From d1affc4340ecb55a8d5251aaab0de7a106bc375c Mon Sep 17 00:00:00 2001 From: Rat Date: Sun, 20 Nov 2011 18:28:18 +0100 Subject: Initial Commit for client version change to 4.2.2 (14545) - added known opcodes (handlers are commented till not updated) - added bitstream support to bytebuffer - updated realm auth for 14545 - updated world auth - fixed char_enum,create,delete handlers - added DB2 reader - added opcode logging to debuglogmask (ignores loglevel) - fixed compile in win64, others not yet tested - using db2 values for item models at char_enum to prevent client crash Lots of Thanks to All SingularityCore Members --- src/server/authserver/Authentication/AuthCodes.h | 2 +- src/server/game/AI/SmartScripts/SmartScriptMgr.h | 1 + src/server/game/DataStores/DB2Stores.cpp | 118 + src/server/game/DataStores/DB2Stores.h | 33 + src/server/game/DataStores/DB2Structure.h | 135 + src/server/game/DataStores/DB2fmt.h | 25 + src/server/game/DataStores/DBCEnums.h | 9 + src/server/game/DataStores/DBCStores.cpp | 16 +- src/server/game/DataStores/DBCStores.h | 6 +- src/server/game/DataStores/DBCStructure.h | 23 +- src/server/game/DataStores/DBCfmt.h | 2 +- src/server/game/Entities/Player/Player.cpp | 436 +++- src/server/game/Entities/Player/Player.h | 28 +- src/server/game/Entities/Unit/Unit.h | 1 + src/server/game/Globals/ObjectMgr.cpp | 6 +- .../Server/Protocol/Handlers/CharacterHandler.cpp | 95 +- .../game/Server/Protocol/Handlers/GroupHandler.cpp | 2 + .../game/Server/Protocol/Handlers/MiscHandler.cpp | 2 +- .../Server/Protocol/Handlers/MovementHandler.cpp | 22 +- src/server/game/Server/Protocol/Opcodes.cpp | 2645 ++++++++++---------- src/server/game/Server/Protocol/Opcodes.h | 2329 ++++++++--------- src/server/game/Server/WorldPacket.h | 53 + src/server/game/Server/WorldSession.cpp | 193 +- src/server/game/Server/WorldSession.h | 1 + src/server/game/Server/WorldSocket.cpp | 225 +- src/server/game/Server/WorldSocket.h | 3 + src/server/game/Spells/Spell.cpp | 1 + src/server/game/World/World.cpp | 5 + src/server/game/World/World.h | 6 +- src/server/scripts/Commands/cs_debug.cpp | 2 +- src/server/scripts/Commands/cs_gm.cpp | 2 +- .../Deadmines/instance_deadmines.cpp | 4 +- .../MagistersTerrace/boss_felblood_kaelthas.cpp | 6 +- .../Outland/TempestKeep/Eye/boss_kaelthas.cpp | 6 +- src/server/shared/DataStores/DB2FileLoader.cpp | 411 +++ src/server/shared/DataStores/DB2FileLoader.h | 106 + src/server/shared/DataStores/DB2Store.h | 141 ++ src/server/shared/DataStores/DBCFileLoader.h | 4 +- src/server/shared/Define.h | 17 + src/server/shared/Logging/Log.cpp | 7 + src/server/shared/Logging/Log.h | 2 + src/server/shared/Packets/ByteBuffer.h | 67 +- src/server/shared/Packets/WorldPacket.h | 52 - src/server/worldserver/worldserver.conf.dist | 1 + 44 files changed, 4168 insertions(+), 3083 deletions(-) create mode 100644 src/server/game/DataStores/DB2Stores.cpp create mode 100644 src/server/game/DataStores/DB2Stores.h create mode 100644 src/server/game/DataStores/DB2Structure.h create mode 100644 src/server/game/DataStores/DB2fmt.h create mode 100644 src/server/game/Server/WorldPacket.h create mode 100644 src/server/shared/DataStores/DB2FileLoader.cpp create mode 100644 src/server/shared/DataStores/DB2FileLoader.h create mode 100644 src/server/shared/DataStores/DB2Store.h delete mode 100755 src/server/shared/Packets/WorldPacket.h (limited to 'src') diff --git a/src/server/authserver/Authentication/AuthCodes.h b/src/server/authserver/Authentication/AuthCodes.h index 11b1b9fb33d..88e2649ce7e 100755 --- a/src/server/authserver/Authentication/AuthCodes.h +++ b/src/server/authserver/Authentication/AuthCodes.h @@ -65,7 +65,7 @@ enum LoginResult LOGIN_LOCKED_ENFORCED = 0x10, }; -#define POST_BC_ACCEPTED_CLIENT_BUILD {12340, 11723, 11403, 11159, 10571, 10505, 10146, 9947, 8606, 0} +#define POST_BC_ACCEPTED_CLIENT_BUILD {14545 ,12340, 11723, 11403, 11159, 10571, 10505, 10146, 9947, 8606, 0} #define PRE_BC_ACCEPTED_CLIENT_BUILD {5875, 6005, 0} enum ExpansionFlags diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index ba986ae310d..b9d4949b75c 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -25,6 +25,7 @@ #include "ConditionMgr.h" #include "CreatureTextMgr.h" #include "Spell.h" +#include "DB2Stores.h" //#include "SmartScript.h" //#include "SmartAI.h" diff --git a/src/server/game/DataStores/DB2Stores.cpp b/src/server/game/DataStores/DB2Stores.cpp new file mode 100644 index 00000000000..7919a3fba16 --- /dev/null +++ b/src/server/game/DataStores/DB2Stores.cpp @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2011 TrintiyCore + * + * 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; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; 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, see . + */ + +#include "DB2Stores.h" + +#include "Logging/Log.h" +#include "SharedDefines.h" +#include "SpellMgr.h" +#include "DB2fmt.h" + +#include + +DB2Storage sItemStore(Itemfmt); +DB2Storage sItemSparseStore (ItemSparsefmt); +DB2Storage sItemExtendedCostStore(ItemExtendedCostEntryfmt); + +typedef std::list StoreProblemList1; + +uint32 DB2FilesCount = 0; + +static bool LoadDB2_assert_print(uint32 fsize,uint32 rsize, const std::string& filename) +{ + sLog->outError("Size of '%s' setted by format string (%u) not equal size of C++ structure (%u).", filename.c_str(), fsize, rsize); + + // ASSERT must fail after function call + return false; +} + +struct LocalDB2Data +{ + LocalDB2Data(LocaleConstant loc) : defaultLocale(loc), availableDb2Locales(0xFFFFFFFF) {} + + LocaleConstant defaultLocale; + + // bitmasks for index of fullLocaleNameList + uint32 availableDb2Locales; +}; + +template +inline void LoadDB2(uint32& availableDb2Locales, StoreProblemList1& errlist, DB2Storage& storage, const std::string& db2_path, const std::string& filename) +{ + // compatibility format and C++ structure sizes + ASSERT(DB2FileLoader::GetFormatRecordSize(storage.GetFormat()) == sizeof(T) || LoadDB2_assert_print(DB2FileLoader::GetFormatRecordSize(storage.GetFormat()), sizeof(T), filename)); + + ++DB2FilesCount; + + std::string db2_filename = db2_path + filename; + if (storage.Load(db2_filename.c_str())) + { + } + else + { + // sort problematic db2 to (1) non compatible and (2) nonexistent + FILE * f = fopen(db2_filename.c_str(), "rb"); + if (f) + { + char buf[100]; + snprintf(buf, 100,"(exist, but have %d fields instead " SIZEFMTD ") Wrong client version DBC file?", storage.GetFieldCount(), strlen(storage.GetFormat())); + errlist.push_back(db2_filename + buf); + fclose(f); + } + else + errlist.push_back(db2_filename); + } +} + +void LoadDB2Stores(const std::string& dataPath) +{ + std::string db2Path = dataPath + "dbc/"; + + StoreProblemList1 bad_db2_files; + uint32 availableDb2Locales = 0xFFFFFFFF; + + LoadDB2(availableDb2Locales, bad_db2_files, sItemStore, db2Path, "Item.db2"); + LoadDB2(availableDb2Locales, bad_db2_files, sItemSparseStore, db2Path, "Item-sparse.db2"); + LoadDB2(availableDb2Locales, bad_db2_files, sItemExtendedCostStore, db2Path, "ItemExtendedCost.db2"); + // error checks + if (bad_db2_files.size() >= DB2FilesCount) + { + sLog->outError("\nIncorrect DataDir value in worldserver.conf or ALL required *.db2 files (%d) not found by path: %sdb2", DB2FilesCount, dataPath.c_str()); + exit(1); + } + else if (!bad_db2_files.empty()) + { + std::string str; + for (std::list::iterator i = bad_db2_files.begin(); i != bad_db2_files.end(); ++i) + str += *i + "\n"; + + sLog->outError("\nSome required *.db2 files (%u from %d) not found or not compatible:\n%s", (uint32)bad_db2_files.size(), DB2FilesCount,str.c_str()); + exit(1); + } + + // Check loaded DB2 files proper version + if (!sItemStore.LookupEntry(72068) || // last item added in 4.2.2 (14545) + !sItemExtendedCostStore.LookupEntry(3652) ) // last item extended cost added in 4.2.2 (14545) + { + sLog->outString(""); + sLog->outError("Please extract correct db2 files from client 4.2.2 14545."); + exit(1); + } + + sLog->outString(">> Initialized %d DB2 data stores.", DB2FilesCount); + sLog->outString(); +} \ No newline at end of file diff --git a/src/server/game/DataStores/DB2Stores.h b/src/server/game/DataStores/DB2Stores.h new file mode 100644 index 00000000000..e60892e05eb --- /dev/null +++ b/src/server/game/DataStores/DB2Stores.h @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2011 TrintiyCore + * + * 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; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; 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, see . + */ + +#ifndef TRINITY_DB2STORES_H +#define TRINITY_DB2STORES_H + +#include "Common.h" +#include "DB2Store.h" +#include "DB2Structure.h" + +#include + +extern DB2Storage sItemStore; +extern DB2Storage sItemSparseStore; +extern DB2Storage sItemExtendedCostStore; + +void LoadDB2Stores(const std::string& dataPath); + +#endif \ No newline at end of file diff --git a/src/server/game/DataStores/DB2Structure.h b/src/server/game/DataStores/DB2Structure.h new file mode 100644 index 00000000000..59dbfc710c3 --- /dev/null +++ b/src/server/game/DataStores/DB2Structure.h @@ -0,0 +1,135 @@ +/* + * Copyright (C) 2011 TrintiyCore + * + * 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; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; 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, see . + */ + +#ifndef TRINITY_DB2STRUCTURE_H +#define TRINITY_DB2STRUCTURE_H + +#include "Common.h" +#include "DBCEnums.h" +#include "Define.h" +#include "Path.h" +#include "Util.h" +#include "Vehicle.h" +#include "SharedDefines.h" + +#include +#include +#include + +// Structures used to access raw DB2 data and required packing to portability +struct ItemEntry +{ + uint32 ID; // 0 + uint32 Class; // 1 + uint32 SubClass; // 2 + int32 Unk0; // 3 + int32 Material; // 4 + uint32 DisplayId; // 5 + uint32 InventoryType; // 6 + uint32 Sheath; // 7 +}; + +struct ItemSparseEntry +{ + uint32 ID; // 0 + uint32 Quality; // 1 + uint32 Flags; // 2 + uint32 Flags2; // 3 + uint32 BuyPrice; // 4 + uint32 SellPrice; // 5 + uint32 InventoryType; // 6 + int32 AllowableClass; // 7 + int32 AllowableRace; // 8 + uint32 ItemLevel; // 9 + int32 RequiredLevel; // 10 + uint32 RequiredSkill; // 11 + uint32 RequiredSkillRank; // 12 + uint32 RequiredSpell; // 13 + uint32 RequiredHonorRank; // 14 + uint32 RequiredCityRank; // 15 + uint32 RequiredReputationFaction; // 16 + uint32 RequiredReputationRank; // 17 + uint32 MaxCount; // 18 + uint32 Stackable; // 19 + uint32 ContainerSlots; // 20 + int32 ItemStatType[MAX_ITEM_PROTO_STATS]; // 21 - 30 + uint32 ItemStatValue[MAX_ITEM_PROTO_STATS]; // 31 - 40 + int32 ItemStatUnk1[MAX_ITEM_PROTO_STATS]; // 41 - 50 + int32 ItemStatUnk2[MAX_ITEM_PROTO_STATS]; // 51 - 60 + uint32 ScalingStatDistribution; // 61 + uint32 DamageType; // 62 + uint32 Delay; // 63 + float RangedModRange; // 64 + int32 SpellId[MAX_ITEM_PROTO_SPELLS]; // 65 - 69 + int32 SpellTrigger[MAX_ITEM_PROTO_SPELLS]; // 70 - 74 + int32 SpellCharges[MAX_ITEM_PROTO_SPELLS]; // 75 - 79 + int32 SpellCooldown[MAX_ITEM_PROTO_SPELLS]; // 80 - 84 + int32 SpellCategory[MAX_ITEM_PROTO_SPELLS]; // 85 - 89 + int32 SpellCategoryCooldown[MAX_ITEM_PROTO_SPELLS]; // 90 - 94 + uint32 Bonding; // 95 + DB2String Name; // 96 + DB2String Name2; // 97 + DB2String Name3; // 98 + DB2String Name4; // 99 + DB2String Description; // 100 + uint32 PageText; // 101 + uint32 LanguageID; // 102 + uint32 PageMaterial; // 103 + uint32 StartQuest; // 104 + uint32 LockID; // 105 + int32 Material; // 106 + uint32 Sheath; // 107 + uint32 RandomProperty; // 108 + uint32 RandomSuffix; // 109 + uint32 ItemSet; // 110 + uint32 MaxDurability; // 111 + uint32 Area; // 112 + uint32 Map; // 113 + uint32 BagFamily; // 114 + uint32 TotemCategory; // 115 + uint32 Color[MAX_ITEM_PROTO_SOCKETS]; // 116 - 118 + uint32 Content[MAX_ITEM_PROTO_SOCKETS]; // 119 - 121 + int32 SocketBonus; // 122 + uint32 GemProperties; // 123 + float ArmorDamageModifier; // 124 + uint32 Duration; // 125 + uint32 ItemLimitCategory; // 126 + uint32 HolidayId; // 127 + float StatScalingFactor; // 128 + int32 Field130; // 129 + int32 Field131; // 130 +}; + +#define MAX_ITEM_EXT_COST_ITEMS 5 +#define MAX_ITEM_EXT_COST_CURRENCIES 5 + +struct ItemExtendedCostEntry +{ + uint32 ID; // 0 extended-cost entry id + //uint32 reqhonorpoints; // 1 required honor points + //uint32 reqarenapoints; // 2 required arena points + uint32 RequiredArenaSlot; // 3 arena slot restrictions (min slot value) + uint32 RequiredItem[MAX_ITEM_EXT_COST_ITEMS]; // 4-8 required item id + uint32 RequiredItemCount[MAX_ITEM_EXT_COST_ITEMS]; // 9-13 required count of 1st item + uint32 RequiredPersonalArenaRating; // 14 required personal arena rating + //uint32 ItemPurchaseGroup; // 15 + uint32 RequiredCurrency[MAX_ITEM_EXT_COST_CURRENCIES];// 16-20 required curency id + uint32 RequiredCurrencyCount[MAX_ITEM_EXT_COST_CURRENCIES];// 21-25 required curency count + //uint32 Unknown[5]; // 26-30 +}; + +#endif \ No newline at end of file diff --git a/src/server/game/DataStores/DB2fmt.h b/src/server/game/DataStores/DB2fmt.h new file mode 100644 index 00000000000..435309cbae4 --- /dev/null +++ b/src/server/game/DataStores/DB2fmt.h @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2011 TrintiyCore + * + * 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; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; 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, see . + */ + +#ifndef TRINITY_DB2SFRM_H +#define TRINITY_DB2SFRM_H + +const char Itemfmt[]="niiiiiii"; +const char ItemSparsefmt[]="niiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiifiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiisssssiiiiiiiiiiiiiiiiiiiiiiifiiifii"; +const char ItemExtendedCostEntryfmt[]="nxxiiiiiiiiiiiixiiiiiiiiiixxxxx"; + +#endif \ No newline at end of file diff --git a/src/server/game/DataStores/DBCEnums.h b/src/server/game/DataStores/DBCEnums.h index dcdc2b2ea0a..80121aa3334 100755 --- a/src/server/game/DataStores/DBCEnums.h +++ b/src/server/game/DataStores/DBCEnums.h @@ -439,4 +439,13 @@ enum VehicleSeatFlagsB VEHICLE_SEAT_FLAG_B_VEHICLE_PLAYERFRAME_UI = 0x80000000, // Lua_UnitHasVehiclePlayerFrameUI - actually checked for flagsb &~ 0x80000000 }; +// CreatureType.dbc +enum CurrencyTypes +{ + CURRENCY_TYPE_CONQUEST_POINTS = 390, + CURRENCY_TYPE_HONOR_POINTS = 392, + CURRENCY_TYPE_JUSTICE_POINTS = 395, + CURRENCY_TYPE_VALOR_POINTS = 396 +}; + #endif diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index faa73cefb11..e13be03965d 100755 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -107,11 +107,11 @@ DBCStorage sGtRegenMPPerSptStore(GtRegenMPPerSptf DBCStorage sHolidaysStore(Holidaysfmt); -DBCStorage sItemStore(Itemfmt); +//DBCStorage sItemStore(Itemfmt); DBCStorage sItemBagFamilyStore(ItemBagFamilyfmt); //DBCStorage sItemCondExtCostsStore(ItemCondExtCostsEntryfmt); //DBCStorage sItemDisplayInfoStore(ItemDisplayTemplateEntryfmt); -- not used currently -DBCStorage sItemExtendedCostStore(ItemExtendedCostEntryfmt); +//DBCStorage sItemExtendedCostStore(ItemExtendedCostEntryfmt); DBCStorage sItemLimitCategoryStore(ItemLimitCategoryEntryfmt); DBCStorage sItemRandomPropertiesStore(ItemRandomPropertiesfmt); DBCStorage sItemRandomSuffixStore(ItemRandomSuffixfmt); @@ -344,11 +344,11 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sHolidaysStore, dbcPath, "Holidays.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sItemStore, dbcPath, "Item.dbc"); +// LoadDBC(availableDbcLocales, bad_dbc_files, sItemStore, dbcPath, "Item.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sItemBagFamilyStore, dbcPath, "ItemBagFamily.dbc"); //LoadDBC(dbcCount, availableDbcLocales, bad_dbc_files, sItemDisplayInfoStore, dbcPath, "ItemDisplayInfo.dbc"); -- not used currently //LoadDBC(dbcCount, availableDbcLocales, bad_dbc_files, sItemCondExtCostsStore, dbcPath, "ItemCondExtCosts.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sItemExtendedCostStore, dbcPath, "ItemExtendedCost.dbc"); +// LoadDBC(availableDbcLocales, bad_dbc_files, sItemExtendedCostStore, dbcPath, "ItemExtendedCost.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sItemLimitCategoryStore, dbcPath, "ItemLimitCategory.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sItemRandomPropertiesStore, dbcPath, "ItemRandomProperties.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sItemRandomSuffixStore, dbcPath, "ItemRandomSuffix.dbc"); @@ -623,8 +623,8 @@ void LoadDBCStores(const std::string& dataPath) if (!sAreaStore.LookupEntry(3617) || // last area (areaflag) added in 3.3.5a !sCharTitlesStore.LookupEntry(177) || // last char title added in 3.3.5a !sGemPropertiesStore.LookupEntry(1629) || // last added spell in 3.3.5a - !sItemStore.LookupEntry(56806) || // last gem property added in 3.3.5a - !sItemExtendedCostStore.LookupEntry(2997) || // last item extended cost added in 3.3.5a + //!sItemStore.LookupEntry(56806) || // last gem property added in 3.3.5a + //!sItemExtendedCostStore.LookupEntry(2997) || // last item extended cost added in 3.3.5a !sMapStore.LookupEntry(724) || // last map added in 3.3.5a !sSpellStore.LookupEntry(80864) ) // last client known item added in 3.3.5a { @@ -632,7 +632,7 @@ void LoadDBCStores(const std::string& dataPath) exit(1); } - sLog->outString(">> Initialized %d data stores in %u ms", DBCFileCount, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(">> Initialized %d DBC data stores in %u ms", DBCFileCount, GetMSTimeDiffToNow(oldMSTime)); sLog->outString(); } @@ -866,7 +866,7 @@ uint32 const* GetTalentTabPages(uint8 cls) DBCStorage const* GetSoundEntriesStore() { return &sSoundEntriesStore; } DBCStorage const* GetSpellRangeStore() { return &sSpellRangeStore; } DBCStorage const* GetFactionStore() { return &sFactionStore; } - DBCStorage const* GetItemDisplayStore() { return &sItemStore; } +// DBCStorage const* GetItemDisplayStore() { return &sItemStore; } DBCStorage const* GetCreatureDisplayStore() { return &sCreatureDisplayInfoStore; } DBCStorage const* GetEmotesStore() { return &sEmotesStore; } DBCStorage const* GetEmotesTextStore() { return &sEmotesTextStore; } diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h index 367746616d1..8bd22a3ab91 100755 --- a/src/server/game/DataStores/DBCStores.h +++ b/src/server/game/DataStores/DBCStores.h @@ -109,10 +109,10 @@ extern DBCStorage sGtOCTRegenHPStore; extern DBCStorage sGtRegenHPPerSptStore; extern DBCStorage sGtRegenMPPerSptStore; extern DBCStorage sHolidaysStore; -extern DBCStorage sItemStore; +//extern DBCStorage sItemStore; extern DBCStorage sItemBagFamilyStore; //extern DBCStorage sItemDisplayInfoStore; -- not used currently -extern DBCStorage sItemExtendedCostStore; +//extern DBCStorage sItemExtendedCostStore; extern DBCStorage sItemLimitCategoryStore; extern DBCStorage sItemRandomPropertiesStore; extern DBCStorage sItemRandomSuffixStore; @@ -176,7 +176,7 @@ void LoadDBCStores(const std::string& dataPath); DBCStorage const* GetSoundEntriesStore(); DBCStorage const* GetSpellRangeStore(); DBCStorage const* GetFactionStore(); - DBCStorage const* GetItemDisplayStore(); +// DBCStorage const* GetItemDisplayStore(); DBCStorage const* GetCreatureDisplayStore(); DBCStorage const* GetEmotesStore(); DBCStorage const* GetEmotesTextStore(); diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index e01acd2e03d..9bc72e31df9 100755 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -783,10 +783,17 @@ struct CurrencyCategoryEntry struct CurrencyTypesEntry { - //uint32 ID; // 0 not used - uint32 ItemId; // 1 used as real index - //uint32 Category; // 2 may be category - uint32 BitIndex; // 3 bit index in PLAYER_FIELD_KNOWN_CURRENCIES (1 << (index-1)) + uint32 ID; // 0 not used + //uint32 Category; // 1 may be category + //DBCString name; // 2 + //DBCString iconName; // 3 + //uint32 unk4; // 4 all 0 + //uint32 unk5; // 5 archaeology-related (?) + //uint32 unk6; // 6 archaeology-related (?) + uint32 TotalCap; // 7 + uint32 WeekCap; // 8 + //int32 unk9; // 9 + //DBCString description; // 10 }; struct DestructibleModelDataEntry @@ -1060,7 +1067,7 @@ struct HolidaysEntry //uint32 flags; // 54 m_flags (0 = Darkmoon Faire, Fishing Contest and Wotlk Launch, rest is 1) }; -struct ItemEntry +/*struct ItemEntry { uint32 ID; // 0 uint32 Class; // 1 @@ -1070,7 +1077,7 @@ struct ItemEntry uint32 DisplayId; // 5 uint32 InventoryType; // 6 uint32 Sheath; // 7 -}; +};*/ struct ItemBagFamilyEntry { @@ -1105,7 +1112,7 @@ struct ItemDisplayInfoEntry #define MAX_ITEM_EXTENDED_COST_REQUIREMENTS 5 -struct ItemExtendedCostEntry +/*struct ItemExtendedCostEntry { uint32 ID; // 0 extended-cost entry id uint32 reqhonorpoints; // 1 required honor points @@ -1114,7 +1121,7 @@ struct ItemExtendedCostEntry uint32 reqitem[MAX_ITEM_EXTENDED_COST_REQUIREMENTS]; // 4-8 required item id uint32 reqitemcount[MAX_ITEM_EXTENDED_COST_REQUIREMENTS]; // 9-14 required count of 1st item uint32 reqpersonalarenarating; // 15 required personal arena rating}; -}; +};*/ struct ItemLimitCategoryEntry { diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index 5d33a3011ab..5a29f5c0c9e 100755 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -42,7 +42,7 @@ const char CreatureDisplayInfofmt[]="nxxxfxxxxxxxxxxx"; const char CreatureFamilyfmt[]="nfifiiiiixssssssssssssssssxx"; const char CreatureSpellDatafmt[]="niiiixxxx"; const char CreatureTypefmt[]="nxxxxxxxxxxxxxxxxxx"; -const char CurrencyTypesfmt[]="xnxi"; +const char CurrencyTypesfmt[]="nxxxxxxiixx";//14545 const char DestructibleModelDatafmt[]="nxxixxxixxxixxxixxx"; const char DungeonEncounterfmt[]="niixissssssssssssssssxx"; const char DurabilityCostsfmt[]="niiiiiiiiiiiiiiiiiiiiiiiiiiiii"; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 9b1b2c34aaa..8ed64e3cdcf 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -74,6 +74,7 @@ #include "InstanceScript.h" #include #include "AccountMgr.h" +#include "DB2Stores.h" #define ZONE_UPDATE_INTERVAL (1*IN_MILLISECONDS) @@ -1851,8 +1852,7 @@ void Player::setDeathState(DeathState s) //clear aura case after resurrection by another way (spells will be applied before next death) SetUInt32Value(PLAYER_SELF_RES_SPELL, 0); } - -bool Player::BuildEnumData(QueryResult result, WorldPacket* data) +bool Player::BuildEnumData(QueryResult result, ByteBuffer* data) { // 0 1 2 3 4 5 6 7 // "SELECT characters.guid, characters.name, characters.race, characters.class, characters.gender, characters.playerBytes, characters.playerBytes2, characters.level, " @@ -1861,63 +1861,87 @@ bool Player::BuildEnumData(QueryResult result, WorldPacket* data) // 15 16 17 18 19 20 21 // "characters.at_login, character_pet.entry, character_pet.modelid, character_pet.level, characters.data, character_banned.guid, character_declinedname.genitive " - Field* fields = result->Fetch(); + Field *fields = result->Fetch(); + + //uint64 GuildGuid = (*result)[13].GetUInt32();//TODO: store as uin64 - uint32 guid = fields[0].GetUInt32(); uint8 plrRace = fields[2].GetUInt8(); uint8 plrClass = fields[3].GetUInt8(); uint8 gender = fields[4].GetUInt8(); - - PlayerInfo const* info = sObjectMgr->GetPlayerInfo(plrRace, plrClass); - if (!info) - { - sLog->outError("Player %u has incorrect race/class pair. Don't build enum.", guid); - return false; - } - else if (!IsValidGender(gender)) + uint8 level = fields[7].GetUInt8(); + uint32 GuidLow = fields[0].GetUInt32(); + uint32 playerBytes = fields[5].GetUInt32(); + uint32 playerFlags = fields[14].GetUInt32(); + uint32 atLoginFlags = fields[15].GetUInt32(); + uint32 zone = fields[8].GetUInt32(); + uint32 petDisplayId = 0; + uint32 petLevel = 0; + uint32 petFamily = 0; + // show pet at selection character in character list only for non-ghost character + if (result && !(playerFlags & PLAYER_FLAGS_GHOST) && (plrClass == CLASS_WARLOCK || plrClass == CLASS_HUNTER || plrClass == CLASS_DEATH_KNIGHT)) { - sLog->outError("Player (%u) has incorrect gender (%hu), don't build enum.", guid, gender); - return false; + uint32 entry = fields[16].GetUInt32(); + CreatureTemplate const* creatureInfo = sObjectMgr->GetCreatureTemplate(entry); + if (creatureInfo) + { + petDisplayId = fields[17].GetUInt32(); + petLevel = fields[18].GetUInt16(); + petFamily = creatureInfo->family; + } } - *data << uint64(MAKE_NEW_GUID(guid, 0, HIGHGUID_PLAYER)); - *data << fields[1].GetString(); // name - *data << uint8(plrRace); // race - *data << uint8(plrClass); // class - *data << uint8(gender); // gender + *data << fields[1].GetString(); // name + *data << uint8(playerBytes >> 8); // face + *data << uint32(fields[9].GetUInt32()); // map - uint32 playerBytes = fields[5].GetUInt32(); - *data << uint8(playerBytes); // skin - *data << uint8(playerBytes >> 8); // face - *data << uint8(playerBytes >> 16); // hair style - *data << uint8(playerBytes >> 24); // hair color + uint8 Guid0 = uint8(GuidLow); + uint8 Guid1 = uint8(GuidLow >> 8); + uint8 Guid2 = uint8(GuidLow >> 16); + uint8 Guid3 = uint8(GuidLow >> 24); - uint32 playerBytes2 = fields[6].GetUInt32(); - *data << uint8(playerBytes2 & 0xFF); // facial hair + if (Guid1) + *data << uint8(Guid1^1); + + //if (uint8(GuildGuid)) + // *data << uint8(GuildGuid^1); - *data << uint8(fields[7].GetUInt8()); // level - *data << uint32(fields[8].GetUInt32()); // zone - *data << uint32(fields[9].GetUInt32()); // map + *data << fields[10].GetFloat(); // x + *data << fields[11].GetFloat(); // y + *data << fields[12].GetFloat(); // z - *data << fields[10].GetFloat(); // x - *data << fields[11].GetFloat(); // y - *data << fields[12].GetFloat(); // z + if (Guid0) + *data << uint8(Guid0^1); - *data << uint32(fields[13].GetUInt32()); // guild id + *data << uint32(zone); // Zone id + *data << uint32(petLevel); // pet level + + if (Guid3) + *data << uint8(Guid3^1); + + //*data << uint8(2); // unk, bit 14 + + uint32 playerBytes2 = fields[6].GetUInt32(); + *data << uint8(playerBytes2 & 0xFF); // facial hair + *data << uint8(playerBytes); // skin + *data << uint8(plrClass); // class + *data << uint32(petFamily); // Pet Family uint32 charFlags = 0; - uint32 playerFlags = fields[14].GetUInt32(); - uint32 atLoginFlags = fields[15].GetUInt32(); if (playerFlags & PLAYER_FLAGS_HIDE_HELM) charFlags |= CHARACTER_FLAG_HIDE_HELM; + if (playerFlags & PLAYER_FLAGS_HIDE_CLOAK) charFlags |= CHARACTER_FLAG_HIDE_CLOAK; + if (playerFlags & PLAYER_FLAGS_GHOST) charFlags |= CHARACTER_FLAG_GHOST; + if (atLoginFlags & AT_LOGIN_RENAME) charFlags |= CHARACTER_FLAG_RENAME; + if (fields[20].GetUInt32()) charFlags |= CHARACTER_FLAG_LOCKED_BY_BILLING; + if (sWorld->getBoolConfig(CONFIG_DECLINED_NAMES_USED)) { if (!fields[21].GetString().empty()) @@ -1926,60 +1950,52 @@ bool Player::BuildEnumData(QueryResult result, WorldPacket* data) else charFlags |= CHARACTER_FLAG_DECLINED; - *data << uint32(charFlags); // character flags - - // character customize flags - if (atLoginFlags & AT_LOGIN_CUSTOMIZE) - *data << uint32(CHAR_CUSTOMIZE_FLAG_CUSTOMIZE); - else if (atLoginFlags & AT_LOGIN_CHANGE_FACTION) - *data << uint32(CHAR_CUSTOMIZE_FLAG_FACTION); - else if (atLoginFlags & AT_LOGIN_CHANGE_RACE) - *data << uint32(CHAR_CUSTOMIZE_FLAG_RACE); - else - *data << uint32(CHAR_CUSTOMIZE_FLAG_NONE); - - // First login - *data << uint8(atLoginFlags & AT_LOGIN_FIRST ? 1 : 0); - - // Pets info - uint32 petDisplayId = 0; - uint32 petLevel = 0; - uint32 petFamily = 0; - - // show pet at selection character in character list only for non-ghost character - if (result && !(playerFlags & PLAYER_FLAGS_GHOST) && (plrClass == CLASS_WARLOCK || plrClass == CLASS_HUNTER || plrClass == CLASS_DEATH_KNIGHT)) - { - uint32 entry = fields[16].GetUInt32(); - CreatureTemplate const* creatureInfo = sObjectMgr->GetCreatureTemplate(entry); - if (creatureInfo) - { - petDisplayId = fields[17].GetUInt32(); - petLevel = fields[18].GetUInt16(); - petFamily = creatureInfo->family; - } - } - - *data << uint32(petDisplayId); - *data << uint32(petLevel); - *data << uint32(petFamily); - + *data << uint32(charFlags); // character flags + + if (Guid2) + *data << uint8(Guid2^1); + + *data << uint32(petDisplayId); // Pet DisplayID + + //if (uint8(GuildGuid >> 56)) + // *data << uint8(GuildGuid^1 >> 56); + + *data << uint8(level); // Level + *data << uint8(playerBytes >> 16); // Hair style + + //if (uint8(GuildGuid >> 16)) + // *data << uint8(GuildGuid^1 >> 16); + + *data << uint8(plrRace); // Race + *data << uint8(playerBytes >> 24); // Hair color + + //if (uint8(GuildGuid >> 48)) + // *data << uint8(GuildGuid^1 >> 48); + + *data << uint8(gender); // Gender + + //if (uint8(GuildGuid >> 24)) + // *data << uint8(GuildGuid^1 >> 24); + + *data << uint8(0); // character order id (used for char list positioning) TODO: implement + Tokens equipment(fields[19].GetString(), ' '); - for (uint8 slot = 0; slot < INVENTORY_SLOT_BAG_END; ++slot) + for (uint8 slot = 0; slot < EQUIPMENT_SLOT_END; ++slot) { - uint32 visualBase = slot * 2; - uint32 itemId = GetUInt32ValueFromArray(equipment, visualBase); + uint32 visualbase = slot * 2; + uint32 itemId = GetUInt32ValueFromArray(equipment, visualbase); ItemTemplate const* proto = sObjectMgr->GetItemTemplate(itemId); - if (!proto) + ItemEntry const *db2Item = sItemStore.LookupEntry(itemId); // Use Item.db2.DisplayID for Char Enum + if (!proto || !db2Item) { *data << uint32(0); *data << uint8(0); *data << uint32(0); continue; } - - SpellItemEnchantmentEntry const* enchant = NULL; - - uint32 enchants = GetUInt32ValueFromArray(equipment, visualBase + 1); + + SpellItemEnchantmentEntry const *enchant = NULL; + uint32 enchants = GetUInt32ValueFromArray(equipment, visualbase + 1); for (uint8 enchantSlot = PERM_ENCHANTMENT_SLOT; enchantSlot <= TEMP_ENCHANTMENT_SLOT; ++enchantSlot) { // values stored in 2 uint16 @@ -1991,12 +2007,36 @@ bool Player::BuildEnumData(QueryResult result, WorldPacket* data) if (enchant) break; } - - *data << uint32(proto->DisplayInfoID); - *data << uint8(proto->InventoryType); + sLog->outError("entry %u aura %u invtype %u display %u", itemId, enchant ? enchant->aura_id : uint32(0), proto->InventoryType,db2Item->DisplayId); *data << uint32(enchant ? enchant->aura_id : 0); + *data << uint8(proto->InventoryType); + *data << uint32(db2Item->DisplayId); } + // Bags (not supported) TODO: implement + for (uint32 i = 0; i < 4; ++i) + { + *data << uint32(0); // enchant + *data << uint8(0); // invtype + *data << uint32(0); // displayid + } + + // character customize flags + if (atLoginFlags & AT_LOGIN_CUSTOMIZE) + *data << uint32(CHAR_CUSTOMIZE_FLAG_CUSTOMIZE); + + else if (atLoginFlags & AT_LOGIN_CHANGE_FACTION) + *data << uint32(CHAR_CUSTOMIZE_FLAG_FACTION); + + else if (atLoginFlags & AT_LOGIN_CHANGE_RACE) + *data << uint32(CHAR_CUSTOMIZE_FLAG_RACE); + + else + *data << uint32(CHAR_CUSTOMIZE_FLAG_NONE); + + //if (uint8(GuildGuid >> 8)) + // *data << uint8(GuildGuid^1 >> 8); + return true; } @@ -7244,6 +7284,154 @@ bool Player::RewardHonor(Unit* uVictim, uint32 groupsize, int32 honor, bool pvpt return true; } + +void Player::SendCurrencies() const +{ + WorldPacket packet(SMSG_INIT_CURRENCY, 4 + m_currencies.size()*(5*4 + 1)); + packet << uint32(m_currencies.size()); + + for (PlayerCurrenciesMap::const_iterator itr = m_currencies.begin(); itr != m_currencies.end(); ++itr) + { + const CurrencyTypesEntry* entry = sCurrencyTypesStore.LookupEntry(itr->first); + packet << uint32(itr->second.weekCount / PLAYER_CURRENCY_PRECISION); + packet << uint8(0); // unknown + packet << uint32(entry->ID); + packet << uint32(sWorld->GetNextWeeklyQuestsResetTime() - 1*WEEK); + packet << uint32(_GetCurrencyWeekCap(entry) / PLAYER_CURRENCY_PRECISION); + packet << uint32(itr->second.totalCount / PLAYER_CURRENCY_PRECISION); + } + + GetSession()->SendPacket(&packet); +} + +uint32 Player::GetCurrency(uint32 id) const +{ + PlayerCurrenciesMap::const_iterator itr = m_currencies.find(id); + return itr != m_currencies.end() ? itr->second.totalCount : 0; +} + +bool Player::HasCurrency(uint32 id, uint32 count) const +{ + PlayerCurrenciesMap::const_iterator itr = m_currencies.find(id); + return itr != m_currencies.end() && itr->second.totalCount >= count; +} + +void Player::ModifyCurrency(uint32 id, int32 count) +{ + if (!count) + return; + + const CurrencyTypesEntry* currency = sCurrencyTypesStore.LookupEntry(id); + ASSERT(currency); + + uint32 oldTotalCount = 0; + uint32 oldWeekCount = 0; + PlayerCurrenciesMap::iterator itr = m_currencies.find(id); + if (itr == m_currencies.end()) + { + PlayerCurrency cur; + cur.state = PLAYERCURRENCY_NEW; + cur.totalCount = 0; + cur.weekCount = 0; + m_currencies[id] = cur; + itr = m_currencies.find(id); + } + else + { + oldTotalCount = itr->second.totalCount; + oldWeekCount = itr->second.weekCount; + } + + int32 newTotalCount = int32(oldTotalCount) + count; + if (newTotalCount < 0) + newTotalCount = 0; + + int32 newWeekCount = int32(oldWeekCount) + (count > 0 ? count : 0); + if (newWeekCount < 0) + newWeekCount = 0; + + if (currency->TotalCap && int32(currency->TotalCap) < newTotalCount) + { + int32 delta = newTotalCount - int32(currency->TotalCap); + newTotalCount = int32(currency->TotalCap); + newWeekCount -= delta; + } + + // TODO: fix conquest points + uint32 weekCap = _GetCurrencyWeekCap(currency); + if (weekCap && int32(weekCap) < newTotalCount) + { + int32 delta = newWeekCount - int32(weekCap); + newWeekCount = int32(weekCap); + newTotalCount -= delta; + } + + // if we change total, we must change week + ASSERT(((newTotalCount-oldTotalCount) != 0) == ((newWeekCount-oldWeekCount) != 0)); + + if (newTotalCount != oldTotalCount) + { + if(itr->second.state != PLAYERCURRENCY_NEW) + itr->second.state = PLAYERCURRENCY_CHANGED; + + itr->second.totalCount = newTotalCount; + itr->second.weekCount = newWeekCount; + + // probably excessive checks + if (IsInWorld() && !GetSession()->PlayerLoading()) + { + WorldPacket packet(SMSG_UPDATE_CURRENCY, 12); + packet << uint32(id); + packet << uint32(weekCap ? (newWeekCount / PLAYER_CURRENCY_PRECISION) : 0); + packet << uint32(newTotalCount / PLAYER_CURRENCY_PRECISION); + GetSession()->SendPacket(&packet); + } + } +} + +void Player::SetCurrency(uint32 id, uint32 count) +{ + ModifyCurrency(id, int32(count) - GetCurrency(id)); +} + +uint32 Player::_GetCurrencyWeekCap(const CurrencyTypesEntry* currency) const +{ + uint32 cap = currency->WeekCap; + switch (currency->ID) + { + case CURRENCY_TYPE_CONQUEST_POINTS: + { + // TODO: implement + cap = 0; + break; + } + case CURRENCY_TYPE_HONOR_POINTS: + { + uint32 honorcap = sWorld->getIntConfig(CONFIG_MAX_HONOR_POINTS); + if (honorcap > 0) + cap = honorcap; + break; + } + case CURRENCY_TYPE_JUSTICE_POINTS: + { + uint32 justicecap = sWorld->getIntConfig(CONFIG_MAX_JUSTICE_POINTS); + if (justicecap > 0) + cap = justicecap; + break; + } + } + + if (cap != currency->WeekCap && IsInWorld() && !GetSession()->PlayerLoading()) + { + WorldPacket packet(SMSG_UPDATE_CURRENCY_WEEK_LIMIT, 8); + packet << uint32(cap / PLAYER_CURRENCY_PRECISION); + packet << uint32(currency->ID); + GetSession()->SendPacket(&packet); + } + + return cap; +} + void Player::SetHonorPoints(uint32 value) { if (value > sWorld->getIntConfig(CONFIG_MAX_HONOR_POINTS)) @@ -19698,7 +19886,7 @@ void Player::AddSpellMod(SpellModifier* mod, bool apply) val += (*itr)->value; } val += apply ? mod->value : -(mod->value); - WorldPacket data(Opcode, (1+1+4)); + WorldPacket data(Opcodes(Opcode), (1+1+4)); data << uint8(eff); data << uint8(mod->op); data << int32(val); @@ -20324,7 +20512,7 @@ void Player::InitDisplayIds() } } -inline bool Player::_StoreOrEquipNewItem(uint32 vendorslot, uint32 item, uint8 count, uint8 bag, uint8 slot, int32 price, ItemTemplate const* pProto, Creature* pVendor, VendorItem const* crItem, bool bStore) +inline bool Player::_StoreOrEquipNewItem(uint32 vendorslot, uint32 item, uint8 count, uint8 bag, uint8 slot, int32 price, ItemTemplate const *pProto, Creature *pVendor, VendorItem const* crItem, bool bStore) { ItemPosCountVec vDest; uint16 uiDest = 0; @@ -20339,19 +20527,19 @@ inline bool Player::_StoreOrEquipNewItem(uint32 vendorslot, uint32 item, uint8 c ModifyMoney(-price); - if (crItem->ExtendedCost) // case for new honor system + if (crItem->ExtendedCost) // case for new honor system { ItemExtendedCostEntry const* iece = sItemExtendedCostStore.LookupEntry(crItem->ExtendedCost); - if (iece->reqhonorpoints) - ModifyHonorPoints(- int32(iece->reqhonorpoints * count)); - - if (iece->reqarenapoints) - ModifyArenaPoints(- int32(iece->reqarenapoints * count)); + for (int i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i) + { + if (iece->RequiredItem[i]) + DestroyItemCount(iece->RequiredItem[i], iece->RequiredItem[i], true); + } - for (uint8 i = 0; i < MAX_ITEM_EXTENDED_COST_REQUIREMENTS; ++i) + for (int i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i) { - if (iece->reqitem[i]) - DestroyItemCount(iece->reqitem[i], (iece->reqitemcount[i] * count), true); + if (iece->RequiredCurrency[i]) + ModifyCurrency(iece->RequiredCurrency[i], -int32(iece->RequiredCurrencyCount[i])); } } @@ -20460,24 +20648,10 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32 return false; } - // honor points price - if (GetHonorPoints() < (iece->reqhonorpoints * count)) - { - SendEquipError(EQUIP_ERR_NOT_ENOUGH_HONOR_POINTS, NULL, NULL); - return false; - } - - // arena points price - if (GetArenaPoints() < (iece->reqarenapoints * count)) - { - SendEquipError(EQUIP_ERR_NOT_ENOUGH_ARENA_POINTS, NULL, NULL); - return false; - } - // item base price - for (uint8 i = 0; i < MAX_ITEM_EXTENDED_COST_REQUIREMENTS; ++i) + for (uint8 i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i) { - if (iece->reqitem[i] && !HasItemCount(iece->reqitem[i], (iece->reqitemcount[i] * count))) + if (iece->RequiredItem[i] && !HasItemCount(iece->RequiredItem[i], (iece->RequiredItemCount[i] * count))) { SendEquipError(EQUIP_ERR_VENDOR_MISSING_TURNINS, NULL, NULL); return false; @@ -20485,7 +20659,7 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32 } // check for personal arena rating requirement - if (GetMaxPersonalArenaRatingRequirement(iece->reqarenaslot) < iece->reqpersonalarenarating) + if (GetMaxPersonalArenaRatingRequirement(iece->RequiredArenaSlot) < iece->RequiredPersonalArenaRating) { // probably not the proper equip err SendEquipError(EQUIP_ERR_CANT_EQUIP_RANK, NULL, NULL); @@ -23755,7 +23929,7 @@ void Player::LearnPetTalent(uint64 petGuid, uint32 talentId, uint32 talentRank) void Player::AddKnownCurrency(uint32 itemId) { if (CurrencyTypesEntry const* ctEntry = sCurrencyTypesStore.LookupEntry(itemId)) - SetFlag64(PLAYER_FIELD_KNOWN_CURRENCIES, (1LL << (ctEntry->BitIndex-1))); + SetFlag64(0, (1LL << (ctEntry->ID-1))); } void Player::UpdateFallInformationIfNeed(MovementInfo const& minfo, uint16 opcode) @@ -24491,7 +24665,7 @@ void Player::DeleteRefundReference(uint32 it) } } -void Player::SendRefundInfo(Item* item) +void Player::SendRefundInfo(Item *item) { // This function call unsets ITEM_FLAGS_REFUNDABLE if played time is over 2 hours. item->UpdatePlayedTime(this); @@ -24518,13 +24692,11 @@ void Player::SendRefundInfo(Item* item) WorldPacket data(SMSG_ITEM_REFUND_INFO_RESPONSE, 8+4+4+4+4*4+4*4+4+4); data << uint64(item->GetGUID()); // item guid - data << uint32(item->GetPaidMoney()); // money cost - data << uint32(iece->reqhonorpoints); // honor point cost - data << uint32(iece->reqarenapoints); // arena point cost - for (uint8 i = 0; i < MAX_ITEM_EXTENDED_COST_REQUIREMENTS; ++i) // item cost data + data << uint32(item->GetPaidMoney()); // money cost + for (uint8 i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i) // item cost data { - data << uint32(iece->reqitem[i]); - data << uint32(iece->reqitemcount[i]); + data << uint32(iece->RequiredItem[i]); + data << uint32(iece->RequiredItemCount[i]); } data << uint32(0); data << uint32(GetTotalPlayedTime() - item->GetPlayedTime()); @@ -24589,8 +24761,8 @@ void Player::RefundItem(Item* item) bool store_error = false; for (uint8 i = 0; i < MAX_ITEM_EXTENDED_COST_REQUIREMENTS; ++i) { - uint32 count = iece->reqitemcount[i]; - uint32 itemid = iece->reqitem[i]; + uint32 count = iece->RequiredItemCount[i]; + uint32 itemid = iece->RequiredItem[i]; if (count && itemid) { @@ -24617,12 +24789,10 @@ void Player::RefundItem(Item* item) data << uint64(item->GetGUID()); // item guid data << uint32(0); // 0, or error code data << uint32(item->GetPaidMoney()); // money cost - data << uint32(iece->reqhonorpoints); // honor point cost - data << uint32(iece->reqarenapoints); // arena point cost - for (uint8 i = 0; i < MAX_ITEM_EXTENDED_COST_REQUIREMENTS; ++i) // item cost data + for (uint8 i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i) // item cost data { - data << uint32(iece->reqitem[i]); - data << uint32(iece->reqitemcount[i]); + data << uint32(iece->RequiredItem[i]); + data << uint32(iece->RequiredItemCount[i]); } GetSession()->SendPacket(&data); @@ -24638,10 +24808,10 @@ void Player::RefundItem(Item* item) DestroyItem(item->GetBagSlot(), item->GetSlot(), true); // Grant back extendedcost items - for (uint8 i = 0; i < MAX_ITEM_EXTENDED_COST_REQUIREMENTS; ++i) + for (uint8 i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i) { - uint32 count = iece->reqitemcount[i]; - uint32 itemid = iece->reqitem[i]; + uint32 count = iece->RequiredItemCount[i]; + uint32 itemid = iece->RequiredItem[i]; if (count && itemid) { ItemPosCountVec dest; @@ -24657,12 +24827,12 @@ void Player::RefundItem(Item* item) ModifyMoney(moneyRefund); // Saved in SaveInventoryAndGoldToDB // Grant back Honor points - if (uint32 honorRefund = iece->reqhonorpoints) - ModifyHonorPoints(honorRefund, &trans); + //if (uint32 honorRefund = iece->reqhonorpoints) + // ModifyHonorPoints(honorRefund, &trans); // Grant back Arena points - if (uint32 arenaRefund = iece->reqarenapoints) - ModifyArenaPoints(arenaRefund, &trans); + //if (uint32 arenaRefund = iece->reqarenapoints) + // ModifyArenaPoints(arenaRefund, &trans); SaveInventoryAndGoldToDB(trans); diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index bb39d902ae7..fd5a52e085b 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -124,9 +124,26 @@ struct SpellModifier Aura* const ownerAura; }; +enum PlayerCurrencyState +{ + PLAYERCURRENCY_UNCHANGED = 0, + PLAYERCURRENCY_CHANGED = 1, + PLAYERCURRENCY_NEW = 2, + PLAYERCURRENCY_REMOVED = 3 +}; + +struct PlayerCurrency +{ + PlayerCurrencyState state; + uint32 totalCount; + uint32 weekCount; +}; + typedef UNORDERED_MAP PlayerTalentMap; typedef UNORDERED_MAP PlayerSpellMap; typedef std::list SpellModList; +typedef UNORDERED_MAP PlayerCurrenciesMap; +#define PLAYER_CURRENCY_PRECISION 100 typedef std::list WhisperListContainer; @@ -1114,7 +1131,7 @@ class Player : public Unit, public GridObject void Update(uint32 time); - static bool BuildEnumData(QueryResult result, WorldPacket* data); + static bool BuildEnumData(QueryResult result, ByteBuffer* data); void SetInWater(bool apply); @@ -1296,6 +1313,12 @@ class Player : public Unit, public GridObject void AddRefundReference(uint32 it); void DeleteRefundReference(uint32 it); + void SendCurrencies() const; + uint32 GetCurrency(uint32 id) const; + bool HasCurrency(uint32 id, uint32 count) const; + void SetCurrency(uint32 id, uint32 count); + void ModifyCurrency(uint32 id, int32 count); + void ApplyEquipCooldown(Item* pItem); void SetAmmo(uint32 item); void RemoveAmmo(); @@ -2613,6 +2636,9 @@ class Player : public Unit, public GridObject Item* m_items[PLAYER_SLOTS_COUNT]; uint32 m_currentBuybackSlot; + PlayerCurrenciesMap m_currencies; + uint32 _GetCurrencyWeekCap(const CurrencyTypesEntry* currency) const; + std::vector m_itemUpdateQueue; bool m_itemUpdateQueueBlocked; diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 5906a7f3a2b..ff2a4e0ccd1 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -35,6 +35,7 @@ #include "SpellInfo.h" #include "Path.h" #include "WorldPacket.h" +#include "WorldSession.h" #include "Timer.h" #include diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 287ce288a88..7261d81bafa 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -45,6 +45,8 @@ #include "ScriptMgr.h" #include "SpellScript.h" #include "PoolMgr.h" +#include "DB2Structure.h" +#include "DB2Stores.h" ScriptMapMap sQuestEndScripts; ScriptMapMap sQuestStartScripts; @@ -2253,7 +2255,7 @@ void ObjectMgr::LoadItemTemplates() // Checks - ItemEntry const* dbcitem = sItemStore.LookupEntry(entry); + /*ItemEntry const* dbcitem = sItemStore.LookupEntry(entry); if (dbcitem) { @@ -2297,7 +2299,7 @@ void ObjectMgr::LoadItemTemplates() } else - sLog->outErrorDb("Item (Entry: %u) does not exist in item.dbc! (not correct id?).", entry); + sLog->outErrorDb("Item (Entry: %u) does not exist in item.dbc! (not correct id?).", entry);*/ if (itemTemplate.Class >= MAX_ITEM_CLASS) { diff --git a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp index 512cccb9bc9..c2b90041c4c 100755 --- a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp @@ -198,29 +198,100 @@ bool LoginQueryHolder::Initialize() void WorldSession::HandleCharEnum(QueryResult result) { - WorldPacket data(SMSG_CHAR_ENUM, 100); // we guess size + WorldPacket data(SMSG_CHAR_ENUM, 270); - uint8 num = 0; + data << uint8(0x80); // 0 causes the client to free memory of charlist + data << uint32(0); // number of characters + data << uint32(0); // unk loop counter - data << num; - - _allowedCharsToLogin.clear(); if (result) { + typedef std::pair Guids; + std::vector guidsVect; + ByteBuffer buffer; + _allowedCharsToLogin.clear(); + do { - uint32 guidlow = (*result)[0].GetUInt32(); - sLog->outDetail("Loading char guid %u from account %u.", guidlow, GetAccountId()); - if (Player::BuildEnumData(result, &data)) + uint32 GuidLow = (*result)[0].GetUInt32(); + uint64 GuildGuid = (*result)[13].GetUInt32();//TODO: store as uin64 + + guidsVect.push_back(std::make_pair(GuidLow, GuildGuid)); + + sLog->outDetail("Loading char guid %u from account %u.", GuidLow, GetAccountId()); + + if (!Player::BuildEnumData(result, &buffer)) { - _allowedCharsToLogin.insert(guidlow); - ++num; + sLog->outError("Building enum data for SMSG_CHAR_ENUM has failed, aborting"); + return; } + _allowedCharsToLogin.insert(GuidLow); } while (result->NextRow()); - } - data.put(0, num); + for (std::vector::iterator itr = guidsVect.begin(); itr != guidsVect.end(); ++itr) + { + uint32 GuidLow = (*itr).first; + uint64 GuildGuid = (*itr).second; + + uint8 Guid0 = uint8(GuidLow); + uint8 Guid1 = uint8(GuidLow >> 8); + uint8 Guid2 = uint8(GuidLow >> 16); + uint8 Guid3 = uint8(GuidLow >> 24); + + for (uint8 i = 0; i < 17; ++i) + { + switch(i) + { + //case 14: + // data.writeBit(1);//unk + // break; + case 11: data.writeBit(Guid0 ? 1 : 0); break; + case 12: data.writeBit(Guid1 ? 1 : 0); break; + case 9: data.writeBit(Guid2 ? 1 : 0); break; + case 8: data.writeBit(Guid3 ? 1 : 0); break; + /*case 15: + if(uint8(GuildGuid)) + data.writeBit(1); + break; + case 4: + if(uint8(GuildGuid >> 8)) + data.writeBit(1); + break; + case 13: + if(uint8(GuildGuid >> 16)) + data.writeBit(1); + break; + case 2: + if(uint8(GuildGuid >> 24)) + data.writeBit(1); + break;*/ + /*case 0: + if(uint8(GuildGuid >> 32)) + data.writeBit(1); + break; + case 0: + if(uint8(GuildGuid >> 40)) + data.writeBit(1); + break;*/ + /*case 5: + if(uint8(GuildGuid >> 48)) + data.writeBit(1); + break; + case 3: + if(uint8(GuildGuid >> 56)) + data.writeBit(1); + break;*/ + default: + data.writeBit(0); + break; + } + } + } + data.flushBits(); + data.append(buffer); + data.put(1, guidsVect.size()); + } SendPacket(&data); } diff --git a/src/server/game/Server/Protocol/Handlers/GroupHandler.cpp b/src/server/game/Server/Protocol/Handlers/GroupHandler.cpp index 65865280459..682c5f8ab9a 100755 --- a/src/server/game/Server/Protocol/Handlers/GroupHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/GroupHandler.cpp @@ -31,6 +31,8 @@ #include "Util.h" #include "SpellAuras.h" #include "Vehicle.h" +#include "DB2Structure.h" +#include "DB2Stores.h" class Aura; diff --git a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp b/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp index 7327cdbba65..bf40b048151 100755 --- a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp @@ -1227,7 +1227,7 @@ void WorldSession::HandleInspectHonorStatsOpcode(WorldPacket& recv_data) return; } - WorldPacket data(MSG_INSPECT_HONOR_STATS, 8+1+4*4); + WorldPacket data(SMSG_INSPECT_HONOR_STATS, 8+1+4*4); data << uint64(player->GetGUID()); data << uint8(player->GetHonorPoints()); data << uint32(player->GetUInt32Value(PLAYER_FIELD_KILLS)); diff --git a/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp b/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp index 90368ae3011..500a232b603 100755 --- a/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp @@ -340,7 +340,7 @@ void WorldSession::HandleMovementOpcodes(WorldPacket & recv_data) /*----------------------*/ /* process position-change */ - WorldPacket data(opcode, recv_data.size()); + WorldPacket data(Opcodes(opcode), recv_data.size()); movementInfo.time = getMSTime(); movementInfo.guid = mover->GetGUID(); WriteMovementInfo(&data, &movementInfo); @@ -387,7 +387,7 @@ void WorldSession::HandleMovementOpcodes(WorldPacket & recv_data) void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recv_data) { uint32 opcode = recv_data.GetOpcode(); - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd %s (%u, 0x%X) opcode", LookupOpcodeName(opcode), opcode, opcode); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd %s (%u, 0x%X) opcode", LookupOpcodeName(Opcodes(opcode)), opcode, opcode); /* extract packet */ uint64 guid; @@ -423,15 +423,15 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recv_data) switch (opcode) { - case CMSG_FORCE_WALK_SPEED_CHANGE_ACK: move_type = MOVE_WALK; force_move_type = MOVE_WALK; break; - case CMSG_FORCE_RUN_SPEED_CHANGE_ACK: move_type = MOVE_RUN; force_move_type = MOVE_RUN; break; - case CMSG_FORCE_RUN_BACK_SPEED_CHANGE_ACK: move_type = MOVE_RUN_BACK; force_move_type = MOVE_RUN_BACK; break; - case CMSG_FORCE_SWIM_SPEED_CHANGE_ACK: move_type = MOVE_SWIM; force_move_type = MOVE_SWIM; break; - case CMSG_FORCE_SWIM_BACK_SPEED_CHANGE_ACK: move_type = MOVE_SWIM_BACK; force_move_type = MOVE_SWIM_BACK; break; - case CMSG_FORCE_TURN_RATE_CHANGE_ACK: move_type = MOVE_TURN_RATE; force_move_type = MOVE_TURN_RATE; break; - case CMSG_FORCE_FLIGHT_SPEED_CHANGE_ACK: move_type = MOVE_FLIGHT; force_move_type = MOVE_FLIGHT; break; - case CMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK: move_type = MOVE_FLIGHT_BACK; force_move_type = MOVE_FLIGHT_BACK; break; - case CMSG_FORCE_PITCH_RATE_CHANGE_ACK: move_type = MOVE_PITCH_RATE; force_move_type = MOVE_PITCH_RATE; break; + //case CMSG_FORCE_WALK_SPEED_CHANGE_ACK: move_type = MOVE_WALK; force_move_type = MOVE_WALK; break; + //case CMSG_FORCE_RUN_SPEED_CHANGE_ACK: move_type = MOVE_RUN; force_move_type = MOVE_RUN; break; + //case CMSG_FORCE_RUN_BACK_SPEED_CHANGE_ACK: move_type = MOVE_RUN_BACK; force_move_type = MOVE_RUN_BACK; break; + //case CMSG_FORCE_SWIM_SPEED_CHANGE_ACK: move_type = MOVE_SWIM; force_move_type = MOVE_SWIM; break; + //case CMSG_FORCE_SWIM_BACK_SPEED_CHANGE_ACK: move_type = MOVE_SWIM_BACK; force_move_type = MOVE_SWIM_BACK; break; + //case CMSG_FORCE_TURN_RATE_CHANGE_ACK: move_type = MOVE_TURN_RATE; force_move_type = MOVE_TURN_RATE; break; + //case CMSG_FORCE_FLIGHT_SPEED_CHANGE_ACK: move_type = MOVE_FLIGHT; force_move_type = MOVE_FLIGHT; break; + //case CMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK: move_type = MOVE_FLIGHT_BACK; force_move_type = MOVE_FLIGHT_BACK; break; + //case CMSG_FORCE_PITCH_RATE_CHANGE_ACK: move_type = MOVE_PITCH_RATE; force_move_type = MOVE_PITCH_RATE; break; default: sLog->outError("WorldSession::HandleForceSpeedChangeAck: Unknown move type opcode: %u", opcode); return; diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index df7816f7cb9..44ac7e3b6bd 100755 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -21,1320 +21,1339 @@ */ #include "Opcodes.h" -#include "WorldSession.h" +//#include "WorldSession.h" + +OpcodeHandler* opcodeTable[NUM_OPCODE_HANDLERS] = { }; /// Correspondence between opcodes and their names -OpcodeHandler opcodeTable[NUM_MSG_TYPES] = +void InitOpcodes() { - /*0x000*/ { "MSG_NULL_ACTION", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x001*/ { "CMSG_BOOTME", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x002*/ { "CMSG_DBLOOKUP", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x003*/ { "SMSG_DBLOOKUP", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x004*/ { "CMSG_QUERY_OBJECT_POSITION", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x005*/ { "SMSG_QUERY_OBJECT_POSITION", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x006*/ { "CMSG_QUERY_OBJECT_ROTATION", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x007*/ { "SMSG_QUERY_OBJECT_ROTATION", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x008*/ { "CMSG_WORLD_TELEPORT", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWorldTeleportOpcode }, - /*0x009*/ { "CMSG_TELEPORT_TO_UNIT", STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x00A*/ { "CMSG_ZONE_MAP", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x00B*/ { "SMSG_ZONE_MAP", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x00C*/ { "CMSG_DEBUG_CHANGECELLZONE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x00D*/ { "CMSG_MOVE_CHARACTER_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x00E*/ { "SMSG_MOVE_CHARACTER_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x00F*/ { "CMSG_RECHARGE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x010*/ { "CMSG_LEARN_SPELL", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x011*/ { "CMSG_CREATEMONSTER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x012*/ { "CMSG_DESTROYMONSTER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x013*/ { "CMSG_CREATEITEM", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x014*/ { "CMSG_CREATEGAMEOBJECT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x015*/ { "SMSG_CHECK_FOR_BOTS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x016*/ { "CMSG_MAKEMONSTERATTACKGUID", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x017*/ { "CMSG_BOT_DETECTED2", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x018*/ { "CMSG_FORCEACTION", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x019*/ { "CMSG_FORCEACTIONONOTHER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x01A*/ { "CMSG_FORCEACTIONSHOW", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x01B*/ { "SMSG_FORCEACTIONSHOW", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x01C*/ { "CMSG_PETGODMODE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x01D*/ { "SMSG_PETGODMODE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x01E*/ { "SMSG_REFER_A_FRIEND_EXPIRED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x01F*/ { "CMSG_WEATHER_SPEED_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x020*/ { "CMSG_UNDRESSPLAYER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x021*/ { "CMSG_BEASTMASTER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x022*/ { "CMSG_GODMODE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x023*/ { "SMSG_GODMODE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x024*/ { "CMSG_CHEAT_SETMONEY", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x025*/ { "CMSG_LEVEL_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x026*/ { "CMSG_PET_LEVEL_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x027*/ { "CMSG_SET_WORLDSTATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x028*/ { "CMSG_COOLDOWN_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x029*/ { "CMSG_USE_SKILL_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x02A*/ { "CMSG_FLAG_QUEST", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x02B*/ { "CMSG_FLAG_QUEST_FINISH", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x02C*/ { "CMSG_CLEAR_QUEST", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x02D*/ { "CMSG_SEND_EVENT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x02E*/ { "CMSG_DEBUG_AISTATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x02F*/ { "SMSG_DEBUG_AISTATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x030*/ { "CMSG_DISABLE_PVP_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x031*/ { "CMSG_ADVANCE_SPAWN_TIME", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x032*/ { "SMSG_DESTRUCTIBLE_BUILDING_DAMAGE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x033*/ { "CMSG_AUTH_SRP6_BEGIN", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x034*/ { "CMSG_AUTH_SRP6_PROOF", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x035*/ { "CMSG_AUTH_SRP6_RECODE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x036*/ { "CMSG_CHAR_CREATE", STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharCreateOpcode }, - /*0x037*/ { "CMSG_CHAR_ENUM", STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharEnumOpcode }, - /*0x038*/ { "CMSG_CHAR_DELETE", STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharDeleteOpcode }, - /*0x039*/ { "SMSG_AUTH_SRP6_RESPONSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x03A*/ { "SMSG_CHAR_CREATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x03B*/ { "SMSG_CHAR_ENUM", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x03C*/ { "SMSG_CHAR_DELETE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x03D*/ { "CMSG_PLAYER_LOGIN", STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayerLoginOpcode }, - /*0x03E*/ { "SMSG_NEW_WORLD", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x03F*/ { "SMSG_TRANSFER_PENDING", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x040*/ { "SMSG_TRANSFER_ABORTED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x041*/ { "SMSG_CHARACTER_LOGIN_FAILED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x042*/ { "SMSG_LOGIN_SETTIMESPEED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x043*/ { "SMSG_GAMETIME_UPDATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x044*/ { "CMSG_GAMETIME_SET", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x045*/ { "SMSG_GAMETIME_SET", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x046*/ { "CMSG_GAMESPEED_SET", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x047*/ { "SMSG_GAMESPEED_SET", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x048*/ { "CMSG_SERVERTIME", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x049*/ { "SMSG_SERVERTIME", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x04A*/ { "CMSG_PLAYER_LOGOUT", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayerLogoutOpcode }, - /*0x04B*/ { "CMSG_LOGOUT_REQUEST", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLogoutRequestOpcode }, - /*0x04C*/ { "SMSG_LOGOUT_RESPONSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x04D*/ { "SMSG_LOGOUT_COMPLETE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x04E*/ { "CMSG_LOGOUT_CANCEL", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLogoutCancelOpcode }, - /*0x04F*/ { "SMSG_LOGOUT_CANCEL_ACK", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x050*/ { "CMSG_NAME_QUERY", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNameQueryOpcode }, - /*0x051*/ { "SMSG_NAME_QUERY_RESPONSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x052*/ { "CMSG_PET_NAME_QUERY", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetNameQuery }, - /*0x053*/ { "SMSG_PET_NAME_QUERY_RESPONSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x054*/ { "CMSG_GUILD_QUERY", STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildQueryOpcode }, - /*0x055*/ { "SMSG_GUILD_QUERY_RESPONSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x056*/ { "CMSG_ITEM_QUERY_SINGLE", STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleItemQuerySingleOpcode }, - /*0x057*/ { "CMSG_ITEM_QUERY_MULTIPLE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x058*/ { "SMSG_ITEM_QUERY_SINGLE_RESPONSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x059*/ { "SMSG_ITEM_QUERY_MULTIPLE_RESPONSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x05A*/ { "CMSG_PAGE_TEXT_QUERY", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePageTextQueryOpcode }, - /*0x05B*/ { "SMSG_PAGE_TEXT_QUERY_RESPONSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x05C*/ { "CMSG_QUEST_QUERY", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestQueryOpcode }, - /*0x05D*/ { "SMSG_QUEST_QUERY_RESPONSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x05E*/ { "CMSG_GAMEOBJECT_QUERY", STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleGameObjectQueryOpcode }, - /*0x05F*/ { "SMSG_GAMEOBJECT_QUERY_RESPONSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x060*/ { "CMSG_CREATURE_QUERY", STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleCreatureQueryOpcode }, - /*0x061*/ { "SMSG_CREATURE_QUERY_RESPONSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x062*/ { "CMSG_WHO", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWhoOpcode }, - /*0x063*/ { "SMSG_WHO", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x064*/ { "CMSG_WHOIS", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWhoisOpcode }, - /*0x065*/ { "SMSG_WHOIS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x066*/ { "CMSG_CONTACT_LIST", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleContactListOpcode }, - /*0x067*/ { "SMSG_CONTACT_LIST", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x068*/ { "SMSG_FRIEND_STATUS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x069*/ { "CMSG_ADD_FRIEND", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddFriendOpcode }, - /*0x06A*/ { "CMSG_DEL_FRIEND", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDelFriendOpcode }, - /*0x06B*/ { "CMSG_SET_CONTACT_NOTES", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetContactNotesOpcode }, - /*0x06C*/ { "CMSG_ADD_IGNORE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddIgnoreOpcode }, - /*0x06D*/ { "CMSG_DEL_IGNORE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDelIgnoreOpcode }, - /*0x06E*/ { "CMSG_GROUP_INVITE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupInviteOpcode }, - /*0x06F*/ { "SMSG_GROUP_INVITE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x070*/ { "CMSG_GROUP_CANCEL", STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x071*/ { "SMSG_GROUP_CANCEL", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x072*/ { "CMSG_GROUP_ACCEPT", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupAcceptOpcode }, - /*0x073*/ { "CMSG_GROUP_DECLINE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupDeclineOpcode }, - /*0x074*/ { "SMSG_GROUP_DECLINE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x075*/ { "CMSG_GROUP_UNINVITE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupUninviteOpcode }, - /*0x076*/ { "CMSG_GROUP_UNINVITE_GUID", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupUninviteGuidOpcode }, - /*0x077*/ { "SMSG_GROUP_UNINVITE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x078*/ { "CMSG_GROUP_SET_LEADER", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupSetLeaderOpcode }, - /*0x079*/ { "SMSG_GROUP_SET_LEADER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x07A*/ { "CMSG_LOOT_METHOD", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMethodOpcode }, - /*0x07B*/ { "CMSG_GROUP_DISBAND", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupDisbandOpcode }, - /*0x07C*/ { "SMSG_GROUP_DESTROYED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x07D*/ { "SMSG_GROUP_LIST", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x07E*/ { "SMSG_PARTY_MEMBER_STATS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x07F*/ { "SMSG_PARTY_COMMAND_RESULT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x080*/ { "UMSG_UPDATE_GROUP_MEMBERS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x081*/ { "CMSG_GUILD_CREATE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildCreateOpcode }, - /*0x082*/ { "CMSG_GUILD_INVITE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildInviteOpcode }, - /*0x083*/ { "SMSG_GUILD_INVITE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x084*/ { "CMSG_GUILD_ACCEPT", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildAcceptOpcode }, - /*0x085*/ { "CMSG_GUILD_DECLINE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDeclineOpcode }, - /*0x086*/ { "SMSG_GUILD_DECLINE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x087*/ { "CMSG_GUILD_INFO", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildInfoOpcode }, - /*0x088*/ { "SMSG_GUILD_INFO", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x089*/ { "CMSG_GUILD_ROSTER", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildRosterOpcode }, - /*0x08A*/ { "SMSG_GUILD_ROSTER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x08B*/ { "CMSG_GUILD_PROMOTE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildPromoteOpcode }, - /*0x08C*/ { "CMSG_GUILD_DEMOTE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDemoteOpcode }, - /*0x08D*/ { "CMSG_GUILD_LEAVE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildLeaveOpcode }, - /*0x08E*/ { "CMSG_GUILD_REMOVE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildRemoveOpcode }, - /*0x08F*/ { "CMSG_GUILD_DISBAND", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDisbandOpcode }, - /*0x090*/ { "CMSG_GUILD_LEADER", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildLeaderOpcode }, - /*0x091*/ { "CMSG_GUILD_MOTD", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildMOTDOpcode }, - /*0x092*/ { "SMSG_GUILD_EVENT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x093*/ { "SMSG_GUILD_COMMAND_RESULT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x094*/ { "UMSG_UPDATE_GUILD", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x095*/ { "CMSG_MESSAGECHAT", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode }, - /*0x096*/ { "SMSG_MESSAGECHAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x097*/ { "CMSG_JOIN_CHANNEL", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleJoinChannel }, - /*0x098*/ { "CMSG_LEAVE_CHANNEL", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLeaveChannel }, - /*0x099*/ { "SMSG_CHANNEL_NOTIFY", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x09A*/ { "CMSG_CHANNEL_LIST", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelList }, - /*0x09B*/ { "SMSG_CHANNEL_LIST", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x09C*/ { "CMSG_CHANNEL_PASSWORD", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelPassword }, - /*0x09D*/ { "CMSG_CHANNEL_SET_OWNER", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelSetOwner }, - /*0x09E*/ { "CMSG_CHANNEL_OWNER", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelOwner }, - /*0x09F*/ { "CMSG_CHANNEL_MODERATOR", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelModerator }, - /*0x0A0*/ { "CMSG_CHANNEL_UNMODERATOR", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelUnmoderator }, - /*0x0A1*/ { "CMSG_CHANNEL_MUTE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelMute }, - /*0x0A2*/ { "CMSG_CHANNEL_UNMUTE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelUnmute }, - /*0x0A3*/ { "CMSG_CHANNEL_INVITE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelInvite }, - /*0x0A4*/ { "CMSG_CHANNEL_KICK", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelKick }, - /*0x0A5*/ { "CMSG_CHANNEL_BAN", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelBan }, - /*0x0A6*/ { "CMSG_CHANNEL_UNBAN", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelUnban }, - /*0x0A7*/ { "CMSG_CHANNEL_ANNOUNCEMENTS", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelAnnouncements }, - /*0x0A8*/ { "CMSG_CHANNEL_MODERATE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::Handle_NULL }, - /*0x0A9*/ { "SMSG_UPDATE_OBJECT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x0AA*/ { "SMSG_DESTROY_OBJECT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x0AB*/ { "CMSG_USE_ITEM", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUseItemOpcode }, - /*0x0AC*/ { "CMSG_OPEN_ITEM", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleOpenItemOpcode }, - /*0x0AD*/ { "CMSG_READ_ITEM", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReadItem }, - /*0x0AE*/ { "SMSG_READ_ITEM_OK", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x0AF*/ { "SMSG_READ_ITEM_FAILED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x0B0*/ { "SMSG_ITEM_COOLDOWN", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x0B1*/ { "CMSG_GAMEOBJ_USE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGameObjectUseOpcode }, - /*0x0B2*/ { "CMSG_DESTROY_ITEMS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x0B3*/ { "SMSG_GAMEOBJECT_CUSTOM_ANIM", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x0B4*/ { "CMSG_AREATRIGGER", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaTriggerOpcode }, - /*0x0B5*/ { "MSG_MOVE_START_FORWARD", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes }, - /*0x0B6*/ { "MSG_MOVE_START_BACKWARD", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes }, - /*0x0B7*/ { "MSG_MOVE_STOP", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes }, - /*0x0B8*/ { "MSG_MOVE_START_STRAFE_LEFT", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes }, - /*0x0B9*/ { "MSG_MOVE_START_STRAFE_RIGHT", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes }, - /*0x0BA*/ { "MSG_MOVE_STOP_STRAFE", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes }, - /*0x0BB*/ { "MSG_MOVE_JUMP", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes }, - /*0x0BC*/ { "MSG_MOVE_START_TURN_LEFT", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes }, - /*0x0BD*/ { "MSG_MOVE_START_TURN_RIGHT", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes }, - /*0x0BE*/ { "MSG_MOVE_STOP_TURN", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes }, - /*0x0BF*/ { "MSG_MOVE_START_PITCH_UP", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes }, - /*0x0C0*/ { "MSG_MOVE_START_PITCH_DOWN", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes }, - /*0x0C1*/ { "MSG_MOVE_STOP_PITCH", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes }, - /*0x0C2*/ { "MSG_MOVE_SET_RUN_MODE", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes }, - /*0x0C3*/ { "MSG_MOVE_SET_WALK_MODE", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes }, - /*0x0C4*/ { "MSG_MOVE_TOGGLE_LOGGING", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x0C5*/ { "MSG_MOVE_TELEPORT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x0C6*/ { "MSG_MOVE_TELEPORT_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x0C7*/ { "MSG_MOVE_TELEPORT_ACK", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveTeleportAck }, - /*0x0C8*/ { "MSG_MOVE_TOGGLE_FALL_LOGGING", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x0C9*/ { "MSG_MOVE_FALL_LAND", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes }, - /*0x0CA*/ { "MSG_MOVE_START_SWIM", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes }, - /*0x0CB*/ { "MSG_MOVE_STOP_SWIM", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes }, - /*0x0CC*/ { "MSG_MOVE_SET_RUN_SPEED_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x0CD*/ { "MSG_MOVE_SET_RUN_SPEED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x0CE*/ { "MSG_MOVE_SET_RUN_BACK_SPEED_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x0CF*/ { "MSG_MOVE_SET_RUN_BACK_SPEED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x0D0*/ { "MSG_MOVE_SET_WALK_SPEED_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x0D1*/ { "MSG_MOVE_SET_WALK_SPEED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x0D2*/ { "MSG_MOVE_SET_SWIM_SPEED_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x0D3*/ { "MSG_MOVE_SET_SWIM_SPEED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x0D4*/ { "MSG_MOVE_SET_SWIM_BACK_SPEED_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x0D5*/ { "MSG_MOVE_SET_SWIM_BACK_SPEED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x0D6*/ { "MSG_MOVE_SET_ALL_SPEED_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x0D7*/ { "MSG_MOVE_SET_TURN_RATE_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x0D8*/ { "MSG_MOVE_SET_TURN_RATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x0D9*/ { "MSG_MOVE_TOGGLE_COLLISION_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x0DA*/ { "MSG_MOVE_SET_FACING", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes }, - /*0x0DB*/ { "MSG_MOVE_SET_PITCH", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes }, - /*0x0DC*/ { "MSG_MOVE_WORLDPORT_ACK", STATUS_TRANSFER, PROCESS_THREADUNSAFE, &WorldSession::HandleMoveWorldportAckOpcode }, - /*0x0DD*/ { "SMSG_MONSTER_MOVE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x0DE*/ { "SMSG_MOVE_WATER_WALK", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x0DF*/ { "SMSG_MOVE_LAND_WALK", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x0E0*/ { "CMSG_MOVE_CHARM_PORT_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x0E1*/ { "CMSG_MOVE_SET_RAW_POSITION", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x0E2*/ { "SMSG_FORCE_RUN_SPEED_CHANGE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x0E3*/ { "CMSG_FORCE_RUN_SPEED_CHANGE_ACK", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck }, - /*0x0E4*/ { "SMSG_FORCE_RUN_BACK_SPEED_CHANGE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x0E5*/ { "CMSG_FORCE_RUN_BACK_SPEED_CHANGE_ACK", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck }, - /*0x0E6*/ { "SMSG_FORCE_SWIM_SPEED_CHANGE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x0E7*/ { "CMSG_FORCE_SWIM_SPEED_CHANGE_ACK", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck }, - /*0x0E8*/ { "SMSG_FORCE_MOVE_ROOT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x0E9*/ { "CMSG_FORCE_MOVE_ROOT_ACK", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveRootAck }, - /*0x0EA*/ { "SMSG_FORCE_MOVE_UNROOT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x0EB*/ { "CMSG_FORCE_MOVE_UNROOT_ACK", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveUnRootAck }, - /*0x0EC*/ { "MSG_MOVE_ROOT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x0ED*/ { "MSG_MOVE_UNROOT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x0EE*/ { "MSG_MOVE_HEARTBEAT", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes }, - /*0x0EF*/ { "SMSG_MOVE_KNOCK_BACK", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x0F0*/ { "CMSG_MOVE_KNOCK_BACK_ACK", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveKnockBackAck }, - /*0x0F1*/ { "MSG_MOVE_KNOCK_BACK", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x0F2*/ { "SMSG_MOVE_FEATHER_FALL", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x0F3*/ { "SMSG_MOVE_NORMAL_FALL", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x0F4*/ { "SMSG_MOVE_SET_HOVER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x0F5*/ { "SMSG_MOVE_UNSET_HOVER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x0F6*/ { "CMSG_MOVE_HOVER_ACK", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMoveHoverAck }, - /*0x0F7*/ { "MSG_MOVE_HOVER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x0F8*/ { "CMSG_TRIGGER_CINEMATIC_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x0F9*/ { "CMSG_OPENING_CINEMATIC", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x0FA*/ { "SMSG_TRIGGER_CINEMATIC", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x0FB*/ { "CMSG_NEXT_CINEMATIC_CAMERA", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNextCinematicCamera }, - /*0x0FC*/ { "CMSG_COMPLETE_CINEMATIC", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCompleteCinematic }, - /*0x0FD*/ { "SMSG_TUTORIAL_FLAGS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x0FE*/ { "CMSG_TUTORIAL_FLAG", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialFlag }, - /*0x0FF*/ { "CMSG_TUTORIAL_CLEAR", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialClear }, - /*0x100*/ { "CMSG_TUTORIAL_RESET", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialReset }, - /*0x101*/ { "CMSG_STANDSTATECHANGE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStandStateChangeOpcode }, - /*0x102*/ { "CMSG_EMOTE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEmoteOpcode }, - /*0x103*/ { "SMSG_EMOTE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x104*/ { "CMSG_TEXT_EMOTE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTextEmoteOpcode }, - /*0x105*/ { "SMSG_TEXT_EMOTE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x106*/ { "CMSG_AUTOEQUIP_GROUND_ITEM", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x107*/ { "CMSG_AUTOSTORE_GROUND_ITEM", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x108*/ { "CMSG_AUTOSTORE_LOOT_ITEM", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutostoreLootItemOpcode }, - /*0x109*/ { "CMSG_STORE_LOOT_IN_SLOT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x10A*/ { "CMSG_AUTOEQUIP_ITEM", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoEquipItemOpcode }, - /*0x10B*/ { "CMSG_AUTOSTORE_BAG_ITEM", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoStoreBagItemOpcode }, - /*0x10C*/ { "CMSG_SWAP_ITEM", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSwapItem }, - /*0x10D*/ { "CMSG_SWAP_INV_ITEM", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSwapInvItemOpcode }, - /*0x10E*/ { "CMSG_SPLIT_ITEM", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSplitItemOpcode }, - /*0x10F*/ { "CMSG_AUTOEQUIP_ITEM_SLOT", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoEquipItemSlotOpcode }, - /*0x110*/ { "CMSG_UNCLAIM_LICENSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x111*/ { "CMSG_DESTROYITEM", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDestroyItemOpcode }, - /*0x112*/ { "SMSG_INVENTORY_CHANGE_FAILURE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x113*/ { "SMSG_OPEN_CONTAINER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x114*/ { "CMSG_INSPECT", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectOpcode }, - /*0x115*/ { "SMSG_INSPECT_RESULTS_UPDATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x116*/ { "CMSG_INITIATE_TRADE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInitiateTradeOpcode }, - /*0x117*/ { "CMSG_BEGIN_TRADE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBeginTradeOpcode }, - /*0x118*/ { "CMSG_BUSY_TRADE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBusyTradeOpcode }, - /*0x119*/ { "CMSG_IGNORE_TRADE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleIgnoreTradeOpcode }, - /*0x11A*/ { "CMSG_ACCEPT_TRADE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAcceptTradeOpcode }, - /*0x11B*/ { "CMSG_UNACCEPT_TRADE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnacceptTradeOpcode }, - /*0x11C*/ { "CMSG_CANCEL_TRADE", STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelTradeOpcode}, - /*0x11D*/ { "CMSG_SET_TRADE_ITEM", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTradeItemOpcode }, - /*0x11E*/ { "CMSG_CLEAR_TRADE_ITEM", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleClearTradeItemOpcode }, - /*0x11F*/ { "CMSG_SET_TRADE_GOLD", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTradeGoldOpcode }, - /*0x120*/ { "SMSG_TRADE_STATUS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x121*/ { "SMSG_TRADE_STATUS_EXTENDED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x122*/ { "SMSG_INITIALIZE_FACTIONS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x123*/ { "SMSG_SET_FACTION_VISIBLE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x124*/ { "SMSG_SET_FACTION_STANDING", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x125*/ { "CMSG_SET_FACTION_ATWAR", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetFactionAtWar }, - /*0x126*/ { "CMSG_SET_FACTION_CHEAT", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetFactionCheat }, - /*0x127*/ { "SMSG_SET_PROFICIENCY", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x128*/ { "CMSG_SET_ACTION_BUTTON", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActionButtonOpcode }, - /*0x129*/ { "SMSG_ACTION_BUTTONS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x12A*/ { "SMSG_INITIAL_SPELLS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x12B*/ { "SMSG_LEARNED_SPELL", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x12C*/ { "SMSG_SUPERCEDED_SPELL", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x12D*/ { "CMSG_NEW_SPELL_SLOT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x12E*/ { "CMSG_CAST_SPELL", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleCastSpellOpcode }, - /*0x12F*/ { "CMSG_CANCEL_CAST", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleCancelCastOpcode }, - /*0x130*/ { "SMSG_CAST_FAILED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x131*/ { "SMSG_SPELL_START", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x132*/ { "SMSG_SPELL_GO", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x133*/ { "SMSG_SPELL_FAILURE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x134*/ { "SMSG_SPELL_COOLDOWN", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x135*/ { "SMSG_COOLDOWN_EVENT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x136*/ { "CMSG_CANCEL_AURA", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelAuraOpcode }, - /*0x137*/ { "SMSG_EQUIPMENT_SET_SAVED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x138*/ { "SMSG_PET_CAST_FAILED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x139*/ { "MSG_CHANNEL_START", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x13A*/ { "MSG_CHANNEL_UPDATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x13B*/ { "CMSG_CANCEL_CHANNELLING", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelChanneling }, - /*0x13C*/ { "SMSG_AI_REACTION", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x13D*/ { "CMSG_SET_SELECTION", STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleSetSelectionOpcode }, - /*0x13E*/ { "CMSG_DELETEEQUIPMENT_SET", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetDelete }, - /*0x13F*/ { "CMSG_INSTANCE_LOCK_RESPONSE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInstanceLockResponse }, - /*0x140*/ { "CMSG_DEBUG_PASSIVE_AURA", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x141*/ { "CMSG_ATTACKSWING", STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleAttackSwingOpcode }, - /*0x142*/ { "CMSG_ATTACKSTOP", STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleAttackStopOpcode }, - /*0x143*/ { "SMSG_ATTACKSTART", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x144*/ { "SMSG_ATTACKSTOP", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x145*/ { "SMSG_ATTACKSWING_NOTINRANGE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x146*/ { "SMSG_ATTACKSWING_BADFACING", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x147*/ { "SMSG_INSTANCE_LOCK_WARNING_QUERY", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x148*/ { "SMSG_ATTACKSWING_DEADTARGET", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x149*/ { "SMSG_ATTACKSWING_CANT_ATTACK", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x14A*/ { "SMSG_ATTACKERSTATEUPDATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x14B*/ { "SMSG_BATTLEFIELD_PORT_DENIED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x14C*/ { "CMSG_PERFORM_ACTION_SET", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x14D*/ { "SMSG_RESUME_CAST_BAR", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x14E*/ { "SMSG_CANCEL_COMBAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x14F*/ { "SMSG_SPELLBREAKLOG", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x150*/ { "SMSG_SPELLHEALLOG", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x151*/ { "SMSG_SPELLENERGIZELOG", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x152*/ { "SMSG_BREAK_TARGET", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x153*/ { "CMSG_SAVE_PLAYER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x154*/ { "CMSG_SETDEATHBINDPOINT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x155*/ { "SMSG_BINDPOINTUPDATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x156*/ { "CMSG_GETDEATHBINDZONE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x157*/ { "SMSG_BINDZONEREPLY", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x158*/ { "SMSG_PLAYERBOUND", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x159*/ { "SMSG_CLIENT_CONTROL_UPDATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x15A*/ { "CMSG_REPOP_REQUEST", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepopRequestOpcode }, - /*0x15B*/ { "SMSG_RESURRECT_REQUEST", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x15C*/ { "CMSG_RESURRECT_RESPONSE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleResurrectResponseOpcode }, - /*0x15D*/ { "CMSG_LOOT", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootOpcode }, - /*0x15E*/ { "CMSG_LOOT_MONEY", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMoneyOpcode }, - /*0x15F*/ { "CMSG_LOOT_RELEASE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootReleaseOpcode }, - /*0x160*/ { "SMSG_LOOT_RESPONSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x161*/ { "SMSG_LOOT_RELEASE_RESPONSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x162*/ { "SMSG_LOOT_REMOVED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x163*/ { "SMSG_LOOT_MONEY_NOTIFY", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x164*/ { "SMSG_LOOT_ITEM_NOTIFY", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x165*/ { "SMSG_LOOT_CLEAR_MONEY", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x166*/ { "SMSG_ITEM_PUSH_RESULT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x167*/ { "SMSG_DUEL_REQUESTED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x168*/ { "SMSG_DUEL_OUTOFBOUNDS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x169*/ { "SMSG_DUEL_INBOUNDS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x16A*/ { "SMSG_DUEL_COMPLETE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x16B*/ { "SMSG_DUEL_WINNER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x16C*/ { "CMSG_DUEL_ACCEPTED", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDuelAcceptedOpcode }, - /*0x16D*/ { "CMSG_DUEL_CANCELLED", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDuelCancelledOpcode }, - /*0x16E*/ { "SMSG_MOUNTRESULT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x16F*/ { "SMSG_DISMOUNTRESULT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x170*/ { "SMSG_REMOVED_FROM_PVP_QUEUE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x171*/ { "CMSG_MOUNTSPECIAL_ANIM", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMountSpecialAnimOpcode }, - /*0x172*/ { "SMSG_MOUNTSPECIAL_ANIM", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x173*/ { "SMSG_PET_TAME_FAILURE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x174*/ { "CMSG_PET_SET_ACTION", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetSetAction }, - /*0x175*/ { "CMSG_PET_ACTION", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetAction }, - /*0x176*/ { "CMSG_PET_ABANDON", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetAbandon }, - /*0x177*/ { "CMSG_PET_RENAME", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetRename }, - /*0x178*/ { "SMSG_PET_NAME_INVALID", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x179*/ { "SMSG_PET_SPELLS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x17A*/ { "SMSG_PET_MODE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x17B*/ { "CMSG_GOSSIP_HELLO", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGossipHelloOpcode }, - /*0x17C*/ { "CMSG_GOSSIP_SELECT_OPTION", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGossipSelectOptionOpcode }, - /*0x17D*/ { "SMSG_GOSSIP_MESSAGE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x17E*/ { "SMSG_GOSSIP_COMPLETE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x17F*/ { "CMSG_NPC_TEXT_QUERY", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNpcTextQueryOpcode }, - /*0x180*/ { "SMSG_NPC_TEXT_UPDATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x181*/ { "SMSG_NPC_WONT_TALK", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x182*/ { "CMSG_QUESTGIVER_STATUS_QUERY", STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleQuestgiverStatusQueryOpcode}, - /*0x183*/ { "SMSG_QUESTGIVER_STATUS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x184*/ { "CMSG_QUESTGIVER_HELLO", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverHelloOpcode }, - /*0x185*/ { "SMSG_QUESTGIVER_QUEST_LIST", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x186*/ { "CMSG_QUESTGIVER_QUERY_QUEST", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverQueryQuestOpcode}, - /*0x187*/ { "CMSG_QUESTGIVER_QUEST_AUTOLAUNCH", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverQuestAutoLaunch }, - /*0x188*/ { "SMSG_QUESTGIVER_QUEST_DETAILS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x189*/ { "CMSG_QUESTGIVER_ACCEPT_QUEST", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverAcceptQuestOpcode}, - /*0x18A*/ { "CMSG_QUESTGIVER_COMPLETE_QUEST", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverCompleteQuest }, - /*0x18B*/ { "SMSG_QUESTGIVER_REQUEST_ITEMS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x18C*/ { "CMSG_QUESTGIVER_REQUEST_REWARD", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverRequestRewardOpcode}, - /*0x18D*/ { "SMSG_QUESTGIVER_OFFER_REWARD", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x18E*/ { "CMSG_QUESTGIVER_CHOOSE_REWARD", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverChooseRewardOpcode}, - /*0x18F*/ { "SMSG_QUESTGIVER_QUEST_INVALID", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x190*/ { "CMSG_QUESTGIVER_CANCEL", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverCancel }, - /*0x191*/ { "SMSG_QUESTGIVER_QUEST_COMPLETE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x192*/ { "SMSG_QUESTGIVER_QUEST_FAILED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x193*/ { "CMSG_QUESTLOG_SWAP_QUEST", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestLogSwapQuest }, - /*0x194*/ { "CMSG_QUESTLOG_REMOVE_QUEST", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestLogRemoveQuest }, - /*0x195*/ { "SMSG_QUESTLOG_FULL", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x196*/ { "SMSG_QUESTUPDATE_FAILED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x197*/ { "SMSG_QUESTUPDATE_FAILEDTIMER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x198*/ { "SMSG_QUESTUPDATE_COMPLETE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x199*/ { "SMSG_QUESTUPDATE_ADD_KILL", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x19A*/ { "SMSG_QUESTUPDATE_ADD_ITEM", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x19B*/ { "CMSG_QUEST_CONFIRM_ACCEPT", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestConfirmAccept }, - /*0x19C*/ { "SMSG_QUEST_CONFIRM_ACCEPT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x19D*/ { "CMSG_PUSHQUESTTOPARTY", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePushQuestToParty }, - /*0x19E*/ { "CMSG_LIST_INVENTORY", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleListInventoryOpcode }, - /*0x19F*/ { "SMSG_LIST_INVENTORY", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1A0*/ { "CMSG_SELL_ITEM", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSellItemOpcode }, - /*0x1A1*/ { "SMSG_SELL_ITEM", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1A2*/ { "CMSG_BUY_ITEM", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyItemOpcode }, - /*0x1A3*/ { "CMSG_BUY_ITEM_IN_SLOT", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyItemInSlotOpcode }, - /*0x1A4*/ { "SMSG_BUY_ITEM", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1A5*/ { "SMSG_BUY_FAILED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1A6*/ { "CMSG_TAXICLEARALLNODES", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x1A7*/ { "CMSG_TAXIENABLEALLNODES", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x1A8*/ { "CMSG_TAXISHOWNODES", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x1A9*/ { "SMSG_SHOWTAXINODES", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1AA*/ { "CMSG_TAXINODE_STATUS_QUERY", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleTaxiNodeStatusQueryOpcode }, - /*0x1AB*/ { "SMSG_TAXINODE_STATUS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1AC*/ { "CMSG_TAXIQUERYAVAILABLENODES", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleTaxiQueryAvailableNodes }, - /*0x1AD*/ { "CMSG_ACTIVATETAXI", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleActivateTaxiOpcode }, - /*0x1AE*/ { "SMSG_ACTIVATETAXIREPLY", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1AF*/ { "SMSG_NEW_TAXI_PATH", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1B0*/ { "CMSG_TRAINER_LIST", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerListOpcode }, - /*0x1B1*/ { "SMSG_TRAINER_LIST", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1B2*/ { "CMSG_TRAINER_BUY_SPELL", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerBuySpellOpcode }, - /*0x1B3*/ { "SMSG_TRAINER_BUY_SUCCEEDED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1B4*/ { "SMSG_TRAINER_BUY_FAILED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1B5*/ { "CMSG_BINDER_ACTIVATE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBinderActivateOpcode }, - /*0x1B6*/ { "SMSG_PLAYERBINDERROR", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1B7*/ { "CMSG_BANKER_ACTIVATE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBankerActivateOpcode }, - /*0x1B8*/ { "SMSG_SHOW_BANK", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1B9*/ { "CMSG_BUY_BANK_SLOT", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyBankSlotOpcode }, - /*0x1BA*/ { "SMSG_BUY_BANK_SLOT_RESULT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1BB*/ { "CMSG_PETITION_SHOWLIST", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionShowListOpcode }, - /*0x1BC*/ { "SMSG_PETITION_SHOWLIST", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1BD*/ { "CMSG_PETITION_BUY", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionBuyOpcode }, - /*0x1BE*/ { "CMSG_PETITION_SHOW_SIGNATURES", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionShowSignOpcode }, - /*0x1BF*/ { "SMSG_PETITION_SHOW_SIGNATURES", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1C0*/ { "CMSG_PETITION_SIGN", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionSignOpcode }, - /*0x1C1*/ { "SMSG_PETITION_SIGN_RESULTS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1C2*/ { "MSG_PETITION_DECLINE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionDeclineOpcode }, - /*0x1C3*/ { "CMSG_OFFER_PETITION", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleOfferPetitionOpcode }, - /*0x1C4*/ { "CMSG_TURN_IN_PETITION", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTurnInPetitionOpcode }, - /*0x1C5*/ { "SMSG_TURN_IN_PETITION_RESULTS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1C6*/ { "CMSG_PETITION_QUERY", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionQueryOpcode }, - /*0x1C7*/ { "SMSG_PETITION_QUERY_RESPONSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1C8*/ { "SMSG_FISH_NOT_HOOKED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1C9*/ { "SMSG_FISH_ESCAPED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1CA*/ { "CMSG_BUG", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBugOpcode }, - /*0x1CB*/ { "SMSG_NOTIFICATION", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1CC*/ { "CMSG_PLAYED_TIME", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayedTime }, - /*0x1CD*/ { "SMSG_PLAYED_TIME", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1CE*/ { "CMSG_QUERY_TIME", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryTimeOpcode }, - /*0x1CF*/ { "SMSG_QUERY_TIME_RESPONSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1D0*/ { "SMSG_LOG_XPGAIN", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1D1*/ { "SMSG_AURACASTLOG", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1D2*/ { "CMSG_RECLAIM_CORPSE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReclaimCorpseOpcode }, - /*0x1D3*/ { "CMSG_WRAP_ITEM", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWrapItemOpcode }, - /*0x1D4*/ { "SMSG_LEVELUP_INFO", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1D5*/ { "MSG_MINIMAP_PING", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMinimapPingOpcode }, - /*0x1D6*/ { "SMSG_RESISTLOG", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1D7*/ { "SMSG_ENCHANTMENTLOG", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1D8*/ { "CMSG_SET_SKILL_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x1D9*/ { "SMSG_START_MIRROR_TIMER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1DA*/ { "SMSG_PAUSE_MIRROR_TIMER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1DB*/ { "SMSG_STOP_MIRROR_TIMER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1DC*/ { "CMSG_PING", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess }, - /*0x1DD*/ { "SMSG_PONG", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1DE*/ { "SMSG_CLEAR_COOLDOWN", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1DF*/ { "SMSG_GAMEOBJECT_PAGETEXT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1E0*/ { "CMSG_SETSHEATHED", STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleSetSheathedOpcode }, - /*0x1E1*/ { "SMSG_COOLDOWN_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1E2*/ { "SMSG_SPELL_DELAYED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1E3*/ { "CMSG_QUEST_POI_QUERY", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestPOIQuery }, - /*0x1E4*/ { "SMSG_QUEST_POI_QUERY_RESPONSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1E5*/ { "CMSG_GHOST", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x1E6*/ { "CMSG_GM_INVIS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x1E7*/ { "SMSG_INVALID_PROMOTION_CODE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1E8*/ { "MSG_GM_BIND_OTHER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x1E9*/ { "MSG_GM_SUMMON", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x1EA*/ { "SMSG_ITEM_TIME_UPDATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1EB*/ { "SMSG_ITEM_ENCHANT_TIME_UPDATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1EC*/ { "SMSG_AUTH_CHALLENGE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1ED*/ { "CMSG_AUTH_SESSION", STATUS_NEVER, PROCESS_THREADUNSAFE, &WorldSession::Handle_EarlyProccess }, - /*0x1EE*/ { "SMSG_AUTH_RESPONSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1EF*/ { "MSG_GM_SHOWLABEL", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x1F0*/ { "CMSG_PET_CAST_SPELL", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetCastSpellOpcode }, - /*0x1F1*/ { "MSG_SAVE_GUILD_EMBLEM", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSaveGuildEmblemOpcode }, - /*0x1F2*/ { "MSG_TABARDVENDOR_ACTIVATE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTabardVendorActivateOpcode}, - /*0x1F3*/ { "SMSG_PLAY_SPELL_VISUAL", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1F4*/ { "CMSG_ZONEUPDATE", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleZoneUpdateOpcode }, - /*0x1F5*/ { "SMSG_PARTYKILLLOG", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1F6*/ { "SMSG_COMPRESSED_UPDATE_OBJECT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1F7*/ { "SMSG_PLAY_SPELL_IMPACT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1F8*/ { "SMSG_EXPLORATION_EXPERIENCE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1F9*/ { "CMSG_GM_SET_SECURITY_GROUP", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x1FA*/ { "CMSG_GM_NUKE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x1FB*/ { "MSG_RANDOM_ROLL", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRandomRollOpcode }, - /*0x1FC*/ { "SMSG_ENVIRONMENTALDAMAGELOG", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1FD*/ { "CMSG_CHANGEPLAYER_DIFFICULTY", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x1FE*/ { "SMSG_RWHOIS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x1FF*/ { "SMSG_LFG_PLAYER_REWARD", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x200*/ { "SMSG_LFG_TELEPORT_DENIED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x201*/ { "CMSG_UNLEARN_SPELL", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x202*/ { "CMSG_UNLEARN_SKILL", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnlearnSkillOpcode }, - /*0x203*/ { "SMSG_REMOVED_SPELL", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x204*/ { "CMSG_DECHARGE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x205*/ { "CMSG_GMTICKET_CREATE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketCreateOpcode }, - /*0x206*/ { "SMSG_GMTICKET_CREATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x207*/ { "CMSG_GMTICKET_UPDATETEXT", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketUpdateOpcode }, - /*0x208*/ { "SMSG_GMTICKET_UPDATETEXT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x209*/ { "SMSG_ACCOUNT_DATA_TIMES", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x20A*/ { "CMSG_REQUEST_ACCOUNT_DATA", STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestAccountData }, - /*0x20B*/ { "CMSG_UPDATE_ACCOUNT_DATA", STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateAccountData }, - /*0x20C*/ { "SMSG_UPDATE_ACCOUNT_DATA", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x20D*/ { "SMSG_CLEAR_FAR_SIGHT_IMMEDIATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x20E*/ { "SMSG_CHANGEPLAYER_DIFFICULTY_RESULT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x20F*/ { "CMSG_GM_TEACH", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x210*/ { "CMSG_GM_CREATE_ITEM_TARGET", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x211*/ { "CMSG_GMTICKET_GETTICKET", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketGetTicketOpcode }, - /*0x212*/ { "SMSG_GMTICKET_GETTICKET", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x213*/ { "CMSG_UNLEARN_TALENTS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x214*/ { "SMSG_GAMEOBJECT_SPAWN_ANIM_OBSOLETE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x215*/ { "SMSG_GAMEOBJECT_DESPAWN_ANIM", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x216*/ { "MSG_CORPSE_QUERY", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCorpseQueryOpcode }, - /*0x217*/ { "CMSG_GMTICKET_DELETETICKET", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketDeleteOpcode }, - /*0x218*/ { "SMSG_GMTICKET_DELETETICKET", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x219*/ { "SMSG_CHAT_WRONG_FACTION", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x21A*/ { "CMSG_GMTICKET_SYSTEMSTATUS", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketSystemStatusOpcode}, - /*0x21B*/ { "SMSG_GMTICKET_SYSTEMSTATUS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x21C*/ { "CMSG_SPIRIT_HEALER_ACTIVATE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSpiritHealerActivateOpcode}, - /*0x21D*/ { "CMSG_SET_STAT_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x21E*/ { "SMSG_QUEST_FORCE_REMOVE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x21F*/ { "CMSG_SKILL_BUY_STEP", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x220*/ { "CMSG_SKILL_BUY_RANK", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x221*/ { "CMSG_XP_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x222*/ { "SMSG_SPIRIT_HEALER_CONFIRM", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x223*/ { "CMSG_CHARACTER_POINT_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x224*/ { "SMSG_GOSSIP_POI", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x225*/ { "CMSG_CHAT_IGNORED", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChatIgnoredOpcode }, - /*0x226*/ { "CMSG_GM_VISION", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x227*/ { "CMSG_SERVER_COMMAND", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x228*/ { "CMSG_GM_SILENCE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x229*/ { "CMSG_GM_REVEALTO", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x22A*/ { "CMSG_GM_RESURRECT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x22B*/ { "CMSG_GM_SUMMONMOB", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x22C*/ { "CMSG_GM_MOVECORPSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x22D*/ { "CMSG_GM_FREEZE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x22E*/ { "CMSG_GM_UBERINVIS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x22F*/ { "CMSG_GM_REQUEST_PLAYER_INFO", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x230*/ { "SMSG_GM_PLAYER_INFO", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x231*/ { "CMSG_GUILD_RANK", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildRankOpcode }, - /*0x232*/ { "CMSG_GUILD_ADD_RANK", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildAddRankOpcode }, - /*0x233*/ { "CMSG_GUILD_DEL_RANK", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDelRankOpcode }, - /*0x234*/ { "CMSG_GUILD_SET_PUBLIC_NOTE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildSetPublicNoteOpcode }, - /*0x235*/ { "CMSG_GUILD_SET_OFFICER_NOTE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildSetOfficerNoteOpcode }, - /*0x236*/ { "SMSG_LOGIN_VERIFY_WORLD", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x237*/ { "CMSG_CLEAR_EXPLORATION", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x238*/ { "CMSG_SEND_MAIL", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSendMail }, - /*0x239*/ { "SMSG_SEND_MAIL_RESULT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x23A*/ { "CMSG_GET_MAIL_LIST", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGetMailList }, - /*0x23B*/ { "SMSG_MAIL_LIST_RESULT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x23C*/ { "CMSG_BATTLEFIELD_LIST", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlefieldListOpcode }, - /*0x23D*/ { "SMSG_BATTLEFIELD_LIST", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x23E*/ { "CMSG_BATTLEFIELD_JOIN", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x23F*/ { "SMSG_FORCE_SET_VEHICLE_REC_ID", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x240*/ { "CMSG_SET_VEHICLE_REC_ID_ACK", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x241*/ { "CMSG_TAXICLEARNODE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x242*/ { "CMSG_TAXIENABLENODE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x243*/ { "CMSG_ITEM_TEXT_QUERY", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemTextQuery }, - /*0x244*/ { "SMSG_ITEM_TEXT_QUERY_RESPONSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x245*/ { "CMSG_MAIL_TAKE_MONEY", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailTakeMoney }, - /*0x246*/ { "CMSG_MAIL_TAKE_ITEM", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailTakeItem }, - /*0x247*/ { "CMSG_MAIL_MARK_AS_READ", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailMarkAsRead }, - /*0x248*/ { "CMSG_MAIL_RETURN_TO_SENDER", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailReturnToSender }, - /*0x249*/ { "CMSG_MAIL_DELETE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailDelete }, - /*0x24A*/ { "CMSG_MAIL_CREATE_TEXT_ITEM", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailCreateTextItem }, - /*0x24B*/ { "SMSG_SPELLLOGMISS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x24C*/ { "SMSG_SPELLLOGEXECUTE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x24D*/ { "SMSG_DEBUGAURAPROC", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x24E*/ { "SMSG_PERIODICAURALOG", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x24F*/ { "SMSG_SPELLDAMAGESHIELD", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x250*/ { "SMSG_SPELLNONMELEEDAMAGELOG", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x251*/ { "CMSG_LEARN_TALENT", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnTalentOpcode }, - /*0x252*/ { "SMSG_RESURRECT_FAILED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x253*/ { "CMSG_TOGGLE_PVP", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTogglePvP }, - /*0x254*/ { "SMSG_ZONE_UNDER_ATTACK", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x255*/ { "MSG_AUCTION_HELLO", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionHelloOpcode }, - /*0x256*/ { "CMSG_AUCTION_SELL_ITEM", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionSellItem }, - /*0x257*/ { "CMSG_AUCTION_REMOVE_ITEM", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionRemoveItem }, - /*0x258*/ { "CMSG_AUCTION_LIST_ITEMS", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListItems }, - /*0x259*/ { "CMSG_AUCTION_LIST_OWNER_ITEMS", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListOwnerItems }, - /*0x25A*/ { "CMSG_AUCTION_PLACE_BID", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionPlaceBid }, - /*0x25B*/ { "SMSG_AUCTION_COMMAND_RESULT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x25C*/ { "SMSG_AUCTION_LIST_RESULT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x25D*/ { "SMSG_AUCTION_OWNER_LIST_RESULT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x25E*/ { "SMSG_AUCTION_BIDDER_NOTIFICATION", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x25F*/ { "SMSG_AUCTION_OWNER_NOTIFICATION", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x260*/ { "SMSG_PROCRESIST", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x261*/ { "SMSG_COMBAT_EVENT_FAILED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x262*/ { "SMSG_DISPEL_FAILED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x263*/ { "SMSG_SPELLORDAMAGE_IMMUNE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x264*/ { "CMSG_AUCTION_LIST_BIDDER_ITEMS", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListBidderItems }, - /*0x265*/ { "SMSG_AUCTION_BIDDER_LIST_RESULT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x266*/ { "SMSG_SET_FLAT_SPELL_MODIFIER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x267*/ { "SMSG_SET_PCT_SPELL_MODIFIER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x268*/ { "CMSG_SET_AMMO", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetAmmoOpcode }, - /*0x269*/ { "SMSG_CORPSE_RECLAIM_DELAY", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x26A*/ { "CMSG_SET_ACTIVE_MOVER", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActiveMoverOpcode }, - /*0x26B*/ { "CMSG_PET_CANCEL_AURA", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetCancelAuraOpcode }, - /*0x26C*/ { "CMSG_PLAYER_AI_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x26D*/ { "CMSG_CANCEL_AUTO_REPEAT_SPELL", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelAutoRepeatSpellOpcode}, - /*0x26E*/ { "MSG_GM_ACCOUNT_ONLINE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x26F*/ { "MSG_LIST_STABLED_PETS", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleListStabledPetsOpcode }, - /*0x270*/ { "CMSG_STABLE_PET", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStablePet }, - /*0x271*/ { "CMSG_UNSTABLE_PET", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnstablePet }, - /*0x272*/ { "CMSG_BUY_STABLE_SLOT", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyStableSlot }, - /*0x273*/ { "SMSG_STABLE_RESULT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x274*/ { "CMSG_STABLE_REVIVE_PET", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStableRevivePet }, - /*0x275*/ { "CMSG_STABLE_SWAP_PET", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStableSwapPet }, - /*0x276*/ { "MSG_QUEST_PUSH_RESULT", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestPushResult }, - /*0x277*/ { "SMSG_PLAY_MUSIC", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x278*/ { "SMSG_PLAY_OBJECT_SOUND", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x279*/ { "CMSG_REQUEST_PET_INFO", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestPetInfoOpcode }, - /*0x27A*/ { "CMSG_FAR_SIGHT", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleFarSightOpcode }, - /*0x27B*/ { "SMSG_SPELLDISPELLOG", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x27C*/ { "SMSG_DAMAGE_CALC_LOG", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x27D*/ { "CMSG_ENABLE_DAMAGE_LOG", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x27E*/ { "CMSG_GROUP_CHANGE_SUB_GROUP", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupChangeSubGroupOpcode }, - /*0x27F*/ { "CMSG_REQUEST_PARTY_MEMBER_STATS", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestPartyMemberStatsOpcode}, - /*0x280*/ { "CMSG_GROUP_SWAP_SUB_GROUP", STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x281*/ { "CMSG_RESET_FACTION_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x282*/ { "CMSG_AUTOSTORE_BANK_ITEM", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoStoreBankItemOpcode }, - /*0x283*/ { "CMSG_AUTOBANK_ITEM", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoBankItemOpcode }, - /*0x284*/ { "MSG_QUERY_NEXT_MAIL_TIME", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryNextMailTime }, - /*0x285*/ { "SMSG_RECEIVED_MAIL", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x286*/ { "SMSG_RAID_GROUP_ONLY", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x287*/ { "CMSG_SET_DURABILITY_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x288*/ { "CMSG_SET_PVP_RANK_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x289*/ { "CMSG_ADD_PVP_MEDAL_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x28A*/ { "CMSG_DEL_PVP_MEDAL_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x28B*/ { "CMSG_SET_PVP_TITLE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x28C*/ { "SMSG_PVP_CREDIT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x28D*/ { "SMSG_AUCTION_REMOVED_NOTIFICATION", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x28E*/ { "CMSG_GROUP_RAID_CONVERT", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupRaidConvertOpcode }, - /*0x28F*/ { "CMSG_GROUP_ASSISTANT_LEADER", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupAssistantLeaderOpcode}, - /*0x290*/ { "CMSG_BUYBACK_ITEM", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuybackItem }, - /*0x291*/ { "SMSG_SERVER_MESSAGE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x292*/ { "CMSG_SET_SAVED_INSTANCE_EXTEND", STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x293*/ { "SMSG_LFG_OFFER_CONTINUE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x294*/ { "CMSG_TEST_DROP_RATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x295*/ { "SMSG_TEST_DROP_RATE_RESULT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x296*/ { "CMSG_LFG_GET_STATUS", STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x297*/ { "SMSG_SHOW_MAILBOX", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x298*/ { "SMSG_RESET_RANGED_COMBAT_TIMER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x299*/ { "SMSG_MEETINGSTONE_MEMBER_ADDED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x29A*/ { "SMSG_CHAT_NOT_IN_PARTY", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x29B*/ { "CMSG_CANCEL_GROWTH_AURA", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelGrowthAuraOpcode }, - /*0x29C*/ { "SMSG_CANCEL_AUTO_REPEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x29D*/ { "SMSG_STANDSTATE_UPDATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x29E*/ { "SMSG_LOOT_ALL_PASSED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x29F*/ { "SMSG_LOOT_ROLL_WON", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2A0*/ { "CMSG_LOOT_ROLL", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootRoll }, - /*0x2A1*/ { "SMSG_LOOT_START_ROLL", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2A2*/ { "SMSG_LOOT_ROLL", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2A3*/ { "CMSG_LOOT_MASTER_GIVE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMasterGiveOpcode }, - /*0x2A4*/ { "SMSG_LOOT_MASTER_LIST", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2A5*/ { "SMSG_SET_FORCED_REACTIONS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2A6*/ { "SMSG_SPELL_FAILED_OTHER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2A7*/ { "SMSG_GAMEOBJECT_RESET_STATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2A8*/ { "CMSG_REPAIR_ITEM", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepairItemOpcode }, - /*0x2A9*/ { "SMSG_CHAT_PLAYER_NOT_FOUND", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2AA*/ { "MSG_TALENT_WIPE_CONFIRM", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTalentWipeConfirmOpcode }, - /*0x2AB*/ { "SMSG_SUMMON_REQUEST", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2AC*/ { "CMSG_SUMMON_RESPONSE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSummonResponseOpcode }, - /*0x2AD*/ { "MSG_DEV_SHOWLABEL", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x2AE*/ { "SMSG_MONSTER_MOVE_TRANSPORT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2AF*/ { "SMSG_PET_BROKEN", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2B0*/ { "MSG_MOVE_FEATHER_FALL", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x2B1*/ { "MSG_MOVE_WATER_WALK", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x2B2*/ { "CMSG_SERVER_BROADCAST", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x2B3*/ { "CMSG_SELF_RES", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSelfResOpcode }, - /*0x2B4*/ { "SMSG_FEIGN_DEATH_RESISTED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2B5*/ { "CMSG_RUN_SCRIPT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x2B6*/ { "SMSG_SCRIPT_MESSAGE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2B7*/ { "SMSG_DUEL_COUNTDOWN", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2B8*/ { "SMSG_AREA_TRIGGER_MESSAGE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2B9*/ { "CMSG_SHOWING_HELM", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleShowingHelmOpcode }, - /*0x2BA*/ { "CMSG_SHOWING_CLOAK", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleShowingCloakOpcode }, - /*0x2BB*/ { "SMSG_LFG_ROLE_CHOSEN", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2BC*/ { "SMSG_PLAYER_SKINNED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2BD*/ { "SMSG_DURABILITY_DAMAGE_DEATH", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2BE*/ { "CMSG_SET_EXPLORATION", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x2BF*/ { "CMSG_SET_ACTIONBAR_TOGGLES", STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActionBarToggles }, - /*0x2C0*/ { "UMSG_DELETE_GUILD_CHARTER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x2C1*/ { "MSG_PETITION_RENAME", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionRenameOpcode }, - /*0x2C2*/ { "SMSG_INIT_WORLD_STATES", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2C3*/ { "SMSG_UPDATE_WORLD_STATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2C4*/ { "CMSG_ITEM_NAME_QUERY", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemNameQueryOpcode }, - /*0x2C5*/ { "SMSG_ITEM_NAME_QUERY_RESPONSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2C6*/ { "SMSG_PET_ACTION_FEEDBACK", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2C7*/ { "CMSG_CHAR_RENAME", STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharRenameOpcode }, - /*0x2C8*/ { "SMSG_CHAR_RENAME", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2C9*/ { "CMSG_MOVE_SPLINE_DONE", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveSplineDoneOpcode }, - /*0x2CA*/ { "CMSG_MOVE_FALL_RESET", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes }, - /*0x2CB*/ { "SMSG_INSTANCE_SAVE_CREATED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2CC*/ { "SMSG_RAID_INSTANCE_INFO", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2CD*/ { "CMSG_REQUEST_RAID_INFO", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestRaidInfoOpcode }, - /*0x2CE*/ { "CMSG_MOVE_TIME_SKIPPED", STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleMoveTimeSkippedOpcode }, - /*0x2CF*/ { "CMSG_MOVE_FEATHER_FALL_ACK", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleFeatherFallAck }, - /*0x2D0*/ { "CMSG_MOVE_WATER_WALK_ACK", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveWaterWalkAck }, - /*0x2D1*/ { "CMSG_MOVE_NOT_ACTIVE_MOVER", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveNotActiveMover }, - /*0x2D2*/ { "SMSG_PLAY_SOUND", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2D3*/ { "CMSG_BATTLEFIELD_STATUS", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlefieldStatusOpcode }, - /*0x2D4*/ { "SMSG_BATTLEFIELD_STATUS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2D5*/ { "CMSG_BATTLEFIELD_PORT", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattleFieldPortOpcode }, - /*0x2D6*/ { "MSG_INSPECT_HONOR_STATS", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectHonorStatsOpcode }, - /*0x2D7*/ { "CMSG_BATTLEMASTER_HELLO", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlemasterHelloOpcode }, - /*0x2D8*/ { "CMSG_MOVE_START_SWIM_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x2D9*/ { "CMSG_MOVE_STOP_SWIM_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x2DA*/ { "SMSG_FORCE_WALK_SPEED_CHANGE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2DB*/ { "CMSG_FORCE_WALK_SPEED_CHANGE_ACK", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck }, - /*0x2DC*/ { "SMSG_FORCE_SWIM_BACK_SPEED_CHANGE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2DD*/ { "CMSG_FORCE_SWIM_BACK_SPEED_CHANGE_ACK", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck }, - /*0x2DE*/ { "SMSG_FORCE_TURN_RATE_CHANGE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2DF*/ { "CMSG_FORCE_TURN_RATE_CHANGE_ACK", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck }, - /*0x2E0*/ { "MSG_PVP_LOG_DATA", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePVPLogDataOpcode }, - /*0x2E1*/ { "CMSG_LEAVE_BATTLEFIELD", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLeaveBattlefieldOpcode }, - /*0x2E2*/ { "CMSG_AREA_SPIRIT_HEALER_QUERY", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaSpiritHealerQueryOpcode}, - /*0x2E3*/ { "CMSG_AREA_SPIRIT_HEALER_QUEUE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaSpiritHealerQueueOpcode}, - /*0x2E4*/ { "SMSG_AREA_SPIRIT_HEALER_TIME", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2E5*/ { "CMSG_GM_UNTEACH", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x2E6*/ { "SMSG_WARDEN_DATA", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2E7*/ { "CMSG_WARDEN_DATA", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWardenDataOpcode }, - /*0x2E8*/ { "SMSG_GROUP_JOINED_BATTLEGROUND", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2E9*/ { "MSG_BATTLEGROUND_PLAYER_POSITIONS", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlegroundPlayerPositionsOpcode}, - /*0x2EA*/ { "CMSG_PET_STOP_ATTACK", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetStopAttack }, - /*0x2EB*/ { "SMSG_BINDER_CONFIRM", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2EC*/ { "SMSG_BATTLEGROUND_PLAYER_JOINED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2ED*/ { "SMSG_BATTLEGROUND_PLAYER_LEFT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2EE*/ { "CMSG_BATTLEMASTER_JOIN", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlemasterJoinOpcode }, - /*0x2EF*/ { "SMSG_ADDON_INFO", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2F0*/ { "CMSG_PET_UNLEARN", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x2F1*/ { "SMSG_PET_UNLEARN_CONFIRM", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2F2*/ { "SMSG_PARTY_MEMBER_STATS_FULL", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2F3*/ { "CMSG_PET_SPELL_AUTOCAST", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetSpellAutocastOpcode }, - /*0x2F4*/ { "SMSG_WEATHER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2F5*/ { "SMSG_PLAY_TIME_WARNING", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2F6*/ { "SMSG_MINIGAME_SETUP", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2F7*/ { "SMSG_MINIGAME_STATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2F8*/ { "CMSG_MINIGAME_MOVE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x2F9*/ { "SMSG_MINIGAME_MOVE_FAILED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2FA*/ { "SMSG_RAID_INSTANCE_MESSAGE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2FB*/ { "SMSG_COMPRESSED_MOVES", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2FC*/ { "CMSG_GUILD_INFO_TEXT", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildChangeInfoTextOpcode }, - /*0x2FD*/ { "SMSG_CHAT_RESTRICTED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2FE*/ { "SMSG_SPLINE_SET_RUN_SPEED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x2FF*/ { "SMSG_SPLINE_SET_RUN_BACK_SPEED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x300*/ { "SMSG_SPLINE_SET_SWIM_SPEED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x301*/ { "SMSG_SPLINE_SET_WALK_SPEED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x302*/ { "SMSG_SPLINE_SET_SWIM_BACK_SPEED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x303*/ { "SMSG_SPLINE_SET_TURN_RATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x304*/ { "SMSG_SPLINE_MOVE_UNROOT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x305*/ { "SMSG_SPLINE_MOVE_FEATHER_FALL", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x306*/ { "SMSG_SPLINE_MOVE_NORMAL_FALL", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x307*/ { "SMSG_SPLINE_MOVE_SET_HOVER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x308*/ { "SMSG_SPLINE_MOVE_UNSET_HOVER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x309*/ { "SMSG_SPLINE_MOVE_WATER_WALK", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x30A*/ { "SMSG_SPLINE_MOVE_LAND_WALK", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x30B*/ { "SMSG_SPLINE_MOVE_START_SWIM", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x30C*/ { "SMSG_SPLINE_MOVE_STOP_SWIM", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x30D*/ { "SMSG_SPLINE_MOVE_SET_RUN_MODE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x30E*/ { "SMSG_SPLINE_MOVE_SET_WALK_MODE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x30F*/ { "CMSG_GM_NUKE_ACCOUNT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x310*/ { "MSG_GM_DESTROY_CORPSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x311*/ { "CMSG_GM_DESTROY_ONLINE_CORPSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x312*/ { "CMSG_ACTIVATETAXIEXPRESS", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleActivateTaxiExpressOpcode }, - /*0x313*/ { "SMSG_SET_FACTION_ATWAR", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x314*/ { "SMSG_GAMETIMEBIAS_SET", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x315*/ { "CMSG_DEBUG_ACTIONS_START", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x316*/ { "CMSG_DEBUG_ACTIONS_STOP", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x317*/ { "CMSG_SET_FACTION_INACTIVE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetFactionInactiveOpcode }, - /*0x318*/ { "CMSG_SET_WATCHED_FACTION", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetWatchedFactionOpcode }, - /*0x319*/ { "MSG_MOVE_TIME_SKIPPED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x31A*/ { "SMSG_SPLINE_MOVE_ROOT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x31B*/ { "CMSG_SET_EXPLORATION_ALL", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x31C*/ { "SMSG_INVALIDATE_PLAYER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x31D*/ { "CMSG_RESET_INSTANCES", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleResetInstancesOpcode }, - /*0x31E*/ { "SMSG_INSTANCE_RESET", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x31F*/ { "SMSG_INSTANCE_RESET_FAILED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x320*/ { "SMSG_UPDATE_LAST_INSTANCE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x321*/ { "MSG_RAID_TARGET_UPDATE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidTargetUpdateOpcode }, - /*0x322*/ { "MSG_RAID_READY_CHECK", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidReadyCheckOpcode }, - /*0x323*/ { "CMSG_LUA_USAGE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x324*/ { "SMSG_PET_ACTION_SOUND", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x325*/ { "SMSG_PET_DISMISS_SOUND", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x326*/ { "SMSG_GHOSTEE_GONE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x327*/ { "CMSG_GM_UPDATE_TICKET_STATUS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x328*/ { "SMSG_GM_TICKET_STATUS_UPDATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x329*/ { "MSG_SET_DUNGEON_DIFFICULTY", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetDungeonDifficultyOpcode}, - /*0x32A*/ { "CMSG_GMSURVEY_SUBMIT", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMSurveySubmit }, - /*0x32B*/ { "SMSG_UPDATE_INSTANCE_OWNERSHIP", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x32C*/ { "CMSG_IGNORE_KNOCKBACK_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x32D*/ { "SMSG_CHAT_PLAYER_AMBIGUOUS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x32E*/ { "MSG_DELAY_GHOST_TELEPORT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x32F*/ { "SMSG_SPELLINSTAKILLLOG", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x330*/ { "SMSG_SPELL_UPDATE_CHAIN_TARGETS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x331*/ { "CMSG_CHAT_FILTERED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x332*/ { "SMSG_EXPECTED_SPAM_RECORDS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x333*/ { "SMSG_SPELLSTEALLOG", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x334*/ { "CMSG_LOTTERY_QUERY_OBSOLETE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x335*/ { "SMSG_LOTTERY_QUERY_RESULT_OBSOLETE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x336*/ { "CMSG_BUY_LOTTERY_TICKET_OBSOLETE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x337*/ { "SMSG_LOTTERY_RESULT_OBSOLETE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x338*/ { "SMSG_CHARACTER_PROFILE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x339*/ { "SMSG_CHARACTER_PROFILE_REALM_CONNECTED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x33A*/ { "SMSG_DEFENSE_MESSAGE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x33B*/ { "SMSG_INSTANCE_DIFFICULTY", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x33C*/ { "MSG_GM_RESETINSTANCELIMIT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x33D*/ { "SMSG_MOTD", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x33E*/ { "SMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x33F*/ { "SMSG_MOVE_UNSET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x340*/ { "CMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY_ACK", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x341*/ { "MSG_MOVE_START_SWIM_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x342*/ { "MSG_MOVE_STOP_SWIM_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x343*/ { "SMSG_MOVE_SET_CAN_FLY", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x344*/ { "SMSG_MOVE_UNSET_CAN_FLY", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x345*/ { "CMSG_MOVE_SET_CAN_FLY_ACK", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveSetCanFlyAckOpcode }, - /*0x346*/ { "CMSG_MOVE_SET_FLY", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes }, - /*0x347*/ { "CMSG_SOCKET_GEMS", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSocketOpcode }, - /*0x348*/ { "CMSG_ARENA_TEAM_CREATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x349*/ { "SMSG_ARENA_TEAM_COMMAND_RESULT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x34A*/ { "MSG_MOVE_UPDATE_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x34B*/ { "CMSG_ARENA_TEAM_QUERY", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamQueryOpcode }, - /*0x34C*/ { "SMSG_ARENA_TEAM_QUERY_RESPONSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x34D*/ { "CMSG_ARENA_TEAM_ROSTER", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamRosterOpcode }, - /*0x34E*/ { "SMSG_ARENA_TEAM_ROSTER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x34F*/ { "CMSG_ARENA_TEAM_INVITE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamInviteOpcode }, - /*0x350*/ { "SMSG_ARENA_TEAM_INVITE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x351*/ { "CMSG_ARENA_TEAM_ACCEPT", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamAcceptOpcode }, - /*0x352*/ { "CMSG_ARENA_TEAM_DECLINE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamDeclineOpcode }, - /*0x353*/ { "CMSG_ARENA_TEAM_LEAVE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamLeaveOpcode }, - /*0x354*/ { "CMSG_ARENA_TEAM_REMOVE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamRemoveOpcode }, - /*0x355*/ { "CMSG_ARENA_TEAM_DISBAND", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamDisbandOpcode }, - /*0x356*/ { "CMSG_ARENA_TEAM_LEADER", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamLeaderOpcode }, - /*0x357*/ { "SMSG_ARENA_TEAM_EVENT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x358*/ { "CMSG_BATTLEMASTER_JOIN_ARENA", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlemasterJoinArena }, - /*0x359*/ { "MSG_MOVE_START_ASCEND", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes }, - /*0x35A*/ { "MSG_MOVE_STOP_ASCEND", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes }, - /*0x35B*/ { "SMSG_ARENA_TEAM_STATS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x35C*/ { "CMSG_LFG_JOIN", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgJoinOpcode }, - /*0x35D*/ { "CMSG_LFG_LEAVE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgLeaveOpcode }, - /*0x35E*/ { "CMSG_SEARCH_LFG_JOIN", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfrSearchOpcode }, - /*0x35F*/ { "CMSG_SEARCH_LFG_LEAVE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfrLeaveOpcode }, - /*0x360*/ { "SMSG_UPDATE_LFG_LIST", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x361*/ { "SMSG_LFG_PROPOSAL_UPDATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x362*/ { "CMSG_LFG_PROPOSAL_RESULT", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgProposalResultOpcode }, - /*0x363*/ { "SMSG_LFG_ROLE_CHECK_UPDATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x364*/ { "SMSG_LFG_JOIN_RESULT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x365*/ { "SMSG_LFG_QUEUE_STATUS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x366*/ { "CMSG_SET_LFG_COMMENT", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetCommentOpcode }, - /*0x367*/ { "SMSG_LFG_UPDATE_PLAYER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x368*/ { "SMSG_LFG_UPDATE_PARTY", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x369*/ { "SMSG_LFG_UPDATE_SEARCH", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x36A*/ { "CMSG_LFG_SET_ROLES", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetRolesOpcode }, - /*0x36B*/ { "CMSG_LFG_SET_NEEDS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x36C*/ { "CMSG_LFG_SET_BOOT_VOTE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetBootVoteOpcode }, - /*0x36D*/ { "SMSG_LFG_BOOT_PROPOSAL_UPDATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x36E*/ { "CMSG_LFD_PLAYER_LOCK_INFO_REQUEST", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgPlayerLockInfoRequestOpcode}, - /*0x36F*/ { "SMSG_LFG_PLAYER_INFO", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x370*/ { "CMSG_LFG_TELEPORT", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgTeleportOpcode }, - /*0x371*/ { "CMSG_LFD_PARTY_LOCK_INFO_REQUEST", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgPartyLockInfoRequestOpcode}, - /*0x372*/ { "SMSG_LFG_PARTY_INFO", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x373*/ { "SMSG_TITLE_EARNED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x374*/ { "CMSG_SET_TITLE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTitleOpcode }, - /*0x375*/ { "CMSG_CANCEL_MOUNT_AURA", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelMountAuraOpcode }, - /*0x376*/ { "SMSG_ARENA_ERROR", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x377*/ { "MSG_INSPECT_ARENA_TEAMS", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectArenaTeamsOpcode }, - /*0x378*/ { "SMSG_DEATH_RELEASE_LOC", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x379*/ { "CMSG_CANCEL_TEMP_ENCHANTMENT", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelTempEnchantmentOpcode}, - /*0x37A*/ { "SMSG_FORCED_DEATH_UPDATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x37B*/ { "CMSG_CHEAT_SET_HONOR_CURRENCY", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x37C*/ { "CMSG_CHEAT_SET_ARENA_CURRENCY", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x37D*/ { "MSG_MOVE_SET_FLIGHT_SPEED_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x37E*/ { "MSG_MOVE_SET_FLIGHT_SPEED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x37F*/ { "MSG_MOVE_SET_FLIGHT_BACK_SPEED_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x380*/ { "MSG_MOVE_SET_FLIGHT_BACK_SPEED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x381*/ { "SMSG_FORCE_FLIGHT_SPEED_CHANGE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x382*/ { "CMSG_FORCE_FLIGHT_SPEED_CHANGE_ACK", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck }, - /*0x383*/ { "SMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x384*/ { "CMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck }, - /*0x385*/ { "SMSG_SPLINE_SET_FLIGHT_SPEED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x386*/ { "SMSG_SPLINE_SET_FLIGHT_BACK_SPEED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x387*/ { "CMSG_MAELSTROM_INVALIDATE_CACHE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x388*/ { "SMSG_FLIGHT_SPLINE_SYNC", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x389*/ { "CMSG_SET_TAXI_BENCHMARK_MODE", STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTaxiBenchmarkOpcode }, - /*0x38A*/ { "SMSG_JOINED_BATTLEGROUND_QUEUE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x38B*/ { "SMSG_REALM_SPLIT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x38C*/ { "CMSG_REALM_SPLIT", STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRealmSplitOpcode }, - /*0x38D*/ { "CMSG_MOVE_CHNG_TRANSPORT", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes }, - /*0x38E*/ { "MSG_PARTY_ASSIGNMENT", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePartyAssignmentOpcode }, - /*0x38F*/ { "SMSG_OFFER_PETITION_ERROR", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x390*/ { "SMSG_TIME_SYNC_REQ", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x391*/ { "CMSG_TIME_SYNC_RESP", STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleTimeSyncResp }, - /*0x392*/ { "CMSG_SEND_LOCAL_EVENT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x393*/ { "CMSG_SEND_GENERAL_TRIGGER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x394*/ { "CMSG_SEND_COMBAT_TRIGGER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x395*/ { "CMSG_MAELSTROM_GM_SENT_MAIL", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x396*/ { "SMSG_RESET_FAILED_NOTIFY", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x397*/ { "SMSG_REAL_GROUP_UPDATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x398*/ { "SMSG_LFG_DISABLED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x399*/ { "CMSG_ACTIVE_PVP_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x39A*/ { "CMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x39B*/ { "SMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY_RESPONSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x39C*/ { "SMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY_RESPONSE_WRITE_FILE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x39D*/ { "SMSG_UPDATE_COMBO_POINTS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x39E*/ { "SMSG_VOICE_SESSION_ROSTER_UPDATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x39F*/ { "SMSG_VOICE_SESSION_LEAVE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x3A0*/ { "SMSG_VOICE_SESSION_ADJUST_PRIORITY", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x3A1*/ { "CMSG_VOICE_SET_TALKER_MUTED_REQUEST", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x3A2*/ { "SMSG_VOICE_SET_TALKER_MUTED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x3A3*/ { "SMSG_INIT_EXTRA_AURA_INFO_OBSOLETE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x3A4*/ { "SMSG_SET_EXTRA_AURA_INFO_OBSOLETE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x3A5*/ { "SMSG_SET_EXTRA_AURA_INFO_NEED_UPDATE_OBSOLETE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x3A6*/ { "SMSG_CLEAR_EXTRA_AURA_INFO_OBSOLETE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x3A7*/ { "MSG_MOVE_START_DESCEND", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes }, - /*0x3A8*/ { "CMSG_IGNORE_REQUIREMENTS_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x3A9*/ { "SMSG_IGNORE_REQUIREMENTS_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x3AA*/ { "SMSG_SPELL_CHANCE_PROC_LOG", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x3AB*/ { "CMSG_MOVE_SET_RUN_SPEED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x3AC*/ { "SMSG_DISMOUNT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x3AD*/ { "MSG_MOVE_UPDATE_CAN_FLY", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x3AE*/ { "MSG_RAID_READY_CHECK_CONFIRM", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x3AF*/ { "CMSG_VOICE_SESSION_ENABLE", STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleVoiceSessionEnableOpcode }, - /*0x3B0*/ { "SMSG_VOICE_SESSION_ENABLE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x3B1*/ { "SMSG_VOICE_PARENTAL_CONTROLS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x3B2*/ { "CMSG_GM_WHISPER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x3B3*/ { "SMSG_GM_MESSAGECHAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x3B4*/ { "MSG_GM_GEARRATING", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x3B5*/ { "CMSG_COMMENTATOR_ENABLE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x3B6*/ { "SMSG_COMMENTATOR_STATE_CHANGED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x3B7*/ { "CMSG_COMMENTATOR_GET_MAP_INFO", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x3B8*/ { "SMSG_COMMENTATOR_MAP_INFO", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x3B9*/ { "CMSG_COMMENTATOR_GET_PLAYER_INFO", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x3BA*/ { "SMSG_COMMENTATOR_GET_PLAYER_INFO", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x3BB*/ { "SMSG_COMMENTATOR_PLAYER_INFO", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x3BC*/ { "CMSG_COMMENTATOR_ENTER_INSTANCE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x3BD*/ { "CMSG_COMMENTATOR_EXIT_INSTANCE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x3BE*/ { "CMSG_COMMENTATOR_INSTANCE_COMMAND", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x3BF*/ { "SMSG_CLEAR_TARGET", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x3C0*/ { "CMSG_BOT_DETECTED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x3C1*/ { "SMSG_CROSSED_INEBRIATION_THRESHOLD", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x3C2*/ { "CMSG_CHEAT_PLAYER_LOGIN", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x3C3*/ { "CMSG_CHEAT_PLAYER_LOOKUP", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x3C4*/ { "SMSG_CHEAT_PLAYER_LOOKUP", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x3C5*/ { "SMSG_KICK_REASON", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x3C6*/ { "MSG_RAID_READY_CHECK_FINISHED", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidReadyCheckFinishedOpcode}, - /*0x3C7*/ { "CMSG_COMPLAIN", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleComplainOpcode }, - /*0x3C8*/ { "SMSG_COMPLAIN_RESULT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x3C9*/ { "SMSG_FEATURE_SYSTEM_STATUS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x3CA*/ { "CMSG_GM_SHOW_COMPLAINTS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x3CB*/ { "CMSG_GM_UNSQUELCH", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x3CC*/ { "CMSG_CHANNEL_SILENCE_VOICE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x3CD*/ { "CMSG_CHANNEL_SILENCE_ALL", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x3CE*/ { "CMSG_CHANNEL_UNSILENCE_VOICE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x3CF*/ { "CMSG_CHANNEL_UNSILENCE_ALL", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x3D0*/ { "CMSG_TARGET_CAST", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x3D1*/ { "CMSG_TARGET_SCRIPT_CAST", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x3D2*/ { "CMSG_CHANNEL_DISPLAY_LIST", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelDisplayListQuery }, - /*0x3D3*/ { "CMSG_SET_ACTIVE_VOICE_CHANNEL", STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActiveVoiceChannel }, - /*0x3D4*/ { "CMSG_GET_CHANNEL_MEMBER_COUNT", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGetChannelMemberCount }, - /*0x3D5*/ { "SMSG_CHANNEL_MEMBER_COUNT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x3D6*/ { "CMSG_CHANNEL_VOICE_ON", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelVoiceOnOpcode }, - /*0x3D7*/ { "CMSG_CHANNEL_VOICE_OFF", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x3D8*/ { "CMSG_DEBUG_LIST_TARGETS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x3D9*/ { "SMSG_DEBUG_LIST_TARGETS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x3DA*/ { "SMSG_AVAILABLE_VOICE_CHANNEL", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x3DB*/ { "CMSG_ADD_VOICE_IGNORE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x3DC*/ { "CMSG_DEL_VOICE_IGNORE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x3DD*/ { "CMSG_PARTY_SILENCE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x3DE*/ { "CMSG_PARTY_UNSILENCE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x3DF*/ { "MSG_NOTIFY_PARTY_SQUELCH", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x3E0*/ { "SMSG_COMSAT_RECONNECT_TRY", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x3E1*/ { "SMSG_COMSAT_DISCONNECT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x3E2*/ { "SMSG_COMSAT_CONNECT_FAIL", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x3E3*/ { "SMSG_VOICE_CHAT_STATUS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x3E4*/ { "CMSG_REPORT_PVP_AFK", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReportPvPAFK }, - /*0x3E5*/ { "SMSG_REPORT_PVP_AFK_RESULT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x3E6*/ { "CMSG_GUILD_BANKER_ACTIVATE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankerActivate }, - /*0x3E7*/ { "CMSG_GUILD_BANK_QUERY_TAB", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankQueryTab }, - /*0x3E8*/ { "SMSG_GUILD_BANK_LIST", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x3E9*/ { "CMSG_GUILD_BANK_SWAP_ITEMS", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankSwapItems }, - /*0x3EA*/ { "CMSG_GUILD_BANK_BUY_TAB", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankBuyTab }, - /*0x3EB*/ { "CMSG_GUILD_BANK_UPDATE_TAB", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankUpdateTab }, - /*0x3EC*/ { "CMSG_GUILD_BANK_DEPOSIT_MONEY", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankDepositMoney }, - /*0x3ED*/ { "CMSG_GUILD_BANK_WITHDRAW_MONEY", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankWithdrawMoney }, - /*0x3EE*/ { "MSG_GUILD_BANK_LOG_QUERY", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankLogQuery }, - /*0x3EF*/ { "CMSG_SET_CHANNEL_WATCH", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetChannelWatch }, - /*0x3F0*/ { "SMSG_USERLIST_ADD", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x3F1*/ { "SMSG_USERLIST_REMOVE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x3F2*/ { "SMSG_USERLIST_UPDATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x3F3*/ { "CMSG_CLEAR_CHANNEL_WATCH", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x3F4*/ { "SMSG_INSPECT_TALENT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x3F5*/ { "SMSG_GOGOGO_OBSOLETE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x3F6*/ { "SMSG_ECHO_PARTY_SQUELCH", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x3F7*/ { "CMSG_SET_TITLE_SUFFIX", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x3F8*/ { "CMSG_SPELLCLICK", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSpellClick }, - /*0x3F9*/ { "SMSG_LOOT_LIST", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x3FA*/ { "CMSG_GM_CHARACTER_RESTORE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x3FB*/ { "CMSG_GM_CHARACTER_SAVE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x3FC*/ { "SMSG_VOICESESSION_FULL", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x3FD*/ { "MSG_GUILD_PERMISSIONS", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildPermissions }, - /*0x3FE*/ { "MSG_GUILD_BANK_MONEY_WITHDRAWN", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankMoneyWithdrawn }, - /*0x3FF*/ { "MSG_GUILD_EVENT_LOG_QUERY", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildEventLogQueryOpcode }, - /*0x400*/ { "CMSG_MAELSTROM_RENAME_GUILD", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x401*/ { "CMSG_GET_MIRRORIMAGE_DATA", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMirrorImageDataRequest }, - /*0x402*/ { "SMSG_MIRRORIMAGE_DATA", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x403*/ { "SMSG_FORCE_DISPLAY_UPDATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x404*/ { "SMSG_SPELL_CHANCE_RESIST_PUSHBACK", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x405*/ { "CMSG_IGNORE_DIMINISHING_RETURNS_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x406*/ { "SMSG_IGNORE_DIMINISHING_RETURNS_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x407*/ { "CMSG_KEEP_ALIVE", STATUS_NEVER, PROCESS_THREADUNSAFE, &WorldSession::Handle_EarlyProccess }, - /*0x408*/ { "SMSG_RAID_READY_CHECK_ERROR", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x409*/ { "CMSG_OPT_OUT_OF_LOOT", STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleOptOutOfLootOpcode }, - /*0x40A*/ { "MSG_QUERY_GUILD_BANK_TEXT", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryGuildBankTabText }, - /*0x40B*/ { "CMSG_SET_GUILD_BANK_TEXT", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetGuildBankTabText }, - /*0x40C*/ { "CMSG_SET_GRANTABLE_LEVELS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x40D*/ { "CMSG_GRANT_LEVEL", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGrantLevel }, - /*0x40E*/ { "CMSG_REFER_A_FRIEND", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x40F*/ { "MSG_GM_CHANGE_ARENA_RATING", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x410*/ { "CMSG_DECLINE_CHANNEL_INVITE", STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleChannelDeclineInvite }, - /*0x411*/ { "SMSG_GROUPACTION_THROTTLED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x412*/ { "SMSG_OVERRIDE_LIGHT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x413*/ { "SMSG_TOTEM_CREATED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x414*/ { "CMSG_TOTEM_DESTROYED", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTotemDestroyed }, - /*0x415*/ { "CMSG_EXPIRE_RAID_INSTANCE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x416*/ { "CMSG_NO_SPELL_VARIANCE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x417*/ { "CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverStatusMultipleQuery}, - /*0x418*/ { "SMSG_QUESTGIVER_STATUS_MULTIPLE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x419*/ { "CMSG_SET_PLAYER_DECLINED_NAMES", STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetPlayerDeclinedNames }, - /*0x41A*/ { "SMSG_SET_PLAYER_DECLINED_NAMES_RESULT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x41B*/ { "CMSG_QUERY_SERVER_BUCK_DATA", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x41C*/ { "CMSG_CLEAR_SERVER_BUCK_DATA", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x41D*/ { "SMSG_SERVER_BUCK_DATA", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x41E*/ { "SMSG_SEND_UNLEARN_SPELLS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x41F*/ { "SMSG_PROPOSE_LEVEL_GRANT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x420*/ { "CMSG_ACCEPT_LEVEL_GRANT", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAcceptGrantLevel }, - /*0x421*/ { "SMSG_REFER_A_FRIEND_FAILURE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x422*/ { "SMSG_SPLINE_MOVE_SET_FLYING", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x423*/ { "SMSG_SPLINE_MOVE_UNSET_FLYING", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x424*/ { "SMSG_SUMMON_CANCEL", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x425*/ { "CMSG_CHANGE_PERSONAL_ARENA_RATING", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x426*/ { "CMSG_ALTER_APPEARANCE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAlterAppearance }, - /*0x427*/ { "SMSG_ENABLE_BARBER_SHOP", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x428*/ { "SMSG_BARBER_SHOP_RESULT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x429*/ { "CMSG_CALENDAR_GET_CALENDAR", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGetCalendar }, - /*0x42A*/ { "CMSG_CALENDAR_GET_EVENT", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGetEvent }, - /*0x42B*/ { "CMSG_CALENDAR_GUILD_FILTER", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGuildFilter }, - /*0x42C*/ { "CMSG_CALENDAR_ARENA_TEAM", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarArenaTeam }, - /*0x42D*/ { "CMSG_CALENDAR_ADD_EVENT", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarAddEvent }, - /*0x42E*/ { "CMSG_CALENDAR_UPDATE_EVENT", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarUpdateEvent }, - /*0x42F*/ { "CMSG_CALENDAR_REMOVE_EVENT", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarRemoveEvent }, - /*0x430*/ { "CMSG_CALENDAR_COPY_EVENT", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarCopyEvent }, - /*0x431*/ { "CMSG_CALENDAR_EVENT_INVITE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventInvite }, - /*0x432*/ { "CMSG_CALENDAR_EVENT_RSVP", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventRsvp }, - /*0x433*/ { "CMSG_CALENDAR_EVENT_REMOVE_INVITE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventRemoveInvite }, - /*0x434*/ { "CMSG_CALENDAR_EVENT_STATUS", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventStatus }, - /*0x435*/ { "CMSG_CALENDAR_EVENT_MODERATOR_STATUS", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventModeratorStatus}, - /*0x436*/ { "SMSG_CALENDAR_SEND_CALENDAR", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x437*/ { "SMSG_CALENDAR_SEND_EVENT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x438*/ { "SMSG_CALENDAR_FILTER_GUILD", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x439*/ { "SMSG_CALENDAR_ARENA_TEAM", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x43A*/ { "SMSG_CALENDAR_EVENT_INVITE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x43B*/ { "SMSG_CALENDAR_EVENT_INVITE_REMOVED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x43C*/ { "SMSG_CALENDAR_EVENT_STATUS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x43D*/ { "SMSG_CALENDAR_COMMAND_RESULT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x43E*/ { "SMSG_CALENDAR_RAID_LOCKOUT_ADDED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x43F*/ { "SMSG_CALENDAR_RAID_LOCKOUT_REMOVED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x440*/ { "SMSG_CALENDAR_EVENT_INVITE_ALERT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x441*/ { "SMSG_CALENDAR_EVENT_INVITE_REMOVED_ALERT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x442*/ { "SMSG_CALENDAR_EVENT_INVITE_STATUS_ALERT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x443*/ { "SMSG_CALENDAR_EVENT_REMOVED_ALERT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x444*/ { "SMSG_CALENDAR_EVENT_UPDATED_ALERT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x445*/ { "SMSG_CALENDAR_EVENT_MODERATOR_STATUS_ALERT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x446*/ { "CMSG_CALENDAR_COMPLAIN", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarComplain }, - /*0x447*/ { "CMSG_CALENDAR_GET_NUM_PENDING", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGetNumPending }, - /*0x448*/ { "SMSG_CALENDAR_SEND_NUM_PENDING", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x449*/ { "CMSG_SAVE_DANCE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x44A*/ { "SMSG_NOTIFY_DANCE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x44B*/ { "CMSG_PLAY_DANCE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x44C*/ { "SMSG_PLAY_DANCE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x44D*/ { "CMSG_LOAD_DANCES", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x44E*/ { "CMSG_STOP_DANCE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x44F*/ { "SMSG_STOP_DANCE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x450*/ { "CMSG_SYNC_DANCE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x451*/ { "CMSG_DANCE_QUERY", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x452*/ { "SMSG_DANCE_QUERY_RESPONSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x453*/ { "SMSG_INVALIDATE_DANCE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x454*/ { "CMSG_DELETE_DANCE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x455*/ { "SMSG_LEARNED_DANCE_MOVES", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x456*/ { "CMSG_LEARN_DANCE_MOVE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x457*/ { "CMSG_UNLEARN_DANCE_MOVE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x458*/ { "CMSG_SET_RUNE_COUNT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x459*/ { "CMSG_SET_RUNE_COOLDOWN", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x45A*/ { "MSG_MOVE_SET_PITCH_RATE_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x45B*/ { "MSG_MOVE_SET_PITCH_RATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x45C*/ { "SMSG_FORCE_PITCH_RATE_CHANGE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x45D*/ { "CMSG_FORCE_PITCH_RATE_CHANGE_ACK", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x45E*/ { "SMSG_SPLINE_SET_PITCH_RATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x45F*/ { "CMSG_CALENDAR_EVENT_INVITE_NOTES", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x460*/ { "SMSG_CALENDAR_EVENT_INVITE_NOTES", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x461*/ { "SMSG_CALENDAR_EVENT_INVITE_NOTES_ALERT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x462*/ { "CMSG_UPDATE_MISSILE_TRAJECTORY", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x463*/ { "SMSG_UPDATE_ACCOUNT_DATA_COMPLETE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x464*/ { "SMSG_TRIGGER_MOVIE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x465*/ { "CMSG_COMPLETE_MOVIE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x466*/ { "CMSG_SET_GLYPH_SLOT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x467*/ { "CMSG_SET_GLYPH", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x468*/ { "SMSG_ACHIEVEMENT_EARNED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x469*/ { "SMSG_DYNAMIC_DROP_ROLL_RESULT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x46A*/ { "SMSG_CRITERIA_UPDATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x46B*/ { "CMSG_QUERY_INSPECT_ACHIEVEMENTS", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryInspectAchievements }, - /*0x46C*/ { "SMSG_RESPOND_INSPECT_ACHIEVEMENTS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x46D*/ { "CMSG_DISMISS_CONTROLLED_VEHICLE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDismissControlledVehicle }, - /*0x46E*/ { "CMSG_COMPLETE_ACHIEVEMENT_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x46F*/ { "SMSG_QUESTUPDATE_ADD_PVP_KILL", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x470*/ { "CMSG_SET_CRITERIA_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x471*/ { "SMSG_CALENDAR_RAID_LOCKOUT_UPDATED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x472*/ { "CMSG_UNITANIMTIER_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x473*/ { "CMSG_CHAR_CUSTOMIZE", STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharCustomize }, - /*0x474*/ { "SMSG_CHAR_CUSTOMIZE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x475*/ { "SMSG_PET_RENAMEABLE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x476*/ { "CMSG_REQUEST_VEHICLE_EXIT", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestVehicleExit }, - /*0x477*/ { "CMSG_REQUEST_VEHICLE_PREV_SEAT", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle}, - /*0x478*/ { "CMSG_REQUEST_VEHICLE_NEXT_SEAT", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle}, - /*0x479*/ { "CMSG_REQUEST_VEHICLE_SWITCH_SEAT", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle}, - /*0x47A*/ { "CMSG_PET_LEARN_TALENT", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetLearnTalent }, - /*0x47B*/ { "CMSG_PET_UNLEARN_TALENTS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x47C*/ { "SMSG_SET_PHASE_SHIFT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x47D*/ { "SMSG_ALL_ACHIEVEMENT_DATA", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x47E*/ { "CMSG_FORCE_SAY_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x47F*/ { "SMSG_HEALTH_UPDATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x480*/ { "SMSG_POWER_UPDATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x481*/ { "CMSG_GAMEOBJ_REPORT_USE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGameobjectReportUse }, - /*0x482*/ { "SMSG_HIGHEST_THREAT_UPDATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x483*/ { "SMSG_THREAT_UPDATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x484*/ { "SMSG_THREAT_REMOVE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x485*/ { "SMSG_THREAT_CLEAR", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x486*/ { "SMSG_CONVERT_RUNE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x487*/ { "SMSG_RESYNC_RUNES", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x488*/ { "SMSG_ADD_RUNE_POWER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x489*/ { "CMSG_START_QUEST", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x48A*/ { "CMSG_REMOVE_GLYPH", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRemoveGlyph }, - /*0x48B*/ { "CMSG_DUMP_OBJECTS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x48C*/ { "SMSG_DUMP_OBJECTS_DATA", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x48D*/ { "CMSG_DISMISS_CRITTER", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDismissCritter }, - /*0x48E*/ { "SMSG_NOTIFY_DEST_LOC_SPELL_CAST", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x48F*/ { "CMSG_AUCTION_LIST_PENDING_SALES", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListPendingSales }, - /*0x490*/ { "SMSG_AUCTION_LIST_PENDING_SALES", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x491*/ { "SMSG_MODIFY_COOLDOWN", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x492*/ { "SMSG_PET_UPDATE_COMBO_POINTS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x493*/ { "CMSG_ENABLETAXI", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleTaxiQueryAvailableNodes }, - /*0x494*/ { "SMSG_PRE_RESURRECT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x495*/ { "SMSG_AURA_UPDATE_ALL", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x496*/ { "SMSG_AURA_UPDATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x497*/ { "CMSG_FLOOD_GRACE_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x498*/ { "SMSG_SERVER_FIRST_ACHIEVEMENT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x499*/ { "SMSG_PET_LEARNED_SPELL", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x49A*/ { "SMSG_PET_REMOVED_SPELL", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x49B*/ { "CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle}, - /*0x49C*/ { "CMSG_HEARTH_AND_RESURRECT", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleHearthAndResurrect }, - /*0x49D*/ { "SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x49E*/ { "SMSG_CRITERIA_DELETED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x49F*/ { "SMSG_ACHIEVEMENT_DELETED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x4A0*/ { "CMSG_SERVER_INFO_QUERY", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x4A1*/ { "SMSG_SERVER_INFO_RESPONSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x4A2*/ { "CMSG_CHECK_LOGIN_CRITERIA", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x4A3*/ { "SMSG_SERVER_BUCK_DATA_START", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x4A4*/ { "CMSG_SET_BREATH", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x4A5*/ { "CMSG_QUERY_VEHICLE_STATUS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x4A6*/ { "SMSG_BATTLEGROUND_INFO_THROTTLED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x4A7*/ { "SMSG_PLAYER_VEHICLE_DATA", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x4A8*/ { "CMSG_PLAYER_VEHICLE_ENTER", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEnterPlayerVehicle }, - /*0x4A9*/ { "CMSG_CONTROLLER_EJECT_PASSENGER", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEjectPassenger }, - /*0x4AA*/ { "SMSG_PET_GUIDS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x4AB*/ { "SMSG_CLIENTCACHE_VERSION", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x4AC*/ { "CMSG_CHANGE_GDF_ARENA_RATING", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x4AD*/ { "CMSG_SET_ARENA_TEAM_RATING_BY_INDEX", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x4AE*/ { "CMSG_SET_ARENA_TEAM_WEEKLY_GAMES", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x4AF*/ { "CMSG_SET_ARENA_TEAM_SEASON_GAMES", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x4B0*/ { "CMSG_SET_ARENA_MEMBER_WEEKLY_GAMES", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x4B1*/ { "CMSG_SET_ARENA_MEMBER_SEASON_GAMES", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x4B2*/ { "SMSG_ITEM_REFUND_INFO_RESPONSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x4B3*/ { "CMSG_ITEM_REFUND_INFO", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemRefundInfoRequest }, - /*0x4B4*/ { "CMSG_ITEM_REFUND", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemRefund }, - /*0x4B5*/ { "SMSG_ITEM_REFUND_RESULT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x4B6*/ { "CMSG_CORPSE_MAP_POSITION_QUERY", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCorpseMapPositionQuery }, - /*0x4B7*/ { "SMSG_CORPSE_MAP_POSITION_QUERY_RESPONSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x4B8*/ { "CMSG_UNUSED5", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::Handle_NULL }, - /*0x4B9*/ { "CMSG_UNUSED6", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x4BA*/ { "CMSG_CALENDAR_EVENT_SIGNUP", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x4BB*/ { "SMSG_CALENDAR_CLEAR_PENDING_ACTION", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x4BC*/ { "SMSG_EQUIPMENT_SET_LIST", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x4BD*/ { "CMSG_EQUIPMENT_SET_SAVE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetSave }, - /*0x4BE*/ { "CMSG_UPDATE_PROJECTILE_POSITION", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateProjectilePosition }, - /*0x4BF*/ { "SMSG_SET_PROJECTILE_POSITION", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x4C0*/ { "SMSG_TALENTS_INFO", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x4C1*/ { "CMSG_LEARN_PREVIEW_TALENTS", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnPreviewTalents }, - /*0x4C2*/ { "CMSG_LEARN_PREVIEW_TALENTS_PET", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnPreviewTalentsPet }, - /*0x4C3*/ { "CMSG_SET_ACTIVE_TALENT_GROUP_OBSOLETE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x4C4*/ { "CMSG_GM_GRANT_ACHIEVEMENT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x4C5*/ { "CMSG_GM_REMOVE_ACHIEVEMENT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x4C6*/ { "CMSG_GM_SET_CRITERIA_FOR_PLAYER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x4C7*/ { "SMSG_ARENA_OPPONENT_UPDATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x4C8*/ { "SMSG_ARENA_TEAM_CHANGE_FAILED_QUEUED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x4C9*/ { "CMSG_PROFILEDATA_REQUEST", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x4CA*/ { "SMSG_PROFILEDATA_RESPONSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x4CB*/ { "CMSG_START_BATTLEFIELD_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x4CC*/ { "CMSG_END_BATTLEFIELD_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x4CD*/ { "SMSG_MULTIPLE_PACKETS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x4CE*/ { "SMSG_MOVE_GRAVITY_DISABLE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x4CF*/ { "CMSG_MOVE_GRAVITY_DISABLE_ACK", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x4D0*/ { "SMSG_MOVE_GRAVITY_ENABLE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x4D1*/ { "CMSG_MOVE_GRAVITY_ENABLE_ACK", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x4D2*/ { "MSG_MOVE_GRAVITY_CHNG", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x4D3*/ { "SMSG_SPLINE_MOVE_GRAVITY_DISABLE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x4D4*/ { "SMSG_SPLINE_MOVE_GRAVITY_ENABLE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x4D5*/ { "CMSG_EQUIPMENT_SET_USE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetUse }, - /*0x4D6*/ { "SMSG_EQUIPMENT_SET_USE_RESULT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x4D7*/ { "CMSG_FORCE_ANIM", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x4D8*/ { "SMSG_FORCE_ANIM", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x4D9*/ { "CMSG_CHAR_FACTION_CHANGE", STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharFactionOrRaceChange }, - /*0x4DA*/ { "SMSG_CHAR_FACTION_CHANGE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x4DB*/ { "CMSG_PVP_QUEUE_STATS_REQUEST", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x4DC*/ { "SMSG_PVP_QUEUE_STATS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x4DD*/ { "CMSG_SET_PAID_SERVICE_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x4DE*/ { "SMSG_BATTLEFIELD_MGR_ENTRY_INVITE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x4DF*/ { "CMSG_BATTLEFIELD_MGR_ENTRY_INVITE_RESPONSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x4E0*/ { "SMSG_BATTLEFIELD_MGR_ENTERED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x4E1*/ { "SMSG_BATTLEFIELD_MGR_QUEUE_INVITE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x4E2*/ { "CMSG_BATTLEFIELD_MGR_QUEUE_INVITE_RESPONSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x4E3*/ { "CMSG_BATTLEFIELD_MGR_QUEUE_REQUEST", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x4E4*/ { "SMSG_BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x4E5*/ { "SMSG_BATTLEFIELD_MGR_EJECT_PENDING", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x4E6*/ { "SMSG_BATTLEFIELD_MGR_EJECTED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x4E7*/ { "CMSG_BATTLEFIELD_MGR_EXIT_REQUEST", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x4E8*/ { "SMSG_BATTLEFIELD_MGR_STATE_CHANGE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x4E9*/ { "CMSG_BATTLEFIELD_MANAGER_ADVANCE_STATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x4EA*/ { "CMSG_BATTLEFIELD_MANAGER_SET_NEXT_TRANSITION_TIME", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x4EB*/ { "MSG_SET_RAID_DIFFICULTY", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetRaidDifficultyOpcode }, - /*0x4EC*/ { "CMSG_TOGGLE_XP_GAIN", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x4ED*/ { "SMSG_TOGGLE_XP_GAIN", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x4EE*/ { "SMSG_GMRESPONSE_DB_ERROR", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x4EF*/ { "SMSG_GMRESPONSE_RECEIVED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x4F0*/ { "CMSG_GMRESPONSE_RESOLVE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMResponseResolve }, - /*0x4F1*/ { "SMSG_GMRESPONSE_STATUS_UPDATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x4F2*/ { "SMSG_GMRESPONSE_CREATE_TICKET", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x4F3*/ { "CMSG_GMRESPONSE_CREATE_TICKET", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x4F4*/ { "CMSG_SERVERINFO", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x4F5*/ { "SMSG_SERVERINFO", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x4F6*/ { "CMSG_WORLD_STATE_UI_TIMER_UPDATE", STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleWorldStateUITimerUpdate }, - /*0x4F7*/ { "SMSG_WORLD_STATE_UI_TIMER_UPDATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x4F8*/ { "CMSG_CHAR_RACE_CHANGE", STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharFactionOrRaceChange }, - /*0x4F9*/ { "MSG_VIEW_PHASE_SHIFT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x4FA*/ { "SMSG_TALENTS_INVOLUNTARILY_RESET", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x4FB*/ { "CMSG_DEBUG_SERVER_GEO", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x4FC*/ { "SMSG_DEBUG_SERVER_GEO", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x4FD*/ { "SMSG_LOOT_SLOT_CHANGED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x4FE*/ { "UMSG_UPDATE_GROUP_INFO", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x4FF*/ { "CMSG_READY_FOR_ACCOUNT_DATA_TIMES", STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleReadyForAccountDataTimes }, - /*0x500*/ { "CMSG_QUERY_QUESTS_COMPLETED", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryQuestsCompleted }, - /*0x501*/ { "SMSG_QUERY_QUESTS_COMPLETED_RESPONSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x502*/ { "CMSG_GM_REPORT_LAG", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReportLag }, - /*0x503*/ { "CMSG_AFK_MONITOR_INFO_REQUEST", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x504*/ { "SMSG_AFK_MONITOR_INFO_RESPONSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x505*/ { "CMSG_AFK_MONITOR_INFO_CLEAR", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x506*/ { "SMSG_CORPSE_IS_NOT_IN_INSTANCE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x507*/ { "CMSG_GM_NUKE_CHARACTER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x508*/ { "CMSG_SET_ALLOW_LOW_LEVEL_RAID1", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x509*/ { "CMSG_SET_ALLOW_LOW_LEVEL_RAID2", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x50A*/ { "SMSG_CAMERA_SHAKE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x50B*/ { "SMSG_UPDATE_ITEM_ENCHANTMENTS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x50C*/ { "CMSG_SET_CHARACTER_MODEL", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x50D*/ { "SMSG_REDIRECT_CLIENT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x50E*/ { "CMSG_REDIRECTION_FAILED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x50F*/ { "SMSG_SUSPEND_COMMS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x510*/ { "CMSG_SUSPEND_COMMS_ACK", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x511*/ { "SMSG_FORCE_SEND_QUEUED_PACKETS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x512*/ { "CMSG_REDIRECTION_AUTH_PROOF", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x513*/ { "CMSG_DROP_NEW_CONNECTION", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x514*/ { "SMSG_SEND_ALL_COMBAT_LOG", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x515*/ { "SMSG_OPEN_LFG_DUNGEON_FINDER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x516*/ { "SMSG_MOVE_SET_COLLISION_HGT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x517*/ { "CMSG_MOVE_SET_COLLISION_HGT_ACK", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x518*/ { "MSG_MOVE_SET_COLLISION_HGT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x519*/ { "CMSG_CLEAR_RANDOM_BG_WIN_TIME", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x51A*/ { "CMSG_CLEAR_HOLIDAY_BG_WIN_TIME", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x51B*/ { "CMSG_COMMENTATOR_SKIRMISH_QUEUE_COMMAND", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x51C*/ { "SMSG_COMMENTATOR_SKIRMISH_QUEUE_RESULT1", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x51D*/ { "SMSG_COMMENTATOR_SKIRMISH_QUEUE_RESULT2", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x51E*/ { "SMSG_COMPRESSED_UNKNOWN_1310", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, + +#define DEFINE_OPCODE_HANDLER(opcode, status, processing, handler) \ + if (opcode < NUM_OPCODE_HANDLERS) { \ + if (opcodeTable[opcode] != NULL) \ + { \ + sLog->outError("Tried to override handler of %s with %s (opcode %u)", \ + opcodeTable[opcode]->name, #opcode, opcode); \ + } \ + else opcodeTable[opcode] = new OpcodeHandler(#opcode, status, processing, handler); \ + } + + memset(opcodeTable, 0, sizeof(opcodeTable)); + + //DEFINE_OPCODE_HANDLER(MSG_NULL_ACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_BOOTME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DBLOOKUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_DBLOOKUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_QUERY_OBJECT_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_QUERY_OBJECT_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_QUERY_OBJECT_ROTATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_QUERY_OBJECT_ROTATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_WORLD_TELEPORT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWorldTeleportOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_TELEPORT_TO_UNIT, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_ZONE_MAP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_ZONE_MAP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_CHANGECELLZONE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_CHARACTER_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_CHARACTER_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_RECHARGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LEARN_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CREATEMONSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DESTROYMONSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CREATEITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CREATEGAMEOBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_CHECK_FOR_BOTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_MAKEMONSTERATTACKGUID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_BOT_DETECTED2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_FORCEACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_FORCEACTIONONOTHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_FORCEACTIONSHOW, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_FORCEACTIONSHOW, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_PETGODMODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_PETGODMODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_REFER_A_FRIEND_EXPIRED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_WEATHER_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_UNDRESSPLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_BEASTMASTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GODMODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_GODMODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_SETMONEY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LEVEL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_PET_LEVEL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_WORLDSTATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_COOLDOWN_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_USE_SKILL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_FLAG_QUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_FLAG_QUEST_FINISH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_QUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SEND_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_AISTATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_DEBUG_AISTATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_DISABLE_PVP_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_ADVANCE_SPAWN_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_DESTRUCTIBLE_BUILDING_DAMAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_AUTH_SRP6_BEGIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_AUTH_SRP6_PROOF, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_AUTH_SRP6_RECODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_CHAR_CREATE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharCreateOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_CHAR_ENUM, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharEnumOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_CHAR_DELETE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharDeleteOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_AUTH_SRP6_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CHAR_CREATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CHAR_ENUM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CHAR_DELETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(CMSG_PLAYER_LOGIN, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayerLoginOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_NEW_WORLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_TRANSFER_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_TRANSFER_ABORTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHARACTER_LOGIN_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LOGIN_SETTIMESPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GAMETIME_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_GAMETIME_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_GAMETIME_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_GAMESPEED_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_GAMESPEED_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_SERVERTIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_SERVERTIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_PLAYER_LOGOUT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayerLogoutOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_LOGOUT_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLogoutRequestOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_LOGOUT_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LOGOUT_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_LOGOUT_CANCEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLogoutCancelOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_LOGOUT_CANCEL_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNameQueryOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_PET_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetNameQuery ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_QUERY, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildQueryOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_ITEM_QUERY_SINGLE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleItemQuerySingleOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_ITEM_QUERY_MULTIPLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_ITEM_QUERY_SINGLE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ITEM_QUERY_MULTIPLE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_PAGE_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePageTextQueryOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_PAGE_TEXT_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_QUEST_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestQueryOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_QUEST_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJECT_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleGameObjectQueryOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_CREATURE_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleCreatureQueryOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_CREATURE_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_WHO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWhoOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_WHO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_WHOIS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWhoisOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_WHOIS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_CONTACT_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleContactListOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_CONTACT_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_FRIEND_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_ADD_FRIEND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddFriendOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_DEL_FRIEND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDelFriendOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_CONTACT_NOTES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetContactNotesOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_ADD_IGNORE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddIgnoreOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_DEL_IGNORE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDelIgnoreOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GROUP_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupInviteOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_GROUP_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_GROUP_CANCEL, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_GROUP_CANCEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_GROUP_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupAcceptOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GROUP_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupDeclineOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_GROUP_DECLINE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_GROUP_UNINVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupUninviteOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GROUP_UNINVITE_GUID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupUninviteGuidOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_GROUP_UNINVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_GROUP_SET_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupSetLeaderOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_GROUP_SET_LEADER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_LOOT_METHOD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMethodOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GROUP_DISBAND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupDisbandOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_GROUP_DESTROYED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GROUP_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PARTY_MEMBER_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PARTY_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(UMSG_UPDATE_GROUP_MEMBERS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_CREATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildCreateOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildInviteOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildAcceptOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDeclineOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_DECLINE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildInfoOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_ROSTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildRosterOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_ROSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_PROMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildPromoteOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_DEMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDemoteOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildLeaveOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_REMOVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildRemoveOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_DISBAND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDisbandOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildLeaderOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_MOTD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildMOTDOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(UMSG_UPDATE_GUILD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_MESSAGECHAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_JOIN_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleJoinChannel ); + //DEFINE_OPCODE_HANDLER(CMSG_LEAVE_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLeaveChannel ); + //DEFINE_OPCODE_HANDLER(SMSG_CHANNEL_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelList ); + //DEFINE_OPCODE_HANDLER(SMSG_CHANNEL_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_PASSWORD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelPassword ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_SET_OWNER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelSetOwner ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_OWNER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelOwner ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_MODERATOR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelModerator ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNMODERATOR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelUnmoderator ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_MUTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelMute ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNMUTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelUnmute ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelInvite ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_KICK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelKick ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_BAN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelBan ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNBAN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelUnban ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_ANNOUNCEMENTS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelAnnouncements ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_MODERATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DESTROY_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_USE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUseItemOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_OPEN_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleOpenItemOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_READ_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReadItem ); + //DEFINE_OPCODE_HANDLER(SMSG_READ_ITEM_OK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_READ_ITEM_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ITEM_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJ_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGameObjectUseOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_DESTROY_ITEMS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_CUSTOM_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_AREATRIGGER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaTriggerOpcode ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_FORWARD, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_BACKWARD, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_STRAFE_LEFT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_STRAFE_RIGHT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_STRAFE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_JUMP, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_TURN_LEFT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_TURN_RIGHT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_TURN, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_PITCH_UP, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_PITCH_DOWN, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_PITCH, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_MODE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_WALK_MODE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_TOGGLE_LOGGING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_TELEPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_TELEPORT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_TELEPORT_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveTeleportAck ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_TOGGLE_FALL_LOGGING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_FALL_LAND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_SWIM, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_SWIM, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_BACK_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_WALK_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_SWIM_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_SWIM_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_SWIM_BACK_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_SWIM_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_ALL_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_TURN_RATE_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_TOGGLE_COLLISION_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_FACING, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_PITCH, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_WORLDPORT_ACK, STATUS_TRANSFER, PROCESS_THREADUNSAFE, &WorldSession::HandleMoveWorldportAckOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_MONSTER_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_LAND_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_CHARM_PORT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_RAW_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_FORCE_RUN_SPEED_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_FORCE_RUN_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); + //DEFINE_OPCODE_HANDLER(SMSG_FORCE_RUN_BACK_SPEED_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_FORCE_RUN_BACK_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); + //DEFINE_OPCODE_HANDLER(SMSG_FORCE_SWIM_SPEED_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_FORCE_SWIM_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); + //DEFINE_OPCODE_HANDLER(SMSG_FORCE_MOVE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_FORCE_MOVE_ROOT_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveRootAck ); + //DEFINE_OPCODE_HANDLER(SMSG_FORCE_MOVE_UNROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_FORCE_MOVE_UNROOT_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveUnRootAck ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_UNROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_HEARTBEAT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_KNOCK_BACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_KNOCK_BACK_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveKnockBackAck ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_KNOCK_BACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_FEATHER_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_NORMAL_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_HOVER_ACK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMoveHoverAck ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_TRIGGER_CINEMATIC_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_OPENING_CINEMATIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_TRIGGER_CINEMATIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_NEXT_CINEMATIC_CAMERA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNextCinematicCamera ); + //DEFINE_OPCODE_HANDLER(CMSG_COMPLETE_CINEMATIC, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCompleteCinematic ); + DEFINE_OPCODE_HANDLER(SMSG_TUTORIAL_FLAGS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_FLAG, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialFlag ); + //DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_CLEAR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialClear ); + //DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_RESET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialReset ); + //DEFINE_OPCODE_HANDLER(CMSG_STANDSTATECHANGE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStandStateChangeOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEmoteOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_EMOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_TEXT_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTextEmoteOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_TEXT_EMOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_AUTOEQUIP_GROUND_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_GROUND_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_LOOT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutostoreLootItemOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_STORE_LOOT_IN_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_AUTOEQUIP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoEquipItemOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_BAG_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoStoreBagItemOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_SWAP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSwapItem ); + //DEFINE_OPCODE_HANDLER(CMSG_SWAP_INV_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSwapInvItemOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_SPLIT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSplitItemOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_AUTOEQUIP_ITEM_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoEquipItemSlotOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_UNCLAIM_LICENSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DESTROYITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDestroyItemOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_INVENTORY_CHANGE_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_OPEN_CONTAINER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_INSPECT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_INSPECT_RESULTS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_INITIATE_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInitiateTradeOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_BEGIN_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBeginTradeOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_BUSY_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBusyTradeOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleIgnoreTradeOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_ACCEPT_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAcceptTradeOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_UNACCEPT_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnacceptTradeOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_TRADE, STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelTradeOpcode); + //DEFINE_OPCODE_HANDLER(CMSG_SET_TRADE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTradeItemOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_TRADE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleClearTradeItemOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_TRADE_GOLD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTradeGoldOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_TRADE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_TRADE_STATUS_EXTENDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_INITIALIZE_FACTIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SET_FACTION_VISIBLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SET_FACTION_STANDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_FACTION_ATWAR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetFactionAtWar ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_FACTION_CHEAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetFactionCheat ); + //DEFINE_OPCODE_HANDLER(SMSG_SET_PROFICIENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_ACTION_BUTTON, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActionButtonOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_ACTION_BUTTONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_INITIAL_SPELLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LEARNED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SUPERCEDED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_NEW_SPELL_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CAST_SPELL, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleCastSpellOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_CAST, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleCancelCastOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_CAST_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELL_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELL_GO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELL_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELL_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COOLDOWN_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelAuraOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_EQUIPMENT_SET_SAVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_CAST_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(MSG_CHANNEL_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_CHANNEL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_CHANNELLING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelChanneling ); + //DEFINE_OPCODE_HANDLER(SMSG_AI_REACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_SELECTION, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleSetSelectionOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_DELETEEQUIPMENT_SET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetDelete ); + //DEFINE_OPCODE_HANDLER(CMSG_INSTANCE_LOCK_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInstanceLockResponse ); + //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_PASSIVE_AURA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_ATTACKSWING, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleAttackSwingOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_ATTACKSTOP, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleAttackStopOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_ATTACKSTART, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ATTACKSTOP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ATTACKSWING_NOTINRANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ATTACKSWING_BADFACING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_LOCK_WARNING_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ATTACKSWING_DEADTARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ATTACKSWING_CANT_ATTACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ATTACKERSTATEUPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_PORT_DENIED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_PERFORM_ACTION_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_RESUME_CAST_BAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CANCEL_COMBAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELLBREAKLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELLHEALLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELLENERGIZELOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BREAK_TARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_SAVE_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SETDEATHBINDPOINT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_BINDPOINTUPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_GETDEATHBINDZONE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_BINDZONEREPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PLAYERBOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CLIENT_CONTROL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_REPOP_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepopRequestOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_RESURRECT_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_RESURRECT_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleResurrectResponseOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_LOOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_LOOT_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMoneyOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_LOOT_RELEASE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootReleaseOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_LOOT_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LOOT_RELEASE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LOOT_REMOVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LOOT_MONEY_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LOOT_ITEM_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LOOT_CLEAR_MONEY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ITEM_PUSH_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DUEL_REQUESTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DUEL_OUTOFBOUNDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DUEL_INBOUNDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DUEL_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DUEL_WINNER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_DUEL_ACCEPTED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDuelAcceptedOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_DUEL_CANCELLED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDuelCancelledOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_MOUNTRESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DISMOUNTRESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_REMOVED_FROM_PVP_QUEUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_MOUNTSPECIAL_ANIM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMountSpecialAnimOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_MOUNTSPECIAL_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_TAME_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_PET_SET_ACTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetSetAction ); + //DEFINE_OPCODE_HANDLER(CMSG_PET_ACTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetAction ); + //DEFINE_OPCODE_HANDLER(CMSG_PET_ABANDON, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetAbandon ); + //DEFINE_OPCODE_HANDLER(CMSG_PET_RENAME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetRename ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_NAME_INVALID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_SPELLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_GOSSIP_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGossipHelloOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GOSSIP_SELECT_OPTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGossipSelectOptionOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_GOSSIP_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GOSSIP_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_NPC_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNpcTextQueryOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_NPC_TEXT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_NPC_WONT_TALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_STATUS_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleQuestgiverStatusQueryOpcode); + //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverHelloOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_QUERY_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverQueryQuestOpcode); + //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_QUEST_AUTOLAUNCH, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverQuestAutoLaunch ); + //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_DETAILS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_ACCEPT_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverAcceptQuestOpcode); + //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_COMPLETE_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverCompleteQuest ); + //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_REQUEST_ITEMS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_REQUEST_REWARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverRequestRewardOpcode); + //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_OFFER_REWARD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_CHOOSE_REWARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverChooseRewardOpcode); + //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_INVALID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_CANCEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverCancel ); + //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_QUESTLOG_SWAP_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestLogSwapQuest ); + //DEFINE_OPCODE_HANDLER(CMSG_QUESTLOG_REMOVE_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestLogRemoveQuest ); + //DEFINE_OPCODE_HANDLER(SMSG_QUESTLOG_FULL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_FAILEDTIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_ADD_KILL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_ADD_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_QUEST_CONFIRM_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestConfirmAccept ); + //DEFINE_OPCODE_HANDLER(SMSG_QUEST_CONFIRM_ACCEPT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_PUSHQUESTTOPARTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePushQuestToParty ); + //DEFINE_OPCODE_HANDLER(CMSG_LIST_INVENTORY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleListInventoryOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_LIST_INVENTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_SELL_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSellItemOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_SELL_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_BUY_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyItemOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_BUY_ITEM_IN_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyItemInSlotOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_BUY_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BUY_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_TAXICLEARALLNODES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_TAXIENABLEALLNODES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_TAXISHOWNODES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_SHOWTAXINODES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_TAXINODE_STATUS_QUERY, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleTaxiNodeStatusQueryOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_TAXINODE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_TAXIQUERYAVAILABLENODES, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleTaxiQueryAvailableNodes ); + //DEFINE_OPCODE_HANDLER(CMSG_ACTIVATETAXI, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleActivateTaxiOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_ACTIVATETAXIREPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_NEW_TAXI_PATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_TRAINER_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerListOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_TRAINER_BUY_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerBuySpellOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_SUCCEEDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_BINDER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBinderActivateOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_PLAYERBINDERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_BANKER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBankerActivateOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_SHOW_BANK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_BUY_BANK_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyBankSlotOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_BUY_BANK_SLOT_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_PETITION_SHOWLIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionShowListOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_PETITION_SHOWLIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_PETITION_BUY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionBuyOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_PETITION_SHOW_SIGNATURES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionShowSignOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_PETITION_SHOW_SIGNATURES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_PETITION_SIGN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionSignOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_PETITION_SIGN_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(MSG_PETITION_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionDeclineOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_OFFER_PETITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleOfferPetitionOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_TURN_IN_PETITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTurnInPetitionOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_TURN_IN_PETITION_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_PETITION_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionQueryOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_PETITION_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_FISH_NOT_HOOKED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_FISH_ESCAPED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_BUG, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBugOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_PLAYED_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayedTime ); + //DEFINE_OPCODE_HANDLER(SMSG_PLAYED_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_QUERY_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryTimeOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_QUERY_TIME_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LOG_XPGAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_AURACASTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_RECLAIM_CORPSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReclaimCorpseOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_WRAP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWrapItemOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_LEVELUP_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(MSG_MINIMAP_PING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMinimapPingOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_RESISTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ENCHANTMENTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_SKILL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_START_MIRROR_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PAUSE_MIRROR_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_STOP_MIRROR_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(CMSG_PING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); + DEFINE_OPCODE_HANDLER(SMSG_PONG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_PAGETEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_SETSHEATHED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleSetSheathedOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_COOLDOWN_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELL_DELAYED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_QUEST_POI_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestPOIQuery ); + //DEFINE_OPCODE_HANDLER(SMSG_QUEST_POI_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_GHOST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_INVIS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_INVALID_PROMOTION_CODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(MSG_GM_BIND_OTHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_GM_SUMMON, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_ITEM_TIME_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ITEM_ENCHANT_TIME_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_AUTH_CHALLENGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(CMSG_AUTH_SESSION, STATUS_NEVER, PROCESS_THREADUNSAFE, &WorldSession::Handle_EarlyProccess ); + DEFINE_OPCODE_HANDLER(SMSG_AUTH_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(MSG_GM_SHOWLABEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_PET_CAST_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetCastSpellOpcode ); + //DEFINE_OPCODE_HANDLER(MSG_SAVE_GUILD_EMBLEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSaveGuildEmblemOpcode ); + //DEFINE_OPCODE_HANDLER(MSG_TABARDVENDOR_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTabardVendorActivateOpcode); + //DEFINE_OPCODE_HANDLER(SMSG_PLAY_SPELL_VISUAL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_ZONEUPDATE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleZoneUpdateOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_PARTYKILLLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_UPDATE_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PLAY_SPELL_IMPACT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_EXPLORATION_EXPERIENCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_SET_SECURITY_GROUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_NUKE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_RANDOM_ROLL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRandomRollOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_ENVIRONMENTALDAMAGELOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANGEPLAYER_DIFFICULTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_RWHOIS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_PLAYER_REWARD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_TELEPORT_DENIED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_SKILL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnlearnSkillOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_REMOVED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_DECHARGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_CREATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketCreateOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_CREATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_UPDATETEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketUpdateOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_UPDATETEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ACCOUNT_DATA_TIMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_ACCOUNT_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestAccountData ); + //DEFINE_OPCODE_HANDLER(CMSG_UPDATE_ACCOUNT_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateAccountData ); + //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ACCOUNT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_FAR_SIGHT_IMMEDIATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHANGEPLAYER_DIFFICULTY_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_TEACH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_CREATE_ITEM_TARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_GETTICKET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketGetTicketOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_GETTICKET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_TALENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + ////DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_SPAWN_ANIM_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_DESPAWN_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(MSG_CORPSE_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCorpseQueryOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_DELETETICKET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketDeleteOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_DELETETICKET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHAT_WRONG_FACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_SYSTEMSTATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketSystemStatusOpcode); + //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_SYSTEMSTATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_SPIRIT_HEALER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSpiritHealerActivateOpcode); + //DEFINE_OPCODE_HANDLER(CMSG_SET_STAT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_QUEST_FORCE_REMOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_SKILL_BUY_STEP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SKILL_BUY_RANK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_XP_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_SPIRIT_HEALER_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_CHARACTER_POINT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_GOSSIP_POI, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_CHAT_IGNORED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChatIgnoredOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_VISION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SERVER_COMMAND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_SILENCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_REVEALTO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_RESURRECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_SUMMONMOB, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_MOVECORPSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_FREEZE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_UBERINVIS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_REQUEST_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_GM_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_RANK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildRankOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_ADD_RANK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildAddRankOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_DEL_RANK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDelRankOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_SET_PUBLIC_NOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildSetPublicNoteOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_SET_OFFICER_NOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildSetOfficerNoteOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_LOGIN_VERIFY_WORLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_EXPLORATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SEND_MAIL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSendMail ); + //DEFINE_OPCODE_HANDLER(SMSG_SEND_MAIL_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_GET_MAIL_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGetMailList ); + //DEFINE_OPCODE_HANDLER(SMSG_MAIL_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlefieldListOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_JOIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_FORCE_SET_VEHICLE_REC_ID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_VEHICLE_REC_ID_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_TAXICLEARNODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_TAXIENABLENODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_ITEM_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemTextQuery ); + //DEFINE_OPCODE_HANDLER(SMSG_ITEM_TEXT_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_MAIL_TAKE_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailTakeMoney ); + //DEFINE_OPCODE_HANDLER(CMSG_MAIL_TAKE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailTakeItem ); + //DEFINE_OPCODE_HANDLER(CMSG_MAIL_MARK_AS_READ, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailMarkAsRead ); + //DEFINE_OPCODE_HANDLER(CMSG_MAIL_RETURN_TO_SENDER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailReturnToSender ); + //DEFINE_OPCODE_HANDLER(CMSG_MAIL_DELETE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailDelete ); + //DEFINE_OPCODE_HANDLER(CMSG_MAIL_CREATE_TEXT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailCreateTextItem ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELLLOGMISS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELLLOGEXECUTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DEBUGAURAPROC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PERIODICAURALOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELLDAMAGESHIELD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELLNONMELEEDAMAGELOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_LEARN_TALENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnTalentOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_RESURRECT_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_TOGGLE_PVP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTogglePvP ); + //DEFINE_OPCODE_HANDLER(SMSG_ZONE_UNDER_ATTACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(MSG_AUCTION_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionHelloOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_SELL_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionSellItem ); + //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_REMOVE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionRemoveItem ); + //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListItems ); + //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_OWNER_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListOwnerItems ); + //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_PLACE_BID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionPlaceBid ); + //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_OWNER_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_BIDDER_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_OWNER_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PROCRESIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMBAT_EVENT_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DISPEL_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELLORDAMAGE_IMMUNE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_BIDDER_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListBidderItems ); + //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_BIDDER_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SET_FLAT_SPELL_MODIFIER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SET_PCT_SPELL_MODIFIER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_AMMO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetAmmoOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_CORPSE_RECLAIM_DELAY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIVE_MOVER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActiveMoverOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_PET_CANCEL_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetCancelAuraOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_PLAYER_AI_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_AUTO_REPEAT_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelAutoRepeatSpellOpcode); + //DEFINE_OPCODE_HANDLER(MSG_GM_ACCOUNT_ONLINE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_LIST_STABLED_PETS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleListStabledPetsOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_STABLE_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStablePet ); + //DEFINE_OPCODE_HANDLER(CMSG_UNSTABLE_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnstablePet ); + //DEFINE_OPCODE_HANDLER(CMSG_BUY_STABLE_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyStableSlot ); + //DEFINE_OPCODE_HANDLER(SMSG_STABLE_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_STABLE_REVIVE_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStableRevivePet ); + //DEFINE_OPCODE_HANDLER(CMSG_STABLE_SWAP_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStableSwapPet ); + //DEFINE_OPCODE_HANDLER(MSG_QUEST_PUSH_RESULT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestPushResult ); + //DEFINE_OPCODE_HANDLER(SMSG_PLAY_MUSIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PLAY_OBJECT_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PET_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestPetInfoOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_FAR_SIGHT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleFarSightOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELLDISPELLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DAMAGE_CALC_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_ENABLE_DAMAGE_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GROUP_CHANGE_SUB_GROUP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupChangeSubGroupOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PARTY_MEMBER_STATS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestPartyMemberStatsOpcode); + //DEFINE_OPCODE_HANDLER(CMSG_GROUP_SWAP_SUB_GROUP, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_RESET_FACTION_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_BANK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoStoreBankItemOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_AUTOBANK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoBankItemOpcode ); + //DEFINE_OPCODE_HANDLER(MSG_QUERY_NEXT_MAIL_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryNextMailTime ); + //DEFINE_OPCODE_HANDLER(SMSG_RECEIVED_MAIL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RAID_GROUP_ONLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_DURABILITY_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_PVP_RANK_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_ADD_PVP_MEDAL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DEL_PVP_MEDAL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_PVP_TITLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_PVP_CREDIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_REMOVED_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_GROUP_RAID_CONVERT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupRaidConvertOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GROUP_ASSISTANT_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupAssistantLeaderOpcode); + //DEFINE_OPCODE_HANDLER(CMSG_BUYBACK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuybackItem ); + //DEFINE_OPCODE_HANDLER(SMSG_SERVER_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_SAVED_INSTANCE_EXTEND, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_OFFER_CONTINUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_TEST_DROP_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_TEST_DROP_RATE_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_LFG_GET_STATUS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_SHOW_MAILBOX, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RESET_RANGED_COMBAT_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + ////DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_MEMBER_ADDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHAT_NOT_IN_PARTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_GROWTH_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelGrowthAuraOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_CANCEL_AUTO_REPEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_STANDSTATE_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LOOT_ALL_PASSED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LOOT_ROLL_WON, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_LOOT_ROLL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootRoll ); + //DEFINE_OPCODE_HANDLER(SMSG_LOOT_START_ROLL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LOOT_ROLL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_LOOT_MASTER_GIVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMasterGiveOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_LOOT_MASTER_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SET_FORCED_REACTIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELL_FAILED_OTHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_RESET_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_REPAIR_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepairItemOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_CHAT_PLAYER_NOT_FOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(MSG_TALENT_WIPE_CONFIRM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTalentWipeConfirmOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_SUMMON_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_SUMMON_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSummonResponseOpcode ); + //DEFINE_OPCODE_HANDLER(MSG_DEV_SHOWLABEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_MONSTER_MOVE_TRANSPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_BROKEN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_FEATHER_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SERVER_BROADCAST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SELF_RES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSelfResOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_FEIGN_DEATH_RESISTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_RUN_SCRIPT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_SCRIPT_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DUEL_COUNTDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_AREA_TRIGGER_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_SHOWING_HELM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleShowingHelmOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_SHOWING_CLOAK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleShowingCloakOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_ROLE_CHOSEN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PLAYER_SKINNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DURABILITY_DAMAGE_DEATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_EXPLORATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIONBAR_TOGGLES, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActionBarToggles ); + //DEFINE_OPCODE_HANDLER(UMSG_DELETE_GUILD_CHARTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_PETITION_RENAME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionRenameOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_INIT_WORLD_STATES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_WORLD_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_ITEM_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemNameQueryOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_ITEM_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_ACTION_FEEDBACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_CHAR_RENAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharRenameOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_CHAR_RENAME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SPLINE_DONE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveSplineDoneOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FALL_RESET, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_SAVE_CREATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RAID_INSTANCE_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RAID_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestRaidInfoOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_TIME_SKIPPED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleMoveTimeSkippedOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FEATHER_FALL_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleFeatherFallAck ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_WATER_WALK_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveWaterWalkAck ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_NOT_ACTIVE_MOVER, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveNotActiveMover ); + //DEFINE_OPCODE_HANDLER(SMSG_PLAY_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_STATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlefieldStatusOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_PORT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattleFieldPortOpcode ); + //DEFINE_OPCODE_HANDLER(MSG_INSPECT_HONOR_STATS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectHonorStatsOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlemasterHelloOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_START_SWIM_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_STOP_SWIM_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_FORCE_WALK_SPEED_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_FORCE_WALK_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); + //DEFINE_OPCODE_HANDLER(SMSG_FORCE_SWIM_BACK_SPEED_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_FORCE_SWIM_BACK_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); + //DEFINE_OPCODE_HANDLER(SMSG_FORCE_TURN_RATE_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_FORCE_TURN_RATE_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); + //DEFINE_OPCODE_HANDLER(MSG_PVP_LOG_DATA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePVPLogDataOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_LEAVE_BATTLEFIELD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLeaveBattlefieldOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_AREA_SPIRIT_HEALER_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaSpiritHealerQueryOpcode); + //DEFINE_OPCODE_HANDLER(CMSG_AREA_SPIRIT_HEALER_QUEUE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaSpiritHealerQueueOpcode); + //DEFINE_OPCODE_HANDLER(SMSG_AREA_SPIRIT_HEALER_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_UNTEACH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_WARDEN_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_WARDEN_DATA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWardenDataOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_GROUP_JOINED_BATTLEGROUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(MSG_BATTLEGROUND_PLAYER_POSITIONS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlegroundPlayerPositionsOpcode); + //DEFINE_OPCODE_HANDLER(CMSG_PET_STOP_ATTACK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetStopAttack ); + //DEFINE_OPCODE_HANDLER(SMSG_BINDER_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_PLAYER_JOINED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_PLAYER_LEFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_JOIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlemasterJoinOpcode ); + DEFINE_OPCODE_HANDLER(SMSG_ADDON_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_PET_UNLEARN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_UNLEARN_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PARTY_MEMBER_STATS_FULL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_PET_SPELL_AUTOCAST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetSpellAutocastOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_WEATHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PLAY_TIME_WARNING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MINIGAME_SETUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MINIGAME_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_MINIGAME_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_MINIGAME_MOVE_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RAID_INSTANCE_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_MOVES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_INFO_TEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildChangeInfoTextOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_CHAT_RESTRICTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_RUN_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_SWIM_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_SWIM_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_UNROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_FEATHER_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_NORMAL_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_UNSET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_LAND_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_START_SWIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_STOP_SWIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_RUN_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_WALK_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_NUKE_ACCOUNT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_GM_DESTROY_CORPSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_DESTROY_ONLINE_CORPSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_ACTIVATETAXIEXPRESS, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleActivateTaxiExpressOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_SET_FACTION_ATWAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GAMETIMEBIAS_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_ACTIONS_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_ACTIONS_STOP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_FACTION_INACTIVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetFactionInactiveOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_WATCHED_FACTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetWatchedFactionOpcode ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_TIME_SKIPPED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_EXPLORATION_ALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_INVALIDATE_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_RESET_INSTANCES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleResetInstancesOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_RESET_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_LAST_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(MSG_RAID_TARGET_UPDATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidTargetUpdateOpcode ); + //DEFINE_OPCODE_HANDLER(MSG_RAID_READY_CHECK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidReadyCheckOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_LUA_USAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_ACTION_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_DISMISS_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GHOSTEE_GONE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_UPDATE_TICKET_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_GM_TICKET_STATUS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(MSG_SET_DUNGEON_DIFFICULTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetDungeonDifficultyOpcode); + //DEFINE_OPCODE_HANDLER(CMSG_GMSURVEY_SUBMIT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMSurveySubmit ); + //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_INSTANCE_OWNERSHIP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_KNOCKBACK_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_CHAT_PLAYER_AMBIGUOUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(MSG_DELAY_GHOST_TELEPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELLINSTAKILLLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELL_UPDATE_CHAIN_TARGETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_CHAT_FILTERED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_EXPECTED_SPAM_RECORDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELLSTEALLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_LOTTERY_QUERY_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_LOTTERY_QUERY_RESULT_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_BUY_LOTTERY_TICKET_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_LOTTERY_RESULT_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHARACTER_PROFILE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHARACTER_PROFILE_REALM_CONNECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DEFENSE_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_DIFFICULTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(MSG_GM_RESETINSTANCELIMIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_MOTD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_SWIM_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_SWIM_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_CAN_FLY_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveSetCanFlyAckOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_FLY, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(CMSG_SOCKET_GEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSocketOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_CREATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamQueryOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_ROSTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamRosterOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_ROSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamInviteOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamAcceptOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamDeclineOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamLeaveOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_REMOVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamRemoveOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_DISBAND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamDisbandOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamLeaderOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_JOIN_ARENA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlemasterJoinArena ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_ASCEND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_ASCEND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_LFG_JOIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgJoinOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_LFG_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgLeaveOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_SEARCH_LFG_JOIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfrSearchOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_SEARCH_LFG_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfrLeaveOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_LFG_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_PROPOSAL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_LFG_PROPOSAL_RESULT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgProposalResultOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_ROLE_CHECK_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_JOIN_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_QUEUE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_LFG_COMMENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetCommentOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_PARTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_SEARCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_ROLES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetRolesOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_NEEDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_BOOT_VOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetBootVoteOpcode ); + ////DEFINE_OPCODE_HANDLER(SMSG_LFG_BOOT_PROPOSAL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_LFD_PLAYER_LOCK_INFO_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgPlayerLockInfoRequestOpcode); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_LFG_TELEPORT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgTeleportOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_LFD_PARTY_LOCK_INFO_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgPartyLockInfoRequestOpcode); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_PARTY_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_TITLE_EARNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_TITLE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTitleOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_MOUNT_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelMountAuraOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_ARENA_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(MSG_INSPECT_ARENA_TEAMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectArenaTeamsOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_DEATH_RELEASE_LOC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_TEMP_ENCHANTMENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelTempEnchantmentOpcode); + //DEFINE_OPCODE_HANDLER(SMSG_FORCED_DEATH_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_SET_HONOR_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_SET_ARENA_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_FLIGHT_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_FLIGHT_BACK_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_FORCE_FLIGHT_SPEED_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_FORCE_FLIGHT_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); + //DEFINE_OPCODE_HANDLER(SMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_MAELSTROM_INVALIDATE_CACHE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_FLIGHT_SPLINE_SYNC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_TAXI_BENCHMARK_MODE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTaxiBenchmarkOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_JOINED_BATTLEGROUND_QUEUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_REALM_SPLIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(CMSG_REALM_SPLIT, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRealmSplitOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_CHNG_TRANSPORT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(MSG_PARTY_ASSIGNMENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePartyAssignmentOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_OFFER_PETITION_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_TIME_SYNC_REQ, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_TIME_SYNC_RESP, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleTimeSyncResp ); + //DEFINE_OPCODE_HANDLER(CMSG_SEND_LOCAL_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SEND_GENERAL_TRIGGER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SEND_COMBAT_TRIGGER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MAELSTROM_GM_SENT_MAIL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_RESET_FAILED_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_REAL_GROUP_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_DISABLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_ACTIVE_PVP_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY_RESPONSE_WRITE_FILE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_COMBO_POINTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_ROSTER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_LEAVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_ADJUST_PRIORITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_VOICE_SET_TALKER_MUTED_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SET_TALKER_MUTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_INIT_EXTRA_AURA_INFO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SET_EXTRA_AURA_INFO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SET_EXTRA_AURA_INFO_NEED_UPDATE_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_EXTRA_AURA_INFO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_DESCEND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_REQUIREMENTS_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_IGNORE_REQUIREMENTS_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELL_CHANCE_PROC_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_DISMOUNT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_RAID_READY_CHECK_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_VOICE_SESSION_ENABLE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleVoiceSessionEnableOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_VOICE_PARENTAL_CONTROLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_WHISPER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_GM_MESSAGECHAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(MSG_GM_GEARRATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_STATE_CHANGED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_GET_MAP_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_MAP_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_GET_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_GET_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_ENTER_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_EXIT_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_INSTANCE_COMMAND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_TARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_BOT_DETECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_CROSSED_INEBRIATION_THRESHOLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_PLAYER_LOGIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_PLAYER_LOOKUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_CHEAT_PLAYER_LOOKUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_KICK_REASON, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(MSG_RAID_READY_CHECK_FINISHED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidReadyCheckFinishedOpcode); + //DEFINE_OPCODE_HANDLER(CMSG_COMPLAIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleComplainOpcode ); + //DEFINE_OPCODE_HANDLER(SMSG_COMPLAIN_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_FEATURE_SYSTEM_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_SHOW_COMPLAINTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_UNSQUELCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_SILENCE_VOICE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_SILENCE_ALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNSILENCE_VOICE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNSILENCE_ALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_TARGET_CAST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_TARGET_SCRIPT_CAST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_DISPLAY_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelDisplayListQuery ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIVE_VOICE_CHANNEL, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActiveVoiceChannel ); + //DEFINE_OPCODE_HANDLER(CMSG_GET_CHANNEL_MEMBER_COUNT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGetChannelMemberCount ); + //DEFINE_OPCODE_HANDLER(SMSG_CHANNEL_MEMBER_COUNT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_VOICE_ON, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelVoiceOnOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_VOICE_OFF, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_LIST_TARGETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_DEBUG_LIST_TARGETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_AVAILABLE_VOICE_CHANNEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_ADD_VOICE_IGNORE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DEL_VOICE_IGNORE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_PARTY_SILENCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_PARTY_UNSILENCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_NOTIFY_PARTY_SQUELCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_COMSAT_RECONNECT_TRY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMSAT_DISCONNECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMSAT_CONNECT_FAIL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_VOICE_CHAT_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_REPORT_PVP_AFK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReportPvPAFK ); + //DEFINE_OPCODE_HANDLER(SMSG_REPORT_PVP_AFK_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANKER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankerActivate ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_QUERY_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankQueryTab ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_SWAP_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankSwapItems ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_BUY_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankBuyTab ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_UPDATE_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankUpdateTab ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_DEPOSIT_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankDepositMoney ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_WITHDRAW_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankWithdrawMoney ); + //DEFINE_OPCODE_HANDLER(MSG_GUILD_BANK_LOG_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankLogQuery ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_CHANNEL_WATCH, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetChannelWatch ); + //DEFINE_OPCODE_HANDLER(SMSG_USERLIST_ADD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_USERLIST_REMOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_USERLIST_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_CHANNEL_WATCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_INSPECT_TALENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GOGOGO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ECHO_PARTY_SQUELCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_TITLE_SUFFIX, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SPELLCLICK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSpellClick ); + //DEFINE_OPCODE_HANDLER(SMSG_LOOT_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_CHARACTER_RESTORE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_CHARACTER_SAVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_VOICESESSION_FULL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(MSG_GUILD_PERMISSIONS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildPermissions ); + //DEFINE_OPCODE_HANDLER(MSG_GUILD_BANK_MONEY_WITHDRAWN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankMoneyWithdrawn ); + //DEFINE_OPCODE_HANDLER(MSG_GUILD_EVENT_LOG_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildEventLogQueryOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_MAELSTROM_RENAME_GUILD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GET_MIRRORIMAGE_DATA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMirrorImageDataRequest ); + //DEFINE_OPCODE_HANDLER(SMSG_MIRRORIMAGE_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_FORCE_DISPLAY_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELL_CHANCE_RESIST_PUSHBACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_DIMINISHING_RETURNS_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_IGNORE_DIMINISHING_RETURNS_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(CMSG_KEEP_ALIVE, STATUS_NEVER, PROCESS_THREADUNSAFE, &WorldSession::Handle_EarlyProccess ); + //DEFINE_OPCODE_HANDLER(SMSG_RAID_READY_CHECK_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_OPT_OUT_OF_LOOT, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleOptOutOfLootOpcode ); + //DEFINE_OPCODE_HANDLER(MSG_QUERY_GUILD_BANK_TEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryGuildBankTabText ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_GUILD_BANK_TEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetGuildBankTabText ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_GRANTABLE_LEVELS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GRANT_LEVEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGrantLevel ); + //DEFINE_OPCODE_HANDLER(CMSG_REFER_A_FRIEND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_GM_CHANGE_ARENA_RATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DECLINE_CHANNEL_INVITE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleChannelDeclineInvite ); + //DEFINE_OPCODE_HANDLER(SMSG_GROUPACTION_THROTTLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_OVERRIDE_LIGHT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_TOTEM_CREATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_TOTEM_DESTROYED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTotemDestroyed ); + //DEFINE_OPCODE_HANDLER(CMSG_EXPIRE_RAID_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_NO_SPELL_VARIANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverStatusMultipleQuery); + //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_STATUS_MULTIPLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_PLAYER_DECLINED_NAMES, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetPlayerDeclinedNames ); + //DEFINE_OPCODE_HANDLER(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_QUERY_SERVER_BUCK_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_SERVER_BUCK_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_SERVER_BUCK_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SEND_UNLEARN_SPELLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PROPOSE_LEVEL_GRANT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_ACCEPT_LEVEL_GRANT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAcceptGrantLevel ); + //DEFINE_OPCODE_HANDLER(SMSG_REFER_A_FRIEND_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FLYING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_UNSET_FLYING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SUMMON_CANCEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANGE_PERSONAL_ARENA_RATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_ALTER_APPEARANCE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAlterAppearance ); + //DEFINE_OPCODE_HANDLER(SMSG_ENABLE_BARBER_SHOP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BARBER_SHOP_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_GET_CALENDAR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGetCalendar ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_GET_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGetEvent ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_GUILD_FILTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGuildFilter ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_ARENA_TEAM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarArenaTeam ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_ADD_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarAddEvent ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_UPDATE_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarUpdateEvent ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_REMOVE_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarRemoveEvent ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_COPY_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarCopyEvent ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventInvite ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_RSVP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventRsvp ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_REMOVE_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventRemoveInvite ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_STATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventStatus ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_MODERATOR_STATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventModeratorStatus); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_SEND_CALENDAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_SEND_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_FILTER_GUILD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_ARENA_TEAM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_REMOVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_RAID_LOCKOUT_ADDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_RAID_LOCKOUT_REMOVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_REMOVED_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_STATUS_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_REMOVED_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_UPDATED_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_MODERATOR_STATUS_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_COMPLAIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarComplain ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_GET_NUM_PENDING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGetNumPending ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_SEND_NUM_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_SAVE_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_NOTIFY_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_PLAY_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_PLAY_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_LOAD_DANCES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_STOP_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_STOP_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_SYNC_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DANCE_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_DANCE_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_INVALIDATE_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_DELETE_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_LEARNED_DANCE_MOVES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_LEARN_DANCE_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_DANCE_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_RUNE_COUNT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_RUNE_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_PITCH_RATE_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_FORCE_PITCH_RATE_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_FORCE_PITCH_RATE_CHANGE_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_INVITE_NOTES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_NOTES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_NOTES_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_UPDATE_MISSILE_TRAJECTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ACCOUNT_DATA_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_TRIGGER_MOVIE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_COMPLETE_MOVIE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_GLYPH_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_GLYPH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_ACHIEVEMENT_EARNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DYNAMIC_DROP_ROLL_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CRITERIA_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_QUERY_INSPECT_ACHIEVEMENTS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryInspectAchievements ); + //DEFINE_OPCODE_HANDLER(SMSG_RESPOND_INSPECT_ACHIEVEMENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_DISMISS_CONTROLLED_VEHICLE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDismissControlledVehicle ); + //DEFINE_OPCODE_HANDLER(CMSG_COMPLETE_ACHIEVEMENT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_ADD_PVP_KILL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_CRITERIA_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_RAID_LOCKOUT_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_UNITANIMTIER_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHAR_CUSTOMIZE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharCustomize ); + //DEFINE_OPCODE_HANDLER(SMSG_CHAR_CUSTOMIZE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_RENAMEABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_EXIT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestVehicleExit ); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_PREV_SEAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_NEXT_SEAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_SWITCH_SEAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); + //DEFINE_OPCODE_HANDLER(CMSG_PET_LEARN_TALENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetLearnTalent ); + //DEFINE_OPCODE_HANDLER(CMSG_PET_UNLEARN_TALENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_SET_PHASE_SHIFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ALL_ACHIEVEMENT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_FORCE_SAY_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_HEALTH_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_POWER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJ_REPORT_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGameobjectReportUse ); + //DEFINE_OPCODE_HANDLER(SMSG_HIGHEST_THREAT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_THREAT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_THREAT_REMOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_THREAT_CLEAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CONVERT_RUNE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RESYNC_RUNES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ADD_RUNE_POWER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_START_QUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_REMOVE_GLYPH, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRemoveGlyph ); + //DEFINE_OPCODE_HANDLER(CMSG_DUMP_OBJECTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_DUMP_OBJECTS_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_DISMISS_CRITTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDismissCritter ); + //DEFINE_OPCODE_HANDLER(SMSG_NOTIFY_DEST_LOC_SPELL_CAST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_PENDING_SALES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListPendingSales ); + //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_LIST_PENDING_SALES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MODIFY_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_UPDATE_COMBO_POINTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_ENABLETAXI, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleTaxiQueryAvailableNodes ); + //DEFINE_OPCODE_HANDLER(SMSG_PRE_RESURRECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_AURA_UPDATE_ALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_AURA_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_FLOOD_GRACE_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_SERVER_FIRST_ACHIEVEMENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_LEARNED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_REMOVED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); + //DEFINE_OPCODE_HANDLER(CMSG_HEARTH_AND_RESURRECT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleHearthAndResurrect ); + //DEFINE_OPCODE_HANDLER(SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CRITERIA_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ACHIEVEMENT_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_SERVER_INFO_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_SERVER_INFO_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_CHECK_LOGIN_CRITERIA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_SERVER_BUCK_DATA_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_BREATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_QUERY_VEHICLE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_INFO_THROTTLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PLAYER_VEHICLE_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_PLAYER_VEHICLE_ENTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEnterPlayerVehicle ); + //DEFINE_OPCODE_HANDLER(CMSG_CONTROLLER_EJECT_PASSENGER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEjectPassenger ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_GUIDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CLIENTCACHE_VERSION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANGE_GDF_ARENA_RATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_ARENA_TEAM_RATING_BY_INDEX, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_ARENA_TEAM_WEEKLY_GAMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_ARENA_TEAM_SEASON_GAMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_ARENA_MEMBER_WEEKLY_GAMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_ARENA_MEMBER_SEASON_GAMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_ITEM_REFUND_INFO_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_ITEM_REFUND_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemRefundInfoRequest ); + //DEFINE_OPCODE_HANDLER(CMSG_ITEM_REFUND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemRefund ); + //DEFINE_OPCODE_HANDLER(SMSG_ITEM_REFUND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_CORPSE_MAP_POSITION_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCorpseMapPositionQuery ); + //DEFINE_OPCODE_HANDLER(SMSG_CORPSE_MAP_POSITION_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_UNUSED5, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_UNUSED6, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_SIGNUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_CLEAR_PENDING_ACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_EQUIPMENT_SET_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_EQUIPMENT_SET_SAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetSave ); + //DEFINE_OPCODE_HANDLER(CMSG_UPDATE_PROJECTILE_POSITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateProjectilePosition ); + //DEFINE_OPCODE_HANDLER(SMSG_SET_PROJECTILE_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_TALENTS_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_LEARN_PREVIEW_TALENTS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnPreviewTalents ); + //DEFINE_OPCODE_HANDLER(CMSG_LEARN_PREVIEW_TALENTS_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnPreviewTalentsPet ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIVE_TALENT_GROUP_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_GRANT_ACHIEVEMENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_REMOVE_ACHIEVEMENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_SET_CRITERIA_FOR_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_ARENA_OPPONENT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_CHANGE_FAILED_QUEUED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_PROFILEDATA_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_PROFILEDATA_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_START_BATTLEFIELD_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_END_BATTLEFIELD_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_MULTIPLE_PACKETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_GRAVITY_DISABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_GRAVITY_DISABLE_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_GRAVITY_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_GRAVITY_ENABLE_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_GRAVITY_CHNG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_GRAVITY_DISABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_GRAVITY_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_EQUIPMENT_SET_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetUse ); + //DEFINE_OPCODE_HANDLER(SMSG_EQUIPMENT_SET_USE_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_FORCE_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_FORCE_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_CHAR_FACTION_CHANGE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharFactionOrRaceChange ); + //DEFINE_OPCODE_HANDLER(SMSG_CHAR_FACTION_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_PVP_QUEUE_STATS_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_PVP_QUEUE_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_PAID_SERVICE_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_ENTRY_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_ENTRY_INVITE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_ENTERED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_QUEUE_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_QUEUE_INVITE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_QUEUE_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_EJECT_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_EJECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_EXIT_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_STATE_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MANAGER_ADVANCE_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MANAGER_SET_NEXT_TRANSITION_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_SET_RAID_DIFFICULTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetRaidDifficultyOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_TOGGLE_XP_GAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_TOGGLE_XP_GAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GMRESPONSE_DB_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GMRESPONSE_RECEIVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_GMRESPONSE_RESOLVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMResponseResolve ); + //DEFINE_OPCODE_HANDLER(SMSG_GMRESPONSE_STATUS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GMRESPONSE_CREATE_TICKET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_GMRESPONSE_CREATE_TICKET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SERVERINFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_SERVERINFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_WORLD_STATE_UI_TIMER_UPDATE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleWorldStateUITimerUpdate ); + //DEFINE_OPCODE_HANDLER(SMSG_WORLD_STATE_UI_TIMER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_CHAR_RACE_CHANGE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharFactionOrRaceChange ); + //DEFINE_OPCODE_HANDLER(MSG_VIEW_PHASE_SHIFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_TALENTS_INVOLUNTARILY_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_SERVER_GEO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_DEBUG_SERVER_GEO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LOOT_SLOT_CHANGED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(UMSG_UPDATE_GROUP_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_READY_FOR_ACCOUNT_DATA_TIMES, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleReadyForAccountDataTimes ); + //DEFINE_OPCODE_HANDLER(CMSG_QUERY_QUESTS_COMPLETED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryQuestsCompleted ); + //DEFINE_OPCODE_HANDLER(SMSG_QUERY_QUESTS_COMPLETED_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_REPORT_LAG, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReportLag ); + //DEFINE_OPCODE_HANDLER(CMSG_AFK_MONITOR_INFO_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_AFK_MONITOR_INFO_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_AFK_MONITOR_INFO_CLEAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + ////DEFINE_OPCODE_HANDLER(SMSG_CORPSE_IS_NOT_IN_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_NUKE_CHARACTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_ALLOW_LOW_LEVEL_RAID1, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_ALLOW_LOW_LEVEL_RAID2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_CAMERA_SHAKE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ITEM_ENCHANTMENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_CHARACTER_MODEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_REDIRECT_CLIENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_REDIRECTION_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_SUSPEND_COMMS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_SUSPEND_COMMS_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_FORCE_SEND_QUEUED_PACKETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_REDIRECTION_AUTH_PROOF, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DROP_NEW_CONNECTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_SEND_ALL_COMBAT_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_OPEN_LFG_DUNGEON_FINDER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_COLLISION_HGT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_COLLISION_HGT_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_COLLISION_HGT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_RANDOM_BG_WIN_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_HOLIDAY_BG_WIN_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_SKIRMISH_QUEUE_COMMAND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_SKIRMISH_QUEUE_RESULT1, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_SKIRMISH_QUEUE_RESULT2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_UNKNOWN_1310, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER( SMSG_VERIFY_CONNECTIVITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER( CMSG_VERIFY_CONNECTIVITY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); + DEFINE_OPCODE_HANDLER( CMSG_LOG_DISCONNECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); +#undef DEFINE_OPCODE_HANDLER }; diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index ef51d1be918..448650cb326 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -25,1327 +25,997 @@ #include "Common.h" -// Note: this include need for be sure have full definition of class WorldSession -// if this class definition not complite then VS for x64 release use different size for -// struct OpcodeHandler in this header and Opcode.cpp and get totally wrong data from -// table opcodeTable in source when Opcode.h included but WorldSession.h not included -#include "WorldSession.h" - /// List of Opcodes enum Opcodes { - MSG_NULL_ACTION = 0x000, - CMSG_BOOTME = 0x001, - CMSG_DBLOOKUP = 0x002, - SMSG_DBLOOKUP = 0x003, - CMSG_QUERY_OBJECT_POSITION = 0x004, - SMSG_QUERY_OBJECT_POSITION = 0x005, - CMSG_QUERY_OBJECT_ROTATION = 0x006, - SMSG_QUERY_OBJECT_ROTATION = 0x007, - CMSG_WORLD_TELEPORT = 0x008, - CMSG_TELEPORT_TO_UNIT = 0x009, - CMSG_ZONE_MAP = 0x00A, - SMSG_ZONE_MAP = 0x00B, - CMSG_DEBUG_CHANGECELLZONE = 0x00C, - CMSG_MOVE_CHARACTER_CHEAT = 0x00D, - SMSG_MOVE_CHARACTER_CHEAT = 0x00E, - CMSG_RECHARGE = 0x00F, - CMSG_LEARN_SPELL = 0x010, - CMSG_CREATEMONSTER = 0x011, - CMSG_DESTROYMONSTER = 0x012, - CMSG_CREATEITEM = 0x013, - CMSG_CREATEGAMEOBJECT = 0x014, - SMSG_CHECK_FOR_BOTS = 0x015, - CMSG_MAKEMONSTERATTACKGUID = 0x016, - CMSG_BOT_DETECTED2 = 0x017, - CMSG_FORCEACTION = 0x018, - CMSG_FORCEACTIONONOTHER = 0x019, - CMSG_FORCEACTIONSHOW = 0x01A, - SMSG_FORCEACTIONSHOW = 0x01B, - CMSG_PETGODMODE = 0x01C, - SMSG_PETGODMODE = 0x01D, - SMSG_REFER_A_FRIEND_EXPIRED = 0x01E, - CMSG_WEATHER_SPEED_CHEAT = 0x01F, - CMSG_UNDRESSPLAYER = 0x020, - CMSG_BEASTMASTER = 0x021, - CMSG_GODMODE = 0x022, - SMSG_GODMODE = 0x023, - CMSG_CHEAT_SETMONEY = 0x024, - CMSG_LEVEL_CHEAT = 0x025, - CMSG_PET_LEVEL_CHEAT = 0x026, - CMSG_SET_WORLDSTATE = 0x027, - CMSG_COOLDOWN_CHEAT = 0x028, - CMSG_USE_SKILL_CHEAT = 0x029, - CMSG_FLAG_QUEST = 0x02A, - CMSG_FLAG_QUEST_FINISH = 0x02B, - CMSG_CLEAR_QUEST = 0x02C, - CMSG_SEND_EVENT = 0x02D, - CMSG_DEBUG_AISTATE = 0x02E, - SMSG_DEBUG_AISTATE = 0x02F, - CMSG_DISABLE_PVP_CHEAT = 0x030, - CMSG_ADVANCE_SPAWN_TIME = 0x031, - SMSG_DESTRUCTIBLE_BUILDING_DAMAGE = 0x032, - CMSG_AUTH_SRP6_BEGIN = 0x033, - CMSG_AUTH_SRP6_PROOF = 0x034, - CMSG_AUTH_SRP6_RECODE = 0x035, - CMSG_CHAR_CREATE = 0x036, - CMSG_CHAR_ENUM = 0x037, - CMSG_CHAR_DELETE = 0x038, - SMSG_AUTH_SRP6_RESPONSE = 0x039, - SMSG_CHAR_CREATE = 0x03A, - SMSG_CHAR_ENUM = 0x03B, - SMSG_CHAR_DELETE = 0x03C, - CMSG_PLAYER_LOGIN = 0x03D, - SMSG_NEW_WORLD = 0x03E, - SMSG_TRANSFER_PENDING = 0x03F, - SMSG_TRANSFER_ABORTED = 0x040, - SMSG_CHARACTER_LOGIN_FAILED = 0x041, - SMSG_LOGIN_SETTIMESPEED = 0x042, - SMSG_GAMETIME_UPDATE = 0x043, - CMSG_GAMETIME_SET = 0x044, - SMSG_GAMETIME_SET = 0x045, - CMSG_GAMESPEED_SET = 0x046, - SMSG_GAMESPEED_SET = 0x047, - CMSG_SERVERTIME = 0x048, - SMSG_SERVERTIME = 0x049, - CMSG_PLAYER_LOGOUT = 0x04A, - CMSG_LOGOUT_REQUEST = 0x04B, - SMSG_LOGOUT_RESPONSE = 0x04C, - SMSG_LOGOUT_COMPLETE = 0x04D, - CMSG_LOGOUT_CANCEL = 0x04E, - SMSG_LOGOUT_CANCEL_ACK = 0x04F, - CMSG_NAME_QUERY = 0x050, - SMSG_NAME_QUERY_RESPONSE = 0x051, - CMSG_PET_NAME_QUERY = 0x052, - SMSG_PET_NAME_QUERY_RESPONSE = 0x053, - CMSG_GUILD_QUERY = 0x054, - SMSG_GUILD_QUERY_RESPONSE = 0x055, - CMSG_ITEM_QUERY_SINGLE = 0x056, - CMSG_ITEM_QUERY_MULTIPLE = 0x057, - SMSG_ITEM_QUERY_SINGLE_RESPONSE = 0x058, - SMSG_ITEM_QUERY_MULTIPLE_RESPONSE = 0x059, - CMSG_PAGE_TEXT_QUERY = 0x05A, - SMSG_PAGE_TEXT_QUERY_RESPONSE = 0x05B, - CMSG_QUEST_QUERY = 0x05C, - SMSG_QUEST_QUERY_RESPONSE = 0x05D, - CMSG_GAMEOBJECT_QUERY = 0x05E, - SMSG_GAMEOBJECT_QUERY_RESPONSE = 0x05F, - CMSG_CREATURE_QUERY = 0x060, - SMSG_CREATURE_QUERY_RESPONSE = 0x061, - CMSG_WHO = 0x062, - SMSG_WHO = 0x063, - CMSG_WHOIS = 0x064, - SMSG_WHOIS = 0x065, - CMSG_CONTACT_LIST = 0x066, - SMSG_CONTACT_LIST = 0x067, - SMSG_FRIEND_STATUS = 0x068, - CMSG_ADD_FRIEND = 0x069, - CMSG_DEL_FRIEND = 0x06A, - CMSG_SET_CONTACT_NOTES = 0x06B, - CMSG_ADD_IGNORE = 0x06C, - CMSG_DEL_IGNORE = 0x06D, - CMSG_GROUP_INVITE = 0x06E, - SMSG_GROUP_INVITE = 0x06F, - CMSG_GROUP_CANCEL = 0x070, - SMSG_GROUP_CANCEL = 0x071, - CMSG_GROUP_ACCEPT = 0x072, - CMSG_GROUP_DECLINE = 0x073, - SMSG_GROUP_DECLINE = 0x074, - CMSG_GROUP_UNINVITE = 0x075, - CMSG_GROUP_UNINVITE_GUID = 0x076, - SMSG_GROUP_UNINVITE = 0x077, - CMSG_GROUP_SET_LEADER = 0x078, - SMSG_GROUP_SET_LEADER = 0x079, - CMSG_LOOT_METHOD = 0x07A, - CMSG_GROUP_DISBAND = 0x07B, - SMSG_GROUP_DESTROYED = 0x07C, - SMSG_GROUP_LIST = 0x07D, - SMSG_PARTY_MEMBER_STATS = 0x07E, - SMSG_PARTY_COMMAND_RESULT = 0x07F, - UMSG_UPDATE_GROUP_MEMBERS = 0x080, - CMSG_GUILD_CREATE = 0x081, - CMSG_GUILD_INVITE = 0x082, - SMSG_GUILD_INVITE = 0x083, - CMSG_GUILD_ACCEPT = 0x084, - CMSG_GUILD_DECLINE = 0x085, - SMSG_GUILD_DECLINE = 0x086, - CMSG_GUILD_INFO = 0x087, - SMSG_GUILD_INFO = 0x088, - CMSG_GUILD_ROSTER = 0x089, - SMSG_GUILD_ROSTER = 0x08A, - CMSG_GUILD_PROMOTE = 0x08B, - CMSG_GUILD_DEMOTE = 0x08C, - CMSG_GUILD_LEAVE = 0x08D, - CMSG_GUILD_REMOVE = 0x08E, - CMSG_GUILD_DISBAND = 0x08F, - CMSG_GUILD_LEADER = 0x090, - CMSG_GUILD_MOTD = 0x091, - SMSG_GUILD_EVENT = 0x092, - SMSG_GUILD_COMMAND_RESULT = 0x093, - UMSG_UPDATE_GUILD = 0x094, - CMSG_MESSAGECHAT = 0x095, - SMSG_MESSAGECHAT = 0x096, - CMSG_JOIN_CHANNEL = 0x097, - CMSG_LEAVE_CHANNEL = 0x098, - SMSG_CHANNEL_NOTIFY = 0x099, - CMSG_CHANNEL_LIST = 0x09A, - SMSG_CHANNEL_LIST = 0x09B, - CMSG_CHANNEL_PASSWORD = 0x09C, - CMSG_CHANNEL_SET_OWNER = 0x09D, - CMSG_CHANNEL_OWNER = 0x09E, - CMSG_CHANNEL_MODERATOR = 0x09F, - CMSG_CHANNEL_UNMODERATOR = 0x0A0, - CMSG_CHANNEL_MUTE = 0x0A1, - CMSG_CHANNEL_UNMUTE = 0x0A2, - CMSG_CHANNEL_INVITE = 0x0A3, - CMSG_CHANNEL_KICK = 0x0A4, - CMSG_CHANNEL_BAN = 0x0A5, - CMSG_CHANNEL_UNBAN = 0x0A6, - CMSG_CHANNEL_ANNOUNCEMENTS = 0x0A7, - CMSG_CHANNEL_MODERATE = 0x0A8, - SMSG_UPDATE_OBJECT = 0x0A9, - SMSG_DESTROY_OBJECT = 0x0AA, - CMSG_USE_ITEM = 0x0AB, - CMSG_OPEN_ITEM = 0x0AC, - CMSG_READ_ITEM = 0x0AD, - SMSG_READ_ITEM_OK = 0x0AE, - SMSG_READ_ITEM_FAILED = 0x0AF, - SMSG_ITEM_COOLDOWN = 0x0B0, - CMSG_GAMEOBJ_USE = 0x0B1, - CMSG_DESTROY_ITEMS = 0x0B2, - SMSG_GAMEOBJECT_CUSTOM_ANIM = 0x0B3, - CMSG_AREATRIGGER = 0x0B4, - MSG_MOVE_START_FORWARD = 0x0B5, - MSG_MOVE_START_BACKWARD = 0x0B6, - MSG_MOVE_STOP = 0x0B7, - MSG_MOVE_START_STRAFE_LEFT = 0x0B8, - MSG_MOVE_START_STRAFE_RIGHT = 0x0B9, - MSG_MOVE_STOP_STRAFE = 0x0BA, - MSG_MOVE_JUMP = 0x0BB, - MSG_MOVE_START_TURN_LEFT = 0x0BC, - MSG_MOVE_START_TURN_RIGHT = 0x0BD, - MSG_MOVE_STOP_TURN = 0x0BE, - MSG_MOVE_START_PITCH_UP = 0x0BF, - MSG_MOVE_START_PITCH_DOWN = 0x0C0, - MSG_MOVE_STOP_PITCH = 0x0C1, - MSG_MOVE_SET_RUN_MODE = 0x0C2, - MSG_MOVE_SET_WALK_MODE = 0x0C3, - MSG_MOVE_TOGGLE_LOGGING = 0x0C4, - MSG_MOVE_TELEPORT = 0x0C5, - MSG_MOVE_TELEPORT_CHEAT = 0x0C6, - MSG_MOVE_TELEPORT_ACK = 0x0C7, - MSG_MOVE_TOGGLE_FALL_LOGGING = 0x0C8, - MSG_MOVE_FALL_LAND = 0x0C9, - MSG_MOVE_START_SWIM = 0x0CA, - MSG_MOVE_STOP_SWIM = 0x0CB, - MSG_MOVE_SET_RUN_SPEED_CHEAT = 0x0CC, - MSG_MOVE_SET_RUN_SPEED = 0x0CD, - MSG_MOVE_SET_RUN_BACK_SPEED_CHEAT = 0x0CE, - MSG_MOVE_SET_RUN_BACK_SPEED = 0x0CF, - MSG_MOVE_SET_WALK_SPEED_CHEAT = 0x0D0, - MSG_MOVE_SET_WALK_SPEED = 0x0D1, - MSG_MOVE_SET_SWIM_SPEED_CHEAT = 0x0D2, - MSG_MOVE_SET_SWIM_SPEED = 0x0D3, - MSG_MOVE_SET_SWIM_BACK_SPEED_CHEAT = 0x0D4, - MSG_MOVE_SET_SWIM_BACK_SPEED = 0x0D5, - MSG_MOVE_SET_ALL_SPEED_CHEAT = 0x0D6, - MSG_MOVE_SET_TURN_RATE_CHEAT = 0x0D7, - MSG_MOVE_SET_TURN_RATE = 0x0D8, - MSG_MOVE_TOGGLE_COLLISION_CHEAT = 0x0D9, - MSG_MOVE_SET_FACING = 0x0DA, - MSG_MOVE_SET_PITCH = 0x0DB, - MSG_MOVE_WORLDPORT_ACK = 0x0DC, - SMSG_MONSTER_MOVE = 0x0DD, - SMSG_MOVE_WATER_WALK = 0x0DE, - SMSG_MOVE_LAND_WALK = 0x0DF, - CMSG_MOVE_CHARM_PORT_CHEAT = 0x0E0, - CMSG_MOVE_SET_RAW_POSITION = 0x0E1, - SMSG_FORCE_RUN_SPEED_CHANGE = 0x0E2, - CMSG_FORCE_RUN_SPEED_CHANGE_ACK = 0x0E3, - SMSG_FORCE_RUN_BACK_SPEED_CHANGE = 0x0E4, - CMSG_FORCE_RUN_BACK_SPEED_CHANGE_ACK = 0x0E5, - SMSG_FORCE_SWIM_SPEED_CHANGE = 0x0E6, - CMSG_FORCE_SWIM_SPEED_CHANGE_ACK = 0x0E7, - SMSG_FORCE_MOVE_ROOT = 0x0E8, - CMSG_FORCE_MOVE_ROOT_ACK = 0x0E9, - SMSG_FORCE_MOVE_UNROOT = 0x0EA, - CMSG_FORCE_MOVE_UNROOT_ACK = 0x0EB, - MSG_MOVE_ROOT = 0x0EC, - MSG_MOVE_UNROOT = 0x0ED, - MSG_MOVE_HEARTBEAT = 0x0EE, - SMSG_MOVE_KNOCK_BACK = 0x0EF, - CMSG_MOVE_KNOCK_BACK_ACK = 0x0F0, - MSG_MOVE_KNOCK_BACK = 0x0F1, - SMSG_MOVE_FEATHER_FALL = 0x0F2, - SMSG_MOVE_NORMAL_FALL = 0x0F3, - SMSG_MOVE_SET_HOVER = 0x0F4, - SMSG_MOVE_UNSET_HOVER = 0x0F5, - CMSG_MOVE_HOVER_ACK = 0x0F6, - MSG_MOVE_HOVER = 0x0F7, - CMSG_TRIGGER_CINEMATIC_CHEAT = 0x0F8, - CMSG_OPENING_CINEMATIC = 0x0F9, - SMSG_TRIGGER_CINEMATIC = 0x0FA, - CMSG_NEXT_CINEMATIC_CAMERA = 0x0FB, - CMSG_COMPLETE_CINEMATIC = 0x0FC, - SMSG_TUTORIAL_FLAGS = 0x0FD, - CMSG_TUTORIAL_FLAG = 0x0FE, - CMSG_TUTORIAL_CLEAR = 0x0FF, - CMSG_TUTORIAL_RESET = 0x100, - CMSG_STANDSTATECHANGE = 0x101, - CMSG_EMOTE = 0x102, - SMSG_EMOTE = 0x103, - CMSG_TEXT_EMOTE = 0x104, - SMSG_TEXT_EMOTE = 0x105, - CMSG_AUTOEQUIP_GROUND_ITEM = 0x106, - CMSG_AUTOSTORE_GROUND_ITEM = 0x107, - CMSG_AUTOSTORE_LOOT_ITEM = 0x108, - CMSG_STORE_LOOT_IN_SLOT = 0x109, - CMSG_AUTOEQUIP_ITEM = 0x10A, - CMSG_AUTOSTORE_BAG_ITEM = 0x10B, - CMSG_SWAP_ITEM = 0x10C, - CMSG_SWAP_INV_ITEM = 0x10D, - CMSG_SPLIT_ITEM = 0x10E, - CMSG_AUTOEQUIP_ITEM_SLOT = 0x10F, - CMSG_UNCLAIM_LICENSE = 0x110, - CMSG_DESTROYITEM = 0x111, - SMSG_INVENTORY_CHANGE_FAILURE = 0x112, - SMSG_OPEN_CONTAINER = 0x113, - CMSG_INSPECT = 0x114, - SMSG_INSPECT_RESULTS_UPDATE = 0x115, - CMSG_INITIATE_TRADE = 0x116, - CMSG_BEGIN_TRADE = 0x117, - CMSG_BUSY_TRADE = 0x118, - CMSG_IGNORE_TRADE = 0x119, - CMSG_ACCEPT_TRADE = 0x11A, - CMSG_UNACCEPT_TRADE = 0x11B, - CMSG_CANCEL_TRADE = 0x11C, - CMSG_SET_TRADE_ITEM = 0x11D, - CMSG_CLEAR_TRADE_ITEM = 0x11E, - CMSG_SET_TRADE_GOLD = 0x11F, - SMSG_TRADE_STATUS = 0x120, - SMSG_TRADE_STATUS_EXTENDED = 0x121, - SMSG_INITIALIZE_FACTIONS = 0x122, - SMSG_SET_FACTION_VISIBLE = 0x123, - SMSG_SET_FACTION_STANDING = 0x124, - CMSG_SET_FACTION_ATWAR = 0x125, - CMSG_SET_FACTION_CHEAT = 0x126, - SMSG_SET_PROFICIENCY = 0x127, - CMSG_SET_ACTION_BUTTON = 0x128, - SMSG_ACTION_BUTTONS = 0x129, - SMSG_INITIAL_SPELLS = 0x12A, - SMSG_LEARNED_SPELL = 0x12B, - SMSG_SUPERCEDED_SPELL = 0x12C, - CMSG_NEW_SPELL_SLOT = 0x12D, - CMSG_CAST_SPELL = 0x12E, - CMSG_CANCEL_CAST = 0x12F, - SMSG_CAST_FAILED = 0x130, - SMSG_SPELL_START = 0x131, - SMSG_SPELL_GO = 0x132, - SMSG_SPELL_FAILURE = 0x133, - SMSG_SPELL_COOLDOWN = 0x134, - SMSG_COOLDOWN_EVENT = 0x135, - CMSG_CANCEL_AURA = 0x136, - SMSG_EQUIPMENT_SET_SAVED = 0x137, - SMSG_PET_CAST_FAILED = 0x138, - MSG_CHANNEL_START = 0x139, - MSG_CHANNEL_UPDATE = 0x13A, - CMSG_CANCEL_CHANNELLING = 0x13B, - SMSG_AI_REACTION = 0x13C, - CMSG_SET_SELECTION = 0x13D, - CMSG_DELETEEQUIPMENT_SET = 0x13E, - CMSG_INSTANCE_LOCK_RESPONSE = 0x13F, - CMSG_DEBUG_PASSIVE_AURA = 0x140, - CMSG_ATTACKSWING = 0x141, - CMSG_ATTACKSTOP = 0x142, - SMSG_ATTACKSTART = 0x143, - SMSG_ATTACKSTOP = 0x144, - SMSG_ATTACKSWING_NOTINRANGE = 0x145, - SMSG_ATTACKSWING_BADFACING = 0x146, - SMSG_INSTANCE_LOCK_WARNING_QUERY = 0x147, - SMSG_ATTACKSWING_DEADTARGET = 0x148, - SMSG_ATTACKSWING_CANT_ATTACK = 0x149, - SMSG_ATTACKERSTATEUPDATE = 0x14A, - SMSG_BATTLEFIELD_PORT_DENIED = 0x14B, - CMSG_PERFORM_ACTION_SET = 0x14C, - SMSG_RESUME_CAST_BAR = 0x14D, - SMSG_CANCEL_COMBAT = 0x14E, - SMSG_SPELLBREAKLOG = 0x14F, - SMSG_SPELLHEALLOG = 0x150, - SMSG_SPELLENERGIZELOG = 0x151, - SMSG_BREAK_TARGET = 0x152, - CMSG_SAVE_PLAYER = 0x153, - CMSG_SETDEATHBINDPOINT = 0x154, - SMSG_BINDPOINTUPDATE = 0x155, - CMSG_GETDEATHBINDZONE = 0x156, - SMSG_BINDZONEREPLY = 0x157, - SMSG_PLAYERBOUND = 0x158, - SMSG_CLIENT_CONTROL_UPDATE = 0x159, - CMSG_REPOP_REQUEST = 0x15A, - SMSG_RESURRECT_REQUEST = 0x15B, - CMSG_RESURRECT_RESPONSE = 0x15C, - CMSG_LOOT = 0x15D, - CMSG_LOOT_MONEY = 0x15E, - CMSG_LOOT_RELEASE = 0x15F, - SMSG_LOOT_RESPONSE = 0x160, - SMSG_LOOT_RELEASE_RESPONSE = 0x161, - SMSG_LOOT_REMOVED = 0x162, - SMSG_LOOT_MONEY_NOTIFY = 0x163, - SMSG_LOOT_ITEM_NOTIFY = 0x164, - SMSG_LOOT_CLEAR_MONEY = 0x165, - SMSG_ITEM_PUSH_RESULT = 0x166, - SMSG_DUEL_REQUESTED = 0x167, - SMSG_DUEL_OUTOFBOUNDS = 0x168, - SMSG_DUEL_INBOUNDS = 0x169, - SMSG_DUEL_COMPLETE = 0x16A, - SMSG_DUEL_WINNER = 0x16B, - CMSG_DUEL_ACCEPTED = 0x16C, - CMSG_DUEL_CANCELLED = 0x16D, - SMSG_MOUNTRESULT = 0x16E, - SMSG_DISMOUNTRESULT = 0x16F, - SMSG_REMOVED_FROM_PVP_QUEUE = 0x170, - CMSG_MOUNTSPECIAL_ANIM = 0x171, - SMSG_MOUNTSPECIAL_ANIM = 0x172, - SMSG_PET_TAME_FAILURE = 0x173, - CMSG_PET_SET_ACTION = 0x174, - CMSG_PET_ACTION = 0x175, - CMSG_PET_ABANDON = 0x176, - CMSG_PET_RENAME = 0x177, - SMSG_PET_NAME_INVALID = 0x178, - SMSG_PET_SPELLS = 0x179, - SMSG_PET_MODE = 0x17A, - CMSG_GOSSIP_HELLO = 0x17B, - CMSG_GOSSIP_SELECT_OPTION = 0x17C, - SMSG_GOSSIP_MESSAGE = 0x17D, - SMSG_GOSSIP_COMPLETE = 0x17E, - CMSG_NPC_TEXT_QUERY = 0x17F, - SMSG_NPC_TEXT_UPDATE = 0x180, - SMSG_NPC_WONT_TALK = 0x181, - CMSG_QUESTGIVER_STATUS_QUERY = 0x182, - SMSG_QUESTGIVER_STATUS = 0x183, - CMSG_QUESTGIVER_HELLO = 0x184, - SMSG_QUESTGIVER_QUEST_LIST = 0x185, - CMSG_QUESTGIVER_QUERY_QUEST = 0x186, - CMSG_QUESTGIVER_QUEST_AUTOLAUNCH = 0x187, - SMSG_QUESTGIVER_QUEST_DETAILS = 0x188, - CMSG_QUESTGIVER_ACCEPT_QUEST = 0x189, - CMSG_QUESTGIVER_COMPLETE_QUEST = 0x18A, - SMSG_QUESTGIVER_REQUEST_ITEMS = 0x18B, - CMSG_QUESTGIVER_REQUEST_REWARD = 0x18C, - SMSG_QUESTGIVER_OFFER_REWARD = 0x18D, - CMSG_QUESTGIVER_CHOOSE_REWARD = 0x18E, - SMSG_QUESTGIVER_QUEST_INVALID = 0x18F, - CMSG_QUESTGIVER_CANCEL = 0x190, - SMSG_QUESTGIVER_QUEST_COMPLETE = 0x191, - SMSG_QUESTGIVER_QUEST_FAILED = 0x192, - CMSG_QUESTLOG_SWAP_QUEST = 0x193, - CMSG_QUESTLOG_REMOVE_QUEST = 0x194, - SMSG_QUESTLOG_FULL = 0x195, - SMSG_QUESTUPDATE_FAILED = 0x196, - SMSG_QUESTUPDATE_FAILEDTIMER = 0x197, - SMSG_QUESTUPDATE_COMPLETE = 0x198, - SMSG_QUESTUPDATE_ADD_KILL = 0x199, - SMSG_QUESTUPDATE_ADD_ITEM = 0x19A, - CMSG_QUEST_CONFIRM_ACCEPT = 0x19B, - SMSG_QUEST_CONFIRM_ACCEPT = 0x19C, - CMSG_PUSHQUESTTOPARTY = 0x19D, - CMSG_LIST_INVENTORY = 0x19E, - SMSG_LIST_INVENTORY = 0x19F, - CMSG_SELL_ITEM = 0x1A0, - SMSG_SELL_ITEM = 0x1A1, - CMSG_BUY_ITEM = 0x1A2, - CMSG_BUY_ITEM_IN_SLOT = 0x1A3, - SMSG_BUY_ITEM = 0x1A4, - SMSG_BUY_FAILED = 0x1A5, - CMSG_TAXICLEARALLNODES = 0x1A6, - CMSG_TAXIENABLEALLNODES = 0x1A7, - CMSG_TAXISHOWNODES = 0x1A8, - SMSG_SHOWTAXINODES = 0x1A9, - CMSG_TAXINODE_STATUS_QUERY = 0x1AA, - SMSG_TAXINODE_STATUS = 0x1AB, - CMSG_TAXIQUERYAVAILABLENODES = 0x1AC, - CMSG_ACTIVATETAXI = 0x1AD, - SMSG_ACTIVATETAXIREPLY = 0x1AE, - SMSG_NEW_TAXI_PATH = 0x1AF, - CMSG_TRAINER_LIST = 0x1B0, - SMSG_TRAINER_LIST = 0x1B1, - CMSG_TRAINER_BUY_SPELL = 0x1B2, - SMSG_TRAINER_BUY_SUCCEEDED = 0x1B3, - SMSG_TRAINER_BUY_FAILED = 0x1B4, - CMSG_BINDER_ACTIVATE = 0x1B5, - SMSG_PLAYERBINDERROR = 0x1B6, - CMSG_BANKER_ACTIVATE = 0x1B7, - SMSG_SHOW_BANK = 0x1B8, - CMSG_BUY_BANK_SLOT = 0x1B9, - SMSG_BUY_BANK_SLOT_RESULT = 0x1BA, - CMSG_PETITION_SHOWLIST = 0x1BB, - SMSG_PETITION_SHOWLIST = 0x1BC, - CMSG_PETITION_BUY = 0x1BD, - CMSG_PETITION_SHOW_SIGNATURES = 0x1BE, - SMSG_PETITION_SHOW_SIGNATURES = 0x1BF, - CMSG_PETITION_SIGN = 0x1C0, - SMSG_PETITION_SIGN_RESULTS = 0x1C1, - MSG_PETITION_DECLINE = 0x1C2, - CMSG_OFFER_PETITION = 0x1C3, - CMSG_TURN_IN_PETITION = 0x1C4, - SMSG_TURN_IN_PETITION_RESULTS = 0x1C5, - CMSG_PETITION_QUERY = 0x1C6, - SMSG_PETITION_QUERY_RESPONSE = 0x1C7, - SMSG_FISH_NOT_HOOKED = 0x1C8, - SMSG_FISH_ESCAPED = 0x1C9, - CMSG_BUG = 0x1CA, - SMSG_NOTIFICATION = 0x1CB, - CMSG_PLAYED_TIME = 0x1CC, - SMSG_PLAYED_TIME = 0x1CD, - CMSG_QUERY_TIME = 0x1CE, - SMSG_QUERY_TIME_RESPONSE = 0x1CF, - SMSG_LOG_XPGAIN = 0x1D0, - SMSG_AURACASTLOG = 0x1D1, - CMSG_RECLAIM_CORPSE = 0x1D2, - CMSG_WRAP_ITEM = 0x1D3, - SMSG_LEVELUP_INFO = 0x1D4, - MSG_MINIMAP_PING = 0x1D5, - SMSG_RESISTLOG = 0x1D6, - SMSG_ENCHANTMENTLOG = 0x1D7, - CMSG_SET_SKILL_CHEAT = 0x1D8, - SMSG_START_MIRROR_TIMER = 0x1D9, - SMSG_PAUSE_MIRROR_TIMER = 0x1DA, - SMSG_STOP_MIRROR_TIMER = 0x1DB, - CMSG_PING = 0x1DC, - SMSG_PONG = 0x1DD, - SMSG_CLEAR_COOLDOWN = 0x1DE, - SMSG_GAMEOBJECT_PAGETEXT = 0x1DF, - CMSG_SETSHEATHED = 0x1E0, - SMSG_COOLDOWN_CHEAT = 0x1E1, - SMSG_SPELL_DELAYED = 0x1E2, - CMSG_QUEST_POI_QUERY = 0x1E3, - SMSG_QUEST_POI_QUERY_RESPONSE = 0x1E4, - CMSG_GHOST = 0x1E5, - CMSG_GM_INVIS = 0x1E6, - SMSG_INVALID_PROMOTION_CODE = 0x1E7, - MSG_GM_BIND_OTHER = 0x1E8, - MSG_GM_SUMMON = 0x1E9, - SMSG_ITEM_TIME_UPDATE = 0x1EA, - SMSG_ITEM_ENCHANT_TIME_UPDATE = 0x1EB, - SMSG_AUTH_CHALLENGE = 0x1EC, - CMSG_AUTH_SESSION = 0x1ED, - SMSG_AUTH_RESPONSE = 0x1EE, - MSG_GM_SHOWLABEL = 0x1EF, - CMSG_PET_CAST_SPELL = 0x1F0, - MSG_SAVE_GUILD_EMBLEM = 0x1F1, - MSG_TABARDVENDOR_ACTIVATE = 0x1F2, - SMSG_PLAY_SPELL_VISUAL = 0x1F3, - CMSG_ZONEUPDATE = 0x1F4, - SMSG_PARTYKILLLOG = 0x1F5, - SMSG_COMPRESSED_UPDATE_OBJECT = 0x1F6, - SMSG_PLAY_SPELL_IMPACT = 0x1F7, - SMSG_EXPLORATION_EXPERIENCE = 0x1F8, - CMSG_GM_SET_SECURITY_GROUP = 0x1F9, - CMSG_GM_NUKE = 0x1FA, - MSG_RANDOM_ROLL = 0x1FB, - SMSG_ENVIRONMENTALDAMAGELOG = 0x1FC, - CMSG_CHANGEPLAYER_DIFFICULTY = 0x1FD, - SMSG_RWHOIS = 0x1FE, - SMSG_LFG_PLAYER_REWARD = 0x1FF, // uint32, uint8, uint32, uint32, uint32, uint32, uint32, uint8, for (uint8) {uint32, uint32, uint32} - SMSG_LFG_TELEPORT_DENIED = 0x200, // uint32 (1, 2, 4, 6;0, 5, 7) - CMSG_UNLEARN_SPELL = 0x201, - CMSG_UNLEARN_SKILL = 0x202, - SMSG_REMOVED_SPELL = 0x203, - CMSG_DECHARGE = 0x204, - CMSG_GMTICKET_CREATE = 0x205, - SMSG_GMTICKET_CREATE = 0x206, - CMSG_GMTICKET_UPDATETEXT = 0x207, - SMSG_GMTICKET_UPDATETEXT = 0x208, - SMSG_ACCOUNT_DATA_TIMES = 0x209, - CMSG_REQUEST_ACCOUNT_DATA = 0x20A, - CMSG_UPDATE_ACCOUNT_DATA = 0x20B, - SMSG_UPDATE_ACCOUNT_DATA = 0x20C, - SMSG_CLEAR_FAR_SIGHT_IMMEDIATE = 0x20D, - SMSG_CHANGEPLAYER_DIFFICULTY_RESULT = 0x20E, - CMSG_GM_TEACH = 0x20F, - CMSG_GM_CREATE_ITEM_TARGET = 0x210, - CMSG_GMTICKET_GETTICKET = 0x211, - SMSG_GMTICKET_GETTICKET = 0x212, - CMSG_UNLEARN_TALENTS = 0x213, - SMSG_UPDATE_INSTANCE_ENCOUNTER_UNIT = 0x214, - SMSG_GAMEOBJECT_DESPAWN_ANIM = 0x215, - MSG_CORPSE_QUERY = 0x216, - CMSG_GMTICKET_DELETETICKET = 0x217, - SMSG_GMTICKET_DELETETICKET = 0x218, - SMSG_CHAT_WRONG_FACTION = 0x219, - CMSG_GMTICKET_SYSTEMSTATUS = 0x21A, - SMSG_GMTICKET_SYSTEMSTATUS = 0x21B, - CMSG_SPIRIT_HEALER_ACTIVATE = 0x21C, - CMSG_SET_STAT_CHEAT = 0x21D, - SMSG_QUEST_FORCE_REMOVE = 0x21E, // uint32 questid - CMSG_SKILL_BUY_STEP = 0x21F, - CMSG_SKILL_BUY_RANK = 0x220, - CMSG_XP_CHEAT = 0x221, - SMSG_SPIRIT_HEALER_CONFIRM = 0x222, - CMSG_CHARACTER_POINT_CHEAT = 0x223, - SMSG_GOSSIP_POI = 0x224, - CMSG_CHAT_IGNORED = 0x225, - CMSG_GM_VISION = 0x226, - CMSG_SERVER_COMMAND = 0x227, - CMSG_GM_SILENCE = 0x228, - CMSG_GM_REVEALTO = 0x229, - CMSG_GM_RESURRECT = 0x22A, - CMSG_GM_SUMMONMOB = 0x22B, - CMSG_GM_MOVECORPSE = 0x22C, - CMSG_GM_FREEZE = 0x22D, - CMSG_GM_UBERINVIS = 0x22E, - CMSG_GM_REQUEST_PLAYER_INFO = 0x22F, - SMSG_GM_PLAYER_INFO = 0x230, - CMSG_GUILD_RANK = 0x231, - CMSG_GUILD_ADD_RANK = 0x232, - CMSG_GUILD_DEL_RANK = 0x233, - CMSG_GUILD_SET_PUBLIC_NOTE = 0x234, - CMSG_GUILD_SET_OFFICER_NOTE = 0x235, - SMSG_LOGIN_VERIFY_WORLD = 0x236, - CMSG_CLEAR_EXPLORATION = 0x237, - CMSG_SEND_MAIL = 0x238, - SMSG_SEND_MAIL_RESULT = 0x239, - CMSG_GET_MAIL_LIST = 0x23A, - SMSG_MAIL_LIST_RESULT = 0x23B, - CMSG_BATTLEFIELD_LIST = 0x23C, - SMSG_BATTLEFIELD_LIST = 0x23D, - CMSG_BATTLEFIELD_JOIN = 0x23E, - SMSG_FORCE_SET_VEHICLE_REC_ID = 0x23F, - CMSG_SET_VEHICLE_REC_ID_ACK = 0x240, - CMSG_TAXICLEARNODE = 0x241, - CMSG_TAXIENABLENODE = 0x242, - CMSG_ITEM_TEXT_QUERY = 0x243, - SMSG_ITEM_TEXT_QUERY_RESPONSE = 0x244, - CMSG_MAIL_TAKE_MONEY = 0x245, - CMSG_MAIL_TAKE_ITEM = 0x246, - CMSG_MAIL_MARK_AS_READ = 0x247, - CMSG_MAIL_RETURN_TO_SENDER = 0x248, - CMSG_MAIL_DELETE = 0x249, - CMSG_MAIL_CREATE_TEXT_ITEM = 0x24A, - SMSG_SPELLLOGMISS = 0x24B, - SMSG_SPELLLOGEXECUTE = 0x24C, - SMSG_DEBUGAURAPROC = 0x24D, - SMSG_PERIODICAURALOG = 0x24E, - SMSG_SPELLDAMAGESHIELD = 0x24F, - SMSG_SPELLNONMELEEDAMAGELOG = 0x250, - CMSG_LEARN_TALENT = 0x251, - SMSG_RESURRECT_FAILED = 0x252, - CMSG_TOGGLE_PVP = 0x253, - SMSG_ZONE_UNDER_ATTACK = 0x254, - MSG_AUCTION_HELLO = 0x255, - CMSG_AUCTION_SELL_ITEM = 0x256, - CMSG_AUCTION_REMOVE_ITEM = 0x257, - CMSG_AUCTION_LIST_ITEMS = 0x258, - CMSG_AUCTION_LIST_OWNER_ITEMS = 0x259, - CMSG_AUCTION_PLACE_BID = 0x25A, - SMSG_AUCTION_COMMAND_RESULT = 0x25B, - SMSG_AUCTION_LIST_RESULT = 0x25C, - SMSG_AUCTION_OWNER_LIST_RESULT = 0x25D, - SMSG_AUCTION_BIDDER_NOTIFICATION = 0x25E, - SMSG_AUCTION_OWNER_NOTIFICATION = 0x25F, - SMSG_PROCRESIST = 0x260, - SMSG_COMBAT_EVENT_FAILED = 0x261, - SMSG_DISPEL_FAILED = 0x262, - SMSG_SPELLORDAMAGE_IMMUNE = 0x263, - CMSG_AUCTION_LIST_BIDDER_ITEMS = 0x264, - SMSG_AUCTION_BIDDER_LIST_RESULT = 0x265, - SMSG_SET_FLAT_SPELL_MODIFIER = 0x266, - SMSG_SET_PCT_SPELL_MODIFIER = 0x267, - CMSG_SET_AMMO = 0x268, - SMSG_CORPSE_RECLAIM_DELAY = 0x269, - CMSG_SET_ACTIVE_MOVER = 0x26A, - CMSG_PET_CANCEL_AURA = 0x26B, - CMSG_PLAYER_AI_CHEAT = 0x26C, - CMSG_CANCEL_AUTO_REPEAT_SPELL = 0x26D, - MSG_GM_ACCOUNT_ONLINE = 0x26E, - MSG_LIST_STABLED_PETS = 0x26F, - CMSG_STABLE_PET = 0x270, - CMSG_UNSTABLE_PET = 0x271, - CMSG_BUY_STABLE_SLOT = 0x272, - SMSG_STABLE_RESULT = 0x273, - CMSG_STABLE_REVIVE_PET = 0x274, - CMSG_STABLE_SWAP_PET = 0x275, - MSG_QUEST_PUSH_RESULT = 0x276, - SMSG_PLAY_MUSIC = 0x277, - SMSG_PLAY_OBJECT_SOUND = 0x278, - CMSG_REQUEST_PET_INFO = 0x279, - CMSG_FAR_SIGHT = 0x27A, - SMSG_SPELLDISPELLOG = 0x27B, - SMSG_DAMAGE_CALC_LOG = 0x27C, - CMSG_ENABLE_DAMAGE_LOG = 0x27D, - CMSG_GROUP_CHANGE_SUB_GROUP = 0x27E, - CMSG_REQUEST_PARTY_MEMBER_STATS = 0x27F, - CMSG_GROUP_SWAP_SUB_GROUP = 0x280, - CMSG_RESET_FACTION_CHEAT = 0x281, - CMSG_AUTOSTORE_BANK_ITEM = 0x282, - CMSG_AUTOBANK_ITEM = 0x283, - MSG_QUERY_NEXT_MAIL_TIME = 0x284, - SMSG_RECEIVED_MAIL = 0x285, - SMSG_RAID_GROUP_ONLY = 0x286, - CMSG_SET_DURABILITY_CHEAT = 0x287, - CMSG_SET_PVP_RANK_CHEAT = 0x288, - CMSG_ADD_PVP_MEDAL_CHEAT = 0x289, - CMSG_DEL_PVP_MEDAL_CHEAT = 0x28A, - CMSG_SET_PVP_TITLE = 0x28B, - SMSG_PVP_CREDIT = 0x28C, - SMSG_AUCTION_REMOVED_NOTIFICATION = 0x28D, - CMSG_GROUP_RAID_CONVERT = 0x28E, - CMSG_GROUP_ASSISTANT_LEADER = 0x28F, - CMSG_BUYBACK_ITEM = 0x290, - SMSG_SERVER_MESSAGE = 0x291, - CMSG_SET_SAVED_INSTANCE_EXTEND = 0x292, - SMSG_LFG_OFFER_CONTINUE = 0x293, - CMSG_TEST_DROP_RATE = 0x294, - SMSG_TEST_DROP_RATE_RESULT = 0x295, - CMSG_LFG_GET_STATUS = 0x296, - SMSG_SHOW_MAILBOX = 0x297, - SMSG_RESET_RANGED_COMBAT_TIMER = 0x298, - SMSG_CHAT_NOT_IN_PARTY = 0x299, // uint32, errors: ERR_NOT_IN_GROUP (2, 51) and ERR_NOT_IN_RAID (3, 39, 40) - CMSG_GMTICKETSYSTEM_TOGGLE = 0x29A, - CMSG_CANCEL_GROWTH_AURA = 0x29B, - SMSG_CANCEL_AUTO_REPEAT = 0x29C, - SMSG_STANDSTATE_UPDATE = 0x29D, - SMSG_LOOT_ALL_PASSED = 0x29E, - SMSG_LOOT_ROLL_WON = 0x29F, - CMSG_LOOT_ROLL = 0x2A0, - SMSG_LOOT_START_ROLL = 0x2A1, - SMSG_LOOT_ROLL = 0x2A2, - CMSG_LOOT_MASTER_GIVE = 0x2A3, - SMSG_LOOT_MASTER_LIST = 0x2A4, - SMSG_SET_FORCED_REACTIONS = 0x2A5, - SMSG_SPELL_FAILED_OTHER = 0x2A6, - SMSG_GAMEOBJECT_RESET_STATE = 0x2A7, - CMSG_REPAIR_ITEM = 0x2A8, - SMSG_CHAT_PLAYER_NOT_FOUND = 0x2A9, - MSG_TALENT_WIPE_CONFIRM = 0x2AA, - SMSG_SUMMON_REQUEST = 0x2AB, - CMSG_SUMMON_RESPONSE = 0x2AC, - MSG_DEV_SHOWLABEL = 0x2AD, - SMSG_MONSTER_MOVE_TRANSPORT = 0x2AE, - SMSG_PET_BROKEN = 0x2AF, - MSG_MOVE_FEATHER_FALL = 0x2B0, - MSG_MOVE_WATER_WALK = 0x2B1, - CMSG_SERVER_BROADCAST = 0x2B2, - CMSG_SELF_RES = 0x2B3, - SMSG_FEIGN_DEATH_RESISTED = 0x2B4, - CMSG_RUN_SCRIPT = 0x2B5, - SMSG_SCRIPT_MESSAGE = 0x2B6, - SMSG_DUEL_COUNTDOWN = 0x2B7, - SMSG_AREA_TRIGGER_MESSAGE = 0x2B8, - CMSG_SHOWING_HELM = 0x2B9, - CMSG_SHOWING_CLOAK = 0x2BA, - SMSG_LFG_ROLE_CHOSEN = 0x2BB, - SMSG_PLAYER_SKINNED = 0x2BC, - SMSG_DURABILITY_DAMAGE_DEATH = 0x2BD, - CMSG_SET_EXPLORATION = 0x2BE, - CMSG_SET_ACTIONBAR_TOGGLES = 0x2BF, - UMSG_DELETE_GUILD_CHARTER = 0x2C0, - MSG_PETITION_RENAME = 0x2C1, - SMSG_INIT_WORLD_STATES = 0x2C2, - SMSG_UPDATE_WORLD_STATE = 0x2C3, - CMSG_ITEM_NAME_QUERY = 0x2C4, - SMSG_ITEM_NAME_QUERY_RESPONSE = 0x2C5, - SMSG_PET_ACTION_FEEDBACK = 0x2C6, - CMSG_CHAR_RENAME = 0x2C7, - SMSG_CHAR_RENAME = 0x2C8, - CMSG_MOVE_SPLINE_DONE = 0x2C9, - CMSG_MOVE_FALL_RESET = 0x2CA, - SMSG_INSTANCE_SAVE_CREATED = 0x2CB, - SMSG_RAID_INSTANCE_INFO = 0x2CC, - CMSG_REQUEST_RAID_INFO = 0x2CD, - CMSG_MOVE_TIME_SKIPPED = 0x2CE, - CMSG_MOVE_FEATHER_FALL_ACK = 0x2CF, - CMSG_MOVE_WATER_WALK_ACK = 0x2D0, - CMSG_MOVE_NOT_ACTIVE_MOVER = 0x2D1, - SMSG_PLAY_SOUND = 0x2D2, - CMSG_BATTLEFIELD_STATUS = 0x2D3, - SMSG_BATTLEFIELD_STATUS = 0x2D4, - CMSG_BATTLEFIELD_PORT = 0x2D5, - MSG_INSPECT_HONOR_STATS = 0x2D6, - CMSG_BATTLEMASTER_HELLO = 0x2D7, - CMSG_MOVE_START_SWIM_CHEAT = 0x2D8, - CMSG_MOVE_STOP_SWIM_CHEAT = 0x2D9, - SMSG_FORCE_WALK_SPEED_CHANGE = 0x2DA, - CMSG_FORCE_WALK_SPEED_CHANGE_ACK = 0x2DB, - SMSG_FORCE_SWIM_BACK_SPEED_CHANGE = 0x2DC, - CMSG_FORCE_SWIM_BACK_SPEED_CHANGE_ACK = 0x2DD, - SMSG_FORCE_TURN_RATE_CHANGE = 0x2DE, - CMSG_FORCE_TURN_RATE_CHANGE_ACK = 0x2DF, - MSG_PVP_LOG_DATA = 0x2E0, - CMSG_LEAVE_BATTLEFIELD = 0x2E1, - CMSG_AREA_SPIRIT_HEALER_QUERY = 0x2E2, - CMSG_AREA_SPIRIT_HEALER_QUEUE = 0x2E3, - SMSG_AREA_SPIRIT_HEALER_TIME = 0x2E4, - CMSG_GM_UNTEACH = 0x2E5, - SMSG_WARDEN_DATA = 0x2E6, - CMSG_WARDEN_DATA = 0x2E7, - SMSG_GROUP_JOINED_BATTLEGROUND = 0x2E8, - MSG_BATTLEGROUND_PLAYER_POSITIONS = 0x2E9, - CMSG_PET_STOP_ATTACK = 0x2EA, - SMSG_BINDER_CONFIRM = 0x2EB, - SMSG_BATTLEGROUND_PLAYER_JOINED = 0x2EC, - SMSG_BATTLEGROUND_PLAYER_LEFT = 0x2ED, - CMSG_BATTLEMASTER_JOIN = 0x2EE, - SMSG_ADDON_INFO = 0x2EF, - CMSG_PET_UNLEARN = 0x2F0, // Deprecated 3.x - SMSG_PET_UNLEARN_CONFIRM = 0x2F1, // Deprecated 3.x - SMSG_PARTY_MEMBER_STATS_FULL = 0x2F2, - CMSG_PET_SPELL_AUTOCAST = 0x2F3, - SMSG_WEATHER = 0x2F4, - SMSG_PLAY_TIME_WARNING = 0x2F5, - SMSG_MINIGAME_SETUP = 0x2F6, - SMSG_MINIGAME_STATE = 0x2F7, - CMSG_MINIGAME_MOVE = 0x2F8, - SMSG_MINIGAME_MOVE_FAILED = 0x2F9, - SMSG_RAID_INSTANCE_MESSAGE = 0x2FA, - SMSG_COMPRESSED_MOVES = 0x2FB, - CMSG_GUILD_INFO_TEXT = 0x2FC, - SMSG_CHAT_RESTRICTED = 0x2FD, - SMSG_SPLINE_SET_RUN_SPEED = 0x2FE, - SMSG_SPLINE_SET_RUN_BACK_SPEED = 0x2FF, - SMSG_SPLINE_SET_SWIM_SPEED = 0x300, - SMSG_SPLINE_SET_WALK_SPEED = 0x301, - SMSG_SPLINE_SET_SWIM_BACK_SPEED = 0x302, - SMSG_SPLINE_SET_TURN_RATE = 0x303, - SMSG_SPLINE_MOVE_UNROOT = 0x304, - SMSG_SPLINE_MOVE_FEATHER_FALL = 0x305, - SMSG_SPLINE_MOVE_NORMAL_FALL = 0x306, - SMSG_SPLINE_MOVE_SET_HOVER = 0x307, - SMSG_SPLINE_MOVE_UNSET_HOVER = 0x308, - SMSG_SPLINE_MOVE_WATER_WALK = 0x309, - SMSG_SPLINE_MOVE_LAND_WALK = 0x30A, - SMSG_SPLINE_MOVE_START_SWIM = 0x30B, - SMSG_SPLINE_MOVE_STOP_SWIM = 0x30C, - SMSG_SPLINE_MOVE_SET_RUN_MODE = 0x30D, - SMSG_SPLINE_MOVE_SET_WALK_MODE = 0x30E, - CMSG_GM_NUKE_ACCOUNT = 0x30F, - MSG_GM_DESTROY_CORPSE = 0x310, - CMSG_GM_DESTROY_ONLINE_CORPSE = 0x311, - CMSG_ACTIVATETAXIEXPRESS = 0x312, - SMSG_SET_FACTION_ATWAR = 0x313, - SMSG_GAMETIMEBIAS_SET = 0x314, - CMSG_DEBUG_ACTIONS_START = 0x315, - CMSG_DEBUG_ACTIONS_STOP = 0x316, - CMSG_SET_FACTION_INACTIVE = 0x317, - CMSG_SET_WATCHED_FACTION = 0x318, - MSG_MOVE_TIME_SKIPPED = 0x319, - SMSG_SPLINE_MOVE_ROOT = 0x31A, - CMSG_SET_EXPLORATION_ALL = 0x31B, - SMSG_INVALIDATE_PLAYER = 0x31C, - CMSG_RESET_INSTANCES = 0x31D, - SMSG_INSTANCE_RESET = 0x31E, - SMSG_INSTANCE_RESET_FAILED = 0x31F, - SMSG_UPDATE_LAST_INSTANCE = 0x320, - MSG_RAID_TARGET_UPDATE = 0x321, - MSG_RAID_READY_CHECK = 0x322, - CMSG_LUA_USAGE = 0x323, - SMSG_PET_ACTION_SOUND = 0x324, - SMSG_PET_DISMISS_SOUND = 0x325, - SMSG_GHOSTEE_GONE = 0x326, - CMSG_GM_UPDATE_TICKET_STATUS = 0x327, - SMSG_GM_TICKET_STATUS_UPDATE = 0x328, - MSG_SET_DUNGEON_DIFFICULTY = 0x329, - CMSG_GMSURVEY_SUBMIT = 0x32A, - SMSG_UPDATE_INSTANCE_OWNERSHIP = 0x32B, - CMSG_IGNORE_KNOCKBACK_CHEAT = 0x32C, - SMSG_CHAT_PLAYER_AMBIGUOUS = 0x32D, - MSG_DELAY_GHOST_TELEPORT = 0x32E, - SMSG_SPELLINSTAKILLLOG = 0x32F, - SMSG_SPELL_UPDATE_CHAIN_TARGETS = 0x330, - CMSG_CHAT_FILTERED = 0x331, - SMSG_EXPECTED_SPAM_RECORDS = 0x332, - SMSG_SPELLSTEALLOG = 0x333, - CMSG_LOTTERY_QUERY_OBSOLETE = 0x334, - SMSG_LOTTERY_QUERY_RESULT_OBSOLETE = 0x335, - CMSG_BUY_LOTTERY_TICKET_OBSOLETE = 0x336, - SMSG_LOTTERY_RESULT_OBSOLETE = 0x337, - SMSG_CHARACTER_PROFILE = 0x338, - SMSG_CHARACTER_PROFILE_REALM_CONNECTED = 0x339, - SMSG_DEFENSE_MESSAGE = 0x33A, - SMSG_INSTANCE_DIFFICULTY = 0x33B, - MSG_GM_RESETINSTANCELIMIT = 0x33C, - SMSG_MOTD = 0x33D, - SMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY= 0x33E, - SMSG_MOVE_UNSET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY= 0x33F, - CMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY_ACK= 0x340, - MSG_MOVE_START_SWIM_CHEAT = 0x341, - MSG_MOVE_STOP_SWIM_CHEAT = 0x342, - SMSG_MOVE_SET_CAN_FLY = 0x343, - SMSG_MOVE_UNSET_CAN_FLY = 0x344, - CMSG_MOVE_SET_CAN_FLY_ACK = 0x345, - CMSG_MOVE_SET_FLY = 0x346, - CMSG_SOCKET_GEMS = 0x347, - CMSG_ARENA_TEAM_CREATE = 0x348, - SMSG_ARENA_TEAM_COMMAND_RESULT = 0x349, - MSG_MOVE_UPDATE_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY= 0x34A, - CMSG_ARENA_TEAM_QUERY = 0x34B, - SMSG_ARENA_TEAM_QUERY_RESPONSE = 0x34C, - CMSG_ARENA_TEAM_ROSTER = 0x34D, - SMSG_ARENA_TEAM_ROSTER = 0x34E, - CMSG_ARENA_TEAM_INVITE = 0x34F, - SMSG_ARENA_TEAM_INVITE = 0x350, - CMSG_ARENA_TEAM_ACCEPT = 0x351, - CMSG_ARENA_TEAM_DECLINE = 0x352, - CMSG_ARENA_TEAM_LEAVE = 0x353, - CMSG_ARENA_TEAM_REMOVE = 0x354, - CMSG_ARENA_TEAM_DISBAND = 0x355, - CMSG_ARENA_TEAM_LEADER = 0x356, - SMSG_ARENA_TEAM_EVENT = 0x357, - CMSG_BATTLEMASTER_JOIN_ARENA = 0x358, - MSG_MOVE_START_ASCEND = 0x359, - MSG_MOVE_STOP_ASCEND = 0x35A, - SMSG_ARENA_TEAM_STATS = 0x35B, - CMSG_LFG_JOIN = 0x35C, - CMSG_LFG_LEAVE = 0x35D, - CMSG_SEARCH_LFG_JOIN = 0x35E, - CMSG_SEARCH_LFG_LEAVE = 0x35F, - SMSG_UPDATE_LFG_LIST = 0x360, // uint32, uint32, if (uint8) { uint32 count, for (count) { uint64} }, uint32 count2, uint32, for (count2) { uint64, uint32 flags, if (flags & 0x2) {string}, if (flags & 0x10) {for (3) uint8}, if (flags & 0x80) {uint64, uint32}}, uint32 count3, uint32, for (count3) {uint64, uint32 flags, if (flags & 0x1) {uint8, uint8, uint8, for (3) uint8, uint32, uint32, uint32, uint32, uint32, uint32, float, float, uint32, uint32, uint32, uint32, uint32, float, uint32, uint32, uint32, uint32, uint32, uint32}, if (flags&0x2) string, if (flags&0x4) uint8, if (flags&0x8) uint64, if (flags&0x10) uint8, if (flags&0x20) uint32, if (flags&0x40) uint8, if (flags& 0x80) {uint64, uint32}} - SMSG_LFG_PROPOSAL_UPDATE = 0x361, // uint32, uint8, uint32, uint32, uint8, for (uint8) {uint32, uint8, uint8, uint8, uint8} - CMSG_LFG_PROPOSAL_RESULT = 0x362, - SMSG_LFG_ROLE_CHECK_UPDATE = 0x363, // uint32, uint8, for (uint8) uint32, uint8, for (uint8) { uint64, uint8, uint32, uint8, } - SMSG_LFG_JOIN_RESULT = 0x364, // uint32 unk, uint32, if (unk == 6) { uint8 count, for (count) uint64 } - SMSG_LFG_QUEUE_STATUS = 0x365, // uint32 dungeon, uint32 lfgtype, uint32, uint32, uint32, uint32, uint8, uint8, uint8, uint8 - CMSG_SET_LFG_COMMENT = 0x366, - SMSG_LFG_UPDATE_PLAYER = 0x367, // uint8, if (uint8) { uint8, uint8, uint8, uint8, if (uint8) for (uint8) uint32, string} - SMSG_LFG_UPDATE_PARTY = 0x368, // uint8, if (uint8) { uint8, uint8, uint8, for (3) uint8, uint8, if (uint8) for (uint8) uint32, string} - SMSG_LFG_UPDATE_SEARCH = 0x369, // uint8 - CMSG_LFG_SET_ROLES = 0x36A, - CMSG_LFG_SET_NEEDS = 0x36B, - CMSG_LFG_SET_BOOT_VOTE = 0x36C, - SMSG_LFG_BOOT_PLAYER = 0x36D, // uint8, uint8, uint8, uint64, uint32, uint32, uint32, uint32 - CMSG_LFD_PLAYER_LOCK_INFO_REQUEST = 0x36E, - SMSG_LFG_PLAYER_INFO = 0x36F, // uint8, for (uint8) { uint32, uint8, uint32, uint32, uint32, uint32, uint8, for (uint8) {uint32, uint32, uint32}}, uint32, for (uint32) {uint32, uint32} - CMSG_LFG_TELEPORT = 0x370, - CMSG_LFD_PARTY_LOCK_INFO_REQUEST = 0x371, - SMSG_LFG_PARTY_INFO = 0x372, // uint8, for (uint8) uint64 - SMSG_TITLE_EARNED = 0x373, - CMSG_SET_TITLE = 0x374, - CMSG_CANCEL_MOUNT_AURA = 0x375, - SMSG_ARENA_ERROR = 0x376, - MSG_INSPECT_ARENA_TEAMS = 0x377, - SMSG_DEATH_RELEASE_LOC = 0x378, - CMSG_CANCEL_TEMP_ENCHANTMENT = 0x379, - SMSG_FORCED_DEATH_UPDATE = 0x37A, - CMSG_CHEAT_SET_HONOR_CURRENCY = 0x37B, - CMSG_CHEAT_SET_ARENA_CURRENCY = 0x37C, - MSG_MOVE_SET_FLIGHT_SPEED_CHEAT = 0x37D, - MSG_MOVE_SET_FLIGHT_SPEED = 0x37E, - MSG_MOVE_SET_FLIGHT_BACK_SPEED_CHEAT = 0x37F, - MSG_MOVE_SET_FLIGHT_BACK_SPEED = 0x380, - SMSG_FORCE_FLIGHT_SPEED_CHANGE = 0x381, - CMSG_FORCE_FLIGHT_SPEED_CHANGE_ACK = 0x382, - SMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE = 0x383, - CMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK = 0x384, - SMSG_SPLINE_SET_FLIGHT_SPEED = 0x385, - SMSG_SPLINE_SET_FLIGHT_BACK_SPEED = 0x386, - CMSG_MAELSTROM_INVALIDATE_CACHE = 0x387, - SMSG_FLIGHT_SPLINE_SYNC = 0x388, - CMSG_SET_TAXI_BENCHMARK_MODE = 0x389, - SMSG_JOINED_BATTLEGROUND_QUEUE = 0x38A, - SMSG_REALM_SPLIT = 0x38B, - CMSG_REALM_SPLIT = 0x38C, - CMSG_MOVE_CHNG_TRANSPORT = 0x38D, - MSG_PARTY_ASSIGNMENT = 0x38E, - SMSG_OFFER_PETITION_ERROR = 0x38F, - SMSG_TIME_SYNC_REQ = 0x390, - CMSG_TIME_SYNC_RESP = 0x391, - CMSG_SEND_LOCAL_EVENT = 0x392, - CMSG_SEND_GENERAL_TRIGGER = 0x393, - CMSG_SEND_COMBAT_TRIGGER = 0x394, - CMSG_MAELSTROM_GM_SENT_MAIL = 0x395, - SMSG_RESET_FAILED_NOTIFY = 0x396, - SMSG_REAL_GROUP_UPDATE = 0x397, - SMSG_LFG_DISABLED = 0x398, - CMSG_ACTIVE_PVP_CHEAT = 0x399, - CMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY = 0x39A, - SMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY_RESPONSE = 0x39B, - SMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY_RESPONSE_WRITE_FILE = 0x39C, - SMSG_UPDATE_COMBO_POINTS = 0x39D, - SMSG_VOICE_SESSION_ROSTER_UPDATE = 0x39E, - SMSG_VOICE_SESSION_LEAVE = 0x39F, - SMSG_VOICE_SESSION_ADJUST_PRIORITY = 0x3A0, - CMSG_VOICE_SET_TALKER_MUTED_REQUEST = 0x3A1, - SMSG_VOICE_SET_TALKER_MUTED = 0x3A2, - SMSG_INIT_EXTRA_AURA_INFO_OBSOLETE = 0x3A3, - SMSG_SET_EXTRA_AURA_INFO_OBSOLETE = 0x3A4, - SMSG_SET_EXTRA_AURA_INFO_NEED_UPDATE_OBSOLETE = 0x3A5, - SMSG_CLEAR_EXTRA_AURA_INFO_OBSOLETE = 0x3A6, - MSG_MOVE_START_DESCEND = 0x3A7, - CMSG_IGNORE_REQUIREMENTS_CHEAT = 0x3A8, - SMSG_IGNORE_REQUIREMENTS_CHEAT = 0x3A9, - SMSG_SPELL_CHANCE_PROC_LOG = 0x3AA, - CMSG_MOVE_SET_RUN_SPEED = 0x3AB, - SMSG_DISMOUNT = 0x3AC, - MSG_MOVE_UPDATE_CAN_FLY = 0x3AD, - MSG_RAID_READY_CHECK_CONFIRM = 0x3AE, - CMSG_VOICE_SESSION_ENABLE = 0x3AF, - SMSG_VOICE_SESSION_ENABLE = 0x3B0, - SMSG_VOICE_PARENTAL_CONTROLS = 0x3B1, - CMSG_GM_WHISPER = 0x3B2, - SMSG_GM_MESSAGECHAT = 0x3B3, - MSG_GM_GEARRATING = 0x3B4, - CMSG_COMMENTATOR_ENABLE = 0x3B5, - SMSG_COMMENTATOR_STATE_CHANGED = 0x3B6, - CMSG_COMMENTATOR_GET_MAP_INFO = 0x3B7, - SMSG_COMMENTATOR_MAP_INFO = 0x3B8, - CMSG_COMMENTATOR_GET_PLAYER_INFO = 0x3B9, - SMSG_COMMENTATOR_GET_PLAYER_INFO = 0x3BA, - SMSG_COMMENTATOR_PLAYER_INFO = 0x3BB, - CMSG_COMMENTATOR_ENTER_INSTANCE = 0x3BC, - CMSG_COMMENTATOR_EXIT_INSTANCE = 0x3BD, - CMSG_COMMENTATOR_INSTANCE_COMMAND = 0x3BE, - SMSG_CLEAR_TARGET = 0x3BF, - CMSG_BOT_DETECTED = 0x3C0, - SMSG_CROSSED_INEBRIATION_THRESHOLD = 0x3C1, - CMSG_CHEAT_PLAYER_LOGIN = 0x3C2, - CMSG_CHEAT_PLAYER_LOOKUP = 0x3C3, - SMSG_CHEAT_PLAYER_LOOKUP = 0x3C4, - SMSG_KICK_REASON = 0x3C5, - MSG_RAID_READY_CHECK_FINISHED = 0x3C6, - CMSG_COMPLAIN = 0x3C7, - SMSG_COMPLAIN_RESULT = 0x3C8, - SMSG_FEATURE_SYSTEM_STATUS = 0x3C9, - CMSG_GM_SHOW_COMPLAINTS = 0x3CA, - CMSG_GM_UNSQUELCH = 0x3CB, - CMSG_CHANNEL_SILENCE_VOICE = 0x3CC, - CMSG_CHANNEL_SILENCE_ALL = 0x3CD, - CMSG_CHANNEL_UNSILENCE_VOICE = 0x3CE, - CMSG_CHANNEL_UNSILENCE_ALL = 0x3CF, - CMSG_TARGET_CAST = 0x3D0, - CMSG_TARGET_SCRIPT_CAST = 0x3D1, - CMSG_CHANNEL_DISPLAY_LIST = 0x3D2, - CMSG_SET_ACTIVE_VOICE_CHANNEL = 0x3D3, - CMSG_GET_CHANNEL_MEMBER_COUNT = 0x3D4, - SMSG_CHANNEL_MEMBER_COUNT = 0x3D5, - CMSG_CHANNEL_VOICE_ON = 0x3D6, - CMSG_CHANNEL_VOICE_OFF = 0x3D7, - CMSG_DEBUG_LIST_TARGETS = 0x3D8, - SMSG_DEBUG_LIST_TARGETS = 0x3D9, - SMSG_AVAILABLE_VOICE_CHANNEL = 0x3DA, - CMSG_ADD_VOICE_IGNORE = 0x3DB, - CMSG_DEL_VOICE_IGNORE = 0x3DC, - CMSG_PARTY_SILENCE = 0x3DD, - CMSG_PARTY_UNSILENCE = 0x3DE, - MSG_NOTIFY_PARTY_SQUELCH = 0x3DF, - SMSG_COMSAT_RECONNECT_TRY = 0x3E0, - SMSG_COMSAT_DISCONNECT = 0x3E1, - SMSG_COMSAT_CONNECT_FAIL = 0x3E2, - SMSG_VOICE_CHAT_STATUS = 0x3E3, - CMSG_REPORT_PVP_AFK = 0x3E4, - SMSG_REPORT_PVP_AFK_RESULT = 0x3E5, - CMSG_GUILD_BANKER_ACTIVATE = 0x3E6, - CMSG_GUILD_BANK_QUERY_TAB = 0x3E7, - SMSG_GUILD_BANK_LIST = 0x3E8, - CMSG_GUILD_BANK_SWAP_ITEMS = 0x3E9, - CMSG_GUILD_BANK_BUY_TAB = 0x3EA, - CMSG_GUILD_BANK_UPDATE_TAB = 0x3EB, - CMSG_GUILD_BANK_DEPOSIT_MONEY = 0x3EC, - CMSG_GUILD_BANK_WITHDRAW_MONEY = 0x3ED, - MSG_GUILD_BANK_LOG_QUERY = 0x3EE, - CMSG_SET_CHANNEL_WATCH = 0x3EF, - SMSG_USERLIST_ADD = 0x3F0, - SMSG_USERLIST_REMOVE = 0x3F1, - SMSG_USERLIST_UPDATE = 0x3F2, - CMSG_CLEAR_CHANNEL_WATCH = 0x3F3, - SMSG_INSPECT_TALENT = 0x3F4, - SMSG_GOGOGO_OBSOLETE = 0x3F5, - SMSG_ECHO_PARTY_SQUELCH = 0x3F6, - CMSG_SET_TITLE_SUFFIX = 0x3F7, - CMSG_SPELLCLICK = 0x3F8, - SMSG_LOOT_LIST = 0x3F9, - CMSG_GM_CHARACTER_RESTORE = 0x3FA, - CMSG_GM_CHARACTER_SAVE = 0x3FB, - SMSG_VOICESESSION_FULL = 0x3FC, - MSG_GUILD_PERMISSIONS = 0x3FD, - MSG_GUILD_BANK_MONEY_WITHDRAWN = 0x3FE, - MSG_GUILD_EVENT_LOG_QUERY = 0x3FF, - CMSG_MAELSTROM_RENAME_GUILD = 0x400, - CMSG_GET_MIRRORIMAGE_DATA = 0x401, - SMSG_MIRRORIMAGE_DATA = 0x402, - SMSG_FORCE_DISPLAY_UPDATE = 0x403, - SMSG_SPELL_CHANCE_RESIST_PUSHBACK = 0x404, - CMSG_IGNORE_DIMINISHING_RETURNS_CHEAT = 0x405, - SMSG_IGNORE_DIMINISHING_RETURNS_CHEAT = 0x406, - CMSG_KEEP_ALIVE = 0x407, - SMSG_RAID_READY_CHECK_ERROR = 0x408, - CMSG_OPT_OUT_OF_LOOT = 0x409, - MSG_QUERY_GUILD_BANK_TEXT = 0x40A, - CMSG_SET_GUILD_BANK_TEXT = 0x40B, - CMSG_SET_GRANTABLE_LEVELS = 0x40C, - CMSG_GRANT_LEVEL = 0x40D, - CMSG_REFER_A_FRIEND = 0x40E, - MSG_GM_CHANGE_ARENA_RATING = 0x40F, - CMSG_DECLINE_CHANNEL_INVITE = 0x410, - SMSG_GROUPACTION_THROTTLED = 0x411, - SMSG_OVERRIDE_LIGHT = 0x412, // uint32 defaultMapLight, uint32 overrideLight, uint32 transitionTimeMs - SMSG_TOTEM_CREATED = 0x413, - CMSG_TOTEM_DESTROYED = 0x414, - CMSG_EXPIRE_RAID_INSTANCE = 0x415, - CMSG_NO_SPELL_VARIANCE = 0x416, - CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY = 0x417, - SMSG_QUESTGIVER_STATUS_MULTIPLE = 0x418, - CMSG_SET_PLAYER_DECLINED_NAMES = 0x419, - SMSG_SET_PLAYER_DECLINED_NAMES_RESULT = 0x41A, - CMSG_QUERY_SERVER_BUCK_DATA = 0x41B, - CMSG_CLEAR_SERVER_BUCK_DATA = 0x41C, - SMSG_SERVER_BUCK_DATA = 0x41D, - SMSG_SEND_UNLEARN_SPELLS = 0x41E, - SMSG_PROPOSE_LEVEL_GRANT = 0x41F, - CMSG_ACCEPT_LEVEL_GRANT = 0x420, - SMSG_REFER_A_FRIEND_FAILURE = 0x421, - SMSG_SPLINE_MOVE_SET_FLYING = 0x422, - SMSG_SPLINE_MOVE_UNSET_FLYING = 0x423, - SMSG_SUMMON_CANCEL = 0x424, - CMSG_CHANGE_PERSONAL_ARENA_RATING = 0x425, - CMSG_ALTER_APPEARANCE = 0x426, - SMSG_ENABLE_BARBER_SHOP = 0x427, - SMSG_BARBER_SHOP_RESULT = 0x428, - CMSG_CALENDAR_GET_CALENDAR = 0x429, - CMSG_CALENDAR_GET_EVENT = 0x42A, - CMSG_CALENDAR_GUILD_FILTER = 0x42B, - CMSG_CALENDAR_ARENA_TEAM = 0x42C, - CMSG_CALENDAR_ADD_EVENT = 0x42D, - CMSG_CALENDAR_UPDATE_EVENT = 0x42E, - CMSG_CALENDAR_REMOVE_EVENT = 0x42F, - CMSG_CALENDAR_COPY_EVENT = 0x430, - CMSG_CALENDAR_EVENT_INVITE = 0x431, - CMSG_CALENDAR_EVENT_RSVP = 0x432, - CMSG_CALENDAR_EVENT_REMOVE_INVITE = 0x433, - CMSG_CALENDAR_EVENT_STATUS = 0x434, - CMSG_CALENDAR_EVENT_MODERATOR_STATUS = 0x435, - SMSG_CALENDAR_SEND_CALENDAR = 0x436, - SMSG_CALENDAR_SEND_EVENT = 0x437, - SMSG_CALENDAR_FILTER_GUILD = 0x438, - SMSG_CALENDAR_ARENA_TEAM = 0x439, - SMSG_CALENDAR_EVENT_INVITE = 0x43A, - SMSG_CALENDAR_EVENT_INVITE_REMOVED = 0x43B, - SMSG_CALENDAR_EVENT_STATUS = 0x43C, - SMSG_CALENDAR_COMMAND_RESULT = 0x43D, - SMSG_CALENDAR_RAID_LOCKOUT_ADDED = 0x43E, - SMSG_CALENDAR_RAID_LOCKOUT_REMOVED = 0x43F, - SMSG_CALENDAR_EVENT_INVITE_ALERT = 0x440, - SMSG_CALENDAR_EVENT_INVITE_REMOVED_ALERT = 0x441, - SMSG_CALENDAR_EVENT_INVITE_STATUS_ALERT = 0x442, - SMSG_CALENDAR_EVENT_REMOVED_ALERT = 0x443, - SMSG_CALENDAR_EVENT_UPDATED_ALERT = 0x444, - SMSG_CALENDAR_EVENT_MODERATOR_STATUS_ALERT = 0x445, - CMSG_CALENDAR_COMPLAIN = 0x446, - CMSG_CALENDAR_GET_NUM_PENDING = 0x447, - SMSG_CALENDAR_SEND_NUM_PENDING = 0x448, - CMSG_SAVE_DANCE = 0x449, - SMSG_NOTIFY_DANCE = 0x44A, - CMSG_PLAY_DANCE = 0x44B, - SMSG_PLAY_DANCE = 0x44C, - CMSG_LOAD_DANCES = 0x44D, - CMSG_STOP_DANCE = 0x44E, - SMSG_STOP_DANCE = 0x44F, - CMSG_SYNC_DANCE = 0x450, - CMSG_DANCE_QUERY = 0x451, - SMSG_DANCE_QUERY_RESPONSE = 0x452, - SMSG_INVALIDATE_DANCE = 0x453, - CMSG_DELETE_DANCE = 0x454, - SMSG_LEARNED_DANCE_MOVES = 0x455, - CMSG_LEARN_DANCE_MOVE = 0x456, - CMSG_UNLEARN_DANCE_MOVE = 0x457, - CMSG_SET_RUNE_COUNT = 0x458, - CMSG_SET_RUNE_COOLDOWN = 0x459, - MSG_MOVE_SET_PITCH_RATE_CHEAT = 0x45A, - MSG_MOVE_SET_PITCH_RATE = 0x45B, - SMSG_FORCE_PITCH_RATE_CHANGE = 0x45C, - CMSG_FORCE_PITCH_RATE_CHANGE_ACK = 0x45D, - SMSG_SPLINE_SET_PITCH_RATE = 0x45E, - CMSG_CALENDAR_EVENT_INVITE_NOTES = 0x45F, - SMSG_CALENDAR_EVENT_INVITE_NOTES = 0x460, - SMSG_CALENDAR_EVENT_INVITE_NOTES_ALERT = 0x461, - CMSG_UPDATE_MISSILE_TRAJECTORY = 0x462, - SMSG_UPDATE_ACCOUNT_DATA_COMPLETE = 0x463, - SMSG_TRIGGER_MOVIE = 0x464, - CMSG_COMPLETE_MOVIE = 0x465, - CMSG_SET_GLYPH_SLOT = 0x466, - CMSG_SET_GLYPH = 0x467, - SMSG_ACHIEVEMENT_EARNED = 0x468, - SMSG_DYNAMIC_DROP_ROLL_RESULT = 0x469, - SMSG_CRITERIA_UPDATE = 0x46A, - CMSG_QUERY_INSPECT_ACHIEVEMENTS = 0x46B, - SMSG_RESPOND_INSPECT_ACHIEVEMENTS = 0x46C, - CMSG_DISMISS_CONTROLLED_VEHICLE = 0x46D, - CMSG_COMPLETE_ACHIEVEMENT_CHEAT = 0x46E, - SMSG_QUESTUPDATE_ADD_PVP_KILL = 0x46F, - CMSG_SET_CRITERIA_CHEAT = 0x470, - SMSG_CALENDAR_RAID_LOCKOUT_UPDATED = 0x471, - CMSG_UNITANIMTIER_CHEAT = 0x472, - CMSG_CHAR_CUSTOMIZE = 0x473, - SMSG_CHAR_CUSTOMIZE = 0x474, - SMSG_PET_RENAMEABLE = 0x475, - CMSG_REQUEST_VEHICLE_EXIT = 0x476, - CMSG_REQUEST_VEHICLE_PREV_SEAT = 0x477, - CMSG_REQUEST_VEHICLE_NEXT_SEAT = 0x478, - CMSG_REQUEST_VEHICLE_SWITCH_SEAT = 0x479, - CMSG_PET_LEARN_TALENT = 0x47A, - CMSG_PET_UNLEARN_TALENTS = 0x47B, - SMSG_SET_PHASE_SHIFT = 0x47C, - SMSG_ALL_ACHIEVEMENT_DATA = 0x47D, - CMSG_FORCE_SAY_CHEAT = 0x47E, - SMSG_HEALTH_UPDATE = 0x47F, - SMSG_POWER_UPDATE = 0x480, - CMSG_GAMEOBJ_REPORT_USE = 0x481, - SMSG_HIGHEST_THREAT_UPDATE = 0x482, - SMSG_THREAT_UPDATE = 0x483, - SMSG_THREAT_REMOVE = 0x484, - SMSG_THREAT_CLEAR = 0x485, - SMSG_CONVERT_RUNE = 0x486, - SMSG_RESYNC_RUNES = 0x487, - SMSG_ADD_RUNE_POWER = 0x488, - CMSG_START_QUEST = 0x489, - CMSG_REMOVE_GLYPH = 0x48A, - CMSG_DUMP_OBJECTS = 0x48B, - SMSG_DUMP_OBJECTS_DATA = 0x48C, - CMSG_DISMISS_CRITTER = 0x48D, - SMSG_NOTIFY_DEST_LOC_SPELL_CAST = 0x48E, - CMSG_AUCTION_LIST_PENDING_SALES = 0x48F, - SMSG_AUCTION_LIST_PENDING_SALES = 0x490, - SMSG_MODIFY_COOLDOWN = 0x491, - SMSG_PET_UPDATE_COMBO_POINTS = 0x492, - CMSG_ENABLETAXI = 0x493, - SMSG_PRE_RESURRECT = 0x494, - SMSG_AURA_UPDATE_ALL = 0x495, - SMSG_AURA_UPDATE = 0x496, - CMSG_FLOOD_GRACE_CHEAT = 0x497, - SMSG_SERVER_FIRST_ACHIEVEMENT = 0x498, - SMSG_PET_LEARNED_SPELL = 0x499, - SMSG_PET_REMOVED_SPELL = 0x49A, - CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE = 0x49B, - CMSG_HEARTH_AND_RESURRECT = 0x49C, - SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA = 0x49D, - SMSG_CRITERIA_DELETED = 0x49E, - SMSG_ACHIEVEMENT_DELETED = 0x49F, - CMSG_SERVER_INFO_QUERY = 0x4A0, - SMSG_SERVER_INFO_RESPONSE = 0x4A1, - CMSG_CHECK_LOGIN_CRITERIA = 0x4A2, - SMSG_SERVER_BUCK_DATA_START = 0x4A3, - CMSG_SET_BREATH = 0x4A4, - CMSG_QUERY_VEHICLE_STATUS = 0x4A5, - SMSG_BATTLEGROUND_INFO_THROTTLED = 0x4A6, // empty, "You can't do that yet" - SMSG_PLAYER_VEHICLE_DATA = 0x4A7, // guid+uint32 (vehicle) - CMSG_PLAYER_VEHICLE_ENTER = 0x4A8, // uint64 - CMSG_CONTROLLER_EJECT_PASSENGER = 0x4A9, // uint64 - SMSG_PET_GUIDS = 0x4AA, - SMSG_CLIENTCACHE_VERSION = 0x4AB, - CMSG_CHANGE_GDF_ARENA_RATING = 0x4AC, - CMSG_SET_ARENA_TEAM_RATING_BY_INDEX = 0x4AD, - CMSG_SET_ARENA_TEAM_WEEKLY_GAMES = 0x4AE, - CMSG_SET_ARENA_TEAM_SEASON_GAMES = 0x4AF, - CMSG_SET_ARENA_MEMBER_WEEKLY_GAMES = 0x4B0, - CMSG_SET_ARENA_MEMBER_SEASON_GAMES = 0x4B1, - SMSG_ITEM_REFUND_INFO_RESPONSE = 0x4B2, - CMSG_ITEM_REFUND_INFO = 0x4B3, - CMSG_ITEM_REFUND = 0x4B4, // lua: ContainerRefundItemPurchase - SMSG_ITEM_REFUND_RESULT = 0x4B5, - CMSG_CORPSE_MAP_POSITION_QUERY = 0x4B6, // uint32 - SMSG_CORPSE_MAP_POSITION_QUERY_RESPONSE = 0x4B7, // 3*float+float - CMSG_UNUSED5 = 0x4B8, - CMSG_UNUSED6 = 0x4B9, - CMSG_CALENDAR_EVENT_SIGNUP = 0x4BA, // uint64 - SMSG_CALENDAR_CLEAR_PENDING_ACTION = 0x4BB, - SMSG_EQUIPMENT_SET_LIST = 0x4BC, // equipment manager list? - CMSG_EQUIPMENT_SET_SAVE = 0x4BD, - CMSG_UPDATE_PROJECTILE_POSITION = 0x4BE, // uint64 caster, uint32 spellId, uint8 castId, vector3 position - SMSG_SET_PROJECTILE_POSITION = 0x4BF, // uint64 caster, uint8 castId, vector3 position - SMSG_TALENTS_INFO = 0x4C0, - CMSG_LEARN_PREVIEW_TALENTS = 0x4C1, - CMSG_LEARN_PREVIEW_TALENTS_PET = 0x4C2, - CMSG_SET_ACTIVE_TALENT_GROUP_OBSOLETE = 0x4C3, - CMSG_GM_GRANT_ACHIEVEMENT = 0x4C4, - CMSG_GM_REMOVE_ACHIEVEMENT = 0x4C5, - CMSG_GM_SET_CRITERIA_FOR_PLAYER = 0x4C6, - SMSG_ARENA_OPPONENT_UPDATE = 0x4C7, // uint64 - SMSG_ARENA_TEAM_CHANGE_FAILED_QUEUED = 0x4C8, // uint32 "Can't modify arena team while queued or in a match." - CMSG_PROFILEDATA_REQUEST = 0x4C9, - SMSG_PROFILEDATA_RESPONSE = 0x4CA, - CMSG_START_BATTLEFIELD_CHEAT = 0x4CB, - CMSG_END_BATTLEFIELD_CHEAT = 0x4CC, - SMSG_MULTIPLE_PACKETS = 0x4CD, - SMSG_MOVE_GRAVITY_DISABLE = 0x4CE, - CMSG_MOVE_GRAVITY_DISABLE_ACK = 0x4CF, - SMSG_MOVE_GRAVITY_ENABLE = 0x4D0, - CMSG_MOVE_GRAVITY_ENABLE_ACK = 0x4D1, - MSG_MOVE_GRAVITY_CHNG = 0x4D2, - SMSG_SPLINE_MOVE_GRAVITY_DISABLE = 0x4D3, - SMSG_SPLINE_MOVE_GRAVITY_ENABLE = 0x4D4, - CMSG_EQUIPMENT_SET_USE = 0x4D5, - SMSG_EQUIPMENT_SET_USE_RESULT = 0x4D6, - CMSG_FORCE_ANIM = 0x4D7, - SMSG_FORCE_ANIM = 0x4D8, - CMSG_CHAR_FACTION_CHANGE = 0x4D9, - SMSG_CHAR_FACTION_CHANGE = 0x4DA, - CMSG_PVP_QUEUE_STATS_REQUEST = 0x4DB, - SMSG_PVP_QUEUE_STATS = 0x4DC, - CMSG_SET_PAID_SERVICE_CHEAT = 0x4DD, - SMSG_BATTLEFIELD_MGR_ENTRY_INVITE = 0x4DE, // uint32 - CMSG_BATTLEFIELD_MGR_ENTRY_INVITE_RESPONSE = 0x4DF, - SMSG_BATTLEFIELD_MGR_ENTERED = 0x4E0, // uint32, uint8, uint8 - SMSG_BATTLEFIELD_MGR_QUEUE_INVITE = 0x4E1, // uint32 - CMSG_BATTLEFIELD_MGR_QUEUE_INVITE_RESPONSE = 0x4E2, - CMSG_BATTLEFIELD_MGR_QUEUE_REQUEST = 0x4E3, - SMSG_BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE = 0x4E4, // uint32, uint8 - SMSG_BATTLEFIELD_MGR_EJECT_PENDING = 0x4E5, // uint32 - SMSG_BATTLEFIELD_MGR_EJECTED = 0x4E6, // uint32, uint32, uint8 - CMSG_BATTLEFIELD_MGR_EXIT_REQUEST = 0x4E7, - SMSG_BATTLEFIELD_MGR_STATE_CHANGE = 0x4E8, // uint32, uint32 - CMSG_BATTLEFIELD_MANAGER_ADVANCE_STATE = 0x4E9, - CMSG_BATTLEFIELD_MANAGER_SET_NEXT_TRANSITION_TIME= 0x4EA, - MSG_SET_RAID_DIFFICULTY = 0x4EB, - CMSG_TOGGLE_XP_GAIN = 0x4EC, - SMSG_TOGGLE_XP_GAIN = 0x4ED, // enable/disable XP gain console message - SMSG_GMRESPONSE_DB_ERROR = 0x4EE, // empty - SMSG_GMRESPONSE_RECEIVED = 0x4EF, // uint32, uint32, string[2000], string[4000][4] - CMSG_GMRESPONSE_RESOLVE = 0x4F0, - SMSG_GMRESPONSE_STATUS_UPDATE = 0x4F1, // uint8 (1 - EVENT_GMSURVEY_DISPLAY, 0 - EVENT_UPDATE_TICKET) - SMSG_GMRESPONSE_CREATE_TICKET = 0x4F2, - CMSG_GMRESPONSE_CREATE_TICKET = 0x4F3, - CMSG_SERVERINFO = 0x4F4, - SMSG_SERVERINFO = 0x4F5, - CMSG_WORLD_STATE_UI_TIMER_UPDATE = 0x4F6, - SMSG_WORLD_STATE_UI_TIMER_UPDATE = 0x4F7, - CMSG_CHAR_RACE_CHANGE = 0x4F8, - MSG_VIEW_PHASE_SHIFT = 0x4F9, - SMSG_TALENTS_INVOLUNTARILY_RESET = 0x4FA, // uint8 - CMSG_DEBUG_SERVER_GEO = 0x4FB, - SMSG_DEBUG_SERVER_GEO = 0x4FC, - SMSG_LOOT_SLOT_CHANGED = 0x4FD, - UMSG_UPDATE_GROUP_INFO = 0x4FE, - CMSG_READY_FOR_ACCOUNT_DATA_TIMES = 0x4FF, - CMSG_QUERY_QUESTS_COMPLETED = 0x500, - SMSG_QUERY_QUESTS_COMPLETED_RESPONSE = 0x501, - CMSG_GM_REPORT_LAG = 0x502, - CMSG_AFK_MONITOR_INFO_REQUEST = 0x503, - SMSG_AFK_MONITOR_INFO_RESPONSE = 0x504, - CMSG_AFK_MONITOR_INFO_CLEAR = 0x505, - SMSG_CORPSE_NOT_IN_INSTANCE = 0x506, - CMSG_GM_NUKE_CHARACTER = 0x507, - CMSG_SET_ALLOW_LOW_LEVEL_RAID1 = 0x508, - CMSG_SET_ALLOW_LOW_LEVEL_RAID2 = 0x509, - SMSG_CAMERA_SHAKE = 0x50A, // uint32 SpellEffectCameraShakes.dbc index, uint32 - SMSG_UPDATE_ITEM_ENCHANTMENTS = 0x50B, // some item update packet? - CMSG_SET_CHARACTER_MODEL = 0x50C, - SMSG_REDIRECT_CLIENT = 0x50D, // uint32 ip, uint16 port, uint32 unk, uint8[20] hash (ip + port, seed=sessionkey) - CMSG_REDIRECTION_FAILED = 0x50E, // something with networking - SMSG_SUSPEND_COMMS = 0x50F, - CMSG_SUSPEND_COMMS_ACK = 0x510, - SMSG_FORCE_SEND_QUEUED_PACKETS = 0x511, - CMSG_REDIRECTION_AUTH_PROOF = 0x512, - CMSG_DROP_NEW_CONNECTION = 0x513, - SMSG_SEND_ALL_COMBAT_LOG = 0x514, - SMSG_OPEN_LFG_DUNGEON_FINDER = 0x515, - SMSG_MOVE_SET_COLLISION_HGT = 0x516, - CMSG_MOVE_SET_COLLISION_HGT_ACK = 0x517, - MSG_MOVE_SET_COLLISION_HGT = 0x518, - CMSG_CLEAR_RANDOM_BG_WIN_TIME = 0x519, - CMSG_CLEAR_HOLIDAY_BG_WIN_TIME = 0x51A, - CMSG_COMMENTATOR_SKIRMISH_QUEUE_COMMAND = 0x51B, - SMSG_COMMENTATOR_SKIRMISH_QUEUE_RESULT1 = 0x51C, - SMSG_COMMENTATOR_SKIRMISH_QUEUE_RESULT2 = 0x51D, - SMSG_COMPRESSED_UNKNOWN_1310 = 0x51E, // some compressed packet? - NUM_MSG_TYPES = 0x51F + NUM_OPCODE_HANDLERS = (0xFFFF+1), + UNKNOWN_OPCODE = NUM_OPCODE_HANDLERS, + + CMSG_ACCEPT_LEVEL_GRANT = 0xDC4B, // 14545 + CMSG_ACCEPT_TRADE = 0x00, // + CMSG_ACTIVATETAXI = 0x00, // + CMSG_ACTIVATETAXIEXPRESS = 0x00, // + CMSG_ADD_FRIEND = 0x5C57, // 14545 + CMSG_ADD_IGNORE = 0xCEEA, // 14545 + CMSG_ADD_VOICE_IGNORE = 0xA7A, // 14545 + CMSG_ALTER_APPEARANCE = 0x00, // + CMSG_AREATRIGGER = 0x5862, // 14545 + CMSG_AREA_SPIRIT_HEALER_QUERY = 0xDC7E, // 14545 + CMSG_AREA_SPIRIT_HEALER_QUEUE = 0x00, // + CMSG_ARENA_TEAM_ACCEPT = 0x00, // + CMSG_ARENA_TEAM_DECLINE = 0x00, // + CMSG_ARENA_TEAM_DISBAND = 0x4A5A, // 14545 + CMSG_ARENA_TEAM_INVITE = 0x4862, // 14545 + CMSG_ARENA_TEAM_LEADER = 0x8F3, // 14545 + CMSG_ARENA_TEAM_LEAVE = 0x48EB, // 14545 + CMSG_ARENA_TEAM_QUERY = 0x872, // 14545 + CMSG_ARENA_TEAM_REMOVE = 0xCE5E, // 14545 + CMSG_ARENA_TEAM_ROSTER = 0x00, // + CMSG_ATTACKSTOP = 0x00, // + CMSG_ATTACKSWING = 0x00, // + CMSG_AUCTION_LIST_BIDDER_ITEMS = 0x00, // + CMSG_AUCTION_LIST_ITEMS = 0xDC5F, // 14545 + CMSG_AUCTION_LIST_OWNER_ITEMS = 0x00, // + CMSG_AUCTION_PLACE_BID = 0x8E76, // 14545 + CMSG_AUCTION_REMOVE_ITEM = 0xCEC3, // 14545 + CMSG_AUCTION_SELL_ITEM = 0xCE6, // 14545 + CMSG_AUTH_SESSION = 0x1019, // 14545 + CMSG_AUTOEQUIP_GROUND_ITEM = 0x00, // + CMSG_AUTOEQUIP_ITEM = 0x8E66, // 14545 + CMSG_AUTOEQUIP_ITEM_SLOT = 0x00, // + CMSG_AUTO_DECLINE_GUILD_INVITES = 0x586F, // 14545 + CMSG_AUTOSTORE_BAG_ITEM = 0x00, // + CMSG_AUTOSTORE_GROUND_ITEM = 0x00, // + CMSG_AUTOSTORE_LOOT_ITEM = 0x00, // + CMSG_BANKER_ACTIVATE = 0x00, // + CMSG_BATTLEFIELD_JOIN = 0x00, // + CMSG_BATTLEFIELD_REQUEST_SCORE_DATA = 0x00, // + CMSG_BATTLEFIELD_STATUS = 0x00, // + MSG_BATTLEGROUND_PLAYER_POSITIONS = 0x00, // + CMSG_BATTLEMASTER_JOIN_ARENA = 0x00, // + CMSG_BEGIN_TRADE = 0x00, // + CMSG_BINDER_ACTIVATE = 0x00, // + CMSG_BOT_DETECTED2 = 0x00, // + CMSG_BUG = 0x1A77, // 14545 + CMSG_BUSY_TRADE = 0x00, // + CMSG_BUYBACK_ITEM = 0xDEE6, // 14545 + CMSG_BUY_BANK_SLOT = 0x487F, // 14545 + CMSG_BUY_ITEM = 0x00, // + CMSG_CALENDAR_ADD_EVENT = 0x1CF3, // 14545 + CMSG_CALENDAR_ARENA_TEAM = 0x00, // + CMSG_CALENDAR_CONTEXT_EVENT_SIGNUP = 0x00, // + CMSG_CALENDAR_COPY_EVENT = 0x00, // + CMSG_CALENDAR_EVENT_INVITE = 0x1EDA, // 14545 + CMSG_CALENDAR_EVENT_MODERATOR_STATUS = 0x00, // + CMSG_CALENDAR_EVENT_REMOVE_INVITE = 0x00, // + CMSG_CALENDAR_EVENT_STATUS = 0x00, // + CMSG_CALENDAR_GET_EVENT = 0x00, // + CMSG_CALENDAR_GET_NUM_PENDING = 0x00, // + CMSG_CALENDAR_GUILD_FILTER = 0x00, // + CMSG_CALENDAR_REMOVE_EVENT = 0x00, // + CMSG_CALENDAR_UPDATE_EVENT = 0x5CD2, // 14545 + CMSG_CANCEL_AURA = 0x00, // + CMSG_CANCEL_AUTO_REPEAT_SPELL = 0x5CEE, // 14545 + CMSG_CANCEL_CAST = 0x00, // + CMSG_CANCEL_CHANNELLING = 0xC8FE, // 14545 + CMSG_CANCEL_GROWTH_AURA = 0xDEF7, // 14545 + CMSG_CANCEL_MOUNT_AURA = 0x00, // + CMSG_CANCEL_TEMP_ENCHANTMENT = 0x00, // + CMSG_CANCEL_TRADE = 0x35A5, // 14545 + CMSG_CAST_SPELL = 0x00, // + CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE = 0x00, // + CMSG_CHANNEL_ANNOUNCEMENTS = 0x00, // + CMSG_CHANNEL_BAN = 0x00, // + CMSG_CHANNEL_DISPLAY_LIST = 0x00, // + CMSG_CHANNEL_INVITE = 0x00, // + CMSG_CHANNEL_KICK = 0x00, // + CMSG_CHANNEL_LIST = 0x00, // + CMSG_CHANNEL_MODERATOR = 0x00, // + CMSG_CHANNEL_MUTE = 0x00, // + CMSG_CHANNEL_OWNER = 0x00, // + CMSG_CHANNEL_PASSWORD = 0x00, // + CMSG_CHANNEL_ROSTER_INFO = 0x00, // + CMSG_CHANNEL_SET_OWNER = 0x00, // + CMSG_CHANNEL_UNBAN = 0x00, // + CMSG_CHANNEL_UNMODERATOR = 0x00, // + CMSG_CHANNEL_UNMUTE = 0x00, // + CMSG_CHAR_CREATE = 0x1AC6, // 14545 + CMSG_CHAR_CUSTOMIZE = 0xDECF, // 14545 + CMSG_CHAR_DELETE = 0x1ED3, // 14545 + CMSG_CHAR_ENUM = 0x4A8B, // 14545 + CMSG_CHAR_FACTION_CHANGE = 0xCCEE, // 14545 + CMSG_CHAR_RACE_CHANGE = 0xDC57, // 14545 + CMSG_CHAR_RENAME = 0x5E6F, // 14545 + CMSG_CLEAR_CHANNEL_WATCH = 0x9CC2, // 14545 + CMSG_CLEAR_TRADE_ITEM = 0x00, // + CMSG_COMMENTATOR_ENABLE = 0x1CF7, // 14545 + CMSG_COMMENTATOR_ENTER_INSTANCE = 0x8EF6, // 14545 + CMSG_COMMENTATOR_EXIT_INSTANCE = 0x4C7B, // 14545 + CMSG_COMMENTATOR_GET_MAP_INFO = 0xDEE7, // 14545 + CMSG_COMMENTATOR_GET_PLAYER_INFO = 0x9EF3, // 14545 + CMSG_COMMENTATOR_INSTANCE_COMMAND = 0x5CEB, // 14545 + CMSG_COMMENTATOR_SKIRMISH_QUEUE_COMMAND = 0x9C4E, // 14545 + CMSG_COMMENTATOR_START_WARGAME = 0x00, // + CMSG_COMPLAIN = 0x00, // + CMSG_COMPLETE_CINEMATIC = 0x1A6F, // 14545 + CMSG_COMPLETE_MOVIE = 0x00, // + CMSG_CONTACT_LIST = 0xCECF, // 14545 + CMSG_CORPSE_MAP_POSITION_QUERY = 0xDC7F, // 14545 + CMSG_CREATURE_QUERY = 0x5A7E, // 14545 + CMSG_DANCE_QUERY = 0x5C5E, // 14545 + CMSG_DECLINE_CHANNEL_INVITE = 0x00, // + CMSG_DEL_FRIEND = 0xC852, // 14545 + CMSG_DEL_IGNORE = 0x8ADA, // 14545 + CMSG_DEL_VOICE_IGNORE = 0x8C73, // 14545 + CMSG_DESTROYITEM = 0x4E7A, // 14545 + CMSG_DESTROY_ITEMS = 0x00, // + CMSG_DUEL_ACCEPTED = 0x00, // + CMSG_DUEL_CANCELLED = 0x00, // + CMSG_EJECT_PASSENGER = 0x00, // + CMSG_EQUIPMENT_SET_DELETE = 0x00, // + CMSG_EQUIPMENT_SET_SAVE = 0x00, // + CMSG_EQUIPMENT_SET_USE = 0x4853, // 14545 + CMSG_EMOTE = 0x9843, // 14545 + CMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK = 0x00, // + CMSG_FORCE_FLIGHT_SPEED_CHANGE_ACK = 0x00, // + CMSG_FORCE_MOVE_ROOT_ACK = 0x00, // + CMSG_FORCE_MOVE_UNROOT_ACK = 0x00, // + CMSG_FORCE_PITCH_RATE_CHANGE_ACK = 0x00, // + CMSG_FORCE_RUN_BACK_SPEED_CHANGE_ACK = 0x00, // + CMSG_FORCE_RUN_SPEED_CHANGE_ACK = 0x00, // + CMSG_FORCE_SWIM_BACK_SPEED_CHANGE_ACK = 0x00, // + CMSG_FORCE_SWIM_SPEED_CHANGE_ACK = 0x00, // + CMSG_FORCE_TURN_RATE_CHANGE_ACK = 0x00, // + CMSG_FORCE_WALK_SPEED_CHANGE_ACK = 0x00, // + CMSG_GAMEOBJECT_QUERY = 0xCEFF, // 14545 + CMSG_GAMEOBJ_REPORT_USE = 0x00, // + CMSG_GAMEOBJ_USE = 0x00, // + CMSG_GAMESPEED_SET = 0x00, // + CMSG_GAMETIME_SET = 0x00, // + CMSG_GET_MAIL_LIST = 0xB284, // 14545 + CMSG_GET_MIRRORIMAGE_DATA = 0xDAF3, // 14545 + CMSG_GETDEATHBINDZONE = 0x00, // + CMSG_GHOST = 0x00, // + CMSG_GM_INVIS = 0x00, // + CMSG_GMRESPONSE_RESOLVE = 0x00, // + CMSG_GMSURVEY_SUBMIT = 0x00, // + CMSG_GMTICKET_CREATE = 0x00, // + CMSG_GMTICKET_DELETETICKET = 0x00, // + CMSG_GMTICKET_GETTICKET = 0x00, // + CMSG_GMTICKET_SYSTEMSTATUS = 0x4A7A, // 14545 + CMSG_GMTICKET_UPDATETEXT = 0x8A7B, // 14545 + CMSG_GM_NUKE = 0x00, // + CMSG_GM_SET_SECURITY_GROUP = 0x00, // + CMSG_GM_REPORT_LAG = 0x00, // + CMSG_GOSSIP_HELLO = 0xAD3, // 14545 + CMSG_GOSSIP_SELECT_OPTION = 0x984E, // 14545 + CMSG_GRANT_LEVEL = 0x1CD6, // 14545 + CMSG_GROUP_ACCEPT = 0x00, // + CMSG_GROUP_ASSISTANT_LEADER = 0xC8CA, // 14545 + CMSG_GROUP_CANCEL = 0x00, // + CMSG_GROUP_CHANGE_SUB_GROUP = 0x1AD2, // 14545 + CMSG_GROUP_DECLINE = 0x00, // + CMSG_GROUP_DISBAND = 0x00, // + CMSG_GROUP_INVITE = 0x00, // + CMSG_GROUP_RAID_CONVERT = 0xC85A, // 14545 + CMSG_GROUP_SET_LEADER = 0xCEC7, // 14545 + CMSG_GROUP_SWAP_SUB_GROUP = 0x5AD7, // 14545 + CMSG_GROUP_UNINVITE = 0x00, // + CMSG_GROUP_UNINVITE_GUID = 0x00, // + CMSG_GUILD_ACCEPT = 0x00, // + CMSG_GUILD_BANKER_ACTIVATE = 0x4E77, // 14545 + CMSG_GUILD_BANK_BUY_TAB = 0x00, // + CMSG_GUILD_BANK_DEPOSIT_MONEY = 0x00, // + CMSG_GUILD_BANK_NOTE = 0x00, // + CMSG_GUILD_BANK_QUERY_TAB = 0xDE46, // 14545 + CMSG_GUILD_BANK_SWAP_ITEMS = 0x85B, // 14545 + CMSG_GUILD_BANK_UPDATE_TAB = 0x00, // + CMSG_GUILD_BANK_WITHDRAW_MONEY = 0x00, // + CMSG_GUILD_CREATE = 0x00, // + CMSG_GUILD_DECLINE = 0x00, // + CMSG_GUILD_DEMOTE = 0x00, // + CMSG_GUILD_DISBAND = 0x00, // + CMSG_GUILD_INFO = 0xCE76, // 14545 + CMSG_GUILD_INVITE = 0x00, // + CMSG_GUILD_PROMOTE = 0x00, // + CMSG_GUILD_QUERY = 0x00, // + CMSG_GUILD_LEADER = 0x00, // + CMSG_GUILD_LEAVE = 0x00, // + CMSG_GUILD_MOTD = 0x00, // + CMSG_GUILD_REMOVE = 0x00, // + CMSG_GUILD_ROSTER = 0x00, // + CMSG_HEARTH_AND_RESURRECT = 0x00, // + CMSG_IGNORE_TRADE = 0x00, // + CMSG_INITIATE_TRADE = 0x00, // + CMSG_INSPECT = 0x9A7B, // 14545 + CMSG_INSTANCE_LOCK_WARNING_RESPONSE = 0x8CF7, // 14545 + CMSG_ITEM_QUERY_SINGLE = 0x8E2, // 14545 + CMSG_ITEM_QUERY_MULTIPLE = 0x00, // + CMSG_ITEM_REFUND = 0xCC3, // 14545 + CMSG_ITEM_REFUND_INFO = 0x1C7E, // 14545 + CMSG_ITEM_TEXT_QUERY = 0x4AEB, // 14545 + CMSG_JOIN_CHANNEL = 0x3441, // 14545 + CMSG_KEEP_ALIVE = 0xC87A, // 14545 + CMSG_LEARN_PREVIEW_TALENTS = 0xDEE3, // 14545 + CMSG_LEARN_PREVIEW_TALENTS_PET = 0x9AFB, // 14545 + CMSG_LEARN_TALENT = 0x98F3, // 14545 + CMSG_LEAVE_BATTLEFIELD = 0x1AE7, // 14545 + CMSG_LEAVE_CHANNEL = 0x00, // + CMSG_LFD_PARTY_LOCK_INFO_REQUEST = 0x00, // + CMSG_LFG_GET_PLAYER_INFO = 0x00, // + CMSG_LFG_JOIN = 0x00, // + CMSG_LFG_LEAVE = 0x00, // + CMSG_LFG_PROPOSAL_RESULT = 0x00, // + SMSG_LFG_BOOT_PLAYER = 0x00, // + CMSG_LFG_SET_ROLES = 0x4843, // 14545 + CMSG_LFG_TELEPORT = 0x8C7A, // 14545 + CMSG_LIST_INVENTORY = 0xDCFE, // 14545 + CMSG_LOG_DISCONNECT = 0x00, // + CMSG_LOGOUT_CANCEL = 0xA76, // 14545 + CMSG_LOGOUT_REQUEST = 0x4C7A, // 14545 + CMSG_LOOT = 0x00, // + CMSG_LOOT_METHOD = 0x00, // + CMSG_LOOT_MONEY = 0x00, // + CMSG_LOOT_RELEASE = 0x4A6A, // 14545 + CMSG_LOOT_ROLL = 0x00, // + CMSG_MAIL_CREATE_TEXT_ITEM = 0x886E, // 14545 + CMSG_MAIL_DELETE = 0x4CCF, // 14545 + CMSG_MAIL_MARK_AS_READ = 0x00, // + CMSG_MAIL_RETURN_TO_SENDER = 0x587E, // 14545 + CMSG_MAIL_TAKE_ITEM = 0xCC2, // 14545 + CMSG_MAIL_TAKE_MONEY = 0x4CD6, // 14545 + CMSG_MEETINGSTONE_INFO = 0xCA5B, // 14545 + CMSG_MESSAGECHAT_AFK = 0x00, // + CMSG_MESSAGECHAT_BATTLEGROUND = 0x00, // + CMSG_MESSAGECHAT_BATTLEGROUND_LEADER = 0x00, // + CMSG_MESSAGECHAT_CHANNEL = 0x00, // + CMSG_MESSAGECHAT_DND = 0x00, // + CMSG_MESSAGECHAT_EMOTE = 0x00, // + CMSG_MESSAGECHAT_GUILD = 0x00, // + CMSG_MESSAGECHAT_OFFICER = 0x00, // + CMSG_MESSAGECHAT_PARTY = 0x00, // + CMSG_MESSAGECHAT_PARTY_LEADER = 0x00, // + CMSG_MESSAGECHAT_RAID = 0x00, // + CMSG_MESSAGECHAT_RAID_LEADER = 0x00, // + CMSG_MESSAGECHAT_RAID_WARNING = 0x00, // + CMSG_MESSAGECHAT_SAY = 0x00, // + CMSG_MESSAGECHAT_WHISPER = 0x00, // + CMSG_MESSAGECHAT_YELL = 0x00, // + CMSG_MINIGAME_MOVE = 0x00, // + CMSG_MOUNTSPECIAL_ANIM = 0x00, // + CMSG_MOVE_KNOCK_BACK_ACK = 0x00, // + CMSG_MOVE_SET_RAW_POSITION = 0x00, // + CMSG_MOVE_TIME_SKIPPED = 0x00, // + CMSG_ENABLE_NAGLE = 0x00, // + CMSG_NAME_QUERY = 0x586A, // 14545 + CMSG_NEW_SPELL_SLOT = 0x00, // + CMSG_NEXT_CINEMATIC_CAMERA = 0x8E63, // 14545 + CMSG_NPC_TEXT_QUERY = 0x5C63, // 14545 + CMSG_OFFER_PETITION = 0xC8DE, // 14545 + CMSG_OPEN_ITEM = 0x88C7, // 14545 + CMSG_OPENING_CINEMATIC = 0xD8D2, // 14545 + CMSG_OPT_OUT_OF_LOOT = 0x00, // + CMSG_PAGE_TEXT_QUERY = 0x8A5F, // 14545 + CMSG_PETITION_BUY = 0x8E4E, // 14545 + CMSG_PETITION_QUERY = 0xCEF3, // 14545 + CMSG_PETITION_SHOWLIST = 0x00, // + CMSG_PETITION_SHOW_SIGNATURES = 0x00, // + CMSG_PETITION_SIGN = 0x4A5E, // 14545 + CMSG_PET_ABANDON = 0x00, // + CMSG_PET_ACTION = 0x1AEA, // 14545 + CMSG_PET_CANCEL_AURA = 0x00, // + CMSG_PET_CAST_SPELL = 0x00, // + CMSG_PET_LEARN_TALENT = 0x48E6, // 14545 + CMSG_PET_NAME_QUERY = 0xDA76, // 14545 + CMSG_PET_RENAME = 0x00, // + CMSG_PET_SET_ACTION = 0x00, // + CMSG_PET_SPELL_AUTOCAST = 0x00, // + CMSG_PET_STOP_ATTACK = 0x00, // + CMSG_PING = 0x1008, // 14545 + CMSG_PLAYER_DIFFICULTY_CHANGE = 0x00, // + CMSG_PLAYED_TIME = 0x5A56, // 14545 + CMSG_PLAYER_LOGIN = 0x0898, // 14545 + CMSG_PLAYER_LOGOUT = 0x1CEE, // 14545 + CMSG_PLAYER_VEHICLE_ENTER = 0x00, // + CMSG_PLAY_DANCE = 0x5857, // 14545 + CMSG_PUSHQUESTTOPARTY = 0xA47, // 14545 + CMSG_QUERY_GUILD_REWARDS = 0x00, // + CMSG_QUERY_GUILD_MAX_XP = 0x00, // + CMSG_QUERY_GUILD_XP = 0x00, // + CMSG_QUERY_TIME = 0x18FE, // 14545 + CMSG_QUEST_QUERY = 0xCE7F, // 14545 + CMSG_QUERY_QUESTS_COMPLETED = 0x98DF, // 14545 + CMSG_QUESTLOG_SWAP_QUEST = 0x00, // + CMSG_QUESTGIVER_ACCEPT_QUEST = 0x8CD3, // 14545 + CMSG_QUESTGIVER_CANCEL = 0xC86A, // 14545 + CMSG_QUESTGIVER_CHOOSE_REWARD = 0x18F3, // 14545 + CMSG_QUESTGIVER_COMPLETE_QUEST = 0xCCE3, // 14545 + CMSG_QUESTGIVER_HELLO = 0x00, // + CMSG_QUESTGIVER_QUERY_QUEST = 0x8CE7, // 14545 + CMSG_QUESTGIVER_QUEST_AUTOLAUNCH = 0x00, // + CMSG_QUESTGIVER_REQUEST_REWARD = 0xD8E7, // 14545 + CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY = 0xC8DB, // 14545 + CMSG_QUESTGIVER_STATUS_QUERY = 0x88C6, // 14545 + CMSG_QUESTLOG_REMOVE_QUEST = 0x8EFF, // 14545 + CMSG_QUEST_POI_QUERY = 0x00, // + CMSG_QUEST_CONFIRM_ACCEPT = 0xC63, // 14545 + CMSG_READY_FOR_ACCOUNT_DATA_TIMES = 0xCCDB, // 14545 + CMSG_READ_ITEM = 0x00, // + CMSG_REALM_SPLIT = 0xDC66, // 14545 + CMSG_RECLAIM_CORPSE = 0x88DB, // 14545 + CMSG_REDIRECTION_AUTH_PROOF = 0x00, // + CMSG_REPAIR_ITEM = 0xCF3, // 14545 + CMSG_REPOP_REQUEST = 0x8872, // 14545 + CMSG_REPORT_PVP_AFK = 0x00, // + CMSG_REPLACE_ACCOUNT_DATA = 0x00, // + CMSG_REQUEST_ACCOUNT_DATA = 0x00, // + CMSG_REQUEST_CATEGORY_COOLDOWNS = 0x00, // + CMSG_REQUEST_CEMETERY_LIST = 0x00, // + CMSG_REQUEST_PARTY_MEMBER_STATS = 0x987E, // 14545 + CMSG_REQUEST_PET_INFO = 0x9A47, // 14545 + CMSG_REQUEST_PLAYER_VEHICLE_EXIT = 0xCC6, // 14545 + CMSG_REQUEST_RATED_BG_INFO = 0x00, // + CMSG_REQUEST_RAID_INFO = 0x00, // + CMSG_REQUEST_VEHICLE_NEXT_SEAT = 0xCAD6, // 14545 + CMSG_REQUEST_VEHICLE_PREV_SEAT = 0x1AE2, // 14545 + CMSG_REQUEST_VEHICLE_SWITCH_SEAT = 0x01, // temp to fix switch case value error + CMSG_RESET_INSTANCES = 0x9EEA, // 14545 + CMSG_RESURRECT_RESPONSE = 0x00, // + CMSG_RETURN_TO_GRAVEYARD = 0x00, // + CMSG_SAVE_PLAYER = 0x00, // + CMSG_SEARCH_LFG_JOIN = 0x00, // + CMSG_SEARCH_LFG_LEAVE = 0x00, // + CMSG_SELF_RES = 0xCCFE, // 14545 + CMSG_SELL_ITEM = 0x5EE3, // 14545 + CMSG_SET_ACTIONBAR_TOGGLES = 0x584F, // 14545 + CMSG_SET_ACTION_BUTTON = 0x00, // + CMSG_SET_ACTIVE_MOVER = 0x00, // + CMSG_SET_ACTIVE_VOICE_CHANNEL = 0x00, // + CMSG_SET_ALLOW_LOW_LEVEL_RAID1 = 0xC863, // 14545 + CMSG_SET_ALLOW_LOW_LEVEL_RAID2 = 0x4CE7, // 14545 + CMSG_SET_CHANNEL_WATCH = 0x00, // + CMSG_SET_CONTACT_NOTES = 0x1AF3, // 14545 + CMSG_SET_FACTION_CHEAT = 0x00, // + CMSG_SET_GUILD_BANK_TEXT = 0x00, // + CMSG_SET_LFG_COMMENT = 0x00, // + CMSG_SET_PLAYER_DECLINED_NAMES = 0xC847, // 14545 + CMSG_SET_PRIMARY_TALENT_TREE = 0x185E, // 14545 + CMSG_SET_SAVED_INSTANCE_EXTEND = 0x8E62, // 14545 + CMSG_SET_SELECTION = 0x4C4E, // 14545 + CMSG_SET_SKILL_CHEAT = 0x00, // + CMSG_SET_TAXI_BENCHMARK_MODE = 0x1EFF, // 14545 + CMSG_SET_TITLE = 0x00, // + CMSG_SET_TRADE_GOLD = 0x00, // + CMSG_SET_TRADE_ITEM = 0x00, // + CMSG_SETDEATHBINDPOINT = 0x00, // + CMSG_SETSHEATHED = 0xCA5F, // 14545 + CMSG_SHOWING_CLOAK = 0x8AE3, // 14545 + CMSG_SHOWING_HELM = 0xCEFA, // 14545 + CMSG_SERVERTIME = 0x00, // + CMSG_SOCKET_GEMS = 0x00, // + CMSG_SPIRIT_HEALER_ACTIVATE = 0x5AEB, // 14545 + CMSG_SPLIT_ITEM = 0x00, // + CMSG_STANDSTATECHANGE = 0x9EC6, // 14545 + CMSG_START_QUEST = 0x00, // + CMSG_STOP_DANCE = 0x00, // + CMSG_STORE_LOOT_IN_SLOT = 0x00, // + CMSG_SUMMON_RESPONSE = 0xD84E, // 14545 + CMSG_SWAP_ITEM = 0xDED6, // 14545 + CMSG_SWAP_INV_ITEM = 0x5CE7, // 14545 + CMSG_TELEPORT_TO_UNIT = 0x8C72, // 14545 + CMSG_TEXT_EMOTE = 0x00, // + CMSG_TIME_SYNC_RESP = 0x00, // + CMSG_TAXICLEARALLNODES = 0x00, // + CMSG_TAXIENABLEALLNODES = 0x00, // + CMSG_TAXINODE_STATUS_QUERY = 0x98E3, // 14545 + CMSG_TAXIQUERYAVAILABLENODES = 0x00, // + CMSG_TAXISHOWNODES = 0x00, // + CMSG_TOGGLE_PVP = 0x8ECA, // 14545 + CMSG_TOTEM_DESTROYED = 0x00, // + SMSG_TRAINER_BUY_SUCCEEDED = 0xAF7, // 14545 + CMSG_TRAINER_LIST = 0xCC7F, // 14545 + CMSG_TRIGGER_CINEMATIC_CHEAT = 0x00, // + CMSG_TURN_IN_PETITION = 0x9C67, // 14545 + CMSG_TUTORIAL_CLEAR = 0x00, // + CMSG_TUTORIAL_FLAG = 0x00, // + CMSG_TUTORIAL_RESET = 0x00, // + CMSG_UNACCEPT_TRADE = 0x00, // + CMSG_UNLEARN_SKILL = 0xAC3, // 14545 + CMSG_UNREGISTER_ALL_ADDON_PREFIXES = 0x00, // + CMSG_UNUSED2 = 0x00, // + CMSG_UPDATE_ACCOUNT_DATA = 0x4AFE, // 14545 + CMSG_USE_ITEM = 0x00, // + CMSG_VOICE_SESSION_ENABLE = 0x00, // + CMSG_VIOLENCE_LEVEL = 0x00, // + CMSG_WARDEN_DATA = 0x5847, // 14545 + CMSG_WHO = 0x9AD7, // 14545 + CMSG_WHOIS = 0xCCE6, // 14545 + CMSG_WORLD_LOGIN = 0x00, // + CMSG_WORLD_STATE_UI_TIMER_UPDATE = 0x58F6, // 14545 + CMSG_WORLD_TELEPORT = 0x00, // + CMSG_WRAP_ITEM = 0x00, // + CMSG_ZONEUPDATE = 0x00, // + MSG_AUCTION_HELLO = 0x00, // + MSG_CHANNEL_START = 0x00, // + MSG_CHANNEL_UPDATE = 0x00, // + MSG_CORPSE_QUERY = 0x00, // + MSG_GM_BIND_OTHER = 0x00, // + MSG_GM_SHOWLABEL = 0x00, // + MSG_GM_SUMMON = 0x00, // + MSG_GUILD_BANK_LOG_QUERY = 0x00, // + MSG_GUILD_BANK_MONEY_WITHDRAWN = 0xDE77, // 14545 + MSG_GUILD_EVENT_LOG_QUERY = 0x00, // + MSG_GUILD_PERMISSIONS = 0x00, // + MSG_INSPECT_ARENA_TEAMS = 0x00, // + MSG_LIST_STABLED_PETS = 0x88CA, // 14545 + MSG_MINIMAP_PING = 0x00, // + MSG_MOVE_FALL_LAND = 0x00, // + MSG_MOVE_HEARTBEAT = 0x00, // + MSG_MOVE_HOVER = 0x00, // + MSG_MOVE_JUMP = 0xE4E, // 14545 + MSG_MOVE_KNOCK_BACK = 0x00, // + MSG_MOVE_ROOT = 0x00, // + MSG_MOVE_SET_ALL_SPEED_CHEAT = 0x00, // + MSG_MOVE_SET_FACING = 0x00, // + MSG_MOVE_SET_FLIGHT_BACK_SPEED = 0x00, // + MSG_MOVE_SET_FLIGHT_BACK_SPEED_CHEAT = 0x00, // + MSG_MOVE_SET_FLIGHT_SPEED = 0x00, // + MSG_MOVE_SET_FLIGHT_SPEED_CHEAT = 0x00, // + MSG_MOVE_SET_PITCH = 0x00, // + MSG_MOVE_SET_PITCH_RATE = 0x00, // + MSG_MOVE_SET_RAW_POSITION_ACK = 0x00, // + MSG_MOVE_SET_RUN_BACK_SPEED = 0x00, // + MSG_MOVE_SET_RUN_BACK_SPEED_CHEAT = 0x00, // + MSG_MOVE_SET_RUN_MODE = 0x00, // + MSG_MOVE_SET_RUN_SPEED_CHEAT = 0x00, // + MSG_MOVE_SET_RUN_SPEED = 0x00, // + MSG_MOVE_SET_SWIM_BACK_SPEED = 0x00, // + MSG_MOVE_SET_SWIM_BACK_SPEED_CHEAT = 0x00, // + MSG_MOVE_SET_SWIM_SPEED = 0x00, // + MSG_MOVE_SET_SWIM_SPEED_CHEAT = 0x00, // + MSG_MOVE_SET_TURN_RATE = 0x00, // + MSG_MOVE_SET_TURN_RATE_CHEAT = 0x00, // + MSG_MOVE_SET_WALK_MODE = 0x00, // + MSG_MOVE_SET_WALK_SPEED = 0x00, // + MSG_MOVE_SET_WALK_SPEED_CHEAT = 0x00, // + MSG_MOVE_START_ASCEND = 0x00, // + MSG_MOVE_START_DESCEND = 0x00, // + MSG_MOVE_STOP_ASCEND = 0x00, // + MSG_MOVE_START_BACKWARD = 0x00, // + MSG_MOVE_START_FORWARD = 0x00, // + MSG_MOVE_START_PITCH_UP = 0x00, // + MSG_MOVE_START_PITCH_DOWN = 0x00, // + MSG_MOVE_START_TURN_LEFT = 0x00, // + MSG_MOVE_START_TURN_RIGHT = 0x00, // + MSG_MOVE_START_STRAFE_LEFT = 0x00, // + MSG_MOVE_START_STRAFE_RIGHT = 0x00, // + MSG_MOVE_START_SWIM = 0x00, // + MSG_MOVE_STOP = 0x00, // + MSG_MOVE_STOP_PITCH = 0x00, // + MSG_MOVE_STOP_TURN = 0x00, // + MSG_MOVE_STOP_STRAFE = 0x00, // + MSG_MOVE_STOP_SWIM = 0x00, // + MSG_MOVE_TOGGLE_LOGGING = 0x00, // + MSG_MOVE_TIME_SKIPPED = 0x00, // + MSG_MOVE_TELEPORT = 0x00, // + MSG_MOVE_TELEPORT_ACK = 0x00, // + MSG_MOVE_TELEPORT_CHEAT = 0x00, // + MSG_MOVE_TOGGLE_COLLISION_CHEAT = 0x00, // + MSG_MOVE_TOGGLE_FALL_LOGGING = 0x00, // + MSG_MOVE_UNROOT = 0x00, // + MSG_MOVE_WORLDPORT_ACK = 0x00, // + MSG_NOTIFY_PARTY_SQUELCH = 0x00, // + MSG_PARTY_ASSIGNMENT = 0x00, // + MSG_PETITION_DECLINE = 0x98E7, // 14545 + MSG_PETITION_RENAME = 0x4857, // 14545 + MSG_PVP_LOG_DATA = 0x00, // + MSG_QUERY_GUILD_BANK_TEXT = 0x00, // + MSG_QUERY_NEXT_MAIL_TIME = 0x00, // + MSG_QUEST_PUSH_RESULT = 0x1863, // 14545 + MSG_RAID_READY_CHECK = 0x584E, // 14545 + MSG_RAID_READY_CHECK_CONFIRM = 0x584E, // 14545 + MSG_RAID_READY_CHECK_FINISHED = 0x00, // + MSG_RAID_TARGET_UPDATE = 0x00, // + MSG_RANDOM_ROLL = 0x4C57, // 14545 + MSG_SAVE_GUILD_EMBLEM = 0x00, // + MSG_SET_DUNGEON_DIFFICULTY = 0xC4F, // 14545 + MSG_SET_RAID_DIFFICULTY = 0x1A5A, // 14545 + MSG_TABARDVENDOR_ACTIVATE = 0x98EB, // 14545 + MSG_TALENT_WIPE_CONFIRM = 0x00, // + OBSOLETE_DROP_ITEM = 0x00, // + SMSG_ACCOUNT_DATA_TIMES = 0x00, // + SMSG_ACHIEVEMENT_DELETED = 0x00, // + SMSG_ACHIEVEMENT_EARNED = 0x00, // + SMSG_ACTION_BUTTONS = 0x00, // + SMSG_ACTIVATETAXIREPLY = 0x8E4F, // 14545 + SMSG_ADDON_INFO = 0x9863, // 14545 + SMSG_ADD_RUNE_POWER = 0x00, // + SMSG_AI_REACTION = 0x00, // + SMSG_ALL_ACHIEVEMENT_DATA = 0x00, // + SMSG_AREA_SPIRIT_HEALER_TIME = 0x00, // + SMSG_AREA_TRIGGER_MESSAGE = 0x00, // + SMSG_ARENA_ERROR = 0x00, // + SMSG_ARENA_OPPONENT_UPDATE = 0x00, // + SMSG_ARENA_TEAM_CHANGE_FAILED_QUEUED = 0x4A4E, // 14545 + SMSG_ARENA_TEAM_COMMAND_RESULT = 0x00, // + SMSG_ARENA_TEAM_EVENT = 0x00, // + SMSG_ARENA_TEAM_INVITE = 0x00, // + SMSG_ARENA_TEAM_QUERY_RESPONSE = 0x00, // + SMSG_ARENA_TEAM_ROSTER = 0x00, // + SMSG_ARENA_TEAM_STATS = 0x00, // + SMSG_ATTACKERSTATEUPDATE = 0x00, // + SMSG_ATTACKSTART = 0x00, // + SMSG_ATTACKSTOP = 0x00, // + SMSG_ATTACKSWING_BADFACING = 0x00, // + SMSG_ATTACKSWING_CANT_ATTACK = 0x00, // + SMSG_ATTACKSWING_DEADTARGET = 0x00, // + SMSG_ATTACKSWING_NOTINRANGE = 0x00, // + SMSG_AUCTION_BIDDER_LIST_RESULT = 0x00, // + SMSG_AUCTION_BIDDER_NOTIFICATION = 0x00, // + SMSG_AUCTION_COMMAND_RESULT = 0x00, // + SMSG_AUCTION_LIST_PENDING_SALES = 0x00, // + SMSG_AUCTION_LIST_RESULT = 0x00, // + SMSG_AUCTION_OWNER_LIST_RESULT = 0x00, // + SMSG_AUCTION_OWNER_NOTIFICATION = 0x00, // + SMSG_AUCTION_REMOVED_NOTIFICATION = 0x00, // + SMSG_AURA_UPDATE = 0x00, // + SMSG_AURA_UPDATE_ALL = 0x00, // + SMSG_AURACASTLOG = 0x00, // + SMSG_AUTH_CHALLENGE = 0x1181, // 14545 + SMSG_AUTH_RESPONSE = 0x8867, // 14545 + SMSG_AVAILABLE_VOICE_CHANNEL = 0x00, // + SMSG_BARBER_SHOP_RESULT = 0x00, // + SMSG_BATTLEFIELD_LIST = 0x00, // + SMSG_BATTLEFIELD_MGR_EJECTED = 0x00, // + SMSG_BATTLEFIELD_MGR_EJECT_PENDING = 0x00, // + SMSG_BATTLEFIELD_MGR_ENTERED = 0x00, // + SMSG_BATTLEFIELD_MGR_ENTRY_INVITE = 0x00, // + SMSG_BATTLEFIELD_MGR_QUEUE_INVITE = 0x00, // + SMSG_BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE = 0x00, // + SMSG_BATTLEFIELD_MGR_STATE_CHANGE = 0x00, // + SMSG_BATTLEFIELD_PORT_DENIED = 0x00, // + SMSG_BATTLEFIELD_STATUS1 = 0x00, // + SMSG_BATTLEFIELD_STATUS2 = 0x00, // + SMSG_BATTLEFIELD_STATUS3 = 0x00, // + SMSG_BATTLEFIELD_STATUS4 = 0x00, // + SMSG_BATTLEGROUND_INFO_THROTTLED = 0x00, // + SMSG_BATTLEGROUND_PLAYER_JOINED = 0x00, // + SMSG_BATTLEGROUND_PLAYER_POSITIONS = 0x00, // + SMSG_BINDPOINTUPDATE = 0x00, // + SMSG_BINDZONEREPLY = 0x00, // + SMSG_BINDER_CONFIRM = 0x00, // + SMSG_BREAK_TARGET = 0x00, // + SMSG_BUY_BANK_SLOT_RESULT = 0x00, // + SMSG_BUY_ITEM = 0x00, // + SMSG_BUY_FAILED = 0x00, // + SMSG_CALENDAR_COMMAND_RESULT = 0x00, // + SMSG_CALENDAR_SEND_NUM_PENDING = 0x00, // + SMSG_CALENDAR_SEND_CALENDAR = 0x00, // + SMSG_CANCEL_AUTO_REPEAT = 0x00, // + SMSG_CANCEL_COMBAT = 0x00, // + SMSG_CAST_FAILED = 0x00, // + SMSG_CHANNEL_LIST = 0x00, // + SMSG_CHANNEL_MEMBER_COUNT = 0x00, // + SMSG_CHANNEL_NOTIFY = 0x9C7F, // 14545 + SMSG_CHAR_CREATE = 19547, // 14545 + SMSG_CHAR_DELETE = 0x48CE, // 14545 + SMSG_CHAR_ENUM = 0xA05C, // 14545 + SMSG_CHARACTER_LOGIN_FAILED = 0x00, // + SMSG_CHAR_RENAME = 0x00, // + SMSG_CHAR_CUSTOMIZE = 0x00, // + SMSG_CHAR_FACTION_CHANGE = 0x00, // + SMSG_CHAT_PLAYER_AMBIGUOUS = 0x00, // + SMSG_CHAT_PLAYER_NOT_FOUND = 0x00, // + SMSG_CHAT_RESTRICTED = 0x00, // + SMSG_CHAT_WRONG_FACTION = 0xE66, // 14545 + SMSG_CHECK_FOR_BOTS = 0x00, // + SMSG_CLEAR_COOLDOWN = 0x00, // + SMSG_CLEAR_TARGET = 0x00, // + SMSG_CLIENTCACHE_VERSION = 0x88F2, // 14545 + SMSG_CLIENT_CONTROL_UPDATE = 0x00, // + SMSG_COMBAT_LOG_MULTIPLE = 0x00, // + SMSG_COMMENTATOR_MAP_INFO = 0x00, // + SMSG_COMMENTATOR_PLAYER_INFO = 0x00, // + SMSG_COMMENTATOR_STATE_CHANGED = 0x00, // + SMSG_COMPLAIN_RESULT = 0x00, // + SMSG_COMPRESSED_MOVES = 0x00, // + SMSG_COMPRESSED_UPDATE_OBJECT = 0x1CC3, // 14545 + SMSG_CONTACT_LIST = 0x00, // + SMSG_CONVERT_RUNE = 0x00, // + SMSG_COOLDOWN_CHEAT = 0x00, // + SMSG_COOLDOWN_EVENT = 0x00, // + SMSG_CORPSE_NOT_IN_INSTANCE = 0x00, // + SMSG_CORPSE_RECLAIM_DELAY = 0x00, // + SMSG_CORPSE_MAP_POSITION_QUERY_RESPONSE = 0x00, // + SMSG_CREATURE_QUERY_RESPONSE = 0xD847, // 14545 + SMSG_CRITERIA_DELETED = 0x00, // + SMSG_CRITERIA_UPDATE = 0x00, // + SMSG_CROSSED_INEBRIATION_THRESHOLD = 0x00, // + SMSG_DAMAGE_CALC_LOG = 0x00, // + SMSG_DAMAGE_DONE_OBSOLETE = 0x00, // + SMSG_DANCE_QUERY_RESPONSE = 0x00, // + SMSG_DB_REPLY = 0x76EC, // 14545 + SMSG_DEATH_RELEASE_LOC = 0x00, // + SMSG_DEFENSE_MESSAGE = 0x00, // + SMSG_DESTROY_OBJECT = 0x00, // + SMSG_DESTRUCTIBLE_BUILDING_DAMAGE = 0x00, // + SMSG_DUEL_OUTOFBOUNDS = 0x00, // + SMSG_DUEL_INBOUNDS = 0x00, // + SMSG_DISMOUNT = 0x00, // + SMSG_DISMOUNTRESULT = 0x00, // + SMSG_DISPEL_FAILED = 0x00, // + SMSG_DUEL_COMPLETE = 0x00, // + SMSG_DUEL_COUNTDOWN = 0x00, // + SMSG_DUEL_REQUESTED = 0x00, // + SMSG_DUEL_WINNER = 0x00, // + SMSG_DURABILITY_DAMAGE_DEATH = 0x00, // + SMSG_ECHO_PARTY_SQUELCH = 0x00, // + SMSG_EMOTE = 0xC67, // 14545 + SMSG_ENABLE_BARBER_SHOP = 0x00, // + SMSG_ENCHANTMENTLOG = 0x00, // + SMSG_ENVIRONMENTALDAMAGELOG = 0x00, // + SMSG_EQUIPMENT_SET_LIST = 0x18DF, // 14545 + SMSG_EQUIPMENT_SET_SAVED = 0x00, // + SMSG_EQUIPMENT_SET_USE_RESULT = 0x00, // + SMSG_EXPECTED_SPAM_RECORDS = 0x00, // + SMSG_EXPLORATION_EXPERIENCE = 0x00, // + SMSG_FEATURE_SYSTEM_STATUS = 0x00, // + SMSG_FISH_ESCAPED = 0x9C66, // 14545 + SMSG_FISH_NOT_HOOKED = 0x18C3, // 14545 + SMSG_FORCEACTIONSHOW = 0x00, // + SMSG_FORCED_DEATH_UPDATE = 0x00, // + SMSG_FORCE_DISPLAY_UPDATE = 0x00, // + SMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE = 0x00, // + SMSG_FORCE_FLIGHT_SPEED_CHANGE = 0x00, // + SMSG_FORCE_MOVE_ROOT = 0x00, // + SMSG_FORCE_MOVE_UNROOT = 0x00, // + SMSG_FORCE_PITCH_RATE_CHANGE = 0x00, // + SMSG_FORCE_RUN_BACK_SPEED_CHANGE = 0x00, // + SMSG_FORCE_RUN_SPEED_CHANGE = 0x00, // + SMSG_FORCE_SEND_QUEUED_PACKETS = 0x00, // + SMSG_FORCE_TURN_RATE_CHANGE = 0x00, // + SMSG_FORCE_SWIM_SPEED_CHANGE = 0x00, // + SMSG_FORCE_SWIM_BACK_SPEED_CHANGE = 0x00, // + SMSG_FORCE_WALK_SPEED_CHANGE = 0x00, // + SMSG_FRIEND_STATUS = 0x00, // + SMSG_GAMEOBJECT_CUSTOM_ANIM = 0x00, // + SMSG_GAMEOBJECT_DESPAWN_ANIM = 0x00, // + SMSG_GAMEOBJECT_PAGETEXT = 0x00, // + SMSG_GAMEOBJECT_QUERY_RESPONSE = 0xCCF7, // 14545 + SMSG_GAMEOBJECT_RESET_STATE = 0x00, // + SMSG_GAMESPEED_SET = 0x00, // + SMSG_GAMETIME_SET = 0x00, // + SMSG_GAMETIME_UPDATE = 0x00, // + SMSG_GMRESPONSE_STATUS_UPDATE = 0x00, // + SMSG_GMRESPONSE_RECEIVED = 0x00, // + SMSG_GMTICKET_DELETETICKET = 0x00, // + SMSG_GMTICKET_GETTICKET = 0x00, // + SMSG_GM_MESSAGECHAT = 0x00, // + SMSG_GMTICKET_CREATE = 0x00, // + SMSG_GMTICKET_SYSTEMSTATUS = 0x9C7E, // 14545 + SMSG_GMTICKET_UPDATETEXT = 0x00, // + SMSG_GODMODE = 0xDEEE, // 14545 + SMSG_GOSSIP_COMPLETE = 0x00, // + SMSG_GOSSIP_MESSAGE = 0xCCEB, // 14545 + SMSG_GOSSIP_POI = 0x00, // + SMSG_GROUP_CANCEL = 0x00, // + SMSG_GROUP_DECLINE = 0x00, // + SMSG_GROUP_DESTROYED = 0x00, // + SMSG_GROUP_INVITE = 0x00, // + SMSG_GROUP_JOINED_BATTLEGROUND = 0x00, // + SMSG_GROUP_LIST = 0x00, // + SMSG_GROUP_SET_LEADER = 0x00, // + SMSG_GROUP_UNINVITE = 0x00, // + SMSG_GUILD_BANK_LIST = 0x5EFB, // 14545 + SMSG_GUILD_COMMAND_RESULT = 0x00, // + SMSG_GUILD_DECLINE = 0x00, // + SMSG_GUILD_EVENT = 0x8AC2, // 14545 + SMSG_GUILD_INFO = 0x00, // + SMSG_GUILD_INVITE = 0x00, // + SMSG_GUILD_MAX_DAILY_XP = 0x00, // + SMSG_GUILD_NEWS_UPDATE = 0x00, // + SMSG_GUILD_QUERY_RESPONSE = 0xCA66, // 14545 + SMSG_GUILD_RANK = 0xA6EC, // 14545 + SMSG_GUILD_RANKS_UPDATE = 0x00, // + SMSG_GUILD_REWARDS_LIST = 0x00, // + SMSG_GUILD_ROSTER = 0x00, // + SMSG_GUILD_TRADESKILL_UPDATE = 0x00, // + SMSG_GUILD_UPDATE_ROSTER = 0x00, // + SMSG_GUILD_XP_UPDATE = 0x00, // + SMSG_HIGHEST_THREAT_UPDATE = 0x00, // + SMSG_INITIALIZE_FACTIONS = 0x00, // + SMSG_INITIAL_SPELLS = 0x00, // + SMSG_INIT_CURRENCY = 0x227E, // 14545 + SMSG_INIT_WORLD_STATES = 0x9EDA, // 14545 + SMSG_INSPECT = 0x00, // + SMSG_INSPECT_HONOR_STATS = 0x00, // + SMSG_INSPECT_TALENT = 0x00, // + SMSG_INSTANCE_DIFFICULTY = 0x00, // + SMSG_INSTANCE_LOCK_WARNING_QUERY = 0x00, // + SMSG_INSTANCE_RESET = 0x00, // + SMSG_INSTANCE_RESET_FAILED = 0x00, // + SMSG_INSTANCE_SAVE_CREATED = 0x00, // + SMSG_INVALID_PROMOTION_CODE = 0x00, // + SMSG_INVALIDATE_DANCE = 0x00, // + SMSG_INVALIDATE_PLAYER = 0x00, // + SMSG_INVENTORY_CHANGE_FAILURE = 0x00, // + SMSG_ITEM_COOLDOWN = 0x00, // + SMSG_ITEM_ENCHANT_TIME_UPDATE = 0x00, // + SMSG_ITEM_NAME_QUERY_RESPONSE = 0x00, // + SMSG_ITEM_PUSH_RESULT = 0x00, // + SMSG_ITEM_QUERY_MULTIPLE_RESPONSE = 0x00, // + SMSG_ITEM_QUERY_SINGLE_RESPONSE = 0x00, // + SMSG_ITEM_REFUND_INFO_RESPONSE = 0x00, // + SMSG_ITEM_REFUND_RESULT = 0x00, // + SMSG_ITEM_TEXT_QUERY_RESPONSE = 0x00, // + SMSG_ITEM_TIME_UPDATE = 0x00, // + SMSG_JOINED_BATTLEGROUND_QUEUE = 0x00, // + SMSG_LEARNED_DANCE_MOVES = 0x00, // + SMSG_LEARNED_SPELL = 0x00, // + SMSG_LEVELUP_INFO = 0x00, // + SMSG_LFG_DISABLED = 0x00, // + SMSG_LFG_JOIN_RESULT = 0x00, // + SMSG_LFG_OFFER_CONTINUE = 0x00, // + SMSG_LFG_OPEN_FROM_GOSSIP = 0x00, // + SMSG_LFG_PARTY_INFO = 0x00, // + SMSG_LFG_PLAYER_INFO = 0x00, // + SMSG_LFG_PLAYER_REWARD = 0x00, // + SMSG_LFG_PROPOSAL_UPDATE = 0x00, // + SMSG_LFG_QUEUE_STATUS = 0x00, // + SMSG_LFG_ROLE_CHECK_UPDATE = 0x00, // + SMSG_LFG_ROLE_CHOSEN = 0x00, // + SMSG_LFG_TELEPORT_DENIED = 0x00, // + SMSG_LFG_UPDATE_SEARCH = 0x00, // + SMSG_LFG_UPDATE_PARTY = 0x00, // + SMSG_LFG_UPDATE_PLAYER = 0x00, // + SMSG_LIST_INVENTORY = 0x264C, // 14545 + SMSG_LOGIN_SETTIMESPEED = 0x00, // + SMSG_LOGIN_VERIFY_WORLD = 0xC86E, // 14545 + SMSG_LOGOUT_CANCEL_ACK = 0x00, // + SMSG_LOGOUT_COMPLETE = 0xCC6B, // 14545 + SMSG_LOGOUT_RESPONSE = 0x886A, // 14545 + SMSG_LOG_XPGAIN = 0x00, // + SMSG_LOOT_ALL_PASSED = 0x00, // + SMSG_LOOT_CLEAR_MONEY = 0x00, // + SMSG_LOOT_ITEM_NOTIFY = 0x00, // + SMSG_LOOT_LIST = 0x00, // + SMSG_LOOT_MASTER_LIST = 0x00, // + SMSG_LOOT_MONEY_NOTIFY = 0x00, // + SMSG_LOOT_RELEASE_RESPONSE = 0x00, // + SMSG_LOOT_REMOVED = 0x00, // + SMSG_LOOT_RESPONSE = 0x00, // + SMSG_LOOT_ROLL = 0x00, // + SMSG_LOOT_ROLL_WON = 0x00, // + SMSG_LOOT_SLOT_CHANGED = 0x00, // + SMSG_LOOT_START_ROLL = 0x00, // + SMSG_MAIL_LIST_RESULT = 0x00, // + SMSG_MEETINGSTONE_COMPLETE = 0x00, // + SMSG_MEETINGSTONE_IN_PROGRESS = 0x00, // + SMSG_MEETINGSTONE_MEMBER_ADDED = 0x00, // + SMSG_MEETINGSTONE_SETQUEUE = 0x00, // + SMSG_MESSAGECHAT = 0x5E52, // 14545 + SMSG_MIRRORIMAGE_DATA = 0x00, // + SMSG_MODIFY_COOLDOWN = 0x00, // + SMSG_MONSTER_MOVE = 0x4C53, // 14545 + SMSG_MONSTER_MOVE_TRANSPORT = 0x88FB, // 14545 + SMSG_MOTD = 0xCA4B, // 14545 + SMSG_MOUNTSPECIAL_ANIM = 0x00, // + SMSG_MOUNTRESULT = 0x00, // + SMSG_MOVE_FEATHER_FALL = 0x00, // + SMSG_MOVE_NORMAL_FALL = 0x00, // + SMSG_MOVE_SET_CAN_FLY = 0x00, // + SMSG_MOVE_SET_HOVER = 0x00, // + SMSG_MOVE_UNSET_CAN_FLY = 0x00, // + SMSG_MOVE_UNSET_HOVER = 0x00, // + SMSG_MOVE_WATER_WALK = 0x00, // + SMSG_MOVE_LAND_WALK = 0x00, // + CMSG_MOVE_HOVER_ACK = 0x00, // + SMSG_MOVE_KNOCK_BACK = 0x00, // + SMSG_MOVE_SET_WALK_IN_AIR = 0x00, // + SMSG_MOVE_UNSET_WALK_IN_AIR = 0x00, // + SMSG_MULTIPLE_PACKETS = 0x00, // + SMSG_NAME_QUERY_RESPONSE = 0x9CE6, // 14545 + SMSG_NEW_TAXI_PATH = 0xC8FF, // Might be 0x98CF + SMSG_NEW_WORLD = 0x00, // + SMSG_NOTIFICATION = 0x00, // + SMSG_NOTIFY_DANCE = 0x00, // + SMSG_NOTIFY_DEST_LOC_SPELL_CAST = 0x00, // + SMSG_NPC_TEXT_UPDATE = 0x4C72, // 14545 + SMSG_NPC_WONT_TALK = 0x00, // + SMSG_OFFER_PETITION_ERROR = 0x00, // + SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA = 0x00, // + SMSG_OPEN_CONTAINER = 0x00, // + SMSG_PAGE_TEXT_QUERY_RESPONSE = 0x18D2, // 14545 + SMSG_PARTYKILLLOG = 0x00, // + SMSG_PARTY_MEMBER_STATS = 0x00, // + SMSG_PARTY_MEMBER_STATS_FULL = 0x00, // + SMSG_PARTY_COMMAND_RESULT = 0x00, // + SMSG_PAUSE_MIRROR_TIMER = 0x00, // + SMSG_PERIODICAURALOG = 0x00, // + SMSG_PETGODMODE = 0x00, // + SMSG_PETITION_QUERY_RESPONSE = 0x00, // + SMSG_PET_ACTION_FEEDBACK = 0x00, // + SMSG_PET_ACTION_SOUND = 0x00, // + SMSG_PET_CAST_FAILED = 0x00, // + SMSG_PET_DISMISS_SOUND = 0x00, // + SMSG_PET_GUIDS = 0x00, // + SMSG_PET_LEARNED_SPELL = 0xDC5E, // 14545 + SMSG_PET_MODE = 0x00, // + SMSG_PET_NAME_QUERY_RESPONSE = 0x00, // + SMSG_PET_NAME_INVALID = 0x00, // + SMSG_PET_REMOVED_SPELL = 0x18F6, // 14545 + SMSG_PET_SPELLS = 0x00, // + SMSG_PET_TAME_FAILURE = 0x00, // + SMSG_PET_UPDATE_COMBO_POINTS = 0x00, // + SMSG_PETITION_SHOWLIST = 0x00, // + SMSG_PETITION_SHOW_SIGNATURES = 0x00, // + SMSG_PETITION_SIGN_RESULTS = 0x00, // + SMSG_PLAYER_MOVE = 0x00, // + SMSG_PLAYED_TIME = 0x00, // + SMSG_PLAYERBINDERROR = 0x5A4F, // 14545 + SMSG_PLAYERBOUND = 0x00, // + SMSG_PLAYER_DIFFICULTY_CHANGE = 0x00, // + SMSG_BATTLEGROUND_PLAYER_LEFT = 0x00, // + SMSG_PLAYER_SKINNED = 0x00, // + SMSG_PLAYER_VEHICLE_DATA = 0x00, // + SMSG_PLAY_DANCE = 0x00, // + SMSG_PLAY_MUSIC = 0x00, // + SMSG_PLAY_OBJECT_SOUND = 0x00, // + SMSG_PLAY_SOUND = 0x00, // + SMSG_PLAY_SPELL_VISUAL = 0x00, // + SMSG_PLAY_SPELL_IMPACT = 0x00, // + SMSG_PLAY_TIME_WARNING = 0x00, // + SMSG_PONG = 0x0380, // 14545 + SMSG_POWER_UPDATE = 0x00, // + SMSG_PRE_RESURRECT = 0x00, // + SMSG_PROCRESIST = 0x00, // + SMSG_PROPOSE_LEVEL_GRANT = 0x00, // + SMSG_PUREMOUNT_CANCELLED_OBSOLETE = 0x00, // + SMSG_PVP_CREDIT = 0x00, // + SMSG_QUERY_QUESTS_COMPLETED_RESPONSE = 0x00, // + SMSG_QUERY_TIME_RESPONSE = 0x00, // + SMSG_QUESTGIVER_OFFER_REWARD = 0x00, // + SMSG_QUESTGIVER_QUEST_COMPLETE = 0x00, // + SMSG_QUESTGIVER_QUEST_DETAILS = 0xCE5F, // 14545 + SMSG_QUESTGIVER_QUEST_FAILED = 0xD8FF, // 14545 + SMSG_QUESTGIVER_QUEST_LIST = 0xDEF6, // 14545 + SMSG_QUESTGIVER_REQUEST_ITEMS = 0x9CEE, // 14545 + SMSG_QUESTGIVER_STATUS = 0xC846, // 14545 + SMSG_QUESTGIVER_STATUS_MULTIPLE = 0xDCFF, // 14545 + SMSG_QUESTLOG_FULL = 0x4EDE, // 14545 + SMSG_QUESTUPDATE_ADD_KILL = 0x00, // + SMSG_QUESTUPDATE_ADD_PVP_KILL = 0x00, // + SMSG_QUESTUPDATE_COMPLETE = 0x9CD6, // 14545 + SMSG_QUESTUPDATE_FAILED = 0x9EF6, // 14545 + SMSG_QUESTUPDATE_FAILEDTIMER = 0x00, // + SMSG_QUEST_CONFIRM_ACCEPT = 0x00, // + SMSG_QUEST_FORCE_REMOVED = 0x00, // + SMSG_QUEST_POI_QUERY_RESPONSE = 0x00, // + SMSG_QUEST_QUERY_RESPONSE = 0x9E56, // 14545 + SMSG_QUESTGIVER_QUEST_INVALID = 0x00, // + SMSG_QUESTUPDATE_ADD_ITEM_OBSOLETE = 0x00, // + SMSG_RAID_GROUP_ONLY = 0x00, // + SMSG_RAID_INSTANCE_INFO = 0x00, // + SMSG_RAID_INSTANCE_MESSAGE = 0x00, // + SMSG_READ_ITEM_FAILED = 0x00, // + SMSG_READ_ITEM_OK = 0x00, // + SMSG_REALM_SPLIT = 0x1AF2, // 14545 + SMSG_REAL_GROUP_UPDATE = 0x00, // + SMSG_RECEIVED_MAIL = 0x00, // + SMSG_REDIRECT_CLIENT = 0x0180, // 14545 + SMSG_REFER_A_FRIEND_FAILURE = 0x00, // + SMSG_REMOVED_SPELL = 0x00, // + SMSG_REPORT_PVP_AFK_RESULT = 0x00, // + SMSG_REQUEST_CEMETERY_LIST_RESPONSE = 0x00, // + SMSG_RESPOND_INSPECT_ACHIEVEMENTS = 0x00, // + SMSG_RESET_FAILED_NOTIFY = 0x00, // + SMSG_RESISTLOG = 0x00, // + SMSG_RESURRECT_REQUEST = 0x00, // + SMSG_RESYNC_RUNES = 0x00, // + SMSG_RWHOIS = 0x00, // + SMSG_SELL_ITEM = 0x00, // + SMSG_SEND_MAIL_RESULT = 0x00, // + SMSG_SEND_UNLEARN_SPELLS = 0x00, // + SMSG_SERVERTIME = 0x00, // + SMSG_SERVER_FIRST_ACHIEVEMENT = 0x00, // + SMSG_SERVER_MESSAGE = 0x00, // + SMSG_SET_FACTION_ATWAR = 0x00, // + SMSG_SET_FACTION_STANDING = 0x00, // + SMSG_SET_FACTION_VISIBLE = 0x00, // + SMSG_SET_FLAT_SPELL_MODIFIER = 0x00, // + SMSG_SET_FORCED_REACTIONS = 0x00, // + SMSG_SET_PCT_SPELL_MODIFIER = 0x00, // + SMSG_SET_PHASE_SHIFT = 0x204C, // 14545 + SMSG_SET_PLAYER_DECLINED_NAMES_RESULT = 0x00, // + SMSG_SET_PROFICIENCY = 0x00, // + SMSG_SET_PROJECTILE_POSITION = 0x00, // + SMSG_SHOWTAXINODES = 0x8CFB, // 14545 + SMSG_SHOW_BANK = 0x00, // + SMSG_SPELLBREAKLOG = 0x00, // + SMSG_SPELLDAMAGESHIELD = 0x00, // + SMSG_SPELLENERGIZELOG = 0x00, // + SMSG_SPELLHEALLOG = 0x00, // + SMSG_SPELLINSTAKILLLOG = 0x00, // + SMSG_SPELLLOGEXECUTE = 0x00, // + SMSG_SPELLLOGMISS = 0x00, // + SMSG_SPELLNONMELEEDAMAGELOG = 0x00, // + SMSG_SPELLORDAMAGE_IMMUNE = 0x00, // + SMSG_SPELL_COOLDOWN = 0x00, // + SMSG_SPELL_DELAYED = 0x00, // + SMSG_SPELLDISPELLOG = 0x00, // + SMSG_SPELL_FAILED_OTHER = 0x00, // + SMSG_SPELL_FAILURE = 0x00, // + SMSG_SPELL_GO = 0x0A53, // 14545 + SMSG_SPELL_START = 0xCE43, // 14545 + SMSG_SPELLSTEALLOG = 0x00, // + SMSG_SPELL_UPDATE_CHAIN_TARGETS = 0x00, // + SMSG_SPIRIT_HEALER_CONFIRM = 0x00, // + SMSG_SPLINE_MOVE_WATER_WALK = 0x00, // + SMSG_SPLINE_MOVE_LAND_WALK = 0x00, // + SMSG_SPLINE_MOVE_ROOT = 0x00, // + SMSG_SPLINE_MOVE_UNROOT = 0x00, // + SMSG_STABLE_RESULT = 0x00, // + SMSG_STANDSTATE_UPDATE = 0x00, // + SMSG_START_MIRROR_TIMER = 0x00, // + SMSG_STOP_DANCE = 0x00, // + SMSG_STOP_MIRROR_TIMER = 0x00, // + SMSG_SUMMON_REQUEST = 0x00, // + SMSG_SUPERCEDED_SPELL = 0x00, // + SMSG_TALENTS_INFO = 0x00, // + SMSG_TAXINODE_STATUS = 0x8CFB, // 14545 + SMSG_TOGGLE_XP_GAIN = 0x8A5B, // 14545 + SMSG_TEXT_EMOTE = 0x00, // + SMSG_THREAT_CLEAR = 0x00, // + SMSG_THREAT_REMOVE = 0x00, // + SMSG_THREAT_UPDATE = 0x00, // + SMSG_TIME_SYNC_REQ = 0x00, // + SMSG_TITLE_EARNED = 0x00, // + SMSG_TOTEM_CREATED = 0x00, // + SMSG_TRADE_STATUS = 0x00, // + SMSG_TRADE_STATUS_EXTENDED = 0x00, // + SMSG_TRAINER_LIST = 0xC84E, // 14545 + SMSG_TRAINER_BUY_RESULT = 0x00, // + SMSG_TRANSFER_ABORTED = 0x00, // + SMSG_TRANSFER_PENDING = 0x00, // + SMSG_TRIGGER_CINEMATIC = 0x00, // + SMSG_TRIGGER_MOVIE = 0x00, // + SMSG_TURN_IN_PETITION_RESULTS = 0x00, // + SMSG_TUTORIAL_FLAGS = 0x1A46, // 14545 + SMSG_UNIT_SPELLCAST_START = 0x00, // + SMSG_UPDATE_ACCOUNT_DATA = 0x00, // + SMSG_UPDATE_ACCOUNT_DATA_COMPLETE = 0x5E53, // 14545 + SMSG_UPDATE_COMBO_POINTS = 0x00, // + SMSG_UPDATE_CURRENCY = 0x00, // + SMSG_UPDATE_CURRENCY_WEEK_LIMIT = 0x00, // + SMSG_UPDATE_INSTANCE_ENCOUNTER_UNIT = 0x00, // + SMSG_UPDATE_INSTANCE_OWNERSHIP = 0x00, // + SMSG_UPDATE_LAST_INSTANCE = 0x00, // + SMSG_UPDATE_LFG_LIST = 0x00, // + SMSG_UPDATE_OBJECT = 0x1EE7, // 14545 + SMSG_UPDATE_WORLD_STATE = 0x00, // + SMSG_USERLIST_ADD = 0x00, // + SMSG_USERLIST_REMOVE = 0x00, // + SMSG_USERLIST_UPDATE = 0x00, // + SMSG_VOICE_CHAT_STATUS = 0x00, // + SMSG_VOICE_PARENTAL_CONTROLS = 0x00, // + SMSG_VOICE_SESSION_LEAVE = 0x00, // + SMSG_VOICE_SESSION_ROSTER_UPDATE = 0x00, // + SMSG_VOICE_SET_TALKER_MUTED = 0x00, // + SMSG_WEATHER = 0x00, // + SMSG_WARDEN_DATA = 0x00, // + SMSG_WHO = 0x00, // + SMSG_WHOIS = 0x00, // + SMSG_WORLD_STATE_UI_TIMER_UPDATE = 0x00, // + SMSG_ZONE_UNDER_ATTACK = 0x00, // + + SMSG_VERIFY_CONNECTIVITY = 20311, // 14545 + CMSG_VERIFY_CONNECTIVITY_RESPONSE = 19538, //1280462679, // 14545 special opcode, client sends as uint32 + + SMSG_BATTLEFIELD_STATUS = 0x00, // + SMSG_QUESTUPDATE_ADD_ITEM = 0x00, // + SMSG_OVERRIDE_LIGHT = 0x00, // + CMSG_RANDOMIZE_CHAR_NAME = 35481, // 14545 byte unk, byte race + SMSG_RANDOMIZE_CHAR_NAME = 61660, // 14545 byte unk(0x80), string name }; /// Player state @@ -1368,22 +1038,33 @@ enum PacketProcessing class WorldPacket; +typedef void(WorldSession::*pOpcodeHandler)(WorldPacket& recvPacket); + struct OpcodeHandler { + OpcodeHandler() {} + OpcodeHandler(const char* _name, SessionStatus _status, PacketProcessing _processing, pOpcodeHandler _handler) + : name(_name), status(_status), packetProcessing(_processing), handler(_handler) {} + char const* name; SessionStatus status; PacketProcessing packetProcessing; - void (WorldSession::*handler)(WorldPacket& recvPacket); + pOpcodeHandler handler; }; -extern OpcodeHandler opcodeTable[NUM_MSG_TYPES]; +extern OpcodeHandler* opcodeTable[NUM_OPCODE_HANDLERS]; +void InitOpcodes(); /// Lookup opcode name for human understandable logging -inline const char* LookupOpcodeName(uint16 id) +inline const char* LookupOpcodeName(Opcodes id) { - if (id >= NUM_MSG_TYPES) - return "Received unknown opcode, it's more than max!"; - return opcodeTable[id].name; + if (id < NUM_OPCODE_HANDLERS) + { + OpcodeHandler* handler = opcodeTable[uint32(id)]; + return handler ? handler->name : "UNKNOWN OPCODE"; + } + else + return "UNKNOWN OPCODE"; } #endif /// @} diff --git a/src/server/game/Server/WorldPacket.h b/src/server/game/Server/WorldPacket.h new file mode 100644 index 00000000000..63da8652c7d --- /dev/null +++ b/src/server/game/Server/WorldPacket.h @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2008-2011 TrinityCore + * Copyright (C) 2005-2009 MaNGOS + * + * 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; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; 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, see . + */ + +#ifndef TRINITYCORE_WORLDPACKET_H +#define TRINITYCORE_WORLDPACKET_H + +#include "Common.h" +#include "Opcodes.h" +#include "ByteBuffer.h" + +class WorldPacket : public ByteBuffer +{ + public: + // just container for later use + WorldPacket() : ByteBuffer(0), m_opcode(UNKNOWN_OPCODE) + { + } + explicit WorldPacket(Opcodes opcode, size_t res=200) : ByteBuffer(res), m_opcode(opcode) { } + // copy constructor + WorldPacket(const WorldPacket &packet) : ByteBuffer(packet), m_opcode(packet.m_opcode) + { + } + + void Initialize(Opcodes opcode, size_t newres=200) + { + clear(); + _storage.reserve(newres); + m_opcode = opcode; + } + + Opcodes GetOpcode() const { return m_opcode; } + void SetOpcode(Opcodes opcode) { m_opcode = opcode; } + + protected: + Opcodes m_opcode; +}; +#endif + diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index 14c86286718..75d8ed0f7a0 100755 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -43,16 +43,26 @@ #include "ScriptMgr.h" #include "Transport.h" +Opcodes PacketFilter::DropHighBytes(Opcodes opcode) +{ + if (opcode & 0xFFFF0000) // check if any High byte is present + return Opcodes(opcode >> 16); + + else + return Opcodes(opcode); +} + bool MapSessionFilter::Process(WorldPacket* packet) { - OpcodeHandler const &opHandle = opcodeTable[packet->GetOpcode()]; + Opcodes opcode = DropHighBytes(packet->GetOpcode()); + const OpcodeHandler* opHandle = opcodeTable[opcode]; //let's check if our opcode can be really processed in Map::Update() - if (opHandle.packetProcessing == PROCESS_INPLACE) + if (opHandle->packetProcessing == PROCESS_INPLACE) return true; //we do not process thread-unsafe packets - if (opHandle.packetProcessing == PROCESS_THREADUNSAFE) + if (opHandle->packetProcessing == PROCESS_THREADUNSAFE) return false; Player* player = m_pSession->GetPlayer(); @@ -67,13 +77,14 @@ bool MapSessionFilter::Process(WorldPacket* packet) //OR packet handler is not thread-safe! bool WorldSessionFilter::Process(WorldPacket* packet) { - OpcodeHandler const &opHandle = opcodeTable[packet->GetOpcode()]; + Opcodes opcode = DropHighBytes(packet->GetOpcode()); + const OpcodeHandler* opHandle = opcodeTable[opcode]; //check if packet handler is supposed to be safe - if (opHandle.packetProcessing == PROCESS_INPLACE) + if (opHandle->packetProcessing == PROCESS_INPLACE) return true; //thread-unsafe packets should be processed in World::UpdateSessions() - if (opHandle.packetProcessing == PROCESS_THREADUNSAFE) + if (opHandle->packetProcessing == PROCESS_THREADUNSAFE) return true; //no player attached? -> our client! ^^ @@ -148,6 +159,14 @@ void WorldSession::SendPacket(WorldPacket const* packet) if (!m_Socket) return; + if (packet->GetOpcode() == UNKNOWN_OPCODE) + { + sLog->outError("Sending unknown opcode - prevented. Trace:"); + ACE_Stack_Trace trace; + sLog->outError("%s", trace.c_str()); + return; + } + #ifdef TRINITY_DEBUG // Code for network use statistic static uint64 sendPacketCount = 0; @@ -224,99 +243,91 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) WorldPacket* packet = NULL; while (m_Socket && !m_Socket->IsClosed() && _recvQueue.next(packet, updater)) { - if (packet->GetOpcode() >= NUM_MSG_TYPES) - { - sLog->outError("SESSION: received non-existed opcode %s (0x%.4X)", LookupOpcodeName(packet->GetOpcode()), packet->GetOpcode()); - sScriptMgr->OnUnknownPacketReceive(m_Socket, WorldPacket(*packet)); - } - else + const OpcodeHandler* opHandle = opcodeTable[packet->GetOpcode()]; + try { - OpcodeHandler &opHandle = opcodeTable[packet->GetOpcode()]; - try + switch (opHandle->status) { - switch (opHandle.status) - { - case STATUS_LOGGEDIN: - if (!_player) - { - // skip STATUS_LOGGEDIN opcode unexpected errors if player logout sometime ago - this can be network lag delayed packets - if (!m_playerRecentlyLogout) - LogUnexpectedOpcode(packet, "STATUS_LOGGEDIN", "the player has not logged in yet"); - } - else if (_player->IsInWorld()) - { - sScriptMgr->OnPacketReceive(m_Socket, WorldPacket(*packet)); - (this->*opHandle.handler)(*packet); - if (sLog->IsOutDebug() && packet->rpos() < packet->wpos()) - LogUnprocessedTail(packet); - } - // lag can cause STATUS_LOGGEDIN opcodes to arrive after the player started a transfer - break; - case STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT: - if (!_player && !m_playerRecentlyLogout) - LogUnexpectedOpcode(packet, "STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT", - "the player has not logged in yet and not recently logout"); - else - { - // not expected _player or must checked in packet hanlder - sScriptMgr->OnPacketReceive(m_Socket, WorldPacket(*packet)); - (this->*opHandle.handler)(*packet); - if (sLog->IsOutDebug() && packet->rpos() < packet->wpos()) - LogUnprocessedTail(packet); - } - break; - case STATUS_TRANSFER: - if (!_player) - LogUnexpectedOpcode(packet, "STATUS_TRANSFER", "the player has not logged in yet"); - else if (_player->IsInWorld()) - LogUnexpectedOpcode(packet, "STATUS_TRANSFER", "the player is still in world"); - else - { - sScriptMgr->OnPacketReceive(m_Socket, WorldPacket(*packet)); - (this->*opHandle.handler)(*packet); - if (sLog->IsOutDebug() && packet->rpos() < packet->wpos()) - LogUnprocessedTail(packet); - } - break; - case STATUS_AUTHED: - // prevent cheating with skip queue wait - if (m_inQueue) - { - LogUnexpectedOpcode(packet, "STATUS_AUTHED", "the player not pass queue yet"); - break; - } - - // single from authed time opcodes send in to after logout time - // and before other STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT opcodes. - if (packet->GetOpcode() != CMSG_SET_ACTIVE_VOICE_CHANNEL) - m_playerRecentlyLogout = false; - + case STATUS_LOGGEDIN: + if (!_player) + { + // skip STATUS_LOGGEDIN opcode unexpected errors if player logout sometime ago - this can be network lag delayed packets + if (!m_playerRecentlyLogout) + LogUnexpectedOpcode(packet, "STATUS_LOGGEDIN", "the player has not logged in yet"); + } + else if (_player->IsInWorld()) + { sScriptMgr->OnPacketReceive(m_Socket, WorldPacket(*packet)); - (this->*opHandle.handler)(*packet); + (this->*opHandle->handler)(*packet); if (sLog->IsOutDebug() && packet->rpos() < packet->wpos()) LogUnprocessedTail(packet); + } + // lag can cause STATUS_LOGGEDIN opcodes to arrive after the player started a transfer + break; + case STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT: + if (!_player && !m_playerRecentlyLogout) + LogUnexpectedOpcode(packet, "STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT", + "the player has not logged in yet and not recently logout"); + else + { + // not expected _player or must checked in packet hanlder + sScriptMgr->OnPacketReceive(m_Socket, WorldPacket(*packet)); + (this->*opHandle->handler)(*packet); + if (sLog->IsOutDebug() && packet->rpos() < packet->wpos()) + LogUnprocessedTail(packet); + } + break; + case STATUS_TRANSFER: + if (!_player) + LogUnexpectedOpcode(packet, "STATUS_TRANSFER", "the player has not logged in yet"); + else if (_player->IsInWorld()) + LogUnexpectedOpcode(packet, "STATUS_TRANSFER", "the player is still in world"); + else + { + sScriptMgr->OnPacketReceive(m_Socket, WorldPacket(*packet)); + (this->*opHandle->handler)(*packet); + if (sLog->IsOutDebug() && packet->rpos() < packet->wpos()) + LogUnprocessedTail(packet); + } + break; + case STATUS_AUTHED: + // prevent cheating with skip queue wait + if (m_inQueue) + { + LogUnexpectedOpcode(packet, "STATUS_AUTHED", "the player not pass queue yet"); break; - case STATUS_NEVER: - sLog->outError("SESSION (account: %u, guidlow: %u, char: %s): received not allowed opcode %s (0x%.4X)", - GetAccountId(), m_GUIDLow, _player ? _player->GetName() : "", - LookupOpcodeName(packet->GetOpcode()), packet->GetOpcode()); - break; - case STATUS_UNHANDLED: - sLog->outDebug(LOG_FILTER_NETWORKIO, "SESSION (account: %u, guidlow: %u, char: %s): received not handled opcode %s (0x%.4X)", - GetAccountId(), m_GUIDLow, _player ? _player->GetName() : "", - LookupOpcodeName(packet->GetOpcode()), packet->GetOpcode()); - break; - } + } + + // single from authed time opcodes send in to after logout time + // and before other STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT opcodes. + if (packet->GetOpcode() != CMSG_SET_ACTIVE_VOICE_CHANNEL) + m_playerRecentlyLogout = false; + + sScriptMgr->OnPacketReceive(m_Socket, WorldPacket(*packet)); + (this->*opHandle->handler)(*packet); + if (sLog->IsOutDebug() && packet->rpos() < packet->wpos()) + LogUnprocessedTail(packet); + break; + case STATUS_NEVER: + sLog->outError("SESSION (account: %u, guidlow: %u, char: %s): received not allowed opcode %s (0x%.4X)", + GetAccountId(), m_GUIDLow, _player ? _player->GetName() : "", + LookupOpcodeName(packet->GetOpcode()), packet->GetOpcode()); + break; + case STATUS_UNHANDLED: + sLog->outDebug(LOG_FILTER_NETWORKIO, "SESSION (account: %u, guidlow: %u, char: %s): received not handled opcode %s (0x%.4X)", + GetAccountId(), m_GUIDLow, _player ? _player->GetName() : "", + LookupOpcodeName(packet->GetOpcode()), packet->GetOpcode()); + break; } - catch(ByteBufferException &) + } + catch(ByteBufferException &) + { + sLog->outError("WorldSession::Update ByteBufferException occured while parsing a packet (opcode: %u) from client %s, accountid=%i. Skipped packet.", + packet->GetOpcode(), GetRemoteAddress().c_str(), GetAccountId()); + if (sLog->IsOutDebug()) { - sLog->outError("WorldSession::Update ByteBufferException occured while parsing a packet (opcode: %u) from client %s, accountid=%i. Skipped packet.", - packet->GetOpcode(), GetRemoteAddress().c_str(), GetAccountId()); - if (sLog->IsOutDebug()) - { - sLog->outDebug(LOG_FILTER_NETWORKIO, "Dumping error causing packet:"); - packet->hexlike(); - } + sLog->outDebug(LOG_FILTER_NETWORKIO, "Dumping error causing packet:"); + packet->hexlike(); } } diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 4a83c2d4092..5c4a0b74195 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -147,6 +147,7 @@ public: virtual bool Process(WorldPacket* /*packet*/) { return true; } virtual bool ProcessLogout() const { return true; } + static Opcodes DropHighBytes(Opcodes opcode); protected: WorldSession* const m_pSession; diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index 0ddc03e3d5c..447da4b6d20 100755 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -179,6 +179,8 @@ int WorldSocket::SendPacket (const WorldPacket& pct) sWorldLog->outLog("\n"); } + sLog->outOpCode(uint32(pct.GetOpcode()), LookupOpcodeName(pct.GetOpcode()), true); + // Create a copy of the original packet; this is to avoid issues if a hook modifies it. sScriptMgr->OnPacketSend(this, WorldPacket(pct)); @@ -257,19 +259,9 @@ int WorldSocket::open (void *a) } m_Address = remote_addr.get_host_addr(); - - // Send startup packet. - WorldPacket packet (SMSG_AUTH_CHALLENGE, 24); - packet << uint32(1); // 1...31 - packet << m_Seed; - - BigNumber seed1; - seed1.SetRand(16 * 8); - packet.append(seed1.AsByteArray(16), 16); // new encryption seeds - - BigNumber seed2; - seed2.SetRand(16 * 8); - packet.append(seed2.AsByteArray(16), 16); // new encryption seeds + + WorldPacket packet(SMSG_VERIFY_CONNECTIVITY); + packet << "RLD OF WARCRAFT CONNECTION - SERVER TO CLIENT"; if (SendPacket(packet) == -1) return -1; @@ -493,7 +485,7 @@ int WorldSocket::handle_input_header (void) EndianConvertReverse(header.size); EndianConvert(header.cmd); - if ((header.size < 4) || (header.size > 10240) || (header.cmd > 10240)) + if ((header.size < 4) || (header.size > 10240)) { Player* _player = m_Session ? m_Session->GetPlayer() : NULL; sLog->outError ("WorldSocket::handle_input_header(): client (account: %u, char [GUID: %u, name: %s]) sent malformed packet (size: %d, cmd: %d)", @@ -508,7 +500,7 @@ int WorldSocket::handle_input_header (void) header.size -= 4; - ACE_NEW_RETURN (m_RecvWPct, WorldPacket ((uint16) header.cmd, header.size), -1); + ACE_NEW_RETURN (m_RecvWPct, WorldPacket (PacketFilter::DropHighBytes(Opcodes(header.cmd)), header.size), -1); if (header.size > 0) { @@ -681,7 +673,7 @@ int WorldSocket::ProcessIncoming (WorldPacket* new_pct) // manage memory ;) ACE_Auto_Ptr aptr (new_pct); - const ACE_UINT16 opcode = new_pct->GetOpcode(); + const ACE_UINT16 opcode = PacketFilter::DropHighBytes(new_pct->GetOpcode()); if (closing_) return -1; @@ -706,6 +698,8 @@ int WorldSocket::ProcessIncoming (WorldPacket* new_pct) sWorldLog->outLog ("\n"); } + sLog->outOpCode(uint32(Opcodes(opcode)), LookupOpcodeName(Opcodes(opcode)), false); + try { switch (opcode) @@ -725,10 +719,23 @@ int WorldSocket::ProcessIncoming (WorldPacket* new_pct) sLog->outStaticDebug ("CMSG_KEEP_ALIVE, size: " UI64FMTD, uint64(new_pct->size())); sScriptMgr->OnPacketReceive(this, WorldPacket(*new_pct)); return 0; + case CMSG_LOG_DISCONNECT: + sLog->outStaticDebug("CMSG_LOG_DISCONNECT , size: " UI64FMTD, uint64(new_pct->size())); + sScriptMgr->OnPacketReceive(this, WorldPacket(*new_pct)); + return 0; + case CMSG_VERIFY_CONNECTIVITY_RESPONSE: + sLog->outStaticDebug("CMSG_VERIFY_CONNECTIVITY_RESPONSE , size: " UI64FMTD, uint64(new_pct->size())); + sScriptMgr->OnPacketReceive(this, WorldPacket(*new_pct)); + return HandleSendAuthSession(); + default: { ACE_GUARD_RETURN (LockType, Guard, m_SessionLock, -1); - + if (!opcodeTable[Opcodes(opcode)]) + { + sLog->outError("Opcode with no defined handler received from client: %u", new_pct->GetOpcode()); + return 0; + } if (m_Session != NULL) { // Our Idle timer will reset on any non PING opcodes. @@ -766,23 +773,66 @@ int WorldSocket::ProcessIncoming (WorldPacket* new_pct) ACE_NOTREACHED (return 0); } -int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) +int WorldSocket::HandleSendAuthSession() +{ + WorldPacket packet(SMSG_AUTH_CHALLENGE, 37); + packet << uint32(0); + packet << uint32(0); + packet << uint32(0); + packet << uint32(0); + packet << m_Seed; + packet << uint8(1); + packet << uint32(0); + packet << uint32(0); + packet << uint32(0); + packet << uint32(0); + return SendPacket(packet); +} + +int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) { - // NOTE: ATM the socket is singlethread, have this in mind ... uint8 digest[20]; + uint16 clientBuild, security; + uint32 id; + uint32 m_addonSize; uint32 clientSeed; - uint32 unk2, unk3, unk5, unk6, unk7; - uint64 unk4; - uint32 BuiltNumberClient; - uint32 id, security; - //uint8 expansion = 0; - LocaleConstant locale; std::string account; + LocaleConstant locale; + SHA1Hash sha1; - BigNumber v, s, g, N; - WorldPacket packet, SendAddonPacked; + BigNumber v, s, g, N, K; + WorldPacket packet; + + recvPacket.read_skip(); + recvPacket.read(digest, 5); + recvPacket >> clientBuild; + recvPacket.read(digest, 2); + recvPacket.read_skip(); + recvPacket.read_skip(); + recvPacket.read(digest, 4); + recvPacket.read_skip(); + recvPacket.read_skip(); + recvPacket.read(digest, 2); + recvPacket.read_skip(); + recvPacket.read(digest, 4); + recvPacket >> clientSeed; + recvPacket.read(digest, 2); + recvPacket.read_skip(); + recvPacket.read(digest, 1); + recvPacket.read_skip(); + recvPacket >> account; + recvPacket >> m_addonSize; - BigNumber K; + uint8 * tableauAddon = new uint8[m_addonSize]; + WorldPacket packetAddon; + for (uint32 i = 0; i < m_addonSize; i++) + { + uint8 ByteSize = 0; + recvPacket >> ByteSize; + tableauAddon[i] = ByteSize; + packetAddon << ByteSize; + } + delete tableauAddon; if (sWorld->IsClosed()) { @@ -790,47 +840,30 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) packet << uint8(AUTH_REJECT); SendPacket (packet); - sLog->outError ("WorldSocket::HandleAuthSession: World closed, denying client (%s).", GetRemoteAddress().c_str()); + sLog->outError("WorldSocket::HandleAuthSession: World closed, denying client (%s).", GetRemoteAddress().c_str()); return -1; } - // Read the content of the packet - recvPacket >> BuiltNumberClient; // for now no use - recvPacket >> unk2; - recvPacket >> account; - recvPacket >> unk3; - recvPacket >> clientSeed; - recvPacket >> unk5 >> unk6 >> unk7; - recvPacket >> unk4; - recvPacket.read(digest, 20); - - sLog->outStaticDebug ("WorldSocket::HandleAuthSession: client %u, unk2 %u, account %s, unk3 %u, clientseed %u", - BuiltNumberClient, - unk2, - account.c_str(), - unk3, - clientSeed); - // Get the account information from the realmd database std::string safe_account = account; // Duplicate, else will screw the SHA hash verification below LoginDatabase.EscapeString (safe_account); // No SQL injection, username escaped. QueryResult result = - LoginDatabase.PQuery ("SELECT " - "id, " //0 - "sessionkey, " //1 - "last_ip, " //2 - "locked, " //3 - "v, " //4 - "s, " //5 - "expansion, " //6 - "mutetime, " //7 - "locale, " //8 - "recruiter " //9 - "FROM account " - "WHERE username = '%s'", - safe_account.c_str()); + LoginDatabase.PQuery ("SELECT " + "id, " //0 + "sessionkey, " //1 + "last_ip, " //2 + "locked, " //3 + "v, " //4 + "s, " //5 + "expansion, " //6 + "mutetime, " //7 + "locale, " //8 + "recruiter " //9 + "FROM account " + "WHERE username = '%s'", + safe_account.c_str()); // Stop if the account is not found if (!result) @@ -860,9 +893,9 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) const char* sStr = s.AsHexStr(); //Must be freed by OPENSSL_free() const char* vStr = v.AsHexStr(); //Must be freed by OPENSSL_free() - sLog->outStaticDebug ("WorldSocket::HandleAuthSession: (s, v) check s: %s v: %s", - sStr, - vStr); + sLog->outStaticDebug ("WorldSocket::HandleAuthSession: (s,v) check s: %s v: %s", + sStr, + vStr); OPENSSL_free ((void*) sStr); OPENSSL_free ((void*) vStr); @@ -882,15 +915,14 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) } id = fields[0].GetUInt32(); + /* + if (security > SEC_ADMINISTRATOR) // prevent invalid security settings in DB + security = SEC_ADMINISTRATOR; + */ + K.SetHexStr (fields[1].GetCString()); - int64 mutetime = fields[7].GetInt64(); - //! Negative mutetime indicates amount of seconds to be muted effective on next login - which is now. - if (mutetime < 0) - { - mutetime = time(NULL) + llabs(mutetime); - LoginDatabase.PExecute("UPDATE account SET mutetime = " SI64FMTD " WHERE id = '%u'", mutetime, id); - } + time_t mutetime = time_t (fields[7].GetUInt64()); locale = LocaleConstant (fields[8].GetUInt8()); if (locale >= TOTAL_LOCALES) @@ -899,15 +931,14 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) uint32 recruiter = fields[9].GetUInt32(); // Checks gmlevel per Realm - result = - LoginDatabase.PQuery ("SELECT " - "RealmID, " //0 - "gmlevel " //1 - "FROM account_access " - "WHERE id = '%d'" - " AND (RealmID = '%d'" - " OR RealmID = '-1')", - id, realmID); + result = LoginDatabase.PQuery ("SELECT " + "RealmID, " //0 + "gmlevel " //1 + "FROM account_access " + "WHERE id = '%d'" + " AND (RealmID = '%d'" + " OR RealmID = '-1')", + id, realmID); if (!result) security = 0; else @@ -918,10 +949,10 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) // Re-check account ban (same check as in realmd) QueryResult banresult = - LoginDatabase.PQuery ("SELECT 1 FROM account_banned WHERE id = %u AND active = 1 " - "UNION " - "SELECT 1 FROM ip_banned WHERE ip = '%s'", - id, GetRemoteAddress().c_str()); + LoginDatabase.PQuery ("SELECT 1 FROM account_banned WHERE id = %u AND active = 1 " + "UNION " + "SELECT 1 FROM ip_banned WHERE ip = '%s'", + id, GetRemoteAddress().c_str()); if (banresult) // if account banned { @@ -936,7 +967,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) // Check locked state for server AccountTypes allowedAccountType = sWorld->GetPlayerSecurityLimit(); sLog->outDebug(LOG_FILTER_NETWORKIO, "Allowed Level: %u Player Level %u", allowedAccountType, AccountTypes(security)); - if (AccountTypes(security) < allowedAccountType) + if (allowedAccountType > SEC_PLAYER && AccountTypes(security) < allowedAccountType) { WorldPacket Packet (SMSG_AUTH_RESPONSE, 1); Packet << uint8 (AUTH_UNAVAILABLE); @@ -960,22 +991,11 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) sha.UpdateBigNumbers (&K, NULL); sha.Finalize(); - if (memcmp (sha.GetDigest(), digest, 20)) - { - packet.Initialize (SMSG_AUTH_RESPONSE, 1); - packet << uint8 (AUTH_FAILED); - - SendPacket (packet); - - sLog->outError ("WorldSocket::HandleAuthSession: Sent Auth Response (authentification failed)."); - return -1; - } - std::string address = GetRemoteAddress(); sLog->outStaticDebug ("WorldSocket::HandleAuthSession: Client '%s' authenticated successfully from %s.", - account.c_str(), - address.c_str()); + account.c_str(), + address.c_str()); // Check if this user is by any chance a recruiter result = LoginDatabase.PQuery ("SELECT 1 FROM account WHERE recruiter = %u", id); @@ -989,10 +1009,10 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) LoginDatabase.EscapeString (address); LoginDatabase.PExecute ("UPDATE account " - "SET last_ip = '%s' " - "WHERE username = '%s'", - address.c_str(), - safe_account.c_str()); + "SET last_ip = '%s' " + "WHERE username = '%s'", + address.c_str(), + safe_account.c_str()); // NOTE ATM the socket is single-threaded, have this in mind ... ACE_NEW_RETURN (m_Session, WorldSession (id, this, AccountTypes(security), expansion, mutetime, locale, recruiter, isRecruiter), -1); @@ -1001,7 +1021,8 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) m_Session->LoadGlobalAccountData(); m_Session->LoadTutorialsData(); - m_Session->ReadAddonsInfo(recvPacket); + packetAddon.rpos(0); + m_Session->ReadAddonsInfo(packetAddon); // Sleep this Network thread for uint32 sleepTime = sWorld->getIntConfig(CONFIG_SESSION_ADD_DELAY); diff --git a/src/server/game/Server/WorldSocket.h b/src/server/game/Server/WorldSocket.h index aa7424085f8..3c3f61c339d 100755 --- a/src/server/game/Server/WorldSocket.h +++ b/src/server/game/Server/WorldSocket.h @@ -161,6 +161,9 @@ class WorldSocket : public WorldHandler /// Called by ProcessIncoming() on CMSG_PING. int HandlePing (WorldPacket& recvPacket); + /// Called by CMSG_VERIFY_CONNECTIVITY_RESPONSE + int HandleSendAuthSession(); + private: /// Time in which the last ping was received ACE_Time_Value m_LastPingTime; diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index dc56e04c3b5..29ad870448e 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -53,6 +53,7 @@ #include "SpellScript.h" #include "InstanceScript.h" #include "SpellInfo.h" +#include "DB2Stores.h" extern pEffect SpellEffects[TOTAL_SPELL_EFFECTS]; diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 408db187aae..e15ef02058f 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -45,6 +45,7 @@ #include "GroupMgr.h" #include "Chat.h" #include "DBCStores.h" +#include "DB2Stores.h" #include "LootMgr.h" #include "ItemEnchantmentMgr.h" #include "MapManager.h" @@ -1257,6 +1258,7 @@ void World::SetInitialWorldSettings() ///- Load the DBC files sLog->outString("Initialize data stores..."); LoadDBCStores(m_dataPath); + LoadDB2Stores(m_dataPath); DetectDBCLang(); sLog->outString("Loading spell dbc data corrections..."); @@ -1739,6 +1741,9 @@ void World::SetInitialWorldSettings() else sLog->SetLogDB(false); + sLog->outString("Initializing Opcodes..."); + InitOpcodes(); + uint32 startupDuration = GetMSTimeDiffToNow(startupBegin); sLog->outString(); sLog->outString("WORLD: World initialized in %u minutes %u seconds", (startupDuration / 60000), ((startupDuration % 60000) / 1000) ); diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h index b493b8b0c7b..e08e78a50bd 100755 --- a/src/server/game/World/World.h +++ b/src/server/game/World/World.h @@ -213,8 +213,10 @@ enum WorldIntConfigs CONFIG_START_PLAYER_MONEY, CONFIG_MAX_HONOR_POINTS, CONFIG_START_HONOR_POINTS, - CONFIG_MAX_ARENA_POINTS, - CONFIG_START_ARENA_POINTS, + CONFIG_MAX_JUSTICE_POINTS, + CONFIG_START_JUSTICE_POINTS, + CONFIG_MAX_ARENA_POINTS,//todo: remove + CONFIG_START_ARENA_POINTS,//todo: remove CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL, CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL_DIFFERENCE, CONFIG_INSTANCE_RESET_TIME_HOUR, diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index 9e1d5717f1f..d47b04f3bcb 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -307,7 +307,7 @@ public: uint32 opcode; parsedStream >> opcode; - WorldPacket data(opcode, 0); + WorldPacket data(Opcodes(opcode), 0); while (!parsedStream.eof()) { diff --git a/src/server/scripts/Commands/cs_gm.cpp b/src/server/scripts/Commands/cs_gm.cpp index ab077af0863..6135e231c24 100644 --- a/src/server/scripts/Commands/cs_gm.cpp +++ b/src/server/scripts/Commands/cs_gm.cpp @@ -95,7 +95,7 @@ public: if (!target) target = handler->GetSession()->GetPlayer(); - WorldPacket data(12); + WorldPacket data; if (strncmp(args, "on", 3) == 0) data.SetOpcode(SMSG_MOVE_SET_CAN_FLY); else if (strncmp(args, "off", 4) == 0) diff --git a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp index ae0042dcfa5..ad1da3896c5 100644 --- a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp +++ b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp @@ -236,7 +236,7 @@ class instance_deadmines : public InstanceMapScript void DoPlaySound(GameObject* unit, uint32 sound) { - WorldPacket data(4); + WorldPacket data; data.SetOpcode(SMSG_PLAY_SOUND); data << uint32(sound); unit->SendMessageToSet(&data, false); @@ -244,7 +244,7 @@ class instance_deadmines : public InstanceMapScript void DoPlaySoundCreature(Unit* unit, uint32 sound) { - WorldPacket data(4); + WorldPacket data; data.SetOpcode(SMSG_PLAY_SOUND); data << uint32(sound); unit->SendMessageToSet(&data, false); diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp index c64fc6f2dab..cc3a8ca7109 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp @@ -241,8 +241,7 @@ public: // Also needs an exception in spell system. unit->CastSpell(unit, SPELL_GRAVITY_LAPSE_FLY, true, 0, 0, me->GetGUID()); // Use packet hack - WorldPacket data(12); - data.SetOpcode(SMSG_MOVE_SET_CAN_FLY); + WorldPacket data(SMSG_MOVE_SET_CAN_FLY, 12); data.append(unit->GetPackGUID()); data << uint32(0); unit->SendMessageToSet(&data, true); @@ -261,8 +260,7 @@ public: unit->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_FLY); unit->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_DOT); - WorldPacket data(12); - data.SetOpcode(SMSG_MOVE_UNSET_CAN_FLY); + WorldPacket data(SMSG_MOVE_UNSET_CAN_FLY, 12); data.append(unit->GetPackGUID()); data << uint32(0); unit->SendMessageToSet(&data, true); diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp index d987601c5bd..0a91828024c 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp @@ -922,8 +922,7 @@ class boss_kaelthas : public CreatureScript unit->CastSpell(unit, SPELL_GRAVITY_LAPSE_AURA, true, 0, 0, me->GetGUID()); //Using packet workaround - WorldPacket data(12); - data.SetOpcode(SMSG_MOVE_SET_CAN_FLY); + WorldPacket data(SMSG_MOVE_SET_CAN_FLY, 12); data.append(unit->GetPackGUID()); data << uint32(0); unit->SendMessageToSet(&data, true); @@ -949,8 +948,7 @@ class boss_kaelthas : public CreatureScript if (Unit* unit = Unit::GetUnit((*me), (*i)->getUnitGuid())) { //Using packet workaround - WorldPacket data(12); - data.SetOpcode(SMSG_MOVE_UNSET_CAN_FLY); + WorldPacket data(SMSG_MOVE_UNSET_CAN_FLY, 12); data.append(unit->GetPackGUID()); data << uint32(0); unit->SendMessageToSet(&data, true); diff --git a/src/server/shared/DataStores/DB2FileLoader.cpp b/src/server/shared/DataStores/DB2FileLoader.cpp new file mode 100644 index 00000000000..2b3e82764cf --- /dev/null +++ b/src/server/shared/DataStores/DB2FileLoader.cpp @@ -0,0 +1,411 @@ +/* + * Copyright (C) 2011 TrintiyCore + * + * 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; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; 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, see . + */ + +#include "Common.h" + +#include +#include +#include +#include "DB2FileLoader.h" + +DB2FileLoader::DB2FileLoader() +{ + data = NULL; + fieldsOffset = NULL; +} + +bool DB2FileLoader::Load(const char *filename, const char *fmt) +{ + uint32 header = 48; + if (data) + { + delete [] data; + data=NULL; + } + + FILE * f = fopen(filename, "rb"); + if (!f) + return false; + + if (fread(&header, 4, 1, f) != 1) // Signature + { + fclose(f); + return false; + } + + EndianConvert(header); + + if (header != 0x32424457) + { + fclose(f); + return false; //'WDB2' + } + + if (fread(&recordCount, 4, 1, f) != 1) // Number of records + { + fclose(f); + return false; + } + + EndianConvert(recordCount); + + if (fread(&fieldCount, 4, 1, f) != 1) // Number of fields + { + fclose(f); + return false; + } + + EndianConvert(fieldCount); + + if (fread(&recordSize, 4, 1, f) != 1) // Size of a record + { + fclose(f); + return false; + } + + EndianConvert(recordSize); + + if (fread(&stringSize, 4, 1, f) != 1) // String size + { + fclose(f); + return false; + } + + EndianConvert(stringSize); + + /* NEW WDB2 FIELDS*/ + if (fread(&tableHash, 4, 1, f) != 1) // Table hash + { + fclose(f); + return false; + } + + EndianConvert(tableHash); + + if (fread(&build, 4, 1, f) != 1) // Build + { + fclose(f); + return false; + } + + EndianConvert(build); + + if (fread(&unk1, 4, 1, f) != 1) // Unknown WDB2 + { + fclose(f); + return false; + } + + EndianConvert(unk1); + + if (build > 12880) + { + if (fread(&unk2, 4, 1, f) != 1) // Unknown WDB2 + { + fclose(f); + return false; + } + EndianConvert(unk2); + + if (fread(&maxIndex, 4, 1, f) != 1) // MaxIndex WDB2 + { + fclose(f); + return false; + } + EndianConvert(maxIndex); + + if (fread(&locale, 4, 1, f) != 1) // Locales + { + fclose(f); + return false; + } + EndianConvert(locale); + + if (fread(&unk5, 4, 1, f) != 1) // Unknown WDB2 + { + fclose(f); + return false; + } + EndianConvert(unk5); + } + + if (maxIndex != 0) + { + int32 diff = maxIndex - unk2 + 1; + fseek(f, diff * 4 + diff * 2, SEEK_CUR); // diff * 4: an index for rows, diff * 2: a memory allocation bank + } + + fieldsOffset = new uint32[fieldCount]; + fieldsOffset[0] = 0; + for (uint32 i = 1; i < fieldCount; i++) + { + fieldsOffset[i] = fieldsOffset[i - 1]; + if (fmt[i - 1] == 'b' || fmt[i - 1] == 'X') + fieldsOffset[i] += 1; + else + fieldsOffset[i] += 4; + } + + data = new unsigned char[recordSize*recordCount+stringSize]; + stringTable = data + recordSize*recordCount; + + if (fread(data, recordSize * recordCount + stringSize, 1, f) != 1) + { + fclose(f); + return false; + } + + fclose(f); + return true; +} + +DB2FileLoader::~DB2FileLoader() +{ + if (data) + delete [] data; + if (fieldsOffset) + delete [] fieldsOffset; +} + +DB2FileLoader::Record DB2FileLoader::getRecord(size_t id) +{ + assert(data); + return Record(*this, data + id*recordSize); +} + +uint32 DB2FileLoader::GetFormatRecordSize(const char * format, int32* index_pos) +{ + uint32 recordsize = 0; + int32 i = -1; + for (uint32 x=0; format[x]; ++x) + { + switch(format[x]) + { + case FT_FLOAT: + case FT_INT: + recordsize += 4; + break; + case FT_STRING: + recordsize += sizeof(char*); + break; + case FT_SORT: + i = x; + break; + case FT_IND: + i = x; + recordsize += 4; + break; + case FT_BYTE: + recordsize += 1; + break; + } + } + + if (index_pos) + *index_pos = i; + + return recordsize; +} + +uint32 DB2FileLoader::GetFormatStringsFields(const char * format) +{ + uint32 stringfields = 0; + for (uint32 x=0; format[x]; ++x) + if (format[x] == FT_STRING) + ++stringfields; + + return stringfields; +} + +char* DB2FileLoader::AutoProduceData(const char* format, uint32& records, char**& indexTable) +{ + + typedef char * ptr; + if (strlen(format) != fieldCount) + return NULL; + + //get struct size and index pos + int32 i; + uint32 recordsize=GetFormatRecordSize(format, &i); + + if (i >= 0) + { + uint32 maxi = 0; + //find max index + for (uint32 y = 0; y < recordCount; y++) + { + uint32 ind=getRecord(y).getUInt(i); + if (ind>maxi) + maxi = ind; + } + + ++maxi; + records = maxi; + indexTable = new ptr[maxi]; + memset(indexTable, 0, maxi * sizeof(ptr)); + } + else + { + records = recordCount; + indexTable = new ptr[recordCount]; + } + + char* dataTable = new char[recordCount * recordsize]; + + uint32 offset=0; + + for (uint32 y =0; y < recordCount; y++) + { + if (i>=0) + { + indexTable[getRecord(y).getUInt(i)] = &dataTable[offset]; + } + else + indexTable[y] = &dataTable[offset]; + + for (uint32 x = 0; x < fieldCount; x++) + { + switch(format[x]) + { + case FT_FLOAT: + *((float*)(&dataTable[offset])) = getRecord(y).getFloat(x); + offset += 4; + break; + case FT_IND: + case FT_INT: + *((uint32*)(&dataTable[offset])) = getRecord(y).getUInt(x); + offset += 4; + break; + case FT_BYTE: + *((uint8*)(&dataTable[offset])) = getRecord(y).getUInt8(x); + offset += 1; + break; + case FT_STRING: + *((char**)(&dataTable[offset])) = NULL; // will be replaces non-empty or "" strings in AutoProduceStrings + offset += sizeof(char*); + break; + } + } + } + + return dataTable; +} + +static char const* const nullStr = ""; + +char* DB2FileLoader::AutoProduceStringsArrayHolders(const char* format, char* dataTable) +{ + if (strlen(format) != fieldCount) + return NULL; + + // we store flat holders pool as single memory block + size_t stringFields = GetFormatStringsFields(format); + // each string field at load have array of string for each locale + size_t stringHolderSize = sizeof(char*) * TOTAL_LOCALES; + size_t stringHoldersRecordPoolSize = stringFields * stringHolderSize; + size_t stringHoldersPoolSize = stringHoldersRecordPoolSize * recordCount; + + char* stringHoldersPool = new char[stringHoldersPoolSize]; + + // DB2 strings expected to have at least empty string + for (size_t i = 0; i < stringHoldersPoolSize / sizeof(char*); ++i) + ((char const**)stringHoldersPool)[i] = nullStr; + + uint32 offset=0; + + // assign string holders to string field slots + for (uint32 y = 0; y < recordCount; y++) + { + uint32 stringFieldNum = 0; + + for(uint32 x = 0; x < fieldCount; x++) + switch(format[x]) + { + case FT_FLOAT: + case FT_IND: + case FT_INT: + offset += 4; + break; + case FT_BYTE: + offset += 1; + break; + case FT_STRING: + { + // init db2 string field slots by pointers to string holders + char const*** slot = (char const***)(&dataTable[offset]); + *slot = (char const**)(&stringHoldersPool[stringHoldersRecordPoolSize * y + stringHolderSize*stringFieldNum]); + ++stringFieldNum; + offset += sizeof(char*); + break; + } + case FT_NA: + case FT_NA_BYTE: + case FT_SORT: + break; + default: + assert(false && "unknown format character"); + } + } + + //send as char* for store in char* pool list for free at unload + return stringHoldersPool; +} + +char* DB2FileLoader::AutoProduceStrings(const char* format, char* dataTable) +{ + if (strlen(format) != fieldCount) + return NULL; + + // each string field at load have array of string for each locale + size_t stringHolderSize = sizeof(char*) * TOTAL_LOCALES; + + char* stringPool= new char[stringSize]; + memcpy(stringPool, stringTable, stringSize); + + uint32 offset = 0; + + for (uint32 y =0; y < recordCount; y++) + { + for (uint32 x = 0; x < fieldCount; x++) + switch(format[x]) + { + case FT_FLOAT: + case FT_IND: + case FT_INT: + offset += 4; + break; + case FT_BYTE: + offset += 1; + break; + case FT_STRING: + { + // fill only not filled entries + char** slot = (char**)(&dataTable[offset]); + if (**((char***)slot) == nullStr) + { + const char * st = getRecord(y).getString(x); + *slot=stringPool + (st-(const char*)stringTable); + } + + offset+=sizeof(char*); + break; + } + } + } + + return stringPool; +} \ No newline at end of file diff --git a/src/server/shared/DataStores/DB2FileLoader.h b/src/server/shared/DataStores/DB2FileLoader.h new file mode 100644 index 00000000000..c30e33c29f6 --- /dev/null +++ b/src/server/shared/DataStores/DB2FileLoader.h @@ -0,0 +1,106 @@ +/* + * Copyright (C) 2011 TrintiyCore + * + * 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; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; 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, see . + */ + +#ifndef DB2_FILE_LOADER_H +#define DB2_FILE_LOADER_H + +#include "Define.h" +#include "Utilities/ByteConverter.h" +#include + +class DB2FileLoader +{ + public: + DB2FileLoader(); + ~DB2FileLoader(); + + bool Load(const char *filename, const char *fmt); + + class Record + { + public: + float getFloat(size_t field) const + { + assert(field < file.fieldCount); + float val = *reinterpret_cast(offset+file.GetOffset(field)); + EndianConvert(val); + return val; + } + uint32 getUInt(size_t field) const + { + assert(field < file.fieldCount); + uint32 val = *reinterpret_cast(offset+file.GetOffset(field)); + EndianConvert(val); + return val; + } + uint8 getUInt8(size_t field) const + { + assert(field < file.fieldCount); + return *reinterpret_cast(offset+file.GetOffset(field)); + } + + const char *getString(size_t field) const + { + assert(field < file.fieldCount); + size_t stringOffset = getUInt(field); + assert(stringOffset < file.stringSize); + return reinterpret_cast(file.stringTable + stringOffset); + } + + private: + Record(DB2FileLoader &file_, unsigned char *offset_): offset(offset_), file(file_) {} + unsigned char *offset; + DB2FileLoader &file; + + friend class DB2FileLoader; + }; + + // Get record by id + Record getRecord(size_t id); + /// Get begin iterator over records + + uint32 GetNumRows() const { return recordCount;} + uint32 GetCols() const { return fieldCount; } + uint32 GetOffset(size_t id) const { return (fieldsOffset != NULL && id < fieldCount) ? fieldsOffset[id] : 0; } + bool IsLoaded() const { return (data != NULL); } + char* AutoProduceData(const char* fmt, uint32& count, char**& indexTable); + char* AutoProduceStringsArrayHolders(const char* fmt, char* dataTable); + char* AutoProduceStrings(const char* fmt, char* dataTable); + static uint32 GetFormatRecordSize(const char * format, int32 * index_pos = NULL); + static uint32 GetFormatStringsFields(const char * format); +private: + + uint32 recordSize; + uint32 recordCount; + uint32 fieldCount; + uint32 stringSize; + uint32 *fieldsOffset; + unsigned char *data; + unsigned char *stringTable; + + // WDB2 / WCH2 fields + uint32 tableHash; // WDB2 + uint32 build; // WDB2 + + int unk1; // WDB2 (Unix time in WCH2) + int unk2; // WDB2 + int maxIndex; // WDB2 (index table) + int locale; // WDB2 + int unk5; // WDB2 +}; + +#endif \ No newline at end of file diff --git a/src/server/shared/DataStores/DB2Store.h b/src/server/shared/DataStores/DB2Store.h new file mode 100644 index 00000000000..a90dba5d768 --- /dev/null +++ b/src/server/shared/DataStores/DB2Store.h @@ -0,0 +1,141 @@ +/* + * Copyright (C) 2011 TrintiyCore + * + * 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; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; 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, see . + */ + +#ifndef DB2STORE_H +#define DB2STORE_H + +#include "DB2FileLoader.h" +#include "DB2fmt.h" +#include "Logging/Log.h" +#include "Field.h" +#include "DatabaseWorkerPool.h" +#include "Implementation/WorldDatabase.h" +#include "DatabaseEnv.h" + +#include + +template +class DB2Storage +{ + typedef std::list StringPoolList; + typedef std::vector DataTableEx; +public: + explicit DB2Storage(const char *f) : nCount(0), fieldCount(0), fmt(f), indexTable(NULL), m_dataTable(NULL) { } + ~DB2Storage() { Clear(); } + + T const* LookupEntry(uint32 id) const { return (id>=nCount)?NULL:indexTable[id]; } + uint32 GetNumRows() const { return nCount; } + char const* GetFormat() const { return fmt; } + uint32 GetFieldCount() const { return fieldCount; } + + /// Copies the provided entry and stores it. + void AddEntry(uint32 id, const T* entry) + { + if (LookupEntry(id)) + return; + + if (id >= nCount) + { + // reallocate index table + char** tmpIdxTable = new char*[id+1]; + memset(tmpIdxTable, 0, (id+1) * sizeof(char*)); + memcpy(tmpIdxTable, (char*)indexTable, nCount * sizeof(char*)); + delete[] ((char*)indexTable); + nCount = id + 1; + indexTable = (T**)tmpIdxTable; + } + + T* entryDst = new T; + memcpy((char*)entryDst, (char*)entry, sizeof(T)); + m_dataTableEx.push_back(entryDst); + indexTable[id] = entryDst; + } + + bool Load(char const* fn) + { + DB2FileLoader db2; + // Check if load was sucessful, only then continue + if (!db2.Load(fn, fmt)) + return false; + + fieldCount = db2.GetCols(); + + // load raw non-string data + m_dataTable = (T*)db2.AutoProduceData(fmt, nCount, (char**&)indexTable); + + // create string holders for loaded string fields + m_stringPoolList.push_back(db2.AutoProduceStringsArrayHolders(fmt, (char*)m_dataTable)); + + // load strings from dbc data + m_stringPoolList.push_back(db2.AutoProduceStrings(fmt, (char*)m_dataTable)); + + // error in dbc file at loading if NULL + return indexTable!=NULL; + } + + bool LoadStringsFrom(char const* fn) + { + // DBC must be already loaded using Load + if (!indexTable) + return false; + + DB2FileLoader db2; + // Check if load was successful, only then continue + if (!db2.Load(fn, fmt)) + return false; + + // load strings from another locale dbc data + m_stringPoolList.push_back(db2.AutoProduceStrings(fmt, (char*)m_dataTable)); + + return true; + } + + void Clear() + { + if (!indexTable) + return; + + delete[] ((char*)indexTable); + indexTable = NULL; + delete[] ((char*)m_dataTable); + m_dataTable = NULL; + for (DataTableEx::const_iterator itr = m_dataTableEx.begin(); itr != m_dataTableEx.end(); ++itr) + delete *itr; + m_dataTableEx.clear(); + + while (!m_stringPoolList.empty()) + { + delete[] m_stringPoolList.front(); + m_stringPoolList.pop_front(); + } + nCount = 0; + } + + void EraseEntry(uint32 id) { indexTable[id] = NULL; } + +private: + uint32 nCount; + uint32 fieldCount; + uint32 recordSize; + char const* fmt; + T** indexTable; + T* m_dataTable; + DataTableEx m_dataTableEx; + StringPoolList m_stringPoolList; +}; + +#endif \ No newline at end of file diff --git a/src/server/shared/DataStores/DBCFileLoader.h b/src/server/shared/DataStores/DBCFileLoader.h index b2d99e9302f..087827c184b 100755 --- a/src/server/shared/DataStores/DBCFileLoader.h +++ b/src/server/shared/DataStores/DBCFileLoader.h @@ -22,7 +22,7 @@ #include "Utilities/ByteConverter.h" #include -enum +/*enum { FT_NA='x', //not used or unknown, 4 byte size FT_NA_BYTE='X', //not used or unknown, byte @@ -35,7 +35,7 @@ enum FT_LOGIC='l', //Logical (boolean) FT_SQL_PRESENT='p', //Used in sql format to mark column present in sql dbc FT_SQL_ABSENT='a' //Used in sql format to mark column absent in sql dbc -}; +};*/ class DBCFileLoader { diff --git a/src/server/shared/Define.h b/src/server/shared/Define.h index 42663fb6bd4..c590c3bf918 100755 --- a/src/server/shared/Define.h +++ b/src/server/shared/Define.h @@ -79,4 +79,21 @@ typedef ACE_UINT32 uint32; typedef ACE_UINT16 uint16; typedef ACE_UINT8 uint8; +typedef char const* const* DBCString; //char* DBCStrings[MAX_LOCALE]; +typedef char const* const* DB2String; //char* DB2Strings[MAX_LOCALE]; + +enum +{ + FT_NA='x', //not used or unknown, 4 byte size + FT_NA_BYTE='X', //not used or unknown, byte + FT_STRING='s', //char* + FT_FLOAT='f', //float + FT_INT='i', //uint32 + FT_BYTE='b', //uint8 + FT_SORT='d', //sorted by this field, field is not included + FT_IND='n', //the same, but parsed to data + FT_LOGIC='l', //Logical (boolean) + FT_SQL_PRESENT='p', //Used in sql format to mark column present in sql dbc + FT_SQL_ABSENT='a' //Used in sql format to mark column absent in sql dbc +}; #endif //TRINITY_DEFINE_H diff --git a/src/server/shared/Logging/Log.cpp b/src/server/shared/Logging/Log.cpp index 15008f13c10..a83a7a46d0b 100755 --- a/src/server/shared/Logging/Log.cpp +++ b/src/server/shared/Logging/Log.cpp @@ -986,6 +986,13 @@ void Log::outCharDump(const char * str, uint32 account_id, uint32 guid, const ch } } +void Log::outOpCode(uint32 op, const char * name, bool smsg) +{ + if (!(m_DebugLogMask & LOG_FILTER_OPCODES)) + return; + outString("%s: %s 0x%.4X (%u)", smsg ? "S->C" : "C->S", name, op, op); +} + void Log::outRemote(const char * str, ...) { if (!str) diff --git a/src/server/shared/Logging/Log.h b/src/server/shared/Logging/Log.h index 5b2eb6aafb6..d17fbf2d4d4 100755 --- a/src/server/shared/Logging/Log.h +++ b/src/server/shared/Logging/Log.h @@ -50,6 +50,7 @@ enum DebugLogFilters LOG_FILTER_LOOT = 0x00100000, // Loot related LOG_FILTER_GUILD = 0x00200000, // Guild related LOG_FILTER_TRANSPORTS = 0x00400000, // Transport related + LOG_FILTER_OPCODES = 0x00800000, // OpCodes }; enum LogTypes @@ -137,6 +138,7 @@ class Log void outArena( const char * str, ... ) ATTR_PRINTF(2, 3); void outSQLDriver( const char* str, ... ) ATTR_PRINTF(2, 3); void outCharDump( const char * str, uint32 account_id, uint32 guid, const char * name ); + void outOpCode(uint32 op, const char * name, bool smsg = true); static void outTimestamp(FILE* file); static std::string GetTimestampStr(); diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h index 08318aa7a5b..93a9aaa6d80 100755 --- a/src/server/shared/Packets/ByteBuffer.h +++ b/src/server/shared/Packets/ByteBuffer.h @@ -51,19 +51,19 @@ class ByteBuffer const static size_t DEFAULT_SIZE = 0x1000; // constructor - ByteBuffer(): _rpos(0), _wpos(0) + ByteBuffer(): _rpos(0), _wpos(0), _bitpos(8), _curbitval(0) { _storage.reserve(DEFAULT_SIZE); } // constructor - ByteBuffer(size_t res): _rpos(0), _wpos(0) + ByteBuffer(size_t res): _rpos(0), _wpos(0), _bitpos(8), _curbitval(0) { _storage.reserve(res); } // copy constructor - ByteBuffer(const ByteBuffer &buf): _rpos(buf._rpos), _wpos(buf._wpos), _storage(buf._storage) { } + ByteBuffer(const ByteBuffer &buf): _rpos(buf._rpos), _wpos(buf._wpos), _storage(buf._storage), _bitpos(buf._bitpos), _curbitval(buf._curbitval) { } void clear() { @@ -73,10 +73,68 @@ class ByteBuffer template void append(T value) { + flushBits(); EndianConvert(value); append((uint8 *)&value, sizeof(value)); } + void flushBits() + { + if (_bitpos == 8) + return; + + append((uint8 *)&_curbitval, sizeof(uint8)); + _curbitval = 0; + _bitpos = 8; + } + + bool writeBit(uint32 bit) + { + --_bitpos; + if (bit) + _curbitval |= (1 << (_bitpos)); + + if (_bitpos == 0) + { + _bitpos = 8; + append((uint8 *)&_curbitval, sizeof(_curbitval)); + _curbitval = 0; + } + + return (bit != 0); + } + + bool readBit() + { + ++_bitpos; + if (_bitpos > 7) + { + _bitpos = 0; + _curbitval = read(); + } + bool bit = ((_curbitval >> (7-_bitpos)) & 1) != 0; + return bit; + } + + template void writeBits(T value, size_t bits) + { + for (int32 i = bits-1; i >= 0; --i) + writeBit((value >> i) & 1); + } + + uint32 readBits(size_t bits) + { + uint32 value = 0; + for (int32 i = bits-1; i >= 0; --i) + { + if(readBit()) + { + value |= (1 << (_bitpos)); + } + } + return value; + } + template void put(size_t pos, T value) { EndianConvert(value); @@ -489,7 +547,8 @@ class ByteBuffer } protected: - size_t _rpos, _wpos; + size_t _rpos, _wpos, _bitpos; + uint8 _curbitval; std::vector _storage; }; diff --git a/src/server/shared/Packets/WorldPacket.h b/src/server/shared/Packets/WorldPacket.h deleted file mode 100755 index c27801a8d58..00000000000 --- a/src/server/shared/Packets/WorldPacket.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2008-2011 TrinityCore - * Copyright (C) 2005-2009 MaNGOS - * - * 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; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; 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, see . - */ - -#ifndef TRINITYCORE_WORLDPACKET_H -#define TRINITYCORE_WORLDPACKET_H - -#include "Common.h" -#include "ByteBuffer.h" - -class WorldPacket : public ByteBuffer -{ - public: - // just container for later use - WorldPacket() : ByteBuffer(0), m_opcode(0) - { - } - explicit WorldPacket(uint16 opcode, size_t res=200) : ByteBuffer(res), m_opcode(opcode) { } - // copy constructor - WorldPacket(const WorldPacket &packet) : ByteBuffer(packet), m_opcode(packet.m_opcode) - { - } - - void Initialize(uint16 opcode, size_t newres=200) - { - clear(); - _storage.reserve(newres); - m_opcode = opcode; - } - - uint16 GetOpcode() const { return m_opcode; } - void SetOpcode(uint16 opcode) { m_opcode = opcode; } - - protected: - uint16 m_opcode; -}; -#endif - diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index a8c0d91b2e6..b8988a01228 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -472,6 +472,7 @@ LogFileLevel = 0 # 1048576 - Anything related to loot # 2097152 - Anything related to guilds # 4194304 - Anything related to transports +# 8388608 - Incoming/outgoing Opcodes # # Simply add the values together to create a bitmask. # For more info see enum DebugLogFilters in Log.h -- cgit v1.2.3 From 154612f279d7e506b0fe2984ef0fc7db4d84878d Mon Sep 17 00:00:00 2001 From: Rat Date: Mon, 21 Nov 2011 14:27:26 +0100 Subject: -started updating DBC formats for 14545 -added new dbc files for dev usage --- DevStuff/dbc/Achievement.dbc | Bin 0 -> 325173 bytes DevStuff/dbc/Achievement_Criteria.dbc | Bin 0 -> 1106768 bytes DevStuff/dbc/AreaGroup.dbc | Bin 0 -> 25941 bytes DevStuff/dbc/AreaPOI.dbc | Bin 0 -> 87378 bytes DevStuff/dbc/AreaTable.dbc | Bin 0 -> 378044 bytes DevStuff/dbc/AreaTrigger.dbc | Bin 0 -> 108077 bytes DevStuff/dbc/ArmorLocation.dbc | Bin 0 -> 573 bytes DevStuff/dbc/AuctionHouse.dbc | Bin 0 -> 330 bytes DevStuff/dbc/BankBagSlotPrices.dbc | Bin 0 -> 117 bytes DevStuff/dbc/BarberShopStyle.dbc | Bin 0 -> 23948 bytes DevStuff/dbc/BattlemasterList.dbc | Bin 0 -> 2026 bytes DevStuff/dbc/CharStartOutfit.dbc | Bin 0 -> 55349 bytes DevStuff/dbc/CharTitles.dbc | Bin 0 -> 7569 bytes DevStuff/dbc/ChatChannels.dbc | Bin 0 -> 219 bytes DevStuff/dbc/ChrClasses.dbc | Bin 0 -> 740 bytes DevStuff/dbc/ChrRaces.dbc | Bin 0 -> 2631 bytes src/server/game/Achievements/AchievementMgr.cpp | 6 +- src/server/game/Battlegrounds/BattlegroundMgr.cpp | 2 +- src/server/game/DataStores/DBCEnums.h | 84 +++++++-- src/server/game/DataStores/DBCStores.cpp | 30 ++-- src/server/game/DataStores/DBCStores.h | 1 + src/server/game/DataStores/DBCStructure.h | 205 ++++++++++++---------- src/server/game/DataStores/DBCfmt.h | 34 ++-- src/server/game/Entities/Player/Player.cpp | 1 - src/server/game/World/World.cpp | 6 +- 25 files changed, 221 insertions(+), 148 deletions(-) create mode 100644 DevStuff/dbc/Achievement.dbc create mode 100644 DevStuff/dbc/Achievement_Criteria.dbc create mode 100644 DevStuff/dbc/AreaGroup.dbc create mode 100644 DevStuff/dbc/AreaPOI.dbc create mode 100644 DevStuff/dbc/AreaTable.dbc create mode 100644 DevStuff/dbc/AreaTrigger.dbc create mode 100644 DevStuff/dbc/ArmorLocation.dbc create mode 100644 DevStuff/dbc/AuctionHouse.dbc create mode 100644 DevStuff/dbc/BankBagSlotPrices.dbc create mode 100644 DevStuff/dbc/BarberShopStyle.dbc create mode 100644 DevStuff/dbc/BattlemasterList.dbc create mode 100644 DevStuff/dbc/CharStartOutfit.dbc create mode 100644 DevStuff/dbc/CharTitles.dbc create mode 100644 DevStuff/dbc/ChatChannels.dbc create mode 100644 DevStuff/dbc/ChrClasses.dbc create mode 100644 DevStuff/dbc/ChrRaces.dbc (limited to 'src') diff --git a/DevStuff/dbc/Achievement.dbc b/DevStuff/dbc/Achievement.dbc new file mode 100644 index 00000000000..82c712614b0 Binary files /dev/null and b/DevStuff/dbc/Achievement.dbc differ diff --git a/DevStuff/dbc/Achievement_Criteria.dbc b/DevStuff/dbc/Achievement_Criteria.dbc new file mode 100644 index 00000000000..a9ae97f09f7 Binary files /dev/null and b/DevStuff/dbc/Achievement_Criteria.dbc differ diff --git a/DevStuff/dbc/AreaGroup.dbc b/DevStuff/dbc/AreaGroup.dbc new file mode 100644 index 00000000000..3d641ed5152 Binary files /dev/null and b/DevStuff/dbc/AreaGroup.dbc differ diff --git a/DevStuff/dbc/AreaPOI.dbc b/DevStuff/dbc/AreaPOI.dbc new file mode 100644 index 00000000000..f4230e58627 Binary files /dev/null and b/DevStuff/dbc/AreaPOI.dbc differ diff --git a/DevStuff/dbc/AreaTable.dbc b/DevStuff/dbc/AreaTable.dbc new file mode 100644 index 00000000000..7c06c1943b2 Binary files /dev/null and b/DevStuff/dbc/AreaTable.dbc differ diff --git a/DevStuff/dbc/AreaTrigger.dbc b/DevStuff/dbc/AreaTrigger.dbc new file mode 100644 index 00000000000..499af4ef766 Binary files /dev/null and b/DevStuff/dbc/AreaTrigger.dbc differ diff --git a/DevStuff/dbc/ArmorLocation.dbc b/DevStuff/dbc/ArmorLocation.dbc new file mode 100644 index 00000000000..36d2fbd2b8f Binary files /dev/null and b/DevStuff/dbc/ArmorLocation.dbc differ diff --git a/DevStuff/dbc/AuctionHouse.dbc b/DevStuff/dbc/AuctionHouse.dbc new file mode 100644 index 00000000000..29a824d79c2 Binary files /dev/null and b/DevStuff/dbc/AuctionHouse.dbc differ diff --git a/DevStuff/dbc/BankBagSlotPrices.dbc b/DevStuff/dbc/BankBagSlotPrices.dbc new file mode 100644 index 00000000000..2efa690c3e3 Binary files /dev/null and b/DevStuff/dbc/BankBagSlotPrices.dbc differ diff --git a/DevStuff/dbc/BarberShopStyle.dbc b/DevStuff/dbc/BarberShopStyle.dbc new file mode 100644 index 00000000000..ade4e735c39 Binary files /dev/null and b/DevStuff/dbc/BarberShopStyle.dbc differ diff --git a/DevStuff/dbc/BattlemasterList.dbc b/DevStuff/dbc/BattlemasterList.dbc new file mode 100644 index 00000000000..56a3ad7fcf3 Binary files /dev/null and b/DevStuff/dbc/BattlemasterList.dbc differ diff --git a/DevStuff/dbc/CharStartOutfit.dbc b/DevStuff/dbc/CharStartOutfit.dbc new file mode 100644 index 00000000000..445c056e5ef Binary files /dev/null and b/DevStuff/dbc/CharStartOutfit.dbc differ diff --git a/DevStuff/dbc/CharTitles.dbc b/DevStuff/dbc/CharTitles.dbc new file mode 100644 index 00000000000..e6cc5ba4fc9 Binary files /dev/null and b/DevStuff/dbc/CharTitles.dbc differ diff --git a/DevStuff/dbc/ChatChannels.dbc b/DevStuff/dbc/ChatChannels.dbc new file mode 100644 index 00000000000..2a8d5a42703 Binary files /dev/null and b/DevStuff/dbc/ChatChannels.dbc differ diff --git a/DevStuff/dbc/ChrClasses.dbc b/DevStuff/dbc/ChrClasses.dbc new file mode 100644 index 00000000000..9d020e01abe Binary files /dev/null and b/DevStuff/dbc/ChrClasses.dbc differ diff --git a/DevStuff/dbc/ChrRaces.dbc b/DevStuff/dbc/ChrRaces.dbc new file mode 100644 index 00000000000..0843d68daf4 Binary files /dev/null and b/DevStuff/dbc/ChrRaces.dbc differ diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 8967446f199..448f14874f9 100755 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -1965,7 +1965,7 @@ void AchievementMgr::StartTimedAchievement(AchievementCriteriaTimedTypes type, u AchievementCriteriaEntryList const& achievementCriteriaList = sAchievementMgr->GetTimedAchievementCriteriaByType(type); for (AchievementCriteriaEntryList::const_iterator i = achievementCriteriaList.begin(); i != achievementCriteriaList.end(); ++i) { - if ((*i)->timerStartEvent != entry) + if ((*i)->timedCriteriaMiscId != entry) continue; AchievementEntry const* achievement = sAchievementStore.LookupEntry((*i)->referredAchievement); @@ -1988,7 +1988,7 @@ void AchievementMgr::RemoveTimedAchievement(AchievementCriteriaTimedTypes type, AchievementCriteriaEntryList const& achievementCriteriaList = sAchievementMgr->GetTimedAchievementCriteriaByType(type); for (AchievementCriteriaEntryList::const_iterator i = achievementCriteriaList.begin(); i!=achievementCriteriaList.end(); ++i) { - if ((*i)->timerStartEvent != entry) + if ((*i)->timedCriteriaMiscId != entry) continue; TimedAchievementMap::iterator timedIter = m_timedAchievements.find((*i)->ID); @@ -2194,7 +2194,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaList() m_AchievementCriteriaListByAchievement[criteria->referredAchievement].push_back(criteria); if (criteria->timeLimit) - m_AchievementCriteriasByTimedType[criteria->timedType].push_back(criteria); + m_AchievementCriteriasByTimedType[criteria->timedCriteriaStartType].push_back(criteria); } sLog->outString(">> Loaded %lu achievement criteria in %u ms", (unsigned long)m_AchievementCriteriasByType->size(), GetMSTimeDiffToNow(oldMSTime)); diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index a9acced82ae..d0f322e3f8c 100755 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -765,7 +765,7 @@ void BattlegroundMgr::CreateInitialBattlegrounds() selectionWeight = fields[9].GetUInt8(); data.scriptId = sObjectMgr->GetScriptId(fields[10].GetCString()); - data.BattlegroundName = bl->name[sWorld->GetDefaultDbcLocale()]; + //data.BattlegroundName = bl->name[sWorld->GetDefaultDbcLocale()]; data.MapID = bl->mapid[0]; if (!CreateBattleground(data)) diff --git a/src/server/game/DataStores/DBCEnums.h b/src/server/game/DataStores/DBCEnums.h index 80121aa3334..a4cfc2758d1 100755 --- a/src/server/game/DataStores/DBCEnums.h +++ b/src/server/game/DataStores/DBCEnums.h @@ -58,16 +58,24 @@ enum AchievementFaction enum AchievementFlags { - ACHIEVEMENT_FLAG_COUNTER = 0x00000001, // Just count statistic (never stop and complete) - ACHIEVEMENT_FLAG_HIDDEN = 0x00000002, // Not sent to client - internal use only - ACHIEVEMENT_FLAG_STORE_MAX_VALUE = 0x00000004, // Store only max value? used only in "Reach level xx" - ACHIEVEMENT_FLAG_SUMM = 0x00000008, // Use summ criteria value from all reqirements (and calculate max value) - ACHIEVEMENT_FLAG_MAX_USED = 0x00000010, // Show max criteria (and calculate max value ??) - ACHIEVEMENT_FLAG_REQ_COUNT = 0x00000020, // Use not zero req count (and calculate max value) - ACHIEVEMENT_FLAG_AVERAGE = 0x00000040, // Show as average value (value / time_in_days) depend from other flag (by def use last criteria value) - ACHIEVEMENT_FLAG_BAR = 0x00000080, // Show as progress bar (value / max vale) depend from other flag (by def use last criteria value) - ACHIEVEMENT_FLAG_REALM_FIRST_REACH = 0x00000100, // - ACHIEVEMENT_FLAG_REALM_FIRST_KILL = 0x00000200, // + ACHIEVEMENT_FLAG_COUNTER = 0x00000001, // Just count statistic (never stop and complete) + ACHIEVEMENT_FLAG_HIDDEN = 0x00000002, // Not sent to client - internal use only + ACHIEVEMENT_FLAG_STORE_MAX_VALUE = 0x00000004, // Store only max value? used only in "Reach level xx" + ACHIEVEMENT_FLAG_SUMM = 0x00000008, // Use summ criteria value from all reqirements (and calculate max value) + ACHIEVEMENT_FLAG_MAX_USED = 0x00000010, // Show max criteria (and calculate max value ??) + ACHIEVEMENT_FLAG_REQ_COUNT = 0x00000020, // Use not zero req count (and calculate max value) + ACHIEVEMENT_FLAG_AVERAGE = 0x00000040, // Show as average value (value / time_in_days) depend from other flag (by def use last criteria value) + ACHIEVEMENT_FLAG_BAR = 0x00000080, // Show as progress bar (value / max vale) depend from other flag (by def use last criteria value) + ACHIEVEMENT_FLAG_REALM_FIRST_REACH = 0x00000100, // + ACHIEVEMENT_FLAG_REALM_FIRST_KILL = 0x00000200, // + ACHIEVEMENT_FLAG_UNK3 = 0x00000400, // ACHIEVEMENT_FLAG_HIDE_NAME_IN_TIE + ACHIEVEMENT_FLAG_REALM_FIRST_GUILD = 0x00000800, // first guild on realm done something + ACHIEVEMENT_FLAG_UNK4 = 0x00001000, // as guild group? + ACHIEVEMENT_FLAG_UNK5 = 0x00002000, // as guild group? + ACHIEVEMENT_FLAG_GUILD = 0x00004000, // + ACHIEVEMENT_FLAG_SHOW_GUILD_MEMBERS = 0x00008000, // + ACHIEVEMENT_FLAG_SHOW_CRITERIA_MEMBERS = 0x00010000, // + }; #define MAX_CRITERIA_REQUIREMENTS 2 @@ -102,6 +110,7 @@ enum AchievementCriteriaTimedTypes ACHIEVEMENT_TIMED_TYPE_SPELL_TARGET = 6, // Timer is started by being target of spell with entry in timerStartEvent ACHIEVEMENT_TIMED_TYPE_CREATURE = 7, // Timer is started by killing creature with entry in timerStartEvent ACHIEVEMENT_TIMED_TYPE_ITEM = 9, // Timer is started by using item with entry in timerStartEvent + ACHIEVEMENT_TIMED_TYPE_UNK = 10, // Unknown ACHIEVEMENT_TIMED_TYPE_MAX, }; @@ -215,17 +224,56 @@ enum AchievementCriteriaTypes ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LINE= 112, ACHIEVEMENT_CRITERIA_TYPE_EARN_HONORABLE_KILL = 113, ACHIEVEMENT_CRITERIA_TYPE_ACCEPTED_SUMMONINGS = 114, - // 0..115 => 116 criteria types total ACHIEVEMENT_CRITERIA_TYPE_EARN_ACHIEVEMENT_POINTS = 115, ACHIEVEMENT_CRITERIA_TYPE_USE_LFD_TO_GROUP_WITH_PLAYERS = 119, - // 120 - // 121 - // 122 - // 123 - // 0..123 => 124 criteria types total - ACHIEVEMENT_CRITERIA_TYPE_TOTAL = 124, + // 120 - + // 121 - + // 122 - + // 123 - + ACHIEVEMENT_CRITERIA_TYPE_SPENT_GOLD_GUILD_REPAIRS = 124, + ACHIEVEMENT_CRITERIA_TYPE_REACH_GUILD_LEVEL = 125, + ACHIEVEMENT_CRITERIA_TYPE_CRAFT_ITEMS_GUILD = 126, + ACHIEVEMENT_CRITERIA_TYPE_CATCH_FROM_POOL = 127, + ACHIEVEMENT_CRITERIA_TYPE_BUY_GUILD_BANK_SLOTS = 128, + ACHIEVEMENT_CRITERIA_TYPE_EARN_GUILD_ACHIEVEMENT_POINTS = 129, + ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_BATTLEGROUND = 130, + // 131 - + ACHIEVEMENT_CRITERIA_TYPE_REACH_BG_RATING = 132, + ACHIEVEMENT_CRITERIA_TYPE_BUY_GUILD_TABARD = 133, + ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUESTS_GUILD = 134, + ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILLS_GUILD = 135, + ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE_TYPE_GUILD = 136, + // 0..136 => 137 criteria types total + ACHIEVEMENT_CRITERIA_TYPE_TOTAL = 137, +}; + +enum AchievementCriteriaMoreReqType +{ + ACHIEVEMENT_CRITERIA_MORE_REQ_TYPE_ITEM_LEVEL = 3, + ACHIEVEMENT_CRITERIA_MORE_REQ_TYPE_CREATURE_ID = 4, + ACHIEVEMENT_CRITERIA_MORE_REQ_TYPE_SPELL = 8, + ACHIEVEMENT_CRITERIA_MORE_REQ_TYPE_SPELL_ON_TARGET = 10, + ACHIEVEMENT_CRITERIA_MORE_REQ_TYPE_ITEM_QUALITY_EQUIPPED = 14, + ACHIEVEMENT_CRITERIA_MORE_REQ_TYPE_ITEM_QUALITY_LOOTED = 15, + ACHIEVEMENT_CRITERIA_MORE_REQ_TYPE_AREA_ID = 17, + ACHIEVEMENT_CRITERIA_MORE_REQ_TYPE_AREA_ID2 = 18, + ACHIEVEMENT_CRITERIA_MORE_REQ_TYPE_RAID_DIFFICULTY = 20, + ACHIEVEMENT_CRITERIA_MORE_REQ_TYPE_ARENA_TYPE = 24, + ACHIEVEMENT_CRITERIA_MORE_REQ_TYPE_PLAYER_CLASS = 26, + ACHIEVEMENT_CRITERIA_MORE_REQ_TYPE_PLAYER_RACE = 27, + ACHIEVEMENT_CRITERIA_MORE_REQ_TYPE_PLAYER_CLASS2 = 28, + ACHIEVEMENT_CRITERIA_MORE_REQ_TYPE_CREATURE_TYPE = 30, + ACHIEVEMENT_CRITERIA_MORE_REQ_TYPE_MAP_ID = 32, + ACHIEVEMENT_CRITERIA_MORE_REQ_TYPE_TIMED_QUEST = 35, + ACHIEVEMENT_CRITERIA_MORE_REQ_TYPE_PLAYER_TITLE = 38, + ACHIEVEMENT_CRITERIA_MORE_REQ_TYPE_PLAYER_LEVEL = 39, + ACHIEVEMENT_CRITERIA_MORE_REQ_TYPE_PLAYER_LEVEL2 = 40, + ACHIEVEMENT_CRITERIA_MORE_REQ_TYPE_AREA_ID3 = 41, + ACHIEVEMENT_CRITERIA_MORE_REQ_TYPE_GUILD_REP = 62, }; + + enum AchievementCategory { CATEGORY_CHILDRENS_WEEK = 163, @@ -233,7 +281,7 @@ enum AchievementCategory enum AreaFlags { - AREA_FLAG_UNK0 = 0x00000001, // Unknown + AREA_FLAG_SNOW = 0x00000001, // snow (only Dun Morogh, Naxxramas, Razorfen Downs and Winterspring) AREA_FLAG_UNK1 = 0x00000002, // Razorfen Downs, Naxxramas and Acherus: The Ebon Hold (3.3.5a) AREA_FLAG_UNK2 = 0x00000004, // Only used for areas on map 571 (development before) AREA_FLAG_SLAVE_CAPITAL = 0x00000008, // city and city subsones diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index e13be03965d..e0d2294abc4 100755 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -59,6 +59,7 @@ static WMOAreaInfoByTripple sWMOAreaInfoByTripple; DBCStorage sAchievementStore(Achievementfmt); DBCStorage sAchievementCriteriaStore(AchievementCriteriafmt); DBCStorage sAreaTriggerStore(AreaTriggerEntryfmt); +DBCStorage sArmorLocationStore(ArmorLocationfmt); DBCStorage sAuctionHouseStore(AuctionHouseEntryfmt); DBCStorage sBankBagSlotPricesStore(BankBagSlotPricesEntryfmt); DBCStorage sBattlemasterListStore(BattlemasterListEntryfmt); @@ -275,20 +276,21 @@ void LoadDBCStores(const std::string& dataPath) } } - LoadDBC(availableDbcLocales, bad_dbc_files, sAchievementStore, dbcPath, "Achievement.dbc", &CustomAchievementfmt, &CustomAchievementIndex); - LoadDBC(availableDbcLocales, bad_dbc_files, sAchievementCriteriaStore, dbcPath, "Achievement_Criteria.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sAreaTriggerStore, dbcPath, "AreaTrigger.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sAreaGroupStore, dbcPath, "AreaGroup.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sAreaPOIStore, dbcPath, "AreaPOI.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sAuctionHouseStore, dbcPath, "AuctionHouse.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sBankBagSlotPricesStore, dbcPath, "BankBagSlotPrices.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sBattlemasterListStore, dbcPath, "BattlemasterList.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sBarberShopStyleStore, dbcPath, "BarberShopStyle.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sCharStartOutfitStore, dbcPath, "CharStartOutfit.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sCharTitlesStore, dbcPath, "CharTitles.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sChatChannelsStore, dbcPath, "ChatChannels.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sChrClassesStore, dbcPath, "ChrClasses.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sChrRacesStore, dbcPath, "ChrRaces.dbc"); + LoadDBC(availableDbcLocales, bad_dbc_files, sAchievementStore, dbcPath, "Achievement.dbc"/*, &CustomAchievementfmt, &CustomAchievementIndex*/);//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sAchievementCriteriaStore, dbcPath, "Achievement_Criteria.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sAreaTriggerStore, dbcPath, "AreaTrigger.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sAreaGroupStore, dbcPath, "AreaGroup.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sAreaPOIStore, dbcPath, "AreaPOI.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sAuctionHouseStore, dbcPath, "AuctionHouse.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sArmorLocationStore, dbcPath, "ArmorLocation.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sBankBagSlotPricesStore, dbcPath, "BankBagSlotPrices.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sBattlemasterListStore, dbcPath, "BattlemasterList.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sBarberShopStyleStore, dbcPath, "BarberShopStyle.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sCharStartOutfitStore, dbcPath, "CharStartOutfit.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sCharTitlesStore, dbcPath, "CharTitles.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sChatChannelsStore, dbcPath, "ChatChannels.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sChrClassesStore, dbcPath, "ChrClasses.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sChrRacesStore, dbcPath, "ChrRaces.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sCinematicSequencesStore, dbcPath, "CinematicSequences.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sCreatureDisplayInfoStore, dbcPath, "CreatureDisplayInfo.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sCreatureFamilyStore, dbcPath, "CreatureFamily.dbc"); diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h index 8bd22a3ab91..fd143b6a690 100755 --- a/src/server/game/DataStores/DBCStores.h +++ b/src/server/game/DataStores/DBCStores.h @@ -69,6 +69,7 @@ extern DBCStorage sAreaStore;// recommend access extern DBCStorage sAreaGroupStore; extern DBCStorage sAreaPOIStore; extern DBCStorage sAreaTriggerStore; +extern DBCStorage sArmorLocationStore; extern DBCStorage sAuctionHouseStore; extern DBCStorage sBankBagSlotPricesStore; extern DBCStorage sBarberShopStyleStore; diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 9bc72e31df9..f2e082c832f 100755 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -44,28 +44,24 @@ struct AchievementEntry int32 requiredFaction; // 1 -1=all, 0=horde, 1=alliance int32 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) + DBCString name; // 4 + //DBCString description; // 5 + uint32 categoryId; // 6 + uint32 points; // 7 reward points + //uint32 OrderInCategory; // 8 + uint32 flags; // 9 + //uint32 icon; // 10 icon (from SpellIcon.dbc) + //DBCString reward; // 11 + uint32 count; // 12 - need this count of completed criterias (own or referenced achievement criterias) + uint32 refAchievement; // 13 - 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 + //DBCString name; // 2 + //uint32 sortOrder; // 3 }; struct AchievementCriteriaEntry @@ -260,7 +256,14 @@ struct AchievementCriteriaEntry struct { uint32 teamtype; // 3 {2, 3, 5} - uint32 PersonalRating; // 4 + uint32 teamrating; // 4 + } reach_team_rating; + + // ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_PERSONAL_RATING = 39 + struct + { + uint32 teamtype; // 3 {2, 3, 5} + uint32 PersonalRating; // 4 } highest_personal_rating; // ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LEVEL = 40 @@ -370,6 +373,7 @@ struct AchievementCriteriaEntry } do_emote; // ACHIEVEMENT_CRITERIA_TYPE_DAMAGE_DONE = 13 // ACHIEVEMENT_CRITERIA_TYPE_HEALING_DONE = 55 + // ACHIEVEMENT_CRITERIA_TYPE_GET_KILLING_BLOWS = 56 struct { uint32 unused; // 3 @@ -504,15 +508,19 @@ struct AchievementCriteriaEntry uint32 additionalRequirement_value; } additionalRequirements[MAX_CRITERIA_REQUIREMENTS]; - //char* name[16]; // 9-24 - //uint32 name_flags; // 25 - uint32 flags; // 26 - uint32 timedType; // 27 - uint32 timerStartEvent; // 28 Alway appears with timed events - // for timed spells it is spell id for - // timed kills it is creature id - uint32 timeLimit; // 29 time limit in seconds - //uint32 showOrder; // 30 show order + char* name; // 9 m_description_lang + uint32 completionFlag; // 10 m_flags + uint32 timedCriteriaStartType; // 11 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; // 12 m_timer_asset_id Alway appears with timed events, used internally to start the achievement, store + uint32 timeLimit; // 13 m_timer_time time limit in seconds + uint32 showOrder; // 14 m_ui_order also used in achievement shift-links as index in state bitmask + //uint32 unk1; // 15 only one value, still unknown + //uint32 unk2; // 16 all zeros + //uint32 moreRequirement[3]; // 17-19 + //uint32 moreRequirementValue[3]; // 20-22 }; struct AreaTableEntry @@ -524,9 +532,15 @@ struct AreaTableEntry 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 + DBCString area_name; // 11 + uint32 team; // 12 + // 13-19 unknown + //uint32 unk20; // 20 4.0.0 + //uint32 unk21; // 21 4.0.0 + //uint32 unk22; // 22 4.0.0 + //uint32 unk23; // 23 4.0.0 + //uint32 unk24; // 24 - worldStateId + //uint32 unk25 // 25 // helpers bool IsSanctuary() const @@ -552,16 +566,14 @@ struct AreaPOIEntry uint32 icon[11]; //1-11 float x; //12 float y; //13 - float z; //14 - uint32 mapId; //15 - //uint32 val1; //16 - uint32 zoneId; //17 - //char* name[16]; //18-33 - //uint32 name_flag; //34 - //char* name2[16]; //35-50 - //uint32 name_flag2; //51 - uint32 worldState; //52 - //uint32 val2; //53 + uint32 mapId; //14 + //uint32 val1; //15 + uint32 zoneId; //16 + //DBCString name; //17 - name + //DBCString name2; //18 - name2 + uint32 worldState; //19 + //uint32 val2; //20 + //uint32 unk; //21 }; struct AreaTriggerEntry @@ -571,11 +583,20 @@ struct AreaTriggerEntry float x; // 2 m_x float y; // 3 m_y float z; // 4 m_z - float radius; // 5 m_radius - float box_x; // 6 m_box_length - float box_y; // 7 m_box_width - float box_z; // 8 m_box_heigh - float box_orientation; // 9 m_box_yaw + //uint32 // 5 + //uint32 // 6 + //uint32 // 7 + float radius; // 8 m_radius + float box_x; // 9 m_box_length + float box_y; // 10 m_box_width + float box_z; // 11 m_box_heigh + float box_orientation; // 12 m_box_yaw +}; + +struct ArmorLocationEntry +{ + uint32 InventoryType; // 0 + float Value[5]; // 1-5 multiplier for armor types (cloth...plate, no armor?) }; struct AuctionHouseEntry @@ -584,8 +605,7 @@ struct AuctionHouseEntry 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 + //DBCString name; // 4 }; struct BankBagSlotPricesEntry @@ -598,14 +618,12 @@ struct BarberShopStyleEntry { uint32 Id; // 0 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 - //float CostMultiplier; // 36 values 1 and 0.75 - uint32 race; // 37 race - uint32 gender; // 38 0 -> male, 1 -> female - uint32 hair_id; // 39 real ID to hair/facial hair + //DBCString name; // 2 m_DisplayName_lang + //uint32 unk_name; // 3 m_Description_lang + //float CostMultiplier; // 4 m_Cost_Modifier + uint32 race; // 5 m_race + uint32 gender; // 6 m_sex + uint32 hair_id; // 7 m_data (real ID to hair/facial hair) }; struct BattlemasterListEntry @@ -614,12 +632,15 @@ struct BattlemasterListEntry 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 - //uint32 SomeLevel; // 31, may be max level + DBCString name; // 11 + uint32 maxGroupSize; // 12 maxGroupSize, used for checking if queue as group + uint32 HolidayWorldStateId; // 13 new 3.1 + uint32 minLevel; // 14, min level (sync with PvPDifficulty.dbc content) + uint32 maxLevel; // 15, max level (sync with PvPDifficulty.dbc content) + //uint32 maxGroupSizeRated; // 16 4.0.1 + //uint32 unk; // 17 - 4.0.6.13596 + //uint32 maxPlayers; // 18 4.0.1 + //uint32 unk1; // 19 4.0.3, value 2 for Rated Battlegrounds }; #define MAX_OUTFIT_ITEMS 24 @@ -634,46 +655,45 @@ struct CharStartOutfitEntry //uint32 Unknown1; // 38, unique values (index-like with gaps ordered in other way as ids) //uint32 Unknown2; // 39 //uint32 Unknown3; // 40 + //uint32 Unknown4; // 41 + //uint32 Unknown5; // 42 }; 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<outError("entry %u aura %u invtype %u display %u", itemId, enchant ? enchant->aura_id : uint32(0), proto->InventoryType,db2Item->DisplayId); *data << uint32(enchant ? enchant->aura_id : 0); *data << uint8(proto->InventoryType); *data << uint32(db2Item->DisplayId); diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 32b99b71abf..87cd3755538 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1765,7 +1765,7 @@ void World::DetectDBCLang() std::string availableLocalsStr; uint8 default_locale = TOTAL_LOCALES; - for (uint8 i = default_locale-1; i < TOTAL_LOCALES; --i) // -1 will be 255 due to uint8 + /*for (uint8 i = default_locale-1; i < TOTAL_LOCALES; --i) // -1 will be 255 due to uint8 { if (race->name[i][0] != '\0') // check by race names { @@ -1774,7 +1774,7 @@ void World::DetectDBCLang() availableLocalsStr += localeNames[i]; availableLocalsStr += " "; } - } + }*/ if (default_locale != m_lang_confid && m_lang_confid < TOTAL_LOCALES && (m_availableDbcLocaleMask & (1 << m_lang_confid))) @@ -1785,7 +1785,7 @@ void World::DetectDBCLang() if (default_locale >= TOTAL_LOCALES) { sLog->outError("Unable to determine your DBC Locale! (corrupt DBC?)"); - exit(1); + //exit(1); TODO: enable after updated all dbc structures } m_defaultDbcLocale = LocaleConstant(default_locale); -- cgit v1.2.3 From a12df963b932bc6f0b28048ed1e2b2efbdb1b791 Mon Sep 17 00:00:00 2001 From: Rat Date: Tue, 22 Nov 2011 13:32:11 +0100 Subject: -updated all DBC formats, except spell* ones -added dbc.zip (all 4.2.2 files + 3.3.5 spells) -hardcoded map 0's entry for mapdifficulty (dbc has no data for it) --- DevStuff/dbc/Achievement.dbc | Bin 325173 -> 0 bytes DevStuff/dbc/Achievement_Criteria.dbc | Bin 1106768 -> 0 bytes DevStuff/dbc/AreaGroup.dbc | Bin 25941 -> 0 bytes DevStuff/dbc/AreaPOI.dbc | Bin 87378 -> 0 bytes DevStuff/dbc/AreaTable.dbc | Bin 378044 -> 0 bytes DevStuff/dbc/AreaTrigger.dbc | Bin 108077 -> 0 bytes DevStuff/dbc/ArmorLocation.dbc | Bin 573 -> 0 bytes DevStuff/dbc/AuctionHouse.dbc | Bin 330 -> 0 bytes DevStuff/dbc/BankBagSlotPrices.dbc | Bin 117 -> 0 bytes DevStuff/dbc/BarberShopStyle.dbc | Bin 23948 -> 0 bytes DevStuff/dbc/BattlemasterList.dbc | Bin 2026 -> 0 bytes DevStuff/dbc/CharStartOutfit.dbc | Bin 55349 -> 0 bytes DevStuff/dbc/CharTitles.dbc | Bin 7569 -> 0 bytes DevStuff/dbc/ChatChannels.dbc | Bin 219 -> 0 bytes DevStuff/dbc/ChrClasses.dbc | Bin 740 -> 0 bytes DevStuff/dbc/ChrRaces.dbc | Bin 2631 -> 0 bytes DevStuff/dbc/CurrencyTypes.dbc | Bin 5374 -> 0 bytes DevStuff/dbc/Item-sparse.db2 | Bin 28739710 -> 0 bytes DevStuff/dbc/Item.db2 | Bin 1952689 -> 0 bytes DevStuff/dbc/ItemExtendedCost.db2 | Bin 198325 -> 0 bytes DevStuff/dbc/dbc.zip | Bin 0 -> 16311312 bytes src/server/game/AuctionHouse/AuctionHouseMgr.cpp | 2 +- src/server/game/Chat/ChatLink.cpp | 4 +- src/server/game/Chat/ChatLink.h | 2 +- src/server/game/DataStores/DBCEnums.h | 2 +- src/server/game/DataStores/DBCStores.cpp | 153 ++++---- src/server/game/DataStores/DBCStores.h | 3 +- src/server/game/DataStores/DBCStructure.h | 423 ++++++++++++--------- src/server/game/DataStores/DBCfmt.h | 92 +++-- src/server/game/Entities/Player/Player.cpp | 7 +- src/server/game/Globals/ObjectMgr.cpp | 2 +- .../game/Server/Protocol/Handlers/NPCHandler.cpp | 4 +- src/server/shared/DataStores/DB2Store.h | 2 +- 33 files changed, 386 insertions(+), 310 deletions(-) delete mode 100644 DevStuff/dbc/Achievement.dbc delete mode 100644 DevStuff/dbc/Achievement_Criteria.dbc delete mode 100644 DevStuff/dbc/AreaGroup.dbc delete mode 100644 DevStuff/dbc/AreaPOI.dbc delete mode 100644 DevStuff/dbc/AreaTable.dbc delete mode 100644 DevStuff/dbc/AreaTrigger.dbc delete mode 100644 DevStuff/dbc/ArmorLocation.dbc delete mode 100644 DevStuff/dbc/AuctionHouse.dbc delete mode 100644 DevStuff/dbc/BankBagSlotPrices.dbc delete mode 100644 DevStuff/dbc/BarberShopStyle.dbc delete mode 100644 DevStuff/dbc/BattlemasterList.dbc delete mode 100644 DevStuff/dbc/CharStartOutfit.dbc delete mode 100644 DevStuff/dbc/CharTitles.dbc delete mode 100644 DevStuff/dbc/ChatChannels.dbc delete mode 100644 DevStuff/dbc/ChrClasses.dbc delete mode 100644 DevStuff/dbc/ChrRaces.dbc delete mode 100644 DevStuff/dbc/CurrencyTypes.dbc delete mode 100644 DevStuff/dbc/Item-sparse.db2 delete mode 100644 DevStuff/dbc/Item.db2 delete mode 100644 DevStuff/dbc/ItemExtendedCost.db2 create mode 100644 DevStuff/dbc/dbc.zip (limited to 'src') diff --git a/DevStuff/dbc/Achievement.dbc b/DevStuff/dbc/Achievement.dbc deleted file mode 100644 index 82c712614b0..00000000000 Binary files a/DevStuff/dbc/Achievement.dbc and /dev/null differ diff --git a/DevStuff/dbc/Achievement_Criteria.dbc b/DevStuff/dbc/Achievement_Criteria.dbc deleted file mode 100644 index a9ae97f09f7..00000000000 Binary files a/DevStuff/dbc/Achievement_Criteria.dbc and /dev/null differ diff --git a/DevStuff/dbc/AreaGroup.dbc b/DevStuff/dbc/AreaGroup.dbc deleted file mode 100644 index 3d641ed5152..00000000000 Binary files a/DevStuff/dbc/AreaGroup.dbc and /dev/null differ diff --git a/DevStuff/dbc/AreaPOI.dbc b/DevStuff/dbc/AreaPOI.dbc deleted file mode 100644 index f4230e58627..00000000000 Binary files a/DevStuff/dbc/AreaPOI.dbc and /dev/null differ diff --git a/DevStuff/dbc/AreaTable.dbc b/DevStuff/dbc/AreaTable.dbc deleted file mode 100644 index 7c06c1943b2..00000000000 Binary files a/DevStuff/dbc/AreaTable.dbc and /dev/null differ diff --git a/DevStuff/dbc/AreaTrigger.dbc b/DevStuff/dbc/AreaTrigger.dbc deleted file mode 100644 index 499af4ef766..00000000000 Binary files a/DevStuff/dbc/AreaTrigger.dbc and /dev/null differ diff --git a/DevStuff/dbc/ArmorLocation.dbc b/DevStuff/dbc/ArmorLocation.dbc deleted file mode 100644 index 36d2fbd2b8f..00000000000 Binary files a/DevStuff/dbc/ArmorLocation.dbc and /dev/null differ diff --git a/DevStuff/dbc/AuctionHouse.dbc b/DevStuff/dbc/AuctionHouse.dbc deleted file mode 100644 index 29a824d79c2..00000000000 Binary files a/DevStuff/dbc/AuctionHouse.dbc and /dev/null differ diff --git a/DevStuff/dbc/BankBagSlotPrices.dbc b/DevStuff/dbc/BankBagSlotPrices.dbc deleted file mode 100644 index 2efa690c3e3..00000000000 Binary files a/DevStuff/dbc/BankBagSlotPrices.dbc and /dev/null differ diff --git a/DevStuff/dbc/BarberShopStyle.dbc b/DevStuff/dbc/BarberShopStyle.dbc deleted file mode 100644 index ade4e735c39..00000000000 Binary files a/DevStuff/dbc/BarberShopStyle.dbc and /dev/null differ diff --git a/DevStuff/dbc/BattlemasterList.dbc b/DevStuff/dbc/BattlemasterList.dbc deleted file mode 100644 index 56a3ad7fcf3..00000000000 Binary files a/DevStuff/dbc/BattlemasterList.dbc and /dev/null differ diff --git a/DevStuff/dbc/CharStartOutfit.dbc b/DevStuff/dbc/CharStartOutfit.dbc deleted file mode 100644 index 445c056e5ef..00000000000 Binary files a/DevStuff/dbc/CharStartOutfit.dbc and /dev/null differ diff --git a/DevStuff/dbc/CharTitles.dbc b/DevStuff/dbc/CharTitles.dbc deleted file mode 100644 index e6cc5ba4fc9..00000000000 Binary files a/DevStuff/dbc/CharTitles.dbc and /dev/null differ diff --git a/DevStuff/dbc/ChatChannels.dbc b/DevStuff/dbc/ChatChannels.dbc deleted file mode 100644 index 2a8d5a42703..00000000000 Binary files a/DevStuff/dbc/ChatChannels.dbc and /dev/null differ diff --git a/DevStuff/dbc/ChrClasses.dbc b/DevStuff/dbc/ChrClasses.dbc deleted file mode 100644 index 9d020e01abe..00000000000 Binary files a/DevStuff/dbc/ChrClasses.dbc and /dev/null differ diff --git a/DevStuff/dbc/ChrRaces.dbc b/DevStuff/dbc/ChrRaces.dbc deleted file mode 100644 index 0843d68daf4..00000000000 Binary files a/DevStuff/dbc/ChrRaces.dbc and /dev/null differ diff --git a/DevStuff/dbc/CurrencyTypes.dbc b/DevStuff/dbc/CurrencyTypes.dbc deleted file mode 100644 index 9805c14d10f..00000000000 Binary files a/DevStuff/dbc/CurrencyTypes.dbc and /dev/null differ diff --git a/DevStuff/dbc/Item-sparse.db2 b/DevStuff/dbc/Item-sparse.db2 deleted file mode 100644 index 073829f3b32..00000000000 Binary files a/DevStuff/dbc/Item-sparse.db2 and /dev/null differ diff --git a/DevStuff/dbc/Item.db2 b/DevStuff/dbc/Item.db2 deleted file mode 100644 index ace5da73f4a..00000000000 Binary files a/DevStuff/dbc/Item.db2 and /dev/null differ diff --git a/DevStuff/dbc/ItemExtendedCost.db2 b/DevStuff/dbc/ItemExtendedCost.db2 deleted file mode 100644 index d87122d20bd..00000000000 Binary files a/DevStuff/dbc/ItemExtendedCost.db2 and /dev/null differ diff --git a/DevStuff/dbc/dbc.zip b/DevStuff/dbc/dbc.zip new file mode 100644 index 00000000000..6edfe3a074e Binary files /dev/null and b/DevStuff/dbc/dbc.zip differ diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp index 0a2ff750a1b..761d1335608 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp @@ -618,7 +618,7 @@ void AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player if (itemRandProp) { - char* const* temp = itemRandProp->nameSuffix; + DBCString temp = itemRandProp->nameSuffix; //char* temp = itemRandProp->nameSuffix; // dbc local name diff --git a/src/server/game/Chat/ChatLink.cpp b/src/server/game/Chat/ChatLink.cpp index 26f63aa77ee..8a91de1969c 100644 --- a/src/server/game/Chat/ChatLink.cpp +++ b/src/server/game/Chat/ChatLink.cpp @@ -165,7 +165,7 @@ bool ItemChatLink::Initialize(std::istringstream& iss) return true; } -inline std::string ItemChatLink::FormatName(uint8 index, ItemLocale const* locale, char* const* suffixStrings) const +inline std::string ItemChatLink::FormatName(uint8 index, ItemLocale const *locale, DBCString suffixStrings) const { std::stringstream ss; if (locale == NULL || index >= locale->Name.size()) @@ -181,7 +181,7 @@ bool ItemChatLink::ValidateName(char* buffer, const char* context) { ChatLink::ValidateName(buffer, context); - char* const* suffixStrings = _suffix ? _suffix->nameSuffix : (_property ? _property->nameSuffix : NULL); + DBCString suffixStrings = _suffix ? _suffix->nameSuffix : (_property ? _property->nameSuffix : NULL); bool res = (FormatName(LOCALE_enUS, NULL, suffixStrings) == buffer); if (!res) diff --git a/src/server/game/Chat/ChatLink.h b/src/server/game/Chat/ChatLink.h index 4b27cab29d3..1eb6c9b03f7 100644 --- a/src/server/game/Chat/ChatLink.h +++ b/src/server/game/Chat/ChatLink.h @@ -61,7 +61,7 @@ public: virtual bool ValidateName(char* buffer, const char* context); protected: - std::string FormatName(uint8 index, ItemLocale const* locale, char* const* suffixStrings) const; + std::string FormatName(uint8 index, ItemLocale const* locale, DBCString suffixStrings) const; ItemTemplate const* _item; int32 _data[8]; diff --git a/src/server/game/DataStores/DBCEnums.h b/src/server/game/DataStores/DBCEnums.h index a4cfc2758d1..e9f4fa5ea63 100755 --- a/src/server/game/DataStores/DBCEnums.h +++ b/src/server/game/DataStores/DBCEnums.h @@ -334,7 +334,7 @@ enum Difficulty enum SpawnMask { - SPAWNMASK_CONTINENT = (1 << REGULAR_DIFFICULTY), // any any maps without spawn modes + SPAWNMASK_CONTINENT = (1 << REGULAR_DIFFICULTY), // any maps without spawn modes SPAWNMASK_DUNGEON_NORMAL = (1 << DUNGEON_DIFFICULTY_NORMAL), SPAWNMASK_DUNGEON_HEROIC = (1 << DUNGEON_DIFFICULTY_HEROIC), diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index e0d2294abc4..c5915b50967 100755 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -69,6 +69,7 @@ DBCStorage sCharTitlesStore(CharTitlesEntryfmt); DBCStorage sChatChannelsStore(ChatChannelsEntryfmt); DBCStorage sChrClassesStore(ChrClassesEntryfmt); DBCStorage sChrRacesStore(ChrRacesEntryfmt); +DBCStorage sChrPowerTypesStore(ChrClassesXPowerTypesfmt); DBCStorage sCinematicSequencesStore(CinematicSequencesEntryfmt); DBCStorage sCreatureDisplayInfoStore(CreatureDisplayInfofmt); DBCStorage sCreatureFamilyStore(CreatureFamilyfmt); @@ -104,10 +105,12 @@ DBCStorage sGtOCTClassCombatRatingScalarStor DBCStorage sGtOCTRegenHPStore(GtOCTRegenHPfmt); //DBCStorage sGtOCTRegenMPStore(GtOCTRegenMPfmt); -- not used currently DBCStorage sGtRegenHPPerSptStore(GtRegenHPPerSptfmt); +DBCStorage sGtOCTHpPerStaminaStore(GtOCTHpPerStaminafmt); DBCStorage sGtRegenMPPerSptStore(GtRegenMPPerSptfmt); DBCStorage sHolidaysStore(Holidaysfmt); +DBCStorage sItemClassStore(ItemClassfmt); //DBCStorage sItemStore(Itemfmt); DBCStorage sItemBagFamilyStore(ItemBagFamilyfmt); //DBCStorage sItemCondExtCostsStore(ItemCondExtCostsEntryfmt); @@ -193,6 +196,7 @@ DBCStorage sWMOAreaTableStore(WMOAreaTableEntryfmt); DBCStorage sWorldMapAreaStore(WorldMapAreaEntryfmt); DBCStorage sWorldMapOverlayStore(WorldMapOverlayEntryfmt); DBCStorage sWorldSafeLocsStore(WorldSafeLocsEntryfmt); +DBCStorage sPhaseStores(PhaseEntryfmt); typedef std::list StoreProblemList; @@ -291,19 +295,20 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sChatChannelsStore, dbcPath, "ChatChannels.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sChrClassesStore, dbcPath, "ChrClasses.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sChrRacesStore, dbcPath, "ChrRaces.dbc");//14545 - LoadDBC(availableDbcLocales, bad_dbc_files, sCinematicSequencesStore, dbcPath, "CinematicSequences.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sCreatureDisplayInfoStore, dbcPath, "CreatureDisplayInfo.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sCreatureFamilyStore, dbcPath, "CreatureFamily.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sCreatureSpellDataStore, dbcPath, "CreatureSpellData.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sCreatureTypeStore, dbcPath, "CreatureType.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sCurrencyTypesStore, dbcPath, "CurrencyTypes.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sDestructibleModelDataStore, dbcPath, "DestructibleModelData.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sDungeonEncounterStore, dbcPath, "DungeonEncounter.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sDurabilityCostsStore, dbcPath, "DurabilityCosts.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sDurabilityQualityStore, dbcPath, "DurabilityQuality.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sEmotesStore, dbcPath, "Emotes.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sEmotesTextStore, dbcPath, "EmotesText.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sFactionStore, dbcPath, "Faction.dbc"); + LoadDBC(availableDbcLocales, bad_dbc_files, sChrPowerTypesStore, dbcPath, "ChrClassesXPowerTypes.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sCinematicSequencesStore, dbcPath, "CinematicSequences.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sCreatureDisplayInfoStore, dbcPath, "CreatureDisplayInfo.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sCreatureFamilyStore, dbcPath, "CreatureFamily.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sCreatureSpellDataStore, dbcPath, "CreatureSpellData.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sCreatureTypeStore, dbcPath, "CreatureType.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sCurrencyTypesStore, dbcPath, "CurrencyTypes.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sDestructibleModelDataStore, dbcPath, "DestructibleModelData.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sDungeonEncounterStore, dbcPath, "DungeonEncounter.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sDurabilityCostsStore, dbcPath, "DurabilityCosts.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sDurabilityQualityStore, dbcPath, "DurabilityQuality.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sEmotesStore, dbcPath, "Emotes.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sEmotesTextStore, dbcPath, "EmotesText.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sFactionStore, dbcPath, "Faction.dbc");//14545 for (uint32 i=0; iMapId, entry->Difficulty)] = MapDifficulty(entry->resetTime, entry->maxPlayers, entry->areaTriggerText[0] != '\0'); + sMapDifficultyMap[MAKE_PAIR32(entry->MapId, entry->Difficulty)] = MapDifficulty(entry->resetTime, entry->maxPlayers, entry->areaTriggerText[0] > 0); sMapDifficultyStore.Clear(); - LoadDBC(availableDbcLocales, bad_dbc_files, sMovieStore, dbcPath, "Movie.dbc"); + LoadDBC(availableDbcLocales, bad_dbc_files, sMovieStore, dbcPath, "Movie.dbc");//14545 - LoadDBC(availableDbcLocales, bad_dbc_files, sOverrideSpellDataStore, dbcPath, "OverrideSpellData.dbc"); + LoadDBC(availableDbcLocales, bad_dbc_files, sOverrideSpellDataStore, dbcPath, "OverrideSpellData.dbc");//14545 - LoadDBC(availableDbcLocales, bad_dbc_files, sPvPDifficultyStore, dbcPath, "PvpDifficulty.dbc"); + LoadDBC(availableDbcLocales, bad_dbc_files, sPvPDifficultyStore, dbcPath, "PvpDifficulty.dbc");//14545 for (uint32 i = 0; i < sPvPDifficultyStore.GetNumRows(); ++i) if (PvPDifficultyEntry const* entry = sPvPDifficultyStore.LookupEntry(i)) if (entry->bracketId > MAX_BATTLEGROUND_BRACKETS) ASSERT(false && "Need update MAX_BATTLEGROUND_BRACKETS by DBC data"); - LoadDBC(availableDbcLocales, bad_dbc_files, sQuestXPStore, dbcPath, "QuestXP.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sQuestFactionRewardStore, dbcPath, "QuestFactionReward.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sQuestSortStore, dbcPath, "QuestSort.dbc"); + LoadDBC(availableDbcLocales, bad_dbc_files, sQuestXPStore, dbcPath, "QuestXP.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sQuestFactionRewardStore, dbcPath, "QuestFactionReward.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sQuestSortStore, dbcPath, "QuestSort.dbc");//14545 - LoadDBC(availableDbcLocales, bad_dbc_files, sRandomPropertiesPointsStore, dbcPath, "RandPropPoints.dbc"); + LoadDBC(availableDbcLocales, bad_dbc_files, sRandomPropertiesPointsStore, dbcPath, "RandPropPoints.dbc");//14545 - LoadDBC(availableDbcLocales, bad_dbc_files, sScalingStatDistributionStore, dbcPath, "ScalingStatDistribution.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sScalingStatValuesStore, dbcPath, "ScalingStatValues.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sSkillLineStore, dbcPath, "SkillLine.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sSkillLineAbilityStore, dbcPath, "SkillLineAbility.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sSoundEntriesStore, dbcPath, "SoundEntries.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sSpellStore, dbcPath, "Spell.dbc", &CustomSpellEntryfmt, &CustomSpellEntryIndex); + LoadDBC(availableDbcLocales, bad_dbc_files, sScalingStatDistributionStore, dbcPath, "ScalingStatDistribution.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sScalingStatValuesStore, dbcPath, "ScalingStatValues.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sSkillLineStore, dbcPath, "SkillLine.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sSkillLineAbilityStore, dbcPath, "SkillLineAbility.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sSoundEntriesStore, dbcPath, "SoundEntries.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sSpellStore, dbcPath, "Spell.dbc", &CustomSpellEntryfmt, &CustomSpellEntryIndex);//todo for (uint32 i = 1; i < sSpellStore.GetNumRows(); ++i) { SpellEntry const* spell = sSpellStore.LookupEntry(i); @@ -437,10 +446,10 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sSpellRangeStore, dbcPath, "SpellRange.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sSpellRuneCostStore, dbcPath, "SpellRuneCost.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sSpellShapeshiftStore, dbcPath, "SpellShapeshiftForm.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sStableSlotPricesStore, dbcPath, "StableSlotPrices.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sSummonPropertiesStore, dbcPath, "SummonProperties.dbc"); + //LoadDBC(availableDbcLocales, bad_dbc_files, sStableSlotPricesStore, dbcPath, "StableSlotPrices.dbc"); + LoadDBC(availableDbcLocales, bad_dbc_files, sSummonPropertiesStore, dbcPath, "SummonProperties.dbc");//14545 - LoadDBC(availableDbcLocales, bad_dbc_files, sTalentStore, dbcPath, "Talent.dbc"); + LoadDBC(availableDbcLocales, bad_dbc_files, sTalentStore, dbcPath, "Talent.dbc");//14545 // Create Spelldifficulty searcher for (uint32 i = 0; i < sSpellDifficultyStore.GetNumRows(); ++i) @@ -479,7 +488,7 @@ void LoadDBCStores(const std::string& dataPath) sTalentSpellPosMap[talentInfo->RankID[j]] = TalentSpellPos(i, j); } - LoadDBC(availableDbcLocales, bad_dbc_files, sTalentTabStore, dbcPath, "TalentTab.dbc"); + LoadDBC(availableDbcLocales, bad_dbc_files, sTalentTabStore, dbcPath, "TalentTab.dbc");//14545 // prepare fast data access to bit pos of talent ranks for use at inspecting { @@ -502,15 +511,15 @@ void LoadDBCStores(const std::string& dataPath) } } - LoadDBC(availableDbcLocales, bad_dbc_files, sTaxiNodesStore, dbcPath, "TaxiNodes.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sTaxiPathStore, dbcPath, "TaxiPath.dbc"); + LoadDBC(availableDbcLocales, bad_dbc_files, sTaxiNodesStore, dbcPath, "TaxiNodes.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sTaxiPathStore, dbcPath, "TaxiPath.dbc");//14545 for (uint32 i = 1; i < sTaxiPathStore.GetNumRows(); ++i) if (TaxiPathEntry const* entry = sTaxiPathStore.LookupEntry(i)) sTaxiPathSetBySource[entry->from][entry->to] = TaxiPathBySourceAndDestination(entry->ID, entry->price); uint32 pathCount = sTaxiPathStore.GetNumRows(); //## TaxiPathNode.dbc ## Loaded only for initialization different structures - LoadDBC(availableDbcLocales, bad_dbc_files, sTaxiPathNodeStore, dbcPath, "TaxiPathNode.dbc"); + LoadDBC(availableDbcLocales, bad_dbc_files, sTaxiPathNodeStore, dbcPath, "TaxiPathNode.dbc");//14545 // Calculate path nodes count std::vector pathLength; pathLength.resize(pathCount); // 0 and some other indexes not used @@ -591,19 +600,19 @@ void LoadDBCStores(const std::string& dataPath) } } - LoadDBC(availableDbcLocales, bad_dbc_files, sTeamContributionPointsStore, dbcPath, "TeamContributionPoints.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sTotemCategoryStore, dbcPath, "TotemCategory.dbc"); + //LoadDBC(availableDbcLocales, bad_dbc_files, sTeamContributionPointsStore, dbcPath, "TeamContributionPoints.dbc"); + LoadDBC(availableDbcLocales, bad_dbc_files, sTotemCategoryStore, dbcPath, "TotemCategory.dbc");//14545 - LoadDBC(availableDbcLocales, bad_dbc_files, sVehicleStore, dbcPath, "Vehicle.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sVehicleSeatStore, dbcPath, "VehicleSeat.dbc"); + LoadDBC(availableDbcLocales, bad_dbc_files, sVehicleStore, dbcPath, "Vehicle.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sVehicleSeatStore, dbcPath, "VehicleSeat.dbc");//14545 - LoadDBC(availableDbcLocales, bad_dbc_files, sWMOAreaTableStore, dbcPath, "WMOAreaTable.dbc"); + LoadDBC(availableDbcLocales, bad_dbc_files, sWMOAreaTableStore, dbcPath, "WMOAreaTable.dbc");//14545 for (uint32 i = 0; i < sWMOAreaTableStore.GetNumRows(); ++i) if (WMOAreaTableEntry const* entry = sWMOAreaTableStore.LookupEntry(i)) sWMOAreaInfoByTripple.insert(WMOAreaInfoByTripple::value_type(WMOAreaTableTripple(entry->rootId, entry->adtId, entry->groupId), entry)); - LoadDBC(availableDbcLocales, bad_dbc_files, sWorldMapAreaStore, dbcPath, "WorldMapArea.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sWorldMapOverlayStore, dbcPath, "WorldMapOverlay.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sWorldSafeLocsStore, dbcPath, "WorldSafeLocs.dbc"); + LoadDBC(availableDbcLocales, bad_dbc_files, sWorldMapAreaStore, dbcPath, "WorldMapArea.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sWorldMapOverlayStore, dbcPath, "WorldMapOverlay.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sWorldSafeLocsStore, dbcPath, "WorldSafeLocs.dbc");//14545 // error checks if (bad_dbc_files.size() >= DBCFileCount) @@ -647,7 +656,7 @@ SimpleFactionsList const* GetFactionTeamList(uint32 faction) return NULL; } -char* GetPetName(uint32 petfamily, uint32 dbclang) +char const* GetPetName(uint32 petfamily, uint32 dbclang) { if (!petfamily) return NULL; diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h index fd143b6a690..c10c19fc428 100755 --- a/src/server/game/DataStores/DBCStores.h +++ b/src/server/game/DataStores/DBCStores.h @@ -28,7 +28,7 @@ typedef std::list SimpleFactionsList; SimpleFactionsList const* GetFactionTeamList(uint32 faction); -char* GetPetName(uint32 petfamily, uint32 dbclang); +char const* GetPetName(uint32 petfamily, uint32 dbclang); uint32 GetTalentSpellCost(uint32 spellId); TalentSpellPos const* GetTalentSpellPos(uint32 spellId); @@ -79,6 +79,7 @@ extern DBCStorage sCharStartOutfitStore; extern DBCStorage sCharTitlesStore; extern DBCStorage sChrClassesStore; extern DBCStorage sChrRacesStore; +extern DBCStorage sChrPowerTypesStore; extern DBCStorage sCinematicSequencesStore; extern DBCStorage sCreatureDisplayInfoStore; extern DBCStorage sCreatureFamilyStore; diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index f2e082c832f..e65d42d2e4e 100755 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -720,6 +720,13 @@ struct ChrRacesEntry //uint32 // 23 4.0.0 }; +struct ChrPowerTypesEntry +{ + uint32 entry; // 0 + uint32 classId; // 1 + uint32 power; // 2 +}; + /* not used struct CinematicCameraEntry { @@ -757,6 +764,7 @@ struct CreatureDisplayInfoEntry // 13 m_particleColorID // 14 m_creatureGeosetData // 15 m_objectEffectPackageID + // 16 }; struct CreatureFamilyEntry @@ -770,9 +778,8 @@ struct CreatureFamilyEntry uint32 petFoodMask; // 7 m_petFoodMask int32 petTalentType; // 8 m_petTalentType // 9 m_categoryEnumID - char* Name[16]; // 10-25 m_name_lang - // 26 string flags - // 27 m_iconFile + DBCString Name; // 10 m_name_lang + // 11 m_iconFile }; #define MAX_CREATURE_SPELL_DATA_SLOT 4 @@ -787,9 +794,8 @@ struct CreatureSpellDataEntry struct CreatureTypeEntry { uint32 ID; // 0 m_ID - //char* Name[16]; // 1-16 name - // 17 string flags - //uint32 no_expirience; // 18 no exp? critters, non-combat pets, gas cloud. + //DBCString Name; // 1 m_name_lang + //uint32 no_expirience; // 2 m_flags no exp? critters, non-combat pets, gas cloud. }; /* not used @@ -820,24 +826,29 @@ struct CurrencyTypesEntry struct DestructibleModelDataEntry { uint32 Id; + uint32 DamagedDisplayId; //uint32 DamagedUnk1; //uint32 DamagedUnk2; - uint32 DamagedDisplayId; //uint32 DamagedUnk3; + uint32 DestroyedDisplayId; //uint32 DestroyedUnk1; //uint32 DestroyedUnk2; - uint32 DestroyedDisplayId; //uint32 DestroyedUnk3; + //uint32 DestroyedUnk4; + uint32 RebuildingDisplayId; //uint32 RebuildingUnk1; //uint32 RebuildingUnk2; - uint32 RebuildingDisplayId; //uint32 RebuildingUnk3; + //uint32 RebuildingUnk4; + uint32 SmokeDisplayId; //uint32 SmokeUnk1; //uint32 SmokeUnk2; - uint32 SmokeDisplayId; //uint32 SmokeUnk3; - //uint32 Unk4; - //uint32 Unk5; + //uint32 SmokeUnk4; + //uint32 UnkDisplayid; + //uint32 Unk6; + //uint32 Unk7; + //uint32 Unk8; }; struct DungeonEncounterEntry @@ -847,7 +858,7 @@ struct DungeonEncounterEntry uint32 difficulty; // 2 instance mode //uint32 unk0; // 3 uint32 encounterIndex; // 4 encounter index for creating completed mask - char* encounterName[16]; // 5-20 encounter name + DBCString encounterName; // 5-20 encounter name //uint32 nameFlags; // 21 //uint32 unk1; // 22 }; @@ -867,12 +878,13 @@ struct DurabilityQualityEntry struct EmotesEntry { uint32 Id; // 0 - //char* Name; // 1, internal name - //uint32 AnimationId; // 2, ref to animationData + //DBCString Name; // 1, internal name + //uint32 AnimationId; // 2, ref to animationData uint32 Flags; // 3, bitmask, may be unit_flags uint32 EmoteType; // 4, Can be 0, 1 or 2 (determine how emote are shown) uint32 UnitStandState; // 5, uncomfirmed, may be enum UnitStandStateType - //uint32 SoundId; // 6, ref to soundEntries + //uint32 SoundId; // 6, ref to soundEntries + //uint32 unk7 // 7 }; struct EmotesTextEntry @@ -894,10 +906,9 @@ struct FactionEntry float spilloverRateOut; // 20 Faction outputs rep * spilloverRateOut as spillover reputation uint32 spilloverMaxRankIn; // 21 The highest rank the faction will profit from incoming spillover //uint32 spilloverRank_unk; // 22 It does not seem to be the max standing at which a faction outputs spillover ...so no idea - char* name[16]; // 23-38 m_name_lang - // 39 string flags - //char* description[16]; // 40-55 m_description_lang - // 56 string flags + DBCString name; // 23 m_name_lang + //DBCString description; // 24 m_description_lang + //uint32 // 25 // helpers bool CanHaveReputation() const @@ -923,6 +934,8 @@ struct FactionTemplateEntry // helpers bool IsFriendlyTo(FactionTemplateEntry const& entry) const { + if (ID == entry.ID) + return true; if (entry.faction) { for (int i = 0; i < MAX_FACTION_RELATIONS; ++i) @@ -936,6 +949,8 @@ struct FactionTemplateEntry } bool IsHostileTo(FactionTemplateEntry const& entry) const { + if (ID == entry.ID) + return false; if (entry.faction) { for (int i = 0; i < MAX_FACTION_RELATIONS; ++i) @@ -974,9 +989,12 @@ struct GameObjectDisplayInfoEntry struct GemPropertiesEntry { - uint32 ID; - uint32 spellitemenchantement; - uint32 color; + uint32 ID; // 0 m_id + uint32 spellitemenchantement; // 1 m_enchant_id + // 2 m_maxcount_inv + // 3 m_maxcount_item + uint32 color; // 4 m_type + //uint32 // 5 }; struct GlyphPropertiesEntry @@ -1001,21 +1019,25 @@ struct GlyphSlotEntry struct GtBarberShopCostBaseEntry { + //uint32 level; float cost; }; struct GtCombatRatingsEntry { + //uint32 level; float ratio; }; struct GtChanceToMeleeCritBaseEntry { + //uint32 level; float base; }; struct GtChanceToMeleeCritEntry { + //uint32 level; float ratio; }; @@ -1039,10 +1061,15 @@ struct GtOCTRegenHPEntry float ratio; }; -//struct GtOCTRegenMPEntry -//{ -// float ratio; -//}; +struct GtOCTRegenMPEntry +{ + float ratio; +}; + +struct gtOCTHpPerStaminaEntry +{ + float ratio; +}; struct GtRegenHPPerSptEntry { @@ -1058,7 +1085,7 @@ struct GtRegenMPPerSptEntry struct HolidayDescriptionsEntry { uint32 ID; // 0, this is NOT holiday id - //char* name[16] // 1-16 m_name_lang + //DBCString name[16] // 1-16 m_name_lang // 17 name flags }; */ @@ -1067,25 +1094,26 @@ struct HolidayDescriptionsEntry struct HolidayNamesEntry { uint32 ID; // 0, this is NOT holiday id - //char* name[16] // 1-16 m_name_lang + //DBCString name[16] // 1-16 m_name_lang // 17 name flags }; */ struct HolidaysEntry { - uint32 ID; // 0 m_ID - //uint32 duration[10]; // 1-10 m_duration - //uint32 date[26]; // 11-36 m_date (dates in unix time starting at January, 1, 2000) - //uint32 region; // 37 m_region (wow region) - //uint32 looping; // 38 m_looping - //uint32 calendarFlags[10]; // 39-48 m_calendarFlags - //uint32 holidayNameId; // 49 m_holidayNameID (HolidayNames.dbc) - //uint32 holidayDescriptionId; // 50 m_holidayDescriptionID (HolidayDescriptions.dbc) - //char *textureFilename; // 51 m_textureFilename - //uint32 priority; // 52 m_priority - //uint32 calendarFilterType; // 53 m_calendarFilterType (-1 = Fishing Contest, 0 = Unk, 1 = Darkmoon Festival, 2 = Yearly holiday) - //uint32 flags; // 54 m_flags (0 = Darkmoon Faire, Fishing Contest and Wotlk Launch, rest is 1) + uint32 ID; // 0, holiday id + //uint32 unk1; // 1 + //uint32 unk2; // 2 + //uint32 unk3[8] // 3-10, empty fields + //uint32 unk11[13] // 11-23, some unknown data (bit strings?) + //uint32 unk11[13] // 24-36, some empty fields (continue prev?) + //uint32 unk11[12] // 37-48, counters? + //uint32 holidayNameId; // 49, id for HolidayNames.dbc + //uint32 holidayDescriptionId; // 50, id for HolidayDescriptions.dbc + //uint32 unk51; // 51 + //uint32 unk52; // 52 + //uint32 unk53; // 53 + //uint32 unk54; // 54 }; /*struct ItemEntry @@ -1100,11 +1128,19 @@ struct HolidaysEntry uint32 Sheath; // 7 };*/ +struct ItemClassEntry +{ + //uint32 id; // 0 + uint32 Class; // 1 equal to id + //uint32 unk2; // 2 looks like second class + //uint32 unk3; // 3 1 for weapons + //DBCString name; // 4 +}; + struct ItemBagFamilyEntry { uint32 ID; // 0 - //char* name[16] // 1-16 m_name_lang - // // 17 name flags + //DBCString name; // 1 m_name_lang }; struct ItemDisplayInfoEntry @@ -1147,10 +1183,9 @@ struct ItemDisplayInfoEntry struct ItemLimitCategoryEntry { uint32 ID; // 0 Id - //char* name[16] // 1-16 m_name_lang - // 17 name flags - uint32 maxCount; // 18, max allowed equipped as item or in gem slot - uint32 mode; // 19, 0 = have, 1 = equip (enum ItemLimitCategoryMode) + //DBCString name; // 1 m_name_lang + uint32 maxCount; // 2, m_quantity max allowed equipped as item or in gem slot + uint32 mode; // 3, m_flags 0 = have, 1 = equip (enum ItemLimitCategoryMode) }; #define MAX_ITEM_ENCHANTMENT_EFFECTS 3 @@ -1158,23 +1193,19 @@ struct ItemLimitCategoryEntry struct ItemRandomPropertiesEntry { uint32 ID; // 0 m_ID - //char* internalName // 1 m_Name + //DBCString internalName // 1 m_Name uint32 enchant_id[MAX_ITEM_ENCHANTMENT_EFFECTS]; // 2-4 m_Enchantment // 5-6 unused - char* nameSuffix[16]; // 7-22 m_name_lang - // 23 name flags + DBCString nameSuffix; // 7 m_name_lang }; struct ItemRandomSuffixEntry { uint32 ID; // 0 m_ID - char* nameSuffix[16]; // 1-16 m_name_lang - // 17, name flags - // 18 m_internalName - uint32 enchant_id[MAX_ITEM_ENCHANTMENT_EFFECTS]; // 19-21 m_enchantment - //uint32 unk1[2] // 22-23 unknown - uint32 prefix[MAX_ITEM_ENCHANTMENT_EFFECTS]; // 24-26 m_allocationPct - //uint32 unk2[2] // 27-28 unknown + DBCString nameSuffix; // 1 m_name_lang + // 2 m_internalName + uint32 enchant_id[5]; // 3-7 m_enchantment + uint32 prefix[5]; // 8-12 m_allocationPct }; #define MAX_ITEM_SET_ITEMS 10 @@ -1183,35 +1214,33 @@ struct ItemRandomSuffixEntry struct ItemSetEntry { //uint32 id // 0 m_ID - char* name[16]; // 1-16 m_name_lang - // 17 string flags, unused - uint32 itemId[MAX_ITEM_SET_ITEMS]; // 18-27 m_itemID - //uint32 unknown[7]; // 28-34 unk, all 0 - uint32 spells[MAX_ITEM_SET_SPELLS]; // 35-42 m_setSpellID - uint32 items_to_triggerspell[MAX_ITEM_SET_SPELLS]; // 43-50 m_setThreshold - uint32 required_skill_id; // 51 m_requiredSkill - uint32 required_skill_value; // 52 m_requiredSkillRank + DBCString name; // 1 m_name_lang + uint32 itemId[MAX_ITEM_SET_ITEMS]; // 2-18 m_itemID + uint32 spells[MAX_ITEM_SET_SPELLS]; // 19-26 m_setSpellID + uint32 items_to_triggerspell[MAX_ITEM_SET_SPELLS]; // 27-34 m_setThreshold + uint32 required_skill_id; // 35 m_requiredSkill + uint32 required_skill_value; // 36 m_requiredSkillRank }; struct LFGDungeonEntry { uint32 ID; // 0 - //char* name[16]; // 1-17 Name lang + //DBCString name[16]; // 1-17 Name lang uint32 minlevel; // 18 uint32 maxlevel; // 19 uint32 reclevel; // 20 uint32 recminlevel; // 21 uint32 recmaxlevel; // 22 - int32 map; // 23 + int32 map; // 23 uint32 difficulty; // 24 - //uint32 flags; // 25 + //uint32 unk; // 25 uint32 type; // 26 - //uint32 unk; // 27 - //char* iconname; // 28 + //uint32 unk2; // 27 + //DBCString unk3; // 28 uint32 expansion; // 29 //uint32 unk4; // 30 uint32 grouptype; // 31 - //char* desc[16]; // 32-47 Description + //DBCString desc; // 32-47 Description // Helpers uint32 Entry() const { return ID + (type << 24); } }; @@ -1249,37 +1278,42 @@ struct LockEntry //uint32 Action[MAX_LOCK_CASE]; // 25-32 m_Action }; +struct PhaseEntry +{ + uint32 ID; // 0 + DBCString Name; // 1 + uint32 phaseShift; // 2 +}; + struct MailTemplateEntry { uint32 ID; // 0 - //char* subject[16]; // 1-16 - // 17 name flags, unused - char* content[16]; // 18-33 + //DBCString subject; // 1 m_subject_lang + DBCString content; // 2 m_body_lang }; struct MapEntry { uint32 MapID; // 0 - //char* internalname; // 1 unused + //DBCString internalname; // 1 unused uint32 map_type; // 2 //uint32 unk_330; // 3 - // 4 0 or 1 for battlegrounds (not arenas) - char* name[16]; // 5-20 - // 21 name flags, unused - uint32 linked_zone; // 22 common zone for instance and continent map - //char* hordeIntro[16]; // 23-38 text for PvP Zones - // 39 intro text flags - //char* allianceIntro[16]; // 40-55 text for PvP Zones - // 56 intro text flags - uint32 multimap_id; // 57 - // 58 - int32 entrance_map; // 59 map_id of entrance map - float entrance_x; // 60 entrance x coordinate (if exist single entry) - float entrance_y; // 61 entrance y coordinate (if exist single entry) - // 62 -1, 0 and 720 - uint32 addon; // 63 (0-original maps, 1-tbc addon) - uint32 unk_time; // 64 some kind of time? - //uint32 maxPlayers; // 65 max players + //uint32 unk4; // 4 4.0.1 + //uint32 isPvP; // 5 m_PVP 0 or 1 for battlegrounds (not arenas) + DBCString name; // 6 m_MapName_lang + uint32 linked_zone; // 7 m_areaTableID + //DBCString hordeIntro; // 8 m_MapDescription0_lang + //DBCString allianceIntro; // 9 m_MapDescription1_lang + uint32 multimap_id; // 10 m_LoadingScreenID (LoadingScreens.dbc) + //float BattlefieldMapIconScale; // 11 m_minimapIconScale + int32 entrance_map; // 12 m_corpseMapID map_id of entrance map in ghost mode (continent always and in most cases = normal entrance) + float entrance_x; // 13 m_corpseX entrance x coordinate in ghost mode (in most cases = normal entrance) + float entrance_y; // 14 m_corpseY entrance y coordinate in ghost mode (in most cases = normal entrance) + //uint32 timeOfDayOverride; // 15 m_timeOfDayOverride + uint32 addon; // 16 m_expansionID + uint32 unk_time; // 17 m_raidOffset + //uint32 maxPlayers; // 18 m_maxPlayers + //uint32 unk400; // 19 new 4.0.0, mapid, related to phasing // Helpers uint32 Expansion() const { return addon; } @@ -1313,18 +1347,18 @@ struct MapDifficultyEntry //uint32 Id; // 0 uint32 MapId; // 1 uint32 Difficulty; // 2 (for arenas: arena slot) - char* areaTriggerText; // 3-18 text showed when transfer to map failed (missing requirements) - //uint32 textFlags; // 19 - uint32 resetTime; // 20 - uint32 maxPlayers; // 21 - //char* difficultyString; // 22 + DBCString areaTriggerText; // 3 m_message_lang (text showed when transfer to map failed) + uint32 resetTime; // 4, m_raidDuration in secs, 0 if no fixed reset time + uint32 maxPlayers; // 5, m_maxPlayers some heroic versions have 0 when expected same amount as in normal version + //DBCString difficultyString; // 6 m_difficultystring }; struct MovieEntry { uint32 Id; // 0 index - //char* filename; // 1 - //uint32 unk2; // 2 always 100 + //DBCString filename; // 1 + //uint32 unk1; // 2 m_volume + //uint32 unk2; // 3 4.0.0 }; #define MAX_OVERRIDE_SPELL 10 @@ -1334,6 +1368,7 @@ struct OverrideSpellDataEntry uint32 id; // 0 uint32 spellId[MAX_OVERRIDE_SPELL]; // 1-10 //uint32 unk0; // 11 + //uint32 unk3; // 12 possibly flag }; struct PvPDifficultyEntry @@ -1352,8 +1387,7 @@ struct PvPDifficultyEntry struct QuestSortEntry { uint32 id; // 0 m_ID - //char* name[16]; // 1-16 m_SortName_lang - // 17 name flags + //DBCString name; // 1 m_SortName_lang }; struct QuestXPEntry @@ -1382,32 +1416,38 @@ struct ScalingStatDistributionEntry uint32 Id; // 0 int32 StatMod[10]; // 1-10 uint32 Modifier[10]; // 11-20 - uint32 MaxLevel; // 21 + //uint32 unk1; // 21 + uint32 MaxLevel; // 22 m_maxlevel }; struct ScalingStatValuesEntry { uint32 Id; // 0 uint32 Level; // 1 - uint32 ssdMultiplier[4]; // 2-5 Multiplier for ScalingStatDistribution - uint32 armorMod[4]; // 6-9 Armor for level - uint32 dpsMod[6]; // 10-15 DPS mod for level - uint32 spellBonus; // 16 spell power for level - uint32 ssdMultiplier2; // 17 there's data from 3.1 dbc ssdMultiplier[3] - uint32 ssdMultiplier3; // 18 3.3 - //uint32 unk2; // 19 unk, probably also Armor for level (flag 0x80000?) - uint32 armorMod2[4]; // 20-23 Armor for level + uint32 dpsMod[6]; // 2-7 DPS mod for level + uint32 spellBonus; // 8 spell power for level + uint32 ssdMultiplier[5]; // 9-13 Multiplier for ScalingStatDistribution + uint32 armorMod[4]; // 14-17 Armor for level + uint32 armorMod2[4]; // 18-21 Armor for level + //uint32 trash[24]; // 22-45 + //uint32 unk2; // 46 unk, probably also Armor for level (flag 0x80000?) uint32 getssdMultiplier(uint32 mask) const { if (mask & 0x4001F) { - if (mask & 0x00000001) return ssdMultiplier[0]; - if (mask & 0x00000002) return ssdMultiplier[1]; - if (mask & 0x00000004) return ssdMultiplier[2]; - if (mask & 0x00000008) return ssdMultiplier2; - if (mask & 0x00000010) return ssdMultiplier[3]; - if (mask & 0x00040000) return ssdMultiplier3; + if (mask & 0x00000001) + return ssdMultiplier[1]; + if (mask & 0x00000002) + return ssdMultiplier[2]; // 0 and 1 were duplicated + if (mask & 0x00000004) + return ssdMultiplier[3]; + if (mask & 0x00000008) + return ssdMultiplier[0]; + if (mask & 0x00000010) + return ssdMultiplier[4]; + if (mask & 0x00040000) + return ssdMultiplier[2]; // 4.0.0 } return 0; } @@ -1416,15 +1456,23 @@ struct ScalingStatValuesEntry { if (mask & 0x00F001E0) { - if (mask & 0x00000020) return armorMod[0]; - if (mask & 0x00000040) return armorMod[1]; - if (mask & 0x00000080) return armorMod[2]; - if (mask & 0x00000100) return armorMod[3]; - - if (mask & 0x00100000) return armorMod2[0]; // cloth - if (mask & 0x00200000) return armorMod2[1]; // leather - if (mask & 0x00400000) return armorMod2[2]; // mail - if (mask & 0x00800000) return armorMod2[3]; // plate + if (mask & 0x00000020) + return armorMod[0]; + if (mask & 0x00000040) + return armorMod[1]; + if (mask & 0x00000080) + return armorMod[2]; + if (mask & 0x00000100) + return armorMod[3]; + + if (mask & 0x00100000) + return armorMod2[0]; // cloth + if (mask & 0x00200000) + return armorMod2[1]; // leather + if (mask & 0x00400000) + return armorMod2[2]; // mail + if (mask & 0x00800000) + return armorMod2[3]; // plate } return 0; } @@ -1432,23 +1480,31 @@ struct ScalingStatValuesEntry { if (mask&0x7E00) { - if (mask & 0x00000200) return dpsMod[0]; - if (mask & 0x00000400) return dpsMod[1]; - if (mask & 0x00000800) return dpsMod[2]; - if (mask & 0x00001000) return dpsMod[3]; - if (mask & 0x00002000) return dpsMod[4]; - if (mask & 0x00004000) return dpsMod[5]; // not used? + if (mask & 0x00000200) + return dpsMod[0]; + if (mask & 0x00000400) + return dpsMod[1]; + if (mask & 0x00000800) + return dpsMod[2]; + if (mask & 0x00001000) + return dpsMod[3]; + if (mask & 0x00002000) + return dpsMod[4]; + if (mask & 0x00004000) + return dpsMod[5]; // not used? } return 0; } uint32 getSpellBonus(uint32 mask) const { - if (mask & 0x00008000) return spellBonus; + if (mask & 0x00008000) + return spellBonus; return 0; } uint32 getFeralBonus(uint32 mask) const // removed in 3.2.x? { - if (mask & 0x00010000) return 0; // not used? + if (mask & 0x00010000) + return 0; // not used? return 0; } }; @@ -1482,14 +1538,11 @@ struct SkillLineEntry uint32 id; // 0 m_ID int32 categoryId; // 1 m_categoryID //uint32 skillCostID; // 2 m_skillCostsID - char* name[16]; // 3-18 m_displayName_lang - // 19 string flags - //char* description[16]; // 20-35 m_description_lang - // 36 string flags - uint32 spellIcon; // 37 m_spellIconID - //char* alternateVerb[16]; // 38-53 m_alternateVerb_lang - // 54 string flags - uint32 canLink; // 55 m_canLink (prof. with recipes + DBCString name; // 3 m_displayName_lang + //DBCString description; // 4 m_description_lang + uint32 spellIcon; // 5 m_spellIconID + //DBCString alternateVerb; // 6 m_alternateVerb_lang + uint32 canLink; // 7 m_canLink (prof. with recipes) }; struct SkillLineAbilityEntry @@ -1506,23 +1559,28 @@ struct SkillLineAbilityEntry uint32 learnOnGetSkill; // 9 m_acquireMethod uint32 max_value; // 10 m_trivialSkillLineRankHigh uint32 min_value; // 11 m_trivialSkillLineRankLow - //uint32 characterPoints[2]; // 12-13 m_characterPoints[2] + //uint32 // 12 + //uint32 // 13 4.0.0 }; struct SoundEntriesEntry { uint32 Id; // 0 m_ID //uint32 Type; // 1 m_soundType - //char* InternalName; // 2 m_name - //char* FileName[10]; // 3-12 m_File[10] + //DBCString InternalName; // 2 m_name + //DBCString FileName[10]; // 3-12 m_File[10] //uint32 Unk13[10]; // 13-22 m_Freq[10] - //char* Path; // 23 m_DirectoryBase + //DBCString Path; // 23 m_DirectoryBase // 24 m_volumeFloat // 25 m_flags // 26 m_minDistance // 27 m_distanceCutoff // 28 m_EAXDef - // 29 new in 3.1 + // 29 m_soundEntriesAdvancedID, new in 3.1 + //unk // 30 4.0.0 + //unk // 31 4.0.0 + //unk // 32 4.0.0 + //unk // 33 4.0.0 }; #define MAX_SPELL_EFFECTS 3 @@ -1782,27 +1840,27 @@ struct TalentEntry uint32 Row; // 2 uint32 Col; // 3 uint32 RankID[MAX_TALENT_RANK]; // 4-8 - // 9-12 not used, always 0, maybe not used high ranks - uint32 DependsOn; // 13 index in Talent.dbc (TalentEntry) - // 14-15 not used - uint32 DependsOnRank; // 16 - // 17-18 not used - //uint32 needAddInSpellBook; // 19 also need disable higest ranks on reset talent tree - //uint32 unk2; // 20, all 0 - //uint64 allowForPet; // 21 its a 64 bit mask for pet 1< GT_MAX_LEVEL) level = GT_MAX_LEVEL; - GtOCTRegenHPEntry const* baseRatio = sGtOCTRegenHPStore.LookupEntry((pclass-1)*GT_MAX_LEVEL + level-1); - GtRegenHPPerSptEntry const* moreRatio = sGtRegenHPPerSptStore.LookupEntry((pclass-1)*GT_MAX_LEVEL + level-1); - if (baseRatio == NULL || moreRatio == NULL) - return 0.0f; - // Formula from PaperDollFrame script float spirit = GetStat(STAT_SPIRIT); float baseSpirit = spirit; if (baseSpirit > 50) baseSpirit = 50; float moreSpirit = spirit - baseSpirit; - float regen = baseSpirit * baseRatio->ratio + moreSpirit * moreRatio->ratio; + float regen = baseSpirit + moreSpirit; return regen; } diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 7261d81bafa..aa5fed118c8 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -6712,7 +6712,7 @@ std::string ObjectMgr::GeneratePetName(uint32 entry) if (list0.empty() || list1.empty()) { CreatureTemplate const* cinfo = GetCreatureTemplate(entry); - char* petname = GetPetName(cinfo->family, sWorld->GetDefaultDbcLocale()); + const char* petname = GetPetName(cinfo->family, sWorld->GetDefaultDbcLocale()); if (!petname) return cinfo->Name; diff --git a/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp b/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp index a675214930a..a2aa5ea3c50 100755 --- a/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp @@ -753,7 +753,7 @@ void WorldSession::HandleBuyStableSlot(WorldPacket & recv_data) if (GetPlayer()->m_stableSlots < MAX_PET_STABLES) { - StableSlotPricesEntry const* SlotPrice = sStableSlotPricesStore.LookupEntry(GetPlayer()->m_stableSlots+1); + /*StableSlotPricesEntry const* SlotPrice = sStableSlotPricesStore.LookupEntry(GetPlayer()->m_stableSlots+1); if (_player->HasEnoughMoney(SlotPrice->Price)) { ++GetPlayer()->m_stableSlots; @@ -761,7 +761,7 @@ void WorldSession::HandleBuyStableSlot(WorldPacket & recv_data) SendStableResult(STABLE_SUCCESS_BUY_SLOT); } else - SendStableResult(STABLE_ERR_MONEY); + SendStableResult(STABLE_ERR_MONEY);*/ } else SendStableResult(STABLE_ERR_STABLE); diff --git a/src/server/shared/DataStores/DB2Store.h b/src/server/shared/DataStores/DB2Store.h index a90dba5d768..d1fbc5f36a3 100644 --- a/src/server/shared/DataStores/DB2Store.h +++ b/src/server/shared/DataStores/DB2Store.h @@ -113,7 +113,7 @@ public: indexTable = NULL; delete[] ((char*)m_dataTable); m_dataTable = NULL; - for (DataTableEx::const_iterator itr = m_dataTableEx.begin(); itr != m_dataTableEx.end(); ++itr) + for (typename DataTableEx::const_iterator itr = m_dataTableEx.begin(); itr != m_dataTableEx.end(); ++itr) delete *itr; m_dataTableEx.clear(); -- cgit v1.2.3 From 34f0792f75cbb82f118961a27183d5aedfcc4e0d Mon Sep 17 00:00:00 2001 From: Rat Date: Tue, 22 Nov 2011 16:50:00 +0100 Subject: fixed startup crash while loading instance_encounters --- src/server/game/Globals/ObjectMgr.cpp | 12 ++++++------ src/server/game/Instances/InstanceScript.cpp | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index aa5fed118c8..9ba54446508 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -1492,7 +1492,7 @@ void ObjectMgr::LoadCreatures() } if (data.spawnMask & ~spawnMasks[data.mapid]) - sLog->outErrorDb("Table `creature` have creature (GUID: %u) that have wrong spawn mask %u including not supported difficulty modes for map (Id: %u).", guid, data.spawnMask, data.mapid); + sLog->outErrorDb("Table `creature` have creature (GUID: %u) that have wrong spawn mask %u including not supported difficulty modes for map (Id: %u) spawnMasks[data.mapid]: %u.", guid, data.spawnMask, data.mapid, spawnMasks[data.mapid]); bool ok = true; for (uint32 diff = 0; diff < MAX_DIFFICULTY - 1 && ok; ++diff) @@ -5156,7 +5156,7 @@ void ObjectMgr::LoadInstanceEncounters() if (lastEncounterDungeon && !sLFGDungeonStore.LookupEntry(lastEncounterDungeon)) { - sLog->outErrorDb("Table `instance_encounters` has an encounter %u (%s) marked as final for invalid dungeon id %u, skipped!", entry, dungeonEncounter->encounterName[0], lastEncounterDungeon); + sLog->outErrorDb("Table `instance_encounters` has an encounter %u (%s) marked as final for invalid dungeon id %u, skipped!", entry, dungeonEncounter->encounterName, lastEncounterDungeon); continue; } @@ -5165,7 +5165,7 @@ void ObjectMgr::LoadInstanceEncounters() { if (itr != dungeonLastBosses.end()) { - sLog->outErrorDb("Table `instance_encounters` specified encounter %u (%s) as last encounter but %u (%s) is already marked as one, skipped!", entry, dungeonEncounter->encounterName[0], itr->second->id, itr->second->encounterName[0]); + sLog->outErrorDb("Table `instance_encounters` specified encounter %u (%s) as last encounter but %u (%s) is already marked as one, skipped!", entry, dungeonEncounter->encounterName, itr->second->id, itr->second->encounterName[0]); continue; } @@ -5179,7 +5179,7 @@ void ObjectMgr::LoadInstanceEncounters() CreatureTemplate const* creatureInfo = GetCreatureTemplate(creditEntry); if (!creatureInfo) { - sLog->outErrorDb("Table `instance_encounters` has an invalid creature (entry %u) linked to the encounter %u (%s), skipped!", creditEntry, entry, dungeonEncounter->encounterName[0]); + sLog->outErrorDb("Table `instance_encounters` has an invalid creature (entry %u) linked to the encounter %u (%s), skipped!", creditEntry, entry, dungeonEncounter->encounterName); continue; } const_cast(creatureInfo)->flags_extra |= CREATURE_FLAG_EXTRA_DUNGEON_BOSS; @@ -5188,12 +5188,12 @@ void ObjectMgr::LoadInstanceEncounters() case ENCOUNTER_CREDIT_CAST_SPELL: if (!sSpellMgr->GetSpellInfo(creditEntry)) { - sLog->outErrorDb("Table `instance_encounters` has an invalid spell (entry %u) linked to the encounter %u (%s), skipped!", creditEntry, entry, dungeonEncounter->encounterName[0]); + sLog->outErrorDb("Table `instance_encounters` has an invalid spell (entry %u) linked to the encounter %u (%s), skipped!", creditEntry, entry, dungeonEncounter->encounterName); continue; } break; default: - sLog->outErrorDb("Table `instance_encounters` has an invalid credit type (%u) for encounter %u (%s), skipped!", creditType, entry, dungeonEncounter->encounterName[0]); + sLog->outErrorDb("Table `instance_encounters` has an invalid credit type (%u) for encounter %u (%s), skipped!", creditType, entry, dungeonEncounter->encounterName); continue; } diff --git a/src/server/game/Instances/InstanceScript.cpp b/src/server/game/Instances/InstanceScript.cpp index f0e21f7f709..f9525a2af1e 100755 --- a/src/server/game/Instances/InstanceScript.cpp +++ b/src/server/game/Instances/InstanceScript.cpp @@ -432,7 +432,7 @@ void InstanceScript::UpdateEncounterState(EncounterCreditType type, uint32 credi if ((*itr)->creditType == type && (*itr)->creditEntry == creditEntry) { completedEncounters |= 1 << (*itr)->dbcEntry->encounterIndex; - sLog->outDebug(LOG_FILTER_TSCR, "Instance %s (instanceId %u) completed encounter %s", instance->GetMapName(), instance->GetInstanceId(), (*itr)->dbcEntry->encounterName[0]); + sLog->outDebug(LOG_FILTER_TSCR, "Instance %s (instanceId %u) completed encounter %s", instance->GetMapName(), instance->GetInstanceId(), (*itr)->dbcEntry->encounterName); if (uint32 dungeonId = (*itr)->lastEncounterDungeon) { Map::PlayerList const& players = instance->GetPlayers(); -- cgit v1.2.3 From dd80a880dc30a337c35fe477bdb8883f9ba09bb1 Mon Sep 17 00:00:00 2001 From: Rat Date: Wed, 23 Nov 2011 13:16:45 +0100 Subject: updated all remaining dbc structures --- src/server/game/DataStores/DBCStores.cpp | 143 ++++++- src/server/game/DataStores/DBCStores.h | 39 +- src/server/game/DataStores/DBCStructure.h | 482 ++++++++++++++++------ src/server/game/DataStores/DBCfmt.h | 30 +- src/server/game/Entities/Player/Player.cpp | 2 +- src/server/game/Entities/Unit/Unit.cpp | 4 +- src/server/game/Quests/QuestDef.cpp | 4 +- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 2 +- src/server/game/Spells/Spell.cpp | 2 +- src/server/game/Spells/SpellInfo.cpp | 321 ++++++++++---- src/server/game/Spells/SpellInfo.h | 48 ++- src/server/game/Spells/SpellMgr.cpp | 4 +- 12 files changed, 820 insertions(+), 261 deletions(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index c5915b50967..fc587f8da9e 100755 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -121,6 +121,18 @@ DBCStorage sItemRandomPropertiesStore(ItemRandomProp DBCStorage sItemRandomSuffixStore(ItemRandomSuffixfmt); DBCStorage sItemSetStore(ItemSetEntryfmt); +DBCStorage sItemArmorQualityStore(ItemArmorQualityfmt); +DBCStorage sItemArmorShieldStore(ItemArmorShieldfmt); +DBCStorage sItemArmorTotalStore(ItemArmorTotalfmt); +DBCStorage sItemDamageAmmoStore(ItemDamagefmt); +DBCStorage sItemDamageOneHandStore(ItemDamagefmt); +DBCStorage sItemDamageOneHandCasterStore(ItemDamagefmt); +DBCStorage sItemDamageRangedStore(ItemDamagefmt); +DBCStorage sItemDamageThrownStore(ItemDamagefmt); +DBCStorage sItemDamageTwoHandStore(ItemDamagefmt); +DBCStorage sItemDamageTwoHandCasterStore(ItemDamagefmt); +DBCStorage sItemDamageWandStore(ItemDamagefmt); + DBCStorage sLFGDungeonStore(LFGDungeonEntryfmt); //DBCStorage sLiquidTypeStore(LiquidTypeEntryfmt); DBCStorage sLockStore(LockEntryfmt); @@ -156,14 +168,36 @@ DBCStorage sSpellStore(SpellEntryfmt); SpellCategoryStore sSpellCategoryStore; PetFamilySpellsStore sPetFamilySpellsStore; + +DBCStorage sSpellReagentsStore(SpellReagentsEntryfmt); +DBCStorage sSpellScalingStore(SpellScalingEntryfmt); +DBCStorage sSpellTotemsStore(SpellTotemsEntryfmt); +DBCStorage sSpellTargetRestrictionsStore(SpellTargetRestrictionsEntryfmt); +DBCStorage sSpellPowerStore(SpellPowerEntryfmt); +DBCStorage sSpellLevelsStore(SpellLevelsEntryfmt); +DBCStorage sSpellInterruptsStore(SpellInterruptsEntryfmt); +DBCStorage sSpellEquippedItemsStore(SpellEquippedItemsEntryfmt); +DBCStorage sSpellClassOptionsStore(SpellClassOptionsEntryfmt); +DBCStorage sSpellCooldownsStore(SpellCooldownsEntryfmt); +DBCStorage sSpellAuraOptionsStore(SpellAuraOptionsEntryfmt); +DBCStorage sSpellAuraRestrictionsStore(SpellAuraRestrictionsEntryfmt); +DBCStorage sSpellCastingRequirementsStore(SpellCastingRequirementsEntryfmt); + +SpellEffectMap sSpellEffectMap; +SpellReagentMap sSpellReagentMap; +SpellTotemMap sSpellTotemMap; + DBCStorage sSpellCastTimesStore(SpellCastTimefmt); +DBCStorage sSpellCategoriesStore(SpellCategoriesEntryfmt); +DBCStorage sSpellEffectStore(SpellEffectEntryfmt); DBCStorage sSpellDifficultyStore(SpellDifficultyfmt); DBCStorage sSpellDurationStore(SpellDurationfmt); DBCStorage sSpellFocusObjectStore(SpellFocusObjectfmt); DBCStorage sSpellRadiusStore(SpellRadiusfmt); DBCStorage sSpellRangeStore(SpellRangefmt); DBCStorage sSpellRuneCostStore(SpellRuneCostfmt); -DBCStorage sSpellShapeshiftStore(SpellShapeshiftfmt); +DBCStorage sSpellShapeshiftStore(SpellShapeshiftEntryfmt); +DBCStorage sSpellShapeshiftFormStore(SpellShapeshiftFormfmt); DBCStorage sStableSlotPricesStore(StableSlotPricesfmt); DBCStorage sSummonPropertiesStore(SummonPropertiesfmt); DBCStorage sTalentStore(TalentEntryfmt); @@ -362,6 +396,19 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sItemRandomSuffixStore, dbcPath, "ItemRandomSuffix.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sItemSetStore, dbcPath, "ItemSet.dbc");//14545 + + LoadDBC(availableDbcLocales, bad_dbc_files, sItemArmorQualityStore, dbcPath, "ItemArmorQuality.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sItemArmorShieldStore, dbcPath, "ItemArmorShield.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sItemArmorTotalStore, dbcPath, "ItemArmorTotal.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sItemDamageAmmoStore, dbcPath, "ItemDamageAmmo.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sItemDamageOneHandStore, dbcPath, "ItemDamageOneHand.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sItemDamageOneHandCasterStore,dbcPath, "ItemDamageOneHandCaster.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sItemDamageRangedStore, dbcPath, "ItemDamageRanged.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sItemDamageThrownStore, dbcPath, "ItemDamageThrown.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sItemDamageTwoHandStore, dbcPath, "ItemDamageTwoHand.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sItemDamageTwoHandCasterStore,dbcPath, "ItemDamageTwoHandCaster.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sItemDamageWandStore, dbcPath, "ItemDamageWand.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sItemClassStore, dbcPath,"ItemClass.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sLFGDungeonStore, dbcPath, "LFGDungeons.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sLockStore, dbcPath, "Lock.dbc");//14545 @@ -371,7 +418,7 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sMapStore, dbcPath, "Map.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sMapDifficultyStore, dbcPath, "MapDifficulty.dbc");//14545 // fill data - sMapDifficultyMap[MAKE_PAIR32(0, 0)] = MapDifficulty(0, 0, 0);//map 0 is missingg from MapDifficulty.dbc use this till its ported to sql + sMapDifficultyMap[MAKE_PAIR32(0, 0)] = MapDifficulty(0, 0, false);//map 0 is missingg from MapDifficulty.dbc use this till its ported to sql for (uint32 i = 0; i < sMapDifficultyStore.GetNumRows(); ++i) if (MapDifficultyEntry const* entry = sMapDifficultyStore.LookupEntry(i)) sMapDifficultyMap[MAKE_PAIR32(entry->MapId, entry->Difficulty)] = MapDifficulty(entry->resetTime, entry->maxPlayers, entry->areaTriggerText[0] > 0); @@ -398,34 +445,37 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sSkillLineStore, dbcPath, "SkillLine.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sSkillLineAbilityStore, dbcPath, "SkillLineAbility.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sSoundEntriesStore, dbcPath, "SoundEntries.dbc");//14545 - LoadDBC(availableDbcLocales, bad_dbc_files, sSpellStore, dbcPath, "Spell.dbc", &CustomSpellEntryfmt, &CustomSpellEntryIndex);//todo + LoadDBC(availableDbcLocales, bad_dbc_files, sSpellStore, dbcPath, "Spell.dbc"/*, &CustomSpellEntryfmt, &CustomSpellEntryIndex*/);// for (uint32 i = 1; i < sSpellStore.GetNumRows(); ++i) { - SpellEntry const* spell = sSpellStore.LookupEntry(i); + SpellCategoriesEntry const* spell = sSpellCategoriesStore.LookupEntry(i); if (spell && spell->Category) sSpellCategoryStore[spell->Category].insert(i); } for (uint32 j = 0; j < sSkillLineAbilityStore.GetNumRows(); ++j) { - SkillLineAbilityEntry const* skillLine = sSkillLineAbilityStore.LookupEntry(j); + SkillLineAbilityEntry const *skillLine = sSkillLineAbilityStore.LookupEntry(j); if (!skillLine) continue; SpellEntry const* spellInfo = sSpellStore.LookupEntry(skillLine->spellId); - if (spellInfo && spellInfo->Attributes & SPELL_ATTR0_PASSIVE) { for (uint32 i = 1; i < sCreatureFamilyStore.GetNumRows(); ++i) { + SpellLevelsEntry const* levels = sSpellLevelsStore.LookupEntry(i); + if (!levels) + continue; + CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(i); if (!cFamily) continue; if (skillLine->skillId != cFamily->skillLine[0] && skillLine->skillId != cFamily->skillLine[1]) continue; - if (spellInfo->spellLevel) + if (levels->spellLevel) continue; if (skillLine->learnOnGetSkill != ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL) @@ -436,16 +486,41 @@ void LoadDBCStores(const std::string& dataPath) } } - LoadDBC(availableDbcLocales, bad_dbc_files, sSpellCastTimesStore, dbcPath, "SpellCastTimes.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sSpellDifficultyStore, dbcPath, "SpellDifficulty.dbc", &CustomSpellDifficultyfmt, &CustomSpellDifficultyIndex); - LoadDBC(availableDbcLocales, bad_dbc_files, sSpellDurationStore, dbcPath, "SpellDuration.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sSpellFocusObjectStore, dbcPath, "SpellFocusObject.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sSpellItemEnchantmentStore, dbcPath, "SpellItemEnchantment.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sSpellItemEnchantmentConditionStore, dbcPath, "SpellItemEnchantmentCondition.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sSpellRadiusStore, dbcPath, "SpellRadius.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sSpellRangeStore, dbcPath, "SpellRange.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sSpellRuneCostStore, dbcPath, "SpellRuneCost.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sSpellShapeshiftStore, dbcPath, "SpellShapeshiftForm.dbc"); + + LoadDBC(availableDbcLocales, bad_dbc_files, sSpellReagentsStore, dbcPath,"SpellReagents.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sSpellScalingStore, dbcPath,"SpellScaling.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sSpellTotemsStore, dbcPath,"SpellTotems.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sSpellTargetRestrictionsStore,dbcPath,"SpellTargetRestrictions.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sSpellPowerStore, dbcPath,"SpellPower.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sSpellLevelsStore, dbcPath,"SpellLevels.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sSpellInterruptsStore, dbcPath,"SpellInterrupts.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sSpellEquippedItemsStore, dbcPath,"SpellEquippedItems.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sSpellClassOptionsStore, dbcPath,"SpellClassOptions.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sSpellCooldownsStore, dbcPath,"SpellCooldowns.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sSpellAuraOptionsStore, dbcPath,"SpellAuraOptions.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sSpellAuraRestrictionsStore, dbcPath,"SpellAuraRestrictions.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sSpellCastingRequirementsStore, dbcPath,"SpellCastingRequirements.dbc");//14545 + + LoadDBC(availableDbcLocales, bad_dbc_files, sSpellCategoriesStore, dbcPath,"SpellCategories.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sSpellEffectStore, dbcPath,"SpellEffect.dbc");//14545 + + for(uint32 i = 1; i < sSpellEffectStore.GetNumRows(); ++i) + { + if(SpellEffectEntry const *spellEffect = sSpellEffectStore.LookupEntry(i)) + sSpellEffectMap[spellEffect->EffectSpellId].effects[spellEffect->EffectIndex] = spellEffect; + } + + LoadDBC(availableDbcLocales, bad_dbc_files, sSpellCastTimesStore, dbcPath, "SpellCastTimes.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sSpellDifficultyStore, dbcPath, "SpellDifficulty.dbc"/*, &CustomSpellDifficultyfmt, &CustomSpellDifficultyIndex*/);//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sSpellDurationStore, dbcPath, "SpellDuration.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sSpellFocusObjectStore, dbcPath, "SpellFocusObject.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sSpellItemEnchantmentStore, dbcPath, "SpellItemEnchantment.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sSpellItemEnchantmentConditionStore, dbcPath, "SpellItemEnchantmentCondition.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sSpellRadiusStore, dbcPath, "SpellRadius.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sSpellRangeStore, dbcPath, "SpellRange.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sSpellRuneCostStore, dbcPath, "SpellRuneCost.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sSpellShapeshiftStore, dbcPath, "SpellShapeshift.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sSpellShapeshiftFormStore, dbcPath, "SpellShapeshiftForm.dbc");//14545 //LoadDBC(availableDbcLocales, bad_dbc_files, sStableSlotPricesStore, dbcPath, "StableSlotPrices.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sSummonPropertiesStore, dbcPath, "SummonProperties.dbc");//14545 @@ -543,10 +618,9 @@ void LoadDBCStores(const std::string& dataPath) { std::set spellPaths; for (uint32 i = 1; i < sSpellStore.GetNumRows (); ++i) - if (SpellEntry const* sInfo = sSpellStore.LookupEntry (i)) - for (int j = 0; j < MAX_SPELL_EFFECTS; ++j) - if (sInfo->Effect[j] == SPELL_EFFECT_SEND_TAXI) - spellPaths.insert(sInfo->EffectMiscValue[j]); + if (SpellEffectEntry const* sInfo = sSpellEffectStore.LookupEntry (i)) + if (sInfo->Effect == SPELL_EFFECT_SEND_TAXI) + spellPaths.insert(sInfo->EffectMiscValue); memset(sTaxiNodesMask, 0, sizeof(sTaxiNodesMask)); memset(sOldContinentsNodesMask, 0, sizeof(sOldContinentsNodesMask)); @@ -666,6 +740,33 @@ char const* GetPetName(uint32 petfamily, uint32 dbclang) return pet_family->Name[dbclang]?pet_family->Name[dbclang]:NULL; } +SpellEffectEntry const* GetSpellEffectEntry(uint32 spellId, uint32 effect) +{ + SpellEffectMap::const_iterator itr = sSpellEffectMap.find(spellId); + if(itr == sSpellEffectMap.end()) + return NULL; + + return itr->second.effects[effect]; +} + +SpellReagentsEntry const* GetSpellReagentEntry(uint32 spellId, uint8 reagent) +{ + SpellReagentMap::const_iterator itr = sSpellReagentMap.find(spellId); + if(itr == sSpellReagentMap.end()) + return NULL; + + return itr->second.reagents[reagent]; +} + +SpellTotemsEntry const* GetSpellTotemEntry(uint32 spellId, uint8 totem) +{ + SpellTotemMap::const_iterator itr = sSpellTotemMap.find(spellId); + if(itr == sSpellTotemMap.end()) + return NULL; + + return itr->second.totems[totem]; +} + TalentSpellPos const* GetTalentSpellPos(uint32 spellId) { TalentSpellPosMap::const_iterator itr = sTalentSpellPosMap.find(spellId); diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h index c10c19fc428..c031b935faa 100755 --- a/src/server/game/DataStores/DBCStores.h +++ b/src/server/game/DataStores/DBCStores.h @@ -31,6 +31,9 @@ SimpleFactionsList const* GetFactionTeamList(uint32 faction); char const* GetPetName(uint32 petfamily, uint32 dbclang); uint32 GetTalentSpellCost(uint32 spellId); TalentSpellPos const* GetTalentSpellPos(uint32 spellId); +SpellEffectEntry const* GetSpellEffectEntry(uint32 spellId, uint32 effect); +SpellReagentsEntry const* GetSpellReagentEntry(uint32 spellId, uint8 reagent); +SpellTotemsEntry const* GetSpellTotemEntry(uint32 spellId, uint8 totem); int32 GetAreaFlagByAreaID(uint32 area_id); // -1 if not found AreaTableEntry const* GetAreaEntryByAreaID(uint32 area_id); @@ -106,24 +109,33 @@ extern DBCStorage sGtChanceToMeleeCritStore; extern DBCStorage sGtChanceToSpellCritBaseStore; extern DBCStorage sGtChanceToSpellCritStore; extern DBCStorage sGtOCTClassCombatRatingScalarStore; -extern DBCStorage sGtOCTRegenHPStore; //extern DBCStorage sGtOCTRegenMPStore; -- not used currently extern DBCStorage sGtRegenHPPerSptStore; +extern DBCStorage sGtOCTHpPerStaminaStore; extern DBCStorage sGtRegenMPPerSptStore; extern DBCStorage sHolidaysStore; -//extern DBCStorage sItemStore; +extern DBCStorage sItemArmorQualityStore; +extern DBCStorage sItemArmorShieldStore; +extern DBCStorage sItemArmorTotalStore; extern DBCStorage sItemBagFamilyStore; +extern DBCStorage sItemDamageAmmoStore; +extern DBCStorage sItemDamageOneHandStore; +extern DBCStorage sItemDamageOneHandCasterStore; +extern DBCStorage sItemDamageRangedStore; +extern DBCStorage sItemDamageThrownStore; +extern DBCStorage sItemDamageTwoHandStore; +extern DBCStorage sItemDamageTwoHandCasterStore; +extern DBCStorage sItemDamageWandStore; //extern DBCStorage sItemDisplayInfoStore; -- not used currently -//extern DBCStorage sItemExtendedCostStore; extern DBCStorage sItemLimitCategoryStore; extern DBCStorage sItemRandomPropertiesStore; extern DBCStorage sItemRandomSuffixStore; extern DBCStorage sItemSetStore; extern DBCStorage sLFGDungeonStore; -//extern DBCStorage sLiquidTypeStore; extern DBCStorage sLockStore; extern DBCStorage sMailTemplateStore; extern DBCStorage sMapStore; +extern DBCStorage sPhaseStore; //extern DBCStorage sMapDifficultyStore; -- use GetMapDifficultyData insteed extern MapDifficultyMap sMapDifficultyMap; extern DBCStorage sMovieStore; @@ -149,8 +161,24 @@ extern DBCStorage sSpellRadiusStore; extern DBCStorage sSpellRangeStore; extern DBCStorage sSpellRuneCostStore; extern DBCStorage sSpellShapeshiftStore; +extern DBCStorage sSpellShapeshiftFormStore; extern DBCStorage sSpellStore; -extern DBCStorage sStableSlotPricesStore; +extern DBCStorage sSpellAuraOptionsStore; +extern DBCStorage sSpellAuraRestrictionsStore; +extern DBCStorage sSpellCastingRequirementsStore; +extern DBCStorage sSpellCategoriesStore; +extern DBCStorage sSpellClassOptionsStore; +extern DBCStorage sSpellCooldownsStore; +extern DBCStorage sSpellEffectStore; +extern DBCStorage sSpellEquippedItemsStore; +extern DBCStorage sSpellInterruptsStore; +extern DBCStorage sSpellLevelsStore; +extern DBCStorage sSpellPowerStore; +extern DBCStorage sSpellReagentsStore; +extern DBCStorage sSpellScalingStore; +extern DBCStorage sSpellTargetRestrictionsStore; +extern DBCStorage sSpellTotemsStore; +//extern DBCStorage sStableSlotPricesStore; extern DBCStorage sSummonPropertiesStore; extern DBCStorage sTalentStore; extern DBCStorage sTalentTabStore; @@ -163,7 +191,6 @@ extern TaxiMask sAllianceTaxiNodesMask; extern TaxiMask sDeathKnightTaxiNodesMask; extern TaxiPathSetBySource sTaxiPathSetBySource; extern TaxiPathNodesByPath sTaxiPathNodesByPath; -extern DBCStorage sTeamContributionPointsStore; extern DBCStorage sTotemCategoryStore; extern DBCStorage sVehicleStore; extern DBCStorage sVehicleSeatStore; diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index e65d42d2e4e..8509d0436e0 100755 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -1137,6 +1137,43 @@ struct ItemClassEntry //DBCString name; // 4 }; +// common struct for: +// ItemDamageAmmo.dbc +// ItemDamageOneHand.dbc +// ItemDamageOneHandCaster.dbc +// ItemDamageRanged.dbc +// ItemDamageThrown.dbc +// ItemDamageTwoHand.dbc +// ItemDamageTwoHandCaster.dbc +// ItemDamageWand.dbc +struct ItemDamageEntry +{ + uint32 Id; // 0 item level + float Value[7]; // 1-7 multiplier for item quality + uint32 Id2; // 8 item level +}; + +struct ItemArmorQualityEntry +{ + uint32 Id; // 0 item level + float Value[7]; // 1-7 multiplier for item quality + uint32 Id2; // 8 item level +}; + +struct ItemArmorShieldEntry +{ + uint32 Id; // 0 item level + uint32 Id2; // 1 item level + float Value[7]; // 2-8 multiplier for item quality +}; + +struct ItemArmorTotalEntry +{ + uint32 Id; // 0 item level + uint32 Id2; // 1 item level + float Value[4]; // 2-5 multiplier for armor types (cloth...plate) +}; + struct ItemBagFamilyEntry { uint32 ID; // 0 @@ -1583,121 +1620,163 @@ struct SoundEntriesEntry //unk // 33 4.0.0 }; +// SpellEffect.dbc +struct SpellEffectEntry +{ + uint32 Id; // 0 m_ID + uint32 Effect; // 1 m_effect + float EffectValueMultiplier; // 2 m_effectAmplitude + uint32 EffectApplyAuraName; // 3 m_effectAura + uint32 EffectAmplitude; // 4 m_effectAuraPeriod + int32 EffectBasePoints; // 5 m_effectBasePoints (don't must be used in spell/auras explicitly, must be used cached Spell::m_currentBasePoints) + float EffectBonusMultiplier; // 6 m_effectBonus + float EffectDamageMultiplier; // 7 m_effectChainAmplitude + uint32 EffectChainTarget; // 8 m_effectChainTargets + int32 EffectDieSides; // 9 m_effectDieSides + uint32 EffectItemType; // 10 m_effectItemType + uint32 EffectMechanic; // 11 m_effectMechanic + int32 EffectMiscValue; // 12 m_effectMiscValue + int32 EffectMiscValueB; // 13 m_effectMiscValueB + float EffectPointsPerComboPoint; // 14 m_effectPointsPerCombo + uint32 EffectRadiusIndex; // 15 m_effectRadiusIndex - spellradius.dbc + uint32 EffectRadiusMaxIndex; // 16 4.0.0 + float EffectRealPointsPerLevel; // 17 m_effectRealPointsPerLevel + flag96 EffectSpellClassMask; // 18 19 20 m_effectSpellClassMask1(2/3), effect 0 + uint32 EffectTriggerSpell; // 21 m_effectTriggerSpell + uint32 EffectImplicitTargetA; // 22 m_implicitTargetA + uint32 EffectImplicitTargetB; // 23 m_implicitTargetB + uint32 EffectSpellId; // 24 new 4.0.0 + uint32 EffectIndex; // 25 new 4.0.0 + //uint32 Unk0 // 26 4.2.0 +}; + #define MAX_SPELL_EFFECTS 3 #define MAX_EFFECT_MASK 7 #define MAX_SPELL_REAGENTS 8 +// SpellAuraOptions.dbc +struct SpellAuraOptionsEntry +{ + uint32 Id; // 0 m_ID + uint32 StackAmount; // 1 m_cumulativeAura + uint32 procChance; // 2 m_procChance + uint32 procCharges; // 3 m_procCharges + uint32 procFlags; // 4 m_procTypeMask +}; + +// SpellAuraRestrictions.dbc/ +struct SpellAuraRestrictionsEntry +{ + //uint32 Id; // 0 m_ID + uint32 CasterAuraState; // 1 m_casterAuraState + uint32 TargetAuraState; // 2 m_targetAuraState + uint32 CasterAuraStateNot; // 3 m_excludeCasterAuraState + uint32 TargetAuraStateNot; // 4 m_excludeTargetAuraState + uint32 casterAuraSpell; // 5 m_casterAuraSpell + uint32 targetAuraSpell; // 6 m_targetAuraSpell + uint32 excludeCasterAuraSpell; // 7 m_excludeCasterAuraSpell + uint32 excludeTargetAuraSpell; // 8 m_excludeTargetAuraSpell +}; + +// SpellCastingRequirements.dbc +struct SpellCastingRequirementsEntry +{ + //uint32 Id; // 0 m_ID + uint32 FacingCasterFlags; // 1 m_facingCasterFlags + //uint32 MinFactionId; // 2 m_minFactionID not used + //uint32 MinReputation; // 3 m_minReputation not used + int32 AreaGroupId; // 4 m_requiredAreaGroupId + //uint32 RequiredAuraVision; // 5 m_requiredAuraVision not used + uint32 RequiresSpellFocus; // 6 m_requiresSpellFocus +}; + +#define MAX_SPELL_TOTEMS 2 + +// SpellTotems.dbc +struct SpellTotemsEntry +{ + uint32 Id; // 0 m_ID + uint32 TotemCategory[MAX_SPELL_TOTEMS]; // 1 m_requiredTotemCategoryID + uint32 Totem[MAX_SPELL_TOTEMS]; // 2 m_totem +}; + +struct SpellTotem +{ + SpellTotem() + { + totems[0] = NULL; + totems[1] = NULL; + } + SpellTotemsEntry const* totems[MAX_SPELL_TOTEMS]; +}; + +typedef std::map SpellTotemMap; + +// Spell.dbc struct SpellEntry { uint32 Id; // 0 m_ID + uint32 Attributes; // 1 m_attribute + uint32 AttributesEx; // 2 m_attributesEx + uint32 AttributesEx2; // 3 m_attributesExB + uint32 AttributesEx3; // 4 m_attributesExC + uint32 AttributesEx4; // 5 m_attributesExD + uint32 AttributesEx5; // 6 m_attributesExE + uint32 AttributesEx6; // 7 m_attributesExF + uint32 AttributesEx7; // 8 m_attributesExG + uint32 AttributesEx8; // 9 m_attributesExH + // uint32 unk_400_1; // 10 4.0.0 + // uint32 unk_420_1 // 11 4.2.0 + uint32 CastingTimeIndex; // 12 m_castingTimeIndex + uint32 DurationIndex; // 13 m_durationIndex + uint32 powerType; // 14 m_powerType + uint32 rangeIndex; // 15 m_rangeIndex + float speed; // 16 m_speed + uint32 SpellVisual[2]; // 17-18 m_spellVisualID + uint32 SpellIconID; // 19 m_spellIconID + uint32 activeIconID; // 20 m_activeIconID + DBCString SpellName; // 21 m_name_lang + DBCString Rank; // 22 m_nameSubtext_lang + //DBCString Description; // 23 m_description_lang not used + //DBCString ToolTip; // 24 m_auraDescription_lang not used + uint32 SchoolMask; // 25 m_schoolMask + uint32 runeCostID; // 26 m_runeCostID + //uint32 spellMissileID; // 27 m_spellMissileID not used + //uint32 spellDescriptionVariableID; // 28 m_spellDescriptionVariableID, 3.2.0 + uint32 SpellDifficultyId; // 29 m_spellDifficultyID - id from SpellDifficulty.dbc + //float unk_f1; // 30 + uint32 SpellScalingId; // 31 SpellScaling.dbc + uint32 SpellAuraOptionsId; // 32 SpellAuraOptions.dbc + uint32 SpellAuraRestrictionsId; // 33 SpellAuraRestrictions.dbc + uint32 SpellCastingRequirementsId; // 34 SpellCastingRequirements.dbc + uint32 SpellCategoriesId; // 35 SpellCategories.dbc + uint32 SpellClassOptionsId; // 36 SpellClassOptions.dbc + uint32 SpellCooldownsId; // 37 SpellCooldowns.dbc + //uint32 unkIndex7; // 38 all zeros... + uint32 SpellEquippedItemsId; // 39 SpellEquippedItems.dbc + uint32 SpellInterruptsId; // 40 SpellInterrupts.dbc + uint32 SpellLevelsId; // 41 SpellLevels.dbc + uint32 SpellPowerId; // 42 SpellPower.dbc + uint32 SpellReagentsId; // 43 SpellReagents.dbc + uint32 SpellShapeshiftId; // 44 SpellShapeshift.dbc + uint32 SpellTargetRestrictionsId; // 45 SpellTargetRestrictions.dbc + uint32 SpellTotemsId; // 46 SpellTotems.dbc + //uint32 ResearchProject; // 47 ResearchProject.dbc + + // struct access functions + SpellEffectEntry const* GetSpellEffect(uint32 eff) const; +}; + +// SpellCategories.dbc +struct SpellCategoriesEntry +{ + //uint32 Id; // 0 m_ID uint32 Category; // 1 m_category + uint32 DmgClass; // 153 m_defenseType uint32 Dispel; // 2 m_dispelType uint32 Mechanic; // 3 m_mechanic - uint32 Attributes; // 4 m_attributes - uint32 AttributesEx; // 5 m_attributesEx - uint32 AttributesEx2; // 6 m_attributesExB - uint32 AttributesEx3; // 7 m_attributesExC - uint32 AttributesEx4; // 8 m_attributesExD - uint32 AttributesEx5; // 9 m_attributesExE - uint32 AttributesEx6; // 10 m_attributesExF - uint32 AttributesEx7; // 11 m_attributesExG - uint32 Stances; // 12 m_shapeshiftMask - // uint32 unk_320_2; // 13 3.2.0 - uint32 StancesNot; // 14 m_shapeshiftExclude - // uint32 unk_320_3; // 15 3.2.0 - uint32 Targets; // 16 m_targets - uint32 TargetCreatureType; // 17 m_targetCreatureType - uint32 RequiresSpellFocus; // 18 m_requiresSpellFocus - uint32 FacingCasterFlags; // 19 m_facingCasterFlags - uint32 CasterAuraState; // 20 m_casterAuraState - uint32 TargetAuraState; // 21 m_targetAuraState - uint32 CasterAuraStateNot; // 22 m_excludeCasterAuraState - uint32 TargetAuraStateNot; // 23 m_excludeTargetAuraState - uint32 casterAuraSpell; // 24 m_casterAuraSpell - uint32 targetAuraSpell; // 25 m_targetAuraSpell - uint32 excludeCasterAuraSpell; // 26 m_excludeCasterAuraSpell - uint32 excludeTargetAuraSpell; // 27 m_excludeTargetAuraSpell - uint32 CastingTimeIndex; // 28 m_castingTimeIndex - uint32 RecoveryTime; // 29 m_recoveryTime - uint32 CategoryRecoveryTime; // 30 m_categoryRecoveryTime - uint32 InterruptFlags; // 31 m_interruptFlags - uint32 AuraInterruptFlags; // 32 m_auraInterruptFlags - uint32 ChannelInterruptFlags; // 33 m_channelInterruptFlags - uint32 procFlags; // 34 m_procTypeMask - uint32 procChance; // 35 m_procChance - uint32 procCharges; // 36 m_procCharges - uint32 maxLevel; // 37 m_maxLevel - uint32 baseLevel; // 38 m_baseLevel - uint32 spellLevel; // 39 m_spellLevel - uint32 DurationIndex; // 40 m_durationIndex - uint32 powerType; // 41 m_powerType - uint32 manaCost; // 42 m_manaCost - uint32 manaCostPerlevel; // 43 m_manaCostPerLevel - uint32 manaPerSecond; // 44 m_manaPerSecond - uint32 manaPerSecondPerLevel; // 45 m_manaPerSecondPerLeve - uint32 rangeIndex; // 46 m_rangeIndex - float speed; // 47 m_speed - //uint32 modalNextSpell; // 48 m_modalNextSpell not used - uint32 StackAmount; // 49 m_cumulativeAura - uint32 Totem[2]; // 50-51 m_totem - int32 Reagent[MAX_SPELL_REAGENTS]; // 52-59 m_reagent - uint32 ReagentCount[MAX_SPELL_REAGENTS]; // 60-67 m_reagentCount - int32 EquippedItemClass; // 68 m_equippedItemClass (value) - int32 EquippedItemSubClassMask; // 69 m_equippedItemSubclass (mask) - int32 EquippedItemInventoryTypeMask; // 70 m_equippedItemInvTypes (mask) - uint32 Effect[MAX_SPELL_EFFECTS]; // 71-73 m_effect - int32 EffectDieSides[MAX_SPELL_EFFECTS]; // 74-76 m_effectDieSides - float EffectRealPointsPerLevel[MAX_SPELL_EFFECTS]; // 77-79 m_effectRealPointsPerLevel - int32 EffectBasePoints[MAX_SPELL_EFFECTS]; // 80-82 m_effectBasePoints (must not be used in spell/auras explicitly, must be used cached Spell::m_currentBasePoints) - uint32 EffectMechanic[MAX_SPELL_EFFECTS]; // 83-85 m_effectMechanic - uint32 EffectImplicitTargetA[MAX_SPELL_EFFECTS]; // 86-88 m_implicitTargetA - uint32 EffectImplicitTargetB[MAX_SPELL_EFFECTS]; // 89-91 m_implicitTargetB - uint32 EffectRadiusIndex[MAX_SPELL_EFFECTS]; // 92-94 m_effectRadiusIndex - spellradius.dbc - uint32 EffectApplyAuraName[MAX_SPELL_EFFECTS]; // 95-97 m_effectAura - uint32 EffectAmplitude[MAX_SPELL_EFFECTS]; // 98-100 m_effectAuraPeriod - float EffectValueMultiplier[MAX_SPELL_EFFECTS]; // 101-103 - uint32 EffectChainTarget[MAX_SPELL_EFFECTS]; // 104-106 m_effectChainTargets - uint32 EffectItemType[MAX_SPELL_EFFECTS]; // 107-109 m_effectItemType - int32 EffectMiscValue[MAX_SPELL_EFFECTS]; // 110-112 m_effectMiscValue - int32 EffectMiscValueB[MAX_SPELL_EFFECTS]; // 113-115 m_effectMiscValueB - uint32 EffectTriggerSpell[MAX_SPELL_EFFECTS]; // 116-118 m_effectTriggerSpell - float EffectPointsPerComboPoint[MAX_SPELL_EFFECTS]; // 119-121 m_effectPointsPerCombo - flag96 EffectSpellClassMask[MAX_SPELL_EFFECTS]; // 122-130 - uint32 SpellVisual[2]; // 131-132 m_spellVisualID - uint32 SpellIconID; // 133 m_spellIconID - uint32 activeIconID; // 134 m_activeIconID - //uint32 spellPriority; // 135 not used - char* SpellName[16]; // 136-151 m_name_lang - //uint32 SpellNameFlag; // 152 not used - char* Rank[16]; // 153-168 m_nameSubtext_lang - //uint32 RankFlags; // 169 not used - //char* Description[16]; // 170-185 m_description_lang not used - //uint32 DescriptionFlags; // 186 not used - //char* ToolTip[16]; // 187-202 m_auraDescription_lang not used - //uint32 ToolTipFlags; // 203 not used - uint32 ManaCostPercentage; // 204 m_manaCostPct - uint32 StartRecoveryCategory; // 205 m_startRecoveryCategory - uint32 StartRecoveryTime; // 206 m_startRecoveryTime - uint32 MaxTargetLevel; // 207 m_maxTargetLevel - uint32 SpellFamilyName; // 208 m_spellClassSet - flag96 SpellFamilyFlags; // 209-211 - uint32 MaxAffectedTargets; // 212 m_maxTargets - uint32 DmgClass; // 213 m_defenseType - uint32 PreventionType; // 214 m_preventionType - //uint32 StanceBarOrder; // 215 m_stanceBarOrder not used - float EffectDamageMultiplier[MAX_SPELL_EFFECTS]; // 216-218 m_effectChainAmplitude - //uint32 MinFactionId; // 219 m_minFactionID not used - //uint32 MinReputation; // 220 m_minReputation not used - //uint32 RequiredAuraVision; // 221 m_requiredAuraVision not used - uint32 TotemCategory[2]; // 222-223 m_requiredTotemCategoryID - int32 AreaGroupId; // 224 m_requiredAreaGroupId - uint32 SchoolMask; // 225 m_schoolMask - uint32 runeCostID; // 226 m_runeCostID - //uint32 spellMissileID; // 227 m_spellMissileID not used - //uint32 PowerDisplayId; // 228 PowerDisplay.dbc, new in 3.1 - float EffectBonusMultiplier[MAX_SPELL_EFFECTS]; // 229-231 3.2.0 - //uint32 spellDescriptionVariableID; // 232 3.2.0 - //uint32 SpellDifficultyId; // 233 3.3.0 + uint32 PreventionType; // 154 m_preventionType + uint32 StartRecoveryCategory; // 145 m_startRecoveryCategory }; typedef std::set SpellCategorySet; @@ -1722,16 +1801,15 @@ struct SpellDifficultyEntry struct SpellFocusObjectEntry { uint32 ID; // 0 - //char* Name[16]; // 1-15 unused - // 16 string flags, unused + //DBCString Name; // 1 m_name_lang }; struct SpellRadiusEntry { uint32 ID; - float radiusMin; + float radiusHostile; //uint32 Unk //always 0 - float radiusMax; + float radiusFriend; }; struct SpellRangeEntry @@ -1740,12 +1818,70 @@ struct SpellRangeEntry float minRangeHostile; float minRangeFriend; float maxRangeHostile; - float maxRangeFriend; + float maxRangeFriend; //friend means unattackable unit here uint32 type; - //char* Name[16]; // 7-23 unused - // 24 string flags, unused - //char* Name2[16]; // 25-40 unused - // 41 string flags, unused + //DBCString Name; // 6-21 m_displayName_lang + //DBCString ShortName; // 23-38 m_displayNameShort_lang +}; + +// SpellEquippedItems.dbc +struct SpellEquippedItemsEntry +{ + //uint32 Id; // 0 m_ID + int32 EquippedItemClass; // 70 m_equippedItemClass (value) + int32 EquippedItemInventoryTypeMask; // 72 m_equippedItemInvTypes (mask) + int32 EquippedItemSubClassMask; // 71 m_equippedItemSubclass (mask) +}; + +// SpellCooldowns.dbc +struct SpellCooldownsEntry +{ + //uint32 Id; // 0 m_ID + uint32 CategoryRecoveryTime; // 31 m_categoryRecoveryTime + uint32 RecoveryTime; // 30 m_recoveryTime + uint32 StartRecoveryTime; // 146 m_startRecoveryTime +}; + +// SpellClassOptions.dbc +struct SpellClassOptionsEntry +{ + //uint32 Id; // 0 m_ID + //uint32 modalNextSpell; // 1 m_modalNextSpell not used + flag96 SpellFamilyFlags; // 2-4 + uint32 SpellFamilyName; // 5 m_spellClassSet + //DBCString Description; // 6 4.0.0 +}; + +// SpellInterrupts.dbc +struct SpellInterruptsEntry +{ + //uint32 Id; // 0 m_ID + uint32 AuraInterruptFlags; // 33 m_auraInterruptFlags + //uint32 // 34 4.0.0 + uint32 ChannelInterruptFlags; // 35 m_channelInterruptFlags + //uint32 // 36 4.0.0 + uint32 InterruptFlags; // 32 m_interruptFlags +}; + +// SpellLevels.dbc +struct SpellLevelsEntry +{ + //uint32 Id; // 0 m_ID + uint32 baseLevel; // 41 m_baseLevel + uint32 maxLevel; // 40 m_maxLevel + uint32 spellLevel; // 42 m_spellLevel +}; + +// SpellPower.dbc +struct SpellPowerEntry +{ + //uint32 Id; // 0 m_ID + uint32 manaCost; // 45 m_manaCost + uint32 manaCostPerlevel; // 46 m_manaCostPerLevel + uint32 ManaCostPercentage; // 144 m_manaCostPct + uint32 manaPerSecond; // 47 m_manaPerSecond + //uint32 PowerDisplayId; // 168 m_powerDisplayID - id from PowerDisplay.dbc, new in 3.1 + //uint32 unk1; // 6 4.0.0 }; struct SpellRuneCostEntry @@ -1760,21 +1896,84 @@ struct SpellRuneCostEntry #define MAX_SHAPESHIFT_SPELLS 8 -struct SpellShapeshiftEntry +struct SpellShapeshiftFormEntry { uint32 ID; // 0 //uint32 buttonPosition; // 1 unused - //char* Name[16]; // 2-17 unused - //uint32 NameFlags; // 18 unused - uint32 flags1; // 19 - int32 creatureType; // 20 <= 0 humanoid, other normal creature types - //uint32 unk1; // 21 unused - uint32 attackSpeed; // 22 - uint32 modelID_A; // 23 alliance modelid - uint32 modelID_H; // 24 horde modelid (only one form) - //uint32 unk3; // 25 unused - //uint32 unk4; // 26 unused - uint32 stanceSpell[MAX_SHAPESHIFT_SPELLS]; // 27 - 34 unused + //DBCString Name; // 2 unused + uint32 flags1; // 3 + int32 creatureType; // 4 <=0 humanoid, other normal creature types + //uint32 unk1; // 5 unused, related to next field + uint32 attackSpeed; // 6 + uint32 modelID_A; // 7 alliance modelid (0 means no model) + uint32 modelID_H; // 8 horde modelid (but only for one form) + //uint32 unk3; // 9 unused always 0 + //uint32 unk4; // 10 unused always 0 + uint32 stanceSpell[MAX_SHAPESHIFT_SPELLS]; // 11-18 spells which appear in the bar after shapeshifting + //uint32 unk5; // 19 + //uint32 unk6; // 20 +}; + +// SpellShapeshift.dbc +struct SpellShapeshiftEntry +{ + uint32 Id; // 0 - m_ID + uint32 Stances; // 1 - m_shapeshiftMask + // uint32 unk_320_2; // 2 - 3.2.0 + uint32 StancesNot; // 3 - m_shapeshiftExclude + // uint32 unk_320_3; // 4 - 3.2.0 + // uint32 StanceBarOrder; // 5 - m_stanceBarOrder not used +}; + +// SpellTargetRestrictions.dbc +struct SpellTargetRestrictionsEntry +{ + uint32 Id; // 0 m_ID + uint32 MaxAffectedTargets; // 152 m_maxTargets + uint32 MaxTargetLevel; // 147 m_maxTargetLevel + uint32 TargetCreatureType; // 18 m_targetCreatureType + uint32 Targets; // 17 m_targets +}; + +// SpellReagents.dbc +struct SpellReagentsEntry +{ + //uint32 Id; // 0 m_ID + int32 Reagent[MAX_SPELL_REAGENTS]; // 54-61 m_reagent + uint32 ReagentCount[MAX_SPELL_REAGENTS]; // 62-69 m_reagentCount +}; + +struct SpellReagent +{ + SpellReagent() + { + reagents[0] = NULL; + reagents[1] = NULL; + reagents[2] = NULL; + reagents[3] = NULL; + reagents[4] = NULL; + reagents[5] = NULL; + reagents[6] = NULL; + reagents[7] = NULL; + } + SpellReagentsEntry const* reagents[MAX_SPELL_REAGENTS]; +}; + +typedef std::map SpellReagentMap; + +// SpellScaling.dbc +struct SpellScalingEntry +{ + //uint32 Id; // 0 m_ID + int32 castTimeMin; // 1 + int32 castTimeMax; // 2 + uint32 castScalingMaxLevel; // 3 + uint32 playerClass; // 4 (index * 100) + charLevel => gtSpellScaling.dbc + float Multiplier[3]; // 5-7 + float RandomMultiplier[3]; // 8-10 + float OtherMultiplier[3]; // 11-13 + float CoefBase; // 14 some coefficient, mostly 1.0f + uint32 CoefLevelBase; // 15 some level }; struct SpellDurationEntry @@ -1791,15 +1990,15 @@ struct SpellItemEnchantmentEntry uint32 amount[MAX_ITEM_ENCHANTMENT_EFFECTS]; // 5-7 m_effectPointsMin[MAX_ITEM_ENCHANTMENT_EFFECTS] //uint32 amount2[MAX_ITEM_ENCHANTMENT_EFFECTS] // 8-10 m_effectPointsMax[MAX_ITEM_ENCHANTMENT_EFFECTS] uint32 spellid[MAX_ITEM_ENCHANTMENT_EFFECTS]; // 11-13 m_effectArg[MAX_ITEM_ENCHANTMENT_EFFECTS] - char* description[16]; // 14-29 m_name_lang[16] - //uint32 descriptionFlags; // 30 name flags - uint32 aura_id; // 31 m_itemVisual - uint32 slot; // 32 m_flags - uint32 GemID; // 33 m_src_itemID - uint32 EnchantmentCondition; // 34 m_condition_id - uint32 requiredSkill; // 35 m_requiredSkillID - uint32 requiredSkillValue; // 36 m_requiredSkillRank - uint32 requiredLevel; // 37 m_requiredLevel + DBCString description; // 14 m_name_lang + uint32 aura_id; // 15 m_itemVisual + uint32 slot; // 16 m_flags + uint32 GemID; // 17 m_src_itemID + uint32 EnchantmentCondition; // 18 m_condition_id + uint32 requiredSkill; // 19 m_requiredSkillID + uint32 requiredSkillValue; // 20 m_requiredSkillRank + uint32 requiredLevel; // 21 new in 3.1 + // 22 new in 3.1 }; struct SpellItemEnchantmentConditionEntry @@ -2134,6 +2333,19 @@ struct TalentSpellPos typedef std::map TalentSpellPosMap; +struct SpellEffect +{ + SpellEffect() + { + effects[0] = NULL; + effects[1] = NULL; + effects[2] = NULL; + } + SpellEffectEntry const* effects[3]; +}; + +typedef std::map SpellEffectMap; + struct TaxiPathBySourceAndDestination { TaxiPathBySourceAndDestination() : ID(0), price(0) {} diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index ab25d942d37..3289f1b9615 100755 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -77,6 +77,10 @@ const char GtRegenMPPerSptfmt[]="xf"; const char Holidaysfmt[]="nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; const char Itemfmt[]="niiiiiii"; const char ItemBagFamilyfmt[]="nx"; +const char ItemArmorQualityfmt[]="nfffffffi"; +const char ItemArmorShieldfmt[]="nifffffff"; +const char ItemArmorTotalfmt[]="niffff"; +const char ItemDamagefmt[]="nfffffffi"; const char ItemClassfmt[]="dixxx"; //const char ItemDisplayTemplateEntryfmt[]="nxxxxxxxxxxixxxxxxxxxxx"; //const char ItemCondExtCostsEntryfmt[]="xiii"; @@ -105,20 +109,36 @@ const char SkillLinefmt[]="nisxixi"; const char SkillLineAbilityfmt[]="niiiixxiiiiixx"; const char SoundEntriesfmt[]="nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; const char SpellCastTimefmt[]="nixx"; +const char SpellCategoriesEntryfmt[]="diiiiii"; const char SpellDifficultyfmt[]="niiii"; const std::string CustomSpellDifficultyfmt="ppppp"; const std::string CustomSpellDifficultyIndex="id"; const char SpellDurationfmt[]="niii"; -const char SpellEntryfmt[]="niiiiiiiiiiiixixiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiifxiiiiiiiiiiiiiiiiiiiiiiiiiiiifffiiiiiiiiiiiiiiiiiiiiifffiiiiiiiiiiiiiiifffiiiiiiiiiiiiixssssssssssssssssxssssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiiiiiiiiiiixfffxxxiiiiixxfffxx"; +const char SpellEffectEntryfmt[]="nifiiiffiiiiiifiifiiiiiiiix"; +const char SpellEntryfmt[]="niiiiiiiiixxiiiifiiiissxxiixxixiiiiiiixiiiiiiiix"; const std::string CustomSpellEntryfmt="papppppppppppapapaaaaaaaaaaapaaapapppppppaaaaapaapaaaaaaaaaaaaaaaaaappppppppppppppppppppppppppppppppppppaaaaaapppppppppaaapppppppppaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaappppppppapppaaaaappaaaaaaa"; const std::string CustomSpellEntryIndex = "Id"; -const char SpellFocusObjectfmt[]="nxxxxxxxxxxxxxxxxx"; -const char SpellItemEnchantmentfmt[]="nxiiiiiixxxiiissssssssssssssssxiiiiiii"; +const char SpellFocusObjectfmt[]="nx"; +const char SpellItemEnchantmentfmt[]="nxiiiiiixxxiiisiiiiiiix"; const char SpellItemEnchantmentConditionfmt[]="nbbbbbxxxxxbbbbbbbbbbiiiiiXXXXX"; const char SpellRadiusfmt[]="nfxf"; -const char SpellRangefmt[]="nffffixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; +const char SpellRangefmt[]="nffffixx"; +const char SpellReagentsEntryfmt[]="diiiiiiiiiiiiiiii"; +const char SpellScalingEntryfmt[]="diiiiffffffffffi"; +const char SpellTotemsEntryfmt[]="niiii"; +const char SpellTargetRestrictionsEntryfmt[]="nxiiii"; +const char SpellPowerEntryfmt[]="diiiixx"; +const char SpellInterruptsEntryfmt[]="dixixi"; +const char SpellEquippedItemsEntryfmt[]="diii"; +const char SpellAuraOptionsEntryfmt[]="niiii"; +const char SpellAuraRestrictionsEntryfmt[]="diiiiiiii"; +const char SpellCastingRequirementsEntryfmt[]="dixxixi"; +const char SpellClassOptionsEntryfmt[]="dxiiiix"; +const char SpellCooldownsEntryfmt[]="diii"; +const char SpellLevelsEntryfmt[]="diii"; const char SpellRuneCostfmt[]="niiii"; -const char SpellShapeshiftfmt[]="nxxxxxxxxxxxxxxxxxxiixiiixxiiiiiiii"; +const char SpellShapeshiftEntryfmt[]="nixixx"; +const char SpellShapeshiftFormfmt[]="nxxiixiiixxiiiiiiiixx"; const char StableSlotPricesfmt[] = "ni"; const char SummonPropertiesfmt[] = "niiiii"; const char TalentEntryfmt[]="niiiiiiiiixxixxxxxx"; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 8380c568e1f..c999bad1af4 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -20437,7 +20437,7 @@ void Player::InitDataForForm(bool reapplyMods) { ShapeshiftForm form = GetShapeshiftForm(); - SpellShapeshiftEntry const* ssEntry = sSpellShapeshiftStore.LookupEntry(form); + SpellShapeshiftFormEntry const* ssEntry = sSpellShapeshiftFormStore.LookupEntry(form); if (ssEntry && ssEntry->attackSpeed) { SetAttackTime(BASE_ATTACK, ssEntry->attackSpeed); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index dc1c4105fea..cf021532abb 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -13326,7 +13326,7 @@ uint32 Unit::GetCreatureType() const if (GetTypeId() == TYPEID_PLAYER) { ShapeshiftForm form = GetShapeshiftForm(); - SpellShapeshiftEntry const* ssEntry = sSpellShapeshiftStore.LookupEntry(form); + SpellShapeshiftFormEntry const* ssEntry = sSpellShapeshiftFormStore.LookupEntry(form); if (ssEntry && ssEntry->creatureType > 0) return ssEntry->creatureType; else @@ -16762,7 +16762,7 @@ uint32 Unit::GetModelForForm(ShapeshiftForm form) } uint32 modelid = 0; - SpellShapeshiftEntry const* formEntry = sSpellShapeshiftStore.LookupEntry(form); + SpellShapeshiftFormEntry const* formEntry = sSpellShapeshiftFormStore.LookupEntry(form); if (formEntry && formEntry->modelID_A) { // Take the alliance modelid as default diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index 9650afb60e2..0fcb342fcfc 100755 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -225,7 +225,7 @@ uint32 Quest::CalculateHonorGain(uint8 level) const uint32 honor = 0; - if (GetRewHonorAddition() > 0 || GetRewHonorMultiplier() > 0.0f) + /*if (GetRewHonorAddition() > 0 || GetRewHonorMultiplier() > 0.0f) { // values stored from 0.. for 1... TeamContributionPointsEntry const* tc = sTeamContributionPointsStore.LookupEntry(level-1); @@ -233,7 +233,7 @@ uint32 Quest::CalculateHonorGain(uint8 level) const return 0; honor = uint32(tc->value * GetRewHonorMultiplier() * 0.1000000014901161); honor += GetRewHonorAddition(); - } + }*/ return honor; } diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 152f94ad420..e68f5668cb1 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -2115,7 +2115,7 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mo if (target->GetTypeId() == TYPEID_PLAYER) { - SpellShapeshiftEntry const* shapeInfo = sSpellShapeshiftStore.LookupEntry(form); + SpellShapeshiftFormEntry const* shapeInfo = sSpellShapeshiftFormStore.LookupEntry(form); // Learn spells for shapeshift form - no need to send action bars or add spells to spellbook for (uint8 i = 0; iEffects[effIndex]; if (effInfo->ApplyAuraName == SPELL_AURA_MOD_SHAPESHIFT) { - SpellShapeshiftEntry const* shapeShiftEntry = sSpellShapeshiftStore.LookupEntry(effInfo->MiscValue); + SpellShapeshiftFormEntry const* shapeShiftEntry = sSpellShapeshiftFormStore.LookupEntry(effInfo->MiscValue); if (shapeShiftEntry && (shapeShiftEntry->flags1 & 1) == 0) // unk flag checkMask |= VEHICLE_SEAT_FLAG_UNCONTROLLED; break; diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 972276c7d26..78de015f200 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -459,28 +459,31 @@ SpellImplicitTargetInfo::StaticData SpellImplicitTargetInfo::_data[TOTAL_SPELL_ SpellEffectInfo::SpellEffectInfo(SpellEntry const* spellEntry, SpellInfo const* spellInfo, uint8 effIndex) { + SpellEffectEntry const* _effect = spellEntry->GetSpellEffect(effIndex); + _spellInfo = spellInfo; _effIndex = effIndex; - Effect = spellEntry->Effect[effIndex]; - ApplyAuraName = spellEntry->EffectApplyAuraName[effIndex]; - Amplitude = spellEntry->EffectAmplitude[effIndex]; - DieSides = spellEntry->EffectDieSides[effIndex]; - RealPointsPerLevel = spellEntry->EffectRealPointsPerLevel[effIndex]; - BasePoints = spellEntry->EffectBasePoints[effIndex]; - PointsPerComboPoint = spellEntry->EffectPointsPerComboPoint[effIndex]; - ValueMultiplier = spellEntry->EffectValueMultiplier[effIndex]; - DamageMultiplier = spellEntry->EffectDamageMultiplier[effIndex]; - BonusMultiplier = spellEntry->EffectBonusMultiplier[effIndex]; - MiscValue = spellEntry->EffectMiscValue[effIndex]; - MiscValueB = spellEntry->EffectMiscValueB[effIndex]; - Mechanic = Mechanics(spellEntry->EffectMechanic[effIndex]); - TargetA = SpellImplicitTargetInfo(spellEntry->EffectImplicitTargetA[effIndex]); - TargetB = SpellImplicitTargetInfo(spellEntry->EffectImplicitTargetB[effIndex]); - RadiusEntry = spellEntry->EffectRadiusIndex[effIndex] ? sSpellRadiusStore.LookupEntry(spellEntry->EffectRadiusIndex[effIndex]) : NULL; - ChainTarget = spellEntry->EffectChainTarget[effIndex]; - ItemType = spellEntry->EffectItemType[effIndex]; - TriggerSpell = spellEntry->EffectTriggerSpell[effIndex]; - SpellClassMask = spellEntry->EffectSpellClassMask[effIndex]; + + Effect = _effect ? _effect->Effect : 0; + ApplyAuraName = _effect ? _effect->EffectApplyAuraName : 0; + Amplitude = _effect ? _effect->EffectAmplitude : 0; + DieSides = _effect ? _effect->EffectDieSides : 0; + RealPointsPerLevel = _effect ? _effect->EffectRealPointsPerLevel : 0.0f; + BasePoints = _effect ? _effect->EffectBasePoints : 0; + PointsPerComboPoint = _effect ? _effect->EffectPointsPerComboPoint : 0.0f; + ValueMultiplier = _effect ? _effect->EffectValueMultiplier : 0.0f; + DamageMultiplier = _effect ? _effect->EffectDamageMultiplier : 0.0f; + BonusMultiplier = _effect ? _effect->EffectBonusMultiplier : 0.0f; + MiscValue = _effect ? _effect->EffectMiscValue : 0; + MiscValueB = _effect ? _effect->EffectMiscValueB : 0; + Mechanic = Mechanics(_effect ? _effect->EffectMechanic : 0); + TargetA = SpellImplicitTargetInfo(_effect ? _effect->EffectImplicitTargetA : 0); + TargetB = SpellImplicitTargetInfo(_effect ? _effect->EffectImplicitTargetB : 0); + RadiusEntry = _effect && _effect->EffectRadiusIndex ? sSpellRadiusStore.LookupEntry(_effect->EffectRadiusIndex) : NULL; + ChainTarget = _effect ? _effect->EffectChainTarget : 0; + ItemType = _effect ? _effect->EffectItemType : 0; + TriggerSpell = _effect ? _effect->EffectTriggerSpell : 0; + SpellClassMask = _effect ? _effect->EffectSpellClassMask : flag96(0); } bool SpellEffectInfo::IsEffect() const @@ -634,8 +637,8 @@ float SpellEffectInfo::CalcRadius(Unit* caster, Spell* spell) const { if (!HasRadius()) return 0.0f; - - float radius = RadiusEntry->radiusMax; + //TODO: FIX radius value + float radius = RadiusEntry->ID; if (Player* modOwner = (caster ? caster->GetSpellModOwner() : NULL)) modOwner->ApplySpellMod(_spellInfo->Id, SPELLMOD_RADIUS, radius, spell); @@ -854,9 +857,6 @@ SpellEffectInfo::StaticData SpellEffectInfo::_data[TOTAL_SPELL_EFFECTS] = SpellInfo::SpellInfo(SpellEntry const* spellEntry) { Id = spellEntry->Id; - Category = spellEntry->Category; - Dispel = spellEntry->Dispel; - Mechanic = spellEntry->Mechanic; Attributes = spellEntry->Attributes; AttributesEx = spellEntry->AttributesEx; AttributesEx2 = spellEntry->AttributesEx2; @@ -865,75 +865,150 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry) AttributesEx5 = spellEntry->AttributesEx5; AttributesEx6 = spellEntry->AttributesEx6; AttributesEx7 = spellEntry->AttributesEx7; + AttributesEx8 = spellEntry->AttributesEx8; AttributesCu = 0; - Stances = spellEntry->Stances; - StancesNot = spellEntry->StancesNot; - Targets = spellEntry->Targets; - TargetCreatureType = spellEntry->TargetCreatureType; - RequiresSpellFocus = spellEntry->RequiresSpellFocus; - FacingCasterFlags = spellEntry->FacingCasterFlags; - CasterAuraState = spellEntry->CasterAuraState; - TargetAuraState = spellEntry->TargetAuraState; - CasterAuraStateNot = spellEntry->CasterAuraStateNot; - TargetAuraStateNot = spellEntry->TargetAuraStateNot; - CasterAuraSpell = spellEntry->casterAuraSpell; - TargetAuraSpell = spellEntry->targetAuraSpell; - ExcludeCasterAuraSpell = spellEntry->excludeCasterAuraSpell; - ExcludeTargetAuraSpell = spellEntry->excludeTargetAuraSpell; CastTimeEntry = spellEntry->CastingTimeIndex ? sSpellCastTimesStore.LookupEntry(spellEntry->CastingTimeIndex) : NULL; - RecoveryTime = spellEntry->RecoveryTime; - CategoryRecoveryTime = spellEntry->CategoryRecoveryTime; - StartRecoveryCategory = spellEntry->StartRecoveryCategory; - StartRecoveryTime = spellEntry->StartRecoveryTime; - InterruptFlags = spellEntry->InterruptFlags; - AuraInterruptFlags = spellEntry->AuraInterruptFlags; - ChannelInterruptFlags = spellEntry->ChannelInterruptFlags; - ProcFlags = spellEntry->procFlags; - ProcChance = spellEntry->procChance; - ProcCharges = spellEntry->procCharges; - MaxLevel = spellEntry->maxLevel; - BaseLevel = spellEntry->baseLevel; - SpellLevel = spellEntry->spellLevel; DurationEntry = spellEntry->DurationIndex ? sSpellDurationStore.LookupEntry(spellEntry->DurationIndex) : NULL; PowerType = spellEntry->powerType; - ManaCost = spellEntry->manaCost; - ManaCostPerlevel = spellEntry->manaCostPerlevel; - ManaPerSecond = spellEntry->manaPerSecond; - ManaPerSecondPerLevel = spellEntry->manaPerSecondPerLevel; - ManaCostPercentage = spellEntry->ManaCostPercentage; - RuneCostID = spellEntry->runeCostID; RangeEntry = spellEntry->rangeIndex ? sSpellRangeStore.LookupEntry(spellEntry->rangeIndex) : NULL; Speed = spellEntry->speed; - StackAmount = spellEntry->StackAmount; - for (uint8 i = 0; i < 2; ++i) - Totem[i] = spellEntry->Totem[i]; - for (uint8 i = 0; i < MAX_SPELL_REAGENTS; ++i) - Reagent[i] = spellEntry->Reagent[i]; - for (uint8 i = 0; i < MAX_SPELL_REAGENTS; ++i) - ReagentCount[i] = spellEntry->ReagentCount[i]; - EquippedItemClass = spellEntry->EquippedItemClass; - EquippedItemSubClassMask = spellEntry->EquippedItemSubClassMask; - EquippedItemInventoryTypeMask = spellEntry->EquippedItemInventoryTypeMask; - for (uint8 i = 0; i < 2; ++i) - TotemCategory[i] = spellEntry->TotemCategory[i]; for (uint8 i = 0; i < 2; ++i) SpellVisual[i] = spellEntry->SpellVisual[i]; SpellIconID = spellEntry->SpellIconID; ActiveIconID = spellEntry->activeIconID; - for (uint8 i = 0; i < 16; ++i) - SpellName[i] = spellEntry->SpellName[i]; - for (uint8 i = 0; i < 16; ++i) - Rank[i] = spellEntry->Rank[i]; - MaxTargetLevel = spellEntry->MaxTargetLevel; - MaxAffectedTargets = spellEntry->MaxAffectedTargets; - SpellFamilyName = spellEntry->SpellFamilyName; - SpellFamilyFlags = spellEntry->SpellFamilyFlags; - DmgClass = spellEntry->DmgClass; - PreventionType = spellEntry->PreventionType; - AreaGroupId = spellEntry->AreaGroupId; + SpellName = spellEntry->SpellName; + Rank = spellEntry->Rank; SchoolMask = spellEntry->SchoolMask; + RuneCostID = spellEntry->runeCostID; + SpellDifficultyId = spellEntry->SpellDifficultyId; + SpellScalingId = spellEntry->SpellScalingId; + SpellAuraOptionsId = spellEntry->SpellAuraOptionsId; + SpellAuraRestrictionsId = spellEntry->SpellAuraRestrictionsId; + SpellCastingRequirementsId = spellEntry->SpellCastingRequirementsId; + SpellCategoriesId = spellEntry->SpellCategoriesId; + SpellClassOptionsId = spellEntry->SpellClassOptionsId; + SpellCooldownsId = spellEntry->SpellCooldownsId; + SpellEquippedItemsId = spellEntry->SpellEquippedItemsId; + SpellInterruptsId = spellEntry->SpellInterruptsId; + SpellLevelsId = spellEntry->SpellLevelsId; + SpellPowerId = spellEntry->SpellPowerId; + SpellReagentsId = spellEntry->SpellReagentsId; + SpellShapeshiftId = spellEntry->SpellShapeshiftId; + SpellTargetRestrictionsId = spellEntry->SpellTargetRestrictionsId; + SpellTotemsId = spellEntry->SpellTotemsId; + + // SpellDifficultyEntry for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) Effects[i] = SpellEffectInfo(spellEntry, this, i); + + // SpellScalingEntry + SpellScalingEntry const* _scaling = GetSpellScaling(); + castTimeMin = _scaling ? _scaling->castTimeMin : 0; + castTimeMax = _scaling ?_scaling->castTimeMax : 0; + castScalingMaxLevel = _scaling ? _scaling->castScalingMaxLevel : 0; + playerClass = _scaling ? _scaling->playerClass : 0; + for (uint8 i = 0; i < 3; ++i) + { + Multiplier[i] = _scaling ? _scaling->Multiplier[i] : 0; + RandomMultiplier[i] = _scaling ? _scaling->RandomMultiplier[i] : 0; + OtherMultiplier[i] = _scaling ? _scaling->OtherMultiplier[i] : 0; + } + CoefBase = _scaling ? _scaling->CoefBase : 0; + CoefLevelBase = _scaling ? _scaling->CoefLevelBase : 0; + + // SpellAuraOptionsEntry + SpellAuraOptionsEntry const* _options = GetSpellAuraOptions(); + ProcFlags = _options ? _options->procFlags : 0; + ProcChance = _options ? _options->procChance : 0; + ProcCharges = _options ? _options->procCharges : 0; + StackAmount = _options ? _options->StackAmount : 0; + + // SpellAuraRestrictionsEntry + SpellAuraRestrictionsEntry const* _aura = GetSpellAuraRestrictions(); + CasterAuraState = _aura ? _aura->CasterAuraState : 0; + TargetAuraState = _aura ? _aura->TargetAuraState : 0; + CasterAuraStateNot = _aura ? _aura->CasterAuraStateNot : 0; + TargetAuraStateNot = _aura ? _aura->TargetAuraStateNot : 0; + CasterAuraSpell = _aura ? _aura->casterAuraSpell : 0; + TargetAuraSpell = _aura ? _aura->targetAuraSpell : 0; + ExcludeCasterAuraSpell = _aura ? _aura->excludeCasterAuraSpell : 0; + ExcludeTargetAuraSpell = _aura ? _aura->excludeTargetAuraSpell : 0; + + // SpellCastingRequirementsEntry + SpellCastingRequirementsEntry const* _castreq = GetSpellCastingRequirements(); + RequiresSpellFocus = _castreq ? _castreq->RequiresSpellFocus : 0; + FacingCasterFlags = _castreq ? _castreq->FacingCasterFlags : 0; + AreaGroupId = _castreq ? _castreq->AreaGroupId : -1; + + // SpellCategoriesEntry + SpellCategoriesEntry const* _categorie = GetSpellCategories(); + Category = _categorie ? _categorie->Category : 0; + Dispel = _categorie ? _categorie->Dispel : 0; + Mechanic = _categorie ? _categorie->Mechanic : 0; + StartRecoveryCategory = _categorie ? _categorie->StartRecoveryCategory : 0; + DmgClass = _categorie ? _categorie->DmgClass : 0; + PreventionType = _categorie ? _categorie->PreventionType : 0; + + // SpellClassOptionsEntry + SpellClassOptionsEntry const* _class = GetSpellClassOptions(); + SpellFamilyName = _class ? _class->SpellFamilyName : 0; + SpellFamilyFlags = _class ? _class->SpellFamilyFlags : flag96(0); + + // SpellCooldownsEntry + SpellCooldownsEntry const* _cooldowns = GetSpellCooldowns(); + RecoveryTime = _cooldowns ? _cooldowns->RecoveryTime : 0; + CategoryRecoveryTime = _cooldowns ? _cooldowns->CategoryRecoveryTime : 0; + StartRecoveryTime = _cooldowns ? _cooldowns->StartRecoveryTime : 0; + + // SpellEquippedItemsEntry + SpellEquippedItemsEntry const* _equipped = GetSpellEquippedItems(); + EquippedItemClass = _equipped ? _equipped->EquippedItemClass : -1; + EquippedItemSubClassMask = _equipped ?_equipped->EquippedItemSubClassMask : -1; + EquippedItemInventoryTypeMask = _equipped ? _equipped->EquippedItemInventoryTypeMask : -1; + + // SpellInterruptsEntry + SpellInterruptsEntry const* _interrupt = GetSpellInterrupts(); + InterruptFlags = _interrupt ? _interrupt->InterruptFlags : 0; + AuraInterruptFlags = _interrupt ? _interrupt->AuraInterruptFlags : 0; + ChannelInterruptFlags = _interrupt ? _interrupt->ChannelInterruptFlags : 0; + + // SpellLevelsEntry + SpellLevelsEntry const* _levels = GetSpellLevels(); + MaxLevel = _levels ? _levels->maxLevel : 0; + BaseLevel = _levels ? _levels->baseLevel : 0; + SpellLevel = _levels ? _levels->spellLevel : 0; + + // SpellPowerEntry + SpellPowerEntry const* _power = GetSpellPower(); + ManaCost = _power ? _power->manaCost : 0; + ManaPerSecond = _power ? _power->manaPerSecond : 0; + ManaCostPercentage = _power ? _power->ManaCostPercentage : 0; + + // SpellReagentsEntry + SpellReagentsEntry const* _reagents = GetSpellReagents(); + for (uint8 i = 0; i < MAX_SPELL_REAGENTS; ++i) + Reagent[i] = _reagents ? _reagents->Reagent[i] : 0; + for (uint8 i = 0; i < MAX_SPELL_REAGENTS; ++i) + ReagentCount[i] = _reagents ? _reagents->ReagentCount[i] : 0; + + // SpellShapeshiftEntry + SpellShapeshiftEntry const* _shapeshift = GetSpellShapeshift(); + Stances = _shapeshift ? _shapeshift->Stances : 0; + StancesNot = _shapeshift ? _shapeshift->StancesNot : 0; + + // SpellTargetRestrictionsEntry + SpellTargetRestrictionsEntry const* _target = GetSpellTargetRestrictions(); + Targets = _target ? _target->Targets : 0; + TargetCreatureType = _target ? _target->TargetCreatureType : 0; + MaxAffectedTargets = _target ? _target->MaxAffectedTargets : 0; + + // SpellTotemsEntry + SpellTotemsEntry const* _totem = GetSpellTotems(); + for (uint8 i = 0; i < 2; ++i) + TotemCategory[i] = _totem ? _totem->TotemCategory[i] : 0; + for (uint8 i = 0; i < 2; ++i) + Totem[i] = _totem ? _totem->Totem[i] : 0; + ExplicitTargetMask = _GetExplicitTargetMask(); ChainEntry = NULL; } @@ -1381,10 +1456,10 @@ SpellCastResult SpellInfo::CheckShapeshift(uint32 form) const return SPELL_CAST_OK; bool actAsShifted = false; - SpellShapeshiftEntry const* shapeInfo = NULL; + SpellShapeshiftFormEntry const* shapeInfo = NULL; if (form > 0) { - shapeInfo = sSpellShapeshiftStore.LookupEntry(form); + shapeInfo = sSpellShapeshiftFormStore.LookupEntry(form); if (!shapeInfo) { sLog->outError("GetErrorAtShapeshiftedCast: unknown shapeshift %u", form); @@ -2522,3 +2597,83 @@ bool SpellInfo::_IsPositiveTarget(uint32 targetA, uint32 targetB) return _IsPositiveTarget(targetB, 0); return true; } + +SpellTargetRestrictionsEntry const* SpellInfo::GetSpellTargetRestrictions() const +{ + return SpellTargetRestrictionsId ? sSpellTargetRestrictionsStore.LookupEntry(SpellTargetRestrictionsId) : NULL; +} + +SpellEquippedItemsEntry const* SpellInfo::GetSpellEquippedItems() const +{ + return SpellEquippedItemsId ? sSpellEquippedItemsStore.LookupEntry(SpellEquippedItemsId) : NULL; +} + +SpellInterruptsEntry const* SpellInfo::GetSpellInterrupts() const +{ + return SpellInterruptsId ? sSpellInterruptsStore.LookupEntry(SpellInterruptsId) : NULL; +} + +SpellLevelsEntry const* SpellInfo::GetSpellLevels() const +{ + return SpellLevelsId ? sSpellLevelsStore.LookupEntry(SpellLevelsId) : NULL; +} + +SpellPowerEntry const* SpellInfo::GetSpellPower() const +{ + return SpellPowerId ? sSpellPowerStore.LookupEntry(SpellPowerId) : NULL; +} + +SpellReagentsEntry const* SpellInfo::GetSpellReagents() const +{ + return SpellReagentsId ? sSpellReagentsStore.LookupEntry(SpellReagentsId) : NULL; +} + +SpellScalingEntry const* SpellInfo::GetSpellScaling() const +{ + return SpellScalingId ? sSpellScalingStore.LookupEntry(SpellScalingId) : NULL; +} + +SpellShapeshiftEntry const* SpellInfo::GetSpellShapeshift() const +{ + return SpellShapeshiftId ? sSpellShapeshiftStore.LookupEntry(SpellShapeshiftId) : NULL; +} + +SpellTotemsEntry const* SpellInfo::GetSpellTotems() const +{ + return SpellTotemsId ? sSpellTotemsStore.LookupEntry(SpellTotemsId) : NULL; +} + +SpellAuraOptionsEntry const* SpellInfo::GetSpellAuraOptions() const +{ + return SpellAuraOptionsId ? sSpellAuraOptionsStore.LookupEntry(SpellAuraOptionsId) : NULL; +} + +SpellAuraRestrictionsEntry const* SpellInfo::GetSpellAuraRestrictions() const +{ + return SpellAuraRestrictionsId ? sSpellAuraRestrictionsStore.LookupEntry(SpellAuraRestrictionsId) : NULL; +} + +SpellCastingRequirementsEntry const* SpellInfo::GetSpellCastingRequirements() const +{ + return SpellCastingRequirementsId ? sSpellCastingRequirementsStore.LookupEntry(SpellCastingRequirementsId) : NULL; +} + +SpellCategoriesEntry const* SpellInfo::GetSpellCategories() const +{ + return SpellCategoriesId ? sSpellCategoriesStore.LookupEntry(SpellCategoriesId) : NULL; +} + +SpellClassOptionsEntry const* SpellInfo::GetSpellClassOptions() const +{ + return SpellClassOptionsId ? sSpellClassOptionsStore.LookupEntry(SpellClassOptionsId) : NULL; +} + +SpellCooldownsEntry const* SpellInfo::GetSpellCooldowns() const +{ + return SpellCooldownsId ? sSpellCooldownsStore.LookupEntry(SpellCooldownsId) : NULL; +} + +SpellEffectEntry const* SpellEntry::GetSpellEffect(uint32 eff) const +{ + return GetSpellEffectEntry(Id, eff); +} \ No newline at end of file diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h index 7faf0de890d..c6947372b0f 100644 --- a/src/server/game/Spells/SpellInfo.h +++ b/src/server/game/Spells/SpellInfo.h @@ -323,6 +323,7 @@ public: uint32 AttributesEx5; uint32 AttributesEx6; uint32 AttributesEx7; + uint32 AttributesEx8; uint32 AttributesCu; uint32 Stances; uint32 StancesNot; @@ -373,8 +374,8 @@ public: uint32 SpellVisual[2]; uint32 SpellIconID; uint32 ActiveIconID; - char* SpellName[16]; - char* Rank[16]; + DBCString SpellName; + DBCString Rank; uint32 MaxTargetLevel; uint32 MaxAffectedTargets; uint32 SpellFamilyName; @@ -383,10 +384,53 @@ public: uint32 PreventionType; int32 AreaGroupId; uint32 SchoolMask; + uint32 SpellDifficultyId; + uint32 SpellScalingId; + uint32 SpellAuraOptionsId; + uint32 SpellAuraRestrictionsId; + uint32 SpellCastingRequirementsId; + uint32 SpellCategoriesId; + uint32 SpellClassOptionsId; + uint32 SpellCooldownsId; + uint32 SpellEquippedItemsId; + uint32 SpellInterruptsId; + uint32 SpellLevelsId; + uint32 SpellPowerId; + uint32 SpellReagentsId; + uint32 SpellShapeshiftId; + uint32 SpellTargetRestrictionsId; + uint32 SpellTotemsId; + // SpellScalingEntry + int32 castTimeMin; + int32 castTimeMax; + uint32 castScalingMaxLevel; + uint32 playerClass; + float Multiplier[3]; + float RandomMultiplier[3]; + float OtherMultiplier[3]; + float CoefBase; + uint32 CoefLevelBase; SpellEffectInfo Effects[MAX_SPELL_EFFECTS]; uint32 ExplicitTargetMask; SpellChainNode const* ChainEntry; + // struct access functions + SpellTargetRestrictionsEntry const* GetSpellTargetRestrictions() const; + SpellAuraOptionsEntry const* GetSpellAuraOptions() const; + SpellAuraRestrictionsEntry const* GetSpellAuraRestrictions() const; + SpellCastingRequirementsEntry const* GetSpellCastingRequirements() const; + SpellCategoriesEntry const* GetSpellCategories() const; + SpellClassOptionsEntry const* GetSpellClassOptions() const; + SpellCooldownsEntry const* GetSpellCooldowns() const; + SpellEquippedItemsEntry const* GetSpellEquippedItems() const; + SpellInterruptsEntry const* GetSpellInterrupts() const; + SpellLevelsEntry const* GetSpellLevels() const; + SpellPowerEntry const* GetSpellPower() const; + SpellReagentsEntry const* GetSpellReagents() const; + SpellScalingEntry const* GetSpellScaling() const; + SpellShapeshiftEntry const* GetSpellShapeshift() const; + SpellTotemsEntry const* GetSpellTotems() const; + SpellInfo(SpellEntry const* spellEntry); bool HasEffect(SpellEffects effect) const; diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index c85758c3897..91cca4011ad 100755 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -2926,7 +2926,7 @@ void SpellMgr::LoadDbcDataCorrections() { uint32 oldMSTime = getMSTime(); - SpellEntry* spellInfo = NULL; + /*SpellEntry* spellInfo = NULL; for (uint32 i = 0; i < sSpellStore.GetNumRows(); ++i) { spellInfo = (SpellEntry*)sSpellStore.LookupEntry(i); @@ -3508,7 +3508,7 @@ void SpellMgr::LoadDbcDataCorrections() properties->Type = SUMMON_TYPE_TOTEM; properties = const_cast(sSummonPropertiesStore.LookupEntry(647)); // 52893 properties->Type = SUMMON_TYPE_TOTEM; - + */ sLog->outString(">> Loading spell dbc data corrections in %u ms", GetMSTimeDiffToNow(oldMSTime)); sLog->outString(); } -- cgit v1.2.3 From 8c4d1451783cdb3da8e85e4cfdfa2205e18a414a Mon Sep 17 00:00:00 2001 From: Rat Date: Wed, 23 Nov 2011 13:17:40 +0100 Subject: fixed dbc local handling --- src/server/game/World/World.cpp | 18 +++++++++--------- src/server/worldserver/worldserver.conf.dist | 5 ++--- 2 files changed, 11 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 87cd3755538..9a5a8d6f5fe 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1752,20 +1752,20 @@ void World::SetInitialWorldSettings() void World::DetectDBCLang() { - uint8 m_lang_confid = ConfigMgr::GetIntDefault("DBC.Locale", 255); + uint8 m_lang_confid = ConfigMgr::GetIntDefault("DBC.Locale", 0); - if (m_lang_confid != 255 && m_lang_confid >= TOTAL_LOCALES) + if (m_lang_confid >= TOTAL_LOCALES) { sLog->outError("Incorrect DBC.Locale! Must be >= 0 and < %d (set to 0)", TOTAL_LOCALES); m_lang_confid = LOCALE_enUS; } - ChrRacesEntry const* race = sChrRacesStore.LookupEntry(1); + /*ChrRacesEntry const* race = sChrRacesStore.LookupEntry(1); std::string availableLocalsStr; uint8 default_locale = TOTAL_LOCALES; - /*for (uint8 i = default_locale-1; i < TOTAL_LOCALES; --i) // -1 will be 255 due to uint8 + for (uint8 i = default_locale-1; i < TOTAL_LOCALES; --i) // -1 will be 255 due to uint8 { if (race->name[i][0] != '\0') // check by race names { @@ -1774,7 +1774,7 @@ void World::DetectDBCLang() availableLocalsStr += localeNames[i]; availableLocalsStr += " "; } - }*/ + } if (default_locale != m_lang_confid && m_lang_confid < TOTAL_LOCALES && (m_availableDbcLocaleMask & (1 << m_lang_confid))) @@ -1785,12 +1785,12 @@ void World::DetectDBCLang() if (default_locale >= TOTAL_LOCALES) { sLog->outError("Unable to determine your DBC Locale! (corrupt DBC?)"); - //exit(1); TODO: enable after updated all dbc structures - } + exit(1); + }*/ - m_defaultDbcLocale = LocaleConstant(default_locale); + m_defaultDbcLocale = LocaleConstant(m_lang_confid); - sLog->outString("Using %s DBC Locale as default. All available DBC locales: %s", localeNames[m_defaultDbcLocale], availableLocalsStr.empty() ? "" : availableLocalsStr.c_str()); + sLog->outString("Using %s DBC Locale", localeNames[m_defaultDbcLocale]); sLog->outString(); } diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index b8988a01228..742421b5ead 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -886,8 +886,7 @@ StrictPetNames = 0 # # DBC.Locale # Description: DBC language settings. -# Default: 255 - (Auto Detect) -# 0 - (English) +# Default: 0 - (English) # 1 - (Korean) # 2 - (French) # 3 - (German) @@ -897,7 +896,7 @@ StrictPetNames = 0 # 7 - (Spanish Mexico) # 8 - (Russian) -DBC.Locale = 255 +DBC.Locale = 0 # # DeclinedNames -- cgit v1.2.3 From 7e6afa7fe8a30b3878c9d0ba32ff18d5a11fcbae Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 24 Nov 2011 00:35:11 +0000 Subject: Core/Enums: Add two new races to enumerations and update maxlevel in config --- sql/updates/world/2011_11_24_01_world_command.sql | 2 ++ src/server/game/Chat/Commands/Level2.cpp | 2 ++ src/server/game/Miscellaneous/SharedDefines.h | 15 ++++++++------- src/server/worldserver/worldserver.conf.dist | 13 +++++++------ 4 files changed, 19 insertions(+), 13 deletions(-) create mode 100644 sql/updates/world/2011_11_24_01_world_command.sql (limited to 'src') diff --git a/sql/updates/world/2011_11_24_01_world_command.sql b/sql/updates/world/2011_11_24_01_world_command.sql new file mode 100644 index 00000000000..849a7538621 --- /dev/null +++ b/sql/updates/world/2011_11_24_01_world_command.sql @@ -0,0 +1,2 @@ +UPDATE `command` SET `help`='Syntax: .account set addon [$account] #addon\n\nSet user (possible targeted) expansion addon level allowed. Addon values: 0 - normal, 1 - tbc, 2 - wotlk, 3 - cata.' WHERE `name`='account set addon'; +UPDATE `command` SET `help`='Syntax: .account addon #addon\nSet expansion addon level allowed. Addon values: 0 - normal, 1 - tbc, 2 - wotlk, 3 - cata.' WHERE `name`='account addon'; diff --git a/src/server/game/Chat/Commands/Level2.cpp b/src/server/game/Chat/Commands/Level2.cpp index 1dd603094f6..295ab1fbf99 100755 --- a/src/server/game/Chat/Commands/Level2.cpp +++ b/src/server/game/Chat/Commands/Level2.cpp @@ -385,6 +385,8 @@ bool ChatHandler::HandlePInfoCommand(const char* args) case RACE_TROLL: race_s = "Troll"; break; case RACE_BLOODELF: race_s = "Blood Elf"; break; case RACE_DRAENEI: race_s = "Draenei"; break; + case RACE_GOBLIN: race_s = "Goblin"; break; + case RACE_WORGEN: race_s = "Worgen"; break; } switch (Class) { diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index a99d0f37c02..8cb9056ed07 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -62,9 +62,9 @@ enum Races RACE_TAUREN = 6, RACE_GNOME = 7, RACE_TROLL = 8, - //RACE_GOBLIN = 9, + RACE_GOBLIN = 9, RACE_BLOODELF = 10, - RACE_DRAENEI = 11 + RACE_DRAENEI = 11, //RACE_FEL_ORC = 12, //RACE_NAGA = 13, //RACE_BROKEN = 14, @@ -74,7 +74,8 @@ enum Races //RACE_FOREST_TROLL = 18, //RACE_TAUNKA = 19, //RACE_NORTHREND_SKELETON = 20, - //RACE_ICE_TROLL = 21 + //RACE_ICE_TROLL = 21, + RACE_WORGEN = 22 }; // max+1 for player race @@ -82,13 +83,13 @@ enum Races #define RACEMASK_ALL_PLAYABLE \ ((1<<(RACE_HUMAN-1)) |(1<<(RACE_ORC-1)) |(1<<(RACE_DWARF-1)) | \ - (1<<(RACE_NIGHTELF-1))|(1<<(RACE_UNDEAD_PLAYER-1))|(1<<(RACE_TAUREN-1)) | \ - (1<<(RACE_GNOME-1)) |(1<<(RACE_TROLL-1)) |(1<<(RACE_BLOODELF-1))| \ - (1<<(RACE_DRAENEI-1))) + (1<<(RACE_NIGHTELF-1))|(1<<(RACE_UNDEAD_PLAYER-1))|(1<<(RACE_TAUREN-1)) | \ + (1<<(RACE_GNOME-1)) |(1<<(RACE_TROLL-1)) |(1<<(RACE_BLOODELF-1))| \ + (1<<(RACE_DRAENEI-1)) |(1<<(RACE_GOBLIN-1)) |(1<<(RACE_WORGEN-1))) #define RACEMASK_ALLIANCE \ ((1<<(RACE_HUMAN-1)) | (1<<(RACE_DWARF-1)) | (1<<(RACE_NIGHTELF-1)) | \ - (1<<(RACE_GNOME-1)) | (1<<(RACE_DRAENEI-1))) + (1<<(RACE_GNOME-1)) | (1<<(RACE_DRAENEI-1)) | (1<<(RACE_WORGEN-1))) #define RACEMASK_HORDE RACEMASK_ALL_PLAYABLE & ~RACEMASK_ALLIANCE diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index 742421b5ead..818db5d46b8 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -910,11 +910,12 @@ DeclinedNames = 0 # Expansion # Description: Allow server to use content from expansions. Checks for expansion-related # map files, client compatibility and class/race character creation. -# Default: 2 - (Expansion 2) +# Default: 3 - (Expansion 3) +# 2 - (Expansion 2) # 1 - (Expansion 1) # 0 - (Disabled, Ignore and disable expansion content (maps, races, classes) -Expansion = 2 +Expansion = 3 # # MinPlayerName @@ -1041,16 +1042,16 @@ SkipCinematics = 0 # Description: Maximum level that can be reached by players. # Important: Levels beyond 100 are not recommended at all. # Range: 1-255 -# Default: 80 +# Default: 85 -MaxPlayerLevel = 80 +MaxPlayerLevel = 85 # # MinDualSpecLevel # Description: Level requirement for Dual Talent Specialization -# Default: 40 +# Default: 30 -MinDualSpecLevel = 40 +MinDualSpecLevel = 30 # # StartPlayerLevel -- cgit v1.2.3 From d6ad3c854a8d2414f5770ae3178563cd8ef9f65b Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 24 Nov 2011 00:36:02 +0000 Subject: Core/Auth: Fix SMSG_AUTH_RESPONSE Should send an extra byte with expansion (selecting new classes in char enum screen is now possible) --- src/server/game/Server/Protocol/Handlers/AuthHandler.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Handlers/AuthHandler.cpp b/src/server/game/Server/Protocol/Handlers/AuthHandler.cpp index d85f3e24aff..89a700f3e29 100755 --- a/src/server/game/Server/Protocol/Handlers/AuthHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/AuthHandler.cpp @@ -26,7 +26,8 @@ void WorldSession::SendAuthResponse(uint8 code, bool shortForm, uint32 queuePos) packet << uint32(0); // BillingTimeRemaining packet << uint8(0); // BillingPlanFlags packet << uint32(0); // BillingTimeRested - packet << uint8(Expansion()); // 0 - normal, 1 - TBC, 2 - WOTLK, must be set in database manually for each account + packet << uint8(Expansion()); // 0 - normal, 1 - TBC, 2 - WOTLK, 3 - CATA; must be set in database manually for each account + packet << uint8(Expansion()); // Unknown, these two show the same if (!shortForm) { -- cgit v1.2.3 From 16e1ab07424f4b7693ea1f88c6fbf91a954edea2 Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 24 Nov 2011 02:07:46 +0000 Subject: Core/Protocol: Add few opcode ids --- src/server/game/Server/Protocol/Opcodes.cpp | 4 +- src/server/game/Server/Protocol/Opcodes.h | 550 ++++++++++++++-------------- 2 files changed, 278 insertions(+), 276 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 44ac7e3b6bd..762c5edb59a 100755 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -393,7 +393,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_LOOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LOOT_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMoneyOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LOOT_RELEASE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootReleaseOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_LOOT_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOOT_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOOT_RELEASE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOOT_REMOVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOOT_MONEY_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1057,7 +1057,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_GOGOGO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ECHO_PARTY_SQUELCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SET_TITLE_SUFFIX, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SPELLCLICK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSpellClick ); + DEFINE_OPCODE_HANDLER(CMSG_SPELLCLICK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSpellClick ); //DEFINE_OPCODE_HANDLER(SMSG_LOOT_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GM_CHARACTER_RESTORE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GM_CHARACTER_SAVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 0bb7bcf2e38..652900cd4af 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -31,39 +31,39 @@ enum Opcodes NUM_OPCODE_HANDLERS = (0xFFFF+1), UNKNOWN_OPCODE = NUM_OPCODE_HANDLERS, - CMSG_ACCEPT_LEVEL_GRANT = 0xDC4B, // 14545 + CMSG_ACCEPT_LEVEL_GRANT = 0xDC4B, // CMSG_ACCEPT_TRADE = 0x00, // CMSG_ACTIVATETAXI = 0x00, // CMSG_ACTIVATETAXIEXPRESS = 0x00, // - CMSG_ADD_FRIEND = 0x5C57, // 14545 - CMSG_ADD_IGNORE = 0xCEEA, // 14545 - CMSG_ADD_VOICE_IGNORE = 0xA7A, // 14545 + CMSG_ADD_FRIEND = 0x5C57, // + CMSG_ADD_IGNORE = 0xCEEA, // + CMSG_ADD_VOICE_IGNORE = 0xA7A, // CMSG_ALTER_APPEARANCE = 0x00, // - CMSG_AREATRIGGER = 0x5862, // 14545 - CMSG_AREA_SPIRIT_HEALER_QUERY = 0xDC7E, // 14545 + CMSG_AREATRIGGER = 0x5862, // + CMSG_AREA_SPIRIT_HEALER_QUERY = 0xDC7E, // CMSG_AREA_SPIRIT_HEALER_QUEUE = 0x00, // CMSG_ARENA_TEAM_ACCEPT = 0x00, // CMSG_ARENA_TEAM_DECLINE = 0x00, // - CMSG_ARENA_TEAM_DISBAND = 0x4A5A, // 14545 - CMSG_ARENA_TEAM_INVITE = 0x4862, // 14545 - CMSG_ARENA_TEAM_LEADER = 0x8F3, // 14545 - CMSG_ARENA_TEAM_LEAVE = 0x48EB, // 14545 - CMSG_ARENA_TEAM_QUERY = 0x872, // 14545 - CMSG_ARENA_TEAM_REMOVE = 0xCE5E, // 14545 + CMSG_ARENA_TEAM_DISBAND = 0x4A5A, // + CMSG_ARENA_TEAM_INVITE = 0x4862, // + CMSG_ARENA_TEAM_LEADER = 0x8F3, // + CMSG_ARENA_TEAM_LEAVE = 0x48EB, // + CMSG_ARENA_TEAM_QUERY = 0x872, // + CMSG_ARENA_TEAM_REMOVE = 0xCE5E, // CMSG_ARENA_TEAM_ROSTER = 0x00, // CMSG_ATTACKSTOP = 0x00, // CMSG_ATTACKSWING = 0x00, // CMSG_AUCTION_LIST_BIDDER_ITEMS = 0x00, // - CMSG_AUCTION_LIST_ITEMS = 0xDC5F, // 14545 + CMSG_AUCTION_LIST_ITEMS = 0xDC5F, // CMSG_AUCTION_LIST_OWNER_ITEMS = 0x00, // - CMSG_AUCTION_PLACE_BID = 0x8E76, // 14545 - CMSG_AUCTION_REMOVE_ITEM = 0xCEC3, // 14545 - CMSG_AUCTION_SELL_ITEM = 0xCE6, // 14545 - CMSG_AUTH_SESSION = 0x1019, // 14545 + CMSG_AUCTION_PLACE_BID = 0x8E76, // + CMSG_AUCTION_REMOVE_ITEM = 0xCEC3, // + CMSG_AUCTION_SELL_ITEM = 0xCE6, // + CMSG_AUTH_SESSION = 0x1019, // CMSG_AUTOEQUIP_GROUND_ITEM = 0x00, // - CMSG_AUTOEQUIP_ITEM = 0x8E66, // 14545 + CMSG_AUTOEQUIP_ITEM = 0x8E66, // CMSG_AUTOEQUIP_ITEM_SLOT = 0x00, // - CMSG_AUTO_DECLINE_GUILD_INVITES = 0x586F, // 14545 + CMSG_AUTO_DECLINE_GUILD_INVITES = 0x586F, // CMSG_AUTOSTORE_BAG_ITEM = 0x00, // CMSG_AUTOSTORE_GROUND_ITEM = 0x00, // CMSG_AUTOSTORE_LOOT_ITEM = 0x00, // @@ -76,16 +76,16 @@ enum Opcodes CMSG_BEGIN_TRADE = 0x00, // CMSG_BINDER_ACTIVATE = 0x00, // CMSG_BOT_DETECTED2 = 0x00, // - CMSG_BUG = 0x1A77, // 14545 + CMSG_BUG = 0x1A77, // CMSG_BUSY_TRADE = 0x00, // - CMSG_BUYBACK_ITEM = 0xDEE6, // 14545 - CMSG_BUY_BANK_SLOT = 0x487F, // 14545 + CMSG_BUYBACK_ITEM = 0xDEE6, // + CMSG_BUY_BANK_SLOT = 0x487F, // CMSG_BUY_ITEM = 0x00, // - CMSG_CALENDAR_ADD_EVENT = 0x1CF3, // 14545 + CMSG_CALENDAR_ADD_EVENT = 0x1CF3, // CMSG_CALENDAR_ARENA_TEAM = 0x00, // CMSG_CALENDAR_CONTEXT_EVENT_SIGNUP = 0x00, // CMSG_CALENDAR_COPY_EVENT = 0x00, // - CMSG_CALENDAR_EVENT_INVITE = 0x1EDA, // 14545 + CMSG_CALENDAR_EVENT_INVITE = 0x1EDA, // CMSG_CALENDAR_EVENT_MODERATOR_STATUS = 0x00, // CMSG_CALENDAR_EVENT_REMOVE_INVITE = 0x00, // CMSG_CALENDAR_EVENT_STATUS = 0x00, // @@ -93,15 +93,15 @@ enum Opcodes CMSG_CALENDAR_GET_NUM_PENDING = 0x00, // CMSG_CALENDAR_GUILD_FILTER = 0x00, // CMSG_CALENDAR_REMOVE_EVENT = 0x00, // - CMSG_CALENDAR_UPDATE_EVENT = 0x5CD2, // 14545 + CMSG_CALENDAR_UPDATE_EVENT = 0x5CD2, // CMSG_CANCEL_AURA = 0x00, // - CMSG_CANCEL_AUTO_REPEAT_SPELL = 0x5CEE, // 14545 + CMSG_CANCEL_AUTO_REPEAT_SPELL = 0x5CEE, // CMSG_CANCEL_CAST = 0x00, // - CMSG_CANCEL_CHANNELLING = 0xC8FE, // 14545 - CMSG_CANCEL_GROWTH_AURA = 0xDEF7, // 14545 + CMSG_CANCEL_CHANNELLING = 0xC8FE, // + CMSG_CANCEL_GROWTH_AURA = 0xDEF7, // CMSG_CANCEL_MOUNT_AURA = 0x00, // CMSG_CANCEL_TEMP_ENCHANTMENT = 0x00, // - CMSG_CANCEL_TRADE = 0x35A5, // 14545 + CMSG_CANCEL_TRADE = 0x35A5, // CMSG_CAST_SPELL = 0x00, // CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE = 0x00, // CMSG_CHANNEL_ANNOUNCEMENTS = 0x00, // @@ -119,43 +119,43 @@ enum Opcodes CMSG_CHANNEL_UNBAN = 0x00, // CMSG_CHANNEL_UNMODERATOR = 0x00, // CMSG_CHANNEL_UNMUTE = 0x00, // - CMSG_CHAR_CREATE = 0x1AC6, // 14545 - CMSG_CHAR_CUSTOMIZE = 0xDECF, // 14545 - CMSG_CHAR_DELETE = 0x1ED3, // 14545 - CMSG_CHAR_ENUM = 0x4A8B, // 14545 - CMSG_CHAR_FACTION_CHANGE = 0xCCEE, // 14545 - CMSG_CHAR_RACE_CHANGE = 0xDC57, // 14545 - CMSG_CHAR_RENAME = 0x5E6F, // 14545 - CMSG_CLEAR_CHANNEL_WATCH = 0x9CC2, // 14545 + CMSG_CHAR_CREATE = 0x1AC6, // + CMSG_CHAR_CUSTOMIZE = 0xDECF, // + CMSG_CHAR_DELETE = 0x1ED3, // + CMSG_CHAR_ENUM = 0x4A8B, // + CMSG_CHAR_FACTION_CHANGE = 0xCCEE, // + CMSG_CHAR_RACE_CHANGE = 0xDC57, // + CMSG_CHAR_RENAME = 0x5E6F, // + CMSG_CLEAR_CHANNEL_WATCH = 0x9CC2, // CMSG_CLEAR_TRADE_ITEM = 0x00, // - CMSG_COMMENTATOR_ENABLE = 0x1CF7, // 14545 - CMSG_COMMENTATOR_ENTER_INSTANCE = 0x8EF6, // 14545 - CMSG_COMMENTATOR_EXIT_INSTANCE = 0x4C7B, // 14545 - CMSG_COMMENTATOR_GET_MAP_INFO = 0xDEE7, // 14545 - CMSG_COMMENTATOR_GET_PLAYER_INFO = 0x9EF3, // 14545 - CMSG_COMMENTATOR_INSTANCE_COMMAND = 0x5CEB, // 14545 - CMSG_COMMENTATOR_SKIRMISH_QUEUE_COMMAND = 0x9C4E, // 14545 + CMSG_COMMENTATOR_ENABLE = 0x1CF7, // + CMSG_COMMENTATOR_ENTER_INSTANCE = 0x8EF6, // + CMSG_COMMENTATOR_EXIT_INSTANCE = 0x4C7B, // + CMSG_COMMENTATOR_GET_MAP_INFO = 0xDEE7, // + CMSG_COMMENTATOR_GET_PLAYER_INFO = 0x9EF3, // + CMSG_COMMENTATOR_INSTANCE_COMMAND = 0x5CEB, // + CMSG_COMMENTATOR_SKIRMISH_QUEUE_COMMAND = 0x9C4E, // CMSG_COMMENTATOR_START_WARGAME = 0x00, // CMSG_COMPLAIN = 0x00, // - CMSG_COMPLETE_CINEMATIC = 0x1A6F, // 14545 + CMSG_COMPLETE_CINEMATIC = 0x1A6F, // CMSG_COMPLETE_MOVIE = 0x00, // - CMSG_CONTACT_LIST = 0xCECF, // 14545 - CMSG_CORPSE_MAP_POSITION_QUERY = 0xDC7F, // 14545 - CMSG_CREATURE_QUERY = 0x5A7E, // 14545 - CMSG_DANCE_QUERY = 0x5C5E, // 14545 + CMSG_CONTACT_LIST = 0xCECF, // + CMSG_CORPSE_MAP_POSITION_QUERY = 0xDC7F, // + CMSG_CREATURE_QUERY = 0x5A7E, // + CMSG_DANCE_QUERY = 0x5C5E, // CMSG_DECLINE_CHANNEL_INVITE = 0x00, // - CMSG_DEL_FRIEND = 0xC852, // 14545 - CMSG_DEL_IGNORE = 0x8ADA, // 14545 - CMSG_DEL_VOICE_IGNORE = 0x8C73, // 14545 - CMSG_DESTROYITEM = 0x4E7A, // 14545 + CMSG_DEL_FRIEND = 0xC852, // + CMSG_DEL_IGNORE = 0x8ADA, // + CMSG_DEL_VOICE_IGNORE = 0x8C73, // + CMSG_DESTROYITEM = 0x4E7A, // CMSG_DESTROY_ITEMS = 0x00, // CMSG_DUEL_ACCEPTED = 0x00, // CMSG_DUEL_CANCELLED = 0x00, // CMSG_EJECT_PASSENGER = 0x00, // CMSG_EQUIPMENT_SET_DELETE = 0x00, // CMSG_EQUIPMENT_SET_SAVE = 0x00, // - CMSG_EQUIPMENT_SET_USE = 0x4853, // 14545 - CMSG_EMOTE = 0x9843, // 14545 + CMSG_EQUIPMENT_SET_USE = 0x4853, // + CMSG_EMOTE = 0x9843, // CMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK = 0x00, // CMSG_FORCE_FLIGHT_SPEED_CHANGE_ACK = 0x00, // CMSG_FORCE_MOVE_ROOT_ACK = 0x00, // @@ -167,13 +167,13 @@ enum Opcodes CMSG_FORCE_SWIM_SPEED_CHANGE_ACK = 0x00, // CMSG_FORCE_TURN_RATE_CHANGE_ACK = 0x00, // CMSG_FORCE_WALK_SPEED_CHANGE_ACK = 0x00, // - CMSG_GAMEOBJECT_QUERY = 0xCEFF, // 14545 + CMSG_GAMEOBJECT_QUERY = 0xCEFF, // CMSG_GAMEOBJ_REPORT_USE = 0x00, // CMSG_GAMEOBJ_USE = 0x00, // CMSG_GAMESPEED_SET = 0x00, // CMSG_GAMETIME_SET = 0x00, // - CMSG_GET_MAIL_LIST = 0xB284, // 14545 - CMSG_GET_MIRRORIMAGE_DATA = 0xDAF3, // 14545 + CMSG_GET_MAIL_LIST = 0xB284, // + CMSG_GET_MIRRORIMAGE_DATA = 0xDAF3, // CMSG_GETDEATHBINDZONE = 0x00, // CMSG_GHOST = 0x00, // CMSG_GM_INVIS = 0x00, // @@ -182,43 +182,43 @@ enum Opcodes CMSG_GMTICKET_CREATE = 0x00, // CMSG_GMTICKET_DELETETICKET = 0x00, // CMSG_GMTICKET_GETTICKET = 0x00, // - CMSG_GMTICKET_SYSTEMSTATUS = 0x4A7A, // 14545 - CMSG_GMTICKET_UPDATETEXT = 0x8A7B, // 14545 + CMSG_GMTICKET_SYSTEMSTATUS = 0x4A7A, // + CMSG_GMTICKET_UPDATETEXT = 0x8A7B, // CMSG_GM_NUKE = 0x00, // CMSG_GM_SET_SECURITY_GROUP = 0x00, // CMSG_GM_REPORT_LAG = 0x00, // - CMSG_GOSSIP_HELLO = 0xAD3, // 14545 - CMSG_GOSSIP_SELECT_OPTION = 0x984E, // 14545 - CMSG_GRANT_LEVEL = 0x1CD6, // 14545 + CMSG_GOSSIP_HELLO = 0xAD3, // + CMSG_GOSSIP_SELECT_OPTION = 0x984E, // + CMSG_GRANT_LEVEL = 0x1CD6, // CMSG_GROUP_ACCEPT = 0x00, // - CMSG_GROUP_ASSISTANT_LEADER = 0xC8CA, // 14545 + CMSG_GROUP_ASSISTANT_LEADER = 0xC8CA, // CMSG_GROUP_CANCEL = 0x00, // - CMSG_GROUP_CHANGE_SUB_GROUP = 0x1AD2, // 14545 + CMSG_GROUP_CHANGE_SUB_GROUP = 0x1AD2, // CMSG_GROUP_DECLINE = 0x00, // CMSG_GROUP_DISBAND = 0x00, // CMSG_GROUP_INVITE = 0x00, // - CMSG_GROUP_RAID_CONVERT = 0xC85A, // 14545 - CMSG_GROUP_SET_LEADER = 0xCEC7, // 14545 - CMSG_GROUP_SWAP_SUB_GROUP = 0x5AD7, // 14545 + CMSG_GROUP_RAID_CONVERT = 0xC85A, // + CMSG_GROUP_SET_LEADER = 0xCEC7, // + CMSG_GROUP_SWAP_SUB_GROUP = 0x5AD7, // CMSG_GROUP_UNINVITE = 0x00, // CMSG_GROUP_UNINVITE_GUID = 0x00, // CMSG_GUILD_ACCEPT = 0x00, // - CMSG_GUILD_BANKER_ACTIVATE = 0x4E77, // 14545 + CMSG_GUILD_BANKER_ACTIVATE = 0x4E77, // CMSG_GUILD_BANK_BUY_TAB = 0x00, // CMSG_GUILD_BANK_DEPOSIT_MONEY = 0x00, // CMSG_GUILD_BANK_NOTE = 0x00, // - CMSG_GUILD_BANK_QUERY_TAB = 0xDE46, // 14545 - CMSG_GUILD_BANK_SWAP_ITEMS = 0x85B, // 14545 + CMSG_GUILD_BANK_QUERY_TAB = 0xDE46, // + CMSG_GUILD_BANK_SWAP_ITEMS = 0x85B, // CMSG_GUILD_BANK_UPDATE_TAB = 0x00, // CMSG_GUILD_BANK_WITHDRAW_MONEY = 0x00, // CMSG_GUILD_CREATE = 0x00, // CMSG_GUILD_DECLINE = 0x00, // CMSG_GUILD_DEMOTE = 0x00, // CMSG_GUILD_DISBAND = 0x00, // - CMSG_GUILD_INFO = 0xCE76, // 14545 + CMSG_GUILD_INFO = 0xCE76, // CMSG_GUILD_INVITE = 0x00, // CMSG_GUILD_PROMOTE = 0x00, // - CMSG_GUILD_QUERY = 0x00, // + CMSG_GUILD_QUERY = 0x8E57, // CMSG_GUILD_LEADER = 0x00, // CMSG_GUILD_LEAVE = 0x00, // CMSG_GUILD_MOTD = 0x00, // @@ -227,19 +227,19 @@ enum Opcodes CMSG_HEARTH_AND_RESURRECT = 0x00, // CMSG_IGNORE_TRADE = 0x00, // CMSG_INITIATE_TRADE = 0x00, // - CMSG_INSPECT = 0x9A7B, // 14545 - CMSG_INSTANCE_LOCK_WARNING_RESPONSE = 0x8CF7, // 14545 - CMSG_ITEM_QUERY_SINGLE = 0x8E2, // 14545 + CMSG_INSPECT = 0x9A7B, // + CMSG_INSTANCE_LOCK_WARNING_RESPONSE = 0x8CF7, // + CMSG_ITEM_QUERY_SINGLE = 0x8E2, // CMSG_ITEM_QUERY_MULTIPLE = 0x00, // - CMSG_ITEM_REFUND = 0xCC3, // 14545 - CMSG_ITEM_REFUND_INFO = 0x1C7E, // 14545 - CMSG_ITEM_TEXT_QUERY = 0x4AEB, // 14545 - CMSG_JOIN_CHANNEL = 0x3441, // 14545 - CMSG_KEEP_ALIVE = 0xC87A, // 14545 - CMSG_LEARN_PREVIEW_TALENTS = 0xDEE3, // 14545 - CMSG_LEARN_PREVIEW_TALENTS_PET = 0x9AFB, // 14545 - CMSG_LEARN_TALENT = 0x98F3, // 14545 - CMSG_LEAVE_BATTLEFIELD = 0x1AE7, // 14545 + CMSG_ITEM_REFUND = 0xCC3, // + CMSG_ITEM_REFUND_INFO = 0x1C7E, // + CMSG_ITEM_TEXT_QUERY = 0x4AEB, // + CMSG_JOIN_CHANNEL = 0x3441, // + CMSG_KEEP_ALIVE = 0xC87A, // + CMSG_LEARN_PREVIEW_TALENTS = 0xDEE3, // + CMSG_LEARN_PREVIEW_TALENTS_PET = 0x9AFB, // + CMSG_LEARN_TALENT = 0x98F3, // + CMSG_LEAVE_BATTLEFIELD = 0x1AE7, // CMSG_LEAVE_CHANNEL = 0x00, // CMSG_LFD_PARTY_LOCK_INFO_REQUEST = 0x00, // CMSG_LFG_GET_PLAYER_INFO = 0x00, // @@ -247,191 +247,193 @@ enum Opcodes CMSG_LFG_LEAVE = 0x00, // CMSG_LFG_PROPOSAL_RESULT = 0x00, // SMSG_LFG_BOOT_PLAYER = 0x00, // - CMSG_LFG_SET_ROLES = 0x4843, // 14545 - CMSG_LFG_TELEPORT = 0x8C7A, // 14545 - CMSG_LIST_INVENTORY = 0xDCFE, // 14545 + CMSG_LFG_SET_ROLES = 0x4843, // + CMSG_LFG_TELEPORT = 0x8C7A, // + CMSG_LIST_INVENTORY = 0xDCFE, // CMSG_LOG_DISCONNECT = 0x00, // - CMSG_LOGOUT_CANCEL = 0xA76, // 14545 - CMSG_LOGOUT_REQUEST = 0x4C7A, // 14545 + CMSG_LOGOUT_CANCEL = 0xA76, // + CMSG_LOGOUT_REQUEST = 0x4C7A, // CMSG_LOOT = 0x00, // CMSG_LOOT_METHOD = 0x00, // CMSG_LOOT_MONEY = 0x00, // - CMSG_LOOT_RELEASE = 0x4A6A, // 14545 + CMSG_LOOT_RELEASE = 0x4A6A, // CMSG_LOOT_ROLL = 0x00, // - CMSG_MAIL_CREATE_TEXT_ITEM = 0x886E, // 14545 - CMSG_MAIL_DELETE = 0x4CCF, // 14545 + CMSG_MAIL_CREATE_TEXT_ITEM = 0x886E, // + CMSG_MAIL_DELETE = 0x4CCF, // CMSG_MAIL_MARK_AS_READ = 0x00, // - CMSG_MAIL_RETURN_TO_SENDER = 0x587E, // 14545 - CMSG_MAIL_TAKE_ITEM = 0xCC2, // 14545 - CMSG_MAIL_TAKE_MONEY = 0x4CD6, // 14545 - CMSG_MEETINGSTONE_INFO = 0xCA5B, // 14545 + CMSG_MAIL_RETURN_TO_SENDER = 0x587E, // + CMSG_MAIL_TAKE_ITEM = 0xCC2, // + CMSG_MAIL_TAKE_MONEY = 0x4CD6, // + CMSG_MEETINGSTONE_INFO = 0xCA5B, // CMSG_MESSAGECHAT_AFK = 0x00, // CMSG_MESSAGECHAT_BATTLEGROUND = 0x00, // CMSG_MESSAGECHAT_BATTLEGROUND_LEADER = 0x00, // - CMSG_MESSAGECHAT_CHANNEL = 0x00, // + CMSG_MESSAGECHAT_ADDON = 0x24D9, // + CMSG_MESSAGECHAT_CHANNEL = 0x7459, // CMSG_MESSAGECHAT_DND = 0x00, // - CMSG_MESSAGECHAT_EMOTE = 0x00, // - CMSG_MESSAGECHAT_GUILD = 0x00, // + CMSG_MESSAGECHAT_EMOTE = 0x6449, // + CMSG_MESSAGECHAT_GUILD = 0x60C1, // CMSG_MESSAGECHAT_OFFICER = 0x00, // - CMSG_MESSAGECHAT_PARTY = 0x00, // + CMSG_MESSAGECHAT_PARTY = 0x24C9, // CMSG_MESSAGECHAT_PARTY_LEADER = 0x00, // CMSG_MESSAGECHAT_RAID = 0x00, // CMSG_MESSAGECHAT_RAID_LEADER = 0x00, // CMSG_MESSAGECHAT_RAID_WARNING = 0x00, // - CMSG_MESSAGECHAT_SAY = 0x00, // - CMSG_MESSAGECHAT_WHISPER = 0x00, // - CMSG_MESSAGECHAT_YELL = 0x00, // + CMSG_MESSAGECHAT_SAY = 0x2459, // + CMSG_MESSAGECHAT_WHISPER = 0x70D9, // + CMSG_MESSAGECHAT_YELL = 0x70C1, // CMSG_MINIGAME_MOVE = 0x00, // CMSG_MOUNTSPECIAL_ANIM = 0x00, // CMSG_MOVE_KNOCK_BACK_ACK = 0x00, // CMSG_MOVE_SET_RAW_POSITION = 0x00, // CMSG_MOVE_TIME_SKIPPED = 0x00, // CMSG_ENABLE_NAGLE = 0x00, // - CMSG_NAME_QUERY = 0x586A, // 14545 + CMSG_NAME_QUERY = 0x586A, // CMSG_NEW_SPELL_SLOT = 0x00, // - CMSG_NEXT_CINEMATIC_CAMERA = 0x8E63, // 14545 - CMSG_NPC_TEXT_QUERY = 0x5C63, // 14545 - CMSG_OFFER_PETITION = 0xC8DE, // 14545 - CMSG_OPEN_ITEM = 0x88C7, // 14545 - CMSG_OPENING_CINEMATIC = 0xD8D2, // 14545 + CMSG_NEXT_CINEMATIC_CAMERA = 0x8E63, // + CMSG_NPC_TEXT_QUERY = 0x5C63, // + CMSG_OFFER_PETITION = 0xC8DE, // + CMSG_OPEN_ITEM = 0x88C7, // + CMSG_OPENING_CINEMATIC = 0xD8D2, // CMSG_OPT_OUT_OF_LOOT = 0x00, // - CMSG_PAGE_TEXT_QUERY = 0x8A5F, // 14545 - CMSG_PETITION_BUY = 0x8E4E, // 14545 - CMSG_PETITION_QUERY = 0xCEF3, // 14545 + CMSG_PAGE_TEXT_QUERY = 0x8A5F, // + CMSG_PETITION_BUY = 0x8E4E, // + CMSG_PETITION_QUERY = 0xCEF3, // CMSG_PETITION_SHOWLIST = 0x00, // - CMSG_PETITION_SHOW_SIGNATURES = 0x00, // - CMSG_PETITION_SIGN = 0x4A5E, // 14545 + CMSG_PETITION_SHOW_SIGNATURES = 0x1E66, // + CMSG_PETITION_SIGN = 0x4A5E, // CMSG_PET_ABANDON = 0x00, // - CMSG_PET_ACTION = 0x1AEA, // 14545 + CMSG_PET_ACTION = 0x1AEA, // CMSG_PET_CANCEL_AURA = 0x00, // CMSG_PET_CAST_SPELL = 0x00, // - CMSG_PET_LEARN_TALENT = 0x48E6, // 14545 - CMSG_PET_NAME_QUERY = 0xDA76, // 14545 + CMSG_PET_LEARN_TALENT = 0x48E6, // + CMSG_PET_NAME_QUERY = 0xDA76, // CMSG_PET_RENAME = 0x00, // CMSG_PET_SET_ACTION = 0x00, // CMSG_PET_SPELL_AUTOCAST = 0x00, // CMSG_PET_STOP_ATTACK = 0x00, // - CMSG_PING = 0x1008, // 14545 + CMSG_PING = 0x1008, // CMSG_PLAYER_DIFFICULTY_CHANGE = 0x00, // - CMSG_PLAYED_TIME = 0x5A56, // 14545 - CMSG_PLAYER_LOGIN = 0x0898, // 14545 - CMSG_PLAYER_LOGOUT = 0x1CEE, // 14545 + CMSG_PLAYED_TIME = 0x5A56, // + CMSG_PLAYER_LOGIN = 0x0898, // + CMSG_PLAYER_LOGOUT = 0x1CEE, // CMSG_PLAYER_VEHICLE_ENTER = 0x00, // - CMSG_PLAY_DANCE = 0x5857, // 14545 - CMSG_PUSHQUESTTOPARTY = 0xA47, // 14545 + CMSG_PLAY_DANCE = 0x5857, // + CMSG_PUSHQUESTTOPARTY = 0xA47, // CMSG_QUERY_GUILD_REWARDS = 0x00, // CMSG_QUERY_GUILD_MAX_XP = 0x00, // CMSG_QUERY_GUILD_XP = 0x00, // - CMSG_QUERY_TIME = 0x18FE, // 14545 - CMSG_QUEST_QUERY = 0xCE7F, // 14545 - CMSG_QUERY_QUESTS_COMPLETED = 0x98DF, // 14545 + CMSG_QUERY_TIME = 0x18FE, // + CMSG_QUEST_QUERY = 0xCE7F, // + CMSG_QUERY_QUESTS_COMPLETED = 0x98DF, // CMSG_QUESTLOG_SWAP_QUEST = 0x00, // - CMSG_QUESTGIVER_ACCEPT_QUEST = 0x8CD3, // 14545 - CMSG_QUESTGIVER_CANCEL = 0xC86A, // 14545 - CMSG_QUESTGIVER_CHOOSE_REWARD = 0x18F3, // 14545 - CMSG_QUESTGIVER_COMPLETE_QUEST = 0xCCE3, // 14545 + CMSG_QUESTGIVER_ACCEPT_QUEST = 0x8CD3, // + CMSG_QUESTGIVER_CANCEL = 0xC86A, // + CMSG_QUESTGIVER_CHOOSE_REWARD = 0x18F3, // + CMSG_QUESTGIVER_COMPLETE_QUEST = 0xCCE3, // CMSG_QUESTGIVER_HELLO = 0x00, // - CMSG_QUESTGIVER_QUERY_QUEST = 0x8CE7, // 14545 + CMSG_QUESTGIVER_QUERY_QUEST = 0x8CE7, // CMSG_QUESTGIVER_QUEST_AUTOLAUNCH = 0x00, // - CMSG_QUESTGIVER_REQUEST_REWARD = 0xD8E7, // 14545 - CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY = 0xC8DB, // 14545 - CMSG_QUESTGIVER_STATUS_QUERY = 0x88C6, // 14545 - CMSG_QUESTLOG_REMOVE_QUEST = 0x8EFF, // 14545 + CMSG_QUESTGIVER_REQUEST_REWARD = 0xD8E7, // + CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY = 0xC8DB, // + CMSG_QUESTGIVER_STATUS_QUERY = 0x88C6, // + CMSG_QUESTLOG_REMOVE_QUEST = 0x8EFF, // CMSG_QUEST_POI_QUERY = 0x00, // - CMSG_QUEST_CONFIRM_ACCEPT = 0xC63, // 14545 - CMSG_READY_FOR_ACCOUNT_DATA_TIMES = 0xCCDB, // 14545 + CMSG_QUEST_CONFIRM_ACCEPT = 0xC63, // + CMSG_READY_FOR_ACCOUNT_DATA_TIMES = 0xCCDB, // CMSG_READ_ITEM = 0x00, // - CMSG_REALM_SPLIT = 0xDC66, // 14545 - CMSG_RECLAIM_CORPSE = 0x88DB, // 14545 + CMSG_REALM_SPLIT = 0xDC66, // + CMSG_RECLAIM_CORPSE = 0x88DB, // CMSG_REDIRECTION_AUTH_PROOF = 0x00, // - CMSG_REPAIR_ITEM = 0xCF3, // 14545 - CMSG_REPOP_REQUEST = 0x8872, // 14545 + CMSG_REPAIR_ITEM = 0xCF3, // + CMSG_REPOP_REQUEST = 0x8872, // CMSG_REPORT_PVP_AFK = 0x00, // CMSG_REPLACE_ACCOUNT_DATA = 0x00, // CMSG_REQUEST_ACCOUNT_DATA = 0x00, // CMSG_REQUEST_CATEGORY_COOLDOWNS = 0x00, // CMSG_REQUEST_CEMETERY_LIST = 0x00, // - CMSG_REQUEST_PARTY_MEMBER_STATS = 0x987E, // 14545 - CMSG_REQUEST_PET_INFO = 0x9A47, // 14545 - CMSG_REQUEST_PLAYER_VEHICLE_EXIT = 0xCC6, // 14545 + CMSG_REQUEST_PARTY_MEMBER_STATS = 0x987E, // + CMSG_REQUEST_PET_INFO = 0x9A47, // + CMSG_REQUEST_PLAYER_VEHICLE_EXIT = 0xCC6, // CMSG_REQUEST_RATED_BG_INFO = 0x00, // CMSG_REQUEST_RAID_INFO = 0x00, // - CMSG_REQUEST_VEHICLE_NEXT_SEAT = 0xCAD6, // 14545 - CMSG_REQUEST_VEHICLE_PREV_SEAT = 0x1AE2, // 14545 + CMSG_REQUEST_VEHICLE_NEXT_SEAT = 0xCAD6, // + CMSG_REQUEST_VEHICLE_PREV_SEAT = 0x1AE2, // CMSG_REQUEST_VEHICLE_SWITCH_SEAT = 0x01, // temp to fix switch case value error - CMSG_RESET_INSTANCES = 0x9EEA, // 14545 + CMSG_RESET_INSTANCES = 0x9EEA, // CMSG_RESURRECT_RESPONSE = 0x00, // CMSG_RETURN_TO_GRAVEYARD = 0x00, // CMSG_SAVE_PLAYER = 0x00, // CMSG_SEARCH_LFG_JOIN = 0x00, // CMSG_SEARCH_LFG_LEAVE = 0x00, // - CMSG_SELF_RES = 0xCCFE, // 14545 - CMSG_SELL_ITEM = 0x5EE3, // 14545 - CMSG_SET_ACTIONBAR_TOGGLES = 0x584F, // 14545 + CMSG_SELF_RES = 0xCCFE, // + CMSG_SELL_ITEM = 0x5EE3, // + CMSG_SET_ACTIONBAR_TOGGLES = 0x584F, // CMSG_SET_ACTION_BUTTON = 0x00, // CMSG_SET_ACTIVE_MOVER = 0x00, // CMSG_SET_ACTIVE_VOICE_CHANNEL = 0x00, // - CMSG_SET_ALLOW_LOW_LEVEL_RAID1 = 0xC863, // 14545 - CMSG_SET_ALLOW_LOW_LEVEL_RAID2 = 0x4CE7, // 14545 + CMSG_SET_ALLOW_LOW_LEVEL_RAID1 = 0xC863, // + CMSG_SET_ALLOW_LOW_LEVEL_RAID2 = 0x4CE7, // CMSG_SET_CHANNEL_WATCH = 0x00, // - CMSG_SET_CONTACT_NOTES = 0x1AF3, // 14545 + CMSG_SET_CONTACT_NOTES = 0x1AF3, // CMSG_SET_FACTION_CHEAT = 0x00, // CMSG_SET_GUILD_BANK_TEXT = 0x00, // CMSG_SET_LFG_COMMENT = 0x00, // - CMSG_SET_PLAYER_DECLINED_NAMES = 0xC847, // 14545 - CMSG_SET_PRIMARY_TALENT_TREE = 0x185E, // 14545 - CMSG_SET_SAVED_INSTANCE_EXTEND = 0x8E62, // 14545 - CMSG_SET_SELECTION = 0x4C4E, // 14545 + CMSG_SET_PLAYER_DECLINED_NAMES = 0xC847, // + CMSG_SET_PRIMARY_TALENT_TREE = 0x185E, // + CMSG_SET_SAVED_INSTANCE_EXTEND = 0x8E62, // + CMSG_SET_SELECTION = 0x4C4E, // CMSG_SET_SKILL_CHEAT = 0x00, // - CMSG_SET_TAXI_BENCHMARK_MODE = 0x1EFF, // 14545 + CMSG_SET_TAXI_BENCHMARK_MODE = 0x1EFF, // CMSG_SET_TITLE = 0x00, // CMSG_SET_TRADE_GOLD = 0x00, // CMSG_SET_TRADE_ITEM = 0x00, // CMSG_SETDEATHBINDPOINT = 0x00, // - CMSG_SETSHEATHED = 0xCA5F, // 14545 - CMSG_SHOWING_CLOAK = 0x8AE3, // 14545 - CMSG_SHOWING_HELM = 0xCEFA, // 14545 + CMSG_SETSHEATHED = 0xCA5F, // + CMSG_SHOWING_CLOAK = 0x8AE3, // + CMSG_SHOWING_HELM = 0xCEFA, // CMSG_SERVERTIME = 0x00, // CMSG_SOCKET_GEMS = 0x00, // - CMSG_SPIRIT_HEALER_ACTIVATE = 0x5AEB, // 14545 + CMSG_SPIRIT_HEALER_ACTIVATE = 0x5AEB, // + CMSG_SPELLCLICK = 0xC8F2, // CMSG_SPLIT_ITEM = 0x00, // - CMSG_STANDSTATECHANGE = 0x9EC6, // 14545 + CMSG_STANDSTATECHANGE = 0x9EC6, // CMSG_START_QUEST = 0x00, // CMSG_STOP_DANCE = 0x00, // CMSG_STORE_LOOT_IN_SLOT = 0x00, // - CMSG_SUMMON_RESPONSE = 0xD84E, // 14545 - CMSG_SWAP_ITEM = 0xDED6, // 14545 - CMSG_SWAP_INV_ITEM = 0x5CE7, // 14545 - CMSG_TELEPORT_TO_UNIT = 0x8C72, // 14545 + CMSG_SUMMON_RESPONSE = 0xD84E, // + CMSG_SWAP_ITEM = 0xDED6, // + CMSG_SWAP_INV_ITEM = 0x5CE7, // + CMSG_TELEPORT_TO_UNIT = 0x8C72, // CMSG_TEXT_EMOTE = 0x00, // - CMSG_TIME_SYNC_RESP = 0x00, // + CMSG_TIME_SYNC_RESP = 0x07A5, // CMSG_TAXICLEARALLNODES = 0x00, // CMSG_TAXIENABLEALLNODES = 0x00, // - CMSG_TAXINODE_STATUS_QUERY = 0x98E3, // 14545 + CMSG_TAXINODE_STATUS_QUERY = 0x98E3, // CMSG_TAXIQUERYAVAILABLENODES = 0x00, // CMSG_TAXISHOWNODES = 0x00, // - CMSG_TOGGLE_PVP = 0x8ECA, // 14545 + CMSG_TOGGLE_PVP = 0x8ECA, // CMSG_TOTEM_DESTROYED = 0x00, // - SMSG_TRAINER_BUY_SUCCEEDED = 0xAF7, // 14545 - CMSG_TRAINER_LIST = 0xCC7F, // 14545 + SMSG_TRAINER_BUY_SUCCEEDED = 0xAF7, // + CMSG_TRAINER_LIST = 0xCC7F, // CMSG_TRIGGER_CINEMATIC_CHEAT = 0x00, // - CMSG_TURN_IN_PETITION = 0x9C67, // 14545 + CMSG_TURN_IN_PETITION = 0x9C67, // CMSG_TUTORIAL_CLEAR = 0x00, // CMSG_TUTORIAL_FLAG = 0x00, // CMSG_TUTORIAL_RESET = 0x00, // CMSG_UNACCEPT_TRADE = 0x00, // - CMSG_UNLEARN_SKILL = 0xAC3, // 14545 + CMSG_UNLEARN_SKILL = 0xAC3, // CMSG_UNREGISTER_ALL_ADDON_PREFIXES = 0x00, // CMSG_UNUSED2 = 0x00, // - CMSG_UPDATE_ACCOUNT_DATA = 0x4AFE, // 14545 + CMSG_UPDATE_ACCOUNT_DATA = 0x4AFE, // CMSG_USE_ITEM = 0x00, // CMSG_VOICE_SESSION_ENABLE = 0x00, // CMSG_VIOLENCE_LEVEL = 0x00, // - CMSG_WARDEN_DATA = 0x5847, // 14545 - CMSG_WHO = 0x9AD7, // 14545 - CMSG_WHOIS = 0xCCE6, // 14545 + CMSG_WARDEN_DATA = 0x5847, // + CMSG_WHO = 0x9AD7, // + CMSG_WHOIS = 0xCCE6, // CMSG_WORLD_LOGIN = 0x00, // - CMSG_WORLD_STATE_UI_TIMER_UPDATE = 0x58F6, // 14545 + CMSG_WORLD_STATE_UI_TIMER_UPDATE = 0x58F6, // CMSG_WORLD_TELEPORT = 0x00, // CMSG_WRAP_ITEM = 0x00, // CMSG_ZONEUPDATE = 0x00, // @@ -443,16 +445,16 @@ enum Opcodes MSG_GM_SHOWLABEL = 0x00, // MSG_GM_SUMMON = 0x00, // MSG_GUILD_BANK_LOG_QUERY = 0x00, // - MSG_GUILD_BANK_MONEY_WITHDRAWN = 0xDE77, // 14545 + MSG_GUILD_BANK_MONEY_WITHDRAWN = 0xDE77, // MSG_GUILD_EVENT_LOG_QUERY = 0x00, // MSG_GUILD_PERMISSIONS = 0x00, // MSG_INSPECT_ARENA_TEAMS = 0x00, // - MSG_LIST_STABLED_PETS = 0x88CA, // 14545 + MSG_LIST_STABLED_PETS = 0x88CA, // MSG_MINIMAP_PING = 0x00, // MSG_MOVE_FALL_LAND = 0x00, // MSG_MOVE_HEARTBEAT = 0x00, // MSG_MOVE_HOVER = 0x00, // - MSG_MOVE_JUMP = 0xE4E, // 14545 + MSG_MOVE_JUMP = 0xE4E, // MSG_MOVE_KNOCK_BACK = 0x00, // MSG_MOVE_ROOT = 0x00, // MSG_MOVE_SET_ALL_SPEED_CHEAT = 0x00, // @@ -506,29 +508,29 @@ enum Opcodes MSG_MOVE_WORLDPORT_ACK = 0x00, // MSG_NOTIFY_PARTY_SQUELCH = 0x00, // MSG_PARTY_ASSIGNMENT = 0x00, // - MSG_PETITION_DECLINE = 0x98E7, // 14545 - MSG_PETITION_RENAME = 0x4857, // 14545 + MSG_PETITION_DECLINE = 0x98E7, // + MSG_PETITION_RENAME = 0x4857, // MSG_PVP_LOG_DATA = 0x00, // MSG_QUERY_GUILD_BANK_TEXT = 0x00, // MSG_QUERY_NEXT_MAIL_TIME = 0x00, // - MSG_QUEST_PUSH_RESULT = 0x1863, // 14545 - MSG_RAID_READY_CHECK = 0x584E, // 14545 - MSG_RAID_READY_CHECK_CONFIRM = 0x584E, // 14545 + MSG_QUEST_PUSH_RESULT = 0x1863, // + MSG_RAID_READY_CHECK = 0x584E, // + MSG_RAID_READY_CHECK_CONFIRM = 0x584E, // MSG_RAID_READY_CHECK_FINISHED = 0x00, // MSG_RAID_TARGET_UPDATE = 0x00, // - MSG_RANDOM_ROLL = 0x4C57, // 14545 + MSG_RANDOM_ROLL = 0x4C57, // MSG_SAVE_GUILD_EMBLEM = 0x00, // - MSG_SET_DUNGEON_DIFFICULTY = 0xC4F, // 14545 - MSG_SET_RAID_DIFFICULTY = 0x1A5A, // 14545 - MSG_TABARDVENDOR_ACTIVATE = 0x98EB, // 14545 + MSG_SET_DUNGEON_DIFFICULTY = 0xC4F, // + MSG_SET_RAID_DIFFICULTY = 0x1A5A, // + MSG_TABARDVENDOR_ACTIVATE = 0x98EB, // MSG_TALENT_WIPE_CONFIRM = 0x00, // OBSOLETE_DROP_ITEM = 0x00, // SMSG_ACCOUNT_DATA_TIMES = 0x00, // SMSG_ACHIEVEMENT_DELETED = 0x00, // SMSG_ACHIEVEMENT_EARNED = 0x00, // SMSG_ACTION_BUTTONS = 0x00, // - SMSG_ACTIVATETAXIREPLY = 0x8E4F, // 14545 - SMSG_ADDON_INFO = 0x9863, // 14545 + SMSG_ACTIVATETAXIREPLY = 0x8E4F, // + SMSG_ADDON_INFO = 0x9863, // SMSG_ADD_RUNE_POWER = 0x00, // SMSG_AI_REACTION = 0x00, // SMSG_ALL_ACHIEVEMENT_DATA = 0x00, // @@ -536,7 +538,7 @@ enum Opcodes SMSG_AREA_TRIGGER_MESSAGE = 0x00, // SMSG_ARENA_ERROR = 0x00, // SMSG_ARENA_OPPONENT_UPDATE = 0x00, // - SMSG_ARENA_TEAM_CHANGE_FAILED_QUEUED = 0x4A4E, // 14545 + SMSG_ARENA_TEAM_CHANGE_FAILED_QUEUED = 0x4A4E, // SMSG_ARENA_TEAM_COMMAND_RESULT = 0x00, // SMSG_ARENA_TEAM_EVENT = 0x00, // SMSG_ARENA_TEAM_INVITE = 0x00, // @@ -561,8 +563,8 @@ enum Opcodes SMSG_AURA_UPDATE = 0x00, // SMSG_AURA_UPDATE_ALL = 0x00, // SMSG_AURACASTLOG = 0x00, // - SMSG_AUTH_CHALLENGE = 0x1181, // 14545 - SMSG_AUTH_RESPONSE = 0x8867, // 14545 + SMSG_AUTH_CHALLENGE = 0x1181, // + SMSG_AUTH_RESPONSE = 0x8867, // SMSG_AVAILABLE_VOICE_CHANNEL = 0x00, // SMSG_BARBER_SHOP_RESULT = 0x00, // SMSG_BATTLEFIELD_LIST = 0x00, // @@ -596,10 +598,10 @@ enum Opcodes SMSG_CAST_FAILED = 0x00, // SMSG_CHANNEL_LIST = 0x00, // SMSG_CHANNEL_MEMBER_COUNT = 0x00, // - SMSG_CHANNEL_NOTIFY = 0x9C7F, // 14545 - SMSG_CHAR_CREATE = 19547, // 14545 - SMSG_CHAR_DELETE = 0x48CE, // 14545 - SMSG_CHAR_ENUM = 0xA05C, // 14545 + SMSG_CHANNEL_NOTIFY = 0x9C7F, // + SMSG_CHAR_CREATE = 19547, // + SMSG_CHAR_DELETE = 0x48CE, // + SMSG_CHAR_ENUM = 0xA05C, // SMSG_CHARACTER_LOGIN_FAILED = 0x00, // SMSG_CHAR_RENAME = 0x00, // SMSG_CHAR_CUSTOMIZE = 0x00, // @@ -607,11 +609,11 @@ enum Opcodes SMSG_CHAT_PLAYER_AMBIGUOUS = 0x00, // SMSG_CHAT_PLAYER_NOT_FOUND = 0x00, // SMSG_CHAT_RESTRICTED = 0x00, // - SMSG_CHAT_WRONG_FACTION = 0xE66, // 14545 + SMSG_CHAT_WRONG_FACTION = 0xE66, // SMSG_CHECK_FOR_BOTS = 0x00, // SMSG_CLEAR_COOLDOWN = 0x00, // SMSG_CLEAR_TARGET = 0x00, // - SMSG_CLIENTCACHE_VERSION = 0x88F2, // 14545 + SMSG_CLIENTCACHE_VERSION = 0x88F2, // SMSG_CLIENT_CONTROL_UPDATE = 0x00, // SMSG_COMBAT_LOG_MULTIPLE = 0x00, // SMSG_COMMENTATOR_MAP_INFO = 0x00, // @@ -619,7 +621,7 @@ enum Opcodes SMSG_COMMENTATOR_STATE_CHANGED = 0x00, // SMSG_COMPLAIN_RESULT = 0x00, // SMSG_COMPRESSED_MOVES = 0x00, // - SMSG_COMPRESSED_UPDATE_OBJECT = 0x1CC3, // 14545 + SMSG_COMPRESSED_UPDATE_OBJECT = 0x1CC3, // SMSG_CONTACT_LIST = 0x00, // SMSG_CONVERT_RUNE = 0x00, // SMSG_COOLDOWN_CHEAT = 0x00, // @@ -627,17 +629,17 @@ enum Opcodes SMSG_CORPSE_NOT_IN_INSTANCE = 0x00, // SMSG_CORPSE_RECLAIM_DELAY = 0x00, // SMSG_CORPSE_MAP_POSITION_QUERY_RESPONSE = 0x00, // - SMSG_CREATURE_QUERY_RESPONSE = 0xD847, // 14545 + SMSG_CREATURE_QUERY_RESPONSE = 0xD847, // SMSG_CRITERIA_DELETED = 0x00, // SMSG_CRITERIA_UPDATE = 0x00, // SMSG_CROSSED_INEBRIATION_THRESHOLD = 0x00, // SMSG_DAMAGE_CALC_LOG = 0x00, // SMSG_DAMAGE_DONE_OBSOLETE = 0x00, // SMSG_DANCE_QUERY_RESPONSE = 0x00, // - SMSG_DB_REPLY = 0x76EC, // 14545 + SMSG_DB_REPLY = 0x76EC, // SMSG_DEATH_RELEASE_LOC = 0x00, // SMSG_DEFENSE_MESSAGE = 0x00, // - SMSG_DESTROY_OBJECT = 0x00, // + SMSG_DESTROY_OBJECT = 0x486B, // SMSG_DESTRUCTIBLE_BUILDING_DAMAGE = 0x00, // SMSG_DUEL_OUTOFBOUNDS = 0x00, // SMSG_DUEL_INBOUNDS = 0x00, // @@ -650,18 +652,18 @@ enum Opcodes SMSG_DUEL_WINNER = 0x00, // SMSG_DURABILITY_DAMAGE_DEATH = 0x00, // SMSG_ECHO_PARTY_SQUELCH = 0x00, // - SMSG_EMOTE = 0xC67, // 14545 + SMSG_EMOTE = 0xC67, // SMSG_ENABLE_BARBER_SHOP = 0x00, // SMSG_ENCHANTMENTLOG = 0x00, // SMSG_ENVIRONMENTALDAMAGELOG = 0x00, // - SMSG_EQUIPMENT_SET_LIST = 0x18DF, // 14545 + SMSG_EQUIPMENT_SET_LIST = 0x18DF, // SMSG_EQUIPMENT_SET_SAVED = 0x00, // SMSG_EQUIPMENT_SET_USE_RESULT = 0x00, // SMSG_EXPECTED_SPAM_RECORDS = 0x00, // SMSG_EXPLORATION_EXPERIENCE = 0x00, // SMSG_FEATURE_SYSTEM_STATUS = 0x00, // - SMSG_FISH_ESCAPED = 0x9C66, // 14545 - SMSG_FISH_NOT_HOOKED = 0x18C3, // 14545 + SMSG_FISH_ESCAPED = 0x9C66, // + SMSG_FISH_NOT_HOOKED = 0x18C3, // SMSG_FORCEACTIONSHOW = 0x00, // SMSG_FORCED_DEATH_UPDATE = 0x00, // SMSG_FORCE_DISPLAY_UPDATE = 0x00, // @@ -681,7 +683,7 @@ enum Opcodes SMSG_GAMEOBJECT_CUSTOM_ANIM = 0x00, // SMSG_GAMEOBJECT_DESPAWN_ANIM = 0x00, // SMSG_GAMEOBJECT_PAGETEXT = 0x00, // - SMSG_GAMEOBJECT_QUERY_RESPONSE = 0xCCF7, // 14545 + SMSG_GAMEOBJECT_QUERY_RESPONSE = 0xCCF7, // SMSG_GAMEOBJECT_RESET_STATE = 0x00, // SMSG_GAMESPEED_SET = 0x00, // SMSG_GAMETIME_SET = 0x00, // @@ -692,11 +694,11 @@ enum Opcodes SMSG_GMTICKET_GETTICKET = 0x00, // SMSG_GM_MESSAGECHAT = 0x00, // SMSG_GMTICKET_CREATE = 0x00, // - SMSG_GMTICKET_SYSTEMSTATUS = 0x9C7E, // 14545 + SMSG_GMTICKET_SYSTEMSTATUS = 0x9C7E, // SMSG_GMTICKET_UPDATETEXT = 0x00, // - SMSG_GODMODE = 0xDEEE, // 14545 + SMSG_GODMODE = 0xDEEE, // SMSG_GOSSIP_COMPLETE = 0x00, // - SMSG_GOSSIP_MESSAGE = 0xCCEB, // 14545 + SMSG_GOSSIP_MESSAGE = 0xCCEB, // SMSG_GOSSIP_POI = 0x00, // SMSG_GROUP_CANCEL = 0x00, // SMSG_GROUP_DECLINE = 0x00, // @@ -706,16 +708,16 @@ enum Opcodes SMSG_GROUP_LIST = 0x00, // SMSG_GROUP_SET_LEADER = 0x00, // SMSG_GROUP_UNINVITE = 0x00, // - SMSG_GUILD_BANK_LIST = 0x5EFB, // 14545 - SMSG_GUILD_COMMAND_RESULT = 0x00, // + SMSG_GUILD_BANK_LIST = 0x5EFB, // + SMSG_GUILD_COMMAND_RESULT = 0xDAD7, // SMSG_GUILD_DECLINE = 0x00, // - SMSG_GUILD_EVENT = 0x8AC2, // 14545 + SMSG_GUILD_EVENT = 0x8AC2, // SMSG_GUILD_INFO = 0x00, // SMSG_GUILD_INVITE = 0x00, // SMSG_GUILD_MAX_DAILY_XP = 0x00, // SMSG_GUILD_NEWS_UPDATE = 0x00, // - SMSG_GUILD_QUERY_RESPONSE = 0xCA66, // 14545 - SMSG_GUILD_RANK = 0xA6EC, // 14545 + SMSG_GUILD_QUERY_RESPONSE = 0xCA66, // + SMSG_GUILD_RANK = 0xA6EC, // SMSG_GUILD_RANKS_UPDATE = 0x00, // SMSG_GUILD_REWARDS_LIST = 0x00, // SMSG_GUILD_ROSTER = 0x00, // @@ -725,8 +727,8 @@ enum Opcodes SMSG_HIGHEST_THREAT_UPDATE = 0x00, // SMSG_INITIALIZE_FACTIONS = 0x00, // SMSG_INITIAL_SPELLS = 0x00, // - SMSG_INIT_CURRENCY = 0x227E, // 14545 - SMSG_INIT_WORLD_STATES = 0x9EDA, // 14545 + SMSG_INIT_CURRENCY = 0x227E, // + SMSG_INIT_WORLD_STATES = 0x9EDA, // SMSG_INSPECT = 0x00, // SMSG_INSPECT_HONOR_STATS = 0x00, // SMSG_INSPECT_TALENT = 0x00, // @@ -742,7 +744,7 @@ enum Opcodes SMSG_ITEM_COOLDOWN = 0x00, // SMSG_ITEM_ENCHANT_TIME_UPDATE = 0x00, // SMSG_ITEM_NAME_QUERY_RESPONSE = 0x00, // - SMSG_ITEM_PUSH_RESULT = 0x00, // + SMSG_ITEM_PUSH_RESULT = 0x8EFB, // SMSG_ITEM_QUERY_MULTIPLE_RESPONSE = 0x00, // SMSG_ITEM_QUERY_SINGLE_RESPONSE = 0x00, // SMSG_ITEM_REFUND_INFO_RESPONSE = 0x00, // @@ -768,12 +770,12 @@ enum Opcodes SMSG_LFG_UPDATE_SEARCH = 0x00, // SMSG_LFG_UPDATE_PARTY = 0x00, // SMSG_LFG_UPDATE_PLAYER = 0x00, // - SMSG_LIST_INVENTORY = 0x264C, // 14545 + SMSG_LIST_INVENTORY = 0x264C, // SMSG_LOGIN_SETTIMESPEED = 0x00, // - SMSG_LOGIN_VERIFY_WORLD = 0xC86E, // 14545 + SMSG_LOGIN_VERIFY_WORLD = 0xC86E, // SMSG_LOGOUT_CANCEL_ACK = 0x00, // - SMSG_LOGOUT_COMPLETE = 0xCC6B, // 14545 - SMSG_LOGOUT_RESPONSE = 0x886A, // 14545 + SMSG_LOGOUT_COMPLETE = 0xCC6B, // + SMSG_LOGOUT_RESPONSE = 0x886A, // SMSG_LOG_XPGAIN = 0x00, // SMSG_LOOT_ALL_PASSED = 0x00, // SMSG_LOOT_CLEAR_MONEY = 0x00, // @@ -783,7 +785,7 @@ enum Opcodes SMSG_LOOT_MONEY_NOTIFY = 0x00, // SMSG_LOOT_RELEASE_RESPONSE = 0x00, // SMSG_LOOT_REMOVED = 0x00, // - SMSG_LOOT_RESPONSE = 0x00, // + SMSG_LOOT_RESPONSE = 0x0842, // SMSG_LOOT_ROLL = 0x00, // SMSG_LOOT_ROLL_WON = 0x00, // SMSG_LOOT_SLOT_CHANGED = 0x00, // @@ -793,12 +795,12 @@ enum Opcodes SMSG_MEETINGSTONE_IN_PROGRESS = 0x00, // SMSG_MEETINGSTONE_MEMBER_ADDED = 0x00, // SMSG_MEETINGSTONE_SETQUEUE = 0x00, // - SMSG_MESSAGECHAT = 0x5E52, // 14545 + SMSG_MESSAGECHAT = 0x5E52, // SMSG_MIRRORIMAGE_DATA = 0x00, // SMSG_MODIFY_COOLDOWN = 0x00, // - SMSG_MONSTER_MOVE = 0x4C53, // 14545 - SMSG_MONSTER_MOVE_TRANSPORT = 0x88FB, // 14545 - SMSG_MOTD = 0xCA4B, // 14545 + SMSG_MONSTER_MOVE = 0x4C53, // + SMSG_MONSTER_MOVE_TRANSPORT = 0x88FB, // + SMSG_MOTD = 0xCA4B, // SMSG_MOUNTSPECIAL_ANIM = 0x00, // SMSG_MOUNTRESULT = 0x00, // SMSG_MOVE_FEATHER_FALL = 0x00, // @@ -814,18 +816,18 @@ enum Opcodes SMSG_MOVE_SET_WALK_IN_AIR = 0x00, // SMSG_MOVE_UNSET_WALK_IN_AIR = 0x00, // SMSG_MULTIPLE_PACKETS = 0x00, // - SMSG_NAME_QUERY_RESPONSE = 0x9CE6, // 14545 + SMSG_NAME_QUERY_RESPONSE = 0x9CE6, // SMSG_NEW_TAXI_PATH = 0xC8FF, // Might be 0x98CF SMSG_NEW_WORLD = 0x00, // SMSG_NOTIFICATION = 0x00, // SMSG_NOTIFY_DANCE = 0x00, // SMSG_NOTIFY_DEST_LOC_SPELL_CAST = 0x00, // - SMSG_NPC_TEXT_UPDATE = 0x4C72, // 14545 + SMSG_NPC_TEXT_UPDATE = 0x4C72, // SMSG_NPC_WONT_TALK = 0x00, // SMSG_OFFER_PETITION_ERROR = 0x00, // SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA = 0x00, // SMSG_OPEN_CONTAINER = 0x00, // - SMSG_PAGE_TEXT_QUERY_RESPONSE = 0x18D2, // 14545 + SMSG_PAGE_TEXT_QUERY_RESPONSE = 0x18D2, // SMSG_PARTYKILLLOG = 0x00, // SMSG_PARTY_MEMBER_STATS = 0x00, // SMSG_PARTY_MEMBER_STATS_FULL = 0x00, // @@ -833,26 +835,26 @@ enum Opcodes SMSG_PAUSE_MIRROR_TIMER = 0x00, // SMSG_PERIODICAURALOG = 0x00, // SMSG_PETGODMODE = 0x00, // - SMSG_PETITION_QUERY_RESPONSE = 0x00, // + SMSG_PETITION_QUERY_RESPONSE = 0xCAEE, // SMSG_PET_ACTION_FEEDBACK = 0x00, // SMSG_PET_ACTION_SOUND = 0x00, // SMSG_PET_CAST_FAILED = 0x00, // SMSG_PET_DISMISS_SOUND = 0x00, // SMSG_PET_GUIDS = 0x00, // - SMSG_PET_LEARNED_SPELL = 0xDC5E, // 14545 + SMSG_PET_LEARNED_SPELL = 0xDC5E, // SMSG_PET_MODE = 0x00, // - SMSG_PET_NAME_QUERY_RESPONSE = 0x00, // + SMSG_PET_NAME_QUERY_RESPONSE = 0xDCD3, // SMSG_PET_NAME_INVALID = 0x00, // - SMSG_PET_REMOVED_SPELL = 0x18F6, // 14545 + SMSG_PET_REMOVED_SPELL = 0x18F6, // SMSG_PET_SPELLS = 0x00, // SMSG_PET_TAME_FAILURE = 0x00, // SMSG_PET_UPDATE_COMBO_POINTS = 0x00, // - SMSG_PETITION_SHOWLIST = 0x00, // - SMSG_PETITION_SHOW_SIGNATURES = 0x00, // - SMSG_PETITION_SIGN_RESULTS = 0x00, // + SMSG_PETITION_SHOWLIST = 0x8ED7, // + SMSG_PETITION_SHOW_SIGNATURES = 0x4E4A, // + SMSG_PETITION_SIGN_RESULTS = 0x5EE6, // SMSG_PLAYER_MOVE = 0x00, // SMSG_PLAYED_TIME = 0x00, // - SMSG_PLAYERBINDERROR = 0x5A4F, // 14545 + SMSG_PLAYERBINDERROR = 0x5A4F, // SMSG_PLAYERBOUND = 0x00, // SMSG_PLAYER_DIFFICULTY_CHANGE = 0x00, // SMSG_BATTLEGROUND_PLAYER_LEFT = 0x00, // @@ -865,7 +867,7 @@ enum Opcodes SMSG_PLAY_SPELL_VISUAL = 0x00, // SMSG_PLAY_SPELL_IMPACT = 0x00, // SMSG_PLAY_TIME_WARNING = 0x00, // - SMSG_PONG = 0x0380, // 14545 + SMSG_PONG = 0x0380, // SMSG_POWER_UPDATE = 0x00, // SMSG_PRE_RESURRECT = 0x00, // SMSG_PROCRESIST = 0x00, // @@ -876,22 +878,22 @@ enum Opcodes SMSG_QUERY_TIME_RESPONSE = 0x00, // SMSG_QUESTGIVER_OFFER_REWARD = 0x00, // SMSG_QUESTGIVER_QUEST_COMPLETE = 0x00, // - SMSG_QUESTGIVER_QUEST_DETAILS = 0xCE5F, // 14545 - SMSG_QUESTGIVER_QUEST_FAILED = 0xD8FF, // 14545 - SMSG_QUESTGIVER_QUEST_LIST = 0xDEF6, // 14545 - SMSG_QUESTGIVER_REQUEST_ITEMS = 0x9CEE, // 14545 - SMSG_QUESTGIVER_STATUS = 0xC846, // 14545 - SMSG_QUESTGIVER_STATUS_MULTIPLE = 0xDCFF, // 14545 - SMSG_QUESTLOG_FULL = 0x4EDE, // 14545 + SMSG_QUESTGIVER_QUEST_DETAILS = 0xCE5F, // + SMSG_QUESTGIVER_QUEST_FAILED = 0xD8FF, // + SMSG_QUESTGIVER_QUEST_LIST = 0xDEF6, // + SMSG_QUESTGIVER_REQUEST_ITEMS = 0x9CEE, // + SMSG_QUESTGIVER_STATUS = 0xC846, // + SMSG_QUESTGIVER_STATUS_MULTIPLE = 0xDCFF, // + SMSG_QUESTLOG_FULL = 0x4EDE, // SMSG_QUESTUPDATE_ADD_KILL = 0x00, // SMSG_QUESTUPDATE_ADD_PVP_KILL = 0x00, // - SMSG_QUESTUPDATE_COMPLETE = 0x9CD6, // 14545 - SMSG_QUESTUPDATE_FAILED = 0x9EF6, // 14545 + SMSG_QUESTUPDATE_COMPLETE = 0x9CD6, // + SMSG_QUESTUPDATE_FAILED = 0x9EF6, // SMSG_QUESTUPDATE_FAILEDTIMER = 0x00, // SMSG_QUEST_CONFIRM_ACCEPT = 0x00, // SMSG_QUEST_FORCE_REMOVED = 0x00, // SMSG_QUEST_POI_QUERY_RESPONSE = 0x00, // - SMSG_QUEST_QUERY_RESPONSE = 0x9E56, // 14545 + SMSG_QUEST_QUERY_RESPONSE = 0x9E56, // SMSG_QUESTGIVER_QUEST_INVALID = 0x00, // SMSG_QUESTUPDATE_ADD_ITEM_OBSOLETE = 0x00, // SMSG_RAID_GROUP_ONLY = 0x00, // @@ -899,10 +901,10 @@ enum Opcodes SMSG_RAID_INSTANCE_MESSAGE = 0x00, // SMSG_READ_ITEM_FAILED = 0x00, // SMSG_READ_ITEM_OK = 0x00, // - SMSG_REALM_SPLIT = 0x1AF2, // 14545 + SMSG_REALM_SPLIT = 0x1AF2, // SMSG_REAL_GROUP_UPDATE = 0x00, // SMSG_RECEIVED_MAIL = 0x00, // - SMSG_REDIRECT_CLIENT = 0x0180, // 14545 + SMSG_REDIRECT_CLIENT = 0x0180, // SMSG_REFER_A_FRIEND_FAILURE = 0x00, // SMSG_REMOVED_SPELL = 0x00, // SMSG_REPORT_PVP_AFK_RESULT = 0x00, // @@ -925,11 +927,11 @@ enum Opcodes SMSG_SET_FLAT_SPELL_MODIFIER = 0x00, // SMSG_SET_FORCED_REACTIONS = 0x00, // SMSG_SET_PCT_SPELL_MODIFIER = 0x00, // - SMSG_SET_PHASE_SHIFT = 0x204C, // 14545 + SMSG_SET_PHASE_SHIFT = 0x204C, // SMSG_SET_PLAYER_DECLINED_NAMES_RESULT = 0x00, // SMSG_SET_PROFICIENCY = 0x00, // SMSG_SET_PROJECTILE_POSITION = 0x00, // - SMSG_SHOWTAXINODES = 0x8CFB, // 14545 + SMSG_SHOWTAXINODES = 0x8CFB, // SMSG_SHOW_BANK = 0x00, // SMSG_SPELLBREAKLOG = 0x00, // SMSG_SPELLDAMAGESHIELD = 0x00, // @@ -945,8 +947,8 @@ enum Opcodes SMSG_SPELLDISPELLOG = 0x00, // SMSG_SPELL_FAILED_OTHER = 0x00, // SMSG_SPELL_FAILURE = 0x00, // - SMSG_SPELL_GO = 0x0A53, // 14545 - SMSG_SPELL_START = 0xCE43, // 14545 + SMSG_SPELL_GO = 0x0A53, // + SMSG_SPELL_START = 0xCE43, // SMSG_SPELLSTEALLOG = 0x00, // SMSG_SPELL_UPDATE_CHAIN_TARGETS = 0x00, // SMSG_SPIRIT_HEALER_CONFIRM = 0x00, // @@ -962,28 +964,28 @@ enum Opcodes SMSG_SUMMON_REQUEST = 0x00, // SMSG_SUPERCEDED_SPELL = 0x00, // SMSG_TALENTS_INFO = 0x00, // - SMSG_TAXINODE_STATUS = 0x8CFB, // 14545 - SMSG_TOGGLE_XP_GAIN = 0x8A5B, // 14545 + SMSG_TAXINODE_STATUS = 0x8CFB, // + SMSG_TOGGLE_XP_GAIN = 0x8A5B, // SMSG_TEXT_EMOTE = 0x00, // SMSG_THREAT_CLEAR = 0x00, // SMSG_THREAT_REMOVE = 0x00, // SMSG_THREAT_UPDATE = 0x00, // - SMSG_TIME_SYNC_REQ = 0x00, // + SMSG_TIME_SYNC_REQ = 0x1009, // SMSG_TITLE_EARNED = 0x00, // SMSG_TOTEM_CREATED = 0x00, // SMSG_TRADE_STATUS = 0x00, // SMSG_TRADE_STATUS_EXTENDED = 0x00, // - SMSG_TRAINER_LIST = 0xC84E, // 14545 + SMSG_TRAINER_LIST = 0xC84E, // SMSG_TRAINER_BUY_RESULT = 0x00, // SMSG_TRANSFER_ABORTED = 0x00, // SMSG_TRANSFER_PENDING = 0x00, // SMSG_TRIGGER_CINEMATIC = 0x00, // SMSG_TRIGGER_MOVIE = 0x00, // - SMSG_TURN_IN_PETITION_RESULTS = 0x00, // - SMSG_TUTORIAL_FLAGS = 0x1A46, // 14545 + SMSG_TURN_IN_PETITION_RESULTS = 0x08DB, // + SMSG_TUTORIAL_FLAGS = 0x1A46, // SMSG_UNIT_SPELLCAST_START = 0x00, // SMSG_UPDATE_ACCOUNT_DATA = 0x00, // - SMSG_UPDATE_ACCOUNT_DATA_COMPLETE = 0x5E53, // 14545 + SMSG_UPDATE_ACCOUNT_DATA_COMPLETE = 0x5E53, // SMSG_UPDATE_COMBO_POINTS = 0x00, // SMSG_UPDATE_CURRENCY = 0x00, // SMSG_UPDATE_CURRENCY_WEEK_LIMIT = 0x00, // @@ -991,7 +993,7 @@ enum Opcodes SMSG_UPDATE_INSTANCE_OWNERSHIP = 0x00, // SMSG_UPDATE_LAST_INSTANCE = 0x00, // SMSG_UPDATE_LFG_LIST = 0x00, // - SMSG_UPDATE_OBJECT = 0x1EE7, // 14545 + SMSG_UPDATE_OBJECT = 0x1EE7, // SMSG_UPDATE_WORLD_STATE = 0x00, // SMSG_USERLIST_ADD = 0x00, // SMSG_USERLIST_REMOVE = 0x00, // @@ -1002,20 +1004,20 @@ enum Opcodes SMSG_VOICE_SESSION_ROSTER_UPDATE = 0x00, // SMSG_VOICE_SET_TALKER_MUTED = 0x00, // SMSG_WEATHER = 0x00, // - SMSG_WARDEN_DATA = 0x00, // - SMSG_WHO = 0x00, // + SMSG_WARDEN_DATA = 0x4ECE, // + SMSG_WHO = 0x4C7F, // SMSG_WHOIS = 0x00, // SMSG_WORLD_STATE_UI_TIMER_UPDATE = 0x00, // SMSG_ZONE_UNDER_ATTACK = 0x00, // - SMSG_VERIFY_CONNECTIVITY = 20311, // 14545 - CMSG_VERIFY_CONNECTIVITY_RESPONSE = 19538, //1280462679, // 14545 special opcode, client sends as uint32 + SMSG_VERIFY_CONNECTIVITY = 20311, // + CMSG_VERIFY_CONNECTIVITY_RESPONSE = 19538, //1280462679, // special opcode, client sends as uint32 SMSG_BATTLEFIELD_STATUS = 0x00, // SMSG_QUESTUPDATE_ADD_ITEM = 0x00, // SMSG_OVERRIDE_LIGHT = 0x00, // - CMSG_RANDOMIZE_CHAR_NAME = 35481, // 14545 byte unk, byte race - SMSG_RANDOMIZE_CHAR_NAME = 61660, // 14545 byte unk(0x80), string name + CMSG_RANDOMIZE_CHAR_NAME = 35481, // byte unk, byte race + SMSG_RANDOMIZE_CHAR_NAME = 61660, // byte unk(0x80), string name CMSG_MOVE_SET_COLLISION_HGT = 0, // SMSG_MOVE_SET_COLLISION_HGT = 0, // -- cgit v1.2.3 From d171f41e011b5de88a2e86e896fdaedeca4c12b6 Mon Sep 17 00:00:00 2001 From: kaelima Date: Thu, 24 Nov 2011 06:14:57 +0100 Subject: Core/Protocol: Handle CMSG_CAST_SPELL. --- src/server/game/Server/Protocol/Handlers/SpellHandler.cpp | 8 ++++++-- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- src/server/game/Server/Protocol/Opcodes.h | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp b/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp index 269576a5696..30c096d1e3f 100755 --- a/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp @@ -324,9 +324,13 @@ void WorldSession::HandleGameobjectReportUse(WorldPacket& recvPacket) void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket) { - uint32 spellId; + uint32 spellId, glyphIndex; uint8 castCount, castFlags; - recvPacket >> castCount >> spellId >> castFlags; + + recvPacket >> castCount; + recvPacket >> spellId; + recvPacket >> glyphIndex; + recvPacket >> castFlags; sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: got cast spell packet, castCount: %u, spellId: %u, castFlags: %u, data length = %u", castCount, spellId, castFlags, (uint32)recvPacket.size()); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 762c5edb59a..0904e978eb8 100755 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -343,7 +343,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_LEARNED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SUPERCEDED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_NEW_SPELL_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CAST_SPELL, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleCastSpellOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_CAST_SPELL, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleCastSpellOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_CAST, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleCancelCastOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_CAST_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELL_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 652900cd4af..3977ecb4538 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -102,7 +102,7 @@ enum Opcodes CMSG_CANCEL_MOUNT_AURA = 0x00, // CMSG_CANCEL_TEMP_ENCHANTMENT = 0x00, // CMSG_CANCEL_TRADE = 0x35A5, // - CMSG_CAST_SPELL = 0x00, // + CMSG_CAST_SPELL = 0x5E4E, // CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE = 0x00, // CMSG_CHANNEL_ANNOUNCEMENTS = 0x00, // CMSG_CHANNEL_BAN = 0x00, // -- cgit v1.2.3 From 05880cc748cfd5d4d44d15631aacacee1645a512 Mon Sep 17 00:00:00 2001 From: Rat Date: Thu, 24 Nov 2011 13:43:41 +0100 Subject: Core/DataStores: -dropped dbcstring/db2string, use simple nonconstant char* (will be useable when loading custom data from db to dbc) -fixed most dbc string related errors (you can now turn on logging) --- src/server/game/AuctionHouse/AuctionHouseMgr.cpp | 2 +- src/server/game/Chat/ChatLink.cpp | 47 +++--- src/server/game/Chat/ChatLink.h | 2 +- src/server/game/Chat/Commands/Level1.cpp | 4 +- src/server/game/Chat/Commands/Level2.cpp | 6 +- src/server/game/Chat/Commands/Level3.cpp | 12 +- src/server/game/DataStores/DB2Structure.h | 10 +- src/server/game/DataStores/DBCStores.cpp | 2 +- src/server/game/DataStores/DBCStructure.h | 158 ++++++++++----------- src/server/game/Entities/Pet/Pet.cpp | 4 +- src/server/game/Entities/Player/Player.cpp | 6 +- src/server/game/Maps/Map.cpp | 2 +- src/server/game/Maps/MapManager.cpp | 2 +- .../game/Server/Protocol/Handlers/MailHandler.cpp | 2 +- src/server/game/Spells/SpellInfo.h | 4 +- src/server/scripts/Commands/cs_gps.cpp | 6 +- src/server/scripts/Commands/cs_titles.cpp | 4 +- src/server/shared/Define.h | 5 +- 18 files changed, 130 insertions(+), 148 deletions(-) (limited to 'src') diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp index 761d1335608..4fb3f395387 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp @@ -618,7 +618,7 @@ void AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player if (itemRandProp) { - DBCString temp = itemRandProp->nameSuffix; + char* temp = itemRandProp->nameSuffix; //char* temp = itemRandProp->nameSuffix; // dbc local name diff --git a/src/server/game/Chat/ChatLink.cpp b/src/server/game/Chat/ChatLink.cpp index 8a91de1969c..dade99c7dc7 100644 --- a/src/server/game/Chat/ChatLink.cpp +++ b/src/server/game/Chat/ChatLink.cpp @@ -165,7 +165,7 @@ bool ItemChatLink::Initialize(std::istringstream& iss) return true; } -inline std::string ItemChatLink::FormatName(uint8 index, ItemLocale const *locale, DBCString suffixStrings) const +inline std::string ItemChatLink::FormatName(uint8 index, ItemLocale const *locale, char* suffixStrings) const { std::stringstream ss; if (locale == NULL || index >= locale->Name.size()) @@ -181,7 +181,7 @@ bool ItemChatLink::ValidateName(char* buffer, const char* context) { ChatLink::ValidateName(buffer, context); - DBCString suffixStrings = _suffix ? _suffix->nameSuffix : (_property ? _property->nameSuffix : NULL); + char* suffixStrings = _suffix ? _suffix->nameSuffix : (_property ? _property->nameSuffix : NULL); bool res = (FormatName(LOCALE_enUS, NULL, suffixStrings) == buffer); if (!res) @@ -304,30 +304,21 @@ bool SpellChatLink::ValidateName(char* buffer, const char* context) return false; } - for (uint8 i = 0; i < TOTAL_LOCALES; ++i) + uint32 skillLineNameLength = strlen(skillLine->name); + if (skillLineNameLength > 0 && strncmp(skillLine->name, buffer, skillLineNameLength) == 0) { - uint32 skillLineNameLength = strlen(skillLine->name[i]); - if (skillLineNameLength > 0 && strncmp(skillLine->name[i], buffer, skillLineNameLength) == 0) - { - // found the prefix, remove it to perform spellname validation below - // -2 = strlen(": ") - uint32 spellNameLength = strlen(buffer) - skillLineNameLength - 2; - memcpy(buffer, buffer + skillLineNameLength + 2, spellNameLength + 1); - } + // found the prefix, remove it to perform spellname validation below + // -2 = strlen(": ") + uint32 spellNameLength = strlen(buffer) - skillLineNameLength - 2; + memcpy(buffer, buffer + skillLineNameLength + 2, spellNameLength + 1); } } - bool res = false; - for (uint8 i = 0; i < TOTAL_LOCALES; ++i) - if (*_spell->SpellName[i] && strcmp(_spell->SpellName[i], buffer) == 0) - { - res = true; - break; - } + if (*_spell->SpellName && strcmp(_spell->SpellName, buffer) == 0) + return true; - if (!res) - sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): linked spell (id: %u) name wasn't found in any localization", context, _spell->Id); - return res; + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): linked spell (id: %u) name wasn't found in any localization", context, _spell->Id); + return false; } // |color|Hachievement:achievement_id:player_guid:0:0:0:0:0:0:0:0|h[name]|h|r @@ -379,17 +370,11 @@ bool AchievementChatLink::ValidateName(char* buffer, const char* context) { ChatLink::ValidateName(buffer, context); - bool res = false; - for (uint8 i = 0; i < TOTAL_LOCALES; ++i) - if (*_achievement->name[i] && strcmp(_achievement->name[i], buffer) == 0) - { - res = true; - break; - } + if (*_achievement->name && strcmp(_achievement->name, buffer) == 0) + return true; - if (!res) - sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): linked achievement (id: %u) name wasn't found in any localization", context, _achievement->ID); - return res; + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): linked achievement (id: %u) name wasn't found in any localization", context, _achievement->ID); + return false; } // |color|Htrade:spell_id:cur_value:max_value:player_guid:base64_data|h[name]|h|r diff --git a/src/server/game/Chat/ChatLink.h b/src/server/game/Chat/ChatLink.h index 1eb6c9b03f7..51cc023f0d4 100644 --- a/src/server/game/Chat/ChatLink.h +++ b/src/server/game/Chat/ChatLink.h @@ -61,7 +61,7 @@ public: virtual bool ValidateName(char* buffer, const char* context); protected: - std::string FormatName(uint8 index, ItemLocale const* locale, DBCString suffixStrings) const; + std::string FormatName(uint8 index, ItemLocale const* locale, char* suffixStrings) const; ItemTemplate const* _item; int32 _data[8]; diff --git a/src/server/game/Chat/Commands/Level1.cpp b/src/server/game/Chat/Commands/Level1.cpp index f06f8a7e89c..042630409e3 100755 --- a/src/server/game/Chat/Commands/Level1.cpp +++ b/src/server/game/Chat/Commands/Level1.cpp @@ -480,7 +480,7 @@ bool ChatHandler::HandleLookupAreaCommand(const char* args) if (areaEntry) { int loc = GetSessionDbcLocale (); - std::string name = areaEntry->area_name[loc]; + std::string name = areaEntry->area_name; if (name.empty()) continue; @@ -492,7 +492,7 @@ bool ChatHandler::HandleLookupAreaCommand(const char* args) if (loc == GetSessionDbcLocale ()) continue; - name = areaEntry->area_name[loc]; + name = areaEntry->area_name; if (name.empty ()) continue; diff --git a/src/server/game/Chat/Commands/Level2.cpp b/src/server/game/Chat/Commands/Level2.cpp index 295ab1fbf99..a5dc27c233a 100755 --- a/src/server/game/Chat/Commands/Level2.cpp +++ b/src/server/game/Chat/Commands/Level2.cpp @@ -566,7 +566,7 @@ bool ChatHandler::HandleCharacterReputationCommand(const char* args) { const FactionState& faction = itr->second; FactionEntry const* factionEntry = sFactionStore.LookupEntry(faction.ID); - char const* factionName = factionEntry ? factionEntry->name[loc] : "#Not found#"; + char const* factionName = factionEntry ? factionEntry->name : "#Not found#"; ReputationRank rank = target->GetReputationMgr().GetRank(factionEntry); std::string rankName = GetTrinityString(ReputationRankStrIndex[rank]); std::ostringstream ss; @@ -1007,7 +1007,7 @@ bool ChatHandler::HandleLookupTitleCommand(const char* args) if (titleInfo) { int loc = GetSessionDbcLocale(); - std::string name = titleInfo->name[loc]; + std::string name = titleInfo->name; if (name.empty()) continue; @@ -1079,7 +1079,7 @@ bool ChatHandler::HandleCharacterTitlesCommand(const char* args) CharTitlesEntry const* titleInfo = sCharTitlesStore.LookupEntry(id); if (titleInfo && target->HasTitle(titleInfo)) { - std::string name = titleInfo->name[loc]; + std::string name = titleInfo->name; if (name.empty()) continue; diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp index f4f5892b587..54f4ae4bdeb 100755 --- a/src/server/game/Chat/Commands/Level3.cpp +++ b/src/server/game/Chat/Commands/Level3.cpp @@ -846,7 +846,7 @@ bool ChatHandler::HandleLookupItemSetCommand(const char *args) if (set) { int loc = GetSessionDbcLocale(); - std::string name = set->name[loc]; + std::string name = set->name; if (name.empty()) continue; @@ -919,7 +919,7 @@ bool ChatHandler::HandleLookupSkillCommand(const char *args) if (skillInfo) { int loc = GetSessionDbcLocale(); - std::string name = skillInfo->name[loc]; + std::string name = skillInfo->name; if (name.empty()) continue; @@ -1006,7 +1006,7 @@ bool ChatHandler::HandleLookupSpellCommand(const char *args) if (spellInfo) { int loc = GetSessionDbcLocale(); - std::string name = spellInfo->SpellName[loc]; + std::string name = spellInfo->SpellName; if (name.empty()) continue; @@ -1393,7 +1393,7 @@ bool ChatHandler::HandleLookupFactionCommand(const char *args) FactionState const* repState = target ? target->GetReputationMgr().GetState(factionEntry) : NULL; int loc = GetSessionDbcLocale(); - std::string name = factionEntry->name[loc]; + std::string name = factionEntry->name; if (name.empty()) continue; @@ -1491,7 +1491,7 @@ bool ChatHandler::HandleLookupTaxiNodeCommand(const char * args) if (nodeEntry) { int loc = GetSessionDbcLocale(); - std::string name = nodeEntry->name[loc]; + std::string name = nodeEntry->name; if (name.empty()) continue; @@ -2415,7 +2415,7 @@ bool ChatHandler::HandleListAurasCommand (const char * /*args*/) AuraApplication const* aurApp = itr->second; Aura const* aura = aurApp->GetBase(); - char const* name = aura->GetSpellInfo()->SpellName[GetSessionDbcLocale()]; + char const* name = aura->GetSpellInfo()->SpellName; std::ostringstream ss_name; ss_name << "|cffffffff|Hspell:" << aura->GetId() << "|h[" << name << "]|h|r"; diff --git a/src/server/game/DataStores/DB2Structure.h b/src/server/game/DataStores/DB2Structure.h index 59dbfc710c3..1681bdfaae1 100644 --- a/src/server/game/DataStores/DB2Structure.h +++ b/src/server/game/DataStores/DB2Structure.h @@ -81,11 +81,11 @@ struct ItemSparseEntry int32 SpellCategory[MAX_ITEM_PROTO_SPELLS]; // 85 - 89 int32 SpellCategoryCooldown[MAX_ITEM_PROTO_SPELLS]; // 90 - 94 uint32 Bonding; // 95 - DB2String Name; // 96 - DB2String Name2; // 97 - DB2String Name3; // 98 - DB2String Name4; // 99 - DB2String Description; // 100 + char* Name; // 96 + char* Name2; // 97 + char* Name3; // 98 + char* Name4; // 99 + char* Description; // 100 uint32 PageText; // 101 uint32 LanguageID; // 102 uint32 PageMaterial; // 103 diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 4202b3fc2d4..82910d296af 100755 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -738,7 +738,7 @@ char const* GetPetName(uint32 petfamily, uint32 dbclang) CreatureFamilyEntry const* pet_family = sCreatureFamilyStore.LookupEntry(petfamily); if (!pet_family) return NULL; - return pet_family->Name[dbclang]?pet_family->Name[dbclang]:NULL; + return pet_family->Name ? pet_family->Name : NULL; } SpellEffectEntry const* GetSpellEffectEntry(uint32 spellId, uint32 effect) diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 208099a5cb2..6af4504f52a 100755 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -44,14 +44,14 @@ struct AchievementEntry int32 requiredFaction; // 1 -1=all, 0=horde, 1=alliance int32 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) - DBCString name; // 4 - //DBCString description; // 5 + char* name; // 4 + //char* description; // 5 uint32 categoryId; // 6 uint32 points; // 7 reward points //uint32 OrderInCategory; // 8 uint32 flags; // 9 //uint32 icon; // 10 icon (from SpellIcon.dbc) - //DBCString reward; // 11 + //char* reward; // 11 uint32 count; // 12 - need this count of completed criterias (own or referenced achievement criterias) uint32 refAchievement; // 13 - referenced achievement (counting of all completed criterias) }; @@ -60,7 +60,7 @@ struct AchievementCategoryEntry { uint32 ID; // 0 uint32 parentCategory; // 1 -1 for main category - //DBCString name; // 2 + //char* name; // 2 //uint32 sortOrder; // 3 }; @@ -532,7 +532,7 @@ struct AreaTableEntry uint32 flags; // 4, unknown value but 312 for all cities // 5-9 unused int32 area_level; // 10 - DBCString area_name; // 11 + char* area_name; // 11 uint32 team; // 12 // 13-19 unknown //uint32 unk20; // 20 4.0.0 @@ -569,8 +569,8 @@ struct AreaPOIEntry uint32 mapId; //14 //uint32 val1; //15 uint32 zoneId; //16 - //DBCString name; //17 - name - //DBCString name2; //18 - name2 + //char* name; //17 - name + //char* name2; //18 - name2 uint32 worldState; //19 //uint32 val2; //20 //uint32 unk; //21 @@ -605,7 +605,7 @@ struct AuctionHouseEntry uint32 faction; // 1 id of faction.dbc for player factions associated with city uint32 depositPercent; // 2 1/3 from real uint32 cutPercent; // 3 - //DBCString name; // 4 + //char* name; // 4 }; struct BankBagSlotPricesEntry @@ -618,7 +618,7 @@ struct BarberShopStyleEntry { uint32 Id; // 0 uint32 type; // 1 value 0 -> hair, value 2 -> facialhair - //DBCString name; // 2 m_DisplayName_lang + //char* name; // 2 m_DisplayName_lang //uint32 unk_name; // 3 m_Description_lang //float CostMultiplier; // 4 m_Cost_Modifier uint32 race; // 5 m_race @@ -632,7 +632,7 @@ struct BattlemasterListEntry int32 mapid[8]; // 1-8 mapid uint32 type; // 9 (3 - BG, 4 - arena) //uint32 canJoinAsGroup; // 10 (0 or 1) - DBCString name; // 11 + char* name; // 11 uint32 maxGroupSize; // 12 maxGroupSize, used for checking if queue as group uint32 HolidayWorldStateId; // 13 new 3.1 uint32 minLevel; // 14, min level (sync with PvPDifficulty.dbc content) @@ -663,7 +663,7 @@ struct CharTitlesEntry { uint32 ID; // 0, title ids, for example in Quest::GetCharTitleId() //uint32 unk1; // 1 flags? - DBCString name; // 2 m_name_lang + char* name; // 2 m_name_lang //char* name2; // 3 m_name1_lang uint32 bit_index; // 4 m_mask_ID used in PLAYER_CHOSEN_TITLE and 1<GetDisplayId()); if (CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(cinfo->family)) - SetName(cFamily->Name[sWorld->GetDefaultDbcLocale()]); + SetName(cFamily->Name); else SetName(creature->GetNameForLocaleIdx(sObjectMgr->GetDBCLocaleIndex())); @@ -729,7 +729,7 @@ bool Pet::CreateBaseAtCreatureInfo(CreatureTemplate const* cinfo, Unit* owner) return false; if (CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(cinfo->family)) - SetName(cFamily->Name[sWorld->GetDefaultDbcLocale()]); + SetName(cFamily->Name); Relocate(owner->GetPositionX(), owner->GetPositionY(), owner->GetPositionZ(), owner->GetOrientation()); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index d67324271ad..4550f9c6e58 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -5619,7 +5619,7 @@ void Player::UpdateLocalChannels(uint32 newZone) if (!cMgr) return; - std::string current_zone_name = current_zone->area_name[GetSession()->GetSessionDbcLocale()]; + std::string current_zone_name = current_zone->area_name; for (uint32 i = 0; i < sChatChannelsStore.GetNumRows(); ++i) { @@ -5655,7 +5655,7 @@ void Player::UpdateLocalChannels(uint32 newZone) else currentNameExt = current_zone_name.c_str(); - snprintf(new_channel_name_buf, 100, channel->pattern[m_session->GetSessionDbcLocale()], currentNameExt); + snprintf(new_channel_name_buf, 100, channel->pattern, currentNameExt); joinChannel = cMgr->GetJoinChannel(new_channel_name_buf, channel->ChannelID); if (usedChannel) @@ -5670,7 +5670,7 @@ void Player::UpdateLocalChannels(uint32 newZone) } } else - joinChannel = cMgr->GetJoinChannel(channel->pattern[m_session->GetSessionDbcLocale()], channel->ChannelID); + joinChannel = cMgr->GetJoinChannel(channel->pattern, channel->ChannelID); } else removeChannel = usedChannel; diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index bd419482b5b..8e81f25ca9e 100755 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -1824,7 +1824,7 @@ bool Map::CheckGridIntegrity(Creature* c, bool moved) const const char* Map::GetMapName() const { - return i_mapEntry ? i_mapEntry->name[sWorld->GetDefaultDbcLocale()] : "UNNAMEDMAP\x0"; + return i_mapEntry ? i_mapEntry->name : "UNNAMEDMAP\x0"; } void Map::UpdateObjectVisibility(WorldObject* obj, Cell cell, CellCoord cellpair) diff --git a/src/server/game/Maps/MapManager.cpp b/src/server/game/Maps/MapManager.cpp index f31f1348b44..6131783c42c 100755 --- a/src/server/game/Maps/MapManager.cpp +++ b/src/server/game/Maps/MapManager.cpp @@ -181,7 +181,7 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck) if (player->isGameMaster()) return true; - char const* mapName = entry->name[player->GetSession()->GetSessionDbcLocale()]; + char const* mapName = entry->name; Group* group = player->GetGroup(); if (entry->IsRaid()) diff --git a/src/server/game/Server/Protocol/Handlers/MailHandler.cpp b/src/server/game/Server/Protocol/Handlers/MailHandler.cpp index 785fcdbf067..26a9bd6c3aa 100755 --- a/src/server/game/Server/Protocol/Handlers/MailHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/MailHandler.cpp @@ -684,7 +684,7 @@ void WorldSession::HandleMailCreateTextItem(WorldPacket & recv_data) return; } - bodyItem->SetText(mailTemplateEntry->content[GetSessionDbcLocale()]); + bodyItem->SetText(mailTemplateEntry->content); } else bodyItem->SetText(m->body); diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h index c6947372b0f..2414730fc75 100644 --- a/src/server/game/Spells/SpellInfo.h +++ b/src/server/game/Spells/SpellInfo.h @@ -374,8 +374,8 @@ public: uint32 SpellVisual[2]; uint32 SpellIconID; uint32 ActiveIconID; - DBCString SpellName; - DBCString Rank; + char* SpellName; + char* Rank; uint32 MaxTargetLevel; uint32 MaxAffectedTargets; uint32 SpellFamilyName; diff --git a/src/server/scripts/Commands/cs_gps.cpp b/src/server/scripts/Commands/cs_gps.cpp index bafaae465ef..6e67eebc5bc 100644 --- a/src/server/scripts/Commands/cs_gps.cpp +++ b/src/server/scripts/Commands/cs_gps.cpp @@ -110,9 +110,9 @@ public: handler->PSendSysMessage("no VMAP available for area info"); handler->PSendSysMessage(LANG_MAP_POSITION, - object->GetMapId(), (mapEntry ? mapEntry->name[handler->GetSessionDbcLocale()] : ""), - zoneId, (zoneEntry ? zoneEntry->area_name[handler->GetSessionDbcLocale()] : ""), - areaId, (areaEntry ? areaEntry->area_name[handler->GetSessionDbcLocale()] : ""), + object->GetMapId(), (mapEntry ? mapEntry->name : ""), + zoneId, (zoneEntry ? zoneEntry->area_name : ""), + areaId, (areaEntry ? areaEntry->area_name : ""), object->GetPhaseMask(), object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), object->GetOrientation(), cell.GridX(), cell.GridY(), cell.CellX(), cell.CellY(), object->GetInstanceId(), diff --git a/src/server/scripts/Commands/cs_titles.cpp b/src/server/scripts/Commands/cs_titles.cpp index 2fb22e0090d..2ffeea78575 100644 --- a/src/server/scripts/Commands/cs_titles.cpp +++ b/src/server/scripts/Commands/cs_titles.cpp @@ -138,7 +138,7 @@ public: char const* targetName = target->GetName(); char titleNameStr[80]; - snprintf(titleNameStr, 80, titleInfo->name[handler->GetSessionDbcLocale()], targetName); + snprintf(titleNameStr, 80, titleInfo->name, targetName); target->SetTitle(titleInfo); handler->PSendSysMessage(LANG_TITLE_ADD_RES, id, titleNameStr, tNameLink.c_str()); @@ -187,7 +187,7 @@ public: char const* targetName = target->GetName(); char titleNameStr[80]; - snprintf(titleNameStr, 80, titleInfo->name[handler->GetSessionDbcLocale()], targetName); + snprintf(titleNameStr, 80, titleInfo->name, targetName); handler->PSendSysMessage(LANG_TITLE_REMOVE_RES, id, titleNameStr, tNameLink.c_str()); diff --git a/src/server/shared/Define.h b/src/server/shared/Define.h index c590c3bf918..e86069948ba 100755 --- a/src/server/shared/Define.h +++ b/src/server/shared/Define.h @@ -79,10 +79,7 @@ typedef ACE_UINT32 uint32; typedef ACE_UINT16 uint16; typedef ACE_UINT8 uint8; -typedef char const* const* DBCString; //char* DBCStrings[MAX_LOCALE]; -typedef char const* const* DB2String; //char* DB2Strings[MAX_LOCALE]; - -enum +enum DBCFormer { FT_NA='x', //not used or unknown, 4 byte size FT_NA_BYTE='X', //not used or unknown, byte -- cgit v1.2.3 From ec8738557ea3cf3986266f7f069b214bb25186b6 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 24 Nov 2011 15:02:23 +0100 Subject: Core/Items: Updated scaling item stat calculations --- src/server/game/DataStores/DBCStores.cpp | 160 ++++++++++++++++++++- src/server/game/DataStores/DBCStructure.h | 98 ++----------- src/server/game/DataStores/DBCfmt.h | 2 +- src/server/game/Entities/Item/ItemPrototype.h | 4 +- src/server/game/Entities/Player/Player.cpp | 59 ++++---- .../game/Server/Protocol/Handlers/ItemHandler.cpp | 2 +- 6 files changed, 200 insertions(+), 125 deletions(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 82910d296af..ceba8d178cf 100755 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -397,7 +397,7 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sItemRandomSuffixStore, dbcPath, "ItemRandomSuffix.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sItemSetStore, dbcPath, "ItemSet.dbc");//14545 - + LoadDBC(availableDbcLocales, bad_dbc_files, sItemArmorQualityStore, dbcPath, "ItemArmorQuality.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sItemArmorShieldStore, dbcPath, "ItemArmorShield.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sItemArmorTotalStore, dbcPath, "ItemArmorTotal.dbc");//14545 @@ -487,7 +487,7 @@ void LoadDBCStores(const std::string& dataPath) } } - + LoadDBC(availableDbcLocales, bad_dbc_files, sSpellReagentsStore, dbcPath,"SpellReagents.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellScalingStore, dbcPath,"SpellScaling.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellTotemsStore, dbcPath,"SpellTotems.dbc");//14545 @@ -501,10 +501,10 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sSpellAuraOptionsStore, dbcPath,"SpellAuraOptions.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellAuraRestrictionsStore, dbcPath,"SpellAuraRestrictions.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellCastingRequirementsStore, dbcPath,"SpellCastingRequirements.dbc");//14545 - + LoadDBC(availableDbcLocales, bad_dbc_files, sSpellCategoriesStore, dbcPath,"SpellCategories.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellEffectStore, dbcPath,"SpellEffect.dbc");//14545 - + for(uint32 i = 1; i < sSpellEffectStore.GetNumRows(); ++i) { if(SpellEffectEntry const *spellEffect = sSpellEffectStore.LookupEntry(i)) @@ -975,6 +975,158 @@ uint32 const* GetTalentTabPages(uint8 cls) return sTalentTabPages[cls]; } +uint32 ScalingStatValuesEntry::GetStatMultiplier(uint32 inventoryType) const +{ + if (inventoryType < MAX_INVTYPE) + { + switch (inventoryType) + { + case INVTYPE_NON_EQUIP: + case INVTYPE_BODY: + case INVTYPE_BAG: + case INVTYPE_TABARD: + case INVTYPE_AMMO: + case INVTYPE_QUIVER: + return 0; + case INVTYPE_HEAD: + case INVTYPE_CHEST: + case INVTYPE_LEGS: + case INVTYPE_2HWEAPON: + case INVTYPE_ROBE: + return StatMultiplier[0]; + case INVTYPE_SHOULDERS: + case INVTYPE_WAIST: + case INVTYPE_FEET: + case INVTYPE_HANDS: + case INVTYPE_TRINKET: + return StatMultiplier[1]; + case INVTYPE_NECK: + case INVTYPE_WRISTS: + case INVTYPE_FINGER: + case INVTYPE_SHIELD: + case INVTYPE_CLOAK: + case INVTYPE_HOLDABLE: + return StatMultiplier[2]; + case INVTYPE_RANGED: + case INVTYPE_THROWN: + case INVTYPE_RANGEDRIGHT: + case INVTYPE_RELIC: + return StatMultiplier[3]; + case INVTYPE_WEAPON: + case INVTYPE_WEAPONMAINHAND: + case INVTYPE_WEAPONOFFHAND: + return StatMultiplier[4]; + default: + break; + } + } + return 0; +} + +uint32 ScalingStatValuesEntry::GetArmor(uint32 inventoryType, uint32 armorType) const +{ + if (inventoryType <= INVTYPE_ROBE && armorType < 4) + { + switch (inventoryType) + { + case INVTYPE_NON_EQUIP: + case INVTYPE_NECK: + case INVTYPE_BODY: + case INVTYPE_FINGER: + case INVTYPE_TRINKET: + case INVTYPE_WEAPON: + case INVTYPE_SHIELD: + case INVTYPE_RANGED: + case INVTYPE_2HWEAPON: + case INVTYPE_BAG: + case INVTYPE_TABARD: + break; + case INVTYPE_SHOULDERS: + return Armor[0][armorType]; + case INVTYPE_CHEST: + case INVTYPE_ROBE: + return Armor[1][armorType]; + case INVTYPE_HEAD: + return Armor[2][armorType]; + case INVTYPE_LEGS: + return Armor[3][armorType]; + case INVTYPE_FEET: + return Armor[4][armorType]; + case INVTYPE_WAIST: + return Armor[5][armorType]; + case INVTYPE_HANDS: + return Armor[6][armorType]; + case INVTYPE_WRISTS: + return Armor[7][armorType]; + case INVTYPE_CLOAK: + return CloakArmor; + default: + break; + } + } + return 0; +} + +uint32 ScalingStatValuesEntry::GetDPSAndDamageMultiplier(uint32 subClass, bool isCasterWeapon, float* damageMultiplier) const +{ + if (!isCasterWeapon) + { + switch (subClass) + { + case ITEM_SUBCLASS_WEAPON_AXE: + case ITEM_SUBCLASS_WEAPON_MACE: + case ITEM_SUBCLASS_WEAPON_SWORD: + case ITEM_SUBCLASS_WEAPON_DAGGER: + case ITEM_SUBCLASS_WEAPON_THROWN: + *damageMultiplier = 0.3f; + return dpsMod[0]; + case ITEM_SUBCLASS_WEAPON_AXE2: + case ITEM_SUBCLASS_WEAPON_MACE2: + case ITEM_SUBCLASS_WEAPON_POLEARM: + case ITEM_SUBCLASS_WEAPON_SWORD2: + case ITEM_SUBCLASS_WEAPON_STAFF: + case ITEM_SUBCLASS_WEAPON_FISHING_POLE: + *damageMultiplier = 0.2f; + return dpsMod[1]; + case ITEM_SUBCLASS_WEAPON_BOW: + case ITEM_SUBCLASS_WEAPON_GUN: + case ITEM_SUBCLASS_WEAPON_CROSSBOW: + *damageMultiplier = 0.3f; + return dpsMod[4]; + case ITEM_SUBCLASS_WEAPON_obsolete: + case ITEM_SUBCLASS_WEAPON_EXOTIC: + case ITEM_SUBCLASS_WEAPON_EXOTIC2: + case ITEM_SUBCLASS_WEAPON_FIST: + case ITEM_SUBCLASS_WEAPON_MISC: + case ITEM_SUBCLASS_WEAPON_SPEAR: + case ITEM_SUBCLASS_WEAPON_WAND: + break; + } + } + else + { + if (subClass <= ITEM_SUBCLASS_WEAPON_WAND) + { + uint32 mask = 1 << subClass; + // two-handed weapons + if (mask & 0x562) + { + *damageMultiplier = 0.2f; + return dpsMod[3]; + } + + if (mask & (1 << ITEM_SUBCLASS_WEAPON_WAND)) + { + *damageMultiplier = 0.3f; + return dpsMod[5]; + } + } + *damageMultiplier = 0.3f; + return dpsMod[2]; + } + return 0; +} + // script support functions DBCStorage const* GetSoundEntriesStore() { return &sSoundEntriesStore; } DBCStorage const* GetSpellRangeStore() { return &sSpellRangeStore; } diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 6af4504f52a..6f303c23c4a 100755 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -520,7 +520,7 @@ struct AchievementCriteriaEntry //uint32 unk1; // 15 only one value, still unknown //uint32 unk2; // 16 all zeros //uint32 moreRequirement[3]; // 17-19 - //uint32 moreRequirementValue[3]; // 20-22 + //uint32 moreRequirementValue[3]; // 20-22 }; struct AreaTableEntry @@ -1481,91 +1481,17 @@ struct ScalingStatDistributionEntry struct ScalingStatValuesEntry { - uint32 Id; // 0 - uint32 Level; // 1 - uint32 dpsMod[6]; // 2-7 DPS mod for level - uint32 spellBonus; // 8 spell power for level - uint32 ssdMultiplier[5]; // 9-13 Multiplier for ScalingStatDistribution - uint32 armorMod[4]; // 14-17 Armor for level - uint32 armorMod2[4]; // 18-21 Armor for level - //uint32 trash[24]; // 22-45 - //uint32 unk2; // 46 unk, probably also Armor for level (flag 0x80000?) - - uint32 getssdMultiplier(uint32 mask) const - { - if (mask & 0x4001F) - { - if (mask & 0x00000001) - return ssdMultiplier[1]; - if (mask & 0x00000002) - return ssdMultiplier[2]; // 0 and 1 were duplicated - if (mask & 0x00000004) - return ssdMultiplier[3]; - if (mask & 0x00000008) - return ssdMultiplier[0]; - if (mask & 0x00000010) - return ssdMultiplier[4]; - if (mask & 0x00040000) - return ssdMultiplier[2]; // 4.0.0 - } - return 0; - } - - uint32 getArmorMod(uint32 mask) const - { - if (mask & 0x00F001E0) - { - if (mask & 0x00000020) - return armorMod[0]; - if (mask & 0x00000040) - return armorMod[1]; - if (mask & 0x00000080) - return armorMod[2]; - if (mask & 0x00000100) - return armorMod[3]; - - if (mask & 0x00100000) - return armorMod2[0]; // cloth - if (mask & 0x00200000) - return armorMod2[1]; // leather - if (mask & 0x00400000) - return armorMod2[2]; // mail - if (mask & 0x00800000) - return armorMod2[3]; // plate - } - return 0; - } - uint32 getDPSMod(uint32 mask) const - { - if (mask&0x7E00) - { - if (mask & 0x00000200) - return dpsMod[0]; - if (mask & 0x00000400) - return dpsMod[1]; - if (mask & 0x00000800) - return dpsMod[2]; - if (mask & 0x00001000) - return dpsMod[3]; - if (mask & 0x00002000) - return dpsMod[4]; - if (mask & 0x00004000) - return dpsMod[5]; // not used? - } - return 0; - } - uint32 getSpellBonus(uint32 mask) const - { - if (mask & 0x00008000) - return spellBonus; - return 0; - } - uint32 getFeralBonus(uint32 mask) const // removed in 3.2.x? - { - if (mask & 0x00010000) - return 0; // not used? - return 0; - } + uint32 Id; // 0 + uint32 Level; // 1 + uint32 dpsMod[6]; // 2-7 DPS mod for level + uint32 Spellpower; // 8 spell power for level + uint32 StatMultiplier[5]; // 9-13 Multiplier for ScalingStatDistribution + uint32 Armor[8][4]; // 14-46 Armor for level + uint32 CloakArmor; // 47 armor for cloak + + uint32 GetStatMultiplier(uint32 inventoryType) const; + uint32 GetArmor(uint32 inventoryType, uint32 armorType) const; + uint32 GetDPSAndDamageMultiplier(uint32 subClass, bool isCasterWeapon, float* damageMultiplier) const; }; //struct SkillLineCategoryEntry{ diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index eb62a211067..be2fe6916e4 100755 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -105,7 +105,7 @@ const char QuestFactionRewardfmt[]="niiiiiiiiii"; const char PvPDifficultyfmt[]="diiiii"; const char RandomPropertiesPointsfmt[]="niiiiiiiiiiiiiii"; const char ScalingStatDistributionfmt[]="niiiiiiiiiiiiiiiiiiiixi"; -const char ScalingStatValuesfmt[]="iniiiiiiiiiiiiiiiiiiiixxxxxxxxxxxxxxxxxxxxxxxxx"; +const char ScalingStatValuesfmt[]="iniiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii"; const char SkillLinefmt[]="nisxixi"; const char SkillLineAbilityfmt[]="niiiixxiiiiixx"; const char SoundEntriesfmt[]="nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; diff --git a/src/server/game/Entities/Item/ItemPrototype.h b/src/server/game/Entities/Item/ItemPrototype.h index 03212c129fd..c15189dfb5f 100755 --- a/src/server/game/Entities/Item/ItemPrototype.h +++ b/src/server/game/Entities/Item/ItemPrototype.h @@ -189,7 +189,8 @@ enum ItemFlagsExtra ITEM_FLAGS_EXTRA_HORDE_ONLY = 0x00000001, ITEM_FLAGS_EXTRA_ALLIANCE_ONLY = 0x00000002, ITEM_FLAGS_EXTRA_EXT_COST_REQUIRES_GOLD = 0x00000004, // when item uses extended cost, gold is also required - ITEM_FLAGS_EXTRA_NEED_ROLL_DISABLED = 0x00000100 + ITEM_FLAGS_EXTRA_NEED_ROLL_DISABLED = 0x00000100, + ITEM_FLAGS_EXTRA_CASTER_WEAPON = 0x00000200, }; enum BAG_FAMILY_MASK @@ -608,7 +609,6 @@ struct ItemTemplate uint32 StatsCount; _ItemStat ItemStat[MAX_ITEM_PROTO_STATS]; uint32 ScalingStatDistribution; // id from ScalingStatDistribution.dbc - uint32 ScalingStatValue; // mask for selecting column in ScalingStatValues.dbc _Damage Damage[MAX_ITEM_PROTO_DAMAGES]; uint32 Armor; uint32 HolyRes; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 4550f9c6e58..b444a8fdc94 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -1881,7 +1881,7 @@ bool Player::BuildEnumData(QueryResult result, ByteBuffer* data) if (result && !(playerFlags & PLAYER_FLAGS_GHOST) && (plrClass == CLASS_WARLOCK || plrClass == CLASS_HUNTER || plrClass == CLASS_DEATH_KNIGHT)) { uint32 entry = fields[16].GetUInt32(); - CreatureTemplate const* creatureInfo = sObjectMgr->GetCreatureTemplate(entry); + CreatureTemplate const* creatureInfo = sObjectMgr->GetCreatureTemplate(entry); if (creatureInfo) { petDisplayId = fields[17].GetUInt32(); @@ -1917,7 +1917,7 @@ bool Player::BuildEnumData(QueryResult result, ByteBuffer* data) if (Guid3) *data << uint8(Guid3^1); - + //*data << uint8(2); // unk, bit 14 uint32 playerBytes2 = fields[6].GetUInt32(); @@ -1956,29 +1956,29 @@ bool Player::BuildEnumData(QueryResult result, ByteBuffer* data) *data << uint8(Guid2^1); *data << uint32(petDisplayId); // Pet DisplayID - + //if (uint8(GuildGuid >> 56)) // *data << uint8(GuildGuid^1 >> 56); - + *data << uint8(level); // Level *data << uint8(playerBytes >> 16); // Hair style - + //if (uint8(GuildGuid >> 16)) // *data << uint8(GuildGuid^1 >> 16); - + *data << uint8(plrRace); // Race *data << uint8(playerBytes >> 24); // Hair color //if (uint8(GuildGuid >> 48)) // *data << uint8(GuildGuid^1 >> 48); - + *data << uint8(gender); // Gender //if (uint8(GuildGuid >> 24)) // *data << uint8(GuildGuid^1 >> 24); - + *data << uint8(0); // character order id (used for char list positioning) TODO: implement - + Tokens equipment(fields[19].GetString(), ' '); for (uint8 slot = 0; slot < EQUIPMENT_SLOT_END; ++slot) { @@ -1993,7 +1993,7 @@ bool Player::BuildEnumData(QueryResult result, ByteBuffer* data) *data << uint32(0); continue; } - + SpellItemEnchantmentEntry const *enchant = NULL; uint32 enchants = GetUInt32ValueFromArray(equipment, visualbase + 1); for (uint8 enchantSlot = PERM_ENCHANTMENT_SLOT; enchantSlot <= TEMP_ENCHANTMENT_SLOT; ++enchantSlot) @@ -2032,7 +2032,7 @@ bool Player::BuildEnumData(QueryResult result, ByteBuffer* data) else *data << uint32(CHAR_CUSTOMIZE_FLAG_NONE); - + //if (uint8(GuildGuid >> 8)) // *data << uint8(GuildGuid^1 >> 8); @@ -7875,7 +7875,7 @@ void Player::_ApplyItemBonuses(ItemTemplate const* proto, uint8 slot, bool apply if (ssd && ssd_level > ssd->MaxLevel) ssd_level = ssd->MaxLevel; - ScalingStatValuesEntry const* ssv = proto->ScalingStatValue ? sScalingStatValuesStore.LookupEntry(ssd_level) : NULL; + ScalingStatValuesEntry const* ssv = ssd ? sScalingStatValuesStore.LookupEntry(ssd_level) : NULL; if (only_level_scale && !ssv) return; @@ -7889,7 +7889,7 @@ void Player::_ApplyItemBonuses(ItemTemplate const* proto, uint8 slot, bool apply if (ssd->StatMod[i] < 0) continue; statType = ssd->StatMod[i]; - val = (ssv->getssdMultiplier(proto->ScalingStatValue) * ssd->Modifier[i]) / 10000; + val = (ssv->GetStatMultiplier(proto->InventoryType) * ssd->Modifier[i]) / 10000; } else { @@ -8054,15 +8054,14 @@ void Player::_ApplyItemBonuses(ItemTemplate const* proto, uint8 slot, bool apply } // Apply Spell Power from ScalingStatValue if set - if (ssv) - if (int32 spellbonus = ssv->getSpellBonus(proto->ScalingStatValue)) + if (ssv && proto->Flags2 & ITEM_FLAGS_EXTRA_CASTER_WEAPON) + if (int32 spellbonus = int32(ssv->Spellpower)) ApplySpellPowerBonus(spellbonus, apply); // If set ScalingStatValue armor get it or use item armor uint32 armor = proto->Armor; - if (ssv) - if (uint32 ssvarmor = ssv->getArmorMod(proto->ScalingStatValue)) - armor = ssvarmor; + if (ssv && proto->Class == ITEM_CLASS_ARMOR) + armor = ssv->GetArmor(proto->InventoryType, proto->SubClass - 1); if (armor) { @@ -8124,15 +8123,6 @@ void Player::_ApplyItemBonuses(ItemTemplate const* proto, uint8 slot, bool apply if (CanUseAttackType(attType)) _ApplyWeaponDamage(slot, proto, ssv, apply); - // Apply feral bonus from ScalingStatValue if set - if (ssv) - if (int32 feral_bonus = ssv->getFeralBonus(proto->ScalingStatValue)) - ApplyFeralAPBonus(feral_bonus, apply); - - // Druids get feral AP bonus from weapon dps (lso use DPS from ScalingStatValue) - if (getClass() == CLASS_DRUID) - if (int32 feral_bonus = proto->getFeralBonus(ssv->getDPSMod(proto->ScalingStatValue))) - ApplyFeralAPBonus(feral_bonus, apply); } void Player::_ApplyWeaponDamage(uint8 slot, ItemTemplate const* proto, ScalingStatValuesEntry const* ssv, bool apply) @@ -8155,14 +8145,16 @@ void Player::_ApplyWeaponDamage(uint8 slot, ItemTemplate const* proto, ScalingSt float maxDamage = proto->Damage[0].DamageMax; // If set dpsMod in ScalingStatValue use it for min (70% from average), max (130% from average) damage + int32 extraDPS = 0; if (ssv) { - int32 extraDPS = ssv->getDPSMod(proto->ScalingStatValue); + float damageMultiplier = 0.0f; + extraDPS = ssv->GetDPSAndDamageMultiplier(proto->SubClass, proto->Flags2 & ITEM_FLAGS_EXTRA_CASTER_WEAPON, &damageMultiplier); if (extraDPS) { float average = extraDPS * proto->Delay / 1000.0f; - minDamage = 0.7f * average; - maxDamage = 1.3f * average; + minDamage = (1.0f - damageMultiplier) * average; + maxDamage = (1.0f + damageMultiplier) * average; } } @@ -8194,6 +8186,11 @@ void Player::_ApplyWeaponDamage(uint8 slot, ItemTemplate const* proto, ScalingSt if (CanModifyStats() && (damage || proto->Delay)) UpdateDamagePhysical(attType); + + // Druids get feral AP bonus from weapon dps (lso use DPS from ScalingStatValue) + if (getClass() == CLASS_DRUID) + if (int32 feral_bonus = proto->getFeralBonus(extraDPS)) + ApplyFeralAPBonus(feral_bonus, apply); } void Player::_ApplyWeaponDependentAuraMods(Item* item, WeaponAttackType attackType, bool apply) @@ -24687,7 +24684,7 @@ void Player::SendRefundInfo(Item *item) WorldPacket data(SMSG_ITEM_REFUND_INFO_RESPONSE, 8+4+4+4+4*4+4*4+4+4); data << uint64(item->GetGUID()); // item guid - data << uint32(item->GetPaidMoney()); // money cost + data << uint32(item->GetPaidMoney()); // money cost for (uint8 i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i) // item cost data { data << uint32(iece->RequiredItem[i]); diff --git a/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp b/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp index f4e3af72892..53b864b4d90 100755 --- a/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp @@ -339,7 +339,7 @@ void WorldSession::HandleItemQuerySingleOpcode(WorldPacket & recv_data) data << pProto->ItemStat[i].ItemStatValue; } data << pProto->ScalingStatDistribution; // scaling stats distribution - data << pProto->ScalingStatValue; // some kind of flags used to determine stat values column + data << uint32(0); for (int i = 0; i < MAX_ITEM_PROTO_DAMAGES; ++i) { data << pProto->Damage[i].DamageMin; -- cgit v1.2.3 From b76b820e492cd014963e6c759ea6750eecf57664 Mon Sep 17 00:00:00 2001 From: kaelima Date: Thu, 24 Nov 2011 18:22:04 +0100 Subject: Core/Protocol: Fix struct of SMSG_AURA_UPDATE/SMSG_AURA_UPDATE_ALL --- src/server/game/Server/Protocol/Opcodes.cpp | 4 ++-- src/server/game/Server/Protocol/Opcodes.h | 4 ++-- src/server/game/Spells/Auras/SpellAuras.cpp | 12 +++++++++++- 3 files changed, 15 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 0904e978eb8..46b58a80b45 100755 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -1214,8 +1214,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_PET_UPDATE_COMBO_POINTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_ENABLETAXI, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleTaxiQueryAvailableNodes ); //DEFINE_OPCODE_HANDLER(SMSG_PRE_RESURRECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_AURA_UPDATE_ALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_AURA_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_AURA_UPDATE_ALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_AURA_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_FLOOD_GRACE_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_SERVER_FIRST_ACHIEVEMENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_LEARNED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 3977ecb4538..3cd790406ae 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -560,8 +560,8 @@ enum Opcodes SMSG_AUCTION_OWNER_LIST_RESULT = 0x00, // SMSG_AUCTION_OWNER_NOTIFICATION = 0x00, // SMSG_AUCTION_REMOVED_NOTIFICATION = 0x00, // - SMSG_AURA_UPDATE = 0x00, // - SMSG_AURA_UPDATE_ALL = 0x00, // + SMSG_AURA_UPDATE = 0x4C66, // + SMSG_AURA_UPDATE_ALL = 0x18EE, // SMSG_AURACASTLOG = 0x00, // SMSG_AUTH_CHALLENGE = 0x1181, // SMSG_AUTH_RESPONSE = 0x8867, // diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 525084a70ed..ffe3b0084a9 100755 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -192,7 +192,7 @@ void AuraApplication::BuildUpdatePacket(ByteBuffer& data, bool remove) const uint32 flags = m_flags; if (aura->GetMaxDuration() > 0 && !(aura->GetSpellInfo()->AttributesEx5 & SPELL_ATTR5_HIDE_DURATION)) flags |= AFLAG_DURATION; - data << uint8(flags); + data << uint16(flags); data << uint8(aura->GetCasterLevel()); // send stack amount for aura which could be stacked (never 0 - causes incorrect display) or charges // stack amount has priority over charges (checked on retail with spell 50262) @@ -206,6 +206,16 @@ void AuraApplication::BuildUpdatePacket(ByteBuffer& data, bool remove) const data << uint32(aura->GetMaxDuration()); data << uint32(aura->GetDuration()); } + + if (flags & AFLAG_ANY_EFFECT_AMOUNT_SENT) + { + if (flags & AFLAG_EFF_INDEX_0) + data << uint32(0); // Effect 0 value + if (flags & AFLAG_EFF_INDEX_1) + data << uint32(0); // Effect 1 value + if (flags & AFLAG_EFF_INDEX_2) + data << uint32(0); // Effect 2 value + } } void AuraApplication::ClientUpdate(bool remove) -- cgit v1.2.3 From 21f9a0532407e7fd80052940d6f881bce5e9b656 Mon Sep 17 00:00:00 2001 From: Venugh Date: Thu, 24 Nov 2011 18:54:59 +0100 Subject: Core/DataStores: Coding style. --- src/server/game/DataStores/DB2Structure.h | 10 +-- src/server/game/DataStores/DBCStructure.h | 140 +++++++++++++++--------------- 2 files changed, 74 insertions(+), 76 deletions(-) (limited to 'src') diff --git a/src/server/game/DataStores/DB2Structure.h b/src/server/game/DataStores/DB2Structure.h index 1681bdfaae1..1f455eec0c2 100644 --- a/src/server/game/DataStores/DB2Structure.h +++ b/src/server/game/DataStores/DB2Structure.h @@ -81,11 +81,11 @@ struct ItemSparseEntry int32 SpellCategory[MAX_ITEM_PROTO_SPELLS]; // 85 - 89 int32 SpellCategoryCooldown[MAX_ITEM_PROTO_SPELLS]; // 90 - 94 uint32 Bonding; // 95 - char* Name; // 96 - char* Name2; // 97 - char* Name3; // 98 - char* Name4; // 99 - char* Description; // 100 + char* Name; // 96 + char* Name2; // 97 + char* Name3; // 98 + char* Name4; // 99 + char* Description; // 100 uint32 PageText; // 101 uint32 LanguageID; // 102 uint32 PageMaterial; // 103 diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 6f303c23c4a..7dbb8a200aa 100755 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -44,14 +44,14 @@ struct AchievementEntry int32 requiredFaction; // 1 -1=all, 0=horde, 1=alliance int32 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; // 4 - //char* description; // 5 + char* name; // 4 + //char* description; // 5 uint32 categoryId; // 6 uint32 points; // 7 reward points //uint32 OrderInCategory; // 8 uint32 flags; // 9 //uint32 icon; // 10 icon (from SpellIcon.dbc) - //char* reward; // 11 + //char* reward; // 11 uint32 count; // 12 - need this count of completed criterias (own or referenced achievement criterias) uint32 refAchievement; // 13 - referenced achievement (counting of all completed criterias) }; @@ -532,7 +532,7 @@ struct AreaTableEntry uint32 flags; // 4, unknown value but 312 for all cities // 5-9 unused int32 area_level; // 10 - char* area_name; // 11 + char* area_name; // 11 uint32 team; // 12 // 13-19 unknown //uint32 unk20; // 20 4.0.0 @@ -569,8 +569,8 @@ struct AreaPOIEntry uint32 mapId; //14 //uint32 val1; //15 uint32 zoneId; //16 - //char* name; //17 - name - //char* name2; //18 - name2 + //char* name; //17 - name + //char* name2; //18 - name2 uint32 worldState; //19 //uint32 val2; //20 //uint32 unk; //21 @@ -632,7 +632,7 @@ struct BattlemasterListEntry int32 mapid[8]; // 1-8 mapid uint32 type; // 9 (3 - BG, 4 - arena) //uint32 canJoinAsGroup; // 10 (0 or 1) - char* name; // 11 + char* name; // 11 uint32 maxGroupSize; // 12 maxGroupSize, used for checking if queue as group uint32 HolidayWorldStateId; // 13 new 3.1 uint32 minLevel; // 14, min level (sync with PvPDifficulty.dbc content) @@ -663,7 +663,7 @@ struct CharTitlesEntry { uint32 ID; // 0, title ids, for example in Quest::GetCharTitleId() //uint32 unk1; // 1 flags? - char* name; // 2 m_name_lang + char* name; // 2 m_name_lang //char* name2; // 3 m_name1_lang uint32 bit_index; // 4 m_mask_ID used in PLAYER_CHOSEN_TITLE and 1< Date: Thu, 24 Nov 2011 18:58:00 +0100 Subject: Core/Protocols: Rename CMSG_WORLD_LOGIN to CMSG_LOAD_SCREEN and add simple structure (still unknown purpose). --- src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp | 10 ++++++++++ src/server/game/Server/Protocol/Opcodes.cpp | 1 + src/server/game/Server/Protocol/Opcodes.h | 2 +- src/server/game/Server/WorldSession.h | 1 + 4 files changed, 13 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp index 342b8ef119f..26a71ea7e80 100755 --- a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp @@ -862,6 +862,16 @@ void WorldSession::HandlePlayerLoginOpcode(WorldPacket & recv_data) _charLoginCallback = CharacterDatabase.DelayQueryHolder((SQLQueryHolder*)holder); } +void WorldSession::HandleLoadScreenOpcode(WorldPacket& recvPacket) +{ + sLog->outStaticDebug("WORLD: Recvd CMSG_LOAD_SCREEN"); + uint8 unkMask; // Loading start: 0x80, loading end: 0x0 + uint32 mapID; + recvPacket >> unkMask >> mapID; + + // TODO: Do something with this packet +} + void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder) { uint64 playerGuid = holder->GetGuid(); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 46b58a80b45..8f0487d563f 100755 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -103,6 +103,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_CHAR_ENUM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CHAR_DELETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_PLAYER_LOGIN, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayerLoginOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_LOAD_SCREEN, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleLoadScreenOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_NEW_WORLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TRANSFER_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TRANSFER_ABORTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 3cd790406ae..cd90f44cb68 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -250,6 +250,7 @@ enum Opcodes CMSG_LFG_SET_ROLES = 0x4843, // CMSG_LFG_TELEPORT = 0x8C7A, // CMSG_LIST_INVENTORY = 0xDCFE, // + CMSG_LOAD_SCREEN = 0x4011, // CMSG_LOG_DISCONNECT = 0x00, // CMSG_LOGOUT_CANCEL = 0xA76, // CMSG_LOGOUT_REQUEST = 0x4C7A, // @@ -432,7 +433,6 @@ enum Opcodes CMSG_WARDEN_DATA = 0x5847, // CMSG_WHO = 0x9AD7, // CMSG_WHOIS = 0xCCE6, // - CMSG_WORLD_LOGIN = 0x00, // CMSG_WORLD_STATE_UI_TIMER_UPDATE = 0x58F6, // CMSG_WORLD_TELEPORT = 0x00, // CMSG_WRAP_ITEM = 0x00, // diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 5c4a0b74195..6421edaa7c6 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -401,6 +401,7 @@ class WorldSession void HandleCharCreateOpcode(WorldPacket& recvPacket); void HandleCharCreateCallback(PreparedQueryResult result, CharacterCreateInfo* createInfo); void HandlePlayerLoginOpcode(WorldPacket& recvPacket); + void HandleLoadScreenOpcode(WorldPacket& recvPacket); void HandleCharEnum(QueryResult result); void HandlePlayerLogin(LoginQueryHolder * holder); void HandleCharFactionOrRaceChange(WorldPacket& recv_data); -- cgit v1.2.3 From 23bd7bc0a30e6a9269c7fd6f6bcc11a0c6604212 Mon Sep 17 00:00:00 2001 From: kaelima Date: Fri, 25 Nov 2011 13:32:46 +0100 Subject: Core/Object: Update UpdateFields to version 4.2.2 (14545) --- .../game/Entities/Object/Updates/UpdateFields.h | 740 ++++++++++++--------- 1 file changed, 431 insertions(+), 309 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Object/Updates/UpdateFields.h b/src/server/game/Entities/Object/Updates/UpdateFields.h index 321d11fac8a..03e83496297 100755 --- a/src/server/game/Entities/Object/Updates/UpdateFields.h +++ b/src/server/game/Entities/Object/Updates/UpdateFields.h @@ -19,16 +19,17 @@ #ifndef _UPDATEFIELDS_AUTO_H #define _UPDATEFIELDS_AUTO_H -// Auto generated for version 3, 3, 5, 12340 +// Auto generated for version 4, 2, 2, 14545 enum EObjectFields { OBJECT_FIELD_GUID = 0x0000, // Size: 2, Type: LONG, Flags: PUBLIC - OBJECT_FIELD_TYPE = 0x0002, // Size: 1, Type: INT, Flags: PUBLIC - OBJECT_FIELD_ENTRY = 0x0003, // Size: 1, Type: INT, Flags: PUBLIC - OBJECT_FIELD_SCALE_X = 0x0004, // Size: 1, Type: FLOAT, Flags: PUBLIC - OBJECT_FIELD_PADDING = 0x0005, // Size: 1, Type: INT, Flags: NONE - OBJECT_END = 0x0006, + OBJECT_FIELD_DATA = 0x0002, // Size: 2, Type: LONG, Flags: PUBLIC + OBJECT_FIELD_TYPE = 0x0004, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + OBJECT_FIELD_ENTRY = 0x0005, // Size: 1, Type: INT, Flags: PUBLIC + OBJECT_FIELD_SCALE_X = 0x0006, // Size: 1, Type: FLOAT, Flags: PUBLIC + OBJECT_FIELD_PADDING = 0x0007, // Size: 1, Type: INT, Flags: NONE + OBJECT_END = 0x0008, }; enum EItemFields @@ -37,9 +38,9 @@ enum EItemFields ITEM_FIELD_CONTAINED = OBJECT_END + 0x0002, // Size: 2, Type: LONG, Flags: PUBLIC ITEM_FIELD_CREATOR = OBJECT_END + 0x0004, // Size: 2, Type: LONG, Flags: PUBLIC ITEM_FIELD_GIFTCREATOR = OBJECT_END + 0x0006, // Size: 2, Type: LONG, Flags: PUBLIC - ITEM_FIELD_STACK_COUNT = OBJECT_END + 0x0008, // Size: 1, Type: INT, Flags: OWNER, ITEM_OWNER - ITEM_FIELD_DURATION = OBJECT_END + 0x0009, // Size: 1, Type: INT, Flags: OWNER, ITEM_OWNER - ITEM_FIELD_SPELL_CHARGES = OBJECT_END + 0x000A, // Size: 5, Type: INT, Flags: OWNER, ITEM_OWNER + ITEM_FIELD_STACK_COUNT = OBJECT_END + 0x0008, // Size: 1, Type: INT, Flags: OWNER, UNUSED1 + ITEM_FIELD_DURATION = OBJECT_END + 0x0009, // Size: 1, Type: INT, Flags: OWNER, UNUSED1 + ITEM_FIELD_SPELL_CHARGES = OBJECT_END + 0x000A, // Size: 5, Type: INT, Flags: OWNER, UNUSED1 ITEM_FIELD_FLAGS = OBJECT_END + 0x000F, // Size: 1, Type: INT, Flags: PUBLIC ITEM_FIELD_ENCHANTMENT_1_1 = OBJECT_END + 0x0010, // Size: 2, Type: INT, Flags: PUBLIC ITEM_FIELD_ENCHANTMENT_1_3 = OBJECT_END + 0x0012, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC @@ -65,13 +66,17 @@ enum EItemFields ITEM_FIELD_ENCHANTMENT_11_3 = OBJECT_END + 0x0030, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC ITEM_FIELD_ENCHANTMENT_12_1 = OBJECT_END + 0x0031, // Size: 2, Type: INT, Flags: PUBLIC ITEM_FIELD_ENCHANTMENT_12_3 = OBJECT_END + 0x0033, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - ITEM_FIELD_PROPERTY_SEED = OBJECT_END + 0x0034, // Size: 1, Type: INT, Flags: PUBLIC - ITEM_FIELD_RANDOM_PROPERTIES_ID = OBJECT_END + 0x0035, // Size: 1, Type: INT, Flags: PUBLIC - ITEM_FIELD_DURABILITY = OBJECT_END + 0x0036, // Size: 1, Type: INT, Flags: OWNER, ITEM_OWNER - ITEM_FIELD_MAXDURABILITY = OBJECT_END + 0x0037, // Size: 1, Type: INT, Flags: OWNER, ITEM_OWNER - ITEM_FIELD_CREATE_PLAYED_TIME = OBJECT_END + 0x0038, // Size: 1, Type: INT, Flags: PUBLIC - ITEM_FIELD_PAD = OBJECT_END + 0x0039, // Size: 1, Type: INT, Flags: NONE - ITEM_END = OBJECT_END + 0x003A, + ITEM_FIELD_ENCHANTMENT_13_1 = OBJECT_END + 0x0034, // Size: 2, Type: INT, Flags: PUBLIC + ITEM_FIELD_ENCHANTMENT_13_3 = OBJECT_END + 0x0036, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + ITEM_FIELD_ENCHANTMENT_14_1 = OBJECT_END + 0x0037, // Size: 2, Type: INT, Flags: PUBLIC + ITEM_FIELD_ENCHANTMENT_14_3 = OBJECT_END + 0x0039, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + ITEM_FIELD_PROPERTY_SEED = OBJECT_END + 0x003A, // Size: 1, Type: INT, Flags: PUBLIC + ITEM_FIELD_RANDOM_PROPERTIES_ID = OBJECT_END + 0x003B, // Size: 1, Type: INT, Flags: PUBLIC + ITEM_FIELD_DURABILITY = OBJECT_END + 0x003C, // Size: 1, Type: INT, Flags: OWNER, UNUSED1 + ITEM_FIELD_MAXDURABILITY = OBJECT_END + 0x003D, // Size: 1, Type: INT, Flags: OWNER, UNUSED1 + ITEM_FIELD_CREATE_PLAYED_TIME = OBJECT_END + 0x003E, // Size: 1, Type: INT, Flags: PUBLIC + ITEM_FIELD_PAD = OBJECT_END + 0x003F, // Size: 1, Type: INT, Flags: NONE + ITEM_END = OBJECT_END + 0x0040, }; enum EContainerFields @@ -102,295 +107,414 @@ enum EUnitFields UNIT_FIELD_POWER5 = OBJECT_END + 0x0017, // Size: 1, Type: INT, Flags: PUBLIC UNIT_FIELD_POWER6 = OBJECT_END + 0x0018, // Size: 1, Type: INT, Flags: PUBLIC UNIT_FIELD_POWER7 = OBJECT_END + 0x0019, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_MAXHEALTH = OBJECT_END + 0x001A, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_MAXPOWER1 = OBJECT_END + 0x001B, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_MAXPOWER2 = OBJECT_END + 0x001C, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_MAXPOWER3 = OBJECT_END + 0x001D, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_MAXPOWER4 = OBJECT_END + 0x001E, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_MAXPOWER5 = OBJECT_END + 0x001F, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_MAXPOWER6 = OBJECT_END + 0x0020, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_MAXPOWER7 = OBJECT_END + 0x0021, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER = OBJECT_END + 0x0022, // Size: 7, Type: FLOAT, Flags: PRIVATE, OWNER - UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER = OBJECT_END + 0x0029, // Size: 7, Type: FLOAT, Flags: PRIVATE, OWNER - UNIT_FIELD_LEVEL = OBJECT_END + 0x0030, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_FACTIONTEMPLATE = OBJECT_END + 0x0031, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_VIRTUAL_ITEM_SLOT_ID = OBJECT_END + 0x0032, // Size: 3, Type: INT, Flags: PUBLIC - UNIT_FIELD_FLAGS = OBJECT_END + 0x0035, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_FLAGS_2 = OBJECT_END + 0x0036, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_AURASTATE = OBJECT_END + 0x0037, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_BASEATTACKTIME = OBJECT_END + 0x0038, // Size: 2, Type: INT, Flags: PUBLIC - UNIT_FIELD_RANGEDATTACKTIME = OBJECT_END + 0x003A, // Size: 1, Type: INT, Flags: PRIVATE - UNIT_FIELD_BOUNDINGRADIUS = OBJECT_END + 0x003B, // Size: 1, Type: FLOAT, Flags: PUBLIC - UNIT_FIELD_COMBATREACH = OBJECT_END + 0x003C, // Size: 1, Type: FLOAT, Flags: PUBLIC - UNIT_FIELD_DISPLAYID = OBJECT_END + 0x003D, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_NATIVEDISPLAYID = OBJECT_END + 0x003E, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_MOUNTDISPLAYID = OBJECT_END + 0x003F, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_MINDAMAGE = OBJECT_END + 0x0040, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER, PARTY_LEADER - UNIT_FIELD_MAXDAMAGE = OBJECT_END + 0x0041, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER, PARTY_LEADER - UNIT_FIELD_MINOFFHANDDAMAGE = OBJECT_END + 0x0042, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER, PARTY_LEADER - UNIT_FIELD_MAXOFFHANDDAMAGE = OBJECT_END + 0x0043, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER, PARTY_LEADER - UNIT_FIELD_BYTES_1 = OBJECT_END + 0x0044, // Size: 1, Type: BYTES, Flags: PUBLIC - UNIT_FIELD_PETNUMBER = OBJECT_END + 0x0045, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_PET_NAME_TIMESTAMP = OBJECT_END + 0x0046, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_PETEXPERIENCE = OBJECT_END + 0x0047, // Size: 1, Type: INT, Flags: OWNER - UNIT_FIELD_PETNEXTLEVELEXP = OBJECT_END + 0x0048, // Size: 1, Type: INT, Flags: OWNER - UNIT_DYNAMIC_FLAGS = OBJECT_END + 0x0049, // Size: 1, Type: INT, Flags: DYNAMIC - UNIT_MOD_CAST_SPEED = OBJECT_END + 0x004A, // Size: 1, Type: FLOAT, Flags: PUBLIC - UNIT_CREATED_BY_SPELL = OBJECT_END + 0x004B, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_NPC_FLAGS = OBJECT_END + 0x004C, // Size: 1, Type: INT, Flags: DYNAMIC - UNIT_NPC_EMOTESTATE = OBJECT_END + 0x004D, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_STAT0 = OBJECT_END + 0x004E, // Size: 1, Type: INT, Flags: PRIVATE, OWNER - UNIT_FIELD_STAT1 = OBJECT_END + 0x004F, // Size: 1, Type: INT, Flags: PRIVATE, OWNER - UNIT_FIELD_STAT2 = OBJECT_END + 0x0050, // Size: 1, Type: INT, Flags: PRIVATE, OWNER - UNIT_FIELD_STAT3 = OBJECT_END + 0x0051, // Size: 1, Type: INT, Flags: PRIVATE, OWNER - UNIT_FIELD_STAT4 = OBJECT_END + 0x0052, // Size: 1, Type: INT, Flags: PRIVATE, OWNER - UNIT_FIELD_POSSTAT0 = OBJECT_END + 0x0053, // Size: 1, Type: INT, Flags: PRIVATE, OWNER - UNIT_FIELD_POSSTAT1 = OBJECT_END + 0x0054, // Size: 1, Type: INT, Flags: PRIVATE, OWNER - UNIT_FIELD_POSSTAT2 = OBJECT_END + 0x0055, // Size: 1, Type: INT, Flags: PRIVATE, OWNER - UNIT_FIELD_POSSTAT3 = OBJECT_END + 0x0056, // Size: 1, Type: INT, Flags: PRIVATE, OWNER - UNIT_FIELD_POSSTAT4 = OBJECT_END + 0x0057, // Size: 1, Type: INT, Flags: PRIVATE, OWNER - UNIT_FIELD_NEGSTAT0 = OBJECT_END + 0x0058, // Size: 1, Type: INT, Flags: PRIVATE, OWNER - UNIT_FIELD_NEGSTAT1 = OBJECT_END + 0x0059, // Size: 1, Type: INT, Flags: PRIVATE, OWNER - UNIT_FIELD_NEGSTAT2 = OBJECT_END + 0x005A, // Size: 1, Type: INT, Flags: PRIVATE, OWNER - UNIT_FIELD_NEGSTAT3 = OBJECT_END + 0x005B, // Size: 1, Type: INT, Flags: PRIVATE, OWNER - UNIT_FIELD_NEGSTAT4 = OBJECT_END + 0x005C, // Size: 1, Type: INT, Flags: PRIVATE, OWNER - UNIT_FIELD_RESISTANCES = OBJECT_END + 0x005D, // Size: 7, Type: INT, Flags: PRIVATE, OWNER, PARTY_LEADER - UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE = OBJECT_END + 0x0064, // Size: 7, Type: INT, Flags: PRIVATE, OWNER - UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE = OBJECT_END + 0x006B, // Size: 7, Type: INT, Flags: PRIVATE, OWNER - UNIT_FIELD_BASE_MANA = OBJECT_END + 0x0072, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_BASE_HEALTH = OBJECT_END + 0x0073, // Size: 1, Type: INT, Flags: PRIVATE, OWNER - UNIT_FIELD_BYTES_2 = OBJECT_END + 0x0074, // Size: 1, Type: BYTES, Flags: PUBLIC - UNIT_FIELD_ATTACK_POWER = OBJECT_END + 0x0075, // Size: 1, Type: INT, Flags: PRIVATE, OWNER - UNIT_FIELD_ATTACK_POWER_MODS = OBJECT_END + 0x0076, // Size: 1, Type: TWO_SHORT, Flags: PRIVATE, OWNER - UNIT_FIELD_ATTACK_POWER_MULTIPLIER = OBJECT_END + 0x0077, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER - UNIT_FIELD_RANGED_ATTACK_POWER = OBJECT_END + 0x0078, // Size: 1, Type: INT, Flags: PRIVATE, OWNER - UNIT_FIELD_RANGED_ATTACK_POWER_MODS = OBJECT_END + 0x0079, // Size: 1, Type: TWO_SHORT, Flags: PRIVATE, OWNER - UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER = OBJECT_END + 0x007A, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER - UNIT_FIELD_MINRANGEDDAMAGE = OBJECT_END + 0x007B, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER - UNIT_FIELD_MAXRANGEDDAMAGE = OBJECT_END + 0x007C, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER - UNIT_FIELD_POWER_COST_MODIFIER = OBJECT_END + 0x007D, // Size: 7, Type: INT, Flags: PRIVATE, OWNER - UNIT_FIELD_POWER_COST_MULTIPLIER = OBJECT_END + 0x0084, // Size: 7, Type: FLOAT, Flags: PRIVATE, OWNER - UNIT_FIELD_MAXHEALTHMODIFIER = OBJECT_END + 0x008B, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER - UNIT_FIELD_HOVERHEIGHT = OBJECT_END + 0x008C, // Size: 1, Type: FLOAT, Flags: PUBLIC - UNIT_FIELD_PADDING = OBJECT_END + 0x008D, // Size: 1, Type: INT, Flags: NONE - UNIT_END = OBJECT_END + 0x008E, + UNIT_FIELD_POWER8 = OBJECT_END + 0x001A, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_POWER9 = OBJECT_END + 0x001B, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_POWER10 = OBJECT_END + 0x001C, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_POWER11 = OBJECT_END + 0x001D, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_MAXHEALTH = OBJECT_END + 0x0018, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_MAXPOWER1 = OBJECT_END + 0x0019, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_MAXPOWER2 = OBJECT_END + 0x001A, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_MAXPOWER3 = OBJECT_END + 0x001B, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_MAXPOWER4 = OBJECT_END + 0x001C, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_MAXPOWER5 = OBJECT_END + 0x001D, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_MAXPOWER6 = OBJECT_END + 0x0024, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_MAXPOWER7 = OBJECT_END + 0x0025, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_MAXPOWER8 = OBJECT_END + 0x0026, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_MAXPOWER9 = OBJECT_END + 0x0027, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_MAXPOWER10 = OBJECT_END + 0x0028, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_MAXPOWER11 = OBJECT_END + 0x0029, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER = OBJECT_END + 0x001E, // Size: 5, Type: FLOAT, Flags: PRIVATE, OWNER, PARTY_MEMBER + UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER = OBJECT_END + 0x0023, // Size: 5, Type: FLOAT, Flags: PRIVATE, OWNER, PARTY_MEMBER + UNIT_FIELD_LEVEL = OBJECT_END + 0x0028, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_FACTIONTEMPLATE = OBJECT_END + 0x0029, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_VIRTUAL_ITEM_SLOT_ID = OBJECT_END + 0x002A, // Size: 3, Type: INT, Flags: PUBLIC + UNIT_FIELD_FLAGS = OBJECT_END + 0x002D, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_FLAGS_2 = OBJECT_END + 0x002E, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_AURASTATE = OBJECT_END + 0x002F, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_BASEATTACKTIME = OBJECT_END + 0x0030, // Size: 2, Type: INT, Flags: PUBLIC + UNIT_FIELD_RANGEDATTACKTIME = OBJECT_END + 0x0032, // Size: 1, Type: INT, Flags: PRIVATE + UNIT_FIELD_BOUNDINGRADIUS = OBJECT_END + 0x0033, // Size: 1, Type: FLOAT, Flags: PUBLIC + UNIT_FIELD_COMBATREACH = OBJECT_END + 0x0034, // Size: 1, Type: FLOAT, Flags: PUBLIC + UNIT_FIELD_DISPLAYID = OBJECT_END + 0x0035, // Size: 1, Type: INT, Flags: UNUSED2 + UNIT_FIELD_NATIVEDISPLAYID = OBJECT_END + 0x0036, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_MOUNTDISPLAYID = OBJECT_END + 0x0037, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_MINDAMAGE = OBJECT_END + 0x0038, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER, ITEM_OWNER + UNIT_FIELD_MAXDAMAGE = OBJECT_END + 0x0039, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER, ITEM_OWNER + UNIT_FIELD_MINOFFHANDDAMAGE = OBJECT_END + 0x003A, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER, ITEM_OWNER + UNIT_FIELD_MAXOFFHANDDAMAGE = OBJECT_END + 0x003B, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER, ITEM_OWNER + UNIT_FIELD_BYTES_1 = OBJECT_END + 0x003C, // Size: 1, Type: BYTES, Flags: PUBLIC + UNIT_FIELD_PETNUMBER = OBJECT_END + 0x003D, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_PET_NAME_TIMESTAMP = OBJECT_END + 0x003E, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_PETEXPERIENCE = OBJECT_END + 0x003F, // Size: 1, Type: INT, Flags: OWNER + UNIT_FIELD_PETNEXTLEVELEXP = OBJECT_END + 0x0040, // Size: 1, Type: INT, Flags: OWNER + UNIT_DYNAMIC_FLAGS = OBJECT_END + 0x0041, // Size: 1, Type: INT, Flags: UNUSED2 + UNIT_MOD_CAST_SPEED = OBJECT_END + 0x0042, // Size: 1, Type: FLOAT, Flags: PUBLIC + UNIT_MOD_CAST_HASTE = OBJECT_END + 0x0043, // Size: 1, Type: FLOAT, Flags: PUBLIC + UNIT_CREATED_BY_SPELL = OBJECT_END + 0x0044, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_NPC_FLAGS = OBJECT_END + 0x0045, // Size: 1, Type: INT, Flags: UNUSED2 + UNIT_NPC_EMOTESTATE = OBJECT_END + 0x0046, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_STAT0 = OBJECT_END + 0x0047, // Size: 1, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_STAT1 = OBJECT_END + 0x0048, // Size: 1, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_STAT2 = OBJECT_END + 0x0049, // Size: 1, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_STAT3 = OBJECT_END + 0x004A, // Size: 1, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_STAT4 = OBJECT_END + 0x004B, // Size: 1, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_POSSTAT0 = OBJECT_END + 0x004C, // Size: 1, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_POSSTAT1 = OBJECT_END + 0x004D, // Size: 1, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_POSSTAT2 = OBJECT_END + 0x004E, // Size: 1, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_POSSTAT3 = OBJECT_END + 0x004F, // Size: 1, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_POSSTAT4 = OBJECT_END + 0x0050, // Size: 1, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_NEGSTAT0 = OBJECT_END + 0x0051, // Size: 1, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_NEGSTAT1 = OBJECT_END + 0x0052, // Size: 1, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_NEGSTAT2 = OBJECT_END + 0x0053, // Size: 1, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_NEGSTAT3 = OBJECT_END + 0x0054, // Size: 1, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_NEGSTAT4 = OBJECT_END + 0x0055, // Size: 1, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_RESISTANCES = OBJECT_END + 0x0056, // Size: 7, Type: INT, Flags: PRIVATE, OWNER, ITEM_OWNER + UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE = OBJECT_END + 0x005D, // Size: 7, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE = OBJECT_END + 0x0064, // Size: 7, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_BASE_MANA = OBJECT_END + 0x006B, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_BASE_HEALTH = OBJECT_END + 0x006C, // Size: 1, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_BYTES_2 = OBJECT_END + 0x006D, // Size: 1, Type: BYTES, Flags: PUBLIC + UNIT_FIELD_ATTACK_POWER = OBJECT_END + 0x006E, // Size: 1, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_ATTACK_POWER_MOD_POS = OBJECT_END + 0x006F, // Size: 1, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_ATTACK_POWER_MOD_NEG = OBJECT_END + 0x0070, // Size: 1, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_ATTACK_POWER_MULTIPLIER = OBJECT_END + 0x0071, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER + UNIT_FIELD_RANGED_ATTACK_POWER = OBJECT_END + 0x0072, // Size: 1, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_RANGED_ATTACK_POWER_MOD_POS = OBJECT_END + 0x0073, // Size: 1, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_RANGED_ATTACK_POWER_MOD_NEG = OBJECT_END + 0x0074, // Size: 1, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER = OBJECT_END + 0x0075, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER + UNIT_FIELD_MINRANGEDDAMAGE = OBJECT_END + 0x0076, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER + UNIT_FIELD_MAXRANGEDDAMAGE = OBJECT_END + 0x0077, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER + UNIT_FIELD_POWER_COST_MODIFIER = OBJECT_END + 0x0078, // Size: 7, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_POWER_COST_MULTIPLIER = OBJECT_END + 0x007F, // Size: 7, Type: FLOAT, Flags: PRIVATE, OWNER + UNIT_FIELD_MAXHEALTHMODIFIER = OBJECT_END + 0x0086, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER + UNIT_FIELD_HOVERHEIGHT = OBJECT_END + 0x0087, // Size: 1, Type: FLOAT, Flags: PUBLIC + UNIT_FIELD_MAXITEMLEVEL = OBJECT_END + 0x0088, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_PADDING = OBJECT_END + 0x0089, // Size: 1, Type: INT, Flags: NONE + UNIT_END = OBJECT_END + 0x008A, PLAYER_DUEL_ARBITER = UNIT_END + 0x0000, // Size: 2, Type: LONG, Flags: PUBLIC PLAYER_FLAGS = UNIT_END + 0x0002, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_GUILDID = UNIT_END + 0x0003, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_GUILDRANK = UNIT_END + 0x0004, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_BYTES = UNIT_END + 0x0005, // Size: 1, Type: BYTES, Flags: PUBLIC - PLAYER_BYTES_2 = UNIT_END + 0x0006, // Size: 1, Type: BYTES, Flags: PUBLIC - PLAYER_BYTES_3 = UNIT_END + 0x0007, // Size: 1, Type: BYTES, Flags: PUBLIC - PLAYER_DUEL_TEAM = UNIT_END + 0x0008, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_GUILD_TIMESTAMP = UNIT_END + 0x0009, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_QUEST_LOG_1_1 = UNIT_END + 0x000A, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_1_2 = UNIT_END + 0x000B, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_1_3 = UNIT_END + 0x000C, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE - PLAYER_QUEST_LOG_1_4 = UNIT_END + 0x000E, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_2_1 = UNIT_END + 0x000F, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_2_2 = UNIT_END + 0x0010, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_2_3 = UNIT_END + 0x0011, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE - PLAYER_QUEST_LOG_2_5 = UNIT_END + 0x0013, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_3_1 = UNIT_END + 0x0014, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_3_2 = UNIT_END + 0x0015, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_3_3 = UNIT_END + 0x0016, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE - PLAYER_QUEST_LOG_3_5 = UNIT_END + 0x0018, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_4_1 = UNIT_END + 0x0019, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_4_2 = UNIT_END + 0x001A, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_4_3 = UNIT_END + 0x001B, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE - PLAYER_QUEST_LOG_4_5 = UNIT_END + 0x001D, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_5_1 = UNIT_END + 0x001E, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_5_2 = UNIT_END + 0x001F, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_5_3 = UNIT_END + 0x0020, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE - PLAYER_QUEST_LOG_5_5 = UNIT_END + 0x0022, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_6_1 = UNIT_END + 0x0023, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_6_2 = UNIT_END + 0x0024, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_6_3 = UNIT_END + 0x0025, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE - PLAYER_QUEST_LOG_6_5 = UNIT_END + 0x0027, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_7_1 = UNIT_END + 0x0028, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_7_2 = UNIT_END + 0x0029, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_7_3 = UNIT_END + 0x002A, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE - PLAYER_QUEST_LOG_7_5 = UNIT_END + 0x002C, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_8_1 = UNIT_END + 0x002D, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_8_2 = UNIT_END + 0x002E, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_8_3 = UNIT_END + 0x002F, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE - PLAYER_QUEST_LOG_8_5 = UNIT_END + 0x0031, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_9_1 = UNIT_END + 0x0032, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_9_2 = UNIT_END + 0x0033, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_9_3 = UNIT_END + 0x0034, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE - PLAYER_QUEST_LOG_9_5 = UNIT_END + 0x0036, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_10_1 = UNIT_END + 0x0037, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_10_2 = UNIT_END + 0x0038, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_10_3 = UNIT_END + 0x0039, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE - PLAYER_QUEST_LOG_10_5 = UNIT_END + 0x003B, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_11_1 = UNIT_END + 0x003C, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_11_2 = UNIT_END + 0x003D, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_11_3 = UNIT_END + 0x003E, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE - PLAYER_QUEST_LOG_11_5 = UNIT_END + 0x0040, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_12_1 = UNIT_END + 0x0041, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_12_2 = UNIT_END + 0x0042, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_12_3 = UNIT_END + 0x0043, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE - PLAYER_QUEST_LOG_12_5 = UNIT_END + 0x0045, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_13_1 = UNIT_END + 0x0046, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_13_2 = UNIT_END + 0x0047, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_13_3 = UNIT_END + 0x0048, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE - PLAYER_QUEST_LOG_13_5 = UNIT_END + 0x004A, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_14_1 = UNIT_END + 0x004B, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_14_2 = UNIT_END + 0x004C, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_14_3 = UNIT_END + 0x004D, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE - PLAYER_QUEST_LOG_14_5 = UNIT_END + 0x004F, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_15_1 = UNIT_END + 0x0050, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_15_2 = UNIT_END + 0x0051, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_15_3 = UNIT_END + 0x0052, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE - PLAYER_QUEST_LOG_15_5 = UNIT_END + 0x0054, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_16_1 = UNIT_END + 0x0055, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_16_2 = UNIT_END + 0x0056, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_16_3 = UNIT_END + 0x0057, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE - PLAYER_QUEST_LOG_16_5 = UNIT_END + 0x0059, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_17_1 = UNIT_END + 0x005A, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_17_2 = UNIT_END + 0x005B, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_17_3 = UNIT_END + 0x005C, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE - PLAYER_QUEST_LOG_17_5 = UNIT_END + 0x005E, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_18_1 = UNIT_END + 0x005F, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_18_2 = UNIT_END + 0x0060, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_18_3 = UNIT_END + 0x0061, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE - PLAYER_QUEST_LOG_18_5 = UNIT_END + 0x0063, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_19_1 = UNIT_END + 0x0064, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_19_2 = UNIT_END + 0x0065, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_19_3 = UNIT_END + 0x0066, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE - PLAYER_QUEST_LOG_19_5 = UNIT_END + 0x0068, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_20_1 = UNIT_END + 0x0069, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_20_2 = UNIT_END + 0x006A, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_20_3 = UNIT_END + 0x006B, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE - PLAYER_QUEST_LOG_20_5 = UNIT_END + 0x006D, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_21_1 = UNIT_END + 0x006E, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_21_2 = UNIT_END + 0x006F, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_21_3 = UNIT_END + 0x0070, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE - PLAYER_QUEST_LOG_21_5 = UNIT_END + 0x0072, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_22_1 = UNIT_END + 0x0073, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_22_2 = UNIT_END + 0x0074, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_22_3 = UNIT_END + 0x0075, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE - PLAYER_QUEST_LOG_22_5 = UNIT_END + 0x0077, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_23_1 = UNIT_END + 0x0078, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_23_2 = UNIT_END + 0x0079, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_23_3 = UNIT_END + 0x007A, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE - PLAYER_QUEST_LOG_23_5 = UNIT_END + 0x007C, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_24_1 = UNIT_END + 0x007D, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_24_2 = UNIT_END + 0x007E, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_24_3 = UNIT_END + 0x007F, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE - PLAYER_QUEST_LOG_24_5 = UNIT_END + 0x0081, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_25_1 = UNIT_END + 0x0082, // Size: 1, Type: INT, Flags: PARTY_MEMBER - PLAYER_QUEST_LOG_25_2 = UNIT_END + 0x0083, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_QUEST_LOG_25_3 = UNIT_END + 0x0084, // Size: 2, Type: TWO_SHORT, Flags: PRIVATE - PLAYER_QUEST_LOG_25_5 = UNIT_END + 0x0086, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_VISIBLE_ITEM_1_ENTRYID = UNIT_END + 0x0087, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_1_ENCHANTMENT = UNIT_END + 0x0088, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_2_ENTRYID = UNIT_END + 0x0089, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_2_ENCHANTMENT = UNIT_END + 0x008A, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_3_ENTRYID = UNIT_END + 0x008B, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_3_ENCHANTMENT = UNIT_END + 0x008C, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_4_ENTRYID = UNIT_END + 0x008D, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_4_ENCHANTMENT = UNIT_END + 0x008E, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_5_ENTRYID = UNIT_END + 0x008F, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_5_ENCHANTMENT = UNIT_END + 0x0090, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_6_ENTRYID = UNIT_END + 0x0091, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_6_ENCHANTMENT = UNIT_END + 0x0092, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_7_ENTRYID = UNIT_END + 0x0093, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_7_ENCHANTMENT = UNIT_END + 0x0094, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_8_ENTRYID = UNIT_END + 0x0095, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_8_ENCHANTMENT = UNIT_END + 0x0096, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_9_ENTRYID = UNIT_END + 0x0097, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_9_ENCHANTMENT = UNIT_END + 0x0098, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_10_ENTRYID = UNIT_END + 0x0099, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_10_ENCHANTMENT = UNIT_END + 0x009A, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_11_ENTRYID = UNIT_END + 0x009B, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_11_ENCHANTMENT = UNIT_END + 0x009C, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_12_ENTRYID = UNIT_END + 0x009D, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_12_ENCHANTMENT = UNIT_END + 0x009E, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_13_ENTRYID = UNIT_END + 0x009F, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_13_ENCHANTMENT = UNIT_END + 0x00A0, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_14_ENTRYID = UNIT_END + 0x00A1, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_14_ENCHANTMENT = UNIT_END + 0x00A2, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_15_ENTRYID = UNIT_END + 0x00A3, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_15_ENCHANTMENT = UNIT_END + 0x00A4, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_16_ENTRYID = UNIT_END + 0x00A5, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_16_ENCHANTMENT = UNIT_END + 0x00A6, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_17_ENTRYID = UNIT_END + 0x00A7, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_17_ENCHANTMENT = UNIT_END + 0x00A8, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_18_ENTRYID = UNIT_END + 0x00A9, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_18_ENCHANTMENT = UNIT_END + 0x00AA, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_19_ENTRYID = UNIT_END + 0x00AB, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_19_ENCHANTMENT = UNIT_END + 0x00AC, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_CHOSEN_TITLE = UNIT_END + 0x00AD, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_FAKE_INEBRIATION = UNIT_END + 0x00AE, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_FIELD_PAD_0 = UNIT_END + 0x00AF, // Size: 1, Type: INT, Flags: NONE - PLAYER_FIELD_INV_SLOT_HEAD = UNIT_END + 0x00B0, // Size: 46, Type: LONG, Flags: PRIVATE - PLAYER_FIELD_PACK_SLOT_1 = UNIT_END + 0x00DE, // Size: 32, Type: LONG, Flags: PRIVATE - PLAYER_FIELD_BANK_SLOT_1 = UNIT_END + 0x00FE, // Size: 56, Type: LONG, Flags: PRIVATE - PLAYER_FIELD_BANKBAG_SLOT_1 = UNIT_END + 0x0136, // Size: 14, Type: LONG, Flags: PRIVATE - PLAYER_FIELD_VENDORBUYBACK_SLOT_1 = UNIT_END + 0x0144, // Size: 24, Type: LONG, Flags: PRIVATE - PLAYER_FIELD_KEYRING_SLOT_1 = UNIT_END + 0x015C, // Size: 64, Type: LONG, Flags: PRIVATE - PLAYER_FIELD_CURRENCYTOKEN_SLOT_1 = UNIT_END + 0x019C, // Size: 64, Type: LONG, Flags: PRIVATE - PLAYER_FARSIGHT = UNIT_END + 0x01DC, // Size: 2, Type: LONG, Flags: PRIVATE - PLAYER__FIELD_KNOWN_TITLES = UNIT_END + 0x01DE, // Size: 2, Type: LONG, Flags: PRIVATE - PLAYER__FIELD_KNOWN_TITLES1 = UNIT_END + 0x01E0, // Size: 2, Type: LONG, Flags: PRIVATE - PLAYER__FIELD_KNOWN_TITLES2 = UNIT_END + 0x01E2, // Size: 2, Type: LONG, Flags: PRIVATE - PLAYER_FIELD_KNOWN_CURRENCIES = UNIT_END + 0x01E4, // Size: 2, Type: LONG, Flags: PRIVATE - PLAYER_XP = UNIT_END + 0x01E6, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_NEXT_LEVEL_XP = UNIT_END + 0x01E7, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_SKILL_INFO_1_1 = UNIT_END + 0x01E8, // Size: 384, Type: TWO_SHORT, Flags: PRIVATE - PLAYER_CHARACTER_POINTS1 = UNIT_END + 0x0368, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_CHARACTER_POINTS2 = UNIT_END + 0x0369, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_TRACK_CREATURES = UNIT_END + 0x036A, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_TRACK_RESOURCES = UNIT_END + 0x036B, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_BLOCK_PERCENTAGE = UNIT_END + 0x036C, // Size: 1, Type: FLOAT, Flags: PRIVATE - PLAYER_DODGE_PERCENTAGE = UNIT_END + 0x036D, // Size: 1, Type: FLOAT, Flags: PRIVATE - PLAYER_PARRY_PERCENTAGE = UNIT_END + 0x036E, // Size: 1, Type: FLOAT, Flags: PRIVATE - PLAYER_EXPERTISE = UNIT_END + 0x036F, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_OFFHAND_EXPERTISE = UNIT_END + 0x0370, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_CRIT_PERCENTAGE = UNIT_END + 0x0371, // Size: 1, Type: FLOAT, Flags: PRIVATE - PLAYER_RANGED_CRIT_PERCENTAGE = UNIT_END + 0x0372, // Size: 1, Type: FLOAT, Flags: PRIVATE - PLAYER_OFFHAND_CRIT_PERCENTAGE = UNIT_END + 0x0373, // Size: 1, Type: FLOAT, Flags: PRIVATE - PLAYER_SPELL_CRIT_PERCENTAGE1 = UNIT_END + 0x0374, // Size: 7, Type: FLOAT, Flags: PRIVATE - PLAYER_SHIELD_BLOCK = UNIT_END + 0x037B, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_SHIELD_BLOCK_CRIT_PERCENTAGE = UNIT_END + 0x037C, // Size: 1, Type: FLOAT, Flags: PRIVATE - PLAYER_EXPLORED_ZONES_1 = UNIT_END + 0x037D, // Size: 128, Type: BYTES, Flags: PRIVATE - PLAYER_REST_STATE_EXPERIENCE = UNIT_END + 0x03FD, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_FIELD_COINAGE = UNIT_END + 0x03FE, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_FIELD_MOD_DAMAGE_DONE_POS = UNIT_END + 0x03FF, // Size: 7, Type: INT, Flags: PRIVATE - PLAYER_FIELD_MOD_DAMAGE_DONE_NEG = UNIT_END + 0x0406, // Size: 7, Type: INT, Flags: PRIVATE - PLAYER_FIELD_MOD_DAMAGE_DONE_PCT = UNIT_END + 0x040D, // Size: 7, Type: INT, Flags: PRIVATE - PLAYER_FIELD_MOD_HEALING_DONE_POS = UNIT_END + 0x0414, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_FIELD_MOD_HEALING_PCT = UNIT_END + 0x0415, // Size: 1, Type: FLOAT, Flags: PRIVATE - PLAYER_FIELD_MOD_HEALING_DONE_PCT = UNIT_END + 0x0416, // Size: 1, Type: FLOAT, Flags: PRIVATE - PLAYER_FIELD_MOD_TARGET_RESISTANCE = UNIT_END + 0x0417, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_FIELD_MOD_TARGET_PHYSICAL_RESISTANCE = UNIT_END + 0x0418, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_FIELD_BYTES = UNIT_END + 0x0419, // Size: 1, Type: BYTES, Flags: PRIVATE - PLAYER_AMMO_ID = UNIT_END + 0x041A, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_SELF_RES_SPELL = UNIT_END + 0x041B, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_FIELD_PVP_MEDALS = UNIT_END + 0x041C, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_FIELD_BUYBACK_PRICE_1 = UNIT_END + 0x041D, // Size: 12, Type: INT, Flags: PRIVATE - PLAYER_FIELD_BUYBACK_TIMESTAMP_1 = UNIT_END + 0x0429, // Size: 12, Type: INT, Flags: PRIVATE - PLAYER_FIELD_KILLS = UNIT_END + 0x0435, // Size: 1, Type: TWO_SHORT, Flags: PRIVATE - PLAYER_FIELD_TODAY_CONTRIBUTION = UNIT_END + 0x0436, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_FIELD_YESTERDAY_CONTRIBUTION = UNIT_END + 0x0437, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_FIELD_LIFETIME_HONORABLE_KILLS = UNIT_END + 0x0438, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_FIELD_BYTES2 = UNIT_END + 0x0439, // Size: 1, Type: 6, Flags: PRIVATE - PLAYER_FIELD_WATCHED_FACTION_INDEX = UNIT_END + 0x043A, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_FIELD_COMBAT_RATING_1 = UNIT_END + 0x043B, // Size: 25, Type: INT, Flags: PRIVATE - PLAYER_FIELD_ARENA_TEAM_INFO_1_1 = UNIT_END + 0x0454, // Size: 21, Type: INT, Flags: PRIVATE - PLAYER_FIELD_HONOR_CURRENCY = UNIT_END + 0x0469, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_FIELD_ARENA_CURRENCY = UNIT_END + 0x046A, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_FIELD_MAX_LEVEL = UNIT_END + 0x046B, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_FIELD_DAILY_QUESTS_1 = UNIT_END + 0x046C, // Size: 25, Type: INT, Flags: PRIVATE - PLAYER_RUNE_REGEN_1 = UNIT_END + 0x0485, // Size: 4, Type: FLOAT, Flags: PRIVATE - PLAYER_NO_REAGENT_COST_1 = UNIT_END + 0x0489, // Size: 3, Type: INT, Flags: PRIVATE - PLAYER_FIELD_GLYPH_SLOTS_1 = UNIT_END + 0x048C, // Size: 6, Type: INT, Flags: PRIVATE - PLAYER_FIELD_GLYPHS_1 = UNIT_END + 0x0492, // Size: 6, Type: INT, Flags: PRIVATE - PLAYER_GLYPHS_ENABLED = UNIT_END + 0x0498, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_PET_SPELL_POWER = UNIT_END + 0x0499, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_END = UNIT_END + 0x049A, + PLAYER_GUILDRANK = UNIT_END + 0x0003, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_GUILDDELETE_DATE = UNIT_END + 0x0004, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_GUILDLEVEL = UNIT_END + 0x0005, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_BYTES = UNIT_END + 0x0006, // Size: 1, Type: BYTES, Flags: PUBLIC + PLAYER_BYTES_2 = UNIT_END + 0x0007, // Size: 1, Type: BYTES, Flags: PUBLIC + PLAYER_BYTES_3 = UNIT_END + 0x0008, // Size: 1, Type: BYTES, Flags: PUBLIC + PLAYER_DUEL_TEAM = UNIT_END + 0x0009, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_GUILD_TIMESTAMP = UNIT_END + 0x000A, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_QUEST_LOG_1_1 = UNIT_END + 0x000B, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_1_2 = UNIT_END + 0x000C, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_1_3 = UNIT_END + 0x000D, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_1_4 = UNIT_END + 0x000F, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_2_1 = UNIT_END + 0x0010, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_2_2 = UNIT_END + 0x0011, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_2_3 = UNIT_END + 0x0012, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_2_5 = UNIT_END + 0x0014, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_3_1 = UNIT_END + 0x0015, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_3_2 = UNIT_END + 0x0016, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_3_3 = UNIT_END + 0x0017, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_3_5 = UNIT_END + 0x0019, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_4_1 = UNIT_END + 0x001A, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_4_2 = UNIT_END + 0x001B, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_4_3 = UNIT_END + 0x001C, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_4_5 = UNIT_END + 0x001E, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_5_1 = UNIT_END + 0x001F, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_5_2 = UNIT_END + 0x0020, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_5_3 = UNIT_END + 0x0021, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_5_5 = UNIT_END + 0x0023, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_6_1 = UNIT_END + 0x0024, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_6_2 = UNIT_END + 0x0025, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_6_3 = UNIT_END + 0x0026, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_6_5 = UNIT_END + 0x0028, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_7_1 = UNIT_END + 0x0029, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_7_2 = UNIT_END + 0x002A, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_7_3 = UNIT_END + 0x002B, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_7_5 = UNIT_END + 0x002D, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_8_1 = UNIT_END + 0x002E, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_8_2 = UNIT_END + 0x002F, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_8_3 = UNIT_END + 0x0030, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_8_5 = UNIT_END + 0x0032, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_9_1 = UNIT_END + 0x0033, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_9_2 = UNIT_END + 0x0034, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_9_3 = UNIT_END + 0x0035, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_9_5 = UNIT_END + 0x0037, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_10_1 = UNIT_END + 0x0038, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_10_2 = UNIT_END + 0x0039, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_10_3 = UNIT_END + 0x003A, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_10_5 = UNIT_END + 0x003C, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_11_1 = UNIT_END + 0x003D, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_11_2 = UNIT_END + 0x003E, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_11_3 = UNIT_END + 0x003F, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_11_5 = UNIT_END + 0x0041, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_12_1 = UNIT_END + 0x0042, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_12_2 = UNIT_END + 0x0043, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_12_3 = UNIT_END + 0x0044, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_12_5 = UNIT_END + 0x0046, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_13_1 = UNIT_END + 0x0047, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_13_2 = UNIT_END + 0x0048, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_13_3 = UNIT_END + 0x0049, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_13_5 = UNIT_END + 0x004B, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_14_1 = UNIT_END + 0x004C, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_14_2 = UNIT_END + 0x004D, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_14_3 = UNIT_END + 0x004E, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_14_5 = UNIT_END + 0x0050, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_15_1 = UNIT_END + 0x0051, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_15_2 = UNIT_END + 0x0052, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_15_3 = UNIT_END + 0x0053, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_15_5 = UNIT_END + 0x0055, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_16_1 = UNIT_END + 0x0056, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_16_2 = UNIT_END + 0x0057, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_16_3 = UNIT_END + 0x0058, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_16_5 = UNIT_END + 0x005A, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_17_1 = UNIT_END + 0x005B, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_17_2 = UNIT_END + 0x005C, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_17_3 = UNIT_END + 0x005D, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_17_5 = UNIT_END + 0x005F, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_18_1 = UNIT_END + 0x0060, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_18_2 = UNIT_END + 0x0061, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_18_3 = UNIT_END + 0x0062, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_18_5 = UNIT_END + 0x0064, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_19_1 = UNIT_END + 0x0065, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_19_2 = UNIT_END + 0x0066, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_19_3 = UNIT_END + 0x0067, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_19_5 = UNIT_END + 0x0069, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_20_1 = UNIT_END + 0x006A, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_20_2 = UNIT_END + 0x006B, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_20_3 = UNIT_END + 0x006C, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_20_5 = UNIT_END + 0x006E, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_21_1 = UNIT_END + 0x006F, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_21_2 = UNIT_END + 0x0070, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_21_3 = UNIT_END + 0x0071, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_21_5 = UNIT_END + 0x0073, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_22_1 = UNIT_END + 0x0074, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_22_2 = UNIT_END + 0x0075, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_22_3 = UNIT_END + 0x0076, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_22_5 = UNIT_END + 0x0078, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_23_1 = UNIT_END + 0x0079, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_23_2 = UNIT_END + 0x007A, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_23_3 = UNIT_END + 0x007B, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_23_5 = UNIT_END + 0x007D, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_24_1 = UNIT_END + 0x007E, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_24_2 = UNIT_END + 0x007F, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_24_3 = UNIT_END + 0x0080, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_24_5 = UNIT_END + 0x0082, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_25_1 = UNIT_END + 0x0083, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_25_2 = UNIT_END + 0x0084, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_25_3 = UNIT_END + 0x0085, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_25_5 = UNIT_END + 0x0087, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_26_1 = UNIT_END + 0x0088, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_26_2 = UNIT_END + 0x0089, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_26_3 = UNIT_END + 0x008A, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_26_5 = UNIT_END + 0x008C, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_27_1 = UNIT_END + 0x008D, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_27_2 = UNIT_END + 0x008E, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_27_3 = UNIT_END + 0x008F, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_27_5 = UNIT_END + 0x0091, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_28_1 = UNIT_END + 0x0092, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_28_2 = UNIT_END + 0x0093, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_28_3 = UNIT_END + 0x0094, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_28_5 = UNIT_END + 0x0096, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_29_1 = UNIT_END + 0x0097, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_29_2 = UNIT_END + 0x0098, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_29_3 = UNIT_END + 0x0099, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_29_5 = UNIT_END + 0x009B, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_30_1 = UNIT_END + 0x009C, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_30_2 = UNIT_END + 0x009D, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_30_3 = UNIT_END + 0x009E, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_30_5 = UNIT_END + 0x00A0, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_31_1 = UNIT_END + 0x00A1, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_31_2 = UNIT_END + 0x00A2, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_31_3 = UNIT_END + 0x00A3, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_31_5 = UNIT_END + 0x00A5, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_32_1 = UNIT_END + 0x00A6, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_32_2 = UNIT_END + 0x00A7, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_32_3 = UNIT_END + 0x00A8, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_32_5 = UNIT_END + 0x00AA, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_33_1 = UNIT_END + 0x00AB, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_33_2 = UNIT_END + 0x00AC, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_33_3 = UNIT_END + 0x00AD, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_33_5 = UNIT_END + 0x00AF, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_34_1 = UNIT_END + 0x00B0, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_34_2 = UNIT_END + 0x00B1, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_34_3 = UNIT_END + 0x00B2, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_34_5 = UNIT_END + 0x00B4, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_35_1 = UNIT_END + 0x00B5, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_35_2 = UNIT_END + 0x00B6, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_35_3 = UNIT_END + 0x00B7, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_35_5 = UNIT_END + 0x00B9, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_36_1 = UNIT_END + 0x00BA, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_36_2 = UNIT_END + 0x00BB, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_36_3 = UNIT_END + 0x00BC, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_36_5 = UNIT_END + 0x00BE, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_37_1 = UNIT_END + 0x00BF, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_37_2 = UNIT_END + 0x00C0, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_37_3 = UNIT_END + 0x00C1, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_37_5 = UNIT_END + 0x00C3, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_38_1 = UNIT_END + 0x00C4, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_38_2 = UNIT_END + 0x00C5, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_38_3 = UNIT_END + 0x00C6, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_38_5 = UNIT_END + 0x00C8, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_39_1 = UNIT_END + 0x00C9, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_39_2 = UNIT_END + 0x00CA, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_39_3 = UNIT_END + 0x00CB, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_39_5 = UNIT_END + 0x00CD, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_40_1 = UNIT_END + 0x00CE, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_40_2 = UNIT_END + 0x00CF, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_40_3 = UNIT_END + 0x00D0, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_40_5 = UNIT_END + 0x00D2, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_41_1 = UNIT_END + 0x00D3, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_41_2 = UNIT_END + 0x00D4, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_41_3 = UNIT_END + 0x00D5, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_41_5 = UNIT_END + 0x00D7, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_42_1 = UNIT_END + 0x00D8, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_42_2 = UNIT_END + 0x00D9, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_42_3 = UNIT_END + 0x00DA, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_42_5 = UNIT_END + 0x00DC, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_43_1 = UNIT_END + 0x00DD, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_43_2 = UNIT_END + 0x00DE, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_43_3 = UNIT_END + 0x00DF, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_43_5 = UNIT_END + 0x00E1, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_44_1 = UNIT_END + 0x00E2, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_44_2 = UNIT_END + 0x00E3, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_44_3 = UNIT_END + 0x00E4, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_44_5 = UNIT_END + 0x00E6, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_45_1 = UNIT_END + 0x00E7, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_45_2 = UNIT_END + 0x00E8, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_45_3 = UNIT_END + 0x00E9, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_45_5 = UNIT_END + 0x00EB, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_46_1 = UNIT_END + 0x00EC, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_46_2 = UNIT_END + 0x00ED, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_46_3 = UNIT_END + 0x00EE, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_46_5 = UNIT_END + 0x00F0, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_47_1 = UNIT_END + 0x00F1, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_47_2 = UNIT_END + 0x00F2, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_47_3 = UNIT_END + 0x00F3, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_47_5 = UNIT_END + 0x00F5, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_48_1 = UNIT_END + 0x00F6, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_48_2 = UNIT_END + 0x00F7, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_48_3 = UNIT_END + 0x00F8, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_48_5 = UNIT_END + 0x00FA, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_49_1 = UNIT_END + 0x00FB, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_49_2 = UNIT_END + 0x00FC, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_49_3 = UNIT_END + 0x00FD, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_49_5 = UNIT_END + 0x00FF, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_50_1 = UNIT_END + 0x0100, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_50_2 = UNIT_END + 0x0101, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_50_3 = UNIT_END + 0x0102, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_50_5 = UNIT_END + 0x0104, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_VISIBLE_ITEM_1_ENTRYID = UNIT_END + 0x0105, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_1_ENCHANTMENT = UNIT_END + 0x0106, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_2_ENTRYID = UNIT_END + 0x0107, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_2_ENCHANTMENT = UNIT_END + 0x0108, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_3_ENTRYID = UNIT_END + 0x0109, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_3_ENCHANTMENT = UNIT_END + 0x010A, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_4_ENTRYID = UNIT_END + 0x010B, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_4_ENCHANTMENT = UNIT_END + 0x010C, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_5_ENTRYID = UNIT_END + 0x010D, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_5_ENCHANTMENT = UNIT_END + 0x010E, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_6_ENTRYID = UNIT_END + 0x010F, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_6_ENCHANTMENT = UNIT_END + 0x0110, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_7_ENTRYID = UNIT_END + 0x0111, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_7_ENCHANTMENT = UNIT_END + 0x0112, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_8_ENTRYID = UNIT_END + 0x0113, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_8_ENCHANTMENT = UNIT_END + 0x0114, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_9_ENTRYID = UNIT_END + 0x0115, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_9_ENCHANTMENT = UNIT_END + 0x0116, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_10_ENTRYID = UNIT_END + 0x0117, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_10_ENCHANTMENT = UNIT_END + 0x0118, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_11_ENTRYID = UNIT_END + 0x0119, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_11_ENCHANTMENT = UNIT_END + 0x011A, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_12_ENTRYID = UNIT_END + 0x011B, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_12_ENCHANTMENT = UNIT_END + 0x011C, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_13_ENTRYID = UNIT_END + 0x011D, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_13_ENCHANTMENT = UNIT_END + 0x011E, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_14_ENTRYID = UNIT_END + 0x011F, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_14_ENCHANTMENT = UNIT_END + 0x0120, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_15_ENTRYID = UNIT_END + 0x0121, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_15_ENCHANTMENT = UNIT_END + 0x0122, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_16_ENTRYID = UNIT_END + 0x0123, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_16_ENCHANTMENT = UNIT_END + 0x0124, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_17_ENTRYID = UNIT_END + 0x0125, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_17_ENCHANTMENT = UNIT_END + 0x0126, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_18_ENTRYID = UNIT_END + 0x0127, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_18_ENCHANTMENT = UNIT_END + 0x0128, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_19_ENTRYID = UNIT_END + 0x0129, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_19_ENCHANTMENT = UNIT_END + 0x012A, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_CHOSEN_TITLE = UNIT_END + 0x012B, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_FAKE_INEBRIATION = UNIT_END + 0x012C, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_FIELD_PAD_0 = UNIT_END + 0x012D, // Size: 1, Type: INT, Flags: NONE + PLAYER_FIELD_INV_SLOT_HEAD = UNIT_END + 0x012E, // Size: 46, Type: LONG, Flags: PRIVATE + PLAYER_FIELD_PACK_SLOT_1 = UNIT_END + 0x015C, // Size: 32, Type: LONG, Flags: PRIVATE + PLAYER_FIELD_BANK_SLOT_1 = UNIT_END + 0x017C, // Size: 56, Type: LONG, Flags: PRIVATE + PLAYER_FIELD_BANKBAG_SLOT_1 = UNIT_END + 0x01B4, // Size: 14, Type: LONG, Flags: PRIVATE + PLAYER_FIELD_VENDORBUYBACK_SLOT_1 = UNIT_END + 0x01C2, // Size: 24, Type: LONG, Flags: PRIVATE + PLAYER_FARSIGHT = UNIT_END + 0x01DA, // Size: 2, Type: LONG, Flags: PRIVATE + PLAYER__FIELD_KNOWN_TITLES = UNIT_END + 0x01DC, // Size: 2, Type: LONG, Flags: PRIVATE + PLAYER__FIELD_KNOWN_TITLES1 = UNIT_END + 0x01DE, // Size: 2, Type: LONG, Flags: PRIVATE + PLAYER__FIELD_KNOWN_TITLES2 = UNIT_END + 0x01E0, // Size: 2, Type: LONG, Flags: PRIVATE + PLAYER_XP = UNIT_END + 0x01E2, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_NEXT_LEVEL_XP = UNIT_END + 0x01E3, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_SKILL_INFO_1_1 = UNIT_END + 0x01E4, // Size: 384, Type: TWO_SHORT, Flags: PRIVATE + PLAYER_CHARACTER_POINTS = UNIT_END + 0x0364, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_TRACK_CREATURES = UNIT_END + 0x0365, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_TRACK_RESOURCES = UNIT_END + 0x0366, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_EXPERTISE = UNIT_END + 0x0367, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_OFFHAND_EXPERTISE = UNIT_END + 0x0368, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_BLOCK_PERCENTAGE = UNIT_END + 0x0369, // Size: 1, Type: FLOAT, Flags: PRIVATE + PLAYER_DODGE_PERCENTAGE = UNIT_END + 0x036A, // Size: 1, Type: FLOAT, Flags: PRIVATE + PLAYER_PARRY_PERCENTAGE = UNIT_END + 0x036B, // Size: 1, Type: FLOAT, Flags: PRIVATE + PLAYER_CRIT_PERCENTAGE = UNIT_END + 0x036C, // Size: 1, Type: FLOAT, Flags: PRIVATE + PLAYER_RANGED_CRIT_PERCENTAGE = UNIT_END + 0x036D, // Size: 1, Type: FLOAT, Flags: PRIVATE + PLAYER_OFFHAND_CRIT_PERCENTAGE = UNIT_END + 0x036E, // Size: 1, Type: FLOAT, Flags: PRIVATE + PLAYER_SPELL_CRIT_PERCENTAGE1 = UNIT_END + 0x036F, // Size: 7, Type: FLOAT, Flags: PRIVATE + PLAYER_SHIELD_BLOCK = UNIT_END + 0x0376, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_SHIELD_BLOCK_CRIT_PERCENTAGE = UNIT_END + 0x0377, // Size: 1, Type: FLOAT, Flags: PRIVATE + PLAYER_MASTERY = UNIT_END + 0x0378, // Size: 1, Type: FLOAT, Flags: PRIVATE + PLAYER_EXPLORED_ZONES_1 = UNIT_END + 0x0379, // Size: 144, Type: BYTES, Flags: PRIVATE + PLAYER_REST_STATE_EXPERIENCE = UNIT_END + 0x0409, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_FIELD_COINAGE = UNIT_END + 0x040A, // Size: 2, Type: LONG, Flags: PRIVATE + PLAYER_FIELD_MOD_DAMAGE_DONE_POS = UNIT_END + 0x040C, // Size: 7, Type: INT, Flags: PRIVATE + PLAYER_FIELD_MOD_DAMAGE_DONE_NEG = UNIT_END + 0x0413, // Size: 7, Type: INT, Flags: PRIVATE + PLAYER_FIELD_MOD_DAMAGE_DONE_PCT = UNIT_END + 0x041A, // Size: 7, Type: INT, Flags: PRIVATE + PLAYER_FIELD_MOD_HEALING_DONE_POS = UNIT_END + 0x0421, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_FIELD_MOD_HEALING_PCT = UNIT_END + 0x0422, // Size: 1, Type: FLOAT, Flags: PRIVATE + PLAYER_FIELD_MOD_HEALING_DONE_PCT = UNIT_END + 0x0423, // Size: 1, Type: FLOAT, Flags: PRIVATE + PLAYER_FIELD_WEAPON_DMG_MULTIPLIERS = UNIT_END + 0x0424, // Size: 3, Type: FLOAT, Flags: PRIVATE + PLAYER_FIELD_MOD_SPELL_POWER_PCT = UNIT_END + 0x0427, // Size: 1, Type: FLOAT, Flags: PRIVATE + PLAYER_FIELD_MOD_TARGET_RESISTANCE = UNIT_END + 0x0428, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_FIELD_MOD_TARGET_PHYSICAL_RESISTANCE = UNIT_END + 0x0429, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_FIELD_BYTES = UNIT_END + 0x042A, // Size: 1, Type: BYTES, Flags: PRIVATE + PLAYER_SELF_RES_SPELL = UNIT_END + 0x042B, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_FIELD_PVP_MEDALS = UNIT_END + 0x042C, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_FIELD_BUYBACK_PRICE_1 = UNIT_END + 0x042D, // Size: 12, Type: INT, Flags: PRIVATE + PLAYER_FIELD_BUYBACK_TIMESTAMP_1 = UNIT_END + 0x0439, // Size: 12, Type: INT, Flags: PRIVATE + PLAYER_FIELD_KILLS = UNIT_END + 0x0445, // Size: 1, Type: TWO_SHORT, Flags: PRIVATE + PLAYER_FIELD_LIFETIME_HONORABLE_KILLS = UNIT_END + 0x0446, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_FIELD_BYTES2 = UNIT_END + 0x0447, // Size: 1, Type: 6, Flags: PRIVATE + PLAYER_FIELD_WATCHED_FACTION_INDEX = UNIT_END + 0x0448, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_FIELD_COMBAT_RATING_1 = UNIT_END + 0x0449, // Size: 26, Type: INT, Flags: PRIVATE + PLAYER_FIELD_ARENA_TEAM_INFO_1_1 = UNIT_END + 0x0463, // Size: 21, Type: INT, Flags: PRIVATE + PLAYER_FIELD_BATTLEGROUND_RATING = UNIT_END + 0x0478, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_FIELD_MAX_LEVEL = UNIT_END + 0x0479, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_FIELD_DAILY_QUESTS_1 = UNIT_END + 0x047A, // Size: 25, Type: INT, Flags: PRIVATE + PLAYER_RUNE_REGEN_1 = UNIT_END + 0x0493, // Size: 4, Type: FLOAT, Flags: PRIVATE + PLAYER_NO_REAGENT_COST_1 = UNIT_END + 0x0497, // Size: 3, Type: INT, Flags: PRIVATE + PLAYER_FIELD_GLYPH_SLOTS_1 = UNIT_END + 0x049A, // Size: 9, Type: INT, Flags: PRIVATE + PLAYER_FIELD_GLYPHS_1 = UNIT_END + 0x04A3, // Size: 9, Type: INT, Flags: PRIVATE + PLAYER_GLYPHS_ENABLED = UNIT_END + 0x04AC, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_PET_SPELL_POWER = UNIT_END + 0x04AD, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_FIELD_RESEARCHING_1 = UNIT_END + 0x04AE, // Size: 8, Type: TWO_SHORT, Flags: PRIVATE + PLAYER_FIELD_RESERACH_SITE_1 = UNIT_END + 0x04B6, // Size: 8, Type: TWO_SHORT, Flags: PRIVATE + PLAYER_PROFESSION_SKILL_LINE_1 = UNIT_END + 0x04BE, // Size: 2, Type: INT, Flags: PRIVATE + PLAYER_FIELD_UI_HIT_MODIFIER = UNIT_END + 0x04C0, // Size: 1, Type: FLOAT, Flags: PRIVATE + PLAYER_FIELD_UI_SPELL_HIT_MODIFIER = UNIT_END + 0x04C1, // Size: 1, Type: FLOAT, Flags: PRIVATE + PLAYER_FIELD_HOME_REALM_TIME_OFFSET = UNIT_END + 0x04C2, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_FIELD_MOD_HASTE = UNIT_END + 0x04C3, // Size: 1, Type: FLOAT, Flags: PRIVATE + PLAYER_FIELD_MOD_RANGED_HASTE = UNIT_END + 0x04C4, // Size: 1, Type: FLOAT, Flags: PRIVATE + PLAYER_FIELD_MOD_PET_HASTE = UNIT_END + 0x04C5, // Size: 1, Type: FLOAT, Flags: PRIVATE + PLAYER_FIELD_MOD_HASTE_REGEN = UNIT_END + 0x04C6, // Size: 1, Type: FLOAT, Flags: PRIVATE + PLAYER_FIELD_PADDING = UNIT_END + 0x04C7, // Size: 1, Type: INT, Flags: NONE + PLAYER_END = UNIT_END + 0x04C8, }; enum EGameObjectFields @@ -399,7 +523,7 @@ enum EGameObjectFields GAMEOBJECT_DISPLAYID = OBJECT_END + 0x0002, // Size: 1, Type: INT, Flags: PUBLIC GAMEOBJECT_FLAGS = OBJECT_END + 0x0003, // Size: 1, Type: INT, Flags: PUBLIC GAMEOBJECT_PARENTROTATION = OBJECT_END + 0x0004, // Size: 4, Type: FLOAT, Flags: PUBLIC - GAMEOBJECT_DYNAMIC = OBJECT_END + 0x0008, // Size: 1, Type: TWO_SHORT, Flags: DYNAMIC + GAMEOBJECT_DYNAMIC = OBJECT_END + 0x0008, // Size: 1, Type: TWO_SHORT, Flags: UNUSED2 GAMEOBJECT_FACTION = OBJECT_END + 0x0009, // Size: 1, Type: INT, Flags: PUBLIC GAMEOBJECT_LEVEL = OBJECT_END + 0x000A, // Size: 1, Type: INT, Flags: PUBLIC GAMEOBJECT_BYTES_1 = OBJECT_END + 0x000B, // Size: 1, Type: BYTES, Flags: PUBLIC @@ -409,7 +533,7 @@ enum EGameObjectFields enum EDynamicObjectFields { DYNAMICOBJECT_CASTER = OBJECT_END + 0x0000, // Size: 2, Type: LONG, Flags: PUBLIC - DYNAMICOBJECT_BYTES = OBJECT_END + 0x0002, // Size: 1, Type: BYTES, Flags: PUBLIC + DYNAMICOBJECT_BYTES = OBJECT_END + 0x0002, // Size: 1, Type: INT, Flags: UNUSED2 DYNAMICOBJECT_SPELLID = OBJECT_END + 0x0003, // Size: 1, Type: INT, Flags: PUBLIC DYNAMICOBJECT_RADIUS = OBJECT_END + 0x0004, // Size: 1, Type: FLOAT, Flags: PUBLIC DYNAMICOBJECT_CASTTIME = OBJECT_END + 0x0005, // Size: 1, Type: INT, Flags: PUBLIC @@ -424,10 +548,8 @@ enum ECorpseFields CORPSE_FIELD_ITEM = OBJECT_END + 0x0005, // Size: 19, Type: INT, Flags: PUBLIC CORPSE_FIELD_BYTES_1 = OBJECT_END + 0x0018, // Size: 1, Type: BYTES, Flags: PUBLIC CORPSE_FIELD_BYTES_2 = OBJECT_END + 0x0019, // Size: 1, Type: BYTES, Flags: PUBLIC - CORPSE_FIELD_GUILD = OBJECT_END + 0x001A, // Size: 1, Type: INT, Flags: PUBLIC - CORPSE_FIELD_FLAGS = OBJECT_END + 0x001B, // Size: 1, Type: INT, Flags: PUBLIC - CORPSE_FIELD_DYNAMIC_FLAGS = OBJECT_END + 0x001C, // Size: 1, Type: INT, Flags: DYNAMIC - CORPSE_FIELD_PAD = OBJECT_END + 0x001D, // Size: 1, Type: INT, Flags: NONE - CORPSE_END = OBJECT_END + 0x001E, + CORPSE_FIELD_FLAGS = OBJECT_END + 0x001A, // Size: 1, Type: INT, Flags: PUBLIC + CORPSE_FIELD_DYNAMIC_FLAGS = OBJECT_END + 0x001B, // Size: 1, Type: INT, Flags: UNUSED2 + CORPSE_END = OBJECT_END + 0x001C, }; #endif -- cgit v1.2.3 From cf0d5e4ec87b00baf19f89146e8c4a028a9a9038 Mon Sep 17 00:00:00 2001 From: kaelima Date: Fri, 25 Nov 2011 13:33:11 +0100 Subject: Core/Enum: Add missing race and powers from dbc --- src/server/game/Miscellaneous/SharedDefines.h | 59 +++++++++++++++------------ 1 file changed, 32 insertions(+), 27 deletions(-) (limited to 'src') diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 8cb9056ed07..9bca1c15423 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -53,33 +53,34 @@ enum Gender // Race value is index in ChrRaces.dbc enum Races { - RACE_NONE = 0, - RACE_HUMAN = 1, - RACE_ORC = 2, - RACE_DWARF = 3, - RACE_NIGHTELF = 4, - RACE_UNDEAD_PLAYER = 5, - RACE_TAUREN = 6, - RACE_GNOME = 7, - RACE_TROLL = 8, - RACE_GOBLIN = 9, - RACE_BLOODELF = 10, - RACE_DRAENEI = 11, - //RACE_FEL_ORC = 12, - //RACE_NAGA = 13, - //RACE_BROKEN = 14, - //RACE_SKELETON = 15, - //RACE_VRYKUL = 16, - //RACE_TUSKARR = 17, - //RACE_FOREST_TROLL = 18, - //RACE_TAUNKA = 19, + RACE_NONE = 0, + RACE_HUMAN = 1, + RACE_ORC = 2, + RACE_DWARF = 3, + RACE_NIGHTELF = 4, + RACE_UNDEAD_PLAYER = 5, + RACE_TAUREN = 6, + RACE_GNOME = 7, + RACE_TROLL = 8, + RACE_GOBLIN = 9, + RACE_BLOODELF = 10, + RACE_DRAENEI = 11, + //RACE_FEL_ORC = 12, + //RACE_NAGA = 13, + //RACE_BROKEN = 14, + //RACE_SKELETON = 15, + //RACE_VRYKUL = 16, + //RACE_TUSKARR = 17, + //RACE_FOREST_TROLL = 18, + //RACE_TAUNKA = 19, //RACE_NORTHREND_SKELETON = 20, - //RACE_ICE_TROLL = 21, - RACE_WORGEN = 22 + //RACE_ICE_TROLL = 21, + RACE_WORGEN = 22, + RACE_GILNEAN = 23 }; // max+1 for player race -#define MAX_RACES 12 +#define MAX_RACES 24 #define RACEMASK_ALL_PLAYABLE \ ((1<<(RACE_HUMAN-1)) |(1<<(RACE_ORC-1)) |(1<<(RACE_DWARF-1)) | \ @@ -174,11 +175,14 @@ enum Powers POWER_RAGE = 1, POWER_FOCUS = 2, POWER_ENERGY = 3, - POWER_HAPPINESS = 4, POWER_RUNE = 5, POWER_RUNIC_POWER = 6, - MAX_POWERS = 7, - POWER_ALL = 127, // default for class? + POWER_SOULSHARD = 7, + POWER_ECLIPSE = 8, + POWER_HOLY_POWER = 9, + POWER_ALTERNATIVE = 10, // Used in some quests + MAX_POWERS = 11, + POWER_ALL = 127, // default for class? POWER_HEALTH = 0xFFFFFFFE // (-2 as signed value) }; @@ -1231,7 +1235,8 @@ enum Mechanics MECHANIC_DISCOVERY = 28, MECHANIC_IMMUNE_SHIELD = 29, // Divine (Blessing) Shield/Protection and Ice Block MECHANIC_SAPPED = 30, - MECHANIC_ENRAGED = 31 + MECHANIC_ENRAGED = 31, + MECHANIC_WOUNDED = 32, }; // Used for spell 42292 Immune Movement Impairment and Loss of Control (0x49967ca6) -- cgit v1.2.3 From 9696d6ba7b02b722b4a03e253ffa653e16940af1 Mon Sep 17 00:00:00 2001 From: kaelima Date: Fri, 25 Nov 2011 15:28:36 +0100 Subject: Core/Mechanics: - Add basic support for focus used by players (hunters) - Drop all support for pet happieness (as it has been completely removed) - Add new fields to characters db to store new power values (Should now be able to create characters again) --- sql/base/characters_database.sql | 9 ++- .../2011_11_25_00_characters_character_stats.sql | 5 ++ .../2011_11_25_01_characters_characters.sql | 5 ++ .../2011_11_25_02_characters_character_pet.sql | 1 + src/server/game/Entities/Pet/Pet.cpp | 74 +++++----------------- src/server/game/Entities/Pet/Pet.h | 12 ---- src/server/game/Entities/Player/Player.cpp | 55 +++++++++------- src/server/game/Entities/Unit/StatSystem.cpp | 21 ------ src/server/game/Entities/Unit/Unit.cpp | 54 ++++++++-------- src/server/game/Entities/Unit/Unit.h | 9 ++- .../game/Server/Protocol/Handlers/PetHandler.cpp | 8 --- src/server/game/Spells/SpellEffects.cpp | 1 + src/server/game/Spells/SpellInfo.cpp | 1 - .../Database/Implementation/CharacterDatabase.cpp | 2 +- 14 files changed, 101 insertions(+), 156 deletions(-) create mode 100644 sql/updates/characters/2011_11_25_00_characters_character_stats.sql create mode 100644 sql/updates/characters/2011_11_25_01_characters_characters.sql create mode 100644 sql/updates/characters/2011_11_25_02_characters_character_pet.sql (limited to 'src') diff --git a/sql/base/characters_database.sql b/sql/base/characters_database.sql index 6296351f52f..1410a5b0008 100644 --- a/sql/base/characters_database.sql +++ b/sql/base/characters_database.sql @@ -737,7 +737,6 @@ CREATE TABLE `character_pet` ( `slot` tinyint(3) unsigned NOT NULL DEFAULT '0', `curhealth` int(10) unsigned NOT NULL DEFAULT '1', `curmana` int(10) unsigned NOT NULL DEFAULT '0', - `curhappiness` int(10) unsigned NOT NULL DEFAULT '0', `savetime` int(10) unsigned NOT NULL DEFAULT '0', `abdata` text, PRIMARY KEY (`id`), @@ -1034,6 +1033,10 @@ CREATE TABLE `character_stats` ( `maxpower5` int(10) unsigned NOT NULL DEFAULT '0', `maxpower6` int(10) unsigned NOT NULL DEFAULT '0', `maxpower7` int(10) unsigned NOT NULL DEFAULT '0', + `maxpower8` int(10) unsigned NOT NULL DEFAULT '0', + `maxpower9` int(10) unsigned NOT NULL DEFAULT '0', + `maxpower10` int(10) unsigned NOT NULL DEFAULT '0', + `maxpower11` int(10) unsigned NOT NULL DEFAULT '0', `strength` int(10) unsigned NOT NULL DEFAULT '0', `agility` int(10) unsigned NOT NULL DEFAULT '0', `stamina` int(10) unsigned NOT NULL DEFAULT '0', @@ -1160,6 +1163,10 @@ CREATE TABLE `characters` ( `power5` int(10) unsigned NOT NULL DEFAULT '0', `power6` int(10) unsigned NOT NULL DEFAULT '0', `power7` int(10) unsigned NOT NULL DEFAULT '0', + `power8` int(10) unsigned NOT NULL DEFAULT '0', + `power9` int(10) unsigned NOT NULL DEFAULT '0', + `power10` int(10) unsigned NOT NULL DEFAULT '0', + `power11` int(10) unsigned NOT NULL DEFAULT '0', `latency` mediumint(8) unsigned NOT NULL DEFAULT '0', `speccount` tinyint(3) unsigned NOT NULL DEFAULT '1', `activespec` tinyint(3) unsigned NOT NULL DEFAULT '0', diff --git a/sql/updates/characters/2011_11_25_00_characters_character_stats.sql b/sql/updates/characters/2011_11_25_00_characters_character_stats.sql new file mode 100644 index 00000000000..60506a491e3 --- /dev/null +++ b/sql/updates/characters/2011_11_25_00_characters_character_stats.sql @@ -0,0 +1,5 @@ +ALTER TABLE `character_stats` +ADD COLUMN `maxpower8` int(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `maxpower7`, +ADD COLUMN `maxpower9` int(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `maxpower8`, +ADD COLUMN `maxpower10` int(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `maxpower9`, +ADD COLUMN `maxpower11` int(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `maxpower10`; diff --git a/sql/updates/characters/2011_11_25_01_characters_characters.sql b/sql/updates/characters/2011_11_25_01_characters_characters.sql new file mode 100644 index 00000000000..6e56aaf9aea --- /dev/null +++ b/sql/updates/characters/2011_11_25_01_characters_characters.sql @@ -0,0 +1,5 @@ +ALTER TABLE `characters` +ADD COLUMN `power8` int(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `power7`, +ADD COLUMN `power9` int(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `power8`, +ADD COLUMN `power10` int(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `power9`, +ADD COLUMN `power11` int(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `power10`; diff --git a/sql/updates/characters/2011_11_25_02_characters_character_pet.sql b/sql/updates/characters/2011_11_25_02_characters_character_pet.sql new file mode 100644 index 00000000000..61a1490b219 --- /dev/null +++ b/sql/updates/characters/2011_11_25_02_characters_character_pet.sql @@ -0,0 +1 @@ +ALTER TABLE `character_pet` DROP COLUMN `curhappiness`; diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index 990e5f8c958..3a4e516dccf 100755 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -35,7 +35,7 @@ Pet::Pet(Player* owner, PetType type) : Guardian(NULL, owner), m_usedTalentCount(0), m_removed(false), m_owner(owner), -m_happinessTimer(7500), m_petType(type), m_duration(0), +m_petType(type), m_duration(0), m_auraRaidUpdateMask(0), m_loading(false), m_declinedname(NULL) { m_unitTypeMask |= UNIT_MASK_PET; @@ -102,25 +102,25 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c QueryResult result; if (petnumber) - // known petnumber entry 0 1 2(?) 3 4 5 6 7 8 9 10 11 12 13 14 15 16 - result = CharacterDatabase.PQuery("SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, curhappiness, abdata, savetime, CreatedBySpell, PetType " + // known petnumber entry 0 1 2(?) 3 4 5 6 7 8 9 10 11 12 13 14 15 + result = CharacterDatabase.PQuery("SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, abdata, savetime, CreatedBySpell, PetType " "FROM character_pet WHERE owner = '%u' AND id = '%u'", ownerid, petnumber); else if (current) - // current pet (slot 0) 0 1 2(?) 3 4 5 6 7 8 9 10 11 12 13 14 15 16 - result = CharacterDatabase.PQuery("SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, curhappiness, abdata, savetime, CreatedBySpell, PetType " + // current pet (slot 0) 0 1 2(?) 3 4 5 6 7 8 9 10 11 12 13 14 15 + result = CharacterDatabase.PQuery("SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, abdata, savetime, CreatedBySpell, PetType " "FROM character_pet WHERE owner = '%u' AND slot = '%u'", ownerid, PET_SAVE_AS_CURRENT); else if (petentry) // known petentry entry (unique for summoned pet, but non unique for hunter pet (only from current or not stabled pets) - // 0 1 2(?) 3 4 5 6 7 8 9 10 11 12 13 14 15 16 - result = CharacterDatabase.PQuery("SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, curhappiness, abdata, savetime, CreatedBySpell, PetType " + // 0 1 2(?) 3 4 5 6 7 8 9 10 11 12 13 14 15 + result = CharacterDatabase.PQuery("SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, abdata, savetime, CreatedBySpell, PetType " "FROM character_pet WHERE owner = '%u' AND entry = '%u' AND (slot = '%u' OR slot > '%u') ", ownerid, petentry, PET_SAVE_AS_CURRENT, PET_SAVE_LAST_STABLE_SLOT); else // any current or other non-stabled pet (for hunter "call pet") - // 0 1 2(?) 3 4 5 6 7 8 9 10 11 12 13 14 15 16 - result = CharacterDatabase.PQuery("SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, curhappiness, abdata, savetime, CreatedBySpell, PetType " + // 0 1 2(?) 3 4 5 6 7 8 9 10 11 12 13 14 15 + result = CharacterDatabase.PQuery("SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, abdata, savetime, CreatedBySpell, PetType " "FROM character_pet WHERE owner = '%u' AND (slot = '%u' OR slot > '%u') ", ownerid, PET_SAVE_AS_CURRENT, PET_SAVE_LAST_STABLE_SLOT); @@ -137,7 +137,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c if (!petentry) return false; - uint32 summon_spell_id = fields[15].GetUInt32(); + uint32 summon_spell_id = fields[14].GetUInt32(); SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(summon_spell_id); bool is_temporary_summoned = spellInfo && spellInfo->GetDuration() > 0; @@ -146,7 +146,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c if (current && is_temporary_summoned) return false; - PetType pet_type = PetType(fields[16].GetUInt8()); + PetType pet_type = PetType(fields[15].GetUInt8()); if (pet_type == HUNTER_PET) { CreatureTemplate const* creatureInfo = sObjectMgr->GetCreatureTemplate(petentry); @@ -213,8 +213,6 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE); // this enables popup window (pet abandon, cancel) - SetMaxPower(POWER_HAPPINESS, GetCreatePowers(POWER_HAPPINESS)); - SetPower(POWER_HAPPINESS, fields[12].GetUInt32()); setPowerType(POWER_FOCUS); break; default: @@ -283,13 +281,13 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c InitTalentForLevel(); // set original talents points before spell loading - uint32 timediff = uint32(time(NULL) - fields[14].GetUInt32()); + uint32 timediff = uint32(time(NULL) - fields[13].GetUInt32()); _LoadAuras(timediff); // load action bar, if data broken will fill later by default spells. if (!is_temporary_summoned) { - m_charmInfo->LoadPetActionBar(fields[13].GetString()); + m_charmInfo->LoadPetActionBar(fields[12].GetString()); _LoadSpells(); InitTalentForLevel(); // re-init to check talent count @@ -400,7 +398,7 @@ void Pet::SavePetToDB(PetSaveMode mode) ownerLowGUID, PET_SAVE_AS_CURRENT, PET_SAVE_LAST_STABLE_SLOT); // save pet std::ostringstream ss; - ss << "INSERT INTO character_pet (id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, curhappiness, abdata, savetime, CreatedBySpell, PetType) " + ss << "INSERT INTO character_pet (id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, abdata, savetime, CreatedBySpell, PetType) " << "VALUES (" << m_charmInfo->GetPetNumber() << ',' << GetEntry() << ',' @@ -413,8 +411,7 @@ void Pet::SavePetToDB(PetSaveMode mode) << name.c_str() << "', " << uint32(HasByteFlag(UNIT_FIELD_BYTES_2, 2, UNIT_CAN_BE_RENAMED) ? 0 : 1) << ',' << curhealth << ',' - << curmana << ',' - << GetPower(POWER_HAPPINESS) << ", '"; + << curmana << ", '"; for (uint32 i = ACTION_BAR_INDEX_START; i < ACTION_BAR_INDEX_END; ++i) { @@ -459,12 +456,6 @@ void Pet::setDeathState(DeathState s) // overwrite virtual // pet corpse non lootable and non skinnable SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_NONE); RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); - - //lose happiness when died and not in BG/Arena - MapEntry const* mapEntry = sMapStore.LookupEntry(GetMapId()); - if (!mapEntry || (mapEntry->map_type != MAP_ARENA && mapEntry->map_type != MAP_BATTLEGROUND)) - ModifyPower(POWER_HAPPINESS, -HAPPINESS_LEVEL_SIZE); - //SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); } } @@ -552,18 +543,6 @@ void Pet::Update(uint32 diff) } } } - - if (getPetType() != HUNTER_PET) - break; - - if (m_happinessTimer <= diff) - { - LoseHappiness(); - m_happinessTimer = 7500; - } - else - m_happinessTimer -= diff; - break; } default: @@ -611,27 +590,6 @@ void Creature::Regenerate(Powers power) ModifyPower(power, int32(addvalue)); } -void Pet::LoseHappiness() -{ - uint32 curValue = GetPower(POWER_HAPPINESS); - if (curValue <= 0) - return; - int32 addvalue = 670; //value is 70/35/17/8/4 (per min) * 1000 / 8 (timer 7.5 secs) - if (isInCombat()) //we know in combat happiness fades faster, multiplier guess - addvalue = int32(addvalue * 1.5f); - ModifyPower(POWER_HAPPINESS, -addvalue); -} - -HappinessState Pet::GetHappinessState() -{ - if (GetPower(POWER_HAPPINESS) < HAPPINESS_LEVEL_SIZE) - return UNHAPPY; - else if (GetPower(POWER_HAPPINESS) >= HAPPINESS_LEVEL_SIZE * 2) - return HAPPY; - else - return CONTENT; -} - void Pet::Remove(PetSaveMode mode, bool returnreagent) { m_owner->RemovePet(this, mode, returnreagent); @@ -744,8 +702,6 @@ bool Pet::CreateBaseAtTamed(CreatureTemplate const* cinfo, Map* map, uint32 phas if (!Create(guid, map, phaseMask, cinfo->Entry, pet_number)) return false; - SetMaxPower(POWER_HAPPINESS, GetCreatePowers(POWER_HAPPINESS)); - SetPower(POWER_HAPPINESS, 166500); setPowerType(POWER_FOCUS); SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, 0); SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0); diff --git a/src/server/game/Entities/Pet/Pet.h b/src/server/game/Entities/Pet/Pet.h index 973e5e99bee..96ff2835604 100755 --- a/src/server/game/Entities/Pet/Pet.h +++ b/src/server/game/Entities/Pet/Pet.h @@ -42,13 +42,6 @@ enum PetSaveMode PET_SAVE_NOT_IN_SLOT = 100 // for avoid conflict with stable size grow will use 100 }; -enum HappinessState -{ - UNHAPPY = 1, - CONTENT = 2, - HAPPY = 3 -}; - enum PetSpellState { PETSPELL_UNCHANGED = 0, @@ -108,8 +101,6 @@ enum PetNameInvalidReason typedef UNORDERED_MAP PetSpellMap; typedef std::vector AutoSpellList; -#define HAPPINESS_LEVEL_SIZE 333000 - #define ACTIVE_SPELLS_MAX 4 #define PET_FOLLOW_DIST 1.0f @@ -156,8 +147,6 @@ class Pet : public Guardian return m_autospells[pos]; } - void LoseHappiness(); - HappinessState GetHappinessState(); void GivePetXP(uint32 xp); void GivePetLevel(uint8 level); void SynchronizeLevelWithOwner(); @@ -226,7 +215,6 @@ class Pet : public Guardian Player* GetOwner() { return m_owner; } protected: Player* m_owner; - uint32 m_happinessTimer; PetType m_petType; int32 m_duration; // time until unsummon (used mostly for summoned guardians and not used for controlled pets) uint64 m_auraRaidUpdateMask; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 18620a9fcc9..f3dc392f569 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -2490,7 +2490,7 @@ void Player::RegenerateAll() m_regenTimerCount += m_regenTimer; Regenerate(POWER_ENERGY); - + Regenerate(POWER_FOCUS); Regenerate(POWER_MANA); // Runes act as cooldowns, and they don't need to send any data @@ -2547,7 +2547,8 @@ void Player::Regenerate(Powers power) addvalue += GetFloatValue(UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER) * ManaIncreaseRate * 0.001f * m_regenTimer; else addvalue += GetFloatValue(UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER) * ManaIncreaseRate * 0.001f * m_regenTimer; - } break; + } + break; case POWER_RAGE: // Regenerate rage { if (!isInCombat() && !HasAuraType(SPELL_AURA_INTERRUPT_REGEN)) @@ -2555,7 +2556,8 @@ void Player::Regenerate(Powers power) float RageDecreaseRate = sWorld->getRate(RATE_POWER_RAGE_LOSS); addvalue += -20 * RageDecreaseRate; // 2 rage by tick (= 2 seconds => 1 rage/sec) } - } break; + } + break; case POWER_ENERGY: // Regenerate energy (rogue) addvalue += 0.01f * m_regenTimer * sWorld->getRate(RATE_POWER_ENERGY); break; @@ -2566,10 +2568,12 @@ void Player::Regenerate(Powers power) float RunicPowerDecreaseRate = sWorld->getRate(RATE_POWER_RUNICPOWER_LOSS); addvalue += -30 * RunicPowerDecreaseRate; // 3 RunicPower by tick } - } break; - case POWER_RUNE: + } + break; case POWER_FOCUS: - case POWER_HAPPINESS: + addvalue += 4.0f * m_modAttackSpeedPct[RANGED_ATTACK] * sWorld->getRate(RATE_POWER_FOCUS); + break; + case POWER_RUNE: case POWER_HEALTH: break; default: @@ -3058,7 +3062,7 @@ void Player::GiveLevel(uint8 level) WorldPacket data(SMSG_LEVELUP_INFO, (4+4+MAX_POWERS*4+MAX_STATS*4)); data << uint32(level); data << uint32(int32(classInfo.basehealth) - int32(GetCreateHealth())); - // for (int i = 0; i < MAX_POWERS; ++i) // Powers loop (0-6) + // for (int i = 0; i < MAX_POWERS; ++i) // Powers loop (0-10) data << uint32(int32(classInfo.basemana) - int32(GetCreateMana())); data << uint32(0); data << uint32(0); @@ -3066,6 +3070,10 @@ void Player::GiveLevel(uint8 level) data << uint32(0); data << uint32(0); data << uint32(0); + data << uint32(0); + data << uint32(0); + data << uint32(0); + data << uint32(0); // end for for (uint8 i = STAT_STRENGTH; i < MAX_STATS; ++i) // Stats loop (0-4) data << uint32(int32(info.stats[i]) - GetCreateStat(Stats(i))); @@ -3106,7 +3114,6 @@ void Player::GiveLevel(uint8 level) if (GetPower(POWER_RAGE) > GetMaxPower(POWER_RAGE)) SetPower(POWER_RAGE, GetMaxPower(POWER_RAGE)); SetPower(POWER_FOCUS, 0); - SetPower(POWER_HAPPINESS, 0); _ApplyAllLevelScaleItemMods(true); @@ -3292,7 +3299,7 @@ void Player::InitStatsForLevel(bool reapplyMods) // save new stats for (uint8 i = POWER_MANA; i < MAX_POWERS; ++i) - SetMaxPower(Powers(i), uint32(GetCreatePowers(Powers(i)))); + SetMaxPower(Powers(i), GetCreatePowers(Powers(i))); SetMaxHealth(classInfo.basehealth); // stamina bonus will applied later @@ -3329,8 +3336,7 @@ void Player::InitStatsForLevel(bool reapplyMods) SetPower(POWER_ENERGY, GetMaxPower(POWER_ENERGY)); if (GetPower(POWER_RAGE) > GetMaxPower(POWER_RAGE)) SetPower(POWER_RAGE, GetMaxPower(POWER_RAGE)); - SetPower(POWER_FOCUS, 0); - SetPower(POWER_HAPPINESS, 0); + SetPower(POWER_FOCUS, GetMaxPower(POWER_FOCUS)); SetPower(POWER_RUNIC_POWER, 0); // update level to hunter/summon pet @@ -5137,6 +5143,7 @@ void Player::ResurrectPlayer(float restore_percent, bool applySickness) SetPower(POWER_MANA, uint32(GetMaxPower(POWER_MANA)*restore_percent)); SetPower(POWER_RAGE, 0); SetPower(POWER_ENERGY, uint32(GetMaxPower(POWER_ENERGY)*restore_percent)); + SetPower(POWER_FOCUS, uint32(GetMaxPower(POWER_FOCUS)*restore_percent)); } // trigger update zone for alive state zone updates @@ -16638,8 +16645,10 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) //"resettalents_time, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, online, death_expire_time, taxi_path, instance_mode_mask, " // 39 40 41 42 43 44 45 46 47 48 49 //"arenaPoints, totalHonorPoints, todayHonorPoints, yesterdayHonorPoints, totalKills, todayKills, yesterdayKills, chosenTitle, knownCurrencies, watchedFaction, drunk, " - // 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 - //"health, power1, power2, power3, power4, power5, power6, power7, instance_id, speccount, activespec, exploredZones, equipmentCache, ammoId, knownTitles, actionBars, grantableLevels FROM characters WHERE guid = '%u'", guid); + // 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 + //"health, power1, power2, power3, power4, power5, power6, power7, power8, power9, power10, power11, instance_id, speccount, activespec, exploredZones, equipmentCache, " + // 67 68 69 70 + //"ammoId, knownTitles, actionBars, grantableLevels FROM characters WHERE guid = '%u'", guid); PreparedQueryResult result = holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADFROM); if (!result) @@ -16698,8 +16707,8 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) SetUInt32Value(UNIT_FIELD_LEVEL, fields[6].GetUInt8()); SetUInt32Value(PLAYER_XP, fields[7].GetUInt32()); - _LoadIntoDataField(fields[61].GetCString(), PLAYER_EXPLORED_ZONES_1, PLAYER_EXPLORED_ZONES_SIZE); - _LoadIntoDataField(fields[64].GetCString(), PLAYER__FIELD_KNOWN_TITLES, KNOWN_TITLES_SIZE*2); + _LoadIntoDataField(fields[65].GetCString(), PLAYER_EXPLORED_ZONES_1, PLAYER_EXPLORED_ZONES_SIZE); + _LoadIntoDataField(fields[68].GetCString(), PLAYER__FIELD_KNOWN_TITLES, KNOWN_TITLES_SIZE*2); SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, DEFAULT_WORLD_OBJECT_SIZE); SetFloatValue(UNIT_FIELD_COMBATREACH, 1.5f); @@ -16721,10 +16730,10 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) SetUInt64Value(PLAYER_FIELD_KNOWN_CURRENCIES, fields[47].GetUInt64()); - SetUInt32Value(PLAYER_AMMO_ID, fields[63].GetUInt32()); + SetUInt32Value(PLAYER_AMMO_ID, fields[67].GetUInt32()); // set which actionbars the client has active - DO NOT REMOVE EVER AGAIN (can be changed though, if it does change fieldwise) - SetByteValue(PLAYER_FIELD_BYTES, 2, fields[65].GetUInt8()); + SetByteValue(PLAYER_FIELD_BYTES, 2, fields[69].GetUInt8()); InitDisplayIds(); @@ -16755,7 +16764,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) uint32 transGUID = uint32(fields[30].GetUInt64()); // field type is uint64 but lowguid is saved Relocate(fields[12].GetFloat(), fields[13].GetFloat(), fields[14].GetFloat(), fields[16].GetFloat()); uint32 mapId = fields[15].GetUInt16(); - uint32 instanceId = fields[58].GetUInt8(); + uint32 instanceId = fields[62].GetUInt8(); uint32 dungeonDiff = fields[38].GetUInt32() & 0x0F; if (dungeonDiff >= MAX_DUNGEON_DIFFICULTY) @@ -17117,8 +17126,8 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) //mails are loaded only when needed ;-) - when player in game click on mailbox. //_LoadMail(); - m_specsCount = fields[59].GetUInt8(); - m_activeSpec = fields[60].GetUInt8(); + m_specsCount = fields[63].GetUInt8(); + m_activeSpec = fields[64].GetUInt8(); // sanity check if (m_specsCount > MAX_TALENT_SPECS || m_activeSpec > MAX_TALENT_SPEC || m_specsCount < MIN_TALENT_SPECS) @@ -17248,7 +17257,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) } // RaF stuff. - m_grantableLevels = fields[66].GetUInt32(); + m_grantableLevels = fields[70].GetUInt32(); if (GetSession()->IsARecruiter() || (GetSession()->GetRecruiterId() != 0)) SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_REFER_A_FRIEND); @@ -19133,7 +19142,7 @@ void Player::_SaveStats(SQLTransaction& trans) trans->PAppend("DELETE FROM character_stats WHERE guid = '%u'", GetGUIDLow()); std::ostringstream ss; - ss << "INSERT INTO character_stats (guid, maxhealth, maxpower1, maxpower2, maxpower3, maxpower4, maxpower5, maxpower6, maxpower7, " + ss << "INSERT INTO character_stats (guid, maxhealth, maxpower1, maxpower2, maxpower3, maxpower4, maxpower5, maxpower6, maxpower7, maxpower8, maxpower9, maxpower10, maxpower11, " "strength, agility, stamina, intellect, spirit, armor, resHoly, resFire, resNature, resFrost, resShadow, resArcane, " "blockPct, dodgePct, parryPct, critPct, rangedCritPct, spellCritPct, attackPower, rangedAttackPower, spellPower, resilience) VALUES (" << GetGUIDLow() << ',' @@ -22670,8 +22679,8 @@ void Player::ResurectUsingRequestData() SetPower(POWER_MANA, GetMaxPower(POWER_MANA)); SetPower(POWER_RAGE, 0); - SetPower(POWER_ENERGY, GetMaxPower(POWER_ENERGY)); + SetPower(POWER_FOCUS, GetMaxPower(POWER_FOCUS)); SpawnCorpseBones(); } diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index 3ab2f786086..459379ac11a 100755 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -1384,27 +1384,6 @@ void Guardian::UpdateDamagePhysical(WeaponAttackType attType) float mindamage = ((base_value + weapon_mindamage) * base_pct + total_value) * total_pct; float maxdamage = ((base_value + weapon_maxdamage) * base_pct + total_value) * total_pct; - // Pet's base damage changes depending on happiness - if (isHunterPet() && attType == BASE_ATTACK) - { - switch (ToPet()->GetHappinessState()) - { - case HAPPY: - // 125% of normal damage - mindamage = mindamage * 1.25f; - maxdamage = maxdamage * 1.25f; - break; - case CONTENT: - // 100% of normal damage, nothing to modify - break; - case UNHAPPY: - // 75% of normal damage - mindamage = mindamage * 0.75f; - maxdamage = maxdamage * 0.75f; - break; - } - } - Unit::AuraEffectList const& mDummy = GetAuraEffectsByType(SPELL_AURA_MOD_ATTACKSPEED); for (Unit::AuraEffectList::const_iterator itr = mDummy.begin(); itr != mDummy.end(); ++itr) { diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 05ed2313bb9..00471c420ce 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -9193,10 +9193,6 @@ void Unit::setPowerType(Powers new_powertype) case POWER_ENERGY: SetMaxPower(POWER_ENERGY, GetCreatePowers(POWER_ENERGY)); break; - case POWER_HAPPINESS: - SetMaxPower(POWER_HAPPINESS, GetCreatePowers(POWER_HAPPINESS)); - SetPower(POWER_HAPPINESS, GetCreatePowers(POWER_HAPPINESS)); - break; } } @@ -13398,7 +13394,6 @@ bool Unit::HandleStatModifier(UnitMods unitMod, UnitModifierType modifierType, f case UNIT_MOD_RAGE: case UNIT_MOD_FOCUS: case UNIT_MOD_ENERGY: - case UNIT_MOD_HAPPINESS: case UNIT_MOD_RUNE: case UNIT_MOD_RUNIC_POWER: UpdateMaxPower(GetPowerTypeByAuraGroup(unitMod)); break; @@ -13518,7 +13513,6 @@ Powers Unit::GetPowerTypeByAuraGroup(UnitMods unitMod) const case UNIT_MOD_RAGE: return POWER_RAGE; case UNIT_MOD_FOCUS: return POWER_FOCUS; case UNIT_MOD_ENERGY: return POWER_ENERGY; - case UNIT_MOD_HAPPINESS: return POWER_HAPPINESS; case UNIT_MOD_RUNE: return POWER_RUNE; case UNIT_MOD_RUNIC_POWER: return POWER_RUNIC_POWER; default: @@ -13621,12 +13615,12 @@ void Unit::SetMaxHealth(uint32 val) SetHealth(val); } -void Unit::SetPower(Powers power, uint32 val) +void Unit::SetPower(Powers power, int32 val) { if (GetPower(power) == val) return; - uint32 maxPower = GetMaxPower(power); + int32 maxPower = (int32)GetMaxPower(power); if (maxPower < val) val = maxPower; @@ -13634,8 +13628,9 @@ void Unit::SetPower(Powers power, uint32 val) WorldPacket data(SMSG_POWER_UPDATE); data.append(GetPackGUID()); + data << int32(1); // Unk data << uint8(power); - data << uint32(val); + data << int32(val); SendMessageToSet(&data, GetTypeId() == TYPEID_PLAYER ? true : false); // group update @@ -13652,16 +13647,12 @@ void Unit::SetPower(Powers power, uint32 val) if (owner && (owner->GetTypeId() == TYPEID_PLAYER) && owner->ToPlayer()->GetGroup()) owner->ToPlayer()->SetGroupUpdateFlag(GROUP_UPDATE_FLAG_PET_CUR_POWER); } - - // Update the pet's character sheet with happiness damage bonus - if (pet->getPetType() == HUNTER_PET && power == POWER_HAPPINESS) - pet->UpdateDamagePhysical(BASE_ATTACK); } } -void Unit::SetMaxPower(Powers power, uint32 val) +void Unit::SetMaxPower(Powers power, int32 val) { - uint32 cur_power = GetPower(power); + int32 cur_power = GetPower(power); SetStatInt32Value(UNIT_FIELD_MAXPOWER1 + power, val); // group update @@ -13684,19 +13675,32 @@ void Unit::SetMaxPower(Powers power, uint32 val) SetPower(power, val); } -uint32 Unit::GetCreatePowers(Powers power) const +int32 Unit::GetCreatePowers(Powers power) const { - // POWER_FOCUS and POWER_HAPPINESS only have hunter pet switch (power) { - case POWER_MANA: return GetCreateMana(); - case POWER_RAGE: return 1000; - case POWER_FOCUS: return (GetTypeId() == TYPEID_PLAYER || !((Creature const*)this)->isPet() || ((Pet const*)this)->getPetType() != HUNTER_PET ? 0 : 100); - case POWER_ENERGY: return 100; - case POWER_HAPPINESS: return (GetTypeId() == TYPEID_PLAYER || !((Creature const*)this)->isPet() || ((Pet const*)this)->getPetType() != HUNTER_PET ? 0 : 1050000); - case POWER_RUNIC_POWER: return 1000; - case POWER_RUNE: return 0; - case POWER_HEALTH: return 0; + case POWER_MANA: + return GetCreateMana(); + case POWER_RAGE: + return 1000; + case POWER_FOCUS: + if (GetTypeId() == TYPEID_PLAYER && getClass() == CLASS_HUNTER) + return 100; + return (GetTypeId() == TYPEID_PLAYER || !((Creature const*)this)->isPet() || ((Pet const*)this)->getPetType() != HUNTER_PET ? 0 : 100); + case POWER_ENERGY: + return 100; + case POWER_RUNIC_POWER: + return 1000; + case POWER_RUNE: + return 0; + case POWER_SOULSHARD: + return 3; + case POWER_ECLIPSE: + return 0; + case POWER_HOLY_POWER: + return 0; + case POWER_HEALTH: + return 0; default: break; } diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index ff2a4e0ccd1..a86361e8d21 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -417,7 +417,6 @@ enum UnitMods UNIT_MOD_RAGE, UNIT_MOD_FOCUS, UNIT_MOD_ENERGY, - UNIT_MOD_HAPPINESS, UNIT_MOD_RUNE, UNIT_MOD_RUNIC_POWER, UNIT_MOD_ARMOR, // UNIT_MOD_ARMOR..UNIT_MOD_RESISTANCE_ARCANE must be in existed order, it's accessed by index values of SpellSchools enum. @@ -1370,10 +1369,10 @@ class Unit : public WorldObject Powers getPowerType() const { return Powers(GetByteValue(UNIT_FIELD_BYTES_0, 3)); } void setPowerType(Powers power); - uint32 GetPower(Powers power) const { return GetUInt32Value(UNIT_FIELD_POWER1 +power); } + int32 GetPower(Powers power) const { return GetUInt32Value(UNIT_FIELD_POWER1+power); } uint32 GetMaxPower(Powers power) const { return GetUInt32Value(UNIT_FIELD_MAXPOWER1+power); } - void SetPower(Powers power, uint32 val); - void SetMaxPower(Powers power, uint32 val); + void SetPower(Powers power, int32 val); + void SetMaxPower(Powers power, int32 val); // returns the change in power int32 ModifyPower(Powers power, int32 val); int32 ModifyPowerPct(Powers power, float pct, bool apply = true); @@ -1870,7 +1869,7 @@ class Unit : public WorldObject uint32 GetCreateHealth() const { return GetUInt32Value(UNIT_FIELD_BASE_HEALTH); } void SetCreateMana(uint32 val) { SetUInt32Value(UNIT_FIELD_BASE_MANA, val); } uint32 GetCreateMana() const { return GetUInt32Value(UNIT_FIELD_BASE_MANA); } - uint32 GetCreatePowers(Powers power) const; + int32 GetCreatePowers(Powers power) const; float GetPosStat(Stats stat) const { return GetFloatValue(UNIT_FIELD_POSSTAT0+stat); } float GetNegStat(Stats stat) const { return GetFloatValue(UNIT_FIELD_NEGSTAT0+stat); } float GetCreateStat(Stats stat) const { return m_createStats[stat]; } diff --git a/src/server/game/Server/Protocol/Handlers/PetHandler.cpp b/src/server/game/Server/Protocol/Handlers/PetHandler.cpp index 5a8781d3925..2a94f15ff2e 100755 --- a/src/server/game/Server/Protocol/Handlers/PetHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/PetHandler.cpp @@ -673,15 +673,7 @@ void WorldSession::HandlePetAbandon(WorldPacket & recv_data) if (pet) { if (pet->isPet()) - { - if (pet->GetGUID() == _player->GetPetGUID()) - { - uint32 feelty = pet->GetPower(POWER_HAPPINESS); - pet->SetPower(POWER_HAPPINESS, feelty > 50000 ? (feelty-50000) : 0); - } - _player->RemovePet((Pet*)pet, PET_SAVE_AS_DELETED); - } else if (pet->GetGUID() == _player->GetCharmGUID()) _player->StopCastingCharm(); } diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index a4cf8e6a469..8cb001ed0ac 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -6195,6 +6195,7 @@ void Spell::EffectSelfResurrect(SpellEffIndex effIndex) player->SetPower(POWER_MANA, mana); player->SetPower(POWER_RAGE, 0); player->SetPower(POWER_ENERGY, player->GetMaxPower(POWER_ENERGY)); + player->SetPower(POWER_FOCUS, 0); player->SpawnCorpseBones(); } diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 78de015f200..3edf682f5bb 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -2170,7 +2170,6 @@ uint32 SpellInfo::CalcPowerCost(Unit const* caster, SpellSchoolMask schoolMask) case POWER_RAGE: case POWER_FOCUS: case POWER_ENERGY: - case POWER_HAPPINESS: powerCost += int32(CalculatePctU(caster->GetMaxPower(Powers(PowerType)), ManaCostPercentage)); break; case POWER_RUNE: diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index e127e4a5298..94b4ca16d7f 100755 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -42,7 +42,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() "position_x, position_y, position_z, map, orientation, taximask, cinematic, totaltime, leveltime, rest_bonus, logout_time, is_logout_resting, resettalents_cost, " "resettalents_time, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, online, death_expire_time, taxi_path, instance_mode_mask, " "arenaPoints, totalHonorPoints, todayHonorPoints, yesterdayHonorPoints, totalKills, todayKills, yesterdayKills, chosenTitle, knownCurrencies, watchedFaction, drunk, " - "health, power1, power2, power3, power4, power5, power6, power7, instance_id, speccount, activespec, exploredZones, equipmentCache, ammoId, knownTitles, actionBars, grantableLevels FROM characters WHERE guid = ?", CONNECTION_ASYNC) + "health, power1, power2, power3, power4, power5, power6, power7, power8, power9, power10, power11, instance_id, speccount, activespec, exploredZones, equipmentCache, ammoId, knownTitles, actionBars, grantableLevels FROM characters WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_LOAD_PLAYER_GROUP, "SELECT guid FROM group_member WHERE memberGuid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_LOAD_PLAYER_BOUNDINSTANCES, "SELECT id, permanent, map, difficulty, resettime FROM character_instance LEFT JOIN instance ON instance = id WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_LOAD_PLAYER_AURAS, "SELECT caster_guid, spell, effect_mask, recalculate_mask, stackcount, amount0, amount1, amount2, " -- cgit v1.2.3 From ec54bb48952fb0f766c61976f736ad727f9aadd0 Mon Sep 17 00:00:00 2001 From: kaelima Date: Fri, 25 Nov 2011 18:54:59 +0100 Subject: Core/Misc: Clearing compile errors since UpdateFields were changed: - Completely remove ammo (Cataclysm change) - Revert some changes with power/maxpower and only store the 5 needed powers in db (the rest is useless) - Remove GuildId from corpse - Move PLAYER_GUILDID to character db (removed updatefield) Note: Compile is still not working as we need to change currency handling --- .../2011_11_25_03_characters_character_stats.sql | 7 + .../2011_11_25_03_characters_characters.sql | 9 + .../characters/2011_11_25_03_characters_corpse.sql | 1 + src/server/game/AI/EventAI/CreatureEventAI.cpp | 2 +- src/server/game/AI/ScriptedAI/ScriptedCreature.cpp | 2 +- src/server/game/DataStores/DB2Stores.cpp | 2 +- src/server/game/Entities/Corpse/Corpse.cpp | 56 +++--- .../game/Entities/Object/Updates/UpdateFields.h | 12 -- src/server/game/Entities/Player/Player.cpp | 199 +++------------------ src/server/game/Entities/Player/Player.h | 29 ++- src/server/game/Entities/Unit/StatSystem.cpp | 10 -- src/server/game/Entities/Unit/Unit.cpp | 4 +- src/server/game/Globals/ObjectMgr.cpp | 2 +- src/server/game/Miscellaneous/SharedDefines.h | 2 + src/server/game/Spells/Auras/SpellAuraEffects.cpp | 10 +- src/server/game/Spells/Spell.cpp | 124 ------------- src/server/game/Spells/Spell.h | 3 +- src/server/game/Spells/SpellEffects.cpp | 2 +- src/server/game/World/World.cpp | 2 +- .../IcecrownCitadel/boss_lady_deathwhisper.cpp | 2 +- .../Database/Implementation/CharacterDatabase.cpp | 17 +- .../Database/Implementation/CharacterDatabase.h | 2 + 22 files changed, 116 insertions(+), 383 deletions(-) create mode 100644 sql/updates/characters/2011_11_25_03_characters_character_stats.sql create mode 100644 sql/updates/characters/2011_11_25_03_characters_characters.sql create mode 100644 sql/updates/characters/2011_11_25_03_characters_corpse.sql (limited to 'src') diff --git a/sql/updates/characters/2011_11_25_03_characters_character_stats.sql b/sql/updates/characters/2011_11_25_03_characters_character_stats.sql new file mode 100644 index 00000000000..5f41b6e40db --- /dev/null +++ b/sql/updates/characters/2011_11_25_03_characters_character_stats.sql @@ -0,0 +1,7 @@ +ALTER TABLE `character_stats` +DROP COLUMN `maxpower6`, +DROP COLUMN `maxpower7`, +DROP COLUMN `maxpower8`, +DROP COLUMN `maxpower9`, +DROP COLUMN `maxpower10`, +DROP COLUMN `maxpower11`; diff --git a/sql/updates/characters/2011_11_25_03_characters_characters.sql b/sql/updates/characters/2011_11_25_03_characters_characters.sql new file mode 100644 index 00000000000..cede344b6bf --- /dev/null +++ b/sql/updates/characters/2011_11_25_03_characters_characters.sql @@ -0,0 +1,9 @@ +ALTER TABLE `characters` +DROP COLUMN `power6`, +DROP COLUMN `power7`, +DROP COLUMN `power8`, +DROP COLUMN `power9`, +DROP COLUMN `power10`, +DROP COLUMN `power11`, +DROP COLUMN `ammoId`, +ADD COLUMN `guildId` int(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `grantableLevels`; diff --git a/sql/updates/characters/2011_11_25_03_characters_corpse.sql b/sql/updates/characters/2011_11_25_03_characters_corpse.sql new file mode 100644 index 00000000000..e1823602b65 --- /dev/null +++ b/sql/updates/characters/2011_11_25_03_characters_corpse.sql @@ -0,0 +1 @@ +ALTER TABLE `corpse` DROP COLUMN `guildId`; diff --git a/src/server/game/AI/EventAI/CreatureEventAI.cpp b/src/server/game/AI/EventAI/CreatureEventAI.cpp index be0dd8c3679..08f8d7a3d77 100755 --- a/src/server/game/AI/EventAI/CreatureEventAI.cpp +++ b/src/server/game/AI/EventAI/CreatureEventAI.cpp @@ -1312,7 +1312,7 @@ bool CreatureEventAI::CanCast(Unit* target, SpellInfo const* spell, bool trigger return false; //Check for power - if (!triggered && me->GetPower((Powers)spell->PowerType) < spell->CalcPowerCost(me, spell->GetSchoolMask())) + if (!triggered && (uint32)me->GetPower((Powers)spell->PowerType) < spell->CalcPowerCost(me, spell->GetSchoolMask())) return false; //Unit is out of range of this spell diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp index 953bbf7521a..e9a9c1fdcf2 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp @@ -237,7 +237,7 @@ SpellInfo const* ScriptedAI::SelectSpell(Unit* target, uint32 school, uint32 mec continue; //Continue if we don't have the mana to actually cast this spell - if (tempSpell->ManaCost > me->GetPower(Powers(tempSpell->PowerType))) + if (tempSpell->ManaCost > (uint32)me->GetPower(Powers(tempSpell->PowerType))) continue; //Check if the spell meets our range requirements diff --git a/src/server/game/DataStores/DB2Stores.cpp b/src/server/game/DataStores/DB2Stores.cpp index 7919a3fba16..77d16501415 100644 --- a/src/server/game/DataStores/DB2Stores.cpp +++ b/src/server/game/DataStores/DB2Stores.cpp @@ -87,7 +87,7 @@ void LoadDB2Stores(const std::string& dataPath) LoadDB2(availableDb2Locales, bad_db2_files, sItemStore, db2Path, "Item.db2"); LoadDB2(availableDb2Locales, bad_db2_files, sItemSparseStore, db2Path, "Item-sparse.db2"); - LoadDB2(availableDb2Locales, bad_db2_files, sItemExtendedCostStore, db2Path, "ItemExtendedCost.db2"); + LoadDB2(availableDb2Locales, bad_db2_files, sItemExtendedCostStore, db2Path, "ItemExtendedCost.db2"); // error checks if (bad_db2_files.size() >= DB2FilesCount) { diff --git a/src/server/game/Entities/Corpse/Corpse.cpp b/src/server/game/Entities/Corpse/Corpse.cpp index 31cc21659c9..ff8c93ec404 100755 --- a/src/server/game/Entities/Corpse/Corpse.cpp +++ b/src/server/game/Entities/Corpse/Corpse.cpp @@ -106,25 +106,25 @@ void Corpse::SaveToDB() SQLTransaction trans = CharacterDatabase.BeginTransaction(); DeleteFromDB(trans); + uint16 index = 0; PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_CORPSE); - stmt->setUInt32(0, GetGUIDLow()); // corpseGuid - stmt->setUInt32(1, GUID_LOPART(GetOwnerGUID())); // guid - stmt->setFloat (2, GetPositionX()); // posX - stmt->setFloat (3, GetPositionY()); // posY - stmt->setFloat (4, GetPositionZ()); // posZ - stmt->setFloat (5, GetOrientation()); // orientation - stmt->setUInt16(6, GetMapId()); // mapId - stmt->setUInt32(7, GetUInt32Value(CORPSE_FIELD_DISPLAY_ID)); // displayId - stmt->setString(8, _ConcatFields(CORPSE_FIELD_ITEM, EQUIPMENT_SLOT_END)); // itemCache - stmt->setUInt32(9, GetUInt32Value(CORPSE_FIELD_BYTES_1)); // bytes1 - stmt->setUInt32(10, GetUInt32Value(CORPSE_FIELD_BYTES_2)); // bytes2 - stmt->setUInt32(11, GetUInt32Value(CORPSE_FIELD_GUILD)); // guildId - stmt->setUInt8 (12, GetUInt32Value(CORPSE_FIELD_FLAGS)); // flags - stmt->setUInt8 (13, GetUInt32Value(CORPSE_FIELD_DYNAMIC_FLAGS)); // dynFlags - stmt->setUInt32(14, uint32(m_time)); // time - stmt->setUInt8 (15, GetType()); // corpseType - stmt->setUInt32(16, GetInstanceId()); // instanceId - stmt->setUInt16(17, GetPhaseMask()); // phaseMask + stmt->setUInt32(index, GetGUIDLow()); // corpseGuid + stmt->setUInt32(index++, GUID_LOPART(GetOwnerGUID())); // guid + stmt->setFloat (index++, GetPositionX()); // posX + stmt->setFloat (index++, GetPositionY()); // posY + stmt->setFloat (index++, GetPositionZ()); // posZ + stmt->setFloat (index++, GetOrientation()); // orientation + stmt->setUInt16(index++, GetMapId()); // mapId + stmt->setUInt32(index++, GetUInt32Value(CORPSE_FIELD_DISPLAY_ID)); // displayId + stmt->setString(index++, _ConcatFields(CORPSE_FIELD_ITEM, EQUIPMENT_SLOT_END)); // itemCache + stmt->setUInt32(index++, GetUInt32Value(CORPSE_FIELD_BYTES_1)); // bytes1 + stmt->setUInt32(index++, GetUInt32Value(CORPSE_FIELD_BYTES_2)); // bytes2 + stmt->setUInt8 (index++, GetUInt32Value(CORPSE_FIELD_FLAGS)); // flags + stmt->setUInt8 (index++, GetUInt32Value(CORPSE_FIELD_DYNAMIC_FLAGS)); // dynFlags + stmt->setUInt32(index++, uint32(m_time)); // time + stmt->setUInt8 (index++, GetType()); // corpseType + stmt->setUInt32(index++, GetInstanceId()); // instanceId + stmt->setUInt16(index++, GetPhaseMask()); // phaseMask trans->Append(stmt); CharacterDatabase.CommitTransaction(trans); @@ -164,10 +164,11 @@ void Corpse::DeleteFromDB(SQLTransaction& trans) bool Corpse::LoadFromDB(uint32 guid, Field* fields) { - uint32 ownerGuid = fields[17].GetUInt32(); - // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 - // SELECT posX, posY, posZ, orientation, mapId, displayId, itemCache, bytes1, bytes2, guildId, flags, dynFlags, time, corpseType, instanceId, phaseMask, corpseGuid, guid FROM corpse WHERE corpseType <> 0 - m_type = CorpseType(fields[13].GetUInt8()); + // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 + // SELECT posX, posY, posZ, orientation, mapId, displayId, itemCache, bytes1, bytes2, flags, dynFlags, time, corpseType, instanceId, phaseMask, corpseGuid, guid FROM corpse WHERE corpseType <> 0 + + uint32 ownerGuid = fields[16].GetUInt32(); + m_type = CorpseType(fields[12].GetUInt8()); if (m_type >= MAX_CORPSE_TYPE) { sLog->outError("Corpse (guid: %u, owner: %u) have wrong corpse type (%u), not loading.", guid, ownerGuid, m_type); @@ -188,15 +189,14 @@ bool Corpse::LoadFromDB(uint32 guid, Field* fields) _LoadIntoDataField(fields[6].GetCString(), CORPSE_FIELD_ITEM, EQUIPMENT_SLOT_END); SetUInt32Value(CORPSE_FIELD_BYTES_1, fields[7].GetUInt32()); SetUInt32Value(CORPSE_FIELD_BYTES_2, fields[8].GetUInt32()); - SetUInt32Value(CORPSE_FIELD_GUILD, fields[9].GetUInt32()); - SetUInt32Value(CORPSE_FIELD_FLAGS, fields[10].GetUInt8()); - SetUInt32Value(CORPSE_FIELD_DYNAMIC_FLAGS, fields[11].GetUInt8()); + SetUInt32Value(CORPSE_FIELD_FLAGS, fields[9].GetUInt8()); + SetUInt32Value(CORPSE_FIELD_DYNAMIC_FLAGS, fields[10].GetUInt8()); SetUInt64Value(CORPSE_FIELD_OWNER, MAKE_NEW_GUID(ownerGuid, 0, HIGHGUID_PLAYER)); - m_time = time_t(fields[12].GetUInt32()); + m_time = time_t(fields[11].GetUInt32()); - uint32 instanceId = fields[14].GetUInt32(); - uint32 phaseMask = fields[15].GetUInt16(); + uint32 instanceId = fields[13].GetUInt32(); + uint32 phaseMask = fields[14].GetUInt16(); // place SetLocationInstanceId(instanceId); diff --git a/src/server/game/Entities/Object/Updates/UpdateFields.h b/src/server/game/Entities/Object/Updates/UpdateFields.h index 03e83496297..ce063f4f2f1 100755 --- a/src/server/game/Entities/Object/Updates/UpdateFields.h +++ b/src/server/game/Entities/Object/Updates/UpdateFields.h @@ -105,24 +105,12 @@ enum EUnitFields UNIT_FIELD_POWER3 = OBJECT_END + 0x0015, // Size: 1, Type: INT, Flags: PUBLIC UNIT_FIELD_POWER4 = OBJECT_END + 0x0016, // Size: 1, Type: INT, Flags: PUBLIC UNIT_FIELD_POWER5 = OBJECT_END + 0x0017, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_POWER6 = OBJECT_END + 0x0018, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_POWER7 = OBJECT_END + 0x0019, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_POWER8 = OBJECT_END + 0x001A, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_POWER9 = OBJECT_END + 0x001B, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_POWER10 = OBJECT_END + 0x001C, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_POWER11 = OBJECT_END + 0x001D, // Size: 1, Type: INT, Flags: PUBLIC UNIT_FIELD_MAXHEALTH = OBJECT_END + 0x0018, // Size: 1, Type: INT, Flags: PUBLIC UNIT_FIELD_MAXPOWER1 = OBJECT_END + 0x0019, // Size: 1, Type: INT, Flags: PUBLIC UNIT_FIELD_MAXPOWER2 = OBJECT_END + 0x001A, // Size: 1, Type: INT, Flags: PUBLIC UNIT_FIELD_MAXPOWER3 = OBJECT_END + 0x001B, // Size: 1, Type: INT, Flags: PUBLIC UNIT_FIELD_MAXPOWER4 = OBJECT_END + 0x001C, // Size: 1, Type: INT, Flags: PUBLIC UNIT_FIELD_MAXPOWER5 = OBJECT_END + 0x001D, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_MAXPOWER6 = OBJECT_END + 0x0024, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_MAXPOWER7 = OBJECT_END + 0x0025, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_MAXPOWER8 = OBJECT_END + 0x0026, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_MAXPOWER9 = OBJECT_END + 0x0027, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_MAXPOWER10 = OBJECT_END + 0x0028, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_MAXPOWER11 = OBJECT_END + 0x0029, // Size: 1, Type: INT, Flags: PUBLIC UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER = OBJECT_END + 0x001E, // Size: 5, Type: FLOAT, Flags: PRIVATE, OWNER, PARTY_MEMBER UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER = OBJECT_END + 0x0023, // Size: 5, Type: FLOAT, Flags: PRIVATE, OWNER, PARTY_MEMBER UNIT_FIELD_LEVEL = OBJECT_END + 0x0028, // Size: 1, Type: INT, Flags: PUBLIC diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index f3dc392f569..b75f3f07d55 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -787,6 +787,8 @@ Player::Player (WorldSession* session): Unit(), m_achievementMgr(this), m_reputa m_activeSpec = 0; m_specsCount = 1; + m_freeTalentPoints = 0; + for (uint8 i = 0; i < MAX_TALENT_SPECS; ++i) { for (uint8 g = 0; g < MAX_GLYPH_SLOT_INDEX; ++g) @@ -978,7 +980,6 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo) SetByteValue(PLAYER_BYTES_3, 0, createInfo->Gender); SetByteValue(PLAYER_BYTES_3, 3, 0); // BattlefieldArenaFaction (0 or 1) - SetUInt32Value(PLAYER_GUILDID, 0); SetUInt32Value(PLAYER_GUILDRANK, 0); SetUInt32Value(PLAYER_GUILD_TIMESTAMP, 0); @@ -1165,7 +1166,7 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo) RemoveItem(INVENTORY_SLOT_BAG_0, i, true); EquipItem(eDest, pItem, true); } - // move other items to more appropriate slots (ammo not equipped in special bag) + // move other items to more appropriate slots else { ItemPosCountVec sDest; @@ -1175,11 +1176,6 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo) RemoveItem(INVENTORY_SLOT_BAG_0, i, true); pItem = StoreItem(sDest, pItem, true); } - - // if this is ammo then use it - msg = CanUseAmmo(pItem->GetEntry()); - if (msg == EQUIP_ERR_OK) - SetAmmo(pItem->GetEntry()); } } } @@ -3111,7 +3107,7 @@ void Player::GiveLevel(uint8 level) SetFullHealth(); SetPower(POWER_MANA, GetMaxPower(POWER_MANA)); SetPower(POWER_ENERGY, GetMaxPower(POWER_ENERGY)); - if (GetPower(POWER_RAGE) > GetMaxPower(POWER_RAGE)) + if ((uint32)GetPower(POWER_RAGE) > GetMaxPower(POWER_RAGE)) SetPower(POWER_RAGE, GetMaxPower(POWER_RAGE)); SetPower(POWER_FOCUS, 0); @@ -3250,10 +3246,8 @@ void Player::InitStatsForLevel(bool reapplyMods) SetFloatValue(UNIT_FIELD_MAXRANGEDDAMAGE, 0.0f); SetInt32Value(UNIT_FIELD_ATTACK_POWER, 0); - SetInt32Value(UNIT_FIELD_ATTACK_POWER_MODS, 0); SetFloatValue(UNIT_FIELD_ATTACK_POWER_MULTIPLIER, 0.0f); SetInt32Value(UNIT_FIELD_RANGED_ATTACK_POWER, 0); - SetInt32Value(UNIT_FIELD_RANGED_ATTACK_POWER_MODS, 0); SetFloatValue(UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER, 0.0f); // Base crit values (will be recalculated in UpdateAllStats() at loading and in _ApplyAllStatBonuses() at reset @@ -3334,7 +3328,7 @@ void Player::InitStatsForLevel(bool reapplyMods) SetFullHealth(); SetPower(POWER_MANA, GetMaxPower(POWER_MANA)); SetPower(POWER_ENERGY, GetMaxPower(POWER_ENERGY)); - if (GetPower(POWER_RAGE) > GetMaxPower(POWER_RAGE)) + if ((uint32)GetPower(POWER_RAGE) > GetMaxPower(POWER_RAGE)) SetPower(POWER_RAGE, GetMaxPower(POWER_RAGE)); SetPower(POWER_FOCUS, GetMaxPower(POWER_FOCUS)); SetPower(POWER_RUNIC_POWER, 0); @@ -4502,12 +4496,6 @@ bool Player::resetTalents(bool no_cost) return true; } -void Player::SetFreeTalentPoints(uint32 points) -{ - sScriptMgr->OnPlayerFreeTalentPointsChanged(this, points); - SetUInt32Value(PLAYER_CHARACTER_POINTS1, points); -} - Mail* Player::GetMail(uint32 id) { for (PlayerMails::iterator itr = m_mail.begin(); itr != m_mail.end(); ++itr) @@ -4565,16 +4553,12 @@ void Player::InitVisibleBits() updateVisualBits.SetBit(UNIT_FIELD_POWER3); updateVisualBits.SetBit(UNIT_FIELD_POWER4); updateVisualBits.SetBit(UNIT_FIELD_POWER5); - updateVisualBits.SetBit(UNIT_FIELD_POWER6); - updateVisualBits.SetBit(UNIT_FIELD_POWER7); updateVisualBits.SetBit(UNIT_FIELD_MAXHEALTH); updateVisualBits.SetBit(UNIT_FIELD_MAXPOWER1); updateVisualBits.SetBit(UNIT_FIELD_MAXPOWER2); updateVisualBits.SetBit(UNIT_FIELD_MAXPOWER3); updateVisualBits.SetBit(UNIT_FIELD_MAXPOWER4); updateVisualBits.SetBit(UNIT_FIELD_MAXPOWER5); - updateVisualBits.SetBit(UNIT_FIELD_MAXPOWER6); - updateVisualBits.SetBit(UNIT_FIELD_MAXPOWER7); updateVisualBits.SetBit(UNIT_FIELD_LEVEL); updateVisualBits.SetBit(UNIT_FIELD_FACTIONTEMPLATE); updateVisualBits.SetBit(UNIT_VIRTUAL_ITEM_SLOT_ID + 0); @@ -4603,7 +4587,6 @@ void Player::InitVisibleBits() updateVisualBits.SetBit(PLAYER_DUEL_ARBITER + 0); updateVisualBits.SetBit(PLAYER_DUEL_ARBITER + 1); updateVisualBits.SetBit(PLAYER_FLAGS); - updateVisualBits.SetBit(PLAYER_GUILDID); updateVisualBits.SetBit(PLAYER_GUILDRANK); updateVisualBits.SetBit(PLAYER_BYTES); updateVisualBits.SetBit(PLAYER_BYTES_2); @@ -5290,12 +5273,10 @@ void Player::CreateCorpse() flags |= CORPSE_FLAG_HIDE_CLOAK; if (InBattleground() && !InArena()) flags |= CORPSE_FLAG_LOOTABLE; // to be able to remove insignia - corpse->SetUInt32Value(CORPSE_FIELD_FLAGS, flags); + corpse->SetUInt32Value(CORPSE_FIELD_FLAGS, flags); corpse->SetUInt32Value(CORPSE_FIELD_DISPLAY_ID, GetNativeDisplayId()); - corpse->SetUInt32Value(CORPSE_FIELD_GUILD, GetGuildId()); - uint32 iDisplayID; uint32 iIventoryType; uint32 _cfi; @@ -7856,10 +7837,6 @@ void Player::_ApplyItemMods(Item* item, uint8 slot, bool apply) _ApplyWeaponDependentAuraMods(item, WeaponAttackType(attacktype), apply); _ApplyItemBonuses(proto, slot, apply); - - if (slot == EQUIPMENT_SLOT_RANGED) - _ApplyAmmoBonuses(); - ApplyItemEquipSpell(item, apply); ApplyEnchantment(item, apply); @@ -8649,9 +8626,6 @@ void Player::_RemoveAllItemMods() _ApplyWeaponDependentAuraMods(m_items[i], WeaponAttackType(attacktype), false); _ApplyItemBonuses(proto, i, false); - - if (i == EQUIPMENT_SLOT_RANGED) - _ApplyAmmoBonuses(); } } @@ -8678,9 +8652,6 @@ void Player::_ApplyAllItemMods() _ApplyWeaponDependentAuraMods(m_items[i], WeaponAttackType(attacktype), true); _ApplyItemBonuses(proto, i, true); - - if (i == EQUIPMENT_SLOT_RANGED) - _ApplyAmmoBonuses(); } } @@ -8725,63 +8696,6 @@ void Player::_ApplyAllLevelScaleItemMods(bool apply) } } -void Player::_ApplyAmmoBonuses() -{ - // check ammo - uint32 ammo_id = GetUInt32Value(PLAYER_AMMO_ID); - if (!ammo_id) - return; - - float currentAmmoDPS; - - ItemTemplate const* ammo_proto = sObjectMgr->GetItemTemplate(ammo_id); - if (!ammo_proto || ammo_proto->Class != ITEM_CLASS_PROJECTILE || !CheckAmmoCompatibility(ammo_proto)) - currentAmmoDPS = 0.0f; - else - currentAmmoDPS = (ammo_proto->Damage[0].DamageMin + ammo_proto->Damage[0].DamageMax) / 2; - - if (currentAmmoDPS == GetAmmoDPS()) - return; - - m_ammoDPS = currentAmmoDPS; - - if (CanModifyStats()) - UpdateDamagePhysical(RANGED_ATTACK); -} - -bool Player::CheckAmmoCompatibility(const ItemTemplate* ammo_proto) const -{ - if (!ammo_proto) - return false; - - // check ranged weapon - Item* weapon = GetWeaponForAttack(RANGED_ATTACK); - if (!weapon || weapon->IsBroken()) - return false; - - ItemTemplate const* weapon_proto = weapon->GetTemplate(); - if (!weapon_proto || weapon_proto->Class != ITEM_CLASS_WEAPON) - return false; - - // check ammo ws. weapon compatibility - switch (weapon_proto->SubClass) - { - case ITEM_SUBCLASS_WEAPON_BOW: - case ITEM_SUBCLASS_WEAPON_CROSSBOW: - if (ammo_proto->SubClass != ITEM_SUBCLASS_ARROW) - return false; - break; - case ITEM_SUBCLASS_WEAPON_GUN: - if (ammo_proto->SubClass != ITEM_SUBCLASS_BULLET) - return false; - break; - default: - return false; - } - - return true; -} - /* If in a battleground a player dies, and an enemy removes the insignia, the player's bones is lootable Called by remove insignia spell effect */ void Player::RemovedInsignia(Player* looterPlr) @@ -11999,71 +11913,6 @@ InventoryResult Player::CanUseItem(ItemTemplate const* proto) const return EQUIP_ERR_ITEM_NOT_FOUND; } -InventoryResult Player::CanUseAmmo(uint32 item) const -{ - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanUseAmmo item = %u", item); - if (!isAlive()) - return EQUIP_ERR_YOU_ARE_DEAD; - //if (isStunned()) - // return EQUIP_ERR_YOU_ARE_STUNNED; - ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(item); - if (pProto) - { - if (pProto->InventoryType!= INVTYPE_AMMO) - return EQUIP_ERR_ONLY_AMMO_CAN_GO_HERE; - - InventoryResult res = CanUseItem(pProto); - if (res != EQUIP_ERR_OK) - return res; - - /*if (GetReputationMgr().GetReputation() < pProto->RequiredReputation) - return EQUIP_ERR_CANT_EQUIP_REPUTATION; - */ - - // Requires No Ammo - if (HasAura(46699)) - return EQUIP_ERR_BAG_FULL6; - - return EQUIP_ERR_OK; - } - return EQUIP_ERR_ITEM_NOT_FOUND; -} - -void Player::SetAmmo(uint32 item) -{ - if (!item) - return; - - // already set - if (GetUInt32Value(PLAYER_AMMO_ID) == item) - return; - - // check ammo - if (item) - { - InventoryResult msg = CanUseAmmo(item); - if (msg != EQUIP_ERR_OK) - { - SendEquipError(msg, NULL, NULL, item); - return; - } - } - - SetUInt32Value(PLAYER_AMMO_ID, item); - - _ApplyAmmoBonuses(); -} - -void Player::RemoveAmmo() -{ - SetUInt32Value(PLAYER_AMMO_ID, 0); - - m_ammoDPS = 0.0f; - - if (CanModifyStats()) - UpdateDamagePhysical(RANGED_ATTACK); -} - Item* Player::StoreNewItem(ItemPosCountVec const& dest, uint32 item, bool update, int32 randomPropertyId) { AllowedLooterSet allowedLooters; @@ -16645,10 +16494,10 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) //"resettalents_time, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, online, death_expire_time, taxi_path, instance_mode_mask, " // 39 40 41 42 43 44 45 46 47 48 49 //"arenaPoints, totalHonorPoints, todayHonorPoints, yesterdayHonorPoints, totalKills, todayKills, yesterdayKills, chosenTitle, knownCurrencies, watchedFaction, drunk, " - // 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 - //"health, power1, power2, power3, power4, power5, power6, power7, power8, power9, power10, power11, instance_id, speccount, activespec, exploredZones, equipmentCache, " - // 67 68 69 70 - //"ammoId, knownTitles, actionBars, grantableLevels FROM characters WHERE guid = '%u'", guid); + // 50 51 52 53 54 55 56 57 58 59 60 + //"health, power1, power2, power3, power4, power5, instance_id, speccount, activespec, exploredZones, equipmentCache, " + // 61 62 63 64 + //"knownTitles, actionBars, grantableLevels, guildId FROM characters WHERE guid = '%u'", guid); PreparedQueryResult result = holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADFROM); if (!result) @@ -16707,8 +16556,8 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) SetUInt32Value(UNIT_FIELD_LEVEL, fields[6].GetUInt8()); SetUInt32Value(PLAYER_XP, fields[7].GetUInt32()); - _LoadIntoDataField(fields[65].GetCString(), PLAYER_EXPLORED_ZONES_1, PLAYER_EXPLORED_ZONES_SIZE); - _LoadIntoDataField(fields[68].GetCString(), PLAYER__FIELD_KNOWN_TITLES, KNOWN_TITLES_SIZE*2); + _LoadIntoDataField(fields[59].GetCString(), PLAYER_EXPLORED_ZONES_1, PLAYER_EXPLORED_ZONES_SIZE); + _LoadIntoDataField(fields[61].GetCString(), PLAYER__FIELD_KNOWN_TITLES, KNOWN_TITLES_SIZE*2); SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, DEFAULT_WORLD_OBJECT_SIZE); SetFloatValue(UNIT_FIELD_COMBATREACH, 1.5f); @@ -16730,10 +16579,8 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) SetUInt64Value(PLAYER_FIELD_KNOWN_CURRENCIES, fields[47].GetUInt64()); - SetUInt32Value(PLAYER_AMMO_ID, fields[67].GetUInt32()); - // set which actionbars the client has active - DO NOT REMOVE EVER AGAIN (can be changed though, if it does change fieldwise) - SetByteValue(PLAYER_FIELD_BYTES, 2, fields[69].GetUInt8()); + SetByteValue(PLAYER_FIELD_BYTES, 2, fields[62].GetUInt8()); InitDisplayIds(); @@ -16764,7 +16611,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) uint32 transGUID = uint32(fields[30].GetUInt64()); // field type is uint64 but lowguid is saved Relocate(fields[12].GetFloat(), fields[13].GetFloat(), fields[14].GetFloat(), fields[16].GetFloat()); uint32 mapId = fields[15].GetUInt16(); - uint32 instanceId = fields[62].GetUInt8(); + uint32 instanceId = fields[56].GetUInt8(); uint32 dungeonDiff = fields[38].GetUInt32() & 0x0F; if (dungeonDiff >= MAX_DUNGEON_DIFFICULTY) @@ -17126,8 +16973,8 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) //mails are loaded only when needed ;-) - when player in game click on mailbox. //_LoadMail(); - m_specsCount = fields[63].GetUInt8(); - m_activeSpec = fields[64].GetUInt8(); + m_specsCount = fields[57].GetUInt8(); + m_activeSpec = fields[58].GetUInt8(); // sanity check if (m_specsCount > MAX_TALENT_SPECS || m_activeSpec > MAX_TALENT_SPEC || m_specsCount < MIN_TALENT_SPECS) @@ -17199,7 +17046,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) // restore remembered power/health values (but not more max values) uint32 savedHealth = fields[50].GetUInt32(); SetHealth(savedHealth > GetMaxHealth() ? GetMaxHealth() : savedHealth); - for (uint8 i = 0; i < MAX_POWERS; ++i) + for (uint8 i = 0; i < MAX_STORED_POWERS; ++i) { uint32 savedPower = fields[51+i].GetUInt32(); SetPower(Powers(i), savedPower > GetMaxPower(Powers(i)) ? GetMaxPower(Powers(i)) : savedPower); @@ -17257,7 +17104,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) } // RaF stuff. - m_grantableLevels = fields[70].GetUInt32(); + m_grantableLevels = fields[63].GetUInt32(); if (GetSession()->IsARecruiter() || (GetSession()->GetRecruiterId() != 0)) SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_REFER_A_FRIEND); @@ -18524,7 +18371,7 @@ void Player::SaveToDB(bool create /*=false*/) stmt->setUInt16(index++, (uint16)(GetUInt32Value(PLAYER_BYTES_3) & 0xFFFE)); stmt->setUInt32(index++, GetHealth()); - for (uint32 i = 0; i < MAX_POWERS; ++i) + for (uint32 i = 0; i < MAX_STORED_POWERS; ++i) stmt->setUInt32(index++, GetPower(Powers(i))); stmt->setUInt32(index++, GetSession()->GetLatency()); @@ -18555,7 +18402,6 @@ void Player::SaveToDB(bool create /*=false*/) } stmt->setString(index++, ss.str()); - stmt->setUInt32(index++, GetUInt32Value(PLAYER_AMMO_ID)); ss.str().clear(); for (uint32 i = 0; i < KNOWN_TITLES_SIZE*2; ++i) @@ -18637,7 +18483,7 @@ void Player::SaveToDB(bool create /*=false*/) stmt->setUInt16(index++, (uint16)(GetUInt32Value(PLAYER_BYTES_3) & 0xFFFE)); stmt->setUInt32(index++, GetHealth()); - for (uint32 i = 0; i < MAX_POWERS; ++i) + for (uint32 i = 0; i < MAX_STORED_POWERS; ++i) stmt->setUInt32(index++, GetPower(Powers(i))); stmt->setUInt32(index++, GetSession()->GetLatency()); @@ -18668,7 +18514,6 @@ void Player::SaveToDB(bool create /*=false*/) } stmt->setString(index++, ss.str()); - stmt->setUInt32(index++, GetUInt32Value(PLAYER_AMMO_ID)); ss.str().clear(); for (uint32 i = 0; i < KNOWN_TITLES_SIZE*2; ++i) @@ -19142,12 +18987,12 @@ void Player::_SaveStats(SQLTransaction& trans) trans->PAppend("DELETE FROM character_stats WHERE guid = '%u'", GetGUIDLow()); std::ostringstream ss; - ss << "INSERT INTO character_stats (guid, maxhealth, maxpower1, maxpower2, maxpower3, maxpower4, maxpower5, maxpower6, maxpower7, maxpower8, maxpower9, maxpower10, maxpower11, " + ss << "INSERT INTO character_stats (guid, maxhealth, maxpower1, maxpower2, maxpower3, maxpower4, maxpower5, " "strength, agility, stamina, intellect, spirit, armor, resHoly, resFire, resNature, resFrost, resShadow, resArcane, " "blockPct, dodgePct, parryPct, critPct, rangedCritPct, spellCritPct, attackPower, rangedAttackPower, spellPower, resilience) VALUES (" << GetGUIDLow() << ',' << GetMaxHealth() << ','; - for (uint8 i = 0; i < MAX_POWERS; ++i) + for (uint8 i = 0; i < MAX_STORED_POWERS; ++i) ss << GetMaxPower(Powers(i)) << ','; for (uint8 i = 0; i < MAX_STATS; ++i) ss << GetStat(Stats(i)) << ','; diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index abbbe31b3ff..b2457a87e82 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1689,8 +1689,8 @@ class Player : public Unit, public GridObject void SetReputation(uint32 factionentry, uint32 value); uint32 GetReputation(uint32 factionentry); std::string GetGuildName(); - uint32 GetFreeTalentPoints() const { return GetUInt32Value(PLAYER_CHARACTER_POINTS1); } - void SetFreeTalentPoints(uint32 points); + uint32 GetFreeTalentPoints() const { return m_freeTalentPoints; } + void SetFreeTalentPoints(uint32 points) { m_freeTalentPoints = points; } bool resetTalents(bool no_cost = false); uint32 resetTalentsCost() const; void InitTalentForLevel(); @@ -1723,8 +1723,8 @@ class Player : public Unit, public GridObject } uint32 GetGlyph(uint8 slot) { return m_Glyphs[m_activeSpec][slot]; } - uint32 GetFreePrimaryProfessionPoints() const { return GetUInt32Value(PLAYER_CHARACTER_POINTS2); } - void SetFreePrimaryProfessions(uint16 profs) { SetUInt32Value(PLAYER_CHARACTER_POINTS2, profs); } + uint32 GetFreePrimaryProfessionPoints() const { return GetUInt32Value(PLAYER_CHARACTER_POINTS); } + void SetFreePrimaryProfessions(uint16 profs) { SetUInt32Value(PLAYER_CHARACTER_POINTS, profs); } void InitPrimaryProfessions(); PlayerSpellMap const& GetSpellMap() const { return m_spells; } @@ -1844,11 +1844,24 @@ class Player : public Unit, public GridObject void RemoveFromGroup(RemoveMethod method = GROUP_REMOVEMETHOD_DEFAULT) { RemoveFromGroup(GetGroup(), GetGUID(), method); } void SendUpdateToOutOfRangeGroupMembers(); - void SetInGuild(uint32 GuildId) { SetUInt32Value(PLAYER_GUILDID, GuildId); } + void SetInGuild(uint32 GuildId) + { + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SET_GUILD_ID); + stmt->setUInt32(0, GuildId); + stmt->setUInt64(1, GetGUID()); + CharacterDatabase.Execute(stmt); + } + + uint32 GetGuildId() + { + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_GET_GUILD_ID); + stmt->setUInt64(0, GetGUIDLow()); + PreparedQueryResult result = CharacterDatabase.Query(stmt); + return result ? (*result)[0].GetUInt32() : 0; + } void SetRank(uint8 rankId) { SetUInt32Value(PLAYER_GUILDRANK, rankId); } uint8 GetRank() { return uint8(GetUInt32Value(PLAYER_GUILDRANK)); } void SetGuildIdInvited(uint32 GuildId) { m_GuildIdInvited = GuildId; } - uint32 GetGuildId() { return GetUInt32Value(PLAYER_GUILDID); } static uint32 GetGuildIdFromDB(uint64 guid); static uint8 GetRankFromDB(uint64 guid); int GetGuildIdInvited() { return m_GuildIdInvited; } @@ -2075,6 +2088,7 @@ class Player : public Unit, public GridObject /*********************************************************/ /*** PVP SYSTEM ***/ /*********************************************************/ + // TODO: Properly implement correncies as of Cataclysm void UpdateHonorFields(); bool RewardHonor(Unit* pVictim, uint32 groupsize, int32 honor = -1, bool pvptoken = false); uint32 GetHonorPoints() const { return GetUInt32Value(PLAYER_FIELD_HONOR_CURRENCY); } @@ -2128,7 +2142,6 @@ class Player : public Unit, public GridObject void _ApplyAllLevelScaleItemMods(bool apply); void _ApplyItemBonuses(ItemTemplate const* proto, uint8 slot, bool apply, bool only_level_scale = false); void _ApplyWeaponDamage(uint8 slot, ItemTemplate const* proto, ScalingStatValuesEntry const* ssv, bool apply); - void _ApplyAmmoBonuses(); bool EnchantmentFitsRequirements(uint32 enchantmentcondition, int8 slot); void ToggleMetaGemsActive(uint8 exceptslot, bool apply); void CorrectMetaGemEnchants(uint8 slot, bool apply); @@ -2705,6 +2718,8 @@ class Player : public Unit, public GridObject uint8 m_activeSpec; uint8 m_specsCount; + uint32 m_freeTalentPoints; + uint32 m_Glyphs[MAX_TALENT_SPECS][MAX_GLYPH_SLOT_INDEX]; ActionButtonList m_actionButtons; diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index 459379ac11a..aa5d783323a 100755 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -287,13 +287,11 @@ void Player::UpdateAttackPowerAndDamage(bool ranged) UnitMods unitMod = ranged ? UNIT_MOD_ATTACK_POWER_RANGED : UNIT_MOD_ATTACK_POWER; uint16 index = UNIT_FIELD_ATTACK_POWER; - uint16 index_mod = UNIT_FIELD_ATTACK_POWER_MODS; uint16 index_mult = UNIT_FIELD_ATTACK_POWER_MULTIPLIER; if (ranged) { index = UNIT_FIELD_RANGED_ATTACK_POWER; - index_mod = UNIT_FIELD_RANGED_ATTACK_POWER_MODS; index_mult = UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER; switch (getClass()) @@ -437,10 +435,7 @@ void Player::UpdateAttackPowerAndDamage(bool ranged) } float attPowerMultiplier = GetModifierValue(unitMod, TOTAL_PCT) - 1.0f; - SetInt32Value(index, (uint32)base_attPower); //UNIT_FIELD_(RANGED)_ATTACK_POWER field - SetInt32Value(index_mod, (uint32)attPowerMod); //UNIT_FIELD_(RANGED)_ATTACK_POWER_MODS field - SetFloatValue(index_mult, attPowerMultiplier); //UNIT_FIELD_(RANGED)_ATTACK_POWER_MULTIPLIER field Pet* pet = GetPet(); //update pet's AP //automatically update weapon damage after attack power modification @@ -968,13 +963,11 @@ void Creature::UpdateAttackPowerAndDamage(bool ranged) UnitMods unitMod = ranged ? UNIT_MOD_ATTACK_POWER_RANGED : UNIT_MOD_ATTACK_POWER; uint16 index = UNIT_FIELD_ATTACK_POWER; - uint16 index_mod = UNIT_FIELD_ATTACK_POWER_MODS; uint16 index_mult = UNIT_FIELD_ATTACK_POWER_MULTIPLIER; if (ranged) { index = UNIT_FIELD_RANGED_ATTACK_POWER; - index_mod = UNIT_FIELD_RANGED_ATTACK_POWER_MODS; index_mult = UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER; } @@ -983,7 +976,6 @@ void Creature::UpdateAttackPowerAndDamage(bool ranged) float attPowerMultiplier = GetModifierValue(unitMod, TOTAL_PCT) - 1.0f; SetInt32Value(index, (uint32)base_attPower); //UNIT_FIELD_(RANGED)_ATTACK_POWER field - SetInt32Value(index_mod, (uint32)attPowerMod); //UNIT_FIELD_(RANGED)_ATTACK_POWER_MODS field SetFloatValue(index_mult, attPowerMultiplier); //UNIT_FIELD_(RANGED)_ATTACK_POWER_MULTIPLIER field //automatically update weapon damage after attack power modification @@ -1336,8 +1328,6 @@ void Guardian::UpdateAttackPowerAndDamage(bool ranged) //UNIT_FIELD_(RANGED)_ATTACK_POWER field SetInt32Value(UNIT_FIELD_ATTACK_POWER, (int32)base_attPower); - //UNIT_FIELD_(RANGED)_ATTACK_POWER_MODS field - SetInt32Value(UNIT_FIELD_ATTACK_POWER_MODS, (int32)attPowerMod); //UNIT_FIELD_(RANGED)_ATTACK_POWER_MULTIPLIER field SetFloatValue(UNIT_FIELD_ATTACK_POWER_MULTIPLIER, attPowerMultiplier); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 00471c420ce..545ba676091 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -13524,14 +13524,14 @@ float Unit::GetTotalAttackPowerValue(WeaponAttackType attType) const { if (attType == RANGED_ATTACK) { - int32 ap = GetInt32Value(UNIT_FIELD_RANGED_ATTACK_POWER) + GetInt32Value(UNIT_FIELD_RANGED_ATTACK_POWER_MODS); + int32 ap = GetInt32Value(UNIT_FIELD_RANGED_ATTACK_POWER); if (ap < 0) return 0.0f; return ap * (1.0f + GetFloatValue(UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER)); } else { - int32 ap = GetInt32Value(UNIT_FIELD_ATTACK_POWER) + GetInt32Value(UNIT_FIELD_ATTACK_POWER_MODS); + int32 ap = GetInt32Value(UNIT_FIELD_ATTACK_POWER); if (ap < 0) return 0.0f; return ap * (1.0f + GetFloatValue(UNIT_FIELD_ATTACK_POWER_MULTIPLIER)); diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 93f58003f6d..f2553b3ace5 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -2184,7 +2184,7 @@ void ObjectMgr::LoadItemTemplates() } itemTemplate.ScalingStatDistribution = uint32(fields[48].GetUInt16()); - itemTemplate.ScalingStatValue = fields[49].GetInt32(); + //itemTemplate.ScalingStatValue = fields[49].GetInt32(); for (uint8 i = 0; i < MAX_ITEM_PROTO_DAMAGES; ++i) { diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 9bca1c15423..197c12ac519 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -186,6 +186,8 @@ enum Powers POWER_HEALTH = 0xFFFFFFFE // (-2 as signed value) }; +#define MAX_STORED_POWERS 5 + enum SpellSchools { SPELL_SCHOOL_NORMAL = 0, diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index b7cc673962c..20ee5ce39e4 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -1984,7 +1984,7 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mo case FORM_DIREBEAR: { // get furor proc chance - uint32 FurorChance = 0; + int32 FurorChance = 0; if (AuraEffect const* dummy = target->GetDummyAuraEffect(SPELLFAMILY_DRUID, 238, 0)) FurorChance = std::max(dummy->GetAmount(), 0); @@ -2003,7 +2003,7 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mo target->CastSpell(target, 17057, true); default: { - uint32 newEnergy = std::min(target->GetPower(POWER_ENERGY), FurorChance); + int32 newEnergy = std::min(target->GetPower(POWER_ENERGY), FurorChance); target->SetPower(POWER_ENERGY, newEnergy); } break; @@ -2056,7 +2056,7 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mo case FORM_DEFENSIVESTANCE: case FORM_BERSERKERSTANCE: { - uint32 Rage_val = 0; + int32 Rage_val = 0; // Defensive Tactics if (form == FORM_DEFENSIVESTANCE) { @@ -4757,10 +4757,6 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool target->GetMotionMaster()->MoveFall(currentGroundLevel); } break; - case 46699: // Requires No Ammo - if (target->GetTypeId() == TYPEID_PLAYER) - target->ToPlayer()->RemoveAmmo(); // not use ammo and not allow use - break; case 49028: if (caster) if (AuraEffect* aurEff = caster->GetAuraEffect(63330, 0)) // glyph of Dancing Rune Weapon diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 4003f2f3b36..c1749867945 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3738,8 +3738,6 @@ void Spell::SendSpellStart() if ((IsTriggered() && !m_spellInfo->IsAutoRepeatRangedSpell()) || m_triggeredByAuraSpell) castFlags |= CAST_FLAG_PENDING; - if (m_spellInfo->Attributes & SPELL_ATTR0_REQ_AMMO) - castFlags |= CAST_FLAG_AMMO; if ((m_caster->GetTypeId() == TYPEID_PLAYER || (m_caster->GetTypeId() == TYPEID_UNIT && m_caster->ToCreature()->isPet())) && m_spellInfo->PowerType != POWER_HEALTH) @@ -3765,9 +3763,6 @@ void Spell::SendSpellStart() if (castFlags & CAST_FLAG_POWER_LEFT_SELF) data << uint32(m_caster->GetPower((Powers)m_spellInfo->PowerType)); - if (castFlags & CAST_FLAG_AMMO) - WriteAmmoToPacket(&data); - if (castFlags & CAST_FLAG_UNKNOWN_23) { data << uint32(0); @@ -3791,8 +3786,6 @@ void Spell::SendSpellGo() if ((IsTriggered() && !m_spellInfo->IsAutoRepeatRangedSpell()) || m_triggeredByAuraSpell) castFlags |= CAST_FLAG_PENDING; - if (m_spellInfo->Attributes & SPELL_ATTR0_REQ_AMMO) - castFlags |= CAST_FLAG_AMMO; // arrows/bullets visual if ((m_caster->GetTypeId() == TYPEID_PLAYER || (m_caster->GetTypeId() == TYPEID_UNIT && m_caster->ToCreature()->isPet())) && m_spellInfo->PowerType != POWER_HEALTH) @@ -3863,9 +3856,6 @@ void Spell::SendSpellGo() data << uint32(0); } - if (castFlags & CAST_FLAG_AMMO) - WriteAmmoToPacket(&data); - if (castFlags & CAST_FLAG_UNKNOWN_20) // unknown wotlk { data << uint32(0); @@ -3880,78 +3870,6 @@ void Spell::SendSpellGo() m_caster->SendMessageToSet(&data, true); } -void Spell::WriteAmmoToPacket(WorldPacket* data) -{ - uint32 ammoInventoryType = 0; - uint32 ammoDisplayID = 0; - - if (m_caster->GetTypeId() == TYPEID_PLAYER) - { - Item* pItem = m_caster->ToPlayer()->GetWeaponForAttack(RANGED_ATTACK); - if (pItem) - { - ammoInventoryType = pItem->GetTemplate()->InventoryType; - if (ammoInventoryType == INVTYPE_THROWN) - ammoDisplayID = pItem->GetTemplate()->DisplayInfoID; - else - { - uint32 ammoID = m_caster->ToPlayer()->GetUInt32Value(PLAYER_AMMO_ID); - if (ammoID) - { - ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(ammoID); - if (pProto) - { - ammoDisplayID = pProto->DisplayInfoID; - ammoInventoryType = pProto->InventoryType; - } - } - else if (m_caster->HasAura(46699)) // Requires No Ammo - { - ammoDisplayID = 5996; // normal arrow - ammoInventoryType = INVTYPE_AMMO; - } - } - } - } - else - { - for (uint8 i = 0; i < 3; ++i) - { - if (uint32 item_id = m_caster->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + i)) - { - if (ItemEntry const* itemEntry = sItemStore.LookupEntry(item_id)) - { - if (itemEntry->Class == ITEM_CLASS_WEAPON) - { - switch (itemEntry->SubClass) - { - case ITEM_SUBCLASS_WEAPON_THROWN: - ammoDisplayID = itemEntry->DisplayId; - ammoInventoryType = itemEntry->InventoryType; - break; - case ITEM_SUBCLASS_WEAPON_BOW: - case ITEM_SUBCLASS_WEAPON_CROSSBOW: - ammoDisplayID = 5996; // is this need fixing? - ammoInventoryType = INVTYPE_AMMO; - break; - case ITEM_SUBCLASS_WEAPON_GUN: - ammoDisplayID = 5998; // is this need fixing? - ammoInventoryType = INVTYPE_AMMO; - break; - } - - if (ammoDisplayID) - break; - } - } - } - } - } - - *data << uint32(ammoDisplayID); - *data << uint32(ammoInventoryType); -} - void Spell::WriteSpellGoTargets(WorldPacket* data) { // This function also fill data for channeled spells: @@ -4319,8 +4237,6 @@ void Spell::TakeAmmo() m_caster->ToPlayer()->DestroyItemCount(pItem, count, true); } } - else if (uint32 ammo = m_caster->ToPlayer()->GetUInt32Value(PLAYER_AMMO_ID)) - m_caster->ToPlayer()->DestroyItemCount(ammo, 1, true); } } @@ -6136,46 +6052,6 @@ SpellCastResult Spell::CheckItems() case ITEM_SUBCLASS_WEAPON_GUN: case ITEM_SUBCLASS_WEAPON_BOW: case ITEM_SUBCLASS_WEAPON_CROSSBOW: - { - uint32 ammo = m_caster->ToPlayer()->GetUInt32Value(PLAYER_AMMO_ID); - if (!ammo) - { - // Requires No Ammo - if (m_caster->HasAura(46699)) - break; // skip other checks - - return SPELL_FAILED_NO_AMMO; - } - - ItemTemplate const* ammoProto = sObjectMgr->GetItemTemplate(ammo); - if (!ammoProto) - return SPELL_FAILED_NO_AMMO; - - if (ammoProto->Class != ITEM_CLASS_PROJECTILE) - return SPELL_FAILED_NO_AMMO; - - // check ammo ws. weapon compatibility - switch (pItem->GetTemplate()->SubClass) - { - case ITEM_SUBCLASS_WEAPON_BOW: - case ITEM_SUBCLASS_WEAPON_CROSSBOW: - if (ammoProto->SubClass != ITEM_SUBCLASS_ARROW) - return SPELL_FAILED_NO_AMMO; - break; - case ITEM_SUBCLASS_WEAPON_GUN: - if (ammoProto->SubClass != ITEM_SUBCLASS_BULLET) - return SPELL_FAILED_NO_AMMO; - break; - default: - return SPELL_FAILED_NO_AMMO; - } - - if (!m_caster->ToPlayer()->HasItemCount(ammo, 1)) - { - m_caster->ToPlayer()->SetUInt32Value(PLAYER_AMMO_ID, 0); - return SPELL_FAILED_NO_AMMO; - } - }; break; case ITEM_SUBCLASS_WEAPON_WAND: break; default: diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h index 624c3b9b9b3..02f415e88c3 100755 --- a/src/server/game/Spells/Spell.h +++ b/src/server/game/Spells/Spell.h @@ -43,7 +43,7 @@ enum SpellCastFlags CAST_FLAG_UNKNOWN_3 = 0x00000004, CAST_FLAG_UNKNOWN_4 = 0x00000008, // ignore AOE visual CAST_FLAG_UNKNOWN_5 = 0x00000010, - CAST_FLAG_AMMO = 0x00000020, // Projectiles visual + CAST_FLAG_UNKNOWN_6 = 0x00000020, CAST_FLAG_UNKNOWN_7 = 0x00000040, CAST_FLAG_UNKNOWN_8 = 0x00000080, CAST_FLAG_UNKNOWN_9 = 0x00000100, @@ -402,7 +402,6 @@ class Spell void DoCreateItem(uint32 i, uint32 itemtype); void WriteSpellGoTargets(WorldPacket* data); - void WriteAmmoToPacket(WorldPacket* data); void InitExplicitTargets(SpellCastTargets const& targets); void SelectSpellTargets(); diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 8cb001ed0ac..a3ff66f7b5b 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -7344,7 +7344,7 @@ void Spell::EffectCastButtons(SpellEffIndex effIndex) if (!(spellInfo->AttributesEx7 & SPELL_ATTR7_SUMMON_PLAYER_TOTEM)) continue; - uint32 cost = spellInfo->CalcPowerCost(m_caster, spellInfo->GetSchoolMask()); + int32 cost = spellInfo->CalcPowerCost(m_caster, spellInfo->GetSchoolMask()); if (m_caster->GetPower(POWER_MANA) < cost) continue; diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 9a5a8d6f5fe..e4ee17e324d 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1258,7 +1258,7 @@ void World::SetInitialWorldSettings() ///- Load the DBC files sLog->outString("Initialize data stores..."); LoadDBCStores(m_dataPath); - LoadDB2Stores(m_dataPath); + LoadDB2Stores(m_dataPath); DetectDBCLang(); sLog->outString("Loading spell dbc data corrections..."); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp index ae6f3feb57f..fe307932988 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp @@ -357,7 +357,7 @@ class boss_lady_deathwhisper : public CreatureScript void DamageTaken(Unit* /*damageDealer*/, uint32& damage) { // phase transition - if (events.GetPhaseMask() & PHASE_ONE_MASK && damage > me->GetPower(POWER_MANA)) + if (events.GetPhaseMask() & PHASE_ONE_MASK && damage > (uint32)me->GetPower(POWER_MANA)) { Talk(SAY_PHASE_2); Talk(EMOTE_PHASE_2); diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index 94b4ca16d7f..536db9dcd30 100755 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -42,7 +42,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() "position_x, position_y, position_z, map, orientation, taximask, cinematic, totaltime, leveltime, rest_bonus, logout_time, is_logout_resting, resettalents_cost, " "resettalents_time, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, online, death_expire_time, taxi_path, instance_mode_mask, " "arenaPoints, totalHonorPoints, todayHonorPoints, yesterdayHonorPoints, totalKills, todayKills, yesterdayKills, chosenTitle, knownCurrencies, watchedFaction, drunk, " - "health, power1, power2, power3, power4, power5, power6, power7, power8, power9, power10, power11, instance_id, speccount, activespec, exploredZones, equipmentCache, ammoId, knownTitles, actionBars, grantableLevels FROM characters WHERE guid = ?", CONNECTION_ASYNC) + "health, power1, power2, power3, power4, power5, instance_id, speccount, activespec, exploredZones, equipmentCache, knownTitles, actionBars, grantableLevels, guildId FROM characters WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_LOAD_PLAYER_GROUP, "SELECT guid FROM group_member WHERE memberGuid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_LOAD_PLAYER_BOUNDINSTANCES, "SELECT id, permanent, map, difficulty, resettime FROM character_instance LEFT JOIN instance ON instance = id WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_LOAD_PLAYER_AURAS, "SELECT caster_guid, spell, effect_mask, recalculate_mask, stackcount, amount0, amount1, amount2, " @@ -116,6 +116,9 @@ void CharacterDatabaseConnection::DoPrepareStatements() // 0: uint32, 1: string, 2: uint32, 3: string, 4: string, 5: uint64, 6-10: uint32, 11: uint64 PREPARE_STATEMENT(CHAR_ADD_GUILD, "INSERT INTO guild (guildid, name, leaderguid, info, motd, createdate, EmblemStyle, EmblemColor, BorderStyle, BorderColor, BackgroundColor, BankMoney) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_GUILD, "DELETE FROM guild WHERE guildid = ?", CONNECTION_ASYNC) // 0: uint32 + // 0: uint32 + PREPARE_STATEMENT(CHAR_SET_GUILD_ID, "UPDATE characters SET guildId = ? WHERE guid = ?", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_GET_GUILD_ID, "SELECT guildId FROM characters WHERE guid = ?", CONNECTION_SYNCH) // 0: uint32, 1: uint32, 2: uint8, 4: string, 5: string PREPARE_STATEMENT(CHAR_ADD_GUILD_MEMBER, "INSERT INTO guild_member (guildid, guid, rank, pnote, offnote) VALUES (?, ?, ?, ?, ?)", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_GUILD_MEMBER, "DELETE FROM guild_member WHERE guid = ?", CONNECTION_ASYNC) // 0: uint32 @@ -262,8 +265,8 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_DEL_PLAYER_HOMEBIND, "DELETE FROM character_homebind WHERE guid = ?", CONNECTION_ASYNC) // Corpse - PREPARE_STATEMENT(CHAR_LOAD_CORPSES, "SELECT posX, posY, posZ, orientation, mapId, displayId, itemCache, bytes1, bytes2, guildId, flags, dynFlags, time, corpseType, instanceId, phaseMask, corpseGuid, guid FROM corpse WHERE corpseType <> 0", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_ADD_CORPSE, "INSERT INTO corpse (corpseGuid, guid, posX, posY, posZ, orientation, mapId, displayId, itemCache, bytes1, bytes2, guildId, flags, dynFlags, time, corpseType, instanceId, phaseMask) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_LOAD_CORPSES, "SELECT posX, posY, posZ, orientation, mapId, displayId, itemCache, bytes1, bytes2, flags, dynFlags, time, corpseType, instanceId, phaseMask, corpseGuid, guid FROM corpse WHERE corpseType <> 0", CONNECTION_SYNCH) + PREPARE_STATEMENT(CHAR_ADD_CORPSE, "INSERT INTO corpse (corpseGuid, guid, posX, posY, posZ, orientation, mapId, displayId, itemCache, bytes1, bytes2, flags, dynFlags, time, corpseType, instanceId, phaseMask) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_CORPSE, "DELETE FROM corpse WHERE corpseGuid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_PLAYER_CORPSES, "DELETE FROM corpse WHERE guid = ? AND corpseType <> 0", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_OLD_CORPSES, "DELETE FROM corpse WHERE corpseType = 0 OR time < (UNIX_TIMESTAMP(NOW()) - ?)", CONNECTION_ASYNC) @@ -308,12 +311,12 @@ void CharacterDatabaseConnection::DoPrepareStatements() "extra_flags, stable_slots, at_login, zone, " "death_expire_time, taxi_path, arenaPoints, totalHonorPoints, todayHonorPoints, yesterdayHonorPoints, totalKills, " "todayKills, yesterdayKills, chosenTitle, knownCurrencies, watchedFaction, drunk, health, power1, power2, power3, " - "power4, power5, power6, power7, latency, speccount, activespec, exploredZones, equipmentCache, ammoId, knownTitles, actionBars, grantableLevels) VALUES " - "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", CONNECTION_ASYNC); + "power4, power5, latency, speccount, activespec, exploredZones, equipmentCache, knownTitles, actionBars, grantableLevels, guildId) VALUES " + "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_UPD_CHARACTER, "UPDATE characters SET name=?,race=?,class=?,gender=?,level=?,xp=?,money=?,playerBytes=?,playerBytes2=?,playerFlags=?," "map=?,instance_id=?,instance_mode_mask=?,position_x=?,position_y=?,position_z=?,orientation=?,taximask=?,cinematic=?,totaltime=?,leveltime=?,rest_bonus=?," "logout_time=?,is_logout_resting=?,resettalents_cost=?,resettalents_time=?,extra_flags=?,stable_slots=?,at_login=?,zone=?,death_expire_time=?,taxi_path=?," "arenaPoints=?,totalHonorPoints=?,todayHonorPoints=?,yesterdayHonorPoints=?,totalKills=?,todayKills=?,yesterdayKills=?,chosenTitle=?,knownCurrencies=?," - "watchedFaction=?,drunk=?,health=?,power1=?,power2=?,power3=?,power4=?,power5=?,power6=?,power7=?,latency=?,speccount=?,activespec=?,exploredZones=?," - "equipmentCache=?,ammoId=?,knownTitles=?,actionBars=?,grantableLevels=?,online=? WHERE guid=?", CONNECTION_ASYNC); + "watchedFaction=?,drunk=?,health=?,power1=?,power2=?,power3=?,power4=?,power5=?,latency=?,speccount=?,activespec=?,exploredZones=?," + "equipmentCache=?,knownTitles=?,actionBars=?,grantableLevels=?,guildId=?,online=? WHERE guid=?", CONNECTION_ASYNC); } diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.h b/src/server/shared/Database/Implementation/CharacterDatabase.h index f06a17aa924..c84ea5544fa 100755 --- a/src/server/shared/Database/Implementation/CharacterDatabase.h +++ b/src/server/shared/Database/Implementation/CharacterDatabase.h @@ -123,6 +123,8 @@ enum CharacterDatabaseStatements CHAR_ADD_GUILD, CHAR_DEL_GUILD, + CHAR_SET_GUILD_ID, + CHAR_GET_GUILD_ID, CHAR_ADD_GUILD_MEMBER, CHAR_DEL_GUILD_MEMBER, CHAR_DEL_GUILD_MEMBERS, -- cgit v1.2.3 From 8d3bc5e8b9515499f366ec7173d70978bb0009e7 Mon Sep 17 00:00:00 2001 From: Nay Date: Fri, 25 Nov 2011 20:49:03 +0000 Subject: Core/Corpse: Fix indexing in Corpse::SaveToDB(). Thanks @Ciclop --- src/server/game/Entities/Corpse/Corpse.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Entities/Corpse/Corpse.cpp b/src/server/game/Entities/Corpse/Corpse.cpp index ff8c93ec404..43f3a085748 100755 --- a/src/server/game/Entities/Corpse/Corpse.cpp +++ b/src/server/game/Entities/Corpse/Corpse.cpp @@ -108,7 +108,7 @@ void Corpse::SaveToDB() uint16 index = 0; PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_CORPSE); - stmt->setUInt32(index, GetGUIDLow()); // corpseGuid + stmt->setUInt32(index++, GetGUIDLow()); // corpseGuid stmt->setUInt32(index++, GUID_LOPART(GetOwnerGUID())); // guid stmt->setFloat (index++, GetPositionX()); // posX stmt->setFloat (index++, GetPositionY()); // posY -- cgit v1.2.3 From e8c3a3ac9c032cf56ec11620ba7dd33efed487c5 Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 25 Nov 2011 23:24:40 +0100 Subject: Core/Items * Updated ItemTemplate structure to 4.x * Calculate armor, damage and disenchant loot from dbc files TODO: Use dbc disenchant ids in disenchant_loot_template --- .../2011_11_25_02_world_item_script_names.sql | 17 + .../world/2011_11_25_02_world_item_template.sql | 48 + .../2011_11_25_02_world_item_template_addon.sql | 38 + src/server/game/DataStores/DBCStores.cpp | 22 +- src/server/game/DataStores/DBCStores.h | 1 + src/server/game/DataStores/DBCStructure.h | 14 +- src/server/game/DataStores/DBCfmt.h | 1 + src/server/game/Entities/Item/ItemPrototype.h | 54 +- src/server/game/Entities/Player/Player.cpp | 55 +- src/server/game/Entities/Player/Player.h | 4 +- src/server/game/Entities/Unit/Unit.cpp | 4 +- src/server/game/Globals/ObjectMgr.cpp | 971 +++++++++------------ src/server/game/Globals/ObjectMgr.h | 3 +- src/server/game/Guilds/GuildMgr.cpp | 2 +- src/server/game/Loot/LootMgr.cpp | 21 +- .../game/Server/Protocol/Handlers/ItemHandler.cpp | 294 +++---- src/server/game/Server/Protocol/Opcodes.cpp | 8 +- src/server/game/Server/WorldSession.h | 4 +- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 2 +- src/server/game/Spells/Spell.cpp | 2 +- src/server/game/Spells/SpellEffects.cpp | 4 +- src/server/game/World/World.cpp | 14 +- .../Database/Implementation/CharacterDatabase.cpp | 2 +- src/server/shared/Packets/ByteBuffer.h | 2 +- 24 files changed, 784 insertions(+), 803 deletions(-) create mode 100644 sql/updates/world/2011_11_25_02_world_item_script_names.sql create mode 100644 sql/updates/world/2011_11_25_02_world_item_template.sql create mode 100644 sql/updates/world/2011_11_25_02_world_item_template_addon.sql (limited to 'src') diff --git a/sql/updates/world/2011_11_25_02_world_item_script_names.sql b/sql/updates/world/2011_11_25_02_world_item_script_names.sql new file mode 100644 index 00000000000..aaf843b91ae --- /dev/null +++ b/sql/updates/world/2011_11_25_02_world_item_script_names.sql @@ -0,0 +1,17 @@ +DROP TABLE IF EXISTS `item_script_names`; +CREATE TABLE `item_script_names` ( +`Id` int(10) unsigned not null, +`ScriptName` varchar(64) not null, +PRIMARY KEY(`Id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; + +INSERT INTO `item_script_names` +SELECT +`item_template`.`entry` AS `Id`, +`item_template`.`ScriptName` AS `ScriptName` +FROM +`item_template` +WHERE +length(`item_template`.`ScriptName`)>0; + +ALTER TABLE `item_template` DROP `ScriptName`; diff --git a/sql/updates/world/2011_11_25_02_world_item_template.sql b/sql/updates/world/2011_11_25_02_world_item_template.sql new file mode 100644 index 00000000000..8a047ed9d11 --- /dev/null +++ b/sql/updates/world/2011_11_25_02_world_item_template.sql @@ -0,0 +1,48 @@ +ALTER TABLE `item_template` + ADD `stat_unk1_1` int(11) not null default 0 AFTER `stat_value1`, + ADD `stat_unk2_1` int(11) not null default 0 AFTER `stat_unk1_1`, + ADD `stat_unk1_2` int(11) not null default 0 AFTER `stat_value2`, + ADD `stat_unk2_2` int(11) not null default 0 AFTER `stat_unk1_2`, + ADD `stat_unk1_3` int(11) not null default 0 AFTER `stat_value3`, + ADD `stat_unk2_3` int(11) not null default 0 AFTER `stat_unk1_3`, + ADD `stat_unk1_4` int(11) not null default 0 AFTER `stat_value4`, + ADD `stat_unk2_4` int(11) not null default 0 AFTER `stat_unk1_4`, + ADD `stat_unk1_5` int(11) not null default 0 AFTER `stat_value5`, + ADD `stat_unk2_5` int(11) not null default 0 AFTER `stat_unk1_5`, + ADD `stat_unk1_6` int(11) not null default 0 AFTER `stat_value6`, + ADD `stat_unk2_6` int(11) not null default 0 AFTER `stat_unk1_6`, + ADD `stat_unk1_7` int(11) not null default 0 AFTER `stat_value7`, + ADD `stat_unk2_7` int(11) not null default 0 AFTER `stat_unk1_7`, + ADD `stat_unk1_8` int(11) not null default 0 AFTER `stat_value8`, + ADD `stat_unk2_8` int(11) not null default 0 AFTER `stat_unk1_8`, + ADD `stat_unk1_9` int(11) not null default 0 AFTER `stat_value9`, + ADD `stat_unk2_9` int(11) not null default 0 AFTER `stat_unk1_9`, + ADD `stat_unk1_10` int(11) not null default 0 AFTER `stat_value10`, + ADD `stat_unk2_10` int(11) not null default 0 AFTER `stat_unk1_10`, + DROP `StatsCount`, + DROP `ScalingStatValue`, + CHANGE `dmg_type1` `DamageType` tinyint(3) unsigned not null default 0 AFTER `ScalingStatDistribution`, + DROP `dmg_min1`, + DROP `dmg_max1`, + DROP `dmg_min2`, + DROP `dmg_max2`, + DROP `dmg_type2`, + DROP `armor`, + DROP `holy_res`, + DROP `fire_res`, + DROP `nature_res`, + DROP `frost_res`, + DROP `shadow_res`, + DROP `arcane_res`, + DROP `ammo_type`, + DROP `spellppmRate_1`, + DROP `spellppmRate_2`, + DROP `spellppmRate_3`, + DROP `spellppmRate_4`, + DROP `spellppmRate_5`, + DROP `block`, + DROP `RequiredDisenchantSkill`, + DROP `DisenchantId`, + ADD `StatScalingFactor` float not null default 0 AFTER `HolidayId`, + ADD `Field130` int(11) not null default 0 AFTER `StatScalingFactor`, + ADD `Field131` int(11) not null default 0 AFTER `Field130`; diff --git a/sql/updates/world/2011_11_25_02_world_item_template_addon.sql b/sql/updates/world/2011_11_25_02_world_item_template_addon.sql new file mode 100644 index 00000000000..2d99d9fc610 --- /dev/null +++ b/sql/updates/world/2011_11_25_02_world_item_template_addon.sql @@ -0,0 +1,38 @@ +DROP TABLE IF EXISTS `item_template_addon`; +CREATE TABLE `item_template_addon` ( +`Id` int(10) unsigned not null, +`BuyCount` tinyint(3) unsigned not null default 1, +`FoodType` tinyint(3) unsigned not null default 0, +`MinMoneyLoot` int(10) unsigned not null default 0, +`MaxMoneyLoot` int(10) unsigned not null default 0, +`SpellPPMChance` float unsigned not null default 0, +PRIMARY KEY(`Id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; + +INSERT INTO `item_template_addon` +SELECT +`item_template`.`entry` AS `Id`, +`item_template`.`BuyCount` AS `BuyCount`, +`item_template`.`FoodType` AS `FoodType`, +`item_template`.`minMoneyLoot` AS `MinMoneyLoot`, +`item_template`.`maxMoneyLoot` AS `MaxMoneyLoot`, +ABS(IF(`item_template`.`spelltrigger_1`=2, `item_template`.`spellppmRate_1`, + IF (`item_template`.`spelltrigger_2`=2, `item_template`.`spellppmRate_2`, + IF (`item_template`.`spelltrigger_3`=2, `item_template`.`spellppmRate_3`, + IF (`item_template`.`spelltrigger_4`=2, `item_template`.`spellppmRate_4`, + IF (`item_template`.`spelltrigger_5`=2, `item_template`.`spellppmRate_5`, 0)))))) + AS `SpellPPMChance` +FROM +`item_template` +HAVING -- need to use having due to `SpellPPMChance` usage which is not an actual field in table +`item_template`.`BuyCount`!=1 OR +`item_template`.`FoodType`!=0 OR +(`item_template`.`minMoneyLoot`!=0 AND +`item_template`.`maxMoneyLoot`!=0) OR +`SpellPPMChance`!=0; + +ALTER TABLE `item_template` + DROP `BuyCount`, + DROP `FoodType`, + DROP `minMoneyLoot`, + DROP `maxMoneyLoot`; diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index ceba8d178cf..9bdbce70acc 100755 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -111,20 +111,12 @@ DBCStorage sGtRegenMPPerSptStore(GtRegenMPPerSptf DBCStorage sHolidaysStore(Holidaysfmt); -DBCStorage sItemClassStore(ItemClassfmt); -//DBCStorage sItemStore(Itemfmt); -DBCStorage sItemBagFamilyStore(ItemBagFamilyfmt); -//DBCStorage sItemCondExtCostsStore(ItemCondExtCostsEntryfmt); -//DBCStorage sItemDisplayInfoStore(ItemDisplayTemplateEntryfmt); -- not used currently -//DBCStorage sItemExtendedCostStore(ItemExtendedCostEntryfmt); -DBCStorage sItemLimitCategoryStore(ItemLimitCategoryEntryfmt); -DBCStorage sItemRandomPropertiesStore(ItemRandomPropertiesfmt); -DBCStorage sItemRandomSuffixStore(ItemRandomSuffixfmt); -DBCStorage sItemSetStore(ItemSetEntryfmt); - DBCStorage sItemArmorQualityStore(ItemArmorQualityfmt); DBCStorage sItemArmorShieldStore(ItemArmorShieldfmt); DBCStorage sItemArmorTotalStore(ItemArmorTotalfmt); +DBCStorage sItemBagFamilyStore(ItemBagFamilyfmt); +DBCStorage sItemClassStore(ItemClassfmt); +//DBCStorage sItemCondExtCostsStore(ItemCondExtCostsEntryfmt); DBCStorage sItemDamageAmmoStore(ItemDamagefmt); DBCStorage sItemDamageOneHandStore(ItemDamagefmt); DBCStorage sItemDamageOneHandCasterStore(ItemDamagefmt); @@ -133,6 +125,13 @@ DBCStorage sItemDamageThrownStore(ItemDamagefmt); DBCStorage sItemDamageTwoHandStore(ItemDamagefmt); DBCStorage sItemDamageTwoHandCasterStore(ItemDamagefmt); DBCStorage sItemDamageWandStore(ItemDamagefmt); +DBCStorage sItemDisenchantLootStore(ItemDisenchantLootfmt); +//DBCStorage sItemDisplayInfoStore(ItemDisplayTemplateEntryfmt); -- not used currently +//DBCStorage sItemExtendedCostStore(ItemExtendedCostEntryfmt); +DBCStorage sItemLimitCategoryStore(ItemLimitCategoryEntryfmt); +DBCStorage sItemRandomPropertiesStore(ItemRandomPropertiesfmt); +DBCStorage sItemRandomSuffixStore(ItemRandomSuffixfmt); +DBCStorage sItemSetStore(ItemSetEntryfmt); DBCStorage sLFGDungeonStore(LFGDungeonEntryfmt); //DBCStorage sLiquidTypeStore(LiquidTypeEntryfmt); @@ -409,6 +408,7 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sItemDamageTwoHandStore, dbcPath, "ItemDamageTwoHand.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sItemDamageTwoHandCasterStore,dbcPath, "ItemDamageTwoHandCaster.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sItemDamageWandStore, dbcPath, "ItemDamageWand.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sItemDisenchantLootStore, dbcPath, "ItemDisenchantLoot.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sItemClassStore, dbcPath,"ItemClass.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sLFGDungeonStore, dbcPath, "LFGDungeons.dbc");//14545 diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h index fc20d61982f..aee179af3b2 100755 --- a/src/server/game/DataStores/DBCStores.h +++ b/src/server/game/DataStores/DBCStores.h @@ -128,6 +128,7 @@ extern DBCStorage sItemDamageTwoHandStore; extern DBCStorage sItemDamageTwoHandCasterStore; extern DBCStorage sItemDamageWandStore; //extern DBCStorage sItemDisplayInfoStore; -- not used currently +extern DBCStorage sItemDisenchantLootStore; extern DBCStorage sItemLimitCategoryStore; extern DBCStorage sItemRandomPropertiesStore; extern DBCStorage sItemRandomSuffixStore; diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 7dbb8a200aa..ae71b24bdcb 100755 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -1169,7 +1169,7 @@ struct ItemClassEntry struct ItemDamageEntry { uint32 Id; // 0 item level - float Value[7]; // 1-7 multiplier for item quality + float DPS[7]; // 1-7 multiplier for item quality uint32 Id2; // 8 item level }; @@ -1216,6 +1216,17 @@ struct ItemDisplayInfoEntry // 11 m_particleColorID }; +struct ItemDisenchantLootEntry +{ + uint32 Id; + uint32 ItemClass; + int32 Unk; + uint32 ItemQuality; + uint32 MinItemLevel; + uint32 MaxItemLevel; + uint32 RequiredDisenchantSkill; +}; + //struct ItemCondExtCostsEntry //{ // uint32 ID; @@ -2317,4 +2328,3 @@ typedef std::vector TaxiPathNodesByPath; #define TaxiMaskSize 14 typedef uint32 TaxiMask[TaxiMaskSize]; #endif - diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index be2fe6916e4..28df75f185b 100755 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -82,6 +82,7 @@ const char ItemArmorQualityfmt[]="nfffffffi"; const char ItemArmorShieldfmt[]="nifffffff"; const char ItemArmorTotalfmt[]="niffff"; const char ItemDamagefmt[]="nfffffffi"; +const char ItemDisenchantLootfmt[]="niiiiii"; const char ItemClassfmt[]="dixxx"; //const char ItemDisplayTemplateEntryfmt[]="nxxxxxxxxxxixxxxxxxxxxx"; //const char ItemCondExtCostsEntryfmt[]="xiii"; diff --git a/src/server/game/Entities/Item/ItemPrototype.h b/src/server/game/Entities/Item/ItemPrototype.h index c15189dfb5f..0234b90e7f5 100755 --- a/src/server/game/Entities/Item/ItemPrototype.h +++ b/src/server/game/Entities/Item/ItemPrototype.h @@ -67,7 +67,15 @@ enum ItemModType ITEM_MOD_SPELL_POWER = 45, ITEM_MOD_HEALTH_REGEN = 46, ITEM_MOD_SPELL_PENETRATION = 47, - ITEM_MOD_BLOCK_VALUE = 48 + ITEM_MOD_BLOCK_VALUE = 48, + ITEM_MOD_MASTERY_RATING = 49, + ITEM_MOD_EXTRA_ARMOR = 50, + ITEM_MOD_FIRE_RESISTANCE = 51, + ITEM_MOD_FROST_RESISTANCE = 52, + ITEM_MOD_HOLY_RESISTANCE = 53, + ITEM_MOD_SHADOW_RESISTANCE = 54, + ITEM_MOD_NATURE_RESISTANCE = 55, + ITEM_MOD_ARCANE_RESISTANCE = 56, }; #define MAX_ITEM_MOD 49 @@ -543,24 +551,19 @@ inline uint8 ItemSubClassToDurabilityMultiplierId(uint32 ItemClass, uint32 ItemS #pragma pack(push, 1) #endif -struct _Damage -{ - float DamageMin; - float DamageMax; - uint32 DamageType; // id from Resistances.dbc -}; - struct _ItemStat { uint32 ItemStatType; int32 ItemStatValue; + int32 ItemStatUnk1; + int32 ItemStatUnk2; }; + struct _Spell { int32 SpellId; // id from Spell.dbc uint32 SpellTrigger; int32 SpellCharges; - float SpellPPMRate; int32 SpellCooldown; uint32 SpellCategory; // id from SpellCategory.dbc int32 SpellCategoryCooldown; @@ -583,7 +586,7 @@ struct ItemTemplate uint32 Class; // id from ItemClass.dbc uint32 SubClass; // id from ItemSubClass.dbc int32 Unk0; - std::string Name1; + std::string Name1; uint32 DisplayInfoID; // id from ItemDisplayInfo.dbc uint32 Quality; uint32 Flags; @@ -609,18 +612,15 @@ struct ItemTemplate uint32 StatsCount; _ItemStat ItemStat[MAX_ITEM_PROTO_STATS]; uint32 ScalingStatDistribution; // id from ScalingStatDistribution.dbc - _Damage Damage[MAX_ITEM_PROTO_DAMAGES]; + float DamageMin; + float DamageMax; + uint32 DamageType; // id from Resistances.dbc + float DPS; uint32 Armor; - uint32 HolyRes; - uint32 FireRes; - uint32 NatureRes; - uint32 FrostRes; - uint32 ShadowRes; - uint32 ArcaneRes; uint32 Delay; - uint32 AmmoType; float RangedModRange; _Spell Spells[MAX_ITEM_PROTO_SPELLS]; + float SpellPPMRate; uint32 Bonding; std::string Description; uint32 PageText; @@ -632,7 +632,6 @@ struct ItemTemplate uint32 Sheath; int32 RandomProperty; // id from ItemRandomProperties.dbc int32 RandomSuffix; // id from ItemRandomSuffix.dbc - uint32 Block; uint32 ItemSet; // id from ItemSet.dbc uint32 MaxDurability; uint32 Area; // id from AreaTable.dbc @@ -647,6 +646,9 @@ struct ItemTemplate int32 Duration; // negative = realtime, positive = ingame time uint32 ItemLimitCategory; // id from ItemLimitCategory.dbc uint32 HolidayId; // id from Holidays.dbc + float StatScalingFactor; + int32 Field130; + int32 Field131; uint32 ScriptId; uint32 DisenchantID; uint32 FoodType; @@ -679,22 +681,12 @@ struct ItemTemplate return (Stackable == 2147483647 || Stackable <= 0) ? uint32(0x7FFFFFFF-1) : uint32(Stackable); } - float getDPS() const - { - if (Delay == 0) - return 0; - float temp = 0; - for (int i = 0; i < MAX_ITEM_PROTO_DAMAGES; ++i) - temp+=Damage[i].DamageMin + Damage[i].DamageMax; - return temp*500/Delay; - } - int32 getFeralBonus(int32 extraDPS = 0) const { // 0x02A5F3 - is mask for Melee weapon from ItemSubClassMask.dbc - if (Class == ITEM_CLASS_WEAPON && (1<ArmorDamageModifier > 0) HandleStatModifier(UNIT_MOD_ARMOR, TOTAL_VALUE, float(proto->ArmorDamageModifier), apply); - if (proto->Block) - HandleBaseModValue(SHIELD_BLOCK_VALUE, FLAT_MOD, float(proto->Block), apply); - - if (proto->HolyRes) - HandleStatModifier(UNIT_MOD_RESISTANCE_HOLY, BASE_VALUE, float(proto->HolyRes), apply); - - if (proto->FireRes) - HandleStatModifier(UNIT_MOD_RESISTANCE_FIRE, BASE_VALUE, float(proto->FireRes), apply); - - if (proto->NatureRes) - HandleStatModifier(UNIT_MOD_RESISTANCE_NATURE, BASE_VALUE, float(proto->NatureRes), apply); - - if (proto->FrostRes) - HandleStatModifier(UNIT_MOD_RESISTANCE_FROST, BASE_VALUE, float(proto->FrostRes), apply); - - if (proto->ShadowRes) - HandleStatModifier(UNIT_MOD_RESISTANCE_SHADOW, BASE_VALUE, float(proto->ShadowRes), apply); - - if (proto->ArcaneRes) - HandleStatModifier(UNIT_MOD_RESISTANCE_ARCANE, BASE_VALUE, float(proto->ArcaneRes), apply); - WeaponAttackType attType = BASE_ATTACK; if (slot == EQUIPMENT_SLOT_RANGED && ( @@ -8123,8 +8120,8 @@ void Player::_ApplyWeaponDamage(uint8 slot, ItemTemplate const* proto, ScalingSt attType = OFF_ATTACK; } - float minDamage = proto->Damage[0].DamageMin; - float maxDamage = proto->Damage[0].DamageMax; + float minDamage = proto->DamageMin; + float maxDamage = proto->DamageMax; // If set dpsMod in ScalingStatValue use it for min (70% from average), max (130% from average) damage int32 extraDPS = 0; @@ -8410,7 +8407,7 @@ void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32 float chance = (float)spellInfo->ProcChance; - if (spellData.SpellPPMRate) + if (proto->SpellPPMRate) { if (spellData.SpellId == 52781) // Persuasive Strike { @@ -8425,7 +8422,7 @@ void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32 } } uint32 WeaponSpeed = GetAttackTime(attType); - chance = GetPPMProcChance(WeaponSpeed, spellData.SpellPPMRate, spellInfo); + chance = GetPPMProcChance(WeaponSpeed, proto->SpellPPMRate, spellInfo); } else if (chance > 100.0f) { @@ -18334,7 +18331,7 @@ void Player::SaveToDB(bool create /*=false*/) stmt->setFloat(index++, finiteAlways(GetPositionY())); stmt->setFloat(index++, finiteAlways(GetPositionZ())); stmt->setFloat(index++, finiteAlways(GetOrientation())); - + std::ostringstream ss; ss << m_taxi; stmt->setString(index++, ss.str()); @@ -18356,7 +18353,7 @@ void Player::SaveToDB(bool create /*=false*/) ss.str().clear(); ss << m_taxi.SaveTaxiDestinationsToString(); - + stmt->setString(index++, ss.str()); stmt->setUInt32(index++, GetArenaPoints()); stmt->setUInt32(index++, GetHonorPoints()); @@ -18389,7 +18386,7 @@ void Player::SaveToDB(bool create /*=false*/) for (uint32 i = 0; i < EQUIPMENT_SLOT_END * 2; ++i) ss << GetUInt32Value(PLAYER_VISIBLE_ITEM_1_ENTRYID + i) << ' '; stmt->setString(index++, ss.str()); - + ss.str().clear(); // ...and bags for enum opcode for (uint32 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) @@ -24825,4 +24822,4 @@ bool Player::IsInWhisperWhiteList(uint64 guid) return true; } return false; -} +} \ No newline at end of file diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index b2457a87e82..efe9dd487d5 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1844,7 +1844,7 @@ class Player : public Unit, public GridObject void RemoveFromGroup(RemoveMethod method = GROUP_REMOVEMETHOD_DEFAULT) { RemoveFromGroup(GetGroup(), GetGUID(), method); } void SendUpdateToOutOfRangeGroupMembers(); - void SetInGuild(uint32 GuildId) + void SetInGuild(uint32 GuildId) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SET_GUILD_ID); stmt->setUInt32(0, GuildId); @@ -2538,7 +2538,7 @@ class Player : public Unit, public GridObject CreatureDisplayInfoEntry const* mountDisplayInfo = sCreatureDisplayInfoStore.LookupEntry(GetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID)); if (!mountDisplayInfo) return GetCollisionHeight(false); - + CreatureModelDataEntry const* mountModelData = sCreatureModelDataStore.LookupEntry(mountDisplayInfo->ModelId); if (!mountModelData) return GetCollisionHeight(false); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 545ba676091..87834d27f34 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -2715,7 +2715,7 @@ float Unit::GetUnitBlockChance() const if (player->CanBlock()) { Item* tmpitem = player->GetUseableItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND); - if (tmpitem && !tmpitem->IsBroken() && tmpitem->GetTemplate()->Block) + if (tmpitem && !tmpitem->IsBroken()) return GetFloatValue(PLAYER_BLOCK_PERCENTAGE); } // is player but has no block ability or no not broken shield equipped @@ -8674,7 +8674,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg ItemTemplate const* weapon = item->GetTemplate(); - float weaponDPS = weapon->getDPS(); + float weaponDPS = weapon->DPS; float attackPower = GetTotalAttackPowerValue(BASE_ATTACK) / 14.0f; float weaponSpeed = float(weapon->Delay) / 1000.0f; basepoints0 = int32((weaponDPS + attackPower) * weaponSpeed); diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index f2553b3ace5..3218f954078 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -2093,600 +2093,493 @@ void ObjectMgr::LoadItemLocales() sLog->outString(); } -void ObjectMgr::LoadItemTemplates() +void FillItemDamageFields(float* minDamage, float* maxDamage, float* dps, uint32 itemLevel, uint32 itemClass, uint32 itemSubClass, uint32 quality, uint32 delay, float statScalingFactor, uint32 inventoryType, uint32 flags2) { - uint32 oldMSTime = getMSTime(); - - // 0 1 2 3 4 5 6 7 8 9 10 11 12 - QueryResult result = WorldDatabase.Query("SELECT entry, class, subclass, unk0, name, displayid, Quality, Flags, FlagsExtra, BuyCount, BuyPrice, SellPrice, InventoryType, " - // 13 14 15 16 17 18 19 20 - "AllowableClass, AllowableRace, ItemLevel, RequiredLevel, RequiredSkill, RequiredSkillRank, requiredspell, requiredhonorrank, " - // 21 22 23 24 25 26 27 28 - "RequiredCityRank, RequiredReputationFaction, RequiredReputationRank, maxcount, stackable, ContainerSlots, StatsCount, stat_type1, " - // 29 30 31 32 33 34 35 36 37 38 - "stat_value1, stat_type2, stat_value2, stat_type3, stat_value3, stat_type4, stat_value4, stat_type5, stat_value5, stat_type6, " - // 39 40 41 42 43 44 45 46 47 - "stat_value6, stat_type7, stat_value7, stat_type8, stat_value8, stat_type9, stat_value9, stat_type10, stat_value10, " - // 48 49 50 51 52 53 54 55 56 57 58 - "ScalingStatDistribution, ScalingStatValue, dmg_min1, dmg_max1, dmg_type1, dmg_min2, dmg_max2, dmg_type2, armor, holy_res, fire_res, " - // 59 60 61 62 63 64 65 66 67 68 - "nature_res, frost_res, shadow_res, arcane_res, delay, ammo_type, RangedModRange, spellid_1, spelltrigger_1, spellcharges_1, " - // 69 70 71 72 73 74 75 - "spellppmRate_1, spellcooldown_1, spellcategory_1, spellcategorycooldown_1, spellid_2, spelltrigger_2, spellcharges_2, " - // 76 77 78 79 80 81 82 - "spellppmRate_2, spellcooldown_2, spellcategory_2, spellcategorycooldown_2, spellid_3, spelltrigger_3, spellcharges_3, " - // 83 84 85 86 87 88 89 - "spellppmRate_3, spellcooldown_3, spellcategory_3, spellcategorycooldown_3, spellid_4, spelltrigger_4, spellcharges_4, " - // 90 91 92 93 94 95 96 - "spellppmRate_4, spellcooldown_4, spellcategory_4, spellcategorycooldown_4, spellid_5, spelltrigger_5, spellcharges_5, " - // 97 98 99 100 101 102 103 104 105 - "spellppmRate_5, spellcooldown_5, spellcategory_5, spellcategorycooldown_5, bonding, description, PageText, LanguageID, PageMaterial, " - // 106 107 108 109 110 111 112 113 114 115 116 117 - "startquest, lockid, Material, sheath, RandomProperty, RandomSuffix, block, itemset, MaxDurability, area, Map, BagFamily, " - // 118 119 120 121 122 123 124 125 - "TotemCategory, socketColor_1, socketContent_1, socketColor_2, socketContent_2, socketColor_3, socketContent_3, socketBonus, " - // 126 127 128 129 130 131 132 133 - "GemProperties, RequiredDisenchantSkill, ArmorDamageModifier, Duration, ItemLimitCategory, HolidayId, ScriptName, DisenchantID, " - // 134 135 136 - "FoodType, minMoneyLoot, maxMoneyLoot FROM item_template"); - - if (!result) - { - sLog->outString(">> Loaded 0 item templates. DB table `item_template` is empty."); - sLog->outString(); + *minDamage = *maxDamage = *dps = 0.0f; + if (itemClass != ITEM_CLASS_WEAPON || quality > ITEM_QUALITY_ARTIFACT) return; - } - uint32 count = 0; - bool enforceDBCAttributes = sWorld->getBoolConfig(CONFIG_DBC_ENFORCE_ITEM_ATTRIBUTES); + DBCStorage* store = NULL; + // get the right store here + if (inventoryType > 0xD + 13) + return; - do + switch (inventoryType) { - Field* fields = result->Fetch(); - - uint32 entry = fields[0].GetUInt32(); - - ItemTemplate& itemTemplate = ItemTemplateStore[entry]; - - itemTemplate.ItemId = entry; - itemTemplate.Class = uint32(fields[1].GetUInt8()); - itemTemplate.SubClass = uint32(fields[2].GetUInt8()); - itemTemplate.Unk0 = fields[3].GetInt32(); - itemTemplate.Name1 = fields[4].GetString(); - itemTemplate.DisplayInfoID = fields[5].GetUInt32(); - itemTemplate.Quality = uint32(fields[6].GetUInt8()); - itemTemplate.Flags = uint32(fields[7].GetInt64()); - itemTemplate.Flags2 = fields[8].GetUInt32(); - itemTemplate.BuyCount = uint32(fields[9].GetUInt8()); - itemTemplate.BuyPrice = int32(fields[10].GetInt64()); - itemTemplate.SellPrice = fields[11].GetUInt32(); - itemTemplate.InventoryType = uint32(fields[12].GetUInt8()); - itemTemplate.AllowableClass = fields[13].GetInt32(); - itemTemplate.AllowableRace = fields[14].GetInt32(); - itemTemplate.ItemLevel = uint32(fields[15].GetUInt16()); - itemTemplate.RequiredLevel = uint32(fields[16].GetUInt8()); - itemTemplate.RequiredSkill = uint32(fields[17].GetUInt16()); - itemTemplate.RequiredSkillRank = uint32(fields[18].GetUInt16()); - itemTemplate.RequiredSpell = fields[19].GetUInt32(); - itemTemplate.RequiredHonorRank = fields[20].GetUInt32(); - itemTemplate.RequiredCityRank = fields[21].GetUInt32(); - itemTemplate.RequiredReputationFaction = uint32(fields[22].GetUInt16()); - itemTemplate.RequiredReputationRank = uint32(fields[23].GetUInt16()); - itemTemplate.MaxCount = fields[24].GetInt32(); - itemTemplate.Stackable = fields[25].GetInt32(); - itemTemplate.ContainerSlots = uint32(fields[26].GetUInt8()); - itemTemplate.StatsCount = uint32(fields[27].GetUInt8()); - - for (uint8 i = 0; i < itemTemplate.StatsCount; ++i) - { - itemTemplate.ItemStat[i].ItemStatType = uint32(fields[28 + i*2].GetUInt8()); - itemTemplate.ItemStat[i].ItemStatValue = int32(fields[29 + i*2].GetInt16()); - } - - itemTemplate.ScalingStatDistribution = uint32(fields[48].GetUInt16()); - //itemTemplate.ScalingStatValue = fields[49].GetInt32(); - - for (uint8 i = 0; i < MAX_ITEM_PROTO_DAMAGES; ++i) - { - itemTemplate.Damage[i].DamageMin = fields[50 + i*3].GetFloat(); - itemTemplate.Damage[i].DamageMax = fields[51 + i*3].GetFloat(); - itemTemplate.Damage[i].DamageType = uint32(fields[52 + i*3].GetUInt8()); - } - - itemTemplate.Armor = uint32(fields[56].GetUInt16()); - itemTemplate.HolyRes = uint32(fields[57].GetUInt8()); - itemTemplate.FireRes = uint32(fields[58].GetUInt8()); - itemTemplate.NatureRes = uint32(fields[59].GetUInt8()); - itemTemplate.FrostRes = uint32(fields[60].GetUInt8()); - itemTemplate.ShadowRes = uint32(fields[61].GetUInt8()); - itemTemplate.ArcaneRes = uint32(fields[62].GetUInt8()); - itemTemplate.Delay = uint32(fields[63].GetUInt16()); - itemTemplate.AmmoType = uint32(fields[64].GetUInt8()); - itemTemplate.RangedModRange = fields[65].GetFloat(); - - for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i) - { - itemTemplate.Spells[i].SpellId = fields[66 + i*7 ].GetInt32(); - itemTemplate.Spells[i].SpellTrigger = uint32(fields[67 + i*7].GetUInt8()); - itemTemplate.Spells[i].SpellCharges = int32(fields[68 + i*7].GetInt16()); - itemTemplate.Spells[i].SpellPPMRate = fields[69 + i*7].GetFloat(); - itemTemplate.Spells[i].SpellCooldown = fields[70 + i*7].GetInt32(); - itemTemplate.Spells[i].SpellCategory = uint32(fields[71 + i*7].GetUInt16()); - itemTemplate.Spells[i].SpellCategoryCooldown = fields[72 + i*7].GetInt32(); - } - - itemTemplate.Bonding = uint32(fields[101].GetUInt8()); - itemTemplate.Description = fields[102].GetString(); - itemTemplate.PageText = fields[103].GetUInt32(); - itemTemplate.LanguageID = uint32(fields[104].GetUInt8()); - itemTemplate.PageMaterial = uint32(fields[105].GetUInt8()); - itemTemplate.StartQuest = fields[106].GetUInt32(); - itemTemplate.LockID = fields[107].GetUInt32(); - itemTemplate.Material = int32(fields[108].GetInt8()); - itemTemplate.Sheath = uint32(fields[109].GetUInt8()); - itemTemplate.RandomProperty = fields[110].GetUInt32(); - itemTemplate.RandomSuffix = fields[111].GetInt32(); - itemTemplate.Block = fields[112].GetUInt32(); - itemTemplate.ItemSet = fields[113].GetUInt32(); - itemTemplate.MaxDurability = uint32(fields[114].GetUInt16()); - itemTemplate.Area = fields[115].GetUInt32(); - itemTemplate.Map = uint32(fields[116].GetUInt16()); - itemTemplate.BagFamily = fields[117].GetUInt32(); - itemTemplate.TotemCategory = fields[118].GetUInt32(); - - for (uint8 i = 0; i < MAX_ITEM_PROTO_SOCKETS; ++i) - { - itemTemplate.Socket[i].Color = uint32(fields[119 + i*2].GetUInt8()); - itemTemplate.Socket[i].Content = fields[120 + i*2].GetUInt32(); - } - - itemTemplate.socketBonus = fields[125].GetUInt32(); - itemTemplate.GemProperties = fields[126].GetUInt32(); - itemTemplate.RequiredDisenchantSkill = uint32(fields[127].GetInt16()); - itemTemplate.ArmorDamageModifier = fields[128].GetFloat(); - itemTemplate.Duration = fields[129].GetInt32(); - itemTemplate.ItemLimitCategory = uint32(fields[130].GetInt16()); - itemTemplate.HolidayId = fields[131].GetUInt32(); - itemTemplate.ScriptId = sObjectMgr->GetScriptId(fields[132].GetCString()); - itemTemplate.DisenchantID = fields[133].GetUInt32(); - itemTemplate.FoodType = uint32(fields[134].GetUInt8()); - itemTemplate.MinMoneyLoot = fields[135].GetUInt32(); - itemTemplate.MaxMoneyLoot = fields[136].GetUInt32(); - - // Checks - - /*ItemEntry const* dbcitem = sItemStore.LookupEntry(entry); - - if (dbcitem) - { - if (itemTemplate.Class != dbcitem->Class) - { - sLog->outErrorDb("Item (Entry: %u) does not have a correct class %u, must be %u .", entry, itemTemplate.Class, dbcitem->Class); - if (enforceDBCAttributes) - itemTemplate.Class = dbcitem->Class; - } - - if (itemTemplate.Unk0 != dbcitem->Unk0) - { - sLog->outErrorDb("Item (Entry: %u) does not have a correct Unk0 (%i), must be %i .", entry, itemTemplate.Unk0, dbcitem->Unk0); - if (enforceDBCAttributes) - itemTemplate.Unk0 = dbcitem->Unk0; - } - if (itemTemplate.Material != dbcitem->Material) - { - sLog->outErrorDb("Item (Entry: %u) does not have a correct material (%i), must be %i .", entry, itemTemplate.Material, dbcitem->Material); - if (enforceDBCAttributes) - itemTemplate.Material = dbcitem->Material; - } - if (itemTemplate.InventoryType != dbcitem->InventoryType) - { - sLog->outErrorDb("Item (Entry: %u) does not have a correct inventory type (%u), must be %u .", entry, itemTemplate.InventoryType, dbcitem->InventoryType); - if (enforceDBCAttributes) - itemTemplate.InventoryType = dbcitem->InventoryType; - } - if (itemTemplate.DisplayInfoID != dbcitem->DisplayId) - { - sLog->outErrorDb("Item (Entry: %u) does not have a correct display id (%u), must be %u .", entry, itemTemplate.DisplayInfoID, dbcitem->DisplayId); - if (enforceDBCAttributes) - itemTemplate.DisplayInfoID = dbcitem->DisplayId; - } - if (itemTemplate.Sheath != dbcitem->Sheath) + case INVTYPE_AMMO: + store = &sItemDamageAmmoStore; + break; + case INVTYPE_2HWEAPON: + if (flags2 & ITEM_FLAGS_EXTRA_CASTER_WEAPON) + store = &sItemDamageTwoHandCasterStore; + else + store = &sItemDamageTwoHandStore; + break; + case INVTYPE_RANGED: + case INVTYPE_THROWN: + case INVTYPE_RANGEDRIGHT: + switch (itemSubClass) { - sLog->outErrorDb("Item (Entry: %u) does not have a correct sheathid (%u), must be %u .", entry, itemTemplate.Sheath, dbcitem->Sheath); - if (enforceDBCAttributes) - itemTemplate.Sheath = dbcitem->Sheath; + case ITEM_SUBCLASS_WEAPON_WAND: + store = &sItemDamageWandStore; + break; + case ITEM_SUBCLASS_WEAPON_THROWN: + store = &sItemDamageThrownStore; + break; + case ITEM_SUBCLASS_WEAPON_BOW: + case ITEM_SUBCLASS_WEAPON_GUN: + case ITEM_SUBCLASS_WEAPON_CROSSBOW: + store = &sItemDamageRangedStore; + break; + default: + return; } + break; + case INVTYPE_WEAPON: + case INVTYPE_WEAPONMAINHAND: + case INVTYPE_WEAPONOFFHAND: + if (flags2 & ITEM_FLAGS_EXTRA_CASTER_WEAPON) + store = &sItemDamageOneHandCasterStore; + else + store = &sItemDamageOneHandStore; + break; + default: + return; + } - } - else - sLog->outErrorDb("Item (Entry: %u) does not exist in item.dbc! (not correct id?).", entry);*/ - - if (itemTemplate.Class >= MAX_ITEM_CLASS) - { - sLog->outErrorDb("Item (Entry: %u) has wrong Class value (%u)", entry, itemTemplate.Class); - itemTemplate.Class = ITEM_CLASS_MISC; - } - - if (itemTemplate.SubClass >= MaxItemSubclassValues[itemTemplate.Class]) - { - sLog->outErrorDb("Item (Entry: %u) has wrong Subclass value (%u) for class %u", entry, itemTemplate.SubClass, itemTemplate.Class); - itemTemplate.SubClass = 0;// exist for all item classes - } + if (!store) + return; - if (itemTemplate.Quality >= MAX_ITEM_QUALITY) - { - sLog->outErrorDb("Item (Entry: %u) has wrong Quality value (%u)", entry, itemTemplate.Quality); - itemTemplate.Quality = ITEM_QUALITY_NORMAL; - } + ItemDamageEntry const* damageInfo = store->LookupEntry(itemLevel); + if (!damageInfo) + return; - if (itemTemplate.Flags2 & ITEM_FLAGS_EXTRA_HORDE_ONLY) - { - if (FactionEntry const* faction = sFactionStore.LookupEntry(HORDE)) - if ((itemTemplate.AllowableRace & faction->BaseRepRaceMask[0]) == 0) - sLog->outErrorDb("Item (Entry: %u) has value (%u) in `AllowableRace` races, not compatible with ITEM_FLAGS_EXTRA_HORDE_ONLY (%u) in Flags field, item cannot be equipped or used by these races.", - entry, itemTemplate.AllowableRace, ITEM_FLAGS_EXTRA_HORDE_ONLY); + *dps = damageInfo->DPS[quality]; + float avgDamage = *dps * delay * 0.001f; + *minDamage = (statScalingFactor * -0.5f + 1.0f) * avgDamage; + *maxDamage = floor(float(avgDamage * (statScalingFactor * 0.5f + 1.0f) + 0.5f)); +} - if (itemTemplate.Flags2 & ITEM_FLAGS_EXTRA_ALLIANCE_ONLY) - sLog->outErrorDb("Item (Entry: %u) has value (%u) in `Flags2` flags (ITEM_FLAGS_EXTRA_ALLIANCE_ONLY) and ITEM_FLAGS_EXTRA_HORDE_ONLY (%u) in Flags field, this is a wrong combination.", - entry, ITEM_FLAGS_EXTRA_ALLIANCE_ONLY, ITEM_FLAGS_EXTRA_HORDE_ONLY); - } - else if (itemTemplate.Flags2 & ITEM_FLAGS_EXTRA_ALLIANCE_ONLY) - { - if (FactionEntry const* faction = sFactionStore.LookupEntry(ALLIANCE)) - if ((itemTemplate.AllowableRace & faction->BaseRepRaceMask[0]) == 0) - sLog->outErrorDb("Item (Entry: %u) has value (%u) in `AllowableRace` races, not compatible with ITEM_FLAGS_EXTRA_ALLIANCE_ONLY (%u) in Flags field, item cannot be equipped or used by these races.", - entry, itemTemplate.AllowableRace, ITEM_FLAGS_EXTRA_ALLIANCE_ONLY); - } +uint32 FillItemArmor(uint32 itemlevel, uint32 itemClass, uint32 itemSubclass, uint32 quality, uint32 inventoryType) +{ + if (quality > ITEM_QUALITY_ARTIFACT) + return 0; - if (itemTemplate.BuyCount <= 0) - { - sLog->outErrorDb("Item (Entry: %u) has wrong BuyCount value (%u), set to default(1).", entry, itemTemplate.BuyCount); - itemTemplate.BuyCount = 1; - } + // all items but shields + if (itemClass != ITEM_CLASS_ARMOR || itemSubclass != ITEM_SUBCLASS_ARMOR_SHIELD) + { + ItemArmorQualityEntry const* armorQuality = sItemArmorQualityStore.LookupEntry(itemlevel); + ItemArmorTotalEntry const* armorToral = sItemArmorTotalStore.LookupEntry(itemlevel); + if (!armorQuality || !armorToral) + return 0; - if (itemTemplate.InventoryType >= MAX_INVTYPE) - { - sLog->outErrorDb("Item (Entry: %u) has wrong InventoryType value (%u)", entry, itemTemplate.InventoryType); - itemTemplate.InventoryType = INVTYPE_NON_EQUIP; - } + if (inventoryType == INVTYPE_ROBE) + inventoryType = INVTYPE_CHEST; - if (itemTemplate.RequiredSkill >= MAX_SKILL_TYPE) - { - sLog->outErrorDb("Item (Entry: %u) has wrong RequiredSkill value (%u)", entry, itemTemplate.RequiredSkill); - itemTemplate.RequiredSkill = 0; - } + ArmorLocationEntry const* location = sArmorLocationStore.LookupEntry(inventoryType); + if (!location) + return 0; - { - // can be used in equip slot, as page read use in inventory, or spell casting at use - bool req = itemTemplate.InventoryType != INVTYPE_NON_EQUIP || itemTemplate.PageText; - if (!req) - for (uint8 j = 0; j < MAX_ITEM_PROTO_SPELLS; ++j) - { - if (itemTemplate.Spells[j].SpellId) - { - req = true; - break; - } - } + if (itemSubclass < ITEM_SUBCLASS_ARMOR_CLOTH) + return 0; - if (req) - { - if (!(itemTemplate.AllowableClass & CLASSMASK_ALL_PLAYABLE)) - sLog->outErrorDb("Item (Entry: %u) does not have any playable classes (%u) in `AllowableClass` and can't be equipped or used.", entry, itemTemplate.AllowableClass); + return uint32(armorQuality->Value[quality] * armorToral->Value[quality] * location->Value[itemSubclass - 1] + 0.5f); + } - if (!(itemTemplate.AllowableRace & RACEMASK_ALL_PLAYABLE)) - sLog->outErrorDb("Item (Entry: %u) does not have any playable races (%u) in `AllowableRace` and can't be equipped or used.", entry, itemTemplate.AllowableRace); - } - } + // shields + ItemArmorShieldEntry const* shield = sItemArmorShieldStore.LookupEntry(itemlevel); + if (!shield) + return 0; - if (itemTemplate.RequiredSpell && !sSpellMgr->GetSpellInfo(itemTemplate.RequiredSpell)) - { - sLog->outErrorDb("Item (Entry: %u) has a wrong (non-existing) spell in RequiredSpell (%u)", entry, itemTemplate.RequiredSpell); - itemTemplate.RequiredSpell = 0; - } + return uint32(shield->Value[quality] + 0.5f); +} - if (itemTemplate.RequiredReputationRank >= MAX_REPUTATION_RANK) - sLog->outErrorDb("Item (Entry: %u) has wrong reputation rank in RequiredReputationRank (%u), item can't be used.", entry, itemTemplate.RequiredReputationRank); +void FillDisenchantFields(uint32* disenchantID, uint32* requiredDisenchantSkill, uint32 itemClass, uint32 quality, uint32 itemLevel) +{ + for (uint32 i = 0; i < sItemDisenchantLootStore.GetNumRows(); ++i) + { + ItemDisenchantLootEntry const* disenchant = sItemDisenchantLootStore.LookupEntry(i); + if (!disenchant) + continue; - if (itemTemplate.RequiredReputationFaction) + if (disenchant->ItemClass == itemClass && + disenchant->ItemQuality == quality && + disenchant->MinItemLevel <= itemLevel && + disenchant->MaxItemLevel >= itemLevel) { - if (!sFactionStore.LookupEntry(itemTemplate.RequiredReputationFaction)) - { - sLog->outErrorDb("Item (Entry: %u) has wrong (not existing) faction in RequiredReputationFaction (%u)", entry, itemTemplate.RequiredReputationFaction); - itemTemplate.RequiredReputationFaction = 0; - } - - if (itemTemplate.RequiredReputationRank == MIN_REPUTATION_RANK) - sLog->outErrorDb("Item (Entry: %u) has min. reputation rank in RequiredReputationRank (0) but RequiredReputationFaction > 0, faction setting is useless.", entry); + *disenchantID = disenchant->Id; + *requiredDisenchantSkill = disenchant->RequiredDisenchantSkill; + return; } + } - if (itemTemplate.MaxCount < -1) - { - sLog->outErrorDb("Item (Entry: %u) has too large negative in maxcount (%i), replace by value (-1) no storing limits.", entry, itemTemplate.MaxCount); - itemTemplate.MaxCount = -1; - } + *disenchantID = 0; + *(int32*)requiredDisenchantSkill = -1; +} - if (itemTemplate.Stackable == 0) - { - sLog->outErrorDb("Item (Entry: %u) has wrong value in stackable (%i), replace by default 1.", entry, itemTemplate.Stackable); - itemTemplate.Stackable = 1; - } - else if (itemTemplate.Stackable < -1) - { - sLog->outErrorDb("Item (Entry: %u) has too large negative in stackable (%i), replace by value (-1) no stacking limits.", entry, itemTemplate.Stackable); - itemTemplate.Stackable = -1; - } +void ObjectMgr::LoadItemTemplates() +{ + uint32 oldMSTime = getMSTime(); + uint32 sparseCount = 0; + uint32 dbCount = 0; - if (itemTemplate.ContainerSlots > MAX_BAG_SIZE) - { - sLog->outErrorDb("Item (Entry: %u) has too large value in ContainerSlots (%u), replace by hardcoded limit (%u).", entry, itemTemplate.ContainerSlots, MAX_BAG_SIZE); - itemTemplate.ContainerSlots = MAX_BAG_SIZE; - } + for (uint32 itemId = 0; itemId < sItemSparseStore.GetNumRows(); ++itemId) + { + ItemSparseEntry const* sparse = sItemSparseStore.LookupEntry(itemId); + ItemEntry const* db2Data = sItemStore.LookupEntry(itemId); + if (!sparse || !db2Data) + continue; - if (itemTemplate.StatsCount > MAX_ITEM_PROTO_STATS) - { - sLog->outErrorDb("Item (Entry: %u) has too large value in statscount (%u), replace by hardcoded limit (%u).", entry, itemTemplate.StatsCount, MAX_ITEM_PROTO_STATS); - itemTemplate.StatsCount = MAX_ITEM_PROTO_STATS; - } + ItemTemplate& itemTemplate = ItemTemplateStore[itemId]; + + itemTemplate.ItemId = itemId; + itemTemplate.Class = db2Data->Class; + itemTemplate.SubClass = db2Data->SubClass; + itemTemplate.Unk0 = db2Data->Unk0; + itemTemplate.Name1 = sparse->Name; + itemTemplate.DisplayInfoID = db2Data->DisplayId; + itemTemplate.Quality = sparse->Quality; + itemTemplate.Flags = sparse->Flags; + itemTemplate.Flags2 = sparse->Flags2; + itemTemplate.BuyCount = 1; + itemTemplate.BuyPrice = sparse->BuyPrice; + itemTemplate.SellPrice = sparse->SellPrice; + itemTemplate.InventoryType = db2Data->InventoryType; + itemTemplate.AllowableClass = sparse->AllowableClass; + itemTemplate.AllowableRace = sparse->AllowableRace; + itemTemplate.ItemLevel = sparse->ItemLevel; + itemTemplate.RequiredLevel = sparse->RequiredLevel; + itemTemplate.RequiredSkill = sparse->RequiredSkill; + itemTemplate.RequiredSkillRank = sparse->RequiredSkillRank; + itemTemplate.RequiredSpell = sparse->RequiredSpell; + itemTemplate.RequiredHonorRank = sparse->RequiredHonorRank; + itemTemplate.RequiredCityRank = sparse->RequiredCityRank; + itemTemplate.RequiredReputationFaction = sparse->RequiredReputationFaction; + itemTemplate.RequiredReputationRank = sparse->RequiredReputationRank; + itemTemplate.MaxCount = sparse->MaxCount; + itemTemplate.Stackable = sparse->Stackable; + itemTemplate.ContainerSlots = sparse->ContainerSlots; + for (uint32 i = 0; i < MAX_ITEM_PROTO_STATS; ++i) + { + itemTemplate.ItemStat[i].ItemStatType = sparse->ItemStatType[i]; + itemTemplate.ItemStat[i].ItemStatValue = sparse->ItemStatValue[i]; + itemTemplate.ItemStat[i].ItemStatUnk1 = sparse->ItemStatUnk1[i]; + itemTemplate.ItemStat[i].ItemStatUnk2 = sparse->ItemStatUnk2[i]; + } + + itemTemplate.ScalingStatDistribution = sparse->ScalingStatDistribution; + + // cache item damage + FillItemDamageFields(&itemTemplate.DamageMin, &itemTemplate.DamageMax, &itemTemplate.DPS, sparse->ItemLevel, + db2Data->Class, db2Data->SubClass, sparse->Quality, sparse->Delay, sparse->StatScalingFactor, + sparse->InventoryType, sparse->Flags2); + + itemTemplate.DamageType = sparse->DamageType; + itemTemplate.Armor = FillItemArmor(sparse->ItemLevel, db2Data->Class, db2Data->SubClass, sparse->Quality, sparse->InventoryType); + itemTemplate.Delay = sparse->Delay; + itemTemplate.RangedModRange = sparse->RangedModRange; + for (uint32 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i) + { + itemTemplate.Spells[i].SpellId = sparse->SpellId[i]; + itemTemplate.Spells[i].SpellTrigger = sparse->SpellTrigger[i]; + itemTemplate.Spells[i].SpellCharges = sparse->SpellCharges[i]; + itemTemplate.Spells[i].SpellCooldown = sparse->SpellCooldown[i]; + itemTemplate.Spells[i].SpellCategory = sparse->SpellCategory[i]; + itemTemplate.Spells[i].SpellCategoryCooldown = sparse->SpellCategoryCooldown[i]; + } + + itemTemplate.SpellPPMRate = 0.0f; + itemTemplate.Bonding = sparse->Bonding; + itemTemplate.Description = sparse->Description; + itemTemplate.PageText = sparse->PageText; + itemTemplate.LanguageID = sparse->LanguageID; + itemTemplate.PageMaterial = sparse->PageMaterial; + itemTemplate.StartQuest = sparse->StartQuest; + itemTemplate.LockID = sparse->LockID; + itemTemplate.Material = sparse->Material; + itemTemplate.Sheath = sparse->Sheath; + itemTemplate.RandomProperty = sparse->RandomProperty; + itemTemplate.RandomSuffix = sparse->RandomSuffix; + itemTemplate.ItemSet = sparse->ItemSet; + itemTemplate.MaxDurability = sparse->MaxDurability; + itemTemplate.Area = sparse->Area; + itemTemplate.Map = sparse->Map; + itemTemplate.BagFamily = sparse->BagFamily; + itemTemplate.TotemCategory = sparse->TotemCategory; + for (uint32 i = 0; i < MAX_ITEM_PROTO_SOCKETS; ++i) + { + itemTemplate.Socket[i].Color = sparse->Color[i]; + itemTemplate.Socket[i].Content = sparse->Content[i]; + } + + itemTemplate.socketBonus = sparse->SocketBonus; + itemTemplate.GemProperties = sparse->GemProperties; + FillDisenchantFields(&itemTemplate.DisenchantID, &itemTemplate.RequiredDisenchantSkill, + db2Data->Class, sparse->Quality, sparse->ItemLevel); + + itemTemplate.ArmorDamageModifier = sparse->ArmorDamageModifier; + itemTemplate.Duration = sparse->Duration; + itemTemplate.ItemLimitCategory = sparse->ItemLimitCategory; + itemTemplate.HolidayId = sparse->HolidayId; + itemTemplate.StatScalingFactor = sparse->StatScalingFactor; + itemTemplate.Field130 = sparse->Field130; + itemTemplate.Field131 = sparse->Field131; + itemTemplate.ScriptId = 0; + itemTemplate.FoodType = 0; + itemTemplate.MinMoneyLoot = 0; + itemTemplate.MaxMoneyLoot = 0; + ++sparseCount; + } + + // Load missing items from item_template AND overwrite data from Item-sparse.db2 (item_template is supposed to contain Item-sparse.adb data) + // 0 1 2 3 4 5 6 7 8 9 10 11 + QueryResult result = WorldDatabase.Query("SELECT entry, Class, SubClass, Unk0, Name, DisplayId, Quality, Flags, FlagsExtra, BuyPrice, SellPrice, InventoryType, " + // 12 13 14 15 16 17 18 19 + "AllowableClass, AllowableRace, ItemLevel, RequiredLevel, RequiredSkill, RequiredSkillRank, RequiredSpell, RequiredHonorRank, " + // 20 21 22 23 24 25 + "RequiredCityRank, RequiredReputationFaction, RequiredReputationRank, MaxCount, Stackable, ContainerSlots, " + // 26 27 28 29 30 31 32 33 + "stat_type1, stat_value1, stat_unk1_1, stat_unk2_1, stat_type2, stat_value2, stat_unk1_2, stat_unk2_2, " + // 34 35 36 37 38 39 40 41 + "stat_type3, stat_value3, stat_unk1_3, stat_unk2_3, stat_type4, stat_value4, stat_unk1_4, stat_unk2_4, " + // 42 43 44 45 46 47 48 49 + "stat_type5, stat_value5, stat_unk1_5, stat_unk2_5, stat_type6, stat_value6, stat_unk1_6, stat_unk2_6, " + // 50 51 52 53 54 55 56 57 + "stat_type7, stat_value7, stat_unk1_7, stat_unk2_7, stat_type8, stat_value8, stat_unk1_8, stat_unk2_8, " + // 58 59 60 61 62 63 64 65 + "stat_type9, stat_value9, stat_unk1_9, stat_unk2_9, stat_type10, stat_value10, stat_unk1_10, stat_unk2_10, " + // 66 67 68 69 + "ScalingStatDistribution, DamageType, Delay, RangedModRange, " + // 70 71 72 73 74 75 + "spellid_1, spelltrigger_1, spellcharges_1, spellcooldown_1, spellcategory_1, spellcategorycooldown_1, " + // 76 77 78 79 80 81 + "spellid_2, spelltrigger_2, spellcharges_2, spellcooldown_2, spellcategory_2, spellcategorycooldown_2, " + // 82 83 84 85 86 87 + "spellid_3, spelltrigger_3, spellcharges_3, spellcooldown_3, spellcategory_3, spellcategorycooldown_3, " + // 88 89 90 91 92 93 + "spellid_4, spelltrigger_4, spellcharges_4, spellcooldown_4, spellcategory_4, spellcategorycooldown_4, " + // 94 95 96 97 98 99 + "spellid_5, spelltrigger_5, spellcharges_5, spellcooldown_5, spellcategory_5, spellcategorycooldown_5, " + // 100 101 102 103 104 105 106 107 + "Bonding, Description, PageText, LanguageID, PageMaterial, StartQuest, LockID, Material, " + // 108 109 110 111 112 113 114 115 116 + "Sheath, RandomProperty, RandomSuffix, ItemSet, MaxDurability, Area, Map, BagFamily, TotemCategory, " + // 117 118 119 120 121 122 123 + "SocketColor_1, SocketContent_1, SocketColor_2, SocketContent_2, SocketColor_3, SocketContent_3, SocketBonus, " + // 124 125 126 127 128 129 130 131 + "GemProperties, ArmorDamageModifier, Duration, ItemLimitCategory, HolidayId, StatScalingFactor, Field130, Field131 " + "FROM item_template"); - for (uint8 j = 0; j < itemTemplate.StatsCount; ++j) + if (result) + { + do { - // for ItemStatValue != 0 - if (itemTemplate.ItemStat[j].ItemStatValue && itemTemplate.ItemStat[j].ItemStatType >= MAX_ITEM_MOD) - { - sLog->outErrorDb("Item (Entry: %u) has wrong (non-existing?) stat_type%d (%u)", entry, j+1, itemTemplate.ItemStat[j].ItemStatType); - itemTemplate.ItemStat[j].ItemStatType = 0; - } - - switch (itemTemplate.ItemStat[j].ItemStatType) - { - case ITEM_MOD_SPELL_HEALING_DONE: - case ITEM_MOD_SPELL_DAMAGE_DONE: - sLog->outErrorDb("Item (Entry: %u) has deprecated stat_type%d (%u)", entry, j+1, itemTemplate.ItemStat[j].ItemStatType); - break; - default: - break; - } - } + Field* fields = result->Fetch(); + uint32 itemId = fields[0].GetUInt32(); + if (ItemTemplateStore.find(itemId) != ItemTemplateStore.end()) + --sparseCount; + + ItemTemplate& itemTemplate = ItemTemplateStore[itemId]; + + itemTemplate.ItemId = itemId; + itemTemplate.Class = fields[1].GetUInt32(); + itemTemplate.SubClass = fields[2].GetUInt32(); + itemTemplate.Unk0 = fields[3].GetInt32(); + itemTemplate.Name1 = fields[4].GetString(); + itemTemplate.DisplayInfoID = fields[5].GetUInt32(); + itemTemplate.Quality = fields[6].GetUInt32(); + itemTemplate.Flags = fields[7].GetUInt32(); + itemTemplate.Flags2 = fields[8].GetUInt32(); + itemTemplate.BuyCount = 1; + itemTemplate.BuyPrice = fields[9].GetInt32(); + itemTemplate.SellPrice = fields[10].GetUInt32(); + itemTemplate.InventoryType = fields[11].GetUInt32(); + itemTemplate.AllowableClass = fields[12].GetUInt32(); + itemTemplate.AllowableRace = fields[13].GetUInt32(); + itemTemplate.ItemLevel = fields[14].GetUInt32(); + itemTemplate.RequiredLevel = fields[15].GetUInt32(); + itemTemplate.RequiredSkill = fields[16].GetUInt32(); + itemTemplate.RequiredSkillRank = fields[17].GetUInt32(); + itemTemplate.RequiredSpell = fields[18].GetUInt32(); + itemTemplate.RequiredHonorRank = fields[19].GetUInt32(); + itemTemplate.RequiredCityRank = fields[20].GetUInt32(); + itemTemplate.RequiredReputationFaction = fields[21].GetUInt32(); + itemTemplate.RequiredReputationRank = fields[22].GetUInt32(); + itemTemplate.MaxCount = fields[23].GetInt32(); + itemTemplate.Stackable = fields[24].GetInt32(); + itemTemplate.ContainerSlots = fields[25].GetUInt32(); + for (uint32 i = 0; i < MAX_ITEM_PROTO_STATS; ++i) + { + itemTemplate.ItemStat[i].ItemStatType = fields[26 + i * 4].GetUInt32(); + itemTemplate.ItemStat[i].ItemStatValue = fields[26 + i * 4 + 1].GetInt32(); + itemTemplate.ItemStat[i].ItemStatUnk1 = fields[26 + i * 4 + 2].GetInt32(); + itemTemplate.ItemStat[i].ItemStatUnk2 = fields[26 + i * 4 + 3].GetInt32(); + } + + itemTemplate.ScalingStatDistribution = fields[66].GetUInt32(); + + // cache item damage + FillItemDamageFields(&itemTemplate.DamageMin, &itemTemplate.DamageMax, &itemTemplate.DPS, itemTemplate.ItemLevel, + itemTemplate.Class, itemTemplate.SubClass, itemTemplate.Quality, fields[68].GetUInt32(), + fields[129].GetFloat(), itemTemplate.InventoryType, itemTemplate.Flags2); + + itemTemplate.DamageType = fields[67].GetUInt32(); + itemTemplate.Armor = FillItemArmor(itemTemplate.ItemLevel, itemTemplate.Class, itemTemplate.SubClass, itemTemplate.Quality, itemTemplate.InventoryType); + itemTemplate.Delay = fields[68].GetUInt32(); + itemTemplate.RangedModRange = fields[69].GetFloat(); + for (uint32 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i) + { + itemTemplate.Spells[i].SpellId = fields[70 + 6 * i].GetInt32(); + itemTemplate.Spells[i].SpellTrigger = fields[70 + 6 * i + 1].GetUInt32(); + itemTemplate.Spells[i].SpellCharges = fields[70 + 6 * i + 2].GetInt32(); + itemTemplate.Spells[i].SpellCooldown = fields[70 + 6 * i + 3].GetInt32(); + itemTemplate.Spells[i].SpellCategory = fields[70 + 6 * i + 4].GetUInt32(); + itemTemplate.Spells[i].SpellCategoryCooldown = fields[70 + 6 * i + 5].GetInt32(); + } + + itemTemplate.SpellPPMRate = 0.0f; + itemTemplate.Bonding = fields[100].GetUInt32(); + itemTemplate.Description = fields[101].GetString(); + itemTemplate.PageText = fields[102].GetUInt32(); + itemTemplate.LanguageID = fields[103].GetUInt32(); + itemTemplate.PageMaterial = fields[104].GetUInt32(); + itemTemplate.StartQuest = fields[105].GetUInt32(); + itemTemplate.LockID = fields[106].GetUInt32(); + itemTemplate.Material = fields[107].GetInt32(); + itemTemplate.Sheath = fields[108].GetUInt32(); + itemTemplate.RandomProperty = fields[109].GetInt32(); + itemTemplate.RandomSuffix = fields[110].GetInt32(); + itemTemplate.ItemSet = fields[111].GetUInt32(); + itemTemplate.MaxDurability = fields[112].GetUInt32(); + itemTemplate.Area = fields[113].GetUInt32(); + itemTemplate.Map = fields[114].GetUInt32(); + itemTemplate.BagFamily = fields[115].GetUInt32(); + itemTemplate.TotemCategory = fields[116].GetUInt32(); + for (uint32 i = 0; i < MAX_ITEM_PROTO_SOCKETS; ++i) + { + itemTemplate.Socket[i].Color = fields[117 + i * 2].GetUInt32(); + itemTemplate.Socket[i].Content = fields[117 + i * 2 + 1].GetUInt32(); + } + + itemTemplate.socketBonus = fields[123].GetUInt32(); + itemTemplate.GemProperties = fields[124].GetUInt32(); + FillDisenchantFields(&itemTemplate.DisenchantID, &itemTemplate.RequiredDisenchantSkill, + itemTemplate.Class, itemTemplate.Quality, itemTemplate.ItemLevel); + + itemTemplate.ArmorDamageModifier = fields[125].GetFloat(); + itemTemplate.Duration = fields[126].GetUInt32(); + itemTemplate.ItemLimitCategory = fields[127].GetUInt32(); + itemTemplate.HolidayId = fields[128].GetUInt32(); + itemTemplate.StatScalingFactor = fields[129].GetFloat(); + itemTemplate.Field130 = fields[130].GetInt32(); + itemTemplate.Field131 = fields[131].GetInt32(); + itemTemplate.ScriptId = 0; + itemTemplate.FoodType = 0; + itemTemplate.MinMoneyLoot = 0; + itemTemplate.MaxMoneyLoot = 0; + ++dbCount; + } while (result->NextRow()); + } - for (uint8 j = 0; j < MAX_ITEM_PROTO_DAMAGES; ++j) - { - if (itemTemplate.Damage[j].DamageType >= MAX_SPELL_SCHOOL) - { - sLog->outErrorDb("Item (Entry: %u) has wrong dmg_type%d (%u)", entry, j+1, itemTemplate.Damage[j].DamageType); - itemTemplate.Damage[j].DamageType = 0; - } - } + // Check if item templates for DBC referenced character start outfit are present + std::set notFoundOutfit; + for (uint32 i = 1; i < sCharStartOutfitStore.GetNumRows(); ++i) + { + CharStartOutfitEntry const* entry = sCharStartOutfitStore.LookupEntry(i); + if (!entry) + continue; - // special format - if ((itemTemplate.Spells[0].SpellId == 483) || (itemTemplate.Spells[0].SpellId == 55884)) + for (int j = 0; j < MAX_OUTFIT_ITEMS; ++j) { - // spell_1 - if (itemTemplate.Spells[0].SpellTrigger != ITEM_SPELLTRIGGER_ON_USE) - { - sLog->outErrorDb("Item (Entry: %u) has wrong item spell trigger value in spelltrigger_%d (%u) for special learning format", entry, 0+1, itemTemplate.Spells[0].SpellTrigger); - itemTemplate.Spells[0].SpellId = 0; - itemTemplate.Spells[0].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE; - itemTemplate.Spells[1].SpellId = 0; - itemTemplate.Spells[1].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE; - } - - // spell_2 have learning spell - if (itemTemplate.Spells[1].SpellTrigger != ITEM_SPELLTRIGGER_LEARN_SPELL_ID) - { - sLog->outErrorDb("Item (Entry: %u) has wrong item spell trigger value in spelltrigger_%d (%u) for special learning format.", entry, 1+1, itemTemplate.Spells[1].SpellTrigger); - itemTemplate.Spells[0].SpellId = 0; - itemTemplate.Spells[1].SpellId = 0; - itemTemplate.Spells[1].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE; - } - else if (!itemTemplate.Spells[1].SpellId) - { - sLog->outErrorDb("Item (Entry: %u) does not have an expected spell in spellid_%d in special learning format.", entry, 1+1); - itemTemplate.Spells[0].SpellId = 0; - itemTemplate.Spells[1].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE; - } - else if (itemTemplate.Spells[1].SpellId != -1) - { - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itemTemplate.Spells[1].SpellId); - if (!spellInfo && !DisableMgr::IsDisabledFor(DISABLE_TYPE_SPELL, itemTemplate.Spells[1].SpellId, NULL)) - { - sLog->outErrorDb("Item (Entry: %u) has wrong (not existing) spell in spellid_%d (%d)", entry, 1+1, itemTemplate.Spells[1].SpellId); - itemTemplate.Spells[0].SpellId = 0; - itemTemplate.Spells[1].SpellId = 0; - itemTemplate.Spells[1].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE; - } - // allowed only in special format - else if ((itemTemplate.Spells[1].SpellId == 483) || (itemTemplate.Spells[1].SpellId == 55884)) - { - sLog->outErrorDb("Item (Entry: %u) has broken spell in spellid_%d (%d)", entry, 1+1, itemTemplate.Spells[1].SpellId); - itemTemplate.Spells[0].SpellId = 0; - itemTemplate.Spells[1].SpellId = 0; - itemTemplate.Spells[1].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE; - } - } + if (entry->ItemId[j] <= 0) + continue; - // spell_3*, spell_4*, spell_5* is empty - for (uint8 j = 2; j < MAX_ITEM_PROTO_SPELLS; ++j) - { - if (itemTemplate.Spells[j].SpellTrigger != ITEM_SPELLTRIGGER_ON_USE) - { - sLog->outErrorDb("Item (Entry: %u) has wrong item spell trigger value in spelltrigger_%d (%u)", entry, j+1, itemTemplate.Spells[j].SpellTrigger); - itemTemplate.Spells[j].SpellId = 0; - itemTemplate.Spells[j].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE; - } - else if (itemTemplate.Spells[j].SpellId != 0) - { - sLog->outErrorDb("Item (Entry: %u) has wrong spell in spellid_%d (%d) for learning special format", entry, j+1, itemTemplate.Spells[j].SpellId); - itemTemplate.Spells[j].SpellId = 0; - } - } - } - // normal spell list - else - { - for (uint8 j = 0; j < MAX_ITEM_PROTO_SPELLS; ++j) - { - if (itemTemplate.Spells[j].SpellTrigger >= MAX_ITEM_SPELLTRIGGER || itemTemplate.Spells[j].SpellTrigger == ITEM_SPELLTRIGGER_LEARN_SPELL_ID) - { - sLog->outErrorDb("Item (Entry: %u) has wrong item spell trigger value in spelltrigger_%d (%u)", entry, j+1, itemTemplate.Spells[j].SpellTrigger); - itemTemplate.Spells[j].SpellId = 0; - itemTemplate.Spells[j].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE; - } + uint32 item_id = entry->ItemId[j]; - if (itemTemplate.Spells[j].SpellId && itemTemplate.Spells[j].SpellId != -1) - { - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itemTemplate.Spells[j].SpellId); - if (!spellInfo && !DisableMgr::IsDisabledFor(DISABLE_TYPE_SPELL, itemTemplate.Spells[j].SpellId, NULL)) - { - sLog->outErrorDb("Item (Entry: %u) has wrong (not existing) spell in spellid_%d (%d)", entry, j+1, itemTemplate.Spells[j].SpellId); - itemTemplate.Spells[j].SpellId = 0; - } - // allowed only in special format - else if ((itemTemplate.Spells[j].SpellId == 483) || (itemTemplate.Spells[j].SpellId == 55884)) - { - sLog->outErrorDb("Item (Entry: %u) has broken spell in spellid_%d (%d)", entry, j+1, itemTemplate.Spells[j].SpellId); - itemTemplate.Spells[j].SpellId = 0; - } - } - } + if (!GetItemTemplate(item_id)) + notFoundOutfit.insert(item_id); } + } - if (itemTemplate.Bonding >= MAX_BIND_TYPE) - sLog->outErrorDb("Item (Entry: %u) has wrong Bonding value (%u)", entry, itemTemplate.Bonding); - - if (itemTemplate.PageText && !GetPageText(itemTemplate.PageText)) - sLog->outErrorDb("Item (Entry: %u) has non existing first page (Id:%u)", entry, itemTemplate.PageText); + for (std::set::const_iterator itr = notFoundOutfit.begin(); itr != notFoundOutfit.end(); ++itr) + sLog->outErrorDb("Item (Entry: %u) does not exist in `item_template` but is referenced in `CharStartOutfit.dbc`", *itr); - if (itemTemplate.LockID && !sLockStore.LookupEntry(itemTemplate.LockID)) - sLog->outErrorDb("Item (Entry: %u) has wrong LockID (%u)", entry, itemTemplate.LockID); + sLog->outString(">> Loaded %u item templates from Item-sparse.db2 and %u from database in %u ms", sparseCount, dbCount, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); +} - if (itemTemplate.Sheath >= MAX_SHEATHETYPE) - { - sLog->outErrorDb("Item (Entry: %u) has wrong Sheath (%u)", entry, itemTemplate.Sheath); - itemTemplate.Sheath = SHEATHETYPE_NONE; - } +void ObjectMgr::LoadItemTemplateAddon() +{ + uint32 oldMSTime = getMSTime(); + uint32 count = 0; - if (itemTemplate.RandomProperty) + QueryResult result = WorldDatabase.Query("SELECT Id, BuyCount, FoodType, MinMoneyLoot, MaxMoneyLoot, SpellPPMChance FROM item_template_addon"); + if (result) + { + do { - // To be implemented later - if (itemTemplate.RandomProperty == -1) - itemTemplate.RandomProperty = 0; - - else if (!sItemRandomPropertiesStore.LookupEntry(GetItemEnchantMod(itemTemplate.RandomProperty))) + Field* fields = result->Fetch(); + uint32 itemId = fields[0].GetUInt32(); + if (!GetItemTemplate(itemId)) { - sLog->outErrorDb("Item (Entry: %u) has unknown (wrong or not listed in `item_enchantment_template`) RandomProperty (%u)", entry, itemTemplate.RandomProperty); - itemTemplate.RandomProperty = 0; + sLog->outErrorDb("Item %u specified in `item_template_addon` does not exist, skipped.", itemId); + continue; } - } - - if (itemTemplate.RandomSuffix && !sItemRandomSuffixStore.LookupEntry(GetItemEnchantMod(itemTemplate.RandomSuffix))) - { - sLog->outErrorDb("Item (Entry: %u) has wrong RandomSuffix (%u)", entry, itemTemplate.RandomSuffix); - itemTemplate.RandomSuffix = 0; - } - - if (itemTemplate.ItemSet && !sItemSetStore.LookupEntry(itemTemplate.ItemSet)) - { - sLog->outErrorDb("Item (Entry: %u) have wrong ItemSet (%u)", entry, itemTemplate.ItemSet); - itemTemplate.ItemSet = 0; - } - - if (itemTemplate.Area && !GetAreaEntryByAreaID(itemTemplate.Area)) - sLog->outErrorDb("Item (Entry: %u) has wrong Area (%u)", entry, itemTemplate.Area); - if (itemTemplate.Map && !sMapStore.LookupEntry(itemTemplate.Map)) - sLog->outErrorDb("Item (Entry: %u) has wrong Map (%u)", entry, itemTemplate.Map); - - if (itemTemplate.BagFamily) - { - // check bits - for (uint32 j = 0; j < sizeof(itemTemplate.BagFamily)*8; ++j) + uint8 buyCount = fields[1].GetUInt8(); + if (!buyCount) { - uint32 mask = 1 << j; - if ((itemTemplate.BagFamily & mask) == 0) - continue; - - ItemBagFamilyEntry const* bf = sItemBagFamilyStore.LookupEntry(j+1); - if (!bf) - { - sLog->outErrorDb("Item (Entry: %u) has bag family bit set not listed in ItemBagFamily.dbc, remove bit", entry); - itemTemplate.BagFamily &= ~mask; - continue; - } - - if (BAG_FAMILY_MASK_CURRENCY_TOKENS & mask) - { - CurrencyTypesEntry const* ctEntry = sCurrencyTypesStore.LookupEntry(itemTemplate.ItemId); - if (!ctEntry) - { - sLog->outErrorDb("Item (Entry: %u) has currency bag family bit set in BagFamily but not listed in CurrencyTypes.dbc, remove bit", entry); - itemTemplate.BagFamily &= ~mask; - } - } + sLog->outErrorDb("Item %u has BuyCount set to 0, corrected to 1.", itemId); + buyCount = 1; } - } - - if (itemTemplate.TotemCategory && !sTotemCategoryStore.LookupEntry(itemTemplate.TotemCategory)) - sLog->outErrorDb("Item (Entry: %u) has wrong TotemCategory (%u)", entry, itemTemplate.TotemCategory); - for (uint8 j = 0; j < MAX_ITEM_PROTO_SOCKETS; ++j) - { - if (itemTemplate.Socket[j].Color && (itemTemplate.Socket[j].Color & SOCKET_COLOR_ALL) != itemTemplate.Socket[j].Color) + uint8 foodType = fields[2].GetUInt8(); + uint32 minMoneyLoot = fields[3].GetUInt32(); + uint32 maxMoneyLoot = fields[4].GetUInt32(); + if (minMoneyLoot > maxMoneyLoot) { - sLog->outErrorDb("Item (Entry: %u) has wrong socketColor_%d (%u)", entry, j+1, itemTemplate.Socket[j].Color); - itemTemplate.Socket[j].Color = 0; + sLog->outErrorDb("Minimum money loot specified in `item_template_addon` for item %u was greater than maximum amount, swapping.", itemId); + std::swap(minMoneyLoot, maxMoneyLoot); } - } - - if (itemTemplate.GemProperties && !sGemPropertiesStore.LookupEntry(itemTemplate.GemProperties)) - sLog->outErrorDb("Item (Entry: %u) has wrong GemProperties (%u)", entry, itemTemplate.GemProperties); - - if (itemTemplate.FoodType >= MAX_PET_DIET) - { - sLog->outErrorDb("Item (Entry: %u) has wrong FoodType value (%u)", entry, itemTemplate.FoodType); - itemTemplate.FoodType = 0; - } - if (itemTemplate.ItemLimitCategory && !sItemLimitCategoryStore.LookupEntry(itemTemplate.ItemLimitCategory)) - { - sLog->outErrorDb("Item (Entry: %u) has wrong LimitCategory value (%u)", entry, itemTemplate.ItemLimitCategory); - itemTemplate.ItemLimitCategory = 0; - } + ItemTemplate& itemTemplate = ItemTemplateStore[itemId]; + itemTemplate.BuyCount = buyCount; + itemTemplate.FoodType = foodType; + itemTemplate.MinMoneyLoot = minMoneyLoot; + itemTemplate.MaxMoneyLoot = maxMoneyLoot; + itemTemplate.SpellPPMRate = fields[5].GetFloat(); + ++count; + } while (result->NextRow()); + } - if (itemTemplate.HolidayId && !sHolidaysStore.LookupEntry(itemTemplate.HolidayId)) - { - sLog->outErrorDb("Item (Entry: %u) has wrong HolidayId value (%u)", entry, itemTemplate.HolidayId); - itemTemplate.HolidayId = 0; - } + sLog->outString(">> Loaded %u item addon templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); +} - ++count; - } - while (result->NextRow()); +void ObjectMgr::LoadItemScriptNames() +{ + uint32 oldMSTime = getMSTime(); + uint32 count = 0; - // Check if item templates for DBC referenced character start outfit are present - std::set notFoundOutfit; - for (uint32 i = 1; i < sCharStartOutfitStore.GetNumRows(); ++i) + QueryResult result = WorldDatabase.Query("SELECT Id, ScriptName FROM item_script_names"); + if (result) { - CharStartOutfitEntry const* entry = sCharStartOutfitStore.LookupEntry(i); - if (!entry) - continue; - - for (int j = 0; j < MAX_OUTFIT_ITEMS; ++j) + do { - if (entry->ItemId[j] <= 0) + Field* fields = result->Fetch(); + uint32 itemId = fields[0].GetUInt32(); + if (!GetItemTemplate(itemId)) + { + sLog->outErrorDb("Item %u specified in `item_script_names` does not exist, skipped.", itemId); continue; + } - uint32 item_id = entry->ItemId[j]; - - if (!sObjectMgr->GetItemTemplate(item_id)) - notFoundOutfit.insert(item_id); - } + ItemTemplateStore[itemId].ScriptId = GetScriptId(fields[1].GetCString()); + ++count; + } while (result->NextRow()); } - for (std::set::const_iterator itr = notFoundOutfit.begin(); itr != notFoundOutfit.end(); ++itr) - sLog->outErrorDb("Item (Entry: %u) does not exist in `item_template` but is referenced in `CharStartOutfit.dbc`", *itr); - - sLog->outString(">> Loaded %u item templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(">> Loaded %u item script names in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); sLog->outString(); } @@ -8584,7 +8477,7 @@ void ObjectMgr::LoadScriptNames() "UNION " "SELECT DISTINCT(ScriptName) FROM gameobject_template WHERE ScriptName <> '' " "UNION " - "SELECT DISTINCT(ScriptName) FROM item_template WHERE ScriptName <> '' " + "SELECT DISTINCT(ScriptName) FROM item_script_names WHERE ScriptName <> '' " "UNION " "SELECT DISTINCT(ScriptName) FROM areatrigger_scripts WHERE ScriptName <> '' " "UNION " @@ -8951,4 +8844,4 @@ VehicleAccessoryList const* ObjectMgr::GetVehicleAccessoryList(Vehicle* veh) con if (itr != m_VehicleTemplateAccessoryMap.end()) return &itr->second; return NULL; -} +} \ No newline at end of file diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index 88c593a009d..e6ac7036d48 100755 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -865,6 +865,8 @@ class ObjectMgr void LoadGameobjects(); void LoadGameobjectRespawnTimes(); void LoadItemTemplates(); + void LoadItemTemplateAddon(); + void LoadItemScriptNames(); void LoadItemLocales(); void LoadItemSetNames(); void LoadItemSetNameLocales(); @@ -1285,7 +1287,6 @@ class ObjectMgr PlayerClassInfo playerClassInfo[MAX_CLASSES]; void BuildPlayerLevelInfo(uint8 race, uint8 class_, uint8 level, PlayerLevelInfo* plinfo) const; - PlayerInfo playerInfo[MAX_RACES][MAX_CLASSES]; typedef std::vector PlayerXPperLevel; // [level] diff --git a/src/server/game/Guilds/GuildMgr.cpp b/src/server/game/Guilds/GuildMgr.cpp index 8eac07918de..dd1ae020a51 100644 --- a/src/server/game/Guilds/GuildMgr.cpp +++ b/src/server/game/Guilds/GuildMgr.cpp @@ -178,7 +178,7 @@ void GuildMgr::LoadGuilds() CharacterDatabase.DirectExecute("DELETE gm FROM guild_member gm LEFT JOIN guild g ON gm.guildId = g.guildId WHERE g.guildId IS NULL"); // 0 1 2 3 4 5 6 - QueryResult result = CharacterDatabase.Query("SELECT guildid, gm.guid, rank, pnote, offnote, BankResetTimeMoney, BankRemMoney, " + QueryResult result = CharacterDatabase.Query("SELECT gm.guildid, gm.guid, rank, pnote, offnote, BankResetTimeMoney, BankRemMoney, " // 7 8 9 10 11 12 "BankResetTimeTab0, BankRemSlotsTab0, BankResetTimeTab1, BankRemSlotsTab1, BankResetTimeTab2, BankRemSlotsTab2, " // 13 14 15 16 17 18 diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index dd17e8277d6..acfb01ecc44 100755 --- a/src/server/game/Loot/LootMgr.cpp +++ b/src/server/game/Loot/LootMgr.cpp @@ -232,7 +232,7 @@ void LootStore::ReportUnusedIds(LootIdSet const& ids_set) const void LootStore::ReportNotExistedId(uint32 id) const { - sLog->outErrorDb("Table '%s' entry %d (%s) not exist but used as loot id in DB.", GetName(), id, GetEntryName()); + sLog->outErrorDb("Table '%s' entry %d (%s) does not exist but used as loot id in DB.", GetName(), id, GetEntryName()); } // @@ -1461,16 +1461,17 @@ void LoadLootTemplates_Disenchant() LootIdSet lootIdSet, loodIdSetUsed; uint32 count = LootTemplates_Disenchant.LoadAndCollectLootIds(lootIdSet); - ItemTemplateContainer const* its = sObjectMgr->GetItemTemplateStore(); - for (ItemTemplateContainer::const_iterator itr = its->begin(); itr != its->end(); ++itr) + for (uint32 i = 0; i < sItemDisenchantLootStore.GetNumRows(); ++i) { - if (uint32 lootid = itr->second.DisenchantID) - { - if (lootIdSet.find(lootid) == lootIdSet.end()) - LootTemplates_Disenchant.ReportNotExistedId(lootid); - else - loodIdSetUsed.insert(lootid); - } + ItemDisenchantLootEntry const* disenchant = sItemDisenchantLootStore.LookupEntry(i); + if (!disenchant) + continue; + + uint32 lootid = disenchant->Id; + if (lootIdSet.find(lootid) == lootIdSet.end()) + LootTemplates_Disenchant.ReportNotExistedId(lootid); + else + loodIdSetUsed.insert(lootid); } for (LootIdSet::const_iterator itr = loodIdSetUsed.begin(); itr != loodIdSetUsed.end(); ++itr) diff --git a/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp b/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp index 53b864b4d90..3f301a7aba8 100755 --- a/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp @@ -280,160 +280,153 @@ void WorldSession::HandleDestroyItemOpcode(WorldPacket & recv_data) // Only _static_ data send in this packet !!! void WorldSession::HandleItemQuerySingleOpcode(WorldPacket & recv_data) { - //sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_ITEM_QUERY_SINGLE"); - uint32 item; - recv_data >> item; + uint32 count, type; + recv_data >> count >> type; - sLog->outDetail("STORAGE: Item Query = %u", item); + if (type != DB2_REPLY_SPARSE && type != DB2_REPLY_ITEM) + return; - ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(item); - if (pProto) + for (uint32 i = 0; i < count; ++i) { - std::string Name = pProto->Name1; - std::string Description = pProto->Description; - - int loc_idx = GetSessionDbLocaleIndex(); - if (loc_idx >= 0) + uint32 item; + recv_data >> item; + recv_data.read_skip(); + WorldPacket data2(SMSG_DB_REPLY, 700); + ByteBuffer data; + data2 << uint32(type); + data2 << uint32(item); + + ItemTemplate const* proto = sObjectMgr->GetItemTemplate(item); + if (proto) { - if (ItemLocale const* il = sObjectMgr->GetItemLocale(pProto->ItemId)) + data << uint32(item); + if (type == DB2_REPLY_ITEM) { - ObjectMgr::GetLocaleString(il->Name, loc_idx, Name); - ObjectMgr::GetLocaleString(il->Description, loc_idx, Description); + data << uint32(proto->Class); + data << uint32(proto->SubClass); + data << int32(proto->Unk0); + data << uint32(proto->Material); + data << uint32(proto->DisplayInfoID); + data << uint32(proto->InventoryType); + data << uint32(proto->Sheath); } - } - // guess size - WorldPacket data(SMSG_ITEM_QUERY_SINGLE_RESPONSE, 600); - data << pProto->ItemId; - data << pProto->Class; - data << pProto->SubClass; - data << int32(pProto->Unk0); // new 2.0.3, not exist in wdb cache? - data << Name; - data << uint8(0x00); //pProto->Name2; // blizz not send name there, just uint8(0x00); <-- \0 = empty string = empty name... - data << uint8(0x00); //pProto->Name3; // blizz not send name there, just uint8(0x00); - data << uint8(0x00); //pProto->Name4; // blizz not send name there, just uint8(0x00); - data << pProto->DisplayInfoID; - data << pProto->Quality; - data << pProto->Flags; - data << pProto->Flags2; - data << pProto->BuyPrice; - data << pProto->SellPrice; - data << pProto->InventoryType; - data << pProto->AllowableClass; - data << pProto->AllowableRace; - data << pProto->ItemLevel; - data << pProto->RequiredLevel; - data << pProto->RequiredSkill; - data << pProto->RequiredSkillRank; - data << pProto->RequiredSpell; - data << pProto->RequiredHonorRank; - data << pProto->RequiredCityRank; - data << pProto->RequiredReputationFaction; - data << pProto->RequiredReputationRank; - data << int32(pProto->MaxCount); - data << int32(pProto->Stackable); - data << pProto->ContainerSlots; - data << pProto->StatsCount; // item stats count - for (uint32 i = 0; i < pProto->StatsCount; ++i) - { - data << pProto->ItemStat[i].ItemStatType; - data << pProto->ItemStat[i].ItemStatValue; - } - data << pProto->ScalingStatDistribution; // scaling stats distribution - data << uint32(0); - for (int i = 0; i < MAX_ITEM_PROTO_DAMAGES; ++i) - { - data << pProto->Damage[i].DamageMin; - data << pProto->Damage[i].DamageMax; - data << pProto->Damage[i].DamageType; - } - - // resistances (7) - data << pProto->Armor; - data << pProto->HolyRes; - data << pProto->FireRes; - data << pProto->NatureRes; - data << pProto->FrostRes; - data << pProto->ShadowRes; - data << pProto->ArcaneRes; - - data << pProto->Delay; - data << pProto->AmmoType; - data << pProto->RangedModRange; - - for (int s = 0; s < MAX_ITEM_PROTO_SPELLS; ++s) - { - // send DBC data for cooldowns in same way as it used in Spell::SendSpellCooldown - // use `item_template` or if not set then only use spell cooldowns - SpellInfo const* spell = sSpellMgr->GetSpellInfo(pProto->Spells[s].SpellId); - if (spell) + else if (type == DB2_REPLY_SPARSE) { - bool db_data = pProto->Spells[s].SpellCooldown >= 0 || pProto->Spells[s].SpellCategoryCooldown >= 0; - - data << pProto->Spells[s].SpellId; - data << pProto->Spells[s].SpellTrigger; - data << uint32(-abs(pProto->Spells[s].SpellCharges)); - - if (db_data) - { - data << uint32(pProto->Spells[s].SpellCooldown); - data << uint32(pProto->Spells[s].SpellCategory); - data << uint32(pProto->Spells[s].SpellCategoryCooldown); - } - else - { - data << uint32(spell->RecoveryTime); - data << uint32(spell->Category); - data << uint32(spell->CategoryRecoveryTime); - } + data << uint32(proto->Quality); + data << uint32(proto->Flags); + data << uint32(proto->Flags2); + data << int32(proto->BuyPrice); + data << uint32(proto->SellPrice); + data << uint32(proto->InventoryType); + data << int32(proto->AllowableClass); + data << int32(proto->AllowableRace); + data << uint32(proto->ItemLevel); + data << uint32(proto->RequiredLevel); + data << uint32(proto->RequiredSkill); + data << uint32(proto->RequiredSkillRank); + data << uint32(proto->RequiredSpell); + data << uint32(proto->RequiredHonorRank); + data << uint32(proto->RequiredCityRank); + data << uint32(proto->RequiredReputationFaction); + data << uint32(proto->RequiredReputationRank); + data << int32(proto->MaxCount); + data << int32(proto->Stackable); + data << uint32(proto->ContainerSlots); + + for (uint32 x = 0; x < MAX_ITEM_PROTO_STATS; ++x) + data << uint32(proto->ItemStat[x].ItemStatType); + + for (uint32 x = 0; x < MAX_ITEM_PROTO_STATS; ++x) + data << int32(proto->ItemStat[x].ItemStatValue); + + for (uint32 x = 0; x < MAX_ITEM_PROTO_STATS; ++x) + data << int32(proto->ItemStat[x].ItemStatUnk1); + + for (uint32 x = 0; x < MAX_ITEM_PROTO_STATS; ++x) + data << int32(proto->ItemStat[x].ItemStatUnk2); + + data << uint32(proto->ScalingStatDistribution); + data << uint32(proto->DamageType); + data << uint32(proto->Delay); + data << float(proto->RangedModRange); + + for (uint32 x = 0; x < MAX_ITEM_PROTO_SPELLS; ++x) + data << int32(proto->Spells[x].SpellId); + + for (uint32 x = 0; x < MAX_ITEM_PROTO_SPELLS; ++x) + data << uint32(proto->Spells[x].SpellTrigger); + + for (uint32 x = 0; x < MAX_ITEM_PROTO_SPELLS; ++x) + data << int32(proto->Spells[x].SpellCharges); + + for (uint32 x = 0; x < MAX_ITEM_PROTO_SPELLS; ++x) + data << int32(proto->Spells[x].SpellCooldown); + + for (uint32 x = 0; x < MAX_ITEM_PROTO_SPELLS; ++x) + data << uint32(proto->Spells[x].SpellCategory); + + for (uint32 x = 0; x < MAX_ITEM_PROTO_SPELLS; ++x) + data << int32(proto->Spells[x].SpellCategoryCooldown); + + data << uint32(proto->Bonding); + + // item name + std::string name = proto->Name1; + data << uint16(name.length() + 1); + data << name; + + for (uint32 i = 0; i < 3; ++i) // other 3 names + data << uint16(0); + + std::string desc = proto->Description; + data << uint16(desc.length() + 1); + data << desc; + + data << uint32(proto->PageText); + data << uint32(proto->LanguageID); + data << uint32(proto->PageMaterial); + data << uint32(proto->StartQuest); + data << uint32(proto->LockID); + data << int32(proto->Material); + data << uint32(proto->Sheath); + data << int32(proto->RandomProperty); + data << int32(proto->RandomSuffix); + data << uint32(proto->ItemSet); + data << uint32(proto->MaxDurability); + + data << uint32(proto->Area); + data << uint32(proto->Map); + data << uint32(proto->BagFamily); + data << uint32(proto->TotemCategory); + + for (uint32 x = 0; x < MAX_ITEM_PROTO_SOCKETS; ++x) + data << uint32(proto->Socket[x].Color); + + for (uint32 x = 0; x < MAX_ITEM_PROTO_SOCKETS; ++x) + data << uint32(proto->Socket[x].Content); + + data << uint32(proto->socketBonus); + data << uint32(proto->GemProperties); + data << float(proto->ArmorDamageModifier); + data << int32(proto->Duration); + data << uint32(proto->ItemLimitCategory); + data << uint32(proto->HolidayId); + data << float(proto->StatScalingFactor); // StatScalingFactor + data << uint32(proto->Field130); // archaeology unk + data << uint32(proto->Field131); // archaeology findinds count } else { + data << uint32(item | 0x80000000); // sometimes with | 0x80000000 data << uint32(0); - data << uint32(0); - data << uint32(0); - data << uint32(-1); - data << uint32(0); - data << uint32(-1); } + + data2 << uint32(data.size()); + data2.append(data); } - data << pProto->Bonding; - data << Description; - data << pProto->PageText; - data << pProto->LanguageID; - data << pProto->PageMaterial; - data << pProto->StartQuest; - data << pProto->LockID; - data << int32(pProto->Material); - data << pProto->Sheath; - data << pProto->RandomProperty; - data << pProto->RandomSuffix; - data << pProto->Block; - data << pProto->ItemSet; - data << pProto->MaxDurability; - data << pProto->Area; - data << pProto->Map; // Added in 1.12.x & 2.0.1 client branch - data << pProto->BagFamily; - data << pProto->TotemCategory; - for (int s = 0; s < MAX_ITEM_PROTO_SOCKETS; ++s) - { - data << pProto->Socket[s].Color; - data << pProto->Socket[s].Content; - } - data << pProto->socketBonus; - data << pProto->GemProperties; - data << pProto->RequiredDisenchantSkill; - data << pProto->ArmorDamageModifier; - data << uint32(abs(pProto->Duration)); // added in 2.4.2.8209, duration (seconds) - data << pProto->ItemLimitCategory; // WotLK, ItemLimitCategory - data << pProto->HolidayId; // Holiday.dbc? - SendPacket(&data); - } - else - { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_ITEM_QUERY_SINGLE - NO item INFO! (ENTRY: %u)", item); - WorldPacket data(SMSG_ITEM_QUERY_SINGLE_RESPONSE, 4); - data << uint32(item | 0x80000000); - SendPacket(&data); + + data2 << uint32(type); + _player->GetSession()->SendPacket(&data2); } } @@ -981,25 +974,6 @@ void WorldSession::HandleAutoStoreBankItemOpcode(WorldPacket& recvPacket) } } -void WorldSession::HandleSetAmmoOpcode(WorldPacket & recv_data) -{ - if (!GetPlayer()->isAlive()) - { - GetPlayer()->SendEquipError(EQUIP_ERR_YOU_ARE_DEAD, NULL, NULL); - return; - } - - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_SET_AMMO"); - uint32 item; - - recv_data >> item; - - if (!item) - GetPlayer()->RemoveAmmo(); - else - GetPlayer()->SetAmmo(item); -} - void WorldSession::SendEnchantmentLog(uint64 Target, uint64 Caster, uint32 ItemID, uint32 SpellID) { WorldPacket data(SMSG_ENCHANTMENTLOG, (8+8+4+4+1)); // last check 2.0.10 diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 8f0487d563f..ad182b4120a 100755 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -40,7 +40,7 @@ void InitOpcodes() } memset(opcodeTable, 0, sizeof(opcodeTable)); - + //DEFINE_OPCODE_HANDLER(MSG_NULL_ACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_BOOTME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_DBLOOKUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -658,7 +658,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_BIDDER_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SET_FLAT_SPELL_MODIFIER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SET_PCT_SPELL_MODIFIER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_AMMO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetAmmoOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_AMMO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_CORPSE_RECLAIM_DELAY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIVE_MOVER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActiveMoverOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_PET_CANCEL_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetCancelAuraOpcode ); @@ -707,7 +707,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_LFG_GET_STATUS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_SHOW_MAILBOX, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_RESET_RANGED_COMBAT_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - ////DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_MEMBER_ADDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_MEMBER_ADDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHAT_NOT_IN_PARTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_GROWTH_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelGrowthAuraOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_CANCEL_AUTO_REPEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -919,7 +919,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_ROLES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetRolesOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_NEEDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_BOOT_VOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetBootVoteOpcode ); - ////DEFINE_OPCODE_HANDLER(SMSG_LFG_BOOT_PROPOSAL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_BOOT_PROPOSAL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_LFD_PLAYER_LOCK_INFO_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgPlayerLockInfoRequestOpcode); //DEFINE_OPCODE_HANDLER(SMSG_LFG_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_LFG_TELEPORT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgTeleportOpcode ); diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 6421edaa7c6..db71fe0941b 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -137,6 +137,9 @@ enum CharterTypes ARENA_TEAM_CHARTER_5v5_TYPE = 5 }; +#define DB2_REPLY_SPARSE 2442913102 +#define DB2_REPLY_ITEM 1344507586 + //class to deal with packet processing //allows to determine if next packet is safe to be processed class PacketFilter @@ -478,7 +481,6 @@ class WorldSession void HandleDelIgnoreOpcode(WorldPacket& recvPacket); void HandleSetContactNotesOpcode(WorldPacket& recvPacket); void HandleBugOpcode(WorldPacket& recvPacket); - void HandleSetAmmoOpcode(WorldPacket& recvPacket); void HandleItemNameQueryOpcode(WorldPacket& recvPacket); void HandleAreaTriggerOpcode(WorldPacket& recvPacket); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 20ee5ce39e4..867ae80319f 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -1992,7 +1992,7 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mo { case FORM_CAT: { - int32 basePoints = int32(std::min(oldPower, FurorChance)); + int32 basePoints = std::min(oldPower, FurorChance); target->SetPower(POWER_ENERGY, 0); target->CastCustomSpell(target, 17099, &basePoints, NULL, NULL, true, NULL, this); } diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index c1749867945..c47d6d08990 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -513,7 +513,7 @@ m_caster((info->AttributesEx6 & SPELL_ATTR6_CAST_BY_CHARMER && caster->GetCharme // wand case if ((m_caster->getClassMask() & CLASSMASK_WAND_USERS) != 0 && m_caster->GetTypeId() == TYPEID_PLAYER) if (Item* pItem = m_caster->ToPlayer()->GetWeaponForAttack(RANGED_ATTACK)) - m_spellSchoolMask = SpellSchoolMask(1 << pItem->GetTemplate()->Damage[0].DamageType); + m_spellSchoolMask = SpellSchoolMask(1 << pItem->GetTemplate()->DamageType); if (originalCasterGUID) m_originalCasterGUID = originalCasterGUID; diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index a3ff66f7b5b..f98d0ab3e46 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -694,8 +694,8 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex) Item* item = m_caster->ToPlayer()->GetWeaponForAttack(RANGED_ATTACK); if (item) { - float dmg_min = item->GetTemplate()->Damage->DamageMin; - float dmg_max = item->GetTemplate()->Damage->DamageMax; + float dmg_min = item->GetTemplate()->DamageMin; + float dmg_max = item->GetTemplate()->DamageMax; if (dmg_max == 0.0f && dmg_min > dmg_max) damage += int32(dmg_min); else diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index e4ee17e324d..64f4e40c32b 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1344,13 +1344,19 @@ void World::SetInitialWorldSettings() sLog->outString("Loading Item Random Enchantments Table..."); LoadRandomEnchantmentsTable(); - sLog->outString("Loading Disables"); - DisableMgr::LoadDisables(); // must be before loading quests and items + sLog->outString("Loading Disables..."); + DisableMgr::LoadDisables(); // must be before loading quests and items - sLog->outString("Loading Items..."); // must be after LoadRandomEnchantmentsTable and LoadPageTexts + sLog->outString("Loading Items..."); // must be after LoadRandomEnchantmentsTable and LoadPageTexts sObjectMgr->LoadItemTemplates(); - sLog->outString("Loading Item set names..."); // must be after LoadItemPrototypes + sLog->outString("Loading Item Extra Data..."); // must be after LoadItemPrototypes + sObjectMgr->LoadItemTemplateAddon(); + + sLog->outString("Loading Item Scripts..."); // must be after LoadItemPrototypes + sObjectMgr->LoadItemScriptNames(); + + sLog->outString("Loading Item set names..."); // must be after LoadItemPrototypes sObjectMgr->LoadItemSetNames(); sLog->outString("Loading Creature Model Based Info Data..."); diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index 536db9dcd30..41e9a1c8220 100755 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -266,7 +266,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() // Corpse PREPARE_STATEMENT(CHAR_LOAD_CORPSES, "SELECT posX, posY, posZ, orientation, mapId, displayId, itemCache, bytes1, bytes2, flags, dynFlags, time, corpseType, instanceId, phaseMask, corpseGuid, guid FROM corpse WHERE corpseType <> 0", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_ADD_CORPSE, "INSERT INTO corpse (corpseGuid, guid, posX, posY, posZ, orientation, mapId, displayId, itemCache, bytes1, bytes2, flags, dynFlags, time, corpseType, instanceId, phaseMask) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_ADD_CORPSE, "INSERT INTO corpse (corpseGuid, guid, posX, posY, posZ, orientation, mapId, displayId, itemCache, bytes1, bytes2, flags, dynFlags, time, corpseType, instanceId, phaseMask) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_CORPSE, "DELETE FROM corpse WHERE corpseGuid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_PLAYER_CORPSES, "DELETE FROM corpse WHERE guid = ? AND corpseType <> 0", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_OLD_CORPSES, "DELETE FROM corpse WHERE corpseType = 0 OR time < (UNIX_TIMESTAMP(NOW()) - ?)", CONNECTION_ASYNC) diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h index 93a9aaa6d80..a4a996b299a 100755 --- a/src/server/shared/Packets/ByteBuffer.h +++ b/src/server/shared/Packets/ByteBuffer.h @@ -108,7 +108,7 @@ class ByteBuffer { ++_bitpos; if (_bitpos > 7) - { + { _bitpos = 0; _curbitval = read(); } -- cgit v1.2.3 From aa215e5e8083c045662151eed67caeb2a7f8caa5 Mon Sep 17 00:00:00 2001 From: kaelima Date: Sat, 26 Nov 2011 01:46:41 +0100 Subject: Core/Misc: Fix compile and char creation - Added very basic honor/conquest support, no idea if its works even a little since there's no possibility of testing yet --- .../2011_11_26_00_characters_characters.sql | 5 + src/server/game/Battlegrounds/ArenaTeamMgr.cpp | 4 +- src/server/game/Battlegrounds/Battleground.cpp | 4 +- src/server/game/Chat/Commands/Level3.cpp | 4 +- src/server/game/Entities/Creature/Creature.cpp | 8 +- src/server/game/Entities/Player/Player.cpp | 168 ++++++--------------- src/server/game/Entities/Player/Player.h | 19 +-- src/server/game/Entities/Unit/StatSystem.cpp | 8 +- .../game/Server/Protocol/Handlers/MiscHandler.cpp | 8 +- src/server/game/Server/Protocol/Opcodes.cpp | 1 - src/server/game/Spells/Auras/SpellAuraEffects.cpp | 4 +- src/server/game/Spells/SpellEffects.cpp | 2 +- src/server/scripts/Commands/cs_modify.cpp | 10 +- .../Database/Implementation/CharacterDatabase.cpp | 12 +- 14 files changed, 87 insertions(+), 170 deletions(-) create mode 100644 sql/updates/characters/2011_11_26_00_characters_characters.sql (limited to 'src') diff --git a/sql/updates/characters/2011_11_26_00_characters_characters.sql b/sql/updates/characters/2011_11_26_00_characters_characters.sql new file mode 100644 index 00000000000..9fe2b4c804e --- /dev/null +++ b/sql/updates/characters/2011_11_26_00_characters_characters.sql @@ -0,0 +1,5 @@ +ALTER TABLE `characters` +DROP COLUMN `todayHonorPoints`, +DROP COLUMN `yesterdayHonorPoints`, +DROP COLUMN `knownCurrencies`, +CHANGE COLUMN `arenaPoints` `conquestPoints` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `taxi_path`; diff --git a/src/server/game/Battlegrounds/ArenaTeamMgr.cpp b/src/server/game/Battlegrounds/ArenaTeamMgr.cpp index cf335ec1971..6357612607f 100644 --- a/src/server/game/Battlegrounds/ArenaTeamMgr.cpp +++ b/src/server/game/Battlegrounds/ArenaTeamMgr.cpp @@ -154,14 +154,16 @@ void ArenaTeamMgr::DistributeArenaPoints() SQLTransaction trans = CharacterDatabase.BeginTransaction(); // Cycle that gives points to all players + /* for (std::map::iterator playerItr = PlayerPoints.begin(); playerItr != PlayerPoints.end(); ++playerItr) { // Add points to player if online if (Player* player = HashMapHolder::Find(playerItr->first)) - player->ModifyArenaPoints(playerItr->second, &trans); + player->ModifyConquestPoints(playerItr->second, &trans); else // Update database trans->PAppend("UPDATE characters SET arenaPoints=arenaPoints+%u WHERE guid=%u", playerItr->second, playerItr->first); } + */ CharacterDatabase.CommitTransaction(trans); diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index af350ac39d6..7cfd4dec28e 100755 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -842,8 +842,8 @@ void Battleground::EndBattleground(uint32 winner) if (IsRandom() || BattlegroundMgr::IsBGWeekend(GetTypeID())) { UpdatePlayerScore(player, SCORE_BONUS_HONOR, GetBonusHonorFromKill(winner_kills)); - if (CanAwardArenaPoints()) - player->ModifyArenaPoints(winner_arena); + /*if (CanAwardArenaPoints()) + player->ModifyConquestPoints(winner_arena);*/ if (!player->GetRandomWinner()) player->SetRandomWinner(true); } diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp index 54f4ae4bdeb..aecf9122f5b 100755 --- a/src/server/game/Chat/Commands/Level3.cpp +++ b/src/server/game/Chat/Commands/Level3.cpp @@ -2461,11 +2461,9 @@ bool ChatHandler::HandleResetHonorCommand (const char * args) if (!extractPlayerTarget((char*)args, &target)) return false; - target->SetHonorPoints(0); + target->SetCurrency(CURRENCY_TYPE_HONOR_POINTS, 0); target->SetUInt32Value(PLAYER_FIELD_KILLS, 0); target->SetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS, 0); - target->SetUInt32Value(PLAYER_FIELD_TODAY_CONTRIBUTION, 0); - target->SetUInt32Value(PLAYER_FIELD_YESTERDAY_CONTRIBUTION, 0); target->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EARN_HONORABLE_KILL); return true; diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 922db88bcd0..b1a353dcb88 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -1687,9 +1687,11 @@ SpellInfo const* Creature::reachWithSpellAttack(Unit* pVictim) break; } } - if (bcontinue) continue; - if (spellInfo->ManaCost > GetPower(POWER_MANA)) + if (bcontinue) + continue; + + if (spellInfo->ManaCost > (uint32)GetPower(POWER_MANA)) continue; float range = spellInfo->GetMaxRange(false); float minrange = spellInfo->GetMinRange(false); @@ -1732,7 +1734,7 @@ SpellInfo const* Creature::reachWithSpellCure(Unit* pVictim) } if (bcontinue) continue; - if (spellInfo->ManaCost > GetPower(POWER_MANA)) + if (spellInfo->ManaCost > (uint32)GetPower(POWER_MANA)) continue; float range = spellInfo->GetMaxRange(true); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 3017a618a20..5f9c900b39c 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -742,7 +742,6 @@ Player::Player (WorldSession* session): Unit(), m_achievementMgr(this), m_reputa m_canBlock = false; m_canDualWield = false; m_canTitanGrip = false; - m_ammoDPS = 0.0f; m_temporaryUnsummonedPetNumber = 0; //cache for UNIT_CREATED_BY_SPELL to allow @@ -989,8 +988,6 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo) SetUInt32Value(PLAYER_FIELD_KILLS, 0); SetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS, 0); - SetUInt32Value(PLAYER_FIELD_TODAY_CONTRIBUTION, 0); - SetUInt32Value(PLAYER_FIELD_YESTERDAY_CONTRIBUTION, 0); // set starting level uint32 start_level = getClass() != CLASS_DEATH_KNIGHT @@ -1009,8 +1006,8 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo) InitRunes(); SetUInt32Value(PLAYER_FIELD_COINAGE, sWorld->getIntConfig(CONFIG_START_PLAYER_MONEY)); - SetHonorPoints(sWorld->getIntConfig(CONFIG_START_HONOR_POINTS)); - SetArenaPoints(sWorld->getIntConfig(CONFIG_START_ARENA_POINTS)); + SetCurrency(CURRENCY_TYPE_HONOR_POINTS, sWorld->getIntConfig(CONFIG_START_HONOR_POINTS)); + SetCurrency(CURRENCY_TYPE_CONQUEST_POINTS, sWorld->getIntConfig(CONFIG_START_ARENA_POINTS)); // start with every map explored if (sWorld->getBoolConfig(CONFIG_START_ALL_EXPLORED)) @@ -7088,16 +7085,12 @@ void Player::UpdateHonorFields() // update yesterday's contribution if (m_lastHonorUpdateTime >= yesterday) { - SetUInt32Value(PLAYER_FIELD_YESTERDAY_CONTRIBUTION, GetUInt32Value(PLAYER_FIELD_TODAY_CONTRIBUTION)); - // this is the first update today, reset today's contribution - SetUInt32Value(PLAYER_FIELD_TODAY_CONTRIBUTION, 0); SetUInt32Value(PLAYER_FIELD_KILLS, MAKE_PAIR32(0, kills_today)); } else { // no honor/kills yesterday or today, reset - SetUInt32Value(PLAYER_FIELD_YESTERDAY_CONTRIBUTION, 0); SetUInt32Value(PLAYER_FIELD_KILLS, 0); } } @@ -7108,15 +7101,15 @@ void Player::UpdateHonorFields() ///Calculate the amount of honor gained based on the victim ///and the size of the group for which the honor is divided ///An exact honor value can also be given (overriding the calcs) -bool Player::RewardHonor(Unit* uVictim, uint32 groupsize, int32 honor, bool pvptoken) +bool Player::RewardHonor(Unit* victim, uint32 groupsize, int32 honor, bool pvptoken) { // do not reward honor in arenas, but enable onkill spellproc if (InArena()) { - if (!uVictim || uVictim == this || uVictim->GetTypeId() != TYPEID_PLAYER) + if (!victim || victim == this || victim->GetTypeId() != TYPEID_PLAYER) return false; - if (GetBGTeam() == uVictim->ToPlayer()->GetBGTeam()) + if (GetBGTeam() == victim->ToPlayer()->GetBGTeam()) return false; return true; @@ -7141,21 +7134,19 @@ bool Player::RewardHonor(Unit* uVictim, uint32 groupsize, int32 honor, bool pvpt if (honor_f <= 0) { - if (!uVictim || uVictim == this || uVictim->HasAuraType(SPELL_AURA_NO_PVP_CREDIT)) + if (!victim || victim == this || victim->HasAuraType(SPELL_AURA_NO_PVP_CREDIT)) return false; - victim_guid = uVictim->GetGUID(); + victim_guid = victim->GetGUID(); - if (uVictim->GetTypeId() == TYPEID_PLAYER) + if (Player* plrVictim = victim->ToPlayer()) { - Player* pVictim = uVictim->ToPlayer(); - - if (GetTeam() == pVictim->GetTeam() && !sWorld->IsFFAPvPRealm()) + if (GetTeam() == plrVictim->GetTeam() && !sWorld->IsFFAPvPRealm()) return false; uint8 k_level = getLevel(); uint8 k_grey = Trinity::XP::GetGrayLevel(k_level); - uint8 v_level = pVictim->getLevel(); + uint8 v_level = plrVictim->getLevel(); if (v_level <= k_grey) return false; @@ -7166,7 +7157,7 @@ bool Player::RewardHonor(Unit* uVictim, uint32 groupsize, int32 honor, bool pvpt // [15..28] Horde honor titles and player name // [29..38] Other title and player name // [39+] Nothing - uint32 victim_title = pVictim->GetUInt32Value(PLAYER_CHOSEN_TITLE); + uint32 victim_title = plrVictim->GetUInt32Value(PLAYER_CHOSEN_TITLE); // Get Killer titles, CharTitlesEntry::bit_index // Ranks: // title[1..14] -> rank[5..18] @@ -7188,14 +7179,14 @@ bool Player::RewardHonor(Unit* uVictim, uint32 groupsize, int32 honor, bool pvpt // and those in a lifetime ApplyModUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS, 1, true); UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EARN_HONORABLE_KILL); - UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HK_CLASS, pVictim->getClass()); - UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HK_RACE, pVictim->getRace()); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HK_CLASS, plrVictim->getClass()); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HK_RACE, plrVictim->getRace()); UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL_AT_AREA, GetAreaId()); - UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL, 1, 0, pVictim); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL, 1, 0, plrVictim); } else { - if (!uVictim->ToCreature()->isRacialLeader()) + if (!victim->ToCreature()->isRacialLeader()) return false; honor_f = 100.0f; // ??? need more info @@ -7203,7 +7194,7 @@ bool Player::RewardHonor(Unit* uVictim, uint32 groupsize, int32 honor, bool pvpt } } - if (uVictim != NULL) + if (victim != NULL) { if (groupsize > 1) honor_f /= groupsize; @@ -7228,9 +7219,7 @@ bool Player::RewardHonor(Unit* uVictim, uint32 groupsize, int32 honor, bool pvpt GetSession()->SendPacket(&data); // add honor points - ModifyHonorPoints(honor); - - ApplyModUInt32Value(PLAYER_FIELD_TODAY_CONTRIBUTION, honor, true); + ModifyCurrency(CURRENCY_TYPE_HONOR_POINTS, int32(honor)); if (InBattleground() && honor > 0) { @@ -7242,10 +7231,10 @@ bool Player::RewardHonor(Unit* uVictim, uint32 groupsize, int32 honor, bool pvpt if (sWorld->getBoolConfig(CONFIG_PVP_TOKEN_ENABLE) && pvptoken) { - if (!uVictim || uVictim == this || uVictim->HasAuraType(SPELL_AURA_NO_PVP_CREDIT)) + if (!victim || victim == this || victim ->HasAuraType(SPELL_AURA_NO_PVP_CREDIT)) return true; - if (uVictim->GetTypeId() == TYPEID_PLAYER) + if (victim->GetTypeId() == TYPEID_PLAYER) { // Check if allowed to receive it in current map uint8 MapType = sWorld->getIntConfig(CONFIG_PVP_TOKEN_MAP_TYPE); @@ -7273,7 +7262,7 @@ void Player::SendCurrencies() const for (PlayerCurrenciesMap::const_iterator itr = m_currencies.begin(); itr != m_currencies.end(); ++itr) { - const CurrencyTypesEntry* entry = sCurrencyTypesStore.LookupEntry(itr->first); + CurrencyTypesEntry const* entry = sCurrencyTypesStore.LookupEntry(itr->first); packet << uint32(itr->second.weekCount / PLAYER_CURRENCY_PRECISION); packet << uint8(0); // unknown packet << uint32(entry->ID); @@ -7302,7 +7291,7 @@ void Player::ModifyCurrency(uint32 id, int32 count) if (!count) return; - const CurrencyTypesEntry* currency = sCurrencyTypesStore.LookupEntry(id); + CurrencyTypesEntry const* currency = sCurrencyTypesStore.LookupEntry(id); ASSERT(currency); uint32 oldTotalCount = 0; @@ -7413,46 +7402,6 @@ uint32 Player::_GetCurrencyWeekCap(const CurrencyTypesEntry* currency) const return cap; } -void Player::SetHonorPoints(uint32 value) -{ - if (value > sWorld->getIntConfig(CONFIG_MAX_HONOR_POINTS)) - value = sWorld->getIntConfig(CONFIG_MAX_HONOR_POINTS); - SetUInt32Value(PLAYER_FIELD_HONOR_CURRENCY, value); - if (value) - AddKnownCurrency(ITEM_HONOR_POINTS_ID); -} - -void Player::SetArenaPoints(uint32 value) -{ - if (value > sWorld->getIntConfig(CONFIG_MAX_ARENA_POINTS)) - value = sWorld->getIntConfig(CONFIG_MAX_ARENA_POINTS); - SetUInt32Value(PLAYER_FIELD_ARENA_CURRENCY, value); - if (value) - AddKnownCurrency(ITEM_ARENA_POINTS_ID); -} - -void Player::ModifyHonorPoints(int32 value, SQLTransaction* trans /*=NULL*/) -{ - int32 newValue = int32(GetHonorPoints()) + value; - if (newValue < 0) - newValue = 0; - SetHonorPoints(uint32(newValue)); - - if (trans && !trans->null()) - (*trans)->PAppend("UPDATE characters SET totalHonorPoints=%u WHERE guid=%u", newValue, GetGUIDLow()); -} - -void Player::ModifyArenaPoints(int32 value, SQLTransaction* trans /*=NULL*/) -{ - int32 newValue = int32(GetArenaPoints()) + value; - if (newValue < 0) - newValue = 0; - SetArenaPoints(uint32(newValue)); - - if (trans && !trans->null()) - (*trans)->PAppend("UPDATE characters SET arenaPoints=%u WHERE guid=%u", newValue, GetGUIDLow()); -} - uint32 Player::GetGuildIdFromDB(uint64 guid) { QueryResult result = CharacterDatabase.PQuery("SELECT guildid FROM guild_member WHERE guid='%u'", GUID_LOPART(guid)); @@ -14975,9 +14924,6 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver, InitTalentForLevel(); } - if (quest->GetRewArenaPoints()) - ModifyArenaPoints(quest->GetRewArenaPoints()); - // Send reward mail if (uint32 mail_template_id = quest->GetRewMailTemplateId()) { @@ -16489,11 +16435,11 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) //"position_x, position_y, position_z, map, orientation, taximask, cinematic, totaltime, leveltime, rest_bonus, logout_time, is_logout_resting, resettalents_cost, " // 25 26 27 28 29 30 31 32 33 34 35 36 37 38 //"resettalents_time, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, online, death_expire_time, taxi_path, instance_mode_mask, " - // 39 40 41 42 43 44 45 46 47 48 49 - //"arenaPoints, totalHonorPoints, todayHonorPoints, yesterdayHonorPoints, totalKills, todayKills, yesterdayKills, chosenTitle, knownCurrencies, watchedFaction, drunk, " - // 50 51 52 53 54 55 56 57 58 59 60 + // 39 40 41 42 43 44 45 46 47 + //"conquestPoints, totalHonorPoints, totalKills, todayKills, yesterdayKills, chosenTitle, knownCurrencies, watchedFaction, drunk, " + // 48 49 50 51 52 53 54 55 56 57 58 //"health, power1, power2, power3, power4, power5, instance_id, speccount, activespec, exploredZones, equipmentCache, " - // 61 62 63 64 + // 59 60 61 62 //"knownTitles, actionBars, grantableLevels, guildId FROM characters WHERE guid = '%u'", guid); PreparedQueryResult result = holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADFROM); @@ -16553,8 +16499,8 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) SetUInt32Value(UNIT_FIELD_LEVEL, fields[6].GetUInt8()); SetUInt32Value(PLAYER_XP, fields[7].GetUInt32()); - _LoadIntoDataField(fields[59].GetCString(), PLAYER_EXPLORED_ZONES_1, PLAYER_EXPLORED_ZONES_SIZE); - _LoadIntoDataField(fields[61].GetCString(), PLAYER__FIELD_KNOWN_TITLES, KNOWN_TITLES_SIZE*2); + _LoadIntoDataField(fields[57].GetCString(), PLAYER_EXPLORED_ZONES_1, PLAYER_EXPLORED_ZONES_SIZE); + _LoadIntoDataField(fields[59].GetCString(), PLAYER__FIELD_KNOWN_TITLES, KNOWN_TITLES_SIZE*2); SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, DEFAULT_WORLD_OBJECT_SIZE); SetFloatValue(UNIT_FIELD_COMBATREACH, 1.5f); @@ -16570,12 +16516,10 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) SetUInt32Value(PLAYER_BYTES, fields[9].GetUInt32()); SetUInt32Value(PLAYER_BYTES_2, fields[10].GetUInt32()); - SetUInt32Value(PLAYER_BYTES_3, (fields[49].GetUInt16() & 0xFFFE) | fields[5].GetUInt8()); + SetUInt32Value(PLAYER_BYTES_3, (fields[47].GetUInt16() & 0xFFFE) | fields[5].GetUInt8()); SetUInt32Value(PLAYER_FLAGS, fields[11].GetUInt32()); SetInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, fields[48].GetUInt32()); - SetUInt64Value(PLAYER_FIELD_KNOWN_CURRENCIES, fields[47].GetUInt64()); - // set which actionbars the client has active - DO NOT REMOVE EVER AGAIN (can be changed though, if it does change fieldwise) SetByteValue(PLAYER_FIELD_BYTES, 2, fields[62].GetUInt8()); @@ -16608,7 +16552,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) uint32 transGUID = uint32(fields[30].GetUInt64()); // field type is uint64 but lowguid is saved Relocate(fields[12].GetFloat(), fields[13].GetFloat(), fields[14].GetFloat(), fields[16].GetFloat()); uint32 mapId = fields[15].GetUInt16(); - uint32 instanceId = fields[56].GetUInt8(); + uint32 instanceId = fields[54].GetUInt8(); uint32 dungeonDiff = fields[38].GetUInt32() & 0x0F; if (dungeonDiff >= MAX_DUNGEON_DIFFICULTY) @@ -16627,8 +16571,6 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) _LoadArenaTeamInfo(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADARENAINFO)); - SetArenaPoints(fields[39].GetUInt32()); - // check arena teams integrity for (uint32 arena_slot = 0; arena_slot < MAX_ARENA_SLOT; ++arena_slot) { @@ -16645,12 +16587,11 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) SetArenaTeamInfoField(arena_slot, ArenaTeamInfoType(j), 0); } - SetHonorPoints(fields[40].GetUInt32()); - SetUInt32Value(PLAYER_FIELD_TODAY_CONTRIBUTION, fields[41].GetUInt32()); - SetUInt32Value(PLAYER_FIELD_YESTERDAY_CONTRIBUTION, fields[42].GetUInt32()); - SetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS, fields[43].GetUInt32()); - SetUInt16Value(PLAYER_FIELD_KILLS, 0, fields[44].GetUInt16()); - SetUInt16Value(PLAYER_FIELD_KILLS, 1, fields[45].GetUInt16()); + SetCurrency(CURRENCY_TYPE_CONQUEST_POINTS, fields[39].GetUInt32()); + SetCurrency(CURRENCY_TYPE_HONOR_POINTS, fields[40].GetUInt32()); + SetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS, fields[41].GetUInt32()); + SetUInt16Value(PLAYER_FIELD_KILLS, 0, fields[42].GetUInt16()); + SetUInt16Value(PLAYER_FIELD_KILLS, 1, fields[43].GetUInt16()); _LoadBoundInstances(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADBOUNDINSTANCES)); _LoadInstanceTimeRestrictions(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADINSTANCELOCKTIMES)); @@ -16970,8 +16911,8 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) //mails are loaded only when needed ;-) - when player in game click on mailbox. //_LoadMail(); - m_specsCount = fields[57].GetUInt8(); - m_activeSpec = fields[58].GetUInt8(); + m_specsCount = fields[55].GetUInt8(); + m_activeSpec = fields[56].GetUInt8(); // sanity check if (m_specsCount > MAX_TALENT_SPECS || m_activeSpec > MAX_TALENT_SPEC || m_specsCount < MIN_TALENT_SPECS) @@ -17018,7 +16959,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) // check PLAYER_CHOSEN_TITLE compatibility with PLAYER__FIELD_KNOWN_TITLES // note: PLAYER__FIELD_KNOWN_TITLES updated at quest status loaded - uint32 curTitle = fields[46].GetUInt32(); + uint32 curTitle = fields[44].GetUInt32(); if (curTitle && !HasTitle(curTitle)) curTitle = 0; @@ -17041,11 +16982,11 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) UpdateAllStats(); // restore remembered power/health values (but not more max values) - uint32 savedHealth = fields[50].GetUInt32(); + uint32 savedHealth = fields[48].GetUInt32(); SetHealth(savedHealth > GetMaxHealth() ? GetMaxHealth() : savedHealth); for (uint8 i = 0; i < MAX_STORED_POWERS; ++i) { - uint32 savedPower = fields[51+i].GetUInt32(); + uint32 savedPower = fields[49+i].GetUInt32(); SetPower(Powers(i), savedPower > GetMaxPower(Powers(i)) ? GetMaxPower(Powers(i)) : savedPower); } @@ -17101,7 +17042,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) } // RaF stuff. - m_grantableLevels = fields[63].GetUInt32(); + m_grantableLevels = fields[61].GetUInt32(); if (GetSession()->IsARecruiter() || (GetSession()->GetRecruiterId() != 0)) SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_REFER_A_FRIEND); @@ -18355,15 +18296,12 @@ void Player::SaveToDB(bool create /*=false*/) ss << m_taxi.SaveTaxiDestinationsToString(); stmt->setString(index++, ss.str()); - stmt->setUInt32(index++, GetArenaPoints()); - stmt->setUInt32(index++, GetHonorPoints()); - stmt->setUInt32(index++, GetUInt32Value(PLAYER_FIELD_TODAY_CONTRIBUTION)); - stmt->setUInt32(index++, GetUInt32Value(PLAYER_FIELD_YESTERDAY_CONTRIBUTION)); + stmt->setUInt32(index++, GetCurrency(CURRENCY_TYPE_CONQUEST_POINTS)); + stmt->setUInt32(index++, GetCurrency(CURRENCY_TYPE_HONOR_POINTS)); stmt->setUInt32(index++, GetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS)); stmt->setUInt16(index++, GetUInt16Value(PLAYER_FIELD_KILLS, 0)); stmt->setUInt16(index++, GetUInt16Value(PLAYER_FIELD_KILLS, 1)); stmt->setUInt32(index++, GetUInt32Value(PLAYER_CHOSEN_TITLE)); - stmt->setUInt64(index++, GetUInt64Value(PLAYER_FIELD_KNOWN_CURRENCIES)); stmt->setUInt32(index++, GetUInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX)); stmt->setUInt16(index++, (uint16)(GetUInt32Value(PLAYER_BYTES_3) & 0xFFFE)); stmt->setUInt32(index++, GetHealth()); @@ -18385,9 +18323,7 @@ void Player::SaveToDB(bool create /*=false*/) // cache equipment... for (uint32 i = 0; i < EQUIPMENT_SLOT_END * 2; ++i) ss << GetUInt32Value(PLAYER_VISIBLE_ITEM_1_ENTRYID + i) << ' '; - stmt->setString(index++, ss.str()); - ss.str().clear(); // ...and bags for enum opcode for (uint32 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) { @@ -18397,14 +18333,13 @@ void Player::SaveToDB(bool create /*=false*/) ss << '0'; ss << " 0 "; } - stmt->setString(index++, ss.str()); ss.str().clear(); for (uint32 i = 0; i < KNOWN_TITLES_SIZE*2; ++i) ss << GetUInt32Value(PLAYER__FIELD_KNOWN_TITLES + i); - stmt->setString(index++, ss.str()); + stmt->setUInt8(index++, GetByteValue(PLAYER_FIELD_BYTES, 2)); stmt->setUInt32(index++, m_grantableLevels); } @@ -18467,15 +18402,12 @@ void Player::SaveToDB(bool create /*=false*/) ss << m_taxi.SaveTaxiDestinationsToString(); stmt->setString(index++, ss.str()); - stmt->setUInt32(index++, GetArenaPoints()); - stmt->setUInt32(index++, GetHonorPoints()); - stmt->setUInt32(index++, GetUInt32Value(PLAYER_FIELD_TODAY_CONTRIBUTION)); - stmt->setUInt32(index++, GetUInt32Value(PLAYER_FIELD_YESTERDAY_CONTRIBUTION)); + stmt->setUInt32(index++, GetCurrency(CURRENCY_TYPE_CONQUEST_POINTS)); + stmt->setUInt32(index++, GetCurrency(CURRENCY_TYPE_HONOR_POINTS)); stmt->setUInt32(index++, GetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS)); stmt->setUInt16(index++, GetUInt16Value(PLAYER_FIELD_KILLS, 0)); stmt->setUInt16(index++, GetUInt16Value(PLAYER_FIELD_KILLS, 1)); stmt->setUInt32(index++, GetUInt32Value(PLAYER_CHOSEN_TITLE)); - stmt->setUInt64(index++, GetUInt64Value(PLAYER_FIELD_KNOWN_CURRENCIES)); stmt->setUInt32(index++, GetUInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX)); stmt->setUInt16(index++, (uint16)(GetUInt32Value(PLAYER_BYTES_3) & 0xFFFE)); stmt->setUInt32(index++, GetHealth()); @@ -21575,6 +21507,7 @@ void Player::SendInitialPacketsBeforeAddToMap() // SMSG_PET_GUIDS // SMSG_UPDATE_WORLD_STATE // SMSG_POWER_UPDATE + SendCurrencies(); } void Player::SendInitialPacketsAfterAddToMap() @@ -21983,6 +21916,7 @@ void Player::ResetWeeklyQuestStatus() m_weeklyquests.clear(); // DB data deleted in caller m_WeeklyQuestChanged = false; + } Battleground* Player::GetBattleground() const @@ -24735,13 +24669,7 @@ void Player::RefundItem(Item* item) if (moneyRefund) ModifyMoney(moneyRefund); // Saved in SaveInventoryAndGoldToDB - // Grant back Honor points - //if (uint32 honorRefund = iece->reqhonorpoints) - // ModifyHonorPoints(honorRefund, &trans); - - // Grant back Arena points - //if (uint32 arenaRefund = iece->reqarenapoints) - // ModifyArenaPoints(arenaRefund, &trans); + // Grant back Arena and Honor points ? SaveInventoryAndGoldToDB(trans); diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index efe9dd487d5..75c99ec0eff 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -895,12 +895,6 @@ enum CharDeleteMethod // the name gets freed up and appears as deleted ingame }; -enum CurrencyItems -{ - ITEM_HONOR_POINTS_ID = 43308, - ITEM_ARENA_POINTS_ID = 43307 -}; - enum ReferAFriendError { ERR_REFER_A_FRIEND_NONE = 0x00, @@ -1320,10 +1314,6 @@ class Player : public Unit, public GridObject void ModifyCurrency(uint32 id, int32 count); void ApplyEquipCooldown(Item* pItem); - void SetAmmo(uint32 item); - void RemoveAmmo(); - float GetAmmoDPS() const { return m_ammoDPS; } - bool CheckAmmoCompatibility(const ItemTemplate* ammo_proto) const; void QuickEquipItem(uint16 pos, Item* pItem); void VisualizeItem(uint8 slot, Item* pItem); void SetVisibleItemSlot(uint8 slot, Item* pItem); @@ -2090,14 +2080,8 @@ class Player : public Unit, public GridObject /*********************************************************/ // TODO: Properly implement correncies as of Cataclysm void UpdateHonorFields(); - bool RewardHonor(Unit* pVictim, uint32 groupsize, int32 honor = -1, bool pvptoken = false); - uint32 GetHonorPoints() const { return GetUInt32Value(PLAYER_FIELD_HONOR_CURRENCY); } - uint32 GetArenaPoints() const { return GetUInt32Value(PLAYER_FIELD_ARENA_CURRENCY); } - void ModifyHonorPoints(int32 value, SQLTransaction* trans = NULL); //! If trans is specified, honor save query will be added to trans - void ModifyArenaPoints(int32 value, SQLTransaction* trans = NULL); //! If trans is specified, arena point save query will be added to trans + bool RewardHonor(Unit* victim, uint32 groupsize, int32 honor = -1, bool pvptoken = false); uint32 GetMaxPersonalArenaRatingRequirement(uint32 minarenaslot) const; - void SetHonorPoints(uint32 value); - void SetArenaPoints(uint32 value); //End of PvP System @@ -2780,7 +2764,6 @@ class Player : public Unit, public GridObject bool m_canBlock; bool m_canTitanGrip; uint8 m_swingErrorMsg; - float m_ammoDPS; ////////////////////Rest System///////////////////// time_t time_inn_enter; diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index aa5d783323a..d263b37e6ef 100755 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -512,11 +512,13 @@ void Player::CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bo weapon_mindamage = BASE_MINDAMAGE; weapon_maxdamage = BASE_MAXDAMAGE; } + /* + TODO: Is this still needed after ammo has been removed? else if (attType == RANGED_ATTACK) //add ammo DPS to ranged damage { - weapon_mindamage += GetAmmoDPS() * att_speed; - weapon_maxdamage += GetAmmoDPS() * att_speed; - } + weapon_mindamage += ammo * att_speed; + weapon_maxdamage += ammo * att_speed; + }*/ min_damage = ((base_value + weapon_mindamage) * base_pct + total_value) * total_pct; max_damage = ((base_value + weapon_maxdamage) * base_pct + total_value) * total_pct; diff --git a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp b/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp index bf40b048151..63ea359755d 100755 --- a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp @@ -1227,13 +1227,11 @@ void WorldSession::HandleInspectHonorStatsOpcode(WorldPacket& recv_data) return; } - WorldPacket data(SMSG_INSPECT_HONOR_STATS, 8+1+4*4); - data << uint64(player->GetGUID()); - data << uint8(player->GetHonorPoints()); + WorldPacket data(SMSG_INSPECT_HONOR_STATS, 4+1+4+8); data << uint32(player->GetUInt32Value(PLAYER_FIELD_KILLS)); - data << uint32(player->GetUInt32Value(PLAYER_FIELD_TODAY_CONTRIBUTION)); - data << uint32(player->GetUInt32Value(PLAYER_FIELD_YESTERDAY_CONTRIBUTION)); + data << uint8(0); // rank data << uint32(player->GetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS)); + data << uint64(player->GetGUID()); SendPacket(&data); } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index ad182b4120a..3152d19e744 100755 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -658,7 +658,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_BIDDER_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SET_FLAT_SPELL_MODIFIER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SET_PCT_SPELL_MODIFIER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_AMMO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_CORPSE_RECLAIM_DELAY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIVE_MOVER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActiveMoverOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_PET_CANCEL_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetCancelAuraOpcode ); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 867ae80319f..bd9a0159c72 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -1972,7 +1972,7 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mo if (PowerType != POWER_MANA) { - uint32 oldPower = target->GetPower(PowerType); + int32 oldPower = target->GetPower(PowerType); // reset power to default values only at power change if (target->getPowerType() != PowerType) target->setPowerType(PowerType); @@ -1999,7 +1999,7 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mo break; case FORM_BEAR: case FORM_DIREBEAR: - if (urand(0, 99) < FurorChance) + if (irand(0, 99) < FurorChance) target->CastSpell(target, 17057, true); default: { diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index f98d0ab3e46..e95203d97be 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -700,7 +700,7 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex) damage += int32(dmg_min); else damage += irand(int32(dmg_min), int32(dmg_max)); - damage += int32(m_caster->ToPlayer()->GetAmmoDPS()*item->GetTemplate()->Delay*0.001f); + damage += int32(item->GetTemplate()->Delay*0.001f); } } } diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index 28bc17a7450..ed97cbf7659 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -1093,7 +1093,7 @@ public: return true; } - static bool HandleModifyHonorCommand (ChatHandler* handler, const char* args) + static bool HandleModifyHonorCommand(ChatHandler* handler, const char* args) { if (!*args) return false; @@ -1112,9 +1112,9 @@ public: int32 amount = (uint32)atoi(args); - target->ModifyHonorPoints(amount); + target->ModifyCurrency(CURRENCY_TYPE_HONOR_POINTS, amount); - handler->PSendSysMessage(LANG_COMMAND_MODIFY_HONOR, handler->GetNameLink(target).c_str(), target->GetHonorPoints()); + handler->PSendSysMessage(LANG_COMMAND_MODIFY_HONOR, handler->GetNameLink(target).c_str(), target->GetCurrency(CURRENCY_TYPE_HONOR_POINTS)); return true; } @@ -1302,9 +1302,9 @@ public: int32 amount = (uint32)atoi(args); - target->ModifyArenaPoints(amount); + target->ModifyCurrency(CURRENCY_TYPE_CONQUEST_POINTS, amount); - handler->PSendSysMessage(LANG_COMMAND_MODIFY_ARENA, handler->GetNameLink(target).c_str(), target->GetArenaPoints()); + handler->PSendSysMessage(LANG_COMMAND_MODIFY_ARENA, handler->GetNameLink(target).c_str(), target->GetCurrency(CURRENCY_TYPE_CONQUEST_POINTS)); return true; } diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index 41e9a1c8220..b5ea47d1a53 100755 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -41,8 +41,8 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_LOAD_PLAYER, "SELECT guid, account, name, race, class, gender, level, xp, money, playerBytes, playerBytes2, playerFlags, " "position_x, position_y, position_z, map, orientation, taximask, cinematic, totaltime, leveltime, rest_bonus, logout_time, is_logout_resting, resettalents_cost, " "resettalents_time, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, online, death_expire_time, taxi_path, instance_mode_mask, " - "arenaPoints, totalHonorPoints, todayHonorPoints, yesterdayHonorPoints, totalKills, todayKills, yesterdayKills, chosenTitle, knownCurrencies, watchedFaction, drunk, " - "health, power1, power2, power3, power4, power5, instance_id, speccount, activespec, exploredZones, equipmentCache, knownTitles, actionBars, grantableLevels, guildId FROM characters WHERE guid = ?", CONNECTION_ASYNC) + "conquestPoints, totalHonorPoints, totalKills, todayKills, yesterdayKills, chosenTitle, watchedFaction, drunk, " + "health, power1, power2, power3, power4, power5, instance_id, speccount, activespec, exploredZones, equipmentCache, knownTitles, actionBars, grantableLevels FROM characters WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_LOAD_PLAYER_GROUP, "SELECT guid FROM group_member WHERE memberGuid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_LOAD_PLAYER_BOUNDINSTANCES, "SELECT id, permanent, map, difficulty, resettime FROM character_instance LEFT JOIN instance ON instance = id WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_LOAD_PLAYER_AURAS, "SELECT caster_guid, spell, effect_mask, recalculate_mask, stackcount, amount0, amount1, amount2, " @@ -309,14 +309,14 @@ void CharacterDatabaseConnection::DoPrepareStatements() "taximask, cinematic, " "totaltime, leveltime, rest_bonus, logout_time, is_logout_resting, resettalents_cost, resettalents_time, " "extra_flags, stable_slots, at_login, zone, " - "death_expire_time, taxi_path, arenaPoints, totalHonorPoints, todayHonorPoints, yesterdayHonorPoints, totalKills, " - "todayKills, yesterdayKills, chosenTitle, knownCurrencies, watchedFaction, drunk, health, power1, power2, power3, " + "death_expire_time, taxi_path, conquestPoints, totalHonorPoints, totalKills, " + "todayKills, yesterdayKills, chosenTitle, watchedFaction, drunk, health, power1, power2, power3, " "power4, power5, latency, speccount, activespec, exploredZones, equipmentCache, knownTitles, actionBars, grantableLevels, guildId) VALUES " - "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", CONNECTION_ASYNC); + "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_UPD_CHARACTER, "UPDATE characters SET name=?,race=?,class=?,gender=?,level=?,xp=?,money=?,playerBytes=?,playerBytes2=?,playerFlags=?," "map=?,instance_id=?,instance_mode_mask=?,position_x=?,position_y=?,position_z=?,orientation=?,taximask=?,cinematic=?,totaltime=?,leveltime=?,rest_bonus=?," "logout_time=?,is_logout_resting=?,resettalents_cost=?,resettalents_time=?,extra_flags=?,stable_slots=?,at_login=?,zone=?,death_expire_time=?,taxi_path=?," - "arenaPoints=?,totalHonorPoints=?,todayHonorPoints=?,yesterdayHonorPoints=?,totalKills=?,todayKills=?,yesterdayKills=?,chosenTitle=?,knownCurrencies=?," + "conquestPoints=?,totalHonorPoints=?,totalKills=?,todayKills=?,yesterdayKills=?,chosenTitle=?," "watchedFaction=?,drunk=?,health=?,power1=?,power2=?,power3=?,power4=?,power5=?,latency=?,speccount=?,activespec=?,exploredZones=?," "equipmentCache=?,knownTitles=?,actionBars=?,grantableLevels=?,guildId=?,online=? WHERE guid=?", CONNECTION_ASYNC); } -- cgit v1.2.3 From 31533a342a56b1db22b50fe9f6c4c24c380cd507 Mon Sep 17 00:00:00 2001 From: kaelima Date: Sat, 26 Nov 2011 01:54:24 +0100 Subject: Core/DB: Another typo in SaveToDB --- src/server/game/Entities/Player/Player.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 5f9c900b39c..5ae9d8f3dca 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -18429,9 +18429,7 @@ void Player::SaveToDB(bool create /*=false*/) // cache equipment... for (uint32 i = 0; i < EQUIPMENT_SLOT_END * 2; ++i) ss << GetUInt32Value(PLAYER_VISIBLE_ITEM_1_ENTRYID + i) << ' '; - stmt->setString(index++, ss.str()); - ss.str().clear(); // ...and bags for enum opcode for (uint32 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) { -- cgit v1.2.3 From d4de58703636721c3e9b873c8e5b16b68497bd52 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 26 Nov 2011 12:02:26 +0100 Subject: Core/Items: Removed obsolete field from ItemTemplate --- src/server/game/Entities/Item/ItemPrototype.h | 19 ++++++++++--------- src/server/game/Entities/Player/Player.cpp | 2 -- 2 files changed, 10 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Item/ItemPrototype.h b/src/server/game/Entities/Item/ItemPrototype.h index 0234b90e7f5..5d72e5b0114 100755 --- a/src/server/game/Entities/Item/ItemPrototype.h +++ b/src/server/game/Entities/Item/ItemPrototype.h @@ -591,7 +591,6 @@ struct ItemTemplate uint32 Quality; uint32 Flags; uint32 Flags2; - uint32 BuyCount; int32 BuyPrice; uint32 SellPrice; uint32 InventoryType; @@ -609,20 +608,14 @@ struct ItemTemplate int32 MaxCount; // <= 0: no limit int32 Stackable; // 0: not allowed, -1: put in player coin info tab and don't limit stacking (so 1 slot) uint32 ContainerSlots; - uint32 StatsCount; _ItemStat ItemStat[MAX_ITEM_PROTO_STATS]; uint32 ScalingStatDistribution; // id from ScalingStatDistribution.dbc - float DamageMin; - float DamageMax; uint32 DamageType; // id from Resistances.dbc - float DPS; - uint32 Armor; uint32 Delay; float RangedModRange; _Spell Spells[MAX_ITEM_PROTO_SPELLS]; - float SpellPPMRate; uint32 Bonding; - std::string Description; + std::string Description; uint32 PageText; uint32 LanguageID; uint32 PageMaterial; @@ -641,7 +634,6 @@ struct ItemTemplate _Socket Socket[MAX_ITEM_PROTO_SOCKETS]; uint32 socketBonus; // id from SpellItemEnchantment.dbc uint32 GemProperties; // id from GemProperties.dbc - uint32 RequiredDisenchantSkill; float ArmorDamageModifier; int32 Duration; // negative = realtime, positive = ingame time uint32 ItemLimitCategory; // id from ItemLimitCategory.dbc @@ -649,8 +641,17 @@ struct ItemTemplate float StatScalingFactor; int32 Field130; int32 Field131; + + // extra fields, not part of db2 files + uint32 BuyCount; + float DamageMin; + float DamageMax; + float DPS; + uint32 Armor; + float SpellPPMRate; uint32 ScriptId; uint32 DisenchantID; + uint32 RequiredDisenchantSkill; uint32 FoodType; uint32 MinMoneyLoot; uint32 MaxMoneyLoot; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index fcf5e872f15..ba7d57df137 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -7825,8 +7825,6 @@ void Player::_ApplyItemBonuses(ItemTemplate const* proto, uint8 slot, bool apply } else { - if (i >= proto->StatsCount) - continue; statType = proto->ItemStat[i].ItemStatType; val = proto->ItemStat[i].ItemStatValue; } -- cgit v1.2.3 From 711858c43bdf58fe309a2a23cfc674bb1bbf894f Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 26 Nov 2011 14:49:15 +0000 Subject: Core/Quests: Update `quest_template` and SMSG_QUEST_QUERY_RESPONSE TODO: - Validate SkillId and reward it - Validate Currency, add it to the requires and reward it (after being able to read currency dbc) - Update other quest related opcodes --- sql/updates/world/2011_11_24_01_world_command.sql | 2 - .../2011_11_24_02_world_player_xp_for_level.sql | 7 - .../2011_11_25_02_world_item_script_names.sql | 17 -- .../world/2011_11_25_02_world_item_template.sql | 48 ----- .../2011_11_25_02_world_item_template_addon.sql | 38 ---- .../world/4.x/2011_11_24_01_world_command.sql | 2 + .../2011_11_24_02_world_player_xp_for_level.sql | 7 + .../4.x/2011_11_25_02_world_item_script_names.sql | 17 ++ .../4.x/2011_11_25_02_world_item_template.sql | 48 +++++ .../2011_11_25_02_world_item_template_addon.sql | 38 ++++ .../4.x/2011_12_26_02_world_quest_template.sql | 31 +++ src/server/game/Entities/Creature/GossipDef.cpp | 46 ++++- src/server/game/Entities/Player/Player.cpp | 16 +- src/server/game/Globals/ObjectMgr.cpp | 209 ++++++++++++++++++--- src/server/game/Quests/QuestDef.cpp | 134 ++++++++----- src/server/game/Quests/QuestDef.h | 62 ++++-- 16 files changed, 512 insertions(+), 210 deletions(-) delete mode 100644 sql/updates/world/2011_11_24_01_world_command.sql delete mode 100644 sql/updates/world/2011_11_24_02_world_player_xp_for_level.sql delete mode 100644 sql/updates/world/2011_11_25_02_world_item_script_names.sql delete mode 100644 sql/updates/world/2011_11_25_02_world_item_template.sql delete mode 100644 sql/updates/world/2011_11_25_02_world_item_template_addon.sql create mode 100644 sql/updates/world/4.x/2011_11_24_01_world_command.sql create mode 100644 sql/updates/world/4.x/2011_11_24_02_world_player_xp_for_level.sql create mode 100644 sql/updates/world/4.x/2011_11_25_02_world_item_script_names.sql create mode 100644 sql/updates/world/4.x/2011_11_25_02_world_item_template.sql create mode 100644 sql/updates/world/4.x/2011_11_25_02_world_item_template_addon.sql create mode 100644 sql/updates/world/4.x/2011_12_26_02_world_quest_template.sql (limited to 'src') diff --git a/sql/updates/world/2011_11_24_01_world_command.sql b/sql/updates/world/2011_11_24_01_world_command.sql deleted file mode 100644 index 849a7538621..00000000000 --- a/sql/updates/world/2011_11_24_01_world_command.sql +++ /dev/null @@ -1,2 +0,0 @@ -UPDATE `command` SET `help`='Syntax: .account set addon [$account] #addon\n\nSet user (possible targeted) expansion addon level allowed. Addon values: 0 - normal, 1 - tbc, 2 - wotlk, 3 - cata.' WHERE `name`='account set addon'; -UPDATE `command` SET `help`='Syntax: .account addon #addon\nSet expansion addon level allowed. Addon values: 0 - normal, 1 - tbc, 2 - wotlk, 3 - cata.' WHERE `name`='account addon'; diff --git a/sql/updates/world/2011_11_24_02_world_player_xp_for_level.sql b/sql/updates/world/2011_11_24_02_world_player_xp_for_level.sql deleted file mode 100644 index d108b01824d..00000000000 --- a/sql/updates/world/2011_11_24_02_world_player_xp_for_level.sql +++ /dev/null @@ -1,7 +0,0 @@ -DELETE FROM `player_xp_for_level` WHERE `lvl` BETWEEN 80 AND 84; -INSERT INTO `player_xp_for_level` (`lvl`, `xp_for_next_level`) VALUES -(80, 1686300), -(81, 2121500), -(82, 4004000), -(83, 5203400), -(84, 9165100); diff --git a/sql/updates/world/2011_11_25_02_world_item_script_names.sql b/sql/updates/world/2011_11_25_02_world_item_script_names.sql deleted file mode 100644 index aaf843b91ae..00000000000 --- a/sql/updates/world/2011_11_25_02_world_item_script_names.sql +++ /dev/null @@ -1,17 +0,0 @@ -DROP TABLE IF EXISTS `item_script_names`; -CREATE TABLE `item_script_names` ( -`Id` int(10) unsigned not null, -`ScriptName` varchar(64) not null, -PRIMARY KEY(`Id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; - -INSERT INTO `item_script_names` -SELECT -`item_template`.`entry` AS `Id`, -`item_template`.`ScriptName` AS `ScriptName` -FROM -`item_template` -WHERE -length(`item_template`.`ScriptName`)>0; - -ALTER TABLE `item_template` DROP `ScriptName`; diff --git a/sql/updates/world/2011_11_25_02_world_item_template.sql b/sql/updates/world/2011_11_25_02_world_item_template.sql deleted file mode 100644 index 8a047ed9d11..00000000000 --- a/sql/updates/world/2011_11_25_02_world_item_template.sql +++ /dev/null @@ -1,48 +0,0 @@ -ALTER TABLE `item_template` - ADD `stat_unk1_1` int(11) not null default 0 AFTER `stat_value1`, - ADD `stat_unk2_1` int(11) not null default 0 AFTER `stat_unk1_1`, - ADD `stat_unk1_2` int(11) not null default 0 AFTER `stat_value2`, - ADD `stat_unk2_2` int(11) not null default 0 AFTER `stat_unk1_2`, - ADD `stat_unk1_3` int(11) not null default 0 AFTER `stat_value3`, - ADD `stat_unk2_3` int(11) not null default 0 AFTER `stat_unk1_3`, - ADD `stat_unk1_4` int(11) not null default 0 AFTER `stat_value4`, - ADD `stat_unk2_4` int(11) not null default 0 AFTER `stat_unk1_4`, - ADD `stat_unk1_5` int(11) not null default 0 AFTER `stat_value5`, - ADD `stat_unk2_5` int(11) not null default 0 AFTER `stat_unk1_5`, - ADD `stat_unk1_6` int(11) not null default 0 AFTER `stat_value6`, - ADD `stat_unk2_6` int(11) not null default 0 AFTER `stat_unk1_6`, - ADD `stat_unk1_7` int(11) not null default 0 AFTER `stat_value7`, - ADD `stat_unk2_7` int(11) not null default 0 AFTER `stat_unk1_7`, - ADD `stat_unk1_8` int(11) not null default 0 AFTER `stat_value8`, - ADD `stat_unk2_8` int(11) not null default 0 AFTER `stat_unk1_8`, - ADD `stat_unk1_9` int(11) not null default 0 AFTER `stat_value9`, - ADD `stat_unk2_9` int(11) not null default 0 AFTER `stat_unk1_9`, - ADD `stat_unk1_10` int(11) not null default 0 AFTER `stat_value10`, - ADD `stat_unk2_10` int(11) not null default 0 AFTER `stat_unk1_10`, - DROP `StatsCount`, - DROP `ScalingStatValue`, - CHANGE `dmg_type1` `DamageType` tinyint(3) unsigned not null default 0 AFTER `ScalingStatDistribution`, - DROP `dmg_min1`, - DROP `dmg_max1`, - DROP `dmg_min2`, - DROP `dmg_max2`, - DROP `dmg_type2`, - DROP `armor`, - DROP `holy_res`, - DROP `fire_res`, - DROP `nature_res`, - DROP `frost_res`, - DROP `shadow_res`, - DROP `arcane_res`, - DROP `ammo_type`, - DROP `spellppmRate_1`, - DROP `spellppmRate_2`, - DROP `spellppmRate_3`, - DROP `spellppmRate_4`, - DROP `spellppmRate_5`, - DROP `block`, - DROP `RequiredDisenchantSkill`, - DROP `DisenchantId`, - ADD `StatScalingFactor` float not null default 0 AFTER `HolidayId`, - ADD `Field130` int(11) not null default 0 AFTER `StatScalingFactor`, - ADD `Field131` int(11) not null default 0 AFTER `Field130`; diff --git a/sql/updates/world/2011_11_25_02_world_item_template_addon.sql b/sql/updates/world/2011_11_25_02_world_item_template_addon.sql deleted file mode 100644 index 2d99d9fc610..00000000000 --- a/sql/updates/world/2011_11_25_02_world_item_template_addon.sql +++ /dev/null @@ -1,38 +0,0 @@ -DROP TABLE IF EXISTS `item_template_addon`; -CREATE TABLE `item_template_addon` ( -`Id` int(10) unsigned not null, -`BuyCount` tinyint(3) unsigned not null default 1, -`FoodType` tinyint(3) unsigned not null default 0, -`MinMoneyLoot` int(10) unsigned not null default 0, -`MaxMoneyLoot` int(10) unsigned not null default 0, -`SpellPPMChance` float unsigned not null default 0, -PRIMARY KEY(`Id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; - -INSERT INTO `item_template_addon` -SELECT -`item_template`.`entry` AS `Id`, -`item_template`.`BuyCount` AS `BuyCount`, -`item_template`.`FoodType` AS `FoodType`, -`item_template`.`minMoneyLoot` AS `MinMoneyLoot`, -`item_template`.`maxMoneyLoot` AS `MaxMoneyLoot`, -ABS(IF(`item_template`.`spelltrigger_1`=2, `item_template`.`spellppmRate_1`, - IF (`item_template`.`spelltrigger_2`=2, `item_template`.`spellppmRate_2`, - IF (`item_template`.`spelltrigger_3`=2, `item_template`.`spellppmRate_3`, - IF (`item_template`.`spelltrigger_4`=2, `item_template`.`spellppmRate_4`, - IF (`item_template`.`spelltrigger_5`=2, `item_template`.`spellppmRate_5`, 0)))))) - AS `SpellPPMChance` -FROM -`item_template` -HAVING -- need to use having due to `SpellPPMChance` usage which is not an actual field in table -`item_template`.`BuyCount`!=1 OR -`item_template`.`FoodType`!=0 OR -(`item_template`.`minMoneyLoot`!=0 AND -`item_template`.`maxMoneyLoot`!=0) OR -`SpellPPMChance`!=0; - -ALTER TABLE `item_template` - DROP `BuyCount`, - DROP `FoodType`, - DROP `minMoneyLoot`, - DROP `maxMoneyLoot`; diff --git a/sql/updates/world/4.x/2011_11_24_01_world_command.sql b/sql/updates/world/4.x/2011_11_24_01_world_command.sql new file mode 100644 index 00000000000..849a7538621 --- /dev/null +++ b/sql/updates/world/4.x/2011_11_24_01_world_command.sql @@ -0,0 +1,2 @@ +UPDATE `command` SET `help`='Syntax: .account set addon [$account] #addon\n\nSet user (possible targeted) expansion addon level allowed. Addon values: 0 - normal, 1 - tbc, 2 - wotlk, 3 - cata.' WHERE `name`='account set addon'; +UPDATE `command` SET `help`='Syntax: .account addon #addon\nSet expansion addon level allowed. Addon values: 0 - normal, 1 - tbc, 2 - wotlk, 3 - cata.' WHERE `name`='account addon'; diff --git a/sql/updates/world/4.x/2011_11_24_02_world_player_xp_for_level.sql b/sql/updates/world/4.x/2011_11_24_02_world_player_xp_for_level.sql new file mode 100644 index 00000000000..d108b01824d --- /dev/null +++ b/sql/updates/world/4.x/2011_11_24_02_world_player_xp_for_level.sql @@ -0,0 +1,7 @@ +DELETE FROM `player_xp_for_level` WHERE `lvl` BETWEEN 80 AND 84; +INSERT INTO `player_xp_for_level` (`lvl`, `xp_for_next_level`) VALUES +(80, 1686300), +(81, 2121500), +(82, 4004000), +(83, 5203400), +(84, 9165100); diff --git a/sql/updates/world/4.x/2011_11_25_02_world_item_script_names.sql b/sql/updates/world/4.x/2011_11_25_02_world_item_script_names.sql new file mode 100644 index 00000000000..aaf843b91ae --- /dev/null +++ b/sql/updates/world/4.x/2011_11_25_02_world_item_script_names.sql @@ -0,0 +1,17 @@ +DROP TABLE IF EXISTS `item_script_names`; +CREATE TABLE `item_script_names` ( +`Id` int(10) unsigned not null, +`ScriptName` varchar(64) not null, +PRIMARY KEY(`Id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; + +INSERT INTO `item_script_names` +SELECT +`item_template`.`entry` AS `Id`, +`item_template`.`ScriptName` AS `ScriptName` +FROM +`item_template` +WHERE +length(`item_template`.`ScriptName`)>0; + +ALTER TABLE `item_template` DROP `ScriptName`; diff --git a/sql/updates/world/4.x/2011_11_25_02_world_item_template.sql b/sql/updates/world/4.x/2011_11_25_02_world_item_template.sql new file mode 100644 index 00000000000..8a047ed9d11 --- /dev/null +++ b/sql/updates/world/4.x/2011_11_25_02_world_item_template.sql @@ -0,0 +1,48 @@ +ALTER TABLE `item_template` + ADD `stat_unk1_1` int(11) not null default 0 AFTER `stat_value1`, + ADD `stat_unk2_1` int(11) not null default 0 AFTER `stat_unk1_1`, + ADD `stat_unk1_2` int(11) not null default 0 AFTER `stat_value2`, + ADD `stat_unk2_2` int(11) not null default 0 AFTER `stat_unk1_2`, + ADD `stat_unk1_3` int(11) not null default 0 AFTER `stat_value3`, + ADD `stat_unk2_3` int(11) not null default 0 AFTER `stat_unk1_3`, + ADD `stat_unk1_4` int(11) not null default 0 AFTER `stat_value4`, + ADD `stat_unk2_4` int(11) not null default 0 AFTER `stat_unk1_4`, + ADD `stat_unk1_5` int(11) not null default 0 AFTER `stat_value5`, + ADD `stat_unk2_5` int(11) not null default 0 AFTER `stat_unk1_5`, + ADD `stat_unk1_6` int(11) not null default 0 AFTER `stat_value6`, + ADD `stat_unk2_6` int(11) not null default 0 AFTER `stat_unk1_6`, + ADD `stat_unk1_7` int(11) not null default 0 AFTER `stat_value7`, + ADD `stat_unk2_7` int(11) not null default 0 AFTER `stat_unk1_7`, + ADD `stat_unk1_8` int(11) not null default 0 AFTER `stat_value8`, + ADD `stat_unk2_8` int(11) not null default 0 AFTER `stat_unk1_8`, + ADD `stat_unk1_9` int(11) not null default 0 AFTER `stat_value9`, + ADD `stat_unk2_9` int(11) not null default 0 AFTER `stat_unk1_9`, + ADD `stat_unk1_10` int(11) not null default 0 AFTER `stat_value10`, + ADD `stat_unk2_10` int(11) not null default 0 AFTER `stat_unk1_10`, + DROP `StatsCount`, + DROP `ScalingStatValue`, + CHANGE `dmg_type1` `DamageType` tinyint(3) unsigned not null default 0 AFTER `ScalingStatDistribution`, + DROP `dmg_min1`, + DROP `dmg_max1`, + DROP `dmg_min2`, + DROP `dmg_max2`, + DROP `dmg_type2`, + DROP `armor`, + DROP `holy_res`, + DROP `fire_res`, + DROP `nature_res`, + DROP `frost_res`, + DROP `shadow_res`, + DROP `arcane_res`, + DROP `ammo_type`, + DROP `spellppmRate_1`, + DROP `spellppmRate_2`, + DROP `spellppmRate_3`, + DROP `spellppmRate_4`, + DROP `spellppmRate_5`, + DROP `block`, + DROP `RequiredDisenchantSkill`, + DROP `DisenchantId`, + ADD `StatScalingFactor` float not null default 0 AFTER `HolidayId`, + ADD `Field130` int(11) not null default 0 AFTER `StatScalingFactor`, + ADD `Field131` int(11) not null default 0 AFTER `Field130`; diff --git a/sql/updates/world/4.x/2011_11_25_02_world_item_template_addon.sql b/sql/updates/world/4.x/2011_11_25_02_world_item_template_addon.sql new file mode 100644 index 00000000000..2d99d9fc610 --- /dev/null +++ b/sql/updates/world/4.x/2011_11_25_02_world_item_template_addon.sql @@ -0,0 +1,38 @@ +DROP TABLE IF EXISTS `item_template_addon`; +CREATE TABLE `item_template_addon` ( +`Id` int(10) unsigned not null, +`BuyCount` tinyint(3) unsigned not null default 1, +`FoodType` tinyint(3) unsigned not null default 0, +`MinMoneyLoot` int(10) unsigned not null default 0, +`MaxMoneyLoot` int(10) unsigned not null default 0, +`SpellPPMChance` float unsigned not null default 0, +PRIMARY KEY(`Id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; + +INSERT INTO `item_template_addon` +SELECT +`item_template`.`entry` AS `Id`, +`item_template`.`BuyCount` AS `BuyCount`, +`item_template`.`FoodType` AS `FoodType`, +`item_template`.`minMoneyLoot` AS `MinMoneyLoot`, +`item_template`.`maxMoneyLoot` AS `MaxMoneyLoot`, +ABS(IF(`item_template`.`spelltrigger_1`=2, `item_template`.`spellppmRate_1`, + IF (`item_template`.`spelltrigger_2`=2, `item_template`.`spellppmRate_2`, + IF (`item_template`.`spelltrigger_3`=2, `item_template`.`spellppmRate_3`, + IF (`item_template`.`spelltrigger_4`=2, `item_template`.`spellppmRate_4`, + IF (`item_template`.`spelltrigger_5`=2, `item_template`.`spellppmRate_5`, 0)))))) + AS `SpellPPMChance` +FROM +`item_template` +HAVING -- need to use having due to `SpellPPMChance` usage which is not an actual field in table +`item_template`.`BuyCount`!=1 OR +`item_template`.`FoodType`!=0 OR +(`item_template`.`minMoneyLoot`!=0 AND +`item_template`.`maxMoneyLoot`!=0) OR +`SpellPPMChance`!=0; + +ALTER TABLE `item_template` + DROP `BuyCount`, + DROP `FoodType`, + DROP `minMoneyLoot`, + DROP `maxMoneyLoot`; diff --git a/sql/updates/world/4.x/2011_12_26_02_world_quest_template.sql b/sql/updates/world/4.x/2011_12_26_02_world_quest_template.sql new file mode 100644 index 00000000000..b43abd6f85d --- /dev/null +++ b/sql/updates/world/4.x/2011_12_26_02_world_quest_template.sql @@ -0,0 +1,31 @@ +ALTER TABLE `quest_template` ADD COLUMN `MinimapTargetMark` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `SpecialFlags`, + ADD COLUMN `RewardSkillId` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardArenaPoints`, + ADD COLUMN `RewardSkillPoints` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardSkillId`, + ADD COLUMN `RewardReputationMask` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardSkillPoints`, + ADD COLUMN `QuestGiverPortrait` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardReputationMask`, + ADD COLUMN `QuestTurnInPortrait` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0' AFTER `QuestGiverPortrait`, + ADD COLUMN `RequiredSpell` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0' AFTER `RequiredItemCount6`, + ADD COLUMN `RewardCurrencyId1` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `ObjectiveText4`, + ADD COLUMN `RewardCurrencyId2` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardCurrencyId1`, + ADD COLUMN `RewardCurrencyId3` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardCurrencyId2`, + ADD COLUMN `RewardCurrencyId4` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardCurrencyId3`, + ADD COLUMN `RewardCurrencyCount1` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardCurrencyId4`, + ADD COLUMN `RewardCurrencyCount2` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardCurrencyCount1`, + ADD COLUMN `RewardCurrencyCount3` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardCurrencyCount2`, + ADD COLUMN `RewardCurrencyCount4` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardCurrencyCount3`, + ADD COLUMN `RequiredCurrencyId1` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardCurrencyCount4`, + ADD COLUMN `RequiredCurrencyId2` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `RequiredCurrencyId1`, + ADD COLUMN `RequiredCurrencyId3` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `RequiredCurrencyId2`, + ADD COLUMN `RequiredCurrencyId4` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `RequiredCurrencyId3`, + ADD COLUMN `RequiredCurrencyCount1` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `RequiredCurrencyId4`, + ADD COLUMN `RequiredCurrencyCount2` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `RequiredCurrencyCount1`, + ADD COLUMN `RequiredCurrencyCount3` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `RequiredCurrencyCount2`, + ADD COLUMN `RequiredCurrencyCount4` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `RequiredCurrencyCount3`, + ADD COLUMN `QuestGiverTextWindow` TEXT NULL DEFAULT NULL AFTER `RequiredCurrencyCount4`, + ADD COLUMN `QuestGiverTargetName` TEXT NULL DEFAULT NULL AFTER `QuestGiverTextWindow`, + ADD COLUMN `QuestTurnTextWindow` TEXT NULL DEFAULT NULL AFTER `QuestGiverTargetName`, + ADD COLUMN `QuestTurnTargetName` TEXT NULL DEFAULT NULL AFTER `QuestTurnTextWindow`, + ADD COLUMN `SoundAccept` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '890' AFTER `QuestTurnTargetName`, + ADD COLUMN `SoundTurnIn` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '878' AFTER `SoundAccept`; + +ALTER TABLE `quest_template` DROP COLUMN `Unknown0`; -- Not found on 422 diff --git a/src/server/game/Entities/Creature/GossipDef.cpp b/src/server/game/Entities/Creature/GossipDef.cpp index 5bf7910466c..1b1c86fe00d 100755 --- a/src/server/game/Entities/Creature/GossipDef.cpp +++ b/src/server/game/Entities/Creature/GossipDef.cpp @@ -401,11 +401,17 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, uint64 npcGUID, void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const { + // SMSG_QUEST_QUERY_RESPONSE - Updated to 422 + std::string questTitle = quest->GetTitle(); std::string questDetails = quest->GetDetails(); std::string questObjectives = quest->GetObjectives(); std::string questEndText = quest->GetEndText(); std::string questCompletedText = quest->GetCompletedText(); + std::string questGiverTextWindow = quest->GetQuestGiverTextWindow(); + std::string questGiverTargetName = quest->GetQuestGiverTargetName(); + std::string questTurnTextWindow = quest->GetQuestTurnTextWindow(); + std::string questTurnTargetName = quest->GetQuestTurnTargetName(); std::string questObjectiveText[QUEST_OBJECTIVES_COUNT]; for (uint32 i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) @@ -421,6 +427,10 @@ void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const ObjectMgr::GetLocaleString(localeData->Objectives, locale, questObjectives); ObjectMgr::GetLocaleString(localeData->EndText, locale, questEndText); ObjectMgr::GetLocaleString(localeData->CompletedText, locale, questCompletedText); + ObjectMgr::GetLocaleString(localeData->QuestGiverTextWindow, locale, questGiverTextWindow); + ObjectMgr::GetLocaleString(localeData->QuestGiverTargetName, locale, questGiverTargetName); + ObjectMgr::GetLocaleString(localeData->QuestTurnTextWindow, locale, questTurnTextWindow); + ObjectMgr::GetLocaleString(localeData->QuestTurnTargetName, locale, questTurnTargetName); for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) ObjectMgr::GetLocaleString(localeData->ObjectiveText[i], locale, questObjectiveText[i]); @@ -461,11 +471,16 @@ void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const data << float(0); // new reward honor (multipled by ~62 at client side) data << uint32(quest->GetSrcItemId()); // source item id data << uint32(quest->GetFlags() & 0xFFFF); // quest flags + data << uint32(quest->GetMinimapTargetMark()); // minimap target mark (skull, etc. missing enum) data << uint32(quest->GetCharTitleId()); // CharTitleId, new 2.4.0, player gets this title (id from CharTitles) data << uint32(quest->GetPlayersSlain()); // players slain data << uint32(quest->GetBonusTalents()); // bonus talents data << uint32(quest->GetRewArenaPoints()); // bonus arena points - data << uint32(0); // review rep show mask + data << uint32(quest->GetRewardSkillId()); // reward skill id + data << uint32(quest->GetRewardSkillPoints()); // reward skill points + data << uint32(quest->GetRewardReputationMask()); // rep mask (unsure on what it does) + data << uint32(quest->GetQuestGiverPortrait()); // quest giver entry ? + data << uint32(quest->GetQuestTurnInPortrait()); // quest turnin entry ? if (quest->HasFlag(QUEST_FLAGS_HIDDEN_REWARDS)) { @@ -494,7 +509,7 @@ void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const for (uint32 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) // columnid+1 QuestFactionReward.dbc? data << int32(quest->RewardFactionValueId[i]); - for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) // unk (0) + for (uint32 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) // unknown usage data << int32(quest->RewardFactionValueIdOverride[i]); data << quest->GetPointMapId(); @@ -506,7 +521,7 @@ void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const data << questObjectives; data << questDetails; data << questEndText; - data << questCompletedText; // display in quest objectives window once all objectives are completed + data << questCompletedText; for (uint32 i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) { @@ -516,8 +531,8 @@ void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const data << uint32(quest->RequiredNpcOrGo[i]); data << uint32(quest->RequiredNpcOrGoCount[i]); - data << uint32(quest->RequiredSourceItemid[i]); - data << uint32(0); // req source count? + data << uint32(quest->RequiredSourceItemId[i]); + data << uint32(quest->RequiredSourceItemCount[i]); } for (uint32 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) @@ -526,9 +541,30 @@ void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const data << uint32(quest->RequiredItemCount[i]); } + data << uint32(quest->GetRequiredSpell()); // Is it required to be cast, learned or what? + for (uint32 i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) data << questObjectiveText[i]; + for (uint32 i = 0; i < QUEST_REWARD_CURRENCY_COUNT; ++i) + { + data << uint32(quest->RewardCurrencyId[i]); + data << uint32(quest->RewardCurrencyCount[i]); + } + + for (uint32 i = 0; i < QUEST_REQUIRED_CURRENCY_COUNT; ++i) + { + data << uint32(quest->RequiredCurrencyId[i]); + data << uint32(quest->RequiredCurrencyCount[i]); + } + + data << questGiverTextWindow; + data << questGiverTargetName; + data << questTurnTextWindow; + data << questTurnTargetName; + data << uint32(quest->GetSoundAccept()); + data << uint32(quest->GetSoundTurnIn()); + _session->SendPacket(&data); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUEST_QUERY_RESPONSE questid=%u", quest->GetQuestId()); } diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 524a5943c7f..5565aacc0e1 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -14834,10 +14834,10 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver, for (uint8 i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i) { - if (quest->RequiredSourceItemid[i]) + if (quest->RequiredSourceItemId[i]) { - uint32 count = quest->RequiredSourceItemId[i]; - DestroyItemCount(quest->RequiredSourceItemid[i], count ? count : 9999, true); + uint32 count = quest->RequiredSourceItemCount[i]; + DestroyItemCount(quest->RequiredSourceItemId[i], count ? count : 9999, true); } } @@ -15031,9 +15031,9 @@ void Player::FailQuest(uint32 questId) // Destroy items recieved on starting the quest. DestroyItemCount(quest->RequiredItemId[i], quest->RequiredItemCount[i], true, true); for (uint8 i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i) - if (quest->RequiredSourceItemid[i] > 0 && quest->RequiredSourceItemId[i] > 0) + if (quest->RequiredSourceItemId[i] > 0 && quest->RequiredSourceItemCount[i] > 0) // Destroy items recieved during the quest. - DestroyItemCount(quest->RequiredSourceItemid[i], quest->RequiredSourceItemId[i], true, true); + DestroyItemCount(quest->RequiredSourceItemId[i], quest->RequiredSourceItemCount[i], true, true); } } @@ -16084,7 +16084,7 @@ bool Player::HasQuestForItem(uint32 itemid) const for (uint8 j = 0; j < QUEST_SOURCE_ITEM_IDS_COUNT; ++j) { // examined item is a source item - if (qinfo->RequiredSourceItemid[j] == itemid) + if (qinfo->RequiredSourceItemId[j] == itemid) { ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(itemid); @@ -16093,9 +16093,9 @@ bool Player::HasQuestForItem(uint32 itemid) const return true; // allows custom amount drop when not 0 - if (qinfo->RequiredSourceItemId[j]) + if (qinfo->RequiredSourceItemCount[j]) { - if (GetItemCount(itemid, true) < qinfo->RequiredSourceItemId[j]) + if (GetItemCount(itemid, true) < qinfo->RequiredSourceItemCount[j]) return true; } else if (GetItemCount(itemid, true) < pProto->GetMaxStackSize()) return true; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 2057180b81b..8a47e91b32b 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -3593,33 +3593,37 @@ void ObjectMgr::LoadQuests() "RequiredFactionId1, RequiredFactionId2, RequiredFactionValue1, RequiredFactionValue2, RequiredMinRepFaction, RequiredMaxRepFaction, RequiredMinRepValue, RequiredMaxRepValue, " // 21 22 23 24 25 26 27 28 29 30 31 "PrevQuestId, NextQuestId, ExclusiveGroup, NextQuestIdChain, RewardXPId, RewardOrRequiredMoney, RewardMoneyMaxLevel, RewardSpell, RewardSpellCast, RewardHonor, RewardHonorMultiplier, " - // 32 33 34 35 36 37 38 39 40 41 42 - "RewardMailTemplateId, RewardMailDelay, SourceItemId, SourceItemCount, SourceSpellId, Flags, SpecialFlags, RewardTitleId, RequiredPlayerKills, RewardTalents, RewardArenaPoints, " - // 43 44 45 46 47 48 49 50 - "RewardItemId1, RewardItemId2, RewardItemId3, RewardItemId4, RewardItemCount1, RewardItemCount2, RewardItemCount3, RewardItemCount4, " - // 51 52 53 54 55 56 57 58 59 60 61 62 + // 32 33 34 35 36 37 38 39 40 41 42 43 + "RewardMailTemplateId, RewardMailDelay, SourceItemId, SourceItemCount, SourceSpellId, Flags, SpecialFlags, MinimapTargetMark, RewardTitleId, RequiredPlayerKills, RewardTalents, RewardArenaPoints, " + // 44 45 46 47 48 49 50 51 52 53 54 55 56 + "RewardSkillId, RewardSkillPoints, RewardReputationMask, QuestGiverPortrait, QuestTurnInPortrait, RewardItemId1, RewardItemId2, RewardItemId3, RewardItemId4, RewardItemCount1, RewardItemCount2, RewardItemCount3, RewardItemCount4, " + // 57 58 59 60 61 62 63 64 65 66 67 68 "RewardChoiceItemId1, RewardChoiceItemId2, RewardChoiceItemId3, RewardChoiceItemId4, RewardChoiceItemId5, RewardChoiceItemId6, RewardChoiceItemCount1, RewardChoiceItemCount2, RewardChoiceItemCount3, RewardChoiceItemCount4, RewardChoiceItemCount5, RewardChoiceItemCount6, " - // 63 64 65 66 67 68 69 70 71 72 + // 69 70 71 72 73 74 75 76 77 78 "RewardFactionId1, RewardFactionId2, RewardFactionId3, RewardFactionId4, RewardFactionId5, RewardFactionValueId1, RewardFactionValueId2, RewardFactionValueId3, RewardFactionValueId4, RewardFactionValueId5, " - // 73 74 75 76 77 + // 79 80 81 82 83 "RewardFactionValueIdOverride1, RewardFactionValueIdOverride2, RewardFactionValueIdOverride3, RewardFactionValueIdOverride4, RewardFactionValueIdOverride5, " - // 78 79 80 81 - "PointMapId, PointX, PointY, PointOption, " - // 82 83 84 85 86 87 88 - "Title, Objectives, Details, EndText, OfferRewardText, RequestItemsText, CompletedText, " - // 89 90 91 92 93 94 95 96 + // 84 85 86 87 88 89 90 91 92 93 94 + "PointMapId, PointX, PointY, PointOption, Title, Objectives, Details, EndText, CompletedText, OfferRewardText, RequestItemsText, " + // 95 96 97 98 99 100 101 102 "RequiredNpcOrGo1, RequiredNpcOrGo2, RequiredNpcOrGo3, RequiredNpcOrGo4, RequiredNpcOrGoCount1, RequiredNpcOrGoCount2, RequiredNpcOrGoCount3, RequiredNpcOrGoCount4, " - // 97 98 99 100 101 102 103 104 + // 103 104 105 106 107 108 109 110 "RequiredSourceItemId1, RequiredSourceItemId2, RequiredSourceItemId3, RequiredSourceItemId4, RequiredSourceItemCount1, RequiredSourceItemCount2, RequiredSourceItemCount3, RequiredSourceItemCount4, " - // 105 106 107 108 109 110 111 112 113 114 115 116 + // 111 112 113 114 115 116 117 118 119 120 121 122 "RequiredItemId1, RequiredItemId2, RequiredItemId3, RequiredItemId4, RequiredItemId5, RequiredItemId6, RequiredItemCount1, RequiredItemCount2, RequiredItemCount3, RequiredItemCount4, RequiredItemCount5, RequiredItemCount6, " - // 117 118 119 120 121 122 123 124 125 - "RequiredSpellCast1, RequiredSpellCast2, RequiredSpellCast3, RequiredSpellCast4, Unknown0, ObjectiveText1, ObjectiveText2, ObjectiveText3, ObjectiveText4, " - // 126 127 128 129 130 131 132 133 134 135 + // 123 124 125 126 127 128 129 130 131 + "RequiredSpell, RequiredSpellCast1, RequiredSpellCast2, RequiredSpellCast3, RequiredSpellCast4, ObjectiveText1, ObjectiveText2, ObjectiveText3, ObjectiveText4, " + // 132 133 134 135 136 137 138 139 + "RewardCurrencyId1, RewardCurrencyId2, RewardCurrencyId3, RewardCurrencyId4, RewardCurrencyCount1, RewardCurrencyCount2, RewardCurrencyCount3, RewardCurrencyCount4, " + // 140 141 142 143 144 145 146 147 + "RequiredCurrencyId1, RequiredCurrencyId2, RequiredCurrencyId3, RequiredCurrencyId4, RequiredCurrencyCount1, RequiredCurrencyCount2, RequiredCurrencyCount3, RequiredCurrencyCount4, " + // 148 149 150 151 152 153 + "QuestGiverTextWindow, QuestGiverTargetName, QuestTurnTextWindow, QuestTurnTargetName, SoundAccept, SoundTurnIn, " + // 154 155 156 157 158 159 160 161 162 163 "DetailsEmote1, DetailsEmote2, DetailsEmote3, DetailsEmote4, DetailsEmoteDelay1, DetailsEmoteDelay2, DetailsEmoteDelay3, DetailsEmoteDelay4, EmoteOnIncomplete, EmoteOnComplete, " - // 136 137 138 139 140 141 142 143 + // 164 165 166 167 168 169 170 171 "OfferRewardEmote1, OfferRewardEmote2, OfferRewardEmote3, OfferRewardEmote4, OfferRewardEmoteDelay1, OfferRewardEmoteDelay2, OfferRewardEmoteDelay3, OfferRewardEmoteDelay4, " - // 144 145 146 + // 172 173 174 "StartScript, CompleteScript, WDBVerified" " FROM quest_template"); if (!result) @@ -3912,7 +3916,7 @@ void ObjectMgr::LoadQuests() qinfo->RequiredItemCount[j] = 0; // prevent incorrect work of quest } } - else if (qinfo->RequiredItemCount[j]>0) + else if (qinfo->RequiredItemCount[j] > 0) { sLog->outErrorDb("Quest %u has `RequiredItemId%d` = 0 but `RequiredItemCount%d` = %u, quest can't be done.", qinfo->GetQuestId(), j+1, j+1, qinfo->RequiredItemCount[j]); @@ -3922,22 +3926,22 @@ void ObjectMgr::LoadQuests() for (uint8 j = 0; j < QUEST_SOURCE_ITEM_IDS_COUNT; ++j) { - uint32 id = qinfo->RequiredSourceItemid[j]; + uint32 id = qinfo->RequiredSourceItemId[j]; if (id) { if (!sObjectMgr->GetItemTemplate(id)) { - sLog->outErrorDb("Quest %u has `RequiredSourceItemid%d` = %u but item with entry %u does not exist, quest can't be done.", + sLog->outErrorDb("Quest %u has `RequiredSourceItemId%d` = %u but item with entry %u does not exist, quest can't be done.", qinfo->GetQuestId(), j+1, id, id); // no changes, quest can't be done for this requirement } } else { - if (qinfo->RequiredSourceItemId[j]>0) + if (qinfo->RequiredSourceItemCount[j] > 0) { - sLog->outErrorDb("Quest %u has `RequiredSourceItemid%d` = 0 but `RequiredSourceItemId%d` = %u.", - qinfo->GetQuestId(), j+1, j+1, qinfo->RequiredSourceItemId[j]); + sLog->outErrorDb("Quest %u has `RequiredSourceItemId%d` = 0 but `RequiredSourceItemCount%d` = %u.", + qinfo->GetQuestId(), j+1, j+1, qinfo->RequiredSourceItemCount[j]); // no changes, quest ignore this data } } @@ -4190,6 +4194,161 @@ void ObjectMgr::LoadQuests() qNextItr->second->prevChainQuests.push_back(qinfo->GetQuestId()); } + for (uint8 j = 0; j < QUEST_REWARD_CURRENCY_COUNT; ++j) + { + uint32 currency = qinfo->RewardCurrencyId[j]; + if (currency) + { + if (qinfo->RewardCurrencyCount[j] == 0) + { + sLog->outErrorDb("Quest %u has `RewardCurrencyId%d` = %u but `RewardCurrencyCount%d` = 0, quest can't be done.", + qinfo->GetQuestId(), j+1, currency, j+1); + // no changes, quest can't be done for this requirement + } + + /* TODO: Re-enable once currency dbc getters are implemented + if (!sObjectMgr->GetCurrency(currency)) + { + sLog->outErrorDb("Quest %u has `RewardCurrencyId%d` = %u but currency with entry %u does not exist, quest can't be done.", + qinfo->GetQuestId(), j+1, currency, currency); + qinfo->RewardCurrencyCount[j] = 0; // prevent incorrect work of quest + }*/ + } + else if (qinfo->RewardCurrencyCount[j] > 0) + { + sLog->outErrorDb("Quest %u has `RewardCurrencyId%d` = 0 but `RewardCurrencyCount%d` = %u, quest can't be done.", + qinfo->GetQuestId(), j+1, j+1, qinfo->RewardCurrencyCount[j]); + qinfo->RewardCurrencyCount[j] = 0; // prevent incorrect work of quest + } + } + + for (uint8 j = 0; j < QUEST_REQUIRED_CURRENCY_COUNT; ++j) + { + uint32 currency = qinfo->RequiredCurrencyId[j]; + if (currency) + { + if (qinfo->RequiredCurrencyCount[j] == 0) + { + sLog->outErrorDb("Quest %u has `RequiredCurrencyId%d` = %u but `RequiredCurrencyCount%d` = 0, quest can't be done.", + qinfo->GetQuestId(), j+1, currency, j+1); + // no changes, quest can't be done for this requirement + } + + /* TODO: Re-enable once currency dbc getters are implemented + if (!sObjectMgr->GetCurrency(currency)) + { + sLog->outErrorDb("Quest %u has `RequiredCurrencyId%d` = %u but currency with entry %u does not exist, quest can't be done.", + qinfo->GetQuestId(), j+1, currency, currency); + qinfo->RequiredCurrencyCount[j] = 0; // prevent incorrect work of quest + }*/ + } + else if (qinfo->RequiredCurrencyCount[j] > 0) + { + sLog->outErrorDb("Quest %u has `RequiredCurrencyId%d` = 0 but `RequiredCurrencyCount%d` = %u, quest can't be done.", + qinfo->GetQuestId(), j+1, j+1, qinfo->RequiredCurrencyCount[j]); + qinfo->RequiredCurrencyCount[j] = 0; // prevent incorrect work of quest + } + } + + if (qinfo->SoundAccept) + { + if (!sSoundEntriesStore.LookupEntry(qinfo->SoundAccept)) + { + sLog->outErrorDb("Quest %u has `SoundAccept` = %u but sound %u does not exist, set to 0.", + qinfo->GetQuestId(), qinfo->SoundAccept, qinfo->SoundAccept); + qinfo->SoundAccept = 0; // no sound will be played + } + } + + if (qinfo->SoundTurnIn) + { + if (!sSoundEntriesStore.LookupEntry(qinfo->SoundTurnIn)) + { + sLog->outErrorDb("Quest %u has `SoundTurnIn` = %u but sound %u does not exist, set to 0.", + qinfo->GetQuestId(), qinfo->SoundTurnIn, qinfo->SoundTurnIn); + qinfo->SoundTurnIn = 0; // no sound will be played + } + } + + if (qinfo->RequiredSpell > 0) + { + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(qinfo->RequiredSpell); + + if (!spellInfo) + { + sLog->outErrorDb("Quest %u has `RequiredSpell` = %u but spell %u does not exist, quest will not require a spell.", + qinfo->GetQuestId(), qinfo->RequiredSpell, qinfo->RequiredSpell); + qinfo->RequiredSpell = 0; // no spell will be required + } + + else if (!SpellMgr::IsSpellValid(spellInfo)) + { + sLog->outErrorDb("Quest %u has `RequiredSpell` = %u but spell %u is broken, quest will not require a spell.", + qinfo->GetQuestId(), qinfo->RequiredSpell, qinfo->RequiredSpell); + qinfo->RequiredSpell = 0; // no spell will be required + } + + /* Can we require talents? + else if (GetTalentSpellCost(qinfo->RewardSpellCast)) + { + sLog->outErrorDb("Quest %u has `RewardSpell` = %u but spell %u is talent, quest will not have a spell reward.", + qinfo->GetQuestId(), qinfo->RewardSpellCast, qinfo->RewardSpellCast); + qinfo->RewardSpellCast = 0; // no spell will be casted on player + } + }*/ + } + + if (qinfo->RewardSkillId) + { + if (!sSkillLineStore.LookupEntry(qinfo->RewardSkillId)) + { + sLog->outErrorDb("Quest %u has `RewardSkillId` = %u but this skill does not exist", + qinfo->GetQuestId(), qinfo->RewardSkillId); + } + if (!qinfo->RewardSkillPoints) + { + sLog->outErrorDb("Quest %u has `RewardSkillId` = %u but `RewardSkillPoints` is 0", + qinfo->GetQuestId(), qinfo->RewardSkillId); + } + } + + if (qinfo->RewardSkillPoints) + { + if (qinfo->RewardSkillPoints > sWorld->GetConfigMaxSkillValue()) + { + sLog->outErrorDb("Quest %u has `RewardSkillPoints` = %u but max possible skill is %u, quest can't be done.", + qinfo->GetQuestId(), qinfo->RewardSkillPoints, sWorld->GetConfigMaxSkillValue()); + // no changes, quest can't be done for this requirement + } + if (!qinfo->RewardSkillId) + { + sLog->outErrorDb("Quest %u has `RewardSkillPoints` = %u but `RewardSkillId` is 0", + qinfo->GetQuestId(), qinfo->RewardSkillPoints); + } + } + + if (qinfo->QuestGiverPortrait) + { + if (!sObjectMgr->GetCreatureTemplate(qinfo->QuestGiverPortrait)) + { + sLog->outErrorDb("Quest %u has `QuestGiverPortrait` = %u but creature with entry %u does not exist, quest can't be done.", + qinfo->GetQuestId(), qinfo->QuestGiverPortrait, qinfo->QuestGiverPortrait); + qinfo->QuestGiverPortrait = 0; + } + } + + if (qinfo->QuestTurnInPortrait) + { + if (!sObjectMgr->GetCreatureTemplate(qinfo->QuestTurnInPortrait)) + { + sLog->outErrorDb("Quest %u has `QuestTurnInPortrait` = %u but creature with entry %u does not exist, quest can't be done.", + qinfo->GetQuestId(), qinfo->QuestTurnInPortrait, qinfo->QuestTurnInPortrait); + qinfo->QuestTurnInPortrait = 0; + } + } + + + // fill additional data stores if (qinfo->PrevQuestId) { diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index 873b6c29fea..f0c67e3ac4d 100755 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -61,114 +61,150 @@ Quest::Quest(Field* questRecord) SourceSpellid = questRecord[36].GetUInt32(); Flags = questRecord[37].GetUInt32(); uint32 SpecialFlags = questRecord[38].GetUInt16(); - RewardTitleId = questRecord[39].GetUInt32(); - RequiredPlayerKills = questRecord[40].GetUInt32(); - RewardTalents = questRecord[41].GetUInt32(); - RewardArenaPoints = questRecord[42].GetInt32(); + MinimapTargetMark = questRecord[39].GetUInt32(); + RewardTitleId = questRecord[40].GetUInt32(); + RequiredPlayerKills = questRecord[41].GetUInt32(); + RewardTalents = questRecord[42].GetUInt32(); + RewardArenaPoints = questRecord[43].GetInt32(); + RewardSkillId = questRecord[44].GetUInt32(); + RewardSkillPoints = questRecord[45].GetUInt32(); + RewardReputationMask = questRecord[46].GetUInt32(); + QuestGiverPortrait = questRecord[47].GetUInt32(); + QuestTurnInPortrait = questRecord[48].GetUInt32(); for (int i = 0; i < QUEST_REWARDS_COUNT; ++i) - RewardItemId[i] = questRecord[43+i].GetUInt32(); + RewardItemId[i] = questRecord[49+i].GetUInt32(); for (int i = 0; i < QUEST_REWARDS_COUNT; ++i) - RewardItemIdCount[i] = questRecord[47+i].GetUInt32(); + RewardItemIdCount[i] = questRecord[53+i].GetUInt32(); for (int i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) - RewardChoiceItemId[i] = questRecord[51+i].GetUInt32(); + RewardChoiceItemId[i] = questRecord[57+i].GetUInt32(); for (int i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) - RewardChoiceItemCount[i] = questRecord[57+i].GetUInt32(); + RewardChoiceItemCount[i] = questRecord[63+i].GetUInt32(); for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) - RewardFactionId[i] = questRecord[63+i].GetUInt32(); + RewardFactionId[i] = questRecord[69+i].GetUInt32(); for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) - RewardFactionValueId[i] = questRecord[68+i].GetInt32(); + RewardFactionValueId[i] = questRecord[74+i].GetInt32(); for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) - RewardFactionValueIdOverride[i] = questRecord[73+i].GetInt32(); + RewardFactionValueIdOverride[i] = questRecord[79+i].GetInt32(); - PointMapId = questRecord[78].GetUInt32(); - PointX = questRecord[79].GetFloat(); - PointY = questRecord[80].GetFloat(); - PointOption = questRecord[81].GetUInt32(); - Title = questRecord[82].GetString(); - Objectives = questRecord[83].GetString(); - Details = questRecord[84].GetString(); - EndText = questRecord[85].GetString(); - OfferRewardText = questRecord[86].GetString(); - RequestItemsText = questRecord[87].GetString(); - CompletedText = questRecord[88].GetString(); + PointMapId = questRecord[84].GetUInt32(); + PointX = questRecord[85].GetFloat(); + PointY = questRecord[86].GetFloat(); + PointOption = questRecord[87].GetUInt32(); + Title = questRecord[88].GetString(); + Objectives = questRecord[89].GetString(); + Details = questRecord[90].GetString(); + EndText = questRecord[91].GetString(); + CompletedText = questRecord[92].GetString(); + OfferRewardText = questRecord[93].GetString(); + RequestItemsText = questRecord[94].GetString(); for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) - RequiredNpcOrGo[i] = questRecord[89+i].GetInt32(); + RequiredNpcOrGo[i] = questRecord[95+i].GetInt32(); for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) - RequiredNpcOrGoCount[i] = questRecord[93+i].GetUInt32(); + RequiredNpcOrGoCount[i] = questRecord[99+i].GetUInt32(); for (int i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i) - RequiredSourceItemid[i] = questRecord[97+i].GetUInt32(); + RequiredSourceItemId[i] = questRecord[103+i].GetUInt32(); for (int i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i) - RequiredSourceItemId[i] = questRecord[101+i].GetUInt32(); + RequiredSourceItemCount[i] = questRecord[107+i].GetUInt32(); for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) - RequiredItemId[i] = questRecord[105+i].GetUInt32(); + RequiredItemId[i] = questRecord[111+i].GetUInt32(); for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) - RequiredItemCount[i] = questRecord[111+i].GetUInt32(); + RequiredItemCount[i] = questRecord[117+i].GetUInt32(); - for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) - RequiredSpellCast[i] = questRecord[117+i].GetUInt32(); + RequiredSpell = questRecord[123].GetUInt32(); - // int8 Unknown0 = questRecord[121].GetUInt32(); + for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) // To be removed + RequiredSpellCast[i] = questRecord[124+i].GetUInt32(); for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) - ObjectiveText[i] = questRecord[122+i].GetString(); + ObjectiveText[i] = questRecord[128+i].GetString(); + + for (int i = 0; i < QUEST_REWARD_CURRENCY_COUNT; ++i) + RewardCurrencyId[i] = questRecord[132].GetUInt32(); + + for (int i = 0; i < QUEST_REWARD_CURRENCY_COUNT; ++i) + RewardCurrencyCount[i] = questRecord[136].GetUInt32(); + + for (int i = 0; i < QUEST_REQUIRED_CURRENCY_COUNT; ++i) + RequiredCurrencyId[i] = questRecord[140].GetUInt32(); + + for (int i = 0; i < QUEST_REQUIRED_CURRENCY_COUNT; ++i) + RequiredCurrencyCount[i] = questRecord[144].GetUInt32(); + + QuestGiverTextWindow = questRecord[148].GetString(); + QuestGiverTargetName = questRecord[149].GetString(); + QuestTurnTextWindow = questRecord[150].GetString(); + QuestTurnTargetName = questRecord[151].GetString(); + SoundAccept = questRecord[152].GetUInt32(); + SoundTurnIn = questRecord[153].GetUInt32(); for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) - DetailsEmote[i] = questRecord[126+i].GetUInt32(); + DetailsEmote[i] = questRecord[154+i].GetUInt32(); for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) - DetailsEmoteDelay[i] = questRecord[130+i].GetUInt32(); + DetailsEmoteDelay[i] = questRecord[158+i].GetUInt32(); - EmoteOnIncomplete = questRecord[134].GetUInt32(); - EmoteOnComplete = questRecord[135].GetUInt32(); + EmoteOnIncomplete = questRecord[162].GetUInt32(); + EmoteOnComplete = questRecord[163].GetUInt32(); for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) - OfferRewardEmote[i] = questRecord[136+i].GetInt32(); + OfferRewardEmote[i] = questRecord[164+i].GetInt32(); for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) - OfferRewardEmoteDelay[i] = questRecord[140+i].GetInt32(); + OfferRewardEmoteDelay[i] = questRecord[168+i].GetInt32(); - StartScript = questRecord[144].GetUInt32(); - CompleteScript = questRecord[145].GetUInt32(); + StartScript = questRecord[172].GetUInt32(); + CompleteScript = questRecord[173].GetUInt32(); - // int32 WDBVerified = questRecord[146].GetInt32(); + // int32 WDBVerified = questRecord[174].GetInt32(); Flags |= SpecialFlags << 20; if (Flags & QUEST_TRINITY_FLAGS_AUTO_ACCEPT) Flags |= QUEST_FLAGS_AUTO_ACCEPT; - m_reqitemscount = 0; - m_reqCreatureOrGOcount = 0; - m_rewitemscount = 0; - m_rewchoiceitemscount = 0; + m_reqItemsCount = 0; + m_reqNpcOrGoCount = 0; + m_rewItemsCount = 0; + m_rewChoiceItemsCount = 0; + m_rewCurrencyCount = 0; + m_reqCurrencyCount = 0; for (int i=0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) if (RequiredItemId[i]) - ++m_reqitemscount; + ++m_reqItemsCount; for (int i=0; i < QUEST_OBJECTIVES_COUNT; ++i) if (RequiredNpcOrGo[i]) - ++m_reqCreatureOrGOcount; + ++m_reqNpcOrGoCount; for (int i=0; i < QUEST_REWARDS_COUNT; ++i) if (RewardItemId[i]) - ++m_rewitemscount; + ++m_rewItemsCount; for (int i=0; i < QUEST_REWARD_CHOICES_COUNT; ++i) if (RewardChoiceItemId[i]) - ++m_rewchoiceitemscount; + ++m_rewChoiceItemsCount; + + for (int i=0; i < QUEST_REWARD_CURRENCY_COUNT; ++i) + if (RewardCurrencyId[i]) + ++m_rewCurrencyCount; + + for (int i=0; i < QUEST_REQUIRED_CURRENCY_COUNT; ++i) + if (RequiredCurrencyId[i]) + ++m_reqCurrencyCount; + } uint32 Quest::XPValue(Player* player) const diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h index fc9a432a11b..4601154feab 100755 --- a/src/server/game/Quests/QuestDef.h +++ b/src/server/game/Quests/QuestDef.h @@ -41,6 +41,8 @@ class ObjectMgr; #define QUEST_REPUTATIONS_COUNT 5 #define QUEST_EMOTE_COUNT 4 #define QUEST_PVP_KILL_SLOT 0 +#define QUEST_REWARD_CURRENCY_COUNT 4 +#define QUEST_REQUIRED_CURRENCY_COUNT 4 enum QuestFailedReasons { @@ -173,6 +175,11 @@ struct QuestLocale StringVector EndText; StringVector CompletedText; std::vector< StringVector > ObjectiveText; + // new on 4.x + StringVector QuestGiverTextWindow; + StringVector QuestGiverTargetName; + StringVector QuestTurnTextWindow; + StringVector QuestTurnTargetName; }; // This Quest class provides a convenient way to access a few pretotaled (cached) quest details, @@ -229,11 +236,14 @@ class Quest std::string GetRequestItemsText() const { return RequestItemsText; } std::string GetEndText() const { return EndText; } std::string GetCompletedText() const { return CompletedText; } + std::string GetQuestGiverTextWindow() const { return QuestGiverTextWindow; } + std::string GetQuestGiverTargetName() const { return QuestGiverTargetName; } + std::string GetQuestTurnTextWindow() const { return QuestTurnTextWindow; } + std::string GetQuestTurnTargetName() const { return QuestTurnTargetName; } int32 GetRewOrReqMoney() const; uint32 GetRewHonorAddition() const { return RewardHonor; } float GetRewHonorMultiplier() const { return RewardHonorMultiplier; } - uint32 GetRewMoneyMaxLevel() const { return RewardMoneyMaxLevel; } - // use in XP calculation at client + uint32 GetRewMoneyMaxLevel() const { return RewardMoneyMaxLevel; } // use in XP calculation at client uint32 GetRewSpell() const { return RewardSpell; } int32 GetRewSpellCast() const { return RewardSpellCast; } uint32 GetRewMailTemplateId() const { return RewardMailTemplateId; } @@ -242,6 +252,9 @@ class Quest float GetPointX() const { return PointX; } float GetPointY() const { return PointY; } uint32 GetPointOpt() const { return PointOption; } + uint32 GetRequiredSpell() const { return RequiredSpell; } + uint32 GetSoundAccept() const { return SoundAccept; } + uint32 GetSoundTurnIn() const { return SoundTurnIn; } uint32 GetIncompleteEmote() const { return EmoteOnIncomplete; } uint32 GetCompleteEmote() const { return EmoteOnComplete; } uint32 GetQuestStartScript() const { return StartScript; } @@ -249,6 +262,12 @@ class Quest bool IsRepeatable() const { return Flags & QUEST_TRINITY_FLAGS_REPEATABLE; } bool IsAutoComplete() const; uint32 GetFlags() const { return Flags; } + uint32 GetMinimapTargetMark() const { return MinimapTargetMark; } + uint32 GetRewardSkillId() const { return RewardSkillId; } + uint32 GetRewardSkillPoints() const { return RewardSkillPoints; } + uint32 GetRewardReputationMask() const { return RewardReputationMask; } + uint32 GetQuestGiverPortrait() const { return QuestGiverPortrait; } + uint32 GetQuestTurnInPortrait() const { return QuestTurnInPortrait; } bool IsDaily() const { return Flags & QUEST_FLAGS_DAILY; } bool IsWeekly() const { return Flags & QUEST_FLAGS_WEEKLY; } bool IsDailyOrWeekly() const { return Flags & (QUEST_FLAGS_DAILY | QUEST_FLAGS_WEEKLY); } @@ -262,8 +281,8 @@ class Quest std::string ObjectiveText[QUEST_OBJECTIVES_COUNT]; uint32 RequiredItemId[QUEST_ITEM_OBJECTIVES_COUNT]; uint32 RequiredItemCount[QUEST_ITEM_OBJECTIVES_COUNT]; - uint32 RequiredSourceItemid[QUEST_SOURCE_ITEM_IDS_COUNT]; uint32 RequiredSourceItemId[QUEST_SOURCE_ITEM_IDS_COUNT]; + uint32 RequiredSourceItemCount[QUEST_SOURCE_ITEM_IDS_COUNT]; int32 RequiredNpcOrGo[QUEST_OBJECTIVES_COUNT]; // >0 Creature <0 Gameobject uint32 RequiredNpcOrGoCount[QUEST_OBJECTIVES_COUNT]; uint32 RequiredSpellCast[QUEST_OBJECTIVES_COUNT]; @@ -278,11 +297,16 @@ class Quest uint32 DetailsEmoteDelay[QUEST_EMOTE_COUNT]; uint32 OfferRewardEmote[QUEST_EMOTE_COUNT]; uint32 OfferRewardEmoteDelay[QUEST_EMOTE_COUNT]; + // 4.x + uint32 RewardCurrencyId[QUEST_REWARD_CURRENCY_COUNT]; + uint32 RewardCurrencyCount[QUEST_REWARD_CURRENCY_COUNT]; + uint32 RequiredCurrencyId[QUEST_REQUIRED_CURRENCY_COUNT]; + uint32 RequiredCurrencyCount[QUEST_REQUIRED_CURRENCY_COUNT]; - uint32 GetReqItemsCount() const { return m_reqitemscount; } - uint32 GetReqCreatureOrGOcount() const { return m_reqCreatureOrGOcount; } - uint32 GetRewChoiceItemsCount() const { return m_rewchoiceitemscount; } - uint32 GetRewItemsCount() const { return m_rewitemscount; } + uint32 GetReqItemsCount() const { return m_reqItemsCount; } + uint32 GetReqCreatureOrGOcount() const { return m_reqNpcOrGoCount; } + uint32 GetRewChoiceItemsCount() const { return m_rewChoiceItemsCount; } + uint32 GetRewItemsCount() const { return m_rewItemsCount; } typedef std::vector PrevQuests; PrevQuests prevQuests; @@ -291,10 +315,12 @@ class Quest // cached data private: - uint32 m_reqitemscount; - uint32 m_reqCreatureOrGOcount; - uint32 m_rewchoiceitemscount; - uint32 m_rewitemscount; + uint32 m_reqItemsCount; + uint32 m_reqNpcOrGoCount; + uint32 m_rewChoiceItemsCount; + uint32 m_rewItemsCount; + uint32 m_rewCurrencyCount; + uint32 m_reqCurrencyCount; // table data protected: @@ -355,6 +381,20 @@ class Quest uint32 EmoteOnComplete; uint32 StartScript; uint32 CompleteScript; + // new in 4.x + uint32 MinimapTargetMark; + uint32 RewardSkillId; + uint32 RewardSkillPoints; + uint32 RewardReputationMask; + uint32 QuestGiverPortrait; + uint32 QuestTurnInPortrait; + uint32 RequiredSpell; + std::string QuestGiverTextWindow; + std::string QuestGiverTargetName; + std::string QuestTurnTextWindow; + std::string QuestTurnTargetName; + uint32 SoundAccept; + uint32 SoundTurnIn; }; struct QuestStatusData -- cgit v1.2.3 From bbf9703b73416917c9c6fae063354658a483926f Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 26 Nov 2011 16:36:01 +0100 Subject: Core/Items: Added more checks determining item disenchanting loot DB/Loot: Added all disenchant templates --- .../4.x/2011_11_26_02_world_quest_template.sql | 31 +++ ...011_11_26_03_world_disenchant_loot_template.sql | 225 +++++++++++++++++++++ .../4.x/2011_12_26_02_world_quest_template.sql | 31 --- src/server/game/DataStores/DB2Stores.cpp | 6 +- src/server/game/DataStores/DB2Stores.h | 3 +- src/server/game/DataStores/DB2Structure.h | 22 +- src/server/game/DataStores/DB2fmt.h | 1 + src/server/game/Globals/ObjectMgr.cpp | 41 ++-- 8 files changed, 305 insertions(+), 55 deletions(-) create mode 100644 sql/updates/world/4.x/2011_11_26_02_world_quest_template.sql create mode 100644 sql/updates/world/4.x/2011_11_26_03_world_disenchant_loot_template.sql delete mode 100644 sql/updates/world/4.x/2011_12_26_02_world_quest_template.sql (limited to 'src') diff --git a/sql/updates/world/4.x/2011_11_26_02_world_quest_template.sql b/sql/updates/world/4.x/2011_11_26_02_world_quest_template.sql new file mode 100644 index 00000000000..b43abd6f85d --- /dev/null +++ b/sql/updates/world/4.x/2011_11_26_02_world_quest_template.sql @@ -0,0 +1,31 @@ +ALTER TABLE `quest_template` ADD COLUMN `MinimapTargetMark` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `SpecialFlags`, + ADD COLUMN `RewardSkillId` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardArenaPoints`, + ADD COLUMN `RewardSkillPoints` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardSkillId`, + ADD COLUMN `RewardReputationMask` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardSkillPoints`, + ADD COLUMN `QuestGiverPortrait` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardReputationMask`, + ADD COLUMN `QuestTurnInPortrait` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0' AFTER `QuestGiverPortrait`, + ADD COLUMN `RequiredSpell` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0' AFTER `RequiredItemCount6`, + ADD COLUMN `RewardCurrencyId1` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `ObjectiveText4`, + ADD COLUMN `RewardCurrencyId2` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardCurrencyId1`, + ADD COLUMN `RewardCurrencyId3` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardCurrencyId2`, + ADD COLUMN `RewardCurrencyId4` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardCurrencyId3`, + ADD COLUMN `RewardCurrencyCount1` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardCurrencyId4`, + ADD COLUMN `RewardCurrencyCount2` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardCurrencyCount1`, + ADD COLUMN `RewardCurrencyCount3` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardCurrencyCount2`, + ADD COLUMN `RewardCurrencyCount4` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardCurrencyCount3`, + ADD COLUMN `RequiredCurrencyId1` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardCurrencyCount4`, + ADD COLUMN `RequiredCurrencyId2` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `RequiredCurrencyId1`, + ADD COLUMN `RequiredCurrencyId3` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `RequiredCurrencyId2`, + ADD COLUMN `RequiredCurrencyId4` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `RequiredCurrencyId3`, + ADD COLUMN `RequiredCurrencyCount1` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `RequiredCurrencyId4`, + ADD COLUMN `RequiredCurrencyCount2` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `RequiredCurrencyCount1`, + ADD COLUMN `RequiredCurrencyCount3` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `RequiredCurrencyCount2`, + ADD COLUMN `RequiredCurrencyCount4` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `RequiredCurrencyCount3`, + ADD COLUMN `QuestGiverTextWindow` TEXT NULL DEFAULT NULL AFTER `RequiredCurrencyCount4`, + ADD COLUMN `QuestGiverTargetName` TEXT NULL DEFAULT NULL AFTER `QuestGiverTextWindow`, + ADD COLUMN `QuestTurnTextWindow` TEXT NULL DEFAULT NULL AFTER `QuestGiverTargetName`, + ADD COLUMN `QuestTurnTargetName` TEXT NULL DEFAULT NULL AFTER `QuestTurnTextWindow`, + ADD COLUMN `SoundAccept` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '890' AFTER `QuestTurnTargetName`, + ADD COLUMN `SoundTurnIn` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '878' AFTER `SoundAccept`; + +ALTER TABLE `quest_template` DROP COLUMN `Unknown0`; -- Not found on 422 diff --git a/sql/updates/world/4.x/2011_11_26_03_world_disenchant_loot_template.sql b/sql/updates/world/4.x/2011_11_26_03_world_disenchant_loot_template.sql new file mode 100644 index 00000000000..48f5d712533 --- /dev/null +++ b/sql/updates/world/4.x/2011_11_26_03_world_disenchant_loot_template.sql @@ -0,0 +1,225 @@ +SET @LESSER_MAGIC = 10938; +SET @GREATER_MAGIC = 10939; +SET @STRANGE_DUST = 10940; +SET @SMALL_GLIMMERING = 10978; +SET @LESSER_ASTRAL = 10998; +SET @GREATER_ASTRAL = 11082; +SET @SOUL_DUST = 11083; +SET @LARGE_GLIMMERING = 11084; +SET @LESSER_MYSTIC = 11134; +SET @GREATER_MYSTIC = 11135; +SET @VISION_DUST = 11137; +SET @SMALL_GLOWING = 11138; +SET @LARGE_GLOWING = 11139; +SET @LESSER_NETHER = 11174; +SET @GREATER_NETHER = 11175; +SET @DREAM_DUST = 11176; +SET @SMALL_RADIANT = 11177; +SET @LARGE_RADIANT = 11178; +SET @SMALL_BRILLIANT = 14343; +SET @LARGE_BRILLIANT = 14344; +SET @LESSER_ETERNAL = 16202; +SET @GREATER_ETERNAL = 16203; +SET @ILLUSION_DUST = 16204; +SET @NEXUS_CRYSTAL = 20725; +SET @ARCANE_DUST = 22445; +SET @GREATER_PLANAR = 22446; +SET @LESSER_PLANAR = 22447; +SET @SMALL_PRISMATIC = 22448; +SET @LARGE_PRISMATIC = 22449; +SET @VOID_CRYSTAL = 22450; +SET @DREAM_SHARD = 34052; +SET @SMALL_DREAM = 34053; +SET @INFINITE_DUST = 34054; +SET @GREATER_COSMIC = 34055; +SET @LESSER_COSMIC = 34056; +SET @ABYSS_CRYSTAL = 34057; +SET @HEAVENLY_SHARD = 52721; +SET @SMALL_HEAVENLY = 52720; +SET @HYPN_DUST = 52555; +SET @GREATER_CEL = 52719; +SET @LESSER_CEL = 52718; +SET @MAELSTROM_CRYSTAL = 52722; + +TRUNCATE `disenchant_loot_template`; +INSERT INTO `disenchant_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(3,@STRANGE_DUST,20,1,1,1,2), +(4,@STRANGE_DUST,80,1,1,1,2), +(5,@STRANGE_DUST,75,1,1,2,3), +(6,@STRANGE_DUST,20,1,1,2,3), +(7,@STRANGE_DUST,15,1,1,4,6), +(8,@STRANGE_DUST,75,1,1,4,6), +(13,@SOUL_DUST,75,1,1,1,2), +(14,@SOUL_DUST,20,1,1,1,2), +(17,@SOUL_DUST,75,1,1,2,5), +(18,@SOUL_DUST,20,1,1,2,5), +(21,@VISION_DUST,75,1,1,1,2), +(22,@VISION_DUST,20,1,1,1,2), +(25,@VISION_DUST,75,1,1,2,5), +(26,@VISION_DUST,20,1,1,2,5), +(29,@DREAM_DUST,75,1,1,1,2), +(30,@DREAM_DUST,20,1,1,1,2), +(31,@DREAM_DUST,22,1,1,2,5), +(32,@DREAM_DUST,75,1,1,2,5), +(46,@ILLUSION_DUST,75,1,1,1,2), +(47,@ILLUSION_DUST,22,1,1,1,2), +(52,@ILLUSION_DUST,75,1,1,2,5), +(53,@ILLUSION_DUST,22,1,1,2,5), +(56,@ARCANE_DUST,75,1,1,1,3), +(57,@ARCANE_DUST,22,1,1,1,2), +(62,@ARCANE_DUST,22,1,1,2,5), +(63,@ARCANE_DUST,75,1,1,2,5), +(70,@ARCANE_DUST,75,1,1,2,3), +(71,@ARCANE_DUST,22,1,1,2,3), +(82,@INFINITE_DUST,75,1,1,1,3), +(83,@INFINITE_DUST,22,1,1,1,3), +(88,@INFINITE_DUST,75,1,1,4,7), +(89,@INFINITE_DUST,22,1,1,4,7), +(94,@HYPN_DUST,75,1,1,1,2), +(95,@HYPN_DUST,75,1,1,1,3), +(96,@HYPN_DUST,60,1,1,1,4), +(97,@HYPN_DUST,80,1,1,2,4), +(98,@HYPN_DUST,50,1,1,2,5), +(99,@HYPN_DUST,25,1,1,1,2), +(100,@HYPN_DUST,25,1,1,1,3), +(101,@HYPN_DUST,35,1,1,1,4), +(102,@HYPN_DUST,30,1,1,2,4), +(103,@HYPN_DUST,30,1,1,2,5), +(3,@LESSER_MAGIC,80,1,1,1,2), +(4,@LESSER_MAGIC,20,1,1,1,2), +(5,@GREATER_MAGIC,20,1,1,1,2), +(6,@GREATER_MAGIC,75,1,1,1,2), +(7,@LESSER_ASTRAL,75,1,1,1,2), +(8,@LESSER_ASTRAL,15,1,1,1,2), +(13,@GREATER_ASTRAL,20,1,1,1,2), +(14,@GREATER_ASTRAL,75,1,1,1,2), +(17,@LESSER_MYSTIC,20,1,1,1,2), +(18,@LESSER_MYSTIC,75,1,1,1,2), +(21,@GREATER_MYSTIC,20,1,1,1,2), +(22,@GREATER_MYSTIC,75,1,1,1,2), +(25,@LESSER_NETHER,20,1,1,1,2), +(26,@LESSER_NETHER,75,1,1,1,2), +(29,@GREATER_NETHER,20,1,1,1,2), +(30,@GREATER_NETHER,75,1,1,1,2), +(31,@LESSER_ETERNAL,75,1,1,1,2), +(32,@LESSER_ETERNAL,20,1,1,1,2), +(46,@GREATER_ETERNAL,20,1,1,1,2), +(47,@GREATER_ETERNAL,75,1,1,1,2), +(52,@GREATER_ETERNAL,20,1,1,2,3), +(53,@GREATER_ETERNAL,75,1,1,2,3), +(56,@LESSER_PLANAR,22,1,1,1,3), +(57,@LESSER_PLANAR,75,1,1,1,2), +(62,@GREATER_PLANAR,75,1,1,1,2), +(63,@GREATER_PLANAR,22,1,1,1,2), +(70,@LESSER_PLANAR,22,1,1,2,3), +(71,@LESSER_PLANAR,75,1,1,2,3), +(82,@LESSER_COSMIC,22,1,1,1,2), +(83,@LESSER_COSMIC,75,1,1,1,2), +(88,@GREATER_COSMIC,22,1,1,1,2), +(89,@GREATER_COSMIC,75,1,1,1,2), +(94,@LESSER_CEL,25,1,1,1,2), +(95,@LESSER_CEL,25,1,1,1,3), +(96,@LESSER_CEL,40,1,1,2,4), +(97,@GREATER_CEL,20,1,1,1,2), +(98,@GREATER_CEL,50,1,1,2,3), +(99,@LESSER_CEL,75,1,1,1,2), +(100,@LESSER_CEL,75,1,1,1,3), +(101,@LESSER_CEL,65,1,1,2,4), +(102,@GREATER_CEL,70,1,1,1,2), +(103,@GREATER_CEL,70,1,1,2,3), +(5,@SMALL_GLIMMERING,5,1,1,1,1), +(6,@SMALL_GLIMMERING,5,1,1,1,1), +(7,@SMALL_GLIMMERING,10,1,1,1,1), +(8,@SMALL_GLIMMERING,10,1,1,1,1), +(9,@SMALL_GLIMMERING,100,1,1,1,1), +(10,@SMALL_GLIMMERING,100,1,1,1,1), +(11,@LARGE_GLIMMERING,100,1,1,1,1), +(12,@LARGE_GLIMMERING,100,1,1,1,1), +(13,@LARGE_GLIMMERING,5,1,1,1,1), +(14,@LARGE_GLIMMERING,5,1,1,1,1), +(15,@SMALL_GLOWING,100,1,1,1,1), +(16,@SMALL_GLOWING,100,1,1,1,1), +(17,@SMALL_GLOWING,5,1,1,1,1), +(18,@SMALL_GLOWING,5,1,1,1,1), +(19,@LARGE_GLOWING,100,1,1,1,1), +(20,@LARGE_GLOWING,100,1,1,1,1), +(21,@LARGE_GLOWING,5,1,1,1,1), +(22,@LARGE_GLOWING,5,1,1,1,1), +(23,@SMALL_RADIANT,100,1,1,1,1), +(24,@SMALL_RADIANT,100,1,1,1,1), +(25,@SMALL_RADIANT,5,1,1,1,1), +(26,@SMALL_RADIANT,5,1,1,1,1), +(27,@LARGE_RADIANT,100,1,1,1,1), +(28,@LARGE_RADIANT,100,1,1,1,1), +(29,@LARGE_RADIANT,5,1,1,1,1), +(30,@LARGE_RADIANT,5,1,1,1,1), +(31,@SMALL_BRILLIANT,3,1,1,1,1), +(32,@SMALL_BRILLIANT,5,1,1,1,1), +(34,@SMALL_BRILLIANT,100,1,1,1,1), +(35,@SMALL_BRILLIANT,100,1,1,1,1), +(38,@SMALL_RADIANT,100,1,1,2,4), +(39,@SMALL_RADIANT,100,1,1,2,4), +(40,@LARGE_RADIANT,100,1,1,2,4), +(41,@LARGE_RADIANT,100,1,1,2,4), +(42,@SMALL_BRILLIANT,100,1,1,2,4), +(43,@SMALL_BRILLIANT,100,1,1,2,4), +(44,@LARGE_BRILLIANT,99.5,1,1,1,1), +(45,@LARGE_BRILLIANT,99.5,1,1,1,1), +(46,@LARGE_BRILLIANT,5,1,1,1,1), +(47,@LARGE_BRILLIANT,3,1,1,1,1), +(50,@SMALL_PRISMATIC,99.5,1,1,1,1), +(51,@SMALL_PRISMATIC,99.5,1,1,1,1), +(52,@LARGE_BRILLIANT,5,1,1,1,1), +(53,@LARGE_BRILLIANT,3,1,1,1,1), +(56,@SMALL_PRISMATIC,3,1,1,1,1), +(57,@SMALL_PRISMATIC,3,1,1,1,1), +(58,@SMALL_PRISMATIC,100,1,1,1,1), +(59,@SMALL_PRISMATIC,100,1,1,1,1), +(62,@LARGE_PRISMATIC,3,1,1,1,1), +(63,@LARGE_PRISMATIC,3,1,1,1,1), +(64,@LARGE_PRISMATIC,99.5,1,1,1,1), +(65,@LARGE_PRISMATIC,99.5,1,1,1,1), +(68,@SMALL_PRISMATIC,100,1,1,1,2), +(69,@SMALL_PRISMATIC,100,1,1,1,2), +(70,@SMALL_PRISMATIC,3,1,1,1,1), +(71,@SMALL_PRISMATIC,3,1,1,1,1), +(72,@SMALL_GLIMMERING,100,1,1,2,4), +(73,@SMALL_GLIMMERING,100,1,1,2,4), +(74,@LARGE_GLIMMERING,100,1,1,2,4), +(75,@LARGE_GLIMMERING,100,1,1,2,4), +(76,@SMALL_GLOWING,100,1,1,2,4), +(77,@SMALL_GLOWING,100,1,1,2,4), +(78,@LARGE_GLOWING,100,1,1,2,4), +(79,@LARGE_GLOWING,100,1,1,2,4), +(82,@SMALL_DREAM,3,1,1,1,1), +(83,@SMALL_DREAM,3,1,1,1,1), +(84,@SMALL_DREAM,100,1,1,1,1), +(85,@SMALL_DREAM,100,1,1,1,1), +(86,@DREAM_SHARD,99.5,1,1,1,1), +(87,@DREAM_SHARD,99.5,1,1,1,1), +(88,@DREAM_SHARD,3,1,1,1,1), +(89,@DREAM_SHARD,3,1,1,1,1), +(104,@SMALL_HEAVENLY,100,1,1,1,1), +(105,@SMALL_HEAVENLY,100,1,1,1,2), +(106,@HEAVENLY_SHARD,100,1,1,1,1), +(107,@HEAVENLY_SHARD,100,1,1,1,1), +(44,@NEXUS_CRYSTAL,0.5,1,1,1,1), +(45,@NEXUS_CRYSTAL,0.5,1,1,1,1), +(48,@NEXUS_CRYSTAL,100,1,1,1,1), +(49,@NEXUS_CRYSTAL,100,1,1,1,1), +(50,@NEXUS_CRYSTAL,0.5,1,1,1,1), +(51,@NEXUS_CRYSTAL,0.5,1,1,1,1), +(54,@NEXUS_CRYSTAL,100,1,1,1,2), +(55,@NEXUS_CRYSTAL,100,1,1,1,2), +(60,@NEXUS_CRYSTAL,100,1,1,1,2), +(61,@NEXUS_CRYSTAL,100,1,1,1,2), +(64,@VOID_CRYSTAL,0.5,1,1,1,1), +(65,@VOID_CRYSTAL,0.5,1,1,1,1), +(66,@VOID_CRYSTAL,100,1,1,1,2), +(67,@VOID_CRYSTAL,100,1,1,1,2), +(80,@ABYSS_CRYSTAL,100,1,1,1,1), +(81,@ABYSS_CRYSTAL,100,1,1,1,1), +(86,@ABYSS_CRYSTAL,0.5,1,1,1,1), +(87,@ABYSS_CRYSTAL,0.5,1,1,1,1), +(108,@MAELSTROM_CRYSTAL,100,1,1,1,1), +(109,@MAELSTROM_CRYSTAL,100,1,1,1,1); diff --git a/sql/updates/world/4.x/2011_12_26_02_world_quest_template.sql b/sql/updates/world/4.x/2011_12_26_02_world_quest_template.sql deleted file mode 100644 index b43abd6f85d..00000000000 --- a/sql/updates/world/4.x/2011_12_26_02_world_quest_template.sql +++ /dev/null @@ -1,31 +0,0 @@ -ALTER TABLE `quest_template` ADD COLUMN `MinimapTargetMark` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `SpecialFlags`, - ADD COLUMN `RewardSkillId` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardArenaPoints`, - ADD COLUMN `RewardSkillPoints` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardSkillId`, - ADD COLUMN `RewardReputationMask` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardSkillPoints`, - ADD COLUMN `QuestGiverPortrait` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardReputationMask`, - ADD COLUMN `QuestTurnInPortrait` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0' AFTER `QuestGiverPortrait`, - ADD COLUMN `RequiredSpell` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0' AFTER `RequiredItemCount6`, - ADD COLUMN `RewardCurrencyId1` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `ObjectiveText4`, - ADD COLUMN `RewardCurrencyId2` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardCurrencyId1`, - ADD COLUMN `RewardCurrencyId3` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardCurrencyId2`, - ADD COLUMN `RewardCurrencyId4` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardCurrencyId3`, - ADD COLUMN `RewardCurrencyCount1` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardCurrencyId4`, - ADD COLUMN `RewardCurrencyCount2` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardCurrencyCount1`, - ADD COLUMN `RewardCurrencyCount3` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardCurrencyCount2`, - ADD COLUMN `RewardCurrencyCount4` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardCurrencyCount3`, - ADD COLUMN `RequiredCurrencyId1` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `RewardCurrencyCount4`, - ADD COLUMN `RequiredCurrencyId2` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `RequiredCurrencyId1`, - ADD COLUMN `RequiredCurrencyId3` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `RequiredCurrencyId2`, - ADD COLUMN `RequiredCurrencyId4` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' AFTER `RequiredCurrencyId3`, - ADD COLUMN `RequiredCurrencyCount1` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `RequiredCurrencyId4`, - ADD COLUMN `RequiredCurrencyCount2` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `RequiredCurrencyCount1`, - ADD COLUMN `RequiredCurrencyCount3` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `RequiredCurrencyCount2`, - ADD COLUMN `RequiredCurrencyCount4` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `RequiredCurrencyCount3`, - ADD COLUMN `QuestGiverTextWindow` TEXT NULL DEFAULT NULL AFTER `RequiredCurrencyCount4`, - ADD COLUMN `QuestGiverTargetName` TEXT NULL DEFAULT NULL AFTER `QuestGiverTextWindow`, - ADD COLUMN `QuestTurnTextWindow` TEXT NULL DEFAULT NULL AFTER `QuestGiverTargetName`, - ADD COLUMN `QuestTurnTargetName` TEXT NULL DEFAULT NULL AFTER `QuestTurnTextWindow`, - ADD COLUMN `SoundAccept` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '890' AFTER `QuestTurnTargetName`, - ADD COLUMN `SoundTurnIn` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '878' AFTER `SoundAccept`; - -ALTER TABLE `quest_template` DROP COLUMN `Unknown0`; -- Not found on 422 diff --git a/src/server/game/DataStores/DB2Stores.cpp b/src/server/game/DataStores/DB2Stores.cpp index 77d16501415..2db85542132 100644 --- a/src/server/game/DataStores/DB2Stores.cpp +++ b/src/server/game/DataStores/DB2Stores.cpp @@ -25,8 +25,9 @@ #include DB2Storage sItemStore(Itemfmt); -DB2Storage sItemSparseStore (ItemSparsefmt); +DB2Storage sItemCurrencyCostStore(ItemCurrencyCostfmt); DB2Storage sItemExtendedCostStore(ItemExtendedCostEntryfmt); +DB2Storage sItemSparseStore (ItemSparsefmt); typedef std::list StoreProblemList1; @@ -86,6 +87,7 @@ void LoadDB2Stores(const std::string& dataPath) uint32 availableDb2Locales = 0xFFFFFFFF; LoadDB2(availableDb2Locales, bad_db2_files, sItemStore, db2Path, "Item.db2"); + LoadDB2(availableDb2Locales, bad_db2_files, sItemCurrencyCostStore, db2Path, "ItemCurrencyCost.db2"); LoadDB2(availableDb2Locales, bad_db2_files, sItemSparseStore, db2Path, "Item-sparse.db2"); LoadDB2(availableDb2Locales, bad_db2_files, sItemExtendedCostStore, db2Path, "ItemExtendedCost.db2"); // error checks @@ -115,4 +117,4 @@ void LoadDB2Stores(const std::string& dataPath) sLog->outString(">> Initialized %d DB2 data stores.", DB2FilesCount); sLog->outString(); -} \ No newline at end of file +} diff --git a/src/server/game/DataStores/DB2Stores.h b/src/server/game/DataStores/DB2Stores.h index e60892e05eb..6cf719da70b 100644 --- a/src/server/game/DataStores/DB2Stores.h +++ b/src/server/game/DataStores/DB2Stores.h @@ -25,8 +25,9 @@ #include extern DB2Storage sItemStore; -extern DB2Storage sItemSparseStore; +extern DB2Storage sItemCurrencyCostStore; extern DB2Storage sItemExtendedCostStore; +extern DB2Storage sItemSparseStore; void LoadDB2Stores(const std::string& dataPath); diff --git a/src/server/game/DataStores/DB2Structure.h b/src/server/game/DataStores/DB2Structure.h index 1f455eec0c2..23bf8339c0d 100644 --- a/src/server/game/DataStores/DB2Structure.h +++ b/src/server/game/DataStores/DB2Structure.h @@ -33,14 +33,20 @@ // Structures used to access raw DB2 data and required packing to portability struct ItemEntry { - uint32 ID; // 0 - uint32 Class; // 1 - uint32 SubClass; // 2 - int32 Unk0; // 3 - int32 Material; // 4 - uint32 DisplayId; // 5 - uint32 InventoryType; // 6 - uint32 Sheath; // 7 + uint32 ID; // 0 + uint32 Class; // 1 + uint32 SubClass; // 2 + int32 Unk0; // 3 + int32 Material; // 4 + uint32 DisplayId; // 5 + uint32 InventoryType; // 6 + uint32 Sheath; // 7 +}; + +struct ItemCurrencyCostEntry +{ + uint32 Id; + uint32 ItemId; }; struct ItemSparseEntry diff --git a/src/server/game/DataStores/DB2fmt.h b/src/server/game/DataStores/DB2fmt.h index 435309cbae4..ed48443d543 100644 --- a/src/server/game/DataStores/DB2fmt.h +++ b/src/server/game/DataStores/DB2fmt.h @@ -19,6 +19,7 @@ #define TRINITY_DB2SFRM_H const char Itemfmt[]="niiiiiii"; +const char ItemCurrencyCostfmt[]="xn"; const char ItemSparsefmt[]="niiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiifiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiisssssiiiiiiiiiiiiiiiiiiiiiiifiiifii"; const char ItemExtendedCostEntryfmt[]="nxxiiiiiiiiiiiixiiiiiiiiiixxxxx"; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 8a47e91b32b..bac87dd1f25 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -2194,27 +2194,44 @@ uint32 FillItemArmor(uint32 itemlevel, uint32 itemClass, uint32 itemSubclass, ui return uint32(shield->Value[quality] + 0.5f); } -void FillDisenchantFields(uint32* disenchantID, uint32* requiredDisenchantSkill, uint32 itemClass, uint32 quality, uint32 itemLevel) +void FillDisenchantFields(uint32* disenchantID, uint32* requiredDisenchantSkill, ItemTemplate const& itemTemplate) { + *disenchantID = 0; + *(int32*)requiredDisenchantSkill = -1; + if ((itemTemplate.Flags & (ITEM_PROTO_FLAG_CONJURED | ITEM_PROTO_FLAG_UNK6)) || + itemTemplate.Bonding == BIND_QUEST_ITEM || itemTemplate.Area || itemTemplate.Map || + itemTemplate.Stackable > 1 || + !(itemTemplate.SellPrice || sItemCurrencyCostStore.LookupEntry(itemTemplate.ItemId))) + return; + for (uint32 i = 0; i < sItemDisenchantLootStore.GetNumRows(); ++i) { ItemDisenchantLootEntry const* disenchant = sItemDisenchantLootStore.LookupEntry(i); if (!disenchant) continue; - if (disenchant->ItemClass == itemClass && - disenchant->ItemQuality == quality && - disenchant->MinItemLevel <= itemLevel && - disenchant->MaxItemLevel >= itemLevel) + if (disenchant->ItemClass == itemTemplate.Class && + disenchant->ItemQuality == itemTemplate.Quality && + disenchant->MinItemLevel <= itemTemplate.ItemLevel && + disenchant->MaxItemLevel >= itemTemplate.ItemLevel) { + // extra check for epics in range 90 - 99 + if (disenchant->MinItemLevel < 90) + { + if (itemTemplate.RequiredLevel > 60 || itemTemplate.RequiredSkillRank > 300) + continue; + } + else + { + if (itemTemplate.RequiredLevel <= 60 || itemTemplate.RequiredSkillRank <= 300) + continue; + } + *disenchantID = disenchant->Id; *requiredDisenchantSkill = disenchant->RequiredDisenchantSkill; return; } } - - *disenchantID = 0; - *(int32*)requiredDisenchantSkill = -1; } void ObjectMgr::LoadItemTemplates() @@ -2314,8 +2331,7 @@ void ObjectMgr::LoadItemTemplates() itemTemplate.socketBonus = sparse->SocketBonus; itemTemplate.GemProperties = sparse->GemProperties; - FillDisenchantFields(&itemTemplate.DisenchantID, &itemTemplate.RequiredDisenchantSkill, - db2Data->Class, sparse->Quality, sparse->ItemLevel); + FillDisenchantFields(&itemTemplate.DisenchantID, &itemTemplate.RequiredDisenchantSkill, itemTemplate); itemTemplate.ArmorDamageModifier = sparse->ArmorDamageModifier; itemTemplate.Duration = sparse->Duration; @@ -2463,8 +2479,7 @@ void ObjectMgr::LoadItemTemplates() itemTemplate.socketBonus = fields[123].GetUInt32(); itemTemplate.GemProperties = fields[124].GetUInt32(); - FillDisenchantFields(&itemTemplate.DisenchantID, &itemTemplate.RequiredDisenchantSkill, - itemTemplate.Class, itemTemplate.Quality, itemTemplate.ItemLevel); + FillDisenchantFields(&itemTemplate.DisenchantID, &itemTemplate.RequiredDisenchantSkill, itemTemplate); itemTemplate.ArmorDamageModifier = fields[125].GetFloat(); itemTemplate.Duration = fields[126].GetUInt32(); @@ -3589,7 +3604,7 @@ void ObjectMgr::LoadQuests() QueryResult result = WorldDatabase.Query("SELECT " //0 1 2 3 4 5 6 7 8 9 10 11 12 "Id, Method, Level, MinLevel, MaxLevel, ZoneOrSort, Type, SuggestedPlayers, LimitTime, RequiredClasses, RequiredRaces, RequiredSkillId, RequiredSkillPoints, " - // 13 14 15 16 17 18 19 20 + // 13 14 15 16 17 18 19 20 "RequiredFactionId1, RequiredFactionId2, RequiredFactionValue1, RequiredFactionValue2, RequiredMinRepFaction, RequiredMaxRepFaction, RequiredMinRepValue, RequiredMaxRepValue, " // 21 22 23 24 25 26 27 28 29 30 31 "PrevQuestId, NextQuestId, ExclusiveGroup, NextQuestIdChain, RewardXPId, RewardOrRequiredMoney, RewardMoneyMaxLevel, RewardSpell, RewardSpellCast, RewardHonor, RewardHonorMultiplier, " -- cgit v1.2.3 From 929da7396d12c4f96670d4f7cc3a6026df304d37 Mon Sep 17 00:00:00 2001 From: Rat Date: Sat, 26 Nov 2011 20:28:12 +0100 Subject: Core/Packets: disable sending 0 as opcode and print trace info --- src/server/game/Server/WorldSession.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index 75d8ed0f7a0..976ef4bd70b 100755 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -159,7 +159,7 @@ void WorldSession::SendPacket(WorldPacket const* packet) if (!m_Socket) return; - if (packet->GetOpcode() == UNKNOWN_OPCODE) + if (packet->GetOpcode() == NULL || packet->GetOpcode() == UNKNOWN_OPCODE) { sLog->outError("Sending unknown opcode - prevented. Trace:"); ACE_Stack_Trace trace; -- cgit v1.2.3 From e97527c24e92b7c8a521cb01f4c655776a10cdcb Mon Sep 17 00:00:00 2001 From: Rat Date: Sat, 26 Nov 2011 20:32:32 +0100 Subject: Core/Packets: Implemented BitStream helper class - added Static BitConverter class - upgraded the ByteBuffer class for easier usage --- src/server/shared/Packets/ByteBuffer.cpp | 89 +++++++++++++++ src/server/shared/Packets/ByteBuffer.h | 179 ++++++++++++++++++++++++++++++- 2 files changed, 264 insertions(+), 4 deletions(-) create mode 100644 src/server/shared/Packets/ByteBuffer.cpp (limited to 'src') diff --git a/src/server/shared/Packets/ByteBuffer.cpp b/src/server/shared/Packets/ByteBuffer.cpp new file mode 100644 index 00000000000..cdb73987453 --- /dev/null +++ b/src/server/shared/Packets/ByteBuffer.cpp @@ -0,0 +1,89 @@ +/* + * Copyright (C) 2008-2011 TrinityCore + * + * 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; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; 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, see . + */ + +#include "ByteBuffer.h" + +void BitStream::Clear() +{ + _data.clear(); + _rpos = _wpos = 0; +} + +uint8 BitStream::GetBit(uint32 bit) +{ + ASSERT(_data.size() > bit); + return _data[bit]; +} + +uint8 BitStream::ReadBit() +{ + ASSERT(_data.size() < _rpos); + uint8 b = _data[_rpos]; + ++_rpos; + return b; +} + +void BitStream::WriteBit(uint32 bit) +{ + _data.push_back(bit ? uint8(1) : uint8(0)); + ++_wpos; +} + +template void BitStream::WriteBits(T value, size_t bits) +{ + for (int32 i = bits-1; i >= 0; --i) + WriteBit((value >> i) & 1); +} + +bool BitStream::Emtpy () +{ + return _data.empty(); +} + +void BitStream::Reverse() +{ + uint32 len = GetLenght(); + std::vector b = _data; + Clear(); + + for(uint32 i = len; i > 0; --i) + WriteBit(b[i-1]); +} + +void BitStream::Print() +{ + if (!sLog->IsOutDebug()) + return; + std::stringstream ss; + ss << "BitStream: "; + for (uint32 i = 0; i < GetLenght(); ++i) + ss << uint32(GetBit(i)) << " "; + + sLog->outDebug(LOG_FILTER_NETWORKIO, ss.str().c_str()); +} + +ByteBuffer::ByteBuffer(size_t res, bool init): _rpos(0), _wpos(0), _bitpos(8), _curbitval(0) +{ + if (init) + { + for (size_t i = 0; i < res; ++i) + { + *this << uint8(0); + } + } else + _storage.reserve(res); +} \ No newline at end of file diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h index 93a9aaa6d80..5be360f1126 100755 --- a/src/server/shared/Packets/ByteBuffer.h +++ b/src/server/shared/Packets/ByteBuffer.h @@ -24,6 +24,8 @@ #include "Logging/Log.h" #include "Utilities/ByteConverter.h" + + class ByteBufferException { public: @@ -45,6 +47,45 @@ class ByteBufferException size_t size; }; +class BitStream +{ + public: + BitStream(): _rpos(0), _wpos(0) {} + + BitStream(uint32 val, size_t len): _rpos(0), _wpos(0) + { + WriteBits(val, len); + } + + void Clear(); + uint8 GetBit(uint32 bit); + uint8 ReadBit(); + void WriteBit(uint32 bit); + template void WriteBits(T value, size_t bits); + bool Emtpy (); + void Reverse(); + void Print(); + + size_t GetLenght () { return _data.size();} + uint32 GetReadPosition() { return _rpos; } + uint32 GetWritePosition() { return _wpos; } + void SetReadPos (uint32 pos) { _rpos = pos; } + + uint8 operator[](uint32 pos) const + { + return _data[pos]; + } + + uint8& operator[] (const uint32 pos) + { + return _data[pos]; + } + + private: + std::vector _data; + uint32 _rpos, _wpos; +}; + class ByteBuffer { public: @@ -57,10 +98,7 @@ class ByteBuffer } // constructor - ByteBuffer(size_t res): _rpos(0), _wpos(0), _bitpos(8), _curbitval(0) - { - _storage.reserve(res); - } + ByteBuffer(size_t res, bool init = false); // copy constructor ByteBuffer(const ByteBuffer &buf): _rpos(buf._rpos), _wpos(buf._wpos), _storage(buf._storage), _bitpos(buf._bitpos), _curbitval(buf._curbitval) { } @@ -135,6 +173,14 @@ class ByteBuffer return value; } + BitStream* ReadBitStream(uint32 len) + { + BitStream* b = new BitStream(); + for (uint32 i = 0; i < len; ++i) + b->WriteBit(readBit()); + return b; + } + template void put(size_t pos, T value) { EndianConvert(value); @@ -302,6 +348,13 @@ class ByteBuffer return read(pos); } + uint8& operator[] (const size_t pos) + { + if (pos >= size()) + throw ByteBufferException(false, pos, 1, size()); + return _storage[pos]; + } + size_t rpos() const { return _rpos; } size_t rpos(size_t rpos_) @@ -381,6 +434,83 @@ class ByteBuffer } } + uint8 ReadUInt8() + { + uint8 u = 0; + (*this) >> u; + return u; + } + + uint16 ReadUInt16() + { + uint16 u = 0; + (*this) >> u; + return u; + } + + uint32 ReadUInt32() + { + uint32 u = 0; + (*this) >> u; + return u; + } + + uint64 ReadUInt64() + { + uint64 u = 0; + (*this) >> u; + return u; + } + + int8 ReadInt8() + { + int8 u = 0; + (*this) >> u; + return u; + } + + int16 ReadInt16() + { + int16 u = 0; + (*this) >> u; + return u; + } + + int32 ReadInt32() + { + uint32 u = 0; + (*this) >> u; + return u; + } + + int64 ReadInt64() + { + int64 u = 0; + (*this) >> u; + return u; + } + + std::string ReadString() + { + std::string s = 0; + (*this) >> s; + return s; + } + + bool ReadBoolean() + { + uint8 b = 0; + (*this) >> b; + return b > 0 ? true : false; + } + + float ReadSingle() + { + float f = 0; + (*this) >> f; + return f; + } + const uint8 *contents() const { return &_storage[0]; } size_t size() const { return _storage.size(); } @@ -657,5 +787,46 @@ inline void ByteBuffer::read_skip() { read_skip(); } + +class BitConverter +{ + public: + + static uint8 ToUInt8(ByteBuffer buff, size_t start = 0) + { + return buff.read(start); + } + + static uint16 ToUInt16(ByteBuffer buff, size_t start = 0) + { + return buff.read(start); + } + + static uint32 ToUInt32(ByteBuffer buff, size_t start = 0) + { + return buff.read(start); + } + + static uint64 ToUInt64(ByteBuffer buff, size_t start = 0) + { + return buff.read(start); + } + + static int16 ToInt16(ByteBuffer buff, size_t start = 0) + { + return buff.read(start); + } + + static int32 ToInt32(ByteBuffer buff, size_t start = 0) + { + return buff.read(start); + } + + static int64 ToInt64(ByteBuffer buff, size_t start = 0) + { + return buff.read(start); + } +}; + #endif -- cgit v1.2.3 From 8cf3fde3291e8fdadef564232c2981d670a1e274 Mon Sep 17 00:00:00 2001 From: Rat Date: Sat, 26 Nov 2011 20:38:00 +0100 Subject: Core/CharacterHandler: fixed guid reading in PlayerLoginOpcode handler thanks to Nay && Shauren --- .../game/Server/Protocol/Handlers/CharacterHandler.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp index 342b8ef119f..20ccf552f50 100755 --- a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp @@ -842,7 +842,22 @@ void WorldSession::HandlePlayerLoginOpcode(WorldPacket & recv_data) sLog->outStaticDebug("WORLD: Recvd Player Logon Message"); - recv_data >> playerGuid; + BitStream* mask = recv_data.ReadBitStream(8); + + ByteBuffer* bytes = new ByteBuffer(8, true); + + if ((*mask)[6]) (*bytes)[5] = recv_data.ReadUInt8() ^ 1; + if ((*mask)[0]) (*bytes)[0] = recv_data.ReadUInt8() ^ 1; + if ((*mask)[4]) (*bytes)[3] = recv_data.ReadUInt8() ^ 1; + if ((*mask)[1]) (*bytes)[4] = recv_data.ReadUInt8() ^ 1; + if ((*mask)[2]) (*bytes)[7] = recv_data.ReadUInt8() ^ 1; + if ((*mask)[5]) (*bytes)[2] = recv_data.ReadUInt8() ^ 1; + if ((*mask)[7]) (*bytes)[6] = recv_data.ReadUInt8() ^ 1; + if ((*mask)[3]) (*bytes)[1] = recv_data.ReadUInt8() ^ 1; + + playerGuid = BitConverter::ToUInt64((*bytes)); + + sLog->outDebug(LOG_FILTER_NETWORKIO, "Character (Guid: %u) logging in", playerGuid); if (!CharCanLogin(GUID_LOPART(playerGuid))) { -- cgit v1.2.3 From b096ffe981e933e9b4ab7560e22cc55f5bca0568 Mon Sep 17 00:00:00 2001 From: kaelima Date: Sat, 26 Nov 2011 20:53:38 +0100 Subject: Misc/Enums: Added more spell custom errors (cast result 172) from 4.2.2 --- src/server/game/Miscellaneous/SharedDefines.h | 57 +++++++++++++++++++-------- 1 file changed, 40 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 197c12ac519..0e055acab4f 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -1095,38 +1095,60 @@ enum SpellCustomErrors SPELL_CUSTOM_ERROR_GM_ONLY = 65, // Only GMs may use that. Your account has been reported for investigation. SPELL_CUSTOM_ERROR_REQUIRES_LEVEL_58 = 66, // You must reach level 58 to use this portal. SPELL_CUSTOM_ERROR_AT_HONOR_CAP = 67, // You already have the maximum amount of honor. - SPELL_CUSTOM_ERROR_68 = 68, // "" - SPELL_CUSTOM_ERROR_69 = 69, // "" - SPELL_CUSTOM_ERROR_70 = 70, // "" - SPELL_CUSTOM_ERROR_71 = 71, // "" - SPELL_CUSTOM_ERROR_72 = 72, // "" - SPELL_CUSTOM_ERROR_73 = 73, // "" - SPELL_CUSTOM_ERROR_74 = 74, // "" + SPELL_CUSTOM_ERROR_HAVE_HOT_ROD = 68, // You already have a Hot Rod. + SPELL_CUSTOM_ERROR_PARTYGOER_MORE_BUBBLY = 69, // This partygoer wants some more bubbly + SPELL_CUSTOM_ERROR_PARTYGOER_NEED_BUCKET = 70, // This partygoer needs a bucket! + SPELL_CUSTOM_ERROR_PARTYGOER_WANT_TO_DANCE = 71, // This partygoer wants to dance with you. + SPELL_CUSTOM_ERROR_PARTYGOER_WANT_FIREWORKS = 72, // This partygoer wants to see some fireworks. + SPELL_CUSTOM_ERROR_PARTYGOER_WANT_APPETIZER = 73, // This partygoer wants some more hors d'oeuvres. + SPELL_CUSTOM_ERROR_GOBLIN_BATTERY_DEPLETED = 74, // The Goblin All-In-1-Der Belt's battery is depleted. SPELL_CUSTOM_ERROR_MUST_HAVE_DEMONIC_CIRCLE = 75, // You must have a demonic circle active. SPELL_CUSTOM_ERROR_AT_MAX_RAGE = 76, // You already have maximum rage SPELL_CUSTOM_ERROR_REQUIRES_350_ENGINEERING = 77, // Requires Engineering (350) SPELL_CUSTOM_ERROR_SOUL_BELONGS_TO_LICH_KING = 78, // Your soul belongs to the Lich King SPELL_CUSTOM_ERROR_ATTENDANT_HAS_PONY = 79, // Your attendant already has an Argent Pony - SPELL_CUSTOM_ERROR_80 = 80, // "" - SPELL_CUSTOM_ERROR_81 = 81, // "" - SPELL_CUSTOM_ERROR_82 = 82, // "" + SPELL_CUSTOM_ERROR_GOBLIN_STARTING_MISSION = 80, // First, Overload the Defective Generator, Activate the Leaky Stove, and Drop a Cigar on the Flammable Bed. + SPELL_CUSTOM_ERROR_GASBOT_ALREADY_SENT = 81, // You've already sent in the Gasbot and destroyed headquarters! + SPELL_CUSTOM_ERROR_GOBLIN_IS_PARTIED_OUT = 82, // This goblin is all partied out! SPELL_CUSTOM_ERROR_MUST_HAVE_FIRE_TOTEM = 83, // You must have a Fire Totem active. SPELL_CUSTOM_ERROR_CANT_TARGET_VAMPIRES = 84, // You may not bite other vampires. SPELL_CUSTOM_ERROR_PET_ALREADY_AT_YOUR_LEVEL = 85, // Your pet is already at your level. SPELL_CUSTOM_ERROR_MISSING_ITEM_REQUIREMENS = 86, // You do not meet the level requirements for this item. SPELL_CUSTOM_ERROR_TOO_MANY_ABOMINATIONS = 87, // There are too many Mutated Abominations. SPELL_CUSTOM_ERROR_ALL_POTIONS_USED = 88, // The potions have all been depleted by Professor Putricide. - SPELL_CUSTOM_ERROR_89 = 89, // "" + SPELL_CUSTOM_ERROR_DEFEATED_ENOUGH_ALREADY = 89, // You have already defeated enough of them. SPELL_CUSTOM_ERROR_REQUIRES_LEVEL_65 = 90, // Requires level 65 - SPELL_CUSTOM_ERROR_91 = 91, // "" - SPELL_CUSTOM_ERROR_92 = 92, // "" - SPELL_CUSTOM_ERROR_93 = 93, // "" - SPELL_CUSTOM_ERROR_94 = 94, // "" - SPELL_CUSTOM_ERROR_95 = 95, // "" + SPELL_CUSTOM_ERROR_DESTROYED_KTC_OIL_PLATFORM = 91, // You have already destroyed the KTC Oil Platform. + SPELL_CUSTOM_ERROR_LAUNCHED_ENOUGH_CAGES = 92, // You have already launched enough cages. + SPELL_CUSTOM_ERROR_REQUIRES_BOOSTER_ROCKETS = 93, // Requires Single-Stage Booster Rockets. Return to Hobart Grapplehammer to get more. + SPELL_CUSTOM_ERROR_ENOUGH_WILD_CLUCKERS = 94, // You have already captured enough wild cluckers. + SPELL_CUSTOM_ERROR_REQUIRES_CONTROL_FIREWORKS = 95, // Requires Remote Control Fireworks. Return to Hobart Grapplehammer to get more. SPELL_CUSTOM_ERROR_MAX_NUMBER_OF_RECRUITS = 96, // You already have the max number of recruits. SPELL_CUSTOM_ERROR_MAX_NUMBER_OF_VOLUNTEERS = 97, // You already have the max number of volunteers. SPELL_CUSTOM_ERROR_FROSTMOURNE_RENDERED_RESSURECT = 98, // Frostmourne has rendered you unable to ressurect. SPELL_CUSTOM_ERROR_CANT_MOUNT_WITH_SHAPESHIFT = 99, // You can't mount while affected by that shapeshift. + SPELL_CUSTOM_ERROR_FAWNS_ALREADY_FOLLOWING = 100, // Three fawns are already following you! + SPELL_CUSTOM_ERROR_ALREADY_HAVE_RIVER_BOAT = 101, // You already have a River Boat. + SPELL_CUSTOM_ERROR_NO_ACTIVE_ENCHANTMENT = 102, // You have no active enchantment to unleash. + SPELL_CUSTOM_ERROR_ENOUGH_HIGHBOURNE_SOULS = 103, // You have bound enough Highborne souls. Return to Arcanist Valdurian. + SPELL_CUSTOM_ERROR_ATLEAST_40YD_FROM_OIL_DRILLING = 104, // You must be at least 40 yards away from all other Oil Drilling Rigs. + SPELL_CUSTOM_ERROR_ABOVE_ENSLAVED_PEARL_MINER = 105, // You must be above the Enslaved Pearl Miner. + SPELL_CUSTOM_ERROR_MUST_TARGET_CORPSE_SPECIAL_1 = 106, // You must target the corpse of a Seabrush Terrapin, Scourgut Remora, or Spinescale Hammerhead. + SPELL_CUSTOM_ERROR_SLAGHAMMER_ALREADY_PRISONER = 107, // Ambassador Slaghammer is already your prisoner. + SPELL_CUSTOM_ERROR_REQUIRE_ATTUNED_LOCATION_1 = 108, // Requires a location that is attuned with the Naz'jar Battlemaiden. + SPELL_CUSTOM_ERROR_NEED_TO_FREE_DRAKE_FIRST = 109, // Free the Drake from the net first! + SPELL_CUSTOM_ERROR_DRAGONMAW_ALLIES_ALREADY_FOLLOW = 110, // You already have three Dragonmaw allies following you. + SPELL_CUSTOM_ERROR_REQUIRE_OPPOSABLE_THUMBS = 111, // Requires Opposable Thumbs. + SPELL_CUSTOM_ERROR_NOT_ENOUGH_HEALTH = 112, // Not enough health + SPELL_CUSTOM_ERROR_ENOUGH_FORSAKEN_TROOPERS = 113, // You already have enough Forsaken Troopers. + SPELL_CUSTOM_ERROR_CANNOT_JUMP_TO_BOULDER = 114, // You cannot jump to another boulder yet. + SPELL_CUSTOM_ERROR_SKILL_TOO_HIGH = 115, // Skill too high. + SPELL_CUSTOM_ERROR_ALREADY_6_SURVIVORS_RESCUED = 116, // You have already rescued 6 Survivors. + SPELL_CUSTOM_ERROR_MUST_FACE_SHIPS_FROM_BALLOON = 117, // You need to be facing the ships from the rescue balloon. + SPELL_CUSTOM_ERROR_CANNOT_SUPERVISE_MORE_CULTISTS = 118, // You cannot supervise more than 5 Arrested Cultists at a time. + SPELL_CUSTOM_ERROR_REQUIRES_LEVEL_85 = 119, // You must reach level 85 to use this portal. + SPELL_CUSTOM_ERROR_MUST_BE_BELOW_35_HEALTH = 120, // Your target must be below 35% health. + SPELL_CUSTOM_ERROR_MUST_SELECT_TALENT_SPECIAL = 121, // You must select a talent specialization first. }; enum StealthType @@ -2722,6 +2744,7 @@ enum ChatMsg CHAT_MSG_CHANNEL_LIST = 0x14, CHAT_MSG_CHANNEL_NOTICE = 0x15, CHAT_MSG_CHANNEL_NOTICE_USER = 0x16, + // CHAT_MSG_TARGETICONS CHAT_MSG_AFK = 0x17, CHAT_MSG_DND = 0x18, CHAT_MSG_IGNORED = 0x19, @@ -2750,7 +2773,7 @@ enum ChatMsg CHAT_MSG_ACHIEVEMENT = 0x30, CHAT_MSG_GUILD_ACHIEVEMENT = 0x31, CHAT_MSG_ARENA_POINTS = 0x32, - CHAT_MSG_PARTY_LEADER = 0x33 + CHAT_MSG_PARTY_LEADER = 0x33, }; #define MAX_CHAT_MSG_TYPE 0x34 -- cgit v1.2.3 From 7dca37ea169ffe54d81986b3044d5f0a8006db77 Mon Sep 17 00:00:00 2001 From: Rat Date: Sat, 26 Nov 2011 21:06:24 +0100 Subject: Core/DB2Stores: fixed loading ItemCurrencyCost.db2 --- src/server/game/DataStores/DB2Structure.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/DataStores/DB2Structure.h b/src/server/game/DataStores/DB2Structure.h index 23bf8339c0d..ae070924b5b 100644 --- a/src/server/game/DataStores/DB2Structure.h +++ b/src/server/game/DataStores/DB2Structure.h @@ -45,7 +45,7 @@ struct ItemEntry struct ItemCurrencyCostEntry { - uint32 Id; + //uint32 Id; uint32 ItemId; }; -- cgit v1.2.3 From 80c3f2234ec4e52857c2c9171490d4b0d461205f Mon Sep 17 00:00:00 2001 From: Shocker Date: Sat, 26 Nov 2011 22:11:11 +0200 Subject: Core/Spells: Use indentantion in SpellAura defines --- src/server/game/Spells/Auras/SpellAuraDefines.h | 636 ++++++++++++------------ 1 file changed, 318 insertions(+), 318 deletions(-) (limited to 'src') diff --git a/src/server/game/Spells/Auras/SpellAuraDefines.h b/src/server/game/Spells/Auras/SpellAuraDefines.h index 7c0be84bf50..febe303b1dc 100755 --- a/src/server/game/Spells/Auras/SpellAuraDefines.h +++ b/src/server/game/Spells/Auras/SpellAuraDefines.h @@ -59,324 +59,324 @@ enum DAMAGE_ABSORB_TYPE enum AuraType { - SPELL_AURA_NONE = 0, - SPELL_AURA_BIND_SIGHT = 1, - SPELL_AURA_MOD_POSSESS = 2, - SPELL_AURA_PERIODIC_DAMAGE = 3, - SPELL_AURA_DUMMY = 4, - SPELL_AURA_MOD_CONFUSE = 5, - SPELL_AURA_MOD_CHARM = 6, - SPELL_AURA_MOD_FEAR = 7, - SPELL_AURA_PERIODIC_HEAL = 8, - SPELL_AURA_MOD_ATTACKSPEED = 9, - SPELL_AURA_MOD_THREAT = 10, - SPELL_AURA_MOD_TAUNT = 11, - SPELL_AURA_MOD_STUN = 12, - SPELL_AURA_MOD_DAMAGE_DONE = 13, - SPELL_AURA_MOD_DAMAGE_TAKEN = 14, - SPELL_AURA_DAMAGE_SHIELD = 15, - SPELL_AURA_MOD_STEALTH = 16, - SPELL_AURA_MOD_STEALTH_DETECT = 17, - SPELL_AURA_MOD_INVISIBILITY = 18, - SPELL_AURA_MOD_INVISIBILITY_DETECT = 19, - SPELL_AURA_OBS_MOD_HEALTH = 20, //20, 21 unofficial - SPELL_AURA_OBS_MOD_POWER = 21, - SPELL_AURA_MOD_RESISTANCE = 22, - SPELL_AURA_PERIODIC_TRIGGER_SPELL = 23, - SPELL_AURA_PERIODIC_ENERGIZE = 24, - SPELL_AURA_MOD_PACIFY = 25, - SPELL_AURA_MOD_ROOT = 26, - SPELL_AURA_MOD_SILENCE = 27, - SPELL_AURA_REFLECT_SPELLS = 28, - SPELL_AURA_MOD_STAT = 29, - SPELL_AURA_MOD_SKILL = 30, - SPELL_AURA_MOD_INCREASE_SPEED = 31, - SPELL_AURA_MOD_INCREASE_MOUNTED_SPEED = 32, - SPELL_AURA_MOD_DECREASE_SPEED = 33, - SPELL_AURA_MOD_INCREASE_HEALTH = 34, - SPELL_AURA_MOD_INCREASE_ENERGY = 35, - SPELL_AURA_MOD_SHAPESHIFT = 36, - SPELL_AURA_EFFECT_IMMUNITY = 37, - SPELL_AURA_STATE_IMMUNITY = 38, - SPELL_AURA_SCHOOL_IMMUNITY = 39, - SPELL_AURA_DAMAGE_IMMUNITY = 40, - SPELL_AURA_DISPEL_IMMUNITY = 41, - SPELL_AURA_PROC_TRIGGER_SPELL = 42, - SPELL_AURA_PROC_TRIGGER_DAMAGE = 43, - SPELL_AURA_TRACK_CREATURES = 44, - SPELL_AURA_TRACK_RESOURCES = 45, - SPELL_AURA_46 = 46, // Ignore all Gear test spells - SPELL_AURA_MOD_PARRY_PERCENT = 47, - SPELL_AURA_48 = 48, // One periodic spell - SPELL_AURA_MOD_DODGE_PERCENT = 49, - SPELL_AURA_MOD_CRITICAL_HEALING_AMOUNT = 50, - SPELL_AURA_MOD_BLOCK_PERCENT = 51, - SPELL_AURA_MOD_WEAPON_CRIT_PERCENT = 52, - SPELL_AURA_PERIODIC_LEECH = 53, - SPELL_AURA_MOD_HIT_CHANCE = 54, - SPELL_AURA_MOD_SPELL_HIT_CHANCE = 55, - SPELL_AURA_TRANSFORM = 56, - SPELL_AURA_MOD_SPELL_CRIT_CHANCE = 57, - SPELL_AURA_MOD_INCREASE_SWIM_SPEED = 58, - SPELL_AURA_MOD_DAMAGE_DONE_CREATURE = 59, - SPELL_AURA_MOD_PACIFY_SILENCE = 60, - SPELL_AURA_MOD_SCALE = 61, - SPELL_AURA_PERIODIC_HEALTH_FUNNEL = 62, - SPELL_AURA_63 = 63, // old SPELL_AURA_PERIODIC_MANA_FUNNEL - SPELL_AURA_PERIODIC_MANA_LEECH = 64, - SPELL_AURA_MOD_CASTING_SPEED_NOT_STACK = 65, - SPELL_AURA_FEIGN_DEATH = 66, - SPELL_AURA_MOD_DISARM = 67, - SPELL_AURA_MOD_STALKED = 68, - SPELL_AURA_SCHOOL_ABSORB = 69, - SPELL_AURA_EXTRA_ATTACKS = 70, - SPELL_AURA_MOD_SPELL_CRIT_CHANCE_SCHOOL = 71, - SPELL_AURA_MOD_POWER_COST_SCHOOL_PCT = 72, - SPELL_AURA_MOD_POWER_COST_SCHOOL = 73, - SPELL_AURA_REFLECT_SPELLS_SCHOOL = 74, - SPELL_AURA_MOD_LANGUAGE = 75, - SPELL_AURA_FAR_SIGHT = 76, - SPELL_AURA_MECHANIC_IMMUNITY = 77, - SPELL_AURA_MOUNTED = 78, - SPELL_AURA_MOD_DAMAGE_PERCENT_DONE = 79, - SPELL_AURA_MOD_PERCENT_STAT = 80, - SPELL_AURA_SPLIT_DAMAGE_PCT = 81, - SPELL_AURA_WATER_BREATHING = 82, - SPELL_AURA_MOD_BASE_RESISTANCE = 83, - SPELL_AURA_MOD_REGEN = 84, - SPELL_AURA_MOD_POWER_REGEN = 85, - SPELL_AURA_CHANNEL_DEATH_ITEM = 86, - SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN = 87, - SPELL_AURA_MOD_HEALTH_REGEN_PERCENT = 88, - SPELL_AURA_PERIODIC_DAMAGE_PERCENT = 89, - SPELL_AURA_90 = 90, // old SPELL_AURA_MOD_RESIST_CHANCE - SPELL_AURA_MOD_DETECT_RANGE = 91, - SPELL_AURA_PREVENTS_FLEEING = 92, - SPELL_AURA_MOD_UNATTACKABLE = 93, - SPELL_AURA_INTERRUPT_REGEN = 94, - SPELL_AURA_GHOST = 95, - SPELL_AURA_SPELL_MAGNET = 96, - SPELL_AURA_MANA_SHIELD = 97, - SPELL_AURA_MOD_SKILL_TALENT = 98, - SPELL_AURA_MOD_ATTACK_POWER = 99, - SPELL_AURA_AURAS_VISIBLE = 100, - SPELL_AURA_MOD_RESISTANCE_PCT = 101, - SPELL_AURA_MOD_MELEE_ATTACK_POWER_VERSUS = 102, - SPELL_AURA_MOD_TOTAL_THREAT = 103, - SPELL_AURA_WATER_WALK = 104, - SPELL_AURA_FEATHER_FALL = 105, - SPELL_AURA_HOVER = 106, - SPELL_AURA_ADD_FLAT_MODIFIER = 107, - SPELL_AURA_ADD_PCT_MODIFIER = 108, - SPELL_AURA_ADD_TARGET_TRIGGER = 109, - SPELL_AURA_MOD_POWER_REGEN_PERCENT = 110, - SPELL_AURA_ADD_CASTER_HIT_TRIGGER = 111, - SPELL_AURA_OVERRIDE_CLASS_SCRIPTS = 112, - SPELL_AURA_MOD_RANGED_DAMAGE_TAKEN = 113, - SPELL_AURA_MOD_RANGED_DAMAGE_TAKEN_PCT = 114, - SPELL_AURA_MOD_HEALING = 115, - SPELL_AURA_MOD_REGEN_DURING_COMBAT = 116, - SPELL_AURA_MOD_MECHANIC_RESISTANCE = 117, - SPELL_AURA_MOD_HEALING_PCT = 118, - SPELL_AURA_119 = 119, // old SPELL_AURA_SHARE_PET_TRACKING - SPELL_AURA_UNTRACKABLE = 120, - SPELL_AURA_EMPATHY = 121, - SPELL_AURA_MOD_OFFHAND_DAMAGE_PCT = 122, - SPELL_AURA_MOD_TARGET_RESISTANCE = 123, - SPELL_AURA_MOD_RANGED_ATTACK_POWER = 124, - SPELL_AURA_MOD_MELEE_DAMAGE_TAKEN = 125, - SPELL_AURA_MOD_MELEE_DAMAGE_TAKEN_PCT = 126, - SPELL_AURA_RANGED_ATTACK_POWER_ATTACKER_BONUS = 127, - SPELL_AURA_MOD_POSSESS_PET = 128, - SPELL_AURA_MOD_SPEED_ALWAYS = 129, - SPELL_AURA_MOD_MOUNTED_SPEED_ALWAYS = 130, - SPELL_AURA_MOD_RANGED_ATTACK_POWER_VERSUS = 131, - SPELL_AURA_MOD_INCREASE_ENERGY_PERCENT = 132, - SPELL_AURA_MOD_INCREASE_HEALTH_PERCENT = 133, - SPELL_AURA_MOD_MANA_REGEN_INTERRUPT = 134, - SPELL_AURA_MOD_HEALING_DONE = 135, - SPELL_AURA_MOD_HEALING_DONE_PERCENT = 136, - SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE = 137, - SPELL_AURA_MOD_MELEE_HASTE = 138, - SPELL_AURA_FORCE_REACTION = 139, - SPELL_AURA_MOD_RANGED_HASTE = 140, - SPELL_AURA_MOD_RANGED_AMMO_HASTE = 141, - SPELL_AURA_MOD_BASE_RESISTANCE_PCT = 142, - SPELL_AURA_MOD_RESISTANCE_EXCLUSIVE = 143, - SPELL_AURA_SAFE_FALL = 144, - SPELL_AURA_MOD_PET_TALENT_POINTS = 145, - SPELL_AURA_ALLOW_TAME_PET_TYPE = 146, - SPELL_AURA_MECHANIC_IMMUNITY_MASK = 147, - SPELL_AURA_RETAIN_COMBO_POINTS = 148, - SPELL_AURA_REDUCE_PUSHBACK = 149, // Reduce Pushback - SPELL_AURA_MOD_SHIELD_BLOCKVALUE_PCT = 150, - SPELL_AURA_TRACK_STEALTHED = 151, // Track Stealthed - SPELL_AURA_MOD_DETECTED_RANGE = 152, // Mod Detected Range - SPELL_AURA_SPLIT_DAMAGE_FLAT = 153, // Split Damage Flat - SPELL_AURA_MOD_STEALTH_LEVEL = 154, // Stealth Level Modifier - SPELL_AURA_MOD_WATER_BREATHING = 155, // Mod Water Breathing - SPELL_AURA_MOD_REPUTATION_GAIN = 156, // Mod Reputation Gain - SPELL_AURA_PET_DAMAGE_MULTI = 157, // Mod Pet Damage - SPELL_AURA_MOD_SHIELD_BLOCKVALUE = 158, - SPELL_AURA_NO_PVP_CREDIT = 159, - SPELL_AURA_MOD_AOE_AVOIDANCE = 160, - SPELL_AURA_MOD_HEALTH_REGEN_IN_COMBAT = 161, - SPELL_AURA_POWER_BURN = 162, - SPELL_AURA_MOD_CRIT_DAMAGE_BONUS = 163, - SPELL_AURA_164 = 164, - SPELL_AURA_MELEE_ATTACK_POWER_ATTACKER_BONUS = 165, - SPELL_AURA_MOD_ATTACK_POWER_PCT = 166, - SPELL_AURA_MOD_RANGED_ATTACK_POWER_PCT = 167, - SPELL_AURA_MOD_DAMAGE_DONE_VERSUS = 168, - SPELL_AURA_MOD_CRIT_PERCENT_VERSUS = 169, - SPELL_AURA_DETECT_AMORE = 170, - SPELL_AURA_MOD_SPEED_NOT_STACK = 171, - SPELL_AURA_MOD_MOUNTED_SPEED_NOT_STACK = 172, - SPELL_AURA_173 = 173, // old SPELL_AURA_ALLOW_CHAMPION_SPELLS - SPELL_AURA_MOD_SPELL_DAMAGE_OF_STAT_PERCENT = 174, // by defeult intelect, dependent from SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT - SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT = 175, - SPELL_AURA_SPIRIT_OF_REDEMPTION = 176, - SPELL_AURA_AOE_CHARM = 177, - SPELL_AURA_MOD_DEBUFF_RESISTANCE = 178, - SPELL_AURA_MOD_ATTACKER_SPELL_CRIT_CHANCE = 179, - SPELL_AURA_MOD_FLAT_SPELL_DAMAGE_VERSUS = 180, - SPELL_AURA_181 = 181, // old SPELL_AURA_MOD_FLAT_SPELL_CRIT_DAMAGE_VERSUS - possible flat spell crit damage versus - SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT = 182, - SPELL_AURA_MOD_CRITICAL_THREAT = 183, - SPELL_AURA_MOD_ATTACKER_MELEE_HIT_CHANCE = 184, - SPELL_AURA_MOD_ATTACKER_RANGED_HIT_CHANCE= 185, - SPELL_AURA_MOD_ATTACKER_SPELL_HIT_CHANCE = 186, - SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_CHANCE = 187, - SPELL_AURA_MOD_ATTACKER_RANGED_CRIT_CHANCE = 188, - SPELL_AURA_MOD_RATING = 189, - SPELL_AURA_MOD_FACTION_REPUTATION_GAIN = 190, - SPELL_AURA_USE_NORMAL_MOVEMENT_SPEED = 191, - SPELL_AURA_MOD_MELEE_RANGED_HASTE = 192, - SPELL_AURA_MELEE_SLOW = 193, - SPELL_AURA_MOD_TARGET_ABSORB_SCHOOL = 194, - SPELL_AURA_MOD_TARGET_ABILITY_ABSORB_SCHOOL = 195, - SPELL_AURA_MOD_COOLDOWN = 196, // only 24818 Noxious Breath - SPELL_AURA_MOD_ATTACKER_SPELL_AND_WEAPON_CRIT_CHANCE = 197, - SPELL_AURA_198 = 198, // old SPELL_AURA_MOD_ALL_WEAPON_SKILLS - SPELL_AURA_MOD_INCREASES_SPELL_PCT_TO_HIT = 199, - SPELL_AURA_MOD_XP_PCT = 200, - SPELL_AURA_FLY = 201, - SPELL_AURA_IGNORE_COMBAT_RESULT = 202, - SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_DAMAGE = 203, - SPELL_AURA_MOD_ATTACKER_RANGED_CRIT_DAMAGE = 204, - SPELL_AURA_MOD_SCHOOL_CRIT_DMG_TAKEN = 205, - SPELL_AURA_MOD_INCREASE_VEHICLE_FLIGHT_SPEED = 206, - SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED = 207, - SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED = 208, - SPELL_AURA_MOD_MOUNTED_FLIGHT_SPEED_ALWAYS = 209, - SPELL_AURA_MOD_VEHICLE_SPEED_ALWAYS = 210, - SPELL_AURA_MOD_FLIGHT_SPEED_NOT_STACK = 211, - SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT = 212, - SPELL_AURA_MOD_RAGE_FROM_DAMAGE_DEALT = 213, - SPELL_AURA_214 = 214, - SPELL_AURA_ARENA_PREPARATION = 215, - SPELL_AURA_HASTE_SPELLS = 216, - SPELL_AURA_MOD_MELEE_HASTE_2 = 217, // NYI - SPELL_AURA_HASTE_RANGED = 218, - SPELL_AURA_MOD_MANA_REGEN_FROM_STAT = 219, - SPELL_AURA_MOD_RATING_FROM_STAT = 220, - SPELL_AURA_MOD_DETAUNT = 221, - SPELL_AURA_222 = 222, - SPELL_AURA_RAID_PROC_FROM_CHARGE = 223, - SPELL_AURA_224 = 224, - SPELL_AURA_RAID_PROC_FROM_CHARGE_WITH_VALUE = 225, - SPELL_AURA_PERIODIC_DUMMY = 226, - SPELL_AURA_PERIODIC_TRIGGER_SPELL_WITH_VALUE = 227, - SPELL_AURA_DETECT_STEALTH = 228, - SPELL_AURA_MOD_AOE_DAMAGE_AVOIDANCE = 229, - SPELL_AURA_230 = 230, - SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE = 231, - SPELL_AURA_MECHANIC_DURATION_MOD = 232, - SPELL_AURA_CHANGE_MODEL_FOR_ALL_HUMANOIDS = 233, // client-side only - SPELL_AURA_MECHANIC_DURATION_MOD_NOT_STACK = 234, - SPELL_AURA_MOD_DISPEL_RESIST = 235, - SPELL_AURA_CONTROL_VEHICLE = 236, - SPELL_AURA_MOD_SPELL_DAMAGE_OF_ATTACK_POWER = 237, - SPELL_AURA_MOD_SPELL_HEALING_OF_ATTACK_POWER = 238, - SPELL_AURA_MOD_SCALE_2 = 239, - SPELL_AURA_MOD_EXPERTISE = 240, - SPELL_AURA_FORCE_MOVE_FORWARD = 241, - SPELL_AURA_MOD_SPELL_DAMAGE_FROM_HEALING = 242, - SPELL_AURA_MOD_FACTION = 243, - SPELL_AURA_COMPREHEND_LANGUAGE = 244, - SPELL_AURA_MOD_AURA_DURATION_BY_DISPEL = 245, - SPELL_AURA_MOD_AURA_DURATION_BY_DISPEL_NOT_STACK = 246, - SPELL_AURA_CLONE_CASTER = 247, - SPELL_AURA_MOD_COMBAT_RESULT_CHANCE = 248, - SPELL_AURA_CONVERT_RUNE = 249, - SPELL_AURA_MOD_INCREASE_HEALTH_2 = 250, - SPELL_AURA_MOD_ENEMY_DODGE = 251, - SPELL_AURA_MOD_SPEED_SLOW_ALL = 252, - SPELL_AURA_MOD_BLOCK_CRIT_CHANCE = 253, - SPELL_AURA_MOD_DISARM_OFFHAND = 254, - SPELL_AURA_MOD_MECHANIC_DAMAGE_TAKEN_PERCENT = 255, - SPELL_AURA_NO_REAGENT_USE = 256, - SPELL_AURA_MOD_TARGET_RESIST_BY_SPELL_CLASS = 257, - SPELL_AURA_258 = 258, - SPELL_AURA_MOD_HOT_PCT = 259, - SPELL_AURA_SCREEN_EFFECT = 260, - SPELL_AURA_PHASE = 261, - SPELL_AURA_ABILITY_IGNORE_AURASTATE = 262, - SPELL_AURA_ALLOW_ONLY_ABILITY = 263, - SPELL_AURA_264 = 264, - SPELL_AURA_265 = 265, - SPELL_AURA_266 = 266, - SPELL_AURA_MOD_IMMUNE_AURA_APPLY_SCHOOL = 267, - SPELL_AURA_MOD_ATTACK_POWER_OF_STAT_PERCENT = 268, - SPELL_AURA_MOD_IGNORE_TARGET_RESIST = 269, - SPELL_AURA_MOD_ABILITY_IGNORE_TARGET_RESIST = 270, // Possibly need swap vs 195 aura used only in 1 spell Chaos Bolt Passive - SPELL_AURA_MOD_DAMAGE_FROM_CASTER = 271, - SPELL_AURA_IGNORE_MELEE_RESET = 272, - SPELL_AURA_X_RAY = 273, - SPELL_AURA_ABILITY_CONSUME_NO_AMMO = 274, - SPELL_AURA_MOD_IGNORE_SHAPESHIFT = 275, - SPELL_AURA_MOD_DAMAGE_DONE_FOR_MECHANIC = 276, // NYI - SPELL_AURA_MOD_MAX_AFFECTED_TARGETS = 277, - SPELL_AURA_MOD_DISARM_RANGED = 278, - SPELL_AURA_INITIALIZE_IMAGES = 279, - SPELL_AURA_MOD_ARMOR_PENETRATION_PCT = 280, - SPELL_AURA_MOD_HONOR_GAIN_PCT = 281, - SPELL_AURA_MOD_BASE_HEALTH_PCT = 282, - SPELL_AURA_MOD_HEALING_RECEIVED = 283, // Possibly only for some spell family class spells - SPELL_AURA_LINKED = 284, - SPELL_AURA_MOD_ATTACK_POWER_OF_ARMOR = 285, - SPELL_AURA_ABILITY_PERIODIC_CRIT = 286, - SPELL_AURA_DEFLECT_SPELLS = 287, - SPELL_AURA_IGNORE_HIT_DIRECTION = 288, - SPELL_AURA_289 = 289, - SPELL_AURA_MOD_CRIT_PCT = 290, - SPELL_AURA_MOD_XP_QUEST_PCT = 291, - SPELL_AURA_OPEN_STABLE = 292, - SPELL_AURA_OVERRIDE_SPELLS = 293, - SPELL_AURA_PREVENT_REGENERATE_POWER = 294, - SPELL_AURA_295 = 295, - SPELL_AURA_SET_VEHICLE_ID = 296, - SPELL_AURA_BLOCK_SPELL_FAMILY = 297, - SPELL_AURA_STRANGULATE = 298, - SPELL_AURA_299 = 299, - SPELL_AURA_SHARE_DAMAGE_PCT = 300, - SPELL_AURA_SCHOOL_HEAL_ABSORB = 301, - SPELL_AURA_302 = 302, - SPELL_AURA_MOD_DAMAGE_DONE_VERSUS_AURASTATE = 303, - SPELL_AURA_MOD_FAKE_INEBRIATE = 304, - SPELL_AURA_MOD_MINIMUM_SPEED = 305, - SPELL_AURA_306 = 306, - SPELL_AURA_HEAL_ABSORB_TEST = 307, - SPELL_AURA_MOD_CRIT_CHANCE_FOR_CASTER = 308, // NYI - SPELL_AURA_309 = 309, - SPELL_AURA_MOD_CREATURE_AOE_DAMAGE_AVOIDANCE = 310, - SPELL_AURA_311 = 311, - SPELL_AURA_312 = 312, - SPELL_AURA_313 = 313, - SPELL_AURA_PREVENT_RESURRECTION = 314, - SPELL_AURA_UNDERWATER_WALKING = 315, - SPELL_AURA_PERIODIC_HASTE = 316, - TOTAL_AURAS = 317 + SPELL_AURA_NONE = 0, + SPELL_AURA_BIND_SIGHT = 1, + SPELL_AURA_MOD_POSSESS = 2, + SPELL_AURA_PERIODIC_DAMAGE = 3, + SPELL_AURA_DUMMY = 4, + SPELL_AURA_MOD_CONFUSE = 5, + SPELL_AURA_MOD_CHARM = 6, + SPELL_AURA_MOD_FEAR = 7, + SPELL_AURA_PERIODIC_HEAL = 8, + SPELL_AURA_MOD_ATTACKSPEED = 9, + SPELL_AURA_MOD_THREAT = 10, + SPELL_AURA_MOD_TAUNT = 11, + SPELL_AURA_MOD_STUN = 12, + SPELL_AURA_MOD_DAMAGE_DONE = 13, + SPELL_AURA_MOD_DAMAGE_TAKEN = 14, + SPELL_AURA_DAMAGE_SHIELD = 15, + SPELL_AURA_MOD_STEALTH = 16, + SPELL_AURA_MOD_STEALTH_DETECT = 17, + SPELL_AURA_MOD_INVISIBILITY = 18, + SPELL_AURA_MOD_INVISIBILITY_DETECT = 19, + SPELL_AURA_OBS_MOD_HEALTH = 20, // 20, 21 unofficial + SPELL_AURA_OBS_MOD_POWER = 21, + SPELL_AURA_MOD_RESISTANCE = 22, + SPELL_AURA_PERIODIC_TRIGGER_SPELL = 23, + SPELL_AURA_PERIODIC_ENERGIZE = 24, + SPELL_AURA_MOD_PACIFY = 25, + SPELL_AURA_MOD_ROOT = 26, + SPELL_AURA_MOD_SILENCE = 27, + SPELL_AURA_REFLECT_SPELLS = 28, + SPELL_AURA_MOD_STAT = 29, + SPELL_AURA_MOD_SKILL = 30, + SPELL_AURA_MOD_INCREASE_SPEED = 31, + SPELL_AURA_MOD_INCREASE_MOUNTED_SPEED = 32, + SPELL_AURA_MOD_DECREASE_SPEED = 33, + SPELL_AURA_MOD_INCREASE_HEALTH = 34, + SPELL_AURA_MOD_INCREASE_ENERGY = 35, + SPELL_AURA_MOD_SHAPESHIFT = 36, + SPELL_AURA_EFFECT_IMMUNITY = 37, + SPELL_AURA_STATE_IMMUNITY = 38, + SPELL_AURA_SCHOOL_IMMUNITY = 39, + SPELL_AURA_DAMAGE_IMMUNITY = 40, + SPELL_AURA_DISPEL_IMMUNITY = 41, + SPELL_AURA_PROC_TRIGGER_SPELL = 42, + SPELL_AURA_PROC_TRIGGER_DAMAGE = 43, + SPELL_AURA_TRACK_CREATURES = 44, + SPELL_AURA_TRACK_RESOURCES = 45, + SPELL_AURA_46 = 46, // Ignore all Gear test spells + SPELL_AURA_MOD_PARRY_PERCENT = 47, + SPELL_AURA_48 = 48, // One periodic spell + SPELL_AURA_MOD_DODGE_PERCENT = 49, + SPELL_AURA_MOD_CRITICAL_HEALING_AMOUNT = 50, + SPELL_AURA_MOD_BLOCK_PERCENT = 51, + SPELL_AURA_MOD_WEAPON_CRIT_PERCENT = 52, + SPELL_AURA_PERIODIC_LEECH = 53, + SPELL_AURA_MOD_HIT_CHANCE = 54, + SPELL_AURA_MOD_SPELL_HIT_CHANCE = 55, + SPELL_AURA_TRANSFORM = 56, + SPELL_AURA_MOD_SPELL_CRIT_CHANCE = 57, + SPELL_AURA_MOD_INCREASE_SWIM_SPEED = 58, + SPELL_AURA_MOD_DAMAGE_DONE_CREATURE = 59, + SPELL_AURA_MOD_PACIFY_SILENCE = 60, + SPELL_AURA_MOD_SCALE = 61, + SPELL_AURA_PERIODIC_HEALTH_FUNNEL = 62, + SPELL_AURA_63 = 63, // old SPELL_AURA_PERIODIC_MANA_FUNNEL + SPELL_AURA_PERIODIC_MANA_LEECH = 64, + SPELL_AURA_MOD_CASTING_SPEED_NOT_STACK = 65, + SPELL_AURA_FEIGN_DEATH = 66, + SPELL_AURA_MOD_DISARM = 67, + SPELL_AURA_MOD_STALKED = 68, + SPELL_AURA_SCHOOL_ABSORB = 69, + SPELL_AURA_EXTRA_ATTACKS = 70, + SPELL_AURA_MOD_SPELL_CRIT_CHANCE_SCHOOL = 71, + SPELL_AURA_MOD_POWER_COST_SCHOOL_PCT = 72, + SPELL_AURA_MOD_POWER_COST_SCHOOL = 73, + SPELL_AURA_REFLECT_SPELLS_SCHOOL = 74, + SPELL_AURA_MOD_LANGUAGE = 75, + SPELL_AURA_FAR_SIGHT = 76, + SPELL_AURA_MECHANIC_IMMUNITY = 77, + SPELL_AURA_MOUNTED = 78, + SPELL_AURA_MOD_DAMAGE_PERCENT_DONE = 79, + SPELL_AURA_MOD_PERCENT_STAT = 80, + SPELL_AURA_SPLIT_DAMAGE_PCT = 81, + SPELL_AURA_WATER_BREATHING = 82, + SPELL_AURA_MOD_BASE_RESISTANCE = 83, + SPELL_AURA_MOD_REGEN = 84, + SPELL_AURA_MOD_POWER_REGEN = 85, + SPELL_AURA_CHANNEL_DEATH_ITEM = 86, + SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN = 87, + SPELL_AURA_MOD_HEALTH_REGEN_PERCENT = 88, + SPELL_AURA_PERIODIC_DAMAGE_PERCENT = 89, + SPELL_AURA_90 = 90, // old SPELL_AURA_MOD_RESIST_CHANCE + SPELL_AURA_MOD_DETECT_RANGE = 91, + SPELL_AURA_PREVENTS_FLEEING = 92, + SPELL_AURA_MOD_UNATTACKABLE = 93, + SPELL_AURA_INTERRUPT_REGEN = 94, + SPELL_AURA_GHOST = 95, + SPELL_AURA_SPELL_MAGNET = 96, + SPELL_AURA_MANA_SHIELD = 97, + SPELL_AURA_MOD_SKILL_TALENT = 98, + SPELL_AURA_MOD_ATTACK_POWER = 99, + SPELL_AURA_AURAS_VISIBLE = 100, + SPELL_AURA_MOD_RESISTANCE_PCT = 101, + SPELL_AURA_MOD_MELEE_ATTACK_POWER_VERSUS = 102, + SPELL_AURA_MOD_TOTAL_THREAT = 103, + SPELL_AURA_WATER_WALK = 104, + SPELL_AURA_FEATHER_FALL = 105, + SPELL_AURA_HOVER = 106, + SPELL_AURA_ADD_FLAT_MODIFIER = 107, + SPELL_AURA_ADD_PCT_MODIFIER = 108, + SPELL_AURA_ADD_TARGET_TRIGGER = 109, + SPELL_AURA_MOD_POWER_REGEN_PERCENT = 110, + SPELL_AURA_ADD_CASTER_HIT_TRIGGER = 111, + SPELL_AURA_OVERRIDE_CLASS_SCRIPTS = 112, + SPELL_AURA_MOD_RANGED_DAMAGE_TAKEN = 113, + SPELL_AURA_MOD_RANGED_DAMAGE_TAKEN_PCT = 114, + SPELL_AURA_MOD_HEALING = 115, + SPELL_AURA_MOD_REGEN_DURING_COMBAT = 116, + SPELL_AURA_MOD_MECHANIC_RESISTANCE = 117, + SPELL_AURA_MOD_HEALING_PCT = 118, + SPELL_AURA_119 = 119, // old SPELL_AURA_SHARE_PET_TRACKING + SPELL_AURA_UNTRACKABLE = 120, + SPELL_AURA_EMPATHY = 121, + SPELL_AURA_MOD_OFFHAND_DAMAGE_PCT = 122, + SPELL_AURA_MOD_TARGET_RESISTANCE = 123, + SPELL_AURA_MOD_RANGED_ATTACK_POWER = 124, + SPELL_AURA_MOD_MELEE_DAMAGE_TAKEN = 125, + SPELL_AURA_MOD_MELEE_DAMAGE_TAKEN_PCT = 126, + SPELL_AURA_RANGED_ATTACK_POWER_ATTACKER_BONUS = 127, + SPELL_AURA_MOD_POSSESS_PET = 128, + SPELL_AURA_MOD_SPEED_ALWAYS = 129, + SPELL_AURA_MOD_MOUNTED_SPEED_ALWAYS = 130, + SPELL_AURA_MOD_RANGED_ATTACK_POWER_VERSUS = 131, + SPELL_AURA_MOD_INCREASE_ENERGY_PERCENT = 132, + SPELL_AURA_MOD_INCREASE_HEALTH_PERCENT = 133, + SPELL_AURA_MOD_MANA_REGEN_INTERRUPT = 134, + SPELL_AURA_MOD_HEALING_DONE = 135, + SPELL_AURA_MOD_HEALING_DONE_PERCENT = 136, + SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE = 137, + SPELL_AURA_MOD_MELEE_HASTE = 138, + SPELL_AURA_FORCE_REACTION = 139, + SPELL_AURA_MOD_RANGED_HASTE = 140, + SPELL_AURA_MOD_RANGED_AMMO_HASTE = 141, + SPELL_AURA_MOD_BASE_RESISTANCE_PCT = 142, + SPELL_AURA_MOD_RESISTANCE_EXCLUSIVE = 143, + SPELL_AURA_SAFE_FALL = 144, + SPELL_AURA_MOD_PET_TALENT_POINTS = 145, + SPELL_AURA_ALLOW_TAME_PET_TYPE = 146, + SPELL_AURA_MECHANIC_IMMUNITY_MASK = 147, + SPELL_AURA_RETAIN_COMBO_POINTS = 148, + SPELL_AURA_REDUCE_PUSHBACK = 149, // Reduce Pushback + SPELL_AURA_MOD_SHIELD_BLOCKVALUE_PCT = 150, + SPELL_AURA_TRACK_STEALTHED = 151, // Track Stealthed + SPELL_AURA_MOD_DETECTED_RANGE = 152, // Mod Detected Range + SPELL_AURA_SPLIT_DAMAGE_FLAT = 153, // Split Damage Flat + SPELL_AURA_MOD_STEALTH_LEVEL = 154, // Stealth Level Modifier + SPELL_AURA_MOD_WATER_BREATHING = 155, // Mod Water Breathing + SPELL_AURA_MOD_REPUTATION_GAIN = 156, // Mod Reputation Gain + SPELL_AURA_PET_DAMAGE_MULTI = 157, // Mod Pet Damage + SPELL_AURA_MOD_SHIELD_BLOCKVALUE = 158, + SPELL_AURA_NO_PVP_CREDIT = 159, + SPELL_AURA_MOD_AOE_AVOIDANCE = 160, + SPELL_AURA_MOD_HEALTH_REGEN_IN_COMBAT = 161, + SPELL_AURA_POWER_BURN = 162, + SPELL_AURA_MOD_CRIT_DAMAGE_BONUS = 163, + SPELL_AURA_164 = 164, + SPELL_AURA_MELEE_ATTACK_POWER_ATTACKER_BONUS = 165, + SPELL_AURA_MOD_ATTACK_POWER_PCT = 166, + SPELL_AURA_MOD_RANGED_ATTACK_POWER_PCT = 167, + SPELL_AURA_MOD_DAMAGE_DONE_VERSUS = 168, + SPELL_AURA_MOD_CRIT_PERCENT_VERSUS = 169, + SPELL_AURA_DETECT_AMORE = 170, + SPELL_AURA_MOD_SPEED_NOT_STACK = 171, + SPELL_AURA_MOD_MOUNTED_SPEED_NOT_STACK = 172, + SPELL_AURA_173 = 173, // old SPELL_AURA_ALLOW_CHAMPION_SPELLS + SPELL_AURA_MOD_SPELL_DAMAGE_OF_STAT_PERCENT = 174, // by defeult intelect, dependent from SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT + SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT = 175, + SPELL_AURA_SPIRIT_OF_REDEMPTION = 176, + SPELL_AURA_AOE_CHARM = 177, + SPELL_AURA_MOD_DEBUFF_RESISTANCE = 178, + SPELL_AURA_MOD_ATTACKER_SPELL_CRIT_CHANCE = 179, + SPELL_AURA_MOD_FLAT_SPELL_DAMAGE_VERSUS = 180, + SPELL_AURA_181 = 181, // old SPELL_AURA_MOD_FLAT_SPELL_CRIT_DAMAGE_VERSUS - possible flat spell crit damage versus + SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT = 182, + SPELL_AURA_MOD_CRITICAL_THREAT = 183, + SPELL_AURA_MOD_ATTACKER_MELEE_HIT_CHANCE = 184, + SPELL_AURA_MOD_ATTACKER_RANGED_HIT_CHANCE = 185, + SPELL_AURA_MOD_ATTACKER_SPELL_HIT_CHANCE = 186, + SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_CHANCE = 187, + SPELL_AURA_MOD_ATTACKER_RANGED_CRIT_CHANCE = 188, + SPELL_AURA_MOD_RATING = 189, + SPELL_AURA_MOD_FACTION_REPUTATION_GAIN = 190, + SPELL_AURA_USE_NORMAL_MOVEMENT_SPEED = 191, + SPELL_AURA_MOD_MELEE_RANGED_HASTE = 192, + SPELL_AURA_MELEE_SLOW = 193, + SPELL_AURA_MOD_TARGET_ABSORB_SCHOOL = 194, + SPELL_AURA_MOD_TARGET_ABILITY_ABSORB_SCHOOL = 195, + SPELL_AURA_MOD_COOLDOWN = 196, // only 24818 Noxious Breath + SPELL_AURA_MOD_ATTACKER_SPELL_AND_WEAPON_CRIT_CHANCE = 197, + SPELL_AURA_198 = 198, // old SPELL_AURA_MOD_ALL_WEAPON_SKILLS + SPELL_AURA_MOD_INCREASES_SPELL_PCT_TO_HIT = 199, + SPELL_AURA_MOD_XP_PCT = 200, + SPELL_AURA_FLY = 201, + SPELL_AURA_IGNORE_COMBAT_RESULT = 202, + SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_DAMAGE = 203, + SPELL_AURA_MOD_ATTACKER_RANGED_CRIT_DAMAGE = 204, + SPELL_AURA_MOD_SCHOOL_CRIT_DMG_TAKEN = 205, + SPELL_AURA_MOD_INCREASE_VEHICLE_FLIGHT_SPEED = 206, + SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED = 207, + SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED = 208, + SPELL_AURA_MOD_MOUNTED_FLIGHT_SPEED_ALWAYS = 209, + SPELL_AURA_MOD_VEHICLE_SPEED_ALWAYS = 210, + SPELL_AURA_MOD_FLIGHT_SPEED_NOT_STACK = 211, + SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT = 212, + SPELL_AURA_MOD_RAGE_FROM_DAMAGE_DEALT = 213, + SPELL_AURA_214 = 214, + SPELL_AURA_ARENA_PREPARATION = 215, + SPELL_AURA_HASTE_SPELLS = 216, + SPELL_AURA_MOD_MELEE_HASTE_2 = 217, // NYI + SPELL_AURA_HASTE_RANGED = 218, + SPELL_AURA_MOD_MANA_REGEN_FROM_STAT = 219, + SPELL_AURA_MOD_RATING_FROM_STAT = 220, + SPELL_AURA_MOD_DETAUNT = 221, + SPELL_AURA_222 = 222, + SPELL_AURA_RAID_PROC_FROM_CHARGE = 223, + SPELL_AURA_224 = 224, + SPELL_AURA_RAID_PROC_FROM_CHARGE_WITH_VALUE = 225, + SPELL_AURA_PERIODIC_DUMMY = 226, + SPELL_AURA_PERIODIC_TRIGGER_SPELL_WITH_VALUE = 227, + SPELL_AURA_DETECT_STEALTH = 228, + SPELL_AURA_MOD_AOE_DAMAGE_AVOIDANCE = 229, + SPELL_AURA_230 = 230, + SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE = 231, + SPELL_AURA_MECHANIC_DURATION_MOD = 232, + SPELL_AURA_CHANGE_MODEL_FOR_ALL_HUMANOIDS = 233, // client-side only + SPELL_AURA_MECHANIC_DURATION_MOD_NOT_STACK = 234, + SPELL_AURA_MOD_DISPEL_RESIST = 235, + SPELL_AURA_CONTROL_VEHICLE = 236, + SPELL_AURA_MOD_SPELL_DAMAGE_OF_ATTACK_POWER = 237, + SPELL_AURA_MOD_SPELL_HEALING_OF_ATTACK_POWER = 238, + SPELL_AURA_MOD_SCALE_2 = 239, + SPELL_AURA_MOD_EXPERTISE = 240, + SPELL_AURA_FORCE_MOVE_FORWARD = 241, + SPELL_AURA_MOD_SPELL_DAMAGE_FROM_HEALING = 242, + SPELL_AURA_MOD_FACTION = 243, + SPELL_AURA_COMPREHEND_LANGUAGE = 244, + SPELL_AURA_MOD_AURA_DURATION_BY_DISPEL = 245, + SPELL_AURA_MOD_AURA_DURATION_BY_DISPEL_NOT_STACK = 246, + SPELL_AURA_CLONE_CASTER = 247, + SPELL_AURA_MOD_COMBAT_RESULT_CHANCE = 248, + SPELL_AURA_CONVERT_RUNE = 249, + SPELL_AURA_MOD_INCREASE_HEALTH_2 = 250, + SPELL_AURA_MOD_ENEMY_DODGE = 251, + SPELL_AURA_MOD_SPEED_SLOW_ALL = 252, + SPELL_AURA_MOD_BLOCK_CRIT_CHANCE = 253, + SPELL_AURA_MOD_DISARM_OFFHAND = 254, + SPELL_AURA_MOD_MECHANIC_DAMAGE_TAKEN_PERCENT = 255, + SPELL_AURA_NO_REAGENT_USE = 256, + SPELL_AURA_MOD_TARGET_RESIST_BY_SPELL_CLASS = 257, + SPELL_AURA_258 = 258, + SPELL_AURA_MOD_HOT_PCT = 259, + SPELL_AURA_SCREEN_EFFECT = 260, + SPELL_AURA_PHASE = 261, + SPELL_AURA_ABILITY_IGNORE_AURASTATE = 262, + SPELL_AURA_ALLOW_ONLY_ABILITY = 263, + SPELL_AURA_264 = 264, + SPELL_AURA_265 = 265, + SPELL_AURA_266 = 266, + SPELL_AURA_MOD_IMMUNE_AURA_APPLY_SCHOOL = 267, + SPELL_AURA_MOD_ATTACK_POWER_OF_STAT_PERCENT = 268, + SPELL_AURA_MOD_IGNORE_TARGET_RESIST = 269, + SPELL_AURA_MOD_ABILITY_IGNORE_TARGET_RESIST = 270, // Possibly need swap vs 195 aura used only in 1 spell Chaos Bolt Passive + SPELL_AURA_MOD_DAMAGE_FROM_CASTER = 271, + SPELL_AURA_IGNORE_MELEE_RESET = 272, + SPELL_AURA_X_RAY = 273, + SPELL_AURA_ABILITY_CONSUME_NO_AMMO = 274, + SPELL_AURA_MOD_IGNORE_SHAPESHIFT = 275, + SPELL_AURA_MOD_DAMAGE_DONE_FOR_MECHANIC = 276, // NYI + SPELL_AURA_MOD_MAX_AFFECTED_TARGETS = 277, + SPELL_AURA_MOD_DISARM_RANGED = 278, + SPELL_AURA_INITIALIZE_IMAGES = 279, + SPELL_AURA_MOD_ARMOR_PENETRATION_PCT = 280, + SPELL_AURA_MOD_HONOR_GAIN_PCT = 281, + SPELL_AURA_MOD_BASE_HEALTH_PCT = 282, + SPELL_AURA_MOD_HEALING_RECEIVED = 283, // Possibly only for some spell family class spells + SPELL_AURA_LINKED = 284, + SPELL_AURA_MOD_ATTACK_POWER_OF_ARMOR = 285, + SPELL_AURA_ABILITY_PERIODIC_CRIT = 286, + SPELL_AURA_DEFLECT_SPELLS = 287, + SPELL_AURA_IGNORE_HIT_DIRECTION = = 288, + SPELL_AURA_289 = 289, + SPELL_AURA_MOD_CRIT_PCT = 290, + SPELL_AURA_MOD_XP_QUEST_PCT = 291, + SPELL_AURA_OPEN_STABLE = 292, + SPELL_AURA_OVERRIDE_SPELLS = 293, + SPELL_AURA_PREVENT_REGENERATE_POWER = 294, + SPELL_AURA_295 = 295, + SPELL_AURA_SET_VEHICLE_ID = 296, + SPELL_AURA_BLOCK_SPELL_FAMILY = 297, + SPELL_AURA_STRANGULATE = 298, + SPELL_AURA_299 = 299, + SPELL_AURA_SHARE_DAMAGE_PCT = 300, + SPELL_AURA_SCHOOL_HEAL_ABSORB = 301, + SPELL_AURA_302 = 302, + SPELL_AURA_MOD_DAMAGE_DONE_VERSUS_AURASTATE = 303, + SPELL_AURA_MOD_FAKE_INEBRIATE = 304, + SPELL_AURA_MOD_MINIMUM_SPEED = 305, + SPELL_AURA_306 = 306, + SPELL_AURA_HEAL_ABSORB_TEST = 307, + SPELL_AURA_MOD_CRIT_CHANCE_FOR_CASTER = 308, // NYI + SPELL_AURA_309 = 309, + SPELL_AURA_MOD_CREATURE_AOE_DAMAGE_AVOIDANCE = 310, + SPELL_AURA_311 = 311, + SPELL_AURA_312 = 312, + SPELL_AURA_313 = 313, + SPELL_AURA_PREVENT_RESURRECTION = 314, + SPELL_AURA_UNDERWATER_WALKING = 315, + SPELL_AURA_PERIODIC_HASTE = 316, + TOTAL_AURAS = 317 }; enum AuraObjectType -- cgit v1.2.3 From 96df0d27e50231a702c78ec8e8de8cbc1d420d98 Mon Sep 17 00:00:00 2001 From: Shocker Date: Sat, 26 Nov 2011 22:19:07 +0200 Subject: Core/Spells: Research 4.x spell auras --- src/server/game/Spells/Auras/SpellAuraDefines.h | 39 ++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Spells/Auras/SpellAuraDefines.h b/src/server/game/Spells/Auras/SpellAuraDefines.h index febe303b1dc..4717c9c2819 100755 --- a/src/server/game/Spells/Auras/SpellAuraDefines.h +++ b/src/server/game/Spells/Auras/SpellAuraDefines.h @@ -376,7 +376,44 @@ enum AuraType SPELL_AURA_PREVENT_RESURRECTION = 314, SPELL_AURA_UNDERWATER_WALKING = 315, SPELL_AURA_PERIODIC_HASTE = 316, - TOTAL_AURAS = 317 + SPELL_AURA_MOD_SPELL_POWER_PCT = 317, + SPELL_AURA_MASTERY = 318, + SPELL_AURA_319 = 319, // (melee?) attack speed + SPELL_AURA_MOD_RANGED_ATTACK_SPEED = 320, // NYI + SPELL_AURA_321 = 321, + SPELL_AURA_INTERFERE_TARGETTING = 322, // NYI + SPELL_AURA_323 = 323, + SPELL_AURA_324 = 324, // spell critical chance (probably by school mask) + SPELL_AURA_325 = 325, + SPELL_AURA_326 = 326, // phase related + SPELL_AURA_327 = 327, + SPELL_AURA_328 = 328, + SPELL_AURA_MOD_RUNE_REGEN_SPEED = 329, // NYI + SPELL_AURA_CAST_WHILE_WALKING = 330, // NYI + SPELL_AURA_331 = 331, + SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS = 332, // NYI + SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS_2 = 333, // NYI + SPELL_AURA_334 = 334, + SPELL_AURA_335 = 335, + SPELL_AURA_MOD_FLYING_RESTRICTIONS = 336, // NYI + SPELL_AURA_MOD_VENDOR_ITEMS_PRICES = 337, // NYI + SPELL_AURA_MOD_DURABILITY_LOSS = 338, // NYI + SPELL_AURA_INCREASE_SKILL_GAIN_CHANCE = 339, // NYI + SPELL_AURA_340 = 340, + SPELL_AURA_341 = 341, // cooldown decrease + SPELL_AURA_MOD_TIME_BETWEEN_ATTACKS = 342, // (attack speed) NYI + SPELL_AURA_343 = 343, + SPELL_AURA_MOD_AUTOATTACK_DAMAGE = 344, // (white damage) NYI + SPELL_AURA_MOD_BYPASS_ARMOR_FOR_CASTER = 345, // NYI + SPELL_AURA_PROGRESS_BAR = 346, // NYI + SPELL_AURA_MOD_SPELL_COOLDOWN_BY_HASTE = 347, // NYI + SPELL_AURA_DEPOSIT_BONUS_MONEY_IN_GUILD_BANK_ON_LOOT = 348, // NYI + SPELL_AURA_MOD_CURRENCY_GAIN = 349, // NYI + SPELL_AURA_MOD_GATHERING_ITEMS_GAINED_PERCENT = 350, // NYI + SPELL_AURA_351 = 351, + SPELL_AURA_352 = 352, + SPELL_AURA_MOD_CAMOUFLAGE = 353, // NYI + TOTAL_AURAS = 354 }; enum AuraObjectType -- cgit v1.2.3 From 35579e574c53f53e0fe41c6abfd0c24451b8f936 Mon Sep 17 00:00:00 2001 From: Rat Date: Sat, 26 Nov 2011 21:21:31 +0100 Subject: Core/DB: fixed player loading from DB --- src/server/game/Entities/Player/Player.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index bc3a1be7ff9..ff2daa14589 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -16520,7 +16520,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) SetInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, fields[48].GetUInt32()); // set which actionbars the client has active - DO NOT REMOVE EVER AGAIN (can be changed though, if it does change fieldwise) - SetByteValue(PLAYER_FIELD_BYTES, 2, fields[62].GetUInt8()); + SetByteValue(PLAYER_FIELD_BYTES, 2, fields[60].GetUInt8()); InitDisplayIds(); -- cgit v1.2.3 From 784a2fa29ab025ce4cf36b3ff57b2892d525375d Mon Sep 17 00:00:00 2001 From: Shocker Date: Sat, 26 Nov 2011 22:22:11 +0200 Subject: Core/Spells: Implement SPELL_AURA_MOD_BYPASS_ARMOR_FOR_CASTER --- src/server/game/Entities/Unit/Unit.cpp | 8 ++++++++ src/server/game/Spells/Auras/SpellAuraDefines.h | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 87834d27f34..777a3a47f44 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -1490,6 +1490,14 @@ uint32 Unit::CalcArmorReducedDamage(Unit* victim, const uint32 damage, SpellInfo uint32 newdamage = 0; float armor = float(victim->GetArmor()); + // bypass enemy armor effectiveness by SPELL_AURA_BYPASS_ARMOR_FOR_CASTER + int32 auraEffectivenessReduction = 0; + AuraEffectList const & reductionAuras = victim->GetAuraEffectsByType(SPELL_AURA_BYPASS_ARMOR_FOR_CASTER); + for (AuraEffectList::const_iterator i = reductionAuras.begin(); i != reductionAuras.end(); ++i) + if ((*i)->GetCasterGUID() == GetGUID()) + auraEffectivenessReduction += (*i)->GetAmount(); + armor = CalculatePctN(armor, 100 - std::min(auraEffectivenessReduction, 100)); + // Ignore enemy armor by SPELL_AURA_MOD_TARGET_RESISTANCE aura armor += GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_TARGET_RESISTANCE, SPELL_SCHOOL_MASK_NORMAL); diff --git a/src/server/game/Spells/Auras/SpellAuraDefines.h b/src/server/game/Spells/Auras/SpellAuraDefines.h index 4717c9c2819..34c1f5f201d 100755 --- a/src/server/game/Spells/Auras/SpellAuraDefines.h +++ b/src/server/game/Spells/Auras/SpellAuraDefines.h @@ -404,7 +404,7 @@ enum AuraType SPELL_AURA_MOD_TIME_BETWEEN_ATTACKS = 342, // (attack speed) NYI SPELL_AURA_343 = 343, SPELL_AURA_MOD_AUTOATTACK_DAMAGE = 344, // (white damage) NYI - SPELL_AURA_MOD_BYPASS_ARMOR_FOR_CASTER = 345, // NYI + SPELL_AURA_BYPASS_ARMOR_FOR_CASTER = 345, SPELL_AURA_PROGRESS_BAR = 346, // NYI SPELL_AURA_MOD_SPELL_COOLDOWN_BY_HASTE = 347, // NYI SPELL_AURA_DEPOSIT_BONUS_MONEY_IN_GUILD_BANK_ON_LOOT = 348, // NYI -- cgit v1.2.3 From d228b76c56d0661a3b69b24f3cf7662e43ad8d0f Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 26 Nov 2011 20:27:38 +0000 Subject: Misc/Enums: SpellCastResult (SPELL_FAILED_X) updates --- src/server/game/Miscellaneous/SharedDefines.h | 394 ++++++++++++++------------ 1 file changed, 205 insertions(+), 189 deletions(-) (limited to 'src') diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 0e055acab4f..92aa906137b 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -833,195 +833,211 @@ enum SpellEffects enum SpellCastResult { - SPELL_FAILED_SUCCESS = 0, - SPELL_FAILED_AFFECTING_COMBAT = 1, - SPELL_FAILED_ALREADY_AT_FULL_HEALTH = 2, - SPELL_FAILED_ALREADY_AT_FULL_MANA = 3, - SPELL_FAILED_ALREADY_AT_FULL_POWER = 4, - SPELL_FAILED_ALREADY_BEING_TAMED = 5, - SPELL_FAILED_ALREADY_HAVE_CHARM = 6, - SPELL_FAILED_ALREADY_HAVE_SUMMON = 7, - SPELL_FAILED_ALREADY_OPEN = 8, - SPELL_FAILED_AURA_BOUNCED = 9, - SPELL_FAILED_AUTOTRACK_INTERRUPTED = 10, - SPELL_FAILED_BAD_IMPLICIT_TARGETS = 11, - SPELL_FAILED_BAD_TARGETS = 12, - SPELL_FAILED_CANT_BE_CHARMED = 13, - SPELL_FAILED_CANT_BE_DISENCHANTED = 14, - SPELL_FAILED_CANT_BE_DISENCHANTED_SKILL = 15, - SPELL_FAILED_CANT_BE_MILLED = 16, - SPELL_FAILED_CANT_BE_PROSPECTED = 17, - SPELL_FAILED_CANT_CAST_ON_TAPPED = 18, - SPELL_FAILED_CANT_DUEL_WHILE_INVISIBLE = 19, - SPELL_FAILED_CANT_DUEL_WHILE_STEALTHED = 20, - SPELL_FAILED_CANT_STEALTH = 21, - SPELL_FAILED_CASTER_AURASTATE = 22, - SPELL_FAILED_CASTER_DEAD = 23, - SPELL_FAILED_CHARMED = 24, - SPELL_FAILED_CHEST_IN_USE = 25, - SPELL_FAILED_CONFUSED = 26, - SPELL_FAILED_DONT_REPORT = 27, - SPELL_FAILED_EQUIPPED_ITEM = 28, - SPELL_FAILED_EQUIPPED_ITEM_CLASS = 29, - SPELL_FAILED_EQUIPPED_ITEM_CLASS_MAINHAND = 30, - SPELL_FAILED_EQUIPPED_ITEM_CLASS_OFFHAND = 31, - SPELL_FAILED_ERROR = 32, - SPELL_FAILED_FIZZLE = 33, - SPELL_FAILED_FLEEING = 34, - SPELL_FAILED_FOOD_LOWLEVEL = 35, - SPELL_FAILED_HIGHLEVEL = 36, - SPELL_FAILED_HUNGER_SATIATED = 37, - SPELL_FAILED_IMMUNE = 38, - SPELL_FAILED_INCORRECT_AREA = 39, - SPELL_FAILED_INTERRUPTED = 40, - SPELL_FAILED_INTERRUPTED_COMBAT = 41, - SPELL_FAILED_ITEM_ALREADY_ENCHANTED = 42, - SPELL_FAILED_ITEM_GONE = 43, - SPELL_FAILED_ITEM_NOT_FOUND = 44, - SPELL_FAILED_ITEM_NOT_READY = 45, - SPELL_FAILED_LEVEL_REQUIREMENT = 46, - SPELL_FAILED_LINE_OF_SIGHT = 47, - SPELL_FAILED_LOWLEVEL = 48, - SPELL_FAILED_LOW_CASTLEVEL = 49, - SPELL_FAILED_MAINHAND_EMPTY = 50, - SPELL_FAILED_MOVING = 51, - SPELL_FAILED_NEED_AMMO = 52, - SPELL_FAILED_NEED_AMMO_POUCH = 53, - SPELL_FAILED_NEED_EXOTIC_AMMO = 54, - SPELL_FAILED_NEED_MORE_ITEMS = 55, - SPELL_FAILED_NOPATH = 56, - SPELL_FAILED_NOT_BEHIND = 57, - SPELL_FAILED_NOT_FISHABLE = 58, - SPELL_FAILED_NOT_FLYING = 59, - SPELL_FAILED_NOT_HERE = 60, - SPELL_FAILED_NOT_INFRONT = 61, - SPELL_FAILED_NOT_IN_CONTROL = 62, - SPELL_FAILED_NOT_KNOWN = 63, - SPELL_FAILED_NOT_MOUNTED = 64, - SPELL_FAILED_NOT_ON_TAXI = 65, - SPELL_FAILED_NOT_ON_TRANSPORT = 66, - SPELL_FAILED_NOT_READY = 67, - SPELL_FAILED_NOT_SHAPESHIFT = 68, - SPELL_FAILED_NOT_STANDING = 69, - SPELL_FAILED_NOT_TRADEABLE = 70, - SPELL_FAILED_NOT_TRADING = 71, - SPELL_FAILED_NOT_UNSHEATHED = 72, - SPELL_FAILED_NOT_WHILE_GHOST = 73, - SPELL_FAILED_NOT_WHILE_LOOTING = 74, - SPELL_FAILED_NO_AMMO = 75, - SPELL_FAILED_NO_CHARGES_REMAIN = 76, - SPELL_FAILED_NO_CHAMPION = 77, - SPELL_FAILED_NO_COMBO_POINTS = 78, - SPELL_FAILED_NO_DUELING = 79, - SPELL_FAILED_NO_ENDURANCE = 80, - SPELL_FAILED_NO_FISH = 81, - SPELL_FAILED_NO_ITEMS_WHILE_SHAPESHIFTED = 82, - SPELL_FAILED_NO_MOUNTS_ALLOWED = 83, - SPELL_FAILED_NO_PET = 84, - SPELL_FAILED_NO_POWER = 85, - SPELL_FAILED_NOTHING_TO_DISPEL = 86, - SPELL_FAILED_NOTHING_TO_STEAL = 87, - SPELL_FAILED_ONLY_ABOVEWATER = 88, - SPELL_FAILED_ONLY_DAYTIME = 89, - SPELL_FAILED_ONLY_INDOORS = 90, - SPELL_FAILED_ONLY_MOUNTED = 91, - SPELL_FAILED_ONLY_NIGHTTIME = 92, - SPELL_FAILED_ONLY_OUTDOORS = 93, - SPELL_FAILED_ONLY_SHAPESHIFT = 94, - SPELL_FAILED_ONLY_STEALTHED = 95, - SPELL_FAILED_ONLY_UNDERWATER = 96, - SPELL_FAILED_OUT_OF_RANGE = 97, - SPELL_FAILED_PACIFIED = 98, - SPELL_FAILED_POSSESSED = 99, - SPELL_FAILED_REAGENTS = 100, - SPELL_FAILED_REQUIRES_AREA = 101, - SPELL_FAILED_REQUIRES_SPELL_FOCUS = 102, - SPELL_FAILED_ROOTED = 103, - SPELL_FAILED_SILENCED = 104, - SPELL_FAILED_SPELL_IN_PROGRESS = 105, - SPELL_FAILED_SPELL_LEARNED = 106, - SPELL_FAILED_SPELL_UNAVAILABLE = 107, - SPELL_FAILED_STUNNED = 108, - SPELL_FAILED_TARGETS_DEAD = 109, - SPELL_FAILED_TARGET_AFFECTING_COMBAT = 110, - SPELL_FAILED_TARGET_AURASTATE = 111, - SPELL_FAILED_TARGET_DUELING = 112, - SPELL_FAILED_TARGET_ENEMY = 113, - SPELL_FAILED_TARGET_ENRAGED = 114, - SPELL_FAILED_TARGET_FRIENDLY = 115, - SPELL_FAILED_TARGET_IN_COMBAT = 116, - SPELL_FAILED_TARGET_IS_PLAYER = 117, - SPELL_FAILED_TARGET_IS_PLAYER_CONTROLLED = 118, - SPELL_FAILED_TARGET_NOT_DEAD = 119, - SPELL_FAILED_TARGET_NOT_IN_PARTY = 120, - SPELL_FAILED_TARGET_NOT_LOOTED = 121, - SPELL_FAILED_TARGET_NOT_PLAYER = 122, - SPELL_FAILED_TARGET_NO_POCKETS = 123, - SPELL_FAILED_TARGET_NO_WEAPONS = 124, - SPELL_FAILED_TARGET_NO_RANGED_WEAPONS = 125, - SPELL_FAILED_TARGET_UNSKINNABLE = 126, - SPELL_FAILED_THIRST_SATIATED = 127, - SPELL_FAILED_TOO_CLOSE = 128, - SPELL_FAILED_TOO_MANY_OF_ITEM = 129, - SPELL_FAILED_TOTEM_CATEGORY = 130, - SPELL_FAILED_TOTEMS = 131, - SPELL_FAILED_TRY_AGAIN = 132, - SPELL_FAILED_UNIT_NOT_BEHIND = 133, - SPELL_FAILED_UNIT_NOT_INFRONT = 134, - SPELL_FAILED_WRONG_PET_FOOD = 135, - SPELL_FAILED_NOT_WHILE_FATIGUED = 136, - SPELL_FAILED_TARGET_NOT_IN_INSTANCE = 137, - SPELL_FAILED_NOT_WHILE_TRADING = 138, - SPELL_FAILED_TARGET_NOT_IN_RAID = 139, - SPELL_FAILED_TARGET_FREEFORALL = 140, - SPELL_FAILED_NO_EDIBLE_CORPSES = 141, - SPELL_FAILED_ONLY_BATTLEGROUNDS = 142, - SPELL_FAILED_TARGET_NOT_GHOST = 143, - SPELL_FAILED_TRANSFORM_UNUSABLE = 144, - SPELL_FAILED_WRONG_WEATHER = 145, - SPELL_FAILED_DAMAGE_IMMUNE = 146, - SPELL_FAILED_PREVENTED_BY_MECHANIC = 147, - SPELL_FAILED_PLAY_TIME = 148, - SPELL_FAILED_REPUTATION = 149, - SPELL_FAILED_MIN_SKILL = 150, - SPELL_FAILED_NOT_IN_ARENA = 151, - SPELL_FAILED_NOT_ON_SHAPESHIFT = 152, - SPELL_FAILED_NOT_ON_STEALTHED = 153, - SPELL_FAILED_NOT_ON_DAMAGE_IMMUNE = 154, - SPELL_FAILED_NOT_ON_MOUNTED = 155, - SPELL_FAILED_TOO_SHALLOW = 156, - SPELL_FAILED_TARGET_NOT_IN_SANCTUARY = 157, - SPELL_FAILED_TARGET_IS_TRIVIAL = 158, - SPELL_FAILED_BM_OR_INVISGOD = 159, - SPELL_FAILED_EXPERT_RIDING_REQUIREMENT = 160, - SPELL_FAILED_ARTISAN_RIDING_REQUIREMENT = 161, - SPELL_FAILED_NOT_IDLE = 162, - SPELL_FAILED_NOT_INACTIVE = 163, - SPELL_FAILED_PARTIAL_PLAYTIME = 164, - SPELL_FAILED_NO_PLAYTIME = 165, - SPELL_FAILED_NOT_IN_BATTLEGROUND = 166, - SPELL_FAILED_NOT_IN_RAID_INSTANCE = 167, - SPELL_FAILED_ONLY_IN_ARENA = 168, - SPELL_FAILED_TARGET_LOCKED_TO_RAID_INSTANCE = 169, - SPELL_FAILED_ON_USE_ENCHANT = 170, - SPELL_FAILED_NOT_ON_GROUND = 171, - SPELL_FAILED_CUSTOM_ERROR = 172, - SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW = 173, - SPELL_FAILED_TOO_MANY_SOCKETS = 174, - SPELL_FAILED_INVALID_GLYPH = 175, - SPELL_FAILED_UNIQUE_GLYPH = 176, - SPELL_FAILED_GLYPH_SOCKET_LOCKED = 177, - SPELL_FAILED_NO_VALID_TARGETS = 178, - SPELL_FAILED_ITEM_AT_MAX_CHARGES = 179, - SPELL_FAILED_NOT_IN_BARBERSHOP = 180, - SPELL_FAILED_FISHING_TOO_LOW = 181, - SPELL_FAILED_ITEM_ENCHANT_TRADE_WINDOW = 182, - SPELL_FAILED_SUMMON_PENDING = 183, - SPELL_FAILED_MAX_SOCKETS = 184, - SPELL_FAILED_PET_CAN_RENAME = 185, - SPELL_FAILED_TARGET_CANNOT_BE_RESURRECTED = 186, - SPELL_FAILED_UNKNOWN = 187, // actually doesn't exist in client - + SPELL_FAILED_SUCCESS = 0, + SPELL_FAILED_AFFECTING_COMBAT = 1, + SPELL_FAILED_ALREADY_AT_FULL_HEALTH = 2, + SPELL_FAILED_ALREADY_AT_FULL_MANA = 3, + SPELL_FAILED_ALREADY_AT_FULL_POWER = 4, + SPELL_FAILED_ALREADY_BEING_TAMED = 5, + SPELL_FAILED_ALREADY_HAVE_CHARM = 6, + SPELL_FAILED_ALREADY_HAVE_SUMMON = 7, + SPELL_FAILED_ALREADY_HAVE_PET = 8, + SPELL_FAILED_ALREADY_OPEN = 9, + SPELL_FAILED_AURA_BOUNCED = 10, + SPELL_FAILED_AUTOTRACK_INTERRUPTED = 11, + SPELL_FAILED_BAD_IMPLICIT_TARGETS = 12, + SPELL_FAILED_BAD_TARGETS = 13, + SPELL_FAILED_CANT_BE_CHARMED = 14, + SPELL_FAILED_CANT_BE_DISENCHANTED = 15, + SPELL_FAILED_CANT_BE_DISENCHANTED_SKILL = 16, + SPELL_FAILED_CANT_BE_MILLED = 17, + SPELL_FAILED_CANT_BE_PROSPECTED = 18, + SPELL_FAILED_CANT_CAST_ON_TAPPED = 19, + SPELL_FAILED_CANT_DUEL_WHILE_INVISIBLE = 20, + SPELL_FAILED_CANT_DUEL_WHILE_STEALTHED = 21, + SPELL_FAILED_CANT_STEALTH = 22, + SPELL_FAILED_CASTER_AURASTATE = 23, + SPELL_FAILED_CASTER_DEAD = 24, + SPELL_FAILED_CHARMED = 25, + SPELL_FAILED_CHEST_IN_USE = 26, + SPELL_FAILED_CONFUSED = 27, + SPELL_FAILED_DONT_REPORT = 28, + SPELL_FAILED_EQUIPPED_ITEM = 29, + SPELL_FAILED_EQUIPPED_ITEM_CLASS = 30, + SPELL_FAILED_EQUIPPED_ITEM_CLASS_MAINHAND = 31, + SPELL_FAILED_EQUIPPED_ITEM_CLASS_OFFHAND = 32, + SPELL_FAILED_ERROR = 33, + SPELL_FAILED_FALLING = 34, + SPELL_FAILED_FIZZLE = 35, + SPELL_FAILED_FLEEING = 36, + SPELL_FAILED_FOOD_LOWLEVEL = 37, + SPELL_FAILED_HIGHLEVEL = 38, + SPELL_FAILED_HUNGER_SATIATED = 39, + SPELL_FAILED_IMMUNE = 40, + SPELL_FAILED_INCORRECT_AREA = 41, + SPELL_FAILED_INTERRUPTED = 42, + SPELL_FAILED_INTERRUPTED_COMBAT = 43, + SPELL_FAILED_ITEM_ALREADY_ENCHANTED = 44, + SPELL_FAILED_ITEM_GONE = 45, + SPELL_FAILED_ITEM_NOT_FOUND = 46, + SPELL_FAILED_ITEM_NOT_READY = 47, + SPELL_FAILED_LEVEL_REQUIREMENT = 48, + SPELL_FAILED_LINE_OF_SIGHT = 49, + SPELL_FAILED_LOWLEVEL = 50, + SPELL_FAILED_LOW_CASTLEVEL = 51, + SPELL_FAILED_MAINHAND_EMPTY = 52, + SPELL_FAILED_MOVING = 53, + SPELL_FAILED_NEED_AMMO = 54, + SPELL_FAILED_NEED_AMMO_POUCH = 55, + SPELL_FAILED_NEED_EXOTIC_AMMO = 56, + SPELL_FAILED_NEED_MORE_ITEMS = 57, + SPELL_FAILED_NOPATH = 58, + SPELL_FAILED_NOT_BEHIND = 59, + SPELL_FAILED_NOT_FISHABLE = 60, + SPELL_FAILED_NOT_FLYING = 61, + SPELL_FAILED_NOT_HERE = 62, + SPELL_FAILED_NOT_INFRONT = 63, + SPELL_FAILED_NOT_IN_CONTROL = 64, + SPELL_FAILED_NOT_KNOWN = 65, + SPELL_FAILED_NOT_MOUNTED = 66, + SPELL_FAILED_NOT_ON_TAXI = 67, + SPELL_FAILED_NOT_ON_TRANSPORT = 68, + SPELL_FAILED_NOT_READY = 69, + SPELL_FAILED_NOT_SHAPESHIFT = 70, + SPELL_FAILED_NOT_STANDING = 71, + SPELL_FAILED_NOT_TRADEABLE = 72, + SPELL_FAILED_NOT_TRADING = 73, + SPELL_FAILED_NOT_UNSHEATHED = 74, + SPELL_FAILED_NOT_WHILE_GHOST = 75, + SPELL_FAILED_NOT_WHILE_LOOTING = 76, + SPELL_FAILED_NO_AMMO = 77, + SPELL_FAILED_NO_CHARGES_REMAIN = 78, + SPELL_FAILED_NO_CHAMPION = 79, + SPELL_FAILED_NO_COMBO_POINTS = 80, + SPELL_FAILED_NO_DUELING = 81, + SPELL_FAILED_NO_ENDURANCE = 82, + SPELL_FAILED_NO_FISH = 83, + SPELL_FAILED_NO_ITEMS_WHILE_SHAPESHIFTED = 84, + SPELL_FAILED_NO_MOUNTS_ALLOWED = 85, + SPELL_FAILED_NO_PET = 86, + SPELL_FAILED_NO_POWER = 87, + SPELL_FAILED_NOTHING_TO_DISPEL = 88, + SPELL_FAILED_NOTHING_TO_STEAL = 89, + SPELL_FAILED_ONLY_ABOVEWATER = 90, + SPELL_FAILED_ONLY_DAYTIME = 91, + SPELL_FAILED_ONLY_INDOORS = 92, + SPELL_FAILED_ONLY_MOUNTED = 93, + SPELL_FAILED_ONLY_NIGHTTIME = 94, + SPELL_FAILED_ONLY_OUTDOORS = 95, + SPELL_FAILED_ONLY_SHAPESHIFT = 96, + SPELL_FAILED_ONLY_STEALTHED = 97, + SPELL_FAILED_ONLY_UNDERWATER = 98, + SPELL_FAILED_OUT_OF_RANGE = 99, + SPELL_FAILED_PACIFIED = 100, + SPELL_FAILED_POSSESSED = 101, + SPELL_FAILED_REAGENTS = 102, + SPELL_FAILED_REQUIRES_AREA = 103, + SPELL_FAILED_REQUIRES_SPELL_FOCUS = 104, + SPELL_FAILED_ROOTED = 105, + SPELL_FAILED_SILENCED = 106, + SPELL_FAILED_SPELL_IN_PROGRESS = 107, + SPELL_FAILED_SPELL_LEARNED = 108, + SPELL_FAILED_SPELL_UNAVAILABLE = 109, + SPELL_FAILED_STUNNED = 110, + SPELL_FAILED_TARGETS_DEAD = 111, + SPELL_FAILED_TARGET_AFFECTING_COMBAT = 112, + SPELL_FAILED_TARGET_AURASTATE = 113, + SPELL_FAILED_TARGET_DUELING = 114, + SPELL_FAILED_TARGET_ENEMY = 115, + SPELL_FAILED_TARGET_ENRAGED = 116, + SPELL_FAILED_TARGET_FRIENDLY = 117, + SPELL_FAILED_TARGET_IN_COMBAT = 118, + SPELL_FAILED_TARGET_IS_PLAYER = 119, + SPELL_FAILED_TARGET_IS_PLAYER_CONTROLLED = 120, + SPELL_FAILED_TARGET_NOT_DEAD = 121, + SPELL_FAILED_TARGET_NOT_IN_PARTY = 122, + SPELL_FAILED_TARGET_NOT_LOOTED = 123, + SPELL_FAILED_TARGET_NOT_PLAYER = 124, + SPELL_FAILED_TARGET_NO_POCKETS = 125, + SPELL_FAILED_TARGET_NO_WEAPONS = 126, + SPELL_FAILED_TARGET_NO_RANGED_WEAPONS = 127, + SPELL_FAILED_TARGET_UNSKINNABLE = 128, + SPELL_FAILED_THIRST_SATIATED = 129, + SPELL_FAILED_TOO_CLOSE = 130, + SPELL_FAILED_TOO_MANY_OF_ITEM = 131, + SPELL_FAILED_TOTEM_CATEGORY = 132, + SPELL_FAILED_TOTEMS = 133, + SPELL_FAILED_TRY_AGAIN = 134, + SPELL_FAILED_UNIT_NOT_BEHIND = 135, + SPELL_FAILED_UNIT_NOT_INFRONT = 136, + SPELL_FAILED_VISION_OBSCURED = 137, + SPELL_FAILED_WRONG_PET_FOOD = 138, + SPELL_FAILED_NOT_WHILE_FATIGUED = 139, + SPELL_FAILED_TARGET_NOT_IN_INSTANCE = 140, + SPELL_FAILED_NOT_WHILE_TRADING = 141, + SPELL_FAILED_TARGET_NOT_IN_RAID = 142, + SPELL_FAILED_TARGET_FREEFORALL = 143, + SPELL_FAILED_NO_EDIBLE_CORPSES = 144, + SPELL_FAILED_ONLY_BATTLEGROUNDS = 145, + SPELL_FAILED_TARGET_NOT_GHOST = 146, + SPELL_FAILED_TRANSFORM_UNUSABLE = 147, + SPELL_FAILED_WRONG_WEATHER = 148, + SPELL_FAILED_DAMAGE_IMMUNE = 149, + SPELL_FAILED_PREVENTED_BY_MECHANIC = 150, + SPELL_FAILED_PLAY_TIME = 151, + SPELL_FAILED_REPUTATION = 152, + SPELL_FAILED_MIN_SKILL = 153, + SPELL_FAILED_NOT_IN_RATED_BATTLEGROUND = 154, + SPELL_FAILED_NOT_ON_SHAPESHIFT = 155, + SPELL_FAILED_NOT_ON_STEALTHED = 156, + SPELL_FAILED_NOT_ON_DAMAGE_IMMUNE = 157, + SPELL_FAILED_NOT_ON_MOUNTED = 158, + SPELL_FAILED_TOO_SHALLOW = 159, + SPELL_FAILED_TARGET_NOT_IN_SANCTUARY = 160, + SPELL_FAILED_TARGET_IS_TRIVIAL = 161, + SPELL_FAILED_BM_OR_INVISGOD = 162, + SPELL_FAILED_EXPERT_RIDING_REQUIREMENT = 163, + SPELL_FAILED_ARTISAN_RIDING_REQUIREMENT = 164, + SPELL_FAILED_NOT_IDLE = 165, + SPELL_FAILED_NOT_INACTIVE = 166, + SPELL_FAILED_PARTIAL_PLAYTIME = 167, + SPELL_FAILED_NO_PLAYTIME = 168, + SPELL_FAILED_NOT_IN_BATTLEGROUND = 169, + SPELL_FAILED_NOT_IN_RAID_INSTANCE = 170, + SPELL_FAILED_ONLY_IN_ARENA = 171, + SPELL_FAILED_TARGET_LOCKED_TO_RAID_INSTANCE= 172, + SPELL_FAILED_ON_USE_ENCHANT = 173, + SPELL_FAILED_NOT_ON_GROUND = 174, + SPELL_FAILED_CUSTOM_ERROR = 175, + SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW = 176, + SPELL_FAILED_TOO_MANY_SOCKETS = 177, + SPELL_FAILED_INVALID_GLYPH = 178, + SPELL_FAILED_UNIQUE_GLYPH = 179, + SPELL_FAILED_GLYPH_SOCKET_LOCKED = 180, + SPELL_FAILED_NO_VALID_TARGETS = 181, + SPELL_FAILED_ITEM_AT_MAX_CHARGES = 182, + SPELL_FAILED_NOT_IN_BARBERSHOP = 183, + SPELL_FAILED_FISHING_TOO_LOW = 184, + SPELL_FAILED_ITEM_ENCHANT_TRADE_WINDOW = 185, + SPELL_FAILED_SUMMON_PENDING = 186, + SPELL_FAILED_MAX_SOCKETS = 187, + SPELL_FAILED_PET_CAN_RENAME = 188, + SPELL_FAILED_TARGET_CANNOT_BE_RESURRECTED = 189, + SPELL_FAILED_NO_ACTIONS = 190, + SPELL_FAILED_CURRENCY_WEIGHT_MISMATCH = 191, + SPELL_FAILED_WEIGHT_NOT_ENOUGH = 192, + SPELL_FAILED_WEIGHT_TOO_MUCH = 193, + SPELL_FAILED_NO_VACANT_SEAT = 194, + SPELL_FAILED_NO_LIQUID = 195, + SPELL_FAILED_ONLY_NOT_SWIMMING = 196, + SPELL_FAILED_BY_NOT_MOVING = 197, + SPELL_FAILED_IN_COMBAT_RES_LIMIT_REACHED = 198, + SPELL_FAILED_NOT_IN_ARENA = 199, + SPELL_FAILED_TARGET_NOT_GROUNDED = 200, + SPELL_FAILED_EXCEEDED_WEEKLY_USAGE = 201, + SPELL_FAILED_NOT_IN_LFG_DUNGEON = 202, + + SPELL_FAILED_UNKNOWN = 254 // custom value, default case SPELL_CAST_OK = 255 // custom value, must not be sent to client }; -- cgit v1.2.3 From 92cc605de4a4178fb4e610ff12d86c29ccea522a Mon Sep 17 00:00:00 2001 From: Shocker Date: Sat, 26 Nov 2011 22:29:28 +0200 Subject: Core/Spells: Typo fix in recent commit --- src/server/game/Spells/Auras/SpellAuraDefines.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Spells/Auras/SpellAuraDefines.h b/src/server/game/Spells/Auras/SpellAuraDefines.h index 34c1f5f201d..63ed4f48105 100755 --- a/src/server/game/Spells/Auras/SpellAuraDefines.h +++ b/src/server/game/Spells/Auras/SpellAuraDefines.h @@ -347,7 +347,7 @@ enum AuraType SPELL_AURA_MOD_ATTACK_POWER_OF_ARMOR = 285, SPELL_AURA_ABILITY_PERIODIC_CRIT = 286, SPELL_AURA_DEFLECT_SPELLS = 287, - SPELL_AURA_IGNORE_HIT_DIRECTION = = 288, + SPELL_AURA_IGNORE_HIT_DIRECTION = 288, SPELL_AURA_289 = 289, SPELL_AURA_MOD_CRIT_PCT = 290, SPELL_AURA_MOD_XP_QUEST_PCT = 291, -- cgit v1.2.3 From 0cb161db812108563e987e5e06ddbed4ca3e54b5 Mon Sep 17 00:00:00 2001 From: Shocker Date: Sat, 26 Nov 2011 22:30:27 +0200 Subject: Core/Spells: Implement SPELL_AURA_MOD_DURABILITY_LOSS --- src/server/game/Entities/Player/Player.cpp | 2 ++ src/server/game/Spells/Auras/SpellAuraDefines.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index ff2daa14589..c5f08b70abb 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -5346,6 +5346,8 @@ void Player::DurabilityLoss(Item* item, double percent) if (!pMaxDurability) return; + percent /= GetTotalAuraMultiplier(SPELL_AURA_MOD_DURABILITY_LOSS); + uint32 pDurabilityLoss = uint32(pMaxDurability*percent); if (pDurabilityLoss < 1) diff --git a/src/server/game/Spells/Auras/SpellAuraDefines.h b/src/server/game/Spells/Auras/SpellAuraDefines.h index 63ed4f48105..65f394052d8 100755 --- a/src/server/game/Spells/Auras/SpellAuraDefines.h +++ b/src/server/game/Spells/Auras/SpellAuraDefines.h @@ -397,7 +397,7 @@ enum AuraType SPELL_AURA_335 = 335, SPELL_AURA_MOD_FLYING_RESTRICTIONS = 336, // NYI SPELL_AURA_MOD_VENDOR_ITEMS_PRICES = 337, // NYI - SPELL_AURA_MOD_DURABILITY_LOSS = 338, // NYI + SPELL_AURA_MOD_DURABILITY_LOSS = 338, SPELL_AURA_INCREASE_SKILL_GAIN_CHANCE = 339, // NYI SPELL_AURA_340 = 340, SPELL_AURA_341 = 341, // cooldown decrease -- cgit v1.2.3 From a2406e2aded19bf38bc636b17ba7fc7f021dda97 Mon Sep 17 00:00:00 2001 From: kaelima Date: Sat, 26 Nov 2011 21:36:15 +0100 Subject: Fix typo and compile --- src/server/game/Miscellaneous/SharedDefines.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 92aa906137b..d539b73fae6 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -1036,9 +1036,8 @@ enum SpellCastResult SPELL_FAILED_TARGET_NOT_GROUNDED = 200, SPELL_FAILED_EXCEEDED_WEEKLY_USAGE = 201, SPELL_FAILED_NOT_IN_LFG_DUNGEON = 202, - - SPELL_FAILED_UNKNOWN = 254 // custom value, default case - SPELL_CAST_OK = 255 // custom value, must not be sent to client + SPELL_FAILED_UNKNOWN = 254, // custom value, default case + SPELL_CAST_OK = 255, // custom value, must not be sent to client }; enum SpellCustomErrors @@ -1155,7 +1154,7 @@ enum SpellCustomErrors SPELL_CUSTOM_ERROR_NEED_TO_FREE_DRAKE_FIRST = 109, // Free the Drake from the net first! SPELL_CUSTOM_ERROR_DRAGONMAW_ALLIES_ALREADY_FOLLOW = 110, // You already have three Dragonmaw allies following you. SPELL_CUSTOM_ERROR_REQUIRE_OPPOSABLE_THUMBS = 111, // Requires Opposable Thumbs. - SPELL_CUSTOM_ERROR_NOT_ENOUGH_HEALTH = 112, // Not enough health + SPELL_CUSTOM_ERROR_NOT_ENOUGH_HEALTH_2 = 112, // Not enough health SPELL_CUSTOM_ERROR_ENOUGH_FORSAKEN_TROOPERS = 113, // You already have enough Forsaken Troopers. SPELL_CUSTOM_ERROR_CANNOT_JUMP_TO_BOULDER = 114, // You cannot jump to another boulder yet. SPELL_CUSTOM_ERROR_SKILL_TOO_HIGH = 115, // Skill too high. -- cgit v1.2.3 From 8160e6e30392d946f29c6eccbcca1ff3bfadbdef Mon Sep 17 00:00:00 2001 From: Shocker Date: Sat, 26 Nov 2011 22:37:02 +0200 Subject: Core/Spells: Allow SPELL_AURA_SET_VEHICLE_ID to be used on creatures too --- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index bd9a0159c72..9f1fd5b6de1 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -5546,7 +5546,7 @@ void AuraEffect::HandleAuraSetVehicle(AuraApplication const* aurApp, uint8 mode, Unit* target = aurApp->GetTarget(); - if (target->GetTypeId() != TYPEID_PLAYER || !target->IsInWorld()) + if (!target->IsInWorld()) return; uint32 vehicleId = GetMiscValue(); @@ -5559,6 +5559,9 @@ void AuraEffect::HandleAuraSetVehicle(AuraApplication const* aurApp, uint8 mode, else if (target->GetVehicleKit()) target->RemoveVehicleKit(); + if (target->GetTypeId() != TYPEID_PLAYER) + return; + WorldPacket data(SMSG_PLAYER_VEHICLE_DATA, target->GetPackGUID().size()+4); data.appendPackGUID(target->GetGUID()); data << uint32(apply ? vehicleId : 0); -- cgit v1.2.3 From bef006c5bf7269a69d06a62aa8235f48be5faaf9 Mon Sep 17 00:00:00 2001 From: Shocker Date: Sat, 26 Nov 2011 22:53:37 +0200 Subject: Core/Spells: Fix SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE --- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 9f1fd5b6de1..67938498a4b 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -3801,19 +3801,13 @@ void AuraEffect::HandleModTotalPercentStat(AuraApplication const* aurApp, uint8 Unit* target = aurApp->GetTarget(); - if (GetMiscValue() < -1 || GetMiscValue() > 4) - { - sLog->outError("WARNING: Misc Value for SPELL_AURA_MOD_PERCENT_STAT not valid"); - return; - } - // save current health state float healthPct = target->GetHealthPct(); bool alive = target->isAlive(); for (int32 i = STAT_STRENGTH; i < MAX_STATS; i++) { - if (GetMiscValue() == i || GetMiscValue() == -1) + if (GetMiscValueB() & 1 << i || !GetMiscValueB()) // 0 is also used for all stats { target->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_PCT, float(GetAmount()), apply); if (target->GetTypeId() == TYPEID_PLAYER || target->ToCreature()->isPet()) @@ -3823,7 +3817,7 @@ void AuraEffect::HandleModTotalPercentStat(AuraApplication const* aurApp, uint8 // recalculate current HP/MP after applying aura modifications (only for spells with SPELL_ATTR0_UNK4 0x00000010 flag) // this check is total bullshit i think - if (GetMiscValue() == STAT_STAMINA && (m_spellInfo->Attributes & SPELL_ATTR0_ABILITY)) + if (GetMiscValueB() & 1 << STAT_STAMINA && (m_spellInfo->Attributes & SPELL_ATTR0_ABILITY)) target->SetHealth(std::max(uint32(healthPct * target->GetMaxHealth() * 0.01f), (alive ? 1 : 0))); } -- cgit v1.2.3 From d26b7210fb13efef51b108defbef77942dae7ed0 Mon Sep 17 00:00:00 2001 From: Shocker Date: Sat, 26 Nov 2011 23:15:23 +0200 Subject: Core/Spells: Implement SPELL_AURA_MOD_AUTOATTACK_DAMAGE --- src/server/game/Entities/Unit/Unit.cpp | 16 ++++++++++++++++ src/server/game/Spells/Auras/SpellAuraDefines.h | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 777a3a47f44..a97343f204e 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -11617,6 +11617,22 @@ void Unit::MeleeDamageBonus(Unit* victim, uint32 *pdamage, WeaponAttackType attT float TakenTotalMod = 1.0f; // ..done + // SPELL_AURA_MOD_AUTOATTACK_DAMAGE + if (!spellProto) + { + AuraEffectList const & autoattackDamage = GetAuraEffectsByType(SPELL_AURA_MOD_AUTOATTACK_DAMAGE); + for (AuraEffectList::const_iterator i = autoattackDamage.begin(); i != autoattackDamage.end(); ++i) + { + int32 amount = (*i)->GetAmount(); + if ((*i)->GetSpellInfo()->EquippedItemClass == -1) + AddPctN(DoneTotalMod, amount); + else if (!((*i)->GetSpellInfo()->AttributesEx5 & SPELL_ATTR5_SPECIAL_ITEM_CLASS_CHECK) && ((*i)->GetSpellInfo()->EquippedItemSubClassMask == 0)) + AddPctN(DoneTotalMod, amount); + else if (ToPlayer() && ToPlayer()->HasItemFitToSpellRequirements((*i)->GetSpellInfo())) + AddPctN(DoneTotalMod, amount); + } + } + AuraEffectList const& mModDamagePercentDone = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE); for (AuraEffectList::const_iterator i = mModDamagePercentDone.begin(); i != mModDamagePercentDone.end(); ++i) { diff --git a/src/server/game/Spells/Auras/SpellAuraDefines.h b/src/server/game/Spells/Auras/SpellAuraDefines.h index 65f394052d8..43c0f5d5ac2 100755 --- a/src/server/game/Spells/Auras/SpellAuraDefines.h +++ b/src/server/game/Spells/Auras/SpellAuraDefines.h @@ -403,7 +403,7 @@ enum AuraType SPELL_AURA_341 = 341, // cooldown decrease SPELL_AURA_MOD_TIME_BETWEEN_ATTACKS = 342, // (attack speed) NYI SPELL_AURA_343 = 343, - SPELL_AURA_MOD_AUTOATTACK_DAMAGE = 344, // (white damage) NYI + SPELL_AURA_MOD_AUTOATTACK_DAMAGE = 344, SPELL_AURA_BYPASS_ARMOR_FOR_CASTER = 345, SPELL_AURA_PROGRESS_BAR = 346, // NYI SPELL_AURA_MOD_SPELL_COOLDOWN_BY_HASTE = 347, // NYI -- cgit v1.2.3 From d1135f00c6879fe4fd9aaad1aa3d0221c33838ea Mon Sep 17 00:00:00 2001 From: Shocker Date: Sat, 26 Nov 2011 23:27:02 +0200 Subject: Core/Spells: Implement SPELL_AURA_MOD_CRIT_CHANCE_FOR_CASTER Correct variable names / comments for SPELL_AURA_BYPASS_ARMOR_FOR_CASTER --- src/server/game/Entities/Unit/Unit.cpp | 13 +++++++++---- src/server/game/Spells/Auras/SpellAuraDefines.h | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index a97343f204e..b4f444f587c 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -1490,13 +1490,13 @@ uint32 Unit::CalcArmorReducedDamage(Unit* victim, const uint32 damage, SpellInfo uint32 newdamage = 0; float armor = float(victim->GetArmor()); - // bypass enemy armor effectiveness by SPELL_AURA_BYPASS_ARMOR_FOR_CASTER - int32 auraEffectivenessReduction = 0; + // bypass enemy armor by SPELL_AURA_BYPASS_ARMOR_FOR_CASTER + int32 armorBypassPct = 0; AuraEffectList const & reductionAuras = victim->GetAuraEffectsByType(SPELL_AURA_BYPASS_ARMOR_FOR_CASTER); for (AuraEffectList::const_iterator i = reductionAuras.begin(); i != reductionAuras.end(); ++i) if ((*i)->GetCasterGUID() == GetGUID()) - auraEffectivenessReduction += (*i)->GetAmount(); - armor = CalculatePctN(armor, 100 - std::min(auraEffectivenessReduction, 100)); + armorBypassPct += (*i)->GetAmount(); + armor = CalculatePctN(armor, 100 - std::min(armorBypassPct, 100)); // Ignore enemy armor by SPELL_AURA_MOD_TARGET_RESISTANCE aura armor += GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_TARGET_RESISTANCE, SPELL_SCHOOL_MASK_NORMAL); @@ -11025,6 +11025,11 @@ bool Unit::isSpellCrit(Unit* victim, SpellInfo const* spellProto, SpellSchoolMas if (Player* modOwner = GetSpellModOwner()) modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_CRITICAL_CHANCE, crit_chance); + AuraEffectList const& critAuras = victim->GetAuraEffectsByType(SPELL_AURA_MOD_CRIT_CHANCE_FOR_CASTER); + for (AuraEffectList::const_iterator i = critAuras.begin(); i != critAuras.end(); ++i) + if ((*i)->GetCasterGUID() == GetGUID() && (*i)->IsAffectedOnSpell(spellProto)) + crit_chance += (*i)->GetAmount(); + crit_chance = crit_chance > 0.0f ? crit_chance : 0.0f; if (roll_chance_f(crit_chance)) return true; diff --git a/src/server/game/Spells/Auras/SpellAuraDefines.h b/src/server/game/Spells/Auras/SpellAuraDefines.h index 43c0f5d5ac2..822f5f886e5 100755 --- a/src/server/game/Spells/Auras/SpellAuraDefines.h +++ b/src/server/game/Spells/Auras/SpellAuraDefines.h @@ -367,7 +367,7 @@ enum AuraType SPELL_AURA_MOD_MINIMUM_SPEED = 305, SPELL_AURA_306 = 306, SPELL_AURA_HEAL_ABSORB_TEST = 307, - SPELL_AURA_MOD_CRIT_CHANCE_FOR_CASTER = 308, // NYI + SPELL_AURA_MOD_CRIT_CHANCE_FOR_CASTER = 308, SPELL_AURA_309 = 309, SPELL_AURA_MOD_CREATURE_AOE_DAMAGE_AVOIDANCE = 310, SPELL_AURA_311 = 311, -- cgit v1.2.3 From ef9101ea83a577dbf605402b04047a91dfd2c4d6 Mon Sep 17 00:00:00 2001 From: Shocker Date: Sat, 26 Nov 2011 23:38:06 +0200 Subject: Core/Spells: Rename AuraEffect::IsAffectedOnSpell to IsAffectingSpell --- src/server/game/Entities/Unit/Unit.cpp | 38 +++++++++++------------ src/server/game/Spells/Auras/SpellAuraEffects.cpp | 6 ++-- src/server/game/Spells/Auras/SpellAuraEffects.h | 2 +- src/server/game/Spells/Spell.cpp | 14 ++++----- 4 files changed, 30 insertions(+), 30 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index b4f444f587c..75265e5dca1 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -1509,7 +1509,7 @@ uint32 Unit::CalcArmorReducedDamage(Unit* victim, const uint32 damage, SpellInfo for (AuraEffectList::const_iterator j = ResIgnoreAurasAb.begin(); j != ResIgnoreAurasAb.end(); ++j) { if ((*j)->GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL - && (*j)->IsAffectedOnSpell(spellInfo)) + && (*j)->IsAffectingSpell(spellInfo)) armor = floor(AddPctN(armor, -(*j)->GetAmount())); } @@ -1639,7 +1639,7 @@ void Unit::CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffe AuraEffectList const& ResIgnoreAurasAb = GetAuraEffectsByType(SPELL_AURA_MOD_ABILITY_IGNORE_TARGET_RESIST); for (AuraEffectList::const_iterator j = ResIgnoreAurasAb.begin(); j != ResIgnoreAurasAb.end(); ++j) - if (((*j)->GetMiscValue() & schoolMask) && (*j)->IsAffectedOnSpell(spellInfo)) + if (((*j)->GetMiscValue() & schoolMask) && (*j)->IsAffectingSpell(spellInfo)) AddPctN(damageResisted, -(*j)->GetAmount()); AuraEffectList const& ResIgnoreAuras = GetAuraEffectsByType(SPELL_AURA_MOD_IGNORE_TARGET_RESIST); @@ -1668,7 +1668,7 @@ void Unit::CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffe if (!((*itr)->GetMiscValue() & schoolMask)) continue; - if (((*itr)->GetAmount() > auraAbsorbMod) && (*itr)->IsAffectedOnSpell(spellInfo)) + if (((*itr)->GetAmount() > auraAbsorbMod) && (*itr)->IsAffectingSpell(spellInfo)) auraAbsorbMod = float((*itr)->GetAmount()); } RoundToInterval(auraAbsorbMod, 0.0f, 100.0f); @@ -2406,7 +2406,7 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit* victim, SpellInfo const* spell) AuraEffectList const& ignore = GetAuraEffectsByType(SPELL_AURA_IGNORE_COMBAT_RESULT); for (AuraEffectList::const_iterator i = ignore.begin(); i != ignore.end(); ++i) { - if (!(*i)->IsAffectedOnSpell(spell)) + if (!(*i)->IsAffectingSpell(spell)) continue; switch ((*i)->GetMiscValue()) { @@ -4250,7 +4250,7 @@ bool Unit::HasAuraTypeWithAffectMask(AuraType auratype, SpellInfo const* affecte { AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype); for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i) - if ((*i)->IsAffectedOnSpell(affectedSpell)) + if ((*i)->IsAffectingSpell(affectedSpell)) return true; return false; } @@ -4310,7 +4310,7 @@ AuraEffect* Unit::IsScriptOverriden(SpellInfo const* spell, int32 script) const for (AuraEffectList::const_iterator i = auras.begin(); i != auras.end(); ++i) { if ((*i)->GetMiscValue() == script) - if ((*i)->IsAffectedOnSpell(spell)) + if ((*i)->IsAffectingSpell(spell)) return (*i); } return NULL; @@ -4547,7 +4547,7 @@ int32 Unit::GetTotalAuraModifierByAffectMask(AuraType auratype, SpellInfo const* AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype); for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i) { - if ((*i)->IsAffectedOnSpell(affectedSpell)) + if ((*i)->IsAffectingSpell(affectedSpell)) modifier += (*i)->GetAmount(); } return modifier; @@ -4560,7 +4560,7 @@ float Unit::GetTotalAuraMultiplierByAffectMask(AuraType auratype, SpellInfo cons AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype); for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i) { - if ((*i)->IsAffectedOnSpell(affectedSpell)) + if ((*i)->IsAffectingSpell(affectedSpell)) AddPctN(multiplier, (*i)->GetAmount()); } return multiplier; @@ -4573,7 +4573,7 @@ int32 Unit::GetMaxPositiveAuraModifierByAffectMask(AuraType auratype, SpellInfo AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype); for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i) { - if ((*i)->IsAffectedOnSpell(affectedSpell) && (*i)->GetAmount() > modifier) + if ((*i)->IsAffectingSpell(affectedSpell) && (*i)->GetAmount() > modifier) modifier = (*i)->GetAmount(); } @@ -4587,7 +4587,7 @@ int32 Unit::GetMaxNegativeAuraModifierByAffectMask(AuraType auratype, SpellInfo AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype); for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i) { - if ((*i)->IsAffectedOnSpell(affectedSpell) && (*i)->GetAmount() < modifier) + if ((*i)->IsAffectingSpell(affectedSpell) && (*i)->GetAmount() < modifier) modifier = (*i)->GetAmount(); } @@ -9639,7 +9639,7 @@ bool Unit::HasAuraState(AuraStateType flag, SpellInfo const* spellProto, Unit co { AuraEffectList const& stateAuras = Caster->GetAuraEffectsByType(SPELL_AURA_ABILITY_IGNORE_AURASTATE); for (AuraEffectList::const_iterator j = stateAuras.begin(); j != stateAuras.end(); ++j) - if ((*j)->IsAffectedOnSpell(spellProto)) + if ((*j)->IsAffectingSpell(spellProto)) return true; } // Check per caster aura state @@ -10310,7 +10310,7 @@ uint32 Unit::SpellDamageBonus(Unit* victim, SpellInfo const* spellProto, uint32 AuraEffectList const& mOverrideClassScript= owner->GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS); for (AuraEffectList::const_iterator i = mOverrideClassScript.begin(); i != mOverrideClassScript.end(); ++i) { - if (!(*i)->IsAffectedOnSpell(spellProto)) + if (!(*i)->IsAffectingSpell(spellProto)) continue; switch ((*i)->GetMiscValue()) @@ -10629,7 +10629,7 @@ uint32 Unit::SpellDamageBonus(Unit* victim, SpellInfo const* spellProto, uint32 // From caster spells AuraEffectList const& mOwnerTaken = victim->GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_FROM_CASTER); for (AuraEffectList::const_iterator i = mOwnerTaken.begin(); i != mOwnerTaken.end(); ++i) - if ((*i)->GetCasterGUID() == GetGUID() && (*i)->IsAffectedOnSpell(spellProto)) + if ((*i)->GetCasterGUID() == GetGUID() && (*i)->IsAffectingSpell(spellProto)) AddPctN(TakenTotalMod, (*i)->GetAmount()); // Mod damage from spell mechanic @@ -10883,7 +10883,7 @@ bool Unit::isSpellCrit(Unit* victim, SpellInfo const* spellProto, SpellSchoolMas AuraEffectList const& mOverrideClassScript = GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS); for (AuraEffectList::const_iterator i = mOverrideClassScript.begin(); i != mOverrideClassScript.end(); ++i) { - if (!((*i)->IsAffectedOnSpell(spellProto))) + if (!((*i)->IsAffectingSpell(spellProto))) continue; int32 modChance = 0; switch ((*i)->GetMiscValue()) @@ -11027,7 +11027,7 @@ bool Unit::isSpellCrit(Unit* victim, SpellInfo const* spellProto, SpellSchoolMas AuraEffectList const& critAuras = victim->GetAuraEffectsByType(SPELL_AURA_MOD_CRIT_CHANCE_FOR_CASTER); for (AuraEffectList::const_iterator i = critAuras.begin(); i != critAuras.end(); ++i) - if ((*i)->GetCasterGUID() == GetGUID() && (*i)->IsAffectedOnSpell(spellProto)) + if ((*i)->GetCasterGUID() == GetGUID() && (*i)->IsAffectingSpell(spellProto)) crit_chance += (*i)->GetAmount(); crit_chance = crit_chance > 0.0f ? crit_chance : 0.0f; @@ -11131,7 +11131,7 @@ uint32 Unit::SpellHealingBonus(Unit* victim, SpellInfo const* spellProto, uint32 AuraEffectList const& mOverrideClassScript= owner->GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS); for (AuraEffectList::const_iterator i = mOverrideClassScript.begin(); i != mOverrideClassScript.end(); ++i) { - if (!(*i)->IsAffectedOnSpell(spellProto)) + if (!(*i)->IsAffectingSpell(spellProto)) continue; switch ((*i)->GetMiscValue()) { @@ -11362,7 +11362,7 @@ uint32 Unit::SpellHealingBonus(Unit* victim, SpellInfo const* spellProto, uint32 AuraEffectList const& mHealingGet= victim->GetAuraEffectsByType(SPELL_AURA_MOD_HEALING_RECEIVED); for (AuraEffectList::const_iterator i = mHealingGet.begin(); i != mHealingGet.end(); ++i) - if (GetGUID() == (*i)->GetCasterGUID() && (*i)->IsAffectedOnSpell(spellProto)) + if (GetGUID() == (*i)->GetCasterGUID() && (*i)->IsAffectingSpell(spellProto)) AddPctN(TakenTotalMod, (*i)->GetAmount()); heal = (int32(heal) + TakenTotal) * TakenTotalMod; @@ -11671,7 +11671,7 @@ void Unit::MeleeDamageBonus(Unit* victim, uint32 *pdamage, WeaponAttackType attT AuraEffectList const& mOverrideClassScript = owner->GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS); for (AuraEffectList::const_iterator i = mOverrideClassScript.begin(); i != mOverrideClassScript.end(); ++i) { - if (!(*i)->IsAffectedOnSpell(spellProto)) + if (!(*i)->IsAffectingSpell(spellProto)) continue; switch ((*i)->GetMiscValue()) @@ -11747,7 +11747,7 @@ void Unit::MeleeDamageBonus(Unit* victim, uint32 *pdamage, WeaponAttackType attT // From caster spells AuraEffectList const& mOwnerTaken = victim->GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_FROM_CASTER); for (AuraEffectList::const_iterator i = mOwnerTaken.begin(); i != mOwnerTaken.end(); ++i) - if ((*i)->GetCasterGUID() == GetGUID() && (*i)->IsAffectedOnSpell(spellProto)) + if ((*i)->GetCasterGUID() == GetGUID() && (*i)->IsAffectingSpell(spellProto)) AddPctN(TakenTotalMod, (*i)->GetAmount()); // .. taken pct (special attacks) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 67938498a4b..60e51a7c2ed 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -467,7 +467,7 @@ int32 AuraEffect::CalculateAmount(Unit* caster) Unit::AuraEffectList const& overrideClassScripts = caster->GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS); for (Unit::AuraEffectList::const_iterator itr = overrideClassScripts.begin(); itr != overrideClassScripts.end(); ++itr) { - if ((*itr)->IsAffectedOnSpell(m_spellInfo)) + if ((*itr)->IsAffectingSpell(m_spellInfo)) { // Glyph of Fear, Glyph of Frost nova and similar auras if ((*itr)->GetMiscValue() == 7801) @@ -1228,7 +1228,7 @@ bool AuraEffect::IsPeriodicTickCrit(Unit* target, Unit const* caster) const Unit::AuraEffectList const& mPeriodicCritAuras= caster->GetAuraEffectsByType(SPELL_AURA_ABILITY_PERIODIC_CRIT); for (Unit::AuraEffectList::const_iterator itr = mPeriodicCritAuras.begin(); itr != mPeriodicCritAuras.end(); ++itr) { - if ((*itr)->IsAffectedOnSpell(m_spellInfo) && caster->isSpellCrit(target, m_spellInfo, m_spellInfo->GetSchoolMask())) + if ((*itr)->IsAffectingSpell(m_spellInfo) && caster->isSpellCrit(target, m_spellInfo, m_spellInfo->GetSchoolMask())) return true; } // Rupture - since 3.3.3 can crit @@ -1240,7 +1240,7 @@ bool AuraEffect::IsPeriodicTickCrit(Unit* target, Unit const* caster) const return false; } -bool AuraEffect::IsAffectedOnSpell(SpellInfo const* spell) const +bool AuraEffect::IsAffectingSpell(SpellInfo const* spell) const { if (!spell) return false; diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.h b/src/server/game/Spells/Auras/SpellAuraEffects.h index c34391471d7..9d1a74591c5 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.h +++ b/src/server/game/Spells/Auras/SpellAuraEffects.h @@ -79,7 +79,7 @@ class AuraEffect bool IsPeriodic() const { return m_isPeriodic; } void SetPeriodic(bool isPeriodic) { m_isPeriodic = isPeriodic; } - bool IsAffectedOnSpell(SpellInfo const* spell) const; + bool IsAffectingSpell(SpellInfo const* spell) const; void SendTickImmune(Unit* target, Unit* caster) const; void PeriodicTick(AuraApplication * aurApp, Unit* caster) const; diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index c47d6d08990..06a6a347fef 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -2814,7 +2814,7 @@ uint32 Spell::SelectEffectTargets(uint32 i, SpellImplicitTargetInfo const& cur) { Unit::AuraEffectList const& Auras = m_caster->GetAuraEffectsByType(SPELL_AURA_MOD_MAX_AFFECTED_TARGETS); for (Unit::AuraEffectList::const_iterator j = Auras.begin(); j != Auras.end(); ++j) - if ((*j)->IsAffectedOnSpell(m_spellInfo)) + if ((*j)->IsAffectingSpell(m_spellInfo)) maxTargets += (*j)->GetAmount(); if (m_spellInfo->Id == 5246) //Intimidating Shout @@ -2834,7 +2834,7 @@ uint32 Spell::SelectEffectTargets(uint32 i, SpellImplicitTargetInfo const& cur) { Unit::AuraEffectList const& Auras = m_caster->GetAuraEffectsByType(SPELL_AURA_MOD_MAX_AFFECTED_TARGETS); for (Unit::AuraEffectList::const_iterator j = Auras.begin(); j != Auras.end(); ++j) - if ((*j)->IsAffectedOnSpell(m_spellInfo)) + if ((*j)->IsAffectingSpell(m_spellInfo)) maxTargets += (*j)->GetAmount(); Trinity::RandomResizeList(gobjectList, maxTargets); @@ -3605,7 +3605,7 @@ void Spell::finish(bool ok) Unit::AuraEffectList const& vIgnoreReset = m_caster->GetAuraEffectsByType(SPELL_AURA_IGNORE_MELEE_RESET); for (Unit::AuraEffectList::const_iterator i = vIgnoreReset.begin(); i != vIgnoreReset.end(); ++i) { - if ((*i)->IsAffectedOnSpell(m_spellInfo)) + if ((*i)->IsAffectingSpell(m_spellInfo)) { found = true; break; @@ -4533,7 +4533,7 @@ SpellCastResult Spell::CheckCast(bool strict) Unit::AuraEffectList const& ignore = m_caster->GetAuraEffectsByType(SPELL_AURA_MOD_IGNORE_SHAPESHIFT); for (Unit::AuraEffectList::const_iterator i = ignore.begin(); i != ignore.end(); ++i) { - if (!(*i)->IsAffectedOnSpell(m_spellInfo)) + if (!(*i)->IsAffectingSpell(m_spellInfo)) continue; checkForm = false; break; @@ -4559,7 +4559,7 @@ SpellCastResult Spell::CheckCast(bool strict) Unit::AuraEffectList const& stateAuras = m_caster->GetAuraEffectsByType(SPELL_AURA_ABILITY_IGNORE_AURASTATE); for (Unit::AuraEffectList::const_iterator j = stateAuras.begin(); j != stateAuras.end(); ++j) { - if ((*j)->IsAffectedOnSpell(m_spellInfo)) + if ((*j)->IsAffectingSpell(m_spellInfo)) { m_needComboPoints = false; if ((*j)->GetMiscValue() == 1) @@ -6475,7 +6475,7 @@ void Spell::HandleLaunchPhase() Unit::AuraEffectList const& Auras = m_caster->GetAuraEffectsByType(SPELL_AURA_ABILITY_CONSUME_NO_AMMO); for (Unit::AuraEffectList::const_iterator j = Auras.begin(); j != Auras.end(); ++j) { - if ((*j)->IsAffectedOnSpell(m_spellInfo)) + if ((*j)->IsAffectingSpell(m_spellInfo)) usesAmmo=false; } @@ -7030,7 +7030,7 @@ void Spell::PrepareTriggersExecutedOnHit() Unit::AuraEffectList const& targetTriggers = m_caster->GetAuraEffectsByType(SPELL_AURA_ADD_TARGET_TRIGGER); for (Unit::AuraEffectList::const_iterator i = targetTriggers.begin(); i != targetTriggers.end(); ++i) { - if (!(*i)->IsAffectedOnSpell(m_spellInfo)) + if (!(*i)->IsAffectingSpell(m_spellInfo)) continue; SpellInfo const* auraSpellInfo = (*i)->GetSpellInfo(); uint32 auraSpellIdx = (*i)->GetEffIndex(); -- cgit v1.2.3 From a2f6a2b6ca1473bb2581960132958d869feaa7cd Mon Sep 17 00:00:00 2001 From: Shocker Date: Sat, 26 Nov 2011 23:41:21 +0200 Subject: Core/Battlegrounds: Remove temporary currency bonus auras before rewarding player at battleground end --- src/server/game/Battlegrounds/Battleground.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index 7cfd4dec28e..e978fec46f4 100755 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -836,6 +836,10 @@ void Battleground::EndBattleground(uint32 winner) uint32 loser_kills = player->GetRandomWinner() ? BG_REWARD_LOSER_HONOR_LAST : BG_REWARD_LOSER_HONOR_FIRST; uint32 winner_arena = player->GetRandomWinner() ? BG_REWARD_WINNER_ARENA_LAST : BG_REWARD_WINNER_ARENA_FIRST; + // remove temporary currency bonus auras before rewarding player + player->RemoveAura(SPELL_HONORABLE_DEFENDER_25Y); + player->RemoveAura(SPELL_HONORABLE_DEFENDER_60Y); + // Reward winner team if (team == winner) { -- cgit v1.2.3 From 29400b4198bd56544de097c186955f1154ca78ad Mon Sep 17 00:00:00 2001 From: Shocker Date: Sat, 26 Nov 2011 23:47:01 +0200 Subject: Core/Spells: Remove feral attack power bonus --- src/server/game/Entities/Player/Player.cpp | 12 ------------ src/server/game/Entities/Player/Player.h | 1 - src/server/game/Entities/Unit/StatSystem.cpp | 6 ------ 3 files changed, 19 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index c5f08b70abb..a106534b3e5 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -7959,9 +7959,6 @@ void Player::_ApplyItemBonuses(ItemTemplate const* proto, uint8 slot, bool apply case ITEM_MOD_RANGED_ATTACK_POWER: HandleStatModifier(UNIT_MOD_ATTACK_POWER_RANGED, TOTAL_VALUE, float(val), apply); break; -// case ITEM_MOD_FERAL_ATTACK_POWER: -// ApplyFeralAPBonus(int32(val), apply); -// break; case ITEM_MOD_MANA_REGENERATION: ApplyManaRegenBonus(int32(val), apply); break; @@ -8115,11 +8112,6 @@ void Player::_ApplyWeaponDamage(uint8 slot, ItemTemplate const* proto, ScalingSt if (CanModifyStats() && (damage || proto->Delay)) UpdateDamagePhysical(attType); - - // Druids get feral AP bonus from weapon dps (lso use DPS from ScalingStatValue) - if (getClass() == CLASS_DRUID) - if (int32 feral_bonus = proto->getFeralBonus(extraDPS)) - ApplyFeralAPBonus(feral_bonus, apply); } void Player::_ApplyWeaponDependentAuraMods(Item* item, WeaponAttackType attackType, bool apply) @@ -13761,10 +13753,6 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool HandleStatModifier(UNIT_MOD_ATTACK_POWER_RANGED, TOTAL_VALUE, float(enchant_amount), apply); sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u RANGED_ATTACK_POWER", enchant_amount); break; -// case ITEM_MOD_FERAL_ATTACK_POWER: -// ApplyFeralAPBonus(enchant_amount, apply); -// sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u FERAL_ATTACK_POWER", enchant_amount); -// break; case ITEM_MOD_MANA_REGENERATION: ApplyManaRegenBonus(enchant_amount, apply); sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u MANA_REGENERATION", enchant_amount); diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index a69de99b2e2..7e559b0e077 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1903,7 +1903,6 @@ class Player : public Unit, public GridObject void UpdateArmor(); void UpdateMaxHealth(); void UpdateMaxPower(Powers power); - void ApplyFeralAPBonus(int32 amount, bool apply); void UpdateAttackPowerAndDamage(bool ranged = false); void UpdateShieldBlockValue(); void UpdateDamagePhysical(WeaponAttackType attType); diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index d263b37e6ef..fda1d0002ca 100755 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -273,12 +273,6 @@ void Player::UpdateMaxPower(Powers power) SetMaxPower(power, uint32(value)); } -void Player::ApplyFeralAPBonus(int32 amount, bool apply) -{ - _ModifyUInt32(apply, m_baseFeralAP, amount); - UpdateAttackPowerAndDamage(); -} - void Player::UpdateAttackPowerAndDamage(bool ranged) { float val2 = 0.0f; -- cgit v1.2.3 From f69a8f4e763c8df10c1767fc82698292f323c7ad Mon Sep 17 00:00:00 2001 From: Shocker Date: Sat, 26 Nov 2011 23:57:11 +0200 Subject: Core/Spells: Remove outdated code for Hand of Reckoning --- src/server/game/Spells/SpellEffects.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index e95203d97be..f88468e44b3 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -3981,9 +3981,6 @@ void Spell::EffectTaunt(SpellEffIndex /*effIndex*/) return; } - if (m_spellInfo->Id == 62124) - m_caster->CastSpell(unitTarget, 67485, true); - // Also use this effect to set the taunter's threat to the taunted creature's highest value if (unitTarget->getThreatManager().getCurrentVictim()) { -- cgit v1.2.3 From 5b6b8dd5772f842f7524ac2a2468313c642313f0 Mon Sep 17 00:00:00 2001 From: Shocker Date: Sun, 27 Nov 2011 00:13:50 +0200 Subject: Core/Spells: Remove hardcoded value for dual wield talent removal and handle them for all classes Also fix IsAffectingSpell compile errors after recent merge --- src/server/game/Entities/Player/Player.cpp | 15 +++++++++++++-- src/server/game/Entities/Unit/Unit.cpp | 2 +- src/server/game/Spells/Auras/SpellAuraEffects.h | 2 +- 3 files changed, 15 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index a106534b3e5..70eb66090af 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -4170,8 +4170,19 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank) if (spell_id == 46917 && m_canTitanGrip) SetCanTitanGrip(false); - if (spell_id == 674 && m_canDualWield) - SetCanDualWield(false); + if (m_canDualWield) + { + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell_id); + if (spellInfo->IsPassive()) + { + for (int i = 0; i < MAX_SPELL_EFFECTS; i++) + if (spellInfo->Effects[i].Effect == SPELL_EFFECT_DUAL_WIELD) + { + SetCanDualWield(false); + break; + } + } + } if (sWorld->getBoolConfig(CONFIG_OFFHAND_CHECK_AT_SPELL_UNLEARN)) AutoUnequipOffhandIfNeed(); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 816392e47ae..a157da6ed49 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -1529,7 +1529,7 @@ uint32 Unit::CalcArmorReducedDamage(Unit* victim, const uint32 damage, SpellInfo { if ((*itr)->GetSpellInfo()->EquippedItemClass == -1) { - if (!spellInfo || (*itr)->IsAffectedOnSpell(spellInfo) || (*itr)->GetMiscValue() & spellInfo->GetSchoolMask()) + if (!spellInfo || (*itr)->IsAffectingSpell(spellInfo) || (*itr)->GetMiscValue() & spellInfo->GetSchoolMask()) bonusPct += (*itr)->GetAmount(); else if (!(*itr)->GetMiscValue() && !(*itr)->HasSpellClassMask()) bonusPct += (*itr)->GetAmount(); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.h b/src/server/game/Spells/Auras/SpellAuraEffects.h index 7f754253719..53757b102f2 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.h +++ b/src/server/game/Spells/Auras/SpellAuraEffects.h @@ -79,7 +79,7 @@ class AuraEffect bool IsPeriodic() const { return m_isPeriodic; } void SetPeriodic(bool isPeriodic) { m_isPeriodic = isPeriodic; } - bool IsAffectedOnSpell(SpellInfo const* spell) const; + bool IsAffectingSpell(SpellInfo const* spell) const; bool HasSpellClassMask() const { return m_spellInfo->Effects[m_effIndex].SpellClassMask; } void SendTickImmune(Unit* target, Unit* caster) const; -- cgit v1.2.3 From c1a6e8d7168acee1bfcddf77414479892fdc32d7 Mon Sep 17 00:00:00 2001 From: Shocker Date: Sun, 27 Nov 2011 00:29:44 +0200 Subject: Core/Achievements: Implement ACHIEVEMENT_CRITERIA_TYPE_CURRENCY --- src/server/game/Achievements/AchievementMgr.cpp | 11 +++++++++++ src/server/game/DataStores/DBCEnums.h | 1 + src/server/game/DataStores/DBCStructure.h | 7 +++++++ src/server/game/Entities/Player/Player.cpp | 3 +++ 4 files changed, 22 insertions(+) (limited to 'src') diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 448f14874f9..f62985c3426 100755 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -1562,6 +1562,15 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui break; } + case ACHIEVEMENT_CRITERIA_TYPE_CURRENCY: + if (!miscValue1 || !miscValue2) + continue; + if (miscValue1 != achievementCriteria->currencyGain.currency) + continue; + if (int64(miscValue2) < 0) + continue; + SetCriteriaProgress(achievementCriteria, miscValue2, PROGRESS_ACCUMULATE); + break; // std case: not exist in DBC, not triggered in code as result case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEALTH: case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_SPELLPOWER: @@ -1731,6 +1740,8 @@ bool AchievementMgr::IsCompletedCriteria(AchievementCriteriaEntry const* achieve return progress->counter >= achievementCriteria->use_lfg.dungeonsComplete; case ACHIEVEMENT_CRITERIA_TYPE_GET_KILLING_BLOWS: return progress->counter >= achievementCriteria->get_killing_blow.killCount; + case ACHIEVEMENT_CRITERIA_TYPE_CURRENCY: + return progress->counter >= achievementCriteria->currencyGain.count; // handle all statistic-only criteria here case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_BATTLEGROUND: case ACHIEVEMENT_CRITERIA_TYPE_DEATH_AT_MAP: diff --git a/src/server/game/DataStores/DBCEnums.h b/src/server/game/DataStores/DBCEnums.h index e9f4fa5ea63..f523f559172 100755 --- a/src/server/game/DataStores/DBCEnums.h +++ b/src/server/game/DataStores/DBCEnums.h @@ -126,6 +126,7 @@ enum AchievementCriteriaTypes // you have to complete a daily quest x times in a row ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST_DAILY = 10, ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUESTS_IN_ZONE = 11, + ACHIEVEMENT_CRITERIA_TYPE_CURRENCY = 12, ACHIEVEMENT_CRITERIA_TYPE_DAMAGE_DONE = 13, ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST = 14, ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_BATTLEGROUND= 15, diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index ae71b24bdcb..03f3f1b1145 100755 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -127,6 +127,13 @@ struct AchievementCriteriaEntry uint32 questCount; // 4 } complete_quests_in_zone; + // ACHIEVEMENT_CRITERIA_TYPE_CURRENCY = 12 + struct + { + uint32 currency; + uint32 count; + } currencyGain; + // ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST = 14 struct { diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 70eb66090af..861fcfb91c6 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -7364,6 +7364,9 @@ void Player::ModifyCurrency(uint32 id, int32 count) // probably excessive checks if (IsInWorld() && !GetSession()->PlayerLoading()) { + if (count > 0) + GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CURRENCY, id, count); + WorldPacket packet(SMSG_UPDATE_CURRENCY, 12); packet << uint32(id); packet << uint32(weekCap ? (newWeekCount / PLAYER_CURRENCY_PRECISION) : 0); -- cgit v1.2.3 From abb82345a4bb50ebd8a392c31dc0ab303931cc5d Mon Sep 17 00:00:00 2001 From: Shocker Date: Sun, 27 Nov 2011 00:43:03 +0200 Subject: Core/Pets: Water Elementals are now permanent pets --- src/server/game/Entities/Pet/Pet.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index 3a4e516dccf..3c0af8a1bfd 100755 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -1720,6 +1720,8 @@ bool Pet::IsPermanentPetFor(Player* owner) return GetCreatureInfo()->type == CREATURE_TYPE_DEMON; case CLASS_DEATH_KNIGHT: return GetCreatureInfo()->type == CREATURE_TYPE_UNDEAD; + case CLASS_MAGE: + return GetCreatureInfo()->type == CREATURE_TYPE_ELEMENTAL; default: return false; } -- cgit v1.2.3 From 97d85e00c23d01e4af2ac94801fc59700e2e7e13 Mon Sep 17 00:00:00 2001 From: Shocker Date: Sun, 27 Nov 2011 01:00:29 +0200 Subject: Core/Spells: Remove outdated code for Predatory Strikes --- src/server/game/Entities/Unit/StatSystem.cpp | 40 ++-------------------------- 1 file changed, 2 insertions(+), 38 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index fda1d0002ca..c73850d44c2 100755 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -337,51 +337,15 @@ void Player::UpdateAttackPowerAndDamage(bool ranged) break; case CLASS_DRUID: { - // Check if Predatory Strikes is skilled - float mLevelMult = 0.0f; - float weapon_bonus = 0.0f; - if (IsInFeralForm()) - { - Unit::AuraEffectList const& mDummy = GetAuraEffectsByType(SPELL_AURA_DUMMY); - for (Unit::AuraEffectList::const_iterator itr = mDummy.begin(); itr != mDummy.end(); ++itr) - { - AuraEffect* aurEff = *itr; - if (aurEff->GetSpellInfo()->SpellIconID == 1563) - { - switch (aurEff->GetEffIndex()) - { - case 0: // Predatory Strikes (effect 0) - mLevelMult = CalculatePctN(1.0f, aurEff->GetAmount()); - break; - case 1: // Predatory Strikes (effect 1) - if (Item* mainHand = m_items[EQUIPMENT_SLOT_MAINHAND]) - { - // also gains % attack power from equipped weapon - ItemTemplate const* proto = mainHand->GetTemplate(); - if (!proto) - continue; - - weapon_bonus = CalculatePctN(float(proto->getFeralBonus()), aurEff->GetAmount()); - } - break; - default: - break; - } - } - } - } - switch (GetShapeshiftForm()) { case FORM_CAT: - val2 = getLevel() * (mLevelMult + 2.0f) + GetStat(STAT_STRENGTH) * 2.0f + GetStat(STAT_AGILITY) - 20.0f + weapon_bonus + m_baseFeralAP; + val2 = GetStat(STAT_STRENGTH) * 2.0f + GetStat(STAT_AGILITY) - 20.0f + m_baseFeralAP; break; case FORM_BEAR: case FORM_DIREBEAR: - val2 = getLevel() * (mLevelMult + 3.0f) + GetStat(STAT_STRENGTH) * 2.0f - 20.0f + weapon_bonus + m_baseFeralAP; - break; case FORM_MOONKIN: - val2 = getLevel() * (mLevelMult + 1.5f) + GetStat(STAT_STRENGTH) * 2.0f - 20.0f + m_baseFeralAP; + val2 = GetStat(STAT_STRENGTH) * 2.0f - 20.0f + m_baseFeralAP; break; default: val2 = GetStat(STAT_STRENGTH) * 2.0f - 20.0f; -- cgit v1.2.3 From e6b120032db3c669c8539cc6da3a838da6691d19 Mon Sep 17 00:00:00 2001 From: Shocker Date: Sun, 27 Nov 2011 01:21:12 +0200 Subject: Core/Spells: Remove outdated code for Rockbiter Weapon --- src/server/game/Spells/SpellEffects.cpp | 52 --------------------------------- 1 file changed, 52 deletions(-) (limited to 'src') diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index f88468e44b3..b533b1a1fe3 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -3679,58 +3679,6 @@ void Spell::EffectEnchantItemTmp(SpellEffIndex effIndex) Player* p_caster = (Player*)m_caster; - // Rockbiter Weapon apply to both weapon - if (!itemTarget) - return; - if (m_spellInfo->SpellFamilyName == SPELLFAMILY_SHAMAN && m_spellInfo->SpellFamilyFlags[0] & 0x400000) - { - uint32 spell_id = 0; - - // enchanting spell selected by calculated damage-per-sec stored in Effect[1] base value - // Note: damage calculated (correctly) with rounding int32(float(v)) but - // RW enchantments applied damage int32(float(v)+0.5), this create 0..1 difference sometime - switch (damage) - { - // Rank 1 - case 2: spell_id = 36744; break; // 0% [ 7% == 2, 14% == 2, 20% == 2] - // Rank 2 - case 4: spell_id = 36753; break; // 0% [ 7% == 4, 14% == 4] - case 5: spell_id = 36751; break; // 20% - // Rank 3 - case 6: spell_id = 36754; break; // 0% [ 7% == 6, 14% == 6] - case 7: spell_id = 36755; break; // 20% - // Rank 4 - case 9: spell_id = 36761; break; // 0% [ 7% == 6] - case 10: spell_id = 36758; break; // 14% - case 11: spell_id = 36760; break; // 20% - default: - sLog->outError("Spell::EffectEnchantItemTmp: Damage %u not handled in S'RW", damage); - return; - } - - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell_id); - if (!spellInfo) - { - sLog->outError("Spell::EffectEnchantItemTmp: unknown spell id %i", spell_id); - return; - - } - - for (int j = BASE_ATTACK; j <= OFF_ATTACK; ++j) - { - if (Item* item = p_caster->GetWeaponForAttack(WeaponAttackType(j))) - { - if (item->IsFitToSpellRequirements(m_spellInfo)) - { - Spell* spell = new Spell(m_caster, spellInfo, TRIGGERED_FULL_MASK); - SpellCastTargets targets; - targets.SetItemTarget(item); - spell->prepare(&targets); - } - } - } - return; - } if (!itemTarget) return; -- cgit v1.2.3 From 007fed581d6ab647309522f6ab3ad8a3c7da0017 Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 27 Nov 2011 00:51:23 +0000 Subject: Core/Unit: Update `creature_template` table and SMSG_CREATURE_QUERY_RESPONSE --- .../4.x/2011_11_26_08_world_creature_template.sql | 2 + src/server/game/Entities/Creature/Creature.h | 6 +- src/server/game/Globals/ObjectMgr.cpp | 142 +++++++++++---------- src/server/game/Miscellaneous/SharedDefines.h | 13 +- .../game/Server/Protocol/Handlers/QueryHandler.cpp | 7 +- 5 files changed, 92 insertions(+), 78 deletions(-) create mode 100644 sql/updates/world/4.x/2011_11_26_08_world_creature_template.sql (limited to 'src') diff --git a/sql/updates/world/4.x/2011_11_26_08_world_creature_template.sql b/sql/updates/world/4.x/2011_11_26_08_world_creature_template.sql new file mode 100644 index 00000000000..b887038b908 --- /dev/null +++ b/sql/updates/world/4.x/2011_11_26_08_world_creature_template.sql @@ -0,0 +1,2 @@ +ALTER TABLE `creature_template` ADD `exp_unk` SMALLINT(2) NOT NULL DEFAULT '0' AFTER `exp`; +ALTER TABLE `creature_template` ADD `type_flags2` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `type_flags`; diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index 665942e134a..c21ad246044 100755 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -95,6 +95,7 @@ struct CreatureTemplate uint8 minlevel; uint8 maxlevel; uint32 expansion; + uint32 expansionUnknown; // either 0 or 3, sent to the client / wdb uint32 faction_A; uint32 faction_H; uint32 npcflag; @@ -122,6 +123,7 @@ struct CreatureTemplate uint32 rangedattackpower; uint32 type; // enum CreatureType values uint32 type_flags; // enum CreatureTypeFlags mask values + uint32 type_flags2; // unknown enum, only set for 4 creatures (with value 1) uint32 lootid; uint32 pickpocketLootId; uint32 SkinLootId; @@ -175,8 +177,8 @@ struct CreatureTemplate typedef UNORDERED_MAP CreatureTemplateContainer; // Represents max amount of expansions. -// TODO: Add MAX_EXPANSION constant. -#define MAX_CREATURE_BASE_HP 3 +// TODO: Update to Cata, if required +#define MAX_CREATURE_BASE_HP MAX_EXPANSION - 1 // Defines base stats for creatures (used to calculate HP/mana/armor). struct CreatureBaseStats diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index bac87dd1f25..be9c11a0f26 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -393,19 +393,19 @@ void ObjectMgr::LoadCreatureTemplates() // 0 1 2 3 4 5 6 7 8 QueryResult result = WorldDatabase.Query("SELECT entry, difficulty_entry_1, difficulty_entry_2, difficulty_entry_3, KillCredit1, KillCredit2, modelid1, modelid2, modelid3, " - // 9 10 11 12 13 14 15 16 17 18 19 20 21 - "modelid4, name, subname, IconName, gossip_menu_id, minlevel, maxlevel, exp, faction_A, faction_H, npcflag, speed_walk, speed_run, " - // 22 23 24 25 26 27 28 29 30 31 32 - "scale, rank, mindmg, maxdmg, dmgschool, attackpower, dmg_multiplier, baseattacktime, rangeattacktime, unit_class, unit_flags, " - // 33 34 35 36 37 38 39 40 41 42 + // 9 10 11 12 13 14 15 16 17 18 19 20 21 + "modelid4, name, subname, IconName, gossip_menu_id, minlevel, maxlevel, exp, exp_unk, faction_A, faction_H, npcflag, speed_walk, " + // 22 23 24 25 26 27 28 29 30 31 32 33 + "speed_run, scale, rank, mindmg, maxdmg, dmgschool, attackpower, dmg_multiplier, baseattacktime, rangeattacktime, unit_class, unit_flags, " + // 34 35 36 37 38 39 40 41 42 43 "dynamicflags, family, trainer_type, trainer_spell, trainer_class, trainer_race, minrangedmg, maxrangedmg, rangedattackpower, type, " - // 43 44 45 46 47 48 49 50 51 52 53 - "type_flags, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, spell1, " - // 54 55 56 57 58 59 60 61 62 63 64 65 66 - "spell2, spell3, spell4, spell5, spell6, spell7, spell8, PetSpellDataId, VehicleId, mingold, maxgold, AIName, MovementType, " - // 67 68 69 70 71 72 73 74 75 76 77 + // 44 45 46 47 48 49 50 51 52 53 54 + "type_flags, type_flags2, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, " + // 55 56 57 58 59 60 61 62 63 64 65 66 67 68 + "spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, PetSpellDataId, VehicleId, mingold, maxgold, AIName, MovementType, " + // 68 69 70 71 72 73 74 75 76 77 78 "InhabitType, Health_mod, Mana_mod, Armor_mod, RacialLeader, questItem1, questItem2, questItem3, questItem4, questItem5, questItem6, " - // 78 79 80 81 82 83 + // 79 80 81 82 83 84 "movementId, RegenHealth, equipment_id, mechanic_immune_mask, flags_extra, ScriptName " "FROM creature_template;"); @@ -449,70 +449,66 @@ void ObjectMgr::LoadCreatureTemplates() creatureTemplate.minlevel = fields[14].GetUInt8(); creatureTemplate.maxlevel = fields[15].GetUInt8(); creatureTemplate.expansion = uint32(fields[16].GetUInt16()); - creatureTemplate.faction_A = uint32(fields[17].GetUInt16()); - creatureTemplate.faction_H = uint32(fields[18].GetUInt16()); - creatureTemplate.npcflag = fields[19].GetUInt32(); - creatureTemplate.speed_walk = fields[20].GetFloat(); - creatureTemplate.speed_run = fields[21].GetFloat(); - creatureTemplate.scale = fields[22].GetFloat(); - creatureTemplate.rank = uint32(fields[23].GetUInt8()); - creatureTemplate.mindmg = fields[24].GetFloat(); - creatureTemplate.maxdmg = fields[25].GetFloat(); - creatureTemplate.dmgschool = uint32(fields[26].GetInt8()); - creatureTemplate.attackpower = fields[27].GetUInt32(); - creatureTemplate.dmg_multiplier = fields[28].GetFloat(); - creatureTemplate.baseattacktime = fields[29].GetUInt32(); - creatureTemplate.rangeattacktime = fields[30].GetUInt32(); - creatureTemplate.unit_class = uint32(fields[31].GetUInt8()); - creatureTemplate.unit_flags = fields[32].GetUInt32(); - creatureTemplate.dynamicflags = fields[33].GetUInt32(); - creatureTemplate.family = uint32(fields[34].GetUInt8()); - creatureTemplate.trainer_type = uint32(fields[35].GetUInt8()); - creatureTemplate.trainer_spell = fields[36].GetUInt32(); - creatureTemplate.trainer_class = uint32(fields[37].GetUInt8()); - creatureTemplate.trainer_race = uint32(fields[38].GetUInt8()); - creatureTemplate.minrangedmg = fields[39].GetFloat(); - creatureTemplate.maxrangedmg = fields[40].GetFloat(); - creatureTemplate.rangedattackpower = uint32(fields[41].GetUInt16()); - creatureTemplate.type = uint32(fields[42].GetUInt8()); - creatureTemplate.type_flags = fields[43].GetUInt32(); - creatureTemplate.lootid = fields[44].GetUInt32(); - creatureTemplate.pickpocketLootId = fields[45].GetUInt32(); - creatureTemplate.SkinLootId = fields[46].GetUInt32(); + creatureTemplate.expansionUnknown = uint32(fields[17].GetUInt16()); + creatureTemplate.faction_A = uint32(fields[18].GetUInt16()); + creatureTemplate.faction_H = uint32(fields[19].GetUInt16()); + creatureTemplate.npcflag = fields[20].GetUInt32(); + creatureTemplate.speed_walk = fields[21].GetFloat(); + creatureTemplate.speed_run = fields[22].GetFloat(); + creatureTemplate.scale = fields[23].GetFloat(); + creatureTemplate.rank = uint32(fields[24].GetUInt8()); + creatureTemplate.mindmg = fields[25].GetFloat(); + creatureTemplate.maxdmg = fields[26].GetFloat(); + creatureTemplate.dmgschool = uint32(fields[27].GetInt8()); + creatureTemplate.attackpower = fields[28].GetUInt32(); + creatureTemplate.dmg_multiplier = fields[29].GetFloat(); + creatureTemplate.baseattacktime = fields[30].GetUInt32(); + creatureTemplate.rangeattacktime = fields[31].GetUInt32(); + creatureTemplate.unit_class = uint32(fields[32].GetUInt8()); + creatureTemplate.unit_flags = fields[33].GetUInt32(); + creatureTemplate.dynamicflags = fields[34].GetUInt32(); + creatureTemplate.family = uint32(fields[35].GetUInt8()); + creatureTemplate.trainer_type = uint32(fields[36].GetUInt8()); + creatureTemplate.trainer_spell = fields[37].GetUInt32(); + creatureTemplate.trainer_class = uint32(fields[38].GetUInt8()); + creatureTemplate.trainer_race = uint32(fields[39].GetUInt8()); + creatureTemplate.minrangedmg = fields[40].GetFloat(); + creatureTemplate.maxrangedmg = fields[41].GetFloat(); + creatureTemplate.rangedattackpower = uint32(fields[42].GetUInt16()); + creatureTemplate.type = uint32(fields[43].GetUInt8()); + creatureTemplate.type_flags = fields[44].GetUInt32(); + creatureTemplate.type_flags2 = fields[45].GetUInt32(); + creatureTemplate.lootid = fields[46].GetUInt32(); + creatureTemplate.pickpocketLootId = fields[47].GetUInt32(); + creatureTemplate.SkinLootId = fields[48].GetUInt32(); for (uint8 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i) - { - creatureTemplate.resistance[i] = fields[47 + i -1].GetInt32(); - } + creatureTemplate.resistance[i] = fields[50 + i -1].GetInt32(); for (uint8 i = 0; i < CREATURE_MAX_SPELLS; ++i) - { - creatureTemplate.spells[i] = fields[53 + i].GetUInt32(); - } - - creatureTemplate.PetSpellDataId = fields[61].GetUInt32(); - creatureTemplate.VehicleId = fields[62].GetUInt32(); - creatureTemplate.mingold = fields[63].GetUInt32(); - creatureTemplate.maxgold = fields[64].GetUInt32(); - creatureTemplate.AIName = fields[65].GetString(); - creatureTemplate.MovementType = uint32(fields[66].GetUInt8()); - creatureTemplate.InhabitType = uint32(fields[67].GetUInt8()); - creatureTemplate.ModHealth = fields[68].GetFloat(); - creatureTemplate.ModMana = fields[69].GetFloat(); - creatureTemplate.ModArmor = fields[70].GetFloat(); - creatureTemplate.RacialLeader = fields[71].GetBool(); + creatureTemplate.spells[i] = fields[55 + i].GetUInt32(); + + creatureTemplate.PetSpellDataId = fields[63].GetUInt32(); + creatureTemplate.VehicleId = fields[64].GetUInt32(); + creatureTemplate.mingold = fields[65].GetUInt32(); + creatureTemplate.maxgold = fields[66].GetUInt32(); + creatureTemplate.AIName = fields[67].GetString(); + creatureTemplate.MovementType = uint32(fields[68].GetUInt8()); + creatureTemplate.InhabitType = uint32(fields[69].GetUInt8()); + creatureTemplate.ModHealth = fields[70].GetFloat(); + creatureTemplate.ModMana = fields[71].GetFloat(); + creatureTemplate.ModArmor = fields[72].GetFloat(); + creatureTemplate.RacialLeader = fields[73].GetBool(); for (uint8 i = 0; i < MAX_CREATURE_QUEST_ITEMS; ++i) - { - creatureTemplate.questItems[i] = fields[72 + i].GetUInt32(); - } + creatureTemplate.questItems[i] = fields[74 + i].GetUInt32(); - creatureTemplate.movementId = fields[78].GetUInt32(); - creatureTemplate.RegenHealth = fields[79].GetBool(); - creatureTemplate.equipmentId = fields[80].GetUInt32(); - creatureTemplate.MechanicImmuneMask = fields[81].GetUInt32(); - creatureTemplate.flags_extra = fields[82].GetUInt32(); - creatureTemplate.ScriptID = GetScriptId(fields[83].GetCString()); + creatureTemplate.movementId = fields[80].GetUInt32(); + creatureTemplate.RegenHealth = fields[81].GetBool(); + creatureTemplate.equipmentId = fields[82].GetUInt32(); + creatureTemplate.MechanicImmuneMask = fields[83].GetUInt32(); + creatureTemplate.flags_extra = fields[84].GetUInt32(); + creatureTemplate.ScriptID = GetScriptId(fields[85].GetCString()); ++count; } @@ -881,12 +877,18 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo) const_cast(cInfo)->scale = 1.0f; } - if (cInfo->expansion > (MAX_CREATURE_BASE_HP - 1)) + if (cInfo->expansion > MAX_EXPANSION) { - sLog->outErrorDb("Table `creature_template` lists creature (Entry: %u) with expansion %u. Ignored and set to 0.", cInfo->Entry, cInfo->expansion); + sLog->outErrorDb("Table `creature_template` lists creature (Entry: %u) with `exp` %u. Ignored and set to 0.", cInfo->Entry, cInfo->expansion); const_cast(cInfo)->expansion = 0; } + if (cInfo->expansionUnknown > MAX_EXPANSION) + { + sLog->outErrorDb("Table `creature_template` lists creature (Entry: %u) with `exp_unk` %u. Ignored and set to 0.", cInfo->Entry, cInfo->expansionUnknown); + const_cast(cInfo)->expansionUnknown = 0; + } + if (uint32 badFlags = (cInfo->flags_extra & ~CREATURE_FLAG_EXTRA_DB_ALLOWED)) { sLog->outErrorDb("Table `creature_template` lists creature (Entry: %u) with disallowed `flags_extra` %u, removing incorrect flag.", cInfo->Entry, badFlags); diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index d539b73fae6..c7994125446 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -22,6 +22,8 @@ #include "Define.h" #include +#define MAX_EXPANSION 4 + enum SpellEffIndex { EFFECT_0 = 0, @@ -33,14 +35,15 @@ enum SpellEffIndex #define EFFECT_FIRST_FOUND 254 #define EFFECT_ALL 255 + // loot modes for creatures and gameobjects, bitmask! enum LootModes { - LOOT_MODE_DEFAULT = 1, - LOOT_MODE_HARD_MODE_1 = 2, - LOOT_MODE_HARD_MODE_2 = 4, - LOOT_MODE_HARD_MODE_3 = 8, - LOOT_MODE_HARD_MODE_4 = 16 + LOOT_MODE_DEFAULT = 0x1, + LOOT_MODE_HARD_MODE_1 = 0x2, + LOOT_MODE_HARD_MODE_2 = 0x4, + LOOT_MODE_HARD_MODE_3 = 0x8, + LOOT_MODE_HARD_MODE_4 = 0x16 }; enum Gender diff --git a/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp b/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp index bf951619e63..e194f57ba09 100755 --- a/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp @@ -128,10 +128,14 @@ void WorldSession::HandleCreatureQueryOpcode(WorldPacket & recv_data) WorldPacket data(SMSG_CREATURE_QUERY_RESPONSE, 100); data << uint32(entry); // creature entry data << Name; - data << uint8(0) << uint8(0) << uint8(0); // name2, name3, name4, always empty + + for (int i = 0; i < 7; i++) + data << uint8(0); // name2, ..., name8 + data << SubName; data << ci->IconName; // "Directions" for guard, string for Icons 2.3.0 data << uint32(ci->type_flags); // flags + data << uint32(ci->type_flags2); // unknown meaning data << uint32(ci->type); // CreatureType.dbc data << uint32(ci->family); // CreatureFamily.dbc data << uint32(ci->rank); // Creature Rank (elite, boss, etc) @@ -147,6 +151,7 @@ void WorldSession::HandleCreatureQueryOpcode(WorldPacket & recv_data) for (uint32 i = 0; i < MAX_CREATURE_QUEST_ITEMS; ++i) data << uint32(ci->questItems[i]); // itemId[6], quest drop data << uint32(ci->movementId); // CreatureMovementInfo.dbc + data << uint32(ci->expansionUnknown); // unknown meaning SendPacket(&data); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_CREATURE_QUERY_RESPONSE"); } -- cgit v1.2.3 From 35bc064407f9729a60d66226fe45ce1a01f1447c Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 27 Nov 2011 01:28:56 +0000 Subject: DB/Player: Add class/race level stats for the new combos (level 1 only); Core/Misc: Set RecruitAFriend.MaxLevel to 80 (from 60); Also fix a typo in previous commit (thanks @Blumster) --- .../4.x/2011_11_27_00_world_player_levelstats.sql | 66 ++++++++++++++++++++++ src/server/game/Miscellaneous/SharedDefines.h | 2 +- src/server/worldserver/worldserver.conf.dist | 4 +- 3 files changed, 69 insertions(+), 3 deletions(-) create mode 100644 sql/updates/world/4.x/2011_11_27_00_world_player_levelstats.sql (limited to 'src') diff --git a/sql/updates/world/4.x/2011_11_27_00_world_player_levelstats.sql b/sql/updates/world/4.x/2011_11_27_00_world_player_levelstats.sql new file mode 100644 index 00000000000..dfecacdaf07 --- /dev/null +++ b/sql/updates/world/4.x/2011_11_27_00_world_player_levelstats.sql @@ -0,0 +1,66 @@ +-- Races: +SET @HUMAN := 1; +SET @ORC := 2; +SET @DWARF := 3; +SET @NIGHT_ELF := 4; +SET @UNDEAD := 5; +SET @TAUREN := 6; +SET @GNOME := 7; +SET @TROLL := 8; +SET @GOBLIN := 9; +SET @BLOOD_ELF := 10; +SET @DRAENEI := 11; +SET @WORGEN := 22; +-- Classes: +SET @WARRIOR := 1; +SET @PALADIN := 2; +SET @HUNTER := 3; +SET @ROGUE := 4; +SET @PRIEST := 5; +SET @DK := 6; +SET @SHAMAN := 7; +SET @MAGE := 8; +SET @WARLOCK := 9; +SET @DRUID := 11; + +DELETE FROM `player_levelstats` WHERE +((`class`=@WARRIOR AND `race` IN (@BLOOD_ELF, @GOBLIN, @WORGEN)) OR +(`class`=@PALADIN AND `race` IN (@TAUREN)) OR +(`class`=@HUNTER AND `race` IN (@HUMAN, @GOBLIN, @WORGEN, @UNDEAD)) OR +(`class`=@ROGUE AND `race` IN (@GOBLIN, @WORGEN)) OR +(`class`=@PRIEST AND `race` IN (@GNOME, @GOBLIN, @WORGEN, @TAUREN)) OR +(`class`=@SHAMAN AND `race` IN (@GOBLIN, @DWARF)) OR +(`class`=@MAGE AND `race` IN (@DWARF, @GOBLIN, @WORGEN, @NIGHT_ELF, @ORC)) OR +(`class`=@WARLOCK AND `race` IN (@DWARF, @GOBLIN, @WORGEN, @TROLL)) OR +(`class`=@DRUID AND `race` IN (@WORGEN, @TROLL))) AND `level`=1; +DELETE FROM `player_levelstats` WHERE `class`=@DK AND `race` IN (@GOBLIN, @WORGEN) AND `level`=55; +INSERT INTO `player_levelstats` (`class`, `race`, `level`, `str`, `agi`, `sta`, `inte`, `spi`) VALUES +(@WARRIOR, @BLOOD_ELF, 1, 20, 22, 20, 24, 19), +(@WARRIOR, @GOBLIN, 1, 20, 22, 22, 23, 18), +(@WARRIOR, @WORGEN, 1, 26, 22, 22, 16, 19), +(@PALADIN, @TAUREN, 1, 27, 15, 24, 15, 23), +(@HUNTER, @HUMAN, 1, 20, 23, 21, 20, 21), +(@HUNTER, @WORGEN, 1, 23, 25, 21, 16, 20), +(@HUNTER, @UNDEAD, 1, 19, 21, 22, 18, 26), +(@HUNTER, @GOBLIN, 1, 17, 25, 21, 23, 19), +(@ROGUE, @WORGEN, 1, 23, 25, 21, 16, 19), +(@ROGUE, @GOBLIN, 1, 18, 25, 21, 23, 18), +(@PRIEST, @GNOME, 1, 15 ,23, 19, 25, 23), +(@PRIEST, @WORGEN, 1, 23 ,22, 20, 18, 22), +(@PRIEST, @GOBLIN, 1, 17 ,22, 20, 25, 21), +(@PRIEST, @TAUREN, 1, 25 ,15, 22, 17, 25), +(@DK, @WORGEN, 55, 111, 75, 99, 25, 41), +(@DK, @GOBLIN, 55, 105, 75, 99, 32, 40), +(@SHAMAN, @DWARF, 1, 22, 16, 23, 22, 21), +(@SHAMAN, @GOBLIN, 1, 18, 22, 21, 24, 20), +(@MAGE, @DWARF, 1, 22, 16, 23, 22, 21), +(@MAGE, @NIGHT_ELF, 1, 17, 25, 19, 23, 22), +(@MAGE, @WORGEN, 1, 23, 22, 20, 19, 21), +(@MAGE, @GOBLIN, 1, 17, 22, 20, 26, 20), +(@MAGE, @ORC, 1, 23, 17, 22, 20, 25), +(@WARLOCK, @WORGEN, 1, 23, 22, 21, 18, 21), +(@WARLOCK, @DWARF, 1, 22, 16, 24, 21, 21), +(@WARLOCK, @GOBLIN, 1, 17, 22, 21, 25, 20), +(@WARLOCK, @TROLL, 1, 21, 22, 22, 18, 23), +(@DRUID, @WORGEN, 1, 24, 22, 20, 18, 21), +(@DRUID, @TROLL, 1, 22, 22, 21, 18, 23); diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index c7994125446..8c4dba94201 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -43,7 +43,7 @@ enum LootModes LOOT_MODE_HARD_MODE_1 = 0x2, LOOT_MODE_HARD_MODE_2 = 0x4, LOOT_MODE_HARD_MODE_3 = 0x8, - LOOT_MODE_HARD_MODE_4 = 0x16 + LOOT_MODE_HARD_MODE_4 = 0x10 }; enum Gender diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index 818db5d46b8..6cff44baca8 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -1109,9 +1109,9 @@ StartArenaPoints = 0 # RecruitAFriend.MaxLevel # Description: Highest level up to which a character can benefit from the Recruit-A-Friend # experience multiplier. -# Default: 60 +# Default: 80 -RecruitAFriend.MaxLevel = 60 +RecruitAFriend.MaxLevel = 80 # # RecruitAFriend.MaxDifference -- cgit v1.2.3 From 50f8881494f83b385b676c43ef00810eb45864a7 Mon Sep 17 00:00:00 2001 From: kaelima Date: Sun, 27 Nov 2011 03:40:03 +0100 Subject: Core/Player: Store guild id inside protected integer instead of fetching from db. Still have method GetGuildIdFromGuid though if player is offline. --- src/server/game/Chat/Commands/Level3.cpp | 6 +++--- src/server/game/Entities/Player/Player.cpp | 25 ++++++++++++---------- src/server/game/Entities/Player/Player.h | 13 +++++------ src/server/game/Guilds/Guild.cpp | 2 +- .../Database/Implementation/CharacterDatabase.cpp | 8 +++---- 5 files changed, 27 insertions(+), 27 deletions(-) (limited to 'src') diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp index aecf9122f5b..9276c536101 100755 --- a/src/server/game/Chat/Commands/Level3.cpp +++ b/src/server/game/Chat/Commands/Level3.cpp @@ -1725,7 +1725,7 @@ bool ChatHandler::HandleGuildUninviteCommand(const char *args) if (!extractPlayerTarget((char*)args, &target, &target_guid)) return false; - uint32 glId = target ? target->GetGuildId () : Player::GetGuildIdFromDB (target_guid); + uint32 glId = target ? target->GetGuildId() : Player::GetGuildIdFromGuid(target_guid); if (!glId) return false; @@ -1752,11 +1752,11 @@ bool ChatHandler::HandleGuildRankCommand(const char *args) if (!extractPlayerTarget(nameStr, &target, &target_guid, &target_name)) return false; - uint32 glId = target ? target->GetGuildId () : Player::GetGuildIdFromDB (target_guid); + uint32 glId = target ? target->GetGuildId() : Player::GetGuildIdFromGuid(target_guid); if (!glId) return false; - Guild* targetGuild = sGuildMgr->GetGuildById (glId); + Guild* targetGuild = sGuildMgr->GetGuildById(glId); if (!targetGuild) return false; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 861fcfb91c6..82d63790b32 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -692,6 +692,7 @@ Player::Player (WorldSession* session): Unit(), m_achievementMgr(this), m_reputa duel = NULL; m_GuildIdInvited = 0; + m_guildId = 0; m_ArenaTeamIdInvited = 0; m_atLoginFlags = AT_LOGIN_NONE; @@ -4804,7 +4805,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC // bones will be deleted by corpse/bones deleting thread shortly sObjectAccessor->ConvertCorpseForPlayer(playerguid); - if (uint32 guildId = GetGuildIdFromDB(playerguid)) + if (uint32 guildId = GetGuildIdFromGuid(playerguid)) if (Guild* guild = sGuildMgr->GetGuildById(guildId)) guild->DeleteMember(guid); @@ -5488,13 +5489,13 @@ uint32 Player::DurabilityRepair(uint16 pos, bool cost, float discountMod, bool g if (guildBank) { - if (GetGuildId() == 0) + if (m_guildId == 0) { sLog->outStaticDebug("You are not member of a guild"); return TotalCost; } - Guild* guild = sGuildMgr->GetGuildById(GetGuildId()); + Guild* guild = sGuildMgr->GetGuildById(m_guildId); if (!guild) return TotalCost; @@ -5574,7 +5575,7 @@ bool Player::CanJoinConstantChannelInZone(ChatChannelsEntry const* channel, Area if ((channel->flags & CHANNEL_DBC_FLAG_CITY_ONLY) && (!(zone->flags & AREA_FLAG_SLAVE_CAPITAL))) return false; - if ((channel->flags & CHANNEL_DBC_FLAG_GUILD_REQ) && GetGuildId()) + if ((channel->flags & CHANNEL_DBC_FLAG_GUILD_REQ) && m_guildId) return false; return true; @@ -7419,14 +7420,14 @@ uint32 Player::_GetCurrencyWeekCap(const CurrencyTypesEntry* currency) const return cap; } -uint32 Player::GetGuildIdFromDB(uint64 guid) +uint32 Player::GetGuildIdFromGuid(uint64 guid) { - QueryResult result = CharacterDatabase.PQuery("SELECT guildid FROM guild_member WHERE guid='%u'", GUID_LOPART(guid)); - if (!result) - return 0; + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_GET_GUILD_ID); + stmt->setUInt64(0, guid); + if (PreparedQueryResult result = CharacterDatabase.Query(stmt)) + return (*result)[0].GetUInt32(); - uint32 id = result->Fetch()[0].GetUInt32(); - return id; + return 0; } uint8 Player::GetRankFromDB(uint64 guid) @@ -17052,6 +17053,8 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) if (m_grantableLevels > 0) SetByteValue(PLAYER_FIELD_BYTES, 1, 0x01); + m_guildId = fields[62].GetUInt32(); + _LoadDeclinedNames(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADDECLINEDNAMES)); m_achievementMgr.CheckAllAchievementCriteria(); @@ -24484,7 +24487,7 @@ uint32 Player::GetReputation(uint32 factionentry) std::string Player::GetGuildName() { - return sGuildMgr->GetGuildById(GetGuildId())->GetName(); + return sGuildMgr->GetGuildById(m_guildId)->GetName(); } void Player::SendDuelCountdown(uint32 counter) diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 7e559b0e077..95197595bf2 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1840,19 +1840,14 @@ class Player : public Unit, public GridObject stmt->setUInt32(0, GuildId); stmt->setUInt64(1, GetGUID()); CharacterDatabase.Execute(stmt); + m_guildId = GuildId; } + uint32 GetGuildId() { return m_guildId; } + static uint32 GetGuildIdFromGuid(uint64 guid); - uint32 GetGuildId() - { - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_GET_GUILD_ID); - stmt->setUInt64(0, GetGUIDLow()); - PreparedQueryResult result = CharacterDatabase.Query(stmt); - return result ? (*result)[0].GetUInt32() : 0; - } void SetRank(uint8 rankId) { SetUInt32Value(PLAYER_GUILDRANK, rankId); } uint8 GetRank() { return uint8(GetUInt32Value(PLAYER_GUILDRANK)); } void SetGuildIdInvited(uint32 GuildId) { m_GuildIdInvited = GuildId; } - static uint32 GetGuildIdFromDB(uint64 guid); static uint8 GetRankFromDB(uint64 guid); int GetGuildIdInvited() { return m_GuildIdInvited; } static void RemovePetitionsAndSigns(uint64 guid, uint32 type); @@ -2758,6 +2753,8 @@ class Player : public Unit, public GridObject uint32 m_restTime; + uint32 m_guildId; + uint32 m_WeaponProficiency; uint32 m_ArmorProficiency; bool m_canParry; diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 59c107bd40f..1d5395b8ad1 100755 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -2073,7 +2073,7 @@ bool Guild::AddMember(uint64 guid, uint8 rankId) if (player->GetGuildId() != 0) return false; } - else if (Player::GetGuildIdFromDB(guid) != 0) + else if (Player::GetGuildIdFromGuid(guid) != 0) return false; // Remove all player signs from another petitions diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index b5ea47d1a53..70a5b69ae9d 100755 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -42,7 +42,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() "position_x, position_y, position_z, map, orientation, taximask, cinematic, totaltime, leveltime, rest_bonus, logout_time, is_logout_resting, resettalents_cost, " "resettalents_time, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, online, death_expire_time, taxi_path, instance_mode_mask, " "conquestPoints, totalHonorPoints, totalKills, todayKills, yesterdayKills, chosenTitle, watchedFaction, drunk, " - "health, power1, power2, power3, power4, power5, instance_id, speccount, activespec, exploredZones, equipmentCache, knownTitles, actionBars, grantableLevels FROM characters WHERE guid = ?", CONNECTION_ASYNC) + "health, power1, power2, power3, power4, power5, instance_id, speccount, activespec, exploredZones, equipmentCache, knownTitles, actionBars, grantableLevels, guildId FROM characters WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_LOAD_PLAYER_GROUP, "SELECT guid FROM group_member WHERE memberGuid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_LOAD_PLAYER_BOUNDINSTANCES, "SELECT id, permanent, map, difficulty, resettime FROM character_instance LEFT JOIN instance ON instance = id WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_LOAD_PLAYER_AURAS, "SELECT caster_guid, spell, effect_mask, recalculate_mask, stackcount, amount0, amount1, amount2, " @@ -311,12 +311,12 @@ void CharacterDatabaseConnection::DoPrepareStatements() "extra_flags, stable_slots, at_login, zone, " "death_expire_time, taxi_path, conquestPoints, totalHonorPoints, totalKills, " "todayKills, yesterdayKills, chosenTitle, watchedFaction, drunk, health, power1, power2, power3, " - "power4, power5, latency, speccount, activespec, exploredZones, equipmentCache, knownTitles, actionBars, grantableLevels, guildId) VALUES " - "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", CONNECTION_ASYNC); + "power4, power5, latency, speccount, activespec, exploredZones, equipmentCache, knownTitles, actionBars, grantableLevels) VALUES " + "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_UPD_CHARACTER, "UPDATE characters SET name=?,race=?,class=?,gender=?,level=?,xp=?,money=?,playerBytes=?,playerBytes2=?,playerFlags=?," "map=?,instance_id=?,instance_mode_mask=?,position_x=?,position_y=?,position_z=?,orientation=?,taximask=?,cinematic=?,totaltime=?,leveltime=?,rest_bonus=?," "logout_time=?,is_logout_resting=?,resettalents_cost=?,resettalents_time=?,extra_flags=?,stable_slots=?,at_login=?,zone=?,death_expire_time=?,taxi_path=?," "conquestPoints=?,totalHonorPoints=?,totalKills=?,todayKills=?,yesterdayKills=?,chosenTitle=?," "watchedFaction=?,drunk=?,health=?,power1=?,power2=?,power3=?,power4=?,power5=?,latency=?,speccount=?,activespec=?,exploredZones=?," - "equipmentCache=?,knownTitles=?,actionBars=?,grantableLevels=?,guildId=?,online=? WHERE guid=?", CONNECTION_ASYNC); + "equipmentCache=?,knownTitles=?,actionBars=?,grantableLevels=?,online=? WHERE guid=?", CONNECTION_ASYNC); } -- cgit v1.2.3 From b84d82e569848f6be08049c2c81f26b89ed30efa Mon Sep 17 00:00:00 2001 From: kaelima Date: Sun, 27 Nov 2011 04:02:59 +0100 Subject: Core/Protocol: Add some account data protocols. Their struct have not changed since 3.3.5a. --- src/server/game/Server/Protocol/Opcodes.cpp | 6 +++--- src/server/game/Server/Protocol/Opcodes.h | 2 +- src/server/game/Server/WorldSession.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 3152d19e744..2fd2c1410ff 100755 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -563,9 +563,9 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_CREATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_UPDATETEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketUpdateOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_UPDATETEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ACCOUNT_DATA_TIMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ACCOUNT_DATA_TIMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_ACCOUNT_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestAccountData ); - //DEFINE_OPCODE_HANDLER(CMSG_UPDATE_ACCOUNT_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateAccountData ); + DEFINE_OPCODE_HANDLER(CMSG_UPDATE_ACCOUNT_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateAccountData ); //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ACCOUNT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_FAR_SIGHT_IMMEDIATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHANGEPLAYER_DIFFICULTY_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1164,7 +1164,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_NOTES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_NOTES_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_UPDATE_MISSILE_TRAJECTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ACCOUNT_DATA_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ACCOUNT_DATA_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TRIGGER_MOVIE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_COMPLETE_MOVIE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_GLYPH_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index cd90f44cb68..c32c881b42c 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -525,7 +525,7 @@ enum Opcodes MSG_TABARDVENDOR_ACTIVATE = 0x98EB, // MSG_TALENT_WIPE_CONFIRM = 0x00, // OBSOLETE_DROP_ITEM = 0x00, // - SMSG_ACCOUNT_DATA_TIMES = 0x00, // + SMSG_ACCOUNT_DATA_TIMES = 0x5EE2, // SMSG_ACHIEVEMENT_DELETED = 0x00, // SMSG_ACHIEVEMENT_EARNED = 0x00, // SMSG_ACTION_BUTTONS = 0x00, // diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index 976ef4bd70b..35cf51b2f24 100755 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -679,8 +679,8 @@ void WorldSession::SetAccountData(AccountDataType type, time_t tm, std::string d void WorldSession::SendAccountDataTimes(uint32 mask) { - WorldPacket data(SMSG_ACCOUNT_DATA_TIMES, 4 + 1 + 4 + 8 * 4); // changed in WotLK - data << uint32(time(NULL)); // unix time of something + WorldPacket data(SMSG_ACCOUNT_DATA_TIMES, 4+1+4+NUM_ACCOUNT_DATA_TYPES*4); + data << uint32(time(NULL)); // Server time data << uint8(1); data << uint32(mask); // type mask for (uint32 i = 0; i < NUM_ACCOUNT_DATA_TYPES; ++i) -- cgit v1.2.3 From 70c3488dd0c5aa123cd1c15242add92187af7048 Mon Sep 17 00:00:00 2001 From: Rat Date: Sun, 27 Nov 2011 09:37:32 +0100 Subject: Core/Player: fixed player loading to reflect new DB changes - added missing changes to characters_datasabase.sql --- sql/base/characters_database.sql | 20 ++----------------- src/server/game/Entities/Player/Player.cpp | 32 +++++++++++++++--------------- 2 files changed, 18 insertions(+), 34 deletions(-) (limited to 'src') diff --git a/sql/base/characters_database.sql b/sql/base/characters_database.sql index 1410a5b0008..bce0a211b3c 100644 --- a/sql/base/characters_database.sql +++ b/sql/base/characters_database.sql @@ -1031,12 +1031,6 @@ CREATE TABLE `character_stats` ( `maxpower3` int(10) unsigned NOT NULL DEFAULT '0', `maxpower4` int(10) unsigned NOT NULL DEFAULT '0', `maxpower5` int(10) unsigned NOT NULL DEFAULT '0', - `maxpower6` int(10) unsigned NOT NULL DEFAULT '0', - `maxpower7` int(10) unsigned NOT NULL DEFAULT '0', - `maxpower8` int(10) unsigned NOT NULL DEFAULT '0', - `maxpower9` int(10) unsigned NOT NULL DEFAULT '0', - `maxpower10` int(10) unsigned NOT NULL DEFAULT '0', - `maxpower11` int(10) unsigned NOT NULL DEFAULT '0', `strength` int(10) unsigned NOT NULL DEFAULT '0', `agility` int(10) unsigned NOT NULL DEFAULT '0', `stamina` int(10) unsigned NOT NULL DEFAULT '0', @@ -1144,15 +1138,12 @@ CREATE TABLE `characters` ( `zone` smallint(5) unsigned NOT NULL DEFAULT '0', `death_expire_time` int(10) unsigned NOT NULL DEFAULT '0', `taxi_path` text, - `arenaPoints` int(10) unsigned NOT NULL DEFAULT '0', + `conquestPoints` int(10) unsigned NOT NULL DEFAULT '0', `totalHonorPoints` int(10) unsigned NOT NULL DEFAULT '0', - `todayHonorPoints` int(10) unsigned NOT NULL DEFAULT '0', - `yesterdayHonorPoints` int(10) unsigned NOT NULL DEFAULT '0', `totalKills` int(10) unsigned NOT NULL DEFAULT '0', `todayKills` smallint(5) unsigned NOT NULL DEFAULT '0', `yesterdayKills` smallint(5) unsigned NOT NULL DEFAULT '0', `chosenTitle` int(10) unsigned NOT NULL DEFAULT '0', - `knownCurrencies` bigint(20) unsigned NOT NULL DEFAULT '0', `watchedFaction` int(10) unsigned NOT NULL DEFAULT '0', `drunk` smallint(5) unsigned NOT NULL DEFAULT '0', `health` int(10) unsigned NOT NULL DEFAULT '0', @@ -1161,21 +1152,15 @@ CREATE TABLE `characters` ( `power3` int(10) unsigned NOT NULL DEFAULT '0', `power4` int(10) unsigned NOT NULL DEFAULT '0', `power5` int(10) unsigned NOT NULL DEFAULT '0', - `power6` int(10) unsigned NOT NULL DEFAULT '0', - `power7` int(10) unsigned NOT NULL DEFAULT '0', - `power8` int(10) unsigned NOT NULL DEFAULT '0', - `power9` int(10) unsigned NOT NULL DEFAULT '0', - `power10` int(10) unsigned NOT NULL DEFAULT '0', - `power11` int(10) unsigned NOT NULL DEFAULT '0', `latency` mediumint(8) unsigned NOT NULL DEFAULT '0', `speccount` tinyint(3) unsigned NOT NULL DEFAULT '1', `activespec` tinyint(3) unsigned NOT NULL DEFAULT '0', `exploredZones` longtext, `equipmentCache` longtext, - `ammoId` int(10) unsigned NOT NULL DEFAULT '0', `knownTitles` longtext, `actionBars` tinyint(3) unsigned NOT NULL DEFAULT '0', `grantableLevels` tinyint(3) unsigned NOT NULL DEFAULT '0', + `guildId` int(10) unsigned NOT NULL DEFAULT '0', `deleteInfos_Account` int(10) unsigned DEFAULT NULL, `deleteInfos_Name` varchar(12) DEFAULT NULL, `deleteDate` int(10) unsigned DEFAULT NULL, @@ -1215,7 +1200,6 @@ CREATE TABLE `corpse` ( `itemCache` text NOT NULL, `bytes1` int(10) unsigned NOT NULL DEFAULT '0', `bytes2` int(10) unsigned NOT NULL DEFAULT '0', - `guildId` int(10) unsigned NOT NULL DEFAULT '0', `flags` tinyint(3) unsigned NOT NULL DEFAULT '0', `dynFlags` tinyint(3) unsigned NOT NULL DEFAULT '0', `time` int(10) unsigned NOT NULL DEFAULT '0', diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 82d63790b32..f4098613cf9 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -16439,11 +16439,11 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) //"position_x, position_y, position_z, map, orientation, taximask, cinematic, totaltime, leveltime, rest_bonus, logout_time, is_logout_resting, resettalents_cost, " // 25 26 27 28 29 30 31 32 33 34 35 36 37 38 //"resettalents_time, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, online, death_expire_time, taxi_path, instance_mode_mask, " - // 39 40 41 42 43 44 45 46 47 - //"conquestPoints, totalHonorPoints, totalKills, todayKills, yesterdayKills, chosenTitle, knownCurrencies, watchedFaction, drunk, " - // 48 49 50 51 52 53 54 55 56 57 58 + // 39 40 41 42 43 44 45 46 + //"conquestPoints, totalHonorPoints, totalKills, todayKills, yesterdayKills, chosenTitle, watchedFaction, drunk, " + // 47 48 49 50 51 52 53 54 55 56 57 //"health, power1, power2, power3, power4, power5, instance_id, speccount, activespec, exploredZones, equipmentCache, " - // 59 60 61 62 + // 58 59 60 61 //"knownTitles, actionBars, grantableLevels, guildId FROM characters WHERE guid = '%u'", guid); PreparedQueryResult result = holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADFROM); @@ -16503,8 +16503,8 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) SetUInt32Value(UNIT_FIELD_LEVEL, fields[6].GetUInt8()); SetUInt32Value(PLAYER_XP, fields[7].GetUInt32()); - _LoadIntoDataField(fields[57].GetCString(), PLAYER_EXPLORED_ZONES_1, PLAYER_EXPLORED_ZONES_SIZE); - _LoadIntoDataField(fields[59].GetCString(), PLAYER__FIELD_KNOWN_TITLES, KNOWN_TITLES_SIZE*2); + _LoadIntoDataField(fields[56].GetCString(), PLAYER_EXPLORED_ZONES_1, PLAYER_EXPLORED_ZONES_SIZE); + _LoadIntoDataField(fields[58].GetCString(), PLAYER__FIELD_KNOWN_TITLES, KNOWN_TITLES_SIZE*2); SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, DEFAULT_WORLD_OBJECT_SIZE); SetFloatValue(UNIT_FIELD_COMBATREACH, 1.5f); @@ -16520,12 +16520,12 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) SetUInt32Value(PLAYER_BYTES, fields[9].GetUInt32()); SetUInt32Value(PLAYER_BYTES_2, fields[10].GetUInt32()); - SetUInt32Value(PLAYER_BYTES_3, (fields[47].GetUInt16() & 0xFFFE) | fields[5].GetUInt8()); + SetUInt32Value(PLAYER_BYTES_3, (fields[46].GetUInt16() & 0xFFFE) | fields[5].GetUInt8()); SetUInt32Value(PLAYER_FLAGS, fields[11].GetUInt32()); - SetInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, fields[48].GetUInt32()); + SetInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, fields[45].GetUInt32()); // set which actionbars the client has active - DO NOT REMOVE EVER AGAIN (can be changed though, if it does change fieldwise) - SetByteValue(PLAYER_FIELD_BYTES, 2, fields[60].GetUInt8()); + SetByteValue(PLAYER_FIELD_BYTES, 2, fields[59].GetUInt8()); InitDisplayIds(); @@ -16556,7 +16556,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) uint32 transGUID = uint32(fields[30].GetUInt64()); // field type is uint64 but lowguid is saved Relocate(fields[12].GetFloat(), fields[13].GetFloat(), fields[14].GetFloat(), fields[16].GetFloat()); uint32 mapId = fields[15].GetUInt16(); - uint32 instanceId = fields[54].GetUInt8(); + uint32 instanceId = fields[53].GetUInt8(); uint32 dungeonDiff = fields[38].GetUInt32() & 0x0F; if (dungeonDiff >= MAX_DUNGEON_DIFFICULTY) @@ -16915,8 +16915,8 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) //mails are loaded only when needed ;-) - when player in game click on mailbox. //_LoadMail(); - m_specsCount = fields[55].GetUInt8(); - m_activeSpec = fields[56].GetUInt8(); + m_specsCount = fields[54].GetUInt8(); + m_activeSpec = fields[55].GetUInt8(); // sanity check if (m_specsCount > MAX_TALENT_SPECS || m_activeSpec > MAX_TALENT_SPEC || m_specsCount < MIN_TALENT_SPECS) @@ -16986,11 +16986,11 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) UpdateAllStats(); // restore remembered power/health values (but not more max values) - uint32 savedHealth = fields[48].GetUInt32(); + uint32 savedHealth = fields[47].GetUInt32(); SetHealth(savedHealth > GetMaxHealth() ? GetMaxHealth() : savedHealth); for (uint8 i = 0; i < MAX_STORED_POWERS; ++i) { - uint32 savedPower = fields[49+i].GetUInt32(); + uint32 savedPower = fields[48+i].GetUInt32(); SetPower(Powers(i), savedPower > GetMaxPower(Powers(i)) ? GetMaxPower(Powers(i)) : savedPower); } @@ -17046,14 +17046,14 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) } // RaF stuff. - m_grantableLevels = fields[61].GetUInt32(); + m_grantableLevels = fields[60].GetUInt32(); if (GetSession()->IsARecruiter() || (GetSession()->GetRecruiterId() != 0)) SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_REFER_A_FRIEND); if (m_grantableLevels > 0) SetByteValue(PLAYER_FIELD_BYTES, 1, 0x01); - m_guildId = fields[62].GetUInt32(); + m_guildId = fields[61].GetUInt32(); _LoadDeclinedNames(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADDECLINEDNAMES)); -- cgit v1.2.3 From 3a855f3f389f1d4b5ba4a7d77f6eb861f23d8d2b Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 27 Nov 2011 12:17:24 +0100 Subject: Core/PacketIO: Fixed memory leak in HandlePlayerLoginOpcode and cleaned some tabs -> spaces --- .../Server/Protocol/Handlers/CharacterHandler.cpp | 24 +++++----- src/server/shared/Packets/ByteBuffer.cpp | 18 ++++---- src/server/shared/Packets/ByteBuffer.h | 53 ++++++++++++---------- 3 files changed, 49 insertions(+), 46 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp index 2024771e31b..3e2c0197c5e 100755 --- a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp @@ -842,22 +842,22 @@ void WorldSession::HandlePlayerLoginOpcode(WorldPacket & recv_data) sLog->outStaticDebug("WORLD: Recvd Player Logon Message"); - BitStream* mask = recv_data.ReadBitStream(8); + BitStream mask = recv_data.ReadBitStream(8); - ByteBuffer* bytes = new ByteBuffer(8, true); + ByteBuffer bytes(8, true); - if ((*mask)[6]) (*bytes)[5] = recv_data.ReadUInt8() ^ 1; - if ((*mask)[0]) (*bytes)[0] = recv_data.ReadUInt8() ^ 1; - if ((*mask)[4]) (*bytes)[3] = recv_data.ReadUInt8() ^ 1; - if ((*mask)[1]) (*bytes)[4] = recv_data.ReadUInt8() ^ 1; - if ((*mask)[2]) (*bytes)[7] = recv_data.ReadUInt8() ^ 1; - if ((*mask)[5]) (*bytes)[2] = recv_data.ReadUInt8() ^ 1; - if ((*mask)[7]) (*bytes)[6] = recv_data.ReadUInt8() ^ 1; - if ((*mask)[3]) (*bytes)[1] = recv_data.ReadUInt8() ^ 1; + if (mask[6]) bytes[5] = recv_data.ReadUInt8() ^ 1; + if (mask[0]) bytes[0] = recv_data.ReadUInt8() ^ 1; + if (mask[4]) bytes[3] = recv_data.ReadUInt8() ^ 1; + if (mask[1]) bytes[4] = recv_data.ReadUInt8() ^ 1; + if (mask[2]) bytes[7] = recv_data.ReadUInt8() ^ 1; + if (mask[5]) bytes[2] = recv_data.ReadUInt8() ^ 1; + if (mask[7]) bytes[6] = recv_data.ReadUInt8() ^ 1; + if (mask[3]) bytes[1] = recv_data.ReadUInt8() ^ 1; - playerGuid = BitConverter::ToUInt64((*bytes)); + playerGuid = BitConverter::ToUInt64(bytes); - sLog->outDebug(LOG_FILTER_NETWORKIO, "Character (Guid: %u) logging in", playerGuid); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Character (Guid: %u) logging in", playerGuid); if (!CharCanLogin(GUID_LOPART(playerGuid))) { diff --git a/src/server/shared/Packets/ByteBuffer.cpp b/src/server/shared/Packets/ByteBuffer.cpp index cdb73987453..f495982ac14 100644 --- a/src/server/shared/Packets/ByteBuffer.cpp +++ b/src/server/shared/Packets/ByteBuffer.cpp @@ -48,7 +48,7 @@ template void BitStream::WriteBits(T value, size_t bits) for (int32 i = bits-1; i >= 0; --i) WriteBit((value >> i) & 1); } - + bool BitStream::Emtpy () { return _data.empty(); @@ -68,22 +68,22 @@ void BitStream::Print() { if (!sLog->IsOutDebug()) return; - std::stringstream ss; - ss << "BitStream: "; + std::stringstream ss; + ss << "BitStream: "; for (uint32 i = 0; i < GetLenght(); ++i) - ss << uint32(GetBit(i)) << " "; + ss << uint32(GetBit(i)) << " "; - sLog->outDebug(LOG_FILTER_NETWORKIO, ss.str().c_str()); + sLog->outDebug(LOG_FILTER_NETWORKIO, ss.str().c_str()); } ByteBuffer::ByteBuffer(size_t res, bool init): _rpos(0), _wpos(0), _bitpos(8), _curbitval(0) { if (init) { + _storage.resize(res); for (size_t i = 0; i < res; ++i) - { *this << uint8(0); - } - } else + } + else _storage.reserve(res); -} \ No newline at end of file +} diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h index c970f32380e..46c5b555093 100755 --- a/src/server/shared/Packets/ByteBuffer.h +++ b/src/server/shared/Packets/ByteBuffer.h @@ -57,26 +57,28 @@ class BitStream WriteBits(val, len); } + BitStream(BitStream const& bs) : _rpos(bs._rpos), _wpos(bs._wpos), _data(bs._data) {} + void Clear(); uint8 GetBit(uint32 bit); uint8 ReadBit(); void WriteBit(uint32 bit); template void WriteBits(T value, size_t bits); - bool Emtpy (); + bool Emtpy(); void Reverse(); - void Print(); - + void Print(); + size_t GetLenght () { return _data.size();} uint32 GetReadPosition() { return _rpos; } uint32 GetWritePosition() { return _wpos; } - void SetReadPos (uint32 pos) { _rpos = pos; } + void SetReadPos(uint32 pos) { _rpos = pos; } - uint8 operator[](uint32 pos) const + uint8 const& operator[](uint32 const pos) const { - return _data[pos]; + return _data[pos]; } - uint8& operator[] (const uint32 pos) + uint8& operator[] (uint32 const pos) { return _data[pos]; } @@ -173,11 +175,11 @@ class ByteBuffer return value; } - BitStream* ReadBitStream(uint32 len) + BitStream ReadBitStream(uint32 len) { - BitStream* b = new BitStream(); + BitStream b; for (uint32 i = 0; i < len; ++i) - b->WriteBit(readBit()); + b.WriteBit(readBit()); return b; } @@ -343,13 +345,15 @@ class ByteBuffer return *this; } - uint8 operator[](size_t pos) const + uint8& operator[](size_t const pos) { - return read(pos); + if (pos >= size()) + throw ByteBufferException(false, pos, 1, size()); + return _storage[pos]; } - uint8& operator[] (const size_t pos) - { + uint8 const& operator[](size_t const pos) const + { if (pos >= size()) throw ByteBufferException(false, pos, 1, size()); return _storage[pos]; @@ -447,7 +451,7 @@ class ByteBuffer (*this) >> u; return u; } - + uint32 ReadUInt32() { uint32 u = 0; @@ -475,7 +479,7 @@ class ByteBuffer (*this) >> u; return u; } - + int32 ReadInt32() { uint32 u = 0; @@ -503,7 +507,7 @@ class ByteBuffer (*this) >> b; return b > 0 ? true : false; } - + float ReadSingle() { float f = 0; @@ -791,38 +795,37 @@ inline void ByteBuffer::read_skip() class BitConverter { public: - - static uint8 ToUInt8(ByteBuffer buff, size_t start = 0) + static uint8 ToUInt8(ByteBuffer const& buff, size_t start = 0) { return buff.read(start); } - static uint16 ToUInt16(ByteBuffer buff, size_t start = 0) + static uint16 ToUInt16(ByteBuffer const& buff, size_t start = 0) { return buff.read(start); } - static uint32 ToUInt32(ByteBuffer buff, size_t start = 0) + static uint32 ToUInt32(ByteBuffer const& buff, size_t start = 0) { return buff.read(start); } - static uint64 ToUInt64(ByteBuffer buff, size_t start = 0) + static uint64 ToUInt64(ByteBuffer const& buff, size_t start = 0) { return buff.read(start); } - static int16 ToInt16(ByteBuffer buff, size_t start = 0) + static int16 ToInt16(ByteBuffer const& buff, size_t start = 0) { return buff.read(start); } - static int32 ToInt32(ByteBuffer buff, size_t start = 0) + static int32 ToInt32(ByteBuffer const& buff, size_t start = 0) { return buff.read(start); } - static int64 ToInt64(ByteBuffer buff, size_t start = 0) + static int64 ToInt64(ByteBuffer const& buff, size_t start = 0) { return buff.read(start); } -- cgit v1.2.3 From e8523b1c3ce276b2c90c074431da265f0f6a2ae2 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 27 Nov 2011 14:41:16 +0100 Subject: Core/Packets: Simplified ByteBuffer constructor --- src/server/shared/Packets/ByteBuffer.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src') diff --git a/src/server/shared/Packets/ByteBuffer.cpp b/src/server/shared/Packets/ByteBuffer.cpp index f495982ac14..9da8e4f813e 100644 --- a/src/server/shared/Packets/ByteBuffer.cpp +++ b/src/server/shared/Packets/ByteBuffer.cpp @@ -79,11 +79,7 @@ void BitStream::Print() ByteBuffer::ByteBuffer(size_t res, bool init): _rpos(0), _wpos(0), _bitpos(8), _curbitval(0) { if (init) - { - _storage.resize(res); - for (size_t i = 0; i < res; ++i) - *this << uint8(0); - } + _storage.resize(res, 0); else _storage.reserve(res); } -- cgit v1.2.3 From 0bc3b2d50e97c5df22880626004e458920fd7464 Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 27 Nov 2011 13:47:38 +0000 Subject: Core/Object: Update Update_type enum, remove BuildMovementUpdateBlock and write the correct (?) number of bits in BuildMovementPack TODO: Send map before count --- src/server/game/Entities/Object/Object.cpp | 12 ------------ src/server/game/Entities/Object/Updates/UpdateData.h | 8 +++----- src/server/game/Entities/Unit/Unit.cpp | 4 ++-- 3 files changed, 5 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 978d9accb64..93bf4e241cd 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -183,18 +183,6 @@ void Object::RemoveFromWorld() ClearUpdateMask(true); } -void Object::BuildMovementUpdateBlock(UpdateData* data, uint32 flags) const -{ - ByteBuffer buf(500); - - buf << uint8(UPDATETYPE_MOVEMENT); - buf.append(GetPackGUID()); - - _BuildMovementUpdate(&buf, flags); - - data->AddUpdateBlock(buf); -} - void Object::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) const { if (!target) diff --git a/src/server/game/Entities/Object/Updates/UpdateData.h b/src/server/game/Entities/Object/Updates/UpdateData.h index 2d102f63e59..15bc7c65d4a 100755 --- a/src/server/game/Entities/Object/Updates/UpdateData.h +++ b/src/server/game/Entities/Object/Updates/UpdateData.h @@ -25,11 +25,9 @@ class WorldPacket; enum OBJECT_UPDATE_TYPE { UPDATETYPE_VALUES = 0, - UPDATETYPE_MOVEMENT = 1, - UPDATETYPE_CREATE_OBJECT = 2, - UPDATETYPE_CREATE_OBJECT2 = 3, - UPDATETYPE_OUT_OF_RANGE_OBJECTS = 4, - UPDATETYPE_NEAR_OBJECTS = 5 + UPDATETYPE_CREATE_OBJECT = 1, + UPDATETYPE_CREATE_OBJECT2 = 2, + UPDATETYPE_OUT_OF_RANGE_OBJECTS = 3, }; enum OBJECT_UPDATE_FLAGS diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index a157da6ed49..be095d05e1f 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -17139,8 +17139,8 @@ void Unit::BuildMovementPacket(ByteBuffer *data) const break; } - *data << uint32(GetUnitMovementFlags()); // movement flags - *data << uint16(m_movementInfo.flags2); // 2.3.0 + (*data).writeBits(GetUnitMovementFlags(), 30); + (*data).writeBits(m_movementInfo.flags2, 12); *data << uint32(getMSTime()); // time *data << GetPositionX(); *data << GetPositionY(); -- cgit v1.2.3 From 8eac7e3fdc3c1bb1f319cc53c3b0f858f17b3901 Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 27 Nov 2011 13:55:44 +0000 Subject: Add missed change to previous commit and fix a typo in BitStream::Empty --- src/server/game/Entities/Object/Object.h | 1 - src/server/shared/Packets/ByteBuffer.cpp | 2 +- src/server/shared/Packets/ByteBuffer.h | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index eab4dbeba99..fc0f93ce51a 100755 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -145,7 +145,6 @@ class Object void BuildValuesUpdateBlockForPlayer(UpdateData* data, Player* target) const; void BuildOutOfRangeUpdateBlock(UpdateData* data) const; - void BuildMovementUpdateBlock(UpdateData* data, uint32 flags = 0) const; virtual void DestroyForPlayer(Player* target, bool anim = false) const; diff --git a/src/server/shared/Packets/ByteBuffer.cpp b/src/server/shared/Packets/ByteBuffer.cpp index 9da8e4f813e..e2efdccfbcb 100644 --- a/src/server/shared/Packets/ByteBuffer.cpp +++ b/src/server/shared/Packets/ByteBuffer.cpp @@ -49,7 +49,7 @@ template void BitStream::WriteBits(T value, size_t bits) WriteBit((value >> i) & 1); } -bool BitStream::Emtpy () +bool BitStream::Empty () { return _data.empty(); } diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h index 46c5b555093..0433145b028 100755 --- a/src/server/shared/Packets/ByteBuffer.h +++ b/src/server/shared/Packets/ByteBuffer.h @@ -64,7 +64,7 @@ class BitStream uint8 ReadBit(); void WriteBit(uint32 bit); template void WriteBits(T value, size_t bits); - bool Emtpy(); + bool Empty(); void Reverse(); void Print(); -- cgit v1.2.3 From 7fdefceb4389eaf7ee6a4ae34a73b861bbcdea5c Mon Sep 17 00:00:00 2001 From: Rat Date: Sun, 27 Nov 2011 16:06:29 +0100 Subject: Core/Packets: updated update_object structure Welcome ingame! --- .../game/Battlegrounds/Zones/BattlegroundIC.cpp | 2 +- .../game/Battlegrounds/Zones/BattlegroundSA.cpp | 6 +- src/server/game/Entities/Corpse/Corpse.cpp | 2 +- .../game/Entities/DynamicObject/DynamicObject.cpp | 2 +- src/server/game/Entities/GameObject/GameObject.cpp | 4 +- src/server/game/Entities/Item/Item.cpp | 2 +- src/server/game/Entities/Object/Object.cpp | 102 ++++++++------------- .../game/Entities/Object/Updates/UpdateData.cpp | 39 +++----- .../game/Entities/Object/Updates/UpdateData.h | 13 ++- src/server/game/Entities/Player/Player.cpp | 4 +- src/server/game/Entities/Transport/Transport.cpp | 6 +- src/server/game/Entities/Unit/Unit.cpp | 47 +++++++--- src/server/game/Grids/Notifiers/GridNotifiers.h | 2 +- src/server/game/Maps/Map.cpp | 6 +- src/server/game/Server/Protocol/Opcodes.cpp | 4 +- 15 files changed, 109 insertions(+), 132 deletions(-) (limited to 'src') diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp index f17df3aaf67..ed3b81d0fb8 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp @@ -74,7 +74,7 @@ void BattlegroundIC::SendTransportInit(Player* player) if (!gunshipAlliance || !gunshipHorde) return; - UpdateData transData; + UpdateData transData(player->GetMapId()); gunshipAlliance->BuildCreateUpdateBlockForPlayer(&transData, player); gunshipHorde->BuildCreateUpdateBlockForPlayer(&transData, player); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp index aaa29e1ca20..794fc76b300 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp @@ -266,7 +266,7 @@ void BattlegroundSA::StartShips() { if (Player* p = ObjectAccessor::FindPlayer(itr->first)) { - UpdateData data; + UpdateData data(p->GetMapId()); WorldPacket pkt; GetBGObject(i)->BuildValuesUpdateBlockForPlayer(&data, p); data.BuildPacket(&pkt); @@ -900,7 +900,7 @@ void BattlegroundSA::SendTransportInit(Player* player) { if (m_BgObjects[BG_SA_BOAT_ONE] || m_BgObjects[BG_SA_BOAT_TWO]) { - UpdateData transData; + UpdateData transData(player->GetMapId()); if (m_BgObjects[BG_SA_BOAT_ONE]) GetBGObject(BG_SA_BOAT_ONE)->BuildCreateUpdateBlockForPlayer(&transData, player); if (m_BgObjects[BG_SA_BOAT_TWO]) @@ -915,7 +915,7 @@ void BattlegroundSA::SendTransportsRemove(Player* player) { if (m_BgObjects[BG_SA_BOAT_ONE] || m_BgObjects[BG_SA_BOAT_TWO]) { - UpdateData transData; + UpdateData transData(player->GetMapId()); if (m_BgObjects[BG_SA_BOAT_ONE]) GetBGObject(BG_SA_BOAT_ONE)->BuildOutOfRangeUpdateBlock(&transData); if (m_BgObjects[BG_SA_BOAT_TWO]) diff --git a/src/server/game/Entities/Corpse/Corpse.cpp b/src/server/game/Entities/Corpse/Corpse.cpp index 43f3a085748..5953518c65b 100755 --- a/src/server/game/Entities/Corpse/Corpse.cpp +++ b/src/server/game/Entities/Corpse/Corpse.cpp @@ -32,7 +32,7 @@ Corpse::Corpse(CorpseType type) : WorldObject() m_objectType |= TYPEMASK_CORPSE; m_objectTypeId = TYPEID_CORPSE; - m_updateFlag = (UPDATEFLAG_HIGHGUID | UPDATEFLAG_HAS_POSITION | UPDATEFLAG_POSITION); + m_updateFlag = (UPDATEFLAG_HAS_POSITION | UPDATEFLAG_POSITION); m_valuesCount = CORPSE_END; diff --git a/src/server/game/Entities/DynamicObject/DynamicObject.cpp b/src/server/game/Entities/DynamicObject/DynamicObject.cpp index 4fc463e6e88..4c8ce4d8d8f 100755 --- a/src/server/game/Entities/DynamicObject/DynamicObject.cpp +++ b/src/server/game/Entities/DynamicObject/DynamicObject.cpp @@ -33,7 +33,7 @@ DynamicObject::DynamicObject() : WorldObject(), m_objectType |= TYPEMASK_DYNAMICOBJECT; m_objectTypeId = TYPEID_DYNAMICOBJECT; - m_updateFlag = (UPDATEFLAG_HIGHGUID | UPDATEFLAG_HAS_POSITION | UPDATEFLAG_POSITION); + m_updateFlag = (UPDATEFLAG_HAS_POSITION | UPDATEFLAG_POSITION); m_valuesCount = DYNAMICOBJECT_END; } diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 9e514ad34bb..68091611a5d 100755 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -35,7 +35,7 @@ GameObject::GameObject() : WorldObject(), m_goValue(new GameObjectValue), m_AI(N m_objectType |= TYPEMASK_GAMEOBJECT; m_objectTypeId = TYPEID_GAMEOBJECT; - m_updateFlag = (UPDATEFLAG_HIGHGUID | UPDATEFLAG_HAS_POSITION | UPDATEFLAG_POSITION | UPDATEFLAG_ROTATION); + m_updateFlag = (UPDATEFLAG_HAS_POSITION | UPDATEFLAG_POSITION | UPDATEFLAG_ROTATION); m_valuesCount = GAMEOBJECT_END; m_respawnTime = 0; @@ -296,7 +296,7 @@ void GameObject::Update(uint32 diff) SetGoState(GO_STATE_ACTIVE); SetUInt32Value(GAMEOBJECT_FLAGS, GO_FLAG_NODESPAWN); - UpdateData udata; + UpdateData udata(caster->GetMapId()); WorldPacket packet; BuildValuesUpdateBlockForPlayer(&udata, caster->ToPlayer()); udata.BuildPacket(&packet); diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index 07275166130..2ef53212d40 100755 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -238,7 +238,7 @@ Item::Item() m_objectType |= TYPEMASK_ITEM; m_objectTypeId = TYPEID_ITEM; - m_updateFlag = UPDATEFLAG_HIGHGUID; + m_updateFlag = 0; m_valuesCount = ITEM_END; m_slot = 0; diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 93bf4e241cd..ce10a821ea4 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -250,7 +250,7 @@ void Object::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) c void Object::SendUpdateToPlayer(Player* player) { // send create update to player - UpdateData upd; + UpdateData upd(player->GetMapId()); WorldPacket packet; BuildCreateUpdateBlockForPlayer(&upd, player); @@ -296,17 +296,18 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint16 flags) const // 0x20 if (flags & UPDATEFLAG_LIVING) { - ((Unit*)this)->BuildMovementPacket(data); + const Unit* self = ToUnit(); + self->BuildMovementPacket(data); - *data << ((Unit*)this)->GetSpeed(MOVE_WALK); - *data << ((Unit*)this)->GetSpeed(MOVE_RUN); - *data << ((Unit*)this)->GetSpeed(MOVE_SWIM_BACK); - *data << ((Unit*)this)->GetSpeed(MOVE_SWIM); - *data << ((Unit*)this)->GetSpeed(MOVE_RUN_BACK); - *data << ((Unit*)this)->GetSpeed(MOVE_FLIGHT); - *data << ((Unit*)this)->GetSpeed(MOVE_FLIGHT_BACK); - *data << ((Unit*)this)->GetSpeed(MOVE_TURN_RATE); - *data << ((Unit*)this)->GetSpeed(MOVE_PITCH_RATE); + *data << self->GetSpeed(MOVE_WALK); + *data << self->GetSpeed(MOVE_RUN); + *data << self->GetSpeed(MOVE_SWIM_BACK); + *data << self->GetSpeed(MOVE_SWIM); + *data << self->GetSpeed(MOVE_RUN_BACK); + *data << self->GetSpeed(MOVE_FLIGHT); + *data << self->GetSpeed(MOVE_FLIGHT_BACK); + *data << self->GetSpeed(MOVE_TURN_RATE); + *data << self->GetSpeed(MOVE_PITCH_RATE); const Player* player = ToPlayer(); @@ -375,19 +376,20 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint16 flags) const } else { + WorldObject* worldObj = ((WorldObject*)this); if (flags & UPDATEFLAG_POSITION) { *data << uint8(0); // unk PGUID! - *data << ((WorldObject*)this)->GetPositionX(); - *data << ((WorldObject*)this)->GetPositionY(); - *data << ((WorldObject*)this)->GetPositionZ(); - *data << ((WorldObject*)this)->GetPositionX(); - *data << ((WorldObject*)this)->GetPositionY(); - *data << ((WorldObject*)this)->GetPositionZ(); - *data << ((WorldObject*)this)->GetOrientation(); + *data << worldObj->GetPositionX(); + *data << worldObj->GetPositionY(); + *data << worldObj->GetPositionZ(); + *data << worldObj->GetPositionX(); + *data << worldObj->GetPositionY(); + *data << worldObj->GetPositionZ(); + *data << worldObj->GetOrientation(); if (GetTypeId() == TYPEID_CORPSE) - *data << float(((WorldObject*)this)->GetOrientation()); + *data << worldObj->GetOrientation(); else *data << float(0); } @@ -402,58 +404,23 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint16 flags) const *data << (float)0; *data << (float)0; *data << (float)0; - *data << ((WorldObject*)this)->GetOrientation(); + *data << worldObj->GetOrientation(); } else { - *data << ((WorldObject*)this)->GetPositionX(); - *data << ((WorldObject*)this)->GetPositionY(); - *data << ((WorldObject*)this)->GetPositionZ(); - *data << ((WorldObject*)this)->GetOrientation(); + *data << worldObj->GetPositionX(); + *data << worldObj->GetPositionY(); + *data << worldObj->GetPositionZ(); + *data << worldObj->GetOrientation(); } } } } - // 0x8 - if (flags & UPDATEFLAG_LOWGUID) - { - switch (GetTypeId()) - { - case TYPEID_OBJECT: - case TYPEID_ITEM: - case TYPEID_CONTAINER: - case TYPEID_GAMEOBJECT: - case TYPEID_DYNAMICOBJECT: - case TYPEID_CORPSE: - *data << uint32(GetGUIDLow()); // GetGUIDLow() - break; - case TYPEID_UNIT: - *data << uint32(0x0000000B); // unk, can be 0xB or 0xC - break; - case TYPEID_PLAYER: - if (flags & UPDATEFLAG_SELF) - *data << uint32(0x0000002F); // unk, can be 0x15 or 0x22 - else - *data << uint32(0x00000008); // unk, can be 0x7 or 0x8 - break; - default: - *data << uint32(0x00000000); // unk - break; - } - } - - // 0x10 - if (flags & UPDATEFLAG_HIGHGUID) - { - // not high guid - *data << uint32(GetUInt32Value(OBJECT_FIELD_GUID)); // unk - } - // 0x4 if (flags & UPDATEFLAG_HAS_TARGET) // packed guid (current target guid) { - if (Unit* victim = ((Unit*)this)->getVictim()) + if (Unit *victim = this->ToUnit()->getVictim()) data->append(victim->GetPackGUID()); else *data << uint8(0); @@ -472,11 +439,14 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint16 flags) const *data << float(((Creature*)this)->GetOrientation()); // facing adjustment } - // 0x200 - if (flags & UPDATEFLAG_ROTATION) - { - *data << uint64(((GameObject*)this)->GetRotation()); - } + // 0x800 + if (flags & UPDATEFLAG_UNK2) + *data << uint16(0) << uint16(0) << uint16(0); //unk + + + // 0x1000 + if (flags & UPDATEFLAG_UNK3) + *data << uint8(0);//unk counter to read uint32 values } void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask* updateMask, Player* target) const @@ -774,7 +744,7 @@ void Object::BuildFieldsUpdate(Player* player, UpdateDataMapType& data_map) cons if (iter == data_map.end()) { - std::pair p = data_map.insert(UpdateDataMapType::value_type(player, UpdateData())); + std::pair p = data_map.insert(UpdateDataMapType::value_type(player, UpdateData(player->GetMapId()))); ASSERT(p.second); iter = p.first; } diff --git a/src/server/game/Entities/Object/Updates/UpdateData.cpp b/src/server/game/Entities/Object/Updates/UpdateData.cpp index 547c415bc73..7ad98418c7b 100755 --- a/src/server/game/Entities/Object/Updates/UpdateData.cpp +++ b/src/server/game/Entities/Object/Updates/UpdateData.cpp @@ -25,7 +25,7 @@ #include "World.h" #include "zlib.h" -UpdateData::UpdateData() : m_blockCount(0) +UpdateData::UpdateData(uint16 map) : m_blockCount(0), m_map(map) { } @@ -104,44 +104,26 @@ void UpdateData::Compress(void* dst, uint32 *dst_size, void* src, int src_size) bool UpdateData::BuildPacket(WorldPacket* packet) { ASSERT(packet->empty()); // shouldn't happen + packet->Initialize(SMSG_UPDATE_OBJECT, 2 + 4 + (m_outOfRangeGUIDs.empty() ? 0 : 1 + 4 + 9 * m_outOfRangeGUIDs.size()) + m_data.wpos()); - ByteBuffer buf(4 + (m_outOfRangeGUIDs.empty() ? 0 : 1 + 4 + 9 * m_outOfRangeGUIDs.size()) + m_data.wpos()); - - buf << (uint32) (!m_outOfRangeGUIDs.empty() ? m_blockCount + 1 : m_blockCount); + *packet << uint16(m_map); + *packet << uint32(m_blockCount); if (!m_outOfRangeGUIDs.empty()) { - buf << (uint8) UPDATETYPE_OUT_OF_RANGE_OBJECTS; - buf << (uint32) m_outOfRangeGUIDs.size(); + *packet << uint8(UPDATETYPE_OUT_OF_RANGE_OBJECTS); + *packet << uint32(m_outOfRangeGUIDs.size()); for (std::set::const_iterator i = m_outOfRangeGUIDs.begin(); i != m_outOfRangeGUIDs.end(); ++i) { - buf.appendPackGUID(*i); + packet->appendPackGUID(*i); } } - buf.append(m_data); - - size_t pSize = buf.wpos(); // use real used data size - - if (pSize > 100) // compress large packets - { - uint32 destsize = compressBound(pSize); - packet->resize(destsize + sizeof(uint32)); - - packet->put(0, pSize); - Compress(const_cast(packet->contents()) + sizeof(uint32), &destsize, (void*)buf.contents(), pSize); - if (destsize == 0) - return false; + packet->append(m_data); - packet->resize(destsize + sizeof(uint32)); - packet->SetOpcode(SMSG_COMPRESSED_UPDATE_OBJECT); - } - else // send small packets without compression - { - packet->append(buf); - packet->SetOpcode(SMSG_UPDATE_OBJECT); - } + //if (packet->wpos() > 100) + // compress meee!! return true; } @@ -151,5 +133,6 @@ void UpdateData::Clear() m_data.clear(); m_outOfRangeGUIDs.clear(); m_blockCount = 0; + m_map = 0; } diff --git a/src/server/game/Entities/Object/Updates/UpdateData.h b/src/server/game/Entities/Object/Updates/UpdateData.h index 15bc7c65d4a..526a31f206f 100755 --- a/src/server/game/Entities/Object/Updates/UpdateData.h +++ b/src/server/game/Entities/Object/Updates/UpdateData.h @@ -36,19 +36,23 @@ enum OBJECT_UPDATE_FLAGS UPDATEFLAG_SELF = 0x0001, UPDATEFLAG_TRANSPORT = 0x0002, UPDATEFLAG_HAS_TARGET = 0x0004, - UPDATEFLAG_LOWGUID = 0x0008, - UPDATEFLAG_HIGHGUID = 0x0010, + UPDATEFLAG_UNK1 = 0x0008, + UPDATEFLAG_UNK2 = 0x0010, UPDATEFLAG_LIVING = 0x0020, UPDATEFLAG_HAS_POSITION = 0x0040, UPDATEFLAG_VEHICLE = 0x0080, UPDATEFLAG_POSITION = 0x0100, - UPDATEFLAG_ROTATION = 0x0200 + UPDATEFLAG_ROTATION = 0x0200, + UPDATEFLAG_UNK3 = 0x0400, + UPDATEFLAG_UNK4 = 0x0800, + UPDATEFLAG_UNK5 = 0x1000, + UPDATEFLAG_UNK6 = 0x2000 }; class UpdateData { public: - UpdateData(); + UpdateData(uint16 map); void AddOutOfRangeGUID(std::set& guids); void AddOutOfRangeGUID(uint64 guid); @@ -60,6 +64,7 @@ class UpdateData std::set const& GetOutOfRangeGUIDs() const { return m_outOfRangeGUIDs; } protected: + uint16 m_map; uint32 m_blockCount; std::set m_outOfRangeGUIDs; ByteBuffer m_data; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index f4098613cf9..ea3600d006d 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -21229,7 +21229,7 @@ void Player::UpdateTriggerVisibility() if (!IsInWorld()) return; - UpdateData udata; + UpdateData udata(GetMapId()); WorldPacket packet; for (ClientGUIDs::iterator itr = m_clientGUIDs.begin(); itr != m_clientGUIDs.end(); ++itr) { @@ -22037,7 +22037,7 @@ void Player::UpdateForQuestWorldObjects() if (m_clientGUIDs.empty()) return; - UpdateData udata; + UpdateData udata(GetMapId()); WorldPacket packet; for (ClientGUIDs::iterator itr=m_clientGUIDs.begin(); itr != m_clientGUIDs.end(); ++itr) { diff --git a/src/server/game/Entities/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp index 97f5af1c6e9..f48d5ed631a 100755 --- a/src/server/game/Entities/Transport/Transport.cpp +++ b/src/server/game/Entities/Transport/Transport.cpp @@ -173,7 +173,7 @@ void MapManager::LoadTransportNPCs() Transport::Transport(uint32 period, uint32 script) : GameObject(), m_pathTime(0), m_timer(0), currenttguid(0), m_period(period), ScriptId(script), m_nextNodeTime(0) { - m_updateFlag = (UPDATEFLAG_TRANSPORT | UPDATEFLAG_HIGHGUID | UPDATEFLAG_HAS_POSITION | UPDATEFLAG_ROTATION); + m_updateFlag = (UPDATEFLAG_TRANSPORT | UPDATEFLAG_HAS_POSITION | UPDATEFLAG_ROTATION); } Transport::~Transport() @@ -585,7 +585,7 @@ void Transport::UpdateForMap(Map const* targetMap) { if (this != itr->getSource()->GetTransport()) { - UpdateData transData; + UpdateData transData(GetMapId()); BuildCreateUpdateBlockForPlayer(&transData, itr->getSource()); WorldPacket packet; transData.BuildPacket(&packet); @@ -595,7 +595,7 @@ void Transport::UpdateForMap(Map const* targetMap) } else { - UpdateData transData; + UpdateData transData(targetMap->GetId()); BuildOutOfRangeUpdateBlock(&transData); WorldPacket out_packet; transData.BuildPacket(&out_packet); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index be095d05e1f..a2bf6947734 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -156,7 +156,7 @@ m_vehicleKit(NULL), m_unitTypeMask(UNIT_MASK_NONE), m_HostileRefManager(this) m_objectType |= TYPEMASK_UNIT; m_objectTypeId = TYPEID_UNIT; - m_updateFlag = (UPDATEFLAG_HIGHGUID | UPDATEFLAG_LIVING | UPDATEFLAG_HAS_POSITION); + m_updateFlag = (UPDATEFLAG_LIVING | UPDATEFLAG_HAS_POSITION); m_attackTimer[BASE_ATTACK] = 0; m_attackTimer[OFF_ATTACK] = 0; @@ -17141,13 +17141,30 @@ void Unit::BuildMovementPacket(ByteBuffer *data) const (*data).writeBits(GetUnitMovementFlags(), 30); (*data).writeBits(m_movementInfo.flags2, 12); + + if (data->writeBit(GetUnitMovementFlags() & MOVEMENTFLAG_ONTRANSPORT)) + { + data->writeBit(m_movementInfo.flags2 & MOVEMENTFLAG2_INTERPOLATED_MOVEMENT); + data->writeBit(0); // Flag for time3 + } + + data->writeBit((GetUnitMovementFlags() & (MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING)) || (m_movementInfo.flags2 & MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING)); + + if (data->writeBit(m_movementInfo.flags2 & MOVEMENTFLAG2_INTERPOLATED_TURNING)) + data->writeBit(GetUnitMovementFlags() & MOVEMENTFLAG_JUMPING); + + data->writeBit(GetUnitMovementFlags() & MOVEMENTFLAG_SPLINE_ELEVATION); + + // has spline data + data->writeBit(0); + + *data << uint64(GetGUID()); // added in 4.2.0 *data << uint32(getMSTime()); // time *data << GetPositionX(); *data << GetPositionY(); *data << GetPositionZ(); *data << GetOrientation(); - // 0x00000200 if (GetUnitMovementFlags() & MOVEMENTFLAG_ONTRANSPORT) { if (m_vehicle) @@ -17161,27 +17178,29 @@ void Unit::BuildMovementPacket(ByteBuffer *data) const *data << float (GetTransOffsetY()); *data << float (GetTransOffsetZ()); *data << float (GetTransOffsetO()); - *data << uint32(GetTransTime()); *data << uint8 (GetTransSeat()); + *data << uint32(GetTransTime()); + + if (m_movementInfo.flags2 & MOVEMENTFLAG2_INTERPOLATED_MOVEMENT) + *data << uint32(m_movementInfo.t_time2); } - // 0x02200000 - if ((GetUnitMovementFlags() & (MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING)) - || (m_movementInfo.flags2 & MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING)) + if ((GetUnitMovementFlags() & (MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING)) || (m_movementInfo.flags2 & MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING)) *data << (float)m_movementInfo.pitch; - *data << (uint32)m_movementInfo.fallTime; - - // 0x00001000 - if (GetUnitMovementFlags() & MOVEMENTFLAG_JUMPING) + if (m_movementInfo.flags2 & MOVEMENTFLAG2_INTERPOLATED_TURNING) { + *data << (uint32)m_movementInfo.fallTime; *data << (float)m_movementInfo.j_zspeed; - *data << (float)m_movementInfo.j_sinAngle; - *data << (float)m_movementInfo.j_cosAngle; - *data << (float)m_movementInfo.j_xyspeed; + + if (GetUnitMovementFlags() & MOVEMENTFLAG_JUMPING) + { + *data << (float)m_movementInfo.j_sinAngle; + *data << (float)m_movementInfo.j_cosAngle; + *data << (float)m_movementInfo.j_xyspeed; + } } - // 0x04000000 if (GetUnitMovementFlags() & MOVEMENTFLAG_SPLINE_ELEVATION) *data << (float)m_movementInfo.splineElevation; } diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h index 239c3710b5b..bdabc7a4bcc 100755 --- a/src/server/game/Grids/Notifiers/GridNotifiers.h +++ b/src/server/game/Grids/Notifiers/GridNotifiers.h @@ -43,7 +43,7 @@ namespace Trinity std::set i_visibleNow; Player::ClientGUIDs vis_guids; - VisibleNotifier(Player &player) : i_player(player), vis_guids(player.m_clientGUIDs) {} + VisibleNotifier(Player &player) : i_player(player), vis_guids(player.m_clientGUIDs), i_data(player.GetMapId()) {} template void Visit(GridRefManager &m); void SendToSelf(void); }; diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 8e81f25ca9e..d9970b79259 100755 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -1853,7 +1853,7 @@ void Map::SendInitSelf(Player* player) { sLog->outDetail("Creating player data for himself %u", player->GetGUIDLow()); - UpdateData data; + UpdateData data(player->GetMapId()); // attach to player data current transport data if (Transport* transport = player->GetTransport()) @@ -1890,7 +1890,7 @@ void Map::SendInitTransports(Player* player) if (tmap.find(player->GetMapId()) == tmap.end()) return; - UpdateData transData; + UpdateData transData(player->GetMapId()); MapManager::TransportSet& tset = tmap[player->GetMapId()]; @@ -1917,7 +1917,7 @@ void Map::SendRemoveTransports(Player* player) if (tmap.find(player->GetMapId()) == tmap.end()) return; - UpdateData transData; + UpdateData transData(player->GetMapId()); MapManager::TransportSet& tset = tmap[player->GetMapId()]; diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 2fd2c1410ff..be6d568cc78 100755 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -211,7 +211,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNBAN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelUnban ); //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_ANNOUNCEMENTS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelAnnouncements ); //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_MODERATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_UPDATE_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DESTROY_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_USE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUseItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_OPEN_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleOpenItemOpcode ); @@ -544,7 +544,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_PLAY_SPELL_VISUAL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_ZONEUPDATE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleZoneUpdateOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_PARTYKILLLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_UPDATE_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_UPDATE_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PLAY_SPELL_IMPACT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_EXPLORATION_EXPERIENCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GM_SET_SECURITY_GROUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); -- cgit v1.2.3 From 07740f84b53a54f5e6224c12d5521579a180151c Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 27 Nov 2011 15:18:29 +0000 Subject: Core/Packets: Refactor BuildMovementPacket --- src/server/game/Entities/Unit/Unit.cpp | 72 +++++++++++++++++++--------------- 1 file changed, 41 insertions(+), 31 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index a2bf6947734..cd21ccabb24 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -17139,40 +17139,50 @@ void Unit::BuildMovementPacket(ByteBuffer *data) const break; } - (*data).writeBits(GetUnitMovementFlags(), 30); - (*data).writeBits(m_movementInfo.flags2, 12); + bool onTransport = GetUnitMovementFlags() & MOVEMENTFLAG_ONTRANSPORT; + bool hasInterpolatedMovement = m_movementInfo.flags2 & MOVEMENTFLAG2_INTERPOLATED_MOVEMENT; + bool time3 = false; + bool swimming = ((GetUnitMovementFlags() & (MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING)) + || (m_movementInfo.flags2 & MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING)); + bool interPolatedTurning = m_movementInfo.flags2 & MOVEMENTFLAG2_INTERPOLATED_TURNING; + bool jumping = GetUnitMovementFlags() & MOVEMENTFLAG_JUMPING; + bool splineElevation = GetUnitMovementFlags() & MOVEMENTFLAG_SPLINE_ELEVATION; + bool splineData = false; - if (data->writeBit(GetUnitMovementFlags() & MOVEMENTFLAG_ONTRANSPORT)) + data->writeBits(GetUnitMovementFlags(), 30); + data->writeBits(m_movementInfo.flags2, 12); + data->writeBit(onTransport); + if (onTransport) { - data->writeBit(m_movementInfo.flags2 & MOVEMENTFLAG2_INTERPOLATED_MOVEMENT); - data->writeBit(0); // Flag for time3 + data->writeBit(hasInterpolatedMovement); + data->writeBit(time3); } - data->writeBit((GetUnitMovementFlags() & (MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING)) || (m_movementInfo.flags2 & MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING)); + data->writeBit(swimming); + data->writeBit(interPolatedTurning); + if (interPolatedTurning) + data->writeBit(jumping); - if (data->writeBit(m_movementInfo.flags2 & MOVEMENTFLAG2_INTERPOLATED_TURNING)) - data->writeBit(GetUnitMovementFlags() & MOVEMENTFLAG_JUMPING); + data->writeBit(splineElevation); + data->writeBit(splineData); - data->writeBit(GetUnitMovementFlags() & MOVEMENTFLAG_SPLINE_ELEVATION); + data->flushBits(); // reset bit stream - // has spline data - data->writeBit(0); + *data << uint64(GetGUID()); + *data << uint32(getMSTime()); + *data << float(GetPositionX()); + *data << float(GetPositionY()); + *data << float(GetPositionZ()); + *data << float(GetOrientation()); - *data << uint64(GetGUID()); // added in 4.2.0 - *data << uint32(getMSTime()); // time - *data << GetPositionX(); - *data << GetPositionY(); - *data << GetPositionZ(); - *data << GetOrientation(); - - if (GetUnitMovementFlags() & MOVEMENTFLAG_ONTRANSPORT) + if (onTransport) { if (m_vehicle) - data->append(m_vehicle->GetBase()->GetPackGUID()); + *data << uint64(m_vehicle->GetBase()->GetGUID()); else if (GetTransport()) - data->append(GetTransport()->GetPackGUID()); - else - *data << (uint8)0; + *data << uint64(GetTransport()->GetGUID()); + else // probably should never happen + *data << (uint64)0; *data << float (GetTransOffsetX()); *data << float (GetTransOffsetY()); @@ -17180,20 +17190,20 @@ void Unit::BuildMovementPacket(ByteBuffer *data) const *data << float (GetTransOffsetO()); *data << uint8 (GetTransSeat()); *data << uint32(GetTransTime()); - - if (m_movementInfo.flags2 & MOVEMENTFLAG2_INTERPOLATED_MOVEMENT) - *data << uint32(m_movementInfo.t_time2); + if (hasInterpolatedMovement) + *data << int32(0); // Transport Time 2 + if (time3) + *data << int32(0); // Transport Time 3 } - if ((GetUnitMovementFlags() & (MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING)) || (m_movementInfo.flags2 & MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING)) + if (swimming) *data << (float)m_movementInfo.pitch; - if (m_movementInfo.flags2 & MOVEMENTFLAG2_INTERPOLATED_TURNING) + if (interPolatedTurning) { *data << (uint32)m_movementInfo.fallTime; *data << (float)m_movementInfo.j_zspeed; - - if (GetUnitMovementFlags() & MOVEMENTFLAG_JUMPING) + if (jumping) { *data << (float)m_movementInfo.j_sinAngle; *data << (float)m_movementInfo.j_cosAngle; @@ -17201,7 +17211,7 @@ void Unit::BuildMovementPacket(ByteBuffer *data) const } } - if (GetUnitMovementFlags() & MOVEMENTFLAG_SPLINE_ELEVATION) + if (splineElevation) *data << (float)m_movementInfo.splineElevation; } -- cgit v1.2.3 From 5be5eae64fa801b6eedbc993d99ba3af61c273e9 Mon Sep 17 00:00:00 2001 From: Rat Date: Sun, 27 Nov 2011 17:04:01 +0100 Subject: Core/Packets: updated WorldPacket compressor --- .../game/Entities/Object/Updates/UpdateData.cpp | 60 +----------- .../game/Entities/Object/Updates/UpdateData.h | 2 - src/server/game/Server/WorldPacket.cpp | 103 +++++++++++++++++++++ src/server/game/Server/WorldPacket.h | 2 + 4 files changed, 107 insertions(+), 60 deletions(-) create mode 100644 src/server/game/Server/WorldPacket.cpp (limited to 'src') diff --git a/src/server/game/Entities/Object/Updates/UpdateData.cpp b/src/server/game/Entities/Object/Updates/UpdateData.cpp index 7ad98418c7b..a2aba642048 100755 --- a/src/server/game/Entities/Object/Updates/UpdateData.cpp +++ b/src/server/game/Entities/Object/Updates/UpdateData.cpp @@ -45,62 +45,6 @@ void UpdateData::AddUpdateBlock(const ByteBuffer &block) ++m_blockCount; } -void UpdateData::Compress(void* dst, uint32 *dst_size, void* src, int src_size) -{ - z_stream c_stream; - - c_stream.zalloc = (alloc_func)0; - c_stream.zfree = (free_func)0; - c_stream.opaque = (voidpf)0; - - // default Z_BEST_SPEED (1) - int z_res = deflateInit(&c_stream, sWorld->getIntConfig(CONFIG_COMPRESSION)); - if (z_res != Z_OK) - { - sLog->outError("Can't compress update packet (zlib: deflateInit) Error code: %i (%s)", z_res, zError(z_res)); - *dst_size = 0; - return; - } - - c_stream.next_out = (Bytef*)dst; - c_stream.avail_out = *dst_size; - c_stream.next_in = (Bytef*)src; - c_stream.avail_in = (uInt)src_size; - - z_res = deflate(&c_stream, Z_NO_FLUSH); - if (z_res != Z_OK) - { - sLog->outError("Can't compress update packet (zlib: deflate) Error code: %i (%s)", z_res, zError(z_res)); - *dst_size = 0; - return; - } - - if (c_stream.avail_in != 0) - { - sLog->outError("Can't compress update packet (zlib: deflate not greedy)"); - *dst_size = 0; - return; - } - - z_res = deflate(&c_stream, Z_FINISH); - if (z_res != Z_STREAM_END) - { - sLog->outError("Can't compress update packet (zlib: deflate should report Z_STREAM_END instead %i (%s)", z_res, zError(z_res)); - *dst_size = 0; - return; - } - - z_res = deflateEnd(&c_stream); - if (z_res != Z_OK) - { - sLog->outError("Can't compress update packet (zlib: deflateEnd) Error code: %i (%s)", z_res, zError(z_res)); - *dst_size = 0; - return; - } - - *dst_size = c_stream.total_out; -} - bool UpdateData::BuildPacket(WorldPacket* packet) { ASSERT(packet->empty()); // shouldn't happen @@ -122,8 +66,8 @@ bool UpdateData::BuildPacket(WorldPacket* packet) packet->append(m_data); - //if (packet->wpos() > 100) - // compress meee!! + if (packet->wpos() > 100) + packet->Compress(SMSG_COMPRESSED_UPDATE_OBJECT); return true; } diff --git a/src/server/game/Entities/Object/Updates/UpdateData.h b/src/server/game/Entities/Object/Updates/UpdateData.h index 526a31f206f..653bf411f26 100755 --- a/src/server/game/Entities/Object/Updates/UpdateData.h +++ b/src/server/game/Entities/Object/Updates/UpdateData.h @@ -68,8 +68,6 @@ class UpdateData uint32 m_blockCount; std::set m_outOfRangeGUIDs; ByteBuffer m_data; - - void Compress(void* dst, uint32 *dst_size, void* src, int src_size); }; #endif diff --git a/src/server/game/Server/WorldPacket.cpp b/src/server/game/Server/WorldPacket.cpp new file mode 100644 index 00000000000..20588529098 --- /dev/null +++ b/src/server/game/Server/WorldPacket.cpp @@ -0,0 +1,103 @@ +/* + * Copyright (C) 2011 TrinityCore + * + * 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; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; 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, see . + */ + +#include "WorldPacket.h" +#include +#include "World.h" + +void WorldPacket::Compress(Opcodes opcode) +{ + if (opcode == UNKNOWN_OPCODE || opcode == NULL) + { + sLog->outError("Tried to compress packet with unknown opcode (%u)", uint32(opcode)); + return; + } + Opcodes uncompressedOpcode = GetOpcode(); + uint32 size = wpos(); + uint32 destsize = compressBound(size); + + std::vector storage(destsize); + + _compress(static_cast(&storage[0]), &destsize, static_cast(contents()), size); + if (destsize == 0) + return; + + clear(); + reserve(destsize + sizeof(uint32)); + *this << uint32(size); + append(&storage[0], destsize); + SetOpcode(opcode); + + sLog->outStaticDebug("Successfully compressed opcode %u (len %u) to %u (len %u)", + uncompressedOpcode, size, opcode, destsize); +} + +void WorldPacket::_compress(void* dst, uint32 *dst_size, const void* src, int src_size) +{ + z_stream c_stream; + + c_stream.zalloc = (alloc_func)0; + c_stream.zfree = (free_func)0; + c_stream.opaque = (voidpf)0; + + // default Z_BEST_SPEED (1) + int z_res = deflateInit(&c_stream, sWorld->getIntConfig(CONFIG_COMPRESSION)); + if (z_res != Z_OK) + { + sLog->outError("Can't compress packet (zlib: deflateInit) Error code: %i (%s)",z_res,zError(z_res)); + *dst_size = 0; + return; + } + + c_stream.next_out = (Bytef*)dst; + c_stream.avail_out = *dst_size; + c_stream.next_in = (Bytef*)src; + c_stream.avail_in = (uInt)src_size; + + z_res = deflate(&c_stream, Z_NO_FLUSH); + if (z_res != Z_OK) + { + sLog->outError("Can't compress packet (zlib: deflate) Error code: %i (%s)",z_res,zError(z_res)); + *dst_size = 0; + return; + } + + if (c_stream.avail_in != 0) + { + sLog->outError("Can't compress packet (zlib: deflate not greedy)"); + *dst_size = 0; + return; + } + + z_res = deflate(&c_stream, Z_FINISH); + if (z_res != Z_STREAM_END) + { + sLog->outError("Can't compress packet (zlib: deflate should report Z_STREAM_END instead %i (%s)",z_res,zError(z_res)); + *dst_size = 0; + return; + } + + z_res = deflateEnd(&c_stream); + if (z_res != Z_OK) + { + sLog->outError("Can't compress packet (zlib: deflateEnd) Error code: %i (%s)",z_res,zError(z_res)); + *dst_size = 0; + return; + } + + *dst_size = c_stream.total_out; +} \ No newline at end of file diff --git a/src/server/game/Server/WorldPacket.h b/src/server/game/Server/WorldPacket.h index 63da8652c7d..a9af9ed0563 100644 --- a/src/server/game/Server/WorldPacket.h +++ b/src/server/game/Server/WorldPacket.h @@ -45,9 +45,11 @@ class WorldPacket : public ByteBuffer Opcodes GetOpcode() const { return m_opcode; } void SetOpcode(Opcodes opcode) { m_opcode = opcode; } + void Compress(Opcodes opcode); protected: Opcodes m_opcode; + void _compress(void* dst, uint32 *dst_size, const void* src, int src_size); }; #endif -- cgit v1.2.3 From 6d1c770d8d5e6beddf304859de76d94473b6d221 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 27 Nov 2011 17:46:05 +0100 Subject: Cosmetic changes and typo fixes --- src/server/game/Entities/Unit/Unit.cpp | 22 +- .../Server/Protocol/Handlers/CharacterHandler.cpp | 12 +- src/server/game/Server/Protocol/Opcodes.h | 1683 ++++++++++---------- src/server/game/Server/WorldPacket.cpp | 15 +- src/server/game/Server/WorldPacket.h | 11 +- src/server/shared/Packets/ByteBuffer.cpp | 6 +- src/server/shared/Packets/ByteBuffer.h | 34 +- 7 files changed, 894 insertions(+), 889 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index cd21ccabb24..df8ee5be2ec 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -17149,24 +17149,24 @@ void Unit::BuildMovementPacket(ByteBuffer *data) const bool splineElevation = GetUnitMovementFlags() & MOVEMENTFLAG_SPLINE_ELEVATION; bool splineData = false; - data->writeBits(GetUnitMovementFlags(), 30); - data->writeBits(m_movementInfo.flags2, 12); - data->writeBit(onTransport); + data->WriteBits(GetUnitMovementFlags(), 30); + data->WriteBits(m_movementInfo.flags2, 12); + data->WriteBit(onTransport); if (onTransport) { - data->writeBit(hasInterpolatedMovement); - data->writeBit(time3); + data->WriteBit(hasInterpolatedMovement); + data->WriteBit(time3); } - data->writeBit(swimming); - data->writeBit(interPolatedTurning); + data->WriteBit(swimming); + data->WriteBit(interPolatedTurning); if (interPolatedTurning) - data->writeBit(jumping); + data->WriteBit(jumping); - data->writeBit(splineElevation); - data->writeBit(splineData); + data->WriteBit(splineElevation); + data->WriteBit(splineData); - data->flushBits(); // reset bit stream + data->FlushBits(); // reset bit stream *data << uint64(GetGUID()); *data << uint32(getMSTime()); diff --git a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp index 3e2c0197c5e..9a72a559502 100755 --- a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp @@ -246,10 +246,10 @@ void WorldSession::HandleCharEnum(QueryResult result) //case 14: // data.writeBit(1);//unk // break; - case 11: data.writeBit(Guid0 ? 1 : 0); break; - case 12: data.writeBit(Guid1 ? 1 : 0); break; - case 9: data.writeBit(Guid2 ? 1 : 0); break; - case 8: data.writeBit(Guid3 ? 1 : 0); break; + case 11: data.WriteBit(Guid0 ? 1 : 0); break; + case 12: data.WriteBit(Guid1 ? 1 : 0); break; + case 9: data.WriteBit(Guid2 ? 1 : 0); break; + case 8: data.WriteBit(Guid3 ? 1 : 0); break; /*case 15: if(uint8(GuildGuid)) data.writeBit(1); @@ -283,12 +283,12 @@ void WorldSession::HandleCharEnum(QueryResult result) data.writeBit(1); break;*/ default: - data.writeBit(0); + data.WriteBit(0); break; } } } - data.flushBits(); + data.FlushBits(); data.append(buffer); data.put(1, guidsVect.size()); } diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index c32c881b42c..933fb980958 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -28,442 +28,443 @@ /// List of Opcodes enum Opcodes { - NUM_OPCODE_HANDLERS = (0xFFFF+1), - UNKNOWN_OPCODE = NUM_OPCODE_HANDLERS, - - CMSG_ACCEPT_LEVEL_GRANT = 0xDC4B, // - CMSG_ACCEPT_TRADE = 0x00, // - CMSG_ACTIVATETAXI = 0x00, // - CMSG_ACTIVATETAXIEXPRESS = 0x00, // - CMSG_ADD_FRIEND = 0x5C57, // - CMSG_ADD_IGNORE = 0xCEEA, // - CMSG_ADD_VOICE_IGNORE = 0xA7A, // - CMSG_ALTER_APPEARANCE = 0x00, // - CMSG_AREATRIGGER = 0x5862, // - CMSG_AREA_SPIRIT_HEALER_QUERY = 0xDC7E, // - CMSG_AREA_SPIRIT_HEALER_QUEUE = 0x00, // - CMSG_ARENA_TEAM_ACCEPT = 0x00, // - CMSG_ARENA_TEAM_DECLINE = 0x00, // - CMSG_ARENA_TEAM_DISBAND = 0x4A5A, // - CMSG_ARENA_TEAM_INVITE = 0x4862, // - CMSG_ARENA_TEAM_LEADER = 0x8F3, // - CMSG_ARENA_TEAM_LEAVE = 0x48EB, // - CMSG_ARENA_TEAM_QUERY = 0x872, // - CMSG_ARENA_TEAM_REMOVE = 0xCE5E, // - CMSG_ARENA_TEAM_ROSTER = 0x00, // - CMSG_ATTACKSTOP = 0x00, // - CMSG_ATTACKSWING = 0x00, // - CMSG_AUCTION_LIST_BIDDER_ITEMS = 0x00, // - CMSG_AUCTION_LIST_ITEMS = 0xDC5F, // - CMSG_AUCTION_LIST_OWNER_ITEMS = 0x00, // - CMSG_AUCTION_PLACE_BID = 0x8E76, // - CMSG_AUCTION_REMOVE_ITEM = 0xCEC3, // - CMSG_AUCTION_SELL_ITEM = 0xCE6, // - CMSG_AUTH_SESSION = 0x1019, // + NUM_OPCODE_HANDLERS = (0xFFFF+1), + UNKNOWN_OPCODE = NUM_OPCODE_HANDLERS, + NULL_OPCODE = 0, + + CMSG_ACCEPT_LEVEL_GRANT = 0xDC4B, // + CMSG_ACCEPT_TRADE = 0x00, // + CMSG_ACTIVATETAXI = 0x00, // + CMSG_ACTIVATETAXIEXPRESS = 0x00, // + CMSG_ADD_FRIEND = 0x5C57, // + CMSG_ADD_IGNORE = 0xCEEA, // + CMSG_ADD_VOICE_IGNORE = 0xA7A, // + CMSG_ALTER_APPEARANCE = 0x00, // + CMSG_AREATRIGGER = 0x5862, // + CMSG_AREA_SPIRIT_HEALER_QUERY = 0xDC7E, // + CMSG_AREA_SPIRIT_HEALER_QUEUE = 0x00, // + CMSG_ARENA_TEAM_ACCEPT = 0x00, // + CMSG_ARENA_TEAM_DECLINE = 0x00, // + CMSG_ARENA_TEAM_DISBAND = 0x4A5A, // + CMSG_ARENA_TEAM_INVITE = 0x4862, // + CMSG_ARENA_TEAM_LEADER = 0x8F3, // + CMSG_ARENA_TEAM_LEAVE = 0x48EB, // + CMSG_ARENA_TEAM_QUERY = 0x872, // + CMSG_ARENA_TEAM_REMOVE = 0xCE5E, // + CMSG_ARENA_TEAM_ROSTER = 0x00, // + CMSG_ATTACKSTOP = 0x00, // + CMSG_ATTACKSWING = 0x00, // + CMSG_AUCTION_LIST_BIDDER_ITEMS = 0x00, // + CMSG_AUCTION_LIST_ITEMS = 0xDC5F, // + CMSG_AUCTION_LIST_OWNER_ITEMS = 0x00, // + CMSG_AUCTION_PLACE_BID = 0x8E76, // + CMSG_AUCTION_REMOVE_ITEM = 0xCEC3, // + CMSG_AUCTION_SELL_ITEM = 0xCE6, // + CMSG_AUTH_SESSION = 0x1019, // CMSG_AUTOEQUIP_GROUND_ITEM = 0x00, // - CMSG_AUTOEQUIP_ITEM = 0x8E66, // - CMSG_AUTOEQUIP_ITEM_SLOT = 0x00, // - CMSG_AUTO_DECLINE_GUILD_INVITES = 0x586F, // - CMSG_AUTOSTORE_BAG_ITEM = 0x00, // + CMSG_AUTOEQUIP_ITEM = 0x8E66, // + CMSG_AUTOEQUIP_ITEM_SLOT = 0x00, // + CMSG_AUTO_DECLINE_GUILD_INVITES = 0x586F, // + CMSG_AUTOSTORE_BAG_ITEM = 0x00, // CMSG_AUTOSTORE_GROUND_ITEM = 0x00, // - CMSG_AUTOSTORE_LOOT_ITEM = 0x00, // - CMSG_BANKER_ACTIVATE = 0x00, // - CMSG_BATTLEFIELD_JOIN = 0x00, // - CMSG_BATTLEFIELD_REQUEST_SCORE_DATA = 0x00, // - CMSG_BATTLEFIELD_STATUS = 0x00, // - MSG_BATTLEGROUND_PLAYER_POSITIONS = 0x00, // - CMSG_BATTLEMASTER_JOIN_ARENA = 0x00, // + CMSG_AUTOSTORE_LOOT_ITEM = 0x00, // + CMSG_BANKER_ACTIVATE = 0x00, // + CMSG_BATTLEFIELD_JOIN = 0x00, // + CMSG_BATTLEFIELD_REQUEST_SCORE_DATA = 0x00, // + CMSG_BATTLEFIELD_STATUS = 0x00, // + MSG_BATTLEGROUND_PLAYER_POSITIONS = 0x00, // + CMSG_BATTLEMASTER_JOIN_ARENA = 0x00, // CMSG_BEGIN_TRADE = 0x00, // - CMSG_BINDER_ACTIVATE = 0x00, // + CMSG_BINDER_ACTIVATE = 0x00, // CMSG_BOT_DETECTED2 = 0x00, // - CMSG_BUG = 0x1A77, // + CMSG_BUG = 0x1A77, // CMSG_BUSY_TRADE = 0x00, // - CMSG_BUYBACK_ITEM = 0xDEE6, // - CMSG_BUY_BANK_SLOT = 0x487F, // - CMSG_BUY_ITEM = 0x00, // - CMSG_CALENDAR_ADD_EVENT = 0x1CF3, // - CMSG_CALENDAR_ARENA_TEAM = 0x00, // - CMSG_CALENDAR_CONTEXT_EVENT_SIGNUP = 0x00, // - CMSG_CALENDAR_COPY_EVENT = 0x00, // - CMSG_CALENDAR_EVENT_INVITE = 0x1EDA, // - CMSG_CALENDAR_EVENT_MODERATOR_STATUS = 0x00, // - CMSG_CALENDAR_EVENT_REMOVE_INVITE = 0x00, // - CMSG_CALENDAR_EVENT_STATUS = 0x00, // - CMSG_CALENDAR_GET_EVENT = 0x00, // - CMSG_CALENDAR_GET_NUM_PENDING = 0x00, // - CMSG_CALENDAR_GUILD_FILTER = 0x00, // - CMSG_CALENDAR_REMOVE_EVENT = 0x00, // - CMSG_CALENDAR_UPDATE_EVENT = 0x5CD2, // - CMSG_CANCEL_AURA = 0x00, // - CMSG_CANCEL_AUTO_REPEAT_SPELL = 0x5CEE, // - CMSG_CANCEL_CAST = 0x00, // - CMSG_CANCEL_CHANNELLING = 0xC8FE, // - CMSG_CANCEL_GROWTH_AURA = 0xDEF7, // - CMSG_CANCEL_MOUNT_AURA = 0x00, // - CMSG_CANCEL_TEMP_ENCHANTMENT = 0x00, // - CMSG_CANCEL_TRADE = 0x35A5, // - CMSG_CAST_SPELL = 0x5E4E, // + CMSG_BUYBACK_ITEM = 0xDEE6, // + CMSG_BUY_BANK_SLOT = 0x487F, // + CMSG_BUY_ITEM = 0x00, // + CMSG_CALENDAR_ADD_EVENT = 0x1CF3, // + CMSG_CALENDAR_ARENA_TEAM = 0x00, // + CMSG_CALENDAR_CONTEXT_EVENT_SIGNUP = 0x00, // + CMSG_CALENDAR_COPY_EVENT = 0x00, // + CMSG_CALENDAR_EVENT_INVITE = 0x1EDA, // + CMSG_CALENDAR_EVENT_MODERATOR_STATUS = 0x00, // + CMSG_CALENDAR_EVENT_REMOVE_INVITE = 0x00, // + CMSG_CALENDAR_EVENT_STATUS = 0x00, // + CMSG_CALENDAR_GET_EVENT = 0x00, // + CMSG_CALENDAR_GET_NUM_PENDING = 0x00, // + CMSG_CALENDAR_GUILD_FILTER = 0x00, // + CMSG_CALENDAR_REMOVE_EVENT = 0x00, // + CMSG_CALENDAR_UPDATE_EVENT = 0x5CD2, // + CMSG_CANCEL_AURA = 0x00, // + CMSG_CANCEL_AUTO_REPEAT_SPELL = 0x5CEE, // + CMSG_CANCEL_CAST = 0x00, // + CMSG_CANCEL_CHANNELLING = 0xC8FE, // + CMSG_CANCEL_GROWTH_AURA = 0xDEF7, // + CMSG_CANCEL_MOUNT_AURA = 0x00, // + CMSG_CANCEL_TEMP_ENCHANTMENT = 0x00, // + CMSG_CANCEL_TRADE = 0x35A5, // + CMSG_CAST_SPELL = 0x5E4E, // CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE = 0x00, // - CMSG_CHANNEL_ANNOUNCEMENTS = 0x00, // - CMSG_CHANNEL_BAN = 0x00, // - CMSG_CHANNEL_DISPLAY_LIST = 0x00, // - CMSG_CHANNEL_INVITE = 0x00, // - CMSG_CHANNEL_KICK = 0x00, // - CMSG_CHANNEL_LIST = 0x00, // - CMSG_CHANNEL_MODERATOR = 0x00, // - CMSG_CHANNEL_MUTE = 0x00, // - CMSG_CHANNEL_OWNER = 0x00, // - CMSG_CHANNEL_PASSWORD = 0x00, // + CMSG_CHANNEL_ANNOUNCEMENTS = 0x00, // + CMSG_CHANNEL_BAN = 0x00, // + CMSG_CHANNEL_DISPLAY_LIST = 0x00, // + CMSG_CHANNEL_INVITE = 0x00, // + CMSG_CHANNEL_KICK = 0x00, // + CMSG_CHANNEL_LIST = 0x00, // + CMSG_CHANNEL_MODERATOR = 0x00, // + CMSG_CHANNEL_MUTE = 0x00, // + CMSG_CHANNEL_OWNER = 0x00, // + CMSG_CHANNEL_PASSWORD = 0x00, // CMSG_CHANNEL_ROSTER_INFO = 0x00, // CMSG_CHANNEL_SET_OWNER = 0x00, // - CMSG_CHANNEL_UNBAN = 0x00, // - CMSG_CHANNEL_UNMODERATOR = 0x00, // - CMSG_CHANNEL_UNMUTE = 0x00, // - CMSG_CHAR_CREATE = 0x1AC6, // - CMSG_CHAR_CUSTOMIZE = 0xDECF, // - CMSG_CHAR_DELETE = 0x1ED3, // - CMSG_CHAR_ENUM = 0x4A8B, // - CMSG_CHAR_FACTION_CHANGE = 0xCCEE, // - CMSG_CHAR_RACE_CHANGE = 0xDC57, // - CMSG_CHAR_RENAME = 0x5E6F, // - CMSG_CLEAR_CHANNEL_WATCH = 0x9CC2, // - CMSG_CLEAR_TRADE_ITEM = 0x00, // - CMSG_COMMENTATOR_ENABLE = 0x1CF7, // - CMSG_COMMENTATOR_ENTER_INSTANCE = 0x8EF6, // - CMSG_COMMENTATOR_EXIT_INSTANCE = 0x4C7B, // - CMSG_COMMENTATOR_GET_MAP_INFO = 0xDEE7, // - CMSG_COMMENTATOR_GET_PLAYER_INFO = 0x9EF3, // - CMSG_COMMENTATOR_INSTANCE_COMMAND = 0x5CEB, // - CMSG_COMMENTATOR_SKIRMISH_QUEUE_COMMAND = 0x9C4E, // + CMSG_CHANNEL_UNBAN = 0x00, // + CMSG_CHANNEL_UNMODERATOR = 0x00, // + CMSG_CHANNEL_UNMUTE = 0x00, // + CMSG_CHAR_CREATE = 0x1AC6, // + CMSG_CHAR_CUSTOMIZE = 0xDECF, // + CMSG_CHAR_DELETE = 0x1ED3, // + CMSG_CHAR_ENUM = 0x4A8B, // + CMSG_CHAR_FACTION_CHANGE = 0xCCEE, // + CMSG_CHAR_RACE_CHANGE = 0xDC57, // + CMSG_CHAR_RENAME = 0x5E6F, // + CMSG_CLEAR_CHANNEL_WATCH = 0x9CC2, // + CMSG_CLEAR_TRADE_ITEM = 0x00, // + CMSG_COMMENTATOR_ENABLE = 0x1CF7, // + CMSG_COMMENTATOR_ENTER_INSTANCE = 0x8EF6, // + CMSG_COMMENTATOR_EXIT_INSTANCE = 0x4C7B, // + CMSG_COMMENTATOR_GET_MAP_INFO = 0xDEE7, // + CMSG_COMMENTATOR_GET_PLAYER_INFO = 0x9EF3, // + CMSG_COMMENTATOR_INSTANCE_COMMAND = 0x5CEB, // + CMSG_COMMENTATOR_SKIRMISH_QUEUE_COMMAND = 0x9C4E, // CMSG_COMMENTATOR_START_WARGAME = 0x00, // - CMSG_COMPLAIN = 0x00, // - CMSG_COMPLETE_CINEMATIC = 0x1A6F, // - CMSG_COMPLETE_MOVIE = 0x00, // - CMSG_CONTACT_LIST = 0xCECF, // - CMSG_CORPSE_MAP_POSITION_QUERY = 0xDC7F, // - CMSG_CREATURE_QUERY = 0x5A7E, // - CMSG_DANCE_QUERY = 0x5C5E, // - CMSG_DECLINE_CHANNEL_INVITE = 0x00, // - CMSG_DEL_FRIEND = 0xC852, // - CMSG_DEL_IGNORE = 0x8ADA, // - CMSG_DEL_VOICE_IGNORE = 0x8C73, // - CMSG_DESTROYITEM = 0x4E7A, // + CMSG_COMPLAIN = 0x00, // + CMSG_COMPLETE_CINEMATIC = 0x1A6F, // + CMSG_COMPLETE_MOVIE = 0x00, // + CMSG_CONTACT_LIST = 0xCECF, // + CMSG_CORPSE_MAP_POSITION_QUERY = 0xDC7F, // + CMSG_CREATURE_QUERY = 0x5A7E, // + CMSG_DANCE_QUERY = 0x5C5E, // + CMSG_DECLINE_CHANNEL_INVITE = 0x00, // + CMSG_DEL_FRIEND = 0xC852, // + CMSG_DEL_IGNORE = 0x8ADA, // + CMSG_DEL_VOICE_IGNORE = 0x8C73, // + CMSG_DESTROYITEM = 0x4E7A, // CMSG_DESTROY_ITEMS = 0x00, // - CMSG_DUEL_ACCEPTED = 0x00, // - CMSG_DUEL_CANCELLED = 0x00, // - CMSG_EJECT_PASSENGER = 0x00, // - CMSG_EQUIPMENT_SET_DELETE = 0x00, // - CMSG_EQUIPMENT_SET_SAVE = 0x00, // - CMSG_EQUIPMENT_SET_USE = 0x4853, // - CMSG_EMOTE = 0x9843, // + CMSG_DUEL_ACCEPTED = 0x00, // + CMSG_DUEL_CANCELLED = 0x00, // + CMSG_EJECT_PASSENGER = 0x00, // + CMSG_EQUIPMENT_SET_DELETE = 0x00, // + CMSG_EQUIPMENT_SET_SAVE = 0x00, // + CMSG_EQUIPMENT_SET_USE = 0x4853, // + CMSG_EMOTE = 0x9843, // CMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK = 0x00, // CMSG_FORCE_FLIGHT_SPEED_CHANGE_ACK = 0x00, // - CMSG_FORCE_MOVE_ROOT_ACK = 0x00, // - CMSG_FORCE_MOVE_UNROOT_ACK = 0x00, // + CMSG_FORCE_MOVE_ROOT_ACK = 0x00, // + CMSG_FORCE_MOVE_UNROOT_ACK = 0x00, // CMSG_FORCE_PITCH_RATE_CHANGE_ACK = 0x00, // CMSG_FORCE_RUN_BACK_SPEED_CHANGE_ACK = 0x00, // - CMSG_FORCE_RUN_SPEED_CHANGE_ACK = 0x00, // + CMSG_FORCE_RUN_SPEED_CHANGE_ACK = 0x00, // CMSG_FORCE_SWIM_BACK_SPEED_CHANGE_ACK = 0x00, // CMSG_FORCE_SWIM_SPEED_CHANGE_ACK = 0x00, // CMSG_FORCE_TURN_RATE_CHANGE_ACK = 0x00, // CMSG_FORCE_WALK_SPEED_CHANGE_ACK = 0x00, // - CMSG_GAMEOBJECT_QUERY = 0xCEFF, // - CMSG_GAMEOBJ_REPORT_USE = 0x00, // - CMSG_GAMEOBJ_USE = 0x00, // + CMSG_GAMEOBJECT_QUERY = 0xCEFF, // + CMSG_GAMEOBJ_REPORT_USE = 0x00, // + CMSG_GAMEOBJ_USE = 0x00, // CMSG_GAMESPEED_SET = 0x00, // - CMSG_GAMETIME_SET = 0x00, // - CMSG_GET_MAIL_LIST = 0xB284, // - CMSG_GET_MIRRORIMAGE_DATA = 0xDAF3, // + CMSG_GAMETIME_SET = 0x00, // + CMSG_GET_MAIL_LIST = 0xB284, // + CMSG_GET_MIRRORIMAGE_DATA = 0xDAF3, // CMSG_GETDEATHBINDZONE = 0x00, // CMSG_GHOST = 0x00, // CMSG_GM_INVIS = 0x00, // - CMSG_GMRESPONSE_RESOLVE = 0x00, // - CMSG_GMSURVEY_SUBMIT = 0x00, // - CMSG_GMTICKET_CREATE = 0x00, // - CMSG_GMTICKET_DELETETICKET = 0x00, // - CMSG_GMTICKET_GETTICKET = 0x00, // - CMSG_GMTICKET_SYSTEMSTATUS = 0x4A7A, // - CMSG_GMTICKET_UPDATETEXT = 0x8A7B, // + CMSG_GMRESPONSE_RESOLVE = 0x00, // + CMSG_GMSURVEY_SUBMIT = 0x00, // + CMSG_GMTICKET_CREATE = 0x00, // + CMSG_GMTICKET_DELETETICKET = 0x00, // + CMSG_GMTICKET_GETTICKET = 0x00, // + CMSG_GMTICKET_SYSTEMSTATUS = 0x4A7A, // + CMSG_GMTICKET_UPDATETEXT = 0x8A7B, // CMSG_GM_NUKE = 0x00, // CMSG_GM_SET_SECURITY_GROUP = 0x00, // - CMSG_GM_REPORT_LAG = 0x00, // - CMSG_GOSSIP_HELLO = 0xAD3, // - CMSG_GOSSIP_SELECT_OPTION = 0x984E, // - CMSG_GRANT_LEVEL = 0x1CD6, // + CMSG_GM_REPORT_LAG = 0x00, // + CMSG_GOSSIP_HELLO = 0xAD3, // + CMSG_GOSSIP_SELECT_OPTION = 0x984E, // + CMSG_GRANT_LEVEL = 0x1CD6, // CMSG_GROUP_ACCEPT = 0x00, // - CMSG_GROUP_ASSISTANT_LEADER = 0xC8CA, // + CMSG_GROUP_ASSISTANT_LEADER = 0xC8CA, // CMSG_GROUP_CANCEL = 0x00, // - CMSG_GROUP_CHANGE_SUB_GROUP = 0x1AD2, // + CMSG_GROUP_CHANGE_SUB_GROUP = 0x1AD2, // CMSG_GROUP_DECLINE = 0x00, // - CMSG_GROUP_DISBAND = 0x00, // - CMSG_GROUP_INVITE = 0x00, // - CMSG_GROUP_RAID_CONVERT = 0xC85A, // - CMSG_GROUP_SET_LEADER = 0xCEC7, // - CMSG_GROUP_SWAP_SUB_GROUP = 0x5AD7, // + CMSG_GROUP_DISBAND = 0x00, // + CMSG_GROUP_INVITE = 0x00, // + CMSG_GROUP_RAID_CONVERT = 0xC85A, // + CMSG_GROUP_SET_LEADER = 0xCEC7, // + CMSG_GROUP_SWAP_SUB_GROUP = 0x5AD7, // CMSG_GROUP_UNINVITE = 0x00, // - CMSG_GROUP_UNINVITE_GUID = 0x00, // + CMSG_GROUP_UNINVITE_GUID = 0x00, // CMSG_GUILD_ACCEPT = 0x00, // - CMSG_GUILD_BANKER_ACTIVATE = 0x4E77, // - CMSG_GUILD_BANK_BUY_TAB = 0x00, // - CMSG_GUILD_BANK_DEPOSIT_MONEY = 0x00, // - CMSG_GUILD_BANK_NOTE = 0x00, // - CMSG_GUILD_BANK_QUERY_TAB = 0xDE46, // - CMSG_GUILD_BANK_SWAP_ITEMS = 0x85B, // - CMSG_GUILD_BANK_UPDATE_TAB = 0x00, // - CMSG_GUILD_BANK_WITHDRAW_MONEY = 0x00, // + CMSG_GUILD_BANKER_ACTIVATE = 0x4E77, // + CMSG_GUILD_BANK_BUY_TAB = 0x00, // + CMSG_GUILD_BANK_DEPOSIT_MONEY = 0x00, // + CMSG_GUILD_BANK_NOTE = 0x00, // + CMSG_GUILD_BANK_QUERY_TAB = 0xDE46, // + CMSG_GUILD_BANK_SWAP_ITEMS = 0x85B, // + CMSG_GUILD_BANK_UPDATE_TAB = 0x00, // + CMSG_GUILD_BANK_WITHDRAW_MONEY = 0x00, // CMSG_GUILD_CREATE = 0x00, // CMSG_GUILD_DECLINE = 0x00, // CMSG_GUILD_DEMOTE = 0x00, // CMSG_GUILD_DISBAND = 0x00, // - CMSG_GUILD_INFO = 0xCE76, // - CMSG_GUILD_INVITE = 0x00, // + CMSG_GUILD_INFO = 0xCE76, // + CMSG_GUILD_INVITE = 0x00, // CMSG_GUILD_PROMOTE = 0x00, // - CMSG_GUILD_QUERY = 0x8E57, // + CMSG_GUILD_QUERY = 0x8E57, // CMSG_GUILD_LEADER = 0x00, // CMSG_GUILD_LEAVE = 0x00, // CMSG_GUILD_MOTD = 0x00, // CMSG_GUILD_REMOVE = 0x00, // CMSG_GUILD_ROSTER = 0x00, // - CMSG_HEARTH_AND_RESURRECT = 0x00, // + CMSG_HEARTH_AND_RESURRECT = 0x00, // CMSG_IGNORE_TRADE = 0x00, // CMSG_INITIATE_TRADE = 0x00, // - CMSG_INSPECT = 0x9A7B, // - CMSG_INSTANCE_LOCK_WARNING_RESPONSE = 0x8CF7, // - CMSG_ITEM_QUERY_SINGLE = 0x8E2, // - CMSG_ITEM_QUERY_MULTIPLE = 0x00, // - CMSG_ITEM_REFUND = 0xCC3, // - CMSG_ITEM_REFUND_INFO = 0x1C7E, // - CMSG_ITEM_TEXT_QUERY = 0x4AEB, // - CMSG_JOIN_CHANNEL = 0x3441, // - CMSG_KEEP_ALIVE = 0xC87A, // - CMSG_LEARN_PREVIEW_TALENTS = 0xDEE3, // - CMSG_LEARN_PREVIEW_TALENTS_PET = 0x9AFB, // - CMSG_LEARN_TALENT = 0x98F3, // - CMSG_LEAVE_BATTLEFIELD = 0x1AE7, // - CMSG_LEAVE_CHANNEL = 0x00, // - CMSG_LFD_PARTY_LOCK_INFO_REQUEST = 0x00, // - CMSG_LFG_GET_PLAYER_INFO = 0x00, // - CMSG_LFG_JOIN = 0x00, // - CMSG_LFG_LEAVE = 0x00, // - CMSG_LFG_PROPOSAL_RESULT = 0x00, // - SMSG_LFG_BOOT_PLAYER = 0x00, // - CMSG_LFG_SET_ROLES = 0x4843, // - CMSG_LFG_TELEPORT = 0x8C7A, // - CMSG_LIST_INVENTORY = 0xDCFE, // - CMSG_LOAD_SCREEN = 0x4011, // - CMSG_LOG_DISCONNECT = 0x00, // - CMSG_LOGOUT_CANCEL = 0xA76, // - CMSG_LOGOUT_REQUEST = 0x4C7A, // - CMSG_LOOT = 0x00, // - CMSG_LOOT_METHOD = 0x00, // - CMSG_LOOT_MONEY = 0x00, // - CMSG_LOOT_RELEASE = 0x4A6A, // - CMSG_LOOT_ROLL = 0x00, // - CMSG_MAIL_CREATE_TEXT_ITEM = 0x886E, // - CMSG_MAIL_DELETE = 0x4CCF, // - CMSG_MAIL_MARK_AS_READ = 0x00, // - CMSG_MAIL_RETURN_TO_SENDER = 0x587E, // - CMSG_MAIL_TAKE_ITEM = 0xCC2, // - CMSG_MAIL_TAKE_MONEY = 0x4CD6, // - CMSG_MEETINGSTONE_INFO = 0xCA5B, // - CMSG_MESSAGECHAT_AFK = 0x00, // - CMSG_MESSAGECHAT_BATTLEGROUND = 0x00, // + CMSG_INSPECT = 0x9A7B, // + CMSG_INSTANCE_LOCK_WARNING_RESPONSE = 0x8CF7, // + CMSG_ITEM_QUERY_SINGLE = 0x8E2, // + CMSG_ITEM_QUERY_MULTIPLE = 0x00, // + CMSG_ITEM_REFUND = 0xCC3, // + CMSG_ITEM_REFUND_INFO = 0x1C7E, // + CMSG_ITEM_TEXT_QUERY = 0x4AEB, // + CMSG_JOIN_CHANNEL = 0x3441, // + CMSG_KEEP_ALIVE = 0xC87A, // + CMSG_LEARN_PREVIEW_TALENTS = 0xDEE3, // + CMSG_LEARN_PREVIEW_TALENTS_PET = 0x9AFB, // + CMSG_LEARN_TALENT = 0x98F3, // + CMSG_LEAVE_BATTLEFIELD = 0x1AE7, // + CMSG_LEAVE_CHANNEL = 0x00, // + CMSG_LFD_PARTY_LOCK_INFO_REQUEST = 0x00, // + CMSG_LFG_GET_PLAYER_INFO = 0x00, // + CMSG_LFG_JOIN = 0x00, // + CMSG_LFG_LEAVE = 0x00, // + CMSG_LFG_PROPOSAL_RESULT = 0x00, // + SMSG_LFG_BOOT_PLAYER = 0x00, // + CMSG_LFG_SET_ROLES = 0x4843, // + CMSG_LFG_TELEPORT = 0x8C7A, // + CMSG_LIST_INVENTORY = 0xDCFE, // + CMSG_LOAD_SCREEN = 0x4011, // + CMSG_LOG_DISCONNECT = 0x00, // + CMSG_LOGOUT_CANCEL = 0xA76, // + CMSG_LOGOUT_REQUEST = 0x4C7A, // + CMSG_LOOT = 0x00, // + CMSG_LOOT_METHOD = 0x00, // + CMSG_LOOT_MONEY = 0x00, // + CMSG_LOOT_RELEASE = 0x4A6A, // + CMSG_LOOT_ROLL = 0x00, // + CMSG_MAIL_CREATE_TEXT_ITEM = 0x886E, // + CMSG_MAIL_DELETE = 0x4CCF, // + CMSG_MAIL_MARK_AS_READ = 0x00, // + CMSG_MAIL_RETURN_TO_SENDER = 0x587E, // + CMSG_MAIL_TAKE_ITEM = 0xCC2, // + CMSG_MAIL_TAKE_MONEY = 0x4CD6, // + CMSG_MEETINGSTONE_INFO = 0xCA5B, // + CMSG_MESSAGECHAT_AFK = 0x00, // + CMSG_MESSAGECHAT_BATTLEGROUND = 0x00, // CMSG_MESSAGECHAT_BATTLEGROUND_LEADER = 0x00, // - CMSG_MESSAGECHAT_ADDON = 0x24D9, // - CMSG_MESSAGECHAT_CHANNEL = 0x7459, // - CMSG_MESSAGECHAT_DND = 0x00, // - CMSG_MESSAGECHAT_EMOTE = 0x6449, // - CMSG_MESSAGECHAT_GUILD = 0x60C1, // - CMSG_MESSAGECHAT_OFFICER = 0x00, // - CMSG_MESSAGECHAT_PARTY = 0x24C9, // + CMSG_MESSAGECHAT_ADDON = 0x24D9, // + CMSG_MESSAGECHAT_CHANNEL = 0x7459, // + CMSG_MESSAGECHAT_DND = 0x00, // + CMSG_MESSAGECHAT_EMOTE = 0x6449, // + CMSG_MESSAGECHAT_GUILD = 0x60C1, // + CMSG_MESSAGECHAT_OFFICER = 0x00, // + CMSG_MESSAGECHAT_PARTY = 0x24C9, // CMSG_MESSAGECHAT_PARTY_LEADER = 0x00, // - CMSG_MESSAGECHAT_RAID = 0x00, // + CMSG_MESSAGECHAT_RAID = 0x00, // CMSG_MESSAGECHAT_RAID_LEADER = 0x00, // - CMSG_MESSAGECHAT_RAID_WARNING = 0x00, // - CMSG_MESSAGECHAT_SAY = 0x2459, // - CMSG_MESSAGECHAT_WHISPER = 0x70D9, // - CMSG_MESSAGECHAT_YELL = 0x70C1, // - CMSG_MINIGAME_MOVE = 0x00, // - CMSG_MOUNTSPECIAL_ANIM = 0x00, // + CMSG_MESSAGECHAT_RAID_WARNING = 0x00, // + CMSG_MESSAGECHAT_SAY = 0x2459, // + CMSG_MESSAGECHAT_WHISPER = 0x70D9, // + CMSG_MESSAGECHAT_YELL = 0x70C1, // + CMSG_MINIGAME_MOVE = 0x00, // + CMSG_MOUNTSPECIAL_ANIM = 0x00, // CMSG_MOVE_KNOCK_BACK_ACK = 0x00, // CMSG_MOVE_SET_RAW_POSITION = 0x00, // - CMSG_MOVE_TIME_SKIPPED = 0x00, // - CMSG_ENABLE_NAGLE = 0x00, // - CMSG_NAME_QUERY = 0x586A, // + CMSG_MOVE_TIME_SKIPPED = 0x00, // + CMSG_ENABLE_NAGLE = 0x00, // + CMSG_NAME_QUERY = 0x586A, // CMSG_NEW_SPELL_SLOT = 0x00, // - CMSG_NEXT_CINEMATIC_CAMERA = 0x8E63, // - CMSG_NPC_TEXT_QUERY = 0x5C63, // - CMSG_OFFER_PETITION = 0xC8DE, // - CMSG_OPEN_ITEM = 0x88C7, // - CMSG_OPENING_CINEMATIC = 0xD8D2, // - CMSG_OPT_OUT_OF_LOOT = 0x00, // - CMSG_PAGE_TEXT_QUERY = 0x8A5F, // - CMSG_PETITION_BUY = 0x8E4E, // - CMSG_PETITION_QUERY = 0xCEF3, // - CMSG_PETITION_SHOWLIST = 0x00, // - CMSG_PETITION_SHOW_SIGNATURES = 0x1E66, // - CMSG_PETITION_SIGN = 0x4A5E, // + CMSG_NEXT_CINEMATIC_CAMERA = 0x8E63, // + CMSG_NPC_TEXT_QUERY = 0x5C63, // + CMSG_OFFER_PETITION = 0xC8DE, // + CMSG_OPEN_ITEM = 0x88C7, // + CMSG_OPENING_CINEMATIC = 0xD8D2, // + CMSG_OPT_OUT_OF_LOOT = 0x00, // + CMSG_PAGE_TEXT_QUERY = 0x8A5F, // + CMSG_PETITION_BUY = 0x8E4E, // + CMSG_PETITION_QUERY = 0xCEF3, // + CMSG_PETITION_SHOWLIST = 0x00, // + CMSG_PETITION_SHOW_SIGNATURES = 0x1E66, // + CMSG_PETITION_SIGN = 0x4A5E, // CMSG_PET_ABANDON = 0x00, // - CMSG_PET_ACTION = 0x1AEA, // - CMSG_PET_CANCEL_AURA = 0x00, // - CMSG_PET_CAST_SPELL = 0x00, // - CMSG_PET_LEARN_TALENT = 0x48E6, // - CMSG_PET_NAME_QUERY = 0xDA76, // - CMSG_PET_RENAME = 0x00, // - CMSG_PET_SET_ACTION = 0x00, // - CMSG_PET_SPELL_AUTOCAST = 0x00, // - CMSG_PET_STOP_ATTACK = 0x00, // - CMSG_PING = 0x1008, // - CMSG_PLAYER_DIFFICULTY_CHANGE = 0x00, // - CMSG_PLAYED_TIME = 0x5A56, // - CMSG_PLAYER_LOGIN = 0x0898, // - CMSG_PLAYER_LOGOUT = 0x1CEE, // - CMSG_PLAYER_VEHICLE_ENTER = 0x00, // - CMSG_PLAY_DANCE = 0x5857, // - CMSG_PUSHQUESTTOPARTY = 0xA47, // + CMSG_PET_ACTION = 0x1AEA, // + CMSG_PET_CANCEL_AURA = 0x00, // + CMSG_PET_CAST_SPELL = 0x00, // + CMSG_PET_LEARN_TALENT = 0x48E6, // + CMSG_PET_NAME_QUERY = 0xDA76, // + CMSG_PET_RENAME = 0x00, // + CMSG_PET_SET_ACTION = 0x00, // + CMSG_PET_SPELL_AUTOCAST = 0x00, // + CMSG_PET_STOP_ATTACK = 0x00, // + CMSG_PING = 0x1008, // + CMSG_PLAYER_DIFFICULTY_CHANGE = 0x00, // + CMSG_PLAYED_TIME = 0x5A56, // + CMSG_PLAYER_LOGIN = 0x0898, // + CMSG_PLAYER_LOGOUT = 0x1CEE, // + CMSG_PLAYER_VEHICLE_ENTER = 0x00, // + CMSG_PLAY_DANCE = 0x5857, // + CMSG_PUSHQUESTTOPARTY = 0xA47, // CMSG_QUERY_GUILD_REWARDS = 0x00, // CMSG_QUERY_GUILD_MAX_XP = 0x00, // CMSG_QUERY_GUILD_XP = 0x00, // - CMSG_QUERY_TIME = 0x18FE, // - CMSG_QUEST_QUERY = 0xCE7F, // - CMSG_QUERY_QUESTS_COMPLETED = 0x98DF, // + CMSG_QUERY_TIME = 0x18FE, // + CMSG_QUEST_QUERY = 0xCE7F, // + CMSG_QUERY_QUESTS_COMPLETED = 0x98DF, // CMSG_QUESTLOG_SWAP_QUEST = 0x00, // - CMSG_QUESTGIVER_ACCEPT_QUEST = 0x8CD3, // - CMSG_QUESTGIVER_CANCEL = 0xC86A, // - CMSG_QUESTGIVER_CHOOSE_REWARD = 0x18F3, // - CMSG_QUESTGIVER_COMPLETE_QUEST = 0xCCE3, // - CMSG_QUESTGIVER_HELLO = 0x00, // - CMSG_QUESTGIVER_QUERY_QUEST = 0x8CE7, // + CMSG_QUESTGIVER_ACCEPT_QUEST = 0x8CD3, // + CMSG_QUESTGIVER_CANCEL = 0xC86A, // + CMSG_QUESTGIVER_CHOOSE_REWARD = 0x18F3, // + CMSG_QUESTGIVER_COMPLETE_QUEST = 0xCCE3, // + CMSG_QUESTGIVER_HELLO = 0x00, // + CMSG_QUESTGIVER_QUERY_QUEST = 0x8CE7, // CMSG_QUESTGIVER_QUEST_AUTOLAUNCH = 0x00, // - CMSG_QUESTGIVER_REQUEST_REWARD = 0xD8E7, // - CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY = 0xC8DB, // - CMSG_QUESTGIVER_STATUS_QUERY = 0x88C6, // - CMSG_QUESTLOG_REMOVE_QUEST = 0x8EFF, // - CMSG_QUEST_POI_QUERY = 0x00, // - CMSG_QUEST_CONFIRM_ACCEPT = 0xC63, // - CMSG_READY_FOR_ACCOUNT_DATA_TIMES = 0xCCDB, // - CMSG_READ_ITEM = 0x00, // - CMSG_REALM_SPLIT = 0xDC66, // - CMSG_RECLAIM_CORPSE = 0x88DB, // - CMSG_REDIRECTION_AUTH_PROOF = 0x00, // - CMSG_REPAIR_ITEM = 0xCF3, // - CMSG_REPOP_REQUEST = 0x8872, // - CMSG_REPORT_PVP_AFK = 0x00, // - CMSG_REPLACE_ACCOUNT_DATA = 0x00, // - CMSG_REQUEST_ACCOUNT_DATA = 0x00, // - CMSG_REQUEST_CATEGORY_COOLDOWNS = 0x00, // - CMSG_REQUEST_CEMETERY_LIST = 0x00, // - CMSG_REQUEST_PARTY_MEMBER_STATS = 0x987E, // - CMSG_REQUEST_PET_INFO = 0x9A47, // - CMSG_REQUEST_PLAYER_VEHICLE_EXIT = 0xCC6, // - CMSG_REQUEST_RATED_BG_INFO = 0x00, // - CMSG_REQUEST_RAID_INFO = 0x00, // - CMSG_REQUEST_VEHICLE_NEXT_SEAT = 0xCAD6, // - CMSG_REQUEST_VEHICLE_PREV_SEAT = 0x1AE2, // + CMSG_QUESTGIVER_REQUEST_REWARD = 0xD8E7, // + CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY = 0xC8DB, // + CMSG_QUESTGIVER_STATUS_QUERY = 0x88C6, // + CMSG_QUESTLOG_REMOVE_QUEST = 0x8EFF, // + CMSG_QUEST_POI_QUERY = 0x00, // + CMSG_QUEST_CONFIRM_ACCEPT = 0xC63, // + CMSG_READY_FOR_ACCOUNT_DATA_TIMES = 0xCCDB, // + CMSG_READ_ITEM = 0x00, // + CMSG_REALM_SPLIT = 0xDC66, // + CMSG_RECLAIM_CORPSE = 0x88DB, // + CMSG_REDIRECTION_AUTH_PROOF = 0x00, // + CMSG_REPAIR_ITEM = 0xCF3, // + CMSG_REPOP_REQUEST = 0x8872, // + CMSG_REPORT_PVP_AFK = 0x00, // + CMSG_REPLACE_ACCOUNT_DATA = 0x00, // + CMSG_REQUEST_ACCOUNT_DATA = 0x00, // + CMSG_REQUEST_CATEGORY_COOLDOWNS = 0x00, // + CMSG_REQUEST_CEMETERY_LIST = 0x00, // + CMSG_REQUEST_PARTY_MEMBER_STATS = 0x987E, // + CMSG_REQUEST_PET_INFO = 0x9A47, // + CMSG_REQUEST_PLAYER_VEHICLE_EXIT = 0xCC6, // + CMSG_REQUEST_RATED_BG_INFO = 0x00, // + CMSG_REQUEST_RAID_INFO = 0x00, // + CMSG_REQUEST_VEHICLE_NEXT_SEAT = 0xCAD6, // + CMSG_REQUEST_VEHICLE_PREV_SEAT = 0x1AE2, // CMSG_REQUEST_VEHICLE_SWITCH_SEAT = 0x01, // temp to fix switch case value error - CMSG_RESET_INSTANCES = 0x9EEA, // - CMSG_RESURRECT_RESPONSE = 0x00, // - CMSG_RETURN_TO_GRAVEYARD = 0x00, // + CMSG_RESET_INSTANCES = 0x9EEA, // + CMSG_RESURRECT_RESPONSE = 0x00, // + CMSG_RETURN_TO_GRAVEYARD = 0x00, // CMSG_SAVE_PLAYER = 0x00, // - CMSG_SEARCH_LFG_JOIN = 0x00, // - CMSG_SEARCH_LFG_LEAVE = 0x00, // - CMSG_SELF_RES = 0xCCFE, // - CMSG_SELL_ITEM = 0x5EE3, // - CMSG_SET_ACTIONBAR_TOGGLES = 0x584F, // - CMSG_SET_ACTION_BUTTON = 0x00, // - CMSG_SET_ACTIVE_MOVER = 0x00, // - CMSG_SET_ACTIVE_VOICE_CHANNEL = 0x00, // - CMSG_SET_ALLOW_LOW_LEVEL_RAID1 = 0xC863, // - CMSG_SET_ALLOW_LOW_LEVEL_RAID2 = 0x4CE7, // + CMSG_SEARCH_LFG_JOIN = 0x00, // + CMSG_SEARCH_LFG_LEAVE = 0x00, // + CMSG_SELF_RES = 0xCCFE, // + CMSG_SELL_ITEM = 0x5EE3, // + CMSG_SET_ACTIONBAR_TOGGLES = 0x584F, // + CMSG_SET_ACTION_BUTTON = 0x00, // + CMSG_SET_ACTIVE_MOVER = 0x00, // + CMSG_SET_ACTIVE_VOICE_CHANNEL = 0x00, // + CMSG_SET_ALLOW_LOW_LEVEL_RAID1 = 0xC863, // + CMSG_SET_ALLOW_LOW_LEVEL_RAID2 = 0x4CE7, // CMSG_SET_CHANNEL_WATCH = 0x00, // - CMSG_SET_CONTACT_NOTES = 0x1AF3, // + CMSG_SET_CONTACT_NOTES = 0x1AF3, // CMSG_SET_FACTION_CHEAT = 0x00, // - CMSG_SET_GUILD_BANK_TEXT = 0x00, // - CMSG_SET_LFG_COMMENT = 0x00, // - CMSG_SET_PLAYER_DECLINED_NAMES = 0xC847, // - CMSG_SET_PRIMARY_TALENT_TREE = 0x185E, // - CMSG_SET_SAVED_INSTANCE_EXTEND = 0x8E62, // - CMSG_SET_SELECTION = 0x4C4E, // + CMSG_SET_GUILD_BANK_TEXT = 0x00, // + CMSG_SET_LFG_COMMENT = 0x00, // + CMSG_SET_PLAYER_DECLINED_NAMES = 0xC847, // + CMSG_SET_PRIMARY_TALENT_TREE = 0x185E, // + CMSG_SET_SAVED_INSTANCE_EXTEND = 0x8E62, // + CMSG_SET_SELECTION = 0x4C4E, // CMSG_SET_SKILL_CHEAT = 0x00, // - CMSG_SET_TAXI_BENCHMARK_MODE = 0x1EFF, // - CMSG_SET_TITLE = 0x00, // + CMSG_SET_TAXI_BENCHMARK_MODE = 0x1EFF, // + CMSG_SET_TITLE = 0x00, // CMSG_SET_TRADE_GOLD = 0x00, // - CMSG_SET_TRADE_ITEM = 0x00, // + CMSG_SET_TRADE_ITEM = 0x00, // CMSG_SETDEATHBINDPOINT = 0x00, // - CMSG_SETSHEATHED = 0xCA5F, // - CMSG_SHOWING_CLOAK = 0x8AE3, // - CMSG_SHOWING_HELM = 0xCEFA, // + CMSG_SETSHEATHED = 0xCA5F, // + CMSG_SHOWING_CLOAK = 0x8AE3, // + CMSG_SHOWING_HELM = 0xCEFA, // CMSG_SERVERTIME = 0x00, // - CMSG_SOCKET_GEMS = 0x00, // - CMSG_SPIRIT_HEALER_ACTIVATE = 0x5AEB, // - CMSG_SPELLCLICK = 0xC8F2, // - CMSG_SPLIT_ITEM = 0x00, // - CMSG_STANDSTATECHANGE = 0x9EC6, // - CMSG_START_QUEST = 0x00, // - CMSG_STOP_DANCE = 0x00, // + CMSG_SOCKET_GEMS = 0x00, // + CMSG_SPIRIT_HEALER_ACTIVATE = 0x5AEB, // + CMSG_SPELLCLICK = 0xC8F2, // + CMSG_SPLIT_ITEM = 0x00, // + CMSG_STANDSTATECHANGE = 0x9EC6, // + CMSG_START_QUEST = 0x00, // + CMSG_STOP_DANCE = 0x00, // CMSG_STORE_LOOT_IN_SLOT = 0x00, // - CMSG_SUMMON_RESPONSE = 0xD84E, // - CMSG_SWAP_ITEM = 0xDED6, // - CMSG_SWAP_INV_ITEM = 0x5CE7, // - CMSG_TELEPORT_TO_UNIT = 0x8C72, // - CMSG_TEXT_EMOTE = 0x00, // - CMSG_TIME_SYNC_RESP = 0x07A5, // - CMSG_TAXICLEARALLNODES = 0x00, // - CMSG_TAXIENABLEALLNODES = 0x00, // - CMSG_TAXINODE_STATUS_QUERY = 0x98E3, // + CMSG_SUMMON_RESPONSE = 0xD84E, // + CMSG_SWAP_ITEM = 0xDED6, // + CMSG_SWAP_INV_ITEM = 0x5CE7, // + CMSG_TELEPORT_TO_UNIT = 0x8C72, // + CMSG_TEXT_EMOTE = 0x00, // + CMSG_TIME_SYNC_RESP = 0x07A5, // + CMSG_TAXICLEARALLNODES = 0x00, // + CMSG_TAXIENABLEALLNODES = 0x00, // + CMSG_TAXINODE_STATUS_QUERY = 0x98E3, // CMSG_TAXIQUERYAVAILABLENODES = 0x00, // - CMSG_TAXISHOWNODES = 0x00, // - CMSG_TOGGLE_PVP = 0x8ECA, // - CMSG_TOTEM_DESTROYED = 0x00, // - SMSG_TRAINER_BUY_SUCCEEDED = 0xAF7, // - CMSG_TRAINER_LIST = 0xCC7F, // + CMSG_TAXISHOWNODES = 0x00, // + CMSG_TOGGLE_PVP = 0x8ECA, // + CMSG_TOTEM_DESTROYED = 0x00, // + SMSG_TRAINER_BUY_SUCCEEDED = 0xAF7, // + CMSG_TRAINER_LIST = 0xCC7F, // CMSG_TRIGGER_CINEMATIC_CHEAT = 0x00, // - CMSG_TURN_IN_PETITION = 0x9C67, // - CMSG_TUTORIAL_CLEAR = 0x00, // - CMSG_TUTORIAL_FLAG = 0x00, // - CMSG_TUTORIAL_RESET = 0x00, // - CMSG_UNACCEPT_TRADE = 0x00, // - CMSG_UNLEARN_SKILL = 0xAC3, // - CMSG_UNREGISTER_ALL_ADDON_PREFIXES = 0x00, // + CMSG_TURN_IN_PETITION = 0x9C67, // + CMSG_TUTORIAL_CLEAR = 0x00, // + CMSG_TUTORIAL_FLAG = 0x00, // + CMSG_TUTORIAL_RESET = 0x00, // + CMSG_UNACCEPT_TRADE = 0x00, // + CMSG_UNLEARN_SKILL = 0xAC3, // + CMSG_UNREGISTER_ALL_ADDON_PREFIXES = 0x00, // CMSG_UNUSED2 = 0x00, // - CMSG_UPDATE_ACCOUNT_DATA = 0x4AFE, // - CMSG_USE_ITEM = 0x00, // - CMSG_VOICE_SESSION_ENABLE = 0x00, // - CMSG_VIOLENCE_LEVEL = 0x00, // - CMSG_WARDEN_DATA = 0x5847, // - CMSG_WHO = 0x9AD7, // - CMSG_WHOIS = 0xCCE6, // - CMSG_WORLD_STATE_UI_TIMER_UPDATE = 0x58F6, // - CMSG_WORLD_TELEPORT = 0x00, // + CMSG_UPDATE_ACCOUNT_DATA = 0x4AFE, // + CMSG_USE_ITEM = 0x00, // + CMSG_VOICE_SESSION_ENABLE = 0x00, // + CMSG_VIOLENCE_LEVEL = 0x00, // + CMSG_WARDEN_DATA = 0x5847, // + CMSG_WHO = 0x9AD7, // + CMSG_WHOIS = 0xCCE6, // + CMSG_WORLD_STATE_UI_TIMER_UPDATE = 0x58F6, // + CMSG_WORLD_TELEPORT = 0x00, // CMSG_WRAP_ITEM = 0x00, // - CMSG_ZONEUPDATE = 0x00, // - MSG_AUCTION_HELLO = 0x00, // - MSG_CHANNEL_START = 0x00, // - MSG_CHANNEL_UPDATE = 0x00, // - MSG_CORPSE_QUERY = 0x00, // + CMSG_ZONEUPDATE = 0x00, // + MSG_AUCTION_HELLO = 0x00, // + MSG_CHANNEL_START = 0x00, // + MSG_CHANNEL_UPDATE = 0x00, // + MSG_CORPSE_QUERY = 0x00, // MSG_GM_BIND_OTHER = 0x00, // MSG_GM_SHOWLABEL = 0x00, // MSG_GM_SUMMON = 0x00, // - MSG_GUILD_BANK_LOG_QUERY = 0x00, // - MSG_GUILD_BANK_MONEY_WITHDRAWN = 0xDE77, // - MSG_GUILD_EVENT_LOG_QUERY = 0x00, // - MSG_GUILD_PERMISSIONS = 0x00, // - MSG_INSPECT_ARENA_TEAMS = 0x00, // - MSG_LIST_STABLED_PETS = 0x88CA, // - MSG_MINIMAP_PING = 0x00, // - MSG_MOVE_FALL_LAND = 0x00, // - MSG_MOVE_HEARTBEAT = 0x00, // + MSG_GUILD_BANK_LOG_QUERY = 0x00, // + MSG_GUILD_BANK_MONEY_WITHDRAWN = 0xDE77, // + MSG_GUILD_EVENT_LOG_QUERY = 0x00, // + MSG_GUILD_PERMISSIONS = 0x00, // + MSG_INSPECT_ARENA_TEAMS = 0x00, // + MSG_LIST_STABLED_PETS = 0x88CA, // + MSG_MINIMAP_PING = 0x00, // + MSG_MOVE_FALL_LAND = 0x00, // + MSG_MOVE_HEARTBEAT = 0x00, // MSG_MOVE_HOVER = 0x00, // - MSG_MOVE_JUMP = 0xE4E, // + MSG_MOVE_JUMP = 0xE4E, // MSG_MOVE_KNOCK_BACK = 0x00, // MSG_MOVE_ROOT = 0x00, // MSG_MOVE_SET_ALL_SPEED_CHEAT = 0x00, // - MSG_MOVE_SET_FACING = 0x00, // + MSG_MOVE_SET_FACING = 0x00, // MSG_MOVE_SET_FLIGHT_BACK_SPEED = 0x00, // MSG_MOVE_SET_FLIGHT_BACK_SPEED_CHEAT = 0x00, // MSG_MOVE_SET_FLIGHT_SPEED = 0x00, // MSG_MOVE_SET_FLIGHT_SPEED_CHEAT = 0x00, // - MSG_MOVE_SET_PITCH = 0x00, // + MSG_MOVE_SET_PITCH = 0x00, // MSG_MOVE_SET_PITCH_RATE = 0x00, // MSG_MOVE_SET_RAW_POSITION_ACK = 0x00, // MSG_MOVE_SET_RUN_BACK_SPEED = 0x00, // @@ -480,545 +481,545 @@ enum Opcodes MSG_MOVE_SET_WALK_MODE = 0x00, // MSG_MOVE_SET_WALK_SPEED = 0x00, // MSG_MOVE_SET_WALK_SPEED_CHEAT = 0x00, // - MSG_MOVE_START_ASCEND = 0x00, // - MSG_MOVE_START_DESCEND = 0x00, // - MSG_MOVE_STOP_ASCEND = 0x00, // - MSG_MOVE_START_BACKWARD = 0x00, // - MSG_MOVE_START_FORWARD = 0x00, // + MSG_MOVE_START_ASCEND = 0x00, // + MSG_MOVE_START_DESCEND = 0x00, // + MSG_MOVE_STOP_ASCEND = 0x00, // + MSG_MOVE_START_BACKWARD = 0x00, // + MSG_MOVE_START_FORWARD = 0x00, // MSG_MOVE_START_PITCH_UP = 0x00, // MSG_MOVE_START_PITCH_DOWN = 0x00, // - MSG_MOVE_START_TURN_LEFT = 0x00, // - MSG_MOVE_START_TURN_RIGHT = 0x00, // - MSG_MOVE_START_STRAFE_LEFT = 0x00, // - MSG_MOVE_START_STRAFE_RIGHT = 0x00, // - MSG_MOVE_START_SWIM = 0x00, // - MSG_MOVE_STOP = 0x00, // + MSG_MOVE_START_TURN_LEFT = 0x00, // + MSG_MOVE_START_TURN_RIGHT = 0x00, // + MSG_MOVE_START_STRAFE_LEFT = 0x00, // + MSG_MOVE_START_STRAFE_RIGHT = 0x00, // + MSG_MOVE_START_SWIM = 0x00, // + MSG_MOVE_STOP = 0x00, // MSG_MOVE_STOP_PITCH = 0x00, // - MSG_MOVE_STOP_TURN = 0x00, // - MSG_MOVE_STOP_STRAFE = 0x00, // + MSG_MOVE_STOP_TURN = 0x00, // + MSG_MOVE_STOP_STRAFE = 0x00, // MSG_MOVE_STOP_SWIM = 0x00, // MSG_MOVE_TOGGLE_LOGGING = 0x00, // - MSG_MOVE_TIME_SKIPPED = 0x00, // + MSG_MOVE_TIME_SKIPPED = 0x00, // MSG_MOVE_TELEPORT = 0x00, // MSG_MOVE_TELEPORT_ACK = 0x00, // MSG_MOVE_TELEPORT_CHEAT = 0x00, // MSG_MOVE_TOGGLE_COLLISION_CHEAT = 0x00, // MSG_MOVE_TOGGLE_FALL_LOGGING = 0x00, // MSG_MOVE_UNROOT = 0x00, // - MSG_MOVE_WORLDPORT_ACK = 0x00, // - MSG_NOTIFY_PARTY_SQUELCH = 0x00, // - MSG_PARTY_ASSIGNMENT = 0x00, // - MSG_PETITION_DECLINE = 0x98E7, // - MSG_PETITION_RENAME = 0x4857, // - MSG_PVP_LOG_DATA = 0x00, // - MSG_QUERY_GUILD_BANK_TEXT = 0x00, // - MSG_QUERY_NEXT_MAIL_TIME = 0x00, // - MSG_QUEST_PUSH_RESULT = 0x1863, // - MSG_RAID_READY_CHECK = 0x584E, // - MSG_RAID_READY_CHECK_CONFIRM = 0x584E, // - MSG_RAID_READY_CHECK_FINISHED = 0x00, // - MSG_RAID_TARGET_UPDATE = 0x00, // - MSG_RANDOM_ROLL = 0x4C57, // - MSG_SAVE_GUILD_EMBLEM = 0x00, // - MSG_SET_DUNGEON_DIFFICULTY = 0xC4F, // - MSG_SET_RAID_DIFFICULTY = 0x1A5A, // - MSG_TABARDVENDOR_ACTIVATE = 0x98EB, // - MSG_TALENT_WIPE_CONFIRM = 0x00, // + MSG_MOVE_WORLDPORT_ACK = 0x00, // + MSG_NOTIFY_PARTY_SQUELCH = 0x00, // + MSG_PARTY_ASSIGNMENT = 0x00, // + MSG_PETITION_DECLINE = 0x98E7, // + MSG_PETITION_RENAME = 0x4857, // + MSG_PVP_LOG_DATA = 0x00, // + MSG_QUERY_GUILD_BANK_TEXT = 0x00, // + MSG_QUERY_NEXT_MAIL_TIME = 0x00, // + MSG_QUEST_PUSH_RESULT = 0x1863, // + MSG_RAID_READY_CHECK = 0x584E, // + MSG_RAID_READY_CHECK_CONFIRM = 0x584E, // + MSG_RAID_READY_CHECK_FINISHED = 0x00, // + MSG_RAID_TARGET_UPDATE = 0x00, // + MSG_RANDOM_ROLL = 0x4C57, // + MSG_SAVE_GUILD_EMBLEM = 0x00, // + MSG_SET_DUNGEON_DIFFICULTY = 0xC4F, // + MSG_SET_RAID_DIFFICULTY = 0x1A5A, // + MSG_TABARDVENDOR_ACTIVATE = 0x98EB, // + MSG_TALENT_WIPE_CONFIRM = 0x00, // OBSOLETE_DROP_ITEM = 0x00, // - SMSG_ACCOUNT_DATA_TIMES = 0x5EE2, // - SMSG_ACHIEVEMENT_DELETED = 0x00, // - SMSG_ACHIEVEMENT_EARNED = 0x00, // - SMSG_ACTION_BUTTONS = 0x00, // - SMSG_ACTIVATETAXIREPLY = 0x8E4F, // - SMSG_ADDON_INFO = 0x9863, // + SMSG_ACCOUNT_DATA_TIMES = 0x5EE2, // + SMSG_ACHIEVEMENT_DELETED = 0x00, // + SMSG_ACHIEVEMENT_EARNED = 0x00, // + SMSG_ACTION_BUTTONS = 0x00, // + SMSG_ACTIVATETAXIREPLY = 0x8E4F, // + SMSG_ADDON_INFO = 0x9863, // SMSG_ADD_RUNE_POWER = 0x00, // - SMSG_AI_REACTION = 0x00, // - SMSG_ALL_ACHIEVEMENT_DATA = 0x00, // + SMSG_AI_REACTION = 0x00, // + SMSG_ALL_ACHIEVEMENT_DATA = 0x00, // SMSG_AREA_SPIRIT_HEALER_TIME = 0x00, // - SMSG_AREA_TRIGGER_MESSAGE = 0x00, // - SMSG_ARENA_ERROR = 0x00, // - SMSG_ARENA_OPPONENT_UPDATE = 0x00, // - SMSG_ARENA_TEAM_CHANGE_FAILED_QUEUED = 0x4A4E, // - SMSG_ARENA_TEAM_COMMAND_RESULT = 0x00, // - SMSG_ARENA_TEAM_EVENT = 0x00, // - SMSG_ARENA_TEAM_INVITE = 0x00, // - SMSG_ARENA_TEAM_QUERY_RESPONSE = 0x00, // - SMSG_ARENA_TEAM_ROSTER = 0x00, // - SMSG_ARENA_TEAM_STATS = 0x00, // - SMSG_ATTACKERSTATEUPDATE = 0x00, // - SMSG_ATTACKSTART = 0x00, // - SMSG_ATTACKSTOP = 0x00, // - SMSG_ATTACKSWING_BADFACING = 0x00, // - SMSG_ATTACKSWING_CANT_ATTACK = 0x00, // - SMSG_ATTACKSWING_DEADTARGET = 0x00, // - SMSG_ATTACKSWING_NOTINRANGE = 0x00, // - SMSG_AUCTION_BIDDER_LIST_RESULT = 0x00, // - SMSG_AUCTION_BIDDER_NOTIFICATION = 0x00, // - SMSG_AUCTION_COMMAND_RESULT = 0x00, // - SMSG_AUCTION_LIST_PENDING_SALES = 0x00, // - SMSG_AUCTION_LIST_RESULT = 0x00, // - SMSG_AUCTION_OWNER_LIST_RESULT = 0x00, // - SMSG_AUCTION_OWNER_NOTIFICATION = 0x00, // - SMSG_AUCTION_REMOVED_NOTIFICATION = 0x00, // - SMSG_AURA_UPDATE = 0x4C66, // - SMSG_AURA_UPDATE_ALL = 0x18EE, // + SMSG_AREA_TRIGGER_MESSAGE = 0x00, // + SMSG_ARENA_ERROR = 0x00, // + SMSG_ARENA_OPPONENT_UPDATE = 0x00, // + SMSG_ARENA_TEAM_CHANGE_FAILED_QUEUED = 0x4A4E, // + SMSG_ARENA_TEAM_COMMAND_RESULT = 0x00, // + SMSG_ARENA_TEAM_EVENT = 0x00, // + SMSG_ARENA_TEAM_INVITE = 0x00, // + SMSG_ARENA_TEAM_QUERY_RESPONSE = 0x00, // + SMSG_ARENA_TEAM_ROSTER = 0x00, // + SMSG_ARENA_TEAM_STATS = 0x00, // + SMSG_ATTACKERSTATEUPDATE = 0x00, // + SMSG_ATTACKSTART = 0x00, // + SMSG_ATTACKSTOP = 0x00, // + SMSG_ATTACKSWING_BADFACING = 0x00, // + SMSG_ATTACKSWING_CANT_ATTACK = 0x00, // + SMSG_ATTACKSWING_DEADTARGET = 0x00, // + SMSG_ATTACKSWING_NOTINRANGE = 0x00, // + SMSG_AUCTION_BIDDER_LIST_RESULT = 0x00, // + SMSG_AUCTION_BIDDER_NOTIFICATION = 0x00, // + SMSG_AUCTION_COMMAND_RESULT = 0x00, // + SMSG_AUCTION_LIST_PENDING_SALES = 0x00, // + SMSG_AUCTION_LIST_RESULT = 0x00, // + SMSG_AUCTION_OWNER_LIST_RESULT = 0x00, // + SMSG_AUCTION_OWNER_NOTIFICATION = 0x00, // + SMSG_AUCTION_REMOVED_NOTIFICATION = 0x00, // + SMSG_AURA_UPDATE = 0x4C66, // + SMSG_AURA_UPDATE_ALL = 0x18EE, // SMSG_AURACASTLOG = 0x00, // - SMSG_AUTH_CHALLENGE = 0x1181, // - SMSG_AUTH_RESPONSE = 0x8867, // - SMSG_AVAILABLE_VOICE_CHANNEL = 0x00, // - SMSG_BARBER_SHOP_RESULT = 0x00, // - SMSG_BATTLEFIELD_LIST = 0x00, // - SMSG_BATTLEFIELD_MGR_EJECTED = 0x00, // - SMSG_BATTLEFIELD_MGR_EJECT_PENDING = 0x00, // - SMSG_BATTLEFIELD_MGR_ENTERED = 0x00, // - SMSG_BATTLEFIELD_MGR_ENTRY_INVITE = 0x00, // - SMSG_BATTLEFIELD_MGR_QUEUE_INVITE = 0x00, // - SMSG_BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE = 0x00, // - SMSG_BATTLEFIELD_MGR_STATE_CHANGE = 0x00, // + SMSG_AUTH_CHALLENGE = 0x1181, // + SMSG_AUTH_RESPONSE = 0x8867, // + SMSG_AVAILABLE_VOICE_CHANNEL = 0x00, // + SMSG_BARBER_SHOP_RESULT = 0x00, // + SMSG_BATTLEFIELD_LIST = 0x00, // + SMSG_BATTLEFIELD_MGR_EJECTED = 0x00, // + SMSG_BATTLEFIELD_MGR_EJECT_PENDING = 0x00, // + SMSG_BATTLEFIELD_MGR_ENTERED = 0x00, // + SMSG_BATTLEFIELD_MGR_ENTRY_INVITE = 0x00, // + SMSG_BATTLEFIELD_MGR_QUEUE_INVITE = 0x00, // + SMSG_BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE = 0x00, // + SMSG_BATTLEFIELD_MGR_STATE_CHANGE = 0x00, // SMSG_BATTLEFIELD_PORT_DENIED = 0x00, // - SMSG_BATTLEFIELD_STATUS1 = 0x00, // - SMSG_BATTLEFIELD_STATUS2 = 0x00, // - SMSG_BATTLEFIELD_STATUS3 = 0x00, // - SMSG_BATTLEFIELD_STATUS4 = 0x00, // + SMSG_BATTLEFIELD_STATUS1 = 0x00, // + SMSG_BATTLEFIELD_STATUS2 = 0x00, // + SMSG_BATTLEFIELD_STATUS3 = 0x00, // + SMSG_BATTLEFIELD_STATUS4 = 0x00, // SMSG_BATTLEGROUND_INFO_THROTTLED = 0x00, // - SMSG_BATTLEGROUND_PLAYER_JOINED = 0x00, // - SMSG_BATTLEGROUND_PLAYER_POSITIONS = 0x00, // - SMSG_BINDPOINTUPDATE = 0x00, // - SMSG_BINDZONEREPLY = 0x00, // - SMSG_BINDER_CONFIRM = 0x00, // - SMSG_BREAK_TARGET = 0x00, // - SMSG_BUY_BANK_SLOT_RESULT = 0x00, // + SMSG_BATTLEGROUND_PLAYER_JOINED = 0x00, // + SMSG_BATTLEGROUND_PLAYER_POSITIONS = 0x00, // + SMSG_BINDPOINTUPDATE = 0x00, // + SMSG_BINDZONEREPLY = 0x00, // + SMSG_BINDER_CONFIRM = 0x00, // + SMSG_BREAK_TARGET = 0x00, // + SMSG_BUY_BANK_SLOT_RESULT = 0x00, // SMSG_BUY_ITEM = 0x00, // SMSG_BUY_FAILED = 0x00, // - SMSG_CALENDAR_COMMAND_RESULT = 0x00, // - SMSG_CALENDAR_SEND_NUM_PENDING = 0x00, // - SMSG_CALENDAR_SEND_CALENDAR = 0x00, // - SMSG_CANCEL_AUTO_REPEAT = 0x00, // - SMSG_CANCEL_COMBAT = 0x00, // - SMSG_CAST_FAILED = 0x00, // - SMSG_CHANNEL_LIST = 0x00, // - SMSG_CHANNEL_MEMBER_COUNT = 0x00, // - SMSG_CHANNEL_NOTIFY = 0x9C7F, // - SMSG_CHAR_CREATE = 19547, // - SMSG_CHAR_DELETE = 0x48CE, // - SMSG_CHAR_ENUM = 0xA05C, // - SMSG_CHARACTER_LOGIN_FAILED = 0x00, // - SMSG_CHAR_RENAME = 0x00, // - SMSG_CHAR_CUSTOMIZE = 0x00, // - SMSG_CHAR_FACTION_CHANGE = 0x00, // - SMSG_CHAT_PLAYER_AMBIGUOUS = 0x00, // - SMSG_CHAT_PLAYER_NOT_FOUND = 0x00, // - SMSG_CHAT_RESTRICTED = 0x00, // - SMSG_CHAT_WRONG_FACTION = 0xE66, // + SMSG_CALENDAR_COMMAND_RESULT = 0x00, // + SMSG_CALENDAR_SEND_NUM_PENDING = 0x00, // + SMSG_CALENDAR_SEND_CALENDAR = 0x00, // + SMSG_CANCEL_AUTO_REPEAT = 0x00, // + SMSG_CANCEL_COMBAT = 0x00, // + SMSG_CAST_FAILED = 0x00, // + SMSG_CHANNEL_LIST = 0x00, // + SMSG_CHANNEL_MEMBER_COUNT = 0x00, // + SMSG_CHANNEL_NOTIFY = 0x9C7F, // + SMSG_CHAR_CREATE = 19547, // + SMSG_CHAR_DELETE = 0x48CE, // + SMSG_CHAR_ENUM = 0xA05C, // + SMSG_CHARACTER_LOGIN_FAILED = 0x00, // + SMSG_CHAR_RENAME = 0x00, // + SMSG_CHAR_CUSTOMIZE = 0x00, // + SMSG_CHAR_FACTION_CHANGE = 0x00, // + SMSG_CHAT_PLAYER_AMBIGUOUS = 0x00, // + SMSG_CHAT_PLAYER_NOT_FOUND = 0x00, // + SMSG_CHAT_RESTRICTED = 0x00, // + SMSG_CHAT_WRONG_FACTION = 0xE66, // SMSG_CHECK_FOR_BOTS = 0x00, // - SMSG_CLEAR_COOLDOWN = 0x00, // - SMSG_CLEAR_TARGET = 0x00, // - SMSG_CLIENTCACHE_VERSION = 0x88F2, // - SMSG_CLIENT_CONTROL_UPDATE = 0x00, // - SMSG_COMBAT_LOG_MULTIPLE = 0x00, // - SMSG_COMMENTATOR_MAP_INFO = 0x00, // - SMSG_COMMENTATOR_PLAYER_INFO = 0x00, // - SMSG_COMMENTATOR_STATE_CHANGED = 0x00, // - SMSG_COMPLAIN_RESULT = 0x00, // - SMSG_COMPRESSED_MOVES = 0x00, // - SMSG_COMPRESSED_UPDATE_OBJECT = 0x1CC3, // - SMSG_CONTACT_LIST = 0x00, // - SMSG_CONVERT_RUNE = 0x00, // - SMSG_COOLDOWN_CHEAT = 0x00, // - SMSG_COOLDOWN_EVENT = 0x00, // - SMSG_CORPSE_NOT_IN_INSTANCE = 0x00, // - SMSG_CORPSE_RECLAIM_DELAY = 0x00, // - SMSG_CORPSE_MAP_POSITION_QUERY_RESPONSE = 0x00, // - SMSG_CREATURE_QUERY_RESPONSE = 0xD847, // - SMSG_CRITERIA_DELETED = 0x00, // - SMSG_CRITERIA_UPDATE = 0x00, // - SMSG_CROSSED_INEBRIATION_THRESHOLD = 0x00, // - SMSG_DAMAGE_CALC_LOG = 0x00, // + SMSG_CLEAR_COOLDOWN = 0x00, // + SMSG_CLEAR_TARGET = 0x00, // + SMSG_CLIENTCACHE_VERSION = 0x88F2, // + SMSG_CLIENT_CONTROL_UPDATE = 0x00, // + SMSG_COMBAT_LOG_MULTIPLE = 0x00, // + SMSG_COMMENTATOR_MAP_INFO = 0x00, // + SMSG_COMMENTATOR_PLAYER_INFO = 0x00, // + SMSG_COMMENTATOR_STATE_CHANGED = 0x00, // + SMSG_COMPLAIN_RESULT = 0x00, // + SMSG_COMPRESSED_MOVES = 0x00, // + SMSG_COMPRESSED_UPDATE_OBJECT = 0x1CC3, // + SMSG_CONTACT_LIST = 0x00, // + SMSG_CONVERT_RUNE = 0x00, // + SMSG_COOLDOWN_CHEAT = 0x00, // + SMSG_COOLDOWN_EVENT = 0x00, // + SMSG_CORPSE_NOT_IN_INSTANCE = 0x00, // + SMSG_CORPSE_RECLAIM_DELAY = 0x00, // + SMSG_CORPSE_MAP_POSITION_QUERY_RESPONSE = 0x00, // + SMSG_CREATURE_QUERY_RESPONSE = 0xD847, // + SMSG_CRITERIA_DELETED = 0x00, // + SMSG_CRITERIA_UPDATE = 0x00, // + SMSG_CROSSED_INEBRIATION_THRESHOLD = 0x00, // + SMSG_DAMAGE_CALC_LOG = 0x00, // SMSG_DAMAGE_DONE_OBSOLETE = 0x00, // - SMSG_DANCE_QUERY_RESPONSE = 0x00, // - SMSG_DB_REPLY = 0x76EC, // - SMSG_DEATH_RELEASE_LOC = 0x00, // - SMSG_DEFENSE_MESSAGE = 0x00, // - SMSG_DESTROY_OBJECT = 0x486B, // - SMSG_DESTRUCTIBLE_BUILDING_DAMAGE = 0x00, // - SMSG_DUEL_OUTOFBOUNDS = 0x00, // - SMSG_DUEL_INBOUNDS = 0x00, // - SMSG_DISMOUNT = 0x00, // - SMSG_DISMOUNTRESULT = 0x00, // - SMSG_DISPEL_FAILED = 0x00, // - SMSG_DUEL_COMPLETE = 0x00, // - SMSG_DUEL_COUNTDOWN = 0x00, // - SMSG_DUEL_REQUESTED = 0x00, // - SMSG_DUEL_WINNER = 0x00, // - SMSG_DURABILITY_DAMAGE_DEATH = 0x00, // - SMSG_ECHO_PARTY_SQUELCH = 0x00, // - SMSG_EMOTE = 0xC67, // - SMSG_ENABLE_BARBER_SHOP = 0x00, // - SMSG_ENCHANTMENTLOG = 0x00, // - SMSG_ENVIRONMENTALDAMAGELOG = 0x00, // - SMSG_EQUIPMENT_SET_LIST = 0x18DF, // - SMSG_EQUIPMENT_SET_SAVED = 0x00, // - SMSG_EQUIPMENT_SET_USE_RESULT = 0x00, // - SMSG_EXPECTED_SPAM_RECORDS = 0x00, // - SMSG_EXPLORATION_EXPERIENCE = 0x00, // - SMSG_FEATURE_SYSTEM_STATUS = 0x00, // - SMSG_FISH_ESCAPED = 0x9C66, // - SMSG_FISH_NOT_HOOKED = 0x18C3, // - SMSG_FORCEACTIONSHOW = 0x00, // - SMSG_FORCED_DEATH_UPDATE = 0x00, // - SMSG_FORCE_DISPLAY_UPDATE = 0x00, // + SMSG_DANCE_QUERY_RESPONSE = 0x00, // + SMSG_DB_REPLY = 0x76EC, // + SMSG_DEATH_RELEASE_LOC = 0x00, // + SMSG_DEFENSE_MESSAGE = 0x00, // + SMSG_DESTROY_OBJECT = 0x486B, // + SMSG_DESTRUCTIBLE_BUILDING_DAMAGE = 0x00, // + SMSG_DUEL_OUTOFBOUNDS = 0x00, // + SMSG_DUEL_INBOUNDS = 0x00, // + SMSG_DISMOUNT = 0x00, // + SMSG_DISMOUNTRESULT = 0x00, // + SMSG_DISPEL_FAILED = 0x00, // + SMSG_DUEL_COMPLETE = 0x00, // + SMSG_DUEL_COUNTDOWN = 0x00, // + SMSG_DUEL_REQUESTED = 0x00, // + SMSG_DUEL_WINNER = 0x00, // + SMSG_DURABILITY_DAMAGE_DEATH = 0x00, // + SMSG_ECHO_PARTY_SQUELCH = 0x00, // + SMSG_EMOTE = 0xC67, // + SMSG_ENABLE_BARBER_SHOP = 0x00, // + SMSG_ENCHANTMENTLOG = 0x00, // + SMSG_ENVIRONMENTALDAMAGELOG = 0x00, // + SMSG_EQUIPMENT_SET_LIST = 0x18DF, // + SMSG_EQUIPMENT_SET_SAVED = 0x00, // + SMSG_EQUIPMENT_SET_USE_RESULT = 0x00, // + SMSG_EXPECTED_SPAM_RECORDS = 0x00, // + SMSG_EXPLORATION_EXPERIENCE = 0x00, // + SMSG_FEATURE_SYSTEM_STATUS = 0x00, // + SMSG_FISH_ESCAPED = 0x9C66, // + SMSG_FISH_NOT_HOOKED = 0x18C3, // + SMSG_FORCEACTIONSHOW = 0x00, // + SMSG_FORCED_DEATH_UPDATE = 0x00, // + SMSG_FORCE_DISPLAY_UPDATE = 0x00, // SMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE = 0x00, // SMSG_FORCE_FLIGHT_SPEED_CHANGE = 0x00, // - SMSG_FORCE_MOVE_ROOT = 0x00, // - SMSG_FORCE_MOVE_UNROOT = 0x00, // + SMSG_FORCE_MOVE_ROOT = 0x00, // + SMSG_FORCE_MOVE_UNROOT = 0x00, // SMSG_FORCE_PITCH_RATE_CHANGE = 0x00, // - SMSG_FORCE_RUN_BACK_SPEED_CHANGE = 0x00, // - SMSG_FORCE_RUN_SPEED_CHANGE = 0x00, // - SMSG_FORCE_SEND_QUEUED_PACKETS = 0x00, // + SMSG_FORCE_RUN_BACK_SPEED_CHANGE = 0x00, // + SMSG_FORCE_RUN_SPEED_CHANGE = 0x00, // + SMSG_FORCE_SEND_QUEUED_PACKETS = 0x00, // SMSG_FORCE_TURN_RATE_CHANGE = 0x00, // SMSG_FORCE_SWIM_SPEED_CHANGE = 0x00, // SMSG_FORCE_SWIM_BACK_SPEED_CHANGE = 0x00, // SMSG_FORCE_WALK_SPEED_CHANGE = 0x00, // - SMSG_FRIEND_STATUS = 0x00, // + SMSG_FRIEND_STATUS = 0x00, // SMSG_GAMEOBJECT_CUSTOM_ANIM = 0x00, // - SMSG_GAMEOBJECT_DESPAWN_ANIM = 0x00, // - SMSG_GAMEOBJECT_PAGETEXT = 0x00, // - SMSG_GAMEOBJECT_QUERY_RESPONSE = 0xCCF7, // - SMSG_GAMEOBJECT_RESET_STATE = 0x00, // - SMSG_GAMESPEED_SET = 0x00, // - SMSG_GAMETIME_SET = 0x00, // - SMSG_GAMETIME_UPDATE = 0x00, // - SMSG_GMRESPONSE_STATUS_UPDATE = 0x00, // - SMSG_GMRESPONSE_RECEIVED = 0x00, // - SMSG_GMTICKET_DELETETICKET = 0x00, // - SMSG_GMTICKET_GETTICKET = 0x00, // - SMSG_GM_MESSAGECHAT = 0x00, // - SMSG_GMTICKET_CREATE = 0x00, // - SMSG_GMTICKET_SYSTEMSTATUS = 0x9C7E, // - SMSG_GMTICKET_UPDATETEXT = 0x00, // - SMSG_GODMODE = 0xDEEE, // - SMSG_GOSSIP_COMPLETE = 0x00, // - SMSG_GOSSIP_MESSAGE = 0xCCEB, // - SMSG_GOSSIP_POI = 0x00, // - SMSG_GROUP_CANCEL = 0x00, // - SMSG_GROUP_DECLINE = 0x00, // - SMSG_GROUP_DESTROYED = 0x00, // - SMSG_GROUP_INVITE = 0x00, // - SMSG_GROUP_JOINED_BATTLEGROUND = 0x00, // - SMSG_GROUP_LIST = 0x00, // - SMSG_GROUP_SET_LEADER = 0x00, // - SMSG_GROUP_UNINVITE = 0x00, // - SMSG_GUILD_BANK_LIST = 0x5EFB, // - SMSG_GUILD_COMMAND_RESULT = 0xDAD7, // - SMSG_GUILD_DECLINE = 0x00, // - SMSG_GUILD_EVENT = 0x8AC2, // - SMSG_GUILD_INFO = 0x00, // - SMSG_GUILD_INVITE = 0x00, // + SMSG_GAMEOBJECT_DESPAWN_ANIM = 0x00, // + SMSG_GAMEOBJECT_PAGETEXT = 0x00, // + SMSG_GAMEOBJECT_QUERY_RESPONSE = 0xCCF7, // + SMSG_GAMEOBJECT_RESET_STATE = 0x00, // + SMSG_GAMESPEED_SET = 0x00, // + SMSG_GAMETIME_SET = 0x00, // + SMSG_GAMETIME_UPDATE = 0x00, // + SMSG_GMRESPONSE_STATUS_UPDATE = 0x00, // + SMSG_GMRESPONSE_RECEIVED = 0x00, // + SMSG_GMTICKET_DELETETICKET = 0x00, // + SMSG_GMTICKET_GETTICKET = 0x00, // + SMSG_GM_MESSAGECHAT = 0x00, // + SMSG_GMTICKET_CREATE = 0x00, // + SMSG_GMTICKET_SYSTEMSTATUS = 0x9C7E, // + SMSG_GMTICKET_UPDATETEXT = 0x00, // + SMSG_GODMODE = 0xDEEE, // + SMSG_GOSSIP_COMPLETE = 0x00, // + SMSG_GOSSIP_MESSAGE = 0xCCEB, // + SMSG_GOSSIP_POI = 0x00, // + SMSG_GROUP_CANCEL = 0x00, // + SMSG_GROUP_DECLINE = 0x00, // + SMSG_GROUP_DESTROYED = 0x00, // + SMSG_GROUP_INVITE = 0x00, // + SMSG_GROUP_JOINED_BATTLEGROUND = 0x00, // + SMSG_GROUP_LIST = 0x00, // + SMSG_GROUP_SET_LEADER = 0x00, // + SMSG_GROUP_UNINVITE = 0x00, // + SMSG_GUILD_BANK_LIST = 0x5EFB, // + SMSG_GUILD_COMMAND_RESULT = 0xDAD7, // + SMSG_GUILD_DECLINE = 0x00, // + SMSG_GUILD_EVENT = 0x8AC2, // + SMSG_GUILD_INFO = 0x00, // + SMSG_GUILD_INVITE = 0x00, // SMSG_GUILD_MAX_DAILY_XP = 0x00, // - SMSG_GUILD_NEWS_UPDATE = 0x00, // - SMSG_GUILD_QUERY_RESPONSE = 0xCA66, // - SMSG_GUILD_RANK = 0xA6EC, // + SMSG_GUILD_NEWS_UPDATE = 0x00, // + SMSG_GUILD_QUERY_RESPONSE = 0xCA66, // + SMSG_GUILD_RANK = 0xA6EC, // SMSG_GUILD_RANKS_UPDATE = 0x00, // - SMSG_GUILD_REWARDS_LIST = 0x00, // - SMSG_GUILD_ROSTER = 0x00, // - SMSG_GUILD_TRADESKILL_UPDATE = 0x00, // + SMSG_GUILD_REWARDS_LIST = 0x00, // + SMSG_GUILD_ROSTER = 0x00, // + SMSG_GUILD_TRADESKILL_UPDATE = 0x00, // SMSG_GUILD_UPDATE_ROSTER = 0x00, // SMSG_GUILD_XP_UPDATE = 0x00, // - SMSG_HIGHEST_THREAT_UPDATE = 0x00, // - SMSG_INITIALIZE_FACTIONS = 0x00, // - SMSG_INITIAL_SPELLS = 0x00, // - SMSG_INIT_CURRENCY = 0x227E, // - SMSG_INIT_WORLD_STATES = 0x9EDA, // - SMSG_INSPECT = 0x00, // - SMSG_INSPECT_HONOR_STATS = 0x00, // - SMSG_INSPECT_TALENT = 0x00, // - SMSG_INSTANCE_DIFFICULTY = 0x00, // - SMSG_INSTANCE_LOCK_WARNING_QUERY = 0x00, // - SMSG_INSTANCE_RESET = 0x00, // - SMSG_INSTANCE_RESET_FAILED = 0x00, // - SMSG_INSTANCE_SAVE_CREATED = 0x00, // - SMSG_INVALID_PROMOTION_CODE = 0x00, // - SMSG_INVALIDATE_DANCE = 0x00, // - SMSG_INVALIDATE_PLAYER = 0x00, // - SMSG_INVENTORY_CHANGE_FAILURE = 0x00, // - SMSG_ITEM_COOLDOWN = 0x00, // - SMSG_ITEM_ENCHANT_TIME_UPDATE = 0x00, // - SMSG_ITEM_NAME_QUERY_RESPONSE = 0x00, // - SMSG_ITEM_PUSH_RESULT = 0x8EFB, // + SMSG_HIGHEST_THREAT_UPDATE = 0x00, // + SMSG_INITIALIZE_FACTIONS = 0x00, // + SMSG_INITIAL_SPELLS = 0x00, // + SMSG_INIT_CURRENCY = 0x227E, // + SMSG_INIT_WORLD_STATES = 0x9EDA, // + SMSG_INSPECT = 0x00, // + SMSG_INSPECT_HONOR_STATS = 0x00, // + SMSG_INSPECT_TALENT = 0x00, // + SMSG_INSTANCE_DIFFICULTY = 0x00, // + SMSG_INSTANCE_LOCK_WARNING_QUERY = 0x00, // + SMSG_INSTANCE_RESET = 0x00, // + SMSG_INSTANCE_RESET_FAILED = 0x00, // + SMSG_INSTANCE_SAVE_CREATED = 0x00, // + SMSG_INVALID_PROMOTION_CODE = 0x00, // + SMSG_INVALIDATE_DANCE = 0x00, // + SMSG_INVALIDATE_PLAYER = 0x00, // + SMSG_INVENTORY_CHANGE_FAILURE = 0x00, // + SMSG_ITEM_COOLDOWN = 0x00, // + SMSG_ITEM_ENCHANT_TIME_UPDATE = 0x00, // + SMSG_ITEM_NAME_QUERY_RESPONSE = 0x00, // + SMSG_ITEM_PUSH_RESULT = 0x8EFB, // SMSG_ITEM_QUERY_MULTIPLE_RESPONSE = 0x00, // - SMSG_ITEM_QUERY_SINGLE_RESPONSE = 0x00, // - SMSG_ITEM_REFUND_INFO_RESPONSE = 0x00, // - SMSG_ITEM_REFUND_RESULT = 0x00, // - SMSG_ITEM_TEXT_QUERY_RESPONSE = 0x00, // - SMSG_ITEM_TIME_UPDATE = 0x00, // - SMSG_JOINED_BATTLEGROUND_QUEUE = 0x00, // - SMSG_LEARNED_DANCE_MOVES = 0x00, // - SMSG_LEARNED_SPELL = 0x00, // - SMSG_LEVELUP_INFO = 0x00, // - SMSG_LFG_DISABLED = 0x00, // - SMSG_LFG_JOIN_RESULT = 0x00, // - SMSG_LFG_OFFER_CONTINUE = 0x00, // - SMSG_LFG_OPEN_FROM_GOSSIP = 0x00, // - SMSG_LFG_PARTY_INFO = 0x00, // - SMSG_LFG_PLAYER_INFO = 0x00, // - SMSG_LFG_PLAYER_REWARD = 0x00, // - SMSG_LFG_PROPOSAL_UPDATE = 0x00, // - SMSG_LFG_QUEUE_STATUS = 0x00, // - SMSG_LFG_ROLE_CHECK_UPDATE = 0x00, // - SMSG_LFG_ROLE_CHOSEN = 0x00, // - SMSG_LFG_TELEPORT_DENIED = 0x00, // - SMSG_LFG_UPDATE_SEARCH = 0x00, // - SMSG_LFG_UPDATE_PARTY = 0x00, // - SMSG_LFG_UPDATE_PLAYER = 0x00, // - SMSG_LIST_INVENTORY = 0x264C, // - SMSG_LOGIN_SETTIMESPEED = 0x00, // - SMSG_LOGIN_VERIFY_WORLD = 0xC86E, // - SMSG_LOGOUT_CANCEL_ACK = 0x00, // - SMSG_LOGOUT_COMPLETE = 0xCC6B, // - SMSG_LOGOUT_RESPONSE = 0x886A, // - SMSG_LOG_XPGAIN = 0x00, // - SMSG_LOOT_ALL_PASSED = 0x00, // - SMSG_LOOT_CLEAR_MONEY = 0x00, // - SMSG_LOOT_ITEM_NOTIFY = 0x00, // - SMSG_LOOT_LIST = 0x00, // - SMSG_LOOT_MASTER_LIST = 0x00, // - SMSG_LOOT_MONEY_NOTIFY = 0x00, // - SMSG_LOOT_RELEASE_RESPONSE = 0x00, // - SMSG_LOOT_REMOVED = 0x00, // - SMSG_LOOT_RESPONSE = 0x0842, // - SMSG_LOOT_ROLL = 0x00, // - SMSG_LOOT_ROLL_WON = 0x00, // - SMSG_LOOT_SLOT_CHANGED = 0x00, // - SMSG_LOOT_START_ROLL = 0x00, // - SMSG_MAIL_LIST_RESULT = 0x00, // - SMSG_MEETINGSTONE_COMPLETE = 0x00, // - SMSG_MEETINGSTONE_IN_PROGRESS = 0x00, // - SMSG_MEETINGSTONE_MEMBER_ADDED = 0x00, // - SMSG_MEETINGSTONE_SETQUEUE = 0x00, // - SMSG_MESSAGECHAT = 0x5E52, // - SMSG_MIRRORIMAGE_DATA = 0x00, // - SMSG_MODIFY_COOLDOWN = 0x00, // - SMSG_MONSTER_MOVE = 0x4C53, // - SMSG_MONSTER_MOVE_TRANSPORT = 0x88FB, // - SMSG_MOTD = 0xCA4B, // - SMSG_MOUNTSPECIAL_ANIM = 0x00, // - SMSG_MOUNTRESULT = 0x00, // - SMSG_MOVE_FEATHER_FALL = 0x00, // - SMSG_MOVE_NORMAL_FALL = 0x00, // - SMSG_MOVE_SET_CAN_FLY = 0x00, // - SMSG_MOVE_SET_HOVER = 0x00, // - SMSG_MOVE_UNSET_CAN_FLY = 0x00, // - SMSG_MOVE_UNSET_HOVER = 0x00, // - SMSG_MOVE_WATER_WALK = 0x00, // - SMSG_MOVE_LAND_WALK = 0x00, // + SMSG_ITEM_QUERY_SINGLE_RESPONSE = 0x00, // + SMSG_ITEM_REFUND_INFO_RESPONSE = 0x00, // + SMSG_ITEM_REFUND_RESULT = 0x00, // + SMSG_ITEM_TEXT_QUERY_RESPONSE = 0x00, // + SMSG_ITEM_TIME_UPDATE = 0x00, // + SMSG_JOINED_BATTLEGROUND_QUEUE = 0x00, // + SMSG_LEARNED_DANCE_MOVES = 0x00, // + SMSG_LEARNED_SPELL = 0x00, // + SMSG_LEVELUP_INFO = 0x00, // + SMSG_LFG_DISABLED = 0x00, // + SMSG_LFG_JOIN_RESULT = 0x00, // + SMSG_LFG_OFFER_CONTINUE = 0x00, // + SMSG_LFG_OPEN_FROM_GOSSIP = 0x00, // + SMSG_LFG_PARTY_INFO = 0x00, // + SMSG_LFG_PLAYER_INFO = 0x00, // + SMSG_LFG_PLAYER_REWARD = 0x00, // + SMSG_LFG_PROPOSAL_UPDATE = 0x00, // + SMSG_LFG_QUEUE_STATUS = 0x00, // + SMSG_LFG_ROLE_CHECK_UPDATE = 0x00, // + SMSG_LFG_ROLE_CHOSEN = 0x00, // + SMSG_LFG_TELEPORT_DENIED = 0x00, // + SMSG_LFG_UPDATE_SEARCH = 0x00, // + SMSG_LFG_UPDATE_PARTY = 0x00, // + SMSG_LFG_UPDATE_PLAYER = 0x00, // + SMSG_LIST_INVENTORY = 0x264C, // + SMSG_LOGIN_SETTIMESPEED = 0x00, // + SMSG_LOGIN_VERIFY_WORLD = 0xC86E, // + SMSG_LOGOUT_CANCEL_ACK = 0x00, // + SMSG_LOGOUT_COMPLETE = 0xCC6B, // + SMSG_LOGOUT_RESPONSE = 0x886A, // + SMSG_LOG_XPGAIN = 0x00, // + SMSG_LOOT_ALL_PASSED = 0x00, // + SMSG_LOOT_CLEAR_MONEY = 0x00, // + SMSG_LOOT_ITEM_NOTIFY = 0x00, // + SMSG_LOOT_LIST = 0x00, // + SMSG_LOOT_MASTER_LIST = 0x00, // + SMSG_LOOT_MONEY_NOTIFY = 0x00, // + SMSG_LOOT_RELEASE_RESPONSE = 0x00, // + SMSG_LOOT_REMOVED = 0x00, // + SMSG_LOOT_RESPONSE = 0x0842, // + SMSG_LOOT_ROLL = 0x00, // + SMSG_LOOT_ROLL_WON = 0x00, // + SMSG_LOOT_SLOT_CHANGED = 0x00, // + SMSG_LOOT_START_ROLL = 0x00, // + SMSG_MAIL_LIST_RESULT = 0x00, // + SMSG_MEETINGSTONE_COMPLETE = 0x00, // + SMSG_MEETINGSTONE_IN_PROGRESS = 0x00, // + SMSG_MEETINGSTONE_MEMBER_ADDED = 0x00, // + SMSG_MEETINGSTONE_SETQUEUE = 0x00, // + SMSG_MESSAGECHAT = 0x5E52, // + SMSG_MIRRORIMAGE_DATA = 0x00, // + SMSG_MODIFY_COOLDOWN = 0x00, // + SMSG_MONSTER_MOVE = 0x4C53, // + SMSG_MONSTER_MOVE_TRANSPORT = 0x88FB, // + SMSG_MOTD = 0xCA4B, // + SMSG_MOUNTSPECIAL_ANIM = 0x00, // + SMSG_MOUNTRESULT = 0x00, // + SMSG_MOVE_FEATHER_FALL = 0x00, // + SMSG_MOVE_NORMAL_FALL = 0x00, // + SMSG_MOVE_SET_CAN_FLY = 0x00, // + SMSG_MOVE_SET_HOVER = 0x00, // + SMSG_MOVE_UNSET_CAN_FLY = 0x00, // + SMSG_MOVE_UNSET_HOVER = 0x00, // + SMSG_MOVE_WATER_WALK = 0x00, // + SMSG_MOVE_LAND_WALK = 0x00, // CMSG_MOVE_HOVER_ACK = 0x00, // SMSG_MOVE_KNOCK_BACK = 0x00, // SMSG_MOVE_SET_WALK_IN_AIR = 0x00, // SMSG_MOVE_UNSET_WALK_IN_AIR = 0x00, // - SMSG_MULTIPLE_PACKETS = 0x00, // - SMSG_NAME_QUERY_RESPONSE = 0x9CE6, // + SMSG_MULTIPLE_PACKETS = 0x00, // + SMSG_NAME_QUERY_RESPONSE = 0x9CE6, // SMSG_NEW_TAXI_PATH = 0xC8FF, // Might be 0x98CF - SMSG_NEW_WORLD = 0x00, // - SMSG_NOTIFICATION = 0x00, // - SMSG_NOTIFY_DANCE = 0x00, // - SMSG_NOTIFY_DEST_LOC_SPELL_CAST = 0x00, // - SMSG_NPC_TEXT_UPDATE = 0x4C72, // + SMSG_NEW_WORLD = 0x00, // + SMSG_NOTIFICATION = 0x00, // + SMSG_NOTIFY_DANCE = 0x00, // + SMSG_NOTIFY_DEST_LOC_SPELL_CAST = 0x00, // + SMSG_NPC_TEXT_UPDATE = 0x4C72, // SMSG_NPC_WONT_TALK = 0x00, // - SMSG_OFFER_PETITION_ERROR = 0x00, // - SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA = 0x00, // + SMSG_OFFER_PETITION_ERROR = 0x00, // + SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA = 0x00, // SMSG_OPEN_CONTAINER = 0x00, // - SMSG_PAGE_TEXT_QUERY_RESPONSE = 0x18D2, // - SMSG_PARTYKILLLOG = 0x00, // - SMSG_PARTY_MEMBER_STATS = 0x00, // - SMSG_PARTY_MEMBER_STATS_FULL = 0x00, // - SMSG_PARTY_COMMAND_RESULT = 0x00, // - SMSG_PAUSE_MIRROR_TIMER = 0x00, // - SMSG_PERIODICAURALOG = 0x00, // - SMSG_PETGODMODE = 0x00, // - SMSG_PETITION_QUERY_RESPONSE = 0xCAEE, // - SMSG_PET_ACTION_FEEDBACK = 0x00, // - SMSG_PET_ACTION_SOUND = 0x00, // - SMSG_PET_CAST_FAILED = 0x00, // - SMSG_PET_DISMISS_SOUND = 0x00, // - SMSG_PET_GUIDS = 0x00, // - SMSG_PET_LEARNED_SPELL = 0xDC5E, // - SMSG_PET_MODE = 0x00, // - SMSG_PET_NAME_QUERY_RESPONSE = 0xDCD3, // - SMSG_PET_NAME_INVALID = 0x00, // - SMSG_PET_REMOVED_SPELL = 0x18F6, // - SMSG_PET_SPELLS = 0x00, // - SMSG_PET_TAME_FAILURE = 0x00, // - SMSG_PET_UPDATE_COMBO_POINTS = 0x00, // - SMSG_PETITION_SHOWLIST = 0x8ED7, // - SMSG_PETITION_SHOW_SIGNATURES = 0x4E4A, // - SMSG_PETITION_SIGN_RESULTS = 0x5EE6, // - SMSG_PLAYER_MOVE = 0x00, // - SMSG_PLAYED_TIME = 0x00, // - SMSG_PLAYERBINDERROR = 0x5A4F, // - SMSG_PLAYERBOUND = 0x00, // - SMSG_PLAYER_DIFFICULTY_CHANGE = 0x00, // + SMSG_PAGE_TEXT_QUERY_RESPONSE = 0x18D2, // + SMSG_PARTYKILLLOG = 0x00, // + SMSG_PARTY_MEMBER_STATS = 0x00, // + SMSG_PARTY_MEMBER_STATS_FULL = 0x00, // + SMSG_PARTY_COMMAND_RESULT = 0x00, // + SMSG_PAUSE_MIRROR_TIMER = 0x00, // + SMSG_PERIODICAURALOG = 0x00, // + SMSG_PETGODMODE = 0x00, // + SMSG_PETITION_QUERY_RESPONSE = 0xCAEE, // + SMSG_PET_ACTION_FEEDBACK = 0x00, // + SMSG_PET_ACTION_SOUND = 0x00, // + SMSG_PET_CAST_FAILED = 0x00, // + SMSG_PET_DISMISS_SOUND = 0x00, // + SMSG_PET_GUIDS = 0x00, // + SMSG_PET_LEARNED_SPELL = 0xDC5E, // + SMSG_PET_MODE = 0x00, // + SMSG_PET_NAME_QUERY_RESPONSE = 0xDCD3, // + SMSG_PET_NAME_INVALID = 0x00, // + SMSG_PET_REMOVED_SPELL = 0x18F6, // + SMSG_PET_SPELLS = 0x00, // + SMSG_PET_TAME_FAILURE = 0x00, // + SMSG_PET_UPDATE_COMBO_POINTS = 0x00, // + SMSG_PETITION_SHOWLIST = 0x8ED7, // + SMSG_PETITION_SHOW_SIGNATURES = 0x4E4A, // + SMSG_PETITION_SIGN_RESULTS = 0x5EE6, // + SMSG_PLAYER_MOVE = 0x00, // + SMSG_PLAYED_TIME = 0x00, // + SMSG_PLAYERBINDERROR = 0x5A4F, // + SMSG_PLAYERBOUND = 0x00, // + SMSG_PLAYER_DIFFICULTY_CHANGE = 0x00, // SMSG_BATTLEGROUND_PLAYER_LEFT = 0x00, // - SMSG_PLAYER_SKINNED = 0x00, // - SMSG_PLAYER_VEHICLE_DATA = 0x00, // - SMSG_PLAY_DANCE = 0x00, // - SMSG_PLAY_MUSIC = 0x00, // - SMSG_PLAY_OBJECT_SOUND = 0x00, // - SMSG_PLAY_SOUND = 0x00, // - SMSG_PLAY_SPELL_VISUAL = 0x00, // - SMSG_PLAY_SPELL_IMPACT = 0x00, // - SMSG_PLAY_TIME_WARNING = 0x00, // - SMSG_PONG = 0x0380, // - SMSG_POWER_UPDATE = 0x00, // - SMSG_PRE_RESURRECT = 0x00, // - SMSG_PROCRESIST = 0x00, // - SMSG_PROPOSE_LEVEL_GRANT = 0x00, // + SMSG_PLAYER_SKINNED = 0x00, // + SMSG_PLAYER_VEHICLE_DATA = 0x00, // + SMSG_PLAY_DANCE = 0x00, // + SMSG_PLAY_MUSIC = 0x00, // + SMSG_PLAY_OBJECT_SOUND = 0x00, // + SMSG_PLAY_SOUND = 0x00, // + SMSG_PLAY_SPELL_VISUAL = 0x00, // + SMSG_PLAY_SPELL_IMPACT = 0x00, // + SMSG_PLAY_TIME_WARNING = 0x00, // + SMSG_PONG = 0x0380, // + SMSG_POWER_UPDATE = 0x00, // + SMSG_PRE_RESURRECT = 0x00, // + SMSG_PROCRESIST = 0x00, // + SMSG_PROPOSE_LEVEL_GRANT = 0x00, // SMSG_PUREMOUNT_CANCELLED_OBSOLETE = 0x00, // - SMSG_PVP_CREDIT = 0x00, // - SMSG_QUERY_QUESTS_COMPLETED_RESPONSE = 0x00, // - SMSG_QUERY_TIME_RESPONSE = 0x00, // - SMSG_QUESTGIVER_OFFER_REWARD = 0x00, // - SMSG_QUESTGIVER_QUEST_COMPLETE = 0x00, // - SMSG_QUESTGIVER_QUEST_DETAILS = 0xCE5F, // - SMSG_QUESTGIVER_QUEST_FAILED = 0xD8FF, // - SMSG_QUESTGIVER_QUEST_LIST = 0xDEF6, // - SMSG_QUESTGIVER_REQUEST_ITEMS = 0x9CEE, // - SMSG_QUESTGIVER_STATUS = 0xC846, // - SMSG_QUESTGIVER_STATUS_MULTIPLE = 0xDCFF, // - SMSG_QUESTLOG_FULL = 0x4EDE, // - SMSG_QUESTUPDATE_ADD_KILL = 0x00, // - SMSG_QUESTUPDATE_ADD_PVP_KILL = 0x00, // - SMSG_QUESTUPDATE_COMPLETE = 0x9CD6, // - SMSG_QUESTUPDATE_FAILED = 0x9EF6, // - SMSG_QUESTUPDATE_FAILEDTIMER = 0x00, // - SMSG_QUEST_CONFIRM_ACCEPT = 0x00, // - SMSG_QUEST_FORCE_REMOVED = 0x00, // - SMSG_QUEST_POI_QUERY_RESPONSE = 0x00, // - SMSG_QUEST_QUERY_RESPONSE = 0x9E56, // + SMSG_PVP_CREDIT = 0x00, // + SMSG_QUERY_QUESTS_COMPLETED_RESPONSE = 0x00, // + SMSG_QUERY_TIME_RESPONSE = 0x00, // + SMSG_QUESTGIVER_OFFER_REWARD = 0x00, // + SMSG_QUESTGIVER_QUEST_COMPLETE = 0x00, // + SMSG_QUESTGIVER_QUEST_DETAILS = 0xCE5F, // + SMSG_QUESTGIVER_QUEST_FAILED = 0xD8FF, // + SMSG_QUESTGIVER_QUEST_LIST = 0xDEF6, // + SMSG_QUESTGIVER_REQUEST_ITEMS = 0x9CEE, // + SMSG_QUESTGIVER_STATUS = 0xC846, // + SMSG_QUESTGIVER_STATUS_MULTIPLE = 0xDCFF, // + SMSG_QUESTLOG_FULL = 0x4EDE, // + SMSG_QUESTUPDATE_ADD_KILL = 0x00, // + SMSG_QUESTUPDATE_ADD_PVP_KILL = 0x00, // + SMSG_QUESTUPDATE_COMPLETE = 0x9CD6, // + SMSG_QUESTUPDATE_FAILED = 0x9EF6, // + SMSG_QUESTUPDATE_FAILEDTIMER = 0x00, // + SMSG_QUEST_CONFIRM_ACCEPT = 0x00, // + SMSG_QUEST_FORCE_REMOVED = 0x00, // + SMSG_QUEST_POI_QUERY_RESPONSE = 0x00, // + SMSG_QUEST_QUERY_RESPONSE = 0x9E56, // SMSG_QUESTGIVER_QUEST_INVALID = 0x00, // - SMSG_QUESTUPDATE_ADD_ITEM_OBSOLETE = 0x00, // + SMSG_QUESTUPDATE_ADD_ITEM_OBSOLETE = 0x00, // SMSG_RAID_GROUP_ONLY = 0x00, // - SMSG_RAID_INSTANCE_INFO = 0x00, // - SMSG_RAID_INSTANCE_MESSAGE = 0x00, // - SMSG_READ_ITEM_FAILED = 0x00, // - SMSG_READ_ITEM_OK = 0x00, // - SMSG_REALM_SPLIT = 0x1AF2, // - SMSG_REAL_GROUP_UPDATE = 0x00, // - SMSG_RECEIVED_MAIL = 0x00, // - SMSG_REDIRECT_CLIENT = 0x0180, // - SMSG_REFER_A_FRIEND_FAILURE = 0x00, // - SMSG_REMOVED_SPELL = 0x00, // - SMSG_REPORT_PVP_AFK_RESULT = 0x00, // - SMSG_REQUEST_CEMETERY_LIST_RESPONSE = 0x00, // - SMSG_RESPOND_INSPECT_ACHIEVEMENTS = 0x00, // + SMSG_RAID_INSTANCE_INFO = 0x00, // + SMSG_RAID_INSTANCE_MESSAGE = 0x00, // + SMSG_READ_ITEM_FAILED = 0x00, // + SMSG_READ_ITEM_OK = 0x00, // + SMSG_REALM_SPLIT = 0x1AF2, // + SMSG_REAL_GROUP_UPDATE = 0x00, // + SMSG_RECEIVED_MAIL = 0x00, // + SMSG_REDIRECT_CLIENT = 0x0180, // + SMSG_REFER_A_FRIEND_FAILURE = 0x00, // + SMSG_REMOVED_SPELL = 0x00, // + SMSG_REPORT_PVP_AFK_RESULT = 0x00, // + SMSG_REQUEST_CEMETERY_LIST_RESPONSE = 0x00, // + SMSG_RESPOND_INSPECT_ACHIEVEMENTS = 0x00, // SMSG_RESET_FAILED_NOTIFY = 0x00, // SMSG_RESISTLOG = 0x00, // - SMSG_RESURRECT_REQUEST = 0x00, // + SMSG_RESURRECT_REQUEST = 0x00, // SMSG_RESYNC_RUNES = 0x00, // - SMSG_RWHOIS = 0x00, // + SMSG_RWHOIS = 0x00, // SMSG_SELL_ITEM = 0x00, // - SMSG_SEND_MAIL_RESULT = 0x00, // - SMSG_SEND_UNLEARN_SPELLS = 0x00, // - SMSG_SERVERTIME = 0x00, // - SMSG_SERVER_FIRST_ACHIEVEMENT = 0x00, // - SMSG_SERVER_MESSAGE = 0x00, // - SMSG_SET_FACTION_ATWAR = 0x00, // - SMSG_SET_FACTION_STANDING = 0x00, // - SMSG_SET_FACTION_VISIBLE = 0x00, // - SMSG_SET_FLAT_SPELL_MODIFIER = 0x00, // - SMSG_SET_FORCED_REACTIONS = 0x00, // - SMSG_SET_PCT_SPELL_MODIFIER = 0x00, // - SMSG_SET_PHASE_SHIFT = 0x204C, // - SMSG_SET_PLAYER_DECLINED_NAMES_RESULT = 0x00, // - SMSG_SET_PROFICIENCY = 0x00, // - SMSG_SET_PROJECTILE_POSITION = 0x00, // - SMSG_SHOWTAXINODES = 0x8CFB, // - SMSG_SHOW_BANK = 0x00, // - SMSG_SPELLBREAKLOG = 0x00, // - SMSG_SPELLDAMAGESHIELD = 0x00, // - SMSG_SPELLENERGIZELOG = 0x00, // - SMSG_SPELLHEALLOG = 0x00, // - SMSG_SPELLINSTAKILLLOG = 0x00, // - SMSG_SPELLLOGEXECUTE = 0x00, // - SMSG_SPELLLOGMISS = 0x00, // - SMSG_SPELLNONMELEEDAMAGELOG = 0x00, // - SMSG_SPELLORDAMAGE_IMMUNE = 0x00, // - SMSG_SPELL_COOLDOWN = 0x00, // - SMSG_SPELL_DELAYED = 0x00, // - SMSG_SPELLDISPELLOG = 0x00, // - SMSG_SPELL_FAILED_OTHER = 0x00, // - SMSG_SPELL_FAILURE = 0x00, // - SMSG_SPELL_GO = 0x0A53, // - SMSG_SPELL_START = 0xCE43, // - SMSG_SPELLSTEALLOG = 0x00, // - SMSG_SPELL_UPDATE_CHAIN_TARGETS = 0x00, // - SMSG_SPIRIT_HEALER_CONFIRM = 0x00, // + SMSG_SEND_MAIL_RESULT = 0x00, // + SMSG_SEND_UNLEARN_SPELLS = 0x00, // + SMSG_SERVERTIME = 0x00, // + SMSG_SERVER_FIRST_ACHIEVEMENT = 0x00, // + SMSG_SERVER_MESSAGE = 0x00, // + SMSG_SET_FACTION_ATWAR = 0x00, // + SMSG_SET_FACTION_STANDING = 0x00, // + SMSG_SET_FACTION_VISIBLE = 0x00, // + SMSG_SET_FLAT_SPELL_MODIFIER = 0x00, // + SMSG_SET_FORCED_REACTIONS = 0x00, // + SMSG_SET_PCT_SPELL_MODIFIER = 0x00, // + SMSG_SET_PHASE_SHIFT = 0x204C, // + SMSG_SET_PLAYER_DECLINED_NAMES_RESULT = 0x00, // + SMSG_SET_PROFICIENCY = 0x00, // + SMSG_SET_PROJECTILE_POSITION = 0x00, // + SMSG_SHOWTAXINODES = 0x8CFB, // + SMSG_SHOW_BANK = 0x00, // + SMSG_SPELLBREAKLOG = 0x00, // + SMSG_SPELLDAMAGESHIELD = 0x00, // + SMSG_SPELLENERGIZELOG = 0x00, // + SMSG_SPELLHEALLOG = 0x00, // + SMSG_SPELLINSTAKILLLOG = 0x00, // + SMSG_SPELLLOGEXECUTE = 0x00, // + SMSG_SPELLLOGMISS = 0x00, // + SMSG_SPELLNONMELEEDAMAGELOG = 0x00, // + SMSG_SPELLORDAMAGE_IMMUNE = 0x00, // + SMSG_SPELL_COOLDOWN = 0x00, // + SMSG_SPELL_DELAYED = 0x00, // + SMSG_SPELLDISPELLOG = 0x00, // + SMSG_SPELL_FAILED_OTHER = 0x00, // + SMSG_SPELL_FAILURE = 0x00, // + SMSG_SPELL_GO = 0x0A53, // + SMSG_SPELL_START = 0xCE43, // + SMSG_SPELLSTEALLOG = 0x00, // + SMSG_SPELL_UPDATE_CHAIN_TARGETS = 0x00, // + SMSG_SPIRIT_HEALER_CONFIRM = 0x00, // SMSG_SPLINE_MOVE_WATER_WALK = 0x00, // SMSG_SPLINE_MOVE_LAND_WALK = 0x00, // - SMSG_SPLINE_MOVE_ROOT = 0x00, // + SMSG_SPLINE_MOVE_ROOT = 0x00, // SMSG_SPLINE_MOVE_UNROOT = 0x00, // - SMSG_STABLE_RESULT = 0x00, // - SMSG_STANDSTATE_UPDATE = 0x00, // - SMSG_START_MIRROR_TIMER = 0x00, // - SMSG_STOP_DANCE = 0x00, // - SMSG_STOP_MIRROR_TIMER = 0x00, // - SMSG_SUMMON_REQUEST = 0x00, // - SMSG_SUPERCEDED_SPELL = 0x00, // - SMSG_TALENTS_INFO = 0x00, // - SMSG_TAXINODE_STATUS = 0x8CFB, // - SMSG_TOGGLE_XP_GAIN = 0x8A5B, // - SMSG_TEXT_EMOTE = 0x00, // - SMSG_THREAT_CLEAR = 0x00, // - SMSG_THREAT_REMOVE = 0x00, // - SMSG_THREAT_UPDATE = 0x00, // - SMSG_TIME_SYNC_REQ = 0x1009, // - SMSG_TITLE_EARNED = 0x00, // - SMSG_TOTEM_CREATED = 0x00, // - SMSG_TRADE_STATUS = 0x00, // - SMSG_TRADE_STATUS_EXTENDED = 0x00, // - SMSG_TRAINER_LIST = 0xC84E, // - SMSG_TRAINER_BUY_RESULT = 0x00, // - SMSG_TRANSFER_ABORTED = 0x00, // - SMSG_TRANSFER_PENDING = 0x00, // - SMSG_TRIGGER_CINEMATIC = 0x00, // - SMSG_TRIGGER_MOVIE = 0x00, // - SMSG_TURN_IN_PETITION_RESULTS = 0x08DB, // - SMSG_TUTORIAL_FLAGS = 0x1A46, // - SMSG_UNIT_SPELLCAST_START = 0x00, // - SMSG_UPDATE_ACCOUNT_DATA = 0x00, // - SMSG_UPDATE_ACCOUNT_DATA_COMPLETE = 0x5E53, // - SMSG_UPDATE_COMBO_POINTS = 0x00, // - SMSG_UPDATE_CURRENCY = 0x00, // - SMSG_UPDATE_CURRENCY_WEEK_LIMIT = 0x00, // - SMSG_UPDATE_INSTANCE_ENCOUNTER_UNIT = 0x00, // - SMSG_UPDATE_INSTANCE_OWNERSHIP = 0x00, // - SMSG_UPDATE_LAST_INSTANCE = 0x00, // - SMSG_UPDATE_LFG_LIST = 0x00, // - SMSG_UPDATE_OBJECT = 0x1EE7, // - SMSG_UPDATE_WORLD_STATE = 0x00, // - SMSG_USERLIST_ADD = 0x00, // - SMSG_USERLIST_REMOVE = 0x00, // - SMSG_USERLIST_UPDATE = 0x00, // - SMSG_VOICE_CHAT_STATUS = 0x00, // - SMSG_VOICE_PARENTAL_CONTROLS = 0x00, // - SMSG_VOICE_SESSION_LEAVE = 0x00, // - SMSG_VOICE_SESSION_ROSTER_UPDATE = 0x00, // - SMSG_VOICE_SET_TALKER_MUTED = 0x00, // - SMSG_WEATHER = 0x00, // - SMSG_WARDEN_DATA = 0x4ECE, // - SMSG_WHO = 0x4C7F, // - SMSG_WHOIS = 0x00, // - SMSG_WORLD_STATE_UI_TIMER_UPDATE = 0x00, // - SMSG_ZONE_UNDER_ATTACK = 0x00, // + SMSG_STABLE_RESULT = 0x00, // + SMSG_STANDSTATE_UPDATE = 0x00, // + SMSG_START_MIRROR_TIMER = 0x00, // + SMSG_STOP_DANCE = 0x00, // + SMSG_STOP_MIRROR_TIMER = 0x00, // + SMSG_SUMMON_REQUEST = 0x00, // + SMSG_SUPERCEDED_SPELL = 0x00, // + SMSG_TALENTS_INFO = 0x00, // + SMSG_TAXINODE_STATUS = 0x8CFB, // + SMSG_TOGGLE_XP_GAIN = 0x8A5B, // + SMSG_TEXT_EMOTE = 0x00, // + SMSG_THREAT_CLEAR = 0x00, // + SMSG_THREAT_REMOVE = 0x00, // + SMSG_THREAT_UPDATE = 0x00, // + SMSG_TIME_SYNC_REQ = 0x1009, // + SMSG_TITLE_EARNED = 0x00, // + SMSG_TOTEM_CREATED = 0x00, // + SMSG_TRADE_STATUS = 0x00, // + SMSG_TRADE_STATUS_EXTENDED = 0x00, // + SMSG_TRAINER_LIST = 0xC84E, // + SMSG_TRAINER_BUY_RESULT = 0x00, // + SMSG_TRANSFER_ABORTED = 0x00, // + SMSG_TRANSFER_PENDING = 0x00, // + SMSG_TRIGGER_CINEMATIC = 0x00, // + SMSG_TRIGGER_MOVIE = 0x00, // + SMSG_TURN_IN_PETITION_RESULTS = 0x08DB, // + SMSG_TUTORIAL_FLAGS = 0x1A46, // + SMSG_UNIT_SPELLCAST_START = 0x00, // + SMSG_UPDATE_ACCOUNT_DATA = 0x00, // + SMSG_UPDATE_ACCOUNT_DATA_COMPLETE = 0x5E53, // + SMSG_UPDATE_COMBO_POINTS = 0x00, // + SMSG_UPDATE_CURRENCY = 0x00, // + SMSG_UPDATE_CURRENCY_WEEK_LIMIT = 0x00, // + SMSG_UPDATE_INSTANCE_ENCOUNTER_UNIT = 0x00, // + SMSG_UPDATE_INSTANCE_OWNERSHIP = 0x00, // + SMSG_UPDATE_LAST_INSTANCE = 0x00, // + SMSG_UPDATE_LFG_LIST = 0x00, // + SMSG_UPDATE_OBJECT = 0x1EE7, // + SMSG_UPDATE_WORLD_STATE = 0x00, // + SMSG_USERLIST_ADD = 0x00, // + SMSG_USERLIST_REMOVE = 0x00, // + SMSG_USERLIST_UPDATE = 0x00, // + SMSG_VOICE_CHAT_STATUS = 0x00, // + SMSG_VOICE_PARENTAL_CONTROLS = 0x00, // + SMSG_VOICE_SESSION_LEAVE = 0x00, // + SMSG_VOICE_SESSION_ROSTER_UPDATE = 0x00, // + SMSG_VOICE_SET_TALKER_MUTED = 0x00, // + SMSG_WEATHER = 0x00, // + SMSG_WARDEN_DATA = 0x4ECE, // + SMSG_WHO = 0x4C7F, // + SMSG_WHOIS = 0x00, // + SMSG_WORLD_STATE_UI_TIMER_UPDATE = 0x00, // + SMSG_ZONE_UNDER_ATTACK = 0x00, // - SMSG_VERIFY_CONNECTIVITY = 20311, // + SMSG_VERIFY_CONNECTIVITY = 20311, // CMSG_VERIFY_CONNECTIVITY_RESPONSE = 19538, //1280462679, // special opcode, client sends as uint32 - SMSG_BATTLEFIELD_STATUS = 0x00, // - SMSG_QUESTUPDATE_ADD_ITEM = 0x00, // - SMSG_OVERRIDE_LIGHT = 0x00, // + SMSG_BATTLEFIELD_STATUS = 0x00, // + SMSG_QUESTUPDATE_ADD_ITEM = 0x00, // + SMSG_OVERRIDE_LIGHT = 0x00, // CMSG_RANDOMIZE_CHAR_NAME = 35481, // byte unk, byte race SMSG_RANDOMIZE_CHAR_NAME = 61660, // byte unk(0x80), string name - + CMSG_MOVE_SET_COLLISION_HGT = 0, // SMSG_MOVE_SET_COLLISION_HGT = 0, // }; diff --git a/src/server/game/Server/WorldPacket.cpp b/src/server/game/Server/WorldPacket.cpp index 20588529098..b6d037d6066 100644 --- a/src/server/game/Server/WorldPacket.cpp +++ b/src/server/game/Server/WorldPacket.cpp @@ -21,18 +21,19 @@ void WorldPacket::Compress(Opcodes opcode) { - if (opcode == UNKNOWN_OPCODE || opcode == NULL) + if (opcode == UNKNOWN_OPCODE || opcode == NULL_OPCODE) { sLog->outError("Tried to compress packet with unknown opcode (%u)", uint32(opcode)); return; } + Opcodes uncompressedOpcode = GetOpcode(); uint32 size = wpos(); uint32 destsize = compressBound(size); std::vector storage(destsize); - _compress(static_cast(&storage[0]), &destsize, static_cast(contents()), size); + Compress(static_cast(&storage[0]), &destsize, static_cast(contents()), size); if (destsize == 0) return; @@ -46,13 +47,13 @@ void WorldPacket::Compress(Opcodes opcode) uncompressedOpcode, size, opcode, destsize); } -void WorldPacket::_compress(void* dst, uint32 *dst_size, const void* src, int src_size) +void WorldPacket::Compress(void* dst, uint32 *dst_size, const void* src, int src_size) { z_stream c_stream; - c_stream.zalloc = (alloc_func)0; - c_stream.zfree = (free_func)0; - c_stream.opaque = (voidpf)0; + c_stream.zalloc = (alloc_func)NULL; + c_stream.zfree = (free_func)NULL; + c_stream.opaque = (voidpf)NULL; // default Z_BEST_SPEED (1) int z_res = deflateInit(&c_stream, sWorld->getIntConfig(CONFIG_COMPRESSION)); @@ -100,4 +101,4 @@ void WorldPacket::_compress(void* dst, uint32 *dst_size, const void* src, int sr } *dst_size = c_stream.total_out; -} \ No newline at end of file +} diff --git a/src/server/game/Server/WorldPacket.h b/src/server/game/Server/WorldPacket.h index a9af9ed0563..cd6f95c2d2e 100644 --- a/src/server/game/Server/WorldPacket.h +++ b/src/server/game/Server/WorldPacket.h @@ -27,12 +27,15 @@ class WorldPacket : public ByteBuffer { public: // just container for later use - WorldPacket() : ByteBuffer(0), m_opcode(UNKNOWN_OPCODE) + WorldPacket() : ByteBuffer(0), m_opcode(UNKNOWN_OPCODE) + { + + } + WorldPacket(Opcodes opcode, size_t res=200) : ByteBuffer(res), m_opcode(opcode) { } - explicit WorldPacket(Opcodes opcode, size_t res=200) : ByteBuffer(res), m_opcode(opcode) { } // copy constructor - WorldPacket(const WorldPacket &packet) : ByteBuffer(packet), m_opcode(packet.m_opcode) + WorldPacket(const WorldPacket &packet) : ByteBuffer(packet), m_opcode(packet.m_opcode) { } @@ -49,7 +52,7 @@ class WorldPacket : public ByteBuffer protected: Opcodes m_opcode; - void _compress(void* dst, uint32 *dst_size, const void* src, int src_size); + void Compress(void* dst, uint32 *dst_size, const void* src, int src_size); }; #endif diff --git a/src/server/shared/Packets/ByteBuffer.cpp b/src/server/shared/Packets/ByteBuffer.cpp index e2efdccfbcb..2f669f9a428 100644 --- a/src/server/shared/Packets/ByteBuffer.cpp +++ b/src/server/shared/Packets/ByteBuffer.cpp @@ -49,14 +49,14 @@ template void BitStream::WriteBits(T value, size_t bits) WriteBit((value >> i) & 1); } -bool BitStream::Empty () +bool BitStream::Empty() { return _data.empty(); } void BitStream::Reverse() { - uint32 len = GetLenght(); + uint32 len = GetLength(); std::vector b = _data; Clear(); @@ -70,7 +70,7 @@ void BitStream::Print() return; std::stringstream ss; ss << "BitStream: "; - for (uint32 i = 0; i < GetLenght(); ++i) + for (uint32 i = 0; i < GetLength(); ++i) ss << uint32(GetBit(i)) << " "; sLog->outDebug(LOG_FILTER_NETWORKIO, ss.str().c_str()); diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h index 0433145b028..bf4cf01b2be 100755 --- a/src/server/shared/Packets/ByteBuffer.h +++ b/src/server/shared/Packets/ByteBuffer.h @@ -68,7 +68,7 @@ class BitStream void Reverse(); void Print(); - size_t GetLenght () { return _data.size();} + size_t GetLength() { return _data.size(); } uint32 GetReadPosition() { return _rpos; } uint32 GetWritePosition() { return _wpos; } void SetReadPos(uint32 pos) { _rpos = pos; } @@ -103,7 +103,10 @@ class ByteBuffer ByteBuffer(size_t res, bool init = false); // copy constructor - ByteBuffer(const ByteBuffer &buf): _rpos(buf._rpos), _wpos(buf._wpos), _storage(buf._storage), _bitpos(buf._bitpos), _curbitval(buf._curbitval) { } + ByteBuffer(const ByteBuffer &buf) : _rpos(buf._rpos), _wpos(buf._wpos), + _storage(buf._storage), _bitpos(buf._bitpos), _curbitval(buf._curbitval) + { + } void clear() { @@ -113,12 +116,12 @@ class ByteBuffer template void append(T value) { - flushBits(); + FlushBits(); EndianConvert(value); append((uint8 *)&value, sizeof(value)); } - void flushBits() + void FlushBits() { if (_bitpos == 8) return; @@ -128,7 +131,7 @@ class ByteBuffer _bitpos = 8; } - bool writeBit(uint32 bit) + bool WriteBit(uint32 bit) { --_bitpos; if (bit) @@ -144,7 +147,7 @@ class ByteBuffer return (bit != 0); } - bool readBit() + bool ReadBit() { ++_bitpos; if (_bitpos > 7) @@ -152,26 +155,23 @@ class ByteBuffer _bitpos = 0; _curbitval = read(); } - bool bit = ((_curbitval >> (7-_bitpos)) & 1) != 0; - return bit; + + return ((_curbitval >> (7-_bitpos)) & 1) != 0; } - template void writeBits(T value, size_t bits) + template void WriteBits(T value, size_t bits) { for (int32 i = bits-1; i >= 0; --i) - writeBit((value >> i) & 1); + WriteBit((value >> i) & 1); } - uint32 readBits(size_t bits) + uint32 ReadBits(size_t bits) { uint32 value = 0; for (int32 i = bits-1; i >= 0; --i) - { - if(readBit()) - { + if (ReadBit()) value |= (1 << (_bitpos)); - } - } + return value; } @@ -179,7 +179,7 @@ class ByteBuffer { BitStream b; for (uint32 i = 0; i < len; ++i) - b.WriteBit(readBit()); + b.WriteBit(ReadBit()); return b; } -- cgit v1.2.3 From a28b5c3a954733bd029aa6020039adf5c5ef136f Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 27 Nov 2011 18:08:29 +0000 Subject: Core/Protocol: Few more opcodes from WPP --- src/server/game/Server/Protocol/Opcodes.h | 1988 +++++++++++++++-------------- 1 file changed, 998 insertions(+), 990 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 933fb980958..a642a304c76 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -28,1000 +28,1008 @@ /// List of Opcodes enum Opcodes { - NUM_OPCODE_HANDLERS = (0xFFFF+1), - UNKNOWN_OPCODE = NUM_OPCODE_HANDLERS, - NULL_OPCODE = 0, - - CMSG_ACCEPT_LEVEL_GRANT = 0xDC4B, // - CMSG_ACCEPT_TRADE = 0x00, // - CMSG_ACTIVATETAXI = 0x00, // - CMSG_ACTIVATETAXIEXPRESS = 0x00, // - CMSG_ADD_FRIEND = 0x5C57, // - CMSG_ADD_IGNORE = 0xCEEA, // - CMSG_ADD_VOICE_IGNORE = 0xA7A, // - CMSG_ALTER_APPEARANCE = 0x00, // - CMSG_AREATRIGGER = 0x5862, // - CMSG_AREA_SPIRIT_HEALER_QUERY = 0xDC7E, // - CMSG_AREA_SPIRIT_HEALER_QUEUE = 0x00, // - CMSG_ARENA_TEAM_ACCEPT = 0x00, // - CMSG_ARENA_TEAM_DECLINE = 0x00, // - CMSG_ARENA_TEAM_DISBAND = 0x4A5A, // - CMSG_ARENA_TEAM_INVITE = 0x4862, // - CMSG_ARENA_TEAM_LEADER = 0x8F3, // - CMSG_ARENA_TEAM_LEAVE = 0x48EB, // - CMSG_ARENA_TEAM_QUERY = 0x872, // - CMSG_ARENA_TEAM_REMOVE = 0xCE5E, // - CMSG_ARENA_TEAM_ROSTER = 0x00, // - CMSG_ATTACKSTOP = 0x00, // - CMSG_ATTACKSWING = 0x00, // - CMSG_AUCTION_LIST_BIDDER_ITEMS = 0x00, // - CMSG_AUCTION_LIST_ITEMS = 0xDC5F, // - CMSG_AUCTION_LIST_OWNER_ITEMS = 0x00, // - CMSG_AUCTION_PLACE_BID = 0x8E76, // - CMSG_AUCTION_REMOVE_ITEM = 0xCEC3, // - CMSG_AUCTION_SELL_ITEM = 0xCE6, // - CMSG_AUTH_SESSION = 0x1019, // - CMSG_AUTOEQUIP_GROUND_ITEM = 0x00, // - CMSG_AUTOEQUIP_ITEM = 0x8E66, // - CMSG_AUTOEQUIP_ITEM_SLOT = 0x00, // - CMSG_AUTO_DECLINE_GUILD_INVITES = 0x586F, // - CMSG_AUTOSTORE_BAG_ITEM = 0x00, // - CMSG_AUTOSTORE_GROUND_ITEM = 0x00, // - CMSG_AUTOSTORE_LOOT_ITEM = 0x00, // - CMSG_BANKER_ACTIVATE = 0x00, // - CMSG_BATTLEFIELD_JOIN = 0x00, // - CMSG_BATTLEFIELD_REQUEST_SCORE_DATA = 0x00, // - CMSG_BATTLEFIELD_STATUS = 0x00, // - MSG_BATTLEGROUND_PLAYER_POSITIONS = 0x00, // - CMSG_BATTLEMASTER_JOIN_ARENA = 0x00, // - CMSG_BEGIN_TRADE = 0x00, // - CMSG_BINDER_ACTIVATE = 0x00, // - CMSG_BOT_DETECTED2 = 0x00, // - CMSG_BUG = 0x1A77, // - CMSG_BUSY_TRADE = 0x00, // - CMSG_BUYBACK_ITEM = 0xDEE6, // - CMSG_BUY_BANK_SLOT = 0x487F, // - CMSG_BUY_ITEM = 0x00, // - CMSG_CALENDAR_ADD_EVENT = 0x1CF3, // - CMSG_CALENDAR_ARENA_TEAM = 0x00, // - CMSG_CALENDAR_CONTEXT_EVENT_SIGNUP = 0x00, // - CMSG_CALENDAR_COPY_EVENT = 0x00, // - CMSG_CALENDAR_EVENT_INVITE = 0x1EDA, // - CMSG_CALENDAR_EVENT_MODERATOR_STATUS = 0x00, // - CMSG_CALENDAR_EVENT_REMOVE_INVITE = 0x00, // - CMSG_CALENDAR_EVENT_STATUS = 0x00, // - CMSG_CALENDAR_GET_EVENT = 0x00, // - CMSG_CALENDAR_GET_NUM_PENDING = 0x00, // - CMSG_CALENDAR_GUILD_FILTER = 0x00, // - CMSG_CALENDAR_REMOVE_EVENT = 0x00, // - CMSG_CALENDAR_UPDATE_EVENT = 0x5CD2, // - CMSG_CANCEL_AURA = 0x00, // - CMSG_CANCEL_AUTO_REPEAT_SPELL = 0x5CEE, // - CMSG_CANCEL_CAST = 0x00, // - CMSG_CANCEL_CHANNELLING = 0xC8FE, // - CMSG_CANCEL_GROWTH_AURA = 0xDEF7, // - CMSG_CANCEL_MOUNT_AURA = 0x00, // - CMSG_CANCEL_TEMP_ENCHANTMENT = 0x00, // - CMSG_CANCEL_TRADE = 0x35A5, // - CMSG_CAST_SPELL = 0x5E4E, // - CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE = 0x00, // - CMSG_CHANNEL_ANNOUNCEMENTS = 0x00, // - CMSG_CHANNEL_BAN = 0x00, // - CMSG_CHANNEL_DISPLAY_LIST = 0x00, // - CMSG_CHANNEL_INVITE = 0x00, // - CMSG_CHANNEL_KICK = 0x00, // - CMSG_CHANNEL_LIST = 0x00, // - CMSG_CHANNEL_MODERATOR = 0x00, // - CMSG_CHANNEL_MUTE = 0x00, // - CMSG_CHANNEL_OWNER = 0x00, // - CMSG_CHANNEL_PASSWORD = 0x00, // - CMSG_CHANNEL_ROSTER_INFO = 0x00, // - CMSG_CHANNEL_SET_OWNER = 0x00, // - CMSG_CHANNEL_UNBAN = 0x00, // - CMSG_CHANNEL_UNMODERATOR = 0x00, // - CMSG_CHANNEL_UNMUTE = 0x00, // - CMSG_CHAR_CREATE = 0x1AC6, // - CMSG_CHAR_CUSTOMIZE = 0xDECF, // - CMSG_CHAR_DELETE = 0x1ED3, // - CMSG_CHAR_ENUM = 0x4A8B, // - CMSG_CHAR_FACTION_CHANGE = 0xCCEE, // - CMSG_CHAR_RACE_CHANGE = 0xDC57, // - CMSG_CHAR_RENAME = 0x5E6F, // - CMSG_CLEAR_CHANNEL_WATCH = 0x9CC2, // - CMSG_CLEAR_TRADE_ITEM = 0x00, // - CMSG_COMMENTATOR_ENABLE = 0x1CF7, // - CMSG_COMMENTATOR_ENTER_INSTANCE = 0x8EF6, // - CMSG_COMMENTATOR_EXIT_INSTANCE = 0x4C7B, // - CMSG_COMMENTATOR_GET_MAP_INFO = 0xDEE7, // - CMSG_COMMENTATOR_GET_PLAYER_INFO = 0x9EF3, // - CMSG_COMMENTATOR_INSTANCE_COMMAND = 0x5CEB, // - CMSG_COMMENTATOR_SKIRMISH_QUEUE_COMMAND = 0x9C4E, // - CMSG_COMMENTATOR_START_WARGAME = 0x00, // - CMSG_COMPLAIN = 0x00, // - CMSG_COMPLETE_CINEMATIC = 0x1A6F, // - CMSG_COMPLETE_MOVIE = 0x00, // - CMSG_CONTACT_LIST = 0xCECF, // - CMSG_CORPSE_MAP_POSITION_QUERY = 0xDC7F, // - CMSG_CREATURE_QUERY = 0x5A7E, // - CMSG_DANCE_QUERY = 0x5C5E, // - CMSG_DECLINE_CHANNEL_INVITE = 0x00, // - CMSG_DEL_FRIEND = 0xC852, // - CMSG_DEL_IGNORE = 0x8ADA, // - CMSG_DEL_VOICE_IGNORE = 0x8C73, // - CMSG_DESTROYITEM = 0x4E7A, // - CMSG_DESTROY_ITEMS = 0x00, // - CMSG_DUEL_ACCEPTED = 0x00, // - CMSG_DUEL_CANCELLED = 0x00, // - CMSG_EJECT_PASSENGER = 0x00, // - CMSG_EQUIPMENT_SET_DELETE = 0x00, // - CMSG_EQUIPMENT_SET_SAVE = 0x00, // - CMSG_EQUIPMENT_SET_USE = 0x4853, // - CMSG_EMOTE = 0x9843, // - CMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK = 0x00, // - CMSG_FORCE_FLIGHT_SPEED_CHANGE_ACK = 0x00, // - CMSG_FORCE_MOVE_ROOT_ACK = 0x00, // - CMSG_FORCE_MOVE_UNROOT_ACK = 0x00, // - CMSG_FORCE_PITCH_RATE_CHANGE_ACK = 0x00, // - CMSG_FORCE_RUN_BACK_SPEED_CHANGE_ACK = 0x00, // - CMSG_FORCE_RUN_SPEED_CHANGE_ACK = 0x00, // - CMSG_FORCE_SWIM_BACK_SPEED_CHANGE_ACK = 0x00, // - CMSG_FORCE_SWIM_SPEED_CHANGE_ACK = 0x00, // - CMSG_FORCE_TURN_RATE_CHANGE_ACK = 0x00, // - CMSG_FORCE_WALK_SPEED_CHANGE_ACK = 0x00, // - CMSG_GAMEOBJECT_QUERY = 0xCEFF, // - CMSG_GAMEOBJ_REPORT_USE = 0x00, // - CMSG_GAMEOBJ_USE = 0x00, // - CMSG_GAMESPEED_SET = 0x00, // - CMSG_GAMETIME_SET = 0x00, // - CMSG_GET_MAIL_LIST = 0xB284, // - CMSG_GET_MIRRORIMAGE_DATA = 0xDAF3, // - CMSG_GETDEATHBINDZONE = 0x00, // - CMSG_GHOST = 0x00, // - CMSG_GM_INVIS = 0x00, // - CMSG_GMRESPONSE_RESOLVE = 0x00, // - CMSG_GMSURVEY_SUBMIT = 0x00, // - CMSG_GMTICKET_CREATE = 0x00, // - CMSG_GMTICKET_DELETETICKET = 0x00, // - CMSG_GMTICKET_GETTICKET = 0x00, // - CMSG_GMTICKET_SYSTEMSTATUS = 0x4A7A, // - CMSG_GMTICKET_UPDATETEXT = 0x8A7B, // - CMSG_GM_NUKE = 0x00, // - CMSG_GM_SET_SECURITY_GROUP = 0x00, // - CMSG_GM_REPORT_LAG = 0x00, // - CMSG_GOSSIP_HELLO = 0xAD3, // - CMSG_GOSSIP_SELECT_OPTION = 0x984E, // - CMSG_GRANT_LEVEL = 0x1CD6, // - CMSG_GROUP_ACCEPT = 0x00, // - CMSG_GROUP_ASSISTANT_LEADER = 0xC8CA, // - CMSG_GROUP_CANCEL = 0x00, // - CMSG_GROUP_CHANGE_SUB_GROUP = 0x1AD2, // - CMSG_GROUP_DECLINE = 0x00, // - CMSG_GROUP_DISBAND = 0x00, // - CMSG_GROUP_INVITE = 0x00, // - CMSG_GROUP_RAID_CONVERT = 0xC85A, // - CMSG_GROUP_SET_LEADER = 0xCEC7, // - CMSG_GROUP_SWAP_SUB_GROUP = 0x5AD7, // - CMSG_GROUP_UNINVITE = 0x00, // - CMSG_GROUP_UNINVITE_GUID = 0x00, // - CMSG_GUILD_ACCEPT = 0x00, // - CMSG_GUILD_BANKER_ACTIVATE = 0x4E77, // - CMSG_GUILD_BANK_BUY_TAB = 0x00, // - CMSG_GUILD_BANK_DEPOSIT_MONEY = 0x00, // - CMSG_GUILD_BANK_NOTE = 0x00, // - CMSG_GUILD_BANK_QUERY_TAB = 0xDE46, // - CMSG_GUILD_BANK_SWAP_ITEMS = 0x85B, // - CMSG_GUILD_BANK_UPDATE_TAB = 0x00, // - CMSG_GUILD_BANK_WITHDRAW_MONEY = 0x00, // - CMSG_GUILD_CREATE = 0x00, // - CMSG_GUILD_DECLINE = 0x00, // - CMSG_GUILD_DEMOTE = 0x00, // - CMSG_GUILD_DISBAND = 0x00, // - CMSG_GUILD_INFO = 0xCE76, // - CMSG_GUILD_INVITE = 0x00, // - CMSG_GUILD_PROMOTE = 0x00, // - CMSG_GUILD_QUERY = 0x8E57, // - CMSG_GUILD_LEADER = 0x00, // - CMSG_GUILD_LEAVE = 0x00, // - CMSG_GUILD_MOTD = 0x00, // - CMSG_GUILD_REMOVE = 0x00, // - CMSG_GUILD_ROSTER = 0x00, // - CMSG_HEARTH_AND_RESURRECT = 0x00, // - CMSG_IGNORE_TRADE = 0x00, // - CMSG_INITIATE_TRADE = 0x00, // - CMSG_INSPECT = 0x9A7B, // - CMSG_INSTANCE_LOCK_WARNING_RESPONSE = 0x8CF7, // - CMSG_ITEM_QUERY_SINGLE = 0x8E2, // - CMSG_ITEM_QUERY_MULTIPLE = 0x00, // - CMSG_ITEM_REFUND = 0xCC3, // - CMSG_ITEM_REFUND_INFO = 0x1C7E, // - CMSG_ITEM_TEXT_QUERY = 0x4AEB, // - CMSG_JOIN_CHANNEL = 0x3441, // - CMSG_KEEP_ALIVE = 0xC87A, // - CMSG_LEARN_PREVIEW_TALENTS = 0xDEE3, // - CMSG_LEARN_PREVIEW_TALENTS_PET = 0x9AFB, // - CMSG_LEARN_TALENT = 0x98F3, // - CMSG_LEAVE_BATTLEFIELD = 0x1AE7, // - CMSG_LEAVE_CHANNEL = 0x00, // - CMSG_LFD_PARTY_LOCK_INFO_REQUEST = 0x00, // - CMSG_LFG_GET_PLAYER_INFO = 0x00, // - CMSG_LFG_JOIN = 0x00, // - CMSG_LFG_LEAVE = 0x00, // - CMSG_LFG_PROPOSAL_RESULT = 0x00, // - SMSG_LFG_BOOT_PLAYER = 0x00, // - CMSG_LFG_SET_ROLES = 0x4843, // - CMSG_LFG_TELEPORT = 0x8C7A, // - CMSG_LIST_INVENTORY = 0xDCFE, // - CMSG_LOAD_SCREEN = 0x4011, // - CMSG_LOG_DISCONNECT = 0x00, // - CMSG_LOGOUT_CANCEL = 0xA76, // - CMSG_LOGOUT_REQUEST = 0x4C7A, // - CMSG_LOOT = 0x00, // - CMSG_LOOT_METHOD = 0x00, // - CMSG_LOOT_MONEY = 0x00, // - CMSG_LOOT_RELEASE = 0x4A6A, // - CMSG_LOOT_ROLL = 0x00, // - CMSG_MAIL_CREATE_TEXT_ITEM = 0x886E, // - CMSG_MAIL_DELETE = 0x4CCF, // - CMSG_MAIL_MARK_AS_READ = 0x00, // - CMSG_MAIL_RETURN_TO_SENDER = 0x587E, // - CMSG_MAIL_TAKE_ITEM = 0xCC2, // - CMSG_MAIL_TAKE_MONEY = 0x4CD6, // - CMSG_MEETINGSTONE_INFO = 0xCA5B, // - CMSG_MESSAGECHAT_AFK = 0x00, // - CMSG_MESSAGECHAT_BATTLEGROUND = 0x00, // - CMSG_MESSAGECHAT_BATTLEGROUND_LEADER = 0x00, // - CMSG_MESSAGECHAT_ADDON = 0x24D9, // - CMSG_MESSAGECHAT_CHANNEL = 0x7459, // - CMSG_MESSAGECHAT_DND = 0x00, // - CMSG_MESSAGECHAT_EMOTE = 0x6449, // - CMSG_MESSAGECHAT_GUILD = 0x60C1, // - CMSG_MESSAGECHAT_OFFICER = 0x00, // - CMSG_MESSAGECHAT_PARTY = 0x24C9, // - CMSG_MESSAGECHAT_PARTY_LEADER = 0x00, // - CMSG_MESSAGECHAT_RAID = 0x00, // - CMSG_MESSAGECHAT_RAID_LEADER = 0x00, // - CMSG_MESSAGECHAT_RAID_WARNING = 0x00, // - CMSG_MESSAGECHAT_SAY = 0x2459, // - CMSG_MESSAGECHAT_WHISPER = 0x70D9, // - CMSG_MESSAGECHAT_YELL = 0x70C1, // - CMSG_MINIGAME_MOVE = 0x00, // - CMSG_MOUNTSPECIAL_ANIM = 0x00, // - CMSG_MOVE_KNOCK_BACK_ACK = 0x00, // - CMSG_MOVE_SET_RAW_POSITION = 0x00, // - CMSG_MOVE_TIME_SKIPPED = 0x00, // - CMSG_ENABLE_NAGLE = 0x00, // - CMSG_NAME_QUERY = 0x586A, // - CMSG_NEW_SPELL_SLOT = 0x00, // - CMSG_NEXT_CINEMATIC_CAMERA = 0x8E63, // - CMSG_NPC_TEXT_QUERY = 0x5C63, // - CMSG_OFFER_PETITION = 0xC8DE, // - CMSG_OPEN_ITEM = 0x88C7, // - CMSG_OPENING_CINEMATIC = 0xD8D2, // - CMSG_OPT_OUT_OF_LOOT = 0x00, // - CMSG_PAGE_TEXT_QUERY = 0x8A5F, // - CMSG_PETITION_BUY = 0x8E4E, // - CMSG_PETITION_QUERY = 0xCEF3, // - CMSG_PETITION_SHOWLIST = 0x00, // - CMSG_PETITION_SHOW_SIGNATURES = 0x1E66, // - CMSG_PETITION_SIGN = 0x4A5E, // - CMSG_PET_ABANDON = 0x00, // - CMSG_PET_ACTION = 0x1AEA, // - CMSG_PET_CANCEL_AURA = 0x00, // - CMSG_PET_CAST_SPELL = 0x00, // - CMSG_PET_LEARN_TALENT = 0x48E6, // - CMSG_PET_NAME_QUERY = 0xDA76, // - CMSG_PET_RENAME = 0x00, // - CMSG_PET_SET_ACTION = 0x00, // - CMSG_PET_SPELL_AUTOCAST = 0x00, // - CMSG_PET_STOP_ATTACK = 0x00, // - CMSG_PING = 0x1008, // - CMSG_PLAYER_DIFFICULTY_CHANGE = 0x00, // - CMSG_PLAYED_TIME = 0x5A56, // - CMSG_PLAYER_LOGIN = 0x0898, // - CMSG_PLAYER_LOGOUT = 0x1CEE, // - CMSG_PLAYER_VEHICLE_ENTER = 0x00, // - CMSG_PLAY_DANCE = 0x5857, // - CMSG_PUSHQUESTTOPARTY = 0xA47, // - CMSG_QUERY_GUILD_REWARDS = 0x00, // - CMSG_QUERY_GUILD_MAX_XP = 0x00, // - CMSG_QUERY_GUILD_XP = 0x00, // - CMSG_QUERY_TIME = 0x18FE, // - CMSG_QUEST_QUERY = 0xCE7F, // - CMSG_QUERY_QUESTS_COMPLETED = 0x98DF, // - CMSG_QUESTLOG_SWAP_QUEST = 0x00, // - CMSG_QUESTGIVER_ACCEPT_QUEST = 0x8CD3, // - CMSG_QUESTGIVER_CANCEL = 0xC86A, // - CMSG_QUESTGIVER_CHOOSE_REWARD = 0x18F3, // - CMSG_QUESTGIVER_COMPLETE_QUEST = 0xCCE3, // - CMSG_QUESTGIVER_HELLO = 0x00, // - CMSG_QUESTGIVER_QUERY_QUEST = 0x8CE7, // - CMSG_QUESTGIVER_QUEST_AUTOLAUNCH = 0x00, // - CMSG_QUESTGIVER_REQUEST_REWARD = 0xD8E7, // - CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY = 0xC8DB, // - CMSG_QUESTGIVER_STATUS_QUERY = 0x88C6, // - CMSG_QUESTLOG_REMOVE_QUEST = 0x8EFF, // - CMSG_QUEST_POI_QUERY = 0x00, // - CMSG_QUEST_CONFIRM_ACCEPT = 0xC63, // - CMSG_READY_FOR_ACCOUNT_DATA_TIMES = 0xCCDB, // - CMSG_READ_ITEM = 0x00, // - CMSG_REALM_SPLIT = 0xDC66, // - CMSG_RECLAIM_CORPSE = 0x88DB, // - CMSG_REDIRECTION_AUTH_PROOF = 0x00, // - CMSG_REPAIR_ITEM = 0xCF3, // - CMSG_REPOP_REQUEST = 0x8872, // - CMSG_REPORT_PVP_AFK = 0x00, // - CMSG_REPLACE_ACCOUNT_DATA = 0x00, // - CMSG_REQUEST_ACCOUNT_DATA = 0x00, // - CMSG_REQUEST_CATEGORY_COOLDOWNS = 0x00, // - CMSG_REQUEST_CEMETERY_LIST = 0x00, // - CMSG_REQUEST_PARTY_MEMBER_STATS = 0x987E, // - CMSG_REQUEST_PET_INFO = 0x9A47, // - CMSG_REQUEST_PLAYER_VEHICLE_EXIT = 0xCC6, // - CMSG_REQUEST_RATED_BG_INFO = 0x00, // - CMSG_REQUEST_RAID_INFO = 0x00, // - CMSG_REQUEST_VEHICLE_NEXT_SEAT = 0xCAD6, // - CMSG_REQUEST_VEHICLE_PREV_SEAT = 0x1AE2, // + NUM_OPCODE_HANDLERS = (0xFFFF+1), + UNKNOWN_OPCODE = NUM_OPCODE_HANDLERS, + + CMSG_ACCEPT_LEVEL_GRANT = 0xDC4B, + CMSG_ACCEPT_TRADE = 0x00, + CMSG_ACTIVATETAXI = 0x00, + CMSG_ACTIVATETAXIEXPRESS = 0x00, + CMSG_ADD_FRIEND = 0x5C57, + CMSG_ADD_IGNORE = 0xCEEA, + CMSG_ADD_VOICE_IGNORE = 0xA7A, + CMSG_ALTER_APPEARANCE = 0x00, + CMSG_AREATRIGGER = 0x5862, + CMSG_AREA_SPIRIT_HEALER_QUERY = 0xDC7E, + CMSG_AREA_SPIRIT_HEALER_QUEUE = 0x00, + CMSG_ARENA_TEAM_ACCEPT = 0x00, + CMSG_ARENA_TEAM_DECLINE = 0x00, + CMSG_ARENA_TEAM_DISBAND = 0x4A5A, + CMSG_ARENA_TEAM_INVITE = 0x4862, + CMSG_ARENA_TEAM_LEADER = 0x8F3, + CMSG_ARENA_TEAM_LEAVE = 0x48EB, + CMSG_ARENA_TEAM_QUERY = 0x872, + CMSG_ARENA_TEAM_REMOVE = 0xCE5E, + CMSG_ARENA_TEAM_ROSTER = 0x00, + CMSG_ATTACKSTOP = 0x00, + CMSG_ATTACKSWING = 0x00, + CMSG_AUCTION_LIST_BIDDER_ITEMS = 0x00, + CMSG_AUCTION_LIST_ITEMS = 0xDC5F, + CMSG_AUCTION_LIST_OWNER_ITEMS = 0x00, + CMSG_AUCTION_PLACE_BID = 0x8E76, + CMSG_AUCTION_REMOVE_ITEM = 0xCEC3, + CMSG_AUCTION_SELL_ITEM = 0xCE6, + CMSG_AUTH_SESSION = 0x1019, + CMSG_AUTOEQUIP_GROUND_ITEM = 0x00, + CMSG_AUTOEQUIP_ITEM = 0x8E66, + CMSG_AUTOEQUIP_ITEM_SLOT = 0x00, + CMSG_AUTO_DECLINE_GUILD_INVITES = 0x586F, + CMSG_BATTLEFIELD_LIST = 0x32A4, // New 4.x + CMSG_AUTOSTORE_BAG_ITEM = 0x00, + CMSG_AUTOSTORE_GROUND_ITEM = 0x00, + CMSG_AUTOSTORE_LOOT_ITEM = 0x00, + CMSG_BANKER_ACTIVATE = 0x00, + CMSG_BATTLEFIELD_JOIN = 0x00, + CMSG_BATTLEFIELD_REQUEST_SCORE_DATA = 0x00, + CMSG_BATTLEFIELD_STATUS = 0x00, + MSG_BATTLEGROUND_PLAYER_POSITIONS = 0x00, + CMSG_BATTLEMASTER_JOIN_ARENA = 0x00, + CMSG_BEGIN_TRADE = 0x00, + CMSG_BINDER_ACTIVATE = 0x00, + CMSG_BOT_DETECTED2 = 0x00, + CMSG_BUG = 0x1A77, + CMSG_BUSY_TRADE = 0x00, + CMSG_BUYBACK_ITEM = 0xDEE6, + CMSG_BUY_BANK_SLOT = 0x487F, + CMSG_BUY_ITEM = 0x00, + CMSG_CALENDAR_ADD_EVENT = 0x1CF3, + CMSG_CALENDAR_ARENA_TEAM = 0x00, + CMSG_CALENDAR_CONTEXT_EVENT_SIGNUP = 0x00, + CMSG_CALENDAR_COPY_EVENT = 0x00, + CMSG_CALENDAR_EVENT_INVITE = 0x1EDA, + CMSG_CALENDAR_EVENT_MODERATOR_STATUS = 0x00, + CMSG_CALENDAR_EVENT_REMOVE_INVITE = 0x00, + CMSG_CALENDAR_EVENT_STATUS = 0x00, + CMSG_CALENDAR_GET_EVENT = 0x00, + CMSG_CALENDAR_GET_NUM_PENDING = 0x00, + CMSG_CALENDAR_GUILD_FILTER = 0x00, + CMSG_CALENDAR_REMOVE_EVENT = 0x00, + CMSG_CALENDAR_UPDATE_EVENT = 0x5CD2, + CMSG_CANCEL_AURA = 0x00, + CMSG_CANCEL_AUTO_REPEAT_SPELL = 0x5CEE, + CMSG_CANCEL_CAST = 0x00, + CMSG_CANCEL_CHANNELLING = 0xC8FE, + CMSG_CANCEL_GROWTH_AURA = 0xDEF7, + CMSG_CANCEL_MOUNT_AURA = 0x00, + CMSG_CANCEL_TEMP_ENCHANTMENT = 0x00, + CMSG_CANCEL_TRADE = 0x35A5, + CMSG_CAST_SPELL = 0x5E4E, + CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE = 0x00, + CMSG_CHANNEL_ANNOUNCEMENTS = 0x00, + CMSG_CHANNEL_BAN = 0x00, + CMSG_CHANNEL_DISPLAY_LIST = 0x00, + CMSG_CHANNEL_INVITE = 0x00, + CMSG_CHANNEL_KICK = 0x00, + CMSG_CHANNEL_LIST = 0x00, + CMSG_CHANNEL_MODERATOR = 0x00, + CMSG_CHANNEL_MUTE = 0x00, + CMSG_CHANNEL_OWNER = 0x00, + CMSG_CHANNEL_PASSWORD = 0x00, + CMSG_CHANNEL_ROSTER_INFO = 0x00, + CMSG_CHANNEL_SET_OWNER = 0x00, + CMSG_CHANNEL_UNBAN = 0x00, + CMSG_CHANNEL_UNMODERATOR = 0x00, + CMSG_CHANNEL_UNMUTE = 0x00, + CMSG_CHAR_CREATE = 0x1AC6, + CMSG_CHAR_CUSTOMIZE = 0xDECF, + CMSG_CHAR_DELETE = 0x1ED3, + CMSG_CHAR_ENUM = 0x4A8B, + CMSG_CHAR_FACTION_CHANGE = 0xCCEE, + CMSG_CHAR_RACE_CHANGE = 0xDC57, + CMSG_CHAR_RENAME = 0x5E6F, + CMSG_CLEAR_CHANNEL_WATCH = 0x9CC2, + CMSG_CLEAR_TRADE_ITEM = 0x00, + CMSG_COMMENTATOR_ENABLE = 0x1CF7, + CMSG_COMMENTATOR_ENTER_INSTANCE = 0x8EF6, + CMSG_COMMENTATOR_EXIT_INSTANCE = 0x4C7B, + CMSG_COMMENTATOR_GET_MAP_INFO = 0xDEE7, + CMSG_COMMENTATOR_GET_PLAYER_INFO = 0x9EF3, + CMSG_COMMENTATOR_INSTANCE_COMMAND = 0x5CEB, + CMSG_COMMENTATOR_SKIRMISH_QUEUE_COMMAND = 0x9C4E, + CMSG_COMMENTATOR_START_WARGAME = 0x00, + CMSG_COMPLAIN = 0x00, + CMSG_COMPLETE_CINEMATIC = 0x1A6F, + CMSG_COMPLETE_MOVIE = 0x00, + CMSG_CONTACT_LIST = 0xCECF, + CMSG_CORPSE_MAP_POSITION_QUERY = 0xDC7F, + CMSG_CREATURE_QUERY = 0x5A7E, + CMSG_DANCE_QUERY = 0x5C5E, + CMSG_DECLINE_CHANNEL_INVITE = 0x00, + CMSG_DEL_FRIEND = 0xC852, + CMSG_DEL_IGNORE = 0x8ADA, + CMSG_DEL_VOICE_IGNORE = 0x8C73, + CMSG_DESTROYITEM = 0x4E7A, + CMSG_DESTROY_ITEMS = 0x00, + CMSG_DUEL_ACCEPTED = 0x00, + CMSG_DUEL_CANCELLED = 0x00, + CMSG_EJECT_PASSENGER = 0x00, + CMSG_EQUIPMENT_SET_DELETE = 0x00, + CMSG_EQUIPMENT_SET_SAVE = 0x00, + CMSG_EQUIPMENT_SET_USE = 0x4853, + CMSG_EMOTE = 0x9843, + CMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK = 0x00, + CMSG_FORCE_FLIGHT_SPEED_CHANGE_ACK = 0x00, + CMSG_FORCE_MOVE_ROOT_ACK = 0x00, + CMSG_FORCE_MOVE_UNROOT_ACK = 0x00, + CMSG_FORCE_PITCH_RATE_CHANGE_ACK = 0x00, + CMSG_FORCE_RUN_BACK_SPEED_CHANGE_ACK = 0x00, + CMSG_FORCE_RUN_SPEED_CHANGE_ACK = 0x00, + CMSG_FORCE_SWIM_BACK_SPEED_CHANGE_ACK = 0x00, + CMSG_FORCE_SWIM_SPEED_CHANGE_ACK = 0x00, + CMSG_FORCE_TURN_RATE_CHANGE_ACK = 0x00, + CMSG_FORCE_WALK_SPEED_CHANGE_ACK = 0x00, + CMSG_GAMEOBJECT_QUERY = 0xCEFF, + CMSG_GAMEOBJ_REPORT_USE = 0x00, + CMSG_GAMEOBJ_USE = 0x9A4A, + CMSG_GAMESPEED_SET = 0x00, + CMSG_GAMETIME_SET = 0x00, + CMSG_GET_MAIL_LIST = 0xB284, + CMSG_GET_MIRRORIMAGE_DATA = 0xDAF3, + CMSG_GETDEATHBINDZONE = 0x00, + CMSG_GHOST = 0x00, + CMSG_GM_INVIS = 0x00, + CMSG_GMRESPONSE_RESOLVE = 0x00, + CMSG_GMSURVEY_SUBMIT = 0x00, + CMSG_GMTICKET_CREATE = 0x00, + CMSG_GMTICKET_DELETETICKET = 0x00, + CMSG_GMTICKET_GETTICKET = 0x00, + CMSG_GMTICKET_SYSTEMSTATUS = 0x4A7A, + CMSG_GMTICKET_UPDATETEXT = 0x8A7B, + CMSG_GM_NUKE = 0x00, + CMSG_GM_SET_SECURITY_GROUP = 0x00, + CMSG_GM_REPORT_LAG = 0x00, + CMSG_GOSSIP_HELLO = 0xAD3, + CMSG_GOSSIP_SELECT_OPTION = 0x984E, + CMSG_GRANT_LEVEL = 0x1CD6, + CMSG_GROUP_ACCEPT = 0x00, + CMSG_GROUP_ASSISTANT_LEADER = 0xC8CA, + CMSG_GROUP_CANCEL = 0x00, + CMSG_GROUP_CHANGE_SUB_GROUP = 0x1AD2, + CMSG_GROUP_DECLINE = 0x00, + CMSG_GROUP_DISBAND = 0x00, + CMSG_GROUP_INVITE = 0x00, + CMSG_GROUP_RAID_CONVERT = 0xC85A, + CMSG_GROUP_SET_LEADER = 0xCEC7, + CMSG_GROUP_SWAP_SUB_GROUP = 0x5AD7, + CMSG_GROUP_UNINVITE = 0x00, + CMSG_GROUP_UNINVITE_GUID = 0x00, + CMSG_GUILD_ACCEPT = 0x00, + CMSG_GUILD_BANKER_ACTIVATE = 0x4E77, + CMSG_GUILD_BANK_BUY_TAB = 0x00, + CMSG_GUILD_BANK_DEPOSIT_MONEY = 0x00, + CMSG_GUILD_BANK_NOTE = 0x00, + CMSG_GUILD_BANK_QUERY_TAB = 0xDE46, + CMSG_GUILD_BANK_SWAP_ITEMS = 0x85B, + CMSG_GUILD_BANK_UPDATE_TAB = 0x00, + CMSG_GUILD_BANK_WITHDRAW_MONEY = 0x00, + CMSG_GUILD_CREATE = 0x00, + CMSG_GUILD_DECLINE = 0x00, + CMSG_GUILD_DEMOTE = 0x00, + CMSG_GUILD_DISBAND = 0x00, + CMSG_GUILD_INFO = 0xCE76, + CMSG_GUILD_INVITE = 0x8C67, + CMSG_GUILD_PROMOTE = 0x00, + CMSG_GUILD_QUERY = 0x8E57, + CMSG_GUILD_LEADER = 0x00, + CMSG_GUILD_LEAVE = 0x00, + CMSG_GUILD_MOTD = 0x00, + CMSG_GUILD_RANK = 0x8D50, // New 4.x + CMSG_GUILD_REMOVE = 0x00, + CMSG_GUILD_ROSTER = 0x9952, + CMSG_GUILD_SET_NOTE = 0x9958, // New 4.x ? + CMSG_GUILDFINDER_JOIN = 0x68C5, // New 4.x + CMSG_HEARTH_AND_RESURRECT = 0x00, + CMSG_IGNORE_TRADE = 0x00, + CMSG_INITIATE_TRADE = 0x00, + CMSG_INSPECT = 0x9A7B, + CMSG_INSTANCE_LOCK_WARNING_RESPONSE = 0x8CF7, + CMSG_ITEM_QUERY_SINGLE = 0x8E2, + CMSG_ITEM_QUERY_MULTIPLE = 0x00, + CMSG_ITEM_REFUND = 0xCC3, + CMSG_ITEM_REFUND_INFO = 0x1C7E, + CMSG_ITEM_TEXT_QUERY = 0x4AEB, + CMSG_JOIN_CHANNEL = 0x3441, + CMSG_KEEP_ALIVE = 0xC87A, + CMSG_LEARN_PREVIEW_TALENTS = 0xDEE3, + CMSG_LEARN_PREVIEW_TALENTS_PET = 0x9AFB, + CMSG_LEARN_TALENT = 0x98F3, + CMSG_LEAVE_BATTLEFIELD = 0x1AE7, + CMSG_LEAVE_CHANNEL = 0x00, + CMSG_LFD_PARTY_LOCK_INFO_REQUEST = 0x00, + CMSG_LFG_GET_PLAYER_INFO = 0x00, + CMSG_LFG_JOIN = 0x00, + CMSG_LFG_LEAVE = 0x00, + CMSG_LFG_PROPOSAL_RESULT = 0x00, + SMSG_LFG_BOOT_PLAYER = 0x00, + CMSG_LFG_SET_ROLES = 0x4843, + CMSG_LFG_TELEPORT = 0x8C7A, + CMSG_LIST_INVENTORY = 0xDCFE, + CMSG_LOAD_SCREEN = 0x0888, + CMSG_LOG_DISCONNECT = 0x00, + CMSG_LOGOUT_CANCEL = 0xA76, + CMSG_LOGOUT_REQUEST = 0x4C7A, + CMSG_LOOT = 0x0A5E, + CMSG_LOOT_METHOD = 0x00, + CMSG_LOOT_MONEY = 0x00, + CMSG_LOOT_RELEASE = 0x4A6A, + CMSG_LOOT_ROLL = 0x00, + CMSG_MAIL_CREATE_TEXT_ITEM = 0x886E, + CMSG_MAIL_DELETE = 0x4CCF, + CMSG_MAIL_MARK_AS_READ = 0x00, + CMSG_MAIL_RETURN_TO_SENDER = 0x587E, + CMSG_MAIL_TAKE_ITEM = 0xCC2, + CMSG_MAIL_TAKE_MONEY = 0x4CD6, + CMSG_MEETINGSTONE_INFO = 0xCA5B, + CMSG_MESSAGECHAT_AFK = 0x00, + CMSG_MESSAGECHAT_BATTLEGROUND = 0x00, + CMSG_MESSAGECHAT_BATTLEGROUND_LEADER = 0x00, + CMSG_MESSAGECHAT_ADDON = 0x24D9, + CMSG_MESSAGECHAT_CHANNEL = 0x7459, + CMSG_MESSAGECHAT_DND = 0x00, + CMSG_MESSAGECHAT_EMOTE = 0x6449, + CMSG_MESSAGECHAT_GUILD = 0x60C1, + CMSG_MESSAGECHAT_OFFICER = 0x00, + CMSG_MESSAGECHAT_PARTY = 0x24C9, + CMSG_MESSAGECHAT_PARTY_LEADER = 0x00, + CMSG_MESSAGECHAT_RAID = 0x00, + CMSG_MESSAGECHAT_RAID_LEADER = 0x00, + CMSG_MESSAGECHAT_RAID_WARNING = 0x00, + CMSG_MESSAGECHAT_SAY = 0x2459, + CMSG_MESSAGECHAT_WHISPER = 0x70D9, + CMSG_MESSAGECHAT_YELL = 0x70C1, + CMSG_MINIGAME_MOVE = 0x00, + CMSG_MOUNTSPECIAL_ANIM = 0x00, + CMSG_MOVE_KNOCK_BACK_ACK = 0x00, + CMSG_MOVE_SET_RAW_POSITION = 0x00, + CMSG_MOVE_TIME_SKIPPED = 0x00, + CMSG_ENABLE_NAGLE = 0x00, + CMSG_NAME_QUERY = 0x586A, + CMSG_NEW_SPELL_SLOT = 0x00, + CMSG_NEXT_CINEMATIC_CAMERA = 0x8E63, + CMSG_NPC_TEXT_QUERY = 0x5C63, + CMSG_OFFER_PETITION = 0xC8DE, + CMSG_OPEN_ITEM = 0x88C7, + CMSG_OPENING_CINEMATIC = 0xD8D2, + CMSG_OPT_OUT_OF_LOOT = 0x00, + CMSG_PAGE_TEXT_QUERY = 0x8A5F, + CMSG_PETITION_BUY = 0x8E4E, + CMSG_PETITION_QUERY = 0xCEF3, + CMSG_PETITION_SHOWLIST = 0x00, + CMSG_PETITION_SHOW_SIGNATURES = 0x1E66, + CMSG_PETITION_SIGN = 0x4A5E, + CMSG_PET_ABANDON = 0x00, + CMSG_PET_ACTION = 0x1AEA, + CMSG_PET_CANCEL_AURA = 0x00, + CMSG_PET_CAST_SPELL = 0x00, + CMSG_PET_LEARN_TALENT = 0x48E6, + CMSG_PET_NAME_QUERY = 0xDA76, + CMSG_PET_RENAME = 0x00, + CMSG_PET_SET_ACTION = 0x00, + CMSG_PET_SPELL_AUTOCAST = 0x00, + CMSG_PET_STOP_ATTACK = 0x00, + CMSG_PING = 0x1008, + CMSG_PLAYER_DIFFICULTY_CHANGE = 0x00, + CMSG_PLAYED_TIME = 0x5A56, + CMSG_PLAYER_LOGIN = 0x0898, + CMSG_PLAYER_LOGOUT = 0x1CEE, + CMSG_PLAYER_VEHICLE_ENTER = 0x00, + CMSG_PLAY_DANCE = 0x5857, + CMSG_PUSHQUESTTOPARTY = 0xA47, + CMSG_QUERY_GUILD_REWARDS = 0x00, + CMSG_QUERY_GUILD_MAX_XP = 0x00, + CMSG_QUERY_GUILD_XP = 0x00, + CMSG_QUERY_TIME = 0x18FE, + CMSG_QUEST_QUERY = 0xCE7F, + CMSG_QUERY_QUESTS_COMPLETED = 0x98DF, + CMSG_QUESTLOG_SWAP_QUEST = 0x00, + CMSG_QUESTGIVER_ACCEPT_QUEST = 0x8CD3, + CMSG_QUESTGIVER_CANCEL = 0xC86A, + CMSG_QUESTGIVER_CHOOSE_REWARD = 0x18F3, + CMSG_QUESTGIVER_COMPLETE_QUEST = 0xCCE3, + CMSG_QUESTGIVER_HELLO = 0x00, + CMSG_QUESTGIVER_QUERY_QUEST = 0x8CE7, + CMSG_QUESTGIVER_QUEST_AUTOLAUNCH = 0x00, + CMSG_QUESTGIVER_REQUEST_REWARD = 0xD8E7, + CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY = 0xC8DB, + CMSG_QUESTGIVER_STATUS_QUERY = 0x88C6, + CMSG_QUESTLOG_REMOVE_QUEST = 0x8EFF, + CMSG_QUEST_POI_QUERY = 0x00, + CMSG_QUEST_CONFIRM_ACCEPT = 0xC63, + CMSG_RANDOMIZE_CHAR_NAME = 0x8A99, // byte unk, byte race + CMSG_READY_FOR_ACCOUNT_DATA_TIMES = 0xCCDB, + CMSG_READ_ITEM = 0x00, + CMSG_REALM_SPLIT = 0xDC66, + CMSG_RECLAIM_CORPSE = 0x88DB, + CMSG_REDIRECTION_AUTH_PROOF = 0x00, + CMSG_REPAIR_ITEM = 0xCF3, + CMSG_REPOP_REQUEST = 0x8872, + CMSG_REPORT_PVP_AFK = 0x00, + CMSG_REPLACE_ACCOUNT_DATA = 0x00, + CMSG_REQUEST_ACCOUNT_DATA = 0x00, + CMSG_REQUEST_CATEGORY_COOLDOWNS = 0x00, + CMSG_REQUEST_CEMETERY_LIST = 0x00, + CMSG_REQUEST_PARTY_MEMBER_STATS = 0x987E, + CMSG_REQUEST_PET_INFO = 0x9A47, + CMSG_REQUEST_PLAYER_VEHICLE_EXIT = 0xCC6, + CMSG_REQUEST_RATED_BG_INFO = 0x00, + CMSG_REQUEST_RAID_INFO = 0x00, + CMSG_REQUEST_VEHICLE_EXIT = 0xCC6. // New 4.x ? + CMSG_REQUEST_VEHICLE_NEXT_SEAT = 0xCAD6, + CMSG_REQUEST_VEHICLE_PREV_SEAT = 0x1AE2, CMSG_REQUEST_VEHICLE_SWITCH_SEAT = 0x01, // temp to fix switch case value error - CMSG_RESET_INSTANCES = 0x9EEA, // - CMSG_RESURRECT_RESPONSE = 0x00, // - CMSG_RETURN_TO_GRAVEYARD = 0x00, // - CMSG_SAVE_PLAYER = 0x00, // - CMSG_SEARCH_LFG_JOIN = 0x00, // - CMSG_SEARCH_LFG_LEAVE = 0x00, // - CMSG_SELF_RES = 0xCCFE, // - CMSG_SELL_ITEM = 0x5EE3, // - CMSG_SET_ACTIONBAR_TOGGLES = 0x584F, // - CMSG_SET_ACTION_BUTTON = 0x00, // - CMSG_SET_ACTIVE_MOVER = 0x00, // - CMSG_SET_ACTIVE_VOICE_CHANNEL = 0x00, // - CMSG_SET_ALLOW_LOW_LEVEL_RAID1 = 0xC863, // - CMSG_SET_ALLOW_LOW_LEVEL_RAID2 = 0x4CE7, // - CMSG_SET_CHANNEL_WATCH = 0x00, // - CMSG_SET_CONTACT_NOTES = 0x1AF3, // - CMSG_SET_FACTION_CHEAT = 0x00, // - CMSG_SET_GUILD_BANK_TEXT = 0x00, // - CMSG_SET_LFG_COMMENT = 0x00, // - CMSG_SET_PLAYER_DECLINED_NAMES = 0xC847, // - CMSG_SET_PRIMARY_TALENT_TREE = 0x185E, // - CMSG_SET_SAVED_INSTANCE_EXTEND = 0x8E62, // - CMSG_SET_SELECTION = 0x4C4E, // - CMSG_SET_SKILL_CHEAT = 0x00, // - CMSG_SET_TAXI_BENCHMARK_MODE = 0x1EFF, // - CMSG_SET_TITLE = 0x00, // - CMSG_SET_TRADE_GOLD = 0x00, // - CMSG_SET_TRADE_ITEM = 0x00, // - CMSG_SETDEATHBINDPOINT = 0x00, // - CMSG_SETSHEATHED = 0xCA5F, // - CMSG_SHOWING_CLOAK = 0x8AE3, // - CMSG_SHOWING_HELM = 0xCEFA, // - CMSG_SERVERTIME = 0x00, // - CMSG_SOCKET_GEMS = 0x00, // - CMSG_SPIRIT_HEALER_ACTIVATE = 0x5AEB, // - CMSG_SPELLCLICK = 0xC8F2, // - CMSG_SPLIT_ITEM = 0x00, // - CMSG_STANDSTATECHANGE = 0x9EC6, // - CMSG_START_QUEST = 0x00, // - CMSG_STOP_DANCE = 0x00, // - CMSG_STORE_LOOT_IN_SLOT = 0x00, // - CMSG_SUMMON_RESPONSE = 0xD84E, // - CMSG_SWAP_ITEM = 0xDED6, // - CMSG_SWAP_INV_ITEM = 0x5CE7, // - CMSG_TELEPORT_TO_UNIT = 0x8C72, // - CMSG_TEXT_EMOTE = 0x00, // - CMSG_TIME_SYNC_RESP = 0x07A5, // - CMSG_TAXICLEARALLNODES = 0x00, // - CMSG_TAXIENABLEALLNODES = 0x00, // - CMSG_TAXINODE_STATUS_QUERY = 0x98E3, // - CMSG_TAXIQUERYAVAILABLENODES = 0x00, // - CMSG_TAXISHOWNODES = 0x00, // - CMSG_TOGGLE_PVP = 0x8ECA, // - CMSG_TOTEM_DESTROYED = 0x00, // - SMSG_TRAINER_BUY_SUCCEEDED = 0xAF7, // - CMSG_TRAINER_LIST = 0xCC7F, // - CMSG_TRIGGER_CINEMATIC_CHEAT = 0x00, // - CMSG_TURN_IN_PETITION = 0x9C67, // - CMSG_TUTORIAL_CLEAR = 0x00, // - CMSG_TUTORIAL_FLAG = 0x00, // - CMSG_TUTORIAL_RESET = 0x00, // - CMSG_UNACCEPT_TRADE = 0x00, // - CMSG_UNLEARN_SKILL = 0xAC3, // - CMSG_UNREGISTER_ALL_ADDON_PREFIXES = 0x00, // - CMSG_UNUSED2 = 0x00, // - CMSG_UPDATE_ACCOUNT_DATA = 0x4AFE, // - CMSG_USE_ITEM = 0x00, // - CMSG_VOICE_SESSION_ENABLE = 0x00, // - CMSG_VIOLENCE_LEVEL = 0x00, // - CMSG_WARDEN_DATA = 0x5847, // - CMSG_WHO = 0x9AD7, // - CMSG_WHOIS = 0xCCE6, // - CMSG_WORLD_STATE_UI_TIMER_UPDATE = 0x58F6, // - CMSG_WORLD_TELEPORT = 0x00, // - CMSG_WRAP_ITEM = 0x00, // - CMSG_ZONEUPDATE = 0x00, // - MSG_AUCTION_HELLO = 0x00, // - MSG_CHANNEL_START = 0x00, // - MSG_CHANNEL_UPDATE = 0x00, // - MSG_CORPSE_QUERY = 0x00, // - MSG_GM_BIND_OTHER = 0x00, // - MSG_GM_SHOWLABEL = 0x00, // - MSG_GM_SUMMON = 0x00, // - MSG_GUILD_BANK_LOG_QUERY = 0x00, // - MSG_GUILD_BANK_MONEY_WITHDRAWN = 0xDE77, // - MSG_GUILD_EVENT_LOG_QUERY = 0x00, // - MSG_GUILD_PERMISSIONS = 0x00, // - MSG_INSPECT_ARENA_TEAMS = 0x00, // - MSG_LIST_STABLED_PETS = 0x88CA, // - MSG_MINIMAP_PING = 0x00, // - MSG_MOVE_FALL_LAND = 0x00, // - MSG_MOVE_HEARTBEAT = 0x00, // - MSG_MOVE_HOVER = 0x00, // - MSG_MOVE_JUMP = 0xE4E, // - MSG_MOVE_KNOCK_BACK = 0x00, // - MSG_MOVE_ROOT = 0x00, // - MSG_MOVE_SET_ALL_SPEED_CHEAT = 0x00, // - MSG_MOVE_SET_FACING = 0x00, // - MSG_MOVE_SET_FLIGHT_BACK_SPEED = 0x00, // - MSG_MOVE_SET_FLIGHT_BACK_SPEED_CHEAT = 0x00, // - MSG_MOVE_SET_FLIGHT_SPEED = 0x00, // - MSG_MOVE_SET_FLIGHT_SPEED_CHEAT = 0x00, // - MSG_MOVE_SET_PITCH = 0x00, // - MSG_MOVE_SET_PITCH_RATE = 0x00, // - MSG_MOVE_SET_RAW_POSITION_ACK = 0x00, // - MSG_MOVE_SET_RUN_BACK_SPEED = 0x00, // - MSG_MOVE_SET_RUN_BACK_SPEED_CHEAT = 0x00, // - MSG_MOVE_SET_RUN_MODE = 0x00, // - MSG_MOVE_SET_RUN_SPEED_CHEAT = 0x00, // - MSG_MOVE_SET_RUN_SPEED = 0x00, // - MSG_MOVE_SET_SWIM_BACK_SPEED = 0x00, // - MSG_MOVE_SET_SWIM_BACK_SPEED_CHEAT = 0x00, // - MSG_MOVE_SET_SWIM_SPEED = 0x00, // - MSG_MOVE_SET_SWIM_SPEED_CHEAT = 0x00, // - MSG_MOVE_SET_TURN_RATE = 0x00, // - MSG_MOVE_SET_TURN_RATE_CHEAT = 0x00, // - MSG_MOVE_SET_WALK_MODE = 0x00, // - MSG_MOVE_SET_WALK_SPEED = 0x00, // - MSG_MOVE_SET_WALK_SPEED_CHEAT = 0x00, // - MSG_MOVE_START_ASCEND = 0x00, // - MSG_MOVE_START_DESCEND = 0x00, // - MSG_MOVE_STOP_ASCEND = 0x00, // - MSG_MOVE_START_BACKWARD = 0x00, // - MSG_MOVE_START_FORWARD = 0x00, // - MSG_MOVE_START_PITCH_UP = 0x00, // - MSG_MOVE_START_PITCH_DOWN = 0x00, // - MSG_MOVE_START_TURN_LEFT = 0x00, // - MSG_MOVE_START_TURN_RIGHT = 0x00, // - MSG_MOVE_START_STRAFE_LEFT = 0x00, // - MSG_MOVE_START_STRAFE_RIGHT = 0x00, // - MSG_MOVE_START_SWIM = 0x00, // - MSG_MOVE_STOP = 0x00, // - MSG_MOVE_STOP_PITCH = 0x00, // - MSG_MOVE_STOP_TURN = 0x00, // - MSG_MOVE_STOP_STRAFE = 0x00, // - MSG_MOVE_STOP_SWIM = 0x00, // - MSG_MOVE_TOGGLE_LOGGING = 0x00, // - MSG_MOVE_TIME_SKIPPED = 0x00, // - MSG_MOVE_TELEPORT = 0x00, // - MSG_MOVE_TELEPORT_ACK = 0x00, // - MSG_MOVE_TELEPORT_CHEAT = 0x00, // - MSG_MOVE_TOGGLE_COLLISION_CHEAT = 0x00, // - MSG_MOVE_TOGGLE_FALL_LOGGING = 0x00, // - MSG_MOVE_UNROOT = 0x00, // - MSG_MOVE_WORLDPORT_ACK = 0x00, // - MSG_NOTIFY_PARTY_SQUELCH = 0x00, // - MSG_PARTY_ASSIGNMENT = 0x00, // - MSG_PETITION_DECLINE = 0x98E7, // - MSG_PETITION_RENAME = 0x4857, // - MSG_PVP_LOG_DATA = 0x00, // - MSG_QUERY_GUILD_BANK_TEXT = 0x00, // - MSG_QUERY_NEXT_MAIL_TIME = 0x00, // - MSG_QUEST_PUSH_RESULT = 0x1863, // - MSG_RAID_READY_CHECK = 0x584E, // - MSG_RAID_READY_CHECK_CONFIRM = 0x584E, // - MSG_RAID_READY_CHECK_FINISHED = 0x00, // - MSG_RAID_TARGET_UPDATE = 0x00, // - MSG_RANDOM_ROLL = 0x4C57, // - MSG_SAVE_GUILD_EMBLEM = 0x00, // - MSG_SET_DUNGEON_DIFFICULTY = 0xC4F, // - MSG_SET_RAID_DIFFICULTY = 0x1A5A, // - MSG_TABARDVENDOR_ACTIVATE = 0x98EB, // - MSG_TALENT_WIPE_CONFIRM = 0x00, // - OBSOLETE_DROP_ITEM = 0x00, // - SMSG_ACCOUNT_DATA_TIMES = 0x5EE2, // - SMSG_ACHIEVEMENT_DELETED = 0x00, // - SMSG_ACHIEVEMENT_EARNED = 0x00, // - SMSG_ACTION_BUTTONS = 0x00, // - SMSG_ACTIVATETAXIREPLY = 0x8E4F, // - SMSG_ADDON_INFO = 0x9863, // - SMSG_ADD_RUNE_POWER = 0x00, // - SMSG_AI_REACTION = 0x00, // - SMSG_ALL_ACHIEVEMENT_DATA = 0x00, // - SMSG_AREA_SPIRIT_HEALER_TIME = 0x00, // - SMSG_AREA_TRIGGER_MESSAGE = 0x00, // - SMSG_ARENA_ERROR = 0x00, // - SMSG_ARENA_OPPONENT_UPDATE = 0x00, // - SMSG_ARENA_TEAM_CHANGE_FAILED_QUEUED = 0x4A4E, // - SMSG_ARENA_TEAM_COMMAND_RESULT = 0x00, // - SMSG_ARENA_TEAM_EVENT = 0x00, // - SMSG_ARENA_TEAM_INVITE = 0x00, // - SMSG_ARENA_TEAM_QUERY_RESPONSE = 0x00, // - SMSG_ARENA_TEAM_ROSTER = 0x00, // - SMSG_ARENA_TEAM_STATS = 0x00, // - SMSG_ATTACKERSTATEUPDATE = 0x00, // - SMSG_ATTACKSTART = 0x00, // - SMSG_ATTACKSTOP = 0x00, // - SMSG_ATTACKSWING_BADFACING = 0x00, // - SMSG_ATTACKSWING_CANT_ATTACK = 0x00, // - SMSG_ATTACKSWING_DEADTARGET = 0x00, // - SMSG_ATTACKSWING_NOTINRANGE = 0x00, // - SMSG_AUCTION_BIDDER_LIST_RESULT = 0x00, // - SMSG_AUCTION_BIDDER_NOTIFICATION = 0x00, // - SMSG_AUCTION_COMMAND_RESULT = 0x00, // - SMSG_AUCTION_LIST_PENDING_SALES = 0x00, // - SMSG_AUCTION_LIST_RESULT = 0x00, // - SMSG_AUCTION_OWNER_LIST_RESULT = 0x00, // - SMSG_AUCTION_OWNER_NOTIFICATION = 0x00, // - SMSG_AUCTION_REMOVED_NOTIFICATION = 0x00, // - SMSG_AURA_UPDATE = 0x4C66, // - SMSG_AURA_UPDATE_ALL = 0x18EE, // - SMSG_AURACASTLOG = 0x00, // - SMSG_AUTH_CHALLENGE = 0x1181, // - SMSG_AUTH_RESPONSE = 0x8867, // - SMSG_AVAILABLE_VOICE_CHANNEL = 0x00, // - SMSG_BARBER_SHOP_RESULT = 0x00, // - SMSG_BATTLEFIELD_LIST = 0x00, // - SMSG_BATTLEFIELD_MGR_EJECTED = 0x00, // - SMSG_BATTLEFIELD_MGR_EJECT_PENDING = 0x00, // - SMSG_BATTLEFIELD_MGR_ENTERED = 0x00, // - SMSG_BATTLEFIELD_MGR_ENTRY_INVITE = 0x00, // - SMSG_BATTLEFIELD_MGR_QUEUE_INVITE = 0x00, // - SMSG_BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE = 0x00, // - SMSG_BATTLEFIELD_MGR_STATE_CHANGE = 0x00, // - SMSG_BATTLEFIELD_PORT_DENIED = 0x00, // - SMSG_BATTLEFIELD_STATUS1 = 0x00, // - SMSG_BATTLEFIELD_STATUS2 = 0x00, // - SMSG_BATTLEFIELD_STATUS3 = 0x00, // - SMSG_BATTLEFIELD_STATUS4 = 0x00, // - SMSG_BATTLEGROUND_INFO_THROTTLED = 0x00, // - SMSG_BATTLEGROUND_PLAYER_JOINED = 0x00, // - SMSG_BATTLEGROUND_PLAYER_POSITIONS = 0x00, // - SMSG_BINDPOINTUPDATE = 0x00, // - SMSG_BINDZONEREPLY = 0x00, // - SMSG_BINDER_CONFIRM = 0x00, // - SMSG_BREAK_TARGET = 0x00, // - SMSG_BUY_BANK_SLOT_RESULT = 0x00, // - SMSG_BUY_ITEM = 0x00, // - SMSG_BUY_FAILED = 0x00, // - SMSG_CALENDAR_COMMAND_RESULT = 0x00, // - SMSG_CALENDAR_SEND_NUM_PENDING = 0x00, // - SMSG_CALENDAR_SEND_CALENDAR = 0x00, // - SMSG_CANCEL_AUTO_REPEAT = 0x00, // - SMSG_CANCEL_COMBAT = 0x00, // - SMSG_CAST_FAILED = 0x00, // - SMSG_CHANNEL_LIST = 0x00, // - SMSG_CHANNEL_MEMBER_COUNT = 0x00, // - SMSG_CHANNEL_NOTIFY = 0x9C7F, // - SMSG_CHAR_CREATE = 19547, // - SMSG_CHAR_DELETE = 0x48CE, // - SMSG_CHAR_ENUM = 0xA05C, // - SMSG_CHARACTER_LOGIN_FAILED = 0x00, // - SMSG_CHAR_RENAME = 0x00, // - SMSG_CHAR_CUSTOMIZE = 0x00, // - SMSG_CHAR_FACTION_CHANGE = 0x00, // - SMSG_CHAT_PLAYER_AMBIGUOUS = 0x00, // - SMSG_CHAT_PLAYER_NOT_FOUND = 0x00, // - SMSG_CHAT_RESTRICTED = 0x00, // - SMSG_CHAT_WRONG_FACTION = 0xE66, // - SMSG_CHECK_FOR_BOTS = 0x00, // - SMSG_CLEAR_COOLDOWN = 0x00, // - SMSG_CLEAR_TARGET = 0x00, // - SMSG_CLIENTCACHE_VERSION = 0x88F2, // - SMSG_CLIENT_CONTROL_UPDATE = 0x00, // - SMSG_COMBAT_LOG_MULTIPLE = 0x00, // - SMSG_COMMENTATOR_MAP_INFO = 0x00, // - SMSG_COMMENTATOR_PLAYER_INFO = 0x00, // - SMSG_COMMENTATOR_STATE_CHANGED = 0x00, // - SMSG_COMPLAIN_RESULT = 0x00, // - SMSG_COMPRESSED_MOVES = 0x00, // - SMSG_COMPRESSED_UPDATE_OBJECT = 0x1CC3, // - SMSG_CONTACT_LIST = 0x00, // - SMSG_CONVERT_RUNE = 0x00, // - SMSG_COOLDOWN_CHEAT = 0x00, // - SMSG_COOLDOWN_EVENT = 0x00, // - SMSG_CORPSE_NOT_IN_INSTANCE = 0x00, // - SMSG_CORPSE_RECLAIM_DELAY = 0x00, // - SMSG_CORPSE_MAP_POSITION_QUERY_RESPONSE = 0x00, // - SMSG_CREATURE_QUERY_RESPONSE = 0xD847, // - SMSG_CRITERIA_DELETED = 0x00, // - SMSG_CRITERIA_UPDATE = 0x00, // - SMSG_CROSSED_INEBRIATION_THRESHOLD = 0x00, // - SMSG_DAMAGE_CALC_LOG = 0x00, // - SMSG_DAMAGE_DONE_OBSOLETE = 0x00, // - SMSG_DANCE_QUERY_RESPONSE = 0x00, // - SMSG_DB_REPLY = 0x76EC, // - SMSG_DEATH_RELEASE_LOC = 0x00, // - SMSG_DEFENSE_MESSAGE = 0x00, // - SMSG_DESTROY_OBJECT = 0x486B, // - SMSG_DESTRUCTIBLE_BUILDING_DAMAGE = 0x00, // - SMSG_DUEL_OUTOFBOUNDS = 0x00, // - SMSG_DUEL_INBOUNDS = 0x00, // - SMSG_DISMOUNT = 0x00, // - SMSG_DISMOUNTRESULT = 0x00, // - SMSG_DISPEL_FAILED = 0x00, // - SMSG_DUEL_COMPLETE = 0x00, // - SMSG_DUEL_COUNTDOWN = 0x00, // - SMSG_DUEL_REQUESTED = 0x00, // - SMSG_DUEL_WINNER = 0x00, // - SMSG_DURABILITY_DAMAGE_DEATH = 0x00, // - SMSG_ECHO_PARTY_SQUELCH = 0x00, // - SMSG_EMOTE = 0xC67, // - SMSG_ENABLE_BARBER_SHOP = 0x00, // - SMSG_ENCHANTMENTLOG = 0x00, // - SMSG_ENVIRONMENTALDAMAGELOG = 0x00, // - SMSG_EQUIPMENT_SET_LIST = 0x18DF, // - SMSG_EQUIPMENT_SET_SAVED = 0x00, // - SMSG_EQUIPMENT_SET_USE_RESULT = 0x00, // - SMSG_EXPECTED_SPAM_RECORDS = 0x00, // - SMSG_EXPLORATION_EXPERIENCE = 0x00, // - SMSG_FEATURE_SYSTEM_STATUS = 0x00, // - SMSG_FISH_ESCAPED = 0x9C66, // - SMSG_FISH_NOT_HOOKED = 0x18C3, // - SMSG_FORCEACTIONSHOW = 0x00, // - SMSG_FORCED_DEATH_UPDATE = 0x00, // - SMSG_FORCE_DISPLAY_UPDATE = 0x00, // - SMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE = 0x00, // - SMSG_FORCE_FLIGHT_SPEED_CHANGE = 0x00, // - SMSG_FORCE_MOVE_ROOT = 0x00, // - SMSG_FORCE_MOVE_UNROOT = 0x00, // - SMSG_FORCE_PITCH_RATE_CHANGE = 0x00, // - SMSG_FORCE_RUN_BACK_SPEED_CHANGE = 0x00, // - SMSG_FORCE_RUN_SPEED_CHANGE = 0x00, // - SMSG_FORCE_SEND_QUEUED_PACKETS = 0x00, // - SMSG_FORCE_TURN_RATE_CHANGE = 0x00, // - SMSG_FORCE_SWIM_SPEED_CHANGE = 0x00, // - SMSG_FORCE_SWIM_BACK_SPEED_CHANGE = 0x00, // - SMSG_FORCE_WALK_SPEED_CHANGE = 0x00, // - SMSG_FRIEND_STATUS = 0x00, // - SMSG_GAMEOBJECT_CUSTOM_ANIM = 0x00, // - SMSG_GAMEOBJECT_DESPAWN_ANIM = 0x00, // - SMSG_GAMEOBJECT_PAGETEXT = 0x00, // - SMSG_GAMEOBJECT_QUERY_RESPONSE = 0xCCF7, // - SMSG_GAMEOBJECT_RESET_STATE = 0x00, // - SMSG_GAMESPEED_SET = 0x00, // - SMSG_GAMETIME_SET = 0x00, // - SMSG_GAMETIME_UPDATE = 0x00, // - SMSG_GMRESPONSE_STATUS_UPDATE = 0x00, // - SMSG_GMRESPONSE_RECEIVED = 0x00, // - SMSG_GMTICKET_DELETETICKET = 0x00, // - SMSG_GMTICKET_GETTICKET = 0x00, // - SMSG_GM_MESSAGECHAT = 0x00, // - SMSG_GMTICKET_CREATE = 0x00, // - SMSG_GMTICKET_SYSTEMSTATUS = 0x9C7E, // - SMSG_GMTICKET_UPDATETEXT = 0x00, // - SMSG_GODMODE = 0xDEEE, // - SMSG_GOSSIP_COMPLETE = 0x00, // - SMSG_GOSSIP_MESSAGE = 0xCCEB, // - SMSG_GOSSIP_POI = 0x00, // - SMSG_GROUP_CANCEL = 0x00, // - SMSG_GROUP_DECLINE = 0x00, // - SMSG_GROUP_DESTROYED = 0x00, // - SMSG_GROUP_INVITE = 0x00, // - SMSG_GROUP_JOINED_BATTLEGROUND = 0x00, // - SMSG_GROUP_LIST = 0x00, // - SMSG_GROUP_SET_LEADER = 0x00, // - SMSG_GROUP_UNINVITE = 0x00, // - SMSG_GUILD_BANK_LIST = 0x5EFB, // - SMSG_GUILD_COMMAND_RESULT = 0xDAD7, // - SMSG_GUILD_DECLINE = 0x00, // - SMSG_GUILD_EVENT = 0x8AC2, // - SMSG_GUILD_INFO = 0x00, // - SMSG_GUILD_INVITE = 0x00, // - SMSG_GUILD_MAX_DAILY_XP = 0x00, // - SMSG_GUILD_NEWS_UPDATE = 0x00, // - SMSG_GUILD_QUERY_RESPONSE = 0xCA66, // - SMSG_GUILD_RANK = 0xA6EC, // - SMSG_GUILD_RANKS_UPDATE = 0x00, // - SMSG_GUILD_REWARDS_LIST = 0x00, // - SMSG_GUILD_ROSTER = 0x00, // - SMSG_GUILD_TRADESKILL_UPDATE = 0x00, // - SMSG_GUILD_UPDATE_ROSTER = 0x00, // - SMSG_GUILD_XP_UPDATE = 0x00, // - SMSG_HIGHEST_THREAT_UPDATE = 0x00, // - SMSG_INITIALIZE_FACTIONS = 0x00, // - SMSG_INITIAL_SPELLS = 0x00, // - SMSG_INIT_CURRENCY = 0x227E, // - SMSG_INIT_WORLD_STATES = 0x9EDA, // - SMSG_INSPECT = 0x00, // - SMSG_INSPECT_HONOR_STATS = 0x00, // - SMSG_INSPECT_TALENT = 0x00, // - SMSG_INSTANCE_DIFFICULTY = 0x00, // - SMSG_INSTANCE_LOCK_WARNING_QUERY = 0x00, // - SMSG_INSTANCE_RESET = 0x00, // - SMSG_INSTANCE_RESET_FAILED = 0x00, // - SMSG_INSTANCE_SAVE_CREATED = 0x00, // - SMSG_INVALID_PROMOTION_CODE = 0x00, // - SMSG_INVALIDATE_DANCE = 0x00, // - SMSG_INVALIDATE_PLAYER = 0x00, // - SMSG_INVENTORY_CHANGE_FAILURE = 0x00, // - SMSG_ITEM_COOLDOWN = 0x00, // - SMSG_ITEM_ENCHANT_TIME_UPDATE = 0x00, // - SMSG_ITEM_NAME_QUERY_RESPONSE = 0x00, // - SMSG_ITEM_PUSH_RESULT = 0x8EFB, // - SMSG_ITEM_QUERY_MULTIPLE_RESPONSE = 0x00, // - SMSG_ITEM_QUERY_SINGLE_RESPONSE = 0x00, // - SMSG_ITEM_REFUND_INFO_RESPONSE = 0x00, // - SMSG_ITEM_REFUND_RESULT = 0x00, // - SMSG_ITEM_TEXT_QUERY_RESPONSE = 0x00, // - SMSG_ITEM_TIME_UPDATE = 0x00, // - SMSG_JOINED_BATTLEGROUND_QUEUE = 0x00, // - SMSG_LEARNED_DANCE_MOVES = 0x00, // - SMSG_LEARNED_SPELL = 0x00, // - SMSG_LEVELUP_INFO = 0x00, // - SMSG_LFG_DISABLED = 0x00, // - SMSG_LFG_JOIN_RESULT = 0x00, // - SMSG_LFG_OFFER_CONTINUE = 0x00, // - SMSG_LFG_OPEN_FROM_GOSSIP = 0x00, // - SMSG_LFG_PARTY_INFO = 0x00, // - SMSG_LFG_PLAYER_INFO = 0x00, // - SMSG_LFG_PLAYER_REWARD = 0x00, // - SMSG_LFG_PROPOSAL_UPDATE = 0x00, // - SMSG_LFG_QUEUE_STATUS = 0x00, // - SMSG_LFG_ROLE_CHECK_UPDATE = 0x00, // - SMSG_LFG_ROLE_CHOSEN = 0x00, // - SMSG_LFG_TELEPORT_DENIED = 0x00, // - SMSG_LFG_UPDATE_SEARCH = 0x00, // - SMSG_LFG_UPDATE_PARTY = 0x00, // - SMSG_LFG_UPDATE_PLAYER = 0x00, // - SMSG_LIST_INVENTORY = 0x264C, // - SMSG_LOGIN_SETTIMESPEED = 0x00, // - SMSG_LOGIN_VERIFY_WORLD = 0xC86E, // - SMSG_LOGOUT_CANCEL_ACK = 0x00, // - SMSG_LOGOUT_COMPLETE = 0xCC6B, // - SMSG_LOGOUT_RESPONSE = 0x886A, // - SMSG_LOG_XPGAIN = 0x00, // - SMSG_LOOT_ALL_PASSED = 0x00, // - SMSG_LOOT_CLEAR_MONEY = 0x00, // - SMSG_LOOT_ITEM_NOTIFY = 0x00, // - SMSG_LOOT_LIST = 0x00, // - SMSG_LOOT_MASTER_LIST = 0x00, // - SMSG_LOOT_MONEY_NOTIFY = 0x00, // - SMSG_LOOT_RELEASE_RESPONSE = 0x00, // - SMSG_LOOT_REMOVED = 0x00, // - SMSG_LOOT_RESPONSE = 0x0842, // - SMSG_LOOT_ROLL = 0x00, // - SMSG_LOOT_ROLL_WON = 0x00, // - SMSG_LOOT_SLOT_CHANGED = 0x00, // - SMSG_LOOT_START_ROLL = 0x00, // - SMSG_MAIL_LIST_RESULT = 0x00, // - SMSG_MEETINGSTONE_COMPLETE = 0x00, // - SMSG_MEETINGSTONE_IN_PROGRESS = 0x00, // - SMSG_MEETINGSTONE_MEMBER_ADDED = 0x00, // - SMSG_MEETINGSTONE_SETQUEUE = 0x00, // - SMSG_MESSAGECHAT = 0x5E52, // - SMSG_MIRRORIMAGE_DATA = 0x00, // - SMSG_MODIFY_COOLDOWN = 0x00, // - SMSG_MONSTER_MOVE = 0x4C53, // - SMSG_MONSTER_MOVE_TRANSPORT = 0x88FB, // - SMSG_MOTD = 0xCA4B, // - SMSG_MOUNTSPECIAL_ANIM = 0x00, // - SMSG_MOUNTRESULT = 0x00, // - SMSG_MOVE_FEATHER_FALL = 0x00, // - SMSG_MOVE_NORMAL_FALL = 0x00, // - SMSG_MOVE_SET_CAN_FLY = 0x00, // - SMSG_MOVE_SET_HOVER = 0x00, // - SMSG_MOVE_UNSET_CAN_FLY = 0x00, // - SMSG_MOVE_UNSET_HOVER = 0x00, // - SMSG_MOVE_WATER_WALK = 0x00, // - SMSG_MOVE_LAND_WALK = 0x00, // - CMSG_MOVE_HOVER_ACK = 0x00, // - SMSG_MOVE_KNOCK_BACK = 0x00, // - SMSG_MOVE_SET_WALK_IN_AIR = 0x00, // - SMSG_MOVE_UNSET_WALK_IN_AIR = 0x00, // - SMSG_MULTIPLE_PACKETS = 0x00, // - SMSG_NAME_QUERY_RESPONSE = 0x9CE6, // + CMSG_RESET_INSTANCES = 0x9EEA, + CMSG_RESURRECT_RESPONSE = 0x00, + CMSG_RETURN_TO_GRAVEYARD = 0x91A4, + CMSG_SAVE_PLAYER = 0x00, + CMSG_SEARCH_LFG_JOIN = 0x00, + CMSG_SEARCH_LFG_LEAVE = 0x00, + CMSG_SELF_RES = 0xCCFE, + CMSG_SELL_ITEM = 0x5EE3, + CMSG_SET_ACTIONBAR_TOGGLES = 0x584F, + CMSG_SET_ACTION_BUTTON = 0x00, + CMSG_SET_ACTIVE_MOVER = 0x00, + CMSG_SET_ACTIVE_VOICE_CHANNEL = 0x00, + CMSG_SET_ALLOW_LOW_LEVEL_RAID1 = 0xC863, + CMSG_SET_ALLOW_LOW_LEVEL_RAID2 = 0x4CE7, + CMSG_SET_CHANNEL_WATCH = 0x00, + CMSG_SET_CONTACT_NOTES = 0x1AF3, + CMSG_SET_FACTION_CHEAT = 0x00, + CMSG_SET_GUILD_BANK_TEXT = 0x00, + CMSG_SET_LFG_COMMENT = 0x00, + CMSG_SET_PLAYER_DECLINED_NAMES = 0xC847, + CMSG_SET_PRIMARY_TALENT_TREE = 0x185E, + CMSG_SET_SAVED_INSTANCE_EXTEND = 0x8E62, + CMSG_SET_SELECTION = 0x4C4E, + CMSG_SET_SKILL_CHEAT = 0x00, + CMSG_SET_TAXI_BENCHMARK_MODE = 0x1EFF, + CMSG_SET_TITLE = 0x00, + CMSG_SET_TRADE_GOLD = 0x00, + CMSG_SET_TRADE_ITEM = 0x00, + CMSG_SETDEATHBINDPOINT = 0x00, + CMSG_SETSHEATHED = 0xCA5F, + CMSG_SHOWING_CLOAK = 0x8AE3, + CMSG_SHOWING_HELM = 0xCEFA, + CMSG_SERVERTIME = 0x00, + CMSG_SOCKET_GEMS = 0x00, + CMSG_SPIRIT_HEALER_ACTIVATE = 0x5AEB, + CMSG_SPELLCLICK = 0xC8F2, + CMSG_SPLIT_ITEM = 0x00, + CMSG_STANDSTATECHANGE = 0x9EC6, + CMSG_START_QUEST = 0x00, + CMSG_STOP_DANCE = 0x00, + CMSG_STORE_LOOT_IN_SLOT = 0x00, + CMSG_SUMMON_RESPONSE = 0xD84E, + CMSG_SWAP_ITEM = 0xDED6, + CMSG_SWAP_INV_ITEM = 0x5CE7, + CMSG_TELEPORT_TO_UNIT = 0x8C72, + CMSG_TEXT_EMOTE = 0x00, + CMSG_TIME_SYNC_RESP = 0x07A5, + CMSG_TAXICLEARALLNODES = 0x00, + CMSG_TAXIENABLEALLNODES = 0x00, + CMSG_TAXINODE_STATUS_QUERY = 0x98E3, + CMSG_TAXIQUERYAVAILABLENODES = 0x00, + CMSG_TAXISHOWNODES = 0x00, + CMSG_TOGGLE_PVP = 0x8ECA, + CMSG_TOTEM_DESTROYED = 0x00, + CMSG_TRAINER_BUY_SUCCEEDED = 0xAF7, + CMSG_TRAINER_LIST = 0xCC7F, + CMSG_TRIGGER_CINEMATIC_CHEAT = 0x00, + CMSG_TURN_IN_PETITION = 0x9C67, + CMSG_TUTORIAL_CLEAR = 0x00, + CMSG_TUTORIAL_FLAG = 0x00, + CMSG_TUTORIAL_RESET = 0x00, + CMSG_UNACCEPT_TRADE = 0x00, + CMSG_UNLEARN_SKILL = 0xAC3, + CMSG_UNREGISTER_ALL_ADDON_PREFIXES = 0x00, + CMSG_UNUSED2 = 0x00, + CMSG_UPDATE_ACCOUNT_DATA = 0x4AFE, + CMSG_USE_ITEM = 0x00, + CMSG_VOICE_SESSION_ENABLE = 0x00, + CMSG_VIOLENCE_LEVEL = 0x00, + CMSG_WARDEN_DATA = 0x5847, + CMSG_WHO = 0x9AD7, + CMSG_WHOIS = 0xCCE6, + CMSG_WORLD_STATE_UI_TIMER_UPDATE = 0x58F6, + CMSG_WORLD_TELEPORT = 0x00, + CMSG_WRAP_ITEM = 0x00, + CMSG_ZONEUPDATE = 0x00, + MSG_AUCTION_HELLO = 0x00, + MSG_CHANNEL_START = 0x00, + MSG_CHANNEL_UPDATE = 0x00, + MSG_CORPSE_QUERY = 0x00, + MSG_GM_BIND_OTHER = 0x00, + MSG_GM_SHOWLABEL = 0x00, + MSG_GM_SUMMON = 0x00, + MSG_GUILD_BANK_LOG_QUERY = 0x00, + MSG_GUILD_BANK_MONEY_WITHDRAWN = 0xDE77, + MSG_GUILD_EVENT_LOG_QUERY = 0x00, + MSG_GUILD_PERMISSIONS = 0x00, + MSG_INSPECT_ARENA_TEAMS = 0x00, + MSG_LIST_STABLED_PETS = 0x88CA, + MSG_MINIMAP_PING = 0x00, + MSG_MOVE_FALL_LAND = 0x00, + MSG_MOVE_HEARTBEAT = 0x00, + MSG_MOVE_HOVER = 0x00, + MSG_MOVE_JUMP = 0xE4E, + MSG_MOVE_KNOCK_BACK = 0x00, + MSG_MOVE_ROOT = 0x00, + MSG_MOVE_SET_ALL_SPEED_CHEAT = 0x00, + MSG_MOVE_SET_FACING = 0x00, + MSG_MOVE_SET_FLIGHT_BACK_SPEED = 0x00, + MSG_MOVE_SET_FLIGHT_BACK_SPEED_CHEAT = 0x00, + MSG_MOVE_SET_FLIGHT_SPEED = 0x00, + MSG_MOVE_SET_FLIGHT_SPEED_CHEAT = 0x00, + MSG_MOVE_SET_PITCH = 0x00, + MSG_MOVE_SET_PITCH_RATE = 0x00, + MSG_MOVE_SET_RAW_POSITION_ACK = 0x00, + MSG_MOVE_SET_RUN_BACK_SPEED = 0x00, + MSG_MOVE_SET_RUN_BACK_SPEED_CHEAT = 0x00, + MSG_MOVE_SET_RUN_MODE = 0x00, + MSG_MOVE_SET_RUN_SPEED_CHEAT = 0x00, + MSG_MOVE_SET_RUN_SPEED = 0x00, + MSG_MOVE_SET_SWIM_BACK_SPEED = 0x00, + MSG_MOVE_SET_SWIM_BACK_SPEED_CHEAT = 0x00, + MSG_MOVE_SET_SWIM_SPEED = 0x00, + MSG_MOVE_SET_SWIM_SPEED_CHEAT = 0x00, + MSG_MOVE_SET_TURN_RATE = 0x00, + MSG_MOVE_SET_TURN_RATE_CHEAT = 0x00, + MSG_MOVE_SET_WALK_MODE = 0x00, + MSG_MOVE_SET_WALK_SPEED = 0x00, + MSG_MOVE_SET_WALK_SPEED_CHEAT = 0x00, + MSG_MOVE_START_ASCEND = 0x00, + MSG_MOVE_START_DESCEND = 0x00, + MSG_MOVE_STOP_ASCEND = 0x00, + MSG_MOVE_START_BACKWARD = 0x00, + MSG_MOVE_START_FORWARD = 0x00, + MSG_MOVE_START_PITCH_UP = 0x00, + MSG_MOVE_START_PITCH_DOWN = 0x00, + MSG_MOVE_START_TURN_LEFT = 0x00, + MSG_MOVE_START_TURN_RIGHT = 0x00, + MSG_MOVE_START_STRAFE_LEFT = 0x00, + MSG_MOVE_START_STRAFE_RIGHT = 0x00, + MSG_MOVE_START_SWIM = 0x00, + MSG_MOVE_STOP = 0x00, + MSG_MOVE_STOP_PITCH = 0x00, + MSG_MOVE_STOP_TURN = 0x00, + MSG_MOVE_STOP_STRAFE = 0x00, + MSG_MOVE_STOP_SWIM = 0x00, + MSG_MOVE_TOGGLE_LOGGING = 0x00, + MSG_MOVE_TIME_SKIPPED = 0x00, + MSG_MOVE_TELEPORT = 0x00, + MSG_MOVE_TELEPORT_ACK = 0x00, + MSG_MOVE_TELEPORT_CHEAT = 0x00, + MSG_MOVE_TOGGLE_COLLISION_CHEAT = 0x00, + MSG_MOVE_TOGGLE_FALL_LOGGING = 0x00, + MSG_MOVE_UNROOT = 0x00, + MSG_MOVE_WORLDPORT_ACK = 0x00, + MSG_NOTIFY_PARTY_SQUELCH = 0x00, + MSG_PARTY_ASSIGNMENT = 0x00, + MSG_PETITION_DECLINE = 0x98E7, + MSG_PETITION_RENAME = 0x4857, + MSG_PVP_LOG_DATA = 0x00, + MSG_QUERY_GUILD_BANK_TEXT = 0x00, + MSG_QUERY_NEXT_MAIL_TIME = 0x00, + MSG_QUEST_PUSH_RESULT = 0x1863, + MSG_RAID_READY_CHECK = 0x584E, + MSG_RAID_READY_CHECK_CONFIRM = 0x584E, + MSG_RAID_READY_CHECK_FINISHED = 0x00, + MSG_RAID_TARGET_UPDATE = 0x00, + MSG_RANDOM_ROLL = 0x4C57, + MSG_SAVE_GUILD_EMBLEM = 0x00, + MSG_SET_DUNGEON_DIFFICULTY = 0xC4F, + MSG_SET_RAID_DIFFICULTY = 0x1A5A, + MSG_TABARDVENDOR_ACTIVATE = 0x98EB, + MSG_TALENT_WIPE_CONFIRM = 0x00, + OBSOLETE_DROP_ITEM = 0x00, + SMSG_ACCOUNT_DATA_TIMES = 0x5EE2, + SMSG_ACHIEVEMENT_DELETED = 0x00, + SMSG_ACHIEVEMENT_EARNED = 0x00, + SMSG_ACTION_BUTTONS = 0x8A6B, + SMSG_ACTIVATETAXIREPLY = 0x8E4F, + SMSG_ADDON_INFO = 0x9863, + SMSG_ADD_RUNE_POWER = 0x00, + SMSG_AI_REACTION = 0x00, + SMSG_ALL_ACHIEVEMENT_DATA = 0x00, + SMSG_AREA_SPIRIT_HEALER_TIME = 0x00, + SMSG_AREA_TRIGGER_MESSAGE = 0x00, + SMSG_ARENA_ERROR = 0x00, + SMSG_ARENA_OPPONENT_UPDATE = 0x00, + SMSG_ARENA_TEAM_CHANGE_FAILED_QUEUED = 0x4A4E, + SMSG_ARENA_TEAM_COMMAND_RESULT = 0x00, + SMSG_ARENA_TEAM_EVENT = 0x00, + SMSG_ARENA_TEAM_INVITE = 0x00, + SMSG_ARENA_TEAM_QUERY_RESPONSE = 0x00, + SMSG_ARENA_TEAM_ROSTER = 0x00, + SMSG_ARENA_TEAM_STATS = 0x00, + SMSG_ATTACKERSTATEUPDATE = 0x00, + SMSG_ATTACKSTART = 0x00, + SMSG_ATTACKSTOP = 0x00, + SMSG_ATTACKSWING_BADFACING = 0x00, + SMSG_ATTACKSWING_CANT_ATTACK = 0x00, + SMSG_ATTACKSWING_DEADTARGET = 0x00, + SMSG_ATTACKSWING_NOTINRANGE = 0x00, + SMSG_AUCTION_BIDDER_LIST_RESULT = 0x00, + SMSG_AUCTION_BIDDER_NOTIFICATION = 0x00, + SMSG_AUCTION_COMMAND_RESULT = 0x00, + SMSG_AUCTION_LIST_PENDING_SALES = 0x00, + SMSG_AUCTION_LIST_RESULT = 0x00, + SMSG_AUCTION_OWNER_LIST_RESULT = 0x00, + SMSG_AUCTION_OWNER_NOTIFICATION = 0x00, + SMSG_AUCTION_REMOVED_NOTIFICATION = 0x00, + SMSG_AURA_UPDATE = 0x4C66, + SMSG_AURA_UPDATE_ALL = 0x18EE, + SMSG_AURACASTLOG = 0x00, + SMSG_AUTH_CHALLENGE = 0x1181, + SMSG_AUTH_RESPONSE = 0x8867, + SMSG_AVAILABLE_VOICE_CHANNEL = 0x00, + SMSG_BARBER_SHOP_RESULT = 0x00, + SMSG_BATTLEFIELD_LIST = 0xB64E, + SMSG_BATTLEFIELD_MGR_EJECTED = 0x00, + SMSG_BATTLEFIELD_MGR_EJECT_PENDING = 0x00, + SMSG_BATTLEFIELD_MGR_ENTERED = 0x00, + SMSG_BATTLEFIELD_MGR_ENTRY_INVITE = 0x00, + SMSG_BATTLEFIELD_MGR_QUEUE_INVITE = 0x00, + SMSG_BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE = 0x00, + SMSG_BATTLEFIELD_MGR_STATE_CHANGE = 0x00, + SMSG_BATTLEFIELD_PORT_DENIED = 0x00, + SMSG_BATTLEFIELD_STATUS1 = 0x00, + SMSG_BATTLEFIELD_STATUS2 = 0x00, + SMSG_BATTLEFIELD_STATUS3 = 0x00, + SMSG_BATTLEFIELD_STATUS4 = 0x00, + SMSG_BATTLEGROUND_INFO_THROTTLED = 0x00, + SMSG_BATTLEGROUND_PLAYER_JOINED = 0x00, + SMSG_BATTLEGROUND_PLAYER_POSITIONS = 0x00, + SMSG_BINDPOINTUPDATE = 0x00, + SMSG_BINDZONEREPLY = 0x00, + SMSG_BINDER_CONFIRM = 0x00, + SMSG_BREAK_TARGET = 0xE7E, + SMSG_BUY_BANK_SLOT_RESULT = 0x00, + SMSG_BUY_ITEM = 0x00, + SMSG_BUY_FAILED = 0x00, + SMSG_CALENDAR_COMMAND_RESULT = 0x00, + SMSG_CALENDAR_SEND_NUM_PENDING = 0x00, + SMSG_CALENDAR_SEND_CALENDAR = 0x00, + SMSG_CANCEL_AUTO_REPEAT = 0x00, + SMSG_CANCEL_COMBAT = 0x00, + SMSG_CAST_FAILED = 0x00, + SMSG_CHANNEL_LIST = 0x00, + SMSG_CHANNEL_MEMBER_COUNT = 0x00, + SMSG_CHANNEL_NOTIFY = 0x9C7F, + SMSG_CHAR_CREATE = 19547, + SMSG_CHAR_DELETE = 0x48CE, + SMSG_CHAR_ENUM = 0xA05C, + SMSG_CHARACTER_LOGIN_FAILED = 0x00, + SMSG_CHAR_RENAME = 0x00, + SMSG_CHAR_CUSTOMIZE = 0x00, + SMSG_CHAR_FACTION_CHANGE = 0x00, + SMSG_CHAT_PLAYER_AMBIGUOUS = 0x00, + SMSG_CHAT_PLAYER_NOT_FOUND = 0x00, + SMSG_CHAT_RESTRICTED = 0x00, + SMSG_CHAT_WRONG_FACTION = 0xE66, + SMSG_CHECK_FOR_BOTS = 0x00, + SMSG_CLEAR_COOLDOWN = 0x00, + SMSG_CLEAR_TARGET = 0x00, + SMSG_CLIENTCACHE_VERSION = 0x88F2, + SMSG_CLIENT_CONTROL_UPDATE = 0x00, + SMSG_COMBAT_LOG_MULTIPLE = 0x00, + SMSG_COMMENTATOR_MAP_INFO = 0x00, + SMSG_COMMENTATOR_PLAYER_INFO = 0x00, + SMSG_COMMENTATOR_STATE_CHANGED = 0x00, + SMSG_COMPLAIN_RESULT = 0x00, + SMSG_COMPRESSED_CHAR_ENUM = 0x380A, // New 4.x + SMSG_COMPRESSED_GUILD_ROSTER = 0x5A29, // New 4.x + SMSG_COMPRESSED_MOVES = 0x00, + SMSG_COMPRESSED_UPDATE_OBJECT = 0x1CC3, + SMSG_CONTACT_LIST = 0x0A6B, + SMSG_CONVERT_RUNE = 0x00, + SMSG_COOLDOWN_CHEAT = 0x00, + SMSG_COOLDOWN_EVENT = 0x00, + SMSG_CORPSE_NOT_IN_INSTANCE = 0xCACB, + SMSG_CORPSE_RECLAIM_DELAY = 0xCD46, + SMSG_CORPSE_MAP_POSITION_QUERY_RESPONSE = 0x00, + SMSG_CREATURE_QUERY_RESPONSE = 0xD847, + SMSG_CRITERIA_DELETED = 0x00, + SMSG_CRITERIA_UPDATE = 0x00, + SMSG_CROSSED_INEBRIATION_THRESHOLD = 0x00, + SMSG_DAMAGE_CALC_LOG = 0x00, + SMSG_DAMAGE_DONE_OBSOLETE = 0x00, + SMSG_DANCE_QUERY_RESPONSE = 0x00, + SMSG_DB_REPLY = 0x76EC, + SMSG_DEATH_RELEASE_LOC = 0x00, + SMSG_DEFENSE_MESSAGE = 0x00, + SMSG_DESTROY_OBJECT = 0x486B, + SMSG_DESTRUCTIBLE_BUILDING_DAMAGE = 0x00, + SMSG_DUEL_OUTOFBOUNDS = 0x00, + SMSG_DUEL_INBOUNDS = 0x00, + SMSG_DISMOUNT = 0x00, + SMSG_DISMOUNTRESULT = 0x00, + SMSG_DISPEL_FAILED = 0x00, + SMSG_DUEL_COMPLETE = 0x00, + SMSG_DUEL_COUNTDOWN = 0x00, + SMSG_DUEL_REQUESTED = 0x00, + SMSG_DUEL_WINNER = 0x00, + SMSG_DURABILITY_DAMAGE_DEATH = 0x00, + SMSG_ECHO_PARTY_SQUELCH = 0x00, + SMSG_EMOTE = 0xC67, + SMSG_ENABLE_BARBER_SHOP = 0x00, + SMSG_ENCHANTMENTLOG = 0x00, + SMSG_ENVIRONMENTALDAMAGELOG = 0x00, + SMSG_EQUIPMENT_SET_LIST = 0x18DF, + SMSG_EQUIPMENT_SET_SAVED = 0x00, + SMSG_EQUIPMENT_SET_USE_RESULT = 0x00, + SMSG_EXPECTED_SPAM_RECORDS = 0x00, + SMSG_EXPLORATION_EXPERIENCE = 0x00, + SMSG_FEATURE_SYSTEM_STATUS = 0x00, + SMSG_FISH_ESCAPED = 0x9C66, + SMSG_FISH_NOT_HOOKED = 0x18C3, + SMSG_FORCEACTIONSHOW = 0x00, + SMSG_FORCED_DEATH_UPDATE = 0x00, + SMSG_FORCE_DISPLAY_UPDATE = 0x00, + SMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE = 0x00, + SMSG_FORCE_FLIGHT_SPEED_CHANGE = 0x00, + SMSG_FORCE_MOVE_ROOT = 0x00, + SMSG_FORCE_MOVE_UNROOT = 0x00, + SMSG_FORCE_PITCH_RATE_CHANGE = 0x00, + SMSG_FORCE_RUN_BACK_SPEED_CHANGE = 0x00, + SMSG_FORCE_RUN_SPEED_CHANGE = 0x00, + SMSG_FORCE_SEND_QUEUED_PACKETS = 0x00, + SMSG_FORCE_TURN_RATE_CHANGE = 0x00, + SMSG_FORCE_SWIM_SPEED_CHANGE = 0x00, + SMSG_FORCE_SWIM_BACK_SPEED_CHANGE = 0x00, + SMSG_FORCE_WALK_SPEED_CHANGE = 0x00, + SMSG_FRIEND_STATUS = 0x00, + SMSG_GAMEOBJECT_CUSTOM_ANIM = 0x00, + SMSG_GAMEOBJECT_DESPAWN_ANIM = 0x00, + SMSG_GAMEOBJECT_PAGETEXT = 0x00, + SMSG_GAMEOBJECT_QUERY_RESPONSE = 0xCCF7, + SMSG_GAMEOBJECT_RESET_STATE = 0x00, + SMSG_GAMESPEED_SET = 0x00, + SMSG_GAMETIME_SET = 0x00, + SMSG_GAMETIME_UPDATE = 0x00, + SMSG_GMRESPONSE_STATUS_UPDATE = 0x00, + SMSG_GMRESPONSE_RECEIVED = 0x00, + SMSG_GMTICKET_DELETETICKET = 0x00, + SMSG_GMTICKET_GETTICKET = 0x00, + SMSG_GM_MESSAGECHAT = 0x8E5E, + SMSG_GMTICKET_CREATE = 0x00, + SMSG_GMTICKET_SYSTEMSTATUS = 0x9C7E, + SMSG_GMTICKET_UPDATETEXT = 0x00, + SMSG_GODMODE = 0xDEEE, + SMSG_GOSSIP_COMPLETE = 0x00, + SMSG_GOSSIP_MESSAGE = 0xCCEB, + SMSG_GOSSIP_POI = 0x00, + SMSG_GROUP_CANCEL = 0x00, + SMSG_GROUP_DECLINE = 0x00, + SMSG_GROUP_DESTROYED = 0x00, + SMSG_GROUP_INVITE = 0x00, + SMSG_GROUP_JOINED_BATTLEGROUND = 0x00, + SMSG_GROUP_LIST = 0x00, + SMSG_GROUP_SET_LEADER = 0x00, + SMSG_GROUP_UNINVITE = 0x00, + SMSG_GUILD_BANK_LIST = 0x5EFB, + SMSG_GUILD_COMMAND_RESULT = 0xDAD7, + SMSG_GUILD_DECLINE = 0x00, + SMSG_GUILD_EVENT = 0x8AC2, + SMSG_GUILD_INFO = 0x00, + SMSG_GUILD_INVITE = 0x00, + SMSG_GUILD_MAX_DAILY_XP = 0x00, + SMSG_GUILD_NEWS_UPDATE = 0x00, + SMSG_GUILD_QUERY_RESPONSE = 0xCA66, + SMSG_GUILD_RANK = 0xA6EC, + SMSG_GUILD_RANKS_UPDATE = 0x00, + SMSG_GUILD_REWARDS_LIST = 0x00, + SMSG_GUILD_SET_NOTE = 0xB6CE, // New 4.x ? + SMSG_GUILD_ROSTER = 0x664C, + SMSG_GUILD_TRADESKILL_UPDATE = 0x00, + SMSG_GUILD_UPDATE_ROSTER = 0x00, + SMSG_GUILD_XP_UPDATE = 0x00, + SMSG_HIGHEST_THREAT_UPDATE = 0x00, + SMSG_INITIALIZE_FACTIONS = 0x00, + SMSG_INITIAL_SPELLS = 0x88FE, + SMSG_INIT_CURRENCY = 0x227E, + SMSG_INIT_WORLD_STATES = 0x9EDA, + SMSG_INSPECT = 0x00, + SMSG_INSPECT_HONOR_STATS = 0x00, + SMSG_INSPECT_TALENT = 0x00, + SMSG_INSTANCE_DIFFICULTY = 0x00, + SMSG_INSTANCE_LOCK_WARNING_QUERY = 0x00, + SMSG_INSTANCE_RESET = 0x00, + SMSG_INSTANCE_RESET_FAILED = 0x00, + SMSG_INSTANCE_SAVE_CREATED = 0x00, + SMSG_INVALID_PROMOTION_CODE = 0xD8FE, + SMSG_INVALIDATE_DANCE = 0x00, + SMSG_INVALIDATE_PLAYER = 0x00, + SMSG_INVENTORY_CHANGE_FAILURE = 0x00, + SMSG_ITEM_COOLDOWN = 0x00, + SMSG_ITEM_ENCHANT_TIME_UPDATE = 0x00, + SMSG_ITEM_NAME_QUERY_RESPONSE = 0x00, + SMSG_ITEM_PUSH_RESULT = 0x8EFB, + SMSG_ITEM_QUERY_MULTIPLE_RESPONSE = 0x00, + SMSG_ITEM_QUERY_SINGLE_RESPONSE = 0x00, + SMSG_ITEM_REFUND_INFO_RESPONSE = 0x00, + SMSG_ITEM_REFUND_RESULT = 0x00, + SMSG_ITEM_TEXT_QUERY_RESPONSE = 0x00, + SMSG_ITEM_TIME_UPDATE = 0x00, + SMSG_JOINED_BATTLEGROUND_QUEUE = 0x00, + SMSG_LEARNED_DANCE_MOVES = 0x00, + SMSG_LEARNED_SPELL = 0x00, + SMSG_LEVELUP_INFO = 0x00, + SMSG_LFG_DISABLED = 0x00, + SMSG_LFG_JOIN_RESULT = 0x00, + SMSG_LFG_OFFER_CONTINUE = 0x00, + SMSG_LFG_OPEN_FROM_GOSSIP = 0x00, + SMSG_LFG_PARTY_INFO = 0x00, + SMSG_LFG_PLAYER_INFO = 0xC85F, + SMSG_LFG_PLAYER_REWARD = 0x00, + SMSG_LFG_PROPOSAL_UPDATE = 0x00, + SMSG_LFG_QUEUE_STATUS = 0x00, + SMSG_LFG_ROLE_CHECK_UPDATE = 0x00, + SMSG_LFG_ROLE_CHOSEN = 0x00, + SMSG_LFG_TELEPORT_DENIED = 0x00, + SMSG_LFG_UPDATE_SEARCH = 0x00, + SMSG_LFG_UPDATE_PARTY = 0x00, + SMSG_LFG_UPDATE_PLAYER = 0x00, + SMSG_LFGUILD_RECRUIT_DATA = 0xE0CE, // New 4.x + SMSG_LIST_INVENTORY = 0x264C, + SMSG_LOGIN_SETTIMESPEED = 0x00, + SMSG_LOGIN_VERIFY_WORLD = 0xC86E, + SMSG_LOGOUT_CANCEL_ACK = 0x00, + SMSG_LOGOUT_COMPLETE = 0xCC6B, + SMSG_LOGOUT_RESPONSE = 0x886A, + SMSG_LOG_XPGAIN = 0x00, + SMSG_LOOT_ALL_PASSED = 0x00, + SMSG_LOOT_CLEAR_MONEY = 0x00, + SMSG_LOOT_ITEM_NOTIFY = 0x00, + SMSG_LOOT_LIST = 0x00, + SMSG_LOOT_MASTER_LIST = 0x00, + SMSG_LOOT_MONEY_NOTIFY = 0x00, + SMSG_LOOT_RELEASE_RESPONSE = 0x00, + SMSG_LOOT_REMOVED = 0x00, + SMSG_LOOT_RESPONSE = 0x0842, + SMSG_LOOT_ROLL = 0x00, + SMSG_LOOT_ROLL_WON = 0x00, + SMSG_LOOT_SLOT_CHANGED = 0x00, + SMSG_LOOT_START_ROLL = 0x00, + SMSG_MAIL_LIST_RESULT = 0x00, + SMSG_MEETINGSTONE_COMPLETE = 0x00, + SMSG_MEETINGSTONE_IN_PROGRESS = 0x00, + SMSG_MEETINGSTONE_MEMBER_ADDED = 0x00, + SMSG_MEETINGSTONE_SETQUEUE = 0x00, + SMSG_MESSAGECHAT = 0x5E52, + SMSG_MIRRORIMAGE_DATA = 0x00, + SMSG_MODIFY_COOLDOWN = 0x00, + SMSG_MONSTER_MOVE = 0x4C53, + SMSG_MONSTER_MOVE_TRANSPORT = 0x88FB, + SMSG_MOTD = 0xCA4B, + SMSG_MOUNTSPECIAL_ANIM = 0x00, + SMSG_MOUNTRESULT = 0x00, + SMSG_MOVE_FEATHER_FALL = 0x00, + SMSG_MOVE_NORMAL_FALL = 0x00, + SMSG_MOVE_SET_CAN_FLY = 0x00, + SMSG_MOVE_SET_HOVER = 0x00, + SMSG_MOVE_UNSET_CAN_FLY = 0x00, + SMSG_MOVE_UNSET_HOVER = 0x00, + SMSG_MOVE_WATER_WALK = 0x00, + SMSG_MOVE_LAND_WALK = 0x00, + CMSG_MOVE_HOVER_ACK = 0x00, + SMSG_MOVE_KNOCK_BACK = 0x00, + SMSG_MOVE_SET_WALK_IN_AIR = 0x00, + SMSG_MOVE_UNSET_WALK_IN_AIR = 0x00, + SMSG_MULTIPLE_PACKETS = 0x00, + SMSG_NAME_QUERY_RESPONSE = 0x9CE6, SMSG_NEW_TAXI_PATH = 0xC8FF, // Might be 0x98CF - SMSG_NEW_WORLD = 0x00, // - SMSG_NOTIFICATION = 0x00, // - SMSG_NOTIFY_DANCE = 0x00, // - SMSG_NOTIFY_DEST_LOC_SPELL_CAST = 0x00, // - SMSG_NPC_TEXT_UPDATE = 0x4C72, // - SMSG_NPC_WONT_TALK = 0x00, // - SMSG_OFFER_PETITION_ERROR = 0x00, // - SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA = 0x00, // - SMSG_OPEN_CONTAINER = 0x00, // - SMSG_PAGE_TEXT_QUERY_RESPONSE = 0x18D2, // - SMSG_PARTYKILLLOG = 0x00, // - SMSG_PARTY_MEMBER_STATS = 0x00, // - SMSG_PARTY_MEMBER_STATS_FULL = 0x00, // - SMSG_PARTY_COMMAND_RESULT = 0x00, // - SMSG_PAUSE_MIRROR_TIMER = 0x00, // - SMSG_PERIODICAURALOG = 0x00, // - SMSG_PETGODMODE = 0x00, // - SMSG_PETITION_QUERY_RESPONSE = 0xCAEE, // - SMSG_PET_ACTION_FEEDBACK = 0x00, // - SMSG_PET_ACTION_SOUND = 0x00, // - SMSG_PET_CAST_FAILED = 0x00, // - SMSG_PET_DISMISS_SOUND = 0x00, // - SMSG_PET_GUIDS = 0x00, // - SMSG_PET_LEARNED_SPELL = 0xDC5E, // - SMSG_PET_MODE = 0x00, // - SMSG_PET_NAME_QUERY_RESPONSE = 0xDCD3, // - SMSG_PET_NAME_INVALID = 0x00, // - SMSG_PET_REMOVED_SPELL = 0x18F6, // - SMSG_PET_SPELLS = 0x00, // - SMSG_PET_TAME_FAILURE = 0x00, // - SMSG_PET_UPDATE_COMBO_POINTS = 0x00, // - SMSG_PETITION_SHOWLIST = 0x8ED7, // - SMSG_PETITION_SHOW_SIGNATURES = 0x4E4A, // - SMSG_PETITION_SIGN_RESULTS = 0x5EE6, // - SMSG_PLAYER_MOVE = 0x00, // - SMSG_PLAYED_TIME = 0x00, // - SMSG_PLAYERBINDERROR = 0x5A4F, // - SMSG_PLAYERBOUND = 0x00, // - SMSG_PLAYER_DIFFICULTY_CHANGE = 0x00, // - SMSG_BATTLEGROUND_PLAYER_LEFT = 0x00, // - SMSG_PLAYER_SKINNED = 0x00, // - SMSG_PLAYER_VEHICLE_DATA = 0x00, // - SMSG_PLAY_DANCE = 0x00, // - SMSG_PLAY_MUSIC = 0x00, // - SMSG_PLAY_OBJECT_SOUND = 0x00, // - SMSG_PLAY_SOUND = 0x00, // - SMSG_PLAY_SPELL_VISUAL = 0x00, // - SMSG_PLAY_SPELL_IMPACT = 0x00, // - SMSG_PLAY_TIME_WARNING = 0x00, // - SMSG_PONG = 0x0380, // - SMSG_POWER_UPDATE = 0x00, // - SMSG_PRE_RESURRECT = 0x00, // - SMSG_PROCRESIST = 0x00, // - SMSG_PROPOSE_LEVEL_GRANT = 0x00, // - SMSG_PUREMOUNT_CANCELLED_OBSOLETE = 0x00, // - SMSG_PVP_CREDIT = 0x00, // - SMSG_QUERY_QUESTS_COMPLETED_RESPONSE = 0x00, // - SMSG_QUERY_TIME_RESPONSE = 0x00, // - SMSG_QUESTGIVER_OFFER_REWARD = 0x00, // - SMSG_QUESTGIVER_QUEST_COMPLETE = 0x00, // - SMSG_QUESTGIVER_QUEST_DETAILS = 0xCE5F, // - SMSG_QUESTGIVER_QUEST_FAILED = 0xD8FF, // - SMSG_QUESTGIVER_QUEST_LIST = 0xDEF6, // - SMSG_QUESTGIVER_REQUEST_ITEMS = 0x9CEE, // - SMSG_QUESTGIVER_STATUS = 0xC846, // - SMSG_QUESTGIVER_STATUS_MULTIPLE = 0xDCFF, // - SMSG_QUESTLOG_FULL = 0x4EDE, // - SMSG_QUESTUPDATE_ADD_KILL = 0x00, // - SMSG_QUESTUPDATE_ADD_PVP_KILL = 0x00, // - SMSG_QUESTUPDATE_COMPLETE = 0x9CD6, // - SMSG_QUESTUPDATE_FAILED = 0x9EF6, // - SMSG_QUESTUPDATE_FAILEDTIMER = 0x00, // - SMSG_QUEST_CONFIRM_ACCEPT = 0x00, // - SMSG_QUEST_FORCE_REMOVED = 0x00, // - SMSG_QUEST_POI_QUERY_RESPONSE = 0x00, // - SMSG_QUEST_QUERY_RESPONSE = 0x9E56, // - SMSG_QUESTGIVER_QUEST_INVALID = 0x00, // - SMSG_QUESTUPDATE_ADD_ITEM_OBSOLETE = 0x00, // - SMSG_RAID_GROUP_ONLY = 0x00, // - SMSG_RAID_INSTANCE_INFO = 0x00, // - SMSG_RAID_INSTANCE_MESSAGE = 0x00, // - SMSG_READ_ITEM_FAILED = 0x00, // - SMSG_READ_ITEM_OK = 0x00, // - SMSG_REALM_SPLIT = 0x1AF2, // - SMSG_REAL_GROUP_UPDATE = 0x00, // - SMSG_RECEIVED_MAIL = 0x00, // - SMSG_REDIRECT_CLIENT = 0x0180, // - SMSG_REFER_A_FRIEND_FAILURE = 0x00, // - SMSG_REMOVED_SPELL = 0x00, // - SMSG_REPORT_PVP_AFK_RESULT = 0x00, // - SMSG_REQUEST_CEMETERY_LIST_RESPONSE = 0x00, // - SMSG_RESPOND_INSPECT_ACHIEVEMENTS = 0x00, // - SMSG_RESET_FAILED_NOTIFY = 0x00, // - SMSG_RESISTLOG = 0x00, // - SMSG_RESURRECT_REQUEST = 0x00, // - SMSG_RESYNC_RUNES = 0x00, // - SMSG_RWHOIS = 0x00, // - SMSG_SELL_ITEM = 0x00, // - SMSG_SEND_MAIL_RESULT = 0x00, // - SMSG_SEND_UNLEARN_SPELLS = 0x00, // - SMSG_SERVERTIME = 0x00, // - SMSG_SERVER_FIRST_ACHIEVEMENT = 0x00, // - SMSG_SERVER_MESSAGE = 0x00, // - SMSG_SET_FACTION_ATWAR = 0x00, // - SMSG_SET_FACTION_STANDING = 0x00, // - SMSG_SET_FACTION_VISIBLE = 0x00, // - SMSG_SET_FLAT_SPELL_MODIFIER = 0x00, // - SMSG_SET_FORCED_REACTIONS = 0x00, // - SMSG_SET_PCT_SPELL_MODIFIER = 0x00, // - SMSG_SET_PHASE_SHIFT = 0x204C, // - SMSG_SET_PLAYER_DECLINED_NAMES_RESULT = 0x00, // - SMSG_SET_PROFICIENCY = 0x00, // - SMSG_SET_PROJECTILE_POSITION = 0x00, // - SMSG_SHOWTAXINODES = 0x8CFB, // - SMSG_SHOW_BANK = 0x00, // - SMSG_SPELLBREAKLOG = 0x00, // - SMSG_SPELLDAMAGESHIELD = 0x00, // - SMSG_SPELLENERGIZELOG = 0x00, // - SMSG_SPELLHEALLOG = 0x00, // - SMSG_SPELLINSTAKILLLOG = 0x00, // - SMSG_SPELLLOGEXECUTE = 0x00, // - SMSG_SPELLLOGMISS = 0x00, // - SMSG_SPELLNONMELEEDAMAGELOG = 0x00, // - SMSG_SPELLORDAMAGE_IMMUNE = 0x00, // - SMSG_SPELL_COOLDOWN = 0x00, // - SMSG_SPELL_DELAYED = 0x00, // - SMSG_SPELLDISPELLOG = 0x00, // - SMSG_SPELL_FAILED_OTHER = 0x00, // - SMSG_SPELL_FAILURE = 0x00, // - SMSG_SPELL_GO = 0x0A53, // - SMSG_SPELL_START = 0xCE43, // - SMSG_SPELLSTEALLOG = 0x00, // - SMSG_SPELL_UPDATE_CHAIN_TARGETS = 0x00, // - SMSG_SPIRIT_HEALER_CONFIRM = 0x00, // - SMSG_SPLINE_MOVE_WATER_WALK = 0x00, // - SMSG_SPLINE_MOVE_LAND_WALK = 0x00, // - SMSG_SPLINE_MOVE_ROOT = 0x00, // - SMSG_SPLINE_MOVE_UNROOT = 0x00, // - SMSG_STABLE_RESULT = 0x00, // - SMSG_STANDSTATE_UPDATE = 0x00, // - SMSG_START_MIRROR_TIMER = 0x00, // - SMSG_STOP_DANCE = 0x00, // - SMSG_STOP_MIRROR_TIMER = 0x00, // - SMSG_SUMMON_REQUEST = 0x00, // - SMSG_SUPERCEDED_SPELL = 0x00, // - SMSG_TALENTS_INFO = 0x00, // - SMSG_TAXINODE_STATUS = 0x8CFB, // - SMSG_TOGGLE_XP_GAIN = 0x8A5B, // - SMSG_TEXT_EMOTE = 0x00, // - SMSG_THREAT_CLEAR = 0x00, // - SMSG_THREAT_REMOVE = 0x00, // - SMSG_THREAT_UPDATE = 0x00, // - SMSG_TIME_SYNC_REQ = 0x1009, // - SMSG_TITLE_EARNED = 0x00, // - SMSG_TOTEM_CREATED = 0x00, // - SMSG_TRADE_STATUS = 0x00, // - SMSG_TRADE_STATUS_EXTENDED = 0x00, // - SMSG_TRAINER_LIST = 0xC84E, // - SMSG_TRAINER_BUY_RESULT = 0x00, // - SMSG_TRANSFER_ABORTED = 0x00, // - SMSG_TRANSFER_PENDING = 0x00, // - SMSG_TRIGGER_CINEMATIC = 0x00, // - SMSG_TRIGGER_MOVIE = 0x00, // - SMSG_TURN_IN_PETITION_RESULTS = 0x08DB, // - SMSG_TUTORIAL_FLAGS = 0x1A46, // - SMSG_UNIT_SPELLCAST_START = 0x00, // - SMSG_UPDATE_ACCOUNT_DATA = 0x00, // - SMSG_UPDATE_ACCOUNT_DATA_COMPLETE = 0x5E53, // - SMSG_UPDATE_COMBO_POINTS = 0x00, // - SMSG_UPDATE_CURRENCY = 0x00, // - SMSG_UPDATE_CURRENCY_WEEK_LIMIT = 0x00, // - SMSG_UPDATE_INSTANCE_ENCOUNTER_UNIT = 0x00, // - SMSG_UPDATE_INSTANCE_OWNERSHIP = 0x00, // - SMSG_UPDATE_LAST_INSTANCE = 0x00, // - SMSG_UPDATE_LFG_LIST = 0x00, // - SMSG_UPDATE_OBJECT = 0x1EE7, // - SMSG_UPDATE_WORLD_STATE = 0x00, // - SMSG_USERLIST_ADD = 0x00, // - SMSG_USERLIST_REMOVE = 0x00, // - SMSG_USERLIST_UPDATE = 0x00, // - SMSG_VOICE_CHAT_STATUS = 0x00, // - SMSG_VOICE_PARENTAL_CONTROLS = 0x00, // - SMSG_VOICE_SESSION_LEAVE = 0x00, // - SMSG_VOICE_SESSION_ROSTER_UPDATE = 0x00, // - SMSG_VOICE_SET_TALKER_MUTED = 0x00, // - SMSG_WEATHER = 0x00, // - SMSG_WARDEN_DATA = 0x4ECE, // - SMSG_WHO = 0x4C7F, // - SMSG_WHOIS = 0x00, // - SMSG_WORLD_STATE_UI_TIMER_UPDATE = 0x00, // - SMSG_ZONE_UNDER_ATTACK = 0x00, // - - SMSG_VERIFY_CONNECTIVITY = 20311, // - CMSG_VERIFY_CONNECTIVITY_RESPONSE = 19538, //1280462679, // special opcode, client sends as uint32 + SMSG_NEW_WORLD = 0x00, + SMSG_NOTIFICATION = 0x00, + SMSG_NOTIFY_DANCE = 0x00, + SMSG_NOTIFY_DEST_LOC_SPELL_CAST = 0x00, + SMSG_NPC_TEXT_UPDATE = 0x4C72, + SMSG_NPC_WONT_TALK = 0x00, + SMSG_OFFER_PETITION_ERROR = 0x00, + SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA = 0x00, + SMSG_OPEN_CONTAINER = 0x00, + SMSG_PAGE_TEXT_QUERY_RESPONSE = 0x18D2, + SMSG_PARTYKILLLOG = 0x00, + SMSG_PARTY_MEMBER_STATS = 0x00, + SMSG_PARTY_MEMBER_STATS_FULL = 0x00, + SMSG_PARTY_COMMAND_RESULT = 0x00, + SMSG_PAUSE_MIRROR_TIMER = 0x00, + SMSG_PERIODICAURALOG = 0x00, + SMSG_PETGODMODE = 0x00, + SMSG_PETITION_QUERY_RESPONSE = 0xCAEE, + SMSG_PET_ACTION_FEEDBACK = 0x00, + SMSG_PET_ACTION_SOUND = 0x00, + SMSG_PET_CAST_FAILED = 0x00, + SMSG_PET_DISMISS_SOUND = 0x00, + SMSG_PET_GUIDS = 0x00, + SMSG_PET_LEARNED_SPELL = 0xDC5E, + SMSG_PET_MODE = 0x00, + SMSG_PET_NAME_QUERY_RESPONSE = 0xDCD3, + SMSG_PET_NAME_INVALID = 0x00, + SMSG_PET_REMOVED_SPELL = 0x18F6, + SMSG_PET_SPELLS = 0x00, + SMSG_PET_TAME_FAILURE = 0x00, + SMSG_PET_UPDATE_COMBO_POINTS = 0x00, + SMSG_PETITION_SHOWLIST = 0x8ED7, + SMSG_PETITION_SHOW_SIGNATURES = 0x4E4A, + SMSG_PETITION_SIGN_RESULTS = 0x5EE6, + SMSG_PLAYER_MOVE = 0x00, + SMSG_PLAYED_TIME = 0x00, + SMSG_PLAYERBINDERROR = 0x5A4F, + SMSG_PLAYERBOUND = 0x00, + SMSG_PLAYER_DIFFICULTY_CHANGE = 0x00, + SMSG_BATTLEGROUND_PLAYER_LEFT = 0x00, + SMSG_PLAYER_SKINNED = 0x00, + SMSG_PLAYER_VEHICLE_DATA = 0x00, + SMSG_PLAY_DANCE = 0x00, + SMSG_PLAY_MUSIC = 0x00, + SMSG_PLAY_OBJECT_SOUND = 0x00, + SMSG_PLAY_SOUND = 0x4ACF, + SMSG_PLAY_SPELL_VISUAL = 0x00, + SMSG_PLAY_SPELL_IMPACT = 0x00, + SMSG_PLAY_TIME_WARNING = 0x00, + SMSG_PONG = 0x0380, + SMSG_POWER_UPDATE = 0x487E, + SMSG_PRE_RESURRECT = 0x00, + SMSG_PROCRESIST = 0x00, + SMSG_PROPOSE_LEVEL_GRANT = 0x00, + SMSG_PUREMOUNT_CANCELLED_OBSOLETE = 0x00, + SMSG_PVP_CREDIT = 0x00, + SMSG_QUERY_QUESTS_COMPLETED_RESPONSE = 0x00, + SMSG_QUERY_TIME_RESPONSE = 0x00, + SMSG_QUESTGIVER_OFFER_REWARD = 0x00, + SMSG_QUESTGIVER_QUEST_COMPLETE = 0x00, + SMSG_QUESTGIVER_QUEST_DETAILS = 0xCE5F, + SMSG_QUESTGIVER_QUEST_FAILED = 0xD8FF, + SMSG_QUESTGIVER_QUEST_LIST = 0xDEF6, + SMSG_QUESTGIVER_REQUEST_ITEMS = 0x9CEE, + SMSG_QUESTGIVER_STATUS = 0xC846, + SMSG_QUESTGIVER_STATUS_MULTIPLE = 0xDCFF, + SMSG_QUESTLOG_FULL = 0x4EDE, + SMSG_QUESTUPDATE_ADD_KILL = 0x00, + SMSG_QUESTUPDATE_ADD_PVP_KILL = 0x00, + SMSG_QUESTUPDATE_COMPLETE = 0x9CD6, + SMSG_QUESTUPDATE_FAILED = 0x9EF6, + SMSG_QUESTUPDATE_FAILEDTIMER = 0x00, + SMSG_QUEST_CONFIRM_ACCEPT = 0x00, + SMSG_QUEST_FORCE_REMOVED = 0x00, + SMSG_QUEST_POI_QUERY_RESPONSE = 0x00, + SMSG_QUEST_QUERY_RESPONSE = 0x9E56, + SMSG_QUESTGIVER_QUEST_INVALID = 0x00, + SMSG_QUESTUPDATE_ADD_ITEM_OBSOLETE = 0x00, + SMSG_RAID_GROUP_ONLY = 0x00, + SMSG_RAID_INSTANCE_INFO = 0x00, + SMSG_RAID_INSTANCE_MESSAGE = 0x00, + SMSG_READ_ITEM_FAILED = 0x00, + SMSG_READ_ITEM_OK = 0x00, + SMSG_REALM_SPLIT = 0x1AF2, + SMSG_REAL_GROUP_UPDATE = 0x00, + SMSG_RECEIVED_MAIL = 0x00, + SMSG_REDIRECT_CLIENT = 0x0180, + SMSG_REFER_A_FRIEND_FAILURE = 0x4867, + SMSG_REMOVED_SPELL = 0x00, + SMSG_REPORT_PVP_AFK_RESULT = 0x00, + SMSG_REQUEST_CEMETERY_LIST_RESPONSE = 0x00, + SMSG_RESPOND_INSPECT_ACHIEVEMENTS = 0x00, + SMSG_RESET_FAILED_NOTIFY = 0x00, + SMSG_RESISTLOG = 0x00, + SMSG_RESURRECT_REQUEST = 0x00, + SMSG_RESYNC_RUNES = 0x00, + SMSG_RWHOIS = 0x00, + SMSG_SELL_ITEM = 0x00, + SMSG_SEND_MAIL_RESULT = 0x00, + SMSG_SEND_UNLEARN_SPELLS = 0x00, + SMSG_SERVERTIME = 0x00, + SMSG_SERVER_FIRST_ACHIEVEMENT = 0x00, + SMSG_SERVER_MESSAGE = 0x00, + SMSG_SET_FACTION_ATWAR = 0x00, + SMSG_SET_FACTION_STANDING = 0x00, + SMSG_SET_FACTION_VISIBLE = 0x00, + SMSG_SET_FLAT_SPELL_MODIFIER = 0x00, + SMSG_SET_FORCED_REACTIONS = 0x00, + SMSG_SET_PCT_SPELL_MODIFIER = 0x00, + SMSG_SET_PHASE_SHIFT = 0x204C, + SMSG_SET_PLAYER_DECLINED_NAMES_RESULT = 0x00, + SMSG_SET_PROFICIENCY = 0x00, + SMSG_SET_PROJECTILE_POSITION = 0x00, + SMSG_SHOWTAXINODES = 0x8CFB, + SMSG_SHOW_BANK = 0x00, + SMSG_SPELLBREAKLOG = 0x00, + SMSG_SPELLDAMAGESHIELD = 0x00, + SMSG_SPELLENERGIZELOG = 0x00, + SMSG_SPELLHEALLOG = 0x00, + SMSG_SPELLINSTAKILLLOG = 0x00, + SMSG_SPELLLOGEXECUTE = 0x00, + SMSG_SPELLLOGMISS = 0x00, + SMSG_SPELLNONMELEEDAMAGELOG = 0x00, + SMSG_SPELLORDAMAGE_IMMUNE = 0x00, + SMSG_SPELL_COOLDOWN = 0x00, + SMSG_SPELL_DELAYED = 0x00, + SMSG_SPELLDISPELLOG = 0x00, + SMSG_SPELL_FAILED_OTHER = 0x00, + SMSG_SPELL_FAILURE = 0x00, + SMSG_SPELL_GO = 0x0A53, + SMSG_SPELL_START = 0xCE43, + SMSG_SPELLSTEALLOG = 0x00, + SMSG_SPELL_UPDATE_CHAIN_TARGETS = 0x00, + SMSG_SPIRIT_HEALER_CONFIRM = 0x00, + SMSG_SPLINE_MOVE_WATER_WALK = 0x00, + SMSG_SPLINE_MOVE_LAND_WALK = 0x00, + SMSG_SPLINE_MOVE_ROOT = 0x00, + SMSG_SPLINE_MOVE_UNROOT = 0x00, + SMSG_STABLE_RESULT = 0x00, + SMSG_STANDSTATE_UPDATE = 0x4E52, + SMSG_START_MIRROR_TIMER = 0x00, + SMSG_STOP_DANCE = 0x00, + SMSG_STOP_MIRROR_TIMER = 0x00, + SMSG_SUMMON_REQUEST = 0x00, + SMSG_SUPERCEDED_SPELL = 0x00, + SMSG_TALENTS_INFO = 0x00, + SMSG_TAXINODE_STATUS = 0x8CFB, + SMSG_TOGGLE_XP_GAIN = 0x8A5B, + SMSG_TEXT_EMOTE = 0x00, + SMSG_THREAT_CLEAR = 0x00, + SMSG_THREAT_REMOVE = 0x00, + SMSG_THREAT_UPDATE = 0x00, + SMSG_TIME_SYNC_REQ = 0x1009, + SMSG_TITLE_EARNED = 0x00, + SMSG_TOTEM_CREATED = 0x00, + SMSG_TRADE_STATUS = 0x00, + SMSG_TRADE_STATUS_EXTENDED = 0x00, + SMSG_TRAINER_LIST = 0xC84E, + SMSG_TRAINER_BUY_RESULT = 0x00, + SMSG_TRANSFER_ABORTED = 0x00, + SMSG_TRANSFER_PENDING = 0x00, + SMSG_TRIGGER_CINEMATIC = 0x00, + SMSG_TRIGGER_MOVIE = 0x00, + SMSG_TURN_IN_PETITION_RESULTS = 0x08DB, + SMSG_TUTORIAL_FLAGS = 0x1A46, + SMSG_UNIT_SPELLCAST_START = 0x00, + SMSG_UPDATE_ACCOUNT_DATA = 0x00, + SMSG_UPDATE_ACCOUNT_DATA_COMPLETE = 0x5E53, + SMSG_UPDATE_COMBO_POINTS = 0x00, + SMSG_UPDATE_CURRENCY = 0x00, + SMSG_UPDATE_CURRENCY_WEEK_LIMIT = 0x00, + SMSG_UPDATE_INSTANCE_ENCOUNTER_UNIT = 0x00, + SMSG_UPDATE_INSTANCE_OWNERSHIP = 0x00, + SMSG_UPDATE_LAST_INSTANCE = 0x00, + SMSG_UPDATE_LFG_LIST = 0x00, + SMSG_UPDATE_OBJECT = 0x1EE7, + SMSG_UPDATE_WORLD_STATE = 0x00, + SMSG_USERLIST_ADD = 0x00, + SMSG_USERLIST_REMOVE = 0x00, + SMSG_USERLIST_UPDATE = 0x00, + SMSG_VOICE_CHAT_STATUS = 0x00, + SMSG_VOICE_PARENTAL_CONTROLS = 0x00, + SMSG_VOICE_SESSION_LEAVE = 0x00, + SMSG_VOICE_SESSION_ROSTER_UPDATE = 0x00, + SMSG_VOICE_SET_TALKER_MUTED = 0x00, + SMSG_WEATHER = 0x4ECE, + SMSG_WARDEN_DATA = 0x484F, + SMSG_WHO = 0x4C7F, + SMSG_WHOIS = 0x00, + SMSG_WORLD_STATE_UI_TIMER_UPDATE = 0x00, + SMSG_ZONE_UNDER_ATTACK = 0x00, - SMSG_BATTLEFIELD_STATUS = 0x00, // - SMSG_QUESTUPDATE_ADD_ITEM = 0x00, // - SMSG_OVERRIDE_LIGHT = 0x00, // - CMSG_RANDOMIZE_CHAR_NAME = 35481, // byte unk, byte race - SMSG_RANDOMIZE_CHAR_NAME = 61660, // byte unk(0x80), string name + SMSG_VERIFY_CONNECTIVITY = 0x4F57, + CMSG_VERIFY_CONNECTIVITY_RESPONSE = 0x4C52, //1280462679, // special opcode, client sends as uint32 - CMSG_MOVE_SET_COLLISION_HGT = 0, // - SMSG_MOVE_SET_COLLISION_HGT = 0, // + SMSG_BATTLEFIELD_STATUS = 0x00, + SMSG_QUESTUPDATE_ADD_ITEM = 0x00, + SMSG_OVERRIDE_LIGHT = 0x00, + SMSG_RANDOMIZE_CHAR_NAME = 0xF0DC, // byte unk(0x80), string name + + CMSG_MOVE_SET_COLLISION_HGT = 0x00, + SMSG_MOVE_SET_COLLISION_HGT = 0x00, }; /// Player state -- cgit v1.2.3 From d977ed01e785ef765011464163e53074552ffd4a Mon Sep 17 00:00:00 2001 From: Rat Date: Sun, 27 Nov 2011 19:08:42 +0100 Subject: Core/Units: fixed power update (yes you are now alive ingame) --- src/server/game/Entities/Unit/Unit.cpp | 39 +++++++++++++++++++++++------ src/server/game/Entities/Unit/Unit.h | 4 ++- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- 3 files changed, 35 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index df8ee5be2ec..f912fd92cea 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -13608,22 +13608,45 @@ void Unit::SetMaxHealth(uint32 val) SetHealth(val); } -void Unit::SetPower(Powers power, int32 val) +uint32 Unit::GetPowerIndexByClass(uint32 powerId, uint32 classId) const { - if (GetPower(power) == val) - return; + ChrClassesEntry const* m_class = sChrClassesStore.LookupEntry(classId); - int32 maxPower = (int32)GetMaxPower(power); + ASSERT(m_class && "Class not found"); + + uint32 index = 0; + + for (uint32 i = 0; i <= sChrPowerTypesStore.GetNumRows(); i++) + { + ChrPowerTypesEntry const* cEntry = sChrPowerTypesStore.LookupEntry(i); + + if (!cEntry) + continue; + + if (classId != cEntry->classId) + continue; + + if (powerId == cEntry->power) + return index; + + index++; + } + return 0; +}; + +void Unit::SetPower(Powers power, uint32 val) +{ + uint32 maxPower = GetMaxPower(power); if (maxPower < val) val = maxPower; - SetStatInt32Value(UNIT_FIELD_POWER1 + power, val); + SetStatInt32Value(UNIT_FIELD_POWER1 + GetPowerIndexByClass(power, getClass()), val); WorldPacket data(SMSG_POWER_UPDATE); data.append(GetPackGUID()); - data << int32(1); // Unk - data << uint8(power); - data << int32(val); + data << uint32(1);//unk + data << uint8(GetPowerIndexByClass(power, getClass())); + data << uint32(val); SendMessageToSet(&data, GetTypeId() == TYPEID_PLAYER ? true : false); // group update diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index a86361e8d21..2f85248648f 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1371,12 +1371,14 @@ class Unit : public WorldObject void setPowerType(Powers power); int32 GetPower(Powers power) const { return GetUInt32Value(UNIT_FIELD_POWER1+power); } uint32 GetMaxPower(Powers power) const { return GetUInt32Value(UNIT_FIELD_MAXPOWER1+power); } - void SetPower(Powers power, int32 val); + void SetPower(Powers power, uint32 val); void SetMaxPower(Powers power, int32 val); // returns the change in power int32 ModifyPower(Powers power, int32 val); int32 ModifyPowerPct(Powers power, float pct, bool apply = true); + uint32 GetPowerIndexByClass(uint32 powerId, uint32 classId) const; + uint32 GetAttackTime(WeaponAttackType att) const { float f_BaseAttackTime = GetFloatValue(UNIT_FIELD_BASEATTACKTIME+att) / m_modAttackSpeedPct[att]; diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index be6d568cc78..bb5d1ec8d2c 100755 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -1193,7 +1193,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_ALL_ACHIEVEMENT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_FORCE_SAY_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_HEALTH_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_POWER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_POWER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJ_REPORT_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGameobjectReportUse ); //DEFINE_OPCODE_HANDLER(SMSG_HIGHEST_THREAT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_THREAT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From 2bd70aae3df4781954d02f151f69968f4d484ac7 Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 27 Nov 2011 18:12:18 +0000 Subject: Usual fix compile commit --- src/server/game/Server/Protocol/Opcodes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index a642a304c76..50ea02812b5 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -363,7 +363,7 @@ enum Opcodes CMSG_REQUEST_PLAYER_VEHICLE_EXIT = 0xCC6, CMSG_REQUEST_RATED_BG_INFO = 0x00, CMSG_REQUEST_RAID_INFO = 0x00, - CMSG_REQUEST_VEHICLE_EXIT = 0xCC6. // New 4.x ? + CMSG_REQUEST_VEHICLE_EXIT = 0xCC6, // New 4.x ? CMSG_REQUEST_VEHICLE_NEXT_SEAT = 0xCAD6, CMSG_REQUEST_VEHICLE_PREV_SEAT = 0x1AE2, CMSG_REQUEST_VEHICLE_SWITCH_SEAT = 0x01, // temp to fix switch case value error -- cgit v1.2.3 From 23dae4e6bb14ace08872b76630ef1f9c0b1aace7 Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 27 Nov 2011 18:23:10 +0000 Subject: Yet another typo in opcodes, failCount++ --- src/server/game/Server/Protocol/Opcodes.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 50ea02812b5..bc8a94b688d 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -28,8 +28,9 @@ /// List of Opcodes enum Opcodes { - NUM_OPCODE_HANDLERS = (0xFFFF+1), - UNKNOWN_OPCODE = NUM_OPCODE_HANDLERS, + NUM_OPCODE_HANDLERS = (0xFFFF+1), + UNKNOWN_OPCODE = NUM_OPCODE_HANDLERS, + NULL_OPCODE = 0, CMSG_ACCEPT_LEVEL_GRANT = 0xDC4B, CMSG_ACCEPT_TRADE = 0x00, @@ -421,8 +422,9 @@ enum Opcodes CMSG_TAXISHOWNODES = 0x00, CMSG_TOGGLE_PVP = 0x8ECA, CMSG_TOTEM_DESTROYED = 0x00, - CMSG_TRAINER_BUY_SUCCEEDED = 0xAF7, + SMSG_TRAINER_BUY_SUCCEEDED = 0x00, CMSG_TRAINER_LIST = 0xCC7F, + CMSG_TRAINER_BUY_SPELL = 0xAF7, CMSG_TRIGGER_CINEMATIC_CHEAT = 0x00, CMSG_TURN_IN_PETITION = 0x9C67, CMSG_TUTORIAL_CLEAR = 0x00, -- cgit v1.2.3 From 521df431d206e968aa0bbc83d31510815c8c07c1 Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 27 Nov 2011 19:03:02 +0000 Subject: Core/Protocol: Re enable handlers for some opcodes --- src/server/game/Server/Protocol/Opcodes.cpp | 38 ++++++++++++++--------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index bb5d1ec8d2c..11c5883aa06 100755 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -116,14 +116,14 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_GAMESPEED_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SERVERTIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_SERVERTIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_PLAYER_LOGOUT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayerLogoutOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_PLAYER_LOGOUT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayerLogoutOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LOGOUT_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLogoutRequestOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_LOGOUT_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LOGOUT_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_LOGOUT_CANCEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLogoutCancelOpcode ); + DEFINE_OPCODE_HANDLER(SMSG_LOGOUT_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOGOUT_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(CMSG_LOGOUT_CANCEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLogoutCancelOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_LOGOUT_CANCEL_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNameQueryOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(CMSG_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNameQueryOpcode ); + DEFINE_OPCODE_HANDLER(SMSG_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_PET_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetNameQuery ); //DEFINE_OPCODE_HANDLER(SMSG_PET_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_QUERY, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildQueryOpcode ); @@ -140,17 +140,17 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_CREATURE_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleCreatureQueryOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_CREATURE_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_WHO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWhoOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_WHO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_WHOIS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWhoisOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_WHO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWhoOpcode ); + DEFINE_OPCODE_HANDLER(SMSG_WHO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(CMSG_WHOIS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWhoisOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_WHOIS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_CONTACT_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleContactListOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_CONTACT_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(CMSG_CONTACT_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleContactListOpcode ); + DEFINE_OPCODE_HANDLER(SMSG_CONTACT_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_FRIEND_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_ADD_FRIEND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddFriendOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_ADD_FRIEND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddFriendOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_DEL_FRIEND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDelFriendOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SET_CONTACT_NOTES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetContactNotesOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_ADD_IGNORE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddIgnoreOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_ADD_IGNORE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddIgnoreOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_DEL_IGNORE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDelIgnoreOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupInviteOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_GROUP_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -219,7 +219,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_READ_ITEM_OK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_READ_ITEM_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ITEM_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJ_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGameObjectUseOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJ_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGameObjectUseOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_DESTROY_ITEMS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_CUSTOM_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_AREATRIGGER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaTriggerOpcode ); @@ -339,8 +339,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_SET_FACTION_CHEAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetFactionCheat ); //DEFINE_OPCODE_HANDLER(SMSG_SET_PROFICIENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SET_ACTION_BUTTON, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActionButtonOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_ACTION_BUTTONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_INITIAL_SPELLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ACTION_BUTTONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_INITIAL_SPELLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LEARNED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SUPERCEDED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_NEW_SPELL_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -391,9 +391,9 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_REPOP_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepopRequestOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_RESURRECT_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_RESURRECT_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleResurrectResponseOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_LOOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_LOOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LOOT_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMoneyOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_LOOT_RELEASE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootReleaseOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_LOOT_RELEASE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootReleaseOpcode ); DEFINE_OPCODE_HANDLER(SMSG_LOOT_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOOT_RELEASE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOOT_REMOVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1311,7 +1311,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_GMRESPONSE_CREATE_TICKET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SERVERINFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_SERVERINFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_WORLD_STATE_UI_TIMER_UPDATE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleWorldStateUITimerUpdate ); + DEFINE_OPCODE_HANDLER(CMSG_WORLD_STATE_UI_TIMER_UPDATE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleWorldStateUITimerUpdate ); //DEFINE_OPCODE_HANDLER(SMSG_WORLD_STATE_UI_TIMER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_CHAR_RACE_CHANGE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharFactionOrRaceChange ); //DEFINE_OPCODE_HANDLER(MSG_VIEW_PHASE_SHIFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); -- cgit v1.2.3 From d27ba7379bd19fa7159ad7854e986eb2c06b7e22 Mon Sep 17 00:00:00 2001 From: Rat Date: Sun, 27 Nov 2011 20:23:27 +0100 Subject: Core/Units: SetPower should be signed int --- src/server/game/Entities/Unit/Unit.cpp | 2 +- src/server/game/Entities/Unit/Unit.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index f912fd92cea..fae8d877fe3 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -13634,7 +13634,7 @@ uint32 Unit::GetPowerIndexByClass(uint32 powerId, uint32 classId) const return 0; }; -void Unit::SetPower(Powers power, uint32 val) +void Unit::SetPower(Powers power, int32 val) { uint32 maxPower = GetMaxPower(power); if (maxPower < val) diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 2f85248648f..4f0db86adc1 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1371,7 +1371,7 @@ class Unit : public WorldObject void setPowerType(Powers power); int32 GetPower(Powers power) const { return GetUInt32Value(UNIT_FIELD_POWER1+power); } uint32 GetMaxPower(Powers power) const { return GetUInt32Value(UNIT_FIELD_MAXPOWER1+power); } - void SetPower(Powers power, uint32 val); + void SetPower(Powers power, int32 val); void SetMaxPower(Powers power, int32 val); // returns the change in power int32 ModifyPower(Powers power, int32 val); -- cgit v1.2.3 From 0ffb50fcd235e6f462b1e282c0ffafd965f68af0 Mon Sep 17 00:00:00 2001 From: Rat Date: Sun, 27 Nov 2011 20:49:07 +0100 Subject: Core/Packets: corrected error msg --- src/server/game/Server/WorldSession.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index 35cf51b2f24..05149b41995 100755 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -159,9 +159,9 @@ void WorldSession::SendPacket(WorldPacket const* packet) if (!m_Socket) return; - if (packet->GetOpcode() == NULL || packet->GetOpcode() == UNKNOWN_OPCODE) + if (packet->GetOpcode() == NULL_OPCODE || packet->GetOpcode() == UNKNOWN_OPCODE) { - sLog->outError("Sending unknown opcode - prevented. Trace:"); + sLog->outError("Prevented sending of %s. Trace:", packet->GetOpcode() == NULL_OPCODE ? "NULL_OPCODE" : "UNKNOWN_OPCODE"); ACE_Stack_Trace trace; sLog->outError("%s", trace.c_str()); return; -- cgit v1.2.3 From 7b5f51b0064db88d2fafdcf6a977710981bb0dfb Mon Sep 17 00:00:00 2001 From: Rat Date: Sun, 27 Nov 2011 21:20:37 +0100 Subject: Core/Packets: enabled / fixed handlers --- src/server/game/Server/Protocol/Handlers/MiscHandler.cpp | 2 +- src/server/game/Server/Protocol/Opcodes.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp b/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp index 63ea359755d..2eb8317ec29 100755 --- a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp @@ -1438,7 +1438,7 @@ void WorldSession::HandleTimeSyncResp(WorldPacket & recv_data) sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_TIME_SYNC_RESP"); uint32 counter, clientTicks; - recv_data >> counter >> clientTicks; + recv_data >> clientTicks >> counter; if (counter != _player->m_timeSyncCounter - 1) sLog->outDebug(LOG_FILTER_NETWORKIO, "Wrong time sync counter from player %s (cheater?)", _player->GetName()); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 11c5883aa06..6907c954fa0 100755 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -263,7 +263,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_FACING, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_PITCH, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_WORLDPORT_ACK, STATUS_TRANSFER, PROCESS_THREADUNSAFE, &WorldSession::HandleMoveWorldportAckOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_MONSTER_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MONSTER_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_LAND_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_CHARM_PORT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -727,7 +727,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_SUMMON_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SUMMON_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSummonResponseOpcode ); //DEFINE_OPCODE_HANDLER(MSG_DEV_SHOWLABEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_MONSTER_MOVE_TRANSPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MONSTER_MOVE_TRANSPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_BROKEN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_FEATHER_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -953,8 +953,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_MOVE_CHNG_TRANSPORT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); //DEFINE_OPCODE_HANDLER(MSG_PARTY_ASSIGNMENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePartyAssignmentOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_OFFER_PETITION_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_TIME_SYNC_REQ, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_TIME_SYNC_RESP, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleTimeSyncResp ); + DEFINE_OPCODE_HANDLER(SMSG_TIME_SYNC_REQ, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(CMSG_TIME_SYNC_RESP, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleTimeSyncResp ); //DEFINE_OPCODE_HANDLER(CMSG_SEND_LOCAL_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SEND_GENERAL_TRIGGER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SEND_COMBAT_TRIGGER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); -- cgit v1.2.3 From f28fd9053552de75b295b525626df2216fefee55 Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 27 Nov 2011 20:39:35 +0000 Subject: Core/Protocol: Two new opcs and re-enable more handlers --- src/server/game/Server/Protocol/Opcodes.cpp | 40 ++++++++++++++--------------- src/server/game/Server/Protocol/Opcodes.h | 4 +-- 2 files changed, 22 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 6907c954fa0..4277792db13 100755 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -117,7 +117,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_SERVERTIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_SERVERTIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_PLAYER_LOGOUT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayerLogoutOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_LOGOUT_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLogoutRequestOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_LOGOUT_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLogoutRequestOpcode ); DEFINE_OPCODE_HANDLER(SMSG_LOGOUT_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LOGOUT_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_LOGOUT_CANCEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLogoutCancelOpcode ); @@ -132,14 +132,14 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_ITEM_QUERY_MULTIPLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_ITEM_QUERY_SINGLE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ITEM_QUERY_MULTIPLE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_PAGE_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePageTextQueryOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_PAGE_TEXT_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_QUEST_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestQueryOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_QUEST_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJECT_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleGameObjectQueryOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_PAGE_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePageTextQueryOpcode ); + DEFINE_OPCODE_HANDLER(SMSG_PAGE_TEXT_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(CMSG_QUEST_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestQueryOpcode ); + DEFINE_OPCODE_HANDLER(SMSG_QUEST_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJECT_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleGameObjectQueryOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_CREATURE_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleCreatureQueryOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_CREATURE_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(CMSG_CREATURE_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleCreatureQueryOpcode ); + DEFINE_OPCODE_HANDLER(SMSG_CREATURE_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_WHO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWhoOpcode ); DEFINE_OPCODE_HANDLER(SMSG_WHO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_WHOIS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWhoisOpcode ); @@ -300,8 +300,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_CLEAR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialClear ); //DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_RESET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialReset ); //DEFINE_OPCODE_HANDLER(CMSG_STANDSTATECHANGE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStandStateChangeOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEmoteOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_EMOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(CMSG_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEmoteOpcode ); + DEFINE_OPCODE_HANDLER(SMSG_EMOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_TEXT_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTextEmoteOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_TEXT_EMOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_AUTOEQUIP_GROUND_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -310,8 +310,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_STORE_LOOT_IN_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_AUTOEQUIP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoEquipItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_BAG_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoStoreBagItemOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_SWAP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSwapItem ); - //DEFINE_OPCODE_HANDLER(CMSG_SWAP_INV_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSwapInvItemOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_SWAP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSwapItem ); + DEFINE_OPCODE_HANDLER(CMSG_SWAP_INV_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSwapInvItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SPLIT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSplitItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_AUTOEQUIP_ITEM_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoEquipItemSlotOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_UNCLAIM_LICENSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -357,7 +357,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_PET_CAST_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(MSG_CHANNEL_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_CHANNEL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_CHANNELLING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelChanneling ); + DEFINE_OPCODE_HANDLER(CMSG_CANCEL_CHANNELLING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelChanneling ); //DEFINE_OPCODE_HANDLER(SMSG_AI_REACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SET_SELECTION, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleSetSelectionOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_DELETEEQUIPMENT_SET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetDelete ); @@ -421,12 +421,12 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_PET_NAME_INVALID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_SPELLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_GOSSIP_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGossipHelloOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GOSSIP_SELECT_OPTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGossipSelectOptionOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_GOSSIP_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(CMSG_GOSSIP_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGossipHelloOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GOSSIP_SELECT_OPTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGossipSelectOptionOpcode ); + DEFINE_OPCODE_HANDLER(SMSG_GOSSIP_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GOSSIP_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_NPC_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNpcTextQueryOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_NPC_TEXT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(CMSG_NPC_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNpcTextQueryOpcode ); + DEFINE_OPCODE_HANDLER(SMSG_NPC_TEXT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_NPC_WONT_TALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_STATUS_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleQuestgiverStatusQueryOpcode); //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -698,7 +698,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_GROUP_RAID_CONVERT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupRaidConvertOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_ASSISTANT_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupAssistantLeaderOpcode); //DEFINE_OPCODE_HANDLER(CMSG_BUYBACK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuybackItem ); - //DEFINE_OPCODE_HANDLER(SMSG_SERVER_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SERVER_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SET_SAVED_INSTANCE_EXTEND, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_OFFER_CONTINUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_TEST_DROP_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -1078,7 +1078,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(MSG_QUERY_GUILD_BANK_TEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryGuildBankTabText ); //DEFINE_OPCODE_HANDLER(CMSG_SET_GUILD_BANK_TEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetGuildBankTabText ); //DEFINE_OPCODE_HANDLER(CMSG_SET_GRANTABLE_LEVELS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GRANT_LEVEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGrantLevel ); + DEFINE_OPCODE_HANDLER(CMSG_GRANT_LEVEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGrantLevel ); //DEFINE_OPCODE_HANDLER(CMSG_REFER_A_FRIEND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_GM_CHANGE_ARENA_RATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_DECLINE_CHANNEL_INVITE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleChannelDeclineInvite ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index bc8a94b688d..d3745b81307 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -709,7 +709,7 @@ enum Opcodes SMSG_GODMODE = 0xDEEE, SMSG_GOSSIP_COMPLETE = 0x00, SMSG_GOSSIP_MESSAGE = 0xCCEB, - SMSG_GOSSIP_POI = 0x00, + SMSG_GOSSIP_POI = 0x1866, SMSG_GROUP_CANCEL = 0x00, SMSG_GROUP_DECLINE = 0x00, SMSG_GROUP_DESTROYED = 0x00, @@ -932,7 +932,7 @@ enum Opcodes SMSG_SEND_UNLEARN_SPELLS = 0x00, SMSG_SERVERTIME = 0x00, SMSG_SERVER_FIRST_ACHIEVEMENT = 0x00, - SMSG_SERVER_MESSAGE = 0x00, + SMSG_SERVER_MESSAGE = 0xC873, SMSG_SET_FACTION_ATWAR = 0x00, SMSG_SET_FACTION_STANDING = 0x00, SMSG_SET_FACTION_VISIBLE = 0x00, -- cgit v1.2.3 From 359a21a55355e7b4741c7f04e050908a405acd4c Mon Sep 17 00:00:00 2001 From: kaelima Date: Sun, 27 Nov 2011 23:31:46 +0100 Subject: Core/Protocol: Allow use of a bunch of opcodes (all structs have been checked) --- src/server/game/Battlegrounds/BattlegroundMgr.cpp | 4 ++-- src/server/game/Battlegrounds/BattlegroundMgr.h | 2 +- .../Protocol/Handlers/BattleGroundHandler.cpp | 12 +++------- src/server/game/Server/Protocol/Opcodes.cpp | 20 ++++++++--------- src/server/game/Server/Protocol/Opcodes.h | 12 +++++----- src/server/game/Spells/Spell.cpp | 26 +++++++++++++++++++--- src/server/game/Spells/Spell.h | 8 +++---- src/server/game/Spells/SpellInfo.h | 2 +- 8 files changed, 50 insertions(+), 36 deletions(-) (limited to 'src') diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index d0f322e3f8c..d67c8f08182 100755 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -804,7 +804,7 @@ void BattlegroundMgr::InitAutomaticArenaPointDistribution() sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Automatic Arena Point Distribution initialized."); } -void BattlegroundMgr::BuildBattlegroundListPacket(WorldPacket* data, uint64 guid, Player* player, BattlegroundTypeId bgTypeId, uint8 fromWhere) +void BattlegroundMgr::BuildBattlegroundListPacket(WorldPacket* data, uint64 guid, Player* player, BattlegroundTypeId bgTypeId) { if (!player) return; @@ -817,8 +817,8 @@ void BattlegroundMgr::BuildBattlegroundListPacket(WorldPacket* data, uint64 guid loser_kills = Trinity::Honor::hk_honor_at_level(player->getLevel(), float(loser_kills)); data->Initialize(SMSG_BATTLEFIELD_LIST); + // TODO: Fix guid *data << uint64(guid); // battlemaster guid - *data << uint8(fromWhere); // from where you joined *data << uint32(bgTypeId); // battleground id *data << uint8(0); // unk *data << uint8(0); // unk diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.h b/src/server/game/Battlegrounds/BattlegroundMgr.h index 989509111bb..02d19f40298 100755 --- a/src/server/game/Battlegrounds/BattlegroundMgr.h +++ b/src/server/game/Battlegrounds/BattlegroundMgr.h @@ -67,7 +67,7 @@ class BattlegroundMgr /* Packet Building */ void BuildPlayerJoinedBattlegroundPacket(WorldPacket* data, Player* player); void BuildPlayerLeftBattlegroundPacket(WorldPacket* data, uint64 guid); - void BuildBattlegroundListPacket(WorldPacket* data, uint64 guid, Player* player, BattlegroundTypeId bgTypeId, uint8 fromWhere); + void BuildBattlegroundListPacket(WorldPacket* data, uint64 guid, Player* player, BattlegroundTypeId bgTypeId); void BuildGroupJoinedBattlegroundPacket(WorldPacket* data, GroupJoinBattlegroundResult result); void BuildUpdateWorldStatePacket(WorldPacket* data, uint32 field, uint32 value); void BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg); diff --git a/src/server/game/Server/Protocol/Handlers/BattleGroundHandler.cpp b/src/server/game/Server/Protocol/Handlers/BattleGroundHandler.cpp index 95327a71374..33579d37967 100755 --- a/src/server/game/Server/Protocol/Handlers/BattleGroundHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/BattleGroundHandler.cpp @@ -66,7 +66,7 @@ void WorldSession::HandleBattlemasterHelloOpcode(WorldPacket & recv_data) void WorldSession::SendBattlegGroundList(uint64 guid, BattlegroundTypeId bgTypeId) { WorldPacket data; - sBattlegroundMgr->BuildBattlegroundListPacket(&data, guid, _player, bgTypeId, 0); + sBattlegroundMgr->BuildBattlegroundListPacket(&data, guid, _player, bgTypeId); SendPacket(&data); } @@ -308,19 +308,13 @@ void WorldSession::HandlePVPLogDataOpcode(WorldPacket & /*recv_data*/) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent MSG_PVP_LOG_DATA Message"); } -void WorldSession::HandleBattlefieldListOpcode(WorldPacket &recv_data) +void WorldSession::HandleBattlefieldListOpcode(WorldPacket& recv_data) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_BATTLEFIELD_LIST Message"); uint32 bgTypeId; recv_data >> bgTypeId; // id from DBC - uint8 fromWhere; - recv_data >> fromWhere; // 0 - battlemaster (lua: ShowBattlefieldList), 1 - UI (lua: RequestBattlegroundInstanceInfo) - - uint8 unk1; - recv_data >> unk1; // Unknown 3.2.2 - BattlemasterListEntry const* bl = sBattlemasterListStore.LookupEntry(bgTypeId); if (!bl) { @@ -329,7 +323,7 @@ void WorldSession::HandleBattlefieldListOpcode(WorldPacket &recv_data) } WorldPacket data; - sBattlegroundMgr->BuildBattlegroundListPacket(&data, 0, _player, BattlegroundTypeId(bgTypeId), fromWhere); + sBattlegroundMgr->BuildBattlegroundListPacket(&data, 0, _player, BattlegroundTypeId(bgTypeId)); SendPacket(&data); } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 4277792db13..16e22130a31 100755 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -292,7 +292,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(MSG_MOVE_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_TRIGGER_CINEMATIC_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_OPENING_CINEMATIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_TRIGGER_CINEMATIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TRIGGER_CINEMATIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_NEXT_CINEMATIC_CAMERA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNextCinematicCamera ); //DEFINE_OPCODE_HANDLER(CMSG_COMPLETE_CINEMATIC, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCompleteCinematic ); DEFINE_OPCODE_HANDLER(SMSG_TUTORIAL_FLAGS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -347,9 +347,9 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_CAST_SPELL, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleCastSpellOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_CAST, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleCancelCastOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_CAST_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELL_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELL_GO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELL_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELL_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELL_GO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELL_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELL_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COOLDOWN_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelAuraOpcode ); @@ -359,7 +359,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(MSG_CHANNEL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_CANCEL_CHANNELLING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelChanneling ); //DEFINE_OPCODE_HANDLER(SMSG_AI_REACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_SELECTION, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleSetSelectionOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_SET_SELECTION, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleSetSelectionOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_DELETEEQUIPMENT_SET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetDelete ); //DEFINE_OPCODE_HANDLER(CMSG_INSTANCE_LOCK_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInstanceLockResponse ); //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_PASSIVE_AURA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -380,7 +380,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_SPELLBREAKLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELLHEALLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELLENERGIZELOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BREAK_TARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BREAK_TARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SAVE_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SETDEATHBINDPOINT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_BINDPOINTUPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -506,7 +506,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_PLAYED_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_QUERY_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryTimeOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_QUERY_TIME_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LOG_XPGAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOG_XPGAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_AURACASTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_RECLAIM_CORPSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReclaimCorpseOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_WRAP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWrapItemOpcode ); @@ -719,7 +719,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_LOOT_MASTER_GIVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMasterGiveOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_LOOT_MASTER_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SET_FORCED_REACTIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELL_FAILED_OTHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELL_FAILED_OTHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_RESET_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_REPAIR_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepairItemOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_CHAT_PLAYER_NOT_FOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -850,7 +850,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_GHOSTEE_GONE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GM_UPDATE_TICKET_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_GM_TICKET_STATUS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(MSG_SET_DUNGEON_DIFFICULTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetDungeonDifficultyOpcode); + DEFINE_OPCODE_HANDLER(MSG_SET_DUNGEON_DIFFICULTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetDungeonDifficultyOpcode); //DEFINE_OPCODE_HANDLER(CMSG_GMSURVEY_SUBMIT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMSurveySubmit ); //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_INSTANCE_OWNERSHIP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_KNOCKBACK_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -1171,7 +1171,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_SET_GLYPH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_ACHIEVEMENT_EARNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DYNAMIC_DROP_ROLL_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CRITERIA_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CRITERIA_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_QUERY_INSPECT_ACHIEVEMENTS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryInspectAchievements ); //DEFINE_OPCODE_HANDLER(SMSG_RESPOND_INSPECT_ACHIEVEMENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_DISMISS_CONTROLLED_VEHICLE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDismissControlledVehicle ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index d3745b81307..b7a4a826e97 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -641,7 +641,7 @@ enum Opcodes SMSG_CORPSE_MAP_POSITION_QUERY_RESPONSE = 0x00, SMSG_CREATURE_QUERY_RESPONSE = 0xD847, SMSG_CRITERIA_DELETED = 0x00, - SMSG_CRITERIA_UPDATE = 0x00, + SMSG_CRITERIA_UPDATE = 0xD87F, SMSG_CROSSED_INEBRIATION_THRESHOLD = 0x00, SMSG_DAMAGE_CALC_LOG = 0x00, SMSG_DAMAGE_DONE_OBSOLETE = 0x00, @@ -788,7 +788,7 @@ enum Opcodes SMSG_LOGOUT_CANCEL_ACK = 0x00, SMSG_LOGOUT_COMPLETE = 0xCC6B, SMSG_LOGOUT_RESPONSE = 0x886A, - SMSG_LOG_XPGAIN = 0x00, + SMSG_LOG_XPGAIN = 0x4E7E, SMSG_LOOT_ALL_PASSED = 0x00, SMSG_LOOT_CLEAR_MONEY = 0x00, SMSG_LOOT_ITEM_NOTIFY = 0x00, @@ -889,7 +889,7 @@ enum Opcodes SMSG_QUERY_QUESTS_COMPLETED_RESPONSE = 0x00, SMSG_QUERY_TIME_RESPONSE = 0x00, SMSG_QUESTGIVER_OFFER_REWARD = 0x00, - SMSG_QUESTGIVER_QUEST_COMPLETE = 0x00, + SMSG_QUESTGIVER_QUEST_COMPLETE = 0x24EE, SMSG_QUESTGIVER_QUEST_DETAILS = 0xCE5F, SMSG_QUESTGIVER_QUEST_FAILED = 0xD8FF, SMSG_QUESTGIVER_QUEST_LIST = 0xDEF6, @@ -957,8 +957,8 @@ enum Opcodes SMSG_SPELL_COOLDOWN = 0x00, SMSG_SPELL_DELAYED = 0x00, SMSG_SPELLDISPELLOG = 0x00, - SMSG_SPELL_FAILED_OTHER = 0x00, - SMSG_SPELL_FAILURE = 0x00, + SMSG_SPELL_FAILED_OTHER = 0xCE4A, + SMSG_SPELL_FAILURE = 0x9A66, SMSG_SPELL_GO = 0x0A53, SMSG_SPELL_START = 0xCE43, SMSG_SPELLSTEALLOG = 0x00, @@ -991,7 +991,7 @@ enum Opcodes SMSG_TRAINER_BUY_RESULT = 0x00, SMSG_TRANSFER_ABORTED = 0x00, SMSG_TRANSFER_PENDING = 0x00, - SMSG_TRIGGER_CINEMATIC = 0x00, + SMSG_TRIGGER_CINEMATIC = 0xCE5B, SMSG_TRIGGER_MOVIE = 0x00, SMSG_TURN_IN_PETITION_RESULTS = 0x08DB, SMSG_TUTORIAL_FLAGS = 0x1A46, diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 06a6a347fef..2cc063fa662 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3763,7 +3763,7 @@ void Spell::SendSpellStart() if (castFlags & CAST_FLAG_POWER_LEFT_SELF) data << uint32(m_caster->GetPower((Powers)m_spellInfo->PowerType)); - if (castFlags & CAST_FLAG_UNKNOWN_23) + if (castFlags & CAST_FLAG_IMMUNITY) { data << uint32(0); data << uint32(0); @@ -3850,13 +3850,19 @@ void Spell::SendSpellGo() } } - if (castFlags & CAST_FLAG_UNKNOWN_18) // unknown wotlk + if (castFlags & CAST_FLAG_ADJUST_MISSILE) { data << float(0); data << uint32(0); } - if (castFlags & CAST_FLAG_UNKNOWN_20) // unknown wotlk + if (castFlags & CAST_FLAG_PROJECTILE) + { + data << uint32(0); // Ammo display ID + data << uint32(0); // Inventory Type + } + + if (castFlags & CAST_FLAG_VISUAL_CHAIN) { data << uint32(0); data << uint32(0); @@ -3867,6 +3873,20 @@ void Spell::SendSpellGo() data << uint8(0); } + if (m_targets.GetTargetMask() & TARGET_FLAG_EXTRA_TARGETS) + { + data << uint8(0); // Extra targets count + /* + for (uint8 i = 0; i < count; ++i) + { + data << float(0); // Target Position X + data << float(0); // Target Position Y + data << float(0); // Target Position Z + data << uint64(0); // Target Guid + } + */ + } + m_caster->SendMessageToSet(&data, true); } diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h index 02f415e88c3..f9a48bf6a87 100755 --- a/src/server/game/Spells/Spell.h +++ b/src/server/game/Spells/Spell.h @@ -43,7 +43,7 @@ enum SpellCastFlags CAST_FLAG_UNKNOWN_3 = 0x00000004, CAST_FLAG_UNKNOWN_4 = 0x00000008, // ignore AOE visual CAST_FLAG_UNKNOWN_5 = 0x00000010, - CAST_FLAG_UNKNOWN_6 = 0x00000020, + CAST_FLAG_PROJECTILE = 0x00000020, CAST_FLAG_UNKNOWN_7 = 0x00000040, CAST_FLAG_UNKNOWN_8 = 0x00000080, CAST_FLAG_UNKNOWN_9 = 0x00000100, @@ -55,16 +55,16 @@ enum SpellCastFlags CAST_FLAG_UNKNOWN_15 = 0x00004000, CAST_FLAG_UNKNOWN_16 = 0x00008000, CAST_FLAG_UNKNOWN_17 = 0x00010000, - CAST_FLAG_UNKNOWN_18 = 0x00020000, + CAST_FLAG_ADJUST_MISSILE = 0x00020000, CAST_FLAG_UNKNOWN_19 = 0x00040000, - CAST_FLAG_UNKNOWN_20 = 0x00080000, + CAST_FLAG_VISUAL_CHAIN = 0x00080000, CAST_FLAG_UNKNOWN_21 = 0x00100000, CAST_FLAG_RUNE_LIST = 0x00200000, CAST_FLAG_UNKNOWN_23 = 0x00400000, CAST_FLAG_UNKNOWN_24 = 0x00800000, CAST_FLAG_UNKNOWN_25 = 0x01000000, CAST_FLAG_UNKNOWN_26 = 0x02000000, - CAST_FLAG_UNKNOWN_27 = 0x04000000, + CAST_FLAG_IMMUNITY = 0x04000000, CAST_FLAG_UNKNOWN_28 = 0x08000000, CAST_FLAG_UNKNOWN_29 = 0x10000000, CAST_FLAG_UNKNOWN_30 = 0x20000000, diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h index 2414730fc75..dd8c793a687 100644 --- a/src/server/game/Spells/SpellInfo.h +++ b/src/server/game/Spells/SpellInfo.h @@ -59,7 +59,7 @@ enum SpellCastTargetFlags TARGET_FLAG_UNIT_MINIPET = 0x00010000, // pguid, used to validate target (if non combat pet) TARGET_FLAG_GLYPH_SLOT = 0x00020000, // used in glyph spells TARGET_FLAG_DEST_TARGET = 0x00040000, // sometimes appears with DEST_TARGET spells (may appear or not for a given spell) - TARGET_FLAG_UNUSED20 = 0x00080000, // uint32 counter, loop { vec3 - screen position (?), guid }, not used so far + TARGET_FLAG_EXTRA_TARGETS = 0x00080000, // uint32 counter, loop { vec3 - screen position (?), guid }, not used so far TARGET_FLAG_UNIT_PASSENGER = 0x00100000, // guessed, used to validate target (if vehicle passenger) TARGET_FLAG_UNIT_MASK = TARGET_FLAG_UNIT | TARGET_FLAG_UNIT_RAID | TARGET_FLAG_UNIT_PARTY -- cgit v1.2.3 From e667c4ab1dd5782ac9f8e51f366fd6475c5ddb33 Mon Sep 17 00:00:00 2001 From: Venugh Date: Sun, 27 Nov 2011 23:42:55 +0100 Subject: Core/Opcode: Fixed SMSG_FEATURE_SYSTEM_STATUS. thx to nay for help. --- src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp | 4 +++- src/server/game/Server/Protocol/Opcodes.h | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp index 9a72a559502..3a9245cd8f4 100755 --- a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp @@ -923,9 +923,11 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder) LoadAccountData(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADACCOUNTDATA), PER_CHARACTER_CACHE_MASK); SendAccountDataTimes(PER_CHARACTER_CACHE_MASK); - data.Initialize(SMSG_FEATURE_SYSTEM_STATUS, 2); // added in 2.2.0 + data.Initialize(SMSG_FEATURE_SYSTEM_STATUS, 7); // checked in 4.2.2 data << uint8(2); // unknown value data << uint8(0); // enable(1)/disable(0) voice chat interface in client + data << uint8(0); + data << uint32(0); // mail related SendPacket(&data); // Send MOTD diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index d3745b81307..d62c378421c 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -31,7 +31,7 @@ enum Opcodes NUM_OPCODE_HANDLERS = (0xFFFF+1), UNKNOWN_OPCODE = NUM_OPCODE_HANDLERS, NULL_OPCODE = 0, - + CMSG_ACCEPT_LEVEL_GRANT = 0xDC4B, CMSG_ACCEPT_TRADE = 0x00, CMSG_ACTIVATETAXI = 0x00, @@ -671,7 +671,7 @@ enum Opcodes SMSG_EQUIPMENT_SET_USE_RESULT = 0x00, SMSG_EXPECTED_SPAM_RECORDS = 0x00, SMSG_EXPLORATION_EXPERIENCE = 0x00, - SMSG_FEATURE_SYSTEM_STATUS = 0x00, + SMSG_FEATURE_SYSTEM_STATUS = 0x70CE, SMSG_FISH_ESCAPED = 0x9C66, SMSG_FISH_NOT_HOOKED = 0x18C3, SMSG_FORCEACTIONSHOW = 0x00, @@ -1029,7 +1029,7 @@ enum Opcodes SMSG_QUESTUPDATE_ADD_ITEM = 0x00, SMSG_OVERRIDE_LIGHT = 0x00, SMSG_RANDOMIZE_CHAR_NAME = 0xF0DC, // byte unk(0x80), string name - + CMSG_MOVE_SET_COLLISION_HGT = 0x00, SMSG_MOVE_SET_COLLISION_HGT = 0x00, }; -- cgit v1.2.3 From 487da95a924458acf323e8d99b4c87b15f6d0ed5 Mon Sep 17 00:00:00 2001 From: Rat Date: Mon, 28 Nov 2011 07:39:21 +0100 Subject: Core/Packets: added new opcodes for player movement and some others -enabled some handlers -temp disabled the movementhandler to prevent spamming bytebuffer exceptions, until correct structure is found --- .../Server/Protocol/Handlers/MovementHandler.cpp | 2 + src/server/game/Server/Protocol/Opcodes.cpp | 78 +++++++++++----------- src/server/game/Server/Protocol/Opcodes.h | 62 ++++++++--------- 3 files changed, 72 insertions(+), 70 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp b/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp index 4b2ebf2139e..22eb002ca71 100755 --- a/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp @@ -257,6 +257,8 @@ void WorldSession::HandleMovementOpcodes(WorldPacket & recv_data) return; } + return; //temp to prevent spamming of bytebuffer exceptions until correct structure is found + /* extract packet */ uint64 guid; diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 16e22130a31..6b7ea03ac5d 100755 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -223,29 +223,29 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_DESTROY_ITEMS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_CUSTOM_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_AREATRIGGER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaTriggerOpcode ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_FORWARD, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_BACKWARD, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_STRAFE_LEFT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_STRAFE_RIGHT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_STRAFE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_JUMP, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_TURN_LEFT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_TURN_RIGHT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_TURN, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_PITCH_UP, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_PITCH_DOWN, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_PITCH, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_MODE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_WALK_MODE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_START_FORWARD, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_START_BACKWARD, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_START_STRAFE_LEFT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_START_STRAFE_RIGHT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_STRAFE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_JUMP, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_START_TURN_LEFT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_START_TURN_RIGHT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_TURN, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_START_PITCH_UP, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_START_PITCH_DOWN, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_PITCH, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_MODE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_WALK_MODE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_TOGGLE_LOGGING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_TELEPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_TELEPORT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_TELEPORT_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveTeleportAck ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_TOGGLE_FALL_LOGGING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_FALL_LAND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_SWIM, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_SWIM, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_FALL_LAND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_START_SWIM, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_SWIM, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_BACK_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -260,8 +260,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_TURN_RATE_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_TOGGLE_COLLISION_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_FACING, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_PITCH, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_FACING, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_PITCH, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_WORLDPORT_ACK, STATUS_TRANSFER, PROCESS_THREADUNSAFE, &WorldSession::HandleMoveWorldportAckOpcode ); DEFINE_OPCODE_HANDLER(SMSG_MONSTER_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -280,7 +280,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_FORCE_MOVE_UNROOT_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveUnRootAck ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_UNROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_HEARTBEAT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_HEARTBEAT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_KNOCK_BACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_KNOCK_BACK_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveKnockBackAck ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_KNOCK_BACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -291,7 +291,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_MOVE_HOVER_ACK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMoveHoverAck ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_TRIGGER_CINEMATIC_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_OPENING_CINEMATIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_OPENING_CINEMATIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(SMSG_TRIGGER_CINEMATIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_NEXT_CINEMATIC_CAMERA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNextCinematicCamera ); //DEFINE_OPCODE_HANDLER(CMSG_COMPLETE_CINEMATIC, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCompleteCinematic ); @@ -302,23 +302,23 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_STANDSTATECHANGE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStandStateChangeOpcode ); DEFINE_OPCODE_HANDLER(CMSG_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEmoteOpcode ); DEFINE_OPCODE_HANDLER(SMSG_EMOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_TEXT_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTextEmoteOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_TEXT_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTextEmoteOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_TEXT_EMOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_AUTOEQUIP_GROUND_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_GROUND_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_LOOT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutostoreLootItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_STORE_LOOT_IN_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_AUTOEQUIP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoEquipItemOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_AUTOEQUIP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoEquipItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_BAG_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoStoreBagItemOpcode ); DEFINE_OPCODE_HANDLER(CMSG_SWAP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSwapItem ); DEFINE_OPCODE_HANDLER(CMSG_SWAP_INV_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSwapInvItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SPLIT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSplitItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_AUTOEQUIP_ITEM_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoEquipItemSlotOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_UNCLAIM_LICENSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_DESTROYITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDestroyItemOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_DESTROYITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDestroyItemOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_INVENTORY_CHANGE_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_OPEN_CONTAINER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_INSPECT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_INSPECT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_INSPECT_RESULTS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_INITIATE_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInitiateTradeOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_BEGIN_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBeginTradeOpcode ); @@ -360,7 +360,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_CANCEL_CHANNELLING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelChanneling ); //DEFINE_OPCODE_HANDLER(SMSG_AI_REACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_SET_SELECTION, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleSetSelectionOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_DELETEEQUIPMENT_SET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetDelete ); + DEFINE_OPCODE_HANDLER(CMSG_EQUIPMENT_SET_DELETE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetDelete ); //DEFINE_OPCODE_HANDLER(CMSG_INSTANCE_LOCK_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInstanceLockResponse ); //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_PASSIVE_AURA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_ATTACKSWING, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleAttackSwingOpcode ); @@ -542,7 +542,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(MSG_SAVE_GUILD_EMBLEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSaveGuildEmblemOpcode ); //DEFINE_OPCODE_HANDLER(MSG_TABARDVENDOR_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTabardVendorActivateOpcode); //DEFINE_OPCODE_HANDLER(SMSG_PLAY_SPELL_VISUAL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_ZONEUPDATE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleZoneUpdateOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_ZONEUPDATE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleZoneUpdateOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_PARTYKILLLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_UPDATE_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PLAY_SPELL_IMPACT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -559,9 +559,9 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_SKILL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnlearnSkillOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_REMOVED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_DECHARGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_CREATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketCreateOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_CREATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketCreateOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_CREATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_UPDATETEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketUpdateOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_UPDATETEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketUpdateOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_UPDATETEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ACCOUNT_DATA_TIMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_ACCOUNT_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestAccountData ); @@ -577,7 +577,7 @@ void InitOpcodes() ////DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_SPAWN_ANIM_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_DESPAWN_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(MSG_CORPSE_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCorpseQueryOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_DELETETICKET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketDeleteOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_DELETETICKET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketDeleteOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_DELETETICKET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHAT_WRONG_FACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_SYSTEMSTATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketSystemStatusOpcode); @@ -763,7 +763,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FEATHER_FALL_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleFeatherFallAck ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_WATER_WALK_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveWaterWalkAck ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_NOT_ACTIVE_MOVER, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveNotActiveMover ); - //DEFINE_OPCODE_HANDLER(SMSG_PLAY_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PLAY_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_STATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlefieldStatusOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_PORT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattleFieldPortOpcode ); @@ -797,7 +797,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_PET_UNLEARN_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PARTY_MEMBER_STATS_FULL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_PET_SPELL_AUTOCAST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetSpellAutocastOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_WEATHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_WEATHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PLAY_TIME_WARNING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MINIGAME_SETUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MINIGAME_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -898,8 +898,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamLeaderOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_JOIN_ARENA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlemasterJoinArena ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_ASCEND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_ASCEND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_START_ASCEND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_ASCEND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_LFG_JOIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgJoinOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LFG_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgLeaveOpcode ); @@ -976,7 +976,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_SET_EXTRA_AURA_INFO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SET_EXTRA_AURA_INFO_NEED_UPDATE_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_EXTRA_AURA_INFO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_DESCEND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_START_DESCEND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_REQUIREMENTS_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_IGNORE_REQUIREMENTS_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELL_CHANCE_PROC_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1254,7 +1254,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_SIGNUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_CLEAR_PENDING_ACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_EQUIPMENT_SET_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_EQUIPMENT_SET_SAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetSave ); + DEFINE_OPCODE_HANDLER(CMSG_EQUIPMENT_SET_SAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetSave ); //DEFINE_OPCODE_HANDLER(CMSG_UPDATE_PROJECTILE_POSITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateProjectilePosition ); //DEFINE_OPCODE_HANDLER(SMSG_SET_PROJECTILE_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TALENTS_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1278,7 +1278,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(MSG_MOVE_GRAVITY_CHNG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_GRAVITY_DISABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_GRAVITY_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_EQUIPMENT_SET_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetUse ); + DEFINE_OPCODE_HANDLER(CMSG_EQUIPMENT_SET_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetUse ); //DEFINE_OPCODE_HANDLER(SMSG_EQUIPMENT_SET_USE_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_FORCE_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_FORCE_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1323,7 +1323,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_READY_FOR_ACCOUNT_DATA_TIMES, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleReadyForAccountDataTimes ); //DEFINE_OPCODE_HANDLER(CMSG_QUERY_QUESTS_COMPLETED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryQuestsCompleted ); //DEFINE_OPCODE_HANDLER(SMSG_QUERY_QUESTS_COMPLETED_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_REPORT_LAG, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReportLag ); + DEFINE_OPCODE_HANDLER(CMSG_GM_REPORT_LAG, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReportLag ); //DEFINE_OPCODE_HANDLER(CMSG_AFK_MONITOR_INFO_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_AFK_MONITOR_INFO_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_AFK_MONITOR_INFO_CLEAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index dbbbbc201ea..9196f239b75 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -154,8 +154,8 @@ enum Opcodes CMSG_DUEL_ACCEPTED = 0x00, CMSG_DUEL_CANCELLED = 0x00, CMSG_EJECT_PASSENGER = 0x00, - CMSG_EQUIPMENT_SET_DELETE = 0x00, - CMSG_EQUIPMENT_SET_SAVE = 0x00, + CMSG_EQUIPMENT_SET_DELETE = 0x9cf2, + CMSG_EQUIPMENT_SET_SAVE = 0x5e5f, CMSG_EQUIPMENT_SET_USE = 0x4853, CMSG_EMOTE = 0x9843, CMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK = 0x00, @@ -181,14 +181,14 @@ enum Opcodes CMSG_GM_INVIS = 0x00, CMSG_GMRESPONSE_RESOLVE = 0x00, CMSG_GMSURVEY_SUBMIT = 0x00, - CMSG_GMTICKET_CREATE = 0x00, - CMSG_GMTICKET_DELETETICKET = 0x00, + CMSG_GMTICKET_CREATE = 0x0a7b, + CMSG_GMTICKET_DELETETICKET = 0x985f, CMSG_GMTICKET_GETTICKET = 0x00, CMSG_GMTICKET_SYSTEMSTATUS = 0x4A7A, CMSG_GMTICKET_UPDATETEXT = 0x8A7B, CMSG_GM_NUKE = 0x00, CMSG_GM_SET_SECURITY_GROUP = 0x00, - CMSG_GM_REPORT_LAG = 0x00, + CMSG_GM_REPORT_LAG = 0x9c6b, CMSG_GOSSIP_HELLO = 0xAD3, CMSG_GOSSIP_SELECT_OPTION = 0x984E, CMSG_GRANT_LEVEL = 0x1CD6, @@ -413,7 +413,7 @@ enum Opcodes CMSG_SWAP_ITEM = 0xDED6, CMSG_SWAP_INV_ITEM = 0x5CE7, CMSG_TELEPORT_TO_UNIT = 0x8C72, - CMSG_TEXT_EMOTE = 0x00, + CMSG_TEXT_EMOTE = 0x08d3, CMSG_TIME_SYNC_RESP = 0x07A5, CMSG_TAXICLEARALLNODES = 0x00, CMSG_TAXIENABLEALLNODES = 0x00, @@ -444,7 +444,7 @@ enum Opcodes CMSG_WORLD_STATE_UI_TIMER_UPDATE = 0x58F6, CMSG_WORLD_TELEPORT = 0x00, CMSG_WRAP_ITEM = 0x00, - CMSG_ZONEUPDATE = 0x00, + CMSG_ZONEUPDATE = 0x4ae2, MSG_AUCTION_HELLO = 0x00, MSG_CHANNEL_START = 0x00, MSG_CHANNEL_UPDATE = 0x00, @@ -459,24 +459,24 @@ enum Opcodes MSG_INSPECT_ARENA_TEAMS = 0x00, MSG_LIST_STABLED_PETS = 0x88CA, MSG_MINIMAP_PING = 0x00, - MSG_MOVE_FALL_LAND = 0x00, - MSG_MOVE_HEARTBEAT = 0x00, + MSG_MOVE_FALL_LAND = 0x00a5, + MSG_MOVE_HEARTBEAT = 0xb024, MSG_MOVE_HOVER = 0x00, - MSG_MOVE_JUMP = 0xE4E, + MSG_MOVE_JUMP = 0x9225, MSG_MOVE_KNOCK_BACK = 0x00, MSG_MOVE_ROOT = 0x00, MSG_MOVE_SET_ALL_SPEED_CHEAT = 0x00, - MSG_MOVE_SET_FACING = 0x00, + MSG_MOVE_SET_FACING = 0x02a4, MSG_MOVE_SET_FLIGHT_BACK_SPEED = 0x00, MSG_MOVE_SET_FLIGHT_BACK_SPEED_CHEAT = 0x00, MSG_MOVE_SET_FLIGHT_SPEED = 0x00, MSG_MOVE_SET_FLIGHT_SPEED_CHEAT = 0x00, - MSG_MOVE_SET_PITCH = 0x00, + MSG_MOVE_SET_PITCH = 0xa7a5, MSG_MOVE_SET_PITCH_RATE = 0x00, MSG_MOVE_SET_RAW_POSITION_ACK = 0x00, MSG_MOVE_SET_RUN_BACK_SPEED = 0x00, MSG_MOVE_SET_RUN_BACK_SPEED_CHEAT = 0x00, - MSG_MOVE_SET_RUN_MODE = 0x00, + MSG_MOVE_SET_RUN_MODE = 0x21a4, MSG_MOVE_SET_RUN_SPEED_CHEAT = 0x00, MSG_MOVE_SET_RUN_SPEED = 0x00, MSG_MOVE_SET_SWIM_BACK_SPEED = 0x00, @@ -485,26 +485,26 @@ enum Opcodes MSG_MOVE_SET_SWIM_SPEED_CHEAT = 0x00, MSG_MOVE_SET_TURN_RATE = 0x00, MSG_MOVE_SET_TURN_RATE_CHEAT = 0x00, - MSG_MOVE_SET_WALK_MODE = 0x00, + MSG_MOVE_SET_WALK_MODE = 0x24a4, MSG_MOVE_SET_WALK_SPEED = 0x00, MSG_MOVE_SET_WALK_SPEED_CHEAT = 0x00, - MSG_MOVE_START_ASCEND = 0x00, - MSG_MOVE_START_DESCEND = 0x00, - MSG_MOVE_STOP_ASCEND = 0x00, - MSG_MOVE_START_BACKWARD = 0x00, - MSG_MOVE_START_FORWARD = 0x00, - MSG_MOVE_START_PITCH_UP = 0x00, - MSG_MOVE_START_PITCH_DOWN = 0x00, - MSG_MOVE_START_TURN_LEFT = 0x00, - MSG_MOVE_START_TURN_RIGHT = 0x00, - MSG_MOVE_START_STRAFE_LEFT = 0x00, - MSG_MOVE_START_STRAFE_RIGHT = 0x00, - MSG_MOVE_START_SWIM = 0x00, - MSG_MOVE_STOP = 0x00, - MSG_MOVE_STOP_PITCH = 0x00, - MSG_MOVE_STOP_TURN = 0x00, - MSG_MOVE_STOP_STRAFE = 0x00, - MSG_MOVE_STOP_SWIM = 0x00, + MSG_MOVE_START_ASCEND = 0x0624, + MSG_MOVE_START_DESCEND = 0x2624, + MSG_MOVE_STOP_ASCEND = 0x1125, + MSG_MOVE_START_BACKWARD = 0x10a5, + MSG_MOVE_START_FORWARD = 0xa0a4, + MSG_MOVE_START_PITCH_UP = 0x9524, + MSG_MOVE_START_PITCH_DOWN = 0x2025, + MSG_MOVE_START_TURN_LEFT = 0x01a5, + MSG_MOVE_START_TURN_RIGHT = 0xb6a4, + MSG_MOVE_START_STRAFE_LEFT = 0xa024, + MSG_MOVE_START_STRAFE_RIGHT = 0x9125, + MSG_MOVE_START_SWIM = 0x85a4, + MSG_MOVE_STOP = 0xa3a4, + MSG_MOVE_STOP_PITCH = 0x8425, + MSG_MOVE_STOP_TURN = 0x90a4, + MSG_MOVE_STOP_STRAFE = 0x0125, + MSG_MOVE_STOP_SWIM = 0xb424, MSG_MOVE_TOGGLE_LOGGING = 0x00, MSG_MOVE_TIME_SKIPPED = 0x00, MSG_MOVE_TELEPORT = 0x00, -- cgit v1.2.3 From c1d6359218c117380173323df81aca634cd3fbe3 Mon Sep 17 00:00:00 2001 From: Rat Date: Mon, 28 Nov 2011 15:50:25 +0100 Subject: Core/Packets: CANCEL_AURA "fix" -Updates to WorldPacket and MovementInfo --- src/server/game/Entities/Object/Object.h | 27 ++++++++++++++------------- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- src/server/game/Server/Protocol/Opcodes.h | 2 +- 3 files changed, 16 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index fc0f93ce51a..ab6b534cac0 100755 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -461,25 +461,26 @@ ByteBuffer& operator<<(ByteBuffer& buf, Position::PositionXYZOStreamer const& st struct MovementInfo { // common - uint64 guid; - uint32 flags; - uint16 flags2; + uint64 guid; + uint32 flags; + uint16 flags2; Position pos; - uint32 time; + uint32 time; // transport - uint64 t_guid; + uint64 t_guid; Position t_pos; - uint32 t_time; - uint32 t_time2; - int8 t_seat; + uint32 t_time; + uint32 t_time2; + uint32 t_time3; + int8 t_seat; // swimming/flying - float pitch; + float pitch; // falling - uint32 fallTime; + uint32 fallTime; // jumping - float j_zspeed, j_sinAngle, j_cosAngle, j_xyspeed; + float j_zspeed, j_sinAngle, j_cosAngle, j_xyspeed; // spline - float splineElevation; + float splineElevation; MovementInfo() { @@ -487,7 +488,7 @@ struct MovementInfo guid = 0; flags = 0; flags2 = 0; - time = t_time = t_time2 = fallTime = 0; + time = t_time = t_time2 = t_time3 = fallTime = 0; splineElevation = 0; pitch = j_zspeed = j_sinAngle = j_cosAngle = j_xyspeed = 0.0f; t_guid = 0; diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 6b7ea03ac5d..05276094a25 100755 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -352,7 +352,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_SPELL_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELL_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COOLDOWN_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelAuraOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_CANCEL_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelAuraOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_EQUIPMENT_SET_SAVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_CAST_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(MSG_CHANNEL_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 9196f239b75..21fa2b82b8b 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -96,7 +96,7 @@ enum Opcodes CMSG_CALENDAR_GUILD_FILTER = 0x00, CMSG_CALENDAR_REMOVE_EVENT = 0x00, CMSG_CALENDAR_UPDATE_EVENT = 0x5CD2, - CMSG_CANCEL_AURA = 0x00, + CMSG_CANCEL_AURA = 0x9c43, CMSG_CANCEL_AUTO_REPEAT_SPELL = 0x5CEE, CMSG_CANCEL_CAST = 0x00, CMSG_CANCEL_CHANNELLING = 0xC8FE, -- cgit v1.2.3 From 699574267c15a525d3e47e62495c52159b8b2a3d Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 28 Nov 2011 15:59:49 +0000 Subject: Core/Chat: Fix most chat opcodes TODO: Addon chat handling and some chat types (raid, bg, dnd, afk) --- src/server/game/Entities/Player/Player.cpp | 2 +- src/server/game/Miscellaneous/SharedDefines.h | 2 +- .../game/Server/Protocol/Handlers/ChatHandler.cpp | 59 +++++++++++++++++++++- src/server/game/Server/Protocol/Opcodes.cpp | 24 +++++++-- src/server/game/Server/Protocol/Opcodes.h | 49 +++++++++--------- 5 files changed, 104 insertions(+), 32 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index ea3600d006d..0bbf95fe890 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -7680,8 +7680,8 @@ void Player::DuelComplete(DuelCompleteType type) { data.Initialize(SMSG_DUEL_WINNER, (1+20)); // we guess size data << uint8(type == DUEL_WON ? 0 : 1); // 0 = just won; 1 = fled - data << duel->opponent->GetName(); data << GetName(); + data << duel->opponent->GetName(); SendMessageToSet(&data, true); } diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 8c4dba94201..a95f29c17d9 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -2738,7 +2738,7 @@ enum WeatherType enum ChatMsg { - CHAT_MSG_ADDON = 0xFFFFFFFF, + CHAT_MSG_ADDON = 0xFFFFFFFF, // -1 CHAT_MSG_SYSTEM = 0x00, CHAT_MSG_SAY = 0x01, CHAT_MSG_PARTY = 0x02, diff --git a/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp b/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp index 852549b3f53..3c8b1d8e033 100755 --- a/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp @@ -65,10 +65,65 @@ bool WorldSession::processChatmessageFurtherAfterSecurityChecks(std::string& msg void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) { - uint32 type; + uint32 type = 0; uint32 lang; - recv_data >> type; + switch(recv_data.GetOpcode()) + { + case CMSG_MESSAGECHAT_SAY: + type = CHAT_MSG_SAY; + break; + case CMSG_MESSAGECHAT_YELL: + type = CHAT_MSG_YELL; + break; + case CMSG_MESSAGECHAT_CHANNEL: + type = CHAT_MSG_CHANNEL; + break; + case CMSG_MESSAGECHAT_WHISPER: + type = CHAT_MSG_WHISPER; + break; + case CMSG_MESSAGECHAT_GUILD: + type = CHAT_MSG_GUILD; + break; + //case CMSG_MESSAGECHAT_OFFICER: + // type = CHAT_MSG_OFFICER; + // break; + //case CMSG_MESSAGECHAT_AFK: + // type = CHAT_MSG_AFK; + // break; + //case CMSG_MESSAGECHAT_DND: + // type = CHAT_MSG_DND; + // break; + case CMSG_MESSAGECHAT_EMOTE: + type = CHAT_MSG_EMOTE; + break; + case CMSG_MESSAGECHAT_PARTY: + type = CHAT_MSG_PARTY; + break; + //case CMSG_MESSAGECHAT_PARTY_LEADER: + // type = CHAT_MSG_PARTY_LEADER; + // break; + //case CMSG_MESSAGECHAT_RAID: + // type = CHAT_MSG_RAID; + // break; + //case CMSG_MESSAGECHAT_RAID_LEADER: + // type = CHAT_MSG_RAID_LEADER; + // break; + //case CMSG_MESSAGECHAT_BATTLEGROUND: + // type = CHAT_MSG_BATTLEGROUND; + // break; + //case CMSG_MESSAGECHAT_BATTLEGROUND_LEADER: + // type = CHAT_MSG_BATTLEGROUND_LEADER; + // break; + //case CMSG_MESSAGECHAT_RAID_WARNING: + // type = CHAT_MSG_RAID_WARNING; + // break; + default: + sLog->outDetail("HandleMessagechatOpcode : Unknown chat opcode (%u)", recv_data.GetOpcode()); + recv_data.hexlike(); + return; + } + recv_data >> lang; if (type >= MAX_CHAT_MSG_TYPE) diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 05276094a25..89e26dbfef7 100755 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -191,8 +191,24 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_GUILD_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(UMSG_UPDATE_GUILD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_MESSAGECHAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_X, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_AFK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_BATTLEGROUND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_BATTLEGROUND_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_DND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_GUILD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_OFFICER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_PARTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_PARTY_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_RAID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_RAID_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_RAID_WARNING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_SAY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_WHISPER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_YELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(SMSG_MESSAGECHAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_JOIN_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleJoinChannel ); //DEFINE_OPCODE_HANDLER(CMSG_LEAVE_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLeaveChannel ); //DEFINE_OPCODE_HANDLER(SMSG_CHANNEL_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -405,7 +421,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_DUEL_OUTOFBOUNDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DUEL_INBOUNDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DUEL_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DUEL_WINNER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_DUEL_WINNER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_DUEL_ACCEPTED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDuelAcceptedOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_DUEL_CANCELLED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDuelCancelledOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_MOUNTRESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1010,7 +1026,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(MSG_RAID_READY_CHECK_FINISHED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidReadyCheckFinishedOpcode); //DEFINE_OPCODE_HANDLER(CMSG_COMPLAIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleComplainOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_COMPLAIN_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_FEATURE_SYSTEM_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_FEATURE_SYSTEM_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GM_SHOW_COMPLAINTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GM_UNSQUELCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_SILENCE_VOICE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 21fa2b82b8b..9c74d58d374 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -96,7 +96,7 @@ enum Opcodes CMSG_CALENDAR_GUILD_FILTER = 0x00, CMSG_CALENDAR_REMOVE_EVENT = 0x00, CMSG_CALENDAR_UPDATE_EVENT = 0x5CD2, - CMSG_CANCEL_AURA = 0x9c43, + CMSG_CANCEL_AURA = 0x9C43, CMSG_CANCEL_AUTO_REPEAT_SPELL = 0x5CEE, CMSG_CANCEL_CAST = 0x00, CMSG_CANCEL_CHANNELLING = 0xC8FE, @@ -154,8 +154,8 @@ enum Opcodes CMSG_DUEL_ACCEPTED = 0x00, CMSG_DUEL_CANCELLED = 0x00, CMSG_EJECT_PASSENGER = 0x00, - CMSG_EQUIPMENT_SET_DELETE = 0x9cf2, - CMSG_EQUIPMENT_SET_SAVE = 0x5e5f, + CMSG_EQUIPMENT_SET_DELETE = 0x9CF2, + CMSG_EQUIPMENT_SET_SAVE = 0x5E5F, CMSG_EQUIPMENT_SET_USE = 0x4853, CMSG_EMOTE = 0x9843, CMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK = 0x00, @@ -181,14 +181,14 @@ enum Opcodes CMSG_GM_INVIS = 0x00, CMSG_GMRESPONSE_RESOLVE = 0x00, CMSG_GMSURVEY_SUBMIT = 0x00, - CMSG_GMTICKET_CREATE = 0x0a7b, - CMSG_GMTICKET_DELETETICKET = 0x985f, + CMSG_GMTICKET_CREATE = 0x0A7B, + CMSG_GMTICKET_DELETETICKET = 0x985F, CMSG_GMTICKET_GETTICKET = 0x00, CMSG_GMTICKET_SYSTEMSTATUS = 0x4A7A, CMSG_GMTICKET_UPDATETEXT = 0x8A7B, CMSG_GM_NUKE = 0x00, CMSG_GM_SET_SECURITY_GROUP = 0x00, - CMSG_GM_REPORT_LAG = 0x9c6b, + CMSG_GM_REPORT_LAG = 0x9C6B, CMSG_GOSSIP_HELLO = 0xAD3, CMSG_GOSSIP_SELECT_OPTION = 0x984E, CMSG_GRANT_LEVEL = 0x1CD6, @@ -198,7 +198,7 @@ enum Opcodes CMSG_GROUP_CHANGE_SUB_GROUP = 0x1AD2, CMSG_GROUP_DECLINE = 0x00, CMSG_GROUP_DISBAND = 0x00, - CMSG_GROUP_INVITE = 0x00, + CMSG_GROUP_INVITE = 0xC88A, CMSG_GROUP_RAID_CONVERT = 0xC85A, CMSG_GROUP_SET_LEADER = 0xCEC7, CMSG_GROUP_SWAP_SUB_GROUP = 0x5AD7, @@ -274,7 +274,8 @@ enum Opcodes CMSG_MESSAGECHAT_AFK = 0x00, CMSG_MESSAGECHAT_BATTLEGROUND = 0x00, CMSG_MESSAGECHAT_BATTLEGROUND_LEADER = 0x00, - CMSG_MESSAGECHAT_ADDON = 0x24D9, + //CMSG_MESSAGECHAT_ADDON_GUILD = 0x24D9, // Not confirmed, new on 4.x + //CMSG_MESSAGECHAT_ADDON_WHISPER = 0x20C1, // Not confirmed, new on 4.x CMSG_MESSAGECHAT_CHANNEL = 0x7459, CMSG_MESSAGECHAT_DND = 0x00, CMSG_MESSAGECHAT_EMOTE = 0x6449, @@ -413,7 +414,7 @@ enum Opcodes CMSG_SWAP_ITEM = 0xDED6, CMSG_SWAP_INV_ITEM = 0x5CE7, CMSG_TELEPORT_TO_UNIT = 0x8C72, - CMSG_TEXT_EMOTE = 0x08d3, + CMSG_TEXT_EMOTE = 0x08D3, CMSG_TIME_SYNC_RESP = 0x07A5, CMSG_TAXICLEARALLNODES = 0x00, CMSG_TAXIENABLEALLNODES = 0x00, @@ -444,7 +445,7 @@ enum Opcodes CMSG_WORLD_STATE_UI_TIMER_UPDATE = 0x58F6, CMSG_WORLD_TELEPORT = 0x00, CMSG_WRAP_ITEM = 0x00, - CMSG_ZONEUPDATE = 0x4ae2, + CMSG_ZONEUPDATE = 0x4AE2, MSG_AUCTION_HELLO = 0x00, MSG_CHANNEL_START = 0x00, MSG_CHANNEL_UPDATE = 0x00, @@ -460,23 +461,23 @@ enum Opcodes MSG_LIST_STABLED_PETS = 0x88CA, MSG_MINIMAP_PING = 0x00, MSG_MOVE_FALL_LAND = 0x00a5, - MSG_MOVE_HEARTBEAT = 0xb024, + MSG_MOVE_HEARTBEAT = 0xB024, MSG_MOVE_HOVER = 0x00, MSG_MOVE_JUMP = 0x9225, MSG_MOVE_KNOCK_BACK = 0x00, MSG_MOVE_ROOT = 0x00, MSG_MOVE_SET_ALL_SPEED_CHEAT = 0x00, - MSG_MOVE_SET_FACING = 0x02a4, + MSG_MOVE_SET_FACING = 0x02A4, MSG_MOVE_SET_FLIGHT_BACK_SPEED = 0x00, MSG_MOVE_SET_FLIGHT_BACK_SPEED_CHEAT = 0x00, MSG_MOVE_SET_FLIGHT_SPEED = 0x00, MSG_MOVE_SET_FLIGHT_SPEED_CHEAT = 0x00, - MSG_MOVE_SET_PITCH = 0xa7a5, + MSG_MOVE_SET_PITCH = 0xA7A5, MSG_MOVE_SET_PITCH_RATE = 0x00, MSG_MOVE_SET_RAW_POSITION_ACK = 0x00, MSG_MOVE_SET_RUN_BACK_SPEED = 0x00, MSG_MOVE_SET_RUN_BACK_SPEED_CHEAT = 0x00, - MSG_MOVE_SET_RUN_MODE = 0x21a4, + MSG_MOVE_SET_RUN_MODE = 0x21A4, MSG_MOVE_SET_RUN_SPEED_CHEAT = 0x00, MSG_MOVE_SET_RUN_SPEED = 0x00, MSG_MOVE_SET_SWIM_BACK_SPEED = 0x00, @@ -491,20 +492,20 @@ enum Opcodes MSG_MOVE_START_ASCEND = 0x0624, MSG_MOVE_START_DESCEND = 0x2624, MSG_MOVE_STOP_ASCEND = 0x1125, - MSG_MOVE_START_BACKWARD = 0x10a5, - MSG_MOVE_START_FORWARD = 0xa0a4, + MSG_MOVE_START_BACKWARD = 0x10A5, + MSG_MOVE_START_FORWARD = 0xA0A4, MSG_MOVE_START_PITCH_UP = 0x9524, MSG_MOVE_START_PITCH_DOWN = 0x2025, - MSG_MOVE_START_TURN_LEFT = 0x01a5, - MSG_MOVE_START_TURN_RIGHT = 0xb6a4, - MSG_MOVE_START_STRAFE_LEFT = 0xa024, + MSG_MOVE_START_TURN_LEFT = 0x01A5, + MSG_MOVE_START_TURN_RIGHT = 0xB6A4, + MSG_MOVE_START_STRAFE_LEFT = 0xA024, MSG_MOVE_START_STRAFE_RIGHT = 0x9125, - MSG_MOVE_START_SWIM = 0x85a4, - MSG_MOVE_STOP = 0xa3a4, + MSG_MOVE_START_SWIM = 0x85A4, + MSG_MOVE_STOP = 0xA3A4, MSG_MOVE_STOP_PITCH = 0x8425, - MSG_MOVE_STOP_TURN = 0x90a4, + MSG_MOVE_STOP_TURN = 0x90A4, MSG_MOVE_STOP_STRAFE = 0x0125, - MSG_MOVE_STOP_SWIM = 0xb424, + MSG_MOVE_STOP_SWIM = 0xB424, MSG_MOVE_TOGGLE_LOGGING = 0x00, MSG_MOVE_TIME_SKIPPED = 0x00, MSG_MOVE_TELEPORT = 0x00, @@ -659,7 +660,7 @@ enum Opcodes SMSG_DUEL_COMPLETE = 0x00, SMSG_DUEL_COUNTDOWN = 0x00, SMSG_DUEL_REQUESTED = 0x00, - SMSG_DUEL_WINNER = 0x00, + SMSG_DUEL_WINNER = 0xDA52, SMSG_DURABILITY_DAMAGE_DEATH = 0x00, SMSG_ECHO_PARTY_SQUELCH = 0x00, SMSG_EMOTE = 0xC67, -- cgit v1.2.3 From e3017f6e2a9e3647276837d36528ebda1fe30338 Mon Sep 17 00:00:00 2001 From: Venugh Date: Mon, 28 Nov 2011 17:53:44 +0100 Subject: Core/Player: Correct val in SMSG_POWER_UPDATE. --- src/server/game/Entities/Unit/Unit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index fae8d877fe3..d1e9d812668 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -13646,7 +13646,7 @@ void Unit::SetPower(Powers power, int32 val) data.append(GetPackGUID()); data << uint32(1);//unk data << uint8(GetPowerIndexByClass(power, getClass())); - data << uint32(val); + data << int32(val); SendMessageToSet(&data, GetTypeId() == TYPEID_PLAYER ? true : false); // group update -- cgit v1.2.3 From 1a1cf8d263b62dd3bd3e241c6e79bfe8bad6f021 Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 28 Nov 2011 17:22:21 +0000 Subject: Core/GOs: Update `gameobject_template` and SMSG_GAMEOBJECT_QUERY_RESPONSE --- .../world/4.x/2011_11_27_00_world_spell_script.sql | 6 +++ .../2011_11_28_00_world_gameobject_template.sql | 9 ++++ src/server/game/Entities/GameObject/GameObject.h | 1 + src/server/game/Globals/ObjectMgr.cpp | 59 +++++++++++----------- src/server/game/Miscellaneous/SharedDefines.h | 2 +- .../game/Server/Protocol/Handlers/QueryHandler.cpp | 6 ++- src/server/game/Server/Protocol/Opcodes.cpp | 10 ++-- 7 files changed, 55 insertions(+), 38 deletions(-) create mode 100644 sql/updates/world/4.x/2011_11_27_00_world_spell_script.sql create mode 100644 sql/updates/world/4.x/2011_11_28_00_world_gameobject_template.sql (limited to 'src') diff --git a/sql/updates/world/4.x/2011_11_27_00_world_spell_script.sql b/sql/updates/world/4.x/2011_11_27_00_world_spell_script.sql new file mode 100644 index 00000000000..5411d660c2b --- /dev/null +++ b/sql/updates/world/4.x/2011_11_27_00_world_spell_script.sql @@ -0,0 +1,6 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_gen_damage_reduction_aura'; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(20911,'spell_gen_damage_reduction_aura'), -- Blessing of Sanctuary +(25899,'spell_gen_damage_reduction_aura'), -- Greater Blessing of Sanctuary +(63944,'spell_gen_damage_reduction_aura'), -- Renewed Hope +(50720,'spell_gen_damage_reduction_aura'); -- Vigilance diff --git a/sql/updates/world/4.x/2011_11_28_00_world_gameobject_template.sql b/sql/updates/world/4.x/2011_11_28_00_world_gameobject_template.sql new file mode 100644 index 00000000000..236f6acc6ae --- /dev/null +++ b/sql/updates/world/4.x/2011_11_28_00_world_gameobject_template.sql @@ -0,0 +1,9 @@ +ALTER TABLE `gameobject_template` ADD `data24` INT(10) NOT NULL DEFAULT '0' AFTER `data23`; +ALTER TABLE `gameobject_template` ADD `data25` INT(10) NOT NULL DEFAULT '0' AFTER `data24`; +ALTER TABLE `gameobject_template` ADD `data26` INT(10) NOT NULL DEFAULT '0' AFTER `data25`; +ALTER TABLE `gameobject_template` ADD `data27` INT(10) NOT NULL DEFAULT '0' AFTER `data26`; +ALTER TABLE `gameobject_template` ADD `data28` INT(10) NOT NULL DEFAULT '0' AFTER `data27`; +ALTER TABLE `gameobject_template` ADD `data29` INT(10) NOT NULL DEFAULT '0' AFTER `data28`; +ALTER TABLE `gameobject_template` ADD `data30` INT(10) NOT NULL DEFAULT '0' AFTER `data29`; +ALTER TABLE `gameobject_template` ADD `data31` INT(10) NOT NULL DEFAULT '0' AFTER `data30`; +ALTER TABLE `gameobject_template` ADD `unkInt32` INT(10) NOT NULL DEFAULT '0' AFTER `data31`; -- Unk size diff --git a/src/server/game/Entities/GameObject/GameObject.h b/src/server/game/Entities/GameObject/GameObject.h index 9167b40d285..d6ddc29a3e0 100755 --- a/src/server/game/Entities/GameObject/GameObject.h +++ b/src/server/game/Entities/GameObject/GameObject.h @@ -51,6 +51,7 @@ struct GameObjectTemplate uint32 flags; float size; uint32 questItems[MAX_GAMEOBJECT_QUEST_ITEMS]; + int32 unkInt32; union // different GO types have different data field { //0 GAMEOBJECT_TYPE_DOOR diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index be9c11a0f26..4680d6edc4f 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -6489,8 +6489,10 @@ void ObjectMgr::LoadGameObjectTemplate() QueryResult result = WorldDatabase.Query("SELECT entry, type, displayId, name, IconName, castBarCaption, unk1, faction, flags, size, questItem1, questItem2, questItem3, " // 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 "questItem4, questItem5, questItem6, data0, data1, data2, data3, data4, data5, data6, data7, data8, data9, data10, data11, data12, " - // 29 30 31 32 33 34 35 36 37 38 39 40 41 - "data13, data14, data15, data16, data17, data18, data19, data20, data21, data22, data23, AIName, ScriptName " + // 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 + "data13, data14, data15, data16, data17, data18, data19, data20, data21, data22, data23, data24, data25, data26, data27, data28, " + // 45 46 47 48 49 50 + "data29, data30, data31, unkInt32, AIName, ScriptName " "FROM gameobject_template"); if (!result) @@ -6521,44 +6523,41 @@ void ObjectMgr::LoadGameObjectTemplate() got.size = fields[9].GetFloat(); for (uint8 i = 0; i < MAX_GAMEOBJECT_QUEST_ITEMS; ++i) - { got.questItems[i] = fields[10 + i].GetUInt32(); - } for (uint8 i = 0; i < MAX_GAMEOBJECT_DATA; ++i) - { got.raw.data[i] = fields[16 + i].GetUInt32(); - } - got.AIName = fields[40].GetString(); - got.ScriptId = GetScriptId(fields[41].GetCString()); + got.unkInt32 = fields[48].GetInt32(); + got.AIName = fields[49].GetString(); + got.ScriptId = GetScriptId(fields[50].GetCString()); // Checks switch (got.type) { - case GAMEOBJECT_TYPE_DOOR: //0 + case GAMEOBJECT_TYPE_DOOR: //0 { if (got.door.lockId) CheckGOLockId(&got, got.door.lockId, 1); CheckGONoDamageImmuneId(&got, got.door.noDamageImmune, 3); break; } - case GAMEOBJECT_TYPE_BUTTON: //1 + case GAMEOBJECT_TYPE_BUTTON: //1 { if (got.button.lockId) CheckGOLockId(&got, got.button.lockId, 1); CheckGONoDamageImmuneId(&got, got.button.noDamageImmune, 4); break; } - case GAMEOBJECT_TYPE_QUESTGIVER: //2 + case GAMEOBJECT_TYPE_QUESTGIVER: //2 { if (got.questgiver.lockId) CheckGOLockId(&got, got.questgiver.lockId, 0); CheckGONoDamageImmuneId(&got, got.questgiver.noDamageImmune, 5); break; } - case GAMEOBJECT_TYPE_CHEST: //3 + case GAMEOBJECT_TYPE_CHEST: //3 { if (got.chest.lockId) CheckGOLockId(&got, got.chest.lockId, 0); @@ -6569,16 +6568,16 @@ void ObjectMgr::LoadGameObjectTemplate() CheckGOLinkedTrapId(&got, got.chest.linkedTrapId, 7); break; } - case GAMEOBJECT_TYPE_TRAP: //6 + case GAMEOBJECT_TYPE_TRAP: //6 { if (got.trap.lockId) CheckGOLockId(&got, got.trap.lockId, 0); break; } - case GAMEOBJECT_TYPE_CHAIR: //7 - CheckAndFixGOChairHeightId(&got, got.chair.height, 1); - break; - case GAMEOBJECT_TYPE_SPELL_FOCUS: //8 + case GAMEOBJECT_TYPE_CHAIR: //7 + CheckAndFixGOChairHeightId(&got, got.chair.height, 1); + break; + case GAMEOBJECT_TYPE_SPELL_FOCUS: //8 { if (got.spellFocus.focusId) { @@ -6591,7 +6590,7 @@ void ObjectMgr::LoadGameObjectTemplate() CheckGOLinkedTrapId(&got, got.spellFocus.linkedTrapId, 2); break; } - case GAMEOBJECT_TYPE_GOOBER: //10 + case GAMEOBJECT_TYPE_GOOBER: //10 { if (got.goober.lockId) CheckGOLockId(&got, got.goober.lockId, 0); @@ -6609,19 +6608,19 @@ void ObjectMgr::LoadGameObjectTemplate() CheckGOLinkedTrapId(&got, got.goober.linkedTrapId, 12); break; } - case GAMEOBJECT_TYPE_AREADAMAGE: //12 + case GAMEOBJECT_TYPE_AREADAMAGE: //12 { if (got.areadamage.lockId) CheckGOLockId(&got, got.areadamage.lockId, 0); break; } - case GAMEOBJECT_TYPE_CAMERA: //13 + case GAMEOBJECT_TYPE_CAMERA: //13 { if (got.camera.lockId) CheckGOLockId(&got, got.camera.lockId, 0); break; } - case GAMEOBJECT_TYPE_MO_TRANSPORT: //15 + case GAMEOBJECT_TYPE_MO_TRANSPORT: //15 { if (got.moTransport.taxiPathId) { @@ -6631,37 +6630,37 @@ void ObjectMgr::LoadGameObjectTemplate() } break; } - case GAMEOBJECT_TYPE_SUMMONING_RITUAL: //18 - break; - case GAMEOBJECT_TYPE_SPELLCASTER: //22 + case GAMEOBJECT_TYPE_SUMMONING_RITUAL: //18 + break; + case GAMEOBJECT_TYPE_SPELLCASTER: //22 { // always must have spell CheckGOSpellId(&got, got.spellcaster.spellId, 0); break; } - case GAMEOBJECT_TYPE_FLAGSTAND: //24 + case GAMEOBJECT_TYPE_FLAGSTAND: //24 { if (got.flagstand.lockId) CheckGOLockId(&got, got.flagstand.lockId, 0); CheckGONoDamageImmuneId(&got, got.flagstand.noDamageImmune, 5); break; } - case GAMEOBJECT_TYPE_FISHINGHOLE: //25 + case GAMEOBJECT_TYPE_FISHINGHOLE: //25 { if (got.fishinghole.lockId) CheckGOLockId(&got, got.fishinghole.lockId, 4); break; } - case GAMEOBJECT_TYPE_FLAGDROP: //26 + case GAMEOBJECT_TYPE_FLAGDROP: //26 { if (got.flagdrop.lockId) CheckGOLockId(&got, got.flagdrop.lockId, 0); CheckGONoDamageImmuneId(&got, got.flagdrop.noDamageImmune, 3); break; } - case GAMEOBJECT_TYPE_BARBER_CHAIR: //32 - CheckAndFixGOChairHeightId(&got, got.barberChair.chairheight, 0); - break; + case GAMEOBJECT_TYPE_BARBER_CHAIR: //32 + CheckAndFixGOChairHeightId(&got, got.barberChair.chairheight, 0); + break; } ++count; diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index a95f29c17d9..2f70031e715 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -1519,7 +1519,7 @@ enum GameobjectTypes }; #define MAX_GAMEOBJECT_TYPE 36 // sending to client this or greater value can crash client. -#define MAX_GAMEOBJECT_DATA 24 // Max number of uint32 vars in gameobject_template data field +#define MAX_GAMEOBJECT_DATA 32 // Max number of uint32 vars in gameobject_template data field enum GameObjectFlags { diff --git a/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp b/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp index e194f57ba09..48caa4f36d5 100755 --- a/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp @@ -169,6 +169,7 @@ void WorldSession::HandleCreatureQueryOpcode(WorldPacket & recv_data) /// Only _static_ data is sent in this packet !!! void WorldSession::HandleGameObjectQueryOpcode(WorldPacket & recv_data) { + const int GO_DATA_FIELDS_NUMBER = 32; uint32 entry; recv_data >> entry; uint64 guid; @@ -204,10 +205,11 @@ void WorldSession::HandleGameObjectQueryOpcode(WorldPacket & recv_data) data << IconName; // 2.0.3, string. Icon name to use instead of default icon for go's (ex: "Attack" makes sword) data << CastBarCaption; // 2.0.3, string. Text will appear in Cast Bar when using GO (ex: "Collecting") data << info->unk1; // 2.0.3, string - data.append(info->raw.data, 24); + data.append(info->raw.data, MAX_GAMEOBJECT_DATA); data << float(info->size); // go size for (uint32 i = 0; i < MAX_GAMEOBJECT_QUEST_ITEMS; ++i) - data << uint32(info->questItems[i]); // itemId[6], quest drop + data << uint32(info->questItems[i]); // itemId[6], quest drop + data << int32(info->unkInt32); // 4.x, unknown SendPacket(&data); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_GAMEOBJECT_QUERY_RESPONSE"); } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 89e26dbfef7..1b3b7eea061 100755 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -137,7 +137,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_QUEST_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestQueryOpcode ); DEFINE_OPCODE_HANDLER(SMSG_QUEST_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJECT_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleGameObjectQueryOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_CREATURE_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleCreatureQueryOpcode ); DEFINE_OPCODE_HANDLER(SMSG_CREATURE_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_WHO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWhoOpcode ); @@ -192,7 +192,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_GUILD_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(UMSG_UPDATE_GUILD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_X, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_AFK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_AFK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_BATTLEGROUND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_BATTLEGROUND_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); @@ -1368,8 +1368,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_SKIRMISH_QUEUE_RESULT1, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_SKIRMISH_QUEUE_RESULT2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_UNKNOWN_1310, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER( SMSG_VERIFY_CONNECTIVITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER( CMSG_VERIFY_CONNECTIVITY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); - DEFINE_OPCODE_HANDLER( CMSG_LOG_DISCONNECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); + DEFINE_OPCODE_HANDLER(SMSG_VERIFY_CONNECTIVITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(CMSG_VERIFY_CONNECTIVITY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); + //DEFINE_OPCODE_HANDLER(CMSG_LOG_DISCONNECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); #undef DEFINE_OPCODE_HANDLER }; -- cgit v1.2.3 From 48652b9352964f52242480838d89568ebef4e047 Mon Sep 17 00:00:00 2001 From: kiper Date: Mon, 28 Nov 2011 22:05:43 +0000 Subject: Core/Packets: Add some new opcodes and enable handlers for some opcodes. --- src/server/game/Server/Protocol/Opcodes.cpp | 22 ++++++++++++---------- src/server/game/Server/Protocol/Opcodes.h | 12 ++++++------ 2 files changed, 18 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 1b3b7eea061..78a230ca658 100755 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -238,7 +238,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJ_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGameObjectUseOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_DESTROY_ITEMS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_CUSTOM_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_AREATRIGGER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaTriggerOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_AREATRIGGER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaTriggerOpcode ); DEFINE_OPCODE_HANDLER(MSG_MOVE_START_FORWARD, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); DEFINE_OPCODE_HANDLER(MSG_MOVE_START_BACKWARD, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); @@ -309,8 +309,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_TRIGGER_CINEMATIC_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_OPENING_CINEMATIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(SMSG_TRIGGER_CINEMATIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_NEXT_CINEMATIC_CAMERA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNextCinematicCamera ); - //DEFINE_OPCODE_HANDLER(CMSG_COMPLETE_CINEMATIC, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCompleteCinematic ); + DEFINE_OPCODE_HANDLER(CMSG_NEXT_CINEMATIC_CAMERA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNextCinematicCamera ); + DEFINE_OPCODE_HANDLER(CMSG_COMPLETE_CINEMATIC, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCompleteCinematic ); DEFINE_OPCODE_HANDLER(SMSG_TUTORIAL_FLAGS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_FLAG, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialFlag ); //DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_CLEAR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialClear ); @@ -319,7 +319,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEmoteOpcode ); DEFINE_OPCODE_HANDLER(SMSG_EMOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_TEXT_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTextEmoteOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_TEXT_EMOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TEXT_EMOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_AUTOEQUIP_GROUND_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_GROUND_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_LOOT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutostoreLootItemOpcode ); @@ -361,7 +361,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_SUPERCEDED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_NEW_SPELL_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_CAST_SPELL, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleCastSpellOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_CAST, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleCancelCastOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_CANCEL_CAST, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleCancelCastOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_CAST_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPELL_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPELL_GO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -520,7 +520,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_PLAYED_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayedTime ); //DEFINE_OPCODE_HANDLER(SMSG_PLAYED_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_QUERY_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryTimeOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_QUERY_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryTimeOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_QUERY_TIME_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LOG_XPGAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_AURACASTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -701,7 +701,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_RESET_FACTION_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_BANK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoStoreBankItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_AUTOBANK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoBankItemOpcode ); - //DEFINE_OPCODE_HANDLER(MSG_QUERY_NEXT_MAIL_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryNextMailTime ); + DEFINE_OPCODE_HANDLER(MSG_QUERY_NEXT_MAIL_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryNextMailTime ); //DEFINE_OPCODE_HANDLER(SMSG_RECEIVED_MAIL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_RAID_GROUP_ONLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SET_DURABILITY_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -722,6 +722,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_LFG_GET_STATUS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_SHOW_MAILBOX, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_RESET_RANGED_COMBAT_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(CMSG_MEETINGSTONE_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_MEMBER_ADDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHAT_NOT_IN_PARTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_GROWTH_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelGrowthAuraOpcode ); @@ -760,7 +761,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_PLAYER_SKINNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DURABILITY_DAMAGE_DEATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SET_EXPLORATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIONBAR_TOGGLES, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActionBarToggles ); + DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIONBAR_TOGGLES, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActionBarToggles ); //DEFINE_OPCODE_HANDLER(UMSG_DELETE_GUILD_CHARTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_PETITION_RENAME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionRenameOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_INIT_WORLD_STATES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -940,8 +941,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_LFG_TELEPORT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgTeleportOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LFD_PARTY_LOCK_INFO_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgPartyLockInfoRequestOpcode); //DEFINE_OPCODE_HANDLER(SMSG_LFG_PARTY_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_TITLE_EARNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_TITLE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTitleOpcode ); + DEFINE_OPCODE_HANDLER(SMSG_TITLE_EARNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(CMSG_SET_TITLE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTitleOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_MOUNT_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelMountAuraOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_ARENA_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(MSG_INSPECT_ARENA_TEAMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectArenaTeamsOpcode ); @@ -1371,5 +1372,6 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_VERIFY_CONNECTIVITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_VERIFY_CONNECTIVITY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); //DEFINE_OPCODE_HANDLER(CMSG_LOG_DISCONNECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); + #undef DEFINE_OPCODE_HANDLER }; diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 9c74d58d374..4278663e58a 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -98,10 +98,10 @@ enum Opcodes CMSG_CALENDAR_UPDATE_EVENT = 0x5CD2, CMSG_CANCEL_AURA = 0x9C43, CMSG_CANCEL_AUTO_REPEAT_SPELL = 0x5CEE, - CMSG_CANCEL_CAST = 0x00, + CMSG_CANCEL_CAST = 0x5A73, CMSG_CANCEL_CHANNELLING = 0xC8FE, CMSG_CANCEL_GROWTH_AURA = 0xDEF7, - CMSG_CANCEL_MOUNT_AURA = 0x00, + CMSG_CANCEL_MOUNT_AURA = 0xD8F3, CMSG_CANCEL_TEMP_ENCHANTMENT = 0x00, CMSG_CANCEL_TRADE = 0x35A5, CMSG_CAST_SPELL = 0x5E4E, @@ -394,7 +394,7 @@ enum Opcodes CMSG_SET_SELECTION = 0x4C4E, CMSG_SET_SKILL_CHEAT = 0x00, CMSG_SET_TAXI_BENCHMARK_MODE = 0x1EFF, - CMSG_SET_TITLE = 0x00, + CMSG_SET_TITLE = 0xCE63, CMSG_SET_TRADE_GOLD = 0x00, CMSG_SET_TRADE_ITEM = 0x00, CMSG_SETDEATHBINDPOINT = 0x00, @@ -521,7 +521,7 @@ enum Opcodes MSG_PETITION_RENAME = 0x4857, MSG_PVP_LOG_DATA = 0x00, MSG_QUERY_GUILD_BANK_TEXT = 0x00, - MSG_QUERY_NEXT_MAIL_TIME = 0x00, + MSG_QUERY_NEXT_MAIL_TIME = 0xCEE6, MSG_QUEST_PUSH_RESULT = 0x1863, MSG_RAID_READY_CHECK = 0x584E, MSG_RAID_READY_CHECK_CONFIRM = 0x584E, @@ -979,12 +979,12 @@ enum Opcodes SMSG_TALENTS_INFO = 0x00, SMSG_TAXINODE_STATUS = 0x8CFB, SMSG_TOGGLE_XP_GAIN = 0x8A5B, - SMSG_TEXT_EMOTE = 0x00, + SMSG_TEXT_EMOTE = 0x9E5A, SMSG_THREAT_CLEAR = 0x00, SMSG_THREAT_REMOVE = 0x00, SMSG_THREAT_UPDATE = 0x00, SMSG_TIME_SYNC_REQ = 0x1009, - SMSG_TITLE_EARNED = 0x00, + SMSG_TITLE_EARNED = 0x1AFA, SMSG_TOTEM_CREATED = 0x00, SMSG_TRADE_STATUS = 0x00, SMSG_TRADE_STATUS_EXTENDED = 0x00, -- cgit v1.2.3 From f94730bd93dd7027f3866b72ca55ac8ced7eed55 Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 28 Nov 2011 23:41:30 +0000 Subject: Core/Misc: Fix "Return to graveyard" button and remove some opcodes that need to be confirmed --- src/server/game/Server/Protocol/Handlers/MiscHandler.cpp | 7 +++++++ src/server/game/Server/Protocol/Opcodes.cpp | 14 ++++++++------ src/server/game/Server/Protocol/Opcodes.h | 8 ++++---- src/server/game/Server/WorldSession.h | 1 + 4 files changed, 20 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp b/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp index 2eb8317ec29..7be1722a906 100755 --- a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp @@ -492,6 +492,13 @@ void WorldSession::HandleZoneUpdateOpcode(WorldPacket & recv_data) //GetPlayer()->SendInitWorldStates(true, newZone); } +void WorldSession::HandleReturnToGraveyard(WorldPacket& /*recvPacket*/) +{ + if (GetPlayer()->isAlive() || !GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST)) + return; + GetPlayer()->RepopAtGraveyard(); +} + void WorldSession::HandleSetSelectionOpcode(WorldPacket & recv_data) { uint64 guid; diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 78a230ca658..4fa60812a45 100755 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -211,7 +211,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_MESSAGECHAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_JOIN_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleJoinChannel ); //DEFINE_OPCODE_HANDLER(CMSG_LEAVE_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLeaveChannel ); - //DEFINE_OPCODE_HANDLER(SMSG_CHANNEL_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CHANNEL_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelList ); //DEFINE_OPCODE_HANDLER(SMSG_CHANNEL_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_PASSWORD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelPassword ); @@ -448,7 +448,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverHelloOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_QUERY_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverQueryQuestOpcode); + DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_QUERY_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverQueryQuestOpcode); //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_QUEST_AUTOLAUNCH, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverQuestAutoLaunch ); //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_DETAILS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_ACCEPT_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverAcceptQuestOpcode); @@ -518,7 +518,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_FISH_ESCAPED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_BUG, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBugOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_PLAYED_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayedTime ); + DEFINE_OPCODE_HANDLER(CMSG_PLAYED_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayedTime ); //DEFINE_OPCODE_HANDLER(SMSG_PLAYED_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_QUERY_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryTimeOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_QUERY_TIME_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -575,7 +575,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_SKILL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnlearnSkillOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_REMOVED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_DECHARGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_CREATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketCreateOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_CREATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketCreateOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_CREATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_UPDATETEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketUpdateOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_UPDATETEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -593,7 +593,7 @@ void InitOpcodes() ////DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_SPAWN_ANIM_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_DESPAWN_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(MSG_CORPSE_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCorpseQueryOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_DELETETICKET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketDeleteOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_DELETETICKET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketDeleteOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_DELETETICKET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHAT_WRONG_FACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_SYSTEMSTATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketSystemStatusOpcode); @@ -1372,6 +1372,8 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_VERIFY_CONNECTIVITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_VERIFY_CONNECTIVITY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); //DEFINE_OPCODE_HANDLER(CMSG_LOG_DISCONNECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); - + DEFINE_OPCODE_HANDLER(CMSG_RETURN_TO_GRAVEYARD, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleReturnToGraveyard ); + + #undef DEFINE_OPCODE_HANDLER }; diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 4278663e58a..c5bce455dab 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -181,9 +181,9 @@ enum Opcodes CMSG_GM_INVIS = 0x00, CMSG_GMRESPONSE_RESOLVE = 0x00, CMSG_GMSURVEY_SUBMIT = 0x00, - CMSG_GMTICKET_CREATE = 0x0A7B, - CMSG_GMTICKET_DELETETICKET = 0x985F, - CMSG_GMTICKET_GETTICKET = 0x00, + CMSG_GMTICKET_CREATE = 0x00, // Can be 0x0A7B + CMSG_GMTICKET_DELETETICKET = 0x00, + CMSG_GMTICKET_GETTICKET = 0x00, // Can be 0x985F CMSG_GMTICKET_SYSTEMSTATUS = 0x4A7A, CMSG_GMTICKET_UPDATETEXT = 0x8A7B, CMSG_GM_NUKE = 0x00, @@ -454,7 +454,7 @@ enum Opcodes MSG_GM_SHOWLABEL = 0x00, MSG_GM_SUMMON = 0x00, MSG_GUILD_BANK_LOG_QUERY = 0x00, - MSG_GUILD_BANK_MONEY_WITHDRAWN = 0xDE77, + MSG_GUILD_BANK_MONEY_WITHDRAWN = 0x00, // Can be 0xDE77 MSG_GUILD_EVENT_LOG_QUERY = 0x00, MSG_GUILD_PERMISSIONS = 0x00, MSG_INSPECT_ARENA_TEAMS = 0x00, diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index db71fe0941b..f30065886f4 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -416,6 +416,7 @@ class WorldSession void HandleMoveUnRootAck(WorldPacket& recvPacket); void HandleMoveRootAck(WorldPacket& recvPacket); void HandleLookingForGroup(WorldPacket& recvPacket); + void HandleReturnToGraveyard(WorldPacket& recvPacket); // new inspect void HandleInspectOpcode(WorldPacket& recvPacket); -- cgit v1.2.3 From 36a90f7098c27279521b6668067bb2e0bbe628de Mon Sep 17 00:00:00 2001 From: kaelima Date: Tue, 29 Nov 2011 02:27:17 +0100 Subject: Core/Definies: Updated SharedDefines header with 4.2.2 values FYI: BATTLEGROUND_TP = Twin Peaks BATTLEGROUND_BFG = Battle For Gilneas --- src/server/game/Miscellaneous/SharedDefines.h | 228 +++++++++++++++++--------- 1 file changed, 152 insertions(+), 76 deletions(-) (limited to 'src') diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 2f70031e715..fc9753741a7 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -2269,47 +2269,58 @@ uint32 const CREATURE_TYPEMASK_MECHANICAL_OR_ELEMENTAL = (1 << (CREATURE_TYPE_ME // CreatureFamily.dbc enum CreatureFamily { - CREATURE_FAMILY_WOLF = 1, - CREATURE_FAMILY_CAT = 2, - CREATURE_FAMILY_SPIDER = 3, - CREATURE_FAMILY_BEAR = 4, - CREATURE_FAMILY_BOAR = 5, - CREATURE_FAMILY_CROCOLISK = 6, - CREATURE_FAMILY_CARRION_BIRD = 7, - CREATURE_FAMILY_CRAB = 8, - CREATURE_FAMILY_GORILLA = 9, - CREATURE_FAMILY_HORSE_CUSTOM = 10, // not exist in DBC but used for horse like beasts in DB - CREATURE_FAMILY_RAPTOR = 11, - CREATURE_FAMILY_TALLSTRIDER = 12, - CREATURE_FAMILY_FELHUNTER = 15, - CREATURE_FAMILY_VOIDWALKER = 16, - CREATURE_FAMILY_SUCCUBUS = 17, - CREATURE_FAMILY_DOOMGUARD = 19, - CREATURE_FAMILY_SCORPID = 20, - CREATURE_FAMILY_TURTLE = 21, - CREATURE_FAMILY_IMP = 23, - CREATURE_FAMILY_BAT = 24, - CREATURE_FAMILY_HYENA = 25, - CREATURE_FAMILY_BIRD_OF_PREY = 26, - CREATURE_FAMILY_WIND_SERPENT = 27, - CREATURE_FAMILY_REMOTE_CONTROL = 28, - CREATURE_FAMILY_FELGUARD = 29, - CREATURE_FAMILY_DRAGONHAWK = 30, - CREATURE_FAMILY_RAVAGER = 31, - CREATURE_FAMILY_WARP_STALKER = 32, - CREATURE_FAMILY_SPOREBAT = 33, - CREATURE_FAMILY_NETHER_RAY = 34, - CREATURE_FAMILY_SERPENT = 35, - CREATURE_FAMILY_MOTH = 37, - CREATURE_FAMILY_CHIMAERA = 38, - CREATURE_FAMILY_DEVILSAUR = 39, - CREATURE_FAMILY_GHOUL = 40, - CREATURE_FAMILY_SILITHID = 41, - CREATURE_FAMILY_WORM = 42, - CREATURE_FAMILY_RHINO = 43, - CREATURE_FAMILY_WASP = 44, - CREATURE_FAMILY_CORE_HOUND = 45, - CREATURE_FAMILY_SPIRIT_BEAST = 46 + CREATURE_FAMILY_WOLF = 1, + CREATURE_FAMILY_CAT = 2, + CREATURE_FAMILY_SPIDER = 3, + CREATURE_FAMILY_BEAR = 4, + CREATURE_FAMILY_BOAR = 5, + CREATURE_FAMILY_CROCOLISK = 6, + CREATURE_FAMILY_CARRION_BIRD = 7, + CREATURE_FAMILY_CRAB = 8, + CREATURE_FAMILY_GORILLA = 9, + CREATURE_FAMILY_HORSE_CUSTOM = 10, // Does not exist in DBC but used for horse like beasts in DB + CREATURE_FAMILY_RAPTOR = 11, + CREATURE_FAMILY_TALLSTRIDER = 12, + CREATURE_FAMILY_FELHUNTER = 15, + CREATURE_FAMILY_VOIDWALKER = 16, + CREATURE_FAMILY_SUCCUBUS = 17, + CREATURE_FAMILY_DOOMGUARD = 19, + CREATURE_FAMILY_SCORPID = 20, + CREATURE_FAMILY_TURTLE = 21, + CREATURE_FAMILY_IMP = 23, + CREATURE_FAMILY_BAT = 24, + CREATURE_FAMILY_HYENA = 25, + CREATURE_FAMILY_BIRD_OF_PREY = 26, + CREATURE_FAMILY_WIND_SERPENT = 27, + CREATURE_FAMILY_REMOTE_CONTROL = 28, + CREATURE_FAMILY_FELGUARD = 29, + CREATURE_FAMILY_DRAGONHAWK = 30, + CREATURE_FAMILY_RAVAGER = 31, + CREATURE_FAMILY_WARP_STALKER = 32, + CREATURE_FAMILY_SPOREBAT = 33, + CREATURE_FAMILY_NETHER_RAY = 34, + CREATURE_FAMILY_SERPENT = 35, + CREATURE_FAMILY_MOTH = 37, + CREATURE_FAMILY_CHIMAERA = 38, + CREATURE_FAMILY_DEVILSAUR = 39, + CREATURE_FAMILY_GHOUL = 40, + CREATURE_FAMILY_SILITHID = 41, + CREATURE_FAMILY_WORM = 42, + CREATURE_FAMILY_RHINO = 43, + CREATURE_FAMILY_WASP = 44, + CREATURE_FAMILY_CORE_HOUND = 45, + CREATURE_FAMILY_SPIRIT_BEAST = 46, + CREATURE_FAMILY_WATER_ELEMENTAL = 49, + CREATURE_FAMILY_FOX = 50, + CREATURE_FAMILY_MONKEY = 51, + CREATURE_FAMILY_DOG = 52, + CREATURE_FAMILY_BEETLE = 53, + CREATURE_FAMILY_SHALE_SPIDER = 55, + CREATURE_FAMILY_ZOMBIE = 56, + CREATURE_FAMILY_BEETLE_OLD = 57, + CREATURE_FAMILY_SILITHID_2 = 59, + CREATURE_FAMILY_WASP_2 = 66, + CREATURE_FAMILY_HYDRA = 68, }; enum CreatureTypeFlags @@ -2348,6 +2359,18 @@ enum CreatureTypeFlags CREATURE_TYPEFLAGS_UNK31 = 0x80000000, }; +enum CreatureTypeFlags2 +{ + CREATURE_TYPEFLAGS_2_UNK1 = 0x00000001, + CREATURE_TYPEFLAGS_2_UNK2 = 0x00000002, + CREATURE_TYPEFLAGS_2_UNK3 = 0x00000004, + CREATURE_TYPEFLAGS_2_UNK4 = 0x00000008, + CREATURE_TYPEFLAGS_2_UNK5 = 0x00000010, + CREATURE_TYPEFLAGS_2_UNK6 = 0x00000020, + CREATURE_TYPEFLAGS_2_UNK7 = 0x00000040, + CREATURE_TYPEFLAGS_2_UNK8 = 0x00000080, +}; + enum CreatureEliteType { CREATURE_ELITE_NORMAL = 0, @@ -2387,7 +2410,13 @@ enum HolidayIds HOLIDAY_WOTLK_LAUNCH = 406, HOLIDAY_DAY_OF_DEAD = 409, HOLIDAY_CALL_TO_ARMS_IC = 420, - HOLIDAY_KALU_AK_FISHING_DERBY = 424 + HOLIDAY_LOVE_IS_IN_THE_AIR_2 = 423, + HOLIDAY_KALU_AK_FISHING_DERBY = 424, + HOLIDAY_CALL_TO_ARMS_BFG = 435, + HOLIDAY_CALL_TO_ARMS_TP = 436, + HOLIDAY_RATED_BG_15_VS_15 = 442, + HOLIDAY_RATED_BG_25_VS_25 = 443, + HOLIDAY_ANNIVERSARY_7_YEARS = 467, }; // values based at QuestInfo.dbc @@ -2446,7 +2475,15 @@ enum QuestSort QUEST_SORT_BREWFEST = 370, QUEST_SORT_INSCRIPTION = 371, QUEST_SORT_DEATH_KNIGHT = 372, - QUEST_SORT_JEWELCRAFTING = 373 + QUEST_SORT_JEWELCRAFTING = 373, + QUEST_SORT_NOBLEGARDEN = 374, + QUEST_SORT_PILGRIMS_BOUNTY = 375, + QUEST_SORT_LOVE_IS_IN_THE_AIR = 376, + QUEST_SORT_ARCHAEOLOGY = 377, + QUEST_SORT_CHILDRENS_WEEK = 378, + QUEST_SORT_FIRELANDS_INVASION = 379, + QUEST_SORT_ZANDALARI = 380, + QUEST_SORT_ELEMENTAL_BONDS = 381, }; inline uint8 ClassByQuestSort(int32 QuestSort) @@ -2592,7 +2629,7 @@ enum SkillType SKILL_RACIAL_HUMAN = 754, SKILL_JEWELCRAFTING = 755, SKILL_RACIAL_BLOODELF = 756, - SKILL_PET_EVENT_RC = 758, + SKILL_PET_EVENT_RC = 758, // SkillCategory = -1 SKILL_LANG_DRAENEI = 759, SKILL_RACIAL_DRAENEI = 760, SKILL_PET_FELGUARD = 761, @@ -2620,10 +2657,34 @@ enum SkillType SKILL_PET_WASP = 785, SKILL_PET_EXOTIC_RHINO = 786, SKILL_PET_EXOTIC_CORE_HOUND = 787, - SKILL_PET_EXOTIC_SPIRIT_BEAST = 788 -}; - -#define MAX_SKILL_TYPE 789 + SKILL_PET_EXOTIC_SPIRIT_BEAST = 788, + SKILL_RACIAL_WORGEN = 789, + SKILL_RACIAL_GOBLIN = 790, + SKILL_LANG_GILNEAN = 791, + SKILL_LANG_GOBLIN = 792, + SKILL_ARCHAEOLOGY = 794, + SKILL_GENERAL_HUNTER = 795, + SKILL_GENERAL_DEATH_KNIGHT = 796, + SKILL_GENERAL_ROGUE = 797, + SKILL_GENERAL_DRUID = 798, + SKILL_GENERAL_MAGE = 799, + SKILL_GENERAL_PALADIN = 800, + SKILL_GENERAL_SHAMAN = 801, + SKILL_GENERAL_WARLOCK = 802, + SKILL_GENERAL_WARRIOR = 803, + SKILL_GENERAL_PRIEST = 804, + SKILL_PET_WATER_ELEMENTAL = 805, + SKILL_PET_FOX = 808, + SKILL_ALL_GLYPHS = 810, + SKILL_PET_DOG = 811, + SKILL_PET_MONKEY = 815, + SKILL_PET_SHALE_SPIDER = 817, + SKILL_PET_BEETLE = 818, + SKILL_ALL_GUILD_PERKS = 821, + SKILL_PET_HYDRA = 824, +}; + +#define MAX_SKILL_TYPE 825 inline SkillType SkillByLockType(LockType locktype) { @@ -2654,12 +2715,14 @@ inline uint32 SkillByQuestSort(int32 QuestSort) case QUEST_SORT_FIRST_AID: return SKILL_FIRST_AID; case QUEST_SORT_JEWELCRAFTING: return SKILL_JEWELCRAFTING; case QUEST_SORT_INSCRIPTION: return SKILL_INSCRIPTION; + case QUEST_SORT_ARCHAEOLOGY: return SKILL_ARCHAEOLOGY; } return 0; } enum SkillCategory { + SKILL_CATEGORY_UNK1 = 0, SKILL_CATEGORY_ATTRIBUTES = 5, SKILL_CATEGORY_WEAPON = 6, SKILL_CATEGORY_CLASS = 7, @@ -2703,7 +2766,9 @@ enum TotemCategory TC_BLADED_PICKAXE = 168, TC_FLINT_AND_TINDER = 169, TC_RUNED_COBALT_ROD = 189, - TC_RUNED_TITANIUM_ROD = 190 + TC_RUNED_TITANIUM_ROD = 190, + TC_RUNED_ELEMENTIUM_ROD = 209, + TC_HIGH_POWERED_BOLT_GUN = 210, }; enum UnitDynFlags @@ -2809,14 +2874,14 @@ enum ChatLinkColors // Values from ItemPetFood (power of (value-1) used for compare with CreatureFamilyEntry.petDietMask enum PetDiet { - PET_DIET_MEAT = 1, - PET_DIET_FISH = 2, - PET_DIET_CHEESE = 3, - PET_DIET_BREAD = 4, - PET_DIET_FUNGAS = 5, - PET_DIET_FRUIT = 6, - PET_DIET_RAW_MEAT = 7, - PET_DIET_RAW_FISH = 8 + PET_DIET_MEAT = 1, + PET_DIET_FISH = 2, + PET_DIET_CHEESE = 3, + PET_DIET_BREAD = 4, + PET_DIET_FUNGAS = 5, + PET_DIET_FRUIT = 6, + PET_DIET_RAW_MEAT = 7, + PET_DIET_RAW_FISH = 8 }; #define MAX_PET_DIET 9 @@ -2894,6 +2959,8 @@ enum SummonType SUMMON_TYPE_VEHICLE = 9, SUMMON_TYPE_VEHICLE2 = 10, SUMMON_TYPE_OBJECT = 11, + SUMMON_TYPE_UNK12 = 12, + SUMMON_TYPE_UNK13 = 13, }; enum EventId @@ -3019,7 +3086,7 @@ enum ResponseCodes CHAR_NAME_CONSECUTIVE_SPACES = 0x64, CHAR_NAME_RUSSIAN_CONSECUTIVE_SILENT_CHARACTERS = 0x65, CHAR_NAME_RUSSIAN_SILENT_CHARACTER_AT_BEGINNING_OR_END = 0x66, - CHAR_NAME_DECLENSION_DOESNT_MATCH_BASE_NAME = 0x67 + CHAR_NAME_DECLENSION_DOESNT_MATCH_BASE_NAME = 0x67, }; /// Ban function modes @@ -3041,23 +3108,31 @@ enum BanReturn // indexes of BattlemasterList.dbc enum BattlegroundTypeId { - BATTLEGROUND_TYPE_NONE = 0, - BATTLEGROUND_AV = 1, - BATTLEGROUND_WS = 2, - BATTLEGROUND_AB = 3, - BATTLEGROUND_NA = 4, - BATTLEGROUND_BE = 5, - BATTLEGROUND_AA = 6, - BATTLEGROUND_EY = 7, - BATTLEGROUND_RL = 8, - BATTLEGROUND_SA = 9, - BATTLEGROUND_DS = 10, - BATTLEGROUND_RV = 11, - BATTLEGROUND_IC = 30, - BATTLEGROUND_RB = 32 -}; - -#define MAX_BATTLEGROUND_TYPE_ID 33 + BATTLEGROUND_TYPE_NONE = 0, + BATTLEGROUND_AV = 1, + BATTLEGROUND_WS = 2, + BATTLEGROUND_AB = 3, + BATTLEGROUND_NA = 4, + BATTLEGROUND_BE = 5, + BATTLEGROUND_AA = 6, + BATTLEGROUND_EY = 7, + BATTLEGROUND_RL = 8, + BATTLEGROUND_SA = 9, + BATTLEGROUND_DS = 10, + BATTLEGROUND_RV = 11, + BATTLEGROUND_IC = 30, + BATTLEGROUND_RB = 32, + BATTLEGROUND_RATED_10_VS_10 = 100, + BATTLEGROUND_RATED_15_VS_15 = 101, + BATTLEGROUND_RATED_25_VS_25 = 102, + BATTLEGROUND_TP = 108, + BATTLEGROUND_BFG = 120, + // 441 = "Icecrown Citadel" + // 443 = "The Ruby Sanctum" + // 656 = "Rated Eye of the Storm" +}; + +#define MAX_BATTLEGROUND_TYPE_ID 121 enum MailResponseType { @@ -3106,7 +3181,8 @@ enum SpellFamilyNames // 14 - unused SPELLFAMILY_DEATHKNIGHT = 15, // 16 - unused - SPELLFAMILY_PET = 17 + SPELLFAMILY_PET = 17, + SPELLFAMILY_UNK3 = 50, }; enum TradeStatus -- cgit v1.2.3 From e2d303dc2639f22207c78adcb53cabb2a79eec25 Mon Sep 17 00:00:00 2001 From: Manuel Carrasco Date: Mon, 28 Nov 2011 23:06:50 -0300 Subject: Core/Packets: Restored functionality of "Randomize" button at character creation. Now it is server-side. --- src/server/game/DataStores/DBCStores.cpp | 19 ++++++++++++++++ src/server/game/DataStores/DBCStores.h | 3 +++ src/server/game/DataStores/DBCStructure.h | 16 +++++++++++++ src/server/game/DataStores/DBCfmt.h | 1 + .../Server/Protocol/Handlers/CharacterHandler.cpp | 26 ++++++++++++++++++++++ src/server/game/Server/Protocol/Opcodes.cpp | 2 +- src/server/game/Server/WorldSession.h | 2 ++ 7 files changed, 68 insertions(+), 1 deletion(-) mode change 100755 => 100644 src/server/game/Server/Protocol/Opcodes.cpp (limited to 'src') diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 9bdbce70acc..82e97e9f863 100755 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -146,6 +146,9 @@ MapDifficultyMap sMapDifficultyMap; DBCStorage sMovieStore(MovieEntryfmt); +DBCStorage sNameGenStore(NameGenfmt); +GenNameVectorArraysMap sGenNameVectoArraysMap; + DBCStorage sOverrideSpellDataStore(OverrideSpellDatafmt); DBCStorage sPvPDifficultyStore(PvPDifficultyfmt); @@ -425,6 +428,14 @@ void LoadDBCStores(const std::string& dataPath) sMapDifficultyMap[MAKE_PAIR32(entry->MapId, entry->Difficulty)] = MapDifficulty(entry->resetTime, entry->maxPlayers, entry->areaTriggerText[0] > 0); sMapDifficultyStore.Clear(); + LoadDBC(availableDbcLocales, bad_dbc_files, sNameGenStore, dbcPath, "NameGen.dbc");//14545 + for (uint32 i = 0; i < sNameGenStore.GetNumRows(); ++i) + { + if (NameGenEntry const* entry = sNameGenStore.LookupEntry(i)) + sGenNameVectoArraysMap[entry->race].stringVectorArray[entry->gender].push_back(std::string(entry->name)); + } + sNameGenStore.Clear(); + LoadDBC(availableDbcLocales, bad_dbc_files, sMovieStore, dbcPath, "Movie.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sOverrideSpellDataStore, dbcPath, "OverrideSpellData.dbc");//14545 @@ -722,6 +733,14 @@ void LoadDBCStores(const std::string& dataPath) sLog->outString(); } +const std::string* GetRandomCharacterName(uint8 race, uint8 gender) +{ + uint32 size = sGenNameVectoArraysMap[race].stringVectorArray[gender].size(); + uint32 randPos = urand(0,size-1); + + return &sGenNameVectoArraysMap[race].stringVectorArray[gender][randPos]; +} + SimpleFactionsList const* GetFactionTeamList(uint32 faction) { FactionTeamMap::const_iterator itr = sFactionTeamMap.find(faction); diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h index aee179af3b2..ea2ddf0ae4b 100755 --- a/src/server/game/DataStores/DBCStores.h +++ b/src/server/game/DataStores/DBCStores.h @@ -44,6 +44,8 @@ WMOAreaTableEntry const* GetWMOAreaTableEntryByTripple(int32 rootid, int32 adtid uint32 GetVirtualMapForMapAndZone(uint32 mapid, uint32 zoneId); +const std::string* GetRandomCharacterName(uint8 race, uint8 gender); + enum ContentLevels { CONTENT_1_60 = 0, @@ -137,6 +139,7 @@ extern DBCStorage sLFGDungeonStore; extern DBCStorage sLockStore; extern DBCStorage sMailTemplateStore; extern DBCStorage sMapStore; +extern DBCStorage sNameGenStore; extern DBCStorage sPhaseStore; //extern DBCStorage sMapDifficultyStore; -- use GetMapDifficultyData insteed extern MapDifficultyMap sMapDifficultyMap; diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 03f3f1b1145..08740a44f48 100755 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -2275,6 +2275,22 @@ struct WorldStateUI #pragma pack(pop) #endif +// NamesGen.dbc +struct NameGenEntry +{ + uint32 id; + char* name; + uint32 race; + uint32 gender; +}; + +struct VectorArray +{ + std::vector stringVectorArray[2]; +}; + +typedef std::map GenNameVectorArraysMap; + // Structures not used for casting to loaded DBC data and not required then packing struct MapDifficulty { diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index 28df75f185b..eeaeadfdfe4 100755 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -99,6 +99,7 @@ const char MailTemplateEntryfmt[]="nxs"; const char MapEntryfmt[]="nxixxxsixxixiffxiixx"; const char MapDifficultyEntryfmt[]="diisiix"; const char MovieEntryfmt[]="nxxx"; +const char NameGenfmt[] = "nsii"; const char OverrideSpellDatafmt[]="niiiiiiiiiixx"; const char QuestSortEntryfmt[]="nx"; const char QuestXPfmt[]="niiiiiiiiii"; diff --git a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp index 3a9245cd8f4..ee724b25326 100755 --- a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp @@ -43,6 +43,7 @@ #include "ScriptMgr.h" #include "Battleground.h" #include "AccountMgr.h" +#include "DBCStores.h" class LoginQueryHolder : public SQLQueryHolder { @@ -1984,3 +1985,28 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) data << uint8(race); SendPacket(&data); } + +void WorldSession::HandleRandomizeCharNameOpcode(WorldPacket& recv_data) +{ + uint8 gender, race; + + recv_data >> gender; + recv_data >> race; + + if (!(1 << race-1) & RACEMASK_ALL_PLAYABLE) + { + sLog->outError("Invalid race sent by accountId: %u", GetAccountId()); + return; + } + + if (!Player::IsValidGender(gender)) + { + sLog->outError("Invalid gender sent by accountId: %u", GetAccountId()); + return; + } + + WorldPacket data(SMSG_RANDOMIZE_CHAR_NAME, 10); + data << uint8(128); // unk1 + data << *GetRandomCharacterName(race, gender); + SendPacket(&data); +} \ No newline at end of file diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp old mode 100755 new mode 100644 index 4fa60812a45..468f85b3bde --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -1373,7 +1373,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_VERIFY_CONNECTIVITY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); //DEFINE_OPCODE_HANDLER(CMSG_LOG_DISCONNECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); DEFINE_OPCODE_HANDLER(CMSG_RETURN_TO_GRAVEYARD, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleReturnToGraveyard ); - + DEFINE_OPCODE_HANDLER(CMSG_RANDOMIZE_CHAR_NAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRandomizeCharNameOpcode ); #undef DEFINE_OPCODE_HANDLER }; diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index f30065886f4..97ea0173545 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -408,6 +408,8 @@ class WorldSession void HandleCharEnum(QueryResult result); void HandlePlayerLogin(LoginQueryHolder * holder); void HandleCharFactionOrRaceChange(WorldPacket& recv_data); + void HandleRandomizeCharNameOpcode(WorldPacket& recv_data); + // played time void HandlePlayedTime(WorldPacket& recvPacket); -- cgit v1.2.3 From a2f6e169e2597d63724b965af5bc6f9a0b23e8c3 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 29 Nov 2011 10:22:46 +0100 Subject: Core/DBC: Fixed loading of NameGen.dbc --- src/server/game/DataStores/DBCStores.cpp | 2 -- src/server/game/DataStores/DBCStructure.h | 19 +++++++++---------- src/server/game/DataStores/DBCfmt.h | 2 +- 3 files changed, 10 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 82e97e9f863..789d2f26309 100755 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -430,10 +430,8 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sNameGenStore, dbcPath, "NameGen.dbc");//14545 for (uint32 i = 0; i < sNameGenStore.GetNumRows(); ++i) - { if (NameGenEntry const* entry = sNameGenStore.LookupEntry(i)) sGenNameVectoArraysMap[entry->race].stringVectorArray[entry->gender].push_back(std::string(entry->name)); - } sNameGenStore.Clear(); LoadDBC(availableDbcLocales, bad_dbc_files, sMovieStore, dbcPath, "Movie.dbc");//14545 diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 08740a44f48..c4d52aa7d41 100755 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -128,7 +128,7 @@ struct AchievementCriteriaEntry } complete_quests_in_zone; // ACHIEVEMENT_CRITERIA_TYPE_CURRENCY = 12 - struct + struct { uint32 currency; uint32 count; @@ -1436,6 +1436,14 @@ struct MovieEntry //uint32 unk2; // 3 4.0.0 }; +struct NameGenEntry +{ + //uint32 id; + char* name; + uint32 race; + uint32 gender; +}; + #define MAX_OVERRIDE_SPELL 10 struct OverrideSpellDataEntry @@ -2275,15 +2283,6 @@ struct WorldStateUI #pragma pack(pop) #endif -// NamesGen.dbc -struct NameGenEntry -{ - uint32 id; - char* name; - uint32 race; - uint32 gender; -}; - struct VectorArray { std::vector stringVectorArray[2]; diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index eeaeadfdfe4..65532474fa5 100755 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -99,7 +99,7 @@ const char MailTemplateEntryfmt[]="nxs"; const char MapEntryfmt[]="nxixxxsixxixiffxiixx"; const char MapDifficultyEntryfmt[]="diisiix"; const char MovieEntryfmt[]="nxxx"; -const char NameGenfmt[] = "nsii"; +const char NameGenfmt[] = "dsii"; const char OverrideSpellDatafmt[]="niiiiiiiiiixx"; const char QuestSortEntryfmt[]="nx"; const char QuestXPfmt[]="niiiiiiiiii"; -- cgit v1.2.3 From 309fd11fb96a0fe0f42c066b157438886b4582de Mon Sep 17 00:00:00 2001 From: Rat Date: Tue, 29 Nov 2011 17:56:00 +0100 Subject: Core/MovementHandler: added new packet handler for movement (it is using 4.2.0 struct so not useable, but can be updated, use it as a base) --- src/server/game/Movement/MovementStructures.h | 1374 ++++++++++++++++++++ .../Server/Protocol/Handlers/MovementHandler.cpp | 335 ++++- src/server/game/Server/WorldPacket.h | 22 + src/server/game/Server/WorldSession.cpp | 105 -- src/server/game/Server/WorldSession.h | 2 +- 5 files changed, 1722 insertions(+), 116 deletions(-) create mode 100644 src/server/game/Movement/MovementStructures.h (limited to 'src') diff --git a/src/server/game/Movement/MovementStructures.h b/src/server/game/Movement/MovementStructures.h new file mode 100644 index 00000000000..1313f897acb --- /dev/null +++ b/src/server/game/Movement/MovementStructures.h @@ -0,0 +1,1374 @@ +/* +* Copyright (C) 2008-2011 TrinityCore +* Copyright (C) 2005-2009 MaNGOS +* +* 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; either version 2 of the License, or (at your +* option) any later version. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; 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, see . +*/ + +#ifndef _MOVEMENT_STRUCTURES_H +#define _MOVEMENT_STRUCTURES_H + +enum MovementStatusElements +{ + MSEFlags, + MSEFlags2, + MSETimestamp, + MSEHavePitch, + MSEGuidByte0, + MSEGuidByte1, + MSEGuidByte2, + MSEGuidByte3, + MSEGuidByte4, + MSEGuidByte5, + MSEGuidByte6, + MSEGuidByte7, + MSEHaveFallData, + MSEHaveFallDirection, + MSEHaveTransportData, + MSETransportHaveTime2, + MSETransportHaveTime3, + MSETransportGuidByte0, + MSETransportGuidByte1, + MSETransportGuidByte2, + MSETransportGuidByte3, + MSETransportGuidByte4, + MSETransportGuidByte5, + MSETransportGuidByte6, + MSETransportGuidByte7, + MSEHaveSpline, + MSEHaveSplineElev, + MSEPositionX, + MSEPositionY, + MSEPositionZ, + MSEPositionO, + MSEGuidByte0_2, + MSEGuidByte1_2, + MSEGuidByte2_2, + MSEGuidByte3_2, + MSEGuidByte4_2, + MSEGuidByte5_2, + MSEGuidByte6_2, + MSEGuidByte7_2, + MSEPitch, + MSEFallTime, + MSETransportGuidByte0_2, + MSETransportGuidByte1_2, + MSETransportGuidByte2_2, + MSETransportGuidByte3_2, + MSETransportGuidByte4_2, + MSETransportGuidByte5_2, + MSETransportGuidByte6_2, + MSETransportGuidByte7_2, + MSESplineElev, + MSEFallHorizontalSpeed, + MSEFallVerticalSpeed, + MSEFallCosAngle, + MSEFallSinAngle, + MSETransportSeat, + MSETransportPositionO, + MSETransportPositionX, + MSETransportPositionY, + MSETransportPositionZ, + MSETransportTime, + MSETransportTime2, + MSETransportTime3, + MSE_COUNT +}; + +MovementStatusElements PlayerMoveSequence[] = { + MSEHavePitch, + MSEGuidByte6, + MSEHaveFallData, + MSEHaveFallDirection, + MSEGuidByte1, + MSEGuidByte2, + MSEFlags2, + MSEGuidByte0, + MSEHaveTransportData, + MSETransportGuidByte1, + MSETransportGuidByte4, + MSETransportGuidByte0, + MSETransportHaveTime2, + MSETransportGuidByte6, + MSETransportGuidByte3, + MSETransportGuidByte2, + MSETransportGuidByte7, + MSETransportHaveTime3, + MSETransportGuidByte5, + MSEGuidByte3, + MSEGuidByte4, + MSEGuidByte5, + MSEHaveSpline, + MSEGuidByte7, + MSEHaveSplineElev, + MSEFlags, + MSEPositionO, + MSEGuidByte0_2, + MSEPitch, + MSEGuidByte4_2, + MSEFallTime, + MSEFallHorizontalSpeed, + MSEFallCosAngle, + MSEFallSinAngle, + MSEFallVerticalSpeed, + MSETimestamp, + MSEGuidByte1_2, + MSETransportGuidByte7_2, + MSETransportGuidByte3_2, + MSETransportGuidByte1_2, + MSETransportSeat, + MSETransportTime2, + MSETransportGuidByte0_2, + MSETransportGuidByte6_2, + MSETransportPositionX, + MSETransportPositionY, + MSETransportPositionZ, + MSETransportGuidByte4_2, + MSETransportPositionO, + MSETransportTime3, + MSETransportGuidByte5_2, + MSETransportTime, + MSETransportGuidByte2_2, + MSEGuidByte2_2, + MSEPositionX, + MSEPositionY, + MSEPositionZ, + MSEGuidByte6_2, + MSESplineElev, + MSEGuidByte5_2, + MSEGuidByte3_2, + MSEGuidByte7_2 +}; + +MovementStatusElements MovementFallLandSequence[] = { + MSEGuidByte5, + MSEGuidByte6, + MSEGuidByte4, + MSEGuidByte1, + MSEGuidByte2, + MSEHaveSpline, + MSEFlags2, + MSEGuidByte7, + MSEGuidByte3, + MSEGuidByte0, + MSEFlags, + MSEHaveFallData, + MSEHaveFallDirection, + MSEHaveTransportData, + MSETransportGuidByte6, + MSETransportGuidByte3, + MSETransportGuidByte7, + MSETransportGuidByte4, + MSETransportGuidByte1, + MSETransportGuidByte0, + MSETransportGuidByte2, + MSETransportGuidByte5, + MSETransportHaveTime3, + MSETransportHaveTime2, + MSEHavePitch, + MSEHaveSplineElev, + MSETimestamp, + MSEPositionX, + MSEPositionY, + MSEPositionZ, + MSEPositionO, + MSEGuidByte7_2, + MSEGuidByte2_2, + MSEGuidByte3_2, + MSEGuidByte0_2, + MSEGuidByte1_2, + MSEGuidByte5_2, + MSEFallVerticalSpeed, + MSEFallTime, + MSEFallHorizontalSpeed, + MSEFallCosAngle, + MSEFallSinAngle, + MSETransportTime, + MSETransportPositionX, + MSETransportPositionY, + MSETransportPositionZ, + MSETransportPositionO, + MSETransportSeat, + MSETransportGuidByte3_2, + MSETransportGuidByte1_2, + MSETransportTime3, + MSETransportGuidByte6_2, + MSETransportGuidByte0_2, + MSETransportGuidByte5_2, + MSETransportTime2, + MSETransportGuidByte7_2, + MSETransportGuidByte4_2, + MSETransportGuidByte2_2, + MSEPitch, + MSESplineElev, + MSEGuidByte6_2, + MSEGuidByte4_2, +}; + +MovementStatusElements MovementHeartBeatSequence[] = { + /* + 3bits + 8bits + */ + MSEGuidByte1, + MSEGuidByte5, + MSEGuidByte2, + MSEFlags2, + MSEGuidByte3, + MSEGuidByte4, + MSEHaveSpline, + MSEFlags, + MSEGuidByte0, + MSEGuidByte6, + MSEGuidByte7, + MSEHaveTransportData, + MSETransportGuidByte6, + MSETransportGuidByte3, + MSETransportGuidByte7, + MSETransportGuidByte4, + MSETransportGuidByte1, + MSETransportGuidByte0, + MSETransportGuidByte2, + MSETransportGuidByte5, + MSETransportHaveTime3, + MSETransportHaveTime2, + MSEHavePitch, + MSEHaveSplineElev, + MSEHaveFallData, + MSEHaveFallDirection, + MSEPositionO, + MSEPositionX, + MSEPositionY, + MSEPositionZ, + MSETimestamp, + MSEGuidByte6_2, + MSETransportTime, + MSETransportPositionX, + MSETransportPositionY, + MSETransportPositionZ, + MSETransportPositionO, + MSETransportSeat, + MSETransportGuidByte3_2, + MSETransportGuidByte1_2, + MSETransportTime3, + MSETransportGuidByte6_2, + MSETransportGuidByte0_2, + MSETransportGuidByte5_2, + MSETransportTime2, + MSETransportGuidByte7_2, + MSETransportGuidByte4_2, + MSETransportGuidByte2_2, + MSEPitch, + MSESplineElev, + MSEFallVerticalSpeed, + MSEFallTime, + MSEFallHorizontalSpeed, + MSEFallCosAngle, + MSEFallSinAngle, + MSEGuidByte5_2, + MSEGuidByte1_2, + MSEGuidByte7_2, + MSEGuidByte0_2, + MSEGuidByte2_2, + MSEGuidByte4_2, + MSEGuidByte3_2, +}; + +MovementStatusElements MovementJumpSequence[] = { + MSEGuidByte5, + MSEGuidByte1, + MSEGuidByte6, + MSEFlags, + MSEGuidByte2, + MSEHaveSpline, + MSEGuidByte3, + MSEFlags2, + MSEGuidByte4, + MSEGuidByte0, + MSEGuidByte7, + MSEHaveFallData, + MSEHaveFallDirection, + MSEHaveTransportData, + MSETransportGuidByte6, + MSETransportGuidByte3, + MSETransportGuidByte7, + MSETransportGuidByte4, + MSETransportGuidByte1, + MSETransportGuidByte0, + MSETransportGuidByte2, + MSETransportGuidByte5, + MSETransportHaveTime3, + MSETransportHaveTime2, + MSEHaveSplineElev, + MSEHavePitch, + MSEPositionO, + MSEPositionX, + MSEPositionY, + MSEPositionZ, + MSETimestamp, + MSEGuidByte1_2, + MSEFallVerticalSpeed, + MSEFallTime, + MSEFallHorizontalSpeed, + MSEFallCosAngle, + MSEFallSinAngle, + MSETransportTime, + MSETransportPositionX, + MSETransportPositionY, + MSETransportPositionZ, + MSETransportPositionO, + MSETransportSeat, + MSETransportGuidByte3_2, + MSETransportGuidByte1_2, + MSETransportTime3, + MSETransportGuidByte6_2, + MSETransportGuidByte0_2, + MSETransportGuidByte5_2, + MSETransportTime2, + MSETransportGuidByte7_2, + MSETransportGuidByte4_2, + MSETransportGuidByte2_2, + MSEGuidByte6_2, + MSEGuidByte4_2, + MSESplineElev, + MSEGuidByte0_2, + MSEPitch, + MSEGuidByte5_2, + MSEGuidByte3_2, + MSEGuidByte7_2, + MSEGuidByte2_2, +}; + +MovementStatusElements MovementSetFacingSequence[] = { + MSEGuidByte3, + MSEGuidByte1, + MSEGuidByte0, + MSEGuidByte7, + MSEFlags2, + MSEHaveSpline, + MSEGuidByte4, + MSEFlags, + MSEGuidByte6, + MSEGuidByte5, + MSEGuidByte2, + MSEHaveFallData, + MSEHaveFallDirection, + MSEHaveTransportData, + MSETransportGuidByte6, + MSETransportGuidByte3, + MSETransportGuidByte7, + MSETransportGuidByte4, + MSETransportGuidByte1, + MSETransportGuidByte0, + MSETransportGuidByte2, + MSETransportGuidByte5, + MSETransportHaveTime3, + MSETransportHaveTime2, + MSEHavePitch, + MSEHaveSplineElev, + MSEPositionX, + MSEPositionY, + MSEPositionZ, + MSEPositionO, + MSETimestamp, + MSEFallVerticalSpeed, + MSEFallTime, + MSEFallHorizontalSpeed, + MSEFallCosAngle, + MSEFallSinAngle, + MSEGuidByte2_2, + MSEGuidByte4_2, + MSETransportTime, + MSETransportPositionX, + MSETransportPositionY, + MSETransportPositionZ, + MSETransportPositionO, + MSETransportSeat, + MSETransportGuidByte3_2, + MSETransportGuidByte1_2, + MSETransportTime3, + MSETransportGuidByte6_2, + MSETransportGuidByte0_2, + MSETransportGuidByte5_2, + MSETransportTime2, + MSETransportGuidByte7_2, + MSETransportGuidByte4_2, + MSETransportGuidByte2_2, + MSEGuidByte3_2, + MSEGuidByte7_2, + MSEPitch, + MSEGuidByte5_2, + MSEGuidByte1_2, + MSEGuidByte6_2, + MSESplineElev, + MSEGuidByte0_2, +}; + +MovementStatusElements MovementSetPitchSequence[] = { + MSEGuidByte4, + MSEGuidByte6, + MSEGuidByte2, + MSEFlags2, + MSEGuidByte1, + MSEGuidByte7, + MSEGuidByte5, + MSEGuidByte3, + MSEHaveSpline, + MSEGuidByte0, + MSEFlags, + MSEHaveFallData, + MSEHaveFallDirection, + MSEHaveTransportData, + MSETransportGuidByte6, + MSETransportGuidByte3, + MSETransportGuidByte7, + MSETransportGuidByte4, + MSETransportGuidByte1, + MSETransportGuidByte0, + MSETransportGuidByte2, + MSETransportGuidByte5, + MSETransportHaveTime3, + MSETransportHaveTime2, + MSEHaveSplineElev, + MSEHavePitch, + MSEPositionO, + MSETimestamp, + MSEPositionX, + MSEPositionY, + MSEPositionZ, + MSEGuidByte2_2, + MSEGuidByte6_2, + MSEGuidByte5_2, + MSEFallVerticalSpeed, + MSEFallTime, + MSEFallHorizontalSpeed, + MSEFallCosAngle, + MSEFallSinAngle, + MSEGuidByte3_2, + MSETransportTime, + MSETransportPositionX, + MSETransportPositionY, + MSETransportPositionZ, + MSETransportPositionO, + MSETransportSeat, + MSETransportGuidByte3_2, + MSETransportGuidByte1_2, + MSETransportTime3, + MSETransportGuidByte6_2, + MSETransportGuidByte0_2, + MSETransportGuidByte5_2, + MSETransportTime2, + MSETransportGuidByte7_2, + MSETransportGuidByte4_2, + MSETransportGuidByte2_2, + MSEGuidByte0_2, + MSEGuidByte1_2, + MSESplineElev, + MSEGuidByte7_2, + MSEGuidByte4_2, + MSEPitch, +}; + +MovementStatusElements MovementStartBackwardSequence[] = { + MSEGuidByte4, + MSEGuidByte1, + MSEGuidByte5, + MSEFlags2, + MSEGuidByte3, + MSEGuidByte6, + MSEGuidByte0, + MSEGuidByte2, + MSEGuidByte7, + MSEFlags, + MSEHaveSpline, + MSEHaveFallData, + MSEHaveFallDirection, + MSEHaveTransportData, + MSETransportGuidByte6, + MSETransportGuidByte3, + MSETransportGuidByte7, + MSETransportGuidByte4, + MSETransportGuidByte1, + MSETransportGuidByte0, + MSETransportGuidByte2, + MSETransportGuidByte5, + MSETransportHaveTime3, + MSETransportHaveTime2, + MSEHavePitch, + MSEHaveSplineElev, + MSEPositionX, + MSEPositionY, + MSEPositionZ, + MSETimestamp, + MSEPositionO, + MSEGuidByte0_2, + MSEGuidByte5_2, + MSEFallVerticalSpeed, + MSEFallTime, + MSEFallHorizontalSpeed, + MSEFallCosAngle, + MSEFallSinAngle, + MSEGuidByte4_2, + MSEGuidByte2_2, + MSETransportTime, + MSETransportPositionX, + MSETransportPositionY, + MSETransportPositionZ, + MSETransportPositionO, + MSETransportSeat, + MSETransportGuidByte3_2, + MSETransportGuidByte1_2, + MSETransportTime3, + MSETransportGuidByte6_2, + MSETransportGuidByte0_2, + MSETransportGuidByte5_2, + MSETransportTime2, + MSETransportGuidByte7_2, + MSETransportGuidByte4_2, + MSETransportGuidByte2_2, + MSEGuidByte6_2, + MSEPitch, + MSEGuidByte3_2, + MSESplineElev, + MSEGuidByte1_2, + MSEGuidByte7_2, +}; + +MovementStatusElements MovementStartForwardSequence[] = { + MSEGuidByte0, + MSEHaveSpline, + MSEGuidByte5, + MSEGuidByte3, + MSEGuidByte4, + MSEGuidByte2, + MSEGuidByte7, + MSEFlags2, + MSEFlags, + MSEGuidByte6, + MSEGuidByte1, + MSEHavePitch, + MSEHaveFallData, + MSEHaveFallDirection, + MSEHaveTransportData, + MSETransportGuidByte6, + MSETransportGuidByte3, + MSETransportGuidByte7, + MSETransportGuidByte4, + MSETransportGuidByte1, + MSETransportGuidByte0, + MSETransportGuidByte2, + MSETransportGuidByte5, + MSETransportHaveTime3, + MSETransportHaveTime2, + MSEHaveSplineElev, + MSETimestamp, + MSEPositionX, + MSEPositionY, + MSEPositionZ, + MSEPositionO, + MSEGuidByte7_2, + MSEPitch, + MSEGuidByte1_2, + MSEGuidByte2_2, + MSEFallVerticalSpeed, + MSEFallTime, + MSEFallHorizontalSpeed, + MSEFallCosAngle, + MSEFallSinAngle, + MSEGuidByte3_2, + MSEGuidByte5_2, + MSEGuidByte0_2, + MSEGuidByte6_2, + MSETransportTime, + MSETransportPositionX, + MSETransportPositionY, + MSETransportPositionZ, + MSETransportPositionO, + MSETransportSeat, + MSETransportGuidByte3_2, + MSETransportGuidByte1_2, + MSETransportTime3, + MSETransportGuidByte6_2, + MSETransportGuidByte0_2, + MSETransportGuidByte5_2, + MSETransportTime2, + MSETransportGuidByte7_2, + MSETransportGuidByte4_2, + MSETransportGuidByte2_2, + MSEGuidByte4_2, + MSESplineElev, +}; + +MovementStatusElements MovementStartStrafeLeftSequence[] = { + MSEGuidByte5, + MSEGuidByte0, + MSEGuidByte3, + MSEFlags, + MSEGuidByte6, + MSEGuidByte1, + MSEGuidByte4, + MSEFlags2, + MSEHaveSpline, + MSEGuidByte7, + MSEGuidByte2, + MSEHaveTransportData, + MSETransportGuidByte6, + MSETransportGuidByte3, + MSETransportGuidByte7, + MSETransportGuidByte4, + MSETransportGuidByte1, + MSETransportGuidByte0, + MSETransportGuidByte2, + MSETransportGuidByte5, + MSETransportHaveTime3, + MSETransportHaveTime2, + MSEHaveSplineElev, + MSEHaveFallData, + MSEHaveFallDirection, + MSEHavePitch, + MSEPositionO, + MSETimestamp, + MSEPositionX, + MSEPositionY, + MSEPositionZ, + MSEGuidByte3_2, + MSETransportTime, + MSETransportPositionX, + MSETransportPositionY, + MSETransportPositionZ, + MSETransportPositionO, + MSETransportSeat, + MSETransportGuidByte3_2, + MSETransportGuidByte1_2, + MSETransportTime3, + MSETransportGuidByte6_2, + MSETransportGuidByte0_2, + MSETransportGuidByte5_2, + MSETransportTime2, + MSETransportGuidByte7_2, + MSETransportGuidByte4_2, + MSETransportGuidByte2_2, + MSEGuidByte5_2, + MSEGuidByte1_2, + MSEGuidByte4_2, + MSEGuidByte2_2, + MSEGuidByte0_2, + MSESplineElev, + MSEGuidByte6_2, + MSEFallVerticalSpeed, + MSEFallTime, + MSEFallHorizontalSpeed, + MSEFallCosAngle, + MSEFallSinAngle, + MSEGuidByte7_2, + MSEPitch, +}; + +MovementStatusElements MovementStartStrafeRightSequence[] = { + MSEGuidByte2, + MSEFlags, + MSEGuidByte3, + MSEFlags2, + MSEGuidByte0, + MSEGuidByte6, + MSEHaveSpline, + MSEGuidByte1, + MSEGuidByte4, + MSEGuidByte5, + MSEGuidByte7, + MSEHaveSplineElev, + MSEHavePitch, + MSEHaveTransportData, + MSETransportGuidByte6, + MSETransportGuidByte3, + MSETransportGuidByte7, + MSETransportGuidByte4, + MSETransportGuidByte1, + MSETransportGuidByte0, + MSETransportGuidByte2, + MSETransportGuidByte5, + MSETransportHaveTime3, + MSETransportHaveTime2, + MSEHaveFallData, + MSEHaveFallDirection, + MSETimestamp, + MSEPositionO, + MSEPositionX, + MSEPositionY, + MSEPositionZ, + MSEGuidByte7_2, + MSEGuidByte1_2, + MSESplineElev, + MSEGuidByte3_2, + MSEPitch, + MSETransportTime, + MSETransportPositionX, + MSETransportPositionY, + MSETransportPositionZ, + MSETransportPositionO, + MSETransportSeat, + MSETransportGuidByte3_2, + MSETransportGuidByte1_2, + MSETransportTime3, + MSETransportGuidByte6_2, + MSETransportGuidByte0_2, + MSETransportGuidByte5_2, + MSETransportTime2, + MSETransportGuidByte7_2, + MSETransportGuidByte4_2, + MSETransportGuidByte2_2, + MSEGuidByte5_2, + MSEGuidByte2_2, + MSEGuidByte6_2, + MSEGuidByte4_2, + MSEGuidByte0_2, + MSEFallVerticalSpeed, + MSEFallTime, + MSEFallHorizontalSpeed, + MSEFallCosAngle, + MSEFallSinAngle, +}; + +MovementStatusElements MovementStartTurnLeftSequence[] = { + MSEFlags, + MSEGuidByte3, + MSEGuidByte5, + MSEGuidByte7, + MSEFlags2, + MSEGuidByte6, + MSEHaveSpline, + MSEGuidByte0, + MSEGuidByte2, + MSEGuidByte1, + MSEGuidByte4, + MSEHaveFallData, + MSEHaveFallDirection, + MSEHaveSplineElev, + MSEHavePitch, + MSEHaveTransportData, + MSETransportGuidByte6, + MSETransportGuidByte3, + MSETransportGuidByte7, + MSETransportGuidByte4, + MSETransportGuidByte1, + MSETransportGuidByte0, + MSETransportGuidByte2, + MSETransportGuidByte5, + MSETransportHaveTime3, + MSETransportHaveTime2, + MSEPositionO, + MSETimestamp, + MSEPositionX, + MSEPositionY, + MSEPositionZ, + MSEGuidByte2_2, + MSEGuidByte6_2, + MSEFallVerticalSpeed, + MSEFallTime, + MSEFallHorizontalSpeed, + MSEFallCosAngle, + MSEFallSinAngle, + MSEGuidByte4_2, + MSESplineElev, + MSEGuidByte0_2, + MSEGuidByte7_2, + MSEPitch, + MSEGuidByte1_2, + MSEGuidByte5_2, + MSEGuidByte3_2, + MSETransportTime, + MSETransportPositionX, + MSETransportPositionY, + MSETransportPositionZ, + MSETransportPositionO, + MSETransportSeat, + MSETransportGuidByte3_2, + MSETransportGuidByte1_2, + MSETransportTime3, + MSETransportGuidByte6_2, + MSETransportGuidByte0_2, + MSETransportGuidByte5_2, + MSETransportTime2, + MSETransportGuidByte7_2, + MSETransportGuidByte4_2, + MSETransportGuidByte2_2, +}; + +MovementStatusElements MovementStartTurnRightSequence[] = { + MSEGuidByte0, + MSEFlags, + MSEGuidByte7, + MSEHaveSpline, + MSEGuidByte4, + MSEGuidByte6, + MSEGuidByte3, + MSEGuidByte1, + MSEFlags2, + MSEGuidByte2, + MSEGuidByte5, + MSEHaveFallData, + MSEHaveFallDirection, + MSEHavePitch, + MSEHaveSplineElev, + MSEHaveTransportData, + MSETransportGuidByte6, + MSETransportGuidByte3, + MSETransportGuidByte7, + MSETransportGuidByte4, + MSETransportGuidByte1, + MSETransportGuidByte0, + MSETransportGuidByte2, + MSETransportGuidByte5, + MSETransportHaveTime3, + MSETransportHaveTime2, + MSEPositionO, + MSETimestamp, + MSEPositionX, + MSEPositionY, + MSEPositionZ, + MSEGuidByte1_2, + MSEGuidByte6_2, + MSEFallVerticalSpeed, + MSEFallTime, + MSEFallHorizontalSpeed, + MSEFallCosAngle, + MSEFallSinAngle, + MSEGuidByte0_2, + MSEGuidByte5_2, + MSEGuidByte2_2, + MSEPitch, + MSEGuidByte4_2, + MSEGuidByte3_2, + MSEGuidByte7_2, + MSESplineElev, + MSETransportTime, + MSETransportPositionX, + MSETransportPositionY, + MSETransportPositionZ, + MSETransportPositionO, + MSETransportSeat, + MSETransportGuidByte3_2, + MSETransportGuidByte1_2, + MSETransportTime3, + MSETransportGuidByte6_2, + MSETransportGuidByte0_2, + MSETransportGuidByte5_2, + MSETransportTime2, + MSETransportGuidByte7_2, + MSETransportGuidByte4_2, + MSETransportGuidByte2_2, +}; + +MovementStatusElements MovementStopSequence[] = { + MSEGuidByte4, + MSEGuidByte3, + MSEFlags, + MSEGuidByte5, + MSEGuidByte6, + MSEGuidByte0, + MSEGuidByte1, + MSEGuidByte2, + MSEGuidByte7, + MSEHaveSpline, + MSEFlags2, + MSEHavePitch, + MSEHaveSplineElev, + MSEHaveFallData, + MSEHaveFallDirection, + MSEHaveTransportData, + MSETransportGuidByte6, + MSETransportGuidByte3, + MSETransportGuidByte7, + MSETransportGuidByte4, + MSETransportGuidByte1, + MSETransportGuidByte0, + MSETransportGuidByte2, + MSETransportGuidByte5, + MSETransportHaveTime3, + MSETransportHaveTime2, + MSETimestamp, + MSEPositionX, + MSEPositionY, + MSEPositionZ, + MSEPositionO, + MSEGuidByte6_2, + MSEGuidByte5_2, + MSEGuidByte1_2, + MSEGuidByte3_2, + MSEPitch, + MSEGuidByte2_2, + MSESplineElev, + MSEGuidByte4_2, + MSEGuidByte0_2, + MSEGuidByte7_2, + MSEFallVerticalSpeed, + MSEFallTime, + MSEFallHorizontalSpeed, + MSEFallCosAngle, + MSEFallSinAngle, + MSETransportTime, + MSETransportPositionX, + MSETransportPositionY, + MSETransportPositionZ, + MSETransportPositionO, + MSETransportSeat, + MSETransportGuidByte3_2, + MSETransportGuidByte1_2, + MSETransportTime3, + MSETransportGuidByte6_2, + MSETransportGuidByte0_2, + MSETransportGuidByte5_2, + MSETransportTime2, + MSETransportGuidByte7_2, + MSETransportGuidByte4_2, + MSETransportGuidByte2_2, +}; + +MovementStatusElements MovementStopStrafeSequence[] = { + MSEGuidByte3, + MSEFlags, + MSEHaveSpline, + MSEGuidByte4, + MSEGuidByte0, + MSEFlags2, + MSEGuidByte5, + MSEGuidByte6, + MSEGuidByte7, + MSEGuidByte1, + MSEGuidByte2, + MSEHaveTransportData, + MSETransportGuidByte6, + MSETransportGuidByte3, + MSETransportGuidByte7, + MSETransportGuidByte4, + MSETransportGuidByte1, + MSETransportGuidByte0, + MSETransportGuidByte2, + MSETransportGuidByte5, + MSETransportHaveTime3, + MSETransportHaveTime2, + MSEHaveSplineElev, + MSEHavePitch, + MSEHaveFallData, + MSEHaveFallDirection, + MSEPositionX, + MSEPositionY, + MSEPositionZ, + MSEPositionO, + MSETimestamp, + MSEGuidByte2_2, + MSEGuidByte7_2, + MSEGuidByte5_2, + MSETransportTime, + MSETransportPositionX, + MSETransportPositionY, + MSETransportPositionZ, + MSETransportPositionO, + MSETransportSeat, + MSETransportGuidByte3_2, + MSETransportGuidByte1_2, + MSETransportTime3, + MSETransportGuidByte6_2, + MSETransportGuidByte0_2, + MSETransportGuidByte5_2, + MSETransportTime2, + MSETransportGuidByte7_2, + MSETransportGuidByte4_2, + MSETransportGuidByte2_2, + MSEGuidByte0_2, + MSESplineElev, + MSEPitch, + MSEFallVerticalSpeed, + MSEFallTime, + MSEFallHorizontalSpeed, + MSEFallCosAngle, + MSEFallSinAngle, + MSEGuidByte1_2, + MSEGuidByte3_2, + MSEGuidByte4_2, + MSEGuidByte6_2, +}; + +MovementStatusElements MovementStopTurnSequence[] = { + MSEGuidByte3, + MSEGuidByte5, + MSEGuidByte4, + MSEGuidByte2, + MSEFlags2, + MSEGuidByte0, + MSEGuidByte7, + MSEGuidByte6, + MSEGuidByte1, + MSEHaveSpline, + MSEFlags, + MSEHaveFallData, + MSEHaveFallDirection, + MSEHaveTransportData, + MSETransportGuidByte6, + MSETransportGuidByte3, + MSETransportGuidByte7, + MSETransportGuidByte4, + MSETransportGuidByte1, + MSETransportGuidByte0, + MSETransportGuidByte2, + MSETransportGuidByte5, + MSETransportHaveTime3, + MSETransportHaveTime2, + MSEHaveSplineElev, + MSEHavePitch, + MSEPositionO, + MSETimestamp, + MSEPositionX, + MSEPositionY, + MSEPositionZ, + MSEGuidByte4_2, + MSEGuidByte2_2, + MSEGuidByte5_2, + MSEFallVerticalSpeed, + MSEFallTime, + MSEFallHorizontalSpeed, + MSEFallCosAngle, + MSEFallSinAngle, + MSEGuidByte0_2, + MSEGuidByte7_2, + MSEGuidByte6_2, + MSETransportTime, + MSETransportPositionX, + MSETransportPositionY, + MSETransportPositionZ, + MSETransportPositionO, + MSETransportSeat, + MSETransportGuidByte3_2, + MSETransportGuidByte1_2, + MSETransportTime3, + MSETransportGuidByte6_2, + MSETransportGuidByte0_2, + MSETransportGuidByte5_2, + MSETransportTime2, + MSETransportGuidByte7_2, + MSETransportGuidByte4_2, + MSETransportGuidByte2_2, + MSESplineElev, + MSEGuidByte1_2, + MSEGuidByte3_2, + MSEPitch, +}; + +MovementStatusElements MovementStartAscendSequence[] = { + MSEGuidByte2, + MSEGuidByte3, + MSEGuidByte6, + MSEGuidByte4, + MSEGuidByte0, + MSEHaveSpline, + MSEGuidByte1, + MSEGuidByte5, + MSEFlags, + MSEFlags2, + MSEGuidByte7, + MSEHaveTransportData, + MSETransportGuidByte6, + MSETransportGuidByte3, + MSETransportGuidByte7, + MSETransportGuidByte4, + MSETransportGuidByte1, + MSETransportGuidByte0, + MSETransportGuidByte2, + MSETransportGuidByte5, + MSETransportHaveTime3, + MSETransportHaveTime2, + MSEHaveFallData, + MSEHaveFallDirection, + MSEHavePitch, + MSEHaveSplineElev, + MSEPositionO, + MSEPositionX, + MSEPositionY, + MSEPositionZ, + MSETimestamp, + MSETransportTime, + MSETransportPositionX, + MSETransportPositionY, + MSETransportPositionZ, + MSETransportPositionO, + MSETransportSeat, + MSETransportGuidByte3_2, + MSETransportGuidByte1_2, + MSETransportTime3, + MSETransportGuidByte6_2, + MSETransportGuidByte0_2, + MSETransportGuidByte5_2, + MSETransportTime2, + MSETransportGuidByte7_2, + MSETransportGuidByte4_2, + MSETransportGuidByte2_2, + MSEGuidByte5_2, + MSEGuidByte3_2, + MSEGuidByte4_2, + MSEFallVerticalSpeed, + MSEFallTime, + MSEFallHorizontalSpeed, + MSEFallCosAngle, + MSEFallSinAngle, + MSEGuidByte0_2, + MSEGuidByte2_2, + MSEPitch, + MSEGuidByte6_2, + MSESplineElev, + MSEGuidByte7_2, + MSEGuidByte1_2, +}; + +MovementStatusElements MovementStartDescendSequence[] = { + MSEGuidByte7, + MSEGuidByte0, + MSEGuidByte2, + MSEGuidByte1, + MSEGuidByte6, + MSEGuidByte4, + MSEGuidByte5, + MSEHaveSpline, + MSEGuidByte3, + MSEFlags2, + MSEFlags, + MSEHaveFallData, + MSEHaveFallDirection, + MSEHavePitch, + MSEHaveSplineElev, + MSEHaveTransportData, + MSETransportGuidByte6, + MSETransportGuidByte3, + MSETransportGuidByte7, + MSETransportGuidByte4, + MSETransportGuidByte1, + MSETransportGuidByte0, + MSETransportGuidByte2, + MSETransportGuidByte5, + MSETransportHaveTime3, + MSETransportHaveTime2, + MSETimestamp, + MSEPositionX, + MSEPositionY, + MSEPositionZ, + MSEPositionO, + MSEGuidByte3_2, + MSEGuidByte4_2, + MSEGuidByte2_2, + MSEFallVerticalSpeed, + MSEFallTime, + MSEFallHorizontalSpeed, + MSEFallCosAngle, + MSEFallSinAngle, + MSEPitch, + MSEGuidByte5_2, + MSESplineElev, + MSETransportTime, + MSETransportPositionX, + MSETransportPositionY, + MSETransportPositionZ, + MSETransportPositionO, + MSETransportSeat, + MSETransportGuidByte3_2, + MSETransportGuidByte1_2, + MSETransportTime3, + MSETransportGuidByte6_2, + MSETransportGuidByte0_2, + MSETransportGuidByte5_2, + MSETransportTime2, + MSETransportGuidByte7_2, + MSETransportGuidByte4_2, + MSETransportGuidByte2_2, + MSEGuidByte1_2, + MSEGuidByte0_2, + MSEGuidByte7_2, + MSEGuidByte6_2, +}; + +MovementStatusElements MovementStartSwimSequence[] = { + MSEGuidByte1, + MSEGuidByte5, + MSEFlags, + MSEGuidByte2, + MSEHaveSpline, + MSEGuidByte6, + MSEFlags2, + MSEGuidByte4, + MSEGuidByte7, + MSEGuidByte0, + MSEGuidByte3, + MSEHavePitch, + MSEHaveSplineElev, + MSEHaveFallData, + MSEHaveFallDirection, + MSEHaveTransportData, + MSETransportGuidByte6, + MSETransportGuidByte3, + MSETransportGuidByte7, + MSETransportGuidByte4, + MSETransportGuidByte1, + MSETransportGuidByte0, + MSETransportGuidByte2, + MSETransportGuidByte5, + MSETransportHaveTime3, + MSETransportHaveTime2, + MSEPositionO, + MSEPositionX, + MSEPositionY, + MSEPositionZ, + MSETimestamp, + MSEPitch, + MSEGuidByte4_2, + MSESplineElev, + MSEFallVerticalSpeed, + MSEFallTime, + MSEFallHorizontalSpeed, + MSEFallCosAngle, + MSEFallSinAngle, + MSEGuidByte0_2, + MSEGuidByte7_2, + MSETransportTime, + MSETransportPositionX, + MSETransportPositionY, + MSETransportPositionZ, + MSETransportPositionO, + MSETransportSeat, + MSETransportGuidByte3_2, + MSETransportGuidByte1_2, + MSETransportTime3, + MSETransportGuidByte6_2, + MSETransportGuidByte0_2, + MSETransportGuidByte5_2, + MSETransportTime2, + MSETransportGuidByte7_2, + MSETransportGuidByte4_2, + MSETransportGuidByte2_2, + MSEGuidByte6_2, + MSEGuidByte5_2, + MSEGuidByte2_2, + MSEGuidByte1_2, + MSEGuidByte3_2, +}; + +MovementStatusElements MovementStopAscendSequence[] = { + MSEHaveSpline, + MSEGuidByte5, + MSEGuidByte3, + MSEGuidByte1, + MSEFlags, + MSEGuidByte4, + MSEGuidByte7, + MSEGuidByte2, + MSEFlags2, + MSEGuidByte6, + MSEGuidByte0, + MSEHavePitch, + MSEHaveSplineElev, + MSEHaveFallData, + MSEHaveFallDirection, + MSEHaveTransportData, + MSETransportGuidByte6, + MSETransportGuidByte3, + MSETransportGuidByte7, + MSETransportGuidByte4, + MSETransportGuidByte1, + MSETransportGuidByte0, + MSETransportGuidByte2, + MSETransportGuidByte5, + MSETransportHaveTime3, + MSETransportHaveTime2, + MSETimestamp, + MSEPositionX, + MSEPositionY, + MSEPositionZ, + MSEPositionO, + MSEGuidByte5_2, + MSEGuidByte2_2, + MSEGuidByte0_2, + MSEGuidByte7_2, + MSEPitch, + MSEGuidByte3_2, + MSEGuidByte4_2, + MSEGuidByte1_2, + MSESplineElev, + MSEFallVerticalSpeed, + MSEFallTime, + MSEFallHorizontalSpeed, + MSEFallCosAngle, + MSEFallSinAngle, + MSEGuidByte6_2, + MSETransportTime, + MSETransportPositionX, + MSETransportPositionY, + MSETransportPositionZ, + MSETransportPositionO, + MSETransportSeat, + MSETransportGuidByte3_2, + MSETransportGuidByte1_2, + MSETransportTime3, + MSETransportGuidByte6_2, + MSETransportGuidByte0_2, + MSETransportGuidByte5_2, + MSETransportTime2, + MSETransportGuidByte7_2, + MSETransportGuidByte4_2, + MSETransportGuidByte2_2, +}; + +MovementStatusElements* GetMovementStatusElementsSequence(Opcodes opcode) +{ + switch(opcode) + { + case SMSG_PLAYER_MOVE: + return PlayerMoveSequence; + case MSG_MOVE_FALL_LAND: + return MovementFallLandSequence; + case MSG_MOVE_HEARTBEAT: + return MovementHeartBeatSequence; + case MSG_MOVE_JUMP: + return MovementJumpSequence; + case MSG_MOVE_SET_FACING: + return MovementSetFacingSequence; + case MSG_MOVE_SET_PITCH: + return MovementSetPitchSequence; + case MSG_MOVE_START_BACKWARD: + return MovementStartBackwardSequence; + case MSG_MOVE_START_FORWARD: + return MovementStartForwardSequence; + case MSG_MOVE_START_STRAFE_LEFT: + return MovementStartStrafeLeftSequence; + case MSG_MOVE_START_STRAFE_RIGHT: + return MovementStartStrafeRightSequence; + case MSG_MOVE_START_TURN_LEFT: + return MovementStartTurnLeftSequence; + case MSG_MOVE_START_TURN_RIGHT: + return MovementStartTurnRightSequence; + case MSG_MOVE_STOP: + return MovementStopSequence; + case MSG_MOVE_STOP_STRAFE: + return MovementStopStrafeSequence; + case MSG_MOVE_STOP_TURN: + return MovementStopTurnSequence; + case MSG_MOVE_START_ASCEND: + return MovementStartAscendSequence; + case MSG_MOVE_START_DESCEND: + return MovementStartDescendSequence; + case MSG_MOVE_START_SWIM: + return MovementStartSwimSequence; + case MSG_MOVE_STOP_ASCEND: + return MovementStopAscendSequence; + } + return NULL; +} + +#endif diff --git a/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp b/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp index 22eb002ca71..4b825ea4248 100755 --- a/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp @@ -30,6 +30,7 @@ #include "WaypointMovementGenerator.h" #include "InstanceSaveMgr.h" #include "ObjectMgr.h" +#include "MovementStructures.h" void WorldSession::HandleMoveWorldportAckOpcode(WorldPacket & /*recv_data*/) { @@ -257,21 +258,14 @@ void WorldSession::HandleMovementOpcodes(WorldPacket & recv_data) return; } - return; //temp to prevent spamming of bytebuffer exceptions until correct structure is found - /* extract packet */ - uint64 guid; - - recv_data.readPackGUID(guid); - MovementInfo movementInfo; - movementInfo.guid = guid; ReadMovementInfo(recv_data, &movementInfo); recv_data.rfinish(); // prevent warnings spam // prevent tampered movement data - if (guid != mover->GetGUID()) + if (movementInfo.guid != mover->GetGUID()) return; if (!movementInfo.pos.IsPositionValid()) @@ -342,10 +336,10 @@ void WorldSession::HandleMovementOpcodes(WorldPacket & recv_data) /*----------------------*/ /* process position-change */ - WorldPacket data(Opcodes(opcode), recv_data.size()); + WorldPacket data(SMSG_PLAYER_MOVE, recv_data.size()); movementInfo.time = getMSTime(); movementInfo.guid = mover->GetGUID(); - WriteMovementInfo(&data, &movementInfo); + WriteMovementInfo(data, &movementInfo); mover->SendMessageToSet(&data, _player); mover->m_movementInfo = movementInfo; @@ -587,3 +581,324 @@ void WorldSession::HandleSummonResponseOpcode(WorldPacket& recv_data) _player->SummonIfPossible(agree); } +void WorldSession::ReadMovementInfo(WorldPacket &data, MovementInfo* mi) +{ + bool HaveTransportData = false, + HaveTransportTime2 = false, + HaveTransportTime3 = false, + HavePitch = false, + HaveFallData = false, + HaveFallDirection = false, + HaveSplineElevation = false, + HaveSpline = false; + + MovementStatusElements *sequence = GetMovementStatusElementsSequence(data.GetOpcode()); + if(sequence == NULL) + return; + uint8 guid[8]; + uint8 tguid[8]; + *(uint64*)guid = 0; + *(uint64*)tguid = 0; + for(uint32 i=0; i < MSE_COUNT; i++) + { + MovementStatusElements element = sequence[i]; + + if (element >= MSEGuidByte0 && element <= MSEGuidByte7) + { + data.ReadByteMask(guid[element - MSEGuidByte0]); + continue; + } + + if (element >= MSETransportGuidByte0 && + element <= MSETransportGuidByte7) + { + if (HaveTransportData) + data.ReadByteMask(tguid[element - MSETransportGuidByte0]); + continue; + } + + if (element >= MSEGuidByte0_2 && element <= MSEGuidByte7_2) + { + data.ReadByteSeq(guid[element - MSEGuidByte0_2]); + continue; + } + + if (element >= MSETransportGuidByte0_2 && + element <= MSETransportGuidByte7_2) + { + if (HaveTransportData) + data.ReadByteSeq(tguid[element - MSETransportGuidByte0_2]); + continue; + } + + switch (element) + { + case MSEFlags: + mi->flags = data.ReadBits(30); + break; + case MSEFlags2: + mi->flags2 = data.ReadBits(12); + break; + case MSETimestamp: + data >> mi->time; + break; + case MSEHavePitch: + HavePitch = data.ReadBit(); + break; + case MSEHaveFallData: + HaveFallData = data.ReadBit(); + break; + case MSEHaveFallDirection: + if (HaveFallData) + HaveFallDirection = data.ReadBit(); + break; + case MSEHaveTransportData: + HaveTransportData = data.ReadBit(); + break; + case MSETransportHaveTime2: + if (HaveTransportData) + HaveTransportTime2 = data.ReadBit(); + break; + case MSETransportHaveTime3: + if (HaveTransportData) + HaveTransportTime3 = data.ReadBit(); + break; + case MSEHaveSpline: + HaveSpline = data.ReadBit(); + break; + case MSEHaveSplineElev: + HaveSplineElevation = data.ReadBit(); + break; + case MSEPositionX: + data >> mi->pos.PositionXYZStream(); + break; + case MSEPositionY: + case MSEPositionZ: + break; // assume they always go as vector of 3 + case MSEPositionO: + data >> mi->pos.m_orientation; + break; + case MSEPitch: + if (HavePitch) + data >> mi->pitch; + break; + case MSEFallTime: + if (HaveFallData) + data >> mi->fallTime; + break; + case MSESplineElev: + if (HaveSplineElevation) + data >> mi->splineElevation; + break; + case MSEFallHorizontalSpeed: + if (HaveFallDirection) + data >> mi->j_xyspeed; + break; + case MSEFallVerticalSpeed: + if (HaveFallData) + data >> mi->j_zspeed; + break; + case MSEFallCosAngle: + if (HaveFallDirection) + data >> mi->j_cosAngle; + break; + case MSEFallSinAngle: + if (HaveFallDirection) + data >> mi->j_sinAngle; + break; + case MSETransportSeat: + if (HaveTransportData) + data >> mi->t_seat; + break; + case MSETransportPositionO: + if (HaveTransportData) + data >> mi->t_pos.m_orientation; + break; + case MSETransportPositionX: + if (HaveTransportData) + data >> mi->t_pos.PositionXYZStream(); + break; + case MSETransportPositionY: + case MSETransportPositionZ: + break; // assume they always go as vector of 3 + case MSETransportTime: + if (HaveTransportData) + data >> mi->t_time; + break; + case MSETransportTime2: + if (HaveTransportTime2) + data >> mi->t_time2; + break; + case MSETransportTime3: + if (HaveTransportTime3) + data >> mi->t_time3; + break; + default: + WPError(false, "Incorrect sequence element detected at ReadMovementInfo"); + } + } + + mi->guid = *(uint64*)guid; + mi->t_guid = *(uint64*)tguid; + + if (HaveTransportData && mi->pos.m_positionX != mi->t_pos.m_positionX) + if (GetPlayer()->GetTransport()) + GetPlayer()->GetTransport()->UpdatePosition(mi); +} + +void WorldSession::WriteMovementInfo(WorldPacket &data, MovementInfo* mi) +{ + bool HaveTransportData = mi->HasMovementFlag(MOVEMENTFLAG_ONTRANSPORT), + HaveTransportTime2 = (mi->flags2 & MOVEMENTFLAG2_INTERPOLATED_MOVEMENT) != 0, + HaveTransportTime3 = false, + HavePitch = (mi->HasMovementFlag(MovementFlags(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING))) + || (mi->flags2 & MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING), + HaveFallData = mi->HasExtraMovementFlag(MOVEMENTFLAG2_INTERPOLATED_TURNING), + HaveFallDirection = mi->HasMovementFlag(MOVEMENTFLAG_JUMPING), + HaveSplineElevation = mi->HasMovementFlag(MOVEMENTFLAG_SPLINE_ELEVATION), + HaveSpline = false; + + MovementStatusElements *sequence = GetMovementStatusElementsSequence(data.GetOpcode()); + if(!sequence) + return; + uint8 *guid = (uint8 *)&mi->guid; + uint8 *tguid = (uint8 *)&mi->t_guid; + for(uint32 i=0; i < MSE_COUNT; i++) + { + MovementStatusElements element = sequence[i]; + + if (element >= MSEGuidByte0 && element <= MSEGuidByte7) + { + data.WriteByteMask(guid[element - MSEGuidByte0]); + continue; + } + + if (element >= MSETransportGuidByte0 && + element <= MSETransportGuidByte7) + { + if (HaveTransportData) + data.WriteByteMask(tguid[element - MSETransportGuidByte0]); + continue; + } + + if (element >= MSEGuidByte0_2 && element <= MSEGuidByte7_2) + { + data.WriteByteSeq(guid[element - MSEGuidByte0_2]); + continue; + } + + if (element >= MSETransportGuidByte0_2 && + element <= MSETransportGuidByte7_2) + { + if (HaveTransportData) + data.WriteByteSeq(tguid[element - MSETransportGuidByte0_2]); + continue; + } + + switch (element) + { + case MSEFlags: + data.WriteBits(mi->flags, 30); + break; + case MSEFlags2: + data.WriteBits(mi->flags2, 12); + break; + case MSETimestamp: + data << mi->time; + break; + case MSEHavePitch: + data.WriteBit(HavePitch); + break; + case MSEHaveFallData: + data.WriteBit(HaveFallData); + break; + case MSEHaveFallDirection: + if (HaveFallData) + data.WriteBit(HaveFallDirection); + break; + case MSEHaveTransportData: + data.WriteBit(HaveTransportData); + break; + case MSETransportHaveTime2: + if (HaveTransportData) + data.WriteBit(HaveTransportTime2); + break; + case MSETransportHaveTime3: + if (HaveTransportData) + data.WriteBit(HaveTransportTime3); + break; + case MSEHaveSpline: + data.WriteBit(HaveSpline); + break; + case MSEHaveSplineElev: + data.WriteBit(HaveSplineElevation); + break; + case MSEPositionX: + data << mi->pos.PositionXYZStream(); + break; + case MSEPositionY: + case MSEPositionZ: + break; // assume they always go as vector of 3 + case MSEPositionO: + data << mi->pos.m_orientation; + break; + case MSEPitch: + if (HavePitch) + data << mi->pitch; + break; + case MSEFallTime: + if (HaveFallData) + data << mi->fallTime; + break; + case MSESplineElev: + if (HaveSplineElevation) + data << mi->splineElevation; + break; + case MSEFallHorizontalSpeed: + if (HaveFallDirection) + data << mi->j_xyspeed; + break; + case MSEFallVerticalSpeed: + if (HaveFallData) + data << mi->j_zspeed; + break; + case MSEFallCosAngle: + if (HaveFallDirection) + data << mi->j_cosAngle; + break; + case MSEFallSinAngle: + if (HaveFallDirection) + data << mi->j_sinAngle; + break; + case MSETransportSeat: + if (HaveTransportData) + data << mi->t_seat; + break; + case MSETransportPositionO: + if (HaveTransportData) + data << mi->t_pos.m_orientation; + break; + case MSETransportPositionX: + if (HaveTransportData) + data << mi->t_pos.PositionXYZStream(); + break; + case MSETransportPositionY: + case MSETransportPositionZ: + break; // assume they always go as vector of 3 + case MSETransportTime: + if (HaveTransportData) + data << mi->t_time; + break; + case MSETransportTime2: + if (HaveTransportTime2) + data << mi->t_time2; + break; + case MSETransportTime3: + if (HaveTransportTime3) + data << mi->t_time3; + break; + default: + WPError(false, "Incorrect sequence element detected at ReadMovementInfo"); + } + } +} \ No newline at end of file diff --git a/src/server/game/Server/WorldPacket.h b/src/server/game/Server/WorldPacket.h index cd6f95c2d2e..bfecf390d68 100644 --- a/src/server/game/Server/WorldPacket.h +++ b/src/server/game/Server/WorldPacket.h @@ -50,6 +50,28 @@ class WorldPacket : public ByteBuffer void SetOpcode(Opcodes opcode) { m_opcode = opcode; } void Compress(Opcodes opcode); + void ReadByteMask(uint8& b) + { + b = ReadBit() ? 1 : 0; + } + + void ReadByteSeq(uint8& b) + { + if (b != 0) + b ^= read(); + } + + void WriteByteMask(uint8 b) + { + WriteBit(b); + } + + void WriteByteSeq(uint8 b) + { + if (b != 0) + append(b ^ 1); + } + protected: Opcodes m_opcode; void Compress(void* dst, uint32 *dst_size, const void* src, int src_size); diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index 05149b41995..8087307dab6 100755 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -728,111 +728,6 @@ void WorldSession::SaveTutorialsData(SQLTransaction &trans) m_TutorialsChanged = false; } -void WorldSession::ReadMovementInfo(WorldPacket &data, MovementInfo* mi) -{ - data >> mi->flags; - data >> mi->flags2; - data >> mi->time; - data >> mi->pos.PositionXYZOStream(); - - if (mi->HasMovementFlag(MOVEMENTFLAG_ONTRANSPORT)) - { - data.readPackGUID(mi->t_guid); - - data >> mi->t_pos.PositionXYZOStream(); - data >> mi->t_time; - data >> mi->t_seat; - - if (mi->HasExtraMovementFlag(MOVEMENTFLAG2_INTERPOLATED_MOVEMENT)) - data >> mi->t_time2; - - if (mi->pos.m_positionX != mi->t_pos.m_positionX) - if (GetPlayer()->GetTransport()) - GetPlayer()->GetTransport()->UpdatePosition(mi); - } - - if (mi->HasMovementFlag(MovementFlags(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING)) || (mi->HasExtraMovementFlag(MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING))) - data >> mi->pitch; - - data >> mi->fallTime; - - if (mi->HasMovementFlag(MOVEMENTFLAG_JUMPING)) - { - data >> mi->j_zspeed; - data >> mi->j_sinAngle; - data >> mi->j_cosAngle; - data >> mi->j_xyspeed; - } - - if (mi->HasMovementFlag(MOVEMENTFLAG_SPLINE_ELEVATION)) - data >> mi->splineElevation; - - // This must be a packet spoofing attempt. MOVEMENTFLAG_ROOT sent from the client is not valid, - // and when used in conjunction with any of the moving movement flags such as MOVEMENTFLAG_FORWARD - // it will freeze clients that receive this player's movement info. - if (mi->HasMovementFlag(MOVEMENTFLAG_ROOT)) - mi->flags &= ~MOVEMENTFLAG_ROOT; - - // Cannot hover and jump at the same time - if (mi->HasMovementFlag(MOVEMENTFLAG_HOVER) && mi->HasMovementFlag(MOVEMENTFLAG_JUMPING)) - mi->flags &= ~MOVEMENTFLAG_JUMPING; - - // Cannot ascend and descend at the same time - if (mi->HasMovementFlag(MOVEMENTFLAG_ASCENDING) && mi->HasMovementFlag(MOVEMENTFLAG_DESCENDING)) - mi->flags &= ~(MOVEMENTFLAG_ASCENDING | MOVEMENTFLAG_DESCENDING); - - // Cannot move left and right at the same time - if (mi->HasMovementFlag(MOVEMENTFLAG_LEFT) && mi->HasMovementFlag(MOVEMENTFLAG_RIGHT)) - mi->flags &= ~(MOVEMENTFLAG_LEFT | MOVEMENTFLAG_RIGHT); - - // Cannot strafe left and right at the same time - if (mi->HasMovementFlag(MOVEMENTFLAG_STRAFE_LEFT) && mi->HasMovementFlag(MOVEMENTFLAG_STRAFE_RIGHT)) - mi->flags &= ~(MOVEMENTFLAG_STRAFE_LEFT | MOVEMENTFLAG_STRAFE_RIGHT); - - // Cannot pitch up and down at the same time - if (mi->HasMovementFlag(MOVEMENTFLAG_PITCH_UP) && mi->HasMovementFlag(MOVEMENTFLAG_PITCH_DOWN)) - mi->flags &= ~(MOVEMENTFLAG_PITCH_UP | MOVEMENTFLAG_PITCH_DOWN); - - // Cannot move forwards and backwards at the same time - if (mi->HasMovementFlag(MOVEMENTFLAG_FORWARD) && mi->HasMovementFlag(MOVEMENTFLAG_BACKWARD)) - mi->flags &= ~(MOVEMENTFLAG_FORWARD | MOVEMENTFLAG_BACKWARD); -} - -void WorldSession::WriteMovementInfo(WorldPacket* data, MovementInfo* mi) -{ - data->appendPackGUID(mi->guid); - - *data << mi->flags; - *data << mi->flags2; - *data << mi->time; - *data << mi->pos.PositionXYZOStream(); - - if (mi->HasMovementFlag(MOVEMENTFLAG_ONTRANSPORT)) - { - data->appendPackGUID(mi->t_guid); - - *data << mi->t_pos.PositionXYZOStream(); - *data << mi->t_time; - *data << mi->t_seat; - } - - if (mi->HasMovementFlag(MovementFlags(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING)) || mi->HasExtraMovementFlag(MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING)) - *data << mi->pitch; - - *data << mi->fallTime; - - if (mi->HasMovementFlag(MOVEMENTFLAG_JUMPING)) - { - *data << mi->j_zspeed; - *data << mi->j_sinAngle; - *data << mi->j_cosAngle; - *data << mi->j_xyspeed; - } - - if (mi->HasMovementFlag(MOVEMENTFLAG_SPLINE_ELEVATION)) - *data << mi->splineElevation; -} - void WorldSession::ReadAddonsInfo(WorldPacket &data) { if (data.rpos() + 4 > data.size()) diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 97ea0173545..e19b26af374 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -231,7 +231,7 @@ class WorldSession void SendAddonsInfo(); void ReadMovementInfo(WorldPacket& data, MovementInfo* mi); - void WriteMovementInfo(WorldPacket* data, MovementInfo* mi); + void WriteMovementInfo(WorldPacket &data, MovementInfo* mi); void SendPacket(WorldPacket const* packet); void SendNotification(const char *format, ...) ATTR_PRINTF(2, 3); -- cgit v1.2.3 From e8b51cc25c1d6faed04179bdc9a1b97507680782 Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 29 Nov 2011 18:45:22 +0000 Subject: Core/Packets: Re-add ticket related to opcodes to opcode enum (thanks Fabi for confirming them, I guess); Add IsValidClass/IsValidRace methods to Player class --- src/server/game/Entities/Player/Player.h | 2 ++ src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp | 6 +++--- src/server/game/Server/Protocol/Opcodes.cpp | 11 ++++++----- src/server/game/Server/Protocol/Opcodes.h | 6 +++--- 4 files changed, 14 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 95197595bf2..92cea0743c5 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1539,6 +1539,8 @@ class Player : public Unit, public GridObject static bool LoadPositionFromDB(uint32& mapid, float& x, float& y, float& z, float& o, bool& in_flight, uint64 guid); static bool IsValidGender(uint8 Gender) { return Gender <= GENDER_FEMALE ; } + static bool IsValidClass(uint8 Class) { return (1 << Class - 1) & CLASSMASK_ALL_PLAYABLE; } + static bool IsValidRace(uint8 Race) { return (1 << Race - 1) & RACEMASK_ALL_PLAYABLE; } /*********************************************************/ /*** SAVE SYSTEM ***/ diff --git a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp index ee724b25326..7f9017605a0 100755 --- a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp @@ -1993,15 +1993,15 @@ void WorldSession::HandleRandomizeCharNameOpcode(WorldPacket& recv_data) recv_data >> gender; recv_data >> race; - if (!(1 << race-1) & RACEMASK_ALL_PLAYABLE) + if (!Player::IsValidRace(race)) { - sLog->outError("Invalid race sent by accountId: %u", GetAccountId()); + sLog->outError("Invalid race (%u) sent by accountId: %u", race, GetAccountId()); return; } if (!Player::IsValidGender(gender)) { - sLog->outError("Invalid gender sent by accountId: %u", GetAccountId()); + sLog->outError("Invalid gender (%u) sent by accountId: %u", gender, GetAccountId()); return; } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 468f85b3bde..00a8daa7bf0 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -472,7 +472,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_QUEST_CONFIRM_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestConfirmAccept ); //DEFINE_OPCODE_HANDLER(SMSG_QUEST_CONFIRM_ACCEPT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_PUSHQUESTTOPARTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePushQuestToParty ); - //DEFINE_OPCODE_HANDLER(CMSG_LIST_INVENTORY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleListInventoryOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_LIST_INVENTORY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleListInventoryOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_LIST_INVENTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SELL_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSellItemOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_SELL_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -575,7 +575,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_SKILL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnlearnSkillOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_REMOVED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_DECHARGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_CREATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketCreateOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_CREATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketCreateOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_CREATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_UPDATETEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketUpdateOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_UPDATETEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -593,7 +593,7 @@ void InitOpcodes() ////DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_SPAWN_ANIM_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_DESPAWN_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(MSG_CORPSE_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCorpseQueryOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_DELETETICKET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketDeleteOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_DELETETICKET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketDeleteOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_DELETETICKET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHAT_WRONG_FACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_SYSTEMSTATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketSystemStatusOpcode); @@ -1372,8 +1372,9 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_VERIFY_CONNECTIVITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_VERIFY_CONNECTIVITY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); //DEFINE_OPCODE_HANDLER(CMSG_LOG_DISCONNECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); - DEFINE_OPCODE_HANDLER(CMSG_RETURN_TO_GRAVEYARD, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleReturnToGraveyard ); + DEFINE_OPCODE_HANDLER(CMSG_RETURN_TO_GRAVEYARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReturnToGraveyard ); DEFINE_OPCODE_HANDLER(CMSG_RANDOMIZE_CHAR_NAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRandomizeCharNameOpcode ); - + DEFINE_OPCODE_HANDLER(SMSG_RANDOMIZE_CHAR_NAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::Handle_ServerSide ); + #undef DEFINE_OPCODE_HANDLER }; diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index c5bce455dab..ddaf30ce70f 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -181,9 +181,9 @@ enum Opcodes CMSG_GM_INVIS = 0x00, CMSG_GMRESPONSE_RESOLVE = 0x00, CMSG_GMSURVEY_SUBMIT = 0x00, - CMSG_GMTICKET_CREATE = 0x00, // Can be 0x0A7B - CMSG_GMTICKET_DELETETICKET = 0x00, - CMSG_GMTICKET_GETTICKET = 0x00, // Can be 0x985F + CMSG_GMTICKET_CREATE = 0x0A7B, + CMSG_GMTICKET_DELETETICKET = 0xC87F, + CMSG_GMTICKET_GETTICKET = 0x985F, CMSG_GMTICKET_SYSTEMSTATUS = 0x4A7A, CMSG_GMTICKET_UPDATETEXT = 0x8A7B, CMSG_GM_NUKE = 0x00, -- cgit v1.2.3 From b0d106944b155babf22dd1837da2017180589b0c Mon Sep 17 00:00:00 2001 From: kaelima Date: Wed, 30 Nov 2011 21:25:20 +0100 Subject: Core/Misc: - Add missing spell effects - One missing area flag - Added some fields to AreaTableEntry fields that now has previously been empty (4.2.2) --- src/server/game/DataStores/DBCEnums.h | 5 ++--- src/server/game/DataStores/DBCStructure.h | 18 ++++++++++++++---- src/server/game/Miscellaneous/SharedDefines.h | 15 ++++++++++++++- 3 files changed, 30 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCEnums.h b/src/server/game/DataStores/DBCEnums.h index f523f559172..7240c648dcb 100755 --- a/src/server/game/DataStores/DBCEnums.h +++ b/src/server/game/DataStores/DBCEnums.h @@ -273,8 +273,6 @@ enum AchievementCriteriaMoreReqType ACHIEVEMENT_CRITERIA_MORE_REQ_TYPE_GUILD_REP = 62, }; - - enum AchievementCategory { CATEGORY_CHILDRENS_WEEK = 163, @@ -310,7 +308,8 @@ enum AreaFlags AREA_FLAG_INSIDE = 0x02000000, // used for determinating spell related inside/outside questions in Map::IsOutdoors AREA_FLAG_OUTSIDE = 0x04000000, // used for determinating spell related inside/outside questions in Map::IsOutdoors AREA_FLAG_WINTERGRASP_2 = 0x08000000, // Same as AREA_FLAG_WINTERGRASP except for The Sunken Ring and Western Bridge. - AREA_FLAG_NO_FLY_ZONE = 0x20000000 // Marks zones where you cannot fly + AREA_FLAG_NO_FLY_ZONE = 0x20000000, // Marks zones where you cannot fly + AREA_FLAG_UNK9 = 0x40000000, }; enum Difficulty diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index c4d52aa7d41..a50b35bbf31 100755 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -536,12 +536,22 @@ struct AreaTableEntry 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 + uint32 flags; // 4, + //uint32 unk5; // 5, + //uint32 unk6; // 6, + //uint32 unk7; // 7, + //uint32 unk8; // 8, + //uint32 unk9; // 9, int32 area_level; // 10 - char* area_name; // 11 + char* area_name; // 11 uint32 team; // 12 - // 13-19 unknown + //uint32 unk13; // 13, + //uint32 unk14; // 14, All zeros (4.2.2) + //uint32 unk15; // 15, + //uint32 unk16; // 16, Only Naxxramas has value (21) + //float unk13; // 17, + //float unk13; // 18, + //uint32 unk19; // 19, All zeros (4.2.2) //uint32 unk20; // 20 4.0.0 //uint32 unk21; // 21 4.0.0 //uint32 unk22; // 22 4.0.0 diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index fc9753741a7..bc399ad2d40 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -831,7 +831,20 @@ enum SpellEffects SPELL_EFFECT_TALENT_SPEC_SELECT = 162, SPELL_EFFECT_163 = 163, SPELL_EFFECT_REMOVE_AURA = 164, - TOTAL_SPELL_EFFECTS = 165 + SPELL_EFFECT_165 = 165, + SPELL_EFFECT_166 = 166, + SPELL_EFFECT_167 = 167, + SPELL_EFFECT_168 = 168, + SPELL_EFFECT_169 = 169, + SPELL_EFFECT_170 = 170, + SPELL_EFFECT_171 = 171, // Summons gamebject + SPELL_EFFECT_172 = 172, // Aoe ressurection + SPELL_EFFECT_173 = 173, // Guild tab unlocked (guild perk) + SPELL_EFFECT_174 = 174, // + SPELL_EFFECT_175 = 175, // Unused (4.2.2) + SPELL_EFFECT_176 = 176, // Some kind of sanctuary effect (Vanish) + SPELL_EFFECT_177 = 177, + TOTAL_SPELL_EFFECTS = 178, }; enum SpellCastResult -- cgit v1.2.3 From 4e2f0b1e4e619893e1e8c504179f430b89d3b1a3 Mon Sep 17 00:00:00 2001 From: Shocker Date: Sat, 10 Dec 2011 20:21:21 +0200 Subject: Core/Achievements: Enable the other requirements fields in the AchievementCriteriaEntry format --- src/server/game/DataStores/DBCStructure.h | 6 +++--- src/server/game/DataStores/DBCfmt.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index a50b35bbf31..b3aafbd5463 100755 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -517,7 +517,7 @@ struct AchievementCriteriaEntry char* name; // 9 m_description_lang uint32 completionFlag; // 10 m_flags - uint32 timedCriteriaStartType; // 11 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 + uint32 timedCriteriaStartType; // 11 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 @@ -526,8 +526,8 @@ struct AchievementCriteriaEntry uint32 showOrder; // 14 m_ui_order also used in achievement shift-links as index in state bitmask //uint32 unk1; // 15 only one value, still unknown //uint32 unk2; // 16 all zeros - //uint32 moreRequirement[3]; // 17-19 - //uint32 moreRequirementValue[3]; // 20-22 + uint32 moreRequirement[3]; // 17-19 + uint32 moreRequirementValue[3]; // 20-22 }; struct AreaTableEntry diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index 65532474fa5..052c0aeba2b 100755 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -22,7 +22,7 @@ const char Achievementfmt[]="niixsxiixixxii"; //const std::string CustomAchievementfmt="pppaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaapapaaaaaaaaaaaaaaaaaapp"; //const std::string CustomAchievementIndex = "ID"; -const char AchievementCriteriafmt[]="niiiiiiiisiiiiixxxxxxxx"; +const char AchievementCriteriafmt[]="niiiiiiiisiiiiixxiiiiii"; const char AreaTableEntryfmt[]="iiinixxxxxisixxxxxxxxxxxxx"; const char AreaGroupEntryfmt[]="niiiiiii"; const char AreaPOIEntryfmt[]="niiiiiiiiiiiffixixxixx"; -- cgit v1.2.3 From 44cdb782bd87f8727594b02ddbc25f4022c6dc1b Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sat, 10 Dec 2011 21:18:27 +0100 Subject: Core/Opcodes: CMSG_REQUEST_VEHICLE_SWITCH_SEAT id --- src/server/game/Server/Protocol/Opcodes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index ddaf30ce70f..6e1ff946240 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -368,7 +368,7 @@ enum Opcodes CMSG_REQUEST_VEHICLE_EXIT = 0xCC6, // New 4.x ? CMSG_REQUEST_VEHICLE_NEXT_SEAT = 0xCAD6, CMSG_REQUEST_VEHICLE_PREV_SEAT = 0x1AE2, - CMSG_REQUEST_VEHICLE_SWITCH_SEAT = 0x01, // temp to fix switch case value error + CMSG_REQUEST_VEHICLE_SWITCH_SEAT = 0x9A46, CMSG_RESET_INSTANCES = 0x9EEA, CMSG_RESURRECT_RESPONSE = 0x00, CMSG_RETURN_TO_GRAVEYARD = 0x91A4, -- cgit v1.2.3 From f57fd9c310f5234709662c166bebcc492e0999fa Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sun, 11 Dec 2011 14:25:59 +0100 Subject: Core/Opcodes: CMSG_ATTACKSWING id (Edit via github) --- src/server/game/Server/Protocol/Opcodes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 6e1ff946240..22d8144f9de 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -53,7 +53,7 @@ enum Opcodes CMSG_ARENA_TEAM_REMOVE = 0xCE5E, CMSG_ARENA_TEAM_ROSTER = 0x00, CMSG_ATTACKSTOP = 0x00, - CMSG_ATTACKSWING = 0x00, + CMSG_ATTACKSWING = 0xDE66, CMSG_AUCTION_LIST_BIDDER_ITEMS = 0x00, CMSG_AUCTION_LIST_ITEMS = 0xDC5F, CMSG_AUCTION_LIST_OWNER_ITEMS = 0x00, -- cgit v1.2.3 From b8dec4ec35bae3cee6a3726276ec9ec99e08fe1b Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sun, 11 Dec 2011 14:27:30 +0100 Subject: Core/Opcodes: Enable CMSG_ATTACKSWING handler (Edit via github) --- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 00a8daa7bf0..d2d06b93344 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -379,7 +379,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_EQUIPMENT_SET_DELETE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetDelete ); //DEFINE_OPCODE_HANDLER(CMSG_INSTANCE_LOCK_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInstanceLockResponse ); //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_PASSIVE_AURA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_ATTACKSWING, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleAttackSwingOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_ATTACKSWING, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleAttackSwingOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_ATTACKSTOP, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleAttackStopOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_ATTACKSTART, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ATTACKSTOP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From 1af4d40be6d689a12ccf2fd1b45c7f950be0c3ac Mon Sep 17 00:00:00 2001 From: Supabad Date: Fri, 16 Dec 2011 12:55:02 +0100 Subject: 4.x simplify Authhandler --- src/server/authserver/Authentication/AuthCodes.cpp | 17 +--- src/server/authserver/Authentication/AuthCodes.h | 12 +-- src/server/authserver/Server/AuthSocket.cpp | 107 +++++++-------------- src/server/authserver/Server/AuthSocket.h | 1 - 4 files changed, 41 insertions(+), 96 deletions(-) (limited to 'src') diff --git a/src/server/authserver/Authentication/AuthCodes.cpp b/src/server/authserver/Authentication/AuthCodes.cpp index 59969670921..36c4a355386 100644 --- a/src/server/authserver/Authentication/AuthCodes.cpp +++ b/src/server/authserver/Authentication/AuthCodes.cpp @@ -2,20 +2,9 @@ namespace AuthHelper { - bool IsPreBCAcceptedClientBuild(int build) + bool IsAcceptedBuild(int build) { - int accepted_versions[] = PRE_BC_ACCEPTED_CLIENT_BUILD; - - for (int i = 0; accepted_versions[i]; ++i) - if (build == accepted_versions[i]) - return true; - - return false; - } - - bool IsPostBCAcceptedClientBuild(int build) - { - int accepted_versions[] = POST_BC_ACCEPTED_CLIENT_BUILD; + static int accepted_versions[] = TRINITYCORE_ACCEPTED_CLIENT_BUILD; for (int i = 0; accepted_versions[i]; ++i) if (build == accepted_versions[i]) @@ -26,6 +15,6 @@ namespace AuthHelper bool IsAcceptedClientBuild(int build) { - return (IsPostBCAcceptedClientBuild(build) || IsPreBCAcceptedClientBuild(build)); + return (IsAcceptedBuild(build)); } }; diff --git a/src/server/authserver/Authentication/AuthCodes.h b/src/server/authserver/Authentication/AuthCodes.h index 88e2649ce7e..085326378da 100755 --- a/src/server/authserver/Authentication/AuthCodes.h +++ b/src/server/authserver/Authentication/AuthCodes.h @@ -65,21 +65,13 @@ enum LoginResult LOGIN_LOCKED_ENFORCED = 0x10, }; -#define POST_BC_ACCEPTED_CLIENT_BUILD {14545 ,12340, 11723, 11403, 11159, 10571, 10505, 10146, 9947, 8606, 0} -#define PRE_BC_ACCEPTED_CLIENT_BUILD {5875, 6005, 0} +#define TRINITYCORE_ACCEPTED_CLIENT_BUILD {14545, 14480, 14333, 14007, 0} -enum ExpansionFlags -{ - POST_BC_EXP_FLAG = 0x2, - PRE_BC_EXP_FLAG = 0x1, - NO_VALID_EXP_FLAG = 0x0 -}; namespace AuthHelper { bool IsAcceptedClientBuild(int build); - bool IsPostBCAcceptedClientBuild(int build); - bool IsPreBCAcceptedClientBuild(int build); + bool IsAcceptedBuild(int build); }; #endif diff --git a/src/server/authserver/Server/AuthSocket.cpp b/src/server/authserver/Server/AuthSocket.cpp index c24012efcef..605c5af889b 100755 --- a/src/server/authserver/Server/AuthSocket.cpp +++ b/src/server/authserver/Server/AuthSocket.cpp @@ -342,10 +342,9 @@ bool AuthSocket::_HandleLogonChallenge() _login = (const char*)ch->I; _build = ch->build; - _expversion = (AuthHelper::IsPostBCAcceptedClientBuild(_build) ? POST_BC_EXP_FLAG : NO_VALID_EXP_FLAG) | (AuthHelper::IsPreBCAcceptedClientBuild(_build) ? PRE_BC_EXP_FLAG : NO_VALID_EXP_FLAG); - pkt << (uint8)AUTH_LOGON_CHALLENGE; - pkt << (uint8)0x00; + pkt << uint8(AUTH_LOGON_CHALLENGE); + pkt << uint8(0x00); // Verify that this IP is not in the ip_banned table LoginDatabase.Execute(LoginDatabase.GetPreparedStatement(LOGIN_SET_EXPIREDIPBANS)); @@ -356,7 +355,7 @@ bool AuthSocket::_HandleLogonChallenge() PreparedQueryResult result = LoginDatabase.Query(stmt); if (result) { - pkt << (uint8)WOW_FAIL_BANNED; + pkt << uint8(WOW_FAIL_BANNED); sLog->outBasic("[AuthChallenge] Banned ip %s tried to login!", ip_address.c_str()); } else @@ -381,7 +380,7 @@ bool AuthSocket::_HandleLogonChallenge() if (strcmp(fields[3].GetCString(), ip_address.c_str())) { sLog->outStaticDebug("[AuthChallenge] Account IP differs"); - pkt << (uint8) WOW_FAIL_SUSPENDED; + pkt << uint8(WOW_FAIL_SUSPENDED); locked = true; } else @@ -403,12 +402,12 @@ bool AuthSocket::_HandleLogonChallenge() { if ((*banresult)[0].GetUInt64() == (*banresult)[1].GetUInt64()) { - pkt << (uint8)WOW_FAIL_BANNED; + pkt << uint8(WOW_FAIL_BANNED); sLog->outBasic("[AuthChallenge] Banned account %s tried to login!", _login.c_str()); } else { - pkt << (uint8)WOW_FAIL_SUSPENDED; + pkt << uint8(WOW_FAIL_SUSPENDED); sLog->outBasic("[AuthChallenge] Temporarily banned account %s tried to login!", _login.c_str()); } } @@ -442,7 +441,11 @@ bool AuthSocket::_HandleLogonChallenge() unk3.SetRand(16 * 8); // Fill the response packet with the result - pkt << uint8(WOW_SUCCESS); + // If the client has no valid version + if (!AuthHelper::IsAcceptedClientBuild(_build)) + pkt << uint8(WOW_FAIL_VERSION_INVALID); + else + pkt << uint8(WOW_SUCCESS); // B may be calculated < 32B so we force minimal length to 32B pkt.append(B.AsByteArray(32), 32); // 32 bytes @@ -485,7 +488,7 @@ bool AuthSocket::_HandleLogonChallenge() } } else //no account - pkt << (uint8)WOW_FAIL_UNKNOWN_ACCOUNT; + pkt << uint8(WOW_FAIL_UNKNOWN_ACCOUNT); } socket().send((char const*)pkt.contents(), pkt.size()); @@ -502,15 +505,6 @@ bool AuthSocket::_HandleLogonProof() if (!socket().recv((char *)&lp, sizeof(sAuthLogonProof_C))) return false; - // If the client has no valid version - if (_expversion == NO_VALID_EXP_FLAG) - { - // Check if we have the appropriate patch on the disk - sLog->outDebug(LOG_FILTER_NETWORKIO, "Client with invalid version, patching is not implemented"); - socket().shutdown(); - return true; - } - // Continue the SRP6 calculation based on data received from the client BigNumber A; @@ -610,26 +604,14 @@ bool AuthSocket::_HandleLogonProof() sha.UpdateBigNumbers(&A, &M, &K, NULL); sha.Finalize(); - if (_expversion & POST_BC_EXP_FLAG) // 2.x and 3.x clients - { - sAuthLogonProof_S proof; - memcpy(proof.M2, sha.GetDigest(), 20); - proof.cmd = AUTH_LOGON_PROOF; - proof.error = 0; - proof.unk1 = 0x00800000; // Accountflags. 0x01 = GM, 0x08 = Trial, 0x00800000 = Pro pass (arena tournament) - proof.unk2 = 0x00; // SurveyId - proof.unk3 = 0x00; - socket().send((char *)&proof, sizeof(proof)); - } - else - { - sAuthLogonProof_S_Old proof; - memcpy(proof.M2, sha.GetDigest(), 20); - proof.cmd = AUTH_LOGON_PROOF; - proof.error = 0; - proof.unk2 = 0x00; - socket().send((char *)&proof, sizeof(proof)); - } + sAuthLogonProof_S proof; + memcpy(proof.M2, sha.GetDigest(), 20); + proof.cmd = AUTH_LOGON_PROOF; + proof.error = 0; + proof.unk1 = 0x00800000; // Accountflags. 0x01 = GM, 0x08 = Trial, 0x00800000 = Pro pass (arena tournament) + proof.unk2 = 0x00; // SurveyId + proof.unk3 = 0x00; + socket().send((char *)&proof, sizeof(proof)); _authed = true; } @@ -737,7 +719,6 @@ bool AuthSocket::_HandleReconnectChallenge() // Reinitialize build, expansion and the account securitylevel _build = ch->build; - _expversion = (AuthHelper::IsPostBCAcceptedClientBuild(_build) ? POST_BC_EXP_FLAG : NO_VALID_EXP_FLAG) | (AuthHelper::IsPreBCAcceptedClientBuild(_build) ? PRE_BC_EXP_FLAG : NO_VALID_EXP_FLAG); Field* fields = result->Fetch(); uint8 secLevel = fields[2].GetUInt8(); @@ -747,11 +728,11 @@ bool AuthSocket::_HandleReconnectChallenge() // Sending response ByteBuffer pkt; - pkt << (uint8)AUTH_RECONNECT_CHALLENGE; - pkt << (uint8)0x00; + pkt << uint8(AUTH_RECONNECT_CHALLENGE); + pkt << uint8(0x00); _reconnectProof.SetRand(16 * 8); pkt.append(_reconnectProof.AsByteArray(16), 16); // 16 bytes random - pkt << (uint64)0x00 << (uint64)0x00; // 16 bytes zeros + pkt << uint64(0x00) << uint64(0x00); // 16 bytes zeros socket().send((char const*)pkt.contents(), pkt.size()); return true; } @@ -781,9 +762,9 @@ bool AuthSocket::_HandleReconnectProof() { // Sending response ByteBuffer pkt; - pkt << (uint8)AUTH_RECONNECT_PROOF; - pkt << (uint8)0x00; - pkt << (uint16)0x00; // 2 bytes zeros + pkt << uint8(AUTH_RECONNECT_PROOF); + pkt << uint8(0x00); + pkt << uint16(0x00); // 2 bytes zeros socket().send((char const*)pkt.contents(), pkt.size()); _authed = true; return true; @@ -830,10 +811,8 @@ bool AuthSocket::_HandleRealmList() for (RealmList::RealmMap::const_iterator i = sRealmList->begin(); i != sRealmList->end(); ++i) { // don't work with realms which not compatible with the client - if ((_expversion & POST_BC_EXP_FLAG) && i->second.gamebuild != _build) + if (i->second.gamebuild != _build) continue; - else if ((_expversion & PRE_BC_EXP_FLAG) && !AuthHelper::IsPreBCAcceptedClientBuild(i->second.gamebuild)) - continue; uint8 AmountOfCharacters; @@ -850,44 +829,30 @@ bool AuthSocket::_HandleRealmList() uint8 lock = (i->second.allowedSecurityLevel > _accountSecurityLevel) ? 1 : 0; pkt << i->second.icon; // realm type - if ( _expversion & POST_BC_EXP_FLAG ) // only 2.x and 3.x clients - pkt << lock; // if 1, then realm locked + pkt << lock; // if 1, then realm locked pkt << i->second.color; // if 2, then realm is offline pkt << i->first; pkt << i->second.address; pkt << i->second.populationLevel; pkt << AmountOfCharacters; pkt << i->second.timezone; // realm category - if (_expversion & POST_BC_EXP_FLAG) // 2.x and 3.x clients - pkt << (uint8)0x2C; // unk, may be realm number/id? - else - pkt << (uint8)0x0; // 1.12.1 and 1.12.2 clients + pkt << uint8(0x2C); // unk, may be realm number/id? ++RealmListSize; } - - if ( _expversion & POST_BC_EXP_FLAG ) // 2.x and 3.x clients - { - pkt << (uint8)0x10; - pkt << (uint8)0x00; - } - else // 1.12.1 and 1.12.2 clients - { - pkt << (uint8)0x00; - pkt << (uint8)0x02; - } + + pkt << uint8(0x10); + pkt << uint8(0x00); + // make a ByteBuffer which stores the RealmList's size ByteBuffer RealmListSizeBuffer; RealmListSizeBuffer << (uint32)0; - if (_expversion & POST_BC_EXP_FLAG) // only 2.x and 3.x clients - RealmListSizeBuffer << (uint16)RealmListSize; - else - RealmListSizeBuffer << (uint32)RealmListSize; + RealmListSizeBuffer << uint16(RealmListSize); ByteBuffer hdr; - hdr << (uint8) REALM_LIST; - hdr << (uint16)(pkt.size() + RealmListSizeBuffer.size()); + hdr << uint8(REALM_LIST); + hdr << uint16((pkt.size() + RealmListSizeBuffer.size())); hdr.append(RealmListSizeBuffer); // append RealmList's size buffer hdr.append(pkt); // append realms in the realmlist diff --git a/src/server/authserver/Server/AuthSocket.h b/src/server/authserver/Server/AuthSocket.h index 75df3d69a05..4322196d9e7 100755 --- a/src/server/authserver/Server/AuthSocket.h +++ b/src/server/authserver/Server/AuthSocket.h @@ -82,7 +82,6 @@ private: // between enUS and enGB, which is important for the patch system std::string _localizationName; uint16 _build; - uint8 _expversion; AccountTypes _accountSecurityLevel; }; -- cgit v1.2.3 From cef048beba21261e9bd224c9649789d2e3438692 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 17 Dec 2011 14:37:00 +0100 Subject: Core/DB2: Wrap DB2 structures in #pragma pack(1) to prevent byte padding and allow correct reading on all platforms --- src/server/game/DataStores/DB2Structure.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src') diff --git a/src/server/game/DataStores/DB2Structure.h b/src/server/game/DataStores/DB2Structure.h index ae070924b5b..e4632e835d8 100644 --- a/src/server/game/DataStores/DB2Structure.h +++ b/src/server/game/DataStores/DB2Structure.h @@ -30,6 +30,13 @@ #include #include +// GCC has alternative #pragma pack(N) syntax and old gcc version does not support pack(push, N), also any gcc version does not support it at some platform +#if defined(__GNUC__) +#pragma pack(1) +#else +#pragma pack(push, 1) +#endif + // Structures used to access raw DB2 data and required packing to portability struct ItemEntry { @@ -138,4 +145,11 @@ struct ItemExtendedCostEntry //uint32 Unknown[5]; // 26-30 }; +// GCC has alternative #pragma pack(N) syntax and old gcc version does not support pack(push, N), also any gcc version does not support it at some platform +#if defined(__GNUC__) +#pragma pack() +#else +#pragma pack(pop) +#endif + #endif \ No newline at end of file -- cgit v1.2.3 From 6758e133499a7e56fb29a351d011eee14b92e43b Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 17 Dec 2011 14:37:28 +0100 Subject: Core/Items: Added ITEM_FLAGS_EXTRA_BNET_ACCOUNT_BOUND --- src/server/game/Entities/Item/ItemPrototype.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/server/game/Entities/Item/ItemPrototype.h b/src/server/game/Entities/Item/ItemPrototype.h index 5d72e5b0114..7ab6a1e6bcd 100755 --- a/src/server/game/Entities/Item/ItemPrototype.h +++ b/src/server/game/Entities/Item/ItemPrototype.h @@ -199,6 +199,7 @@ enum ItemFlagsExtra ITEM_FLAGS_EXTRA_EXT_COST_REQUIRES_GOLD = 0x00000004, // when item uses extended cost, gold is also required ITEM_FLAGS_EXTRA_NEED_ROLL_DISABLED = 0x00000100, ITEM_FLAGS_EXTRA_CASTER_WEAPON = 0x00000200, + ITEM_FLAGS_EXTRA_BNET_ACCOUNT_BOUND = 0x00020000, }; enum BAG_FAMILY_MASK -- cgit v1.2.3 From 8a000de1ca8e675b88f3b3a70bbcee3b4be120f1 Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 18 Dec 2011 15:42:07 +0000 Subject: Core/Misc: Fix two warnings --- src/server/game/Entities/Player/Player.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index e52f1cc1ee4..7eca06f750c 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1536,8 +1536,8 @@ class Player : public Unit, public GridObject static bool LoadPositionFromDB(uint32& mapid, float& x, float& y, float& z, float& o, bool& in_flight, uint64 guid); static bool IsValidGender(uint8 Gender) { return Gender <= GENDER_FEMALE ; } - static bool IsValidClass(uint8 Class) { return (1 << Class - 1) & CLASSMASK_ALL_PLAYABLE; } - static bool IsValidRace(uint8 Race) { return (1 << Race - 1) & RACEMASK_ALL_PLAYABLE; } + static bool IsValidClass(uint8 Class) { return (1 << (Class - 1)) & CLASSMASK_ALL_PLAYABLE; } + static bool IsValidRace(uint8 Race) { return (1 << (Race - 1)) & RACEMASK_ALL_PLAYABLE; } /*********************************************************/ /*** SAVE SYSTEM ***/ -- cgit v1.2.3 From 4f75009fdf12a4bddbf4f0ce3541e790f192f883 Mon Sep 17 00:00:00 2001 From: weclub <2359980687@qq.com> Date: Sun, 18 Dec 2011 16:06:49 +0000 Subject: Core/Opcodes: Enable SMSG_ZONE_UNDER_ATTACK, Structure is correct Closes #4275 --- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- src/server/game/Server/Protocol/Opcodes.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index d2d06b93344..9537ec60282 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -654,7 +654,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_LEARN_TALENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnTalentOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_RESURRECT_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_TOGGLE_PVP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTogglePvP ); - //DEFINE_OPCODE_HANDLER(SMSG_ZONE_UNDER_ATTACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ZONE_UNDER_ATTACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(MSG_AUCTION_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionHelloOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_SELL_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionSellItem ); //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_REMOVE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionRemoveItem ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 22d8144f9de..0091fa6313d 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -1021,7 +1021,7 @@ enum Opcodes SMSG_WHO = 0x4C7F, SMSG_WHOIS = 0x00, SMSG_WORLD_STATE_UI_TIMER_UPDATE = 0x00, - SMSG_ZONE_UNDER_ATTACK = 0x00, + SMSG_ZONE_UNDER_ATTACK = 0x8CF, SMSG_VERIFY_CONNECTIVITY = 0x4F57, CMSG_VERIFY_CONNECTIVITY_RESPONSE = 0x4C52, //1280462679, // special opcode, client sends as uint32 -- cgit v1.2.3 From 005636003410b9223c9083f6729557a58858efbd Mon Sep 17 00:00:00 2001 From: weclub <2359980687@qq.com> Date: Sun, 18 Dec 2011 16:13:03 +0000 Subject: Core/Enum: Update ServerMessageType enum to 14545 Closes #4277 --- src/server/game/World/World.h | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h index fd0a05f469c..4a34dc63af3 100755 --- a/src/server/game/World/World.h +++ b/src/server/game/World/World.h @@ -44,11 +44,19 @@ class SystemMgr; // ServerMessages.dbc enum ServerMessageType { - SERVER_MSG_SHUTDOWN_TIME = 1, - SERVER_MSG_RESTART_TIME = 2, - SERVER_MSG_STRING = 3, - SERVER_MSG_SHUTDOWN_CANCELLED = 4, - SERVER_MSG_RESTART_CANCELLED = 5 + SERVER_MSG_SHUTDOWN_TIME = 1, + SERVER_MSG_RESTART_TIME = 2, + SERVER_MSG_STRING = 3, + SERVER_MSG_SHUTDOWN_CANCELLED = 4, + SERVER_MSG_RESTART_CANCELLED = 5, + SERVER_MSG_BG_SHUTDOWN_TIME = 6, + SERVER_MSG_BG_RESTART_TIME = 7, + SERVER_MSG_INSTANCE_SHUTDOWN_TIME = 8, + SERVER_MSG_INSTANCE_RESTART_TIME = 9, + SERVER_MSG_CONTENT_READY = 10, + SERVER_MSG_TICKET_SERVICED_SOON = 11, + SERVER_MSG_WAIT_TIME_UNAVAILABLE = 12, + SERVER_MSG_TICKET_WAIT_TIME = 13, }; enum ShutdownMask -- cgit v1.2.3 From 9ded88d75f4fa8bb4219f7be6c0cf91959b9638f Mon Sep 17 00:00:00 2001 From: weclub <2359980687@qq.com> Date: Sun, 18 Dec 2011 16:18:07 +0000 Subject: Core/Opcodes.h: Codestyle; opcode ids should be in hex and uppercased Closes #4278 --- src/server/game/Server/Protocol/Opcodes.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 0091fa6313d..319c7e9487e 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -460,7 +460,7 @@ enum Opcodes MSG_INSPECT_ARENA_TEAMS = 0x00, MSG_LIST_STABLED_PETS = 0x88CA, MSG_MINIMAP_PING = 0x00, - MSG_MOVE_FALL_LAND = 0x00a5, + MSG_MOVE_FALL_LAND = 0x00A5, MSG_MOVE_HEARTBEAT = 0xB024, MSG_MOVE_HOVER = 0x00, MSG_MOVE_JUMP = 0x9225, @@ -486,7 +486,7 @@ enum Opcodes MSG_MOVE_SET_SWIM_SPEED_CHEAT = 0x00, MSG_MOVE_SET_TURN_RATE = 0x00, MSG_MOVE_SET_TURN_RATE_CHEAT = 0x00, - MSG_MOVE_SET_WALK_MODE = 0x24a4, + MSG_MOVE_SET_WALK_MODE = 0x24A4, MSG_MOVE_SET_WALK_SPEED = 0x00, MSG_MOVE_SET_WALK_SPEED_CHEAT = 0x00, MSG_MOVE_START_ASCEND = 0x0624, @@ -608,7 +608,7 @@ enum Opcodes SMSG_CHANNEL_LIST = 0x00, SMSG_CHANNEL_MEMBER_COUNT = 0x00, SMSG_CHANNEL_NOTIFY = 0x9C7F, - SMSG_CHAR_CREATE = 19547, + SMSG_CHAR_CREATE = 0x4C5B, SMSG_CHAR_DELETE = 0x48CE, SMSG_CHAR_ENUM = 0xA05C, SMSG_CHARACTER_LOGIN_FAILED = 0x00, -- cgit v1.2.3 From 1a7f9f4ce628420452712e9cf91cc1d44a5d58c9 Mon Sep 17 00:00:00 2001 From: weclub <2359980687@qq.com> Date: Sun, 18 Dec 2011 16:24:15 +0000 Subject: Core/Spells: Update SpellEffects to 422 and fix a typo Close #4297 --- src/server/game/DataStores/DBCStructure.h | 2 +- src/server/game/Entities/Item/ItemPrototype.h | 4 ++-- src/server/game/Miscellaneous/SharedDefines.h | 16 ++++++++-------- src/server/game/Spells/SpellEffects.cpp | 17 +++++++++++++++-- 4 files changed, 26 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 7b0695f5615..744e5a1c048 100755 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -1629,7 +1629,7 @@ struct SpellEffectEntry uint32 EffectImplicitTargetB; // 23 m_implicitTargetB uint32 EffectSpellId; // 24 new 4.0.0 uint32 EffectIndex; // 25 new 4.0.0 - //uint32 Unk0 // 26 4.2.0 + //uint32 Unk0 // 26 4.2.0 only 0 or 1 }; #define MAX_SPELL_EFFECTS 3 diff --git a/src/server/game/Entities/Item/ItemPrototype.h b/src/server/game/Entities/Item/ItemPrototype.h index 7ab6a1e6bcd..c60d26833fb 100755 --- a/src/server/game/Entities/Item/ItemPrototype.h +++ b/src/server/game/Entities/Item/ItemPrototype.h @@ -78,7 +78,7 @@ enum ItemModType ITEM_MOD_ARCANE_RESISTANCE = 56, }; -#define MAX_ITEM_MOD 49 +#define MAX_ITEM_MOD 57 enum ItemSpelltriggerType { @@ -148,7 +148,7 @@ enum ItemProtoFlags ITEM_PROTO_FLAG_TRIGGERED_CAST = 0x10000000, // Spell is cast with triggered flag ITEM_PROTO_FLAG_MILLABLE = 0x20000000, // Item can be milled ITEM_PROTO_FLAG_UNK11 = 0x40000000, // ? - ITEM_PROTO_FLAG_UNK12 = 0x80000000 // ? + ITEM_PROTO_FLAG_BOP_TRADEABLE = 0x80000000 // bound item that can be traded }; /* TODO diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 58ffc19126e..ac3db9a4f2f 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -670,7 +670,7 @@ enum SpellEffects SPELL_EFFECT_INSTAKILL = 1, SPELL_EFFECT_SCHOOL_DAMAGE = 2, SPELL_EFFECT_DUMMY = 3, - SPELL_EFFECT_PORTAL_TELEPORT = 4, + SPELL_EFFECT_PORTAL_TELEPORT = 4, // Unused (4.2.2) SPELL_EFFECT_TELEPORT_UNITS = 5, SPELL_EFFECT_APPLY_AURA = 6, SPELL_EFFECT_ENVIRONMENTAL_DAMAGE = 7, @@ -679,9 +679,9 @@ enum SpellEffects SPELL_EFFECT_HEAL = 10, SPELL_EFFECT_BIND = 11, SPELL_EFFECT_PORTAL = 12, - SPELL_EFFECT_RITUAL_BASE = 13, - SPELL_EFFECT_RITUAL_SPECIALIZE = 14, - SPELL_EFFECT_RITUAL_ACTIVATE_PORTAL = 15, + SPELL_EFFECT_RITUAL_BASE = 13, // Unused (4.2.2) + SPELL_EFFECT_RITUAL_SPECIALIZE = 14, // Unused (4.2.2) + SPELL_EFFECT_RITUAL_ACTIVATE_PORTAL = 15, // Unused (4.2.2) SPELL_EFFECT_QUEST_COMPLETE = 16, SPELL_EFFECT_WEAPON_DAMAGE_NOSCHOOL = 17, SPELL_EFFECT_RESURRECT = 18, @@ -717,8 +717,8 @@ enum SpellEffects SPELL_EFFECT_STEALTH = 48, SPELL_EFFECT_DETECT = 49, SPELL_EFFECT_TRANS_DOOR = 50, - SPELL_EFFECT_FORCE_CRITICAL_HIT = 51, - SPELL_EFFECT_GUARANTEE_HIT = 52, + SPELL_EFFECT_FORCE_CRITICAL_HIT = 51, // Unused (4.2.2) + SPELL_EFFECT_GUARANTEE_HIT = 52, // Unused (4.2.2) SPELL_EFFECT_ENCHANT_ITEM = 53, SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY = 54, SPELL_EFFECT_TAMECREATURE = 55, @@ -788,7 +788,7 @@ enum SpellEffects SPELL_EFFECT_APPLY_AREA_AURA_PET = 119, SPELL_EFFECT_TELEPORT_GRAVEYARD = 120, SPELL_EFFECT_NORMALIZED_WEAPON_DMG = 121, - SPELL_EFFECT_122 = 122, + SPELL_EFFECT_122 = 122, // Unused (4.2.2) SPELL_EFFECT_SEND_TAXI = 123, SPELL_EFFECT_PULL_TOWARDS = 124, SPELL_EFFECT_MODIFY_THREAT_PERCENT = 125, @@ -829,7 +829,7 @@ enum SpellEffects SPELL_EFFECT_160 = 160, SPELL_EFFECT_TALENT_SPEC_COUNT = 161, SPELL_EFFECT_TALENT_SPEC_SELECT = 162, - SPELL_EFFECT_163 = 163, + SPELL_EFFECT_163 = 163, // Unused (4.2.2) SPELL_EFFECT_REMOVE_AURA = 164, SPELL_EFFECT_165 = 165, SPELL_EFFECT_166 = 166, diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index de1b453ac17..be8db537065 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -118,7 +118,7 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]= &Spell::EffectUnused, // 49 SPELL_EFFECT_DETECT one spell: Detect &Spell::EffectTransmitted, // 50 SPELL_EFFECT_TRANS_DOOR &Spell::EffectUnused, // 51 SPELL_EFFECT_FORCE_CRITICAL_HIT unused - &Spell::EffectUnused, // 52 SPELL_EFFECT_GUARANTEE_HIT one spell: zzOLDCritical Shot + &Spell::EffectUnused, // 52 SPELL_EFFECT_GUARANTEE_HIT unused &Spell::EffectEnchantItemPerm, // 53 SPELL_EFFECT_ENCHANT_ITEM &Spell::EffectEnchantItemTmp, // 54 SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY &Spell::EffectTameCreature, // 55 SPELL_EFFECT_TAMECREATURE @@ -229,8 +229,21 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]= &Spell::EffectNULL, //160 SPELL_EFFECT_160 1 spell - 45534 &Spell::EffectSpecCount, //161 SPELL_EFFECT_TALENT_SPEC_COUNT second talent spec (learn/revert) &Spell::EffectActivateSpec, //162 SPELL_EFFECT_TALENT_SPEC_SELECT activate primary/secondary spec - &Spell::EffectNULL, //163 unused + &Spell::EffectUnused, //163 SPELL_EFFECT_163 unused &Spell::EffectRemoveAura, //164 SPELL_EFFECT_REMOVE_AURA + &Spell::EffectNULL, //165 SPELL_EFFECT_165 + &Spell::EffectNULL, //166 SPELL_EFFECT_166 + &Spell::EffectNULL, //167 SPELL_EFFECT_167 + &Spell::EffectNULL, //168 SPELL_EFFECT_168 + &Spell::EffectNULL, //169 SPELL_EFFECT_169 + &Spell::EffectNULL, //170 SPELL_EFFECT_170 + &Spell::EffectNULL, //171 SPELL_EFFECT_171 + &Spell::EffectNULL, //172 SPELL_EFFECT_172 + &Spell::EffectNULL, //173 SPELL_EFFECT_173 + &Spell::EffectNULL, //174 SPELL_EFFECT_174 + &Spell::EffectUnused, //175 SPELL_EFFECT_175 unused + &Spell::EffectNULL, //176 SPELL_EFFECT_176 + &Spell::EffectNULL, //177 SPELL_EFFECT_177 }; void Spell::EffectNULL(SpellEffIndex /*effIndex*/) -- cgit v1.2.3 From 0c5d88c06014108c91311c21f8a07f2784dccb45 Mon Sep 17 00:00:00 2001 From: weclub <2359980687@qq.com> Date: Sun, 18 Dec 2011 16:37:39 +0000 Subject: Core/Opcodes: Add a few opcode ids and enable their handlers Closes #4296 Closes #4298 Closes #4299 Closes #4300 --- src/server/game/Server/Protocol/Opcodes.cpp | 8 ++++---- src/server/game/Server/Protocol/Opcodes.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 9537ec60282..699baee84a2 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -517,7 +517,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_FISH_NOT_HOOKED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_FISH_ESCAPED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_BUG, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBugOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_PLAYED_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayedTime ); //DEFINE_OPCODE_HANDLER(SMSG_PLAYED_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_QUERY_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryTimeOpcode ); @@ -580,9 +580,9 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_UPDATETEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketUpdateOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_UPDATETEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ACCOUNT_DATA_TIMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_ACCOUNT_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestAccountData ); + DEFINE_OPCODE_HANDLER(CMSG_REQUEST_ACCOUNT_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestAccountData ); DEFINE_OPCODE_HANDLER(CMSG_UPDATE_ACCOUNT_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateAccountData ); - //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ACCOUNT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ACCOUNT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_FAR_SIGHT_IMMEDIATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHANGEPLAYER_DIFFICULTY_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GM_TEACH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -887,7 +887,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_DEFENSE_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_DIFFICULTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(MSG_GM_RESETINSTANCELIMIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_MOTD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOTD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 319c7e9487e..d7285b09027 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -352,12 +352,12 @@ enum Opcodes CMSG_READ_ITEM = 0x00, CMSG_REALM_SPLIT = 0xDC66, CMSG_RECLAIM_CORPSE = 0x88DB, - CMSG_REDIRECTION_AUTH_PROOF = 0x00, + CMSG_REDIRECTION_AUTH_PROOF = 0x1039, CMSG_REPAIR_ITEM = 0xCF3, CMSG_REPOP_REQUEST = 0x8872, CMSG_REPORT_PVP_AFK = 0x00, CMSG_REPLACE_ACCOUNT_DATA = 0x00, - CMSG_REQUEST_ACCOUNT_DATA = 0x00, + CMSG_REQUEST_ACCOUNT_DATA = 0x8AF2, CMSG_REQUEST_CATEGORY_COOLDOWNS = 0x00, CMSG_REQUEST_CEMETERY_LIST = 0x00, CMSG_REQUEST_PARTY_MEMBER_STATS = 0x987E, @@ -832,7 +832,7 @@ enum Opcodes SMSG_NAME_QUERY_RESPONSE = 0x9CE6, SMSG_NEW_TAXI_PATH = 0xC8FF, // Might be 0x98CF SMSG_NEW_WORLD = 0x00, - SMSG_NOTIFICATION = 0x00, + SMSG_NOTIFICATION = 0x1A56, SMSG_NOTIFY_DANCE = 0x00, SMSG_NOTIFY_DEST_LOC_SPELL_CAST = 0x00, SMSG_NPC_TEXT_UPDATE = 0x4C72, @@ -997,7 +997,7 @@ enum Opcodes SMSG_TURN_IN_PETITION_RESULTS = 0x08DB, SMSG_TUTORIAL_FLAGS = 0x1A46, SMSG_UNIT_SPELLCAST_START = 0x00, - SMSG_UPDATE_ACCOUNT_DATA = 0x00, + SMSG_UPDATE_ACCOUNT_DATA = 0x4A73, SMSG_UPDATE_ACCOUNT_DATA_COMPLETE = 0x5E53, SMSG_UPDATE_COMBO_POINTS = 0x00, SMSG_UPDATE_CURRENCY = 0x00, -- cgit v1.2.3 From b3670c9712064934f357e6b9118fb91e50c288bd Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 18 Dec 2011 16:48:17 +0000 Subject: Core/Opcodes: Add id and handler for SMSG_UPDATE_LAST_INSTANCE (from WPP) --- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- src/server/game/Server/Protocol/Opcodes.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 699baee84a2..9f43dbb50a9 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -858,7 +858,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_RESET_INSTANCES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleResetInstancesOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_RESET_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_LAST_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_UPDATE_LAST_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(MSG_RAID_TARGET_UPDATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidTargetUpdateOpcode ); //DEFINE_OPCODE_HANDLER(MSG_RAID_READY_CHECK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidReadyCheckOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LUA_USAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index d7285b09027..aae4a4b68eb 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -1004,7 +1004,7 @@ enum Opcodes SMSG_UPDATE_CURRENCY_WEEK_LIMIT = 0x00, SMSG_UPDATE_INSTANCE_ENCOUNTER_UNIT = 0x00, SMSG_UPDATE_INSTANCE_OWNERSHIP = 0x00, - SMSG_UPDATE_LAST_INSTANCE = 0x00, + SMSG_UPDATE_LAST_INSTANCE = 0x58FE, SMSG_UPDATE_LFG_LIST = 0x00, SMSG_UPDATE_OBJECT = 0x1EE7, SMSG_UPDATE_WORLD_STATE = 0x00, -- cgit v1.2.3 From dc93f698ca40bcb47745452d1b8a776129a8be6a Mon Sep 17 00:00:00 2001 From: Supabad Date: Mon, 19 Dec 2011 12:57:50 +0100 Subject: 4.x add handler for CMSG_GROUP_SWAP_SUB_GROUP and uncomment some confirmed handlers add opcode value for CMSG_REQUEST_RAID_INFO --- src/server/game/Server/Protocol/Handlers/GroupHandler.cpp | 10 ++++++++++ src/server/game/Server/Protocol/Opcodes.cpp | 6 +++--- src/server/game/Server/Protocol/Opcodes.h | 2 +- src/server/game/Server/WorldSession.h | 1 + 4 files changed, 15 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Handlers/GroupHandler.cpp b/src/server/game/Server/Protocol/Handlers/GroupHandler.cpp index 682c5f8ab9a..56dc30e2fa3 100755 --- a/src/server/game/Server/Protocol/Handlers/GroupHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/GroupHandler.cpp @@ -608,6 +608,16 @@ void WorldSession::HandleGroupChangeSubGroupOpcode(WorldPacket & recv_data) group->ChangeMembersGroup(guid, groupNr); } +void WorldSession::HandleGroupSwapSubGroupOpcode(WorldPacket & recv_data) +{ + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_SWAP_SUB_GROUP"); + std::string unk1; + std::string unk2; + + recv_data >> unk1; + recv_data >> unk2; +} + void WorldSession::HandleGroupAssistantLeaderOpcode(WorldPacket & recv_data) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_ASSISTANT_LEADER"); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 9f43dbb50a9..d5923b26116 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -695,9 +695,9 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_SPELLDISPELLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DAMAGE_CALC_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_ENABLE_DAMAGE_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GROUP_CHANGE_SUB_GROUP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupChangeSubGroupOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GROUP_CHANGE_SUB_GROUP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupChangeSubGroupOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PARTY_MEMBER_STATS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestPartyMemberStatsOpcode); - //DEFINE_OPCODE_HANDLER(CMSG_GROUP_SWAP_SUB_GROUP, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_GROUP_SWAP_SUB_GROUP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupSwapSubGroupOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_RESET_FACTION_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_BANK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoStoreBankItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_AUTOBANK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoBankItemOpcode ); @@ -775,7 +775,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FALL_RESET, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); //DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_SAVE_CREATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_RAID_INSTANCE_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RAID_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestRaidInfoOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RAID_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestRaidInfoOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_TIME_SKIPPED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleMoveTimeSkippedOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FEATHER_FALL_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleFeatherFallAck ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_WATER_WALK_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveWaterWalkAck ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index aae4a4b68eb..16bbbbe7401 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -364,7 +364,7 @@ enum Opcodes CMSG_REQUEST_PET_INFO = 0x9A47, CMSG_REQUEST_PLAYER_VEHICLE_EXIT = 0xCC6, CMSG_REQUEST_RATED_BG_INFO = 0x00, - CMSG_REQUEST_RAID_INFO = 0x00, + CMSG_REQUEST_RAID_INFO = 0xECF, CMSG_REQUEST_VEHICLE_EXIT = 0xCC6, // New 4.x ? CMSG_REQUEST_VEHICLE_NEXT_SEAT = 0xCAD6, CMSG_REQUEST_VEHICLE_PREV_SEAT = 0x1AE2, diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index e19b26af374..e972a092dd3 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -541,6 +541,7 @@ class WorldSession void HandleRaidReadyCheckFinishedOpcode(WorldPacket& recv_data); void HandleGroupRaidConvertOpcode(WorldPacket& recv_data); void HandleGroupChangeSubGroupOpcode(WorldPacket& recv_data); + void HandleGroupSwapSubGroupOpcode(WorldPacket& recv_data); void HandleGroupAssistantLeaderOpcode(WorldPacket& recv_data); void HandlePartyAssignmentOpcode(WorldPacket& recv_data); -- cgit v1.2.3 From b8eed5d127479abca64e0c7e4cc3e860e903e390 Mon Sep 17 00:00:00 2001 From: kaelima Date: Wed, 21 Dec 2011 02:23:56 +0100 Subject: Misc/Enum: Updated some enums to 4.2.2 --- src/server/game/DataStores/DBCEnums.h | 28 ++++++++++++++--------- src/server/game/Entities/Vehicle/VehicleDefines.h | 24 ++++++++++++++++++- src/server/game/Groups/Group.h | 4 +++- 3 files changed, 43 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCEnums.h b/src/server/game/DataStores/DBCEnums.h index 900e97511c4..2cfcc2117e2 100755 --- a/src/server/game/DataStores/DBCEnums.h +++ b/src/server/game/DataStores/DBCEnums.h @@ -397,19 +397,19 @@ enum ItemEnchantmentType enum ItemLimitCategoryMode { - ITEM_LIMIT_CATEGORY_MODE_HAVE = 0, // limit applied to amount items in inventory/bank - ITEM_LIMIT_CATEGORY_MODE_EQUIP = 1, // limit applied to amount equipped items (including used gems) + ITEM_LIMIT_CATEGORY_MODE_HAVE = 0, // limit applied to amount items in inventory/bank + ITEM_LIMIT_CATEGORY_MODE_EQUIP = 1, // limit applied to amount equipped items (including used gems) }; enum TotemCategoryType { - TOTEM_CATEGORY_TYPE_KNIFE = 1, - TOTEM_CATEGORY_TYPE_TOTEM = 2, - TOTEM_CATEGORY_TYPE_ROD = 3, - TOTEM_CATEGORY_TYPE_PICK = 21, - TOTEM_CATEGORY_TYPE_STONE = 22, - TOTEM_CATEGORY_TYPE_HAMMER = 23, - TOTEM_CATEGORY_TYPE_SPANNER = 24 + TOTEM_CATEGORY_TYPE_KNIFE = 1, + TOTEM_CATEGORY_TYPE_TOTEM = 2, + TOTEM_CATEGORY_TYPE_ROD = 3, + TOTEM_CATEGORY_TYPE_PICK = 21, + TOTEM_CATEGORY_TYPE_STONE = 22, + TOTEM_CATEGORY_TYPE_HAMMER = 23, + TOTEM_CATEGORY_TYPE_SPANNER = 24 }; // SummonProperties.dbc, col 1 @@ -437,7 +437,8 @@ enum SummonPropType SUMMON_PROP_TYPE_SIEGE_VEH = 9, // summon different vehicles, 14 spells in 3.0.3 SUMMON_PROP_TYPE_DRAKE_VEH = 10, // summon drake (vehicle), 3 spells SUMMON_PROP_TYPE_LIGHTWELL = 11, // summon lightwell, 6 spells in 3.0.3 - SUMMON_PROP_TYPE_JEEVES = 12 // summon Jeeves, 1 spell in 3.3.5a + SUMMON_PROP_TYPE_JEEVES = 12, // summon Jeeves, 1 spell in 3.3.5a + SUMMON_PROP_TYPE_LASHTAIL = 13, // Lashtail Hatchling, 1 spell in 4.2.2 }; // SummonProperties.dbc, col 5 @@ -460,6 +461,11 @@ enum SummonPropFlags SUMMON_PROP_FLAG_UNK14 = 0x00002000, // Guides, player follows SUMMON_PROP_FLAG_UNK15 = 0x00004000, // Force of Nature, Shadowfiend, Feral Spirit, Summon Water Elemental SUMMON_PROP_FLAG_UNK16 = 0x00008000, // Light/Dark Bullet, Soul/Fiery Consumption, Twisted Visage, Twilight Whelp. Phase related? + SUMMON_PROP_FLAG_UNK17 = 0x00010000, + SUMMON_PROP_FLAG_UNK18 = 0x00020000, + SUMMON_PROP_FLAG_UNK19 = 0x00040000, + SUMMON_PROP_FLAG_UNK20 = 0x00080000, + SUMMON_PROP_FLAG_UNK21 = 0x00100000, // Totems }; enum VehicleSeatFlags @@ -487,7 +493,7 @@ enum VehicleSeatFlagsB VEHICLE_SEAT_FLAG_B_VEHICLE_PLAYERFRAME_UI = 0x80000000, // Lua_UnitHasVehiclePlayerFrameUI - actually checked for flagsb &~ 0x80000000 }; -// CreatureType.dbc +// CurrencyTypes.dbc enum CurrencyTypes { CURRENCY_TYPE_CONQUEST_POINTS = 390, diff --git a/src/server/game/Entities/Vehicle/VehicleDefines.h b/src/server/game/Entities/Vehicle/VehicleDefines.h index 4d46ce956de..49194489d03 100644 --- a/src/server/game/Entities/Vehicle/VehicleDefines.h +++ b/src/server/game/Entities/Vehicle/VehicleDefines.h @@ -32,7 +32,29 @@ enum PowerType POWER_HEAT = 101, POWER_OOZE = 121, POWER_BLOOD = 141, - POWER_WRATH = 142 + POWER_WRATH = 142, + POWER_ARCANE_ENERGY = 143, + POWER_LIFE_ENERGY = 144, + POWER_SUN_ENERGY = 145, + POWER_SWING_VELOCITY = 146, + POWER_SHADOWFLAME_ENERGY = 147, + POWER_BLUE_POWER = 148, + POWER_PURPLE_POWER = 149, + POWER_GREEN_POWER = 150, + POWER_ORANGE_POWER = 151, + POWER_ENERGY = 153, + POWER_ARCANEENERGY = 161, + POWER_WIND_POWER_1 = 162, + POWER_WIND_POWER_2 = 163, + POWER_WIND_POWER_3 = 164, + POWER_FUEL = 165, + POWER_SUN_POWER = 166, + POWER_TWILIGHT_ENERGY = 169, + POWER_VENOM = 174, + POWER_ORANGE_POWER_2 = 176, + POWER_CONSUMING_FLAME = 177, + POWER_PYROCLASTIC_FRENZY = 178, + POWER_FLASHFIRE = 179, }; enum VehicleFlags diff --git a/src/server/game/Groups/Group.h b/src/server/game/Groups/Group.h index c51aa6dd7bf..5d41934f0e0 100755 --- a/src/server/game/Groups/Group.h +++ b/src/server/game/Groups/Group.h @@ -113,7 +113,9 @@ enum GroupUpdateFlags GROUP_UPDATE_FLAG_PET_CUR_POWER = 0x00010000, // uint16 pet cur power GROUP_UPDATE_FLAG_PET_MAX_POWER = 0x00020000, // uint16 pet max power GROUP_UPDATE_FLAG_PET_AURAS = 0x00040000, // uint64 mask, for each bit set uint32 spellid + uint8 unk, pet auras... - GROUP_UPDATE_FLAG_VEHICLE_SEAT = 0x00080000, // uint32 vehicle_seat_id (index from VehicleSeat.dbc) + GROUP_UPDATE_FLAG_VEHICLE_SEAT = 0x00080000, // uint8, uint64, if (uint32 != 0) { uint32, if (uint16 & 0x40) { uint32, uint32, uint32 } } + GROUP_UPDATE_FLAG_UNKNOWN_1 = 0x00100000, // uint32 + GROUP_UPDATE_FLAG_UNKNOWN_2 = 0x00200000, // uint32, uint32, string GROUP_UPDATE_PET = 0x0007FC00, // all pet flags GROUP_UPDATE_FULL = 0x0007FFFF, // all known flags }; -- cgit v1.2.3 From d70b94848fef12aebeb6acf27898b8c20d7a52f2 Mon Sep 17 00:00:00 2001 From: weclub Date: Wed, 21 Dec 2011 02:53:13 +0100 Subject: Core/Protocol: Added a few opcodes --- src/server/game/Server/Protocol/Opcodes.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 16bbbbe7401..52373b10e0d 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -436,7 +436,7 @@ enum Opcodes CMSG_UNREGISTER_ALL_ADDON_PREFIXES = 0x00, CMSG_UNUSED2 = 0x00, CMSG_UPDATE_ACCOUNT_DATA = 0x4AFE, - CMSG_USE_ITEM = 0x00, + CMSG_USE_ITEM = 0xD8EA, CMSG_VOICE_SESSION_ENABLE = 0x00, CMSG_VIOLENCE_LEVEL = 0x00, CMSG_WARDEN_DATA = 0x5847, @@ -612,9 +612,9 @@ enum Opcodes SMSG_CHAR_DELETE = 0x48CE, SMSG_CHAR_ENUM = 0xA05C, SMSG_CHARACTER_LOGIN_FAILED = 0x00, - SMSG_CHAR_RENAME = 0x00, - SMSG_CHAR_CUSTOMIZE = 0x00, - SMSG_CHAR_FACTION_CHANGE = 0x00, + SMSG_CHAR_RENAME = 0x5EF6, + SMSG_CHAR_CUSTOMIZE = 0x0AE3, + SMSG_CHAR_FACTION_CHANGE = 0x885A, SMSG_CHAT_PLAYER_AMBIGUOUS = 0x00, SMSG_CHAT_PLAYER_NOT_FOUND = 0x00, SMSG_CHAT_RESTRICTED = 0x00, @@ -941,7 +941,7 @@ enum Opcodes SMSG_SET_FORCED_REACTIONS = 0x00, SMSG_SET_PCT_SPELL_MODIFIER = 0x00, SMSG_SET_PHASE_SHIFT = 0x204C, - SMSG_SET_PLAYER_DECLINED_NAMES_RESULT = 0x00, + SMSG_SET_PLAYER_DECLINED_NAMES_RESULT = 0x0E67, SMSG_SET_PROFICIENCY = 0x00, SMSG_SET_PROJECTILE_POSITION = 0x00, SMSG_SHOWTAXINODES = 0x8CFB, @@ -1008,9 +1008,9 @@ enum Opcodes SMSG_UPDATE_LFG_LIST = 0x00, SMSG_UPDATE_OBJECT = 0x1EE7, SMSG_UPDATE_WORLD_STATE = 0x00, - SMSG_USERLIST_ADD = 0x00, - SMSG_USERLIST_REMOVE = 0x00, - SMSG_USERLIST_UPDATE = 0x00, + SMSG_USERLIST_ADD = 0x4CEE, + SMSG_USERLIST_REMOVE = 0x9A6B, + SMSG_USERLIST_UPDATE = 0x4A4B, SMSG_VOICE_CHAT_STATUS = 0x00, SMSG_VOICE_PARENTAL_CONTROLS = 0x00, SMSG_VOICE_SESSION_LEAVE = 0x00, -- cgit v1.2.3 From 4ef82117d13b139141951e0847184dca99ce1099 Mon Sep 17 00:00:00 2001 From: kaelima Date: Wed, 21 Dec 2011 03:25:24 +0100 Subject: Server/Protocol: - Added a bunch of opcodes (from wpp, ty Nay and Spp) - Accepted handler for some confirmed structures - Some updates in SMSG_UPDATE_OBJECT (although useless without splines) --- src/server/game/Entities/Object/Object.cpp | 31 ++++++-------- .../game/Server/Protocol/Handlers/PetHandler.cpp | 5 +++ src/server/game/Server/Protocol/Opcodes.cpp | 30 ++++++------- src/server/game/Server/Protocol/Opcodes.h | 49 +++++++++++----------- 4 files changed, 58 insertions(+), 57 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index c5db71784c2..2820755f00c 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -296,7 +296,7 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint16 flags) const // 0x20 if (flags & UPDATEFLAG_LIVING) { - const Unit* self = ToUnit(); + Unit const* self = ToUnit(); self->BuildMovementPacket(data); *data << self->GetSpeed(MOVE_WALK); @@ -309,36 +309,31 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint16 flags) const *data << self->GetSpeed(MOVE_TURN_RATE); *data << self->GetSpeed(MOVE_PITCH_RATE); - const Player* player = ToPlayer(); + Player const* player = ToPlayer(); // 0x08000000 if (player && player->isInFlight()) { uint32 flags3 = SPLINEFLAG_GLIDE; - *data << uint32(flags3); // splines flag? + *data << uint32(flags3); // splines flag - if (flags3 & 0x20000) // may be orientation + if (flags3 & 0x00004000) // FinalOrientation { *data << (float)0; } - else + else if (flags3 & 0x00001000) // FinalOrientation { - if (flags3 & 0x8000) // probably x, y, z coords there - { - *data << (float)0; - *data << (float)0; - *data << (float)0; - } - - if (flags3 & 0x10000) // probably guid there - { - *data << uint64(0); - } + *data << (float)0; + *data << (float)0; + *data << (float)0; + } + else if (flags3 & 0x00002000) // FinalTarget + { + *data << uint64(0); } - FlightPathMovementGenerator *fmg = - (FlightPathMovementGenerator*)(player->GetMotionMaster()->top()); + FlightPathMovementGenerator *fmg = (FlightPathMovementGenerator*)(player->GetMotionMaster()->top()); TaxiPathNodeList const& path = fmg->GetPath(); float x, y, z; diff --git a/src/server/game/Server/Protocol/Handlers/PetHandler.cpp b/src/server/game/Server/Protocol/Handlers/PetHandler.cpp index 2a94f15ff2e..81bd1382d5e 100755 --- a/src/server/game/Server/Protocol/Handlers/PetHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/PetHandler.cpp @@ -60,9 +60,14 @@ void WorldSession::HandlePetAction(WorldPacket & recv_data) uint64 guid1; uint32 data; uint64 guid2; + float x, y, z; recv_data >> guid1; //pet guid recv_data >> data; recv_data >> guid2; //tag guid + // Position + recv_data >> x; + recv_data >> y; + recv_data >> z; uint32 spellid = UNIT_ACTION_BUTTON_ACTION(data); uint8 flag = UNIT_ACTION_BUTTON_TYPE(data); //delete = 0x07 CastSpell = C1 diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index d5923b26116..30ccdbf780f 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -374,15 +374,15 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(MSG_CHANNEL_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_CHANNEL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_CANCEL_CHANNELLING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelChanneling ); - //DEFINE_OPCODE_HANDLER(SMSG_AI_REACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_AI_REACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_SET_SELECTION, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleSetSelectionOpcode ); DEFINE_OPCODE_HANDLER(CMSG_EQUIPMENT_SET_DELETE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetDelete ); //DEFINE_OPCODE_HANDLER(CMSG_INSTANCE_LOCK_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInstanceLockResponse ); //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_PASSIVE_AURA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_ATTACKSWING, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleAttackSwingOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_ATTACKSTOP, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleAttackStopOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_ATTACKSTART, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ATTACKSTOP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(CMSG_ATTACKSTOP, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleAttackStopOpcode ); + DEFINE_OPCODE_HANDLER(SMSG_ATTACKSTART, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ATTACKSTOP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ATTACKSWING_NOTINRANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ATTACKSWING_BADFACING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_LOCK_WARNING_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -394,8 +394,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_RESUME_CAST_BAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CANCEL_COMBAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELLBREAKLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELLHEALLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELLENERGIZELOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELLHEALLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELLENERGIZELOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_BREAK_TARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SAVE_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SETDEATHBINDPOINT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -431,7 +431,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_MOUNTSPECIAL_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_TAME_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_PET_SET_ACTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetSetAction ); - //DEFINE_OPCODE_HANDLER(CMSG_PET_ACTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetAction ); + DEFINE_OPCODE_HANDLER(CMSG_PET_ACTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetAction ); //DEFINE_OPCODE_HANDLER(CMSG_PET_ABANDON, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetAbandon ); //DEFINE_OPCODE_HANDLER(CMSG_PET_RENAME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetRename ); //DEFINE_OPCODE_HANDLER(SMSG_PET_NAME_INVALID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -555,7 +555,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_AUTH_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(MSG_GM_SHOWLABEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_PET_CAST_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetCastSpellOpcode ); - //DEFINE_OPCODE_HANDLER(MSG_SAVE_GUILD_EMBLEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSaveGuildEmblemOpcode ); + DEFINE_OPCODE_HANDLER(MSG_SAVE_GUILD_EMBLEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSaveGuildEmblemOpcode ); //DEFINE_OPCODE_HANDLER(MSG_TABARDVENDOR_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTabardVendorActivateOpcode); //DEFINE_OPCODE_HANDLER(SMSG_PLAY_SPELL_VISUAL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_ZONEUPDATE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleZoneUpdateOpcode ); @@ -590,8 +590,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_GETTICKET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketGetTicketOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_GETTICKET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_TALENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - ////DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_SPAWN_ANIM_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_DESPAWN_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_SPAWN_ANIM_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_DESPAWN_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(MSG_CORPSE_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCorpseQueryOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_DELETETICKET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketDeleteOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_DELETETICKET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -645,15 +645,15 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_MAIL_RETURN_TO_SENDER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailReturnToSender ); //DEFINE_OPCODE_HANDLER(CMSG_MAIL_DELETE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailDelete ); //DEFINE_OPCODE_HANDLER(CMSG_MAIL_CREATE_TEXT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailCreateTextItem ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELLLOGMISS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELLLOGEXECUTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELLLOGMISS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELLLOGEXECUTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DEBUGAURAPROC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PERIODICAURALOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELLDAMAGESHIELD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELLNONMELEEDAMAGELOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELLNONMELEEDAMAGELOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_LEARN_TALENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnTalentOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_RESURRECT_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_TOGGLE_PVP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTogglePvP ); + DEFINE_OPCODE_HANDLER(CMSG_TOGGLE_PVP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTogglePvP ); DEFINE_OPCODE_HANDLER(SMSG_ZONE_UNDER_ATTACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(MSG_AUCTION_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionHelloOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_SELL_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionSellItem ); @@ -1120,7 +1120,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_UNSET_FLYING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SUMMON_CANCEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_CHANGE_PERSONAL_ARENA_RATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_ALTER_APPEARANCE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAlterAppearance ); + DEFINE_OPCODE_HANDLER(CMSG_ALTER_APPEARANCE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAlterAppearance ); //DEFINE_OPCODE_HANDLER(SMSG_ENABLE_BARBER_SHOP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BARBER_SHOP_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_GET_CALENDAR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGetCalendar ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 52373b10e0d..95711f13c59 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -34,15 +34,15 @@ enum Opcodes CMSG_ACCEPT_LEVEL_GRANT = 0xDC4B, CMSG_ACCEPT_TRADE = 0x00, - CMSG_ACTIVATETAXI = 0x00, - CMSG_ACTIVATETAXIEXPRESS = 0x00, + CMSG_ACTIVATETAXI = 0x8CDB, + CMSG_ACTIVATETAXIEXPRESS = 0x5E7F, CMSG_ADD_FRIEND = 0x5C57, CMSG_ADD_IGNORE = 0xCEEA, CMSG_ADD_VOICE_IGNORE = 0xA7A, - CMSG_ALTER_APPEARANCE = 0x00, + CMSG_ALTER_APPEARANCE = 0x5CE3, CMSG_AREATRIGGER = 0x5862, CMSG_AREA_SPIRIT_HEALER_QUERY = 0xDC7E, - CMSG_AREA_SPIRIT_HEALER_QUEUE = 0x00, + CMSG_AREA_SPIRIT_HEALER_QUEUE = 0x8846, CMSG_ARENA_TEAM_ACCEPT = 0x00, CMSG_ARENA_TEAM_DECLINE = 0x00, CMSG_ARENA_TEAM_DISBAND = 0x4A5A, @@ -51,10 +51,10 @@ enum Opcodes CMSG_ARENA_TEAM_LEAVE = 0x48EB, CMSG_ARENA_TEAM_QUERY = 0x872, CMSG_ARENA_TEAM_REMOVE = 0xCE5E, - CMSG_ARENA_TEAM_ROSTER = 0x00, - CMSG_ATTACKSTOP = 0x00, + CMSG_ARENA_TEAM_ROSTER = 0x0A42, + CMSG_ATTACKSTOP = 0x5AC3, CMSG_ATTACKSWING = 0xDE66, - CMSG_AUCTION_LIST_BIDDER_ITEMS = 0x00, + CMSG_AUCTION_LIST_BIDDER_ITEMS = 0x187A, CMSG_AUCTION_LIST_ITEMS = 0xDC5F, CMSG_AUCTION_LIST_OWNER_ITEMS = 0x00, CMSG_AUCTION_PLACE_BID = 0x8E76, @@ -66,9 +66,10 @@ enum Opcodes CMSG_AUTOEQUIP_ITEM_SLOT = 0x00, CMSG_AUTO_DECLINE_GUILD_INVITES = 0x586F, CMSG_BATTLEFIELD_LIST = 0x32A4, // New 4.x - CMSG_AUTOSTORE_BAG_ITEM = 0x00, + CMSG_AUTOSTORE_BAG_ITEM = 0x0EEE, + CMSG_AUTOSTORE_BANK_ITEM = 0x1C5F, CMSG_AUTOSTORE_GROUND_ITEM = 0x00, - CMSG_AUTOSTORE_LOOT_ITEM = 0x00, + CMSG_AUTOSTORE_LOOT_ITEM = 0xD876, CMSG_BANKER_ACTIVATE = 0x00, CMSG_BATTLEFIELD_JOIN = 0x00, CMSG_BATTLEFIELD_REQUEST_SCORE_DATA = 0x00, @@ -259,7 +260,7 @@ enum Opcodes CMSG_LOG_DISCONNECT = 0x00, CMSG_LOGOUT_CANCEL = 0xA76, CMSG_LOGOUT_REQUEST = 0x4C7A, - CMSG_LOOT = 0x0A5E, + CMSG_LOOT = 0x1E62, CMSG_LOOT_METHOD = 0x00, CMSG_LOOT_MONEY = 0x00, CMSG_LOOT_RELEASE = 0x4A6A, @@ -405,7 +406,7 @@ enum Opcodes CMSG_SOCKET_GEMS = 0x00, CMSG_SPIRIT_HEALER_ACTIVATE = 0x5AEB, CMSG_SPELLCLICK = 0xC8F2, - CMSG_SPLIT_ITEM = 0x00, + CMSG_SPLIT_ITEM = 0xDCFA, CMSG_STANDSTATECHANGE = 0x9EC6, CMSG_START_QUEST = 0x00, CMSG_STOP_DANCE = 0x00, @@ -528,7 +529,7 @@ enum Opcodes MSG_RAID_READY_CHECK_FINISHED = 0x00, MSG_RAID_TARGET_UPDATE = 0x00, MSG_RANDOM_ROLL = 0x4C57, - MSG_SAVE_GUILD_EMBLEM = 0x00, + MSG_SAVE_GUILD_EMBLEM = 0x4EE3, MSG_SET_DUNGEON_DIFFICULTY = 0xC4F, MSG_SET_RAID_DIFFICULTY = 0x1A5A, MSG_TABARDVENDOR_ACTIVATE = 0x98EB, @@ -541,10 +542,10 @@ enum Opcodes SMSG_ACTIVATETAXIREPLY = 0x8E4F, SMSG_ADDON_INFO = 0x9863, SMSG_ADD_RUNE_POWER = 0x00, - SMSG_AI_REACTION = 0x00, + SMSG_AI_REACTION = 0xCEC2, SMSG_ALL_ACHIEVEMENT_DATA = 0x00, SMSG_AREA_SPIRIT_HEALER_TIME = 0x00, - SMSG_AREA_TRIGGER_MESSAGE = 0x00, + SMSG_AREA_TRIGGER_MESSAGE = 0xCC42, SMSG_ARENA_ERROR = 0x00, SMSG_ARENA_OPPONENT_UPDATE = 0x00, SMSG_ARENA_TEAM_CHANGE_FAILED_QUEUED = 0x4A4E, @@ -555,8 +556,8 @@ enum Opcodes SMSG_ARENA_TEAM_ROSTER = 0x00, SMSG_ARENA_TEAM_STATS = 0x00, SMSG_ATTACKERSTATEUPDATE = 0x00, - SMSG_ATTACKSTART = 0x00, - SMSG_ATTACKSTOP = 0x00, + SMSG_ATTACKSTART = 0xCA4A, + SMSG_ATTACKSTOP = 0xCED7, SMSG_ATTACKSWING_BADFACING = 0x00, SMSG_ATTACKSWING_CANT_ATTACK = 0x00, SMSG_ATTACKSWING_DEADTARGET = 0x00, @@ -602,7 +603,7 @@ enum Opcodes SMSG_CALENDAR_COMMAND_RESULT = 0x00, SMSG_CALENDAR_SEND_NUM_PENDING = 0x00, SMSG_CALENDAR_SEND_CALENDAR = 0x00, - SMSG_CANCEL_AUTO_REPEAT = 0x00, + SMSG_CANCEL_AUTO_REPEAT = 0x5ACB, SMSG_CANCEL_COMBAT = 0x00, SMSG_CAST_FAILED = 0x00, SMSG_CHANNEL_LIST = 0x00, @@ -631,7 +632,7 @@ enum Opcodes SMSG_COMPLAIN_RESULT = 0x00, SMSG_COMPRESSED_CHAR_ENUM = 0x380A, // New 4.x SMSG_COMPRESSED_GUILD_ROSTER = 0x5A29, // New 4.x - SMSG_COMPRESSED_MOVES = 0x00, + SMSG_COMPRESSED_MOVES = 0x0862, SMSG_COMPRESSED_UPDATE_OBJECT = 0x1CC3, SMSG_CONTACT_LIST = 0x0A6B, SMSG_CONVERT_RUNE = 0x00, @@ -692,7 +693,7 @@ enum Opcodes SMSG_FORCE_WALK_SPEED_CHANGE = 0x00, SMSG_FRIEND_STATUS = 0x00, SMSG_GAMEOBJECT_CUSTOM_ANIM = 0x00, - SMSG_GAMEOBJECT_DESPAWN_ANIM = 0x00, + SMSG_GAMEOBJECT_DESPAWN_ANIM = 0x0A5E, SMSG_GAMEOBJECT_PAGETEXT = 0x00, SMSG_GAMEOBJECT_QUERY_RESPONSE = 0xCCF7, SMSG_GAMEOBJECT_RESET_STATE = 0x00, @@ -948,12 +949,12 @@ enum Opcodes SMSG_SHOW_BANK = 0x00, SMSG_SPELLBREAKLOG = 0x00, SMSG_SPELLDAMAGESHIELD = 0x00, - SMSG_SPELLENERGIZELOG = 0x00, - SMSG_SPELLHEALLOG = 0x00, + SMSG_SPELLENERGIZELOG = 0xD8FB, + SMSG_SPELLHEALLOG = 0xDE4A, SMSG_SPELLINSTAKILLLOG = 0x00, - SMSG_SPELLLOGEXECUTE = 0x00, - SMSG_SPELLLOGMISS = 0x00, - SMSG_SPELLNONMELEEDAMAGELOG = 0x00, + SMSG_SPELLLOGEXECUTE = 0x8AD7, + SMSG_SPELLLOGMISS = 0x1CFF, + SMSG_SPELLNONMELEEDAMAGELOG = 0x5CCF, SMSG_SPELLORDAMAGE_IMMUNE = 0x00, SMSG_SPELL_COOLDOWN = 0x00, SMSG_SPELL_DELAYED = 0x00, -- cgit v1.2.3 From 6b25c2c6299bf7c959365ed6ef144ca049ad40ab Mon Sep 17 00:00:00 2001 From: kaelima Date: Wed, 21 Dec 2011 03:29:25 +0100 Subject: Core/Spells: Added more cases for SMSG_CAST_FAILED. Thanks Tomrus and Spp --- src/server/game/Spells/Spell.cpp | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 1a93e5fcc4b..7ac3e04bc3b 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3666,10 +3666,13 @@ void Spell::SendCastResult(Player* caster, SpellInfo const* spellInfo, uint8 cas data << uint8(result); // problem switch (result) { + case SPELL_FAILED_NOT_READY: + data << uint32(0); // unknown (value 1 update cooldowns on client flag) + break; case SPELL_FAILED_REQUIRES_SPELL_FOCUS: - data << uint32(spellInfo->RequiresSpellFocus); + data << uint32(spellInfo->RequiresSpellFocus); // SpellFocusObject.dbc id break; - case SPELL_FAILED_REQUIRES_AREA: + case SPELL_FAILED_REQUIRES_AREA: // AreaTable.dbc id // hardcode areas limitation case switch (spellInfo->Id) { @@ -3702,14 +3705,15 @@ void Spell::SendCastResult(Player* caster, SpellInfo const* spellInfo, uint8 cas data << uint32(spellInfo->TotemCategory[1]); break; case SPELL_FAILED_EQUIPPED_ITEM_CLASS: + case SPELL_FAILED_EQUIPPED_ITEM_CLASS_MAINHAND: + case SPELL_FAILED_EQUIPPED_ITEM_CLASS_OFFHAND: data << uint32(spellInfo->EquippedItemClass); data << uint32(spellInfo->EquippedItemSubClassMask); - //data << uint32(spellInfo->EquippedItemInventoryTypeMask); break; case SPELL_FAILED_TOO_MANY_OF_ITEM: { uint32 item = 0; - for (int8 x = 0;x < 3; x++) + for (int8 x = 0; x < 3; x++) if (spellInfo->Effects[x].ItemType) item = spellInfo->Effects[x].ItemType; ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(item); @@ -3717,9 +3721,32 @@ void Spell::SendCastResult(Player* caster, SpellInfo const* spellInfo, uint8 cas data << uint32(pProto->ItemLimitCategory); break; } + case SPELL_FAILED_PREVENTED_BY_MECHANIC: + data << uint32(spellInfo->GetAllEffectsMechanicMask()); // SpellMechanic.dbc id + break; + case SPELL_FAILED_NEED_EXOTIC_AMMO: + data << uint32(spellInfo->EquippedItemSubClassMask); // seems correct... + break; + case SPELL_FAILED_REAGENTS: + data << uint32(0); // Item id + break; + case SPELL_FAILED_NEED_MORE_ITEMS: + data << uint32(0); // Item id + data << uint32(0); // Item count? + break; + case SPELL_FAILED_MIN_SKILL: + data << uint32(0); // SkillLine.dbc id + data << uint32(0); // required skill value + break; + case SPELL_FAILED_FISHING_TOO_LOW: + data << uint32(0); // required fishing skill + break; case SPELL_FAILED_CUSTOM_ERROR: data << uint32(customError); break; + case SPELL_FAILED_SILENCED: + data << uint32(0); // Unknown + break; default: break; } -- cgit v1.2.3 From e285fcffac054b8eed5cb394fe2fa8bd21f55622 Mon Sep 17 00:00:00 2001 From: kaelima Date: Wed, 21 Dec 2011 03:45:58 +0100 Subject: Fix compile --- src/server/game/Entities/Vehicle/VehicleDefines.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Entities/Vehicle/VehicleDefines.h b/src/server/game/Entities/Vehicle/VehicleDefines.h index 49194489d03..abe7ea49d3f 100644 --- a/src/server/game/Entities/Vehicle/VehicleDefines.h +++ b/src/server/game/Entities/Vehicle/VehicleDefines.h @@ -42,7 +42,7 @@ enum PowerType POWER_PURPLE_POWER = 149, POWER_GREEN_POWER = 150, POWER_ORANGE_POWER = 151, - POWER_ENERGY = 153, + POWER_ENERGY_2 = 153, POWER_ARCANEENERGY = 161, POWER_WIND_POWER_1 = 162, POWER_WIND_POWER_2 = 163, -- cgit v1.2.3 From e16ac6f1e5bc9e016ed853267a6411785eb71a0b Mon Sep 17 00:00:00 2001 From: Nay Date: Wed, 21 Dec 2011 14:29:57 +0000 Subject: Core/Protocol: More opcodes by Spp and weclub --- src/server/game/Server/Protocol/Opcodes.h | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 95711f13c59..3090c7a3840 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -208,7 +208,7 @@ enum Opcodes CMSG_GUILD_ACCEPT = 0x00, CMSG_GUILD_BANKER_ACTIVATE = 0x4E77, CMSG_GUILD_BANK_BUY_TAB = 0x00, - CMSG_GUILD_BANK_DEPOSIT_MONEY = 0x00, + CMSG_GUILD_BANK_DEPOSIT_MONEY = 0x4847, CMSG_GUILD_BANK_NOTE = 0x00, CMSG_GUILD_BANK_QUERY_TAB = 0xDE46, CMSG_GUILD_BANK_SWAP_ITEMS = 0x85B, @@ -222,7 +222,7 @@ enum Opcodes CMSG_GUILD_INVITE = 0x8C67, CMSG_GUILD_PROMOTE = 0x00, CMSG_GUILD_QUERY = 0x8E57, - CMSG_GUILD_LEADER = 0x00, + CMSG_GUILD_LEADER = 0x28C4, CMSG_GUILD_LEAVE = 0x00, CMSG_GUILD_MOTD = 0x00, CMSG_GUILD_RANK = 0x8D50, // New 4.x @@ -247,7 +247,8 @@ enum Opcodes CMSG_LEARN_TALENT = 0x98F3, CMSG_LEAVE_BATTLEFIELD = 0x1AE7, CMSG_LEAVE_CHANNEL = 0x00, - CMSG_LFD_PARTY_LOCK_INFO_REQUEST = 0x00, + CMSG_LFG_LFR_JOIN = 0x8CFA, + CMSG_LFG_PARTY_LOCK_INFO_REQUEST = 0xC867, CMSG_LFG_GET_PLAYER_INFO = 0x00, CMSG_LFG_JOIN = 0x00, CMSG_LFG_LEAVE = 0x00, @@ -275,8 +276,11 @@ enum Opcodes CMSG_MESSAGECHAT_AFK = 0x00, CMSG_MESSAGECHAT_BATTLEGROUND = 0x00, CMSG_MESSAGECHAT_BATTLEGROUND_LEADER = 0x00, - //CMSG_MESSAGECHAT_ADDON_GUILD = 0x24D9, // Not confirmed, new on 4.x - //CMSG_MESSAGECHAT_ADDON_WHISPER = 0x20C1, // Not confirmed, new on 4.x + CMSG_MESSAGECHAT_ADDON_BATTLEGROUND = 0x6059, // New on 4.x + CMSG_MESSAGECHAT_ADDON_GUILD = 0x24D9, // New on 4.x + CMSG_MESSAGECHAT_ADDON_PARTY = 0x6041, // New on 4.x + CMSG_MESSAGECHAT_ADDON_RAID = 0x3041, // New on 4.x + CMSG_MESSAGECHAT_ADDON_WHISPER = 0x20C1, // New on 4.x CMSG_MESSAGECHAT_CHANNEL = 0x7459, CMSG_MESSAGECHAT_DND = 0x00, CMSG_MESSAGECHAT_EMOTE = 0x6449, @@ -655,7 +659,7 @@ enum Opcodes SMSG_DESTRUCTIBLE_BUILDING_DAMAGE = 0x00, SMSG_DUEL_OUTOFBOUNDS = 0x00, SMSG_DUEL_INBOUNDS = 0x00, - SMSG_DISMOUNT = 0x00, + SMSG_DISMOUNT = 0xCEE7, SMSG_DISMOUNTRESULT = 0x00, SMSG_DISPEL_FAILED = 0x00, SMSG_DUEL_COMPLETE = 0x00, @@ -720,6 +724,7 @@ enum Opcodes SMSG_GROUP_LIST = 0x00, SMSG_GROUP_SET_LEADER = 0x00, SMSG_GROUP_UNINVITE = 0x00, + SMSG_GUILDFINDER_SEARCH_RESULT = 0xE0CE, // New 4.x SMSG_GUILD_BANK_LIST = 0x5EFB, SMSG_GUILD_COMMAND_RESULT = 0xDAD7, SMSG_GUILD_DECLINE = 0x00, @@ -783,7 +788,6 @@ enum Opcodes SMSG_LFG_UPDATE_SEARCH = 0x00, SMSG_LFG_UPDATE_PARTY = 0x00, SMSG_LFG_UPDATE_PLAYER = 0x00, - SMSG_LFGUILD_RECRUIT_DATA = 0xE0CE, // New 4.x SMSG_LIST_INVENTORY = 0x264C, SMSG_LOGIN_SETTIMESPEED = 0x00, SMSG_LOGIN_VERIFY_WORLD = 0xC86E, @@ -794,7 +798,7 @@ enum Opcodes SMSG_LOOT_ALL_PASSED = 0x00, SMSG_LOOT_CLEAR_MONEY = 0x00, SMSG_LOOT_ITEM_NOTIFY = 0x00, - SMSG_LOOT_LIST = 0x00, + SMSG_LOOT_LIST = 0x8C5B, SMSG_LOOT_MASTER_LIST = 0x00, SMSG_LOOT_MONEY_NOTIFY = 0x00, SMSG_LOOT_RELEASE_RESPONSE = 0x00, @@ -933,7 +937,7 @@ enum Opcodes SMSG_SEND_MAIL_RESULT = 0x00, SMSG_SEND_UNLEARN_SPELLS = 0x00, SMSG_SERVERTIME = 0x00, - SMSG_SERVER_FIRST_ACHIEVEMENT = 0x00, + SMSG_SERVER_FIRST_ACHIEVEMENT = 0x0CDF, SMSG_SERVER_MESSAGE = 0xC873, SMSG_SET_FACTION_ATWAR = 0x00, SMSG_SET_FACTION_STANDING = 0x00, -- cgit v1.2.3 From 7cc49aa0ab4b86260b0844b924f787ac63783c6e Mon Sep 17 00:00:00 2001 From: Nay Date: Wed, 21 Dec 2011 15:58:41 +0000 Subject: Core/Chat: Implement CMSG_MESSAGECHAT_ADDON_X depending on type Ref http://www.wowwiki.com/API_SendAddonMessage --- .../game/Server/Protocol/Handlers/ChatHandler.cpp | 138 ++++++++++++++++++--- src/server/game/Server/Protocol/Opcodes.cpp | 6 +- src/server/game/Server/WorldSession.h | 1 + 3 files changed, 127 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp b/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp index 3c8b1d8e033..ee2e5ef9e0f 100755 --- a/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp @@ -63,12 +63,12 @@ bool WorldSession::processChatmessageFurtherAfterSecurityChecks(std::string& msg return true; } -void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) +void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) { uint32 type = 0; uint32 lang; - switch(recv_data.GetOpcode()) + switch(recvData.GetOpcode()) { case CMSG_MESSAGECHAT_SAY: type = CHAT_MSG_SAY; @@ -119,17 +119,17 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) // type = CHAT_MSG_RAID_WARNING; // break; default: - sLog->outDetail("HandleMessagechatOpcode : Unknown chat opcode (%u)", recv_data.GetOpcode()); - recv_data.hexlike(); + sLog->outDetail("HandleMessagechatOpcode : Unknown chat opcode (%u)", recvData.GetOpcode()); + recvData.hexlike(); return; } - recv_data >> lang; + recvData >> lang; if (type >= MAX_CHAT_MSG_TYPE) { sLog->outError("CHAT: Wrong message type received: %u", type); - recv_data.rfinish(); + recvData.rfinish(); return; } @@ -142,7 +142,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) if (!langDesc) { SendNotification(LANG_UNKNOWN_LANGUAGE); - recv_data.rfinish(); + recvData.rfinish(); return; } if (langDesc->skill_id != 0 && !sender->HasSkill(langDesc->skill_id)) @@ -161,7 +161,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) if (!foundAura) { SendNotification(LANG_NOT_LEARNED_LANGUAGE); - recv_data.rfinish(); + recvData.rfinish(); return; } } @@ -171,7 +171,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) if (sWorld->getBoolConfig(CONFIG_CHATLOG_ADDON)) { std::string msg = ""; - recv_data >> msg; + recvData >> msg; if (msg.empty()) return; @@ -226,7 +226,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) { std::string timeStr = secsToTimeString(m_muteTime - time(NULL)); SendNotification(GetTrinityString(LANG_WAIT_BEFORE_SPEAKING), timeStr.c_str()); - recv_data.rfinish(); // Prevent warnings + recvData.rfinish(); // Prevent warnings return; } @@ -237,7 +237,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) if (sender->HasAura(1852) && type != CHAT_MSG_WHISPER) { std::string msg=""; - recv_data >> msg; + recvData >> msg; SendNotification(GetTrinityString(LANG_GM_SILENCE), sender->GetName()); return; @@ -259,19 +259,19 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) case CHAT_MSG_RAID_WARNING: case CHAT_MSG_BATTLEGROUND: case CHAT_MSG_BATTLEGROUND_LEADER: - recv_data >> msg; + recvData >> msg; break; case CHAT_MSG_WHISPER: - recv_data >> to; - recv_data >> msg; + recvData >> to; + recvData >> msg; break; case CHAT_MSG_CHANNEL: - recv_data >> channel; - recv_data >> msg; + recvData >> channel; + recvData >> msg; break; case CHAT_MSG_AFK: case CHAT_MSG_DND: - recv_data >> msg; + recvData >> msg; ignoreChecks = true; break; } @@ -534,6 +534,110 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) } } +void WorldSession::HandleAddonMessagechatOpcode(WorldPacket& recvData) +{ + Player* sender = GetPlayer(); + ChatMsg type; + + switch (recvData.GetOpcode()) + { + case CMSG_MESSAGECHAT_ADDON_BATTLEGROUND: + type = CHAT_MSG_BATTLEGROUND; + break; + case CMSG_MESSAGECHAT_ADDON_GUILD: + type = CHAT_MSG_GUILD; + break; + case CMSG_MESSAGECHAT_ADDON_PARTY: + type = CHAT_MSG_PARTY; + break; + case CMSG_MESSAGECHAT_ADDON_RAID: + type = CHAT_MSG_RAID; + break; + case CMSG_MESSAGECHAT_ADDON_WHISPER: + type = CHAT_MSG_WHISPER; + break; + default: + sLog->outDetail("HandleAddonMessagechatOpcode: Unknown addon chat opcode (%u)", recvData.GetOpcode()); + recvData.hexlike(); + return; + } + + std::string message = ""; + std::string prefix = ""; + std::string targetName = ""; + + if (type == CHAT_MSG_WHISPER) + recvData >> prefix >> targetName >> message; + else + recvData >> message >> prefix; + + // Logging enabled? + if (sWorld->getBoolConfig(CONFIG_CHATLOG_ADDON)) + { + if (message.empty()) + return; + + // Weird way to log stuff... + sScriptMgr->OnPlayerChat(sender, CHAT_MSG_ADDON, LANG_ADDON, message); + } + + // Disabled addon channel? + if (!sWorld->getBoolConfig(CONFIG_ADDON_CHANNEL)) + return; + + switch (type) + { + case CHAT_MSG_BATTLEGROUND: + { + Group* group = sender->GetGroup(); + if (!group || !group->isBGGroup()) + return; + + WorldPacket data; + ChatHandler::FillMessageData(&data, this, type, LANG_ADDON, "", 0, message.c_str(), NULL); + group->BroadcastPacket(&data, false); + break; + } + case CHAT_MSG_GUILD: + { + if (sender->GetGuildId()) + if (Guild* guild = sGuildMgr->GetGuildById(sender->GetGuildId())) + guild->BroadcastToGuild(this, false, message, LANG_ADDON); + break; + } + case CHAT_MSG_WHISPER: + { + if (!normalizePlayerName(targetName)) + break; + Player* receiver = sObjectAccessor->FindPlayerByName(targetName.c_str()); + if (!receiver) + break; + + sender->Whisper(message, LANG_ADDON, receiver->GetGUID()); + break; + } + // Messages sent to "RAID" while in a party will get delivered to "PARTY" + case CHAT_MSG_PARTY: + case CHAT_MSG_RAID: + { + + Group* group = sender->GetGroup(); + if (!group || group->isBGGroup()) + break; + + WorldPacket data; + ChatHandler::FillMessageData(&data, this, type, LANG_ADDON, "", 0, message.c_str(), NULL); + group->BroadcastPacket(&data, true, -1, group->GetMemberGroup(sender->GetGUID())); + break; + } + default: + { + sLog->outError("HandleAddonMessagechatOpcode: unknown addon message type %u", type); + break; + } + } +} + void WorldSession::HandleEmoteOpcode(WorldPacket & recv_data) { if (!GetPlayer()->isAlive() || GetPlayer()->HasUnitState(UNIT_STAT_DIED)) diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 30ccdbf780f..28dec40f311 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -191,7 +191,11 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_GUILD_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(UMSG_UPDATE_GUILD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_X, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_BATTLEGROUND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_GUILD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_PARTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_RAID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_WHISPER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_AFK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_BATTLEGROUND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_BATTLEGROUND_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index e972a092dd3..d3afe11ba42 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -694,6 +694,7 @@ class WorldSession bool processChatmessageFurtherAfterSecurityChecks(std::string&, uint32); void HandleMessagechatOpcode(WorldPacket& recvPacket); + void HandleAddonMessagechatOpcode(WorldPacket& recvPacket); void SendPlayerNotFoundNotice(std::string name); void SendPlayerAmbiguousNotice(std::string name); void SendWrongFactionNotice(); -- cgit v1.2.3 From c5ce824ab5c2254f30f76ab6c0fdf098367e227e Mon Sep 17 00:00:00 2001 From: Nay Date: Wed, 21 Dec 2011 18:08:51 +0000 Subject: Core&DB/Quest: Add new fields to locales_quest --- .../4.x/2011_12_21_00_world_locales_quest_4x.sql | 34 ++++++++++++++++++++++ src/server/game/Globals/ObjectMgr.cpp | 34 ++++++++++++---------- 2 files changed, 53 insertions(+), 15 deletions(-) create mode 100644 sql/updates/world/4.x/2011_12_21_00_world_locales_quest_4x.sql (limited to 'src') diff --git a/sql/updates/world/4.x/2011_12_21_00_world_locales_quest_4x.sql b/sql/updates/world/4.x/2011_12_21_00_world_locales_quest_4x.sql new file mode 100644 index 00000000000..2a6cc73ebdc --- /dev/null +++ b/sql/updates/world/4.x/2011_12_21_00_world_locales_quest_4x.sql @@ -0,0 +1,34 @@ +ALTER TABLE `locales_quest` + ADD `QuestGiverTextWindow_loc1` TEXT NULL DEFAULT NULL AFTER `ObjectiveText4_loc8`, + ADD `QuestGiverTextWindow_loc2` TEXT NULL DEFAULT NULL AFTER `QuestGiverTextWindow_loc1`, + ADD `QuestGiverTextWindow_loc3` TEXT NULL DEFAULT NULL AFTER `QuestGiverTextWindow_loc2`, + ADD `QuestGiverTextWindow_loc4` TEXT NULL DEFAULT NULL AFTER `QuestGiverTextWindow_loc3`, + ADD `QuestGiverTextWindow_loc5` TEXT NULL DEFAULT NULL AFTER `QuestGiverTextWindow_loc4`, + ADD `QuestGiverTextWindow_loc6` TEXT NULL DEFAULT NULL AFTER `QuestGiverTextWindow_loc5`, + ADD `QuestGiverTextWindow_loc7` TEXT NULL DEFAULT NULL AFTER `QuestGiverTextWindow_loc6`, + ADD `QuestGiverTextWindow_loc8` TEXT NULL DEFAULT NULL AFTER `QuestGiverTextWindow_loc7`, + ADD `QuestGiverTargetName_loc1` TEXT NULL DEFAULT NULL AFTER `QuestGiverTextWindow_loc8`, + ADD `QuestGiverTargetName_loc2` TEXT NULL DEFAULT NULL AFTER `QuestGiverTargetName_loc1`, + ADD `QuestGiverTargetName_loc3` TEXT NULL DEFAULT NULL AFTER `QuestGiverTargetName_loc2`, + ADD `QuestGiverTargetName_loc4` TEXT NULL DEFAULT NULL AFTER `QuestGiverTargetName_loc3`, + ADD `QuestGiverTargetName_loc5` TEXT NULL DEFAULT NULL AFTER `QuestGiverTargetName_loc4`, + ADD `QuestGiverTargetName_loc6` TEXT NULL DEFAULT NULL AFTER `QuestGiverTargetName_loc5`, + ADD `QuestGiverTargetName_loc7` TEXT NULL DEFAULT NULL AFTER `QuestGiverTargetName_loc6`, + ADD `QuestGiverTargetName_loc8` TEXT NULL DEFAULT NULL AFTER `QuestGiverTargetName_loc7`, + ADD `QuestTurnTextWindow_loc1` TEXT NULL DEFAULT NULL AFTER `QuestGiverTargetName_loc8`, + ADD `QuestTurnTextWindow_loc2` TEXT NULL DEFAULT NULL AFTER `QuestTurnTextWindow_loc1`, + ADD `QuestTurnTextWindow_loc3` TEXT NULL DEFAULT NULL AFTER `QuestTurnTextWindow_loc2`, + ADD `QuestTurnTextWindow_loc4` TEXT NULL DEFAULT NULL AFTER `QuestTurnTextWindow_loc3`, + ADD `QuestTurnTextWindow_loc5` TEXT NULL DEFAULT NULL AFTER `QuestTurnTextWindow_loc4`, + ADD `QuestTurnTextWindow_loc6` TEXT NULL DEFAULT NULL AFTER `QuestTurnTextWindow_loc5`, + ADD `QuestTurnTextWindow_loc7` TEXT NULL DEFAULT NULL AFTER `QuestTurnTextWindow_loc6`, + ADD `QuestTurnTextWindow_loc8` TEXT NULL DEFAULT NULL AFTER `QuestTurnTextWindow_loc7`, + ADD `QuestTurnTargetName_loc1` TEXT NULL DEFAULT NULL AFTER `QuestTurnTextWindow_loc8`, + ADD `QuestTurnTargetName_loc2` TEXT NULL DEFAULT NULL AFTER `QuestTurnTargetName_loc1`, + ADD `QuestTurnTargetName_loc3` TEXT NULL DEFAULT NULL AFTER `QuestTurnTargetName_loc2`, + ADD `QuestTurnTargetName_loc4` TEXT NULL DEFAULT NULL AFTER `QuestTurnTargetName_loc3`, + ADD `QuestTurnTargetName_loc5` TEXT NULL DEFAULT NULL AFTER `QuestTurnTargetName_loc4`, + ADD `QuestTurnTargetName_loc6` TEXT NULL DEFAULT NULL AFTER `QuestTurnTargetName_loc5`, + ADD `QuestTurnTargetName_loc7` TEXT NULL DEFAULT NULL AFTER `QuestTurnTargetName_loc6`, + ADD `QuestTurnTargetName_loc8` TEXT NULL DEFAULT NULL AFTER `QuestTurnTargetName_loc7`; + \ No newline at end of file diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 18f3e1a403c..ff7a9cc4b63 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -4431,14 +4431,14 @@ void ObjectMgr::LoadQuestLocales() mQuestLocaleMap.clear(); // need for reload case QueryResult result = WorldDatabase.Query("SELECT entry, " - "Title_loc1, Details_loc1, Objectives_loc1, OfferRewardText_loc1, RequestItemsText_loc1, EndText_loc1, CompletedText_loc1, ObjectiveText1_loc1, ObjectiveText2_loc1, ObjectiveText3_loc1, ObjectiveText4_loc1, " - "Title_loc2, Details_loc2, Objectives_loc2, OfferRewardText_loc2, RequestItemsText_loc2, EndText_loc2, CompletedText_loc2, ObjectiveText1_loc2, ObjectiveText2_loc2, ObjectiveText3_loc2, ObjectiveText4_loc2, " - "Title_loc3, Details_loc3, Objectives_loc3, OfferRewardText_loc3, RequestItemsText_loc3, EndText_loc3, CompletedText_loc3, ObjectiveText1_loc3, ObjectiveText2_loc3, ObjectiveText3_loc3, ObjectiveText4_loc3, " - "Title_loc4, Details_loc4, Objectives_loc4, OfferRewardText_loc4, RequestItemsText_loc4, EndText_loc4, CompletedText_loc4, ObjectiveText1_loc4, ObjectiveText2_loc4, ObjectiveText3_loc4, ObjectiveText4_loc4, " - "Title_loc5, Details_loc5, Objectives_loc5, OfferRewardText_loc5, RequestItemsText_loc5, EndText_loc5, CompletedText_loc5, ObjectiveText1_loc5, ObjectiveText2_loc5, ObjectiveText3_loc5, ObjectiveText4_loc5, " - "Title_loc6, Details_loc6, Objectives_loc6, OfferRewardText_loc6, RequestItemsText_loc6, EndText_loc6, CompletedText_loc6, ObjectiveText1_loc6, ObjectiveText2_loc6, ObjectiveText3_loc6, ObjectiveText4_loc6, " - "Title_loc7, Details_loc7, Objectives_loc7, OfferRewardText_loc7, RequestItemsText_loc7, EndText_loc7, CompletedText_loc7, ObjectiveText1_loc7, ObjectiveText2_loc7, ObjectiveText3_loc7, ObjectiveText4_loc7, " - "Title_loc8, Details_loc8, Objectives_loc8, OfferRewardText_loc8, RequestItemsText_loc8, EndText_loc8, CompletedText_loc8, ObjectiveText1_loc8, ObjectiveText2_loc8, ObjectiveText3_loc8, ObjectiveText4_loc8" + "Title_loc1, Details_loc1, Objectives_loc1, OfferRewardText_loc1, RequestItemsText_loc1, EndText_loc1, CompletedText_loc1, ObjectiveText1_loc1, ObjectiveText2_loc1, ObjectiveText3_loc1, ObjectiveText4_loc1, QuestGiverTextWindow_loc1, QuestGiverTargetName_loc1, QuestTurnTextWindow_loc1, QuestTurnTargetName_loc1" + "Title_loc2, Details_loc2, Objectives_loc2, OfferRewardText_loc2, RequestItemsText_loc2, EndText_loc2, CompletedText_loc2, ObjectiveText1_loc2, ObjectiveText2_loc2, ObjectiveText3_loc2, ObjectiveText4_loc2, QuestGiverTextWindow_loc2, QuestGiverTargetName_loc2, QuestTurnTextWindow_loc2, QuestTurnTargetName_loc2" + "Title_loc3, Details_loc3, Objectives_loc3, OfferRewardText_loc3, RequestItemsText_loc3, EndText_loc3, CompletedText_loc3, ObjectiveText1_loc3, ObjectiveText2_loc3, ObjectiveText3_loc3, ObjectiveText4_loc3, QuestGiverTextWindow_loc3, QuestGiverTargetName_loc3, QuestTurnTextWindow_loc3, QuestTurnTargetName_loc3" + "Title_loc4, Details_loc4, Objectives_loc4, OfferRewardText_loc4, RequestItemsText_loc4, EndText_loc4, CompletedText_loc4, ObjectiveText1_loc4, ObjectiveText2_loc4, ObjectiveText3_loc4, ObjectiveText4_loc4, QuestGiverTextWindow_loc4, QuestGiverTargetName_loc4, QuestTurnTextWindow_loc4, QuestTurnTargetName_loc4" + "Title_loc5, Details_loc5, Objectives_loc5, OfferRewardText_loc5, RequestItemsText_loc5, EndText_loc5, CompletedText_loc5, ObjectiveText1_loc5, ObjectiveText2_loc5, ObjectiveText3_loc5, ObjectiveText4_loc5, QuestGiverTextWindow_loc5, QuestGiverTargetName_loc5, QuestTurnTextWindow_loc5, QuestTurnTargetName_loc5" + "Title_loc6, Details_loc6, Objectives_loc6, OfferRewardText_loc6, RequestItemsText_loc6, EndText_loc6, CompletedText_loc6, ObjectiveText1_loc6, ObjectiveText2_loc6, ObjectiveText3_loc6, ObjectiveText4_loc6, QuestGiverTextWindow_loc6, QuestGiverTargetName_loc6, QuestTurnTextWindow_loc6, QuestTurnTargetName_loc6" + "Title_loc7, Details_loc7, Objectives_loc7, OfferRewardText_loc7, RequestItemsText_loc7, EndText_loc7, CompletedText_loc7, ObjectiveText1_loc7, ObjectiveText2_loc7, ObjectiveText3_loc7, ObjectiveText4_loc7, QuestGiverTextWindow_loc7, QuestGiverTargetName_loc7, QuestTurnTextWindow_loc7, QuestTurnTargetName_loc7" + "Title_loc8, Details_loc8, Objectives_loc8, OfferRewardText_loc8, RequestItemsText_loc8, EndText_loc8, CompletedText_loc8, ObjectiveText1_loc8, ObjectiveText2_loc8, ObjectiveText3_loc8, ObjectiveText4_loc8, QuestGiverTextWindow_loc8, QuestGiverTargetName_loc8, QuestTurnTextWindow_loc8, QuestTurnTargetName_loc8" " FROM locales_quest"); if (!result) @@ -4456,13 +4456,17 @@ void ObjectMgr::LoadQuestLocales() { LocaleConstant locale = (LocaleConstant) i; - AddLocaleString(fields[1 + 11 * (i - 1)].GetString(), locale, data.Title); - AddLocaleString(fields[1 + 11 * (i - 1) + 1].GetString(), locale, data.Details); - AddLocaleString(fields[1 + 11 * (i - 1) + 2].GetString(), locale, data.Objectives); - AddLocaleString(fields[1 + 11 * (i - 1) + 3].GetString(), locale, data.OfferRewardText); - AddLocaleString(fields[1 + 11 * (i - 1) + 4].GetString(), locale, data.RequestItemsText); - AddLocaleString(fields[1 + 11 * (i - 1) + 5].GetString(), locale, data.EndText); - AddLocaleString(fields[1 + 11 * (i - 1) + 6].GetString(), locale, data.CompletedText); + AddLocaleString(fields[1 + 11 * (i - 1) + 00].GetString(), locale, data.Title); + AddLocaleString(fields[1 + 11 * (i - 1) + 01].GetString(), locale, data.Details); + AddLocaleString(fields[1 + 11 * (i - 1) + 02].GetString(), locale, data.Objectives); + AddLocaleString(fields[1 + 11 * (i - 1) + 03].GetString(), locale, data.OfferRewardText); + AddLocaleString(fields[1 + 11 * (i - 1) + 04].GetString(), locale, data.RequestItemsText); + AddLocaleString(fields[1 + 11 * (i - 1) + 05].GetString(), locale, data.EndText); + AddLocaleString(fields[1 + 11 * (i - 1) + 06].GetString(), locale, data.CompletedText); + AddLocaleString(fields[1 + 11 * (i - 1) + 07].GetString(), locale, data.QuestGiverTextWindow); + AddLocaleString(fields[1 + 11 * (i - 1) + 08].GetString(), locale, data.QuestGiverTargetName); + AddLocaleString(fields[1 + 11 * (i - 1) + 09].GetString(), locale, data.QuestTurnTextWindow); + AddLocaleString(fields[1 + 11 * (i - 1) + 10].GetString(), locale, data.QuestTurnTargetName); for (uint8 k = 0; k < 4; ++k) AddLocaleString(fields[1 + 11 * (i - 1) + 7 + k].GetString(), locale, data.ObjectiveText[k]); -- cgit v1.2.3 From 968e50c0b1b23e64b7234908c81f89018f5f829c Mon Sep 17 00:00:00 2001 From: Nay Date: Wed, 21 Dec 2011 20:16:27 +0000 Subject: Core/Quests: Update SMSG_QUESTGIVER_QUEST_DETAILS Should fix client crash when accepting quest and display the proper npc visual in certain quests (new feature 4.x) TODO: - Test - Update SMSG_QUESTUPDATE_COMPLETE (similar change) --- src/server/game/Entities/Creature/GossipDef.cpp | 78 ++++++++++++++++--------- src/server/game/Globals/ObjectMgr.cpp | 14 ++--- src/server/game/Quests/QuestDef.cpp | 22 ++++++- src/server/game/Quests/QuestDef.h | 2 + src/server/game/Server/Protocol/Opcodes.cpp | 2 +- 5 files changed, 83 insertions(+), 35 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Creature/GossipDef.cpp b/src/server/game/Entities/Creature/GossipDef.cpp index 1b1c86fe00d..10f52accdd0 100755 --- a/src/server/game/Entities/Creature/GossipDef.cpp +++ b/src/server/game/Entities/Creature/GossipDef.cpp @@ -300,6 +300,10 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, uint64 npcGUID, std::string questDetails = quest->GetDetails(); std::string questObjectives = quest->GetObjectives(); std::string questEndText = quest->GetEndText(); + std::string questGiverTextWindow = quest->GetQuestGiverTextWindow(); + std::string questGiverTargetName = quest->GetQuestGiverTargetName(); + std::string questTurnTextWindow = quest->GetQuestTurnTextWindow(); + std::string questTurnTargetName = quest->GetQuestTurnTargetName(); int32 locale = _session->GetSessionDbLocaleIndex(); if (locale >= 0) @@ -310,6 +314,10 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, uint64 npcGUID, ObjectMgr::GetLocaleString(localeData->Details, locale, questDetails); ObjectMgr::GetLocaleString(localeData->Objectives, locale, questObjectives); ObjectMgr::GetLocaleString(localeData->EndText, locale, questEndText); + ObjectMgr::GetLocaleString(localeData->QuestGiverTextWindow, locale, questGiverTextWindow); + ObjectMgr::GetLocaleString(localeData->QuestGiverTargetName, locale, questGiverTargetName); + ObjectMgr::GetLocaleString(localeData->QuestTurnTextWindow, locale, questTurnTextWindow); + ObjectMgr::GetLocaleString(localeData->QuestTurnTargetName, locale, questTurnTargetName); } } @@ -320,10 +328,18 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, uint64 npcGUID, data << questTitle; data << questDetails; data << questObjectives; + data << questGiverTextWindow; // 4.x + data << questGiverTargetName; // 4.x + data << questGiverTextWindow; // 4.x + data << questTurnTargetName; // 4.x + data << uint32(quest->GetQuestGiverPortrait()); // 4.x + data << uint32(quest->GetQuestTurnInPortrait()); // 4.x data << uint8(activateAccept ? 1 : 0); // auto finish data << uint32(quest->GetFlags()); // 3.3.3 questFlags data << uint32(quest->GetSuggestedPlayers()); data << uint8(0); // IsFinished? value is sent back to server in quest accept packet + data << uint8(0); // 4.x StartType, unknown enum + data << uint32(quest->GetRequiredSpell()); // 4.x if (quest->HasFlag(QUEST_FLAGS_HIDDEN_REWARDS)) { @@ -334,31 +350,26 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, uint64 npcGUID, } else { - data << uint32(quest->GetRewChoiceItemsCount()); - for (uint32 i=0; i < QUEST_REWARD_CHOICES_COUNT; ++i) - { - if (!quest->RewardChoiceItemId[i]) - continue; - + data << uint32(quest->GetRewChoiceItemsEffectiveCount()); + for (uint8 i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) data << uint32(quest->RewardChoiceItemId[i]); + for (uint8 i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) data << uint32(quest->RewardChoiceItemCount[i]); - + for (uint8 i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) + { if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->RewardChoiceItemId[i])) data << uint32(itemTemplate->DisplayInfoID); else - data << uint32(0x00); + data << uint32(0); } - data << uint32(quest->GetRewItemsCount()); - - for (uint32 i=0; i < QUEST_REWARDS_COUNT; ++i) - { - if (!quest->RewardItemId[i]) - continue; - + data << uint32(quest->GetRewChoiceItemsEffectiveCount()); + for (uint8 i = 0; i < QUEST_REWARDS_COUNT; ++i) data << uint32(quest->RewardItemId[i]); + for (uint8 i = 0; i < QUEST_REWARDS_COUNT; ++i) data << uint32(quest->RewardItemIdCount[i]); - + for (uint8 i = 0; i < QUEST_REWARDS_COUNT; ++i) + { if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->RewardItemId[i])) data << uint32(itemTemplate->DisplayInfoID); else @@ -369,25 +380,40 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, uint64 npcGUID, data << uint32(quest->XPValue(_session->GetPlayer()) * sWorld->getRate(RATE_XP_QUEST)); } - // rewarded honor points. Multiply with 10 to satisfy client - data << 10 * Trinity::Honor::hk_honor_at_level(_session->GetPlayer()->getLevel(), quest->GetRewHonorMultiplier()); - data << float(0.0f); // new 3.3.0, honor multiplier? - data << uint32(quest->GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast == 0) - data << int32(quest->GetRewSpellCast()); // casted spell data << uint32(quest->GetCharTitleId()); // CharTitleId, new 2.4.0, player gets this title (id from CharTitles) + data << uint32(0); // 4.x Unk + data << uint32(0); // 4.x Unk data << uint32(quest->GetBonusTalents()); // bonus talents - data << uint32(quest->GetRewArenaPoints()); // reward arena points - data << uint32(0); // unk + data << uint32(0); // 4.x Unk + data << uint32(0); // 4.x Unk - for (uint32 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) + /* There are probably some of the unks above + // rewarded honor points. Multiply with 10 to satisfy client + data << 10 * Trinity::Honor::hk_honor_at_level(_session->GetPlayer()->getLevel(), quest->GetRewHonorMultiplier()); + data << float(0.0f); // new 3.3.0, honor multiplier? + data << uint32(quest->GetCharTitleId()); // CharTitleId, new 2.4.0, player gets this title (id from CharTitles) // unk + */ + + for (uint8 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) data << uint32(quest->RewardFactionId[i]); - for (uint32 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) + for (uint8 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) data << int32(quest->RewardFactionValueId[i]); - for (uint32 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) + for (uint8 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) data << int32(quest->RewardFactionValueIdOverride[i]); + data << uint32(quest->GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast == 0) + data << int32(quest->GetRewSpellCast()); // casted spell + + for (uint8 i = 0; i < 4; i++) + data << uint32(0); // 4.x Unk + for (uint8 i = 0; i < 4; i++) + data << uint32(0); // 4.x Unk + + data << uint32(0); // 4.x Unk + data << uint32(0); // 4.x Unk + data << uint32(QUEST_EMOTE_COUNT); for (uint32 i = 0; i < QUEST_EMOTE_COUNT; ++i) { diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index ff7a9cc4b63..c39062b8a32 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -4431,13 +4431,13 @@ void ObjectMgr::LoadQuestLocales() mQuestLocaleMap.clear(); // need for reload case QueryResult result = WorldDatabase.Query("SELECT entry, " - "Title_loc1, Details_loc1, Objectives_loc1, OfferRewardText_loc1, RequestItemsText_loc1, EndText_loc1, CompletedText_loc1, ObjectiveText1_loc1, ObjectiveText2_loc1, ObjectiveText3_loc1, ObjectiveText4_loc1, QuestGiverTextWindow_loc1, QuestGiverTargetName_loc1, QuestTurnTextWindow_loc1, QuestTurnTargetName_loc1" - "Title_loc2, Details_loc2, Objectives_loc2, OfferRewardText_loc2, RequestItemsText_loc2, EndText_loc2, CompletedText_loc2, ObjectiveText1_loc2, ObjectiveText2_loc2, ObjectiveText3_loc2, ObjectiveText4_loc2, QuestGiverTextWindow_loc2, QuestGiverTargetName_loc2, QuestTurnTextWindow_loc2, QuestTurnTargetName_loc2" - "Title_loc3, Details_loc3, Objectives_loc3, OfferRewardText_loc3, RequestItemsText_loc3, EndText_loc3, CompletedText_loc3, ObjectiveText1_loc3, ObjectiveText2_loc3, ObjectiveText3_loc3, ObjectiveText4_loc3, QuestGiverTextWindow_loc3, QuestGiverTargetName_loc3, QuestTurnTextWindow_loc3, QuestTurnTargetName_loc3" - "Title_loc4, Details_loc4, Objectives_loc4, OfferRewardText_loc4, RequestItemsText_loc4, EndText_loc4, CompletedText_loc4, ObjectiveText1_loc4, ObjectiveText2_loc4, ObjectiveText3_loc4, ObjectiveText4_loc4, QuestGiverTextWindow_loc4, QuestGiverTargetName_loc4, QuestTurnTextWindow_loc4, QuestTurnTargetName_loc4" - "Title_loc5, Details_loc5, Objectives_loc5, OfferRewardText_loc5, RequestItemsText_loc5, EndText_loc5, CompletedText_loc5, ObjectiveText1_loc5, ObjectiveText2_loc5, ObjectiveText3_loc5, ObjectiveText4_loc5, QuestGiverTextWindow_loc5, QuestGiverTargetName_loc5, QuestTurnTextWindow_loc5, QuestTurnTargetName_loc5" - "Title_loc6, Details_loc6, Objectives_loc6, OfferRewardText_loc6, RequestItemsText_loc6, EndText_loc6, CompletedText_loc6, ObjectiveText1_loc6, ObjectiveText2_loc6, ObjectiveText3_loc6, ObjectiveText4_loc6, QuestGiverTextWindow_loc6, QuestGiverTargetName_loc6, QuestTurnTextWindow_loc6, QuestTurnTargetName_loc6" - "Title_loc7, Details_loc7, Objectives_loc7, OfferRewardText_loc7, RequestItemsText_loc7, EndText_loc7, CompletedText_loc7, ObjectiveText1_loc7, ObjectiveText2_loc7, ObjectiveText3_loc7, ObjectiveText4_loc7, QuestGiverTextWindow_loc7, QuestGiverTargetName_loc7, QuestTurnTextWindow_loc7, QuestTurnTargetName_loc7" + "Title_loc1, Details_loc1, Objectives_loc1, OfferRewardText_loc1, RequestItemsText_loc1, EndText_loc1, CompletedText_loc1, ObjectiveText1_loc1, ObjectiveText2_loc1, ObjectiveText3_loc1, ObjectiveText4_loc1, QuestGiverTextWindow_loc1, QuestGiverTargetName_loc1, QuestTurnTextWindow_loc1, QuestTurnTargetName_loc1," + "Title_loc2, Details_loc2, Objectives_loc2, OfferRewardText_loc2, RequestItemsText_loc2, EndText_loc2, CompletedText_loc2, ObjectiveText1_loc2, ObjectiveText2_loc2, ObjectiveText3_loc2, ObjectiveText4_loc2, QuestGiverTextWindow_loc2, QuestGiverTargetName_loc2, QuestTurnTextWindow_loc2, QuestTurnTargetName_loc2," + "Title_loc3, Details_loc3, Objectives_loc3, OfferRewardText_loc3, RequestItemsText_loc3, EndText_loc3, CompletedText_loc3, ObjectiveText1_loc3, ObjectiveText2_loc3, ObjectiveText3_loc3, ObjectiveText4_loc3, QuestGiverTextWindow_loc3, QuestGiverTargetName_loc3, QuestTurnTextWindow_loc3, QuestTurnTargetName_loc3," + "Title_loc4, Details_loc4, Objectives_loc4, OfferRewardText_loc4, RequestItemsText_loc4, EndText_loc4, CompletedText_loc4, ObjectiveText1_loc4, ObjectiveText2_loc4, ObjectiveText3_loc4, ObjectiveText4_loc4, QuestGiverTextWindow_loc4, QuestGiverTargetName_loc4, QuestTurnTextWindow_loc4, QuestTurnTargetName_loc4," + "Title_loc5, Details_loc5, Objectives_loc5, OfferRewardText_loc5, RequestItemsText_loc5, EndText_loc5, CompletedText_loc5, ObjectiveText1_loc5, ObjectiveText2_loc5, ObjectiveText3_loc5, ObjectiveText4_loc5, QuestGiverTextWindow_loc5, QuestGiverTargetName_loc5, QuestTurnTextWindow_loc5, QuestTurnTargetName_loc5," + "Title_loc6, Details_loc6, Objectives_loc6, OfferRewardText_loc6, RequestItemsText_loc6, EndText_loc6, CompletedText_loc6, ObjectiveText1_loc6, ObjectiveText2_loc6, ObjectiveText3_loc6, ObjectiveText4_loc6, QuestGiverTextWindow_loc6, QuestGiverTargetName_loc6, QuestTurnTextWindow_loc6, QuestTurnTargetName_loc6," + "Title_loc7, Details_loc7, Objectives_loc7, OfferRewardText_loc7, RequestItemsText_loc7, EndText_loc7, CompletedText_loc7, ObjectiveText1_loc7, ObjectiveText2_loc7, ObjectiveText3_loc7, ObjectiveText4_loc7, QuestGiverTextWindow_loc7, QuestGiverTargetName_loc7, QuestTurnTextWindow_loc7, QuestTurnTargetName_loc7," "Title_loc8, Details_loc8, Objectives_loc8, OfferRewardText_loc8, RequestItemsText_loc8, EndText_loc8, CompletedText_loc8, ObjectiveText1_loc8, ObjectiveText2_loc8, ObjectiveText3_loc8, ObjectiveText4_loc8, QuestGiverTextWindow_loc8, QuestGiverTargetName_loc8, QuestTurnTextWindow_loc8, QuestTurnTargetName_loc8" " FROM locales_quest"); diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index f0c67e3ac4d..b9a7cf1767b 100755 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -238,7 +238,7 @@ uint32 Quest::XPValue(Player* player) const return 0; } -int32 Quest::GetRewOrReqMoney() const +int32 Quest::GetRewOrReqMoney() const { if (RewardOrRequiredMoney <= 0) return RewardOrRequiredMoney; @@ -246,6 +246,26 @@ int32 Quest::GetRewOrReqMoney() const return int32(RewardOrRequiredMoney * sWorld->getRate(RATE_DROP_MONEY)); } +uint32 Quest::GetRewChoiceItemsEffectiveCount() const +{ + uint32 count = 0; + for (uint8 i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) + if (RewardChoiceItemId[i] > 0) + count++; + + return count; +} + +uint32 Quest::GetRewItemsEffectiveCount() const +{ + uint32 count = 0; + for (uint8 i = 0; i < QUEST_REWARDS_COUNT; ++i) + if (RewardItemId[i] > 0) + count++; + + return count; +} + bool Quest::IsAutoComplete() const { return Method == 0 || HasFlag(QUEST_FLAGS_AUTOCOMPLETE); diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h index 4601154feab..9d65700b381 100755 --- a/src/server/game/Quests/QuestDef.h +++ b/src/server/game/Quests/QuestDef.h @@ -304,8 +304,10 @@ class Quest uint32 RequiredCurrencyCount[QUEST_REQUIRED_CURRENCY_COUNT]; uint32 GetReqItemsCount() const { return m_reqItemsCount; } + uint32 GetRewItemsEffectiveCount() const; uint32 GetReqCreatureOrGOcount() const { return m_reqNpcOrGoCount; } uint32 GetRewChoiceItemsCount() const { return m_rewChoiceItemsCount; } + uint32 GetRewChoiceItemsEffectiveCount() const; uint32 GetRewItemsCount() const { return m_rewItemsCount; } typedef std::vector PrevQuests; diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 28dec40f311..355d61f338e 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -454,7 +454,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_QUERY_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverQueryQuestOpcode); //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_QUEST_AUTOLAUNCH, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverQuestAutoLaunch ); - //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_DETAILS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_DETAILS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_ACCEPT_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverAcceptQuestOpcode); //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_COMPLETE_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverCompleteQuest ); //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_REQUEST_ITEMS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From ed4a74690e2ad22aa39da5e648defd367b2bccbd Mon Sep 17 00:00:00 2001 From: Nay Date: Wed, 21 Dec 2011 21:12:52 +0000 Subject: Fix compile and a typo Self reference: in C++ a number prefixed with a zero is treated as an octal number --- src/server/game/Entities/Creature/GossipDef.cpp | 2 +- src/server/game/Globals/ObjectMgr.cpp | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Creature/GossipDef.cpp b/src/server/game/Entities/Creature/GossipDef.cpp index 10f52accdd0..d581891f997 100755 --- a/src/server/game/Entities/Creature/GossipDef.cpp +++ b/src/server/game/Entities/Creature/GossipDef.cpp @@ -330,7 +330,7 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, uint64 npcGUID, data << questObjectives; data << questGiverTextWindow; // 4.x data << questGiverTargetName; // 4.x - data << questGiverTextWindow; // 4.x + data << questTurnTextWindow; // 4.x data << questTurnTargetName; // 4.x data << uint32(quest->GetQuestGiverPortrait()); // 4.x data << uint32(quest->GetQuestTurnInPortrait()); // 4.x diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index c39062b8a32..00e67dc3507 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -4456,16 +4456,16 @@ void ObjectMgr::LoadQuestLocales() { LocaleConstant locale = (LocaleConstant) i; - AddLocaleString(fields[1 + 11 * (i - 1) + 00].GetString(), locale, data.Title); - AddLocaleString(fields[1 + 11 * (i - 1) + 01].GetString(), locale, data.Details); - AddLocaleString(fields[1 + 11 * (i - 1) + 02].GetString(), locale, data.Objectives); - AddLocaleString(fields[1 + 11 * (i - 1) + 03].GetString(), locale, data.OfferRewardText); - AddLocaleString(fields[1 + 11 * (i - 1) + 04].GetString(), locale, data.RequestItemsText); - AddLocaleString(fields[1 + 11 * (i - 1) + 05].GetString(), locale, data.EndText); - AddLocaleString(fields[1 + 11 * (i - 1) + 06].GetString(), locale, data.CompletedText); - AddLocaleString(fields[1 + 11 * (i - 1) + 07].GetString(), locale, data.QuestGiverTextWindow); - AddLocaleString(fields[1 + 11 * (i - 1) + 08].GetString(), locale, data.QuestGiverTargetName); - AddLocaleString(fields[1 + 11 * (i - 1) + 09].GetString(), locale, data.QuestTurnTextWindow); + AddLocaleString(fields[1 + 11 * (i - 1)].GetString(), locale, data.Title); + AddLocaleString(fields[1 + 11 * (i - 1) + 1].GetString(), locale, data.Details); + AddLocaleString(fields[1 + 11 * (i - 1) + 2].GetString(), locale, data.Objectives); + AddLocaleString(fields[1 + 11 * (i - 1) + 3].GetString(), locale, data.OfferRewardText); + AddLocaleString(fields[1 + 11 * (i - 1) + 4].GetString(), locale, data.RequestItemsText); + AddLocaleString(fields[1 + 11 * (i - 1) + 5].GetString(), locale, data.EndText); + AddLocaleString(fields[1 + 11 * (i - 1) + 6].GetString(), locale, data.CompletedText); + AddLocaleString(fields[1 + 11 * (i - 1) + 7].GetString(), locale, data.QuestGiverTextWindow); + AddLocaleString(fields[1 + 11 * (i - 1) + 8].GetString(), locale, data.QuestGiverTargetName); + AddLocaleString(fields[1 + 11 * (i - 1) + 9].GetString(), locale, data.QuestTurnTextWindow); AddLocaleString(fields[1 + 11 * (i - 1) + 10].GetString(), locale, data.QuestTurnTargetName); for (uint8 k = 0; k < 4; ++k) -- cgit v1.2.3 From 770ff57101e1ca6cce0922c3835de527f47d2c9e Mon Sep 17 00:00:00 2001 From: Nay Date: Wed, 21 Dec 2011 23:26:10 +0000 Subject: Core/Quests: Implement SMSG_QUESTUPDATE_COMPLETE Quests can now be completed (and it won't crash client) --- src/server/game/Entities/Creature/GossipDef.cpp | 77 +------------------------ src/server/game/Entities/Player/Player.cpp | 55 +++++++++++++++--- src/server/game/Entities/Player/Player.h | 2 +- src/server/game/Quests/QuestDef.cpp | 76 ++++++++++++++++++++++++ src/server/game/Quests/QuestDef.h | 2 + src/server/game/Server/Protocol/Opcodes.cpp | 2 +- 6 files changed, 131 insertions(+), 83 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Creature/GossipDef.cpp b/src/server/game/Entities/Creature/GossipDef.cpp index d581891f997..4aa7afe695c 100755 --- a/src/server/game/Entities/Creature/GossipDef.cpp +++ b/src/server/game/Entities/Creature/GossipDef.cpp @@ -323,7 +323,7 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, uint64 npcGUID, WorldPacket data(SMSG_QUESTGIVER_QUEST_DETAILS, 100); // guess size data << uint64(npcGUID); - data << uint64(0); // wotlk, something todo with quest sharing? + data << uint64(0); // either 0 or a npc guid (quest giver) data << uint32(quest->GetQuestId()); data << questTitle; data << questDetails; @@ -341,81 +341,10 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, uint64 npcGUID, data << uint8(0); // 4.x StartType, unknown enum data << uint32(quest->GetRequiredSpell()); // 4.x - if (quest->HasFlag(QUEST_FLAGS_HIDDEN_REWARDS)) - { - data << uint32(0); // Rewarded chosen items hidden - data << uint32(0); // Rewarded items hidden - data << uint32(0); // Rewarded money hidden - data << uint32(0); // Rewarded XP hidden - } - else - { - data << uint32(quest->GetRewChoiceItemsEffectiveCount()); - for (uint8 i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) - data << uint32(quest->RewardChoiceItemId[i]); - for (uint8 i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) - data << uint32(quest->RewardChoiceItemCount[i]); - for (uint8 i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) - { - if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->RewardChoiceItemId[i])) - data << uint32(itemTemplate->DisplayInfoID); - else - data << uint32(0); - } - - data << uint32(quest->GetRewChoiceItemsEffectiveCount()); - for (uint8 i = 0; i < QUEST_REWARDS_COUNT; ++i) - data << uint32(quest->RewardItemId[i]); - for (uint8 i = 0; i < QUEST_REWARDS_COUNT; ++i) - data << uint32(quest->RewardItemIdCount[i]); - for (uint8 i = 0; i < QUEST_REWARDS_COUNT; ++i) - { - if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->RewardItemId[i])) - data << uint32(itemTemplate->DisplayInfoID); - else - data << uint32(0); - } - - data << uint32(quest->GetRewOrReqMoney()); - data << uint32(quest->XPValue(_session->GetPlayer()) * sWorld->getRate(RATE_XP_QUEST)); - } - - data << uint32(quest->GetCharTitleId()); // CharTitleId, new 2.4.0, player gets this title (id from CharTitles) - data << uint32(0); // 4.x Unk - data << uint32(0); // 4.x Unk - data << uint32(quest->GetBonusTalents()); // bonus talents - data << uint32(0); // 4.x Unk - data << uint32(0); // 4.x Unk - - /* There are probably some of the unks above - // rewarded honor points. Multiply with 10 to satisfy client - data << 10 * Trinity::Honor::hk_honor_at_level(_session->GetPlayer()->getLevel(), quest->GetRewHonorMultiplier()); - data << float(0.0f); // new 3.3.0, honor multiplier? - data << uint32(quest->GetCharTitleId()); // CharTitleId, new 2.4.0, player gets this title (id from CharTitles) // unk - */ - - for (uint8 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) - data << uint32(quest->RewardFactionId[i]); - - for (uint8 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) - data << int32(quest->RewardFactionValueId[i]); - - for (uint8 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) - data << int32(quest->RewardFactionValueIdOverride[i]); - - data << uint32(quest->GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast == 0) - data << int32(quest->GetRewSpellCast()); // casted spell - - for (uint8 i = 0; i < 4; i++) - data << uint32(0); // 4.x Unk - for (uint8 i = 0; i < 4; i++) - data << uint32(0); // 4.x Unk - - data << uint32(0); // 4.x Unk - data << uint32(0); // 4.x Unk + quest->BuildExtraQuestInfo(data, _session->GetPlayer()); data << uint32(QUEST_EMOTE_COUNT); - for (uint32 i = 0; i < QUEST_EMOTE_COUNT; ++i) + for (uint8 i = 0; i < QUEST_EMOTE_COUNT; ++i) { data << uint32(quest->DetailsEmote[i]); data << uint32(quest->DetailsEmoteDelay[i]); // DetailsEmoteDelay (in ms) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index ff5d5c4c0e1..67c301977fc 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -14779,7 +14779,7 @@ void Player::CompleteQuest(uint32 quest_id) if (qInfo->HasFlag(QUEST_FLAGS_AUTO_REWARDED)) RewardQuest(qInfo, 0, this, false); else - SendQuestComplete(quest_id); + SendQuestComplete(qInfo); } } } @@ -16082,15 +16082,56 @@ bool Player::HasQuestForItem(uint32 itemid) const return false; } -void Player::SendQuestComplete(uint32 quest_id) +void Player::SendQuestComplete(Quest const* quest) { - if (quest_id) + // SMSG_QUESTUPDATE_COMPLETE - whole new structure in 4.x + + std::string title = quest->GetTitle(); + std::string completedText = quest->GetCompletedText(); + std::string questGiverTextWindow = quest->GetQuestGiverTextWindow(); + std::string questGiverTargetName = quest->GetQuestGiverTargetName(); + std::string questTurnTextWindow = quest->GetQuestTurnTextWindow(); + std::string questTurnTargetName = quest->GetQuestTurnTargetName(); + + int32 locale = GetSession()->GetSessionDbLocaleIndex(); + if (locale >= 0) { - WorldPacket data(SMSG_QUESTUPDATE_COMPLETE, 4); - data << uint32(quest_id); - GetSession()->SendPacket(&data); - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTUPDATE_COMPLETE quest = %u", quest_id); + if (QuestLocale const* localeData = sObjectMgr->GetQuestLocale(quest->GetQuestId())) + { + ObjectMgr::GetLocaleString(localeData->Title, locale, title); + ObjectMgr::GetLocaleString(localeData->CompletedText, locale, completedText); + ObjectMgr::GetLocaleString(localeData->QuestGiverTextWindow, locale, questGiverTextWindow); + ObjectMgr::GetLocaleString(localeData->QuestGiverTargetName, locale, questGiverTargetName); + ObjectMgr::GetLocaleString(localeData->QuestTurnTextWindow, locale, questTurnTextWindow); + ObjectMgr::GetLocaleString(localeData->QuestTurnTargetName, locale, questTurnTargetName); + } } + + WorldPacket data(SMSG_QUESTUPDATE_COMPLETE, 4); + data << uint64(this->GetGUID()); + data << uint32(quest->GetQuestId()); + data << title; + data << completedText; + data << questGiverTextWindow; + data << questGiverTargetName; + data << questTurnTextWindow; + data << questTurnTargetName; + data << uint32(quest->GetQuestGiverPortrait()); + data << uint32(quest->GetQuestTurnInPortrait()); + data << int8(0); // Unk + data << uint32(quest->GetFlags()); + data << int32(0); // Unk + data << uint32(QUEST_EMOTE_COUNT); + for (uint8 i = 0; i < QUEST_EMOTE_COUNT; ++i) + { + data << uint32(quest->DetailsEmote[i]); + data << uint32(quest->DetailsEmoteDelay[i]); // DetailsEmoteDelay (in ms) + } + + quest->BuildExtraQuestInfo(data, this); + + GetSession()->SendPacket(&data); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTUPDATE_COMPLETE quest = %u", quest->GetQuestId()); } void Player::SendQuestReward(Quest const* quest, uint32 XP, Object* questGiver) diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 7eca06f750c..40c14055a31 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1500,7 +1500,7 @@ class Player : public Unit, public GridObject void UpdateForQuestWorldObjects(); bool CanShareQuest(uint32 quest_id) const; - void SendQuestComplete(uint32 quest_id); + void SendQuestComplete(Quest const* quest); void SendQuestReward(Quest const* quest, uint32 XP, Object* questGiver); void SendQuestFailed(uint32 questId, InventoryResult reason = EQUIP_ERR_OK); void SendQuestTimerFailed(uint32 quest_id); diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index b9a7cf1767b..e5e7555330b 100755 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -266,6 +266,82 @@ uint32 Quest::GetRewItemsEffectiveCount() const return count; } +void Quest::BuildExtraQuestInfo(WorldPacket& data, Player* player) const +{ + if (HasFlag(QUEST_FLAGS_HIDDEN_REWARDS)) + { + data << uint32(0); // Rewarded chosen items hidden + data << uint32(0); // Rewarded items hidden + data << uint32(0); // Rewarded money hidden + data << uint32(0); // Rewarded XP hidden + } + else + { + data << uint32(GetRewChoiceItemsEffectiveCount()); + for (uint8 i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) + data << uint32(RewardChoiceItemId[i]); + for (uint8 i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) + data << uint32(RewardChoiceItemCount[i]); + for (uint8 i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) + { + if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(RewardChoiceItemId[i])) + data << uint32(itemTemplate->DisplayInfoID); + else + data << uint32(0); + } + + data << uint32(GetRewChoiceItemsEffectiveCount()); + for (uint8 i = 0; i < QUEST_REWARDS_COUNT; ++i) + data << uint32(RewardItemId[i]); + for (uint8 i = 0; i < QUEST_REWARDS_COUNT; ++i) + data << uint32(RewardItemIdCount[i]); + for (uint8 i = 0; i < QUEST_REWARDS_COUNT; ++i) + { + if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(RewardItemId[i])) + data << uint32(itemTemplate->DisplayInfoID); + else + data << uint32(0); + } + + data << uint32(GetRewOrReqMoney()); + data << uint32(XPValue(player) * sWorld->getRate(RATE_XP_QUEST)); + } + + data << uint32(GetCharTitleId()); // CharTitleId, new 2.4.0, player gets this title (id from CharTitles) + data << uint32(0); // 4.x Unk + data << uint32(0); // 4.x Unk + data << uint32(GetBonusTalents()); // bonus talents + data << uint32(0); // 4.x Unk + data << uint32(0); // 4.x Unk + + /* These are probably some of the unks above + // rewarded honor points. Multiply with 10 to satisfy client + data << 10 * Trinity::Honor::hk_honor_at_level(_session->GetPlayer()->getLevel(), quest->GetRewHonorMultiplier()); + data << float(0.0f); // new 3.3.0, honor multiplier? + data << uint32(quest->GetCharTitleId()); // CharTitleId, new 2.4.0, player gets this title (id from CharTitles) // unk + */ + + for (uint8 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) + data << uint32(RewardFactionId[i]); + + for (uint8 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) + data << int32(RewardFactionValueId[i]); + + for (uint8 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) + data << int32(RewardFactionValueIdOverride[i]); + + data << uint32(GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast == 0) + data << int32(GetRewSpellCast()); // casted spell + + for (uint8 i = 0; i < 4; i++) + data << uint32(0); // 4.x Unk + for (uint8 i = 0; i < 4; i++) + data << uint32(0); // 4.x Unk + + data << uint32(0); // 4.x Unk + data << uint32(0); // 4.x Unk +} + bool Quest::IsAutoComplete() const { return Method == 0 || HasFlag(QUEST_FLAGS_AUTOCOMPLETE); diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h index 9d65700b381..ec21239956a 100755 --- a/src/server/game/Quests/QuestDef.h +++ b/src/server/game/Quests/QuestDef.h @@ -310,6 +310,8 @@ class Quest uint32 GetRewChoiceItemsEffectiveCount() const; uint32 GetRewItemsCount() const { return m_rewItemsCount; } + void BuildExtraQuestInfo(WorldPacket& data, Player* player) const; + typedef std::vector PrevQuests; PrevQuests prevQuests; typedef std::vector PrevChainQuests; diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 355d61f338e..b13fa388263 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -470,7 +470,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_QUESTLOG_FULL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_FAILEDTIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_ADD_KILL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_ADD_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_QUEST_CONFIRM_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestConfirmAccept ); -- cgit v1.2.3 From f9d398c6ad10e58e4b09d6645fc74839ac4cbfc2 Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 22 Dec 2011 03:39:27 +0000 Subject: Core/Guilds: Preliminary implementation of guild guids --- src/server/game/Entities/Object/ObjectDefines.h | 4 ++++ src/server/game/Guilds/GuildMgr.cpp | 11 +++++++++++ src/server/game/Guilds/GuildMgr.h | 1 + 3 files changed, 16 insertions(+) (limited to 'src') diff --git a/src/server/game/Entities/Object/ObjectDefines.h b/src/server/game/Entities/Object/ObjectDefines.h index 4108063bfb3..58b2455c2e6 100755 --- a/src/server/game/Entities/Object/ObjectDefines.h +++ b/src/server/game/Entities/Object/ObjectDefines.h @@ -45,6 +45,7 @@ enum HighGuid HIGHGUID_CORPSE = 0xF101, // blizz F100 HIGHGUID_MO_TRANSPORT = 0x1FC0, // blizz 1FC0 (for GAMEOBJECT_TYPE_MO_TRANSPORT) HIGHGUID_GROUP = 0x1F50, + HIGHGUID_GUILD = 0x1FF // new 4.x }; #define IS_EMPTY_GUID(Guid) (Guid == 0) @@ -64,6 +65,7 @@ enum HighGuid #define IS_TRANSPORT(Guid) (GUID_HIPART(Guid) == HIGHGUID_TRANSPORT) #define IS_MO_TRANSPORT(Guid) (GUID_HIPART(Guid) == HIGHGUID_MO_TRANSPORT) #define IS_GROUP(Guid) (GUID_HIPART(Guid) == HIGHGUID_GROUP) +#define IS_GUILD(Guid) (GUID_HIPART(Guid) == HIGHGUID_GUILD) // l - OBJECT_FIELD_GUID // e - OBJECT_FIELD_ENTRY for GO (except GAMEOBJECT_TYPE_MO_TRANSPORT) and creatures or UNIT_FIELD_PETNUMBER for pets @@ -87,6 +89,7 @@ inline bool IsGuidHaveEnPart(uint64 guid) case HIGHGUID_DYNAMICOBJECT: case HIGHGUID_CORPSE: case HIGHGUID_GROUP: + case HIGHGUID_GUILD: return false; case HIGHGUID_GAMEOBJECT: case HIGHGUID_TRANSPORT: @@ -117,6 +120,7 @@ inline char const* GetLogNameForGuid(uint64 guid) case HIGHGUID_CORPSE: return "corpse"; case HIGHGUID_MO_TRANSPORT: return "mo_transport"; case HIGHGUID_GROUP: return "group"; + case HIGHGUID_GUILD: return "guild"; default: return ""; } diff --git a/src/server/game/Guilds/GuildMgr.cpp b/src/server/game/Guilds/GuildMgr.cpp index dd1ae020a51..1a6e125512b 100644 --- a/src/server/game/Guilds/GuildMgr.cpp +++ b/src/server/game/Guilds/GuildMgr.cpp @@ -59,6 +59,17 @@ Guild* GuildMgr::GetGuildById(uint32 guildId) const return NULL; } +Guild* GuildMgr::GetGuildByGuid(uint64 guid) const +{ + // Full guids are only used when receiving/sending data to client + // everywhere else guild id is used + if (IS_GUILD(guid)) + if (uint32 guildId = GUID_LOPART(guid)) + return GetGuildById(guildId); + + return NULL; +} + Guild* GuildMgr::GetGuildByName(const std::string& guildName) const { std::string search = guildName; diff --git a/src/server/game/Guilds/GuildMgr.h b/src/server/game/Guilds/GuildMgr.h index e53c46cb6be..d5aea8d13cb 100644 --- a/src/server/game/Guilds/GuildMgr.h +++ b/src/server/game/Guilds/GuildMgr.h @@ -32,6 +32,7 @@ public: Guild* GetGuildByLeader(uint64 guid) const; Guild* GetGuildById(uint32 guildId) const; + Guild* GetGuildByGuid(uint64 guid) const; Guild* GetGuildByName(const std::string& guildName) const; std::string GetGuildNameById(uint32 guildId) const; -- cgit v1.2.3 From 869a8644e55d4d1db724df7f20d59ed26fce53f4 Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 22 Dec 2011 03:49:36 +0000 Subject: Core/Guild: Fix and enable CMSG_GUILD_QUERY --- src/server/game/Guilds/Guild.cpp | 6 ++++++ src/server/game/Guilds/Guild.h | 1 + .../game/Server/Protocol/Handlers/GuildHandler.cpp | 19 ++++++++++++------- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- 4 files changed, 20 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index e422cf1e152..e7374a273dc 100755 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -2201,6 +2201,12 @@ bool Guild::ChangeMemberRank(uint64 guid, uint8 newRank) return false; } +bool Guild::IsMember(uint64 guid) +{ + Members::const_iterator itr = m_members.find(GUID_LOPART(guid)); + return itr != m_members.end(); +} + /////////////////////////////////////////////////////////////////////////////// // Bank (items move) void Guild::SwapItems(Player* player, uint8 tabId, uint8 slotId, uint8 destTabId, uint8 destSlotId, uint32 splitedAmount) diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h index 3ac2b0a490d..2f89cb21f3e 100755 --- a/src/server/game/Guilds/Guild.h +++ b/src/server/game/Guilds/Guild.h @@ -659,6 +659,7 @@ public: bool AddMember(uint64 guid, uint8 rankId = GUILD_RANK_NONE); void DeleteMember(uint64 guid, bool isDisbanding = false, bool isKicked = false); bool ChangeMemberRank(uint64 guid, uint8 newRank); + bool IsMember(uint64 guid); // Bank void SwapItems(Player* player, uint8 tabId, uint8 slotId, uint8 destTabId, uint8 destSlotId, uint32 splitedAmount); diff --git a/src/server/game/Server/Protocol/Handlers/GuildHandler.cpp b/src/server/game/Server/Protocol/Handlers/GuildHandler.cpp index 7e964b4faf6..28d4292977b 100755 --- a/src/server/game/Server/Protocol/Handlers/GuildHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/GuildHandler.cpp @@ -44,13 +44,18 @@ void WorldSession::HandleGuildQueryOpcode(WorldPacket& recvPacket) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_QUERY"); - uint32 guildId; - recvPacket >> guildId; - // Use received guild id to access guild method (not player's guild id) - if (Guild* guild = sGuildMgr->GetGuildById(guildId)) - guild->HandleQuery(this); - else - Guild::SendCommandResult(this, GUILD_CREATE_S, ERR_GUILD_PLAYER_NOT_IN_GUILD); + uint64 guildGuid, playerGuid; + recvPacket >> guildGuid >> playerGuid; + + // If guild doesn't exist or player is not part of the guild send error + if (Guild* guild = sGuildMgr->GetGuildByGuid(guildGuid)) + if (guild->IsMember(playerGuid)) + { + guild->HandleQuery(this); + return; + } + + Guild::SendCommandResult(this, GUILD_CREATE_S, ERR_GUILD_PLAYER_NOT_IN_GUILD); } void WorldSession::HandleGuildCreateOpcode(WorldPacket& recvPacket) diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index b13fa388263..8c7d56171f0 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -126,7 +126,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_PET_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetNameQuery ); //DEFINE_OPCODE_HANDLER(SMSG_PET_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_QUERY, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildQueryOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_QUERY, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildQueryOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_ITEM_QUERY_SINGLE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleItemQuerySingleOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_ITEM_QUERY_MULTIPLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); -- cgit v1.2.3 From 5d5ed297b43bd3e1cc19a7e128b4ed5d0d6da3c9 Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 22 Dec 2011 03:55:07 +0000 Subject: Core/Guild: Fix and enable CMSG_JOIN_CHANNEL --- .../game/Server/Protocol/Handlers/ChannelHandler.cpp | 20 ++++++++++---------- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Handlers/ChannelHandler.cpp b/src/server/game/Server/Protocol/Handlers/ChannelHandler.cpp index d08e7d9f930..9286d31677d 100755 --- a/src/server/game/Server/Protocol/Handlers/ChannelHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/ChannelHandler.cpp @@ -23,18 +23,18 @@ void WorldSession::HandleJoinChannel(WorldPacket& recvPacket) { sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); - uint32 channel_id; + uint32 channelId; uint8 unknown1, unknown2; - std::string channelname, pass; + std::string channelName, pass; - recvPacket >> channel_id; + recvPacket >> channelId; recvPacket >> unknown1 >> unknown2; - recvPacket >> channelname; recvPacket >> pass; - - if (channel_id) + recvPacket >> channelName; + + if (channelId) { - ChatChannelsEntry const* channel = sChatChannelsStore.LookupEntry(channel_id); + ChatChannelsEntry const* channel = sChatChannelsStore.LookupEntry(channelId); if (!channel) return; @@ -46,13 +46,13 @@ void WorldSession::HandleJoinChannel(WorldPacket& recvPacket) return; } - if (channelname.empty()) + if (channelName.empty()) return; if (ChannelMgr* cMgr = channelMgr(_player->GetTeam())) { cMgr->team = _player->GetTeam(); - if (Channel* chn = cMgr->GetJoinChannel(channelname, channel_id)) + if (Channel* chn = cMgr->GetJoinChannel(channelName, channelId)) chn->Join(_player->GetGUID(), pass.c_str()); } } @@ -296,7 +296,7 @@ void WorldSession::HandleSetChannelWatch(WorldPacket &recvPacket) std::string channelname; recvPacket >> channelname; /*if (ChannelMgr* cMgr = channelMgr(_player->GetTeam())) - if (Channel* chn = cMgr->GetChannel(channelname, _player)) + if (Channel* chn = cMgr->GetChannel(channelName, _player)) chn->JoinNotify(_player->GetGUID());*/ } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 8c7d56171f0..9c93845a954 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -213,7 +213,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_WHISPER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_YELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); DEFINE_OPCODE_HANDLER(SMSG_MESSAGECHAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_JOIN_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleJoinChannel ); + DEFINE_OPCODE_HANDLER(CMSG_JOIN_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleJoinChannel ); //DEFINE_OPCODE_HANDLER(CMSG_LEAVE_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLeaveChannel ); DEFINE_OPCODE_HANDLER(SMSG_CHANNEL_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelList ); -- cgit v1.2.3 From 9fe7bedd106e137d09cf451a207eeafb324df9ce Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 22 Dec 2011 04:08:48 +0000 Subject: Core/Quest: Fix and enable CMSG_QUESTGIVER_COMPLETE_QUEST --- .../game/Server/Protocol/Handlers/QueryHandler.cpp | 1 + .../game/Server/Protocol/Handlers/QuestHandler.cpp | 43 +++++++++++----------- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- 3 files changed, 24 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp b/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp index f89ec5ab7ee..7de5ee61115 100755 --- a/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp @@ -418,6 +418,7 @@ void WorldSession::HandleQuestPOIQuery(WorldPacket& recv_data) { uint32 count; recv_data >> count; // quest count, max=25 + // 4.3 struct: count, byte, byte, byte, questIds[] if (count >= MAX_QUEST_LOG_SIZE) { diff --git a/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp b/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp index e0bcadc89e9..e345eac884c 100755 --- a/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp @@ -486,48 +486,49 @@ void WorldSession::HandleQuestConfirmAccept(WorldPacket& recv_data) void WorldSession::HandleQuestgiverCompleteQuest(WorldPacket& recv_data) { - uint32 quest; - uint64 guid; - recv_data >> guid >> quest; + uint32 questId; + uint64 playerGuid; + int8 unkByte; + recv_data >> playerGuid >> questId >> unkByte; - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_COMPLETE_QUEST npc = %u, quest = %u", uint32(GUID_LOPART(guid)), quest); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_COMPLETE_QUEST npc = %u, questId = %u", uint32(GUID_LOPART(playerGuid)), questId); - Object* pObject = ObjectAccessor::GetObjectByTypeMask(*_player, guid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT); - if (!pObject || !pObject->hasInvolvedQuest(quest)) + Object* object = ObjectAccessor::GetObjectByTypeMask(*_player, playerGuid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT); + if (!object || !object->hasInvolvedQuest(questId)) return; // some kind of WPE protection - if (!_player->CanInteractWithQuestGiver(pObject)) + if (!_player->CanInteractWithQuestGiver(object)) return; - Quest const* pQuest = sObjectMgr->GetQuestTemplate(quest); - if (pQuest) + Quest const* quest = sObjectMgr->GetQuestTemplate(questId); + if (quest) { - if (!_player->CanSeeStartQuest(pQuest) && _player->GetQuestStatus(quest)==QUEST_STATUS_NONE) + if (!_player->CanSeeStartQuest(quest) && _player->GetQuestStatus(questId)==QUEST_STATUS_NONE) { - sLog->outError("Possible hacking attempt: Player %s [guid: %u] tried to complete quest [entry: %u] without being in possession of the quest!", - _player->GetName(), _player->GetGUIDLow(), quest); + sLog->outError("Possible hacking attempt: Player %s [playerGuid: %u] tried to complete questId [entry: %u] without being in possession of the questId!", + _player->GetName(), _player->GetGUIDLow(), questId); return; } // TODO: need a virtual function if (_player->InBattleground()) if (Battleground* bg = _player->GetBattleground()) if (bg->GetTypeID() == BATTLEGROUND_AV) - ((BattlegroundAV*)bg)->HandleQuestComplete(quest, _player); + ((BattlegroundAV*)bg)->HandleQuestComplete(questId, _player); - if (_player->GetQuestStatus(quest) != QUEST_STATUS_COMPLETE) + if (_player->GetQuestStatus(questId) != QUEST_STATUS_COMPLETE) { - if (pQuest->IsRepeatable()) - _player->PlayerTalkClass->SendQuestGiverRequestItems(pQuest, guid, _player->CanCompleteRepeatableQuest(pQuest), false); + if (quest->IsRepeatable()) + _player->PlayerTalkClass->SendQuestGiverRequestItems(quest, playerGuid, _player->CanCompleteRepeatableQuest(quest), false); else - _player->PlayerTalkClass->SendQuestGiverRequestItems(pQuest, guid, _player->CanRewardQuest(pQuest, false), false); + _player->PlayerTalkClass->SendQuestGiverRequestItems(quest, playerGuid, _player->CanRewardQuest(quest, false), false); } else { - if (pQuest->GetReqItemsCount()) // some items required - _player->PlayerTalkClass->SendQuestGiverRequestItems(pQuest, guid, _player->CanRewardQuest(pQuest, false), false); + if (quest->GetReqItemsCount()) // some items required + _player->PlayerTalkClass->SendQuestGiverRequestItems(quest, playerGuid, _player->CanRewardQuest(quest, false), false); else // no items required - _player->PlayerTalkClass->SendQuestGiverOfferReward(pQuest, guid, true); + _player->PlayerTalkClass->SendQuestGiverOfferReward(quest, playerGuid, true); } } } @@ -542,7 +543,7 @@ void WorldSession::HandlePushQuestToParty(WorldPacket& recvPacket) uint32 questId; recvPacket >> questId; - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_PUSHQUESTTOPARTY quest = %u", questId); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_PUSHQUESTTOPARTY questId = %u", questId); if (Quest const* pQuest = sObjectMgr->GetQuestTemplate(questId)) { diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 9c93845a954..5921267a2e4 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -456,7 +456,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_QUEST_AUTOLAUNCH, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverQuestAutoLaunch ); DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_DETAILS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_ACCEPT_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverAcceptQuestOpcode); - //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_COMPLETE_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverCompleteQuest ); + DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_COMPLETE_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverCompleteQuest ); //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_REQUEST_ITEMS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_REQUEST_REWARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverRequestRewardOpcode); //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_OFFER_REWARD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From 41b0a9ec86b2805801924bc78da28d790a618142 Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 22 Dec 2011 04:34:26 +0000 Subject: Core/Quest: Fix and enable CMSG_QUEST_CONFIRM_ACCEPT Core/Protocol: Add CMSG_QUEST_POI_QUERY opcode --- src/server/game/Entities/Unit/Unit.h | 2 +- .../game/Server/Protocol/Handlers/QuestHandler.cpp | 30 ++++++++++++++-------- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- src/server/game/Server/Protocol/Opcodes.h | 2 +- 4 files changed, 23 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 4f0db86adc1..951682cc5ee 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -628,7 +628,7 @@ enum NPCFlags { UNIT_NPC_FLAG_NONE = 0x00000000, UNIT_NPC_FLAG_GOSSIP = 0x00000001, // 100% - UNIT_NPC_FLAG_QUESTGIVER = 0x00000002, // guessed, probably ok + UNIT_NPC_FLAG_QUESTGIVER = 0x00000002, // 100% UNIT_NPC_FLAG_UNK1 = 0x00000004, UNIT_NPC_FLAG_UNK2 = 0x00000008, UNIT_NPC_FLAG_TRAINER = 0x00000010, // 100% diff --git a/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp b/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp index e345eac884c..a50da77a067 100755 --- a/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp @@ -449,16 +449,26 @@ void WorldSession::HandleQuestLogRemoveQuest(WorldPacket& recv_data) } } -void WorldSession::HandleQuestConfirmAccept(WorldPacket& recv_data) +void WorldSession::HandleQuestConfirmAccept(WorldPacket& recvData) { - uint32 quest; - recv_data >> quest; + uint64 questGiverGuid; + uint32 questId; + uint32 unkInt; + recvData >> questGiverGuid>> questId >> unkInt; - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUEST_CONFIRM_ACCEPT quest = %u", quest); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUEST_CONFIRM_ACCEPT questId = %u", questId); + + if (IS_UNIT_GUID(questGiverGuid)) + if (!GetPlayer()->GetNPCIfCanInteractWith(questGiverGuid, UNIT_NPC_FLAG_QUESTGIVER)) + return; + if (IS_GAMEOBJECT_GUID(questGiverGuid)) + if (!GetPlayer()->GetGameObjectIfCanInteractWith(questGiverGuid, GAMEOBJECT_TYPE_QUESTGIVER)) + return; + // Can items be quest giver? - if (const Quest* pQuest = sObjectMgr->GetQuestTemplate(quest)) + if (const Quest* quest = sObjectMgr->GetQuestTemplate(questId)) { - if (!pQuest->HasFlag(QUEST_FLAGS_PARTY_ACCEPT)) + if (!quest->HasFlag(QUEST_FLAGS_PARTY_ACCEPT)) return; Player* pOriginalPlayer = ObjectAccessor::FindPlayer(_player->GetDivider()); @@ -466,7 +476,7 @@ void WorldSession::HandleQuestConfirmAccept(WorldPacket& recv_data) if (!pOriginalPlayer) return; - if (pQuest->IsRaidQuest()) + if (quest->IsRaidQuest()) { if (!_player->IsInSameRaidWith(pOriginalPlayer)) return; @@ -477,8 +487,8 @@ void WorldSession::HandleQuestConfirmAccept(WorldPacket& recv_data) return; } - if (_player->CanAddQuest(pQuest, true)) - _player->AddQuest(pQuest, NULL); // NULL, this prevent DB script from duplicate running + if (_player->CanAddQuest(quest, true)) + _player->AddQuest(quest, NULL); // NULL, this prevent DB script from duplicate running _player->SetDivider(0); } @@ -765,7 +775,7 @@ void WorldSession::HandleQuestgiverStatusMultipleQuery(WorldPacket& /*recvPacket SendPacket(&data); } -void WorldSession::HandleQueryQuestsCompleted(WorldPacket & /*recv_data*/) +void WorldSession::HandleQueryQuestsCompleted(WorldPacket & /*recvData*/) { size_t rew_count = _player->GetRewardedQuestCount(); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 5921267a2e4..d63528adedb 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -473,7 +473,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_ADD_KILL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_ADD_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_QUEST_CONFIRM_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestConfirmAccept ); + DEFINE_OPCODE_HANDLER(CMSG_QUEST_CONFIRM_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestConfirmAccept ); //DEFINE_OPCODE_HANDLER(SMSG_QUEST_CONFIRM_ACCEPT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_PUSHQUESTTOPARTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePushQuestToParty ); DEFINE_OPCODE_HANDLER(CMSG_LIST_INVENTORY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleListInventoryOpcode ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 3090c7a3840..ab877abdf65 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -350,7 +350,7 @@ enum Opcodes CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY = 0xC8DB, CMSG_QUESTGIVER_STATUS_QUERY = 0x88C6, CMSG_QUESTLOG_REMOVE_QUEST = 0x8EFF, - CMSG_QUEST_POI_QUERY = 0x00, + CMSG_QUEST_POI_QUERY = 0x12A5, CMSG_QUEST_CONFIRM_ACCEPT = 0xC63, CMSG_RANDOMIZE_CHAR_NAME = 0x8A99, // byte unk, byte race CMSG_READY_FOR_ACCOUNT_DATA_TIMES = 0xCCDB, -- cgit v1.2.3 From 3eed377f48c3e20ab2ff9cca620fb730333b1445 Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 22 Dec 2011 04:50:41 +0000 Subject: Core/Guild: CMSG_GUILD_ROSTER ft. Bit Streaming Note: all the structures from this, previous and future commits are from our WPP --- .../game/Server/Protocol/Handlers/GuildHandler.cpp | 22 +++++++++++++++++++--- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- 2 files changed, 20 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Handlers/GuildHandler.cpp b/src/server/game/Server/Protocol/Handlers/GuildHandler.cpp index 28d4292977b..e229da81719 100755 --- a/src/server/game/Server/Protocol/Handlers/GuildHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/GuildHandler.cpp @@ -125,12 +125,28 @@ void WorldSession::HandleGuildInfoOpcode(WorldPacket& /*recvPacket*/) guild->SendInfo(this); } -void WorldSession::HandleGuildRosterOpcode(WorldPacket& /*recvPacket*/) +void WorldSession::HandleGuildRosterOpcode(WorldPacket& recvPacket) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_ROSTER"); - if (Guild* guild = _GetPlayerGuild(this)) - guild->HandleRoster(this); + BitStream mask = recvPacket.ReadBitStream(8); + + ByteBuffer bytes(8, true); + + if (mask[0]) bytes[7] = recvPacket.ReadUInt8() ^ 1; + if (mask[5]) bytes[4] = recvPacket.ReadUInt8() ^ 1; + if (mask[4]) bytes[5] = recvPacket.ReadUInt8() ^ 1; + if (mask[7]) bytes[0] = recvPacket.ReadUInt8() ^ 1; + if (mask[3]) bytes[1] = recvPacket.ReadUInt8() ^ 1; + if (mask[2]) bytes[2] = recvPacket.ReadUInt8() ^ 1; + if (mask[1]) bytes[6] = recvPacket.ReadUInt8() ^ 1; + if (mask[6]) bytes[3] = recvPacket.ReadUInt8() ^ 1; + + uint64 guildGuid = BitConverter::ToUInt64(bytes); + + if (Guild* guild = sGuildMgr->GetGuildByGuid(guildGuid)) + if (guild->IsMember(GetPlayer()->GetGUID())) + guild->HandleRoster(this); } void WorldSession::HandleGuildPromoteOpcode(WorldPacket& recvPacket) diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index d63528adedb..14069a0910a 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -179,7 +179,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_GUILD_DECLINE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildInfoOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_ROSTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildRosterOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_ROSTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildRosterOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_ROSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_PROMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildPromoteOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_DEMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDemoteOpcode ); -- cgit v1.2.3 From 3698fc5a73189b241dd4d123b08aef500a3cfbf9 Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 22 Dec 2011 05:18:54 +0000 Subject: Core/Trainers: Fix and enable CMSG_TRAINER_BUY_SPELL --- src/server/game/Server/Protocol/Handlers/NPCHandler.cpp | 3 ++- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp b/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp index 27e569fe921..a1986bc352a 100755 --- a/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp @@ -238,8 +238,9 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket & recv_data) { uint64 guid; uint32 spellId = 0; + int32 unkInt; - recv_data >> guid >> spellId; + recv_data >> guid >> unkInt >> spellId; sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_TRAINER_BUY_SPELL NpcGUID=%u, learn spell id is: %u", uint32(GUID_LOPART(guid)), spellId); Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TRAINER); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 14069a0910a..9840aeffc55 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -496,7 +496,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_NEW_TAXI_PATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_TRAINER_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerListOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_TRAINER_BUY_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerBuySpellOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_TRAINER_BUY_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerBuySpellOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_SUCCEEDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_BINDER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBinderActivateOpcode ); -- cgit v1.2.3 From 788545cf95faca789fb4de2c59f8c911d83c8b83 Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 22 Dec 2011 05:40:35 +0000 Subject: Core/Protocol: Enable many CMSGs (structure verified for each one) --- src/server/game/Server/Protocol/Opcodes.cpp | 76 ++++++++++++++--------------- src/server/game/Server/Protocol/Opcodes.h | 2 +- 2 files changed, 39 insertions(+), 39 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 9840aeffc55..246621911ed 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -124,7 +124,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_LOGOUT_CANCEL_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNameQueryOpcode ); DEFINE_OPCODE_HANDLER(SMSG_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_PET_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetNameQuery ); + DEFINE_OPCODE_HANDLER(CMSG_PET_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetNameQuery ); //DEFINE_OPCODE_HANDLER(SMSG_PET_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_QUERY, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildQueryOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -233,8 +233,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_MODERATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DESTROY_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_USE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUseItemOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_OPEN_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleOpenItemOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_USE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUseItemOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_OPEN_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleOpenItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_READ_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReadItem ); //DEFINE_OPCODE_HANDLER(SMSG_READ_ITEM_OK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_READ_ITEM_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -319,14 +319,14 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_FLAG, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialFlag ); //DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_CLEAR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialClear ); //DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_RESET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialReset ); - //DEFINE_OPCODE_HANDLER(CMSG_STANDSTATECHANGE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStandStateChangeOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_STANDSTATECHANGE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStandStateChangeOpcode ); DEFINE_OPCODE_HANDLER(CMSG_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEmoteOpcode ); DEFINE_OPCODE_HANDLER(SMSG_EMOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_TEXT_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTextEmoteOpcode ); DEFINE_OPCODE_HANDLER(SMSG_TEXT_EMOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_AUTOEQUIP_GROUND_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_GROUND_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_LOOT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutostoreLootItemOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_LOOT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutostoreLootItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_STORE_LOOT_IN_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_AUTOEQUIP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoEquipItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_BAG_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoStoreBagItemOpcode ); @@ -346,7 +346,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleIgnoreTradeOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_ACCEPT_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAcceptTradeOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_UNACCEPT_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnacceptTradeOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_TRADE, STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelTradeOpcode); + DEFINE_OPCODE_HANDLER(CMSG_CANCEL_TRADE, STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelTradeOpcode); //DEFINE_OPCODE_HANDLER(CMSG_SET_TRADE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTradeItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_TRADE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleClearTradeItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SET_TRADE_GOLD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTradeGoldOpcode ); @@ -408,7 +408,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_BINDZONEREPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PLAYERBOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CLIENT_CONTROL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_REPOP_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepopRequestOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_REPOP_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepopRequestOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_RESURRECT_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_RESURRECT_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleResurrectResponseOpcode ); DEFINE_OPCODE_HANDLER(CMSG_LOOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootOpcode ); @@ -448,9 +448,9 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_NPC_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNpcTextQueryOpcode ); DEFINE_OPCODE_HANDLER(SMSG_NPC_TEXT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_NPC_WONT_TALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_STATUS_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleQuestgiverStatusQueryOpcode); + DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_STATUS_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleQuestgiverStatusQueryOpcode); //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverHelloOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverHelloOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_QUERY_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverQueryQuestOpcode); //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_QUEST_AUTOLAUNCH, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverQuestAutoLaunch ); @@ -458,15 +458,15 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_ACCEPT_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverAcceptQuestOpcode); DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_COMPLETE_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverCompleteQuest ); //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_REQUEST_ITEMS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_REQUEST_REWARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverRequestRewardOpcode); + DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_REQUEST_REWARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverRequestRewardOpcode); //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_OFFER_REWARD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_CHOOSE_REWARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverChooseRewardOpcode); + DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_CHOOSE_REWARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverChooseRewardOpcode); //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_INVALID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_CANCEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverCancel ); //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_QUESTLOG_SWAP_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestLogSwapQuest ); - //DEFINE_OPCODE_HANDLER(CMSG_QUESTLOG_REMOVE_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestLogRemoveQuest ); + DEFINE_OPCODE_HANDLER(CMSG_QUESTLOG_REMOVE_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestLogRemoveQuest ); //DEFINE_OPCODE_HANDLER(SMSG_QUESTLOG_FULL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_FAILEDTIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -475,10 +475,10 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_ADD_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_QUEST_CONFIRM_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestConfirmAccept ); //DEFINE_OPCODE_HANDLER(SMSG_QUEST_CONFIRM_ACCEPT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_PUSHQUESTTOPARTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePushQuestToParty ); + DEFINE_OPCODE_HANDLER(CMSG_PUSHQUESTTOPARTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePushQuestToParty ); DEFINE_OPCODE_HANDLER(CMSG_LIST_INVENTORY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleListInventoryOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_LIST_INVENTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_SELL_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSellItemOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_SELL_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSellItemOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_SELL_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_BUY_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_BUY_ITEM_IN_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyItemInSlotOpcode ); @@ -488,18 +488,18 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_TAXIENABLEALLNODES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_TAXISHOWNODES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_SHOWTAXINODES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_TAXINODE_STATUS_QUERY, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleTaxiNodeStatusQueryOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_TAXINODE_STATUS_QUERY, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleTaxiNodeStatusQueryOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_TAXINODE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_TAXIQUERYAVAILABLENODES, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleTaxiQueryAvailableNodes ); - //DEFINE_OPCODE_HANDLER(CMSG_ACTIVATETAXI, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleActivateTaxiOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_ACTIVATETAXI, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleActivateTaxiOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_ACTIVATETAXIREPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_NEW_TAXI_PATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_TRAINER_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerListOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_TRAINER_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerListOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_TRAINER_BUY_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerBuySpellOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_SUCCEEDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_BINDER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBinderActivateOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_BINDER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBinderActivateOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_PLAYERBINDERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_BANKER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBankerActivateOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_SHOW_BANK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -528,7 +528,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_QUERY_TIME_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LOG_XPGAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_AURACASTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_RECLAIM_CORPSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReclaimCorpseOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_RECLAIM_CORPSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReclaimCorpseOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_WRAP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWrapItemOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_LEVELUP_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(MSG_MINIMAP_PING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMinimapPingOpcode ); @@ -542,10 +542,10 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_PONG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_PAGETEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_SETSHEATHED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleSetSheathedOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_SETSHEATHED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleSetSheathedOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_COOLDOWN_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELL_DELAYED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_QUEST_POI_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestPOIQuery ); + DEFINE_OPCODE_HANDLER(CMSG_QUEST_POI_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestPOIQuery ); //DEFINE_OPCODE_HANDLER(SMSG_QUEST_POI_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GHOST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GM_INVIS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -591,7 +591,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_CHANGEPLAYER_DIFFICULTY_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GM_TEACH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GM_CREATE_ITEM_TARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_GETTICKET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketGetTicketOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_GETTICKET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketGetTicketOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_GETTICKET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_TALENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_SPAWN_ANIM_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -634,7 +634,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_SEND_MAIL_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GET_MAIL_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGetMailList ); //DEFINE_OPCODE_HANDLER(SMSG_MAIL_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlefieldListOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlefieldListOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_JOIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_FORCE_SET_VEHICLE_REC_ID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -644,7 +644,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_ITEM_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemTextQuery ); //DEFINE_OPCODE_HANDLER(SMSG_ITEM_TEXT_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_MAIL_TAKE_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailTakeMoney ); - //DEFINE_OPCODE_HANDLER(CMSG_MAIL_TAKE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailTakeItem ); + DEFINE_OPCODE_HANDLER(CMSG_MAIL_TAKE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailTakeItem ); //DEFINE_OPCODE_HANDLER(CMSG_MAIL_MARK_AS_READ, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailMarkAsRead ); //DEFINE_OPCODE_HANDLER(CMSG_MAIL_RETURN_TO_SENDER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailReturnToSender ); //DEFINE_OPCODE_HANDLER(CMSG_MAIL_DELETE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailDelete ); @@ -694,17 +694,17 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(MSG_QUEST_PUSH_RESULT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestPushResult ); //DEFINE_OPCODE_HANDLER(SMSG_PLAY_MUSIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PLAY_OBJECT_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PET_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestPetInfoOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PET_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestPetInfoOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_FAR_SIGHT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleFarSightOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_SPELLDISPELLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DAMAGE_CALC_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_ENABLE_DAMAGE_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GROUP_CHANGE_SUB_GROUP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupChangeSubGroupOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PARTY_MEMBER_STATS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestPartyMemberStatsOpcode); + DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PARTY_MEMBER_STATS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestPartyMemberStatsOpcode); DEFINE_OPCODE_HANDLER(CMSG_GROUP_SWAP_SUB_GROUP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupSwapSubGroupOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_RESET_FACTION_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_BANK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoStoreBankItemOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_AUTOBANK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoBankItemOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_AUTOBANK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoBankItemOpcode ); DEFINE_OPCODE_HANDLER(MSG_QUERY_NEXT_MAIL_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryNextMailTime ); //DEFINE_OPCODE_HANDLER(SMSG_RECEIVED_MAIL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_RAID_GROUP_ONLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -717,7 +717,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_REMOVED_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_RAID_CONVERT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupRaidConvertOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_ASSISTANT_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupAssistantLeaderOpcode); - //DEFINE_OPCODE_HANDLER(CMSG_BUYBACK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuybackItem ); + DEFINE_OPCODE_HANDLER(CMSG_BUYBACK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuybackItem ); DEFINE_OPCODE_HANDLER(SMSG_SERVER_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SET_SAVED_INSTANCE_EXTEND, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_OFFER_CONTINUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -742,7 +742,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_SET_FORCED_REACTIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPELL_FAILED_OTHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_RESET_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_REPAIR_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepairItemOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_REPAIR_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepairItemOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_CHAT_PLAYER_NOT_FOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(MSG_TALENT_WIPE_CONFIRM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTalentWipeConfirmOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_SUMMON_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -848,7 +848,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_GM_NUKE_ACCOUNT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_GM_DESTROY_CORPSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GM_DESTROY_ONLINE_CORPSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_ACTIVATETAXIEXPRESS, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleActivateTaxiExpressOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_ACTIVATETAXIEXPRESS, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleActivateTaxiExpressOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_SET_FACTION_ATWAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GAMETIMEBIAS_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_ACTIONS_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -905,9 +905,9 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_CREATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamQueryOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamQueryOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_ROSTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamRosterOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_ROSTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamRosterOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_ROSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamInviteOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -942,12 +942,12 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_LFG_BOOT_PROPOSAL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_LFD_PLAYER_LOCK_INFO_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgPlayerLockInfoRequestOpcode); //DEFINE_OPCODE_HANDLER(SMSG_LFG_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_LFG_TELEPORT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgTeleportOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_LFG_TELEPORT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgTeleportOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LFD_PARTY_LOCK_INFO_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgPartyLockInfoRequestOpcode); //DEFINE_OPCODE_HANDLER(SMSG_LFG_PARTY_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TITLE_EARNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_SET_TITLE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTitleOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_MOUNT_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelMountAuraOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_CANCEL_MOUNT_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelMountAuraOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_ARENA_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(MSG_INSPECT_ARENA_TEAMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectArenaTeamsOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_DEATH_RELEASE_LOC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1087,7 +1087,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(MSG_GUILD_BANK_MONEY_WITHDRAWN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankMoneyWithdrawn ); //DEFINE_OPCODE_HANDLER(MSG_GUILD_EVENT_LOG_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildEventLogQueryOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_MAELSTROM_RENAME_GUILD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GET_MIRRORIMAGE_DATA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMirrorImageDataRequest ); + DEFINE_OPCODE_HANDLER(CMSG_GET_MIRRORIMAGE_DATA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMirrorImageDataRequest ); //DEFINE_OPCODE_HANDLER(SMSG_MIRRORIMAGE_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_FORCE_DISPLAY_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELL_CHANCE_RESIST_PUSHBACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1109,7 +1109,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_TOTEM_DESTROYED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTotemDestroyed ); //DEFINE_OPCODE_HANDLER(CMSG_EXPIRE_RAID_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_NO_SPELL_VARIANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverStatusMultipleQuery); + DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverStatusMultipleQuery); //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_STATUS_MULTIPLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SET_PLAYER_DECLINED_NAMES, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetPlayerDeclinedNames ); //DEFINE_OPCODE_HANDLER(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1265,7 +1265,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_SET_ARENA_MEMBER_WEEKLY_GAMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_ARENA_MEMBER_SEASON_GAMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_ITEM_REFUND_INFO_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_ITEM_REFUND_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemRefundInfoRequest ); + DEFINE_OPCODE_HANDLER(CMSG_ITEM_REFUND_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemRefundInfoRequest ); //DEFINE_OPCODE_HANDLER(CMSG_ITEM_REFUND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemRefund ); //DEFINE_OPCODE_HANDLER(SMSG_ITEM_REFUND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_CORPSE_MAP_POSITION_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCorpseMapPositionQuery ); @@ -1360,7 +1360,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_SUSPEND_COMMS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SUSPEND_COMMS_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_FORCE_SEND_QUEUED_PACKETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_REDIRECTION_AUTH_PROOF, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_REDIRECTION_AUTH_PROOF, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_DROP_NEW_CONNECTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_SEND_ALL_COMBAT_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_OPEN_LFG_DUNGEON_FINDER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index ab877abdf65..fde0264bdd7 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -65,7 +65,7 @@ enum Opcodes CMSG_AUTOEQUIP_ITEM = 0x8E66, CMSG_AUTOEQUIP_ITEM_SLOT = 0x00, CMSG_AUTO_DECLINE_GUILD_INVITES = 0x586F, - CMSG_BATTLEFIELD_LIST = 0x32A4, // New 4.x + CMSG_BATTLEFIELD_LIST = 0x32A4, CMSG_AUTOSTORE_BAG_ITEM = 0x0EEE, CMSG_AUTOSTORE_BANK_ITEM = 0x1C5F, CMSG_AUTOSTORE_GROUND_ITEM = 0x00, -- cgit v1.2.3 From 49f32ae6a8f229dc9ee848eae62cddf2d4b6f9ef Mon Sep 17 00:00:00 2001 From: weclub Date: Thu, 22 Dec 2011 14:07:13 +0000 Subject: Core/Protocol: Enable 2 SMSGs Closes #4388, #4389 --- src/server/game/Server/Protocol/Opcodes.cpp | 4 ++-- src/server/game/Server/Protocol/Opcodes.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 246621911ed..42efc28b06b 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -107,7 +107,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_NEW_WORLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TRANSFER_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TRANSFER_ABORTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHARACTER_LOGIN_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CHARACTER_LOGIN_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOGIN_SETTIMESPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GAMETIME_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GAMETIME_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -610,7 +610,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_XP_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_SPIRIT_HEALER_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_CHARACTER_POINT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_GOSSIP_POI, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GOSSIP_POI, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_CHAT_IGNORED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChatIgnoredOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GM_VISION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SERVER_COMMAND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index fde0264bdd7..d9f0d36a95f 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -616,7 +616,7 @@ enum Opcodes SMSG_CHAR_CREATE = 0x4C5B, SMSG_CHAR_DELETE = 0x48CE, SMSG_CHAR_ENUM = 0xA05C, - SMSG_CHARACTER_LOGIN_FAILED = 0x00, + SMSG_CHARACTER_LOGIN_FAILED = 0x4AE6, SMSG_CHAR_RENAME = 0x5EF6, SMSG_CHAR_CUSTOMIZE = 0x0AE3, SMSG_CHAR_FACTION_CHANGE = 0x885A, @@ -814,7 +814,7 @@ enum Opcodes SMSG_MEETINGSTONE_MEMBER_ADDED = 0x00, SMSG_MEETINGSTONE_SETQUEUE = 0x00, SMSG_MESSAGECHAT = 0x5E52, - SMSG_MIRRORIMAGE_DATA = 0x00, + SMSG_MIRRORIMAGE_DATA = 0x8AFB, SMSG_MODIFY_COOLDOWN = 0x00, SMSG_MONSTER_MOVE = 0x4C53, SMSG_MONSTER_MOVE_TRANSPORT = 0x88FB, @@ -1016,7 +1016,7 @@ enum Opcodes SMSG_USERLIST_ADD = 0x4CEE, SMSG_USERLIST_REMOVE = 0x9A6B, SMSG_USERLIST_UPDATE = 0x4A4B, - SMSG_VOICE_CHAT_STATUS = 0x00, + SMSG_VOICE_CHAT_STATUS = 0x9ADF, SMSG_VOICE_PARENTAL_CONTROLS = 0x00, SMSG_VOICE_SESSION_LEAVE = 0x00, SMSG_VOICE_SESSION_ROSTER_UPDATE = 0x00, -- cgit v1.2.3 From 3310bd0c407ae30d4bd9c31ac550db8693af6c04 Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 22 Dec 2011 14:47:07 +0000 Subject: Core/Protocol: Enable more CMSGs --- src/server/game/Server/Protocol/Opcodes.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 42efc28b06b..48154137099 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -628,7 +628,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_GUILD_DEL_RANK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDelRankOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_SET_PUBLIC_NOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildSetPublicNoteOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_SET_OFFICER_NOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildSetOfficerNoteOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_LOGIN_VERIFY_WORLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOGIN_VERIFY_WORLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_EXPLORATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SEND_MAIL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSendMail ); //DEFINE_OPCODE_HANDLER(SMSG_SEND_MAIL_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -647,7 +647,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_MAIL_TAKE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailTakeItem ); //DEFINE_OPCODE_HANDLER(CMSG_MAIL_MARK_AS_READ, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailMarkAsRead ); //DEFINE_OPCODE_HANDLER(CMSG_MAIL_RETURN_TO_SENDER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailReturnToSender ); - //DEFINE_OPCODE_HANDLER(CMSG_MAIL_DELETE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailDelete ); + DEFINE_OPCODE_HANDLER(CMSG_MAIL_DELETE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailDelete ); //DEFINE_OPCODE_HANDLER(CMSG_MAIL_CREATE_TEXT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailCreateTextItem ); DEFINE_OPCODE_HANDLER(SMSG_SPELLLOGMISS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPELLLOGEXECUTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -674,7 +674,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_COMBAT_EVENT_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DISPEL_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELLORDAMAGE_IMMUNE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_BIDDER_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListBidderItems ); + DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_BIDDER_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListBidderItems ); //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_BIDDER_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SET_FLAT_SPELL_MODIFIER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SET_PCT_SPELL_MODIFIER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -703,7 +703,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PARTY_MEMBER_STATS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestPartyMemberStatsOpcode); DEFINE_OPCODE_HANDLER(CMSG_GROUP_SWAP_SUB_GROUP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupSwapSubGroupOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_RESET_FACTION_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_BANK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoStoreBankItemOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_BANK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoStoreBankItemOpcode ); DEFINE_OPCODE_HANDLER(CMSG_AUTOBANK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoBankItemOpcode ); DEFINE_OPCODE_HANDLER(MSG_QUERY_NEXT_MAIL_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryNextMailTime ); //DEFINE_OPCODE_HANDLER(SMSG_RECEIVED_MAIL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -799,9 +799,9 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_FORCE_TURN_RATE_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_FORCE_TURN_RATE_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); //DEFINE_OPCODE_HANDLER(MSG_PVP_LOG_DATA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePVPLogDataOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_LEAVE_BATTLEFIELD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLeaveBattlefieldOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_AREA_SPIRIT_HEALER_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaSpiritHealerQueryOpcode); - //DEFINE_OPCODE_HANDLER(CMSG_AREA_SPIRIT_HEALER_QUEUE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaSpiritHealerQueueOpcode); + DEFINE_OPCODE_HANDLER(CMSG_LEAVE_BATTLEFIELD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLeaveBattlefieldOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_AREA_SPIRIT_HEALER_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaSpiritHealerQueryOpcode); + DEFINE_OPCODE_HANDLER(CMSG_AREA_SPIRIT_HEALER_QUEUE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaSpiritHealerQueueOpcode); //DEFINE_OPCODE_HANDLER(SMSG_AREA_SPIRIT_HEALER_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GM_UNTEACH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_WARDEN_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -936,7 +936,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_PARTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_SEARCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_ROLES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetRolesOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_ROLES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetRolesOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_NEEDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_BOOT_VOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetBootVoteOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_BOOT_PROPOSAL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1060,10 +1060,10 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_VOICE_CHAT_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_REPORT_PVP_AFK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReportPvPAFK ); //DEFINE_OPCODE_HANDLER(SMSG_REPORT_PVP_AFK_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANKER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankerActivate ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANKER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankerActivate ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_QUERY_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankQueryTab ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_SWAP_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankSwapItems ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_SWAP_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankSwapItems ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_BUY_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankBuyTab ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_UPDATE_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankUpdateTab ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_DEPOSIT_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankDepositMoney ); @@ -1171,7 +1171,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_DANCE_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_INVALIDATE_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_DELETE_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_LEARNED_DANCE_MOVES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LEARNED_DANCE_MOVES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_LEARN_DANCE_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_DANCE_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_RUNE_COUNT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); -- cgit v1.2.3 From 304fa1d53f91561a867bd0f68981fd0fbbbae1c4 Mon Sep 17 00:00:00 2001 From: weclub Date: Thu, 22 Dec 2011 15:00:06 +0000 Subject: Core/Quest: Fix SMSG_QUESTGIVER_STATUS(_MULTIPLE) Closes #4437 --- src/server/game/Entities/Creature/GossipDef.cpp | 6 +++--- src/server/game/Entities/Creature/GossipDef.h | 2 +- src/server/game/Quests/QuestDef.h | 23 +++++++++++----------- .../game/Server/Protocol/Handlers/QuestHandler.cpp | 14 ++++++------- src/server/game/Server/Protocol/Opcodes.cpp | 4 ++-- src/server/game/Server/Protocol/Opcodes.h | 7 ++++--- 6 files changed, 29 insertions(+), 27 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Creature/GossipDef.cpp b/src/server/game/Entities/Creature/GossipDef.cpp index 4aa7afe695c..d94a628b951 100755 --- a/src/server/game/Entities/Creature/GossipDef.cpp +++ b/src/server/game/Entities/Creature/GossipDef.cpp @@ -284,11 +284,11 @@ void PlayerMenu::SendQuestGiverQuestList(QEmote eEmote, const std::string& Title sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_QUEST_LIST NPC Guid=%u", GUID_LOPART(npcGUID)); } -void PlayerMenu::SendQuestGiverStatus(uint8 questStatus, uint64 npcGUID) const +void PlayerMenu::SendQuestGiverStatus(uint32 questStatus, uint64 npcGUID) const { - WorldPacket data(SMSG_QUESTGIVER_STATUS, 9); + WorldPacket data(SMSG_QUESTGIVER_STATUS, 8 + 4); data << uint64(npcGUID); - data << uint8(questStatus); + data << uint32(questStatus); _session->SendPacket(&data); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_STATUS NPC Guid=%u, status=%u", GUID_LOPART(npcGUID), questStatus); diff --git a/src/server/game/Entities/Creature/GossipDef.h b/src/server/game/Entities/Creature/GossipDef.h index 517395578cf..7b2e9429706 100755 --- a/src/server/game/Entities/Creature/GossipDef.h +++ b/src/server/game/Entities/Creature/GossipDef.h @@ -267,7 +267,7 @@ class PlayerMenu /*********************************************************/ /*** QUEST SYSTEM ***/ /*********************************************************/ - void SendQuestGiverStatus(uint8 questStatus, uint64 npcGUID) const; + void SendQuestGiverStatus(uint32 questStatus, uint64 npcGUID) const; void SendQuestGiverQuestList(QEmote eEmote, const std::string& Title, uint64 npcGUID); diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h index ec21239956a..79c8978b770 100755 --- a/src/server/game/Quests/QuestDef.h +++ b/src/server/game/Quests/QuestDef.h @@ -109,17 +109,18 @@ enum QuestStatus enum __QuestGiverStatus { - DIALOG_STATUS_NONE = 0, - DIALOG_STATUS_UNAVAILABLE = 1, - DIALOG_STATUS_LOW_LEVEL_AVAILABLE = 2, - DIALOG_STATUS_LOW_LEVEL_REWARD_REP = 3, - DIALOG_STATUS_LOW_LEVEL_AVAILABLE_REP = 4, - DIALOG_STATUS_INCOMPLETE = 5, - DIALOG_STATUS_REWARD_REP = 6, - DIALOG_STATUS_AVAILABLE_REP = 7, - DIALOG_STATUS_AVAILABLE = 8, - DIALOG_STATUS_REWARD2 = 9, // no yellow dot on minimap - DIALOG_STATUS_REWARD = 10 // yellow dot on minimap + DIALOG_STATUS_NONE = 0x000, + DIALOG_STATUS_UNK = 0x001, + DIALOG_STATUS_UNAVAILABLE = 0x002, + DIALOG_STATUS_LOW_LEVEL_AVAILABLE = 0x004, + DIALOG_STATUS_LOW_LEVEL_REWARD_REP = 0x008, + DIALOG_STATUS_LOW_LEVEL_AVAILABLE_REP = 0x010, + DIALOG_STATUS_INCOMPLETE = 0x020, + DIALOG_STATUS_REWARD_REP = 0x040, + DIALOG_STATUS_AVAILABLE_REP = 0x080, + DIALOG_STATUS_AVAILABLE = 0x100, + DIALOG_STATUS_REWARD2 = 0x200, // no yellow dot on minimap + DIALOG_STATUS_REWARD = 0x400 // yellow dot on minimap }; enum __QuestFlags diff --git a/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp b/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp index a50da77a067..95377d7ed8c 100755 --- a/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp @@ -37,8 +37,8 @@ void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket & recv_data) { uint64 guid; recv_data >> guid; - uint8 questStatus = DIALOG_STATUS_NONE; - uint8 defstatus = DIALOG_STATUS_NONE; + uint32 questStatus = DIALOG_STATUS_NONE; + uint32 defstatus = DIALOG_STATUS_NONE; Object* questgiver = ObjectAccessor::GetObjectByTypeMask(*_player, guid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT); if (!questgiver) @@ -730,13 +730,13 @@ void WorldSession::HandleQuestgiverStatusMultipleQuery(WorldPacket& /*recvPacket uint32 count = 0; - WorldPacket data(SMSG_QUESTGIVER_STATUS_MULTIPLE, 4); + WorldPacket data(SMSG_QUESTGIVER_STATUS_MULTIPLE, 4 + 8 + 4); data << uint32(count); // placeholder for (Player::ClientGUIDs::const_iterator itr = _player->m_clientGUIDs.begin(); itr != _player->m_clientGUIDs.end(); ++itr) { - uint8 questStatus = DIALOG_STATUS_NONE; - uint8 defstatus = DIALOG_STATUS_NONE; + uint32 questStatus = DIALOG_STATUS_NONE; + uint32 defstatus = DIALOG_STATUS_NONE; if (IS_CRE_OR_VEH_OR_PET_GUID(*itr)) { @@ -751,7 +751,7 @@ void WorldSession::HandleQuestgiverStatusMultipleQuery(WorldPacket& /*recvPacket questStatus = getDialogStatus(_player, questgiver, defstatus); data << uint64(questgiver->GetGUID()); - data << uint8(questStatus); + data << uint32(questStatus); ++count; } else if (IS_GAMEOBJECT_GUID(*itr)) @@ -766,7 +766,7 @@ void WorldSession::HandleQuestgiverStatusMultipleQuery(WorldPacket& /*recvPacket questStatus = getDialogStatus(_player, questgiver, defstatus); data << uint64(questgiver->GetGUID()); - data << uint8(questStatus); + data << uint32(questStatus); ++count; } } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 48154137099..384a1d13575 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -449,7 +449,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_NPC_TEXT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_NPC_WONT_TALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_STATUS_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleQuestgiverStatusQueryOpcode); - //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverHelloOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_QUERY_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverQueryQuestOpcode); @@ -1110,7 +1110,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_EXPIRE_RAID_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_NO_SPELL_VARIANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverStatusMultipleQuery); - //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_STATUS_MULTIPLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_STATUS_MULTIPLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SET_PLAYER_DECLINED_NAMES, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetPlayerDeclinedNames ); //DEFINE_OPCODE_HANDLER(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_QUERY_SERVER_BUCK_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index d9f0d36a95f..e7f8f26d471 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -61,6 +61,7 @@ enum Opcodes CMSG_AUCTION_REMOVE_ITEM = 0xCEC3, CMSG_AUCTION_SELL_ITEM = 0xCE6, CMSG_AUTH_SESSION = 0x1019, + CMSG_AUTOBANK_ITEM = 0x8C56, CMSG_AUTOEQUIP_GROUND_ITEM = 0x00, CMSG_AUTOEQUIP_ITEM = 0x8E66, CMSG_AUTOEQUIP_ITEM_SLOT = 0x00, @@ -77,7 +78,7 @@ enum Opcodes MSG_BATTLEGROUND_PLAYER_POSITIONS = 0x00, CMSG_BATTLEMASTER_JOIN_ARENA = 0x00, CMSG_BEGIN_TRADE = 0x00, - CMSG_BINDER_ACTIVATE = 0x00, + CMSG_BINDER_ACTIVATE = 0x58FB, CMSG_BOT_DETECTED2 = 0x00, CMSG_BUG = 0x1A77, CMSG_BUSY_TRADE = 0x00, @@ -343,7 +344,7 @@ enum Opcodes CMSG_QUESTGIVER_CANCEL = 0xC86A, CMSG_QUESTGIVER_CHOOSE_REWARD = 0x18F3, CMSG_QUESTGIVER_COMPLETE_QUEST = 0xCCE3, - CMSG_QUESTGIVER_HELLO = 0x00, + CMSG_QUESTGIVER_HELLO = 0xC86A, CMSG_QUESTGIVER_QUERY_QUEST = 0x8CE7, CMSG_QUESTGIVER_QUEST_AUTOLAUNCH = 0x00, CMSG_QUESTGIVER_REQUEST_REWARD = 0xD8E7, @@ -770,7 +771,7 @@ enum Opcodes SMSG_ITEM_TEXT_QUERY_RESPONSE = 0x00, SMSG_ITEM_TIME_UPDATE = 0x00, SMSG_JOINED_BATTLEGROUND_QUEUE = 0x00, - SMSG_LEARNED_DANCE_MOVES = 0x00, + SMSG_LEARNED_DANCE_MOVES = 0xE52, SMSG_LEARNED_SPELL = 0x00, SMSG_LEVELUP_INFO = 0x00, SMSG_LFG_DISABLED = 0x00, -- cgit v1.2.3 From 07293b55fc1f56c6e2fae59f4a49aa0fff30d162 Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 22 Dec 2011 15:13:22 +0000 Subject: Core/Protocol: Last group of "enable CMSGs", onto SMSGs now... --- src/server/game/Server/Protocol/Opcodes.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 384a1d13575..42d7085dd36 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -172,7 +172,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_PARTY_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(UMSG_UPDATE_GROUP_MEMBERS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_CREATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildCreateOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildInviteOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildInviteOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildAcceptOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDeclineOpcode ); @@ -186,7 +186,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_GUILD_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildLeaveOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_REMOVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildRemoveOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_DISBAND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDisbandOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildLeaderOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildLeaderOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_MOTD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildMOTDOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -507,16 +507,16 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_BUY_BANK_SLOT_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_PETITION_SHOWLIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionShowListOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_PETITION_SHOWLIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_PETITION_BUY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionBuyOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_PETITION_SHOW_SIGNATURES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionShowSignOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_PETITION_BUY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionBuyOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_PETITION_SHOW_SIGNATURES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionShowSignOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_PETITION_SHOW_SIGNATURES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_PETITION_SIGN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionSignOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_PETITION_SIGN_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(MSG_PETITION_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionDeclineOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_OFFER_PETITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleOfferPetitionOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_TURN_IN_PETITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTurnInPetitionOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_OFFER_PETITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleOfferPetitionOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_TURN_IN_PETITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTurnInPetitionOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_TURN_IN_PETITION_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_PETITION_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionQueryOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_PETITION_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionQueryOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_PETITION_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_FISH_NOT_HOOKED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_FISH_ESCAPED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -602,7 +602,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_CHAT_WRONG_FACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_SYSTEMSTATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketSystemStatusOpcode); //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_SYSTEMSTATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_SPIRIT_HEALER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSpiritHealerActivateOpcode); + DEFINE_OPCODE_HANDLER(CMSG_SPIRIT_HEALER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSpiritHealerActivateOpcode); //DEFINE_OPCODE_HANDLER(CMSG_SET_STAT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_QUEST_FORCE_REMOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SKILL_BUY_STEP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -648,7 +648,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_MAIL_MARK_AS_READ, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailMarkAsRead ); //DEFINE_OPCODE_HANDLER(CMSG_MAIL_RETURN_TO_SENDER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailReturnToSender ); DEFINE_OPCODE_HANDLER(CMSG_MAIL_DELETE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailDelete ); - //DEFINE_OPCODE_HANDLER(CMSG_MAIL_CREATE_TEXT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailCreateTextItem ); + DEFINE_OPCODE_HANDLER(CMSG_MAIL_CREATE_TEXT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailCreateTextItem ); DEFINE_OPCODE_HANDLER(SMSG_SPELLLOGMISS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPELLLOGEXECUTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DEBUGAURAPROC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1342,7 +1342,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_LOOT_SLOT_CHANGED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(UMSG_UPDATE_GROUP_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_READY_FOR_ACCOUNT_DATA_TIMES, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleReadyForAccountDataTimes ); - //DEFINE_OPCODE_HANDLER(CMSG_QUERY_QUESTS_COMPLETED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryQuestsCompleted ); + DEFINE_OPCODE_HANDLER(CMSG_QUERY_QUESTS_COMPLETED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryQuestsCompleted ); //DEFINE_OPCODE_HANDLER(SMSG_QUERY_QUESTS_COMPLETED_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_GM_REPORT_LAG, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReportLag ); //DEFINE_OPCODE_HANDLER(CMSG_AFK_MONITOR_INFO_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); -- cgit v1.2.3 From 090bb5a45e4b7608b57577c525a16416986a0b3e Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 22 Dec 2011 19:53:47 +0000 Subject: Core/Guild: Fix and enable SMSG_GUILD_QUERY_RESPONSE - Update GuildEvents for 4.x (by Spp) --- src/server/game/Guilds/Guild.cpp | 35 ++++++++++++++++--- src/server/game/Guilds/Guild.h | 53 +++++++++++++++++------------ src/server/game/Server/Protocol/Opcodes.cpp | 4 +-- 3 files changed, 65 insertions(+), 27 deletions(-) (limited to 'src') diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index e7374a273dc..3c040b91e38 100755 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -1227,10 +1227,11 @@ void Guild::HandleQuery(WorldSession* session) { WorldPacket data(SMSG_GUILD_QUERY_RESPONSE, 8 * 32 + 200); // Guess size - data << uint32(m_id); + data << uint64(GetGuid()); data << m_name; - for (uint8 i = 0 ; i < GUILD_RANKS_MAX_COUNT; ++i) // Alwayse show 10 ranks + // Rank name + for (uint8 i = 0; i < GUILD_RANKS_MAX_COUNT; ++i) // Always show 10 ranks { if (i < _GetRanksSize()) data << m_ranks[i].GetName(); @@ -1238,8 +1239,34 @@ void Guild::HandleQuery(WorldSession* session) data << uint8(0); // Empty string } + // Rank order of creation + for (uint8 i = 0; i < GUILD_RANKS_MAX_COUNT; ++i) + { + if (i < _GetRanksSize()) + data << uint32(i); + else + data << uint32(0); + } + + // Rank order of "importance" (sorting by rights) + Ranks ranks = m_ranks; + std::sort(ranks.begin(), ranks.end()); + Ranks::iterator it; + + for (uint8 i = 0; i < GUILD_RANKS_MAX_COUNT; ++i) + { + if (i < _GetRanksSize()) + { + it = std::find(ranks.begin(), ranks.end(), m_ranks[i]); + data << std::distance(ranks.begin(), it); + } + else + data << uint32(0); + } + m_emblemInfo.WritePacket(data); - data << uint32(0); // Something new in WotLK + + data << uint32(_GetRanksSize()); // Number of ranks used session->SendPacket(&data); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (SMSG_GUILD_QUERY_RESPONSE)"); @@ -2083,7 +2110,7 @@ bool Guild::AddMember(uint64 guid, uint8 rankId) uint32 lowguid = GUID_LOPART(guid); - // If rank was not passed, assing lowest possible rank + // If rank was not passed, assign lowest possible rank if (rankId == GUILD_RANK_NONE) rankId = _GetLowestRankId(); diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h index 2f89cb21f3e..94885af5d07 100755 --- a/src/server/game/Guilds/Guild.h +++ b/src/server/game/Guilds/Guild.h @@ -115,26 +115,33 @@ enum GuildCommandError enum GuildEvents { - GE_PROMOTION = 0x00, - GE_DEMOTION = 0x01, - GE_MOTD = 0x02, - GE_JOINED = 0x03, - GE_LEFT = 0x04, - GE_REMOVED = 0x05, - GE_LEADER_IS = 0x06, - GE_LEADER_CHANGED = 0x07, - GE_DISBANDED = 0x08, - GE_TABARDCHANGE = 0x09, - GE_UNK1 = 0x0A, // string, string EVENT_GUILD_ROSTER_UPDATE tab content change? - GE_UNK2 = 0x0B, // EVENT_GUILD_ROSTER_UPDATE - GE_SIGNED_ON = 0x0C, // ERR_FRIEND_ONLINE_SS - GE_SIGNED_OFF = 0x0D, // ERR_FRIEND_OFFLINE_S - GE_GUILDBANK_BAGSLOTS_CHANGED = 0x0E, // EVENT_GUILDBANK_BAGSLOTS_CHANGED - GE_GUILDBANK_TAB_PURCHASED = 0x0F, // EVENT_GUILDBANK_UPDATE_TABS - GE_UNK5 = 0x10, // EVENT_GUILDBANK_UPDATE_TABS - GE_GUILDBANK_MONEY_UPDATE = 0x11, // EVENT_GUILDBANK_UPDATE_MONEY, string 0000000000002710 is 1 gold - GE_GUILDBANK_MONEY_WITHDRAWN = 0x12, // MSG_GUILD_BANK_MONEY_WITHDRAWN - GE_GUILDBANK_TEXT_CHANGED = 0x13 // EVENT_GUILDBANK_TEXT_CHANGED + // TODO Verify this enum, it changed in 4.x + GE_PROMOTION = 1, + GE_DEMOTION = 2, + GE_MOTD = 3, + GE_JOINED = 4, + GE_LEFT = 5, + GE_REMOVED = 6, + GE_LEADER_IS = 7, + GE_LEADER_CHANGED = 8, + GE_DISBANDED = 9, + GE_TABARDCHANGE = 10, + GE_RANK_UPDATED = 11, + GE_RANK_CREATED = 12, + GE_RANK_DELETED = 13, + GE_RANK_ORDER_CHANGED = 14, + // Unk15 = 15, // At guild creation - Set founder + GE_SIGNED_ON = 16, + GE_SIGNED_OFF = 17, + GE_GUILDBANKBAGSLOTS_CHANGED = 18, + GE_BANK_TAB_PURCHASED = 19, + GE_BANK_TAB_UPDATED = 20, + GE_BANK_UPDATE_MONEY = 21, + + // To be found: + // GE_BANK_MONEY_WITHDRAWN = 19, + // GE_BANK_TEXT_CHANGED = 20, + // GE_UPDATE_ROSTER = 12, }; enum PetitionTurns @@ -409,7 +416,7 @@ private: uint32 m_nextGUID; }; - // Class incapsulating guild rank data + // Class encapsulating guild rank data class RankInfo { public: @@ -429,6 +436,9 @@ private: uint32 GetRights() const { return m_rights; } void SetRights(uint32 rights); + bool operator < (const RankInfo& rank) const { return m_rights > rank.GetRights(); } + bool operator == (const RankInfo& rank) const { return m_rights == rank.GetRights(); } + uint32 GetBankMoneyPerDay() const { return m_rankId == GR_GUILDMASTER ? GUILD_WITHDRAW_MONEY_UNLIMITED : m_bankMoneyPerDay; } void SetBankMoneyPerDay(uint32 money); @@ -590,6 +600,7 @@ public: // Getters uint32 GetId() const { return m_id; } + uint64 GetGuid() const { return MAKE_NEW_GUID(m_id, 0, HIGHGUID_GUILD); } uint64 GetLeaderGUID() const { return m_leaderGuid; } const std::string& GetName() const { return m_name; } const std::string& GetMOTD() const { return m_motd; } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 42d7085dd36..323901dc494 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -127,7 +127,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_PET_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetNameQuery ); //DEFINE_OPCODE_HANDLER(SMSG_PET_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_QUERY, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildQueryOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_ITEM_QUERY_SINGLE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleItemQuerySingleOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_ITEM_QUERY_MULTIPLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_ITEM_QUERY_SINGLE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -188,7 +188,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_GUILD_DISBAND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDisbandOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildLeaderOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_MOTD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildMOTDOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(UMSG_UPDATE_GUILD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_BATTLEGROUND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); -- cgit v1.2.3 From 94e85c34d3187de243984e46e1cc6d9ef3361529 Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 22 Dec 2011 21:21:41 +0000 Subject: Core/Spell: Enable and 'fix' SMSG_SET_PCT/FLAG_SPELL_MODIFIER --- src/server/game/Entities/Player/Player.cpp | 12 ++++++------ src/server/game/Server/Protocol/Opcodes.cpp | 4 ++-- src/server/game/Server/Protocol/Opcodes.h | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 67c301977fc..e1494a094c4 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -19730,29 +19730,29 @@ bool Player::IsAffectedBySpellmod(SpellInfo const* spellInfo, SpellModifier* mod void Player::AddSpellMod(SpellModifier* mod, bool apply) { sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Player::AddSpellMod %d", mod->spellId); - uint16 Opcode = (mod->type == SPELLMOD_FLAT) ? SMSG_SET_FLAT_SPELL_MODIFIER : SMSG_SET_PCT_SPELL_MODIFIER; + uint16 opcode = (mod->type == SPELLMOD_FLAT) ? SMSG_SET_FLAT_SPELL_MODIFIER : SMSG_SET_PCT_SPELL_MODIFIER; int i = 0; flag96 _mask = 0; for (int eff = 0; eff < 96; ++eff) { - if (eff != 0 && eff%32 == 0) + if (eff != 0 && eff % 32 == 0) _mask[i++] = 0; - _mask[i] = uint32(1) << (eff-(32*i)); + _mask[i] = uint32(1) << (eff - (32 * i)); if (mod->mask & _mask) { int32 val = 0; for (SpellModList::iterator itr = m_spellMods[mod->op].begin(); itr != m_spellMods[mod->op].end(); ++itr) - { if ((*itr)->type == mod->type && (*itr)->mask & _mask) val += (*itr)->value; - } val += apply ? mod->value : -(mod->value); - WorldPacket data(Opcodes(Opcode), (1+1+4)); + WorldPacket data(Opcodes(opcode), (1+1+4)); data << uint8(eff); data << uint8(mod->op); data << int32(val); + if (opcode == SMSG_SET_PCT_SPELL_MODIFIER) + data << uint8(0); // 4.x unk SendDirectMessage(&data); } } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 323901dc494..4bac2be777a 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -676,8 +676,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_SPELLORDAMAGE_IMMUNE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_BIDDER_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListBidderItems ); //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_BIDDER_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SET_FLAT_SPELL_MODIFIER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SET_PCT_SPELL_MODIFIER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SET_FLAT_SPELL_MODIFIER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SET_PCT_SPELL_MODIFIER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CORPSE_RECLAIM_DELAY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIVE_MOVER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActiveMoverOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_PET_CANCEL_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetCancelAuraOpcode ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index e7f8f26d471..d986eae76d6 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -943,9 +943,9 @@ enum Opcodes SMSG_SET_FACTION_ATWAR = 0x00, SMSG_SET_FACTION_STANDING = 0x00, SMSG_SET_FACTION_VISIBLE = 0x00, - SMSG_SET_FLAT_SPELL_MODIFIER = 0x00, + SMSG_SET_FLAT_SPELL_MODIFIER = 0x88D3, SMSG_SET_FORCED_REACTIONS = 0x00, - SMSG_SET_PCT_SPELL_MODIFIER = 0x00, + SMSG_SET_PCT_SPELL_MODIFIER = 0x98FE, SMSG_SET_PHASE_SHIFT = 0x204C, SMSG_SET_PLAYER_DECLINED_NAMES_RESULT = 0x0E67, SMSG_SET_PROFICIENCY = 0x00, -- cgit v1.2.3 From bdf64e8f96885026be5ba08332f1b3b0236c2902 Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 22 Dec 2011 22:09:33 +0000 Subject: Core/Quest: Enable and 'fix' SMSG_QUESTGIVER_REQUEST_ITEMS --- src/server/game/Entities/Creature/GossipDef.cpp | 26 ++++++++++++------------- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Creature/GossipDef.cpp b/src/server/game/Entities/Creature/GossipDef.cpp index d94a628b951..5f819914559 100755 --- a/src/server/game/Entities/Creature/GossipDef.cpp +++ b/src/server/game/Entities/Creature/GossipDef.cpp @@ -645,7 +645,7 @@ void PlayerMenu::SendQuestGiverRequestItems(Quest const* quest, uint64 npcGUID, data << questTitle; data << requestItemsText; - data << uint32(0x00); // unknown + data << uint32(0); // unknown if (canComplete) data << quest->GetCompleteEmote(); @@ -653,10 +653,7 @@ void PlayerMenu::SendQuestGiverRequestItems(Quest const* quest, uint64 npcGUID, data << quest->GetIncompleteEmote(); // Close Window after cancel - if (closeOnCancel) - data << uint32(0x01); - else - data << uint32(0x00); + data << uint32(closeOnCancel); data << uint32(quest->GetFlags()); // 3.3.3 questFlags data << uint32(quest->GetSuggestedPlayers()); // SuggestedGroupNum @@ -679,14 +676,17 @@ void PlayerMenu::SendQuestGiverRequestItems(Quest const* quest, uint64 npcGUID, data << uint32(0); } - if (!canComplete) - data << uint32(0x00); - else - data << uint32(0x03); - - data << uint32(0x04); - data << uint32(0x08); - data << uint32(0x10); + // if (!canComplete) + // data << uint32(0x00); + // else + // data << uint32(0x03); + + data << uint32(0x00); // Unk flags + data << uint32(0x00); // Unk flags + data << uint32(0x04); // Unk flags + data << uint32(0x08); // Unk flags + data << uint32(0x10); // Unk flags 4.x + data << uint32(0x40); // Unk flags 4.x _session->SendPacket(&data); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_REQUEST_ITEMS NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), quest->GetQuestId()); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 4bac2be777a..d5f267bf293 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -457,7 +457,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_DETAILS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_ACCEPT_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverAcceptQuestOpcode); DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_COMPLETE_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverCompleteQuest ); - //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_REQUEST_ITEMS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_REQUEST_ITEMS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_REQUEST_REWARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverRequestRewardOpcode); //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_OFFER_REWARD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_CHOOSE_REWARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverChooseRewardOpcode); -- cgit v1.2.3 From e2704d6abdb1e4fb4657a6ffca980e45727b4e89 Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 22 Dec 2011 22:21:48 +0000 Subject: Core/Loot: Enable and fix SMSG_LOOT_START_ROLL --- src/server/game/Groups/Group.cpp | 7 ++++--- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- src/server/game/Server/Protocol/Opcodes.h | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index 11175b13114..459cbc73623 100755 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -627,18 +627,19 @@ void Group::Disband(bool hideDestroy /* = false */) /*** LOOT SYSTEM ***/ /*********************************************************/ -void Group::SendLootStartRoll(uint32 CountDown, uint32 mapid, const Roll &r) +void Group::SendLootStartRoll(uint32 countDown, uint32 mapid, const Roll &r) { WorldPacket data(SMSG_LOOT_START_ROLL, (8+4+4+4+4+4+4+1)); data << uint64(r.itemGUID); // guid of rolled item data << uint32(mapid); // 3.3.3 mapid - data << uint32(r.totalPlayersRolling); // maybe the number of players rolling for it??? + data << uint32(r.itemSlot); // slot data << uint32(r.itemid); // the itemEntryId for the item that shall be rolled for data << uint32(r.itemRandomSuffix); // randomSuffix data << uint32(r.itemRandomPropId); // item random property ID data << uint32(r.itemCount); // items in stack - data << uint32(CountDown); // the countdown time to choose "need" or "greed" + data << uint32(countDown); // the countdown time to choose "need" or "greed" data << uint8(r.rollVoteMask); // roll type mask + data << uint8(r.totalPlayersRolling); // maybe the number of players rolling for it??? for (Roll::PlayerVote::const_iterator itr=r.playerVote.begin(); itr != r.playerVote.end(); ++itr) { diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index d5f267bf293..5b9eac05220 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -735,7 +735,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_LOOT_ALL_PASSED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOOT_ROLL_WON, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_LOOT_ROLL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootRoll ); - //DEFINE_OPCODE_HANDLER(SMSG_LOOT_START_ROLL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOOT_START_ROLL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOOT_ROLL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_LOOT_MASTER_GIVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMasterGiveOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_LOOT_MASTER_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index d986eae76d6..16983ee89fe 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -808,7 +808,7 @@ enum Opcodes SMSG_LOOT_ROLL = 0x00, SMSG_LOOT_ROLL_WON = 0x00, SMSG_LOOT_SLOT_CHANGED = 0x00, - SMSG_LOOT_START_ROLL = 0x00, + SMSG_LOOT_START_ROLL = 0xC8C2, SMSG_MAIL_LIST_RESULT = 0x00, SMSG_MEETINGSTONE_COMPLETE = 0x00, SMSG_MEETINGSTONE_IN_PROGRESS = 0x00, -- cgit v1.2.3 From f20c1fb112cada73a40945402c5c2cbd12db8f6a Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 22 Dec 2011 23:25:42 +0000 Subject: Core/Protocol: Enable a lot of SMSGs. Each one got verified... --- src/server/game/Server/Protocol/Opcodes.cpp | 114 ++++++++++++++-------------- src/server/game/Server/Protocol/Opcodes.h | 68 ++++++++--------- 2 files changed, 91 insertions(+), 91 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 5b9eac05220..7bc312a58a9 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -105,11 +105,11 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_PLAYER_LOGIN, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayerLoginOpcode ); DEFINE_OPCODE_HANDLER(CMSG_LOAD_SCREEN, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleLoadScreenOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_NEW_WORLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_TRANSFER_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TRANSFER_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TRANSFER_ABORTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CHARACTER_LOGIN_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LOGIN_SETTIMESPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GAMETIME_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOGIN_SETTIMESPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GAMETIME_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GAMETIME_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_GAMETIME_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GAMESPEED_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -121,11 +121,11 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_LOGOUT_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LOGOUT_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_LOGOUT_CANCEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLogoutCancelOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_LOGOUT_CANCEL_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOGOUT_CANCEL_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNameQueryOpcode ); DEFINE_OPCODE_HANDLER(SMSG_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_PET_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetNameQuery ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PET_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_QUERY, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildQueryOpcode ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_ITEM_QUERY_SINGLE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleItemQuerySingleOpcode ); @@ -146,7 +146,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_WHOIS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_CONTACT_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleContactListOpcode ); DEFINE_OPCODE_HANDLER(SMSG_CONTACT_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_FRIEND_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_FRIEND_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_ADD_FRIEND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddFriendOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_DEL_FRIEND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDelFriendOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SET_CONTACT_NOTES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetContactNotesOpcode ); @@ -217,7 +217,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_LEAVE_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLeaveChannel ); DEFINE_OPCODE_HANDLER(SMSG_CHANNEL_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelList ); - //DEFINE_OPCODE_HANDLER(SMSG_CHANNEL_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CHANNEL_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_PASSWORD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelPassword ); //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_SET_OWNER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelSetOwner ); //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_OWNER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelOwner ); @@ -232,11 +232,11 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_ANNOUNCEMENTS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelAnnouncements ); //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_MODERATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DESTROY_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_DESTROY_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_USE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUseItemOpcode ); DEFINE_OPCODE_HANDLER(CMSG_OPEN_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleOpenItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_READ_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReadItem ); - //DEFINE_OPCODE_HANDLER(SMSG_READ_ITEM_OK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_READ_ITEM_OK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_READ_ITEM_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ITEM_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJ_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGameObjectUseOpcode ); @@ -366,7 +366,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_NEW_SPELL_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_CAST_SPELL, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleCastSpellOpcode ); DEFINE_OPCODE_HANDLER(CMSG_CANCEL_CAST, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleCancelCastOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_CAST_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CAST_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPELL_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPELL_GO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPELL_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -407,7 +407,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_GETDEATHBINDZONE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_BINDZONEREPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PLAYERBOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CLIENT_CONTROL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CLIENT_CONTROL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_REPOP_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepopRequestOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_RESURRECT_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_RESURRECT_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleResurrectResponseOpcode ); @@ -415,12 +415,12 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_LOOT_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMoneyOpcode ); DEFINE_OPCODE_HANDLER(CMSG_LOOT_RELEASE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootReleaseOpcode ); DEFINE_OPCODE_HANDLER(SMSG_LOOT_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LOOT_RELEASE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LOOT_REMOVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LOOT_MONEY_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOOT_RELEASE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOOT_REMOVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOOT_MONEY_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOOT_ITEM_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LOOT_CLEAR_MONEY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ITEM_PUSH_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOOT_CLEAR_MONEY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ITEM_PUSH_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DUEL_REQUESTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DUEL_OUTOFBOUNDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DUEL_INBOUNDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -432,15 +432,15 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_DISMOUNTRESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_REMOVED_FROM_PVP_QUEUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_MOUNTSPECIAL_ANIM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMountSpecialAnimOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_MOUNTSPECIAL_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOUNTSPECIAL_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_TAME_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_PET_SET_ACTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetSetAction ); DEFINE_OPCODE_HANDLER(CMSG_PET_ACTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetAction ); //DEFINE_OPCODE_HANDLER(CMSG_PET_ABANDON, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetAbandon ); //DEFINE_OPCODE_HANDLER(CMSG_PET_RENAME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetRename ); //DEFINE_OPCODE_HANDLER(SMSG_PET_NAME_INVALID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_SPELLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PET_SPELLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PET_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_GOSSIP_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGossipHelloOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GOSSIP_SELECT_OPTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGossipSelectOptionOpcode ); DEFINE_OPCODE_HANDLER(SMSG_GOSSIP_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -451,7 +451,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_STATUS_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleQuestgiverStatusQueryOpcode); DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverHelloOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_QUERY_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverQueryQuestOpcode); //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_QUEST_AUTOLAUNCH, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverQuestAutoLaunch ); DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_DETAILS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -464,15 +464,15 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_INVALID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_CANCEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverCancel ); //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_QUESTLOG_SWAP_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestLogSwapQuest ); DEFINE_OPCODE_HANDLER(CMSG_QUESTLOG_REMOVE_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestLogRemoveQuest ); - //DEFINE_OPCODE_HANDLER(SMSG_QUESTLOG_FULL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUESTLOG_FULL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_FAILEDTIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_ADD_KILL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_ADD_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_ADD_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_QUEST_CONFIRM_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestConfirmAccept ); //DEFINE_OPCODE_HANDLER(SMSG_QUEST_CONFIRM_ACCEPT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_PUSHQUESTTOPARTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePushQuestToParty ); @@ -489,11 +489,11 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_TAXISHOWNODES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_SHOWTAXINODES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_TAXINODE_STATUS_QUERY, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleTaxiNodeStatusQueryOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_TAXINODE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TAXINODE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_TAXIQUERYAVAILABLENODES, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleTaxiQueryAvailableNodes ); DEFINE_OPCODE_HANDLER(CMSG_ACTIVATETAXI, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleActivateTaxiOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_ACTIVATETAXIREPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_NEW_TAXI_PATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ACTIVATETAXIREPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_NEW_TAXI_PATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_TRAINER_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerListOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_TRAINER_BUY_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerBuySpellOpcode ); @@ -506,7 +506,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_BUY_BANK_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyBankSlotOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_BUY_BANK_SLOT_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_PETITION_SHOWLIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionShowListOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_PETITION_SHOWLIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PETITION_SHOWLIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_PETITION_BUY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionBuyOpcode ); DEFINE_OPCODE_HANDLER(CMSG_PETITION_SHOW_SIGNATURES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionShowSignOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_PETITION_SHOW_SIGNATURES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -518,14 +518,14 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_TURN_IN_PETITION_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_PETITION_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionQueryOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_PETITION_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_FISH_NOT_HOOKED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_FISH_ESCAPED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_FISH_NOT_HOOKED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_FISH_ESCAPED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_BUG, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBugOpcode ); DEFINE_OPCODE_HANDLER(SMSG_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_PLAYED_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayedTime ); - //DEFINE_OPCODE_HANDLER(SMSG_PLAYED_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PLAYED_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_QUERY_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryTimeOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_QUERY_TIME_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUERY_TIME_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LOG_XPGAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_AURACASTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_RECLAIM_CORPSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReclaimCorpseOpcode ); @@ -546,10 +546,10 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_COOLDOWN_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELL_DELAYED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_QUEST_POI_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestPOIQuery ); - //DEFINE_OPCODE_HANDLER(SMSG_QUEST_POI_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUEST_POI_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GHOST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GM_INVIS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_INVALID_PROMOTION_CODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_INVALID_PROMOTION_CODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(MSG_GM_BIND_OTHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_GM_SUMMON, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_ITEM_TIME_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -601,7 +601,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_DELETETICKET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHAT_WRONG_FACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_SYSTEMSTATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketSystemStatusOpcode); - //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_SYSTEMSTATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_SYSTEMSTATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_SPIRIT_HEALER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSpiritHealerActivateOpcode); //DEFINE_OPCODE_HANDLER(CMSG_SET_STAT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_QUEST_FORCE_REMOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -666,7 +666,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_OWNER_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListOwnerItems ); //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_PLACE_BID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionPlaceBid ); //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_AUCTION_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_OWNER_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_BIDDER_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_OWNER_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -706,7 +706,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_BANK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoStoreBankItemOpcode ); DEFINE_OPCODE_HANDLER(CMSG_AUTOBANK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoBankItemOpcode ); DEFINE_OPCODE_HANDLER(MSG_QUERY_NEXT_MAIL_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryNextMailTime ); - //DEFINE_OPCODE_HANDLER(SMSG_RECEIVED_MAIL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_RECEIVED_MAIL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_RAID_GROUP_ONLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SET_DURABILITY_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_PVP_RANK_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -730,13 +730,13 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_MEMBER_ADDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHAT_NOT_IN_PARTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_GROWTH_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelGrowthAuraOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_CANCEL_AUTO_REPEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_STANDSTATE_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LOOT_ALL_PASSED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CANCEL_AUTO_REPEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_STANDSTATE_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOOT_ALL_PASSED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOOT_ROLL_WON, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_LOOT_ROLL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootRoll ); DEFINE_OPCODE_HANDLER(SMSG_LOOT_START_ROLL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LOOT_ROLL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOOT_ROLL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_LOOT_MASTER_GIVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMasterGiveOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_LOOT_MASTER_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SET_FORCED_REACTIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -768,7 +768,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIONBAR_TOGGLES, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActionBarToggles ); //DEFINE_OPCODE_HANDLER(UMSG_DELETE_GUILD_CHARTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_PETITION_RENAME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionRenameOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_INIT_WORLD_STATES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_INIT_WORLD_STATES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_WORLD_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_ITEM_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemNameQueryOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_ITEM_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -777,7 +777,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_CHAR_RENAME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SPLINE_DONE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveSplineDoneOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FALL_RESET, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_SAVE_CREATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_SAVE_CREATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_RAID_INSTANCE_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RAID_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestRaidInfoOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_TIME_SKIPPED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleMoveTimeSkippedOpcode ); @@ -824,7 +824,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_MINIGAME_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_MINIGAME_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_MINIGAME_MOVE_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RAID_INSTANCE_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_RAID_INSTANCE_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_MOVES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_INFO_TEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildChangeInfoTextOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_CHAT_RESTRICTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -860,14 +860,14 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_SET_EXPLORATION_ALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_INVALIDATE_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_RESET_INSTANCES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleResetInstancesOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_RESET_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_LAST_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(MSG_RAID_TARGET_UPDATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidTargetUpdateOpcode ); //DEFINE_OPCODE_HANDLER(MSG_RAID_READY_CHECK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidReadyCheckOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LUA_USAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_ACTION_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_DISMISS_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PET_ACTION_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PET_DISMISS_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GHOSTEE_GONE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GM_UPDATE_TICKET_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_GM_TICKET_STATUS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -888,7 +888,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_LOTTERY_RESULT_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHARACTER_PROFILE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHARACTER_PROFILE_REALM_CONNECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DEFENSE_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_DEFENSE_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_DIFFICULTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(MSG_GM_RESETINSTANCELIMIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(SMSG_MOTD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -906,7 +906,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamQueryOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_ROSTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamRosterOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_ROSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamInviteOpcode ); @@ -921,7 +921,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_JOIN_ARENA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlemasterJoinArena ); DEFINE_OPCODE_HANDLER(MSG_MOVE_START_ASCEND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_ASCEND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_LFG_JOIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgJoinOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LFG_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgLeaveOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SEARCH_LFG_JOIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfrSearchOpcode ); @@ -966,7 +966,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_MAELSTROM_INVALIDATE_CACHE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_FLIGHT_SPLINE_SYNC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_FLIGHT_SPLINE_SYNC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SET_TAXI_BENCHMARK_MODE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTaxiBenchmarkOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_JOINED_BATTLEGROUND_QUEUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_REALM_SPLIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1002,7 +1002,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_IGNORE_REQUIREMENTS_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELL_CHANCE_PROC_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_DISMOUNT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_DISMOUNT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_RAID_READY_CHECK_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_VOICE_SESSION_ENABLE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleVoiceSessionEnableOpcode ); @@ -1062,7 +1062,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_REPORT_PVP_AFK_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANKER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankerActivate ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_QUERY_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankQueryTab ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_SWAP_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankSwapItems ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_BUY_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankBuyTab ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_UPDATE_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankUpdateTab ); @@ -1079,7 +1079,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_ECHO_PARTY_SQUELCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SET_TITLE_SUFFIX, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_SPELLCLICK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSpellClick ); - //DEFINE_OPCODE_HANDLER(SMSG_LOOT_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOOT_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GM_CHARACTER_RESTORE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GM_CHARACTER_SAVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_VOICESESSION_FULL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1239,7 +1239,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_AURA_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_FLOOD_GRACE_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_SERVER_FIRST_ACHIEVEMENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_LEARNED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PET_LEARNED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_REMOVED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); //DEFINE_OPCODE_HANDLER(CMSG_HEARTH_AND_RESURRECT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleHearthAndResurrect ); @@ -1274,7 +1274,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_UNUSED6, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_SIGNUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_CLEAR_PENDING_ACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_EQUIPMENT_SET_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_EQUIPMENT_SET_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_EQUIPMENT_SET_SAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetSave ); //DEFINE_OPCODE_HANDLER(CMSG_UPDATE_PROJECTILE_POSITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateProjectilePosition ); //DEFINE_OPCODE_HANDLER(SMSG_SET_PROJECTILE_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1339,7 +1339,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_TALENTS_INVOLUNTARILY_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_SERVER_GEO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_DEBUG_SERVER_GEO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LOOT_SLOT_CHANGED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOOT_SLOT_CHANGED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(UMSG_UPDATE_GROUP_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_READY_FOR_ACCOUNT_DATA_TIMES, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleReadyForAccountDataTimes ); DEFINE_OPCODE_HANDLER(CMSG_QUERY_QUESTS_COMPLETED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryQuestsCompleted ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 16983ee89fe..ca168aec5c0 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -557,9 +557,9 @@ enum Opcodes SMSG_ARENA_TEAM_COMMAND_RESULT = 0x00, SMSG_ARENA_TEAM_EVENT = 0x00, SMSG_ARENA_TEAM_INVITE = 0x00, - SMSG_ARENA_TEAM_QUERY_RESPONSE = 0x00, + SMSG_ARENA_TEAM_QUERY_RESPONSE = 0x8CCE, SMSG_ARENA_TEAM_ROSTER = 0x00, - SMSG_ARENA_TEAM_STATS = 0x00, + SMSG_ARENA_TEAM_STATS = 0xDEF2, SMSG_ATTACKERSTATEUPDATE = 0x00, SMSG_ATTACKSTART = 0xCA4A, SMSG_ATTACKSTOP = 0xCED7, @@ -571,7 +571,7 @@ enum Opcodes SMSG_AUCTION_BIDDER_NOTIFICATION = 0x00, SMSG_AUCTION_COMMAND_RESULT = 0x00, SMSG_AUCTION_LIST_PENDING_SALES = 0x00, - SMSG_AUCTION_LIST_RESULT = 0x00, + SMSG_AUCTION_LIST_RESULT = 0xDEDE, SMSG_AUCTION_OWNER_LIST_RESULT = 0x00, SMSG_AUCTION_OWNER_NOTIFICATION = 0x00, SMSG_AUCTION_REMOVED_NOTIFICATION = 0x00, @@ -610,8 +610,8 @@ enum Opcodes SMSG_CALENDAR_SEND_CALENDAR = 0x00, SMSG_CANCEL_AUTO_REPEAT = 0x5ACB, SMSG_CANCEL_COMBAT = 0x00, - SMSG_CAST_FAILED = 0x00, - SMSG_CHANNEL_LIST = 0x00, + SMSG_CAST_FAILED = 0x1AEB, + SMSG_CHANNEL_LIST = 0x9C47, SMSG_CHANNEL_MEMBER_COUNT = 0x00, SMSG_CHANNEL_NOTIFY = 0x9C7F, SMSG_CHAR_CREATE = 0x4C5B, @@ -655,7 +655,7 @@ enum Opcodes SMSG_DANCE_QUERY_RESPONSE = 0x00, SMSG_DB_REPLY = 0x76EC, SMSG_DEATH_RELEASE_LOC = 0x00, - SMSG_DEFENSE_MESSAGE = 0x00, + SMSG_DEFENSE_MESSAGE = 0x9EC3, SMSG_DESTROY_OBJECT = 0x486B, SMSG_DESTRUCTIBLE_BUILDING_DAMAGE = 0x00, SMSG_DUEL_OUTOFBOUNDS = 0x00, @@ -679,6 +679,7 @@ enum Opcodes SMSG_EXPECTED_SPAM_RECORDS = 0x00, SMSG_EXPLORATION_EXPERIENCE = 0x00, SMSG_FEATURE_SYSTEM_STATUS = 0x70CE, + SMSG_FLIGHT_SPLINE_SYNC = 0x1C63, SMSG_FISH_ESCAPED = 0x9C66, SMSG_FISH_NOT_HOOKED = 0x18C3, SMSG_FORCEACTIONSHOW = 0x00, @@ -696,7 +697,7 @@ enum Opcodes SMSG_FORCE_SWIM_SPEED_CHANGE = 0x00, SMSG_FORCE_SWIM_BACK_SPEED_CHANGE = 0x00, SMSG_FORCE_WALK_SPEED_CHANGE = 0x00, - SMSG_FRIEND_STATUS = 0x00, + SMSG_FRIEND_STATUS = 0xD852, SMSG_GAMEOBJECT_CUSTOM_ANIM = 0x00, SMSG_GAMEOBJECT_DESPAWN_ANIM = 0x0A5E, SMSG_GAMEOBJECT_PAGETEXT = 0x00, @@ -704,7 +705,7 @@ enum Opcodes SMSG_GAMEOBJECT_RESET_STATE = 0x00, SMSG_GAMESPEED_SET = 0x00, SMSG_GAMETIME_SET = 0x00, - SMSG_GAMETIME_UPDATE = 0x00, + SMSG_GAMETIME_UPDATE = 0x18E3, SMSG_GMRESPONSE_STATUS_UPDATE = 0x00, SMSG_GMRESPONSE_RECEIVED = 0x00, SMSG_GMTICKET_DELETETICKET = 0x00, @@ -753,9 +754,9 @@ enum Opcodes SMSG_INSPECT_TALENT = 0x00, SMSG_INSTANCE_DIFFICULTY = 0x00, SMSG_INSTANCE_LOCK_WARNING_QUERY = 0x00, - SMSG_INSTANCE_RESET = 0x00, + SMSG_INSTANCE_RESET = 0xDAC2, SMSG_INSTANCE_RESET_FAILED = 0x00, - SMSG_INSTANCE_SAVE_CREATED = 0x00, + SMSG_INSTANCE_SAVE_CREATED = 0xCE56, SMSG_INVALID_PROMOTION_CODE = 0xD8FE, SMSG_INVALIDATE_DANCE = 0x00, SMSG_INVALIDATE_PLAYER = 0x00, @@ -790,24 +791,24 @@ enum Opcodes SMSG_LFG_UPDATE_PARTY = 0x00, SMSG_LFG_UPDATE_PLAYER = 0x00, SMSG_LIST_INVENTORY = 0x264C, - SMSG_LOGIN_SETTIMESPEED = 0x00, + SMSG_LOGIN_SETTIMESPEED = 0x5ECA, SMSG_LOGIN_VERIFY_WORLD = 0xC86E, - SMSG_LOGOUT_CANCEL_ACK = 0x00, + SMSG_LOGOUT_CANCEL_ACK = 0xD8EF, SMSG_LOGOUT_COMPLETE = 0xCC6B, SMSG_LOGOUT_RESPONSE = 0x886A, SMSG_LOG_XPGAIN = 0x4E7E, - SMSG_LOOT_ALL_PASSED = 0x00, - SMSG_LOOT_CLEAR_MONEY = 0x00, + SMSG_LOOT_ALL_PASSED = 0x1C7A, + SMSG_LOOT_CLEAR_MONEY = 0x586E, SMSG_LOOT_ITEM_NOTIFY = 0x00, SMSG_LOOT_LIST = 0x8C5B, SMSG_LOOT_MASTER_LIST = 0x00, - SMSG_LOOT_MONEY_NOTIFY = 0x00, - SMSG_LOOT_RELEASE_RESPONSE = 0x00, - SMSG_LOOT_REMOVED = 0x00, + SMSG_LOOT_MONEY_NOTIFY = 0x0EF3, + SMSG_LOOT_RELEASE_RESPONSE = 0x88FF, + SMSG_LOOT_REMOVED = 0x8E6B, SMSG_LOOT_RESPONSE = 0x0842, - SMSG_LOOT_ROLL = 0x00, - SMSG_LOOT_ROLL_WON = 0x00, - SMSG_LOOT_SLOT_CHANGED = 0x00, + SMSG_LOOT_ROLL = 0x4C4F, + SMSG_LOOT_ROLL_WON = 0x5E4B, + SMSG_LOOT_SLOT_CHANGED = 0xDCDA, SMSG_LOOT_START_ROLL = 0xC8C2, SMSG_MAIL_LIST_RESULT = 0x00, SMSG_MEETINGSTONE_COMPLETE = 0x00, @@ -820,7 +821,7 @@ enum Opcodes SMSG_MONSTER_MOVE = 0x4C53, SMSG_MONSTER_MOVE_TRANSPORT = 0x88FB, SMSG_MOTD = 0xCA4B, - SMSG_MOUNTSPECIAL_ANIM = 0x00, + SMSG_MOUNTSPECIAL_ANIM = 0x9E77, SMSG_MOUNTRESULT = 0x00, SMSG_MOVE_FEATHER_FALL = 0x00, SMSG_MOVE_NORMAL_FALL = 0x00, @@ -856,16 +857,16 @@ enum Opcodes SMSG_PETGODMODE = 0x00, SMSG_PETITION_QUERY_RESPONSE = 0xCAEE, SMSG_PET_ACTION_FEEDBACK = 0x00, - SMSG_PET_ACTION_SOUND = 0x00, + SMSG_PET_ACTION_SOUND = 0x0CC7, SMSG_PET_CAST_FAILED = 0x00, SMSG_PET_DISMISS_SOUND = 0x00, SMSG_PET_GUIDS = 0x00, SMSG_PET_LEARNED_SPELL = 0xDC5E, - SMSG_PET_MODE = 0x00, + SMSG_PET_MODE = 0x58DE, SMSG_PET_NAME_QUERY_RESPONSE = 0xDCD3, SMSG_PET_NAME_INVALID = 0x00, SMSG_PET_REMOVED_SPELL = 0x18F6, - SMSG_PET_SPELLS = 0x00, + SMSG_PET_SPELLS = 0x5A43, SMSG_PET_TAME_FAILURE = 0x00, SMSG_PET_UPDATE_COMBO_POINTS = 0x00, SMSG_PETITION_SHOWLIST = 0x8ED7, @@ -894,7 +895,7 @@ enum Opcodes SMSG_PUREMOUNT_CANCELLED_OBSOLETE = 0x00, SMSG_PVP_CREDIT = 0x00, SMSG_QUERY_QUESTS_COMPLETED_RESPONSE = 0x00, - SMSG_QUERY_TIME_RESPONSE = 0x00, + SMSG_QUERY_TIME_RESPONSE = 0xD85A, SMSG_QUESTGIVER_OFFER_REWARD = 0x00, SMSG_QUESTGIVER_QUEST_COMPLETE = 0x24EE, SMSG_QUESTGIVER_QUEST_DETAILS = 0xCE5F, @@ -911,18 +912,18 @@ enum Opcodes SMSG_QUESTUPDATE_FAILEDTIMER = 0x00, SMSG_QUEST_CONFIRM_ACCEPT = 0x00, SMSG_QUEST_FORCE_REMOVED = 0x00, - SMSG_QUEST_POI_QUERY_RESPONSE = 0x00, + SMSG_QUEST_POI_QUERY_RESPONSE = 0x8CC3, SMSG_QUEST_QUERY_RESPONSE = 0x9E56, SMSG_QUESTGIVER_QUEST_INVALID = 0x00, - SMSG_QUESTUPDATE_ADD_ITEM_OBSOLETE = 0x00, + SMSG_QUESTUPDATE_ADD_ITEM = 0x9CCF, SMSG_RAID_GROUP_ONLY = 0x00, SMSG_RAID_INSTANCE_INFO = 0x00, - SMSG_RAID_INSTANCE_MESSAGE = 0x00, + SMSG_RAID_INSTANCE_MESSAGE = 0xD862, SMSG_READ_ITEM_FAILED = 0x00, - SMSG_READ_ITEM_OK = 0x00, + SMSG_READ_ITEM_OK = 0x9ECE, SMSG_REALM_SPLIT = 0x1AF2, SMSG_REAL_GROUP_UPDATE = 0x00, - SMSG_RECEIVED_MAIL = 0x00, + SMSG_RECEIVED_MAIL = 0xDEE2, SMSG_REDIRECT_CLIENT = 0x0180, SMSG_REFER_A_FRIEND_FAILURE = 0x4867, SMSG_REMOVED_SPELL = 0x00, @@ -934,7 +935,7 @@ enum Opcodes SMSG_RESURRECT_REQUEST = 0x00, SMSG_RESYNC_RUNES = 0x00, SMSG_RWHOIS = 0x00, - SMSG_SELL_ITEM = 0x00, + SMSG_SELL_ITEM = 0x9CD3, SMSG_SEND_MAIL_RESULT = 0x00, SMSG_SEND_UNLEARN_SPELLS = 0x00, SMSG_SERVERTIME = 0x00, @@ -996,8 +997,8 @@ enum Opcodes SMSG_TRADE_STATUS_EXTENDED = 0x00, SMSG_TRAINER_LIST = 0xC84E, SMSG_TRAINER_BUY_RESULT = 0x00, - SMSG_TRANSFER_ABORTED = 0x00, - SMSG_TRANSFER_PENDING = 0x00, + SMSG_TRANSFER_ABORTED = 0x0CF7, + SMSG_TRANSFER_PENDING = 0xCA6E, SMSG_TRIGGER_CINEMATIC = 0xCE5B, SMSG_TRIGGER_MOVIE = 0x00, SMSG_TURN_IN_PETITION_RESULTS = 0x08DB, @@ -1033,7 +1034,6 @@ enum Opcodes CMSG_VERIFY_CONNECTIVITY_RESPONSE = 0x4C52, //1280462679, // special opcode, client sends as uint32 SMSG_BATTLEFIELD_STATUS = 0x00, - SMSG_QUESTUPDATE_ADD_ITEM = 0x00, SMSG_OVERRIDE_LIGHT = 0x00, SMSG_RANDOMIZE_CHAR_NAME = 0xF0DC, // byte unk(0x80), string name -- cgit v1.2.3 From 8816b00be76b58213dcf940a1e016b335f3481ca Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 22 Dec 2011 23:38:46 +0000 Subject: Core/Protocol: Add missing opcode ids that got enabled previous commit Also, throw an error if opcode in handler is 0 --- src/server/game/Server/Protocol/Opcodes.cpp | 2 ++ src/server/game/Server/Protocol/Opcodes.h | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 7bc312a58a9..e01e02e69e9 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -30,6 +30,8 @@ void InitOpcodes() { #define DEFINE_OPCODE_HANDLER(opcode, status, processing, handler) \ + if (opcode == 0) \ + sLog->outError("Opcode %s got value 0", #opcode); \ if (opcode < NUM_OPCODE_HANDLERS) { \ if (opcodeTable[opcode] != NULL) \ { \ diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index ca168aec5c0..71aa69e5ea1 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -629,7 +629,7 @@ enum Opcodes SMSG_CLEAR_COOLDOWN = 0x00, SMSG_CLEAR_TARGET = 0x00, SMSG_CLIENTCACHE_VERSION = 0x88F2, - SMSG_CLIENT_CONTROL_UPDATE = 0x00, + SMSG_CLIENT_CONTROL_UPDATE = 0x08CB, SMSG_COMBAT_LOG_MULTIPLE = 0x00, SMSG_COMMENTATOR_MAP_INFO = 0x00, SMSG_COMMENTATOR_PLAYER_INFO = 0x00, @@ -859,7 +859,7 @@ enum Opcodes SMSG_PET_ACTION_FEEDBACK = 0x00, SMSG_PET_ACTION_SOUND = 0x0CC7, SMSG_PET_CAST_FAILED = 0x00, - SMSG_PET_DISMISS_SOUND = 0x00, + SMSG_PET_DISMISS_SOUND = 0x9A56, SMSG_PET_GUIDS = 0x00, SMSG_PET_LEARNED_SPELL = 0xDC5E, SMSG_PET_MODE = 0x58DE, @@ -873,7 +873,7 @@ enum Opcodes SMSG_PETITION_SHOW_SIGNATURES = 0x4E4A, SMSG_PETITION_SIGN_RESULTS = 0x5EE6, SMSG_PLAYER_MOVE = 0x00, - SMSG_PLAYED_TIME = 0x00, + SMSG_PLAYED_TIME = 0x187F, SMSG_PLAYERBINDERROR = 0x5A4F, SMSG_PLAYERBOUND = 0x00, SMSG_PLAYER_DIFFICULTY_CHANGE = 0x00, -- cgit v1.2.3 From 8bed4ce7a3638c822913ee7f52a5bf78dddde947 Mon Sep 17 00:00:00 2001 From: Shocker Date: Mon, 26 Dec 2011 04:44:22 +0200 Subject: Core/Achievements: Start implementing DBC achievement criteria conditions and remove db data and code for outdated DB achievement criteria datas --- ...11_12_26_00_world_achievement_criteria_data.sql | 3 + src/server/game/Achievements/AchievementMgr.cpp | 111 ++++++++++----------- src/server/game/Achievements/AchievementMgr.h | 31 +----- src/server/game/DataStores/DBCEnums.h | 99 +++++++++++++----- src/server/game/DataStores/DBCStructure.h | 4 +- 5 files changed, 136 insertions(+), 112 deletions(-) create mode 100644 sql/updates/world/4.x/2011_12_26_00_world_achievement_criteria_data.sql (limited to 'src') diff --git a/sql/updates/world/4.x/2011_12_26_00_world_achievement_criteria_data.sql b/sql/updates/world/4.x/2011_12_26_00_world_achievement_criteria_data.sql new file mode 100644 index 00000000000..0f2936634fb --- /dev/null +++ b/sql/updates/world/4.x/2011_12_26_00_world_achievement_criteria_data.sql @@ -0,0 +1,3 @@ +-- Remove unneeded achievement criteria datas for implemented DBC conditions: +-- TYPE_T_PLAYER_DEAD 4, TYPE_S_AREA 6, TYPE_MAP_DIFFICULTY 12, TYPE_MAP_ID 20 +DELETE FROM achievement_criteria_data WHERE `type` IN (4, 6, 12, 20); diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index abbf36f0c3d..8cf4d4efb59 100755 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -155,14 +155,6 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) return false; } return true; - case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_DEAD: - if (player_dead.own_team_flag > 1) - { - sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_DEAD (%u) has wrong boolean value1 (%u).", - criteria->ID, criteria->requiredType, dataType, player_dead.own_team_flag); - return false; - } - return true; case ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA: case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA: { @@ -187,14 +179,6 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) } return true; } - case ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AREA: - if (!GetAreaEntryByAreaID(area.id)) - { - sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AREA (%u) has wrong area id in value1 (%u), ignored.", - criteria->ID, criteria->requiredType, dataType, area.id); - return false; - } - return true; case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_LEVEL: if (level.minlevel > STRONG_MAX_LEVEL) { @@ -219,14 +203,6 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) return false; } return true; - case ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_DIFFICULTY: - if (difficulty.difficulty >= MAX_DIFFICULTY) - { - sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_DIFFICULTY (%u) has wrong difficulty in value1 (%u), ignored.", - criteria->ID, criteria->requiredType, dataType, difficulty.difficulty); - return false; - } - return true; case ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_PLAYER_COUNT: if (map_players.maxcount <= 0) { @@ -269,14 +245,6 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) return false; } return true; - case ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_ID: - if (!sMapStore.LookupEntry(map_id.mapId)) - { - sLog->outErrorDb("Table `achievement_criteria_requirement` (Entry: %u Type: %u) for requirement ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_ID (%u) has unknown map id in value1 (%u), ignored.", - criteria->ID, criteria->requiredType, dataType, map_id.mapId); - return false; - } - return true; default: sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) has data for non-supported data type (%u), ignored.", criteria->ID, criteria->requiredType, dataType); return false; @@ -305,21 +273,8 @@ bool AchievementCriteriaData::Meets(uint32 criteria_id, Player const* source, Un if (!target || target->GetTypeId() != TYPEID_PLAYER) return false; return !target->HealthAbovePct(health.percent); - case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_DEAD: - if (target && !target->isAlive()) - if (const Player* player = target->ToPlayer()) - if (player->GetDeathTimer() != 0) - // flag set == must be same team, not set == different team - return (player->GetTeam() == source->GetTeam()) == (player_dead.own_team_flag != 0); - return false; case ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA: return source->HasAuraEffect(aura.spell_id, aura.effect_idx); - case ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AREA: - { - uint32 zone_id, area_id; - source->GetZoneAndAreaId(zone_id, area_id); - return area.id == zone_id || area.id == area_id; - } case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA: return target && target->HasAuraEffect(aura.spell_id, aura.effect_idx); case ACHIEVEMENT_CRITERIA_DATA_TYPE_VALUE: @@ -334,11 +289,6 @@ bool AchievementCriteriaData::Meets(uint32 criteria_id, Player const* source, Un return target->getGender() == gender.gender; case ACHIEVEMENT_CRITERIA_DATA_TYPE_SCRIPT: return sScriptMgr->OnCriteriaCheck(this, const_cast(source), const_cast(target)); - case ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_DIFFICULTY: - if (source->GetMap()->IsRaid()) - if (source->GetMap()->Is25ManRaid() != (difficulty.difficulty & RAID_DIFFICULTY_MASK_25MAN)) - return false; - return source->GetMap()->GetSpawnMode() >= difficulty.difficulty; case ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_PLAYER_COUNT: return source->GetMap()->GetPlayersCountExceptGMs() <= map_players.maxcount; case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_TEAM: @@ -383,8 +333,6 @@ bool AchievementCriteriaData::Meets(uint32 criteria_id, Player const* source, Un return false; return pProto->ItemLevel >= equipped_item.item_level && pProto->Quality >= equipped_item.item_quality; } - case ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_ID: - return source->GetMapId() == map_id.mapId; default: break; } @@ -747,7 +695,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (!achievement) continue; - if (!CanUpdateCriteria(achievementCriteria, achievement)) + if (!CanUpdateCriteria(achievementCriteria, achievement, miscValue1, miscValue2, unit)) continue; switch (type) @@ -2131,7 +2079,7 @@ bool AchievementMgr::HasAchieved(uint32 achievementId) const return m_completedAchievements.find(achievementId) != m_completedAchievements.end(); } -bool AchievementMgr::CanUpdateCriteria(AchievementCriteriaEntry const* criteria, AchievementEntry const* achievement) +bool AchievementMgr::CanUpdateCriteria(AchievementCriteriaEntry const* criteria, AchievementEntry const* achievement, uint64 miscValue1, uint64 miscValue2, Unit* unit) { if (DisableMgr::IsDisabledFor(DISABLE_TYPE_ACHIEVEMENT_CRITERIA, criteria->ID, NULL)) return false; @@ -2139,6 +2087,10 @@ bool AchievementMgr::CanUpdateCriteria(AchievementCriteriaEntry const* criteria, if (achievement->mapID != -1 && GetPlayer()->GetMapId() != uint32(achievement->mapID)) return false; + // don't update already completed criteria + if (IsCompletedCriteria(criteria, achievement)) + return false; + if ((achievement->requiredFaction == ACHIEVEMENT_FACTION_HORDE && GetPlayer()->GetTeam() != HORDE) || (achievement->requiredFaction == ACHIEVEMENT_FACTION_ALLIANCE && GetPlayer()->GetTeam() != ALLIANCE)) return false; @@ -2162,10 +2114,55 @@ bool AchievementMgr::CanUpdateCriteria(AchievementCriteriaEntry const* criteria, break; } } + + // additional conditions + for (int8 i = 0; i < MAX_ADDITIONAL_CRITERIA_CONDITIONS; ++i) + { + if (!criteria->additionalConditionType[i]) + continue; - // don't update already completed criteria - if (IsCompletedCriteria(criteria, achievement)) - return false; + uint32 value = criteria->additionalConditionValue[i]; + switch (criteria->additionalConditionType[i]) + { + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_MUST_BE_PLAYER: + if (!unit || !unit->ToPlayer()) + return false; + break; + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_MUST_BE_DEAD: + if (!unit || unit->isAlive()) + return false; + break; + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_MUST_BE_MOUNTED: + if (!unit || !unit->IsMounted()) + return false; + break; + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_MAP_DIFFICULTY: + if (GetPlayer()->GetDifficulty(GetPlayer()->GetMap()->IsRaid()) != value) + return false; + break; + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_MAP: + if (GetPlayer()->GetMapId() != value) + return false; + break; + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_ZONE: + if (GetPlayer()->GetZoneId() != value) + return false; + break; + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_AREA: + if (GetPlayer()->GetAreaId() != value) + return false; + break; + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_MUST_BE_ENEMY: + if (!unit) + return false; + if (const Player* player = unit->ToPlayer()) + if (player->GetDeathTimer() != 0 && player->GetTeam() == GetPlayer()->GetTeam()) + return false; + break; + default: + break; + } + } return true; } diff --git a/src/server/game/Achievements/AchievementMgr.h b/src/server/game/Achievements/AchievementMgr.h index f88be974c9d..8d78eb9f113 100755 --- a/src/server/game/Achievements/AchievementMgr.h +++ b/src/server/game/Achievements/AchievementMgr.h @@ -46,15 +46,12 @@ enum AchievementCriteriaDataType ACHIEVEMENT_CRITERIA_DATA_TYPE_T_CREATURE = 1, // creature_id 0 ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE = 2, // class_id race_id ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_LESS_HEALTH= 3, // health_percent 0 - ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_DEAD = 4, // own_team 0 not corpse (not released body), own_team == false if enemy team expected ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA = 5, // spell_id effect_idx - ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AREA = 6, // area id 0 ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA = 7, // spell_id effect_idx ACHIEVEMENT_CRITERIA_DATA_TYPE_VALUE = 8, // minvalue value provided with achievement update must be not less that limit ACHIEVEMENT_CRITERIA_DATA_TYPE_T_LEVEL = 9, // minlevel minlevel of target ACHIEVEMENT_CRITERIA_DATA_TYPE_T_GENDER = 10, // gender 0=male; 1=female ACHIEVEMENT_CRITERIA_DATA_TYPE_SCRIPT = 11, // scripted requirement - ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_DIFFICULTY = 12, // difficulty normal/heroic difficulty for current event map ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_PLAYER_COUNT = 13, // count "with less than %u people in the zone" ACHIEVEMENT_CRITERIA_DATA_TYPE_T_TEAM = 14, // team HORDE(67), ALLIANCE(469) ACHIEVEMENT_CRITERIA_DATA_TYPE_S_DRUNK = 15, // drunken_state 0 (enum DrunkenState) of player @@ -62,11 +59,9 @@ enum AchievementCriteriaDataType ACHIEVEMENT_CRITERIA_DATA_TYPE_BG_LOSS_TEAM_SCORE = 17, // min_score max_score player's team win bg and opposition team have team score in range ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT = 18, // 0 0 maker instance script call for check current criteria requirements fit ACHIEVEMENT_CRITERIA_DATA_TYPE_S_EQUIPED_ITEM = 19, // item_level item_quality for equipped item in slot to check item level and quality - ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_ID = 20, // map_id 0 player must be on map with id in map_id + MAX_ACHIEVEMENT_CRITERIA_DATA_TYPE, }; -#define MAX_ACHIEVEMENT_CRITERIA_DATA_TYPE 21 // maximum value in AchievementCriteriaDataType enum - class Player; class Unit; @@ -92,11 +87,6 @@ struct AchievementCriteriaData { uint32 percent; } health; - // ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_DEAD = 4 - struct - { - uint32 own_team_flag; - } player_dead; // ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA = 5 // ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA = 7 struct @@ -104,11 +94,6 @@ struct AchievementCriteriaData uint32 spell_id; uint32 effect_idx; } aura; - // ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AREA = 6 - struct - { - uint32 id; - } area; // ACHIEVEMENT_CRITERIA_DATA_TYPE_VALUE = 8 struct { @@ -125,11 +110,6 @@ struct AchievementCriteriaData uint32 gender; } gender; // ACHIEVEMENT_CRITERIA_DATA_TYPE_SCRIPT = 11 (no data) - // ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_DIFFICULTY = 12 - struct - { - uint32 difficulty; - } difficulty; // ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_PLAYER_COUNT = 13 struct { @@ -163,12 +143,7 @@ struct AchievementCriteriaData uint32 item_level; uint32 item_quality; } equipped_item; - // ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_ID = 20 - struct - { - uint32 mapId; - } map_id; - // ... + // raw struct { uint32 value1; @@ -273,7 +248,7 @@ class AchievementMgr void CompletedCriteriaFor(AchievementEntry const* achievement); bool IsCompletedCriteria(AchievementCriteriaEntry const* achievementCriteria, AchievementEntry const* achievement); bool IsCompletedAchievement(AchievementEntry const* entry); - bool CanUpdateCriteria(AchievementCriteriaEntry const* criteria, AchievementEntry const* achievement); + bool CanUpdateCriteria(AchievementCriteriaEntry const* criteria, AchievementEntry const* achievement, uint64 miscValue1, uint64 miscValue2, Unit* unit); void BuildAllDataPacket(WorldPacket* data) const; Player* m_player; diff --git a/src/server/game/DataStores/DBCEnums.h b/src/server/game/DataStores/DBCEnums.h index 2cfcc2117e2..a5253b15cf0 100755 --- a/src/server/game/DataStores/DBCEnums.h +++ b/src/server/game/DataStores/DBCEnums.h @@ -92,6 +92,80 @@ enum AchievementCriteriaCondition ACHIEVEMENT_CRITERIA_CONDITION_UNK3 = 13, // unk }; +#define MAX_ADDITIONAL_CRITERIA_CONDITIONS 3 + +enum AchievementCriteriaAdditionalCondition +{ + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_DRUNK_VALUE = 1, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK2 = 2, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_ITEM_LEVEL = 3, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_CREATURE_ENTRY = 4, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_MUST_BE_PLAYER = 5, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_MUST_BE_DEAD = 6, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_MUST_BE_ENEMY = 7, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_HAS_AURA = 8, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK9 = 9, // unused in 4.0.6a + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_HAS_AURA = 10, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_MUST_BE_MOUNTED = 11, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK12 = 12, // unused in 4.0.6a + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK13 = 13, // unused in 4.0.6a + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_ITEM_QUALITY_MIN = 14, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_ITEM_QUALITY_EQUALS = 15, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK16 = 16, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_AREA = 17, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_ZONE = 18, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK19 = 19, // unused in 4.0.6a + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_MAP_DIFFICULTY = 20, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_CREATURE_YIELDS_XP = 21, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK22 = 22, // unused in 4.0.6a + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK23 = 23, // unused in 4.0.6a + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_ARENA_TEAM_SIZE = 24, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_RACE = 25, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_CLASS = 26, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_RACE = 27, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_CLASS = 28, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_MAX_GROUP_MEMBERS = 29, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_CREATURE_TYPE = 30, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK31 = 31, // unused in 4.0.6a + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_MAP = 32, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_ITEM_CLASS = 33, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_ITEM_SUBCLASS = 34, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK35 = 35, // related to timed completing-quests achievements + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK36 = 36, // unused in 4.0.6a + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_MIN_PERSONAL_RATING = 37, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TITLE_BIT_INDEX = 38, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_LEVEL = 39, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_LEVEL = 40, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_ZONE = 41, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK42 = 42, // unused in 4.0.6a + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK43 = 43, // unused in 4.0.6a + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK44 = 44, // unused in 4.0.6a + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK45 = 45, // unused in 4.0.6a + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_HEALTH_PERCENT_BELOW = 46, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK47 = 47, // unused in 4.0.6a + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK48 = 48, // unused in 4.0.6a + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK49 = 49, // unused in 4.0.6a + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK50 = 50, // unused in 4.0.6a + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK51 = 51, // unused in 4.0.6a + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK52 = 52, // unused in 4.0.6a + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK53 = 53, // unused in 4.0.6a + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK54 = 54, // unused in 4.0.6a + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK55 = 55, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_MIN_ACHIEVEMENT_POINTS = 56, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK57 = 57, // unused in 4.0.6a + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_REQUIRES_LFG_GROUP = 58, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK59 = 59, // unused in 4.0.6a + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK60 = 60, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_REQUIRES_GUILD_GROUP = 61, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_GUILD_REPUTATION = 62, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_RATED_BATTLEGROUND = 63, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK64 = 64, // unused in 4.0.6a + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK65 = 65, // Archaeology, item quality related + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK66 = 66, // Archaeology, race related +}; + +#define MAX_ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TYPE 66 + enum AchievementCriteriaFlags { ACHIEVEMENT_CRITERIA_FLAG_SHOW_PROGRESS_BAR = 0x00000001, // Show progress as bar @@ -248,31 +322,6 @@ enum AchievementCriteriaTypes ACHIEVEMENT_CRITERIA_TYPE_TOTAL = 137, }; -enum AchievementCriteriaMoreReqType -{ - ACHIEVEMENT_CRITERIA_MORE_REQ_TYPE_ITEM_LEVEL = 3, - ACHIEVEMENT_CRITERIA_MORE_REQ_TYPE_CREATURE_ID = 4, - ACHIEVEMENT_CRITERIA_MORE_REQ_TYPE_SPELL = 8, - ACHIEVEMENT_CRITERIA_MORE_REQ_TYPE_SPELL_ON_TARGET = 10, - ACHIEVEMENT_CRITERIA_MORE_REQ_TYPE_ITEM_QUALITY_EQUIPPED = 14, - ACHIEVEMENT_CRITERIA_MORE_REQ_TYPE_ITEM_QUALITY_LOOTED = 15, - ACHIEVEMENT_CRITERIA_MORE_REQ_TYPE_AREA_ID = 17, - ACHIEVEMENT_CRITERIA_MORE_REQ_TYPE_AREA_ID2 = 18, - ACHIEVEMENT_CRITERIA_MORE_REQ_TYPE_RAID_DIFFICULTY = 20, - ACHIEVEMENT_CRITERIA_MORE_REQ_TYPE_ARENA_TYPE = 24, - ACHIEVEMENT_CRITERIA_MORE_REQ_TYPE_PLAYER_CLASS = 26, - ACHIEVEMENT_CRITERIA_MORE_REQ_TYPE_PLAYER_RACE = 27, - ACHIEVEMENT_CRITERIA_MORE_REQ_TYPE_PLAYER_CLASS2 = 28, - ACHIEVEMENT_CRITERIA_MORE_REQ_TYPE_CREATURE_TYPE = 30, - ACHIEVEMENT_CRITERIA_MORE_REQ_TYPE_MAP_ID = 32, - ACHIEVEMENT_CRITERIA_MORE_REQ_TYPE_TIMED_QUEST = 35, - ACHIEVEMENT_CRITERIA_MORE_REQ_TYPE_PLAYER_TITLE = 38, - ACHIEVEMENT_CRITERIA_MORE_REQ_TYPE_PLAYER_LEVEL = 39, - ACHIEVEMENT_CRITERIA_MORE_REQ_TYPE_PLAYER_LEVEL2 = 40, - ACHIEVEMENT_CRITERIA_MORE_REQ_TYPE_AREA_ID3 = 41, - ACHIEVEMENT_CRITERIA_MORE_REQ_TYPE_GUILD_REP = 62, -}; - enum AchievementCategory { CATEGORY_CHILDRENS_WEEK = 163, diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 744e5a1c048..87a20633d8d 100755 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -526,8 +526,8 @@ struct AchievementCriteriaEntry uint32 showOrder; // 14 m_ui_order also used in achievement shift-links as index in state bitmask //uint32 unk1; // 15 only one value, still unknown //uint32 unk2; // 16 all zeros - uint32 moreRequirement[3]; // 17-19 - uint32 moreRequirementValue[3]; // 20-22 + uint32 additionalConditionType[MAX_ADDITIONAL_CRITERIA_CONDITIONS]; // 17-19 + uint32 additionalConditionValue[MAX_ADDITIONAL_CRITERIA_CONDITIONS]; // 20-22 }; struct AreaTableEntry -- cgit v1.2.3 From 7260a4a949382d997e4db389759da329ac118088 Mon Sep 17 00:00:00 2001 From: Shocker Date: Mon, 26 Dec 2011 04:55:38 +0200 Subject: Core/Achievements: Avoid code duplication for DB achievement criteria data check and correctly allow to update criteria if there is no DB data --- src/server/game/Achievements/AchievementMgr.cpp | 123 +----------------------- src/server/game/DataStores/DBCEnums.h | 2 +- 2 files changed, 6 insertions(+), 119 deletions(-) (limited to 'src') diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 8cf4d4efb59..c12ce8b999c 100755 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -698,6 +698,11 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (!CanUpdateCriteria(achievementCriteria, achievement, miscValue1, miscValue2, unit)) continue; + // requirements not found in the dbc + if (AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria)) + if (!data->Meets(GetPlayer(), unit, miscValue1)) + continue; + switch (type) { // std. case: increment at 1 @@ -752,13 +757,6 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (!miscValue1) continue; - if (achievement->categoryId == CATEGORY_CHILDRENS_WEEK) - { - AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria); - if (!data || !data->Meets(GetPlayer(), NULL)) - continue; - } - SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); break; } @@ -770,11 +768,6 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (achievementCriteria->win_bg.bgMapID != GetPlayer()->GetMapId()) continue; - // those requirements couldn't be found in the dbc - AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria); - if (!data || !data->Meets(GetPlayer(), unit)) - continue; - SetCriteriaProgress(achievementCriteria, miscValue1, PROGRESS_ACCUMULATE); break; } @@ -786,18 +779,10 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (achievementCriteria->kill_creature.creatureID != miscValue1) continue; - // those requirements couldn't be found in the dbc - AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria); - if (!data || !data->Meets(GetPlayer(), unit)) - continue; - SetCriteriaProgress(achievementCriteria, miscValue2, PROGRESS_ACCUMULATE); break; } case ACHIEVEMENT_CRITERIA_TYPE_REACH_LEVEL: - if (AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria)) - if (!data->Meets(GetPlayer(), unit)) - continue; SetCriteriaProgress(achievementCriteria, GetPlayer()->getLevel()); break; case ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL: @@ -985,11 +970,6 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (!miscValue1) continue; - // those requirements couldn't be found in the dbc - AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria); - if (!data || !data->Meets(GetPlayer(), unit)) - continue; - // miscvalue1 is the ingame fallheight*100 as stored in dbc SetCriteriaProgress(achievementCriteria, miscValue1); break; @@ -1017,15 +997,6 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui continue; } - if (achievement->ID == 1282) - { - // those requirements couldn't be found in the dbc - AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria); - if (!data || !data->Meets(GetPlayer(), unit)) - continue; - break; - } - SetCriteriaProgress(achievementCriteria, 1); break; } @@ -1035,14 +1006,6 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (!miscValue1 || miscValue1 != achievementCriteria->be_spell_target.spellID) continue; - // those requirements couldn't be found in the dbc - AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria); - if (!data) - continue; - - if (!data->Meets(GetPlayer(), unit)) - continue; - SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); break; } @@ -1052,14 +1015,6 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (!miscValue1 || miscValue1 != achievementCriteria->cast_spell.spellID) continue; - // those requirements couldn't be found in the dbc - AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria); - if (!data) - continue; - - if (!data->Meets(GetPlayer(), unit)) - continue; - SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); break; } @@ -1079,15 +1034,6 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (miscValue1 != achievementCriteria->loot_type.lootType) continue; - // zone specific - if (achievementCriteria->loot_type.lootTypeCount == 1) - { - // those requirements couldn't be found in the dbc - AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria); - if (!data || !data->Meets(GetPlayer(), unit)) - continue; - } - SetCriteriaProgress(achievementCriteria, miscValue2, PROGRESS_ACCUMULATE); break; } @@ -1102,19 +1048,6 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (!miscValue1) // no update at login continue; - // additional requirements - if (achievementCriteria->additionalRequirements[0].additionalRequirement_type == ACHIEVEMENT_CRITERIA_CONDITION_NO_LOSE) - { - // those requirements couldn't be found in the dbc - AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria); - if (!data || !data->Meets(GetPlayer(), unit, miscValue1)) - { - // reset the progress as we have a win without the requirement. - SetCriteriaProgress(achievementCriteria, 0); - continue; - } - } - SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); break; case ACHIEVEMENT_CRITERIA_TYPE_USE_ITEM: @@ -1125,14 +1058,6 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (achievementCriteria->use_item.itemID != miscValue1) continue; - // Children's Week achievements have extra requirements - if (achievement->categoryId == CATEGORY_CHILDRENS_WEEK) - { - AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria); - if (!data || !data->Meets(GetPlayer(), NULL)) - continue; - } - SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); break; case ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM: @@ -1211,11 +1136,6 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (miscValue2 != achievementCriteria->equip_epic_item.itemSlot) continue; - // check item level and quality via achievement_criteria_data - AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria); - if (!data || !data->Meets(GetPlayer(), 0, miscValue1)) - continue; - SetCriteriaProgress(achievementCriteria, 1); break; } @@ -1234,11 +1154,6 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (!pProto) continue; - // check item level via achievement_criteria_data - AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria); - if (!data || !data->Meets(GetPlayer(), 0, pProto->ItemLevel)) - continue; - SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); break; } @@ -1249,13 +1164,6 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui continue; if (miscValue1 != achievementCriteria->do_emote.emoteID) continue; - if (achievementCriteria->do_emote.count) - { - // those requirements couldn't be found in the dbc - AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria); - if (!data || !data->Meets(GetPlayer(), unit)) - continue; - } SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); break; @@ -1330,17 +1238,6 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (!miscValue1) continue; - if (achievementCriteria->win_duel.duelCount) - { - // those requirements couldn't be found in the dbc - AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria); - if (!data) - continue; - - if (!data->Meets(GetPlayer(), unit)) - continue; - } - SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); break; case ACHIEVEMENT_CRITERIA_TYPE_GAIN_REVERED_REPUTATION: @@ -1419,11 +1316,6 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (!miscValue1 || miscValue1 != achievementCriteria->bg_objective.objectiveId) continue; - // those requirements couldn't be found in the dbc - AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria); - if (!data || !data->Meets(GetPlayer(), unit)) - continue; - SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); break; } @@ -1435,11 +1327,6 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (!miscValue1) continue; - // those requirements couldn't be found in the dbc - AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria); - if (!data || !data->Meets(GetPlayer(), unit)) - continue; - SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); break; } diff --git a/src/server/game/DataStores/DBCEnums.h b/src/server/game/DataStores/DBCEnums.h index a5253b15cf0..1af24eb16d3 100755 --- a/src/server/game/DataStores/DBCEnums.h +++ b/src/server/game/DataStores/DBCEnums.h @@ -132,7 +132,7 @@ enum AchievementCriteriaAdditionalCondition ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_ITEM_SUBCLASS = 34, // NYI ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK35 = 35, // related to timed completing-quests achievements ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK36 = 36, // unused in 4.0.6a - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_MIN_PERSONAL_RATING = 37, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_MIN_PERSONAL_RATING = 37, // NYI (when implementing don't forget about ACHIEVEMENT_CRITERIA_CONDITION_NO_LOSE) ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TITLE_BIT_INDEX = 38, // NYI ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_LEVEL = 39, // NYI ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_LEVEL = 40, // NYI -- cgit v1.2.3 From 8323027e0c15e97e5da5ec0948c447273321d43f Mon Sep 17 00:00:00 2001 From: Shocker Date: Mon, 26 Dec 2011 05:07:43 +0200 Subject: Core/Achievements: Remove invalid check in ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_MUST_BE_ENEMY --- src/server/game/Achievements/AchievementMgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index c12ce8b999c..0221afd2113 100755 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -2043,7 +2043,7 @@ bool AchievementMgr::CanUpdateCriteria(AchievementCriteriaEntry const* criteria, if (!unit) return false; if (const Player* player = unit->ToPlayer()) - if (player->GetDeathTimer() != 0 && player->GetTeam() == GetPlayer()->GetTeam()) + if (player->GetTeam() == GetPlayer()->GetTeam()) return false; break; default: -- cgit v1.2.3 From 8cf68fd1edb945456cc654377005fcac0c90c550 Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 27 Dec 2011 15:33:56 +0000 Subject: Core/Quests: Fix a couple of typos in quest DB loading. Thanks Spp. --- src/server/game/Quests/QuestDef.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index e5e7555330b..f0b5b11e1d8 100755 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -132,16 +132,16 @@ Quest::Quest(Field* questRecord) ObjectiveText[i] = questRecord[128+i].GetString(); for (int i = 0; i < QUEST_REWARD_CURRENCY_COUNT; ++i) - RewardCurrencyId[i] = questRecord[132].GetUInt32(); + RewardCurrencyId[i] = questRecord[132+i].GetUInt32(); for (int i = 0; i < QUEST_REWARD_CURRENCY_COUNT; ++i) - RewardCurrencyCount[i] = questRecord[136].GetUInt32(); + RewardCurrencyCount[i] = questRecord[136+i].GetUInt32(); for (int i = 0; i < QUEST_REQUIRED_CURRENCY_COUNT; ++i) - RequiredCurrencyId[i] = questRecord[140].GetUInt32(); + RequiredCurrencyId[i] = questRecord[140+i].GetUInt32(); for (int i = 0; i < QUEST_REQUIRED_CURRENCY_COUNT; ++i) - RequiredCurrencyCount[i] = questRecord[144].GetUInt32(); + RequiredCurrencyCount[i] = questRecord[144+i].GetUInt32(); QuestGiverTextWindow = questRecord[148].GetString(); QuestGiverTargetName = questRecord[149].GetString(); -- cgit v1.2.3 From 696c424fcd19690960976848601da09c666f7fad Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 27 Dec 2011 16:00:27 +0000 Subject: Core/Player: Fix a tiny typo in loading map from DB --- src/server/game/Entities/Player/Player.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index ce0b4667e9b..d2552fbe8cb 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -1883,7 +1883,7 @@ bool Player::BuildEnumData(PreparedQueryResult result, ByteBuffer* data) *data << fields[1].GetString(); // name *data << uint8(playerBytes >> 8); // face - *data << uint32(fields[9].GetUInt32()); // map + *data << uint32(fields[9].GetUInt16()); // map uint8 Guid0 = uint8(GuidLow); uint8 Guid1 = uint8(GuidLow >> 8); -- cgit v1.2.3 From 996364752c96b80b3903177693277ef3fbf6dab8 Mon Sep 17 00:00:00 2001 From: Spp Date: Wed, 28 Dec 2011 10:42:43 +0100 Subject: Core/Scripts: Replace rand with urand in most cases (using regexp) Used: perl -pi -e 's/([0-9]+) \+ rand\(\)\%([0-9]+)/"urand(".$1.", ".($1+$2).")"/ge' --- .../BlackwingLair/boss_flamegor.cpp | 2 +- .../EasternKingdoms/Karazhan/bosses_opera.cpp | 2 +- .../MagistersTerrace/boss_priestess_delrissa.cpp | 2 +- .../MagistersTerrace/boss_selin_fireheart.cpp | 10 +++---- .../EasternKingdoms/ScarletEnclave/chapter2.cpp | 6 ++-- .../EasternKingdoms/ScarletEnclave/chapter5.cpp | 12 ++++---- .../ScarletMonastery/boss_arcanist_doan.cpp | 2 +- .../ScarletMonastery/boss_bloodmage_thalnos.cpp | 2 +- .../ScarletMonastery/boss_interrogator_vishas.cpp | 2 +- .../Scholomance/boss_darkmaster_gandling.cpp | 6 ++-- .../Scholomance/boss_jandice_barov.cpp | 4 +-- .../Stratholme/boss_dathrohan_balnazzar.cpp | 4 +-- .../SunwellPlateau/boss_kalecgos.cpp | 2 +- .../EasternKingdoms/ZulAman/boss_akilzon.cpp | 8 +++--- .../EasternKingdoms/ZulAman/boss_halazzi.cpp | 2 +- .../EasternKingdoms/ZulAman/boss_nalorakk.cpp | 32 +++++++++++----------- .../EasternKingdoms/ZulAman/boss_zuljin.cpp | 6 ++-- .../EasternKingdoms/ZulGurub/boss_gahzranka.cpp | 6 ++-- .../EasternKingdoms/ZulGurub/boss_grilek.cpp | 8 +++--- .../EasternKingdoms/ZulGurub/boss_hakkar.cpp | 10 +++---- .../EasternKingdoms/ZulGurub/boss_hazzarah.cpp | 12 ++++---- .../EasternKingdoms/ZulGurub/boss_jeklik.cpp | 14 +++++----- .../EasternKingdoms/ZulGurub/boss_jindo.cpp | 10 +++---- .../EasternKingdoms/ZulGurub/boss_mandokir.cpp | 2 +- .../EasternKingdoms/ZulGurub/boss_marli.cpp | 6 ++-- .../EasternKingdoms/ZulGurub/boss_renataki.cpp | 12 ++++---- .../EasternKingdoms/ZulGurub/boss_thekal.cpp | 10 +++---- .../EasternKingdoms/ZulGurub/boss_wushoolay.cpp | 8 +++--- .../scripts/EasternKingdoms/eversong_woods.cpp | 6 ++-- .../CavernsOfTime/BattleForMountHyjal/hyjal.cpp | 10 +++---- .../boss_captain_skarloc.cpp | 8 +++--- .../EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp | 6 ++-- .../boss_amnennar_the_coldbringer.cpp | 2 +- .../Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp | 20 +++++++------- .../Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp | 12 ++++---- .../Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp | 14 +++++----- .../Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp | 22 +++++++-------- .../Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp | 26 +++++++++--------- .../Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp | 8 +++--- .../TempleOfAhnQiraj/boss_twinemperors.cpp | 14 +++++----- src/server/scripts/Kalimdor/azuremyst_isle.cpp | 4 +-- src/server/scripts/Kalimdor/boss_azuregos.cpp | 16 +++++------ .../Northrend/Naxxramas/boss_anubrekhan.cpp | 2 +- .../scripts/Northrend/Naxxramas/boss_noth.cpp | 8 +++--- .../Ulduar/HallsOfLightning/boss_bjarngrim.cpp | 30 ++++++++++---------- .../Ulduar/HallsOfLightning/boss_loken.cpp | 4 +-- .../Ulduar/HallsOfStone/boss_krystallus.cpp | 16 +++++------ .../Ulduar/HallsOfStone/boss_maiden_of_grief.cpp | 12 ++++---- .../Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp | 14 +++++----- .../Ulduar/HallsOfStone/halls_of_stone.cpp | 4 +-- .../Northrend/Ulduar/Ulduar/boss_algalon.cpp | 2 +- .../AuchenaiCrypts/boss_exarch_maladaar.cpp | 2 +- .../ManaTombs/boss_nexusprince_shaffar.cpp | 10 +++---- .../SethekkHalls/boss_darkweaver_syth.cpp | 8 +++--- .../ShadowLabyrinth/boss_ambassador_hellmaw.cpp | 8 +++--- .../boss_blackheart_the_inciter.cpp | 4 +-- .../ShadowLabyrinth/boss_grandmaster_vorpil.cpp | 4 +-- .../Auchindoun/ShadowLabyrinth/boss_murmur.cpp | 6 ++-- .../scripts/Outland/BlackTemple/boss_illidan.cpp | 24 ++++++++-------- .../Outland/BlackTemple/boss_mother_shahraz.cpp | 6 ++-- .../BlackTemple/boss_reliquary_of_souls.cpp | 4 +-- .../Outland/BlackTemple/boss_teron_gorefiend.cpp | 8 +++--- .../Outland/BlackTemple/illidari_council.cpp | 14 +++++----- .../SerpentShrine/boss_leotheras_the_blind.cpp | 8 +++--- .../scripts/Outland/GruulsLair/boss_gruul.cpp | 2 +- .../Outland/GruulsLair/boss_high_king_maulgar.cpp | 10 +++---- .../MagtheridonsLair/boss_magtheridon.cpp | 14 +++++----- .../Mechanar/boss_gatewatcher_ironhand.cpp | 4 +-- .../Mechanar/boss_nethermancer_sepethrea.cpp | 14 +++++----- .../Mechanar/boss_pathaleon_the_calculator.cpp | 22 +++++++-------- .../TempestKeep/botanica/boss_warp_splinter.cpp | 8 +++--- 71 files changed, 321 insertions(+), 321 deletions(-) (limited to 'src') diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_flamegor.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_flamegor.cpp index 4e44a70475f..a7c984fa536 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_flamegor.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_flamegor.cpp @@ -70,7 +70,7 @@ public: if (ShadowFlame_Timer <= diff) { DoCast(me->getVictim(), SPELL_SHADOWFLAME); - ShadowFlame_Timer = 15000 + rand()%7000; + ShadowFlame_Timer = urand(15000, 22000); } else ShadowFlame_Timer -= diff; //WingBuffet_Timer diff --git a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp index 8454150d830..389f0d0a959 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp @@ -824,7 +824,7 @@ public: void Reset() { ChaseTimer = 30000; - FearTimer = 25000 + rand()%10000; + FearTimer = urand(25000, 35000); SwipeTimer = 5000; HoodGUID = 0; diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp index 55254a3b8ee..bf58d6f2853 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp @@ -467,7 +467,7 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI if (ResetThreatTimer <= diff) { DoResetThreat(); - ResetThreatTimer = 5000 + rand()%15000; + ResetThreatTimer = urand(5000, 20000); } else ResetThreatTimer -= diff; } }; diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp index 305ce97687a..93b0b45a3e3 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp @@ -122,13 +122,13 @@ public: instance->SetData(DATA_SELIN_EVENT, NOT_STARTED); } else sLog->outError(ERROR_INST_DATA); - DrainLifeTimer = 3000 + rand()%4000; + DrainLifeTimer = urand(3000, 7000); DrainManaTimer = DrainLifeTimer + 5000; FelExplosionTimer = 2100; if (IsHeroic()) - DrainCrystalTimer = 10000 + rand()%5000; + DrainCrystalTimer = urand(10000, 15000); else - DrainCrystalTimer = 20000 + rand()%5000; + DrainCrystalTimer = urand(20000, 25000); EmpowerTimer = 10000; IsDraining = false; @@ -285,9 +285,9 @@ public: { SelectNearestCrystal(); if (IsHeroic()) - DrainCrystalTimer = 10000 + rand()%5000; + DrainCrystalTimer = urand(10000, 15000); else - DrainCrystalTimer = 20000 + rand()%5000; + DrainCrystalTimer = urand(20000, 25000); } else DrainCrystalTimer -= diff; } diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp index 8179c9fccaa..6d316eff94f 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp @@ -482,21 +482,21 @@ public: { Shout(); DoCast(me, SPELL_RENEW); - uiRenew_timer = 1000 + rand()%5000; + uiRenew_timer = urand(1000, 6000); } else uiRenew_timer -= diff; if (uiInquisitor_Penance_timer <= diff) { Shout(); DoCast(me->getVictim(), SPELL_INQUISITOR_PENANCE); - uiInquisitor_Penance_timer = 2000 + rand()%5000; + uiInquisitor_Penance_timer = urand(2000, 7000); } else uiInquisitor_Penance_timer -= diff; if (uiValroth_Smite_timer <= diff) { Shout(); DoCast(me->getVictim(), SPELL_VALROTH_SMITE); - uiValroth_Smite_timer = 1000 + rand()%5000; + uiValroth_Smite_timer = urand(1000, 6000); } else uiValroth_Smite_timer -= diff; DoMeleeAttackIfReady(); diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp index 3ee71ce3609..5b89651f2b0 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp @@ -1352,31 +1352,31 @@ public: if (uiAnti_magic_zone <= diff) { DoCast(me, SPELL_ANTI_MAGIC_ZONE1); - uiAnti_magic_zone = 25000 + rand()%5000; + uiAnti_magic_zone = urand(25000, 30000); } else uiAnti_magic_zone -= diff; if (uiDeath_strike <= diff) { DoCast(me->getVictim(), SPELL_DEATH_STRIKE); - uiDeath_strike = 5000 + rand()%5000; + uiDeath_strike = urand(5000, 10000); } else uiDeath_strike -= diff; if (uiDeath_embrace <= diff) { DoCast(me->getVictim(), SPELL_DEATH_EMBRACE); - uiDeath_embrace = 5000 + rand()%5000; + uiDeath_embrace = urand(5000, 10000); } else uiDeath_embrace -= diff; if (uiIcy_touch <= diff) { DoCast(me->getVictim(), SPELL_ICY_TOUCH1); - uiIcy_touch = 5000 + rand()%5000; + uiIcy_touch = urand(5000, 10000); } else uiIcy_touch -= diff; if (uiUnholy_blight <= diff) { DoCast(me->getVictim(), SPELL_UNHOLY_BLIGHT); - uiUnholy_blight = 5000 + rand()%5000; + uiUnholy_blight = urand(5000, 10000); } else uiUnholy_blight -= diff; if (uiFight_speech <= diff) @@ -1387,7 +1387,7 @@ public: SAY_LIGHT_OF_DAWN18, SAY_LIGHT_OF_DAWN19, SAY_LIGHT_OF_DAWN20, SAY_LIGHT_OF_DAWN21, SAY_LIGHT_OF_DAWN22, SAY_LIGHT_OF_DAWN23, SAY_LIGHT_OF_DAWN24), me); - uiFight_speech = 15000 + rand()%5000; + uiFight_speech = urand(15000, 20000); } else uiFight_speech -= diff; // Check spawns diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp index a5fe8a5c6db..25295e62ff3 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp @@ -111,7 +111,7 @@ public: if (AoESilence_Timer <= diff) { DoCast(me->getVictim(), SPELL_AOESILENCE); - AoESilence_Timer = 15000 + rand()%5000; + AoESilence_Timer = urand(15000, 20000); } else AoESilence_Timer -= diff; //ArcaneExplosion_Timer diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp index 16875dce85f..733b3a91f93 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp @@ -92,7 +92,7 @@ public: if (FlameShock_Timer <= diff) { DoCast(me->getVictim(), SPELL_FLAMESHOCK); - FlameShock_Timer = 10000 + rand()%5000; + FlameShock_Timer = urand(10000, 15000); } else FlameShock_Timer -= diff; //FlameSpike_Timer diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp index 2277d867455..e66c639896e 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp @@ -107,7 +107,7 @@ public: if (ShadowWordPain_Timer <= diff) { DoCast(me->getVictim(), SPELL_SHADOWWORDPAIN); - ShadowWordPain_Timer = 5000 + rand()%10000; + ShadowWordPain_Timer = urand(5000, 15000); } else ShadowWordPain_Timer -= diff; DoMeleeAttackIfReady(); diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp index 12dd67e009d..d930dd4a14c 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp @@ -108,14 +108,14 @@ public: if (ShadowShield_Timer <= diff) { DoCast(me, SPELL_SHADOWSHIELD); - ShadowShield_Timer = 14000 + rand()%14000; + ShadowShield_Timer = urand(14000, 28000); } else ShadowShield_Timer -= diff; //Curse_Timer if (Curse_Timer <= diff) { DoCast(me->getVictim(), SPELL_CURSE); - Curse_Timer = 15000 + rand()%12000; + Curse_Timer = urand(15000, 27000); } else Curse_Timer -= diff; //Teleporting Random Target to one of the six pre boss rooms and spawn 3-4 skeletons near the gamer. @@ -214,7 +214,7 @@ public: break; } } - Teleport_Timer = 20000 + rand()%15000; + Teleport_Timer = urand(20000, 35000); } else Teleport_Timer -= diff; } diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp index 9dd9f1fedb5..2d1d78193ed 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp @@ -171,7 +171,7 @@ public: void Reset() { - Cleave_Timer = 2000 + rand()%6000; + Cleave_Timer = urand(2000, 8000); me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true); } @@ -192,7 +192,7 @@ public: DoCast(me->getVictim(), SPELL_CLEAVE); //5-8 seconds - Cleave_Timer = 5000 + rand()%3000; + Cleave_Timer = urand(5000, 8000); } else Cleave_Timer -= diff; DoMeleeAttackIfReady(); diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp index 17ea8a04293..3cbf00f291d 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp @@ -131,7 +131,7 @@ public: if (m_uiMindBlast_Timer <= uiDiff) { DoCast(me->getVictim(), SPELL_MINDBLAST); - m_uiMindBlast_Timer = 15000 + rand()%5000; + m_uiMindBlast_Timer = urand(15000, 20000); } else m_uiMindBlast_Timer -= uiDiff; //CrusadersHammer @@ -173,7 +173,7 @@ public: if (m_uiMindBlast_Timer <= uiDiff) { DoCast(me->getVictim(), SPELL_MINDBLAST); - m_uiMindBlast_Timer = 15000 + rand()%5000; + m_uiMindBlast_Timer = urand(15000, 20000); } else m_uiMindBlast_Timer -= uiDiff; //ShadowShock diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp index df3bb5d4525..747d9e29ec1 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp @@ -612,7 +612,7 @@ public: KalecGUID = 0; } - ShadowBoltTimer = 7000 + rand()%3 * 1000; + ShadowBoltTimer = urand(7, 10) * 1000; AgonyCurseTimer = 20000; CorruptionStrikeTimer = 13000; CheckTimer = 1000; diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp index 413897c94e8..ffccfbce2b6 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp @@ -296,13 +296,13 @@ class boss_akilzon : public CreatureScript Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1); if (!target) target = me->getVictim(); DoCast(target, SPELL_GUST_OF_WIND); - GustOfWind_Timer = (20+rand()%10)*1000; //20 to 30 seconds(bosskillers) + GustOfWind_Timer = urand(20, 30) * 1000; //20 to 30 seconds(bosskillers) } else GustOfWind_Timer -= diff; if (CallLighting_Timer <= diff) { DoCast(me->getVictim(), SPELL_CALL_LIGHTNING); - CallLighting_Timer = (12 + rand()%5)*1000; //totaly random timer. can't find any info on this + CallLighting_Timer = urand(12, 17) * 1000; //totaly random timer. can't find any info on this } else CallLighting_Timer -= diff; if (!isRaining && ElectricalStorm_Timer < uint32(8000 + rand() % 5000)) @@ -406,7 +406,7 @@ class mob_akilzon_eagle : public CreatureScript void Reset() { - EagleSwoop_Timer = 5000 + rand()%5000; + EagleSwoop_Timer = urand(5000, 10000); arrived = true; TargetGUID = 0; me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); @@ -425,7 +425,7 @@ class mob_akilzon_eagle : public CreatureScript DoCast(target, SPELL_EAGLE_SWOOP, true); TargetGUID = 0; me->SetSpeed(MOVE_RUN, 1.2f); - EagleSwoop_Timer = 5000 + rand()%5000; + EagleSwoop_Timer = urand(5000, 10000); } } diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp index a3c7aae4132..80c31d42a46 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp @@ -263,7 +263,7 @@ class boss_halazzi : public CreatureScript DoCast(target, SPELL_EARTHSHOCK); else DoCast(target, SPELL_FLAMESHOCK); - ShockTimer = 10000 + rand()%5000; + ShockTimer = urand(10000, 15000); } } else ShockTimer -= diff; diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp index 3ff465a3c1d..0ae8a9bc5c4 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp @@ -145,10 +145,10 @@ class boss_nalorakk : public CreatureScript if (instance) instance->SetData(DATA_NALORAKKEVENT, NOT_STARTED); - Surge_Timer = 15000 + rand()%5000; - BrutalSwipe_Timer = 7000 + rand()%5000; - Mangle_Timer = 10000 + rand()%5000; - ShapeShift_Timer = 45000 + rand()%5000; + Surge_Timer = urand(15000, 20000); + BrutalSwipe_Timer = urand(7000, 12000); + Mangle_Timer = urand(10000, 15000); + ShapeShift_Timer = urand(45000, 50000); Berserk_Timer = 600000; inBearForm = false; @@ -371,10 +371,10 @@ class boss_nalorakk : public CreatureScript me->MonsterYell(YELL_SHIFTEDTOTROLL, LANG_UNIVERSAL, 0); DoPlaySoundToSet(me, SOUND_YELL_TOTROLL); me->RemoveAurasDueToSpell(SPELL_BEARFORM); - Surge_Timer = 15000 + rand()%5000; - BrutalSwipe_Timer = 7000 + rand()%5000; - Mangle_Timer = 10000 + rand()%5000; - ShapeShift_Timer = 45000 + rand()%5000; + Surge_Timer = urand(15000, 20000); + BrutalSwipe_Timer = urand(7000, 12000); + Mangle_Timer = urand(10000, 15000); + ShapeShift_Timer = urand(45000, 50000); inBearForm = false; } else @@ -385,8 +385,8 @@ class boss_nalorakk : public CreatureScript DoCast(me, SPELL_BEARFORM, true); LaceratingSlash_Timer = 2000; // dur 18s RendFlesh_Timer = 3000; // dur 5s - DeafeningRoar_Timer = 5000 + rand()%5000; // dur 2s - ShapeShift_Timer = 20000 + rand()%5000; // dur 30s + DeafeningRoar_Timer = urand(5000, 10000); // dur 2s + ShapeShift_Timer = urand(20000, 25000); // dur 30s inBearForm = true; } } else ShapeShift_Timer -= diff; @@ -396,7 +396,7 @@ class boss_nalorakk : public CreatureScript if (BrutalSwipe_Timer <= diff) { DoCast(me->getVictim(), SPELL_BRUTALSWIPE); - BrutalSwipe_Timer = 7000 + rand()%5000; + BrutalSwipe_Timer = urand(7000, 12000); } else BrutalSwipe_Timer -= diff; if (Mangle_Timer <= diff) @@ -406,7 +406,7 @@ class boss_nalorakk : public CreatureScript DoCast(me->getVictim(), SPELL_MANGLE); Mangle_Timer = 1000; } - else Mangle_Timer = 10000 + rand()%5000; + else Mangle_Timer = urand(10000, 15000); } else Mangle_Timer -= diff; if (Surge_Timer <= diff) @@ -416,7 +416,7 @@ class boss_nalorakk : public CreatureScript Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 45, true); if (target) DoCast(target, SPELL_SURGE); - Surge_Timer = 15000 + rand()%5000; + Surge_Timer = urand(15000, 20000); } else Surge_Timer -= diff; } else @@ -424,19 +424,19 @@ class boss_nalorakk : public CreatureScript if (LaceratingSlash_Timer <= diff) { DoCast(me->getVictim(), SPELL_LACERATINGSLASH); - LaceratingSlash_Timer = 18000 + rand()%5000; + LaceratingSlash_Timer = urand(18000, 23000); } else LaceratingSlash_Timer -= diff; if (RendFlesh_Timer <= diff) { DoCast(me->getVictim(), SPELL_RENDFLESH); - RendFlesh_Timer = 5000 + rand()%5000; + RendFlesh_Timer = urand(5000, 10000); } else RendFlesh_Timer -= diff; if (DeafeningRoar_Timer <= diff) { DoCast(me->getVictim(), SPELL_DEAFENINGROAR); - DeafeningRoar_Timer = 15000 + rand()%5000; + DeafeningRoar_Timer = urand(15000, 20000); } else DeafeningRoar_Timer -= diff; } diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp index ae6a25d2c17..5dbe3fc9409 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp @@ -430,7 +430,7 @@ class boss_zuljin : public CreatureScript if (Whirlwind_Timer <= diff) { DoCast(me, SPELL_WHIRLWIND); - Whirlwind_Timer = 15000 + rand()%5000; + Whirlwind_Timer = urand(15000, 20000); } else Whirlwind_Timer -= diff; if (Grievous_Throw_Timer <= diff) @@ -489,7 +489,7 @@ class boss_zuljin : public CreatureScript ++Claw_Counter; if (Claw_Counter == 12) { - Claw_Rage_Timer = 15000 + rand()%5000; + Claw_Rage_Timer = urand(15000, 20000); me->SetSpeed(MOVE_RUN, 1.2f); AttackStart(Unit::GetUnit(*me, TankGUID)); TankGUID = 0; @@ -537,7 +537,7 @@ class boss_zuljin : public CreatureScript ++Claw_Counter; if (Claw_Counter == 9) { - Lynx_Rush_Timer = 15000 + rand()%5000; + Lynx_Rush_Timer = urand(15000, 20000); me->SetSpeed(MOVE_RUN, 1.2f); AttackStart(Unit::GetUnit(*me, TankGUID)); TankGUID = 0; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp index c515b625e6f..5ca43e9268e 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp @@ -66,7 +66,7 @@ class boss_gahzranka : public CreatureScript if (Frostbreath_Timer <= diff) { DoCast(me->getVictim(), SPELL_FROSTBREATH); - Frostbreath_Timer = 7000 + rand()%4000; + Frostbreath_Timer = urand(7000, 11000); } else Frostbreath_Timer -= diff; //MassiveGeyser_Timer @@ -75,14 +75,14 @@ class boss_gahzranka : public CreatureScript DoCast(me->getVictim(), SPELL_MASSIVEGEYSER); DoResetThreat(); - MassiveGeyser_Timer = 22000 + rand()%10000; + MassiveGeyser_Timer = urand(22000, 32000); } else MassiveGeyser_Timer -= diff; //Slam_Timer if (Slam_Timer <= diff) { DoCast(me->getVictim(), SPELL_SLAM); - Slam_Timer = 12000 + rand()%8000; + Slam_Timer = urand(12000, 20000); } else Slam_Timer -= diff; DoMeleeAttackIfReady(); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp index e01dafd4777..d3922602a17 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp @@ -47,8 +47,8 @@ class boss_grilek : public CreatureScript void Reset() { - Avartar_Timer = 15000 + rand()%10000; - GroundTremor_Timer = 8000 + rand()%8000; + Avartar_Timer = urand(15000, 25000); + GroundTremor_Timer = urand(8000, 16000); } void EnterCombat(Unit* /*who*/) @@ -75,14 +75,14 @@ class boss_grilek : public CreatureScript if (target) AttackStart(target); - Avartar_Timer = 25000 + rand()%10000; + Avartar_Timer = urand(25000, 35000); } else Avartar_Timer -= diff; //GroundTremor_Timer if (GroundTremor_Timer <= diff) { DoCast(me->getVictim(), SPELL_GROUNDTREMOR); - GroundTremor_Timer = 12000 + rand()%4000; + GroundTremor_Timer = urand(12000, 16000); } else GroundTremor_Timer -= diff; DoMeleeAttackIfReady(); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp index 77b8955158a..484499b1567 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp @@ -126,7 +126,7 @@ class boss_hakkar : public CreatureScript if (CorruptedBlood_Timer <= diff) { DoCast(me->getVictim(), SPELL_CORRUPTEDBLOOD); - CorruptedBlood_Timer = 30000 + rand()%15000; + CorruptedBlood_Timer = urand(30000, 45000); } else CorruptedBlood_Timer -= diff; //CauseInsanity_Timer @@ -135,7 +135,7 @@ class boss_hakkar : public CreatureScript if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_CAUSEINSANITY); - CauseInsanity_Timer = 35000 + rand()%8000; + CauseInsanity_Timer = urand(35000, 43000); } else CauseInsanity_Timer -= diff;*/ //WillOfHakkar_Timer @@ -144,7 +144,7 @@ class boss_hakkar : public CreatureScript if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_WILLOFHAKKAR); - WillOfHakkar_Timer = 25000 + rand()%10000; + WillOfHakkar_Timer = urand(25000, 35000); } else WillOfHakkar_Timer -= diff; if (!Enraged && Enrage_Timer <= diff) @@ -163,7 +163,7 @@ class boss_hakkar : public CreatureScript if (AspectOfJeklik_Timer <= diff) { DoCast(me->getVictim(), SPELL_ASPECT_OF_JEKLIK); - AspectOfJeklik_Timer = 10000 + rand()%4000; + AspectOfJeklik_Timer = urand(10000, 14000); } else AspectOfJeklik_Timer -= diff; } } @@ -234,7 +234,7 @@ class boss_hakkar : public CreatureScript DoCast(me, SPELL_ASPECT_OF_ARLOKK); DoResetThreat(); - AspectOfArlokk_Timer = 10000 + rand()%5000; + AspectOfArlokk_Timer = urand(10000, 15000); } else AspectOfArlokk_Timer -= diff; } } diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp index b8f4b0a50a1..73fa91dbdd8 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp @@ -48,9 +48,9 @@ class boss_hazzarah : public CreatureScript void Reset() { - ManaBurn_Timer = 4000 + rand()%6000; - Sleep_Timer = 10000 + rand()%8000; - Illusions_Timer = 10000 + rand()%8000; + ManaBurn_Timer = urand(4000, 10000); + Sleep_Timer = urand(10000, 18000); + Illusions_Timer = urand(10000, 18000); } void EnterCombat(Unit* /*who*/) @@ -66,14 +66,14 @@ class boss_hazzarah : public CreatureScript if (ManaBurn_Timer <= diff) { DoCast(me->getVictim(), SPELL_MANABURN); - ManaBurn_Timer = 8000 + rand()%8000; + ManaBurn_Timer = urand(8000, 16000); } else ManaBurn_Timer -= diff; //Sleep_Timer if (Sleep_Timer <= diff) { DoCast(me->getVictim(), SPELL_SLEEP); - Sleep_Timer = 12000 + rand()%8000; + Sleep_Timer = urand(12000, 20000); } else Sleep_Timer -= diff; //Illusions_Timer @@ -93,7 +93,7 @@ class boss_hazzarah : public CreatureScript Illusion->AI()->AttackStart(target); } - Illusions_Timer = 15000 + rand()%10000; + Illusions_Timer = urand(15000, 25000); } else Illusions_Timer -= diff; DoMeleeAttackIfReady(); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp index fcb492d47f7..87dc0e372f6 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp @@ -119,19 +119,19 @@ class boss_jeklik : public CreatureScript AttackStart(target); } - Charge_Timer = 15000 + rand()%15000; + Charge_Timer = urand(15000, 30000); } else Charge_Timer -= diff; if (SonicBurst_Timer <= diff) { DoCast(me->getVictim(), SPELL_SONICBURST); - SonicBurst_Timer = 8000 + rand()%5000; + SonicBurst_Timer = urand(8000, 13000); } else SonicBurst_Timer -= diff; if (Screech_Timer <= diff) { DoCast(me->getVictim(), SPELL_SCREECH); - Screech_Timer = 18000 + rand()%8000; + Screech_Timer = urand(18000, 26000); } else Screech_Timer -= diff; if (SpawnBats_Timer <= diff) @@ -168,7 +168,7 @@ class boss_jeklik : public CreatureScript if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) { DoCast(target, SPELL_SHADOW_WORD_PAIN); - ShadowWordPain_Timer = 12000 + rand()%6000; + ShadowWordPain_Timer = urand(12000, 18000); } }ShadowWordPain_Timer -=diff; @@ -182,14 +182,14 @@ class boss_jeklik : public CreatureScript { me->InterruptNonMeleeSpells(false); DoCast(me->getVictim(), SPELL_CHAIN_MIND_FLAY); - ChainMindFlay_Timer = 15000 + rand()%15000; + ChainMindFlay_Timer = urand(15000, 30000); }ChainMindFlay_Timer -=diff; if (GreaterHeal_Timer <= diff) { me->InterruptNonMeleeSpells(false); DoCast(me, SPELL_GREATERHEAL); - GreaterHeal_Timer = 25000 + rand()%10000; + GreaterHeal_Timer = urand(25000, 35000); }GreaterHeal_Timer -=diff; if (SpawnFlyingBats_Timer <= diff) @@ -202,7 +202,7 @@ class boss_jeklik : public CreatureScript if (FlyingBat) FlyingBat->AI()->AttackStart(target); - SpawnFlyingBats_Timer = 10000 + rand()%5000; + SpawnFlyingBats_Timer = urand(10000, 15000); } else SpawnFlyingBats_Timer -=diff; } else diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp index 7c8e53038ab..9c82c3eddfb 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp @@ -83,7 +83,7 @@ class boss_jindo : public CreatureScript if (BrainWashTotem_Timer <= diff) { DoCast(me, SPELL_BRAINWASHTOTEM); - BrainWashTotem_Timer = 18000 + rand()%8000; + BrainWashTotem_Timer = urand(18000, 26000); } else BrainWashTotem_Timer -= diff; //HealingWard_Timer @@ -91,7 +91,7 @@ class boss_jindo : public CreatureScript { //DoCast(me, SPELL_POWERFULLHEALINGWARD); me->SummonCreature(14987, me->GetPositionX()+3, me->GetPositionY()-2, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000); - HealingWard_Timer = 14000 + rand()%6000; + HealingWard_Timer = urand(14000, 20000); } else HealingWard_Timer -= diff; //Hex_Timer @@ -102,7 +102,7 @@ class boss_jindo : public CreatureScript if (DoGetThreat(me->getVictim())) DoModifyThreatPercent(me->getVictim(), -80); - Hex_Timer = 12000 + rand()%8000; + Hex_Timer = urand(12000, 20000); } else Hex_Timer -= diff; //Casting the delusion curse with a shade. So shade will attack the same target with the curse. @@ -117,7 +117,7 @@ class boss_jindo : public CreatureScript Shade->AI()->AttackStart(target); } - Delusions_Timer = 4000 + rand()%8000; + Delusions_Timer = urand(4000, 12000); } else Delusions_Timer -= diff; //Teleporting a random gamer and spawning 9 skeletons that will attack this gamer @@ -162,7 +162,7 @@ class boss_jindo : public CreatureScript Skeletons->AI()->AttackStart(target); } - Teleport_Timer = 15000 + rand()%8000; + Teleport_Timer = urand(15000, 23000); } else Teleport_Timer -= diff; DoMeleeAttackIfReady(); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp index 7dc357f692a..06ae34b79b2 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp @@ -325,7 +325,7 @@ class mob_ohgan : public CreatureScript if (SunderArmor_Timer <= diff) { DoCast(me->getVictim(), SPELL_SUNDERARMOR); - SunderArmor_Timer = 10000 + rand()%5000; + SunderArmor_Timer = urand(10000, 15000); } else SunderArmor_Timer -= diff; DoMeleeAttackIfReady(); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp index f6704a50e6f..5dafa54a2ba 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp @@ -105,13 +105,13 @@ class boss_marli : public CreatureScript if (PoisonVolley_Timer <= diff) { DoCast(me->getVictim(), SPELL_POISONVOLLEY); - PoisonVolley_Timer = 10000 + rand()%10000; + PoisonVolley_Timer = urand(10000, 20000); } else PoisonVolley_Timer -= diff; if (!PhaseTwo && Aspect_Timer <= diff) { DoCast(me->getVictim(), SPELL_ASPECT_OF_MARLI); - Aspect_Timer = 13000 + rand()%5000; + Aspect_Timer = urand(13000, 18000); } else Aspect_Timer -= diff; if (!Spawned && SpawnStartSpiders_Timer <= diff) @@ -149,7 +149,7 @@ class boss_marli : public CreatureScript Creature* Spider = me->SummonCreature(15041, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (Spider) Spider->AI()->AttackStart(target); - SpawnSpider_Timer = 12000 + rand()%5000; + SpawnSpider_Timer = urand(12000, 17000); } else SpawnSpider_Timer -= diff; if (!PhaseTwo && Transform_Timer <= diff) diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp index bbff6a55ffb..c3bf09ee28d 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp @@ -55,11 +55,11 @@ class boss_renataki : public CreatureScript void Reset() { - Invisible_Timer = 8000 + rand()%10000; + Invisible_Timer = urand(8000, 18000); Ambush_Timer = 3000; Visible_Timer = 4000; - Aggro_Timer = 15000 + rand()%10000; - ThousandBlades_Timer = 4000 + rand()%4000; + Aggro_Timer = urand(15000, 25000); + ThousandBlades_Timer = urand(4000, 8000); Invisible = false; Ambushed = false; @@ -85,7 +85,7 @@ class boss_renataki : public CreatureScript me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); Invisible = true; - Invisible_Timer = 15000 + rand()%15000; + Invisible_Timer = urand(15000, 30000); } else Invisible_Timer -= diff; if (Invisible) @@ -135,13 +135,13 @@ class boss_renataki : public CreatureScript if (target) AttackStart(target); - Aggro_Timer = 7000 + rand()%13000; + Aggro_Timer = urand(7000, 20000); } else Aggro_Timer -= diff; if (ThousandBlades_Timer <= diff) { DoCast(me->getVictim(), SPELL_THOUSANDBLADES); - ThousandBlades_Timer = 7000 + rand()%5000; + ThousandBlades_Timer = urand(7000, 12000); } else ThousandBlades_Timer -= diff; } diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp index 4fbb5cd1109..743ec211529 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp @@ -167,13 +167,13 @@ class boss_thekal : public CreatureScript if (!PhaseTwo && MortalCleave_Timer <= diff) { DoCast(me->getVictim(), SPELL_MORTALCLEAVE); - MortalCleave_Timer = 15000 + rand()%5000; + MortalCleave_Timer = urand(15000, 20000); } else MortalCleave_Timer -= diff; if (!PhaseTwo && Silence_Timer <= diff) { DoCast(me->getVictim(), SPELL_SILENCE); - Silence_Timer = 20000 + rand()%5000; + Silence_Timer = urand(20000, 25000); } else Silence_Timer -= diff; if (!PhaseTwo && !WasDead && !HealthAbovePct(5)) @@ -226,7 +226,7 @@ class boss_thekal : public CreatureScript AttackStart(target); } - Charge_Timer = 15000 + rand()%7000; + Charge_Timer = urand(15000, 22000); } else Charge_Timer -= diff; if (Frenzy_Timer <= diff) @@ -238,13 +238,13 @@ class boss_thekal : public CreatureScript if (ForcePunch_Timer <= diff) { DoCast(me->getVictim(), SPELL_SILENCE); - ForcePunch_Timer = 16000 + rand()%5000; + ForcePunch_Timer = urand(16000, 21000); } else ForcePunch_Timer -= diff; if (SummonTigers_Timer <= diff) { DoCast(me->getVictim(), SPELL_SUMMONTIGERS); - SummonTigers_Timer = 10000 + rand()%4000; + SummonTigers_Timer = urand(10000, 14000); } else SummonTigers_Timer -= diff; if (HealthBelowPct(11) && !Enraged) diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp index 7288d063c21..179935524a8 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp @@ -47,8 +47,8 @@ class boss_wushoolay : public CreatureScript void Reset() { - LightningCloud_Timer = 5000 + rand()%5000; - LightningWave_Timer = 8000 + rand()%8000; + LightningCloud_Timer = urand(5000, 10000); + LightningWave_Timer = urand(8000, 16000); } void EnterCombat(Unit* /*who*/) @@ -64,7 +64,7 @@ class boss_wushoolay : public CreatureScript if (LightningCloud_Timer <= diff) { DoCast(me->getVictim(), SPELL_LIGHTNINGCLOUD); - LightningCloud_Timer = 15000 + rand()%5000; + LightningCloud_Timer = urand(15000, 20000); } else LightningCloud_Timer -= diff; //LightningWave_Timer @@ -74,7 +74,7 @@ class boss_wushoolay : public CreatureScript target = SelectTarget(SELECT_TARGET_RANDOM, 0); if (target) DoCast(target, SPELL_LIGHTNINGWAVE); - LightningWave_Timer = 12000 + rand()%4000; + LightningWave_Timer = urand(12000, 16000); } else LightningWave_Timer -= diff; DoMeleeAttackIfReady(); diff --git a/src/server/scripts/EasternKingdoms/eversong_woods.cpp b/src/server/scripts/EasternKingdoms/eversong_woods.cpp index d02cce3f17c..d9171308ba6 100644 --- a/src/server/scripts/EasternKingdoms/eversong_woods.cpp +++ b/src/server/scripts/EasternKingdoms/eversong_woods.cpp @@ -204,7 +204,7 @@ public: if (timerJustice <= diff) { DoCast(me, SPELL_SEAL_OF_JUSTICE); - timerJustice = 10000 + rand()%10000; + timerJustice = urand(10000, 20000); } else timerJustice -= diff; @@ -215,7 +215,7 @@ public: if (timerJudLight <= diff) { DoCast(me, SPELL_JUDGEMENT_OF_LIGHT); - timerJudLight = 10000 + rand()%10000; + timerJudLight = urand(10000, 20000); } else timerJudLight -= diff; @@ -226,7 +226,7 @@ public: if (timerCommand <= diff) { DoCast(me, SPELL_SEAL_OF_COMMAND); - timerCommand = 20000 + rand()%20000; + timerCommand = urand(20000, 40000); } else timerCommand -= diff; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp index f681b245a42..35de4c70214 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp @@ -105,15 +105,15 @@ public: ai->EnterEvadeMode(); ai->Spells[0].SpellId = SPELL_BLIZZARD; - ai->Spells[0].Cooldown = 15000 + rand()%20000; + ai->Spells[0].Cooldown = urand(15000, 35000); ai->Spells[0].TargetType = TARGETTYPE_RANDOM; ai->Spells[1].SpellId = SPELL_PYROBLAST; - ai->Spells[1].Cooldown = 5500 + rand()%4000; + ai->Spells[1].Cooldown = urand(5500, 9500); ai->Spells[1].TargetType = TARGETTYPE_RANDOM; ai->Spells[2].SpellId = SPELL_SUMMON_ELEMENTALS; - ai->Spells[2].Cooldown = 15000 + rand()%30000; + ai->Spells[2].Cooldown = urand(15000, 45000); ai->Spells[2].TargetType = TARGETTYPE_SELF; return ai; @@ -187,11 +187,11 @@ public: ai->EnterEvadeMode(); ai->Spells[0].SpellId = SPELL_CHAIN_LIGHTNING; - ai->Spells[0].Cooldown = 3000 + rand()%5000; + ai->Spells[0].Cooldown = urand(3000, 8000); ai->Spells[0].TargetType = TARGETTYPE_VICTIM; ai->Spells[1].SpellId = SPELL_SUMMON_DIRE_WOLF; - ai->Spells[1].Cooldown = 6000 + rand()%35000; + ai->Spells[1].Cooldown = urand(6000, 41000); ai->Spells[1].TargetType = TARGETTYPE_RANDOM; return ai; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp index f09308a6724..488c7195534 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp @@ -68,9 +68,9 @@ public: void Reset() { - Holy_Light_Timer = 20000 + rand()%10000; + Holy_Light_Timer = urand(20000, 30000); Cleanse_Timer = 10000; - HammerOfJustice_Timer = 20000 + rand()%15000; + HammerOfJustice_Timer = urand(20000, 35000); HolyShield_Timer = 240000; DevotionAura_Timer = 3000; Consecration_Timer = 8000; @@ -134,14 +134,14 @@ public: if (DevotionAura_Timer <= diff) { DoCast(me, SPELL_DEVOTION_AURA); - DevotionAura_Timer = 45000 + rand()%10000; + DevotionAura_Timer = urand(45000, 55000); } else DevotionAura_Timer -= diff; //Consecration if (Consecration_Timer <= diff) { //DoCast(me->getVictim(), SPELL_CONSECRATION); - Consecration_Timer = 5000 + rand()%5000; + Consecration_Timer = urand(5000, 10000); } else Consecration_Timer -= diff; DoMeleeAttackIfReady(); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp index 5b201e50bcb..9e6957a5e0c 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp @@ -68,8 +68,8 @@ public: void Reset() { - SandBreath_Timer = 8000 + rand()%8000; - ImpendingDeath_Timer = 25000 + rand()%5000; + SandBreath_Timer = urand(8000, 16000); + ImpendingDeath_Timer = urand(25000, 30000); WingBuffet_Timer = 35000; Mda_Timer = 40000; } @@ -108,7 +108,7 @@ public: DoScriptText(RAND(SAY_BREATH1, SAY_BREATH2), me); - SandBreath_Timer = 10000 + rand()%10000; + SandBreath_Timer = urand(10000, 20000); } else SandBreath_Timer -= diff; if (ImpendingDeath_Timer <= diff) diff --git a/src/server/scripts/Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp b/src/server/scripts/Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp index 7ade38dba8e..fd1966d106c 100644 --- a/src/server/scripts/Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp +++ b/src/server/scripts/Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp @@ -61,7 +61,7 @@ public: { AmnenarsWrath_Timer = 8000; FrostBolt_Timer = 1000; - FrostNova_Timer = 10000 + rand()%5000; + FrostNova_Timer = urand(10000, 15000); Spectrals30 = false; Spectrals60 = false; Hp = false; diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp index 1a9d3f7a557..34b481c97f4 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp @@ -65,8 +65,8 @@ public: void Reset() { - Cleave_Timer = 4000 + rand()%4000; - ToxicVolley_Timer = 6000 + rand()%6000; + Cleave_Timer = urand(4000, 8000); + ToxicVolley_Timer = urand(6000, 12000); Check_Timer = 2000; VemDead = false; @@ -98,14 +98,14 @@ public: if (Cleave_Timer <= diff) { DoCast(me->getVictim(), SPELL_CLEAVE); - Cleave_Timer = 5000 + rand()%7000; + Cleave_Timer = urand(5000, 12000); } else Cleave_Timer -= diff; //ToxicVolley_Timer if (ToxicVolley_Timer <= diff) { DoCast(me->getVictim(), SPELL_TOXIC_VOLLEY); - ToxicVolley_Timer = 10000 + rand()%5000; + ToxicVolley_Timer = urand(10000, 15000); } else ToxicVolley_Timer -= diff; if (!HealthAbovePct(5) && !Death) @@ -161,8 +161,8 @@ public: void Reset() { - Charge_Timer = 15000 + rand()%12000; - KnockBack_Timer = 8000 + rand()%12000; + Charge_Timer = urand(15000, 27000); + KnockBack_Timer = urand(8000, 20000); Enrage_Timer = 120000; Enraged = false; @@ -202,7 +202,7 @@ public: AttackStart(target); } - Charge_Timer = 8000 + rand()%8000; + Charge_Timer = urand(8000, 16000); } else Charge_Timer -= diff; //KnockBack_Timer @@ -211,7 +211,7 @@ public: DoCast(me->getVictim(), SPELL_KNOCKBACK); if (DoGetThreat(me->getVictim())) DoModifyThreatPercent(me->getVictim(), -80); - KnockBack_Timer = 15000 + rand()%10000; + KnockBack_Timer = urand(15000, 25000); } else KnockBack_Timer -= diff; //Enrage_Timer @@ -254,8 +254,8 @@ public: void Reset() { - Heal_Timer = 25000 + rand()%15000; - Fear_Timer = 12000 + rand()%12000; + Heal_Timer = urand(25000, 40000); + Fear_Timer = urand(12000, 24000); Check_Timer = 2000; VemDead = false; diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp index 9d83bfea866..505907cd0f5 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp @@ -63,9 +63,9 @@ public: void Reset() { - MortalWound_Timer = 10000 + rand()%5000; - SpawnHatchlings_Timer = 6000 + rand()%6000; - SpawnSpawns_Timer = 15000 + rand()%30000; + MortalWound_Timer = urand(10000, 15000); + SpawnHatchlings_Timer = urand(6000, 12000); + SpawnSpawns_Timer = urand(15000, 45000); } void SummonSpawn(Unit* victim) @@ -106,7 +106,7 @@ public: if (MortalWound_Timer <= diff) { DoCast(me->getVictim(), SPELL_MORTAL_WOUND); - MortalWound_Timer = 10000 + rand()%10000; + MortalWound_Timer = urand(10000, 20000); } else MortalWound_Timer -= diff; //Summon 1-3 Spawns of Fankriss at random time. @@ -127,7 +127,7 @@ public: SummonSpawn(SelectTarget(SELECT_TARGET_RANDOM, 0)); break; } - SpawnSpawns_Timer = 30000 + rand()%30000; + SpawnSpawns_Timer = urand(30000, 60000); } else SpawnSpawns_Timer -= diff; // Teleporting Random Target to one of the three tunnels and spawn 4 hatchlings near the gamer. @@ -194,7 +194,7 @@ public: break; } } - SpawnHatchlings_Timer = 45000 + rand()%15000; + SpawnHatchlings_Timer = urand(45000, 60000); } else SpawnHatchlings_Timer -= diff; } diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp index f8cafea0ef2..d6d23cf7426 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp @@ -61,11 +61,11 @@ public: void Reset() { - Frenzy_Timer = 25000 + rand()%10000; - Wyvern_Timer = 18000 + rand()%10000; + Frenzy_Timer = urand(25000, 35000); + Wyvern_Timer = urand(18000, 28000); Spit_Timer = 8000; PoisonBolt_Timer = 4000; - NoxiousPoison_Timer = 10000 + rand()%10000; + NoxiousPoison_Timer = urand(10000, 20000); FrenzyBack_Timer = 15000; Frenzy = false; @@ -89,7 +89,7 @@ public: DoScriptText(EMOTE_GENERIC_FRENZY_KILL, me); Frenzy = true; PoisonBolt_Timer = 3000; - Frenzy_Timer = 25000 + rand()%10000; + Frenzy_Timer = urand(25000, 35000); } else Frenzy_Timer -= diff; // Wyvern Timer @@ -97,21 +97,21 @@ public: { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_WYVERNSTING); - Wyvern_Timer = 15000 + rand()%17000; + Wyvern_Timer = urand(15000, 32000); } else Wyvern_Timer -= diff; //Spit Timer if (Spit_Timer <= diff) { DoCast(me->getVictim(), SPELL_ACIDSPIT); - Spit_Timer = 5000 + rand()%5000; + Spit_Timer = urand(5000, 10000); } else Spit_Timer -= diff; //NoxiousPoison_Timer if (NoxiousPoison_Timer <= diff) { DoCast(me->getVictim(), SPELL_NOXIOUSPOISON); - NoxiousPoison_Timer = 12000 + rand()%12000; + NoxiousPoison_Timer = urand(12000, 24000); } else NoxiousPoison_Timer -= diff; //PoisonBolt only if frenzy or berserk diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp index 01d26ed7726..4595e4e5095 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp @@ -59,12 +59,12 @@ public: void Reset() { - Sweep_Timer = 5000 + rand()%5000; - SandBlast_Timer = 20000 + rand()%15000; - Submerge_Timer = 90000 + rand()%60000; - Back_Timer = 30000 + rand()%15000; - ChangeTarget_Timer = 5000 + rand()%3000; - Spawn_Timer = 10000 + rand()%10000; + Sweep_Timer = urand(5000, 10000); + SandBlast_Timer = urand(20000, 35000); + Submerge_Timer = urand(90000, 150000); + Back_Timer = urand(30000, 45000); + ChangeTarget_Timer = urand(5000, 8000); + Spawn_Timer = urand(10000, 20000); Enrage = false; Submerged = false; @@ -85,14 +85,14 @@ public: if (!Submerged && Sweep_Timer <= diff) { DoCast(me->getVictim(), SPELL_SWEEP); - Sweep_Timer = 15000 + rand()%15000; + Sweep_Timer = urand(15000, 30000); } else Sweep_Timer -= diff; //SandBlast_Timer if (!Submerged && SandBlast_Timer <= diff) { DoCast(me->getVictim(), SPELL_SANDBLAST); - SandBlast_Timer = 20000 + rand()%15000; + SandBlast_Timer = urand(20000, 35000); } else SandBlast_Timer -= diff; //Submerge_Timer @@ -105,7 +105,7 @@ public: DoCast(me, SPELL_DIRTMOUND_PASSIVE); Submerged = true; - Back_Timer = 30000 + rand()%15000; + Back_Timer = urand(30000, 45000); } else Submerge_Timer -= diff; //ChangeTarget_Timer @@ -117,7 +117,7 @@ public: if (target) DoTeleportTo(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ()); - ChangeTarget_Timer = 10000 + rand()%10000; + ChangeTarget_Timer = urand(10000, 20000); } else ChangeTarget_Timer -= diff; //Back_Timer @@ -129,7 +129,7 @@ public: DoCast(me->getVictim(), SPELL_GROUND_RUPTURE); Submerged = false; - Submerge_Timer = 60000 + rand()%60000; + Submerge_Timer = urand(60000, 120000); } else Back_Timer -= diff; DoMeleeAttackIfReady(); diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp index fb16d2b7319..27aa72d3e55 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp @@ -66,9 +66,9 @@ public: void Reset() { WhirlWind_Timer = 30000; - WhirlWindRandom_Timer = 3000 + rand()%4000; + WhirlWindRandom_Timer = urand(3000, 7000); WhirlWindEnd_Timer = 15000; - AggroReset_Timer = 45000 + rand()%10000; + AggroReset_Timer = urand(45000, 55000); AggroResetEnd_Timer = 5000; EnrageHard_Timer = 10*60000; @@ -111,13 +111,13 @@ public: me->TauntApply(target); AttackStart(target); } - WhirlWindRandom_Timer = 3000 + rand()%4000; + WhirlWindRandom_Timer = urand(3000, 7000); } else WhirlWindRandom_Timer -= diff; if (WhirlWindEnd_Timer <= diff) { WhirlWind = false; - WhirlWind_Timer = 25000 + rand()%15000; + WhirlWind_Timer = urand(25000, 40000); } else WhirlWindEnd_Timer -= diff; } @@ -140,7 +140,7 @@ public: AttackStart(target); } AggroReset = true; - AggroReset_Timer = 2000 + rand()%3000; + AggroReset_Timer = urand(2000, 5000); } else AggroReset_Timer -= diff; if (AggroReset) @@ -149,7 +149,7 @@ public: { AggroReset = false; AggroResetEnd_Timer = 5000; - AggroReset_Timer = 35000 + rand()%10000; + AggroReset_Timer = urand(35000, 45000); } else AggroResetEnd_Timer -= diff; } @@ -207,9 +207,9 @@ public: void Reset() { WhirlWind_Timer = 30000; - WhirlWindRandom_Timer = 3000 + rand()%4000; + WhirlWindRandom_Timer = urand(3000, 7000); WhirlWindEnd_Timer = 15000; - AggroReset_Timer = 45000 + rand()%10000; + AggroReset_Timer = urand(45000, 55000); AggroResetEnd_Timer = 5000; KnockBack_Timer = 10000; @@ -231,7 +231,7 @@ public: { DoCast(me, SPELL_WHIRLWINDADD); WhirlWind = true; - WhirlWind_Timer = 25000 + rand()%15000; + WhirlWind_Timer = urand(25000, 40000); WhirlWindEnd_Timer = 15000; } else WhirlWind_Timer -= diff; @@ -247,7 +247,7 @@ public: AttackStart(target); } - WhirlWindRandom_Timer = 3000 + rand()%4000; + WhirlWindRandom_Timer = urand(3000, 7000); } else WhirlWindRandom_Timer -= diff; if (WhirlWindEnd_Timer <= diff) @@ -269,13 +269,13 @@ public: } AggroReset = true; - AggroReset_Timer = 2000 + rand()%3000; + AggroReset_Timer = urand(2000, 5000); } else AggroReset_Timer -= diff; if (KnockBack_Timer <= diff) { DoCast(me, SPELL_WHIRLWINDADD); - KnockBack_Timer = 10000 + rand()%10000; + KnockBack_Timer = urand(10000, 20000); } else KnockBack_Timer -= diff; } @@ -285,7 +285,7 @@ public: { AggroReset = false; AggroResetEnd_Timer = 5000; - AggroReset_Timer = 30000 + rand()%10000; + AggroReset_Timer = urand(30000, 40000); } else AggroResetEnd_Timer -= diff; } diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp index 0ba6bdb1154..c9a9865e36e 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp @@ -82,10 +82,10 @@ public: void Reset() { - ArcaneExplosion_Timer = 6000 + rand()%6000; + ArcaneExplosion_Timer = urand(6000, 12000); EarthShock_Timer = 2000; FullFillment_Timer = 15000; - Blink_Timer = 8000 + rand()%12000; + Blink_Timer = urand(8000, 20000); Invisible_Timer = 500; Images75 = false; @@ -128,7 +128,7 @@ public: if (ArcaneExplosion_Timer <= diff) { DoCast(me->getVictim(), SPELL_ARCANE_EXPLOSION); - ArcaneExplosion_Timer = 8000 + rand()%10000; + ArcaneExplosion_Timer = urand(8000, 18000); } else ArcaneExplosion_Timer -= diff; //If we are within range melee the target @@ -171,7 +171,7 @@ public: } DoStopAttack(); - Blink_Timer= 20000 + rand()%20000; + Blink_Timer= urand(20000, 40000); } else Blink_Timer -= diff; int procent = (int) (me->GetHealthPct() + 0.5f); diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp index 29b92957ace..b005f9d0953 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp @@ -88,7 +88,7 @@ struct boss_twinemperorsAI : public ScriptedAI AfterTeleport = false; tspellcasted = false; AfterTeleportTimer = 0; - Abuse_Bug_Timer = 10000 + rand()%7000; + Abuse_Bug_Timer = urand(10000, 17000); BugsTimer = 2000; me->ClearUnitState(UNIT_STAT_STUNNED); DontYellWhenDead = false; @@ -347,7 +347,7 @@ struct boss_twinemperorsAI : public ScriptedAI if (c) { CastSpellOnBug(c); - Abuse_Bug_Timer = 10000 + rand()%7000; + Abuse_Bug_Timer = urand(10000, 17000); } else { @@ -407,9 +407,9 @@ public: void Reset() { TwinReset(); - UpperCut_Timer = 14000 + rand()%15000; - UnbalancingStrike_Timer = 8000 + rand()%10000; - Scarabs_Timer = 7000 + rand()%7000; + UpperCut_Timer = urand(14000, 29000); + UnbalancingStrike_Timer = urand(8000, 18000); + Scarabs_Timer = urand(7000, 14000); //Added. Can be removed if its included in DB. me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true); @@ -495,9 +495,9 @@ public: { TwinReset(); ShadowBolt_Timer = 0; - Blizzard_Timer = 15000 + rand()%5000; + Blizzard_Timer = urand(15000, 20000); ArcaneBurst_Timer = 1000; - Scorpions_Timer = 7000 + rand()%7000; + Scorpions_Timer = urand(7000, 14000); //Added. Can be removed if its included in DB. me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true); diff --git a/src/server/scripts/Kalimdor/azuremyst_isle.cpp b/src/server/scripts/Kalimdor/azuremyst_isle.cpp index 57ff1448a7e..1898186f615 100644 --- a/src/server/scripts/Kalimdor/azuremyst_isle.cpp +++ b/src/server/scripts/Kalimdor/azuremyst_isle.cpp @@ -243,7 +243,7 @@ public: void Reset() { Dynamite_Timer = 8000; - Emote_Timer = 120000 + rand()%30000; + Emote_Timer = urand(120000, 150000); me->setFaction(NormFaction); me->SetUInt32Value(UNIT_NPC_FLAGS, NpcFlags); @@ -264,7 +264,7 @@ public: { DoScriptText(SAY_TEXT, me); DoScriptText(SAY_EMOTE, me); - Emote_Timer = 120000 + rand()%30000; + Emote_Timer = urand(120000, 150000); } else Emote_Timer -= diff; } else if (IsTreeEvent) diff --git a/src/server/scripts/Kalimdor/boss_azuregos.cpp b/src/server/scripts/Kalimdor/boss_azuregos.cpp index 6bbc29dcc56..19b5e36e113 100644 --- a/src/server/scripts/Kalimdor/boss_azuregos.cpp +++ b/src/server/scripts/Kalimdor/boss_azuregos.cpp @@ -62,11 +62,11 @@ public: void Reset() { MarkOfFrost_Timer = 35000; - ManaStorm_Timer = 5000 + rand()%12000; - Chill_Timer = 10000 + rand()%20000; - Breath_Timer = 2000 + rand()%6000; + ManaStorm_Timer = urand(5000, 17000); + Chill_Timer = urand(10000, 30000); + Breath_Timer = urand(2000, 8000); Teleport_Timer = 30000; - Reflect_Timer = 15000 + rand()%15000; + Reflect_Timer = urand(15000, 30000); Cleave_Timer = 7000; Enrage_Timer = 0; Enraged = false; @@ -109,14 +109,14 @@ public: if (Chill_Timer <= diff) { DoCast(me->getVictim(), SPELL_CHILL); - Chill_Timer = 13000 + rand()%12000; + Chill_Timer = urand(13000, 25000); } else Chill_Timer -= diff; //Breath_Timer if (Breath_Timer <= diff) { DoCast(me->getVictim(), SPELL_FROSTBREATH); - Breath_Timer = 10000 + rand()%5000; + Breath_Timer = urand(10000, 15000); } else Breath_Timer -= diff; //ManaStorm_Timer @@ -124,14 +124,14 @@ public: { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_MANASTORM); - ManaStorm_Timer = 7500 + rand()%5000; + ManaStorm_Timer = urand(7500, 12500); } else ManaStorm_Timer -= diff; //Reflect_Timer if (Reflect_Timer <= diff) { DoCast(me, SPELL_REFLECT); - Reflect_Timer = 20000 + rand()%15000; + Reflect_Timer = urand(20000, 35000); } else Reflect_Timer -= diff; //Cleave_Timer diff --git a/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp b/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp index c2107e88b2e..9096282c3f6 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp @@ -111,7 +111,7 @@ public: { _EnterCombat(); DoScriptText(SAY_AGGRO, me); - events.ScheduleEvent(EVENT_IMPALE, 10000 + rand()%10000); + events.ScheduleEvent(EVENT_IMPALE, urand(10000, 20000)); events.ScheduleEvent(EVENT_LOCUST, 90000); events.ScheduleEvent(EVENT_BERSERK, 600000); diff --git a/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp b/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp index 04627981ef3..b7d74c02dd8 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp @@ -107,7 +107,7 @@ public: events.ScheduleEvent(EVENT_CURSE, 10000+rand()%15000); events.ScheduleEvent(EVENT_WARRIOR, 30000); if (GetDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL) - events.ScheduleEvent(EVENT_BLINK, 20000 + rand()%20000); + events.ScheduleEvent(EVENT_BLINK, urand(20000, 40000)); } } @@ -153,7 +153,7 @@ public: { case EVENT_CURSE: DoCastAOE(SPELL_CURSE_PLAGUEBRINGER); - events.ScheduleEvent(EVENT_CURSE, 50000 + rand()%10000); + events.ScheduleEvent(EVENT_CURSE, urand(50000, 60000)); return; case EVENT_WARRIOR: DoScriptText(SAY_SUMMON, me); @@ -173,7 +173,7 @@ public: me->RemoveAllAuras(); me->NearTeleportTo(TELE_X, TELE_Y, TELE_Z, TELE_O); events.Reset(); - events.ScheduleEvent(EVENT_WAVE, 2000 + rand()%3000); + events.ScheduleEvent(EVENT_WAVE, urand(2000, 5000)); waveCount = 0; return; case EVENT_WAVE: @@ -188,7 +188,7 @@ public: SummonUndead(MOB_GUARDIAN, RAID_MODE(5, 10));break; } ++waveCount; - events.ScheduleEvent(waveCount < 2 ? EVENT_WAVE : EVENT_GROUND, 30000 + rand()%15000); + events.ScheduleEvent(waveCount < 2 ? EVENT_WAVE : EVENT_GROUND, urand(30000, 45000)); return; case EVENT_GROUND: { diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp index 8c97766f787..5e2b6551f84 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp @@ -131,7 +131,7 @@ public: m_uiChargingStatus = 0; m_uiCharge_Timer = 1000; - m_uiChangeStance_Timer = 20000 + rand()%5000; + m_uiChangeStance_Timer = urand(20000, 25000); m_uiReflection_Timer = 8000; m_uiKnockAway_Timer = 20000; @@ -252,7 +252,7 @@ public: break; } - m_uiChangeStance_Timer = 20000 + rand()%5000; + m_uiChangeStance_Timer = urand(20000, 25000); return; } else @@ -265,7 +265,7 @@ public: if (m_uiReflection_Timer <= uiDiff) { DoCast(me, SPELL_SPELL_REFLECTION); - m_uiReflection_Timer = 8000 + rand()%1000; + m_uiReflection_Timer = urand(8000, 9000); } else m_uiReflection_Timer -= uiDiff; @@ -273,7 +273,7 @@ public: if (m_uiKnockAway_Timer <= uiDiff) { DoCast(me, SPELL_KNOCK_AWAY); - m_uiKnockAway_Timer = 20000 + rand()%1000; + m_uiKnockAway_Timer = urand(20000, 21000); } else m_uiKnockAway_Timer -= uiDiff; @@ -281,7 +281,7 @@ public: if (m_uiPummel_Timer <= uiDiff) { DoCast(me->getVictim(), SPELL_PUMMEL); - m_uiPummel_Timer = 10000 + rand()%1000; + m_uiPummel_Timer = urand(10000, 11000); } else m_uiPummel_Timer -= uiDiff; @@ -289,7 +289,7 @@ public: if (m_uiIronform_Timer <= uiDiff) { DoCast(me, SPELL_IRONFORM); - m_uiIronform_Timer = 25000 + rand()%1000; + m_uiIronform_Timer = urand(25000, 26000); } else m_uiIronform_Timer -= uiDiff; @@ -302,7 +302,7 @@ public: { //not much point is this, better random target and more often? DoCast(me->getVictim(), SPELL_INTERCEPT); - m_uiIntercept_Timer = 45000 + rand()%1000; + m_uiIntercept_Timer = urand(45000, 46000); } else m_uiIntercept_Timer -= uiDiff; @@ -310,7 +310,7 @@ public: if (m_uiWhirlwind_Timer <= uiDiff) { DoCast(me, SPELL_WHIRLWIND); - m_uiWhirlwind_Timer = 10000 + rand()%1000; + m_uiWhirlwind_Timer = urand(10000, 11000); } else m_uiWhirlwind_Timer -= uiDiff; @@ -318,7 +318,7 @@ public: if (m_uiCleave_Timer <= uiDiff) { DoCast(me->getVictim(), SPELL_CLEAVE); - m_uiCleave_Timer = 8000 + rand()%1000; + m_uiCleave_Timer = urand(8000, 9000); } else m_uiCleave_Timer -= uiDiff; @@ -330,7 +330,7 @@ public: if (m_uiMortalStrike_Timer <= uiDiff) { DoCast(me->getVictim(), SPELL_MORTAL_STRIKE); - m_uiMortalStrike_Timer = 20000 + rand()%1000; + m_uiMortalStrike_Timer = urand(20000, 21000); } else m_uiMortalStrike_Timer -= uiDiff; @@ -338,7 +338,7 @@ public: if (m_uiSlam_Timer <= uiDiff) { DoCast(me->getVictim(), SPELL_SLAM); - m_uiSlam_Timer = 15000 + rand()%1000; + m_uiSlam_Timer = urand(15000, 16000); } else m_uiSlam_Timer -= uiDiff; @@ -381,8 +381,8 @@ public: void Reset() { - m_uiArcWeld_Timer = 20000 + rand()%1000; - m_uiRenewSteel_Timer = 10000 + rand()%1000; + m_uiArcWeld_Timer = urand(20000, 21000); + m_uiRenewSteel_Timer = urand(10000, 11000); } void EnterCombat(Unit* who) @@ -406,7 +406,7 @@ public: if (m_uiArcWeld_Timer <= uiDiff) { DoCast(me->getVictim(), SPELL_ARC_WELD); - m_uiArcWeld_Timer = 20000 + rand()%1000; + m_uiArcWeld_Timer = urand(20000, 21000); } else m_uiArcWeld_Timer -= uiDiff; @@ -421,7 +421,7 @@ public: DoCast(pBjarngrim, SPELL_RENEW_STEEL_N); } } - m_uiRenewSteel_Timer = 10000 + rand()%4000; + m_uiRenewSteel_Timer = urand(10000, 14000); } else m_uiRenewSteel_Timer -= uiDiff; diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp index a5ea1868686..d90704dd352 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp @@ -183,7 +183,7 @@ public: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_ARC_LIGHTNING); - m_uiArcLightning_Timer = 15000 + rand()%1000; + m_uiArcLightning_Timer = urand(15000, 16000); } else m_uiArcLightning_Timer -= uiDiff; @@ -196,7 +196,7 @@ public: m_bIsAura = false; m_uiResumePulsingShockwave_Timer = DUNGEON_MODE(5000, 4000); // Pause Pulsing Shockwave aura - m_uiLightningNova_Timer = 20000 + rand()%1000; + m_uiLightningNova_Timer = urand(20000, 21000); } else m_uiLightningNova_Timer -= uiDiff; diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp index 375862c141c..65b5d3eaad1 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp @@ -80,10 +80,10 @@ public: { bIsSlam = false; - uiBoulderTossTimer = 3000 + rand()%6000; - uiGroundSpikeTimer = 9000 + rand()%5000; - uiGroundSlamTimer = 15000 + rand()%3000; - uiStompTimer = 20000 + rand()%9000; + uiBoulderTossTimer = urand(3000, 9000); + uiGroundSpikeTimer = urand(9000, 14000); + uiGroundSlamTimer = urand(15000, 18000); + uiStompTimer = urand(20000, 29000); uiShatterTimer = 0; if (instance) @@ -107,20 +107,20 @@ public: { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) DoCast(target, SPELL_BOULDER_TOSS); - uiBoulderTossTimer = 9000 + rand()%6000; + uiBoulderTossTimer = urand(9000, 15000); } else uiBoulderTossTimer -= diff; if (uiGroundSpikeTimer <= diff) { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) DoCast(target, SPELL_GROUND_SPIKE); - uiGroundSpikeTimer = 12000 + rand()%5000; + uiGroundSpikeTimer = urand(12000, 17000); } else uiGroundSpikeTimer -= diff; if (uiStompTimer <= diff) { DoCast(me, SPELL_STOMP); - uiStompTimer = 20000 + rand()%9000; + uiStompTimer = urand(20000, 29000); } else uiStompTimer -= diff; if (uiGroundSlamTimer <= diff) @@ -128,7 +128,7 @@ public: DoCast(me, SPELL_GROUND_SLAM); bIsSlam = true; uiShatterTimer = 10000; - uiGroundSlamTimer = 15000 + rand()%3000; + uiGroundSlamTimer = urand(15000, 18000); } else uiGroundSlamTimer -= diff; if (bIsSlam) diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp index 4ab09dbf67a..4f512089119 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp @@ -79,10 +79,10 @@ public: void Reset() { - PartingSorrowTimer = 25000 + rand()%5000; + PartingSorrowTimer = urand(25000, 30000); StormOfGriefTimer = 10000; ShockOfSorrowTimer = 20000+rand()%5000; - PillarOfWoeTimer = 5000 + rand()%10000; + PillarOfWoeTimer = urand(5000, 15000); if (instance) { @@ -124,14 +124,14 @@ public: if (target) DoCast(target, SPELL_PARTING_SORROW); - PartingSorrowTimer = 30000 + rand()%10000; + PartingSorrowTimer = urand(30000, 40000); } else PartingSorrowTimer -= diff; } if (StormOfGriefTimer <= diff) { DoCast(me->getVictim(), SPELL_STORM_OF_GRIEF_N, true); - StormOfGriefTimer = 15000 + rand()%5000; + StormOfGriefTimer = urand(15000, 20000); } else StormOfGriefTimer -= diff; if (ShockOfSorrowTimer <= diff) @@ -139,7 +139,7 @@ public: DoResetThreat(); DoScriptText(SAY_STUN, me); DoCast(me, SPELL_SHOCK_OF_SORROW_N); - ShockOfSorrowTimer = 20000 + rand()%10000; + ShockOfSorrowTimer = urand(20000, 30000); } else ShockOfSorrowTimer -= diff; if (PillarOfWoeTimer <= diff) @@ -151,7 +151,7 @@ public: else DoCast(me->getVictim(), SPELL_PILLAR_OF_WOE_N); - PillarOfWoeTimer = 5000 + rand()%20000; + PillarOfWoeTimer = urand(5000, 25000); } else PillarOfWoeTimer -= diff; DoMeleeAttackIfReady(); diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp index 41dcd77d4bc..dd61fe549c3 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp @@ -115,10 +115,10 @@ public: bIsFrenzy = false; uiEncounterTimer = 0; - uiChainLightningTimer = 3000 + rand()%5000; - uiLightningShieldTimer = 20000 + rand()%5000; - uiStaticChargeTimer = 20000 + rand()%5000; - uiLightningRingTimer = 30000 + rand()%5000; + uiChainLightningTimer = urand(3000, 8000); + uiLightningShieldTimer = urand(20000, 25000); + uiStaticChargeTimer = urand(20000, 25000); + uiLightningRingTimer = urand(30000, 35000); uiSummonTimer = 5000; uiFrenzyTimer = 300000; //5 minutes abuseTheOoze = 0; @@ -158,7 +158,7 @@ public: { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) DoCast(target, SPELL_CHAIN_LIGHTING); - uiChainLightningTimer = 10000 + rand()%5000; + uiChainLightningTimer = urand(10000, 15000); } else uiChainLightningTimer -= diff; if (uiLightningShieldTimer <= diff) @@ -170,7 +170,7 @@ public: if (uiStaticChargeTimer <= diff) { DoCast(me->getVictim(), SPELL_STATIC_CHARGE); - uiStaticChargeTimer = 20000 + rand()%5000; + uiStaticChargeTimer = urand(20000, 25000); } uiStaticChargeTimer -= diff; if (uiLightningRingTimer <= diff) @@ -178,7 +178,7 @@ public: if (me->IsNonMeleeSpellCasted(false)) me->InterruptNonMeleeSpells(false); DoCast(me, SPELL_LIGHTING_RING); - uiLightningRingTimer = 30000 + rand()%5000; + uiLightningRingTimer = urand(30000, 35000); } else uiLightningRingTimer -= diff; if (uiSummonTimer <= diff) diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp index ec1464a5d6f..273a0bf6f8e 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp @@ -239,7 +239,7 @@ public: summon->CastSpell(target, DUNGEON_MODE(SPELL_DARK_MATTER, H_SPELL_DARK_MATTER), true); } } - uiMarnakEncounterTimer = 30000 + rand()%1000; + uiMarnakEncounterTimer = urand(30000, 31000); } else uiMarnakEncounterTimer -= diff; } if (bAbedneumActivated) @@ -255,7 +255,7 @@ public: summon->CastSpell(target, DUNGEON_MODE(SPELL_SEARING_GAZE, H_SPELL_SEARING_GAZE), true); } } - uiAbedneumEncounterTimer = 30000 + rand()%1000; + uiAbedneumEncounterTimer = urand(30000, 31000); } else uiAbedneumEncounterTimer -= diff; } } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon.cpp index 3888cc43bc9..1892702d336 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon.cpp @@ -143,7 +143,7 @@ public: uiPhase_timer = 0; Ascend_Timer = 480000; //8 minutes - QuantumStrike_Timer = 4000 + rand()%10000; + QuantumStrike_Timer = urand(4000, 14000); Berserk_Timer = 360000; //6 minutes CollapsingStar_Timer = urand(15000, 20000); //Spawns between 15 to 20 seconds BigBang_Timer = 90000; diff --git a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp index a9f84016a04..71de7177e2b 100644 --- a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp +++ b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp @@ -340,7 +340,7 @@ public: if (Mortal_Strike_timer <= diff) { DoCast(me->getVictim(), SPELL_AV_MORTAL_STRIKE); - Mortal_Strike_timer = 10000 + rand()%20 * 1000; + Mortal_Strike_timer = urand(10, 30) * 1000; } else Mortal_Strike_timer -= diff; DoMeleeAttackIfReady(); diff --git a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp index 829f681982f..8a7eefbf633 100644 --- a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp +++ b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp @@ -162,20 +162,20 @@ public: me->InterruptNonMeleeSpells(true); DoCast(me, SPELL_FROSTNOVA); - FrostNova_Timer = 17500 + rand()%7500; + FrostNova_Timer = urand(17500, 25000); CanBlink = true; } else FrostNova_Timer -= diff; if (Frostbolt_Timer <= diff) { DoCast(me->getVictim(), SPELL_FROSTBOLT); - Frostbolt_Timer = 4500 + rand()%1500; + Frostbolt_Timer = urand(4500, 6000); } else Frostbolt_Timer -= diff; if (FireBall_Timer <= diff) { DoCast(me->getVictim(), SPELL_FIREBALL); - FireBall_Timer = 4500 + rand()%1500; + FireBall_Timer = urand(4500, 6000); } else FireBall_Timer -= diff; if (CanBlink) @@ -191,7 +191,7 @@ public: me->GetMotionMaster()->MovementExpired(); DoCast(me, SPELL_BLINK); - Blink_Timer = 1000 + rand()%1500; + Blink_Timer = urand(1000, 2500); CanBlink = false; } else Blink_Timer -= diff; } @@ -290,7 +290,7 @@ public: if (ArcaneBolt_Timer <= diff) { DoCast(me->getVictim(), SPELL_ARCANE_BOLT); - ArcaneBolt_Timer = 2000 + rand()%2500; + ArcaneBolt_Timer = urand(2000, 4500); } else ArcaneBolt_Timer -= diff; if (Apprentice_Timer <= diff) diff --git a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp index 43171eda1af..e744cd0f8fb 100644 --- a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp +++ b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp @@ -157,7 +157,7 @@ public: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_FLAME_SHOCK); - flameshock_timer = 10000 + rand()%5000; + flameshock_timer = urand(10000, 15000); } else flameshock_timer -= diff; if (arcaneshock_timer <= diff) @@ -165,7 +165,7 @@ public: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_ARCANE_SHOCK); - arcaneshock_timer = 10000 + rand()%5000; + arcaneshock_timer = urand(10000, 15000); } else arcaneshock_timer -= diff; if (frostshock_timer <= diff) @@ -173,7 +173,7 @@ public: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_FROST_SHOCK); - frostshock_timer = 10000 + rand()%5000; + frostshock_timer = urand(10000, 15000); } else frostshock_timer -= diff; if (shadowshock_timer <= diff) @@ -181,7 +181,7 @@ public: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_SHADOW_SHOCK); - shadowshock_timer = 10000 + rand()%5000; + shadowshock_timer = urand(10000, 15000); } else shadowshock_timer -= diff; if (chainlightning_timer <= diff) diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp index 8f1453e51ee..7ffc203f694 100644 --- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp @@ -74,8 +74,8 @@ public: void Reset() { EventCheck_Timer = 5000; - CorrosiveAcid_Timer = 5000 + rand()%5000; - Fear_Timer = 25000 + rand()%5000; + CorrosiveAcid_Timer = urand(5000, 10000); + Fear_Timer = urand(25000, 30000); Enrage_Timer = 180000; Intro = false; IsBanished = true; @@ -182,13 +182,13 @@ public: if (CorrosiveAcid_Timer <= diff) { DoCast(me->getVictim(), SPELL_CORROSIVE_ACID); - CorrosiveAcid_Timer = 15000 + rand()%10000; + CorrosiveAcid_Timer = urand(15000, 25000); } else CorrosiveAcid_Timer -= diff; if (Fear_Timer <= diff) { DoCast(me, SPELL_FEAR); - Fear_Timer = 20000 + rand()%15000; + Fear_Timer = urand(20000, 35000); } else Fear_Timer -= diff; if (IsHeroic()) diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_blackheart_the_inciter.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_blackheart_the_inciter.cpp index 1987c1bb01a..dd5df358d53 100644 --- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_blackheart_the_inciter.cpp +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_blackheart_the_inciter.cpp @@ -152,14 +152,14 @@ public: { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_CHARGE); - Charge_Timer = 15000 + rand()%10000; + Charge_Timer = urand(15000, 25000); } else Charge_Timer -= diff; //Knockback_Timer if (Knockback_Timer <= diff) { DoCast(me, SPELL_WAR_STOMP); - Knockback_Timer = 18000 + rand()%6000; + Knockback_Timer = urand(18000, 24000); } else Knockback_Timer -= diff; DoMeleeAttackIfReady(); diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp index 6d3a5f181d4..8cf8d61b845 100644 --- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp @@ -165,7 +165,7 @@ public: void Reset() { - ShadowBoltVolley_Timer = 7000 + rand()%7000; + ShadowBoltVolley_Timer = urand(7000, 14000); DrawShadows_Timer = 45000; summonTraveler_Timer = 90000; banish_Timer = 17000; @@ -269,7 +269,7 @@ public: if (ShadowBoltVolley_Timer <= diff) { DoCast(me, SPELL_SHADOWBOLT_VOLLEY); - ShadowBoltVolley_Timer = 15000 + rand()%15000; + ShadowBoltVolley_Timer = urand(15000, 30000); } else ShadowBoltVolley_Timer -= diff; if (IsHeroic() && banish_Timer <= diff) diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp index bd6539335c8..ebb279f74ac 100644 --- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp @@ -64,9 +64,9 @@ public: void Reset() { SonicBoom_Timer = 30000; - MurmursTouch_Timer = 8000 + rand()%12000; + MurmursTouch_Timer = urand(8000, 20000); Resonance_Timer = 5000; - MagneticPull_Timer = 15000 + rand()%15000; + MagneticPull_Timer = urand(15000, 30000); ThunderingStorm_Timer = 15000; SonicShock_Timer = 10000; SonicBoom = false; @@ -133,7 +133,7 @@ public: { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 80, true)) DoCast(target, SPELL_MURMURS_TOUCH); - MurmursTouch_Timer = 25000 + rand()%10000; + MurmursTouch_Timer = urand(25000, 35000); } else MurmursTouch_Timer -= diff; // Resonance diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp index ec7f9a8e070..c28fe68d9e0 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp @@ -646,7 +646,7 @@ public: case PHASE_NORMAL_MAIEV: AttackStart(me->getVictim()); Timer[EVENT_TAUNT] = 32000; - Timer[EVENT_SHEAR] = 10000 + rand()%15 * 1000; + Timer[EVENT_SHEAR] = urand(10, 25) * 1000; Timer[EVENT_FLAME_CRASH] = 20000; Timer[EVENT_PARASITIC_SHADOWFIEND] = 25000; Timer[EVENT_PARASITE_CHECK] = 0; @@ -657,14 +657,14 @@ public: Timer[EVENT_TRANSFORM_NORMAL] = 60000; if (NextPhase == PHASE_NORMAL_2) break; - Timer[EVENT_ENRAGE] = 30000 + rand()%10 * 1000; + Timer[EVENT_ENRAGE] = urand(30, 40) * 1000; break; case PHASE_FLIGHT: Timer[EVENT_FIREBALL] = 1000; if (!(rand()%4)) Timer[EVENT_DARK_BARRAGE] = 10000; - Timer[EVENT_EYE_BLAST] = 10000 + rand()%15 * 1000; - Timer[EVENT_MOVE_POINT] = 20000 + rand()%20 * 1000; + Timer[EVENT_EYE_BLAST] = urand(10, 25) * 1000; + Timer[EVENT_MOVE_POINT] = urand(20, 40) * 1000; break; case PHASE_DEMON: Timer[EVENT_SHADOW_BLAST] = 1000; @@ -1022,7 +1022,7 @@ public: if (soundid) DoPlaySoundToSet(me, soundid); } - Timer[EVENT_TAUNT] = 25000 + rand()%10000; + Timer[EVENT_TAUNT] = urand(25000, 35000); break; case EVENT_SHEAR: @@ -1033,14 +1033,14 @@ public: case EVENT_FLAME_CRASH: DoCast(me->getVictim(), SPELL_FLAME_CRASH); - Timer[EVENT_FLAME_CRASH] = 30000 + rand()%10000; + Timer[EVENT_FLAME_CRASH] = urand(30000, 40000); break; case EVENT_PARASITIC_SHADOWFIEND: { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 200, true)) DoCast(target, SPELL_PARASITIC_SHADOWFIEND, true); - Timer[EVENT_PARASITIC_SHADOWFIEND] = 35000 + rand()%10000; + Timer[EVENT_PARASITIC_SHADOWFIEND] = urand(35000, 45000); } break; @@ -1050,7 +1050,7 @@ public: case EVENT_DRAW_SOUL: DoCast(me->getVictim(), SPELL_DRAW_SOUL); - Timer[EVENT_DRAW_SOUL] = 50000 + rand()%10000; + Timer[EVENT_DRAW_SOUL] = urand(50000, 60000); break; // PHASE_NORMAL_2 @@ -1172,7 +1172,7 @@ public: Phase = PHASE_NORMAL_MAIEV; IllidanGUID = 0; Timer[EVENT_MAIEV_STEALTH] = 0; - Timer[EVENT_MAIEV_TAUNT] = 22000 + rand()%21 * 1000; + Timer[EVENT_MAIEV_TAUNT] = urand(22, 43) * 1000; Timer[EVENT_MAIEV_SHADOW_STRIKE] = 30000; SetEquipmentSlots(false, 44850, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, 45738); @@ -1321,7 +1321,7 @@ public: if (MaievTaunts[random].text.size()) me->MonsterYell(MaievTaunts[random].text.c_str(), LANG_UNIVERSAL, 0); DoPlaySoundToSet(me, sound); - Timer[EVENT_MAIEV_TAUNT] = 22000 + rand()%21 * 1000; + Timer[EVENT_MAIEV_TAUNT] = urand(22, 43) * 1000; } break; case EVENT_MAIEV_SHADOW_STRIKE: @@ -1590,7 +1590,7 @@ public: break; case PHASE_FIGHT_MINIONS: me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - Timer = 10000 + rand()%6000; // summon minion + Timer = urand(10000, 16000); // summon minion break; case PHASE_RETURN: me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); @@ -1780,7 +1780,7 @@ public: AttackStart(Elite); me->AddThreat(Elite, 1000000.0f); } - Timer = 10000 + rand()%6000; + Timer = urand(10000, 16000); GETUNIT(Illidan, IllidanGUID); if (Illidan && Illidan->HealthBelowPct(10)) EnterPhase(PHASE_RETURN); diff --git a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp index a69ed1f7e7d..645a9fe7978 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp @@ -128,7 +128,7 @@ public: FatalAttractionExplodeTimer = 70000; ShriekTimer = 30000; SaberTimer = 35000; - RandomYellTimer = 70000 + rand()%41 * 1000; + RandomYellTimer = urand(70, 111) * 1000; EnrageTimer = 600000; ExplosionCount = 0; @@ -237,7 +237,7 @@ public: DoScriptText(RAND(SAY_SPELL2, SAY_SPELL3), me); FatalAttractionExplodeTimer = 2000; - FatalAttractionTimer = 40000 + rand()%31 * 1000; + FatalAttractionTimer = urand(40, 71) * 1000; } else FatalAttractionTimer -= diff; if (FatalAttractionExplodeTimer <= diff) @@ -293,7 +293,7 @@ public: if (RandomYellTimer <= diff) { DoScriptText(RAND(SAY_TAUNT1, SAY_TAUNT2, SAY_TAUNT3), me); - RandomYellTimer = 60000 + rand()%91 * 1000; + RandomYellTimer = urand(60, 151) * 1000; } else RandomYellTimer -= diff; DoMeleeAttackIfReady(); diff --git a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp index 1519713183d..8b39fe8a8f7 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp @@ -582,7 +582,7 @@ public: { me->InterruptNonMeleeSpells(false); DoCast(me->getVictim(), SPELL_DEADEN); - DeadenTimer = 25000 + rand()%10000; + DeadenTimer = urand(25000, 35000); if (!(rand()%2)) { DoScriptText(DESI_SAY_SPEC, me); @@ -676,7 +676,7 @@ public: if (SoulScreamTimer <= diff) { DoCast(me->getVictim(), SPELL_SOUL_SCREAM); - SoulScreamTimer = 9000 + rand()%2000; + SoulScreamTimer = urand(9000, 11000); if (!(rand()%3)) { DoScriptText(ANGER_SAY_SPEC, me); diff --git a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp index 074bb16e7a0..d6510db0cbb 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp @@ -246,7 +246,7 @@ public: if (instance) instance->SetData(DATA_TERONGOREFIENDEVENT, NOT_STARTED); - IncinerateTimer = 20000 + rand()%11000; + IncinerateTimer = urand(20000, 31000); SummonDoomBlossomTimer = 12000; EnrageTimer = 600000; CrushingShadowsTimer = 22000; @@ -460,7 +460,7 @@ public: { DoScriptText(RAND(SAY_SPECIAL1, SAY_SPECIAL2), me); DoCast(target, SPELL_INCINERATE); - IncinerateTimer = 20000 + rand()%31 * 1000; + IncinerateTimer = urand(20, 51) * 1000; } } else IncinerateTimer -= diff; @@ -469,7 +469,7 @@ public: Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0); if (target && target->isAlive()) DoCast(target, SPELL_CRUSHING_SHADOWS); - CrushingShadowsTimer = 10000 + rand()%16 * 1000; + CrushingShadowsTimer = urand(10, 26) * 1000; } else CrushingShadowsTimer -= diff; /*** NOTE FOR FUTURE DEV: UNCOMMENT BELOW ONLY IF MIND CONTROL IS FULLY IMPLEMENTED **/ @@ -492,7 +492,7 @@ public: if (RandomYellTimer <= diff) { DoScriptText(RAND(SAY_SPELL1, SAY_SPELL2), me); - RandomYellTimer = 50000 + rand()%51 * 1000; + RandomYellTimer = urand(50, 101) * 1000; } else RandomYellTimer -= diff; if (!me->HasAura(SPELL_BERSERK)) diff --git a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp index f7e98444be8..6fe24378f79 100644 --- a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp +++ b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp @@ -613,8 +613,8 @@ public: void Reset() { - BlizzardTimer = 30000 + rand()%61 * 1000; - FlamestrikeTimer = 30000 + rand()%61 * 1000; + BlizzardTimer = urand(30, 91) * 1000; + FlamestrikeTimer = urand(30, 91) * 1000; ArcaneBoltTimer = 10000; DampenMagicTimer = 2000; ArcaneExplosionTimer = 14000; @@ -673,7 +673,7 @@ public: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) { DoCast(target, SPELL_BLIZZARD); - BlizzardTimer = 45000 + rand()%46 * 1000; + BlizzardTimer = urand(45, 91) * 1000; FlamestrikeTimer += 10000; Cooldown = 1000; } @@ -684,7 +684,7 @@ public: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) { DoCast(target, SPELL_FLAMESTRIKE); - FlamestrikeTimer = 55000 + rand()%46 * 1000; + FlamestrikeTimer = urand(55, 101) * 1000; BlizzardTimer += 10000; Cooldown = 2000; } @@ -756,7 +756,7 @@ public: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) { DoCast(target, SPELL_DIVINE_WRATH); - DivineWrathTimer = 40000 + rand()%41 * 1000; + DivineWrathTimer = urand(40, 81) * 1000; } } else DivineWrathTimer -= diff; @@ -799,7 +799,7 @@ public: EnvenomTargetGUID = 0; DeadlyPoisonTimer = 20000; - VanishTimer = 60000 + rand()%61 * 1000; + VanishTimer = urand(60, 121) * 1000; AppearEnvenomTimer = 150000; HasVanished = false; @@ -827,7 +827,7 @@ public: if (DeadlyPoisonTimer <= diff) { DoCast(me->getVictim(), SPELL_DEADLY_POISON); - DeadlyPoisonTimer = 15000 + rand()%31 * 1000; + DeadlyPoisonTimer = urand(15, 46) * 1000; } else DeadlyPoisonTimer -= diff; if (AppearEnvenomTimer <= diff) // Cast Envenom. This is cast 4 seconds after Vanish is over diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp index 65cb0173cd7..a29fafe4edb 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp @@ -691,8 +691,8 @@ public: void Reset() { - Mindblast_Timer = 3000 + rand()%5000; - Earthshock_Timer = 5000 + rand()%5000; + Mindblast_Timer = urand(3000, 8000); + Earthshock_Timer = urand(5000, 10000); if (instance) { @@ -764,7 +764,7 @@ public: if (target)DoCast(target, SPELL_MINDBLAST); - Mindblast_Timer = 10000 + rand()%5000; + Mindblast_Timer = urand(10000, 15000); } else Mindblast_Timer -= diff; if (Earthshock_Timer <= diff) @@ -787,7 +787,7 @@ public: } } } - Earthshock_Timer = 8000 + rand()%7000; + Earthshock_Timer = urand(8000, 15000); } else Earthshock_Timer -= diff; DoMeleeAttackIfReady(); } diff --git a/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp b/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp index 7cdfdc383bd..5265dff16e2 100644 --- a/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp +++ b/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp @@ -213,7 +213,7 @@ public: if (m_uiReverberation_Timer <= uiDiff) { DoCast(me->getVictim(), SPELL_REVERBERATION, true); - m_uiReverberation_Timer = 15000 + rand()%10000; + m_uiReverberation_Timer = urand(15000, 25000); } else m_uiReverberation_Timer -= uiDiff; diff --git a/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp b/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp index de3b93d029d..b941e3bc581 100644 --- a/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp +++ b/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp @@ -524,7 +524,7 @@ public: if (target) DoCast(target, SPELL_GREATER_POLYMORPH); - GreaterPolymorph_Timer = 15000 + rand()%5000; + GreaterPolymorph_Timer = urand(15000, 20000); } else GreaterPolymorph_Timer -= diff; //LightningBolt_Timer @@ -581,8 +581,8 @@ public: void Reset() { GreaterPowerWordShield_Timer = 5000; - Heal_Timer = 25000 + rand()%15000; - PrayerofHealing_Timer = 45000 + rand()%10000; + Heal_Timer = urand(25000, 40000); + PrayerofHealing_Timer = urand(45000, 55000); //reset encounter if (instance) @@ -648,14 +648,14 @@ public: if (Heal_Timer <= diff) { DoCast(me, SPELL_HEAL); - Heal_Timer = 15000 + rand()%25000; + Heal_Timer = urand(15000, 40000); } else Heal_Timer -= diff; //PrayerofHealing_Timer if (PrayerofHealing_Timer <= diff) { DoCast(me, SPELL_PRAYER_OH); - PrayerofHealing_Timer = 35000 + rand()%15000; + PrayerofHealing_Timer = urand(35000, 50000); } else PrayerofHealing_Timer -= diff; DoMeleeAttackIfReady(); diff --git a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp index 6918a076f6e..755106f7092 100644 --- a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp @@ -424,7 +424,7 @@ class boss_magtheridon : public CreatureScript summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); } } - Blaze_Timer = 20000 + rand()%20000; + Blaze_Timer = urand(20000, 40000); } else Blaze_Timer -= diff; @@ -497,10 +497,10 @@ class mob_hellfire_channeler : public CreatureScript void Reset() { - ShadowBoltVolley_Timer = 8000 + rand()%2000; + ShadowBoltVolley_Timer = urand(8000, 10000); DarkMending_Timer = 10000; - Fear_Timer = 15000 + rand()%5000; - Infernal_Timer = 10000 + rand()%40000; + Fear_Timer = urand(15000, 20000); + Infernal_Timer = urand(10000, 50000); Check_Timer = 5000; } @@ -547,7 +547,7 @@ class mob_hellfire_channeler : public CreatureScript if (ShadowBoltVolley_Timer <= diff) { DoCast(me, SPELL_SHADOW_BOLT_VOLLEY); - ShadowBoltVolley_Timer = 10000 + rand()%10000; + ShadowBoltVolley_Timer = urand(10000, 20000); } else ShadowBoltVolley_Timer -= diff; @@ -565,7 +565,7 @@ class mob_hellfire_channeler : public CreatureScript { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1)) DoCast(target, SPELL_FEAR); - Fear_Timer = 25000 + rand()%15000; + Fear_Timer = urand(25000, 40000); } else Fear_Timer -= diff; @@ -574,7 +574,7 @@ class mob_hellfire_channeler : public CreatureScript { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_BURNING_ABYSSAL, true); - Infernal_Timer = 30000 + rand()%10000; + Infernal_Timer = urand(30000, 40000); } else Infernal_Timer -= diff; diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp index df7f95abe2a..cae13adfef7 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp @@ -102,7 +102,7 @@ class boss_gatewatcher_iron_hand : public CreatureScript if (Shadow_Power_Timer <= diff) { DoCast(me, SPELL_SHADOW_POWER); - Shadow_Power_Timer = 20000 + rand()%8000; + Shadow_Power_Timer = urand(20000, 28000); } else Shadow_Power_Timer -= diff; @@ -128,7 +128,7 @@ class boss_gatewatcher_iron_hand : public CreatureScript if (Stream_of_Machine_Fluid_Timer <= diff) { DoCast(me->getVictim(), SPELL_STREAM_OF_MACHINE_FLUID); - Stream_of_Machine_Fluid_Timer = 35000 + rand()%15000; + Stream_of_Machine_Fluid_Timer = urand(35000, 50000); } else Stream_of_Machine_Fluid_Timer -= diff; diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp index 05bf711432d..c5408b4bbf5 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp @@ -76,10 +76,10 @@ class boss_nethermancer_sepethrea : public CreatureScript void Reset() { - frost_attack_Timer = 7000 + rand()%3000; - arcane_blast_Timer = 12000 + rand()%6000; - dragons_breath_Timer = 18000 + rand()%4000; - knockback_Timer = 22000 + rand()%6000; + frost_attack_Timer = urand(7000, 10000); + arcane_blast_Timer = urand(12000, 18000); + dragons_breath_Timer = urand(18000, 22000); + knockback_Timer = urand(22000, 28000); solarburn_Timer = 30000; if (instance) @@ -119,7 +119,7 @@ class boss_nethermancer_sepethrea : public CreatureScript { DoCast(me->getVictim(), SPELL_FROST_ATTACK); - frost_attack_Timer = 7000 + rand()%3000; + frost_attack_Timer = urand(7000, 10000); } else frost_attack_Timer -= diff; @@ -141,7 +141,7 @@ class boss_nethermancer_sepethrea : public CreatureScript return; DoScriptText(RAND(SAY_DRAGONS_BREATH_1, SAY_DRAGONS_BREATH_2), me); } - dragons_breath_Timer = 12000 + rand()%10000; + dragons_breath_Timer = urand(12000, 22000); } else dragons_breath_Timer -= diff; @@ -150,7 +150,7 @@ class boss_nethermancer_sepethrea : public CreatureScript if (knockback_Timer <= diff) { DoCast(me->getVictim(), SPELL_KNOCKBACK); - knockback_Timer = 15000 + rand()%10000; + knockback_Timer = urand(15000, 25000); } else knockback_Timer -= diff; diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp index 54ecbdd621a..30a6bdbc0dd 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp @@ -83,10 +83,10 @@ class boss_pathaleon_the_calculator : public CreatureScript void Reset() { Summon_Timer = 30000; - ManaTap_Timer = 12000 + rand()%8000; - ArcaneTorrent_Timer = 16000 + rand()%9000; - Domination_Timer = 25000 + rand()%15000; - ArcaneExplosion_Timer = 8000 + rand()%5000; + ManaTap_Timer = urand(12000, 20000); + ArcaneTorrent_Timer = urand(16000, 25000); + Domination_Timer = urand(25000, 40000); + ArcaneExplosion_Timer = urand(8000, 13000); Enraged = false; @@ -135,7 +135,7 @@ class boss_pathaleon_the_calculator : public CreatureScript Wraith->AI()->AttackStart(target); } DoScriptText(SAY_SUMMON, me); - Summon_Timer = 30000 + rand()%15000; + Summon_Timer = urand(30000, 45000); } else Summon_Timer -= diff; @@ -143,7 +143,7 @@ class boss_pathaleon_the_calculator : public CreatureScript if (ManaTap_Timer <= diff) { DoCast(me->getVictim(), SPELL_MANA_TAP); - ManaTap_Timer = 14000 + rand()%8000; + ManaTap_Timer = urand(14000, 22000); } else ManaTap_Timer -= diff; @@ -151,7 +151,7 @@ class boss_pathaleon_the_calculator : public CreatureScript if (ArcaneTorrent_Timer <= diff) { DoCast(me->getVictim(), SPELL_ARCANE_TORRENT); - ArcaneTorrent_Timer = 12000 + rand()%6000; + ArcaneTorrent_Timer = urand(12000, 18000); } else ArcaneTorrent_Timer -= diff; @@ -163,7 +163,7 @@ class boss_pathaleon_the_calculator : public CreatureScript DoScriptText(RAND(SAY_DOMINATION_1, SAY_DOMINATION_2), me); DoCast(target, SPELL_DOMINATION); } - Domination_Timer = 25000 + rand()%5000; + Domination_Timer = urand(25000, 30000); } else Domination_Timer -= diff; @@ -174,7 +174,7 @@ class boss_pathaleon_the_calculator : public CreatureScript if (ArcaneExplosion_Timer <= diff) { DoCast(me->getVictim(), H_SPELL_ARCANE_EXPLOSION); - ArcaneExplosion_Timer = 10000 + rand()%4000; + ArcaneExplosion_Timer = urand(10000, 14000); } else ArcaneExplosion_Timer -= diff; @@ -218,7 +218,7 @@ class mob_nether_wraith : public CreatureScript void Reset() { - ArcaneMissiles_Timer = 1000 + rand()%3000; + ArcaneMissiles_Timer = urand(1000, 4000); Detonation_Timer = 20000; Die_Timer = 2200; Detonation = false; @@ -237,7 +237,7 @@ class mob_nether_wraith : public CreatureScript DoCast(target, SPELL_ARCANE_MISSILES); else DoCast(me->getVictim(), SPELL_ARCANE_MISSILES); - ArcaneMissiles_Timer = 5000 + rand()%5000; + ArcaneMissiles_Timer = urand(5000, 10000); } else ArcaneMissiles_Timer -=diff; diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp index 2bf4abbcb96..75c80b06816 100644 --- a/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp +++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp @@ -152,9 +152,9 @@ class boss_warp_splinter : public CreatureScript void Reset() { - War_Stomp_Timer = 25000 + rand()%15000; + War_Stomp_Timer = urand(25000, 40000); Summon_Treants_Timer = 45000; - Arcane_Volley_Timer = 8000 + rand()%12000; + Arcane_Volley_Timer = urand(8000, 20000); me->SetSpeed(MOVE_RUN, 0.7f, true); } @@ -199,7 +199,7 @@ class boss_warp_splinter : public CreatureScript if (War_Stomp_Timer <= diff) { DoCast(me->getVictim(), WAR_STOMP); - War_Stomp_Timer = 25000 + rand()%15000; + War_Stomp_Timer = urand(25000, 40000); } else War_Stomp_Timer -= diff; @@ -208,7 +208,7 @@ class boss_warp_splinter : public CreatureScript if (Arcane_Volley_Timer <= diff) { DoCast(me->getVictim(), DUNGEON_MODE(ARCANE_VOLLEY, ARCANE_VOLLEY_H)); - Arcane_Volley_Timer = 20000 + rand()%15000; + Arcane_Volley_Timer = urand(20000, 35000); } else Arcane_Volley_Timer -= diff; -- cgit v1.2.3 From 76501e2d1b3b5b555cc33fe6bedce1d4b342c1a5 Mon Sep 17 00:00:00 2001 From: weclub Date: Sat, 31 Dec 2011 12:38:33 +0800 Subject: Core/Opcodes: Enable SMSG_WORLD_STATE_UI_TIMER_UPDATE Signed-off-by: weclub --- src/server/game/Server/Protocol/Opcodes.cpp | 3 +-- src/server/game/Server/Protocol/Opcodes.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index e01e02e69e9..82b733344bc 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -21,7 +21,6 @@ */ #include "Opcodes.h" -//#include "WorldSession.h" OpcodeHandler* opcodeTable[NUM_OPCODE_HANDLERS] = { }; @@ -1335,7 +1334,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_SERVERINFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_SERVERINFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_WORLD_STATE_UI_TIMER_UPDATE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleWorldStateUITimerUpdate ); - //DEFINE_OPCODE_HANDLER(SMSG_WORLD_STATE_UI_TIMER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_WORLD_STATE_UI_TIMER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_CHAR_RACE_CHANGE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharFactionOrRaceChange ); //DEFINE_OPCODE_HANDLER(MSG_VIEW_PHASE_SHIFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_TALENTS_INVOLUNTARILY_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 71aa69e5ea1..f0a5d0445b6 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -1027,7 +1027,7 @@ enum Opcodes SMSG_WARDEN_DATA = 0x484F, SMSG_WHO = 0x4C7F, SMSG_WHOIS = 0x00, - SMSG_WORLD_STATE_UI_TIMER_UPDATE = 0x00, + SMSG_WORLD_STATE_UI_TIMER_UPDATE = 0xDE5E, SMSG_ZONE_UNDER_ATTACK = 0x8CF, SMSG_VERIFY_CONNECTIVITY = 0x4F57, -- cgit v1.2.3 From a1a9fcbbcd2df011402c725fb6926c6d6d873e1f Mon Sep 17 00:00:00 2001 From: weclub Date: Sat, 31 Dec 2011 12:46:19 +0800 Subject: Core/DBC: Update DEFAULT_MAX_LEVEL to 85 Drop ItemClass.dbc(ues Item.db2) Signed-off-by: weclub --- src/server/game/DataStores/DBCEnums.h | 2 +- src/server/game/DataStores/DBCStores.cpp | 4 ---- src/server/game/DataStores/DBCStructure.h | 21 --------------------- src/server/game/DataStores/DBCfmt.h | 1 - 4 files changed, 1 insertion(+), 27 deletions(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCEnums.h b/src/server/game/DataStores/DBCEnums.h index 9dd97f936ef..9371509d22a 100755 --- a/src/server/game/DataStores/DBCEnums.h +++ b/src/server/game/DataStores/DBCEnums.h @@ -22,7 +22,7 @@ // Client expected level limitation, like as used in DBC item max levels for "until max player level" // use as default max player level, must be fit max level for used client // also see MAX_LEVEL and STRONG_MAX_LEVEL define -#define DEFAULT_MAX_LEVEL 80 +#define DEFAULT_MAX_LEVEL 85 // client supported max level for player/pets/etc. Avoid overflow or client stability affected. // also see GT_MAX_LEVEL define diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 89061f1a19b..05c067046ac 100755 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -17,11 +17,9 @@ */ #include "DBCStores.h" - #include "Log.h" #include "SharedDefines.h" #include "SpellMgr.h" - #include "DBCfmt.h" #include @@ -115,7 +113,6 @@ DBCStorage sItemArmorQualityStore(ItemArmorQualit DBCStorage sItemArmorShieldStore(ItemArmorShieldfmt); DBCStorage sItemArmorTotalStore(ItemArmorTotalfmt); DBCStorage sItemBagFamilyStore(ItemBagFamilyfmt); -DBCStorage sItemClassStore(ItemClassfmt); //DBCStorage sItemCondExtCostsStore(ItemCondExtCostsEntryfmt); DBCStorage sItemDamageAmmoStore(ItemDamagefmt); DBCStorage sItemDamageOneHandStore(ItemDamagefmt); @@ -413,7 +410,6 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sItemDamageWandStore, dbcPath, "ItemDamageWand.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sItemDisenchantLootStore, dbcPath, "ItemDisenchantLoot.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sItemClassStore, dbcPath,"ItemClass.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sLFGDungeonStore, dbcPath, "LFGDungeons.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sLockStore, dbcPath, "Lock.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sPhaseStores, dbcPath, "Phase.dbc");//14545 diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 994a7978272..2bf1a9a1291 100755 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -1153,27 +1153,6 @@ struct HolidaysEntry //uint32 unk54; // 54 }; -/*struct ItemEntry -{ - uint32 ID; // 0 - uint32 Class; // 1 - uint32 SubClass; // 2 some items have strnage subclasses - int32 Unk0; // 3 - int32 Material; // 4 - uint32 DisplayId; // 5 - uint32 InventoryType; // 6 - uint32 Sheath; // 7 -};*/ - -struct ItemClassEntry -{ - //uint32 id; // 0 - uint32 Class; // 1 equal to id - //uint32 unk2; // 2 looks like second class - //uint32 unk3; // 3 1 for weapons - //char* name; // 4 -}; - // common struct for: // ItemDamageAmmo.dbc // ItemDamageOneHand.dbc diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index 052c0aeba2b..0dfca379d8a 100755 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -83,7 +83,6 @@ const char ItemArmorShieldfmt[]="nifffffff"; const char ItemArmorTotalfmt[]="niffff"; const char ItemDamagefmt[]="nfffffffi"; const char ItemDisenchantLootfmt[]="niiiiii"; -const char ItemClassfmt[]="dixxx"; //const char ItemDisplayTemplateEntryfmt[]="nxxxxxxxxxxixxxxxxxxxxx"; //const char ItemCondExtCostsEntryfmt[]="xiii"; const char ItemExtendedCostEntryfmt[]="niiiiiiiiiiiiiix"; -- cgit v1.2.3 From aa8bf2c819c215174509438cbd4ee7a5ecbdaf7f Mon Sep 17 00:00:00 2001 From: weclub Date: Sat, 31 Dec 2011 12:54:10 +0800 Subject: Core/DBC: Drop Item.dbc & ItemCondExtCosts.dbc & ItemExtendedCost.dbc (Ues DB2) Signed-off-by: weclub --- src/server/game/DataStores/DBCStores.cpp | 10 ---------- src/server/game/DataStores/DBCStructure.h | 21 --------------------- src/server/game/DataStores/DBCfmt.h | 3 --- src/server/game/Entities/Player/Player.cpp | 2 +- 4 files changed, 1 insertion(+), 35 deletions(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 05c067046ac..4ce5454f2c3 100755 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -113,7 +113,6 @@ DBCStorage sItemArmorQualityStore(ItemArmorQualit DBCStorage sItemArmorShieldStore(ItemArmorShieldfmt); DBCStorage sItemArmorTotalStore(ItemArmorTotalfmt); DBCStorage sItemBagFamilyStore(ItemBagFamilyfmt); -//DBCStorage sItemCondExtCostsStore(ItemCondExtCostsEntryfmt); DBCStorage sItemDamageAmmoStore(ItemDamagefmt); DBCStorage sItemDamageOneHandStore(ItemDamagefmt); DBCStorage sItemDamageOneHandCasterStore(ItemDamagefmt); @@ -124,7 +123,6 @@ DBCStorage sItemDamageTwoHandCasterStore(ItemDama DBCStorage sItemDamageWandStore(ItemDamagefmt); DBCStorage sItemDisenchantLootStore(ItemDisenchantLootfmt); //DBCStorage sItemDisplayInfoStore(ItemDisplayTemplateEntryfmt); -- not used currently -//DBCStorage sItemExtendedCostStore(ItemExtendedCostEntryfmt); DBCStorage sItemLimitCategoryStore(ItemLimitCategoryEntryfmt); DBCStorage sItemRandomPropertiesStore(ItemRandomPropertiesfmt); DBCStorage sItemRandomSuffixStore(ItemRandomSuffixfmt); @@ -385,18 +383,13 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sGtRegenMPPerSptStore, dbcPath, "gtRegenMPPerSpt.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sHolidaysStore, dbcPath, "Holidays.dbc");//14545 - -// LoadDBC(availableDbcLocales, bad_dbc_files, sItemStore, dbcPath, "Item.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sItemBagFamilyStore, dbcPath, "ItemBagFamily.dbc");//14545 //LoadDBC(dbcCount, availableDbcLocales, bad_dbc_files, sItemDisplayInfoStore, dbcPath, "ItemDisplayInfo.dbc"); -- not used currently - //LoadDBC(dbcCount, availableDbcLocales, bad_dbc_files, sItemCondExtCostsStore, dbcPath, "ItemCondExtCosts.dbc"); -// LoadDBC(availableDbcLocales, bad_dbc_files, sItemExtendedCostStore, dbcPath, "ItemExtendedCost.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sItemLimitCategoryStore, dbcPath, "ItemLimitCategory.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sItemRandomPropertiesStore, dbcPath, "ItemRandomProperties.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sItemRandomSuffixStore, dbcPath, "ItemRandomSuffix.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sItemSetStore, dbcPath, "ItemSet.dbc");//14545 - LoadDBC(availableDbcLocales, bad_dbc_files, sItemArmorQualityStore, dbcPath, "ItemArmorQuality.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sItemArmorShieldStore, dbcPath, "ItemArmorShield.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sItemArmorTotalStore, dbcPath, "ItemArmorTotal.dbc");//14545 @@ -714,8 +707,6 @@ void LoadDBCStores(const std::string& dataPath) if (!sAreaStore.LookupEntry(3617) || // last area (areaflag) added in 3.3.5a !sCharTitlesStore.LookupEntry(177) || // last char title added in 3.3.5a !sGemPropertiesStore.LookupEntry(1629) || // last added spell in 3.3.5a - //!sItemStore.LookupEntry(56806) || // last gem property added in 3.3.5a - //!sItemExtendedCostStore.LookupEntry(2997) || // last item extended cost added in 3.3.5a !sMapStore.LookupEntry(724) || // last map added in 3.3.5a !sSpellStore.LookupEntry(80864) ) // last client known item added in 3.3.5a { @@ -1144,7 +1135,6 @@ uint32 ScalingStatValuesEntry::GetDPSAndDamageMultiplier(uint32 subClass, bool i DBCStorage const* GetSoundEntriesStore() { return &sSoundEntriesStore; } DBCStorage const* GetSpellRangeStore() { return &sSpellRangeStore; } DBCStorage const* GetFactionStore() { return &sFactionStore; } -// DBCStorage const* GetItemDisplayStore() { return &sItemStore; } DBCStorage const* GetCreatureDisplayStore() { return &sCreatureDisplayInfoStore; } DBCStorage const* GetEmotesStore() { return &sEmotesStore; } DBCStorage const* GetEmotesTextStore() { return &sEmotesTextStore; } diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 2bf1a9a1291..cbf7c7ad77d 100755 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -1223,27 +1223,6 @@ struct ItemDisenchantLootEntry uint32 RequiredDisenchantSkill; }; -//struct ItemCondExtCostsEntry -//{ -// uint32 ID; -// uint32 condExtendedCost; // ItemTemplate::CondExtendedCost -// uint32 itemextendedcostentry; // ItemTemplate::ExtendedCost -// uint32 arenaseason; // arena season number(1-4) -//}; - -#define MAX_ITEM_EXTENDED_COST_REQUIREMENTS 5 - -/*struct ItemExtendedCostEntry -{ - uint32 ID; // 0 extended-cost entry id - uint32 reqhonorpoints; // 1 required honor points - uint32 reqarenapoints; // 2 required arena points - uint32 reqarenaslot; // 3 arena slot restrctions (min slot value) - uint32 reqitem[MAX_ITEM_EXTENDED_COST_REQUIREMENTS]; // 4-8 required item id - uint32 reqitemcount[MAX_ITEM_EXTENDED_COST_REQUIREMENTS]; // 9-14 required count of 1st item - uint32 reqpersonalarenarating; // 15 required personal arena rating}; -};*/ - struct ItemLimitCategoryEntry { uint32 ID; // 0 Id diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index 0dfca379d8a..058b05718de 100755 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -76,7 +76,6 @@ const char GtRegenHPPerSptfmt[]="f"; const char GtRegenMPPerSptfmt[]="xf"; const char Holidaysfmt[]="nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; -const char Itemfmt[]="niiiiiii"; const char ItemBagFamilyfmt[]="nx"; const char ItemArmorQualityfmt[]="nfffffffi"; const char ItemArmorShieldfmt[]="nifffffff"; @@ -84,8 +83,6 @@ const char ItemArmorTotalfmt[]="niffff"; const char ItemDamagefmt[]="nfffffffi"; const char ItemDisenchantLootfmt[]="niiiiii"; //const char ItemDisplayTemplateEntryfmt[]="nxxxxxxxxxxixxxxxxxxxxx"; -//const char ItemCondExtCostsEntryfmt[]="xiii"; -const char ItemExtendedCostEntryfmt[]="niiiiiiiiiiiiiix"; const char ItemLimitCategoryEntryfmt[]="nxii"; const char ItemRandomPropertiesfmt[]="nxiiixxs"; const char ItemRandomSuffixfmt[]="nsxiiiiiiiiii"; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index d2552fbe8cb..a83e637a038 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -24670,7 +24670,7 @@ void Player::RefundItem(Item* item) } bool store_error = false; - for (uint8 i = 0; i < MAX_ITEM_EXTENDED_COST_REQUIREMENTS; ++i) + for (uint8 i = 0; i < MAX_ITEM_EXT_COST_ITEMS; ++i) { uint32 count = iece->RequiredItemCount[i]; uint32 itemid = iece->RequiredItem[i]; -- cgit v1.2.3 From 8c508933677140ec4f63d4d531e0961cc099c08f Mon Sep 17 00:00:00 2001 From: weclub Date: Sat, 31 Dec 2011 14:01:36 +0800 Subject: Core/DBC: Update DBC check to 4.x Signed-off-by: weclub --- src/server/game/DataStores/DBCStores.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 4ce5454f2c3..0300f3bf61f 100755 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -704,11 +704,11 @@ void LoadDBCStores(const std::string& dataPath) } // Check loaded DBC files proper version - if (!sAreaStore.LookupEntry(3617) || // last area (areaflag) added in 3.3.5a - !sCharTitlesStore.LookupEntry(177) || // last char title added in 3.3.5a - !sGemPropertiesStore.LookupEntry(1629) || // last added spell in 3.3.5a - !sMapStore.LookupEntry(724) || // last map added in 3.3.5a - !sSpellStore.LookupEntry(80864) ) // last client known item added in 3.3.5a + if (//!sAreaStore.LookupEntry(5839) || // last area (areaflag) added in 4.22 (5839 is wrong? why?) + !sCharTitlesStore.LookupEntry(279) || // last char title added in 4.22 + !sGemPropertiesStore.LookupEntry(1860) || // last gem property added in 4.22 + !sMapStore.LookupEntry(968) || // last map added in 4.22 + !sSpellStore.LookupEntry(102129) ) // last spell added in 4.22 { sLog->outError("You have _outdated_ DBC files. Please extract correct versions from current using client."); exit(1); -- cgit v1.2.3 From a177c1c4465b3fe96fd424e1b8f9f1114f2d06f6 Mon Sep 17 00:00:00 2001 From: weclub Date: Sat, 31 Dec 2011 14:38:31 +0800 Subject: Core/Opcodes: Enable 4 Opcodes SMSG_GODMODE SMSG_GAMESPEED_SET SMSG_GAMETIME_SET SMSG_SERVERTIME Signed-off-by: weclub --- src/server/game/Server/Protocol/Opcodes.cpp | 8 ++++---- src/server/game/Server/Protocol/Opcodes.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 82b733344bc..7738fdb363f 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -77,7 +77,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_UNDRESSPLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_BEASTMASTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GODMODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_GODMODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GODMODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_SETMONEY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_LEVEL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_PET_LEVEL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -112,11 +112,11 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_LOGIN_SETTIMESPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GAMETIME_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GAMETIME_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_GAMETIME_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GAMETIME_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GAMESPEED_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_GAMESPEED_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GAMESPEED_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SERVERTIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_SERVERTIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SERVERTIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_PLAYER_LOGOUT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayerLogoutOpcode ); DEFINE_OPCODE_HANDLER(CMSG_LOGOUT_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLogoutRequestOpcode ); DEFINE_OPCODE_HANDLER(SMSG_LOGOUT_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index f0a5d0445b6..81922317264 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -703,8 +703,8 @@ enum Opcodes SMSG_GAMEOBJECT_PAGETEXT = 0x00, SMSG_GAMEOBJECT_QUERY_RESPONSE = 0xCCF7, SMSG_GAMEOBJECT_RESET_STATE = 0x00, - SMSG_GAMESPEED_SET = 0x00, - SMSG_GAMETIME_SET = 0x00, + SMSG_GAMESPEED_SET = 0x5ACA, + SMSG_GAMETIME_SET = 0x9C4A, SMSG_GAMETIME_UPDATE = 0x18E3, SMSG_GMRESPONSE_STATUS_UPDATE = 0x00, SMSG_GMRESPONSE_RECEIVED = 0x00, @@ -938,8 +938,8 @@ enum Opcodes SMSG_SELL_ITEM = 0x9CD3, SMSG_SEND_MAIL_RESULT = 0x00, SMSG_SEND_UNLEARN_SPELLS = 0x00, - SMSG_SERVERTIME = 0x00, - SMSG_SERVER_FIRST_ACHIEVEMENT = 0x0CDF, + SMSG_SERVERTIME = 0x1CD7, + SMSG_SERVER_FIRST_ACHIEVEMENT = 0xCDF, SMSG_SERVER_MESSAGE = 0xC873, SMSG_SET_FACTION_ATWAR = 0x00, SMSG_SET_FACTION_STANDING = 0x00, -- cgit v1.2.3 From bff7c18251e8c16dfbe3f4484a76d8df76f05076 Mon Sep 17 00:00:00 2001 From: Rat Date: Sun, 1 Jan 2012 22:30:37 +0100 Subject: Core/Movement: Fixed some movement structures, added SMSG_PLAYER_MOVE --- src/server/game/Movement/MovementStructures.h | 242 +++++++++++++------------- src/server/game/Server/Protocol/Opcodes.cpp | 1 + src/server/game/Server/Protocol/Opcodes.h | 2 +- 3 files changed, 121 insertions(+), 124 deletions(-) (limited to 'src') diff --git a/src/server/game/Movement/MovementStructures.h b/src/server/game/Movement/MovementStructures.h index 1313f897acb..5529a4e1f37 100644 --- a/src/server/game/Movement/MovementStructures.h +++ b/src/server/game/Movement/MovementStructures.h @@ -85,70 +85,70 @@ enum MovementStatusElements MSETransportTime3, MSE_COUNT }; - +//4.2.2 MovementStatusElements PlayerMoveSequence[] = { - MSEHavePitch, - MSEGuidByte6, - MSEHaveFallData, - MSEHaveFallDirection, - MSEGuidByte1, - MSEGuidByte2, - MSEFlags2, - MSEGuidByte0, + MSEHaveSplineElev, MSEHaveTransportData, - MSETransportGuidByte1, - MSETransportGuidByte4, + MSEGuidByte5, MSETransportGuidByte0, - MSETransportHaveTime2, - MSETransportGuidByte6, - MSETransportGuidByte3, MSETransportGuidByte2, + MSETransportGuidByte4, + MSETransportGuidByte1, + MSETransportGuidByte3, + MSETransportHaveTime2, MSETransportGuidByte7, MSETransportHaveTime3, + MSETransportGuidByte6, MSETransportGuidByte5, + MSEGuidByte7, MSEGuidByte3, + MSEGuidByte1, MSEGuidByte4, - MSEGuidByte5, - MSEHaveSpline, - MSEGuidByte7, - MSEHaveSplineElev, + MSEGuidByte0, MSEFlags, - MSEPositionO, - MSEGuidByte0_2, - MSEPitch, + MSEHavePitch, + MSEGuidByte2, + MSEFlags2, + MSEGuidByte6, + MSEHaveFallData, + MSEHaveFallDirection, + MSEHaveSpline, MSEGuidByte4_2, - MSEFallTime, - MSEFallHorizontalSpeed, - MSEFallCosAngle, - MSEFallSinAngle, - MSEFallVerticalSpeed, - MSETimestamp, - MSEGuidByte1_2, - MSETransportGuidByte7_2, - MSETransportGuidByte3_2, - MSETransportGuidByte1_2, + MSEGuidByte0_2, + MSEPositionO, + MSEGuidByte6_2, + MSEGuidByte7_2, + MSESplineElev, + MSETransportGuidByte4_2, + MSETransportGuidByte2_2, + MSETransportPositionO, + MSETransportTime, MSETransportSeat, - MSETransportTime2, - MSETransportGuidByte0_2, - MSETransportGuidByte6_2, + MSETransportGuidByte3_2, MSETransportPositionX, MSETransportPositionY, MSETransportPositionZ, - MSETransportGuidByte4_2, - MSETransportPositionO, + MSETransportGuidByte1_2, + MSETransportTime2, MSETransportTime3, MSETransportGuidByte5_2, - MSETransportTime, - MSETransportGuidByte2_2, + MSETransportGuidByte0_2, + MSETransportGuidByte6_2, + MSETransportGuidByte7_2, MSEGuidByte2_2, + MSETimestamp, + MSEGuidByte1_2, + MSEPitch, MSEPositionX, MSEPositionY, MSEPositionZ, - MSEGuidByte6_2, - MSESplineElev, MSEGuidByte5_2, MSEGuidByte3_2, - MSEGuidByte7_2 + MSEFallSinAngle, + MSEFallCosAngle, + MSEFallVerticalSpeed, + MSEFallHorizontalSpeed, + MSEFallTime, }; MovementStatusElements MovementFallLandSequence[] = { @@ -215,74 +215,70 @@ MovementStatusElements MovementFallLandSequence[] = { MSEGuidByte6_2, MSEGuidByte4_2, }; - +//4.2.2 MovementStatusElements MovementHeartBeatSequence[] = { - /* - 3bits - 8bits - */ - MSEGuidByte1, - MSEGuidByte5, - MSEGuidByte2, - MSEFlags2, - MSEGuidByte3, - MSEGuidByte4, - MSEHaveSpline, MSEFlags, + MSEHaveSpline, MSEGuidByte0, MSEGuidByte6, + MSEGuidByte1, MSEGuidByte7, + MSEGuidByte2, + MSEGuidByte4, + MSEGuidByte3, + MSEFlags2, + MSEGuidByte5, + MSEHaveSplineElev, MSEHaveTransportData, - MSETransportGuidByte6, - MSETransportGuidByte3, - MSETransportGuidByte7, - MSETransportGuidByte4, - MSETransportGuidByte1, MSETransportGuidByte0, + MSETransportGuidByte6, MSETransportGuidByte2, MSETransportGuidByte5, - MSETransportHaveTime3, + MSETransportGuidByte4, + MSETransportGuidByte1, + MSETransportGuidByte3, + MSETransportGuidByte7, MSETransportHaveTime2, + MSETransportHaveTime3, MSEHavePitch, - MSEHaveSplineElev, MSEHaveFallData, MSEHaveFallDirection, - MSEPositionO, + MSETimestamp, MSEPositionX, MSEPositionY, MSEPositionZ, - MSETimestamp, + MSEPositionO, + MSEGuidByte7_2, + MSEGuidByte5_2, + MSESplineElev, + MSEGuidByte1_2, MSEGuidByte6_2, - MSETransportTime, + MSEGuidByte4_2, + MSEGuidByte3_2, + MSETransportSeat, + MSETransportPositionO, MSETransportPositionX, MSETransportPositionY, MSETransportPositionZ, - MSETransportPositionO, - MSETransportSeat, + MSETransportTime, + MSETransportTime2, MSETransportGuidByte3_2, - MSETransportGuidByte1_2, - MSETransportTime3, MSETransportGuidByte6_2, - MSETransportGuidByte0_2, - MSETransportGuidByte5_2, - MSETransportTime2, + MSETransportTime3, MSETransportGuidByte7_2, - MSETransportGuidByte4_2, + MSETransportGuidByte5_2, MSETransportGuidByte2_2, + MSETransportGuidByte1_2, + MSETransportGuidByte0_2, + MSETransportGuidByte4_2, MSEPitch, - MSESplineElev, - MSEFallVerticalSpeed, MSEFallTime, - MSEFallHorizontalSpeed, - MSEFallCosAngle, + MSEFallVerticalSpeed, MSEFallSinAngle, - MSEGuidByte5_2, - MSEGuidByte1_2, - MSEGuidByte7_2, - MSEGuidByte0_2, + MSEFallCosAngle, + MSEFallHorizontalSpeed, MSEGuidByte2_2, - MSEGuidByte4_2, - MSEGuidByte3_2, + MSEGuidByte0_2, }; MovementStatusElements MovementJumpSequence[] = { @@ -349,70 +345,70 @@ MovementStatusElements MovementJumpSequence[] = { MSEGuidByte7_2, MSEGuidByte2_2, }; - +//4.2.2 MovementStatusElements MovementSetFacingSequence[] = { + MSEFlags, + MSEGuidByte4, + MSEGuidByte2, + MSEHaveSpline, MSEGuidByte3, - MSEGuidByte1, + MSEGuidByte5, + MSEFlags2, MSEGuidByte0, MSEGuidByte7, - MSEFlags2, - MSEHaveSpline, - MSEGuidByte4, - MSEFlags, MSEGuidByte6, - MSEGuidByte5, - MSEGuidByte2, + MSEGuidByte1, + MSEHaveSplineElev, + MSEHavePitch, MSEHaveFallData, MSEHaveFallDirection, MSEHaveTransportData, - MSETransportGuidByte6, - MSETransportGuidByte3, - MSETransportGuidByte7, - MSETransportGuidByte4, - MSETransportGuidByte1, MSETransportGuidByte0, + MSETransportGuidByte6, MSETransportGuidByte2, MSETransportGuidByte5, - MSETransportHaveTime3, + MSETransportGuidByte4, + MSETransportGuidByte1, + MSETransportGuidByte3, + MSETransportGuidByte7, MSETransportHaveTime2, - MSEHavePitch, - MSEHaveSplineElev, + MSETransportHaveTime3, + MSEPositionO, + MSETimestamp, MSEPositionX, MSEPositionY, MSEPositionZ, - MSEPositionO, - MSETimestamp, - MSEFallVerticalSpeed, + MSEGuidByte7_2, + MSEGuidByte5_2, + MSESplineElev, + MSEGuidByte4_2, + MSEGuidByte1_2, + MSEGuidByte2_2, + MSEPitch, MSEFallTime, - MSEFallHorizontalSpeed, - MSEFallCosAngle, + MSEFallVerticalSpeed, MSEFallSinAngle, - MSEGuidByte2_2, - MSEGuidByte4_2, - MSETransportTime, + MSEFallCosAngle, + MSEFallHorizontalSpeed, + MSEGuidByte6_2, + MSEGuidByte0_2, + MSETransportSeat, + MSETransportPositionO, MSETransportPositionX, MSETransportPositionY, MSETransportPositionZ, - MSETransportPositionO, - MSETransportSeat, + MSETransportTime, + MSETransportTime2, MSETransportGuidByte3_2, - MSETransportGuidByte1_2, - MSETransportTime3, MSETransportGuidByte6_2, - MSETransportGuidByte0_2, - MSETransportGuidByte5_2, - MSETransportTime2, + MSETransportTime3, MSETransportGuidByte7_2, - MSETransportGuidByte4_2, + MSETransportGuidByte5_2, MSETransportGuidByte2_2, + MSETransportGuidByte1_2, + MSETransportGuidByte0_2, + MSETransportGuidByte4_2, MSEGuidByte3_2, - MSEGuidByte7_2, - MSEPitch, - MSEGuidByte5_2, - MSEGuidByte1_2, - MSEGuidByte6_2, - MSESplineElev, - MSEGuidByte0_2, }; MovementStatusElements MovementSetPitchSequence[] = { @@ -1329,15 +1325,15 @@ MovementStatusElements* GetMovementStatusElementsSequence(Opcodes opcode) { switch(opcode) { - case SMSG_PLAYER_MOVE: + case SMSG_PLAYER_MOVE://done return PlayerMoveSequence; case MSG_MOVE_FALL_LAND: return MovementFallLandSequence; - case MSG_MOVE_HEARTBEAT: + case MSG_MOVE_HEARTBEAT://done return MovementHeartBeatSequence; case MSG_MOVE_JUMP: return MovementJumpSequence; - case MSG_MOVE_SET_FACING: + case MSG_MOVE_SET_FACING://done return MovementSetFacingSequence; case MSG_MOVE_SET_PITCH: return MovementSetPitchSequence; diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index e01e02e69e9..f2a04c7156c 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -1381,6 +1381,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_RETURN_TO_GRAVEYARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReturnToGraveyard ); DEFINE_OPCODE_HANDLER(CMSG_RANDOMIZE_CHAR_NAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRandomizeCharNameOpcode ); DEFINE_OPCODE_HANDLER(SMSG_RANDOMIZE_CHAR_NAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PLAYER_MOVE, STATUS_AUTHED, PROCESS_THREADSAFE, &WorldSession::Handle_ServerSide ); #undef DEFINE_OPCODE_HANDLER }; diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 71aa69e5ea1..4ca65831775 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -872,7 +872,7 @@ enum Opcodes SMSG_PETITION_SHOWLIST = 0x8ED7, SMSG_PETITION_SHOW_SIGNATURES = 0x4E4A, SMSG_PETITION_SIGN_RESULTS = 0x5EE6, - SMSG_PLAYER_MOVE = 0x00, + SMSG_PLAYER_MOVE = 0xF66C, SMSG_PLAYED_TIME = 0x187F, SMSG_PLAYERBINDERROR = 0x5A4F, SMSG_PLAYERBOUND = 0x00, -- cgit v1.2.3 From a3b788ec6571ff493e5b675a8597f66a3dd6aaaa Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Fri, 6 Jan 2012 15:39:38 +0800 Subject: P1: Fixed some opcodes, structure later update. Signed-off-by: Gyx <2359980687@qq.com> --- src/server/game/Server/Protocol/Opcodes.h | 202 +++++++++++++++--------------- 1 file changed, 101 insertions(+), 101 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 9f77d185090..25e47be9783 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -89,10 +89,10 @@ enum Opcodes CMSG_CALENDAR_ARENA_TEAM = 0x00, CMSG_CALENDAR_CONTEXT_EVENT_SIGNUP = 0x00, CMSG_CALENDAR_COPY_EVENT = 0x00, - CMSG_CALENDAR_EVENT_INVITE = 0x1EDA, - CMSG_CALENDAR_EVENT_MODERATOR_STATUS = 0x00, - CMSG_CALENDAR_EVENT_REMOVE_INVITE = 0x00, - CMSG_CALENDAR_EVENT_STATUS = 0x00, + CMSG_CALENDAR_EVENT_INVITE = 0x1EDA, // 0x4A76 + CMSG_CALENDAR_EVENT_MODERATOR_STATUS = 0xCCFA, + CMSG_CALENDAR_EVENT_REMOVE_INVITE = 0xCCD2, + CMSG_CALENDAR_EVENT_STATUS = 0x4E67, CMSG_CALENDAR_GET_EVENT = 0x00, CMSG_CALENDAR_GET_NUM_PENDING = 0x00, CMSG_CALENDAR_GUILD_FILTER = 0x00, @@ -452,7 +452,7 @@ enum Opcodes CMSG_WORLD_TELEPORT = 0x00, CMSG_WRAP_ITEM = 0x00, CMSG_ZONEUPDATE = 0x4AE2, - MSG_AUCTION_HELLO = 0x00, + MSG_AUCTION_HELLO = 0xCC7A, MSG_CHANNEL_START = 0x00, MSG_CHANNEL_UPDATE = 0x00, MSG_CORPSE_QUERY = 0x00, @@ -460,10 +460,10 @@ enum Opcodes MSG_GM_SHOWLABEL = 0x00, MSG_GM_SUMMON = 0x00, MSG_GUILD_BANK_LOG_QUERY = 0x00, - MSG_GUILD_BANK_MONEY_WITHDRAWN = 0x00, // Can be 0xDE77 - MSG_GUILD_EVENT_LOG_QUERY = 0x00, - MSG_GUILD_PERMISSIONS = 0x00, - MSG_INSPECT_ARENA_TEAMS = 0x00, + MSG_GUILD_BANK_MONEY_WITHDRAWN = 0xDE77, // Can be 0xDE77 + MSG_GUILD_EVENT_LOG_QUERY = 0xCEDA, + MSG_GUILD_PERMISSIONS = 0xDC73, + MSG_INSPECT_ARENA_TEAMS = 0xDA4F, MSG_LIST_STABLED_PETS = 0x88CA, MSG_MINIMAP_PING = 0x00, MSG_MOVE_FALL_LAND = 0x00A5, @@ -525,7 +525,7 @@ enum Opcodes MSG_PARTY_ASSIGNMENT = 0x00, MSG_PETITION_DECLINE = 0x98E7, MSG_PETITION_RENAME = 0x4857, - MSG_PVP_LOG_DATA = 0x00, + MSG_PVP_LOG_DATA = 0x60FE, MSG_QUERY_GUILD_BANK_TEXT = 0x00, MSG_QUERY_NEXT_MAIL_TIME = 0xCEE6, MSG_QUEST_PUSH_RESULT = 0x1863, @@ -551,14 +551,14 @@ enum Opcodes SMSG_ALL_ACHIEVEMENT_DATA = 0x00, SMSG_AREA_SPIRIT_HEALER_TIME = 0x00, SMSG_AREA_TRIGGER_MESSAGE = 0xCC42, - SMSG_ARENA_ERROR = 0x00, - SMSG_ARENA_OPPONENT_UPDATE = 0x00, + SMSG_ARENA_ERROR = 0x8C7, + SMSG_ARENA_OPPONENT_UPDATE = 0xAD6, SMSG_ARENA_TEAM_CHANGE_FAILED_QUEUED = 0x4A4E, - SMSG_ARENA_TEAM_COMMAND_RESULT = 0x00, - SMSG_ARENA_TEAM_EVENT = 0x00, - SMSG_ARENA_TEAM_INVITE = 0x00, + SMSG_ARENA_TEAM_COMMAND_RESULT = 0x605C, + SMSG_ARENA_TEAM_EVENT = 0x5CDA, + SMSG_ARENA_TEAM_INVITE = 0x5EDB, SMSG_ARENA_TEAM_QUERY_RESPONSE = 0x8CCE, - SMSG_ARENA_TEAM_ROSTER = 0x00, + SMSG_ARENA_TEAM_ROSTER = 0xCE7A, SMSG_ARENA_TEAM_STATS = 0xDEF2, SMSG_ATTACKERSTATEUPDATE = 0x00, SMSG_ATTACKSTART = 0xCA4A, @@ -567,34 +567,34 @@ enum Opcodes SMSG_ATTACKSWING_CANT_ATTACK = 0x00, SMSG_ATTACKSWING_DEADTARGET = 0x00, SMSG_ATTACKSWING_NOTINRANGE = 0x00, - SMSG_AUCTION_BIDDER_LIST_RESULT = 0x00, - SMSG_AUCTION_BIDDER_NOTIFICATION = 0x00, - SMSG_AUCTION_COMMAND_RESULT = 0x00, - SMSG_AUCTION_LIST_PENDING_SALES = 0x00, + SMSG_AUCTION_BIDDER_LIST_RESULT = 0x88E3, + SMSG_AUCTION_BIDDER_NOTIFICATION = 0xC85B, + SMSG_AUCTION_COMMAND_RESULT = 0xCCCE, + SMSG_AUCTION_LIST_PENDING_SALES = 0x8EC7, SMSG_AUCTION_LIST_RESULT = 0xDEDE, - SMSG_AUCTION_OWNER_LIST_RESULT = 0x00, - SMSG_AUCTION_OWNER_NOTIFICATION = 0x00, - SMSG_AUCTION_REMOVED_NOTIFICATION = 0x00, + SMSG_AUCTION_OWNER_LIST_RESULT = 0x4EDA, + SMSG_AUCTION_OWNER_NOTIFICATION = 0xCA6A, + SMSG_AUCTION_REMOVED_NOTIFICATION = 0x4CFB, SMSG_AURA_UPDATE = 0x4C66, SMSG_AURA_UPDATE_ALL = 0x18EE, SMSG_AURACASTLOG = 0x00, SMSG_AUTH_CHALLENGE = 0x1181, SMSG_AUTH_RESPONSE = 0x8867, - SMSG_AVAILABLE_VOICE_CHANNEL = 0x00, + SMSG_AVAILABLE_VOICE_CHANNEL = 0x9C7B, SMSG_BARBER_SHOP_RESULT = 0x00, SMSG_BATTLEFIELD_LIST = 0xB64E, - SMSG_BATTLEFIELD_MGR_EJECTED = 0x00, - SMSG_BATTLEFIELD_MGR_EJECT_PENDING = 0x00, - SMSG_BATTLEFIELD_MGR_ENTERED = 0x00, - SMSG_BATTLEFIELD_MGR_ENTRY_INVITE = 0x00, - SMSG_BATTLEFIELD_MGR_QUEUE_INVITE = 0x00, - SMSG_BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE = 0x00, - SMSG_BATTLEFIELD_MGR_STATE_CHANGE = 0x00, + SMSG_BATTLEFIELD_MGR_EJECTED = 0x32EC, + SMSG_BATTLEFIELD_MGR_EJECT_PENDING = 0x724C, + SMSG_BATTLEFIELD_MGR_ENTERED = 0x66DC, + SMSG_BATTLEFIELD_MGR_ENTRY_INVITE = 0x70DE, + SMSG_BATTLEFIELD_MGR_QUEUE_INVITE = 0x644E, + SMSG_BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE = 0x326E, + SMSG_BATTLEFIELD_MGR_STATE_CHANGE = 0x32EE, SMSG_BATTLEFIELD_PORT_DENIED = 0x00, - SMSG_BATTLEFIELD_STATUS1 = 0x00, - SMSG_BATTLEFIELD_STATUS2 = 0x00, - SMSG_BATTLEFIELD_STATUS3 = 0x00, - SMSG_BATTLEFIELD_STATUS4 = 0x00, + SMSG_BATTLEFIELD_STATUS1 = 0x70EE, + SMSG_BATTLEFIELD_STATUS2 = 0x20DC, + SMSG_BATTLEFIELD_STATUS3 = 0x36DE, + SMSG_BATTLEFIELD_STATUS4 = 0x626E, SMSG_BATTLEGROUND_INFO_THROTTLED = 0x00, SMSG_BATTLEGROUND_PLAYER_JOINED = 0x00, SMSG_BATTLEGROUND_PLAYER_POSITIONS = 0x00, @@ -605,14 +605,14 @@ enum Opcodes SMSG_BUY_BANK_SLOT_RESULT = 0x00, SMSG_BUY_ITEM = 0x00, SMSG_BUY_FAILED = 0x00, - SMSG_CALENDAR_COMMAND_RESULT = 0x00, + SMSG_CALENDAR_COMMAND_RESULT = 0x9A4E, SMSG_CALENDAR_SEND_NUM_PENDING = 0x00, SMSG_CALENDAR_SEND_CALENDAR = 0x00, SMSG_CANCEL_AUTO_REPEAT = 0x5ACB, SMSG_CANCEL_COMBAT = 0x00, SMSG_CAST_FAILED = 0x1AEB, SMSG_CHANNEL_LIST = 0x9C47, - SMSG_CHANNEL_MEMBER_COUNT = 0x00, + SMSG_CHANNEL_MEMBER_COUNT = 0x5EEA, SMSG_CHANNEL_NOTIFY = 0x9C7F, SMSG_CHAR_CREATE = 0x4C5B, SMSG_CHAR_DELETE = 0x48CE, @@ -630,7 +630,7 @@ enum Opcodes SMSG_CLEAR_TARGET = 0x00, SMSG_CLIENTCACHE_VERSION = 0x88F2, SMSG_CLIENT_CONTROL_UPDATE = 0x08CB, - SMSG_COMBAT_LOG_MULTIPLE = 0x00, + SMSG_COMBAT_LOG_MULTIPLE = 0x5C56, SMSG_COMMENTATOR_MAP_INFO = 0x00, SMSG_COMMENTATOR_PLAYER_INFO = 0x00, SMSG_COMMENTATOR_STATE_CHANGED = 0x00, @@ -649,10 +649,10 @@ enum Opcodes SMSG_CREATURE_QUERY_RESPONSE = 0xD847, SMSG_CRITERIA_DELETED = 0x00, SMSG_CRITERIA_UPDATE = 0xD87F, - SMSG_CROSSED_INEBRIATION_THRESHOLD = 0x00, + SMSG_CROSSED_INEBRIATION_THRESHOLD = 0x9CD7, SMSG_DAMAGE_CALC_LOG = 0x00, SMSG_DAMAGE_DONE_OBSOLETE = 0x00, - SMSG_DANCE_QUERY_RESPONSE = 0x00, + SMSG_DANCE_QUERY_RESPONSE = 0x9E42, SMSG_DB_REPLY = 0x76EC, SMSG_DEATH_RELEASE_LOC = 0x00, SMSG_DEFENSE_MESSAGE = 0x9EC3, @@ -663,12 +663,12 @@ enum Opcodes SMSG_DISMOUNT = 0xCEE7, SMSG_DISMOUNTRESULT = 0x00, SMSG_DISPEL_FAILED = 0x00, - SMSG_DUEL_COMPLETE = 0x00, - SMSG_DUEL_COUNTDOWN = 0x00, - SMSG_DUEL_REQUESTED = 0x00, + SMSG_DUEL_COMPLETE = 0x5846, + SMSG_DUEL_COUNTDOWN = 0x1A5F, + SMSG_DUEL_REQUESTED = 0x1EC6, SMSG_DUEL_WINNER = 0xDA52, SMSG_DURABILITY_DAMAGE_DEATH = 0x00, - SMSG_ECHO_PARTY_SQUELCH = 0x00, + SMSG_ECHO_PARTY_SQUELCH = 0x5ED7, SMSG_EMOTE = 0xC67, SMSG_ENABLE_BARBER_SHOP = 0x00, SMSG_ENCHANTMENTLOG = 0x00, @@ -676,8 +676,8 @@ enum Opcodes SMSG_EQUIPMENT_SET_LIST = 0x18DF, SMSG_EQUIPMENT_SET_SAVED = 0x00, SMSG_EQUIPMENT_SET_USE_RESULT = 0x00, - SMSG_EXPECTED_SPAM_RECORDS = 0x00, - SMSG_EXPLORATION_EXPERIENCE = 0x00, + SMSG_EXPECTED_SPAM_RECORDS = 0x48E7, + SMSG_EXPLORATION_EXPERIENCE = 0xEE7, SMSG_FEATURE_SYSTEM_STATUS = 0x70CE, SMSG_FLIGHT_SPLINE_SYNC = 0x1C63, SMSG_FISH_ESCAPED = 0x9C66, @@ -715,23 +715,23 @@ enum Opcodes SMSG_GMTICKET_SYSTEMSTATUS = 0x9C7E, SMSG_GMTICKET_UPDATETEXT = 0x00, SMSG_GODMODE = 0xDEEE, - SMSG_GOSSIP_COMPLETE = 0x00, + SMSG_GOSSIP_COMPLETE = 0xDE7B, SMSG_GOSSIP_MESSAGE = 0xCCEB, SMSG_GOSSIP_POI = 0x1866, - SMSG_GROUP_CANCEL = 0x00, + SMSG_GROUP_CANCEL = 0xED6, SMSG_GROUP_DECLINE = 0x00, SMSG_GROUP_DESTROYED = 0x00, SMSG_GROUP_INVITE = 0x00, - SMSG_GROUP_JOINED_BATTLEGROUND = 0x00, + SMSG_GROUP_JOINED_BATTLEGROUND = 0x265C, SMSG_GROUP_LIST = 0x00, SMSG_GROUP_SET_LEADER = 0x00, SMSG_GROUP_UNINVITE = 0x00, SMSG_GUILDFINDER_SEARCH_RESULT = 0xE0CE, // New 4.x SMSG_GUILD_BANK_LIST = 0x5EFB, SMSG_GUILD_COMMAND_RESULT = 0xDAD7, - SMSG_GUILD_DECLINE = 0x00, + SMSG_GUILD_DECLINE = 0x1E5B, SMSG_GUILD_EVENT = 0x8AC2, - SMSG_GUILD_INFO = 0x00, + SMSG_GUILD_INFO = 0x5876, SMSG_GUILD_INVITE = 0x00, SMSG_GUILD_MAX_DAILY_XP = 0x00, SMSG_GUILD_NEWS_UPDATE = 0x00, @@ -745,21 +745,21 @@ enum Opcodes SMSG_GUILD_UPDATE_ROSTER = 0x00, SMSG_GUILD_XP_UPDATE = 0x00, SMSG_HIGHEST_THREAT_UPDATE = 0x00, - SMSG_INITIALIZE_FACTIONS = 0x00, + SMSG_INITIALIZE_FACTIONS = 0xCC6F, SMSG_INITIAL_SPELLS = 0x88FE, SMSG_INIT_CURRENCY = 0x227E, SMSG_INIT_WORLD_STATES = 0x9EDA, - SMSG_INSPECT = 0x00, + SMSG_INSPECT = 0xE46, SMSG_INSPECT_HONOR_STATS = 0x00, - SMSG_INSPECT_TALENT = 0x00, + SMSG_INSPECT_TALENT = 0x48EF, SMSG_INSTANCE_DIFFICULTY = 0x00, SMSG_INSTANCE_LOCK_WARNING_QUERY = 0x00, SMSG_INSTANCE_RESET = 0xDAC2, - SMSG_INSTANCE_RESET_FAILED = 0x00, + SMSG_INSTANCE_RESET_FAILED = 0xCEFE, SMSG_INSTANCE_SAVE_CREATED = 0xCE56, SMSG_INVALID_PROMOTION_CODE = 0xD8FE, - SMSG_INVALIDATE_DANCE = 0x00, - SMSG_INVALIDATE_PLAYER = 0x00, + SMSG_INVALIDATE_DANCE = 0x1EEF, + SMSG_INVALIDATE_PLAYER = 0x5C5F, SMSG_INVENTORY_CHANGE_FAILURE = 0x00, SMSG_ITEM_COOLDOWN = 0x00, SMSG_ITEM_ENCHANT_TIME_UPDATE = 0x00, @@ -767,13 +767,13 @@ enum Opcodes SMSG_ITEM_PUSH_RESULT = 0x8EFB, SMSG_ITEM_QUERY_MULTIPLE_RESPONSE = 0x00, SMSG_ITEM_QUERY_SINGLE_RESPONSE = 0x00, - SMSG_ITEM_REFUND_INFO_RESPONSE = 0x00, - SMSG_ITEM_REFUND_RESULT = 0x00, - SMSG_ITEM_TEXT_QUERY_RESPONSE = 0x00, + SMSG_ITEM_REFUND_INFO_RESPONSE = 0x304E, + SMSG_ITEM_REFUND_RESULT = 0x60DC, + SMSG_ITEM_TEXT_QUERY_RESPONSE = 0x984A, SMSG_ITEM_TIME_UPDATE = 0x00, SMSG_JOINED_BATTLEGROUND_QUEUE = 0x00, SMSG_LEARNED_DANCE_MOVES = 0xE52, - SMSG_LEARNED_SPELL = 0x00, + SMSG_LEARNED_SPELL = 0x88D3, SMSG_LEVELUP_INFO = 0x00, SMSG_LFG_DISABLED = 0x00, SMSG_LFG_JOIN_RESULT = 0x00, @@ -835,32 +835,32 @@ enum Opcodes SMSG_MOVE_KNOCK_BACK = 0x00, SMSG_MOVE_SET_WALK_IN_AIR = 0x00, SMSG_MOVE_UNSET_WALK_IN_AIR = 0x00, - SMSG_MULTIPLE_PACKETS = 0x00, + SMSG_MULTIPLE_PACKETS = 0xDCEA, SMSG_NAME_QUERY_RESPONSE = 0x9CE6, SMSG_NEW_TAXI_PATH = 0xC8FF, // Might be 0x98CF SMSG_NEW_WORLD = 0x00, SMSG_NOTIFICATION = 0x1A56, - SMSG_NOTIFY_DANCE = 0x00, + SMSG_NOTIFY_DANCE = 0xCE62, SMSG_NOTIFY_DEST_LOC_SPELL_CAST = 0x00, SMSG_NPC_TEXT_UPDATE = 0x4C72, SMSG_NPC_WONT_TALK = 0x00, - SMSG_OFFER_PETITION_ERROR = 0x00, + SMSG_OFFER_PETITION_ERROR = 0x1E7F, SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA = 0x00, SMSG_OPEN_CONTAINER = 0x00, SMSG_PAGE_TEXT_QUERY_RESPONSE = 0x18D2, SMSG_PARTYKILLLOG = 0x00, - SMSG_PARTY_MEMBER_STATS = 0x00, + SMSG_PARTY_MEMBER_STATS = 0xDC5A, SMSG_PARTY_MEMBER_STATS_FULL = 0x00, SMSG_PARTY_COMMAND_RESULT = 0x00, SMSG_PAUSE_MIRROR_TIMER = 0x00, SMSG_PERIODICAURALOG = 0x00, SMSG_PETGODMODE = 0x00, SMSG_PETITION_QUERY_RESPONSE = 0xCAEE, - SMSG_PET_ACTION_FEEDBACK = 0x00, + SMSG_PET_ACTION_FEEDBACK = 0x4E5A, SMSG_PET_ACTION_SOUND = 0x0CC7, SMSG_PET_CAST_FAILED = 0x00, SMSG_PET_DISMISS_SOUND = 0x9A56, - SMSG_PET_GUIDS = 0x00, + SMSG_PET_GUIDS = 0x5E6B, SMSG_PET_LEARNED_SPELL = 0xDC5E, SMSG_PET_MODE = 0x58DE, SMSG_PET_NAME_QUERY_RESPONSE = 0xDCD3, @@ -868,7 +868,7 @@ enum Opcodes SMSG_PET_REMOVED_SPELL = 0x18F6, SMSG_PET_SPELLS = 0x5A43, SMSG_PET_TAME_FAILURE = 0x00, - SMSG_PET_UPDATE_COMBO_POINTS = 0x00, + SMSG_PET_UPDATE_COMBO_POINTS = 0x1A47, SMSG_PETITION_SHOWLIST = 0x8ED7, SMSG_PETITION_SHOW_SIGNATURES = 0x4E4A, SMSG_PETITION_SIGN_RESULTS = 0x5EE6, @@ -876,20 +876,20 @@ enum Opcodes SMSG_PLAYED_TIME = 0x187F, SMSG_PLAYERBINDERROR = 0x5A4F, SMSG_PLAYERBOUND = 0x00, - SMSG_PLAYER_DIFFICULTY_CHANGE = 0x00, + SMSG_PLAYER_DIFFICULTY_CHANGE = 0xD846, SMSG_BATTLEGROUND_PLAYER_LEFT = 0x00, - SMSG_PLAYER_SKINNED = 0x00, - SMSG_PLAYER_VEHICLE_DATA = 0x00, - SMSG_PLAY_DANCE = 0x00, + SMSG_PLAYER_SKINNED = 0xDA63, + SMSG_PLAYER_VEHICLE_DATA = 0x186E, + SMSG_PLAY_DANCE = 0x8CFE, SMSG_PLAY_MUSIC = 0x00, SMSG_PLAY_OBJECT_SOUND = 0x00, SMSG_PLAY_SOUND = 0x4ACF, SMSG_PLAY_SPELL_VISUAL = 0x00, SMSG_PLAY_SPELL_IMPACT = 0x00, - SMSG_PLAY_TIME_WARNING = 0x00, + SMSG_PLAY_TIME_WARNING = 0xD857, SMSG_PONG = 0x0380, SMSG_POWER_UPDATE = 0x487E, - SMSG_PRE_RESURRECT = 0x00, + SMSG_PRE_RESURRECT = 0x1CFB, SMSG_PROCRESIST = 0x00, SMSG_PROPOSE_LEVEL_GRANT = 0x00, SMSG_PUREMOUNT_CANCELLED_OBSOLETE = 0x00, @@ -910,7 +910,7 @@ enum Opcodes SMSG_QUESTUPDATE_COMPLETE = 0x9CD6, SMSG_QUESTUPDATE_FAILED = 0x9EF6, SMSG_QUESTUPDATE_FAILEDTIMER = 0x00, - SMSG_QUEST_CONFIRM_ACCEPT = 0x00, + SMSG_QUEST_CONFIRM_ACCEPT = 0x184B, SMSG_QUEST_FORCE_REMOVED = 0x00, SMSG_QUEST_POI_QUERY_RESPONSE = 0x8CC3, SMSG_QUEST_QUERY_RESPONSE = 0x9E56, @@ -922,11 +922,11 @@ enum Opcodes SMSG_READ_ITEM_FAILED = 0x00, SMSG_READ_ITEM_OK = 0x9ECE, SMSG_REALM_SPLIT = 0x1AF2, - SMSG_REAL_GROUP_UPDATE = 0x00, + SMSG_REAL_GROUP_UPDATE = 0x4C56, SMSG_RECEIVED_MAIL = 0xDEE2, SMSG_REDIRECT_CLIENT = 0x0180, SMSG_REFER_A_FRIEND_FAILURE = 0x4867, - SMSG_REMOVED_SPELL = 0x00, + SMSG_REMOVED_SPELL = 0x98FE, SMSG_REPORT_PVP_AFK_RESULT = 0x00, SMSG_REQUEST_CEMETERY_LIST_RESPONSE = 0x00, SMSG_RESPOND_INSPECT_ACHIEVEMENTS = 0x00, @@ -934,34 +934,34 @@ enum Opcodes SMSG_RESISTLOG = 0x00, SMSG_RESURRECT_REQUEST = 0x00, SMSG_RESYNC_RUNES = 0x00, - SMSG_RWHOIS = 0x00, + SMSG_RWHOIS = 0xCCE2, SMSG_SELL_ITEM = 0x9CD3, - SMSG_SEND_MAIL_RESULT = 0x00, - SMSG_SEND_UNLEARN_SPELLS = 0x00, + SMSG_SEND_MAIL_RESULT = 0x8CC2, + SMSG_SEND_UNLEARN_SPELLS = 0xCED2, SMSG_SERVERTIME = 0x1CD7, SMSG_SERVER_FIRST_ACHIEVEMENT = 0xCDF, SMSG_SERVER_MESSAGE = 0xC873, - SMSG_SET_FACTION_ATWAR = 0x00, - SMSG_SET_FACTION_STANDING = 0x00, - SMSG_SET_FACTION_VISIBLE = 0x00, + SMSG_SET_FACTION_ATWAR = 0x1E47, + SMSG_SET_FACTION_STANDING = 0x1AE3, + SMSG_SET_FACTION_VISIBLE = 0x4CEB, SMSG_SET_FLAT_SPELL_MODIFIER = 0x88D3, - SMSG_SET_FORCED_REACTIONS = 0x00, + SMSG_SET_FORCED_REACTIONS = 0xD8C3, SMSG_SET_PCT_SPELL_MODIFIER = 0x98FE, SMSG_SET_PHASE_SHIFT = 0x204C, SMSG_SET_PLAYER_DECLINED_NAMES_RESULT = 0x0E67, - SMSG_SET_PROFICIENCY = 0x00, + SMSG_SET_PROFICIENCY = 0x9C5F, SMSG_SET_PROJECTILE_POSITION = 0x00, SMSG_SHOWTAXINODES = 0x8CFB, SMSG_SHOW_BANK = 0x00, SMSG_SPELLBREAKLOG = 0x00, - SMSG_SPELLDAMAGESHIELD = 0x00, + SMSG_SPELLDAMAGESHIELD = 0x8AFE, SMSG_SPELLENERGIZELOG = 0xD8FB, SMSG_SPELLHEALLOG = 0xDE4A, - SMSG_SPELLINSTAKILLLOG = 0x00, + SMSG_SPELLINSTAKILLLOG = 0x8ED2, SMSG_SPELLLOGEXECUTE = 0x8AD7, SMSG_SPELLLOGMISS = 0x1CFF, SMSG_SPELLNONMELEEDAMAGELOG = 0x5CCF, - SMSG_SPELLORDAMAGE_IMMUNE = 0x00, + SMSG_SPELLORDAMAGE_IMMUNE = 0x48FA, SMSG_SPELL_COOLDOWN = 0x00, SMSG_SPELL_DELAYED = 0x00, SMSG_SPELLDISPELLOG = 0x00, @@ -976,20 +976,20 @@ enum Opcodes SMSG_SPLINE_MOVE_LAND_WALK = 0x00, SMSG_SPLINE_MOVE_ROOT = 0x00, SMSG_SPLINE_MOVE_UNROOT = 0x00, - SMSG_STABLE_RESULT = 0x00, + SMSG_STABLE_RESULT = 0xA5B, SMSG_STANDSTATE_UPDATE = 0x4E52, SMSG_START_MIRROR_TIMER = 0x00, - SMSG_STOP_DANCE = 0x00, + SMSG_STOP_DANCE = 0x8E5F, SMSG_STOP_MIRROR_TIMER = 0x00, - SMSG_SUMMON_REQUEST = 0x00, - SMSG_SUPERCEDED_SPELL = 0x00, + SMSG_SUMMON_REQUEST = 0x9A52, + SMSG_SUPERCEDED_SPELL = 0xDE53, SMSG_TALENTS_INFO = 0x00, SMSG_TAXINODE_STATUS = 0x8CFB, SMSG_TOGGLE_XP_GAIN = 0x8A5B, SMSG_TEXT_EMOTE = 0x9E5A, - SMSG_THREAT_CLEAR = 0x00, - SMSG_THREAT_REMOVE = 0x00, - SMSG_THREAT_UPDATE = 0x00, + SMSG_THREAT_CLEAR = 0x9E4A, + SMSG_THREAT_REMOVE = 0x8A7E, + SMSG_THREAT_UPDATE = 0x5E7B, SMSG_TIME_SYNC_REQ = 0x1009, SMSG_TITLE_EARNED = 0x1AFA, SMSG_TOTEM_CREATED = 0x00, @@ -1010,7 +1010,7 @@ enum Opcodes SMSG_UPDATE_CURRENCY = 0x00, SMSG_UPDATE_CURRENCY_WEEK_LIMIT = 0x00, SMSG_UPDATE_INSTANCE_ENCOUNTER_UNIT = 0x00, - SMSG_UPDATE_INSTANCE_OWNERSHIP = 0x00, + SMSG_UPDATE_INSTANCE_OWNERSHIP = 0xCA73, SMSG_UPDATE_LAST_INSTANCE = 0x58FE, SMSG_UPDATE_LFG_LIST = 0x00, SMSG_UPDATE_OBJECT = 0x1EE7, @@ -1019,14 +1019,14 @@ enum Opcodes SMSG_USERLIST_REMOVE = 0x9A6B, SMSG_USERLIST_UPDATE = 0x4A4B, SMSG_VOICE_CHAT_STATUS = 0x9ADF, - SMSG_VOICE_PARENTAL_CONTROLS = 0x00, - SMSG_VOICE_SESSION_LEAVE = 0x00, - SMSG_VOICE_SESSION_ROSTER_UPDATE = 0x00, - SMSG_VOICE_SET_TALKER_MUTED = 0x00, + SMSG_VOICE_PARENTAL_CONTROLS = 0x5ADE, + SMSG_VOICE_SESSION_LEAVE = 0xCE72, + SMSG_VOICE_SESSION_ROSTER_UPDATE = 0x8AC7, + SMSG_VOICE_SET_TALKER_MUTED = 0x8873, SMSG_WEATHER = 0x4ECE, SMSG_WARDEN_DATA = 0x484F, SMSG_WHO = 0x4C7F, - SMSG_WHOIS = 0x00, + SMSG_WHOIS = 0x9CFF, SMSG_WORLD_STATE_UI_TIMER_UPDATE = 0xDE5E, SMSG_ZONE_UNDER_ATTACK = 0x8CF, -- cgit v1.2.3 From f31a7d8fed8c5c59210f87dd63bb0afcb909c7a2 Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Fri, 6 Jan 2012 16:35:17 +0800 Subject: P2: More opcodes. Signed-off-by: Gyx <2359980687@qq.com> --- src/server/game/DataStores/DBCStores.cpp | 10 +++++----- src/server/game/Server/Protocol/Opcodes.h | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 0300f3bf61f..2f4daa2d2c9 100755 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -704,11 +704,11 @@ void LoadDBCStores(const std::string& dataPath) } // Check loaded DBC files proper version - if (//!sAreaStore.LookupEntry(5839) || // last area (areaflag) added in 4.22 (5839 is wrong? why?) - !sCharTitlesStore.LookupEntry(279) || // last char title added in 4.22 - !sGemPropertiesStore.LookupEntry(1860) || // last gem property added in 4.22 - !sMapStore.LookupEntry(968) || // last map added in 4.22 - !sSpellStore.LookupEntry(102129) ) // last spell added in 4.22 + if (!sAreaStore.LookupEntry(4559) || // last area (areaflag) added in 4.2.2 (14545) + !sCharTitlesStore.LookupEntry(279) || // last char title added in 4.2.2 (14545) + !sGemPropertiesStore.LookupEntry(1860) || // last gem property added in 4.2.2 (14545) + !sMapStore.LookupEntry(968) || // last map added in 4.2.2 (14545) + !sSpellStore.LookupEntry(102129) ) // last spell added in 4.2.2 (14545) { sLog->outError("You have _outdated_ DBC files. Please extract correct versions from current using client."); exit(1); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 25e47be9783..a35e376b1b0 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -33,7 +33,7 @@ enum Opcodes NULL_OPCODE = 0, CMSG_ACCEPT_LEVEL_GRANT = 0xDC4B, - CMSG_ACCEPT_TRADE = 0x00, + CMSG_ACCEPT_TRADE = 0xB4A5, CMSG_ACTIVATETAXI = 0x8CDB, CMSG_ACTIVATETAXIEXPRESS = 0x5E7F, CMSG_ADD_FRIEND = 0x5C57, @@ -43,8 +43,8 @@ enum Opcodes CMSG_AREATRIGGER = 0x5862, CMSG_AREA_SPIRIT_HEALER_QUERY = 0xDC7E, CMSG_AREA_SPIRIT_HEALER_QUEUE = 0x8846, - CMSG_ARENA_TEAM_ACCEPT = 0x00, - CMSG_ARENA_TEAM_DECLINE = 0x00, + CMSG_ARENA_TEAM_ACCEPT = 0xDA42, + CMSG_ARENA_TEAM_DECLINE = 0x8E73, CMSG_ARENA_TEAM_DISBAND = 0x4A5A, CMSG_ARENA_TEAM_INVITE = 0x4862, CMSG_ARENA_TEAM_LEADER = 0x8F3, @@ -56,7 +56,7 @@ enum Opcodes CMSG_ATTACKSWING = 0xDE66, CMSG_AUCTION_LIST_BIDDER_ITEMS = 0x187A, CMSG_AUCTION_LIST_ITEMS = 0xDC5F, - CMSG_AUCTION_LIST_OWNER_ITEMS = 0x00, + CMSG_AUCTION_LIST_OWNER_ITEMS = 0x9CDA, CMSG_AUCTION_PLACE_BID = 0x8E76, CMSG_AUCTION_REMOVE_ITEM = 0xCEC3, CMSG_AUCTION_SELL_ITEM = 0xCE6, @@ -77,7 +77,7 @@ enum Opcodes CMSG_BATTLEFIELD_STATUS = 0x00, MSG_BATTLEGROUND_PLAYER_POSITIONS = 0x00, CMSG_BATTLEMASTER_JOIN_ARENA = 0x00, - CMSG_BEGIN_TRADE = 0x00, + CMSG_BEGIN_TRADE = 0x3724, CMSG_BINDER_ACTIVATE = 0x58FB, CMSG_BOT_DETECTED2 = 0x00, CMSG_BUG = 0x1A77, @@ -460,7 +460,7 @@ enum Opcodes MSG_GM_SHOWLABEL = 0x00, MSG_GM_SUMMON = 0x00, MSG_GUILD_BANK_LOG_QUERY = 0x00, - MSG_GUILD_BANK_MONEY_WITHDRAWN = 0xDE77, // Can be 0xDE77 + MSG_GUILD_BANK_MONEY_WITHDRAWN = 0x00, MSG_GUILD_EVENT_LOG_QUERY = 0xCEDA, MSG_GUILD_PERMISSIONS = 0xDC73, MSG_INSPECT_ARENA_TEAMS = 0xDA4F, @@ -983,7 +983,7 @@ enum Opcodes SMSG_STOP_MIRROR_TIMER = 0x00, SMSG_SUMMON_REQUEST = 0x9A52, SMSG_SUPERCEDED_SPELL = 0xDE53, - SMSG_TALENTS_INFO = 0x00, + SMSG_TALENTS_INFO = 0x5EC6, SMSG_TAXINODE_STATUS = 0x8CFB, SMSG_TOGGLE_XP_GAIN = 0x8A5B, SMSG_TEXT_EMOTE = 0x9E5A, -- cgit v1.2.3 From 57798840022eb651d4e405af798499bc1e0a76c2 Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Fri, 6 Jan 2012 19:24:51 +0800 Subject: P3: And more opcodes. Signed-off-by: Gyx <2359980687@qq.com> --- src/server/game/Server/Protocol/Opcodes.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index a35e376b1b0..3074242e132 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -460,7 +460,7 @@ enum Opcodes MSG_GM_SHOWLABEL = 0x00, MSG_GM_SUMMON = 0x00, MSG_GUILD_BANK_LOG_QUERY = 0x00, - MSG_GUILD_BANK_MONEY_WITHDRAWN = 0x00, + MSG_GUILD_BANK_MONEY_WITHDRAWN = 0xDE77, MSG_GUILD_EVENT_LOG_QUERY = 0xCEDA, MSG_GUILD_PERMISSIONS = 0xDC73, MSG_INSPECT_ARENA_TEAMS = 0xDA4F, @@ -650,7 +650,7 @@ enum Opcodes SMSG_CRITERIA_DELETED = 0x00, SMSG_CRITERIA_UPDATE = 0xD87F, SMSG_CROSSED_INEBRIATION_THRESHOLD = 0x9CD7, - SMSG_DAMAGE_CALC_LOG = 0x00, + SMSG_DAMAGE_CALC_LOG = 0x5C47, SMSG_DAMAGE_DONE_OBSOLETE = 0x00, SMSG_DANCE_QUERY_RESPONSE = 0x9E42, SMSG_DB_REPLY = 0x76EC, @@ -692,7 +692,7 @@ enum Opcodes SMSG_FORCE_PITCH_RATE_CHANGE = 0x00, SMSG_FORCE_RUN_BACK_SPEED_CHANGE = 0x00, SMSG_FORCE_RUN_SPEED_CHANGE = 0x00, - SMSG_FORCE_SEND_QUEUED_PACKETS = 0x00, + SMSG_FORCE_SEND_QUEUED_PACKETS = 0x1380, SMSG_FORCE_TURN_RATE_CHANGE = 0x00, SMSG_FORCE_SWIM_SPEED_CHANGE = 0x00, SMSG_FORCE_SWIM_BACK_SPEED_CHANGE = 0x00, @@ -724,7 +724,7 @@ enum Opcodes SMSG_GROUP_INVITE = 0x00, SMSG_GROUP_JOINED_BATTLEGROUND = 0x265C, SMSG_GROUP_LIST = 0x00, - SMSG_GROUP_SET_LEADER = 0x00, + SMSG_GROUP_SET_LEADER = 0xCCF2, SMSG_GROUP_UNINVITE = 0x00, SMSG_GUILDFINDER_SEARCH_RESULT = 0xE0CE, // New 4.x SMSG_GUILD_BANK_LIST = 0x5EFB, @@ -810,7 +810,7 @@ enum Opcodes SMSG_LOOT_ROLL_WON = 0x5E4B, SMSG_LOOT_SLOT_CHANGED = 0xDCDA, SMSG_LOOT_START_ROLL = 0xC8C2, - SMSG_MAIL_LIST_RESULT = 0x00, + SMSG_MAIL_LIST_RESULT = 0x5CD7, SMSG_MEETINGSTONE_COMPLETE = 0x00, SMSG_MEETINGSTONE_IN_PROGRESS = 0x00, SMSG_MEETINGSTONE_MEMBER_ADDED = 0x00, -- cgit v1.2.3 From f27cc655880ebe2ce38c133a22592b6b7730a759 Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Sat, 7 Jan 2012 10:24:35 +0800 Subject: P4: Fixed some opcodes. Fixed HandleReadItem (CMSG_READ_ITEM). Signed-off-by: Gyx <2359980687@qq.com> --- src/server/game/Server/Protocol/Handlers/ItemHandler.cpp | 3 --- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- src/server/game/Server/Protocol/Opcodes.h | 8 ++++---- 3 files changed, 5 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp b/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp index de1a1b08ce3..be1261ab6fc 100755 --- a/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp @@ -432,12 +432,9 @@ void WorldSession::HandleItemQuerySingleOpcode(WorldPacket & recv_data) void WorldSession::HandleReadItem(WorldPacket & recv_data) { - //sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_READ_ITEM"); - uint8 bag, slot; recv_data >> bag >> slot; - //sLog->outDetail("STORAGE: Read bag = %u, slot = %u", bag, slot); Item* pItem = _player->GetItemByPos(bag, slot); if (pItem && pItem->GetTemplate()->PageText) diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index a514c0c7b23..6d8d1a6bc56 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -236,7 +236,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_DESTROY_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_USE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUseItemOpcode ); DEFINE_OPCODE_HANDLER(CMSG_OPEN_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleOpenItemOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_READ_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReadItem ); + DEFINE_OPCODE_HANDLER(CMSG_READ_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReadItem ); DEFINE_OPCODE_HANDLER(SMSG_READ_ITEM_OK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_READ_ITEM_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ITEM_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 3074242e132..a3d10c48181 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -355,7 +355,7 @@ enum Opcodes CMSG_QUEST_CONFIRM_ACCEPT = 0xC63, CMSG_RANDOMIZE_CHAR_NAME = 0x8A99, // byte unk, byte race CMSG_READY_FOR_ACCOUNT_DATA_TIMES = 0xCCDB, - CMSG_READ_ITEM = 0x00, + CMSG_READ_ITEM = 0x184F, CMSG_REALM_SPLIT = 0xDC66, CMSG_RECLAIM_CORPSE = 0x88DB, CMSG_REDIRECTION_AUTH_PROOF = 0x1039, @@ -774,7 +774,7 @@ enum Opcodes SMSG_JOINED_BATTLEGROUND_QUEUE = 0x00, SMSG_LEARNED_DANCE_MOVES = 0xE52, SMSG_LEARNED_SPELL = 0x88D3, - SMSG_LEVELUP_INFO = 0x00, + SMSG_LEVELUP_INFO = 0x9A73, SMSG_LFG_DISABLED = 0x00, SMSG_LFG_JOIN_RESULT = 0x00, SMSG_LFG_OFFER_CONTINUE = 0x00, @@ -799,9 +799,9 @@ enum Opcodes SMSG_LOG_XPGAIN = 0x4E7E, SMSG_LOOT_ALL_PASSED = 0x1C7A, SMSG_LOOT_CLEAR_MONEY = 0x586E, - SMSG_LOOT_ITEM_NOTIFY = 0x00, + SMSG_LOOT_ITEM_NOTIFY = 0xD8E3, SMSG_LOOT_LIST = 0x8C5B, - SMSG_LOOT_MASTER_LIST = 0x00, + SMSG_LOOT_MASTER_LIST = 0xDE4E, SMSG_LOOT_MONEY_NOTIFY = 0x0EF3, SMSG_LOOT_RELEASE_RESPONSE = 0x88FF, SMSG_LOOT_REMOVED = 0x8E6B, -- cgit v1.2.3 From 42f3f91ad400b9e129213eb06df6256bb55079be Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Sat, 7 Jan 2012 12:28:09 +0800 Subject: P5: Typo... Signed-off-by: Gyx <2359980687@qq.com> --- src/server/game/Entities/Object/Updates/UpdateFields.h | 4 ++++ src/server/game/Server/Protocol/Handlers/ItemHandler.cpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Entities/Object/Updates/UpdateFields.h b/src/server/game/Entities/Object/Updates/UpdateFields.h index ce063f4f2f1..22c22b2335a 100755 --- a/src/server/game/Entities/Object/Updates/UpdateFields.h +++ b/src/server/game/Entities/Object/Updates/UpdateFields.h @@ -179,7 +179,10 @@ enum EUnitFields UNIT_FIELD_MAXITEMLEVEL = OBJECT_END + 0x0088, // Size: 1, Type: INT, Flags: PUBLIC UNIT_FIELD_PADDING = OBJECT_END + 0x0089, // Size: 1, Type: INT, Flags: NONE UNIT_END = OBJECT_END + 0x008A, +}; +enum EPlayerFields +{ PLAYER_DUEL_ARBITER = UNIT_END + 0x0000, // Size: 2, Type: LONG, Flags: PUBLIC PLAYER_FLAGS = UNIT_END + 0x0002, // Size: 1, Type: INT, Flags: PUBLIC PLAYER_GUILDRANK = UNIT_END + 0x0003, // Size: 1, Type: INT, Flags: PUBLIC @@ -540,4 +543,5 @@ enum ECorpseFields CORPSE_FIELD_DYNAMIC_FLAGS = OBJECT_END + 0x001B, // Size: 1, Type: INT, Flags: UNUSED2 CORPSE_END = OBJECT_END + 0x001C, }; + #endif diff --git a/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp b/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp index be1261ab6fc..aebb832ce58 100755 --- a/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp @@ -444,7 +444,7 @@ void WorldSession::HandleReadItem(WorldPacket & recv_data) InventoryResult msg = _player->CanUseItem(pItem); if (msg == EQUIP_ERR_OK) { - data.Initialize (SMSG_READ_ITEM_OK, 8); + data.Initialize(SMSG_READ_ITEM_OK, 8); sLog->outDetail("STORAGE: Item page sent"); } else -- cgit v1.2.3 From ccf8b3889b8a67c18d5c5c79ce3c0cd32d7647f6 Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 7 Jan 2012 16:40:50 +0000 Subject: Core/Protocol: Enable some handlers --- src/server/game/Server/Protocol/Opcodes.cpp | 80 ++++++++++++++--------------- src/server/game/Server/Protocol/Opcodes.h | 4 +- 2 files changed, 42 insertions(+), 42 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 6d8d1a6bc56..a72595c59d7 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -164,7 +164,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_GROUP_UNINVITE_GUID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupUninviteGuidOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_GROUP_UNINVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_SET_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupSetLeaderOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_GROUP_SET_LEADER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GROUP_SET_LEADER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_LOOT_METHOD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMethodOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_DISBAND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupDisbandOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_GROUP_DESTROYED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -333,7 +333,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_BAG_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoStoreBagItemOpcode ); DEFINE_OPCODE_HANDLER(CMSG_SWAP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSwapItem ); DEFINE_OPCODE_HANDLER(CMSG_SWAP_INV_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSwapInvItemOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_SPLIT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSplitItemOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_SPLIT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSplitItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_AUTOEQUIP_ITEM_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoEquipItemSlotOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_UNCLAIM_LICENSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_DESTROYITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDestroyItemOpcode ); @@ -345,7 +345,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_BEGIN_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBeginTradeOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_BUSY_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBusyTradeOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleIgnoreTradeOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_ACCEPT_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAcceptTradeOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_ACCEPT_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAcceptTradeOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_UNACCEPT_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnacceptTradeOpcode ); DEFINE_OPCODE_HANDLER(CMSG_CANCEL_TRADE, STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelTradeOpcode); //DEFINE_OPCODE_HANDLER(CMSG_SET_TRADE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTradeItemOpcode ); @@ -353,17 +353,17 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_SET_TRADE_GOLD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTradeGoldOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_TRADE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TRADE_STATUS_EXTENDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_INITIALIZE_FACTIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SET_FACTION_VISIBLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SET_FACTION_STANDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_INITIALIZE_FACTIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SET_FACTION_VISIBLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SET_FACTION_STANDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SET_FACTION_ATWAR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetFactionAtWar ); //DEFINE_OPCODE_HANDLER(CMSG_SET_FACTION_CHEAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetFactionCheat ); - //DEFINE_OPCODE_HANDLER(SMSG_SET_PROFICIENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SET_PROFICIENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SET_ACTION_BUTTON, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActionButtonOpcode ); DEFINE_OPCODE_HANDLER(SMSG_ACTION_BUTTONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_INITIAL_SPELLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LEARNED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SUPERCEDED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LEARNED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SUPERCEDED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_NEW_SPELL_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_CAST_SPELL, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleCastSpellOpcode ); DEFINE_OPCODE_HANDLER(CMSG_CANCEL_CAST, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleCancelCastOpcode ); @@ -422,10 +422,10 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_LOOT_ITEM_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LOOT_CLEAR_MONEY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ITEM_PUSH_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DUEL_REQUESTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_DUEL_REQUESTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DUEL_OUTOFBOUNDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DUEL_INBOUNDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DUEL_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_DUEL_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_DUEL_WINNER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_DUEL_ACCEPTED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDuelAcceptedOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_DUEL_CANCELLED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDuelCancelledOpcode ); @@ -445,7 +445,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_GOSSIP_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGossipHelloOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GOSSIP_SELECT_OPTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGossipSelectOptionOpcode ); DEFINE_OPCODE_HANDLER(SMSG_GOSSIP_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GOSSIP_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GOSSIP_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_NPC_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNpcTextQueryOpcode ); DEFINE_OPCODE_HANDLER(SMSG_NPC_TEXT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_NPC_WONT_TALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -475,7 +475,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_ADD_KILL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_ADD_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_QUEST_CONFIRM_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestConfirmAccept ); - //DEFINE_OPCODE_HANDLER(SMSG_QUEST_CONFIRM_ACCEPT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUEST_CONFIRM_ACCEPT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_PUSHQUESTTOPARTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePushQuestToParty ); DEFINE_OPCODE_HANDLER(CMSG_LIST_INVENTORY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleListInventoryOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_LIST_INVENTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -567,7 +567,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_PARTYKILLLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_UPDATE_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PLAY_SPELL_IMPACT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_EXPLORATION_EXPERIENCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_EXPLORATION_EXPERIENCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GM_SET_SECURITY_GROUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GM_NUKE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_RANDOM_ROLL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRandomRollOpcode ); @@ -578,7 +578,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_LFG_TELEPORT_DENIED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_SKILL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnlearnSkillOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_REMOVED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_REMOVED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_DECHARGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_CREATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketCreateOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_CREATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -634,7 +634,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_SEND_MAIL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSendMail ); //DEFINE_OPCODE_HANDLER(SMSG_SEND_MAIL_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GET_MAIL_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGetMailList ); - //DEFINE_OPCODE_HANDLER(SMSG_MAIL_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MAIL_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlefieldListOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_JOIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -660,11 +660,11 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_RESURRECT_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_TOGGLE_PVP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTogglePvP ); DEFINE_OPCODE_HANDLER(SMSG_ZONE_UNDER_ATTACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(MSG_AUCTION_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionHelloOpcode ); + DEFINE_OPCODE_HANDLER(MSG_AUCTION_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionHelloOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_SELL_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionSellItem ); //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_REMOVE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionRemoveItem ); //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListItems ); - //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_OWNER_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListOwnerItems ); + DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_OWNER_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListOwnerItems ); //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_PLACE_BID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionPlaceBid ); //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_AUCTION_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -674,11 +674,11 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_PROCRESIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMBAT_EVENT_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DISPEL_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELLORDAMAGE_IMMUNE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELLORDAMAGE_IMMUNE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_BIDDER_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListBidderItems ); //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_BIDDER_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SET_FLAT_SPELL_MODIFIER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SET_PCT_SPELL_MODIFIER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SET_FLAT_SPELL_MODIFIER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SET_PCT_SPELL_MODIFIER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CORPSE_RECLAIM_DELAY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIVE_MOVER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActiveMoverOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_PET_CANCEL_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetCancelAuraOpcode ); @@ -740,13 +740,13 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_LOOT_ROLL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_LOOT_MASTER_GIVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMasterGiveOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_LOOT_MASTER_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SET_FORCED_REACTIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SET_FORCED_REACTIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPELL_FAILED_OTHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_RESET_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_REPAIR_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepairItemOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_CHAT_PLAYER_NOT_FOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(MSG_TALENT_WIPE_CONFIRM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTalentWipeConfirmOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_SUMMON_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SUMMON_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SUMMON_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSummonResponseOpcode ); //DEFINE_OPCODE_HANDLER(MSG_DEV_SHOWLABEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(SMSG_MONSTER_MOVE_TRANSPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -758,12 +758,12 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_FEIGN_DEATH_RESISTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_RUN_SCRIPT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_SCRIPT_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DUEL_COUNTDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_DUEL_COUNTDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_AREA_TRIGGER_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SHOWING_HELM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleShowingHelmOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SHOWING_CLOAK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleShowingCloakOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_ROLE_CHOSEN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PLAYER_SKINNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PLAYER_SKINNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DURABILITY_DAMAGE_DEATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SET_EXPLORATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIONBAR_TOGGLES, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActionBarToggles ); @@ -773,7 +773,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_WORLD_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_ITEM_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemNameQueryOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_ITEM_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_ACTION_FEEDBACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PET_ACTION_FEEDBACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_CHAR_RENAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharRenameOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_CHAR_RENAME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SPLINE_DONE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveSplineDoneOpcode ); @@ -859,7 +859,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(MSG_MOVE_TIME_SKIPPED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SET_EXPLORATION_ALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_INVALIDATE_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_INVALIDATE_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_RESET_INSTANCES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleResetInstancesOpcode ); DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_RESET_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -878,7 +878,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_KNOCKBACK_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_CHAT_PLAYER_AMBIGUOUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(MSG_DELAY_GHOST_TELEPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELLINSTAKILLLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELLINSTAKILLLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELL_UPDATE_CHAIN_TARGETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_CHAT_FILTERED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_EXPECTED_SPAM_RECORDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -909,7 +909,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamQueryOpcode ); DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_ROSTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamRosterOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_ROSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_ROSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamInviteOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamAcceptOpcode ); @@ -990,7 +990,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY_RESPONSE_WRITE_FILE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_COMBO_POINTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_ROSTER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_LEAVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_LEAVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_ADJUST_PRIORITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_VOICE_SET_TALKER_MUTED_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SET_TALKER_MUTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1024,7 +1024,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_INSTANCE_COMMAND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_TARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_BOT_DETECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_CROSSED_INEBRIATION_THRESHOLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CROSSED_INEBRIATION_THRESHOLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_PLAYER_LOGIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_PLAYER_LOOKUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_CHEAT_PLAYER_LOOKUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1086,7 +1086,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_VOICESESSION_FULL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(MSG_GUILD_PERMISSIONS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildPermissions ); //DEFINE_OPCODE_HANDLER(MSG_GUILD_BANK_MONEY_WITHDRAWN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankMoneyWithdrawn ); - //DEFINE_OPCODE_HANDLER(MSG_GUILD_EVENT_LOG_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildEventLogQueryOpcode ); + DEFINE_OPCODE_HANDLER(MSG_GUILD_EVENT_LOG_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildEventLogQueryOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_MAELSTROM_RENAME_GUILD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GET_MIRRORIMAGE_DATA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMirrorImageDataRequest ); //DEFINE_OPCODE_HANDLER(SMSG_MIRRORIMAGE_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1117,7 +1117,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_QUERY_SERVER_BUCK_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_SERVER_BUCK_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_SERVER_BUCK_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SEND_UNLEARN_SPELLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SEND_UNLEARN_SPELLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PROPOSE_LEVEL_GRANT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_ACCEPT_LEVEL_GRANT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAcceptGrantLevel ); //DEFINE_OPCODE_HANDLER(SMSG_REFER_A_FRIEND_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1219,8 +1219,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJ_REPORT_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGameobjectReportUse ); //DEFINE_OPCODE_HANDLER(SMSG_HIGHEST_THREAT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_THREAT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_THREAT_REMOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_THREAT_CLEAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_THREAT_REMOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_THREAT_CLEAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CONVERT_RUNE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_RESYNC_RUNES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ADD_RUNE_POWER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1233,9 +1233,9 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_PENDING_SALES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListPendingSales ); //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_LIST_PENDING_SALES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MODIFY_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_UPDATE_COMBO_POINTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PET_UPDATE_COMBO_POINTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_ENABLETAXI, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleTaxiQueryAvailableNodes ); - //DEFINE_OPCODE_HANDLER(SMSG_PRE_RESURRECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PRE_RESURRECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_AURA_UPDATE_ALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_AURA_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_FLOOD_GRACE_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -1254,10 +1254,10 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_SET_BREATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_QUERY_VEHICLE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_INFO_THROTTLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PLAYER_VEHICLE_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PLAYER_VEHICLE_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_PLAYER_VEHICLE_ENTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEnterPlayerVehicle ); //DEFINE_OPCODE_HANDLER(CMSG_CONTROLLER_EJECT_PASSENGER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEjectPassenger ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_GUIDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PET_GUIDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CLIENTCACHE_VERSION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_CHANGE_GDF_ARENA_RATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_ARENA_TEAM_RATING_BY_INDEX, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -1360,7 +1360,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_REDIRECTION_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_SUSPEND_COMMS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SUSPEND_COMMS_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_FORCE_SEND_QUEUED_PACKETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_FORCE_SEND_QUEUED_PACKETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_REDIRECTION_AUTH_PROOF, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_DROP_NEW_CONNECTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_SEND_ALL_COMBAT_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index a3d10c48181..aeb5c8b24a6 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -944,9 +944,9 @@ enum Opcodes SMSG_SET_FACTION_ATWAR = 0x1E47, SMSG_SET_FACTION_STANDING = 0x1AE3, SMSG_SET_FACTION_VISIBLE = 0x4CEB, - SMSG_SET_FLAT_SPELL_MODIFIER = 0x88D3, + SMSG_SET_FLAT_SPELL_MODIFIER = 0x4EF2, SMSG_SET_FORCED_REACTIONS = 0xD8C3, - SMSG_SET_PCT_SPELL_MODIFIER = 0x98FE, + SMSG_SET_PCT_SPELL_MODIFIER = 0x485B, SMSG_SET_PHASE_SHIFT = 0x204C, SMSG_SET_PLAYER_DECLINED_NAMES_RESULT = 0x0E67, SMSG_SET_PROFICIENCY = 0x9C5F, -- cgit v1.2.3 From 9f4bdbe3d7ef8cbfaeb0318d8eaaf7499088d44d Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 7 Jan 2012 17:29:59 +0000 Subject: Core/DB: Fix corpse loading prepared statements (typo introduced in merge) --- src/server/shared/Database/Implementation/CharacterDatabase.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index 6b331740aa6..fef3c9f9ccf 100755 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -291,8 +291,8 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_DEL_PLAYER_HOMEBIND, "DELETE FROM character_homebind WHERE guid = ?", CONNECTION_ASYNC) // Corpse - PREPARE_STATEMENT(CHAR_SEL_CORPSES, "SELECT posX, posY, posZ, orientation, mapId, displayId, itemCache, bytes1, bytes2, guildId, flags, dynFlags, time, corpseType, instanceId, phaseMask, corpseGuid, guid FROM corpse WHERE corpseType <> 0", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_INS_CORPSE, "INSERT INTO corpse (corpseGuid, guid, posX, posY, posZ, orientation, mapId, displayId, itemCache, bytes1, bytes2, guildId, flags, dynFlags, time, corpseType, instanceId, phaseMask) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_SEL_CORPSES, "SELECT posX, posY, posZ, orientation, mapId, displayId, itemCache, bytes1, bytes2, flags, dynFlags, time, corpseType, instanceId, phaseMask, corpseGuid, guid FROM corpse WHERE corpseType <> 0", CONNECTION_SYNCH) + PREPARE_STATEMENT(CHAR_INS_CORPSE, "INSERT INTO corpse (corpseGuid, guid, posX, posY, posZ, orientation, mapId, displayId, itemCache, bytes1, bytes2, flags, dynFlags, time, corpseType, instanceId, phaseMask) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_CORPSE, "DELETE FROM corpse WHERE corpseGuid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_PLAYER_CORPSES, "DELETE FROM corpse WHERE guid = ? AND corpseType <> 0", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_OLD_CORPSES, "DELETE FROM corpse WHERE corpseType = 0 OR time < (UNIX_TIMESTAMP(NOW()) - ?)", CONNECTION_ASYNC) -- cgit v1.2.3 From 0b507c1a293536f1d1b5675a2908b6b8cc2e1be1 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 7 Jan 2012 18:34:31 +0100 Subject: Core/Movement: 4.2.2 structure for MSG_MOVE_FALL_LAND --- src/server/game/Movement/MovementStructures.h | 72 +++++++++++++-------------- 1 file changed, 36 insertions(+), 36 deletions(-) (limited to 'src') diff --git a/src/server/game/Movement/MovementStructures.h b/src/server/game/Movement/MovementStructures.h index 09ad8a1a659..3992858ceac 100644 --- a/src/server/game/Movement/MovementStructures.h +++ b/src/server/game/Movement/MovementStructures.h @@ -150,70 +150,70 @@ MovementStatusElements PlayerMoveSequence[] = { MSEFallHorizontalSpeed, MSEFallTime, }; - +//4.2.2 MovementStatusElements MovementFallLandSequence[] = { - MSEGuidByte5, - MSEGuidByte6, MSEGuidByte4, - MSEGuidByte1, - MSEGuidByte2, + MSEGuidByte6, + MSEGuidByte3, MSEHaveSpline, - MSEFlags2, + MSEGuidByte2, + MSEFlags, MSEGuidByte7, - MSEGuidByte3, + MSEGuidByte1, + MSEFlags2, + MSEGuidByte5, MSEGuidByte0, - MSEFlags, MSEHaveFallData, MSEHaveFallDirection, + MSEHavePitch, MSEHaveTransportData, - MSETransportGuidByte6, - MSETransportGuidByte3, - MSETransportGuidByte7, - MSETransportGuidByte4, - MSETransportGuidByte1, MSETransportGuidByte0, + MSETransportGuidByte6, MSETransportGuidByte2, MSETransportGuidByte5, - MSETransportHaveTime3, + MSETransportGuidByte4, + MSETransportGuidByte1, + MSETransportGuidByte3, + MSETransportGuidByte7, MSETransportHaveTime2, - MSEHavePitch, + MSETransportHaveTime3, MSEHaveSplineElev, - MSETimestamp, + MSEPositionO, MSEPositionX, MSEPositionY, MSEPositionZ, - MSEPositionO, + MSETimestamp, MSEGuidByte7_2, MSEGuidByte2_2, - MSEGuidByte3_2, - MSEGuidByte0_2, - MSEGuidByte1_2, - MSEGuidByte5_2, - MSEFallVerticalSpeed, MSEFallTime, + MSEFallVerticalSpeed, MSEFallHorizontalSpeed, - MSEFallCosAngle, MSEFallSinAngle, - MSETransportTime, + MSEFallCosAngle, + MSEGuidByte0_2, + MSEPitch, + MSEGuidByte4_2, + MSEGuidByte6_2, + MSEGuidByte5_2, + MSEGuidByte3_2, + MSETransportSeat, + MSETransportPositionO, MSETransportPositionX, MSETransportPositionY, MSETransportPositionZ, - MSETransportPositionO, - MSETransportSeat, + MSETransportTime, + MSETransportTime2, MSETransportGuidByte3_2, - MSETransportGuidByte1_2, - MSETransportTime3, MSETransportGuidByte6_2, - MSETransportGuidByte0_2, - MSETransportGuidByte5_2, - MSETransportTime2, + MSETransportTime3, MSETransportGuidByte7_2, - MSETransportGuidByte4_2, + MSETransportGuidByte5_2, MSETransportGuidByte2_2, - MSEPitch, + MSETransportGuidByte1_2, + MSETransportGuidByte0_2, + MSETransportGuidByte4_2, MSESplineElev, - MSEGuidByte6_2, - MSEGuidByte4_2, + MSEGuidByte1_2, }; //4.2.2 MovementStatusElements MovementHeartBeatSequence[] = { @@ -1327,7 +1327,7 @@ MovementStatusElements* GetMovementStatusElementsSequence(Opcodes opcode) { case SMSG_PLAYER_MOVE://done return PlayerMoveSequence; - case MSG_MOVE_FALL_LAND: + case MSG_MOVE_FALL_LAND://done return MovementFallLandSequence; case MSG_MOVE_HEARTBEAT://done return MovementHeartBeatSequence; -- cgit v1.2.3 From 79e7e86384e565d989654c547dac52ead20af6ff Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Sun, 8 Jan 2012 11:35:00 +0800 Subject: P7: Small clean-up. Signed-off-by: Gyx <2359980687@qq.com> --- src/server/game/World/World.cpp | 9 ++------- src/server/shared/DataStores/DBCFileLoader.h | 15 --------------- 2 files changed, 2 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 79ef12e4115..eaa17b3f072 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1242,12 +1242,7 @@ void World::SetInitialWorldSettings() //No SQL injection as values are treated as integers // not send custom type REALM_FFA_PVP to realm list - uint32 server_type; - if (IsFFAPvPRealm()) - server_type = REALM_TYPE_PVP; - else - server_type = getIntConfig(CONFIG_GAME_TYPE); - + uint32 server_type = IsFFAPvPRealm() ? REALM_TYPE_PVP : getIntConfig(CONFIG_GAME_TYPE); uint32 realm_zone = getIntConfig(CONFIG_REALM_ZONE); LoginDatabase.PExecute("UPDATE realmlist SET icon = %u, timezone = %u WHERE id = '%d'", server_type, realm_zone, realmID); // One-time query @@ -2797,8 +2792,8 @@ void World::LoadDBVersion() if (result) { Field* fields = result->Fetch(); - m_DBVersion = fields[0].GetString(); + m_DBVersion = fields[0].GetString(); // will be overwrite by config values if different and non-0 m_int_configs[CONFIG_CLIENTCACHE_VERSION] = fields[1].GetUInt32(); } diff --git a/src/server/shared/DataStores/DBCFileLoader.h b/src/server/shared/DataStores/DBCFileLoader.h index 184186d28ee..3d5c23dcb85 100755 --- a/src/server/shared/DataStores/DBCFileLoader.h +++ b/src/server/shared/DataStores/DBCFileLoader.h @@ -22,21 +22,6 @@ #include "Utilities/ByteConverter.h" #include -/*enum -{ - FT_NA='x', //not used or unknown, 4 byte size - FT_NA_BYTE='X', //not used or unknown, byte - FT_STRING='s', //char* - FT_FLOAT='f', //float - FT_INT='i', //uint32 - FT_BYTE='b', //uint8 - FT_SORT='d', //sorted by this field, field is not included - FT_IND='n', //the same, but parsed to data - FT_LOGIC='l', //Logical (boolean) - FT_SQL_PRESENT='p', //Used in sql format to mark column present in sql dbc - FT_SQL_ABSENT='a' //Used in sql format to mark column absent in sql dbc -};*/ - class DBCFileLoader { public: -- cgit v1.2.3 From 636e2fb7525db490c35e53442c564d37d87b9369 Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Sun, 8 Jan 2012 12:17:06 +0800 Subject: P8: Fixed corpse loading crash. Signed-off-by: Gyx <2359980687@qq.com> --- src/server/game/Globals/ObjectMgr.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index e2cf7d981cd..8c14c0b04fc 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -6791,6 +6791,9 @@ uint32 ObjectMgr::GeneratePetNumber() void ObjectMgr::LoadCorpses() { + // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 + // SELECT posX, posY, posZ, orientation, mapId, displayId, itemCache, bytes1, bytes2, flags, dynFlags, time, corpseType, instanceId, phaseMask, corpseGuid, guid FROM corpse WHERE corpseType <> 0 + uint32 oldMSTime = getMSTime(); PreparedQueryResult result = CharacterDatabase.Query(CharacterDatabase.GetPreparedStatement(CHAR_SEL_CORPSES)); @@ -6806,7 +6809,7 @@ void ObjectMgr::LoadCorpses() { Field* fields = result->Fetch(); uint32 guid = fields[16].GetUInt32(); - CorpseType type = CorpseType(fields[13].GetUInt8()); + CorpseType type = CorpseType(fields[12].GetUInt8()); if (type >= MAX_CORPSE_TYPE) { sLog->outError("Corpse (guid: %u) have wrong corpse type (%u), not loading.", guid, type); -- cgit v1.2.3 From 1180fbf531eb6e4c359763d23c3ec65349b94944 Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Sun, 8 Jan 2012 14:42:37 +0800 Subject: P9: Update ItemClass & ItemSubclass from ItemClass.dbc & ItemSubclass.dbc Signed-off-by: Gyx <2359980687@qq.com> --- src/server/game/DataStores/DBCStores.cpp | 6 +-- src/server/game/Entities/Item/ItemPrototype.h | 77 ++++++++++++++------------- src/server/game/Entities/Player/Player.cpp | 4 +- 3 files changed, 46 insertions(+), 41 deletions(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 24c07809df2..3a5a988e7b7 100755 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -1097,11 +1097,11 @@ uint32 ScalingStatValuesEntry::GetDPSAndDamageMultiplier(uint32 subClass, bool i case ITEM_SUBCLASS_WEAPON_CROSSBOW: *damageMultiplier = 0.3f; return dpsMod[4]; - case ITEM_SUBCLASS_WEAPON_obsolete: + case ITEM_SUBCLASS_WEAPON_Obsolete: case ITEM_SUBCLASS_WEAPON_EXOTIC: case ITEM_SUBCLASS_WEAPON_EXOTIC2: - case ITEM_SUBCLASS_WEAPON_FIST: - case ITEM_SUBCLASS_WEAPON_MISC: + case ITEM_SUBCLASS_WEAPON_FIST_WEAPON: + case ITEM_SUBCLASS_WEAPON_MISCELLANEOUS: case ITEM_SUBCLASS_WEAPON_SPEAR: case ITEM_SUBCLASS_WEAPON_WAND: break; diff --git a/src/server/game/Entities/Item/ItemPrototype.h b/src/server/game/Entities/Item/ItemPrototype.h index c329b9c7bf9..048da0b231c 100755 --- a/src/server/game/Entities/Item/ItemPrototype.h +++ b/src/server/game/Entities/Item/ItemPrototype.h @@ -277,14 +277,14 @@ enum ItemClass ITEM_CLASS_REAGENT = 5, ITEM_CLASS_PROJECTILE = 6, ITEM_CLASS_TRADE_GOODS = 7, - ITEM_CLASS_GENERIC = 8, + ITEM_CLASS_GENERIC = 8, // OBSOLETE ITEM_CLASS_RECIPE = 9, - ITEM_CLASS_MONEY = 10, + ITEM_CLASS_MONEY = 10, // OBSOLETE ITEM_CLASS_QUIVER = 11, ITEM_CLASS_QUEST = 12, ITEM_CLASS_KEY = 13, - ITEM_CLASS_PERMANENT = 14, - ITEM_CLASS_MISC = 15, + ITEM_CLASS_PERMANENT = 14, // OBSOLETE + ITEM_CLASS_MISCELLANEOUS = 15, ITEM_CLASS_GLYPH = 16 }; @@ -297,7 +297,7 @@ enum ItemSubclassConsumable ITEM_SUBCLASS_ELIXIR = 2, ITEM_SUBCLASS_FLASK = 3, ITEM_SUBCLASS_SCROLL = 4, - ITEM_SUBCLASS_FOOD = 5, + ITEM_SUBCLASS_FOOD_DRINK = 5, ITEM_SUBCLASS_ITEM_ENHANCEMENT = 6, ITEM_SUBCLASS_BANDAGE = 7, ITEM_SUBCLASS_CONSUMABLE_OTHER = 8 @@ -315,28 +315,29 @@ enum ItemSubclassContainer ITEM_SUBCLASS_GEM_CONTAINER = 5, ITEM_SUBCLASS_MINING_CONTAINER = 6, ITEM_SUBCLASS_LEATHERWORKING_CONTAINER = 7, - ITEM_SUBCLASS_INSCRIPTION_CONTAINER = 8 + ITEM_SUBCLASS_INSCRIPTION_CONTAINER = 8, + ITEM_SUBCLASS_TACKLE_CONTAINER = 9 }; -#define MAX_ITEM_SUBCLASS_CONTAINER 9 +#define MAX_ITEM_SUBCLASS_CONTAINER 10 enum ItemSubclassWeapon { - ITEM_SUBCLASS_WEAPON_AXE = 0, - ITEM_SUBCLASS_WEAPON_AXE2 = 1, + ITEM_SUBCLASS_WEAPON_AXE = 0, // One-Handed Axes + ITEM_SUBCLASS_WEAPON_AXE2 = 1, // Two-Handed Axes ITEM_SUBCLASS_WEAPON_BOW = 2, ITEM_SUBCLASS_WEAPON_GUN = 3, - ITEM_SUBCLASS_WEAPON_MACE = 4, - ITEM_SUBCLASS_WEAPON_MACE2 = 5, + ITEM_SUBCLASS_WEAPON_MACE = 4, // One-Handed Maces + ITEM_SUBCLASS_WEAPON_MACE2 = 5, // Two-Handed Maces ITEM_SUBCLASS_WEAPON_POLEARM = 6, - ITEM_SUBCLASS_WEAPON_SWORD = 7, - ITEM_SUBCLASS_WEAPON_SWORD2 = 8, - ITEM_SUBCLASS_WEAPON_obsolete = 9, + ITEM_SUBCLASS_WEAPON_SWORD = 7, // One-Handed Swords + ITEM_SUBCLASS_WEAPON_SWORD2 = 8, // Two-Handed Swords + ITEM_SUBCLASS_WEAPON_Obsolete = 9, ITEM_SUBCLASS_WEAPON_STAFF = 10, - ITEM_SUBCLASS_WEAPON_EXOTIC = 11, - ITEM_SUBCLASS_WEAPON_EXOTIC2 = 12, - ITEM_SUBCLASS_WEAPON_FIST = 13, - ITEM_SUBCLASS_WEAPON_MISC = 14, + ITEM_SUBCLASS_WEAPON_EXOTIC = 11, // One-Handed Exotics + ITEM_SUBCLASS_WEAPON_EXOTIC2 = 12, // Two-Handed Exotics + ITEM_SUBCLASS_WEAPON_FIST_WEAPON = 13, + ITEM_SUBCLASS_WEAPON_MISCELLANEOUS = 14, ITEM_SUBCLASS_WEAPON_DAGGER = 15, ITEM_SUBCLASS_WEAPON_THROWN = 16, ITEM_SUBCLASS_WEAPON_SPEAR = 17, @@ -361,27 +362,30 @@ enum ItemSubclassGem ITEM_SUBCLASS_GEM_ORANGE = 5, ITEM_SUBCLASS_GEM_META = 6, ITEM_SUBCLASS_GEM_SIMPLE = 7, - ITEM_SUBCLASS_GEM_PRISMATIC = 8 + ITEM_SUBCLASS_GEM_PRISMATIC = 8, + ITEM_SUBCLASS_GEM_HYDRAULIC = 9, + ITEM_SUBCLASS_GEM_COGWHEEL = 10 }; -#define MAX_ITEM_SUBCLASS_GEM 9 +#define MAX_ITEM_SUBCLASS_GEM 11 enum ItemSubclassArmor { - ITEM_SUBCLASS_ARMOR_MISC = 0, + ITEM_SUBCLASS_ARMOR_MISCELLANEOUS = 0, ITEM_SUBCLASS_ARMOR_CLOTH = 1, ITEM_SUBCLASS_ARMOR_LEATHER = 2, ITEM_SUBCLASS_ARMOR_MAIL = 3, ITEM_SUBCLASS_ARMOR_PLATE = 4, - ITEM_SUBCLASS_ARMOR_BUCKLER = 5, + ITEM_SUBCLASS_ARMOR_BUCKLER = 5, // OBSOLETE ITEM_SUBCLASS_ARMOR_SHIELD = 6, ITEM_SUBCLASS_ARMOR_LIBRAM = 7, ITEM_SUBCLASS_ARMOR_IDOL = 8, ITEM_SUBCLASS_ARMOR_TOTEM = 9, - ITEM_SUBCLASS_ARMOR_SIGIL = 10 + ITEM_SUBCLASS_ARMOR_SIGIL = 10, + ITEM_SUBCLASS_ARMOR_RELIC = 11, }; -#define MAX_ITEM_SUBCLASS_ARMOR 11 +#define MAX_ITEM_SUBCLASS_ARMOR 12 enum ItemSubclassReagent { @@ -392,11 +396,11 @@ enum ItemSubclassReagent enum ItemSubclassProjectile { - ITEM_SUBCLASS_WAND = 0, // ABS - ITEM_SUBCLASS_BOLT = 1, // ABS + ITEM_SUBCLASS_WAND = 0, // OBSOLETE + ITEM_SUBCLASS_BOLT = 1, // OBSOLETE ITEM_SUBCLASS_ARROW = 2, ITEM_SUBCLASS_BULLET = 3, - ITEM_SUBCLASS_THROWN = 4 // ABS + ITEM_SUBCLASS_THROWN = 4 // OBSOLETE }; #define MAX_ITEM_SUBCLASS_PROJECTILE 5 @@ -417,15 +421,15 @@ enum ItemSubclassTradeGoods ITEM_SUBCLASS_TRADE_GOODS_OTHER = 11, ITEM_SUBCLASS_ENCHANTING = 12, ITEM_SUBCLASS_MATERIAL = 13, - ITEM_SUBCLASS_ARMOR_ENCHANTMENT = 14, - ITEM_SUBCLASS_WEAPON_ENCHANTMENT = 15 + ITEM_SUBCLASS_ITEM_ENCHANTMENT = 14, + ITEM_SUBCLASS_WEAPON_ENCHANTMENT = 15 // OBSOLETE }; #define MAX_ITEM_SUBCLASS_TRADE_GOODS 16 enum ItemSubclassGeneric { - ITEM_SUBCLASS_GENERIC = 0 + ITEM_SUBCLASS_GENERIC = 0 // OBSOLETE }; #define MAX_ITEM_SUBCLASS_GENERIC 1 @@ -442,22 +446,23 @@ enum ItemSubclassRecipe ITEM_SUBCLASS_FIRST_AID_MANUAL = 7, ITEM_SUBCLASS_ENCHANTING_FORMULA = 8, ITEM_SUBCLASS_FISHING_MANUAL = 9, - ITEM_SUBCLASS_JEWELCRAFTING_RECIPE = 10 + ITEM_SUBCLASS_JEWELCRAFTING_RECIPE = 10, + ITEM_SUBCLASS_INSCRIPTION_TECHNIQUE = 11 }; -#define MAX_ITEM_SUBCLASS_RECIPE 11 +#define MAX_ITEM_SUBCLASS_RECIPE 12 enum ItemSubclassMoney { - ITEM_SUBCLASS_MONEY = 0 + ITEM_SUBCLASS_MONEY = 0 // OBSOLETE }; #define MAX_ITEM_SUBCLASS_MONEY 1 enum ItemSubclassQuiver { - ITEM_SUBCLASS_QUIVER0 = 0, // ABS - ITEM_SUBCLASS_QUIVER1 = 1, // ABS + ITEM_SUBCLASS_QUIVER0 = 0, // OBSOLETE + ITEM_SUBCLASS_QUIVER1 = 1, // OBSOLETE ITEM_SUBCLASS_QUIVER = 2, ITEM_SUBCLASS_AMMO_POUCH = 3 }; @@ -721,7 +726,7 @@ struct ItemTemplate bool IsPotion() const { return Class == ITEM_CLASS_CONSUMABLE && SubClass == ITEM_SUBCLASS_POTION; } bool IsWeaponVellum() const { return Class == ITEM_CLASS_TRADE_GOODS && SubClass == ITEM_SUBCLASS_WEAPON_ENCHANTMENT; } - bool IsArmorVellum() const { return Class == ITEM_CLASS_TRADE_GOODS && SubClass == ITEM_SUBCLASS_ARMOR_ENCHANTMENT; } + bool IsArmorVellum() const { return Class == ITEM_CLASS_TRADE_GOODS && SubClass == ITEM_SUBCLASS_ITEM_ENCHANTMENT; } bool IsConjuredConsumable() const { return Class == ITEM_CLASS_CONSUMABLE && (Flags & ITEM_PROTO_FLAG_CONJURED); } }; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index e93692715a0..979c62942f1 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -1127,7 +1127,7 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo) uint32 count = iProto->BuyCount; // special amount for food/drink - if (iProto->Class == ITEM_CLASS_CONSUMABLE && iProto->SubClass == ITEM_SUBCLASS_FOOD) + if (iProto->Class == ITEM_CLASS_CONSUMABLE && iProto->SubClass == ITEM_SUBCLASS_FOOD_DRINK) { switch (iProto->Spells[0].SpellCategory) { @@ -9922,7 +9922,7 @@ uint8 Player::FindEquipSlot(ItemTemplate const* proto, uint32 slot, bool swap) c if (playerClass == CLASS_SHAMAN) slots[0] = EQUIPMENT_SLOT_RANGED; break; - case ITEM_SUBCLASS_ARMOR_MISC: + case ITEM_SUBCLASS_ARMOR_MISCELLANEOUS: if (playerClass == CLASS_WARLOCK) slots[0] = EQUIPMENT_SLOT_RANGED; break; -- cgit v1.2.3 From 241b46026931cc7b17572ce588be32c104454f7e Mon Sep 17 00:00:00 2001 From: Subv2112 Date: Sun, 8 Jan 2012 13:28:48 +0000 Subject: Core/Protocol: Enable 3 more handlers Closes #4507 --- src/server/game/Server/Protocol/Opcodes.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 11edcdc77f7..63ffde54a10 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -342,7 +342,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_INSPECT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_INSPECT_RESULTS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_INITIATE_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInitiateTradeOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_BEGIN_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBeginTradeOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_BEGIN_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBeginTradeOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_BUSY_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBusyTradeOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleIgnoreTradeOpcode ); DEFINE_OPCODE_HANDLER(CMSG_ACCEPT_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAcceptTradeOpcode ); @@ -912,8 +912,8 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_ROSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamInviteOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamAcceptOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamDeclineOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamAcceptOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamDeclineOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamLeaveOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_REMOVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamRemoveOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_DISBAND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamDisbandOpcode ); -- cgit v1.2.3 From e8877e8d64a77ba8e1935b7b69d998f2a65112fc Mon Sep 17 00:00:00 2001 From: Rat Date: Sun, 8 Jan 2012 16:25:39 +0100 Subject: Core/Movement: updated 2 more movement structures --- src/server/game/Movement/MovementStructures.h | 142 +++++++++++++------------- 1 file changed, 71 insertions(+), 71 deletions(-) (limited to 'src') diff --git a/src/server/game/Movement/MovementStructures.h b/src/server/game/Movement/MovementStructures.h index 3992858ceac..5c60914f5b4 100644 --- a/src/server/game/Movement/MovementStructures.h +++ b/src/server/game/Movement/MovementStructures.h @@ -540,70 +540,70 @@ MovementStatusElements MovementStartBackwardSequence[] = { MSEGuidByte1_2, MSEGuidByte7_2, }; - +//4.2.2 MovementStatusElements MovementStartForwardSequence[] = { - MSEGuidByte0, - MSEHaveSpline, + MSEFlags, + MSEGuidByte1, + MSEGuidByte7, + MSEFlags2, + MSEGuidByte6, MSEGuidByte5, + MSEHaveSpline, + MSEGuidByte0, MSEGuidByte3, MSEGuidByte4, MSEGuidByte2, - MSEGuidByte7, - MSEFlags2, - MSEFlags, - MSEGuidByte6, - MSEGuidByte1, - MSEHavePitch, MSEHaveFallData, MSEHaveFallDirection, + MSEHaveSplineElev, MSEHaveTransportData, - MSETransportGuidByte6, - MSETransportGuidByte3, - MSETransportGuidByte7, - MSETransportGuidByte4, - MSETransportGuidByte1, MSETransportGuidByte0, + MSETransportGuidByte6, MSETransportGuidByte2, MSETransportGuidByte5, - MSETransportHaveTime3, + MSETransportGuidByte4, + MSETransportGuidByte1, + MSETransportGuidByte3, + MSETransportGuidByte7, MSETransportHaveTime2, - MSEHaveSplineElev, - MSETimestamp, + MSETransportHaveTime3, + MSEHavePitch, MSEPositionX, MSEPositionY, MSEPositionZ, + MSETimestamp, MSEPositionO, - MSEGuidByte7_2, - MSEPitch, - MSEGuidByte1_2, MSEGuidByte2_2, - MSEFallVerticalSpeed, + MSEGuidByte3_2, MSEFallTime, MSEFallHorizontalSpeed, - MSEFallCosAngle, MSEFallSinAngle, - MSEGuidByte3_2, - MSEGuidByte5_2, - MSEGuidByte0_2, + MSEFallCosAngle, + MSEFallVerticalSpeed, + MSESplineElev, MSEGuidByte6_2, - MSETransportTime, + MSEGuidByte0_2, + MSEGuidByte1_2, + MSEGuidByte7_2, + MSETransportSeat, + MSETransportPositionO, MSETransportPositionX, MSETransportPositionY, MSETransportPositionZ, - MSETransportPositionO, - MSETransportSeat, + MSETransportTime, + MSETransportTime2, MSETransportGuidByte3_2, - MSETransportGuidByte1_2, - MSETransportTime3, MSETransportGuidByte6_2, - MSETransportGuidByte0_2, - MSETransportGuidByte5_2, - MSETransportTime2, + MSETransportTime3, MSETransportGuidByte7_2, - MSETransportGuidByte4_2, + MSETransportGuidByte5_2, MSETransportGuidByte2_2, + MSETransportGuidByte1_2, + MSETransportGuidByte0_2, + MSETransportGuidByte4_2, + MSEGuidByte5_2, MSEGuidByte4_2, - MSESplineElev, + MSEPitch, }; MovementStatusElements MovementStartStrafeLeftSequence[] = { @@ -865,70 +865,70 @@ MovementStatusElements MovementStartTurnRightSequence[] = { MSETransportGuidByte4_2, MSETransportGuidByte2_2, }; - +//4.2.2 MovementStatusElements MovementStopSequence[] = { + MSEGuidByte2, + MSEGuidByte0, + MSEHaveSpline, + MSEFlags, MSEGuidByte4, + MSEGuidByte6, MSEGuidByte3, - MSEFlags, MSEGuidByte5, - MSEGuidByte6, - MSEGuidByte0, - MSEGuidByte1, - MSEGuidByte2, MSEGuidByte7, - MSEHaveSpline, MSEFlags2, + MSEGuidByte1, MSEHavePitch, - MSEHaveSplineElev, MSEHaveFallData, MSEHaveFallDirection, MSEHaveTransportData, - MSETransportGuidByte6, - MSETransportGuidByte3, - MSETransportGuidByte7, - MSETransportGuidByte4, - MSETransportGuidByte1, MSETransportGuidByte0, + MSETransportGuidByte6, MSETransportGuidByte2, MSETransportGuidByte5, - MSETransportHaveTime3, + MSETransportGuidByte4, + MSETransportGuidByte1, + MSETransportGuidByte3, + MSETransportGuidByte7, MSETransportHaveTime2, + MSETransportHaveTime3, + MSEHaveSplineElev, + MSEPositionO, MSETimestamp, MSEPositionX, MSEPositionY, MSEPositionZ, - MSEPositionO, - MSEGuidByte6_2, - MSEGuidByte5_2, - MSEGuidByte1_2, + MSEGuidByte2_2, MSEGuidByte3_2, MSEPitch, - MSEGuidByte2_2, - MSESplineElev, - MSEGuidByte4_2, - MSEGuidByte0_2, - MSEGuidByte7_2, - MSEFallVerticalSpeed, MSEFallTime, MSEFallHorizontalSpeed, - MSEFallCosAngle, MSEFallSinAngle, - MSETransportTime, + MSEFallCosAngle, + MSEFallVerticalSpeed, + MSEGuidByte5_2, + MSEGuidByte7_2, + MSETransportSeat, + MSETransportPositionO, MSETransportPositionX, MSETransportPositionY, MSETransportPositionZ, - MSETransportPositionO, - MSETransportSeat, + MSETransportTime, + MSETransportTime2, MSETransportGuidByte3_2, - MSETransportGuidByte1_2, - MSETransportTime3, MSETransportGuidByte6_2, - MSETransportGuidByte0_2, - MSETransportGuidByte5_2, - MSETransportTime2, + MSETransportTime3, MSETransportGuidByte7_2, - MSETransportGuidByte4_2, + MSETransportGuidByte5_2, MSETransportGuidByte2_2, + MSETransportGuidByte1_2, + MSETransportGuidByte0_2, + MSETransportGuidByte4_2, + MSEGuidByte1_2, + MSEGuidByte0_2, + MSESplineElev, + MSEGuidByte6_2, + MSEGuidByte4_2, }; MovementStatusElements MovementStopStrafeSequence[] = { @@ -1339,7 +1339,7 @@ MovementStatusElements* GetMovementStatusElementsSequence(Opcodes opcode) return MovementSetPitchSequence; case MSG_MOVE_START_BACKWARD: return MovementStartBackwardSequence; - case MSG_MOVE_START_FORWARD: + case MSG_MOVE_START_FORWARD://done return MovementStartForwardSequence; case MSG_MOVE_START_STRAFE_LEFT: return MovementStartStrafeLeftSequence; @@ -1349,7 +1349,7 @@ MovementStatusElements* GetMovementStatusElementsSequence(Opcodes opcode) return MovementStartTurnLeftSequence; case MSG_MOVE_START_TURN_RIGHT: return MovementStartTurnRightSequence; - case MSG_MOVE_STOP: + case MSG_MOVE_STOP://done return MovementStopSequence; case MSG_MOVE_STOP_STRAFE: return MovementStopStrafeSequence; -- cgit v1.2.3 From a34a421e99e8feb214ea0121b60d3982499cf10f Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 8 Jan 2012 16:45:49 +0100 Subject: Core/Movement: 4.2.2 structure for MSG_MOVE_JUMP --- src/server/game/Movement/MovementStructures.h | 80 +++++++++++++-------------- 1 file changed, 40 insertions(+), 40 deletions(-) (limited to 'src') diff --git a/src/server/game/Movement/MovementStructures.h b/src/server/game/Movement/MovementStructures.h index 5c60914f5b4..2ef756b22d1 100644 --- a/src/server/game/Movement/MovementStructures.h +++ b/src/server/game/Movement/MovementStructures.h @@ -274,76 +274,76 @@ MovementStatusElements MovementHeartBeatSequence[] = { MSEPitch, MSEFallTime, MSEFallVerticalSpeed, + MSEFallHorizontalSpeed, MSEFallSinAngle, MSEFallCosAngle, - MSEFallHorizontalSpeed, MSEGuidByte2_2, MSEGuidByte0_2, }; - +//4.2.2 MovementStatusElements MovementJumpSequence[] = { - MSEGuidByte5, + MSEHaveSpline, + MSEGuidByte0, MSEGuidByte1, - MSEGuidByte6, + MSEGuidByte4, MSEFlags, MSEGuidByte2, - MSEHaveSpline, + MSEGuidByte5, MSEGuidByte3, MSEFlags2, - MSEGuidByte4, - MSEGuidByte0, MSEGuidByte7, - MSEHaveFallData, - MSEHaveFallDirection, + MSEGuidByte6, + MSEHaveSplineElev, MSEHaveTransportData, - MSETransportGuidByte6, - MSETransportGuidByte3, - MSETransportGuidByte7, - MSETransportGuidByte4, - MSETransportGuidByte1, MSETransportGuidByte0, + MSETransportGuidByte6, MSETransportGuidByte2, MSETransportGuidByte5, - MSETransportHaveTime3, + MSETransportGuidByte4, + MSETransportGuidByte1, + MSETransportGuidByte3, + MSETransportGuidByte7, MSETransportHaveTime2, - MSEHaveSplineElev, + MSETransportHaveTime3, + MSEHaveFallData, + MSEHaveFallDirection, MSEHavePitch, MSEPositionO, + MSETimestamp, MSEPositionX, MSEPositionY, MSEPositionZ, - MSETimestamp, - MSEGuidByte1_2, - MSEFallVerticalSpeed, - MSEFallTime, - MSEFallHorizontalSpeed, - MSEFallCosAngle, - MSEFallSinAngle, - MSETransportTime, + MSESplineElev, + MSEGuidByte0_2, + MSEGuidByte5_2, + MSEGuidByte3_2, + MSETransportSeat, + MSETransportPositionO, MSETransportPositionX, MSETransportPositionY, MSETransportPositionZ, - MSETransportPositionO, - MSETransportSeat, + MSETransportTime, + MSETransportTime2, MSETransportGuidByte3_2, - MSETransportGuidByte1_2, - MSETransportTime3, MSETransportGuidByte6_2, - MSETransportGuidByte0_2, - MSETransportGuidByte5_2, - MSETransportTime2, + MSETransportTime3, MSETransportGuidByte7_2, - MSETransportGuidByte4_2, + MSETransportGuidByte5_2, MSETransportGuidByte2_2, - MSEGuidByte6_2, + MSETransportGuidByte1_2, + MSETransportGuidByte0_2, + MSETransportGuidByte4_2, MSEGuidByte4_2, - MSESplineElev, - MSEGuidByte0_2, - MSEPitch, - MSEGuidByte5_2, - MSEGuidByte3_2, - MSEGuidByte7_2, + MSEGuidByte1_2, + MSEFallTime, + MSEFallVerticalSpeed, + MSEFallHorizontalSpeed, + MSEFallSinAngle, + MSEFallCosAngle, MSEGuidByte2_2, + MSEGuidByte6_2, + MSEGuidByte7_2, + MSEPitch, }; //4.2.2 MovementStatusElements MovementSetFacingSequence[] = { @@ -1331,7 +1331,7 @@ MovementStatusElements* GetMovementStatusElementsSequence(Opcodes opcode) return MovementFallLandSequence; case MSG_MOVE_HEARTBEAT://done return MovementHeartBeatSequence; - case MSG_MOVE_JUMP: + case MSG_MOVE_JUMP://done return MovementJumpSequence; case MSG_MOVE_SET_FACING://done return MovementSetFacingSequence; -- cgit v1.2.3 From ab5e1d56675d345030995180fa4131fe8571a295 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 8 Jan 2012 17:19:26 +0100 Subject: Core/Movement: 4.2.2 structure for MSG_MOVE_SET_PITCH --- src/server/game/Movement/MovementStructures.h | 80 +++++++++++++-------------- 1 file changed, 40 insertions(+), 40 deletions(-) (limited to 'src') diff --git a/src/server/game/Movement/MovementStructures.h b/src/server/game/Movement/MovementStructures.h index 2ef756b22d1..6c81cc8e675 100644 --- a/src/server/game/Movement/MovementStructures.h +++ b/src/server/game/Movement/MovementStructures.h @@ -412,68 +412,68 @@ MovementStatusElements MovementSetFacingSequence[] = { }; MovementStatusElements MovementSetPitchSequence[] = { - MSEGuidByte4, - MSEGuidByte6, - MSEGuidByte2, - MSEFlags2, MSEGuidByte1, + MSEGuidByte6, MSEGuidByte7, - MSEGuidByte5, MSEGuidByte3, - MSEHaveSpline, - MSEGuidByte0, MSEFlags, - MSEHaveFallData, - MSEHaveFallDirection, + MSEGuidByte5, + MSEGuidByte2, + MSEGuidByte0, + MSEHaveSpline, + MSEGuidByte4, + MSEFlags2, + MSEHaveSplineElev, MSEHaveTransportData, - MSETransportGuidByte6, - MSETransportGuidByte3, - MSETransportGuidByte7, - MSETransportGuidByte4, - MSETransportGuidByte1, MSETransportGuidByte0, + MSETransportGuidByte6, MSETransportGuidByte2, MSETransportGuidByte5, - MSETransportHaveTime3, + MSETransportGuidByte4, + MSETransportGuidByte1, + MSETransportGuidByte3, + MSETransportGuidByte7, MSETransportHaveTime2, - MSEHaveSplineElev, + MSETransportHaveTime3, MSEHavePitch, - MSEPositionO, - MSETimestamp, + MSEHaveFallData, + MSEHaveFallDirection, MSEPositionX, MSEPositionY, MSEPositionZ, - MSEGuidByte2_2, - MSEGuidByte6_2, - MSEGuidByte5_2, - MSEFallVerticalSpeed, - MSEFallTime, - MSEFallHorizontalSpeed, - MSEFallCosAngle, - MSEFallSinAngle, - MSEGuidByte3_2, - MSETransportTime, + MSETimestamp, + MSEPositionO, + MSEGuidByte1_2, + MSEGuidByte4_2, + MSESplineElev, + MSETransportSeat, + MSETransportPositionO, MSETransportPositionX, MSETransportPositionY, MSETransportPositionZ, - MSETransportPositionO, - MSETransportSeat, + MSETransportTime, + MSETransportTime2, MSETransportGuidByte3_2, - MSETransportGuidByte1_2, - MSETransportTime3, MSETransportGuidByte6_2, - MSETransportGuidByte0_2, - MSETransportGuidByte5_2, - MSETransportTime2, + MSETransportTime3, MSETransportGuidByte7_2, - MSETransportGuidByte4_2, + MSETransportGuidByte5_2, MSETransportGuidByte2_2, + MSETransportGuidByte1_2, + MSETransportGuidByte0_2, + MSETransportGuidByte4_2, + MSEPitch, + MSEGuidByte5_2, + MSEFallTime, + MSEFallVerticalSpeed, + MSEFallHorizontalSpeed, + MSEFallSinAngle, + MSEFallCosAngle, MSEGuidByte0_2, - MSEGuidByte1_2, - MSESplineElev, + MSEGuidByte3_2, + MSEGuidByte6_2, MSEGuidByte7_2, - MSEGuidByte4_2, - MSEPitch, + MSEGuidByte2_2, }; MovementStatusElements MovementStartBackwardSequence[] = { -- cgit v1.2.3 From 7db8fbd874e1e06f22afff5590b345cd2f27dac9 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 8 Jan 2012 17:26:45 +0100 Subject: Core/Movement: 4.2.2 structure for MSG_MOVE_START_BACKWARD --- src/server/game/Movement/MovementStructures.h | 84 +++++++++++++-------------- 1 file changed, 42 insertions(+), 42 deletions(-) (limited to 'src') diff --git a/src/server/game/Movement/MovementStructures.h b/src/server/game/Movement/MovementStructures.h index 6c81cc8e675..45406cb732d 100644 --- a/src/server/game/Movement/MovementStructures.h +++ b/src/server/game/Movement/MovementStructures.h @@ -410,7 +410,7 @@ MovementStatusElements MovementSetFacingSequence[] = { MSETransportGuidByte4_2, MSEGuidByte3_2, }; - +//4.2.2 MovementStatusElements MovementSetPitchSequence[] = { MSEGuidByte1, MSEGuidByte6, @@ -475,70 +475,70 @@ MovementStatusElements MovementSetPitchSequence[] = { MSEGuidByte7_2, MSEGuidByte2_2, }; - +//4.2.2 MovementStatusElements MovementStartBackwardSequence[] = { - MSEGuidByte4, - MSEGuidByte1, MSEGuidByte5, MSEFlags2, - MSEGuidByte3, - MSEGuidByte6, - MSEGuidByte0, MSEGuidByte2, MSEGuidByte7, - MSEFlags, MSEHaveSpline, - MSEHaveFallData, - MSEHaveFallDirection, + MSEFlags, + MSEGuidByte1, + MSEGuidByte3, + MSEGuidByte4, + MSEGuidByte6, + MSEGuidByte0, + MSEHaveSplineElev, + MSEHavePitch, MSEHaveTransportData, - MSETransportGuidByte6, - MSETransportGuidByte3, - MSETransportGuidByte7, - MSETransportGuidByte4, - MSETransportGuidByte1, MSETransportGuidByte0, + MSETransportGuidByte6, MSETransportGuidByte2, MSETransportGuidByte5, - MSETransportHaveTime3, + MSETransportGuidByte4, + MSETransportGuidByte1, + MSETransportGuidByte3, + MSETransportGuidByte7, MSETransportHaveTime2, - MSEHavePitch, - MSEHaveSplineElev, + MSETransportHaveTime3, + MSEHaveFallData, + MSEHaveFallDirection, + MSEPositionO, MSEPositionX, MSEPositionY, MSEPositionZ, MSETimestamp, - MSEPositionO, + MSEGuidByte3_2, MSEGuidByte0_2, - MSEGuidByte5_2, - MSEFallVerticalSpeed, - MSEFallTime, - MSEFallHorizontalSpeed, - MSEFallCosAngle, - MSEFallSinAngle, + MSEGuidByte1_2, + MSESplineElev, MSEGuidByte4_2, + MSEPitch, + MSEGuidByte7_2, MSEGuidByte2_2, - MSETransportTime, + MSEGuidByte6_2, + MSETransportSeat, + MSETransportPositionO, MSETransportPositionX, MSETransportPositionY, MSETransportPositionZ, - MSETransportPositionO, - MSETransportSeat, + MSETransportTime, + MSETransportTime2, MSETransportGuidByte3_2, - MSETransportGuidByte1_2, - MSETransportTime3, MSETransportGuidByte6_2, - MSETransportGuidByte0_2, - MSETransportGuidByte5_2, - MSETransportTime2, + MSETransportTime3, MSETransportGuidByte7_2, - MSETransportGuidByte4_2, + MSETransportGuidByte5_2, MSETransportGuidByte2_2, - MSEGuidByte6_2, - MSEPitch, - MSEGuidByte3_2, - MSESplineElev, - MSEGuidByte1_2, - MSEGuidByte7_2, + MSETransportGuidByte1_2, + MSETransportGuidByte0_2, + MSETransportGuidByte4_2, + MSEGuidByte5_2, + MSEFallTime, + MSEFallVerticalSpeed, + MSEFallHorizontalSpeed, + MSEFallSinAngle, + MSEFallCosAngle, }; //4.2.2 MovementStatusElements MovementStartForwardSequence[] = { @@ -1335,9 +1335,9 @@ MovementStatusElements* GetMovementStatusElementsSequence(Opcodes opcode) return MovementJumpSequence; case MSG_MOVE_SET_FACING://done return MovementSetFacingSequence; - case MSG_MOVE_SET_PITCH: + case MSG_MOVE_SET_PITCH://done return MovementSetPitchSequence; - case MSG_MOVE_START_BACKWARD: + case MSG_MOVE_START_BACKWARD://done return MovementStartBackwardSequence; case MSG_MOVE_START_FORWARD://done return MovementStartForwardSequence; -- cgit v1.2.3 From e8c5218e00cc753085f1b522d169b24c4b262bcf Mon Sep 17 00:00:00 2001 From: Rat Date: Mon, 9 Jan 2012 18:17:09 +0100 Subject: Core/Movement: updated 2 more movement structures --- src/server/game/Movement/MovementStructures.h | 166 +++++++++++++------------- 1 file changed, 83 insertions(+), 83 deletions(-) (limited to 'src') diff --git a/src/server/game/Movement/MovementStructures.h b/src/server/game/Movement/MovementStructures.h index 45406cb732d..9abd8c616db 100644 --- a/src/server/game/Movement/MovementStructures.h +++ b/src/server/game/Movement/MovementStructures.h @@ -605,70 +605,70 @@ MovementStatusElements MovementStartForwardSequence[] = { MSEGuidByte4_2, MSEPitch, }; - +//4.2.2 MovementStatusElements MovementStartStrafeLeftSequence[] = { MSEGuidByte5, - MSEGuidByte0, - MSEGuidByte3, MSEFlags, + MSEHaveSpline, MSEGuidByte6, MSEGuidByte1, - MSEGuidByte4, + MSEGuidByte2, MSEFlags2, - MSEHaveSpline, MSEGuidByte7, - MSEGuidByte2, + MSEGuidByte0, + MSEGuidByte3, + MSEGuidByte4, + MSEHavePitch, + MSEHaveSplineElev, + MSEHaveFallData, + MSEHaveFallDirection, MSEHaveTransportData, - MSETransportGuidByte6, - MSETransportGuidByte3, - MSETransportGuidByte7, - MSETransportGuidByte4, - MSETransportGuidByte1, MSETransportGuidByte0, + MSETransportGuidByte6, MSETransportGuidByte2, MSETransportGuidByte5, - MSETransportHaveTime3, + MSETransportGuidByte4, + MSETransportGuidByte1, + MSETransportGuidByte3, + MSETransportGuidByte7, MSETransportHaveTime2, - MSEHaveSplineElev, - MSEHaveFallData, - MSEHaveFallDirection, - MSEHavePitch, - MSEPositionO, - MSETimestamp, + MSETransportHaveTime3, MSEPositionX, MSEPositionY, MSEPositionZ, + MSEPositionO, + MSETimestamp, + MSEPitch, + MSESplineElev, + MSEGuidByte7_2, + MSEGuidByte5_2, + MSEFallTime, + MSEFallVerticalSpeed, + MSEFallHorizontalSpeed, + MSEFallSinAngle, + MSEFallCosAngle, + MSEGuidByte4_2, MSEGuidByte3_2, - MSETransportTime, + MSEGuidByte2_2, + MSEGuidByte6_2, + MSEGuidByte0_2, + MSEGuidByte1_2, + MSETransportSeat, + MSETransportPositionO, MSETransportPositionX, MSETransportPositionY, MSETransportPositionZ, - MSETransportPositionO, - MSETransportSeat, + MSETransportTime, + MSETransportTime2, MSETransportGuidByte3_2, - MSETransportGuidByte1_2, - MSETransportTime3, MSETransportGuidByte6_2, - MSETransportGuidByte0_2, - MSETransportGuidByte5_2, - MSETransportTime2, + MSETransportTime3, MSETransportGuidByte7_2, - MSETransportGuidByte4_2, + MSETransportGuidByte5_2, MSETransportGuidByte2_2, - MSEGuidByte5_2, - MSEGuidByte1_2, - MSEGuidByte4_2, - MSEGuidByte2_2, - MSEGuidByte0_2, - MSESplineElev, - MSEGuidByte6_2, - MSEFallVerticalSpeed, - MSEFallTime, - MSEFallHorizontalSpeed, - MSEFallCosAngle, - MSEFallSinAngle, - MSEGuidByte7_2, - MSEPitch, + MSETransportGuidByte1_2, + MSETransportGuidByte0_2, + MSETransportGuidByte4_2, }; MovementStatusElements MovementStartStrafeRightSequence[] = { @@ -930,70 +930,70 @@ MovementStatusElements MovementStopSequence[] = { MSEGuidByte6_2, MSEGuidByte4_2, }; - +//4.2.2 MovementStatusElements MovementStopStrafeSequence[] = { - MSEGuidByte3, - MSEFlags, - MSEHaveSpline, MSEGuidByte4, - MSEGuidByte0, MSEFlags2, + MSEGuidByte3, + MSEGuidByte1, + MSEFlags, MSEGuidByte5, + MSEHaveSpline, + MSEGuidByte2, MSEGuidByte6, + MSEGuidByte0, MSEGuidByte7, - MSEGuidByte1, - MSEGuidByte2, + MSEHaveFallData, + MSEHaveFallDirection, + MSEHavePitch, + MSEHaveSplineElev, MSEHaveTransportData, - MSETransportGuidByte6, - MSETransportGuidByte3, - MSETransportGuidByte7, - MSETransportGuidByte4, - MSETransportGuidByte1, MSETransportGuidByte0, + MSETransportGuidByte6, MSETransportGuidByte2, MSETransportGuidByte5, - MSETransportHaveTime3, + MSETransportGuidByte4, + MSETransportGuidByte1, + MSETransportGuidByte3, + MSETransportGuidByte7, MSETransportHaveTime2, - MSEHaveSplineElev, - MSEHavePitch, - MSEHaveFallData, - MSEHaveFallDirection, + MSETransportHaveTime3, + MSEPositionO, + MSETimestamp, MSEPositionX, MSEPositionY, MSEPositionZ, - MSEPositionO, - MSETimestamp, + MSEGuidByte1_2, MSEGuidByte2_2, - MSEGuidByte7_2, + MSEGuidByte6_2, MSEGuidByte5_2, - MSETransportTime, + MSEGuidByte7_2, + MSEGuidByte0_2, + MSEFallTime, + MSEFallVerticalSpeed, + MSEFallHorizontalSpeed, + MSEFallSinAngle, + MSEFallCosAngle, + MSEGuidByte3_2, + MSEPitch, + MSESplineElev, + MSETransportSeat, + MSETransportPositionO, MSETransportPositionX, MSETransportPositionY, MSETransportPositionZ, - MSETransportPositionO, - MSETransportSeat, + MSETransportTime, + MSETransportTime2, MSETransportGuidByte3_2, - MSETransportGuidByte1_2, - MSETransportTime3, MSETransportGuidByte6_2, - MSETransportGuidByte0_2, - MSETransportGuidByte5_2, - MSETransportTime2, + MSETransportTime3, MSETransportGuidByte7_2, - MSETransportGuidByte4_2, + MSETransportGuidByte5_2, MSETransportGuidByte2_2, - MSEGuidByte0_2, - MSESplineElev, - MSEPitch, - MSEFallVerticalSpeed, - MSEFallTime, - MSEFallHorizontalSpeed, - MSEFallCosAngle, - MSEFallSinAngle, - MSEGuidByte1_2, - MSEGuidByte3_2, + MSETransportGuidByte1_2, + MSETransportGuidByte0_2, + MSETransportGuidByte4_2, MSEGuidByte4_2, - MSEGuidByte6_2, }; MovementStatusElements MovementStopTurnSequence[] = { @@ -1341,7 +1341,7 @@ MovementStatusElements* GetMovementStatusElementsSequence(Opcodes opcode) return MovementStartBackwardSequence; case MSG_MOVE_START_FORWARD://done return MovementStartForwardSequence; - case MSG_MOVE_START_STRAFE_LEFT: + case MSG_MOVE_START_STRAFE_LEFT://done return MovementStartStrafeLeftSequence; case MSG_MOVE_START_STRAFE_RIGHT: return MovementStartStrafeRightSequence; @@ -1351,7 +1351,7 @@ MovementStatusElements* GetMovementStatusElementsSequence(Opcodes opcode) return MovementStartTurnRightSequence; case MSG_MOVE_STOP://done return MovementStopSequence; - case MSG_MOVE_STOP_STRAFE: + case MSG_MOVE_STOP_STRAFE://done return MovementStopStrafeSequence; case MSG_MOVE_STOP_TURN: return MovementStopTurnSequence; -- cgit v1.2.3 From c84de34ab674f5c67bf7843a33e9ee63b5c0b124 Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 9 Jan 2012 19:44:46 +0100 Subject: Core/Movement: Minor corrections to SMSG_PLAYER_MOVE --- src/server/game/Movement/MovementStructures.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Movement/MovementStructures.h b/src/server/game/Movement/MovementStructures.h index 9abd8c616db..49ab6369fc7 100644 --- a/src/server/game/Movement/MovementStructures.h +++ b/src/server/game/Movement/MovementStructures.h @@ -90,11 +90,11 @@ MovementStatusElements PlayerMoveSequence[] = { MSEHaveSplineElev, MSEHaveTransportData, MSEGuidByte5, - MSETransportGuidByte0, MSETransportGuidByte2, MSETransportGuidByte4, MSETransportGuidByte1, MSETransportGuidByte3, + MSETransportGuidByte0, MSETransportHaveTime2, MSETransportGuidByte7, MSETransportHaveTime3, @@ -144,10 +144,10 @@ MovementStatusElements PlayerMoveSequence[] = { MSEPositionZ, MSEGuidByte5_2, MSEGuidByte3_2, + MSEFallHorizontalSpeed, MSEFallSinAngle, MSEFallCosAngle, MSEFallVerticalSpeed, - MSEFallHorizontalSpeed, MSEFallTime, }; //4.2.2 -- cgit v1.2.3 From d4169a533328dbb2aa97fb697503c7c14c4d97bf Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Tue, 10 Jan 2012 15:15:49 +0800 Subject: P11: Fixed CMSG_LOOT_MONEY opcode and handler. Signed-off-by: Gyx <2359980687@qq.com> --- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- src/server/game/Server/Protocol/Opcodes.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 63ffde54a10..f32d086e07f 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -413,7 +413,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_RESURRECT_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_RESURRECT_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleResurrectResponseOpcode ); DEFINE_OPCODE_HANDLER(CMSG_LOOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_LOOT_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMoneyOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_LOOT_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMoneyOpcode ); DEFINE_OPCODE_HANDLER(CMSG_LOOT_RELEASE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootReleaseOpcode ); DEFINE_OPCODE_HANDLER(SMSG_LOOT_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LOOT_RELEASE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index f337945a1be..f0a1f180e4b 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -264,7 +264,7 @@ enum Opcodes CMSG_LOGOUT_REQUEST = 0x4C7A, CMSG_LOOT = 0x1E62, CMSG_LOOT_METHOD = 0x00, - CMSG_LOOT_MONEY = 0x00, + CMSG_LOOT_MONEY = 0x4A42, CMSG_LOOT_RELEASE = 0x4A6A, CMSG_LOOT_ROLL = 0x00, CMSG_MAIL_CREATE_TEXT_ITEM = 0x886E, -- cgit v1.2.3 From a43e4bb7738bf369c79dee6328f0a400efc936d2 Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Tue, 10 Jan 2012 16:55:02 +0800 Subject: P12: Fixed CMSG_BATTLEFIELD_JOIN opcode. Signed-off-by: Gyx <2359980687@qq.com> --- src/server/game/Server/Protocol/Opcodes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index f0a1f180e4b..a531fd3bf61 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -72,7 +72,7 @@ enum Opcodes CMSG_AUTOSTORE_GROUND_ITEM = 0x00, CMSG_AUTOSTORE_LOOT_ITEM = 0xD876, CMSG_BANKER_ACTIVATE = 0x00, - CMSG_BATTLEFIELD_JOIN = 0x00, + CMSG_BATTLEFIELD_JOIN = 0x225, CMSG_BATTLEFIELD_REQUEST_SCORE_DATA = 0x00, CMSG_BATTLEFIELD_STATUS = 0x00, MSG_BATTLEGROUND_PLAYER_POSITIONS = 0x00, -- cgit v1.2.3 From 07d27cbbf75b035c3a414ff6b9c3288ab3fb41b8 Mon Sep 17 00:00:00 2001 From: Rat Date: Tue, 10 Jan 2012 10:22:49 +0100 Subject: Core/ByteBuffer: fixed bitreader, this fixes the "strange movement" bug --- src/server/shared/Packets/ByteBuffer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h index 16f06563630..2d5dbc0d3aa 100755 --- a/src/server/shared/Packets/ByteBuffer.h +++ b/src/server/shared/Packets/ByteBuffer.h @@ -170,7 +170,7 @@ class ByteBuffer uint32 value = 0; for (int32 i = bits-1; i >= 0; --i) if (ReadBit()) - value |= (1 << (_bitpos)); + value |= (1 << (i)); return value; } -- cgit v1.2.3 From 26a1806b7d6f08f9585f105ac3fb89ebc14a98cc Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Tue, 10 Jan 2012 17:26:13 +0800 Subject: P13: Fixed CMSG_MESSAGECHAT_AFK & CMSG_MESSAGECHAT_DND opcodes and hadler. Signed-off-by: Gyx <2359980687@qq.com> --- src/server/game/Server/Protocol/Handlers/ChatHandler.cpp | 12 ++++++------ src/server/game/Server/Protocol/Opcodes.cpp | 4 ++-- src/server/game/Server/Protocol/Opcodes.h | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp b/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp index add0c7fffaf..effc28c1063 100755 --- a/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp @@ -88,12 +88,12 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) //case CMSG_MESSAGECHAT_OFFICER: // type = CHAT_MSG_OFFICER; // break; - //case CMSG_MESSAGECHAT_AFK: - // type = CHAT_MSG_AFK; - // break; - //case CMSG_MESSAGECHAT_DND: - // type = CHAT_MSG_DND; - // break; + case CMSG_MESSAGECHAT_AFK: + type = CHAT_MSG_AFK; + break; + case CMSG_MESSAGECHAT_DND: + type = CHAT_MSG_DND; + break; case CMSG_MESSAGECHAT_EMOTE: type = CHAT_MSG_EMOTE; break; diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index f32d086e07f..d05b45ab718 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -197,11 +197,11 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_PARTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_RAID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_WHISPER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_AFK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_AFK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_BATTLEGROUND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_BATTLEGROUND_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_DND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_DND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_GUILD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_OFFICER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index a531fd3bf61..68a779201b7 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -274,7 +274,7 @@ enum Opcodes CMSG_MAIL_TAKE_ITEM = 0xCC2, CMSG_MAIL_TAKE_MONEY = 0x4CD6, CMSG_MEETINGSTONE_INFO = 0xCA5B, - CMSG_MESSAGECHAT_AFK = 0x00, + CMSG_MESSAGECHAT_AFK = 0x30C1, CMSG_MESSAGECHAT_BATTLEGROUND = 0x00, CMSG_MESSAGECHAT_BATTLEGROUND_LEADER = 0x00, CMSG_MESSAGECHAT_ADDON_BATTLEGROUND = 0x6059, // New on 4.x @@ -283,7 +283,7 @@ enum Opcodes CMSG_MESSAGECHAT_ADDON_RAID = 0x3041, // New on 4.x CMSG_MESSAGECHAT_ADDON_WHISPER = 0x20C1, // New on 4.x CMSG_MESSAGECHAT_CHANNEL = 0x7459, - CMSG_MESSAGECHAT_DND = 0x00, + CMSG_MESSAGECHAT_DND = 0x30C9, CMSG_MESSAGECHAT_EMOTE = 0x6449, CMSG_MESSAGECHAT_GUILD = 0x60C1, CMSG_MESSAGECHAT_OFFICER = 0x00, -- cgit v1.2.3 From 8d19dc343e3a9acbd160b84555fbb40215be9b3a Mon Sep 17 00:00:00 2001 From: Rat Date: Tue, 10 Jan 2012 14:50:25 +0100 Subject: Core/Movement: updated movement structures again ... --- src/server/game/Movement/MovementStructures.h | 624 +++++++++++++------------- 1 file changed, 312 insertions(+), 312 deletions(-) (limited to 'src') diff --git a/src/server/game/Movement/MovementStructures.h b/src/server/game/Movement/MovementStructures.h index 49ab6369fc7..9f8a5108e46 100644 --- a/src/server/game/Movement/MovementStructures.h +++ b/src/server/game/Movement/MovementStructures.h @@ -145,8 +145,8 @@ MovementStatusElements PlayerMoveSequence[] = { MSEGuidByte5_2, MSEGuidByte3_2, MSEFallHorizontalSpeed, - MSEFallSinAngle, MSEFallCosAngle, + MSEFallSinAngle, MSEFallVerticalSpeed, MSEFallTime, }; @@ -188,8 +188,8 @@ MovementStatusElements MovementFallLandSequence[] = { MSEFallTime, MSEFallVerticalSpeed, MSEFallHorizontalSpeed, - MSEFallSinAngle, MSEFallCosAngle, + MSEFallSinAngle, MSEGuidByte0_2, MSEPitch, MSEGuidByte4_2, @@ -275,8 +275,8 @@ MovementStatusElements MovementHeartBeatSequence[] = { MSEFallTime, MSEFallVerticalSpeed, MSEFallHorizontalSpeed, - MSEFallSinAngle, MSEFallCosAngle, + MSEFallSinAngle, MSEGuidByte2_2, MSEGuidByte0_2, }; @@ -338,8 +338,8 @@ MovementStatusElements MovementJumpSequence[] = { MSEFallTime, MSEFallVerticalSpeed, MSEFallHorizontalSpeed, - MSEFallSinAngle, MSEFallCosAngle, + MSEFallSinAngle, MSEGuidByte2_2, MSEGuidByte6_2, MSEGuidByte7_2, @@ -387,9 +387,9 @@ MovementStatusElements MovementSetFacingSequence[] = { MSEPitch, MSEFallTime, MSEFallVerticalSpeed, - MSEFallSinAngle, - MSEFallCosAngle, MSEFallHorizontalSpeed, + MSEFallCosAngle, + MSEFallSinAngle, MSEGuidByte6_2, MSEGuidByte0_2, MSETransportSeat, @@ -467,8 +467,8 @@ MovementStatusElements MovementSetPitchSequence[] = { MSEFallTime, MSEFallVerticalSpeed, MSEFallHorizontalSpeed, - MSEFallSinAngle, MSEFallCosAngle, + MSEFallSinAngle, MSEGuidByte0_2, MSEGuidByte3_2, MSEGuidByte6_2, @@ -537,8 +537,8 @@ MovementStatusElements MovementStartBackwardSequence[] = { MSEFallTime, MSEFallVerticalSpeed, MSEFallHorizontalSpeed, - MSEFallSinAngle, MSEFallCosAngle, + MSEFallSinAngle, }; //4.2.2 MovementStatusElements MovementStartForwardSequence[] = { @@ -576,10 +576,10 @@ MovementStatusElements MovementStartForwardSequence[] = { MSEGuidByte2_2, MSEGuidByte3_2, MSEFallTime, + MSEFallVerticalSpeed, MSEFallHorizontalSpeed, - MSEFallSinAngle, MSEFallCosAngle, - MSEFallVerticalSpeed, + MSEFallSinAngle, MSESplineElev, MSEGuidByte6_2, MSEGuidByte0_2, @@ -645,8 +645,8 @@ MovementStatusElements MovementStartStrafeLeftSequence[] = { MSEFallTime, MSEFallVerticalSpeed, MSEFallHorizontalSpeed, - MSEFallSinAngle, MSEFallCosAngle, + MSEFallSinAngle, MSEGuidByte4_2, MSEGuidByte3_2, MSEGuidByte2_2, @@ -670,200 +670,200 @@ MovementStatusElements MovementStartStrafeLeftSequence[] = { MSETransportGuidByte0_2, MSETransportGuidByte4_2, }; - +//4.2.2 MovementStatusElements MovementStartStrafeRightSequence[] = { - MSEGuidByte2, - MSEFlags, MSEGuidByte3, - MSEFlags2, + MSEGuidByte2, + MSEGuidByte4, + MSEGuidByte5, MSEGuidByte0, MSEGuidByte6, MSEHaveSpline, + MSEFlags2, MSEGuidByte1, - MSEGuidByte4, - MSEGuidByte5, + MSEFlags, MSEGuidByte7, MSEHaveSplineElev, MSEHavePitch, MSEHaveTransportData, - MSETransportGuidByte6, - MSETransportGuidByte3, - MSETransportGuidByte7, - MSETransportGuidByte4, - MSETransportGuidByte1, MSETransportGuidByte0, + MSETransportGuidByte6, MSETransportGuidByte2, MSETransportGuidByte5, - MSETransportHaveTime3, + MSETransportGuidByte4, + MSETransportGuidByte1, + MSETransportGuidByte3, + MSETransportGuidByte7, MSETransportHaveTime2, + MSETransportHaveTime3, MSEHaveFallData, MSEHaveFallDirection, - MSETimestamp, MSEPositionO, + MSETimestamp, MSEPositionX, MSEPositionY, MSEPositionZ, - MSEGuidByte7_2, + MSEGuidByte4_2, MSEGuidByte1_2, + MSEGuidByte2_2, MSESplineElev, - MSEGuidByte3_2, + MSEGuidByte0_2, MSEPitch, - MSETransportTime, + MSEGuidByte6_2, + MSEGuidByte3_2, + MSEGuidByte7_2, + MSEGuidByte5_2, + MSETransportSeat, + MSETransportPositionO, MSETransportPositionX, MSETransportPositionY, MSETransportPositionZ, - MSETransportPositionO, - MSETransportSeat, + MSETransportTime, + MSETransportTime2, MSETransportGuidByte3_2, - MSETransportGuidByte1_2, - MSETransportTime3, MSETransportGuidByte6_2, - MSETransportGuidByte0_2, - MSETransportGuidByte5_2, - MSETransportTime2, + MSETransportTime3, MSETransportGuidByte7_2, - MSETransportGuidByte4_2, + MSETransportGuidByte5_2, MSETransportGuidByte2_2, - MSEGuidByte5_2, - MSEGuidByte2_2, - MSEGuidByte6_2, - MSEGuidByte4_2, - MSEGuidByte0_2, - MSEFallVerticalSpeed, + MSETransportGuidByte1_2, + MSETransportGuidByte0_2, + MSETransportGuidByte4_2, MSEFallTime, + MSEFallVerticalSpeed, MSEFallHorizontalSpeed, MSEFallCosAngle, MSEFallSinAngle, }; - +//4.2.2 MovementStatusElements MovementStartTurnLeftSequence[] = { - MSEFlags, - MSEGuidByte3, MSEGuidByte5, - MSEGuidByte7, - MSEFlags2, + MSEGuidByte4, MSEGuidByte6, - MSEHaveSpline, MSEGuidByte0, - MSEGuidByte2, MSEGuidByte1, - MSEGuidByte4, - MSEHaveFallData, - MSEHaveFallDirection, - MSEHaveSplineElev, - MSEHavePitch, + MSEGuidByte7, + MSEGuidByte2, + MSEGuidByte3, + MSEFlags, + MSEFlags2, + MSEHaveSpline, MSEHaveTransportData, - MSETransportGuidByte6, - MSETransportGuidByte3, - MSETransportGuidByte7, - MSETransportGuidByte4, - MSETransportGuidByte1, MSETransportGuidByte0, + MSETransportGuidByte6, MSETransportGuidByte2, MSETransportGuidByte5, - MSETransportHaveTime3, + MSETransportGuidByte4, + MSETransportGuidByte1, + MSETransportGuidByte3, + MSETransportGuidByte7, MSETransportHaveTime2, - MSEPositionO, - MSETimestamp, + MSETransportHaveTime3, + MSEHaveSplineElev, + MSEHaveFallData, + MSEHaveFallDirection, + MSEHavePitch, MSEPositionX, MSEPositionY, MSEPositionZ, - MSEGuidByte2_2, - MSEGuidByte6_2, - MSEFallVerticalSpeed, - MSEFallTime, - MSEFallHorizontalSpeed, - MSEFallCosAngle, - MSEFallSinAngle, - MSEGuidByte4_2, - MSESplineElev, - MSEGuidByte0_2, - MSEGuidByte7_2, - MSEPitch, - MSEGuidByte1_2, - MSEGuidByte5_2, - MSEGuidByte3_2, - MSETransportTime, + MSETimestamp, + MSEPositionO, + MSETransportSeat, + MSETransportPositionO, MSETransportPositionX, MSETransportPositionY, MSETransportPositionZ, - MSETransportPositionO, - MSETransportSeat, + MSETransportTime, + MSETransportTime2, MSETransportGuidByte3_2, - MSETransportGuidByte1_2, - MSETransportTime3, MSETransportGuidByte6_2, - MSETransportGuidByte0_2, - MSETransportGuidByte5_2, - MSETransportTime2, + MSETransportTime3, MSETransportGuidByte7_2, - MSETransportGuidByte4_2, + MSETransportGuidByte5_2, MSETransportGuidByte2_2, + MSETransportGuidByte1_2, + MSETransportGuidByte0_2, + MSETransportGuidByte4_2, + MSEGuidByte4_2, + MSEGuidByte0_2, + MSEGuidByte7_2, + MSEGuidByte1_2, + MSEGuidByte6_2, + MSEGuidByte5_2, + MSEGuidByte3_2, + MSESplineElev, + MSEFallTime, + MSEFallVerticalSpeed, + MSEFallHorizontalSpeed, + MSEFallCosAngle, + MSEFallSinAngle, + MSEGuidByte2_2, + MSEPitch, }; - +//4.2.2 MovementStatusElements MovementStartTurnRightSequence[] = { - MSEGuidByte0, - MSEFlags, - MSEGuidByte7, - MSEHaveSpline, MSEGuidByte4, - MSEGuidByte6, - MSEGuidByte3, MSEGuidByte1, + MSEGuidByte6, + MSEGuidByte0, + MSEFlags, + MSEGuidByte5, MSEFlags2, + MSEHaveSpline, MSEGuidByte2, - MSEGuidByte5, - MSEHaveFallData, - MSEHaveFallDirection, - MSEHavePitch, - MSEHaveSplineElev, + MSEGuidByte3, + MSEGuidByte7, MSEHaveTransportData, - MSETransportGuidByte6, - MSETransportGuidByte3, - MSETransportGuidByte7, - MSETransportGuidByte4, - MSETransportGuidByte1, MSETransportGuidByte0, + MSETransportGuidByte6, MSETransportGuidByte2, MSETransportGuidByte5, - MSETransportHaveTime3, + MSETransportGuidByte4, + MSETransportGuidByte1, + MSETransportGuidByte3, + MSETransportGuidByte7, MSETransportHaveTime2, - MSEPositionO, - MSETimestamp, + MSETransportHaveTime3, + MSEHaveFallData, + MSEHaveFallDirection, + MSEHavePitch, + MSEHaveSplineElev, MSEPositionX, MSEPositionY, MSEPositionZ, - MSEGuidByte1_2, + MSEPositionO, + MSETimestamp, MSEGuidByte6_2, - MSEFallVerticalSpeed, - MSEFallTime, - MSEFallHorizontalSpeed, - MSEFallCosAngle, - MSEFallSinAngle, - MSEGuidByte0_2, - MSEGuidByte5_2, - MSEGuidByte2_2, - MSEPitch, - MSEGuidByte4_2, - MSEGuidByte3_2, - MSEGuidByte7_2, - MSESplineElev, - MSETransportTime, + MSETransportSeat, + MSETransportPositionO, MSETransportPositionX, MSETransportPositionY, MSETransportPositionZ, - MSETransportPositionO, - MSETransportSeat, + MSETransportTime, + MSETransportTime2, MSETransportGuidByte3_2, - MSETransportGuidByte1_2, - MSETransportTime3, MSETransportGuidByte6_2, - MSETransportGuidByte0_2, - MSETransportGuidByte5_2, - MSETransportTime2, + MSETransportTime3, MSETransportGuidByte7_2, - MSETransportGuidByte4_2, + MSETransportGuidByte5_2, MSETransportGuidByte2_2, + MSETransportGuidByte1_2, + MSETransportGuidByte0_2, + MSETransportGuidByte4_2, + MSEGuidByte2_2, + MSEGuidByte4_2, + MSEFallTime, + MSEFallVerticalSpeed, + MSEFallHorizontalSpeed, + MSEFallCosAngle, + MSEFallSinAngle, + MSEPitch, + MSEGuidByte7_2, + MSEGuidByte3_2, + MSEGuidByte1_2, + MSEGuidByte0_2, + MSESplineElev, + MSEGuidByte5_2, }; //4.2.2 MovementStatusElements MovementStopSequence[] = { @@ -902,10 +902,10 @@ MovementStatusElements MovementStopSequence[] = { MSEGuidByte3_2, MSEPitch, MSEFallTime, + MSEFallVerticalSpeed, MSEFallHorizontalSpeed, - MSEFallSinAngle, MSEFallCosAngle, - MSEFallVerticalSpeed, + MSEFallSinAngle, MSEGuidByte5_2, MSEGuidByte7_2, MSETransportSeat, @@ -972,8 +972,8 @@ MovementStatusElements MovementStopStrafeSequence[] = { MSEFallTime, MSEFallVerticalSpeed, MSEFallHorizontalSpeed, - MSEFallSinAngle, MSEFallCosAngle, + MSEFallSinAngle, MSEGuidByte3_2, MSEPitch, MSESplineElev, @@ -995,330 +995,330 @@ MovementStatusElements MovementStopStrafeSequence[] = { MSETransportGuidByte4_2, MSEGuidByte4_2, }; - +//4.2.2 MovementStatusElements MovementStopTurnSequence[] = { - MSEGuidByte3, - MSEGuidByte5, - MSEGuidByte4, + MSEGuidByte6, + MSEFlags, MSEGuidByte2, + MSEGuidByte3, MSEFlags2, - MSEGuidByte0, + MSEGuidByte5, MSEGuidByte7, - MSEGuidByte6, + MSEGuidByte0, + MSEGuidByte4, MSEGuidByte1, MSEHaveSpline, - MSEFlags, + MSEHavePitch, MSEHaveFallData, MSEHaveFallDirection, + MSEHaveSplineElev, MSEHaveTransportData, - MSETransportGuidByte6, - MSETransportGuidByte3, - MSETransportGuidByte7, - MSETransportGuidByte4, - MSETransportGuidByte1, MSETransportGuidByte0, + MSETransportGuidByte6, MSETransportGuidByte2, MSETransportGuidByte5, - MSETransportHaveTime3, + MSETransportGuidByte4, + MSETransportGuidByte1, + MSETransportGuidByte3, + MSETransportGuidByte7, MSETransportHaveTime2, - MSEHaveSplineElev, - MSEHavePitch, - MSEPositionO, + MSETransportHaveTime3, MSETimestamp, MSEPositionX, MSEPositionY, MSEPositionZ, + MSEPositionO, MSEGuidByte4_2, - MSEGuidByte2_2, MSEGuidByte5_2, - MSEFallVerticalSpeed, + MSEGuidByte7_2, + MSEGuidByte1_2, + MSEPitch, + MSEGuidByte3_2, + MSEGuidByte6_2, MSEFallTime, + MSEFallVerticalSpeed, MSEFallHorizontalSpeed, MSEFallCosAngle, MSEFallSinAngle, + MSESplineElev, MSEGuidByte0_2, - MSEGuidByte7_2, - MSEGuidByte6_2, - MSETransportTime, + MSEGuidByte2_2, + MSETransportSeat, + MSETransportPositionO, MSETransportPositionX, MSETransportPositionY, MSETransportPositionZ, - MSETransportPositionO, - MSETransportSeat, + MSETransportTime, + MSETransportTime2, MSETransportGuidByte3_2, - MSETransportGuidByte1_2, - MSETransportTime3, MSETransportGuidByte6_2, - MSETransportGuidByte0_2, - MSETransportGuidByte5_2, - MSETransportTime2, + MSETransportTime3, MSETransportGuidByte7_2, - MSETransportGuidByte4_2, + MSETransportGuidByte5_2, MSETransportGuidByte2_2, - MSESplineElev, - MSEGuidByte1_2, - MSEGuidByte3_2, - MSEPitch, + MSETransportGuidByte1_2, + MSETransportGuidByte0_2, + MSETransportGuidByte4_2, }; - +//4.2.2 MovementStatusElements MovementStartAscendSequence[] = { - MSEGuidByte2, MSEGuidByte3, - MSEGuidByte6, - MSEGuidByte4, - MSEGuidByte0, - MSEHaveSpline, MSEGuidByte1, MSEGuidByte5, MSEFlags, - MSEFlags2, + MSEGuidByte4, + MSEGuidByte6, + MSEGuidByte0, MSEGuidByte7, + MSEFlags2, + MSEGuidByte2, + MSEHaveSpline, + MSEHaveFallData, + MSEHaveFallDirection, + MSEHavePitch, + MSEHaveSplineElev, MSEHaveTransportData, - MSETransportGuidByte6, - MSETransportGuidByte3, - MSETransportGuidByte7, - MSETransportGuidByte4, - MSETransportGuidByte1, MSETransportGuidByte0, + MSETransportGuidByte6, MSETransportGuidByte2, MSETransportGuidByte5, - MSETransportHaveTime3, + MSETransportGuidByte4, + MSETransportGuidByte1, + MSETransportGuidByte3, + MSETransportGuidByte7, MSETransportHaveTime2, - MSEHaveFallData, - MSEHaveFallDirection, - MSEHavePitch, - MSEHaveSplineElev, - MSEPositionO, + MSETransportHaveTime3, MSEPositionX, MSEPositionY, MSEPositionZ, MSETimestamp, - MSETransportTime, + MSEPositionO, + MSEGuidByte3_2, + MSEFallTime, + MSEFallVerticalSpeed, + MSEFallHorizontalSpeed, + MSEFallCosAngle, + MSEFallSinAngle, + MSEPitch, + MSEGuidByte0_2, + MSEGuidByte5_2, + MSESplineElev, + MSEGuidByte1_2, + MSETransportSeat, + MSETransportPositionO, MSETransportPositionX, MSETransportPositionY, MSETransportPositionZ, - MSETransportPositionO, - MSETransportSeat, + MSETransportTime, + MSETransportTime2, MSETransportGuidByte3_2, - MSETransportGuidByte1_2, - MSETransportTime3, MSETransportGuidByte6_2, - MSETransportGuidByte0_2, - MSETransportGuidByte5_2, - MSETransportTime2, + MSETransportTime3, MSETransportGuidByte7_2, - MSETransportGuidByte4_2, + MSETransportGuidByte5_2, MSETransportGuidByte2_2, - MSEGuidByte5_2, - MSEGuidByte3_2, + MSETransportGuidByte1_2, + MSETransportGuidByte0_2, + MSETransportGuidByte4_2, MSEGuidByte4_2, - MSEFallVerticalSpeed, - MSEFallTime, - MSEFallHorizontalSpeed, - MSEFallCosAngle, - MSEFallSinAngle, - MSEGuidByte0_2, + MSEGuidByte7_2, MSEGuidByte2_2, - MSEPitch, MSEGuidByte6_2, - MSESplineElev, - MSEGuidByte7_2, - MSEGuidByte1_2, }; - +//4.2.2 MovementStatusElements MovementStartDescendSequence[] = { - MSEGuidByte7, - MSEGuidByte0, - MSEGuidByte2, - MSEGuidByte1, MSEGuidByte6, + MSEGuidByte1, + MSEGuidByte0, + MSEGuidByte3, + MSEFlags, MSEGuidByte4, - MSEGuidByte5, + MSEGuidByte7, MSEHaveSpline, - MSEGuidByte3, + MSEGuidByte5, MSEFlags2, - MSEFlags, + MSEGuidByte2, + MSEHaveSplineElev, MSEHaveFallData, MSEHaveFallDirection, - MSEHavePitch, - MSEHaveSplineElev, MSEHaveTransportData, - MSETransportGuidByte6, - MSETransportGuidByte3, - MSETransportGuidByte7, - MSETransportGuidByte4, - MSETransportGuidByte1, MSETransportGuidByte0, + MSETransportGuidByte6, MSETransportGuidByte2, MSETransportGuidByte5, - MSETransportHaveTime3, + MSETransportGuidByte4, + MSETransportGuidByte1, + MSETransportGuidByte3, + MSETransportGuidByte7, MSETransportHaveTime2, + MSETransportHaveTime3, + MSEHavePitch, MSETimestamp, MSEPositionX, MSEPositionY, MSEPositionZ, MSEPositionO, - MSEGuidByte3_2, + MSESplineElev, + MSEGuidByte7_2, MSEGuidByte4_2, MSEGuidByte2_2, - MSEFallVerticalSpeed, + MSEGuidByte5_2, MSEFallTime, + MSEFallVerticalSpeed, MSEFallHorizontalSpeed, MSEFallCosAngle, MSEFallSinAngle, - MSEPitch, - MSEGuidByte5_2, - MSESplineElev, - MSETransportTime, + MSEGuidByte6_2, + MSETransportSeat, + MSETransportPositionO, MSETransportPositionX, MSETransportPositionY, MSETransportPositionZ, - MSETransportPositionO, - MSETransportSeat, + MSETransportTime, + MSETransportTime2, MSETransportGuidByte3_2, - MSETransportGuidByte1_2, - MSETransportTime3, MSETransportGuidByte6_2, - MSETransportGuidByte0_2, - MSETransportGuidByte5_2, - MSETransportTime2, + MSETransportTime3, MSETransportGuidByte7_2, - MSETransportGuidByte4_2, + MSETransportGuidByte5_2, MSETransportGuidByte2_2, - MSEGuidByte1_2, + MSETransportGuidByte1_2, + MSETransportGuidByte0_2, + MSETransportGuidByte4_2, MSEGuidByte0_2, - MSEGuidByte7_2, - MSEGuidByte6_2, + MSEGuidByte3_2, + MSEGuidByte1_2, + MSEPitch, }; - +//4.2.2 MovementStatusElements MovementStartSwimSequence[] = { - MSEGuidByte1, - MSEGuidByte5, - MSEFlags, MSEGuidByte2, MSEHaveSpline, + MSEGuidByte1, + MSEFlags, + MSEGuidByte3, + MSEGuidByte5, + MSEGuidByte0, MSEGuidByte6, + MSEGuidByte7, MSEFlags2, MSEGuidByte4, - MSEGuidByte7, - MSEGuidByte0, - MSEGuidByte3, MSEHavePitch, MSEHaveSplineElev, MSEHaveFallData, MSEHaveFallDirection, MSEHaveTransportData, - MSETransportGuidByte6, - MSETransportGuidByte3, - MSETransportGuidByte7, - MSETransportGuidByte4, - MSETransportGuidByte1, MSETransportGuidByte0, + MSETransportGuidByte6, MSETransportGuidByte2, MSETransportGuidByte5, - MSETransportHaveTime3, + MSETransportGuidByte4, + MSETransportGuidByte1, + MSETransportGuidByte3, + MSETransportGuidByte7, MSETransportHaveTime2, - MSEPositionO, + MSETransportHaveTime3, MSEPositionX, MSEPositionY, MSEPositionZ, + MSEPositionO, MSETimestamp, MSEPitch, - MSEGuidByte4_2, MSESplineElev, - MSEFallVerticalSpeed, + MSEGuidByte2_2, + MSEGuidByte0_2, + MSEGuidByte5_2, + MSEGuidByte4_2, + MSEGuidByte7_2, + MSEGuidByte1_2, MSEFallTime, + MSEFallVerticalSpeed, MSEFallHorizontalSpeed, MSEFallCosAngle, MSEFallSinAngle, - MSEGuidByte0_2, - MSEGuidByte7_2, - MSETransportTime, + MSEGuidByte3_2, + MSETransportSeat, + MSETransportPositionO, MSETransportPositionX, MSETransportPositionY, MSETransportPositionZ, - MSETransportPositionO, - MSETransportSeat, + MSETransportTime, + MSETransportTime2, MSETransportGuidByte3_2, - MSETransportGuidByte1_2, - MSETransportTime3, MSETransportGuidByte6_2, - MSETransportGuidByte0_2, - MSETransportGuidByte5_2, - MSETransportTime2, + MSETransportTime3, MSETransportGuidByte7_2, - MSETransportGuidByte4_2, + MSETransportGuidByte5_2, MSETransportGuidByte2_2, + MSETransportGuidByte1_2, + MSETransportGuidByte0_2, + MSETransportGuidByte4_2, MSEGuidByte6_2, - MSEGuidByte5_2, - MSEGuidByte2_2, - MSEGuidByte1_2, - MSEGuidByte3_2, }; - +//4.2.2 MovementStatusElements MovementStopAscendSequence[] = { + MSEFlags2, MSEHaveSpline, - MSEGuidByte5, + MSEGuidByte4, MSEGuidByte3, + MSEGuidByte0, MSEGuidByte1, + MSEGuidByte5, MSEFlags, - MSEGuidByte4, MSEGuidByte7, MSEGuidByte2, - MSEFlags2, MSEGuidByte6, - MSEGuidByte0, - MSEHavePitch, - MSEHaveSplineElev, - MSEHaveFallData, - MSEHaveFallDirection, MSEHaveTransportData, - MSETransportGuidByte6, - MSETransportGuidByte3, - MSETransportGuidByte7, - MSETransportGuidByte4, - MSETransportGuidByte1, MSETransportGuidByte0, + MSETransportGuidByte6, MSETransportGuidByte2, MSETransportGuidByte5, - MSETransportHaveTime3, + MSETransportGuidByte4, + MSETransportGuidByte1, + MSETransportGuidByte3, + MSETransportGuidByte7, MSETransportHaveTime2, + MSETransportHaveTime3, + MSEHaveFallData, + MSEHaveFallDirection, + MSEHaveSplineElev, + MSEHavePitch, MSETimestamp, MSEPositionX, MSEPositionY, MSEPositionZ, MSEPositionO, - MSEGuidByte5_2, - MSEGuidByte2_2, - MSEGuidByte0_2, + MSEGuidByte4_2, MSEGuidByte7_2, - MSEPitch, MSEGuidByte3_2, - MSEGuidByte4_2, - MSEGuidByte1_2, - MSESplineElev, - MSEFallVerticalSpeed, - MSEFallTime, - MSEFallHorizontalSpeed, - MSEFallCosAngle, - MSEFallSinAngle, - MSEGuidByte6_2, - MSETransportTime, + MSEGuidByte2_2, + MSEGuidByte5_2, + MSETransportSeat, + MSETransportPositionO, MSETransportPositionX, MSETransportPositionY, MSETransportPositionZ, - MSETransportPositionO, - MSETransportSeat, + MSETransportTime, + MSETransportTime2, MSETransportGuidByte3_2, - MSETransportGuidByte1_2, - MSETransportTime3, MSETransportGuidByte6_2, - MSETransportGuidByte0_2, - MSETransportGuidByte5_2, - MSETransportTime2, + MSETransportTime3, MSETransportGuidByte7_2, - MSETransportGuidByte4_2, + MSETransportGuidByte5_2, MSETransportGuidByte2_2, + MSETransportGuidByte1_2, + MSETransportGuidByte0_2, + MSETransportGuidByte4_2, + MSEFallTime, + MSEFallVerticalSpeed, + MSEFallHorizontalSpeed, + MSEFallCosAngle, + MSEFallSinAngle, + MSEGuidByte1_2, + MSESplineElev, + MSEGuidByte0_2, + MSEGuidByte6_2, + MSEPitch, }; MovementStatusElements* GetMovementStatusElementsSequence(Opcodes opcode) @@ -1343,25 +1343,25 @@ MovementStatusElements* GetMovementStatusElementsSequence(Opcodes opcode) return MovementStartForwardSequence; case MSG_MOVE_START_STRAFE_LEFT://done return MovementStartStrafeLeftSequence; - case MSG_MOVE_START_STRAFE_RIGHT: + case MSG_MOVE_START_STRAFE_RIGHT://done return MovementStartStrafeRightSequence; - case MSG_MOVE_START_TURN_LEFT: + case MSG_MOVE_START_TURN_LEFT://done return MovementStartTurnLeftSequence; - case MSG_MOVE_START_TURN_RIGHT: + case MSG_MOVE_START_TURN_RIGHT://done return MovementStartTurnRightSequence; case MSG_MOVE_STOP://done return MovementStopSequence; case MSG_MOVE_STOP_STRAFE://done return MovementStopStrafeSequence; - case MSG_MOVE_STOP_TURN: + case MSG_MOVE_STOP_TURN://done return MovementStopTurnSequence; - case MSG_MOVE_START_ASCEND: + case MSG_MOVE_START_ASCEND://done return MovementStartAscendSequence; - case MSG_MOVE_START_DESCEND: + case MSG_MOVE_START_DESCEND://done return MovementStartDescendSequence; - case MSG_MOVE_START_SWIM: + case MSG_MOVE_START_SWIM://done return MovementStartSwimSequence; - case MSG_MOVE_STOP_ASCEND: + case MSG_MOVE_STOP_ASCEND://done return MovementStopAscendSequence; default: break; -- cgit v1.2.3 From de6a45b20795855b93be2fbe86c2bba0ab5387e4 Mon Sep 17 00:00:00 2001 From: Rat Date: Tue, 10 Jan 2012 15:26:12 +0100 Subject: Core/WorldSession: commented null opcode tracer --- src/server/game/Server/WorldSession.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index db6c75304a4..bc9cf569b3d 100755 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -161,9 +161,9 @@ void WorldSession::SendPacket(WorldPacket const* packet) if (packet->GetOpcode() == NULL_OPCODE || packet->GetOpcode() == UNKNOWN_OPCODE) { - sLog->outError("Prevented sending of %s. Trace:", packet->GetOpcode() == NULL_OPCODE ? "NULL_OPCODE" : "UNKNOWN_OPCODE"); - ACE_Stack_Trace trace; - sLog->outError("%s", trace.c_str()); + sLog->outError("Prevented sending of %s", packet->GetOpcode() == NULL_OPCODE ? "NULL_OPCODE" : "UNKNOWN_OPCODE"); + //ACE_Stack_Trace trace; + //sLog->outError("%s", trace.c_str()); return; } -- cgit v1.2.3 From c33475c6a86755ef012c0a913d56d62c12aad76c Mon Sep 17 00:00:00 2001 From: Rat Date: Tue, 10 Jan 2012 19:21:01 +0100 Subject: Core/MovementHandler: small cleanup disabled SMSG_THREAT_UPDATE for now (client crash issue) --- src/server/game/Entities/Unit/Unit.cpp | 4 ++-- src/server/game/Server/Protocol/Handlers/MovementHandler.cpp | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 21e313c1bc0..a9c0ea70f72 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -17334,7 +17334,7 @@ void Unit::SendThreatListUpdate() { uint32 count = getThreatManager().getThreatList().size(); - //sLog->outDebug(LOG_FILTER_UNITS, "WORLD: Send SMSG_THREAT_UPDATE Message"); + sLog->outDebug(LOG_FILTER_UNITS, "WORLD: Send SMSG_THREAT_UPDATE Message (disabled)"); WorldPacket data(SMSG_THREAT_UPDATE, 8 + count * 8); data.append(GetPackGUID()); data << uint32(count); @@ -17344,7 +17344,7 @@ void Unit::SendThreatListUpdate() data.appendPackGUID((*itr)->getUnitGuid()); data << uint32((*itr)->getThreat() * 100); } - SendMessageToSet(&data, false); + //SendMessageToSet(&data, false); } } diff --git a/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp b/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp index fe23e85cb3e..9997816f0ec 100755 --- a/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp @@ -254,7 +254,6 @@ void WorldSession::HandleMovementOpcodes(WorldPacket & recv_data) // ignore, waiting processing in WorldSession::HandleMoveWorldportAckOpcode and WorldSession::HandleMoveTeleportAck if (plMover && plMover->IsBeingTeleported()) { - recv_data.rfinish(); // prevent warnings spam return; } @@ -262,15 +261,15 @@ void WorldSession::HandleMovementOpcodes(WorldPacket & recv_data) MovementInfo movementInfo; ReadMovementInfo(recv_data, &movementInfo); - recv_data.rfinish(); // prevent warnings spam - // prevent tampered movement data if (movementInfo.guid != mover->GetGUID()) + { + sLog->outError("HandleMovementOpcodes: guid error"); return; - + } if (!movementInfo.pos.IsPositionValid()) { - recv_data.rfinish(); // prevent warnings spam + sLog->outError("HandleMovementOpcodes: Invalid Position"); return; } -- cgit v1.2.3 From 01e515d94b0422edcbef1e88c4528bf6abc2f4dd Mon Sep 17 00:00:00 2001 From: Rat Date: Thu, 12 Jan 2012 14:16:16 +0100 Subject: Core/Spells: fixed SMSG_SET_FLAT_SPELL_MODIFIER and SMSG_SET_PCT_SPELL_MODIFIER by Shauren changed TOTAL_AURAS to 363 (biggest number in dbc files) --- src/server/game/Entities/Player/Player.cpp | 20 ++++++++++++-------- src/server/game/Server/Protocol/Opcodes.cpp | 4 ++-- src/server/game/Spells/Auras/SpellAuraDefines.h | 2 +- 3 files changed, 15 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 979c62942f1..975599eae01 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -19923,9 +19923,15 @@ void Player::AddSpellMod(SpellModifier* mod, bool apply) int i = 0; flag96 _mask = 0; + uint32 modTypeCount = 0; // count of mods per one mod->op + WorldPacket data(Opcodes(opcode), 1); + data << uint32(1); // count of different mod->op's in packet + size_t writePos = data.wpos(); + data << uint32(modTypeCount); + data << uint8(mod->op); for (int eff = 0; eff < 96; ++eff) { - if (eff != 0 && eff % 32 == 0) + if (eff != 0 && (eff % 32) == 0) _mask[i++] = 0; _mask[i] = uint32(1) << (eff - (32 * i)); @@ -19936,16 +19942,14 @@ void Player::AddSpellMod(SpellModifier* mod, bool apply) if ((*itr)->type == mod->type && (*itr)->mask & _mask) val += (*itr)->value; val += apply ? mod->value : -(mod->value); - WorldPacket data(Opcodes(opcode), (1+1+4)); + data << uint8(eff); - data << uint8(mod->op); - data << int32(val); - if (opcode == SMSG_SET_PCT_SPELL_MODIFIER) - data << uint8(0); // 4.x unk - SendDirectMessage(&data); + data << float(val); + ++modTypeCount; } } - + data.put(writePos, modTypeCount); + SendDirectMessage(&data); if (apply) m_spellMods[mod->op].push_back(mod); else diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index d05b45ab718..8324a990170 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -677,8 +677,8 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_SPELLORDAMAGE_IMMUNE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_BIDDER_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListBidderItems ); //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_BIDDER_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SET_FLAT_SPELL_MODIFIER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SET_PCT_SPELL_MODIFIER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SET_FLAT_SPELL_MODIFIER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SET_PCT_SPELL_MODIFIER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CORPSE_RECLAIM_DELAY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIVE_MOVER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActiveMoverOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_PET_CANCEL_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetCancelAuraOpcode ); diff --git a/src/server/game/Spells/Auras/SpellAuraDefines.h b/src/server/game/Spells/Auras/SpellAuraDefines.h index 90d77a5e509..c5540052fb3 100755 --- a/src/server/game/Spells/Auras/SpellAuraDefines.h +++ b/src/server/game/Spells/Auras/SpellAuraDefines.h @@ -413,7 +413,7 @@ enum AuraType SPELL_AURA_351 = 351, SPELL_AURA_352 = 352, SPELL_AURA_MOD_CAMOUFLAGE = 353, // NYI - TOTAL_AURAS = 354 + TOTAL_AURAS = 363 // 4.2.2 }; enum AuraObjectType -- cgit v1.2.3 From a7923ae20f1fe0b94979de95b2f50b4c16c56d51 Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Thu, 12 Jan 2012 14:40:01 +0000 Subject: Core/Spells: Enable and "fix" SMSG_SPELLDAMAGESHIELD --- src/server/game/Entities/Unit/Unit.cpp | 3 ++- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index a9c0ea70f72..582b2e79596 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -1443,7 +1443,7 @@ void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss) victim->DealDamageMods(this, damage, NULL); // TODO: Move this to a packet handler - WorldPacket data(SMSG_SPELLDAMAGESHIELD, (8+8+4+4+4+4)); + WorldPacket data(SMSG_SPELLDAMAGESHIELD, 8 + 8 + 4 + 4 + 4 + 4 + 4); data << uint64(victim->GetGUID()); data << uint64(GetGUID()); data << uint32(i_spellProto->Id); @@ -1451,6 +1451,7 @@ void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss) int32 overkill = int32(damage) - int32(GetHealth()); data << uint32(overkill > 0 ? overkill : 0); // Overkill data << uint32(i_spellProto->SchoolMask); + data << uint32(0); // Unknown 4.x victim->SendMessageToSet(&data, true); victim->DealDamage(this, damage, 0, SPELL_DIRECT_DAMAGE, i_spellProto->GetSchoolMask(), i_spellProto, true); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 8324a990170..495f261eaff 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -654,7 +654,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_SPELLLOGEXECUTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DEBUGAURAPROC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PERIODICAURALOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELLDAMAGESHIELD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELLDAMAGESHIELD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPELLNONMELEEDAMAGELOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_LEARN_TALENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnTalentOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_RESURRECT_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From 12e879c5b8c7bf2b45bb0fbdc2a328ef3207ec3e Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Thu, 12 Jan 2012 14:59:40 +0000 Subject: Core/Opcodes: Few opcodes from WPP + Some random cleanup --- src/server/game/AuctionHouse/AuctionHouseMgr.cpp | 2 +- src/server/game/DataStores/DB2Stores.cpp | 3 +- .../Server/Protocol/Handlers/CharacterHandler.cpp | 1 - .../game/Server/Protocol/Handlers/SpellHandler.cpp | 6 - src/server/game/Server/Protocol/Opcodes.h | 230 ++++++++++----------- src/server/shared/DataStores/DB2Store.h | 2 +- src/server/shared/DataStores/DBCStore.h | 2 +- src/server/shared/Packets/ByteBuffer.h | 2 +- 8 files changed, 119 insertions(+), 129 deletions(-) (limited to 'src') diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp index b2888c0d70d..838fdbddfeb 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp @@ -29,7 +29,7 @@ #include "AuctionHouseMgr.h" #include "Item.h" #include "Language.h" -#include "Logging/Log.h" +#include "Log.h" #include enum eAuctionHouse diff --git a/src/server/game/DataStores/DB2Stores.cpp b/src/server/game/DataStores/DB2Stores.cpp index fcdee61d68a..dbbcf1ef279 100644 --- a/src/server/game/DataStores/DB2Stores.cpp +++ b/src/server/game/DataStores/DB2Stores.cpp @@ -16,8 +16,7 @@ */ #include "DB2Stores.h" - -#include "Logging/Log.h" +#include "Log.h" #include "SharedDefines.h" #include "SpellMgr.h" #include "DB2fmt.h" diff --git a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp index bd4943f339d..242a8edc31c 100644 --- a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp @@ -26,7 +26,6 @@ #include "WorldPacket.h" #include "WorldSession.h" #include "DatabaseEnv.h" - #include "ArenaTeam.h" #include "Chat.h" #include "Group.h" diff --git a/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp b/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp index 6ec7c142bb0..b867100e7b7 100755 --- a/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp @@ -191,12 +191,6 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket) } } -#define OPEN_CHEST 11437 -#define OPEN_SAFE 11535 -#define OPEN_CAGE 11792 -#define OPEN_BOOTY_CHEST 5107 -#define OPEN_STRONGBOX 8517 - void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket) { sLog->outDetail("WORLD: CMSG_OPEN_ITEM packet, data length = %i", (uint32)recvPacket.size()); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 68a779201b7..645701be817 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -65,17 +65,16 @@ enum Opcodes CMSG_AUTOEQUIP_GROUND_ITEM = 0x00, CMSG_AUTOEQUIP_ITEM = 0x8E66, CMSG_AUTOEQUIP_ITEM_SLOT = 0x00, - CMSG_AUTO_DECLINE_GUILD_INVITES = 0x586F, - CMSG_BATTLEFIELD_LIST = 0x32A4, CMSG_AUTOSTORE_BAG_ITEM = 0x0EEE, CMSG_AUTOSTORE_BANK_ITEM = 0x1C5F, CMSG_AUTOSTORE_GROUND_ITEM = 0x00, CMSG_AUTOSTORE_LOOT_ITEM = 0xD876, + CMSG_AUTO_DECLINE_GUILD_INVITES = 0x586F, CMSG_BANKER_ACTIVATE = 0x00, CMSG_BATTLEFIELD_JOIN = 0x225, + CMSG_BATTLEFIELD_LIST = 0x32A4, CMSG_BATTLEFIELD_REQUEST_SCORE_DATA = 0x00, CMSG_BATTLEFIELD_STATUS = 0x00, - MSG_BATTLEGROUND_PLAYER_POSITIONS = 0x00, CMSG_BATTLEMASTER_JOIN_ARENA = 0x00, CMSG_BEGIN_TRADE = 0x3724, CMSG_BINDER_ACTIVATE = 0x58FB, @@ -89,7 +88,7 @@ enum Opcodes CMSG_CALENDAR_ARENA_TEAM = 0x00, CMSG_CALENDAR_CONTEXT_EVENT_SIGNUP = 0x00, CMSG_CALENDAR_COPY_EVENT = 0x00, - CMSG_CALENDAR_EVENT_INVITE = 0x1EDA, // 0x4A76 + CMSG_CALENDAR_EVENT_INVITE = 0x1EDA, CMSG_CALENDAR_EVENT_MODERATOR_STATUS = 0xCCFA, CMSG_CALENDAR_EVENT_REMOVE_INVITE = 0xCCD2, CMSG_CALENDAR_EVENT_STATUS = 0x4E67, @@ -156,10 +155,11 @@ enum Opcodes CMSG_DUEL_ACCEPTED = 0x00, CMSG_DUEL_CANCELLED = 0x00, CMSG_EJECT_PASSENGER = 0x00, + CMSG_EMOTE = 0x9843, + CMSG_ENABLE_NAGLE = 0x00, CMSG_EQUIPMENT_SET_DELETE = 0x9CF2, CMSG_EQUIPMENT_SET_SAVE = 0x5E5F, CMSG_EQUIPMENT_SET_USE = 0x4853, - CMSG_EMOTE = 0x9843, CMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK = 0x00, CMSG_FORCE_FLIGHT_SPEED_CHANGE_ACK = 0x00, CMSG_FORCE_MOVE_ROOT_ACK = 0x00, @@ -173,14 +173,13 @@ enum Opcodes CMSG_FORCE_WALK_SPEED_CHANGE_ACK = 0x00, CMSG_GAMEOBJECT_QUERY = 0xCEFF, CMSG_GAMEOBJ_REPORT_USE = 0x00, - CMSG_GAMEOBJ_USE = 0x9A4A, + CMSG_GAMEOBJ_USE = 0x9A4A, // might be CMSG_GAMEOBJ_USE CMSG_GAMESPEED_SET = 0x00, CMSG_GAMETIME_SET = 0x00, + CMSG_GETDEATHBINDZONE = 0x00, CMSG_GET_MAIL_LIST = 0xB284, CMSG_GET_MIRRORIMAGE_DATA = 0xDAF3, - CMSG_GETDEATHBINDZONE = 0x00, CMSG_GHOST = 0x00, - CMSG_GM_INVIS = 0x00, CMSG_GMRESPONSE_RESOLVE = 0x00, CMSG_GMSURVEY_SUBMIT = 0x00, CMSG_GMTICKET_CREATE = 0x0A7B, @@ -188,9 +187,10 @@ enum Opcodes CMSG_GMTICKET_GETTICKET = 0x985F, CMSG_GMTICKET_SYSTEMSTATUS = 0x4A7A, CMSG_GMTICKET_UPDATETEXT = 0x8A7B, + CMSG_GM_INVIS = 0x00, CMSG_GM_NUKE = 0x00, - CMSG_GM_SET_SECURITY_GROUP = 0x00, CMSG_GM_REPORT_LAG = 0x9C6B, + CMSG_GM_SET_SECURITY_GROUP = 0x00, CMSG_GOSSIP_HELLO = 0xAD3, CMSG_GOSSIP_SELECT_OPTION = 0x984E, CMSG_GRANT_LEVEL = 0x1CD6, @@ -206,6 +206,7 @@ enum Opcodes CMSG_GROUP_SWAP_SUB_GROUP = 0x5AD7, CMSG_GROUP_UNINVITE = 0x00, CMSG_GROUP_UNINVITE_GUID = 0x00, + CMSG_GUILDFINDER_JOIN = 0x68C5, CMSG_GUILD_ACCEPT = 0x00, CMSG_GUILD_BANKER_ACTIVATE = 0x4E77, CMSG_GUILD_BANK_BUY_TAB = 0x00, @@ -221,23 +222,22 @@ enum Opcodes CMSG_GUILD_DISBAND = 0x00, CMSG_GUILD_INFO = 0xCE76, CMSG_GUILD_INVITE = 0x8C67, - CMSG_GUILD_PROMOTE = 0x00, - CMSG_GUILD_QUERY = 0x8E57, CMSG_GUILD_LEADER = 0x28C4, CMSG_GUILD_LEAVE = 0x00, CMSG_GUILD_MOTD = 0x00, - CMSG_GUILD_RANK = 0x8D50, // New 4.x + CMSG_GUILD_PROMOTE = 0x00, + CMSG_GUILD_QUERY = 0x8E57, + CMSG_GUILD_RANK = 0x8D50, CMSG_GUILD_REMOVE = 0x00, CMSG_GUILD_ROSTER = 0x9952, - CMSG_GUILD_SET_NOTE = 0x9958, // New 4.x ? - CMSG_GUILDFINDER_JOIN = 0x68C5, // New 4.x + CMSG_GUILD_SET_NOTE = 0x9958, CMSG_HEARTH_AND_RESURRECT = 0x00, CMSG_IGNORE_TRADE = 0x00, CMSG_INITIATE_TRADE = 0x00, CMSG_INSPECT = 0x9A7B, CMSG_INSTANCE_LOCK_WARNING_RESPONSE = 0x8CF7, - CMSG_ITEM_QUERY_SINGLE = 0x8E2, CMSG_ITEM_QUERY_MULTIPLE = 0x00, + CMSG_ITEM_QUERY_SINGLE = 0x8E2, CMSG_ITEM_REFUND = 0xCC3, CMSG_ITEM_REFUND_INFO = 0x1C7E, CMSG_ITEM_TEXT_QUERY = 0x4AEB, @@ -248,20 +248,19 @@ enum Opcodes CMSG_LEARN_TALENT = 0x98F3, CMSG_LEAVE_BATTLEFIELD = 0x1AE7, CMSG_LEAVE_CHANNEL = 0x00, - CMSG_LFG_LFR_JOIN = 0x8CFA, - CMSG_LFG_PARTY_LOCK_INFO_REQUEST = 0xC867, CMSG_LFG_GET_PLAYER_INFO = 0x00, CMSG_LFG_JOIN = 0x00, CMSG_LFG_LEAVE = 0x00, + CMSG_LFG_LFR_JOIN = 0x8CFA, + CMSG_LFG_PARTY_LOCK_INFO_REQUEST = 0xC867, CMSG_LFG_PROPOSAL_RESULT = 0x00, - SMSG_LFG_BOOT_PLAYER = 0x00, CMSG_LFG_SET_ROLES = 0x4843, CMSG_LFG_TELEPORT = 0x8C7A, CMSG_LIST_INVENTORY = 0xDCFE, CMSG_LOAD_SCREEN = 0x0888, - CMSG_LOG_DISCONNECT = 0x00, CMSG_LOGOUT_CANCEL = 0xA76, CMSG_LOGOUT_REQUEST = 0x4C7A, + CMSG_LOG_DISCONNECT = 0x00, CMSG_LOOT = 0x1E62, CMSG_LOOT_METHOD = 0x00, CMSG_LOOT_MONEY = 0x4A42, @@ -274,14 +273,14 @@ enum Opcodes CMSG_MAIL_TAKE_ITEM = 0xCC2, CMSG_MAIL_TAKE_MONEY = 0x4CD6, CMSG_MEETINGSTONE_INFO = 0xCA5B, + CMSG_MESSAGECHAT_ADDON_BATTLEGROUND = 0x6059, + CMSG_MESSAGECHAT_ADDON_GUILD = 0x24D9, + CMSG_MESSAGECHAT_ADDON_PARTY = 0x6041, + CMSG_MESSAGECHAT_ADDON_RAID = 0x3041, + CMSG_MESSAGECHAT_ADDON_WHISPER = 0x20C1, CMSG_MESSAGECHAT_AFK = 0x30C1, CMSG_MESSAGECHAT_BATTLEGROUND = 0x00, CMSG_MESSAGECHAT_BATTLEGROUND_LEADER = 0x00, - CMSG_MESSAGECHAT_ADDON_BATTLEGROUND = 0x6059, // New on 4.x - CMSG_MESSAGECHAT_ADDON_GUILD = 0x24D9, // New on 4.x - CMSG_MESSAGECHAT_ADDON_PARTY = 0x6041, // New on 4.x - CMSG_MESSAGECHAT_ADDON_RAID = 0x3041, // New on 4.x - CMSG_MESSAGECHAT_ADDON_WHISPER = 0x20C1, // New on 4.x CMSG_MESSAGECHAT_CHANNEL = 0x7459, CMSG_MESSAGECHAT_DND = 0x30C9, CMSG_MESSAGECHAT_EMOTE = 0x6449, @@ -297,17 +296,18 @@ enum Opcodes CMSG_MESSAGECHAT_YELL = 0x70C1, CMSG_MINIGAME_MOVE = 0x00, CMSG_MOUNTSPECIAL_ANIM = 0x00, + CMSG_MOVE_HOVER_ACK = 0x00, CMSG_MOVE_KNOCK_BACK_ACK = 0x00, + CMSG_MOVE_SET_COLLISION_HGT = 0x00, CMSG_MOVE_SET_RAW_POSITION = 0x00, CMSG_MOVE_TIME_SKIPPED = 0x00, - CMSG_ENABLE_NAGLE = 0x00, CMSG_NAME_QUERY = 0x586A, CMSG_NEW_SPELL_SLOT = 0x00, CMSG_NEXT_CINEMATIC_CAMERA = 0x8E63, CMSG_NPC_TEXT_QUERY = 0x5C63, CMSG_OFFER_PETITION = 0xC8DE, - CMSG_OPEN_ITEM = 0x88C7, CMSG_OPENING_CINEMATIC = 0xD8D2, + CMSG_OPEN_ITEM = 0x88C7, CMSG_OPT_OUT_OF_LOOT = 0x00, CMSG_PAGE_TEXT_QUERY = 0x8A5F, CMSG_PETITION_BUY = 0x8E4E, @@ -326,20 +326,18 @@ enum Opcodes CMSG_PET_SPELL_AUTOCAST = 0x00, CMSG_PET_STOP_ATTACK = 0x00, CMSG_PING = 0x1008, - CMSG_PLAYER_DIFFICULTY_CHANGE = 0x00, CMSG_PLAYED_TIME = 0x5A56, + CMSG_PLAYER_DIFFICULTY_CHANGE = 0x00, CMSG_PLAYER_LOGIN = 0x0898, CMSG_PLAYER_LOGOUT = 0x1CEE, CMSG_PLAYER_VEHICLE_ENTER = 0x00, CMSG_PLAY_DANCE = 0x5857, CMSG_PUSHQUESTTOPARTY = 0xA47, - CMSG_QUERY_GUILD_REWARDS = 0x00, CMSG_QUERY_GUILD_MAX_XP = 0x00, + CMSG_QUERY_GUILD_REWARDS = 0x00, CMSG_QUERY_GUILD_XP = 0x00, - CMSG_QUERY_TIME = 0x18FE, - CMSG_QUEST_QUERY = 0xCE7F, CMSG_QUERY_QUESTS_COMPLETED = 0x98DF, - CMSG_QUESTLOG_SWAP_QUEST = 0x00, + CMSG_QUERY_TIME = 0x18FE, CMSG_QUESTGIVER_ACCEPT_QUEST = 0x8CD3, CMSG_QUESTGIVER_CANCEL = 0xC86A, CMSG_QUESTGIVER_CHOOSE_REWARD = 0x18F3, @@ -351,27 +349,29 @@ enum Opcodes CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY = 0xC8DB, CMSG_QUESTGIVER_STATUS_QUERY = 0x88C6, CMSG_QUESTLOG_REMOVE_QUEST = 0x8EFF, - CMSG_QUEST_POI_QUERY = 0x12A5, + CMSG_QUESTLOG_SWAP_QUEST = 0x00, CMSG_QUEST_CONFIRM_ACCEPT = 0xC63, - CMSG_RANDOMIZE_CHAR_NAME = 0x8A99, // byte unk, byte race + CMSG_QUEST_POI_QUERY = 0x12A5, + CMSG_QUEST_QUERY = 0xCE7F, + CMSG_RANDOMIZE_CHAR_NAME = 0x8A99, CMSG_READY_FOR_ACCOUNT_DATA_TIMES = 0xCCDB, CMSG_READ_ITEM = 0x184F, CMSG_REALM_SPLIT = 0xDC66, CMSG_RECLAIM_CORPSE = 0x88DB, CMSG_REDIRECTION_AUTH_PROOF = 0x1039, CMSG_REPAIR_ITEM = 0xCF3, + CMSG_REPLACE_ACCOUNT_DATA = 0x00, CMSG_REPOP_REQUEST = 0x8872, CMSG_REPORT_PVP_AFK = 0x00, - CMSG_REPLACE_ACCOUNT_DATA = 0x00, CMSG_REQUEST_ACCOUNT_DATA = 0x8AF2, CMSG_REQUEST_CATEGORY_COOLDOWNS = 0x00, CMSG_REQUEST_CEMETERY_LIST = 0x00, CMSG_REQUEST_PARTY_MEMBER_STATS = 0x987E, CMSG_REQUEST_PET_INFO = 0x9A47, CMSG_REQUEST_PLAYER_VEHICLE_EXIT = 0xCC6, - CMSG_REQUEST_RATED_BG_INFO = 0x00, CMSG_REQUEST_RAID_INFO = 0xECF, - CMSG_REQUEST_VEHICLE_EXIT = 0xCC6, // New 4.x ? + CMSG_REQUEST_RATED_BG_INFO = 0x00, + CMSG_REQUEST_VEHICLE_EXIT = 0xCC6, CMSG_REQUEST_VEHICLE_NEXT_SEAT = 0xCAD6, CMSG_REQUEST_VEHICLE_PREV_SEAT = 0x1AE2, CMSG_REQUEST_VEHICLE_SWITCH_SEAT = 0x9A46, @@ -383,6 +383,9 @@ enum Opcodes CMSG_SEARCH_LFG_LEAVE = 0x00, CMSG_SELF_RES = 0xCCFE, CMSG_SELL_ITEM = 0x5EE3, + CMSG_SERVERTIME = 0x00, + CMSG_SETDEATHBINDPOINT = 0x00, + CMSG_SETSHEATHED = 0xCA5F, CMSG_SET_ACTIONBAR_TOGGLES = 0x584F, CMSG_SET_ACTION_BUTTON = 0x00, CMSG_SET_ACTIVE_MOVER = 0x00, @@ -403,35 +406,31 @@ enum Opcodes CMSG_SET_TITLE = 0xCE63, CMSG_SET_TRADE_GOLD = 0x00, CMSG_SET_TRADE_ITEM = 0x00, - CMSG_SETDEATHBINDPOINT = 0x00, - CMSG_SETSHEATHED = 0xCA5F, CMSG_SHOWING_CLOAK = 0x8AE3, CMSG_SHOWING_HELM = 0xCEFA, - CMSG_SERVERTIME = 0x00, CMSG_SOCKET_GEMS = 0x00, - CMSG_SPIRIT_HEALER_ACTIVATE = 0x5AEB, CMSG_SPELLCLICK = 0xC8F2, + CMSG_SPIRIT_HEALER_ACTIVATE = 0x5AEB, CMSG_SPLIT_ITEM = 0xDCFA, CMSG_STANDSTATECHANGE = 0x9EC6, CMSG_START_QUEST = 0x00, CMSG_STOP_DANCE = 0x00, CMSG_STORE_LOOT_IN_SLOT = 0x00, CMSG_SUMMON_RESPONSE = 0xD84E, - CMSG_SWAP_ITEM = 0xDED6, CMSG_SWAP_INV_ITEM = 0x5CE7, - CMSG_TELEPORT_TO_UNIT = 0x8C72, - CMSG_TEXT_EMOTE = 0x08D3, - CMSG_TIME_SYNC_RESP = 0x07A5, + CMSG_SWAP_ITEM = 0xDED6, CMSG_TAXICLEARALLNODES = 0x00, CMSG_TAXIENABLEALLNODES = 0x00, CMSG_TAXINODE_STATUS_QUERY = 0x98E3, CMSG_TAXIQUERYAVAILABLENODES = 0x00, CMSG_TAXISHOWNODES = 0x00, + CMSG_TELEPORT_TO_UNIT = 0x8C72, + CMSG_TEXT_EMOTE = 0x08D3, + CMSG_TIME_SYNC_RESP = 0x07A5, CMSG_TOGGLE_PVP = 0x8ECA, CMSG_TOTEM_DESTROYED = 0x00, - SMSG_TRAINER_BUY_SUCCEEDED = 0x00, - CMSG_TRAINER_LIST = 0xCC7F, CMSG_TRAINER_BUY_SPELL = 0xAF7, + CMSG_TRAINER_LIST = 0xCC7F, CMSG_TRIGGER_CINEMATIC_CHEAT = 0x00, CMSG_TURN_IN_PETITION = 0x9C67, CMSG_TUTORIAL_CLEAR = 0x00, @@ -442,9 +441,11 @@ enum Opcodes CMSG_UNREGISTER_ALL_ADDON_PREFIXES = 0x00, CMSG_UNUSED2 = 0x00, CMSG_UPDATE_ACCOUNT_DATA = 0x4AFE, + CMSG_UPDATE_PROJECTILE_POSITION = 0xEDB, CMSG_USE_ITEM = 0xD8EA, - CMSG_VOICE_SESSION_ENABLE = 0x00, + CMSG_VERIFY_CONNECTIVITY_RESPONSE = 0x4C52, CMSG_VIOLENCE_LEVEL = 0x00, + CMSG_VOICE_SESSION_ENABLE = 0x00, CMSG_WARDEN_DATA = 0x5847, CMSG_WHO = 0x9AD7, CMSG_WHOIS = 0xCCE6, @@ -453,6 +454,7 @@ enum Opcodes CMSG_WRAP_ITEM = 0x00, CMSG_ZONEUPDATE = 0x4AE2, MSG_AUCTION_HELLO = 0xCC7A, + MSG_BATTLEGROUND_PLAYER_POSITIONS = 0x00, MSG_CHANNEL_START = 0x00, MSG_CHANNEL_UPDATE = 0x00, MSG_CORPSE_QUERY = 0x00, @@ -484,8 +486,8 @@ enum Opcodes MSG_MOVE_SET_RUN_BACK_SPEED = 0x00, MSG_MOVE_SET_RUN_BACK_SPEED_CHEAT = 0x00, MSG_MOVE_SET_RUN_MODE = 0x21A4, - MSG_MOVE_SET_RUN_SPEED_CHEAT = 0x00, MSG_MOVE_SET_RUN_SPEED = 0x00, + MSG_MOVE_SET_RUN_SPEED_CHEAT = 0x00, MSG_MOVE_SET_SWIM_BACK_SPEED = 0x00, MSG_MOVE_SET_SWIM_BACK_SPEED_CHEAT = 0x00, MSG_MOVE_SET_SWIM_SPEED = 0x00, @@ -496,29 +498,29 @@ enum Opcodes MSG_MOVE_SET_WALK_SPEED = 0x00, MSG_MOVE_SET_WALK_SPEED_CHEAT = 0x00, MSG_MOVE_START_ASCEND = 0x0624, - MSG_MOVE_START_DESCEND = 0x2624, - MSG_MOVE_STOP_ASCEND = 0x1125, MSG_MOVE_START_BACKWARD = 0x10A5, + MSG_MOVE_START_DESCEND = 0x2624, MSG_MOVE_START_FORWARD = 0xA0A4, - MSG_MOVE_START_PITCH_UP = 0x9524, MSG_MOVE_START_PITCH_DOWN = 0x2025, - MSG_MOVE_START_TURN_LEFT = 0x01A5, - MSG_MOVE_START_TURN_RIGHT = 0xB6A4, + MSG_MOVE_START_PITCH_UP = 0x9524, MSG_MOVE_START_STRAFE_LEFT = 0xA024, MSG_MOVE_START_STRAFE_RIGHT = 0x9125, MSG_MOVE_START_SWIM = 0x85A4, + MSG_MOVE_START_TURN_LEFT = 0x01A5, + MSG_MOVE_START_TURN_RIGHT = 0xB6A4, MSG_MOVE_STOP = 0xA3A4, + MSG_MOVE_STOP_ASCEND = 0x1125, MSG_MOVE_STOP_PITCH = 0x8425, - MSG_MOVE_STOP_TURN = 0x90A4, MSG_MOVE_STOP_STRAFE = 0x0125, MSG_MOVE_STOP_SWIM = 0xB424, - MSG_MOVE_TOGGLE_LOGGING = 0x00, - MSG_MOVE_TIME_SKIPPED = 0x00, + MSG_MOVE_STOP_TURN = 0x90A4, MSG_MOVE_TELEPORT = 0x00, MSG_MOVE_TELEPORT_ACK = 0x00, MSG_MOVE_TELEPORT_CHEAT = 0x00, + MSG_MOVE_TIME_SKIPPED = 0x00, MSG_MOVE_TOGGLE_COLLISION_CHEAT = 0x00, MSG_MOVE_TOGGLE_FALL_LOGGING = 0x00, + MSG_MOVE_TOGGLE_LOGGING = 0x00, MSG_MOVE_UNROOT = 0x00, MSG_MOVE_WORLDPORT_ACK = 0x00, MSG_NOTIFY_PARTY_SQUELCH = 0x00, @@ -560,7 +562,7 @@ enum Opcodes SMSG_ARENA_TEAM_QUERY_RESPONSE = 0x8CCE, SMSG_ARENA_TEAM_ROSTER = 0xCE7A, SMSG_ARENA_TEAM_STATS = 0xDEF2, - SMSG_ATTACKERSTATEUPDATE = 0x00, + SMSG_ATTACKERSTATEUPDATE = 0x0E6A, SMSG_ATTACKSTART = 0xCA4A, SMSG_ATTACKSTOP = 0xCED7, SMSG_ATTACKSWING_BADFACING = 0x00, @@ -575,9 +577,9 @@ enum Opcodes SMSG_AUCTION_OWNER_LIST_RESULT = 0x4EDA, SMSG_AUCTION_OWNER_NOTIFICATION = 0xCA6A, SMSG_AUCTION_REMOVED_NOTIFICATION = 0x4CFB, + SMSG_AURACASTLOG = 0x00, SMSG_AURA_UPDATE = 0x4C66, SMSG_AURA_UPDATE_ALL = 0x18EE, - SMSG_AURACASTLOG = 0x00, SMSG_AUTH_CHALLENGE = 0x1181, SMSG_AUTH_RESPONSE = 0x8867, SMSG_AVAILABLE_VOICE_CHANNEL = 0x9C7B, @@ -591,36 +593,38 @@ enum Opcodes SMSG_BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE = 0x326E, SMSG_BATTLEFIELD_MGR_STATE_CHANGE = 0x32EE, SMSG_BATTLEFIELD_PORT_DENIED = 0x00, + SMSG_BATTLEFIELD_STATUS = 0x00, SMSG_BATTLEFIELD_STATUS1 = 0x70EE, SMSG_BATTLEFIELD_STATUS2 = 0x20DC, SMSG_BATTLEFIELD_STATUS3 = 0x36DE, SMSG_BATTLEFIELD_STATUS4 = 0x626E, SMSG_BATTLEGROUND_INFO_THROTTLED = 0x00, SMSG_BATTLEGROUND_PLAYER_JOINED = 0x00, + SMSG_BATTLEGROUND_PLAYER_LEFT = 0x00, SMSG_BATTLEGROUND_PLAYER_POSITIONS = 0x00, + SMSG_BINDER_CONFIRM = 0x00, SMSG_BINDPOINTUPDATE = 0x00, SMSG_BINDZONEREPLY = 0x00, - SMSG_BINDER_CONFIRM = 0x00, SMSG_BREAK_TARGET = 0xE7E, SMSG_BUY_BANK_SLOT_RESULT = 0x00, - SMSG_BUY_ITEM = 0x00, SMSG_BUY_FAILED = 0x00, + SMSG_BUY_ITEM = 0x00, SMSG_CALENDAR_COMMAND_RESULT = 0x9A4E, - SMSG_CALENDAR_SEND_NUM_PENDING = 0x00, SMSG_CALENDAR_SEND_CALENDAR = 0x00, + SMSG_CALENDAR_SEND_NUM_PENDING = 0x00, SMSG_CANCEL_AUTO_REPEAT = 0x5ACB, SMSG_CANCEL_COMBAT = 0x00, SMSG_CAST_FAILED = 0x1AEB, SMSG_CHANNEL_LIST = 0x9C47, SMSG_CHANNEL_MEMBER_COUNT = 0x5EEA, SMSG_CHANNEL_NOTIFY = 0x9C7F, + SMSG_CHARACTER_LOGIN_FAILED = 0x4AE6, SMSG_CHAR_CREATE = 0x4C5B, + SMSG_CHAR_CUSTOMIZE = 0x0AE3, SMSG_CHAR_DELETE = 0x48CE, SMSG_CHAR_ENUM = 0xA05C, - SMSG_CHARACTER_LOGIN_FAILED = 0x4AE6, - SMSG_CHAR_RENAME = 0x5EF6, - SMSG_CHAR_CUSTOMIZE = 0x0AE3, SMSG_CHAR_FACTION_CHANGE = 0x885A, + SMSG_CHAR_RENAME = 0x5EF6, SMSG_CHAT_PLAYER_AMBIGUOUS = 0x00, SMSG_CHAT_PLAYER_NOT_FOUND = 0x00, SMSG_CHAT_RESTRICTED = 0x00, @@ -635,17 +639,17 @@ enum Opcodes SMSG_COMMENTATOR_PLAYER_INFO = 0x00, SMSG_COMMENTATOR_STATE_CHANGED = 0x00, SMSG_COMPLAIN_RESULT = 0x00, - SMSG_COMPRESSED_CHAR_ENUM = 0x380A, // New 4.x - SMSG_COMPRESSED_GUILD_ROSTER = 0x5A29, // New 4.x + SMSG_COMPRESSED_CHAR_ENUM = 0x380A, + SMSG_COMPRESSED_GUILD_ROSTER = 0x5A29, SMSG_COMPRESSED_MOVES = 0x0862, SMSG_COMPRESSED_UPDATE_OBJECT = 0x1CC3, SMSG_CONTACT_LIST = 0x0A6B, SMSG_CONVERT_RUNE = 0x00, SMSG_COOLDOWN_CHEAT = 0x00, SMSG_COOLDOWN_EVENT = 0x00, + SMSG_CORPSE_MAP_POSITION_QUERY_RESPONSE = 0x00, SMSG_CORPSE_NOT_IN_INSTANCE = 0xCACB, SMSG_CORPSE_RECLAIM_DELAY = 0xCD46, - SMSG_CORPSE_MAP_POSITION_QUERY_RESPONSE = 0x00, SMSG_CREATURE_QUERY_RESPONSE = 0xD847, SMSG_CRITERIA_DELETED = 0x00, SMSG_CRITERIA_UPDATE = 0xD87F, @@ -658,13 +662,13 @@ enum Opcodes SMSG_DEFENSE_MESSAGE = 0x9EC3, SMSG_DESTROY_OBJECT = 0x486B, SMSG_DESTRUCTIBLE_BUILDING_DAMAGE = 0x00, - SMSG_DUEL_OUTOFBOUNDS = 0x00, - SMSG_DUEL_INBOUNDS = 0x00, SMSG_DISMOUNT = 0xCEE7, SMSG_DISMOUNTRESULT = 0x00, SMSG_DISPEL_FAILED = 0x00, SMSG_DUEL_COMPLETE = 0x5846, SMSG_DUEL_COUNTDOWN = 0x1A5F, + SMSG_DUEL_INBOUNDS = 0x00, + SMSG_DUEL_OUTOFBOUNDS = 0x00, SMSG_DUEL_REQUESTED = 0x1EC6, SMSG_DUEL_WINNER = 0xDA52, SMSG_DURABILITY_DAMAGE_DEATH = 0x00, @@ -679,9 +683,9 @@ enum Opcodes SMSG_EXPECTED_SPAM_RECORDS = 0x48E7, SMSG_EXPLORATION_EXPERIENCE = 0xEE7, SMSG_FEATURE_SYSTEM_STATUS = 0x70CE, - SMSG_FLIGHT_SPLINE_SYNC = 0x1C63, SMSG_FISH_ESCAPED = 0x9C66, SMSG_FISH_NOT_HOOKED = 0x18C3, + SMSG_FLIGHT_SPLINE_SYNC = 0x1C63, SMSG_FORCEACTIONSHOW = 0x00, SMSG_FORCED_DEATH_UPDATE = 0x00, SMSG_FORCE_DISPLAY_UPDATE = 0x00, @@ -693,9 +697,9 @@ enum Opcodes SMSG_FORCE_RUN_BACK_SPEED_CHANGE = 0x00, SMSG_FORCE_RUN_SPEED_CHANGE = 0x00, SMSG_FORCE_SEND_QUEUED_PACKETS = 0x1380, - SMSG_FORCE_TURN_RATE_CHANGE = 0x00, - SMSG_FORCE_SWIM_SPEED_CHANGE = 0x00, SMSG_FORCE_SWIM_BACK_SPEED_CHANGE = 0x00, + SMSG_FORCE_SWIM_SPEED_CHANGE = 0x00, + SMSG_FORCE_TURN_RATE_CHANGE = 0x00, SMSG_FORCE_WALK_SPEED_CHANGE = 0x00, SMSG_FRIEND_STATUS = 0xD852, SMSG_GAMEOBJECT_CUSTOM_ANIM = 0x00, @@ -706,14 +710,14 @@ enum Opcodes SMSG_GAMESPEED_SET = 0x5ACA, SMSG_GAMETIME_SET = 0x9C4A, SMSG_GAMETIME_UPDATE = 0x18E3, - SMSG_GMRESPONSE_STATUS_UPDATE = 0x00, SMSG_GMRESPONSE_RECEIVED = 0x00, + SMSG_GMRESPONSE_STATUS_UPDATE = 0x00, + SMSG_GMTICKET_CREATE = 0x00, SMSG_GMTICKET_DELETETICKET = 0x00, SMSG_GMTICKET_GETTICKET = 0x00, - SMSG_GM_MESSAGECHAT = 0x8E5E, - SMSG_GMTICKET_CREATE = 0x00, SMSG_GMTICKET_SYSTEMSTATUS = 0x9C7E, SMSG_GMTICKET_UPDATETEXT = 0x00, + SMSG_GM_MESSAGECHAT = 0x8E5E, SMSG_GODMODE = 0xDEEE, SMSG_GOSSIP_COMPLETE = 0xDE7B, SMSG_GOSSIP_MESSAGE = 0xCCEB, @@ -726,7 +730,7 @@ enum Opcodes SMSG_GROUP_LIST = 0x00, SMSG_GROUP_SET_LEADER = 0xCCF2, SMSG_GROUP_UNINVITE = 0x00, - SMSG_GUILDFINDER_SEARCH_RESULT = 0xE0CE, // New 4.x + SMSG_GUILDFINDER_SEARCH_RESULT = 0xE0CE, SMSG_GUILD_BANK_LIST = 0x5EFB, SMSG_GUILD_COMMAND_RESULT = 0xDAD7, SMSG_GUILD_DECLINE = 0x1E5B, @@ -739,12 +743,12 @@ enum Opcodes SMSG_GUILD_RANK = 0xA6EC, SMSG_GUILD_RANKS_UPDATE = 0x00, SMSG_GUILD_REWARDS_LIST = 0x00, - SMSG_GUILD_SET_NOTE = 0xB6CE, // New 4.x ? SMSG_GUILD_ROSTER = 0x664C, + SMSG_GUILD_SET_NOTE = 0xB6CE, SMSG_GUILD_TRADESKILL_UPDATE = 0x00, SMSG_GUILD_UPDATE_ROSTER = 0x00, SMSG_GUILD_XP_UPDATE = 0x00, - SMSG_HIGHEST_THREAT_UPDATE = 0x00, + SMSG_HIGHEST_THREAT_UPDATE = 0x5E7B, SMSG_INITIALIZE_FACTIONS = 0xCC6F, SMSG_INITIAL_SPELLS = 0x88FE, SMSG_INIT_CURRENCY = 0x227E, @@ -757,9 +761,9 @@ enum Opcodes SMSG_INSTANCE_RESET = 0xDAC2, SMSG_INSTANCE_RESET_FAILED = 0xCEFE, SMSG_INSTANCE_SAVE_CREATED = 0xCE56, - SMSG_INVALID_PROMOTION_CODE = 0xD8FE, SMSG_INVALIDATE_DANCE = 0x1EEF, SMSG_INVALIDATE_PLAYER = 0x5C5F, + SMSG_INVALID_PROMOTION_CODE = 0xD8FE, SMSG_INVENTORY_CHANGE_FAILURE = 0x00, SMSG_ITEM_COOLDOWN = 0x00, SMSG_ITEM_ENCHANT_TIME_UPDATE = 0x00, @@ -775,6 +779,7 @@ enum Opcodes SMSG_LEARNED_DANCE_MOVES = 0xE52, SMSG_LEARNED_SPELL = 0x88D3, SMSG_LEVELUP_INFO = 0x9A73, + SMSG_LFG_BOOT_PLAYER = 0x00, SMSG_LFG_DISABLED = 0x00, SMSG_LFG_JOIN_RESULT = 0x00, SMSG_LFG_OFFER_CONTINUE = 0x00, @@ -787,9 +792,9 @@ enum Opcodes SMSG_LFG_ROLE_CHECK_UPDATE = 0x00, SMSG_LFG_ROLE_CHOSEN = 0x00, SMSG_LFG_TELEPORT_DENIED = 0x00, - SMSG_LFG_UPDATE_SEARCH = 0x00, SMSG_LFG_UPDATE_PARTY = 0x00, SMSG_LFG_UPDATE_PLAYER = 0x00, + SMSG_LFG_UPDATE_SEARCH = 0x00, SMSG_LIST_INVENTORY = 0x264C, SMSG_LOGIN_SETTIMESPEED = 0x5ECA, SMSG_LOGIN_VERIFY_WORLD = 0xC86E, @@ -821,23 +826,23 @@ enum Opcodes SMSG_MONSTER_MOVE = 0x4C53, SMSG_MONSTER_MOVE_TRANSPORT = 0x88FB, SMSG_MOTD = 0xCA4B, - SMSG_MOUNTSPECIAL_ANIM = 0x9E77, SMSG_MOUNTRESULT = 0x00, + SMSG_MOUNTSPECIAL_ANIM = 0x9E77, SMSG_MOVE_FEATHER_FALL = 0x00, + SMSG_MOVE_KNOCK_BACK = 0x00, + SMSG_MOVE_LAND_WALK = 0x00, SMSG_MOVE_NORMAL_FALL = 0x00, SMSG_MOVE_SET_CAN_FLY = 0x00, + SMSG_MOVE_SET_COLLISION_HGT = 0x00, SMSG_MOVE_SET_HOVER = 0x00, + SMSG_MOVE_SET_WALK_IN_AIR = 0x00, SMSG_MOVE_UNSET_CAN_FLY = 0x00, SMSG_MOVE_UNSET_HOVER = 0x00, - SMSG_MOVE_WATER_WALK = 0x00, - SMSG_MOVE_LAND_WALK = 0x00, - CMSG_MOVE_HOVER_ACK = 0x00, - SMSG_MOVE_KNOCK_BACK = 0x00, - SMSG_MOVE_SET_WALK_IN_AIR = 0x00, SMSG_MOVE_UNSET_WALK_IN_AIR = 0x00, + SMSG_MOVE_WATER_WALK = 0x00, SMSG_MULTIPLE_PACKETS = 0xDCEA, SMSG_NAME_QUERY_RESPONSE = 0x9CE6, - SMSG_NEW_TAXI_PATH = 0xC8FF, // Might be 0x98CF + SMSG_NEW_TAXI_PATH = 0xC8FF, SMSG_NEW_WORLD = 0x00, SMSG_NOTIFICATION = 0x1A56, SMSG_NOTIFY_DANCE = 0xCE62, @@ -847,15 +852,19 @@ enum Opcodes SMSG_OFFER_PETITION_ERROR = 0x1E7F, SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA = 0x00, SMSG_OPEN_CONTAINER = 0x00, + SMSG_OVERRIDE_LIGHT = 0x00, SMSG_PAGE_TEXT_QUERY_RESPONSE = 0x18D2, - SMSG_PARTYKILLLOG = 0x00, + SMSG_PARTYKILLLOG = 0xCCC2, + SMSG_PARTY_COMMAND_RESULT = 0x00, SMSG_PARTY_MEMBER_STATS = 0xDC5A, SMSG_PARTY_MEMBER_STATS_FULL = 0x00, - SMSG_PARTY_COMMAND_RESULT = 0x00, SMSG_PAUSE_MIRROR_TIMER = 0x00, SMSG_PERIODICAURALOG = 0x00, SMSG_PETGODMODE = 0x00, SMSG_PETITION_QUERY_RESPONSE = 0xCAEE, + SMSG_PETITION_SHOWLIST = 0x8ED7, + SMSG_PETITION_SHOW_SIGNATURES = 0x4E4A, + SMSG_PETITION_SIGN_RESULTS = 0x5EE6, SMSG_PET_ACTION_FEEDBACK = 0x4E5A, SMSG_PET_ACTION_SOUND = 0x0CC7, SMSG_PET_CAST_FAILED = 0x00, @@ -863,29 +872,25 @@ enum Opcodes SMSG_PET_GUIDS = 0x5E6B, SMSG_PET_LEARNED_SPELL = 0xDC5E, SMSG_PET_MODE = 0x58DE, - SMSG_PET_NAME_QUERY_RESPONSE = 0xDCD3, SMSG_PET_NAME_INVALID = 0x00, + SMSG_PET_NAME_QUERY_RESPONSE = 0xDCD3, SMSG_PET_REMOVED_SPELL = 0x18F6, SMSG_PET_SPELLS = 0x5A43, SMSG_PET_TAME_FAILURE = 0x00, SMSG_PET_UPDATE_COMBO_POINTS = 0x1A47, - SMSG_PETITION_SHOWLIST = 0x8ED7, - SMSG_PETITION_SHOW_SIGNATURES = 0x4E4A, - SMSG_PETITION_SIGN_RESULTS = 0x5EE6, - SMSG_PLAYER_MOVE = 0xF66C, SMSG_PLAYED_TIME = 0x187F, SMSG_PLAYERBINDERROR = 0x5A4F, SMSG_PLAYERBOUND = 0x00, SMSG_PLAYER_DIFFICULTY_CHANGE = 0xD846, - SMSG_BATTLEGROUND_PLAYER_LEFT = 0x00, + SMSG_PLAYER_MOVE = 0xF66C, SMSG_PLAYER_SKINNED = 0xDA63, SMSG_PLAYER_VEHICLE_DATA = 0x186E, SMSG_PLAY_DANCE = 0x8CFE, SMSG_PLAY_MUSIC = 0x00, SMSG_PLAY_OBJECT_SOUND = 0x00, SMSG_PLAY_SOUND = 0x4ACF, - SMSG_PLAY_SPELL_VISUAL = 0x00, SMSG_PLAY_SPELL_IMPACT = 0x00, + SMSG_PLAY_SPELL_VISUAL = 0x00, SMSG_PLAY_TIME_WARNING = 0xD857, SMSG_PONG = 0x0380, SMSG_POWER_UPDATE = 0x487E, @@ -900,11 +905,13 @@ enum Opcodes SMSG_QUESTGIVER_QUEST_COMPLETE = 0x24EE, SMSG_QUESTGIVER_QUEST_DETAILS = 0xCE5F, SMSG_QUESTGIVER_QUEST_FAILED = 0xD8FF, + SMSG_QUESTGIVER_QUEST_INVALID = 0x00, SMSG_QUESTGIVER_QUEST_LIST = 0xDEF6, SMSG_QUESTGIVER_REQUEST_ITEMS = 0x9CEE, SMSG_QUESTGIVER_STATUS = 0xC846, SMSG_QUESTGIVER_STATUS_MULTIPLE = 0xDCFF, SMSG_QUESTLOG_FULL = 0x4EDE, + SMSG_QUESTUPDATE_ADD_ITEM = 0x9CCF, SMSG_QUESTUPDATE_ADD_KILL = 0x00, SMSG_QUESTUPDATE_ADD_PVP_KILL = 0x00, SMSG_QUESTUPDATE_COMPLETE = 0x9CD6, @@ -914,11 +921,10 @@ enum Opcodes SMSG_QUEST_FORCE_REMOVED = 0x00, SMSG_QUEST_POI_QUERY_RESPONSE = 0x8CC3, SMSG_QUEST_QUERY_RESPONSE = 0x9E56, - SMSG_QUESTGIVER_QUEST_INVALID = 0x00, - SMSG_QUESTUPDATE_ADD_ITEM = 0x9CCF, SMSG_RAID_GROUP_ONLY = 0x00, SMSG_RAID_INSTANCE_INFO = 0x00, SMSG_RAID_INSTANCE_MESSAGE = 0xD862, + SMSG_RANDOMIZE_CHAR_NAME = 0xF0DC, SMSG_READ_ITEM_FAILED = 0x00, SMSG_READ_ITEM_OK = 0x9ECE, SMSG_REALM_SPLIT = 0x1AF2, @@ -929,9 +935,9 @@ enum Opcodes SMSG_REMOVED_SPELL = 0x98FE, SMSG_REPORT_PVP_AFK_RESULT = 0x00, SMSG_REQUEST_CEMETERY_LIST_RESPONSE = 0x00, - SMSG_RESPOND_INSPECT_ACHIEVEMENTS = 0x00, SMSG_RESET_FAILED_NOTIFY = 0x00, SMSG_RESISTLOG = 0x00, + SMSG_RESPOND_INSPECT_ACHIEVEMENTS = 0x00, SMSG_RESURRECT_REQUEST = 0x00, SMSG_RESYNC_RUNES = 0x00, SMSG_RWHOIS = 0xCCE2, @@ -955,6 +961,7 @@ enum Opcodes SMSG_SHOW_BANK = 0x00, SMSG_SPELLBREAKLOG = 0x00, SMSG_SPELLDAMAGESHIELD = 0x8AFE, + SMSG_SPELLDISPELLOG = 0x00, SMSG_SPELLENERGIZELOG = 0xD8FB, SMSG_SPELLHEALLOG = 0xDE4A, SMSG_SPELLINSTAKILLLOG = 0x8ED2, @@ -962,20 +969,19 @@ enum Opcodes SMSG_SPELLLOGMISS = 0x1CFF, SMSG_SPELLNONMELEEDAMAGELOG = 0x5CCF, SMSG_SPELLORDAMAGE_IMMUNE = 0x48FA, + SMSG_SPELLSTEALLOG = 0x00, SMSG_SPELL_COOLDOWN = 0x00, SMSG_SPELL_DELAYED = 0x00, - SMSG_SPELLDISPELLOG = 0x00, SMSG_SPELL_FAILED_OTHER = 0xCE4A, SMSG_SPELL_FAILURE = 0x9A66, SMSG_SPELL_GO = 0x0A53, SMSG_SPELL_START = 0xCE43, - SMSG_SPELLSTEALLOG = 0x00, SMSG_SPELL_UPDATE_CHAIN_TARGETS = 0x00, SMSG_SPIRIT_HEALER_CONFIRM = 0x00, - SMSG_SPLINE_MOVE_WATER_WALK = 0x00, SMSG_SPLINE_MOVE_LAND_WALK = 0x00, SMSG_SPLINE_MOVE_ROOT = 0x00, SMSG_SPLINE_MOVE_UNROOT = 0x00, + SMSG_SPLINE_MOVE_WATER_WALK = 0x00, SMSG_STABLE_RESULT = 0xA5B, SMSG_STANDSTATE_UPDATE = 0x4E52, SMSG_START_MIRROR_TIMER = 0x00, @@ -985,18 +991,19 @@ enum Opcodes SMSG_SUPERCEDED_SPELL = 0xDE53, SMSG_TALENTS_INFO = 0x5EC6, SMSG_TAXINODE_STATUS = 0x8CFB, - SMSG_TOGGLE_XP_GAIN = 0x8A5B, SMSG_TEXT_EMOTE = 0x9E5A, SMSG_THREAT_CLEAR = 0x9E4A, SMSG_THREAT_REMOVE = 0x8A7E, - SMSG_THREAT_UPDATE = 0x5E7B, + SMSG_THREAT_UPDATE = 0x0CE3, // Can be SMSG_HIGHEST_THREAT_UPDATE SMSG_TIME_SYNC_REQ = 0x1009, SMSG_TITLE_EARNED = 0x1AFA, + SMSG_TOGGLE_XP_GAIN = 0x8A5B, SMSG_TOTEM_CREATED = 0x00, SMSG_TRADE_STATUS = 0x00, SMSG_TRADE_STATUS_EXTENDED = 0x00, - SMSG_TRAINER_LIST = 0xC84E, SMSG_TRAINER_BUY_RESULT = 0x00, + SMSG_TRAINER_BUY_SUCCEEDED = 0x00, + SMSG_TRAINER_LIST = 0xC84E, SMSG_TRANSFER_ABORTED = 0x0CF7, SMSG_TRANSFER_PENDING = 0xCA6E, SMSG_TRIGGER_CINEMATIC = 0xCE5B, @@ -1018,27 +1025,18 @@ enum Opcodes SMSG_USERLIST_ADD = 0x4CEE, SMSG_USERLIST_REMOVE = 0x9A6B, SMSG_USERLIST_UPDATE = 0x4A4B, + SMSG_VERIFY_CONNECTIVITY = 0x4F57, SMSG_VOICE_CHAT_STATUS = 0x9ADF, SMSG_VOICE_PARENTAL_CONTROLS = 0x5ADE, SMSG_VOICE_SESSION_LEAVE = 0xCE72, SMSG_VOICE_SESSION_ROSTER_UPDATE = 0x8AC7, SMSG_VOICE_SET_TALKER_MUTED = 0x8873, - SMSG_WEATHER = 0x4ECE, SMSG_WARDEN_DATA = 0x484F, + SMSG_WEATHER = 0x4ECE, SMSG_WHO = 0x4C7F, SMSG_WHOIS = 0x9CFF, SMSG_WORLD_STATE_UI_TIMER_UPDATE = 0xDE5E, SMSG_ZONE_UNDER_ATTACK = 0x8CF, - - SMSG_VERIFY_CONNECTIVITY = 0x4F57, - CMSG_VERIFY_CONNECTIVITY_RESPONSE = 0x4C52, //1280462679, // special opcode, client sends as uint32 - - SMSG_BATTLEFIELD_STATUS = 0x00, - SMSG_OVERRIDE_LIGHT = 0x00, - SMSG_RANDOMIZE_CHAR_NAME = 0xF0DC, // byte unk(0x80), string name - - CMSG_MOVE_SET_COLLISION_HGT = 0x00, - SMSG_MOVE_SET_COLLISION_HGT = 0x00, }; /// Player state diff --git a/src/server/shared/DataStores/DB2Store.h b/src/server/shared/DataStores/DB2Store.h index d1fbc5f36a3..6ebca714fe6 100644 --- a/src/server/shared/DataStores/DB2Store.h +++ b/src/server/shared/DataStores/DB2Store.h @@ -20,7 +20,7 @@ #include "DB2FileLoader.h" #include "DB2fmt.h" -#include "Logging/Log.h" +#include "Log.h" #include "Field.h" #include "DatabaseWorkerPool.h" #include "Implementation/WorldDatabase.h" diff --git a/src/server/shared/DataStores/DBCStore.h b/src/server/shared/DataStores/DBCStore.h index c5b8b6f5a21..589d331f22d 100755 --- a/src/server/shared/DataStores/DBCStore.h +++ b/src/server/shared/DataStores/DBCStore.h @@ -20,7 +20,7 @@ #define DBCSTORE_H #include "DBCFileLoader.h" -#include "Logging/Log.h" +#include "Log.h" #include "Field.h" #include "DatabaseWorkerPool.h" #include "Implementation/WorldDatabase.h" diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h index 2d5dbc0d3aa..d1e6289d23f 100755 --- a/src/server/shared/Packets/ByteBuffer.h +++ b/src/server/shared/Packets/ByteBuffer.h @@ -21,7 +21,7 @@ #include "Common.h" #include "Debugging/Errors.h" -#include "Logging/Log.h" +#include "Log.h" #include "Utilities/ByteConverter.h" -- cgit v1.2.3 From 28a80eb0a66aa18bc93d65eec7d333dee2bb09e6 Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Thu, 12 Jan 2012 15:07:06 +0000 Subject: Core/Misc: - 41 talents points instead of 71. - Add baseGain formula for 81-85. - Drop RACE_GILNEAN. - Add language for WORGEN & GOBLIN. - Rename SKILL_LANG_GILNEAN to SKILL_LANG_WORGEN. --- src/server/game/DataStores/DBCStores.h | 3 ++- src/server/game/Globals/ObjectMgr.cpp | 4 +++- src/server/game/Miscellaneous/Formulas.h | 3 +++ src/server/game/Miscellaneous/SharedDefines.h | 10 ++++++---- src/server/game/Server/Protocol/Handlers/MiscHandler.cpp | 2 +- src/server/game/Server/Protocol/Opcodes.h | 4 ++-- 6 files changed, 17 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h index 0278a2ace99..635d319abbb 100755 --- a/src/server/game/DataStores/DBCStores.h +++ b/src/server/game/DataStores/DBCStores.h @@ -50,7 +50,8 @@ enum ContentLevels { CONTENT_1_60 = 0, CONTENT_61_70, - CONTENT_71_80 + CONTENT_71_80, + CONTENT_81_85 }; ContentLevels GetContentLevelsForMapAndZone(uint32 mapid, uint32 zoneId); diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 8c14c0b04fc..6d9fbbc435d 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -179,7 +179,9 @@ LanguageDesc lang_description[LANGUAGES_COUNT] = { LANG_DRAENEI, 29932, SKILL_LANG_DRAENEI }, { LANG_ZOMBIE, 0, 0 }, { LANG_GNOMISH_BINARY, 0, 0 }, - { LANG_GOBLIN_BINARY, 0, 0 } + { LANG_GOBLIN_BINARY, 0, 0 }, + { LANG_WORGEN, 69270, SKILL_LANG_WORGEN }, + { LANG_GOBLIN, 69269, SKILL_LANG_GOBLIN } }; LanguageDesc const* GetLanguageDescByID(uint32 lang) diff --git a/src/server/game/Miscellaneous/Formulas.h b/src/server/game/Miscellaneous/Formulas.h index 4faacc1f7b7..27397837265 100755 --- a/src/server/game/Miscellaneous/Formulas.h +++ b/src/server/game/Miscellaneous/Formulas.h @@ -126,6 +126,9 @@ namespace Trinity case CONTENT_71_80: nBaseExp = 580; break; + case CONTENT_81_85: + nBaseExp = 1878; + break; default: sLog->outError("BaseGain: Unsupported content level %u", content); nBaseExp = 45; diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index c8199f2c98a..8fac594520e 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -79,11 +79,11 @@ enum Races //RACE_NORTHREND_SKELETON = 20, //RACE_ICE_TROLL = 21, RACE_WORGEN = 22, - RACE_GILNEAN = 23 + //RACE_GILNEAN = 23 }; // max+1 for player race -#define MAX_RACES 24 +#define MAX_RACES 23 #define RACEMASK_ALL_PLAYABLE \ ((1<<(RACE_HUMAN-1)) |(1<<(RACE_ORC-1)) |(1<<(RACE_DWARF-1)) | \ @@ -641,10 +641,12 @@ enum Language LANG_ZOMBIE = 36, LANG_GNOMISH_BINARY = 37, LANG_GOBLIN_BINARY = 38, + LANG_WORGEN = 39, + LANG_GOBLIN = 40, LANG_ADDON = 0xFFFFFFFF // used by addons, in 2.4.0 not exist, replaced by messagetype? }; -#define LANGUAGES_COUNT 19 +#define LANGUAGES_COUNT 21 enum TeamId { @@ -2673,7 +2675,7 @@ enum SkillType SKILL_PET_EXOTIC_SPIRIT_BEAST = 788, SKILL_RACIAL_WORGEN = 789, SKILL_RACIAL_GOBLIN = 790, - SKILL_LANG_GILNEAN = 791, + SKILL_LANG_WORGEN = 791, SKILL_LANG_GOBLIN = 792, SKILL_ARCHAEOLOGY = 794, SKILL_GENERAL_HUNTER = 795, diff --git a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp b/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp index 7ffadb7bad8..d51afc5eaf1 100755 --- a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp @@ -1207,7 +1207,7 @@ void WorldSession::HandleInspectOpcode(WorldPacket& recv_data) if (!player) // wrong player return; - uint32 talent_points = 0x47; + uint32 talent_points = 41; uint32 guid_size = player->GetPackGUID().wpos(); WorldPacket data(SMSG_INSPECT_TALENT, guid_size+4+talent_points); data.append(player->GetPackGUID()); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 645701be817..d4c19057d6f 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -173,7 +173,7 @@ enum Opcodes CMSG_FORCE_WALK_SPEED_CHANGE_ACK = 0x00, CMSG_GAMEOBJECT_QUERY = 0xCEFF, CMSG_GAMEOBJ_REPORT_USE = 0x00, - CMSG_GAMEOBJ_USE = 0x9A4A, // might be CMSG_GAMEOBJ_USE + CMSG_GAMEOBJ_USE = 0x9A4A, // might be CMSG_GAMEOBJ_REPORT_USE CMSG_GAMESPEED_SET = 0x00, CMSG_GAMETIME_SET = 0x00, CMSG_GETDEATHBINDZONE = 0x00, @@ -994,7 +994,7 @@ enum Opcodes SMSG_TEXT_EMOTE = 0x9E5A, SMSG_THREAT_CLEAR = 0x9E4A, SMSG_THREAT_REMOVE = 0x8A7E, - SMSG_THREAT_UPDATE = 0x0CE3, // Can be SMSG_HIGHEST_THREAT_UPDATE + SMSG_THREAT_UPDATE = 0x0CE3, SMSG_TIME_SYNC_REQ = 0x1009, SMSG_TITLE_EARNED = 0x1AFA, SMSG_TOGGLE_XP_GAIN = 0x8A5B, -- cgit v1.2.3 From 629694cbadad171534304004dab4439553369c17 Mon Sep 17 00:00:00 2001 From: Rat Date: Thu, 12 Jan 2012 17:59:03 +0100 Subject: Core: Some opcodes + handler fixes + cleanup --- src/server/game/Entities/Player/Player.cpp | 14 ++---------- src/server/game/Entities/Player/Player.h | 34 +++++++++++++++-------------- src/server/game/Server/Protocol/Opcodes.cpp | 12 +++++----- src/server/game/Server/Protocol/Opcodes.h | 5 +---- 4 files changed, 26 insertions(+), 39 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 975599eae01..49f639bfa14 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -21814,18 +21814,8 @@ void Player::SendTransferAborted(uint32 mapid, TransferAbortReason reason, uint8 { WorldPacket data(SMSG_TRANSFER_ABORTED, 4+2); data << uint32(mapid); - data << uint8(reason); // transfer abort reason - switch (reason) - { - case TRANSFER_ABORT_INSUF_EXPAN_LVL: - case TRANSFER_ABORT_DIFFICULTY: - case TRANSFER_ABORT_UNIQUE_MESSAGE: - // these are the ONLY cases that have an extra argument in the packet!!! - data << uint8(arg); - break; - default: - break; - } + data << uint8(reason); // transfer abort reason + data << uint8(arg); GetSession()->SendPacket(&data); } diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index aac005660ea..f27e427b435 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -708,22 +708,24 @@ enum TradeSlots enum TransferAbortReason { - TRANSFER_ABORT_NONE = 0x00, - TRANSFER_ABORT_ERROR = 0x01, - TRANSFER_ABORT_MAX_PLAYERS = 0x02, // Transfer Aborted: instance is full - TRANSFER_ABORT_NOT_FOUND = 0x03, // Transfer Aborted: instance not found - TRANSFER_ABORT_TOO_MANY_INSTANCES = 0x04, // You have entered too many instances recently. - TRANSFER_ABORT_ZONE_IN_COMBAT = 0x06, // Unable to zone in while an encounter is in progress. - TRANSFER_ABORT_INSUF_EXPAN_LVL = 0x07, // You must have expansion installed to access this area. - TRANSFER_ABORT_DIFFICULTY = 0x08, // difficulty mode is not available for %s. - TRANSFER_ABORT_UNIQUE_MESSAGE = 0x09, // Until you've escaped TLK's grasp, you cannot leave this place! - TRANSFER_ABORT_TOO_MANY_REALM_INSTANCES = 0x0A, // Additional instances cannot be launched, please try again later. - TRANSFER_ABORT_NEED_GROUP = 0x0B, // 3.1 - TRANSFER_ABORT_NOT_FOUND2 = 0x0C, // 3.1 - TRANSFER_ABORT_NOT_FOUND3 = 0x0D, // 3.1 - TRANSFER_ABORT_NOT_FOUND4 = 0x0E, // 3.2 - TRANSFER_ABORT_REALM_ONLY = 0x0F, // All players on party must be from the same realm. - TRANSFER_ABORT_MAP_NOT_ALLOWED = 0x10, // Map can't be entered at this time. + TRANSFER_ABORT_NONE = 0x00, + TRANSFER_ABORT_ERROR = 0x01, + TRANSFER_ABORT_MAX_PLAYERS = 0x02, // Transfer Aborted: instance is full + TRANSFER_ABORT_NOT_FOUND = 0x03, // Transfer Aborted: instance not found + TRANSFER_ABORT_TOO_MANY_INSTANCES = 0x04, // You have entered too many instances recently. + TRANSFER_ABORT_ZONE_IN_COMBAT = 0x06, // Unable to zone in while an encounter is in progress. + TRANSFER_ABORT_INSUF_EXPAN_LVL = 0x07, // You must have expansion installed to access this area. + TRANSFER_ABORT_DIFFICULTY = 0x08, // difficulty mode is not available for %s. + TRANSFER_ABORT_UNIQUE_MESSAGE = 0x09, // Until you've escaped TLK's grasp, you cannot leave this place! + TRANSFER_ABORT_TOO_MANY_REALM_INSTANCES = 0x0A, // Additional instances cannot be launched, please try again later. + TRANSFER_ABORT_NEED_GROUP = 0x0B, // 3.1 + TRANSFER_ABORT_NOT_FOUND2 = 0x0C, // 3.1 + TRANSFER_ABORT_NOT_FOUND3 = 0x0D, // 3.1 + TRANSFER_ABORT_NOT_FOUND4 = 0x0E, // 3.2 + TRANSFER_ABORT_REALM_ONLY = 0x0F, // All players on party must be from the same realm. + TRANSFER_ABORT_MAP_NOT_ALLOWED = 0x10, // Map can't be entered at this time. + TRANSFER_ABORT_LOCKED_TO_DIFFERENT_INSTANCE = 0x12, // 4.2.2 + TRANSFER_ABORT_ALREADY_COMPLETED_ENCOUNTER = 0x13, // 4.2.2 }; enum InstanceResetWarningType diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 495f261eaff..cdb59c69bbf 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -105,9 +105,9 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_CHAR_DELETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_PLAYER_LOGIN, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayerLoginOpcode ); DEFINE_OPCODE_HANDLER(CMSG_LOAD_SCREEN, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleLoadScreenOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_NEW_WORLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_NEW_WORLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TRANSFER_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_TRANSFER_ABORTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TRANSFER_ABORTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CHARACTER_LOGIN_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LOGIN_SETTIMESPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GAMETIME_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -129,10 +129,8 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_PET_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_QUERY, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildQueryOpcode ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_ITEM_QUERY_SINGLE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleItemQuerySingleOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_ITEM_QUERY_MULTIPLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_ITEM_QUERY_SINGLE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ITEM_QUERY_MULTIPLE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(CMSG_ITEM_QUERY_SINGLE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleItemQuerySingleOpcode ); + DEFINE_OPCODE_HANDLER(SMSG_DB_REPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_PAGE_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePageTextQueryOpcode ); DEFINE_OPCODE_HANDLER(SMSG_PAGE_TEXT_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_QUEST_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestQueryOpcode ); @@ -144,7 +142,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_WHO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWhoOpcode ); DEFINE_OPCODE_HANDLER(SMSG_WHO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_WHOIS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWhoisOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_WHOIS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_WHOIS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_CONTACT_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleContactListOpcode ); DEFINE_OPCODE_HANDLER(SMSG_CONTACT_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_FRIEND_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index d4c19057d6f..10cd943e1b4 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -236,7 +236,6 @@ enum Opcodes CMSG_INITIATE_TRADE = 0x00, CMSG_INSPECT = 0x9A7B, CMSG_INSTANCE_LOCK_WARNING_RESPONSE = 0x8CF7, - CMSG_ITEM_QUERY_MULTIPLE = 0x00, CMSG_ITEM_QUERY_SINGLE = 0x8E2, CMSG_ITEM_REFUND = 0xCC3, CMSG_ITEM_REFUND_INFO = 0x1C7E, @@ -769,8 +768,6 @@ enum Opcodes SMSG_ITEM_ENCHANT_TIME_UPDATE = 0x00, SMSG_ITEM_NAME_QUERY_RESPONSE = 0x00, SMSG_ITEM_PUSH_RESULT = 0x8EFB, - SMSG_ITEM_QUERY_MULTIPLE_RESPONSE = 0x00, - SMSG_ITEM_QUERY_SINGLE_RESPONSE = 0x00, SMSG_ITEM_REFUND_INFO_RESPONSE = 0x304E, SMSG_ITEM_REFUND_RESULT = 0x60DC, SMSG_ITEM_TEXT_QUERY_RESPONSE = 0x984A, @@ -843,7 +840,7 @@ enum Opcodes SMSG_MULTIPLE_PACKETS = 0xDCEA, SMSG_NAME_QUERY_RESPONSE = 0x9CE6, SMSG_NEW_TAXI_PATH = 0xC8FF, - SMSG_NEW_WORLD = 0x00, + SMSG_NEW_WORLD = 0x647E, SMSG_NOTIFICATION = 0x1A56, SMSG_NOTIFY_DANCE = 0xCE62, SMSG_NOTIFY_DEST_LOC_SPELL_CAST = 0x00, -- cgit v1.2.3 From bb35989a7e6f1532c1147a07408aabde8ce5a077 Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Thu, 12 Jan 2012 17:11:25 +0000 Subject: Core/Loot: "Fix" SMSG_LOOT_RESPONSE Closes #4768 --- src/server/game/Entities/Player/Player.cpp | 4 ++-- src/server/game/Loot/LootMgr.cpp | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 49f639bfa14..9ee8a0c5c59 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -3173,7 +3173,7 @@ void Player::InitStatsForLevel(bool reapplyMods) // reset before any aura state sources (health set/aura apply) SetUInt32Value(UNIT_FIELD_AURASTATE, 0); - UpdateSkillsForLevel (); + UpdateSkillsForLevel(); // set default cast time multiplier SetFloatValue(UNIT_MOD_CAST_SPEED, 1.0f); @@ -9000,7 +9000,7 @@ void Player::SendLoot(uint64 guid, LootType loot_type) // need know merged fishing/corpse loot type for achievements loot->loot_type = loot_type; - WorldPacket data(SMSG_LOOT_RESPONSE, (9+50)); // we guess size + WorldPacket data(SMSG_LOOT_RESPONSE, 8 + 1 + 50 + 1 + 1); // we guess size data << uint64(guid); data << uint8(loot_type); diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index 0d649ddc56d..a0ede8c7eef 100755 --- a/src/server/game/Loot/LootMgr.cpp +++ b/src/server/game/Loot/LootMgr.cpp @@ -816,6 +816,7 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv) size_t count_pos = b.wpos(); // pos of item count byte b << uint8(0); // item count placeholder + b << uint8(0); // 4.x unknown switch (lv.permission) { -- cgit v1.2.3 From ba45ff0c61dd0e154b5b805b129e046ceb20b31e Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 12 Jan 2012 17:15:27 +0000 Subject: Core/Player: Fix and enable SMSG_LEVELUP_INFO + 2 new opcodes by Kaelima --- src/server/game/Entities/Player/Player.cpp | 13 ++++--------- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- src/server/game/Server/Protocol/Opcodes.h | 4 ++-- 3 files changed, 7 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 9ee8a0c5c59..b104ed8e5c4 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -3030,23 +3030,18 @@ void Player::GiveLevel(uint8 level) sObjectMgr->GetPlayerClassLevelInfo(getClass(), level, &classInfo); // send levelup info to client - WorldPacket data(SMSG_LEVELUP_INFO, (4+4+MAX_POWERS*4+MAX_STATS*4)); + uint32 maxPowers = 5; // 4.x + WorldPacket data(SMSG_LEVELUP_INFO, (4+4+maxPowers*4+MAX_STATS*4)); data << uint32(level); data << uint32(int32(classInfo.basehealth) - int32(GetCreateHealth())); - // for (int i = 0; i < MAX_POWERS; ++i) // Powers loop (0-10) + // for (int i = 0; i < maxPowers; ++i) // Powers loop (0-10) data << uint32(int32(classInfo.basemana) - int32(GetCreateMana())); data << uint32(0); data << uint32(0); data << uint32(0); data << uint32(0); - data << uint32(0); - data << uint32(0); - data << uint32(0); - data << uint32(0); - data << uint32(0); - data << uint32(0); // end for - for (uint8 i = STAT_STRENGTH; i < MAX_STATS; ++i) // Stats loop (0-4) + for (uint8 i = STAT_STRENGTH; i < MAX_STATS; ++i) // Stats loop (0-4) data << uint32(int32(info.stats[i]) - GetCreateStat(Stats(i))); GetSession()->SendPacket(&data); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index cdb59c69bbf..41d15786edc 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -529,7 +529,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_AURACASTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_RECLAIM_CORPSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReclaimCorpseOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_WRAP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWrapItemOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_LEVELUP_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LEVELUP_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(MSG_MINIMAP_PING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMinimapPingOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_RESISTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ENCHANTMENTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 10cd943e1b4..635f2cc1694 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -205,7 +205,7 @@ enum Opcodes CMSG_GROUP_SET_LEADER = 0xCEC7, CMSG_GROUP_SWAP_SUB_GROUP = 0x5AD7, CMSG_GROUP_UNINVITE = 0x00, - CMSG_GROUP_UNINVITE_GUID = 0x00, + CMSG_GROUP_UNINVITE_GUID = 0xCE66, CMSG_GUILDFINDER_JOIN = 0x68C5, CMSG_GUILD_ACCEPT = 0x00, CMSG_GUILD_BANKER_ACTIVATE = 0x4E77, @@ -726,7 +726,7 @@ enum Opcodes SMSG_GROUP_DESTROYED = 0x00, SMSG_GROUP_INVITE = 0x00, SMSG_GROUP_JOINED_BATTLEGROUND = 0x265C, - SMSG_GROUP_LIST = 0x00, + SMSG_GROUP_LIST = 0x5C7E, SMSG_GROUP_SET_LEADER = 0xCCF2, SMSG_GROUP_UNINVITE = 0x00, SMSG_GUILDFINDER_SEARCH_RESULT = 0xE0CE, -- cgit v1.2.3 From 506e7913f8ece7ca2854cf9e6613af8a7d69d895 Mon Sep 17 00:00:00 2001 From: Subv2112 Date: Wed, 11 Jan 2012 21:54:28 -0500 Subject: Core/IO: Defined some opcodes and adjusted their handlers Signed-off-by: Subv2112 Signed-off-by: Nay --- src/server/game/Entities/Player/Player.cpp | 2 -- .../game/Server/Protocol/Handlers/ItemHandler.cpp | 15 ++++++++------- src/server/game/Server/Protocol/Opcodes.cpp | 17 +++++++++-------- 3 files changed, 17 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index b104ed8e5c4..b98b9c114fe 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -13282,8 +13282,6 @@ void Player::SendBuyError(BuyResult msg, Creature* creature, uint32 item, uint32 WorldPacket data(SMSG_BUY_FAILED, (8+4+4+1)); data << uint64(creature ? creature->GetGUID() : 0); data << uint32(item); - if (param > 0) - data << uint32(param); data << uint8(msg); GetSession()->SendPacket(&data); } diff --git a/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp b/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp index fb8ecb7a8e0..fc69569ec25 100755 --- a/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp @@ -680,11 +680,12 @@ void WorldSession::HandleBuyItemInSlotOpcode(WorldPacket & recv_data) void WorldSession::HandleBuyItemOpcode(WorldPacket & recv_data) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_BUY_ITEM"); - uint64 vendorguid; + uint64 vendorguid, unk2; // unk2 can be 0? uint32 item, slot, count; - uint8 unk1; + uint8 unk1; // if this is == 2 then the count might be multiplied by 100 + int8 unk3; // only known value = -1, according to the client it can take more values - recv_data >> vendorguid >> item >> slot >> count >> unk1; + recv_data >> vendorguid >> unk1 >> item >> slot >> count >> unk2 >> unk3; // client expects count starting at 1, and we send vendorslot+1 to client already if (slot > 0) @@ -1321,15 +1322,15 @@ void WorldSession::HandleCancelTempEnchantmentOpcode(WorldPacket& recv_data) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CANCEL_TEMP_ENCHANTMENT"); - uint32 eslot; + uint32 slot; - recv_data >> eslot; + recv_data >> slot; // apply only to equipped item - if (!Player::IsEquipmentPos(INVENTORY_SLOT_BAG_0, eslot)) + if (!Player::IsEquipmentPos(INVENTORY_SLOT_BAG_0, slot)) return; - Item* item = GetPlayer()->GetItemByPos(INVENTORY_SLOT_BAG_0, eslot); + Item* item = GetPlayer()->GetItemByPos(INVENTORY_SLOT_BAG_0, slot); if (!item) return; diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 41d15786edc..13854c34655 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -224,11 +224,11 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNMODERATOR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelUnmoderator ); //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_MUTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelMute ); //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNMUTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelUnmute ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelInvite ); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelInvite ); //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_KICK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelKick ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_BAN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelBan ); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_BAN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelBan ); //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNBAN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelUnban ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_ANNOUNCEMENTS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelAnnouncements ); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_ANNOUNCEMENTS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelAnnouncements ); //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_MODERATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_DESTROY_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -479,10 +479,10 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_LIST_INVENTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_SELL_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSellItemOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_SELL_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_BUY_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyItemOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_BUY_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_BUY_ITEM_IN_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyItemInSlotOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_BUY_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BUY_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BUY_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BUY_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_TAXICLEARALLNODES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_TAXIENABLEALLNODES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_TAXISHOWNODES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -500,7 +500,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_BINDER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBinderActivateOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_PLAYERBINDERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_BANKER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBankerActivateOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_BANKER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBankerActivateOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_SHOW_BANK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_BUY_BANK_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyBankSlotOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_BUY_BANK_SLOT_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -950,7 +950,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_ARENA_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(MSG_INSPECT_ARENA_TEAMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectArenaTeamsOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_DEATH_RELEASE_LOC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_TEMP_ENCHANTMENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelTempEnchantmentOpcode); + DEFINE_OPCODE_HANDLER(CMSG_CANCEL_TEMP_ENCHANTMENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelTempEnchantmentOpcode); //DEFINE_OPCODE_HANDLER(SMSG_FORCED_DEATH_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_SET_HONOR_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_SET_ARENA_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -1379,6 +1379,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_RANDOMIZE_CHAR_NAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRandomizeCharNameOpcode ); DEFINE_OPCODE_HANDLER(SMSG_RANDOMIZE_CHAR_NAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAYER_MOVE, STATUS_AUTHED, PROCESS_THREADSAFE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_REQUEST_SCORE_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); Need to send the response #undef DEFINE_OPCODE_HANDLER }; -- cgit v1.2.3 From dfb8764e00e41b34fcb618da83fdb0f8162bae50 Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 12 Jan 2012 18:21:20 +0000 Subject: Core/Opcodes: More opcodes by Subv Closes #4783 --- src/server/game/Entities/Player/Player.cpp | 5 ++--- src/server/game/Server/Protocol/Opcodes.h | 18 +++++++++--------- 2 files changed, 11 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index b98b9c114fe..a14c6681c52 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -3030,11 +3030,10 @@ void Player::GiveLevel(uint8 level) sObjectMgr->GetPlayerClassLevelInfo(getClass(), level, &classInfo); // send levelup info to client - uint32 maxPowers = 5; // 4.x - WorldPacket data(SMSG_LEVELUP_INFO, (4+4+maxPowers*4+MAX_STATS*4)); + WorldPacket data(SMSG_LEVELUP_INFO, (4+4+MAX_STORED_POWERS*4+MAX_STATS*4)); data << uint32(level); data << uint32(int32(classInfo.basehealth) - int32(GetCreateHealth())); - // for (int i = 0; i < maxPowers; ++i) // Powers loop (0-10) + // for (int i = 0; i < MAX_STORED_POWERS; ++i) // Powers loop (0-10) data << uint32(int32(classInfo.basemana) - int32(GetCreateMana())); data << uint32(0); data << uint32(0); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 635f2cc1694..314b21f4d5a 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -70,10 +70,10 @@ enum Opcodes CMSG_AUTOSTORE_GROUND_ITEM = 0x00, CMSG_AUTOSTORE_LOOT_ITEM = 0xD876, CMSG_AUTO_DECLINE_GUILD_INVITES = 0x586F, - CMSG_BANKER_ACTIVATE = 0x00, + CMSG_BANKER_ACTIVATE = 0x0A5A, CMSG_BATTLEFIELD_JOIN = 0x225, CMSG_BATTLEFIELD_LIST = 0x32A4, - CMSG_BATTLEFIELD_REQUEST_SCORE_DATA = 0x00, + CMSG_BATTLEFIELD_REQUEST_SCORE_DATA = 0x85A5, CMSG_BATTLEFIELD_STATUS = 0x00, CMSG_BATTLEMASTER_JOIN_ARENA = 0x00, CMSG_BEGIN_TRADE = 0x3724, @@ -83,7 +83,7 @@ enum Opcodes CMSG_BUSY_TRADE = 0x00, CMSG_BUYBACK_ITEM = 0xDEE6, CMSG_BUY_BANK_SLOT = 0x487F, - CMSG_BUY_ITEM = 0x00, + CMSG_BUY_ITEM = 0x1E5A, CMSG_CALENDAR_ADD_EVENT = 0x1CF3, CMSG_CALENDAR_ARENA_TEAM = 0x00, CMSG_CALENDAR_CONTEXT_EVENT_SIGNUP = 0x00, @@ -103,14 +103,14 @@ enum Opcodes CMSG_CANCEL_CHANNELLING = 0xC8FE, CMSG_CANCEL_GROWTH_AURA = 0xDEF7, CMSG_CANCEL_MOUNT_AURA = 0xD8F3, - CMSG_CANCEL_TEMP_ENCHANTMENT = 0x00, + CMSG_CANCEL_TEMP_ENCHANTMENT = 0x0ACE, CMSG_CANCEL_TRADE = 0x35A5, CMSG_CAST_SPELL = 0x5E4E, CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE = 0x00, - CMSG_CHANNEL_ANNOUNCEMENTS = 0x00, - CMSG_CHANNEL_BAN = 0x00, + CMSG_CHANNEL_ANNOUNCEMENTS = 0x70D1, + CMSG_CHANNEL_BAN = 0x2041, CMSG_CHANNEL_DISPLAY_LIST = 0x00, - CMSG_CHANNEL_INVITE = 0x00, + CMSG_CHANNEL_INVITE = 0x7451, CMSG_CHANNEL_KICK = 0x00, CMSG_CHANNEL_LIST = 0x00, CMSG_CHANNEL_MODERATOR = 0x00, @@ -606,8 +606,8 @@ enum Opcodes SMSG_BINDZONEREPLY = 0x00, SMSG_BREAK_TARGET = 0xE7E, SMSG_BUY_BANK_SLOT_RESULT = 0x00, - SMSG_BUY_FAILED = 0x00, - SMSG_BUY_ITEM = 0x00, + SMSG_BUY_FAILED = 0x4A7F, + SMSG_BUY_ITEM = 0xCA67, SMSG_CALENDAR_COMMAND_RESULT = 0x9A4E, SMSG_CALENDAR_SEND_CALENDAR = 0x00, SMSG_CALENDAR_SEND_NUM_PENDING = 0x00, -- cgit v1.2.3 From 02b5a81ed37e010c848cbae319d5bf0092f93491 Mon Sep 17 00:00:00 2001 From: Rat Date: Thu, 12 Jan 2012 19:25:19 +0100 Subject: Core/Opcodes: more ops + checked handlers --- src/server/game/Server/Protocol/Opcodes.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 13854c34655..59c70966e6c 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -147,10 +147,10 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_CONTACT_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_FRIEND_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_ADD_FRIEND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddFriendOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_DEL_FRIEND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDelFriendOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_CONTACT_NOTES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetContactNotesOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_DEL_FRIEND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDelFriendOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_SET_CONTACT_NOTES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetContactNotesOpcode ); DEFINE_OPCODE_HANDLER(CMSG_ADD_IGNORE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddIgnoreOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_DEL_IGNORE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDelIgnoreOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_DEL_IGNORE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDelIgnoreOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupInviteOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_GROUP_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_CANCEL, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_NULL ); -- cgit v1.2.3 From e7c7158db0da55892983629e852ac6faf0f4f630 Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 12 Jan 2012 21:08:00 +0000 Subject: Core/Opcodes: Fix and enable SMSG_QUESTGIVER_QUEST_COMPLETE --- src/server/game/Entities/Player/Player.cpp | 21 ++++++++++++--------- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- 2 files changed, 13 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index a14c6681c52..498ff60478b 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -16185,26 +16185,29 @@ void Player::SendQuestComplete(Quest const* quest) void Player::SendQuestReward(Quest const* quest, uint32 XP, Object* questGiver) { - uint32 questid = quest->GetQuestId(); - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_QUEST_COMPLETE quest = %u", questid); - sGameEventMgr->HandleQuestComplete(questid); + uint32 questId = quest->GetQuestId(); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_QUEST_COMPLETE quest = %u", questId); + sGameEventMgr->HandleQuestComplete(questId); WorldPacket data(SMSG_QUESTGIVER_QUEST_COMPLETE, (4+4+4+4+4)); - data << uint32(questid); - + + data << int8(0x80); // 4.x unknown flag, most common value is 0x80 (it might be a single bit) + if (getLevel() < sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) { data << uint32(XP); data << uint32(quest->GetRewOrReqMoney()); } - else + else // At max level, increase gold reward { data << uint32(0); data << uint32(quest->GetRewOrReqMoney() + int32(quest->GetRewMoneyMaxLevel() * sWorld->getRate(RATE_DROP_MONEY))); } + + data << uint32(quest->GetRewardSkillPoints()); // 4.x bonus skill points + data << uint32(questId); + data << uint32(quest->GetRewardSkillId()); // 4.x bonus skill id - data << 10 * Trinity::Honor::hk_honor_at_level(getLevel(), quest->GetRewHonorMultiplier()); - data << uint32(quest->GetBonusTalents()); // bonus talents - data << uint32(quest->GetRewArenaPoints()); + data << uint32(quest->GetBonusTalents()); // bonus talents (not verified for 4.x) GetSession()->SendPacket(&data); if (quest->GetQuestCompleteScript() != 0) diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 59c70966e6c..f9f9bc967f5 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -462,7 +462,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_CHOOSE_REWARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverChooseRewardOpcode); //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_INVALID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_CANCEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverCancel ); - //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_QUESTLOG_SWAP_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestLogSwapQuest ); DEFINE_OPCODE_HANDLER(CMSG_QUESTLOG_REMOVE_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestLogRemoveQuest ); -- cgit v1.2.3 From 7163670be1ee3507219d0ed22508e10b6e71a5be Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 12 Jan 2012 23:35:08 +0100 Subject: Core/Quests: Send currency rewards in quest packets --- src/server/game/Entities/Player/Player.cpp | 6 +++--- src/server/game/Quests/QuestDef.cpp | 12 ++++++------ src/server/game/Server/WorldPacket.h | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 498ff60478b..7fa604aeac3 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -19914,12 +19914,12 @@ bool Player::IsAffectedBySpellmod(SpellInfo const* spellInfo, SpellModifier* mod void Player::AddSpellMod(SpellModifier* mod, bool apply) { sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Player::AddSpellMod %d", mod->spellId); - uint16 opcode = (mod->type == SPELLMOD_FLAT) ? SMSG_SET_FLAT_SPELL_MODIFIER : SMSG_SET_PCT_SPELL_MODIFIER; + Opcodes opcode = Opcodes((mod->type == SPELLMOD_FLAT) ? SMSG_SET_FLAT_SPELL_MODIFIER : SMSG_SET_PCT_SPELL_MODIFIER); int i = 0; flag96 _mask = 0; uint32 modTypeCount = 0; // count of mods per one mod->op - WorldPacket data(Opcodes(opcode), 1); + WorldPacket data(opcode); data << uint32(1); // count of different mod->op's in packet size_t writePos = data.wpos(); data << uint32(modTypeCount); @@ -19937,7 +19937,7 @@ void Player::AddSpellMod(SpellModifier* mod, bool apply) if ((*itr)->type == mod->type && (*itr)->mask & _mask) val += (*itr)->value; val += apply ? mod->value : -(mod->value); - + data << uint8(eff); data << float(val); ++modTypeCount; diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index 1b4613c5535..1a0b21c9615 100755 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -133,7 +133,7 @@ Quest::Quest(Field* questRecord) for (int i = 0; i < QUEST_REWARD_CURRENCY_COUNT; ++i) RewardCurrencyId[i] = questRecord[132+i].GetUInt32(); - + for (int i = 0; i < QUEST_REWARD_CURRENCY_COUNT; ++i) RewardCurrencyCount[i] = questRecord[136+i].GetUInt32(); @@ -309,7 +309,7 @@ void Quest::BuildExtraQuestInfo(WorldPacket& data, Player* player) const data << uint32(GetCharTitleId()); // CharTitleId, new 2.4.0, player gets this title (id from CharTitles) data << uint32(0); // 4.x Unk - data << uint32(0); // 4.x Unk + data << float(0); // 4.x Unk data << uint32(GetBonusTalents()); // bonus talents data << uint32(0); // 4.x Unk data << uint32(0); // 4.x Unk @@ -333,10 +333,10 @@ void Quest::BuildExtraQuestInfo(WorldPacket& data, Player* player) const data << uint32(GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast == 0) data << int32(GetRewSpellCast()); // casted spell - for (uint8 i = 0; i < 4; i++) - data << uint32(0); // 4.x Unk - for (uint8 i = 0; i < 4; i++) - data << uint32(0); // 4.x Unk + for (uint8 i = 0; i < QUEST_REWARD_CURRENCY_COUNT; i++) + data << uint32(RewardCurrencyId[i]); // 4.x Unk + for (uint8 i = 0; i < QUEST_REWARD_CURRENCY_COUNT; i++) + data << uint32(RewardCurrencyCount[i]); // 4.x Unk data << uint32(0); // 4.x Unk data << uint32(0); // 4.x Unk diff --git a/src/server/game/Server/WorldPacket.h b/src/server/game/Server/WorldPacket.h index e7bcbd8d7bf..a005a1b57fa 100644 --- a/src/server/game/Server/WorldPacket.h +++ b/src/server/game/Server/WorldPacket.h @@ -29,17 +29,17 @@ class WorldPacket : public ByteBuffer // just container for later use WorldPacket() : ByteBuffer(0), m_opcode(UNKNOWN_OPCODE) { - } - WorldPacket(Opcodes opcode, size_t res=200) : ByteBuffer(res), m_opcode(opcode) + + WorldPacket(Opcodes opcode, size_t res = 200) : ByteBuffer(res), m_opcode(opcode) { } // copy constructor - WorldPacket(const WorldPacket &packet) : ByteBuffer(packet), m_opcode(packet.m_opcode) + WorldPacket(WorldPacket const& packet) : ByteBuffer(packet), m_opcode(packet.m_opcode) { } - void Initialize(Opcodes opcode, size_t newres=200) + void Initialize(Opcodes opcode, size_t newres = 200) { clear(); _storage.reserve(newres); -- cgit v1.2.3 From 32c4bd6304415ebd6f091081a27d09c278ddd84f Mon Sep 17 00:00:00 2001 From: Nay Date: Fri, 13 Jan 2012 00:00:13 +0000 Subject: Core/Pet: "Fix" MSG_LIST_STABLED_PETS and enable a couple of handlers --- src/server/game/Server/Protocol/Handlers/NPCHandler.cpp | 1 + src/server/game/Server/Protocol/Opcodes.cpp | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp b/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp index 5d62e4b7d0d..ae06832a19e 100755 --- a/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp @@ -553,6 +553,7 @@ void WorldSession::SendStablePetCallback(PreparedQueryResult result, uint64 guid // not let move dead pet in slot if (pet && pet->isAlive() && pet->getPetType() == HUNTER_PET) { + data << uint32(0); // 4.x unknown, some kind of order? data << uint32(pet->GetCharmInfo()->GetPetNumber()); data << uint32(pet->GetEntry()); data << uint32(pet->getLevel()); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index f9f9bc967f5..0b395202f09 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -630,7 +630,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_LOGIN_VERIFY_WORLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_EXPLORATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SEND_MAIL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSendMail ); - //DEFINE_OPCODE_HANDLER(SMSG_SEND_MAIL_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SEND_MAIL_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GET_MAIL_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGetMailList ); DEFINE_OPCODE_HANDLER(SMSG_MAIL_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlefieldListOpcode ); @@ -683,7 +683,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_PLAYER_AI_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_AUTO_REPEAT_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelAutoRepeatSpellOpcode); //DEFINE_OPCODE_HANDLER(MSG_GM_ACCOUNT_ONLINE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_LIST_STABLED_PETS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleListStabledPetsOpcode ); + DEFINE_OPCODE_HANDLER(MSG_LIST_STABLED_PETS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleListStabledPetsOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_STABLE_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStablePet ); //DEFINE_OPCODE_HANDLER(CMSG_UNSTABLE_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnstablePet ); //DEFINE_OPCODE_HANDLER(CMSG_BUY_STABLE_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyStableSlot ); @@ -948,7 +948,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_SET_TITLE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTitleOpcode ); DEFINE_OPCODE_HANDLER(CMSG_CANCEL_MOUNT_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelMountAuraOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_ARENA_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(MSG_INSPECT_ARENA_TEAMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectArenaTeamsOpcode ); + DEFINE_OPCODE_HANDLER(MSG_INSPECT_ARENA_TEAMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectArenaTeamsOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_DEATH_RELEASE_LOC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_CANCEL_TEMP_ENCHANTMENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelTempEnchantmentOpcode); //DEFINE_OPCODE_HANDLER(SMSG_FORCED_DEATH_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From 73a291c31032b5503cce393b5da18f97a1b6b301 Mon Sep 17 00:00:00 2001 From: Nay Date: Fri, 13 Jan 2012 00:34:23 +0000 Subject: Core/Auctions: Fix and enable SMSG_AUCTION_BIDDER_NOTIFICATION by Gyx --- src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp | 4 ++-- src/server/game/Server/Protocol/Opcodes.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp b/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp index aaafb09115d..8bed95ef3f6 100755 --- a/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp @@ -91,8 +91,8 @@ void WorldSession::SendAuctionBidderNotification(uint32 location, uint32 auction data << uint32(location); data << uint32(auctionId); data << uint64(bidder); - data << uint32(bidSum); - data << uint32(diff); + data << uint64(bidSum); + data << uint64(diff); data << uint32(item_template); data << uint32(0); SendPacket(&data); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 0b395202f09..2bbd47e2b52 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -667,7 +667,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_AUCTION_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_OWNER_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_BIDDER_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_AUCTION_BIDDER_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_OWNER_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PROCRESIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMBAT_EVENT_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -863,7 +863,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_RESET_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_LAST_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(MSG_RAID_TARGET_UPDATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidTargetUpdateOpcode ); - //DEFINE_OPCODE_HANDLER(MSG_RAID_READY_CHECK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidReadyCheckOpcode ); + DEFINE_OPCODE_HANDLER(MSG_RAID_READY_CHECK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidReadyCheckOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LUA_USAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(SMSG_PET_ACTION_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PET_DISMISS_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From cd7bad0d4b3eaf74d09e2eb752843c5df16c5fc5 Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Fri, 13 Jan 2012 11:54:46 +0800 Subject: Core/Opcodes: Fixed SMSG_READ_ITEM_FAILED Signed-off-by: Gyx <2359980687@qq.com> --- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- src/server/game/Server/Protocol/Opcodes.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 2bbd47e2b52..ef24d784410 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -236,7 +236,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_OPEN_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleOpenItemOpcode ); DEFINE_OPCODE_HANDLER(CMSG_READ_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReadItem ); DEFINE_OPCODE_HANDLER(SMSG_READ_ITEM_OK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_READ_ITEM_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_READ_ITEM_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ITEM_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJ_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGameObjectUseOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_DESTROY_ITEMS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 314b21f4d5a..9f8720afdcc 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -922,7 +922,7 @@ enum Opcodes SMSG_RAID_INSTANCE_INFO = 0x00, SMSG_RAID_INSTANCE_MESSAGE = 0xD862, SMSG_RANDOMIZE_CHAR_NAME = 0xF0DC, - SMSG_READ_ITEM_FAILED = 0x00, + SMSG_READ_ITEM_FAILED = 0xC5B, SMSG_READ_ITEM_OK = 0x9ECE, SMSG_REALM_SPLIT = 0x1AF2, SMSG_REAL_GROUP_UPDATE = 0x4C56, -- cgit v1.2.3 From db00c5f29b9d2a31b24b0314bb692f6c9f0f53dd Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Fri, 13 Jan 2012 11:55:44 +0800 Subject: Core/Opcodes: Fixed SMSG_SPELL_COOLDOWN Signed-off-by: Gyx <2359980687@qq.com> --- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- src/server/game/Server/Protocol/Opcodes.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index ef24d784410..d7d4a999393 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -369,7 +369,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_SPELL_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPELL_GO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPELL_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELL_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELL_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COOLDOWN_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_CANCEL_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelAuraOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_EQUIPMENT_SET_SAVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 9f8720afdcc..2bb9f88b617 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -967,7 +967,7 @@ enum Opcodes SMSG_SPELLNONMELEEDAMAGELOG = 0x5CCF, SMSG_SPELLORDAMAGE_IMMUNE = 0x48FA, SMSG_SPELLSTEALLOG = 0x00, - SMSG_SPELL_COOLDOWN = 0x00, + SMSG_SPELL_COOLDOWN = 0x88D6, SMSG_SPELL_DELAYED = 0x00, SMSG_SPELL_FAILED_OTHER = 0xCE4A, SMSG_SPELL_FAILURE = 0x9A66, -- cgit v1.2.3 From 7be86ac0a3ca51f49b3d36b4cd8be9da3c64afba Mon Sep 17 00:00:00 2001 From: kaelima Date: Fri, 13 Jan 2012 05:58:36 +0100 Subject: Core/Opcodes: Added some reversed opcodes (all verified) --- src/server/game/Entities/Player/Player.cpp | 3 ++- src/server/game/Server/Protocol/Opcodes.cpp | 17 +++++++++-------- src/server/game/Server/Protocol/Opcodes.h | 17 +++++++++-------- 3 files changed, 20 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 7fa604aeac3..46ba32413df 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -9025,9 +9025,10 @@ void Player::SendNotifyLootItemRemoved(uint8 lootSlot) void Player::SendUpdateWorldState(uint32 Field, uint32 Value) { - WorldPacket data(SMSG_UPDATE_WORLD_STATE, 8); + WorldPacket data(SMSG_UPDATE_WORLD_STATE, 4+4+1); data << Field; data << Value; + data << uint8(0); GetSession()->SendPacket(&data); } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index d7d4a999393..4fcda864050 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -595,7 +595,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_TALENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_SPAWN_ANIM_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_DESPAWN_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(MSG_CORPSE_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCorpseQueryOpcode ); + DEFINE_OPCODE_HANDLER(MSG_CORPSE_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCorpseQueryOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_DELETETICKET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketDeleteOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_DELETETICKET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHAT_WRONG_FACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -692,7 +692,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_STABLE_SWAP_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStableSwapPet ); //DEFINE_OPCODE_HANDLER(MSG_QUEST_PUSH_RESULT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestPushResult ); //DEFINE_OPCODE_HANDLER(SMSG_PLAY_MUSIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PLAY_OBJECT_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PLAY_OBJECT_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PET_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestPetInfoOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_FAR_SIGHT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleFarSightOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_SPELLDISPELLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -712,7 +712,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_ADD_PVP_MEDAL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_DEL_PVP_MEDAL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_PVP_TITLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_PVP_CREDIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PVP_CREDIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_REMOVED_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_RAID_CONVERT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupRaidConvertOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_ASSISTANT_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupAssistantLeaderOpcode); @@ -768,7 +768,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(UMSG_DELETE_GUILD_CHARTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_PETITION_RENAME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionRenameOpcode ); DEFINE_OPCODE_HANDLER(SMSG_INIT_WORLD_STATES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_WORLD_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_UPDATE_WORLD_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_ITEM_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemNameQueryOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_ITEM_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PET_ACTION_FEEDBACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -986,7 +986,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY_RESPONSE_WRITE_FILE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_COMBO_POINTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_UPDATE_COMBO_POINTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_ROSTER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_LEAVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_ADJUST_PRIORITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1103,7 +1103,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(MSG_GM_CHANGE_ARENA_RATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_DECLINE_CHANNEL_INVITE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleChannelDeclineInvite ); //DEFINE_OPCODE_HANDLER(SMSG_GROUPACTION_THROTTLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_OVERRIDE_LIGHT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_OVERRIDE_LIGHT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TOTEM_CREATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_TOTEM_DESTROYED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTotemDestroyed ); //DEFINE_OPCODE_HANDLER(CMSG_EXPIRE_RAID_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -1116,7 +1116,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_SERVER_BUCK_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_SERVER_BUCK_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SEND_UNLEARN_SPELLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PROPOSE_LEVEL_GRANT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PROPOSE_LEVEL_GRANT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_ACCEPT_LEVEL_GRANT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAcceptGrantLevel ); //DEFINE_OPCODE_HANDLER(SMSG_REFER_A_FRIEND_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FLYING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1277,7 +1277,8 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_EQUIPMENT_SET_SAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetSave ); //DEFINE_OPCODE_HANDLER(CMSG_UPDATE_PROJECTILE_POSITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateProjectilePosition ); //DEFINE_OPCODE_HANDLER(SMSG_SET_PROJECTILE_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_TALENTS_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TALENTS_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TALENTS_INVOLUNTARILY_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_LEARN_PREVIEW_TALENTS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnPreviewTalents ); //DEFINE_OPCODE_HANDLER(CMSG_LEARN_PREVIEW_TALENTS_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnPreviewTalentsPet ); //DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIVE_TALENT_GROUP_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 2bb9f88b617..4a2396edfed 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -456,7 +456,7 @@ enum Opcodes MSG_BATTLEGROUND_PLAYER_POSITIONS = 0x00, MSG_CHANNEL_START = 0x00, MSG_CHANNEL_UPDATE = 0x00, - MSG_CORPSE_QUERY = 0x00, + MSG_CORPSE_QUERY = 0xC876, MSG_GM_BIND_OTHER = 0x00, MSG_GM_SHOWLABEL = 0x00, MSG_GM_SUMMON = 0x00, @@ -849,7 +849,7 @@ enum Opcodes SMSG_OFFER_PETITION_ERROR = 0x1E7F, SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA = 0x00, SMSG_OPEN_CONTAINER = 0x00, - SMSG_OVERRIDE_LIGHT = 0x00, + SMSG_OVERRIDE_LIGHT = 0xCC56, SMSG_PAGE_TEXT_QUERY_RESPONSE = 0x18D2, SMSG_PARTYKILLLOG = 0xCCC2, SMSG_PARTY_COMMAND_RESULT = 0x00, @@ -884,7 +884,7 @@ enum Opcodes SMSG_PLAYER_VEHICLE_DATA = 0x186E, SMSG_PLAY_DANCE = 0x8CFE, SMSG_PLAY_MUSIC = 0x00, - SMSG_PLAY_OBJECT_SOUND = 0x00, + SMSG_PLAY_OBJECT_SOUND = 0xCC57, SMSG_PLAY_SOUND = 0x4ACF, SMSG_PLAY_SPELL_IMPACT = 0x00, SMSG_PLAY_SPELL_VISUAL = 0x00, @@ -893,9 +893,9 @@ enum Opcodes SMSG_POWER_UPDATE = 0x487E, SMSG_PRE_RESURRECT = 0x1CFB, SMSG_PROCRESIST = 0x00, - SMSG_PROPOSE_LEVEL_GRANT = 0x00, + SMSG_PROPOSE_LEVEL_GRANT = 0x0C42, SMSG_PUREMOUNT_CANCELLED_OBSOLETE = 0x00, - SMSG_PVP_CREDIT = 0x00, + SMSG_PVP_CREDIT = 0x9EF2, SMSG_QUERY_QUESTS_COMPLETED_RESPONSE = 0x00, SMSG_QUERY_TIME_RESPONSE = 0xD85A, SMSG_QUESTGIVER_OFFER_REWARD = 0x00, @@ -922,7 +922,7 @@ enum Opcodes SMSG_RAID_INSTANCE_INFO = 0x00, SMSG_RAID_INSTANCE_MESSAGE = 0xD862, SMSG_RANDOMIZE_CHAR_NAME = 0xF0DC, - SMSG_READ_ITEM_FAILED = 0xC5B, + SMSG_READ_ITEM_FAILED = 0x0C5B, SMSG_READ_ITEM_OK = 0x9ECE, SMSG_REALM_SPLIT = 0x1AF2, SMSG_REAL_GROUP_UPDATE = 0x4C56, @@ -987,6 +987,7 @@ enum Opcodes SMSG_SUMMON_REQUEST = 0x9A52, SMSG_SUPERCEDED_SPELL = 0xDE53, SMSG_TALENTS_INFO = 0x5EC6, + SMSG_TALENTS_INVOLUNTARILY_RESET = 0x1C7B, SMSG_TAXINODE_STATUS = 0x8CFB, SMSG_TEXT_EMOTE = 0x9E5A, SMSG_THREAT_CLEAR = 0x9E4A, @@ -1010,7 +1011,7 @@ enum Opcodes SMSG_UNIT_SPELLCAST_START = 0x00, SMSG_UPDATE_ACCOUNT_DATA = 0x4A73, SMSG_UPDATE_ACCOUNT_DATA_COMPLETE = 0x5E53, - SMSG_UPDATE_COMBO_POINTS = 0x00, + SMSG_UPDATE_COMBO_POINTS = 0x9AF6, SMSG_UPDATE_CURRENCY = 0x00, SMSG_UPDATE_CURRENCY_WEEK_LIMIT = 0x00, SMSG_UPDATE_INSTANCE_ENCOUNTER_UNIT = 0x00, @@ -1018,7 +1019,7 @@ enum Opcodes SMSG_UPDATE_LAST_INSTANCE = 0x58FE, SMSG_UPDATE_LFG_LIST = 0x00, SMSG_UPDATE_OBJECT = 0x1EE7, - SMSG_UPDATE_WORLD_STATE = 0x00, + SMSG_UPDATE_WORLD_STATE = 0x08E2, SMSG_USERLIST_ADD = 0x4CEE, SMSG_USERLIST_REMOVE = 0x9A6B, SMSG_USERLIST_UPDATE = 0x4A4B, -- cgit v1.2.3 From 421bbc59821773405751f1ef367dbbb2067f0af5 Mon Sep 17 00:00:00 2001 From: Subv2112 Date: Fri, 13 Jan 2012 21:33:27 -0500 Subject: Core/IO: Updated some opcodes Signed-off-by: Subv2112 --- src/server/game/Server/Protocol/Opcodes.cpp | 22 +++++++++++----------- src/server/game/Server/Protocol/Opcodes.h | 22 +++++++++++----------- 2 files changed, 22 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 4fcda864050..c78e5d44288 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -218,16 +218,16 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelList ); DEFINE_OPCODE_HANDLER(SMSG_CHANNEL_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_PASSWORD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelPassword ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_SET_OWNER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelSetOwner ); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_SET_OWNER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelSetOwner ); //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_OWNER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelOwner ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_MODERATOR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelModerator ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNMODERATOR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelUnmoderator ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_MUTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelMute ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNMUTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelUnmute ); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_MODERATOR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelModerator ); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNMODERATOR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelUnmoderator ); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_MUTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelMute ); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNMUTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelUnmute ); DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelInvite ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_KICK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelKick ); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_KICK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelKick ); DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_BAN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelBan ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNBAN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelUnban ); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNBAN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelUnban ); DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_ANNOUNCEMENTS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelAnnouncements ); //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_MODERATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -332,7 +332,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_SWAP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSwapItem ); DEFINE_OPCODE_HANDLER(CMSG_SWAP_INV_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSwapInvItemOpcode ); DEFINE_OPCODE_HANDLER(CMSG_SPLIT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSplitItemOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_AUTOEQUIP_ITEM_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoEquipItemSlotOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_AUTOEQUIP_ITEM_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoEquipItemSlotOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_UNCLAIM_LICENSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_DESTROYITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDestroyItemOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_INVENTORY_CHANGE_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -425,8 +425,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_DUEL_INBOUNDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_DUEL_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_DUEL_WINNER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_DUEL_ACCEPTED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDuelAcceptedOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_DUEL_CANCELLED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDuelCancelledOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_DUEL_ACCEPTED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDuelAcceptedOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_DUEL_CANCELLED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDuelCancelledOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_MOUNTRESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DISMOUNTRESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_REMOVED_FROM_PVP_QUEUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1101,7 +1101,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_GRANT_LEVEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGrantLevel ); //DEFINE_OPCODE_HANDLER(CMSG_REFER_A_FRIEND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_GM_CHANGE_ARENA_RATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_DECLINE_CHANNEL_INVITE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleChannelDeclineInvite ); + DEFINE_OPCODE_HANDLER(CMSG_DECLINE_CHANNEL_INVITE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleChannelDeclineInvite ); //DEFINE_OPCODE_HANDLER(SMSG_GROUPACTION_THROTTLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_OVERRIDE_LIGHT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TOTEM_CREATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 4a2396edfed..2d30f9a7bf7 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -64,7 +64,7 @@ enum Opcodes CMSG_AUTOBANK_ITEM = 0x8C56, CMSG_AUTOEQUIP_GROUND_ITEM = 0x00, CMSG_AUTOEQUIP_ITEM = 0x8E66, - CMSG_AUTOEQUIP_ITEM_SLOT = 0x00, + CMSG_AUTOEQUIP_ITEM_SLOT = 0x9E67, CMSG_AUTOSTORE_BAG_ITEM = 0x0EEE, CMSG_AUTOSTORE_BANK_ITEM = 0x1C5F, CMSG_AUTOSTORE_GROUND_ITEM = 0x00, @@ -111,17 +111,17 @@ enum Opcodes CMSG_CHANNEL_BAN = 0x2041, CMSG_CHANNEL_DISPLAY_LIST = 0x00, CMSG_CHANNEL_INVITE = 0x7451, - CMSG_CHANNEL_KICK = 0x00, + CMSG_CHANNEL_KICK = 0x3049, CMSG_CHANNEL_LIST = 0x00, - CMSG_CHANNEL_MODERATOR = 0x00, - CMSG_CHANNEL_MUTE = 0x00, + CMSG_CHANNEL_MODERATOR = 0x20D1, + CMSG_CHANNEL_MUTE = 0x34C9, CMSG_CHANNEL_OWNER = 0x00, CMSG_CHANNEL_PASSWORD = 0x00, CMSG_CHANNEL_ROSTER_INFO = 0x00, - CMSG_CHANNEL_SET_OWNER = 0x00, - CMSG_CHANNEL_UNBAN = 0x00, - CMSG_CHANNEL_UNMODERATOR = 0x00, - CMSG_CHANNEL_UNMUTE = 0x00, + CMSG_CHANNEL_SET_OWNER = 0x7449, + CMSG_CHANNEL_UNBAN = 0x6451, + CMSG_CHANNEL_UNMODERATOR = 0x6051, + CMSG_CHANNEL_UNMUTE = 0x74C9, CMSG_CHAR_CREATE = 0x1AC6, CMSG_CHAR_CUSTOMIZE = 0xDECF, CMSG_CHAR_DELETE = 0x1ED3, @@ -146,14 +146,14 @@ enum Opcodes CMSG_CORPSE_MAP_POSITION_QUERY = 0xDC7F, CMSG_CREATURE_QUERY = 0x5A7E, CMSG_DANCE_QUERY = 0x5C5E, - CMSG_DECLINE_CHANNEL_INVITE = 0x00, + CMSG_DECLINE_CHANNEL_INVITE = 0x4EFB, CMSG_DEL_FRIEND = 0xC852, CMSG_DEL_IGNORE = 0x8ADA, CMSG_DEL_VOICE_IGNORE = 0x8C73, CMSG_DESTROYITEM = 0x4E7A, CMSG_DESTROY_ITEMS = 0x00, - CMSG_DUEL_ACCEPTED = 0x00, - CMSG_DUEL_CANCELLED = 0x00, + CMSG_DUEL_ACCEPTED = 0x9CCB, + CMSG_DUEL_CANCELLED = 0x1E4F, CMSG_EJECT_PASSENGER = 0x00, CMSG_EMOTE = 0x9843, CMSG_ENABLE_NAGLE = 0x00, -- cgit v1.2.3 From 1d9dcfcaf0128f4b328653b1b0f84d85c53aa1ca Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Sat, 14 Jan 2012 02:44:28 +0000 Subject: Core/Protocol: Few more opcode ids Closes #4797 --- .../game/Server/Protocol/Handlers/LFGHandler.cpp | 4 ++-- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- src/server/game/Server/Protocol/Opcodes.h | 18 +++++++++--------- 3 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp b/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp index 52b4d4abbed..9666a054225 100755 --- a/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp @@ -656,8 +656,8 @@ void WorldSession::SendLfgTeleportError(uint8 err) /* void WorldSession::SendLfrUpdateListOpcode(uint32 dungeonEntry) { - sLog->outDebug(LOG_FILTER_PACKETIO, "SMSG_UPDATE_LFG_LIST [" UI64FMTD "] dungeon entry: %u", GetPlayer()->GetGUID(), dungeonEntry); - WorldPacket data(SMSG_UPDATE_LFG_LIST); + sLog->outDebug(LOG_FILTER_PACKETIO, "SMSG_LFG_UPDATE_LIST [" UI64FMTD "] dungeon entry: %u", GetPlayer()->GetGUID(), dungeonEntry); + WorldPacket data(SMSG_LFG_UPDATE_LIST); SendPacket(&data); } */ diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 4fcda864050..48b9191be78 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -925,7 +925,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_LFG_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgLeaveOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SEARCH_LFG_JOIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfrSearchOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SEARCH_LFG_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfrLeaveOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_LFG_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_PROPOSAL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_LFG_PROPOSAL_RESULT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgProposalResultOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_ROLE_CHECK_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 4a2396edfed..08d2d243b3b 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -542,8 +542,8 @@ enum Opcodes MSG_TALENT_WIPE_CONFIRM = 0x00, OBSOLETE_DROP_ITEM = 0x00, SMSG_ACCOUNT_DATA_TIMES = 0x5EE2, - SMSG_ACHIEVEMENT_DELETED = 0x00, - SMSG_ACHIEVEMENT_EARNED = 0x00, + SMSG_ACHIEVEMENT_DELETED = 0x9ED2, + SMSG_ACHIEVEMENT_EARNED = 0x484E, SMSG_ACTION_BUTTONS = 0x8A6B, SMSG_ACTIVATETAXIREPLY = 0x8E4F, SMSG_ADDON_INFO = 0x9863, @@ -582,7 +582,7 @@ enum Opcodes SMSG_AUTH_CHALLENGE = 0x1181, SMSG_AUTH_RESPONSE = 0x8867, SMSG_AVAILABLE_VOICE_CHANNEL = 0x9C7B, - SMSG_BARBER_SHOP_RESULT = 0x00, + SMSG_BARBER_SHOP_RESULT = 0x9847, SMSG_BATTLEFIELD_LIST = 0xB64E, SMSG_BATTLEFIELD_MGR_EJECTED = 0x32EC, SMSG_BATTLEFIELD_MGR_EJECT_PENDING = 0x724C, @@ -650,7 +650,7 @@ enum Opcodes SMSG_CORPSE_NOT_IN_INSTANCE = 0xCACB, SMSG_CORPSE_RECLAIM_DELAY = 0xCD46, SMSG_CREATURE_QUERY_RESPONSE = 0xD847, - SMSG_CRITERIA_DELETED = 0x00, + SMSG_CRITERIA_DELETED = 0x1A5B, SMSG_CRITERIA_UPDATE = 0xD87F, SMSG_CROSSED_INEBRIATION_THRESHOLD = 0x9CD7, SMSG_DAMAGE_CALC_LOG = 0x5C47, @@ -789,6 +789,7 @@ enum Opcodes SMSG_LFG_ROLE_CHECK_UPDATE = 0x00, SMSG_LFG_ROLE_CHOSEN = 0x00, SMSG_LFG_TELEPORT_DENIED = 0x00, + SMSG_LFG_UPDATE_LIST = 0x0EFB, SMSG_LFG_UPDATE_PARTY = 0x00, SMSG_LFG_UPDATE_PLAYER = 0x00, SMSG_LFG_UPDATE_SEARCH = 0x00, @@ -877,7 +878,7 @@ enum Opcodes SMSG_PET_UPDATE_COMBO_POINTS = 0x1A47, SMSG_PLAYED_TIME = 0x187F, SMSG_PLAYERBINDERROR = 0x5A4F, - SMSG_PLAYERBOUND = 0x00, + SMSG_PLAYERBOUND = 0xCC46, SMSG_PLAYER_DIFFICULTY_CHANGE = 0xD846, SMSG_PLAYER_MOVE = 0xF66C, SMSG_PLAYER_SKINNED = 0xDA63, @@ -892,7 +893,7 @@ enum Opcodes SMSG_PONG = 0x0380, SMSG_POWER_UPDATE = 0x487E, SMSG_PRE_RESURRECT = 0x1CFB, - SMSG_PROCRESIST = 0x00, + SMSG_PROCRESIST = 0x9AEA, SMSG_PROPOSE_LEVEL_GRANT = 0x0C42, SMSG_PUREMOUNT_CANCELLED_OBSOLETE = 0x00, SMSG_PVP_CREDIT = 0x9EF2, @@ -919,7 +920,7 @@ enum Opcodes SMSG_QUEST_POI_QUERY_RESPONSE = 0x8CC3, SMSG_QUEST_QUERY_RESPONSE = 0x9E56, SMSG_RAID_GROUP_ONLY = 0x00, - SMSG_RAID_INSTANCE_INFO = 0x00, + SMSG_RAID_INSTANCE_INFO = 0x4ACA, SMSG_RAID_INSTANCE_MESSAGE = 0xD862, SMSG_RANDOMIZE_CHAR_NAME = 0xF0DC, SMSG_READ_ITEM_FAILED = 0x0C5B, @@ -1008,7 +1009,7 @@ enum Opcodes SMSG_TRIGGER_MOVIE = 0x00, SMSG_TURN_IN_PETITION_RESULTS = 0x08DB, SMSG_TUTORIAL_FLAGS = 0x1A46, - SMSG_UNIT_SPELLCAST_START = 0x00, + SMSG_UNIT_SPELLCAST_START = 0x8C63, SMSG_UPDATE_ACCOUNT_DATA = 0x4A73, SMSG_UPDATE_ACCOUNT_DATA_COMPLETE = 0x5E53, SMSG_UPDATE_COMBO_POINTS = 0x9AF6, @@ -1017,7 +1018,6 @@ enum Opcodes SMSG_UPDATE_INSTANCE_ENCOUNTER_UNIT = 0x00, SMSG_UPDATE_INSTANCE_OWNERSHIP = 0xCA73, SMSG_UPDATE_LAST_INSTANCE = 0x58FE, - SMSG_UPDATE_LFG_LIST = 0x00, SMSG_UPDATE_OBJECT = 0x1EE7, SMSG_UPDATE_WORLD_STATE = 0x08E2, SMSG_USERLIST_ADD = 0x4CEE, -- cgit v1.2.3 From 0ef2b77f25be7a0dd7f9e3377973eb9209959be8 Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 14 Jan 2012 03:23:53 +0000 Subject: Core/Protocol: Enable more handlers (for opcodes added on the previous commit) --- src/server/game/Server/Protocol/Opcodes.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 48b9191be78..8c568f21295 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -405,7 +405,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_BINDPOINTUPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GETDEATHBINDZONE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_BINDZONEREPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PLAYERBOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PLAYERBOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CLIENT_CONTROL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_REPOP_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepopRequestOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_RESURRECT_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1125,7 +1125,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_CHANGE_PERSONAL_ARENA_RATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_ALTER_APPEARANCE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAlterAppearance ); //DEFINE_OPCODE_HANDLER(SMSG_ENABLE_BARBER_SHOP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BARBER_SHOP_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BARBER_SHOP_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_GET_CALENDAR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGetCalendar ); //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_GET_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGetEvent ); //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_GUILD_FILTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGuildFilter ); @@ -1189,7 +1189,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_COMPLETE_MOVIE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_GLYPH_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_GLYPH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_ACHIEVEMENT_EARNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ACHIEVEMENT_EARNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DYNAMIC_DROP_ROLL_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CRITERIA_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_QUERY_INSPECT_ACHIEVEMENTS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryInspectAchievements ); @@ -1243,7 +1243,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); //DEFINE_OPCODE_HANDLER(CMSG_HEARTH_AND_RESURRECT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleHearthAndResurrect ); //DEFINE_OPCODE_HANDLER(SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CRITERIA_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CRITERIA_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ACHIEVEMENT_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SERVER_INFO_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_SERVER_INFO_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From 522683bfabca985034aad1dbadd0738e1cfe2cc6 Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Sat, 14 Jan 2012 13:02:35 +0000 Subject: Core/Protocol: More opcodes, enable some handlers --- src/server/game/Server/Protocol/Opcodes.cpp | 6 +++--- src/server/game/Server/Protocol/Opcodes.h | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 8c8f755d6af..b326598ca9b 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -742,7 +742,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_SPELL_FAILED_OTHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_RESET_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_REPAIR_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepairItemOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_CHAT_PLAYER_NOT_FOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CHAT_PLAYER_NOT_FOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(MSG_TALENT_WIPE_CONFIRM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTalentWipeConfirmOpcode ); DEFINE_OPCODE_HANDLER(SMSG_SUMMON_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SUMMON_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSummonResponseOpcode ); @@ -808,7 +808,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_GROUP_JOINED_BATTLEGROUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(MSG_BATTLEGROUND_PLAYER_POSITIONS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlegroundPlayerPositionsOpcode); //DEFINE_OPCODE_HANDLER(CMSG_PET_STOP_ATTACK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetStopAttack ); - //DEFINE_OPCODE_HANDLER(SMSG_BINDER_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BINDER_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_PLAYER_JOINED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_PLAYER_LEFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_JOIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlemasterJoinOpcode ); @@ -826,7 +826,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_RAID_INSTANCE_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_MOVES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_INFO_TEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildChangeInfoTextOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_CHAT_RESTRICTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CHAT_RESTRICTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_RUN_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_SWIM_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index b47da82a9c1..8092960f9ec 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -601,10 +601,10 @@ enum Opcodes SMSG_BATTLEGROUND_PLAYER_JOINED = 0x00, SMSG_BATTLEGROUND_PLAYER_LEFT = 0x00, SMSG_BATTLEGROUND_PLAYER_POSITIONS = 0x00, - SMSG_BINDER_CONFIRM = 0x00, + SMSG_BINDER_CONFIRM = 0x0ADA, SMSG_BINDPOINTUPDATE = 0x00, - SMSG_BINDZONEREPLY = 0x00, - SMSG_BREAK_TARGET = 0xE7E, + SMSG_BINDZONEREPLY = 0x1A42, + SMSG_BREAK_TARGET = 0x0E7E, SMSG_BUY_BANK_SLOT_RESULT = 0x00, SMSG_BUY_FAILED = 0x4A7F, SMSG_BUY_ITEM = 0xCA67, @@ -624,9 +624,9 @@ enum Opcodes SMSG_CHAR_ENUM = 0xA05C, SMSG_CHAR_FACTION_CHANGE = 0x885A, SMSG_CHAR_RENAME = 0x5EF6, - SMSG_CHAT_PLAYER_AMBIGUOUS = 0x00, - SMSG_CHAT_PLAYER_NOT_FOUND = 0x00, - SMSG_CHAT_RESTRICTED = 0x00, + SMSG_CHAT_PLAYER_AMBIGUOUS = 0xDE7F, + SMSG_CHAT_PLAYER_NOT_FOUND = 0x4E6F, + SMSG_CHAT_RESTRICTED = 0x4863, SMSG_CHAT_WRONG_FACTION = 0xE66, SMSG_CHECK_FOR_BOTS = 0x00, SMSG_CLEAR_COOLDOWN = 0x00, -- cgit v1.2.3 From a369594d61c688127eff7c04e2a691400416b18d Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 14 Jan 2012 17:43:19 +0000 Subject: Core/Group: Update CMSG_GROUP_RAID_CONVERT to 4.x. Based on SF sources and thanks Subv. TODO: Test --- src/server/game/Groups/Group.cpp | 31 ++++++++++++++++++++++ src/server/game/Groups/Group.h | 1 + .../game/Server/Protocol/Handlers/GroupHandler.cpp | 16 ++++++++--- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- 4 files changed, 45 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index b03f853a9e4..5f1b27a5d53 100755 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -254,6 +254,37 @@ void Group::ConvertToRaid() player->UpdateForQuestWorldObjects(); } +void Group::ConvertToGroup() +{ + if (m_memberSlots.size() > 5) + return; // What message error should we send? + + m_groupType = GroupType(GROUPTYPE_NORMAL); + + if (m_subGroupsCounts) + { + delete[] m_subGroupsCounts; + m_subGroupsCounts = NULL;; + } + + if (!isBGGroup()) + { + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_TYPE); + + stmt->setUInt8(0, uint8(m_groupType)); + stmt->setUInt32(1, m_dbStoreId); + + CharacterDatabase.Execute(stmt); + } + + SendUpdate(); + + // update quest related GO states (quest activity dependent from raid membership) + for (member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr) + if (Player* player = ObjectAccessor::FindPlayer(citr->guid)) + player->UpdateForQuestWorldObjects(); +} + bool Group::AddInvite(Player* player) { if (!player || player->GetGroupInvite()) diff --git a/src/server/game/Groups/Group.h b/src/server/game/Groups/Group.h index b718246b43e..63c89069f52 100755 --- a/src/server/game/Groups/Group.h +++ b/src/server/game/Groups/Group.h @@ -239,6 +239,7 @@ class Group void ConvertToLFG(); void ConvertToRaid(); + void ConvertToGroup(); void SetBattlegroundGroup(Battleground* bg); GroupJoinBattlegroundResult CanJoinBattlegroundQueue(Battleground const* bgOrTemplate, BattlegroundQueueTypeId bgQueueTypeId, uint32 MinPlayerCount, uint32 MaxPlayerCount, bool isRated, uint32 arenaSlot); diff --git a/src/server/game/Server/Protocol/Handlers/GroupHandler.cpp b/src/server/game/Server/Protocol/Handlers/GroupHandler.cpp index 101b5be0033..03c213b9bd3 100755 --- a/src/server/game/Server/Protocol/Handlers/GroupHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/GroupHandler.cpp @@ -548,7 +548,7 @@ void WorldSession::HandleRaidTargetUpdateOpcode(WorldPacket & recv_data) } } -void WorldSession::HandleGroupRaidConvertOpcode(WorldPacket & /*recv_data*/) +void WorldSession::HandleGroupRaidConvertOpcode(WorldPacket& recv_data) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_RAID_CONVERT"); @@ -559,14 +559,22 @@ void WorldSession::HandleGroupRaidConvertOpcode(WorldPacket & /*recv_data*/) if (_player->InBattleground()) return; - /** error handling **/ + // error handling if (!group->IsLeader(GetPlayer()->GetGUID()) || group->GetMembersCount() < 2) return; - /********************/ // everything's fine, do it (is it 0 (PARTY_OP_INVITE) correct code) SendPartyResult(PARTY_OP_INVITE, "", ERR_PARTY_RESULT_OK); - group->ConvertToRaid(); + + // New 4.x: it is now possible to convert a raid to a group if member count is 5 or less + + bool toRaid; + recv_data >> toRaid; + + if (toRaid) + group->ConvertToRaid(); + else + group->ConvertToGroup(); } void WorldSession::HandleGroupChangeSubGroupOpcode(WorldPacket & recv_data) diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index b326598ca9b..ed9035a5ece 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -714,7 +714,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_SET_PVP_TITLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(SMSG_PVP_CREDIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_REMOVED_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_GROUP_RAID_CONVERT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupRaidConvertOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GROUP_RAID_CONVERT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupRaidConvertOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_ASSISTANT_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupAssistantLeaderOpcode); DEFINE_OPCODE_HANDLER(CMSG_BUYBACK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuybackItem ); DEFINE_OPCODE_HANDLER(SMSG_SERVER_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From cc5450c4a08d228d3b7cd31e3c2a233aa8bb8b48 Mon Sep 17 00:00:00 2001 From: Heisenberg Date: Sat, 14 Jan 2012 18:21:36 +0000 Subject: Core/Auction: Fix CMSG_AUCTION_PLACE_BID Enable 2 handlers --- .../Server/Protocol/Handlers/AuctionHouseHandler.cpp | 16 ++++++++-------- .../game/Server/Protocol/Handlers/SkillHandler.cpp | 8 ++++---- src/server/game/Server/Protocol/Opcodes.cpp | 4 ++-- 3 files changed, 14 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp b/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp index 8bed95ef3f6..8b5a4a3f481 100755 --- a/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp @@ -252,19 +252,20 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data) GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CREATE_AUCTION, 1); } -//this function is called when client bids or buys out auction -void WorldSession::HandleAuctionPlaceBid(WorldPacket & recv_data) +// this function is called when client bids or buys out auction +void WorldSession::HandleAuctionPlaceBid(WorldPacket& recv_data) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_AUCTION_PLACE_BID"); uint64 auctioneer; uint32 auctionId; - uint32 price; + uint64 price; recv_data >> auctioneer; - recv_data >> auctionId >> price; + recv_data >> auctionId; + recv_data >> price; if (!auctionId || !price) - return; //check for cheaters + return; // check for cheaters Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(auctioneer, UNIT_NPC_FLAG_AUCTIONEER); if (!creature) @@ -384,7 +385,6 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recv_data) uint32 auctionId; recv_data >> auctioneer; recv_data >> auctionId; - //sLog->outDebug("Cancel AUCTION AuctionID: %u", auctionId); Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(auctioneer, UNIT_NPC_FLAG_AUCTIONEER); if (!creature) @@ -428,7 +428,7 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recv_data) } else { - sLog->outError("Auction id: %u has non-existed item (item guid : %u)!!!", auction->Id, auction->item_guidlow); + sLog->outError("Auction id: %u got non existing item (item guid : %u)!", auction->Id, auction->item_guidlow); SendAuctionCommandResult(0, AUCTION_CANCEL, AUCTION_INTERNAL_ERROR); return; } @@ -437,7 +437,7 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recv_data) { SendAuctionCommandResult(0, AUCTION_CANCEL, AUCTION_INTERNAL_ERROR); //this code isn't possible ... maybe there should be assert - sLog->outError("CHEATER : %u, he tried to cancel auction (id: %u) of another player, or auction is NULL", player->GetGUIDLow(), auctionId); + sLog->outError("CHEATER: %u tried to cancel auction (id: %u) of another player or auction is NULL", player->GetGUIDLow(), auctionId); return; } diff --git a/src/server/game/Server/Protocol/Handlers/SkillHandler.cpp b/src/server/game/Server/Protocol/Handlers/SkillHandler.cpp index 520cd89e7d5..24b5ca9537d 100755 --- a/src/server/game/Server/Protocol/Handlers/SkillHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/SkillHandler.cpp @@ -84,10 +84,10 @@ void WorldSession::HandleTalentWipeConfirmOpcode(WorldPacket & recv_data) unit->CastSpell(_player, 14867, true); //spell: "Untalent Visual Effect" } -void WorldSession::HandleUnlearnSkillOpcode(WorldPacket & recv_data) +void WorldSession::HandleUnlearnSkillOpcode(WorldPacket& recv_data) { - uint32 skill_id; - recv_data >> skill_id; - GetPlayer()->SetSkill(skill_id, 0, 0, 0); + uint32 skillId; + recv_data >> skillId; + GetPlayer()->SetSkill(skillId, 0, 0, 0); } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index ed9035a5ece..3b266d88adb 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -663,7 +663,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_REMOVE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionRemoveItem ); //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListItems ); DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_OWNER_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListOwnerItems ); - //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_PLACE_BID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionPlaceBid ); + DEFINE_OPCODE_HANDLER(CMSG_AUCTION_PLACE_BID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionPlaceBid ); //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_AUCTION_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_OWNER_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -874,7 +874,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_GMSURVEY_SUBMIT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMSurveySubmit ); //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_INSTANCE_OWNERSHIP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_KNOCKBACK_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_CHAT_PLAYER_AMBIGUOUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CHAT_PLAYER_AMBIGUOUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(MSG_DELAY_GHOST_TELEPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(SMSG_SPELLINSTAKILLLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELL_UPDATE_CHAIN_TARGETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From d3e508254baeca8404b11b700a5b97bdd8b5b072 Mon Sep 17 00:00:00 2001 From: Heisenberg Date: Sat, 14 Jan 2012 19:27:14 +0000 Subject: Core/Misc: - Swap 2 quest opcodes and remove uneeded code; - Add worgen and goblin support to faction/race change - More opcode ids and enable handlers --- .../game/Server/Protocol/Handlers/CharacterHandler.cpp | 9 ++++++++- src/server/game/Server/Protocol/Handlers/MovementHandler.cpp | 4 ++-- src/server/game/Server/Protocol/Handlers/PetHandler.cpp | 6 +++--- .../game/Server/Protocol/Handlers/PetitionsHandler.cpp | 2 +- src/server/game/Server/Protocol/Handlers/QuestHandler.cpp | 12 +----------- src/server/game/Server/Protocol/Handlers/SkillHandler.cpp | 8 ++++---- src/server/game/Server/Protocol/Opcodes.cpp | 6 +++--- src/server/game/Server/Protocol/Opcodes.h | 6 +++--- 8 files changed, 25 insertions(+), 28 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp index 242a8edc31c..b645f3e4527 100644 --- a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp @@ -1757,6 +1757,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) switch (race) { case RACE_ORC: + case RACE_GOBLIN: case RACE_TAUREN: case RACE_UNDEAD_PLAYER: case RACE_TROLL: @@ -1769,7 +1770,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) // Switch Languages // delete all languages first - trans->PAppend("DELETE FROM `character_skills` WHERE `skill` IN (98, 113, 759, 111, 313, 109, 115, 315, 673, 137) AND `guid`='%u'", lowGuid); + trans->PAppend("DELETE FROM `character_skills` WHERE `skill` IN (98, 113, 759, 111, 313, 109, 115, 315, 673, 137, 791, 792) AND `guid`='%u'", lowGuid); // now add them back if (team == BG_TEAM_ALLIANCE) @@ -1789,6 +1790,9 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) case RACE_NIGHTELF: trans->PAppend("INSERT INTO `character_skills` (guid, skill, value, max) VALUES (%u, 113, 300, 300)", lowGuid); break; + case RACE_WORGEN: + trans->PAppend("INSERT INTO `character_skills` (guid, skill, value, max) VALUES (%u, 791, 300, 300)", lowGuid); + break; } } else if (team == BG_TEAM_HORDE) @@ -1808,6 +1812,9 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) case RACE_BLOODELF: trans->PAppend("INSERT INTO `character_skills` (guid, skill, value, max) VALUES (%u, 137, 300, 300)", lowGuid); break; + case RACE_GOBLIN: + trans->PAppend("INSERT INTO `character_skills` (guid, skill, value, max) VALUES (%u, 792, 300, 300)", lowGuid); + break; } } diff --git a/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp b/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp index 9997816f0ec..761b8406d88 100755 --- a/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp @@ -572,9 +572,9 @@ void WorldSession::HandleSummonResponseOpcode(WorldPacket& recv_data) if (!_player->isAlive() || _player->isInCombat()) return; - uint64 summoner_guid; + uint64 summonerGuid; bool agree; - recv_data >> summoner_guid; + recv_data >> summonerGuid; recv_data >> agree; _player->SummonIfPossible(agree); diff --git a/src/server/game/Server/Protocol/Handlers/PetHandler.cpp b/src/server/game/Server/Protocol/Handlers/PetHandler.cpp index 52a3e36f2ba..90cda17d477 100755 --- a/src/server/game/Server/Protocol/Handlers/PetHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/PetHandler.cpp @@ -845,10 +845,10 @@ void WorldSession::HandlePetLearnTalent(WorldPacket & recv_data) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_PET_LEARN_TALENT"); uint64 guid; - uint32 talent_id, requested_rank; - recv_data >> guid >> talent_id >> requested_rank; + uint32 talentId, requestedRank; + recv_data >> guid >> talentId >> requestedRank; - _player->LearnPetTalent(guid, talent_id, requested_rank); + _player->LearnPetTalent(guid, talentId, requestedRank); _player->SendTalentsInfoData(true); } diff --git a/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp b/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp index 26185d3376d..dce5e0f78ba 100755 --- a/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp @@ -370,7 +370,7 @@ void WorldSession::SendPetitionQueryOpcode(uint64 petitionguid) void WorldSession::HandlePetitionRenameOpcode(WorldPacket & recv_data) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode MSG_PETITION_RENAME"); // ok + sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode MSG_PETITION_RENAME"); uint64 petitionGuid; uint32 type; diff --git a/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp b/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp index 8b57fce1d81..a3debe82ac1 100755 --- a/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp @@ -451,21 +451,11 @@ void WorldSession::HandleQuestLogRemoveQuest(WorldPacket& recv_data) void WorldSession::HandleQuestConfirmAccept(WorldPacket& recvData) { - uint64 questGiverGuid; uint32 questId; - uint32 unkInt; - recvData >> questGiverGuid>> questId >> unkInt; + recvData >> questId; sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUEST_CONFIRM_ACCEPT questId = %u", questId); - if (IS_UNIT_GUID(questGiverGuid)) - if (!GetPlayer()->GetNPCIfCanInteractWith(questGiverGuid, UNIT_NPC_FLAG_QUESTGIVER)) - return; - if (IS_GAMEOBJECT_GUID(questGiverGuid)) - if (!GetPlayer()->GetGameObjectIfCanInteractWith(questGiverGuid, GAMEOBJECT_TYPE_QUESTGIVER)) - return; - // Can items be quest giver? - if (const Quest* quest = sObjectMgr->GetQuestTemplate(questId)) { if (!quest->HasFlag(QUEST_FLAGS_PARTY_ACCEPT)) diff --git a/src/server/game/Server/Protocol/Handlers/SkillHandler.cpp b/src/server/game/Server/Protocol/Handlers/SkillHandler.cpp index 24b5ca9537d..96234762a15 100755 --- a/src/server/game/Server/Protocol/Handlers/SkillHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/SkillHandler.cpp @@ -28,10 +28,10 @@ void WorldSession::HandleLearnTalentOpcode(WorldPacket & recv_data) { - uint32 talent_id, requested_rank; - recv_data >> talent_id >> requested_rank; + uint32 talentId, requestedRank; + recv_data >> talentId >> requestedRank; - _player->LearnTalent(talent_id, requested_rank); + _player->LearnTalent(talentId, requestedRank); _player->SendTalentsInfoData(false); } @@ -71,7 +71,7 @@ void WorldSession::HandleTalentWipeConfirmOpcode(WorldPacket & recv_data) if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); - if (!(_player->resetTalents())) + if (!_player->resetTalents()) { WorldPacket data(MSG_TALENT_WIPE_CONFIRM, 8+4); //you have not any talent data << uint64(0); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 3b266d88adb..c92649eb4b9 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -454,7 +454,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_QUERY_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverQueryQuestOpcode); //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_QUEST_AUTOLAUNCH, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverQuestAutoLaunch ); DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_DETAILS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_ACCEPT_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverAcceptQuestOpcode); + DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_ACCEPT_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverAcceptQuestOpcode); DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_COMPLETE_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverCompleteQuest ); DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_REQUEST_ITEMS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_REQUEST_REWARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverRequestRewardOpcode); @@ -743,9 +743,9 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_RESET_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_REPAIR_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepairItemOpcode ); DEFINE_OPCODE_HANDLER(SMSG_CHAT_PLAYER_NOT_FOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(MSG_TALENT_WIPE_CONFIRM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTalentWipeConfirmOpcode ); + DEFINE_OPCODE_HANDLER(MSG_TALENT_WIPE_CONFIRM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTalentWipeConfirmOpcode ); DEFINE_OPCODE_HANDLER(SMSG_SUMMON_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_SUMMON_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSummonResponseOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_SUMMON_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSummonResponseOpcode ); //DEFINE_OPCODE_HANDLER(MSG_DEV_SHOWLABEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(SMSG_MONSTER_MOVE_TRANSPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_BROKEN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 8092960f9ec..c8a18266a4a 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -337,7 +337,7 @@ enum Opcodes CMSG_QUERY_GUILD_XP = 0x00, CMSG_QUERY_QUESTS_COMPLETED = 0x98DF, CMSG_QUERY_TIME = 0x18FE, - CMSG_QUESTGIVER_ACCEPT_QUEST = 0x8CD3, + CMSG_QUESTGIVER_ACCEPT_QUEST = 0x0C63, CMSG_QUESTGIVER_CANCEL = 0xC86A, CMSG_QUESTGIVER_CHOOSE_REWARD = 0x18F3, CMSG_QUESTGIVER_COMPLETE_QUEST = 0xCCE3, @@ -349,7 +349,7 @@ enum Opcodes CMSG_QUESTGIVER_STATUS_QUERY = 0x88C6, CMSG_QUESTLOG_REMOVE_QUEST = 0x8EFF, CMSG_QUESTLOG_SWAP_QUEST = 0x00, - CMSG_QUEST_CONFIRM_ACCEPT = 0xC63, + CMSG_QUEST_CONFIRM_ACCEPT = 0x8CD3, CMSG_QUEST_POI_QUERY = 0x12A5, CMSG_QUEST_QUERY = 0xCE7F, CMSG_RANDOMIZE_CHAR_NAME = 0x8A99, @@ -386,7 +386,7 @@ enum Opcodes CMSG_SETDEATHBINDPOINT = 0x00, CMSG_SETSHEATHED = 0xCA5F, CMSG_SET_ACTIONBAR_TOGGLES = 0x584F, - CMSG_SET_ACTION_BUTTON = 0x00, + CMSG_SET_ACTION_BUTTON = 0xDAC3, CMSG_SET_ACTIVE_MOVER = 0x00, CMSG_SET_ACTIVE_VOICE_CHANNEL = 0x00, CMSG_SET_ALLOW_LOW_LEVEL_RAID1 = 0xC863, -- cgit v1.2.3 From dcd915c9b9f4490fd05fe8854c3e23cd3778f530 Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 14 Jan 2012 22:32:39 +0000 Subject: Core/Auction: Fix more auction related opcodes Closes #4731 --- src/server/game/AuctionHouse/AuctionHouseMgr.cpp | 28 +++++++++--------- src/server/game/Entities/Player/Player.cpp | 12 ++++---- .../Protocol/Handlers/AuctionHouseHandler.cpp | 34 +++++++++++----------- .../game/Server/Protocol/Handlers/ItemHandler.cpp | 2 +- .../game/Server/Protocol/Handlers/MailHandler.cpp | 10 +++++-- src/server/game/Server/Protocol/Opcodes.cpp | 12 ++++---- 6 files changed, 51 insertions(+), 47 deletions(-) (limited to 'src') diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp index 838fdbddfeb..4a725fada58 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp @@ -648,7 +648,7 @@ void AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player } //this function inserts to WorldPacket auction's data -bool AuctionEntry::BuildAuctionInfo(WorldPacket & data) const +bool AuctionEntry::BuildAuctionInfo(WorldPacket& data) const { Item* pItem = sAuctionMgr->GetAItem(item_guidlow); if (!pItem) @@ -659,26 +659,26 @@ bool AuctionEntry::BuildAuctionInfo(WorldPacket & data) const data << uint32(Id); data << uint32(pItem->GetEntry()); - for (uint8 i = 0; i < MAX_INSPECTED_ENCHANTMENT_SLOT; ++i) + for (uint8 i = 0; i < PROP_ENCHANTMENT_SLOT_2; ++i) // PROP_ENCHANTMENT_SLOT_2 = 9 { data << uint32(pItem->GetEnchantmentId(EnchantmentSlot(i))); data << uint32(pItem->GetEnchantmentDuration(EnchantmentSlot(i))); data << uint32(pItem->GetEnchantmentCharges(EnchantmentSlot(i))); } - data << int32(pItem->GetItemRandomPropertyId()); //random item property id - data << uint32(pItem->GetItemSuffixFactor()); //SuffixFactor - data << uint32(pItem->GetCount()); //item->count - data << uint32(pItem->GetSpellCharges()); //item->charge FFFFFFF - data << uint32(0); //Unknown - data << uint64(owner); //Auction->owner - data << uint32(startbid); //Auction->startbid (not sure if useful) - data << uint32(bid ? GetAuctionOutBid() : 0); + data << int32(pItem->GetItemRandomPropertyId()); // random item property id + data << uint32(pItem->GetItemSuffixFactor()); // SuffixFactor + data << uint32(pItem->GetCount()); // item->count + data << uint32(pItem->GetSpellCharges()); // item->charge FFFFFFF + data << uint32(0); // Unknown + data << uint64(owner); // Auction->owner + data << uint64(startbid); // Auction->startbid (not sure if useful) + data << uint64(bid ? GetAuctionOutBid() : 0); //minimal outbid - data << uint32(buyout); //auction->buyout - data << uint32((expire_time-time(NULL))*IN_MILLISECONDS);//time left - data << uint64(bidder); //auction->bidder current - data << uint32(bid); //current bid + data << uint64(buyout); // auction->buyout + data << uint32((expire_time-time(NULL))*IN_MILLISECONDS); // time left + data << uint64(bidder); // auction->bidder current + data << uint64(bid); // current bid return true; } diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 46ba32413df..71822cdc71d 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -3393,15 +3393,15 @@ void Player::RemoveMail(uint32 id) void Player::SendMailResult(uint32 mailId, MailResponseType mailAction, MailResponseResult mailError, uint32 equipError, uint32 item_guid, uint32 item_count) { WorldPacket data(SMSG_SEND_MAIL_RESULT, (4+4+4+(mailError == MAIL_ERR_EQUIP_ERROR?4:(mailAction == MAIL_ITEM_TAKEN?4+4:0)))); - data << (uint32) mailId; - data << (uint32) mailAction; - data << (uint32) mailError; + data << uint32(mailId); + data << uint32(mailAction); + data << uint32(mailError); if (mailError == MAIL_ERR_EQUIP_ERROR) - data << (uint32) equipError; + data << uint32(equipError); else if (mailAction == MAIL_ITEM_TAKEN) { - data << (uint32) item_guid; // item guid low? - data << (uint32) item_count; // item count? + data << uint32(item_guid); // item guid low? + data << uint32(item_count); // item count? } GetSession()->SendPacket(&data); } diff --git a/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp b/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp index 8b5a4a3f481..3a952946a2b 100755 --- a/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp @@ -98,17 +98,17 @@ void WorldSession::SendAuctionBidderNotification(uint32 location, uint32 auction SendPacket(&data); } -//this void causes on client to display: "Your auction sold" +// this void causes on client to display: "Your auction sold" void WorldSession::SendAuctionOwnerNotification(AuctionEntry* auction) { - WorldPacket data(SMSG_AUCTION_OWNER_NOTIFICATION, (7*4)); - data << auction->Id; - data << auction->bid; - data << (uint32) 0; //unk - data << (uint32) 0; //unk - data << (uint32) 0; //unk - data << auction->item_template; - data << (uint32) 0; //unk + WorldPacket data(SMSG_AUCTION_OWNER_NOTIFICATION, 40); + data << uint32(auction->Id); + data << uint64(auction->bid); + data << uint64(0); //unk + data << uint64(0); //unk + data << uint32(0); //unk + data << uint32(auction->item_template); + data << float(0); //unk SendPacket(&data); } @@ -311,7 +311,7 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket& recv_data) return; } - if (!player->HasEnoughMoney(price)) + if (!player->HasEnoughMoney((uint32)price)) { //you don't have enought money!, client tests! //SendAuctionCommandResult(auction->auctionId, AUCTION_PLACE_BID, ???); @@ -489,7 +489,7 @@ void WorldSession::HandleAuctionListBidderItems(WorldPacket & recv_data) WorldPacket data(SMSG_AUCTION_BIDDER_LIST_RESULT, (4+4+4)); Player* player = GetPlayer(); - data << (uint32) 0; //add 0 as count + data << uint32(0); //add 0 as count uint32 count = 0; uint32 totalcount = 0; while (outbiddedCount > 0) //add all data, which client requires @@ -508,7 +508,7 @@ void WorldSession::HandleAuctionListBidderItems(WorldPacket & recv_data) auctionHouse->BuildListBidderItems(data, player, count, totalcount); data.put(0, count); // add count to placeholder data << totalcount; - data << (uint32)300; //unk 2.3.0 + data << uint32(300); //unk 2.3.0 SendPacket(&data); } @@ -537,15 +537,15 @@ void WorldSession::HandleAuctionListOwnerItems(WorldPacket & recv_data) AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction()); WorldPacket data(SMSG_AUCTION_OWNER_LIST_RESULT, (4+4+4)); - data << (uint32) 0; // amount place holder + data << uint32(0); // amount place holder uint32 count = 0; uint32 totalcount = 0; auctionHouse->BuildListOwnerItems(data, _player, count, totalcount); data.put(0, count); - data << (uint32) totalcount; - data << (uint32) 0; + data << uint32(totalcount); + data << uint32(0); SendPacket(&data); } @@ -612,8 +612,8 @@ void WorldSession::HandleAuctionListItems(WorldPacket & recv_data) count, totalcount); data.put(0, count); - data << (uint32) totalcount; - data << (uint32) 300; // unk 2.3.0 const? + data << uint32(totalcount); + data << uint32(300); //unk 2.3.0 SendPacket(&data); } diff --git a/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp b/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp index fc69569ec25..c733e1ac9b3 100755 --- a/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp @@ -1387,7 +1387,7 @@ void WorldSession::HandleItemTextQuery(WorldPacket & recv_data ) sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ITEM_TEXT_QUERY item guid: %u", GUID_LOPART(itemGuid)); - WorldPacket data(SMSG_ITEM_TEXT_QUERY_RESPONSE, (4+10)); // guess size + WorldPacket data(SMSG_ITEM_TEXT_QUERY_RESPONSE, 14); // guess size if (Item* item = _player->GetItemByGuid(itemGuid)) { diff --git a/src/server/game/Server/Protocol/Handlers/MailHandler.cpp b/src/server/game/Server/Protocol/Handlers/MailHandler.cpp index 0d992f2f95d..cb75de0569e 100755 --- a/src/server/game/Server/Protocol/Handlers/MailHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/MailHandler.cpp @@ -491,12 +491,15 @@ void WorldSession::HandleMailTakeItem(WorldPacket & recv_data) player->SendMailResult(mailId, MAIL_ITEM_TAKEN, MAIL_ERR_EQUIP_ERROR, msg); } -void WorldSession::HandleMailTakeMoney(WorldPacket & recv_data) +void WorldSession::HandleMailTakeMoney(WorldPacket& recv_data) { uint64 mailbox; + uint64 money; uint32 mailId; + recv_data >> mailbox; recv_data >> mailId; + recv_data >> money; if (!GetPlayer()->GetGameObjectIfCanInteractWith(mailbox, GAMEOBJECT_TYPE_MAILBOX)) return; @@ -504,7 +507,8 @@ void WorldSession::HandleMailTakeMoney(WorldPacket & recv_data) Player* player = _player; Mail* m = player->GetMail(mailId); - if (!m || m->state == MAIL_STATE_DELETED || m->deliver_time > time(NULL)) + if ((!m || m->state == MAIL_STATE_DELETED || m->deliver_time > time(NULL)) || + (money > 0 && m->money != money)) { player->SendMailResult(mailId, MAIL_MONEY_TAKEN, MAIL_ERR_INTERNAL_ERROR); return; @@ -512,7 +516,7 @@ void WorldSession::HandleMailTakeMoney(WorldPacket & recv_data) player->SendMailResult(mailId, MAIL_MONEY_TAKEN, MAIL_OK); - player->ModifyMoney(m->money); + player->ModifyMoney(money); m->money = 0; m->state = MAIL_STATE_CHANGED; player->m_mailsUpdated = true; diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index c92649eb4b9..6dfab9aaf50 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -642,7 +642,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_TAXIENABLENODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_ITEM_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemTextQuery ); //DEFINE_OPCODE_HANDLER(SMSG_ITEM_TEXT_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_MAIL_TAKE_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailTakeMoney ); + DEFINE_OPCODE_HANDLER(CMSG_MAIL_TAKE_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailTakeMoney ); DEFINE_OPCODE_HANDLER(CMSG_MAIL_TAKE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailTakeItem ); //DEFINE_OPCODE_HANDLER(CMSG_MAIL_MARK_AS_READ, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailMarkAsRead ); //DEFINE_OPCODE_HANDLER(CMSG_MAIL_RETURN_TO_SENDER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailReturnToSender ); @@ -664,17 +664,17 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListItems ); DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_OWNER_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListOwnerItems ); DEFINE_OPCODE_HANDLER(CMSG_AUCTION_PLACE_BID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionPlaceBid ); - //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_AUCTION_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_AUCTION_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_OWNER_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_AUCTION_OWNER_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_AUCTION_BIDDER_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_OWNER_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_AUCTION_OWNER_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PROCRESIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMBAT_EVENT_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DISPEL_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPELLORDAMAGE_IMMUNE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_BIDDER_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListBidderItems ); - //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_BIDDER_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_AUCTION_BIDDER_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SET_FLAT_SPELL_MODIFIER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SET_PCT_SPELL_MODIFIER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CORPSE_RECLAIM_DELAY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -713,7 +713,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_DEL_PVP_MEDAL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_PVP_TITLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(SMSG_PVP_CREDIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_REMOVED_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_AUCTION_REMOVED_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_GROUP_RAID_CONVERT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupRaidConvertOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_ASSISTANT_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupAssistantLeaderOpcode); DEFINE_OPCODE_HANDLER(CMSG_BUYBACK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuybackItem ); -- cgit v1.2.3 From 984c8f38946a502280eb7b124c71ef7018b93d0a Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 14 Jan 2012 22:53:09 +0000 Subject: Core/Auction: Fix an error in SMSG_AUCTION_OWNER_NOTIFICATION. Thanks Fredi. --- src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp b/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp index 3a952946a2b..845f3279356 100755 --- a/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp @@ -106,8 +106,8 @@ void WorldSession::SendAuctionOwnerNotification(AuctionEntry* auction) data << uint64(auction->bid); data << uint64(0); //unk data << uint64(0); //unk - data << uint32(0); //unk data << uint32(auction->item_template); + data << uint32(0); //unk data << float(0); //unk SendPacket(&data); } -- cgit v1.2.3 From 4899f6c47cefbef9f970054e5c17b89f8c490e39 Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 15 Jan 2012 01:47:21 +0000 Subject: Core/Protocol: Enable handler and add opcode id for SMSG_SPELL_DELAYED --- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- src/server/game/Server/Protocol/Opcodes.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 6dfab9aaf50..15bb71e1f9d 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -543,7 +543,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_PAGETEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_SETSHEATHED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleSetSheathedOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_COOLDOWN_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELL_DELAYED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELL_DELAYED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_QUEST_POI_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestPOIQuery ); DEFINE_OPCODE_HANDLER(SMSG_QUEST_POI_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GHOST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index c8a18266a4a..57fe4b2bf8f 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -969,7 +969,7 @@ enum Opcodes SMSG_SPELLORDAMAGE_IMMUNE = 0x48FA, SMSG_SPELLSTEALLOG = 0x00, SMSG_SPELL_COOLDOWN = 0x88D6, - SMSG_SPELL_DELAYED = 0x00, + SMSG_SPELL_DELAYED = 0x1AD3, SMSG_SPELL_FAILED_OTHER = 0xCE4A, SMSG_SPELL_FAILURE = 0x9A66, SMSG_SPELL_GO = 0x0A53, -- cgit v1.2.3 From f1cc8f532efefb659ef86e3ac16110e9b0b70adb Mon Sep 17 00:00:00 2001 From: kaelima Date: Sun, 15 Jan 2012 14:52:57 +0100 Subject: Core/Opcodes: Corrected the opcode for CMSG_GAMEOBJ_USE and CMSG_GAMEOBJ_REPORT_USE --- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- src/server/game/Server/Protocol/Opcodes.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 15bb71e1f9d..1435dff4527 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -1214,7 +1214,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_FORCE_SAY_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_HEALTH_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_POWER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJ_REPORT_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGameobjectReportUse ); + DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJ_REPORT_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGameobjectReportUse ); //DEFINE_OPCODE_HANDLER(SMSG_HIGHEST_THREAT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_THREAT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_THREAT_REMOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 57fe4b2bf8f..0bdfd6cc76e 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -172,8 +172,8 @@ enum Opcodes CMSG_FORCE_TURN_RATE_CHANGE_ACK = 0x00, CMSG_FORCE_WALK_SPEED_CHANGE_ACK = 0x00, CMSG_GAMEOBJECT_QUERY = 0xCEFF, - CMSG_GAMEOBJ_REPORT_USE = 0x00, - CMSG_GAMEOBJ_USE = 0x9A4A, // might be CMSG_GAMEOBJ_REPORT_USE + CMSG_GAMEOBJ_REPORT_USE = 0x9A4A, + CMSG_GAMEOBJ_USE = 0x1E77, CMSG_GAMESPEED_SET = 0x00, CMSG_GAMETIME_SET = 0x00, CMSG_GETDEATHBINDZONE = 0x00, -- cgit v1.2.3 From 643b6acc4ff15b340e67b9a14eb5f1d19cceb42e Mon Sep 17 00:00:00 2001 From: Subv2112 Date: Mon, 16 Jan 2012 15:27:36 -0500 Subject: Core/Vendors: Fixed SMSG_LIST_INVENTORY, you can buy things from vendors now Signed-off-by: Subv2112 --- .../game/Server/Protocol/Handlers/ItemHandler.cpp | 60 ++++++++++++++++++---- 1 file changed, 50 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp b/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp index c733e1ac9b3..2146b8a89bb 100755 --- a/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp @@ -730,25 +730,64 @@ void WorldSession::SendListInventory(uint64 vendorGuid) if (vendor->HasUnitState(UNIT_STAT_MOVING)) vendor->StopMoving(); + uint8* bytes = (uint8*)&vendorGuid; + VendorItemData const* items = vendor->GetVendorItems(); if (!items) { WorldPacket data(SMSG_LIST_INVENTORY, 8 + 1 + 1); - data << uint64(vendorGuid); + data.WriteByteMask(bytes[5]); + data.WriteByteMask(bytes[6]); + data.WriteByteMask(bytes[1]); + data.WriteByteMask(bytes[2]); + data.WriteByteMask(bytes[3]); + data.WriteByteMask(bytes[0]); + data.WriteByteMask(bytes[7]); + data.WriteByteMask(bytes[4]); + + data.WriteByteSeq(bytes[2]); + data.WriteByteSeq(bytes[3]); + data << uint8(0); // count == 0, next will be error code - data << uint8(0); // "Vendor has no inventory" + data << uint8(0xA0); // Only seen 0xA0 (160) so far ( should we send 0 here?) + + data.WriteByteSeq(bytes[4]); + data.WriteByteSeq(bytes[7]); + data.WriteByteSeq(bytes[6]); SendPacket(&data); return; } uint8 itemCount = items->GetItemCount(); uint8 count = 0; - + WorldPacket data(SMSG_LIST_INVENTORY, 8 + 1 + itemCount * 8 * 4); - data << uint64(vendorGuid); - + + data.WriteByteMask(bytes[5]); + data.WriteByteMask(bytes[6]); + data.WriteByteMask(bytes[1]); + data.WriteByteMask(bytes[2]); + data.WriteByteMask(bytes[3]); + data.WriteByteMask(bytes[0]); + data.WriteByteMask(bytes[7]); + data.WriteByteMask(bytes[4]); + + data.WriteByteSeq(bytes[2]); + data.WriteByteSeq(bytes[3]); + size_t countPos = data.wpos(); - data << uint8(count); + data << uint32(count); + + data.WriteByteSeq(bytes[5]); + data.WriteByteSeq(bytes[0]); + data.WriteByteSeq(bytes[1]); + + data << uint8(0xA0); // Only seen 0xA0 (160) so far + + data.WriteByteSeq(bytes[4]); + data.WriteByteSeq(bytes[7]); + data.WriteByteSeq(bytes[6]); + float discountMod = _player->GetReputationPriceDiscount(vendor); @@ -775,26 +814,27 @@ void WorldSession::SendListInventory(uint64 vendorGuid) // reputation discount int32 price = item->IsGoldRequired(itemTemplate) ? uint32(floor(itemTemplate->BuyPrice * discountMod)) : 0; + data << uint32(itemTemplate->MaxDurability); data << uint32(slot + 1); // client expects counting to start at 1 data << uint32(item->item); + data << uint32(0); // Always 0? data << uint32(itemTemplate->DisplayInfoID); data << int32(leftInStock); - data << uint32(price); - data << uint32(itemTemplate->MaxDurability); data << uint32(itemTemplate->BuyCount); data << uint32(item->ExtendedCost); + data << uint32(1); // Always 1? + data << uint32(price); } } } if (count == 0) { - data << uint8(0); SendPacket(&data); return; } - data.put(countPos, count); + data.put(countPos, count); SendPacket(&data); } -- cgit v1.2.3 From 37ffa978f70ed05073a281af9b74128598af8c32 Mon Sep 17 00:00:00 2001 From: Subv2112 Date: Mon, 16 Jan 2012 21:44:22 -0500 Subject: Fixed Run speed change opcodes, thanks to LordJZ for the opcode ids --- src/server/game/Entities/Unit/Unit.cpp | 56 ++++++++++++++++++++++++++----- src/server/game/Server/Protocol/Opcodes.h | 4 +-- 2 files changed, 49 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 582b2e79596..39e9e077e3e 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -12629,6 +12629,8 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) propagateSpeedChange(); WorldPacket data; + uint64 guid = GetGUID(); + uint8* bytes = (uint8*)&guid; if (!forced) { switch (mtype) @@ -12637,7 +12639,26 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) data.Initialize(MSG_MOVE_SET_WALK_SPEED, 8+4+2+4+4+4+4+4+4+4); break; case MOVE_RUN: - data.Initialize(MSG_MOVE_SET_RUN_SPEED, 8+4+2+4+4+4+4+4+4+4); + data.Initialize(SMSG_MOVE_SPLINE_SET_RUN_SPEED, 1 + 8 + 4); + data.WriteByteMask(bytes[7]); + data.WriteByteMask(bytes[2]); + data.WriteByteMask(bytes[1]); + data.WriteByteMask(bytes[3]); + data.WriteByteMask(bytes[5]); + data.WriteByteMask(bytes[6]); + data.WriteByteMask(bytes[4]); + data.WriteByteMask(bytes[0]); + + data.WriteByteSeq(bytes[6]); + data.WriteByteSeq(bytes[7]); + data.WriteByteSeq(bytes[4]); + data.WriteByteSeq(bytes[3]); + data.WriteByteSeq(bytes[2]); + data.WriteByteSeq(bytes[5]); + data.WriteByteSeq(bytes[0]); + data.WriteByteSeq(bytes[1]); + + data << float(GetSpeed(mtype)); break; case MOVE_RUN_BACK: data.Initialize(MSG_MOVE_SET_RUN_BACK_SPEED, 8+4+2+4+4+4+4+4+4+4); @@ -12665,7 +12686,7 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) return; } - data.append(GetPackGUID()); + /*data.append(GetPackGUID()); data << uint32(0); // movement flags data << uint16(0); // unk flags data << uint32(getMSTime()); @@ -12674,7 +12695,8 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) data << float(GetPositionZ()); data << float(GetOrientation()); data << uint32(0); // fall time - data << float(GetSpeed(mtype)); + data << float(GetSpeed(mtype));*/ + SendMessageToSet(&data, true); } else @@ -12696,7 +12718,28 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) data.Initialize(SMSG_FORCE_WALK_SPEED_CHANGE, 16); break; case MOVE_RUN: - data.Initialize(SMSG_FORCE_RUN_SPEED_CHANGE, 17); + data.Initialize(SMSG_FORCE_RUN_SPEED_CHANGE, 1 + 8 + 4 + 4 ); + data.WriteByteMask(bytes[1]); + data.WriteByteMask(bytes[0]); + data.WriteByteMask(bytes[7]); + data.WriteByteMask(bytes[5]); + data.WriteByteMask(bytes[2]); + data.WriteByteMask(bytes[4]); + data.WriteByteMask(bytes[3]); + data.WriteByteMask(bytes[6]); + + data.WriteByteSeq(bytes[1]); + + data << float(GetSpeed(mtype)); + + data.WriteByteSeq(bytes[6]); + data.WriteByteSeq(bytes[2]); + data.WriteByteSeq(bytes[3]); + data.WriteByteSeq(bytes[7]); + data.WriteByteSeq(bytes[4]); + data.WriteByteSeq(bytes[0]); + data.WriteByteSeq(bytes[5]); + data << uint32(0); break; case MOVE_RUN_BACK: data.Initialize(SMSG_FORCE_RUN_BACK_SPEED_CHANGE, 16); @@ -12723,11 +12766,6 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) sLog->outError("Unit::SetSpeed: Unsupported move type (%d), data not sent to client.", mtype); return; } - data.append(GetPackGUID()); - data << (uint32)0; // moveEvent, NUM_PMOVE_EVTS = 0x39 - if (mtype == MOVE_RUN) - data << uint8(0); // new 2.1.0 - data << float(GetSpeed(mtype)); SendMessageToSet(&data, true); } } diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 0bdfd6cc76e..ed657814d18 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -485,7 +485,8 @@ enum Opcodes MSG_MOVE_SET_RUN_BACK_SPEED = 0x00, MSG_MOVE_SET_RUN_BACK_SPEED_CHEAT = 0x00, MSG_MOVE_SET_RUN_MODE = 0x21A4, - MSG_MOVE_SET_RUN_SPEED = 0x00, + SMSG_FORCE_RUN_SPEED_CHANGE = 0xE24E, // for self + SMSG_MOVE_SPLINE_SET_RUN_SPEED = 0xB2CE, // for others MSG_MOVE_SET_RUN_SPEED_CHEAT = 0x00, MSG_MOVE_SET_SWIM_BACK_SPEED = 0x00, MSG_MOVE_SET_SWIM_BACK_SPEED_CHEAT = 0x00, @@ -694,7 +695,6 @@ enum Opcodes SMSG_FORCE_MOVE_UNROOT = 0x00, SMSG_FORCE_PITCH_RATE_CHANGE = 0x00, SMSG_FORCE_RUN_BACK_SPEED_CHANGE = 0x00, - SMSG_FORCE_RUN_SPEED_CHANGE = 0x00, SMSG_FORCE_SEND_QUEUED_PACKETS = 0x1380, SMSG_FORCE_SWIM_BACK_SPEED_CHANGE = 0x00, SMSG_FORCE_SWIM_SPEED_CHANGE = 0x00, -- cgit v1.2.3 From 1c413aa1d67a5b78155a14aa695b358d37572a8a Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Tue, 17 Jan 2012 19:17:11 +0800 Subject: Core/Opcodes: 40++ new Opcodes. Signed-off-by: Gyx <2359980687@qq.com> --- src/server/game/Server/Protocol/Opcodes.h | 84 +++++++++++++++---------------- 1 file changed, 42 insertions(+), 42 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 0bdfd6cc76e..509faffe22a 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -231,7 +231,7 @@ enum Opcodes CMSG_GUILD_REMOVE = 0x00, CMSG_GUILD_ROSTER = 0x9952, CMSG_GUILD_SET_NOTE = 0x9958, - CMSG_HEARTH_AND_RESURRECT = 0x00, + CMSG_HEARTH_AND_RESURRECT = 0xDC4E, CMSG_IGNORE_TRADE = 0x00, CMSG_INITIATE_TRADE = 0x00, CMSG_INSPECT = 0x9A7B, @@ -278,16 +278,16 @@ enum Opcodes CMSG_MESSAGECHAT_ADDON_RAID = 0x3041, CMSG_MESSAGECHAT_ADDON_WHISPER = 0x20C1, CMSG_MESSAGECHAT_AFK = 0x30C1, - CMSG_MESSAGECHAT_BATTLEGROUND = 0x00, + CMSG_MESSAGECHAT_BATTLEGROUND = 0x20C9, CMSG_MESSAGECHAT_BATTLEGROUND_LEADER = 0x00, CMSG_MESSAGECHAT_CHANNEL = 0x7459, CMSG_MESSAGECHAT_DND = 0x30C9, CMSG_MESSAGECHAT_EMOTE = 0x6449, CMSG_MESSAGECHAT_GUILD = 0x60C1, - CMSG_MESSAGECHAT_OFFICER = 0x00, + CMSG_MESSAGECHAT_OFFICER = 0x7049, CMSG_MESSAGECHAT_PARTY = 0x24C9, CMSG_MESSAGECHAT_PARTY_LEADER = 0x00, - CMSG_MESSAGECHAT_RAID = 0x00, + CMSG_MESSAGECHAT_RAID = 0x60D1, CMSG_MESSAGECHAT_RAID_LEADER = 0x00, CMSG_MESSAGECHAT_RAID_WARNING = 0x00, CMSG_MESSAGECHAT_SAY = 0x2459, @@ -432,9 +432,9 @@ enum Opcodes CMSG_TRAINER_LIST = 0xCC7F, CMSG_TRIGGER_CINEMATIC_CHEAT = 0x00, CMSG_TURN_IN_PETITION = 0x9C67, - CMSG_TUTORIAL_CLEAR = 0x00, - CMSG_TUTORIAL_FLAG = 0x00, - CMSG_TUTORIAL_RESET = 0x00, + CMSG_TUTORIAL_CLEAR = 0x1CE7, + CMSG_TUTORIAL_FLAG = 0x9E73, + CMSG_TUTORIAL_RESET = 0x8AF7, CMSG_UNACCEPT_TRADE = 0x00, CMSG_UNLEARN_SKILL = 0xAC3, CMSG_UNREGISTER_ALL_ADDON_PREFIXES = 0x00, @@ -454,8 +454,8 @@ enum Opcodes CMSG_ZONEUPDATE = 0x4AE2, MSG_AUCTION_HELLO = 0xCC7A, MSG_BATTLEGROUND_PLAYER_POSITIONS = 0x00, - MSG_CHANNEL_START = 0x00, - MSG_CHANNEL_UPDATE = 0x00, + MSG_CHANNEL_START = 0xDCC2, + MSG_CHANNEL_UPDATE = 0xCC5E, MSG_CORPSE_QUERY = 0xC876, MSG_GM_BIND_OTHER = 0x00, MSG_GM_SHOWLABEL = 0x00, @@ -602,14 +602,14 @@ enum Opcodes SMSG_BATTLEGROUND_PLAYER_LEFT = 0x00, SMSG_BATTLEGROUND_PLAYER_POSITIONS = 0x00, SMSG_BINDER_CONFIRM = 0x0ADA, - SMSG_BINDPOINTUPDATE = 0x00, + SMSG_BINDPOINTUPDATE = 0x98CF, SMSG_BINDZONEREPLY = 0x1A42, SMSG_BREAK_TARGET = 0x0E7E, SMSG_BUY_BANK_SLOT_RESULT = 0x00, SMSG_BUY_FAILED = 0x4A7F, SMSG_BUY_ITEM = 0xCA67, SMSG_CALENDAR_COMMAND_RESULT = 0x9A4E, - SMSG_CALENDAR_SEND_CALENDAR = 0x00, + SMSG_CALENDAR_SEND_CALENDAR = 0x8FB, SMSG_CALENDAR_SEND_NUM_PENDING = 0x00, SMSG_CANCEL_AUTO_REPEAT = 0x5ACB, SMSG_CANCEL_COMBAT = 0x00, @@ -637,13 +637,13 @@ enum Opcodes SMSG_COMMENTATOR_MAP_INFO = 0x00, SMSG_COMMENTATOR_PLAYER_INFO = 0x00, SMSG_COMMENTATOR_STATE_CHANGED = 0x00, - SMSG_COMPLAIN_RESULT = 0x00, + SMSG_COMPLAIN_RESULT = 0x8A4B, SMSG_COMPRESSED_CHAR_ENUM = 0x380A, SMSG_COMPRESSED_GUILD_ROSTER = 0x5A29, SMSG_COMPRESSED_MOVES = 0x0862, SMSG_COMPRESSED_UPDATE_OBJECT = 0x1CC3, SMSG_CONTACT_LIST = 0x0A6B, - SMSG_CONVERT_RUNE = 0x00, + SMSG_CONVERT_RUNE = 0x9EE7, SMSG_COOLDOWN_CHEAT = 0x00, SMSG_COOLDOWN_EVENT = 0x00, SMSG_CORPSE_MAP_POSITION_QUERY_RESPONSE = 0x00, @@ -657,7 +657,7 @@ enum Opcodes SMSG_DAMAGE_DONE_OBSOLETE = 0x00, SMSG_DANCE_QUERY_RESPONSE = 0x9E42, SMSG_DB_REPLY = 0x76EC, - SMSG_DEATH_RELEASE_LOC = 0x00, + SMSG_DEATH_RELEASE_LOC = 0x8C6, SMSG_DEFENSE_MESSAGE = 0x9EC3, SMSG_DESTROY_OBJECT = 0x486B, SMSG_DESTRUCTIBLE_BUILDING_DAMAGE = 0x00, @@ -670,7 +670,7 @@ enum Opcodes SMSG_DUEL_OUTOFBOUNDS = 0x00, SMSG_DUEL_REQUESTED = 0x1EC6, SMSG_DUEL_WINNER = 0xDA52, - SMSG_DURABILITY_DAMAGE_DEATH = 0x00, + SMSG_DURABILITY_DAMAGE_DEATH = 0xACF, SMSG_ECHO_PARTY_SQUELCH = 0x5ED7, SMSG_EMOTE = 0xC67, SMSG_ENABLE_BARBER_SHOP = 0x00, @@ -701,9 +701,9 @@ enum Opcodes SMSG_FORCE_TURN_RATE_CHANGE = 0x00, SMSG_FORCE_WALK_SPEED_CHANGE = 0x00, SMSG_FRIEND_STATUS = 0xD852, - SMSG_GAMEOBJECT_CUSTOM_ANIM = 0x00, + SMSG_GAMEOBJECT_CUSTOM_ANIM = 0xCCE, SMSG_GAMEOBJECT_DESPAWN_ANIM = 0x0A5E, - SMSG_GAMEOBJECT_PAGETEXT = 0x00, + SMSG_GAMEOBJECT_PAGETEXT = 0xD8DE, SMSG_GAMEOBJECT_QUERY_RESPONSE = 0xCCF7, SMSG_GAMEOBJECT_RESET_STATE = 0x00, SMSG_GAMESPEED_SET = 0x5ACA, @@ -722,7 +722,7 @@ enum Opcodes SMSG_GOSSIP_MESSAGE = 0xCCEB, SMSG_GOSSIP_POI = 0x1866, SMSG_GROUP_CANCEL = 0xED6, - SMSG_GROUP_DECLINE = 0x00, + SMSG_GROUP_DECLINE = 0x0863, SMSG_GROUP_DESTROYED = 0x00, SMSG_GROUP_INVITE = 0x00, SMSG_GROUP_JOINED_BATTLEGROUND = 0x265C, @@ -756,43 +756,43 @@ enum Opcodes SMSG_INSPECT_HONOR_STATS = 0x00, SMSG_INSPECT_TALENT = 0x48EF, SMSG_INSTANCE_DIFFICULTY = 0x00, - SMSG_INSTANCE_LOCK_WARNING_QUERY = 0x00, + SMSG_INSTANCE_LOCK_WARNING_QUERY = 0x4E7F, SMSG_INSTANCE_RESET = 0xDAC2, SMSG_INSTANCE_RESET_FAILED = 0xCEFE, SMSG_INSTANCE_SAVE_CREATED = 0xCE56, SMSG_INVALIDATE_DANCE = 0x1EEF, SMSG_INVALIDATE_PLAYER = 0x5C5F, SMSG_INVALID_PROMOTION_CODE = 0xD8FE, - SMSG_INVENTORY_CHANGE_FAILURE = 0x00, + SMSG_INVENTORY_CHANGE_FAILURE = 0xC8EE, SMSG_ITEM_COOLDOWN = 0x00, - SMSG_ITEM_ENCHANT_TIME_UPDATE = 0x00, + SMSG_ITEM_ENCHANT_TIME_UPDATE = 0xDCE6, SMSG_ITEM_NAME_QUERY_RESPONSE = 0x00, SMSG_ITEM_PUSH_RESULT = 0x8EFB, SMSG_ITEM_REFUND_INFO_RESPONSE = 0x304E, SMSG_ITEM_REFUND_RESULT = 0x60DC, SMSG_ITEM_TEXT_QUERY_RESPONSE = 0x984A, - SMSG_ITEM_TIME_UPDATE = 0x00, + SMSG_ITEM_TIME_UPDATE = 0x8AEB, SMSG_JOINED_BATTLEGROUND_QUEUE = 0x00, SMSG_LEARNED_DANCE_MOVES = 0xE52, SMSG_LEARNED_SPELL = 0x88D3, SMSG_LEVELUP_INFO = 0x9A73, - SMSG_LFG_BOOT_PLAYER = 0x00, - SMSG_LFG_DISABLED = 0x00, - SMSG_LFG_JOIN_RESULT = 0x00, - SMSG_LFG_OFFER_CONTINUE = 0x00, - SMSG_LFG_OPEN_FROM_GOSSIP = 0x00, - SMSG_LFG_PARTY_INFO = 0x00, + SMSG_LFG_BOOT_PLAYER = 0x4A5F, + SMSG_LFG_DISABLED = 0xCAEA, + SMSG_LFG_JOIN_RESULT = 0xCCCB, + SMSG_LFG_OFFER_CONTINUE = 0x8E7E, + SMSG_LFG_OPEN_FROM_GOSSIP = 0xC5E, + SMSG_LFG_PARTY_INFO = 0x5E47, SMSG_LFG_PLAYER_INFO = 0xC85F, SMSG_LFG_PLAYER_REWARD = 0x00, - SMSG_LFG_PROPOSAL_UPDATE = 0x00, - SMSG_LFG_QUEUE_STATUS = 0x00, - SMSG_LFG_ROLE_CHECK_UPDATE = 0x00, - SMSG_LFG_ROLE_CHOSEN = 0x00, - SMSG_LFG_TELEPORT_DENIED = 0x00, + SMSG_LFG_PROPOSAL_UPDATE = 0x485E, + SMSG_LFG_QUEUE_STATUS = 0x5AF6, + SMSG_LFG_ROLE_CHECK_UPDATE = 0x5C6F, + SMSG_LFG_ROLE_CHOSEN = 0x8C5A, + SMSG_LFG_TELEPORT_DENIED = 0x585F, SMSG_LFG_UPDATE_LIST = 0x0EFB, - SMSG_LFG_UPDATE_PARTY = 0x00, + SMSG_LFG_UPDATE_PARTY = 0xCCF6, SMSG_LFG_UPDATE_PLAYER = 0x00, - SMSG_LFG_UPDATE_SEARCH = 0x00, + SMSG_LFG_UPDATE_SEARCH = 0x1E53, SMSG_LIST_INVENTORY = 0x264C, SMSG_LOGIN_SETTIMESPEED = 0x5ECA, SMSG_LOGIN_VERIFY_WORLD = 0xC86E, @@ -855,7 +855,7 @@ enum Opcodes SMSG_PARTYKILLLOG = 0xCCC2, SMSG_PARTY_COMMAND_RESULT = 0x00, SMSG_PARTY_MEMBER_STATS = 0xDC5A, - SMSG_PARTY_MEMBER_STATS_FULL = 0x00, + SMSG_PARTY_MEMBER_STATS_FULL = 0xEDF, SMSG_PAUSE_MIRROR_TIMER = 0x00, SMSG_PERIODICAURALOG = 0x00, SMSG_PETGODMODE = 0x00, @@ -919,7 +919,7 @@ enum Opcodes SMSG_QUEST_FORCE_REMOVED = 0x00, SMSG_QUEST_POI_QUERY_RESPONSE = 0x8CC3, SMSG_QUEST_QUERY_RESPONSE = 0x9E56, - SMSG_RAID_GROUP_ONLY = 0x00, + SMSG_RAID_GROUP_ONLY = 0xDCDB, SMSG_RAID_INSTANCE_INFO = 0x4ACA, SMSG_RAID_INSTANCE_MESSAGE = 0xD862, SMSG_RANDOMIZE_CHAR_NAME = 0xF0DC, @@ -931,12 +931,12 @@ enum Opcodes SMSG_REDIRECT_CLIENT = 0x0180, SMSG_REFER_A_FRIEND_FAILURE = 0x4867, SMSG_REMOVED_SPELL = 0x98FE, - SMSG_REPORT_PVP_AFK_RESULT = 0x00, + SMSG_REPORT_PVP_AFK_RESULT = 0xE56, SMSG_REQUEST_CEMETERY_LIST_RESPONSE = 0x00, SMSG_RESET_FAILED_NOTIFY = 0x00, SMSG_RESISTLOG = 0x00, SMSG_RESPOND_INSPECT_ACHIEVEMENTS = 0x00, - SMSG_RESURRECT_REQUEST = 0x00, + SMSG_RESURRECT_REQUEST = 0xAFE, SMSG_RESYNC_RUNES = 0x00, SMSG_RWHOIS = 0xCCE2, SMSG_SELL_ITEM = 0x9CD3, @@ -956,7 +956,7 @@ enum Opcodes SMSG_SET_PROFICIENCY = 0x9C5F, SMSG_SET_PROJECTILE_POSITION = 0x00, SMSG_SHOWTAXINODES = 0x8CFB, - SMSG_SHOW_BANK = 0x00, + SMSG_SHOW_BANK = 0xCCA, SMSG_SPELLBREAKLOG = 0x00, SMSG_SPELLDAMAGESHIELD = 0x8AFE, SMSG_SPELLDISPELLOG = 0x00, @@ -975,7 +975,7 @@ enum Opcodes SMSG_SPELL_GO = 0x0A53, SMSG_SPELL_START = 0xCE43, SMSG_SPELL_UPDATE_CHAIN_TARGETS = 0x00, - SMSG_SPIRIT_HEALER_CONFIRM = 0x00, + SMSG_SPIRIT_HEALER_CONFIRM = 0xA4A, SMSG_SPLINE_MOVE_LAND_WALK = 0x00, SMSG_SPLINE_MOVE_ROOT = 0x00, SMSG_SPLINE_MOVE_UNROOT = 0x00, @@ -1001,7 +1001,7 @@ enum Opcodes SMSG_TRADE_STATUS = 0x00, SMSG_TRADE_STATUS_EXTENDED = 0x00, SMSG_TRAINER_BUY_RESULT = 0x00, - SMSG_TRAINER_BUY_SUCCEEDED = 0x00, + SMSG_TRAINER_BUY_SUCCEEDED = 0xDCDE, SMSG_TRAINER_LIST = 0xC84E, SMSG_TRANSFER_ABORTED = 0x0CF7, SMSG_TRANSFER_PENDING = 0xCA6E, -- cgit v1.2.3 From eae789c5c1ca4d4399d7ec7d89b57f0c980099e4 Mon Sep 17 00:00:00 2001 From: kaelima Date: Wed, 18 Jan 2012 18:13:57 +0100 Subject: Core/Protocol: Fix and activate a handful of opcodes, also some cleanup / documentation --- src/server/game/Entities/Player/Player.cpp | 12 ++++++++-- src/server/game/Groups/Group.cpp | 1 - src/server/game/Guilds/Guild.cpp | 7 +++--- .../game/Server/Protocol/Handlers/LFGHandler.cpp | 7 ++++-- .../game/Server/Protocol/Handlers/SpellHandler.cpp | 8 ++++++- .../game/Server/Protocol/Handlers/TradeHandler.cpp | 22 +++++++++++++++++- src/server/game/Server/Protocol/Opcodes.cpp | 27 +++++++++++----------- src/server/game/Server/Protocol/Opcodes.h | 8 +++---- src/server/game/Spells/Spell.cpp | 25 +++++++++++--------- 9 files changed, 78 insertions(+), 39 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 71822cdc71d..5e031510752 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -2312,11 +2312,17 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati if (!GetSession()->PlayerLogout()) { WorldPacket data(SMSG_NEW_WORLD, 4 + 4 + 4 + 4 + 4); + if (m_transport) + data << m_movementInfo.t_pos.PositionXYZStream(); + else + data << m_teleport_dest.PositionXYZStream(); + data << uint32(mapid); + if (m_transport) - data << m_movementInfo.t_pos.PositionXYZOStream(); + data << m_movementInfo.t_pos.GetOrientation(); else - data << m_teleport_dest.PositionXYZOStream(); + data << m_teleport_dest.GetOrientation(); GetSession()->SendPacket(&data); SendSavedInstances(); @@ -18144,10 +18150,12 @@ void Player::SendRaidInfo() InstanceSave* save = itr->second.save; data << uint32(save->GetMapId()); // map id data << uint32(save->GetDifficulty()); // difficulty + data << uint32(0); // Unknown 4.2.2 data << uint64(save->GetInstanceId()); // instance id data << uint8(1); // expired = 0 data << uint8(0); // extended = 1 data << uint32(save->GetResetTime() - now); // reset time + data << uint32(0); // Unknown 4.2.2 ++counter; } } diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index 5f1b27a5d53..0411d8854ad 100755 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -1338,7 +1338,6 @@ void Group::SendUpdateToPlayer(uint64 playerGUID, MemberSlot* slot) data << uint8(m_lootThreshold); // loot threshold data << uint8(m_dungeonDifficulty); // Dungeon Difficulty data << uint8(m_raidDifficulty); // Raid Difficulty - data << uint8(0); // 3.3 } player->GetSession()->SendPacket(&data); diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 6bffb2e545e..12dff5fbae2 100755 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -1820,14 +1820,13 @@ void Guild::SendPermissions(WorldSession* session) const { uint64 guid = session->GetPlayer()->GetGUID(); uint8 rankId = session->GetPlayer()->GetRank(); - + uint8 tabSize = _GetPurchasedTabsSize(); WorldPacket data(MSG_GUILD_PERMISSIONS, 4 * 15 + 1); data << uint32(rankId); data << uint32(_GetRankRights(rankId)); data << uint32(_GetMemberRemainingMoney(guid)); - data << uint8 (_GetPurchasedTabsSize()); - // Why sending all info when not all tabs are purchased??? - for (uint8 tabId = 0; tabId < GUILD_BANK_MAX_TABS; ++tabId) + data << uint8(tabSize); + for (uint8 tabId = 0; tabId < tabSize; ++tabId) { data << uint32(_GetRankBankTabRights(rankId, tabId)); data << uint32(_GetMemberRemainingSlots(guid, tabId)); diff --git a/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp b/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp index 9666a054225..7d4e4ec28ae 100755 --- a/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp @@ -32,6 +32,8 @@ void BuildPlayerLockDungeonBlock(WorldPacket& data, const LfgLockMap& lock) { data << uint32(it->first); // Dungeon entry (id + type) data << uint32(it->second); // Lock status + data << uint32(0); // Unknown 4.2.2 + data << uint32(0); // Unknown 4.2.2 } } @@ -256,7 +258,7 @@ void WorldSession::HandleLfgPartyLockInfoRequestOpcode(WorldPacket& /*recv_data uint32 size = 0; for (LfgLockPartyMap::const_iterator it = lockMap.begin(); it != lockMap.end(); ++it) - size += 8 + 4 + uint32(it->second.size()) * (4 + 4); + size += 8 + 4 + uint32(it->second.size()) * (4 + 4 + 4 + 4); sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_PARTY_INFO [" UI64FMTD "]", guid); WorldPacket data(SMSG_LFG_PARTY_INFO, 1 + size); @@ -443,7 +445,7 @@ void WorldSession::SendLfgJoinResult(const LfgJoinResultData& joinData) { uint32 size = 0; for (LfgLockPartyMap::const_iterator it = joinData.lockmap.begin(); it != joinData.lockmap.end(); ++it) - size += 8 + 4 + uint32(it->second.size()) * (4 + 4); + size += 8 + 4 + uint32(it->second.size()) * (4 + 4 + 4 + 4); sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_JOIN_RESULT [" UI64FMTD "] checkResult: %u checkValue: %u", GetPlayer()->GetGUID(), joinData.result, joinData.state); WorldPacket data(SMSG_LFG_JOIN_RESULT, 4 + 4 + size); @@ -530,6 +532,7 @@ void WorldSession::SendLfgBootPlayer(const LfgPlayerBoot* pBoot) data << uint8(pBoot->inProgress); // Vote in progress data << uint8(playerVote != LFG_ANSWER_PENDING); // Did Vote data << uint8(playerVote == LFG_ANSWER_AGREE); // Agree + data << uint8(0); // Unknown 4.2.2 data << uint64(pBoot->victim); // Victim GUID data << uint32(votesNum); // Total Votes data << uint32(agreeNum); // Agree Count diff --git a/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp b/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp index b867100e7b7..2a6f4902dac 100755 --- a/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp @@ -21,6 +21,7 @@ #include "WorldPacket.h" #include "WorldSession.h" #include "ObjectMgr.h" +#include "GuildMgr.h" #include "SpellMgr.h" #include "Log.h" #include "Opcodes.h" @@ -600,12 +601,17 @@ void WorldSession::HandleMirrorImageDataRequest(WorldPacket & recv_data) if (creator->GetTypeId() == TYPEID_PLAYER) { Player* player = creator->ToPlayer(); + uint32 guildId = player->GetGuildId(); + Guild* guild = NULL; + if (guildId) + guild = sGuildMgr->GetGuildById(guildId); + data << uint8(player->GetByteValue(PLAYER_BYTES, 0)); // skin data << uint8(player->GetByteValue(PLAYER_BYTES, 1)); // face data << uint8(player->GetByteValue(PLAYER_BYTES, 2)); // hair data << uint8(player->GetByteValue(PLAYER_BYTES, 3)); // haircolor data << uint8(player->GetByteValue(PLAYER_BYTES_2, 0)); // facialhair - data << uint32(player->GetGuildId()); // unk + data << uint64(guild ? guild->GetGuid() : 0); static EquipmentSlots const itemSlots[] = { diff --git a/src/server/game/Server/Protocol/Handlers/TradeHandler.cpp b/src/server/game/Server/Protocol/Handlers/TradeHandler.cpp index ebe54eb17eb..dc0165038c1 100755 --- a/src/server/game/Server/Protocol/Handlers/TradeHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/TradeHandler.cpp @@ -519,8 +519,28 @@ void WorldSession::HandleUnacceptTradeOpcode(WorldPacket& /*recvPacket*/) my_trade->SetAccepted(false, true); } -void WorldSession::HandleBeginTradeOpcode(WorldPacket& /*recvPacket*/) +void WorldSession::HandleBeginTradeOpcode(WorldPacket& recvPacket) { +/* + TODO: Need to verify + + BitStream mask = recvPacket.ReadBitStream(8); + + ByteBuffer bytes(8, true); + + if (mask[0]) bytes[5] = recvPacket.ReadUInt8() ^ 1; + if (mask[4]) bytes[2] = recvPacket.ReadUInt8() ^ 1; + if (mask[5]) bytes[3] = recvPacket.ReadUInt8() ^ 1; + if (mask[2]) bytes[4] = recvPacket.ReadUInt8() ^ 1; + if (mask[7]) bytes[1] = recvPacket.ReadUInt8() ^ 1; + if (mask[3]) bytes[0] = recvPacket.ReadUInt8() ^ 1; + if (mask[1]) bytes[6] = recvPacket.ReadUInt8() ^ 1; + if (mask[6]) bytes[7] = recvPacket.ReadUInt8() ^ 1; + + uint64 tradeGuid = BitConverter::ToUInt64(bytes); +*/ + recvPacket.rfinish(); + TradeData* my_trade = _player->m_trade; if (!my_trade) return; diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 1435dff4527..0b78b70785a 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -573,7 +573,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_CHANGEPLAYER_DIFFICULTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_RWHOIS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_PLAYER_REWARD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_TELEPORT_DENIED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LFG_TELEPORT_DENIED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_SKILL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnlearnSkillOpcode ); DEFINE_OPCODE_HANDLER(SMSG_REMOVED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -719,7 +719,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_BUYBACK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuybackItem ); DEFINE_OPCODE_HANDLER(SMSG_SERVER_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SET_SAVED_INSTANCE_EXTEND, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_OFFER_CONTINUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LFG_OFFER_CONTINUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_TEST_DROP_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_TEST_DROP_RATE_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_LFG_GET_STATUS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -760,7 +760,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_AREA_TRIGGER_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SHOWING_HELM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleShowingHelmOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SHOWING_CLOAK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleShowingCloakOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_ROLE_CHOSEN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LFG_ROLE_CHOSEN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAYER_SKINNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DURABILITY_DAMAGE_DEATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SET_EXPLORATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -777,7 +777,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SPLINE_DONE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveSplineDoneOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FALL_RESET, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_SAVE_CREATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RAID_INSTANCE_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_RAID_INSTANCE_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RAID_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestRaidInfoOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_TIME_SKIPPED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleMoveTimeSkippedOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FEATHER_FALL_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleFeatherFallAck ); @@ -926,24 +926,25 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_SEARCH_LFG_JOIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfrSearchOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SEARCH_LFG_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfrLeaveOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_PROPOSAL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LFG_PROPOSAL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_LFG_PROPOSAL_RESULT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgProposalResultOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_ROLE_CHECK_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_JOIN_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_QUEUE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LFG_ROLE_CHECK_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LFG_JOIN_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LFG_QUEUE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SET_LFG_COMMENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetCommentOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_PARTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_SEARCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_PARTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_SEARCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_ROLES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetRolesOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_NEEDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_BOOT_VOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetBootVoteOpcode ); + DEFINE_OPCODE_HANDLER(SMSG_LFG_BOOT_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_BOOT_PROPOSAL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_LFD_PLAYER_LOCK_INFO_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgPlayerLockInfoRequestOpcode); //DEFINE_OPCODE_HANDLER(SMSG_LFG_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_LFG_TELEPORT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgTeleportOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LFD_PARTY_LOCK_INFO_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgPartyLockInfoRequestOpcode); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_PARTY_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LFG_PARTY_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TITLE_EARNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_SET_TITLE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTitleOpcode ); DEFINE_OPCODE_HANDLER(CMSG_CANCEL_MOUNT_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelMountAuraOpcode ); @@ -981,7 +982,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_MAELSTROM_GM_SENT_MAIL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_RESET_FAILED_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_REAL_GROUP_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_DISABLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LFG_DISABLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_ACTIVE_PVP_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1241,7 +1242,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_PET_LEARNED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_REMOVED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); - //DEFINE_OPCODE_HANDLER(CMSG_HEARTH_AND_RESURRECT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleHearthAndResurrect ); + DEFINE_OPCODE_HANDLER(CMSG_HEARTH_AND_RESURRECT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleHearthAndResurrect ); //DEFINE_OPCODE_HANDLER(SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CRITERIA_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ACHIEVEMENT_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index edc006d64df..ca5c38152ed 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -471,7 +471,7 @@ enum Opcodes MSG_MOVE_HEARTBEAT = 0xB024, MSG_MOVE_HOVER = 0x00, MSG_MOVE_JUMP = 0x9225, - MSG_MOVE_KNOCK_BACK = 0x00, + MSG_MOVE_KNOCK_BACK = 0x00, // Possibly 0x60FE MSG_MOVE_ROOT = 0x00, MSG_MOVE_SET_ALL_SPEED_CHEAT = 0x00, MSG_MOVE_SET_FACING = 0x02A4, @@ -527,7 +527,7 @@ enum Opcodes MSG_PARTY_ASSIGNMENT = 0x00, MSG_PETITION_DECLINE = 0x98E7, MSG_PETITION_RENAME = 0x4857, - MSG_PVP_LOG_DATA = 0x60FE, + MSG_PVP_LOG_DATA = 0x0, MSG_QUERY_GUILD_BANK_TEXT = 0x00, MSG_QUERY_NEXT_MAIL_TIME = 0xCEE6, MSG_QUEST_PUSH_RESULT = 0x1863, @@ -610,7 +610,7 @@ enum Opcodes SMSG_BUY_FAILED = 0x4A7F, SMSG_BUY_ITEM = 0xCA67, SMSG_CALENDAR_COMMAND_RESULT = 0x9A4E, - SMSG_CALENDAR_SEND_CALENDAR = 0x8FB, + SMSG_CALENDAR_SEND_CALENDAR = 0x08FB, SMSG_CALENDAR_SEND_NUM_PENDING = 0x00, SMSG_CANCEL_AUTO_REPEAT = 0x5ACB, SMSG_CANCEL_COMBAT = 0x00, @@ -855,7 +855,7 @@ enum Opcodes SMSG_PARTYKILLLOG = 0xCCC2, SMSG_PARTY_COMMAND_RESULT = 0x00, SMSG_PARTY_MEMBER_STATS = 0xDC5A, - SMSG_PARTY_MEMBER_STATS_FULL = 0xEDF, + SMSG_PARTY_MEMBER_STATS_FULL = 0x0EDF, SMSG_PAUSE_MIRROR_TIMER = 0x00, SMSG_PERIODICAURALOG = 0x00, SMSG_PETGODMODE = 0x00, diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index a47c12aacd7..77b014eb67b 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3811,6 +3811,15 @@ void Spell::SendSpellStart() data << uint32(0); } + if (castFlags & CAST_FLAG_UNKNOWN_31) + { + data << uint32(0); + data << uint8(0); // unkByte + // if (unkByte == 2) + // data.append(0); + + } + m_caster->SendMessageToSet(&data, true); } @@ -3875,19 +3884,13 @@ void Spell::SendSpellGo() //The creature is the mover of a player, so HandleCastSpellOpcode uses it as the caster if (Player* player = m_caster->ToPlayer()) { - uint8 runeMaskInitial = m_runesState; - uint8 runeMaskAfterCast = player->GetRunesState(); - data << uint8(runeMaskInitial); // runes state before - data << uint8(runeMaskAfterCast); // runes state after + data << uint8(m_runesState); // runes state before + data << uint8(player->GetRunesState()); // runes state after for (uint8 i = 0; i < MAX_RUNES; ++i) { - uint8 mask = (1 << i); - if (mask & runeMaskInitial && !(mask & runeMaskAfterCast)) // usable before andon cooldown now... - { - // float casts ensure the division is performed on floats as we need float result - float baseCd = float(player->GetRuneBaseCooldown(i)); - data << uint8((baseCd - float(player->GetRuneCooldown(i))) / baseCd * 255); // rune cooldown passed - } + // float casts ensure the division is performed on floats as we need float result + float baseCd = float(player->GetRuneBaseCooldown(i)); + data << uint8((baseCd - float(player->GetRuneCooldown(i))) / baseCd * 255); // rune cooldown passed } } } -- cgit v1.2.3 From ba23b69a17e6eb8cc1173cd179bf8e1ae8ab6759 Mon Sep 17 00:00:00 2001 From: kaelima Date: Wed, 18 Jan 2012 18:26:15 +0100 Subject: Core/Protocol: Fix SMSG_TRAINER_BUY_SUCCEEDED and SMSG_MAIL_LIST_RESULT. Thanks Nay --- src/server/game/Entities/Item/Item.h | 4 +++- src/server/game/Server/Protocol/Handlers/MailHandler.cpp | 4 ++-- src/server/game/Server/Protocol/Handlers/NPCHandler.cpp | 2 ++ src/server/game/Server/Protocol/Handlers/SpellHandler.cpp | 4 ++-- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- 5 files changed, 10 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Item/Item.h b/src/server/game/Entities/Item/Item.h index 0960a3e5563..41c13f78029 100755 --- a/src/server/game/Entities/Item/Item.h +++ b/src/server/game/Entities/Item/Item.h @@ -162,7 +162,9 @@ enum EnchantmentSlot SOCK_ENCHANTMENT_SLOT_3 = 4, BONUS_ENCHANTMENT_SLOT = 5, PRISMATIC_ENCHANTMENT_SLOT = 6, // added at apply special permanent enchantment - MAX_INSPECTED_ENCHANTMENT_SLOT = 7, + //TODO: 7, + //TODO: 8, + MAX_INSPECTED_ENCHANTMENT_SLOT = 9, PROP_ENCHANTMENT_SLOT_0 = 7, // used with RandomSuffix PROP_ENCHANTMENT_SLOT_1 = 8, // used with RandomSuffix diff --git a/src/server/game/Server/Protocol/Handlers/MailHandler.cpp b/src/server/game/Server/Protocol/Handlers/MailHandler.cpp index cb75de0569e..95459bae0fa 100755 --- a/src/server/game/Server/Protocol/Handlers/MailHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/MailHandler.cpp @@ -596,10 +596,10 @@ void WorldSession::HandleGetMailList(WorldPacket & recv_data) break; } - data << uint32((*itr)->COD); // COD + data << uint64((*itr)->COD); // COD data << uint32(0); // probably changed in 3.3.3 data << uint32((*itr)->stationery); // stationery (Stationery.dbc) - data << uint32((*itr)->money); // Gold + data << uint64((*itr)->money); // Gold data << uint32((*itr)->checked); // flags data << float(((*itr)->expire_time-time(NULL))/DAY); // Time data << uint32((*itr)->mailTemplateId); // mail template (MailTemplate.dbc) diff --git a/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp b/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp index ae06832a19e..6145ef1438d 100755 --- a/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp @@ -292,6 +292,7 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket & recv_data) WorldPacket data(SMSG_TRAINER_BUY_SUCCEEDED, 12); data << uint64(guid); data << uint32(spellId); // should be same as in packet from client + data << uint32(0); // "Trainer service", 1 = "Not enough money for trainer service ". 0 = "Trainer service unavailable" SendPacket(&data); } @@ -492,6 +493,7 @@ void WorldSession::SendBindPoint(Creature* npc) WorldPacket data(SMSG_TRAINER_BUY_SUCCEEDED, (8+4)); data << uint64(npc->GetGUID()); data << uint32(bindspell); + data << uint32(0); // "Trainer service", 1 = "Not enough money for trainer service ". 0 = "Trainer service unavailable" SendPacket(&data); _player->PlayerTalkClass->SendCloseGossip(); diff --git a/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp b/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp index 2a6f4902dac..e15fc8b3871 100755 --- a/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp @@ -601,9 +601,9 @@ void WorldSession::HandleMirrorImageDataRequest(WorldPacket & recv_data) if (creator->GetTypeId() == TYPEID_PLAYER) { Player* player = creator->ToPlayer(); - uint32 guildId = player->GetGuildId(); Guild* guild = NULL; - if (guildId) + + if (uint32 guildId = player->GetGuildId()) guild = sGuildMgr->GetGuildById(guildId); data << uint8(player->GetByteValue(PLAYER_BYTES, 0)); // skin diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 0b78b70785a..36cf769f59a 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -496,7 +496,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_TRAINER_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerListOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_TRAINER_BUY_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerBuySpellOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_SUCCEEDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_SUCCEEDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_BINDER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBinderActivateOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_PLAYERBINDERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From 99086ac8a840515281447b4ddd1cd9ce14fee9a3 Mon Sep 17 00:00:00 2001 From: kaelima Date: Wed, 18 Jan 2012 19:01:22 +0100 Subject: Core/Protocol: Refix MSG_GUILD_PERMISSIONS after a misstake in my last commit --- src/server/game/Guilds/Guild.cpp | 5 ++--- src/server/game/Guilds/Guild.h | 2 +- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 12dff5fbae2..a7c5b04bcba 100755 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -1820,13 +1820,12 @@ void Guild::SendPermissions(WorldSession* session) const { uint64 guid = session->GetPlayer()->GetGUID(); uint8 rankId = session->GetPlayer()->GetRank(); - uint8 tabSize = _GetPurchasedTabsSize(); WorldPacket data(MSG_GUILD_PERMISSIONS, 4 * 15 + 1); data << uint32(rankId); data << uint32(_GetRankRights(rankId)); data << uint32(_GetMemberRemainingMoney(guid)); - data << uint8(tabSize); - for (uint8 tabId = 0; tabId < tabSize; ++tabId) + data << uint8(_GetPurchasedTabsSize()); + for (uint8 tabId = 0; tabId < GUILD_BANK_MAX_TABS; ++tabId) { data << uint32(_GetRankBankTabRights(rankId, tabId)); data << uint32(_GetMemberRemainingSlots(guid, tabId)); diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h index 87a95668555..f5d71d50023 100755 --- a/src/server/game/Guilds/Guild.h +++ b/src/server/game/Guilds/Guild.h @@ -29,7 +29,7 @@ class Item; enum GuildMisc { - GUILD_BANK_MAX_TABS = 6, // send by client for money log also + GUILD_BANK_MAX_TABS = 8, // send by client for money log also GUILD_BANK_MAX_SLOTS = 98, GUILD_BANK_MONEY_LOGS_TAB = 100, // used for money log in DB GUILD_RANKS_MIN_COUNT = 5, diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 36cf769f59a..b830444aaf2 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -1083,7 +1083,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_GM_CHARACTER_RESTORE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GM_CHARACTER_SAVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_VOICESESSION_FULL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(MSG_GUILD_PERMISSIONS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildPermissions ); + DEFINE_OPCODE_HANDLER(MSG_GUILD_PERMISSIONS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildPermissions ); //DEFINE_OPCODE_HANDLER(MSG_GUILD_BANK_MONEY_WITHDRAWN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankMoneyWithdrawn ); DEFINE_OPCODE_HANDLER(MSG_GUILD_EVENT_LOG_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildEventLogQueryOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_MAELSTROM_RENAME_GUILD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); -- cgit v1.2.3 From d2cf7d619ac580873cdcac1b2d643c2ab8980e7a Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Thu, 19 Jan 2012 12:53:17 +0800 Subject: Core/Opcodes: 8 new opcodes Signed-off-by: Gyx <2359980687@qq.com> --- src/server/game/Server/Protocol/Opcodes.h | 44 +++++++++++++++---------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index ca5c38152ed..c13806c8a49 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -38,7 +38,7 @@ enum Opcodes CMSG_ACTIVATETAXIEXPRESS = 0x5E7F, CMSG_ADD_FRIEND = 0x5C57, CMSG_ADD_IGNORE = 0xCEEA, - CMSG_ADD_VOICE_IGNORE = 0xA7A, + CMSG_ADD_VOICE_IGNORE = 0x0A7A, CMSG_ALTER_APPEARANCE = 0x5CE3, CMSG_AREATRIGGER = 0x5862, CMSG_AREA_SPIRIT_HEALER_QUERY = 0xDC7E, @@ -47,9 +47,9 @@ enum Opcodes CMSG_ARENA_TEAM_DECLINE = 0x8E73, CMSG_ARENA_TEAM_DISBAND = 0x4A5A, CMSG_ARENA_TEAM_INVITE = 0x4862, - CMSG_ARENA_TEAM_LEADER = 0x8F3, + CMSG_ARENA_TEAM_LEADER = 0x08F3, CMSG_ARENA_TEAM_LEAVE = 0x48EB, - CMSG_ARENA_TEAM_QUERY = 0x872, + CMSG_ARENA_TEAM_QUERY = 0x0872, CMSG_ARENA_TEAM_REMOVE = 0xCE5E, CMSG_ARENA_TEAM_ROSTER = 0x0A42, CMSG_ATTACKSTOP = 0x5AC3, @@ -59,7 +59,7 @@ enum Opcodes CMSG_AUCTION_LIST_OWNER_ITEMS = 0x9CDA, CMSG_AUCTION_PLACE_BID = 0x8E76, CMSG_AUCTION_REMOVE_ITEM = 0xCEC3, - CMSG_AUCTION_SELL_ITEM = 0xCE6, + CMSG_AUCTION_SELL_ITEM = 0x0CE6, CMSG_AUTH_SESSION = 0x1019, CMSG_AUTOBANK_ITEM = 0x8C56, CMSG_AUTOEQUIP_GROUND_ITEM = 0x00, @@ -514,7 +514,7 @@ enum Opcodes MSG_MOVE_STOP_STRAFE = 0x0125, MSG_MOVE_STOP_SWIM = 0xB424, MSG_MOVE_STOP_TURN = 0x90A4, - MSG_MOVE_TELEPORT = 0x00, + MSG_MOVE_TELEPORT = 0xF25C, MSG_MOVE_TELEPORT_ACK = 0x00, MSG_MOVE_TELEPORT_CHEAT = 0x00, MSG_MOVE_TIME_SKIPPED = 0x00, @@ -537,10 +537,10 @@ enum Opcodes MSG_RAID_TARGET_UPDATE = 0x00, MSG_RANDOM_ROLL = 0x4C57, MSG_SAVE_GUILD_EMBLEM = 0x4EE3, - MSG_SET_DUNGEON_DIFFICULTY = 0xC4F, + MSG_SET_DUNGEON_DIFFICULTY = 0x0C4F, MSG_SET_RAID_DIFFICULTY = 0x1A5A, MSG_TABARDVENDOR_ACTIVATE = 0x98EB, - MSG_TALENT_WIPE_CONFIRM = 0x00, + MSG_TALENT_WIPE_CONFIRM = 0x4C52, OBSOLETE_DROP_ITEM = 0x00, SMSG_ACCOUNT_DATA_TIMES = 0x5EE2, SMSG_ACHIEVEMENT_DELETED = 0x9ED2, @@ -553,8 +553,8 @@ enum Opcodes SMSG_ALL_ACHIEVEMENT_DATA = 0x00, SMSG_AREA_SPIRIT_HEALER_TIME = 0x00, SMSG_AREA_TRIGGER_MESSAGE = 0xCC42, - SMSG_ARENA_ERROR = 0x8C7, - SMSG_ARENA_OPPONENT_UPDATE = 0xAD6, + SMSG_ARENA_ERROR = 0x08C7, + SMSG_ARENA_OPPONENT_UPDATE = 0x0AD6, SMSG_ARENA_TEAM_CHANGE_FAILED_QUEUED = 0x4A4E, SMSG_ARENA_TEAM_COMMAND_RESULT = 0x605C, SMSG_ARENA_TEAM_EVENT = 0x5CDA, @@ -658,10 +658,10 @@ enum Opcodes SMSG_DAMAGE_DONE_OBSOLETE = 0x00, SMSG_DANCE_QUERY_RESPONSE = 0x9E42, SMSG_DB_REPLY = 0x76EC, - SMSG_DEATH_RELEASE_LOC = 0x8C6, + SMSG_DEATH_RELEASE_LOC = 0x08C6, SMSG_DEFENSE_MESSAGE = 0x9EC3, SMSG_DESTROY_OBJECT = 0x486B, - SMSG_DESTRUCTIBLE_BUILDING_DAMAGE = 0x00, + SMSG_DESTRUCTIBLE_BUILDING_DAMAGE = 0x1C5E, SMSG_DISMOUNT = 0xCEE7, SMSG_DISMOUNTRESULT = 0x00, SMSG_DISPEL_FAILED = 0x00, @@ -673,7 +673,7 @@ enum Opcodes SMSG_DUEL_WINNER = 0xDA52, SMSG_DURABILITY_DAMAGE_DEATH = 0xACF, SMSG_ECHO_PARTY_SQUELCH = 0x5ED7, - SMSG_EMOTE = 0xC67, + SMSG_EMOTE = 0x0C67, SMSG_ENABLE_BARBER_SHOP = 0x00, SMSG_ENCHANTMENTLOG = 0x00, SMSG_ENVIRONMENTALDAMAGELOG = 0x00, @@ -681,7 +681,7 @@ enum Opcodes SMSG_EQUIPMENT_SET_SAVED = 0x00, SMSG_EQUIPMENT_SET_USE_RESULT = 0x00, SMSG_EXPECTED_SPAM_RECORDS = 0x48E7, - SMSG_EXPLORATION_EXPERIENCE = 0xEE7, + SMSG_EXPLORATION_EXPERIENCE = 0x0EE7, SMSG_FEATURE_SYSTEM_STATUS = 0x70CE, SMSG_FISH_ESCAPED = 0x9C66, SMSG_FISH_NOT_HOOKED = 0x18C3, @@ -705,7 +705,7 @@ enum Opcodes SMSG_GAMEOBJECT_DESPAWN_ANIM = 0x0A5E, SMSG_GAMEOBJECT_PAGETEXT = 0xD8DE, SMSG_GAMEOBJECT_QUERY_RESPONSE = 0xCCF7, - SMSG_GAMEOBJECT_RESET_STATE = 0x00, + SMSG_GAMEOBJECT_RESET_STATE = 0x9CF3, SMSG_GAMESPEED_SET = 0x5ACA, SMSG_GAMETIME_SET = 0x9C4A, SMSG_GAMETIME_UPDATE = 0x18E3, @@ -721,7 +721,7 @@ enum Opcodes SMSG_GOSSIP_COMPLETE = 0xDE7B, SMSG_GOSSIP_MESSAGE = 0xCCEB, SMSG_GOSSIP_POI = 0x1866, - SMSG_GROUP_CANCEL = 0xED6, + SMSG_GROUP_CANCEL = 0x0ED6, SMSG_GROUP_DECLINE = 0x0863, SMSG_GROUP_DESTROYED = 0x00, SMSG_GROUP_INVITE = 0x00, @@ -752,7 +752,7 @@ enum Opcodes SMSG_INITIAL_SPELLS = 0x88FE, SMSG_INIT_CURRENCY = 0x227E, SMSG_INIT_WORLD_STATES = 0x9EDA, - SMSG_INSPECT = 0xE46, + SMSG_INSPECT = 0x0E46, SMSG_INSPECT_HONOR_STATS = 0x00, SMSG_INSPECT_TALENT = 0x48EF, SMSG_INSTANCE_DIFFICULTY = 0x00, @@ -827,7 +827,7 @@ enum Opcodes SMSG_MOUNTRESULT = 0x00, SMSG_MOUNTSPECIAL_ANIM = 0x9E77, SMSG_MOVE_FEATHER_FALL = 0x00, - SMSG_MOVE_KNOCK_BACK = 0x00, + SMSG_MOVE_KNOCK_BACK = 0x60FE, SMSG_MOVE_LAND_WALK = 0x00, SMSG_MOVE_NORMAL_FALL = 0x00, SMSG_MOVE_SET_CAN_FLY = 0x00, @@ -943,7 +943,7 @@ enum Opcodes SMSG_SEND_MAIL_RESULT = 0x8CC2, SMSG_SEND_UNLEARN_SPELLS = 0xCED2, SMSG_SERVERTIME = 0x1CD7, - SMSG_SERVER_FIRST_ACHIEVEMENT = 0xCDF, + SMSG_SERVER_FIRST_ACHIEVEMENT = 0x0CDF, SMSG_SERVER_MESSAGE = 0xC873, SMSG_SET_FACTION_ATWAR = 0x1E47, SMSG_SET_FACTION_STANDING = 0x1AE3, @@ -994,12 +994,12 @@ enum Opcodes SMSG_THREAT_CLEAR = 0x9E4A, SMSG_THREAT_REMOVE = 0x8A7E, SMSG_THREAT_UPDATE = 0x0CE3, - SMSG_TIME_SYNC_REQ = 0x1009, + SMSG_TIME_SYNC_REQ = 0xE46E, SMSG_TITLE_EARNED = 0x1AFA, SMSG_TOGGLE_XP_GAIN = 0x8A5B, SMSG_TOTEM_CREATED = 0x00, - SMSG_TRADE_STATUS = 0x00, - SMSG_TRADE_STATUS_EXTENDED = 0x00, + SMSG_TRADE_STATUS = 0xA0DC, + SMSG_TRADE_STATUS_EXTENDED = 0xF0EC, SMSG_TRAINER_BUY_RESULT = 0x00, SMSG_TRAINER_BUY_SUCCEEDED = 0xDCDE, SMSG_TRAINER_LIST = 0xC84E, @@ -1034,7 +1034,7 @@ enum Opcodes SMSG_WHO = 0x4C7F, SMSG_WHOIS = 0x9CFF, SMSG_WORLD_STATE_UI_TIMER_UPDATE = 0xDE5E, - SMSG_ZONE_UNDER_ATTACK = 0x8CF, + SMSG_ZONE_UNDER_ATTACK = 0x08CF, }; /// Player state -- cgit v1.2.3 From a215e68f4e79fe30a391409ec82b04b5672100c6 Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Thu, 19 Jan 2012 14:07:21 +0800 Subject: Core/Opcodes: 9 new opcodes Signed-off-by: Gyx <2359980687@qq.com> --- src/server/game/Server/Protocol/Opcodes.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index c13806c8a49..b30dc5531fb 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -471,8 +471,8 @@ enum Opcodes MSG_MOVE_HEARTBEAT = 0xB024, MSG_MOVE_HOVER = 0x00, MSG_MOVE_JUMP = 0x9225, - MSG_MOVE_KNOCK_BACK = 0x00, // Possibly 0x60FE - MSG_MOVE_ROOT = 0x00, + MSG_MOVE_KNOCK_BACK = 0x60FE, + MSG_MOVE_ROOT = 0xB0DE, MSG_MOVE_SET_ALL_SPEED_CHEAT = 0x00, MSG_MOVE_SET_FACING = 0x02A4, MSG_MOVE_SET_FLIGHT_BACK_SPEED = 0x00, @@ -515,9 +515,9 @@ enum Opcodes MSG_MOVE_STOP_SWIM = 0xB424, MSG_MOVE_STOP_TURN = 0x90A4, MSG_MOVE_TELEPORT = 0xF25C, - MSG_MOVE_TELEPORT_ACK = 0x00, - MSG_MOVE_TELEPORT_CHEAT = 0x00, - MSG_MOVE_TIME_SKIPPED = 0x00, + MSG_MOVE_TELEPORT_ACK = 0x2425, + MSG_MOVE_TELEPORT_CHEAT = 0xA5A5, + MSG_MOVE_TIME_SKIPPED = 0x3424, MSG_MOVE_TOGGLE_COLLISION_CHEAT = 0x00, MSG_MOVE_TOGGLE_FALL_LOGGING = 0x00, MSG_MOVE_TOGGLE_LOGGING = 0x00, @@ -527,7 +527,7 @@ enum Opcodes MSG_PARTY_ASSIGNMENT = 0x00, MSG_PETITION_DECLINE = 0x98E7, MSG_PETITION_RENAME = 0x4857, - MSG_PVP_LOG_DATA = 0x0, + MSG_PVP_LOG_DATA = 0x00, MSG_QUERY_GUILD_BANK_TEXT = 0x00, MSG_QUERY_NEXT_MAIL_TIME = 0xCEE6, MSG_QUEST_PUSH_RESULT = 0x1863, @@ -844,7 +844,7 @@ enum Opcodes SMSG_NEW_WORLD = 0x647E, SMSG_NOTIFICATION = 0x1A56, SMSG_NOTIFY_DANCE = 0xCE62, - SMSG_NOTIFY_DEST_LOC_SPELL_CAST = 0x00, + SMSG_NOTIFY_DEST_LOC_SPELL_CAST = 0x5CE2, SMSG_NPC_TEXT_UPDATE = 0x4C72, SMSG_NPC_WONT_TALK = 0x00, SMSG_OFFER_PETITION_ERROR = 0x1E7F, @@ -853,7 +853,7 @@ enum Opcodes SMSG_OVERRIDE_LIGHT = 0xCC56, SMSG_PAGE_TEXT_QUERY_RESPONSE = 0x18D2, SMSG_PARTYKILLLOG = 0xCCC2, - SMSG_PARTY_COMMAND_RESULT = 0x00, + SMSG_PARTY_COMMAND_RESULT = 0xCCD6, SMSG_PARTY_MEMBER_STATS = 0xDC5A, SMSG_PARTY_MEMBER_STATS_FULL = 0x0EDF, SMSG_PAUSE_MIRROR_TIMER = 0x00, @@ -897,7 +897,7 @@ enum Opcodes SMSG_PROPOSE_LEVEL_GRANT = 0x0C42, SMSG_PUREMOUNT_CANCELLED_OBSOLETE = 0x00, SMSG_PVP_CREDIT = 0x9EF2, - SMSG_QUERY_QUESTS_COMPLETED_RESPONSE = 0x00, + SMSG_QUERY_QUESTS_COMPLETED_RESPONSE = 0x8E7A, SMSG_QUERY_TIME_RESPONSE = 0xD85A, SMSG_QUESTGIVER_OFFER_REWARD = 0x00, SMSG_QUESTGIVER_QUEST_COMPLETE = 0x24EE, @@ -954,7 +954,7 @@ enum Opcodes SMSG_SET_PHASE_SHIFT = 0x204C, SMSG_SET_PLAYER_DECLINED_NAMES_RESULT = 0x0E67, SMSG_SET_PROFICIENCY = 0x9C5F, - SMSG_SET_PROJECTILE_POSITION = 0x00, + SMSG_SET_PROJECTILE_POSITION = 0xC8F7, SMSG_SHOWTAXINODES = 0x8CFB, SMSG_SHOW_BANK = 0xCCA, SMSG_SPELLBREAKLOG = 0x00, -- cgit v1.2.3 From e5bdc6612d2b7c289ae27829ed7b78254e0a61e3 Mon Sep 17 00:00:00 2001 From: Rat Date: Thu, 19 Jan 2012 12:59:28 +0100 Subject: Core/Packets: Moved Bit related functions to ByteBuffer from WorldPacket --- src/server/game/Server/WorldPacket.h | 22 ---------------------- src/server/shared/Packets/ByteBuffer.h | 22 ++++++++++++++++++++++ 2 files changed, 22 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/WorldPacket.h b/src/server/game/Server/WorldPacket.h index a005a1b57fa..f648e905bf9 100644 --- a/src/server/game/Server/WorldPacket.h +++ b/src/server/game/Server/WorldPacket.h @@ -50,28 +50,6 @@ class WorldPacket : public ByteBuffer void SetOpcode(Opcodes opcode) { m_opcode = opcode; } void Compress(Opcodes opcode); - void ReadByteMask(uint8& b) - { - b = ReadBit() ? 1 : 0; - } - - void ReadByteSeq(uint8& b) - { - if (b != 0) - b ^= read(); - } - - void WriteByteMask(uint8 b) - { - WriteBit(b); - } - - void WriteByteSeq(uint8 b) - { - if (b != 0) - append(b ^ 1); - } - protected: Opcodes m_opcode; void Compress(void* dst, uint32 *dst_size, const void* src, int src_size); diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h index d1e6289d23f..805a031ee4b 100755 --- a/src/server/shared/Packets/ByteBuffer.h +++ b/src/server/shared/Packets/ByteBuffer.h @@ -183,6 +183,28 @@ class ByteBuffer return b; } + void ReadByteMask(uint8& b) + { + b = ReadBit() ? 1 : 0; + } + + void ReadByteSeq(uint8& b) + { + if (b != 0) + b ^= read(); + } + + void WriteByteMask(uint8 b) + { + WriteBit(b); + } + + void WriteByteSeq(uint8 b) + { + if (b != 0) + append(b ^ 1); + } + template void put(size_t pos, T value) { EndianConvert(value); -- cgit v1.2.3 From fa77969184a7ad5b0dcc2cd52fcb9f2fc79b2519 Mon Sep 17 00:00:00 2001 From: Rat Date: Thu, 19 Jan 2012 20:11:32 +0100 Subject: Core/Movement: Updated/Added/Removed/Renamed Movement related Opcodes. - Rearranged opcodes enum (started working on structs + have to check new naming and such) --- src/server/game/Entities/Player/Player.cpp | 18 +- src/server/game/Entities/Unit/Unit.cpp | 52 ++-- src/server/game/Entities/Vehicle/Vehicle.cpp | 2 +- .../game/Server/Protocol/Handlers/MiscHandler.cpp | 4 +- .../Server/Protocol/Handlers/MovementHandler.cpp | 26 +- src/server/game/Server/Protocol/Opcodes.cpp | 98 +++---- src/server/game/Server/Protocol/Opcodes.h | 286 ++++++++++++--------- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 20 +- src/server/scripts/Commands/cs_modify.cpp | 4 +- 9 files changed, 270 insertions(+), 240 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 5e031510752..61d4121c2e4 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -2068,7 +2068,7 @@ uint8 Player::GetChatTag() const void Player::SendTeleportPacket(Position &oldPos) { - WorldPacket data2(MSG_MOVE_TELEPORT, 38); + WorldPacket data2(SMSG_MOVE_TELEPORT, 38); data2.append(GetPackGUID()); BuildMovementPacket(&data2); Relocate(&oldPos); @@ -2077,7 +2077,7 @@ void Player::SendTeleportPacket(Position &oldPos) void Player::SendTeleportAckPacket() { - WorldPacket data(MSG_MOVE_TELEPORT_ACK, 41); + WorldPacket data(CMSG_MOVE_TELEPORT_ACK, 41); data.append(GetPackGUID()); data << uint32(0); // this value increments every time BuildMovementPacket(&data); @@ -2187,9 +2187,9 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati SetFallInformation(0, z); // code for finish transfer called in WorldSession::HandleMovementOpcodes() - // at client packet MSG_MOVE_TELEPORT_ACK + // at client packet CMSG_MOVE_TELEPORT_ACK SetSemaphoreTeleportNear(true); - // near teleport, triggering send MSG_MOVE_TELEPORT_ACK from client at landing + // near teleport, triggering send CMSG_MOVE_TELEPORT_ACK from client at landing if (!GetSession()->PlayerLogout()) { Position oldPos; @@ -5036,10 +5036,10 @@ void Player::SetMovement(PlayerMovementType pType) WorldPacket data; switch (pType) { - case MOVE_ROOT: data.Initialize(SMSG_FORCE_MOVE_ROOT, GetPackGUID().size()+4); break; - case MOVE_UNROOT: data.Initialize(SMSG_FORCE_MOVE_UNROOT, GetPackGUID().size()+4); break; - case MOVE_WATER_WALK: data.Initialize(SMSG_MOVE_WATER_WALK, GetPackGUID().size()+4); break; - case MOVE_LAND_WALK: data.Initialize(SMSG_MOVE_LAND_WALK, GetPackGUID().size()+4); break; + case MOVE_ROOT: data.Initialize(SMSG_MOVE_ROOT, GetPackGUID().size()+4); break; + case MOVE_UNROOT: data.Initialize(SMSG_MOVE_UNROOT, GetPackGUID().size()+4); break; + case MOVE_WATER_WALK: data.Initialize(SMSG_MOVE_SPLINE_SET_WATER_WALK, GetPackGUID().size()+4); break; + case MOVE_LAND_WALK: data.Initialize(SMSG_MOVE_SPLINE_SET_LAND_WALK, GetPackGUID().size()+4); break; default: sLog->outError("Player::SetMovement: Unsupported move type (%d), data not sent to client.", pType); return; @@ -21778,7 +21778,7 @@ void Player::SendInitialPacketsAfterAddToMap() // manual send package (have code in HandleEffect(this, AURA_EFFECT_HANDLE_SEND_FOR_CLIENT, true); that must not be re-applied. if (HasAuraType(SPELL_AURA_MOD_ROOT)) { - WorldPacket data2(SMSG_FORCE_MOVE_ROOT, 10); + WorldPacket data2(SMSG_MOVE_ROOT, 10); data2.append(GetPackGUID()); data2 << (uint32)2; SendMessageToSet(&data2, true); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 39e9e077e3e..dcc18c0559f 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -11958,7 +11958,7 @@ void Unit::Mount(uint32 mount, uint32 VehicleId, uint32 creatureEntry) player->UnsummonPetTemporaryIfAny(); } - WorldPacket data(SMSG_MOVE_SET_COLLISION_HGT, GetPackGUID().size() + 4 + 4); + WorldPacket data(SMSG_MOVE_SET_COLLISION_HEIGHT, GetPackGUID().size() + 4 + 4); data.append(GetPackGUID()); data << uint32(sWorld->GetGameTime()); // Packet counter data << player->GetCollisionHeight(true); @@ -11978,7 +11978,7 @@ void Unit::Dismount() if (Player* thisPlayer = ToPlayer()) { - WorldPacket data(SMSG_MOVE_SET_COLLISION_HGT, GetPackGUID().size() + 4 + 4); + WorldPacket data(SMSG_MOVE_SET_COLLISION_HEIGHT, GetPackGUID().size() + 4 + 4); data.append(GetPackGUID()); data << uint32(sWorld->GetGameTime()); // Packet counter data << thisPlayer->GetCollisionHeight(false); @@ -12636,7 +12636,7 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) switch (mtype) { case MOVE_WALK: - data.Initialize(MSG_MOVE_SET_WALK_SPEED, 8+4+2+4+4+4+4+4+4+4); + data.Initialize(SMSG_MOVE_SPLINE_SET_WALK_SPEED, 8+4+2+4+4+4+4+4+4+4); break; case MOVE_RUN: data.Initialize(SMSG_MOVE_SPLINE_SET_RUN_SPEED, 1 + 8 + 4); @@ -12661,25 +12661,25 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) data << float(GetSpeed(mtype)); break; case MOVE_RUN_BACK: - data.Initialize(MSG_MOVE_SET_RUN_BACK_SPEED, 8+4+2+4+4+4+4+4+4+4); + data.Initialize(SMSG_MOVE_SPLINE_SET_RUN_BACK_SPEED, 8+4+2+4+4+4+4+4+4+4); break; case MOVE_SWIM: - data.Initialize(MSG_MOVE_SET_SWIM_SPEED, 8+4+2+4+4+4+4+4+4+4); + data.Initialize(SMSG_MOVE_SPLINE_SET_SWIM_SPEED, 8+4+2+4+4+4+4+4+4+4); break; case MOVE_SWIM_BACK: - data.Initialize(MSG_MOVE_SET_SWIM_BACK_SPEED, 8+4+2+4+4+4+4+4+4+4); + data.Initialize(SMSG_MOVE_SPLINE_SET_SWIM_BACK_SPEED, 8+4+2+4+4+4+4+4+4+4); break; case MOVE_TURN_RATE: - data.Initialize(MSG_MOVE_SET_TURN_RATE, 8+4+2+4+4+4+4+4+4+4); + data.Initialize(SMSG_MOVE_SPLINE_SET_TURN_RATE, 8+4+2+4+4+4+4+4+4+4); break; case MOVE_FLIGHT: - data.Initialize(MSG_MOVE_SET_FLIGHT_SPEED, 8+4+2+4+4+4+4+4+4+4); + data.Initialize(SMSG_MOVE_SPLINE_SET_FLIGHT_SPEED, 8+4+2+4+4+4+4+4+4+4); break; case MOVE_FLIGHT_BACK: - data.Initialize(MSG_MOVE_SET_FLIGHT_BACK_SPEED, 8+4+2+4+4+4+4+4+4+4); + data.Initialize(SMSG_MOVE_SPLINE_SET_FLIGHT_BACK_SPEED, 8+4+2+4+4+4+4+4+4+4); break; case MOVE_PITCH_RATE: - data.Initialize(MSG_MOVE_SET_PITCH_RATE, 8+4+2+4+4+4+4+4+4+4); + data.Initialize(SMSG_MOVE_SPLINE_SET_PITCH_RATE, 8+4+2+4+4+4+4+4+4+4); break; default: sLog->outError("Unit::SetSpeed: Unsupported move type (%d), data not sent to client.", mtype); @@ -12715,10 +12715,10 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) switch (mtype) { case MOVE_WALK: - data.Initialize(SMSG_FORCE_WALK_SPEED_CHANGE, 16); + data.Initialize(SMSG_MOVE_SET_WALK_SPEED, 16); break; case MOVE_RUN: - data.Initialize(SMSG_FORCE_RUN_SPEED_CHANGE, 1 + 8 + 4 + 4 ); + data.Initialize(SMSG_MOVE_SET_RUN_SPEED, 1 + 8 + 4 + 4 ); data.WriteByteMask(bytes[1]); data.WriteByteMask(bytes[0]); data.WriteByteMask(bytes[7]); @@ -12742,25 +12742,25 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) data << uint32(0); break; case MOVE_RUN_BACK: - data.Initialize(SMSG_FORCE_RUN_BACK_SPEED_CHANGE, 16); + data.Initialize(SMSG_MOVE_SET_RUN_BACK_SPEED, 16); break; case MOVE_SWIM: - data.Initialize(SMSG_FORCE_SWIM_SPEED_CHANGE, 16); + data.Initialize(SMSG_MOVE_SET_SWIM_SPEED, 16); break; case MOVE_SWIM_BACK: - data.Initialize(SMSG_FORCE_SWIM_BACK_SPEED_CHANGE, 16); + data.Initialize(SMSG_MOVE_SET_SWIM_BACK_SPEED, 16); break; case MOVE_TURN_RATE: - data.Initialize(SMSG_FORCE_TURN_RATE_CHANGE, 16); + data.Initialize(SMSG_MOVE_SET_TURN_RATE, 16); break; case MOVE_FLIGHT: - data.Initialize(SMSG_FORCE_FLIGHT_SPEED_CHANGE, 16); + data.Initialize(SMSG_MOVE_SET_FLIGHT_SPEED, 16); break; case MOVE_FLIGHT_BACK: - data.Initialize(SMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE, 16); + data.Initialize(SMSG_MOVE_SET_FLIGHT_BACK_SPEED, 16); break; case MOVE_PITCH_RATE: - data.Initialize(SMSG_FORCE_PITCH_RATE_CHANGE, 16); + data.Initialize(SMSG_MOVE_SET_PITCH_RATE, 16); break; default: sLog->outError("Unit::SetSpeed: Unsupported move type (%d), data not sent to client.", mtype); @@ -15820,7 +15820,7 @@ void Unit::SetStunned(bool apply) else SetStandState(UNIT_STAND_STATE_STAND); - WorldPacket data(SMSG_FORCE_MOVE_ROOT, 8); + WorldPacket data(SMSG_MOVE_ROOT, 8); data.append(GetPackGUID()); data << uint32(0); SendMessageToSet(&data, true); @@ -15839,7 +15839,7 @@ void Unit::SetStunned(bool apply) if (!HasUnitState(UNIT_STAT_ROOT)) // prevent moving if it also has root effect { - WorldPacket data(SMSG_FORCE_MOVE_UNROOT, 8+4); + WorldPacket data(SMSG_MOVE_UNROOT, 8+4); data.append(GetPackGUID()); data << uint32(0); SendMessageToSet(&data, true); @@ -15864,14 +15864,14 @@ void Unit::SetRooted(bool apply) if (GetTypeId() == TYPEID_PLAYER) { - WorldPacket data(SMSG_FORCE_MOVE_ROOT, 10); + WorldPacket data(SMSG_MOVE_ROOT, 10); data.append(GetPackGUID()); data << m_rootTimes; SendMessageToSet(&data, true); } else { - WorldPacket data(SMSG_SPLINE_MOVE_ROOT, 8); + WorldPacket data(SMSG_MOVE_SPLINE_ROOT, 8); data.append(GetPackGUID()); SendMessageToSet(&data, true); ToCreature()->StopMoving(); @@ -15883,14 +15883,14 @@ void Unit::SetRooted(bool apply) { if (GetTypeId() == TYPEID_PLAYER) { - WorldPacket data(SMSG_FORCE_MOVE_UNROOT, 10); + WorldPacket data(SMSG_MOVE_UNROOT, 10); data.append(GetPackGUID()); data << ++m_rootTimes; SendMessageToSet(&data, true); } else { - WorldPacket data(SMSG_SPLINE_MOVE_UNROOT, 8); + WorldPacket data(SMSG_MOVE_SPLINE_UNROOT, 8); data.append(GetPackGUID()); SendMessageToSet(&data, true); } @@ -17180,7 +17180,7 @@ void Unit::_ExitVehicle(Position const* exitPosition) ToPlayer()->SetFallInformation(0, GetPositionZ()); else if (HasUnitMovementFlag(MOVEMENTFLAG_ROOT)) { - WorldPacket data(SMSG_SPLINE_MOVE_UNROOT, 8); + WorldPacket data(SMSG_MOVE_SPLINE_UNROOT, 8); data.append(GetPackGUID()); SendMessageToSet(&data, false); } diff --git a/src/server/game/Entities/Vehicle/Vehicle.cpp b/src/server/game/Entities/Vehicle/Vehicle.cpp index 7e4bebaab95..677ef5032f2 100755 --- a/src/server/game/Entities/Vehicle/Vehicle.cpp +++ b/src/server/game/Entities/Vehicle/Vehicle.cpp @@ -364,7 +364,7 @@ bool Vehicle::AddPassenger(Unit* unit, int8 seatId) if (_me->IsInWorld()) { unit->SendClearTarget(); // SMSG_BREAK_TARGET - unit->SetControlled(true, UNIT_STAT_ROOT); // SMSG_FORCE_ROOT - In some cases we send SMSG_SPLINE_MOVE_ROOT here (for creatures) + unit->SetControlled(true, UNIT_STAT_ROOT); // SMSG_FORCE_ROOT - In some cases we send SMSG_MOVE_SPLINE_ROOT here (for creatures) // also adds MOVEMENTFLAG_ROOT unit->SendMonsterMoveTransport(_me); // SMSG_MONSTER_MOVE_TRANSPORT diff --git a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp b/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp index d51afc5eaf1..898db683c0a 100755 --- a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp @@ -400,7 +400,7 @@ void WorldSession::HandleLogoutRequestOpcode(WorldPacket & /*recv_data*/) { GetPlayer()->SetStandState(UNIT_STAND_STATE_SIT); - WorldPacket data(SMSG_FORCE_MOVE_ROOT, (8+4)); // guess size + WorldPacket data(SMSG_MOVE_ROOT, (8+4)); // guess size data.append(GetPlayer()->GetPackGUID()); data << (uint32)2; SendPacket(&data); @@ -432,7 +432,7 @@ void WorldSession::HandleLogoutCancelOpcode(WorldPacket & /*recv_data*/) if (GetPlayer()->CanFreeMove()) { //!we can move again - data.Initialize(SMSG_FORCE_MOVE_UNROOT, 8); // guess size + data.Initialize(SMSG_MOVE_UNROOT, 8); // guess size data.append(GetPlayer()->GetPackGUID()); data << uint32(0); SendPacket(&data); diff --git a/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp b/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp index 761b8406d88..9fc429f1321 100755 --- a/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp @@ -34,7 +34,7 @@ void WorldSession::HandleMoveWorldportAckOpcode(WorldPacket & /*recv_data*/) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: got MSG_MOVE_WORLDPORT_ACK."); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: got CMSG_WORLD_PORT_RESPONSE."); HandleMoveWorldportAckOpcode(); } @@ -191,7 +191,7 @@ void WorldSession::HandleMoveWorldportAckOpcode() void WorldSession::HandleMoveTeleportAck(WorldPacket& recv_data) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "MSG_MOVE_TELEPORT_ACK"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_MOVE_TELEPORT_ACK"); uint64 guid; recv_data.readPackGUID(guid); @@ -418,15 +418,15 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recv_data) switch (opcode) { - //case CMSG_FORCE_WALK_SPEED_CHANGE_ACK: move_type = MOVE_WALK; force_move_type = MOVE_WALK; break; - //case CMSG_FORCE_RUN_SPEED_CHANGE_ACK: move_type = MOVE_RUN; force_move_type = MOVE_RUN; break; - //case CMSG_FORCE_RUN_BACK_SPEED_CHANGE_ACK: move_type = MOVE_RUN_BACK; force_move_type = MOVE_RUN_BACK; break; - //case CMSG_FORCE_SWIM_SPEED_CHANGE_ACK: move_type = MOVE_SWIM; force_move_type = MOVE_SWIM; break; - //case CMSG_FORCE_SWIM_BACK_SPEED_CHANGE_ACK: move_type = MOVE_SWIM_BACK; force_move_type = MOVE_SWIM_BACK; break; - //case CMSG_FORCE_TURN_RATE_CHANGE_ACK: move_type = MOVE_TURN_RATE; force_move_type = MOVE_TURN_RATE; break; - //case CMSG_FORCE_FLIGHT_SPEED_CHANGE_ACK: move_type = MOVE_FLIGHT; force_move_type = MOVE_FLIGHT; break; - //case CMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK: move_type = MOVE_FLIGHT_BACK; force_move_type = MOVE_FLIGHT_BACK; break; - //case CMSG_FORCE_PITCH_RATE_CHANGE_ACK: move_type = MOVE_PITCH_RATE; force_move_type = MOVE_PITCH_RATE; break; + case CMSG_MOVE_FORCE_WALK_SPEED_CHANGE_ACK: move_type = MOVE_WALK; force_move_type = MOVE_WALK; break; + case CMSG_MOVE_FORCE_RUN_SPEED_CHANGE_ACK: move_type = MOVE_RUN; force_move_type = MOVE_RUN; break; + case CMSG_MOVE_FORCE_RUN_BACK_SPEED_CHANGE_ACK: move_type = MOVE_RUN_BACK; force_move_type = MOVE_RUN_BACK; break; + case CMSG_MOVE_FORCE_SWIM_SPEED_CHANGE_ACK: move_type = MOVE_SWIM; force_move_type = MOVE_SWIM; break; + case CMSG_MOVE_FORCE_SWIM_BACK_SPEED_CHANGE_ACK: move_type = MOVE_SWIM_BACK; force_move_type = MOVE_SWIM_BACK; break; + case CMSG_MOVE_FORCE_TURN_RATE_CHANGE_ACK: move_type = MOVE_TURN_RATE; force_move_type = MOVE_TURN_RATE; break; + case CMSG_MOVE_FORCE_FLIGHT_SPEED_CHANGE_ACK: move_type = MOVE_FLIGHT; force_move_type = MOVE_FLIGHT; break; + case CMSG_MOVE_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK: move_type = MOVE_FLIGHT_BACK; force_move_type = MOVE_FLIGHT_BACK; break; + case CMSG_MOVE_FORCE_PITCH_RATE_CHANGE_ACK: move_type = MOVE_PITCH_RATE; force_move_type = MOVE_PITCH_RATE; break; default: sLog->outError("WorldSession::HandleForceSpeedChangeAck: Unknown move type opcode: %u", opcode); return; @@ -472,7 +472,7 @@ void WorldSession::HandleSetActiveMoverOpcode(WorldPacket &recv_data) GetPlayer()->SetMover(mover); if (mover != GetPlayer() && mover->canFly()) { - WorldPacket data(SMSG_MOVE_SET_CAN_FLY, 12); + WorldPacket data(SMSG_MOVE_SPLINE_SET_FLYING, 12); data.append(mover->GetPackGUID()); data << uint32(0); SendPacket(&data); @@ -524,7 +524,7 @@ void WorldSession::HandleMoveKnockBackAck(WorldPacket & recv_data) ReadMovementInfo(recv_data, &movementInfo); _player->m_movementInfo = movementInfo; - WorldPacket data(MSG_MOVE_KNOCK_BACK, 66); + WorldPacket data(SMSG_MOVE_UPDATE_KNOCK_BACK, 66); data.appendPackGUID(guid); _player->BuildMovementPacket(&data); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index b830444aaf2..bff065a6290 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -255,12 +255,12 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(MSG_MOVE_START_PITCH_UP, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); DEFINE_OPCODE_HANDLER(MSG_MOVE_START_PITCH_DOWN, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_PITCH, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_MODE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_WALK_MODE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_RUN_MODE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_WALK_MODE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_TOGGLE_LOGGING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_TELEPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_TELEPORT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_TELEPORT_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveTeleportAck ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_TELEPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_TELEPORT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_TELEPORT_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveTeleportAck ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_TOGGLE_FALL_LOGGING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_MOVE_FALL_LAND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); DEFINE_OPCODE_HANDLER(MSG_MOVE_START_SWIM, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); @@ -268,47 +268,47 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_BACK_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_RUN_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_WALK_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_SWIM_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_SWIM_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_SWIM_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_SWIM_BACK_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_SWIM_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_SWIM_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_ALL_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_TURN_RATE_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_TOGGLE_COLLISION_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_FACING, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_PITCH, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_WORLDPORT_ACK, STATUS_TRANSFER, PROCESS_THREADUNSAFE, &WorldSession::HandleMoveWorldportAckOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_WORLD_PORT_RESPONSE, STATUS_TRANSFER, PROCESS_THREADUNSAFE, &WorldSession::HandleMoveWorldportAckOpcode ); DEFINE_OPCODE_HANDLER(SMSG_MONSTER_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_LAND_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_LAND_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_CHARM_PORT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_RAW_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_FORCE_RUN_SPEED_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_FORCE_RUN_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); - //DEFINE_OPCODE_HANDLER(SMSG_FORCE_RUN_BACK_SPEED_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_FORCE_RUN_BACK_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); - //DEFINE_OPCODE_HANDLER(SMSG_FORCE_SWIM_SPEED_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_FORCE_SWIM_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); - //DEFINE_OPCODE_HANDLER(SMSG_FORCE_MOVE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_RELATIVE_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_RUN_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_RUN_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_RUN_BACK_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_SWIM_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_SWIM_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_FORCE_MOVE_ROOT_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveRootAck ); - //DEFINE_OPCODE_HANDLER(SMSG_FORCE_MOVE_UNROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_FORCE_MOVE_UNROOT_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveUnRootAck ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_UNROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_MOVE_HEARTBEAT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_KNOCK_BACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_KNOCK_BACK_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveKnockBackAck ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_KNOCK_BACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_FEATHER_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_NORMAL_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_KNOCK_BACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_FEATHER_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_NORMAL_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_UNSET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_HOVER_ACK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMoveHoverAck ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_HOVERING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_TRIGGER_CINEMATIC_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_OPENING_CINEMATIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(SMSG_TRIGGER_CINEMATIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -791,12 +791,12 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlemasterHelloOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_START_SWIM_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_STOP_SWIM_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_FORCE_WALK_SPEED_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_FORCE_WALK_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); - //DEFINE_OPCODE_HANDLER(SMSG_FORCE_SWIM_BACK_SPEED_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_FORCE_SWIM_BACK_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); - //DEFINE_OPCODE_HANDLER(SMSG_FORCE_TURN_RATE_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_FORCE_TURN_RATE_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_WALK_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_SWIM_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_SWIM_BACK_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_TURN_RATE_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); //DEFINE_OPCODE_HANDLER(MSG_PVP_LOG_DATA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePVPLogDataOpcode ); DEFINE_OPCODE_HANDLER(CMSG_LEAVE_BATTLEFIELD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLeaveBattlefieldOpcode ); DEFINE_OPCODE_HANDLER(CMSG_AREA_SPIRIT_HEALER_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaSpiritHealerQueryOpcode); @@ -833,7 +833,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_SWIM_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_UNROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_UNROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_FEATHER_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_NORMAL_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -854,8 +854,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_ACTIONS_STOP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_FACTION_INACTIVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetFactionInactiveOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SET_WATCHED_FACTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetWatchedFactionOpcode ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_TIME_SKIPPED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SKIP_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SET_EXPLORATION_ALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(SMSG_INVALIDATE_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_RESET_INSTANCES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleResetInstancesOpcode ); @@ -896,8 +896,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_SWIM_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_SWIM_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_FLYING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_UNSET_FLYING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_CAN_FLY_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveSetCanFlyAckOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_FLY, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); //DEFINE_OPCODE_HANDLER(CMSG_SOCKET_GEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSocketOpcode ); @@ -956,13 +956,13 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_SET_HONOR_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_SET_ARENA_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_FLIGHT_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_FLIGHT_BACK_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_FORCE_FLIGHT_SPEED_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_FORCE_FLIGHT_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); - //DEFINE_OPCODE_HANDLER(SMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_FLIGHT_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_MAELSTROM_INVALIDATE_CACHE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -1177,9 +1177,9 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_SET_RUNE_COUNT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_RUNE_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_PITCH_RATE_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_FORCE_PITCH_RATE_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_FORCE_PITCH_RATE_CHANGE_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_PITCH_RATE_CHANGE_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_INVITE_NOTES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_NOTES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1365,7 +1365,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_DROP_NEW_CONNECTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_SEND_ALL_COMBAT_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_OPEN_LFG_DUNGEON_FINDER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_COLLISION_HGT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_COLLISION_HEIGHT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_COLLISION_HGT_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_COLLISION_HGT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_RANDOM_BG_WIN_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index b30dc5531fb..0d05d924580 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -40,9 +40,9 @@ enum Opcodes CMSG_ADD_IGNORE = 0xCEEA, CMSG_ADD_VOICE_IGNORE = 0x0A7A, CMSG_ALTER_APPEARANCE = 0x5CE3, - CMSG_AREATRIGGER = 0x5862, CMSG_AREA_SPIRIT_HEALER_QUERY = 0xDC7E, CMSG_AREA_SPIRIT_HEALER_QUEUE = 0x8846, + CMSG_AREATRIGGER = 0x5862, CMSG_ARENA_TEAM_ACCEPT = 0xDA42, CMSG_ARENA_TEAM_DECLINE = 0x8E73, CMSG_ARENA_TEAM_DISBAND = 0x4A5A, @@ -61,6 +61,7 @@ enum Opcodes CMSG_AUCTION_REMOVE_ITEM = 0xCEC3, CMSG_AUCTION_SELL_ITEM = 0x0CE6, CMSG_AUTH_SESSION = 0x1019, + CMSG_AUTO_DECLINE_GUILD_INVITES = 0x586F, CMSG_AUTOBANK_ITEM = 0x8C56, CMSG_AUTOEQUIP_GROUND_ITEM = 0x00, CMSG_AUTOEQUIP_ITEM = 0x8E66, @@ -69,7 +70,6 @@ enum Opcodes CMSG_AUTOSTORE_BANK_ITEM = 0x1C5F, CMSG_AUTOSTORE_GROUND_ITEM = 0x00, CMSG_AUTOSTORE_LOOT_ITEM = 0xD876, - CMSG_AUTO_DECLINE_GUILD_INVITES = 0x586F, CMSG_BANKER_ACTIVATE = 0x0A5A, CMSG_BATTLEFIELD_JOIN = 0x225, CMSG_BATTLEFIELD_LIST = 0x32A4, @@ -81,9 +81,9 @@ enum Opcodes CMSG_BOT_DETECTED2 = 0x00, CMSG_BUG = 0x1A77, CMSG_BUSY_TRADE = 0x00, - CMSG_BUYBACK_ITEM = 0xDEE6, CMSG_BUY_BANK_SLOT = 0x487F, CMSG_BUY_ITEM = 0x1E5A, + CMSG_BUYBACK_ITEM = 0xDEE6, CMSG_CALENDAR_ADD_EVENT = 0x1CF3, CMSG_CALENDAR_ARENA_TEAM = 0x00, CMSG_CALENDAR_CONTEXT_EVENT_SIGNUP = 0x00, @@ -150,8 +150,8 @@ enum Opcodes CMSG_DEL_FRIEND = 0xC852, CMSG_DEL_IGNORE = 0x8ADA, CMSG_DEL_VOICE_IGNORE = 0x8C73, - CMSG_DESTROYITEM = 0x4E7A, CMSG_DESTROY_ITEMS = 0x00, + CMSG_DESTROYITEM = 0x4E7A, CMSG_DUEL_ACCEPTED = 0x9CCB, CMSG_DUEL_CANCELLED = 0x1E4F, CMSG_EJECT_PASSENGER = 0x00, @@ -160,26 +160,21 @@ enum Opcodes CMSG_EQUIPMENT_SET_DELETE = 0x9CF2, CMSG_EQUIPMENT_SET_SAVE = 0x5E5F, CMSG_EQUIPMENT_SET_USE = 0x4853, - CMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK = 0x00, - CMSG_FORCE_FLIGHT_SPEED_CHANGE_ACK = 0x00, - CMSG_FORCE_MOVE_ROOT_ACK = 0x00, - CMSG_FORCE_MOVE_UNROOT_ACK = 0x00, - CMSG_FORCE_PITCH_RATE_CHANGE_ACK = 0x00, - CMSG_FORCE_RUN_BACK_SPEED_CHANGE_ACK = 0x00, - CMSG_FORCE_RUN_SPEED_CHANGE_ACK = 0x00, - CMSG_FORCE_SWIM_BACK_SPEED_CHANGE_ACK = 0x00, - CMSG_FORCE_SWIM_SPEED_CHANGE_ACK = 0x00, - CMSG_FORCE_TURN_RATE_CHANGE_ACK = 0x00, - CMSG_FORCE_WALK_SPEED_CHANGE_ACK = 0x00, - CMSG_GAMEOBJECT_QUERY = 0xCEFF, + CMSG_FORCE_MOVE_ROOT_ACK = 0x00A4, + CMSG_FORCE_MOVE_UNROOT_ACK = 0x27A5, CMSG_GAMEOBJ_REPORT_USE = 0x9A4A, CMSG_GAMEOBJ_USE = 0x1E77, + CMSG_GAMEOBJECT_QUERY = 0xCEFF, CMSG_GAMESPEED_SET = 0x00, CMSG_GAMETIME_SET = 0x00, - CMSG_GETDEATHBINDZONE = 0x00, CMSG_GET_MAIL_LIST = 0xB284, CMSG_GET_MIRRORIMAGE_DATA = 0xDAF3, + CMSG_GETDEATHBINDZONE = 0x00, CMSG_GHOST = 0x00, + CMSG_GM_INVIS = 0x00, + CMSG_GM_NUKE = 0x00, + CMSG_GM_REPORT_LAG = 0x9C6B, + CMSG_GM_SET_SECURITY_GROUP = 0x00, CMSG_GMRESPONSE_RESOLVE = 0x00, CMSG_GMSURVEY_SUBMIT = 0x00, CMSG_GMTICKET_CREATE = 0x0A7B, @@ -187,10 +182,6 @@ enum Opcodes CMSG_GMTICKET_GETTICKET = 0x985F, CMSG_GMTICKET_SYSTEMSTATUS = 0x4A7A, CMSG_GMTICKET_UPDATETEXT = 0x8A7B, - CMSG_GM_INVIS = 0x00, - CMSG_GM_NUKE = 0x00, - CMSG_GM_REPORT_LAG = 0x9C6B, - CMSG_GM_SET_SECURITY_GROUP = 0x00, CMSG_GOSSIP_HELLO = 0xAD3, CMSG_GOSSIP_SELECT_OPTION = 0x984E, CMSG_GRANT_LEVEL = 0x1CD6, @@ -206,9 +197,7 @@ enum Opcodes CMSG_GROUP_SWAP_SUB_GROUP = 0x5AD7, CMSG_GROUP_UNINVITE = 0x00, CMSG_GROUP_UNINVITE_GUID = 0xCE66, - CMSG_GUILDFINDER_JOIN = 0x68C5, CMSG_GUILD_ACCEPT = 0x00, - CMSG_GUILD_BANKER_ACTIVATE = 0x4E77, CMSG_GUILD_BANK_BUY_TAB = 0x00, CMSG_GUILD_BANK_DEPOSIT_MONEY = 0x4847, CMSG_GUILD_BANK_NOTE = 0x00, @@ -216,6 +205,7 @@ enum Opcodes CMSG_GUILD_BANK_SWAP_ITEMS = 0x85B, CMSG_GUILD_BANK_UPDATE_TAB = 0x00, CMSG_GUILD_BANK_WITHDRAW_MONEY = 0x00, + CMSG_GUILD_BANKER_ACTIVATE = 0x4E77, CMSG_GUILD_CREATE = 0x00, CMSG_GUILD_DECLINE = 0x00, CMSG_GUILD_DEMOTE = 0x00, @@ -231,6 +221,7 @@ enum Opcodes CMSG_GUILD_REMOVE = 0x00, CMSG_GUILD_ROSTER = 0x9952, CMSG_GUILD_SET_NOTE = 0x9958, + CMSG_GUILDFINDER_JOIN = 0x68C5, CMSG_HEARTH_AND_RESURRECT = 0xDC4E, CMSG_IGNORE_TRADE = 0x00, CMSG_INITIATE_TRADE = 0x00, @@ -257,9 +248,9 @@ enum Opcodes CMSG_LFG_TELEPORT = 0x8C7A, CMSG_LIST_INVENTORY = 0xDCFE, CMSG_LOAD_SCREEN = 0x0888, + CMSG_LOG_DISCONNECT = 0x00, CMSG_LOGOUT_CANCEL = 0xA76, CMSG_LOGOUT_REQUEST = 0x4C7A, - CMSG_LOG_DISCONNECT = 0x00, CMSG_LOOT = 0x1E62, CMSG_LOOT_METHOD = 0x00, CMSG_LOOT_MONEY = 0x4A42, @@ -295,25 +286,40 @@ enum Opcodes CMSG_MESSAGECHAT_YELL = 0x70C1, CMSG_MINIGAME_MOVE = 0x00, CMSG_MOUNTSPECIAL_ANIM = 0x00, - CMSG_MOVE_HOVER_ACK = 0x00, - CMSG_MOVE_KNOCK_BACK_ACK = 0x00, - CMSG_MOVE_SET_COLLISION_HGT = 0x00, - CMSG_MOVE_SET_RAW_POSITION = 0x00, - CMSG_MOVE_TIME_SKIPPED = 0x00, + CMSG_MOVE_CHARM_TELEPORT_CHEAT = 0x16A4, + CMSG_MOVE_ENABLE_SWIM_TO_FLY_TRANS_ACK = 0x05A4, + CMSG_MOVE_FEATHER_FALL_ACK = 0x8525, + CMSG_MOVE_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK = 0x82A4, + CMSG_MOVE_FORCE_FLIGHT_SPEED_CHANGE_ACK = 0x9525, + CMSG_MOVE_FORCE_PITCH_RATE_CHANGE_ACK = 0x0025, + CMSG_MOVE_FORCE_RUN_BACK_SPEED_CHANGE_ACK = 0xB7A5, + CMSG_MOVE_FORCE_RUN_SPEED_CHANGE_ACK = 0x20A4, + CMSG_MOVE_FORCE_SWIM_BACK_SPEED_CHANGE_ACK = 0x21A5, + CMSG_MOVE_FORCE_SWIM_SPEED_CHANGE_ACK = 0x96A4, + CMSG_MOVE_FORCE_TURN_RATE_CHANGE_ACK = 0xA324, + CMSG_MOVE_FORCE_WALK_SPEED_CHANGE_ACK = 0x2224, + CMSG_MOVE_GRAVITY_DISABLE_ACK = 0x3524, + CMSG_MOVE_GRAVITY_ENABLE_ACK = 0x80A5, + CMSG_MOVE_HOVER_ACK = 0x31A4, + CMSG_MOVE_KNOCK_BACK_ACK = 0xA025, + CMSG_MOVE_SET_CAN_FLY_ACK = 0xA325, + CMSG_MOVE_SET_COLLISION_HEIGHT_ACK = 0x0525, + CMSG_MOVE_SET_RELATIVE_POSITION = 0x0024, + CMSG_MOVE_SET_VEHICLE_REC_ID_ACK = 0x3525, + CMSG_MOVE_TELEPORT_ACK = 0x2425, + CMSG_MOVE_TELEPORT_CHEAT = 0xA5A5, + CMSG_MOVE_TIME_SKIPPED = 0x3424, + CMSG_MOVE_TOGGLE_COLLISION_ACK = 0x0000, // exists, but not yet known + CMSG_MOVE_WATER_WALK_ACK = 0x25A4, CMSG_NAME_QUERY = 0x586A, CMSG_NEW_SPELL_SLOT = 0x00, CMSG_NEXT_CINEMATIC_CAMERA = 0x8E63, CMSG_NPC_TEXT_QUERY = 0x5C63, CMSG_OFFER_PETITION = 0xC8DE, - CMSG_OPENING_CINEMATIC = 0xD8D2, CMSG_OPEN_ITEM = 0x88C7, + CMSG_OPENING_CINEMATIC = 0xD8D2, CMSG_OPT_OUT_OF_LOOT = 0x00, CMSG_PAGE_TEXT_QUERY = 0x8A5F, - CMSG_PETITION_BUY = 0x8E4E, - CMSG_PETITION_QUERY = 0xCEF3, - CMSG_PETITION_SHOWLIST = 0x00, - CMSG_PETITION_SHOW_SIGNATURES = 0x1E66, - CMSG_PETITION_SIGN = 0x4A5E, CMSG_PET_ABANDON = 0x00, CMSG_PET_ACTION = 0x1AEA, CMSG_PET_CANCEL_AURA = 0x00, @@ -324,19 +330,27 @@ enum Opcodes CMSG_PET_SET_ACTION = 0x00, CMSG_PET_SPELL_AUTOCAST = 0x00, CMSG_PET_STOP_ATTACK = 0x00, + CMSG_PETITION_BUY = 0x8E4E, + CMSG_PETITION_QUERY = 0xCEF3, + CMSG_PETITION_SHOW_SIGNATURES = 0x1E66, + CMSG_PETITION_SHOWLIST = 0x00, + CMSG_PETITION_SIGN = 0x4A5E, CMSG_PING = 0x1008, + CMSG_PLAY_DANCE = 0x5857, CMSG_PLAYED_TIME = 0x5A56, CMSG_PLAYER_DIFFICULTY_CHANGE = 0x00, CMSG_PLAYER_LOGIN = 0x0898, CMSG_PLAYER_LOGOUT = 0x1CEE, CMSG_PLAYER_VEHICLE_ENTER = 0x00, - CMSG_PLAY_DANCE = 0x5857, CMSG_PUSHQUESTTOPARTY = 0xA47, CMSG_QUERY_GUILD_MAX_XP = 0x00, CMSG_QUERY_GUILD_REWARDS = 0x00, CMSG_QUERY_GUILD_XP = 0x00, CMSG_QUERY_QUESTS_COMPLETED = 0x98DF, CMSG_QUERY_TIME = 0x18FE, + CMSG_QUEST_CONFIRM_ACCEPT = 0x8CD3, + CMSG_QUEST_POI_QUERY = 0x12A5, + CMSG_QUEST_QUERY = 0xCE7F, CMSG_QUESTGIVER_ACCEPT_QUEST = 0x0C63, CMSG_QUESTGIVER_CANCEL = 0xC86A, CMSG_QUESTGIVER_CHOOSE_REWARD = 0x18F3, @@ -349,12 +363,9 @@ enum Opcodes CMSG_QUESTGIVER_STATUS_QUERY = 0x88C6, CMSG_QUESTLOG_REMOVE_QUEST = 0x8EFF, CMSG_QUESTLOG_SWAP_QUEST = 0x00, - CMSG_QUEST_CONFIRM_ACCEPT = 0x8CD3, - CMSG_QUEST_POI_QUERY = 0x12A5, - CMSG_QUEST_QUERY = 0xCE7F, CMSG_RANDOMIZE_CHAR_NAME = 0x8A99, - CMSG_READY_FOR_ACCOUNT_DATA_TIMES = 0xCCDB, CMSG_READ_ITEM = 0x184F, + CMSG_READY_FOR_ACCOUNT_DATA_TIMES = 0xCCDB, CMSG_REALM_SPLIT = 0xDC66, CMSG_RECLAIM_CORPSE = 0x88DB, CMSG_REDIRECTION_AUTH_PROOF = 0x1039, @@ -383,10 +394,8 @@ enum Opcodes CMSG_SELF_RES = 0xCCFE, CMSG_SELL_ITEM = 0x5EE3, CMSG_SERVERTIME = 0x00, - CMSG_SETDEATHBINDPOINT = 0x00, - CMSG_SETSHEATHED = 0xCA5F, - CMSG_SET_ACTIONBAR_TOGGLES = 0x584F, CMSG_SET_ACTION_BUTTON = 0xDAC3, + CMSG_SET_ACTIONBAR_TOGGLES = 0x584F, CMSG_SET_ACTIVE_MOVER = 0x00, CMSG_SET_ACTIVE_VOICE_CHANNEL = 0x00, CMSG_SET_ALLOW_LOW_LEVEL_RAID1 = 0xC863, @@ -405,6 +414,8 @@ enum Opcodes CMSG_SET_TITLE = 0xCE63, CMSG_SET_TRADE_GOLD = 0x00, CMSG_SET_TRADE_ITEM = 0x00, + CMSG_SETDEATHBINDPOINT = 0x00, + CMSG_SETSHEATHED = 0xCA5F, CMSG_SHOWING_CLOAK = 0x8AE3, CMSG_SHOWING_HELM = 0xCEFA, CMSG_SOCKET_GEMS = 0x00, @@ -448,6 +459,7 @@ enum Opcodes CMSG_WARDEN_DATA = 0x5847, CMSG_WHO = 0x9AD7, CMSG_WHOIS = 0xCCE6, + CMSG_WORLD_PORT_RESPONSE = 0x0A9A, CMSG_WORLD_STATE_UI_TIMER_UPDATE = 0x58F6, CMSG_WORLD_TELEPORT = 0x00, CMSG_WRAP_ITEM = 0x00, @@ -469,33 +481,18 @@ enum Opcodes MSG_MINIMAP_PING = 0x00, MSG_MOVE_FALL_LAND = 0x00A5, MSG_MOVE_HEARTBEAT = 0xB024, - MSG_MOVE_HOVER = 0x00, MSG_MOVE_JUMP = 0x9225, - MSG_MOVE_KNOCK_BACK = 0x60FE, - MSG_MOVE_ROOT = 0xB0DE, MSG_MOVE_SET_ALL_SPEED_CHEAT = 0x00, MSG_MOVE_SET_FACING = 0x02A4, - MSG_MOVE_SET_FLIGHT_BACK_SPEED = 0x00, MSG_MOVE_SET_FLIGHT_BACK_SPEED_CHEAT = 0x00, - MSG_MOVE_SET_FLIGHT_SPEED = 0x00, MSG_MOVE_SET_FLIGHT_SPEED_CHEAT = 0x00, MSG_MOVE_SET_PITCH = 0xA7A5, - MSG_MOVE_SET_PITCH_RATE = 0x00, MSG_MOVE_SET_RAW_POSITION_ACK = 0x00, - MSG_MOVE_SET_RUN_BACK_SPEED = 0x00, MSG_MOVE_SET_RUN_BACK_SPEED_CHEAT = 0x00, - MSG_MOVE_SET_RUN_MODE = 0x21A4, - SMSG_FORCE_RUN_SPEED_CHANGE = 0xE24E, // for self - SMSG_MOVE_SPLINE_SET_RUN_SPEED = 0xB2CE, // for others MSG_MOVE_SET_RUN_SPEED_CHEAT = 0x00, - MSG_MOVE_SET_SWIM_BACK_SPEED = 0x00, MSG_MOVE_SET_SWIM_BACK_SPEED_CHEAT = 0x00, - MSG_MOVE_SET_SWIM_SPEED = 0x00, MSG_MOVE_SET_SWIM_SPEED_CHEAT = 0x00, - MSG_MOVE_SET_TURN_RATE = 0x00, MSG_MOVE_SET_TURN_RATE_CHEAT = 0x00, - MSG_MOVE_SET_WALK_MODE = 0x24A4, - MSG_MOVE_SET_WALK_SPEED = 0x00, MSG_MOVE_SET_WALK_SPEED_CHEAT = 0x00, MSG_MOVE_START_ASCEND = 0x0624, MSG_MOVE_START_BACKWARD = 0x10A5, @@ -514,15 +511,9 @@ enum Opcodes MSG_MOVE_STOP_STRAFE = 0x0125, MSG_MOVE_STOP_SWIM = 0xB424, MSG_MOVE_STOP_TURN = 0x90A4, - MSG_MOVE_TELEPORT = 0xF25C, - MSG_MOVE_TELEPORT_ACK = 0x2425, - MSG_MOVE_TELEPORT_CHEAT = 0xA5A5, - MSG_MOVE_TIME_SKIPPED = 0x3424, MSG_MOVE_TOGGLE_COLLISION_CHEAT = 0x00, MSG_MOVE_TOGGLE_FALL_LOGGING = 0x00, MSG_MOVE_TOGGLE_LOGGING = 0x00, - MSG_MOVE_UNROOT = 0x00, - MSG_MOVE_WORLDPORT_ACK = 0x00, MSG_NOTIFY_PARTY_SQUELCH = 0x00, MSG_PARTY_ASSIGNMENT = 0x00, MSG_PETITION_DECLINE = 0x98E7, @@ -547,8 +538,8 @@ enum Opcodes SMSG_ACHIEVEMENT_EARNED = 0x484E, SMSG_ACTION_BUTTONS = 0x8A6B, SMSG_ACTIVATETAXIREPLY = 0x8E4F, - SMSG_ADDON_INFO = 0x9863, SMSG_ADD_RUNE_POWER = 0x00, + SMSG_ADDON_INFO = 0x9863, SMSG_AI_REACTION = 0xCEC2, SMSG_ALL_ACHIEVEMENT_DATA = 0x00, SMSG_AREA_SPIRIT_HEALER_TIME = 0x00, @@ -577,16 +568,16 @@ enum Opcodes SMSG_AUCTION_OWNER_LIST_RESULT = 0x4EDA, SMSG_AUCTION_OWNER_NOTIFICATION = 0xCA6A, SMSG_AUCTION_REMOVED_NOTIFICATION = 0x4CFB, - SMSG_AURACASTLOG = 0x00, SMSG_AURA_UPDATE = 0x4C66, SMSG_AURA_UPDATE_ALL = 0x18EE, + SMSG_AURACASTLOG = 0x00, SMSG_AUTH_CHALLENGE = 0x1181, SMSG_AUTH_RESPONSE = 0x8867, SMSG_AVAILABLE_VOICE_CHANNEL = 0x9C7B, SMSG_BARBER_SHOP_RESULT = 0x9847, SMSG_BATTLEFIELD_LIST = 0xB64E, - SMSG_BATTLEFIELD_MGR_EJECTED = 0x32EC, SMSG_BATTLEFIELD_MGR_EJECT_PENDING = 0x724C, + SMSG_BATTLEFIELD_MGR_EJECTED = 0x32EC, SMSG_BATTLEFIELD_MGR_ENTERED = 0x66DC, SMSG_BATTLEFIELD_MGR_ENTRY_INVITE = 0x70DE, SMSG_BATTLEFIELD_MGR_QUEUE_INVITE = 0x644E, @@ -618,13 +609,13 @@ enum Opcodes SMSG_CHANNEL_LIST = 0x9C47, SMSG_CHANNEL_MEMBER_COUNT = 0x5EEA, SMSG_CHANNEL_NOTIFY = 0x9C7F, - SMSG_CHARACTER_LOGIN_FAILED = 0x4AE6, SMSG_CHAR_CREATE = 0x4C5B, SMSG_CHAR_CUSTOMIZE = 0x0AE3, SMSG_CHAR_DELETE = 0x48CE, SMSG_CHAR_ENUM = 0xA05C, SMSG_CHAR_FACTION_CHANGE = 0x885A, SMSG_CHAR_RENAME = 0x5EF6, + SMSG_CHARACTER_LOGIN_FAILED = 0x4AE6, SMSG_CHAT_PLAYER_AMBIGUOUS = 0xDE7F, SMSG_CHAT_PLAYER_NOT_FOUND = 0x4E6F, SMSG_CHAT_RESTRICTED = 0x4863, @@ -632,8 +623,8 @@ enum Opcodes SMSG_CHECK_FOR_BOTS = 0x00, SMSG_CLEAR_COOLDOWN = 0x00, SMSG_CLEAR_TARGET = 0x00, - SMSG_CLIENTCACHE_VERSION = 0x88F2, SMSG_CLIENT_CONTROL_UPDATE = 0x08CB, + SMSG_CLIENTCACHE_VERSION = 0x88F2, SMSG_COMBAT_LOG_MULTIPLE = 0x5C56, SMSG_COMMENTATOR_MAP_INFO = 0x00, SMSG_COMMENTATOR_PLAYER_INFO = 0x00, @@ -686,20 +677,10 @@ enum Opcodes SMSG_FISH_ESCAPED = 0x9C66, SMSG_FISH_NOT_HOOKED = 0x18C3, SMSG_FLIGHT_SPLINE_SYNC = 0x1C63, - SMSG_FORCEACTIONSHOW = 0x00, - SMSG_FORCED_DEATH_UPDATE = 0x00, SMSG_FORCE_DISPLAY_UPDATE = 0x00, - SMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE = 0x00, - SMSG_FORCE_FLIGHT_SPEED_CHANGE = 0x00, - SMSG_FORCE_MOVE_ROOT = 0x00, - SMSG_FORCE_MOVE_UNROOT = 0x00, - SMSG_FORCE_PITCH_RATE_CHANGE = 0x00, - SMSG_FORCE_RUN_BACK_SPEED_CHANGE = 0x00, SMSG_FORCE_SEND_QUEUED_PACKETS = 0x1380, - SMSG_FORCE_SWIM_BACK_SPEED_CHANGE = 0x00, - SMSG_FORCE_SWIM_SPEED_CHANGE = 0x00, - SMSG_FORCE_TURN_RATE_CHANGE = 0x00, - SMSG_FORCE_WALK_SPEED_CHANGE = 0x00, + SMSG_FORCEACTIONSHOW = 0x00, + SMSG_FORCED_DEATH_UPDATE = 0x00, SMSG_FRIEND_STATUS = 0xD852, SMSG_GAMEOBJECT_CUSTOM_ANIM = 0xCCE, SMSG_GAMEOBJECT_DESPAWN_ANIM = 0x0A5E, @@ -709,6 +690,7 @@ enum Opcodes SMSG_GAMESPEED_SET = 0x5ACA, SMSG_GAMETIME_SET = 0x9C4A, SMSG_GAMETIME_UPDATE = 0x18E3, + SMSG_GM_MESSAGECHAT = 0x8E5E, SMSG_GMRESPONSE_RECEIVED = 0x00, SMSG_GMRESPONSE_STATUS_UPDATE = 0x00, SMSG_GMTICKET_CREATE = 0x00, @@ -716,7 +698,6 @@ enum Opcodes SMSG_GMTICKET_GETTICKET = 0x00, SMSG_GMTICKET_SYSTEMSTATUS = 0x9C7E, SMSG_GMTICKET_UPDATETEXT = 0x00, - SMSG_GM_MESSAGECHAT = 0x8E5E, SMSG_GODMODE = 0xDEEE, SMSG_GOSSIP_COMPLETE = 0xDE7B, SMSG_GOSSIP_MESSAGE = 0xCCEB, @@ -729,7 +710,6 @@ enum Opcodes SMSG_GROUP_LIST = 0x5C7E, SMSG_GROUP_SET_LEADER = 0xCCF2, SMSG_GROUP_UNINVITE = 0x00, - SMSG_GUILDFINDER_SEARCH_RESULT = 0xE0CE, SMSG_GUILD_BANK_LIST = 0x5EFB, SMSG_GUILD_COMMAND_RESULT = 0xDAD7, SMSG_GUILD_DECLINE = 0x1E5B, @@ -747,11 +727,12 @@ enum Opcodes SMSG_GUILD_TRADESKILL_UPDATE = 0x00, SMSG_GUILD_UPDATE_ROSTER = 0x00, SMSG_GUILD_XP_UPDATE = 0x00, + SMSG_GUILDFINDER_SEARCH_RESULT = 0xE0CE, SMSG_HIGHEST_THREAT_UPDATE = 0x5E7B, - SMSG_INITIALIZE_FACTIONS = 0xCC6F, - SMSG_INITIAL_SPELLS = 0x88FE, SMSG_INIT_CURRENCY = 0x227E, SMSG_INIT_WORLD_STATES = 0x9EDA, + SMSG_INITIAL_SPELLS = 0x88FE, + SMSG_INITIALIZE_FACTIONS = 0xCC6F, SMSG_INSPECT = 0x0E46, SMSG_INSPECT_HONOR_STATS = 0x00, SMSG_INSPECT_TALENT = 0x48EF, @@ -760,9 +741,9 @@ enum Opcodes SMSG_INSTANCE_RESET = 0xDAC2, SMSG_INSTANCE_RESET_FAILED = 0xCEFE, SMSG_INSTANCE_SAVE_CREATED = 0xCE56, + SMSG_INVALID_PROMOTION_CODE = 0xD8FE, SMSG_INVALIDATE_DANCE = 0x1EEF, SMSG_INVALIDATE_PLAYER = 0x5C5F, - SMSG_INVALID_PROMOTION_CODE = 0xD8FE, SMSG_INVENTORY_CHANGE_FAILURE = 0xC8EE, SMSG_ITEM_COOLDOWN = 0x00, SMSG_ITEM_ENCHANT_TIME_UPDATE = 0xDCE6, @@ -794,12 +775,12 @@ enum Opcodes SMSG_LFG_UPDATE_PLAYER = 0x00, SMSG_LFG_UPDATE_SEARCH = 0x1E53, SMSG_LIST_INVENTORY = 0x264C, + SMSG_LOG_XPGAIN = 0x4E7E, SMSG_LOGIN_SETTIMESPEED = 0x5ECA, SMSG_LOGIN_VERIFY_WORLD = 0xC86E, SMSG_LOGOUT_CANCEL_ACK = 0xD8EF, SMSG_LOGOUT_COMPLETE = 0xCC6B, SMSG_LOGOUT_RESPONSE = 0x886A, - SMSG_LOG_XPGAIN = 0x4E7E, SMSG_LOOT_ALL_PASSED = 0x1C7A, SMSG_LOOT_CLEAR_MONEY = 0x586E, SMSG_LOOT_ITEM_NOTIFY = 0xD8E3, @@ -826,18 +807,70 @@ enum Opcodes SMSG_MOTD = 0xCA4B, SMSG_MOUNTRESULT = 0x00, SMSG_MOUNTSPECIAL_ANIM = 0x9E77, - SMSG_MOVE_FEATHER_FALL = 0x00, - SMSG_MOVE_KNOCK_BACK = 0x60FE, - SMSG_MOVE_LAND_WALK = 0x00, - SMSG_MOVE_NORMAL_FALL = 0x00, - SMSG_MOVE_SET_CAN_FLY = 0x00, - SMSG_MOVE_SET_COLLISION_HGT = 0x00, - SMSG_MOVE_SET_HOVER = 0x00, + SMSG_MOVE_DISABLE_COLLISION = 0xF2DE, //forced, for self + SMSG_MOVE_DISABLE_GRAVITY = 0x60DC, //forced, for self + SMSG_MOVE_DISABLE_TRANSITION_BETWEEN_SWIM_AND_FLY= 0x365E, //forced, for self + SMSG_MOVE_ENABLE_COLLISION = 0x64DC, //forced, for self + SMSG_MOVE_ENABLE_GRAVITY = 0x645E, //forced, for self + SMSG_MOVE_ENABLE_TRANSITION_BETWEEN_SWIM_AND_FLY = 0x60CC, //forced, for self + SMSG_MOVE_KNOCK_BACK = 0x60FE, //forced, for self + SMSG_MOVE_ROOT = 0xB0DE, //forced, for self + SMSG_MOVE_SET_ACTIVE_MOVER = 0xA0DE, + SMSG_MOVE_SET_CAN_FLY = 0xB66E, //forced, for self + SMSG_MOVE_SET_COLLISION_HEIGHT = 0x20DC, //forced, for self + SMSG_MOVE_SET_COMPOUND_STATE = 0xF25E, + SMSG_MOVE_SET_FEATHER_FALL = 0xF2CC, //forced, for self + SMSG_MOVE_SET_FLIGHT_BACK_SPEED = 0x627C, //forced, for self + SMSG_MOVE_SET_FLIGHT_SPEED = 0x365C, //forced, for self + SMSG_MOVE_SET_HOVERING = 0x74FC, //forced, for self + SMSG_MOVE_SET_LAND_WALK = 0x76CE, //forced, for self + SMSG_MOVE_SET_NORMAL_FALL = 0xF4DC, //forced, for self + SMSG_MOVE_SET_PITCH_RATE = 0x24FE, //forced, for self + SMSG_MOVE_SET_RUN_BACK_SPEED = 0x747C, //forced, for self + SMSG_MOVE_SET_RUN_SPEED = 0xE24E, // for self + SMSG_MOVE_SET_SWIM_BACK_SPEED = 0xE6CC, //forced, for self + SMSG_MOVE_SET_SWIM_SPEED = 0x30FC, //forced, for self + SMSG_MOVE_SET_TURN_RATE = 0xA04E, //forced, for self + SMSG_MOVE_SET_VEHICLE_REC_ID = 0xA44C, //forced, for self SMSG_MOVE_SET_WALK_IN_AIR = 0x00, - SMSG_MOVE_UNSET_CAN_FLY = 0x00, - SMSG_MOVE_UNSET_HOVER = 0x00, + SMSG_MOVE_SET_WALK_SPEED = 0x246E, //forced, for self + SMSG_MOVE_SET_WATER_WALK = 0x625E, //forced, for self + SMSG_MOVE_SKIP_TIME = 0x32DE, + SMSG_MOVE_SPLINE_DISABLE_COLLISION = 0xE04E, + SMSG_MOVE_SPLINE_DISABLE_GRAVITY = 0xF04C, + SMSG_MOVE_SPLINE_ENABLE_COLLISION = 0x227C, + SMSG_MOVE_SPLINE_ENABLE_GRAVITY = 0xA4DE, + SMSG_MOVE_SPLINE_ROOT = 0x265C, + SMSG_MOVE_SPLINE_SET_FEATHER_FALL = 0xB6CC, + SMSG_MOVE_SPLINE_SET_FLIGHT_BACK_SPEED = 0x70EC, + SMSG_MOVE_SPLINE_SET_FLIGHT_SPEED = 0x644C, + SMSG_MOVE_SPLINE_SET_FLYING = 0x70DC, + SMSG_MOVE_SPLINE_SET_HOVER = 0x667E, + SMSG_MOVE_SPLINE_SET_LAND_WALK = 0xA65E, + SMSG_MOVE_SPLINE_SET_NORMAL_FALL = 0xE2FC, + SMSG_MOVE_SPLINE_SET_PITCH_RATE = 0x60CE, + SMSG_MOVE_SPLINE_SET_RUN_BACK_SPEED = 0x624E, + SMSG_MOVE_SPLINE_SET_RUN_MODE = 0x26CC, + SMSG_MOVE_SPLINE_SET_RUN_SPEED = 0xB2CE, // for others + SMSG_MOVE_SPLINE_SET_SWIM_BACK_SPEED = 0x326C, + SMSG_MOVE_SPLINE_SET_SWIM_SPEED = 0x327E, + SMSG_MOVE_SPLINE_SET_TURN_RATE = 0x745C, + SMSG_MOVE_SPLINE_SET_WALK_MODE = 0xF65C, + SMSG_MOVE_SPLINE_SET_WALK_SPEED = 0x0000, // exists, but not yet known + SMSG_MOVE_SPLINE_SET_WATER_WALK = 0xA24E, + SMSG_MOVE_SPLINE_START_SWIM = 0xF0FC, + SMSG_MOVE_SPLINE_STOP_SWIM = 0x66EE, + SMSG_MOVE_SPLINE_UNROOT = 0x64EE, + SMSG_MOVE_SPLINE_UNSET_FLYING = 0xB06E, + SMSG_MOVE_SPLINE_UNSET_HOVER = 0xA07E, + SMSG_MOVE_TELEPORT = 0xF25C, + SMSG_MOVE_UNROOT = 0xB0CE, //forced, for self + SMSG_MOVE_UNSET_CAN_FLY = 0xA24C, //forced, for self + SMSG_MOVE_UNSET_HOVERING = 0x325E, //forced, for self SMSG_MOVE_UNSET_WALK_IN_AIR = 0x00, - SMSG_MOVE_WATER_WALK = 0x00, + SMSG_MOVE_UPDATE = 0xF66C, + SMSG_MOVE_UPDATE_KNOCK_BACK = 0x725C, + SMSG_MOVE_UPDATE_TELEPORT = 0xF6DC, SMSG_MULTIPLE_PACKETS = 0xDCEA, SMSG_NAME_QUERY_RESPONSE = 0x9CE6, SMSG_NEW_TAXI_PATH = 0xC8FF, @@ -852,17 +885,12 @@ enum Opcodes SMSG_OPEN_CONTAINER = 0x00, SMSG_OVERRIDE_LIGHT = 0xCC56, SMSG_PAGE_TEXT_QUERY_RESPONSE = 0x18D2, - SMSG_PARTYKILLLOG = 0xCCC2, SMSG_PARTY_COMMAND_RESULT = 0xCCD6, SMSG_PARTY_MEMBER_STATS = 0xDC5A, SMSG_PARTY_MEMBER_STATS_FULL = 0x0EDF, + SMSG_PARTYKILLLOG = 0xCCC2, SMSG_PAUSE_MIRROR_TIMER = 0x00, SMSG_PERIODICAURALOG = 0x00, - SMSG_PETGODMODE = 0x00, - SMSG_PETITION_QUERY_RESPONSE = 0xCAEE, - SMSG_PETITION_SHOWLIST = 0x8ED7, - SMSG_PETITION_SHOW_SIGNATURES = 0x4E4A, - SMSG_PETITION_SIGN_RESULTS = 0x5EE6, SMSG_PET_ACTION_FEEDBACK = 0x4E5A, SMSG_PET_ACTION_SOUND = 0x0CC7, SMSG_PET_CAST_FAILED = 0x00, @@ -876,13 +904,11 @@ enum Opcodes SMSG_PET_SPELLS = 0x5A43, SMSG_PET_TAME_FAILURE = 0x00, SMSG_PET_UPDATE_COMBO_POINTS = 0x1A47, - SMSG_PLAYED_TIME = 0x187F, - SMSG_PLAYERBINDERROR = 0x5A4F, - SMSG_PLAYERBOUND = 0xCC46, - SMSG_PLAYER_DIFFICULTY_CHANGE = 0xD846, - SMSG_PLAYER_MOVE = 0xF66C, - SMSG_PLAYER_SKINNED = 0xDA63, - SMSG_PLAYER_VEHICLE_DATA = 0x186E, + SMSG_PETGODMODE = 0x00, + SMSG_PETITION_QUERY_RESPONSE = 0xCAEE, + SMSG_PETITION_SHOW_SIGNATURES = 0x4E4A, + SMSG_PETITION_SHOWLIST = 0x8ED7, + SMSG_PETITION_SIGN_RESULTS = 0x5EE6, SMSG_PLAY_DANCE = 0x8CFE, SMSG_PLAY_MUSIC = 0x00, SMSG_PLAY_OBJECT_SOUND = 0xCC57, @@ -890,6 +916,13 @@ enum Opcodes SMSG_PLAY_SPELL_IMPACT = 0x00, SMSG_PLAY_SPELL_VISUAL = 0x00, SMSG_PLAY_TIME_WARNING = 0xD857, + SMSG_PLAYED_TIME = 0x187F, + SMSG_PLAYER_DIFFICULTY_CHANGE = 0xD846, + SMSG_PLAYER_MOVE = 0xF66C, + SMSG_PLAYER_SKINNED = 0xDA63, + SMSG_PLAYER_VEHICLE_DATA = 0x186E, + SMSG_PLAYERBINDERROR = 0x5A4F, + SMSG_PLAYERBOUND = 0xCC46, SMSG_PONG = 0x0380, SMSG_POWER_UPDATE = 0x487E, SMSG_PRE_RESURRECT = 0x1CFB, @@ -899,6 +932,10 @@ enum Opcodes SMSG_PVP_CREDIT = 0x9EF2, SMSG_QUERY_QUESTS_COMPLETED_RESPONSE = 0x8E7A, SMSG_QUERY_TIME_RESPONSE = 0xD85A, + SMSG_QUEST_CONFIRM_ACCEPT = 0x184B, + SMSG_QUEST_FORCE_REMOVED = 0x00, + SMSG_QUEST_POI_QUERY_RESPONSE = 0x8CC3, + SMSG_QUEST_QUERY_RESPONSE = 0x9E56, SMSG_QUESTGIVER_OFFER_REWARD = 0x00, SMSG_QUESTGIVER_QUEST_COMPLETE = 0x24EE, SMSG_QUESTGIVER_QUEST_DETAILS = 0xCE5F, @@ -915,18 +952,14 @@ enum Opcodes SMSG_QUESTUPDATE_COMPLETE = 0x9CD6, SMSG_QUESTUPDATE_FAILED = 0x9EF6, SMSG_QUESTUPDATE_FAILEDTIMER = 0x00, - SMSG_QUEST_CONFIRM_ACCEPT = 0x184B, - SMSG_QUEST_FORCE_REMOVED = 0x00, - SMSG_QUEST_POI_QUERY_RESPONSE = 0x8CC3, - SMSG_QUEST_QUERY_RESPONSE = 0x9E56, SMSG_RAID_GROUP_ONLY = 0xDCDB, SMSG_RAID_INSTANCE_INFO = 0x4ACA, SMSG_RAID_INSTANCE_MESSAGE = 0xD862, SMSG_RANDOMIZE_CHAR_NAME = 0xF0DC, SMSG_READ_ITEM_FAILED = 0x0C5B, SMSG_READ_ITEM_OK = 0x9ECE, - SMSG_REALM_SPLIT = 0x1AF2, SMSG_REAL_GROUP_UPDATE = 0x4C56, + SMSG_REALM_SPLIT = 0x1AF2, SMSG_RECEIVED_MAIL = 0xDEE2, SMSG_REDIRECT_CLIENT = 0x0180, SMSG_REFER_A_FRIEND_FAILURE = 0x4867, @@ -942,9 +975,9 @@ enum Opcodes SMSG_SELL_ITEM = 0x9CD3, SMSG_SEND_MAIL_RESULT = 0x8CC2, SMSG_SEND_UNLEARN_SPELLS = 0xCED2, - SMSG_SERVERTIME = 0x1CD7, SMSG_SERVER_FIRST_ACHIEVEMENT = 0x0CDF, SMSG_SERVER_MESSAGE = 0xC873, + SMSG_SERVERTIME = 0x1CD7, SMSG_SET_FACTION_ATWAR = 0x1E47, SMSG_SET_FACTION_STANDING = 0x1AE3, SMSG_SET_FACTION_VISIBLE = 0x4CEB, @@ -952,11 +985,19 @@ enum Opcodes SMSG_SET_FORCED_REACTIONS = 0xD8C3, SMSG_SET_PCT_SPELL_MODIFIER = 0x485B, SMSG_SET_PHASE_SHIFT = 0x204C, + SMSG_SET_PLAY_HOVER_ANIM = 0xA27E, //forced, for self SMSG_SET_PLAYER_DECLINED_NAMES_RESULT = 0x0E67, SMSG_SET_PROFICIENCY = 0x9C5F, SMSG_SET_PROJECTILE_POSITION = 0xC8F7, - SMSG_SHOWTAXINODES = 0x8CFB, SMSG_SHOW_BANK = 0xCCA, + SMSG_SHOWTAXINODES = 0x8CFB, + SMSG_SPELL_COOLDOWN = 0x88D6, + SMSG_SPELL_DELAYED = 0x1AD3, + SMSG_SPELL_FAILED_OTHER = 0xCE4A, + SMSG_SPELL_FAILURE = 0x9A66, + SMSG_SPELL_GO = 0x0A53, + SMSG_SPELL_START = 0xCE43, + SMSG_SPELL_UPDATE_CHAIN_TARGETS = 0x00, SMSG_SPELLBREAKLOG = 0x00, SMSG_SPELLDAMAGESHIELD = 0x8AFE, SMSG_SPELLDISPELLOG = 0x00, @@ -968,18 +1009,7 @@ enum Opcodes SMSG_SPELLNONMELEEDAMAGELOG = 0x5CCF, SMSG_SPELLORDAMAGE_IMMUNE = 0x48FA, SMSG_SPELLSTEALLOG = 0x00, - SMSG_SPELL_COOLDOWN = 0x88D6, - SMSG_SPELL_DELAYED = 0x1AD3, - SMSG_SPELL_FAILED_OTHER = 0xCE4A, - SMSG_SPELL_FAILURE = 0x9A66, - SMSG_SPELL_GO = 0x0A53, - SMSG_SPELL_START = 0xCE43, - SMSG_SPELL_UPDATE_CHAIN_TARGETS = 0x00, SMSG_SPIRIT_HEALER_CONFIRM = 0xA4A, - SMSG_SPLINE_MOVE_LAND_WALK = 0x00, - SMSG_SPLINE_MOVE_ROOT = 0x00, - SMSG_SPLINE_MOVE_UNROOT = 0x00, - SMSG_SPLINE_MOVE_WATER_WALK = 0x00, SMSG_STABLE_RESULT = 0xA5B, SMSG_STANDSTATE_UPDATE = 0x4E52, SMSG_START_MIRROR_TIMER = 0x00, diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index e3e69eff720..124e1628903 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -2852,9 +2852,9 @@ void AuraEffect::HandleAuraAllowFlight(AuraApplication const* aurApp, uint8 mode // allow flying WorldPacket data; if (apply) - data.Initialize(SMSG_MOVE_SET_CAN_FLY, 12); + data.Initialize(SMSG_MOVE_SPLINE_SET_FLYING, 12); else - data.Initialize(SMSG_MOVE_UNSET_CAN_FLY, 12); + data.Initialize(SMSG_MOVE_SPLINE_UNSET_FLYING, 12); data.append(target->GetPackGUID()); data << uint32(0); // unk player->SendDirectMessage(&data); @@ -2877,9 +2877,9 @@ void AuraEffect::HandleAuraWaterWalk(AuraApplication const* aurApp, uint8 mode, WorldPacket data; if (apply) - data.Initialize(SMSG_MOVE_WATER_WALK, 8+4); + data.Initialize(SMSG_MOVE_SPLINE_SET_WATER_WALK, 8+4); else - data.Initialize(SMSG_MOVE_LAND_WALK, 8+4); + data.Initialize(SMSG_MOVE_SPLINE_SET_LAND_WALK, 8+4); data.append(target->GetPackGUID()); data << uint32(0); target->SendMessageToSet(&data, true); @@ -2901,9 +2901,9 @@ void AuraEffect::HandleAuraFeatherFall(AuraApplication const* aurApp, uint8 mode WorldPacket data; if (apply) - data.Initialize(SMSG_MOVE_FEATHER_FALL, 8+4); + data.Initialize(SMSG_MOVE_SPLINE_SET_FEATHER_FALL, 8+4); else - data.Initialize(SMSG_MOVE_NORMAL_FALL, 8+4); + data.Initialize(SMSG_MOVE_SPLINE_SET_NORMAL_FALL, 8+4); data.append(target->GetPackGUID()); data << uint32(0); target->SendMessageToSet(&data, true); @@ -2929,9 +2929,9 @@ void AuraEffect::HandleAuraHover(AuraApplication const* aurApp, uint8 mode, bool WorldPacket data; if (apply) - data.Initialize(SMSG_MOVE_SET_HOVER, 8+4); + data.Initialize(SMSG_MOVE_SPLINE_SET_HOVER, 8+4); else - data.Initialize(SMSG_MOVE_UNSET_HOVER, 8+4); + data.Initialize(SMSG_MOVE_SPLINE_UNSET_HOVER, 8+4); data.append(target->GetPackGUID()); data << uint32(0); target->SendMessageToSet(&data, true); @@ -3250,9 +3250,9 @@ void AuraEffect::HandleAuraModIncreaseFlightSpeed(AuraApplication const* aurApp, { WorldPacket data; if (apply) - data.Initialize(SMSG_MOVE_SET_CAN_FLY, 12); + data.Initialize(SMSG_MOVE_SPLINE_SET_FLYING, 12); else - data.Initialize(SMSG_MOVE_UNSET_CAN_FLY, 12); + data.Initialize(SMSG_MOVE_SPLINE_UNSET_FLYING, 12); data.append(player->GetPackGUID()); data << uint32(0); // unknown player->SendDirectMessage(&data); diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index 99283623207..9fc220e600a 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -959,14 +959,14 @@ public: target->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP); target->Mount(mId); - WorldPacket data(SMSG_FORCE_RUN_SPEED_CHANGE, (8+4+1+4)); + WorldPacket data(SMSG_MOVE_SET_RUN_SPEED, (8+4+1+4)); data.append(target->GetPackGUID()); data << (uint32)0; data << (uint8)0; //new 2.1.0 data << float(speed); target->SendMessageToSet(&data, true); - data.Initialize(SMSG_FORCE_SWIM_SPEED_CHANGE, (8+4+4)); + data.Initialize(SMSG_MOVE_SET_SWIM_SPEED, (8+4+4)); data.append(target->GetPackGUID()); data << (uint32)0; data << float(speed); -- cgit v1.2.3 From 599db736e7b0f26f3516ce97d796f7c4f93c7cfe Mon Sep 17 00:00:00 2001 From: Rat Date: Thu, 19 Jan 2012 21:09:02 +0100 Subject: Core/Movement: Enabled CMSG_WORLD_PORT_RESPONSE, fixes Cross-Map teleportation --- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index bff065a6290..b6cd0dc4cae 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -281,7 +281,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(MSG_MOVE_TOGGLE_COLLISION_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_FACING, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_PITCH, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(CMSG_WORLD_PORT_RESPONSE, STATUS_TRANSFER, PROCESS_THREADUNSAFE, &WorldSession::HandleMoveWorldportAckOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_WORLD_PORT_RESPONSE, STATUS_TRANSFER, PROCESS_THREADUNSAFE, &WorldSession::HandleMoveWorldportAckOpcode ); DEFINE_OPCODE_HANDLER(SMSG_MONSTER_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_LAND_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From 2a549a0369b70e856225800138c3638f949d240e Mon Sep 17 00:00:00 2001 From: Rat Date: Fri, 20 Jan 2012 06:17:58 +0100 Subject: Core/Opcodes: Removed and checked some duplicate opcodes --- src/server/game/Server/Protocol/Handlers/GroupHandler.cpp | 4 ++-- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- src/server/game/Server/Protocol/Opcodes.h | 14 ++++++-------- 3 files changed, 9 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Handlers/GroupHandler.cpp b/src/server/game/Server/Protocol/Handlers/GroupHandler.cpp index 03c213b9bd3..27ab91e4941 100755 --- a/src/server/game/Server/Protocol/Handlers/GroupHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/GroupHandler.cpp @@ -683,7 +683,7 @@ void WorldSession::HandlePartyAssignmentOpcode(WorldPacket & recv_data) void WorldSession::HandleRaidReadyCheckOpcode(WorldPacket & recv_data) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_RAID_READY_CHECK"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received SMSG_RAID_READY_CHECK"); Group* group = GetPlayer()->GetGroup(); if (!group) @@ -697,7 +697,7 @@ void WorldSession::HandleRaidReadyCheckOpcode(WorldPacket & recv_data) /********************/ // everything's fine, do it - WorldPacket data(MSG_RAID_READY_CHECK, 8); + WorldPacket data(SMSG_RAID_READY_CHECK, 8); data << GetPlayer()->GetGUID(); group->BroadcastPacket(&data, false, -1); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index b6cd0dc4cae..209099a3c7f 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -863,7 +863,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_RESET_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_LAST_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(MSG_RAID_TARGET_UPDATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidTargetUpdateOpcode ); - DEFINE_OPCODE_HANDLER(MSG_RAID_READY_CHECK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidReadyCheckOpcode ); + DEFINE_OPCODE_HANDLER(SMSG_RAID_READY_CHECK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidReadyCheckOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LUA_USAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(SMSG_PET_ACTION_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PET_DISMISS_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 0d05d924580..682e23359ed 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -352,7 +352,7 @@ enum Opcodes CMSG_QUEST_POI_QUERY = 0x12A5, CMSG_QUEST_QUERY = 0xCE7F, CMSG_QUESTGIVER_ACCEPT_QUEST = 0x0C63, - CMSG_QUESTGIVER_CANCEL = 0xC86A, + CMSG_QUESTGIVER_CANCEL = 0x0000, CMSG_QUESTGIVER_CHOOSE_REWARD = 0x18F3, CMSG_QUESTGIVER_COMPLETE_QUEST = 0xCCE3, CMSG_QUESTGIVER_HELLO = 0xC86A, @@ -378,7 +378,6 @@ enum Opcodes CMSG_REQUEST_CEMETERY_LIST = 0x00, CMSG_REQUEST_PARTY_MEMBER_STATS = 0x987E, CMSG_REQUEST_PET_INFO = 0x9A47, - CMSG_REQUEST_PLAYER_VEHICLE_EXIT = 0xCC6, CMSG_REQUEST_RAID_INFO = 0xECF, CMSG_REQUEST_RATED_BG_INFO = 0x00, CMSG_REQUEST_VEHICLE_EXIT = 0xCC6, @@ -522,8 +521,7 @@ enum Opcodes MSG_QUERY_GUILD_BANK_TEXT = 0x00, MSG_QUERY_NEXT_MAIL_TIME = 0xCEE6, MSG_QUEST_PUSH_RESULT = 0x1863, - MSG_RAID_READY_CHECK = 0x584E, - MSG_RAID_READY_CHECK_CONFIRM = 0x584E, + MSG_RAID_READY_CHECK_CONFIRM = 0x0000, MSG_RAID_READY_CHECK_FINISHED = 0x00, MSG_RAID_TARGET_UPDATE = 0x00, MSG_RANDOM_ROLL = 0x4C57, @@ -531,7 +529,7 @@ enum Opcodes MSG_SET_DUNGEON_DIFFICULTY = 0x0C4F, MSG_SET_RAID_DIFFICULTY = 0x1A5A, MSG_TABARDVENDOR_ACTIVATE = 0x98EB, - MSG_TALENT_WIPE_CONFIRM = 0x4C52, + MSG_TALENT_WIPE_CONFIRM = 0x4C52, //duplicate of CMSG_VERIFY_CONNECTIVITY_RESPONSE OBSOLETE_DROP_ITEM = 0x00, SMSG_ACCOUNT_DATA_TIMES = 0x5EE2, SMSG_ACHIEVEMENT_DELETED = 0x9ED2, @@ -586,7 +584,7 @@ enum Opcodes SMSG_BATTLEFIELD_PORT_DENIED = 0x00, SMSG_BATTLEFIELD_STATUS = 0x00, SMSG_BATTLEFIELD_STATUS1 = 0x70EE, - SMSG_BATTLEFIELD_STATUS2 = 0x20DC, + SMSG_BATTLEFIELD_STATUS2 = 0x0000, SMSG_BATTLEFIELD_STATUS3 = 0x36DE, SMSG_BATTLEFIELD_STATUS4 = 0x626E, SMSG_BATTLEGROUND_INFO_THROTTLED = 0x00, @@ -706,7 +704,7 @@ enum Opcodes SMSG_GROUP_DECLINE = 0x0863, SMSG_GROUP_DESTROYED = 0x00, SMSG_GROUP_INVITE = 0x00, - SMSG_GROUP_JOINED_BATTLEGROUND = 0x265C, + SMSG_GROUP_JOINED_BATTLEGROUND = 0x0000, SMSG_GROUP_LIST = 0x5C7E, SMSG_GROUP_SET_LEADER = 0xCCF2, SMSG_GROUP_UNINVITE = 0x00, @@ -868,7 +866,6 @@ enum Opcodes SMSG_MOVE_UNSET_CAN_FLY = 0xA24C, //forced, for self SMSG_MOVE_UNSET_HOVERING = 0x325E, //forced, for self SMSG_MOVE_UNSET_WALK_IN_AIR = 0x00, - SMSG_MOVE_UPDATE = 0xF66C, SMSG_MOVE_UPDATE_KNOCK_BACK = 0x725C, SMSG_MOVE_UPDATE_TELEPORT = 0xF6DC, SMSG_MULTIPLE_PACKETS = 0xDCEA, @@ -955,6 +952,7 @@ enum Opcodes SMSG_RAID_GROUP_ONLY = 0xDCDB, SMSG_RAID_INSTANCE_INFO = 0x4ACA, SMSG_RAID_INSTANCE_MESSAGE = 0xD862, + SMSG_RAID_READY_CHECK = 0x584E, SMSG_RANDOMIZE_CHAR_NAME = 0xF0DC, SMSG_READ_ITEM_FAILED = 0x0C5B, SMSG_READ_ITEM_OK = 0x9ECE, -- cgit v1.2.3 From 166a161f35d59a156885da3614693cd285922c8e Mon Sep 17 00:00:00 2001 From: Rat Date: Fri, 20 Jan 2012 07:11:54 +0100 Subject: Core/Opcodes: Removed and checked some duplicate opcodes --- src/server/game/Server/Protocol/Opcodes.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 682e23359ed..6b1369aef85 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -227,7 +227,7 @@ enum Opcodes CMSG_INITIATE_TRADE = 0x00, CMSG_INSPECT = 0x9A7B, CMSG_INSTANCE_LOCK_WARNING_RESPONSE = 0x8CF7, - CMSG_ITEM_QUERY_SINGLE = 0x8E2, + CMSG_ITEM_QUERY_SINGLE = 0x0000, CMSG_ITEM_REFUND = 0xCC3, CMSG_ITEM_REFUND_INFO = 0x1C7E, CMSG_ITEM_TEXT_QUERY = 0x4AEB, @@ -748,7 +748,7 @@ enum Opcodes SMSG_ITEM_NAME_QUERY_RESPONSE = 0x00, SMSG_ITEM_PUSH_RESULT = 0x8EFB, SMSG_ITEM_REFUND_INFO_RESPONSE = 0x304E, - SMSG_ITEM_REFUND_RESULT = 0x60DC, + SMSG_ITEM_REFUND_RESULT = 0x0000, SMSG_ITEM_TEXT_QUERY_RESPONSE = 0x984A, SMSG_ITEM_TIME_UPDATE = 0x8AEB, SMSG_JOINED_BATTLEGROUND_QUEUE = 0x00, @@ -988,7 +988,7 @@ enum Opcodes SMSG_SET_PROFICIENCY = 0x9C5F, SMSG_SET_PROJECTILE_POSITION = 0xC8F7, SMSG_SHOW_BANK = 0xCCA, - SMSG_SHOWTAXINODES = 0x8CFB, + SMSG_SHOWTAXINODES = 0x0000, SMSG_SPELL_COOLDOWN = 0x88D6, SMSG_SPELL_DELAYED = 0x1AD3, SMSG_SPELL_FAILED_OTHER = 0xCE4A, -- cgit v1.2.3 From 774935926930997b9f5ac225e707230a2ec67b33 Mon Sep 17 00:00:00 2001 From: Rat Date: Fri, 20 Jan 2012 14:25:46 +0100 Subject: Core/ByteBuffer: Implemented ReadXorByte, usefull when reading guid bytes based on bits --- src/server/shared/Packets/ByteBuffer.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src') diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h index 805a031ee4b..a15f8ce5c30 100755 --- a/src/server/shared/Packets/ByteBuffer.h +++ b/src/server/shared/Packets/ByteBuffer.h @@ -194,6 +194,19 @@ class ByteBuffer b ^= read(); } + uint8 ReadXorByte() + { + return ReadUInt8() ^ 1; + } + + void ReadXorByte(uint32 bit, uint8& byte) + { + if (!bit) + byte = 0; + else + byte = ReadUInt8() ^ bit; + } + void WriteByteMask(uint8 b) { WriteBit(b); -- cgit v1.2.3 From 98f57f6963832fbf953a77b8d5fa0a9cb6683dc9 Mon Sep 17 00:00:00 2001 From: Rat Date: Fri, 20 Jan 2012 14:26:42 +0100 Subject: Core/Trade: Uncommented and updated HandleBeginTradeOpcode --- .../game/Server/Protocol/Handlers/TradeHandler.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Handlers/TradeHandler.cpp b/src/server/game/Server/Protocol/Handlers/TradeHandler.cpp index dc0165038c1..900f036df0a 100755 --- a/src/server/game/Server/Protocol/Handlers/TradeHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/TradeHandler.cpp @@ -527,15 +527,15 @@ void WorldSession::HandleBeginTradeOpcode(WorldPacket& recvPacket) BitStream mask = recvPacket.ReadBitStream(8); ByteBuffer bytes(8, true); - - if (mask[0]) bytes[5] = recvPacket.ReadUInt8() ^ 1; - if (mask[4]) bytes[2] = recvPacket.ReadUInt8() ^ 1; - if (mask[5]) bytes[3] = recvPacket.ReadUInt8() ^ 1; - if (mask[2]) bytes[4] = recvPacket.ReadUInt8() ^ 1; - if (mask[7]) bytes[1] = recvPacket.ReadUInt8() ^ 1; - if (mask[3]) bytes[0] = recvPacket.ReadUInt8() ^ 1; - if (mask[1]) bytes[6] = recvPacket.ReadUInt8() ^ 1; - if (mask[6]) bytes[7] = recvPacket.ReadUInt8() ^ 1; + + recvPacket.ReadXorByte(mask[0], bytes[5]); + recvPacket.ReadXorByte(mask[4], bytes[2]); + recvPacket.ReadXorByte(mask[5], bytes[3]); + recvPacket.ReadXorByte(mask[2], bytes[4]); + recvPacket.ReadXorByte(mask[7], bytes[1]); + recvPacket.ReadXorByte(mask[3], bytes[0]); + recvPacket.ReadXorByte(mask[1], bytes[6]); + recvPacket.ReadXorByte(mask[6], bytes[7]); uint64 tradeGuid = BitConverter::ToUInt64(bytes); */ -- cgit v1.2.3 From 7d2c5d263d5a8b5681cb1f900e4519712f090468 Mon Sep 17 00:00:00 2001 From: Rat Date: Fri, 20 Jan 2012 14:30:30 +0100 Subject: Core/Misc: use ReadXorByte to read bitpacked guids --- .../game/Server/Protocol/Handlers/CharacterHandler.cpp | 16 ++++++++-------- .../game/Server/Protocol/Handlers/GuildHandler.cpp | 18 +++++++++--------- 2 files changed, 17 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp index b645f3e4527..6479c6b6386 100644 --- a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp @@ -820,14 +820,14 @@ void WorldSession::HandlePlayerLoginOpcode(WorldPacket & recv_data) ByteBuffer bytes(8, true); - if (mask[6]) bytes[5] = recv_data.ReadUInt8() ^ 1; - if (mask[0]) bytes[0] = recv_data.ReadUInt8() ^ 1; - if (mask[4]) bytes[3] = recv_data.ReadUInt8() ^ 1; - if (mask[1]) bytes[4] = recv_data.ReadUInt8() ^ 1; - if (mask[2]) bytes[7] = recv_data.ReadUInt8() ^ 1; - if (mask[5]) bytes[2] = recv_data.ReadUInt8() ^ 1; - if (mask[7]) bytes[6] = recv_data.ReadUInt8() ^ 1; - if (mask[3]) bytes[1] = recv_data.ReadUInt8() ^ 1; + recv_data.ReadXorByte(mask[6], bytes[5]); + recv_data.ReadXorByte(mask[0], bytes[0]); + recv_data.ReadXorByte(mask[4], bytes[3]); + recv_data.ReadXorByte(mask[1], bytes[4]); + recv_data.ReadXorByte(mask[2], bytes[7]); + recv_data.ReadXorByte(mask[5], bytes[2]); + recv_data.ReadXorByte(mask[7], bytes[6]); + recv_data.ReadXorByte(mask[3], bytes[1]); playerGuid = BitConverter::ToUInt64(bytes); diff --git a/src/server/game/Server/Protocol/Handlers/GuildHandler.cpp b/src/server/game/Server/Protocol/Handlers/GuildHandler.cpp index e5198e26bd9..fff068a0a04 100755 --- a/src/server/game/Server/Protocol/Handlers/GuildHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/GuildHandler.cpp @@ -132,15 +132,15 @@ void WorldSession::HandleGuildRosterOpcode(WorldPacket& recvPacket) BitStream mask = recvPacket.ReadBitStream(8); ByteBuffer bytes(8, true); - - if (mask[0]) bytes[7] = recvPacket.ReadUInt8() ^ 1; - if (mask[5]) bytes[4] = recvPacket.ReadUInt8() ^ 1; - if (mask[4]) bytes[5] = recvPacket.ReadUInt8() ^ 1; - if (mask[7]) bytes[0] = recvPacket.ReadUInt8() ^ 1; - if (mask[3]) bytes[1] = recvPacket.ReadUInt8() ^ 1; - if (mask[2]) bytes[2] = recvPacket.ReadUInt8() ^ 1; - if (mask[1]) bytes[6] = recvPacket.ReadUInt8() ^ 1; - if (mask[6]) bytes[3] = recvPacket.ReadUInt8() ^ 1; + + recvPacket.ReadXorByte(mask[0], bytes[7]); + recvPacket.ReadXorByte(mask[5], bytes[4]); + recvPacket.ReadXorByte(mask[4], bytes[5]); + recvPacket.ReadXorByte(mask[7], bytes[0]); + recvPacket.ReadXorByte(mask[3], bytes[1]); + recvPacket.ReadXorByte(mask[2], bytes[2]); + recvPacket.ReadXorByte(mask[1], bytes[6]); + recvPacket.ReadXorByte(mask[6], bytes[3]); uint64 guildGuid = BitConverter::ToUInt64(bytes); -- cgit v1.2.3 From 6cd52e7e027c325fad16c295dc83bd70da9d2ded Mon Sep 17 00:00:00 2001 From: Rat Date: Fri, 20 Jan 2012 14:34:04 +0100 Subject: Core/Movement: Fixed short-range teleportation, needs more testing -added structure for CMSG_MOVE_TIME_SKIPPED, still need to implement the time synch --- src/server/game/Entities/Player/Player.cpp | 46 +++++++++++++++------- src/server/game/Entities/Player/Player.h | 1 - .../game/Server/Protocol/Handlers/MiscHandler.cpp | 25 +++++++++--- .../Server/Protocol/Handlers/MovementHandler.cpp | 18 +++++++-- src/server/game/Server/Protocol/Opcodes.cpp | 4 +- src/server/game/Spells/SpellEffects.cpp | 2 +- 6 files changed, 70 insertions(+), 26 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 61d4121c2e4..30427b2bec0 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -2068,20 +2068,39 @@ uint8 Player::GetChatTag() const void Player::SendTeleportPacket(Position &oldPos) { - WorldPacket data2(SMSG_MOVE_TELEPORT, 38); - data2.append(GetPackGUID()); - BuildMovementPacket(&data2); - Relocate(&oldPos); - SendMessageToSet(&data2, false); -} + WorldPacket data(SMSG_MOVE_TELEPORT, 38); + + uint64 guid = GetGUID(); + uint8* bytes = (uint8*)&guid; + + data.WriteBit(GetTransGUID()); + data.WriteBit(bytes[0]); + data.WriteBit(bytes[2]); + data.WriteBit(bytes[6]); + data.WriteBit(bytes[7]); + data.WriteBit(bytes[4]); + data.WriteBit(bytes[5]); + data.WriteBit(bytes[3]); + data.WriteBit(bytes[1]); + data.WriteBit(0); //unk byte's bit + data << GetPositionX(); + data << GetPositionY(); + data << GetPositionZ(); + data.WriteByteSeq(bytes[5]); + data.WriteByteSeq(bytes[4]); + if (GetTransGUID()) data << GetTransGUID(); + data.WriteByteSeq(bytes[2]); + data.WriteByteSeq(bytes[7]); + data << uint32(0); //unk int + data.WriteByteSeq(bytes[1]); + data.WriteByteSeq(bytes[0]); + data.WriteByteSeq(bytes[6]); + data.WriteByteSeq(bytes[3]); + // unk byte, only if bit is set + data << GetOrientation(); -void Player::SendTeleportAckPacket() -{ - WorldPacket data(CMSG_MOVE_TELEPORT_ACK, 41); - data.append(GetPackGUID()); - data << uint32(0); // this value increments every time - BuildMovementPacket(&data); - GetSession()->SendPacket(&data); + Relocate(&oldPos); + SendDirectMessage(&data); } bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientation, uint32 options) @@ -2195,7 +2214,6 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati Position oldPos; GetPosition(&oldPos); Relocate(x, y, z, orientation); - SendTeleportAckPacket(); SendTeleportPacket(oldPos); // this automatically relocates to oldPos in order to broadcast the packet in the right place } } diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index f27e427b435..9c8f60b3abc 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1983,7 +1983,6 @@ class Player : public Unit, public GridObject void SendMessageToSet(WorldPacket* data, Player const* skipped_rcvr); void SendTeleportPacket(Position &oldPos); - void SendTeleportAckPacket(); Corpse* GetCorpse() const; void SpawnCorpseBones(); diff --git a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp b/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp index 898db683c0a..fac568b9857 100755 --- a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp @@ -1078,12 +1078,27 @@ void WorldSession::HandleNextCinematicCamera(WorldPacket & /*recv_data*/) void WorldSession::HandleMoveTimeSkippedOpcode(WorldPacket & recv_data) { - /* WorldSession::Update(getMSTime());*/ - sLog->outStaticDebug("WORLD: Time Lag/Synchronization Resent/Update"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_MOVE_TIME_SKIPPED"); + + BitStream mask = recv_data.ReadBitStream(8); + + uint32 time; + recv_data >> time; + + ByteBuffer bytes(8, true); + recv_data.ReadXorByte(mask[0], bytes[1]); + recv_data.ReadXorByte(mask[1], bytes[4]); + recv_data.ReadXorByte(mask[7], bytes[2]); + recv_data.ReadXorByte(mask[5], bytes[5]); + recv_data.ReadXorByte(mask[3], bytes[0]); + recv_data.ReadXorByte(mask[6], bytes[7]); + recv_data.ReadXorByte(mask[2], bytes[6]); + recv_data.ReadXorByte(mask[4], bytes[3]); + + uint64 guid = BitConverter::ToUInt64(bytes); + + //TODO! - uint64 guid; - recv_data.readPackGUID(guid); - recv_data.read_skip(); /* uint64 guid; uint32 time_skipped; diff --git a/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp b/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp index 9fc429f1321..b23a73dc9bb 100755 --- a/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp @@ -192,12 +192,24 @@ void WorldSession::HandleMoveWorldportAckOpcode() void WorldSession::HandleMoveTeleportAck(WorldPacket& recv_data) { sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_MOVE_TELEPORT_ACK"); - uint64 guid; - - recv_data.readPackGUID(guid); + BitStream mask = recv_data.ReadBitStream(8); + uint32 flags, time; recv_data >> flags >> time; + + ByteBuffer bytes(8, true); + recv_data.ReadXorByte(mask[6], bytes[1]); + recv_data.ReadXorByte(mask[0], bytes[3]); + recv_data.ReadXorByte(mask[1], bytes[2]); + recv_data.ReadXorByte(mask[7], bytes[0]); + recv_data.ReadXorByte(mask[5], bytes[6]); + recv_data.ReadXorByte(mask[3], bytes[4]); + recv_data.ReadXorByte(mask[2], bytes[7]); + recv_data.ReadXorByte(mask[4], bytes[5]); + + uint64 guid = BitConverter::ToUInt64(bytes); + sLog->outStaticDebug("Guid " UI64FMTD, guid); sLog->outStaticDebug("Flags %u, time %u", flags, time/IN_MILLISECONDS); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 209099a3c7f..41ddddaaf1d 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -258,9 +258,9 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_RUN_MODE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_WALK_MODE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_TOGGLE_LOGGING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_TELEPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_TELEPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_TELEPORT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_TELEPORT_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveTeleportAck ); + DEFINE_OPCODE_HANDLER(CMSG_MOVE_TELEPORT_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveTeleportAck ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_TOGGLE_FALL_LOGGING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_MOVE_FALL_LAND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); DEFINE_OPCODE_HANDLER(MSG_MOVE_START_SWIM, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index c417a14ccd3..86bc68e631d 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -3414,7 +3414,7 @@ void Spell::EffectDistract(SpellEffIndex /*effIndex*/) { // For players just turn them unitTarget->ToPlayer()->UpdatePosition(unitTarget->GetPositionX(), unitTarget->GetPositionY(), unitTarget->GetPositionZ(), angle, false); - unitTarget->ToPlayer()->SendTeleportAckPacket(); + //unitTarget->ToPlayer()->SendTeleportAckPacket(); TODO! } else { -- cgit v1.2.3 From 0bd8d246594897b7ee08f78a0a07147928a0d2a0 Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 20 Jan 2012 19:35:11 +0100 Subject: Core/Player: Currency precision updates --- src/server/game/DataStores/DBCStructure.h | 2 +- src/server/game/Entities/Player/Player.cpp | 27 ++++++++++++++++----------- src/server/game/Entities/Player/Player.h | 3 +-- 3 files changed, 18 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index aa244a2985e..d2083c90d9f 100755 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -858,7 +858,7 @@ struct CurrencyTypesEntry //uint32 unk6; // 6 archaeology-related (?) uint32 TotalCap; // 7 uint32 WeekCap; // 8 - //int32 unk9; // 9 + uint32 Flags; // 9 //char* description; // 10 }; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 30427b2bec0..975a999267b 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -2069,10 +2069,10 @@ uint8 Player::GetChatTag() const void Player::SendTeleportPacket(Position &oldPos) { WorldPacket data(SMSG_MOVE_TELEPORT, 38); - + uint64 guid = GetGUID(); uint8* bytes = (uint8*)&guid; - + data.WriteBit(GetTransGUID()); data.WriteBit(bytes[0]); data.WriteBit(bytes[2]); @@ -7303,12 +7303,16 @@ void Player::SendCurrencies() const for (PlayerCurrenciesMap::const_iterator itr = m_currencies.begin(); itr != m_currencies.end(); ++itr) { CurrencyTypesEntry const* entry = sCurrencyTypesStore.LookupEntry(itr->first); - packet << uint32(itr->second.weekCount / PLAYER_CURRENCY_PRECISION); + if (!entry) + continue; + + uint32 precision = (entry->Flags & 0x8) ? 100 : 1; + packet << uint32(itr->second.weekCount / precision); packet << uint8(0); // unknown packet << uint32(entry->ID); packet << uint32(sWorld->GetNextWeeklyQuestsResetTime() - 1*WEEK); - packet << uint32(_GetCurrencyWeekCap(entry) / PLAYER_CURRENCY_PRECISION); - packet << uint32(itr->second.totalCount / PLAYER_CURRENCY_PRECISION); + packet << uint32(_GetCurrencyWeekCap(entry) / precision); + packet << uint32(itr->second.totalCount / precision); } GetSession()->SendPacket(&packet); @@ -7334,6 +7338,7 @@ void Player::ModifyCurrency(uint32 id, int32 count) CurrencyTypesEntry const* currency = sCurrencyTypesStore.LookupEntry(id); ASSERT(currency); + int32 precision = currency->Flags & 0x8 ? 100 : 1; uint32 oldTotalCount = 0; uint32 oldWeekCount = 0; PlayerCurrenciesMap::iterator itr = m_currencies.find(id); @@ -7395,8 +7400,8 @@ void Player::ModifyCurrency(uint32 id, int32 count) WorldPacket packet(SMSG_UPDATE_CURRENCY, 12); packet << uint32(id); - packet << uint32(weekCap ? (newWeekCount / PLAYER_CURRENCY_PRECISION) : 0); - packet << uint32(newTotalCount / PLAYER_CURRENCY_PRECISION); + packet << uint32(weekCap ? (newWeekCount / precision) : 0); + packet << uint32(newTotalCount / precision); GetSession()->SendPacket(&packet); } } @@ -7437,7 +7442,7 @@ uint32 Player::_GetCurrencyWeekCap(const CurrencyTypesEntry* currency) const if (cap != currency->WeekCap && IsInWorld() && !GetSession()->PlayerLoading()) { WorldPacket packet(SMSG_UPDATE_CURRENCY_WEEK_LIMIT, 8); - packet << uint32(cap / PLAYER_CURRENCY_PRECISION); + packet << uint32(cap / ((currency->Flags & 0x8) ? 100 : 1)); packet << uint32(currency->ID); GetSession()->SendPacket(&packet); } @@ -16214,9 +16219,9 @@ void Player::SendQuestReward(Quest const* quest, uint32 XP, Object* questGiver) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_QUEST_COMPLETE quest = %u", questId); sGameEventMgr->HandleQuestComplete(questId); WorldPacket data(SMSG_QUESTGIVER_QUEST_COMPLETE, (4+4+4+4+4)); - + data << int8(0x80); // 4.x unknown flag, most common value is 0x80 (it might be a single bit) - + if (getLevel() < sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) { data << uint32(XP); @@ -16227,7 +16232,7 @@ void Player::SendQuestReward(Quest const* quest, uint32 XP, Object* questGiver) data << uint32(0); data << uint32(quest->GetRewOrReqMoney() + int32(quest->GetRewMoneyMaxLevel() * sWorld->getRate(RATE_DROP_MONEY))); } - + data << uint32(quest->GetRewardSkillPoints()); // 4.x bonus skill points data << uint32(questId); data << uint32(quest->GetRewardSkillId()); // 4.x bonus skill id diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 9c8f60b3abc..66e95f09003 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -143,7 +143,6 @@ typedef UNORDERED_MAP PlayerTalentMap; typedef UNORDERED_MAP PlayerSpellMap; typedef std::list SpellModList; typedef UNORDERED_MAP PlayerCurrenciesMap; -#define PLAYER_CURRENCY_PRECISION 100 typedef std::list WhisperListContainer; @@ -2078,7 +2077,7 @@ class Player : public Unit, public GridObject /*********************************************************/ // TODO: Properly implement correncies as of Cataclysm void UpdateHonorFields(); - bool RewardHonor(Unit* victim, uint32 groupsize, int32 honor = -1, bool pvptoken = false); + bool RewardHonor(Unit* victim, uint32 groupsize, int32 honor = -1, bool pvptoken = false); uint32 GetMaxPersonalArenaRatingRequirement(uint32 minarenaslot) const; //End of PvP System -- cgit v1.2.3 From 075780ad597d3073d434f73a33116a2cddbb73c9 Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 20 Jan 2012 19:48:44 +0100 Subject: Forgotten dbc format change --- src/server/game/DataStores/DBCfmt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index 11bd0fb348a..697b80cf3bb 100755 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -46,7 +46,7 @@ const char CreatureModelDatafmt[]="nxxxxxxxxxxxxxffxxxxxxxxxxxx"; const char CreatureFamilyfmt[]="nfifiiiiixsx"; const char CreatureSpellDatafmt[]="niiiixxxx"; const char CreatureTypefmt[]="nxx"; -const char CurrencyTypesfmt[]="nxxxxxxiixx"; +const char CurrencyTypesfmt[]="nxxxxxxiiix"; const char DestructibleModelDatafmt[]="ixxixxxixxxixxxixxxxxxxx"; const char DungeonEncounterfmt[]="iiixisxx"; -- cgit v1.2.3 From bdd02e763b27869de9e9d0200ac75189e1bdf625 Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 20 Jan 2012 20:31:59 +0100 Subject: Core/Objects: Fixed visibility of gameobjects and fixed client crash when logging in a character that had currencies (honor points) --- src/server/game/Entities/Object/Object.cpp | 17 +++++----- .../game/Entities/Object/Updates/UpdateData.h | 2 +- src/server/game/Entities/Player/Player.cpp | 36 +++++++++++++++------- 3 files changed, 35 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index ae68624e58e..d4e48548aa0 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -301,9 +301,9 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint16 flags) const *data << self->GetSpeed(MOVE_WALK); *data << self->GetSpeed(MOVE_RUN); - *data << self->GetSpeed(MOVE_SWIM_BACK); - *data << self->GetSpeed(MOVE_SWIM); *data << self->GetSpeed(MOVE_RUN_BACK); + *data << self->GetSpeed(MOVE_SWIM); + *data << self->GetSpeed(MOVE_SWIM_BACK); *data << self->GetSpeed(MOVE_FLIGHT); *data << self->GetSpeed(MOVE_FLIGHT_BACK); *data << self->GetSpeed(MOVE_TURN_RATE); @@ -423,9 +423,7 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint16 flags) const // 0x2 if (flags & UPDATEFLAG_TRANSPORT) - { *data << uint32(getMSTime()); // ms time - } // 0x80 if (flags & UPDATEFLAG_VEHICLE) // unused for now @@ -434,11 +432,14 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint16 flags) const *data << float(((Creature*)this)->GetOrientation()); // facing adjustment } - // 0x800 - if (flags & UPDATEFLAG_UNK2) - *data << uint16(0) << uint16(0) << uint16(0); //unk + // 0x800 - AnimKits + if (flags & UPDATEFLAG_ANIMKITS) + *data << uint16(0) << uint16(0) << uint16(0); //unk + + // 0x200 + if (flags & UPDATEFLAG_ROTATION) + *data << int64(((GameObject*)this)->GetRotation()); - // 0x1000 if (flags & UPDATEFLAG_UNK3) *data << uint8(0);//unk counter to read uint32 values diff --git a/src/server/game/Entities/Object/Updates/UpdateData.h b/src/server/game/Entities/Object/Updates/UpdateData.h index 4e74e67f986..d1bdad13a19 100755 --- a/src/server/game/Entities/Object/Updates/UpdateData.h +++ b/src/server/game/Entities/Object/Updates/UpdateData.h @@ -44,7 +44,7 @@ enum OBJECT_UPDATE_FLAGS UPDATEFLAG_POSITION = 0x0100, UPDATEFLAG_ROTATION = 0x0200, UPDATEFLAG_UNK3 = 0x0400, - UPDATEFLAG_UNK4 = 0x0800, + UPDATEFLAG_ANIMKITS = 0x0800, UPDATEFLAG_UNK5 = 0x1000, UPDATEFLAG_UNK6 = 0x2000 }; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 975a999267b..4d9dd6aa669 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -7302,17 +7302,31 @@ void Player::SendCurrencies() const for (PlayerCurrenciesMap::const_iterator itr = m_currencies.begin(); itr != m_currencies.end(); ++itr) { - CurrencyTypesEntry const* entry = sCurrencyTypesStore.LookupEntry(itr->first); - if (!entry) - continue; - - uint32 precision = (entry->Flags & 0x8) ? 100 : 1; - packet << uint32(itr->second.weekCount / precision); - packet << uint8(0); // unknown - packet << uint32(entry->ID); - packet << uint32(sWorld->GetNextWeeklyQuestsResetTime() - 1*WEEK); - packet << uint32(_GetCurrencyWeekCap(entry) / precision); - packet << uint32(itr->second.totalCount / precision); + CurrencyTypesEntry const* entry = sCurrencyTypesStore.LookupEntry(itr->first); + if (!entry) + continue; + + uint32 precision = (entry->Flags & 0x8) ? 100 : 1; + packet.WriteBit(_GetCurrencyWeekCap(entry) / precision); + packet.WriteBit(0); + packet.WriteBit(itr->second.weekCount / precision); + } + + for (PlayerCurrenciesMap::const_iterator itr = m_currencies.begin(); itr != m_currencies.end(); ++itr) + { + CurrencyTypesEntry const* entry = sCurrencyTypesStore.LookupEntry(itr->first); + if (!entry) + continue; + + uint32 precision = (entry->Flags & 0x8) ? 100 : 1; + packet << uint32(entry->ID); + if (uint32 weekCap = (_GetCurrencyWeekCap(entry) / precision)) + packet << uint32(weekCap); + packet << uint32(itr->second.totalCount / precision); + packet << uint8(0); // unknown + //packet << uint32(0); // season total earned + if (uint32 weekCount = (itr->second.weekCount / precision)) + packet << uint32(weekCount); } GetSession()->SendPacket(&packet); -- cgit v1.2.3 From 68ec9b02e39b8adca44e49cc928ab54ab7b64e8f Mon Sep 17 00:00:00 2001 From: Rat Date: Sat, 21 Jan 2012 22:22:24 +0100 Subject: Core/Movement: added forgotten MSG_MOVE_STOP_ASCEND structure --- src/server/game/Movement/MovementStructures.h | 42 +++++++++++++-------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/server/game/Movement/MovementStructures.h b/src/server/game/Movement/MovementStructures.h index 9f8a5108e46..013e759e573 100644 --- a/src/server/game/Movement/MovementStructures.h +++ b/src/server/game/Movement/MovementStructures.h @@ -1257,17 +1257,19 @@ MovementStatusElements MovementStartSwimSequence[] = { }; //4.2.2 MovementStatusElements MovementStopAscendSequence[] = { - MSEFlags2, - MSEHaveSpline, - MSEGuidByte4, - MSEGuidByte3, MSEGuidByte0, + MSEGuidByte3, + MSEFlags2, MSEGuidByte1, MSEGuidByte5, + MSEHaveSpline, + MSEGuidByte4, + MSEGuidByte2, MSEFlags, MSEGuidByte7, - MSEGuidByte2, MSEGuidByte6, + MSEHaveFallData, + MSEHaveFallDirection, MSEHaveTransportData, MSETransportGuidByte0, MSETransportGuidByte6, @@ -1279,20 +1281,22 @@ MovementStatusElements MovementStopAscendSequence[] = { MSETransportGuidByte7, MSETransportHaveTime2, MSETransportHaveTime3, - MSEHaveFallData, - MSEHaveFallDirection, - MSEHaveSplineElev, MSEHavePitch, + MSEHaveSplineElev, MSETimestamp, + MSEPositionO, MSEPositionX, MSEPositionY, MSEPositionZ, - MSEPositionO, - MSEGuidByte4_2, - MSEGuidByte7_2, - MSEGuidByte3_2, + MSEGuidByte0_2, + MSEGuidByte1_2, MSEGuidByte2_2, - MSEGuidByte5_2, + MSEGuidByte7_2, + MSEFallTime, + MSEFallVerticalSpeed, + MSEFallHorizontalSpeed, + MSEFallCosAngle, + MSEFallSinAngle, MSETransportSeat, MSETransportPositionO, MSETransportPositionX, @@ -1309,16 +1313,12 @@ MovementStatusElements MovementStopAscendSequence[] = { MSETransportGuidByte1_2, MSETransportGuidByte0_2, MSETransportGuidByte4_2, - MSEFallTime, - MSEFallVerticalSpeed, - MSEFallHorizontalSpeed, - MSEFallCosAngle, - MSEFallSinAngle, - MSEGuidByte1_2, + MSEPitch, + MSEGuidByte5_2, + MSEGuidByte4_2, + MSEGuidByte3_2, MSESplineElev, - MSEGuidByte0_2, MSEGuidByte6_2, - MSEPitch, }; MovementStatusElements* GetMovementStatusElementsSequence(Opcodes opcode) -- cgit v1.2.3 From f006a2da68cf2df130a02e41eda4ab0e06d92170 Mon Sep 17 00:00:00 2001 From: Rat Date: Sat, 21 Jan 2012 22:25:01 +0100 Subject: Core/Movement: updated UN/SET_FLY packets, .gm fly on/off now works, fly mounts are still broken, probably aura handling needs to be updated too --- src/server/game/Entities/Player/Player.cpp | 48 ++++++++++++++++++++++ src/server/game/Entities/Player/Player.h | 1 + src/server/game/Entities/Unit/Unit.cpp | 8 ++-- .../Server/Protocol/Handlers/MovementHandler.cpp | 5 +-- src/server/game/Server/Protocol/Opcodes.cpp | 3 +- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 20 +-------- src/server/scripts/Commands/cs_gm.cpp | 7 +--- 7 files changed, 60 insertions(+), 32 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 4d9dd6aa669..cdb9ddbcd9b 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -2103,6 +2103,54 @@ void Player::SendTeleportPacket(Position &oldPos) SendDirectMessage(&data); } +void Player::SendSetFlyPacket(bool apply) +{ + WorldPacket data(apply ? SMSG_MOVE_SET_CAN_FLY : SMSG_MOVE_UNSET_CAN_FLY, 12); + uint64 guid = GetGUID(); + uint8* bytes = (uint8*)&guid; + if (apply) + { + data.WriteBit(bytes[4]); + data.WriteBit(bytes[3]); + data.WriteBit(bytes[6]); + data.WriteBit(bytes[0]); + data.WriteBit(bytes[1]); + data.WriteBit(bytes[2]); + data.WriteBit(bytes[7]); + data.WriteBit(bytes[5]); + data.WriteByteSeq(bytes[3]); + data.WriteByteSeq(bytes[7]); + data.WriteByteSeq(bytes[5]); + data.WriteByteSeq(bytes[0]); + data.WriteByteSeq(bytes[1]); + data.WriteByteSeq(bytes[4]); + data << uint32(sWorld->GetGameTime()); + data.WriteByteSeq(bytes[6]); + data.WriteByteSeq(bytes[2]); + } + else + { + data.WriteBit(bytes[1]); + data.WriteBit(bytes[6]); + data.WriteBit(bytes[0]); + data.WriteBit(bytes[2]); + data.WriteBit(bytes[4]); + data.WriteBit(bytes[5]); + data.WriteBit(bytes[7]); + data.WriteBit(bytes[3]); + data.WriteByteSeq(bytes[7]); + data.WriteByteSeq(bytes[6]); + data.WriteByteSeq(bytes[5]); + data.WriteByteSeq(bytes[0]); + data << uint32(sWorld->GetGameTime()); + data.WriteByteSeq(bytes[3]); + data.WriteByteSeq(bytes[1]); + data.WriteByteSeq(bytes[2]); + data.WriteByteSeq(bytes[4]); + } + SendDirectMessage(&data); +} + bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientation, uint32 options) { if (!MapManager::IsValidMapCoord(mapid, x, y, z, orientation)) diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 66e95f09003..a594f2c02ef 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1982,6 +1982,7 @@ class Player : public Unit, public GridObject void SendMessageToSet(WorldPacket* data, Player const* skipped_rcvr); void SendTeleportPacket(Position &oldPos); + void SendSetFlyPacket(bool apply); Corpse* GetCorpse() const; void SpawnCorpseBones(); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index dcc18c0559f..cbfa73d5311 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -11958,11 +11958,11 @@ void Unit::Mount(uint32 mount, uint32 VehicleId, uint32 creatureEntry) player->UnsummonPetTemporaryIfAny(); } - WorldPacket data(SMSG_MOVE_SET_COLLISION_HEIGHT, GetPackGUID().size() + 4 + 4); + /*WorldPacket data(SMSG_MOVE_SET_COLLISION_HEIGHT, GetPackGUID().size() + 4 + 4); data.append(GetPackGUID()); data << uint32(sWorld->GetGameTime()); // Packet counter data << player->GetCollisionHeight(true); - player->GetSession()->SendPacket(&data); + player->GetSession()->SendPacket(&data);*/ } RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_MOUNT); @@ -11976,14 +11976,14 @@ void Unit::Dismount() SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, 0); RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_MOUNT); - if (Player* thisPlayer = ToPlayer()) + /*if (Player* thisPlayer = ToPlayer()) { WorldPacket data(SMSG_MOVE_SET_COLLISION_HEIGHT, GetPackGUID().size() + 4 + 4); data.append(GetPackGUID()); data << uint32(sWorld->GetGameTime()); // Packet counter data << thisPlayer->GetCollisionHeight(false); thisPlayer->GetSession()->SendPacket(&data); - } + }*/ WorldPacket data(SMSG_DISMOUNT, 8); data.appendPackGUID(GetGUID()); diff --git a/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp b/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp index b23a73dc9bb..71dfc670145 100755 --- a/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp @@ -484,10 +484,7 @@ void WorldSession::HandleSetActiveMoverOpcode(WorldPacket &recv_data) GetPlayer()->SetMover(mover); if (mover != GetPlayer() && mover->canFly()) { - WorldPacket data(SMSG_MOVE_SPLINE_SET_FLYING, 12); - data.append(mover->GetPackGUID()); - data << uint32(0); - SendPacket(&data); + GetPlayer()->SendSetFlyPacket(true); } } else diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 41ddddaaf1d..1225f7b6c06 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -896,7 +896,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_SWIM_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_SWIM_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_FLYING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_UNSET_FLYING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_CAN_FLY_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveSetCanFlyAckOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_FLY, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 124e1628903..c54f644a43c 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -2850,14 +2850,7 @@ void AuraEffect::HandleAuraAllowFlight(AuraApplication const* aurApp, uint8 mode if (Player* player = target->m_movedPlayer) { // allow flying - WorldPacket data; - if (apply) - data.Initialize(SMSG_MOVE_SPLINE_SET_FLYING, 12); - else - data.Initialize(SMSG_MOVE_SPLINE_UNSET_FLYING, 12); - data.append(target->GetPackGUID()); - data << uint32(0); // unk - player->SendDirectMessage(&data); + player->SendSetFlyPacket(apply); } } @@ -3247,16 +3240,7 @@ void AuraEffect::HandleAuraModIncreaseFlightSpeed(AuraApplication const* aurApp, if (mode & AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK && (apply || (!target->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) && !target->HasAuraType(SPELL_AURA_FLY)))) { if (Player* player = target->m_movedPlayer) - { - WorldPacket data; - if (apply) - data.Initialize(SMSG_MOVE_SPLINE_SET_FLYING, 12); - else - data.Initialize(SMSG_MOVE_SPLINE_UNSET_FLYING, 12); - data.append(player->GetPackGUID()); - data << uint32(0); // unknown - player->SendDirectMessage(&data); - } + player->SendSetFlyPacket(apply); } if (mode & AURA_EFFECT_HANDLE_REAL) diff --git a/src/server/scripts/Commands/cs_gm.cpp b/src/server/scripts/Commands/cs_gm.cpp index 926e2fe2bf2..ac57d9c9425 100644 --- a/src/server/scripts/Commands/cs_gm.cpp +++ b/src/server/scripts/Commands/cs_gm.cpp @@ -97,17 +97,14 @@ public: WorldPacket data; if (strncmp(args, "on", 3) == 0) - data.SetOpcode(SMSG_MOVE_SET_CAN_FLY); + target->SendSetFlyPacket(true); else if (strncmp(args, "off", 4) == 0) - data.SetOpcode(SMSG_MOVE_UNSET_CAN_FLY); + target->SendSetFlyPacket(false); else { handler->SendSysMessage(LANG_USE_BOL); return false; } - data.append(target->GetPackGUID()); - data << uint32(0); // unknown - target->SendMessageToSet(&data, true); handler->PSendSysMessage(LANG_COMMAND_FLYMODE_STATUS, handler->GetNameLink(target).c_str(), args); return true; } -- cgit v1.2.3 From cb78962a7e63c84f41c5dab035db0e1353e956c7 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 21 Jan 2012 23:18:33 +0100 Subject: Core/Auras: Fixer assertion failures on mounting (its a good idea to load the dbc before trying to lookup its values) --- src/server/game/DataStores/DBCStores.cpp | 1 + src/server/game/DataStores/DBCStructure.h | 4 ++-- src/server/game/DataStores/DBCfmt.h | 2 +- src/server/game/Entities/Unit/Unit.cpp | 6 +++--- 4 files changed, 7 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 3a5a988e7b7..3367eac6e7d 100755 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -331,6 +331,7 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sCinematicSequencesStore, dbcPath, "CinematicSequences.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sCreatureDisplayInfoStore, dbcPath, "CreatureDisplayInfo.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sCreatureFamilyStore, dbcPath, "CreatureFamily.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sCreatureModelDataStore, dbcPath, "CreatureModelData.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sCreatureSpellDataStore, dbcPath, "CreatureSpellData.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sCreatureTypeStore, dbcPath, "CreatureType.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sCurrencyTypesStore, dbcPath, "CurrencyTypes.dbc");//14545 diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index d2083c90d9f..0bde8e01359 100755 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -803,9 +803,9 @@ struct CreatureModelDataEntry { uint32 Id; //uint32 Flags; - //char* ModelPath[16] + //char* ModelPath //uint32 Unk1; - float Scale; // Used in calculation of unit collision data + //float Scale; // Used in calculation of unit collision data //int32 Unk2 //int32 Unk3 //uint32 Unk4 diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index 697b80cf3bb..b133537a5a3 100755 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -42,7 +42,7 @@ const char ChrClassesXPowerTypesfmt[]="nii"; const char CinematicSequencesEntryfmt[]="nxxxxxxxxx"; const char CreatureDisplayInfofmt[]="nixxfxxxxxxxxxxxx"; -const char CreatureModelDatafmt[]="nxxxxxxxxxxxxxffxxxxxxxxxxxx"; +const char CreatureModelDatafmt[]="nxxxxxxxxxxxxxffxxxxxxxxxxxxxxx"; const char CreatureFamilyfmt[]="nfifiiiiixsx"; const char CreatureSpellDatafmt[]="niiiixxxx"; const char CreatureTypefmt[]="nxx"; diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index cbfa73d5311..518d95c584b 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -11958,11 +11958,11 @@ void Unit::Mount(uint32 mount, uint32 VehicleId, uint32 creatureEntry) player->UnsummonPetTemporaryIfAny(); } - /*WorldPacket data(SMSG_MOVE_SET_COLLISION_HEIGHT, GetPackGUID().size() + 4 + 4); + WorldPacket data(SMSG_MOVE_SET_COLLISION_HEIGHT, GetPackGUID().size() + 4 + 4); data.append(GetPackGUID()); data << uint32(sWorld->GetGameTime()); // Packet counter data << player->GetCollisionHeight(true); - player->GetSession()->SendPacket(&data);*/ + player->GetSession()->SendPacket(&data); } RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_MOUNT); @@ -12657,7 +12657,7 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) data.WriteByteSeq(bytes[5]); data.WriteByteSeq(bytes[0]); data.WriteByteSeq(bytes[1]); - + data << float(GetSpeed(mtype)); break; case MOVE_RUN_BACK: -- cgit v1.2.3 From 95a8bf536771532128350e461e6957289645747b Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 22 Jan 2012 00:13:57 +0100 Subject: Core/Units: Power fixes --- src/server/game/Entities/Unit/Unit.cpp | 56 +++++++++++++++++++++++++--------- src/server/game/Entities/Unit/Unit.h | 4 +-- 2 files changed, 43 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 518d95c584b..c25e4bf455b 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -13686,42 +13686,64 @@ void Unit::SetMaxHealth(uint32 val) uint32 Unit::GetPowerIndexByClass(uint32 powerId, uint32 classId) const { - ChrClassesEntry const* m_class = sChrClassesStore.LookupEntry(classId); + ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(classId); - ASSERT(m_class && "Class not found"); + ASSERT(classEntry && "Class not found"); uint32 index = 0; - - for (uint32 i = 0; i <= sChrPowerTypesStore.GetNumRows(); i++) + for (uint32 i = 0; i <= sChrPowerTypesStore.GetNumRows(); ++i) { - ChrPowerTypesEntry const* cEntry = sChrPowerTypesStore.LookupEntry(i); - - if (!cEntry) + ChrPowerTypesEntry const* powerEntry = sChrPowerTypesStore.LookupEntry(i); + if (!powerEntry) continue; - if (classId != cEntry->classId) + if (powerEntry->classId != classId) continue; - if (powerId == cEntry->power) + if (powerEntry->power == powerId) return index; - index++; + ++index; } - return 0; + + // return invalid value - this class doesn't use this power + return MAX_POWERS; }; +int32 Unit::GetPower(Powers power) const +{ + uint32 powerIndex = GetPowerIndexByClass(power, getClass()); + if (powerIndex == MAX_POWERS) + return 0; + + return GetUInt32Value(UNIT_FIELD_POWER1 + powerIndex); +} + +uint32 Unit::GetMaxPower(Powers power) const +{ + uint32 powerIndex = GetPowerIndexByClass(power, getClass()); + if (powerIndex == MAX_POWERS) + return 0; + + return GetUInt32Value(UNIT_FIELD_MAXPOWER1 + powerIndex); +} + void Unit::SetPower(Powers power, int32 val) { - uint32 maxPower = GetMaxPower(power); + uint32 powerIndex = GetPowerIndexByClass(power, getClass()); + if (powerIndex == MAX_POWERS) + return; + + int32 maxPower = int32(GetMaxPower(power)); if (maxPower < val) val = maxPower; - SetStatInt32Value(UNIT_FIELD_POWER1 + GetPowerIndexByClass(power, getClass()), val); + SetStatInt32Value(UNIT_FIELD_POWER1 + powerIndex, val); WorldPacket data(SMSG_POWER_UPDATE); data.append(GetPackGUID()); data << uint32(1);//unk - data << uint8(GetPowerIndexByClass(power, getClass())); + data << uint8(powerIndex); data << int32(val); SendMessageToSet(&data, GetTypeId() == TYPEID_PLAYER ? true : false); @@ -13744,8 +13766,12 @@ void Unit::SetPower(Powers power, int32 val) void Unit::SetMaxPower(Powers power, int32 val) { + uint32 powerIndex = GetPowerIndexByClass(power, getClass()); + if (powerIndex == MAX_POWERS) + return; + int32 cur_power = GetPower(power); - SetStatInt32Value(UNIT_FIELD_MAXPOWER1 + power, val); + SetStatInt32Value(UNIT_FIELD_MAXPOWER1 + powerIndex, val); // group update if (GetTypeId() == TYPEID_PLAYER) diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 8353b88e4c9..8274b62145f 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1369,8 +1369,8 @@ class Unit : public WorldObject Powers getPowerType() const { return Powers(GetByteValue(UNIT_FIELD_BYTES_0, 3)); } void setPowerType(Powers power); - int32 GetPower(Powers power) const { return GetUInt32Value(UNIT_FIELD_POWER1+power); } - uint32 GetMaxPower(Powers power) const { return GetUInt32Value(UNIT_FIELD_MAXPOWER1+power); } + int32 GetPower(Powers power) const; + uint32 GetMaxPower(Powers power) const; void SetPower(Powers power, int32 val); void SetMaxPower(Powers power, int32 val); // returns the change in power -- cgit v1.2.3 From 9e0d64e76929944f51df262beaa99763cadd7f87 Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Sun, 22 Jan 2012 02:29:02 +0000 Subject: Core/Opcodes: 11 new opcodes --- src/server/game/Server/Protocol/Opcodes.h | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 6b1369aef85..d9b51a92c08 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -471,7 +471,7 @@ enum Opcodes MSG_GM_BIND_OTHER = 0x00, MSG_GM_SHOWLABEL = 0x00, MSG_GM_SUMMON = 0x00, - MSG_GUILD_BANK_LOG_QUERY = 0x00, + MSG_GUILD_BANK_LOG_QUERY = 0x4CD2, MSG_GUILD_BANK_MONEY_WITHDRAWN = 0xDE77, MSG_GUILD_EVENT_LOG_QUERY = 0xCEDA, MSG_GUILD_PERMISSIONS = 0xDC73, @@ -518,19 +518,18 @@ enum Opcodes MSG_PETITION_DECLINE = 0x98E7, MSG_PETITION_RENAME = 0x4857, MSG_PVP_LOG_DATA = 0x00, - MSG_QUERY_GUILD_BANK_TEXT = 0x00, + MSG_QUERY_GUILD_BANK_TEXT = 0x8CCF, MSG_QUERY_NEXT_MAIL_TIME = 0xCEE6, MSG_QUEST_PUSH_RESULT = 0x1863, MSG_RAID_READY_CHECK_CONFIRM = 0x0000, MSG_RAID_READY_CHECK_FINISHED = 0x00, - MSG_RAID_TARGET_UPDATE = 0x00, + MSG_RAID_TARGET_UPDATE = 0x1E5F, MSG_RANDOM_ROLL = 0x4C57, MSG_SAVE_GUILD_EMBLEM = 0x4EE3, MSG_SET_DUNGEON_DIFFICULTY = 0x0C4F, MSG_SET_RAID_DIFFICULTY = 0x1A5A, MSG_TABARDVENDOR_ACTIVATE = 0x98EB, MSG_TALENT_WIPE_CONFIRM = 0x4C52, //duplicate of CMSG_VERIFY_CONNECTIVITY_RESPONSE - OBSOLETE_DROP_ITEM = 0x00, SMSG_ACCOUNT_DATA_TIMES = 0x5EE2, SMSG_ACHIEVEMENT_DELETED = 0x9ED2, SMSG_ACHIEVEMENT_EARNED = 0x484E, @@ -624,9 +623,9 @@ enum Opcodes SMSG_CLIENT_CONTROL_UPDATE = 0x08CB, SMSG_CLIENTCACHE_VERSION = 0x88F2, SMSG_COMBAT_LOG_MULTIPLE = 0x5C56, - SMSG_COMMENTATOR_MAP_INFO = 0x00, - SMSG_COMMENTATOR_PLAYER_INFO = 0x00, - SMSG_COMMENTATOR_STATE_CHANGED = 0x00, + SMSG_COMMENTATOR_MAP_INFO = 0x0C73, + SMSG_COMMENTATOR_PLAYER_INFO = 0x9A6E, + SMSG_COMMENTATOR_STATE_CHANGED = 0x4EEE, SMSG_COMPLAIN_RESULT = 0x8A4B, SMSG_COMPRESSED_CHAR_ENUM = 0x380A, SMSG_COMPRESSED_GUILD_ROSTER = 0x5A29, @@ -634,7 +633,7 @@ enum Opcodes SMSG_COMPRESSED_UPDATE_OBJECT = 0x1CC3, SMSG_CONTACT_LIST = 0x0A6B, SMSG_CONVERT_RUNE = 0x9EE7, - SMSG_COOLDOWN_CHEAT = 0x00, + SMSG_COOLDOWN_CHEAT = 0x9856, SMSG_COOLDOWN_EVENT = 0x00, SMSG_CORPSE_MAP_POSITION_QUERY_RESPONSE = 0x00, SMSG_CORPSE_NOT_IN_INSTANCE = 0xCACB, @@ -653,18 +652,18 @@ enum Opcodes SMSG_DESTRUCTIBLE_BUILDING_DAMAGE = 0x1C5E, SMSG_DISMOUNT = 0xCEE7, SMSG_DISMOUNTRESULT = 0x00, - SMSG_DISPEL_FAILED = 0x00, + SMSG_DISPEL_FAILED = 0x1E4A, SMSG_DUEL_COMPLETE = 0x5846, SMSG_DUEL_COUNTDOWN = 0x1A5F, SMSG_DUEL_INBOUNDS = 0x00, SMSG_DUEL_OUTOFBOUNDS = 0x00, SMSG_DUEL_REQUESTED = 0x1EC6, SMSG_DUEL_WINNER = 0xDA52, - SMSG_DURABILITY_DAMAGE_DEATH = 0xACF, + SMSG_DURABILITY_DAMAGE_DEATH = 0x0ACF, SMSG_ECHO_PARTY_SQUELCH = 0x5ED7, SMSG_EMOTE = 0x0C67, - SMSG_ENABLE_BARBER_SHOP = 0x00, - SMSG_ENCHANTMENTLOG = 0x00, + SMSG_ENABLE_BARBER_SHOP = 0x9C7A, + SMSG_ENCHANTMENTLOG = 0x48E2, SMSG_ENVIRONMENTALDAMAGELOG = 0x00, SMSG_EQUIPMENT_SET_LIST = 0x18DF, SMSG_EQUIPMENT_SET_SAVED = 0x00, @@ -793,7 +792,7 @@ enum Opcodes SMSG_LOOT_SLOT_CHANGED = 0xDCDA, SMSG_LOOT_START_ROLL = 0xC8C2, SMSG_MAIL_LIST_RESULT = 0x5CD7, - SMSG_MEETINGSTONE_COMPLETE = 0x00, + SMSG_MEETINGSTONE_COMPLETE = 0xDA43, SMSG_MEETINGSTONE_IN_PROGRESS = 0x00, SMSG_MEETINGSTONE_MEMBER_ADDED = 0x00, SMSG_MEETINGSTONE_SETQUEUE = 0x00, -- cgit v1.2.3 From 869961bd4e3818ccbab0d80f80ee3e5107750bab Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 22 Jan 2012 02:29:35 +0000 Subject: Core/Opcodes: Enable handlers for some opcodes added in previous commit --- src/server/game/Server/Protocol/Opcodes.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 1225f7b6c06..cb1c803b0dd 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -532,7 +532,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_LEVELUP_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(MSG_MINIMAP_PING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMinimapPingOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_RESISTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ENCHANTMENTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ENCHANTMENTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SET_SKILL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_START_MIRROR_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PAUSE_MIRROR_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -862,7 +862,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_RESET_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_LAST_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(MSG_RAID_TARGET_UPDATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidTargetUpdateOpcode ); + DEFINE_OPCODE_HANDLER(MSG_RAID_TARGET_UPDATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidTargetUpdateOpcode ); DEFINE_OPCODE_HANDLER(SMSG_RAID_READY_CHECK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidReadyCheckOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LUA_USAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(SMSG_PET_ACTION_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1069,7 +1069,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_UPDATE_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankUpdateTab ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_DEPOSIT_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankDepositMoney ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_WITHDRAW_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankWithdrawMoney ); - //DEFINE_OPCODE_HANDLER(MSG_GUILD_BANK_LOG_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankLogQuery ); + DEFINE_OPCODE_HANDLER(MSG_GUILD_BANK_LOG_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankLogQuery ); //DEFINE_OPCODE_HANDLER(CMSG_SET_CHANNEL_WATCH, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetChannelWatch ); //DEFINE_OPCODE_HANDLER(SMSG_USERLIST_ADD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_USERLIST_REMOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1126,7 +1126,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_SUMMON_CANCEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_CHANGE_PERSONAL_ARENA_RATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_ALTER_APPEARANCE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAlterAppearance ); - //DEFINE_OPCODE_HANDLER(SMSG_ENABLE_BARBER_SHOP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ENABLE_BARBER_SHOP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_BARBER_SHOP_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_GET_CALENDAR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGetCalendar ); //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_GET_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGetEvent ); -- cgit v1.2.3 From bbdd2ee2737b3abf8e4eef795f53c4be90b71d9b Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 22 Jan 2012 03:41:34 +0000 Subject: Update SMSG_DURABILITY_DAMAGE_DEATH to 4.x. Auras can change durability damage (Reinforce guild perk) and need to send the updated value to the client. --- src/server/game/Entities/Player/Player.cpp | 12 +++++++----- src/server/game/Entities/Player/Player.h | 4 ++-- src/server/game/Entities/Unit/Unit.cpp | 8 +++++--- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- src/server/game/Server/Protocol/Opcodes.h | 2 +- 5 files changed, 16 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index cdb9ddbcd9b..404557a4d96 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -1279,10 +1279,12 @@ uint32 Player::EnvironmentalDamage(EnviromentalDamage type, uint32 damage) { if (type == DAMAGE_FALL) // DealDamage not apply item durability loss at self damage { - sLog->outStaticDebug("We are fall to death, loosing 10 percents durability"); - DurabilityLossAll(0.10f, false); + float percent = 0.10f; + DurabilityLossAll(percent, false); + sLog->outStaticDebug("We are fall to death, loosing %f percents durability", percent); // durability lost message - WorldPacket data2(SMSG_DURABILITY_DAMAGE_DEATH, 0); + WorldPacket data2(SMSG_DURABILITY_DAMAGE_DEATH, 4); + data2 << uint32(percent*100); GetSession()->SendPacket(&data2); } @@ -5391,7 +5393,7 @@ Corpse* Player::GetCorpse() const return sObjectAccessor->GetCorpseForPlayerGUID(GetGUID()); } -void Player::DurabilityLossAll(double percent, bool inventory) +void Player::DurabilityLossAll(double &percent, bool inventory) { for (uint8 i = EQUIPMENT_SLOT_START; i < EQUIPMENT_SLOT_END; i++) if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) @@ -5417,7 +5419,7 @@ void Player::DurabilityLossAll(double percent, bool inventory) } } -void Player::DurabilityLoss(Item* item, double percent) +void Player::DurabilityLoss(Item* item, double &percent) { if (!item) return; diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index a594f2c02ef..a9ad919cd04 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1994,8 +1994,8 @@ class Player : public Unit, public GridObject void BuildPlayerRepop(); void RepopAtGraveyard(); - void DurabilityLossAll(double percent, bool inventory); - void DurabilityLoss(Item* item, double percent); + void DurabilityLossAll(double &percent, bool inventory); + void DurabilityLoss(Item* item, double &percent); void DurabilityPointsLossAll(int32 points, bool inventory); void DurabilityPointsLoss(Item* item, int32 points); void DurabilityPointLossForEquipSlot(EquipmentSlots slot); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index c25e4bf455b..6c310f594b9 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -15635,10 +15635,12 @@ void Unit::Kill(Unit* victim, bool durabilityLoss) // only if not player and not controlled by player pet. And not at BG if ((durabilityLoss && !player && !victim->ToPlayer()->InBattleground()) || (player && sWorld->getBoolConfig(CONFIG_DURABILITY_LOSS_IN_PVP))) { - sLog->outStaticDebug("We are dead, losing %f percent durability", sWorld->getRate(RATE_DURABILITY_LOSS_ON_DEATH)); - plrVictim->DurabilityLossAll(sWorld->getRate(RATE_DURABILITY_LOSS_ON_DEATH), false); + float percent = sWorld->getRate(RATE_DURABILITY_LOSS_ON_DEATH); + plrVictim->DurabilityLossAll(percent, false); + sLog->outStaticDebug("We are dead, losing %f percent durability", percent); // durability lost message - WorldPacket data(SMSG_DURABILITY_DAMAGE_DEATH, 0); + WorldPacket data(SMSG_DURABILITY_DAMAGE_DEATH, 4); + data << uint32(percent*100); plrVictim->GetSession()->SendPacket(&data); } // Call KilledUnit for creatures diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index cb1c803b0dd..bfa8372caf9 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -762,7 +762,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_SHOWING_CLOAK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleShowingCloakOpcode ); DEFINE_OPCODE_HANDLER(SMSG_LFG_ROLE_CHOSEN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAYER_SKINNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DURABILITY_DAMAGE_DEATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_DURABILITY_DAMAGE_DEATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SET_EXPLORATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIONBAR_TOGGLES, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActionBarToggles ); //DEFINE_OPCODE_HANDLER(UMSG_DELETE_GUILD_CHARTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index d9b51a92c08..037eb6af79a 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -280,7 +280,7 @@ enum Opcodes CMSG_MESSAGECHAT_PARTY_LEADER = 0x00, CMSG_MESSAGECHAT_RAID = 0x60D1, CMSG_MESSAGECHAT_RAID_LEADER = 0x00, - CMSG_MESSAGECHAT_RAID_WARNING = 0x00, + CMSG_MESSAGECHAT_RAID_WARNING = 0x2449, CMSG_MESSAGECHAT_SAY = 0x2459, CMSG_MESSAGECHAT_WHISPER = 0x70D9, CMSG_MESSAGECHAT_YELL = 0x70C1, -- cgit v1.2.3 From f714a7d6c9746846c6f31bcfa3c7d7e01b257344 Mon Sep 17 00:00:00 2001 From: Drake Fish Date: Sun, 22 Jan 2012 03:45:18 +0000 Subject: Core/Chat: Fixed whispers and emotes handling. Added missing chat CMSG. Ref #4824 --- .../game/Server/Protocol/Handlers/ChatHandler.cpp | 158 +++++++++++---------- src/server/game/Server/Protocol/Opcodes.cpp | 8 +- 2 files changed, 85 insertions(+), 81 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp b/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp index effc28c1063..9c73a7b3be7 100755 --- a/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp @@ -124,8 +124,6 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) return; } - recvData >> lang; - if (type >= MAX_CHAT_MSG_TYPE) { sLog->outError("CHAT: Wrong message type received: %u", type); @@ -137,101 +135,107 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) //sLog->outDebug("CHAT: packet received. type %u, lang %u", type, lang); - // prevent talking at unknown language (cheating) - LanguageDesc const* langDesc = GetLanguageDescByID(lang); - if (!langDesc) - { - SendNotification(LANG_UNKNOWN_LANGUAGE); - recvData.rfinish(); - return; - } - if (langDesc->skill_id != 0 && !sender->HasSkill(langDesc->skill_id)) + // no language sent with emote packet. + if (type != CHAT_MSG_EMOTE) { - // also check SPELL_AURA_COMPREHEND_LANGUAGE (client offers option to speak in that language) - Unit::AuraEffectList const& langAuras = sender->GetAuraEffectsByType(SPELL_AURA_COMPREHEND_LANGUAGE); - bool foundAura = false; - for (Unit::AuraEffectList::const_iterator i = langAuras.begin(); i != langAuras.end(); ++i) - { - if ((*i)->GetMiscValue() == int32(lang)) - { - foundAura = true; - break; - } - } - if (!foundAura) + recvData >> lang; + + // prevent talking at unknown language (cheating) + LanguageDesc const* langDesc = GetLanguageDescByID(lang); + if (!langDesc) { - SendNotification(LANG_NOT_LEARNED_LANGUAGE); + SendNotification(LANG_UNKNOWN_LANGUAGE); recvData.rfinish(); return; } - } + if (langDesc->skill_id != 0 && !sender->HasSkill(langDesc->skill_id)) + { + // also check SPELL_AURA_COMPREHEND_LANGUAGE (client offers option to speak in that language) + Unit::AuraEffectList const& langAuras = sender->GetAuraEffectsByType(SPELL_AURA_COMPREHEND_LANGUAGE); + bool foundAura = false; + for (Unit::AuraEffectList::const_iterator i = langAuras.begin(); i != langAuras.end(); ++i) + { + if ((*i)->GetMiscValue() == int32(lang)) + { + foundAura = true; + break; + } + } + if (!foundAura) + { + SendNotification(LANG_NOT_LEARNED_LANGUAGE); + recvData.rfinish(); + return; + } + } - if (lang == LANG_ADDON) - { - if (sWorld->getBoolConfig(CONFIG_CHATLOG_ADDON)) + if (lang == LANG_ADDON) { - std::string msg = ""; - recvData >> msg; + if (sWorld->getBoolConfig(CONFIG_CHATLOG_ADDON)) + { + std::string msg = ""; + recvData >> msg; - if (msg.empty()) - return; + if (msg.empty()) + return; - sScriptMgr->OnPlayerChat(sender, uint32(CHAT_MSG_ADDON), lang, msg); - } + sScriptMgr->OnPlayerChat(sender, uint32(CHAT_MSG_ADDON), lang, msg); + } - // Disabled addon channel? - if (!sWorld->getBoolConfig(CONFIG_ADDON_CHANNEL)) - return; - } - // LANG_ADDON should not be changed nor be affected by flood control - else - { - // send in universal language if player in .gmon mode (ignore spell effects) - if (sender->isGameMaster()) - lang = LANG_UNIVERSAL; + // Disabled addon channel? + if (!sWorld->getBoolConfig(CONFIG_ADDON_CHANNEL)) + return; + } + // LANG_ADDON should not be changed nor be affected by flood control else { - // send in universal language in two side iteration allowed mode - if (sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT)) + // send in universal language if player in .gmon mode (ignore spell effects) + if (sender->isGameMaster()) lang = LANG_UNIVERSAL; else { - switch (type) + // send in universal language in two side iteration allowed mode + if (sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT)) + lang = LANG_UNIVERSAL; + else { - case CHAT_MSG_PARTY: - case CHAT_MSG_PARTY_LEADER: - case CHAT_MSG_RAID: - case CHAT_MSG_RAID_LEADER: - case CHAT_MSG_RAID_WARNING: - // allow two side chat at group channel if two side group allowed - if (sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP)) - lang = LANG_UNIVERSAL; - break; - case CHAT_MSG_GUILD: - case CHAT_MSG_OFFICER: - // allow two side chat at guild channel if two side guild allowed - if (sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD)) - lang = LANG_UNIVERSAL; - break; + switch (type) + { + case CHAT_MSG_PARTY: + case CHAT_MSG_PARTY_LEADER: + case CHAT_MSG_RAID: + case CHAT_MSG_RAID_LEADER: + case CHAT_MSG_RAID_WARNING: + // allow two side chat at group channel if two side group allowed + if (sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP)) + lang = LANG_UNIVERSAL; + break; + case CHAT_MSG_GUILD: + case CHAT_MSG_OFFICER: + // allow two side chat at guild channel if two side guild allowed + if (sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD)) + lang = LANG_UNIVERSAL; + break; + } } + + // but overwrite it by SPELL_AURA_MOD_LANGUAGE auras (only single case used) + Unit::AuraEffectList const& ModLangAuras = sender->GetAuraEffectsByType(SPELL_AURA_MOD_LANGUAGE); + if (!ModLangAuras.empty()) + lang = ModLangAuras.front()->GetMiscValue(); } - // but overwrite it by SPELL_AURA_MOD_LANGUAGE auras (only single case used) - Unit::AuraEffectList const& ModLangAuras = sender->GetAuraEffectsByType(SPELL_AURA_MOD_LANGUAGE); - if (!ModLangAuras.empty()) - lang = ModLangAuras.front()->GetMiscValue(); - } + if (!sender->CanSpeak()) + { + std::string timeStr = secsToTimeString(m_muteTime - time(NULL)); + SendNotification(GetTrinityString(LANG_WAIT_BEFORE_SPEAKING), timeStr.c_str()); + recvData.rfinish(); // Prevent warnings + return; + } - if (!sender->CanSpeak()) - { - std::string timeStr = secsToTimeString(m_muteTime - time(NULL)); - SendNotification(GetTrinityString(LANG_WAIT_BEFORE_SPEAKING), timeStr.c_str()); - recvData.rfinish(); // Prevent warnings - return; + if (type != CHAT_MSG_AFK && type != CHAT_MSG_DND) + sender->UpdateSpeakTime(); } - - if (type != CHAT_MSG_AFK && type != CHAT_MSG_DND) - sender->UpdateSpeakTime(); } if (sender->HasAura(1852) && type != CHAT_MSG_WHISPER) @@ -262,8 +266,8 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) recvData >> msg; break; case CHAT_MSG_WHISPER: - recvData >> to; recvData >> msg; + recvData >> to; break; case CHAT_MSG_CHANNEL: recvData >> channel; diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index bfa8372caf9..24069406894 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -196,18 +196,18 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_RAID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_WHISPER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_AFK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_BATTLEGROUND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_BATTLEGROUND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_BATTLEGROUND_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_DND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_GUILD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_OFFICER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_OFFICER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_PARTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_PARTY_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_RAID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_RAID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_RAID_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_RAID_WARNING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_RAID_WARNING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_SAY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_WHISPER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_YELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); -- cgit v1.2.3 From dedb3726835e0c595b1d84c77f3c3a5c406d223b Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 22 Jan 2012 04:02:28 +0000 Subject: Revert "Update SMSG_DURABILITY_DAMAGE_DEATH to 4.x." This reverts commit bbdd2ee2737b3abf8e4eef795f53c4be90b71d9b. --- src/server/game/Entities/Player/Player.cpp | 12 +++++------- src/server/game/Entities/Player/Player.h | 4 ++-- src/server/game/Entities/Unit/Unit.cpp | 8 +++----- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- src/server/game/Server/Protocol/Opcodes.h | 2 +- 5 files changed, 12 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 404557a4d96..cdb9ddbcd9b 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -1279,12 +1279,10 @@ uint32 Player::EnvironmentalDamage(EnviromentalDamage type, uint32 damage) { if (type == DAMAGE_FALL) // DealDamage not apply item durability loss at self damage { - float percent = 0.10f; - DurabilityLossAll(percent, false); - sLog->outStaticDebug("We are fall to death, loosing %f percents durability", percent); + sLog->outStaticDebug("We are fall to death, loosing 10 percents durability"); + DurabilityLossAll(0.10f, false); // durability lost message - WorldPacket data2(SMSG_DURABILITY_DAMAGE_DEATH, 4); - data2 << uint32(percent*100); + WorldPacket data2(SMSG_DURABILITY_DAMAGE_DEATH, 0); GetSession()->SendPacket(&data2); } @@ -5393,7 +5391,7 @@ Corpse* Player::GetCorpse() const return sObjectAccessor->GetCorpseForPlayerGUID(GetGUID()); } -void Player::DurabilityLossAll(double &percent, bool inventory) +void Player::DurabilityLossAll(double percent, bool inventory) { for (uint8 i = EQUIPMENT_SLOT_START; i < EQUIPMENT_SLOT_END; i++) if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) @@ -5419,7 +5417,7 @@ void Player::DurabilityLossAll(double &percent, bool inventory) } } -void Player::DurabilityLoss(Item* item, double &percent) +void Player::DurabilityLoss(Item* item, double percent) { if (!item) return; diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index a9ad919cd04..a594f2c02ef 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1994,8 +1994,8 @@ class Player : public Unit, public GridObject void BuildPlayerRepop(); void RepopAtGraveyard(); - void DurabilityLossAll(double &percent, bool inventory); - void DurabilityLoss(Item* item, double &percent); + void DurabilityLossAll(double percent, bool inventory); + void DurabilityLoss(Item* item, double percent); void DurabilityPointsLossAll(int32 points, bool inventory); void DurabilityPointsLoss(Item* item, int32 points); void DurabilityPointLossForEquipSlot(EquipmentSlots slot); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 6c310f594b9..c25e4bf455b 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -15635,12 +15635,10 @@ void Unit::Kill(Unit* victim, bool durabilityLoss) // only if not player and not controlled by player pet. And not at BG if ((durabilityLoss && !player && !victim->ToPlayer()->InBattleground()) || (player && sWorld->getBoolConfig(CONFIG_DURABILITY_LOSS_IN_PVP))) { - float percent = sWorld->getRate(RATE_DURABILITY_LOSS_ON_DEATH); - plrVictim->DurabilityLossAll(percent, false); - sLog->outStaticDebug("We are dead, losing %f percent durability", percent); + sLog->outStaticDebug("We are dead, losing %f percent durability", sWorld->getRate(RATE_DURABILITY_LOSS_ON_DEATH)); + plrVictim->DurabilityLossAll(sWorld->getRate(RATE_DURABILITY_LOSS_ON_DEATH), false); // durability lost message - WorldPacket data(SMSG_DURABILITY_DAMAGE_DEATH, 4); - data << uint32(percent*100); + WorldPacket data(SMSG_DURABILITY_DAMAGE_DEATH, 0); plrVictim->GetSession()->SendPacket(&data); } // Call KilledUnit for creatures diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 24069406894..4170a9b623b 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -762,7 +762,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_SHOWING_CLOAK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleShowingCloakOpcode ); DEFINE_OPCODE_HANDLER(SMSG_LFG_ROLE_CHOSEN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAYER_SKINNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_DURABILITY_DAMAGE_DEATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DURABILITY_DAMAGE_DEATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SET_EXPLORATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIONBAR_TOGGLES, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActionBarToggles ); //DEFINE_OPCODE_HANDLER(UMSG_DELETE_GUILD_CHARTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 037eb6af79a..d9b51a92c08 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -280,7 +280,7 @@ enum Opcodes CMSG_MESSAGECHAT_PARTY_LEADER = 0x00, CMSG_MESSAGECHAT_RAID = 0x60D1, CMSG_MESSAGECHAT_RAID_LEADER = 0x00, - CMSG_MESSAGECHAT_RAID_WARNING = 0x2449, + CMSG_MESSAGECHAT_RAID_WARNING = 0x00, CMSG_MESSAGECHAT_SAY = 0x2459, CMSG_MESSAGECHAT_WHISPER = 0x70D9, CMSG_MESSAGECHAT_YELL = 0x70C1, -- cgit v1.2.3 From 5cbe4abae3cc7aa5019ebfcfb2682a1c8ea439bf Mon Sep 17 00:00:00 2001 From: Drake Fish Date: Sun, 22 Jan 2012 04:32:15 +0000 Subject: Core/Opcodes: Few more opcodes, enable handlers; Send spell id in SMSG_RESURRECT_REQUEST Ref #4824 --- src/server/game/Server/Protocol/Opcodes.cpp | 20 ++++++++++---------- src/server/game/Server/Protocol/Opcodes.h | 12 ++++++------ src/server/game/Spells/Spell.cpp | 6 +++--- 3 files changed, 19 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 4170a9b623b..1886b993228 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -173,8 +173,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_GUILD_CREATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildCreateOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildInviteOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildAcceptOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDeclineOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildAcceptOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDeclineOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_DECLINE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildInfoOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -184,7 +184,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_GUILD_DEMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDemoteOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildLeaveOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_REMOVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildRemoveOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_DISBAND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDisbandOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_DISBAND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDisbandOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildLeaderOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_MOTD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildMOTDOpcode ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -240,7 +240,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_ITEM_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJ_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGameObjectUseOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_DESTROY_ITEMS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_CUSTOM_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_CUSTOM_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_AREATRIGGER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaTriggerOpcode ); DEFINE_OPCODE_HANDLER(MSG_MOVE_START_FORWARD, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); DEFINE_OPCODE_HANDLER(MSG_MOVE_START_BACKWARD, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); @@ -402,14 +402,14 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_BREAK_TARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SAVE_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SETDEATHBINDPOINT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_BINDPOINTUPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BINDPOINTUPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GETDEATHBINDZONE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_BINDZONEREPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAYERBOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CLIENT_CONTROL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_REPOP_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepopRequestOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_RESURRECT_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_RESURRECT_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleResurrectResponseOpcode ); + DEFINE_OPCODE_HANDLER(SMSG_RESURRECT_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(CMSG_RESURRECT_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleResurrectResponseOpcode ); DEFINE_OPCODE_HANDLER(CMSG_LOOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootOpcode ); DEFINE_OPCODE_HANDLER(CMSG_LOOT_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMoneyOpcode ); DEFINE_OPCODE_HANDLER(CMSG_LOOT_RELEASE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootReleaseOpcode ); @@ -540,7 +540,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_PING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); DEFINE_OPCODE_HANDLER(SMSG_PONG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_PAGETEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_PAGETEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_SETSHEATHED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleSetSheathedOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_COOLDOWN_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPELL_DELAYED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -607,7 +607,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_SKILL_BUY_STEP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SKILL_BUY_RANK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_XP_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_SPIRIT_HEALER_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPIRIT_HEALER_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_CHARACTER_POINT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(SMSG_GOSSIP_POI, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_CHAT_IGNORED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChatIgnoredOpcode ); @@ -951,7 +951,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_CANCEL_MOUNT_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelMountAuraOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_ARENA_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(MSG_INSPECT_ARENA_TEAMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectArenaTeamsOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_DEATH_RELEASE_LOC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_DEATH_RELEASE_LOC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_CANCEL_TEMP_ENCHANTMENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelTempEnchantmentOpcode); //DEFINE_OPCODE_HANDLER(SMSG_FORCED_DEATH_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_SET_HONOR_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index d9b51a92c08..09db6f0c7db 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -280,7 +280,7 @@ enum Opcodes CMSG_MESSAGECHAT_PARTY_LEADER = 0x00, CMSG_MESSAGECHAT_RAID = 0x60D1, CMSG_MESSAGECHAT_RAID_LEADER = 0x00, - CMSG_MESSAGECHAT_RAID_WARNING = 0x00, + CMSG_MESSAGECHAT_RAID_WARNING = 0x2449, CMSG_MESSAGECHAT_SAY = 0x2459, CMSG_MESSAGECHAT_WHISPER = 0x70D9, CMSG_MESSAGECHAT_YELL = 0x70C1, @@ -961,12 +961,12 @@ enum Opcodes SMSG_REDIRECT_CLIENT = 0x0180, SMSG_REFER_A_FRIEND_FAILURE = 0x4867, SMSG_REMOVED_SPELL = 0x98FE, - SMSG_REPORT_PVP_AFK_RESULT = 0xE56, + SMSG_REPORT_PVP_AFK_RESULT = 0x0E56, SMSG_REQUEST_CEMETERY_LIST_RESPONSE = 0x00, SMSG_RESET_FAILED_NOTIFY = 0x00, SMSG_RESISTLOG = 0x00, SMSG_RESPOND_INSPECT_ACHIEVEMENTS = 0x00, - SMSG_RESURRECT_REQUEST = 0xAFE, + SMSG_RESURRECT_REQUEST = 0x0AFE, SMSG_RESYNC_RUNES = 0x00, SMSG_RWHOIS = 0xCCE2, SMSG_SELL_ITEM = 0x9CD3, @@ -986,7 +986,7 @@ enum Opcodes SMSG_SET_PLAYER_DECLINED_NAMES_RESULT = 0x0E67, SMSG_SET_PROFICIENCY = 0x9C5F, SMSG_SET_PROJECTILE_POSITION = 0xC8F7, - SMSG_SHOW_BANK = 0xCCA, + SMSG_SHOW_BANK = 0x0CCA, SMSG_SHOWTAXINODES = 0x0000, SMSG_SPELL_COOLDOWN = 0x88D6, SMSG_SPELL_DELAYED = 0x1AD3, @@ -1006,8 +1006,8 @@ enum Opcodes SMSG_SPELLNONMELEEDAMAGELOG = 0x5CCF, SMSG_SPELLORDAMAGE_IMMUNE = 0x48FA, SMSG_SPELLSTEALLOG = 0x00, - SMSG_SPIRIT_HEALER_CONFIRM = 0xA4A, - SMSG_STABLE_RESULT = 0xA5B, + SMSG_SPIRIT_HEALER_CONFIRM = 0x0A4A, + SMSG_STABLE_RESULT = 0x0A5B, SMSG_STANDSTATE_UPDATE = 0x4E52, SMSG_START_MIRROR_TIMER = 0x00, SMSG_STOP_DANCE = 0x8E5F, diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 77b014eb67b..e8872deb152 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -4146,12 +4146,12 @@ void Spell::SendResurrectRequest(Player* target) data << uint32(strlen(resurrectorName) + 1); data << resurrectorName; - data << uint8(0); // null terminator + data << uint8(0); // use timer according to client symbols data << uint8(m_caster->GetTypeId() == TYPEID_PLAYER ? 0 : 1); // "you'll be afflicted with resurrection sickness" // override delay sent with SMSG_CORPSE_RECLAIM_DELAY, set instant resurrection for spells with this attribute - if (m_spellInfo->AttributesEx3 & SPELL_ATTR3_IGNORE_RESURRECTION_TIMER) - data << uint32(0); + // 4.2.2 edit : id of the spell used to resurect. (used client-side for Mass Resurect) + data << uint32(m_spellInfo->Id); target->GetSession()->SendPacket(&data); } -- cgit v1.2.3 From d052d4f5511f4430937ea85bb30edef737e3641f Mon Sep 17 00:00:00 2001 From: Drake Fish Date: Sun, 22 Jan 2012 05:28:08 +0000 Subject: 4.2.2 More opcodes, enable handlers and update structure for SMSG_INSTANCE_LOCK_WARNING_QUERY and SMSG_COMPLAIN_RESULT Ref #4824 --- src/server/game/Maps/Map.cpp | 3 ++- src/server/game/Server/Protocol/Handlers/MiscHandler.cpp | 5 +++-- src/server/game/Server/Protocol/Opcodes.cpp | 16 ++++++++-------- src/server/game/Server/Protocol/Opcodes.h | 4 ++++ 4 files changed, 17 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 3807873e82d..bbe349d76df 100755 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -2303,10 +2303,11 @@ bool InstanceMap::AddPlayerToMap(Player* player) // players also become permanently bound when they enter if (groupBind->perm) { - WorldPacket data(SMSG_INSTANCE_LOCK_WARNING_QUERY, 9); + WorldPacket data(SMSG_INSTANCE_LOCK_WARNING_QUERY, 10); data << uint32(60000); data << uint32(i_data ? i_data->GetCompletedEncounterMask() : 0); data << uint8(0); + data << uint8(0); // events it throws: 1 : INSTANCE_LOCK_WARNING 0 : INSTANCE_LOCK_STOP / INSTANCE_LOCK_START player->GetSession()->SendPacket(&data); player->SetPendingBind(mapSave->GetInstanceId(), 60000); } diff --git a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp b/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp index fac568b9857..5dff3ba8e36 100755 --- a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp @@ -1387,8 +1387,9 @@ void WorldSession::HandleComplainOpcode(WorldPacket & recv_data) // if it's mail spam - ALL mails from this spammer automatically removed by client // Complaint Received message - WorldPacket data(SMSG_COMPLAIN_RESULT, 1); - data << uint8(0); + WorldPacket data(SMSG_COMPLAIN_RESULT, 2); + data << uint8(0); // value 1 resets CGChat::m_complaintsSystemStatus in client. (unused?) + data << uint8(0); // value 0xC generates a "CalendarError" in client. SendPacket(&data); sLog->outDebug(LOG_FILTER_NETWORKIO, "REPORT SPAM: type %u, guid %u, unk1 %u, unk2 %u, unk3 %u, unk4 %u, message %s", spam_type, GUID_LOPART(spammer_guid), unk1, unk2, unk3, unk4, description.c_str()); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 1886b993228..8f5194bfb7d 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -315,9 +315,9 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_NEXT_CINEMATIC_CAMERA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNextCinematicCamera ); DEFINE_OPCODE_HANDLER(CMSG_COMPLETE_CINEMATIC, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCompleteCinematic ); DEFINE_OPCODE_HANDLER(SMSG_TUTORIAL_FLAGS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_FLAG, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialFlag ); - //DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_CLEAR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialClear ); - //DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_RESET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialReset ); + DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_FLAG, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialFlag ); + DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_CLEAR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialClear ); + DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_RESET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialReset ); DEFINE_OPCODE_HANDLER(CMSG_STANDSTATECHANGE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStandStateChangeOpcode ); DEFINE_OPCODE_HANDLER(CMSG_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEmoteOpcode ); DEFINE_OPCODE_HANDLER(SMSG_EMOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -335,7 +335,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_AUTOEQUIP_ITEM_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoEquipItemSlotOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_UNCLAIM_LICENSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_DESTROYITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDestroyItemOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_INVENTORY_CHANGE_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_INVENTORY_CHANGE_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_OPEN_CONTAINER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_INSPECT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_INSPECT_RESULTS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -706,7 +706,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_AUTOBANK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoBankItemOpcode ); DEFINE_OPCODE_HANDLER(MSG_QUERY_NEXT_MAIL_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryNextMailTime ); DEFINE_OPCODE_HANDLER(SMSG_RECEIVED_MAIL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RAID_GROUP_ONLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_RAID_GROUP_ONLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SET_DURABILITY_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_PVP_RANK_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_ADD_PVP_MEDAL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -1031,7 +1031,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_KICK_REASON, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(MSG_RAID_READY_CHECK_FINISHED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidReadyCheckFinishedOpcode); //DEFINE_OPCODE_HANDLER(CMSG_COMPLAIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleComplainOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_COMPLAIN_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_COMPLAIN_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_FEATURE_SYSTEM_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GM_SHOW_COMPLAINTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GM_UNSQUELCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -1060,7 +1060,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_COMSAT_CONNECT_FAIL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_VOICE_CHAT_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_REPORT_PVP_AFK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReportPvPAFK ); - //DEFINE_OPCODE_HANDLER(SMSG_REPORT_PVP_AFK_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(SMSG_REPORT_PVP_AFK_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANKER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankerActivate ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_QUERY_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankQueryTab ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1354,7 +1354,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_GM_NUKE_CHARACTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_ALLOW_LOW_LEVEL_RAID1, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_ALLOW_LOW_LEVEL_RAID2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_CAMERA_SHAKE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CAMERA_SHAKE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ITEM_ENCHANTMENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SET_CHARACTER_MODEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_REDIRECT_CLIENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 09db6f0c7db..5efde346bc4 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -600,6 +600,7 @@ enum Opcodes SMSG_CALENDAR_COMMAND_RESULT = 0x9A4E, SMSG_CALENDAR_SEND_CALENDAR = 0x08FB, SMSG_CALENDAR_SEND_NUM_PENDING = 0x00, + SMSG_CAMERA_SHAKE = 0x5CFB, SMSG_CANCEL_AUTO_REPEAT = 0x5ACB, SMSG_CANCEL_COMBAT = 0x00, SMSG_CAST_FAILED = 0x1AEB, @@ -917,6 +918,7 @@ enum Opcodes SMSG_PLAYER_MOVE = 0xF66C, SMSG_PLAYER_SKINNED = 0xDA63, SMSG_PLAYER_VEHICLE_DATA = 0x186E, + SMSG_PLAYER_UNK_DEAD_ALIVE = 0x0AF3, // causes client to Signal either PLAYER_ALIVE or DEAD events. SMSG_PLAYERBINDERROR = 0x5A4F, SMSG_PLAYERBOUND = 0xCC46, SMSG_PONG = 0x0380, @@ -1012,8 +1014,10 @@ enum Opcodes SMSG_START_MIRROR_TIMER = 0x00, SMSG_STOP_DANCE = 0x8E5F, SMSG_STOP_MIRROR_TIMER = 0x00, + SMSG_SUMMON_CANCEL = 0x8A4E, SMSG_SUMMON_REQUEST = 0x9A52, SMSG_SUPERCEDED_SPELL = 0xDE53, + SMSG_TALENTS_ERROR = 0x8AE2, // int32 : 1: ERR_TALENT_FAILED_UNKNOWN 2: ERR_TALENT_FAILED_NOT_ENOUGH_TALENTS_IN_PRIMARY_TREE 3: ERR_TALENT_FAILED_NO_PRIMARY_TREE_SELECTED SMSG_TALENTS_INFO = 0x5EC6, SMSG_TALENTS_INVOLUNTARILY_RESET = 0x1C7B, SMSG_TAXINODE_STATUS = 0x8CFB, -- cgit v1.2.3 From 9958f34114181bda8e9581d872bdf976f6da5b18 Mon Sep 17 00:00:00 2001 From: Drake Fish Date: Sun, 22 Jan 2012 05:39:54 +0000 Subject: Core/Groups: Fix structure of CMSG_GROUP_INVITE and SMSG_PARTY_COMMAND_RESULT Closes #4824 --- .../game/Server/Protocol/Handlers/GroupHandler.cpp | 29 +++++++++++++++++++++- src/server/game/Server/Protocol/Opcodes.cpp | 4 +-- 2 files changed, 30 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Handlers/GroupHandler.cpp b/src/server/game/Server/Protocol/Handlers/GroupHandler.cpp index 27ab91e4941..7d99213acf0 100755 --- a/src/server/game/Server/Protocol/Handlers/GroupHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/GroupHandler.cpp @@ -49,11 +49,12 @@ class Aura; void WorldSession::SendPartyResult(PartyOperation operation, const std::string& member, PartyResult res, uint32 val /* = 0 */) { - WorldPacket data(SMSG_PARTY_COMMAND_RESULT, 4 + member.size() + 1 + 4 + 4); + WorldPacket data(SMSG_PARTY_COMMAND_RESULT, 4 + member.size() + 1 + 4 + 4 + 8); data << uint32(operation); data << member; data << uint32(res); data << uint32(val); // LFD cooldown related (used with ERR_PARTY_LFG_BOOT_COOLDOWN_S and ERR_PARTY_LFG_BOOT_NOT_ELIGIBLE_S) + data << uint64(0); // player who caused error (in some cases). SendPacket(&data); } @@ -61,11 +62,37 @@ void WorldSession::SendPartyResult(PartyOperation operation, const std::string& void WorldSession::HandleGroupInviteOpcode(WorldPacket & recv_data) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_INVITE"); + + BytesGuid guid; + guid.guid = 0; + + recv_data.ReadByteMask(guid.bytes[6]); + recv_data.ReadByteMask(guid.bytes[5]); + recv_data.ReadByteMask(guid.bytes[0]); + recv_data.ReadByteMask(guid.bytes[3]); + recv_data.ReadByteMask(guid.bytes[4]); + recv_data.ReadByteMask(guid.bytes[7]); + recv_data.ReadByteMask(guid.bytes[1]); + recv_data.ReadByteMask(guid.bytes[2]); + + recv_data.read_skip(); + recv_data.read_skip(); std::string membername; recv_data >> membername; recv_data.read_skip(); + recv_data.ReadByteSeq(guid.bytes[0]); + recv_data.ReadByteSeq(guid.bytes[7]); + recv_data.ReadByteSeq(guid.bytes[4]); + recv_data.ReadByteSeq(guid.bytes[1]); + recv_data.ReadByteSeq(guid.bytes[2]); + recv_data.ReadByteSeq(guid.bytes[6]); + recv_data.ReadByteSeq(guid.bytes[5]); + std::string string0; + recv_data >> string0; + recv_data.ReadByteSeq(guid.bytes[3]); + // attempt add selected player // cheating diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 8f5194bfb7d..eebdefe7359 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -151,7 +151,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_SET_CONTACT_NOTES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetContactNotesOpcode ); DEFINE_OPCODE_HANDLER(CMSG_ADD_IGNORE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddIgnoreOpcode ); DEFINE_OPCODE_HANDLER(CMSG_DEL_IGNORE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDelIgnoreOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GROUP_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupInviteOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GROUP_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupInviteOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_GROUP_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_CANCEL, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_GROUP_CANCEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -168,7 +168,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_GROUP_DESTROYED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GROUP_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PARTY_MEMBER_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PARTY_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PARTY_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(UMSG_UPDATE_GROUP_MEMBERS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_CREATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildCreateOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildInviteOpcode ); -- cgit v1.2.3 From 1f2bfbdb815354710bc5d3fb7c986f2247b51d03 Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 22 Jan 2012 18:54:36 +0000 Subject: Core/Opcodes: Add some opcodes from WPP --- src/server/game/Server/Protocol/Opcodes.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 5efde346bc4..db2825038dc 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -71,7 +71,7 @@ enum Opcodes CMSG_AUTOSTORE_GROUND_ITEM = 0x00, CMSG_AUTOSTORE_LOOT_ITEM = 0xD876, CMSG_BANKER_ACTIVATE = 0x0A5A, - CMSG_BATTLEFIELD_JOIN = 0x225, + CMSG_BATTLEFIELD_JOIN = 0x0225, CMSG_BATTLEFIELD_LIST = 0x32A4, CMSG_BATTLEFIELD_REQUEST_SCORE_DATA = 0x85A5, CMSG_BATTLEFIELD_STATUS = 0x00, @@ -197,7 +197,7 @@ enum Opcodes CMSG_GROUP_SWAP_SUB_GROUP = 0x5AD7, CMSG_GROUP_UNINVITE = 0x00, CMSG_GROUP_UNINVITE_GUID = 0xCE66, - CMSG_GUILD_ACCEPT = 0x00, + CMSG_GUILD_ACCEPT = 0x8889, CMSG_GUILD_BANK_BUY_TAB = 0x00, CMSG_GUILD_BANK_DEPOSIT_MONEY = 0x4847, CMSG_GUILD_BANK_NOTE = 0x00, @@ -207,9 +207,9 @@ enum Opcodes CMSG_GUILD_BANK_WITHDRAW_MONEY = 0x00, CMSG_GUILD_BANKER_ACTIVATE = 0x4E77, CMSG_GUILD_CREATE = 0x00, - CMSG_GUILD_DECLINE = 0x00, + CMSG_GUILD_DECLINE = 0x8D5A, CMSG_GUILD_DEMOTE = 0x00, - CMSG_GUILD_DISBAND = 0x00, + CMSG_GUILD_DISBAND = 0x8958, CMSG_GUILD_INFO = 0xCE76, CMSG_GUILD_INVITE = 0x8C67, CMSG_GUILD_LEADER = 0x28C4, @@ -385,7 +385,7 @@ enum Opcodes CMSG_REQUEST_VEHICLE_PREV_SEAT = 0x1AE2, CMSG_REQUEST_VEHICLE_SWITCH_SEAT = 0x9A46, CMSG_RESET_INSTANCES = 0x9EEA, - CMSG_RESURRECT_RESPONSE = 0x00, + CMSG_RESURRECT_RESPONSE = 0xDE46, CMSG_RETURN_TO_GRAVEYARD = 0x91A4, CMSG_SAVE_PLAYER = 0x00, CMSG_SEARCH_LFG_JOIN = 0x00, @@ -411,7 +411,7 @@ enum Opcodes CMSG_SET_SKILL_CHEAT = 0x00, CMSG_SET_TAXI_BENCHMARK_MODE = 0x1EFF, CMSG_SET_TITLE = 0xCE63, - CMSG_SET_TRADE_GOLD = 0x00, + CMSG_SET_TRADE_GOLD = 0x27A4, CMSG_SET_TRADE_ITEM = 0x00, CMSG_SETDEATHBINDPOINT = 0x00, CMSG_SETSHEATHED = 0xCA5F, @@ -521,7 +521,7 @@ enum Opcodes MSG_QUERY_GUILD_BANK_TEXT = 0x8CCF, MSG_QUERY_NEXT_MAIL_TIME = 0xCEE6, MSG_QUEST_PUSH_RESULT = 0x1863, - MSG_RAID_READY_CHECK_CONFIRM = 0x0000, + MSG_RAID_READY_CHECK_CONFIRM = 0x584E, MSG_RAID_READY_CHECK_FINISHED = 0x00, MSG_RAID_TARGET_UPDATE = 0x1E5F, MSG_RANDOM_ROLL = 0x4C57, @@ -680,7 +680,7 @@ enum Opcodes SMSG_FORCEACTIONSHOW = 0x00, SMSG_FORCED_DEATH_UPDATE = 0x00, SMSG_FRIEND_STATUS = 0xD852, - SMSG_GAMEOBJECT_CUSTOM_ANIM = 0xCCE, + SMSG_GAMEOBJECT_CUSTOM_ANIM = 0x0CCE, SMSG_GAMEOBJECT_DESPAWN_ANIM = 0x0A5E, SMSG_GAMEOBJECT_PAGETEXT = 0xD8DE, SMSG_GAMEOBJECT_QUERY_RESPONSE = 0xCCF7, @@ -759,7 +759,7 @@ enum Opcodes SMSG_LFG_DISABLED = 0xCAEA, SMSG_LFG_JOIN_RESULT = 0xCCCB, SMSG_LFG_OFFER_CONTINUE = 0x8E7E, - SMSG_LFG_OPEN_FROM_GOSSIP = 0xC5E, + SMSG_LFG_OPEN_FROM_GOSSIP = 0x0C5E, SMSG_LFG_PARTY_INFO = 0x5E47, SMSG_LFG_PLAYER_INFO = 0xC85F, SMSG_LFG_PLAYER_REWARD = 0x00, @@ -899,7 +899,7 @@ enum Opcodes SMSG_PET_NAME_QUERY_RESPONSE = 0xDCD3, SMSG_PET_REMOVED_SPELL = 0x18F6, SMSG_PET_SPELLS = 0x5A43, - SMSG_PET_TAME_FAILURE = 0x00, + SMSG_PET_TAME_FAILURE = 0x48F7, SMSG_PET_UPDATE_COMBO_POINTS = 0x1A47, SMSG_PETGODMODE = 0x00, SMSG_PETITION_QUERY_RESPONSE = 0xCAEE, -- cgit v1.2.3 From 76b4b3f177aa5170c3aeafe6c6ca4d462c1cffbf Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 22 Jan 2012 22:41:17 +0000 Subject: Core/Opcodes: More opcs from WPP --- src/server/game/Server/Protocol/Opcodes.h | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index db2825038dc..d226e6bdf47 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -91,6 +91,7 @@ enum Opcodes CMSG_CALENDAR_EVENT_INVITE = 0x1EDA, CMSG_CALENDAR_EVENT_MODERATOR_STATUS = 0xCCFA, CMSG_CALENDAR_EVENT_REMOVE_INVITE = 0xCCD2, + CMSG_CALENDAR_EVENT_RSVP = 0x1EDA, CMSG_CALENDAR_EVENT_STATUS = 0x4E67, CMSG_CALENDAR_GET_EVENT = 0x00, CMSG_CALENDAR_GET_NUM_PENDING = 0x00, @@ -349,6 +350,7 @@ enum Opcodes CMSG_QUERY_QUESTS_COMPLETED = 0x98DF, CMSG_QUERY_TIME = 0x18FE, CMSG_QUEST_CONFIRM_ACCEPT = 0x8CD3, + CMSG_QUEST_NPC_QUERY = 0x9ED6, CMSG_QUEST_POI_QUERY = 0x12A5, CMSG_QUEST_QUERY = 0xCE7F, CMSG_QUESTGIVER_ACCEPT_QUEST = 0x0C63, @@ -426,6 +428,7 @@ enum Opcodes CMSG_STOP_DANCE = 0x00, CMSG_STORE_LOOT_IN_SLOT = 0x00, CMSG_SUMMON_RESPONSE = 0xD84E, + CMSG_SUSPEND_TOKEN = 0x1009, CMSG_SWAP_INV_ITEM = 0x5CE7, CMSG_SWAP_ITEM = 0xDED6, CMSG_TAXICLEARALLNODES = 0x00, @@ -583,7 +586,7 @@ enum Opcodes SMSG_BATTLEFIELD_PORT_DENIED = 0x00, SMSG_BATTLEFIELD_STATUS = 0x00, SMSG_BATTLEFIELD_STATUS1 = 0x70EE, - SMSG_BATTLEFIELD_STATUS2 = 0x0000, + SMSG_BATTLEFIELD_STATUS2 = 0x20DC, SMSG_BATTLEFIELD_STATUS3 = 0x36DE, SMSG_BATTLEFIELD_STATUS4 = 0x626E, SMSG_BATTLEGROUND_INFO_THROTTLED = 0x00, @@ -619,7 +622,7 @@ enum Opcodes SMSG_CHAT_RESTRICTED = 0x4863, SMSG_CHAT_WRONG_FACTION = 0xE66, SMSG_CHECK_FOR_BOTS = 0x00, - SMSG_CLEAR_COOLDOWN = 0x00, + SMSG_CLEAR_COOLDOWN = 0x986F, SMSG_CLEAR_TARGET = 0x00, SMSG_CLIENT_CONTROL_UPDATE = 0x08CB, SMSG_CLIENTCACHE_VERSION = 0x88F2, @@ -635,7 +638,7 @@ enum Opcodes SMSG_CONTACT_LIST = 0x0A6B, SMSG_CONVERT_RUNE = 0x9EE7, SMSG_COOLDOWN_CHEAT = 0x9856, - SMSG_COOLDOWN_EVENT = 0x00, + SMSG_COOLDOWN_EVENT = 0x185F, SMSG_CORPSE_MAP_POSITION_QUERY_RESPONSE = 0x00, SMSG_CORPSE_NOT_IN_INSTANCE = 0xCACB, SMSG_CORPSE_RECLAIM_DELAY = 0xCD46, @@ -709,6 +712,7 @@ enum Opcodes SMSG_GROUP_SET_LEADER = 0xCCF2, SMSG_GROUP_UNINVITE = 0x00, SMSG_GUILD_BANK_LIST = 0x5EFB, + SMSG_GUILD_CANCEL = 0x08C3, SMSG_GUILD_COMMAND_RESULT = 0xDAD7, SMSG_GUILD_DECLINE = 0x1E5B, SMSG_GUILD_EVENT = 0x8AC2, @@ -748,10 +752,11 @@ enum Opcodes SMSG_ITEM_NAME_QUERY_RESPONSE = 0x00, SMSG_ITEM_PUSH_RESULT = 0x8EFB, SMSG_ITEM_REFUND_INFO_RESPONSE = 0x304E, - SMSG_ITEM_REFUND_RESULT = 0x0000, + SMSG_ITEM_REFUND_RESULT = 0x60DC, SMSG_ITEM_TEXT_QUERY_RESPONSE = 0x984A, SMSG_ITEM_TIME_UPDATE = 0x8AEB, SMSG_JOINED_BATTLEGROUND_QUEUE = 0x00, + SMSG_KICK_REASON = 0x8A67, SMSG_LEARNED_DANCE_MOVES = 0xE52, SMSG_LEARNED_SPELL = 0x88D3, SMSG_LEVELUP_INFO = 0x9A73, @@ -799,7 +804,7 @@ enum Opcodes SMSG_MEETINGSTONE_SETQUEUE = 0x00, SMSG_MESSAGECHAT = 0x5E52, SMSG_MIRRORIMAGE_DATA = 0x8AFB, - SMSG_MODIFY_COOLDOWN = 0x00, + SMSG_MODIFY_COOLDOWN = 0xD8DF, SMSG_MONSTER_MOVE = 0x4C53, SMSG_MONSTER_MOVE_TRANSPORT = 0x88FB, SMSG_MOTD = 0xCA4B, @@ -932,6 +937,7 @@ enum Opcodes SMSG_QUERY_TIME_RESPONSE = 0xD85A, SMSG_QUEST_CONFIRM_ACCEPT = 0x184B, SMSG_QUEST_FORCE_REMOVED = 0x00, + SMSG_QUEST_NPC_QUERY_RESPONSE = 0xF67C, SMSG_QUEST_POI_QUERY_RESPONSE = 0x8CC3, SMSG_QUEST_QUERY_RESPONSE = 0x9E56, SMSG_QUESTGIVER_OFFER_REWARD = 0x00, @@ -1017,6 +1023,7 @@ enum Opcodes SMSG_SUMMON_CANCEL = 0x8A4E, SMSG_SUMMON_REQUEST = 0x9A52, SMSG_SUPERCEDED_SPELL = 0xDE53, + SMSG_SUSPEND_TOKEN_RESPONSE = 0xE2EE, SMSG_TALENTS_ERROR = 0x8AE2, // int32 : 1: ERR_TALENT_FAILED_UNKNOWN 2: ERR_TALENT_FAILED_NOT_ENOUGH_TALENTS_IN_PRIMARY_TREE 3: ERR_TALENT_FAILED_NO_PRIMARY_TREE_SELECTED SMSG_TALENTS_INFO = 0x5EC6, SMSG_TALENTS_INVOLUNTARILY_RESET = 0x1C7B, @@ -1048,6 +1055,7 @@ enum Opcodes SMSG_UPDATE_CURRENCY_WEEK_LIMIT = 0x00, SMSG_UPDATE_INSTANCE_ENCOUNTER_UNIT = 0x00, SMSG_UPDATE_INSTANCE_OWNERSHIP = 0xCA73, + SMSG_UPDATE_ITEM_ENCHANTMENTS = 0xCA43, SMSG_UPDATE_LAST_INSTANCE = 0x58FE, SMSG_UPDATE_OBJECT = 0x1EE7, SMSG_UPDATE_WORLD_STATE = 0x08E2, -- cgit v1.2.3 From 2940c169e0ee7f50d74ac0d5172d7fd76afb5673 Mon Sep 17 00:00:00 2001 From: Drake Fish Date: Sun, 22 Jan 2012 20:47:13 -0500 Subject: Fixed Channel message handler. Enabled and checked some channel CMSG handlers. --- src/server/game/Server/Protocol/Handlers/ChatHandler.cpp | 2 +- src/server/game/Server/Protocol/Opcodes.cpp | 8 ++++---- src/server/game/Server/Protocol/Opcodes.h | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp b/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp index 9c73a7b3be7..3a47f214099 100755 --- a/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp @@ -270,8 +270,8 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) recvData >> to; break; case CHAT_MSG_CHANNEL: - recvData >> channel; recvData >> msg; + recvData >> channel; break; case CHAT_MSG_AFK: case CHAT_MSG_DND: diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index eebdefe7359..67d12b59ecd 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -213,11 +213,11 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_YELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); DEFINE_OPCODE_HANDLER(SMSG_MESSAGECHAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_JOIN_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleJoinChannel ); - //DEFINE_OPCODE_HANDLER(CMSG_LEAVE_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLeaveChannel ); + DEFINE_OPCODE_HANDLER(CMSG_LEAVE_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLeaveChannel ); DEFINE_OPCODE_HANDLER(SMSG_CHANNEL_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelList ); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelList ); DEFINE_OPCODE_HANDLER(SMSG_CHANNEL_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_PASSWORD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelPassword ); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_PASSWORD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelPassword ); DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_SET_OWNER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelSetOwner ); //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_OWNER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelOwner ); DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_MODERATOR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelModerator ); @@ -1070,7 +1070,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_DEPOSIT_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankDepositMoney ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_WITHDRAW_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankWithdrawMoney ); DEFINE_OPCODE_HANDLER(MSG_GUILD_BANK_LOG_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankLogQuery ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_CHANNEL_WATCH, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetChannelWatch ); + DEFINE_OPCODE_HANDLER(CMSG_SET_CHANNEL_WATCH, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetChannelWatch ); //DEFINE_OPCODE_HANDLER(SMSG_USERLIST_ADD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_USERLIST_REMOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_USERLIST_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index d226e6bdf47..6e6b9cb8c99 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -113,11 +113,11 @@ enum Opcodes CMSG_CHANNEL_DISPLAY_LIST = 0x00, CMSG_CHANNEL_INVITE = 0x7451, CMSG_CHANNEL_KICK = 0x3049, - CMSG_CHANNEL_LIST = 0x00, + CMSG_CHANNEL_LIST = 0x64D9, CMSG_CHANNEL_MODERATOR = 0x20D1, CMSG_CHANNEL_MUTE = 0x34C9, CMSG_CHANNEL_OWNER = 0x00, - CMSG_CHANNEL_PASSWORD = 0x00, + CMSG_CHANNEL_PASSWORD = 0x30D1, CMSG_CHANNEL_ROSTER_INFO = 0x00, CMSG_CHANNEL_SET_OWNER = 0x7449, CMSG_CHANNEL_UNBAN = 0x6451, @@ -238,7 +238,7 @@ enum Opcodes CMSG_LEARN_PREVIEW_TALENTS_PET = 0x9AFB, CMSG_LEARN_TALENT = 0x98F3, CMSG_LEAVE_BATTLEFIELD = 0x1AE7, - CMSG_LEAVE_CHANNEL = 0x00, + CMSG_LEAVE_CHANNEL = 0x60C9, CMSG_LFG_GET_PLAYER_INFO = 0x00, CMSG_LFG_JOIN = 0x00, CMSG_LFG_LEAVE = 0x00, @@ -401,7 +401,7 @@ enum Opcodes CMSG_SET_ACTIVE_VOICE_CHANNEL = 0x00, CMSG_SET_ALLOW_LOW_LEVEL_RAID1 = 0xC863, CMSG_SET_ALLOW_LOW_LEVEL_RAID2 = 0x4CE7, - CMSG_SET_CHANNEL_WATCH = 0x00, + CMSG_SET_CHANNEL_WATCH = 0x9CFB, CMSG_SET_CONTACT_NOTES = 0x1AF3, CMSG_SET_FACTION_CHEAT = 0x00, CMSG_SET_GUILD_BANK_TEXT = 0x00, -- cgit v1.2.3 From 8a43bd7293572a1cc93d84eee4badd60da762e6f Mon Sep 17 00:00:00 2001 From: Drake Fish Date: Sun, 22 Jan 2012 21:53:54 -0500 Subject: Core/Movement: Fixed forced speed changes. --- src/server/game/Entities/Unit/Unit.cpp | 171 +++++++++++++++++++++++++++++++-- 1 file changed, 163 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index c25e4bf455b..b11772e7b20 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -12715,7 +12715,26 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) switch (mtype) { case MOVE_WALK: - data.Initialize(SMSG_MOVE_SET_WALK_SPEED, 16); + data.Initialize(SMSG_MOVE_SET_WALK_SPEED, 1 + 8 + 4 + 4 ); + data.WriteByteMask(bytes[6]); + data.WriteByteMask(bytes[5]); + data.WriteByteMask(bytes[7]); + data.WriteByteMask(bytes[0]); + data.WriteByteMask(bytes[2]); + data.WriteByteMask(bytes[4]); + data.WriteByteMask(bytes[1]); + data.WriteByteMask(bytes[3]); + + data.WriteByteSeq(bytes[3]); + data.WriteByteSeq(bytes[1]); + data << float(GetSpeed(mtype)); + data.WriteByteSeq(bytes[6]); + data.WriteByteSeq(bytes[4]); + data.WriteByteSeq(bytes[7]); + data.WriteByteSeq(bytes[2]); + data.WriteByteSeq(bytes[5]); + data << uint32(0); + data.WriteByteSeq(bytes[0]); break; case MOVE_RUN: data.Initialize(SMSG_MOVE_SET_RUN_SPEED, 1 + 8 + 4 + 4 ); @@ -12742,25 +12761,161 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) data << uint32(0); break; case MOVE_RUN_BACK: - data.Initialize(SMSG_MOVE_SET_RUN_BACK_SPEED, 16); + data.Initialize(SMSG_MOVE_SET_RUN_BACK_SPEED, 1 + 8 + 4 + 4 ); + data.WriteByteMask(bytes[3]); + data.WriteByteMask(bytes[0]); + data.WriteByteMask(bytes[6]); + data.WriteByteMask(bytes[2]); + data.WriteByteMask(bytes[7]); + data.WriteByteMask(bytes[1]); + data.WriteByteMask(bytes[4]); + data.WriteByteMask(bytes[5]); + + data << float(GetSpeed(mtype)); + + data.WriteByteSeq(bytes[4]); + data.WriteByteSeq(bytes[1]); + data << uint32(0); + data.WriteByteSeq(bytes[5]); + data.WriteByteSeq(bytes[3]); + data.WriteByteSeq(bytes[7]); + data.WriteByteSeq(bytes[6]); + data.WriteByteSeq(bytes[2]); + data.WriteByteSeq(bytes[0]); break; case MOVE_SWIM: - data.Initialize(SMSG_MOVE_SET_SWIM_SPEED, 16); + data.Initialize(SMSG_MOVE_SET_SWIM_SPEED, 1 + 8 + 4 + 4 ); + data.WriteByteMask(bytes[7]); + data.WriteByteMask(bytes[2]); + data.WriteByteMask(bytes[3]); + data.WriteByteMask(bytes[4]); + data.WriteByteMask(bytes[5]); + data.WriteByteMask(bytes[6]); + data.WriteByteMask(bytes[1]); + data.WriteByteMask(bytes[0]); + + data.WriteByteSeq(bytes[6]); + data.WriteByteSeq(bytes[4]); + data.WriteByteSeq(bytes[7]); + data.WriteByteSeq(bytes[0]); + data << float(GetSpeed(mtype)); + data.WriteByteSeq(bytes[3]); + data.WriteByteSeq(bytes[1]); + data.WriteByteSeq(bytes[5]); + data.WriteByteSeq(bytes[2]); + data << uint32(0); break; case MOVE_SWIM_BACK: - data.Initialize(SMSG_MOVE_SET_SWIM_BACK_SPEED, 16); + data.Initialize(SMSG_MOVE_SET_SWIM_BACK_SPEED, 1 + 8 + 4 + 4 ); + data.WriteByteMask(bytes[3]); + data.WriteByteMask(bytes[1]); + data.WriteByteMask(bytes[4]); + data.WriteByteMask(bytes[2]); + data.WriteByteMask(bytes[7]); + data.WriteByteMask(bytes[6]); + data.WriteByteMask(bytes[5]); + data.WriteByteMask(bytes[0]); + + data.WriteByteSeq(bytes[6]); + data.WriteByteSeq(bytes[3]); + data.WriteByteSeq(bytes[7]); + data.WriteByteSeq(bytes[0]); + data << uint32(0); + data.WriteByteSeq(bytes[4]); + data.WriteByteSeq(bytes[1]); + data.WriteByteSeq(bytes[2]); + data << float(GetSpeed(mtype)); + data.WriteByteSeq(bytes[5]); break; case MOVE_TURN_RATE: - data.Initialize(SMSG_MOVE_SET_TURN_RATE, 16); + data.Initialize(SMSG_MOVE_SET_TURN_RATE, 1 + 8 + 4 + 4 ); + data.WriteByteMask(bytes[0]); + data.WriteByteMask(bytes[2]); + data.WriteByteMask(bytes[1]); + data.WriteByteMask(bytes[5]); + data.WriteByteMask(bytes[3]); + data.WriteByteMask(bytes[7]); + data.WriteByteMask(bytes[6]); + data.WriteByteMask(bytes[4]); + + data << float(GetSpeed(mtype)); + + data.WriteByteSeq(bytes[1]); + data.WriteByteSeq(bytes[4]); + data.WriteByteSeq(bytes[5]); + data << uint32(0); + data.WriteByteSeq(bytes[3]); + data.WriteByteSeq(bytes[6]); + data.WriteByteSeq(bytes[2]); + data.WriteByteSeq(bytes[0]); + data.WriteByteSeq(bytes[7]); break; case MOVE_FLIGHT: - data.Initialize(SMSG_MOVE_SET_FLIGHT_SPEED, 16); + data.Initialize(SMSG_MOVE_SET_FLIGHT_SPEED, 1 + 8 + 4 + 4 ); + data.WriteByteMask(bytes[0]); + data.WriteByteMask(bytes[7]); + data.WriteByteMask(bytes[4]); + data.WriteByteMask(bytes[5]); + data.WriteByteMask(bytes[6]); + data.WriteByteMask(bytes[1]); + data.WriteByteMask(bytes[2]); + data.WriteByteMask(bytes[3]); + + data << float(GetSpeed(mtype)); + + data.WriteByteSeq(bytes[5]); + data.WriteByteSeq(bytes[1]); + data.WriteByteSeq(bytes[7]); + data.WriteByteSeq(bytes[0]); + data.WriteByteSeq(bytes[2]); + data << uint32(0); + data.WriteByteSeq(bytes[6]); + data.WriteByteSeq(bytes[3]); + data.WriteByteSeq(bytes[4]); break; case MOVE_FLIGHT_BACK: - data.Initialize(SMSG_MOVE_SET_FLIGHT_BACK_SPEED, 16); + data.Initialize(SMSG_MOVE_SET_FLIGHT_BACK_SPEED, 1 + 8 + 4 + 4 ); + data.WriteByteMask(bytes[3]); + data.WriteByteMask(bytes[4]); + data.WriteByteMask(bytes[5]); + data.WriteByteMask(bytes[6]); + data.WriteByteMask(bytes[1]); + data.WriteByteMask(bytes[0]); + data.WriteByteMask(bytes[2]); + data.WriteByteMask(bytes[7]); + + data.WriteByteSeq(bytes[0]); + data << float(GetSpeed(mtype)); + data.WriteByteSeq(bytes[2]); + data.WriteByteSeq(bytes[7]); + data << uint32(0); + data.WriteByteSeq(bytes[1]); + data.WriteByteSeq(bytes[3]); + data.WriteByteSeq(bytes[6]); + data.WriteByteSeq(bytes[4]); + data.WriteByteSeq(bytes[5]); break; case MOVE_PITCH_RATE: - data.Initialize(SMSG_MOVE_SET_PITCH_RATE, 16); + data.Initialize(SMSG_MOVE_SET_PITCH_RATE, 1 + 8 + 4 + 4 ); + data.WriteByteMask(bytes[7]); + data.WriteByteMask(bytes[5]); + data.WriteByteMask(bytes[6]); + data.WriteByteMask(bytes[2]); + data.WriteByteMask(bytes[4]); + data.WriteByteMask(bytes[0]); + data.WriteByteMask(bytes[3]); + data.WriteByteMask(bytes[1]); + + data.WriteByteSeq(bytes[0]); + data << uint32(0); + data.WriteByteSeq(bytes[3]); + data << float(GetSpeed(mtype)); + data.WriteByteSeq(bytes[5]); + data.WriteByteSeq(bytes[1]); + data.WriteByteSeq(bytes[6]); + data.WriteByteSeq(bytes[7]); + data.WriteByteSeq(bytes[2]); + data.WriteByteSeq(bytes[4]); break; default: sLog->outError("Unit::SetSpeed: Unsupported move type (%d), data not sent to client.", mtype); -- cgit v1.2.3 From 2da09128f7131cf9b683e1e4ace21e5889699a10 Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Mon, 23 Jan 2012 13:27:08 +0800 Subject: Core/Opcodes: 4 new opcodes Signed-off-by: Gyx <2359980687@qq.com> --- src/server/game/Server/Protocol/Opcodes.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 6e6b9cb8c99..c5106311db2 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -451,7 +451,6 @@ enum Opcodes CMSG_UNACCEPT_TRADE = 0x00, CMSG_UNLEARN_SKILL = 0xAC3, CMSG_UNREGISTER_ALL_ADDON_PREFIXES = 0x00, - CMSG_UNUSED2 = 0x00, CMSG_UPDATE_ACCOUNT_DATA = 0x4AFE, CMSG_UPDATE_PROJECTILE_POSITION = 0xEDB, CMSG_USE_ITEM = 0xD8EA, @@ -620,7 +619,7 @@ enum Opcodes SMSG_CHAT_PLAYER_AMBIGUOUS = 0xDE7F, SMSG_CHAT_PLAYER_NOT_FOUND = 0x4E6F, SMSG_CHAT_RESTRICTED = 0x4863, - SMSG_CHAT_WRONG_FACTION = 0xE66, + SMSG_CHAT_WRONG_FACTION = 0x0E66, SMSG_CHECK_FOR_BOTS = 0x00, SMSG_CLEAR_COOLDOWN = 0x986F, SMSG_CLEAR_TARGET = 0x00, @@ -747,7 +746,7 @@ enum Opcodes SMSG_INVALIDATE_DANCE = 0x1EEF, SMSG_INVALIDATE_PLAYER = 0x5C5F, SMSG_INVENTORY_CHANGE_FAILURE = 0xC8EE, - SMSG_ITEM_COOLDOWN = 0x00, + SMSG_ITEM_COOLDOWN = 0x5CC2, SMSG_ITEM_ENCHANT_TIME_UPDATE = 0xDCE6, SMSG_ITEM_NAME_QUERY_RESPONSE = 0x00, SMSG_ITEM_PUSH_RESULT = 0x8EFB, @@ -799,8 +798,8 @@ enum Opcodes SMSG_LOOT_START_ROLL = 0xC8C2, SMSG_MAIL_LIST_RESULT = 0x5CD7, SMSG_MEETINGSTONE_COMPLETE = 0xDA43, - SMSG_MEETINGSTONE_IN_PROGRESS = 0x00, - SMSG_MEETINGSTONE_MEMBER_ADDED = 0x00, + SMSG_MEETINGSTONE_IN_PROGRESS = 0xCACE, + SMSG_MEETINGSTONE_MEMBER_ADDED = 0x1AFF, SMSG_MEETINGSTONE_SETQUEUE = 0x00, SMSG_MESSAGECHAT = 0x5E52, SMSG_MIRRORIMAGE_DATA = 0x8AFB, @@ -1002,7 +1001,7 @@ enum Opcodes SMSG_SPELL_FAILURE = 0x9A66, SMSG_SPELL_GO = 0x0A53, SMSG_SPELL_START = 0xCE43, - SMSG_SPELL_UPDATE_CHAIN_TARGETS = 0x00, + SMSG_SPELL_UPDATE_CHAIN_TARGETS = 0x98EE, SMSG_SPELLBREAKLOG = 0x00, SMSG_SPELLDAMAGESHIELD = 0x8AFE, SMSG_SPELLDISPELLOG = 0x00, -- cgit v1.2.3 From 00ff0d6fa055f6a74a5bfee53774ab2c8cee5a6b Mon Sep 17 00:00:00 2001 From: Drake Fish Date: Mon, 23 Jan 2012 14:38:56 -0500 Subject: Core/Movement: Added most spline speed changes. --- src/server/game/Entities/Unit/Unit.cpp | 142 +++++++++++++++++++++++++++++++-- 1 file changed, 135 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index b11772e7b20..5c481033273 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -12661,25 +12661,153 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) data << float(GetSpeed(mtype)); break; case MOVE_RUN_BACK: - data.Initialize(SMSG_MOVE_SPLINE_SET_RUN_BACK_SPEED, 8+4+2+4+4+4+4+4+4+4); + data.Initialize(SMSG_MOVE_SPLINE_SET_RUN_BACK_SPEED, 1 + 8 + 4); + data.WriteByteMask(bytes[4]); + data.WriteByteMask(bytes[0]); + data.WriteByteMask(bytes[6]); + data.WriteByteMask(bytes[3]); + data.WriteByteMask(bytes[5]); + data.WriteByteMask(bytes[1]); + data.WriteByteMask(bytes[7]); + data.WriteByteMask(bytes[2]); + + data.WriteByteSeq(bytes[1]); + data.WriteByteSeq(bytes[7]); + data.WriteByteSeq(bytes[5]); + data.WriteByteSeq(bytes[3]); + data.WriteByteSeq(bytes[6]); + data.WriteByteSeq(bytes[4]); + data.WriteByteSeq(bytes[0]); + data.WriteByteSeq(bytes[2]); + + data << float(GetSpeed(mtype)); break; case MOVE_SWIM: - data.Initialize(SMSG_MOVE_SPLINE_SET_SWIM_SPEED, 8+4+2+4+4+4+4+4+4+4); + data.Initialize(SMSG_MOVE_SPLINE_SET_SWIM_SPEED, 1 + 8 + 4); + data.WriteByteMask(bytes[3]); + data.WriteByteMask(bytes[5]); + data.WriteByteMask(bytes[7]); + data.WriteByteMask(bytes[4]); + data.WriteByteMask(bytes[2]); + data.WriteByteMask(bytes[0]); + data.WriteByteMask(bytes[1]); + data.WriteByteMask(bytes[6]); + + data.WriteByteSeq(bytes[0]); + data.WriteByteSeq(bytes[3]); + data.WriteByteSeq(bytes[6]); + data.WriteByteSeq(bytes[4]); + data.WriteByteSeq(bytes[2]); + data.WriteByteSeq(bytes[7]); + data << float(GetSpeed(mtype)); + data.WriteByteSeq(bytes[1]); + data.WriteByteSeq(bytes[5]); break; case MOVE_SWIM_BACK: - data.Initialize(SMSG_MOVE_SPLINE_SET_SWIM_BACK_SPEED, 8+4+2+4+4+4+4+4+4+4); + data.Initialize(SMSG_MOVE_SPLINE_SET_SWIM_BACK_SPEED, 1 + 8 + 4); + data.WriteByteMask(bytes[3]); + data.WriteByteMask(bytes[5]); + data.WriteByteMask(bytes[4]); + data.WriteByteMask(bytes[0]); + data.WriteByteMask(bytes[2]); + data.WriteByteMask(bytes[1]); + data.WriteByteMask(bytes[6]); + data.WriteByteMask(bytes[7]); + + data.WriteByteSeq(bytes[1]); + data.WriteByteSeq(bytes[0]); + data.WriteByteSeq(bytes[2]); + data << float(GetSpeed(mtype)); + data.WriteByteSeq(bytes[7]); + data.WriteByteSeq(bytes[3]); + data.WriteByteSeq(bytes[6]); + data.WriteByteSeq(bytes[4]); + data.WriteByteSeq(bytes[5]); break; case MOVE_TURN_RATE: - data.Initialize(SMSG_MOVE_SPLINE_SET_TURN_RATE, 8+4+2+4+4+4+4+4+4+4); + data.Initialize(SMSG_MOVE_SPLINE_SET_TURN_RATE, 1 + 8 + 4); + data.WriteByteMask(bytes[0]); + data.WriteByteMask(bytes[4]); + data.WriteByteMask(bytes[5]); + data.WriteByteMask(bytes[1]); + data.WriteByteMask(bytes[6]); + data.WriteByteMask(bytes[3]); + data.WriteByteMask(bytes[7]); + data.WriteByteMask(bytes[2]); + + data.WriteByteSeq(bytes[2]); + data.WriteByteSeq(bytes[4]); + data.WriteByteSeq(bytes[7]); + data.WriteByteSeq(bytes[0]); + data << float(GetSpeed(mtype)); + data.WriteByteSeq(bytes[5]); + data.WriteByteSeq(bytes[1]); + data.WriteByteSeq(bytes[6]); + data.WriteByteSeq(bytes[3]); break; case MOVE_FLIGHT: - data.Initialize(SMSG_MOVE_SPLINE_SET_FLIGHT_SPEED, 8+4+2+4+4+4+4+4+4+4); + data.Initialize(SMSG_MOVE_SPLINE_SET_FLIGHT_SPEED, 1 + 8 + 4); + data.WriteByteMask(bytes[2]); + data.WriteByteMask(bytes[3]); + data.WriteByteMask(bytes[5]); + data.WriteByteMask(bytes[0]); + data.WriteByteMask(bytes[7]); + data.WriteByteMask(bytes[4]); + data.WriteByteMask(bytes[6]); + data.WriteByteMask(bytes[1]); + + data << float(GetSpeed(mtype)); + + data.WriteByteSeq(bytes[1]); + data.WriteByteSeq(bytes[0]); + data.WriteByteSeq(bytes[6]); + data.WriteByteSeq(bytes[7]); + data.WriteByteSeq(bytes[3]); + data.WriteByteSeq(bytes[2]); + data.WriteByteSeq(bytes[5]); + data.WriteByteSeq(bytes[4]); break; case MOVE_FLIGHT_BACK: - data.Initialize(SMSG_MOVE_SPLINE_SET_FLIGHT_BACK_SPEED, 8+4+2+4+4+4+4+4+4+4); + data.Initialize(SMSG_MOVE_SPLINE_SET_FLIGHT_BACK_SPEED, 1 + 8 + 4); + data.WriteByteMask(bytes[1]); + data.WriteByteMask(bytes[6]); + data.WriteByteMask(bytes[0]); + data.WriteByteMask(bytes[2]); + data.WriteByteMask(bytes[7]); + data.WriteByteMask(bytes[5]); + data.WriteByteMask(bytes[4]); + data.WriteByteMask(bytes[3]); + + data.WriteByteSeq(bytes[5]); + data.WriteByteSeq(bytes[6]); + data.WriteByteSeq(bytes[0]); + data.WriteByteSeq(bytes[4]); + data.WriteByteSeq(bytes[2]); + data.WriteByteSeq(bytes[1]); + data.WriteByteSeq(bytes[7]); + data << float(GetSpeed(mtype)); + data.WriteByteSeq(bytes[3]); break; case MOVE_PITCH_RATE: - data.Initialize(SMSG_MOVE_SPLINE_SET_PITCH_RATE, 8+4+2+4+4+4+4+4+4+4); + data.Initialize(SMSG_MOVE_SPLINE_SET_PITCH_RATE, 1 + 8 + 4); + data.WriteByteMask(bytes[7]); + data.WriteByteMask(bytes[2]); + data.WriteByteMask(bytes[3]); + data.WriteByteMask(bytes[5]); + data.WriteByteMask(bytes[4]); + data.WriteByteMask(bytes[0]); + data.WriteByteMask(bytes[6]); + data.WriteByteMask(bytes[1]); + + data.WriteByteSeq(bytes[0]); + data.WriteByteSeq(bytes[1]); + data.WriteByteSeq(bytes[7]); + data.WriteByteSeq(bytes[2]); + data.WriteByteSeq(bytes[3]); + data.WriteByteSeq(bytes[6]); + data.WriteByteSeq(bytes[5]); + data.WriteByteSeq(bytes[4]); + data << float(GetSpeed(mtype)); break; default: sLog->outError("Unit::SetSpeed: Unsupported move type (%d), data not sent to client.", mtype); -- cgit v1.2.3 From af12ae1fa3a0fcef8bdf6bc142294e79dcc7de71 Mon Sep 17 00:00:00 2001 From: Drake Fish Date: Mon, 23 Jan 2012 19:06:38 -0500 Subject: Core/Movement: Added a cs for SMSG_MOVE_SPLINE_ENABLE/DISABLE_COLLISION. --- src/server/scripts/Commands/cs_modify.cpp | 83 +++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) (limited to 'src') diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index 9fc220e600a..00832aa4d59 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -60,6 +60,7 @@ public: { "morph", SEC_GAMEMASTER, false, &HandleModifyMorphCommand, "", NULL }, { "phase", SEC_ADMINISTRATOR, false, &HandleModifyPhaseCommand, "", NULL }, { "gender", SEC_GAMEMASTER, false, &HandleModifyGenderCommand, "", NULL }, + { "collision", SEC_GAMEMASTER, false, &HandleModifyCollisionCommand, "", NULL }, { NULL, 0, false, NULL, "", NULL } }; static ChatCommand commandTable[] = @@ -1374,6 +1375,88 @@ public: return true; } + + static bool HandleModifyCollisionCommand(ChatHandler* handler, const char* args) + { + if (!*args) + return false; + + Player* target = handler->getSelectedPlayer(); + + if (!target) + { + handler->PSendSysMessage(LANG_PLAYER_NOT_FOUND); + handler->SetSentErrorMessage(true); + return false; + } + + std::string param = (char*)args; + + if (param == "on") + { + // enable collision + WorldPacket data; + uint64 guid = target->GetGUID(); + uint8* bytes = (uint8*)&guid; + + data.Initialize(SMSG_MOVE_SPLINE_ENABLE_COLLISION, 1 + 8); + data.WriteByteMask(bytes[7]); + data.WriteByteMask(bytes[5]); + data.WriteByteMask(bytes[4]); + data.WriteByteMask(bytes[0]); + data.WriteByteMask(bytes[1]); + data.WriteByteMask(bytes[6]); + data.WriteByteMask(bytes[2]); + data.WriteByteMask(bytes[3]); + + data.WriteByteSeq(bytes[6]); + data.WriteByteSeq(bytes[3]); + data.WriteByteSeq(bytes[2]); + data.WriteByteSeq(bytes[7]); + data.WriteByteSeq(bytes[4]); + data.WriteByteSeq(bytes[1]); + data.WriteByteSeq(bytes[5]); + data.WriteByteSeq(bytes[0]); + + target->SendMessageToSet(&data, true); + handler->SendSysMessage("Enabled Collision"); + return true; + } + + if (param == "off") + { + // disable collision + WorldPacket data; + uint64 guid = target->GetGUID(); + uint8* bytes = (uint8*)&guid; + + data.Initialize(SMSG_MOVE_SPLINE_DISABLE_COLLISION, 1 + 8); + data.WriteByteMask(bytes[4]); + data.WriteByteMask(bytes[7]); + data.WriteByteMask(bytes[5]); + data.WriteByteMask(bytes[3]); + data.WriteByteMask(bytes[2]); + data.WriteByteMask(bytes[1]); + data.WriteByteMask(bytes[6]); + data.WriteByteMask(bytes[0]); + + data.WriteByteSeq(bytes[6]); + data.WriteByteSeq(bytes[0]); + data.WriteByteSeq(bytes[5]); + data.WriteByteSeq(bytes[4]); + data.WriteByteSeq(bytes[7]); + data.WriteByteSeq(bytes[3]); + data.WriteByteSeq(bytes[1]); + data.WriteByteSeq(bytes[2]); + + target->SendMessageToSet(&data, true); + handler->SendSysMessage("Disabled Collision"); + return true; + } + + return false; + } + }; void AddSC_modify_commandscript() -- cgit v1.2.3 From b56d9c5e96c9526643045eeaef59366549dffca5 Mon Sep 17 00:00:00 2001 From: Drake Fish Date: Mon, 23 Jan 2012 20:46:19 -0500 Subject: Core/Movement: Fixed SMSG_MOVE_KNOCK_BACK structure. --- src/server/game/Entities/Unit/Unit.cpp | 67 +++++++++++++++++++++++++++------- 1 file changed, 53 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 5c481033273..35b337f5a15 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -16970,13 +16970,33 @@ void Unit::KnockbackFrom(float x, float y, float speedXY, float speedZ) float vcos, vsin; GetSinCos(x, y, vsin, vcos); - WorldPacket data(SMSG_MOVE_KNOCK_BACK, (8+4+4+4+4+4)); - data.append(GetPackGUID()); - data << uint32(0); // counter - data << float(vcos); // x direction - data << float(vsin); // y direction - data << float(speedXY); // Horizontal speed - data << float(-speedZ); // Z Movement speed (vertical) + WorldPacket data(SMSG_MOVE_KNOCK_BACK, (1+8+4+4+4+4+4)); + uint64 guid = GetGUID(); + uint8* bytes = (uint8*)&guid; + + data.WriteByteMask(bytes[5]); + data.WriteByteMask(bytes[2]); + data.WriteByteMask(bytes[6]); + data.WriteByteMask(bytes[3]); + data.WriteByteMask(bytes[1]); + data.WriteByteMask(bytes[4]); + data.WriteByteMask(bytes[0]); + data.WriteByteMask(bytes[7]); + + data.WriteByteSeq(bytes[0]); + data << float(speedXY); + data << uint32(0); + data << float(-speedZ); + data.WriteByteSeq(bytes[6]); + data << float(vcos); + data << float(vsin); + data.WriteByteSeq(bytes[3]); + data.WriteByteSeq(bytes[1]); + data.WriteByteSeq(bytes[2]); + data.WriteByteSeq(bytes[4]); + data.WriteByteSeq(bytes[7]); + data.WriteByteSeq(bytes[5]); + data.WriteByteSeq(bytes[5]); player->GetSession()->SendPacket(&data); } @@ -17290,13 +17310,32 @@ void Unit::JumpTo(float speedXY, float speedZ, bool forward) float vcos = cos(angle+GetOrientation()); float vsin = sin(angle+GetOrientation()); - WorldPacket data(SMSG_MOVE_KNOCK_BACK, (8+4+4+4+4+4)); - data.append(GetPackGUID()); - data << uint32(0); // Sequence - data << float(vcos); // x direction - data << float(vsin); // y direction - data << float(speedXY); // Horizontal speed - data << float(-speedZ); // Z Movement speed (vertical) + WorldPacket data(SMSG_MOVE_KNOCK_BACK, (1+8+4+4+4+4+4)); + uint64 guid = GetGUID(); + uint8* bytes = (uint8*)&guid; + + data.WriteByteMask(bytes[5]); + data.WriteByteMask(bytes[2]); + data.WriteByteMask(bytes[6]); + data.WriteByteMask(bytes[3]); + data.WriteByteMask(bytes[1]); + data.WriteByteMask(bytes[4]); + data.WriteByteMask(bytes[0]); + data.WriteByteMask(bytes[7]); + + data.WriteByteSeq(bytes[0]); + data << float(speedXY); + data << uint32(0); + data << float(-speedZ); + data.WriteByteSeq(bytes[6]); + data << float(vcos); + data << float(vsin); + data.WriteByteSeq(bytes[3]); + data.WriteByteSeq(bytes[1]); + data.WriteByteSeq(bytes[2]); + data.WriteByteSeq(bytes[4]); + data.WriteByteSeq(bytes[7]); + data.WriteByteSeq(bytes[5]); ToPlayer()->GetSession()->SendPacket(&data); } -- cgit v1.2.3 From 9d9dc50b139be5081ea57f2fce22a0d43b2db9a2 Mon Sep 17 00:00:00 2001 From: kaelima Date: Thu, 26 Jan 2012 15:43:42 +0100 Subject: Core/Protocol: Activate some SMSG opcodes --- src/server/game/Server/Protocol/Opcodes.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 67d12b59ecd..ba861b2bd2e 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -1178,8 +1178,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_SET_RUNE_COUNT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_RUNE_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_PITCH_RATE_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_PITCH_RATE_CHANGE_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_INVITE_NOTES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -1217,8 +1217,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_HEALTH_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_POWER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJ_REPORT_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGameobjectReportUse ); - //DEFINE_OPCODE_HANDLER(SMSG_HIGHEST_THREAT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_THREAT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_HIGHEST_THREAT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_THREAT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_THREAT_REMOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_THREAT_CLEAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CONVERT_RUNE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From b62af271232a5fb258240eb149a6ee0c3999d9bb Mon Sep 17 00:00:00 2001 From: kaelima Date: Thu, 26 Jan 2012 15:45:09 +0100 Subject: Core/Protocol: Enable SMSG_THREAT_UPDATE --- src/server/game/Entities/Unit/Unit.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 35b337f5a15..034ab9ba92d 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -17721,7 +17721,7 @@ void Unit::SendThreatListUpdate() { uint32 count = getThreatManager().getThreatList().size(); - sLog->outDebug(LOG_FILTER_UNITS, "WORLD: Send SMSG_THREAT_UPDATE Message (disabled)"); + sLog->outDebug(LOG_FILTER_UNITS, "WORLD: Send SMSG_THREAT_UPDATE Message"); WorldPacket data(SMSG_THREAT_UPDATE, 8 + count * 8); data.append(GetPackGUID()); data << uint32(count); @@ -17731,7 +17731,7 @@ void Unit::SendThreatListUpdate() data.appendPackGUID((*itr)->getUnitGuid()); data << uint32((*itr)->getThreat() * 100); } - //SendMessageToSet(&data, false); + SendMessageToSet(&data, false); } } -- cgit v1.2.3 From f7214400bbfd363c5abc29fe7f047499687c1174 Mon Sep 17 00:00:00 2001 From: Shocker Date: Fri, 27 Jan 2012 02:09:40 +0200 Subject: Core/Achievements: Implement more DBC achievement criteria conditions --- src/server/game/Achievements/AchievementMgr.cpp | 56 ++++++++++++++++++++++++- src/server/game/DataStores/DBCEnums.h | 22 +++++----- 2 files changed, 66 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index b4fe39484e9..40a0be723fe 100755 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -40,6 +40,7 @@ #include "BattlegroundAB.h" #include "Map.h" #include "InstanceScript.h" +#include "Group.h" namespace Trinity { @@ -2016,7 +2017,7 @@ bool AchievementMgr::HasAchieved(uint32 achievementId) const return m_completedAchievements.find(achievementId) != m_completedAchievements.end(); } -bool AchievementMgr::CanUpdateCriteria(AchievementCriteriaEntry const* criteria, AchievementEntry const* achievement, uint64 /*miscValue1*/, uint64 /*miscValue2*/, Unit* unit) +bool AchievementMgr::CanUpdateCriteria(AchievementCriteriaEntry const* criteria, AchievementEntry const* achievement, uint64 miscValue1, uint64 miscValue2, Unit* unit) { if (DisableMgr::IsDisabledFor(DISABLE_TYPE_ACHIEVEMENT_CRITERIA, criteria->ID, NULL)) return false; @@ -2096,6 +2097,59 @@ bool AchievementMgr::CanUpdateCriteria(AchievementCriteriaEntry const* criteria, if (player->GetTeam() == GetPlayer()->GetTeam()) return false; break; + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_CREATURE_ENTRY: + if (!unit || !unit->ToCreature()) + return false; + if (unit->ToCreature()->GetEntry() != value) + return false; + break; + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_HAS_AURA: + if (!GetPlayer()->HasAura(value)) + return false; + break; + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_HAS_AURA: + if (!unit || !unit->HasAura(value)) + return false; + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_ITEM_QUALITY_MIN: + if (ItemTemplate const * itemProto = sObjectMgr->GetItemTemplate(miscValue1)) + if (itemProto->Quality < value) + return false; + break; + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_ITEM_QUALITY_EQUALS: + if (ItemTemplate const * itemProto = sObjectMgr->GetItemTemplate(miscValue1)) + if (itemProto->Quality < value) + return false; + break; + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_RACE: + if (GetPlayer()->getRace() != value) + return false; + break; + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_CLASS: + if (GetPlayer()->getClass() != value) + return false; + break; + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_RACE: + if (!unit || !unit->ToPlayer()) + break; + if (unit->ToPlayer()->getRace() != value) + return false; + break; + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_CLASS: + if (!unit || !unit->ToPlayer()) + break; + if (unit->ToPlayer()->getClass() != value) + return false; + break; + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_MAX_GROUP_MEMBERS: + if (GetPlayer()->GetGroup() && GetPlayer()->GetGroup()->GetMembersCount() >= value) + return false; + break; + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_CREATURE_TYPE: + if (!unit || !unit->ToCreature()) + return false; + if (unit->ToCreature()->GetCreatureType() != value) + return false; + break; default: break; } diff --git a/src/server/game/DataStores/DBCEnums.h b/src/server/game/DataStores/DBCEnums.h index 4888dadfcd6..b850aa0ef46 100755 --- a/src/server/game/DataStores/DBCEnums.h +++ b/src/server/game/DataStores/DBCEnums.h @@ -99,18 +99,18 @@ enum AchievementCriteriaAdditionalCondition ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_DRUNK_VALUE = 1, // NYI ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK2 = 2, ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_ITEM_LEVEL = 3, // NYI - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_CREATURE_ENTRY = 4, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_CREATURE_ENTRY = 4, ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_MUST_BE_PLAYER = 5, ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_MUST_BE_DEAD = 6, ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_MUST_BE_ENEMY = 7, - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_HAS_AURA = 8, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_HAS_AURA = 8, ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK9 = 9, // unused in 4.0.6a - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_HAS_AURA = 10, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_HAS_AURA = 10, ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_MUST_BE_MOUNTED = 11, ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK12 = 12, // unused in 4.0.6a ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK13 = 13, // unused in 4.0.6a - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_ITEM_QUALITY_MIN = 14, // NYI - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_ITEM_QUALITY_EQUALS = 15, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_ITEM_QUALITY_MIN = 14, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_ITEM_QUALITY_EQUALS = 15, ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK16 = 16, ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_AREA = 17, ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_ZONE = 18, @@ -120,12 +120,12 @@ enum AchievementCriteriaAdditionalCondition ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK22 = 22, // unused in 4.0.6a ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK23 = 23, // unused in 4.0.6a ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_ARENA_TEAM_SIZE = 24, // NYI - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_RACE = 25, // NYI - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_CLASS = 26, // NYI - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_RACE = 27, // NYI - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_CLASS = 28, // NYI - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_MAX_GROUP_MEMBERS = 29, // NYI - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_CREATURE_TYPE = 30, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_RACE = 25, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_CLASS = 26, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_RACE = 27, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_CLASS = 28, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_MAX_GROUP_MEMBERS = 29, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_CREATURE_TYPE = 30, ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK31 = 31, // unused in 4.0.6a ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_MAP = 32, ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_ITEM_CLASS = 33, // NYI -- cgit v1.2.3 From b9e64f962458829a8b27d2b578a3aa744e7651b0 Mon Sep 17 00:00:00 2001 From: Shocker Date: Fri, 27 Jan 2012 02:35:10 +0200 Subject: Core/Spells: Remove outdated code for Wild Hunt --- src/server/game/Entities/Unit/StatSystem.cpp | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index a1f10752a4d..c25c4d3d79d 100755 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -1064,18 +1064,6 @@ bool Guardian::UpdateStats(Stats stat) else { mod = 0.45f; - if (isPet()) - { - PetSpellMap::const_iterator itr = (ToPet()->m_spells.find(62758)); // Wild Hunt rank 1 - if (itr == ToPet()->m_spells.end()) - itr = ToPet()->m_spells.find(62762); // Wild Hunt rank 2 - - if (itr != ToPet()->m_spells.end()) // If pet has Wild Hunt - { - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value - AddPctN(mod, spellInfo->Effects[EFFECT_0].CalcValue()); - } - } ownersBonus = float(owner->GetStat(stat)) * mod; value += ownersBonus; } @@ -1233,19 +1221,6 @@ void Guardian::UpdateAttackPowerAndDamage(bool ranged) if (isHunterPet()) //hunter pets benefit from owner's attack power { float mod = 1.0f; //Hunter contribution modifier - if (isPet()) - { - PetSpellMap::const_iterator itr = ToPet()->m_spells.find(62758); //Wild Hunt rank 1 - if (itr == ToPet()->m_spells.end()) - itr = ToPet()->m_spells.find(62762); //Wild Hunt rank 2 - - if (itr != ToPet()->m_spells.end()) // If pet has Wild Hunt - { - SpellInfo const* sProto = sSpellMgr->GetSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value - mod += CalculatePctN(1.0f, sProto->Effects[1].CalcValue()); - } - } - bonusAP = owner->GetTotalAttackPowerValue(RANGED_ATTACK) * 0.22f * mod; SetBonusDamage(int32(owner->GetTotalAttackPowerValue(RANGED_ATTACK) * 0.1287f * mod)); } -- cgit v1.2.3 From 0df5e19bd6b1cbad20ba80c73db3bc8693c6bece Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 27 Jan 2012 11:24:41 +0100 Subject: Core/Spells: Implemented mounts --- src/server/game/DataStores/DBCEnums.h | 6 +++ src/server/game/DataStores/DBCStores.cpp | 7 ++- src/server/game/DataStores/DBCStores.h | 2 + src/server/game/DataStores/DBCStructure.h | 22 +++++++- src/server/game/DataStores/DBCfmt.h | 2 + src/server/game/Entities/Unit/Unit.cpp | 62 ++++++++++++++++++++++- src/server/game/Entities/Unit/Unit.h | 1 + src/server/game/Spells/Auras/SpellAuraEffects.cpp | 20 ++++++-- src/server/game/Spells/Auras/SpellAuras.cpp | 21 +++++--- 9 files changed, 128 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCEnums.h b/src/server/game/DataStores/DBCEnums.h index b850aa0ef46..33a15c3b457 100755 --- a/src/server/game/DataStores/DBCEnums.h +++ b/src/server/game/DataStores/DBCEnums.h @@ -450,6 +450,12 @@ enum ItemLimitCategoryMode ITEM_LIMIT_CATEGORY_MODE_EQUIP = 1, // limit applied to amount equipped items (including used gems) }; +enum MountFlags +{ + MOUNT_FLAG_CAN_PITCH = 0x4, // client checks MOVEMENTFLAG2_FULL_SPEED_PITCHING + MOUNT_FLAG_CAN_SWIM = 0x8, // client checks MOVEMENTFLAG_SWIMMING +}; + enum TotemCategoryType { TOTEM_CATEGORY_TYPE_KNIFE = 1, diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 3367eac6e7d..0a7b1776bc9 100755 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -140,9 +140,11 @@ DBCStorage sMapDifficultyStore(MapDifficultyEntryfmt); // o MapDifficultyMap sMapDifficultyMap; DBCStorage sMovieStore(MovieEntryfmt); +DBCStorage sMountCapabilityStore(MountCapabilityfmt); +DBCStorage sMountTypeStore(MountTypefmt); DBCStorage sNameGenStore(NameGenfmt); -GenNameVectorArraysMap sGenNameVectoArraysMap; +NameGenVectorArraysMap sGenNameVectoArraysMap; DBCStorage sOverrideSpellDataStore(OverrideSpellDatafmt); @@ -418,6 +420,9 @@ void LoadDBCStores(const std::string& dataPath) sMapDifficultyMap[MAKE_PAIR32(entry->MapId, entry->Difficulty)] = MapDifficulty(entry->resetTime, entry->maxPlayers, entry->areaTriggerText[0] > 0); sMapDifficultyStore.Clear(); + LoadDBC(availableDbcLocales, bad_dbc_files, sMountCapabilityStore, dbcPath, "MountCapability.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sMountTypeStore, dbcPath, "MountType.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sNameGenStore, dbcPath, "NameGen.dbc");//14545 for (uint32 i = 0; i < sNameGenStore.GetNumRows(); ++i) if (NameGenEntry const* entry = sNameGenStore.LookupEntry(i)) diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h index 635d319abbb..5fa8d83fc4b 100755 --- a/src/server/game/DataStores/DBCStores.h +++ b/src/server/game/DataStores/DBCStores.h @@ -140,6 +140,8 @@ extern DBCStorage sLFGDungeonStore; extern DBCStorage sLockStore; extern DBCStorage sMailTemplateStore; extern DBCStorage sMapStore; +extern DBCStorage sMountCapabilityStore; +extern DBCStorage sMountTypeStore; extern DBCStorage sNameGenStore; extern DBCStorage sPhaseStore; //extern DBCStorage sMapDifficultyStore; -- use GetMapDifficultyData insteed diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 0bde8e01359..608824b140f 100755 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -1396,6 +1396,26 @@ struct MapDifficultyEntry //char* difficultyString; // 6 m_difficultystring }; +struct MountCapabilityEntry +{ + uint32 Id; + uint32 Flags; + uint32 RequiredRidingSkill; + uint32 RequiredArea; + uint32 RequiredAura; + uint32 RequiredSpell; + uint32 SpeedModSpell; + int32 RequiredMap; +}; + +#define MAX_MOUNT_CAPABILITIES 24 + +struct MountTypeEntry +{ + uint32 Id; + uint32 MountCapability[MAX_MOUNT_CAPABILITIES]; +}; + struct MovieEntry { uint32 Id; // 0 index @@ -2257,7 +2277,7 @@ struct VectorArray std::vector stringVectorArray[2]; }; -typedef std::map GenNameVectorArraysMap; +typedef std::map NameGenVectorArraysMap; // Structures not used for casting to loaded DBC data and not required then packing struct MapDifficulty diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index b133537a5a3..59af1d0e7c6 100755 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -95,6 +95,8 @@ const char MailTemplateEntryfmt[]="nxs"; const char MapEntryfmt[]="nxixxxsixxixiffxiixx"; const char MapDifficultyEntryfmt[]="diisiix"; const char MovieEntryfmt[]="nxxx"; +const char MountCapabilityfmt[]="niiiiiii"; +const char MountTypefmt[]="niiiiiiiiiiiiiiiiiiiiiiii"; const char NameGenfmt[] = "dsii"; const char OverrideSpellDatafmt[]="niiiiiiiiiixx"; const char QuestSortEntryfmt[]="nx"; diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 034ab9ba92d..430b6adb6ec 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -12018,6 +12018,64 @@ void Unit::Dismount() } } +MountCapabilityEntry const* Unit::GetMountCapability(uint32 mountType) const +{ + if (!mountType) + return NULL; + + MountTypeEntry const* mountTypeEntry = sMountTypeStore.LookupEntry(mountType); + if (!mountTypeEntry) + return NULL; + + uint32 zoneId, areaId; + GetZoneAndAreaId(zoneId, areaId); + uint32 ridingSkill = 5000; + if (GetTypeId() == TYPEID_PLAYER) + ridingSkill = ToPlayer()->GetSkillValue(SKILL_RIDING); + + for (uint32 i = MAX_MOUNT_CAPABILITIES; i > 0; --i) + { + MountCapabilityEntry const* mountCapability = sMountCapabilityStore.LookupEntry(mountTypeEntry->MountCapability[i - 1]); + if (!mountCapability) + continue; + + if (ridingSkill < mountCapability->RequiredRidingSkill) + continue; + + if (HasExtraUnitMovementFlag(MOVEMENTFLAG2_FULL_SPEED_PITCHING)) + { + if (!(mountCapability->Flags & MOUNT_FLAG_CAN_PITCH)) + continue; + } + else if (HasUnitMovementFlag(MOVEMENTFLAG_SWIMMING)) + { + if (!(mountCapability->Flags & MOUNT_FLAG_CAN_SWIM)) + continue; + } + else if (!(mountCapability->Flags & 0x1)) // unknown flags, checked in 4.2.2 14545 client + { + if (!(mountCapability->Flags & 0x2)) + continue; + } + + if (mountCapability->RequiredMap != -1 && GetMapId() != mountCapability->RequiredMap) + continue; + + if (mountCapability->RequiredArea && (mountCapability->RequiredArea != zoneId && mountCapability->RequiredArea != areaId)) + continue; + + if (mountCapability->RequiredAura && !HasAura(mountCapability->RequiredAura)) + continue; + + if (mountCapability->RequiredSpell && (GetTypeId() != TYPEID_PLAYER || !ToPlayer()->HasSpell(mountCapability->RequiredSpell))) + continue; + + return mountCapability; + } + + return NULL; +} + void Unit::SetInCombatWith(Unit* enemy) { Unit* eOwner = enemy->GetCharmerOrOwnerOrSelf(); @@ -16973,7 +17031,7 @@ void Unit::KnockbackFrom(float x, float y, float speedXY, float speedZ) WorldPacket data(SMSG_MOVE_KNOCK_BACK, (1+8+4+4+4+4+4)); uint64 guid = GetGUID(); uint8* bytes = (uint8*)&guid; - + data.WriteByteMask(bytes[5]); data.WriteByteMask(bytes[2]); data.WriteByteMask(bytes[6]); @@ -17313,7 +17371,7 @@ void Unit::JumpTo(float speedXY, float speedZ, bool forward) WorldPacket data(SMSG_MOVE_KNOCK_BACK, (1+8+4+4+4+4+4)); uint64 guid = GetGUID(); uint8* bytes = (uint8*)&guid; - + data.WriteByteMask(bytes[5]); data.WriteByteMask(bytes[2]); data.WriteByteMask(bytes[6]); diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 8274b62145f..21dcb4bf3fe 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1444,6 +1444,7 @@ class Unit : public WorldObject uint32 GetMountID() const { return GetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID); } void Mount(uint32 mount, uint32 vehicleId = 0, uint32 creatureEntry = 0); void Dismount(); + MountCapabilityEntry const* GetMountCapability(uint32 mountType) const; uint16 GetMaxSkillValueForLevel(Unit const* target = NULL) const { return (target ? getLevelForTarget(target) : getLevel()) * 5; } void DealDamageMods(Unit* pVictim, uint32 &damage, uint32* absorb); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index c54f644a43c..8521d48cd9e 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -747,6 +747,10 @@ int32 AuraEffect::CalculateAmount(Unit* caster) if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_DRUID && GetSpellInfo()->SpellFamilyFlags[2] & 0x00000008) amount = GetBase()->GetUnitOwner()->GetShapeshiftForm() == FORM_CAT ? amount : 0; break; + case SPELL_AURA_MOUNTED: + if (MountCapabilityEntry const* mountCapability = GetBase()->GetUnitOwner()->GetMountCapability(uint32(GetMiscValueB()))) + amount = mountCapability->Id; + break; default: break; } @@ -2808,7 +2812,7 @@ void AuraEffect::HandleAuraMounted(AuraApplication const* aurApp, uint8 mode, bo if (target->GetTypeId() == TYPEID_PLAYER) team = target->ToPlayer()->GetTeam(); - uint32 displayID = sObjectMgr->ChooseDisplayId(team, ci); + uint32 displayID = ObjectMgr::ChooseDisplayId(team, ci); sObjectMgr->GetCreatureModelRandomGender(&displayID); //some spell has one aura of mount and one of vehicle @@ -2818,6 +2822,10 @@ void AuraEffect::HandleAuraMounted(AuraApplication const* aurApp, uint8 mode, bo displayID = 0; target->Mount(displayID, ci->VehicleId, GetMiscValue()); + + // cast speed aura + if (MountCapabilityEntry const* mountCapability = target->GetMountCapability(uint32(GetMiscValueB()))) + target->CastSpell(target, mountCapability->SpeedModSpell, true); } else { @@ -2826,7 +2834,13 @@ void AuraEffect::HandleAuraMounted(AuraApplication const* aurApp, uint8 mode, bo // need to remove ALL arura related to mounts, this will stop client crash with broom stick // and never endless flying after using Headless Horseman's Mount if (mode & AURA_EFFECT_HANDLE_REAL) + { target->RemoveAurasByType(SPELL_AURA_MOUNTED); + + // remove speed aura + if (MountCapabilityEntry const* mountCapability = target->GetMountCapability(uint32(GetMiscValueB()))) + target->RemoveAurasDueToSpell(mountCapability->SpeedModSpell, target->GetGUID()); + } } } @@ -4781,7 +4795,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool if (Aura* newAura = target->AddAura(71564, target)) newAura->SetStackAmount(newAura->GetSpellInfo()->StackAmount); break; - case 59628: // Tricks of the Trade + case 59628: // Tricks of the Trade if (caster && caster->GetMisdirectionTarget()) target->SetReducedThreatPercent(100, caster->GetMisdirectionTarget()->GetGUID()); break; @@ -4944,7 +4958,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool target->SetReducedThreatPercent(0,0); else target->SetReducedThreatPercent(0,caster->GetMisdirectionTarget()->GetGUID()); - break; + break; } default: break; diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 44ba17c32cb..ff3d9fcddf3 100755 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -147,6 +147,16 @@ void AuraApplication::_InitFlags(Unit* caster, uint8 effMask) } m_flags |= positiveFound ? AFLAG_POSITIVE : AFLAG_NEGATIVE; } + + // there are more auras that require this flag, this is just the beginning + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) + { + if (((1 << i) & effMask) && GetBase()->GetSpellInfo()->Effects[i].ApplyAuraName == SPELL_AURA_MOUNTED) + { + m_flags |= AFLAG_ANY_EFFECT_AMOUNT_SENT; + break; + } + } } void AuraApplication::_HandleEffect(uint8 effIndex, bool apply) @@ -208,14 +218,9 @@ void AuraApplication::BuildUpdatePacket(ByteBuffer& data, bool remove) const } if (flags & AFLAG_ANY_EFFECT_AMOUNT_SENT) - { - if (flags & AFLAG_EFF_INDEX_0) - data << uint32(0); // Effect 0 value - if (flags & AFLAG_EFF_INDEX_1) - data << uint32(0); // Effect 1 value - if (flags & AFLAG_EFF_INDEX_2) - data << uint32(0); // Effect 2 value - } + for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i) + if (AuraEffect const* eff = aura->GetEffect(i)) // NULL if effect flag not set + data << int32(eff->GetAmount()); } void AuraApplication::ClientUpdate(bool remove) -- cgit v1.2.3 From 23e3d64e9b6c9f468947e92b6835cfe31f73b417 Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Sat, 28 Jan 2012 20:55:28 +0800 Subject: Core/Achievement: update AchievementCriteriaTypes to 4.2.2 Signed-off-by: Gyx <2359980687@qq.com> --- src/server/game/Achievements/AchievementMgr.cpp | 10 --------- src/server/game/DataStores/DBCEnums.h | 30 +++++++++++++------------ 2 files changed, 16 insertions(+), 24 deletions(-) (limited to 'src') diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 40a0be723fe..b72caaccef5 100755 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -1449,14 +1449,6 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui continue; SetCriteriaProgress(achievementCriteria, miscValue2, PROGRESS_ACCUMULATE); break; - // std case: not exist in DBC, not triggered in code as result - case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEALTH: - case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_SPELLPOWER: - case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_ARMOR: - case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_POWER: - case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_STAT: - case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_RATING: - break; // FIXME: not triggered in code as result, need to implement case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_RAID: case ACHIEVEMENT_CRITERIA_TYPE_WIN_ARENA: @@ -1644,9 +1636,7 @@ bool AchievementMgr::IsCompletedCriteria(AchievementCriteriaEntry const* achieve case ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM: case ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED: case ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED: - case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEALTH: case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_SPELLPOWER: - case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_ARMOR: case ACHIEVEMENT_CRITERIA_TYPE_QUEST_ABANDONED: case ACHIEVEMENT_CRITERIA_TYPE_FLIGHT_PATHS_TAKEN: case ACHIEVEMENT_CRITERIA_TYPE_ACCEPTED_SUMMONINGS: diff --git a/src/server/game/DataStores/DBCEnums.h b/src/server/game/DataStores/DBCEnums.h index 33a15c3b457..bb280140767 100755 --- a/src/server/game/DataStores/DBCEnums.h +++ b/src/server/game/DataStores/DBCEnums.h @@ -193,6 +193,7 @@ enum AchievementCriteriaTypes { ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE = 0, ACHIEVEMENT_CRITERIA_TYPE_WIN_BG = 1, + ACHIEVEMENT_CRITERIA_TYPE_UNK3 = 3, // struct { uint32 itemCount; } ACHIEVEMENT_CRITERIA_TYPE_REACH_LEVEL = 5, ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL = 7, ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT = 8, @@ -222,7 +223,6 @@ enum AchievementCriteriaTypes ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL = 34, ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL = 35, ACHIEVEMENT_CRITERIA_TYPE_OWN_ITEM = 36, - // TODO: the archievements 1162 and 1163 requires a special rating which can't be found in the dbc ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA = 37, ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_TEAM_RATING = 38, ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_PERSONAL_RATING = 39, @@ -279,12 +279,6 @@ enum AchievementCriteriaTypes ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM = 91, ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED = 93, ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED = 94, - ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEALTH = 95, - ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_POWER = 96, - ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_STAT = 97, - ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_SPELLPOWER = 98, - ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_ARMOR = 99, - ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_RATING = 100, ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HIT_DEALT = 101, ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HIT_RECEIVED = 102, ACHIEVEMENT_CRITERIA_TYPE_TOTAL_DAMAGE_RECEIVED = 103, @@ -300,11 +294,12 @@ enum AchievementCriteriaTypes ACHIEVEMENT_CRITERIA_TYPE_EARN_HONORABLE_KILL = 113, ACHIEVEMENT_CRITERIA_TYPE_ACCEPTED_SUMMONINGS = 114, ACHIEVEMENT_CRITERIA_TYPE_EARN_ACHIEVEMENT_POINTS = 115, + ACHIEVEMENT_CRITERIA_TYPE_UNK118 = 118, ACHIEVEMENT_CRITERIA_TYPE_USE_LFD_TO_GROUP_WITH_PLAYERS = 119, - // 120 - - // 121 - - // 122 - - // 123 - + ACHIEVEMENT_CRITERIA_TYPE_UNK120 = 120, + ACHIEVEMENT_CRITERIA_TYPE_UNK121 = 121, + ACHIEVEMENT_CRITERIA_TYPE_UNK122 = 122, + ACHIEVEMENT_CRITERIA_TYPE_UNK123 = 123, ACHIEVEMENT_CRITERIA_TYPE_SPENT_GOLD_GUILD_REPAIRS = 124, ACHIEVEMENT_CRITERIA_TYPE_REACH_GUILD_LEVEL = 125, ACHIEVEMENT_CRITERIA_TYPE_CRAFT_ITEMS_GUILD = 126, @@ -312,14 +307,21 @@ enum AchievementCriteriaTypes ACHIEVEMENT_CRITERIA_TYPE_BUY_GUILD_BANK_SLOTS = 128, ACHIEVEMENT_CRITERIA_TYPE_EARN_GUILD_ACHIEVEMENT_POINTS = 129, ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_BATTLEGROUND = 130, - // 131 - ACHIEVEMENT_CRITERIA_TYPE_REACH_BG_RATING = 132, ACHIEVEMENT_CRITERIA_TYPE_BUY_GUILD_TABARD = 133, ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUESTS_GUILD = 134, ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILLS_GUILD = 135, ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE_TYPE_GUILD = 136, - // 0..136 => 137 criteria types total - ACHIEVEMENT_CRITERIA_TYPE_TOTAL = 137, + ACHIEVEMENT_CRITERIA_TYPE_UNK137 = 137, + ACHIEVEMENT_CRITERIA_TYPE_UNK138 = 138, //struct { Flag flag; uint32 count; } 1: Guild Dungeon, 2:Guild Challenge, 3:Guild battlefield + ACHIEVEMENT_CRITERIA_TYPE_UNK139 = 139, //struct { uint32 count; } Guild Challenge + ACHIEVEMENT_CRITERIA_TYPE_UNK140 = 140, + ACHIEVEMENT_CRITERIA_TYPE_UNK141 = 141, + ACHIEVEMENT_CRITERIA_TYPE_UNK142 = 142, + ACHIEVEMENT_CRITERIA_TYPE_UNK143 = 143, + ACHIEVEMENT_CRITERIA_TYPE_UNK144 = 144, + // 0..144 => 145 criteria types total + ACHIEVEMENT_CRITERIA_TYPE_TOTAL = 145, }; enum AchievementCategory -- cgit v1.2.3 From a6473889620bcc2bd40ec88e51f25251d68024a9 Mon Sep 17 00:00:00 2001 From: Gyx <2359980687@qq.com> Date: Sat, 28 Jan 2012 21:37:08 +0800 Subject: Core/Misc: Typo... Signed-off-by: Gyx <2359980687@qq.com> --- src/server/game/Achievements/AchievementMgr.cpp | 1 - src/server/game/Achievements/AchievementMgr.h | 1 - 2 files changed, 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index b72caaccef5..354ee8d1d3b 100755 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -1636,7 +1636,6 @@ bool AchievementMgr::IsCompletedCriteria(AchievementCriteriaEntry const* achieve case ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM: case ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED: case ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED: - case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_SPELLPOWER: case ACHIEVEMENT_CRITERIA_TYPE_QUEST_ABANDONED: case ACHIEVEMENT_CRITERIA_TYPE_FLIGHT_PATHS_TAKEN: case ACHIEVEMENT_CRITERIA_TYPE_ACCEPTED_SUMMONINGS: diff --git a/src/server/game/Achievements/AchievementMgr.h b/src/server/game/Achievements/AchievementMgr.h index 5797fe06cd5..7e0f715f2d2 100755 --- a/src/server/game/Achievements/AchievementMgr.h +++ b/src/server/game/Achievements/AchievementMgr.h @@ -59,7 +59,6 @@ enum AchievementCriteriaDataType ACHIEVEMENT_CRITERIA_DATA_TYPE_BG_LOSS_TEAM_SCORE = 17, // min_score max_score player's team win bg and opposition team have team score in range ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT = 18, // 0 0 maker instance script call for check current criteria requirements fit ACHIEVEMENT_CRITERIA_DATA_TYPE_S_EQUIPED_ITEM = 19, // item_level item_quality for equipped item in slot to check item level and quality - MAX_ACHIEVEMENT_CRITERIA_DATA_TYPE, ACHIEVEMENT_CRITERIA_DATA_TYPE_S_PLAYER_CLASS_RACE = 21, // class_id race_id }; -- cgit v1.2.3 From 05c8dd3042cd966e23ffa02a43860c1e178662b3 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 28 Jan 2012 19:50:50 +0100 Subject: Core/DBCs: Fixed memory corruption caused by out of bounds array access --- src/server/game/DataStores/DBCStructure.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 608824b140f..d57b6d68115 100755 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -2336,6 +2336,6 @@ struct TaxiPathNodePtr typedef Path TaxiPathNodeList; typedef std::vector TaxiPathNodesByPath; -#define TaxiMaskSize 14 +#define TaxiMaskSize 25 typedef uint32 TaxiMask[TaxiMaskSize]; #endif -- cgit v1.2.3 From 8e7e10dd7d04f6e3be08772ed0fd5ab6fc5a41ae Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 29 Jan 2012 01:03:13 +0000 Subject: Core/Opcodes: 3 opcodes by Kaelima --- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- src/server/game/Server/Protocol/Opcodes.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index ba861b2bd2e..e1aaaf1dbef 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -853,7 +853,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_ACTIONS_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_ACTIONS_STOP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_FACTION_INACTIVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetFactionInactiveOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_WATCHED_FACTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetWatchedFactionOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_SET_WATCHED_FACTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetWatchedFactionOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SKIP_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SET_EXPLORATION_ALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index c5106311db2..8f9761c3b7c 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -342,7 +342,7 @@ enum Opcodes CMSG_PLAYER_DIFFICULTY_CHANGE = 0x00, CMSG_PLAYER_LOGIN = 0x0898, CMSG_PLAYER_LOGOUT = 0x1CEE, - CMSG_PLAYER_VEHICLE_ENTER = 0x00, + CMSG_PLAYER_VEHICLE_ENTER = 0x0A62, CMSG_PUSHQUESTTOPARTY = 0xA47, CMSG_QUERY_GUILD_MAX_XP = 0x00, CMSG_QUERY_GUILD_REWARDS = 0x00, @@ -403,6 +403,7 @@ enum Opcodes CMSG_SET_ALLOW_LOW_LEVEL_RAID2 = 0x4CE7, CMSG_SET_CHANNEL_WATCH = 0x9CFB, CMSG_SET_CONTACT_NOTES = 0x1AF3, + CMSG_SET_FACTION_ATWAR = 0x4AD2, CMSG_SET_FACTION_CHEAT = 0x00, CMSG_SET_GUILD_BANK_TEXT = 0x00, CMSG_SET_LFG_COMMENT = 0x00, @@ -415,6 +416,7 @@ enum Opcodes CMSG_SET_TITLE = 0xCE63, CMSG_SET_TRADE_GOLD = 0x27A4, CMSG_SET_TRADE_ITEM = 0x00, + CMSG_SET_WATCHED_FACTION = 0x5CD3, CMSG_SETDEATHBINDPOINT = 0x00, CMSG_SETSHEATHED = 0xCA5F, CMSG_SHOWING_CLOAK = 0x8AE3, -- cgit v1.2.3 From 20595bf97d20628ec7dbe27a26a069ef7b24ce5c Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 29 Jan 2012 12:01:59 +0100 Subject: Core/Auras: Updated handlers array (added new auras, unhandled for now) --- src/server/game/Spells/Auras/SpellAuraDefines.h | 9 +++++ src/server/game/Spells/Auras/SpellAuraEffects.cpp | 46 +++++++++++++++++++++++ 2 files changed, 55 insertions(+) (limited to 'src') diff --git a/src/server/game/Spells/Auras/SpellAuraDefines.h b/src/server/game/Spells/Auras/SpellAuraDefines.h index c5540052fb3..f9dc4bd1c87 100755 --- a/src/server/game/Spells/Auras/SpellAuraDefines.h +++ b/src/server/game/Spells/Auras/SpellAuraDefines.h @@ -413,6 +413,15 @@ enum AuraType SPELL_AURA_351 = 351, SPELL_AURA_352 = 352, SPELL_AURA_MOD_CAMOUFLAGE = 353, // NYI + SPELL_AURA_354 = 353, + SPELL_AURA_355 = 354, + SPELL_AURA_356 = 356, + SPELL_AURA_357 = 357, + SPELL_AURA_358 = 358, + SPELL_AURA_359 = 359, + SPELL_AURA_360 = 360, + SPELL_AURA_361 = 361, + SPELL_AURA_362 = 362, TOTAL_AURAS = 363 // 4.2.2 }; diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 8521d48cd9e..c1fcfc6d244 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -370,6 +370,52 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandlePreventResurrection, //314 SPELL_AURA_PREVENT_RESURRECTION todo &AuraEffect::HandleNoImmediateEffect, //315 SPELL_AURA_UNDERWATER_WALKING todo &AuraEffect::HandleNoImmediateEffect, //316 SPELL_AURA_PERIODIC_HASTE implemented in AuraEffect::CalculatePeriodic + &AuraEffect::HandleNULL, //317 SPELL_AURA_MOD_SPELL_POWER_PCT + &AuraEffect::HandleNULL, //318 SPELL_AURA_MASTERY + &AuraEffect::HandleNULL, //319 SPELL_AURA_319 + &AuraEffect::HandleNULL, //320 SPELL_AURA_MOD_RANGED_ATTACK_SPEED + &AuraEffect::HandleNULL, //321 SPELL_AURA_321 + &AuraEffect::HandleNULL, //322 SPELL_AURA_INTERFERE_TARGETTING + &AuraEffect::HandleNULL, //323 SPELL_AURA_323 + &AuraEffect::HandleNULL, //324 SPELL_AURA_324 + &AuraEffect::HandleNULL, //325 SPELL_AURA_325 + &AuraEffect::HandleNULL, //326 SPELL_AURA_326 + &AuraEffect::HandleNULL, //327 SPELL_AURA_327 + &AuraEffect::HandleNULL, //328 SPELL_AURA_328 + &AuraEffect::HandleNULL, //329 SPELL_AURA_MOD_RUNE_REGEN_SPEED + &AuraEffect::HandleNULL, //330 SPELL_AURA_CAST_WHILE_WALKING + &AuraEffect::HandleNULL, //331 SPELL_AURA_331 + &AuraEffect::HandleNULL, //332 SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS + &AuraEffect::HandleNULL, //333 SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS_2 + &AuraEffect::HandleNULL, //334 SPELL_AURA_334 + &AuraEffect::HandleNULL, //335 SPELL_AURA_335 + &AuraEffect::HandleNULL, //336 SPELL_AURA_MOD_FLYING_RESTRICTIONS + &AuraEffect::HandleNULL, //337 SPELL_AURA_MOD_VENDOR_ITEMS_PRICES + &AuraEffect::HandleNULL, //338 SPELL_AURA_MOD_DURABILITY_LOSS + &AuraEffect::HandleNULL, //339 SPELL_AURA_INCREASE_SKILL_GAIN_CHANCE + &AuraEffect::HandleNULL, //340 SPELL_AURA_340 + &AuraEffect::HandleNULL, //341 SPELL_AURA_341 + &AuraEffect::HandleNULL, //342 SPELL_AURA_MOD_TIME_BETWEEN_ATTACKS + &AuraEffect::HandleNULL, //343 SPELL_AURA_343 + &AuraEffect::HandleNULL, //344 SPELL_AURA_MOD_AUTOATTACK_DAMAGE + &AuraEffect::HandleNULL, //345 SPELL_AURA_BYPASS_ARMOR_FOR_CASTER + &AuraEffect::HandleNULL, //346 SPELL_AURA_PROGRESS_BAR + &AuraEffect::HandleNULL, //347 SPELL_AURA_MOD_SPELL_COOLDOWN_BY_HASTE + &AuraEffect::HandleNULL, //348 SPELL_AURA_DEPOSIT_BONUS_MONEY_IN_GUILD_BANK_ON_LOOT + &AuraEffect::HandleNULL, //349 SPELL_AURA_MOD_CURRENCY_GAIN + &AuraEffect::HandleNULL, //350 SPELL_AURA_MOD_GATHERING_ITEMS_GAINED_PERCENT + &AuraEffect::HandleNULL, //351 SPELL_AURA_351 + &AuraEffect::HandleNULL, //352 SPELL_AURA_352 + &AuraEffect::HandleNULL, //353 SPELL_AURA_MOD_CAMOUFLAGE + &AuraEffect::HandleNULL, //353 SPELL_AURA_354 + &AuraEffect::HandleNULL, //354 SPELL_AURA_355 + &AuraEffect::HandleNULL, //356 SPELL_AURA_356 + &AuraEffect::HandleNULL, //357 SPELL_AURA_357 + &AuraEffect::HandleNULL, //358 SPELL_AURA_358 + &AuraEffect::HandleNULL, //359 SPELL_AURA_359 + &AuraEffect::HandleNULL, //360 SPELL_AURA_360 + &AuraEffect::HandleNULL, //361 SPELL_AURA_361 + &AuraEffect::HandleNULL, //362 SPELL_AURA_362 }; AuraEffect::AuraEffect(Aura* base, uint8 effIndex, int32 *baseAmount, Unit* caster): -- cgit v1.2.3 From e7064803bb3cacf161c67630e0972539ac28888f Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 29 Jan 2012 12:12:34 +0100 Subject: Typo fix --- src/server/game/Spells/Auras/SpellAuraDefines.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Spells/Auras/SpellAuraDefines.h b/src/server/game/Spells/Auras/SpellAuraDefines.h index f9dc4bd1c87..c8e41d1fcfa 100755 --- a/src/server/game/Spells/Auras/SpellAuraDefines.h +++ b/src/server/game/Spells/Auras/SpellAuraDefines.h @@ -413,8 +413,8 @@ enum AuraType SPELL_AURA_351 = 351, SPELL_AURA_352 = 352, SPELL_AURA_MOD_CAMOUFLAGE = 353, // NYI - SPELL_AURA_354 = 353, - SPELL_AURA_355 = 354, + SPELL_AURA_354 = 354, + SPELL_AURA_355 = 355, SPELL_AURA_356 = 356, SPELL_AURA_357 = 357, SPELL_AURA_358 = 358, -- cgit v1.2.3 From ef471da666c39025fa9a44338c1d4071fbca3a9a Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 29 Jan 2012 17:40:14 +0100 Subject: Core/Player: Updated talent system for cataclysm --- sql/base/characters_database.sql | 1 + .../2012_01_29_00_.characters_characters.sql | 1 + src/server/game/Chat/Commands/Level3.cpp | 2 +- src/server/game/DataStores/DBCStores.cpp | 27 +- src/server/game/DataStores/DBCStores.h | 2 + src/server/game/DataStores/DBCStructure.h | 14 + src/server/game/DataStores/DBCfmt.h | 2 + src/server/game/Entities/Player/Player.cpp | 414 +++++++++++---------- src/server/game/Entities/Player/Player.h | 98 +++-- src/server/game/Miscellaneous/SharedDefines.h | 5 +- .../Server/Protocol/Handlers/CharacterHandler.cpp | 4 +- .../game/Server/Protocol/Handlers/SkillHandler.cpp | 28 +- .../game/Server/Protocol/Handlers/SpellHandler.cpp | 1 + src/server/game/Server/Protocol/Opcodes.cpp | 12 +- src/server/game/Spells/SpellEffects.cpp | 16 +- .../Database/Implementation/CharacterDatabase.cpp | 8 +- 16 files changed, 390 insertions(+), 245 deletions(-) create mode 100644 sql/updates/characters/2012_01_29_00_.characters_characters.sql (limited to 'src') diff --git a/sql/base/characters_database.sql b/sql/base/characters_database.sql index bce0a211b3c..5cd0db50dcb 100644 --- a/sql/base/characters_database.sql +++ b/sql/base/characters_database.sql @@ -1127,6 +1127,7 @@ CREATE TABLE `characters` ( `rest_bonus` float NOT NULL DEFAULT '0', `resettalents_cost` int(10) unsigned NOT NULL DEFAULT '0', `resettalents_time` int(10) unsigned NOT NULL DEFAULT '0', + `talentTree` smallint(5) unsigned NOT NULL DEFAULT '0', `trans_x` float NOT NULL DEFAULT '0', `trans_y` float NOT NULL DEFAULT '0', `trans_z` float NOT NULL DEFAULT '0', diff --git a/sql/updates/characters/2012_01_29_00_.characters_characters.sql b/sql/updates/characters/2012_01_29_00_.characters_characters.sql new file mode 100644 index 00000000000..baaf37ac467 --- /dev/null +++ b/sql/updates/characters/2012_01_29_00_.characters_characters.sql @@ -0,0 +1 @@ +ALTER TABLE `characters` ADD `talentTree` smallint(5) UNSIGNED NOT NULL DEFAULT 0 AFTER `resettalents_time`; diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp index ee07c034b15..df35a8ed906 100755 --- a/src/server/game/Chat/Commands/Level3.cpp +++ b/src/server/game/Chat/Commands/Level3.cpp @@ -2627,7 +2627,7 @@ bool ChatHandler::HandleResetTalentsCommand(const char* args) if (target) { - target->resetTalents(true); + target->ResetTalents(true); target->SendTalentsInfoData(false); ChatHandler(target).SendSysMessage(LANG_RESET_TALENTS); if (!m_session || m_session->GetPlayer() != target) diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 0a7b1776bc9..98b21355504 100755 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -145,6 +145,7 @@ DBCStorage sMountTypeStore(MountTypefmt); DBCStorage sNameGenStore(NameGenfmt); NameGenVectorArraysMap sGenNameVectoArraysMap; +DBCStorage sNumTalentsAtLevelStore(NumTalentsAtLevelfmt); DBCStorage sOverrideSpellDataStore(OverrideSpellDatafmt); @@ -203,6 +204,9 @@ DBCStorage sSummonPropertiesStore(SummonPropertiesfmt); DBCStorage sTalentStore(TalentEntryfmt); TalentSpellPosMap sTalentSpellPosMap; DBCStorage sTalentTabStore(TalentTabEntryfmt); +DBCStorage sTalentTreePrimarySpellsStore(TalentTreePrimarySpellsfmt); +typedef std::map > TalentTreePrimarySpellsMap; +TalentTreePrimarySpellsMap sTalentTreePrimarySpellsMap; // store absolute bit position for first rank for talent inspect static uint32 sTalentTabPages[MAX_CLASSES][3]; @@ -428,6 +432,7 @@ void LoadDBCStores(const std::string& dataPath) if (NameGenEntry const* entry = sNameGenStore.LookupEntry(i)) sGenNameVectoArraysMap[entry->race].stringVectorArray[entry->gender].push_back(std::string(entry->name)); sNameGenStore.Clear(); + LoadDBC(availableDbcLocales, bad_dbc_files, sNumTalentsAtLevelStore, dbcPath, "NumTalentsAtLevel.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sMovieStore, dbcPath, "Movie.dbc");//14545 @@ -584,13 +589,18 @@ void LoadDBCStores(const std::string& dataPath) continue; // store class talent tab pages - uint32 cls = 1; - for (uint32 m=1; !(m & talentTabInfo->ClassMask) && cls < MAX_CLASSES; m <<= 1, ++cls) {} - - sTalentTabPages[cls][talentTabInfo->tabpage]=talentTabId; + for (uint32 cls = 1; cls < MAX_CLASSES; ++cls) + if (talentTabInfo->ClassMask & (1 << (cls - 1))) + sTalentTabPages[cls][talentTabInfo->tabpage] = talentTabId; } } + LoadDBC(availableDbcLocales, bad_dbc_files, sTalentTreePrimarySpellsStore, dbcPath, "TalentTreePrimarySpells.dbc"); + for (uint32 i = 0; i < sTalentTreePrimarySpellsStore.GetNumRows(); ++i) + if (TalentTreePrimarySpellsEntry const* talentSpell = sTalentTreePrimarySpellsStore.LookupEntry(i)) + sTalentTreePrimarySpellsMap[talentSpell->TalentTree].push_back(talentSpell->SpellId); + sTalentTreePrimarySpellsStore.Clear(); + LoadDBC(availableDbcLocales, bad_dbc_files, sTaxiNodesStore, dbcPath, "TaxiNodes.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sTaxiPathStore, dbcPath, "TaxiPath.dbc");//14545 for (uint32 i = 1; i < sTaxiPathStore.GetNumRows(); ++i) @@ -985,6 +995,15 @@ uint32 const* GetTalentTabPages(uint8 cls) return sTalentTabPages[cls]; } +std::vector const* GetTalentTreePrimarySpells(uint32 talentTree) +{ + TalentTreePrimarySpellsMap::const_iterator itr = sTalentTreePrimarySpellsMap.find(talentTree); + if (itr == sTalentTreePrimarySpellsMap.end()) + return NULL; + + return &itr->second; +} + uint32 ScalingStatValuesEntry::GetStatMultiplier(uint32 inventoryType) const { if (inventoryType < MAX_INVTYPE) diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h index 5fa8d83fc4b..f77f6195aea 100755 --- a/src/server/game/DataStores/DBCStores.h +++ b/src/server/game/DataStores/DBCStores.h @@ -65,6 +65,7 @@ MapDifficulty const* GetMapDifficultyData(uint32 mapId, Difficulty difficulty); MapDifficulty const* GetDownscaledMapDifficultyData(uint32 mapId, Difficulty &difficulty); uint32 const* /*[MAX_TALENT_TABS]*/ GetTalentTabPages(uint8 cls); +std::vector const* GetTalentTreePrimarySpells(uint32 talentTree); PvPDifficultyEntry const* GetBattlegroundBracketByLevel(uint32 mapid, uint32 level); PvPDifficultyEntry const* GetBattlegroundBracketById(uint32 mapid, BattlegroundBracketId id); @@ -143,6 +144,7 @@ extern DBCStorage sMapStore; extern DBCStorage sMountCapabilityStore; extern DBCStorage sMountTypeStore; extern DBCStorage sNameGenStore; +extern DBCStorage sNumTalentsAtLevelStore; extern DBCStorage sPhaseStore; //extern DBCStorage sMapDifficultyStore; -- use GetMapDifficultyData insteed extern MapDifficultyMap sMapDifficultyMap; diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index d57b6d68115..37ae10f52cb 100755 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -1432,6 +1432,12 @@ struct NameGenEntry uint32 gender; }; +struct NumTalentsAtLevelEntry +{ + //uint32 Level; // 0 index + float Talents; // 1 talent count +}; + #define MAX_OVERRIDE_SPELL 10 struct OverrideSpellDataEntry @@ -2022,6 +2028,14 @@ struct TalentTabEntry //uint32 spellIds[2]; // 9-10 passive mastery bonus spells? }; +struct TalentTreePrimarySpellsEntry +{ + //uint32 Id; // 0 index + uint32 TalentTree; // 1 entry from TalentTab.dbc + uint32 SpellId; // 2 spell id to learn + //uint32 Flags; // 3 some kind of flags +}; + struct TaxiNodesEntry { uint32 ID; // 0 m_ID diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index 59af1d0e7c6..81f6e1a75a0 100755 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -98,6 +98,7 @@ const char MovieEntryfmt[]="nxxx"; const char MountCapabilityfmt[]="niiiiiii"; const char MountTypefmt[]="niiiiiiiiiiiiiiiiiiiiiiii"; const char NameGenfmt[] = "dsii"; +const char NumTalentsAtLevelfmt[]="df"; const char OverrideSpellDatafmt[]="niiiiiiiiiixx"; const char QuestSortEntryfmt[]="nx"; const char QuestXPfmt[]="niiiiiiiiii"; @@ -144,6 +145,7 @@ const char StableSlotPricesfmt[] = "ni"; const char SummonPropertiesfmt[] = "niiiii"; const char TalentEntryfmt[]="niiiiiiiiixxixxxxxx"; const char TalentTabEntryfmt[]="nxxiiixxxxx"; +const char TalentTreePrimarySpellsfmt[]="diix"; const char TaxiNodesEntryfmt[]="nifffsiixxx"; const char TaxiPathEntryfmt[]="niii"; const char TaxiPathNodeEntryfmt[]="diiifffiiii"; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index cdb9ddbcd9b..22bd1846bb5 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -663,9 +663,6 @@ Player::Player(WorldSession* session): Unit(true), m_achievementMgr(this), m_rep m_comboTarget = 0; m_comboPoints = 0; - m_usedTalentCount = 0; - m_questRewardTalentCount = 0; - m_regenTimer = 0; m_regenTimerCount = 0; m_weaponChangeTimer = 0; @@ -766,8 +763,6 @@ Player::Player(WorldSession* session): Unit(true), m_achievementMgr(this), m_rep unReadMails = 0; m_nextMailDelivereTime = 0; - m_resetTalentsCost = 0; - m_resetTalentsTime = 0; m_itemUpdateQueueBlocked = false; for (uint8 i = 0; i < MAX_MOVE_TYPE; ++i) @@ -783,19 +778,7 @@ Player::Player(WorldSession* session): Unit(true), m_achievementMgr(this), m_rep m_raidDifficulty = RAID_DIFFICULTY_10MAN_NORMAL; m_lastPotionId = 0; - - m_activeSpec = 0; - m_specsCount = 1; - - m_freeTalentPoints = 0; - - for (uint8 i = 0; i < MAX_TALENT_SPECS; ++i) - { - for (uint8 g = 0; g < MAX_GLYPH_SLOT_INDEX; ++g) - m_Glyphs[i][g] = 0; - - m_talents[i] = new PlayerTalentMap(); - } + _talentMgr = new PlayerTalentInfo(); for (uint8 i = 0; i < BASEMOD_END; ++i) { @@ -857,7 +840,7 @@ Player::Player(WorldSession* session): Unit(true), m_achievementMgr(this), m_rep SetPendingBind(0, 0); } -Player::~Player () +Player::~Player() { // it must be unloaded already in PlayerLogout and accessed only for loggined player //m_social = NULL; @@ -869,12 +852,7 @@ Player::~Player () for (PlayerSpellMap::const_iterator itr = m_spells.begin(); itr != m_spells.end(); ++itr) delete itr->second; - for (uint8 i = 0; i < MAX_TALENT_SPECS; ++i) - { - for (PlayerTalentMap::const_iterator itr = m_talents[i]->begin(); itr != m_talents[i]->end(); ++itr) - delete itr->second; - delete m_talents[i]; - } + delete _talentMgr; //all mailed items should be deleted, also all mail should be deallocated for (PlayerMails::iterator itr = m_mail.begin(); itr != m_mail.end(); ++itr) @@ -2128,7 +2106,7 @@ void Player::SendSetFlyPacket(bool apply) data.WriteByteSeq(bytes[6]); data.WriteByteSeq(bytes[2]); } - else + else { data.WriteBit(bytes[1]); data.WriteBit(bytes[6]); @@ -3189,33 +3167,33 @@ void Player::InitTalentForLevel() if (level < 10) { // Remove all talent points - if (m_usedTalentCount > 0) // Free any used talents + if (GetUsedTalentCount() > 0) // Free any used talents { - resetTalents(true); + ResetTalents(true); SetFreeTalentPoints(0); } } else { - if (level < sWorld->getIntConfig(CONFIG_MIN_DUALSPEC_LEVEL) || m_specsCount == 0) + if (level < sWorld->getIntConfig(CONFIG_MIN_DUALSPEC_LEVEL) || GetSpecsCount() == 0) { - m_specsCount = 1; - m_activeSpec = 0; + SetSpecsCount(1); + SetActiveSpec(0); } uint32 talentPointsForLevel = CalculateTalentsPoints(); // if used more that have then reset - if (m_usedTalentCount > talentPointsForLevel) + if (GetUsedTalentCount() > talentPointsForLevel) { if (!AccountMgr::IsAdminAccount(GetSession()->GetSecurity())) - resetTalents(true); + ResetTalents(true); else SetFreeTalentPoints(0); } // else update amount of free points else - SetFreeTalentPoints(talentPointsForLevel - m_usedTalentCount); + SetFreeTalentPoints(talentPointsForLevel - GetUsedTalentCount()); } if (!GetSession()->PlayerLoading()) @@ -3560,8 +3538,8 @@ bool Player::AddTalent(uint32 spellId, uint8 spec, bool learning) return false; } - PlayerTalentMap::iterator itr = m_talents[spec]->find(spellId); - if (itr != m_talents[spec]->end()) + PlayerTalentMap::iterator itr = GetTalentMap(spec)->find(spellId); + if (itr != GetTalentMap(spec)->end()) itr->second->state = PLAYERSPELL_UNCHANGED; else if (TalentSpellPos const* talentPos = GetTalentSpellPos(spellId)) { @@ -3574,8 +3552,8 @@ bool Player::AddTalent(uint32 spellId, uint8 spec, bool learning) if (!rankSpellId || rankSpellId == spellId) continue; - itr = m_talents[spec]->find(rankSpellId); - if (itr != m_talents[spec]->end()) + itr = GetTalentMap(spec)->find(rankSpellId); + if (itr != GetTalentMap(spec)->end()) itr->second->state = PLAYERSPELL_REMOVED; } } @@ -3586,7 +3564,7 @@ bool Player::AddTalent(uint32 spellId, uint8 spec, bool learning) newtalent->state = state; newtalent->spec = spec; - (*m_talents[spec])[spellId] = newtalent; + (*GetTalentMap(spec))[spellId] = newtalent; return true; } return false; @@ -3860,7 +3838,7 @@ bool Player::addSpell(uint32 spellId, bool active, bool learning, bool dependent } // update used talent points count - m_usedTalentCount += talentCost; + SetUsedTalentCount(GetUsedTalentCount() + talentCost); // update free primary prof.points (if any, can be none in case GM .learn prof. learning) if (uint32 freeProfs = GetFreePrimaryProfessionPoints()) @@ -4096,10 +4074,10 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank) uint32 talentCosts = GetTalentSpellCost(spell_id); if (talentCosts > 0 && giveTalentPoints) { - if (talentCosts < m_usedTalentCount) - m_usedTalentCount -= talentCosts; + if (talentCosts < GetUsedTalentCount()) + SetUsedTalentCount(GetUsedTalentCount() - talentCosts); else - m_usedTalentCount = 0; + SetUsedTalentCount(0); } // update free primary prof.points (if not overflow setting, can be in case GM use before .learn prof. learning) @@ -4442,31 +4420,31 @@ void Player::_SaveSpellCooldowns(SQLTransaction& trans) trans->Append(ss.str().c_str()); } -uint32 Player::resetTalentsCost() const +uint32 Player::GetNextResetTalentsCost() const { // The first time reset costs 1 gold - if (m_resetTalentsCost < 1*GOLD) + if (GetTalentResetCost() < 1*GOLD) return 1*GOLD; // then 5 gold - else if (m_resetTalentsCost < 5*GOLD) + else if (GetTalentResetCost() < 5*GOLD) return 5*GOLD; // After that it increases in increments of 5 gold - else if (m_resetTalentsCost < 10*GOLD) + else if (GetTalentResetCost() < 10*GOLD) return 10*GOLD; else { - uint64 months = (sWorld->GetGameTime() - m_resetTalentsTime)/MONTH; + uint64 months = (sWorld->GetGameTime() - GetTalentResetTime())/MONTH; if (months > 0) { // This cost will be reduced by a rate of 5 gold per month - int32 new_cost = int32(m_resetTalentsCost - 5*GOLD*months); + int32 new_cost = int32(GetTalentResetCost() - 5*GOLD*months); // to a minimum of 10 gold. return (new_cost < 10*GOLD ? 10*GOLD : new_cost); } else { // After that it increases in increments of 5 gold - int32 new_cost = m_resetTalentsCost + 5*GOLD; + int32 new_cost = GetTalentResetCost() + 5*GOLD; // until it hits a cap of 50 gold. if (new_cost > 50*GOLD) new_cost = 50*GOLD; @@ -4475,7 +4453,7 @@ uint32 Player::resetTalentsCost() const } } -bool Player::resetTalents(bool no_cost) +bool Player::ResetTalents(bool no_cost) { sScriptMgr->OnPlayerTalentsReset(this, no_cost); @@ -4485,7 +4463,7 @@ bool Player::resetTalents(bool no_cost) uint32 talentPointsForLevel = CalculateTalentsPoints(); - if (m_usedTalentCount == 0) + if (!GetUsedTalentCount()) { SetFreeTalentPoints(talentPointsForLevel); return false; @@ -4495,7 +4473,7 @@ bool Player::resetTalents(bool no_cost) if (!no_cost && !sWorld->getBoolConfig(CONFIG_NO_RESET_TALENT_COST)) { - cost = resetTalentsCost(); + cost = GetNextResetTalentsCost(); if (!HasEnoughMoney(cost)) { @@ -4535,27 +4513,37 @@ bool Player::resetTalents(bool no_cost) if (_spellEntry->Effects[i].TriggerSpell > 0 && _spellEntry->Effects[i].Effect == SPELL_EFFECT_LEARN_SPELL) removeSpell(_spellEntry->Effects[i].TriggerSpell, true); // and remove any spells that the talent teaches // if this talent rank can be found in the PlayerTalentMap, mark the talent as removed so it gets deleted - PlayerTalentMap::iterator plrTalent = m_talents[m_activeSpec]->find(talentInfo->RankID[rank]); - if (plrTalent != m_talents[m_activeSpec]->end()) + PlayerTalentMap::iterator plrTalent = GetTalentMap(GetActiveSpec())->find(talentInfo->RankID[rank]); + if (plrTalent != GetTalentMap(GetActiveSpec())->end()) plrTalent->second->state = PLAYERSPELL_REMOVED; } } + // Remove spec specific spells + for (uint32 i = 0; i < MAX_TALENT_TABS; ++i) + { + std::vector const* specSpells = GetTalentTreePrimarySpells(GetTalentTabPages(getClass())[i]); + if (specSpells) + for (size_t i = 0; i < specSpells->size(); ++i) + removeSpell(specSpells->at(i), true); + } + + SetPrimaryTalentTree(0); + SetFreeTalentPoints(talentPointsForLevel); + SQLTransaction trans = CharacterDatabase.BeginTransaction(); _SaveTalents(trans); _SaveSpells(trans); CharacterDatabase.CommitTransaction(trans); - SetFreeTalentPoints(talentPointsForLevel); - if (!no_cost) { ModifyMoney(-(int32)cost); GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TALENTS, cost); GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_NUMBER_OF_TALENT_RESETS, 1); - m_resetTalentsCost = cost; - m_resetTalentsTime = time(NULL); + SetTalentResetCost(cost); + SetTalentResetTime(time(NULL)); } /* when prev line will dropped use next line @@ -4757,8 +4745,8 @@ bool Player::HasSpell(uint32 spell) const bool Player::HasTalent(uint32 spell, uint8 spec) const { - PlayerTalentMap::const_iterator itr = m_talents[spec]->find(spell); - return (itr != m_talents[spec]->end() && itr->second->state != PLAYERSPELL_REMOVED); + PlayerTalentMap::const_iterator itr = GetTalentMap(spec)->find(spell); + return (itr != GetTalentMap(spec)->end() && itr->second->state != PLAYERSPELL_REMOVED); } bool Player::HasActiveSpell(uint32 spell) const @@ -6707,7 +6695,7 @@ int16 Player::GetSkillTempBonusValue(uint32 skill) const void Player::SendActionButtons(uint32 state) const { - sLog->outDetail("Sending Action Buttons for '%u' spec '%u'", GetGUIDLow(), m_activeSpec); + sLog->outDetail("Sending Action Buttons for '%u' spec '%u'", GetGUIDLow(), GetActiveSpec()); WorldPacket data(SMSG_ACTION_BUTTONS, 1+(MAX_ACTION_BUTTONS*4)); data << uint8(state); @@ -6730,7 +6718,7 @@ void Player::SendActionButtons(uint32 state) const } GetSession()->SendPacket(&data); - sLog->outDetail("Action Buttons for '%u' spec '%u' Sent", GetGUIDLow(), m_activeSpec); + sLog->outDetail("Action Buttons for '%u' spec '%u' Sent", GetGUIDLow(), GetActiveSpec()); } bool Player::IsActionButtonDataValid(uint8 button, uint32 action, uint8 type) @@ -9795,7 +9783,7 @@ void Player::SendTalentWipeConfirm(uint64 guid) { WorldPacket data(MSG_TALENT_WIPE_CONFIRM, (8+4)); data << uint64(guid); - uint32 cost = sWorld->getBoolConfig(CONFIG_NO_RESET_TALENT_COST) ? 0 : resetTalentsCost(); + uint32 cost = sWorld->getBoolConfig(CONFIG_NO_RESET_TALENT_COST) ? 0 : GetNextResetTalentsCost(); data << cost; GetSession()->SendPacket(&data); } @@ -15019,9 +15007,9 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver, SetTitle(titleEntry); } - if (quest->GetBonusTalents()) + if (uint32 talents = quest->GetBonusTalents()) { - m_questRewardTalentCount+=quest->GetBonusTalents(); + AddQuestRewardedTalentCount(talents); InitTalentForLevel(); } @@ -16593,13 +16581,13 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) //QueryResult* result = CharacterDatabase.PQuery("SELECT guid, account, name, race, class, gender, level, xp, money, playerBytes, playerBytes2, playerFlags, " // 12 13 14 15 16 17 18 19 20 21 22 23 24 //"position_x, position_y, position_z, map, orientation, taximask, cinematic, totaltime, leveltime, rest_bonus, logout_time, is_logout_resting, resettalents_cost, " - // 25 26 27 28 29 30 31 32 33 34 35 36 37 38 - //"resettalents_time, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, online, death_expire_time, taxi_path, instance_mode_mask, " - // 39 40 41 42 43 44 45 46 + // 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 + //"resettalents_time, talentTree, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, online, death_expire_time, taxi_path, instance_mode_mask, " + // 40 41 42 43 44 45 46 47 //"conquestPoints, totalHonorPoints, totalKills, todayKills, yesterdayKills, chosenTitle, watchedFaction, drunk, " - // 47 48 49 50 51 52 53 54 55 56 57 + // 48 49 50 51 52 53 54 55 56 57 58 //"health, power1, power2, power3, power4, power5, instance_id, speccount, activespec, exploredZones, equipmentCache, " - // 58 59 60 61 + // 59 60 61 62 //"knownTitles, actionBars, grantableLevels, guildId FROM characters WHERE guid = '%u'", guid); PreparedQueryResult result = holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADFROM); @@ -16665,8 +16653,8 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) SetUInt32Value(UNIT_FIELD_LEVEL, fields[6].GetUInt8()); SetUInt32Value(PLAYER_XP, fields[7].GetUInt32()); - _LoadIntoDataField(fields[56].GetCString(), PLAYER_EXPLORED_ZONES_1, PLAYER_EXPLORED_ZONES_SIZE); - _LoadIntoDataField(fields[58].GetCString(), PLAYER__FIELD_KNOWN_TITLES, KNOWN_TITLES_SIZE*2); + _LoadIntoDataField(fields[57].GetCString(), PLAYER_EXPLORED_ZONES_1, PLAYER_EXPLORED_ZONES_SIZE); + _LoadIntoDataField(fields[59].GetCString(), PLAYER__FIELD_KNOWN_TITLES, KNOWN_TITLES_SIZE*2); SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, DEFAULT_WORLD_OBJECT_SIZE); SetFloatValue(UNIT_FIELD_COMBATREACH, 1.5f); @@ -16682,12 +16670,12 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) SetUInt32Value(PLAYER_BYTES, fields[9].GetUInt32()); SetUInt32Value(PLAYER_BYTES_2, fields[10].GetUInt32()); - SetUInt32Value(PLAYER_BYTES_3, (fields[46].GetUInt16() & 0xFFFE) | fields[5].GetUInt8()); + SetUInt32Value(PLAYER_BYTES_3, (fields[47].GetUInt16() & 0xFFFE) | fields[5].GetUInt8()); SetUInt32Value(PLAYER_FLAGS, fields[11].GetUInt32()); - SetInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, fields[45].GetUInt32()); + SetInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, fields[46].GetUInt32()); // set which actionbars the client has active - DO NOT REMOVE EVER AGAIN (can be changed though, if it does change fieldwise) - SetByteValue(PLAYER_FIELD_BYTES, 2, fields[59].GetUInt8()); + SetByteValue(PLAYER_FIELD_BYTES, 2, fields[60].GetUInt8()); InitDisplayIds(); @@ -16715,21 +16703,21 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) InitPrimaryProfessions(); // to max set before any spell loaded // init saved position, and fix it later if problematic - uint32 transGUID = uint32(fields[30].GetUInt64()); // field type is uint64 but lowguid is saved + uint32 transGUID = uint32(fields[31].GetUInt64()); // field type is uint64 but lowguid is saved Relocate(fields[12].GetFloat(), fields[13].GetFloat(), fields[14].GetFloat(), fields[16].GetFloat()); uint32 mapId = fields[15].GetUInt16(); - uint32 instanceId = fields[53].GetUInt8(); + uint32 instanceId = fields[54].GetUInt8(); - uint32 dungeonDiff = fields[38].GetUInt32() & 0x0F; + uint32 dungeonDiff = fields[39].GetUInt32() & 0x0F; if (dungeonDiff >= MAX_DUNGEON_DIFFICULTY) dungeonDiff = DUNGEON_DIFFICULTY_NORMAL; - uint32 raidDiff = (fields[38].GetUInt8() >> 4) & 0x0F; + uint32 raidDiff = (fields[39].GetUInt8() >> 4) & 0x0F; if (raidDiff >= MAX_RAID_DIFFICULTY) raidDiff = RAID_DIFFICULTY_10MAN_NORMAL; SetDungeonDifficulty(Difficulty(dungeonDiff)); // may be changed in _LoadGroup SetRaidDifficulty(Difficulty(raidDiff)); // may be changed in _LoadGroup - std::string taxi_nodes = fields[37].GetString(); + std::string taxi_nodes = fields[38].GetString(); #define RelocateToHomebind(){ mapId = m_homebindMapId; instanceId = 0; Relocate(m_homebindX, m_homebindY, m_homebindZ); } @@ -16753,11 +16741,11 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) SetArenaTeamInfoField(arena_slot, ArenaTeamInfoType(j), 0); } - SetCurrency(CURRENCY_TYPE_CONQUEST_POINTS, fields[39].GetUInt32()); - SetCurrency(CURRENCY_TYPE_HONOR_POINTS, fields[40].GetUInt32()); - SetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS, fields[41].GetUInt32()); - SetUInt16Value(PLAYER_FIELD_KILLS, 0, fields[42].GetUInt16()); - SetUInt16Value(PLAYER_FIELD_KILLS, 1, fields[43].GetUInt16()); + SetCurrency(CURRENCY_TYPE_CONQUEST_POINTS, fields[40].GetUInt32()); + SetCurrency(CURRENCY_TYPE_HONOR_POINTS, fields[41].GetUInt32()); + SetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS, fields[42].GetUInt32()); + SetUInt16Value(PLAYER_FIELD_KILLS, 0, fields[43].GetUInt16()); + SetUInt16Value(PLAYER_FIELD_KILLS, 1, fields[44].GetUInt16()); _LoadBoundInstances(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADBOUNDINSTANCES)); _LoadInstanceTimeRestrictions(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADINSTANCELOCKTIMES)); @@ -16818,7 +16806,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) else if (transGUID) { m_movementInfo.t_guid = MAKE_NEW_GUID(transGUID, 0, HIGHGUID_MO_TRANSPORT); - m_movementInfo.t_pos.Relocate(fields[26].GetFloat(), fields[27].GetFloat(), fields[28].GetFloat(), fields[29].GetFloat()); + m_movementInfo.t_pos.Relocate(fields[27].GetFloat(), fields[28].GetFloat(), fields[29].GetFloat(), fields[30].GetFloat()); if (!Trinity::IsValidMapCoord( GetPositionX()+m_movementInfo.t_pos.m_positionX, GetPositionY()+m_movementInfo.t_pos.m_positionY, @@ -16996,28 +16984,28 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) m_Played_time[PLAYED_TIME_TOTAL]= fields[19].GetUInt32(); m_Played_time[PLAYED_TIME_LEVEL]= fields[20].GetUInt32(); - m_resetTalentsCost = fields[24].GetUInt32(); - m_resetTalentsTime = time_t(fields[25].GetUInt32()); + SetTalentResetCost(fields[24].GetUInt32()); + SetTalentResetTime(time_t(fields[25].GetUInt32())); m_taxi.LoadTaxiMask(fields[17].GetCString()); // must be before InitTaxiNodesForLevel - uint32 extraflags = fields[31].GetUInt16(); + uint32 extraflags = fields[32].GetUInt16(); - m_stableSlots = fields[32].GetUInt8(); + m_stableSlots = fields[33].GetUInt8(); if (m_stableSlots > MAX_PET_STABLES) { sLog->outError("Player can have not more %u stable slots, but have in DB %u", MAX_PET_STABLES, uint32(m_stableSlots)); m_stableSlots = MAX_PET_STABLES; } - m_atLoginFlags = fields[33].GetUInt16(); + m_atLoginFlags = fields[34].GetUInt16(); // Honor system // Update Honor kills data m_lastHonorUpdateTime = logoutTime; UpdateHonorFields(); - m_deathExpireTime = time_t(fields[36].GetUInt32()); + m_deathExpireTime = time_t(fields[37].GetUInt32()); if (m_deathExpireTime > now+MAX_DEATH_COUNT*DEATH_EXPIRE_STEP) m_deathExpireTime = now+MAX_DEATH_COUNT*DEATH_EXPIRE_STEP-1; @@ -17077,14 +17065,14 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) //mails are loaded only when needed ;-) - when player in game click on mailbox. //_LoadMail(); - m_specsCount = fields[54].GetUInt8(); - m_activeSpec = fields[55].GetUInt8(); + SetSpecsCount(fields[55].GetUInt8()); + SetActiveSpec(fields[56].GetUInt8()); // sanity check - if (m_specsCount > MAX_TALENT_SPECS || m_activeSpec > MAX_TALENT_SPEC || m_specsCount < MIN_TALENT_SPECS) + if (GetSpecsCount() > MAX_TALENT_SPECS || GetActiveSpec() > MAX_TALENT_SPEC || GetSpecsCount() < MIN_TALENT_SPECS) { - m_activeSpec = 0; - sLog->outError("Player %s(GUID: %u) has SpecCount = %u and ActiveSpec = %u.", GetName(), GetGUIDLow(), m_specsCount, m_activeSpec); + SetActiveSpec(0); + sLog->outError("Player %s(GUID: %u) has SpecCount = %u and ActiveSpec = %u.", GetName(), GetGUIDLow(), GetSpecsCount(), GetActiveSpec()); } _LoadTalents(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADTALENTS)); @@ -17126,7 +17114,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) // check PLAYER_CHOSEN_TITLE compatibility with PLAYER__FIELD_KNOWN_TITLES // note: PLAYER__FIELD_KNOWN_TITLES updated at quest status loaded - uint32 curTitle = fields[44].GetUInt32(); + uint32 curTitle = fields[45].GetUInt32(); if (curTitle && !HasTitle(curTitle)) curTitle = 0; @@ -17149,14 +17137,21 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) UpdateAllStats(); // restore remembered power/health values (but not more max values) - uint32 savedHealth = fields[47].GetUInt32(); + uint32 savedHealth = fields[48].GetUInt32(); SetHealth(savedHealth > GetMaxHealth() ? GetMaxHealth() : savedHealth); for (uint8 i = 0; i < MAX_STORED_POWERS; ++i) { - uint32 savedPower = fields[48+i].GetUInt32(); + uint32 savedPower = fields[49+i].GetUInt32(); SetPower(Powers(i), savedPower > GetMaxPower(Powers(i)) ? GetMaxPower(Powers(i)) : savedPower); } + // must be after loading spells and talents + uint32 talentTree = uint32(fields[26].GetUInt16()); + if (sTalentTabStore.LookupEntry(talentTree)) + SetPrimaryTalentTree(talentTree); + else + SetAtLoginFlag(AT_LOGIN_RESET_TALENTS); // invalid tree, reset talents + sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "The value of player %s after load item and aura is: ", m_name.c_str()); outDebugValues(); @@ -17209,14 +17204,14 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) } // RaF stuff. - m_grantableLevels = fields[60].GetUInt32(); + m_grantableLevels = fields[61].GetUInt32(); if (GetSession()->IsARecruiter() || (GetSession()->GetRecruiterId() != 0)) SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_REFER_A_FRIEND); if (m_grantableLevels > 0) SetByteValue(PLAYER_FIELD_BYTES, 1, 0x01); - m_guildId = fields[61].GetUInt32(); + m_guildId = fields[62].GetUInt32(); _LoadDeclinedNames(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADDECLINEDNAMES)); @@ -17380,7 +17375,7 @@ void Player::_LoadGlyphAuras() { for (uint8 i = 0; i < MAX_GLYPH_SLOT_INDEX; ++i) { - if (uint32 glyph = GetGlyph(i)) + if (uint32 glyph = GetGlyph(GetActiveSpec(), i)) { if (GlyphPropertiesEntry const* gp = sGlyphPropertiesStore.LookupEntry(glyph)) { @@ -17886,8 +17881,8 @@ void Player::_LoadQuestStatusRewarded(PreparedQueryResult result) SetTitle(titleEntry); } - if (quest->GetBonusTalents()) - m_questRewardTalentCount += quest->GetBonusTalents(); + if (uint32 talents = quest->GetBonusTalents()) + AddQuestRewardedTalentCount(talents); } m_RewardedQuests.insert(quest_id); @@ -18531,8 +18526,9 @@ void Player::SaveToDB(bool create /*=false*/) stmt->setUInt8(index++, (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) ? 1 : 0)); //save, far from tavern/city //save, but in tavern/city - stmt->setUInt32(index++, m_resetTalentsCost); - stmt->setUInt32(index++, m_resetTalentsTime); + stmt->setUInt32(index++, GetTalentResetCost()); + stmt->setUInt32(index++, GetTalentResetTime()); + stmt->setUInt16(index++, uint16(GetPrimaryTalentTree())); stmt->setUInt16(index++, (uint16)m_ExtraFlags); stmt->setUInt8(index++, m_stableSlots); stmt->setUInt16(index++, (uint16)m_atLoginFlags); @@ -18558,8 +18554,8 @@ void Player::SaveToDB(bool create /*=false*/) stmt->setUInt32(index++, GetSession()->GetLatency()); - stmt->setUInt8(index++, m_specsCount); - stmt->setUInt8(index++, m_activeSpec); + stmt->setUInt8(index++, GetSpecsCount()); + stmt->setUInt8(index++, GetActiveSpec()); ss.str(""); for (uint32 i = 0; i < PLAYER_EXPLORED_ZONES_SIZE; ++i) @@ -18637,8 +18633,9 @@ void Player::SaveToDB(bool create /*=false*/) stmt->setUInt8(index++, (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) ? 1 : 0)); //save, far from tavern/city //save, but in tavern/city - stmt->setUInt32(index++, m_resetTalentsCost); - stmt->setUInt32(index++, m_resetTalentsTime); + stmt->setUInt32(index++, GetTalentResetCost()); + stmt->setUInt32(index++, GetTalentResetTime()); + stmt->setUInt16(index++, uint16(GetPrimaryTalentTree())); stmt->setUInt16(index++, (uint16)m_ExtraFlags); stmt->setUInt8(index++, m_stableSlots); stmt->setUInt16(index++, (uint16)m_atLoginFlags); @@ -18664,8 +18661,8 @@ void Player::SaveToDB(bool create /*=false*/) stmt->setUInt32(index++, GetSession()->GetLatency()); - stmt->setUInt8(index++, m_specsCount); - stmt->setUInt8(index++, m_activeSpec); + stmt->setUInt8(index++, GetSpecsCount()); + stmt->setUInt8(index++, GetActiveSpec()); ss.str(""); for (uint32 i = 0; i < PLAYER_EXPLORED_ZONES_SIZE; ++i) @@ -18760,18 +18757,18 @@ void Player::_SaveActions(SQLTransaction& trans) { case ACTIONBUTTON_NEW: trans->PAppend("INSERT INTO character_action (guid, spec, button, action, type) VALUES ('%u', '%u', '%u', '%u', '%u')", - GetGUIDLow(), m_activeSpec, (uint32)itr->first, (uint32)itr->second.GetAction(), (uint32)itr->second.GetType()); + GetGUIDLow(), GetActiveSpec(), (uint32)itr->first, (uint32)itr->second.GetAction(), (uint32)itr->second.GetType()); itr->second.uState = ACTIONBUTTON_UNCHANGED; ++itr; break; case ACTIONBUTTON_CHANGED: trans->PAppend("UPDATE character_action SET action = '%u', type = '%u' WHERE guid = '%u' AND button = '%u' AND spec = '%u'", - (uint32)itr->second.GetAction(), (uint32)itr->second.GetType(), GetGUIDLow(), (uint32)itr->first, m_activeSpec); + (uint32)itr->second.GetAction(), (uint32)itr->second.GetType(), GetGUIDLow(), (uint32)itr->first, GetActiveSpec()); itr->second.uState = ACTIONBUTTON_UNCHANGED; ++itr; break; case ACTIONBUTTON_DELETED: - trans->PAppend("DELETE FROM character_action WHERE guid = '%u' and button = '%u' and spec = '%u'", GetGUIDLow(), (uint32)itr->first, m_activeSpec); + trans->PAppend("DELETE FROM character_action WHERE guid = '%u' and button = '%u' and spec = '%u'", GetGUIDLow(), (uint32)itr->first, GetActiveSpec()); m_actionButtons.erase(itr++); break; default: @@ -23229,27 +23226,22 @@ uint32 Player::GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 n void Player::InitGlyphsForLevel() { - for (uint32 i = 0; i < sGlyphSlotStore.GetNumRows(); ++i) + uint32 slot = 0; + for (uint32 i = 0; i < sGlyphSlotStore.GetNumRows() && slot < MAX_GLYPH_SLOT_INDEX; ++i) if (GlyphSlotEntry const* gs = sGlyphSlotStore.LookupEntry(i)) - if (gs->Order) - SetGlyphSlot(gs->Order - 1, gs->Id); + SetGlyphSlot(slot++, gs->Id); uint8 level = getLevel(); - uint32 value = 0; + uint32 slotMask = 0; - // 0x3F = 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 for 80 level - if (level >= 15) - value |= (0x01 | 0x02); - if (level >= 30) - value |= 0x08; + if (level >= 25) + slotMask |= 0x01 | 0x02 | 0x40; if (level >= 50) - value |= 0x04; - if (level >= 70) - value |= 0x10; - if (level >= 80) - value |= 0x20; + slotMask |= 0x04 | 0x08 | 0x80; + if (level >= 75) + slotMask |= 0x10 | 0x20 | 0x100; - SetUInt32Value(PLAYER_GLYPHS_ENABLED, value); + SetUInt32Value(PLAYER_GLYPHS_ENABLED, slotMask); } bool Player::isTotalImmune() @@ -23573,16 +23565,30 @@ void Player::StoreLootItem(uint8 lootSlot, Loot* loot) uint32 Player::CalculateTalentsPoints() const { - uint32 base_talent = getLevel() < 10 ? 0 : getLevel()-9; + // this dbc file has entries only up to level 100 + NumTalentsAtLevelEntry const* count = sNumTalentsAtLevelStore.LookupEntry(std::min(getLevel(), 100)); + if (!count) + return 0; + + float baseForLevel = count->Talents; if (getClass() != CLASS_DEATH_KNIGHT || GetMapId() != 609) - return uint32(base_talent * sWorld->getRate(RATE_TALENT)); + return uint32(baseForLevel * sWorld->getRate(RATE_TALENT)); + + // Death Knight starting level + // hardcoded here - number of quest awarded talents is equal to number of talents any other class would have at level 55 + if (getLevel() < 55) + return 0; + + NumTalentsAtLevelEntry const* dkBase = sNumTalentsAtLevelStore.LookupEntry(55); + if (!dkBase) + return 0; - uint32 talentPointsForLevel = getLevel() < 56 ? 0 : getLevel() - 55; - talentPointsForLevel += m_questRewardTalentCount; + float talentPointsForLevel = count->Talents - dkBase->Talents; + talentPointsForLevel += float(GetQuestRewardedTalentCount()); - if (talentPointsForLevel > base_talent) - talentPointsForLevel = base_talent; + if (talentPointsForLevel > baseForLevel) + talentPointsForLevel = baseForLevel; return uint32(talentPointsForLevel * sWorld->getRate(RATE_TALENT)); } @@ -23851,29 +23857,29 @@ void Player::CompletedAchievement(AchievementEntry const* entry) GetAchievementMgr().CompletedAchievement(entry); } -void Player::LearnTalent(uint32 talentId, uint32 talentRank) +bool Player::LearnTalent(uint32 talentId, uint32 talentRank) { uint32 CurTalentPoints = GetFreeTalentPoints(); if (CurTalentPoints == 0) - return; + return false; if (talentRank >= MAX_TALENT_RANK) - return; + return false; TalentEntry const* talentInfo = sTalentStore.LookupEntry(talentId); if (!talentInfo) - return; + return false; TalentTabEntry const* talentTabInfo = sTalentTabStore.LookupEntry(talentInfo->TalentTab); if (!talentTabInfo) - return; + return false; // prevent learn talent for different class (cheating) if ((getClassMask() & talentTabInfo->ClassMask) == 0) - return; + return false; // find current max talent rank (0~5) uint8 curtalent_maxrank = 0; // 0 = not learned any rank @@ -23888,11 +23894,11 @@ void Player::LearnTalent(uint32 talentId, uint32 talentRank) // we already have same or higher talent rank learned if (curtalent_maxrank >= (talentRank + 1)) - return; + return false; // check if we have enough talent points if (CurTalentPoints < (talentRank - curtalent_maxrank + 1)) - return; + return false; // Check if it requires another talent if (talentInfo->DependsOn > 0) @@ -23907,33 +23913,32 @@ void Player::LearnTalent(uint32 talentId, uint32 talentRank) hasEnoughRank = true; } if (!hasEnoughRank) - return; + return false; } } // Find out how many points we have in this field uint32 spentPoints = 0; - + uint32 primaryTreeTalents = 0; uint32 tTab = talentInfo->TalentTab; - if (talentInfo->Row > 0) + bool isMainTree = GetPrimaryTalentTree() == tTab || !GetPrimaryTalentTree(); + + if (talentInfo->Row > 0 || !isMainTree) { - uint32 numRows = sTalentStore.GetNumRows(); - for (uint32 i = 0; i < numRows; i++) // Loop through all talents. + for (uint32 i = 0; i < sTalentStore.GetNumRows(); i++) // Loop through all talents. { - // Someday, someone needs to revamp - const TalentEntry* tmpTalent = sTalentStore.LookupEntry(i); - if (tmpTalent) // the way talents are tracked + if (TalentEntry const* tmpTalent = sTalentStore.LookupEntry(i)) // Someday, someone needs to revamp the way talents are tracked { - if (tmpTalent->TalentTab == tTab) + for (uint8 rank = 0; rank < MAX_TALENT_RANK; rank++) { - for (uint8 rank = 0; rank < MAX_TALENT_RANK; rank++) + if (tmpTalent->RankID[rank] != 0) { - if (tmpTalent->RankID[rank] != 0) + if (HasSpell(tmpTalent->RankID[rank])) { - if (HasSpell(tmpTalent->RankID[rank])) - { + if (tmpTalent->TalentTab == tTab) spentPoints += (rank + 1); - } + if (tmpTalent->TalentTab == GetPrimaryTalentTree()) + primaryTreeTalents += (rank + 1); } } } @@ -23943,28 +23948,43 @@ void Player::LearnTalent(uint32 talentId, uint32 talentRank) // not have required min points spent in talent tree if (spentPoints < (talentInfo->Row * MAX_TALENT_RANK)) - return; + return false; + + // player has not spent 31 talents in main tree before attempting to learn other tree's talents + if (!isMainTree && primaryTreeTalents < REQ_PRIMARY_TREE_TALENTS) + return false; // spell not set in talent.dbc uint32 spellid = talentInfo->RankID[talentRank]; if (spellid == 0) { sLog->outError("Talent.dbc have for talent: %u Rank: %u spell id = 0", talentId, talentRank); - return; + return false; } // already known if (HasSpell(spellid)) - return; + return false; // learn! (other talent ranks will unlearned at learning) learnSpell(spellid, false); - AddTalent(spellid, m_activeSpec, true); + AddTalent(spellid, GetActiveSpec(), true); + + sLog->outDetail("TalentID: %u Rank: %u Spell: %u Spec: %u\n", talentId, talentRank, spellid, GetActiveSpec()); - sLog->outDetail("TalentID: %u Rank: %u Spell: %u Spec: %u\n", talentId, talentRank, spellid, m_activeSpec); + // set talent tree for player + if (!GetPrimaryTalentTree()) + { + SetPrimaryTalentTree(talentInfo->TalentTab); + std::vector const* specSpells = GetTalentTreePrimarySpells(talentInfo->TalentTab); + if (specSpells) + for (size_t i = 0; i < specSpells->size(); ++i) + learnSpell(specSpells->at(i), false); + } // update free talent points SetFreeTalentPoints(CurTalentPoints - (talentRank - curtalent_maxrank + 1)); + return true; } void Player::LearnPetTalent(uint64 petGuid, uint32 talentId, uint32 talentRank) @@ -24167,23 +24187,26 @@ bool Player::canSeeSpellClickOn(Creature const* c) const void Player::BuildPlayerTalentsInfoData(WorldPacket* data) { *data << uint32(GetFreeTalentPoints()); // unspentTalentPoints - *data << uint8(m_specsCount); // talent group count (0, 1 or 2) - *data << uint8(m_activeSpec); // talent group index (0 or 1) + *data << uint8(GetSpecsCount()); // talent group count (0, 1 or 2) + *data << uint8(GetActiveSpec()); // talent group index (0 or 1) - if (m_specsCount) + if (GetSpecsCount()) { - if (m_specsCount > MAX_TALENT_SPECS) - m_specsCount = MAX_TALENT_SPECS; + if (GetSpecsCount() > MAX_TALENT_SPECS) + SetSpecsCount(MAX_TALENT_SPECS); // loop through all specs (only 1 for now) - for (uint32 specIdx = 0; specIdx < m_specsCount; ++specIdx) + for (uint32 specIdx = 0; specIdx < GetSpecsCount(); ++specIdx) { + size_t specPos = data->wpos(); + *data << uint32(0); uint8 talentIdCount = 0; size_t pos = data->wpos(); *data << uint8(talentIdCount); // [PH], talentIdCount // find class talent tabs (all players have 3 talent tabs) uint32 const* talentTabIds = GetTalentTabPages(getClass()); + uint32 talentCounts[3] = { 0, 0, 0 }; for (uint8 i = 0; i < MAX_TALENT_TABS; ++i) { @@ -24217,16 +24240,29 @@ void Player::BuildPlayerTalentsInfoData(WorldPacket* data) *data << uint32(talentInfo->TalentID); // Talent.dbc *data << uint8(curtalent_maxrank); // talentMaxRank (0-4) + talentCounts[i] += curtalent_maxrank + 1; ++talentIdCount; } } + if (talentIdCount) + { + uint32 maxTalentsSpec = 0; + if (talentCounts[1] > talentCounts[maxTalentsSpec]) + maxTalentsSpec = 1; + + if (talentCounts[2] > talentCounts[maxTalentsSpec]) + maxTalentsSpec = 2; + + data->put(specPos, talentTabIds[maxTalentsSpec]); + } + data->put(pos, talentIdCount); // put real count *data << uint8(MAX_GLYPH_SLOT_INDEX); // glyphs count for (uint8 i = 0; i < MAX_GLYPH_SLOT_INDEX; ++i) - *data << uint16(m_Glyphs[specIdx][i]); // GlyphProperties.dbc + *data << uint16(GetGlyph(specIdx, i)); // GlyphProperties.dbc } } } @@ -24558,15 +24594,11 @@ void Player::_LoadGlyphs(PreparedQueryResult result) Field* fields = result->Fetch(); uint8 spec = fields[0].GetUInt8(); - if (spec >= m_specsCount) + if (spec >= GetSpecsCount()) continue; - m_Glyphs[spec][0] = fields[1].GetUInt16(); - m_Glyphs[spec][1] = fields[2].GetUInt16(); - m_Glyphs[spec][2] = fields[3].GetUInt16(); - m_Glyphs[spec][3] = fields[4].GetUInt16(); - m_Glyphs[spec][4] = fields[5].GetUInt16(); - m_Glyphs[spec][5] = fields[6].GetUInt16(); + for (uint8 i = 0; i < 6; ++i) + _talentMgr->SpecInfo[spec].Glyphs[i] = fields[i + 1].GetUInt16(); } while (result->NextRow()); } @@ -24574,10 +24606,10 @@ void Player::_LoadGlyphs(PreparedQueryResult result) void Player::_SaveGlyphs(SQLTransaction& trans) { trans->PAppend("DELETE FROM character_glyphs WHERE guid='%u'", GetGUIDLow()); - for (uint8 spec = 0; spec < m_specsCount; ++spec) + for (uint8 spec = 0; spec < GetSpecsCount(); ++spec) { trans->PAppend("INSERT INTO character_glyphs VALUES('%u', '%u', '%u', '%u', '%u', '%u', '%u', '%u')", - GetGUIDLow(), spec, m_Glyphs[spec][0], m_Glyphs[spec][1], m_Glyphs[spec][2], m_Glyphs[spec][3], m_Glyphs[spec][4], m_Glyphs[spec][5]); + GetGUIDLow(), spec, GetGlyph(spec, 0), GetGlyph(spec, 1), GetGlyph(spec, 2), GetGlyph(spec, 3), GetGlyph(spec, 4), GetGlyph(spec, 5)); } } @@ -24596,7 +24628,7 @@ void Player::_SaveTalents(SQLTransaction& trans) { for (uint8 i = 0; i < MAX_TALENT_SPECS; ++i) { - for (PlayerTalentMap::iterator itr = m_talents[i]->begin(); itr != m_talents[i]->end();) + for (PlayerTalentMap::iterator itr = GetTalentMap(i)->begin(); itr != GetTalentMap(i)->end();) { if (itr->second->state == PLAYERSPELL_REMOVED || itr->second->state == PLAYERSPELL_CHANGED) trans->PAppend("DELETE FROM character_talent WHERE guid = '%u' and spell = '%u' and spec = '%u'", GetGUIDLow(), itr->first, itr->second->spec); @@ -24607,7 +24639,7 @@ void Player::_SaveTalents(SQLTransaction& trans) if (itr->second->state == PLAYERSPELL_REMOVED) { delete itr->second; - m_talents[i]->erase(itr++); + GetTalentMap(i)->erase(itr++); } else { @@ -24624,7 +24656,7 @@ void Player::UpdateSpecCount(uint8 count) if (curCount == count) return; - if (m_activeSpec >= count) + if (GetActiveSpec() >= count) ActivateSpec(0); SQLTransaction trans = CharacterDatabase.BeginTransaction(); @@ -24641,8 +24673,8 @@ void Player::UpdateSpecCount(uint8 count) else if (count < curCount) { _SaveActions(trans); - trans->PAppend("DELETE FROM character_action WHERE spec<>'%u' AND guid='%u'", m_activeSpec, GetGUIDLow()); - m_activeSpec = 0; + trans->PAppend("DELETE FROM character_action WHERE spec<>'%u' AND guid='%u'", GetActiveSpec(), GetGUIDLow()); + SetActiveSpec(0); } CharacterDatabase.CommitTransaction(trans); @@ -24723,7 +24755,7 @@ void Player::ActivateSpec(uint8 spec) // set glyphs for (uint8 slot = 0; slot < MAX_GLYPH_SLOT_INDEX; ++slot) // remove secondary glyph - if (uint32 oldglyph = m_Glyphs[m_activeSpec][slot]) + if (uint32 oldglyph = GetGlyph(GetActiveSpec(), slot)) if (GlyphPropertiesEntry const* old_gp = sGlyphPropertiesStore.LookupEntry(oldglyph)) RemoveAurasDueToSpell(old_gp->SpellId); @@ -24753,7 +24785,7 @@ void Player::ActivateSpec(uint8 spec) if (talentInfo->RankID[rank] == 0) continue; // if the talent can be found in the newly activated PlayerTalentMap - if (HasTalent(talentInfo->RankID[rank], m_activeSpec)) + if (HasTalent(talentInfo->RankID[rank], GetActiveSpec())) { learnSpell(talentInfo->RankID[rank], false); // add the talent to the PlayerSpellMap spentTalents += (rank + 1); // increment the spentTalents count @@ -24764,7 +24796,7 @@ void Player::ActivateSpec(uint8 spec) // set glyphs for (uint8 slot = 0; slot < MAX_GLYPH_SLOT_INDEX; ++slot) { - uint32 glyph = m_Glyphs[m_activeSpec][slot]; + uint32 glyph = GetGlyph(GetActiveSpec(), slot); // apply primary glyph if (glyph) @@ -24774,13 +24806,13 @@ void Player::ActivateSpec(uint8 spec) SetGlyph(slot, glyph); } - m_usedTalentCount = spentTalents; + SetUsedTalentCount(spentTalents); InitTalentForLevel(); { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_ACTIONS_SPEC); stmt->setUInt32(0, GetGUIDLow()); - stmt->setUInt8(1, m_activeSpec); + stmt->setUInt8(1, GetActiveSpec()); if (PreparedQueryResult result = CharacterDatabase.Query(stmt)) _LoadActions(result); } diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index a594f2c02ef..73c8c010e76 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1086,6 +1086,49 @@ private: uint32 _xp; }; +struct PlayerTalentInfo +{ + PlayerTalentInfo() : + FreeTalentPoints(0), UsedTalentCount(0), QuestRewardedTalentCount(0), + ResetTalentsCost(0), ResetTalentsTime(0), TalentTree(0), + ActiveSpec(0), SpecsCount(1) + { + for (uint8 i = 0; i < MAX_TALENT_SPECS; ++i) + { + memset(SpecInfo[i].Glyphs, 0, MAX_GLYPH_SLOT_INDEX * sizeof(uint32)); + SpecInfo[i].Talents = new PlayerTalentMap(); + } + } + + ~PlayerTalentInfo() + { + for (uint8 i = 0; i < MAX_TALENT_SPECS; ++i) + { + for (PlayerTalentMap::const_iterator itr = SpecInfo[i].Talents->begin(); itr != SpecInfo[i].Talents->end(); ++itr) + delete itr->second; + delete SpecInfo[i].Talents; + } + } + + struct TalentSpecInfo + { + PlayerTalentMap* Talents; + uint32 Glyphs[MAX_GLYPH_SLOT_INDEX]; + } SpecInfo[MAX_TALENT_SPECS]; + + uint32 FreeTalentPoints; + uint32 UsedTalentCount; + uint32 QuestRewardedTalentCount; + uint32 ResetTalentsCost; + time_t ResetTalentsTime; + uint32 TalentTree; + uint8 ActiveSpec; + uint8 SpecsCount; + +private: + PlayerTalentInfo(PlayerTalentInfo const&); +}; + class Player : public Unit, public GridObject { friend class WorldSession; @@ -1683,39 +1726,54 @@ class Player : public Unit, public GridObject void SetReputation(uint32 factionentry, uint32 value); uint32 GetReputation(uint32 factionentry); std::string GetGuildName(); - uint32 GetFreeTalentPoints() const { return m_freeTalentPoints; } - void SetFreeTalentPoints(uint32 points) { m_freeTalentPoints = points; } - bool resetTalents(bool no_cost = false); - uint32 resetTalentsCost() const; + + // Talents + uint32 GetFreeTalentPoints() const { return _talentMgr->FreeTalentPoints; } + void SetFreeTalentPoints(uint32 points) { _talentMgr->FreeTalentPoints = points; } + uint32 GetUsedTalentCount() const { return _talentMgr->UsedTalentCount; } + void SetUsedTalentCount(uint32 talents) { _talentMgr->UsedTalentCount = talents; } + uint32 GetQuestRewardedTalentCount() const { return _talentMgr->QuestRewardedTalentCount; } + void AddQuestRewardedTalentCount(uint32 points) { _talentMgr->QuestRewardedTalentCount += points; } + uint32 GetTalentResetCost() const { return _talentMgr->ResetTalentsCost; } + void SetTalentResetCost(uint32 cost) { _talentMgr->ResetTalentsCost = cost; } + uint32 GetTalentResetTime() const { return _talentMgr->ResetTalentsTime; } + void SetTalentResetTime(time_t time_) { _talentMgr->ResetTalentsTime = time_; } + uint32 GetPrimaryTalentTree() const { return _talentMgr->TalentTree; } + void SetPrimaryTalentTree(uint32 tree) { _talentMgr->TalentTree = tree; } + uint8 GetActiveSpec() const { return _talentMgr->ActiveSpec; } + void SetActiveSpec(uint8 spec){ _talentMgr->ActiveSpec = spec; } + uint8 GetSpecsCount() const { return _talentMgr->SpecsCount; } + void SetSpecsCount(uint8 count) { _talentMgr->SpecsCount = count; } + + bool ResetTalents(bool no_cost = false); + uint32 GetNextResetTalentsCost() const; void InitTalentForLevel(); void BuildPlayerTalentsInfoData(WorldPacket* data); void BuildPetTalentsInfoData(WorldPacket* data); void SendTalentsInfoData(bool pet); - void LearnTalent(uint32 talentId, uint32 talentRank); + bool LearnTalent(uint32 talentId, uint32 talentRank); void LearnPetTalent(uint64 petGuid, uint32 talentId, uint32 talentRank); - bool AddTalent(uint32 spellId, uint8 spec, bool learning); bool HasTalent(uint32 spell_id, uint8 spec) const; - uint32 CalculateTalentsPoints() const; // Dual Spec void UpdateSpecCount(uint8 count); - uint32 GetActiveSpec() { return m_activeSpec; } - void SetActiveSpec(uint8 spec){ m_activeSpec = spec; } - uint8 GetSpecsCount() { return m_specsCount; } - void SetSpecsCount(uint8 count) { m_specsCount = count; } void ActivateSpec(uint8 spec); void InitGlyphsForLevel(); void SetGlyphSlot(uint8 slot, uint32 slottype) { SetUInt32Value(PLAYER_FIELD_GLYPH_SLOTS_1 + slot, slottype); } - uint32 GetGlyphSlot(uint8 slot) { return GetUInt32Value(PLAYER_FIELD_GLYPH_SLOTS_1 + slot); } + uint32 GetGlyphSlot(uint8 slot) const { return GetUInt32Value(PLAYER_FIELD_GLYPH_SLOTS_1 + slot); } void SetGlyph(uint8 slot, uint32 glyph) { - m_Glyphs[m_activeSpec][slot] = glyph; + _talentMgr->SpecInfo[GetActiveSpec()].Glyphs[slot] = glyph; SetUInt32Value(PLAYER_FIELD_GLYPHS_1 + slot, glyph); } - uint32 GetGlyph(uint8 slot) { return m_Glyphs[m_activeSpec][slot]; } + uint32 GetGlyph(uint8 spec, uint8 slot) const { return _talentMgr->SpecInfo[spec].Glyphs[slot]; } + + PlayerTalentMap const* GetTalentMap(uint8 spec) const { return _talentMgr->SpecInfo[spec].Talents; } + PlayerTalentMap* GetTalentMap(uint8 spec) { return _talentMgr->SpecInfo[spec].Talents; } + ActionButtonList const& GetActionButtons() const { return m_actionButtons; } uint32 GetFreePrimaryProfessionPoints() const { return GetUInt32Value(PLAYER_CHARACTER_POINTS); } void SetFreePrimaryProfessions(uint16 profs) { SetUInt32Value(PLAYER_CHARACTER_POINTS, profs); } @@ -2698,17 +2756,11 @@ class Player : public Unit, public GridObject PlayerMails m_mail; PlayerSpellMap m_spells; - PlayerTalentMap* m_talents[MAX_TALENT_SPECS]; uint32 m_lastPotionId; // last used health/mana potion in combat, that block next potion use GlobalCooldownMgr m_GlobalCooldownMgr; - uint8 m_activeSpec; - uint8 m_specsCount; - - uint32 m_freeTalentPoints; - - uint32 m_Glyphs[MAX_TALENT_SPECS][MAX_GLYPH_SLOT_INDEX]; + PlayerTalentInfo* _talentMgr; ActionButtonList m_actionButtons; @@ -2781,10 +2833,6 @@ class Player : public Unit, public GridObject float m_rest_bonus; RestType rest_type; ////////////////////Rest System///////////////////// - uint32 m_resetTalentsCost; - time_t m_resetTalentsTime; - uint32 m_usedTalentCount; - uint32 m_questRewardTalentCount; // Social PlayerSocial *m_social; diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 8fac594520e..323f31c9bb4 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -564,7 +564,8 @@ enum SpellAttr7 #define MAX_TALENT_SPEC 1 #define MIN_TALENT_SPECS 1 #define MAX_TALENT_SPECS 2 -#define MAX_GLYPH_SLOT_INDEX 6 +#define MAX_GLYPH_SLOT_INDEX 9 +#define REQ_PRIMARY_TREE_TALENTS 31 // Custom values enum SpellClickUserTypes @@ -842,7 +843,7 @@ enum SpellEffects SPELL_EFFECT_171 = 171, // Summons gamebject SPELL_EFFECT_172 = 172, // Aoe ressurection SPELL_EFFECT_173 = 173, // Guild tab unlocked (guild perk) - SPELL_EFFECT_174 = 174, // + SPELL_EFFECT_174 = 174, // SPELL_EFFECT_175 = 175, // Unused (4.2.2) SPELL_EFFECT_176 = 176, // Some kind of sanctuary effect (Vanish) SPELL_EFFECT_177 = 177, diff --git a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp index 6479c6b6386..62b9fe0b582 100644 --- a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp @@ -1070,7 +1070,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder) if (pCurrChar->HasAtLoginFlag(AT_LOGIN_RESET_TALENTS)) { - pCurrChar->resetTalents(true); + pCurrChar->ResetTalents(true); pCurrChar->SendTalentsInfoData(false); // original talents send already in to SendInitialPacketsBeforeAddToMap, resend reset state SendNotification(LANG_RESET_TALENTS); } @@ -1428,7 +1428,7 @@ void WorldSession::HandleRemoveGlyph(WorldPacket & recv_data) return; } - if (uint32 glyph = _player->GetGlyph(slot)) + if (uint32 glyph = _player->GetGlyph(_player->GetActiveSpec(), slot)) { if (GlyphPropertiesEntry const* gp = sGlyphPropertiesStore.LookupEntry(glyph)) { diff --git a/src/server/game/Server/Protocol/Handlers/SkillHandler.cpp b/src/server/game/Server/Protocol/Handlers/SkillHandler.cpp index 96234762a15..09d8b42c0ab 100755 --- a/src/server/game/Server/Protocol/Handlers/SkillHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/SkillHandler.cpp @@ -31,15 +31,31 @@ void WorldSession::HandleLearnTalentOpcode(WorldPacket & recv_data) uint32 talentId, requestedRank; recv_data >> talentId >> requestedRank; - _player->LearnTalent(talentId, requestedRank); - _player->SendTalentsInfoData(false); + if (_player->LearnTalent(talentId, requestedRank)) + _player->SendTalentsInfoData(false); } void WorldSession::HandleLearnPreviewTalents(WorldPacket& recvPacket) { sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LEARN_PREVIEW_TALENTS"); + int32 tabPage; uint32 talentsCount; + recvPacket >> tabPage; // talent tree + + // prevent cheating (selecting new tree with points already in another) + if (tabPage >= 0) // -1 if player already has specialization + { + if (TalentTabEntry const* talentTabEntry = sTalentTabStore.LookupEntry(_player->GetPrimaryTalentTree())) + { + if (talentTabEntry->tabpage != tabPage) + { + recvPacket.rfinish(); + return; + } + } + } + recvPacket >> talentsCount; uint32 talentId, talentRank; @@ -48,7 +64,11 @@ void WorldSession::HandleLearnPreviewTalents(WorldPacket& recvPacket) { recvPacket >> talentId >> talentRank; - _player->LearnTalent(talentId, talentRank); + if (!_player->LearnTalent(talentId, talentRank)) + { + recvPacket.rfinish(); + break; + } } _player->SendTalentsInfoData(false); @@ -71,7 +91,7 @@ void WorldSession::HandleTalentWipeConfirmOpcode(WorldPacket & recv_data) if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); - if (!_player->resetTalents()) + if (!_player->ResetTalents()) { WorldPacket data(MSG_TALENT_WIPE_CONFIRM, 8+4); //you have not any talent data << uint64(0); diff --git a/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp b/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp index e15fc8b3871..09ba46654ee 100755 --- a/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp @@ -405,6 +405,7 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket) Spell* spell = new Spell(mover, spellInfo, TRIGGERED_NONE, 0, false); spell->m_cast_count = castCount; // set count of casts + spell->m_glyphIndex = glyphIndex; spell->prepare(&targets); } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index e1aaaf1dbef..3b202a159ec 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -654,7 +654,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_PERIODICAURALOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPELLDAMAGESHIELD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPELLNONMELEEDAMAGELOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_LEARN_TALENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnTalentOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_LEARN_TALENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnTalentOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_RESURRECT_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_TOGGLE_PVP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTogglePvP ); DEFINE_OPCODE_HANDLER(SMSG_ZONE_UNDER_ATTACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1209,7 +1209,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_PREV_SEAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_NEXT_SEAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_SWITCH_SEAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); - //DEFINE_OPCODE_HANDLER(CMSG_PET_LEARN_TALENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetLearnTalent ); + DEFINE_OPCODE_HANDLER(CMSG_PET_LEARN_TALENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetLearnTalent ); //DEFINE_OPCODE_HANDLER(CMSG_PET_UNLEARN_TALENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_SET_PHASE_SHIFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ALL_ACHIEVEMENT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1281,8 +1281,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_SET_PROJECTILE_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TALENTS_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TALENTS_INVOLUNTARILY_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_LEARN_PREVIEW_TALENTS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnPreviewTalents ); - //DEFINE_OPCODE_HANDLER(CMSG_LEARN_PREVIEW_TALENTS_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnPreviewTalentsPet ); + DEFINE_OPCODE_HANDLER(CMSG_LEARN_PREVIEW_TALENTS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnPreviewTalents ); + DEFINE_OPCODE_HANDLER(CMSG_LEARN_PREVIEW_TALENTS_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnPreviewTalentsPet ); //DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIVE_TALENT_GROUP_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GM_GRANT_ACHIEVEMENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GM_REMOVE_ACHIEVEMENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -1378,11 +1378,11 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_VERIFY_CONNECTIVITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_VERIFY_CONNECTIVITY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); //DEFINE_OPCODE_HANDLER(CMSG_LOG_DISCONNECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); - DEFINE_OPCODE_HANDLER(CMSG_RETURN_TO_GRAVEYARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReturnToGraveyard ); + DEFINE_OPCODE_HANDLER(CMSG_RETURN_TO_GRAVEYARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReturnToGraveyard ); DEFINE_OPCODE_HANDLER(CMSG_RANDOMIZE_CHAR_NAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRandomizeCharNameOpcode ); DEFINE_OPCODE_HANDLER(SMSG_RANDOMIZE_CHAR_NAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAYER_MOVE, STATUS_AUTHED, PROCESS_THREADSAFE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_REQUEST_SCORE_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); Need to send the response - + #undef DEFINE_OPCODE_HANDLER }; diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 86bc68e631d..d932b536a78 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -5710,12 +5710,16 @@ void Spell::EffectApplyGlyph(SpellEffIndex effIndex) switch (m_glyphIndex) { case 0: - case 1: minLevel = 15; break; - case 2: minLevel = 50; break; - case 3: minLevel = 30; break; - case 4: minLevel = 70; break; - case 5: minLevel = 80; break; + case 1: + case 6: minLevel = 25; break; + case 2: + case 3: + case 7: minLevel = 50; break; + case 4: + case 5: + case 8: minLevel = 75; break; } + if (minLevel && m_caster->getLevel() < minLevel) { SendCastResult(SPELL_FAILED_GLYPH_SOCKET_LOCKED); @@ -5737,7 +5741,7 @@ void Spell::EffectApplyGlyph(SpellEffIndex effIndex) } // remove old glyph - if (uint32 oldglyph = player->GetGlyph(m_glyphIndex)) + if (uint32 oldglyph = player->GetGlyph(player->GetActiveSpec(), m_glyphIndex)) { if (GlyphPropertiesEntry const* old_gp = sGlyphPropertiesStore.LookupEntry(oldglyph)) { diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index fef3c9f9ccf..b0054aca5a5 100755 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -56,7 +56,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() // Start LoginQueryHolder content PREPARE_STATEMENT(CHAR_SEL_CHARACTER, "SELECT guid, account, name, race, class, gender, level, xp, money, playerBytes, playerBytes2, playerFlags, " "position_x, position_y, position_z, map, orientation, taximask, cinematic, totaltime, leveltime, rest_bonus, logout_time, is_logout_resting, resettalents_cost, " - "resettalents_time, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, online, death_expire_time, taxi_path, instance_mode_mask, " + "resettalents_time, talentTree, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, online, death_expire_time, taxi_path, instance_mode_mask, " "conquestPoints, totalHonorPoints, totalKills, todayKills, yesterdayKills, chosenTitle, watchedFaction, drunk, " "health, power1, power2, power3, power4, power5, instance_id, speccount, activespec, exploredZones, equipmentCache, knownTitles, actionBars, grantableLevels, guildId FROM characters WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_GROUP_MEMBER, "SELECT guid FROM group_member WHERE memberGuid = ?", CONNECTION_ASYNC) @@ -333,15 +333,15 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_INS_CHARACTER, "INSERT INTO characters (guid, account, name, race, class, gender, level, xp, money, playerBytes, playerBytes2, playerFlags, " "map, instance_id, instance_mode_mask, position_x, position_y, position_z, orientation, " "taximask, cinematic, " - "totaltime, leveltime, rest_bonus, logout_time, is_logout_resting, resettalents_cost, resettalents_time, " + "totaltime, leveltime, rest_bonus, logout_time, is_logout_resting, resettalents_cost, resettalents_time, talentTree, " "extra_flags, stable_slots, at_login, zone, " "death_expire_time, taxi_path, conquestPoints, totalHonorPoints, totalKills, " "todayKills, yesterdayKills, chosenTitle, watchedFaction, drunk, health, power1, power2, power3, " "power4, power5, latency, speccount, activespec, exploredZones, equipmentCache, knownTitles, actionBars, grantableLevels) VALUES " - "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", CONNECTION_ASYNC); + "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_UPD_CHARACTER, "UPDATE characters SET name=?,race=?,class=?,gender=?,level=?,xp=?,money=?,playerBytes=?,playerBytes2=?,playerFlags=?," "map=?,instance_id=?,instance_mode_mask=?,position_x=?,position_y=?,position_z=?,orientation=?,taximask=?,cinematic=?,totaltime=?,leveltime=?,rest_bonus=?," - "logout_time=?,is_logout_resting=?,resettalents_cost=?,resettalents_time=?,extra_flags=?,stable_slots=?,at_login=?,zone=?,death_expire_time=?,taxi_path=?," + "logout_time=?,is_logout_resting=?,resettalents_cost=?,resettalents_time=?,talentTree=?,extra_flags=?,stable_slots=?,at_login=?,zone=?,death_expire_time=?,taxi_path=?," "conquestPoints=?,totalHonorPoints=?,totalKills=?,todayKills=?,yesterdayKills=?,chosenTitle=?," "watchedFaction=?,drunk=?,health=?,power1=?,power2=?,power3=?,power4=?,power5=?,latency=?,speccount=?,activespec=?,exploredZones=?," "equipmentCache=?,knownTitles=?,actionBars=?,grantableLevels=?,online=? WHERE guid=?", CONNECTION_ASYNC); -- cgit v1.2.3 From 23c44b2a16e0347e2f2ee61b9949b7b7a3072fb1 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 29 Jan 2012 18:22:50 +0100 Subject: Core/Players: Fixed talents tree specific spells to work with dual spec --- sql/base/characters_database.sql | 2 +- .../2012_01_29_00_.characters_characters.sql | 1 - .../2012_01_29_00_characters_characters.sql | 1 + .../2012_01_29_01_characters_characters.sql | 2 + src/server/game/Entities/Player/Player.cpp | 70 ++++++++++++++-------- src/server/game/Entities/Player/Player.h | 11 ++-- .../game/Server/Protocol/Handlers/SkillHandler.cpp | 2 +- 7 files changed, 55 insertions(+), 34 deletions(-) delete mode 100644 sql/updates/characters/2012_01_29_00_.characters_characters.sql create mode 100644 sql/updates/characters/2012_01_29_00_characters_characters.sql create mode 100644 sql/updates/characters/2012_01_29_01_characters_characters.sql (limited to 'src') diff --git a/sql/base/characters_database.sql b/sql/base/characters_database.sql index 5cd0db50dcb..df935c184d2 100644 --- a/sql/base/characters_database.sql +++ b/sql/base/characters_database.sql @@ -1127,7 +1127,7 @@ CREATE TABLE `characters` ( `rest_bonus` float NOT NULL DEFAULT '0', `resettalents_cost` int(10) unsigned NOT NULL DEFAULT '0', `resettalents_time` int(10) unsigned NOT NULL DEFAULT '0', - `talentTree` smallint(5) unsigned NOT NULL DEFAULT '0', + `talentTree` varchar(10) NOT NULL DEFAULT '0 0', `trans_x` float NOT NULL DEFAULT '0', `trans_y` float NOT NULL DEFAULT '0', `trans_z` float NOT NULL DEFAULT '0', diff --git a/sql/updates/characters/2012_01_29_00_.characters_characters.sql b/sql/updates/characters/2012_01_29_00_.characters_characters.sql deleted file mode 100644 index baaf37ac467..00000000000 --- a/sql/updates/characters/2012_01_29_00_.characters_characters.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE `characters` ADD `talentTree` smallint(5) UNSIGNED NOT NULL DEFAULT 0 AFTER `resettalents_time`; diff --git a/sql/updates/characters/2012_01_29_00_characters_characters.sql b/sql/updates/characters/2012_01_29_00_characters_characters.sql new file mode 100644 index 00000000000..baaf37ac467 --- /dev/null +++ b/sql/updates/characters/2012_01_29_00_characters_characters.sql @@ -0,0 +1 @@ +ALTER TABLE `characters` ADD `talentTree` smallint(5) UNSIGNED NOT NULL DEFAULT 0 AFTER `resettalents_time`; diff --git a/sql/updates/characters/2012_01_29_01_characters_characters.sql b/sql/updates/characters/2012_01_29_01_characters_characters.sql new file mode 100644 index 00000000000..ae8aefc75b6 --- /dev/null +++ b/sql/updates/characters/2012_01_29_01_characters_characters.sql @@ -0,0 +1,2 @@ +ALTER TABLE `characters` CHANGE `talentTree` `talentTree` varchar(10) NOT NULL DEFAULT '0 0 ' AFTER `resettalents_time`; +UPDATE `characters` SET `talentTree`='0 0 '; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 22bd1846bb5..3140a3a8ef1 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -4528,7 +4528,7 @@ bool Player::ResetTalents(bool no_cost) removeSpell(specSpells->at(i), true); } - SetPrimaryTalentTree(0); + SetPrimaryTalentTree(GetActiveSpec(), 0); SetFreeTalentPoints(talentPointsForLevel); SQLTransaction trans = CharacterDatabase.BeginTransaction(); @@ -17146,11 +17146,18 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) } // must be after loading spells and talents - uint32 talentTree = uint32(fields[26].GetUInt16()); - if (sTalentTabStore.LookupEntry(talentTree)) - SetPrimaryTalentTree(talentTree); - else - SetAtLoginFlag(AT_LOGIN_RESET_TALENTS); // invalid tree, reset talents + Tokens talentTrees(fields[26].GetString(), ' ', MAX_TALENT_SPECS); + for (uint8 i = 0; i < MAX_TALENT_SPECS; ++i) + { + if (i >= talentTrees.size()) + break; + + uint32 talentTree = atol(talentTrees[i]); + if (sTalentTabStore.LookupEntry(talentTree)) + SetPrimaryTalentTree(i, talentTree); + else if (i == GetActiveSpec()) + SetAtLoginFlag(AT_LOGIN_RESET_TALENTS); // invalid tree, reset talents + } sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "The value of player %s after load item and aura is: ", m_name.c_str()); outDebugValues(); @@ -18528,7 +18535,11 @@ void Player::SaveToDB(bool create /*=false*/) //save, but in tavern/city stmt->setUInt32(index++, GetTalentResetCost()); stmt->setUInt32(index++, GetTalentResetTime()); - stmt->setUInt16(index++, uint16(GetPrimaryTalentTree())); + + ss.str(""); + for (uint8 i = 0; i < MAX_TALENT_SPECS; ++i) + ss << GetPrimaryTalentTree(i) << " "; + stmt->setString(index++, ss.str()); stmt->setUInt16(index++, (uint16)m_ExtraFlags); stmt->setUInt8(index++, m_stableSlots); stmt->setUInt16(index++, (uint16)m_atLoginFlags); @@ -18635,7 +18646,11 @@ void Player::SaveToDB(bool create /*=false*/) //save, but in tavern/city stmt->setUInt32(index++, GetTalentResetCost()); stmt->setUInt32(index++, GetTalentResetTime()); - stmt->setUInt16(index++, uint16(GetPrimaryTalentTree())); + + ss.str(""); + for (uint8 i = 0; i < MAX_TALENT_SPECS; ++i) + ss << GetPrimaryTalentTree(i) << " "; + stmt->setString(index++, ss.str()); stmt->setUInt16(index++, (uint16)m_ExtraFlags); stmt->setUInt8(index++, m_stableSlots); stmt->setUInt16(index++, (uint16)m_atLoginFlags); @@ -23921,7 +23936,7 @@ bool Player::LearnTalent(uint32 talentId, uint32 talentRank) uint32 spentPoints = 0; uint32 primaryTreeTalents = 0; uint32 tTab = talentInfo->TalentTab; - bool isMainTree = GetPrimaryTalentTree() == tTab || !GetPrimaryTalentTree(); + bool isMainTree = GetPrimaryTalentTree(GetActiveSpec()) == tTab || !GetPrimaryTalentTree(GetActiveSpec()); if (talentInfo->Row > 0 || !isMainTree) { @@ -23937,7 +23952,7 @@ bool Player::LearnTalent(uint32 talentId, uint32 talentRank) { if (tmpTalent->TalentTab == tTab) spentPoints += (rank + 1); - if (tmpTalent->TalentTab == GetPrimaryTalentTree()) + if (tmpTalent->TalentTab == GetPrimaryTalentTree(GetActiveSpec())) primaryTreeTalents += (rank + 1); } } @@ -23973,9 +23988,9 @@ bool Player::LearnTalent(uint32 talentId, uint32 talentRank) sLog->outDetail("TalentID: %u Rank: %u Spell: %u Spec: %u\n", talentId, talentRank, spellid, GetActiveSpec()); // set talent tree for player - if (!GetPrimaryTalentTree()) + if (!GetPrimaryTalentTree(GetActiveSpec())) { - SetPrimaryTalentTree(talentInfo->TalentTab); + SetPrimaryTalentTree(GetActiveSpec(), talentInfo->TalentTab); std::vector const* specSpells = GetTalentTreePrimarySpells(talentInfo->TalentTab); if (specSpells) for (size_t i = 0; i < specSpells->size(); ++i) @@ -24198,7 +24213,6 @@ void Player::BuildPlayerTalentsInfoData(WorldPacket* data) // loop through all specs (only 1 for now) for (uint32 specIdx = 0; specIdx < GetSpecsCount(); ++specIdx) { - size_t specPos = data->wpos(); *data << uint32(0); uint8 talentIdCount = 0; size_t pos = data->wpos(); @@ -24240,23 +24254,10 @@ void Player::BuildPlayerTalentsInfoData(WorldPacket* data) *data << uint32(talentInfo->TalentID); // Talent.dbc *data << uint8(curtalent_maxrank); // talentMaxRank (0-4) - talentCounts[i] += curtalent_maxrank + 1; ++talentIdCount; } } - if (talentIdCount) - { - uint32 maxTalentsSpec = 0; - if (talentCounts[1] > talentCounts[maxTalentsSpec]) - maxTalentsSpec = 1; - - if (talentCounts[2] > talentCounts[maxTalentsSpec]) - maxTalentsSpec = 2; - - data->put(specPos, talentTabIds[maxTalentsSpec]); - } - data->put(pos, talentIdCount); // put real count *data << uint8(MAX_GLYPH_SLOT_INDEX); // glyphs count @@ -24752,6 +24753,15 @@ void Player::ActivateSpec(uint8 spec) } } + // Remove spec specific spells + for (uint32 i = 0; i < MAX_TALENT_TABS; ++i) + { + std::vector const* specSpells = GetTalentTreePrimarySpells(GetTalentTabPages(getClass())[i]); + if (specSpells) + for (size_t i = 0; i < specSpells->size(); ++i) + removeSpell(specSpells->at(i), true); + } + // set glyphs for (uint8 slot = 0; slot < MAX_GLYPH_SLOT_INDEX; ++slot) // remove secondary glyph @@ -24793,6 +24803,11 @@ void Player::ActivateSpec(uint8 spec) } } + std::vector const* specSpells = GetTalentTreePrimarySpells(GetPrimaryTalentTree(GetActiveSpec())); + if (specSpells) + for (size_t i = 0; i < specSpells->size(); ++i) + learnSpell(specSpells->at(i), false); + // set glyphs for (uint8 slot = 0; slot < MAX_GLYPH_SLOT_INDEX; ++slot) { @@ -24824,6 +24839,9 @@ void Player::ActivateSpec(uint8 spec) SetPower(POWER_MANA, 0); // Mana must be 0 even if it isn't the active power type. SetPower(pw, 0); + + if (!sTalentTabStore.LookupEntry(GetPrimaryTalentTree(GetActiveSpec()))) + ResetTalents(true); } void Player::ResetTimeSync() diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 73c8c010e76..9ac5f221b48 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1090,13 +1090,14 @@ struct PlayerTalentInfo { PlayerTalentInfo() : FreeTalentPoints(0), UsedTalentCount(0), QuestRewardedTalentCount(0), - ResetTalentsCost(0), ResetTalentsTime(0), TalentTree(0), + ResetTalentsCost(0), ResetTalentsTime(0), ActiveSpec(0), SpecsCount(1) { for (uint8 i = 0; i < MAX_TALENT_SPECS; ++i) { - memset(SpecInfo[i].Glyphs, 0, MAX_GLYPH_SLOT_INDEX * sizeof(uint32)); SpecInfo[i].Talents = new PlayerTalentMap(); + memset(SpecInfo[i].Glyphs, 0, MAX_GLYPH_SLOT_INDEX * sizeof(uint32)); + SpecInfo[i].TalentTree = 0; } } @@ -1114,6 +1115,7 @@ struct PlayerTalentInfo { PlayerTalentMap* Talents; uint32 Glyphs[MAX_GLYPH_SLOT_INDEX]; + uint32 TalentTree; } SpecInfo[MAX_TALENT_SPECS]; uint32 FreeTalentPoints; @@ -1121,7 +1123,6 @@ struct PlayerTalentInfo uint32 QuestRewardedTalentCount; uint32 ResetTalentsCost; time_t ResetTalentsTime; - uint32 TalentTree; uint8 ActiveSpec; uint8 SpecsCount; @@ -1738,8 +1739,8 @@ class Player : public Unit, public GridObject void SetTalentResetCost(uint32 cost) { _talentMgr->ResetTalentsCost = cost; } uint32 GetTalentResetTime() const { return _talentMgr->ResetTalentsTime; } void SetTalentResetTime(time_t time_) { _talentMgr->ResetTalentsTime = time_; } - uint32 GetPrimaryTalentTree() const { return _talentMgr->TalentTree; } - void SetPrimaryTalentTree(uint32 tree) { _talentMgr->TalentTree = tree; } + uint32 GetPrimaryTalentTree(uint8 spec) const { return _talentMgr->SpecInfo[spec].TalentTree; } + void SetPrimaryTalentTree(uint8 spec, uint32 tree) { _talentMgr->SpecInfo[spec].TalentTree = tree; } uint8 GetActiveSpec() const { return _talentMgr->ActiveSpec; } void SetActiveSpec(uint8 spec){ _talentMgr->ActiveSpec = spec; } uint8 GetSpecsCount() const { return _talentMgr->SpecsCount; } diff --git a/src/server/game/Server/Protocol/Handlers/SkillHandler.cpp b/src/server/game/Server/Protocol/Handlers/SkillHandler.cpp index 09d8b42c0ab..2e4ef5cb40d 100755 --- a/src/server/game/Server/Protocol/Handlers/SkillHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/SkillHandler.cpp @@ -46,7 +46,7 @@ void WorldSession::HandleLearnPreviewTalents(WorldPacket& recvPacket) // prevent cheating (selecting new tree with points already in another) if (tabPage >= 0) // -1 if player already has specialization { - if (TalentTabEntry const* talentTabEntry = sTalentTabStore.LookupEntry(_player->GetPrimaryTalentTree())) + if (TalentTabEntry const* talentTabEntry = sTalentTabStore.LookupEntry(_player->GetPrimaryTalentTree(_player->GetActiveSpec()))) { if (talentTabEntry->tabpage != tabPage) { -- cgit v1.2.3 From 7575ba38981ea0748700f408249eee6bb69530c1 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 29 Jan 2012 18:31:55 +0100 Subject: Core/Player: Missed change for talents packet --- src/server/game/Entities/Player/Player.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 3140a3a8ef1..a211d848f59 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -24211,9 +24211,9 @@ void Player::BuildPlayerTalentsInfoData(WorldPacket* data) SetSpecsCount(MAX_TALENT_SPECS); // loop through all specs (only 1 for now) - for (uint32 specIdx = 0; specIdx < GetSpecsCount(); ++specIdx) + for (uint8 specIdx = 0; specIdx < GetSpecsCount(); ++specIdx) { - *data << uint32(0); + *data << uint32(GetPrimaryTalentTree(specIdx)); uint8 talentIdCount = 0; size_t pos = data->wpos(); *data << uint8(talentIdCount); // [PH], talentIdCount -- cgit v1.2.3 From 6089d4642bac381a25348c227b6c5ab3e86834f3 Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 30 Jan 2012 15:28:38 +0100 Subject: Core/Protocol: Resolved conflicing opcodes MSG_TALENT_WIPE_CONFIRM and CMSG_VERIFY_CONNECTIVITY_RESPONSE --- src/server/game/Server/Protocol/Opcodes.cpp | 3 +-- src/server/game/Server/Protocol/Opcodes.h | 5 ++--- src/server/game/Server/WorldSession.cpp | 9 --------- src/server/game/Server/WorldSession.h | 2 +- src/server/game/Server/WorldSocket.cpp | 19 ++++++++++++++----- 5 files changed, 18 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 3b202a159ec..c7b889c864f 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -1375,8 +1375,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_SKIRMISH_QUEUE_RESULT1, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_SKIRMISH_QUEUE_RESULT2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_UNKNOWN_1310, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_VERIFY_CONNECTIVITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_VERIFY_CONNECTIVITY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); + DEFINE_OPCODE_HANDLER(MSG_VERIFY_CONNECTIVITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); //DEFINE_OPCODE_HANDLER(CMSG_LOG_DISCONNECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); DEFINE_OPCODE_HANDLER(CMSG_RETURN_TO_GRAVEYARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReturnToGraveyard ); DEFINE_OPCODE_HANDLER(CMSG_RANDOMIZE_CHAR_NAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRandomizeCharNameOpcode ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 8f9761c3b7c..070aed33ebd 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -456,7 +456,6 @@ enum Opcodes CMSG_UPDATE_ACCOUNT_DATA = 0x4AFE, CMSG_UPDATE_PROJECTILE_POSITION = 0xEDB, CMSG_USE_ITEM = 0xD8EA, - CMSG_VERIFY_CONNECTIVITY_RESPONSE = 0x4C52, CMSG_VIOLENCE_LEVEL = 0x00, CMSG_VOICE_SESSION_ENABLE = 0x00, CMSG_WARDEN_DATA = 0x5847, @@ -533,7 +532,8 @@ enum Opcodes MSG_SET_DUNGEON_DIFFICULTY = 0x0C4F, MSG_SET_RAID_DIFFICULTY = 0x1A5A, MSG_TABARDVENDOR_ACTIVATE = 0x98EB, - MSG_TALENT_WIPE_CONFIRM = 0x4C52, //duplicate of CMSG_VERIFY_CONNECTIVITY_RESPONSE + MSG_TALENT_WIPE_CONFIRM = 0x4C52, + MSG_VERIFY_CONNECTIVITY = 0x4F57, SMSG_ACCOUNT_DATA_TIMES = 0x5EE2, SMSG_ACHIEVEMENT_DELETED = 0x9ED2, SMSG_ACHIEVEMENT_EARNED = 0x484E, @@ -1063,7 +1063,6 @@ enum Opcodes SMSG_USERLIST_ADD = 0x4CEE, SMSG_USERLIST_REMOVE = 0x9A6B, SMSG_USERLIST_UPDATE = 0x4A4B, - SMSG_VERIFY_CONNECTIVITY = 0x4F57, SMSG_VOICE_CHAT_STATUS = 0x9ADF, SMSG_VOICE_PARENTAL_CONTROLS = 0x5ADE, SMSG_VOICE_SESSION_LEAVE = 0xCE72, diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index bc9cf569b3d..84ccc3e574b 100755 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -43,15 +43,6 @@ #include "ScriptMgr.h" #include "Transport.h" -Opcodes PacketFilter::DropHighBytes(Opcodes opcode) -{ - if (opcode & 0xFFFF0000) // check if any High byte is present - return Opcodes(opcode >> 16); - - else - return Opcodes(opcode); -} - bool MapSessionFilter::Process(WorldPacket* packet) { Opcodes opcode = DropHighBytes(packet->GetOpcode()); diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index dd53d69b451..ff07164e7b2 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -156,7 +156,7 @@ public: virtual bool Process(WorldPacket* /*packet*/) { return true; } virtual bool ProcessLogout() const { return true; } - static Opcodes DropHighBytes(Opcodes opcode); + static Opcodes DropHighBytes(Opcodes opcode) { return Opcodes(opcode & 0xFFFF); } protected: WorldSession* const m_pSession; diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index 2b13e23a28b..881464ce40a 100755 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -259,8 +259,10 @@ int WorldSocket::open (void *a) } m_Address = remote_addr.get_host_addr(); - - WorldPacket packet(SMSG_VERIFY_CONNECTIVITY); + + // not an opcode. this packet sends raw string WORLD OF WARCRAFT CONNECTION - SERVER TO CLIENT" + // because of our implementation, bytes "WO" become the opcode + WorldPacket packet(MSG_VERIFY_CONNECTIVITY); packet << "RLD OF WARCRAFT CONNECTION - SERVER TO CLIENT"; if (SendPacket(packet) == -1) @@ -723,11 +725,18 @@ int WorldSocket::ProcessIncoming (WorldPacket* new_pct) sLog->outStaticDebug("CMSG_LOG_DISCONNECT , size: " UI64FMTD, uint64(new_pct->size())); sScriptMgr->OnPacketReceive(this, WorldPacket(*new_pct)); return 0; - case CMSG_VERIFY_CONNECTIVITY_RESPONSE: - sLog->outStaticDebug("CMSG_VERIFY_CONNECTIVITY_RESPONSE , size: " UI64FMTD, uint64(new_pct->size())); + // not an opcode, client sends string "WORLD OF WARCRAFT CONNECTION - CLIENT TO SERVER" without opcode + // first 4 bytes become the opcode (2 dropped) + case MSG_VERIFY_CONNECTIVITY: + { + sLog->outStaticDebug("MSG_VERIFY_CONNECTIVITY , size: " UI64FMTD, uint64(new_pct->size())); sScriptMgr->OnPacketReceive(this, WorldPacket(*new_pct)); + std::string str; + *new_pct >> str; + if (str != "D OF WARCRAFT CONNECTION - CLIENT TO SERVER") + return -1; return HandleSendAuthSession(); - + } default: { ACE_GUARD_RETURN (LockType, Guard, m_SessionLock, -1); -- cgit v1.2.3 From e865cffc33404f43f9e5c5a0d7bccbb0fcafb365 Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 30 Jan 2012 17:49:44 +0100 Subject: Core/Protocol: Enabled CMSG_SET_ACTION_BUTTON handler --- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index c7b889c864f..d7d37707182 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -357,7 +357,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_SET_FACTION_ATWAR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetFactionAtWar ); //DEFINE_OPCODE_HANDLER(CMSG_SET_FACTION_CHEAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetFactionCheat ); DEFINE_OPCODE_HANDLER(SMSG_SET_PROFICIENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_ACTION_BUTTON, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActionButtonOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_SET_ACTION_BUTTON, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActionButtonOpcode ); DEFINE_OPCODE_HANDLER(SMSG_ACTION_BUTTONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_INITIAL_SPELLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LEARNED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From a6b9350396acf97528d161e1e90036c02775dc21 Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 30 Jan 2012 17:52:22 +0100 Subject: Core/Protocol: Updated SMSG_TRAINER_LIST structure (fields still need filling) --- src/server/game/Entities/Player/Player.h | 6 +++--- src/server/game/Server/Protocol/Handlers/MiscHandler.cpp | 4 ++-- src/server/game/Server/Protocol/Handlers/NPCHandler.cpp | 14 ++++++++------ 3 files changed, 13 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 9ac5f221b48..21027402e84 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -157,9 +157,9 @@ typedef UNORDERED_MAP InstanceTime enum TrainerSpellState { - TRAINER_SPELL_GREEN = 0, - TRAINER_SPELL_RED = 1, - TRAINER_SPELL_GRAY = 2, + TRAINER_SPELL_GRAY = 0, + TRAINER_SPELL_GREEN = 1, + TRAINER_SPELL_RED = 2, TRAINER_SPELL_GREEN_DISABLED = 10 // custom value, not send to client: formally green but learn not allowed }; diff --git a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp b/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp index 5dff3ba8e36..843aa8fd6c0 100755 --- a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp @@ -1079,9 +1079,9 @@ void WorldSession::HandleNextCinematicCamera(WorldPacket & /*recv_data*/) void WorldSession::HandleMoveTimeSkippedOpcode(WorldPacket & recv_data) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_MOVE_TIME_SKIPPED"); - + BitStream mask = recv_data.ReadBitStream(8); - + uint32 time; recv_data >> time; diff --git a/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp b/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp index 6145ef1438d..c1b59b41ebb 100755 --- a/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp @@ -154,6 +154,7 @@ void WorldSession::SendTrainerList(uint64 guid, const std::string& strTitle) WorldPacket data(SMSG_TRAINER_LIST, 8+4+4+trainer_spells->spellList.size()*38 + strTitle.size()+1); data << guid; data << uint32(trainer_spells->trainerType); + data << uint32(0); size_t count_pos = data.wpos(); data << uint32(trainer_spells->spellList.size()); @@ -191,9 +192,6 @@ void WorldSession::SendTrainerList(uint64 guid, const std::string& strTitle) data << uint8(state == TRAINER_SPELL_GREEN_DISABLED ? TRAINER_SPELL_GREEN : state); data << uint32(floor(tSpell->spellCost * fDiscountMod)); - data << uint32(primary_prof_first_rank && can_learn_primary_prof ? 1 : 0); - // primary prof. learn confirmation dialog - data << uint32(primary_prof_first_rank ? 1 : 0); // must be equal prev. field to have learn button in enabled state data << uint8(tSpell->reqLevel); data << uint32(tSpell->reqSkill); data << uint32(tSpell->reqSkillValue); @@ -208,7 +206,7 @@ void WorldSession::SendTrainerList(uint64 guid, const std::string& strTitle) data << uint32(prevSpellId); ++maxReq; } - if (maxReq == 3) + if (maxReq == 2) break; SpellsRequiringSpellMapBounds spellsRequired = sSpellMgr->GetSpellsRequiredForSpellBounds(tSpell->learnedSpell[i]); for (SpellsRequiringSpellMap::const_iterator itr2 = spellsRequired.first; itr2 != spellsRequired.second && maxReq < 3; ++itr2) @@ -216,15 +214,19 @@ void WorldSession::SendTrainerList(uint64 guid, const std::string& strTitle) data << uint32(itr2->second); ++maxReq; } - if (maxReq == 3) + if (maxReq == 2) break; } - while (maxReq < 3) + while (maxReq < 2) { data << uint32(0); ++maxReq; } + data << uint32(primary_prof_first_rank && can_learn_primary_prof ? 1 : 0); + // primary prof. learn confirmation dialog + data << uint32(primary_prof_first_rank ? 1 : 0); // must be equal prev. field to have learn button in enabled state + ++count; } -- cgit v1.2.3 From 59c470894af9c87f3c00d3c6b4a9377282b0bc1e Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 30 Jan 2012 18:18:36 +0100 Subject: Core/Spells * Removed deprecated dbc field and properly initialize ManaCostPerlevel * Corrected order of required shapeshift form fields --- src/server/game/DataStores/DBCStructure.h | 4 ++-- src/server/game/Spells/Auras/SpellAuras.cpp | 6 +++--- src/server/game/Spells/SpellInfo.cpp | 3 ++- src/server/game/Spells/SpellInfo.h | 1 - 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 37ae10f52cb..eb25a6d8624 100755 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -1884,9 +1884,9 @@ struct SpellShapeshiftFormEntry struct SpellShapeshiftEntry { uint32 Id; // 0 - m_ID - uint32 Stances; // 1 - m_shapeshiftMask - // uint32 unk_320_2; // 2 - 3.2.0 uint32 StancesNot; // 3 - m_shapeshiftExclude + // uint32 unk_320_2; // 2 - 3.2.0 + uint32 Stances; // 1 - m_shapeshiftMask // uint32 unk_320_3; // 4 - 3.2.0 // uint32 StanceBarOrder; // 5 - m_stanceBarOrder not used }; diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index ff3d9fcddf3..aac93ad78a3 100755 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -352,7 +352,7 @@ m_owner(owner), m_timeCla(0), m_updateTargetMapInterval(0), m_casterLevel(caster ? caster->getLevel() : m_spellInfo->SpellLevel), m_procCharges(0), m_stackAmount(1), m_isRemoved(false), m_isSingleTarget(false), m_isUsingCharges(false) { - if (m_spellInfo->ManaPerSecond || m_spellInfo->ManaPerSecondPerLevel) + if (m_spellInfo->ManaPerSecond) m_timeCla = 1 * IN_MILLISECONDS; m_maxDuration = CalcMaxDuration(caster); @@ -681,7 +681,7 @@ void Aura::Update(uint32 diff, Unit* caster) m_timeCla -= diff; else if (caster) { - if (int32 manaPerSecond = m_spellInfo->ManaPerSecond + m_spellInfo->ManaPerSecondPerLevel * caster->getLevel()) + if (int32 manaPerSecond = m_spellInfo->ManaPerSecond) { m_timeCla += 1000 - diff; @@ -749,7 +749,7 @@ void Aura::RefreshDuration() { SetDuration(GetMaxDuration()); - if (m_spellInfo->ManaPerSecond || m_spellInfo->ManaPerSecondPerLevel) + if (m_spellInfo->ManaPerSecond) m_timeCla = 1 * IN_MILLISECONDS; } diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index f8ff215d965..8e6d6cb7207 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -981,8 +981,9 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry) // SpellPowerEntry SpellPowerEntry const* _power = GetSpellPower(); ManaCost = _power ? _power->manaCost : 0; - ManaPerSecond = _power ? _power->manaPerSecond : 0; + ManaCostPerlevel = _power ? _power->manaCostPerlevel : 0; ManaCostPercentage = _power ? _power->ManaCostPercentage : 0; + ManaPerSecond = _power ? _power->manaPerSecond : 0; // SpellReagentsEntry SpellReagentsEntry const* _reagents = GetSpellReagents(); diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h index 5671fdf1ec9..44fb49bb17f 100644 --- a/src/server/game/Spells/SpellInfo.h +++ b/src/server/game/Spells/SpellInfo.h @@ -358,7 +358,6 @@ public: uint32 ManaCost; uint32 ManaCostPerlevel; uint32 ManaPerSecond; - uint32 ManaPerSecondPerLevel; uint32 ManaCostPercentage; uint32 RuneCostID; SpellRangeEntry const* RangeEntry; -- cgit v1.2.3 From fdbb3e52bcbaa236a26bd2bf8293a5deccb34a01 Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 30 Jan 2012 18:19:07 +0100 Subject: Core/Commands: Fixed crash in .modify reputation --- src/server/scripts/Commands/cs_modify.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index 00832aa4d59..93aa188c071 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -1234,7 +1234,7 @@ public: } target->GetReputationMgr().SetReputation(factionEntry, amount); - handler->PSendSysMessage(LANG_COMMAND_MODIFY_REP, factionEntry->name[handler->GetSessionDbcLocale()], factionId, + handler->PSendSysMessage(LANG_COMMAND_MODIFY_REP, factionEntry->name, factionId, handler->GetNameLink(target).c_str(), target->GetReputationMgr().GetReputation(factionEntry)); return true; } -- cgit v1.2.3 From 1b676b1ccf2fc8c0aca9e0502164a7c68daf9b7c Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 31 Jan 2012 14:02:59 +0100 Subject: Core/Items: Some work on hotfixes and SMSG_DB_REPLY --- .../world/2012_01_31_01_world_hotfix_data.sql | 42 +++ src/server/game/Globals/ObjectMgr.cpp | 35 +++ src/server/game/Globals/ObjectMgr.h | 14 + src/server/game/Handlers/CharacterHandler.cpp | 11 + src/server/game/Handlers/ItemHandler.cpp | 322 +++++++++++---------- src/server/game/Handlers/MiscHandler.cpp | 45 +++ src/server/game/Server/Protocol/Opcodes.cpp | 5 +- src/server/game/Server/Protocol/Opcodes.h | 3 +- src/server/game/Server/WorldSession.h | 4 +- src/server/game/World/World.cpp | 3 + src/server/shared/Packets/ByteBuffer.h | 4 +- 11 files changed, 325 insertions(+), 163 deletions(-) create mode 100644 sql/updates/world/2012_01_31_01_world_hotfix_data.sql (limited to 'src') diff --git a/sql/updates/world/2012_01_31_01_world_hotfix_data.sql b/sql/updates/world/2012_01_31_01_world_hotfix_data.sql new file mode 100644 index 00000000000..8c941ea7038 --- /dev/null +++ b/sql/updates/world/2012_01_31_01_world_hotfix_data.sql @@ -0,0 +1,42 @@ +DROP TABLE IF EXISTS `hotfix_data`; +CREATE TABLE `hotfix_data` ( + `entry` int(10) unsigned NOT NULL, + `type` int(10) unsigned NOT NULL DEFAULT '0', + `unk` int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`entry`,`type`,`unk`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `hotfix_data` +-- + +INSERT INTO `hotfix_data` VALUES +(6948,1344507586,1322022853), +(44623,1344507586,1322022844), +(44625,1344507586,1322022844), +(44626,1344507586,1322022844), +(44632,1344507586,1322022844), +(44812,1344507586,1322022840), +(44834,1344507586,1322022840), +(44835,1344507586,1322022840), +(44836,1344507586,1322022840), +(44837,1344507586,1322022840), +(44838,1344507586,1322022840), +(44839,1344507586,1322022840), +(44840,1344507586,1322022840), +(44844,1344507586,1322022840), +(44853,1344507586,1322022840), +(44854,1344507586,1322022840), +(44855,1344507586,1322022840), +(44856,1344507586,1322022840), +(46784,1344507586,1322022840), +(46793,1344507586,1322022840), +(46796,1344507586,1322022840), +(46797,1344507586,1322022840), +(46887,1344507586,1322022840), +(46888,1344507586,1322022840), +(64488,1344507586,1322022853), +(69847,1344507586,1322022843), +(69847,1344507586,1322022846), +(72068,1344507586,1322022843), +(72068,1344507586,1322022846); diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 30e0efc15a2..9c0c5553b91 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -9034,6 +9034,41 @@ void ObjectMgr::LoadFactionChangeReputations() sLog->outString(); } +void ObjectMgr::LoadHotfixData() +{ + uint32 oldMSTime = getMSTime(); + + QueryResult result = WorldDatabase.Query("SELECT entry, type, unk FROM hotfix_data"); + + if (!result) + { + sLog->outString(">> Loaded 0 hotfix info entries. DB table `hotfix_data` is empty."); + sLog->outString(); + return; + } + + uint32 count = 0; + + _hotfixData.reserve(result->GetRowCount()); + + do + { + Field* fields = result->Fetch(); + + HotfixInfo info; + info.Entry = fields[0].GetUInt32(); + info.Type = fields[1].GetUInt32(); + info.Unk = fields[2].GetUInt32(); + + _hotfixData.push_back(info); + ++count; + } + while (result->NextRow()); + + sLog->outString(">> Loaded %u hotfix info entries in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); +} + GameObjectTemplate const* ObjectMgr::GetGameObjectTemplate(uint32 entry) { GameObjectTemplateContainer::const_iterator itr = GameObjectTemplateStore.find(entry); diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index 2dfa256ad5a..22bb5e09e50 100755 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -586,6 +586,15 @@ struct DungeonEncounter typedef std::list DungeonEncounterList; typedef UNORDERED_MAP DungeonEncounterMap; +struct HotfixInfo +{ + uint32 Type; + uint32 Unk; + uint32 Entry; +}; + +typedef std::vector HotfixData; + class PlayerDumpReader; class ObjectMgr @@ -1196,6 +1205,9 @@ class ObjectMgr void LoadFactionChangeSpells(); void LoadFactionChangeReputations(); + void LoadHotfixData(); + HotfixData const& GetHotfixData() const { return _hotfixData; } + private: // first free id for selected id type uint32 m_auctionid; @@ -1349,6 +1361,8 @@ class ObjectMgr GO_TO_CREATURE, // GO is dependant on creature }; + HotfixData _hotfixData; + }; #define sObjectMgr ACE_Singleton::instance() diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index ee68a15c301..3dccfe9b245 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -971,6 +971,17 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder) data << uint32(0); SendPacket(&data); + data.Initialize(SMSG_HOTFIX_INFO); + HotfixData const& hotfix = sObjectMgr->GetHotfixData(); + data << uint32(hotfix.size()); + for (uint32 i = 0; i < hotfix.size(); ++i) + { + data << uint32(hotfix[i].Type); + data << uint32(hotfix[i].Unk); + data << uint32(hotfix[i].Entry); + } + SendPacket(&data); + pCurrChar->SendInitialPacketsBeforeAddToMap(); //Show cinematic at the first time that player login diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 2146b8a89bb..40de8ca9fe8 100755 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -277,157 +277,165 @@ void WorldSession::HandleDestroyItemOpcode(WorldPacket & recv_data) _player->DestroyItem(bag, slot, true); } -// Only _static_ data send in this packet !!! -void WorldSession::HandleItemQuerySingleOpcode(WorldPacket & recv_data) +void WorldSession::SendItemDb2Reply(uint32 entry) { - uint32 count, type; - recv_data >> count >> type; - - if (type != DB2_REPLY_SPARSE && type != DB2_REPLY_ITEM) + WorldPacket data(SMSG_DB_REPLY, 44); + data << uint32(DB2_REPLY_ITEM); + ItemTemplate const* proto = sObjectMgr->GetItemTemplate(entry); + if (!proto) + { + data << uint32(-1); // entry + data << uint32(1322512289); // some kind of flags + data << uint32(0); // size of next block return; + } - for (uint32 i = 0; i < count; ++i) - { - uint32 item; - recv_data >> item; - recv_data.read_skip(); - WorldPacket data2(SMSG_DB_REPLY, 700); - ByteBuffer data; - data2 << uint32(type); - data2 << uint32(item); - - ItemTemplate const* proto = sObjectMgr->GetItemTemplate(item); - if (proto) - { - data << uint32(item); - if (type == DB2_REPLY_ITEM) - { - data << uint32(proto->Class); - data << uint32(proto->SubClass); - data << int32(proto->Unk0); - data << uint32(proto->Material); - data << uint32(proto->DisplayInfoID); - data << uint32(proto->InventoryType); - data << uint32(proto->Sheath); - } - else if (type == DB2_REPLY_SPARSE) - { - data << uint32(proto->Quality); - data << uint32(proto->Flags); - data << uint32(proto->Flags2); - data << int32(proto->BuyPrice); - data << uint32(proto->SellPrice); - data << uint32(proto->InventoryType); - data << int32(proto->AllowableClass); - data << int32(proto->AllowableRace); - data << uint32(proto->ItemLevel); - data << uint32(proto->RequiredLevel); - data << uint32(proto->RequiredSkill); - data << uint32(proto->RequiredSkillRank); - data << uint32(proto->RequiredSpell); - data << uint32(proto->RequiredHonorRank); - data << uint32(proto->RequiredCityRank); - data << uint32(proto->RequiredReputationFaction); - data << uint32(proto->RequiredReputationRank); - data << int32(proto->MaxCount); - data << int32(proto->Stackable); - data << uint32(proto->ContainerSlots); - - for (uint32 x = 0; x < MAX_ITEM_PROTO_STATS; ++x) - data << uint32(proto->ItemStat[x].ItemStatType); - - for (uint32 x = 0; x < MAX_ITEM_PROTO_STATS; ++x) - data << int32(proto->ItemStat[x].ItemStatValue); - - for (uint32 x = 0; x < MAX_ITEM_PROTO_STATS; ++x) - data << int32(proto->ItemStat[x].ItemStatUnk1); - - for (uint32 x = 0; x < MAX_ITEM_PROTO_STATS; ++x) - data << int32(proto->ItemStat[x].ItemStatUnk2); - - data << uint32(proto->ScalingStatDistribution); - data << uint32(proto->DamageType); - data << uint32(proto->Delay); - data << float(proto->RangedModRange); - - for (uint32 x = 0; x < MAX_ITEM_PROTO_SPELLS; ++x) - data << int32(proto->Spells[x].SpellId); - - for (uint32 x = 0; x < MAX_ITEM_PROTO_SPELLS; ++x) - data << uint32(proto->Spells[x].SpellTrigger); - - for (uint32 x = 0; x < MAX_ITEM_PROTO_SPELLS; ++x) - data << int32(proto->Spells[x].SpellCharges); - - for (uint32 x = 0; x < MAX_ITEM_PROTO_SPELLS; ++x) - data << int32(proto->Spells[x].SpellCooldown); - - for (uint32 x = 0; x < MAX_ITEM_PROTO_SPELLS; ++x) - data << uint32(proto->Spells[x].SpellCategory); - - for (uint32 x = 0; x < MAX_ITEM_PROTO_SPELLS; ++x) - data << int32(proto->Spells[x].SpellCategoryCooldown); - - data << uint32(proto->Bonding); - - // item name - std::string name = proto->Name1; - data << uint16(name.length() + 1); - data << name; - - for (uint32 i = 0; i < 3; ++i) // other 3 names - data << uint16(0); - - std::string desc = proto->Description; - data << uint16(desc.length() + 1); - data << desc; - - data << uint32(proto->PageText); - data << uint32(proto->LanguageID); - data << uint32(proto->PageMaterial); - data << uint32(proto->StartQuest); - data << uint32(proto->LockID); - data << int32(proto->Material); - data << uint32(proto->Sheath); - data << int32(proto->RandomProperty); - data << int32(proto->RandomSuffix); - data << uint32(proto->ItemSet); - data << uint32(proto->MaxDurability); - - data << uint32(proto->Area); - data << uint32(proto->Map); - data << uint32(proto->BagFamily); - data << uint32(proto->TotemCategory); - - for (uint32 x = 0; x < MAX_ITEM_PROTO_SOCKETS; ++x) - data << uint32(proto->Socket[x].Color); - - for (uint32 x = 0; x < MAX_ITEM_PROTO_SOCKETS; ++x) - data << uint32(proto->Socket[x].Content); - - data << uint32(proto->socketBonus); - data << uint32(proto->GemProperties); - data << float(proto->ArmorDamageModifier); - data << int32(proto->Duration); - data << uint32(proto->ItemLimitCategory); - data << uint32(proto->HolidayId); - data << float(proto->StatScalingFactor); // StatScalingFactor - data << uint32(proto->Field130); // archaeology unk - data << uint32(proto->Field131); // archaeology findinds count - } - else - { - data << uint32(item | 0x80000000); // sometimes with | 0x80000000 - data << uint32(0); - } + data << uint32(entry); + data << uint32(1322512290); // flags - data2 << uint32(data.size()); - data2.append(data); - } + ByteBuffer buff; + buff << uint32(entry); + buff << uint32(proto->Class); + buff << uint32(proto->SubClass); + buff << int32(proto->Unk0); + buff << uint32(proto->Material); + buff << uint32(proto->DisplayInfoID); + buff << uint32(proto->InventoryType); + buff << uint32(proto->Sheath); + + data << uint32(buff.size()); + data.append(buff); - data2 << uint32(type); - _player->GetSession()->SendPacket(&data2); + SendPacket(&data); +} + +void WorldSession::SendItemSparseDb2Reply(uint32 entry) +{ + WorldPacket data(SMSG_DB_REPLY, 526); + data << uint32(DB2_REPLY_SPARSE); + ItemTemplate const* proto = sObjectMgr->GetItemTemplate(entry); + if (!proto) + { + data << uint32(-1); // entry + data << uint32(1322512289); // some kind of flags + data << uint32(0); // size of next block + return; } + + data << uint32(entry); + data << uint32(1322512290); // flags + + ByteBuffer buff; + buff << uint32(entry); + buff << uint32(proto->Quality); + buff << uint32(proto->Flags); + buff << uint32(proto->Flags2); + buff << int32(proto->BuyPrice); + buff << uint32(proto->SellPrice); + buff << uint32(proto->InventoryType); + buff << int32(proto->AllowableClass); + buff << int32(proto->AllowableRace); + buff << uint32(proto->ItemLevel); + buff << uint32(proto->RequiredLevel); + buff << uint32(proto->RequiredSkill); + buff << uint32(proto->RequiredSkillRank); + buff << uint32(proto->RequiredSpell); + buff << uint32(proto->RequiredHonorRank); + buff << uint32(proto->RequiredCityRank); + buff << uint32(proto->RequiredReputationFaction); + buff << uint32(proto->RequiredReputationRank); + buff << int32(proto->MaxCount); + buff << int32(proto->Stackable); + buff << uint32(proto->ContainerSlots); + + for (uint32 x = 0; x < MAX_ITEM_PROTO_STATS; ++x) + buff << uint32(proto->ItemStat[x].ItemStatType); + + for (uint32 x = 0; x < MAX_ITEM_PROTO_STATS; ++x) + buff << int32(proto->ItemStat[x].ItemStatValue); + + for (uint32 x = 0; x < MAX_ITEM_PROTO_STATS; ++x) + buff << int32(proto->ItemStat[x].ItemStatUnk1); + + for (uint32 x = 0; x < MAX_ITEM_PROTO_STATS; ++x) + buff << int32(proto->ItemStat[x].ItemStatUnk2); + + buff << uint32(proto->ScalingStatDistribution); + buff << uint32(proto->DamageType); + buff << uint32(proto->Delay); + buff << float(proto->RangedModRange); + + for (uint32 x = 0; x < MAX_ITEM_PROTO_SPELLS; ++x) + buff << int32(proto->Spells[x].SpellId); + + for (uint32 x = 0; x < MAX_ITEM_PROTO_SPELLS; ++x) + buff << uint32(proto->Spells[x].SpellTrigger); + + for (uint32 x = 0; x < MAX_ITEM_PROTO_SPELLS; ++x) + buff << int32(proto->Spells[x].SpellCharges); + + for (uint32 x = 0; x < MAX_ITEM_PROTO_SPELLS; ++x) + buff << int32(proto->Spells[x].SpellCooldown); + + for (uint32 x = 0; x < MAX_ITEM_PROTO_SPELLS; ++x) + buff << uint32(proto->Spells[x].SpellCategory); + + for (uint32 x = 0; x < MAX_ITEM_PROTO_SPELLS; ++x) + buff << int32(proto->Spells[x].SpellCategoryCooldown); + + buff << uint32(proto->Bonding); + + // item name + std::string name = proto->Name1; + buff << uint16(name.length()); + if (name.length()) + buff << name; + + for (uint32 i = 0; i < 3; ++i) // other 3 names + buff << uint16(0); + + std::string desc = proto->Description; + buff << uint16(desc.length()); + if (desc.length()) + buff << desc; + + buff << uint32(proto->PageText); + buff << uint32(proto->LanguageID); + buff << uint32(proto->PageMaterial); + buff << uint32(proto->StartQuest); + buff << uint32(proto->LockID); + buff << int32(proto->Material); + buff << uint32(proto->Sheath); + buff << int32(proto->RandomProperty); + buff << int32(proto->RandomSuffix); + buff << uint32(proto->ItemSet); + buff << uint32(proto->MaxDurability); + + buff << uint32(proto->Area); + buff << uint32(proto->Map); + buff << uint32(proto->BagFamily); + buff << uint32(proto->TotemCategory); + + for (uint32 x = 0; x < MAX_ITEM_PROTO_SOCKETS; ++x) + buff << uint32(proto->Socket[x].Color); + + for (uint32 x = 0; x < MAX_ITEM_PROTO_SOCKETS; ++x) + buff << uint32(proto->Socket[x].Content); + + buff << uint32(proto->socketBonus); + buff << uint32(proto->GemProperties); + buff << float(proto->ArmorDamageModifier); + buff << int32(proto->Duration); + buff << uint32(proto->ItemLimitCategory); + buff << uint32(proto->HolidayId); + buff << float(proto->StatScalingFactor); // StatScalingFactor + buff << uint32(proto->Field130); // archaeology unk + buff << uint32(proto->Field131); // archaeology findinds count + + data << uint32(buff.size()); + data.append(buff); + + SendPacket(&data); } void WorldSession::HandleReadItem(WorldPacket & recv_data) @@ -731,7 +739,7 @@ void WorldSession::SendListInventory(uint64 vendorGuid) vendor->StopMoving(); uint8* bytes = (uint8*)&vendorGuid; - + VendorItemData const* items = vendor->GetVendorItems(); if (!items) { @@ -744,13 +752,13 @@ void WorldSession::SendListInventory(uint64 vendorGuid) data.WriteByteMask(bytes[0]); data.WriteByteMask(bytes[7]); data.WriteByteMask(bytes[4]); - + data.WriteByteSeq(bytes[2]); data.WriteByteSeq(bytes[3]); - + data << uint8(0); // count == 0, next will be error code data << uint8(0xA0); // Only seen 0xA0 (160) so far ( should we send 0 here?) - + data.WriteByteSeq(bytes[4]); data.WriteByteSeq(bytes[7]); data.WriteByteSeq(bytes[6]); @@ -760,9 +768,9 @@ void WorldSession::SendListInventory(uint64 vendorGuid) uint8 itemCount = items->GetItemCount(); uint8 count = 0; - + WorldPacket data(SMSG_LIST_INVENTORY, 8 + 1 + itemCount * 8 * 4); - + data.WriteByteMask(bytes[5]); data.WriteByteMask(bytes[6]); data.WriteByteMask(bytes[1]); @@ -771,23 +779,23 @@ void WorldSession::SendListInventory(uint64 vendorGuid) data.WriteByteMask(bytes[0]); data.WriteByteMask(bytes[7]); data.WriteByteMask(bytes[4]); - + data.WriteByteSeq(bytes[2]); data.WriteByteSeq(bytes[3]); - + size_t countPos = data.wpos(); data << uint32(count); - + data.WriteByteSeq(bytes[5]); data.WriteByteSeq(bytes[0]); data.WriteByteSeq(bytes[1]); - + data << uint8(0xA0); // Only seen 0xA0 (160) so far - + data.WriteByteSeq(bytes[4]); data.WriteByteSeq(bytes[7]); data.WriteByteSeq(bytes[6]); - + float discountMod = _player->GetReputationPriceDiscount(vendor); diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 0b3a675e762..04ad3e745dc 100755 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -1748,3 +1748,48 @@ void WorldSession::HandleInstanceLockResponse(WorldPacket& recvPacket) _player->SetPendingBind(0, 0); } + +void WorldSession::HandleRequestHotfix(WorldPacket& recvPacket) +{ + uint32 type, count; + recvPacket >> type >> count; + + ByteBuffer* guidBytes = new ByteBuffer[count]; + BitStream* mask = new BitStream[count]; + for (uint32 i = 0; i < count; ++i) + { + mask[i] = recvPacket.ReadBitStream(8); + guidBytes[i].resize(8); // damn c++ not allowing to use non-default constructor with new[] + } + + uint32 entry; + uint64 guid; + for (uint32 i = 0; i < count; ++i) + { + recvPacket >> entry; + recvPacket.ReadXorByte(mask[i][7], guidBytes[i][2]); + recvPacket.ReadXorByte(mask[i][4], guidBytes[i][6]); + recvPacket.ReadXorByte(mask[i][1], guidBytes[i][3]); + recvPacket.ReadXorByte(mask[i][2], guidBytes[i][0]); + recvPacket.ReadXorByte(mask[i][3], guidBytes[i][5]); + recvPacket.ReadXorByte(mask[i][0], guidBytes[i][7]); + recvPacket.ReadXorByte(mask[i][6], guidBytes[i][1]); + recvPacket.ReadXorByte(mask[i][5], guidBytes[i][4]); + guid = BitConverter::ToUInt64(guidBytes[i]); + + switch (type) + { + case DB2_REPLY_ITEM: + SendItemDb2Reply(entry); + break; + case DB2_REPLY_SPARSE: + SendItemSparseDb2Reply(entry); + break; + default: + break; + } + } + + delete[] guidBytes; + delete[] mask; +} diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index d7d37707182..e5cdc7da4b4 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -129,7 +129,6 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_PET_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_QUERY, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildQueryOpcode ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_ITEM_QUERY_SINGLE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleItemQuerySingleOpcode ); DEFINE_OPCODE_HANDLER(SMSG_DB_REPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_PAGE_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePageTextQueryOpcode ); DEFINE_OPCODE_HANDLER(SMSG_PAGE_TEXT_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1380,7 +1379,9 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_RETURN_TO_GRAVEYARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReturnToGraveyard ); DEFINE_OPCODE_HANDLER(CMSG_RANDOMIZE_CHAR_NAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRandomizeCharNameOpcode ); DEFINE_OPCODE_HANDLER(SMSG_RANDOMIZE_CHAR_NAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PLAYER_MOVE, STATUS_AUTHED, PROCESS_THREADSAFE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PLAYER_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(CMSG_REQUEST_HOTFIX, STATUS_AUTHED, PROCESS_INPLACE, &WorldSession::HandleRequestHotfix ); + DEFINE_OPCODE_HANDLER(SMSG_HOTFIX_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_REQUEST_SCORE_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); Need to send the response #undef DEFINE_OPCODE_HANDLER diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 070aed33ebd..3714218540c 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -228,7 +228,6 @@ enum Opcodes CMSG_INITIATE_TRADE = 0x00, CMSG_INSPECT = 0x9A7B, CMSG_INSTANCE_LOCK_WARNING_RESPONSE = 0x8CF7, - CMSG_ITEM_QUERY_SINGLE = 0x0000, CMSG_ITEM_REFUND = 0xCC3, CMSG_ITEM_REFUND_INFO = 0x1C7E, CMSG_ITEM_TEXT_QUERY = 0x4AEB, @@ -378,6 +377,7 @@ enum Opcodes CMSG_REQUEST_ACCOUNT_DATA = 0x8AF2, CMSG_REQUEST_CATEGORY_COOLDOWNS = 0x00, CMSG_REQUEST_CEMETERY_LIST = 0x00, + CMSG_REQUEST_HOTFIX = 0x8A8B, CMSG_REQUEST_PARTY_MEMBER_STATS = 0x987E, CMSG_REQUEST_PET_INFO = 0x9A47, CMSG_REQUEST_RAID_INFO = 0xECF, @@ -731,6 +731,7 @@ enum Opcodes SMSG_GUILD_UPDATE_ROSTER = 0x00, SMSG_GUILD_XP_UPDATE = 0x00, SMSG_GUILDFINDER_SEARCH_RESULT = 0xE0CE, + SMSG_HOTFIX_INFO = 0xA04C, SMSG_HIGHEST_THREAT_UPDATE = 0x5E7B, SMSG_INIT_CURRENCY = 0x227E, SMSG_INIT_WORLD_STATES = 0x9EDA, diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index d4cf3119257..ec2587f8b29 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -647,7 +647,8 @@ class WorldSession void HandleSwapInvItemOpcode(WorldPacket& recvPacket); void HandleDestroyItemOpcode(WorldPacket& recvPacket); void HandleAutoEquipItemOpcode(WorldPacket& recvPacket); - void HandleItemQuerySingleOpcode(WorldPacket& recvPacket); + void SendItemDb2Reply(uint32 entry); + void SendItemSparseDb2Reply(uint32 entry); void HandleSellItemOpcode(WorldPacket& recvPacket); void HandleBuyItemInSlotOpcode(WorldPacket& recvPacket); void HandleBuyItemOpcode(WorldPacket& recvPacket); @@ -903,6 +904,7 @@ class WorldSession void HandleEjectPassenger(WorldPacket& data); void HandleEnterPlayerVehicle(WorldPacket& data); void HandleUpdateProjectilePosition(WorldPacket& recvPacket); + void HandleRequestHotfix(WorldPacket& recvPacket); private: void InitializeQueryCallbackParameters(); diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index eaa17b3f072..f492ff80fae 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1747,6 +1747,9 @@ void World::SetInitialWorldSettings() sLog->outString("Initializing Opcodes..."); InitOpcodes(); + sLog->outString("Loading hotfix info..."); + sObjectMgr->LoadHotfixData(); + uint32 startupDuration = GetMSTimeDiffToNow(startupBegin); sLog->outString(); sLog->outString("WORLD: World initialized in %u minutes %u seconds", (startupDuration / 60000), ((startupDuration % 60000) / 1000) ); diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h index a15f8ce5c30..3506913fc23 100755 --- a/src/server/shared/Packets/ByteBuffer.h +++ b/src/server/shared/Packets/ByteBuffer.h @@ -198,10 +198,10 @@ class ByteBuffer { return ReadUInt8() ^ 1; } - + void ReadXorByte(uint32 bit, uint8& byte) { - if (!bit) + if (!bit) byte = 0; else byte = ReadUInt8() ^ bit; -- cgit v1.2.3 From ea070e44e0542b56108fd1ae39ba64eb8d4a7f3d Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 31 Jan 2012 15:13:38 +0100 Subject: Core/Items: Defined "unk" field in HotfixInfo --- sql/updates/world/2012_01_31_02_world_hotfix_data.sql | 5 +++++ src/server/game/Globals/ObjectMgr.cpp | 4 ++-- src/server/game/Globals/ObjectMgr.h | 2 +- src/server/game/Handlers/CharacterHandler.cpp | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 sql/updates/world/2012_01_31_02_world_hotfix_data.sql (limited to 'src') diff --git a/sql/updates/world/2012_01_31_02_world_hotfix_data.sql b/sql/updates/world/2012_01_31_02_world_hotfix_data.sql new file mode 100644 index 00000000000..ce45feed943 --- /dev/null +++ b/sql/updates/world/2012_01_31_02_world_hotfix_data.sql @@ -0,0 +1,5 @@ +ALTER TABLE hotfix_data ADD `hotfixDate` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `unk`; +UPDATE `hotfix_data` SET `hotfixDate`=FROM_UNIXTIME(`unk`); +ALTER TABLE `hotfix_data` DROP PRIMARY KEY; +ALTER TABLE `hotfix_data` ADD PRIMARY KEY (`entry`,`type`,`hotfixDate`); +ALTER TABLE `hotfix_data` DROP `unk`; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 9c0c5553b91..6bd34ae19ba 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -9038,7 +9038,7 @@ void ObjectMgr::LoadHotfixData() { uint32 oldMSTime = getMSTime(); - QueryResult result = WorldDatabase.Query("SELECT entry, type, unk FROM hotfix_data"); + QueryResult result = WorldDatabase.Query("SELECT entry, type, UNIX_TIMESTAMP(hotixDate) FROM hotfix_data"); if (!result) { @@ -9058,7 +9058,7 @@ void ObjectMgr::LoadHotfixData() HotfixInfo info; info.Entry = fields[0].GetUInt32(); info.Type = fields[1].GetUInt32(); - info.Unk = fields[2].GetUInt32(); + info.Timestamp = fields[2].GetUInt32(); _hotfixData.push_back(info); ++count; diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index 22bb5e09e50..023b28d0860 100755 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -589,7 +589,7 @@ typedef UNORDERED_MAP DungeonEncounterMap; struct HotfixInfo { uint32 Type; - uint32 Unk; + uint32 Timestamp; uint32 Entry; }; diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 3dccfe9b245..44556f0ec20 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -977,7 +977,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder) for (uint32 i = 0; i < hotfix.size(); ++i) { data << uint32(hotfix[i].Type); - data << uint32(hotfix[i].Unk); + data << uint32(hotfix[i].Timestamp); data << uint32(hotfix[i].Entry); } SendPacket(&data); -- cgit v1.2.3 From 2030a14e8a8e7b914b39fd7d4b010b944dda02aa Mon Sep 17 00:00:00 2001 From: kaelima Date: Tue, 31 Jan 2012 16:48:09 +0100 Subject: Core/Protocol: Correct the struct for SMSG_FEATURE_SYSTEM_STATUS (4.2.2) --- src/server/game/Handlers/CharacterHandler.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 44556f0ec20..ebde812ac76 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -898,9 +898,8 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder) data.Initialize(SMSG_FEATURE_SYSTEM_STATUS, 7); // checked in 4.2.2 data << uint8(2); // unknown value - data << uint8(0); // enable(1)/disable(0) voice chat interface in client - data << uint8(0); - data << uint32(0); // mail related + data << uint8(0); // enable(1) / disable(0) voice chat interface in client + data << uint32(0); // Complain System Status SendPacket(&data); // Send MOTD -- cgit v1.2.3 From 565838d39cf5b2c0b16ff2d7e1998b7f44038f48 Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 1 Feb 2012 15:39:25 +0100 Subject: Core/ObjectMgr: Fixed typo in field name in hotfix loading query --- src/server/game/Globals/ObjectMgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 6bd34ae19ba..7ed4af97a8b 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -9038,7 +9038,7 @@ void ObjectMgr::LoadHotfixData() { uint32 oldMSTime = getMSTime(); - QueryResult result = WorldDatabase.Query("SELECT entry, type, UNIX_TIMESTAMP(hotixDate) FROM hotfix_data"); + QueryResult result = WorldDatabase.Query("SELECT entry, type, UNIX_TIMESTAMP(hotfixDate) FROM hotfix_data"); if (!result) { -- cgit v1.2.3 From cbbd7a96c841faab9a4ddb198438cbbc7e56ccdf Mon Sep 17 00:00:00 2001 From: Shocker Date: Fri, 3 Feb 2012 01:45:47 +0200 Subject: Core/Achievements: Implement more DBC achievement criteria conditions --- src/server/game/Achievements/AchievementMgr.cpp | 17 +++++++++++++++++ src/server/game/DataStores/DBCEnums.h | 8 ++++---- 2 files changed, 21 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 354ee8d1d3b..f72906ed951 100755 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -2139,6 +2139,23 @@ bool AchievementMgr::CanUpdateCriteria(AchievementCriteriaEntry const* criteria, if (unit->ToCreature()->GetCreatureType() != value) return false; break; + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_LEVEL: + if (GetPlayer()->getLevel() != value) + return false; + break; + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_LEVEL: + if (!unit && unit->getLevel() != value) + return false; + break; + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_HEALTH_PERCENT_BELOW: + if (!unit || unit->GetHealthPct() >= value) + return false; + break; + // generic, compare miscValue1 with DBC value + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TITLE_BIT_INDEX: + if (miscValue1 != value) + return false; + break; default: break; } diff --git a/src/server/game/DataStores/DBCEnums.h b/src/server/game/DataStores/DBCEnums.h index bb280140767..8055641f3a4 100755 --- a/src/server/game/DataStores/DBCEnums.h +++ b/src/server/game/DataStores/DBCEnums.h @@ -133,15 +133,15 @@ enum AchievementCriteriaAdditionalCondition ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK35 = 35, // related to timed completing-quests achievements ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK36 = 36, // unused in 4.0.6a ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_MIN_PERSONAL_RATING = 37, // NYI (when implementing don't forget about ACHIEVEMENT_CRITERIA_CONDITION_NO_LOSE) - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TITLE_BIT_INDEX = 38, // NYI - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_LEVEL = 39, // NYI - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_LEVEL = 40, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TITLE_BIT_INDEX = 38, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_LEVEL = 39, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_LEVEL = 40, ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_ZONE = 41, // NYI ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK42 = 42, // unused in 4.0.6a ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK43 = 43, // unused in 4.0.6a ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK44 = 44, // unused in 4.0.6a ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK45 = 45, // unused in 4.0.6a - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_HEALTH_PERCENT_BELOW = 46, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_HEALTH_PERCENT_BELOW = 46, ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK47 = 47, // unused in 4.0.6a ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK48 = 48, // unused in 4.0.6a ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK49 = 49, // unused in 4.0.6a -- cgit v1.2.3 From 04f38855abeeb101de52b091c378991813e4d28d Mon Sep 17 00:00:00 2001 From: Shocker Date: Fri, 3 Feb 2012 19:12:41 +0200 Subject: Core/Misc: Rename UNIT_STAT_* enums to UNIT_STATE_* --- src/server/game/AI/CoreAI/CombatAI.cpp | 4 +- src/server/game/AI/CoreAI/PassiveAI.cpp | 8 +- src/server/game/AI/CoreAI/PetAI.cpp | 4 +- src/server/game/AI/CoreAI/UnitAI.cpp | 4 +- src/server/game/AI/CreatureAIImpl.h | 4 +- src/server/game/AI/EventAI/CreatureEventAI.cpp | 4 +- src/server/game/AI/ScriptedAI/ScriptedCreature.cpp | 4 +- src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp | 2 +- .../game/AI/ScriptedAI/ScriptedFollowerAI.cpp | 14 +-- src/server/game/AI/SmartScripts/SmartScript.cpp | 2 +- src/server/game/Combat/ThreatManager.cpp | 2 +- src/server/game/DungeonFinding/LFGMgr.cpp | 2 +- src/server/game/Entities/Creature/Creature.cpp | 6 +- src/server/game/Entities/Creature/Creature.h | 2 +- src/server/game/Entities/Object/Object.cpp | 2 +- src/server/game/Entities/Player/Player.cpp | 8 +- src/server/game/Entities/Player/Player.h | 2 +- src/server/game/Entities/Unit/Unit.cpp | 110 ++++++++++----------- src/server/game/Entities/Unit/Unit.h | 88 ++++++++--------- src/server/game/Entities/Vehicle/Vehicle.cpp | 8 +- src/server/game/Grids/Notifiers/GridNotifiers.cpp | 2 +- src/server/game/Grids/Notifiers/GridNotifiers.h | 2 +- src/server/game/Handlers/AuctionHouseHandler.cpp | 14 +-- src/server/game/Handlers/CharacterHandler.cpp | 2 +- src/server/game/Handlers/ChatHandler.cpp | 4 +- src/server/game/Handlers/GuildHandler.cpp | 2 +- src/server/game/Handlers/ItemHandler.cpp | 8 +- src/server/game/Handlers/MiscHandler.cpp | 2 +- src/server/game/Handlers/NPCHandler.cpp | 28 +++--- src/server/game/Handlers/PetHandler.cpp | 4 +- src/server/game/Handlers/PetitionsHandler.cpp | 2 +- src/server/game/Handlers/QuestHandler.cpp | 2 +- src/server/game/Handlers/SkillHandler.cpp | 2 +- src/server/game/Handlers/TaxiHandler.cpp | 4 +- src/server/game/Handlers/TradeHandler.cpp | 4 +- src/server/game/Movement/MotionMaster.cpp | 6 +- .../ConfusedMovementGenerator.cpp | 14 +-- .../FleeingMovementGenerator.cpp | 20 ++-- .../MovementGenerators/HomeMovementGenerator.cpp | 8 +- .../MovementGenerators/IdleMovementGenerator.cpp | 14 +-- .../MovementGenerators/PointMovementGenerator.cpp | 14 +-- .../MovementGenerators/RandomMovementGenerator.cpp | 10 +- .../TargetedMovementGenerator.cpp | 16 +-- .../MovementGenerators/TargetedMovementGenerator.h | 8 +- .../WaypointMovementGenerator.cpp | 18 ++-- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 36 +++---- src/server/game/Spells/Auras/SpellAuras.cpp | 2 +- src/server/game/Spells/Spell.cpp | 16 +-- src/server/game/Spells/SpellEffects.cpp | 8 +- src/server/game/Spells/SpellInfo.cpp | 2 +- .../BlackrockSpire/boss_drakkisath.cpp | 2 +- .../EasternKingdoms/BlackrockSpire/boss_gyth.cpp | 2 +- .../BlackrockSpire/boss_halycon.cpp | 2 +- .../BlackrockSpire/boss_highlord_omokk.cpp | 2 +- .../BlackrockSpire/boss_mother_smolderweb.cpp | 2 +- .../BlackrockSpire/boss_overlord_wyrmthalak.cpp | 2 +- .../BlackrockSpire/boss_pyroguard_emberseer.cpp | 2 +- .../BlackrockSpire/boss_quartermaster_zigris.cpp | 2 +- .../BlackrockSpire/boss_rend_blackhand.cpp | 2 +- .../boss_shadow_hunter_voshgajin.cpp | 2 +- .../BlackrockSpire/boss_the_beast.cpp | 2 +- .../BlackrockSpire/boss_warmaster_voone.cpp | 2 +- .../BlackwingLair/boss_victor_nefarius.cpp | 2 +- .../Karazhan/boss_prince_malchezaar.cpp | 2 +- .../MoltenCore/boss_baron_geddon.cpp | 2 +- .../EasternKingdoms/MoltenCore/boss_garr.cpp | 2 +- .../EasternKingdoms/MoltenCore/boss_gehennas.cpp | 2 +- .../EasternKingdoms/MoltenCore/boss_golemagg.cpp | 2 +- .../EasternKingdoms/MoltenCore/boss_lucifron.cpp | 2 +- .../EasternKingdoms/MoltenCore/boss_magmadar.cpp | 2 +- .../MoltenCore/boss_majordomo_executus.cpp | 2 +- .../EasternKingdoms/MoltenCore/boss_shazzrah.cpp | 2 +- .../MoltenCore/boss_sulfuron_harbinger.cpp | 4 +- .../SunwellPlateau/boss_kiljaeden.cpp | 2 +- .../EasternKingdoms/SunwellPlateau/boss_muru.cpp | 12 +-- .../EasternKingdoms/ZulGurub/boss_venoxis.cpp | 2 +- .../Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp | 2 +- .../scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp | 2 +- .../Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp | 2 +- .../TempleOfAhnQiraj/boss_twinemperors.cpp | 10 +- .../AzjolNerub/Ahnkahet/boss_herald_volazj.cpp | 6 +- .../AzjolNerub/AzjolNerub/boss_anubarak.cpp | 2 +- .../RubySanctum/boss_baltharus_the_warborn.cpp | 4 +- .../RubySanctum/boss_general_zarithrian.cpp | 4 +- .../RubySanctum/boss_saviana_ragefire.cpp | 2 +- .../TrialOfTheChampion/boss_black_knight.cpp | 12 +-- .../FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp | 2 +- .../ForgeOfSouls/boss_devourer_of_souls.cpp | 2 +- .../FrozenHalls/ForgeOfSouls/forge_of_souls.cpp | 16 +-- .../FrozenHalls/HallsOfReflection/boss_falric.cpp | 2 +- .../FrozenHalls/HallsOfReflection/boss_marwyn.cpp | 2 +- .../HallsOfReflection/halls_of_reflection.cpp | 10 +- .../PitOfSaron/boss_forgemaster_garfrost.cpp | 2 +- .../FrozenHalls/PitOfSaron/boss_krickandick.cpp | 2 +- .../FrozenHalls/PitOfSaron/pit_of_saron.cpp | 4 +- .../Northrend/Gundrak/boss_drakkari_colossus.cpp | 6 +- .../scripts/Northrend/Gundrak/boss_gal_darah.cpp | 8 +- .../IcecrownCitadel/boss_blood_prince_council.cpp | 16 +-- .../IcecrownCitadel/boss_blood_queen_lana_thel.cpp | 2 +- .../IcecrownCitadel/boss_deathbringer_saurfang.cpp | 2 +- .../Northrend/IcecrownCitadel/boss_festergut.cpp | 4 +- .../IcecrownCitadel/boss_lady_deathwhisper.cpp | 8 +- .../IcecrownCitadel/boss_lord_marrowgar.cpp | 2 +- .../IcecrownCitadel/boss_professor_putricide.cpp | 4 +- .../Northrend/IcecrownCitadel/boss_rotface.cpp | 4 +- .../Northrend/IcecrownCitadel/boss_sindragosa.cpp | 8 +- .../IcecrownCitadel/boss_the_lich_king.cpp | 22 ++--- .../IcecrownCitadel/boss_valithria_dreamwalker.cpp | 12 +-- .../Northrend/IcecrownCitadel/icecrown_citadel.cpp | 14 +-- .../scripts/Northrend/Naxxramas/boss_faerlina.cpp | 2 +- .../Northrend/Naxxramas/boss_four_horsemen.cpp | 2 +- .../scripts/Northrend/Naxxramas/boss_gothik.cpp | 2 +- .../scripts/Northrend/Naxxramas/boss_kelthuzad.cpp | 2 +- .../scripts/Northrend/Naxxramas/boss_thaddius.cpp | 2 +- .../Northrend/Nexus/EyeOfEternity/boss_malygos.cpp | 2 +- .../scripts/Northrend/Nexus/Oculus/boss_drakos.cpp | 2 +- .../scripts/Northrend/Nexus/Oculus/boss_eregos.cpp | 2 +- .../scripts/Northrend/Nexus/Oculus/boss_varos.cpp | 2 +- .../Ulduar/Ulduar/boss_assembly_of_iron.cpp | 6 +- .../Northrend/Ulduar/Ulduar/boss_auriaya.cpp | 6 +- .../Ulduar/Ulduar/boss_flame_leviathan.cpp | 6 +- .../scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp | 8 +- .../Northrend/Ulduar/Ulduar/boss_general_vezax.cpp | 4 +- .../scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp | 20 ++-- .../scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp | 2 +- .../Northrend/Ulduar/Ulduar/boss_kologarn.cpp | 4 +- .../scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp | 2 +- .../UtgardeKeep/boss_ingvar_the_plunderer.cpp | 2 +- .../UtgardeKeep/UtgardeKeep/boss_keleseth.cpp | 2 +- .../UtgardeKeep/UtgardePinnacle/boss_svala.cpp | 4 +- .../Northrend/VaultOfArchavon/boss_archavon.cpp | 4 +- .../Northrend/VaultOfArchavon/boss_emalon.cpp | 4 +- .../Northrend/VaultOfArchavon/boss_koralon.cpp | 2 +- .../Northrend/VaultOfArchavon/boss_toravon.cpp | 4 +- src/server/scripts/Northrend/borean_tundra.cpp | 6 +- .../boss_shirrak_the_dead_watcher.cpp | 2 +- .../HellfireRamparts/boss_vazruden_the_herald.cpp | 4 +- .../MagtheridonsLair/boss_magtheridon.cpp | 8 +- .../instance_magtheridons_lair.cpp | 2 +- .../Outland/TempestKeep/Eye/boss_kaelthas.cpp | 2 +- .../scripts/Outland/boss_doomlord_kazzak.cpp | 2 +- src/server/scripts/Outland/boss_doomwalker.cpp | 2 +- src/server/scripts/Outland/nagrand.cpp | 2 +- src/server/scripts/Outland/netherstorm.cpp | 2 +- src/server/scripts/Outland/shadowmoon_valley.cpp | 4 +- src/server/scripts/Spells/spell_quest.cpp | 2 +- src/server/scripts/World/boss_emerald_dragons.cpp | 2 +- src/server/scripts/World/npcs_special.cpp | 10 +- 148 files changed, 483 insertions(+), 483 deletions(-) (limited to 'src') diff --git a/src/server/game/AI/CoreAI/CombatAI.cpp b/src/server/game/AI/CoreAI/CombatAI.cpp index a83fb6f2789..e178efc7eee 100755 --- a/src/server/game/AI/CoreAI/CombatAI.cpp +++ b/src/server/game/AI/CoreAI/CombatAI.cpp @@ -99,7 +99,7 @@ void CombatAI::UpdateAI(const uint32 diff) events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; if (uint32 spellId = events.ExecuteEvent()) @@ -158,7 +158,7 @@ void CasterAI::UpdateAI(const uint32 diff) events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; if (uint32 spellId = events.ExecuteEvent()) diff --git a/src/server/game/AI/CoreAI/PassiveAI.cpp b/src/server/game/AI/CoreAI/PassiveAI.cpp index 1244e032dbd..3738d5bab6c 100755 --- a/src/server/game/AI/CoreAI/PassiveAI.cpp +++ b/src/server/game/AI/CoreAI/PassiveAI.cpp @@ -61,14 +61,14 @@ void PossessedAI::KilledUnit(Unit* victim) void CritterAI::DamageTaken(Unit* /*done_by*/, uint32&) { - if (!me->HasUnitState(UNIT_STAT_FLEEING)) - me->SetControlled(true, UNIT_STAT_FLEEING); + if (!me->HasUnitState(UNIT_STATE_FLEEING)) + me->SetControlled(true, UNIT_STATE_FLEEING); } void CritterAI::EnterEvadeMode() { - if (me->HasUnitState(UNIT_STAT_FLEEING)) - me->SetControlled(false, UNIT_STAT_FLEEING); + if (me->HasUnitState(UNIT_STATE_FLEEING)) + me->SetControlled(false, UNIT_STATE_FLEEING); CreatureAI::EnterEvadeMode(); } diff --git a/src/server/game/AI/CoreAI/PetAI.cpp b/src/server/game/AI/CoreAI/PetAI.cpp index 015e20415b1..83a89a966c5 100755 --- a/src/server/game/AI/CoreAI/PetAI.cpp +++ b/src/server/game/AI/CoreAI/PetAI.cpp @@ -116,14 +116,14 @@ void PetAI::UpdateAI(const uint32 diff) else HandleReturnMovement(); } - else if (owner && !me->HasUnitState(UNIT_STAT_FOLLOW)) // no charm info and no victim + else if (owner && !me->HasUnitState(UNIT_STATE_FOLLOW)) // no charm info and no victim me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle()); if (!me->GetCharmInfo()) return; // Autocast (casted only in combat or persistent spells in any state) - if (!me->HasUnitState(UNIT_STAT_CASTING)) + if (!me->HasUnitState(UNIT_STATE_CASTING)) { typedef std::vector > TargetSpellList; TargetSpellList targetSpellStore; diff --git a/src/server/game/AI/CoreAI/UnitAI.cpp b/src/server/game/AI/CoreAI/UnitAI.cpp index 38504b90b19..bf50909eeee 100755 --- a/src/server/game/AI/CoreAI/UnitAI.cpp +++ b/src/server/game/AI/CoreAI/UnitAI.cpp @@ -40,7 +40,7 @@ void UnitAI::AttackStartCaster(Unit* victim, float dist) void UnitAI::DoMeleeAttackIfReady() { - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; Unit* victim = me->getVictim(); @@ -60,7 +60,7 @@ void UnitAI::DoMeleeAttackIfReady() bool UnitAI::DoSpellAttackIfReady(uint32 spell) { - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return true; if (me->isAttackReady()) diff --git a/src/server/game/AI/CreatureAIImpl.h b/src/server/game/AI/CreatureAIImpl.h index 147e829b0df..f568da80b49 100755 --- a/src/server/game/AI/CreatureAIImpl.h +++ b/src/server/game/AI/CreatureAIImpl.h @@ -596,7 +596,7 @@ inline bool CreatureAI::_EnterEvadeMode() inline void UnitAI::DoCast(Unit* victim, uint32 spellId, bool triggered) { - if (!victim || (me->HasUnitState(UNIT_STAT_CASTING) && !triggered)) + if (!victim || (me->HasUnitState(UNIT_STATE_CASTING) && !triggered)) return; me->CastSpell(victim, spellId, triggered); @@ -609,7 +609,7 @@ inline void UnitAI::DoCastVictim(uint32 spellId, bool triggered) inline void UnitAI::DoCastAOE(uint32 spellId, bool triggered) { - if (!triggered && me->HasUnitState(UNIT_STAT_CASTING)) + if (!triggered && me->HasUnitState(UNIT_STATE_CASTING)) return; me->CastSpell((Unit*)NULL, spellId, triggered); diff --git a/src/server/game/AI/EventAI/CreatureEventAI.cpp b/src/server/game/AI/EventAI/CreatureEventAI.cpp index 9703757ca7a..ce46d51f579 100755 --- a/src/server/game/AI/EventAI/CreatureEventAI.cpp +++ b/src/server/game/AI/EventAI/CreatureEventAI.cpp @@ -577,7 +577,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 { if (action.combat_movement.melee) { - me->AddUnitState(UNIT_STAT_MELEE_ATTACKING); + me->AddUnitState(UNIT_STATE_MELEE_ATTACKING); me->SendMeleeAttackStart(victim); } if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == IDLE_MOTION_TYPE) @@ -591,7 +591,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 Unit* victim = me->getVictim(); if (action.combat_movement.melee && victim) { - me->ClearUnitState(UNIT_STAT_MELEE_ATTACKING); + me->ClearUnitState(UNIT_STATE_MELEE_ATTACKING); me->SendMeleeAttackStop(victim); } if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE) diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp index ff432abcc82..78adc38a67d 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp @@ -595,7 +595,7 @@ void BossAI::UpdateAI(uint32 const diff) events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -654,7 +654,7 @@ void WorldBossAI::UpdateAI(uint32 const diff) events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp index c5f04d4ff5f..048cc8b3d68 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp @@ -90,7 +90,7 @@ bool npc_escortAI::AssistPlayerInCombat(Unit* who) void npc_escortAI::MoveInLineOfSight(Unit* who) { - if (!me->HasUnitState(UNIT_STAT_STUNNED) && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me)) + if (!me->HasUnitState(UNIT_STATE_STUNNED) && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me)) { if (HasEscortState(STATE_ESCORT_ESCORTING) && AssistPlayerInCombat(who)) return; diff --git a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp index 53747d0c799..d83ad9b756c 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp @@ -38,8 +38,8 @@ void FollowerAI::AttackStart(Unit* who) me->SetInCombatWith(who); who->SetInCombatWith(me); - if (me->HasUnitState(UNIT_STAT_FOLLOW)) - me->ClearUnitState(UNIT_STAT_FOLLOW); + if (me->HasUnitState(UNIT_STATE_FOLLOW)) + me->ClearUnitState(UNIT_STATE_FOLLOW); if (IsCombatMovementAllowed()) me->GetMotionMaster()->MoveChase(who); @@ -88,7 +88,7 @@ bool FollowerAI::AssistPlayerInCombat(Unit* who) void FollowerAI::MoveInLineOfSight(Unit* who) { - if (!me->HasUnitState(UNIT_STAT_STUNNED) && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me)) + if (!me->HasUnitState(UNIT_STATE_STUNNED) && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me)) { if (HasFollowState(STATE_FOLLOW_INPROGRESS) && AssistPlayerInCombat(who)) return; @@ -340,9 +340,9 @@ Player* FollowerAI::GetLeaderForFollower() void FollowerAI::SetFollowComplete(bool bWithEndEvent) { - if (me->HasUnitState(UNIT_STAT_FOLLOW)) + if (me->HasUnitState(UNIT_STATE_FOLLOW)) { - me->ClearUnitState(UNIT_STAT_FOLLOW); + me->ClearUnitState(UNIT_STATE_FOLLOW); me->StopMoving(); me->GetMotionMaster()->Clear(); @@ -369,9 +369,9 @@ void FollowerAI::SetFollowPaused(bool paused) { AddFollowState(STATE_FOLLOW_PAUSED); - if (me->HasUnitState(UNIT_STAT_FOLLOW)) + if (me->HasUnitState(UNIT_STATE_FOLLOW)) { - me->ClearUnitState(UNIT_STAT_FOLLOW); + me->ClearUnitState(UNIT_STATE_FOLLOW); me->StopMoving(); me->GetMotionMaster()->Clear(); diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 3c0bdfcade7..04b1fa2b2e7 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -2714,7 +2714,7 @@ void SmartScript::UpdateTimer(SmartScriptHolder& e, uint32 const diff) { if (!(e.action.cast.flags & SMARTCAST_INTERRUPT_PREVIOUS)) { - if (me && me->HasUnitState(UNIT_STAT_CASTING)) + if (me && me->HasUnitState(UNIT_STATE_CASTING)) { e.timer = 1; return; diff --git a/src/server/game/Combat/ThreatManager.cpp b/src/server/game/Combat/ThreatManager.cpp index 7833198e3c3..d82e43ba83b 100755 --- a/src/server/game/Combat/ThreatManager.cpp +++ b/src/server/game/Combat/ThreatManager.cpp @@ -180,7 +180,7 @@ void HostileReference::updateOnlineStatus() // target is not in flight if (isValid() && (getTarget()->GetTypeId() != TYPEID_PLAYER || !getTarget()->ToPlayer()->isGameMaster()) - && !getTarget()->HasUnitState(UNIT_STAT_IN_FLIGHT) + && !getTarget()->HasUnitState(UNIT_STATE_IN_FLIGHT) && getTarget()->IsInMap(getSourceUnit()) ) { diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index ac7343e8f23..cccb780e412 100755 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -1762,7 +1762,7 @@ void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false* error = LFG_TELEPORTERROR_INVALID_LOCATION; else if (!player->isAlive()) error = LFG_TELEPORTERROR_PLAYER_DEAD; - else if (player->IsFalling() || player->HasUnitState(UNIT_STAT_JUMPING)) + else if (player->IsFalling() || player->HasUnitState(UNIT_STATE_JUMPING)) error = LFG_TELEPORTERROR_FALLING; else { diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 25682999f62..82c5ce09d35 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -685,7 +685,7 @@ void Creature::DoFleeToGetAssistance() if (!creature) //SetFeared(true, getVictim()->GetGUID(), 0, sWorld->getIntConfig(CONFIG_CREATURE_FAMILY_FLEE_DELAY)); //TODO: use 31365 - SetControlled(true, UNIT_STAT_FLEEING); + SetControlled(true, UNIT_STATE_FLEEING); else GetMotionMaster()->MoveSeekAssistance(creature->GetPositionX(), creature->GetPositionY(), creature->GetPositionZ()); } @@ -1536,7 +1536,7 @@ void Creature::setDeathState(DeathState s) if (GetCreatureInfo()->InhabitType & INHABIT_WATER) AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING); SetUInt32Value(UNIT_NPC_FLAGS, cinfo->npcflag); - ClearUnitState(uint32(UNIT_STAT_ALL_STATE)); + ClearUnitState(uint32(UNIT_STATE_ALL_STATE)); SetMeleeDamageSchool(SpellSchools(cinfo->dmgschool)); LoadCreaturesAddon(true); Motion_Initialize(); @@ -1949,7 +1949,7 @@ bool Creature::_IsTargetAcceptable(const Unit* target) const || (m_vehicle && (IsOnVehicle(target) || m_vehicle->GetBase()->IsOnVehicle(target)))) return false; - if (target->HasUnitState(UNIT_STAT_DIED)) + if (target->HasUnitState(UNIT_STATE_DIED)) { // guards can detect fake death if (isGuard() && target->HasFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH)) diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index 908f2b7e312..e890b6ac6fe 100755 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -514,7 +514,7 @@ class Creature : public Unit, public GridObject, public MapCreature uint8 getLevelForTarget(WorldObject const* target) const; // overwrite Unit::getLevelForTarget for boss level support - bool IsInEvadeMode() const { return HasUnitState(UNIT_STAT_EVADE); } + bool IsInEvadeMode() const { return HasUnitState(UNIT_STATE_EVADE); } bool AIM_Initialize(CreatureAI* ai = NULL); void Motion_Initialize(); diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index d89849f7ccf..0332d0998b4 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -2417,7 +2417,7 @@ namespace Trinity float x, y, z; - if (!c->isAlive() || c->HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED) || + if (!c->isAlive() || c->HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED | UNIT_STATE_DISTRACTED) || !c->GetMotionMaster()->GetDestination(x, y, z)) { x = c->GetPositionX(); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 8cf1413611b..21994640e63 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -1562,7 +1562,7 @@ void Player::Update(uint32 p_time) GetAchievementMgr().UpdateTimedAchievements(p_time); - if (HasUnitState(UNIT_STAT_MELEE_ATTACKING) && !HasUnitState(UNIT_STAT_CASTING)) + if (HasUnitState(UNIT_STATE_MELEE_ATTACKING) && !HasUnitState(UNIT_STATE_CASTING)) { if (Unit* pVictim = getVictim()) { @@ -11519,7 +11519,7 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool { // May be here should be more stronger checks; STUNNED checked // ROOT, CONFUSED, DISTRACTED, FLEEING this needs to be checked. - if (HasUnitState(UNIT_STAT_STUNNED)) + if (HasUnitState(UNIT_STATE_STUNNED)) return EQUIP_ERR_YOU_ARE_STUNNED; // do not allow equipping gear except weapons, offhands, projectiles, relics in @@ -20385,7 +20385,7 @@ bool Player::ActivateTaxiPathTo(std::vector const& nodes, Creature* npc return false; // not let cheating with start flight in time of logout process || while in combat || has type state: stunned || has type state: root - if (GetSession()->isLogingOut() || isInCombat() || HasUnitState(UNIT_STAT_STUNNED) || HasUnitState(UNIT_STAT_ROOT)) + if (GetSession()->isLogingOut() || isInCombat() || HasUnitState(UNIT_STATE_STUNNED) || HasUnitState(UNIT_STATE_ROOT)) { WorldPacket data(SMSG_ACTIVATETAXIREPLY, 4); data << uint32(ERR_TAXIPLAYERBUSY); @@ -21666,7 +21666,7 @@ void Player::SendInitialVisiblePackets(Unit* target) SendAurasForTarget(target); if (target->isAlive()) { - if (target->HasUnitState(UNIT_STAT_MELEE_ATTACKING) && target->getVictim()) + if (target->HasUnitState(UNIT_STATE_MELEE_ATTACKING) && target->getVictim()) target->SendMeleeAttackStart(target->getVictim()); } } diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index f462f5af48f..ae2e0df2a63 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1881,7 +1881,7 @@ class Player : public Unit, public GridObject void SetContestedPvPTimer(uint32 newTime) {m_contestedPvPTimer = newTime;} void ResetContestedPvP() { - ClearUnitState(UNIT_STAT_ATTACK_PLAYER); + ClearUnitState(UNIT_STATE_ATTACK_PLAYER); RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_CONTESTED_PVP); m_contestedPvPTimer = 0; } diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 103e42a9da9..1fda85c6c9c 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -316,7 +316,7 @@ void Unit::Update(uint32 p_time) // update combat timer only for players and pets (only pets with PetAI) if (isInCombat() && (GetTypeId() == TYPEID_PLAYER || (ToCreature()->isPet() && IsControlledByPlayer()))) { - // Check UNIT_STAT_MELEE_ATTACKING or UNIT_STAT_CHASE (without UNIT_STAT_FOLLOW in this case) so pets can reach far away + // Check UNIT_STATE_MELEE_ATTACKING or UNIT_STATE_CHASE (without UNIT_STATE_FOLLOW in this case) so pets can reach far away // targets without stopping half way there and running off. // These flags are reset after target dies or another command is given. if (m_HostileRefManager.isEmpty()) @@ -518,7 +518,7 @@ bool Unit::HasAuraTypeWithFamilyFlags(AuraType auraType, uint32 familyName, uint void Unit::DealDamageMods(Unit* victim, uint32 &damage, uint32* absorb) { - if (!victim || !victim->isAlive() || victim->HasUnitState(UNIT_STAT_IN_FLIGHT) || (victim->GetTypeId() == TYPEID_UNIT && victim->ToCreature()->IsInEvadeMode())) + if (!victim || !victim->isAlive() || victim->HasUnitState(UNIT_STATE_IN_FLIGHT) || (victim->GetTypeId() == TYPEID_UNIT && victim->ToCreature()->IsInEvadeMode())) { if (absorb) *absorb += damage; @@ -1043,7 +1043,7 @@ void Unit::DealSpellDamage(SpellNonMeleeDamage* damageInfo, bool durabilityLoss) if (!victim) return; - if (!victim->isAlive() || victim->HasUnitState(UNIT_STAT_IN_FLIGHT) || (victim->GetTypeId() == TYPEID_UNIT && victim->ToCreature()->IsInEvadeMode())) + if (!victim->isAlive() || victim->HasUnitState(UNIT_STATE_IN_FLIGHT) || (victim->GetTypeId() == TYPEID_UNIT && victim->ToCreature()->IsInEvadeMode())) return; SpellInfo const* spellProto = sSpellMgr->GetSpellInfo(damageInfo->SpellID); @@ -1260,7 +1260,7 @@ void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss) { Unit* victim = damageInfo->target; - if (!victim->isAlive() || victim->HasUnitState(UNIT_STAT_IN_FLIGHT) || (victim->GetTypeId() == TYPEID_UNIT && victim->ToCreature()->IsInEvadeMode())) + if (!victim->isAlive() || victim->HasUnitState(UNIT_STATE_IN_FLIGHT) || (victim->GetTypeId() == TYPEID_UNIT && victim->ToCreature()->IsInEvadeMode())) return; // Hmmmm dont like this emotes client must by self do all animations @@ -1845,7 +1845,7 @@ void Unit::CalcHealAbsorb(Unit* victim, const SpellInfo* healSpell, uint32 &heal void Unit::AttackerStateUpdate (Unit* victim, WeaponAttackType attType, bool extra) { - if (HasUnitState(UNIT_STAT_CANNOT_AUTOATTACK) || HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED)) + if (HasUnitState(UNIT_STATE_CANNOT_AUTOATTACK) || HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED)) return; if (!victim->isAlive()) @@ -2563,7 +2563,7 @@ uint32 Unit::GetDefenseSkillValue(Unit const* target) const float Unit::GetUnitDodgeChance() const { - if (IsNonMeleeSpellCasted(false) || HasUnitState(UNIT_STAT_CONTROLLED)) + if (IsNonMeleeSpellCasted(false) || HasUnitState(UNIT_STATE_CONTROLLED)) return 0.0f; if (GetTypeId() == TYPEID_PLAYER) @@ -2583,7 +2583,7 @@ float Unit::GetUnitDodgeChance() const float Unit::GetUnitParryChance() const { - if (IsNonMeleeSpellCasted(false) || HasUnitState(UNIT_STAT_CONTROLLED)) + if (IsNonMeleeSpellCasted(false) || HasUnitState(UNIT_STATE_CONTROLLED)) return 0.0f; float chance = 0.0f; @@ -2629,7 +2629,7 @@ float Unit::GetUnitMissChance(WeaponAttackType attType) const float Unit::GetUnitBlockChance() const { - if (IsNonMeleeSpellCasted(false) || HasUnitState(UNIT_STAT_CONTROLLED)) + if (IsNonMeleeSpellCasted(false) || HasUnitState(UNIT_STATE_CONTROLLED)) return 0.0f; if (Player const* player = ToPlayer()) @@ -2881,7 +2881,7 @@ void Unit::SetCurrentCastedSpell(Spell* pSpell) InterruptSpell(CURRENT_AUTOREPEAT_SPELL); m_AutoRepeatFirstCast = true; } - AddUnitState(UNIT_STAT_CASTING); + AddUnitState(UNIT_STATE_CASTING); } break; case CURRENT_CHANNELED_SPELL: @@ -2894,7 +2894,7 @@ void Unit::SetCurrentCastedSpell(Spell* pSpell) if (m_currentSpells[CURRENT_AUTOREPEAT_SPELL] && m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo->Id != 75) InterruptSpell(CURRENT_AUTOREPEAT_SPELL); - AddUnitState(UNIT_STAT_CASTING); + AddUnitState(UNIT_STATE_CASTING); } break; case CURRENT_AUTOREPEAT_SPELL: @@ -9349,16 +9349,16 @@ bool Unit::Attack(Unit* victim, bool meleeAttack) // switch to melee attack from ranged/magic if (meleeAttack) { - if (!HasUnitState(UNIT_STAT_MELEE_ATTACKING)) + if (!HasUnitState(UNIT_STATE_MELEE_ATTACKING)) { - AddUnitState(UNIT_STAT_MELEE_ATTACKING); + AddUnitState(UNIT_STATE_MELEE_ATTACKING); SendMeleeAttackStart(victim); return true; } } - else if (HasUnitState(UNIT_STAT_MELEE_ATTACKING)) + else if (HasUnitState(UNIT_STATE_MELEE_ATTACKING)) { - ClearUnitState(UNIT_STAT_MELEE_ATTACKING); + ClearUnitState(UNIT_STATE_MELEE_ATTACKING); SendMeleeAttackStop(victim); return true; } @@ -9368,7 +9368,7 @@ bool Unit::Attack(Unit* victim, bool meleeAttack) // switch target InterruptSpell(CURRENT_MELEE_SPELL); if (!meleeAttack) - ClearUnitState(UNIT_STAT_MELEE_ATTACKING); + ClearUnitState(UNIT_STATE_MELEE_ATTACKING); } if (m_attacking) @@ -9381,7 +9381,7 @@ bool Unit::Attack(Unit* victim, bool meleeAttack) SetTarget(victim->GetGUID()); if (meleeAttack) - AddUnitState(UNIT_STAT_MELEE_ATTACKING); + AddUnitState(UNIT_STATE_MELEE_ATTACKING); // set position before any AI calls/assistance //if (GetTypeId() == TYPEID_UNIT) @@ -9422,7 +9422,7 @@ bool Unit::AttackStop() // Clear our target SetTarget(0); - ClearUnitState(UNIT_STAT_MELEE_ATTACKING); + ClearUnitState(UNIT_STATE_MELEE_ATTACKING); InterruptSpell(CURRENT_MELEE_SPELL); @@ -9465,7 +9465,7 @@ void Unit::CombatStopWithPets(bool includingCast) bool Unit::isAttackingPlayer() const { - if (HasUnitState(UNIT_STAT_ATTACK_PLAYER)) + if (HasUnitState(UNIT_STATE_ATTACK_PLAYER)) return true; for (ControlList::const_iterator itr = m_Controlled.begin(); itr != m_Controlled.end(); ++itr) @@ -11922,7 +11922,7 @@ void Unit::Dismount() { if (Pet* pPet = player->GetPet()) { - if (pPet->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED) && !pPet->HasUnitState(UNIT_STAT_STUNNED)) + if (pPet->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED) && !pPet->HasUnitState(UNIT_STATE_STUNNED)) pPet->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); } else @@ -12049,7 +12049,7 @@ void Unit::SetInCombatState(bool PvP, Unit* enemy) if (PvP) m_CombatTimer = 5000; - if (isInCombat() || HasUnitState(UNIT_STAT_EVADE)) + if (isInCombat() || HasUnitState(UNIT_STATE_EVADE)) return; SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); @@ -12102,7 +12102,7 @@ void Unit::ClearInCombat() if (creature->GetCreatureInfo() && creature->GetCreatureInfo()->unit_flags & UNIT_FLAG_OOC_NOT_ATTACKABLE) SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); // re-apply Out of Combat Non Attackable flag if we leave combat, can be overriden in scripts in EnterEvadeMode() - ClearUnitState(UNIT_STAT_ATTACK_PLAYER); + ClearUnitState(UNIT_STATE_ATTACK_PLAYER); if (HasFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_TAPPED)) SetUInt32Value(UNIT_DYNAMIC_FLAGS, creature->GetCreatureInfo()->dynamicflags); @@ -12134,7 +12134,7 @@ bool Unit::isTargetableForAttack(bool checkFakeDeath) const if (GetTypeId() == TYPEID_PLAYER && ToPlayer()->isGameMaster()) return false; - return !HasUnitState(UNIT_STAT_UNATTACKABLE) && (!checkFakeDeath || !HasUnitState(UNIT_STAT_DIED)); + return !HasUnitState(UNIT_STATE_UNATTACKABLE) && (!checkFakeDeath || !HasUnitState(UNIT_STATE_DIED)); } bool Unit::IsValidAttackTarget(Unit const* target) const @@ -12152,7 +12152,7 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell) co return false; // can't attack unattackable units or GMs - if (target->HasUnitState(UNIT_STAT_UNATTACKABLE) + if (target->HasUnitState(UNIT_STATE_UNATTACKABLE) || (target->GetTypeId() == TYPEID_PLAYER && target->ToPlayer()->isGameMaster())) return false; @@ -12246,7 +12246,7 @@ bool Unit::_IsValidAssistTarget(Unit const* target, SpellInfo const* bySpell) co return true; // can't assist unattackable units or GMs - if (target->HasUnitState(UNIT_STAT_UNATTACKABLE) + if (target->HasUnitState(UNIT_STATE_UNATTACKABLE) || (target->GetTypeId() == TYPEID_PLAYER && target->ToPlayer()->isGameMaster())) return false; @@ -15055,7 +15055,7 @@ void Unit::SendPetAIReaction(uint64 guid) void Unit::StopMoving() { - ClearUnitState(UNIT_STAT_MOVING); + ClearUnitState(UNIT_STATE_MOVING); // not need send any packets if not in world if (!IsInWorld()) @@ -15437,16 +15437,16 @@ void Unit::SetContestedPvP(Player* attackedPlayer) return; player->SetContestedPvPTimer(30000); - if (!player->HasUnitState(UNIT_STAT_ATTACK_PLAYER)) + if (!player->HasUnitState(UNIT_STATE_ATTACK_PLAYER)) { - player->AddUnitState(UNIT_STAT_ATTACK_PLAYER); + player->AddUnitState(UNIT_STATE_ATTACK_PLAYER); player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_CONTESTED_PVP); // call MoveInLineOfSight for nearby contested guards UpdateObjectVisibility(); } - if (!HasUnitState(UNIT_STAT_ATTACK_PLAYER)) + if (!HasUnitState(UNIT_STATE_ATTACK_PLAYER)) { - AddUnitState(UNIT_STAT_ATTACK_PLAYER); + AddUnitState(UNIT_STATE_ATTACK_PLAYER); // call MoveInLineOfSight for nearby contested guards UpdateObjectVisibility(); } @@ -16014,28 +16014,28 @@ void Unit::SetControlled(bool apply, UnitState state) AddUnitState(state); switch (state) { - case UNIT_STAT_STUNNED: + case UNIT_STATE_STUNNED: SetStunned(true); CastStop(); break; - case UNIT_STAT_ROOT: - if (!HasUnitState(UNIT_STAT_STUNNED)) + case UNIT_STATE_ROOT: + if (!HasUnitState(UNIT_STATE_STUNNED)) SetRooted(true); break; - case UNIT_STAT_CONFUSED: - if (!HasUnitState(UNIT_STAT_STUNNED)) + case UNIT_STATE_CONFUSED: + if (!HasUnitState(UNIT_STATE_STUNNED)) { - ClearUnitState(UNIT_STAT_MELEE_ATTACKING); + ClearUnitState(UNIT_STATE_MELEE_ATTACKING); SendMeleeAttackStop(); // SendAutoRepeatCancel ? SetConfused(true); CastStop(); } break; - case UNIT_STAT_FLEEING: - if (!HasUnitState(UNIT_STAT_STUNNED | UNIT_STAT_CONFUSED)) + case UNIT_STATE_FLEEING: + if (!HasUnitState(UNIT_STATE_STUNNED | UNIT_STATE_CONFUSED)) { - ClearUnitState(UNIT_STAT_MELEE_ATTACKING); + ClearUnitState(UNIT_STATE_MELEE_ATTACKING); SendMeleeAttackStop(); // SendAutoRepeatCancel ? SetFeared(true); @@ -16050,29 +16050,29 @@ void Unit::SetControlled(bool apply, UnitState state) { switch (state) { - case UNIT_STAT_STUNNED: if (HasAuraType(SPELL_AURA_MOD_STUN)) return; + case UNIT_STATE_STUNNED: if (HasAuraType(SPELL_AURA_MOD_STUN)) return; else SetStunned(false); break; - case UNIT_STAT_ROOT: if (HasAuraType(SPELL_AURA_MOD_ROOT) || GetVehicle()) return; + case UNIT_STATE_ROOT: if (HasAuraType(SPELL_AURA_MOD_ROOT) || GetVehicle()) return; else SetRooted(false); break; - case UNIT_STAT_CONFUSED:if (HasAuraType(SPELL_AURA_MOD_CONFUSE)) return; + case UNIT_STATE_CONFUSED:if (HasAuraType(SPELL_AURA_MOD_CONFUSE)) return; else SetConfused(false); break; - case UNIT_STAT_FLEEING: if (HasAuraType(SPELL_AURA_MOD_FEAR)) return; + case UNIT_STATE_FLEEING: if (HasAuraType(SPELL_AURA_MOD_FEAR)) return; else SetFeared(false); break; default: return; } ClearUnitState(state); - if (HasUnitState(UNIT_STAT_STUNNED)) + if (HasUnitState(UNIT_STATE_STUNNED)) SetStunned(true); else { - if (HasUnitState(UNIT_STAT_ROOT)) + if (HasUnitState(UNIT_STATE_ROOT)) SetRooted(true); - if (HasUnitState(UNIT_STAT_CONFUSED)) + if (HasUnitState(UNIT_STATE_CONFUSED)) SetConfused(true); - else if (HasUnitState(UNIT_STAT_FLEEING)) + else if (HasUnitState(UNIT_STATE_FLEEING)) SetFeared(true); } } @@ -16114,7 +16114,7 @@ void Unit::SetStunned(bool apply) if (!owner || (owner->GetTypeId() == TYPEID_PLAYER && !owner->ToPlayer()->IsMounted())) RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); - if (!HasUnitState(UNIT_STAT_ROOT)) // prevent moving if it also has root effect + if (!HasUnitState(UNIT_STATE_ROOT)) // prevent moving if it also has root effect { WorldPacket data(SMSG_MOVE_UNROOT, 8+4); data.append(GetPackGUID()); @@ -16156,7 +16156,7 @@ void Unit::SetRooted(bool apply) } else { - if (!HasUnitState(UNIT_STAT_STUNNED)) // prevent moving if it also has stun effect + if (!HasUnitState(UNIT_STATE_STUNNED)) // prevent moving if it also has stun effect { if (GetTypeId() == TYPEID_PLAYER) { @@ -16248,7 +16248,7 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au return false; } - //if (HasUnitState(UNIT_STAT_UNATTACKABLE)) + //if (HasUnitState(UNIT_STATE_UNATTACKABLE)) // return false; if (GetTypeId() == TYPEID_PLAYER && ToPlayer()->GetTransport()) @@ -16341,7 +16341,7 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au charmer->ToPlayer()->VehicleSpellInitialize(); break; case CHARM_TYPE_POSSESS: - AddUnitState(UNIT_STAT_POSSESSED); + AddUnitState(UNIT_STATE_POSSESSED); SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED); charmer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); charmer->ToPlayer()->SetClientControl(this, 1); @@ -16392,7 +16392,7 @@ void Unit::RemoveCharmedBy(Unit* charmer) } CharmType type; - if (HasUnitState(UNIT_STAT_POSSESSED)) + if (HasUnitState(UNIT_STATE_POSSESSED)) type = CHARM_TYPE_POSSESS; else if (charmer && charmer->IsOnVehicle(this)) type = CHARM_TYPE_VEHICLE; @@ -16410,7 +16410,7 @@ void Unit::RemoveCharmedBy(Unit* charmer) if (type == CHARM_TYPE_POSSESS) { - ClearUnitState(UNIT_STAT_POSSESSED); + ClearUnitState(UNIT_STATE_POSSESSED); RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED); } @@ -17488,7 +17488,7 @@ void Unit::_ExitVehicle(Position const* exitPosition) Vehicle* vehicle = m_vehicle; m_vehicle = NULL; - SetControlled(false, UNIT_STAT_ROOT); // SMSG_MOVE_FORCE_UNROOT, ~MOVEMENTFLAG_ROOT + SetControlled(false, UNIT_STATE_ROOT); // SMSG_MOVE_FORCE_UNROOT, ~MOVEMENTFLAG_ROOT Position pos; if (!exitPosition) // Exit position not specified @@ -17496,7 +17496,7 @@ void Unit::_ExitVehicle(Position const* exitPosition) else pos = *exitPosition; - AddUnitState(UNIT_STAT_MOVE); + AddUnitState(UNIT_STATE_MOVE); if (GetTypeId() == TYPEID_PLAYER) ToPlayer()->SetFallInformation(0, GetPositionZ()); @@ -17936,7 +17936,7 @@ bool CharmInfo::IsReturning() void Unit::SetInFront(Unit const* target) { - if (!HasUnitState(UNIT_STAT_CANNOT_TURN)) + if (!HasUnitState(UNIT_STATE_CANNOT_TURN)) SetOrientation(GetAngle(target)); } diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index c50cba080c7..e65574bbfbc 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -469,46 +469,46 @@ enum DeathState enum UnitState { - UNIT_STAT_DIED = 0x00000001, // player has fake death aura - UNIT_STAT_MELEE_ATTACKING = 0x00000002, // player is melee attacking someone - //UNIT_STAT_MELEE_ATTACK_BY = 0x00000004, // player is melee attack by someone - UNIT_STAT_STUNNED = 0x00000008, - UNIT_STAT_ROAMING = 0x00000010, - UNIT_STAT_CHASE = 0x00000020, - //UNIT_STAT_SEARCHING = 0x00000040, - UNIT_STAT_FLEEING = 0x00000080, - UNIT_STAT_IN_FLIGHT = 0x00000100, // player is in flight mode - UNIT_STAT_FOLLOW = 0x00000200, - UNIT_STAT_ROOT = 0x00000400, - UNIT_STAT_CONFUSED = 0x00000800, - UNIT_STAT_DISTRACTED = 0x00001000, - UNIT_STAT_ISOLATED = 0x00002000, // area auras do not affect other players - UNIT_STAT_ATTACK_PLAYER = 0x00004000, - UNIT_STAT_CASTING = 0x00008000, - UNIT_STAT_POSSESSED = 0x00010000, - UNIT_STAT_CHARGING = 0x00020000, - UNIT_STAT_JUMPING = 0x00040000, - UNIT_STAT_ONVEHICLE = 0x00080000, - UNIT_STAT_MOVE = 0x00100000, - UNIT_STAT_ROTATING = 0x00200000, - UNIT_STAT_EVADE = 0x00400000, - UNIT_STAT_ROAMING_MOVE = 0x00800000, - UNIT_STAT_CONFUSED_MOVE = 0x01000000, - UNIT_STAT_FLEEING_MOVE = 0x02000000, - UNIT_STAT_CHASE_MOVE = 0x04000000, - UNIT_STAT_FOLLOW_MOVE = 0x08000000, - UNIT_STAT_UNATTACKABLE = (UNIT_STAT_IN_FLIGHT | UNIT_STAT_ONVEHICLE), - //UNIT_STAT_MOVING = (UNIT_STAT_ROAMING | UNIT_STAT_CHASE), + UNIT_STATE_DIED = 0x00000001, // player has fake death aura + UNIT_STATE_MELEE_ATTACKING = 0x00000002, // player is melee attacking someone + //UNIT_STATE_MELEE_ATTACK_BY = 0x00000004, // player is melee attack by someone + UNIT_STATE_STUNNED = 0x00000008, + UNIT_STATE_ROAMING = 0x00000010, + UNIT_STATE_CHASE = 0x00000020, + //UNIT_STATE_SEARCHING = 0x00000040, + UNIT_STATE_FLEEING = 0x00000080, + UNIT_STATE_IN_FLIGHT = 0x00000100, // player is in flight mode + UNIT_STATE_FOLLOW = 0x00000200, + UNIT_STATE_ROOT = 0x00000400, + UNIT_STATE_CONFUSED = 0x00000800, + UNIT_STATE_DISTRACTED = 0x00001000, + UNIT_STATE_ISOLATED = 0x00002000, // area auras do not affect other players + UNIT_STATE_ATTACK_PLAYER = 0x00004000, + UNIT_STATE_CASTING = 0x00008000, + UNIT_STATE_POSSESSED = 0x00010000, + UNIT_STATE_CHARGING = 0x00020000, + UNIT_STATE_JUMPING = 0x00040000, + UNIT_STATE_ONVEHICLE = 0x00080000, + UNIT_STATE_MOVE = 0x00100000, + UNIT_STATE_ROTATING = 0x00200000, + UNIT_STATE_EVADE = 0x00400000, + UNIT_STATE_ROAMING_MOVE = 0x00800000, + UNIT_STATE_CONFUSED_MOVE = 0x01000000, + UNIT_STATE_FLEEING_MOVE = 0x02000000, + UNIT_STATE_CHASE_MOVE = 0x04000000, + UNIT_STATE_FOLLOW_MOVE = 0x08000000, + UNIT_STATE_UNATTACKABLE = (UNIT_STATE_IN_FLIGHT | UNIT_STATE_ONVEHICLE), + //UNIT_STATE_MOVING = (UNIT_STATE_ROAMING | UNIT_STATE_CHASE), // for real move using movegen check and stop (except unstoppable flight) - UNIT_STAT_MOVING = UNIT_STAT_ROAMING_MOVE | UNIT_STAT_CONFUSED_MOVE | UNIT_STAT_FLEEING_MOVE| UNIT_STAT_CHASE_MOVE | UNIT_STAT_FOLLOW_MOVE , - UNIT_STAT_CONTROLLED = (UNIT_STAT_CONFUSED | UNIT_STAT_STUNNED | UNIT_STAT_FLEEING), - UNIT_STAT_LOST_CONTROL = (UNIT_STAT_CONTROLLED | UNIT_STAT_JUMPING | UNIT_STAT_CHARGING), - UNIT_STAT_SIGHTLESS = (UNIT_STAT_LOST_CONTROL | UNIT_STAT_EVADE), - UNIT_STAT_CANNOT_AUTOATTACK = (UNIT_STAT_LOST_CONTROL | UNIT_STAT_CASTING), - UNIT_STAT_CANNOT_TURN = (UNIT_STAT_LOST_CONTROL | UNIT_STAT_ROTATING), + UNIT_STATE_MOVING = UNIT_STATE_ROAMING_MOVE | UNIT_STATE_CONFUSED_MOVE | UNIT_STATE_FLEEING_MOVE| UNIT_STATE_CHASE_MOVE | UNIT_STATE_FOLLOW_MOVE , + UNIT_STATE_CONTROLLED = (UNIT_STATE_CONFUSED | UNIT_STATE_STUNNED | UNIT_STATE_FLEEING), + UNIT_STATE_LOST_CONTROL = (UNIT_STATE_CONTROLLED | UNIT_STATE_JUMPING | UNIT_STATE_CHARGING), + UNIT_STATE_SIGHTLESS = (UNIT_STATE_LOST_CONTROL | UNIT_STATE_EVADE), + UNIT_STATE_CANNOT_AUTOATTACK = (UNIT_STATE_LOST_CONTROL | UNIT_STATE_CASTING), + UNIT_STATE_CANNOT_TURN = (UNIT_STATE_LOST_CONTROL | UNIT_STATE_ROTATING), // stay by different reasons - UNIT_STAT_NOT_MOVE = UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DIED | UNIT_STAT_DISTRACTED, - UNIT_STAT_ALL_STATE = 0xffffffff //(UNIT_STAT_STOPPED | UNIT_STAT_MOVING | UNIT_STAT_IN_COMBAT | UNIT_STAT_IN_FLIGHT) + UNIT_STATE_NOT_MOVE = UNIT_STATE_ROOT | UNIT_STATE_STUNNED | UNIT_STATE_DIED | UNIT_STATE_DISTRACTED, + UNIT_STATE_ALL_STATE = 0xffffffff //(UNIT_STATE_STOPPED | UNIT_STATE_MOVING | UNIT_STATE_IN_COMBAT | UNIT_STATE_IN_FLIGHT) }; enum UnitMoveType @@ -1289,8 +1289,8 @@ class Unit : public WorldObject void ClearUnitState(uint32 f) { m_state &= ~f; } bool CanFreeMove() const { - return !HasUnitState(UNIT_STAT_CONFUSED | UNIT_STAT_FLEEING | UNIT_STAT_IN_FLIGHT | - UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED) && GetOwnerGUID() == 0; + return !HasUnitState(UNIT_STATE_CONFUSED | UNIT_STATE_FLEEING | UNIT_STATE_IN_FLIGHT | + UNIT_STATE_ROOT | UNIT_STATE_STUNNED | UNIT_STATE_DISTRACTED) && GetOwnerGUID() == 0; } uint32 HasUnitTypeMask(uint32 mask) const { return mask & m_unitTypeMask; } @@ -1528,7 +1528,7 @@ class Unit : public WorldObject } bool isSpiritService() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPIRITHEALER | UNIT_NPC_FLAG_SPIRITGUIDE); } - bool isInFlight() const { return HasUnitState(UNIT_STAT_IN_FLIGHT); } + bool isInFlight() const { return HasUnitState(UNIT_STATE_IN_FLIGHT); } bool isInCombat() const { return HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); } void CombatStart(Unit* target, bool initialAggro = true); @@ -1685,8 +1685,8 @@ class Unit : public WorldObject void RemoveAllControlled(); bool isCharmed() const { return GetCharmerGUID() != 0; } - bool isPossessed() const { return HasUnitState(UNIT_STAT_POSSESSED); } - bool isPossessedByPlayer() const { return HasUnitState(UNIT_STAT_POSSESSED) && IS_PLAYER_GUID(GetCharmerGUID()); } + bool isPossessed() const { return HasUnitState(UNIT_STATE_POSSESSED); } + bool isPossessedByPlayer() const { return HasUnitState(UNIT_STATE_POSSESSED) && IS_PLAYER_GUID(GetCharmerGUID()); } bool isPossessing() const { if (Unit* u = GetCharm()) @@ -2051,7 +2051,7 @@ class Unit : public WorldObject MotionMaster* GetMotionMaster() { return &i_motionMaster; } const MotionMaster* GetMotionMaster() const { return &i_motionMaster; } - bool IsStopped() const { return !(HasUnitState(UNIT_STAT_MOVING)); } + bool IsStopped() const { return !(HasUnitState(UNIT_STATE_MOVING)); } void StopMoving(); void AddUnitMovementFlag(uint32 f) { m_movementInfo.flags |= f; } diff --git a/src/server/game/Entities/Vehicle/Vehicle.cpp b/src/server/game/Entities/Vehicle/Vehicle.cpp index 677ef5032f2..0ff5d402242 100755 --- a/src/server/game/Entities/Vehicle/Vehicle.cpp +++ b/src/server/game/Entities/Vehicle/Vehicle.cpp @@ -176,7 +176,7 @@ void Vehicle::ApplyAllImmunities() case 160: // Strand of the Ancients case 244: // Wintergrasp case 510: // Isle of Conquest - _me->SetControlled(true, UNIT_STAT_ROOT); + _me->SetControlled(true, UNIT_STATE_ROOT); // why we need to apply this? we can simple add immunities to slow mechanic in DB _me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_DECREASE_SPEED, true); break; @@ -342,7 +342,7 @@ bool Vehicle::AddPassenger(Unit* unit, int8 seatId) } if (seat->second.SeatInfo->m_flags && !(seat->second.SeatInfo->m_flags & VEHICLE_SEAT_FLAG_UNK1)) - unit->AddUnitState(UNIT_STAT_ONVEHICLE); + unit->AddUnitState(UNIT_STATE_ONVEHICLE); unit->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT); VehicleSeatEntry const* veSeat = seat->second.SeatInfo; @@ -364,7 +364,7 @@ bool Vehicle::AddPassenger(Unit* unit, int8 seatId) if (_me->IsInWorld()) { unit->SendClearTarget(); // SMSG_BREAK_TARGET - unit->SetControlled(true, UNIT_STAT_ROOT); // SMSG_FORCE_ROOT - In some cases we send SMSG_MOVE_SPLINE_ROOT here (for creatures) + unit->SetControlled(true, UNIT_STATE_ROOT); // SMSG_FORCE_ROOT - In some cases we send SMSG_MOVE_SPLINE_ROOT here (for creatures) // also adds MOVEMENTFLAG_ROOT unit->SendMonsterMoveTransport(_me); // SMSG_MONSTER_MOVE_TRANSPORT @@ -407,7 +407,7 @@ void Vehicle::RemovePassenger(Unit* unit) ++_usableSeatNum; } - unit->ClearUnitState(UNIT_STAT_ONVEHICLE); + unit->ClearUnitState(UNIT_STATE_ONVEHICLE); if (_me->GetTypeId() == TYPEID_UNIT && unit->GetTypeId() == TYPEID_PLAYER && seat->first == 0 && seat->second.SeatInfo->m_flags & VEHICLE_SEAT_FLAG_CAN_CONTROL) _me->RemoveCharmedBy(unit); diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.cpp b/src/server/game/Grids/Notifiers/GridNotifiers.cpp index 5e5fbf4a9a6..2446e9d4276 100755 --- a/src/server/game/Grids/Notifiers/GridNotifiers.cpp +++ b/src/server/game/Grids/Notifiers/GridNotifiers.cpp @@ -113,7 +113,7 @@ inline void CreatureUnitRelocationWorker(Creature* c, Unit* u) if (!u->isAlive() || !c->isAlive() || c == u || u->isInFlight()) return; - if (c->HasReactState(REACT_AGGRESSIVE) && !c->HasUnitState(UNIT_STAT_SIGHTLESS)) + if (c->HasReactState(REACT_AGGRESSIVE) && !c->HasUnitState(UNIT_STATE_SIGHTLESS)) if (c->IsAIEnabled && c->canSeeOrDetect(u, false, true)) c->AI()->MoveInLineOfSight_Safe(u); } diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h index 2234109c383..4bec8b2e897 100755 --- a/src/server/game/Grids/Notifiers/GridNotifiers.h +++ b/src/server/game/Grids/Notifiers/GridNotifiers.h @@ -746,7 +746,7 @@ namespace Trinity bool operator()(Unit* u) { if (u->isAlive() && u->isInCombat() && !i_obj->IsHostileTo(u) && i_obj->IsWithinDistInMap(u, i_range) && - (u->isFeared() || u->isCharmed() || u->isFrozen() || u->HasUnitState(UNIT_STAT_STUNNED) || u->HasUnitState(UNIT_STAT_CONFUSED))) + (u->isFeared() || u->isCharmed() || u->isFrozen() || u->HasUnitState(UNIT_STATE_STUNNED) || u->HasUnitState(UNIT_STATE_CONFUSED))) { return true; } diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp index 845f3279356..9b2d502b331 100755 --- a/src/server/game/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Handlers/AuctionHouseHandler.cpp @@ -46,7 +46,7 @@ void WorldSession::HandleAuctionHelloOpcode(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); SendAuctionHello(guid, unit); @@ -161,7 +161,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); Item* it = player->GetItemByGuid(item); @@ -275,7 +275,7 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket& recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction()); @@ -394,7 +394,7 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction()); @@ -482,7 +482,7 @@ void WorldSession::HandleAuctionListBidderItems(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction()); @@ -531,7 +531,7 @@ void WorldSession::HandleAuctionListOwnerItems(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction()); @@ -586,7 +586,7 @@ void WorldSession::HandleAuctionListItems(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction()); diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index ebde812ac76..c4208215053 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -1112,7 +1112,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder) sLog->outChar("Account: %d (IP: %s) Login Character:[%s] (GUID: %u)", GetAccountId(), IP_str.c_str(), pCurrChar->GetName(), pCurrChar->GetGUIDLow()); - if (!pCurrChar->IsStandState() && !pCurrChar->HasUnitState(UNIT_STAT_STUNNED)) + if (!pCurrChar->IsStandState() && !pCurrChar->HasUnitState(UNIT_STATE_STUNNED)) pCurrChar->SetStandState(UNIT_STAND_STATE_STAND); m_playerLoading = false; diff --git a/src/server/game/Handlers/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cpp index 3a47f214099..4aab82945f1 100755 --- a/src/server/game/Handlers/ChatHandler.cpp +++ b/src/server/game/Handlers/ChatHandler.cpp @@ -644,7 +644,7 @@ void WorldSession::HandleAddonMessagechatOpcode(WorldPacket& recvData) void WorldSession::HandleEmoteOpcode(WorldPacket & recv_data) { - if (!GetPlayer()->isAlive() || GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (!GetPlayer()->isAlive() || GetPlayer()->HasUnitState(UNIT_STATE_DIED)) return; uint32 emote; @@ -721,7 +721,7 @@ void WorldSession::HandleTextEmoteOpcode(WorldPacket & recv_data) break; default: // Only allow text-emotes for "dead" entities (feign death included) - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) break; GetPlayer()->HandleEmoteCommand(emote_anim); break; diff --git a/src/server/game/Handlers/GuildHandler.cpp b/src/server/game/Handlers/GuildHandler.cpp index fff068a0a04..fd3f0c07fb4 100755 --- a/src/server/game/Handlers/GuildHandler.cpp +++ b/src/server/game/Handlers/GuildHandler.cpp @@ -324,7 +324,7 @@ void WorldSession::HandleSaveGuildEmblemOpcode(WorldPacket& recvPacket) if (GetPlayer()->GetNPCIfCanInteractWith(vendorGuid, UNIT_NPC_FLAG_TABARDDESIGNER)) { // Remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); if (Guild* guild = _GetPlayerGuild(this)) diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 40de8ca9fe8..00ff1f8ffa4 100755 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -501,7 +501,7 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); Item* pItem = _player->GetItemByGuid(itemguid); @@ -612,7 +612,7 @@ void WorldSession::HandleBuybackItem(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); Item* pItem = _player->GetItemFromBuyBackSlot(slot); @@ -731,11 +731,11 @@ void WorldSession::SendListInventory(uint64 vendorGuid) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); // Stop the npc if moving - if (vendor->HasUnitState(UNIT_STAT_MOVING)) + if (vendor->HasUnitState(UNIT_STATE_MOVING)) vendor->StopMoving(); uint8* bytes = (uint8*)&vendorGuid; diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 04ad3e745dc..8184334d2b1 100755 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -122,7 +122,7 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); if ((unit && unit->GetCreatureInfo()->ScriptID != unit->LastUsedScriptID) || (go && go->GetGOInfo()->ScriptId != go->LastUsedScriptID)) diff --git a/src/server/game/Handlers/NPCHandler.cpp b/src/server/game/Handlers/NPCHandler.cpp index c1b59b41ebb..945116ea5d8 100755 --- a/src/server/game/Handlers/NPCHandler.cpp +++ b/src/server/game/Handlers/NPCHandler.cpp @@ -60,7 +60,7 @@ void WorldSession::HandleTabardVendorActivateOpcode(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); SendTabardVendorActivate(guid); @@ -89,7 +89,7 @@ void WorldSession::HandleBankerActivateOpcode(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); SendShowBank(guid); @@ -128,7 +128,7 @@ void WorldSession::SendTrainerList(uint64 guid, const std::string& strTitle) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); // trainer list loaded at check; @@ -253,7 +253,7 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); if (!unit->isCanTrainingOf(_player, true)) @@ -318,7 +318,7 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket & recv_data) GetPlayer()->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TALK); // remove fake death - //if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + //if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) // GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); if (unit->isArmorer() || unit->isCivilian() || unit->isQuestGiver() || unit->isServiceProvider() || unit->isGuard()) @@ -373,7 +373,7 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); if (!code.empty()) @@ -404,7 +404,7 @@ void WorldSession::HandleSpiritHealerActivateOpcode(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); SendSpiritResurrect(); @@ -459,7 +459,7 @@ void WorldSession::HandleBinderActivateOpcode(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); SendBindPoint(unit); @@ -512,7 +512,7 @@ void WorldSession::HandleListStabledPetsOpcode(WorldPacket & recv_data) return; // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); // remove mounts this fix bug where getting pet from stable while mounted deletes pet. @@ -615,7 +615,7 @@ void WorldSession::HandleStablePet(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); Pet* pet = _player->GetPet(); @@ -685,7 +685,7 @@ void WorldSession::HandleUnstablePet(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PET_ENTRY); @@ -765,7 +765,7 @@ void WorldSession::HandleBuyStableSlot(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); if (GetPlayer()->m_stableSlots < MAX_PET_STABLES) @@ -804,7 +804,7 @@ void WorldSession::HandleStableSwapPet(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); Pet* pet = _player->GetPet(); @@ -892,7 +892,7 @@ void WorldSession::HandleRepairItemOpcode(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); // reputation discount diff --git a/src/server/game/Handlers/PetHandler.cpp b/src/server/game/Handlers/PetHandler.cpp index 00a19adc8ae..fb94800d1bd 100755 --- a/src/server/game/Handlers/PetHandler.cpp +++ b/src/server/game/Handlers/PetHandler.cpp @@ -207,7 +207,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint16 spellid return; } - pet->ClearUnitState(UNIT_STAT_FOLLOW); + pet->ClearUnitState(UNIT_STATE_FOLLOW); // This is true if pet has no target or has target but targets differs. if (pet->getVictim() != TargetUnit || (pet->getVictim() == TargetUnit && !pet->GetCharmInfo()->IsCommandAttack())) { @@ -774,7 +774,7 @@ void WorldSession::HandlePetCastSpellOpcode(WorldPacket& recvPacket) targets.Read(recvPacket, caster); HandleClientCastFlags(recvPacket, castFlags, targets); - caster->ClearUnitState(UNIT_STAT_FOLLOW); + caster->ClearUnitState(UNIT_STATE_FOLLOW); Spell* spell = new Spell(caster, spellInfo, TRIGGERED_NONE); spell->m_cast_count = castCount; // probably pending spell cast diff --git a/src/server/game/Handlers/PetitionsHandler.cpp b/src/server/game/Handlers/PetitionsHandler.cpp index dce5e0f78ba..f363fa71038 100755 --- a/src/server/game/Handlers/PetitionsHandler.cpp +++ b/src/server/game/Handlers/PetitionsHandler.cpp @@ -98,7 +98,7 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); uint32 charterid = 0; diff --git a/src/server/game/Handlers/QuestHandler.cpp b/src/server/game/Handlers/QuestHandler.cpp index a3debe82ac1..6cba7b7fb4f 100755 --- a/src/server/game/Handlers/QuestHandler.cpp +++ b/src/server/game/Handlers/QuestHandler.cpp @@ -95,7 +95,7 @@ void WorldSession::HandleQuestgiverHelloOpcode(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); // Stop the npc if moving creature->StopMoving(); diff --git a/src/server/game/Handlers/SkillHandler.cpp b/src/server/game/Handlers/SkillHandler.cpp index 2e4ef5cb40d..886368821f5 100755 --- a/src/server/game/Handlers/SkillHandler.cpp +++ b/src/server/game/Handlers/SkillHandler.cpp @@ -88,7 +88,7 @@ void WorldSession::HandleTalentWipeConfirmOpcode(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); if (!_player->ResetTalents()) diff --git a/src/server/game/Handlers/TaxiHandler.cpp b/src/server/game/Handlers/TaxiHandler.cpp index 3533b153bd8..8eb1eab06d9 100755 --- a/src/server/game/Handlers/TaxiHandler.cpp +++ b/src/server/game/Handlers/TaxiHandler.cpp @@ -79,7 +79,7 @@ void WorldSession::HandleTaxiQueryAvailableNodes(WorldPacket & recv_data) } // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); // unknown taxi node case @@ -118,7 +118,7 @@ void WorldSession::SendTaxiMenu(Creature* unit) void WorldSession::SendDoFlight(uint32 mountDisplayId, uint32 path, uint32 pathNode) { // remove fake death - if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); while (GetPlayer()->GetMotionMaster()->GetCurrentMovementGeneratorType() == FLIGHT_MOTION_TYPE) diff --git a/src/server/game/Handlers/TradeHandler.cpp b/src/server/game/Handlers/TradeHandler.cpp index 900f036df0a..b51f13a5063 100755 --- a/src/server/game/Handlers/TradeHandler.cpp +++ b/src/server/game/Handlers/TradeHandler.cpp @@ -581,7 +581,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket) return; } - if (GetPlayer()->HasUnitState(UNIT_STAT_STUNNED)) + if (GetPlayer()->HasUnitState(UNIT_STATE_STUNNED)) { SendTradeStatus(TRADE_STATUS_YOU_STUNNED); return; @@ -631,7 +631,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket) return; } - if (pOther->HasUnitState(UNIT_STAT_STUNNED)) + if (pOther->HasUnitState(UNIT_STATE_STUNNED)) { SendTradeStatus(TRADE_STATUS_TARGET_STUNNED); return; diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp index 8975a2d7d7b..4945ae2a014 100755 --- a/src/server/game/Movement/MotionMaster.cpp +++ b/src/server/game/Movement/MotionMaster.cpp @@ -80,7 +80,7 @@ void MotionMaster::UpdateMotion(uint32 diff) if (!i_owner) return; - if (i_owner->HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED)) // what about UNIT_STAT_DISTRACTED? Why is this not included? + if (i_owner->HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED)) // what about UNIT_STATE_DISTRACTED? Why is this not included? return; ASSERT(!empty()); @@ -237,7 +237,7 @@ void MotionMaster::MoveChase(Unit* target, float dist, float angle) if (!target || target == i_owner || i_owner->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE)) return; - //i_owner->ClearUnitState(UNIT_STAT_FOLLOW); + //i_owner->ClearUnitState(UNIT_STATE_FOLLOW); if (i_owner->GetTypeId() == TYPEID_PLAYER) { sLog->outStaticDebug("Player (GUID: %u) chase to %s (GUID: %u)", @@ -262,7 +262,7 @@ void MotionMaster::MoveFollow(Unit* target, float dist, float angle, MovementSlo if (!target || target == i_owner || i_owner->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE)) return; - //i_owner->AddUnitState(UNIT_STAT_FOLLOW); + //i_owner->AddUnitState(UNIT_STATE_FOLLOW); if (i_owner->GetTypeId() == TYPEID_PLAYER) { sLog->outStaticDebug("Player (GUID: %u) follow to %s (GUID: %u)", i_owner->GetGUIDLow(), diff --git a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp index 94608d85420..32b960028c2 100755 --- a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp @@ -71,7 +71,7 @@ void ConfusedMovementGenerator::Initialize(T &unit) unit.StopMoving(); unit.SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED); - unit.AddUnitState(UNIT_STAT_CONFUSED|UNIT_STAT_CONFUSED_MOVE); + unit.AddUnitState(UNIT_STATE_CONFUSED|UNIT_STATE_CONFUSED_MOVE); } template<> @@ -94,19 +94,19 @@ void ConfusedMovementGenerator::Reset(T &unit) i_nextMove = 1; i_nextMoveTime.Reset(0); unit.StopMoving(); - unit.AddUnitState(UNIT_STAT_CONFUSED|UNIT_STAT_CONFUSED_MOVE); + unit.AddUnitState(UNIT_STATE_CONFUSED|UNIT_STATE_CONFUSED_MOVE); } template bool ConfusedMovementGenerator::Update(T &unit, const uint32 &diff) { - if (unit.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED)) + if (unit.HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED | UNIT_STATE_DISTRACTED)) return true; if (i_nextMoveTime.Passed()) { // currently moving, update location - unit.AddUnitState(UNIT_STAT_CONFUSED_MOVE); + unit.AddUnitState(UNIT_STATE_CONFUSED_MOVE); if (unit.movespline->Finalized()) { @@ -121,7 +121,7 @@ bool ConfusedMovementGenerator::Update(T &unit, const uint32 &diff) if(i_nextMoveTime.Passed() ) { // start moving - unit.AddUnitState(UNIT_STAT_CONFUSED_MOVE); + unit.AddUnitState(UNIT_STATE_CONFUSED_MOVE); ASSERT( i_nextMove <= MAX_CONF_WAYPOINTS ); float x = i_waypoints[i_nextMove][0]; @@ -141,14 +141,14 @@ template<> void ConfusedMovementGenerator::Finalize(Player &unit) { unit.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED); - unit.ClearUnitState(UNIT_STAT_CONFUSED|UNIT_STAT_CONFUSED_MOVE); + unit.ClearUnitState(UNIT_STATE_CONFUSED|UNIT_STATE_CONFUSED_MOVE); } template<> void ConfusedMovementGenerator::Finalize(Creature &unit) { unit.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED); - unit.ClearUnitState(UNIT_STAT_CONFUSED|UNIT_STAT_CONFUSED_MOVE); + unit.ClearUnitState(UNIT_STATE_CONFUSED|UNIT_STATE_CONFUSED_MOVE); if (unit.getVictim()) unit.SetTarget(unit.getVictim()->GetGUID()); } diff --git a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp index 458e6f9a62c..ed5b73dd378 100755 --- a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp @@ -34,7 +34,7 @@ FleeingMovementGenerator::_setTargetLocation(T &owner) if (!&owner) return; - if (owner.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED)) + if (owner.HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED)) return; if (!_setMoveData(owner)) @@ -44,7 +44,7 @@ FleeingMovementGenerator::_setTargetLocation(T &owner) if (!_getPoint(owner, x, y, z)) return; - owner.AddUnitState(UNIT_STAT_FLEEING_MOVE); + owner.AddUnitState(UNIT_STATE_FLEEING_MOVE); Movement::MoveSplineInit init(owner); init.MoveTo(x,y,z); @@ -287,7 +287,7 @@ FleeingMovementGenerator::Initialize(T &owner) return; owner.SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING); - owner.AddUnitState(UNIT_STAT_FLEEING|UNIT_STAT_FLEEING_MOVE); + owner.AddUnitState(UNIT_STATE_FLEEING|UNIT_STATE_FLEEING_MOVE); _Init(owner); @@ -335,14 +335,14 @@ template<> void FleeingMovementGenerator::Finalize(Player &owner) { owner.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING); - owner.ClearUnitState(UNIT_STAT_FLEEING|UNIT_STAT_FLEEING_MOVE); + owner.ClearUnitState(UNIT_STATE_FLEEING|UNIT_STATE_FLEEING_MOVE); } template<> void FleeingMovementGenerator::Finalize(Creature &owner) { owner.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING); - owner.ClearUnitState(UNIT_STAT_FLEEING|UNIT_STAT_FLEEING_MOVE); + owner.ClearUnitState(UNIT_STATE_FLEEING|UNIT_STATE_FLEEING_MOVE); if (owner.getVictim()) owner.SetTarget(owner.getVictim()->GetGUID()); } @@ -359,9 +359,9 @@ FleeingMovementGenerator::Update(T &owner, const uint32 &time_diff) { if (!&owner || !owner.isAlive()) return false; - if (owner.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED)) + if (owner.HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED)) { - owner.ClearUnitState(UNIT_STAT_FLEEING_MOVE); + owner.ClearUnitState(UNIT_STATE_FLEEING_MOVE); return true; } @@ -388,7 +388,7 @@ template bool FleeingMovementGenerator::Update(Creature &, const uint3 void TimedFleeingMovementGenerator::Finalize(Unit &owner) { owner.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING); - owner.ClearUnitState(UNIT_STAT_FLEEING|UNIT_STAT_FLEEING_MOVE); + owner.ClearUnitState(UNIT_STATE_FLEEING|UNIT_STATE_FLEEING_MOVE); if (Unit* victim = owner.getVictim()) { if (owner.isAlive()) @@ -404,9 +404,9 @@ bool TimedFleeingMovementGenerator::Update(Unit & owner, const uint32 time_diff) if (!owner.isAlive()) return false; - if (owner.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED)) + if (owner.HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED)) { - owner.ClearUnitState(UNIT_STAT_FLEEING_MOVE); + owner.ClearUnitState(UNIT_STATE_FLEEING_MOVE); return true; } diff --git a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp index 84997d6d1ae..dc47898352e 100755 --- a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp @@ -25,7 +25,7 @@ void HomeMovementGenerator::Initialize(Creature & owner) { - owner.AddUnitState(UNIT_STAT_EVADE); + owner.AddUnitState(UNIT_STATE_EVADE); _setTargetLocation(owner); } @@ -38,7 +38,7 @@ void HomeMovementGenerator::_setTargetLocation(Creature & owner) if (!&owner) return; - if (owner.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED)) + if (owner.HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED | UNIT_STATE_DISTRACTED)) return; Movement::MoveSplineInit init(owner); @@ -54,7 +54,7 @@ void HomeMovementGenerator::_setTargetLocation(Creature & owner) init.Launch(); arrived = false; - owner.ClearUnitState(UNIT_STAT_ALL_STATE & ~UNIT_STAT_EVADE); + owner.ClearUnitState(UNIT_STATE_ALL_STATE & ~UNIT_STATE_EVADE); } bool HomeMovementGenerator::Update(Creature &owner, const uint32 time_diff) @@ -67,7 +67,7 @@ void HomeMovementGenerator::Finalize(Creature& owner) { if (arrived) { - owner.ClearUnitState(UNIT_STAT_EVADE); + owner.ClearUnitState(UNIT_STATE_EVADE); owner.SetWalk(true); owner.LoadCreaturesAddon(true); owner.AI()->JustReachedHome(); diff --git a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp index 43d3cccfe48..36561e00b93 100755 --- a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp @@ -32,19 +32,19 @@ void IdleMovementGenerator::Initialize(Unit &owner) void IdleMovementGenerator::Reset(Unit& owner) { - if (owner.HasUnitState(UNIT_STAT_MOVE)) + if (owner.HasUnitState(UNIT_STATE_MOVE)) owner.StopMoving(); } void RotateMovementGenerator::Initialize(Unit& owner) { - if (owner.HasUnitState(UNIT_STAT_MOVE)) + if (owner.HasUnitState(UNIT_STATE_MOVE)) owner.StopMoving(); if (owner.getVictim()) owner.SetInFront(owner.getVictim()); - owner.AddUnitState(UNIT_STAT_ROTATING); + owner.AddUnitState(UNIT_STATE_ROTATING); owner.AttackStop(); } @@ -75,7 +75,7 @@ bool RotateMovementGenerator::Update(Unit& owner, const uint32 diff) void RotateMovementGenerator::Finalize(Unit &unit) { - unit.ClearUnitState(UNIT_STAT_ROTATING); + unit.ClearUnitState(UNIT_STATE_ROTATING); if (unit.GetTypeId() == TYPEID_UNIT) unit.ToCreature()->AI()->MovementInform(ROTATE_MOTION_TYPE, 0); } @@ -83,13 +83,13 @@ void RotateMovementGenerator::Finalize(Unit &unit) void DistractMovementGenerator::Initialize(Unit& owner) { - owner.AddUnitState(UNIT_STAT_DISTRACTED); + owner.AddUnitState(UNIT_STATE_DISTRACTED); } void DistractMovementGenerator::Finalize(Unit& owner) { - owner.ClearUnitState(UNIT_STAT_DISTRACTED); + owner.ClearUnitState(UNIT_STATE_DISTRACTED); } bool @@ -105,7 +105,7 @@ DistractMovementGenerator::Update(Unit& /*owner*/, const uint32 time_diff) void AssistanceDistractMovementGenerator::Finalize(Unit &unit) { - unit.ClearUnitState(UNIT_STAT_DISTRACTED); + unit.ClearUnitState(UNIT_STATE_DISTRACTED); unit.ToCreature()->SetReactState(REACT_AGGRESSIVE); } diff --git a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp index 88465017dc2..02f9ebce847 100755 --- a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp @@ -32,7 +32,7 @@ void PointMovementGenerator::Initialize(T &unit) if (!unit.IsStopped()) unit.StopMoving(); - unit.AddUnitState(UNIT_STAT_ROAMING|UNIT_STAT_ROAMING_MOVE); + unit.AddUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE); Movement::MoveSplineInit init(unit); init.MoveTo(i_x, i_y, i_z); if (speed > 0.0f) @@ -46,20 +46,20 @@ bool PointMovementGenerator::Update(T &unit, const uint32 &diff) if (!&unit) return false; - if(unit.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED)) + if(unit.HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED)) { - unit.ClearUnitState(UNIT_STAT_ROAMING_MOVE); + unit.ClearUnitState(UNIT_STATE_ROAMING_MOVE); return true; } - unit.AddUnitState(UNIT_STAT_ROAMING_MOVE); + unit.AddUnitState(UNIT_STATE_ROAMING_MOVE); return !unit.movespline->Finalized(); } template void PointMovementGenerator:: Finalize(T &unit) { - unit.ClearUnitState(UNIT_STAT_ROAMING|UNIT_STAT_ROAMING_MOVE); + unit.ClearUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE); if (unit.movespline->Finalized()) MovementInform(unit); @@ -71,7 +71,7 @@ void PointMovementGenerator::Reset(T &unit) if (!unit.IsStopped()) unit.StopMoving(); - unit.AddUnitState(UNIT_STAT_ROAMING|UNIT_STAT_ROAMING_MOVE); + unit.AddUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE); } template @@ -120,7 +120,7 @@ void EffectMovementGenerator::Finalize(Unit &unit) if (((Creature&)unit).AI() && unit.movespline->Finalized()) ((Creature&)unit).AI()->MovementInform(EFFECT_MOTION_TYPE, m_Id); // Need restore previous movement since we have no proper states system - //if (unit.isAlive() && !unit.HasUnitState(UNIT_STAT_CONFUSED|UNIT_STAT_FLEEING)) + //if (unit.isAlive() && !unit.HasUnitState(UNIT_STATE_CONFUSED|UNIT_STATE_FLEEING)) //{ // if (Unit * victim = unit.getVictim()) // unit.GetMotionMaster()->MoveChase(victim); diff --git a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp index 0205b734058..22adc7be92f 100755 --- a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp @@ -102,7 +102,7 @@ void RandomMovementGenerator::_setRandomLocation(Creature &creature) else i_nextMoveTime.Reset(urand(500, 10000)); - creature.AddUnitState(UNIT_STAT_ROAMING_MOVE); + creature.AddUnitState(UNIT_STATE_ROAMING_MOVE); Movement::MoveSplineInit init(creature); init.MoveTo(destX, destY, destZ); @@ -123,7 +123,7 @@ void RandomMovementGenerator::Initialize(Creature &creature) if (!wander_distance) wander_distance = creature.GetRespawnRadius(); - creature.AddUnitState(UNIT_STAT_ROAMING|UNIT_STAT_ROAMING_MOVE); + creature.AddUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE); _setRandomLocation(creature); } @@ -137,7 +137,7 @@ RandomMovementGenerator::Reset(Creature &creature) template<> void RandomMovementGenerator::Finalize(Creature &creature) { - creature.ClearUnitState(UNIT_STAT_ROAMING|UNIT_STAT_ROAMING_MOVE); + creature.ClearUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE); creature.SetWalk(false); } @@ -145,10 +145,10 @@ template<> bool RandomMovementGenerator::Update(Creature &creature, const uint32 diff) { - if (creature.HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED)) + if (creature.HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED | UNIT_STATE_DISTRACTED)) { i_nextMoveTime.Reset(0); // Expire the timer - creature.ClearUnitState(UNIT_STAT_ROAMING_MOVE); + creature.ClearUnitState(UNIT_STATE_ROAMING_MOVE); return true; } diff --git a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp index 0d2982ab6b7..964b4402438 100755 --- a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp @@ -34,7 +34,7 @@ void TargetedMovementGeneratorMedium::_setTargetLocation(T &owner) if (!i_target.isValid() || !i_target->IsInWorld()) return; - if (owner.HasUnitState(UNIT_STAT_NOT_MOVE)) + if (owner.HasUnitState(UNIT_STATE_NOT_MOVE)) return; float x, y, z; @@ -125,7 +125,7 @@ bool TargetedMovementGeneratorMedium::Update(T &owner, const uint32 & time_ if (!owner.isAlive()) return true; - if (owner.HasUnitState(UNIT_STAT_NOT_MOVE)) + if (owner.HasUnitState(UNIT_STATE_NOT_MOVE)) { D::_clearUnitStateMove(owner); return true; @@ -188,7 +188,7 @@ void ChaseMovementGenerator::_reachTarget(T &owner) template<> void ChaseMovementGenerator::Initialize(Player &owner) { - owner.AddUnitState(UNIT_STAT_CHASE|UNIT_STAT_CHASE_MOVE); + owner.AddUnitState(UNIT_STATE_CHASE|UNIT_STATE_CHASE_MOVE); _setTargetLocation(owner); } @@ -196,14 +196,14 @@ template<> void ChaseMovementGenerator::Initialize(Creature &owner) { owner.SetWalk(false); - owner.AddUnitState(UNIT_STAT_CHASE|UNIT_STAT_CHASE_MOVE); + owner.AddUnitState(UNIT_STATE_CHASE|UNIT_STATE_CHASE_MOVE); _setTargetLocation(owner); } template void ChaseMovementGenerator::Finalize(T &owner) { - owner.ClearUnitState(UNIT_STAT_CHASE|UNIT_STAT_CHASE_MOVE); + owner.ClearUnitState(UNIT_STATE_CHASE|UNIT_STATE_CHASE_MOVE); } template @@ -259,7 +259,7 @@ void FollowMovementGenerator::_updateSpeed(Creature &u) template<> void FollowMovementGenerator::Initialize(Player &owner) { - owner.AddUnitState(UNIT_STAT_FOLLOW|UNIT_STAT_FOLLOW_MOVE); + owner.AddUnitState(UNIT_STATE_FOLLOW|UNIT_STATE_FOLLOW_MOVE); _updateSpeed(owner); _setTargetLocation(owner); } @@ -267,7 +267,7 @@ void FollowMovementGenerator::Initialize(Player &owner) template<> void FollowMovementGenerator::Initialize(Creature &owner) { - owner.AddUnitState(UNIT_STAT_FOLLOW|UNIT_STAT_FOLLOW_MOVE); + owner.AddUnitState(UNIT_STATE_FOLLOW|UNIT_STATE_FOLLOW_MOVE); _updateSpeed(owner); _setTargetLocation(owner); } @@ -275,7 +275,7 @@ void FollowMovementGenerator::Initialize(Creature &owner) template void FollowMovementGenerator::Finalize(T &owner) { - owner.ClearUnitState(UNIT_STAT_FOLLOW|UNIT_STAT_FOLLOW_MOVE); + owner.ClearUnitState(UNIT_STATE_FOLLOW|UNIT_STATE_FOLLOW_MOVE); _updateSpeed(owner); } diff --git a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h index 696c99e1460..bf2eecc89f6 100755 --- a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h @@ -79,8 +79,8 @@ class ChaseMovementGenerator : public TargetedMovementGeneratorMediumGetTarget(); } void _reachTarget(T &); @@ -103,8 +103,8 @@ class FollowMovementGenerator : public TargetedMovementGeneratorMedium::LoadPath(Creature &creature) void WaypointMovementGenerator::Initialize(Creature &creature) { LoadPath(creature); - creature.AddUnitState(UNIT_STAT_ROAMING|UNIT_STAT_ROAMING_MOVE); + creature.AddUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE); } void WaypointMovementGenerator::Finalize(Creature &creature) { - creature.ClearUnitState(UNIT_STAT_ROAMING|UNIT_STAT_ROAMING_MOVE); + creature.ClearUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE); creature.SetWalk(false); } void WaypointMovementGenerator::Reset(Creature &creature) { - creature.AddUnitState(UNIT_STAT_ROAMING|UNIT_STAT_ROAMING_MOVE); + creature.AddUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE); StartMoveNow(creature); } @@ -73,7 +73,7 @@ void WaypointMovementGenerator::OnArrived(Creature& creature) if (m_isArrivalDone) return; - creature.ClearUnitState(UNIT_STAT_ROAMING_MOVE); + creature.ClearUnitState(UNIT_STATE_ROAMING_MOVE); m_isArrivalDone = true; if (i_path->at(i_currentNode)->event_id && urand(0, 99) < i_path->at(i_currentNode)->event_chance) @@ -111,7 +111,7 @@ bool WaypointMovementGenerator::StartMove(Creature &creature) m_isArrivalDone = false; - creature.AddUnitState(UNIT_STAT_ROAMING_MOVE); + creature.AddUnitState(UNIT_STATE_ROAMING_MOVE); Movement::MoveSplineInit init(creature); init.MoveTo(node->x, node->y, node->z); @@ -133,9 +133,9 @@ bool WaypointMovementGenerator::Update(Creature &creature, const uint3 { // Waypoint movement can be switched on/off // This is quite handy for escort quests and other stuff - if (creature.HasUnitState(UNIT_STAT_NOT_MOVE)) + if (creature.HasUnitState(UNIT_STATE_NOT_MOVE)) { - creature.ClearUnitState(UNIT_STAT_ROAMING_MOVE); + creature.ClearUnitState(UNIT_STATE_ROAMING_MOVE); return true; } // prevent a crash at empty waypoint path. @@ -204,7 +204,7 @@ void FlightPathMovementGenerator::Initialize(Player &player) void FlightPathMovementGenerator::Finalize(Player & player) { // remove flag to prevent send object build movement packets for flight state and crash (movement generator already not at top of stack) - player.ClearUnitState(UNIT_STAT_IN_FLIGHT); + player.ClearUnitState(UNIT_STATE_IN_FLIGHT); player.Dismount(); player.RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT); @@ -227,7 +227,7 @@ void FlightPathMovementGenerator::Finalize(Player & player) void FlightPathMovementGenerator::Reset(Player & player) { player.getHostileRefManager().setOnlineOfflineState(false); - player.AddUnitState(UNIT_STAT_IN_FLIGHT); + player.AddUnitState(UNIT_STATE_IN_FLIGHT); player.SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT); Movement::MoveSplineInit init(player); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 2c28eb4216c..b3b4cf4a30d 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -2467,7 +2467,7 @@ void AuraEffect::HandleFeignDeath(AuraApplication const* aurApp, uint8 mode, boo target->VisitNearbyObject(target->GetMap()->GetVisibilityRange(), searcher); for (UnitList::iterator iter = targets.begin(); iter != targets.end(); ++iter) { - if (!(*iter)->HasUnitState(UNIT_STAT_CASTING)) + if (!(*iter)->HasUnitState(UNIT_STATE_CASTING)) continue; for (uint32 i = CURRENT_FIRST_NON_MELEE_SPELL; i < CURRENT_MAX_SPELL; i++) @@ -2498,7 +2498,7 @@ void AuraEffect::HandleFeignDeath(AuraApplication const* aurApp, uint8 mode, boo // blizz like 2.0.x target->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD); - target->AddUnitState(UNIT_STAT_DIED); + target->AddUnitState(UNIT_STATE_DIED); } else { @@ -2515,7 +2515,7 @@ void AuraEffect::HandleFeignDeath(AuraApplication const* aurApp, uint8 mode, boo // blizz like 2.0.x target->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD); - target->ClearUnitState(UNIT_STAT_DIED); + target->ClearUnitState(UNIT_STATE_DIED); } } @@ -3084,7 +3084,7 @@ void AuraEffect::HandleModConfuse(AuraApplication const* aurApp, uint8 mode, boo Unit* target = aurApp->GetTarget(); - target->SetControlled(apply, UNIT_STAT_CONFUSED); + target->SetControlled(apply, UNIT_STATE_CONFUSED); } void AuraEffect::HandleModFear(AuraApplication const* aurApp, uint8 mode, bool apply) const @@ -3094,7 +3094,7 @@ void AuraEffect::HandleModFear(AuraApplication const* aurApp, uint8 mode, bool a Unit* target = aurApp->GetTarget(); - target->SetControlled(apply, UNIT_STAT_FLEEING); + target->SetControlled(apply, UNIT_STATE_FLEEING); } void AuraEffect::HandleAuraModStun(AuraApplication const* aurApp, uint8 mode, bool apply) const @@ -3104,7 +3104,7 @@ void AuraEffect::HandleAuraModStun(AuraApplication const* aurApp, uint8 mode, bo Unit* target = aurApp->GetTarget(); - target->SetControlled(apply, UNIT_STAT_STUNNED); + target->SetControlled(apply, UNIT_STATE_STUNNED); } void AuraEffect::HandleAuraModRoot(AuraApplication const* aurApp, uint8 mode, bool apply) const @@ -3114,7 +3114,7 @@ void AuraEffect::HandleAuraModRoot(AuraApplication const* aurApp, uint8 mode, bo Unit* target = aurApp->GetTarget(); - target->SetControlled(apply, UNIT_STAT_ROOT); + target->SetControlled(apply, UNIT_STATE_ROOT); } void AuraEffect::HandlePreventFleeing(AuraApplication const* aurApp, uint8 mode, bool apply) const @@ -3125,7 +3125,7 @@ void AuraEffect::HandlePreventFleeing(AuraApplication const* aurApp, uint8 mode, Unit* target = aurApp->GetTarget(); if (target->HasAuraType(SPELL_AURA_MOD_FEAR)) - target->SetControlled(!(apply), UNIT_STAT_FLEEING); + target->SetControlled(!(apply), UNIT_STATE_FLEEING); } /***************************/ @@ -3509,7 +3509,7 @@ void AuraEffect::HandleAuraModSchoolImmunity(AuraApplication const* aurApp, uint if (GetSpellInfo()->Mechanic == MECHANIC_BANISH) { if (apply) - target->AddUnitState(UNIT_STAT_ISOLATED); + target->AddUnitState(UNIT_STATE_ISOLATED); else { bool banishFound = false; @@ -3521,7 +3521,7 @@ void AuraEffect::HandleAuraModSchoolImmunity(AuraApplication const* aurApp, uint break; } if (!banishFound) - target->ClearUnitState(UNIT_STAT_ISOLATED); + target->ClearUnitState(UNIT_STATE_ISOLATED); } } @@ -6193,7 +6193,7 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const if (!caster || !target->isAlive()) return; - if (target->HasUnitState(UNIT_STAT_ISOLATED) || target->IsImmunedToDamage(GetSpellInfo())) + if (target->HasUnitState(UNIT_STATE_ISOLATED) || target->IsImmunedToDamage(GetSpellInfo())) { SendTickImmune(target, caster); return; @@ -6334,7 +6334,7 @@ void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) c if (!caster || !caster->isAlive() || !target->isAlive()) return; - if (target->HasUnitState(UNIT_STAT_ISOLATED) || target->IsImmunedToDamage(GetSpellInfo())) + if (target->HasUnitState(UNIT_STATE_ISOLATED) || target->IsImmunedToDamage(GetSpellInfo())) { SendTickImmune(target, caster); return; @@ -6400,7 +6400,7 @@ void AuraEffect::HandlePeriodicHealthFunnelAuraTick(Unit* target, Unit* caster) if (!caster || !caster->isAlive() || !target->isAlive()) return; - if (target->HasUnitState(UNIT_STAT_ISOLATED)) + if (target->HasUnitState(UNIT_STATE_ISOLATED)) { SendTickImmune(target, caster); return; @@ -6428,7 +6428,7 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const if (!caster || !target->isAlive()) return; - if (target->HasUnitState(UNIT_STAT_ISOLATED)) + if (target->HasUnitState(UNIT_STATE_ISOLATED)) { SendTickImmune(target, caster); return; @@ -6544,7 +6544,7 @@ void AuraEffect::HandlePeriodicManaLeechAuraTick(Unit* target, Unit* caster) con if (!caster || !caster->isAlive() || !target->isAlive() || target->getPowerType() != powerType) return; - if (target->HasUnitState(UNIT_STAT_ISOLATED) || target->IsImmunedToDamage(GetSpellInfo())) + if (target->HasUnitState(UNIT_STATE_ISOLATED) || target->IsImmunedToDamage(GetSpellInfo())) { SendTickImmune(target, caster); return; @@ -6644,7 +6644,7 @@ void AuraEffect::HandleObsModPowerAuraTick(Unit* target, Unit* caster) const if (!target->isAlive() || !target->GetMaxPower(powerType)) return; - if (target->HasUnitState(UNIT_STAT_ISOLATED)) + if (target->HasUnitState(UNIT_STATE_ISOLATED)) { SendTickImmune(target, caster); return; @@ -6675,7 +6675,7 @@ void AuraEffect::HandlePeriodicEnergizeAuraTick(Unit* target, Unit* caster) cons if (!target->isAlive() || !target->GetMaxPower(powerType)) return; - if (target->HasUnitState(UNIT_STAT_ISOLATED)) + if (target->HasUnitState(UNIT_STATE_ISOLATED)) { SendTickImmune(target, caster); return; @@ -6707,7 +6707,7 @@ void AuraEffect::HandlePeriodicPowerBurnAuraTick(Unit* target, Unit* caster) con if (!caster || !target->isAlive() || target->getPowerType() != powerType) return; - if (target->HasUnitState(UNIT_STAT_ISOLATED) || target->IsImmunedToDamage(GetSpellInfo())) + if (target->HasUnitState(UNIT_STATE_ISOLATED) || target->IsImmunedToDamage(GetSpellInfo())) { SendTickImmune(target, caster); return; diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index a577a8678ea..d20411eb8a6 100755 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -2357,7 +2357,7 @@ void UnitAura::FillTargetMap(std::map & targets, Unit* caster) { float radius = GetSpellInfo()->Effects[effIndex].CalcRadius(caster); - if (!GetUnitOwner()->HasUnitState(UNIT_STAT_ISOLATED)) + if (!GetUnitOwner()->HasUnitState(UNIT_STATE_ISOLATED)) { switch (GetSpellInfo()->Effects[effIndex].Effect) { diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index a36bd7361b4..c56969b2094 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -1448,7 +1448,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, const uint32 effectMask, bool return SPELL_MISS_EVADE; // assisting case, healing and resurrection - if (unit->HasUnitState(UNIT_STAT_ATTACK_PLAYER)) + if (unit->HasUnitState(UNIT_STATE_ATTACK_PLAYER)) { m_caster->SetContestedPvP(); if (m_caster->GetTypeId() == TYPEID_PLAYER) @@ -3215,8 +3215,8 @@ void Spell::cast(bool skipCheck) m_spellState = SPELL_STATE_DELAYED; SetDelayStart(0); - if (m_caster->HasUnitState(UNIT_STAT_CASTING) && !m_caster->IsNonMeleeSpellCasted(false, false, true)) - m_caster->ClearUnitState(UNIT_STAT_CASTING); + if (m_caster->HasUnitState(UNIT_STATE_CASTING) && !m_caster->IsNonMeleeSpellCasted(false, false, true)) + m_caster->ClearUnitState(UNIT_STATE_CASTING); } else { @@ -3582,8 +3582,8 @@ void Spell::finish(bool ok) if (m_spellInfo->IsChanneled()) m_caster->UpdateInterruptMask(); - if (m_caster->HasUnitState(UNIT_STAT_CASTING) && !m_caster->IsNonMeleeSpellCasted(false, false, true)) - m_caster->ClearUnitState(UNIT_STAT_CASTING); + if (m_caster->HasUnitState(UNIT_STATE_CASTING) && !m_caster->IsNonMeleeSpellCasted(false, false, true)) + m_caster->ClearUnitState(UNIT_STATE_CASTING); // Unsummon summon as possessed creatures on spell cancel if (m_spellInfo->IsChanneled() && m_caster->GetTypeId() == TYPEID_PLAYER) @@ -4967,7 +4967,7 @@ SpellCastResult Spell::CheckCast(bool strict) if (strict && m_caster->IsScriptOverriden(m_spellInfo, 6953)) m_caster->RemoveMovementImpairingAuras(); } - if (m_caster->HasUnitState(UNIT_STAT_ROOT)) + if (m_caster->HasUnitState(UNIT_STATE_ROOT)) return SPELL_FAILED_ROOTED; break; } @@ -5195,7 +5195,7 @@ SpellCastResult Spell::CheckCast(bool strict) return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; Unit* target = m_targets.GetUnitTarget(); - if (m_caster == target && m_caster->HasUnitState(UNIT_STAT_ROOT)) + if (m_caster == target && m_caster->HasUnitState(UNIT_STATE_ROOT)) { if (m_caster->GetTypeId() == TYPEID_PLAYER) return SPELL_FAILED_ROOTED; @@ -5419,7 +5419,7 @@ SpellCastResult Spell::CheckCast(bool strict) SpellCastResult Spell::CheckPetCast(Unit* target) { - if (m_caster->HasUnitState(UNIT_STAT_CASTING) && !(_triggeredCastFlags & TRIGGERED_IGNORE_CAST_IN_PROGRESS)) //prevent spellcast interruption by another spellcast + if (m_caster->HasUnitState(UNIT_STATE_CASTING) && !(_triggeredCastFlags & TRIGGERED_IGNORE_CAST_IN_PROGRESS)) //prevent spellcast interruption by another spellcast return SPELL_FAILED_SPELL_IN_PROGRESS; // dead owner (pets still alive when owners ressed?) diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index cd4f2324d9b..6ea53fcfd8b 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -1351,7 +1351,7 @@ void Spell::EffectDummy(SpellEffIndex effIndex) } //Any effect which causes you to lose control of your character will supress the starfall effect. - if (m_caster->HasUnitState(UNIT_STAT_CONTROLLED)) + if (m_caster->HasUnitState(UNIT_STATE_CONTROLLED)) return; m_caster->CastSpell(unitTarget, damage, true); @@ -3373,11 +3373,11 @@ void Spell::EffectDistract(SpellEffIndex /*effIndex*/) return; // target must be OK to do this - if (unitTarget->HasUnitState(UNIT_STAT_CONFUSED | UNIT_STAT_STUNNED | UNIT_STAT_FLEEING)) + if (unitTarget->HasUnitState(UNIT_STATE_CONFUSED | UNIT_STATE_STUNNED | UNIT_STATE_FLEEING)) return; unitTarget->SetFacingTo(unitTarget->GetAngle(m_targets.GetDst())); - unitTarget->ClearUnitState(UNIT_STAT_MOVING); + unitTarget->ClearUnitState(UNIT_STATE_MOVING); if (unitTarget->GetTypeId() == TYPEID_UNIT) unitTarget->GetMotionMaster()->MoveDistract(damage * IN_MILLISECONDS); @@ -6389,7 +6389,7 @@ void Spell::EffectSummonDeadPet(SpellEffIndex /*effIndex*/) pet->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_NONE); pet->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); pet->setDeathState(ALIVE); - pet->ClearUnitState(uint32(UNIT_STAT_ALL_STATE)); + pet->ClearUnitState(uint32(UNIT_STATE_ALL_STATE)); pet->SetHealth(pet->CountPctFromMaxHealth(damage)); //pet->AIM_Initialize(); diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 8e6d6cb7207..718efaed411 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -1680,7 +1680,7 @@ SpellCastResult SpellInfo::CheckTarget(Unit const* caster, Unit const* target, b } // not allow casting on flying player - if (target->HasUnitState(UNIT_STAT_IN_FLIGHT)) + if (target->HasUnitState(UNIT_STATE_IN_FLIGHT)) return SPELL_FAILED_BAD_TARGETS; if (TargetAuraState && !target->HasAuraState(AuraStateType(TargetAuraState), this, caster)) diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_drakkisath.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_drakkisath.cpp index 442fd025423..ff17e989cd9 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_drakkisath.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_drakkisath.cpp @@ -76,7 +76,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp index 0edcdfece15..0d8cabcf89c 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp @@ -105,7 +105,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_halycon.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_halycon.cpp index 3a7461f90c4..a944ee6daf8 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_halycon.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_halycon.cpp @@ -82,7 +82,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_highlord_omokk.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_highlord_omokk.cpp index 6f5b9079268..bc9de52d91d 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_highlord_omokk.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_highlord_omokk.cpp @@ -85,7 +85,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_mother_smolderweb.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_mother_smolderweb.cpp index cac07469d68..973ffe7e53b 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_mother_smolderweb.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_mother_smolderweb.cpp @@ -77,7 +77,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_overlord_wyrmthalak.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_overlord_wyrmthalak.cpp index 0975b171f4d..b7492998d56 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_overlord_wyrmthalak.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_overlord_wyrmthalak.cpp @@ -101,7 +101,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp index 96cc6e75e4e..d76d0d7f47c 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp @@ -74,7 +74,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_quartermaster_zigris.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_quartermaster_zigris.cpp index 470d41208dc..4fb7e513f5d 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_quartermaster_zigris.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_quartermaster_zigris.cpp @@ -72,7 +72,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp index 70b2a415a24..ce19a03571a 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp @@ -73,7 +73,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp index 20eefd5a0bc..f93466cbece 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp @@ -74,7 +74,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_the_beast.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_the_beast.cpp index 77152277742..88a09d57138 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_the_beast.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_the_beast.cpp @@ -73,7 +73,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_warmaster_voone.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_warmaster_voone.cpp index 9f06c2fbd5d..2dc05799e51 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_warmaster_voone.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_warmaster_voone.cpp @@ -82,7 +82,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp index 5222270df1a..2c7cd73c604 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp @@ -351,7 +351,7 @@ public: //Teleport self to a hiding spot (this causes errors in the Trinity log but no real issues) DoTeleportTo(HIDE_X, HIDE_Y, HIDE_Z); - me->AddUnitState(UNIT_STAT_FLEEING); + me->AddUnitState(UNIT_STATE_FLEEING); //Spawn nef and have him attack a random target Creature* Nefarian = me->SummonCreature(CREATURE_NEFARIAN, NEF_X, NEF_Y, NEF_Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp index a6d7248cc26..14add92fd16 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp @@ -393,7 +393,7 @@ public: EnfeebleResetTimer = 0; } else EnfeebleResetTimer -= diff; - if (me->HasUnitState(UNIT_STAT_STUNNED)) // While shifting to phase 2 malchezaar stuns himself + if (me->HasUnitState(UNIT_STATE_STUNNED)) // While shifting to phase 2 malchezaar stuns himself return; if (me->GetUInt64Value(UNIT_FIELD_TARGET) != me->getVictim()->GetGUID()) diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_baron_geddon.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_baron_geddon.cpp index 3959a01e4ba..f792b861c99 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_baron_geddon.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_baron_geddon.cpp @@ -80,7 +80,7 @@ class boss_baron_geddon : public CreatureScript return; } - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_garr.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_garr.cpp index e1bb48dfbb0..a9d32ebca9a 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_garr.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_garr.cpp @@ -71,7 +71,7 @@ class boss_garr : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_gehennas.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_gehennas.cpp index 9bbbb086abd..7261bbf1fbd 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_gehennas.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_gehennas.cpp @@ -68,7 +68,7 @@ class boss_gehennas : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_golemagg.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_golemagg.cpp index 1ba143a8c03..84e9957a60c 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_golemagg.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_golemagg.cpp @@ -91,7 +91,7 @@ class boss_golemagg : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_lucifron.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_lucifron.cpp index 5395b46fef3..e3e04002112 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_lucifron.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_lucifron.cpp @@ -68,7 +68,7 @@ class boss_lucifron : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_magmadar.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_magmadar.cpp index 5551531379b..65a630a58f7 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_magmadar.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_magmadar.cpp @@ -80,7 +80,7 @@ class boss_magmadar : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp index d324150c22f..862a980394a 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp @@ -116,7 +116,7 @@ class boss_majordomo : public CreatureScript return; } - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; if (HealthBelowPct(50)) diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_shazzrah.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_shazzrah.cpp index 97c89f12b5b..f696ec58e1b 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_shazzrah.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_shazzrah.cpp @@ -73,7 +73,7 @@ class boss_shazzrah : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_sulfuron_harbinger.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_sulfuron_harbinger.cpp index ccefca70d67..9f511c1394a 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_sulfuron_harbinger.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_sulfuron_harbinger.cpp @@ -84,7 +84,7 @@ class boss_sulfuron : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -169,7 +169,7 @@ class mob_flamewaker_priest : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp index cb7f0de165d..337eea13438 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp @@ -425,7 +425,7 @@ public: { me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->AddUnitState(UNIT_STAT_STUNNED); + me->AddUnitState(UNIT_STATE_STUNNED); ScriptedAI::InitializeAI(); } diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp index 2004eec71bc..9b5d941589b 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp @@ -151,7 +151,7 @@ public: summoned->CastSpell(summoned, SPELL_DARKFIEND_VISUAL, false); break; case CREATURE_DARKNESS: - summoned->AddUnitState(UNIT_STAT_STUNNED); + summoned->AddUnitState(UNIT_STATE_STUNNED); float x, y, z, o; summoned->GetHomePosition(x, y, z, o); me->SummonCreature(CREATURE_DARK_FIENDS, x, y, z, o, TEMPSUMMON_CORPSE_DESPAWN, 0); @@ -399,7 +399,7 @@ public: InAction = false; SummonSentinel = false; - me->AddUnitState(UNIT_STAT_STUNNED); + me->AddUnitState(UNIT_STATE_STUNNED); Summons.DespawnAll(); } @@ -472,7 +472,7 @@ public: WaitTimer = 2000; InAction = false; - me->AddUnitState(UNIT_STAT_STUNNED); + me->AddUnitState(UNIT_STATE_STUNNED); } void SpellHit(Unit* /*caster*/, const SpellInfo* Spell) @@ -491,7 +491,7 @@ public: { if (!InAction) { - me->ClearUnitState(UNIT_STAT_STUNNED); + me->ClearUnitState(UNIT_STATE_STUNNED); DoCastAOE(SPELL_DARKFIEND_SKIN, false); AttackStart(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)); InAction = true; @@ -599,7 +599,7 @@ public: SpellTimer = 5000; Phase = 0; - me->AddUnitState(UNIT_STAT_STUNNED); + me->AddUnitState(UNIT_STATE_STUNNED); DoCastAOE(SPELL_BLACKHOLE_SPAWN, true); } @@ -611,7 +611,7 @@ public: switch (NeedForAHack) { case 0: - me->ClearUnitState(UNIT_STAT_STUNNED); + me->ClearUnitState(UNIT_STATE_STUNNED); DoCastAOE(SPELL_BLACKHOLE_GROW, false); if (Victim) AttackStart(Victim); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp index 3cb0cc2120a..bd6f6ec4748 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp @@ -173,7 +173,7 @@ class boss_venoxis : public CreatureScript events.Update(diff); // return back to main code if we're still casting - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp index b295780cfc9..36a1ff1bade 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp @@ -75,7 +75,7 @@ class boss_kurinnaxx : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp index 3dc7660985f..a290b07e60f 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp @@ -127,7 +127,7 @@ class boss_moam : public CreatureScript } // Messing up mana-drain channel - //if (me->HasUnitState(UNIT_STAT_CASTING)) + //if (me->HasUnitState(UNIT_STATE_CASTING)) // return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp index ea137026ec2..afa8eff5823 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp @@ -93,7 +93,7 @@ class boss_rajaxx : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp index a60c33a4feb..b03d2dc3a4a 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp @@ -90,7 +90,7 @@ struct boss_twinemperorsAI : public ScriptedAI AfterTeleportTimer = 0; Abuse_Bug_Timer = urand(10000, 17000); BugsTimer = 2000; - me->ClearUnitState(UNIT_STAT_STUNNED); + me->ClearUnitState(UNIT_STATE_STUNNED); DontYellWhenDead = false; EnrageTimer = 15*60000; } @@ -234,7 +234,7 @@ struct boss_twinemperorsAI : public ScriptedAI DoStopAttack(); DoResetThreat(); DoCast(me, SPELL_TWIN_TELEPORT_VISUAL); - me->AddUnitState(UNIT_STAT_STUNNED); + me->AddUnitState(UNIT_STATE_STUNNED); AfterTeleport = true; AfterTeleportTimer = 2000; tspellcasted = false; @@ -246,9 +246,9 @@ struct boss_twinemperorsAI : public ScriptedAI { if (!tspellcasted) { - me->ClearUnitState(UNIT_STAT_STUNNED); + me->ClearUnitState(UNIT_STATE_STUNNED); DoCast(me, SPELL_TWIN_TELEPORT); - me->AddUnitState(UNIT_STAT_STUNNED); + me->AddUnitState(UNIT_STATE_STUNNED); } tspellcasted = true; @@ -256,7 +256,7 @@ struct boss_twinemperorsAI : public ScriptedAI if (AfterTeleportTimer <= diff) { AfterTeleport = false; - me->ClearUnitState(UNIT_STAT_STUNNED); + me->ClearUnitState(UNIT_STATE_STUNNED); if (Unit* nearu = me->SelectNearestTarget(100)) { //DoYell(nearu->GetName(), LANG_UNIVERSAL, 0); diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp index bf22c7a5d30..f1eaa0c87c5 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp @@ -115,7 +115,7 @@ public: DoCast(me, INSANITY_VISUAL, true); // Unattackable me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetControlled(true, UNIT_STAT_STUNNED); + me->SetControlled(true, UNIT_STATE_STUNNED); } // phase mask target->CastSpell(target, SPELL_INSANITY_TARGET+insanityHandled, true); @@ -171,7 +171,7 @@ public: // Cleanup Summons.DespawnAll(); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetControlled(false, UNIT_STAT_STUNNED); + me->SetControlled(false, UNIT_STATE_STUNNED); } void EnterCombat(Unit* /*who*/) @@ -271,7 +271,7 @@ public: insanityHandled = 0; me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetControlled(false, UNIT_STAT_STUNNED); + me->SetControlled(false, UNIT_STATE_STUNNED); me->RemoveAurasDueToSpell(INSANITY_VISUAL); } diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp index cf9c7fd0f3d..79a102c803f 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp @@ -283,7 +283,7 @@ public: if (((UndergroundPhase == 0 && HealthBelowPct(75)) || (UndergroundPhase == 1 && HealthBelowPct(50)) || (UndergroundPhase == 2 && HealthBelowPct(25))) - && !me->HasUnitState(UNIT_STAT_CASTING)) + && !me->HasUnitState(UNIT_STATE_CASTING)) { GuardianSummoned = false; VenomancerSummoned = false; diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp index 61d74c431fe..e848c29c466 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp @@ -174,7 +174,7 @@ class boss_baltharus_the_warborn : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING) && !(events.GetPhaseMask() & PHASE_INTRO_MASK)) + if (me->HasUnitState(UNIT_STATE_CASTING) && !(events.GetPhaseMask() & PHASE_INTRO_MASK)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -268,7 +268,7 @@ class npc_baltharus_the_warborn_clone : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = _events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp index 3b3b1fb9f47..851a56009f6 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp @@ -148,7 +148,7 @@ class boss_general_zarithrian : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -257,7 +257,7 @@ class npc_onyx_flamecaller : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = _events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp index 724fd4ef011..78810e27b05 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp @@ -137,7 +137,7 @@ class boss_saviana_ragefire : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp index 153e128e58d..0848d1e9524 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp @@ -111,7 +111,7 @@ public: { RemoveSummons(); me->SetDisplayId(me->GetNativeDisplayId()); - me->ClearUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED); + me->ClearUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED); bEventInProgress = false; bEvent = false; @@ -167,7 +167,7 @@ public: uiPhase++; uiResurrectTimer = 4000; bEventInProgress = false; - me->ClearUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED); + me->ClearUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED); } else uiResurrectTimer -= uiDiff; } @@ -211,14 +211,14 @@ public: if (!bSummonArmy) { bSummonArmy = true; - me->AddUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED); + me->AddUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED); DoCast(me, SPELL_ARMY_DEAD); } if (!bDeathArmyDone) { if (uiDeathArmyCheckTimer <= uiDiff) { - me->ClearUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED); + me->ClearUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED); uiDeathArmyCheckTimer = 0; bDeathArmyDone = true; } else uiDeathArmyCheckTimer -= uiDiff; @@ -263,7 +263,7 @@ public: } } - if (!me->HasUnitState(UNIT_STAT_ROOT) && !me->HealthBelowPct(1)) + if (!me->HasUnitState(UNIT_STATE_ROOT) && !me->HealthBelowPct(1)) DoMeleeAttackIfReady(); } @@ -273,7 +273,7 @@ public: { uiDamage = 0; me->SetHealth(0); - me->AddUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED); + me->AddUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED); RemoveSummons(); switch (uiPhase) { diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp index a0d6f04f44c..4a28ebe6495 100644 --- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp @@ -142,7 +142,7 @@ class boss_bronjahm : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp index fb39019fb84..ad49f6cbce8 100644 --- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp @@ -260,7 +260,7 @@ class boss_devourer_of_souls : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp index c6d00a95de3..c8f18dba1d0 100644 --- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp @@ -441,7 +441,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -497,7 +497,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -555,7 +555,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -612,7 +612,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -672,7 +672,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -738,7 +738,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -811,7 +811,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -878,7 +878,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp index 673362f59a0..9cfcb78f6f1 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp @@ -103,7 +103,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; switch (events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp index b074c309cb3..a9bfb603794 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp @@ -100,7 +100,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; switch (events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp index e1ae8374278..1583bdbdcd4 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp @@ -659,7 +659,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -742,7 +742,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -842,7 +842,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -912,7 +912,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -978,7 +978,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp index 26ece7db662..0f9495d4928 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp @@ -190,7 +190,7 @@ class boss_garfrost : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp index 8bcd0b8b8e2..8e211cbd2cb 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp @@ -215,7 +215,7 @@ class boss_ick : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp index 91be62a33e7..25cd292d390 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp @@ -72,7 +72,7 @@ class mob_ymirjar_flamebearer : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = _events.ExecuteEvent()) @@ -187,7 +187,7 @@ class mob_wrathbone_laborer : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = _events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp b/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp index 9abcc669f09..11614708d99 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp @@ -212,7 +212,7 @@ class boss_drakkari_colossus : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -289,7 +289,7 @@ class boss_drakkari_elemental : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -335,7 +335,7 @@ class boss_drakkari_elemental : public CreatureScript damage = 0; // to prevent spell spaming - if (me->HasUnitState(UNIT_STAT_CHARGING)) + if (me->HasUnitState(UNIT_STATE_CHARGING)) return; // not sure about this, the idea of this code is to prevent bug the elemental diff --git a/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp b/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp index 46070090063..daa5ee86483 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp @@ -148,7 +148,7 @@ public: DoScriptText(SAY_TRANSFORM_1, me); uiTransformationTimer = 5*IN_MILLISECONDS; bStartOfTransformation = true; - me->ClearUnitState(UNIT_STAT_STUNNED|UNIT_STAT_ROOT); + me->ClearUnitState(UNIT_STATE_STUNNED|UNIT_STATE_ROOT); me->SetReactState(REACT_AGGRESSIVE); } else @@ -158,7 +158,7 @@ public: if (bStartOfTransformation) { bStartOfTransformation = false; - me->AddUnitState(UNIT_STAT_STUNNED|UNIT_STAT_ROOT); + me->AddUnitState(UNIT_STATE_STUNNED|UNIT_STATE_ROOT); me->SetReactState(REACT_PASSIVE); } } @@ -191,7 +191,7 @@ public: DoScriptText(SAY_TRANSFORM_2, me); uiTransformationTimer = 9*IN_MILLISECONDS; bStartOfTransformation = true; - me->ClearUnitState(UNIT_STAT_STUNNED|UNIT_STAT_ROOT); + me->ClearUnitState(UNIT_STATE_STUNNED|UNIT_STATE_ROOT); me->SetReactState(REACT_AGGRESSIVE); } else @@ -201,7 +201,7 @@ public: if (bStartOfTransformation) { bStartOfTransformation = false; - me->AddUnitState(UNIT_STAT_STUNNED|UNIT_STAT_ROOT); + me->AddUnitState(UNIT_STATE_STUNNED|UNIT_STATE_ROOT); me->SetReactState(REACT_PASSIVE); } } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp index 94a3da2672b..ca86e4cef60 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp @@ -287,7 +287,7 @@ class boss_blood_council_controller : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -535,7 +535,7 @@ class boss_prince_keleseth_icc : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -753,7 +753,7 @@ class boss_prince_taldaram_icc : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -990,7 +990,7 @@ class boss_prince_valanar_icc : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -1179,7 +1179,7 @@ class npc_ball_of_flame : public CreatureScript if (Player* target = ObjectAccessor::GetPlayer(*me, _chaseGUID)) { // need to clear states now because this call is before AuraEffect is fully removed - me->ClearUnitState(UNIT_STAT_CASTING | UNIT_STAT_STUNNED); + me->ClearUnitState(UNIT_STATE_CASTING | UNIT_STATE_STUNNED); if (target && me->Attack(target, true)) me->GetMotionMaster()->MoveChase(target, 1.0f); } @@ -1316,7 +1316,7 @@ class npc_dark_nucleus : public CreatureScript } DoCast(who, SPELL_SHADOW_RESONANCE_RESIST); - me->ClearUnitState(UNIT_STAT_CASTING); + me->ClearUnitState(UNIT_STATE_CASTING); } void MoveInLineOfSight(Unit* who) @@ -1350,7 +1350,7 @@ class npc_dark_nucleus : public CreatureScript !victim->HasAura(SPELL_SHADOW_RESONANCE_RESIST, me->GetGUID())) { DoCast(victim, SPELL_SHADOW_RESONANCE_RESIST); - me->ClearUnitState(UNIT_STAT_CASTING); + me->ClearUnitState(UNIT_STATE_CASTING); } } else @@ -1369,7 +1369,7 @@ class npc_dark_nucleus : public CreatureScript _lockedTarget = true; AttackStart(victim); DoCast(victim, SPELL_SHADOW_RESONANCE_RESIST); - me->ClearUnitState(UNIT_STAT_CASTING); + me->ClearUnitState(UNIT_STATE_CASTING); } } } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp index d775e5778f7..79a577f6591 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp @@ -321,7 +321,7 @@ class boss_blood_queen_lana_thel : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp index 31b3786a360..ace5f07a2f8 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp @@ -403,7 +403,7 @@ class boss_deathbringer_saurfang : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp index f90bc5d445e..a97c6f7d138 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp @@ -169,7 +169,7 @@ class boss_festergut : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -305,7 +305,7 @@ class npc_stinky_icc : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = _events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp index 739df319117..6edf3fe300b 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp @@ -410,7 +410,7 @@ class boss_lady_deathwhisper : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING) && !(events.GetPhaseMask() & PHASE_INTRO_MASK)) + if (me->HasUnitState(UNIT_STATE_CASTING) && !(events.GetPhaseMask() & PHASE_INTRO_MASK)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -665,7 +665,7 @@ class npc_cult_fanatic : public CreatureScript Events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = Events.ExecuteEvent()) @@ -743,7 +743,7 @@ class npc_cult_adherent : public CreatureScript Events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = Events.ExecuteEvent()) @@ -888,7 +888,7 @@ class npc_darnavan : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; if (_canShatter && me->getVictim() && me->getVictim()->IsImmunedToDamage(SPELL_SCHOOL_MASK_NORMAL)) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp index 04ae6f933d8..c05422cbbf6 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp @@ -153,7 +153,7 @@ class boss_lord_marrowgar : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp index cf22338995b..a4c814e5789 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp @@ -519,7 +519,7 @@ class boss_professor_putricide : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -796,7 +796,7 @@ class spell_putricide_ooze_channel : public SpellScriptLoader void StartAttack() { - GetCaster()->ClearUnitState(UNIT_STAT_CASTING); + GetCaster()->ClearUnitState(UNIT_STATE_CASTING); GetCaster()->ToCreature()->AI()->AttackStart(GetHitUnit()); } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp index a4cd96aa9f6..9649b6c8ef8 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp @@ -169,7 +169,7 @@ class boss_rotface : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -384,7 +384,7 @@ class npc_precious_icc : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = _events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index 3d3eaa1cc87..bab58094468 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -379,7 +379,7 @@ class boss_sindragosa : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -663,7 +663,7 @@ class npc_spinestalker : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = _events.ExecuteEvent()) @@ -783,7 +783,7 @@ class npc_rimefang : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = _events.ExecuteEvent()) @@ -911,7 +911,7 @@ class npc_sindragosa_trash : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = _events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp index 5029dbcceee..f3750f38dd5 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -701,7 +701,7 @@ class boss_the_lich_king : public CreatureScript summon->CastSpell(summon, SPELL_ICE_SPHERE, false); summon->CastSpell(summon, SPELL_ICE_BURST_TARGET_SEARCH, false); summon->CastSpell(target, SPELL_ICE_PULSE, false); - summon->ClearUnitState(UNIT_STAT_CASTING); + summon->ClearUnitState(UNIT_STATE_CASTING); summon->GetMotionMaster()->MoveFollow(target, 0.0f, 0.0f); } else @@ -861,7 +861,7 @@ class boss_the_lich_king : public CreatureScript events.Update(diff); // during Remorseless Winter phases The Lich King is channeling a spell, but we must continue casting other spells - if (me->HasUnitState(UNIT_STAT_CASTING) && !(events.GetPhaseMask() & PHASE_MASK_NO_CAST_CHECK)) + if (me->HasUnitState(UNIT_STATE_CASTING) && !(events.GetPhaseMask() & PHASE_MASK_NO_CAST_CHECK)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -966,14 +966,14 @@ class boss_the_lich_king : public CreatureScript break; case EVENT_QUAKE: events.SetPhase(PHASE_TWO); - me->ClearUnitState(UNIT_STAT_CASTING); // clear state to ensure check in DoCastAOE passes + me->ClearUnitState(UNIT_STATE_CASTING); // clear state to ensure check in DoCastAOE passes DoCastAOE(SPELL_QUAKE); SendMusicToPlayers(MUSIC_SPECIAL); Talk(SAY_LK_QUAKE); break; case EVENT_QUAKE_2: events.SetPhase(PHASE_THREE); - me->ClearUnitState(UNIT_STAT_CASTING); // clear state to ensure check in DoCastAOE passes + me->ClearUnitState(UNIT_STATE_CASTING); // clear state to ensure check in DoCastAOE passes DoCastAOE(SPELL_QUAKE); SendMusicToPlayers(MUSIC_SPECIAL); Talk(SAY_LK_QUAKE); @@ -1059,7 +1059,7 @@ class boss_the_lich_king : public CreatureScript break; case EVENT_OUTRO_RAISE_DEAD: DoCastAOE(SPELL_RAISE_DEAD); - me->ClearUnitState(UNIT_STAT_CASTING); + me->ClearUnitState(UNIT_STATE_CASTING); SendMusicToPlayers(MUSIC_FINAL); break; case EVENT_OUTRO_TALK_5: @@ -1071,7 +1071,7 @@ class boss_the_lich_king : public CreatureScript Talk(SAY_LK_OUTRO_6); if (Creature* tirion = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_HIGHLORD_TIRION_FORDRING))) tirion->SetFacingToObject(me); - me->ClearUnitState(UNIT_STAT_CASTING); + me->ClearUnitState(UNIT_STATE_CASTING); DoCastAOE(SPELL_SUMMON_BROKEN_FROSTMOURNE_3); SetEquipmentSlots(false, EQUIP_UNEQUIP); break; @@ -1255,7 +1255,7 @@ class npc_tirion_fordring_tft : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = _events.ExecuteEvent()) @@ -1349,7 +1349,7 @@ class npc_shambling_horror_icc : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = _events.ExecuteEvent()) @@ -1429,7 +1429,7 @@ class npc_raging_spirit : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = _events.ExecuteEvent()) @@ -1498,7 +1498,7 @@ class npc_valkyr_shadowguard : public CreatureScript _events.Reset(); DoCastAOE(SPELL_EJECT_ALL_PASSENGERS); me->GetMotionMaster()->MoveTargetedHome(); - me->ClearUnitState(UNIT_STAT_EVADE); + me->ClearUnitState(UNIT_STATE_EVADE); } } @@ -1564,7 +1564,7 @@ class npc_valkyr_shadowguard : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = _events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp index 96072ad0e83..e0993178890 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp @@ -426,7 +426,7 @@ class boss_valithria_dreamwalker : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = _events.ExecuteEvent()) @@ -626,7 +626,7 @@ class npc_the_lich_king_controller : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = _events.ExecuteEvent()) @@ -741,7 +741,7 @@ class npc_risen_archmage : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = _events.ExecuteEvent()) @@ -807,7 +807,7 @@ class npc_blazing_skeleton : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = _events.ExecuteEvent()) @@ -873,7 +873,7 @@ class npc_suppresser : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; // this code will never be reached while channeling @@ -967,7 +967,7 @@ class npc_gluttonous_abomination : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = _events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp index 6bd8f3cba7d..112e23c4691 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp @@ -611,7 +611,7 @@ class npc_rotting_frost_giant : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = _events.ExecuteEvent()) @@ -874,7 +874,7 @@ class boss_sister_svalna : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -1130,7 +1130,7 @@ class npc_crok_scourgebane : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = _events.ExecuteEvent()) @@ -1353,7 +1353,7 @@ class npc_captain_arnath : public CreatureScript Events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = Events.ExecuteEvent()) @@ -1434,7 +1434,7 @@ class npc_captain_brandon : public CreatureScript Events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = Events.ExecuteEvent()) @@ -1502,7 +1502,7 @@ class npc_captain_grondel : public CreatureScript Events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = Events.ExecuteEvent()) @@ -1567,7 +1567,7 @@ class npc_captain_rupert : public CreatureScript Events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = Events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp b/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp index 95f07ac212a..058c5b35e3a 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp @@ -137,7 +137,7 @@ class boss_faerlina : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp index 2964cb5a699..47151ef6d80 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp @@ -342,7 +342,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp index 4c0efc4ac98..26e4b33ad8a 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp @@ -400,7 +400,7 @@ class boss_gothik : public CreatureScript instance->SetData(DATA_GOTHIK_GATE, GO_STATE_ACTIVE); } - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp index f70f36e77a3..161c9160293 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp @@ -486,7 +486,7 @@ public: else uiGuardiansOfIcecrownTimer -= diff; } - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; if (uint32 eventId = events.GetEvent()) diff --git a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp index be9168c6fd4..acdb2355841 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp @@ -248,7 +248,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp index 052fa3ba4a5..6dfa62df2d1 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp @@ -523,7 +523,7 @@ public: return; // We can't cast if we are casting already. - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_drakos.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_drakos.cpp index fe00f5b97d8..bb75b789fff 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_drakos.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_drakos.cpp @@ -95,7 +95,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp index b86e04f55bb..ab814a2ca22 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp @@ -200,7 +200,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp index 28b606c19e1..8de2945af30 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp @@ -101,7 +101,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp index 2c7532fcf70..eadc524348b 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp @@ -283,7 +283,7 @@ class boss_steelbreaker : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -404,7 +404,7 @@ class boss_runemaster_molgeim : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -649,7 +649,7 @@ class boss_stormcaller_brundir : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp index 10ff3db96c7..1c478cd83e9 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp @@ -217,7 +217,7 @@ class boss_auriaya : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -348,7 +348,7 @@ class npc_sanctum_sentry : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -418,7 +418,7 @@ class npc_feral_defender : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp index d96790c3e37..47f74b1ddba 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp @@ -384,7 +384,7 @@ class boss_flame_leviathan : public CreatureScript return; } - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -425,7 +425,7 @@ class boss_flame_leviathan : public CreatureScript break; case EVENT_REPAIR: me->MonsterTextEmote(EMOTE_REPAIR, 0, true); - me->ClearUnitState(UNIT_STAT_STUNNED | UNIT_STAT_ROOT); + me->ClearUnitState(UNIT_STATE_STUNNED | UNIT_STATE_ROOT); events.ScheduleEvent(EVENT_SHUTDOWN, 150*IN_MILLISECONDS); events.CancelEvent(EVENT_REPAIR); break; @@ -1576,7 +1576,7 @@ class spell_systems_shutdown : public SpellScriptLoader return; //! This could probably in the SPELL_EFFECT_SEND_EVENT handler too: - owner->AddUnitState(UNIT_STAT_STUNNED | UNIT_STAT_ROOT); + owner->AddUnitState(UNIT_STATE_STUNNED | UNIT_STATE_ROOT); owner->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); owner->RemoveAurasDueToSpell(SPELL_GATHERING_SPEED); } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp index f62c2d6c596..1f4fc8d3938 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp @@ -401,7 +401,7 @@ class boss_freya : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -739,7 +739,7 @@ class boss_elder_brightleaf : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -872,7 +872,7 @@ class boss_elder_stonebark : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -985,7 +985,7 @@ class boss_elder_ironbranch : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp index 0013a970380..c7918f85245 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp @@ -138,7 +138,7 @@ class boss_general_vezax : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -336,7 +336,7 @@ class boss_saronite_animus : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp index 918a401143a..33f50d0b3de 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp @@ -370,7 +370,7 @@ class boss_hodir : public CreatureScript me->StopMoving(); me->GetMotionMaster()->Clear(); me->GetMotionMaster()->MoveIdle(); - me->SetControlled(true, UNIT_STAT_STUNNED); + me->SetControlled(true, UNIT_STATE_STUNNED); me->CombatStop(true); me->setFaction(35); @@ -387,7 +387,7 @@ class boss_hodir : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -612,12 +612,12 @@ class npc_hodir_priest : public CreatureScript void UpdateAI(uint32 const diff) { - if (!UpdateVictim() || me->HasUnitState(UNIT_STAT_STUNNED) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED)) + if (!UpdateVictim() || me->HasUnitState(UNIT_STATE_STUNNED) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED)) return; events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; if (HealthBelowPct(30)) @@ -688,12 +688,12 @@ class npc_hodir_shaman : public CreatureScript void UpdateAI(uint32 const diff) { - if (!UpdateVictim() || me->HasUnitState(UNIT_STAT_STUNNED) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED)) + if (!UpdateVictim() || me->HasUnitState(UNIT_STATE_STUNNED) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED)) return; events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -750,12 +750,12 @@ class npc_hodir_druid : public CreatureScript void UpdateAI(uint32 const diff) { - if (!UpdateVictim() || me->HasUnitState(UNIT_STAT_STUNNED) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED)) + if (!UpdateVictim() || me->HasUnitState(UNIT_STATE_STUNNED) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED)) return; events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -825,12 +825,12 @@ class npc_hodir_mage : public CreatureScript void UpdateAI(uint32 const diff) { - if (!UpdateVictim() || me->HasUnitState(UNIT_STAT_STUNNED) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED)) + if (!UpdateVictim() || me->HasUnitState(UNIT_STATE_STUNNED) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED)) return; events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp index e72cf395a0d..d8a3ef0b8df 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp @@ -202,7 +202,7 @@ class boss_ignis : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp index 1fd8430abd8..a156e6ef08b 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp @@ -224,7 +224,7 @@ class boss_kologarn : public CreatureScript summon->CastSpell(summon, SPELL_FOCUSED_EYEBEAM_VISUAL, true); summon->SetReactState(REACT_PASSIVE); // One of the above spells is a channeled spell, we need to clear this unit state for MoveChase to work - summon->ClearUnitState(UNIT_STAT_CASTING); + summon->ClearUnitState(UNIT_STATE_CASTING); // Victim gets 67351 if (eyebeamTarget) @@ -244,7 +244,7 @@ class boss_kologarn : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp index 8f09ab26a0a..724eb45d586 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp @@ -263,7 +263,7 @@ class boss_xt002 : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp index 0c59097a9ec..43a848c6b16 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp @@ -229,7 +229,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp index 94a133c78a6..8a6d7f80818 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp @@ -252,7 +252,7 @@ public: events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp index 5c1ec15030c..989e1e57453 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp @@ -535,7 +535,7 @@ public: void UpdateAI(const uint32 diff) { - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; if (paralyzeTimer <= diff) @@ -663,7 +663,7 @@ class npc_scourge_hulk : public CreatureScript if (mightyBlow <= diff) { if (Unit* victim = me->getVictim()) - if (!victim->HasUnitState(UNIT_STAT_STUNNED)) // Prevent knocking back a ritual player + if (!victim->HasUnitState(UNIT_STATE_STUNNED)) // Prevent knocking back a ritual player DoCast(victim, SPELL_MIGHTY_BLOW); mightyBlow = urand(12000, 17000); } diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp index 1cc681b0133..bffc6af2a3a 100644 --- a/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp +++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp @@ -81,7 +81,7 @@ class boss_archavon : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -161,7 +161,7 @@ class mob_archavon_warder : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp index 973e7a2844c..2f4079d4e3c 100644 --- a/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp +++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp @@ -120,7 +120,7 @@ class boss_emalon : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -221,7 +221,7 @@ class mob_tempest_minion : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; if (Aura const* overchargedAura = me->GetAura(SPELL_OVERCHARGED)) diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_koralon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_koralon.cpp index a545a6ae14c..dd9db1c0a99 100644 --- a/src/server/scripts/Northrend/VaultOfArchavon/boss_koralon.cpp +++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_koralon.cpp @@ -79,7 +79,7 @@ class boss_koralon : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp index 4b92b54b0d3..162f59fa5b7 100644 --- a/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp +++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp @@ -80,7 +80,7 @@ class boss_toravon : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) @@ -148,7 +148,7 @@ class mob_frost_warder : public CreatureScript events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; if (events.ExecuteEvent() == EVENT_FROST_BLAST) diff --git a/src/server/scripts/Northrend/borean_tundra.cpp b/src/server/scripts/Northrend/borean_tundra.cpp index b6e01d3188e..11fb0933b9b 100644 --- a/src/server/scripts/Northrend/borean_tundra.cpp +++ b/src/server/scripts/Northrend/borean_tundra.cpp @@ -1328,7 +1328,7 @@ public: if (uiType != POINT_MOTION_TYPE) return; - me->AddUnitState(UNIT_STAT_STUNNED); + me->AddUnitState(UNIT_STATE_STUNNED); me->CastSpell(me, SPELL_STUN, true); if (me->isSummon()) if (Unit* summoner = me->ToTempSummon()->GetSummoner()) @@ -1445,7 +1445,7 @@ public: DoScriptText(SAY_LERYSSA_1, pLeryssa); pArlos->Kill(pArlos, false); pLeryssa->RemoveAura(SPELL_STUN); - pLeryssa->ClearUnitState(UNIT_STAT_STUNNED); + pLeryssa->ClearUnitState(UNIT_STATE_STUNNED); pLeryssa->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); pLeryssa->GetMotionMaster()->MovePoint(0, 3722.114502f, 3564.201660f, 477.441437f); @@ -1495,7 +1495,7 @@ public: if (Creature* pTalbot = me->FindNearestCreature(NPC_PRINCE_VALANAR, 50.0f, true)) CAST_AI(npc_counselor_talbot::npc_counselor_talbotAI, pTalbot->GetAI())->bCheck = true; - me->AddUnitState(UNIT_STAT_STUNNED); + me->AddUnitState(UNIT_STATE_STUNNED); me->CastSpell(me, SPELL_STUN, true); if (me->isSummon()) diff --git a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp index a8d1f22bd00..d359917ab28 100644 --- a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp +++ b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp @@ -82,7 +82,7 @@ public: summoned->CastSpell(summoned, SPELL_FOCUS_FIRE_VISUAL, false); summoned->setFaction(me->getFaction()); summoned->SetLevel(me->getLevel()); - summoned->AddUnitState(UNIT_STAT_ROOT); + summoned->AddUnitState(UNIT_STATE_ROOT); if (Unit* pFocusedTarget = Unit::GetUnit(*me, FocusedTargetGUID)) summoned->AI()->AttackStart(pFocusedTarget); diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp index 71e773042b7..ecea5e6abb4 100644 --- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp @@ -337,7 +337,7 @@ class boss_vazruden_the_herald : public CreatureScript VazrudenGUID = 0; } summoned = false; - me->ClearUnitState(UNIT_STAT_ROOT); + me->ClearUnitState(UNIT_STATE_ROOT); me->SetVisible(true); } } @@ -352,7 +352,7 @@ class boss_vazruden_the_herald : public CreatureScript NazanGUID = Nazan->GetGUID(); summoned = true; me->SetVisible(false); - me->AddUnitState(UNIT_STAT_ROOT); + me->AddUnitState(UNIT_STATE_ROOT); } } diff --git a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp index 1679efb5525..1f17e9e4802 100644 --- a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp @@ -253,7 +253,7 @@ class boss_magtheridon : public CreatureScript me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); - me->AddUnitState(UNIT_STAT_STUNNED); + me->AddUnitState(UNIT_STATE_STUNNED); DoCast(me, SPELL_SHADOW_CAGE_C, true); } @@ -334,7 +334,7 @@ class boss_magtheridon : public CreatureScript void AttackStart(Unit* who) { - if (!me->HasUnitState(UNIT_STAT_STUNNED)) + if (!me->HasUnitState(UNIT_STATE_STUNNED)) ScriptedAI::AttackStart(who); } @@ -388,7 +388,7 @@ class boss_magtheridon : public CreatureScript if (BlastNova_Timer <= diff) { // to avoid earthquake interruption - if (!me->HasUnitState(UNIT_STAT_STUNNED)) + if (!me->HasUnitState(UNIT_STATE_STUNNED)) { DoScriptText(EMOTE_BLASTNOVA, me); DoCast(me, SPELL_BLASTNOVA); @@ -431,7 +431,7 @@ class boss_magtheridon : public CreatureScript if (!Phase3 && HealthBelowPct(30) && !me->IsNonMeleeSpellCasted(false) // blast nova - && !me->HasUnitState(UNIT_STAT_STUNNED)) // shadow cage and earthquake + && !me->HasUnitState(UNIT_STATE_STUNNED)) // shadow cage and earthquake { Phase3 = true; DoScriptText(SAY_CHAMBER_DESTROY, me); diff --git a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp index 9d52a0a3e87..caaedc4c51b 100644 --- a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp @@ -223,7 +223,7 @@ class instance_magtheridons_lair : public InstanceMapScript Creature* Magtheridon = instance->GetCreature(MagtheridonGUID); if (Magtheridon && Magtheridon->isAlive()) { - Magtheridon->ClearUnitState(UNIT_STAT_STUNNED); + Magtheridon->ClearUnitState(UNIT_STATE_STUNNED); Magtheridon->AI()->AttackStart(Magtheridon->SelectNearestTarget(999)); } CageTimer = 0; diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp index 982b8372b7c..7a60b1545d0 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp @@ -397,7 +397,7 @@ class boss_kaelthas : public CreatureScript void MoveInLineOfSight(Unit* who) { - if (!me->HasUnitState(UNIT_STAT_STUNNED) && me->canCreatureAttack(who)) + if (!me->HasUnitState(UNIT_STATE_STUNNED) && me->canCreatureAttack(who)) { if (!me->canFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) return; diff --git a/src/server/scripts/Outland/boss_doomlord_kazzak.cpp b/src/server/scripts/Outland/boss_doomlord_kazzak.cpp index 4a83181159c..2f6e0823da1 100644 --- a/src/server/scripts/Outland/boss_doomlord_kazzak.cpp +++ b/src/server/scripts/Outland/boss_doomlord_kazzak.cpp @@ -110,7 +110,7 @@ class boss_doomlord_kazzak : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = _events.ExecuteEvent()) diff --git a/src/server/scripts/Outland/boss_doomwalker.cpp b/src/server/scripts/Outland/boss_doomwalker.cpp index 883601632b8..c4bd232cc85 100644 --- a/src/server/scripts/Outland/boss_doomwalker.cpp +++ b/src/server/scripts/Outland/boss_doomwalker.cpp @@ -103,7 +103,7 @@ class boss_doomwalker : public CreatureScript _events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = _events.ExecuteEvent()) diff --git a/src/server/scripts/Outland/nagrand.cpp b/src/server/scripts/Outland/nagrand.cpp index c27ad8e7948..668db2efcbb 100644 --- a/src/server/scripts/Outland/nagrand.cpp +++ b/src/server/scripts/Outland/nagrand.cpp @@ -632,7 +632,7 @@ public: if (!UpdateVictim()) return; - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; if (ChainLightningTimer <= diff) diff --git a/src/server/scripts/Outland/netherstorm.cpp b/src/server/scripts/Outland/netherstorm.cpp index efebf7dfe94..79811069402 100644 --- a/src/server/scripts/Outland/netherstorm.cpp +++ b/src/server/scripts/Outland/netherstorm.cpp @@ -796,7 +796,7 @@ public: Materialize = true; } - if (me->HasAuraType(SPELL_AURA_MOD_DECREASE_SPEED) || me->HasUnitState(UNIT_STAT_ROOT)) // if the mob is rooted/slowed by spells eg.: Entangling Roots, Frost Nova, Hamstring, Crippling Poison, etc. => remove it + if (me->HasAuraType(SPELL_AURA_MOD_DECREASE_SPEED) || me->HasUnitState(UNIT_STATE_ROOT)) // if the mob is rooted/slowed by spells eg.: Entangling Roots, Frost Nova, Hamstring, Crippling Poison, etc. => remove it DoCast(me, SPELL_PHASE_SLIP); if (!UpdateVictim()) diff --git a/src/server/scripts/Outland/shadowmoon_valley.cpp b/src/server/scripts/Outland/shadowmoon_valley.cpp index e4c4e020b0f..07de7fe4786 100644 --- a/src/server/scripts/Outland/shadowmoon_valley.cpp +++ b/src/server/scripts/Outland/shadowmoon_valley.cpp @@ -1195,7 +1195,7 @@ public: AggroTargetGUID = 0; Timers = false; - me->AddUnitState(UNIT_STAT_ROOT); + me->AddUnitState(UNIT_STATE_ROOT); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->SetTarget(0); } @@ -1239,7 +1239,7 @@ public: if (Player* AggroTarget = (Unit::GetPlayer(*me, AggroTargetGUID))) { me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->ClearUnitState(UNIT_STAT_ROOT); + me->ClearUnitState(UNIT_STATE_ROOT); float x, y, z; AggroTarget->GetPosition(x, y, z); diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index d266b42f50a..d3e484d80ab 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -224,7 +224,7 @@ public: { Unit* target = GetTarget(); target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); - target->AddUnitState(UNIT_STAT_ROOT); + target->AddUnitState(UNIT_STATE_ROOT); } void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) diff --git a/src/server/scripts/World/boss_emerald_dragons.cpp b/src/server/scripts/World/boss_emerald_dragons.cpp index 9deecea01ba..9f652e7a859 100644 --- a/src/server/scripts/World/boss_emerald_dragons.cpp +++ b/src/server/scripts/World/boss_emerald_dragons.cpp @@ -144,7 +144,7 @@ struct emerald_dragonAI : public WorldBossAI events.Update(diff); - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; while (uint32 eventId = events.ExecuteEvent()) diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index 9227c0c1138..fcf5f56c539 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -1910,7 +1910,7 @@ public: Unit* owner = me->GetCharmerOrOwner(); me->CombatStop(true); - if (owner && !me->HasUnitState(UNIT_STAT_FOLLOW)) + if (owner && !me->HasUnitState(UNIT_STATE_FOLLOW)) { me->GetMotionMaster()->Clear(false); me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle(), MOTION_SLOT_ACTIVE); @@ -2069,7 +2069,7 @@ public: void Reset() { - me->SetControlled(true, UNIT_STAT_STUNNED);//disable rotate + me->SetControlled(true, UNIT_STATE_STUNNED);//disable rotate me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);//imune to knock aways like blast wave ResetTimer = 5000; @@ -2101,8 +2101,8 @@ public: if (!UpdateVictim()) return; - if (!me->HasUnitState(UNIT_STAT_STUNNED)) - me->SetControlled(true, UNIT_STAT_STUNNED);//disable rotate + if (!me->HasUnitState(UNIT_STATE_STUNNED)) + me->SetControlled(true, UNIT_STATE_STUNNED);//disable rotate if (Entry != NPC_ADVANCED_TARGET_DUMMY && Entry != NPC_TARGET_DUMMY) { @@ -2203,7 +2203,7 @@ public: if (!UpdateVictim()) return; - if (me->HasUnitState(UNIT_STAT_CASTING)) + if (me->HasUnitState(UNIT_STATE_CASTING)) return; if (FireShield_Timer <= diff) -- cgit v1.2.3 From 39f96656ab1a559e7fe2f9116fdb2126352d4a2e Mon Sep 17 00:00:00 2001 From: Shocker Date: Fri, 3 Feb 2012 19:16:02 +0200 Subject: Core/Achievements: Correct condition for ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_LEVEL, thanks Lordron --- src/server/game/Achievements/AchievementMgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index f72906ed951..79366f90395 100755 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -2144,7 +2144,7 @@ bool AchievementMgr::CanUpdateCriteria(AchievementCriteriaEntry const* criteria, return false; break; case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_LEVEL: - if (!unit && unit->getLevel() != value) + if (!unit || unit->getLevel() != value) return false; break; case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_HEALTH_PERCENT_BELOW: -- cgit v1.2.3 From b1e4a1b14f43aa72c750dfb0b3b652d70863c892 Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 20 Feb 2012 19:12:05 +0100 Subject: Core/Tools: Replaced libmpq with StormLib and made map extractor use it, you can now extract 4.2.2 dbcs with it (still not maps) TODO: Update ADT structure --- dep/CMakeLists.txt | 2 +- dep/PackageList.txt | 8 +- dep/StormLib/CMakeLists.txt | 295 + dep/StormLib/doc/History.txt | 62 + dep/StormLib/doc/Sector Offset MD5.txt | 25 + dep/StormLib/doc/The MoPaQ File Format 0.9.txt | 318 + dep/StormLib/doc/The MoPaQ File Format 1.0.txt | 433 + dep/StormLib/src/FileStream.cpp | 1861 ++++ dep/StormLib/src/SBaseCommon.cpp | 1668 +++ dep/StormLib/src/SBaseDumpData.cpp | 144 + dep/StormLib/src/SBaseFileTable.cpp | 2477 +++++ dep/StormLib/src/SCompression.cpp | 1050 ++ dep/StormLib/src/SFileAddFile.cpp | 1211 ++ dep/StormLib/src/SFileAttributes.cpp | 399 + dep/StormLib/src/SFileCompactArchive.cpp | 735 ++ dep/StormLib/src/SFileCreateArchive.cpp | 234 + dep/StormLib/src/SFileExtractFile.cpp | 67 + dep/StormLib/src/SFileFindFile.cpp | 446 + dep/StormLib/src/SFileListFile.cpp | 554 + dep/StormLib/src/SFileOpenArchive.cpp | 439 + dep/StormLib/src/SFileOpenFileEx.cpp | 452 + dep/StormLib/src/SFilePatchArchives.cpp | 587 + dep/StormLib/src/SFileReadFile.cpp | 1185 ++ dep/StormLib/src/SFileVerify.cpp | 926 ++ dep/StormLib/src/StormCommon.h | 270 + dep/StormLib/src/StormLib.h | 975 ++ dep/StormLib/src/StormPort.h | 235 + dep/StormLib/src/adpcm/adpcm.cpp | 357 + dep/StormLib/src/adpcm/adpcm.h | 22 + dep/StormLib/src/bzip2/blocksort.c | 1094 ++ dep/StormLib/src/bzip2/bzlib.c | 1573 +++ dep/StormLib/src/bzip2/bzlib.h | 282 + dep/StormLib/src/bzip2/bzlib_private.h | 509 + dep/StormLib/src/bzip2/compress.c | 672 ++ dep/StormLib/src/bzip2/crctable.c | 104 + dep/StormLib/src/bzip2/decompress.c | 626 ++ dep/StormLib/src/bzip2/huffman.c | 205 + dep/StormLib/src/bzip2/randtable.c | 84 + dep/StormLib/src/huffman/huff.cpp | 1295 +++ dep/StormLib/src/huffman/huff.h | 144 + dep/StormLib/src/huffman/huff_patch.cpp | 1120 ++ dep/StormLib/src/huffman/huff_patch.h | 145 + dep/StormLib/src/jenkins/lookup.h | 24 + dep/StormLib/src/jenkins/lookup3.c | 1003 ++ .../src/libtomcrypt/src/hashes/hash_memory.c | 69 + dep/StormLib/src/libtomcrypt/src/hashes/md5.c | 368 + dep/StormLib/src/libtomcrypt/src/hashes/sha1.c | 288 + .../src/libtomcrypt/src/headers/tomcrypt.h | 87 + .../src/libtomcrypt/src/headers/tomcrypt_argchk.h | 38 + .../src/libtomcrypt/src/headers/tomcrypt_cfg.h | 136 + .../src/libtomcrypt/src/headers/tomcrypt_cipher.h | 891 ++ .../src/libtomcrypt/src/headers/tomcrypt_custom.h | 424 + .../src/libtomcrypt/src/headers/tomcrypt_hash.h | 378 + .../src/libtomcrypt/src/headers/tomcrypt_mac.h | 384 + .../src/libtomcrypt/src/headers/tomcrypt_macros.h | 424 + .../src/libtomcrypt/src/headers/tomcrypt_math.h | 500 + .../src/libtomcrypt/src/headers/tomcrypt_misc.h | 23 + .../src/libtomcrypt/src/headers/tomcrypt_pk.h | 558 + .../src/libtomcrypt/src/headers/tomcrypt_pkcs.h | 89 + .../src/libtomcrypt/src/headers/tomcrypt_prng.h | 199 + dep/StormLib/src/libtomcrypt/src/math/ltm_desc.c | 483 + dep/StormLib/src/libtomcrypt/src/math/multi.c | 61 + dep/StormLib/src/libtomcrypt/src/math/rand_prime.c | 87 + .../src/libtomcrypt/src/misc/base64_decode.c | 104 + .../src/libtomcrypt/src/misc/crypt_argchk.c | 30 + .../src/libtomcrypt/src/misc/crypt_find_hash.c | 40 + .../src/libtomcrypt/src/misc/crypt_find_prng.c | 41 + .../libtomcrypt/src/misc/crypt_hash_descriptor.c | 27 + .../src/libtomcrypt/src/misc/crypt_hash_is_valid.c | 36 + dep/StormLib/src/libtomcrypt/src/misc/crypt_libc.c | 43 + .../libtomcrypt/src/misc/crypt_ltc_mp_descriptor.c | 13 + .../libtomcrypt/src/misc/crypt_prng_descriptor.c | 26 + .../src/libtomcrypt/src/misc/crypt_prng_is_valid.c | 36 + .../src/libtomcrypt/src/misc/crypt_register_hash.c | 54 + .../src/libtomcrypt/src/misc/crypt_register_prng.c | 54 + dep/StormLib/src/libtomcrypt/src/misc/zeromem.c | 34 + .../src/pk/asn1/der_decode_bit_string.c | 102 + .../libtomcrypt/src/pk/asn1/der_decode_boolean.c | 47 + .../libtomcrypt/src/pk/asn1/der_decode_choice.c | 182 + .../src/pk/asn1/der_decode_ia5_string.c | 96 + .../libtomcrypt/src/pk/asn1/der_decode_integer.c | 110 + .../src/pk/asn1/der_decode_object_identifier.c | 99 + .../src/pk/asn1/der_decode_octet_string.c | 91 + .../src/pk/asn1/der_decode_printable_string.c | 96 + .../src/pk/asn1/der_decode_sequence_ex.c | 287 + .../src/pk/asn1/der_decode_sequence_flexi.c | 386 + .../src/pk/asn1/der_decode_sequence_multi.c | 139 + .../src/pk/asn1/der_decode_short_integer.c | 68 + .../libtomcrypt/src/pk/asn1/der_decode_utctime.c | 127 + .../src/pk/asn1/der_decode_utf8_string.c | 111 + .../src/pk/asn1/der_length_bit_string.c | 54 + .../libtomcrypt/src/pk/asn1/der_length_boolean.c | 35 + .../src/pk/asn1/der_length_ia5_string.c | 194 + .../libtomcrypt/src/pk/asn1/der_length_integer.c | 82 + .../src/pk/asn1/der_length_object_identifier.c | 89 + .../src/pk/asn1/der_length_octet_string.c | 53 + .../src/pk/asn1/der_length_printable_string.c | 166 + .../libtomcrypt/src/pk/asn1/der_length_sequence.c | 169 + .../src/pk/asn1/der_length_short_integer.c | 70 + .../libtomcrypt/src/pk/asn1/der_length_utctime.c | 46 + .../src/pk/asn1/der_length_utf8_string.c | 83 + .../libtomcrypt/src/pk/asn1/der_sequence_free.c | 65 + .../src/libtomcrypt/src/pk/ecc/ltc_ecc_map.c | 76 + .../src/libtomcrypt/src/pk/ecc/ltc_ecc_mul2add.c | 207 + .../src/libtomcrypt/src/pk/ecc/ltc_ecc_mulmod.c | 222 + .../src/libtomcrypt/src/pk/ecc/ltc_ecc_points.c | 60 + .../src/pk/ecc/ltc_ecc_projective_add_point.c | 196 + .../src/pk/ecc/ltc_ecc_projective_dbl_point.c | 147 + .../src/libtomcrypt/src/pk/pkcs1/pkcs_1_mgf1.c | 108 + .../libtomcrypt/src/pk/pkcs1/pkcs_1_oaep_decode.c | 189 + .../libtomcrypt/src/pk/pkcs1/pkcs_1_pss_decode.c | 177 + .../libtomcrypt/src/pk/pkcs1/pkcs_1_v1_5_decode.c | 110 + .../src/libtomcrypt/src/pk/rsa/rsa_exptmod.c | 113 + dep/StormLib/src/libtomcrypt/src/pk/rsa/rsa_free.c | 34 + .../src/libtomcrypt/src/pk/rsa/rsa_import.c | 143 + .../src/libtomcrypt/src/pk/rsa/rsa_make_key.c | 112 + .../src/libtomcrypt/src/pk/rsa/rsa_verify_hash.c | 167 + .../src/libtomcrypt/src/pk/rsa/rsa_verify_simple.c | 87 + dep/StormLib/src/libtommath/bn_fast_mp_invmod.c | 148 + .../src/libtommath/bn_fast_mp_montgomery_reduce.c | 172 + .../src/libtommath/bn_fast_s_mp_mul_digs.c | 107 + .../src/libtommath/bn_fast_s_mp_mul_high_digs.c | 98 + dep/StormLib/src/libtommath/bn_fast_s_mp_sqr.c | 114 + dep/StormLib/src/libtommath/bn_mp_2expt.c | 48 + dep/StormLib/src/libtommath/bn_mp_abs.c | 43 + dep/StormLib/src/libtommath/bn_mp_add.c | 53 + dep/StormLib/src/libtommath/bn_mp_add_d.c | 112 + dep/StormLib/src/libtommath/bn_mp_addmod.c | 41 + dep/StormLib/src/libtommath/bn_mp_and.c | 57 + dep/StormLib/src/libtommath/bn_mp_clamp.c | 44 + dep/StormLib/src/libtommath/bn_mp_clear.c | 44 + dep/StormLib/src/libtommath/bn_mp_clear_multi.c | 34 + dep/StormLib/src/libtommath/bn_mp_cmp.c | 43 + dep/StormLib/src/libtommath/bn_mp_cmp_d.c | 44 + dep/StormLib/src/libtommath/bn_mp_cmp_mag.c | 55 + dep/StormLib/src/libtommath/bn_mp_cnt_lsb.c | 53 + dep/StormLib/src/libtommath/bn_mp_copy.c | 68 + dep/StormLib/src/libtommath/bn_mp_count_bits.c | 45 + dep/StormLib/src/libtommath/bn_mp_div.c | 292 + dep/StormLib/src/libtommath/bn_mp_div_2.c | 68 + dep/StormLib/src/libtommath/bn_mp_div_2d.c | 97 + dep/StormLib/src/libtommath/bn_mp_div_3.c | 79 + dep/StormLib/src/libtommath/bn_mp_div_d.c | 115 + dep/StormLib/src/libtommath/bn_mp_dr_is_modulus.c | 43 + dep/StormLib/src/libtommath/bn_mp_dr_reduce.c | 94 + dep/StormLib/src/libtommath/bn_mp_dr_setup.c | 32 + dep/StormLib/src/libtommath/bn_mp_exch.c | 34 + dep/StormLib/src/libtommath/bn_mp_expt_d.c | 57 + dep/StormLib/src/libtommath/bn_mp_exptmod.c | 112 + dep/StormLib/src/libtommath/bn_mp_exptmod_fast.c | 321 + dep/StormLib/src/libtommath/bn_mp_exteuclid.c | 82 + dep/StormLib/src/libtommath/bn_mp_fread.c | 67 + dep/StormLib/src/libtommath/bn_mp_fwrite.c | 52 + dep/StormLib/src/libtommath/bn_mp_gcd.c | 105 + dep/StormLib/src/libtommath/bn_mp_get_int.c | 45 + dep/StormLib/src/libtommath/bn_mp_grow.c | 57 + dep/StormLib/src/libtommath/bn_mp_init.c | 46 + dep/StormLib/src/libtommath/bn_mp_init_copy.c | 32 + dep/StormLib/src/libtommath/bn_mp_init_multi.c | 59 + dep/StormLib/src/libtommath/bn_mp_init_set.c | 32 + dep/StormLib/src/libtommath/bn_mp_init_set_int.c | 31 + dep/StormLib/src/libtommath/bn_mp_init_size.c | 48 + dep/StormLib/src/libtommath/bn_mp_invmod.c | 43 + dep/StormLib/src/libtommath/bn_mp_invmod_slow.c | 175 + dep/StormLib/src/libtommath/bn_mp_is_square.c | 109 + dep/StormLib/src/libtommath/bn_mp_jacobi.c | 105 + dep/StormLib/src/libtommath/bn_mp_karatsuba_mul.c | 167 + dep/StormLib/src/libtommath/bn_mp_karatsuba_sqr.c | 121 + dep/StormLib/src/libtommath/bn_mp_lcm.c | 60 + dep/StormLib/src/libtommath/bn_mp_lshd.c | 67 + dep/StormLib/src/libtommath/bn_mp_mod.c | 48 + dep/StormLib/src/libtommath/bn_mp_mod_2d.c | 55 + dep/StormLib/src/libtommath/bn_mp_mod_d.c | 27 + .../bn_mp_montgomery_calc_normalization.c | 59 + .../src/libtommath/bn_mp_montgomery_reduce.c | 118 + .../src/libtommath/bn_mp_montgomery_setup.c | 59 + dep/StormLib/src/libtommath/bn_mp_mul.c | 66 + dep/StormLib/src/libtommath/bn_mp_mul_2.c | 82 + dep/StormLib/src/libtommath/bn_mp_mul_2d.c | 85 + dep/StormLib/src/libtommath/bn_mp_mul_d.c | 79 + dep/StormLib/src/libtommath/bn_mp_mulmod.c | 40 + dep/StormLib/src/libtommath/bn_mp_n_root.c | 132 + dep/StormLib/src/libtommath/bn_mp_neg.c | 40 + dep/StormLib/src/libtommath/bn_mp_or.c | 50 + dep/StormLib/src/libtommath/bn_mp_prime_fermat.c | 62 + .../src/libtommath/bn_mp_prime_is_divisible.c | 50 + dep/StormLib/src/libtommath/bn_mp_prime_is_prime.c | 83 + .../src/libtommath/bn_mp_prime_miller_rabin.c | 103 + .../src/libtommath/bn_mp_prime_next_prime.c | 170 + .../libtommath/bn_mp_prime_rabin_miller_trials.c | 52 + .../src/libtommath/bn_mp_prime_random_ex.c | 125 + dep/StormLib/src/libtommath/bn_mp_radix_size.c | 78 + dep/StormLib/src/libtommath/bn_mp_radix_smap.c | 24 + dep/StormLib/src/libtommath/bn_mp_rand.c | 55 + dep/StormLib/src/libtommath/bn_mp_read_radix.c | 85 + .../src/libtommath/bn_mp_read_signed_bin.c | 41 + .../src/libtommath/bn_mp_read_unsigned_bin.c | 55 + dep/StormLib/src/libtommath/bn_mp_reduce.c | 100 + dep/StormLib/src/libtommath/bn_mp_reduce_2k.c | 61 + dep/StormLib/src/libtommath/bn_mp_reduce_2k_l.c | 62 + .../src/libtommath/bn_mp_reduce_2k_setup.c | 47 + .../src/libtommath/bn_mp_reduce_2k_setup_l.c | 44 + dep/StormLib/src/libtommath/bn_mp_reduce_is_2k.c | 52 + dep/StormLib/src/libtommath/bn_mp_reduce_is_2k_l.c | 44 + dep/StormLib/src/libtommath/bn_mp_reduce_setup.c | 34 + dep/StormLib/src/libtommath/bn_mp_rshd.c | 72 + dep/StormLib/src/libtommath/bn_mp_set.c | 29 + dep/StormLib/src/libtommath/bn_mp_set_int.c | 48 + dep/StormLib/src/libtommath/bn_mp_shrink.c | 35 + .../src/libtommath/bn_mp_signed_bin_size.c | 27 + dep/StormLib/src/libtommath/bn_mp_sqr.c | 58 + dep/StormLib/src/libtommath/bn_mp_sqrmod.c | 41 + dep/StormLib/src/libtommath/bn_mp_sqrt.c | 81 + dep/StormLib/src/libtommath/bn_mp_sub.c | 59 + dep/StormLib/src/libtommath/bn_mp_sub_d.c | 93 + dep/StormLib/src/libtommath/bn_mp_submod.c | 42 + dep/StormLib/src/libtommath/bn_mp_to_signed_bin.c | 33 + .../src/libtommath/bn_mp_to_signed_bin_n.c | 31 + .../src/libtommath/bn_mp_to_unsigned_bin.c | 48 + .../src/libtommath/bn_mp_to_unsigned_bin_n.c | 31 + dep/StormLib/src/libtommath/bn_mp_toom_mul.c | 284 + dep/StormLib/src/libtommath/bn_mp_toom_sqr.c | 226 + dep/StormLib/src/libtommath/bn_mp_toradix.c | 75 + dep/StormLib/src/libtommath/bn_mp_toradix_n.c | 88 + .../src/libtommath/bn_mp_unsigned_bin_size.c | 28 + dep/StormLib/src/libtommath/bn_mp_xor.c | 51 + dep/StormLib/src/libtommath/bn_mp_zero.c | 36 + dep/StormLib/src/libtommath/bn_prime_tab.c | 61 + dep/StormLib/src/libtommath/bn_reverse.c | 39 + dep/StormLib/src/libtommath/bn_s_mp_add.c | 109 + dep/StormLib/src/libtommath/bn_s_mp_exptmod.c | 252 + dep/StormLib/src/libtommath/bn_s_mp_mul_digs.c | 90 + .../src/libtommath/bn_s_mp_mul_high_digs.c | 81 + dep/StormLib/src/libtommath/bn_s_mp_sqr.c | 84 + dep/StormLib/src/libtommath/bn_s_mp_sub.c | 89 + dep/StormLib/src/libtommath/bncore.c | 36 + dep/StormLib/src/libtommath/tommath.h | 584 + dep/StormLib/src/libtommath/tommath_class.h | 999 ++ dep/StormLib/src/libtommath/tommath_superclass.h | 76 + dep/StormLib/src/lzma/C/LzFind.c | 761 ++ dep/StormLib/src/lzma/C/LzFind.h | 115 + dep/StormLib/src/lzma/C/LzFindMt.c | 793 ++ dep/StormLib/src/lzma/C/LzFindMt.h | 105 + dep/StormLib/src/lzma/C/LzHash.h | 54 + dep/StormLib/src/lzma/C/LzmaDec.c | 999 ++ dep/StormLib/src/lzma/C/LzmaDec.h | 231 + dep/StormLib/src/lzma/C/LzmaEnc.c | 2268 ++++ dep/StormLib/src/lzma/C/LzmaEnc.h | 80 + dep/StormLib/src/lzma/C/Threads.c | 84 + dep/StormLib/src/lzma/C/Threads.h | 59 + dep/StormLib/src/lzma/C/Types.h | 236 + dep/StormLib/src/pklib/crc32.c | 66 + dep/StormLib/src/pklib/explode.c | 522 + dep/StormLib/src/pklib/implode.c | 769 ++ dep/StormLib/src/pklib/pklib.h | 148 + dep/StormLib/src/sparse/sparse.cpp | 288 + dep/StormLib/src/sparse/sparse.h | 19 + dep/StormLib/src/zlib/adler32.c | 149 + dep/StormLib/src/zlib/compress2.c | 79 + dep/StormLib/src/zlib/crc32.c | 423 + dep/StormLib/src/zlib/crc32.h | 441 + dep/StormLib/src/zlib/deflate.c | 1736 +++ dep/StormLib/src/zlib/deflate.h | 331 + dep/StormLib/src/zlib/inffast.c | 318 + dep/StormLib/src/zlib/inffast.h | 11 + dep/StormLib/src/zlib/inffixed.h | 94 + dep/StormLib/src/zlib/inflate.c | 1368 +++ dep/StormLib/src/zlib/inflate.h | 115 + dep/StormLib/src/zlib/inftrees.c | 329 + dep/StormLib/src/zlib/inftrees.h | 55 + dep/StormLib/src/zlib/trees.c | 1219 ++ dep/StormLib/src/zlib/trees.h | 128 + dep/StormLib/src/zlib/zconf.h | 332 + dep/StormLib/src/zlib/zlib.h | 1357 +++ dep/StormLib/src/zlib/zutil.c | 318 + dep/StormLib/src/zlib/zutil.h | 269 + dep/StormLib/storm_dll/storm_dll.cpp | 117 + dep/StormLib/storm_dll/storm_dll.def | 25 + dep/StormLib/storm_dll/storm_dll.h | 67 + dep/StormLib/stormlib_dll/DllMain.c | 24 + dep/StormLib/stormlib_dll/StormLib.def | 77 + dep/StormLib/stormlib_dll/StormLib.exp | 76 + dep/StormLib/test/Test.cpp | 1804 +++ dep/StormLib/test/x86_ripped_code.asm | 1231 +++ dep/StormLib/test/x86_starcraft_lzma.asm | 11066 +++++++++++++++++++ dep/libmpq/AUTHORS | 10 - dep/libmpq/CMakeLists.txt | 34 - dep/libmpq/COPYING | 339 - dep/libmpq/FAQ | 68 - dep/libmpq/INSTALL | 182 - dep/libmpq/Makefile.am | 26 - dep/libmpq/NEWS | 76 - dep/libmpq/README | 34 - dep/libmpq/THANKS | 21 - dep/libmpq/TODO | 10 - dep/libmpq/autogen.sh | 19 - dep/libmpq/bindings/Makefile.am | 6 - dep/libmpq/bindings/d/Makefile.am | 6 - dep/libmpq/bindings/d/dsss.conf | 2 - dep/libmpq/bindings/d/mpq.d | 318 - dep/libmpq/bindings/python/Makefile.am | 5 - dep/libmpq/bindings/python/mpq-info | 16 - dep/libmpq/bindings/python/mpq.py | 322 - dep/libmpq/config.h | 74 - dep/libmpq/configure.ac | 84 - dep/libmpq/debian/changelog | 35 - dep/libmpq/debian/compat | 1 - dep/libmpq/debian/control | 50 - dep/libmpq/debian/copyright | 23 - dep/libmpq/debian/libmpq-dev.dirs | 6 - dep/libmpq/debian/libmpq-dev.install | 6 - dep/libmpq/debian/libmpq0.dirs | 1 - dep/libmpq/debian/libmpq0.docs | 6 - dep/libmpq/debian/libmpq0.install | 1 - dep/libmpq/debian/python-mpq.install | 1 - dep/libmpq/debian/rules | 112 - dep/libmpq/doc/Makefile.am | 5 - dep/libmpq/doc/man1/Makefile.am | 9 - dep/libmpq/doc/man1/libmpq-config.1 | 69 - dep/libmpq/doc/man3/Makefile.am | 31 - dep/libmpq/doc/man3/libmpq.3 | 207 - dep/libmpq/doc/man3/libmpq__archive_close.3 | 57 - dep/libmpq/doc/man3/libmpq__archive_files.3 | 50 - dep/libmpq/doc/man3/libmpq__archive_offset.3 | 51 - dep/libmpq/doc/man3/libmpq__archive_open.3 | 71 - dep/libmpq/doc/man3/libmpq__archive_packed_size.3 | 51 - .../doc/man3/libmpq__archive_unpacked_size.3 | 51 - dep/libmpq/doc/man3/libmpq__archive_version.3 | 48 - dep/libmpq/doc/man3/libmpq__block_close_offset.3 | 53 - dep/libmpq/doc/man3/libmpq__block_open_offset.3 | 65 - dep/libmpq/doc/man3/libmpq__block_read.3 | 78 - dep/libmpq/doc/man3/libmpq__block_unpacked_size.3 | 59 - dep/libmpq/doc/man3/libmpq__file_blocks.3 | 54 - dep/libmpq/doc/man3/libmpq__file_compressed.3 | 54 - dep/libmpq/doc/man3/libmpq__file_encrypted.3 | 54 - dep/libmpq/doc/man3/libmpq__file_imploded.3 | 54 - dep/libmpq/doc/man3/libmpq__file_number.3 | 52 - dep/libmpq/doc/man3/libmpq__file_offset.3 | 55 - dep/libmpq/doc/man3/libmpq__file_packed_size.3 | 55 - dep/libmpq/doc/man3/libmpq__file_read.3 | 77 - dep/libmpq/doc/man3/libmpq__file_unpacked_size.3 | 55 - dep/libmpq/doc/man3/libmpq__strerror.3 | 45 - dep/libmpq/doc/man3/libmpq__version.3 | 45 - dep/libmpq/libmpq-config.in | 57 - dep/libmpq/libmpq.pc.in | 10 - dep/libmpq/libmpq/Makefile.am | 23 - dep/libmpq/libmpq/common.c | 220 - dep/libmpq/libmpq/common.h | 61 - dep/libmpq/libmpq/crypt_buf.h | 217 - dep/libmpq/libmpq/explode.c | 602 - dep/libmpq/libmpq/explode.h | 87 - dep/libmpq/libmpq/extract.c | 361 - dep/libmpq/libmpq/extract.h | 106 - dep/libmpq/libmpq/huffman.c | 1101 -- dep/libmpq/libmpq/huffman.h | 151 - dep/libmpq/libmpq/mpq-internal.h | 145 - dep/libmpq/libmpq/mpq.c | 1004 -- dep/libmpq/libmpq/mpq.h | 101 - dep/libmpq/libmpq/pack_begin.h | 34 - dep/libmpq/libmpq/pack_end.h | 31 - dep/libmpq/libmpq/platform.h | 28 - dep/libmpq/libmpq/wave.c | 250 - dep/libmpq/libmpq/wave.h | 45 - dep/libmpq/tools/Makefile.am | 8 - dep/libmpq/tools/crypt_buf_gen.c | 85 - dep/libmpq/win/config.h | 81 - dep/libmpq/win/dirent.h | 230 - dep/libmpq/win/stdint.h | 247 - src/tools/map_extractor/CMakeLists.txt | 26 +- src/tools/map_extractor/System.cpp | 408 +- src/tools/map_extractor/adt.h | 4 +- src/tools/map_extractor/dbcfile.cpp | 76 +- src/tools/map_extractor/dbcfile.h | 210 +- src/tools/map_extractor/loadlib.cpp | 25 +- src/tools/map_extractor/loadlib/loadlib.h | 5 +- src/tools/map_extractor/mpq_libmpq.cpp | 111 - src/tools/map_extractor/mpq_libmpq04.h | 91 - src/tools/map_extractor/wdt.cpp | 2 +- src/tools/map_extractor/wdt.h | 2 +- src/tools/vmap3_extractor/CMakeLists.txt | 18 +- src/tools/vmap3_extractor/dbcfile.cpp | 106 +- src/tools/vmap3_extractor/dbcfile.h | 242 +- src/tools/vmap3_extractor/loadlib/loadlib.h | 59 - src/tools/vmap3_extractor/model.h | 1 - src/tools/vmap3_extractor/mpq_libmpq04.h | 1 - src/tools/vmap3_extractor/wmo.h | 1 - 386 files changed, 79961 insertions(+), 9507 deletions(-) create mode 100644 dep/StormLib/CMakeLists.txt create mode 100644 dep/StormLib/doc/History.txt create mode 100644 dep/StormLib/doc/Sector Offset MD5.txt create mode 100644 dep/StormLib/doc/The MoPaQ File Format 0.9.txt create mode 100644 dep/StormLib/doc/The MoPaQ File Format 1.0.txt create mode 100644 dep/StormLib/src/FileStream.cpp create mode 100644 dep/StormLib/src/SBaseCommon.cpp create mode 100644 dep/StormLib/src/SBaseDumpData.cpp create mode 100644 dep/StormLib/src/SBaseFileTable.cpp create mode 100644 dep/StormLib/src/SCompression.cpp create mode 100644 dep/StormLib/src/SFileAddFile.cpp create mode 100644 dep/StormLib/src/SFileAttributes.cpp create mode 100644 dep/StormLib/src/SFileCompactArchive.cpp create mode 100644 dep/StormLib/src/SFileCreateArchive.cpp create mode 100644 dep/StormLib/src/SFileExtractFile.cpp create mode 100644 dep/StormLib/src/SFileFindFile.cpp create mode 100644 dep/StormLib/src/SFileListFile.cpp create mode 100644 dep/StormLib/src/SFileOpenArchive.cpp create mode 100644 dep/StormLib/src/SFileOpenFileEx.cpp create mode 100644 dep/StormLib/src/SFilePatchArchives.cpp create mode 100644 dep/StormLib/src/SFileReadFile.cpp create mode 100644 dep/StormLib/src/SFileVerify.cpp create mode 100644 dep/StormLib/src/StormCommon.h create mode 100644 dep/StormLib/src/StormLib.h create mode 100644 dep/StormLib/src/StormPort.h create mode 100644 dep/StormLib/src/adpcm/adpcm.cpp create mode 100644 dep/StormLib/src/adpcm/adpcm.h create mode 100644 dep/StormLib/src/bzip2/blocksort.c create mode 100644 dep/StormLib/src/bzip2/bzlib.c create mode 100644 dep/StormLib/src/bzip2/bzlib.h create mode 100644 dep/StormLib/src/bzip2/bzlib_private.h create mode 100644 dep/StormLib/src/bzip2/compress.c create mode 100644 dep/StormLib/src/bzip2/crctable.c create mode 100644 dep/StormLib/src/bzip2/decompress.c create mode 100644 dep/StormLib/src/bzip2/huffman.c create mode 100644 dep/StormLib/src/bzip2/randtable.c create mode 100644 dep/StormLib/src/huffman/huff.cpp create mode 100644 dep/StormLib/src/huffman/huff.h create mode 100644 dep/StormLib/src/huffman/huff_patch.cpp create mode 100644 dep/StormLib/src/huffman/huff_patch.h create mode 100644 dep/StormLib/src/jenkins/lookup.h create mode 100644 dep/StormLib/src/jenkins/lookup3.c create mode 100644 dep/StormLib/src/libtomcrypt/src/hashes/hash_memory.c create mode 100644 dep/StormLib/src/libtomcrypt/src/hashes/md5.c create mode 100644 dep/StormLib/src/libtomcrypt/src/hashes/sha1.c create mode 100644 dep/StormLib/src/libtomcrypt/src/headers/tomcrypt.h create mode 100644 dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_argchk.h create mode 100644 dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_cfg.h create mode 100644 dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_cipher.h create mode 100644 dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_custom.h create mode 100644 dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_hash.h create mode 100644 dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_mac.h create mode 100644 dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_macros.h create mode 100644 dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_math.h create mode 100644 dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_misc.h create mode 100644 dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_pk.h create mode 100644 dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_pkcs.h create mode 100644 dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_prng.h create mode 100644 dep/StormLib/src/libtomcrypt/src/math/ltm_desc.c create mode 100644 dep/StormLib/src/libtomcrypt/src/math/multi.c create mode 100644 dep/StormLib/src/libtomcrypt/src/math/rand_prime.c create mode 100644 dep/StormLib/src/libtomcrypt/src/misc/base64_decode.c create mode 100644 dep/StormLib/src/libtomcrypt/src/misc/crypt_argchk.c create mode 100644 dep/StormLib/src/libtomcrypt/src/misc/crypt_find_hash.c create mode 100644 dep/StormLib/src/libtomcrypt/src/misc/crypt_find_prng.c create mode 100644 dep/StormLib/src/libtomcrypt/src/misc/crypt_hash_descriptor.c create mode 100644 dep/StormLib/src/libtomcrypt/src/misc/crypt_hash_is_valid.c create mode 100644 dep/StormLib/src/libtomcrypt/src/misc/crypt_libc.c create mode 100644 dep/StormLib/src/libtomcrypt/src/misc/crypt_ltc_mp_descriptor.c create mode 100644 dep/StormLib/src/libtomcrypt/src/misc/crypt_prng_descriptor.c create mode 100644 dep/StormLib/src/libtomcrypt/src/misc/crypt_prng_is_valid.c create mode 100644 dep/StormLib/src/libtomcrypt/src/misc/crypt_register_hash.c create mode 100644 dep/StormLib/src/libtomcrypt/src/misc/crypt_register_prng.c create mode 100644 dep/StormLib/src/libtomcrypt/src/misc/zeromem.c create mode 100644 dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_bit_string.c create mode 100644 dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_boolean.c create mode 100644 dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_choice.c create mode 100644 dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_ia5_string.c create mode 100644 dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_integer.c create mode 100644 dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_object_identifier.c create mode 100644 dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_octet_string.c create mode 100644 dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_printable_string.c create mode 100644 dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_sequence_ex.c create mode 100644 dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_sequence_flexi.c create mode 100644 dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_sequence_multi.c create mode 100644 dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_short_integer.c create mode 100644 dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_utctime.c create mode 100644 dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_utf8_string.c create mode 100644 dep/StormLib/src/libtomcrypt/src/pk/asn1/der_length_bit_string.c create mode 100644 dep/StormLib/src/libtomcrypt/src/pk/asn1/der_length_boolean.c create mode 100644 dep/StormLib/src/libtomcrypt/src/pk/asn1/der_length_ia5_string.c create mode 100644 dep/StormLib/src/libtomcrypt/src/pk/asn1/der_length_integer.c create mode 100644 dep/StormLib/src/libtomcrypt/src/pk/asn1/der_length_object_identifier.c create mode 100644 dep/StormLib/src/libtomcrypt/src/pk/asn1/der_length_octet_string.c create mode 100644 dep/StormLib/src/libtomcrypt/src/pk/asn1/der_length_printable_string.c create mode 100644 dep/StormLib/src/libtomcrypt/src/pk/asn1/der_length_sequence.c create mode 100644 dep/StormLib/src/libtomcrypt/src/pk/asn1/der_length_short_integer.c create mode 100644 dep/StormLib/src/libtomcrypt/src/pk/asn1/der_length_utctime.c create mode 100644 dep/StormLib/src/libtomcrypt/src/pk/asn1/der_length_utf8_string.c create mode 100644 dep/StormLib/src/libtomcrypt/src/pk/asn1/der_sequence_free.c create mode 100644 dep/StormLib/src/libtomcrypt/src/pk/ecc/ltc_ecc_map.c create mode 100644 dep/StormLib/src/libtomcrypt/src/pk/ecc/ltc_ecc_mul2add.c create mode 100644 dep/StormLib/src/libtomcrypt/src/pk/ecc/ltc_ecc_mulmod.c create mode 100644 dep/StormLib/src/libtomcrypt/src/pk/ecc/ltc_ecc_points.c create mode 100644 dep/StormLib/src/libtomcrypt/src/pk/ecc/ltc_ecc_projective_add_point.c create mode 100644 dep/StormLib/src/libtomcrypt/src/pk/ecc/ltc_ecc_projective_dbl_point.c create mode 100644 dep/StormLib/src/libtomcrypt/src/pk/pkcs1/pkcs_1_mgf1.c create mode 100644 dep/StormLib/src/libtomcrypt/src/pk/pkcs1/pkcs_1_oaep_decode.c create mode 100644 dep/StormLib/src/libtomcrypt/src/pk/pkcs1/pkcs_1_pss_decode.c create mode 100644 dep/StormLib/src/libtomcrypt/src/pk/pkcs1/pkcs_1_v1_5_decode.c create mode 100644 dep/StormLib/src/libtomcrypt/src/pk/rsa/rsa_exptmod.c create mode 100644 dep/StormLib/src/libtomcrypt/src/pk/rsa/rsa_free.c create mode 100644 dep/StormLib/src/libtomcrypt/src/pk/rsa/rsa_import.c create mode 100644 dep/StormLib/src/libtomcrypt/src/pk/rsa/rsa_make_key.c create mode 100644 dep/StormLib/src/libtomcrypt/src/pk/rsa/rsa_verify_hash.c create mode 100644 dep/StormLib/src/libtomcrypt/src/pk/rsa/rsa_verify_simple.c create mode 100644 dep/StormLib/src/libtommath/bn_fast_mp_invmod.c create mode 100644 dep/StormLib/src/libtommath/bn_fast_mp_montgomery_reduce.c create mode 100644 dep/StormLib/src/libtommath/bn_fast_s_mp_mul_digs.c create mode 100644 dep/StormLib/src/libtommath/bn_fast_s_mp_mul_high_digs.c create mode 100644 dep/StormLib/src/libtommath/bn_fast_s_mp_sqr.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_2expt.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_abs.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_add.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_add_d.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_addmod.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_and.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_clamp.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_clear.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_clear_multi.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_cmp.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_cmp_d.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_cmp_mag.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_cnt_lsb.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_copy.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_count_bits.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_div.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_div_2.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_div_2d.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_div_3.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_div_d.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_dr_is_modulus.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_dr_reduce.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_dr_setup.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_exch.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_expt_d.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_exptmod.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_exptmod_fast.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_exteuclid.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_fread.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_fwrite.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_gcd.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_get_int.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_grow.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_init.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_init_copy.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_init_multi.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_init_set.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_init_set_int.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_init_size.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_invmod.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_invmod_slow.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_is_square.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_jacobi.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_karatsuba_mul.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_karatsuba_sqr.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_lcm.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_lshd.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_mod.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_mod_2d.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_mod_d.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_montgomery_calc_normalization.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_montgomery_reduce.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_montgomery_setup.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_mul.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_mul_2.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_mul_2d.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_mul_d.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_mulmod.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_n_root.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_neg.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_or.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_prime_fermat.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_prime_is_divisible.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_prime_is_prime.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_prime_miller_rabin.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_prime_next_prime.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_prime_rabin_miller_trials.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_prime_random_ex.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_radix_size.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_radix_smap.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_rand.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_read_radix.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_read_signed_bin.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_read_unsigned_bin.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_reduce.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_reduce_2k.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_reduce_2k_l.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_reduce_2k_setup.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_reduce_2k_setup_l.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_reduce_is_2k.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_reduce_is_2k_l.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_reduce_setup.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_rshd.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_set.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_set_int.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_shrink.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_signed_bin_size.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_sqr.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_sqrmod.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_sqrt.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_sub.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_sub_d.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_submod.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_to_signed_bin.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_to_signed_bin_n.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_to_unsigned_bin.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_to_unsigned_bin_n.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_toom_mul.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_toom_sqr.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_toradix.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_toradix_n.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_unsigned_bin_size.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_xor.c create mode 100644 dep/StormLib/src/libtommath/bn_mp_zero.c create mode 100644 dep/StormLib/src/libtommath/bn_prime_tab.c create mode 100644 dep/StormLib/src/libtommath/bn_reverse.c create mode 100644 dep/StormLib/src/libtommath/bn_s_mp_add.c create mode 100644 dep/StormLib/src/libtommath/bn_s_mp_exptmod.c create mode 100644 dep/StormLib/src/libtommath/bn_s_mp_mul_digs.c create mode 100644 dep/StormLib/src/libtommath/bn_s_mp_mul_high_digs.c create mode 100644 dep/StormLib/src/libtommath/bn_s_mp_sqr.c create mode 100644 dep/StormLib/src/libtommath/bn_s_mp_sub.c create mode 100644 dep/StormLib/src/libtommath/bncore.c create mode 100644 dep/StormLib/src/libtommath/tommath.h create mode 100644 dep/StormLib/src/libtommath/tommath_class.h create mode 100644 dep/StormLib/src/libtommath/tommath_superclass.h create mode 100644 dep/StormLib/src/lzma/C/LzFind.c create mode 100644 dep/StormLib/src/lzma/C/LzFind.h create mode 100644 dep/StormLib/src/lzma/C/LzFindMt.c create mode 100644 dep/StormLib/src/lzma/C/LzFindMt.h create mode 100644 dep/StormLib/src/lzma/C/LzHash.h create mode 100644 dep/StormLib/src/lzma/C/LzmaDec.c create mode 100644 dep/StormLib/src/lzma/C/LzmaDec.h create mode 100644 dep/StormLib/src/lzma/C/LzmaEnc.c create mode 100644 dep/StormLib/src/lzma/C/LzmaEnc.h create mode 100644 dep/StormLib/src/lzma/C/Threads.c create mode 100644 dep/StormLib/src/lzma/C/Threads.h create mode 100644 dep/StormLib/src/lzma/C/Types.h create mode 100644 dep/StormLib/src/pklib/crc32.c create mode 100644 dep/StormLib/src/pklib/explode.c create mode 100644 dep/StormLib/src/pklib/implode.c create mode 100644 dep/StormLib/src/pklib/pklib.h create mode 100644 dep/StormLib/src/sparse/sparse.cpp create mode 100644 dep/StormLib/src/sparse/sparse.h create mode 100644 dep/StormLib/src/zlib/adler32.c create mode 100644 dep/StormLib/src/zlib/compress2.c create mode 100644 dep/StormLib/src/zlib/crc32.c create mode 100644 dep/StormLib/src/zlib/crc32.h create mode 100644 dep/StormLib/src/zlib/deflate.c create mode 100644 dep/StormLib/src/zlib/deflate.h create mode 100644 dep/StormLib/src/zlib/inffast.c create mode 100644 dep/StormLib/src/zlib/inffast.h create mode 100644 dep/StormLib/src/zlib/inffixed.h create mode 100644 dep/StormLib/src/zlib/inflate.c create mode 100644 dep/StormLib/src/zlib/inflate.h create mode 100644 dep/StormLib/src/zlib/inftrees.c create mode 100644 dep/StormLib/src/zlib/inftrees.h create mode 100644 dep/StormLib/src/zlib/trees.c create mode 100644 dep/StormLib/src/zlib/trees.h create mode 100644 dep/StormLib/src/zlib/zconf.h create mode 100644 dep/StormLib/src/zlib/zlib.h create mode 100644 dep/StormLib/src/zlib/zutil.c create mode 100644 dep/StormLib/src/zlib/zutil.h create mode 100644 dep/StormLib/storm_dll/storm_dll.cpp create mode 100644 dep/StormLib/storm_dll/storm_dll.def create mode 100644 dep/StormLib/storm_dll/storm_dll.h create mode 100644 dep/StormLib/stormlib_dll/DllMain.c create mode 100644 dep/StormLib/stormlib_dll/StormLib.def create mode 100644 dep/StormLib/stormlib_dll/StormLib.exp create mode 100644 dep/StormLib/test/Test.cpp create mode 100644 dep/StormLib/test/x86_ripped_code.asm create mode 100644 dep/StormLib/test/x86_starcraft_lzma.asm delete mode 100644 dep/libmpq/AUTHORS delete mode 100644 dep/libmpq/CMakeLists.txt delete mode 100644 dep/libmpq/COPYING delete mode 100644 dep/libmpq/FAQ delete mode 100644 dep/libmpq/INSTALL delete mode 100644 dep/libmpq/Makefile.am delete mode 100644 dep/libmpq/NEWS delete mode 100644 dep/libmpq/README delete mode 100644 dep/libmpq/THANKS delete mode 100644 dep/libmpq/TODO delete mode 100644 dep/libmpq/autogen.sh delete mode 100644 dep/libmpq/bindings/Makefile.am delete mode 100644 dep/libmpq/bindings/d/Makefile.am delete mode 100644 dep/libmpq/bindings/d/dsss.conf delete mode 100644 dep/libmpq/bindings/d/mpq.d delete mode 100644 dep/libmpq/bindings/python/Makefile.am delete mode 100644 dep/libmpq/bindings/python/mpq-info delete mode 100644 dep/libmpq/bindings/python/mpq.py delete mode 100644 dep/libmpq/config.h delete mode 100644 dep/libmpq/configure.ac delete mode 100644 dep/libmpq/debian/changelog delete mode 100644 dep/libmpq/debian/compat delete mode 100644 dep/libmpq/debian/control delete mode 100644 dep/libmpq/debian/copyright delete mode 100644 dep/libmpq/debian/libmpq-dev.dirs delete mode 100644 dep/libmpq/debian/libmpq-dev.install delete mode 100644 dep/libmpq/debian/libmpq0.dirs delete mode 100644 dep/libmpq/debian/libmpq0.docs delete mode 100644 dep/libmpq/debian/libmpq0.install delete mode 100644 dep/libmpq/debian/python-mpq.install delete mode 100644 dep/libmpq/debian/rules delete mode 100644 dep/libmpq/doc/Makefile.am delete mode 100644 dep/libmpq/doc/man1/Makefile.am delete mode 100644 dep/libmpq/doc/man1/libmpq-config.1 delete mode 100644 dep/libmpq/doc/man3/Makefile.am delete mode 100644 dep/libmpq/doc/man3/libmpq.3 delete mode 100644 dep/libmpq/doc/man3/libmpq__archive_close.3 delete mode 100644 dep/libmpq/doc/man3/libmpq__archive_files.3 delete mode 100644 dep/libmpq/doc/man3/libmpq__archive_offset.3 delete mode 100644 dep/libmpq/doc/man3/libmpq__archive_open.3 delete mode 100644 dep/libmpq/doc/man3/libmpq__archive_packed_size.3 delete mode 100644 dep/libmpq/doc/man3/libmpq__archive_unpacked_size.3 delete mode 100644 dep/libmpq/doc/man3/libmpq__archive_version.3 delete mode 100644 dep/libmpq/doc/man3/libmpq__block_close_offset.3 delete mode 100644 dep/libmpq/doc/man3/libmpq__block_open_offset.3 delete mode 100644 dep/libmpq/doc/man3/libmpq__block_read.3 delete mode 100644 dep/libmpq/doc/man3/libmpq__block_unpacked_size.3 delete mode 100644 dep/libmpq/doc/man3/libmpq__file_blocks.3 delete mode 100644 dep/libmpq/doc/man3/libmpq__file_compressed.3 delete mode 100644 dep/libmpq/doc/man3/libmpq__file_encrypted.3 delete mode 100644 dep/libmpq/doc/man3/libmpq__file_imploded.3 delete mode 100644 dep/libmpq/doc/man3/libmpq__file_number.3 delete mode 100644 dep/libmpq/doc/man3/libmpq__file_offset.3 delete mode 100644 dep/libmpq/doc/man3/libmpq__file_packed_size.3 delete mode 100644 dep/libmpq/doc/man3/libmpq__file_read.3 delete mode 100644 dep/libmpq/doc/man3/libmpq__file_unpacked_size.3 delete mode 100644 dep/libmpq/doc/man3/libmpq__strerror.3 delete mode 100644 dep/libmpq/doc/man3/libmpq__version.3 delete mode 100644 dep/libmpq/libmpq-config.in delete mode 100644 dep/libmpq/libmpq.pc.in delete mode 100644 dep/libmpq/libmpq/Makefile.am delete mode 100644 dep/libmpq/libmpq/common.c delete mode 100644 dep/libmpq/libmpq/common.h delete mode 100644 dep/libmpq/libmpq/crypt_buf.h delete mode 100644 dep/libmpq/libmpq/explode.c delete mode 100644 dep/libmpq/libmpq/explode.h delete mode 100644 dep/libmpq/libmpq/extract.c delete mode 100644 dep/libmpq/libmpq/extract.h delete mode 100644 dep/libmpq/libmpq/huffman.c delete mode 100644 dep/libmpq/libmpq/huffman.h delete mode 100644 dep/libmpq/libmpq/mpq-internal.h delete mode 100644 dep/libmpq/libmpq/mpq.c delete mode 100644 dep/libmpq/libmpq/mpq.h delete mode 100644 dep/libmpq/libmpq/pack_begin.h delete mode 100644 dep/libmpq/libmpq/pack_end.h delete mode 100644 dep/libmpq/libmpq/platform.h delete mode 100644 dep/libmpq/libmpq/wave.c delete mode 100644 dep/libmpq/libmpq/wave.h delete mode 100644 dep/libmpq/tools/Makefile.am delete mode 100644 dep/libmpq/tools/crypt_buf_gen.c delete mode 100644 dep/libmpq/win/config.h delete mode 100644 dep/libmpq/win/dirent.h delete mode 100644 dep/libmpq/win/stdint.h delete mode 100644 src/tools/map_extractor/mpq_libmpq.cpp delete mode 100644 src/tools/map_extractor/mpq_libmpq04.h delete mode 100644 src/tools/vmap3_extractor/loadlib/loadlib.h (limited to 'src') diff --git a/dep/CMakeLists.txt b/dep/CMakeLists.txt index 9c13ad59bc5..ce80d43b0c1 100644 --- a/dep/CMakeLists.txt +++ b/dep/CMakeLists.txt @@ -40,5 +40,5 @@ if(SERVERS) endif() if(TOOLS) - add_subdirectory(libmpq) + add_subdirectory(StormLib) endif() diff --git a/dep/PackageList.txt b/dep/PackageList.txt index 7ab307ecfc5..b599bd0e11b 100644 --- a/dep/PackageList.txt +++ b/dep/PackageList.txt @@ -16,10 +16,6 @@ jemalloc (a general-purpose scalable concurrent malloc-implementation) http://www.canonware.com/jemalloc/ Version: 2.1.0 -libMPQ (a library for reading MPQ files) - https://libmpq.org/ - Version: 1.0.4 - MersenneTwister (a very fast random number generator) http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html Version: 0.4.2 @@ -43,3 +39,7 @@ zlib (A Massively Spiffy Yet Delicately Unobtrusive Compression Library) gSOAP (a portable development toolkit for C and C++ XML Web services and XML data bindings) http://gsoap2.sourceforge.net/ Version: 2.8.0 + +StormLib (a pack of modules, written in C++, which are able to read and also to write files from/to the MPQ archives) + http://www.zezula.net/en/mpq/stormlib.html + Version: 8.04 \ No newline at end of file diff --git a/dep/StormLib/CMakeLists.txt b/dep/StormLib/CMakeLists.txt new file mode 100644 index 00000000000..33f5f7b830d --- /dev/null +++ b/dep/StormLib/CMakeLists.txt @@ -0,0 +1,295 @@ +project(StormLib) +cmake_minimum_required(VERSION 2.6) + +set(SRC_FILES + src/adpcm/adpcm.cpp + src/huffman/huff.cpp + src/jenkins/lookup3.c + src/lzma/C/LzFind.c + src/lzma/C/LzmaDec.c + src/lzma/C/LzmaEnc.c + src/pklib/explode.c + src/pklib/implode.c + src/sparse/sparse.cpp + src/FileStream.cpp + src/SBaseCommon.cpp + src/SBaseFileTable.cpp + src/SCompression.cpp + src/SFileAddFile.cpp + src/SFileAttributes.cpp + src/SFileCompactArchive.cpp + src/SFileCreateArchive.cpp + src/SFileExtractFile.cpp + src/SFileFindFile.cpp + src/SFileListFile.cpp + src/SFileOpenArchive.cpp + src/SFileOpenFileEx.cpp + src/SFilePatchArchives.cpp + src/SFileReadFile.cpp + src/SFileVerify.cpp +) + +set(TOMCRYPT_FILES + src/libtomcrypt/src/hashes/hash_memory.c + src/libtomcrypt/src/hashes/md5.c + src/libtomcrypt/src/hashes/sha1.c + src/libtomcrypt/src/math/ltm_desc.c + src/libtomcrypt/src/math/multi.c + src/libtomcrypt/src/math/rand_prime.c + src/libtomcrypt/src/misc/base64_decode.c + src/libtomcrypt/src/misc/crypt_argchk.c + src/libtomcrypt/src/misc/crypt_find_hash.c + src/libtomcrypt/src/misc/crypt_find_prng.c + src/libtomcrypt/src/misc/crypt_hash_descriptor.c + src/libtomcrypt/src/misc/crypt_hash_is_valid.c + src/libtomcrypt/src/misc/crypt_libc.c + src/libtomcrypt/src/misc/crypt_ltc_mp_descriptor.c + src/libtomcrypt/src/misc/crypt_prng_descriptor.c + src/libtomcrypt/src/misc/crypt_prng_is_valid.c + src/libtomcrypt/src/misc/crypt_register_hash.c + src/libtomcrypt/src/misc/crypt_register_prng.c + src/libtomcrypt/src/misc/zeromem.c + src/libtomcrypt/src/pk/asn1/der_decode_bit_string.c + src/libtomcrypt/src/pk/asn1/der_decode_boolean.c + src/libtomcrypt/src/pk/asn1/der_decode_choice.c + src/libtomcrypt/src/pk/asn1/der_decode_ia5_string.c + src/libtomcrypt/src/pk/asn1/der_decode_integer.c + src/libtomcrypt/src/pk/asn1/der_decode_object_identifier.c + src/libtomcrypt/src/pk/asn1/der_decode_octet_string.c + src/libtomcrypt/src/pk/asn1/der_decode_printable_string.c + src/libtomcrypt/src/pk/asn1/der_decode_sequence_ex.c + src/libtomcrypt/src/pk/asn1/der_decode_sequence_flexi.c + src/libtomcrypt/src/pk/asn1/der_decode_sequence_multi.c + src/libtomcrypt/src/pk/asn1/der_decode_short_integer.c + src/libtomcrypt/src/pk/asn1/der_decode_utctime.c + src/libtomcrypt/src/pk/asn1/der_decode_utf8_string.c + src/libtomcrypt/src/pk/asn1/der_length_bit_string.c + src/libtomcrypt/src/pk/asn1/der_length_boolean.c + src/libtomcrypt/src/pk/asn1/der_length_ia5_string.c + src/libtomcrypt/src/pk/asn1/der_length_integer.c + src/libtomcrypt/src/pk/asn1/der_length_object_identifier.c + src/libtomcrypt/src/pk/asn1/der_length_octet_string.c + src/libtomcrypt/src/pk/asn1/der_length_printable_string.c + src/libtomcrypt/src/pk/asn1/der_length_sequence.c + src/libtomcrypt/src/pk/asn1/der_length_utctime.c + src/libtomcrypt/src/pk/asn1/der_sequence_free.c + src/libtomcrypt/src/pk/asn1/der_length_utf8_string.c + src/libtomcrypt/src/pk/asn1/der_length_short_integer.c + src/libtomcrypt/src/pk/ecc/ltc_ecc_map.c + src/libtomcrypt/src/pk/ecc/ltc_ecc_mul2add.c + src/libtomcrypt/src/pk/ecc/ltc_ecc_mulmod.c + src/libtomcrypt/src/pk/ecc/ltc_ecc_points.c + src/libtomcrypt/src/pk/ecc/ltc_ecc_projective_add_point.c + src/libtomcrypt/src/pk/ecc/ltc_ecc_projective_dbl_point.c + src/libtomcrypt/src/pk/pkcs1/pkcs_1_mgf1.c + src/libtomcrypt/src/pk/pkcs1/pkcs_1_oaep_decode.c + src/libtomcrypt/src/pk/pkcs1/pkcs_1_pss_decode.c + src/libtomcrypt/src/pk/pkcs1/pkcs_1_v1_5_decode.c + src/libtomcrypt/src/pk/rsa/rsa_exptmod.c + src/libtomcrypt/src/pk/rsa/rsa_free.c + src/libtomcrypt/src/pk/rsa/rsa_import.c + src/libtomcrypt/src/pk/rsa/rsa_make_key.c + src/libtomcrypt/src/pk/rsa/rsa_verify_hash.c + src/libtomcrypt/src/pk/rsa/rsa_verify_simple.c +) + +set(TOMMATH_FILES + src/libtommath/bncore.c + src/libtommath/bn_fast_mp_invmod.c + src/libtommath/bn_fast_mp_montgomery_reduce.c + src/libtommath/bn_fast_s_mp_mul_digs.c + src/libtommath/bn_fast_s_mp_mul_high_digs.c + src/libtommath/bn_fast_s_mp_sqr.c + src/libtommath/bn_mp_2expt.c + src/libtommath/bn_mp_abs.c + src/libtommath/bn_mp_add.c + src/libtommath/bn_mp_addmod.c + src/libtommath/bn_mp_add_d.c + src/libtommath/bn_mp_and.c + src/libtommath/bn_mp_clamp.c + src/libtommath/bn_mp_clear.c + src/libtommath/bn_mp_clear_multi.c + src/libtommath/bn_mp_cmp.c + src/libtommath/bn_mp_cmp_d.c + src/libtommath/bn_mp_cmp_mag.c + src/libtommath/bn_mp_cnt_lsb.c + src/libtommath/bn_mp_copy.c + src/libtommath/bn_mp_count_bits.c + src/libtommath/bn_mp_div.c + src/libtommath/bn_mp_div_2.c + src/libtommath/bn_mp_div_2d.c + src/libtommath/bn_mp_div_3.c + src/libtommath/bn_mp_div_d.c + src/libtommath/bn_mp_dr_is_modulus.c + src/libtommath/bn_mp_dr_reduce.c + src/libtommath/bn_mp_dr_setup.c + src/libtommath/bn_mp_exch.c + src/libtommath/bn_mp_exptmod.c + src/libtommath/bn_mp_exptmod_fast.c + src/libtommath/bn_mp_expt_d.c + src/libtommath/bn_mp_exteuclid.c + src/libtommath/bn_mp_fread.c + src/libtommath/bn_mp_fwrite.c + src/libtommath/bn_mp_gcd.c + src/libtommath/bn_mp_get_int.c + src/libtommath/bn_mp_grow.c + src/libtommath/bn_mp_init.c + src/libtommath/bn_mp_init_copy.c + src/libtommath/bn_mp_init_multi.c + src/libtommath/bn_mp_init_set.c + src/libtommath/bn_mp_init_set_int.c + src/libtommath/bn_mp_init_size.c + src/libtommath/bn_mp_invmod.c + src/libtommath/bn_mp_invmod_slow.c + src/libtommath/bn_mp_is_square.c + src/libtommath/bn_mp_jacobi.c + src/libtommath/bn_mp_karatsuba_mul.c + src/libtommath/bn_mp_karatsuba_sqr.c + src/libtommath/bn_mp_lcm.c + src/libtommath/bn_mp_lshd.c + src/libtommath/bn_mp_mod.c + src/libtommath/bn_mp_mod_2d.c + src/libtommath/bn_mp_mod_d.c + src/libtommath/bn_mp_montgomery_calc_normalization.c + src/libtommath/bn_mp_montgomery_reduce.c + src/libtommath/bn_mp_montgomery_setup.c + src/libtommath/bn_mp_mul.c + src/libtommath/bn_mp_mulmod.c + src/libtommath/bn_mp_mul_2.c + src/libtommath/bn_mp_mul_2d.c + src/libtommath/bn_mp_mul_d.c + src/libtommath/bn_mp_neg.c + src/libtommath/bn_mp_n_root.c + src/libtommath/bn_mp_or.c + src/libtommath/bn_mp_prime_fermat.c + src/libtommath/bn_mp_prime_is_divisible.c + src/libtommath/bn_mp_prime_is_prime.c + src/libtommath/bn_mp_prime_miller_rabin.c + src/libtommath/bn_mp_prime_next_prime.c + src/libtommath/bn_mp_prime_rabin_miller_trials.c + src/libtommath/bn_mp_prime_random_ex.c + src/libtommath/bn_mp_radix_size.c + src/libtommath/bn_mp_radix_smap.c + src/libtommath/bn_mp_rand.c + src/libtommath/bn_mp_read_radix.c + src/libtommath/bn_mp_read_signed_bin.c + src/libtommath/bn_mp_read_unsigned_bin.c + src/libtommath/bn_mp_reduce.c + src/libtommath/bn_mp_reduce_2k.c + src/libtommath/bn_mp_reduce_2k_l.c + src/libtommath/bn_mp_reduce_2k_setup.c + src/libtommath/bn_mp_reduce_2k_setup_l.c + src/libtommath/bn_mp_reduce_is_2k.c + src/libtommath/bn_mp_reduce_is_2k_l.c + src/libtommath/bn_mp_reduce_setup.c + src/libtommath/bn_mp_rshd.c + src/libtommath/bn_mp_set.c + src/libtommath/bn_mp_set_int.c + src/libtommath/bn_mp_shrink.c + src/libtommath/bn_mp_signed_bin_size.c + src/libtommath/bn_mp_sqr.c + src/libtommath/bn_mp_sqrmod.c + src/libtommath/bn_mp_sqrt.c + src/libtommath/bn_mp_sub.c + src/libtommath/bn_mp_submod.c + src/libtommath/bn_mp_sub_d.c + src/libtommath/bn_mp_toom_mul.c + src/libtommath/bn_mp_toom_sqr.c + src/libtommath/bn_mp_toradix.c + src/libtommath/bn_mp_toradix_n.c + src/libtommath/bn_mp_to_signed_bin.c + src/libtommath/bn_mp_to_signed_bin_n.c + src/libtommath/bn_mp_to_unsigned_bin.c + src/libtommath/bn_mp_to_unsigned_bin_n.c + src/libtommath/bn_mp_unsigned_bin_size.c + src/libtommath/bn_mp_xor.c + src/libtommath/bn_mp_zero.c + src/libtommath/bn_prime_tab.c + src/libtommath/bn_reverse.c + src/libtommath/bn_s_mp_add.c + src/libtommath/bn_s_mp_exptmod.c + src/libtommath/bn_s_mp_mul_digs.c + src/libtommath/bn_s_mp_mul_high_digs.c + src/libtommath/bn_s_mp_sqr.c + src/libtommath/bn_s_mp_sub.c +) + +set(ZLIB_BZIP2_FILES + src/bzip2/blocksort.c + src/bzip2/bzlib.c + src/bzip2/compress.c + src/bzip2/crctable.c + src/bzip2/decompress.c + src/bzip2/huffman.c + src/bzip2/randtable.c + src/zlib/adler32.c + src/zlib/compress2.c + src/zlib/crc32.c + src/zlib/deflate.c + src/zlib/inffast.c + src/zlib/inflate.c + src/zlib/inftrees.c + src/zlib/trees.c + src/zlib/zutil.c +) + +set(TEST_SRC_FILES + test/Test.cpp +) + +add_definitions(-D_7ZIP_ST -DBZ_STRICT_ANSI) + +if(WIN32) + if(MSVC) + message(STATUS "Using MSVC") + add_definitions(-D_7ZIP_ST -DWIN32) + else() + message(STATUS "Using mingw") + endif() + set(SRC_ADDITIONAL_FILES ${ZLIB_BZIP2_FILES} ${TOMCRYPT_FILES} ${TOMMATH_FILES}) +endif() + +if(APPLE) + message(STATUS "Using Mac OS X port") + set(LINK_LIBS z bz2) + set(SRC_ADDITIONAL_FILES ${TOMCRYPT_FILES} ${TOMMATH_FILES}) +endif() + +if (${CMAKE_SYSTEM_NAME} STREQUAL Linux) + message(STATUS "Using Linux port") + option(WITH_LIBTOMCRYPT "Use system LibTomCrypt library" OFF) + if(WITH_LIBTOMCRYPT) + set(LINK_LIBS z bz2 tomcrypt) + else() + set(LINK_LIBS z bz2) + set(SRC_ADDITIONAL_FILES ${TOMCRYPT_FILES} ${TOMMATH_FILES}) + endif() +endif() + +add_library(storm STATIC ${SRC_FILES} ${SRC_ADDITIONAL_FILES}) +target_link_libraries(storm ${LINK_LIBS}) + +option(WITH_TEST "Compile Test application" OFF) +if(WITH_TEST) + add_executable(storm_test ${TEST_SRC_FILES}) + target_link_libraries(storm_test storm) +endif() + +if(APPLE) + set_target_properties(storm PROPERTIES FRAMEWORK true) + set_target_properties(storm PROPERTIES PUBLIC_HEADER "src/StormLib.h src/StormPort.h") + set_target_properties(storm PROPERTIES LINK_FLAGS "-framework Carbon") +endif() + +if(UNIX) + set_target_properties(storm PROPERTIES SOVERSION 0) +endif() + +# On Win32, build StormLib.dll since we don't want to clash with Storm.dll +if(WIN32) + set_target_properties(storm PROPERTIES OUTPUT_NAME StormLib) +endif() + +#install(TARGETS storm ARCHIVE DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib FRAMEWORK DESTINATION /Library/Frameworks) +#install(FILES src/StormLib.h src/StormPort.h DESTINATION include) + diff --git a/dep/StormLib/doc/History.txt b/dep/StormLib/doc/History.txt new file mode 100644 index 00000000000..5e32894d7b1 --- /dev/null +++ b/dep/StormLib/doc/History.txt @@ -0,0 +1,62 @@ + + StormLib history + ================ + + Version 8.02 + + - Support for UNICODE encoding for on-disk files + - Optimized file deleting + + Version 8.01 + + - SFileFindFirstFile and SFileFindNextFile no longer find files that have + patch file in the oldest MPQ in the patch chain + - Write support for MPQs version 4 + + Version 8.00 + + - Updated support for protected maps from Warcraft III + + Version 7.11 + + - Support for MPQs v 3.0 (WOW-Cataclysm BETA) + - StormLib now deals properly with files that have MPQ_SECTOR_CHECKSUM missing, + but have sector checksum entry present in the sector offset table + + Version 7.10 + + - Support for partial MPQs ("interface.MPQ.part") + - The only operation that is externally allowed to do with internal files + ("(listfile)", "(attributes)" and "(signature)") is reading. Attempt to modify any of the file + fails and GetLastError returns ERROR_INTERNAL_FILE + - Fixed memory leak that has occured when writing more than one sector to the file at once + + Version 7.01 + + - Support for adding files from memory + - Fixed improper validation of handles to MPQ file and MPQ archive + - Fixed bug where StormLib didn't save CRC32 of the file when added to archive + + Version 7.00 + + - Properly deals with MPQs protected by w3xMaster + - Major rewrite + - Fixed support for (attributes) + - Added file verification + - Added MPQ signature verification + + Version 6.22 + + - Properly deals with MPQs protected by w3xMaster + + Version 6.21 + + - SFileRenameFile now properly re-crypts the file if necessary. + - SFileFindFirstFile correctly deals with deleted files + + Version 6.20 + + - Fixed lots of bugs when processing files with same names but different locales + - Fixed bugs when repeately extracts the same file with MPQ_FILE_SINGLE_UNIT flag + - Added SFileFlushArchive + - Fixed issue opening AVI files renamed to MPQ using SFileCreateArchiveEx diff --git a/dep/StormLib/doc/Sector Offset MD5.txt b/dep/StormLib/doc/Sector Offset MD5.txt new file mode 100644 index 00000000000..a22506ac704 --- /dev/null +++ b/dep/StormLib/doc/Sector Offset MD5.txt @@ -0,0 +1,25 @@ + + After sector offset table + ========================= + +FileSize CmpSize DWORDs +00007588 000075A4 0x01 +0000A9EA 000095EC 0x01 +0000E51D 0000E20D 0x02 +00015C00 00015C40 0x02 +0001C578 000186C4 0x02 +0002A9D4 0002A9EA 0x04 +00037BAC 00037A42 0x06 +0003C3C1 00034084 0x06 +0003D224 0003B30F 0x06 +00045105 0004195A 0x07 +00045D9C 0003D87D 0x07 +0004AAB8 0004860A 0x08 +0004D18E 00048E0C 0x07 +00056B4C 00056BDD 0x09 +0005DC08 00059426 0x09 +00061EC0 00057711 0x0A +0006CEC4 00062561 0x0B +000778EE 00066736 0x0C +000AD0CB 0007F32E 0x11 +00327EAC 00303395 0x53 diff --git a/dep/StormLib/doc/The MoPaQ File Format 0.9.txt b/dep/StormLib/doc/The MoPaQ File Format 0.9.txt new file mode 100644 index 00000000000..ce8d8f70166 --- /dev/null +++ b/dep/StormLib/doc/The MoPaQ File Format 0.9.txt @@ -0,0 +1,318 @@ +THE MOPAQ ARCHIVE FORMAT +v0.9 (Thursday, June 30, 2005) +by Justin Olbrantz(Quantam) + +Distribution and reproduction of this specification are allowed without limitation, as long as it is not altered. Quoting +in other works is freely allowed, as long as the source and author of the quote is stated. + +TABLE OF CONTENTS +1. Introduction to the MoPaQ Format +2. The MoPaQ Format + 2.1 General Archive Layout + 2.2 Archive Header + 2.3 Block Table + 2.4 Hash Table + 2.5 File Data + 2.6 Listfile + 2.7 Extended Attributes + 2.8 Weak (Old) Digital Signature + 2.9 Strong (New) Digital Signature +3. Algorithm Source Code + 3.1 Encryption/Decryption + 3.2 Hashing + 3.3 Conversion of FILETIME and time_t + +1. INTRODUCTION TO THE MOPAQ FORMAT +The MoPaQ (or MPQ) format is an archive file format designed by Mike O'Brien (hence the name Mike O'brien PaCK) at Blizzard +Entertainment. The format has been used in all Blizzard games since (and including) Diablo. It is heavily optimized to be +a read-only game archive format, and excels at this role. + +The Blizzard MoPaQ-reading functions are contained in the Storm module, which my be either statically or dynamically linked. +The Blizzard MoPaQ-writing functions are contained in the MPQAPI module, which is always statically linked. + +2. THE MOPAQ FORMAT +All numbers in the MoPaQ format are in little endian. Data types are listed either as int (integer, the number of bits specified), +byte (8 bits), and char (bytes which contain ASCII characters). All sizes and offsets are in bytes, unless specified otherwise. +Structure members are listed in the following general form: +offset from the beginning of the structure: data type(array size) member name : member description + +2.1 GENERAL ARCHIVE LAYOUT +- Archive Header +- File Data +- File Data - Special Files +- Hash Table +- Block Table +- Strong Digital signature + +This is the usual archive format, and is not absolutely essential. Some archives have been observed placing the hash table +and file table after the archive header, and before the file data. + +2.2 ARCHIVE HEADER +00h: char(4) Magic : Indicates that the file is a MoPaQ archive. Must be ASCII "MPQ" 1Ah. +04h: int32 HeaderSize : Size of the archive header. Should be 32. +08h: int32 ArchiveSize : Size of the whole archive, including the header. Does not include the strong digital signature, if present. +This size is used, among other things, for determining the region to hash in computing the digital signature. +0Ch: int16 Unknown : Unknown +0Eh: int8 SectorSizeShift : Power of two exponent specifying the number of 512-byte disk sectors in each logical sector +in the archive. The size of each logical sector the archive is 512 * 2^SectorSizeShift. Bugs in the Storm library dictate +that this should always be 3 (4096 byte sectors). +10h: int32 HashTableOffset : Offset to the beginning of the hash table, relative to the beginning of the archive. +14h: int32 BlockTableOffset : Offset to the beginning of the block table, relative to the beginning of the archive. +18h: int32 HashTableEntries : Number of entries in the hash table. Must be a power of two, and must be less than 2^16. +1Ch: int32 BlockTableEntries : Number of entries in the block table. + +The archive header is the first structure in the archive, at archive offset 0, but the archive does not need to be at offset +0 of the containing file. The offset of the archive in the file is referred to here as ArchiveOffset. If the archive is not +at the beginning of the file, it must begin at a disk sector boundary (512 bytes). Early versions of Storm require that the +archive be at the end of the containing file (ArchiveOffset + ArchiveSize = file size), but this is not required in newer +versions (due to the strong digital signature not being considered a part of the archive). + +2.3 BLOCK TABLE +The block table contains entries for each region in the archive. Regions may be either files or empty space, which may be +overwritten by new files (typically this space is from deleted file data). The block table is encrypted, using the hash +of "(block table)" as the key. Each entry is structured as follows: + +00h: int32 BlockOffset : Offset of the beginning of the block, relative to the beginning of the archive. Meaningless if the block size is 0. +04h: int32 BlockSize : Size of the block in the archive. +08h: int32 FileSize : Size of the file data stored in the block. Only valid if the block is a file, otherwise meaningless, and should be 0. If the file is compressed, this is the size of the uncompressed file data. +0Ch: int32 Flags : Bit mask of the flags for the block. The following values are conclusively identified: + 80000000h: Block is a file, and follows the file data format; otherwise, block is free space, and may be overwritten. If the block is not a file, all other flags should be cleared. + 01000000h: File is stored as a single unit, rather than split into sectors. + 00020000h: The file's encryption key is adjusted by the block offset and file size (explained in detail in the File Data section). File must be encrypted. + 00010000h: File is encrypted. + 00000200h: File is compressed. Mutually exclusive to file imploded. + 00000100h: File is imploded. Mutually exclusive to file compressed. + +2.4 HASH TABLE +Instead of storing file names, for quick access MoPaQs use a fixed, power of two-size hash table of files in the archive. A file is uniquely identified by its file path, its language, and its platform. The home entry for a file in the hash table is computed as a hash of the file path. In the event of a collision (the home entry is occupied by another file), progressive overflow is used, and the file is placed in the next available hash table entry. Searches for a desired file in the hash table proceed from the home entry for the file until either the file is found, the entire hash table is searched, or an empty hash table entry (FileBlockIndex of FFFFFFFFh) is encountered. The hash table is encrypted using the hash of "(hash table)" as the key. Each entry is structured as follows: + +00h: int32 FilePathHashA : The hash of the file path, using method A. +04h: int32 FilePathHashB : The hash of the file path, using method B. +08h: int16 Language : The language of the file. This is a Windows LANGID data type, and uses the same values. 0 indicates the default language (American English), or that the file is language-neutral. +0Ah: int8 Platform : The platform the file is used for. 0 indicates the default platform. No other values have been observed. +0Ch: int32 FileBlockIndex : If the hash table entry is valid, this is the index into the block table of the file. Otherwise, one of the following two values: + FFFFFFFFh: Hash table entry is empty, and has always been empty. Terminates searches for a given file. + FFFFFFFEh: Hash table entry is empty, but was valid at some point (in other words, the file was deleted). Does not terminate searches for a given file. + +2.5 FILE DATA +00h: int32(SectorsInFile + 1) SectorOffsetTable : Offsets to the start of each sector's data, relative to the beginning of the file data. Not present if this information is calculatable (see details below). +immediately following SectorOffsetTable: SectorData : Data of each sector in the file, packed end to end (see details below). + +Normally, file data is split up into sectors, for simple streaming. All sectors, save for the last, will contain as many bytes of file data as specified in the archive header's SectorSizeShift; the last sector may be smaller than this, depending on the size of the file data. This sector size is the size of the raw file data; if the file is compressed, the compressed sector will be smaller or the same size as the uncompressed sector size. Individual sectors in a compressed file may be stored uncompressed; this occurs if and only if the sector could not be compressed by the algorithm used (if the compressed sector size was greater than or equal to the size of the raw data), and is indicated by the sector's compressed size in SectorOffsetTable being equal to the uncompressed size of the sector (which may be calculated from the FileSize). + +If the sector is compressed (but not imploded), a bit mask byte of the compression algorithm(s) used to compress the sector is appended to the beginning of the compressed sector data. This additional byte counts towards the total size of the sector; if the size of the sector (including this byte) exceeds or matches the uncompressed size of the sector data, the sector will be stored uncompressed, and this byte omitted. Multiple compression algorithms may be used on the same sector; in this case, successive compression occurs in the order the algorithms are listed below, and decompression occurs in the opposite order. For implimentations of all of these algorithms, see StormLib. + 40h: IMA ADPCM mono + 80h: IMA ADPCM stereo + 01h: Huffman encoded + 02h: Deflated (see ZLib) + 08h: Imploded (see PKWare Data Compression Library) + 10h: BZip2 compressed (see BZip2) + +If the file is stored as a single unit (indicated in the file's Flags), there is effectively only a single sector, which +contains the entire file. + +If the file is encrypted, each sector (after compression and appendage of the compression type byte, if applicable) +is encrypted with the file's key. The base key for a file is determined by a hash of the file name stripped of the +directory (i.e. the key for a file named "directory\file" would be computed as the hash of "file"). If this key is +adjusted, as indicated in the file's Flags, the final key is calculated as ((base key + BlockOffset - ArchiveOffset) +XOR FileSize) (StormLib - an open-source implementation of the MoPaQ reading and writing functions, +by Ladislav Zezula - incorrectly uses an AND in place of the XOR). Each sector is encrypted using the key + the +0-based index of the sector in the file. The SectorOffsetTable, if present, is encrypted using the key - 1. + +The SectorOffsetTable is omitted when the sizes and offsets of all sectors in the file are calculatable from the FileSize. +This can happen in several circumstances. If the file is not compressed/imploded, then the size and offset of all sectors +is known, based on the archive's SectorSizeShift. If the file is stored as a single unit compressed/imploded, then the +SectorOffsetTable is omitted, as the single file "sector" corresponds to BlockSize and FileSize, as mentioned previously. +Note that the SectorOffsetTable will always be present if the file is compressed/imploded and the file is not stored as +a single unit, even if there is only a single sector in the file (the size of the file is less than or equal to the +archive's sector size). + +2.6 LISTFILE +The listfile is a very simple extension to the MoPaQ format that contains the file paths of (most) files in the archive. +The languages and platforms of the files are not stored in the listfile. The listfile is contained in the file "(listfile)", +and is simply a non-Unix-style text file with one file path on each line, lines terminated with the bytes 0Dh 0Ah. The file +"(listfile)" may not be listed in the listfile. + +2.7 EXTENDED ATTRIBUTES +The extended attributes are optional file attributes for files in the block table. These attributes were added at times after +the MoPaQ format was already finalized, and it is not necessary for every archive to have all (or any) of the extended attributes. +If an archive contains a given attribute, there will be an instance of that attribute for every block in the block table, although +the attribute will be meaningless if the block is not a file. The order of the attributes for blocks correspond to the order of the +blocks in the block table, and are of the same number. The attributes are stored in parallel arrays in the "(attributes)" file, +in the archive. The attributes corresponding to this file need not be valid (and logically cannot be). Unlike all the other +structures in the MoPaQ format, entries in the extended attributes are NOT guaranteed to be aligned. Also note that in some +archives, malicious zeroing of the attributes has been observed, perhaps with the intent of breaking archive viewers. This +file is structured as follows: + +00h: int32 Version : Specifies the extended attributes format version. For now, must be 100. +04h: int32 AttributesPresent : Bit mask of the extended attributes present in the archive: + 00000001h: File CRC32s. + 00000002h: File timestamps. + 00000004h: File MD5s. +08h: int32(BlockTableEntries) CRC32s : CRC32s of the (uncompressed) file data for each block in the archive. Omitted if the +archive does not have CRC32s. immediately after CRC32s: FILETIME(BlockTableEntries) Timestamps : Timestamps for each block +in the archive. The format is that of the Windows FILETIME structure. Omitted if the archive does not have timestamps. +immediately after Timestamps: MD5(BlockTableEntries) MD5s : MD5s of the (uncompressed) file data for each block in the archive. +Omitted if the archive does not have MD5s. + +2.8 WEAK DIGITAL SIGNATURE +The weak digital signature is a digital signature using Microsoft CryptoAPI. It is an implimentation of the RSASSA-PKCS1-v1_5 +digital signature protocol, using the MD5 hashing algorithm and a 512-bit (weak) RSA key (for more information about this +protocol, see the RSA Labs PKCS1 specification). The public key and exponent are stored in a resource in Storm. The signature +is stored uncompressed, unencrypted in the file "(signature)" in the archive. The archive is hashed from the beginning of the +archive (ArchiveOffset in the containing file) to the end of the archive (the length indicated by ArchiveSize); the signature +file is added to the archive before signing, and the space occupied by the file is considered to be all binary 0s during +signing/verification. This file is structured as follows: + +00h: int32 Unknown : Must be 0. +04h: int32 Unknown : must be 0. +08h: int512 Signature : The digital signature. Like all other numbers in the MoPaQ format, this is stored in little-endian order. + +2.9 STRONG DIGITAL SIGNATURE +The strong digital signature uses a simple proprietary implementation of RSA signing, using the SHA-1 hashing algorithm and +a 2048-bit (strong) RSA key. The default public key and exponent are stored in Storm, but other keys may be used as well. +The strong digital signature is stored immediately after the archive, in the containing file; the entire archive (ArchiveSize +bytes, starting at ArchiveOffset in the containing file) is hashed as a single block. The signature has the following format: + +00h: char(4) Magic : Indicates the presence of a digital signature. Must be "NGIS" ("SIGN" backwards). +04h: int2048 Signature : The digital signature, stored in little-endian format. + +When the Signature field is decrypted with the public key and exponent, and the result stored in little-endian order, it is structured as follows: + +00h: byte Padding : Must be 0Bh. +01h: byte(235) Padding : Must be BBh. +ECh: byte(20) SHA-1 : SHA-1 hash of the archive, in standard SHA-1 format. + +3. ALGORITHM SOURCE CODE +3.1 ENCRYPTION/DECRYPTION +I believe this was derived at some point from code in StormLib. Assumes the long type to be 32 bits, and the machine to be little endian order. + +unsigned long dwCryptTable[0x500]; + +void InitializeCryptTable() +{ + unsigned long seed = 0x00100001; + unsigned long index1 = 0; + unsigned long index2 = 0; + int i; + + for (index1 = 0; index1 < 0x100; index1++) + { + for (index2 = index1, i = 0; i < 5; i++, index2 += 0x100) + { + unsigned long temp1, temp2; + + seed = (seed * 125 + 3) % 0x2AAAAB; + temp1 = (seed & 0xFFFF) << 0x10; + + seed = (seed * 125 + 3) % 0x2AAAAB; + temp2 = (seed & 0xFFFF); + + dwCryptTable[index2] = (temp1 | temp2); + } + } +} + +void EncryptData(void *lpbyBuffer, unsigned long dwLength, unsigned long dwKey) +{ + unsigned long *lpdwBuffer = (unsigned long *)lpbyBuffer; + unsigned long seed = 0xEEEEEEEE; + unsigned long ch; + + assert(lpbyBuffer); + + dwLength /= sizeof(unsigned long); + + while(dwLength-- > 0) + { + seed += dwCryptTable[0x400 + (dwKey & 0xFF)]; + ch = *lpdwBuffer ^ (dwKey + seed); + + dwKey = ((~dwKey << 0x15) + 0x11111111) | (dwKey >> 0x0B); + seed = *lpdwBuffer + seed + (seed << 5) + 3; + + *lpdwBuffer++ = ch; + } +} + +void DecryptData(void *lpbyBuffer, unsigned long dwLength, unsigned long dwKey) +{ + unsigned long *lpdwBuffer = (unsigned long *)lpbyBuffer; + unsigned long seed = 0xEEEEEEEE; + unsigned long ch; + + assert(lpbyBuffer); + + dwLength /= sizeof(unsigned long); + + while(dwLength-- > 0) + { + seed += dwCryptTable[0x400 + (dwKey & 0xFF)]; + ch = *lpdwBuffer ^ (dwKey + seed); + + dwKey = ((~dwKey << 0x15) + 0x11111111) | (dwKey >> 0x0B); + seed = ch + seed + (seed << 5) + 3; + + *lpdwBuffer++ = ch; + } +} + +3.2 HASHING +Based on code from StormLib. + +// Different types of hashes to make with HashString +#define MPQ_HASH_TABLE_OFFSET 0 +#define MPQ_HASH_NAME_A 1 +#define MPQ_HASH_NAME_B 2 +#define MPQ_HASH_FILE_KEY 3 + +unsigned long HashString(const char *lpszString, unsigned long dwHashType) +{ + unsigned long seed1 = 0x7FED7FED; + unsigned long seed2 = 0xEEEEEEEE; + int ch; + + while (*lpszString != 0) + { + ch = toupper(*lpszString++); + + seed1 = dwCryptTable[(dwHashType * 0xFF) + ch] ^ (seed1 + seed2); + seed2 = ch + seed1 + seed2 + (seed2 << 5) + 3; + } + return seed1; +} + +3.3 CONVERSION OF FILETIME AND time_t + +#define EPOCH_OFFSET 116444736000000000ULL // Number of 100 ns units between 01/01/1601 and 01/01/1970 + +bool GetTimeFromFileTime(FILETIME &fileTime, time_t &time) +{ + // The FILETIME represents a 64-bit integer: the number of 100 ns units since January 1, 1601 + unsigned long long nTime = ((unsigned long long)fileTime.dwHighDateTime << 32) + fileTime.dwLowDateTime; + + if (nTime < EPOCH_OFFSET) + return false; + + nTime -= EPOCH_OFFSET; // Convert the time base from 01/01/1601 to 01/01/1970 + nTime /= 10000000ULL; // Convert 100 ns to sec + + time = (time_t)nTime; + + // Test for overflow (FILETIME is 64 bits, time_t is 32 bits) + if ((nTime - (unsigned long long)time) > 0) + return false; + + return true; +} + +void GetFileTimeFromTime(time_t &time, FILETIME &fileTime) +{ + unsigned long long nTime = (unsigned long long)time; + + nTime *= 10000000ULL; + nTime += EPOCH_OFFSET; + + fileTime.dwLowDateTime = (DWORD)nTime; + fileTime.dwHighDateTime = (DWORD)(nTime >> 32); +} diff --git a/dep/StormLib/doc/The MoPaQ File Format 1.0.txt b/dep/StormLib/doc/The MoPaQ File Format 1.0.txt new file mode 100644 index 00000000000..2f139453e0e --- /dev/null +++ b/dep/StormLib/doc/The MoPaQ File Format 1.0.txt @@ -0,0 +1,433 @@ +THE MOPAQ ARCHIVE FORMAT +v1.0 (Friday, September 1, 2006) +by Justin Olbrantz(Quantam) + +Distribution and reproduction of this specification are allowed without limitation, as long as it is not altered. Quotation in other works is freely allowed, as long as the source and author of the quote are stated. + +TABLE OF CONTENTS +1. Introduction to the MoPaQ Format +2. The MoPaQ Format + 2.1 General Archive Layout + 2.2 Archive Header + 2.3 Block Table + 2.4 Extended Block Table + 2.5 Hash Table + 2.6 File Data + 2.7 Listfile + 2.8 Extended Attributes + 2.9 Weak (Old) Digital Signature + 2.10 Strong (New) Digital Signature +3. Algorithm Source Code + 3.1 Encryption/Decryption + 3.2 Hashing and File Key Computation + 3.3 Finding Files + 3.4 Deleting Files + 3.5 Conversion of FILETIME and time_t + 3.6 Forming a 64-bit Large Archive Offset from 32-bit and 16-bit Components +4. Revision History + +1. INTRODUCTION TO THE MOPAQ FORMAT +The MoPaQ (or MPQ) format is an archive file format designed by Mike O'Brien (hence the name Mike O'brien PaCK) at Blizzard Entertainment. The format has been used in all Blizzard games since (and including) Diablo. It is heavily optimized to be a read-only game archive format, and excels at this role. + +The Blizzard MoPaQ-reading functions are contained in the Storm module, which my be either statically or dynamically linked. The Blizzard MoPaQ-writing functions are contained in the MPQAPI module, which is always statically linked. + +StormLib - mentioned several times in this specification - is an open-source MoPaQ reading and writing library written by Ladislav Zezula (no affiliation with Blizzard Entertainment). While it's a bit dated, and does not support all of the newer MoPaQ features, it contains source code to the more exotic compression methods used by MoPaQ, such as the PKWare implode algorithm, MoPaQ's huffman compression algorithm, and the IMA ADPCM compression used by MoPaQ. + +2. THE MOPAQ FORMAT +All numbers in the MoPaQ format are in little endian byte order; signed numbers use the two's complement system. Data types are listed either as int (integer, the number of bits specified), byte (8 bits), or char (bytes which contain ASCII characters). All sizes and offsets are in bytes, unless specified otherwise. Structure members are listed in the following general form: +offset from the beginning of the structure: data type(array size) member name : member description + +2.1 GENERAL ARCHIVE LAYOUT +- Archive Header +- File Data +- File Data - Special Files +- Hash Table +- Block Table +- Extended Block Table +- Strong Digital signature + +This is the usual archive format, but it is not mandatory. Some archives have been observed placing the hash table and file table after the archive header, and before the file data. + +2.2 ARCHIVE HEADER +00h: char(4) Magic : Indicates that the file is a MoPaQ archive. Must be ASCII "MPQ" 1Ah. +04h: int32 HeaderSize : Size of the archive header. +08h: int32 ArchiveSize : Size of the whole archive, including the header. Does not include the strong digital signature, if present. This size is used, among other things, for determining the region to hash in computing the digital signature. This field is deprecated in the Burning Crusade MoPaQ format, and the size of the archive is calculated as the size from the beginning of the archive to the end of the hash table, block table, or extended block table (whichever is largest). +0Ch: int16 FormatVersion : MoPaQ format version. MPQAPI will not open archives where this is negative. Known versions: + 0000h: Original format. HeaderSize should be 20h, and large archives are not supported. + 0001h: Burning Crusade format. Header size should be 2Ch, and large archives are supported. +0Eh: int8 SectorSizeShift : Power of two exponent specifying the number of 512-byte disk sectors in each logical sector in the archive. The size of each logical sector in the archive is 512 * 2^SectorSizeShift. Bugs in the Storm library dictate that this should always be 3 (4096 byte sectors). +10h: int32 HashTableOffset : Offset to the beginning of the hash table, relative to the beginning of the archive. +14h: int32 BlockTableOffset : Offset to the beginning of the block table, relative to the beginning of the archive. +18h: int32 HashTableEntries : Number of entries in the hash table. Must be a power of two, and must be less than 2^16 for the original MoPaQ format, or less than 2^20 for the Burning Crusade format. +1Ch: int32 BlockTableEntries : Number of entries in the block table. +Fields only present in the Burning Crusade format and later: +20h: int64 ExtendedBlockTableOffset : Offset to the beginning of the extended block table, relative to the beginning of the archive. +28h: int16 HashTableOffsetHigh : High 16 bits of the hash table offset for large archives. +2Ah: int16 BlockTableOffsetHigh : High 16 bits of the block table offset for large archives. + +The archive header is the first structure in the archive, at archive offset 0; however, the archive does not need to be at offset 0 of the containing file. The offset of the archive in the file is referred to here as ArchiveOffset. If the archive is not at the beginning of the file, it must begin at a disk sector boundary (512 bytes). Early versions of Storm require that the archive be at the end of the containing file (ArchiveOffset + ArchiveSize = file size), but this is not required in newer versions (due to the strong digital signature not being considered a part of the archive). + +2.3 BLOCK TABLE +The block table contains entries for each region in the archive. Regions may be either files, empty space, which may be overwritten by new files (typically this space is from deleted file data), or unused block table entries. Empty space entries should have BlockOffset and BlockSize nonzero, and FileSize and Flags zero; unused block table entries should have BlockSize, FileSize, and Flags zero. The block table is encrypted, using the hash of "(block table)" as the key. Each entry is structured as follows: + +00h: int32 BlockOffset : Offset of the beginning of the block, relative to the beginning of the archive. +04h: int32 BlockSize : Size of the block in the archive. +08h: int32 FileSize : Size of the file data stored in the block. Only valid if the block is a file; otherwise meaningless, and should be 0. If the file is compressed, this is the size of the uncompressed file data. +0Ch: int32 Flags : Bit mask of the flags for the block. The following values are conclusively identified: + 80000000h: Block is a file, and follows the file data format; otherwise, block is free space or unused. If the block is not a file, all other flags should be cleared, and FileSize should be 0. + 01000000h: File is stored as a single unit, rather than split into sectors. + 00020000h: The file's encryption key is adjusted by the block offset and file size (explained in detail in the File Data section). File must be encrypted. + 00010000h: File is encrypted. + 00000200h: File is compressed. File cannot be imploded. + 00000100h: File is imploded. File cannot be compressed. + +2.4 EXTENDED BLOCK TABLE +The extended block table was added to support archives larger than 4 gigabytes (2^32 bytes). The table contains the upper bits of the archive offsets for each block in the block table. It is simply an array of int16s, which become bits 32-47 of the archive offsets for each block, with bits 48-63 being zero. Individual blocks in the archive are still limited to 4 gigabytes in size. This table is only present in Burning Crusade format archives that exceed 4 gigabytes size. + +As of the Burning Crusade Friends and Family beta, this table is not encrypted. + +2.5 HASH TABLE +Instead of storing file names, for quick access MoPaQs use a fixed, power of two-size hash table of files in the archive. A file is uniquely identified by its file path, its language, and its platform. The home entry for a file in the hash table is computed as a hash of the file path. In the event of a collision (the home entry is occupied by another file), progressive overflow is used, and the file is placed in the next available hash table entry. Searches for a desired file in the hash table proceed from the home entry for the file until either the file is found, the entire hash table is searched, or an empty hash table entry (FileBlockIndex of FFFFFFFFh) is encountered. The hash table is encrypted using the hash of "(hash table)" as the key. Each entry is structured as follows: + +00h: int32 FilePathHashA : The hash of the file path, using method A. +04h: int32 FilePathHashB : The hash of the file path, using method B. +08h: int16 Language : The language of the file. This is a Windows LANGID data type, and uses the same values. 0 indicates the default language (American English), or that the file is language-neutral. +0Ah: int8 Platform : The platform the file is used for. 0 indicates the default platform. No other values have been observed. +0Ch: int32 FileBlockIndex : If the hash table entry is valid, this is the index into the block table of the file. Otherwise, one of the following two values: + FFFFFFFFh: Hash table entry is empty, and has always been empty. Terminates searches for a given file. + FFFFFFFEh: Hash table entry is empty, but was valid at some point (in other words, the file was deleted). Does not terminate searches for a given file. + +2.6 FILE DATA +The data for each file is composed of the following structure: +00h: int32(SectorsInFile + 1) SectorOffsetTable : Offsets to the start of each sector, relative to the beginning of the file data. The last entry contains the file size, making it possible to easily calculate the size of any given sector. This table is not present if this information can be calculated (see details below). +immediately following SectorOffsetTable: SECTOR Sectors(SectorsInFile) : Data of each sector in the file, packed end to end (see details below). + +Normally, file data is split up into sectors, for simple streaming. All sectors, save for the last, will contain as many bytes of file data as specified in the archive header's SectorSizeShift; the last sector may contain less than this, depending on the size of the entire file's data. If the file is compressed or imploded, the sector will be smaller or the same size as the file data it contains. Individual sectors in a compressed or imploded file may be stored uncompressed; this occurs if and only if the file data the sector contains could not be compressed by the algorithm(s) used (if the compressed sector size was greater than or equal to the size of the file data), and is indicated by the sector's size in SectorOffsetTable being equal to the size of the file data in the sector (which may be calculated from the FileSize). + +The format of each sector depends on the kind of sector it is. Uncompressed sectors are simply the the raw file data contained in the sector. Imploded sectors are the raw compressed data following compression with the implode algorithm (these sectors can only be in imploded files). Compressed sectors (only found in compressed - not imploded - files) are compressed with one or more compression algorithms, and have the following structure: +00h: byte CompressionMask : Mask of the compression types applied to this sector. If multiple compression types are used, they are applied in the order listed below, and decompression is performed in the opposite order. This byte counts towards the total sector size, meaning that the sector will be stored uncompressed if the data cannot be compressed by at least two bytes; as well, this byte is encrypted with the sector data, if applicable. The following compression types are defined (for implementations of these algorithms, see StormLib): + 40h: IMA ADPCM mono + 80h: IMA ADPCM stereo + 01h: Huffman encoded + 02h: Deflated (see ZLib) + 08h: Imploded (see PKWare Data Compression Library) + 10h: BZip2 compressed (see BZip2) +01h: byte(SectorSize - 1) SectorData : The compressed data for the sector. + +If the file is stored as a single unit (indicated in the file's Flags), there is effectively only a single sector, which contains the entire file data. + +If the file is encrypted, each sector (after compression/implosion, if applicable) is encrypted with the file's key. The base key for a file is determined by a hash of the file name stripped of the directory (i.e. the key for a file named "directory\file" would be computed as the hash of "file"). If this key is adjusted, as indicated in the file's Flags, the final key is calculated as ((base key + BlockOffset - ArchiveOffset) XOR FileSize) (StormLib incorrectly uses an AND in place of the XOR). Each sector is encrypted using the key + the 0-based index of the sector in the file. The SectorOffsetTable, if present, is encrypted using the key - 1. + +The SectorOffsetTable is omitted when the sizes and offsets of all sectors in the file are calculatable from the FileSize. This can happen in several circumstances. If the file is not compressed/imploded, then the size and offset of all sectors is known, based on the archive's SectorSizeShift. If the file is stored as a single unit compressed/imploded, then the SectorOffsetTable is omitted, as the single file "sector" corresponds to BlockSize and FileSize, as mentioned previously. However, the SectorOffsetTable will be present if the file is compressed/imploded and the file is not stored as a single unit, even if there is only a single sector in the file (the size of the file is less than or equal to the archive's sector size). + +2.7 LISTFILE +The listfile is a very simple extension to the MoPaQ format that contains the file paths of (most) files in the archive. The languages and platforms of the files are not stored in the listfile. The listfile is contained in the file "(listfile)" (default language and platform), and is simply a text file with file paths separated by ';', 0Dh, 0Ah, or some combination of these. The file "(listfile)" may not be listed in the listfile. + +2.8 EXTENDED ATTRIBUTES +The extended attributes are optional file attributes for files in the block table. These attributes were added at times after the MoPaQ format was already finalized, and it is not necessary for every archive to have all (or any) of the extended attributes. If an archive contains a given attribute, there will be an instance of that attribute for every block in the block table, although the attribute will be meaningless if the block is not a file. The order of the attributes for blocks correspond to the order of the blocks in the block table, and are of the same number. The attributes are stored in parallel arrays in the "(attributes)" file (default language and platform), in the archive. The attributes corresponding to this file need not be valid (and logically cannot be). Unlike all the other structures in the MoPaQ format, entries in the extended attributes are NOT guaranteed to be aligned. Also note that in some archives, malicious zeroing of the attributes has been observed, perhaps with the intent of breaking archive viewers. This file is structured as follows: + +00h: int32 Version : Specifies the extended attributes format version. For now, must be 100. +04h: int32 AttributesPresent : Bit mask of the extended attributes present in the archive: + 00000001h: File CRC32s. + 00000002h: File timestamps. + 00000004h: File MD5s. +08h: int32(BlockTableEntries) CRC32s : CRC32s of the (uncompressed) file data for each block in the archive. Omitted if the archive does not have CRC32s. +immediately after CRC32s: FILETIME(BlockTableEntries) Timestamps : Timestamps for each block in the archive. The format is that of the Windows FILETIME structure. Omitted if the archive does not have timestamps. +immediately after Timestamps: MD5(BlockTableEntries) MD5s : MD5s of the (uncompressed) file data for each block in the archive. Omitted if the archive does not have MD5s. + +2.9 WEAK DIGITAL SIGNATURE +The weak digital signature is a digital signature using Microsoft CryptoAPI. It is an implimentation +of the RSASSA-PKCS1-v1_5 digital signature protocol, using the MD5 hashing algorithm and a 512-bit (weak) +RSA key (for more information about this protocol, see the RSA Labs PKCS1 specification). The public key +and exponent are stored in a resource in Storm, the private key is stored in a separate file, whose filename +is passed to MPQAPI (the private key is not stored in MPQAPI). The signature is stored uncompressed, +unencrypted in the file "(signature)" (default language and platform) in the archive. The archive +is hashed from the beginning of the archive (ArchiveOffset in the containing file) to the end of +the archive (the length indicated by ArchiveSize, or calculated in the Burning Crusade MoPaQ format); +the signature file is added to the archive before signing, and the space occupied by the file is considered +to be all binary 0s during signing/verification. This file is structured as follows: + +00h: int32 Unknown : Must be 0. +04h: int32 Unknown : Must be 0. +08h: int512 Signature : The digital signature. Like all other numbers in the MoPaQ format, this is stored +in little-endian order. The structure of this, when decrypted, follows the RSASSA-PKCS1-v1_5 specification; +this format is rather icky to work with (I wrote a program to verify this signature using nothing but an MD5 +function and huge integer functions; it wasn't pleasant), and best left to an encryption library such as Cryto++. + +2.10 STRONG DIGITAL SIGNATURE +The strong digital signature uses a simple proprietary implementation of RSA signing, using the SHA-1 hashing algorithm and a 2048-bit (strong) RSA key. The default public key and exponent are stored in Storm, but other keys may be used as well. The strong digital signature is stored immediately after the archive, in the containing file; the entire archive (ArchiveSize bytes, starting at ArchiveOffset in the containing file) is hashed as a single block. The signature has the following format: + +00h: char(4) Magic : Indicates the presence of a digital signature. Must be "NGIS" ("SIGN" backwards). +04h: int2048 Signature : The digital signature, stored in little-endian format. + +When the Signature field is decrypted with the public key and exponent, and the resulting large integer is stored in little-endian order, it is structured as follows: + +00h: byte Padding : Must be 0Bh. +01h: byte(235) Padding : Must be BBh. +ECh: byte(20) SHA-1 : SHA-1 hash of the archive, in standard SHA-1 byte order. + +3. ALGORITHM SOURCE CODE +All of the sample code here assumes little endian machine byte order, that the short type is 16 bits, that the long type is 32 bits, and that the long long type is 64 bits. Adjustments must be made if these assumptions are not correct on a given platform. All code not credited otherwise was written by myself in the writing of this specification. + +3.1 ENCRYPTION/DECRYPTION +Based on code from StormLib. + +unsigned long dwCryptTable[0x500]; + +// The encryption and hashing functions use a number table in their procedures. This table must be initialized before the functions are called the first time. +void InitializeCryptTable() +{ + unsigned long seed = 0x00100001; + unsigned long index1 = 0; + unsigned long index2 = 0; + int i; + + for (index1 = 0; index1 < 0x100; index1++) + { + for (index2 = index1, i = 0; i < 5; i++, index2 += 0x100) + { + unsigned long temp1, temp2; + + seed = (seed * 125 + 3) % 0x2AAAAB; + temp1 = (seed & 0xFFFF) << 0x10; + + seed = (seed * 125 + 3) % 0x2AAAAB; + temp2 = (seed & 0xFFFF); + + dwCryptTable[index2] = (temp1 | temp2); + } + } +} + +void EncryptData(void *lpbyBuffer, unsigned long dwLength, unsigned long dwKey) +{ + assert(lpbyBuffer); + + unsigned long *lpdwBuffer = (unsigned long *)lpbyBuffer; + unsigned long seed = 0xEEEEEEEE; + unsigned long ch; + + dwLength /= sizeof(unsigned long); + + while(dwLength-- > 0) + { + seed += dwCryptTable[0x400 + (dwKey & 0xFF)]; + ch = *lpdwBuffer ^ (dwKey + seed); + + dwKey = ((~dwKey << 0x15) + 0x11111111) | (dwKey >> 0x0B); + seed = *lpdwBuffer + seed + (seed << 5) + 3; + + *lpdwBuffer++ = ch; + } +} + +void DecryptData(void *lpbyBuffer, unsigned long dwLength, unsigned long dwKey) +{ + assert(lpbyBuffer); + + unsigned long *lpdwBuffer = (unsigned long *)lpbyBuffer; + unsigned long seed = 0xEEEEEEEEL; + unsigned long ch; + + dwLength /= sizeof(unsigned long); + + while(dwLength-- > 0) + { + seed += dwCryptTable[0x400 + (dwKey & 0xFF)]; + ch = *lpdwBuffer ^ (dwKey + seed); + + dwKey = ((~dwKey << 0x15) + 0x11111111L) | (dwKey >> 0x0B); + seed = ch + seed + (seed << 5) + 3; + + *lpdwBuffer++ = ch; + } +} + +3.2 HASHING AND FILE KEY COMPUTATION +These functions may have been derived from StormLib code at some point in the very distant past. It was so long ago that I don't remember for certain. + +// Different types of hashes to make with HashString +#define MPQ_HASH_TABLE_OFFSET 0 +#define MPQ_HASH_NAME_A 1 +#define MPQ_HASH_NAME_B 2 +#define MPQ_HASH_FILE_KEY 3 + +// Based on code from StormLib. +unsigned long HashString(const char *lpszString, unsigned long dwHashType) +{ + assert(lpszString); + assert(dwHashType <= MPQ_HASH_FILE_KEY); + + unsigned long seed1 = 0x7FED7FEDL; + unsigned long seed2 = 0xEEEEEEEEL; + int ch; + + while (*lpszString != 0) + { + ch = toupper(*lpszString++); + + seed1 = dwCryptTable[(dwHashType * 0x100) + ch] ^ (seed1 + seed2); + seed2 = ch + seed1 + seed2 + (seed2 << 5) + 3; + } + return seed1; +} + +#define BLOCK_OFFSET_ADJUSTED_KEY 0x00020000L + +unsigned long ComputeFileKey(const char *lpszFilePath, const BlockTableEntry &blockEntry, unsigned long nArchiveOffset) +{ + assert(lpszFilePath); + + // Find the file name part of the path + const char *lpszFileName = strrchr(lpszFilePath, '\\'); + if (lpszFileName) + lpszFileName++; // Skip the \ + else + lpszFileName = lpszFilePath; + + // Hash the name to get the base key + unsigned long nFileKey = HashString(lpszFileName, MPQ_HASH_FILE_KEY); + + // Offset-adjust the key if necessary + if (blockEntry.Flags & BLOCK_OFFSET_ADJUSTED_KEY) + nFileKey = (nFileKey + blockEntry.BlockOffset) ^ blockEntry.FileSize; + + return nFileKey; +} + +3.3 FINDING FILES + +#define MPQ_HASH_ENTRY_EMPTY 0xFFFFFFFFL +#define MPQ_HASH_ENTRY_DELETED 0xFFFFFFFEL + +bool FindFileInHashTable(const HashTableEntry *lpHashTable, unsigned long nHashTableSize, const char *lpszFilePath, unsigned short nLang, unsigned char nPlatform, unsigned long &iFileHashEntry) +{ + assert(lpHashTable); + assert(nHashTableSize); + assert(lpszFilePath); + + // Find the home entry in the hash table for the file + unsigned long iInitEntry = HashString(lpszFilePath, MPQ_HASH_TABLE_OFFSET) & (nHashTableSize - 1); + + // Is there anything there at all? + if (lpHashTable[iInitEntry].FileBlockIndex == MPQ_HASH_ENTRY_EMPTY) + return false; + + // Compute the hashes to compare the hash table entry against + unsigned long nNameHashA = HashString(lpszFilePath, MPQ_HASH_NAME_A), + nNameHashB = HashString(lpszFilePath, MPQ_HASH_NAME_B), + iCurEntry = iInitEntry; + + // Check each entry in the hash table till a termination point is reached + do + { + if (lpHashTable[iCurEntry].FileBlockIndex != MPQ_HASH_ENTRY_DELETED) + { + if (lpHashTable[iCurEntry].FilePathHashA == nNameHashA + && lpHashTable[iCurEntry].FilePathHashB == nNameHashB + && lpHashTable[iCurEntry].Language == nLang + && lpHashTable[iCurEntry].Platform == nPlatform) + { + iFileHashEntry = iCurEntry; + + return true; + } + } + + iCurEntry = (iCurEntry + 1) & (nHashTableSize - 1); + } while (iCurEntry != iInitEntry && lpHashTable[iCurEntry].FileBlockIndex != MPQ_HASH_ENTRY_EMPTY); + + return false; +} + +3.4 DELETING FILES + +bool DeleteFile(HashTableEntry *lpHashTable, unsigned long nHashTableSize, BlockTableEntry *lpBlockTable, const char *lpszFilePath, unsigned short nLang, unsigned char nPlatform) +{ + assert(lpHashTable); + assert(nHashTableSize); + assert(lpBlockTable); + + // Find the file in the hash table + unsigned long iFileHashEntry; + + if (!FindFileInHashTable(lpHashTable, nHashTableSize, lpszFilePath, nLang, nPlatform, iFileHashEntry)) + return false; + + // Get the block table index before we nuke the hash table entry + unsigned long iFileBlockEntry = lpHashTable[iFileHashEntry].FileBlockIndex; + + // Delete the file's entry in the hash table + memset(&lpHashTable[iFileHashEntry], 0xFF, sizeof(HashTableEntry)); + + // If the next entry is empty, mark this one as empty; otherwise, mark this as deleted. + if (lpHashTable[(iFileHashEntry + 1) & (nHashTableSize - 1)].FileBlockIndex == MPQ_HASH_ENTRY_EMPTY) + lpHashTable[iFileHashEntry].FileBlockIndex = MPQ_HASH_ENTRY_EMPTY; + else + lpHashTable[iFileHashEntry].FileBlockIndex = MPQ_HASH_ENTRY_DELETED; + + // If the block occupies space, mark the block as free space; otherwise, clear the block table entry. + if (lpBlockTable[iFileBlockEntry].BlockSize > 0) + { + lpBlockTable[iFileBlockEntry].FileSize = 0; + lpBlockTable[iFileBlockEntry].Flags = 0; + } + else + memset(&lpBlockTable[iFileBlockEntry], 0, sizeof(BlockTableEntry); + + return true; +} + +3.5 CONVERSION OF FILETIME AND time_t +This code assumes that the base ("zero") date for time_t is 01/01/1970. This is true on Windows, Unix System V systems, and Mac OS X. It is unknown whether this is true on all other platforms. You'll need to research this yourself, if you plan on porting it somewhere else. + +#define EPOCH_OFFSET 116444736000000000ULL // Number of 100 ns units between 01/01/1601 and 01/01/1970 + +bool GetTimeFromFileTime(const FILETIME &fileTime, time_t &time) +{ + // The FILETIME represents a 64-bit integer: the number of 100 ns units since January 1, 1601 + unsigned long long nTime = ((unsigned long long)fileTime.dwHighDateTime << 32) + fileTime.dwLowDateTime; + + if (nTime < EPOCH_OFFSET) + return false; + + nTime -= EPOCH_OFFSET; // Convert the time base from 01/01/1601 to 01/01/1970 + nTime /= 10000000ULL; // Convert 100 ns to sec + + time = (time_t)nTime; + + // Test for overflow (FILETIME is 64 bits, time_t is 32 bits) + if ((nTime - (unsigned long long)time) > 0) + return false; + + return true; +} + +void GetFileTimeFromTime(const time_t &time, FILETIME &fileTime) +{ + unsigned long long nTime = (unsigned long long)time; + + nTime *= 10000000ULL; + nTime += EPOCH_OFFSET; + + fileTime.dwLowDateTime = (DWORD)nTime; + fileTime.dwHighDateTime = (DWORD)(nTime >> 32); +} + +3.6 FORMING A 64-BIT LARGE ARCHIVE OFFSET FROM 32-BIT AND 16-BIT COMPONENTS +unsigned long long MakeLargeArchiveOffset(unsigned long nOffsetLow, unsigned short nOffsetHigh) +{ + return ((unsigned long long)nOffsetHigh << 32) + (unsigned long long)nOffsetLow; +} + +4. REVISION HISTORY +1.0 + - Updated to include most of the changes found in the Burning Crusade Friends and Family beta + +0.91. + - Updated several structure member descriptions + - Listed the full set of characters that can separate list file entries + - Noted that (attributes), (listfile), and (signature) use the default language and platform codes + - Redid part of the file data specs to clarify the format of sectors + - Enhanced descriptions of the different kinds of block table entries + - Added ComputeFileKey, FindFileInHashTable, and DeleteFile source \ No newline at end of file diff --git a/dep/StormLib/src/FileStream.cpp b/dep/StormLib/src/FileStream.cpp new file mode 100644 index 00000000000..b8de102cd2e --- /dev/null +++ b/dep/StormLib/src/FileStream.cpp @@ -0,0 +1,1861 @@ +/*****************************************************************************/ +/* FileStream.cpp Copyright (c) Ladislav Zezula 2010 */ +/*---------------------------------------------------------------------------*/ +/* File stream support for StormLib */ +/* */ +/* Windows support: Written by Ladislav Zezula */ +/* Mac support: Written by Sam Wilkins */ +/* Linux support: Written by Sam Wilkins and Ivan Komissarov */ +/* Big-endian: Written & debugged by Sam Wilkins */ +/*---------------------------------------------------------------------------*/ +/* Date Ver Who Comment */ +/* -------- ---- --- ------- */ +/* 11.06.10 1.00 Lad Derived from StormPortMac.cpp and StormPortLinux.cpp */ +/*****************************************************************************/ + +#define __STORMLIB_SELF__ +#include "StormLib.h" +#include "StormCommon.h" + +//----------------------------------------------------------------------------- +// Local defines + +#ifndef INVALID_HANDLE_VALUE +#define INVALID_HANDLE_VALUE ((HANDLE)-1) +#endif + +#ifdef _MSC_VER +#pragma warning(disable: 4800) // 'BOOL' : forcing value to bool 'true' or 'false' (performance warning) +#endif + +//----------------------------------------------------------------------------- +// Local structures + +// Structure describing the PART file header +typedef struct _PART_FILE_HEADER +{ + DWORD PartialVersion; // Always set to 2 + char GameBuildNumber[8]; // Minimum build number of the game that can use this MPQ + DWORD Unknown0C; + DWORD Unknown10; + DWORD Unknown14; // Often contains 0x1C (size of the rest of the header ?) + DWORD Unknown18; + DWORD ZeroValue1C; // Seems to always be zero + DWORD ZeroValue20; // Seems to always be zero + DWORD ZeroValue24; // Seems to always be zero + DWORD FileSizeLo; // Low 32 bits of the file size + DWORD FileSizeHi; // High 32 bits of the file size + DWORD BlockSize; // Size of one file block, in bytes + +} PART_FILE_HEADER, *PPART_FILE_HEADER; + +// Structure describing the block-to-file map entry +typedef struct _PART_FILE_MAP_ENTRY +{ + DWORD Flags; // 3 = the block is present in the file + DWORD BlockOffsLo; // Low 32 bits of the block position in the file + DWORD BlockOffsHi; // High 32 bits of the block position in the file + DWORD Unknown0C; + DWORD Unknown10; + +} PART_FILE_MAP_ENTRY, *PPART_FILE_MAP_ENTRY; + +struct TPartFileStream : public TFileStream +{ + ULONGLONG VirtualSize; // Virtual size of the file + ULONGLONG VirtualPos; // Virtual position in the file + DWORD BlockCount; // Number of file blocks. Used by partial file stream + DWORD BlockSize; // Size of one block. Used by partial file stream + + PART_FILE_MAP_ENTRY PartMap[1]; // File map, variable length +}; + +#define MPQE_CHUNK_SIZE 0x40 // Size of one chunk to be decrypted + +struct TEncryptedStream : public TFileStream +{ + BYTE Key[MPQE_CHUNK_SIZE]; // File key +}; + +static bool IsPartHeader(PPART_FILE_HEADER pPartHdr) +{ + // Version number must be 2 + if(pPartHdr->PartialVersion == 2) + { + // GameBuildNumber must be anm ASCII number + if(isdigit(pPartHdr->GameBuildNumber[0]) && isdigit(pPartHdr->GameBuildNumber[1]) && isdigit(pPartHdr->GameBuildNumber[2])) + { + // Block size must be power of 2 + if((pPartHdr->BlockSize & (pPartHdr->BlockSize - 1)) == 0) + return true; + } + } + + return false; +} + +//----------------------------------------------------------------------------- +// Non-Windows support for LastError + +#ifndef PLATFORM_WINDOWS +static int nLastError = ERROR_SUCCESS; + +int GetLastError() +{ + return nLastError; +} + +void SetLastError(int nError) +{ + nLastError = nError; +} +#endif + +//----------------------------------------------------------------------------- +// Local functions - platform-specific functions + +#ifndef PLATFORM_LITTLE_ENDIAN +void ConvertPartHeader(void * partHeader) +{ + PPART_FILE_HEADER theHeader = (PPART_FILE_HEADER)partHeader; + + theHeader->PartialVersion = SwapUInt32(theHeader->PartialVersion); + theHeader->Unknown0C = SwapUInt32(theHeader->Unknown0C); + theHeader->Unknown10 = SwapUInt32(theHeader->Unknown10); + theHeader->Unknown14 = SwapUInt32(theHeader->Unknown14); + theHeader->Unknown18 = SwapUInt32(theHeader->Unknown18); + theHeader->Unknown1C = SwapUInt32(theHeader->Unknown1C); + theHeader->Unknown20 = SwapUInt32(theHeader->Unknown20); + theHeader->ZeroValue = SwapUInt32(theHeader->ZeroValue); + theHeader->FileSizeLo = SwapUInt32(theHeader->FileSizeLo); + theHeader->FileSizeHi = SwapUInt32(theHeader->FileSizeHi); + theHeader->BlockSize = SwapUInt32(theHeader->BlockSize); +} +#endif + +#ifdef PLATFORM_MAC +static void ConvertUTCDateTimeToFileTime(const UTCDateTimePtr inTime, ULONGLONG * pFT) +{ + UInt64 intTime = ((UInt64)inTime->highSeconds << 32) + inTime->lowSeconds; + intTime *= 10000000; + intTime += 0x0153b281e0fb4000ull; + + *pFT = intTime; +} + +static OSErr FSOpenDFCompat(FSRef *ref, char permission, short *refNum) +{ + HFSUniStr255 forkName; + OSErr theErr; + Boolean isFolder, wasChanged; + + theErr = FSResolveAliasFile(ref, true, &isFolder, &wasChanged); + if (theErr != noErr) + { + return theErr; + } + + FSGetDataForkName(&forkName); +#ifdef PLATFORM_64BIT + theErr = FSOpenFork(ref, forkName.length, forkName.unicode, permission, (FSIORefNum *)refNum); +#else + theErr = FSOpenFork(ref, forkName.length, forkName.unicode, permission, refNum); +#endif + return theErr; +} +#endif + +#ifdef PLATFORM_LINUX +// time_t is number of seconds since 1.1.1970, UTC. +// 1 second = 10000000 (decimal) in FILETIME +static void ConvertTimeTToFileTime(ULONGLONG * pFileTime, time_t crt_time) +{ + // Set the start to 1.1.1970 00:00:00 + *pFileTime = 0x019DB1DED53E8000ULL + (10000000 * crt_time); +} +#endif + +static HANDLE CreateNewFile( + const TCHAR * szFileName) // Name of the file to open +{ + HANDLE hFile = INVALID_HANDLE_VALUE; // Pre-set the file handle to INVALID_HANDLE_VALUE + +#ifdef PLATFORM_WINDOWS + { + DWORD dwShareMode = FILE_SHARE_READ; + + if(dwGlobalFlags & SFILE_FLAG_ALLOW_WRITE_SHARE) + dwShareMode |= FILE_SHARE_WRITE; + + hFile = CreateFile(szFileName, + GENERIC_READ | GENERIC_WRITE, + dwShareMode, + NULL, + CREATE_ALWAYS, + 0, + NULL); + } +#endif + +#ifdef PLATFORM_MAC + { + FSRef theParentRef; + FSRef theFileRef; + OSErr theErr; + short fileRef; + + theErr = FSPathMakeRef((const UInt8 *)szFileName, &theFileRef, NULL); + + if (theErr == noErr) + FSDeleteObject(&theFileRef); + + // Create the FSRef for the parent directory. + UInt8 folderName[MAX_PATH]; + memset(&theFileRef, 0, sizeof(FSRef)); + CFStringRef filePathCFString = CFStringCreateWithCString(NULL, szFileName, kCFStringEncodingUTF8); + CFURLRef fileURL = CFURLCreateWithFileSystemPath(NULL, filePathCFString, kCFURLPOSIXPathStyle, false); + CFURLRef folderURL = CFURLCreateCopyDeletingLastPathComponent(NULL, fileURL); + CFURLGetFileSystemRepresentation(folderURL, true, folderName, MAX_PATH); + theErr = FSPathMakeRef(folderName, &theParentRef, NULL); + CFRelease(fileURL); + CFRelease(folderURL); + + if (theErr != noErr) + { + nLastError = theErr; + return INVALID_HANDLE_VALUE; + } + + // Create the file + UniChar unicodeFileName[256]; + fileURL = CFURLCreateWithFileSystemPath(NULL, filePathCFString, kCFURLPOSIXPathStyle, false); + CFStringRef fileNameCFString = CFURLCopyLastPathComponent(fileURL); + CFStringGetCharacters(fileNameCFString, CFRangeMake(0, CFStringGetLength(fileNameCFString)), + unicodeFileName); + theErr = FSCreateFileUnicode(&theParentRef, CFStringGetLength(fileNameCFString), unicodeFileName, + kFSCatInfoNone, NULL, &theFileRef, NULL); + CFRelease(fileNameCFString); + CFRelease(filePathCFString); + CFRelease(fileURL); + if (theErr != noErr) + { + nLastError = theErr; + return INVALID_HANDLE_VALUE; + } + + theErr = FSOpenDFCompat(&theFileRef, fsRdWrPerm, &fileRef); + if(theErr != noErr) + { + nLastError = theErr; + return INVALID_HANDLE_VALUE; + } + + hFile = (HANDLE)(int)fileRef; + } +#endif + +#ifdef PLATFORM_LINUX + { + intptr_t handle; + + handle = open(szFileName, O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); + if(handle == -1) + { + nLastError = errno; + return INVALID_HANDLE_VALUE; + } + + hFile = (HANDLE)handle; + } +#endif + + // Return the file handle + return hFile; +} + +static HANDLE OpenExistingFile( + const TCHAR * szFileName, // Name of the file to open + bool bWriteAccess) // false = read-only, true = read/write +{ + HANDLE hFile = INVALID_HANDLE_VALUE; // Pre-set the file handle to INVALID_HANDLE_VALUE + +#ifdef PLATFORM_WINDOWS + { + DWORD dwShareMode = FILE_SHARE_READ; + + if(dwGlobalFlags & SFILE_FLAG_ALLOW_WRITE_SHARE) + dwShareMode |= FILE_SHARE_WRITE; + + hFile = CreateFile(szFileName, + bWriteAccess ? (GENERIC_READ | GENERIC_WRITE) : GENERIC_READ, + dwShareMode, + NULL, + OPEN_EXISTING, + 0, + NULL); + } +#endif + +#ifdef PLATFORM_MAC + { + FSRef theFileRef; + OSErr theErr; + short fileRef; + char permission = bWriteAccess ? fsRdWrPerm : fsRdPerm; + + theErr = FSPathMakeRef((const UInt8 *)szFileName, &theFileRef, NULL); + if(theErr != noErr) + { + nLastError = theErr; + return INVALID_HANDLE_VALUE; + } + + theErr = FSOpenDFCompat(&theFileRef, permission, &fileRef); + if (theErr != noErr) + { + nLastError = theErr; + return INVALID_HANDLE_VALUE; + } + + hFile = (HANDLE)(int)fileRef; + } +#endif + +#ifdef PLATFORM_LINUX + { + int oflag = bWriteAccess ? O_RDWR : O_RDONLY; + intptr_t handle; + + handle = open(szFileName, oflag | O_LARGEFILE); + if(handle == -1) + { + nLastError = errno; + return INVALID_HANDLE_VALUE; + } + + hFile = (HANDLE)handle; + } +#endif + + // Return the file handle + return hFile; +} + +static void CloseTheFile(HANDLE hFile) +{ +#ifdef PLATFORM_WINDOWS + CloseHandle(hFile); +#endif + +#ifdef PLATFORM_MAC + FSCloseFork((short)(long)hFile); +#endif + +#ifdef PLATFORM_LINUX + close((intptr_t)hFile); +#endif +} + +/** + * Renames a file to another name. + * Note that the "szNewFile" file usually exists when this function is called, + * so the function must deal with it properly + */ +static bool RenameFile(const TCHAR * szExistingFile, const TCHAR * szNewFile) +{ +#ifdef PLATFORM_WINDOWS + // Delete the original stream file. Don't check the result value, + // because if the file doesn't exist, it would fail + DeleteFile(szNewFile); + + // Rename the new file to the old stream's file + return (bool)MoveFile(szExistingFile, szNewFile); +#endif + +#ifdef PLATFORM_MAC + OSErr theErr; + FSRef fromFileRef; + FSRef toFileRef; + + if (FSPathMakeRef((const UInt8 *)szNewFile, &toFileRef, NULL) == noErr) + FSDeleteObject(&toFileRef); + + // Get the path to the old file + theErr = FSPathMakeRef((const UInt8 *)szExistingFile, &fromFileRef, NULL); + if (theErr != noErr) + { + nLastError = theErr; + return false; + } + + // Get a CFString for the new file name + CFStringRef newFileNameCFString = CFStringCreateWithCString(NULL, szNewFile, kCFStringEncodingUTF8); + CFURLRef fileURL = CFURLCreateWithFileSystemPath(NULL, newFileNameCFString, kCFURLPOSIXPathStyle, false); + CFRelease(newFileNameCFString); + newFileNameCFString = CFURLCopyLastPathComponent(fileURL); + CFRelease(fileURL); + + // Convert CFString to Unicode and rename the file + UniChar unicodeFileName[256]; + CFStringGetCharacters(newFileNameCFString, CFRangeMake(0, CFStringGetLength(newFileNameCFString)), + unicodeFileName); + theErr = FSRenameUnicode(&fromFileRef, CFStringGetLength(newFileNameCFString), unicodeFileName, + kTextEncodingUnknown, NULL); + if (theErr != noErr) + { + CFRelease(newFileNameCFString); + nLastError = theErr; + return false; + } + + CFRelease(newFileNameCFString); + + return true; +#endif + +#ifdef PLATFORM_LINUX + // "rename" on Linux also works if the target file exists + if(rename(szExistingFile, szNewFile) == -1) + { + nLastError = errno; + return false; + } + + return true; +#endif +} + +//----------------------------------------------------------------------------- +// Stream functions - normal file stream + +static bool File_GetPos( + TFileStream * pStream, // Pointer to an open stream + ULONGLONG & ByteOffset) // Pointer to file byte offset +{ + ByteOffset = pStream->RawFilePos; + return true; +} + +static bool File_Read( + TFileStream * pStream, // Pointer to an open stream + ULONGLONG * pByteOffset, // Pointer to file byte offset. If NULL, it reads from the current position + void * pvBuffer, // Pointer to data to be read + DWORD dwBytesToRead) // Number of bytes to read from the file +{ + DWORD dwBytesRead = 0; // Must be set by platform-specific code + + // If the byte offset is not entered, use the current position + if(pByteOffset == NULL) + pByteOffset = &pStream->RawFilePos; + +#ifdef PLATFORM_WINDOWS + { + // If the byte offset is different from the current file position, + // we have to update the file position + if(*pByteOffset != pStream->RawFilePos) + { + LONG ByteOffsetHi = (LONG)(*pByteOffset >> 32); + LONG ByteOffsetLo = (LONG)(*pByteOffset); + + SetFilePointer(pStream->hFile, ByteOffsetLo, &ByteOffsetHi, FILE_BEGIN); + pStream->RawFilePos = *pByteOffset; + } + + // Read the data + if(dwBytesToRead != 0) + { + if(!ReadFile(pStream->hFile, pvBuffer, dwBytesToRead, &dwBytesRead, NULL)) + return false; + } + } +#endif + +#ifdef PLATFORM_MAC + { + ByteCount nBytesToRead = (ByteCount)dwBytesToRead; + ByteCount nBytesRead = 0; + OSErr theErr; + + // If the byte offset is different from the current file position, + // we have to update the file position + if(*pByteOffset != pStream->RawFilePos) + { + FSSetForkPosition((short)(long)pStream->hFile, fsFromStart, (SInt64)(*pByteOffset)); + pStream->RawFilePos = *pByteOffset; + } + + // Read the data + if(nBytesToRead != 0) + { + theErr = FSReadFork((short)(long)pStream->hFile, fsAtMark, 0, nBytesToRead, pvBuffer, &nBytesRead); + if (theErr != noErr && theErr != eofErr) + { + nLastError = theErr; + return false; + } + dwBytesRead = (DWORD)nBytesRead; + } + } +#endif + +#ifdef PLATFORM_LINUX + { + ssize_t bytes_read; + + // If the byte offset is different from the current file position, + // we have to update the file position + if(*pByteOffset != pStream->RawFilePos) + { + lseek64((intptr_t)pStream->hFile, (off64_t)(*pByteOffset), SEEK_SET); + pStream->RawFilePos = *pByteOffset; + } + + // Perform the read operation + if(dwBytesToRead != 0) + { + bytes_read = read((intptr_t)pStream->hFile, pvBuffer, (size_t)dwBytesToRead); + if(bytes_read == -1) + { + nLastError = errno; + return false; + } + + dwBytesRead = (DWORD)(size_t)bytes_read; + } + } +#endif + + // Increment the current file position by number of bytes read + // If the number of bytes read doesn't match to required amount, return false + pStream->RawFilePos = *pByteOffset + dwBytesRead; + if(dwBytesRead != dwBytesToRead) + SetLastError(ERROR_HANDLE_EOF); + return (dwBytesRead == dwBytesToRead); +} + +/** + * \a pStream Pointer to an open stream + * \a pByteOffset Pointer to file byte offset. If NULL, writes to current position + * \a pvBuffer Pointer to data to be written + * \a dwBytesToWrite Number of bytes to write to the file + */ + +static bool File_Write(TFileStream * pStream, ULONGLONG * pByteOffset, const void * pvBuffer, DWORD dwBytesToWrite) +{ + DWORD dwBytesWritten = 0; // Must be set by platform-specific code + + // If the byte offset is not entered, use the current position + if(pByteOffset == NULL) + pByteOffset = &pStream->RawFilePos; + +#ifdef PLATFORM_WINDOWS + { + // If the byte offset is different from the current file position, + // we have to update the file position + if(*pByteOffset != pStream->RawFilePos) + { + LONG ByteOffsetHi = (LONG)(*pByteOffset >> 32); + LONG ByteOffsetLo = (LONG)(*pByteOffset); + + SetFilePointer(pStream->hFile, ByteOffsetLo, &ByteOffsetHi, FILE_BEGIN); + pStream->RawFilePos = *pByteOffset; + } + + // Read the data + if(!WriteFile(pStream->hFile, pvBuffer, dwBytesToWrite, &dwBytesWritten, NULL)) + return false; + } +#endif + +#ifdef PLATFORM_MAC + { + ByteCount nBytesToWrite = (ByteCount)dwBytesToWrite; + ByteCount nBytesWritten = 0; + OSErr theErr; + + // If the byte offset is different from the current file position, + // we have to update the file position + if(*pByteOffset != pStream->RawFilePos) + { + FSSetForkPosition((short)(long)pStream->hFile, fsFromStart, (SInt64)(*pByteOffset)); + pStream->RawFilePos = *pByteOffset; + } + + theErr = FSWriteFork((short)(long)pStream->hFile, fsAtMark, 0, nBytesToWrite, pvBuffer, &nBytesWritten); + if (theErr != noErr) + { + nLastError = theErr; + return false; + } + dwBytesWritten = (DWORD)nBytesWritten; + } +#endif + +#ifdef PLATFORM_LINUX + { + ssize_t bytes_written; + + // If the byte offset is different from the current file position, + // we have to update the file position + if(*pByteOffset != pStream->RawFilePos) + { + lseek64((intptr_t)pStream->hFile, (off64_t)(*pByteOffset), SEEK_SET); + pStream->RawFilePos = *pByteOffset; + } + + // Perform the read operation + bytes_written = write((intptr_t)pStream->hFile, pvBuffer, (size_t)dwBytesToWrite); + if(bytes_written == -1) + { + nLastError = errno; + return false; + } + + dwBytesWritten = (DWORD)(size_t)bytes_written; + } +#endif + + // Increment the current file position by number of bytes read + pStream->RawFilePos = *pByteOffset + dwBytesWritten; + if(dwBytesWritten != dwBytesToWrite) + SetLastError(ERROR_DISK_FULL); + return (dwBytesWritten == dwBytesToWrite); +} + +static bool File_GetSize( + TFileStream * pStream, // Pointer to an open stream + ULONGLONG & FileSize) // Pointer where to store file size +{ +#ifdef PLATFORM_WINDOWS + DWORD FileSizeHi = 0; + DWORD FileSizeLo; + + FileSizeLo = GetFileSize(pStream->hFile, &FileSizeHi); + if(FileSizeLo == INVALID_FILE_SIZE && GetLastError() != ERROR_SUCCESS) + return false; + + FileSize = MAKE_OFFSET64(FileSizeHi, FileSizeLo); + return true; +#endif + +#ifdef PLATFORM_MAC + SInt64 fileLength = 0; + OSErr theErr; + + theErr = FSGetForkSize((short)(long)pStream->hFile, &fileLength); + if(theErr != noErr) + { + nLastError = theErr; + return false; + } + + FileSize = (ULONGLONG)fileLength; + return true; +#endif + +#ifdef PLATFORM_LINUX + struct stat64 fileinfo; + + if(fstat64((intptr_t)pStream->hFile, &fileinfo) == -1) + { + nLastError = errno; + return false; + } + + FileSize = (ULONGLONG)fileinfo.st_size; + return true; +#endif +} + +/** + * \a pStream Pointer to an open stream + * \a NewFileSize New size of the file + */ +static bool File_SetSize(TFileStream * pStream, ULONGLONG NewFileSize) +{ +#ifdef PLATFORM_WINDOWS + { + LONG FileSizeHi = (LONG)(NewFileSize >> 32); + LONG FileSizeLo = (LONG)(NewFileSize); + DWORD dwNewPos; + bool bResult; + + // Set the position at the new file size + dwNewPos = SetFilePointer(pStream->hFile, FileSizeLo, &FileSizeHi, FILE_BEGIN); + if(dwNewPos == INVALID_SET_FILE_POINTER && GetLastError() != ERROR_SUCCESS) + return false; + + // Set the current file pointer as the end of the file + bResult = (bool)SetEndOfFile(pStream->hFile); + + // Restore the file position + FileSizeHi = (LONG)(pStream->RawFilePos >> 32); + FileSizeLo = (LONG)(pStream->RawFilePos); + SetFilePointer(pStream->hFile, FileSizeLo, &FileSizeHi, FILE_BEGIN); + return bResult; + } +#endif + +#ifdef PLATFORM_MAC + { + OSErr theErr; + + theErr = FSSetForkSize((short)(long)pStream->hFile, fsFromStart, (SInt64)NewFileSize); + if(theErr != noErr) + { + nLastError = theErr; + return false; + } + + return true; + } +#endif + +#ifdef PLATFORM_LINUX + { + if(ftruncate((intptr_t)pStream->hFile, (off_t)NewFileSize) == -1) + { + nLastError = errno; + return false; + } + + return true; + } +#endif +} + +//----------------------------------------------------------------------------- +// Stream functions - partial normal file stream + +/** + * \a pStream Pointer to an open stream + * \a ByteOffset File byte offset + */ +static bool PartFile_GetPos(TPartFileStream * pStream, ULONGLONG & ByteOffset) +{ + ByteOffset = pStream->VirtualPos; + return true; +} + +/** + * \a pStream Pointer to an open stream + * \a pByteOffset Pointer to file byte offset. If NULL, reads from the current position + * \a pvBuffer Pointer to data to be read + * \a dwBytesToRead Number of bytes to read from the file + */ +static bool PartFile_Read(TPartFileStream * pStream, ULONGLONG * pByteOffset, void * pvBuffer, DWORD dwBytesToRead) +{ + ULONGLONG RawByteOffset; + LPBYTE pbBuffer = (LPBYTE)pvBuffer; + DWORD dwBytesRemaining = dwBytesToRead; + DWORD dwPartOffset; + DWORD dwPartIndex; + DWORD dwBytesRead = 0; + DWORD dwBlockSize = pStream->BlockSize; + bool bResult = false; + int nFailReason = ERROR_HANDLE_EOF; // Why it failed if not enough bytes was read + + // If the byte offset is not entered, use the current position + if(pByteOffset == NULL) + pByteOffset = &pStream->VirtualPos; + + // Check if the file position is not at or beyond end of the file + if(*pByteOffset >= pStream->VirtualSize) + { + SetLastError(ERROR_HANDLE_EOF); + return false; + } + + // Get the part index where the read offset is + // Note that the part index should now be within the range, + // as read requests beyond-EOF are handled by the previous test + dwPartIndex = (DWORD)(*pByteOffset / pStream->BlockSize); + assert(dwPartIndex < pStream->BlockCount); + + // If the number of bytes remaining goes past + // the end of the file, cut them + if((*pByteOffset + dwBytesRemaining) > pStream->VirtualSize) + dwBytesRemaining = (DWORD)(pStream->VirtualSize - *pByteOffset); + + // Calculate the offset in the current part + dwPartOffset = (DWORD)(*pByteOffset) & (pStream->BlockSize - 1); + + // Read all data, one part at a time + while(dwBytesRemaining != 0) + { + PPART_FILE_MAP_ENTRY PartMap = pStream->PartMap + dwPartIndex; + DWORD dwBytesInPart; + + // If the part is not present in the file, we fail the read + if((PartMap->Flags & 3) == 0) + { + nFailReason = ERROR_CAN_NOT_COMPLETE; + bResult = false; + break; + } + + // If we are in the last part, we have to cut the number of bytes in the last part + if(dwPartIndex == pStream->BlockCount - 1) + dwBlockSize = (DWORD)pStream->VirtualSize & (pStream->BlockSize - 1); + + // Get the number of bytes reamining in the current part + dwBytesInPart = dwBlockSize - dwPartOffset; + + // Compute the raw file offset of the file part + RawByteOffset = MAKE_OFFSET64(PartMap->BlockOffsHi, PartMap->BlockOffsLo); + if(RawByteOffset == 0) + { + nFailReason = ERROR_CAN_NOT_COMPLETE; + bResult = false; + break; + } + + // If the number of bytes in part is too big, cut it + if(dwBytesInPart > dwBytesRemaining) + dwBytesInPart = dwBytesRemaining; + + // Append the offset within the part + RawByteOffset += dwPartOffset; + if(!File_Read(pStream, &RawByteOffset, pbBuffer, dwBytesInPart)) + { + nFailReason = ERROR_CAN_NOT_COMPLETE; + bResult = false; + break; + } + + // Increment the file position + dwBytesRemaining -= dwBytesInPart; + dwBytesRead += dwBytesInPart; + pbBuffer += dwBytesInPart; + + // Move to the next file part + dwPartOffset = 0; + dwPartIndex++; + } + + // Move the file position by the number of bytes read + pStream->VirtualPos = *pByteOffset + dwBytesRead; + if(dwBytesRead != dwBytesToRead) + SetLastError(nFailReason); + return (dwBytesRead == dwBytesToRead); +} + +static bool PartFile_Write( + TPartFileStream * pStream, // Pointer to an open stream + ULONGLONG * pByteOffset, // Pointer to file byte offset. If NULL, it reads from the current position + const void * pvBuffer, // Pointer to data to be read + DWORD dwBytesToRead) // Number of bytes to read from the file +{ + // Keep compiler happy + dwBytesToRead = dwBytesToRead; + pByteOffset = pByteOffset; + pvBuffer = pvBuffer; + pStream = pStream; + + // Not allowed + return false; +} + +static bool PartFile_GetSize( + TPartFileStream * pStream, // Pointer to an open stream + ULONGLONG & FileSize) // Pointer where to store file size +{ + FileSize = pStream->VirtualSize; + return true; +} + +static bool PartFile_SetSize( + TPartFileStream * pStream, // Pointer to an open stream + ULONGLONG NewSize) // new size of the file +{ + // Keep compiler happy + pStream = pStream; + NewSize = NewSize; + + // Not allowed + return false; +} + +/* + * Stream functions - encrypted stream + * + * Note: In original Starcraft II Installer.exe: Suffix derived from battle.net auth. code + * Address of decryption routine: 0053A3D0 http://us.battle.net/static/mediakey/sc2-authenticationcode-enUS.txt + * Pointer to decryptor object: ECX Numbers mean offset of 4-char group of auth code + * Pointer to key: ECX+0x5C -0C- -1C--08- -18--04- -14--00- -10- + */ +static const char * MpqeKey_Starcraft2_Install_enUS = "expand 32-byte kTFD80000ETR5VM5G0000K859RE5N0000WT6F3DH500005LXG"; +static const char * MpqeKey_Starcraft2_Install_enGB = "expand 32-byte kANGY000029ZH6NA20000HRGF8UDG0000NY82G8MN00006A3D"; +static const char * MpqeKey_Starcraft2_Install_deDE = "expand 32-byte kSSXH00004XFXK4KX00008EKJD3CA0000Y64ZY45M0000YD9V"; +static const char * MpqeKey_Starcraft2_Install_esES = "expand 32-byte kQU4Y0000XKTQ94PF0000N4R4UAXE0000AZ248WLK0000249P"; +static const char * MpqeKey_Starcraft2_Install_frFR = "expand 32-byte kFWPQ00006EAJ8HJE0000PFER9K9300008MA2ZG7J0000UA76"; +static const char * MpqeKey_Starcraft2_Install_itIT = "expand 32-byte kXV7E00008BL2TVAP0000GVMWUNNN0000SVBWNE7C00003G2B"; +static const char * MpqeKey_Starcraft2_Install_plPL = "expand 32-byte k83U6000048L6LULJ00004MQDB8ME0000UP6K2NSF0000YHA3"; +static const char * MpqeKey_Starcraft2_Install_ruRU = "expand 32-byte k9SH70000YEGT4BAT0000QDK978W60000V9NLVHB30000D68V"; + +static const char * MpqKeyArray[] = +{ + MpqeKey_Starcraft2_Install_enUS, + MpqeKey_Starcraft2_Install_enGB, + MpqeKey_Starcraft2_Install_deDE, + MpqeKey_Starcraft2_Install_esES, + MpqeKey_Starcraft2_Install_frFR, + MpqeKey_Starcraft2_Install_itIT, + MpqeKey_Starcraft2_Install_plPL, + MpqeKey_Starcraft2_Install_ruRU, + NULL +}; + +static DWORD Rol32(DWORD dwValue, DWORD dwRolCount) +{ + DWORD dwShiftRight = 32 - dwRolCount; + + return (dwValue << dwRolCount) | (dwValue >> dwShiftRight); +} + +static void DecryptFileChunk( + DWORD * MpqData, + LPBYTE pbKey, + ULONGLONG ByteOffset, + DWORD dwLength) +{ + ULONGLONG ChunkOffset; + DWORD KeyShuffled[0x10]; + DWORD KeyMirror[0x10]; + DWORD RoundCount = 0x14; + + // Prepare the key + ChunkOffset = ByteOffset / MPQE_CHUNK_SIZE; + memcpy(KeyMirror, pbKey, MPQE_CHUNK_SIZE); + BSWAP_ARRAY32_UNSIGNED(KeyMirror, MPQE_CHUNK_SIZE); + KeyMirror[0x05] = (DWORD)(ChunkOffset >> 32); + KeyMirror[0x08] = (DWORD)(ChunkOffset); + + while(dwLength >= MPQE_CHUNK_SIZE) + { + // Shuffle the key - part 1 + KeyShuffled[0x0E] = KeyMirror[0x00]; + KeyShuffled[0x0C] = KeyMirror[0x01]; + KeyShuffled[0x05] = KeyMirror[0x02]; + KeyShuffled[0x0F] = KeyMirror[0x03]; + KeyShuffled[0x0A] = KeyMirror[0x04]; + KeyShuffled[0x07] = KeyMirror[0x05]; + KeyShuffled[0x0B] = KeyMirror[0x06]; + KeyShuffled[0x09] = KeyMirror[0x07]; + KeyShuffled[0x03] = KeyMirror[0x08]; + KeyShuffled[0x06] = KeyMirror[0x09]; + KeyShuffled[0x08] = KeyMirror[0x0A]; + KeyShuffled[0x0D] = KeyMirror[0x0B]; + KeyShuffled[0x02] = KeyMirror[0x0C]; + KeyShuffled[0x04] = KeyMirror[0x0D]; + KeyShuffled[0x01] = KeyMirror[0x0E]; + KeyShuffled[0x00] = KeyMirror[0x0F]; + + // Shuffle the key - part 2 + for(DWORD i = 0; i < RoundCount; i += 2) + { + KeyShuffled[0x0A] = KeyShuffled[0x0A] ^ Rol32((KeyShuffled[0x0E] + KeyShuffled[0x02]), 0x07); + KeyShuffled[0x03] = KeyShuffled[0x03] ^ Rol32((KeyShuffled[0x0A] + KeyShuffled[0x0E]), 0x09); + KeyShuffled[0x02] = KeyShuffled[0x02] ^ Rol32((KeyShuffled[0x03] + KeyShuffled[0x0A]), 0x0D); + KeyShuffled[0x0E] = KeyShuffled[0x0E] ^ Rol32((KeyShuffled[0x02] + KeyShuffled[0x03]), 0x12); + + KeyShuffled[0x07] = KeyShuffled[0x07] ^ Rol32((KeyShuffled[0x0C] + KeyShuffled[0x04]), 0x07); + KeyShuffled[0x06] = KeyShuffled[0x06] ^ Rol32((KeyShuffled[0x07] + KeyShuffled[0x0C]), 0x09); + KeyShuffled[0x04] = KeyShuffled[0x04] ^ Rol32((KeyShuffled[0x06] + KeyShuffled[0x07]), 0x0D); + KeyShuffled[0x0C] = KeyShuffled[0x0C] ^ Rol32((KeyShuffled[0x04] + KeyShuffled[0x06]), 0x12); + + KeyShuffled[0x0B] = KeyShuffled[0x0B] ^ Rol32((KeyShuffled[0x05] + KeyShuffled[0x01]), 0x07); + KeyShuffled[0x08] = KeyShuffled[0x08] ^ Rol32((KeyShuffled[0x0B] + KeyShuffled[0x05]), 0x09); + KeyShuffled[0x01] = KeyShuffled[0x01] ^ Rol32((KeyShuffled[0x08] + KeyShuffled[0x0B]), 0x0D); + KeyShuffled[0x05] = KeyShuffled[0x05] ^ Rol32((KeyShuffled[0x01] + KeyShuffled[0x08]), 0x12); + + KeyShuffled[0x09] = KeyShuffled[0x09] ^ Rol32((KeyShuffled[0x0F] + KeyShuffled[0x00]), 0x07); + KeyShuffled[0x0D] = KeyShuffled[0x0D] ^ Rol32((KeyShuffled[0x09] + KeyShuffled[0x0F]), 0x09); + KeyShuffled[0x00] = KeyShuffled[0x00] ^ Rol32((KeyShuffled[0x0D] + KeyShuffled[0x09]), 0x0D); + KeyShuffled[0x0F] = KeyShuffled[0x0F] ^ Rol32((KeyShuffled[0x00] + KeyShuffled[0x0D]), 0x12); + + KeyShuffled[0x04] = KeyShuffled[0x04] ^ Rol32((KeyShuffled[0x0E] + KeyShuffled[0x09]), 0x07); + KeyShuffled[0x08] = KeyShuffled[0x08] ^ Rol32((KeyShuffled[0x04] + KeyShuffled[0x0E]), 0x09); + KeyShuffled[0x09] = KeyShuffled[0x09] ^ Rol32((KeyShuffled[0x08] + KeyShuffled[0x04]), 0x0D); + KeyShuffled[0x0E] = KeyShuffled[0x0E] ^ Rol32((KeyShuffled[0x09] + KeyShuffled[0x08]), 0x12); + + KeyShuffled[0x01] = KeyShuffled[0x01] ^ Rol32((KeyShuffled[0x0C] + KeyShuffled[0x0A]), 0x07); + KeyShuffled[0x0D] = KeyShuffled[0x0D] ^ Rol32((KeyShuffled[0x01] + KeyShuffled[0x0C]), 0x09); + KeyShuffled[0x0A] = KeyShuffled[0x0A] ^ Rol32((KeyShuffled[0x0D] + KeyShuffled[0x01]), 0x0D); + KeyShuffled[0x0C] = KeyShuffled[0x0C] ^ Rol32((KeyShuffled[0x0A] + KeyShuffled[0x0D]), 0x12); + + KeyShuffled[0x00] = KeyShuffled[0x00] ^ Rol32((KeyShuffled[0x05] + KeyShuffled[0x07]), 0x07); + KeyShuffled[0x03] = KeyShuffled[0x03] ^ Rol32((KeyShuffled[0x00] + KeyShuffled[0x05]), 0x09); + KeyShuffled[0x07] = KeyShuffled[0x07] ^ Rol32((KeyShuffled[0x03] + KeyShuffled[0x00]), 0x0D); + KeyShuffled[0x05] = KeyShuffled[0x05] ^ Rol32((KeyShuffled[0x07] + KeyShuffled[0x03]), 0x12); + + KeyShuffled[0x02] = KeyShuffled[0x02] ^ Rol32((KeyShuffled[0x0F] + KeyShuffled[0x0B]), 0x07); + KeyShuffled[0x06] = KeyShuffled[0x06] ^ Rol32((KeyShuffled[0x02] + KeyShuffled[0x0F]), 0x09); + KeyShuffled[0x0B] = KeyShuffled[0x0B] ^ Rol32((KeyShuffled[0x06] + KeyShuffled[0x02]), 0x0D); + KeyShuffled[0x0F] = KeyShuffled[0x0F] ^ Rol32((KeyShuffled[0x0B] + KeyShuffled[0x06]), 0x12); + } + + // Decrypt one data chunk + BSWAP_ARRAY32_UNSIGNED(MpqData, MPQE_CHUNK_SIZE); + MpqData[0x00] = MpqData[0x00] ^ (KeyShuffled[0x0E] + KeyMirror[0x00]); + MpqData[0x01] = MpqData[0x01] ^ (KeyShuffled[0x04] + KeyMirror[0x0D]); + MpqData[0x02] = MpqData[0x02] ^ (KeyShuffled[0x08] + KeyMirror[0x0A]); + MpqData[0x03] = MpqData[0x03] ^ (KeyShuffled[0x09] + KeyMirror[0x07]); + MpqData[0x04] = MpqData[0x04] ^ (KeyShuffled[0x0A] + KeyMirror[0x04]); + MpqData[0x05] = MpqData[0x05] ^ (KeyShuffled[0x0C] + KeyMirror[0x01]); + MpqData[0x06] = MpqData[0x06] ^ (KeyShuffled[0x01] + KeyMirror[0x0E]); + MpqData[0x07] = MpqData[0x07] ^ (KeyShuffled[0x0D] + KeyMirror[0x0B]); + MpqData[0x08] = MpqData[0x08] ^ (KeyShuffled[0x03] + KeyMirror[0x08]); + MpqData[0x09] = MpqData[0x09] ^ (KeyShuffled[0x07] + KeyMirror[0x05]); + MpqData[0x0A] = MpqData[0x0A] ^ (KeyShuffled[0x05] + KeyMirror[0x02]); + MpqData[0x0B] = MpqData[0x0B] ^ (KeyShuffled[0x00] + KeyMirror[0x0F]); + MpqData[0x0C] = MpqData[0x0C] ^ (KeyShuffled[0x02] + KeyMirror[0x0C]); + MpqData[0x0D] = MpqData[0x0D] ^ (KeyShuffled[0x06] + KeyMirror[0x09]); + MpqData[0x0E] = MpqData[0x0E] ^ (KeyShuffled[0x0B] + KeyMirror[0x06]); + MpqData[0x0F] = MpqData[0x0F] ^ (KeyShuffled[0x0F] + KeyMirror[0x03]); + BSWAP_ARRAY32_UNSIGNED(MpqData, MPQE_CHUNK_SIZE); + + // Update byte offset in the key + KeyMirror[0x08]++; + if(KeyMirror[0x08] == 0) + KeyMirror[0x05]++; + + // Move pointers and decrease number of bytes to decrypt + MpqData += (MPQE_CHUNK_SIZE / sizeof(DWORD)); + dwLength -= MPQE_CHUNK_SIZE; + } +} + + +static bool DetectFileKey(TEncryptedStream * pStream) +{ + ULONGLONG ByteOffset = 0; + BYTE EncryptedHeader[MPQE_CHUNK_SIZE]; + BYTE FileHeader[MPQE_CHUNK_SIZE]; + + // Load the chunk from the file + if(!FileStream_Read(pStream, &ByteOffset, EncryptedHeader, sizeof(EncryptedHeader))) + return false; + + // We just try all known keys one by one + for(int i = 0; MpqKeyArray[i] != NULL; i++) + { + // Copy the key there + memcpy(pStream->Key, MpqKeyArray[i], MPQE_CHUNK_SIZE); + BSWAP_ARRAY32_UNSIGNED(pStream->Key, MPQE_CHUNK_SIZE); + + // Try to decrypt with the given key + memcpy(FileHeader, EncryptedHeader, MPQE_CHUNK_SIZE); + DecryptFileChunk((LPDWORD)FileHeader, pStream->Key, ByteOffset, MPQE_CHUNK_SIZE); + + // We check the decrypoted data + // All known encrypted MPQs have header at the begin of the file, + // so we check for MPQ signature there. + if(FileHeader[0] == 'M' && FileHeader[1] == 'P' && FileHeader[2] == 'Q') + return true; + } + + // Key not found, sorry + return false; +} + +static bool EncryptedFile_Read( + TEncryptedStream * pStream, // Pointer to an open stream + ULONGLONG * pByteOffset, // Pointer to file byte offset. If NULL, it reads from the current position + void * pvBuffer, // Pointer to data to be read + DWORD dwBytesToRead) // Number of bytes to read from the file +{ + ULONGLONG StartOffset; // Offset of the first byte to be read from the file + ULONGLONG ByteOffset; // Offset that the caller wants + ULONGLONG EndOffset; // End offset that is to be read from the file + DWORD dwBytesToAllocate; + DWORD dwBytesToDecrypt; + DWORD dwOffsetInCache; + LPBYTE pbMpqData = NULL; + bool bResult = false; + + // Get the byte offset + if(pByteOffset != NULL) + ByteOffset = *pByteOffset; + else + ByteOffset = pStream->RawFilePos; + + // Cut it down to MPQE chunk size + StartOffset = ByteOffset; + StartOffset = StartOffset & ~(MPQE_CHUNK_SIZE - 1); + EndOffset = ByteOffset + dwBytesToRead; + + // Calculate number of bytes to decrypt + dwBytesToDecrypt = (DWORD)(EndOffset - StartOffset); + dwBytesToAllocate = (dwBytesToDecrypt + (MPQE_CHUNK_SIZE - 1)) & ~(MPQE_CHUNK_SIZE - 1); + + // Allocate buffers for encrypted and decrypted data + pbMpqData = STORM_ALLOC(BYTE, dwBytesToAllocate); + if(pbMpqData) + { + // Get the offset of the desired data in the cache + dwOffsetInCache = (DWORD)(ByteOffset - StartOffset); + + // Read the file from the stream as-is + if(File_Read(pStream, &StartOffset, pbMpqData, dwBytesToDecrypt)) + { + // Decrypt the data + DecryptFileChunk((LPDWORD)pbMpqData, pStream->Key, StartOffset, dwBytesToAllocate); + + // Copy the decrypted data + memcpy(pvBuffer, pbMpqData + dwOffsetInCache, dwBytesToRead); + bResult = true; + } + else + { + assert(false); + } + + // Free decryption buffer + STORM_FREE(pbMpqData); + } + + // Free buffers and exit + return bResult; +} + +static bool EncryptedFile_Write( + TEncryptedStream * pStream, // Pointer to an open stream + ULONGLONG * pByteOffset, // Pointer to file byte offset. If NULL, it reads from the current position + const void * pvBuffer, // Pointer to data to be read + DWORD dwBytesToRead) // Number of bytes to read from the file +{ + // Keep compiler happy + dwBytesToRead = dwBytesToRead; + pByteOffset = pByteOffset; + pvBuffer = pvBuffer; + pStream = pStream; + + // Not allowed + return false; +} + +static bool EncryptedFile_SetSize( + TEncryptedStream * pStream, // Pointer to an open stream + ULONGLONG NewSize) // new size of the file +{ + // Keep compiler happy + pStream = pStream; + NewSize = NewSize; + + // Not allowed + return false; +} + +//----------------------------------------------------------------------------- +// Public functions + +/** + * This function creates a new file for read or read-write access + * + * - If the current platform supports file sharing, + * the file must be created for read sharing (i.e. another application + * can open the file for read, but not for write) + * - If the file does not exist, the function must create new one + * - If the file exists, the function must rewrite it and set to zero size + * - The parameters of the function must be validate by the caller + * - The function must initialize all stream function pointers in TFileStream + * - If the function fails from any reason, it must close all handles + * and free all memory that has been allocated in the process of stream creation, + * including the TFileStream structure itself + * + * \a szFileName Name of the file to create + */ + +TFileStream * FileStream_CreateFile( + const TCHAR * szFileName) // Name of the file to create +{ + TFileStream * pStream = NULL; + HANDLE hFile; + + // Create the file + hFile = CreateNewFile(szFileName); + if(hFile != INVALID_HANDLE_VALUE) + { + // Allocate the FileStream structure and fill it + pStream = STORM_ALLOC(TFileStream, 1); + if(pStream != NULL) + { + // Reset entire structure to zero + memset(pStream, 0, sizeof(TFileStream)); + + // Save file name and set function pointers + _tcscpy(pStream->szFileName, szFileName); + pStream->StreamGetPos = File_GetPos; + pStream->StreamRead = File_Read; + pStream->StreamWrite = File_Write; + pStream->StreamGetSize = File_GetSize; + pStream->StreamSetSize = File_SetSize; + pStream->hFile = hFile; + } + else + { + CloseTheFile(hFile); + } + } + + // Return the stream + return pStream; +} + +/** + * This function opens an existing file for read or read-write access + * - If the current platform supports file sharing, + * the file must be open for read sharing (i.e. another application + * can open the file for read, but not for write) + * - If the file does not exist, the function must return NULL + * - If the file exists but cannot be open, then function must return NULL + * - The parameters of the function must be validate by the caller + * - The function must check if the file is a PART file, + * and create TPartFileStream object if so. + * - The function must initialize all stream function pointers in TFileStream + * - If the function fails from any reason, it must close all handles + * and free all memory that has been allocated in the process of stream creation, + * including the TFileStream structure itself + * + * \a szFileName Name of the file to open + * \a bWriteAccess false for read only, true for read+write + */ + +TFileStream * FileStream_OpenRawFile( + const TCHAR * szFileName, // Name of the file to create + bool bWriteAccess) // false = read-only, true = read+write +{ + TFileStream * pStream; + HANDLE hFile; + + // Create the file + hFile = OpenExistingFile(szFileName, bWriteAccess); + if(hFile == INVALID_HANDLE_VALUE) + return NULL; + + // Initialize the file as normal file stream + pStream = STORM_ALLOC(TFileStream, 1); + if(pStream != NULL) + { + // Reset entire structure to zero + memset(pStream, 0, sizeof(TFileStream)); + + // Save file name and set function pointers + _tcscpy(pStream->szFileName, szFileName); + pStream->StreamGetPos = File_GetPos; + pStream->StreamRead = File_Read; + pStream->StreamWrite = File_Write; + pStream->StreamGetSize = File_GetSize; + pStream->StreamSetSize = File_SetSize; + if(bWriteAccess == false) + pStream->StreamFlags |= STREAM_FLAG_READ_ONLY; + pStream->hFile = hFile; + return pStream; + } + + CloseTheFile(hFile); + return NULL; +} + +/** + * Opens a file + * + * \a szFileName Name of the file to open + * \a bWriteAccess false for read only, true for read+write + */ + +TFileStream * FileStream_OpenFile(const TCHAR * szFileName, bool bWriteAccess) +{ + PART_FILE_HEADER PartHdr; + ULONGLONG VirtualSize; // Size of the file stored in part file + ULONGLONG ByteOffset = {0}; + TFileStream * pStream; + size_t nStructLength; + DWORD BlockCount; + + // Open the file as normal stream + pStream = FileStream_OpenRawFile(szFileName, bWriteAccess); + if(pStream == NULL) + return NULL; + + // Attempt to read PART file header + if(FileStream_Read(pStream, &ByteOffset, &PartHdr, sizeof(PART_FILE_HEADER))) + { + // We need to swap PART file header on big-endian platforms + BSWAP_PART_HEADER(&PartHdr); + + // Verify the PART file header + if(IsPartHeader(&PartHdr)) + { + TPartFileStream * pPartStream; + + // Calculate the number of parts in the file + VirtualSize = MAKE_OFFSET64(PartHdr.FileSizeHi, PartHdr.FileSizeLo); + BlockCount = (DWORD)((VirtualSize + PartHdr.BlockSize - 1) / PartHdr.BlockSize); + + // Calculate the size of the entire structure + // Note that we decrement number of parts by one, + // because there already is one entry in the TPartFileStream structure + nStructLength = sizeof(TPartFileStream) + (BlockCount - 1) * sizeof(PART_FILE_MAP_ENTRY); + pPartStream = (TPartFileStream *)STORM_ALLOC(char, nStructLength); + if(pPartStream != NULL) + { + // Initialize the part file stream + memset(pPartStream, 0, nStructLength); + memcpy(pPartStream, pStream, sizeof(TFileStream)); + + // Load the block map + if(!FileStream_Read(pPartStream, NULL, pPartStream->PartMap, BlockCount * sizeof(PART_FILE_MAP_ENTRY))) + { + FileStream_Close(pStream); + STORM_FREE(pPartStream); + return NULL; + } + + // Swap the array of file map entries + BSWAP_ARRAY32_UNSIGNED(pPartStream->PartMap, BlockCount * sizeof(PART_FILE_MAP_ENTRY)); + + // Set new function pointers + pPartStream->StreamGetPos = (STREAM_GETPOS)PartFile_GetPos; + pPartStream->StreamRead = (STREAM_READ)PartFile_Read; + pPartStream->StreamWrite = (STREAM_WRITE)PartFile_Write; + pPartStream->StreamGetSize = (STREAM_GETSIZE)PartFile_GetSize; + pPartStream->StreamSetSize = (STREAM_SETSIZE)PartFile_SetSize; + pPartStream->StreamFlags |= (STREAM_FLAG_READ_ONLY | STREAM_FLAG_PART_FILE); + + // Fill the members of PART file stream + pPartStream->VirtualSize = ((ULONGLONG)PartHdr.FileSizeHi) + PartHdr.FileSizeLo; + pPartStream->VirtualPos = 0; + pPartStream->BlockCount = BlockCount; + pPartStream->BlockSize = PartHdr.BlockSize; + + STORM_FREE(pStream); + } + return pPartStream; + } + } + + // If the file doesn't contain PART file header, + // reset the file position to begin of the file + FileStream_Read(pStream, &ByteOffset, NULL, 0); + return pStream; +} + +TFileStream * FileStream_OpenEncrypted(const TCHAR * szFileName) +{ + TEncryptedStream * pEncryptedStream; + TFileStream * pStream; + + // Open the file as raw stream + pStream = FileStream_OpenRawFile(szFileName, false); + if(pStream) + { + // Allocate new stream for handling encryption + pEncryptedStream = STORM_ALLOC(TEncryptedStream, 1); + if(pEncryptedStream != NULL) + { + // Copy the file stream to the encrypted stream + memset(pEncryptedStream, 0, sizeof(TEncryptedStream)); + memcpy(pEncryptedStream, pStream, sizeof(TFileStream)); + + // Assign functions + pEncryptedStream->StreamRead = (STREAM_READ)EncryptedFile_Read; + pEncryptedStream->StreamWrite = (STREAM_WRITE)EncryptedFile_Write; + pEncryptedStream->StreamSetSize = (STREAM_SETSIZE)EncryptedFile_SetSize; + pEncryptedStream->StreamFlags |= (STREAM_FLAG_READ_ONLY | STREAM_FLAG_ENCRYPTED_FILE); + + // Get the file key + if(DetectFileKey(pEncryptedStream)) + return pEncryptedStream; + + // Close the encrypted stream + STORM_FREE(pEncryptedStream); + pEncryptedStream = NULL; + } + + FileStream_Close(pStream); + pStream = NULL; + } + + SetLastError(ERROR_UNKNOWN_FILE_KEY); + return NULL; +} + +/** + * This function returns the current file position + * \a pStream + * \a ByteOffset + */ +bool FileStream_GetPos(TFileStream * pStream, ULONGLONG & ByteOffset) +{ + assert(pStream->StreamGetPos != NULL); + return pStream->StreamGetPos(pStream, ByteOffset); +} + +/** + * Reads data from the stream + * + * - Returns true if the read operation succeeded and all bytes have been read + * - Returns false if either read failed or not all bytes have been read + * - If the pByteOffset is NULL, the function must read the data from the current file position + * - The function can be called with dwBytesToRead = 0. In that case, pvBuffer is ignored + * and the function just adjusts file pointer. + * + * \a pStream Pointer to an open stream + * \a pByteOffset Pointer to file byte offset. If NULL, it reads from the current position + * \a pvBuffer Pointer to data to be read + * \a dwBytesToRead Number of bytes to read from the file + * + * \returns + * - If the function reads the required amount of bytes, it returns true. + * - If the function reads less than required bytes, it returns false and GetLastError() returns ERROR_HANDLE_EOF + * - If the function fails, it reads false and GetLastError() returns an error code different from ERROR_HANDLE_EOF + */ +bool FileStream_Read(TFileStream * pStream, ULONGLONG * pByteOffset, void * pvBuffer, DWORD dwBytesToRead) +{ + assert(pStream->StreamRead != NULL); + return pStream->StreamRead(pStream, pByteOffset, pvBuffer, dwBytesToRead); +} + +/** + * This function writes data to the stream + * + * - Returns true if the write operation succeeded and all bytes have been written + * - Returns false if either write failed or not all bytes have been written + * - If the pByteOffset is NULL, the function must write the data to the current file position + * + * \a pStream Pointer to an open stream + * \a pByteOffset Pointer to file byte offset. If NULL, it reads from the current position + * \a pvBuffer Pointer to data to be written + * \a dwBytesToWrite Number of bytes to write to the file + */ +bool FileStream_Write(TFileStream * pStream, ULONGLONG * pByteOffset, const void * pvBuffer, DWORD dwBytesToWrite) +{ + if(pStream->StreamFlags & STREAM_FLAG_READ_ONLY) + return false; + assert(pStream->StreamWrite != NULL); + + return pStream->StreamWrite(pStream, pByteOffset, pvBuffer, dwBytesToWrite); +} + + +/** + * Returns the last write time of a file + * + * \a pStream Pointer to an open stream + * \a pFileType Pointer where to store the file last write time + */ +bool FileStream_GetLastWriteTime(TFileStream * pStream, ULONGLONG * pFileTime) +{ +#ifdef PLATFORM_WINDOWS + FILETIME ft; + + if(!GetFileTime(pStream->hFile, NULL, NULL, &ft)) + return false; + + *pFileTime = MAKE_OFFSET64(ft.dwHighDateTime, ft.dwLowDateTime); + return true; +#endif + +#ifdef PLATFORM_MAC + OSErr theErr; + FSRef theFileRef; + FSCatalogInfo theCatInfo; + + theErr = FSGetForkCBInfo((short)(long)pStream->hFile, 0, NULL, NULL, NULL, &theFileRef, NULL); + if(theErr != noErr) + { + nLastError = theErr; + return false; + } + + theErr = FSGetCatalogInfo(&theFileRef, kFSCatInfoContentMod, &theCatInfo, NULL, NULL, NULL); + if(theErr != noErr) + { + nLastError = theErr; + return false; + } + + ConvertUTCDateTimeToFileTime(&theCatInfo.contentModDate, pFileTime); + return true; +#endif + +#ifdef PLATFORM_LINUX + struct stat file_stats; + + if(fstat((int)(size_t)pStream->hFile, &file_stats) == -1) + { + nLastError = errno; + return false; + } + + ConvertTimeTToFileTime(pFileTime, file_stats.st_mtime); + return true; +#endif +} + +/** + * Returns the size of a file + * + * \a pStream Pointer to an open stream + * \a FileSize Pointer where to store the file size + */ +bool FileStream_GetSize(TFileStream * pStream, ULONGLONG & FileSize) +{ + assert(pStream->StreamGetSize != NULL); + return pStream->StreamGetSize(pStream, FileSize); +} + +/** + * Sets the size of a file + * + * \a pStream Pointer to an open stream + * \a NewFileSize File size to set + */ +bool FileStream_SetSize(TFileStream * pStream, ULONGLONG NewFileSize) +{ + if(pStream->StreamFlags & STREAM_FLAG_READ_ONLY) + return false; + assert(pStream->StreamSetSize != NULL); + + return pStream->StreamSetSize(pStream, NewFileSize); +} + +/** + * Switches a stream with another. Used for final phase of archive compacting. + * Performs these steps: + * + * 1) Closes the handle to the existing MPQ + * 2) Renames the temporary MPQ to the original MPQ, overwrites existing one + * 3) Opens the MPQ stores the handle and stream position to the new stream structure + * + * \a pStream Pointer to an open stream + * \a pTempStream Temporary ("working") stream (created during archive compacting) + */ +bool FileStream_MoveFile(TFileStream * pStream, TFileStream * pTempStream) +{ + bool bWriteAccess; + + // Close the handle to the temporary file + CloseTheFile(pTempStream->hFile); + pTempStream->hFile = INVALID_HANDLE_VALUE; + + // Close the handle to the source file + CloseTheFile(pStream->hFile); + pStream->hFile = INVALID_HANDLE_VALUE; + + // Rename the temp file to the final file + if(!RenameFile(pTempStream->szFileName, pStream->szFileName)) + return false; + + // Now open the renamed file again, and store its handle to the old stream + bWriteAccess = (pStream->StreamFlags & STREAM_FLAG_READ_ONLY) ? false : true; + pStream->hFile = OpenExistingFile(pStream->szFileName, bWriteAccess); + if(pStream->hFile == INVALID_HANDLE_VALUE) + return false; + + // Delete the temporary file stream + FileStream_Close(pTempStream); + + // The file position has been reset to zero by reopening the file + pStream->RawFilePos = 0; + return true; +} + +/** + * This function closes an archive file and frees any data buffers + * that have been allocated for stream management. The function must also + * support partially allocated structure, i.e. one or more buffers + * can be NULL, if there was an allocation failure during the process + * + * \a pStream Pointer to an open stream + */ +void FileStream_Close(TFileStream * pStream) +{ + // Check if the stream structure is allocated at all + if(pStream != NULL) + { + // Close the file handle + if(pStream->hFile != INVALID_HANDLE_VALUE) + CloseTheFile(pStream->hFile); + + // Free the stream itself + STORM_FREE(pStream); + } +} + +//----------------------------------------------------------------------------- +// main - for testing purposes +/* +int main(void) +{ + ULONGLONG FilePos; + ULONGLONG FileSize; + TMPQFileTime * pFT; + TFileStream * pTempStream; + TFileStream * pStream; + TMPQBlock * pBlock; + TMPQHash * pHash; + TMPQHeader2 MpqHeader; + char szString1[100] = "This is a single line\n\r"; + char szString2[100]; + char Buffer[0x80]; + DWORD dwLength = strlen(szString1); + + // + // Test 1: Write to a stream + // + + pStream = FileStream_CreateFile("E:\\Stream.bin"); + if(pStream == NULL) + { + printf("Failed to create new file\n"); + return -1; + } + + for(int i = 0; i < 10; i++) + { + if(!FileStream_Write(pStream, NULL, szString1, dwLength)) + { + printf("Failed to write to the stream\n"); + return -1; + } + } + FileStream_Close(pStream); + + // + // Test2: Read from the stream + // + + pStream = FileStream_OpenFile("E:\\Stream.bin", false); + if(pStream == NULL) + { + printf("Failed to open existing file\n"); + return -1; + } + + // This call must end with an error + if(FileStream_Write(pStream, NULL, "aaa", 3)) + { + printf("Write succeeded while it should fail\n"); + return -1; + } + + for(int i = 0; i < 10; i++) + { + if(!FileStream_Read(pStream, NULL, szString2, dwLength)) + { + printf("Failed to read from the stream\n"); + return -1; + } + + szString2[dwLength] = 0; + if(strcmp(szString1, szString2)) + { + printf("Data read from file are different from data written\n"); + return -1; + } + } + FileStream_Close(pStream); + + // + // Test3: Open the temp stream, write some data and switch it to the original stream + // + + pStream = FileStream_OpenFile("E:\\Stream.bin", false); + if(pStream == NULL) + { + printf("Failed to open existing file\n"); + return -1; + } + + pTempStream = FileStream_CreateFile("E:\\TempStream.bin"); + if(pTempStream == NULL) + { + printf("Failed to create temp stream\n"); + return -1; + } + + // Copy the original stream to the temp + if(!FileStream_GetSize(pStream, &FileSize)) + { + printf("Failed to get the file size\n"); + return -1; + } + + while(FileSize.QuadPart != 0) + { + DWORD dwBytesToRead = FileSize.LowPart; + + if(dwBytesToRead > sizeof(Buffer)) + dwBytesToRead = sizeof(Buffer); + + if(!FileStream_Read(pStream, NULL, Buffer, dwBytesToRead)) + { + printf("CopyStream: Read source file failed\n"); + return -1; + } + + if(!FileStream_Write(pTempStream, NULL, Buffer, dwBytesToRead)) + { + printf("CopyStream: Write target file failed\n"); + return -1; + } + + FileSize.QuadPart -= dwBytesToRead; + } + + // Switch the streams + // Note that the pTempStream is closed by the operation + FileStream_MoveFile(pStream, pTempStream); + FileStream_Close(pStream); + + // + // Test4: Read from the stream again + // + + pStream = FileStream_OpenFile("E:\\Stream.bin", false); + if(pStream == NULL) + { + printf("Failed to open existing file\n"); + return -1; + } + + for(int i = 0; i < 10; i++) + { + if(!FileStream_Read(pStream, NULL, szString2, dwLength)) + { + printf("Failed to read from the stream\n"); + return -1; + } + + szString2[dwLength] = 0; + if(strcmp(szString1, szString2)) + { + printf("Data read from file are different from data written\n"); + return -1; + } + } + FileStream_Close(pStream); + + // + // Test5: Open partial MPQ stream + // + +// InitializeMpqCryptography(); + pStream = FileStream_OpenFile("e:\\Multimedia\\MPQs\\PartialMPQs\\patch.MPQ.part", false); + if(pStream != NULL) + { + // Read the MPQ header + FileStream_Read(pStream, NULL, &MpqHeader, MPQ_HEADER_SIZE_V2); + + // Read the hash table + pHash = STORM_ALLOC(TMPQHash, MpqHeader.dwHashTableSize); + FilePos.HighPart = 0; + FilePos.LowPart = MpqHeader.dwHashTablePos; + FileStream_Read(pStream, &FilePos, pHash, MpqHeader.dwHashTableSize * sizeof(TMPQHash)); + + // + // At this point, the encrypted hash table should be like this: + // + // 416c7175 5ddfb61b 84bb75c8 c0399515 + // a9793eca 9ec773d7 ed8a54d6 74fb2adf + // 6acd4ae5 b13816b5 ffad2341 2f2b2a54 + // 614339c7 5fd0adf0 62434e91 d62439e3 + // 8f317aa5 f12706d6 bd83d2ca 97d7f108 + // 7586d373 51d85b05 8540beca f37ef3d7 + // d931d4d6 d592aadf 9044e960 c4592e92 + // 47dc03f7 0982dea4 afb31943 7c3c7cec + // 0c28fd0d bcbfb7df 4d13b6e4 b5b0ef31 + // e1a33b70 ec30e4b9 7aaa5e7a fb6d46ec + // 61732791 55fe757e 8ba18b5d d5f93246 + // 6d275f38 a89b5781 c34189a9 654c6472 + // 07e1d4e1 814bc8ee c72d2730 815afd43 + // 40bd2a92 640a9391 d868f813 0f61b73d + // 6d202746 2c5124ca 65db3ad0 5b1c3e39 + // b731013c 73776405 eac0c746 6e50c938 + // a4a7fd00 56db3805 6d6dbab7 44fed28a + // 2383394b bf617bdd a3edfaa2 e7d3aaaf + // + + // Decrypt the hash table +// DecryptMpqBlock(pHash, MpqHeader.dwHashTableSize * sizeof(TMPQHash), MPQ_KEY_HASH_TABLE); + + // + // At this point, the hash table should be like this: + // + // c750beb9 72c2538a 00000000 00000466 + // ffffffff ffffffff ffffffff ffffffff + // 898fdc7a 18963b5d 00000000 000005e1 + // ffffffff ffffffff ffffffff ffffffff + // e3c6fc32 d8afff2b 00000000 000001ea + // ffffffff ffffffff ffffffff ffffffff + // ffffffff ffffffff ffffffff ffffffff + // ffffffff ffffffff ffffffff ffffffff + // ffffffff ffffffff ffffffff ffffffff + // ffffffff ffffffff ffffffff ffffffff + // ffffffff ffffffff ffffffff ffffffff + // 0fa4fd60 3fbe8626 00000000 0000076f + // 9ee5bccf 031b277b 00000000 0000095c + // f4e154c5 0aadd1c1 00000000 00000876 + // 9e1ce9e7 e12d575d 00000000 0000071d + // + + // Read the block table + pBlock = STORM_ALLOC(TMPQBlock, MpqHeader.dwBlockTableSize); + FilePos.HighPart = 0; + FilePos.LowPart = MpqHeader.dwBlockTablePos; + FileStream_Read(pStream, &FilePos, pBlock, MpqHeader.dwBlockTableSize * sizeof(TMPQBlock)); + + // + // At this point, the encrypted block table should be like this: + // + // 3d4867a7 ca0f533e f82c54d6 ed3c9dec + // d8d607dc d9ad13ab f4588b46 8d058704 + // e8084fc8 63bc8064 b058c777 3683e9e3 + // 6c0da998 7703be0d 91ce3607 c14e29b9 + // 481b5c0d 42d902d2 8302acb7 e8f3e715 + // c9cdfc91 7cc38c15 ea3dfd22 ad20c856 + // b6450c7f 08522866 4cedb064 e03e3a86 + // 4509c7cc ddffbfc3 82fc8c66 e82a4424 + // afc4a982 23169037 5af6a3e2 34e1d24e + // 362c9e34 846cfc3d 4c611fcd d645fe8f + // f4061640 6d08d196 f330a975 66e30993 + // fd96a033 2b16def6 62ff30af 3e190b0b + // 664a5b91 b8558235 fd631825 a7807be7 + // ec906b9b 76d8b32e 36f3ea0b 1b0f5391 + // + + // Decrypt the block table +// DecryptMpqBlock(pBlock, MpqHeader.dwBlockTableSize * sizeof(TMPQBlock), MPQ_KEY_BLOCK_TABLE); + + // + // At this point, the block table should be like this: + // + // 0000002c 00078093 00116824 84000200 + // 000780bf 000002d5 00008044 84000200 + // 00078394 00001516 0000874c 84000200 + // 000798aa 00003797 0000af4e 84000200 + // 0007d041 000001db 00008044 84000200 + // 0007d21c 0000005e 0000005e 84000200 + // 0007d27a 000022fb 00009674 84000200 + // 0007f575 00002389 00009c64 84000200 + // 000818fe 000023cb 00009d58 84000200 + // 00083cc9 000024d9 0000a0d8 84000200 + // 000861a2 00002356 00009c70 84000200 + // 000884f8 000023d3 00009da4 84000200 + // 0008a8cb 000022d6 00009cd4 84000200 + // 0008cba1 00002339 00009714 84000200 + // 0008eeda 000023dc 00009b24 84000200 + // 000912b6 00002481 00009eac 84000200 + // 00093737 00002444 0000a028 84000200 + // 00095b7b 00002440 00009fc4 84000200 + // + + FileStream_Close(pStream); + } + + return 0; +} +*/ diff --git a/dep/StormLib/src/SBaseCommon.cpp b/dep/StormLib/src/SBaseCommon.cpp new file mode 100644 index 00000000000..9db708a2fe7 --- /dev/null +++ b/dep/StormLib/src/SBaseCommon.cpp @@ -0,0 +1,1668 @@ +/*****************************************************************************/ +/* SBaseCommon.cpp Copyright (c) Ladislav Zezula 2003 */ +/*---------------------------------------------------------------------------*/ +/* Common functions for StormLib, used by all SFile*** modules */ +/*---------------------------------------------------------------------------*/ +/* Date Ver Who Comment */ +/* -------- ---- --- ------- */ +/* 24.03.03 1.00 Lad The first version of SFileCommon.cpp */ +/* 19.11.03 1.01 Dan Big endian handling */ +/* 12.06.04 1.01 Lad Renamed to SCommon.cpp */ +/* 06.09.10 1.01 Lad Renamed to SBaseCommon.cpp */ +/*****************************************************************************/ + +#define __STORMLIB_SELF__ +#include "StormLib.h" +#include "StormCommon.h" + +char StormLibCopyright[] = "StormLib v " STORMLIB_VERSION_STRING " Copyright Ladislav Zezula 1998-2011"; + +//----------------------------------------------------------------------------- +// The buffer for decryption engine. + +DWORD dwGlobalFlags = 0; // Global flags +LCID lcFileLocale = LANG_NEUTRAL; // File locale +USHORT wPlatform = 0; // File platform + +//----------------------------------------------------------------------------- +// Storm buffer functions + +#define STORM_BUFFER_SIZE 0x500 + +static DWORD StormBuffer[STORM_BUFFER_SIZE]; // Buffer for the decryption engine +static bool bMpqCryptographyInitialized = false; + +DWORD HashString(const char * szFileName, DWORD dwHashType) +{ + LPBYTE pbKey = (BYTE *)szFileName; + DWORD dwSeed1 = 0x7FED7FED; + DWORD dwSeed2 = 0xEEEEEEEE; + DWORD ch; + + while(*pbKey != 0) + { + ch = toupper(*pbKey++); + + dwSeed1 = StormBuffer[dwHashType + ch] ^ (dwSeed1 + dwSeed2); + dwSeed2 = ch + dwSeed1 + dwSeed2 + (dwSeed2 << 5) + 3; + } + + return dwSeed1; +} + +void InitializeMpqCryptography() +{ + DWORD dwSeed = 0x00100001; + DWORD index1 = 0; + DWORD index2 = 0; + int i; + + // Initialize the decryption buffer. + // Do nothing if already done. + if(bMpqCryptographyInitialized == false) + { + for(index1 = 0; index1 < 0x100; index1++) + { + for(index2 = index1, i = 0; i < 5; i++, index2 += 0x100) + { + DWORD temp1, temp2; + + dwSeed = (dwSeed * 125 + 3) % 0x2AAAAB; + temp1 = (dwSeed & 0xFFFF) << 0x10; + + dwSeed = (dwSeed * 125 + 3) % 0x2AAAAB; + temp2 = (dwSeed & 0xFFFF); + + StormBuffer[index2] = (temp1 | temp2); + } + } + + // Also register both MD5 and SHA1 hash algorithms + register_hash(&md5_desc); + register_hash(&sha1_desc); + + // Use LibTomMath as support math library for LibTomCrypt + ltc_mp = ltm_desc; + + // Don't do that again + bMpqCryptographyInitialized = true; + } +} + +//----------------------------------------------------------------------------- +// Calculates the hash table size for a given amount of files + +DWORD GetHashTableSizeForFileCount(DWORD dwFileCount) +{ + DWORD dwPowerOfTwo; + + // Round the hash table size up to the nearest power of two + for(dwPowerOfTwo = HASH_TABLE_SIZE_MIN; dwPowerOfTwo < HASH_TABLE_SIZE_MAX; dwPowerOfTwo <<= 1) + { + if(dwPowerOfTwo >= dwFileCount) + { + return dwPowerOfTwo; + } + } + + // Don't allow the hash table size go over allowed maximum + return HASH_TABLE_SIZE_MAX; +} + +//----------------------------------------------------------------------------- +// Calculates a Jenkin's Encrypting and decrypting MPQ file data + +ULONGLONG HashStringJenkins(const char * szFileName) +{ + char * szTemp; + char szLocFileName[0x108]; + char chOneChar; + size_t nLength = 0; + unsigned int primary_hash = 1; + unsigned int secondary_hash = 2; + + // This is required to produce defined results + assert(szFileName != NULL); + + // Normalize the file name - convert to uppercase, and convert "/" to "\\". + if(szFileName != NULL) + { + szTemp = szLocFileName; + while(*szFileName != 0) + { + chOneChar = (char)tolower(*szFileName++); + if(chOneChar == '/') + chOneChar = '\\'; + + *szTemp++ = chOneChar; + } + + nLength = szTemp - szLocFileName; + *szTemp = 0; + } + + // Thanks Quantam for finding out what the algorithm is. + // I am really getting old for reversing large chunks of assembly + // that does hashing :-) + hashlittle2(szLocFileName, nLength, &secondary_hash, &primary_hash); + + // Combine those 2 together + return (ULONGLONG)primary_hash * (ULONGLONG)0x100000000ULL + (ULONGLONG)secondary_hash; +} + +//----------------------------------------------------------------------------- +// This function converts the MPQ header so it always looks like version 4 + +int ConvertMpqHeaderToFormat4( + TMPQArchive * ha, + ULONGLONG FileSize, + DWORD dwFlags) +{ + ULONGLONG ByteOffset; + TMPQHeader * pHeader = ha->pHeader; + DWORD dwExpectedArchiveSize; + USHORT wFormatVersion = pHeader->wFormatVersion; + int nError = ERROR_SUCCESS; + + // If version 1.0 is forced, then the format version is forced to be 1.0 + // Reason: Storm.dll in Warcraft III ignores format version value + if(dwFlags & MPQ_OPEN_FORCE_MPQ_V1) + wFormatVersion = MPQ_FORMAT_VERSION_1; + + // Format-specific fixes + switch(wFormatVersion) + { + case MPQ_FORMAT_VERSION_1: + + // Check for malformed MPQ header version 1.0 + if(pHeader->dwHeaderSize != MPQ_HEADER_SIZE_V1) + { + pHeader->dwHeaderSize = MPQ_HEADER_SIZE_V1; + ha->dwFlags |= MPQ_FLAG_PROTECTED; + } + + // + // The value of "dwArchiveSize" member in the MPQ header + // is ignored by Storm.dll and can contain garbage value + // ("w3xmaster" protector). + // + + dwExpectedArchiveSize = (DWORD)(FileSize - ha->MpqPos); + if(pHeader->dwArchiveSize != dwExpectedArchiveSize) + { + // Note: dwExpectedArchiveSize might be incorrect at this point. + // MPQs version 1.0 can have strong digital signature appended at the end, + // or they might just have arbitrary data there. + // In either case, we recalculate the archive size later when + // block table is loaded and positions of all files is known. + pHeader->dwArchiveSize = dwExpectedArchiveSize; + ha->dwFlags |= MPQ_FLAG_NEED_FIX_SIZE; + } + + // Zero the fields in 2.0 part of the MPQ header + pHeader->HiBlockTablePos64 = 0; + pHeader->wHashTablePosHi = 0; + pHeader->wBlockTablePosHi = 0; + // No break here !!! + + case MPQ_FORMAT_VERSION_2: + case MPQ_FORMAT_VERSION_3: + + // In MPQ format 3.0, the entire header is optional + // and the size of the header can actually be identical + // to size of header 2.0 + if(pHeader->dwHeaderSize < MPQ_HEADER_SIZE_V3) + { + ULONGLONG ArchiveSize64 = pHeader->dwArchiveSize; + + // In format 2.0, the archive size is obsolete and is calculated + // as the highest offset of hash table, block table or hi-block table. + // However, we can still rely on it, if the size of the archive is under 4 GB + if((FileSize - ha->MpqPos) >> 32) + { + ByteOffset = MAKE_OFFSET64(pHeader->wHashTablePosHi, pHeader->dwHashTablePos) + (pHeader->dwHashTableSize * sizeof(TMPQHash)); + if(ByteOffset > ArchiveSize64) + ArchiveSize64 = ByteOffset; + + ByteOffset = MAKE_OFFSET64(pHeader->wBlockTablePosHi, pHeader->dwBlockTablePos) + (pHeader->dwBlockTableSize * sizeof(TMPQBlock)); + if(ByteOffset > ArchiveSize64) + ArchiveSize64 = ByteOffset; + + // Only if we actually have a hi-block table + if(pHeader->HiBlockTablePos64) + { + ByteOffset = pHeader->HiBlockTablePos64 + (pHeader->dwBlockTableSize * sizeof(USHORT)); + if(ByteOffset > ArchiveSize64) + ArchiveSize64 = ByteOffset; + } + + // We need to recalculate archive size later, + // when block table is loaded and the position of files is known + ha->dwFlags |= MPQ_FLAG_NEED_FIX_SIZE; + } + + // Initialize the rest of the 3.0 header + pHeader->ArchiveSize64 = ArchiveSize64; + pHeader->HetTablePos64 = 0; + pHeader->BetTablePos64 = 0; + } + + // + // Calculate compressed size of each table. We assume the following order: + // 1) HET table + // 2) BET table + // 3) Classic hash table + // 4) Classic block table + // 5) Hi-block table + // + + // Set all sizes to zero + pHeader->HetTableSize64 = 0; + pHeader->BetTableSize64 = 0; + + // Either both HET and BET table exist or none of them does. + if(pHeader->HetTablePos64) + { + // Compressed size of the HET and BET tables + pHeader->HetTableSize64 = pHeader->BetTablePos64 - pHeader->HetTablePos64; + pHeader->BetTableSize64 = MAKE_OFFSET64(pHeader->wHashTablePosHi, pHeader->dwHashTablePos) - pHeader->HetTablePos64; + } + + // Compressed size of hash and block table + if(wFormatVersion >= MPQ_FORMAT_VERSION_2) + { + // Compressed size of the hash table + pHeader->HashTableSize64 = MAKE_OFFSET64(pHeader->wBlockTablePosHi, pHeader->dwBlockTablePos) - MAKE_OFFSET64(pHeader->wHashTablePosHi, pHeader->dwHashTablePos); + + // Block and hi-block table + if(pHeader->HiBlockTablePos64) + { + pHeader->BlockTableSize64 = pHeader->HiBlockTablePos64 - MAKE_OFFSET64(pHeader->wBlockTablePosHi, pHeader->dwBlockTablePos); + pHeader->HiBlockTableSize64 = pHeader->ArchiveSize64 - pHeader->HiBlockTablePos64; + } + else + { + pHeader->BlockTableSize64 = pHeader->ArchiveSize64 - MAKE_OFFSET64(pHeader->wBlockTablePosHi, pHeader->dwBlockTablePos); + pHeader->HiBlockTableSize64 = 0; + } + } + else + { + // No known MPQ in format 1.0 has any of the tables compressed + pHeader->HashTableSize64 = pHeader->dwHashTableSize * sizeof(TMPQHash); + pHeader->BlockTableSize64 = pHeader->dwBlockTableSize * sizeof(TMPQBlock); + pHeader->HiBlockTableSize64 = 0; + } + + // Set the data chunk size for MD5 to zero + pHeader->dwRawChunkSize = 0; + + // Fill the MD5's + memset(pHeader->MD5_BlockTable, 0, MD5_DIGEST_SIZE); + memset(pHeader->MD5_HashTable, 0, MD5_DIGEST_SIZE); + memset(pHeader->MD5_HiBlockTable, 0, MD5_DIGEST_SIZE); + memset(pHeader->MD5_BetTable, 0, MD5_DIGEST_SIZE); + memset(pHeader->MD5_HetTable, 0, MD5_DIGEST_SIZE); + memset(pHeader->MD5_MpqHeader, 0, MD5_DIGEST_SIZE); + // No break here !!!! + + case MPQ_FORMAT_VERSION_4: + + // Verify header MD5. Header MD5 is calculated from the MPQ header since the 'MPQ\x1A' + // signature until the position of header MD5 at offset 0xC0 + if(!VerifyDataBlockHash(ha->pHeader, MPQ_HEADER_SIZE_V4 - MD5_DIGEST_SIZE, ha->pHeader->MD5_MpqHeader)) + nError = ERROR_FILE_CORRUPT; + break; + } + + return nError; +} + +//----------------------------------------------------------------------------- +// Encrypting and decrypting MPQ file data + +void EncryptMpqBlock(void * pvFileBlock, DWORD dwLength, DWORD dwSeed1) +{ + LPDWORD block = (LPDWORD)pvFileBlock; + DWORD dwSeed2 = 0xEEEEEEEE; + DWORD ch; + + // Round to DWORDs + dwLength >>= 2; + + while(dwLength-- > 0) + { + dwSeed2 += StormBuffer[0x400 + (dwSeed1 & 0xFF)]; + ch = *block; + *block++ = ch ^ (dwSeed1 + dwSeed2); + + dwSeed1 = ((~dwSeed1 << 0x15) + 0x11111111) | (dwSeed1 >> 0x0B); + dwSeed2 = ch + dwSeed2 + (dwSeed2 << 5) + 3; + } +} + +void DecryptMpqBlock(void * pvFileBlock, DWORD dwLength, DWORD dwSeed1) +{ + LPDWORD block = (LPDWORD)pvFileBlock; + DWORD dwSeed2 = 0xEEEEEEEE; + DWORD ch; + + // Round to DWORDs + dwLength >>= 2; + + while(dwLength-- > 0) + { + dwSeed2 += StormBuffer[0x400 + (dwSeed1 & 0xFF)]; + ch = *block ^ (dwSeed1 + dwSeed2); + + dwSeed1 = ((~dwSeed1 << 0x15) + 0x11111111) | (dwSeed1 >> 0x0B); + dwSeed2 = ch + dwSeed2 + (dwSeed2 << 5) + 3; + *block++ = ch; + } +} + +/* +void EncryptMpqTable(void * pvMpqTable, DWORD dwLength, const char * szKey) +{ + EncryptMpqBlock(pvMpqTable, dwLength, HashString(szKey, MPQ_HASH_FILE_KEY)); +} + +void DecryptMpqTable(void * pvMpqTable, DWORD dwLength, const char * szKey) +{ + DecryptMpqBlock(pvMpqTable, dwLength, HashString(szKey, MPQ_HASH_FILE_KEY)); +} +*/ + +/** + * Functions tries to get file decryption key. The trick comes from sector + * positions which are stored at the begin of each compressed file. We know the + * file size, that means we know number of sectors that means we know the first + * DWORD value in sector position. And if we know encrypted and decrypted value, + * we can find the decryption key !!! + * + * hf - MPQ file handle + * SectorOffsets - DWORD array of sector positions + * ch - Decrypted value of the first sector pos + */ + +DWORD DetectFileKeyBySectorSize(LPDWORD SectorOffsets, DWORD decrypted) +{ + DWORD saveKey1; + DWORD temp = *SectorOffsets ^ decrypted; // temp = seed1 + seed2 + temp -= 0xEEEEEEEE; // temp = seed1 + StormBuffer[0x400 + (seed1 & 0xFF)] + + for(int i = 0; i < 0x100; i++) // Try all 255 possibilities + { + DWORD seed1; + DWORD seed2 = 0xEEEEEEEE; + DWORD ch; + + // Try the first DWORD (We exactly know the value) + seed1 = temp - StormBuffer[0x400 + i]; + seed2 += StormBuffer[0x400 + (seed1 & 0xFF)]; + ch = SectorOffsets[0] ^ (seed1 + seed2); + + if(ch != decrypted) + continue; + + // Add 1 because we are decrypting sector positions + saveKey1 = seed1 + 1; + + // If OK, continue and test the second value. We don't know exactly the value, + // but we know that the second one has lower 16 bits set to zero + // (no compressed sector is larger than 0xFFFF bytes) + seed1 = ((~seed1 << 0x15) + 0x11111111) | (seed1 >> 0x0B); + seed2 = ch + seed2 + (seed2 << 5) + 3; + + seed2 += StormBuffer[0x400 + (seed1 & 0xFF)]; + ch = SectorOffsets[1] ^ (seed1 + seed2); + + if((ch & 0xFFFF0000) == 0) + return saveKey1; + } + return 0; +} + +// Function tries to detect file encryption key. It expectes at least two uncompressed bytes +DWORD DetectFileKeyByKnownContent(void * pvFileContent, DWORD nDwords, ...) +{ + LPDWORD pdwContent = (LPDWORD)pvFileContent; + va_list argList; + DWORD dwDecrypted[0x10]; + DWORD saveKey1; + DWORD dwTemp; + DWORD i, j; + + // We need at least two DWORDS to detect the file key + if(nDwords < 0x02 || nDwords > 0x10) + return 0; + + va_start(argList, nDwords); + for(i = 0; i < nDwords; i++) + dwDecrypted[i] = va_arg(argList, DWORD); + va_end(argList); + + dwTemp = (*pdwContent ^ dwDecrypted[0]) - 0xEEEEEEEE; + for(i = 0; i < 0x100; i++) // Try all 256 possibilities + { + DWORD seed1; + DWORD seed2 = 0xEEEEEEEE; + DWORD ch; + + // Try the first DWORD + seed1 = dwTemp - StormBuffer[0x400 + i]; + seed2 += StormBuffer[0x400 + (seed1 & 0xFF)]; + ch = pdwContent[0] ^ (seed1 + seed2); + + if(ch != dwDecrypted[0]) + continue; + + saveKey1 = seed1; + + // If OK, continue and test all bytes. + for(j = 1; j < nDwords; j++) + { + seed1 = ((~seed1 << 0x15) + 0x11111111) | (seed1 >> 0x0B); + seed2 = ch + seed2 + (seed2 << 5) + 3; + + seed2 += StormBuffer[0x400 + (seed1 & 0xFF)]; + ch = pdwContent[j] ^ (seed1 + seed2); + + if(ch == dwDecrypted[j] && j == nDwords - 1) + return saveKey1; + } + } + return 0; +} + +DWORD DetectFileKeyByContent(void * pvFileContent, DWORD dwFileSize) +{ + DWORD dwFileKey; + + // Try to break the file encryption key as if it was a WAVE file + if(dwFileSize >= 0x0C) + { + dwFileKey = DetectFileKeyByKnownContent(pvFileContent, 3, 0x46464952, dwFileSize - 8, 0x45564157); + if(dwFileKey != 0) + return dwFileKey; + } + + // Try to break the encryption key as if it was an EXE file + if(dwFileSize > 0x40) + { + dwFileKey = DetectFileKeyByKnownContent(pvFileContent, 2, 0x00905A4D, 0x00000003); + if(dwFileKey != 0) + return dwFileKey; + } + + // Try to break the encryption key as if it was a XML file + if(dwFileSize > 0x04) + { + dwFileKey = DetectFileKeyByKnownContent(pvFileContent, 2, 0x6D783F3C, 0x6576206C); + if(dwFileKey != 0) + return dwFileKey; + } + + // Not detected, sorry + return 0; +} + +DWORD DecryptFileKey( + const char * szFileName, + ULONGLONG MpqPos, + DWORD dwFileSize, + DWORD dwFlags) +{ + DWORD dwFileKey; + DWORD dwMpqPos = (DWORD)MpqPos; + + // File key is calculated from plain name + szFileName = GetPlainFileNameA(szFileName); + dwFileKey = HashString(szFileName, MPQ_HASH_FILE_KEY); + + // Fix the key, if needed + if(dwFlags & MPQ_FILE_FIX_KEY) + dwFileKey = (dwFileKey + dwMpqPos) ^ dwFileSize; + + // Return the key + return dwFileKey; +} + +//----------------------------------------------------------------------------- +// Handle validation functions + +bool IsValidMpqHandle(TMPQArchive * ha) +{ + if(ha == NULL) + return false; + if(ha->pHeader == NULL || ha->pHeader->dwID != ID_MPQ) + return false; + + return (bool)(ha->pHeader->dwID == ID_MPQ); +} + +bool IsValidFileHandle(TMPQFile * hf) +{ + if(hf == NULL) + return false; + + if(hf->dwMagic != ID_MPQ_FILE) + return false; + + if(hf->pStream != NULL) + return true; + + return IsValidMpqHandle(hf->ha); +} + +//----------------------------------------------------------------------------- +// Hash table and block table manipulation + +// Retrieves the first hash entry for the given file. +// Every locale version of a file has its own hash entry +TMPQHash * GetFirstHashEntry(TMPQArchive * ha, const char * szFileName) +{ + TMPQHash * pStartHash; // File hash entry (start) + TMPQHash * pHashEnd = ha->pHashTable + ha->pHeader->dwHashTableSize; + TMPQHash * pHash; // File hash entry (current) + DWORD dwHashTableSizeMask; + DWORD dwIndex = HashString(szFileName, MPQ_HASH_TABLE_INDEX); + DWORD dwName1 = HashString(szFileName, MPQ_HASH_NAME_A); + DWORD dwName2 = HashString(szFileName, MPQ_HASH_NAME_B); + + // Get the first possible has entry that might be the one + dwHashTableSizeMask = ha->pHeader->dwHashTableSize ? (ha->pHeader->dwHashTableSize - 1) : 0; + pStartHash = pHash = ha->pHashTable + (dwIndex & dwHashTableSizeMask); + + // There might be deleted entries in the hash table prior to our desired entry. + while(pHash->dwBlockIndex != HASH_ENTRY_FREE) + { + // If the entry agrees, we found it. + if(pHash->dwName1 == dwName1 && pHash->dwName2 == dwName2 && pHash->dwBlockIndex < ha->dwFileTableSize) + return pHash; + + // Move to the next hash entry. Stop searching + // if we got reached the original hash entry + if(++pHash >= pHashEnd) + pHash = ha->pHashTable; + if(pHash == pStartHash) + break; + } + + // The apropriate hash entry was not found + return NULL; +} + +TMPQHash * GetNextHashEntry(TMPQArchive * ha, TMPQHash * pFirstHash, TMPQHash * pPrevHash) +{ + TMPQHash * pHashEnd = ha->pHashTable + ha->pHeader->dwHashTableSize; + TMPQHash * pHash = pPrevHash; + DWORD dwName1 = pPrevHash->dwName1; + DWORD dwName2 = pPrevHash->dwName2; + + // Now go for any next entry that follows the pPrevHash, + // until either free hash entry was found, or the start entry was reached + for(;;) + { + // Move to the next hash entry. Stop searching + // if we got reached the original hash entry + if(++pHash >= pHashEnd) + pHash = ha->pHashTable; + if(pHash == pFirstHash) + break; + + // If the entry is a free entry, stop search + if(pHash->dwBlockIndex == HASH_ENTRY_FREE) + break; + + // If the entry is not free and the name agrees, we found it + if(pHash->dwName1 == dwName1 && pHash->dwName2 == dwName2 && pHash->dwBlockIndex < ha->pHeader->dwBlockTableSize) + return pHash; + } + + // No next entry + return NULL; +} + +// Allocates an entry in the hash table +DWORD AllocateHashEntry( + TMPQArchive * ha, + TFileEntry * pFileEntry) +{ + TMPQHash * pStartHash; // File hash entry (start) + TMPQHash * pHashEnd = ha->pHashTable + ha->pHeader->dwHashTableSize; + TMPQHash * pHash; // File hash entry (current) + DWORD dwHashTableSizeMask; + DWORD dwIndex = HashString(pFileEntry->szFileName, MPQ_HASH_TABLE_INDEX); + DWORD dwName1 = HashString(pFileEntry->szFileName, MPQ_HASH_NAME_A); + DWORD dwName2 = HashString(pFileEntry->szFileName, MPQ_HASH_NAME_B); + + // Get the first possible has entry that might be the one + dwHashTableSizeMask = ha->pHeader->dwHashTableSize ? (ha->pHeader->dwHashTableSize - 1) : 0; + pStartHash = pHash = ha->pHashTable + (dwIndex & dwHashTableSizeMask); + + // There might be deleted entries in the hash table prior to our desired entry. + while(pHash->dwBlockIndex < HASH_ENTRY_DELETED) + { + // If there already is an existing entry, reuse it. + if(pHash->dwName1 == dwName1 && pHash->dwName2 == dwName2 && pHash->lcLocale == pFileEntry->lcLocale) + break; + + // Move to the next hash entry. + // If we reached the starting entry, it's failure. + if(++pHash >= pHashEnd) + pHash = ha->pHashTable; + if(pHash == pStartHash) + return HASH_ENTRY_FREE; + } + + // Fill the free hash entry + pHash->dwName1 = dwName1; + pHash->dwName2 = dwName2; + pHash->lcLocale = pFileEntry->lcLocale; + pHash->wPlatform = pFileEntry->wPlatform; + pHash->dwBlockIndex = (DWORD)(pFileEntry - ha->pFileTable); + + // Fill the hash index in the file entry + pFileEntry->dwHashIndex = (DWORD)(pHash - ha->pHashTable); + return pFileEntry->dwHashIndex; +} + +// Finds a free space in the MPQ where to store next data +// The free space begins beyond the file that is stored at the fuhrtest +// position in the MPQ. +void FindFreeMpqSpace(TMPQArchive * ha, ULONGLONG * pFreeSpacePos) +{ + TMPQHeader * pHeader = ha->pHeader; + TFileEntry * pFileTableEnd = ha->pFileTable + ha->dwFileTableSize; + TFileEntry * pFileEntry = ha->pFileTable; + ULONGLONG FreeSpacePos = ha->pHeader->dwHeaderSize; + DWORD dwChunkCount; + + // Parse the entire block table + for(pFileEntry = ha->pFileTable; pFileEntry < pFileTableEnd; pFileEntry++) + { + // Only take existing files + if(pFileEntry->dwFlags & MPQ_FILE_EXISTS) + { + // If the end of the file is bigger than current MPQ table pos, update it + if((pFileEntry->ByteOffset + pFileEntry->dwCmpSize) > FreeSpacePos) + { + // Get the end of the file data + FreeSpacePos = pFileEntry->ByteOffset + pFileEntry->dwCmpSize; + + // Add the MD5 chunks, if present + if(pHeader->dwRawChunkSize != 0) + { + dwChunkCount = pFileEntry->dwCmpSize / pHeader->dwRawChunkSize; + if(pFileEntry->dwCmpSize % pHeader->dwRawChunkSize) + dwChunkCount++; + FreeSpacePos += dwChunkCount * MD5_DIGEST_SIZE; + } + } + } + } + + // Give the free space position to the caller + if(pFreeSpacePos != NULL) + *pFreeSpacePos = FreeSpacePos; +} + +//----------------------------------------------------------------------------- +// Common functions - MPQ File + +TMPQFile * CreateMpqFile(TMPQArchive * ha) +{ + TMPQFile * hf; + + // Allocate space for TMPQFile + hf = STORM_ALLOC(TMPQFile, 1); + if(hf != NULL) + { + // Fill the file structure + memset(hf, 0, sizeof(TMPQFile)); + hf->ha = ha; + hf->pStream = NULL; + hf->dwMagic = ID_MPQ_FILE; + } + + return hf; +} + +// Loads a table from MPQ. +// Can be used for hash table, block table, sector offset table or sector checksum table +int LoadMpqTable( + TMPQArchive * ha, + ULONGLONG ByteOffset, + void * pvTable, + DWORD dwCompressedSize, + DWORD dwRealSize, + DWORD dwKey) +{ + LPBYTE pbCompressed = NULL; + LPBYTE pbToRead = (LPBYTE)pvTable; + int nError = ERROR_SUCCESS; + + // "interface.MPQ.part" in trial version of World of Warcraft + // has block table and hash table compressed. + if(dwCompressedSize < dwRealSize) + { + // Allocate temporary buffer for holding compressed data + pbCompressed = STORM_ALLOC(BYTE, dwCompressedSize); + if(pbCompressed == NULL) + return ERROR_NOT_ENOUGH_MEMORY; + + // Assign the temporary buffer as target for read operation + pbToRead = pbCompressed; + } + + // Read the table + if(FileStream_Read(ha->pStream, &ByteOffset, pbToRead, dwCompressedSize)) + { + // First of all, decrypt the table + if(dwKey != 0) + { + BSWAP_ARRAY32_UNSIGNED(pbToRead, dwCompressedSize); + DecryptMpqBlock(pbToRead, dwCompressedSize, dwKey); + BSWAP_ARRAY32_UNSIGNED(pbToRead, dwCompressedSize); + } + + // If the table is compressed, decompress it + if(dwCompressedSize < dwRealSize) + { + int cbOutBuffer = (int)dwRealSize; + int cbInBuffer = (int)dwCompressedSize; + + if(!SCompDecompress((char *)pvTable, &cbOutBuffer, (char *)pbCompressed, cbInBuffer)) + nError = GetLastError(); + + // Free the temporary buffer + STORM_FREE(pbCompressed); + } + } + else + { + nError = GetLastError(); + } + + BSWAP_ARRAY32_UNSIGNED(pvTable, dwRealSize); + return nError; +} + +void CalculateRawSectorOffset( + ULONGLONG & RawFilePos, + TMPQFile * hf, + DWORD dwSectorOffset) +{ + // + // Some MPQ protectors place the sector offset table after the actual file data. + // Sector offsets in the sector offset table are negative. When added + // to MPQ file offset from the block table entry, the result is a correct + // position of the file data in the MPQ. + // + // The position of sector table must be always within the MPQ, however. + // When a negative sector offset is found, we make sure that we make the addition + // just in 32-bits, and then add the MPQ offset. + // + + if(dwSectorOffset & 0x80000000) + { + RawFilePos = hf->ha->MpqPos + ((DWORD)hf->pFileEntry->ByteOffset + dwSectorOffset); + } + else + { + RawFilePos = hf->RawFilePos + dwSectorOffset; + } + + // We also have to add patch header size, if patch header is present + if(hf->pPatchInfo != NULL) + RawFilePos += hf->pPatchInfo->dwLength; +} + +unsigned char * AllocateMd5Buffer( + DWORD dwRawDataSize, + DWORD dwChunkSize, + LPDWORD pcbMd5Size) +{ + unsigned char * md5_array; + DWORD cbMd5Size; + + // Sanity check + assert(dwChunkSize != 0); + + // Calculate how many MD5's we will calculate + cbMd5Size = dwRawDataSize / dwChunkSize; + if(dwRawDataSize % dwChunkSize) + cbMd5Size++; + cbMd5Size *= MD5_DIGEST_SIZE; + + // Allocate space for array or MD5s + md5_array = STORM_ALLOC(BYTE, cbMd5Size); + + // Give the size of the MD5 array + if(pcbMd5Size != NULL) + *pcbMd5Size = cbMd5Size; + return md5_array; +} + +// Allocates sector buffer and sector offset table +int AllocateSectorBuffer(TMPQFile * hf) +{ + TMPQArchive * ha = hf->ha; + + // Caller of AllocateSectorBuffer must ensure these + assert(hf->pbFileSector == NULL); + assert(hf->pFileEntry != NULL); + assert(hf->dwDataSize != 0); + assert(hf->ha != NULL); + + // Determine the file sector size and allocate buffer for it + hf->dwSectorSize = (hf->pFileEntry->dwFlags & MPQ_FILE_SINGLE_UNIT) ? hf->dwDataSize : ha->dwSectorSize; + hf->pbFileSector = STORM_ALLOC(BYTE, hf->dwSectorSize); + hf->dwSectorOffs = SFILE_INVALID_POS; + + // Return result + return (hf->pbFileSector != NULL) ? (int)ERROR_SUCCESS : (int)ERROR_NOT_ENOUGH_MEMORY; +} + +// Allocates sector offset table +int AllocatePatchInfo(TMPQFile * hf, bool bLoadFromFile) +{ + TMPQArchive * ha = hf->ha; + DWORD dwLength = sizeof(TPatchInfo); + + // The following conditions must be true + assert(hf->pFileEntry->dwFlags & MPQ_FILE_PATCH_FILE); + assert(hf->pPatchInfo == NULL); + +__AllocateAndLoadPatchInfo: + + // Allocate space for patch header. Start with default size, + // and if its size if bigger, then we reload them + hf->pPatchInfo = (TPatchInfo *)STORM_ALLOC(BYTE, dwLength); + if(hf->pPatchInfo == NULL) + return ERROR_NOT_ENOUGH_MEMORY; + + // Do we have to load the patch header from the file ? + if(bLoadFromFile) + { + // Load the patch header + if(!FileStream_Read(ha->pStream, &hf->RawFilePos, hf->pPatchInfo, dwLength)) + { + // Free the sector offsets + STORM_FREE(hf->pPatchInfo); + hf->pPatchInfo = NULL; + return GetLastError(); + } + + // Perform necessary swapping + hf->pPatchInfo->dwLength = BSWAP_INT32_UNSIGNED(hf->pPatchInfo->dwLength); + hf->pPatchInfo->dwFlags = BSWAP_INT32_UNSIGNED(hf->pPatchInfo->dwFlags); + hf->pPatchInfo->dwDataSize = BSWAP_INT32_UNSIGNED(hf->pPatchInfo->dwDataSize); + + // Verify the size of the patch header + // If it's not default size, we have to reload them + if(hf->pPatchInfo->dwLength > dwLength) + { + dwLength = hf->pPatchInfo->dwLength; + STORM_FREE(hf->pPatchInfo); + hf->pPatchInfo = NULL; + + goto __AllocateAndLoadPatchInfo; + } + + // Patch file data size according to the patch header + hf->dwDataSize = hf->pPatchInfo->dwDataSize; + } + else + { + memset(hf->pPatchInfo, 0, dwLength); + } + + // Save the final length to the patch header + hf->pPatchInfo->dwLength = dwLength; + hf->pPatchInfo->dwFlags = 0x80000000; + return ERROR_SUCCESS; +} + +// Allocates sector offset table +int AllocateSectorOffsets(TMPQFile * hf, bool bLoadFromFile) +{ + TMPQArchive * ha = hf->ha; + TFileEntry * pFileEntry = hf->pFileEntry; + DWORD dwSectorOffsLen; + bool bSectorOffsetTableCorrupt = false; + + // Caller of AllocateSectorOffsets must ensure these + assert(hf->SectorOffsets == NULL); + assert(hf->pFileEntry != NULL); + assert(hf->dwDataSize != 0); + assert(hf->ha != NULL); + + // If the file is stored as single unit, just set number of sectors to 1 + if(pFileEntry->dwFlags & MPQ_FILE_SINGLE_UNIT) + { + hf->dwSectorCount = 1; + return ERROR_SUCCESS; + } + + // Calculate the number of data sectors + hf->dwSectorCount = ((hf->dwDataSize - 1) / hf->dwSectorSize) + 1; + + // Calculate the number of file sectors + dwSectorOffsLen = (hf->dwSectorCount + 1) * sizeof(DWORD); + + // If MPQ_FILE_SECTOR_CRC flag is set, there will either be extra DWORD + // or an array of MD5's. Either way, we read at least 4 bytes more + // in order to save additional read from the file. + if(pFileEntry->dwFlags & MPQ_FILE_SECTOR_CRC) + dwSectorOffsLen += sizeof(DWORD); + + // Only allocate and load the table if the file is compressed + if(pFileEntry->dwFlags & MPQ_FILE_COMPRESSED) + { + // Allocate the sector offset table + hf->SectorOffsets = (DWORD *)STORM_ALLOC(BYTE, dwSectorOffsLen); + if(hf->SectorOffsets == NULL) + return ERROR_NOT_ENOUGH_MEMORY; + + // Only read from the file if we are supposed to do so + if(bLoadFromFile) + { + ULONGLONG RawFilePos = hf->RawFilePos; + + if(hf->pPatchInfo != NULL) + RawFilePos += hf->pPatchInfo->dwLength; + + // Load the sector offsets from the file + if(!FileStream_Read(ha->pStream, &RawFilePos, hf->SectorOffsets, dwSectorOffsLen)) + { + // Free the sector offsets + STORM_FREE(hf->SectorOffsets); + hf->SectorOffsets = NULL; + return GetLastError(); + } + + // Swap the sector positions + BSWAP_ARRAY32_UNSIGNED(hf->SectorOffsets, dwSectorOffsLen); + + // Decrypt loaded sector positions if necessary + if(pFileEntry->dwFlags & MPQ_FILE_ENCRYPTED) + { + // If we don't know the file key, try to find it. + if(hf->dwFileKey == 0) + { + hf->dwFileKey = DetectFileKeyBySectorSize(hf->SectorOffsets, dwSectorOffsLen); + if(hf->dwFileKey == 0) + { + STORM_FREE(hf->SectorOffsets); + hf->SectorOffsets = NULL; + return ERROR_UNKNOWN_FILE_KEY; + } + } + + // Decrypt sector positions + DecryptMpqBlock(hf->SectorOffsets, dwSectorOffsLen, hf->dwFileKey - 1); + } + + // + // Validate the sector offset table + // + // Note: Some MPQ protectors put the actual file data before the sector offset table. + // In this case, the sector offsets are negative (> 0x80000000). + // + + for(DWORD i = 0; i < hf->dwSectorCount; i++) + { + DWORD dwSectorOffset1 = hf->SectorOffsets[i+1]; + DWORD dwSectorOffset0 = hf->SectorOffsets[i]; + + // Every following sector offset must be bigger than the previous one + if(dwSectorOffset1 <= dwSectorOffset0) + { + bSectorOffsetTableCorrupt = true; + break; + } + + // The sector size must not be bigger than compressed file size + if((dwSectorOffset1 - dwSectorOffset0) > pFileEntry->dwCmpSize) + { + bSectorOffsetTableCorrupt = true; + break; + } + } + + // If data corruption detected, free the sector offset table + if(bSectorOffsetTableCorrupt) + { + STORM_FREE(hf->SectorOffsets); + hf->SectorOffsets = NULL; + return ERROR_FILE_CORRUPT; + } + + // + // There may be various extra DWORDs loaded after the sector offset table. + // They are mostly empty on WoW release MPQs, but on MPQs from PTR, + // they contain random non-zero data. Their meaning is unknown. + // At this point, we completely ignore them + // + +// assert(dwSectorOffsLen == hf->SectorOffsets[0]); + } + else + { + memset(hf->SectorOffsets, 0, dwSectorOffsLen); + hf->SectorOffsets[0] = dwSectorOffsLen; + } + } + + return ERROR_SUCCESS; +} + +int AllocateSectorChecksums(TMPQFile * hf, bool bLoadFromFile) +{ + TMPQArchive * ha = hf->ha; + TFileEntry * pFileEntry = hf->pFileEntry; + ULONGLONG RawFilePos; + DWORD dwCompressedSize = 0; + DWORD dwExpectedSize; + DWORD dwCrcOffset; // Offset of the CRC table, relative to file offset in the MPQ + DWORD dwCrcSize; + + // Caller of AllocateSectorChecksums must ensure these + assert(hf->SectorChksums == NULL); + assert(hf->SectorOffsets != NULL); + assert(hf->pFileEntry != NULL); + assert(hf->ha != NULL); + + // Single unit files don't have sector checksums + if(pFileEntry->dwFlags & MPQ_FILE_SINGLE_UNIT) + return ERROR_SUCCESS; + + // Caller must ensure that we are only called when we have sector checksums + assert(pFileEntry->dwFlags & MPQ_FILE_SECTOR_CRC); + + // + // Older MPQs store an array of CRC32's after + // the raw file data in the MPQ. + // + // In newer MPQs, the (since Cataclysm BETA) the (attributes) file + // contains additional 32-bit values beyond the sector table. + // Their number depends on size of the (attributes), but their + // meaning is unknown. They are usually zeroed in retail game files, + // but contain some sort of checksum in BETA MPQs + // + + // Does the size of the file table match with the CRC32-based checksums? + dwExpectedSize = (hf->dwSectorCount + 2) * sizeof(DWORD); + if(hf->SectorOffsets[0] == dwExpectedSize) + { + // Is there valid size of the sector checksums? + if(hf->SectorOffsets[hf->dwSectorCount + 1] >= hf->SectorOffsets[hf->dwSectorCount]) + dwCompressedSize = hf->SectorOffsets[hf->dwSectorCount + 1] - hf->SectorOffsets[hf->dwSectorCount]; + + // Ignore cases when the length is too small or too big. + if(dwCompressedSize < sizeof(DWORD) || dwCompressedSize > hf->dwSectorSize) + return ERROR_SUCCESS; + + // Allocate the array for the sector checksums + hf->SectorChksums = STORM_ALLOC(DWORD, hf->dwSectorCount); + if(hf->SectorChksums == NULL) + return ERROR_NOT_ENOUGH_MEMORY; + + // If we are not supposed to load it from the file, allocate empty buffer + if(bLoadFromFile == false) + { + memset(hf->SectorChksums, 0, hf->dwSectorCount * sizeof(DWORD)); + return ERROR_SUCCESS; + } + + // Calculate offset of the CRC table + dwCrcSize = hf->dwSectorCount * sizeof(DWORD); + dwCrcOffset = hf->SectorOffsets[hf->dwSectorCount]; + CalculateRawSectorOffset(RawFilePos, hf, dwCrcOffset); + + // Now read the table from the MPQ + return LoadMpqTable(ha, RawFilePos, hf->SectorChksums, dwCompressedSize, dwCrcSize, 0); + } + + // If the size doesn't match, we ignore sector checksums +// assert(false); + return ERROR_SUCCESS; +} + +int WritePatchInfo(TMPQFile * hf) +{ + TMPQArchive * ha = hf->ha; + TPatchInfo * pPatchInfo = hf->pPatchInfo; + + // The caller must make sure that this function is only called + // when the following is true. + assert(hf->pFileEntry->dwFlags & MPQ_FILE_PATCH_FILE); + assert(pPatchInfo != NULL); + + BSWAP_ARRAY32_UNSIGNED(pPatchInfo, 3 * sizeof(DWORD)); + if(!FileStream_Write(ha->pStream, &hf->RawFilePos, pPatchInfo, sizeof(TPatchInfo))) + return GetLastError(); + + return ERROR_SUCCESS; +} + +int WriteSectorOffsets(TMPQFile * hf) +{ + TMPQArchive * ha = hf->ha; + TFileEntry * pFileEntry = hf->pFileEntry; + ULONGLONG RawFilePos = hf->RawFilePos; + DWORD dwSectorOffsLen; + + // The caller must make sure that this function is only called + // when the following is true. + assert(hf->pFileEntry->dwFlags & MPQ_FILE_COMPRESSED); + assert(hf->SectorOffsets != NULL); + dwSectorOffsLen = hf->SectorOffsets[0]; + + // If file is encrypted, sector positions are also encrypted + if(pFileEntry->dwFlags & MPQ_FILE_ENCRYPTED) + EncryptMpqBlock(hf->SectorOffsets, dwSectorOffsLen, hf->dwFileKey - 1); + BSWAP_ARRAY32_UNSIGNED(hf->SectorOffsets, dwSectorOffsLen); + + // Adjust sector offset table position, if we also have patch info + if(hf->pPatchInfo != NULL) + RawFilePos += hf->pPatchInfo->dwLength; + + // Write sector offsets to the archive + if(!FileStream_Write(ha->pStream, &RawFilePos, hf->SectorOffsets, dwSectorOffsLen)) + return GetLastError(); + + // Not necessary, as the sector checksums + // are going to be freed when this is done. +// BSWAP_ARRAY32_UNSIGNED(hf->SectorOffsets, dwSectorOffsLen); + return ERROR_SUCCESS; +} + + +int WriteSectorChecksums(TMPQFile * hf) +{ + TMPQArchive * ha = hf->ha; + ULONGLONG RawFilePos; + TFileEntry * pFileEntry = hf->pFileEntry; + LPBYTE pbCompressed; + DWORD dwCompressedSize = 0; + DWORD dwCrcSize; + int nOutSize; + int nError = ERROR_SUCCESS; + + // The caller must make sure that this function is only called + // when the following is true. + assert(hf->pFileEntry->dwFlags & MPQ_FILE_SECTOR_CRC); + assert(hf->SectorOffsets != NULL); + assert(hf->SectorChksums != NULL); + + // If the MPQ has MD5 of each raw data chunk, + // we leave sector offsets empty + if(ha->pHeader->dwRawChunkSize != 0) + { + hf->SectorOffsets[hf->dwSectorCount + 1] = hf->SectorOffsets[hf->dwSectorCount]; + return ERROR_SUCCESS; + } + + // Calculate size of the checksum array + dwCrcSize = hf->dwSectorCount * sizeof(DWORD); + + // Allocate buffer for compressed sector CRCs. + pbCompressed = STORM_ALLOC(BYTE, dwCrcSize); + if(pbCompressed == NULL) + return ERROR_NOT_ENOUGH_MEMORY; + + // Perform the compression + BSWAP_ARRAY32_UNSIGNED(hf->SectorChksums, dwCrcSize); + + nOutSize = (int)dwCrcSize; + SCompCompress((char *)pbCompressed, &nOutSize, (char *)hf->SectorChksums, (int)dwCrcSize, MPQ_COMPRESSION_ZLIB, 0, 0); + dwCompressedSize = (DWORD)nOutSize; + + // Write the sector CRCs to the archive + RawFilePos = hf->RawFilePos + hf->SectorOffsets[hf->dwSectorCount]; + if(hf->pPatchInfo != NULL) + RawFilePos += hf->pPatchInfo->dwLength; + if(!FileStream_Write(ha->pStream, &RawFilePos, pbCompressed, dwCompressedSize)) + nError = GetLastError(); + + // Not necessary, as the sector checksums + // are going to be freed when this is done. +// BSWAP_ARRAY32_UNSIGNED(hf->SectorChksums, dwCrcSize); + + // Store the sector CRCs + hf->SectorOffsets[hf->dwSectorCount + 1] = hf->SectorOffsets[hf->dwSectorCount] + dwCompressedSize; + pFileEntry->dwCmpSize += dwCompressedSize; + STORM_FREE(pbCompressed); + return nError; +} + +int WriteMemDataMD5( + TFileStream * pStream, + ULONGLONG RawDataOffs, + void * pvRawData, + DWORD dwRawDataSize, + DWORD dwChunkSize, + LPDWORD pcbTotalSize) +{ + unsigned char * md5_array; + unsigned char * md5; + LPBYTE pbRawData = (LPBYTE)pvRawData; + DWORD dwBytesRemaining = dwRawDataSize; + DWORD dwMd5ArraySize = 0; + int nError = ERROR_SUCCESS; + + // Allocate buffer for array of MD5 + md5_array = md5 = AllocateMd5Buffer(dwRawDataSize, dwChunkSize, &dwMd5ArraySize); + if(md5_array == NULL) + return ERROR_NOT_ENOUGH_MEMORY; + + // For every file chunk, calculate MD5 + while(dwBytesRemaining != 0) + { + // Get the remaining number of bytes to read + dwChunkSize = STORMLIB_MIN(dwBytesRemaining, dwChunkSize); + + // Calculate MD5 + CalculateDataBlockHash(pbRawData, dwChunkSize, md5); + md5 += MD5_DIGEST_SIZE; + + // Move offset and size + dwBytesRemaining -= dwChunkSize; + pbRawData += dwChunkSize; + } + + // Write the array od MD5's to the file + RawDataOffs += dwRawDataSize; + if(!FileStream_Write(pStream, &RawDataOffs, md5_array, dwMd5ArraySize)) + nError = GetLastError(); + + // Give the caller the size of the MD5 array + if(pcbTotalSize != NULL) + *pcbTotalSize = dwRawDataSize + dwMd5ArraySize; + + // Free buffers and exit + STORM_FREE(md5_array); + return nError; +} + + +// Writes the MD5 for each chunk of the raw file data +int WriteMpqDataMD5( + TFileStream * pStream, + ULONGLONG RawDataOffs, + DWORD dwRawDataSize, + DWORD dwChunkSize) +{ + unsigned char * md5_array; + unsigned char * md5; + LPBYTE pbFileChunk; + DWORD dwMd5ArraySize = 0; + DWORD dwToRead = dwRawDataSize; + int nError = ERROR_SUCCESS; + + // Allocate buffer for array of MD5 + md5_array = md5 = AllocateMd5Buffer(dwRawDataSize, dwChunkSize, &dwMd5ArraySize); + if(md5_array == NULL) + return ERROR_NOT_ENOUGH_MEMORY; + + // Allocate space for file chunk + pbFileChunk = STORM_ALLOC(BYTE, dwChunkSize); + if(pbFileChunk == NULL) + { + STORM_FREE(md5_array); + return ERROR_NOT_ENOUGH_MEMORY; + } + + // For every file chunk, calculate MD5 + while(dwRawDataSize != 0) + { + // Get the remaining number of bytes to read + dwToRead = STORMLIB_MIN(dwRawDataSize, dwChunkSize); + + // Read the chunk + if(!FileStream_Read(pStream, &RawDataOffs, pbFileChunk, dwToRead)) + { + nError = GetLastError(); + break; + } + + // Calculate MD5 + CalculateDataBlockHash(pbFileChunk, dwToRead, md5); + md5 += MD5_DIGEST_SIZE; + + // Move offset and size + RawDataOffs += dwToRead; + dwRawDataSize -= dwToRead; + } + + // Write the array od MD5's to the file + if(nError == ERROR_SUCCESS) + { + if(!FileStream_Write(pStream, NULL, md5_array, dwMd5ArraySize)) + nError = GetLastError(); + } + + // Free buffers and exit + STORM_FREE(pbFileChunk); + STORM_FREE(md5_array); + return nError; +} + +// Frees the structure for MPQ file +void FreeMPQFile(TMPQFile *& hf) +{ + if(hf != NULL) + { + // If we have patch file attached to this one, free it first + if(hf->hfPatchFile != NULL) + FreeMPQFile(hf->hfPatchFile); + + // Then free all buffers allocated in the file structure + if(hf->pPatchHeader != NULL) + STORM_FREE(hf->pPatchHeader); + if(hf->pbFileData != NULL) + STORM_FREE(hf->pbFileData); + if(hf->pPatchInfo != NULL) + STORM_FREE(hf->pPatchInfo); + if(hf->SectorOffsets != NULL) + STORM_FREE(hf->SectorOffsets); + if(hf->SectorChksums != NULL) + STORM_FREE(hf->SectorChksums); + if(hf->pbFileSector != NULL) + STORM_FREE(hf->pbFileSector); + FileStream_Close(hf->pStream); + STORM_FREE(hf); + hf = NULL; + } +} + +// Frees the MPQ archive +void FreeMPQArchive(TMPQArchive *& ha) +{ + if(ha != NULL) + { + // First of all, free the patch archive, if any + if(ha->haPatch != NULL) + FreeMPQArchive(ha->haPatch); + + // Free the file names from the file table + if(ha->pFileTable != NULL) + { + for(DWORD i = 0; i < ha->dwFileTableSize; i++) + { + if(ha->pFileTable[i].szFileName != NULL) + STORM_FREE(ha->pFileTable[i].szFileName); + ha->pFileTable[i].szFileName = NULL; + } + + // Then free all buffers allocated in the archive structure + STORM_FREE(ha->pFileTable); + } + + if(ha->pHashTable != NULL) + STORM_FREE(ha->pHashTable); + if(ha->pHetTable != NULL) + FreeHetTable(ha->pHetTable); + FileStream_Close(ha->pStream); + STORM_FREE(ha); + ha = NULL; + } +} + +const char * GetPlainFileNameA(const char * szFileName) +{ + const char * szPlainName = szFileName; + + while(*szFileName != 0) + { + if(*szFileName == '\\' || *szFileName == '/') + szPlainName = szFileName + 1; + szFileName++; + } + + return szPlainName; +} + +const TCHAR * GetPlainFileNameT(const TCHAR * szFileName) +{ + const TCHAR * szPlainName = szFileName; + + while(*szFileName != 0) + { + if(*szFileName == '\\' || *szFileName == '/') + szPlainName = szFileName + 1; + szFileName++; + } + + return szPlainName; +} + +bool IsInternalMpqFileName(const char * szFileName) +{ + if(szFileName != NULL && szFileName[0] == '(') + { + if(!_stricmp(szFileName, LISTFILE_NAME) || + !_stricmp(szFileName, ATTRIBUTES_NAME) || + !_stricmp(szFileName, SIGNATURE_NAME)) + { + return true; + } + } + + return false; +} + +// Verifies if the file name is a pseudo-name +bool IsPseudoFileName(const char * szFileName, DWORD * pdwFileIndex) +{ + DWORD dwFileIndex = 0; + + if(szFileName != NULL) + { + // Must be "File########.ext" + if(!_strnicmp(szFileName, "File", 4)) + { + // Check 8 digits + for(int i = 4; i < 4+8; i++) + { + if(szFileName[i] < '0' || szFileName[i] > '9') + return false; + dwFileIndex = (dwFileIndex * 10) + (szFileName[i] - '0'); + } + + // An extension must follow + if(szFileName[12] == '.') + { + if(pdwFileIndex != NULL) + *pdwFileIndex = dwFileIndex; + return true; + } + } + } + + // Not a pseudo-name + return false; +} + +//----------------------------------------------------------------------------- +// Functions calculating and verifying the MD5 signature + +bool IsValidMD5(LPBYTE pbMd5) +{ + BYTE BitSummary = 0; + + // The MD5 is considered invalid of it is zeroed + BitSummary |= pbMd5[0x00] | pbMd5[0x01] | pbMd5[0x02] | pbMd5[0x03] | pbMd5[0x04] | pbMd5[0x05] | pbMd5[0x06] | pbMd5[0x07]; + BitSummary |= pbMd5[0x08] | pbMd5[0x09] | pbMd5[0x0A] | pbMd5[0x0B] | pbMd5[0x0C] | pbMd5[0x0D] | pbMd5[0x0E] | pbMd5[0x0F]; + return (BitSummary != 0); +} + +bool VerifyDataBlockHash(void * pvDataBlock, DWORD cbDataBlock, LPBYTE expected_md5) +{ + hash_state md5_state; + BYTE md5_digest[MD5_DIGEST_SIZE]; + + // Don't verify the block if the MD5 is not valid. + if(!IsValidMD5(expected_md5)) + return true; + + // Calculate the MD5 of the data block + md5_init(&md5_state); + md5_process(&md5_state, (unsigned char *)pvDataBlock, cbDataBlock); + md5_done(&md5_state, md5_digest); + + // Does the MD5's match? + return (memcmp(md5_digest, expected_md5, MD5_DIGEST_SIZE) == 0); +} + +void CalculateDataBlockHash(void * pvDataBlock, DWORD cbDataBlock, LPBYTE md5_hash) +{ + hash_state md5_state; + + md5_init(&md5_state); + md5_process(&md5_state, (unsigned char *)pvDataBlock, cbDataBlock); + md5_done(&md5_state, md5_hash); +} + + +//----------------------------------------------------------------------------- +// Swapping functions + +#ifndef PLATFORM_LITTLE_ENDIAN + +// +// Note that those functions are implemented for Mac operating system, +// as this is the only supported platform that uses big endian. +// + +// Swaps a signed 16-bit integer +int16_t SwapInt16(uint16_t data) +{ + return (int16_t)CFSwapInt16(data); +} + +// Swaps an unsigned 16-bit integer +uint16_t SwapUInt16(uint16_t data) +{ + return CFSwapInt16(data); +} + +// Swaps signed 32-bit integer +int32_t SwapInt32(uint32_t data) +{ + return (int32_t)CFSwapInt32(data); +} + +// Swaps an unsigned 32-bit integer +uint32_t SwapUInt32(uint32_t data) +{ + return CFSwapInt32(data); +} + +// Swaps signed 64-bit integer +int64_t SwapInt64(int64_t data) +{ + return (int64_t)CFSwapInt64(data); +} + +// Swaps an unsigned 64-bit integer +uint64_t SwapUInt64(uint64_t data) +{ + return CFSwapInt64(data); +} + +// Swaps array of unsigned 16-bit integers +void ConvertUInt16Buffer(void * ptr, size_t length) +{ + uint16_t * buffer = (uint16_t *)ptr; + uint32_t nElements = (uint32_t)(length / sizeof(uint16_t)); + + while(nElements-- > 0) + { + *buffer = SwapUInt16(*buffer); + buffer++; + } +} + +// Swaps array of unsigned 32-bit integers +void ConvertUInt32Buffer(void * ptr, size_t length) +{ + uint32_t * buffer = (uint32_t *)ptr; + uint32_t nElements = (uint32_t)(length / sizeof(uint32_t)); + + while(nElements-- > 0) + { + *buffer = SwapUInt32(*buffer); + buffer++; + } +} + +// Swaps array of unsigned 64-bit integers +void ConvertUInt64Buffer(void * ptr, size_t length) +{ + uint64_t * buffer = (uint64_t *)ptr; + uint32_t nElements = (uint32_t)(length / sizeof(uint64_t)); + + while(nElements-- > 0) + { + *buffer = SwapUInt64(*buffer); + buffer++; + } +} + +// Swaps the TMPQUserData structure +void ConvertTMPQUserData(void *userData) +{ + TMPQUserData * theData = (TMPQUserData *)userData; + + theData->dwID = SwapUInt32(theData->dwID); + theData->cbUserDataSize = SwapUInt32(theData->cbUserDataSize); + theData->dwHeaderOffs = SwapUInt32(theData->dwHeaderOffs); + theData->cbUserDataHeader = SwapUInt32(theData->cbUserDataHeader); +} + +// Swaps the TMPQHeader structure +void ConvertTMPQHeader(void *header) +{ + TMPQHeader * theHeader = (TMPQHeader *)header; + + theHeader->dwID = SwapUInt32(theHeader->dwID); + theHeader->dwHeaderSize = SwapUInt32(theHeader->dwHeaderSize); + theHeader->dwArchiveSize = SwapUInt32(theHeader->dwArchiveSize); + theHeader->wFormatVersion = SwapUInt16(theHeader->wFormatVersion); + theHeader->wSectorSize = SwapUInt16(theHeader->wSectorSize); + theHeader->dwHashTablePos = SwapUInt32(theHeader->dwHashTablePos); + theHeader->dwBlockTablePos = SwapUInt32(theHeader->dwBlockTablePos); + theHeader->dwHashTableSize = SwapUInt32(theHeader->dwHashTableSize); + theHeader->dwBlockTableSize = SwapUInt32(theHeader->dwBlockTableSize); + + if(theHeader->wFormatVersion >= MPQ_FORMAT_VERSION_2) + { + // Swap the hi-block table position + theHeader->HiBlockTablePos64 = SwapUInt64(theHeader->HiBlockTablePos64); + + theHeader->wHashTablePosHi = SwapUInt16(theHeader->wHashTablePosHi); + theHeader->wBlockTablePosHi = SwapUInt16(theHeader->wBlockTablePosHi); + + if(theHeader->wFormatVersion >= MPQ_FORMAT_VERSION_3) + { + theHeader->ArchiveSize64 = SwapUInt64(theHeader->ArchiveSize64); + theHeader->BetTablePos64 = SwapUInt64(theHeader->BetTablePos64); + theHeader->HetTablePos64 = SwapUInt64(theHeader->HetTablePos64); + + if(theHeader->wFormatVersion >= MPQ_FORMAT_VERSION_4) + { + theHeader->HashTableSize64 = SwapUInt64(theHeader->HashTableSize64); + theHeader->BlockTableSize64 = SwapUInt64(theHeader->BlockTableSize64); + theHeader->HiBlockTableSize64 = SwapUInt64(theHeader->HiBlockTableSize64); + theHeader->HetTableSize64 = SwapUInt64(theHeader->HetTableSize64); + theHeader->BetTableSize64 = SwapUInt64(theHeader->BetTableSize64); + } + } + } +} + +#endif // PLATFORM_LITTLE_ENDIAN diff --git a/dep/StormLib/src/SBaseDumpData.cpp b/dep/StormLib/src/SBaseDumpData.cpp new file mode 100644 index 00000000000..f2b5fad1e8f --- /dev/null +++ b/dep/StormLib/src/SBaseDumpData.cpp @@ -0,0 +1,144 @@ +/*****************************************************************************/ +/* SBaseDumpData.cpp Copyright (c) Ladislav Zezula 2011 */ +/*---------------------------------------------------------------------------*/ +/* Description : */ +/*---------------------------------------------------------------------------*/ +/* Date Ver Who Comment */ +/* -------- ---- --- ------- */ +/* 26.01.11 1.00 Lad The first version of SBaseDumpData.cpp */ +/*****************************************************************************/ + +#define __STORMLIB_SELF__ +#include "StormLib.h" +#include "StormCommon.h" + +#ifdef __STORMLIB_DUMP_DATA__ + +void DumpMpqHeader(TMPQHeader * pHeader) +{ + printf("== MPQ Header =================================\n"); + printf("DWORD dwID = %08lX\n", pHeader->dwID); + printf("DWORD dwHeaderSize = %08lX\n", pHeader->dwHeaderSize); + printf("DWORD dwArchiveSize = %08lX\n", pHeader->dwArchiveSize); + printf("USHORT wFormatVersion = %04lX\n", pHeader->wFormatVersion); + printf("USHORT wSectorSize = %04lX\n", pHeader->wSectorSize); + printf("DWORD dwHashTablePos = %08lX\n", pHeader->dwHashTablePos); + printf("DWORD dwBlockTablePos = %08lX\n", pHeader->dwBlockTablePos); + printf("DWORD dwHashTableSize = %08lX\n", pHeader->dwHashTableSize); + printf("DWORD dwBlockTableSize = %08lX\n", pHeader->dwBlockTableSize); + printf("ULONGLONG HiBlockTablePos64 = %016llX\n", pHeader->HiBlockTablePos64); + printf("USHORT wHashTablePosHi = %04lX\n", pHeader->wHashTablePosHi); + printf("USHORT wBlockTablePosHi = %04lX\n", pHeader->wBlockTablePosHi); + printf("ULONGLONG ArchiveSize64 = %016llX\n", pHeader->ArchiveSize64); + printf("ULONGLONG BetTablePos64 = %016llX\n", pHeader->BetTablePos64); + printf("ULONGLONG HetTablePos64 = %016llX\n", pHeader->HetTablePos64); + printf("ULONGLONG HashTableSize64 = %016llX\n", pHeader->HashTableSize64); + printf("ULONGLONG BlockTableSize64 = %016llX\n", pHeader->BlockTableSize64); + printf("ULONGLONG HiBlockTableSize64 = %016llX\n", pHeader->HiBlockTableSize64); + printf("ULONGLONG HetTableSize64 = %016llX\n", pHeader->HetTableSize64); + printf("ULONGLONG BetTableSize64 = %016llX\n", pHeader->BetTableSize64); + printf("DWORD dwRawChunkSize = %08lX\n", pHeader->dwRawChunkSize); + printf("-----------------------------------------------\n\n"); +} + +void DumpHetAndBetTable(TMPQHetTable * pHetTable, TMPQBetTable * pBetTable) +{ + DWORD i; + + if(pHetTable == NULL || pBetTable == NULL) + return; + + printf("== HET Header =================================\n"); + printf("ULONGLONG AndMask64 = %016llX\n", pHetTable->AndMask64); + printf("ULONGLONG OrMask64 = %016llX\n", pHetTable->OrMask64); + printf("DWORD dwIndexSizeTotal = %08lX\n", pHetTable->dwIndexSizeTotal); + printf("DWORD dwIndexSizeExtra = %08lX\n", pHetTable->dwIndexSizeExtra); + printf("DWORD dwIndexSize = %08lX\n", pHetTable->dwIndexSize); + printf("DWORD dwMaxFileCount = %08lX\n", pHetTable->dwMaxFileCount); + printf("DWORD dwHashTableSize = %08lX\n", pHetTable->dwHashTableSize); + printf("DWORD dwHashBitSize = %08lX\n", pHetTable->dwHashBitSize); + printf("-----------------------------------------------\n\n"); + + printf("== BET Header =================================\n"); + printf("DWORD dwTableEntrySize = %08lX\n", pBetTable->dwTableEntrySize); + printf("DWORD dwBitIndex_FilePos = %08lX\n", pBetTable->dwBitIndex_FilePos); + printf("DWORD dwBitIndex_FileSize = %08lX\n", pBetTable->dwBitIndex_FileSize); + printf("DWORD dwBitIndex_CmpSize = %08lX\n", pBetTable->dwBitIndex_CmpSize); + printf("DWORD dwBitIndex_FlagIndex = %08lX\n", pBetTable->dwBitIndex_FlagIndex); + printf("DWORD dwBitIndex_Unknown = %08lX\n", pBetTable->dwBitIndex_Unknown); + printf("DWORD dwBitCount_FilePos = %08lX\n", pBetTable->dwBitCount_FilePos); + printf("DWORD dwBitCount_FileSize = %08lX\n", pBetTable->dwBitCount_FileSize); + printf("DWORD dwBitCount_CmpSize = %08lX\n", pBetTable->dwBitCount_CmpSize); + printf("DWORD dwBitCount_FlagIndex = %08lX\n", pBetTable->dwBitCount_FlagIndex); + printf("DWORD dwBitCount_Unknown = %08lX\n", pBetTable->dwBitCount_Unknown); + printf("DWORD dwBetHashSizeTotal = %08lX\n", pBetTable->dwBetHashSizeTotal); + printf("DWORD dwBetHashSizeExtra = %08lX\n", pBetTable->dwBetHashSizeExtra); + printf("DWORD dwBetHashSize = %08lX\n", pBetTable->dwBetHashSize); + printf("DWORD dwMaxFileCount = %08lX\n", pBetTable->dwMaxFileCount); + printf("DWORD dwFlagCount = %08lX\n", pBetTable->dwFlagCount); + printf("-----------------------------------------------\n\n"); + + printf("== HET & Bet Table ======================================================================\n\n"); + printf("HetIdx HetHash BetIdx BetHash ByteOffset FileSize CmpSize FlgIdx Flags \n"); + printf("------ ------- ------ ---------------- ---------------- -------- -------- ------ --------\n"); + for(i = 0; i < pHetTable->dwHashTableSize; i++) + { + ULONGLONG ByteOffset = 0; + ULONGLONG BetHash = 0; + DWORD dwFileSize = 0; + DWORD dwCmpSize = 0; + DWORD dwFlagIndex = 0; + DWORD dwFlags = 0; + DWORD dwBetIndex = 0; + + pHetTable->pBetIndexes->GetBits(i * pHetTable->dwIndexSizeTotal, + pHetTable->dwIndexSize, + &dwBetIndex, + 4); + + if(dwBetIndex < pHetTable->dwMaxFileCount) + { + DWORD dwEntryIndex = pBetTable->dwTableEntrySize * dwBetIndex; + + pBetTable->pBetHashes->GetBits(dwBetIndex * pBetTable->dwBetHashSizeTotal, + pBetTable->dwBetHashSize, + &BetHash, + 8); + + pBetTable->pFileTable->GetBits(dwEntryIndex + pBetTable->dwBitIndex_FilePos, + pBetTable->dwBitCount_FilePos, + &ByteOffset, + 8); + + pBetTable->pFileTable->GetBits(dwEntryIndex + pBetTable->dwBitIndex_FileSize, + pBetTable->dwBitCount_FileSize, + &dwFileSize, + 4); + + pBetTable->pFileTable->GetBits(dwEntryIndex + pBetTable->dwBitIndex_CmpSize, + pBetTable->dwBitCount_CmpSize, + &dwCmpSize, + 4); + + pBetTable->pFileTable->GetBits(dwEntryIndex + pBetTable->dwBitIndex_FlagIndex, + pBetTable->dwBitCount_FlagIndex, + &dwFlagIndex, + 4); + + dwFlags = pBetTable->pFileFlags[dwFlagIndex]; + } + + printf(" %04lX %02lX %04lX %016llX %016llX %08lX %08lX %04lX %08lX\n", i, + pHetTable->pHetHashes[i], + dwBetIndex, + BetHash, + ByteOffset, + dwFileSize, + dwCmpSize, + dwFlagIndex, + dwFlags); + } + printf("-----------------------------------------------------------------------------------------\n"); +} + +#endif // __STORMLIB_DUMP_DATA__ diff --git a/dep/StormLib/src/SBaseFileTable.cpp b/dep/StormLib/src/SBaseFileTable.cpp new file mode 100644 index 00000000000..83d31bbac94 --- /dev/null +++ b/dep/StormLib/src/SBaseFileTable.cpp @@ -0,0 +1,2477 @@ +/*****************************************************************************/ +/* SBaseFileTable.cpp Copyright (c) Ladislav Zezula 2010 */ +/*---------------------------------------------------------------------------*/ +/* Description: Common handler for classic and new hash&block tables */ +/*---------------------------------------------------------------------------*/ +/* Date Ver Who Comment */ +/* -------- ---- --- ------- */ +/* 06.09.10 1.00 Lad The first version of SBaseFileTable.cpp */ +/*****************************************************************************/ + +#define __STORMLIB_SELF__ +#include "StormLib.h" +#include "StormCommon.h" + +//----------------------------------------------------------------------------- +// Local defines + +#define MAX_FLAG_INDEX 256 + +//----------------------------------------------------------------------------- +// Local structures + +// Structure for HET table header +typedef struct _HET_TABLE_HEADER +{ + DWORD dwTableSize; // Size of the entire HET table, including HET_TABLE_HEADER (in bytes) + DWORD dwMaxFileCount; // Maximum number of files in the MPQ + DWORD dwHashTableSize; // Size of the hash table (in bytes) + DWORD dwHashEntrySize; // Effective size of the hash entry (in bits) + DWORD dwIndexSizeTotal; // Total size of file index (in bits) + DWORD dwIndexSizeExtra; // Extra bits in the file index + DWORD dwIndexSize; // Effective size of the file index (in bits) + DWORD dwIndexTableSize; // Size of the block index subtable (in bytes) + +} HET_TABLE_HEADER, *PHET_TABLE_HEADER; + +// Structure for BET table header +typedef struct _BET_TABLE_HEADER +{ + DWORD dwTableSize; // Size of the entire BET table, including the header (in bytes) + DWORD dwFileCount; // Number of files in the BET table + DWORD dwUnknown08; + DWORD dwTableEntrySize; // Size of one table entry (in bits) + DWORD dwBitIndex_FilePos; // Bit index of the file position (within the entry record) + DWORD dwBitIndex_FileSize; // Bit index of the file size (within the entry record) + DWORD dwBitIndex_CmpSize; // Bit index of the compressed size (within the entry record) + DWORD dwBitIndex_FlagIndex; // Bit index of the flag index (within the entry record) + DWORD dwBitIndex_Unknown; // Bit index of the ??? (within the entry record) + DWORD dwBitCount_FilePos; // Bit size of file position (in the entry record) + DWORD dwBitCount_FileSize; // Bit size of file size (in the entry record) + DWORD dwBitCount_CmpSize; // Bit size of compressed file size (in the entry record) + DWORD dwBitCount_FlagIndex; // Bit size of flags index (in the entry record) + DWORD dwBitCount_Unknown; // Bit size of ??? (in the entry record) + DWORD dwBetHashSizeTotal; // Total size of the BET hash + DWORD dwBetHashSizeExtra; // Extra bits in the BET hash + DWORD dwBetHashSize; // Effective size of BET hash (in bits) + DWORD dwBetHashArraySize; // Size of BET hashes array, in bytes + DWORD dwFlagCount; // Number of flags in the following array + +} BET_TABLE_HEADER, *PBET_TABLE_HEADER; + +//----------------------------------------------------------------------------- +// Support for calculating bit sizes + +static DWORD GetNecessaryBitCount(ULONGLONG MaxValue) +{ + DWORD dwBitCount = 0; + + while(MaxValue > 0) + { + MaxValue >>= 1; + dwBitCount++; + } + + return dwBitCount; +} + +static BYTE GetFlagsComboIndex(DWORD dwFlags) +{ + BYTE FlagComboIndex = 0; + + // + // We only use 8 different bits. This allows us to + // construct 256 unique values for every possible combination of MPQ file flags. + // + + if(dwFlags & MPQ_FILE_IMPLODE) + FlagComboIndex |= 0x01; + dwFlags &= ~MPQ_FILE_IMPLODE; + + if(dwFlags & MPQ_FILE_COMPRESS) + FlagComboIndex |= 0x02; + dwFlags &= ~MPQ_FILE_COMPRESS; + + if(dwFlags & MPQ_FILE_ENCRYPTED) + FlagComboIndex |= 0x04; + dwFlags &= ~MPQ_FILE_ENCRYPTED; + + if(dwFlags & MPQ_FILE_FIX_KEY) + FlagComboIndex |= 0x08; + dwFlags &= ~MPQ_FILE_FIX_KEY; + + if(dwFlags & MPQ_FILE_PATCH_FILE) + FlagComboIndex |= 0x10; + dwFlags &= ~MPQ_FILE_PATCH_FILE; + + if(dwFlags & MPQ_FILE_SINGLE_UNIT) + FlagComboIndex |= 0x20; + dwFlags &= ~MPQ_FILE_SINGLE_UNIT; + + if(dwFlags & MPQ_FILE_DELETE_MARKER) + FlagComboIndex |= 0x40; + dwFlags &= ~MPQ_FILE_DELETE_MARKER; + + if(dwFlags & MPQ_FILE_SECTOR_CRC) + FlagComboIndex |= 0x80; + dwFlags &= ~MPQ_FILE_SECTOR_CRC; + + // Sanity check - the flags must now be zero + assert((dwFlags & 0x7FFFFFFF) == 0); + return FlagComboIndex; +} + +static DWORD GetFileFlagIndex(LPDWORD FlagArray, DWORD dwFlags) +{ + // Find free or equal entry in the flag array + for(DWORD dwFlagIndex = 0; dwFlagIndex < MAX_FLAG_INDEX; dwFlagIndex++) + { + if(FlagArray[dwFlagIndex] == 0 || FlagArray[dwFlagIndex] == dwFlags) + { + FlagArray[dwFlagIndex] = dwFlags; + return dwFlagIndex; + } + } + + // This should never happen + assert(false); + return 0xFFFFFFFF; +} + +//----------------------------------------------------------------------------- +// Support functions for BIT_ARRAY + +static USHORT SetBitsMask[] = {0x00, 0x01, 0x03, 0x07, 0x0F, 0x1F, 0x3F, 0x7F, 0xFF}; + +static TBitArray * CreateBitArray( + DWORD NumberOfBits, + BYTE FillValue) +{ + TBitArray * pBitArray; + size_t nSize = sizeof(TBitArray) + (NumberOfBits + 7) / 8; + + // Allocate the bit array + pBitArray = (TBitArray *)STORM_ALLOC(BYTE, nSize); + if(pBitArray != NULL) + { + memset(pBitArray, FillValue, nSize); + pBitArray->NumberOfBits = NumberOfBits; + } + + return pBitArray; +} + +void TBitArray::GetBits( + unsigned int nBitPosition, + unsigned int nBitLength, + void * pvBuffer, + int nResultByteSize) +{ + unsigned char * pbBuffer = (unsigned char *)pvBuffer; + unsigned int nBytePosition0 = (nBitPosition / 8); + unsigned int nBytePosition1 = nBytePosition0 + 1; + unsigned int nByteLength = (nBitLength / 8); + unsigned int nBitOffset = (nBitPosition & 0x07); + unsigned char BitBuffer; + + // Keep compiler happy for platforms where nResultByteSize is not used + nResultByteSize = nResultByteSize; + +#ifdef _DEBUG + // Check if the target is properly zeroed + for(int i = 0; i < nResultByteSize; i++) + assert(pbBuffer[i] == 0); +#endif + +#ifndef PLATFORM_LITTLE_ENDIAN + // Adjust the buffer pointer for big endian platforms + pbBuffer += (nResultByteSize - 1); +#endif + + // Copy whole bytes, if any + while(nByteLength > 0) + { + // Is the current position in the Elements byte-aligned? + if(nBitOffset != 0) + { + BitBuffer = (unsigned char)((Elements[nBytePosition0] >> nBitOffset) | (Elements[nBytePosition1] << (0x08 - nBitOffset))); + } + else + { + BitBuffer = Elements[nBytePosition0]; + } + +#ifdef PLATFORM_LITTLE_ENDIAN + *pbBuffer++ = BitBuffer; +#else + *pbBuffer-- = BitBuffer; +#endif + + // Move byte positions and lengths + nBytePosition1++; + nBytePosition0++; + nByteLength--; + } + + // Get the rest of the bits + nBitLength = (nBitLength & 0x07); + if(nBitLength != 0) + { + *pbBuffer = (unsigned char)(Elements[nBytePosition0] >> nBitOffset); + + if(nBitLength > (8 - nBitOffset)) + *pbBuffer = (unsigned char)((Elements[nBytePosition1] << (8 - nBitOffset)) | (Elements[nBytePosition0] >> nBitOffset)); + + *pbBuffer &= (0x01 << nBitLength) - 1; + } +} + +void TBitArray::SetBits( + unsigned int nBitPosition, + unsigned int nBitLength, + void * pvBuffer, + int nResultByteSize) +{ + unsigned char * pbBuffer = (unsigned char *)pvBuffer; + unsigned int nBytePosition = (nBitPosition / 8); + unsigned int nBitOffset = (nBitPosition & 0x07); + unsigned short BitBuffer = 0; + unsigned short AndMask = 0; + unsigned short OneByte = 0; + + // Keep compiler happy for platforms where nResultByteSize is not used + nResultByteSize = nResultByteSize; + +#ifndef PLATFORM_LITTLE_ENDIAN + // Adjust the buffer pointer for big endian platforms + pbBuffer += (nResultByteSize - 1); +#endif + + // Copy whole bytes, if any + while(nBitLength > 8) + { + // Reload the bit buffer +#ifdef PLATFORM_LITTLE_ENDIAN + OneByte = *pbBuffer++; +#else + OneByte = *pbBuffer--; +#endif + // Update the BitBuffer and AndMask for the bit array + BitBuffer = (BitBuffer >> 0x08) | (OneByte << nBitOffset); + AndMask = (AndMask >> 0x08) | (0x00FF << nBitOffset); + + // Update the byte in the array + Elements[nBytePosition] = (BYTE)((Elements[nBytePosition] & ~AndMask) | BitBuffer); + + // Move byte positions and lengths + nBytePosition++; + nBitLength -= 0x08; + } + + if(nBitLength != 0) + { + // Reload the bit buffer + OneByte = *pbBuffer; + + // Update the AND mask for the last bit + BitBuffer = (BitBuffer >> 0x08) | (OneByte << nBitOffset); + AndMask = (AndMask >> 0x08) | (SetBitsMask[nBitLength] << nBitOffset); + + // Update the byte in the array + Elements[nBytePosition] = (BYTE)((Elements[nBytePosition] & ~AndMask) | BitBuffer); + + // Update the next byte, if needed + if(AndMask & 0xFF00) + { + nBytePosition++; + BitBuffer >>= 0x08; + AndMask >>= 0x08; + + Elements[nBytePosition] = (BYTE)((Elements[nBytePosition] & ~AndMask) | BitBuffer); + } + } +} + + +//----------------------------------------------------------------------------- +// Support for hash table + +// Returns a hash table entry in the following order: +// 1) A hash table entry with the neutral locale +// 2) A hash table entry with any other locale +// 3) NULL +static TMPQHash * GetHashEntryAny(TMPQArchive * ha, const char * szFileName) +{ + TMPQHash * pHashNeutral = NULL; + TMPQHash * pFirstHash = GetFirstHashEntry(ha, szFileName); + TMPQHash * pHashAny = NULL; + TMPQHash * pHash = pFirstHash; + + // Parse the found hashes + while(pHash != NULL) + { + // If we found neutral hash, remember it + if(pHash->lcLocale == 0) + pHashNeutral = pHash; + if(pHashAny == NULL) + pHashAny = pHash; + + // Get the next hash entry for that file + pHash = GetNextHashEntry(ha, pFirstHash, pHash); + } + + // At the end, return neutral hash (if found), otherwise NULL + return (pHashNeutral != NULL) ? pHashNeutral : pHashAny; +} + +// Returns a hash table entry in the following order: +// 1) A hash table entry with the preferred locale +// 2) A hash table entry with the neutral locale +// 3) NULL +static TMPQHash * GetHashEntryLocale(TMPQArchive * ha, const char * szFileName, LCID lcLocale) +{ + TMPQHash * pHashNeutral = NULL; + TMPQHash * pFirstHash = GetFirstHashEntry(ha, szFileName); + TMPQHash * pHash = pFirstHash; + + // Parse the found hashes + while(pHash != NULL) + { + // If the locales match, return it + if(pHash->lcLocale == lcLocale) + return pHash; + + // If we found neutral hash, remember it + if(pHash->lcLocale == 0) + pHashNeutral = pHash; + + // Get the next hash entry for that file + pHash = GetNextHashEntry(ha, pFirstHash, pHash); + } + + // At the end, return neutral hash (if found), otherwise NULL + return pHashNeutral; +} + +// Returns a hash table entry in the following order: +// 1) A hash table entry with the preferred locale +// 2) NULL +static TMPQHash * GetHashEntryExact(TMPQArchive * ha, const char * szFileName, LCID lcLocale) +{ + TMPQHash * pFirstHash = GetFirstHashEntry(ha, szFileName); + TMPQHash * pHash = pFirstHash; + + // Parse the found hashes + while(pHash != NULL) + { + // If the locales match, return it + if(pHash->lcLocale == lcLocale) + return pHash; + + // Get the next hash entry for that file + pHash = GetNextHashEntry(ha, pFirstHash, pHash); + } + + // Not found + return NULL; +} + +static TMPQHash * TranslateHashTable( + TMPQArchive * ha, + ULONGLONG * pcbTableSize) +{ + TMPQHash * pHashTable; + size_t HashTableSize; + + // Allocate copy of the hash table + pHashTable = STORM_ALLOC(TMPQHash, ha->pHeader->dwHashTableSize); + if(pHashTable != NULL) + { + // Copy the hash table + HashTableSize = sizeof(TMPQHash) * ha->pHeader->dwHashTableSize; + memcpy(pHashTable, ha->pHashTable, HashTableSize); + + // Give the size to the caller + if(pcbTableSize != NULL) + { + *pcbTableSize = (ULONGLONG)HashTableSize; + } + } + + return pHashTable; +} + +static TMPQBlock * TranslateBlockTable( + TMPQArchive * ha, + ULONGLONG * pcbTableSize, + bool * pbNeedHiBlockTable) +{ + TFileEntry * pFileEntry = ha->pFileTable; + TMPQBlock * pBlockTable; + TMPQBlock * pBlock; + size_t BlockTableSize; + bool bNeedHiBlockTable = false; + + // Allocate copy of the hash table + pBlockTable = pBlock = STORM_ALLOC(TMPQBlock, ha->dwFileTableSize); + if(pBlockTable != NULL) + { + // Copy the block table + BlockTableSize = sizeof(TMPQBlock) * ha->dwFileTableSize; + for(DWORD i = 0; i < ha->dwFileTableSize; i++) + { + if(pFileEntry->ByteOffset >> 32) + bNeedHiBlockTable = true; + pBlock->dwFilePos = (DWORD)pFileEntry->ByteOffset; + pBlock->dwFSize = pFileEntry->dwFileSize; + pBlock->dwCSize = pFileEntry->dwCmpSize; + pBlock->dwFlags = pFileEntry->dwFlags; + + pFileEntry++; + pBlock++; + } + + // Give the size to the caller + if(pcbTableSize != NULL) + *pcbTableSize = (ULONGLONG)BlockTableSize; + + if(pbNeedHiBlockTable != NULL) + *pbNeedHiBlockTable = bNeedHiBlockTable; + } + + return pBlockTable; +} + +static USHORT * TranslateHiBlockTable( + TMPQArchive * ha, + ULONGLONG * pcbTableSize) +{ + TFileEntry * pFileEntry = ha->pFileTable; + USHORT * pHiBlockTable; + USHORT * pHiBlock; + size_t HiBlockTableSize; + + // Allocate copy of the hash table + pHiBlockTable = pHiBlock = STORM_ALLOC(USHORT, ha->dwFileTableSize); + if(pHiBlockTable != NULL) + { + // Copy the block table + HiBlockTableSize = sizeof(USHORT) * ha->dwFileTableSize; + for(DWORD i = 0; i < ha->dwFileTableSize; i++) + pHiBlock[i] = (USHORT)(pFileEntry[i].ByteOffset >> 0x20); + + // Give the size to the caller + if(pcbTableSize != NULL) + *pcbTableSize = (ULONGLONG)HiBlockTableSize; + } + + return pHiBlockTable; +} + +//----------------------------------------------------------------------------- +// General EXT table functions + +TMPQExtTable * LoadExtTable( + TMPQArchive * ha, + ULONGLONG ByteOffset, + size_t Size, + DWORD dwSignature, + DWORD dwKey) +{ + TMPQExtTable * pCompressed = NULL; // Compressed table + TMPQExtTable * pExtTable = NULL; // Uncompressed table + + // Do nothing if the size is zero + if(ByteOffset != 0 && Size != 0) + { + // Allocate size for the compressed table + pExtTable = (TMPQExtTable *)STORM_ALLOC(BYTE, Size); + if(pExtTable != NULL) + { + // Load the table from the MPQ + ByteOffset += ha->MpqPos; + if(!FileStream_Read(ha->pStream, &ByteOffset, pExtTable, (DWORD)Size)) + { + STORM_FREE(pExtTable); + return NULL; + } + + // Swap the ext table header + BSWAP_ARRAY32_UNSIGNED(pExtTable, sizeof(TMPQExtTable)); + if(pExtTable->dwSignature != dwSignature) + { + STORM_FREE(pExtTable); + return NULL; + } + + // Decrypt the block + BSWAP_ARRAY32_UNSIGNED(pExtTable + 1, pExtTable->dwDataSize); + DecryptMpqBlock(pExtTable + 1, (DWORD)(Size - sizeof(TMPQExtTable)), dwKey); + BSWAP_ARRAY32_UNSIGNED(pExtTable + 1, pExtTable->dwDataSize); + + // If the table is compressed, decompress it + if((pExtTable->dwDataSize + sizeof(TMPQExtTable)) > Size) + { + pCompressed = pExtTable; + pExtTable = (TMPQExtTable *)STORM_ALLOC(BYTE, sizeof(TMPQExtTable) + pCompressed->dwDataSize); + if(pExtTable != NULL) + { + int cbOutBuffer = (int)pCompressed->dwDataSize; + int cbInBuffer = (int)Size; + + // Decompress the XXX block + pExtTable->dwSignature = pCompressed->dwSignature; + pExtTable->dwVersion = pCompressed->dwVersion; + pExtTable->dwDataSize = pCompressed->dwDataSize; + SCompDecompress((char *)(pExtTable + 1), &cbOutBuffer, (char *)(pCompressed + 1), cbInBuffer); + } + + // Free the compressed block + STORM_FREE(pCompressed); + } + } + } + + // Return the decompressed table to the caller + return pExtTable; +} + +// Used in MPQ Editor +void FreeExtTable(TMPQExtTable * pExtTable) +{ + STORM_FREE(pExtTable); +} + +static int SaveMpqTable( + TMPQArchive * ha, + void * pMpqTable, + ULONGLONG ByteOffset, + size_t Size, + unsigned char * md5, + DWORD dwKey, + bool bCompress) +{ + ULONGLONG FileOffset; + void * pCompressed = NULL; + int nError = ERROR_SUCCESS; + + // Do we have to compress the table? + if(bCompress) + { + int cbOutBuffer = (int)Size; + int cbInBuffer = (int)Size; + + // Allocate extra space for compressed table + pCompressed = STORM_ALLOC(BYTE, Size); + if(pCompressed == NULL) + return ERROR_NOT_ENOUGH_MEMORY; + + // Compress the table + SCompCompress((char *)pCompressed, &cbOutBuffer, (char *)pMpqTable, cbInBuffer, MPQ_COMPRESSION_ZLIB, 0, 0); + + // If the compression failed, revert it. Otherwise, swap the tables + if(cbOutBuffer >= cbInBuffer) + { + STORM_FREE(pCompressed); + pCompressed = NULL; + } + else + { + pMpqTable = pCompressed; + } + } + + // Encrypt the table + if(dwKey != 0) + { + BSWAP_ARRAY32_UNSIGNED(pMpqTable, Size); + EncryptMpqBlock(pMpqTable, (DWORD)Size, dwKey); + BSWAP_ARRAY32_UNSIGNED(pMpqTable, Size); + } + + // Calculate the MD5 + if(md5 != NULL) + { + CalculateDataBlockHash(pMpqTable, (DWORD)Size, md5); + } + + // Save the table to the MPQ + BSWAP_ARRAY32_UNSIGNED(pMpqTable, Size); + FileOffset = ha->MpqPos + ByteOffset; + if(!FileStream_Write(ha->pStream, &FileOffset, pMpqTable, (DWORD)Size)) + nError = GetLastError(); + + // Free the compressed table, if any + if(pCompressed != NULL) + STORM_FREE(pCompressed); + return nError; +} + +static int SaveExtTable( + TMPQArchive * ha, + TMPQExtTable * pExtTable, + ULONGLONG ByteOffset, + DWORD dwTableSize, + unsigned char * md5, + DWORD dwKey, + bool bCompress, + LPDWORD pcbTotalSize) +{ + ULONGLONG FileOffset; + TMPQExtTable * pCompressed = NULL; + DWORD cbTotalSize = 0; + int nError = ERROR_SUCCESS; + + // Do we have to compress the table? + if(bCompress) + { + int cbOutBuffer = (int)dwTableSize; + int cbInBuffer = (int)dwTableSize; + + // Allocate extra space for compressed table + pCompressed = (TMPQExtTable *)STORM_ALLOC(BYTE, dwTableSize); + if(pCompressed == NULL) + return ERROR_NOT_ENOUGH_MEMORY; + + // Compress the table + pCompressed->dwSignature = pExtTable->dwSignature; + pCompressed->dwVersion = pExtTable->dwVersion; + pCompressed->dwDataSize = pExtTable->dwDataSize; + SCompCompress((char *)(pCompressed + 1), &cbOutBuffer, (char *)(pExtTable + 1), cbInBuffer, MPQ_COMPRESSION_ZLIB, 0, 0); + + // If the compression failed, revert it. Otherwise, swap the tables + if(cbOutBuffer >= cbInBuffer) + { + STORM_FREE(pCompressed); + pCompressed = NULL; + } + else + { + pExtTable = pCompressed; + } + } + + // Encrypt the table + if(dwKey != 0) + { + BSWAP_ARRAY32_UNSIGNED(pExtTable + 1, pExtTable->dwDataSize); + EncryptMpqBlock(pExtTable + 1, (DWORD)(dwTableSize - sizeof(TMPQExtTable)), dwKey); + BSWAP_ARRAY32_UNSIGNED(pExtTable + 1, pExtTable->dwDataSize); + } + + // Calculate the MD5 of the table after + if(md5 != NULL) + { + CalculateDataBlockHash(pExtTable, dwTableSize, md5); + } + + // Save the table to the MPQ + FileOffset = ha->MpqPos + ByteOffset; + if(FileStream_Write(ha->pStream, &FileOffset, pExtTable, dwTableSize)) + cbTotalSize += dwTableSize; + else + nError = GetLastError(); + + // We have to write raw data MD5 + if(nError == ERROR_SUCCESS && ha->pHeader->dwRawChunkSize != 0) + { + nError = WriteMemDataMD5(ha->pStream, + FileOffset, + pExtTable, + dwTableSize, + ha->pHeader->dwRawChunkSize, + &cbTotalSize); + } + + // Give the total written size, if needed + if(pcbTotalSize != NULL) + *pcbTotalSize = cbTotalSize; + + // Free the compressed table, if any + if(pCompressed != NULL) + STORM_FREE(pCompressed); + return nError; +} + +//----------------------------------------------------------------------------- +// Support for HET table + +static void CreateHetHeader( + TMPQHetTable * pHetTable, + PHET_TABLE_HEADER pHetHeader) +{ + // Fill the BET header + pHetHeader->dwMaxFileCount = pHetTable->dwMaxFileCount; + pHetHeader->dwHashTableSize = pHetTable->dwHashTableSize; + pHetHeader->dwHashEntrySize = pHetTable->dwHashBitSize; + pHetHeader->dwIndexSizeTotal = GetNecessaryBitCount(pHetTable->dwMaxFileCount); + pHetHeader->dwIndexSizeExtra = 0; + pHetHeader->dwIndexSize = pHetHeader->dwIndexSizeTotal; + pHetHeader->dwIndexTableSize = ((pHetHeader->dwIndexSizeTotal * pHetTable->dwHashTableSize) + 7) / 8; + + // Calculate the total size needed for holding HET table + pHetHeader->dwTableSize = sizeof(HET_TABLE_HEADER) + + pHetHeader->dwHashTableSize + + pHetHeader->dwIndexTableSize; +} + +TMPQHetTable * CreateHetTable(DWORD dwMaxFileCount, DWORD dwHashBitSize, bool bCreateEmpty) +{ + TMPQHetTable * pHetTable; + + pHetTable = STORM_ALLOC(TMPQHetTable, 1); + if(pHetTable != NULL) + { + pHetTable->dwIndexSizeTotal = 0; + pHetTable->dwIndexSizeExtra = 0; + pHetTable->dwIndexSize = pHetTable->dwIndexSizeTotal; + pHetTable->dwMaxFileCount = dwMaxFileCount; + pHetTable->dwHashTableSize = (dwMaxFileCount * 4 / 3); + pHetTable->dwHashBitSize = dwHashBitSize; + + // Size of one index is calculated from max file count + pHetTable->dwIndexSizeTotal = GetNecessaryBitCount(dwMaxFileCount); + pHetTable->dwIndexSizeExtra = 0; + pHetTable->dwIndexSize = pHetTable->dwIndexSizeTotal; + + // Allocate hash table + pHetTable->pHetHashes = STORM_ALLOC(BYTE, pHetTable->dwHashTableSize); + memset(pHetTable->pHetHashes, 0, pHetTable->dwHashTableSize); + + // If we shall create empty HET table, we have to allocate empty block index table as well + if(bCreateEmpty) + pHetTable->pBetIndexes = CreateBitArray(pHetTable->dwHashTableSize * pHetTable->dwIndexSizeTotal, 0xFF); + + // Calculate masks + pHetTable->AndMask64 = 0; + if(dwHashBitSize != 0x40) + pHetTable->AndMask64 = (ULONGLONG)1 << dwHashBitSize; + pHetTable->AndMask64--; + + pHetTable->OrMask64 = (ULONGLONG)1 << (dwHashBitSize - 1); + } + + return pHetTable; +} + +static TMPQHetTable * TranslateHetTable(TMPQExtTable * pExtTable) +{ + HET_TABLE_HEADER HetHeader; + TMPQHetTable * pHetTable = NULL; + LPBYTE pbSrcData = (LPBYTE)(pExtTable + 1); + + // Sanity check + assert(pExtTable->dwSignature == HET_TABLE_SIGNATURE); + assert(pExtTable->dwVersion == 1); + + // Verify size of the HET table + if(pExtTable != NULL && pExtTable->dwDataSize >= sizeof(HET_TABLE_HEADER)) + { + // Copy the table header in order to have it aligned and swapped + memcpy(&HetHeader, pbSrcData, sizeof(HET_TABLE_HEADER)); + BSWAP_ARRAY32_UNSIGNED(&HetHeader, sizeof(HET_TABLE_HEADER)); + pbSrcData += sizeof(HET_TABLE_HEADER); + + // Verify the size of the table in the header + if(HetHeader.dwTableSize == pExtTable->dwDataSize) + { + // Create translated table + pHetTable = CreateHetTable(HetHeader.dwMaxFileCount, HetHeader.dwHashEntrySize, false); + if(pHetTable != NULL) + { + // Copy the hash table size, index size and extra bits from the HET header + pHetTable->dwHashTableSize = HetHeader.dwHashTableSize; + pHetTable->dwIndexSizeTotal = HetHeader.dwIndexSizeTotal; + pHetTable->dwIndexSizeExtra = HetHeader.dwIndexSizeExtra; + + // Fill the hash table + if(pHetTable->pHetHashes != NULL) + memcpy(pHetTable->pHetHashes, pbSrcData, pHetTable->dwHashTableSize); + pbSrcData += pHetTable->dwHashTableSize; + + // Copy the block index table + pHetTable->pBetIndexes = CreateBitArray(HetHeader.dwIndexTableSize * 8, 0xFF); + if(pHetTable->pBetIndexes != NULL) + memcpy(pHetTable->pBetIndexes->Elements, pbSrcData, HetHeader.dwIndexTableSize); + pbSrcData += HetHeader.dwIndexTableSize; + } + } + } + + return pHetTable; +} + +static TMPQExtTable * TranslateHetTable(TMPQHetTable * pHetTable, ULONGLONG * pcbHetTable) +{ + TMPQExtTable * pExtTable = NULL; + HET_TABLE_HEADER HetHeader; + LPBYTE pbLinearTable = NULL; + LPBYTE pbTrgData; + size_t HetTableSize; + + // Prepare header of the HET table + CreateHetHeader(pHetTable, &HetHeader); + + // Calculate the total size needed for holding the encrypted HET table + HetTableSize = HetHeader.dwTableSize; + + // Allocate space for the linear table + pbLinearTable = STORM_ALLOC(BYTE, sizeof(TMPQExtTable) + HetTableSize); + if(pbLinearTable != NULL) + { + // Create the common ext table header + pExtTable = (TMPQExtTable *)pbLinearTable; + pExtTable->dwSignature = HET_TABLE_SIGNATURE; + pExtTable->dwVersion = 1; + pExtTable->dwDataSize = (DWORD)HetTableSize; + pbTrgData = (LPBYTE)(pExtTable + 1); + + // Copy the HET table header + memcpy(pbTrgData, &HetHeader, sizeof(HET_TABLE_HEADER)); + BSWAP_ARRAY32_UNSIGNED(pbTrgData, sizeof(HET_TABLE_HEADER)); + pbTrgData += sizeof(HET_TABLE_HEADER); + + // Copy the array of HET hashes + memcpy(pbTrgData, pHetTable->pHetHashes, pHetTable->dwHashTableSize); + pbTrgData += pHetTable->dwHashTableSize; + + // Copy the bit array of BET indexes + memcpy(pbTrgData, pHetTable->pBetIndexes->Elements, HetHeader.dwIndexTableSize); + + // Calculate the total size of the table, including the TMPQExtTable + if(pcbHetTable != NULL) + { + *pcbHetTable = (ULONGLONG)(sizeof(TMPQExtTable) + HetTableSize); + } + } + + return pExtTable; +} + +DWORD GetFileIndex_Het(TMPQArchive * ha, const char * szFileName) +{ + TMPQHetTable * pHetTable = ha->pHetTable; + ULONGLONG FileNameHash; + ULONGLONG AndMask64; + ULONGLONG OrMask64; + ULONGLONG BetHash; + DWORD StartIndex; + DWORD Index; + BYTE HetHash; // Upper 8 bits of the masked file name hash + + // Do nothing if the MPQ has no HET table + assert(ha->pHetTable != NULL); + + // Calculate 64-bit hash of the file name + AndMask64 = pHetTable->AndMask64; + OrMask64 = pHetTable->OrMask64; + FileNameHash = (HashStringJenkins(szFileName) & AndMask64) | OrMask64; + + // Split the file name hash into two parts: + // Part 1: The highest 8 bits of the name hash + // Part 2: The rest of the name hash (without the highest 8 bits) + HetHash = (BYTE)(FileNameHash >> (pHetTable->dwHashBitSize - 8)); + BetHash = FileNameHash & (AndMask64 >> 0x08); + + // Calculate the starting index to the hash table + StartIndex = Index = (DWORD)(FileNameHash % pHetTable->dwHashTableSize); + + // Go through HET table until we find a terminator + while(pHetTable->pHetHashes[Index] != HET_ENTRY_FREE) + { + // Did we find match ? + if(pHetTable->pHetHashes[Index] == HetHash) + { + DWORD dwFileIndex = 0; + + // Get the index of the BetHash + pHetTable->pBetIndexes->GetBits(pHetTable->dwIndexSizeTotal * Index, + pHetTable->dwIndexSize, + &dwFileIndex, + 4); + + // + // TODO: This condition only happens when we are opening a MPQ + // where some files were deleted by StormLib. Perhaps + // we should not allow shrinking of the file table in MPQs v 4.0? + // assert(dwFileIndex <= ha->dwFileTableSize); + // + + // Verify the BetHash against the entry in the table of BET hashes + if(dwFileIndex <= ha->dwFileTableSize && ha->pFileTable[dwFileIndex].BetHash == BetHash) + return dwFileIndex; + } + + // Move to the next entry in the primary search table + // If we came to the start index again, we are done + Index = (Index + 1) % pHetTable->dwHashTableSize; + if(Index == StartIndex) + break; + } + + // File not found + return HASH_ENTRY_FREE; +} + +DWORD AllocateHetEntry( + TMPQArchive * ha, + TFileEntry * pFileEntry) +{ + TMPQHetTable * pHetTable = ha->pHetTable; + ULONGLONG FileNameHash; + ULONGLONG AndMask64; + ULONGLONG OrMask64; + ULONGLONG BetHash; + DWORD FreeHetIndex = HASH_ENTRY_FREE; + DWORD dwFileIndex; + DWORD StartIndex; + DWORD Index; + BYTE HetHash; // Upper 8 bits of the masked file name hash + + // Do nothing if the MPQ has no HET table + assert(ha->pHetTable != NULL); + + // Calculate 64-bit hash of the file name + AndMask64 = pHetTable->AndMask64; + OrMask64 = pHetTable->OrMask64; + FileNameHash = (HashStringJenkins(pFileEntry->szFileName) & AndMask64) | OrMask64; + + // Calculate the starting index to the hash table + StartIndex = Index = (DWORD)(FileNameHash % pHetTable->dwHashTableSize); + + // Split the file name hash into two parts: + // Part 1: The highest 8 bits of the name hash + // Part 2: The rest of the name hash (without the highest 8 bits) + HetHash = (BYTE)(FileNameHash >> (pHetTable->dwHashBitSize - 8)); + BetHash = FileNameHash & (AndMask64 >> 0x08); + + // Go through HET table until we find a terminator + for(;;) + { + // Check for entries that might have been deleted + if(pHetTable->pHetHashes[Index] == HET_ENTRY_DELETED) + { + DWORD dwInvalidBetIndex = (1 << pHetTable->dwIndexSizeTotal) - 1; + DWORD dwBetIndex = 0; + + // Verify the BET index. If it's really free, we can use it + dwFileIndex = (DWORD)(pFileEntry - ha->pFileTable); + pHetTable->pBetIndexes->GetBits(pHetTable->dwIndexSizeTotal * Index, + pHetTable->dwIndexSize, + &dwBetIndex, + 4); + + if(dwBetIndex == dwInvalidBetIndex) + { + FreeHetIndex = Index; + break; + } + } + + // Is that entry free ? + if(pHetTable->pHetHashes[Index] == HET_ENTRY_FREE) + { + FreeHetIndex = Index; + break; + } + + // Move to the next entry in the primary search table + // If we came to the start index again, we are done + Index = (Index + 1) % pHetTable->dwHashTableSize; + if(Index == StartIndex) + return HASH_ENTRY_FREE; + } + + // Fill the HET table entry + dwFileIndex = (DWORD)(pFileEntry - ha->pFileTable); + pHetTable->pHetHashes[FreeHetIndex] = HetHash; + pHetTable->pBetIndexes->SetBits(pHetTable->dwIndexSizeTotal * FreeHetIndex, + pHetTable->dwIndexSize, + &dwFileIndex, + 4); + // Fill the file entry + pFileEntry->BetHash = BetHash; + pFileEntry->dwHetIndex = FreeHetIndex; + return FreeHetIndex; +} + +void FreeHetTable(TMPQHetTable * pHetTable) +{ + if(pHetTable != NULL) + { + if(pHetTable->pHetHashes != NULL) + STORM_FREE(pHetTable->pHetHashes); + if(pHetTable->pBetIndexes != NULL) + STORM_FREE(pHetTable->pBetIndexes); + + STORM_FREE(pHetTable); + } +} + +//----------------------------------------------------------------------------- +// Support for BET table + +static void CreateBetHeader( + TMPQArchive * ha, + PBET_TABLE_HEADER pBetHeader) +{ + TFileEntry * pFileTableEnd = ha->pFileTable + ha->dwFileTableSize; + TFileEntry * pFileEntry; + ULONGLONG MaxByteOffset = 0; + DWORD dwMaxFileSize = 0; + DWORD dwMaxCmpSize = 0; + DWORD dwFlagCount = 0; + BYTE FlagComboArray[MAX_FLAG_INDEX]; + BYTE FlagComboIndex; + + // Initialize array of flag combinations + memset(FlagComboArray, 0, sizeof(FlagComboArray)); + + // Get the maximum values for the BET table + for(pFileEntry = ha->pFileTable; pFileEntry < pFileTableEnd; pFileEntry++) + { + // We don't allow the file table to have free entries in the middle + // This must be a bug in the library somewhere. + if((pFileEntry->dwFlags & MPQ_FILE_EXISTS) == 0) + { + pFileEntry->dwFlags = MPQ_FILE_EXISTS | MPQ_FILE_DELETE_MARKER; + assert(false); + } + + // Highest file position in the MPQ + if(pFileEntry->ByteOffset > MaxByteOffset) + MaxByteOffset = pFileEntry->ByteOffset; + + // Biggest file size + if(pFileEntry->dwFileSize > dwMaxFileSize) + dwMaxFileSize = pFileEntry->dwFileSize; + + // Biggest compressed size + if(pFileEntry->dwCmpSize > dwMaxCmpSize) + dwMaxCmpSize = pFileEntry->dwCmpSize; + + // Check if this flag was there before + FlagComboIndex = GetFlagsComboIndex(pFileEntry->dwFlags); + if(FlagComboArray[FlagComboIndex] == 0) + dwFlagCount++; + FlagComboArray[FlagComboIndex] = 1; + } + + // Now save bit count for every piece of file information + pBetHeader->dwBitIndex_FilePos = 0; + pBetHeader->dwBitCount_FilePos = GetNecessaryBitCount(MaxByteOffset); + + pBetHeader->dwBitIndex_FileSize = pBetHeader->dwBitIndex_FilePos + pBetHeader->dwBitCount_FilePos; + pBetHeader->dwBitCount_FileSize = GetNecessaryBitCount(dwMaxFileSize); + + pBetHeader->dwBitIndex_CmpSize = pBetHeader->dwBitIndex_FileSize + pBetHeader->dwBitCount_FileSize; + pBetHeader->dwBitCount_CmpSize = GetNecessaryBitCount(dwMaxCmpSize); + + pBetHeader->dwBitIndex_FlagIndex = pBetHeader->dwBitIndex_CmpSize + pBetHeader->dwBitCount_CmpSize; + pBetHeader->dwBitCount_FlagIndex = GetNecessaryBitCount(dwFlagCount); + + pBetHeader->dwBitIndex_Unknown = pBetHeader->dwBitIndex_FlagIndex + pBetHeader->dwBitCount_FlagIndex; + pBetHeader->dwBitCount_Unknown = 0; + + // Calculate the total size of one entry + pBetHeader->dwTableEntrySize = pBetHeader->dwBitCount_FilePos + + pBetHeader->dwBitCount_FileSize + + pBetHeader->dwBitCount_CmpSize + + pBetHeader->dwBitCount_FlagIndex + + pBetHeader->dwBitCount_Unknown; + + // Save the file count and flag count + pBetHeader->dwFileCount = ha->dwFileTableSize; + pBetHeader->dwFlagCount = dwFlagCount; + pBetHeader->dwUnknown08 = 0x10; + + // Save the total size of the BET hash + pBetHeader->dwBetHashSizeTotal = ha->pHetTable->dwHashBitSize - 0x08; + pBetHeader->dwBetHashSizeExtra = 0; + pBetHeader->dwBetHashSize = pBetHeader->dwBetHashSizeTotal; + pBetHeader->dwBetHashArraySize = ((pBetHeader->dwBetHashSizeTotal * pBetHeader->dwFileCount) + 7) / 8; + + // Save the total table size + pBetHeader->dwTableSize = sizeof(BET_TABLE_HEADER) + + pBetHeader->dwFlagCount * sizeof(DWORD) + + ((pBetHeader->dwTableEntrySize * pBetHeader->dwFileCount) + 7) / 8 + + pBetHeader->dwBetHashArraySize; +} + +TMPQBetTable * CreateBetTable(DWORD dwFileCount) +{ + TMPQBetTable * pBetTable; + + // Allocate BET table + pBetTable = STORM_ALLOC(TMPQBetTable, 1); + if(pBetTable != NULL) + { + memset(pBetTable, 0, sizeof(TMPQBetTable)); + pBetTable->dwFileCount = dwFileCount; + } + + return pBetTable; +} + +static TMPQBetTable * TranslateBetTable( + TMPQArchive * ha, + TMPQExtTable * pExtTable) +{ + BET_TABLE_HEADER BetHeader; + TMPQBetTable * pBetTable = NULL; + LPBYTE pbSrcData = (LPBYTE)(pExtTable + 1); + DWORD LengthInBytes; + + // Sanity check + assert(pExtTable->dwSignature == BET_TABLE_SIGNATURE); + assert(pExtTable->dwVersion == 1); + assert(ha->pHetTable != NULL); + ha = ha; + + // Verify size of the HET table + if(pExtTable != NULL && pExtTable->dwDataSize >= sizeof(BET_TABLE_HEADER)) + { + // Copy the table header in order to have it aligned and swapped + memcpy(&BetHeader, pbSrcData, sizeof(BET_TABLE_HEADER)); + BSWAP_ARRAY32_UNSIGNED(&BetHeader, sizeof(BET_TABLE_HEADER)); + pbSrcData += sizeof(BET_TABLE_HEADER); + + // Some MPQs affected by a bug in StormLib have pBetTable->dwFileCount + // greater than ha->dwMaxFileCount + if(BetHeader.dwFileCount > ha->dwMaxFileCount) + return NULL; + + // Verify the size of the table in the header + if(BetHeader.dwTableSize == pExtTable->dwDataSize) + { + // Create translated table + pBetTable = CreateBetTable(BetHeader.dwFileCount); + if(pBetTable != NULL) + { + // Copy the variables from the header to the BetTable + pBetTable->dwTableEntrySize = BetHeader.dwTableEntrySize; + pBetTable->dwBitIndex_FilePos = BetHeader.dwBitIndex_FilePos; + pBetTable->dwBitIndex_FileSize = BetHeader.dwBitIndex_FileSize; + pBetTable->dwBitIndex_CmpSize = BetHeader.dwBitIndex_CmpSize; + pBetTable->dwBitIndex_FlagIndex = BetHeader.dwBitIndex_FlagIndex; + pBetTable->dwBitIndex_Unknown = BetHeader.dwBitIndex_Unknown; + pBetTable->dwBitCount_FilePos = BetHeader.dwBitCount_FilePos; + pBetTable->dwBitCount_FileSize = BetHeader.dwBitCount_FileSize; + pBetTable->dwBitCount_CmpSize = BetHeader.dwBitCount_CmpSize; + pBetTable->dwBitCount_FlagIndex = BetHeader.dwBitCount_FlagIndex; + pBetTable->dwBitCount_Unknown = BetHeader.dwBitCount_Unknown; + + // Since we don't know what the "unknown" is, we'll assert when it's nonzero + assert(pBetTable->dwBitCount_Unknown == 0); + + // Allocate array for flags + if(BetHeader.dwFlagCount != 0) + { + // Allocate array for file flags and load it + pBetTable->pFileFlags = STORM_ALLOC(DWORD, BetHeader.dwFlagCount); + if(pBetTable->pFileFlags != NULL) + { + LengthInBytes = BetHeader.dwFlagCount * sizeof(DWORD); + memcpy(pBetTable->pFileFlags, pbSrcData, LengthInBytes); + BSWAP_ARRAY32_UNSIGNED(pBetTable->pFileFlags, LengthInBytes); + pbSrcData += LengthInBytes; + } + + // Save the number of flags + pBetTable->dwFlagCount = BetHeader.dwFlagCount; + } + + // Load the bit-based file table + pBetTable->pFileTable = CreateBitArray(pBetTable->dwTableEntrySize * BetHeader.dwFileCount, 0); + LengthInBytes = (pBetTable->pFileTable->NumberOfBits + 7) / 8; + if(pBetTable->pFileTable != NULL) + memcpy(pBetTable->pFileTable->Elements, pbSrcData, LengthInBytes); + pbSrcData += LengthInBytes; + + // Fill the sizes of BET hash + pBetTable->dwBetHashSizeTotal = BetHeader.dwBetHashSizeTotal; + pBetTable->dwBetHashSizeExtra = BetHeader.dwBetHashSizeExtra; + pBetTable->dwBetHashSize = BetHeader.dwBetHashSize; + + // Create and load the array of BET hashes + pBetTable->pBetHashes = CreateBitArray(pBetTable->dwBetHashSizeTotal * BetHeader.dwFileCount, 0); + LengthInBytes = (pBetTable->pBetHashes->NumberOfBits + 7) / 8; + if(pBetTable->pBetHashes != NULL) + memcpy(pBetTable->pBetHashes->Elements, pbSrcData, LengthInBytes); + pbSrcData += BetHeader.dwBetHashArraySize; + + // Dump both tables +// DumpHetAndBetTable(ha->pHetTable, pBetTable); + } + } + } + + return pBetTable; +} + +TMPQExtTable * TranslateBetTable( + TMPQArchive * ha, + ULONGLONG * pcbBetTable) +{ + TMPQExtTable * pExtTable = NULL; + BET_TABLE_HEADER BetHeader; + TBitArray * pBitArray = NULL; + LPBYTE pbLinearTable = NULL; + LPBYTE pbTrgData; + size_t BetTableSize; + DWORD LengthInBytes; + DWORD FlagArray[MAX_FLAG_INDEX]; + DWORD i; + + // Calculate the bit sizes of various entries + CreateBetHeader(ha, &BetHeader); + memset(FlagArray, 0, sizeof(FlagArray)); + + // Calculate the size of the BET table + BetTableSize = sizeof(BET_TABLE_HEADER) + + BetHeader.dwFlagCount * sizeof(DWORD) + + ((BetHeader.dwTableEntrySize * BetHeader.dwFileCount) + 7) / 8 + + BetHeader.dwBetHashArraySize; + + // Allocate space + pbLinearTable = STORM_ALLOC(BYTE, sizeof(TMPQExtTable) + BetTableSize); + if(pbLinearTable != NULL) + { + // Create the common ext table header + pExtTable = (TMPQExtTable *)pbLinearTable; + pExtTable->dwSignature = BET_TABLE_SIGNATURE; + pExtTable->dwVersion = 1; + pExtTable->dwDataSize = (DWORD)BetTableSize; + pbTrgData = (LPBYTE)(pExtTable + 1); + + // Copy the BET table header + memcpy(pbTrgData, &BetHeader, sizeof(BET_TABLE_HEADER)); + BSWAP_ARRAY32_UNSIGNED(pbTrgData, sizeof(BET_TABLE_HEADER)); + pbTrgData += sizeof(BET_TABLE_HEADER); + + // Save the bit-based block table + pBitArray = CreateBitArray(BetHeader.dwFileCount * BetHeader.dwTableEntrySize, 0); + if(pBitArray != NULL) + { + TFileEntry * pFileEntry = ha->pFileTable; + DWORD dwFlagIndex = 0; + DWORD nBitOffset = 0; + + // Construct the array of flag values and bit-based file table + for(i = 0; i < BetHeader.dwFileCount; i++, pFileEntry++) + { + // Only count files that exist + if(pFileEntry->dwFlags & MPQ_FILE_EXISTS) + { + // Save the byte offset + pBitArray->SetBits(nBitOffset + BetHeader.dwBitIndex_FilePos, + BetHeader.dwBitCount_FilePos, + &pFileEntry->ByteOffset, + 8); + pBitArray->SetBits(nBitOffset + BetHeader.dwBitIndex_FileSize, + BetHeader.dwBitCount_FileSize, + &pFileEntry->dwFileSize, + 4); + pBitArray->SetBits(nBitOffset + BetHeader.dwBitIndex_CmpSize, + BetHeader.dwBitCount_CmpSize, + &pFileEntry->dwCmpSize, + 4); + + // Get the flag array for the file + dwFlagIndex = GetFileFlagIndex(FlagArray, pFileEntry->dwFlags); + pBitArray->SetBits(nBitOffset + BetHeader.dwBitIndex_FlagIndex, + BetHeader.dwBitCount_FlagIndex, + &dwFlagIndex, + 4); + } + + // Move the bit offset + nBitOffset += BetHeader.dwTableEntrySize; + } + + // Write the array of flags + LengthInBytes = BetHeader.dwFlagCount * sizeof(DWORD); + memcpy(pbTrgData, FlagArray, LengthInBytes); + BSWAP_ARRAY32_UNSIGNED(pbTrgData, LengthInBytes); + pbTrgData += LengthInBytes; + + // Write the bit-based block table + LengthInBytes = (pBitArray->NumberOfBits + 7) / 8; + memcpy(pbTrgData, pBitArray->Elements, LengthInBytes); + pbTrgData += LengthInBytes; + + // Free the bit array + STORM_FREE(pBitArray); + } + + // Create bit array for BET hashes + pBitArray = CreateBitArray(BetHeader.dwBetHashSizeTotal * BetHeader.dwFileCount, 0); + if(pBitArray != NULL) + { + TFileEntry * pFileEntry = ha->pFileTable; + ULONGLONG AndMask64 = ha->pHetTable->AndMask64; + ULONGLONG OrMask64 = ha->pHetTable->OrMask64; + + for(i = 0; i < BetHeader.dwFileCount; i++) + { + ULONGLONG FileNameHash = 0; + + // Calculate 64-bit hash of the file name + if((pFileEntry->dwFlags & MPQ_FILE_EXISTS) && pFileEntry->szFileName != NULL) + { + FileNameHash = (HashStringJenkins(pFileEntry->szFileName) & AndMask64) | OrMask64; + FileNameHash = FileNameHash & (AndMask64 >> 0x08); + } + + // Insert the name hash to the bit array + pBitArray->SetBits(BetHeader.dwBetHashSizeTotal * i, + BetHeader.dwBetHashSize, + &FileNameHash, + 8); + + // Move to the next file entry + pFileEntry++; + } + + // Write the array of BET hashes + LengthInBytes = (pBitArray->NumberOfBits + 7) / 8; + memcpy(pbTrgData, pBitArray->Elements, LengthInBytes); + pbTrgData += LengthInBytes; + + // Free the bit array + STORM_FREE(pBitArray); + } + + // Write the size of the BET table in the MPQ + if(pcbBetTable != NULL) + { + *pcbBetTable = (ULONGLONG)(sizeof(TMPQExtTable) + BetTableSize); + } + } + + return pExtTable; +} + +void FreeBetTable(TMPQBetTable * pBetTable) +{ + if(pBetTable != NULL) + { + if(pBetTable->pFileTable != NULL) + STORM_FREE(pBetTable->pFileTable); + if(pBetTable->pFileFlags != NULL) + STORM_FREE(pBetTable->pFileFlags); + if(pBetTable->pBetHashes != NULL) + STORM_FREE(pBetTable->pBetHashes); + + STORM_FREE(pBetTable); + } +} + +//----------------------------------------------------------------------------- +// Support for file table + +TFileEntry * GetFileEntryAny(TMPQArchive * ha, const char * szFileName) +{ + TMPQHash * pHash; + DWORD dwFileIndex; + + // If we have HET table in the MPQ, try to find the file in HET table + if(ha->pHetTable != NULL) + { + dwFileIndex = GetFileIndex_Het(ha, szFileName); + if(dwFileIndex != HASH_ENTRY_FREE) + return ha->pFileTable + dwFileIndex; + } + + // Otherwise, perform the file search in the classic hash table + if(ha->pHashTable != NULL) + { + pHash = GetHashEntryAny(ha, szFileName); + if(pHash != NULL && pHash->dwBlockIndex < ha->dwFileTableSize) + return ha->pFileTable + pHash->dwBlockIndex; + } + + // Not found + return NULL; +} + +TFileEntry * GetFileEntryLocale(TMPQArchive * ha, const char * szFileName, LCID lcLocale) +{ + TMPQHash * pHash; + DWORD dwFileIndex; + + // If we have HET table in the MPQ, try to find the file in HET table + if(ha->pHetTable != NULL) + { + dwFileIndex = GetFileIndex_Het(ha, szFileName); + if(dwFileIndex != HASH_ENTRY_FREE) + return ha->pFileTable + dwFileIndex; + } + + // Otherwise, perform the file search in the classic hash table + if(ha->pHashTable != NULL) + { + pHash = GetHashEntryLocale(ha, szFileName, lcLocale); + if(pHash != NULL && pHash->dwBlockIndex < ha->dwFileTableSize) + return ha->pFileTable + pHash->dwBlockIndex; + } + + // Not found + return NULL; +} + +TFileEntry * GetFileEntryExact(TMPQArchive * ha, const char * szFileName, LCID lcLocale) +{ + TMPQHash * pHash; + DWORD dwFileIndex; + + // If we have HET table in the MPQ, try to find the file in HET table + if(ha->pHetTable != NULL) + { + dwFileIndex = GetFileIndex_Het(ha, szFileName); + if(dwFileIndex != HASH_ENTRY_FREE) + return ha->pFileTable + dwFileIndex; + } + + // Otherwise, perform the file search in the classic hash table + if(ha->pHashTable != NULL) + { + pHash = GetHashEntryExact(ha, szFileName, lcLocale); + if(pHash != NULL && pHash->dwBlockIndex < ha->dwFileTableSize) + return ha->pFileTable + pHash->dwBlockIndex; + } + + // Not found + return NULL; +} + +TFileEntry * GetFileEntryByIndex(TMPQArchive * ha, DWORD dwIndex) +{ + // For MPQs with classic hash table + if(dwIndex < ha->dwFileTableSize) + return ha->pFileTable + dwIndex; + return NULL; +} + +void AllocateFileName(TFileEntry * pFileEntry, const char * szFileName) +{ + // Sanity check + assert(pFileEntry != NULL); + + // If the file name is pseudo file name, free it at this point + if(IsPseudoFileName(pFileEntry->szFileName, NULL)) + { + if(pFileEntry->szFileName != NULL) + STORM_FREE(pFileEntry->szFileName); + pFileEntry->szFileName = NULL; + } + + // Only allocate new file name if it's not there yet + if(pFileEntry->szFileName == NULL) + { + pFileEntry->szFileName = STORM_ALLOC(char, strlen(szFileName) + 1); + if(pFileEntry->szFileName != NULL) + strcpy(pFileEntry->szFileName, szFileName); + } +} + + +// Finds a free file entry. Does NOT increment table size. +TFileEntry * FindFreeFileEntry(TMPQArchive * ha) +{ + TFileEntry * pFileTableEnd = ha->pFileTable + ha->dwFileTableSize; + TFileEntry * pDeletedEntry = NULL; + TFileEntry * pFileEntry; + + // Try to find a free entry + for(pFileEntry = ha->pFileTable; pFileEntry < pFileTableEnd; pFileEntry++) + { + // If that entry is free, we reuse it + if((pFileEntry->dwFlags & MPQ_FILE_EXISTS) == 0) + return pFileEntry; + + // If that entry is deleted, remember it + if(pFileEntry->dwFlags & MPQ_FILE_DELETE_MARKER) + pDeletedEntry = pFileEntry; + } + + // Do we have a deleted entry? + if(pDeletedEntry != NULL) + { + ClearFileEntry(ha, pDeletedEntry); + return pDeletedEntry; + } + + // If no file entry within the existing file table is free, + // we try the reserve space after current file table + if(ha->dwFileTableSize < ha->dwMaxFileCount) + return ha->pFileTable + ha->dwFileTableSize; + + // If we reached maximum file count, we cannot add more files to the MPQ + assert(ha->dwFileTableSize == ha->dwMaxFileCount); + return NULL; +} + + +TFileEntry * AllocateFileEntry(TMPQArchive * ha, const char * szFileName, LCID lcLocale) +{ + TFileEntry * pFileEntry = NULL; + TMPQHash * pHash; + DWORD dwHashIndex; + DWORD dwFileIndex; + bool bHashEntryExists = false; + bool bHetEntryExists = false; + + // If the archive has classic hash table, we try to + // find the file in the hash table + if(ha->pHashTable != NULL) + { + // If the hash entry is already there, we reuse the file entry + pHash = GetHashEntryExact(ha, szFileName, lcLocale); + if(pHash != NULL) + { + pFileEntry = ha->pFileTable + pHash->dwBlockIndex; + bHashEntryExists = true; + } + } + + // If the archive has HET table, try to use it for + // finding the file + if(ha->pHetTable != NULL) + { + dwFileIndex = GetFileIndex_Het(ha, szFileName); + if(dwFileIndex != HASH_ENTRY_FREE) + { + pFileEntry = ha->pFileTable + dwFileIndex; + bHetEntryExists = true; + } + } + + // If still haven't found the file entry, we allocate new one + if(pFileEntry == NULL) + { + pFileEntry = FindFreeFileEntry(ha); + if(pFileEntry == NULL) + return NULL; + } + + // Fill the rest of the file entry + pFileEntry->ByteOffset = 0; + pFileEntry->FileTime = 0; + pFileEntry->dwFileSize = 0; + pFileEntry->dwCmpSize = 0; + pFileEntry->dwFlags = 0; + pFileEntry->lcLocale = 0; + pFileEntry->wPlatform = 0; + pFileEntry->dwCrc32 = 0; + memset(pFileEntry->md5, 0, MD5_DIGEST_SIZE); + + // Allocate space for file name, if it's not there yet + AllocateFileName(pFileEntry, szFileName); + + // If the free file entry is at the end of the file table, + // we have to increment file table size + if(pFileEntry == ha->pFileTable + ha->dwFileTableSize) + { + assert(ha->dwFileTableSize < ha->dwMaxFileCount); + ha->pHeader->dwBlockTableSize++; + ha->dwFileTableSize++; + } + + // If the MPQ has hash table, we have to insert the new entry into the hash table + if(ha->pHashTable != NULL && bHashEntryExists == false) + { + dwHashIndex = AllocateHashEntry(ha, pFileEntry); + assert(dwHashIndex != HASH_ENTRY_FREE); + } + + // If the MPQ has HET table, we have to insert it to the HET table as well + if(ha->pHetTable != NULL && bHetEntryExists == false) + { + // TODO: Does HET table even support locales? + // Most probably, Blizzard gave up that silly idea long ago. + dwHashIndex = AllocateHetEntry(ha, pFileEntry); + assert(dwHashIndex != HASH_ENTRY_FREE); + } + + // Return the file entry + return pFileEntry; +} + +int RenameFileEntry( + TMPQArchive * ha, + TFileEntry * pFileEntry, + const char * szNewFileName) +{ + TMPQHash * pHash; + DWORD dwFileIndex; + int nError = ERROR_SUCCESS; + + // If the MPQ has classic hash table, clear the entry there + if(ha->pHashTable != NULL) + { + assert(pFileEntry->dwHashIndex < ha->pHeader->dwHashTableSize); + + pHash = ha->pHashTable + pFileEntry->dwHashIndex; + memset(pHash, 0xFF, sizeof(TMPQHash)); + pHash->dwBlockIndex = HASH_ENTRY_DELETED; + } + + // If the MPQ has HET table, clear the entry there as well + if(ha->pHetTable != NULL) + { + TMPQHetTable * pHetTable = ha->pHetTable; + DWORD dwInvalidFileIndex = (1 << pHetTable->dwIndexSizeTotal) - 1; + + assert(pFileEntry->dwHetIndex < pHetTable->dwHashTableSize); + + // Clear the entry in the HET hash array + pHetTable->pHetHashes[pFileEntry->dwHetIndex] = HET_ENTRY_DELETED; + + // Set the BET index to invalid index + pHetTable->pBetIndexes->SetBits(pHetTable->dwIndexSizeTotal * pFileEntry->dwHetIndex, + pHetTable->dwIndexSize, + &dwInvalidFileIndex, + 4); + } + + // Free the old file name + if(pFileEntry->szFileName != NULL) + STORM_FREE(pFileEntry->szFileName); + pFileEntry->szFileName = NULL; + + // Allocate new file name + AllocateFileName(pFileEntry, szNewFileName); + + // Now find a hash entry for the new file name + if(ha->pHashTable != NULL) + { + // Try to find the hash table entry for the new file name + // Note: If this fails, we leave the MPQ in a corrupt state + dwFileIndex = AllocateHashEntry(ha, pFileEntry); + if(dwFileIndex == HASH_ENTRY_FREE) + nError = ERROR_FILE_CORRUPT; + } + + // If the archive has HET table, we have to allocate HET table for the file as well + // finding the file + if(ha->pHetTable != NULL) + { + dwFileIndex = AllocateHetEntry(ha, pFileEntry); + if(dwFileIndex == HASH_ENTRY_FREE) + nError = ERROR_FILE_CORRUPT; + } + + // Invalidate the entries for (listfile) and (attributes) + // After we are done with MPQ changes, we need to re-create them + InvalidateInternalFiles(ha); + return nError; +} + +void ClearFileEntry( + TMPQArchive * ha, + TFileEntry * pFileEntry) +{ + TMPQHash * pHash = NULL; + + // If the MPQ has classic hash table, clear the entry there + if(ha->pHashTable != NULL) + { + assert(pFileEntry->dwHashIndex < ha->pHeader->dwHashTableSize); + + pHash = ha->pHashTable + pFileEntry->dwHashIndex; + memset(pHash, 0xFF, sizeof(TMPQHash)); + pHash->dwBlockIndex = HASH_ENTRY_DELETED; + } + + // If the MPQ has HET table, clear the entry there as well + if(ha->pHetTable != NULL) + { + TMPQHetTable * pHetTable = ha->pHetTable; + DWORD dwInvalidFileIndex = (1 << pHetTable->dwIndexSizeTotal) - 1; + + assert(pFileEntry->dwHetIndex < pHetTable->dwHashTableSize); + + // Clear the entry in the HET hash array + pHetTable->pHetHashes[pFileEntry->dwHetIndex] = HET_ENTRY_DELETED; + + // Set the BET index to invalid index + pHetTable->pBetIndexes->SetBits(pHetTable->dwIndexSizeTotal * pFileEntry->dwHetIndex, + pHetTable->dwIndexSize, + &dwInvalidFileIndex, + 4); + } + + // Free the file name, and zero the entire entry + if(pFileEntry->szFileName != NULL) + STORM_FREE(pFileEntry->szFileName); + memset(pFileEntry, 0, sizeof(TFileEntry)); +} + +int FreeFileEntry( + TMPQArchive * ha, + TFileEntry * pFileEntry) +{ + TFileEntry * pFileTableEnd = ha->pFileTable + ha->dwFileTableSize; + TFileEntry * pTempEntry; + int nError = ERROR_SUCCESS; + + // + // If we have HET table, we cannot just get rid of the file + // Doing so would lead to empty gaps in the HET and BET tables + // We have to keep BET hash, hash index, HET index, locale, platform and file name + // + + if(ha->pHetTable == NULL) + { + TFileEntry * pLastFileEntry = ha->pFileTable + ha->dwFileTableSize - 1; + TFileEntry * pLastUsedEntry = pLastFileEntry; + + // Zero the file entry + ClearFileEntry(ha, pFileEntry); + + // Now there is a chance that we created a chunk of free + // file entries at the end of the file table. We check this + // and eventually free all deleted file entries at the end + for(pTempEntry = ha->pFileTable; pTempEntry < pFileTableEnd; pTempEntry++) + { + // Is that an occupied file entry? + if(pTempEntry->dwFlags & MPQ_FILE_EXISTS) + pLastUsedEntry = pTempEntry; + } + + // Can we free some entries at the end? + if(pLastUsedEntry < pLastFileEntry) + { + // Fix the size of the file table entry + ha->dwFileTableSize = (DWORD)(pLastUsedEntry - ha->pFileTable) + 1; + ha->pHeader->dwBlockTableSize = ha->dwFileTableSize; + } + } + else + { + memset(pFileEntry->md5, 0, MD5_DIGEST_SIZE); + pFileEntry->ByteOffset = 0; + pFileEntry->FileTime = 0; + pFileEntry->dwFileSize = 0; + pFileEntry->dwCmpSize = 0; + pFileEntry->dwFlags = MPQ_FILE_EXISTS | MPQ_FILE_DELETE_MARKER; + pFileEntry->dwCrc32 = 0; + nError = ERROR_MARKED_FOR_DELETE; + } + + return nError; +} + +void InvalidateInternalFiles(TMPQArchive * ha) +{ + TFileEntry * pFileEntry; + + // Invalidate the (listfile), if not done yet + if(!(ha->dwFlags & MPQ_FLAG_INV_LISTFILE)) + { + pFileEntry = GetFileEntryExact(ha, LISTFILE_NAME, LANG_NEUTRAL); + if(pFileEntry != NULL) + FreeFileEntry(ha, pFileEntry); + ha->dwFlags |= MPQ_FLAG_INV_LISTFILE; + } + + // Invalidate the (attributes), if not done yet + if(!(ha->dwFlags & MPQ_FLAG_INV_ATTRIBUTES)) + { + pFileEntry = GetFileEntryExact(ha, ATTRIBUTES_NAME, LANG_NEUTRAL); + if(pFileEntry != NULL) + FreeFileEntry(ha, pFileEntry); + ha->dwFlags |= MPQ_FLAG_INV_ATTRIBUTES; + } + + // Remember that the MPQ has been changed and it will ne necessary + // to update the tables + ha->dwFlags |= MPQ_FLAG_CHANGED; +} + +//----------------------------------------------------------------------------- +// Support for file tables - hash table, block table, hi-block table, +// (attributes) and (listfile) + +static void FixBlockTableSize( + TMPQArchive * ha, + TMPQBlock * pBlockTable, + DWORD dwClaimedSize) +{ + TMPQHeader * pHeader = ha->pHeader; + ULONGLONG BlockTableStart; + ULONGLONG BlockTableEnd; + ULONGLONG FileDataStart; + + // Only perform this check on MPQs version 1.0 + if(pHeader->dwHeaderSize == MPQ_HEADER_SIZE_V1) + { + // Calculate claimed block table begin and end + BlockTableStart = ha->MpqPos + MAKE_OFFSET64(pHeader->wBlockTablePosHi, pHeader->dwBlockTablePos); + BlockTableEnd = BlockTableStart + (pHeader->dwBlockTableSize * sizeof(TMPQBlock)); + + for(DWORD i = 0; i < dwClaimedSize; i++) + { + // If the block table end goes into that file, fix the block table end + FileDataStart = ha->MpqPos + pBlockTable[i].dwFilePos; + if(BlockTableStart < FileDataStart && BlockTableEnd > FileDataStart) + { + dwClaimedSize = (DWORD)((FileDataStart - BlockTableStart) / sizeof(TMPQBlock)); + BlockTableEnd = FileDataStart; + } + } + } + + // Fix the block table size + pHeader->BlockTableSize64 = dwClaimedSize * sizeof(TMPQBlock); + pHeader->dwBlockTableSize = dwClaimedSize; +} + +int CreateHashTable(TMPQArchive * ha, DWORD dwHashTableSize) +{ + TMPQHash * pHashTable; + + // Sanity checks + assert((dwHashTableSize & (dwHashTableSize - 1)) == 0); + assert(ha->pHashTable == NULL); + + // Create the hash table + pHashTable = STORM_ALLOC(TMPQHash, dwHashTableSize); + if(pHashTable == NULL) + return ERROR_NOT_ENOUGH_MEMORY; + + // Fill it + memset(pHashTable, 0xFF, dwHashTableSize * sizeof(TMPQHash)); + ha->pHashTable = pHashTable; + + // Set the max file count, if needed + if(ha->pHetTable == NULL) + ha->dwMaxFileCount = dwHashTableSize; + return ERROR_SUCCESS; +} + +int LoadHashTable(TMPQArchive * ha) +{ + TMPQHeader * pHeader = ha->pHeader; + ULONGLONG ByteOffset; + TMPQHash * pHashTable; + DWORD dwTableSize; + DWORD dwCmpSize; + int nError; + + // If the MPQ has no hash table, do nothing + if(pHeader->dwHashTablePos == 0 && pHeader->wHashTablePosHi == 0) + return ERROR_SUCCESS; + + // If the hash table size is zero, do nothing + if(pHeader->dwHashTableSize == 0) + return ERROR_SUCCESS; + + // Allocate buffer for the hash table + dwTableSize = pHeader->dwHashTableSize * sizeof(TMPQHash); + pHashTable = STORM_ALLOC(TMPQHash, pHeader->dwHashTableSize); + if(pHashTable == NULL) + return ERROR_NOT_ENOUGH_MEMORY; + + // Compressed size of the hash table + dwCmpSize = (DWORD)pHeader->HashTableSize64; + + // + // Load the table from the MPQ, with decompression + // + // Note: We will NOT check if the hash table is properly decrypted. + // Some MPQ protectors corrupt the hash table by rewriting part of it. + // Hash table, the way how it works, allows arbitrary values for unused entries. + // + + ByteOffset = ha->MpqPos + MAKE_OFFSET64(pHeader->wHashTablePosHi, pHeader->dwHashTablePos); + nError = LoadMpqTable(ha, ByteOffset, pHashTable, dwCmpSize, dwTableSize, MPQ_KEY_HASH_TABLE); + if(nError != ERROR_SUCCESS) + { + STORM_FREE(pHashTable); + pHashTable = NULL; + return nError; + } + + // Set the maximum file count to the size of the hash table + // In case there is HET table, we have to keep the file limit + if(ha->pHetTable == NULL) + ha->dwMaxFileCount = pHeader->dwHashTableSize; + + // Store the hash table to the MPQ + ha->pHashTable = pHashTable; + return ERROR_SUCCESS; +} + +int LoadHetTable(TMPQArchive * ha) +{ + TMPQExtTable * pExtTable; + TMPQHeader * pHeader = ha->pHeader; + int nError = ERROR_SUCCESS; + + // If the HET table position is not NULL, we expect + // both HET and BET tables to be present. + if(pHeader->HetTablePos64 != 0) + { + // Attempt to load the HET table (Hash Extended Table) + pExtTable = LoadExtTable(ha, pHeader->HetTablePos64, (size_t)pHeader->HetTableSize64, HET_TABLE_SIGNATURE, MPQ_KEY_HASH_TABLE); + if(pExtTable != NULL) + { + // If succeeded, we have to limit the maximum file count + // to the values saved in the HET table + // If loading HET table fails, we ignore the result. + ha->pHetTable = TranslateHetTable(pExtTable); + if(ha->pHetTable != NULL) + ha->dwMaxFileCount = ha->pHetTable->dwMaxFileCount; + + STORM_FREE(pExtTable); + } + + // If the HET hable failed to load, it's corrupt. + if(ha->pHetTable == NULL) + nError = ERROR_FILE_CORRUPT; + } + + return nError; +} + +TMPQBetTable * LoadBetTable(TMPQArchive * ha) +{ + TMPQExtTable * pExtTable; + TMPQBetTable * pBetTable = NULL; + TMPQHeader * pHeader = ha->pHeader; + + // If the HET table position is not NULL, we expect + // both HET and BET tables to be present. + if(pHeader->BetTablePos64 != 0) + { + // Attempt to load the HET table (Hash Extended Table) + pExtTable = LoadExtTable(ha, pHeader->BetTablePos64, (size_t)pHeader->BetTableSize64, BET_TABLE_SIGNATURE, MPQ_KEY_BLOCK_TABLE); + if(pExtTable != NULL) + { + // If succeeded, we translate the BET table + // to more readable form + pBetTable = TranslateBetTable(ha, pExtTable); + STORM_FREE(pExtTable); + } + } + + return pBetTable; +} + +int LoadAnyHashTable(TMPQArchive * ha) +{ + TMPQHeader * pHeader = ha->pHeader; + bool bHashTableLoaded = false; + + // If the MPQ archive is empty, don't bother trying to load anything + if(pHeader->dwHashTableSize == 0 && pHeader->HetTableSize64 == 0) + return CreateHashTable(ha, HASH_TABLE_SIZE_DEFAULT); + + // Try to load HET table + if(LoadHetTable(ha) == ERROR_SUCCESS) + bHashTableLoaded = true; + + // Try to load the classic hash table + if(LoadHashTable(ha) == ERROR_SUCCESS) + bHashTableLoaded = true; + + // In theory, a MPQ could have bigger block table than hash table + if(ha->pHeader->dwBlockTableSize > ha->dwMaxFileCount) + { + ha->dwMaxFileCount = ha->pHeader->dwBlockTableSize; + ha->dwFlags |= MPQ_FLAG_READ_ONLY; + } + + return bHashTableLoaded ? ERROR_SUCCESS : ERROR_FILE_CORRUPT; +} + +int BuildFileTable_Classic( + TMPQArchive * ha, + TFileEntry * pFileTable, + ULONGLONG FileSize) +{ + TFileEntry * pFileEntry; + TMPQHeader * pHeader = ha->pHeader; + TMPQBlock * pBlockTable; + TMPQBlock * pBlock; + int nError = ERROR_SUCCESS; + + // Sanity checks + assert(ha->pHashTable != NULL); + + // Do nothing if the size of the block table is zero + if(pHeader->dwBlockTablePos != 0 && pHeader->dwBlockTableSize != 0) + { + // Sanity check, enforced by LoadAnyHashTable + assert(ha->dwMaxFileCount >= pHeader->dwBlockTableSize); + + // Allocate space for the block table + // Note: pHeader->dwBlockTableSize can be zero !!! + pBlockTable = STORM_ALLOC(TMPQBlock, ha->dwMaxFileCount); + if(pBlockTable != NULL) + { + ULONGLONG ByteOffset = ha->MpqPos + MAKE_OFFSET64(pHeader->wBlockTablePosHi, pHeader->dwBlockTablePos); + TMPQHash * pHashEnd = ha->pHashTable + pHeader->dwHashTableSize; + TMPQHash * pHash; + DWORD dwTableSize = pHeader->dwBlockTableSize * sizeof(TMPQBlock); + DWORD dwCmpSize = (DWORD)pHeader->BlockTableSize64; + + // Fill the block table with zeros + memset(pBlockTable, 0, dwTableSize); + + // I have found a MPQ which claimed 0x200 entries in the block table, + // but the file was cut and there was only 0x1A0 entries. + // We will handle this case properly. + if(dwTableSize == dwCmpSize && (ByteOffset + dwTableSize) > FileSize) + { + pHeader->dwBlockTableSize = (DWORD)((FileSize - ByteOffset) / sizeof(TMPQBlock)); + pHeader->BlockTableSize64 = pHeader->dwBlockTableSize * sizeof(TMPQBlock); + dwTableSize = dwCmpSize = pHeader->dwBlockTableSize * sizeof(TMPQBlock); + } + + // + // One of the first cracked versions of Diablo I had block table unencrypted + // StormLib does NOT support such MPQs anymore, as they are incompatible + // with compressed block table feature + // + + // Load the block table + nError = LoadMpqTable(ha, ByteOffset, pBlockTable, dwCmpSize, dwTableSize, MPQ_KEY_BLOCK_TABLE); + if(nError == ERROR_SUCCESS) + { + // Defense against MPQs that claim block table to be bigger than it really is + FixBlockTableSize(ha, pBlockTable, pHeader->dwBlockTableSize); + + // If we don't have HET table, we build the file entries from the hash&block tables + if(ha->pHetTable == NULL) + { + for(pHash = ha->pHashTable; pHash < pHashEnd; pHash++) + { + if(pHash->dwBlockIndex < pHeader->dwBlockTableSize) + { + pFileEntry = pFileTable + pHash->dwBlockIndex; + pBlock = pBlockTable + pHash->dwBlockIndex; + + // + // Yet another silly map protector: For each valid file, + // there are 4 items in the hash table, that appears to be valid: + // + // a6d79af0 e61a0932 001e0000 0000770b <== Fake valid + // a6d79af0 e61a0932 0000d761 0000dacb <== Fake valid + // a6d79af0 e61a0932 00000000 0000002f <== Real file entry + // a6d79af0 e61a0932 00005a4f 000093bc <== Fake valid + // + + if(!(pBlock->dwFlags & ~MPQ_FILE_VALID_FLAGS) && (pBlock->dwFlags & MPQ_FILE_EXISTS)) + { + // Fill the entry + pFileEntry->ByteOffset = pBlock->dwFilePos; + pFileEntry->dwHashIndex = (DWORD)(pHash - ha->pHashTable); + pFileEntry->dwFileSize = pBlock->dwFSize; + pFileEntry->dwCmpSize = pBlock->dwCSize; + pFileEntry->dwFlags = pBlock->dwFlags; + pFileEntry->lcLocale = pHash->lcLocale; + pFileEntry->wPlatform = pHash->wPlatform; + } + else + { + // If the hash table entry doesn't point to the valid file item, + // we invalidate the entire hash table entry + pHash->dwName1 = 0xFFFFFFFF; + pHash->dwName2 = 0xFFFFFFFF; + pHash->lcLocale = 0xFFFF; + pHash->wPlatform = 0xFFFF; + pHash->dwBlockIndex = HASH_ENTRY_DELETED; + } + } + } + } + else + { + for(pHash = ha->pHashTable; pHash < pHashEnd; pHash++) + { + if(pHash->dwBlockIndex < ha->dwFileTableSize) + { + pFileEntry = pFileTable + pHash->dwBlockIndex; + if(pFileEntry->dwFlags & MPQ_FILE_EXISTS) + { + pFileEntry->dwHashIndex = (DWORD)(pHash - ha->pHashTable); + pFileEntry->lcLocale = pHash->lcLocale; + pFileEntry->wPlatform = pHash->wPlatform; + } + } + } + } + } + + // Free the block table + STORM_FREE(pBlockTable); + } + else + { + nError = ERROR_NOT_ENOUGH_MEMORY; + } + } + + // Load the hi-block table + if(nError == ERROR_SUCCESS && pHeader->HiBlockTablePos64 != 0) + { + ULONGLONG ByteOffset; + USHORT * pHiBlockTable = NULL; + DWORD dwTableSize = pHeader->dwBlockTableSize * sizeof(USHORT); + + // Allocate space for the hi-block table + // Note: pHeader->dwBlockTableSize can be zero !!! + pHiBlockTable = STORM_ALLOC(USHORT, pHeader->dwBlockTableSize + 1); + if(pHiBlockTable != NULL) + { + // Load the hi-block table. It is not encrypted, nor compressed + ByteOffset = ha->MpqPos + pHeader->HiBlockTablePos64; + if(!FileStream_Read(ha->pStream, &ByteOffset, pHiBlockTable, dwTableSize)) + nError = GetLastError(); + + // Now merge the hi-block table to the file table + if(nError == ERROR_SUCCESS) + { + pFileEntry = pFileTable; + + // Add the high file offset to the base file offset. + // We also need to swap it during the process. + for(DWORD i = 0; i < pHeader->dwBlockTableSize; i++) + { + pFileEntry->ByteOffset |= ((ULONGLONG)BSWAP_INT16_UNSIGNED(pHiBlockTable[i]) << 32); + pFileEntry++; + } + } + + // Free the hi-block table + STORM_FREE(pHiBlockTable); + } + else + { + nError = ERROR_NOT_ENOUGH_MEMORY; + } + } + + // Set the current size of the file table + ha->dwFileTableSize = pHeader->dwBlockTableSize; + return nError; +} + +int BuildFileTable_HetBet( + TMPQArchive * ha, + TFileEntry * pFileTable) +{ + TMPQHetTable * pHetTable = ha->pHetTable; + TMPQBetTable * pBetTable; + TFileEntry * pFileEntry = pFileTable; + TBitArray * pBitArray; + DWORD dwBitPosition = 0; + DWORD i; + int nError = ERROR_FILE_CORRUPT; + + // Load the BET table from the MPQ + pBetTable = LoadBetTable(ha); + if(pBetTable != NULL) + { + // Step one: Fill the indexes to the HET table + for(i = 0; i < pHetTable->dwHashTableSize; i++) + { + DWORD dwFileIndex = 0; + + // Is the entry in the HET table occupied? + if(pHetTable->pHetHashes[i] != 0) + { + // Load the index to the BET table + pHetTable->pBetIndexes->GetBits(pHetTable->dwIndexSizeTotal * i, + pHetTable->dwIndexSize, + &dwFileIndex, + 4); + // Overflow test + if(dwFileIndex < pBetTable->dwFileCount) + { + // Get the file entry and save HET index + pFileEntry = pFileTable + dwFileIndex; + pFileEntry->dwHetIndex = i; + + // Load the BET hash + pBetTable->pBetHashes->GetBits(pBetTable->dwBetHashSizeTotal * dwFileIndex, + pBetTable->dwBetHashSize, + &pFileEntry->BetHash, + 8); + } + } + } + + // Go through the entire BET table and convert it to the file table. + pFileEntry = pFileTable; + pBitArray = pBetTable->pFileTable; + for(i = 0; i < pBetTable->dwFileCount; i++) + { + DWORD dwFlagIndex = 0; + + // Read the file position + pBitArray->GetBits(dwBitPosition + pBetTable->dwBitIndex_FilePos, + pBetTable->dwBitCount_FilePos, + &pFileEntry->ByteOffset, + 8); + + // Read the file size + pBitArray->GetBits(dwBitPosition + pBetTable->dwBitIndex_FileSize, + pBetTable->dwBitCount_FileSize, + &pFileEntry->dwFileSize, + 4); + + // Read the compressed size + pBitArray->GetBits(dwBitPosition + pBetTable->dwBitIndex_CmpSize, + pBetTable->dwBitCount_CmpSize, + &pFileEntry->dwCmpSize, + 4); + + + // Read the flag index + if(pBetTable->dwFlagCount != 0) + { + pBitArray->GetBits(dwBitPosition + pBetTable->dwBitIndex_FlagIndex, + pBetTable->dwBitCount_FlagIndex, + &dwFlagIndex, + 4); + + pFileEntry->dwFlags = pBetTable->pFileFlags[dwFlagIndex]; + } + + // + // TODO: Locale (?) + // + + // Move the current bit position + dwBitPosition += pBetTable->dwTableEntrySize; + pFileEntry++; + } + + // Set the current size of the file table + ha->dwFileTableSize = pBetTable->dwFileCount; + FreeBetTable(pBetTable); + nError = ERROR_SUCCESS; + } + else + { + nError = ERROR_FILE_CORRUPT; + } + + return nError; +} + +int BuildFileTable(TMPQArchive * ha, ULONGLONG FileSize) +{ + TFileEntry * pFileTable; + bool bFileTableCreated = false; + + // Sanity checks + assert(ha->dwFileTableSize == 0); + assert(ha->dwMaxFileCount != 0); + + // Allocate the file table with size determined before + pFileTable = STORM_ALLOC(TFileEntry, ha->dwMaxFileCount); + if(pFileTable == NULL) + return ERROR_NOT_ENOUGH_MEMORY; + + // Fill the table with zeros + memset(pFileTable, 0, ha->dwMaxFileCount * sizeof(TFileEntry)); + + // If we have HET table, we load file table from the BET table + // Note: If BET table is corrupt or missing, we set the archive as read only + if(ha->pHetTable != NULL) + { + if(BuildFileTable_HetBet(ha, pFileTable) != ERROR_SUCCESS) + ha->dwFlags |= MPQ_FLAG_READ_ONLY; + else + bFileTableCreated = true; + } + + // If we have hash table, we load the file table from the block table + // Note: If block table is corrupt or missing, we set the archive as read only + if(ha->pHashTable != NULL) + { + if(BuildFileTable_Classic(ha, pFileTable, FileSize) != ERROR_SUCCESS) + ha->dwFlags |= MPQ_FLAG_READ_ONLY; + else + bFileTableCreated = true; + } + + // If something failed, we free the file table entry + if(bFileTableCreated == false) + { + STORM_FREE(pFileTable); + return ERROR_FILE_CORRUPT; + } + + // Assign it to the archive structure + ha->pFileTable = pFileTable; + return ERROR_SUCCESS; +} + +// Saves MPQ header, hash table, block table and hi-block table. +int SaveMPQTables(TMPQArchive * ha) +{ + TMPQExtTable * pHetTable = NULL; + TMPQExtTable * pBetTable = NULL; + TMPQHeader * pHeader = ha->pHeader; + TMPQBlock * pBlockTable = NULL; + TMPQHash * pHashTable = NULL; + ULONGLONG HetTableSize64 = 0; + ULONGLONG BetTableSize64 = 0; + ULONGLONG HashTableSize64 = 0; + ULONGLONG BlockTableSize64 = 0; + ULONGLONG HiBlockTableSize64 = 0; + ULONGLONG TablePos = 0; // A table position, relative to the begin of the MPQ + USHORT * pHiBlockTable = NULL; + DWORD cbTotalSize; + bool bNeedHiBlockTable = false; + int nError = ERROR_SUCCESS; + + // We expect this function to be called only when tables have been changed + assert(ha->dwFlags & MPQ_FLAG_CHANGED); + + // Find the space where the MPQ tables will be saved + FindFreeMpqSpace(ha, &TablePos); + + // If the MPQ has HET table, we prepare a ready-to-save version + if(nError == ERROR_SUCCESS && ha->pHetTable != NULL) + { + pHetTable = TranslateHetTable(ha->pHetTable, &HetTableSize64); + if(pHetTable == NULL) + nError = ERROR_NOT_ENOUGH_MEMORY; + } + + // If the MPQ has HET table, we also must create BET table to be saved + if(nError == ERROR_SUCCESS && ha->pHetTable != NULL) + { + pBetTable = TranslateBetTable(ha, &BetTableSize64); + if(pBetTable == NULL) + nError = ERROR_NOT_ENOUGH_MEMORY; + } + + // Now create hash table + if(nError == ERROR_SUCCESS && ha->pHashTable != NULL) + { + pHashTable = TranslateHashTable(ha, &HashTableSize64); + if(pHashTable == NULL) + nError = ERROR_NOT_ENOUGH_MEMORY; + } + + // Create block table + if(nError == ERROR_SUCCESS && ha->pHashTable != NULL) + { + pBlockTable = TranslateBlockTable(ha, &BlockTableSize64, &bNeedHiBlockTable); + if(pBlockTable == NULL) + nError = ERROR_NOT_ENOUGH_MEMORY; + } + + // Create hi-block table, if needed + if(nError == ERROR_SUCCESS && bNeedHiBlockTable) + { + pHiBlockTable = TranslateHiBlockTable(ha, &HiBlockTableSize64); + if(pHiBlockTable == NULL) + nError = ERROR_NOT_ENOUGH_MEMORY; + } + + // Write the HET table, if any + if(nError == ERROR_SUCCESS && pHetTable != NULL) + { + pHeader->HetTableSize64 = HetTableSize64; + pHeader->HetTablePos64 = TablePos; + nError = SaveExtTable(ha, pHetTable, TablePos, (DWORD)HetTableSize64, pHeader->MD5_HetTable, MPQ_KEY_HASH_TABLE, false, &cbTotalSize); + TablePos += cbTotalSize; + } + + // Write the BET table, if any + if(nError == ERROR_SUCCESS && pBetTable != NULL) + { + pHeader->BetTableSize64 = BetTableSize64; + pHeader->BetTablePos64 = TablePos; + nError = SaveExtTable(ha, pBetTable, TablePos, (DWORD)BetTableSize64, pHeader->MD5_BetTable, MPQ_KEY_BLOCK_TABLE, false, &cbTotalSize); + TablePos += cbTotalSize; + } + + // Write the hash table, if we have any + if(nError == ERROR_SUCCESS && pHashTable != NULL) + { + pHeader->HashTableSize64 = HashTableSize64; + pHeader->wHashTablePosHi = (USHORT)(TablePos >> 32); + pHeader->dwHashTableSize = (DWORD)(HashTableSize64 / sizeof(TMPQHash)); + pHeader->dwHashTablePos = (DWORD)TablePos; + nError = SaveMpqTable(ha, pHashTable, TablePos, (size_t)HashTableSize64, pHeader->MD5_HashTable, MPQ_KEY_HASH_TABLE, false); + TablePos += HashTableSize64; + } + + // Write the block table, if we have any + if(nError == ERROR_SUCCESS && pBlockTable != NULL) + { + pHeader->BlockTableSize64 = BlockTableSize64; + pHeader->wBlockTablePosHi = (USHORT)(TablePos >> 32); + pHeader->dwBlockTableSize = (DWORD)(BlockTableSize64 / sizeof(TMPQBlock)); + pHeader->dwBlockTablePos = (DWORD)TablePos; + nError = SaveMpqTable(ha, pBlockTable, TablePos, (size_t)BlockTableSize64, pHeader->MD5_BlockTable, MPQ_KEY_BLOCK_TABLE, false); + TablePos += BlockTableSize64; + } + + // Write the hi-block table, if we have any + if(nError == ERROR_SUCCESS && pHiBlockTable != NULL) + { + ULONGLONG ByteOffset = ha->MpqPos + TablePos; + + pHeader->HiBlockTableSize64 = HiBlockTableSize64; + pHeader->HiBlockTablePos64 = TablePos; + BSWAP_ARRAY16_UNSIGNED(pHiBlockTable, HiBlockTableSize64); + + if(!FileStream_Write(ha->pStream, &ByteOffset, pHiBlockTable, (DWORD)HiBlockTableSize64)) + nError = GetLastError(); + TablePos += HiBlockTableSize64; + } + + // Cut the MPQ + if(nError == ERROR_SUCCESS) + { + ULONGLONG FileSize = ha->MpqPos + TablePos; + + if(!FileStream_SetSize(ha->pStream, FileSize)) + nError = GetLastError(); + } + + // Write the MPQ header + if(nError == ERROR_SUCCESS) + { + // Update the size of the archive + pHeader->ArchiveSize64 = TablePos; + pHeader->dwArchiveSize = (DWORD)TablePos; + + // Update the MD5 of the archive header + CalculateDataBlockHash(pHeader, MPQ_HEADER_SIZE_V4 - MD5_DIGEST_SIZE, pHeader->MD5_MpqHeader); + + // Write the MPQ header to the file + BSWAP_TMPQHEADER(pHeader); + if(!FileStream_Write(ha->pStream, &ha->MpqPos, pHeader, pHeader->dwHeaderSize)) + nError = GetLastError(); + BSWAP_TMPQHEADER(pHeader); + } + + // Clear the changed flag + if(nError == ERROR_SUCCESS) + ha->dwFlags &= ~MPQ_FLAG_CHANGED; + + // Cleanup and exit + if(pHetTable != NULL) + STORM_FREE(pHetTable); + if(pBetTable != NULL) + STORM_FREE(pBetTable); + if(pHashTable != NULL) + STORM_FREE(pHashTable); + if(pBlockTable != NULL) + STORM_FREE(pBlockTable); + if(pHiBlockTable != NULL) + STORM_FREE(pHiBlockTable); + return nError; +} diff --git a/dep/StormLib/src/SCompression.cpp b/dep/StormLib/src/SCompression.cpp new file mode 100644 index 00000000000..88351499ef7 --- /dev/null +++ b/dep/StormLib/src/SCompression.cpp @@ -0,0 +1,1050 @@ +/*****************************************************************************/ +/* SCompression.cpp Copyright (c) Ladislav Zezula 2003 */ +/*---------------------------------------------------------------------------*/ +/* This module serves as a bridge between StormLib code and (de)compression */ +/* functions. All (de)compression calls go (and should only go) through this */ +/* module. No system headers should be included in this module to prevent */ +/* compile-time problems. */ +/*---------------------------------------------------------------------------*/ +/* Date Ver Who Comment */ +/* -------- ---- --- ------- */ +/* 01.04.03 1.00 Lad The first version of SCompression.cpp */ +/* 19.11.03 1.01 Dan Big endian handling */ +/*****************************************************************************/ + +#define __STORMLIB_SELF__ +#include "StormLib.h" +#include "StormCommon.h" + +//----------------------------------------------------------------------------- +// Local structures + +// Information about the input and output buffers for pklib +typedef struct +{ + char * pbInBuff; // Pointer to input data buffer + char * pbInBuffEnd; // End of the input buffer + char * pbOutBuff; // Pointer to output data buffer + char * pbOutBuffEnd; // Pointer to output data buffer +} TDataInfo; + +// Prototype of the compression function +// Function doesn't return an error. A success means that the size of compressed buffer +// is lower than size of uncompressed buffer. +typedef void (*COMPRESS)( + char * pbOutBuffer, // [out] Pointer to the buffer where the compressed data will be stored + int * pcbOutBuffer, // [in] Pointer to length of the buffer pointed by pbOutBuffer + // [out] Contains length of the compressed data + char * pbInBuffer, // [in] Pointer to the buffer with data to compress + int cbInBuffer, // [in] Length of the buffer pointer by pbInBuffer + int * pCmpType, // [in] Compression-method specific value. ADPCM Setups this for the following Huffman compression + int nCmpLevel); // [in] Compression specific value. ADPCM uses this. Should be set to zero. + +// Prototype of the decompression function +// Returns 1 if success, 0 if failure +typedef int (*DECOMPRESS)( + char * pbOutBuffer, // [out] Pointer to the buffer where to store decompressed data + int * pcbOutBuffer, // [in] Pointer to total size of the buffer pointed by pbOutBuffer + // [out] Contains length of the decompressed data + char * pbInBuffer, // [in] Pointer to data to be decompressed + int cbInBuffer); // [in] Length of the data to be decompressed + +// Table of compression functions +typedef struct +{ + unsigned long uMask; // Compression mask + COMPRESS Compress; // Compression function +} TCompressTable; + +// Table of decompression functions +typedef struct +{ + unsigned long uMask; // Decompression bit + DECOMPRESS Decompress; // Decompression function +} TDecompressTable; + + +/*****************************************************************************/ +/* */ +/* Support for Huffman compression (0x01) */ +/* */ +/*****************************************************************************/ + +// 1500F4C0 +void Compress_huff( + char * pbOutBuffer, + int * pcbOutBuffer, + char * pbInBuffer, + int cbInBuffer, + int * pCmpType, + int /* nCmpLevel */) +{ + THuffmannTree ht; // Huffmann tree for compression + TOutputStream os; // Output stream + + // Initialize output stream + os.pbOutBuffer = (unsigned char *)pbOutBuffer; + os.cbOutSize = *pcbOutBuffer; + os.pbOutPos = (unsigned char *)pbOutBuffer; + os.dwBitBuff = 0; + os.nBits = 0; + + // Initialize the Huffmann tree for compression + ht.InitTree(true); + + *pcbOutBuffer = ht.DoCompression(&os, (unsigned char *)pbInBuffer, cbInBuffer, *pCmpType); + + // The following code is not necessary to run, because it has no + // effect on the output data. It only clears the huffmann tree, but when + // the tree is on the stack, who cares ? +// ht.UninitTree(); +} + +// 1500F5F0 +int Decompress_huff(char * pbOutBuffer, int * pcbOutBuffer, char * pbInBuffer, int cbInBuffer) +{ + THuffmannTree ht; + TInputStream is; + + // Initialize input stream + is.pbInBufferEnd = (unsigned char *)pbInBuffer + cbInBuffer; + is.pbInBuffer = (unsigned char *)pbInBuffer; + is.BitBuffer = 0; + is.BitCount = 0; + + // Initialize the Huffmann tree for compression + ht.InitTree(false); + *pcbOutBuffer = ht.DoDecompression((unsigned char *)pbOutBuffer, *pcbOutBuffer, &is); + if(*pcbOutBuffer == 0) + return 0; + + // The following code is not necessary to run, because it has no + // effect on the output data. It only clears the huffmann tree, but when + // the tree is on the stack, who cares ? +// ht.UninitTree(); + return 1; +} + +/******************************************************************************/ +/* */ +/* Support for ZLIB compression (0x02) */ +/* */ +/******************************************************************************/ + +void Compress_ZLIB( + char * pbOutBuffer, + int * pcbOutBuffer, + char * pbInBuffer, + int cbInBuffer, + int * /* pCmpType */, + int /* nCmpLevel */) +{ + z_stream z; // Stream information for zlib + int windowBits; + int nResult; + + // Fill the stream structure for zlib + z.next_in = (Bytef *)pbInBuffer; + z.avail_in = (uInt)cbInBuffer; + z.total_in = cbInBuffer; + z.next_out = (Bytef *)pbOutBuffer; + z.avail_out = *pcbOutBuffer; + z.total_out = 0; + z.zalloc = NULL; + z.zfree = NULL; + + // Determine the proper window bits (WoW.exe build 12694) + if(cbInBuffer <= 0x100) + windowBits = 8; + else if(cbInBuffer <= 0x200) + windowBits = 9; + else if(cbInBuffer <= 0x400) + windowBits = 10; + else if(cbInBuffer <= 0x800) + windowBits = 11; + else if(cbInBuffer <= 0x1000) + windowBits = 12; + else if(cbInBuffer <= 0x2000) + windowBits = 13; + else if(cbInBuffer <= 0x4000) + windowBits = 14; + else + windowBits = 15; + + // Initialize the compression. + // Storm.dll uses zlib version 1.1.3 + // Wow.exe uses zlib version 1.2.3 + nResult = deflateInit2(&z, + Z_DEFAULT_COMPRESSION, + Z_DEFLATED, + windowBits, + 8, + Z_DEFAULT_STRATEGY); + if(nResult == Z_OK) + { + // Call zlib to compress the data + nResult = deflate(&z, Z_FINISH); + + if(nResult == Z_OK || nResult == Z_STREAM_END) + *pcbOutBuffer = z.total_out; + + deflateEnd(&z); + } +} + +int Decompress_ZLIB(char * pbOutBuffer, int * pcbOutBuffer, char * pbInBuffer, int cbInBuffer) +{ + z_stream z; // Stream information for zlib + int nResult; + + // Fill the stream structure for zlib + z.next_in = (Bytef *)pbInBuffer; + z.avail_in = (uInt)cbInBuffer; + z.total_in = cbInBuffer; + z.next_out = (Bytef *)pbOutBuffer; + z.avail_out = *pcbOutBuffer; + z.total_out = 0; + z.zalloc = NULL; + z.zfree = NULL; + + // Initialize the decompression structure. Storm.dll uses zlib version 1.1.3 + if((nResult = inflateInit(&z)) == 0) + { + // Call zlib to decompress the data + nResult = inflate(&z, Z_FINISH); + *pcbOutBuffer = z.total_out; + inflateEnd(&z); + } + return nResult; +} + +/******************************************************************************/ +/* */ +/* Support functions for PKWARE Data Compression Library compression (0x08) */ +/* */ +/******************************************************************************/ + +// Function loads data from the input buffer. Used by Pklib's "implode" +// and "explode" function as user-defined callback +// Returns number of bytes loaded +// +// char * buf - Pointer to a buffer where to store loaded data +// unsigned int * size - Max. number of bytes to read +// void * param - Custom pointer, parameter of implode/explode + +static unsigned int ReadInputData(char * buf, unsigned int * size, void * param) +{ + TDataInfo * pInfo = (TDataInfo *)param; + unsigned int nMaxAvail = (unsigned int)(pInfo->pbInBuffEnd - pInfo->pbInBuff); + unsigned int nToRead = *size; + + // Check the case when not enough data available + if(nToRead > nMaxAvail) + nToRead = nMaxAvail; + + // Load data and increment offsets + memcpy(buf, pInfo->pbInBuff, nToRead); + pInfo->pbInBuff += nToRead; + assert(pInfo->pbInBuff <= pInfo->pbInBuffEnd); + return nToRead; +} + +// Function for store output data. Used by Pklib's "implode" and "explode" +// as user-defined callback +// +// char * buf - Pointer to data to be written +// unsigned int * size - Number of bytes to write +// void * param - Custom pointer, parameter of implode/explode + +static void WriteOutputData(char * buf, unsigned int * size, void * param) +{ + TDataInfo * pInfo = (TDataInfo *)param; + unsigned int nMaxWrite = (unsigned int)(pInfo->pbOutBuffEnd - pInfo->pbOutBuff); + unsigned int nToWrite = *size; + + // Check the case when not enough space in the output buffer + if(nToWrite > nMaxWrite) + nToWrite = nMaxWrite; + + // Write output data and increments offsets + memcpy(pInfo->pbOutBuff, buf, nToWrite); + pInfo->pbOutBuff += nToWrite; + assert(pInfo->pbOutBuff <= pInfo->pbOutBuffEnd); +} + +static void Compress_PKLIB( + char * pbOutBuffer, + int * pcbOutBuffer, + char * pbInBuffer, + int cbInBuffer, + int * /* pCmpType */, + int /* nCmpLevel */) +{ + TDataInfo Info; // Data information + char * work_buf = STORM_ALLOC(char, CMP_BUFFER_SIZE);// Pklib's work buffer + unsigned int dict_size; // Dictionary size + unsigned int ctype = CMP_BINARY; // Compression type + + // Fill data information structure + memset(work_buf, 0, CMP_BUFFER_SIZE); + Info.pbInBuff = pbInBuffer; + Info.pbInBuffEnd = pbInBuffer + cbInBuffer; + Info.pbOutBuff = pbOutBuffer; + Info.pbOutBuffEnd = pbOutBuffer + *pcbOutBuffer; + + // Set the compression type and dictionary size + if (cbInBuffer < 0x600) + dict_size = CMP_IMPLODE_DICT_SIZE1; + else if(0x600 <= cbInBuffer && cbInBuffer < 0xC00) + dict_size = CMP_IMPLODE_DICT_SIZE2; + else + dict_size = CMP_IMPLODE_DICT_SIZE3; + + // Do the compression + if(implode(ReadInputData, WriteOutputData, work_buf, &Info, &ctype, &dict_size) == CMP_NO_ERROR) + *pcbOutBuffer = (int)(Info.pbOutBuff - pbOutBuffer); + + STORM_FREE(work_buf); +} + +static int Decompress_PKLIB(char * pbOutBuffer, int * pcbOutBuffer, char * pbInBuffer, int cbInBuffer) +{ + TDataInfo Info; // Data information + char * work_buf = STORM_ALLOC(char, EXP_BUFFER_SIZE);// Pklib's work buffer + + // Fill data information structure + memset(work_buf, 0, EXP_BUFFER_SIZE); + Info.pbInBuff = pbInBuffer; + Info.pbInBuffEnd = pbInBuffer + cbInBuffer; + Info.pbOutBuff = pbOutBuffer; + Info.pbOutBuffEnd = pbOutBuffer + *pcbOutBuffer; + + // Do the decompression + explode(ReadInputData, WriteOutputData, work_buf, &Info); + + // If PKLIB is unable to decompress the data, return 0; + if(Info.pbOutBuff == pbOutBuffer) + return 0; + + // Give away the number of decompressed bytes + *pcbOutBuffer = (int)(Info.pbOutBuff - pbOutBuffer); + STORM_FREE(work_buf); + return 1; +} + +/******************************************************************************/ +/* */ +/* Support for Bzip2 compression (0x10) */ +/* */ +/******************************************************************************/ + +static void Compress_BZIP2( + char * pbOutBuffer, + int * pcbOutBuffer, + char * pbInBuffer, + int cbInBuffer, + int * /* pCmpType */, + int /* nCmpLevel */) +{ + bz_stream strm; + int blockSize100k = 9; + int workFactor = 30; + int bzError; + + // Initialize the BZIP2 compression + strm.bzalloc = NULL; + strm.bzfree = NULL; + + // Blizzard uses 9 as blockSize100k, (0x30 as workFactor) + // Last checked on Starcraft II + if(BZ2_bzCompressInit(&strm, blockSize100k, 0, workFactor) == BZ_OK) + { + strm.next_in = pbInBuffer; + strm.avail_in = cbInBuffer; + strm.next_out = pbOutBuffer; + strm.avail_out = *pcbOutBuffer; + + // Perform the compression + for(;;) + { + bzError = BZ2_bzCompress(&strm, (strm.avail_in != 0) ? BZ_RUN : BZ_FINISH); + if(bzError == BZ_STREAM_END || bzError < 0) + break; + } + + // Put the stream into idle state + BZ2_bzCompressEnd(&strm); + + if(bzError > 0) + *pcbOutBuffer = strm.total_out_lo32; + } +} + +static int Decompress_BZIP2(char * pbOutBuffer, int * pcbOutBuffer, char * pbInBuffer, int cbInBuffer) +{ + bz_stream strm; + int nResult = BZ_OK; + + // Initialize the BZIP2 decompression + strm.bzalloc = NULL; + strm.bzfree = NULL; + if(BZ2_bzDecompressInit(&strm, 0, 0) == BZ_OK) + { + strm.next_in = pbInBuffer; + strm.avail_in = cbInBuffer; + strm.next_out = pbOutBuffer; + strm.avail_out = *pcbOutBuffer; + + // Perform the decompression + while(nResult != BZ_STREAM_END) + { + nResult = BZ2_bzDecompress(&strm); + + // If any error there, break the loop + if(nResult < BZ_OK) + break; + } + + // Put the stream into idle state + BZ2_bzDecompressEnd(&strm); + + // If all succeeded, set the number of output bytes + if(nResult >= BZ_OK) + { + *pcbOutBuffer = strm.total_out_lo32; + return 1; + } + } + + // Something failed, so set number of output bytes to zero + *pcbOutBuffer = 0; + return 1; +} + +/******************************************************************************/ +/* */ +/* Support functions for LZMA compression (0x12) */ +/* */ +/******************************************************************************/ + +#define LZMA_HEADER_SIZE (1 + LZMA_PROPS_SIZE + 8) + +static SRes LZMA_Callback_Progress(void * /* p */, UInt64 /* inSize */, UInt64 /* outSize */) +{ + return SZ_OK; +} + +static void * LZMA_Callback_Alloc(void *p, size_t size) +{ + p = p; + return STORM_ALLOC(BYTE, size); +} + +/* address can be 0 */ +static void LZMA_Callback_Free(void *p, void *address) +{ + p = p; + if(address != NULL) + STORM_FREE(address); +} + +// +// Note: So far, I haven't seen any files compressed by LZMA. +// This code haven't been verified against code ripped from Starcraft II Beta, +// but we know that Starcraft LZMA decompression code is able to decompress +// the data compressed by StormLib. +// + +static void Compress_LZMA( + char * pbOutBuffer, + int * pcbOutBuffer, + char * pbInBuffer, + int cbInBuffer, + int * /* pCmpType */, + int /* nCmpLevel */) +{ + ICompressProgress Progress; + CLzmaEncProps props; + ISzAlloc SzAlloc; + Byte * destBuffer; + SizeT destLen = *pcbOutBuffer; + SizeT srcLen = cbInBuffer; + Byte encodedProps[LZMA_PROPS_SIZE]; + size_t encodedPropsSize = LZMA_PROPS_SIZE; + SRes nResult; + + // Fill the callbacks in structures + Progress.Progress = LZMA_Callback_Progress; + SzAlloc.Alloc = LZMA_Callback_Alloc; + SzAlloc.Free = LZMA_Callback_Free; + + // Initialize properties + LzmaEncProps_Init(&props); + + // Perform compression + destBuffer = (Byte *)pbOutBuffer + LZMA_HEADER_SIZE; + destLen = *pcbOutBuffer - LZMA_HEADER_SIZE; + nResult = LzmaEncode(destBuffer, + &destLen, + (Byte *)pbInBuffer, + srcLen, + &props, + encodedProps, + &encodedPropsSize, + 0, + &Progress, + &SzAlloc, + &SzAlloc); + if(nResult != SZ_OK) + return; + + // If we failed to compress the data + if(destLen >= (SizeT)(*pcbOutBuffer - LZMA_HEADER_SIZE)) + return; + + // Write "useFilter" variable. Blizzard MPQ must not use filter. + *pbOutBuffer++ = 0; + + // Copy the encoded properties to the output buffer + memcpy(pbOutBuffer, encodedProps, encodedPropsSize); + pbOutBuffer += encodedPropsSize; + + // Copy the size of the data + *pbOutBuffer++ = (unsigned char)(srcLen >> 0x00); + *pbOutBuffer++ = (unsigned char)(srcLen >> 0x08); + *pbOutBuffer++ = (unsigned char)(srcLen >> 0x10); + *pbOutBuffer++ = (unsigned char)(srcLen >> 0x18); + *pbOutBuffer++ = 0; + *pbOutBuffer++ = 0; + *pbOutBuffer++ = 0; + *pbOutBuffer++ = 0; + + // Give the size of the data to the caller + *pcbOutBuffer = (unsigned int)(destLen + LZMA_HEADER_SIZE); +} + +static int Decompress_LZMA(char * pbOutBuffer, int * pcbOutBuffer, char * pbInBuffer, int cbInBuffer) +{ + ELzmaStatus LzmaStatus; + ISzAlloc SzAlloc; + Byte * destBuffer = (Byte *)pbOutBuffer; + Byte * srcBuffer = (Byte *)pbInBuffer; + SizeT destLen = *pcbOutBuffer; + SizeT srcLen = cbInBuffer; + SRes nResult; + + // There must be at least 0x0E bytes in the buffer + if(srcLen <= LZMA_HEADER_SIZE) + return 0; + + // We only accept blocks that have no filter used + if(*srcBuffer != 0) + return 0; + + // Fill the callbacks in structures + SzAlloc.Alloc = LZMA_Callback_Alloc; + SzAlloc.Free = LZMA_Callback_Free; + + // Perform compression + srcLen = cbInBuffer - LZMA_HEADER_SIZE; + nResult = LzmaDecode(destBuffer, + &destLen, + srcBuffer + LZMA_HEADER_SIZE, + &srcLen, + srcBuffer + 1, + LZMA_PROPS_SIZE, + LZMA_FINISH_END, + &LzmaStatus, + &SzAlloc); + if(nResult != SZ_OK) + return 0; + + *pcbOutBuffer = (unsigned int)destLen; + return 1; +} + +/******************************************************************************/ +/* */ +/* Support functions for SPARSE compression (0x20) */ +/* */ +/******************************************************************************/ + +void Compress_SPARSE( + char * pbOutBuffer, + int * pcbOutBuffer, + char * pbInBuffer, + int cbInBuffer, + int * /* pCmpType */, + int /* nCmpLevel */) +{ + CompressSparse((unsigned char *)pbOutBuffer, pcbOutBuffer, (unsigned char *)pbInBuffer, cbInBuffer); +} + +int Decompress_SPARSE(char * pbOutBuffer, int * pcbOutBuffer, char * pbInBuffer, int cbInBuffer) +{ + return DecompressSparse((unsigned char *)pbOutBuffer, pcbOutBuffer, (unsigned char *)pbInBuffer, cbInBuffer); +} + +/******************************************************************************/ +/* */ +/* Support for ADPCM mono compression (0x40) */ +/* */ +/******************************************************************************/ + +static void Compress_ADPCM_mono( + char * pbOutBuffer, + int * pcbOutBuffer, + char * pbInBuffer, + int cbInBuffer, + int * pCmpType, + int nCmpLevel) +{ + // Prepare the compression level for Huffmann compression, + // which will be called as next step + if(0 < nCmpLevel && nCmpLevel <= 2) + { + nCmpLevel = 4; + *pCmpType = 6; + } + else if(nCmpLevel == 3) + { + nCmpLevel = 6; + *pCmpType = 8; + } + else + { + nCmpLevel = 5; + *pCmpType = 7; + } + *pcbOutBuffer = CompressADPCM((unsigned char *)pbOutBuffer, *pcbOutBuffer, (short *)pbInBuffer, cbInBuffer, 1, nCmpLevel); +} + +static int Decompress_ADPCM_mono(char * pbOutBuffer, int * pcbOutBuffer, char * pbInBuffer, int cbInBuffer) +{ + *pcbOutBuffer = DecompressADPCM((unsigned char *)pbOutBuffer, *pcbOutBuffer, (unsigned char *)pbInBuffer, cbInBuffer, 1); + return 1; +} + +/******************************************************************************/ +/* */ +/* Support for ADPCM stereo compression (0x80) */ +/* */ +/******************************************************************************/ + +static void Compress_ADPCM_stereo( + char * pbOutBuffer, + int * pcbOutBuffer, + char * pbInBuffer, + int cbInBuffer, + int * pCmpType, + int nCmpLevel) +{ + // Prepare the compression level for Huffmann compression, + // which will be called as next step + if(0 < nCmpLevel && nCmpLevel <= 2) + { + nCmpLevel = 4; + *pCmpType = 6; + } + else if(nCmpLevel == 3) + { + nCmpLevel = 6; + *pCmpType = 8; + } + else + { + nCmpLevel = 5; + *pCmpType = 7; + } + *pcbOutBuffer = CompressADPCM((unsigned char *)pbOutBuffer, *pcbOutBuffer, (short *)pbInBuffer, cbInBuffer, 2, nCmpLevel); +} + +static int Decompress_ADPCM_stereo(char * pbOutBuffer, int * pcbOutBuffer, char * pbInBuffer, int cbInBuffer) +{ + *pcbOutBuffer = DecompressADPCM((unsigned char *)pbOutBuffer, *pcbOutBuffer, (unsigned char *)pbInBuffer, cbInBuffer, 2); + return 1; +} + +/*****************************************************************************/ +/* */ +/* SCompImplode */ +/* */ +/*****************************************************************************/ + +int WINAPI SCompImplode(char * pbOutBuffer, int * pcbOutBuffer, char * pbInBuffer, int cbInBuffer) +{ + int cbOutBuffer = *pcbOutBuffer; + + // Check for valid parameters + if(!pcbOutBuffer || *pcbOutBuffer < cbInBuffer || !pbOutBuffer || !pbInBuffer) + { + SetLastError(ERROR_INVALID_PARAMETER); + return 0; + } + + // Perform the compression + Compress_PKLIB(pbOutBuffer, &cbOutBuffer, pbInBuffer, cbInBuffer, NULL, 0); + + // If the compression was unsuccessful, copy the data as-is + if(cbOutBuffer >= *pcbOutBuffer) + { + memcpy(pbOutBuffer, pbInBuffer, cbInBuffer); + cbOutBuffer = *pcbOutBuffer; + } + + *pcbOutBuffer = cbOutBuffer; + return 1; +} + +/*****************************************************************************/ +/* */ +/* SCompExplode */ +/* */ +/*****************************************************************************/ + +int WINAPI SCompExplode(char * pbOutBuffer, int * pcbOutBuffer, char * pbInBuffer, int cbInBuffer) +{ + int cbOutBuffer = *pcbOutBuffer; + + // Check for valid parameters + if(!pcbOutBuffer || *pcbOutBuffer < cbInBuffer || !pbOutBuffer || !pbInBuffer) + { + SetLastError(ERROR_INVALID_PARAMETER); + return 0; + } + + // If the input length is the same as output length, do nothing. + if(cbInBuffer == cbOutBuffer) + { + // If the buffers are equal, don't copy anything. + if(pbInBuffer == pbOutBuffer) + return 1; + + memcpy(pbOutBuffer, pbInBuffer, cbInBuffer); + return 1; + } + + // Perform decompression + if(!Decompress_PKLIB(pbOutBuffer, &cbOutBuffer, pbInBuffer, cbInBuffer)) + { + SetLastError(ERROR_FILE_CORRUPT); + return false; + } + + *pcbOutBuffer = cbOutBuffer; + return 1; +} + +/*****************************************************************************/ +/* */ +/* SCompCompress */ +/* */ +/*****************************************************************************/ + +// This table contains compress functions which can be applied to +// uncompressed data. Each bit means the corresponding +// compression method/function must be applied. +// +// WAVes compression Data compression +// ------------------ ------------------- +// 1st sector - 0x08 0x08 (D, HF, W2, SC, D2) +// Next sectors - 0x81 0x02 (W3) + +static TCompressTable cmp_table[] = +{ + {MPQ_COMPRESSION_SPARSE, Compress_SPARSE}, // Sparse compression + {MPQ_COMPRESSION_WAVE_MONO, Compress_ADPCM_mono}, // IMA ADPCM mono compression + {MPQ_COMPRESSION_WAVE_STEREO, Compress_ADPCM_stereo}, // IMA ADPCM stereo compression + {MPQ_COMPRESSION_HUFFMANN, Compress_huff}, // Huffmann compression + {MPQ_COMPRESSION_ZLIB, Compress_ZLIB}, // Compression with the "zlib" library + {MPQ_COMPRESSION_PKWARE, Compress_PKLIB}, // Compression with Pkware DCL + {MPQ_COMPRESSION_BZIP2, Compress_BZIP2} // Compression Bzip2 library +}; + +int WINAPI SCompCompress( + char * pbOutBuffer, + int * pcbOutBuffer, + char * pbInBuffer, + int cbInBuffer, + unsigned uCompressionMask, + int nCmpType, + int nCmpLevel) +{ + COMPRESS CompressFuncArray[0x10]; // Array of compression functions, applied sequentially + unsigned char CompressByte[0x10]; // CompressByte for each method in the CompressFuncArray array + char * pbWorkBuffer = NULL; // Temporary storage for decompressed data + char * pbOutput = pbOutBuffer; // Current output buffer + char * pbInput = pbInBuffer; // Current input buffer + int nCompressCount = 0; + int nCompressIndex = 0; + int nAtLeastOneCompressionDone = 0; + int cbOutBuffer = 0; + int cbInLength = cbInBuffer; + int nResult = 1; + + // Check for valid parameters + if(!pcbOutBuffer || *pcbOutBuffer < cbInBuffer || !pbOutBuffer || !pbInBuffer) + { + SetLastError(ERROR_INVALID_PARAMETER); + return 0; + } + + // Zero input length brings zero output length + if(cbInBuffer == 0) + { + *pcbOutBuffer = 0; + return true; + } + + // Setup the compression function array + if(uCompressionMask == MPQ_COMPRESSION_LZMA) + { + CompressFuncArray[0] = Compress_LZMA; + CompressByte[0] = (char)uCompressionMask; + nCompressCount = 1; + } + else + { + // Fill the compressions array + for(size_t i = 0; i < (sizeof(cmp_table) / sizeof(TCompressTable)); i++) + { + // If the mask agrees, insert the compression function to the array + if(uCompressionMask & cmp_table[i].uMask) + { + CompressFuncArray[nCompressCount] = cmp_table[i].Compress; + CompressByte[nCompressCount] = (unsigned char)cmp_table[i].uMask; + uCompressionMask &= ~cmp_table[i].uMask; + nCompressCount++; + } + } + + // If at least one of the compressions remaing unknown, return an error + if(uCompressionMask != 0) + { + SetLastError(ERROR_NOT_SUPPORTED); + return 0; + } + } + + // If there is at least one compression, do it + if(nCompressCount > 0) + { + // If we need to do more than 1 compression, allocate intermediate buffer + if(nCompressCount > 1) + { + pbWorkBuffer = STORM_ALLOC(char, *pcbOutBuffer); + if(pbWorkBuffer == NULL) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return 0; + } + } + + // Get the current compression index + nCompressIndex = nCompressCount - 1; + + // Perform all compressions in the array + for(int i = 0; i < nCompressCount; i++) + { + // Choose the proper output buffer + pbOutput = (nCompressIndex & 1) ? pbWorkBuffer : pbOutBuffer; + nCompressIndex--; + + // Perform the (next) compression + // Note that if the compression method is unable to compress the input data block + // by at least 2 bytes, we consider it as failure and will use source data instead + cbOutBuffer = *pcbOutBuffer - 1; + CompressFuncArray[i](pbOutput + 1, &cbOutBuffer, pbInput, cbInLength, &nCmpType, nCmpLevel); + + // If the compression failed, we copy the input buffer as-is. + // Note that there is one extra byte at the end of the intermediate buffer, so it should be OK + if(cbOutBuffer > (cbInLength - 2)) + { + memcpy(pbOutput + nAtLeastOneCompressionDone, pbInput, cbInLength); + cbOutBuffer = cbInLength; + } + else + { + // Remember that we have done at least one compression + nAtLeastOneCompressionDone = 1; + uCompressionMask |= CompressByte[i]; + } + + // Now point input buffer to the output buffer + pbInput = pbOutput + nAtLeastOneCompressionDone; + cbInLength = cbOutBuffer; + } + + // If at least one compression succeeded, put the compression + // mask to the begin of the output buffer + if(nAtLeastOneCompressionDone) + *pbOutBuffer = (char)uCompressionMask; + *pcbOutBuffer = cbOutBuffer + nAtLeastOneCompressionDone; + } + else + { + memcpy(pbOutBuffer, pbInBuffer, cbInBuffer); + *pcbOutBuffer = cbInBuffer; + } + + // Cleanup and return + if(pbWorkBuffer != NULL) + STORM_FREE(pbWorkBuffer); + return nResult; +} + +/*****************************************************************************/ +/* */ +/* SCompDecompress */ +/* */ +/*****************************************************************************/ + +// This table contains decompress functions which can be applied to +// uncompressed data. The compression mask is stored in the first byte +// of compressed data +static TDecompressTable dcmp_table[] = +{ + {MPQ_COMPRESSION_BZIP2, Decompress_BZIP2}, // Decompression with Bzip2 library + {MPQ_COMPRESSION_PKWARE, Decompress_PKLIB}, // Decompression with Pkware Data Compression Library + {MPQ_COMPRESSION_ZLIB, Decompress_ZLIB}, // Decompression with the "zlib" library + {MPQ_COMPRESSION_HUFFMANN, Decompress_huff}, // Huffmann decompression + {MPQ_COMPRESSION_WAVE_STEREO, Decompress_ADPCM_stereo}, // IMA ADPCM stereo decompression + {MPQ_COMPRESSION_WAVE_MONO, Decompress_ADPCM_mono}, // IMA ADPCM mono decompression + {MPQ_COMPRESSION_SPARSE, Decompress_SPARSE} // Sparse decompression +}; + +int WINAPI SCompDecompress( + char * pbOutBuffer, + int * pcbOutBuffer, + char * pbInBuffer, + int cbInBuffer) +{ + DECOMPRESS DecompressFuncArray[0x10]; // Array of compression functions, applied sequentially + char * pbWorkBuffer = NULL; // Temporary storage for decompressed data + char * pbOutput = pbOutBuffer; // Where to store decompressed data + char * pbInput; // Where to store decompressed data + unsigned uCompressionMask; // Decompressions applied to the data + int cbOutBuffer = *pcbOutBuffer; // Current size of the output buffer + int cbInLength; // Current size of the input buffer + int nCompressCount = 0; // Number of compressions to be applied + int nCompressIndex = 0; + int nResult = 1; + + // Zero input data bring zero output data + if(cbInBuffer == 0) + { + *pcbOutBuffer = 0; + return 1; + } + +/* + // If the input length is the same as output length, do nothing. + // Unfortunately, some data in WoW-Cataclysm BETA MPQs are like that .... + if(cbInBuffer == cbOutBuffer) + { + // If the buffers are equal, don't copy anything. + if(pbInBuffer == pbOutBuffer) + return 1; + + memcpy(pbOutBuffer, pbInBuffer, cbInBuffer); + return 1; + } +*/ + + // Get applied compression types and decrement data length + uCompressionMask = (unsigned char)*pbInBuffer++; + cbInBuffer--; + + // Get current compressed data and length of it + pbInput = pbInBuffer; + cbInLength = cbInBuffer; + + // + // Beginning with Starcraft II, the decompression byte can no longer contain + // any arbitrary combination types. Instead, it can be one of the few + // pre-set values (0x02, 0x08, 0x10, 0x12, 0x20, 0x22, 0x30) + // Note that Starcraft II no longer uses WAVE files, so compressions 0x41, 0x48, 0x81, 0x88 + // are no longer used. + // + + // Special case: LZMA decompression (added in Starcraft II) + if(uCompressionMask == MPQ_COMPRESSION_LZMA) + { + DecompressFuncArray[0] = Decompress_LZMA; + nCompressCount = 1; + } + else + { + // Fill the compressions array + for(size_t i = 0; i < (sizeof(dcmp_table) / sizeof(TDecompressTable)); i++) + { + // If the mask agrees, insert the compression function to the array + if(uCompressionMask & dcmp_table[i].uMask) + { + DecompressFuncArray[nCompressCount] = dcmp_table[i].Decompress; + uCompressionMask &= ~dcmp_table[i].uMask; + nCompressCount++; + } + } + + // If at least one of the compressions remaing unknown, return an error + if(uCompressionMask != 0) + { + SetLastError(ERROR_NOT_SUPPORTED); + return 0; + } + } + + // If there is at least one decompression, do it + if(nCompressCount > 0) + { + // If there is more than one compression, we have to allocate extra buffer + if(nCompressCount > 1) + { + pbWorkBuffer = STORM_ALLOC(char, *pcbOutBuffer); + if(pbWorkBuffer == NULL) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return 0; + } + } + + // Get the current compression index + nCompressIndex = nCompressCount - 1; + + // Apply all decompressions + for(int i = 0; i < nCompressCount; i++) + { + // Get the correct output buffer + pbOutput = (nCompressIndex & 1) ? pbWorkBuffer : pbOutBuffer; + nCompressIndex--; + + // Perform the (next) decompression + cbOutBuffer = *pcbOutBuffer; + nResult = DecompressFuncArray[i](pbOutput, &cbOutBuffer, pbInput, cbInLength); + if(nResult == 0 || cbOutBuffer == 0) + { + SetLastError(ERROR_FILE_CORRUPT); + nResult = 0; + break; + } + + // Switch buffers + pbInput = pbOutput; + cbInLength = cbOutBuffer; + } + + // Put the length of the decompressed data to the output buffer + *pcbOutBuffer = cbOutBuffer; + } + else + { + memcpy(pbOutBuffer, pbInBuffer, cbInBuffer); + *pcbOutBuffer = cbInBuffer; + } + + // Cleanup and return + if(pbWorkBuffer != NULL) + STORM_FREE(pbWorkBuffer); + return nResult; +} diff --git a/dep/StormLib/src/SFileAddFile.cpp b/dep/StormLib/src/SFileAddFile.cpp new file mode 100644 index 00000000000..e908d644990 --- /dev/null +++ b/dep/StormLib/src/SFileAddFile.cpp @@ -0,0 +1,1211 @@ +/*****************************************************************************/ +/* SFileAddFile.cpp Copyright (c) Ladislav Zezula 2010 */ +/*---------------------------------------------------------------------------*/ +/* MPQ Editing functions */ +/*---------------------------------------------------------------------------*/ +/* Date Ver Who Comment */ +/* -------- ---- --- ------- */ +/* 27.03.10 1.00 Lad Splitted from SFileCreateArchiveEx.cpp */ +/*****************************************************************************/ + +#define __STORMLIB_SELF__ +#include "StormLib.h" +#include "StormCommon.h" + +//----------------------------------------------------------------------------- +// Local variables + +// Data compression for SFileAddFile +// Kept here for compatibility with code that was created with StormLib version < 6.50 +static DWORD DefaultDataCompression = MPQ_COMPRESSION_PKWARE; + +static SFILE_ADDFILE_CALLBACK AddFileCB = NULL; +static void * pvUserData = NULL; + +//----------------------------------------------------------------------------- +// MPQ write data functions + +#define LOSSY_COMPRESSION_MASK (MPQ_COMPRESSION_ADPCM_MONO | MPQ_COMPRESSION_ADPCM_STEREO | MPQ_COMPRESSION_HUFFMANN) + +static int WriteDataToMpqFile( + TMPQArchive * ha, + TMPQFile * hf, + LPBYTE pbFileData, + DWORD dwDataSize, + DWORD dwCompression) +{ + TFileEntry * pFileEntry = hf->pFileEntry; + ULONGLONG ByteOffset; + LPBYTE pbCompressed = NULL; // Compressed (target) data + LPBYTE pbToWrite = NULL; // Data to write to the file + int nCompressionLevel = -1; // ADPCM compression level (only used for wave files) + int nError = ERROR_SUCCESS; + + // If the caller wants ADPCM compression, we will set wave compression level to 4, + // which corresponds to medium quality + if(dwCompression & LOSSY_COMPRESSION_MASK) + nCompressionLevel = 4; + + // Make sure that the caller won't overrun the previously initiated file size + assert(hf->dwFilePos + dwDataSize <= pFileEntry->dwFileSize); + assert(hf->dwSectorCount != 0); + assert(hf->pbFileSector != NULL); + if((hf->dwFilePos + dwDataSize) > pFileEntry->dwFileSize) + return ERROR_DISK_FULL; + pbToWrite = hf->pbFileSector; + + // Now write all data to the file sector buffer + if(nError == ERROR_SUCCESS) + { + DWORD dwBytesInSector = hf->dwFilePos % hf->dwSectorSize; + DWORD dwSectorIndex = hf->dwFilePos / hf->dwSectorSize; + DWORD dwBytesToCopy; + + // Process all data. + while(dwDataSize != 0) + { + dwBytesToCopy = dwDataSize; + + // Check for sector overflow + if(dwBytesToCopy > (hf->dwSectorSize - dwBytesInSector)) + dwBytesToCopy = (hf->dwSectorSize - dwBytesInSector); + + // Copy the data to the file sector + memcpy(hf->pbFileSector + dwBytesInSector, pbFileData, dwBytesToCopy); + dwBytesInSector += dwBytesToCopy; + pbFileData += dwBytesToCopy; + dwDataSize -= dwBytesToCopy; + + // Update the file position + hf->dwFilePos += dwBytesToCopy; + + // If the current sector is full, or if the file is already full, + // then write the data to the MPQ + if(dwBytesInSector >= hf->dwSectorSize || hf->dwFilePos >= pFileEntry->dwFileSize) + { + // Set the position in the file + ByteOffset = hf->RawFilePos + pFileEntry->dwCmpSize; + + // If the file is compressed, allocate buffer for the compressed data. + // Note that we allocate buffer that is a bit longer than sector size, + // for case if the compression method performs a buffer overrun + if((pFileEntry->dwFlags & MPQ_FILE_COMPRESSED) && pbCompressed == NULL) + { + pbToWrite = pbCompressed = STORM_ALLOC(BYTE, hf->dwSectorSize + 0x100); + if(pbCompressed == NULL) + nError = ERROR_NOT_ENOUGH_MEMORY; + } + + // Update CRC32 and MD5 of the file + md5_process((hash_state *)hf->hctx, hf->pbFileSector, dwBytesInSector); + hf->dwCrc32 = crc32(hf->dwCrc32, hf->pbFileSector, dwBytesInSector); + + // Compress the file sector, if needed + if(pFileEntry->dwFlags & MPQ_FILE_COMPRESSED) + { + int nOutBuffer = (int)dwBytesInSector; + int nInBuffer = (int)dwBytesInSector; + + assert(pbCompressed != NULL); + + // + // Note that both SCompImplode and SCompCompress give original buffer, + // if they are unable to comperss the data. + // + + if(pFileEntry->dwFlags & MPQ_FILE_IMPLODE) + { + SCompImplode((char *)pbCompressed, + &nOutBuffer, + (char *)hf->pbFileSector, + nInBuffer); + } + + if(pFileEntry->dwFlags & MPQ_FILE_COMPRESS) + { + SCompCompress((char *)pbCompressed, + &nOutBuffer, + (char *)hf->pbFileSector, + nInBuffer, + (unsigned)dwCompression, + 0, + nCompressionLevel); + } + + // Update sector positions + dwBytesInSector = nOutBuffer; + if(hf->SectorOffsets != NULL) + hf->SectorOffsets[dwSectorIndex+1] = hf->SectorOffsets[dwSectorIndex] + dwBytesInSector; + + // We have to calculate sector CRC, if enabled + if(hf->SectorChksums != NULL) + hf->SectorChksums[dwSectorIndex] = adler32(0, pbCompressed, nOutBuffer); + } + + // Encrypt the sector, if necessary + if(pFileEntry->dwFlags & MPQ_FILE_ENCRYPTED) + { + BSWAP_ARRAY32_UNSIGNED(pbToWrite, dwBytesInSector); + EncryptMpqBlock(pbToWrite, dwBytesInSector, hf->dwFileKey + dwSectorIndex); + BSWAP_ARRAY32_UNSIGNED(pbToWrite, dwBytesInSector); + } + + // Write the file sector + if(!FileStream_Write(ha->pStream, &ByteOffset, pbToWrite, dwBytesInSector)) + { + nError = GetLastError(); + break; + } + + // Call the compact callback, if any + if(AddFileCB != NULL) + AddFileCB(pvUserData, hf->dwFilePos, hf->dwDataSize, false); + + // Update the compressed file size + pFileEntry->dwCmpSize += dwBytesInSector; + dwBytesInSector = 0; + dwSectorIndex++; + } + } + } + + // Cleanup + if(pbCompressed != NULL) + STORM_FREE(pbCompressed); + return nError; +} + +//----------------------------------------------------------------------------- +// Recrypts file data for file renaming + +static int RecryptFileData( + TMPQArchive * ha, + TMPQFile * hf, + const char * szFileName, + const char * szNewFileName) +{ + ULONGLONG RawFilePos; + TFileEntry * pFileEntry = hf->pFileEntry; + DWORD dwBytesToRecrypt = pFileEntry->dwCmpSize; + DWORD dwOldKey; + DWORD dwNewKey; + int nError = ERROR_SUCCESS; + + // The file must be encrypted + assert(pFileEntry->dwFlags & MPQ_FILE_ENCRYPTED); + + // File decryption key is calculated from the plain name + szNewFileName = GetPlainFileNameA(szNewFileName); + szFileName = GetPlainFileNameA(szFileName); + + // Calculate both file keys + dwOldKey = DecryptFileKey(szFileName, pFileEntry->ByteOffset, pFileEntry->dwFileSize, pFileEntry->dwFlags); + dwNewKey = DecryptFileKey(szNewFileName, pFileEntry->ByteOffset, pFileEntry->dwFileSize, pFileEntry->dwFlags); + + // Incase the keys are equal, don't recrypt the file + if(dwNewKey == dwOldKey) + return ERROR_SUCCESS; + hf->dwFileKey = dwOldKey; + + // Calculate the raw position of the file in the archive + hf->MpqFilePos = pFileEntry->ByteOffset; + hf->RawFilePos = ha->MpqPos + hf->MpqFilePos; + + // Allocate buffer for file transfer + nError = AllocateSectorBuffer(hf); + if(nError != ERROR_SUCCESS) + return nError; + + // Also allocate buffer for sector offsets + // Note: Don't load sector checksums, we don't need to recrypt them + nError = AllocateSectorOffsets(hf, true); + if(nError != ERROR_SUCCESS) + return nError; + + // If we have sector offsets, recrypt these as well + if(hf->SectorOffsets != NULL) + { + // Allocate secondary buffer for sectors copy + DWORD * SectorOffsetsCopy = (DWORD *)STORM_ALLOC(BYTE, hf->SectorOffsets[0]); + DWORD dwSectorOffsLen = hf->SectorOffsets[0]; + + if(SectorOffsetsCopy == NULL) + return ERROR_NOT_ENOUGH_MEMORY; + + // Recrypt the array of sector offsets + memcpy(SectorOffsetsCopy, hf->SectorOffsets, dwSectorOffsLen); + EncryptMpqBlock(SectorOffsetsCopy, dwSectorOffsLen, dwNewKey - 1); + BSWAP_ARRAY32_UNSIGNED(SectorOffsetsCopy, dwSectorOffsLen); + + // Write the recrypted array back + if(!FileStream_Write(ha->pStream, &hf->RawFilePos, SectorOffsetsCopy, dwSectorOffsLen)) + nError = GetLastError(); + STORM_FREE(SectorOffsetsCopy); + } + + // Now we have to recrypt all file sectors. We do it without + // recompression, because recompression is not necessary in this case + if(nError == ERROR_SUCCESS) + { + for(DWORD dwSector = 0; dwSector < hf->dwSectorCount; dwSector++) + { + DWORD dwRawDataInSector = hf->dwSectorSize; + DWORD dwRawByteOffset = dwSector * hf->dwSectorSize; + + // Last sector: If there is not enough bytes remaining in the file, cut the raw size + if(dwRawDataInSector > dwBytesToRecrypt) + dwRawDataInSector = dwBytesToRecrypt; + + // Fix the raw data length if the file is compressed + if(hf->SectorOffsets != NULL) + { + dwRawDataInSector = hf->SectorOffsets[dwSector+1] - hf->SectorOffsets[dwSector]; + dwRawByteOffset = hf->SectorOffsets[dwSector]; + } + + // Calculate the raw file offset of the file sector + CalculateRawSectorOffset(RawFilePos, hf, dwRawByteOffset); + + // Read the file sector + if(!FileStream_Read(ha->pStream, &RawFilePos, hf->pbFileSector, dwRawDataInSector)) + { + nError = GetLastError(); + break; + } + + // If necessary, re-encrypt the sector + // Note: Recompression is not necessary here. Unlike encryption, + // the compression does not depend on the position of the file in MPQ. + BSWAP_ARRAY32_UNSIGNED(hf->pbFileSector, dwRawDataInSector); + DecryptMpqBlock(hf->pbFileSector, dwRawDataInSector, dwOldKey + dwSector); + EncryptMpqBlock(hf->pbFileSector, dwRawDataInSector, dwNewKey + dwSector); + BSWAP_ARRAY32_UNSIGNED(hf->pbFileSector, dwRawDataInSector); + + // Write the sector back + if(!FileStream_Write(ha->pStream, &RawFilePos, hf->pbFileSector, dwRawDataInSector)) + { + nError = GetLastError(); + break; + } + + // Decrement number of bytes remaining + dwBytesToRecrypt -= hf->dwSectorSize; + } + } + + return nError; +} + +//----------------------------------------------------------------------------- +// Support functions for adding files to the MPQ + +int SFileAddFile_Init( + TMPQArchive * ha, + const char * szFileName, + ULONGLONG FileTime, + DWORD dwFileSize, + LCID lcLocale, + DWORD dwFlags, + TMPQFile ** phf) +{ + TFileEntry * pFileEntry = NULL; + ULONGLONG TempPos; // For various file offset calculations + TMPQFile * hf = NULL; // File structure for newly added file + int nError = ERROR_SUCCESS; + + // + // Note: This is an internal function so no validity checks are done. + // It is the caller's responsibility to make sure that no invalid + // flags get to this point + // + + // Adjust file flags for too-small files + if(dwFileSize < 0x04) + dwFlags &= ~(MPQ_FILE_ENCRYPTED | MPQ_FILE_FIX_KEY); + if(dwFileSize < 0x20) + dwFlags &= ~(MPQ_FILE_COMPRESSED | MPQ_FILE_SECTOR_CRC); + + // If the MPQ is of version 3.0 or higher, we ignore file locale. + // This is because HET and BET tables have no known support for it + if(ha->pHeader->wFormatVersion >= MPQ_FORMAT_VERSION_3) + lcLocale = 0; + + // Allocate the TMPQFile entry for newly added file + hf = CreateMpqFile(ha); + if(hf == NULL) + nError = ERROR_NOT_ENOUGH_MEMORY; + + // Find a free space in the MPQ, as well as free block table entry + if(nError == ERROR_SUCCESS) + { + // Find the position where the file will be stored + FindFreeMpqSpace(ha, &hf->MpqFilePos); + hf->RawFilePos = ha->MpqPos + hf->MpqFilePos; + hf->bIsWriteHandle = true; + + // Sanity check: The MPQ must be marked as changed at this point + assert((ha->dwFlags & MPQ_FLAG_CHANGED) != 0); + + // When format V1, the size of the archive cannot exceed 4 GB + if(ha->pHeader->wFormatVersion == MPQ_FORMAT_VERSION_1) + { + TempPos = hf->MpqFilePos + dwFileSize; + TempPos += ha->pHeader->dwHashTableSize * sizeof(TMPQHash); + TempPos += ha->pHeader->dwBlockTableSize * sizeof(TMPQBlock); + TempPos += ha->pHeader->dwBlockTableSize * sizeof(USHORT); + if((TempPos >> 32) != 0) + nError = ERROR_DISK_FULL; + } + } + + // Allocate file entry in the MPQ + if(nError == ERROR_SUCCESS) + { + // Check if the file already exists in the archive + pFileEntry = GetFileEntryExact(ha, szFileName, lcLocale); + if(pFileEntry == NULL) + { + pFileEntry = AllocateFileEntry(ha, szFileName, lcLocale); + if(pFileEntry == NULL) + nError = ERROR_DISK_FULL; + } + else + { + // If the file is marked as deleted, it's OK + if(!(pFileEntry->dwFlags & MPQ_FILE_DELETE_MARKER)) + { + if((dwFlags & MPQ_FILE_REPLACEEXISTING) == 0) + nError = ERROR_ALREADY_EXISTS; + } + + // If the file entry already contains a file + // and it is a pseudo-name, replace it + if(nError == ERROR_SUCCESS) + { + AllocateFileName(pFileEntry, szFileName); + } + } + } + + // + // At this point, the file name in file entry must be non-NULL + // + + // Create key for file encryption + if(nError == ERROR_SUCCESS && (dwFlags & MPQ_FILE_ENCRYPTED)) + { + hf->dwFileKey = DecryptFileKey(szFileName, hf->MpqFilePos, dwFileSize, dwFlags); + } + + if(nError == ERROR_SUCCESS) + { + // Initialize the hash entry for the file + hf->pFileEntry = pFileEntry; + hf->dwDataSize = dwFileSize; + + // Initialize the block table entry for the file + pFileEntry->ByteOffset = hf->MpqFilePos; + pFileEntry->dwFileSize = dwFileSize; + pFileEntry->dwCmpSize = 0; + pFileEntry->dwFlags = dwFlags | MPQ_FILE_EXISTS; + pFileEntry->lcLocale = (USHORT)lcLocale; + + // Initialize the file time, CRC32 and MD5 + assert(sizeof(hf->hctx) >= sizeof(hash_state)); + memset(pFileEntry->md5, 0, MD5_DIGEST_SIZE); + md5_init((hash_state *)hf->hctx); + pFileEntry->dwCrc32 = crc32(0, Z_NULL, 0); + + // If the caller gave us a file time, use it. + pFileEntry->FileTime = FileTime; + + // Call the callback, if needed + if(AddFileCB != NULL) + AddFileCB(pvUserData, 0, hf->dwDataSize, false); + } + + // If an error occured, remember it + if(nError != ERROR_SUCCESS) + hf->bErrorOccured = true; + *phf = hf; + return nError; +} + +int SFileAddFile_Write(TMPQFile * hf, const void * pvData, DWORD dwSize, DWORD dwCompression) +{ + TMPQArchive * ha; + TFileEntry * pFileEntry; + int nError = ERROR_SUCCESS; + + // Don't bother if the caller gave us zero size + if(pvData == NULL || dwSize == 0) + return ERROR_SUCCESS; + + // Get pointer to the MPQ archive + pFileEntry = hf->pFileEntry; + ha = hf->ha; + + // Allocate file buffers + if(hf->pbFileSector == NULL) + { + ULONGLONG RawFilePos = hf->RawFilePos; + + // Allocate buffer for file sector + nError = AllocateSectorBuffer(hf); + if(nError != ERROR_SUCCESS) + { + hf->bErrorOccured = true; + return nError; + } + + // Allocate patch info, if the data is patch + if(hf->pPatchInfo == NULL && IsPatchData(pvData, dwSize, &hf->dwPatchedFileSize)) + { + // Set the MPQ_FILE_PATCH_FILE flag + hf->pFileEntry->dwFlags |= MPQ_FILE_PATCH_FILE; + + // Allocate the patch info + nError = AllocatePatchInfo(hf, false); + if(nError != ERROR_SUCCESS) + { + hf->bErrorOccured = true; + return nError; + } + } + + // Allocate sector offsets + if(hf->SectorOffsets == NULL) + { + nError = AllocateSectorOffsets(hf, false); + if(nError != ERROR_SUCCESS) + { + hf->bErrorOccured = true; + return nError; + } + } + + // Create array of sector checksums + if(hf->SectorChksums == NULL && (pFileEntry->dwFlags & MPQ_FILE_SECTOR_CRC)) + { + nError = AllocateSectorChecksums(hf, false); + if(nError != ERROR_SUCCESS) + { + hf->bErrorOccured = true; + return nError; + } + } + + // Pre-save the patch info, if any + if(hf->pPatchInfo != NULL) + { + if(!FileStream_Write(ha->pStream, &RawFilePos, hf->pPatchInfo, hf->pPatchInfo->dwLength)) + nError = GetLastError(); + + pFileEntry->dwCmpSize += hf->pPatchInfo->dwLength; + RawFilePos += hf->pPatchInfo->dwLength; + } + + // Pre-save the sector offset table, just to reserve space in the file. + // Note that we dont need to swap the sector positions, nor encrypt the table + // at the moment, as it will be written again after writing all file sectors. + if(hf->SectorOffsets != NULL) + { + if(!FileStream_Write(ha->pStream, &RawFilePos, hf->SectorOffsets, hf->SectorOffsets[0])) + nError = GetLastError(); + + pFileEntry->dwCmpSize += hf->SectorOffsets[0]; + RawFilePos += hf->SectorOffsets[0]; + } + } + + // Write the MPQ data to the file + if(nError == ERROR_SUCCESS) + nError = WriteDataToMpqFile(ha, hf, (LPBYTE)pvData, dwSize, dwCompression); + + // If it succeeded and we wrote all the file data, + // we need to re-save sector offset table + if(nError == ERROR_SUCCESS) + { + if(hf->dwFilePos >= pFileEntry->dwFileSize) + { + // Finish calculating CRC32 + hf->pFileEntry->dwCrc32 = hf->dwCrc32; + + // Finish calculating MD5 + md5_done((hash_state *)hf->hctx, hf->pFileEntry->md5); + + // If we also have sector checksums, write them to the file + if(hf->SectorChksums != NULL) + { + nError = WriteSectorChecksums(hf); + if(nError != ERROR_SUCCESS) + hf->bErrorOccured = true; + } + + // Now write patch info + if(hf->pPatchInfo != NULL) + { + memcpy(hf->pPatchInfo->md5, hf->pFileEntry->md5, MD5_DIGEST_SIZE); + hf->pPatchInfo->dwDataSize = hf->pFileEntry->dwFileSize; + hf->pFileEntry->dwFileSize = hf->dwPatchedFileSize; + nError = WritePatchInfo(hf); + if(nError != ERROR_SUCCESS) + hf->bErrorOccured = true; + } + + // Now write sector offsets to the file + if(hf->SectorOffsets != NULL) + { + nError = WriteSectorOffsets(hf); + if(nError != ERROR_SUCCESS) + hf->bErrorOccured = true; + } + + // Write the MD5 hashes of each file chunk, if required + if(ha->pHeader->dwRawChunkSize != 0) + { + nError = WriteMpqDataMD5(ha->pStream, + ha->MpqPos + hf->pFileEntry->ByteOffset, + hf->pFileEntry->dwCmpSize, + ha->pHeader->dwRawChunkSize); + if(nError != ERROR_SUCCESS) + hf->bErrorOccured = true; + } + } + } + else + { + hf->bErrorOccured = true; + } + + return nError; +} + +int SFileAddFile_Finish(TMPQFile * hf) +{ + TMPQArchive * ha = hf->ha; + TFileEntry * pFileEntry = hf->pFileEntry; + int nError = ERROR_SUCCESS; + + // If all previous operations succeeded, we can update the MPQ + if(!hf->bErrorOccured) + { + // Verify if the caller wrote the file properly + if(hf->pPatchInfo == NULL) + { + assert(pFileEntry != NULL); + if(hf->dwFilePos != pFileEntry->dwFileSize) + { + nError = ERROR_CAN_NOT_COMPLETE; + hf->bErrorOccured = true; + } + } + else + { + if(hf->dwFilePos != hf->pPatchInfo->dwDataSize) + { + nError = ERROR_CAN_NOT_COMPLETE; + hf->bErrorOccured = true; + } + } + } + + if(!hf->bErrorOccured) + { + // Call the user callback, if any + if(AddFileCB != NULL) + AddFileCB(pvUserData, hf->dwDataSize, hf->dwDataSize, true); + + // Update the size of the block table + ha->pHeader->dwBlockTableSize = ha->dwFileTableSize; + } + else + { + // Free the file entry in MPQ tables + if(pFileEntry != NULL) + FreeFileEntry(ha, pFileEntry); + } + + // Clear the add file callback + FreeMPQFile(hf); + pvUserData = NULL; + AddFileCB = NULL; + return nError; +} + +//----------------------------------------------------------------------------- +// Adds data as file to the archive + +bool WINAPI SFileCreateFile( + HANDLE hMpq, + const char * szArchivedName, + ULONGLONG FileTime, + DWORD dwFileSize, + LCID lcLocale, + DWORD dwFlags, + HANDLE * phFile) +{ + TMPQArchive * ha = (TMPQArchive *)hMpq; + int nError = ERROR_SUCCESS; + + // Check valid parameters + if(!IsValidMpqHandle(ha)) + nError = ERROR_INVALID_HANDLE; + if(szArchivedName == NULL || *szArchivedName == 0) + nError = ERROR_INVALID_PARAMETER; + if(phFile == NULL) + nError = ERROR_INVALID_PARAMETER; + + // Don't allow to add file if the MPQ is open for read only + if(ha->dwFlags & MPQ_FLAG_READ_ONLY) + nError = ERROR_ACCESS_DENIED; + + // Don't allow to add a file under pseudo-file name + if(IsPseudoFileName(szArchivedName, NULL)) + nError = ERROR_INVALID_PARAMETER; + + // Don't allow to add any of the internal files + if(IsInternalMpqFileName(szArchivedName)) + nError = ERROR_INTERNAL_FILE; + + // Perform validity check of the MPQ flags + if(nError == ERROR_SUCCESS) + { + // Mask all unsupported flags out + dwFlags &= MPQ_FILE_VALID_FLAGS; + + // Check for valid flag combinations + if((dwFlags & (MPQ_FILE_IMPLODE | MPQ_FILE_COMPRESS)) == (MPQ_FILE_IMPLODE | MPQ_FILE_COMPRESS)) + nError = ERROR_INVALID_PARAMETER; + } + + // Create the file in MPQ + if(nError == ERROR_SUCCESS) + { + // Invalidate the entries for (listfile) and (attributes) + // After we are done with MPQ changes, we need to re-create them anyway + InvalidateInternalFiles(ha); + + // Initiate the add file operation + nError = SFileAddFile_Init(ha, szArchivedName, FileTime, dwFileSize, lcLocale, dwFlags, (TMPQFile **)phFile); + } + + // Deal with the errors + if(nError != ERROR_SUCCESS) + SetLastError(nError); + return (nError == ERROR_SUCCESS); +} + +bool WINAPI SFileWriteFile( + HANDLE hFile, + const void * pvData, + DWORD dwSize, + DWORD dwCompression) +{ + TMPQFile * hf = (TMPQFile *)hFile; + int nError = ERROR_SUCCESS; + + // Check the proper parameters + if(!IsValidFileHandle(hf)) + nError = ERROR_INVALID_HANDLE; + if(hf->bIsWriteHandle == false) + nError = ERROR_INVALID_HANDLE; + + // Special checks for single unit files + if(nError == ERROR_SUCCESS && (hf->pFileEntry->dwFlags & MPQ_FILE_SINGLE_UNIT)) + { + // + // Note: Blizzard doesn't support single unit files + // that are stored as encrypted or imploded. We will allow them here, + // the calling application must ensure that such flag combination doesn't get here + // + +// if(dwFlags & MPQ_FILE_IMPLODE) +// nError = ERROR_INVALID_PARAMETER; +// +// if(dwFlags & MPQ_FILE_ENCRYPTED) +// nError = ERROR_INVALID_PARAMETER; + + // Lossy compression is not allowed on single unit files + if(dwCompression & LOSSY_COMPRESSION_MASK) + nError = ERROR_INVALID_PARAMETER; + } + + + // Write the data to the file + if(nError == ERROR_SUCCESS) + nError = SFileAddFile_Write(hf, pvData, dwSize, dwCompression); + + // Deal with errors + if(nError != ERROR_SUCCESS) + SetLastError(nError); + return (nError == ERROR_SUCCESS); +} + +bool WINAPI SFileFinishFile(HANDLE hFile) +{ + TMPQFile * hf = (TMPQFile *)hFile; + int nError = ERROR_SUCCESS; + + // Check the proper parameters + if(!IsValidFileHandle(hf)) + nError = ERROR_INVALID_HANDLE; + if(hf->bIsWriteHandle == false) + nError = ERROR_INVALID_HANDLE; + + // Finish the file + if(nError == ERROR_SUCCESS) + nError = SFileAddFile_Finish(hf); + + // Deal with errors + if(nError != ERROR_SUCCESS) + SetLastError(nError); + return (nError == ERROR_SUCCESS); +} + +//----------------------------------------------------------------------------- +// Adds a file to the archive + +bool WINAPI SFileAddFileEx( + HANDLE hMpq, + const TCHAR * szFileName, + const char * szArchivedName, + DWORD dwFlags, + DWORD dwCompression, // Compression of the first sector + DWORD dwCompressionNext) // Compression of next sectors +{ + ULONGLONG FileSize = 0; + ULONGLONG FileTime = 0; + TFileStream * pStream = NULL; + HANDLE hMpqFile = NULL; + LPBYTE pbFileData = NULL; + DWORD dwBytesRemaining = 0; + DWORD dwBytesToRead; + DWORD dwSectorSize = 0x1000; + int nError = ERROR_SUCCESS; + + // Check parameters + if(szFileName == NULL || *szFileName == 0) + nError = ERROR_INVALID_PARAMETER; + + // Open added file + if(nError == ERROR_SUCCESS) + { + pStream = FileStream_OpenFile(szFileName, false); + if(pStream == NULL) + nError = GetLastError(); + } + + // Get the file size and file time + if(nError == ERROR_SUCCESS) + { + FileStream_GetLastWriteTime(pStream, &FileTime); + FileStream_GetSize(pStream, FileSize); + + // Files bigger than 4GB cannot be added to MPQ + if(FileSize >> 32) + nError = ERROR_DISK_FULL; + } + + // Allocate data buffer for reading from the source file + if(nError == ERROR_SUCCESS) + { + dwBytesRemaining = (DWORD)FileSize; + pbFileData = STORM_ALLOC(BYTE, dwSectorSize); + if(pbFileData == NULL) + nError = ERROR_NOT_ENOUGH_MEMORY; + } + + // Deal with various combination of compressions + if(nError == ERROR_SUCCESS) + { + // When the compression for next blocks is set to default, + // we will copy the compression for the first sector + if(dwCompressionNext == 0xFFFFFFFF) + dwCompressionNext = dwCompression; + + // If the caller wants ADPCM compression, we make sure that the first sector is not + // compressed with lossy compression + if(dwCompressionNext & (MPQ_COMPRESSION_WAVE_MONO | MPQ_COMPRESSION_WAVE_STEREO)) + { + // The first compression must not be WAVE + if(dwCompression & (MPQ_COMPRESSION_WAVE_MONO | MPQ_COMPRESSION_WAVE_STEREO)) + dwCompression = MPQ_COMPRESSION_PKWARE; + } + + // Initiate adding file to the MPQ + if(!SFileCreateFile(hMpq, szArchivedName, FileTime, (DWORD)FileSize, lcFileLocale, dwFlags, &hMpqFile)) + nError = GetLastError(); + } + + // Write the file data to the MPQ + while(nError == ERROR_SUCCESS && dwBytesRemaining != 0) + { + // Get the number of bytes remaining in the source file + dwBytesToRead = dwBytesRemaining; + if(dwBytesToRead > dwSectorSize) + dwBytesToRead = dwSectorSize; + + // Read data from the local file + if(!FileStream_Read(pStream, NULL, pbFileData, dwBytesToRead)) + { + nError = GetLastError(); + break; + } + + // Add the file sectors to the MPQ + if(!SFileWriteFile(hMpqFile, pbFileData, dwBytesToRead, dwCompression)) + { + nError = GetLastError(); + break; + } + + // Set the next data compression + dwBytesRemaining -= dwBytesToRead; + dwCompression = dwCompressionNext; + } + + // Finish the file writing + if(hMpqFile != NULL) + { + if(!SFileFinishFile(hMpqFile)) + nError = GetLastError(); + } + + // Cleanup and exit + if(pbFileData != NULL) + STORM_FREE(pbFileData); + if(pStream != NULL) + FileStream_Close(pStream); + if(nError != ERROR_SUCCESS) + SetLastError(nError); + return (nError == ERROR_SUCCESS); +} + +// Adds a data file into the archive +bool WINAPI SFileAddFile(HANDLE hMpq, const TCHAR * szFileName, const char * szArchivedName, DWORD dwFlags) +{ + return SFileAddFileEx(hMpq, + szFileName, + szArchivedName, + dwFlags, + DefaultDataCompression, + DefaultDataCompression); +} + +// Adds a WAVE file into the archive +bool WINAPI SFileAddWave(HANDLE hMpq, const TCHAR * szFileName, const char * szArchivedName, DWORD dwFlags, DWORD dwQuality) +{ + DWORD dwCompression = 0; + + // + // Note to wave compression level: + // The following conversion table applied: + // High quality: WaveCompressionLevel = -1 + // Medium quality: WaveCompressionLevel = 4 + // Low quality: WaveCompressionLevel = 2 + // + // Starcraft files are packed as Mono (0x41) on medium quality. + // Because this compression is not used anymore, our compression functions + // will default to WaveCompressionLevel = 4 when using ADPCM compression + // + + // Convert quality to data compression + switch(dwQuality) + { + case MPQ_WAVE_QUALITY_HIGH: +// WaveCompressionLevel = -1; + dwCompression = MPQ_COMPRESSION_PKWARE; + break; + + case MPQ_WAVE_QUALITY_MEDIUM: +// WaveCompressionLevel = 4; + dwCompression = MPQ_COMPRESSION_WAVE_STEREO | MPQ_COMPRESSION_HUFFMANN; + break; + + case MPQ_WAVE_QUALITY_LOW: +// WaveCompressionLevel = 2; + dwCompression = MPQ_COMPRESSION_WAVE_STEREO | MPQ_COMPRESSION_HUFFMANN; + break; + } + + return SFileAddFileEx(hMpq, + szFileName, + szArchivedName, + dwFlags, + MPQ_COMPRESSION_PKWARE, // First sector should be compressed as data + dwCompression); // Next sectors should be compressed as WAVE +} + +//----------------------------------------------------------------------------- +// bool SFileRemoveFile(HANDLE hMpq, char * szFileName) +// +// This function removes a file from the archive. The file content +// remains there, only the entries in the hash table and in the block +// table are updated. + +bool WINAPI SFileRemoveFile(HANDLE hMpq, const char * szFileName, DWORD dwSearchScope) +{ + TMPQArchive * ha = (TMPQArchive *)hMpq; + TFileEntry * pFileEntry = NULL; // File entry of the file to be deleted + DWORD dwFileIndex = 0; + int nError = ERROR_SUCCESS; + + // Keep compiler happy + dwSearchScope = dwSearchScope; + + // Check the parameters + if(nError == ERROR_SUCCESS) + { + if(!IsValidMpqHandle(ha)) + nError = ERROR_INVALID_HANDLE; + if(szFileName == NULL || *szFileName == 0) + nError = ERROR_INVALID_PARAMETER; + if(IsInternalMpqFileName(szFileName)) + nError = ERROR_INTERNAL_FILE; + } + + if(nError == ERROR_SUCCESS) + { + // Do not allow to remove files from MPQ open for read only + if(ha->dwFlags & MPQ_FLAG_READ_ONLY) + nError = ERROR_ACCESS_DENIED; + } + + // Get hash entry belonging to this file + if(nError == ERROR_SUCCESS) + { + if(!IsPseudoFileName(szFileName, &dwFileIndex)) + { + if((pFileEntry = GetFileEntryExact(ha, (char *)szFileName, lcFileLocale)) == NULL) + nError = ERROR_FILE_NOT_FOUND; + } + else + { + if((pFileEntry = GetFileEntryByIndex(ha, dwFileIndex)) == NULL) + nError = ERROR_FILE_NOT_FOUND; + } + } + + // Test if the file is not already deleted + if(nError == ERROR_SUCCESS) + { + if(!(pFileEntry->dwFlags & MPQ_FILE_EXISTS)) + nError = ERROR_FILE_NOT_FOUND; + } + + if(nError == ERROR_SUCCESS) + { + // Invalidate the entries for (listfile) and (attributes) + // After we are done with MPQ changes, we need to re-create them anyway + InvalidateInternalFiles(ha); + + // Mark the file entry as free + nError = FreeFileEntry(ha, pFileEntry); + } + + // Resolve error and exit + if(nError != ERROR_SUCCESS) + SetLastError(nError); + return (nError == ERROR_SUCCESS); +} + +// Renames the file within the archive. +bool WINAPI SFileRenameFile(HANDLE hMpq, const char * szFileName, const char * szNewFileName) +{ + TMPQArchive * ha = (TMPQArchive *)hMpq; + TFileEntry * pFileEntry = NULL; + ULONGLONG RawDataOffs; + TMPQFile * hf; + int nError = ERROR_SUCCESS; + + // Test the valid parameters + if(nError == ERROR_SUCCESS) + { + if(!IsValidMpqHandle(ha)) + nError = ERROR_INVALID_HANDLE; + if(szFileName == NULL || *szFileName == 0 || szNewFileName == NULL || *szNewFileName == 0) + nError = ERROR_INVALID_PARAMETER; + } + + if(nError == ERROR_SUCCESS) + { + // Do not allow to rename files in MPQ open for read only + if(ha->dwFlags & MPQ_FLAG_READ_ONLY) + nError = ERROR_ACCESS_DENIED; + + // Do not allow renaming anything to a pseudo-file name + if(IsPseudoFileName(szFileName, NULL) || IsPseudoFileName(szNewFileName, NULL)) + nError = ERROR_INVALID_PARAMETER; + + // Do not allow to rename any of the internal files + // Also do not allow to rename any of files to an internal file + if(IsInternalMpqFileName(szFileName) || IsInternalMpqFileName(szNewFileName)) + nError = ERROR_INTERNAL_FILE; + } + + // Find the current file entry. + if(nError == ERROR_SUCCESS) + { + // Get the file entry + pFileEntry = GetFileEntryLocale(ha, szFileName, lcFileLocale); + if(pFileEntry == NULL) + nError = ERROR_FILE_NOT_FOUND; + } + + // Also try to find file entry for the new file. + // This verifies if we are not overwriting an existing file + // (whose name we perhaps don't know) + if(nError == ERROR_SUCCESS) + { + if(GetFileEntryLocale(ha, szNewFileName, pFileEntry->lcLocale) != NULL) + nError = ERROR_ALREADY_EXISTS; + } + + // Now we rename the existing file entry. + if(nError == ERROR_SUCCESS) + { + // Rename the file entry + nError = RenameFileEntry(ha, pFileEntry, szNewFileName); + } + + // Now we copy the existing file entry to the new one + if(nError == ERROR_SUCCESS) + { + // If the file is encrypted, we have to re-crypt the file content + // with the new decryption key + if(pFileEntry->dwFlags & MPQ_FILE_ENCRYPTED) + { + hf = CreateMpqFile(ha); + if(hf != NULL) + { + // Recrypt the file data in the MPQ + hf->pFileEntry = pFileEntry; + hf->dwDataSize = pFileEntry->dwFileSize; + nError = RecryptFileData(ha, hf, szFileName, szNewFileName); + + // Update the MD5 + if(ha->pHeader->dwRawChunkSize != 0) + { + RawDataOffs = ha->MpqPos + pFileEntry->ByteOffset; + WriteMpqDataMD5(ha->pStream, + RawDataOffs, + pFileEntry->dwCmpSize, + ha->pHeader->dwRawChunkSize); + } + + FreeMPQFile(hf); + } + else + { + nError = ERROR_NOT_ENOUGH_MEMORY; + } + } + } + + // + // Note: MPQ_FLAG_CHANGED is set by RenameFileEntry + // + + // Resolve error and return + if(nError != ERROR_SUCCESS) + SetLastError(nError); + return (nError == ERROR_SUCCESS); +} + +//----------------------------------------------------------------------------- +// Sets default data compression for SFileAddFile + +bool WINAPI SFileSetDataCompression(DWORD DataCompression) +{ + unsigned int uValidMask = (MPQ_COMPRESSION_ZLIB | MPQ_COMPRESSION_PKWARE | MPQ_COMPRESSION_BZIP2 | MPQ_COMPRESSION_SPARSE); + + if((DataCompression & uValidMask) != DataCompression) + { + SetLastError(ERROR_INVALID_PARAMETER); + return false; + } + + DefaultDataCompression = DataCompression; + return true; +} + +//----------------------------------------------------------------------------- +// Changes locale ID of a file + +bool WINAPI SFileSetFileLocale(HANDLE hFile, LCID lcNewLocale) +{ + TMPQArchive * ha; + TFileEntry * pFileEntry; + TMPQFile * hf = (TMPQFile *)hFile; + + // Invalid handle => do nothing + if(!IsValidFileHandle(hf)) + { + SetLastError(ERROR_INVALID_HANDLE); + return false; + } + + // Do not allow unnamed access + if(hf->pFileEntry->szFileName == NULL) + { + SetLastError(ERROR_CAN_NOT_COMPLETE); + return false; + } + + // Do not allow to change locale of any internal file + if(IsInternalMpqFileName(hf->pFileEntry->szFileName)) + { + SetLastError(ERROR_INTERNAL_FILE); + return false; + } + + // Do not allow changing file locales in MPQs version 3 or higher + ha = hf->ha; + if(ha->pHeader->wFormatVersion >= MPQ_FORMAT_VERSION_3) + { + SetLastError(ERROR_NOT_SUPPORTED); + return false; + } + + // Do not allow to rename files in MPQ open for read only + if(ha->dwFlags & MPQ_FLAG_READ_ONLY) + { + SetLastError(ERROR_ACCESS_DENIED); + return false; + } + + // If the file already has that locale, return OK + if(hf->pFileEntry->lcLocale == lcNewLocale) + return true; + + // We have to check if the file+locale is not already there + pFileEntry = GetFileEntryExact(ha, hf->pFileEntry->szFileName, lcNewLocale); + if(pFileEntry != NULL) + { + SetLastError(ERROR_ALREADY_EXISTS); + return false; + } + + // Set the locale and return success + pFileEntry = hf->pFileEntry; + pFileEntry->lcLocale = (USHORT)lcNewLocale; + + // Save the new locale to the hash table, if any + if(ha->pHashTable != NULL) + ha->pHashTable[pFileEntry->dwHashIndex].lcLocale = (USHORT)lcNewLocale; + + // Remember that the MPQ tables have been changed + ha->dwFlags |= MPQ_FLAG_CHANGED; + return true; +} + +//----------------------------------------------------------------------------- +// Sets add file callback + +bool WINAPI SFileSetAddFileCallback(HANDLE /* hMpq */, SFILE_ADDFILE_CALLBACK aAddFileCB, void * pvData) +{ + pvUserData = pvData; + AddFileCB = aAddFileCB; + return true; +} diff --git a/dep/StormLib/src/SFileAttributes.cpp b/dep/StormLib/src/SFileAttributes.cpp new file mode 100644 index 00000000000..091950885c8 --- /dev/null +++ b/dep/StormLib/src/SFileAttributes.cpp @@ -0,0 +1,399 @@ +/*****************************************************************************/ +/* SAttrFile.cpp Copyright (c) Ladislav Zezula 2007 */ +/*---------------------------------------------------------------------------*/ +/* Description: */ +/*---------------------------------------------------------------------------*/ +/* Date Ver Who Comment */ +/* -------- ---- --- ------- */ +/* 12.06.04 1.00 Lad The first version of SAttrFile.cpp */ +/*****************************************************************************/ + +#define __STORMLIB_SELF__ +#include "StormLib.h" +#include "StormCommon.h" + +//----------------------------------------------------------------------------- +// Local structures + +typedef struct _MPQ_ATTRIBUTES_HEADER +{ + DWORD dwVersion; // Version of the (attributes) file. Must be 100 (0x64) + DWORD dwFlags; // See MPQ_ATTRIBUTE_XXXX + + // Followed by an array of CRC32 + // Followed by an array of file times + // Followed by an array of MD5 +} MPQ_ATTRIBUTES_HEADER, *PMPQ_ATTRIBUTES_HEADER; + +//----------------------------------------------------------------------------- +// Public functions (internal use by StormLib) + +int SAttrLoadAttributes(TMPQArchive * ha) +{ + MPQ_ATTRIBUTES_HEADER AttrHeader; + TMPQFile * hf; + HANDLE hFile = NULL; + DWORD dwBlockTableSize = ha->pHeader->dwBlockTableSize; + DWORD dwArraySize; + DWORD dwBytesRead; + DWORD i; + int nError = ERROR_SUCCESS; + + // File table must be initialized + assert(ha->pFileTable != NULL); + + // Attempt to open the "(attributes)" file. + // If it's not there, then the archive doesn't support attributes + if(SFileOpenFileEx((HANDLE)ha, ATTRIBUTES_NAME, SFILE_OPEN_ANY_LOCALE, &hFile)) + { + // Remember the flags for (attributes) + hf = (TMPQFile *)hFile; + ha->dwFileFlags2 = hf->pFileEntry->dwFlags; + + // Load the content of the attributes file + SFileReadFile(hFile, &AttrHeader, sizeof(MPQ_ATTRIBUTES_HEADER), &dwBytesRead, NULL); + if(dwBytesRead != sizeof(MPQ_ATTRIBUTES_HEADER)) + nError = ERROR_FILE_CORRUPT; + + // Verify the header of the (attributes) file + if(nError == ERROR_SUCCESS) + { + AttrHeader.dwVersion = BSWAP_INT32_UNSIGNED(AttrHeader.dwVersion); + AttrHeader.dwFlags = BSWAP_INT32_UNSIGNED(AttrHeader.dwFlags); + ha->dwAttrFlags = AttrHeader.dwFlags; + if(dwBytesRead != sizeof(MPQ_ATTRIBUTES_HEADER)) + nError = ERROR_FILE_CORRUPT; + } + + // Verify format of the attributes + if(nError == ERROR_SUCCESS) + { + if(AttrHeader.dwVersion > MPQ_ATTRIBUTES_V1) + nError = ERROR_BAD_FORMAT; + } + + // Load the CRC32 (if any) + if(nError == ERROR_SUCCESS && (AttrHeader.dwFlags & MPQ_ATTRIBUTE_CRC32)) + { + LPDWORD pArrayCRC32 = STORM_ALLOC(DWORD, dwBlockTableSize); + + if(pArrayCRC32 != NULL) + { + dwArraySize = dwBlockTableSize * sizeof(DWORD); + SFileReadFile(hFile, pArrayCRC32, dwArraySize, &dwBytesRead, NULL); + if(dwBytesRead == dwArraySize) + { + for(i = 0; i < dwBlockTableSize; i++) + ha->pFileTable[i].dwCrc32 = BSWAP_INT32_UNSIGNED(pArrayCRC32[i]); + } + else + nError = ERROR_FILE_CORRUPT; + + STORM_FREE(pArrayCRC32); + } + else + nError = ERROR_NOT_ENOUGH_MEMORY; + } + + // Read the array of file times + if(nError == ERROR_SUCCESS && (AttrHeader.dwFlags & MPQ_ATTRIBUTE_FILETIME)) + { + ULONGLONG * pArrayFileTime = STORM_ALLOC(ULONGLONG, dwBlockTableSize); + + if(pArrayFileTime != NULL) + { + dwArraySize = dwBlockTableSize * sizeof(ULONGLONG); + SFileReadFile(hFile, pArrayFileTime, dwArraySize, &dwBytesRead, NULL); + if(dwBytesRead == dwArraySize) + { + for(i = 0; i < dwBlockTableSize; i++) + ha->pFileTable[i].FileTime = BSWAP_INT64_UNSIGNED(pArrayFileTime[i]); + } + else + nError = ERROR_FILE_CORRUPT; + + STORM_FREE(pArrayFileTime); + } + else + nError = ERROR_NOT_ENOUGH_MEMORY; + } + + // Read the MD5 (if any) + // Note: MD5 array can be incomplete, if it's the last array in the (attributes) + if(nError == ERROR_SUCCESS && (AttrHeader.dwFlags & MPQ_ATTRIBUTE_MD5)) + { + unsigned char * pArrayMD5 = STORM_ALLOC(unsigned char, (dwBlockTableSize * MD5_DIGEST_SIZE)); + unsigned char * md5; + + if(pArrayMD5 != NULL) + { + dwArraySize = dwBlockTableSize * MD5_DIGEST_SIZE; + SFileReadFile(hFile, pArrayMD5, dwArraySize, &dwBytesRead, NULL); + if(dwBytesRead == dwArraySize) + { + md5 = pArrayMD5; + for(i = 0; i < dwBlockTableSize; i++) + { + memcpy(ha->pFileTable[i].md5, md5, MD5_DIGEST_SIZE); + md5 += MD5_DIGEST_SIZE; + } + } + else + nError = ERROR_FILE_CORRUPT; + + STORM_FREE(pArrayMD5); + } + else + nError = ERROR_NOT_ENOUGH_MEMORY; + } + + // + // Note: Version 7.00 of StormLib saved the (attributes) incorrectly. + // Sometimes, number of entries in the (attributes) was 1 item less + // than block table size. + // If we encounter such table, we will zero all three arrays + // + + if(nError != ERROR_SUCCESS) + ha->dwAttrFlags = 0; + + // Cleanup & exit + SFileCloseFile(hFile); + } + return nError; +} + +int SAttrFileSaveToMpq(TMPQArchive * ha) +{ + MPQ_ATTRIBUTES_HEADER AttrHeader; + TFileEntry * pFileEntry; + TMPQFile * hf = NULL; + DWORD dwFinalBlockTableSize = ha->dwFileTableSize; + DWORD dwFileSize = 0; + DWORD dwToWrite; + DWORD i; + int nError = ERROR_SUCCESS; + + // If the (attributes) is not in the file table yet, + // we have to increase the final block table size + pFileEntry = GetFileEntryExact(ha, ATTRIBUTES_NAME, LANG_NEUTRAL); + if(pFileEntry != NULL) + { + // If "(attributes)" file exists, and it's set to 0, then remove it + if(ha->dwAttrFlags == 0) + { + FreeFileEntry(ha, pFileEntry); + return ERROR_SUCCESS; + } + } + else + { + // If we don't want to create file atributes, do nothing + if(ha->dwAttrFlags == 0) + return ERROR_SUCCESS; + + // Check where the file entry is going to be allocated. + // If at the end of the file table, we have to increment + // the expected size of the (attributes) file. + pFileEntry = FindFreeFileEntry(ha); + if(pFileEntry == ha->pFileTable + ha->dwFileTableSize) + dwFinalBlockTableSize++; + } + + // Calculate the size of the attributes file + if(nError == ERROR_SUCCESS) + { + dwFileSize = sizeof(MPQ_ATTRIBUTES_HEADER); // Header + if(ha->dwAttrFlags & MPQ_ATTRIBUTE_CRC32) + dwFileSize += dwFinalBlockTableSize * sizeof(DWORD); + if(ha->dwAttrFlags & MPQ_ATTRIBUTE_FILETIME) + dwFileSize += dwFinalBlockTableSize * sizeof(ULONGLONG); + if(ha->dwAttrFlags & MPQ_ATTRIBUTE_MD5) + dwFileSize += dwFinalBlockTableSize * MD5_DIGEST_SIZE; + } + + // Create the attributes file in the MPQ + assert(ha->dwFileFlags2 != 0); + nError = SFileAddFile_Init(ha, ATTRIBUTES_NAME, + 0, + dwFileSize, + LANG_NEUTRAL, + ha->dwFileFlags2, + &hf); + + // Write all parts of the (attributes) file + if(nError == ERROR_SUCCESS) + { + assert(ha->dwFileTableSize == dwFinalBlockTableSize); + + AttrHeader.dwVersion = BSWAP_INT32_UNSIGNED(100); + AttrHeader.dwFlags = BSWAP_INT32_UNSIGNED(ha->dwAttrFlags); + dwToWrite = sizeof(MPQ_ATTRIBUTES_HEADER); + nError = SFileAddFile_Write(hf, &AttrHeader, dwToWrite, MPQ_COMPRESSION_ZLIB); + } + + // Write the array of CRC32 + if(nError == ERROR_SUCCESS && (ha->dwAttrFlags & MPQ_ATTRIBUTE_CRC32)) + { + LPDWORD pArrayCRC32 = STORM_ALLOC(DWORD, dwFinalBlockTableSize); + + if(pArrayCRC32 != NULL) + { + // Copy from file table + for(i = 0; i < ha->dwFileTableSize; i++) + pArrayCRC32[i] = BSWAP_INT32_UNSIGNED(ha->pFileTable[i].dwCrc32); + + dwToWrite = ha->dwFileTableSize * sizeof(DWORD); + nError = SFileAddFile_Write(hf, pArrayCRC32, dwToWrite, MPQ_COMPRESSION_ZLIB); + STORM_FREE(pArrayCRC32); + } + } + + // Write the array of file time + if(nError == ERROR_SUCCESS && (ha->dwAttrFlags & MPQ_ATTRIBUTE_FILETIME)) + { + ULONGLONG * pArrayFileTime = STORM_ALLOC(ULONGLONG, ha->dwFileTableSize); + + if(pArrayFileTime != NULL) + { + // Copy from file table + for(i = 0; i < ha->dwFileTableSize; i++) + pArrayFileTime[i] = BSWAP_INT64_UNSIGNED(ha->pFileTable[i].FileTime); + + dwToWrite = ha->dwFileTableSize * sizeof(ULONGLONG); + nError = SFileAddFile_Write(hf, pArrayFileTime, dwToWrite, MPQ_COMPRESSION_ZLIB); + STORM_FREE(pArrayFileTime); + } + } + + // Write the array of MD5s + if(nError == ERROR_SUCCESS && (ha->dwAttrFlags & MPQ_ATTRIBUTE_MD5)) + { + char * pArrayMD5 = STORM_ALLOC(char, ha->dwFileTableSize * MD5_DIGEST_SIZE); + + if(pArrayMD5 != NULL) + { + // Copy from file table + for(i = 0; i < ha->dwFileTableSize; i++) + memcpy(&pArrayMD5[i * MD5_DIGEST_SIZE], ha->pFileTable[i].md5, MD5_DIGEST_SIZE); + + dwToWrite = ha->dwFileTableSize * MD5_DIGEST_SIZE; + nError = SFileAddFile_Write(hf, pArrayMD5, dwToWrite, MPQ_COMPRESSION_ZLIB); + STORM_FREE(pArrayMD5); + } + } + + // Finalize the file in the archive + if(hf != NULL) + { + SFileAddFile_Finish(hf); + } + + if(nError == ERROR_SUCCESS) + ha->dwFlags &= ~MPQ_FLAG_INV_ATTRIBUTES; + return nError; +} + +//----------------------------------------------------------------------------- +// Public functions + +DWORD WINAPI SFileGetAttributes(HANDLE hMpq) +{ + TMPQArchive * ha = (TMPQArchive *)hMpq; + + // Verify the parameters + if(!IsValidMpqHandle(ha)) + { + SetLastError(ERROR_INVALID_PARAMETER); + return SFILE_INVALID_ATTRIBUTES; + } + + return ha->dwAttrFlags; +} + +bool WINAPI SFileSetAttributes(HANDLE hMpq, DWORD dwFlags) +{ + TMPQArchive * ha = (TMPQArchive *)hMpq; + + // Verify the parameters + if(!IsValidMpqHandle(ha)) + { + SetLastError(ERROR_INVALID_PARAMETER); + return false; + } + + // Not allowed when the archive is read-only + if(ha->dwFlags & MPQ_FLAG_READ_ONLY) + { + SetLastError(ERROR_ACCESS_DENIED); + return false; + } + + // Set the attributes + InvalidateInternalFiles(ha); + ha->dwAttrFlags = (dwFlags & MPQ_ATTRIBUTE_ALL); + return true; +} + +bool WINAPI SFileUpdateFileAttributes(HANDLE hMpq, const char * szFileName) +{ + hash_state md5_state; + TMPQArchive * ha = (TMPQArchive *)hMpq; + TMPQFile * hf; + BYTE Buffer[0x1000]; + HANDLE hFile = NULL; + DWORD dwTotalBytes = 0; + DWORD dwBytesRead; + DWORD dwCrc32; + + // Verify the parameters + if(!IsValidMpqHandle(ha)) + { + SetLastError(ERROR_INVALID_PARAMETER); + return false; + } + + // Not allowed when the archive is read-only + if(ha->dwFlags & MPQ_FLAG_READ_ONLY) + { + SetLastError(ERROR_ACCESS_DENIED); + return false; + } + + // Attempt to open the file + if(!SFileOpenFileEx(hMpq, szFileName, SFILE_OPEN_FROM_MPQ, &hFile)) + return false; + + // Get the file size + hf = (TMPQFile *)hFile; + SFileGetFileInfo(hFile, SFILE_INFO_FILE_SIZE, &dwTotalBytes, sizeof(DWORD)); + + // Initialize the CRC32 and MD5 contexts + md5_init(&md5_state); + dwCrc32 = crc32(0, Z_NULL, 0); + + // Go through entire file and calculate both CRC32 and MD5 + while(dwTotalBytes != 0) + { + // Read data from file + SFileReadFile(hFile, Buffer, sizeof(Buffer), &dwBytesRead, NULL); + if(dwBytesRead == 0) + break; + + // Update CRC32 and MD5 + dwCrc32 = crc32(dwCrc32, Buffer, dwBytesRead); + md5_process(&md5_state, Buffer, dwBytesRead); + + // Decrement the total size + dwTotalBytes -= dwBytesRead; + } + + // Update both CRC32 and MD5 + hf->pFileEntry->dwCrc32 = dwCrc32; + md5_done(&md5_state, hf->pFileEntry->md5); + + // Remember that we need to save the MPQ tables + InvalidateInternalFiles(ha); + SFileCloseFile(hFile); + return true; +} diff --git a/dep/StormLib/src/SFileCompactArchive.cpp b/dep/StormLib/src/SFileCompactArchive.cpp new file mode 100644 index 00000000000..09cb179bd74 --- /dev/null +++ b/dep/StormLib/src/SFileCompactArchive.cpp @@ -0,0 +1,735 @@ +/*****************************************************************************/ +/* SFileCompactArchive.cpp Copyright (c) Ladislav Zezula 2003 */ +/*---------------------------------------------------------------------------*/ +/* Archive compacting function */ +/*---------------------------------------------------------------------------*/ +/* Date Ver Who Comment */ +/* -------- ---- --- ------- */ +/* 14.04.03 1.00 Lad Splitted from SFileCreateArchiveEx.cpp */ +/* 19.11.03 1.01 Dan Big endian handling */ +/*****************************************************************************/ + +#define __STORMLIB_SELF__ +#include "StormLib.h" +#include "StormCommon.h" + +/*****************************************************************************/ +/* Local variables */ +/*****************************************************************************/ + +static SFILE_COMPACT_CALLBACK CompactCB = NULL; +static ULONGLONG CompactBytesProcessed = 0; +static ULONGLONG CompactTotalBytes = 0; +static void * pvUserData = NULL; + +/*****************************************************************************/ +/* Local functions */ +/*****************************************************************************/ + +static int CheckIfAllFilesKnown(TMPQArchive * ha, const char * szListFile, LPDWORD pFileKeys) +{ + TFileEntry * pFileTableEnd; + TFileEntry * pFileEntry; + DWORD dwBlockIndex = 0; + int nError = ERROR_SUCCESS; + + // Add the listfile to the MPQ + if(nError == ERROR_SUCCESS && szListFile != NULL) + { + // Notify the user + if(CompactCB != NULL) + CompactCB(pvUserData, CCB_CHECKING_FILES, CompactBytesProcessed, CompactTotalBytes); + + nError = SFileAddListFile((HANDLE)ha, szListFile); + } + + // Verify the file table + if(nError == ERROR_SUCCESS) + { + pFileTableEnd = ha->pFileTable + ha->dwFileTableSize; + for(pFileEntry = ha->pFileTable; pFileEntry < pFileTableEnd; pFileEntry++, dwBlockIndex++) + { + if(pFileEntry->dwFlags & MPQ_FILE_EXISTS) + { + if(pFileEntry->szFileName != NULL && !IsPseudoFileName(pFileEntry->szFileName, NULL)) + { + DWORD dwFileKey = 0; + + // Resolve the file key. Use plain file name for it + if(pFileEntry->dwFlags & MPQ_FILE_ENCRYPTED) + { + dwFileKey = DecryptFileKey(pFileEntry->szFileName, + pFileEntry->ByteOffset, + pFileEntry->dwFileSize, + pFileEntry->dwFlags); + } + + // Give the key to the caller + if(pFileKeys != NULL) + pFileKeys[dwBlockIndex] = dwFileKey; + } + else + { + nError = ERROR_CAN_NOT_COMPLETE; + break; + } + } + } + } + + return nError; +} + +static int CopyNonMpqData( + TFileStream * pSrcStream, + TFileStream * pTrgStream, + ULONGLONG & ByteOffset, + ULONGLONG & ByteCount) +{ + ULONGLONG DataSize = ByteCount; + DWORD dwToRead; + char DataBuffer[0x1000]; + int nError = ERROR_SUCCESS; + + // Copy the data + while(DataSize > 0) + { + // Get the proper size of data + dwToRead = sizeof(DataBuffer); + if(DataSize < dwToRead) + dwToRead = (DWORD)DataSize; + + // Read from the source stream + if(!FileStream_Read(pSrcStream, &ByteOffset, DataBuffer, dwToRead)) + { + nError = GetLastError(); + break; + } + + // Write to the target stream + if(!FileStream_Write(pTrgStream, NULL, DataBuffer, dwToRead)) + { + nError = GetLastError(); + break; + } + + // Update the progress + if(CompactCB != NULL) + { + CompactBytesProcessed += dwToRead; + CompactCB(pvUserData, CCB_COPYING_NON_MPQ_DATA, CompactBytesProcessed, CompactTotalBytes); + } + + // Decrement the number of data to be copied + ByteOffset += dwToRead; + DataSize -= dwToRead; + } + + return ERROR_SUCCESS; +} + +// Copies all file sectors into another archive. +static int CopyMpqFileSectors( + TMPQArchive * ha, + TMPQFile * hf, + TFileStream * pNewStream) +{ + TFileEntry * pFileEntry = hf->pFileEntry; + ULONGLONG RawFilePos; // Used for calculating sector offset in the old MPQ archive + ULONGLONG MpqFilePos; // MPQ file position in the new archive + DWORD dwBytesToCopy = pFileEntry->dwCmpSize; + DWORD dwPatchSize = 0; // Size of patch header + DWORD dwFileKey1 = 0; // File key used for decryption + DWORD dwFileKey2 = 0; // File key used for encryption + DWORD dwCmpSize = 0; // Compressed file size, including patch header + int nError = ERROR_SUCCESS; + + // Remember the position in the destination file + FileStream_GetPos(pNewStream, MpqFilePos); + MpqFilePos -= ha->MpqPos; + + // Resolve decryption keys. Note that the file key given + // in the TMPQFile structure also includes the key adjustment + if(nError == ERROR_SUCCESS && (pFileEntry->dwFlags & MPQ_FILE_ENCRYPTED)) + { + dwFileKey2 = dwFileKey1 = hf->dwFileKey; + if(pFileEntry->dwFlags & MPQ_FILE_FIX_KEY) + { + dwFileKey2 = (dwFileKey1 ^ pFileEntry->dwFileSize) - (DWORD)pFileEntry->ByteOffset; + dwFileKey2 = (dwFileKey2 + (DWORD)MpqFilePos) ^ pFileEntry->dwFileSize; + } + } + + // If we have to save patch header, do it + if(nError == ERROR_SUCCESS && hf->pPatchInfo != NULL) + { + BSWAP_ARRAY32_UNSIGNED(hf->pPatchInfo, sizeof(DWORD) * 3); + if(!FileStream_Write(pNewStream, NULL, hf->pPatchInfo, hf->pPatchInfo->dwLength)) + nError = GetLastError(); + + // Save the size of the patch info + dwPatchSize = hf->pPatchInfo->dwLength; + } + + // If we have to save sector offset table, do it. + if(nError == ERROR_SUCCESS && hf->SectorOffsets != NULL) + { + DWORD * SectorOffsetsCopy = (DWORD *)STORM_ALLOC(BYTE, hf->SectorOffsets[0]); + DWORD dwSectorOffsLen = hf->SectorOffsets[0]; + + assert((pFileEntry->dwFlags & MPQ_FILE_SINGLE_UNIT) == 0); + assert(pFileEntry->dwFlags & MPQ_FILE_COMPRESSED); + + if(SectorOffsetsCopy == NULL) + nError = ERROR_NOT_ENOUGH_MEMORY; + + // Encrypt the secondary sector offset table and write it to the target file + if(nError == ERROR_SUCCESS) + { + memcpy(SectorOffsetsCopy, hf->SectorOffsets, dwSectorOffsLen); + if(pFileEntry->dwFlags & MPQ_FILE_ENCRYPTED) + EncryptMpqBlock(SectorOffsetsCopy, dwSectorOffsLen, dwFileKey2 - 1); + + BSWAP_ARRAY32_UNSIGNED(SectorOffsetsCopy, dwSectorOffsLen); + if(!FileStream_Write(pNewStream, NULL, SectorOffsetsCopy, dwSectorOffsLen)) + nError = GetLastError(); + + dwCmpSize += dwSectorOffsLen; + } + + // Update compact progress + if(CompactCB != NULL) + { + CompactBytesProcessed += dwSectorOffsLen; + CompactCB(pvUserData, CCB_COMPACTING_FILES, CompactBytesProcessed, CompactTotalBytes); + } + + STORM_FREE(SectorOffsetsCopy); + } + + // Now we have to copy all file sectors. We do it without + // recompression, because recompression is not necessary in this case + if(nError == ERROR_SUCCESS) + { + for(DWORD dwSector = 0; dwSector < hf->dwSectorCount; dwSector++) + { + DWORD dwRawDataInSector = hf->dwSectorSize; + DWORD dwRawByteOffset = dwSector * hf->dwSectorSize; + + // Last sector: If there is not enough bytes remaining in the file, cut the raw size + if(dwRawDataInSector > dwBytesToCopy) + dwRawDataInSector = dwBytesToCopy; + + // Fix the raw data length if the file is compressed + if(hf->SectorOffsets != NULL) + { + dwRawDataInSector = hf->SectorOffsets[dwSector+1] - hf->SectorOffsets[dwSector]; + dwRawByteOffset = hf->SectorOffsets[dwSector]; + } + + // Calculate the raw file offset of the file sector + CalculateRawSectorOffset(RawFilePos, hf, dwRawByteOffset); + + // Read the file sector + if(!FileStream_Read(ha->pStream, &RawFilePos, hf->pbFileSector, dwRawDataInSector)) + { + nError = GetLastError(); + break; + } + + // If necessary, re-encrypt the sector + // Note: Recompression is not necessary here. Unlike encryption, + // the compression does not depend on the position of the file in MPQ. + if((pFileEntry->dwFlags & MPQ_FILE_ENCRYPTED) && dwFileKey1 != dwFileKey2) + { + BSWAP_ARRAY32_UNSIGNED(hf->pbFileSector, dwRawDataInSector); + DecryptMpqBlock(hf->pbFileSector, dwRawDataInSector, dwFileKey1 + dwSector); + EncryptMpqBlock(hf->pbFileSector, dwRawDataInSector, dwFileKey2 + dwSector); + BSWAP_ARRAY32_UNSIGNED(hf->pbFileSector, dwRawDataInSector); + } + + // Now write the sector back to the file + if(!FileStream_Write(pNewStream, NULL, hf->pbFileSector, dwRawDataInSector)) + { + nError = GetLastError(); + break; + } + + // Update compact progress + if(CompactCB != NULL) + { + CompactBytesProcessed += dwRawDataInSector; + CompactCB(pvUserData, CCB_COMPACTING_FILES, CompactBytesProcessed, CompactTotalBytes); + } + + // Adjust byte counts + dwBytesToCopy -= hf->dwSectorSize; + dwCmpSize += dwRawDataInSector; + } + } + + // Copy the sector CRCs, if any + // Sector CRCs are always compressed (not imploded) and unencrypted + if(nError == ERROR_SUCCESS && hf->SectorOffsets != NULL && hf->SectorChksums != NULL) + { + DWORD dwCrcLength; + + dwCrcLength = hf->SectorOffsets[hf->dwSectorCount + 1] - hf->SectorOffsets[hf->dwSectorCount]; + if(dwCrcLength != 0) + { + if(!FileStream_Read(ha->pStream, NULL, hf->SectorChksums, dwCrcLength)) + nError = GetLastError(); + + if(!FileStream_Write(pNewStream, NULL, hf->SectorChksums, dwCrcLength)) + nError = GetLastError(); + + // Update compact progress + if(CompactCB != NULL) + { + CompactBytesProcessed += dwCrcLength; + CompactCB(pvUserData, CCB_COMPACTING_FILES, CompactBytesProcessed, CompactTotalBytes); + } + + // Size of the CRC block is also included in the compressed file size + dwCmpSize += dwCrcLength; + } + } + + // Write the MD5's of the raw file data, if needed + if(nError == ERROR_SUCCESS && ha->pHeader->dwRawChunkSize != 0) + { + nError = WriteMpqDataMD5(pNewStream, + ha->MpqPos + MpqFilePos, + pFileEntry->dwCmpSize, + ha->pHeader->dwRawChunkSize); + } + + // Update file position in the block table + if(nError == ERROR_SUCCESS) + { + // At this point, number of bytes written should be exactly + // the same like the compressed file size. If it isn't, + // there's something wrong (an unknown archive version, MPQ protection, ...) + // + // Note: Diablo savegames have very weird layout, and the file "hero" + // seems to have improper compressed size. Instead of real compressed size, + // the "dwCmpSize" member of the block table entry contains + // uncompressed size of file data + size of the sector table. + // If we compact the archive, Diablo will refuse to load the game + // Seems like some sort of protection to me. + // + // Note: Some patch files in WOW patches don't count the patch header + // into compressed size + // + + if(dwCmpSize <= pFileEntry->dwCmpSize && pFileEntry->dwCmpSize <= dwCmpSize + dwPatchSize) + { + // Note: DO NOT update the compressed size in the file entry, no matter how bad it is. + pFileEntry->ByteOffset = MpqFilePos; + } + else + { + nError = ERROR_FILE_CORRUPT; + assert(false); + } + } + + return nError; +} + +static int CopyMpqFiles(TMPQArchive * ha, LPDWORD pFileKeys, TFileStream * pNewStream) +{ + TFileEntry * pFileTableEnd = ha->pFileTable + ha->dwFileTableSize; + TFileEntry * pFileEntry; + TMPQFile * hf = NULL; + int nError = ERROR_SUCCESS; + + // Walk through all files and write them to the destination MPQ archive + for(pFileEntry = ha->pFileTable; pFileEntry < pFileTableEnd; pFileEntry++) + { + // Copy all the file sectors + // Only do that when the file has nonzero size + if((pFileEntry->dwFlags & MPQ_FILE_EXISTS) && pFileEntry->dwFileSize != 0) + { + // Allocate structure for the MPQ file + hf = CreateMpqFile(ha); + if(hf == NULL) + return ERROR_NOT_ENOUGH_MEMORY; + + // Store file entry + hf->pFileEntry = pFileEntry; + + // Set the raw file position + hf->MpqFilePos = pFileEntry->ByteOffset; + hf->RawFilePos = ha->MpqPos + hf->MpqFilePos; + + // Set the file decryption key + hf->dwFileKey = pFileKeys[pFileEntry - ha->pFileTable]; + hf->dwDataSize = pFileEntry->dwFileSize; + + // If the file is a patch file, load the patch header + if(pFileEntry->dwFlags & MPQ_FILE_PATCH_FILE) + { + nError = AllocatePatchInfo(hf, true); + if(nError != ERROR_SUCCESS) + break; + } + + // Allocate buffers for file sector and sector offset table + nError = AllocateSectorBuffer(hf); + if(nError != ERROR_SUCCESS) + break; + + // Also allocate sector offset table and sector checksum table + nError = AllocateSectorOffsets(hf, true); + if(nError != ERROR_SUCCESS) + break; + + // Also load sector checksums, if any + if(pFileEntry->dwFlags & MPQ_FILE_SECTOR_CRC) + { + nError = AllocateSectorChecksums(hf, false); + if(nError != ERROR_SUCCESS) + break; + } + + // Copy all file sectors + nError = CopyMpqFileSectors(ha, hf, pNewStream); + if(nError != ERROR_SUCCESS) + break; + + // Free buffers. This also sets "hf" to NULL. + FreeMPQFile(hf); + } + } + + // Cleanup and exit + if(hf != NULL) + FreeMPQFile(hf); + return nError; +} + + +/*****************************************************************************/ +/* Public functions */ +/*****************************************************************************/ + +bool WINAPI SFileSetCompactCallback(HANDLE /* hMpq */, SFILE_COMPACT_CALLBACK aCompactCB, void * pvData) +{ + CompactCB = aCompactCB; + pvUserData = pvData; + return true; +} + +//----------------------------------------------------------------------------- +// Archive compacting + +bool WINAPI SFileCompactArchive(HANDLE hMpq, const char * szListFile, bool /* bReserved */) +{ + TFileStream * pTempStream = NULL; + TMPQArchive * ha = (TMPQArchive *)hMpq; + ULONGLONG ByteOffset; + ULONGLONG ByteCount; + LPDWORD pFileKeys = NULL; + TCHAR szTempFile[MAX_PATH] = _T(""); + TCHAR * szTemp = NULL; + int nError = ERROR_SUCCESS; + + // Test the valid parameters + if(!IsValidMpqHandle(ha)) + nError = ERROR_INVALID_HANDLE; + if(ha->dwFlags & MPQ_FLAG_READ_ONLY) + nError = ERROR_ACCESS_DENIED; + + // If the MPQ is changed at this moment, we have to flush the archive + if(nError == ERROR_SUCCESS && (ha->dwFlags & MPQ_FLAG_CHANGED)) + { + SFileFlushArchive(hMpq); + } + + // Create the table with file keys + if(nError == ERROR_SUCCESS) + { + if((pFileKeys = STORM_ALLOC(DWORD, ha->dwFileTableSize)) != NULL) + memset(pFileKeys, 0, sizeof(DWORD) * ha->dwFileTableSize); + else + nError = ERROR_NOT_ENOUGH_MEMORY; + } + + // First of all, we have to check of we are able to decrypt all files. + // If not, sorry, but the archive cannot be compacted. + if(nError == ERROR_SUCCESS) + { + // Initialize the progress variables for compact callback + FileStream_GetSize(ha->pStream, CompactTotalBytes); + CompactBytesProcessed = 0; + nError = CheckIfAllFilesKnown(ha, szListFile, pFileKeys); + } + + // Get the temporary file name and create it + if(nError == ERROR_SUCCESS) + { + _tcscpy(szTempFile, ha->pStream->szFileName); + if((szTemp = _tcsrchr(szTempFile, '.')) != NULL) + _tcscpy(szTemp + 1, _T("mp_")); + else + _tcscat(szTempFile, _T("_")); + + pTempStream = FileStream_CreateFile(szTempFile); + if(pTempStream == NULL) + nError = GetLastError(); + } + + // Write the data before MPQ user data (if any) + if(nError == ERROR_SUCCESS && ha->UserDataPos != 0) + { + // Inform the application about the progress + if(CompactCB != NULL) + CompactCB(pvUserData, CCB_COPYING_NON_MPQ_DATA, CompactBytesProcessed, CompactTotalBytes); + + ByteOffset = 0; + ByteCount = ha->UserDataPos; + nError = CopyNonMpqData(ha->pStream, pTempStream, ByteOffset, ByteCount); + } + + // Write the MPQ user data (if any) + if(nError == ERROR_SUCCESS && ha->MpqPos > ha->UserDataPos) + { + // At this point, we assume that the user data size is equal + // to pUserData->dwHeaderOffs. + // If this assumption doesn't work, then we have an unknown version of MPQ + ByteOffset = ha->UserDataPos; + ByteCount = ha->MpqPos - ha->UserDataPos; + + assert(ha->pUserData != NULL); + assert(ha->pUserData->dwHeaderOffs == ByteCount); + nError = CopyNonMpqData(ha->pStream, pTempStream, ByteOffset, ByteCount); + } + + // Write the MPQ header + if(nError == ERROR_SUCCESS) + { + // Remember the header size before swapping + DWORD dwBytesToWrite = ha->pHeader->dwHeaderSize; + + BSWAP_TMPQHEADER(ha->pHeader); + if(!FileStream_Write(pTempStream, NULL, ha->pHeader, dwBytesToWrite)) + nError = GetLastError(); + BSWAP_TMPQHEADER(ha->pHeader); + + // Update the progress + CompactBytesProcessed += ha->pHeader->dwHeaderSize; + } + + // Now copy all files + if(nError == ERROR_SUCCESS) + { + nError = CopyMpqFiles(ha, pFileKeys, pTempStream); + ha->dwFlags |= MPQ_FLAG_CHANGED; + } + + // If succeeded, switch the streams + if(nError == ERROR_SUCCESS) + { + if(FileStream_MoveFile(ha->pStream, pTempStream)) + pTempStream = NULL; + else + nError = ERROR_CAN_NOT_COMPLETE; + } + + // If all succeeded, save the MPQ tables + if(nError == ERROR_SUCCESS) + { + // + // Note: We don't recalculate position of the MPQ tables at this point. + // SaveMPQTables does it automatically. + // + + nError = SaveMPQTables(ha); + if(nError == ERROR_SUCCESS && CompactCB != NULL) + { + CompactBytesProcessed += (ha->pHeader->dwHashTableSize * sizeof(TMPQHash)); + CompactBytesProcessed += (ha->pHeader->dwBlockTableSize * sizeof(TMPQBlock)); + CompactCB(pvUserData, CCB_CLOSING_ARCHIVE, CompactBytesProcessed, CompactTotalBytes); + } + } + + // Invalidate the compact callback + pvUserData = NULL; + CompactCB = NULL; + + // Cleanup and return + if(pTempStream != NULL) + FileStream_Close(pTempStream); + if(pFileKeys != NULL) + STORM_FREE(pFileKeys); + if(nError != ERROR_SUCCESS) + SetLastError(nError); + return (nError == ERROR_SUCCESS); +} + +//----------------------------------------------------------------------------- +// Changing hash table size + +DWORD WINAPI SFileGetMaxFileCount(HANDLE hMpq) +{ + TMPQArchive * ha = (TMPQArchive *)hMpq; + + return ha->dwMaxFileCount; +} + +bool WINAPI SFileSetMaxFileCount(HANDLE hMpq, DWORD dwMaxFileCount) +{ + TMPQHetTable * pOldHetTable = NULL; + TMPQArchive * ha = (TMPQArchive *)hMpq; + TFileEntry * pOldFileTableEnd = ha->pFileTable + ha->dwFileTableSize; + TFileEntry * pOldFileTable = NULL; + TFileEntry * pOldFileEntry; + TFileEntry * pFileEntry; + TMPQHash * pOldHashTable = NULL; + DWORD dwOldHashTableSize = 0; + DWORD dwOldFileTableSize = 0; + int nError = ERROR_SUCCESS; + + // Test the valid parameters + if(!IsValidMpqHandle(ha)) + nError = ERROR_INVALID_HANDLE; + if(ha->dwFlags & MPQ_FLAG_READ_ONLY) + nError = ERROR_ACCESS_DENIED; + + // The new limit must not be lower than the index of the last file entry in the table + if(nError == ERROR_SUCCESS && ha->dwFileTableSize > dwMaxFileCount) + nError = ERROR_DISK_FULL; + + // ALL file names must be known in order to be able + // to rebuild hash table size + if(nError == ERROR_SUCCESS) + { + nError = CheckIfAllFilesKnown(ha, NULL, NULL); + } + + // If the MPQ has a hash table, then we relocate the hash table + if(nError == ERROR_SUCCESS && ha->pHashTable != NULL) + { + // Save parameters for the current hash table + dwOldHashTableSize = ha->pHeader->dwHashTableSize; + pOldHashTable = ha->pHashTable; + + // Allocate new hash table + ha->pHeader->dwHashTableSize = GetHashTableSizeForFileCount(dwMaxFileCount); + ha->pHashTable = STORM_ALLOC(TMPQHash, ha->pHeader->dwHashTableSize); + if(ha->pHashTable != NULL) + memset(ha->pHashTable, 0xFF, ha->pHeader->dwHashTableSize * sizeof(TMPQHash)); + else + nError = ERROR_NOT_ENOUGH_MEMORY; + } + + // If the MPQ has HET table, allocate new one as well + if(nError == ERROR_SUCCESS && ha->pHetTable != NULL) + { + // Save the original HET table + pOldHetTable = ha->pHetTable; + + // Create new one + ha->pHetTable = CreateHetTable(dwMaxFileCount, 0x40, true); + if(ha->pHetTable == NULL) + nError = ERROR_NOT_ENOUGH_MEMORY; + } + + // Now reallocate the file table + if(nError == ERROR_SUCCESS) + { + // Save the current file table + dwOldFileTableSize = ha->dwFileTableSize; + pOldFileTable = ha->pFileTable; + + // Create new one + ha->pFileTable = STORM_ALLOC(TFileEntry, dwMaxFileCount); + if(ha->pFileTable != NULL) + memset(ha->pFileTable, 0, dwMaxFileCount * sizeof(TFileEntry)); + else + nError = ERROR_NOT_ENOUGH_MEMORY; + } + + // Now we have to build both classic hash table and HET table. + if(nError == ERROR_SUCCESS) + { + DWORD dwFileIndex = 0; + DWORD dwHashIndex = 0; + + // Create new hash and HET entry for each file + pFileEntry = ha->pFileTable; + for(pOldFileEntry = pOldFileTable; pOldFileEntry < pOldFileTableEnd; pOldFileEntry++) + { + if(pOldFileEntry->dwFlags & MPQ_FILE_EXISTS) + { + // Copy the old file entry to the new one + memcpy(pFileEntry, pOldFileEntry, sizeof(TFileEntry)); + assert(pFileEntry->szFileName != NULL); + + // Create new entry in the hash table + if(ha->pHashTable != NULL) + { + dwHashIndex = AllocateHashEntry(ha, pFileEntry); + if(dwHashIndex == HASH_ENTRY_FREE) + { + nError = ERROR_CAN_NOT_COMPLETE; + break; + } + } + + // Create new entry in the HET table, if needed + if(ha->pHetTable != NULL) + { + dwHashIndex = AllocateHetEntry(ha, pFileEntry); + if(dwHashIndex == HASH_ENTRY_FREE) + { + nError = ERROR_CAN_NOT_COMPLETE; + break; + } + } + + // Move to the next file entry in the new table + pFileEntry++; + dwFileIndex++; + } + } + } + + // Mark the archive as changed + // Note: We always have to rebuild the (attributes) file due to file table change + if(nError == ERROR_SUCCESS) + { + ha->dwMaxFileCount = dwMaxFileCount; + InvalidateInternalFiles(ha); + } + else + { + // Revert the hash table + if(ha->pHashTable != NULL && pOldHashTable != NULL) + { + STORM_FREE(ha->pHashTable); + ha->pHeader->dwHashTableSize = dwOldHashTableSize; + ha->pHashTable = pOldHashTable; + } + + // Revert the HET table + if(ha->pHetTable != NULL && pOldHetTable != NULL) + { + FreeHetTable(ha->pHetTable); + ha->pHetTable = pOldHetTable; + } + + // Revert the file table + if(pOldFileTable != NULL) + { + STORM_FREE(ha->pFileTable); + ha->pFileTable = pOldFileTable; + } + + SetLastError(nError); + } + + // Return the result + return (nError == ERROR_SUCCESS); +} diff --git a/dep/StormLib/src/SFileCreateArchive.cpp b/dep/StormLib/src/SFileCreateArchive.cpp new file mode 100644 index 00000000000..6e8be7c46ec --- /dev/null +++ b/dep/StormLib/src/SFileCreateArchive.cpp @@ -0,0 +1,234 @@ +/*****************************************************************************/ +/* SFileCreateArchive.cpp Copyright (c) Ladislav Zezula 2003 */ +/*---------------------------------------------------------------------------*/ +/* MPQ Editing functions */ +/*---------------------------------------------------------------------------*/ +/* Date Ver Who Comment */ +/* -------- ---- --- ------- */ +/* 24.03.03 1.00 Lad Splitted from SFileOpenArchive.cpp */ +/* 08.06.10 1.00 Lad Renamed to SFileCreateArchive.cpp */ +/*****************************************************************************/ + +#define __STORMLIB_SELF__ +#include "StormLib.h" +#include "StormCommon.h" + +//----------------------------------------------------------------------------- +// Local variables + +static const DWORD MpqHeaderSizes[] = +{ + MPQ_HEADER_SIZE_V1, + MPQ_HEADER_SIZE_V2, + MPQ_HEADER_SIZE_V3, + MPQ_HEADER_SIZE_V4 +}; + +//----------------------------------------------------------------------------- +// Local functions + +static USHORT GetSectorSizeShift(DWORD dwSectorSize) +{ + USHORT wSectorSizeShift = 0; + + while(dwSectorSize > 0x200) + { + dwSectorSize >>= 1; + wSectorSizeShift++; + } + + return wSectorSizeShift; +} + +static int WriteNakedMPQHeader(TMPQArchive * ha) +{ + TMPQHeader * pHeader = ha->pHeader; + TMPQHeader Header; + DWORD dwBytesToWrite = pHeader->dwHeaderSize; + int nError = ERROR_SUCCESS; + + // Prepare the naked MPQ header + memset(&Header, 0, sizeof(TMPQHeader)); + Header.dwID = pHeader->dwID; + Header.dwHeaderSize = pHeader->dwHeaderSize; + Header.dwArchiveSize = pHeader->dwHeaderSize; + Header.wFormatVersion = pHeader->wFormatVersion; + Header.wSectorSize = pHeader->wSectorSize; + + // Write it to the file + BSWAP_TMPQHEADER(&Header); + if(!FileStream_Write(ha->pStream, &ha->MpqPos, &Header, dwBytesToWrite)) + nError = GetLastError(); + + return nError; +} + +//----------------------------------------------------------------------------- +// Creates a new MPQ archive. + +bool WINAPI SFileCreateArchive(const TCHAR * szMpqName, DWORD dwFlags, DWORD dwMaxFileCount, HANDLE * phMpq) +{ + TFileStream * pStream = NULL; // File stream + TMPQArchive * ha = NULL; // MPQ archive handle + ULONGLONG MpqPos = 0; // Position of MPQ header in the file + HANDLE hMpq = NULL; + USHORT wFormatVersion = MPQ_FORMAT_VERSION_1; + DWORD dwBlockTableSize = 0; // Initial block table size + DWORD dwHashTableSize = 0; + int nError = ERROR_SUCCESS; + + // Check the parameters, if they are valid + if(szMpqName == NULL || *szMpqName == 0 || phMpq == NULL) + { + SetLastError(ERROR_INVALID_PARAMETER); + return false; + } + + // One time initialization of MPQ cryptography + InitializeMpqCryptography(); + + // We verify if the file already exists and if it's a MPQ archive. + // If yes, we won't allow to overwrite it. + if(SFileOpenArchive(szMpqName, 0, dwFlags, &hMpq)) + { + SFileCloseArchive(hMpq); + SetLastError(ERROR_ALREADY_EXISTS); + return false; + } + + // + // At this point, we have to create the archive. + // - If the file exists, convert it to MPQ archive. + // - If the file doesn't exist, create new empty file + // + + pStream = FileStream_OpenFile(szMpqName, true); + if(pStream == NULL) + { + pStream = FileStream_CreateFile(szMpqName); + if(pStream == NULL) + return false; + } + + // Decide what format to use + wFormatVersion = (USHORT)((dwFlags & MPQ_CREATE_ARCHIVE_VMASK) >> 16); + if(wFormatVersion > MPQ_FORMAT_VERSION_4) + { + SetLastError(ERROR_INVALID_PARAMETER); + return false; + } + + // Increment the maximum amount of files to have space + // for listfile and attributes file + if(dwFlags & MPQ_CREATE_ATTRIBUTES) + dwMaxFileCount++; + dwMaxFileCount++; + + // If file count is not zero, initialize the hash table size + dwHashTableSize = GetHashTableSizeForFileCount(dwMaxFileCount); + + // Retrieve the file size and round it up to 0x200 bytes + FileStream_GetSize(pStream, MpqPos); + MpqPos = (MpqPos + 0x1FF) & (ULONGLONG)0xFFFFFFFFFFFFFE00ULL; + if(!FileStream_SetSize(pStream, MpqPos)) + nError = GetLastError(); + +#ifdef _DEBUG + // Debug code, used for testing StormLib +// dwBlockTableSize = dwHashTableSize * 2; +#endif + + // Create the archive handle + if(nError == ERROR_SUCCESS) + { + if((ha = STORM_ALLOC(TMPQArchive, 1)) == NULL) + nError = ERROR_NOT_ENOUGH_MEMORY; + } + + // Fill the MPQ archive handle structure + if(nError == ERROR_SUCCESS) + { + memset(ha, 0, sizeof(TMPQArchive)); + ha->pStream = pStream; + ha->dwSectorSize = (wFormatVersion >= MPQ_FORMAT_VERSION_3) ? 0x4000 : 0x1000; + ha->UserDataPos = MpqPos; + ha->MpqPos = MpqPos; + ha->pHeader = (TMPQHeader *)ha->HeaderData; + ha->dwMaxFileCount = dwMaxFileCount; + ha->dwFileTableSize = 0; + ha->dwFileFlags1 = MPQ_FILE_ENCRYPTED | MPQ_FILE_COMPRESS | MPQ_FILE_REPLACEEXISTING; + ha->dwFileFlags2 = MPQ_FILE_ENCRYPTED | MPQ_FILE_COMPRESS | MPQ_FILE_REPLACEEXISTING; + ha->dwFlags = 0; + + // Setup the attributes + if(dwFlags & MPQ_CREATE_ATTRIBUTES) + ha->dwAttrFlags = MPQ_ATTRIBUTE_CRC32 | MPQ_ATTRIBUTE_FILETIME | MPQ_ATTRIBUTE_MD5; + pStream = NULL; + } + + // Fill the MPQ header + if(nError == ERROR_SUCCESS) + { + TMPQHeader * pHeader = ha->pHeader; + + // Fill the MPQ header + memset(pHeader, 0, sizeof(ha->HeaderData)); + pHeader->dwID = ID_MPQ; + pHeader->dwHeaderSize = MpqHeaderSizes[wFormatVersion]; + pHeader->dwArchiveSize = pHeader->dwHeaderSize + dwHashTableSize * sizeof(TMPQHash); + pHeader->wFormatVersion = wFormatVersion; + pHeader->wSectorSize = GetSectorSizeShift(ha->dwSectorSize); + pHeader->dwHashTablePos = pHeader->dwHeaderSize; + pHeader->dwHashTableSize = dwHashTableSize; + pHeader->dwBlockTablePos = pHeader->dwHashTablePos + dwHashTableSize * sizeof(TMPQHash); + pHeader->dwBlockTableSize = dwBlockTableSize; + + // For MPQs version 4 and higher, we set the size of raw data block + // for calculating MD5 + if(wFormatVersion >= MPQ_FORMAT_VERSION_4) + pHeader->dwRawChunkSize = 0x4000; + + // Write the naked MPQ header + nError = WriteNakedMPQHeader(ha); + + // Remember that the (listfile) and (attributes) need to be saved + ha->dwFlags |= MPQ_FLAG_CHANGED | MPQ_FLAG_INV_LISTFILE | MPQ_FLAG_INV_ATTRIBUTES; + } + + // Create initial HET table, if the caller required an MPQ format 3.0 or newer + if(nError == ERROR_SUCCESS && wFormatVersion >= MPQ_FORMAT_VERSION_3) + { + ha->pHetTable = CreateHetTable(ha->dwMaxFileCount, 0x40, true); + if(ha->pHetTable == NULL) + nError = ERROR_NOT_ENOUGH_MEMORY; + } + + // Create initial hash table + if(nError == ERROR_SUCCESS) + { + nError = CreateHashTable(ha, dwHashTableSize); + } + + // Create initial file table + if(nError == ERROR_SUCCESS) + { + ha->pFileTable = STORM_ALLOC(TFileEntry, ha->dwMaxFileCount); + if(ha->pFileTable != NULL) + memset(ha->pFileTable, 0x00, sizeof(TFileEntry) * ha->dwMaxFileCount); + else + nError = ERROR_NOT_ENOUGH_MEMORY; + } + + // Cleanup : If an error, delete all buffers and return + if(nError != ERROR_SUCCESS) + { + FileStream_Close(pStream); + FreeMPQArchive(ha); + SetLastError(nError); + ha = NULL; + } + + // Return the values + *phMpq = (HANDLE)ha; + return (nError == ERROR_SUCCESS); +} diff --git a/dep/StormLib/src/SFileExtractFile.cpp b/dep/StormLib/src/SFileExtractFile.cpp new file mode 100644 index 00000000000..f46ef178fbc --- /dev/null +++ b/dep/StormLib/src/SFileExtractFile.cpp @@ -0,0 +1,67 @@ +/*****************************************************************************/ +/* SFileExtractFile.cpp Copyright (c) Ladislav Zezula 2003 */ +/*---------------------------------------------------------------------------*/ +/* Simple extracting utility */ +/*---------------------------------------------------------------------------*/ +/* Date Ver Who Comment */ +/* -------- ---- --- ------- */ +/* 20.06.03 1.00 Lad The first version of SFileExtractFile.cpp */ +/*****************************************************************************/ + +#define __STORMLIB_SELF__ +#include "StormLib.h" +#include "StormCommon.h" + +bool WINAPI SFileExtractFile(HANDLE hMpq, const char * szToExtract, const TCHAR * szExtracted, DWORD dwSearchScope) +{ + TFileStream * pLocalFile = NULL; + HANDLE hMpqFile = NULL; + int nError = ERROR_SUCCESS; + + // Open the MPQ file + if(nError == ERROR_SUCCESS) + { + if(!SFileOpenFileEx(hMpq, szToExtract, dwSearchScope, &hMpqFile)) + nError = GetLastError(); + } + + // Create the local file + if(nError == ERROR_SUCCESS) + { + pLocalFile = FileStream_CreateFile(szExtracted); + if(pLocalFile == NULL) + nError = GetLastError(); + } + + // Copy the file's content + if(nError == ERROR_SUCCESS) + { + char szBuffer[0x1000]; + DWORD dwTransferred; + + for(;;) + { + // dwTransferred is only set to nonzero if something has been read. + // nError can be ERROR_SUCCESS or ERROR_HANDLE_EOF + if(!SFileReadFile(hMpqFile, szBuffer, sizeof(szBuffer), &dwTransferred, NULL)) + nError = GetLastError(); + if(nError == ERROR_HANDLE_EOF) + nError = ERROR_SUCCESS; + if(dwTransferred == 0) + break; + + // If something has been actually read, write it + if(!FileStream_Write(pLocalFile, NULL, szBuffer, dwTransferred)) + nError = GetLastError(); + } + } + + // Close the files + if(hMpqFile != NULL) + SFileCloseFile(hMpqFile); + if(pLocalFile != NULL) + FileStream_Close(pLocalFile); + if(nError != ERROR_SUCCESS) + SetLastError(nError); + return (nError == ERROR_SUCCESS); +} diff --git a/dep/StormLib/src/SFileFindFile.cpp b/dep/StormLib/src/SFileFindFile.cpp new file mode 100644 index 00000000000..aa065d23a84 --- /dev/null +++ b/dep/StormLib/src/SFileFindFile.cpp @@ -0,0 +1,446 @@ +/*****************************************************************************/ +/* SFileFindFile.cpp Copyright (c) Ladislav Zezula 2003 */ +/*---------------------------------------------------------------------------*/ +/* A module for file searching within MPQs */ +/*---------------------------------------------------------------------------*/ +/* Date Ver Who Comment */ +/* -------- ---- --- ------- */ +/* 25.03.03 1.00 Lad The first version of SFileFindFile.cpp */ +/*****************************************************************************/ + +#define __STORMLIB_SELF__ +#include "StormLib.h" +#include "StormCommon.h" + +//----------------------------------------------------------------------------- +// Defines + +#define LISTFILE_CACHE_SIZE 0x1000 + +//----------------------------------------------------------------------------- +// Private structure used for file search (search handle) + +struct TMPQSearch; +typedef int (*MPQSEARCH)(TMPQSearch *, SFILE_FIND_DATA *); + +// Used by searching in MPQ archives +struct TMPQSearch +{ + TMPQArchive * ha; // Handle to MPQ, where the search runs + TFileEntry ** pSearchTable; // Table for files that have been already found + DWORD dwSearchTableItems; // Number of items in the search table + DWORD dwNextIndex; // Next file index to be checked + DWORD dwFlagMask; // For checking flag mask + char szSearchMask[1]; // Search mask (variable length) +}; + +//----------------------------------------------------------------------------- +// Local functions + +static bool IsValidSearchHandle(TMPQSearch * hs) +{ + if(hs == NULL) + return false; + + return IsValidMpqHandle(hs->ha); +} + +bool CheckWildCard(const char * szString, const char * szWildCard) +{ + const char * szSubString; + int nSubStringLength; + int nMatchCount = 0; + + // When the mask is empty, it never matches + if(szWildCard == NULL || *szWildCard == 0) + return false; + + // If the wildcard contains just "*", then it always matches + if(szWildCard[0] == '*' && szWildCard[1] == 0) + return true; + + // Do normal test + for(;;) + { + // If there is '?' in the wildcard, we skip one char + while(*szWildCard == '?') + { + szWildCard++; + szString++; + } + + // If there is '*', means zero or more chars. We have to + // find the sequence after '*' + if(*szWildCard == '*') + { + // More stars is equal to one star + while(*szWildCard == '*' || *szWildCard == '?') + szWildCard++; + + // If we found end of the wildcard, it's a match + if(*szWildCard == 0) + return true; + + // Determine the length of the substring in szWildCard + szSubString = szWildCard; + while(*szSubString != 0 && *szSubString != '?' && *szSubString != '*') + szSubString++; + nSubStringLength = (int)(szSubString - szWildCard); + nMatchCount = 0; + + // Now we have to find a substring in szString, + // that matches the substring in szWildCard + while(*szString != 0) + { + // Calculate match count + while(nMatchCount < nSubStringLength) + { + if(toupper(szString[nMatchCount]) != toupper(szWildCard[nMatchCount])) + break; + if(szString[nMatchCount] == 0) + break; + nMatchCount++; + } + + // If the match count has reached substring length, we found a match + if(nMatchCount == nSubStringLength) + { + szWildCard += nMatchCount; + szString += nMatchCount; + break; + } + + // No match, move to the next char in szString + nMatchCount = 0; + szString++; + } + } + else + { + // If we came to the end of the string, compare it to the wildcard + if(toupper(*szString) != toupper(*szWildCard)) + return false; + + // If we arrived to the end of the string, it's a match + if(*szString == 0) + return true; + + // Otherwise, continue in comparing + szWildCard++; + szString++; + } + } +} + +static DWORD GetSearchTableItems(TMPQArchive * ha) +{ + DWORD dwMergeItems = 0; + + // Loop over all patches + while(ha != NULL) + { + // Append the number of files + dwMergeItems += (ha->pHetTable != NULL) ? ha->pHetTable->dwMaxFileCount + : ha->pHeader->dwBlockTableSize; + // Move to the patched archive + ha = ha->haPatch; + } + + // Return the double size of number of items + return (dwMergeItems | 1); +} + +static bool FileWasFoundBefore( + TMPQArchive * ha, + TMPQSearch * hs, + TFileEntry * pFileEntry) +{ + TFileEntry * pEntry; + char * szRealFileName = pFileEntry->szFileName; + DWORD dwStartIndex; + DWORD dwNameHash; + DWORD dwIndex; + + if(hs->pSearchTable != NULL && szRealFileName != NULL) + { + // If we are in patch MPQ, we check if patch prefix matches + // and then trim the patch prefix + if(ha->cchPatchPrefix != 0) + { + // If the patch prefix doesn't fit, we pretend that the file + // was there before and it will be skipped + if(_strnicmp(szRealFileName, ha->szPatchPrefix, ha->cchPatchPrefix)) + return true; + + szRealFileName += ha->cchPatchPrefix; + } + + // Calculate the hash to the table + dwNameHash = HashString(szRealFileName, MPQ_HASH_NAME_A); + dwStartIndex = dwIndex = (dwNameHash % hs->dwSearchTableItems); + + // The file might have been found before + // only if this is not the first MPQ being searched + if(ha->haBase != NULL) + { + // Enumerate all entries in the search table + for(;;) + { + // Get the file entry at that position + pEntry = hs->pSearchTable[dwIndex]; + if(pEntry == NULL) + break; + + if(pEntry->szFileName != NULL) + { + // Does the name match? + if(!_stricmp(pEntry->szFileName, szRealFileName)) + return true; + } + + // Move to the next entry + dwIndex = (dwIndex + 1) % hs->dwSearchTableItems; + if(dwIndex == dwStartIndex) + break; + } + } + + // Put the entry to the table for later use + hs->pSearchTable[dwIndex] = pFileEntry; + } + return false; +} + +static TFileEntry * FindPatchEntry(TMPQArchive * ha, TFileEntry * pFileEntry) +{ + TFileEntry * pPatchEntry = NULL; + TFileEntry * pTempEntry; + char szFileName[MAX_PATH]; + LCID lcLocale = pFileEntry->lcLocale; + + // Go while there are patches + while(ha->haPatch != NULL) + { + // Move to the patch archive + ha = ha->haPatch; + + // Prepare the prefix for the file name + strcpy(szFileName, ha->szPatchPrefix); + strcat(szFileName, pFileEntry->szFileName); + + // Try to find the file there + pTempEntry = GetFileEntryExact(ha, szFileName, lcLocale); + if(pTempEntry != NULL) + pPatchEntry = pTempEntry; + } + + // Return the found patch entry + return pPatchEntry; +} + +// Performs one MPQ search +static int DoMPQSearch(TMPQSearch * hs, SFILE_FIND_DATA * lpFindFileData) +{ + TMPQArchive * ha = hs->ha; + TFileEntry * pFileTableEnd; + TFileEntry * pPatchEntry; + TFileEntry * pFileEntry; + const char * szFileName; + HANDLE hFile; + char szPseudoName[20]; + DWORD dwBlockIndex; + size_t nPrefixLength; + + // Start searching with base MPQ + while(ha != NULL) + { + // Now parse the file entry table in order to get all files. + pFileTableEnd = ha->pFileTable + ha->dwFileTableSize; + pFileEntry = ha->pFileTable + hs->dwNextIndex; + + // Get the length of the patch prefix (0 if none) + nPrefixLength = strlen(ha->szPatchPrefix); + + // Parse the file table + while(pFileEntry < pFileTableEnd) + { + // Increment the next index for subsequent search + hs->dwNextIndex++; + + // Is it a file and not a patch file? + if((pFileEntry->dwFlags & hs->dwFlagMask) == MPQ_FILE_EXISTS) + { + // Now we have to check if this file was not enumerated before + if(!FileWasFoundBefore(ha, hs, pFileEntry)) + { + // Find a patch to this file + pPatchEntry = FindPatchEntry(ha, pFileEntry); + if(pPatchEntry == NULL) + pPatchEntry = pFileEntry; + + // Prepare the block index + dwBlockIndex = (DWORD)(pFileEntry - ha->pFileTable); + + // Get the file name. If it's not known, we will create pseudo-name + szFileName = pFileEntry->szFileName; + if(szFileName == NULL) + { + // Open the file by its pseudo-name. + // This also generates the file name with a proper extension + sprintf(szPseudoName, "File%08u.xxx", dwBlockIndex); + if(SFileOpenFileEx((HANDLE)hs->ha, szPseudoName, SFILE_OPEN_FROM_MPQ, &hFile)) + { + szFileName = (pFileEntry->szFileName != NULL) ? pFileEntry->szFileName : szPseudoName; + SFileCloseFile(hFile); + } + } + + // Check the file name against the wildcard + if(CheckWildCard(szFileName + nPrefixLength, hs->szSearchMask)) + { + // Fill the found entry + lpFindFileData->dwHashIndex = pPatchEntry->dwHashIndex; + lpFindFileData->dwBlockIndex = dwBlockIndex; + lpFindFileData->dwFileSize = pPatchEntry->dwFileSize; + lpFindFileData->dwFileFlags = pPatchEntry->dwFlags; + lpFindFileData->dwCompSize = pPatchEntry->dwCmpSize; + lpFindFileData->lcLocale = pPatchEntry->lcLocale; + + // Fill the filetime + lpFindFileData->dwFileTimeHi = (DWORD)(pPatchEntry->FileTime >> 32); + lpFindFileData->dwFileTimeLo = (DWORD)(pPatchEntry->FileTime); + + // Fill the file name and plain file name + strcpy(lpFindFileData->cFileName, szFileName + nPrefixLength); + lpFindFileData->szPlainName = (char *)GetPlainFileNameA(lpFindFileData->cFileName); + return ERROR_SUCCESS; + } + + } + } + + pFileEntry++; + } + + // Move to the next patch in the patch chain + hs->ha = ha = ha->haPatch; + hs->dwNextIndex = 0; + } + + // No more files found, return error + return ERROR_NO_MORE_FILES; +} + +static void FreeMPQSearch(TMPQSearch *& hs) +{ + if(hs != NULL) + { + if(hs->pSearchTable != NULL) + STORM_FREE(hs->pSearchTable); + STORM_FREE(hs); + hs = NULL; + } +} + +//----------------------------------------------------------------------------- +// Public functions + +HANDLE WINAPI SFileFindFirstFile(HANDLE hMpq, const char * szMask, SFILE_FIND_DATA * lpFindFileData, const char * szListFile) +{ + TMPQArchive * ha = (TMPQArchive *)hMpq; + TMPQSearch * hs = NULL; + size_t nSize = 0; + int nError = ERROR_SUCCESS; + + // Check for the valid parameters + if(!IsValidMpqHandle(ha)) + nError = ERROR_INVALID_HANDLE; + if(szMask == NULL || lpFindFileData == NULL) + nError = ERROR_INVALID_PARAMETER; + + // Include the listfile into the MPQ's internal listfile + // Note that if the listfile name is NULL, do nothing because the + // internal listfile is always included. + if(nError == ERROR_SUCCESS && szListFile != NULL && *szListFile != 0) + nError = SFileAddListFile((HANDLE)ha, szListFile); + + // Allocate the structure for MPQ search + if(nError == ERROR_SUCCESS) + { + nSize = sizeof(TMPQSearch) + strlen(szMask) + 1; + if((hs = (TMPQSearch *)STORM_ALLOC(char, nSize)) == NULL) + nError = ERROR_NOT_ENOUGH_MEMORY; + } + + // Perform the first search + if(nError == ERROR_SUCCESS) + { + memset(hs, 0, sizeof(TMPQSearch)); + strcpy(hs->szSearchMask, szMask); + hs->dwFlagMask = MPQ_FILE_EXISTS; + hs->ha = ha; + + // If the archive is patched archive, we have to create a merge table + // to prevent files being repeated + if(ha->haPatch != NULL) + { + hs->dwSearchTableItems = GetSearchTableItems(ha); + hs->pSearchTable = STORM_ALLOC(TFileEntry *, hs->dwSearchTableItems); + hs->dwFlagMask = MPQ_FILE_EXISTS | MPQ_FILE_PATCH_FILE; + if(hs->pSearchTable != NULL) + memset(hs->pSearchTable, 0, hs->dwSearchTableItems * sizeof(TFileEntry *)); + else + nError = ERROR_NOT_ENOUGH_MEMORY; + } + } + + // Perform first item searching + if(nError == ERROR_SUCCESS) + { + nError = DoMPQSearch(hs, lpFindFileData); + } + + // Cleanup + if(nError != ERROR_SUCCESS) + { + FreeMPQSearch(hs); + SetLastError(nError); + } + + // Return the result value + return (HANDLE)hs; +} + +bool WINAPI SFileFindNextFile(HANDLE hFind, SFILE_FIND_DATA * lpFindFileData) +{ + TMPQSearch * hs = (TMPQSearch *)hFind; + int nError = ERROR_SUCCESS; + + // Check the parameters + if(!IsValidSearchHandle(hs)) + nError = ERROR_INVALID_HANDLE; + if(lpFindFileData == NULL) + nError = ERROR_INVALID_PARAMETER; + + if(nError == ERROR_SUCCESS) + nError = DoMPQSearch(hs, lpFindFileData); + + if(nError != ERROR_SUCCESS) + SetLastError(nError); + return (nError == ERROR_SUCCESS); +} + +bool WINAPI SFileFindClose(HANDLE hFind) +{ + TMPQSearch * hs = (TMPQSearch *)hFind; + + // Check the parameters + if(!IsValidSearchHandle(hs)) + { + SetLastError(ERROR_INVALID_HANDLE); + return false; + } + + FreeMPQSearch(hs); + return true; +} diff --git a/dep/StormLib/src/SFileListFile.cpp b/dep/StormLib/src/SFileListFile.cpp new file mode 100644 index 00000000000..9f476d1e4a4 --- /dev/null +++ b/dep/StormLib/src/SFileListFile.cpp @@ -0,0 +1,554 @@ +/*****************************************************************************/ +/* SListFile.cpp Copyright (c) Ladislav Zezula 2004 */ +/*---------------------------------------------------------------------------*/ +/* Description: */ +/*---------------------------------------------------------------------------*/ +/* Date Ver Who Comment */ +/* -------- ---- --- ------- */ +/* 12.06.04 1.00 Lad The first version of SListFile.cpp */ +/*****************************************************************************/ + +#define __STORMLIB_SELF__ +#include "StormLib.h" +#include "StormCommon.h" +#include + +//----------------------------------------------------------------------------- +// Listfile entry structure + +#define CACHE_BUFFER_SIZE 0x1000 // Size of the cache buffer + +struct TListFileCache +{ + HANDLE hFile; // Stormlib file handle + char * szMask; // File mask + DWORD dwFileSize; // Total size of the cached file + DWORD dwFilePos; // Position of the cache in the file + BYTE * pBegin; // The begin of the listfile cache + BYTE * pPos; + BYTE * pEnd; // The last character in the file cache + + BYTE Buffer[CACHE_BUFFER_SIZE]; // Listfile cache itself +}; + +//----------------------------------------------------------------------------- +// Local functions (cache) + +static TListFileCache * CreateListFileCache(HANDLE hMpq, const char * szListFile) +{ + TListFileCache * pCache = NULL; + HANDLE hListFile = NULL; + DWORD dwSearchScope = SFILE_OPEN_LOCAL_FILE; + DWORD dwBytesRead = 0; + int nError = ERROR_SUCCESS; + + // If the szListFile is NULL, it means we have to open internal listfile + if(szListFile == NULL) + { + // Use SFILE_OPEN_ANY_LOCALE for listfile. This will allow us to load + // the listfile even if there is only non-neutral version of the listfile in the MPQ + dwSearchScope = SFILE_OPEN_ANY_LOCALE; + szListFile = LISTFILE_NAME; + } + + // Open the local/internal listfile + if(SFileOpenFileEx(hMpq, szListFile, dwSearchScope, &hListFile)) + { + TMPQArchive * ha = (TMPQArchive *)hMpq; + TMPQFile * hf = (TMPQFile *)hListFile; + + // Remember flags for (listfile) + if(hf->pFileEntry != NULL) + ha->dwFileFlags1 = hf->pFileEntry->dwFlags; + } + else + nError = GetLastError(); + + // Allocate cache for one file block + if(nError == ERROR_SUCCESS) + { + pCache = (TListFileCache *)STORM_ALLOC(TListFileCache, 1); + if(pCache == NULL) + nError = ERROR_NOT_ENOUGH_MEMORY; + } + + if(nError == ERROR_SUCCESS) + { + // Initialize the file cache + memset(pCache, 0, sizeof(TListFileCache)); + pCache->dwFileSize = SFileGetFileSize(hListFile, NULL); + pCache->hFile = hListFile; + + // Fill the cache + SFileReadFile(hListFile, pCache->Buffer, CACHE_BUFFER_SIZE, &dwBytesRead, NULL); + if(dwBytesRead == 0) + nError = GetLastError(); + } + + // Initialize the pointers + if(nError == ERROR_SUCCESS) + { + pCache->pBegin = + pCache->pPos = &pCache->Buffer[0]; + pCache->pEnd = pCache->pBegin + dwBytesRead; + } + else + { + SListFileFindClose((HANDLE)pCache); + SetLastError(nError); + pCache = NULL; + } + + // Return the cache + return pCache; +} + +// Reloads the cache. Returns number of characters +// that has been loaded into the cache. +static DWORD ReloadListFileCache(TListFileCache * pCache) +{ + DWORD dwBytesToRead; + DWORD dwBytesRead = 0; + + // Only do something if the cache is empty + if(pCache->pPos >= pCache->pEnd) + { +// __TryReadBlock: + + // Move the file position forward + pCache->dwFilePos += CACHE_BUFFER_SIZE; + if(pCache->dwFilePos >= pCache->dwFileSize) + return 0; + + // Get the number of bytes remaining + dwBytesToRead = pCache->dwFileSize - pCache->dwFilePos; + if(dwBytesToRead > CACHE_BUFFER_SIZE) + dwBytesToRead = CACHE_BUFFER_SIZE; + + // Load the next data chunk to the cache + SFileSetFilePointer(pCache->hFile, pCache->dwFilePos, NULL, FILE_BEGIN); + SFileReadFile(pCache->hFile, pCache->Buffer, CACHE_BUFFER_SIZE, &dwBytesRead, NULL); + + // If we didn't read anything, it might mean that the block + // of the file is not available (in case of partial MPQs). + // We stop reading the file at this point, because the rest + // of the listfile is unreliable + if(dwBytesRead == 0) + return 0; + + // Set the buffer pointers + pCache->pBegin = + pCache->pPos = &pCache->Buffer[0]; + pCache->pEnd = pCache->pBegin + dwBytesRead; + } + + return dwBytesRead; +} + +static size_t ReadListFileLine(TListFileCache * pCache, char * szLine, int nMaxChars) +{ + char * szLineBegin = szLine; + char * szLineEnd = szLine + nMaxChars - 1; + char * szExtraString = NULL; + + // Skip newlines, spaces, tabs and another non-printable stuff + for(;;) + { + // If we need to reload the cache, do it + if(pCache->pPos == pCache->pEnd) + { + if(ReloadListFileCache(pCache) == 0) + break; + } + + // If we found a non-whitespace character, stop + if(*pCache->pPos > 0x20) + break; + + // Skip the character + pCache->pPos++; + } + + // Copy the remaining characters + while(szLine < szLineEnd) + { + // If we need to reload the cache, do it now and resume copying + if(pCache->pPos == pCache->pEnd) + { + if(ReloadListFileCache(pCache) == 0) + break; + } + + // If we have found a newline, stop loading + if(*pCache->pPos == 0x0D || *pCache->pPos == 0x0A) + break; + + // Blizzard listfiles can also contain information about patch: + // Pass1\Files\MacOS\unconditional\user\Background Downloader.app\Contents\Info.plist~Patch(Data#frFR#base-frFR,1326) + if(*pCache->pPos == '~') + szExtraString = szLine; + + // Copy the character + *szLine++ = *pCache->pPos++; + } + + // Terminate line with zero + *szLine = 0; + + // If there was extra string after the file name, clear it + if(szExtraString != NULL) + { + if(szExtraString[0] == '~' && szExtraString[1] == 'P') + { + szLine = szExtraString; + *szExtraString = 0; + } + } + + // Return the length of the line + return (szLine - szLineBegin); +} + +static int CompareFileNodes(const void * p1, const void * p2) +{ + char * szFileName1 = *(char **)p1; + char * szFileName2 = *(char **)p2; + + return _stricmp(szFileName1, szFileName2); +} + +static int WriteListFileLine( + TMPQFile * hf, + const char * szLine) +{ + char szNewLine[2] = {0x0D, 0x0A}; + size_t nLength = strlen(szLine); + int nError; + + nError = SFileAddFile_Write(hf, szLine, (DWORD)nLength, MPQ_COMPRESSION_ZLIB); + if(nError != ERROR_SUCCESS) + return nError; + + return SFileAddFile_Write(hf, szNewLine, sizeof(szNewLine), MPQ_COMPRESSION_ZLIB); +} + +//----------------------------------------------------------------------------- +// Local functions (listfile nodes) + +// Adds a name into the list of all names. For each locale in the MPQ, +// one entry will be created +// If the file name is already there, does nothing. +int SListFileCreateNodeForAllLocales(TMPQArchive * ha, const char * szFileName) +{ + TMPQHeader * pHeader = ha->pHeader; + TFileEntry * pFileEntry; + TMPQHash * pFirstHash; + TMPQHash * pHash; + bool bNameEntryCreated = false; + + // If we have HET table, use that one + if(ha->pHetTable != NULL) + { + pFileEntry = GetFileEntryAny(ha, szFileName); + if(pFileEntry != NULL) + { + // Allocate file name for the file entry + AllocateFileName(pFileEntry, szFileName); + bNameEntryCreated = true; + } + + return ERROR_SUCCESS; + } + + // If we have hash table, we use it + if(bNameEntryCreated == false && ha->pHashTable != NULL) + { + // Look for the first hash table entry for the file + pFirstHash = pHash = GetFirstHashEntry(ha, szFileName); + + // Go while we found something + while(pHash != NULL) + { + // Is it a valid file table index ? + if(pHash->dwBlockIndex < pHeader->dwBlockTableSize) + { + // Allocate file name for the file entry + AllocateFileName(ha->pFileTable + pHash->dwBlockIndex, szFileName); + bNameEntryCreated = true; + } + + // Now find the next language version of the file + pHash = GetNextHashEntry(ha, pFirstHash, pHash); + } + } + + return ERROR_CAN_NOT_COMPLETE; +} + +// Saves the whole listfile into the MPQ. +int SListFileSaveToMpq(TMPQArchive * ha) +{ + TFileEntry * pFileTableEnd = ha->pFileTable + ha->dwFileTableSize; + TFileEntry * pFileEntry; + TMPQFile * hf = NULL; + char * szPrevItem; + char ** SortTable = NULL; + DWORD dwFileSize = 0; + size_t nFileNodes = 0; + size_t i; + int nError = ERROR_SUCCESS; + + // Allocate the table for sorting listfile + SortTable = STORM_ALLOC(char*, ha->dwFileTableSize); + if(SortTable == NULL) + return ERROR_NOT_ENOUGH_MEMORY; + + // Construct the sort table + // Note: in MPQs with multiple locale versions of the same file, + // this code causes adding multiple listfile entries. + // Since those MPQs were last time used in Starcraft, + // we leave it as it is. + for(pFileEntry = ha->pFileTable; pFileEntry < pFileTableEnd; pFileEntry++) + { + // Only take existing items + if((pFileEntry->dwFlags & MPQ_FILE_EXISTS) && pFileEntry->szFileName != NULL) + { + // Ignore pseudo-names + if(!IsPseudoFileName(pFileEntry->szFileName, NULL) && !IsInternalMpqFileName(pFileEntry->szFileName)) + { + SortTable[nFileNodes++] = pFileEntry->szFileName; + } + } + } + + // Sort the table + qsort(SortTable, nFileNodes, sizeof(char *), CompareFileNodes); + + // Now parse the table of file names again - remove duplicates + // and count file size. + if(nFileNodes != 0) + { + // Count the 0-th item + dwFileSize += (DWORD)strlen(SortTable[0]) + 2; + szPrevItem = SortTable[0]; + + // Count all next items + for(i = 1; i < nFileNodes; i++) + { + // If the item is the same like the last one, skip it + if(_stricmp(SortTable[i], szPrevItem)) + { + dwFileSize += (DWORD)strlen(SortTable[i]) + 2; + szPrevItem = SortTable[i]; + } + } + + // Create the listfile in the MPQ + assert(ha->dwFileFlags1 != 0); + nError = SFileAddFile_Init(ha, LISTFILE_NAME, + 0, + dwFileSize, + LANG_NEUTRAL, + ha->dwFileFlags1, + &hf); + // Add all file names + if(nError == ERROR_SUCCESS) + { + // Each name is followed by newline ("\x0D\x0A") + szPrevItem = SortTable[0]; + nError = WriteListFileLine(hf, SortTable[0]); + + // Count all next items + for(i = 1; i < nFileNodes; i++) + { + // If the item is the same like the last one, skip it + if(_stricmp(SortTable[i], szPrevItem)) + { + WriteListFileLine(hf, SortTable[i]); + szPrevItem = SortTable[i]; + } + } + } + } + else + { + // Create the listfile in the MPQ + dwFileSize = (DWORD)strlen(LISTFILE_NAME) + 2; + nError = SFileAddFile_Init(ha, LISTFILE_NAME, + 0, + dwFileSize, + LANG_NEUTRAL, + MPQ_FILE_ENCRYPTED | MPQ_FILE_COMPRESS | MPQ_FILE_REPLACEEXISTING, + &hf); + + // Just add "(listfile)" there + if(nError == ERROR_SUCCESS) + { + WriteListFileLine(hf, LISTFILE_NAME); + } + } + + // Finalize the file in the MPQ + if(hf != NULL) + { + SFileAddFile_Finish(hf); + } + + // Free buffers + if(nError == ERROR_SUCCESS) + ha->dwFlags &= ~MPQ_FLAG_INV_LISTFILE; + if(SortTable != NULL) + STORM_FREE(SortTable); + return nError; +} + +//----------------------------------------------------------------------------- +// File functions + +// Adds a listfile into the MPQ archive. +// Note that the function does not remove the +int WINAPI SFileAddListFile(HANDLE hMpq, const char * szListFile) +{ + TListFileCache * pCache = NULL; + TMPQArchive * ha = (TMPQArchive *)hMpq; + char szFileName[MAX_PATH]; + size_t nLength = 0; + int nError = ERROR_SUCCESS; + + // Add the listfile for each MPQ in the patch chain + while(ha != NULL) + { + // Load the listfile to cache + pCache = CreateListFileCache(hMpq, szListFile); + if(pCache == NULL) + { + nError = GetLastError(); + break; + } + + // Load the node list. Add the node for every locale in the archive + while((nLength = ReadListFileLine(pCache, szFileName, sizeof(szFileName))) > 0) + SListFileCreateNodeForAllLocales(ha, szFileName); + + // Also, add three special files to the listfile: + // (listfile) itself, (attributes) and (signature) + SListFileCreateNodeForAllLocales(ha, LISTFILE_NAME); + SListFileCreateNodeForAllLocales(ha, SIGNATURE_NAME); + SListFileCreateNodeForAllLocales(ha, ATTRIBUTES_NAME); + + // Delete the cache + SListFileFindClose((HANDLE)pCache); + + // Move to the next archive in the chain + ha = ha->haPatch; + } + + return nError; +} + +//----------------------------------------------------------------------------- +// Passing through the listfile + +HANDLE WINAPI SListFileFindFirstFile(HANDLE hMpq, const char * szListFile, const char * szMask, SFILE_FIND_DATA * lpFindFileData) +{ + TListFileCache * pCache = NULL; + size_t nLength = 0; + int nError = ERROR_SUCCESS; + + // Initialize the structure with zeros + memset(lpFindFileData, 0, sizeof(SFILE_FIND_DATA)); + + // Load the listfile to cache + pCache = CreateListFileCache(hMpq, szListFile); + if(pCache == NULL) + nError = GetLastError(); + + // Allocate file mask + if(nError == ERROR_SUCCESS && szMask != NULL) + { + pCache->szMask = STORM_ALLOC(char, strlen(szMask) + 1); + if(pCache->szMask != NULL) + strcpy(pCache->szMask, szMask); + else + nError = ERROR_NOT_ENOUGH_MEMORY; + } + + // Perform file search + if(nError == ERROR_SUCCESS) + { + for(;;) + { + // Read the (next) line + nLength = ReadListFileLine(pCache, lpFindFileData->cFileName, sizeof(lpFindFileData->cFileName)); + if(nLength == 0) + { + nError = ERROR_NO_MORE_FILES; + break; + } + + // If some mask entered, check it + if(CheckWildCard(lpFindFileData->cFileName, pCache->szMask)) + break; + } + } + + // Cleanup & exit + if(nError != ERROR_SUCCESS) + { + memset(lpFindFileData, 0, sizeof(SFILE_FIND_DATA)); + SListFileFindClose((HANDLE)pCache); + pCache = NULL; + + SetLastError(nError); + } + return (HANDLE)pCache; +} + +bool WINAPI SListFileFindNextFile(HANDLE hFind, SFILE_FIND_DATA * lpFindFileData) +{ + TListFileCache * pCache = (TListFileCache *)hFind; + size_t nLength; + bool bResult = false; + int nError = ERROR_SUCCESS; + + for(;;) + { + // Read the (next) line + nLength = ReadListFileLine(pCache, lpFindFileData->cFileName, sizeof(lpFindFileData->cFileName)); + if(nLength == 0) + { + nError = ERROR_NO_MORE_FILES; + break; + } + + // If some mask entered, check it + if(CheckWildCard(lpFindFileData->cFileName, pCache->szMask)) + { + bResult = true; + break; + } + } + + if(nError != ERROR_SUCCESS) + SetLastError(nError); + return bResult; +} + +bool WINAPI SListFileFindClose(HANDLE hFind) +{ + TListFileCache * pCache = (TListFileCache *)hFind; + + if(pCache != NULL) + { + if(pCache->hFile != NULL) + SFileCloseFile(pCache->hFile); + if(pCache->szMask != NULL) + STORM_FREE(pCache->szMask); + + STORM_FREE(pCache); + return true; + } + + return false; +} + diff --git a/dep/StormLib/src/SFileOpenArchive.cpp b/dep/StormLib/src/SFileOpenArchive.cpp new file mode 100644 index 00000000000..d7b04aba70e --- /dev/null +++ b/dep/StormLib/src/SFileOpenArchive.cpp @@ -0,0 +1,439 @@ +/*****************************************************************************/ +/* SFileOpenArchive.cpp Copyright Ladislav Zezula 1999 */ +/* */ +/* Author : Ladislav Zezula */ +/* E-mail : ladik@zezula.net */ +/* WWW : www.zezula.net */ +/*---------------------------------------------------------------------------*/ +/* Archive functions of Storm.dll */ +/*---------------------------------------------------------------------------*/ +/* Date Ver Who Comment */ +/* -------- ---- --- ------- */ +/* xx.xx.xx 1.00 Lad The first version of SFileOpenArchive.cpp */ +/* 19.11.03 1.01 Dan Big endian handling */ +/*****************************************************************************/ + +#define __STORMLIB_SELF__ +#include "StormLib.h" +#include "StormCommon.h" + +/*****************************************************************************/ +/* Local functions */ +/*****************************************************************************/ + +static bool IsAviFile(void * pvFileBegin) +{ + LPDWORD AviHeader = (DWORD *)pvFileBegin; + DWORD DwordValue0 = BSWAP_INT32_UNSIGNED(AviHeader[0]); + DWORD DwordValue2 = BSWAP_INT32_UNSIGNED(AviHeader[2]); + DWORD DwordValue3 = BSWAP_INT32_UNSIGNED(AviHeader[3]); + + // Test for 'RIFF', 'AVI ' or 'LIST' + return (DwordValue0 == 0x46464952 && DwordValue2 == 0x20495641 && DwordValue3 == 0x5453494C); +} + +// This function gets the right positions of the hash table and the block table. +static int VerifyMpqTablePositions(TMPQArchive * ha, ULONGLONG FileSize) +{ + TMPQHeader * pHeader = ha->pHeader; + ULONGLONG ByteOffset; + + // Check the begin of HET table + if(pHeader->HetTablePos64) + { + ByteOffset = ha->MpqPos + pHeader->HetTablePos64; + if(ByteOffset > FileSize) + return ERROR_BAD_FORMAT; + } + + // Check the begin of BET table + if(pHeader->BetTablePos64) + { + ByteOffset = ha->MpqPos + pHeader->BetTablePos64; + if(ByteOffset > FileSize) + return ERROR_BAD_FORMAT; + } + + // Check the begin of hash table + if(pHeader->wHashTablePosHi || pHeader->dwHashTablePos) + { + ByteOffset = ha->MpqPos + MAKE_OFFSET64(pHeader->wHashTablePosHi, pHeader->dwHashTablePos); + if(ByteOffset > FileSize) + return ERROR_BAD_FORMAT; + } + + // Check the begin of block table + if(pHeader->wBlockTablePosHi || pHeader->dwBlockTablePos) + { + ByteOffset = ha->MpqPos + MAKE_OFFSET64(pHeader->wBlockTablePosHi, pHeader->dwBlockTablePos); + if(ByteOffset > FileSize) + return ERROR_BAD_FORMAT; + } + + // Check the begin of hi-block table + if(pHeader->HiBlockTablePos64 != 0) + { + ByteOffset = ha->MpqPos + pHeader->HiBlockTablePos64; + if(ByteOffset > FileSize) + return ERROR_BAD_FORMAT; + } + + // All OK. + return ERROR_SUCCESS; +} + + +/*****************************************************************************/ +/* Public functions */ +/*****************************************************************************/ + +//----------------------------------------------------------------------------- +// SFileGetLocale and SFileSetLocale +// Set the locale for all newly opened files + +DWORD WINAPI SFileGetGlobalFlags() +{ + return dwGlobalFlags; +} + +DWORD WINAPI SFileSetGlobalFlags(DWORD dwNewFlags) +{ + DWORD dwOldFlags = dwGlobalFlags; + + dwGlobalFlags = dwNewFlags; + return dwOldFlags; +} + +LCID WINAPI SFileGetLocale() +{ + return lcFileLocale; +} + +LCID WINAPI SFileSetLocale(LCID lcNewLocale) +{ + lcFileLocale = lcNewLocale; + return lcFileLocale; +} + +//----------------------------------------------------------------------------- +// SFileOpenArchive +// +// szFileName - MPQ archive file name to open +// dwPriority - When SFileOpenFileEx called, this contains the search priority for searched archives +// dwFlags - See MPQ_OPEN_XXX in StormLib.h +// phMpq - Pointer to store open archive handle + +bool WINAPI SFileOpenArchive( + const TCHAR * szMpqName, + DWORD dwPriority, + DWORD dwFlags, + HANDLE * phMpq) +{ + TFileStream * pStream = NULL; // Open file stream + TMPQArchive * ha = NULL; // Archive handle + ULONGLONG FileSize = 0; // Size of the file + int nError = ERROR_SUCCESS; + + // Verify the parameters + if(szMpqName == NULL || *szMpqName == 0 || phMpq == NULL) + nError = ERROR_INVALID_PARAMETER; + + // One time initialization of MPQ cryptography + InitializeMpqCryptography(); + dwPriority = dwPriority; + + // Open the MPQ archive file + if(nError == ERROR_SUCCESS) + { + if(!(dwFlags & MPQ_OPEN_ENCRYPTED)) + { + pStream = FileStream_OpenFile(szMpqName, (dwFlags & MPQ_OPEN_READ_ONLY) ? false : true); + if(pStream == NULL) + nError = GetLastError(); + } + else + { + pStream = FileStream_OpenEncrypted(szMpqName); + if(pStream == NULL) + nError = GetLastError(); + } + } + + // Allocate the MPQhandle + if(nError == ERROR_SUCCESS) + { + FileStream_GetSize(pStream, FileSize); + if((ha = STORM_ALLOC(TMPQArchive, 1)) == NULL) + nError = ERROR_NOT_ENOUGH_MEMORY; + } + + // Initialize handle structure and allocate structure for MPQ header + if(nError == ERROR_SUCCESS) + { + memset(ha, 0, sizeof(TMPQArchive)); + ha->pStream = pStream; + pStream = NULL; + + // Remember if the archive is open for write + if(ha->pStream->StreamFlags & (STREAM_FLAG_READ_ONLY | STREAM_FLAG_ENCRYPTED_FILE)) + ha->dwFlags |= MPQ_FLAG_READ_ONLY; + + // Also remember if we shall check sector CRCs when reading file + if(dwFlags & MPQ_OPEN_CHECK_SECTOR_CRC) + ha->dwFlags |= MPQ_FLAG_CHECK_SECTOR_CRC; + } + + // Find the offset of MPQ header within the file + if(nError == ERROR_SUCCESS) + { + ULONGLONG SearchPos = 0; + DWORD dwHeaderID; + + while(SearchPos < FileSize) + { + DWORD dwBytesAvailable = MPQ_HEADER_SIZE_V4; + + // Cut the bytes available, if needed + if((FileSize - SearchPos) < MPQ_HEADER_SIZE_V4) + dwBytesAvailable = (DWORD)(FileSize - SearchPos); + + // Read the eventual MPQ header + if(!FileStream_Read(ha->pStream, &SearchPos, ha->HeaderData, dwBytesAvailable)) + { + nError = GetLastError(); + break; + } + + // There are AVI files from Warcraft III with 'MPQ' extension. + if(SearchPos == 0 && IsAviFile(ha->HeaderData)) + { + nError = ERROR_AVI_FILE; + break; + } + + // If there is the MPQ user data signature, process it + dwHeaderID = BSWAP_INT32_UNSIGNED(*(LPDWORD)ha->HeaderData); + if(dwHeaderID == ID_MPQ_USERDATA && ha->pUserData == NULL) + { + // Ignore the MPQ user data completely if the caller wants to open the MPQ as V1.0 + if((dwFlags & MPQ_OPEN_FORCE_MPQ_V1) == 0) + { + // Fill the user data header + ha->pUserData = &ha->UserData; + memcpy(ha->pUserData, ha->HeaderData, sizeof(TMPQUserData)); + BSWAP_TMPQUSERDATA(ha->pUserData); + + // Remember the position of the user data and continue search + ha->UserDataPos = SearchPos; + SearchPos += ha->pUserData->dwHeaderOffs; + continue; + } + } + + // There must be MPQ header signature + if(dwHeaderID == ID_MPQ) + { + // Save the position where the MPQ header has been found + if(ha->pUserData == NULL) + ha->UserDataPos = SearchPos; + ha->pHeader = (TMPQHeader *)ha->HeaderData; + ha->MpqPos = SearchPos; + + // Now convert the header to version 4 + BSWAP_TMPQHEADER(ha->pHeader); + nError = ConvertMpqHeaderToFormat4(ha, FileSize, dwFlags); + break; + } + + // Move to the next possible offset + SearchPos += 0x200; + } + + // If we haven't found MPQ header in the file, it's an error + if(ha->pHeader == NULL) + nError = ERROR_BAD_FORMAT; + } + + // Fix table positions according to format + if(nError == ERROR_SUCCESS) + { + // Dump the header +// DumpMpqHeader(ha->pHeader); + + // W3x Map Protectors use the fact that War3's Storm.dll ignores the MPQ user data, + // and probably ignores the MPQ format version as well. The trick is to + // fake MPQ format 2, with an improper hi-word position of hash table and block table + // We can overcome such protectors by forcing opening the archive as MPQ v 1.0 + if(dwFlags & MPQ_OPEN_FORCE_MPQ_V1) + { + ha->pHeader->wFormatVersion = MPQ_FORMAT_VERSION_1; + ha->pHeader->dwHeaderSize = MPQ_HEADER_SIZE_V1; + ha->dwFlags |= MPQ_FLAG_READ_ONLY; + ha->pUserData = NULL; + } + + // Both MPQ_OPEN_NO_LISTFILE or MPQ_OPEN_NO_ATTRIBUTES trigger read only mode + if(dwFlags & (MPQ_OPEN_NO_LISTFILE | MPQ_OPEN_NO_ATTRIBUTES)) + ha->dwFlags |= MPQ_FLAG_READ_ONLY; + + // Set the default file flags for (listfile) and (attributes) + ha->dwFileFlags1 = + ha->dwFileFlags2 = MPQ_FILE_ENCRYPTED | MPQ_FILE_COMPRESS | MPQ_FILE_REPLACEEXISTING; + + // Set the size of file sector + ha->dwSectorSize = (0x200 << ha->pHeader->wSectorSize); + + // Verify if any of the tables doesn't start beyond the end of the file + nError = VerifyMpqTablePositions(ha, FileSize); + } + + // Read the hash table. Ignore the result, as hash table is no longer required + // Read HET table. Ignore the result, as HET table is no longer required + if(nError == ERROR_SUCCESS) + { + nError = LoadAnyHashTable(ha); + } + + // Now, build the file table. It will be built by combining + // the block table, BET table, hi-block table, (attributes) and (listfile). + if(nError == ERROR_SUCCESS) + { + nError = BuildFileTable(ha, FileSize); + } + + // Verify the file table, if no kind of protection was detected + if(nError == ERROR_SUCCESS && (ha->dwFlags & MPQ_FLAG_PROTECTED) == 0) + { + TFileEntry * pFileTableEnd = ha->pFileTable + ha->pHeader->dwBlockTableSize; + TFileEntry * pFileEntry = ha->pFileTable; +// ULONGLONG ArchiveSize = 0; + ULONGLONG RawFilePos; + + // Parse all file entries + for(pFileEntry = ha->pFileTable; pFileEntry < pFileTableEnd; pFileEntry++) + { + // If that file entry is valid, check the file position + if(pFileEntry->dwFlags & MPQ_FILE_EXISTS) + { + // Get the 64-bit file position, + // relative to the begin of the file + RawFilePos = ha->MpqPos + pFileEntry->ByteOffset; + + // Begin of the file must be within range + if(RawFilePos > FileSize) + { + nError = ERROR_FILE_CORRUPT; + break; + } + + // End of the file must be within range + RawFilePos += pFileEntry->dwCmpSize; + if(RawFilePos > FileSize) + { + nError = ERROR_FILE_CORRUPT; + break; + } + + // Also, we remember end of the file +// if(RawFilePos > ArchiveSize) +// ArchiveSize = RawFilePos; + } + } + } + + // Load the internal listfile and include it to the file table + if(nError == ERROR_SUCCESS && (dwFlags & MPQ_OPEN_NO_LISTFILE) == 0) + { + // Ignore result of the operation. (listfile) is optional. + SFileAddListFile((HANDLE)ha, NULL); + } + + // Load the "(attributes)" file and merge it to the file table + if(nError == ERROR_SUCCESS && (dwFlags & MPQ_OPEN_NO_ATTRIBUTES) == 0) + { + // Ignore result of the operation. (attributes) is optional. + SAttrLoadAttributes(ha); + } + + // Cleanup and exit + if(nError != ERROR_SUCCESS) + { + FileStream_Close(pStream); + FreeMPQArchive(ha); + SetLastError(nError); + ha = NULL; + } + + *phMpq = ha; + return (nError == ERROR_SUCCESS); +} + +//----------------------------------------------------------------------------- +// bool SFileFlushArchive(HANDLE hMpq) +// +// Saves all dirty data into MPQ archive. +// Has similar effect like SFileCloseArchive, but the archive is not closed. +// Use on clients who keep MPQ archive open even for write operations, +// and terminating without calling SFileCloseArchive might corrupt the archive. +// + +bool WINAPI SFileFlushArchive(HANDLE hMpq) +{ + TMPQArchive * ha = (TMPQArchive *)hMpq; + int nResultError = ERROR_SUCCESS; + int nError; + + // Do nothing if 'hMpq' is bad parameter + if(!IsValidMpqHandle(ha)) + { + SetLastError(ERROR_INVALID_HANDLE); + return false; + } + + // If the (listfile) has been invalidated, save it + if(ha->dwFlags & MPQ_FLAG_INV_LISTFILE) + { + nError = SListFileSaveToMpq(ha); + if(nError != ERROR_SUCCESS) + nResultError = nError; + } + + // If the (attributes) has been invalidated, save it + if(ha->dwFlags & MPQ_FLAG_INV_ATTRIBUTES) + { + nError = SAttrFileSaveToMpq(ha); + if(nError != ERROR_SUCCESS) + nResultError = nError; + } + + // Save HET table, BET table, hash table, block table, hi-block table + if(ha->dwFlags & MPQ_FLAG_CHANGED) + { + nError = SaveMPQTables(ha); + if(nError != ERROR_SUCCESS) + nResultError = nError; + } + + // Return the error + if(nResultError != ERROR_SUCCESS) + SetLastError(nResultError); + return (nResultError == ERROR_SUCCESS); +} + +//----------------------------------------------------------------------------- +// bool SFileCloseArchive(HANDLE hMpq); +// + +bool WINAPI SFileCloseArchive(HANDLE hMpq) +{ + TMPQArchive * ha = (TMPQArchive *)hMpq; + bool bResult; + + // Flush all unsaved data to the storage + bResult = SFileFlushArchive(hMpq); + + // Free all memory used by MPQ archive + FreeMPQArchive(ha); + return bResult; +} + diff --git a/dep/StormLib/src/SFileOpenFileEx.cpp b/dep/StormLib/src/SFileOpenFileEx.cpp new file mode 100644 index 00000000000..c35ac9f969c --- /dev/null +++ b/dep/StormLib/src/SFileOpenFileEx.cpp @@ -0,0 +1,452 @@ +/*****************************************************************************/ +/* SFileOpenFileEx.cpp Copyright (c) Ladislav Zezula 2003 */ +/*---------------------------------------------------------------------------*/ +/* Description : */ +/*---------------------------------------------------------------------------*/ +/* Date Ver Who Comment */ +/* -------- ---- --- ------- */ +/* xx.xx.99 1.00 Lad The first version of SFileOpenFileEx.cpp */ +/*****************************************************************************/ + +#define __STORMLIB_SELF__ +#include "StormLib.h" +#include "StormCommon.h" + +/*****************************************************************************/ +/* Local functions */ +/*****************************************************************************/ + +static bool OpenLocalFile(const char * szFileName, HANDLE * phFile) +{ + TFileStream * pStream; + TMPQFile * hf = NULL; + + // We have to convert the local file name to UNICODE, if needed +#ifdef _UNICODE + TCHAR szFileNameT[MAX_PATH]; + int i; + + for(i = 0; szFileName[i] != 0; i++) + szFileNameT[i] = szFileName[i]; + szFileNameT[i] = 0; + pStream = FileStream_OpenFile(szFileNameT, false); + +#else + pStream = FileStream_OpenFile(szFileName, false); +#endif + + if(pStream != NULL) + { + // Allocate and initialize file handle + hf = CreateMpqFile(NULL); + if(hf != NULL) + { + hf->pStream = pStream; + *phFile = hf; + return true; + } + else + { + FileStream_Close(pStream); + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + } + } + *phFile = NULL; + return false; +} + +bool OpenPatchedFile(HANDLE hMpq, const char * szFileName, DWORD dwReserved, HANDLE * phFile) +{ + TMPQArchive * ha = (TMPQArchive *)hMpq; + TMPQFile * hfPatch; // Pointer to patch file + TMPQFile * hfBase = NULL; // Pointer to base open file + TMPQFile * hfLast = NULL; // The highest file in the chain that is not patch file + TMPQFile * hf = NULL; + HANDLE hPatchFile; + char szPatchFileName[MAX_PATH]; + + // Keep this flag here for future updates + dwReserved = dwReserved; + + // First of all, try to open the original version of the file in any of the patch chain + while(ha != NULL) + { + // Construct the name of the patch file + strcpy(szPatchFileName, ha->szPatchPrefix); + strcat(szPatchFileName, szFileName); + if(SFileOpenFileEx((HANDLE)ha, szPatchFileName, SFILE_OPEN_FROM_MPQ, (HANDLE *)&hfBase)) + { + // The file must be a base file, i.e. without MPQ_FILE_PATCH_FILE + if((hfBase->pFileEntry->dwFlags & MPQ_FILE_PATCH_FILE) == 0) + { + hf = hfLast = hfBase; + break; + } + + SFileCloseFile((HANDLE)hfBase); + } + + // Move to the next file in the patch chain + ha = ha->haPatch; + } + + // If we couldn't find the file in any of the patches, it doesn't exist + if(hf == NULL) + { + SetLastError(ERROR_FILE_NOT_FOUND); + return false; + } + + // Now keep going in the patch chain and open every patch file that is there + for(ha = ha->haPatch; ha != NULL; ha = ha->haPatch) + { + // Construct patch file name + strcpy(szPatchFileName, ha->szPatchPrefix); + strcat(szPatchFileName, szFileName); + if(SFileOpenFileEx((HANDLE)ha, szPatchFileName, SFILE_OPEN_FROM_MPQ, &hPatchFile)) + { + // Remember the new version + hfPatch = (TMPQFile *)hPatchFile; + + // If we encountered a full replacement of the file, + // we have to remember the highest full file + if((hfPatch->pFileEntry->dwFlags & MPQ_FILE_PATCH_FILE) == 0) + hfLast = hfPatch; + + // Set current patch to base file and move on + hf->hfPatchFile = hfPatch; + hf = hfPatch; + } + } + + // Now we need to free all files that are below the highest unpatched version + while(hfBase != hfLast) + { + TMPQFile * hfNext = hfBase->hfPatchFile; + + // Free the file below + hfBase->hfPatchFile = NULL; + FreeMPQFile(hfBase); + + // Move the base to the next file + hfBase = hfNext; + } + + // Give the updated base MPQ + if(phFile != NULL) + *phFile = (HANDLE)hfBase; + return true; +} + +/*****************************************************************************/ +/* Public functions */ +/*****************************************************************************/ + +//----------------------------------------------------------------------------- +// SFileEnumLocales enums all locale versions within MPQ. +// Functions fills all available language identifiers on a file into the buffer +// pointed by plcLocales. There must be enough entries to copy the localed, +// otherwise the function returns ERROR_INSUFFICIENT_BUFFER. + +int WINAPI SFileEnumLocales( + HANDLE hMpq, + const char * szFileName, + LCID * plcLocales, + LPDWORD pdwMaxLocales, + DWORD dwSearchScope) +{ + TMPQArchive * ha = (TMPQArchive *)hMpq; + TFileEntry * pFileEntry; + TMPQHash * pFirstHash; + TMPQHash * pHash; + DWORD dwFileIndex = 0; + DWORD dwLocales = 0; + + // Test the parameters + if(!IsValidMpqHandle(ha)) + return ERROR_INVALID_HANDLE; + if(szFileName == NULL || *szFileName == 0) + return ERROR_INVALID_PARAMETER; + if(pdwMaxLocales == NULL) + return ERROR_INVALID_PARAMETER; + + // Keep compiler happy + dwSearchScope = dwSearchScope; + + // Parse hash table entries for all locales + if(!IsPseudoFileName(szFileName, &dwFileIndex)) + { + // Calculate the number of locales + pFirstHash = pHash = GetFirstHashEntry(ha, szFileName); + while(pHash != NULL) + { + dwLocales++; + pHash = GetNextHashEntry(ha, pFirstHash, pHash); + } + + // Test if there is enough space to copy the locales + if(*pdwMaxLocales < dwLocales) + { + *pdwMaxLocales = dwLocales; + return ERROR_INSUFFICIENT_BUFFER; + } + + // Enum the locales + pFirstHash = pHash = GetFirstHashEntry(ha, szFileName); + while(pHash != NULL) + { + *plcLocales++ = pHash->lcLocale; + pHash = GetNextHashEntry(ha, pFirstHash, pHash); + } + } + else + { + // There must be space for 1 locale + if(*pdwMaxLocales < 1) + { + *pdwMaxLocales = 1; + return ERROR_INSUFFICIENT_BUFFER; + } + + // For nameless access, always return 1 locale + pFileEntry = GetFileEntryByIndex(ha, dwFileIndex); + pHash = ha->pHashTable + pFileEntry->dwHashIndex; + *plcLocales = pHash->lcLocale; + dwLocales = 1; + } + + // Give the caller the total number of found locales + *pdwMaxLocales = dwLocales; + return ERROR_SUCCESS; +} + +//----------------------------------------------------------------------------- +// SFileHasFile +// +// hMpq - Handle of opened MPQ archive +// szFileName - Name of file to look for + +bool WINAPI SFileHasFile(HANDLE hMpq, const char * szFileName) +{ + TMPQArchive * ha = (TMPQArchive *)hMpq; + DWORD dwFileIndex = 0; + int nError = ERROR_SUCCESS; + + if(!IsValidMpqHandle(ha)) + nError = ERROR_INVALID_HANDLE; + if(szFileName == NULL || *szFileName == 0) + nError = ERROR_INVALID_PARAMETER; + + // Prepare the file opening + if(nError == ERROR_SUCCESS) + { + if(!IsPseudoFileName(szFileName, &dwFileIndex)) + { + if(GetFileEntryLocale(ha, szFileName, lcFileLocale) == NULL) + { + nError = ERROR_FILE_NOT_FOUND; + } + } + else + { + if(GetFileEntryByIndex(ha, dwFileIndex) == NULL) + { + nError = ERROR_FILE_NOT_FOUND; + } + } + } + + // Cleanup + if(nError != ERROR_SUCCESS) + SetLastError(nError); + return (nError == ERROR_SUCCESS); +} + + +//----------------------------------------------------------------------------- +// SFileOpenFileEx +// +// hMpq - Handle of opened MPQ archive +// szFileName - Name of file to open +// dwSearchScope - Where to search +// phFile - Pointer to store opened file handle + +bool WINAPI SFileOpenFileEx(HANDLE hMpq, const char * szFileName, DWORD dwSearchScope, HANDLE * phFile) +{ + TMPQArchive * ha = (TMPQArchive *)hMpq; + TFileEntry * pFileEntry = NULL; + TMPQFile * hf = NULL; + DWORD dwFileIndex = 0; + bool bOpenByIndex = false; + int nError = ERROR_SUCCESS; + + // Don't accept NULL pointer to file handle + if(phFile == NULL) + nError = ERROR_INVALID_PARAMETER; + + // Prepare the file opening + if(nError == ERROR_SUCCESS) + { + switch(dwSearchScope) + { + case SFILE_OPEN_PATCHED_FILE: + + // We want to open the updated version of the file + return OpenPatchedFile(hMpq, szFileName, 0, phFile); + + case SFILE_OPEN_FROM_MPQ: + + if(!IsValidMpqHandle(ha)) + { + nError = ERROR_INVALID_HANDLE; + break; + } + + if(szFileName == NULL || *szFileName == 0) + { + nError = ERROR_INVALID_PARAMETER; + break; + } + + // First of all, check the name as-is + if(!IsPseudoFileName(szFileName, &dwFileIndex)) + { + pFileEntry = GetFileEntryLocale(ha, szFileName, lcFileLocale); + if(pFileEntry == NULL) + nError = ERROR_FILE_NOT_FOUND; + } + else + { + bOpenByIndex = true; + pFileEntry = GetFileEntryByIndex(ha, dwFileIndex); + if(pFileEntry == NULL) + nError = ERROR_FILE_NOT_FOUND; + } + break; + + case SFILE_OPEN_ANY_LOCALE: + + // This open option is reserved for opening MPQ internal listfile. + // No argument validation. Tries to open file with neutral locale first, + // then any other available. + dwSearchScope = SFILE_OPEN_FROM_MPQ; + pFileEntry = GetFileEntryAny(ha, szFileName); + if(pFileEntry == NULL) + nError = ERROR_FILE_NOT_FOUND; + break; + + case SFILE_OPEN_LOCAL_FILE: + + if(szFileName == NULL || *szFileName == 0) + { + nError = ERROR_INVALID_PARAMETER; + break; + } + + return OpenLocalFile(szFileName, phFile); + + default: + + // Don't accept any other value + nError = ERROR_INVALID_PARAMETER; + break; + } + + // Quick return if something failed + if(nError != ERROR_SUCCESS) + { + SetLastError(nError); + return false; + } + } + + // Test if the file was not already deleted. + if(nError == ERROR_SUCCESS) + { + if((pFileEntry->dwFlags & MPQ_FILE_EXISTS) == 0) + nError = ERROR_FILE_NOT_FOUND; + if(pFileEntry->dwFlags & ~MPQ_FILE_VALID_FLAGS) + nError = ERROR_NOT_SUPPORTED; + } + + // Allocate file handle + if(nError == ERROR_SUCCESS) + { + if((hf = STORM_ALLOC(TMPQFile, 1)) == NULL) + nError = ERROR_NOT_ENOUGH_MEMORY; + } + + // Initialize file handle + if(nError == ERROR_SUCCESS) + { + memset(hf, 0, sizeof(TMPQFile)); + hf->pFileEntry = pFileEntry; + hf->dwMagic = ID_MPQ_FILE; + hf->ha = ha; + + hf->MpqFilePos = pFileEntry->ByteOffset; + hf->RawFilePos = ha->MpqPos + hf->MpqFilePos; + hf->dwDataSize = pFileEntry->dwFileSize; + + // If the MPQ has sector CRC enabled, enable if for the file + if(ha->dwFlags & MPQ_FLAG_CHECK_SECTOR_CRC) + hf->bCheckSectorCRCs = true; + + // If we know the real file name, copy it to the file entry + if(bOpenByIndex == false) + { + // If there is no file name yet, allocate it + AllocateFileName(pFileEntry, szFileName); + + // If the file is encrypted, we should detect the file key + if(pFileEntry->dwFlags & MPQ_FILE_ENCRYPTED) + { + hf->dwFileKey = DecryptFileKey(szFileName, + pFileEntry->ByteOffset, + pFileEntry->dwFileSize, + pFileEntry->dwFlags); + } + } + else + { + // Try to auto-detect the file name + if(!SFileGetFileName(hf, NULL)) + nError = GetLastError(); + } + } + + // If the file is actually a patch file, we have to load the patch file header + if(nError == ERROR_SUCCESS && pFileEntry->dwFlags & MPQ_FILE_PATCH_FILE) + { + assert(hf->pPatchInfo == NULL); + nError = AllocatePatchInfo(hf, true); + } + + // Cleanup + if(nError != ERROR_SUCCESS) + { + SetLastError(nError); + FreeMPQFile(hf); + } + + *phFile = hf; + return (nError == ERROR_SUCCESS); +} + +//----------------------------------------------------------------------------- +// bool WINAPI SFileCloseFile(HANDLE hFile); + +bool WINAPI SFileCloseFile(HANDLE hFile) +{ + TMPQFile * hf = (TMPQFile *)hFile; + + if(!IsValidFileHandle(hf)) + { + SetLastError(ERROR_INVALID_HANDLE); + return false; + } + + // Free the structure + FreeMPQFile(hf); + return true; +} diff --git a/dep/StormLib/src/SFilePatchArchives.cpp b/dep/StormLib/src/SFilePatchArchives.cpp new file mode 100644 index 00000000000..02f149be968 --- /dev/null +++ b/dep/StormLib/src/SFilePatchArchives.cpp @@ -0,0 +1,587 @@ +/*****************************************************************************/ +/* SFilePatchArchives.cpp Copyright (c) Ladislav Zezula 2010 */ +/*---------------------------------------------------------------------------*/ +/* Description: */ +/*---------------------------------------------------------------------------*/ +/* Date Ver Who Comment */ +/* -------- ---- --- ------- */ +/* 18.08.10 1.00 Lad The first version of SFilePatchArchives.cpp */ +/*****************************************************************************/ + +#define __STORMLIB_SELF__ +#include "StormLib.h" +#include "StormCommon.h" + +//----------------------------------------------------------------------------- +// Local structures + +typedef struct _BLIZZARD_BSDIFF40_FILE +{ + ULONGLONG Signature; + ULONGLONG CtrlBlockSize; + ULONGLONG DataBlockSize; + ULONGLONG NewFileSize; +} BLIZZARD_BSDIFF40_FILE, *PBLIZZARD_BSDIFF40_FILE; + +//----------------------------------------------------------------------------- +// Local functions + +static bool GetDefaultPatchPrefix( + const TCHAR * szBaseMpqName, + char * szBuffer) +{ + const TCHAR * szExtension; + const TCHAR * szDash; + + // Ensure that both names are plain names + szBaseMpqName = GetPlainFileNameT(szBaseMpqName); + + // Patch prefix is for the Cataclysm MPQs, whose names + // are like "locale-enGB.MPQ" or "speech-enGB.MPQ" + szExtension = _tcsrchr(szBaseMpqName, _T('.')); + szDash = _tcsrchr(szBaseMpqName, _T('-')); + strcpy(szBuffer, "Base"); + + // If the length of the prefix doesn't match, use default one + if(szExtension != NULL && szDash != NULL && (szExtension - szDash) == 5) + { + // Copy the prefix + szBuffer[0] = (char)szDash[1]; + szBuffer[1] = (char)szDash[2]; + szBuffer[2] = (char)szDash[3]; + szBuffer[3] = (char)szDash[4]; + szBuffer[4] = 0; + } + + return true; +} + +static void Decompress_RLE(LPBYTE pbDecompressed, DWORD cbDecompressed, LPBYTE pbCompressed, DWORD cbCompressed) +{ + LPBYTE pbDecompressedEnd = pbDecompressed + cbDecompressed; + LPBYTE pbCompressedEnd = pbCompressed + cbCompressed; + BYTE RepeatCount; + BYTE OneByte; + + // Cut the initial DWORD from the compressed chunk + pbCompressed += sizeof(DWORD); + cbCompressed -= sizeof(DWORD); + + // Pre-fill decompressed buffer with zeros + memset(pbDecompressed, 0, cbDecompressed); + + // Unpack + while(pbCompressed < pbCompressedEnd && pbDecompressed < pbDecompressedEnd) + { + OneByte = *pbCompressed++; + + // Is it a repetition byte ? + if(OneByte & 0x80) + { + RepeatCount = (OneByte & 0x7F) + 1; + for(BYTE i = 0; i < RepeatCount; i++) + { + if(pbDecompressed == pbDecompressedEnd || pbCompressed == pbCompressedEnd) + break; + + *pbDecompressed++ = *pbCompressed++; + } + } + else + { + pbDecompressed += (OneByte + 1); + } + } +} + +static int LoadMpqPatch_COPY(TMPQFile * hf, TPatchHeader * pPatchHeader) +{ + int nError = ERROR_SUCCESS; + + // Allocate space for patch header and compressed data + hf->pPatchHeader = (TPatchHeader *)STORM_ALLOC(BYTE, pPatchHeader->dwSizeOfPatchData); + if(hf->pPatchHeader == NULL) + nError = ERROR_NOT_ENOUGH_MEMORY; + + // Load the patch data and decide if they are compressed or not + if(nError == ERROR_SUCCESS) + { + LPBYTE pbPatchFile = (LPBYTE)hf->pPatchHeader; + + // Copy the patch header itself + memcpy(pbPatchFile, pPatchHeader, sizeof(TPatchHeader)); + pbPatchFile += sizeof(TPatchHeader); + + // Load the rest of the patch + if(!SFileReadFile((HANDLE)hf, pbPatchFile, pPatchHeader->dwSizeOfPatchData - sizeof(TPatchHeader))) + nError = GetLastError(); + } + + return nError; +} + +static int LoadMpqPatch_BSD0(TMPQFile * hf, TPatchHeader * pPatchHeader) +{ + LPBYTE pbDecompressed = NULL; + LPBYTE pbCompressed = NULL; + DWORD cbDecompressed = 0; + DWORD cbCompressed = 0; + DWORD dwBytesRead = 0; + int nError = ERROR_SUCCESS; + + // Allocate space for compressed data + cbCompressed = pPatchHeader->dwXfrmBlockSize - SIZE_OF_XFRM_HEADER; + pbCompressed = STORM_ALLOC(BYTE, cbCompressed); + if(pbCompressed == NULL) + nError = ERROR_SUCCESS; + + // Read the compressed patch data + if(nError == ERROR_SUCCESS) + { + // Load the rest of the header + SFileReadFile((HANDLE)hf, pbCompressed, cbCompressed, &dwBytesRead); + if(dwBytesRead != cbCompressed) + nError = ERROR_FILE_CORRUPT; + } + + // Get the uncompressed size of the patch + if(nError == ERROR_SUCCESS) + { + cbDecompressed = pPatchHeader->dwSizeOfPatchData - sizeof(TPatchHeader); + hf->pPatchHeader = (TPatchHeader *)STORM_ALLOC(BYTE, pPatchHeader->dwSizeOfPatchData); + if(hf->pPatchHeader == NULL) + nError = ERROR_NOT_ENOUGH_MEMORY; + } + + // Now decompress the patch data + if(nError == ERROR_SUCCESS) + { + // Copy the patch header + memcpy(hf->pPatchHeader, pPatchHeader, sizeof(TPatchHeader)); + pbDecompressed = (LPBYTE)hf->pPatchHeader + sizeof(TPatchHeader); + + // Uncompress or copy the patch data + if(cbCompressed < cbDecompressed) + { + Decompress_RLE(pbDecompressed, cbDecompressed, pbCompressed, cbCompressed); + } + else + { + assert(cbCompressed == cbDecompressed); + memcpy(pbDecompressed, pbCompressed, cbCompressed); + } + } + + // Free buffers and exit + if(pbCompressed != NULL) + STORM_FREE(pbCompressed); + return nError; +} + +static int ApplyMpqPatch_COPY( + TMPQFile * hf, + TPatchHeader * pPatchHeader) +{ + LPBYTE pbNewFileData; + DWORD cbNewFileData; + + // Allocate space for new file data + cbNewFileData = pPatchHeader->dwXfrmBlockSize - SIZE_OF_XFRM_HEADER; + pbNewFileData = STORM_ALLOC(BYTE, cbNewFileData); + if(pbNewFileData == NULL) + return ERROR_NOT_ENOUGH_MEMORY; + + // Copy the patch data as-is + memcpy(pbNewFileData, (LPBYTE)pPatchHeader + sizeof(TPatchHeader), cbNewFileData); + + // Free the old file data + STORM_FREE(hf->pbFileData); + + // Put the new file data there + hf->pbFileData = pbNewFileData; + hf->cbFileData = cbNewFileData; + return ERROR_SUCCESS; +} + +static int ApplyMpqPatch_BSD0( + TMPQFile * hf, + TPatchHeader * pPatchHeader) +{ + PBLIZZARD_BSDIFF40_FILE pBsdiff; + LPDWORD pCtrlBlock; + LPBYTE pbPatchData = (LPBYTE)pPatchHeader + sizeof(TPatchHeader); + LPBYTE pDataBlock; + LPBYTE pExtraBlock; + LPBYTE pbNewData = NULL; + LPBYTE pbOldData = (LPBYTE)hf->pbFileData; + DWORD dwNewOffset = 0; // Current position to patch + DWORD dwOldOffset = 0; // Current source position + DWORD dwNewSize; // Patched file size + DWORD dwOldSize = hf->cbFileData; // File size before patch + + // Get pointer to the patch header + // Format of BSDIFF header corresponds to original BSDIFF, which is: + // 0000 8 bytes signature "BSDIFF40" + // 0008 8 bytes size of the control block + // 0010 8 bytes size of the data block + // 0018 8 bytes new size of the patched file + pBsdiff = (PBLIZZARD_BSDIFF40_FILE)pbPatchData; + pbPatchData += sizeof(BLIZZARD_BSDIFF40_FILE); + + // Get pointer to the 32-bit BSDIFF control block + // The control block follows immediately after the BSDIFF header + // and consists of three 32-bit integers + // 0000 4 bytes Length to copy from the BSDIFF data block the new file + // 0004 4 bytes Length to copy from the BSDIFF extra block + // 0008 4 bytes Size to increment source file offset + pCtrlBlock = (LPDWORD)pbPatchData; + pbPatchData += (size_t)BSWAP_INT64_UNSIGNED(pBsdiff->CtrlBlockSize); + + // Get the pointer to the data block + pDataBlock = (LPBYTE)pbPatchData; + pbPatchData += (size_t)BSWAP_INT64_UNSIGNED(pBsdiff->DataBlockSize); + + // Get the pointer to the extra block + pExtraBlock = (LPBYTE)pbPatchData; + dwNewSize = (DWORD)BSWAP_INT64_UNSIGNED(pBsdiff->NewFileSize); + + // Allocate new buffer + pbNewData = STORM_ALLOC(BYTE, dwNewSize); + if(pbNewData == NULL) + return ERROR_NOT_ENOUGH_MEMORY; + + // Now patch the file + while(dwNewOffset < dwNewSize) + { + DWORD dwAddDataLength = BSWAP_INT32_UNSIGNED(pCtrlBlock[0]); + DWORD dwMovDataLength = BSWAP_INT32_UNSIGNED(pCtrlBlock[1]); + DWORD dwOldMoveLength = BSWAP_INT32_UNSIGNED(pCtrlBlock[2]); + DWORD i; + + // Sanity check + if((dwNewOffset + dwAddDataLength) > dwNewSize) + { + STORM_FREE(pbNewData); + return ERROR_FILE_CORRUPT; + } + + // Read the diff string to the target buffer + memcpy(pbNewData + dwNewOffset, pDataBlock, dwAddDataLength); + pDataBlock += dwAddDataLength; + + // Now combine the patch data with the original file + for(i = 0; i < dwAddDataLength; i++) + { + if(dwOldOffset < dwOldSize) + pbNewData[dwNewOffset] = pbNewData[dwNewOffset] + pbOldData[dwOldOffset]; + + dwNewOffset++; + dwOldOffset++; + } + + // Sanity check + if((dwNewOffset + dwMovDataLength) > dwNewSize) + { + STORM_FREE(pbNewData); + return ERROR_FILE_CORRUPT; + } + + // Copy the data from the extra block in BSDIFF patch + memcpy(pbNewData + dwNewOffset, pExtraBlock, dwMovDataLength); + pExtraBlock += dwMovDataLength; + dwNewOffset += dwMovDataLength; + + // Move the old offset + if(dwOldMoveLength & 0x80000000) + dwOldMoveLength = 0x80000000 - dwOldMoveLength; + dwOldOffset += dwOldMoveLength; + pCtrlBlock += 3; + } + + // Free the old file data + STORM_FREE(hf->pbFileData); + + // Put the new data to the fil structure + hf->pbFileData = pbNewData; + hf->cbFileData = dwNewSize; + return ERROR_SUCCESS; +} + + +static int LoadMpqPatch(TMPQFile * hf) +{ + TPatchHeader PatchHeader; + DWORD dwBytesRead; + int nError = ERROR_SUCCESS; + + // Read the patch header + SFileReadFile((HANDLE)hf, &PatchHeader, sizeof(TPatchHeader), &dwBytesRead); + if(dwBytesRead != sizeof(TPatchHeader)) + nError = ERROR_FILE_CORRUPT; + + // Verify the signatures in the patch header + if(nError == ERROR_SUCCESS) + { + // BSWAP the entire header, if needed + BSWAP_ARRAY32_UNSIGNED(&PatchHeader, sizeof(DWORD) * 6); + PatchHeader.dwXFRM = BSWAP_INT32_UNSIGNED(PatchHeader.dwXFRM); + PatchHeader.dwXfrmBlockSize = BSWAP_INT32_UNSIGNED(PatchHeader.dwXfrmBlockSize); + PatchHeader.dwPatchType = BSWAP_INT32_UNSIGNED(PatchHeader.dwPatchType); + + if(PatchHeader.dwSignature != 0x48435450 || PatchHeader.dwMD5 != 0x5f35444d || PatchHeader.dwXFRM != 0x4d524658) + nError = ERROR_FILE_CORRUPT; + } + + // Read the patch, depending on patch type + if(nError == ERROR_SUCCESS) + { + switch(PatchHeader.dwPatchType) + { + case 0x59504f43: // 'COPY' + nError = LoadMpqPatch_COPY(hf, &PatchHeader); + break; + + case 0x30445342: // 'BSD0' + nError = LoadMpqPatch_BSD0(hf, &PatchHeader); + break; + + default: + nError = ERROR_FILE_CORRUPT; + break; + } + } + + return nError; +} + +static int ApplyMpqPatch( + TMPQFile * hf, + TPatchHeader * pPatchHeader) +{ + int nError = ERROR_SUCCESS; + + // Verify the original file before patching + if(pPatchHeader->dwSizeBeforePatch != 0) + { + if(!VerifyDataBlockHash(hf->pbFileData, hf->cbFileData, pPatchHeader->md5_before_patch)) + nError = ERROR_FILE_CORRUPT; + } + + // Apply the patch + if(nError == ERROR_SUCCESS) + { + switch(pPatchHeader->dwPatchType) + { + case 0x59504f43: // 'COPY' + nError = ApplyMpqPatch_COPY(hf, pPatchHeader); + break; + + case 0x30445342: // 'BSD0' + nError = ApplyMpqPatch_BSD0(hf, pPatchHeader); + break; + + default: + nError = ERROR_FILE_CORRUPT; + break; + } + } + + // Verify MD5 after patch + if(nError == ERROR_SUCCESS && pPatchHeader->dwSizeAfterPatch != 0) + { + // Verify the patched file + if(!VerifyDataBlockHash(hf->pbFileData, hf->cbFileData, pPatchHeader->md5_after_patch)) + nError = ERROR_FILE_CORRUPT; + } + + return nError; +} + +//----------------------------------------------------------------------------- +// Public functions (StormLib internals) + +bool IsPatchData(const void * pvData, DWORD cbData, LPDWORD pdwPatchedFileSize) +{ + TPatchHeader * pPatchHeader = (TPatchHeader *)pvData; + BLIZZARD_BSDIFF40_FILE DiffFile; + DWORD dwPatchType; + + if(cbData >= sizeof(TPatchHeader) + sizeof(BLIZZARD_BSDIFF40_FILE)) + { + dwPatchType = BSWAP_INT32_UNSIGNED(pPatchHeader->dwPatchType); + if(dwPatchType == 0x30445342) + { + // Give the caller the patch file size + if(pdwPatchedFileSize != NULL) + { + Decompress_RLE((LPBYTE)&DiffFile, sizeof(BLIZZARD_BSDIFF40_FILE), (LPBYTE)(pPatchHeader + 1), sizeof(BLIZZARD_BSDIFF40_FILE)); + DiffFile.NewFileSize = BSWAP_INT64_UNSIGNED(DiffFile.NewFileSize); + *pdwPatchedFileSize = (DWORD)DiffFile.NewFileSize; + return true; + } + } + } + + return false; +} + +int PatchFileData(TMPQFile * hf) +{ + TMPQFile * hfBase = hf; + int nError = ERROR_SUCCESS; + + // Move to the first patch + hf = hf->hfPatchFile; + + // Now go through all patches and patch the original data + while(hf != NULL) + { + // This must be true + assert(hf->pFileEntry->dwFlags & MPQ_FILE_PATCH_FILE); + + // Make sure that the patch data is loaded + nError = LoadMpqPatch(hf); + if(nError != ERROR_SUCCESS) + break; + + // Apply the patch + nError = ApplyMpqPatch(hfBase, hf->pPatchHeader); + if(nError != ERROR_SUCCESS) + break; + + // Move to the next patch + hf = hf->hfPatchFile; + } + + return nError; +} + +//----------------------------------------------------------------------------- +// Public functions + +// +// Patch prefix is the path subdirectory where the patched files are within MPQ. +// +// Example 1: +// Main MPQ: locale-enGB.MPQ +// Patch MPQ: wow-update-12694.MPQ +// File in main MPQ: DBFilesClient\Achievement.dbc +// File in patch MPQ: enGB\DBFilesClient\Achievement.dbc +// Path prefix: enGB +// +// Example 2: +// Main MPQ: expansion1.MPQ +// Patch MPQ: wow-update-12694.MPQ +// File in main MPQ: DBFilesClient\Achievement.dbc +// File in patch MPQ: Base\DBFilesClient\Achievement.dbc +// Path prefix: Base +// + +bool WINAPI SFileOpenPatchArchive( + HANDLE hMpq, + const TCHAR * szPatchMpqName, + const char * szPatchPathPrefix, + DWORD dwFlags) +{ + TMPQArchive * haPatch; + TMPQArchive * ha = (TMPQArchive *)hMpq; + HANDLE hPatchMpq = NULL; + char szPatchPrefixBuff[MPQ_PATCH_PREFIX_LEN]; + int nError = ERROR_SUCCESS; + + // Keep compiler happy + dwFlags = dwFlags; + + // Verify input parameters + if(!IsValidMpqHandle(ha)) + nError = ERROR_INVALID_HANDLE; + if(szPatchMpqName == NULL || *szPatchMpqName == 0) + nError = ERROR_INVALID_PARAMETER; + + // If the user didn't give the patch prefix, get default one + if(szPatchPathPrefix != NULL) + { + // Save length of the patch prefix + if(strlen(szPatchPathPrefix) > MPQ_PATCH_PREFIX_LEN - 2) + nError = ERROR_INVALID_PARAMETER; + } + + // + // We don't allow adding patches to archives that have been open for write + // + // Error scenario: + // + // 1) Open archive for writing + // 2) Modify or replace a file + // 3) Add patch archive to the opened MPQ + // 4) Read patched file + // 5) Now what ? + // + + if(nError == ERROR_SUCCESS) + { + if((ha->pStream->StreamFlags & STREAM_FLAG_READ_ONLY) == 0) + nError = ERROR_ACCESS_DENIED; + } + + // Open the archive like it is normal archive + if(nError == ERROR_SUCCESS) + { + if(!SFileOpenArchive(szPatchMpqName, 0, MPQ_OPEN_READ_ONLY, &hPatchMpq)) + return false; + haPatch = (TMPQArchive *)hPatchMpq; + + // Older WoW patches (build 13914) used to have + // several language versions in one patch file + // Those patches needed to have a path prefix + // We can distinguish such patches by not having the (patch_metadata) file + if(szPatchPathPrefix == NULL) + { + if(!SFileHasFile(hPatchMpq, PATCH_METADATA_NAME)) + { + GetDefaultPatchPrefix(ha->pStream->szFileName, szPatchPrefixBuff); + szPatchPathPrefix = szPatchPrefixBuff; + } + } + + // Save the prefix for patch file names. + // Make sure that there is backslash after it + if(szPatchPathPrefix != NULL && *szPatchPathPrefix != 0) + { + strcpy(haPatch->szPatchPrefix, szPatchPathPrefix); + strcat(haPatch->szPatchPrefix, "\\"); + haPatch->cchPatchPrefix = strlen(haPatch->szPatchPrefix); + } + + // Now add the patch archive to the list of patches to the original MPQ + while(ha != NULL) + { + if(ha->haPatch == NULL) + { + haPatch->haBase = ha; + ha->haPatch = haPatch; + return true; + } + + // Move to the next archive + ha = ha->haPatch; + } + + // Should never happen + nError = ERROR_CAN_NOT_COMPLETE; + } + + SetLastError(nError); + return false; +} + +bool WINAPI SFileIsPatchedArchive(HANDLE hMpq) +{ + TMPQArchive * ha = (TMPQArchive *)hMpq; + + // Verify input parameters + if(!IsValidMpqHandle(ha)) + return false; + + return (ha->haPatch != NULL); +} diff --git a/dep/StormLib/src/SFileReadFile.cpp b/dep/StormLib/src/SFileReadFile.cpp new file mode 100644 index 00000000000..8c6482c13d2 --- /dev/null +++ b/dep/StormLib/src/SFileReadFile.cpp @@ -0,0 +1,1185 @@ +/*****************************************************************************/ +/* SFileReadFile.cpp Copyright (c) Ladislav Zezula 2003 */ +/*---------------------------------------------------------------------------*/ +/* Description : */ +/*---------------------------------------------------------------------------*/ +/* Date Ver Who Comment */ +/* -------- ---- --- ------- */ +/* xx.xx.99 1.00 Lad The first version of SFileReadFile.cpp */ +/* 24.03.99 1.00 Lad Added the SFileGetFileInfo function */ +/*****************************************************************************/ + +#define __STORMLIB_SELF__ +#include "StormLib.h" +#include "StormCommon.h" + +//----------------------------------------------------------------------------- +// Local structures + +struct TFileHeader2Ext +{ + DWORD dwOffset00Data; // Required data at offset 00 (32-bits) + DWORD dwOffset00Mask; // Mask for data at offset 00 (32 bits). 0 = data are ignored + DWORD dwOffset04Data; // Required data at offset 04 (32-bits) + DWORD dwOffset04Mask; // Mask for data at offset 04 (32 bits). 0 = data are ignored + const char * szExt; // Supplied extension, if the condition is true +}; + +//----------------------------------------------------------------------------- +// Local functions + +static void CopyFileName(char * szTarget, const TCHAR * szSource) +{ + while(*szSource != 0) + *szTarget++ = (char)*szSource++; + *szTarget = 0; +} + +static DWORD GetMpqFileCount(TMPQArchive * ha) +{ + TFileEntry * pFileTableEnd; + TFileEntry * pFileEntry; + DWORD dwFileCount = 0; + + // Go through all open MPQs, including patches + while(ha != NULL) + { + // Only count files that are not patch files + pFileTableEnd = ha->pFileTable + ha->dwFileTableSize; + for(pFileEntry = ha->pFileTable; pFileEntry < pFileTableEnd; pFileEntry++) + { + // If the file is patch file and this is not primary archive, skip it + // BUGBUG: This errorneously counts non-patch files that are in both + // base MPQ and in patches, and increases the number of files by cca 50% + if((pFileEntry->dwFlags & (MPQ_FILE_EXISTS | MPQ_FILE_PATCH_FILE)) == MPQ_FILE_EXISTS) + dwFileCount++; + } + + // Move to the next patch archive + ha = ha->haPatch; + } + + return dwFileCount; +} + +static bool GetFilePatchChain(TMPQFile * hf, void * pvFileInfo, DWORD cbFileInfo, LPDWORD pcbLengthNeeded) +{ + TMPQFile * hfTemp; + TCHAR * szPatchChain = (TCHAR *)pvFileInfo; + TCHAR * szFileName; + size_t cchCharsNeeded = 1; + size_t nLength; + DWORD cbLengthNeeded; + + // Check if the "hf" is a MPQ file + if(hf->pStream != NULL) + { + // Calculate the length needed + cchCharsNeeded += _tcslen(hf->pStream->szFileName) + 1; + cbLengthNeeded = (DWORD)(cchCharsNeeded * sizeof(TCHAR)); + + // If we have enough space, copy the file name + if(cbFileInfo >= cbLengthNeeded) + { + nLength = _tcslen(szFileName = hf->pStream->szFileName) + 1; + memcpy(szPatchChain, szFileName, nLength * sizeof(TCHAR)); + szPatchChain += nLength; + + // Terminate the multi-string + *szPatchChain = 0; + } + } + else + { + // Calculate number of characters needed + for(hfTemp = hf; hfTemp != NULL; hfTemp = hfTemp->hfPatchFile) + cchCharsNeeded += _tcslen(hfTemp->ha->pStream->szFileName) + 1; + cbLengthNeeded = (DWORD)(cchCharsNeeded * sizeof(TCHAR)); + + // If we have enough space, the copy the patch chain + if(cbFileInfo >= cbLengthNeeded) + { + for(hfTemp = hf; hfTemp != NULL; hfTemp = hfTemp->hfPatchFile) + { + nLength = _tcslen(szFileName = hfTemp->ha->pStream->szFileName) + 1; + memcpy(szPatchChain, szFileName, nLength * sizeof(TCHAR)); + szPatchChain += nLength; + } + + // Terminate the multi-string + *szPatchChain = 0; + } + } + + // Give result length, terminate multi-string and return + *pcbLengthNeeded = cbLengthNeeded; + return true; +} + +// hf - MPQ File handle. +// pbBuffer - Pointer to target buffer to store sectors. +// dwByteOffset - Position of sector in the file (relative to file begin) +// dwBytesToRead - Number of bytes to read. Must be multiplier of sector size. +// pdwBytesRead - Stored number of bytes loaded +static int ReadMpqSectors(TMPQFile * hf, LPBYTE pbBuffer, DWORD dwByteOffset, DWORD dwBytesToRead, LPDWORD pdwBytesRead) +{ + ULONGLONG RawFilePos; + TMPQArchive * ha = hf->ha; + TFileEntry * pFileEntry = hf->pFileEntry; + LPBYTE pbRawSector = NULL; + LPBYTE pbOutSector = pbBuffer; + LPBYTE pbInSector = pbBuffer; + DWORD dwRawBytesToRead; + DWORD dwRawSectorOffset = dwByteOffset; + DWORD dwSectorsToRead = dwBytesToRead / ha->dwSectorSize; + DWORD dwSectorIndex = dwByteOffset / ha->dwSectorSize; + DWORD dwSectorsDone = 0; + DWORD dwBytesRead = 0; + int nError = ERROR_SUCCESS; + + // Note that dwByteOffset must be aligned to size of one sector + // Note that dwBytesToRead must be a multiplier of one sector size + // This is local function, so we won't check if that's true. + // Note that files stored in single units are processed by a separate function + + // If there is not enough bytes remaining, cut dwBytesToRead + if((dwByteOffset + dwBytesToRead) > hf->dwDataSize) + dwBytesToRead = hf->dwDataSize - dwByteOffset; + dwRawBytesToRead = dwBytesToRead; + + // Perform all necessary work to do with compressed files + if(pFileEntry->dwFlags & MPQ_FILE_COMPRESSED) + { + // If the sector positions are not loaded yet, do it + if(hf->SectorOffsets == NULL) + { + nError = AllocateSectorOffsets(hf, true); + if(nError != ERROR_SUCCESS) + return nError; + } + + // If the sector checksums are not loaded yet, load them now. + if(hf->SectorChksums == NULL && (pFileEntry->dwFlags & MPQ_FILE_SECTOR_CRC) && hf->bLoadedSectorCRCs == false) + { + // + // Sector CRCs is plain crap feature. It is almost never present, + // often it's empty, or the end offset of sector CRCs is zero. + // We only try to load sector CRCs once, and regardless if it fails + // or not, we won't try that again for the given file. + // + + AllocateSectorChecksums(hf, true); + hf->bLoadedSectorCRCs = true; + } + + // TODO: If the raw data MD5s are not loaded yet, load them now + // Only do it if the MPQ is of format 4.0 +// if(ha->pHeader->wFormatVersion >= MPQ_FORMAT_VERSION_4 && ha->pHeader->dwRawChunkSize != 0) +// { +// nError = AllocateRawMD5s(hf, true); +// if(nError != ERROR_SUCCESS) +// return nError; +// } + + // If the file is compressed, also allocate secondary buffer + pbInSector = pbRawSector = STORM_ALLOC(BYTE, dwBytesToRead); + if(pbRawSector == NULL) + return ERROR_NOT_ENOUGH_MEMORY; + + // Assign the temporary buffer as target for read operation + dwRawSectorOffset = hf->SectorOffsets[dwSectorIndex]; + dwRawBytesToRead = hf->SectorOffsets[dwSectorIndex + dwSectorsToRead] - dwRawSectorOffset; + } + + // Calculate raw file offset where the sector(s) are stored. + CalculateRawSectorOffset(RawFilePos, hf, dwRawSectorOffset); + + // Set file pointer and read all required sectors + if(!FileStream_Read(ha->pStream, &RawFilePos, pbInSector, dwRawBytesToRead)) + return GetLastError(); + dwBytesRead = 0; + + // Now we have to decrypt and decompress all file sectors that have been loaded + for(DWORD i = 0; i < dwSectorsToRead; i++) + { + DWORD dwRawBytesInThisSector = ha->dwSectorSize; + DWORD dwBytesInThisSector = ha->dwSectorSize; + DWORD dwIndex = dwSectorIndex + i; + + // If there is not enough bytes in the last sector, + // cut the number of bytes in this sector + if(dwRawBytesInThisSector > dwBytesToRead) + dwRawBytesInThisSector = dwBytesToRead; + if(dwBytesInThisSector > dwBytesToRead) + dwBytesInThisSector = dwBytesToRead; + + // If the file is compressed, we have to adjust the raw sector size + if(pFileEntry->dwFlags & MPQ_FILE_COMPRESSED) + dwRawBytesInThisSector = hf->SectorOffsets[dwIndex + 1] - hf->SectorOffsets[dwIndex]; + + // If the file is encrypted, we have to decrypt the sector + if(pFileEntry->dwFlags & MPQ_FILE_ENCRYPTED) + { + BSWAP_ARRAY32_UNSIGNED(pbInSector, dwRawBytesInThisSector); + + // If we don't know the key, try to detect it by file content + if(hf->dwFileKey == 0) + { + hf->dwFileKey = DetectFileKeyByContent(pbInSector, dwBytesInThisSector); + if(hf->dwFileKey == 0) + { + nError = ERROR_UNKNOWN_FILE_KEY; + break; + } + } + + DecryptMpqBlock(pbInSector, dwRawBytesInThisSector, hf->dwFileKey + dwIndex); + BSWAP_ARRAY32_UNSIGNED(pbInSector, dwRawBytesInThisSector); + } + + // If the file has sector CRC check turned on, perform it + if(hf->bCheckSectorCRCs && hf->SectorChksums != NULL) + { + DWORD dwAdlerExpected = hf->SectorChksums[dwIndex]; + DWORD dwAdlerValue = 0; + + // We can only check sector CRC when it's not zero + // Neither can we check it if it's 0xFFFFFFFF. + if(dwAdlerExpected != 0 && dwAdlerExpected != 0xFFFFFFFF) + { + dwAdlerValue = adler32(0, pbInSector, dwRawBytesInThisSector); + if(dwAdlerValue != dwAdlerExpected) + { + nError = ERROR_CHECKSUM_ERROR; + break; + } + } + } + + // If the sector is really compressed, decompress it. + // WARNING : Some sectors may not be compressed, it can be determined only + // by comparing uncompressed and compressed size !!! + if(dwRawBytesInThisSector < dwBytesInThisSector) + { + int cbOutSector = dwBytesInThisSector; + int cbInSector = dwRawBytesInThisSector; + int nResult = 0; + + // Is the file compressed by PKWARE Data Compression Library ? + if(pFileEntry->dwFlags & MPQ_FILE_IMPLODE) + nResult = SCompExplode((char *)pbOutSector, &cbOutSector, (char *)pbInSector, cbInSector); + + // Is the file compressed by Blizzard's multiple compression ? + if(pFileEntry->dwFlags & MPQ_FILE_COMPRESS) + { + hf->PreviousCompression = pbInSector[0]; + nResult = SCompDecompress((char *)pbOutSector, &cbOutSector, (char *)pbInSector, cbInSector); + } + + // Did the decompression fail ? + if(nResult == 0) + { + nError = ERROR_FILE_CORRUPT; + break; + } + } + else + { + if(pbOutSector != pbInSector) + memcpy(pbOutSector, pbInSector, dwBytesInThisSector); + } + + // Move pointers + dwBytesToRead -= dwBytesInThisSector; + dwByteOffset += dwBytesInThisSector; + dwBytesRead += dwBytesInThisSector; + pbOutSector += dwBytesInThisSector; + pbInSector += dwRawBytesInThisSector; + dwSectorsDone++; + } + + // Free all used buffers + if(pbRawSector != NULL) + STORM_FREE(pbRawSector); + + // Give the caller thenumber of bytes read + *pdwBytesRead = dwBytesRead; + return nError; +} + +static int ReadMpqFileSingleUnit(TMPQFile * hf, void * pvBuffer, DWORD dwFilePos, DWORD dwToRead, LPDWORD pdwBytesRead) +{ + ULONGLONG RawFilePos = hf->RawFilePos; + TMPQArchive * ha = hf->ha; + TFileEntry * pFileEntry = hf->pFileEntry; + LPBYTE pbCompressed = NULL; + LPBYTE pbRawData = NULL; + bool bIsReallyCompressed = false; + int nError = ERROR_SUCCESS; + + // If the file buffer is not allocated yet, do it. + if(hf->pbFileSector == NULL) + { + nError = AllocateSectorBuffer(hf); + if(nError != ERROR_SUCCESS) + return nError; + pbRawData = hf->pbFileSector; + } + + // If the file is a patch file, adjust raw data offset + if(hf->pPatchInfo != NULL) + RawFilePos += hf->pPatchInfo->dwLength; + + // If the file sector is not loaded yet, do it + if(hf->dwSectorOffs != 0) + { + // Is the file compressed? + if(pFileEntry->dwFlags & MPQ_FILE_COMPRESS) + { + // Allocate space for compressed data + pbCompressed = STORM_ALLOC(BYTE, pFileEntry->dwCmpSize); + if(pbCompressed == NULL) + return ERROR_NOT_ENOUGH_MEMORY; + bIsReallyCompressed = true; + pbRawData = pbCompressed; + } + + // Load the raw (compressed, encrypted) data + if(!FileStream_Read(ha->pStream, &RawFilePos, pbRawData, pFileEntry->dwCmpSize)) + { + STORM_FREE(pbCompressed); + return GetLastError(); + } + + // If the file is encrypted, we have to decrypt the data first + if(pFileEntry->dwFlags & MPQ_FILE_ENCRYPTED) + { + BSWAP_ARRAY32_UNSIGNED(pbRawData, pFileEntry->dwCmpSize); + DecryptMpqBlock(pbRawData, pFileEntry->dwCmpSize, hf->dwFileKey); + BSWAP_ARRAY32_UNSIGNED(pbRawData, pFileEntry->dwCmpSize); + } + + // + // In "wow-update-12694.MPQ" from Wow-Cataclysm BETA: + // + // File CmpSize FileSize Data + // -------------------------------------- ------- -------- --------------- + // esES\DBFilesClient\LightSkyBox.dbc 0xBE 0xBC Is compressed + // deDE\DBFilesClient\MountCapability.dbc 0x93 0x77 Is uncompressed + // + // Now tell me how to deal with this mess. + // + + if(hf->pPatchInfo != NULL) + { + if(pbRawData[0] == 'P' && pbRawData[1] == 'T' && pbRawData[2] == 'C' && pbRawData[3] == 'H') + { + assert(pFileEntry->dwCmpSize >= hf->dwDataSize); + bIsReallyCompressed = false; + } + } + else + { + if(pFileEntry->dwCmpSize >= hf->dwDataSize) + bIsReallyCompressed = false; + } + + // If the file is compressed, we have to decompress it now + if(bIsReallyCompressed) + { + int cbOutBuffer = (int)hf->dwDataSize; + + // Note: Single unit files compressed with IMPLODE are not supported by Blizzard + if(pFileEntry->dwFlags & MPQ_FILE_IMPLODE) + { + if(!SCompExplode((char *)hf->pbFileSector, &cbOutBuffer, (char *)pbRawData, (int)pFileEntry->dwCmpSize)) + nError = ERROR_FILE_CORRUPT; + } + if(pFileEntry->dwFlags & MPQ_FILE_COMPRESS) + { + if(!SCompDecompress((char *)hf->pbFileSector, &cbOutBuffer, (char *)pbRawData, (int)pFileEntry->dwCmpSize)) + nError = ERROR_FILE_CORRUPT; + } + } + else + { + if(pbRawData != hf->pbFileSector) + memcpy(hf->pbFileSector, pbRawData, hf->dwDataSize); + } + + // Free the decompression buffer. + if(pbCompressed != NULL) + STORM_FREE(pbCompressed); + + // The file sector is now properly loaded + hf->dwSectorOffs = 0; + } + + // At this moment, we have the file loaded into the file buffer. + // Copy as much as the caller wants + if(nError == ERROR_SUCCESS && hf->dwSectorOffs == 0) + { + // File position is greater or equal to file size ? + if(dwFilePos >= hf->dwDataSize) + { + *pdwBytesRead = 0; + return ERROR_SUCCESS; + } + + // If not enough bytes remaining in the file, cut them + if((hf->dwDataSize - dwFilePos) < dwToRead) + dwToRead = (hf->dwDataSize - dwFilePos); + + // Copy the bytes + memcpy(pvBuffer, hf->pbFileSector + dwFilePos, dwToRead); + + // Give the number of bytes read + *pdwBytesRead = dwToRead; + return ERROR_SUCCESS; + } + + // An error, sorry + return ERROR_CAN_NOT_COMPLETE; +} + +static int ReadMpqFile(TMPQFile * hf, void * pvBuffer, DWORD dwFilePos, DWORD dwBytesToRead, LPDWORD pdwBytesRead) +{ + TMPQArchive * ha = hf->ha; + LPBYTE pbBuffer = (BYTE *)pvBuffer; + DWORD dwTotalBytesRead = 0; // Total bytes read in all three parts + DWORD dwSectorSizeMask = ha->dwSectorSize - 1; // Mask for block size, usually 0x0FFF + DWORD dwFileSectorPos; // File offset of the loaded sector + DWORD dwBytesRead; // Number of bytes read (temporary variable) + int nError; + + // If the file position is at or beyond end of file, do nothing + if(dwFilePos >= hf->dwDataSize) + { + *pdwBytesRead = 0; + return ERROR_SUCCESS; + } + + // If not enough bytes in the file remaining, cut them + if(dwBytesToRead > (hf->dwDataSize - dwFilePos)) + dwBytesToRead = (hf->dwDataSize - dwFilePos); + + // Compute sector position in the file + dwFileSectorPos = dwFilePos & ~dwSectorSizeMask; // Position in the block + + // If the file sector buffer is not allocated yet, do it now + if(hf->pbFileSector == NULL) + { + nError = AllocateSectorBuffer(hf); + if(nError != ERROR_SUCCESS) + return nError; + } + + // Load the first (incomplete) file sector + if(dwFilePos & dwSectorSizeMask) + { + DWORD dwBytesInSector = ha->dwSectorSize; + DWORD dwBufferOffs = dwFilePos & dwSectorSizeMask; + DWORD dwToCopy; + + // Is the file sector already loaded ? + if(hf->dwSectorOffs != dwFileSectorPos) + { + // Load one MPQ sector into archive buffer + nError = ReadMpqSectors(hf, hf->pbFileSector, dwFileSectorPos, ha->dwSectorSize, &dwBytesInSector); + if(nError != ERROR_SUCCESS) + return nError; + + // Remember that the data loaded to the sector have new file offset + hf->dwSectorOffs = dwFileSectorPos; + } + else + { + if((dwFileSectorPos + dwBytesInSector) > hf->dwDataSize) + dwBytesInSector = hf->dwDataSize - dwFileSectorPos; + } + + // Copy the data from the offset in the loaded sector to the end of the sector + dwToCopy = dwBytesInSector - dwBufferOffs; + if(dwToCopy > dwBytesToRead) + dwToCopy = dwBytesToRead; + + // Copy data from sector buffer into target buffer + memcpy(pbBuffer, hf->pbFileSector + dwBufferOffs, dwToCopy); + + // Update pointers and byte counts + dwTotalBytesRead += dwToCopy; + dwFileSectorPos += dwBytesInSector; + pbBuffer += dwToCopy; + dwBytesToRead -= dwToCopy; + } + + // Load the whole ("middle") sectors only if there is at least one full sector to be read + if(dwBytesToRead >= ha->dwSectorSize) + { + DWORD dwBlockBytes = dwBytesToRead & ~dwSectorSizeMask; + + // Load all sectors to the output buffer + nError = ReadMpqSectors(hf, pbBuffer, dwFileSectorPos, dwBlockBytes, &dwBytesRead); + if(nError != ERROR_SUCCESS) + return nError; + + // Update pointers + dwTotalBytesRead += dwBytesRead; + dwFileSectorPos += dwBytesRead; + pbBuffer += dwBytesRead; + dwBytesToRead -= dwBytesRead; + } + + // Read the terminating sector + if(dwBytesToRead > 0) + { + DWORD dwToCopy = ha->dwSectorSize; + + // Is the file sector already loaded ? + if(hf->dwSectorOffs != dwFileSectorPos) + { + // Load one MPQ sector into archive buffer + nError = ReadMpqSectors(hf, hf->pbFileSector, dwFileSectorPos, ha->dwSectorSize, &dwBytesRead); + if(nError != ERROR_SUCCESS) + return nError; + + // Remember that the data loaded to the sector have new file offset + hf->dwSectorOffs = dwFileSectorPos; + } + + // Check number of bytes read + if(dwToCopy > dwBytesToRead) + dwToCopy = dwBytesToRead; + + // Copy the data from the cached last sector to the caller's buffer + memcpy(pbBuffer, hf->pbFileSector, dwToCopy); + + // Update pointers + dwTotalBytesRead += dwToCopy; + } + + // Store total number of bytes read to the caller + *pdwBytesRead = dwTotalBytesRead; + return ERROR_SUCCESS; +} + +static int ReadMpqFilePatchFile(TMPQFile * hf, void * pvBuffer, DWORD dwFilePos, DWORD dwToRead, LPDWORD pdwBytesRead) +{ + DWORD dwBytesToRead = dwToRead; + DWORD dwBytesRead = 0; + int nError = ERROR_SUCCESS; + + // Make sure that the patch file is loaded completely + if(hf->pbFileData == NULL) + { + // Load the original file and store its content to "pbOldData" + hf->pbFileData = STORM_ALLOC(BYTE, hf->pFileEntry->dwFileSize); + hf->cbFileData = hf->pFileEntry->dwFileSize; + if(hf->pbFileData == NULL) + return ERROR_NOT_ENOUGH_MEMORY; + + // Read the file data + if(hf->pFileEntry->dwFlags & MPQ_FILE_SINGLE_UNIT) + nError = ReadMpqFileSingleUnit(hf, hf->pbFileData, 0, hf->cbFileData, &dwBytesRead); + else + nError = ReadMpqFile(hf, hf->pbFileData, 0, hf->cbFileData, &dwBytesRead); + + // Fix error code + if(nError == ERROR_SUCCESS && dwBytesRead != hf->cbFileData) + nError = ERROR_FILE_CORRUPT; + + // Patch the file data + if(nError == ERROR_SUCCESS) + nError = PatchFileData(hf); + + // Reset number of bytes read to zero + dwBytesRead = 0; + } + + // If there is something to read, do it + if(nError == ERROR_SUCCESS) + { + if(dwFilePos < hf->cbFileData) + { + // Make sure we don't copy more than file size + if((dwFilePos + dwToRead) > hf->cbFileData) + dwToRead = hf->cbFileData - dwFilePos; + + // Copy the appropriate amount of the file data to the caller's buffer + memcpy(pvBuffer, hf->pbFileData + dwFilePos, dwToRead); + dwBytesRead = dwToRead; + } + + // Set the proper error code + nError = (dwBytesRead == dwBytesToRead) ? ERROR_SUCCESS : ERROR_HANDLE_EOF; + } + + // Give the result to the caller + if(pdwBytesRead != NULL) + *pdwBytesRead = dwBytesRead; + return nError; +} + +//----------------------------------------------------------------------------- +// SFileReadFile + +bool WINAPI SFileReadFile(HANDLE hFile, void * pvBuffer, DWORD dwToRead, LPDWORD pdwRead, LPOVERLAPPED lpOverlapped) +{ + TMPQFile * hf = (TMPQFile *)hFile; + DWORD dwBytesRead = 0; // Number of bytes read + int nError = ERROR_SUCCESS; + + // Keep compilers happy + lpOverlapped = lpOverlapped; + + // Check valid parameters + if(!IsValidFileHandle(hf)) + { + SetLastError(ERROR_INVALID_HANDLE); + return false; + } + + if(pvBuffer == NULL) + { + SetLastError(ERROR_INVALID_PARAMETER); + return false; + } + + // If the file is local file, read the data directly from the stream + if(hf->pStream != NULL) + { + ULONGLONG FilePosition1; + ULONGLONG FilePosition2; + + // Because stream I/O functions are designed to read + // "all or nothing", we compare file position before and after, + // and if they differ, we assume that number of bytes read + // is the difference between them + + FileStream_GetPos(hf->pStream, FilePosition1); + if(!FileStream_Read(hf->pStream, NULL, pvBuffer, dwToRead)) + { + // If not all bytes have been read, then return the number + // of bytes read + if((nError = GetLastError()) == ERROR_HANDLE_EOF) + { + FileStream_GetPos(hf->pStream, FilePosition2); + dwBytesRead = (DWORD)(FilePosition2 - FilePosition1); + } + else + { + nError = GetLastError(); + } + } + else + { + dwBytesRead = dwToRead; + } + } + else + { + // If the file is a patch file, we have to read it special way + if(hf->hfPatchFile != NULL && (hf->pFileEntry->dwFlags & MPQ_FILE_PATCH_FILE) == 0) + { + nError = ReadMpqFilePatchFile(hf, pvBuffer, hf->dwFilePos, dwToRead, &dwBytesRead); + } + + // If the file is single unit file, redirect it to read file + else if(hf->pFileEntry->dwFlags & MPQ_FILE_SINGLE_UNIT) + { + nError = ReadMpqFileSingleUnit(hf, pvBuffer, hf->dwFilePos, dwToRead, &dwBytesRead); + } + + // Otherwise read it as sector based MPQ file + else + { + nError = ReadMpqFile(hf, pvBuffer, hf->dwFilePos, dwToRead, &dwBytesRead); + } + + // Increment the file position + hf->dwFilePos += dwBytesRead; + } + + // Give the caller the number of bytes read + if(pdwRead != NULL) + *pdwRead = dwBytesRead; + + // If the read operation succeeded, but not full number of bytes was read, + // set the last error to ERROR_HANDLE_EOF + if(nError == ERROR_SUCCESS && (dwBytesRead < dwToRead)) + nError = ERROR_HANDLE_EOF; + + // If something failed, set the last error value + if(nError != ERROR_SUCCESS) + SetLastError(nError); + return (nError == ERROR_SUCCESS); +} + +//----------------------------------------------------------------------------- +// SFileGetFileSize + +DWORD WINAPI SFileGetFileSize(HANDLE hFile, LPDWORD pdwFileSizeHigh) +{ + ULONGLONG FileSize; + TMPQFile * hf = (TMPQFile *)hFile; + + // Validate the file handle before we go on + if(IsValidFileHandle(hf)) + { + // Make sure that the variable is initialized + FileSize = 0; + + // If the file is patched file, we have to get the size of the last version + if(hf->hfPatchFile != NULL) + { + // Walk through the entire patch chain, take the last version + while(hf != NULL) + { + // Get the size of the currently pointed version + FileSize = hf->pFileEntry->dwFileSize; + + // Move to the next patch file in the hierarchy + hf = hf->hfPatchFile; + } + } + else + { + // Is it a local file ? + if(hf->pStream != NULL) + { + FileStream_GetSize(hf->pStream, FileSize); + } + else + { + FileSize = hf->dwDataSize; + } + } + + // If opened from archive, return file size + if(pdwFileSizeHigh != NULL) + *pdwFileSizeHigh = (DWORD)(FileSize >> 32); + return (DWORD)FileSize; + } + + SetLastError(ERROR_INVALID_HANDLE); + return SFILE_INVALID_SIZE; +} + +DWORD WINAPI SFileSetFilePointer(HANDLE hFile, LONG lFilePos, LONG * plFilePosHigh, DWORD dwMoveMethod) +{ + TMPQFile * hf = (TMPQFile *)hFile; + ULONGLONG FilePosition; + ULONGLONG MoveOffset; + DWORD dwFilePosHi; + + // If the hFile is not a valid file handle, return an error. + if(!IsValidFileHandle(hf)) + { + SetLastError(ERROR_INVALID_HANDLE); + return SFILE_INVALID_POS; + } + + // Get the relative point where to move from + switch(dwMoveMethod) + { + case FILE_BEGIN: + FilePosition = 0; + break; + + case FILE_CURRENT: + if(hf->pStream != NULL) + { + FileStream_GetPos(hf->pStream, FilePosition); + } + else + { + FilePosition = hf->dwFilePos; + } + break; + + case FILE_END: + if(hf->pStream != NULL) + { + FileStream_GetSize(hf->pStream, FilePosition); + } + else + { + FilePosition = SFileGetFileSize(hFile, NULL); + } + break; + + default: + SetLastError(ERROR_INVALID_PARAMETER); + return SFILE_INVALID_POS; + } + + // Now get the move offset. Note that both values form + // a signed 64-bit value (a file pointer can be moved backwards) + if(plFilePosHigh != NULL) + dwFilePosHi = *plFilePosHigh; + else + dwFilePosHi = (lFilePos & 0x80000000) ? 0xFFFFFFFF : 0; + MoveOffset = MAKE_OFFSET64(dwFilePosHi, lFilePos); + + // Now calculate the new file pointer + // Do not allow the file pointer to go before the begin of the file + FilePosition += MoveOffset; + if(FilePosition < 0) + FilePosition = 0; + + // Now apply the file pointer to the file + if(hf->pStream != NULL) + { + // Apply the new file position + if(!FileStream_Read(hf->pStream, &FilePosition, NULL, 0)) + return SFILE_INVALID_POS; + + // Return the new file position + if(plFilePosHigh != NULL) + *plFilePosHigh = (LONG)(FilePosition >> 32); + return (DWORD)FilePosition; + } + else + { + // Files in MPQ can't be bigger than 4 GB. + // We don't allow to go past 4 GB + if(FilePosition >> 32) + { + SetLastError(ERROR_INVALID_PARAMETER); + return SFILE_INVALID_POS; + } + + // Change the file position + hf->dwFilePos = (DWORD)FilePosition; + + // Return the new file position + if(plFilePosHigh != NULL) + *plFilePosHigh = 0; + return (DWORD)FilePosition; + } +} + +//----------------------------------------------------------------------------- +// Tries to retrieve the file name + +static TFileHeader2Ext data2ext[] = +{ + {0x00005A4D, 0x0000FFFF, 0x00000000, 0x00000000, "exe"}, // EXE files + {0x00000006, 0xFFFFFFFF, 0x00000001, 0xFFFFFFFF, "dc6"}, // EXE files + {0x1A51504D, 0xFFFFFFFF, 0x00000000, 0x00000000, "mpq"}, // MPQ archive header ID ('MPQ\x1A') + {0x46464952, 0xFFFFFFFF, 0x00000000, 0x00000000, "wav"}, // WAVE header 'RIFF' + {0x324B4D53, 0xFFFFFFFF, 0x00000000, 0x00000000, "smk"}, // Old "Smacker Video" files 'SMK2' + {0x694B4942, 0xFFFFFFFF, 0x00000000, 0x00000000, "bik"}, // Bink video files (new) + {0x0801050A, 0xFFFFFFFF, 0x00000000, 0x00000000, "pcx"}, // PCX images used in Diablo I + {0x544E4F46, 0xFFFFFFFF, 0x00000000, 0x00000000, "fnt"}, // Font files used in Diablo II + {0x6D74683C, 0xFFFFFFFF, 0x00000000, 0x00000000, "html"}, // HTML 'pFileEntry; + + // Only do something if the file name is not filled + if(nError == ERROR_SUCCESS && pFileEntry != NULL && pFileEntry->szFileName == NULL) + { + // Read the first 2 DWORDs bytes from the file + FirstBytes[0] = FirstBytes[1] = 0; + dwFilePos = SFileSetFilePointer(hf, 0, NULL, FILE_CURRENT); + SFileReadFile(hFile, FirstBytes, sizeof(FirstBytes), NULL); + BSWAP_ARRAY32_UNSIGNED(FirstBytes, sizeof(FirstBytes)); + SFileSetFilePointer(hf, dwFilePos, NULL, FILE_BEGIN); + + // Try to guess file extension from those 2 DWORDs + for(i = 0; data2ext[i].szExt != NULL; i++) + { + if((FirstBytes[0] & data2ext[i].dwOffset00Mask) == data2ext[i].dwOffset00Data && + (FirstBytes[1] & data2ext[i].dwOffset04Mask) == data2ext[i].dwOffset04Data) + { + sprintf(szPseudoName, "File%08u.%s", (unsigned int)(pFileEntry - hf->ha->pFileTable), data2ext[i].szExt); + break; + } + } + + // Put the file name to the file table + AllocateFileName(pFileEntry, szPseudoName); + } + + // Now put the file name to the file structure + if(nError == ERROR_SUCCESS && szFileName != NULL) + { + if(pFileEntry != NULL && pFileEntry->szFileName != NULL) + strcpy(szFileName, pFileEntry->szFileName); + else if(hf->pStream != NULL) + CopyFileName(szFileName, hf->pStream->szFileName); + } + return (nError == ERROR_SUCCESS); +} + +//----------------------------------------------------------------------------- +// Retrieves an information about an archive or about a file within the archive +// +// hMpqOrFile - Handle to an MPQ archive or to a file +// dwInfoType - Information to obtain + +#define VERIFY_MPQ_HANDLE(h) \ + if(!IsValidMpqHandle(h)) \ + { \ + nError = ERROR_INVALID_HANDLE; \ + break; \ + } + +#define VERIFY_FILE_HANDLE(h) \ + if(!IsValidFileHandle(h)) \ + { \ + nError = ERROR_INVALID_HANDLE; \ + break; \ + } + +bool WINAPI SFileGetFileInfo( + HANDLE hMpqOrFile, + DWORD dwInfoType, + void * pvFileInfo, + DWORD cbFileInfo, + LPDWORD pcbLengthNeeded) +{ + TMPQArchive * ha = (TMPQArchive *)hMpqOrFile; + TMPQBlock * pBlock; + TMPQFile * hf = (TMPQFile *)hMpqOrFile; + void * pvSrcFileInfo = NULL; + DWORD cbLengthNeeded = 0; + DWORD dwIsReadOnly; + DWORD dwFileCount = 0; + DWORD dwFileIndex; + DWORD dwFileKey; + DWORD i; + int nError = ERROR_SUCCESS; + + switch(dwInfoType) + { + case SFILE_INFO_ARCHIVE_NAME: + VERIFY_MPQ_HANDLE(ha); + + // pvFileInfo receives the name of the archive, terminated by 0 + cbLengthNeeded = (DWORD)(_tcslen(ha->pStream->szFileName) + 1) * sizeof(TCHAR); + pvSrcFileInfo = ha->pStream->szFileName; + break; + + case SFILE_INFO_ARCHIVE_SIZE: // Size of the archive + VERIFY_MPQ_HANDLE(ha); + cbLengthNeeded = sizeof(DWORD); + pvSrcFileInfo = &ha->pHeader->dwArchiveSize; + break; + + case SFILE_INFO_MAX_FILE_COUNT: // Max. number of files in the MPQ + VERIFY_MPQ_HANDLE(ha); + cbLengthNeeded = sizeof(DWORD); + pvSrcFileInfo = &ha->dwMaxFileCount; + break; + + case SFILE_INFO_HASH_TABLE_SIZE: // Size of the hash table + VERIFY_MPQ_HANDLE(ha); + cbLengthNeeded = sizeof(DWORD); + pvSrcFileInfo = &ha->pHeader->dwHashTableSize; + break; + + case SFILE_INFO_BLOCK_TABLE_SIZE: // Size of the block table + VERIFY_MPQ_HANDLE(ha); + cbLengthNeeded = sizeof(DWORD); + pvSrcFileInfo = &ha->pHeader->dwBlockTableSize; + break; + + case SFILE_INFO_SECTOR_SIZE: + VERIFY_MPQ_HANDLE(ha); + cbLengthNeeded = sizeof(DWORD); + pvSrcFileInfo = &ha->dwSectorSize; + break; + + case SFILE_INFO_HASH_TABLE: + VERIFY_MPQ_HANDLE(ha); + cbLengthNeeded = ha->pHeader->dwHashTableSize * sizeof(TMPQHash); + pvSrcFileInfo = ha->pHashTable; + break; + + case SFILE_INFO_BLOCK_TABLE: + VERIFY_MPQ_HANDLE(ha); + cbLengthNeeded = ha->dwFileTableSize * sizeof(TMPQBlock); + if(cbFileInfo < cbLengthNeeded) + { + nError = ERROR_INSUFFICIENT_BUFFER; + break; + } + + // Construct block table from file table size + pBlock = (TMPQBlock *)pvFileInfo; + for(i = 0; i < ha->dwFileTableSize; i++) + { + pBlock->dwFilePos = (DWORD)ha->pFileTable[i].ByteOffset; + pBlock->dwFSize = ha->pFileTable[i].dwFileSize; + pBlock->dwCSize = ha->pFileTable[i].dwCmpSize; + pBlock->dwFlags = ha->pFileTable[i].dwFlags; + pBlock++; + } + break; + + case SFILE_INFO_NUM_FILES: + VERIFY_MPQ_HANDLE(ha); + dwFileCount = GetMpqFileCount(ha); + cbLengthNeeded = sizeof(DWORD); + pvSrcFileInfo = &dwFileCount; + break; + + case SFILE_INFO_STREAM_FLAGS: // Stream flags for the MPQ. See STREAM_FLAG_XXX + VERIFY_MPQ_HANDLE(ha); + cbLengthNeeded = sizeof(DWORD); + pvSrcFileInfo = &ha->pStream->StreamFlags; + break; + + case SFILE_INFO_IS_READ_ONLY: + VERIFY_MPQ_HANDLE(ha); + dwIsReadOnly = ((ha->pStream->StreamFlags & STREAM_FLAG_READ_ONLY) || (ha->dwFlags & MPQ_FLAG_READ_ONLY)); + cbLengthNeeded = sizeof(DWORD); + pvSrcFileInfo = &dwIsReadOnly; + break; + + case SFILE_INFO_HASH_INDEX: + VERIFY_FILE_HANDLE(hf); + cbLengthNeeded = sizeof(DWORD); + pvSrcFileInfo = &hf->pFileEntry->dwHashIndex; + break; + + case SFILE_INFO_CODENAME1: + VERIFY_FILE_HANDLE(hf); + cbLengthNeeded = sizeof(DWORD); + pvSrcFileInfo = &hf->pFileEntry->dwHashIndex; + if(ha->pHashTable != NULL) + pvSrcFileInfo = &ha->pHashTable[hf->pFileEntry->dwHashIndex].dwName1; + break; + + case SFILE_INFO_CODENAME2: + VERIFY_FILE_HANDLE(hf); + cbLengthNeeded = sizeof(DWORD); + if(ha->pHashTable != NULL) + pvSrcFileInfo = &ha->pHashTable[hf->pFileEntry->dwHashIndex].dwName2; + break; + + case SFILE_INFO_LOCALEID: + VERIFY_FILE_HANDLE(hf); + cbLengthNeeded = sizeof(DWORD); + pvSrcFileInfo = &hf->pFileEntry->lcLocale; + break; + + case SFILE_INFO_BLOCKINDEX: + VERIFY_FILE_HANDLE(hf); + dwFileIndex = (DWORD)(hf->pFileEntry - hf->ha->pFileTable); + cbLengthNeeded = sizeof(DWORD); + pvSrcFileInfo = &dwFileIndex; + break; + + case SFILE_INFO_FILE_SIZE: + VERIFY_FILE_HANDLE(hf); + cbLengthNeeded = sizeof(DWORD); + pvSrcFileInfo = &hf->pFileEntry->dwFileSize; + break; + + case SFILE_INFO_COMPRESSED_SIZE: + VERIFY_FILE_HANDLE(hf); + cbLengthNeeded = sizeof(DWORD); + pvSrcFileInfo = &hf->pFileEntry->dwCmpSize; + break; + + case SFILE_INFO_FLAGS: + VERIFY_FILE_HANDLE(hf); + cbLengthNeeded = sizeof(DWORD); + pvSrcFileInfo = &hf->pFileEntry->dwFlags; + break; + + case SFILE_INFO_POSITION: + VERIFY_FILE_HANDLE(hf); + cbLengthNeeded = sizeof(ULONGLONG); + pvSrcFileInfo = &hf->pFileEntry->ByteOffset; + break; + + case SFILE_INFO_KEY: + VERIFY_FILE_HANDLE(hf); + cbLengthNeeded = sizeof(DWORD); + pvSrcFileInfo = &hf->dwFileKey; + break; + + case SFILE_INFO_KEY_UNFIXED: + VERIFY_FILE_HANDLE(hf); + dwFileKey = hf->dwFileKey; + if(hf->pFileEntry->dwFlags & MPQ_FILE_FIX_KEY) + dwFileKey = (dwFileKey ^ hf->pFileEntry->dwFileSize) - (DWORD)hf->MpqFilePos; + cbLengthNeeded = sizeof(DWORD); + pvSrcFileInfo = &dwFileKey; + break; + + case SFILE_INFO_FILETIME: + VERIFY_FILE_HANDLE(hf); + cbLengthNeeded = sizeof(ULONGLONG); + pvSrcFileInfo = &hf->pFileEntry->FileTime; + break; + + case SFILE_INFO_PATCH_CHAIN: + VERIFY_FILE_HANDLE(hf); + GetFilePatchChain(hf, pvFileInfo, cbFileInfo, &cbLengthNeeded); + break; + + default: + nError = ERROR_INVALID_PARAMETER; + break; + } + + // If everything is OK so far, copy the information + if(nError == ERROR_SUCCESS) + { + // Is the output buffer large enough? + if(cbFileInfo >= cbLengthNeeded) + { + // Copy the data + if(pvSrcFileInfo != NULL) + memcpy(pvFileInfo, pvSrcFileInfo, cbLengthNeeded); + } + else + { + nError = ERROR_INSUFFICIENT_BUFFER; + } + + // Give the size to the caller + if(pcbLengthNeeded != NULL) + *pcbLengthNeeded = cbLengthNeeded; + } + + // Set the last error value, if needed + if(nError != ERROR_SUCCESS) + SetLastError(nError); + return (nError == ERROR_SUCCESS); +} diff --git a/dep/StormLib/src/SFileVerify.cpp b/dep/StormLib/src/SFileVerify.cpp new file mode 100644 index 00000000000..2190caa6994 --- /dev/null +++ b/dep/StormLib/src/SFileVerify.cpp @@ -0,0 +1,926 @@ +/*****************************************************************************/ +/* SFileVerify.cpp Copyright (c) Ladislav Zezula 2010 */ +/*---------------------------------------------------------------------------*/ +/* MPQ files and MPQ archives verification. */ +/* */ +/* The MPQ signature verification has been written by Jean-Francois Roy */ +/* and Justin Olbrantz (Quantam). */ +/* The MPQ public keys have been created by MPQKit, using OpenSSL library. */ +/* */ +/*---------------------------------------------------------------------------*/ +/* Date Ver Who Comment */ +/* -------- ---- --- ------- */ +/* 04.05.10 1.00 Lad The first version of SFileVerify.cpp */ +/*****************************************************************************/ + +#define __STORMLIB_SELF__ +#include "StormLib.h" +#include "StormCommon.h" + +//----------------------------------------------------------------------------- +// Local defines + +#define SIGNATURE_TYPE_NONE 0 +#define SIGNATURE_TYPE_WEAK 1 +#define SIGNATURE_TYPE_STRONG 2 + +#define MPQ_DIGEST_UNIT_SIZE 0x10000 + +typedef struct _MPQ_SIGNATURE_INFO +{ + ULONGLONG BeginMpqData; // File offset where the hashing starts + ULONGLONG BeginExclude; // Begin of the excluded area (used for (signature) file) + ULONGLONG EndExclude; // End of the excluded area (used for (signature) file) + ULONGLONG EndMpqData; // File offset where the hashing ends + ULONGLONG EndOfFile; // Size of the entire file + BYTE Signature[MPQ_STRONG_SIGNATURE_SIZE + 0x10]; + DWORD cbSignatureSize; // Length of the signature + int nSignatureType; // See SIGNATURE_TYPE_XXX + +} MPQ_SIGNATURE_INFO, *PMPQ_SIGNATURE_INFO; + +//----------------------------------------------------------------------------- +// Known Blizzard public keys +// Created by Jean-Francois Roy using OpenSSL + +static const char * szBlizzardWeakPublicKey = + "-----BEGIN PUBLIC KEY-----" + "MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJJidwS/uILMBSO5DLGsBFknIXWWjQJe" + "2kfdfEk3G/j66w4KkhZ1V61Rt4zLaMVCYpDun7FLwRjkMDSepO1q2DcCAwEAAQ==" + "-----END PUBLIC KEY-----"; + +static const char * szBlizzardStrongPublicKey = + "-----BEGIN PUBLIC KEY-----" + "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsQZ+ziT2h8h+J/iMQpgd" + "tH1HaJzOBE3agjU4yMPcrixaPOZoA4t8bwfey7qczfWywocYo3pleytFF+IuD4HD" + "Fl9OXN1SFyupSgMx1EGZlgbFAomnbq9MQJyMqQtMhRAjFgg4TndS7YNb+JMSAEKp" + "kXNqY28n/EVBHD5TsMuVCL579gIenbr61dI92DDEdy790IzIG0VKWLh/KOTcTJfm" + "Ds/7HQTkGouVW+WUsfekuqNQo7ND9DBnhLjLjptxeFE2AZqYcA1ao3S9LN3GL1tW" + "lVXFIX9c7fWqaVTQlZ2oNsI/ARVApOK3grNgqvwH6YoVYVXjNJEo5sQJsPsdV/hk" + "dwIDAQAB" + "-----END PUBLIC KEY-----"; + +static const char * szWarcraft3MapPublicKey = + "-----BEGIN PUBLIC KEY-----" + "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1BwklUUQ3UvjizOBRoF5" + "yyOVc7KD+oGOQH5i6eUk1yfs0luCC70kNucNrfqhmviywVtahRse1JtXCPrx2bd3" + "iN8Dx91fbkxjYIOGTsjYoHKTp0BbaFkJih776fcHgnFSb+7mJcDuJVvJOXxEH6w0" + "1vo6VtujCqj1arqbyoal+xtAaczF3us5cOEp45sR1zAWTn1+7omN7VWV4QqJPaDS" + "gBSESc0l1grO0i1VUSumayk7yBKIkb+LBvcG6WnYZHCi7VdLmaxER5m8oZfER66b" + "heHoiSQIZf9PAY6Guw2DT5BTc54j/AaLQAKf2qcRSgQLVo5kQaddF3rCpsXoB/74" + "6QIDAQAB" + "-----END PUBLIC KEY-----"; + +static const char * szWowPatchPublicKey = + "-----BEGIN PUBLIC KEY-----" + "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwOsMV0LagAWPEtEQM6b9" + "6FHFkUyGbbyda2/Dfc9dyl21E9QvX+Yw7qKRMAKPzA2TlQQLZKvXpnKXF/YIK5xa" + "5uwg9CEHCEAYolLG4xn0FUOE0E/0PuuytI0p0ICe6rk00PifZzTr8na2wI/l/GnQ" + "bvnIVF1ck6cslATpQJ5JJVMXzoFlUABS19WESw4MXuJAS3AbMhxNWdEhVv7eO51c" + "yGjRLy9QjogZODZTY0fSEksgBqQxNCoYVJYI/sF5K2flDsGqrIp0OdJ6teJlzg1Y" + "UjYnb6bKjlidXoHEXI2TgA/mD6O3XFIt08I9s3crOCTgICq7cgX35qrZiIVWZdRv" + "TwIDAQAB" + "-----END PUBLIC KEY-----"; + +static const char * szWowSurveyPublicKey = + "-----BEGIN PUBLIC KEY-----" + "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnIt1DR6nRyyKsy2qahHe" + "MKLtacatn/KxieHcwH87wLBxKy+jZ0gycTmJ7SaTdBAEMDs/V5IPIXEtoqYnid2c" + "63TmfGDU92oc3Ph1PWUZ2PWxBhT06HYxRdbrgHw9/I29pNPi/607x+lzPORITOgU" + "BR6MR8au8HsQP4bn4vkJNgnSgojh48/XQOB/cAln7As1neP61NmVimoLR4Bwi3zt" + "zfgrZaUpyeNCUrOYJmH09YIjbBySTtXOUidoPHjFrMsCWpr6xs8xbETbs7MJFL6a" + "vcUfTT67qfIZ9RsuKfnXJTIrV0kwDSjjuNXiPTmWAehSsiHIsrUXX5RNcwsSjClr" + "nQIDAQAB" + "-----END PUBLIC KEY-----"; + +static const char * szStarcraft2MapPublicKey = + "-----BEGIN PUBLIC KEY-----" + "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmk4GT8zb+ICC25a17KZB" + "q/ygKGJ2VSO6IT5PGHJlm1KfnHBA4B6SH3xMlJ4c6eG2k7QevZv+FOhjsAHubyWq" + "2VKqWbrIFKv2ILc2RfMn8J9EDVRxvcxh6slRrVL69D0w1tfVGjMiKq2Fym5yGoRT" + "E7CRgDqbAbXP9LBsCNWHiJLwfxMGzHbk8pIl9oia5pvM7ofZamSHchxlpy6xa4GJ" + "7xKN01YCNvklTL1D7uol3wkwcHc7vrF8QwuJizuA5bSg4poEGtH62BZOYi+UL/z0" + "31YK+k9CbQyM0X0pJoJoYz1TK+Y5J7vBnXCZtfcTYQ/ZzN6UcxTa57dJaiOlCh9z" + "nQIDAQAB" + "-----END PUBLIC KEY-----"; + +//----------------------------------------------------------------------------- +// Local functions + +static void memrev(unsigned char *buf, size_t count) +{ + unsigned char *r; + + for (r = buf + count - 1; buf < r; buf++, r--) + { + *buf ^= *r; + *r ^= *buf; + *buf ^= *r; + } +} + +static bool is_valid_md5(void * pvMd5) +{ + LPDWORD Md5 = (LPDWORD)pvMd5; + + return (Md5[0] | Md5[1] | Md5[2] | Md5[3]) ? true : false; +} + +static bool decode_base64_key(const char * szKeyBase64, rsa_key * key) +{ + unsigned char decoded_key[0x200]; + const char * szBase64Begin; + const char * szBase64End; + unsigned long decoded_length = sizeof(decoded_key); + unsigned long length; + + // Find out the begin of the BASE64 data + szBase64Begin = szKeyBase64 + strlen("-----BEGIN PUBLIC KEY-----"); + szBase64End = szBase64Begin + strlen(szBase64Begin) - strlen("-----END PUBLIC KEY-----"); + if(szBase64End[0] != '-') + return false; + + // decode the base64 string + length = (unsigned long)(szBase64End - szBase64Begin); + if(base64_decode((unsigned char *)szBase64Begin, length, decoded_key, &decoded_length) != CRYPT_OK) + return false; + + // Create RSA key + if(rsa_import(decoded_key, decoded_length, key) != CRYPT_OK) + return false; + + return true; +} + +static void GetPlainAnsiFileName( + const TCHAR * szFileName, + char * szPlainName) +{ + const TCHAR * szPlainNameT = GetPlainFileNameT(szFileName); + + // Convert the plain name to ANSI + while(*szPlainNameT != 0) + *szPlainName++ = (char)*szPlainNameT++; + *szPlainName = 0; +} + +// Calculate begin and end of the MPQ archive +static void CalculateArchiveRange( + TMPQArchive * ha, + PMPQ_SIGNATURE_INFO pSI) +{ + TMPQHeader * pHeader = ha->pHeader; + ULONGLONG TempPos = 0; + ULONGLONG MaxPos; + char szMapHeader[0x200]; + + // Get the MPQ begin + pSI->BeginMpqData = ha->MpqPos; + + // Warcraft III maps are signed from the map header to the end + if(FileStream_Read(ha->pStream, &TempPos, szMapHeader, sizeof(szMapHeader))) + { + // Is it a map header ? + if(szMapHeader[0] == 'H' && szMapHeader[1] == 'M' && szMapHeader[2] == '3' && szMapHeader[3] == 'W') + { + // We will have to hash since the map header + pSI->BeginMpqData = 0; + } + } + + // Get the MPQ data end. The end is calculated as the biggest + // value of (end of the last file), (end of block table), + // (end of ext block table), (end of hash table) + FindFreeMpqSpace(ha, &MaxPos); + + // Check if hash table is beyond + TempPos = ha->MpqPos + MAKE_OFFSET64(pHeader->wHashTablePosHi, pHeader->dwHashTablePos) + pHeader->HashTableSize64; + if(TempPos > MaxPos) + MaxPos = TempPos; + + // Check if block table is beyond + TempPos = ha->MpqPos + MAKE_OFFSET64(pHeader->wBlockTablePosHi, pHeader->dwBlockTablePos) + pHeader->BlockTableSize64; + if(TempPos > MaxPos) + MaxPos = TempPos; + + // Check if ext block table is beyond + if(pHeader->HiBlockTablePos64 != 0) + { + TempPos = ha->MpqPos + pHeader->HiBlockTablePos64 + pHeader->HiBlockTableSize64; + if(TempPos > MaxPos) + MaxPos = TempPos; + } + + // Give the end + pSI->EndMpqData = MaxPos; + + // Get the size of the entire file + FileStream_GetSize(ha->pStream, pSI->EndOfFile); +} + +static bool QueryMpqSignatureInfo( + TMPQArchive * ha, + PMPQ_SIGNATURE_INFO pSI) +{ + ULONGLONG ExtraBytes; + TMPQFile * hf; + HANDLE hFile; + DWORD dwFileSize; + + // Calculate the range of the MPQ + CalculateArchiveRange(ha, pSI); + + // If there is "(signature)" file in the MPQ, it has a weak signature + if(SFileOpenFileEx((HANDLE)ha, SIGNATURE_NAME, SFILE_OPEN_FROM_MPQ, &hFile)) + { + // Get the content of the signature + SFileReadFile(hFile, pSI->Signature, sizeof(pSI->Signature), &pSI->cbSignatureSize); + + // Verify the size of the signature + hf = (TMPQFile *)hFile; + + // We have to exclude the signature file from the digest + pSI->BeginExclude = ha->MpqPos + hf->pFileEntry->ByteOffset; + pSI->EndExclude = pSI->BeginExclude + hf->pFileEntry->dwCmpSize; + dwFileSize = hf->dwDataSize; + + // Close the file + SFileCloseFile(hFile); + pSI->nSignatureType = SIGNATURE_TYPE_WEAK; + return (dwFileSize == (MPQ_WEAK_SIGNATURE_SIZE + 8)) ? true : false; + } + + // If there is extra bytes beyond the end of the archive, + // it's the strong signature + ExtraBytes = pSI->EndOfFile - pSI->EndMpqData; + if(ExtraBytes >= (MPQ_STRONG_SIGNATURE_SIZE + 4)) + { + // Read the strong signature + if(!FileStream_Read(ha->pStream, &pSI->EndMpqData, pSI->Signature, (MPQ_STRONG_SIGNATURE_SIZE + 4))) + return false; + + // Check the signature header "NGIS" + if(pSI->Signature[0] != 'N' || pSI->Signature[1] != 'G' || pSI->Signature[2] != 'I' || pSI->Signature[3] != 'S') + return false; + + pSI->nSignatureType = SIGNATURE_TYPE_STRONG; + return true; + } + + // Succeeded, but no known signature found + return true; +} + +static bool CalculateMpqHashMd5( + TMPQArchive * ha, + PMPQ_SIGNATURE_INFO pSI, + LPBYTE pMd5Digest) +{ + hash_state md5_state; + ULONGLONG BeginBuffer; + ULONGLONG EndBuffer; + LPBYTE pbDigestBuffer = NULL; + + // Allocate buffer for creating the MPQ digest. + pbDigestBuffer = STORM_ALLOC(BYTE, MPQ_DIGEST_UNIT_SIZE); + if(pbDigestBuffer == NULL) + return false; + + // Initialize the MD5 hash state + md5_init(&md5_state); + + // Set the byte offset of begin of the data + BeginBuffer = pSI->BeginMpqData; + + // Create the digest + for(;;) + { + ULONGLONG BytesRemaining; + LPBYTE pbSigBegin = NULL; + LPBYTE pbSigEnd = NULL; + DWORD dwToRead = MPQ_DIGEST_UNIT_SIZE; + + // Check the number of bytes remaining + BytesRemaining = pSI->EndMpqData - BeginBuffer; + if(BytesRemaining < MPQ_DIGEST_UNIT_SIZE) + dwToRead = (DWORD)BytesRemaining; + if(dwToRead == 0) + break; + + // Read the next chunk + if(!FileStream_Read(ha->pStream, &BeginBuffer, pbDigestBuffer, dwToRead)) + { + STORM_FREE(pbDigestBuffer); + return false; + } + + // Move the current byte offset + EndBuffer = BeginBuffer + dwToRead; + + // Check if the signature is within the loaded digest + if(BeginBuffer <= pSI->BeginExclude && pSI->BeginExclude < EndBuffer) + pbSigBegin = pbDigestBuffer + (size_t)(pSI->BeginExclude - BeginBuffer); + if(BeginBuffer <= pSI->EndExclude && pSI->EndExclude < EndBuffer) + pbSigEnd = pbDigestBuffer + (size_t)(pSI->EndExclude - BeginBuffer); + + // Zero the part that belongs to the signature + if(pbSigBegin != NULL || pbSigEnd != NULL) + { + if(pbSigBegin == NULL) + pbSigBegin = pbDigestBuffer; + if(pbSigEnd == NULL) + pbSigEnd = pbDigestBuffer + dwToRead; + + memset(pbSigBegin, 0, (pbSigEnd - pbSigBegin)); + } + + // Pass the buffer to the hashing function + md5_process(&md5_state, pbDigestBuffer, dwToRead); + + // Move pointers + BeginBuffer += dwToRead; + } + + // Finalize the MD5 hash + md5_done(&md5_state, pMd5Digest); + STORM_FREE(pbDigestBuffer); + return true; +} + +static void AddTailToSha1( + hash_state * psha1_state, + const char * szTail) +{ + unsigned char szUpperCase[0x200]; + unsigned long nLength = 0; + + // Convert the tail to uppercase + // Note that we don't need to terminate the string with zero + while(*szTail != 0) + { + szUpperCase[nLength++] = (unsigned char)toupper(*szTail++); + } + + // Append the tail to the SHA1 + sha1_process(psha1_state, szUpperCase, nLength); +} + +static bool CalculateMpqHashSha1( + TMPQArchive * ha, + PMPQ_SIGNATURE_INFO pSI, + unsigned char * sha1_tail0, + unsigned char * sha1_tail1, + unsigned char * sha1_tail2) +{ + ULONGLONG BeginBuffer; + hash_state sha1_state_temp; + hash_state sha1_state; + LPBYTE pbDigestBuffer = NULL; + char szPlainName[MAX_PATH]; + + // Allocate buffer for creating the MPQ digest. + pbDigestBuffer = STORM_ALLOC(BYTE, MPQ_DIGEST_UNIT_SIZE); + if(pbDigestBuffer == NULL) + return false; + + // Initialize SHA1 state structure + sha1_init(&sha1_state); + + // Calculate begin of data to be hashed + BeginBuffer = pSI->BeginMpqData; + + // Create the digest + for(;;) + { + ULONGLONG BytesRemaining; + DWORD dwToRead = MPQ_DIGEST_UNIT_SIZE; + + // Check the number of bytes remaining + BytesRemaining = pSI->EndMpqData - BeginBuffer; + if(BytesRemaining < MPQ_DIGEST_UNIT_SIZE) + dwToRead = (DWORD)BytesRemaining; + if(dwToRead == 0) + break; + + // Read the next chunk + if(!FileStream_Read(ha->pStream, &BeginBuffer, pbDigestBuffer, dwToRead)) + { + STORM_FREE(pbDigestBuffer); + return false; + } + + // Pass the buffer to the hashing function + sha1_process(&sha1_state, pbDigestBuffer, dwToRead); + + // Move pointers + BeginBuffer += dwToRead; + } + + // Add all three known tails and generate three hashes + memcpy(&sha1_state_temp, &sha1_state, sizeof(hash_state)); + sha1_done(&sha1_state_temp, sha1_tail0); + + memcpy(&sha1_state_temp, &sha1_state, sizeof(hash_state)); + GetPlainAnsiFileName(ha->pStream->szFileName, szPlainName); + AddTailToSha1(&sha1_state_temp, szPlainName); + sha1_done(&sha1_state_temp, sha1_tail1); + + memcpy(&sha1_state_temp, &sha1_state, sizeof(hash_state)); + AddTailToSha1(&sha1_state_temp, "ARCHIVE"); + sha1_done(&sha1_state_temp, sha1_tail2); + + // Finalize the MD5 hash + STORM_FREE(pbDigestBuffer); + return true; +} + +static int VerifyRawMpqData( + TMPQArchive * ha, + ULONGLONG ByteOffset, + DWORD dwDataSize) +{ + ULONGLONG DataOffset = ha->MpqPos + ByteOffset; + LPBYTE pbDataChunk; + LPBYTE pbMD5Array1; // Calculated MD5 array + LPBYTE pbMD5Array2; // MD5 array loaded from the MPQ + DWORD dwBytesInChunk; + DWORD dwChunkCount; + DWORD dwChunkSize = ha->pHeader->dwRawChunkSize; + DWORD dwMD5Size; + int nError = ERROR_SUCCESS; + + // Get the number of data chunks to calculate MD5 + assert(dwChunkSize != 0); + dwChunkCount = dwDataSize / dwChunkSize; + if(dwDataSize % dwChunkSize) + dwChunkCount++; + dwMD5Size = dwChunkCount * MD5_DIGEST_SIZE; + + // Allocate space for data chunk and for the MD5 array + pbDataChunk = STORM_ALLOC(BYTE, dwChunkSize); + if(pbDataChunk == NULL) + return ERROR_NOT_ENOUGH_MEMORY; + + // Allocate space for MD5 array + pbMD5Array1 = STORM_ALLOC(BYTE, dwMD5Size); + pbMD5Array2 = STORM_ALLOC(BYTE, dwMD5Size); + if(pbMD5Array1 == NULL || pbMD5Array2 == NULL) + nError = ERROR_NOT_ENOUGH_MEMORY; + + // Calculate MD5 of each data chunk + if(nError == ERROR_SUCCESS) + { + LPBYTE pbMD5 = pbMD5Array1; + + for(DWORD i = 0; i < dwChunkCount; i++) + { + // Get the number of bytes in the chunk + dwBytesInChunk = STORMLIB_MIN(dwChunkSize, dwDataSize); + + // Read the data chunk + if(!FileStream_Read(ha->pStream, &DataOffset, pbDataChunk, dwBytesInChunk)) + { + nError = ERROR_FILE_CORRUPT; + break; + } + + // Calculate MD5 + CalculateDataBlockHash(pbDataChunk, dwBytesInChunk, pbMD5); + + // Move pointers and offsets + DataOffset += dwBytesInChunk; + dwDataSize -= dwBytesInChunk; + pbMD5 += MD5_DIGEST_SIZE; + } + } + + // Read the MD5 array + if(nError == ERROR_SUCCESS) + { + // Read the array of MD5 + if(!FileStream_Read(ha->pStream, &DataOffset, pbMD5Array2, dwMD5Size)) + nError = GetLastError(); + } + + // Compare the array of MD5 + if(nError == ERROR_SUCCESS) + { + // Compare the MD5 + if(memcmp(pbMD5Array1, pbMD5Array2, dwMD5Size)) + nError = ERROR_FILE_CORRUPT; + } + + // Free memory and return result + if(pbMD5Array2 != NULL) + STORM_FREE(pbMD5Array2); + if(pbMD5Array1 != NULL) + STORM_FREE(pbMD5Array1); + if(pbDataChunk != NULL) + STORM_FREE(pbDataChunk); + return nError; +} + +static DWORD VerifyWeakSignature( + TMPQArchive * ha, + PMPQ_SIGNATURE_INFO pSI) +{ + BYTE RevSignature[MPQ_WEAK_SIGNATURE_SIZE]; + BYTE Md5Digest[MD5_DIGEST_SIZE]; + rsa_key key; + int hash_idx = find_hash("md5"); + int result = 0; + + // Calculate hash of the entire archive, skipping the (signature) file + if(!CalculateMpqHashMd5(ha, pSI, Md5Digest)) + return ERROR_VERIFY_FAILED; + + // Import the Blizzard key in OpenSSL format + if(!decode_base64_key(szBlizzardWeakPublicKey, &key)) + return ERROR_VERIFY_FAILED; + + // Verify the signature + memcpy(RevSignature, &pSI->Signature[8], MPQ_WEAK_SIGNATURE_SIZE); + memrev(RevSignature, MPQ_WEAK_SIGNATURE_SIZE); + rsa_verify_hash_ex(RevSignature, MPQ_WEAK_SIGNATURE_SIZE, Md5Digest, sizeof(Md5Digest), LTC_LTC_PKCS_1_V1_5, hash_idx, 0, &result, &key); + rsa_free(&key); + + // Return the result + return result ? ERROR_WEAK_SIGNATURE_OK : ERROR_WEAK_SIGNATURE_ERROR; +} + +static DWORD VerifyStrongSignatureWithKey( + unsigned char * reversed_signature, + unsigned char * padded_digest, + const char * szPublicKey) +{ + rsa_key key; + int result = 0; + + // Import the Blizzard key in OpenSSL format + if(!decode_base64_key(szPublicKey, &key)) + { + assert(false); + return ERROR_VERIFY_FAILED; + } + + // Verify the signature + if(rsa_verify_simple(reversed_signature, MPQ_STRONG_SIGNATURE_SIZE, padded_digest, MPQ_STRONG_SIGNATURE_SIZE, &result, &key) != CRYPT_OK) + return ERROR_VERIFY_FAILED; + + // Free the key and return result + rsa_free(&key); + return result ? ERROR_STRONG_SIGNATURE_OK : ERROR_STRONG_SIGNATURE_ERROR; +} + +static DWORD VerifyStrongSignature( + TMPQArchive * ha, + PMPQ_SIGNATURE_INFO pSI) +{ + unsigned char reversed_signature[MPQ_STRONG_SIGNATURE_SIZE]; + unsigned char Sha1Digest_tail0[SHA1_DIGEST_SIZE]; + unsigned char Sha1Digest_tail1[SHA1_DIGEST_SIZE]; + unsigned char Sha1Digest_tail2[SHA1_DIGEST_SIZE]; + unsigned char padded_digest[MPQ_STRONG_SIGNATURE_SIZE]; + DWORD dwResult; + size_t digest_offset; + + // Calculate SHA1 hash of the archive + if(!CalculateMpqHashSha1(ha, pSI, Sha1Digest_tail0, Sha1Digest_tail1, Sha1Digest_tail2)) + return ERROR_VERIFY_FAILED; + + // Prepare the signature for decryption + memcpy(reversed_signature, &pSI->Signature[4], MPQ_STRONG_SIGNATURE_SIZE); + memrev(reversed_signature, MPQ_STRONG_SIGNATURE_SIZE); + + // Prepare the padded digest for comparison + digest_offset = sizeof(padded_digest) - SHA1_DIGEST_SIZE; + memset(padded_digest, 0xbb, digest_offset); + padded_digest[0] = 0x0b; + + // Try Blizzard Strong public key with no SHA1 tail + memcpy(padded_digest + digest_offset, Sha1Digest_tail0, SHA1_DIGEST_SIZE); + memrev(padded_digest + digest_offset, SHA1_DIGEST_SIZE); + dwResult = VerifyStrongSignatureWithKey(reversed_signature, padded_digest, szBlizzardStrongPublicKey); + if(dwResult == ERROR_STRONG_SIGNATURE_OK) + return dwResult; + + // Try War 3 map public key with plain file name as SHA1 tail + memcpy(padded_digest + digest_offset, Sha1Digest_tail1, SHA1_DIGEST_SIZE); + memrev(padded_digest + digest_offset, SHA1_DIGEST_SIZE); + dwResult = VerifyStrongSignatureWithKey(reversed_signature, padded_digest, szWarcraft3MapPublicKey); + if(dwResult == ERROR_STRONG_SIGNATURE_OK) + return dwResult; + + // Try WoW-TBC public key with "ARCHIVE" as SHA1 tail + memcpy(padded_digest + digest_offset, Sha1Digest_tail2, SHA1_DIGEST_SIZE); + memrev(padded_digest + digest_offset, SHA1_DIGEST_SIZE); + dwResult = VerifyStrongSignatureWithKey(reversed_signature, padded_digest, szWowPatchPublicKey); + if(dwResult == ERROR_STRONG_SIGNATURE_OK) + return dwResult; + + // Try Survey public key with no SHA1 tail + memcpy(padded_digest + digest_offset, Sha1Digest_tail0, SHA1_DIGEST_SIZE); + memrev(padded_digest + digest_offset, SHA1_DIGEST_SIZE); + dwResult = VerifyStrongSignatureWithKey(reversed_signature, padded_digest, szWowSurveyPublicKey); + if(dwResult == ERROR_STRONG_SIGNATURE_OK) + return dwResult; + + // Try Starcraft II public key with no SHA1 tail + memcpy(padded_digest + digest_offset, Sha1Digest_tail0, SHA1_DIGEST_SIZE); + memrev(padded_digest + digest_offset, SHA1_DIGEST_SIZE); + dwResult = VerifyStrongSignatureWithKey(reversed_signature, padded_digest, szStarcraft2MapPublicKey); + if(dwResult == ERROR_STRONG_SIGNATURE_OK) + return dwResult; + + return ERROR_STRONG_SIGNATURE_ERROR; +} + +static DWORD VerifyFile( + HANDLE hMpq, + const char * szFileName, + LPDWORD pdwCrc32, + char * pMD5, + DWORD dwFlags) +{ + hash_state md5_state; + unsigned char * pFileMd5; + unsigned char md5[MD5_DIGEST_SIZE]; + TFileEntry * pFileEntry; + TMPQFile * hf; + BYTE Buffer[0x1000]; + HANDLE hFile = NULL; + DWORD dwVerifyResult = 0; + DWORD dwSearchScope = SFILE_OPEN_FROM_MPQ; + DWORD dwTotalBytes = 0; + DWORD dwBytesRead; + DWORD dwCrc32 = 0; + + // Fix the open type for patched archives + if(SFileIsPatchedArchive(hMpq)) + dwSearchScope = SFILE_OPEN_PATCHED_FILE; + + // Attempt to open the file + if(SFileOpenFileEx(hMpq, szFileName, dwSearchScope, &hFile)) + { + // Get the file size + hf = (TMPQFile *)hFile; + pFileEntry = hf->pFileEntry; + dwTotalBytes = SFileGetFileSize(hFile, NULL); + + // Initialize the CRC32 and MD5 contexts + md5_init(&md5_state); + dwCrc32 = crc32(0, Z_NULL, 0); + + // If we have to verify raw data MD5, do it + if(dwFlags & SFILE_VERIFY_RAW_MD5) + { + if(hf->ha->pHeader->dwRawChunkSize != 0) + { + // Note: we have to open the file from the MPQ where it was open from + if(VerifyRawMpqData(hf->ha, pFileEntry->ByteOffset, pFileEntry->dwCmpSize) != ERROR_SUCCESS) + dwVerifyResult |= VERIFY_FILE_RAW_MD5_ERROR; + dwVerifyResult |= VERIFY_FILE_HAS_RAW_MD5; + } + } + + // Also turn on sector checksum verification + if(dwFlags & SFILE_VERIFY_SECTOR_CRC) + hf->bCheckSectorCRCs = true; + + // Go through entire file and update both CRC32 and MD5 + for(;;) + { + // Read data from file + SFileReadFile(hFile, Buffer, sizeof(Buffer), &dwBytesRead, NULL); + if(dwBytesRead == 0) + { + if(GetLastError() == ERROR_CHECKSUM_ERROR) + dwVerifyResult |= VERIFY_FILE_SECTOR_CRC_ERROR; + break; + } + + // Update CRC32 value + if(dwFlags & SFILE_VERIFY_FILE_CRC) + dwCrc32 = crc32(dwCrc32, Buffer, dwBytesRead); + + // Update MD5 value + if(dwFlags & SFILE_VERIFY_FILE_MD5) + md5_process(&md5_state, Buffer, dwBytesRead); + + // Decrement the total size + dwTotalBytes -= dwBytesRead; + } + + // If the file has sector checksums, indicate it in the flags + if(dwFlags & SFILE_VERIFY_SECTOR_CRC) + { + if((hf->pFileEntry->dwFlags & MPQ_FILE_SECTOR_CRC) && hf->SectorChksums != NULL && hf->SectorChksums[0] != 0) + dwVerifyResult |= VERIFY_FILE_HAS_SECTOR_CRC; + } + + // Check if the entire file has been read + // No point in checking CRC32 and MD5 if not + // Skip checksum checks if the file has patches + if(dwTotalBytes == 0) + { + // Check CRC32 and MD5 only if there is no patches + if(hf->hfPatchFile == NULL) + { + // Check if the CRC32 matches. + if(dwFlags & SFILE_VERIFY_FILE_CRC) + { + // Only check the CRC32 if it is valid + if(pFileEntry->dwCrc32 != 0) + { + dwVerifyResult |= VERIFY_FILE_HAS_CHECKSUM; + if(dwCrc32 != pFileEntry->dwCrc32) + dwVerifyResult |= VERIFY_FILE_CHECKSUM_ERROR; + } + } + + // Check if MD5 matches + if(dwFlags & SFILE_VERIFY_FILE_MD5) + { + // Patch files have their MD5 saved in the patch info + pFileMd5 = (hf->pPatchInfo != NULL) ? hf->pPatchInfo->md5 : pFileEntry->md5; + md5_done(&md5_state, md5); + + // Only check the MD5 if it is valid + if(is_valid_md5(pFileMd5)) + { + dwVerifyResult |= VERIFY_FILE_HAS_MD5; + if(memcmp(md5, pFileMd5, MD5_DIGEST_SIZE)) + dwVerifyResult |= VERIFY_FILE_MD5_ERROR; + } + } + } + else + { + // Patched files are MD5-checked automatically + dwVerifyResult |= VERIFY_FILE_HAS_MD5; + } + } + else + { + dwVerifyResult |= VERIFY_READ_ERROR; + } + + SFileCloseFile(hFile); + } + else + { + // Remember that the file couldn't be open + dwVerifyResult |= VERIFY_OPEN_ERROR; + } + + // If the caller required CRC32 and/or MD5, give it to him + if(pdwCrc32 != NULL) + *pdwCrc32 = dwCrc32; + if(pMD5 != NULL) + memcpy(pMD5, md5, MD5_DIGEST_SIZE); + + return dwVerifyResult; +} + +//----------------------------------------------------------------------------- +// Public (exported) functions + +bool WINAPI SFileGetFileChecksums(HANDLE hMpq, const char * szFileName, LPDWORD pdwCrc32, char * pMD5) +{ + DWORD dwVerifyResult; + DWORD dwVerifyFlags = 0; + + if(pdwCrc32 != NULL) + dwVerifyFlags |= SFILE_VERIFY_FILE_CRC; + if(pMD5 != NULL) + dwVerifyFlags |= SFILE_VERIFY_FILE_MD5; + + dwVerifyResult = VerifyFile(hMpq, + szFileName, + pdwCrc32, + pMD5, + dwVerifyFlags); + + // If verification failed, return zero + if(dwVerifyResult & VERIFY_FILE_ERROR_MASK) + { + SetLastError(ERROR_FILE_CORRUPT); + return false; + } + + return true; +} + + +DWORD WINAPI SFileVerifyFile(HANDLE hMpq, const char * szFileName, DWORD dwFlags) +{ + return VerifyFile(hMpq, + szFileName, + NULL, + NULL, + dwFlags); +} + +// Verifies raw data of the archive Only works for MPQs version 4 or newer +int WINAPI SFileVerifyRawData(HANDLE hMpq, DWORD dwWhatToVerify, const char * szFileName) +{ + TMPQArchive * ha = (TMPQArchive *)hMpq; + TFileEntry * pFileEntry; + TMPQHeader * pHeader; + + // Verify input parameters + if(!IsValidMpqHandle(ha)) + return ERROR_INVALID_PARAMETER; + pHeader = ha->pHeader; + + // If the archive doesn't have raw data MD5, report it as OK + if(pHeader->dwRawChunkSize == 0) + return ERROR_SUCCESS; + + // If we have to verify MPQ header, do it + switch(dwWhatToVerify) + { + case SFILE_VERIFY_MPQ_HEADER: + + // Only if the header is of version 4 or newer + if(pHeader->dwHeaderSize >= (MPQ_HEADER_SIZE_V4 - MD5_DIGEST_SIZE)) + return VerifyRawMpqData(ha, 0, MPQ_HEADER_SIZE_V4 - MD5_DIGEST_SIZE); + return ERROR_SUCCESS; + + case SFILE_VERIFY_HET_TABLE: + + // Only if we have HET table + if(pHeader->HetTablePos64 && pHeader->HetTableSize64) + return VerifyRawMpqData(ha, pHeader->HetTablePos64, (DWORD)pHeader->HetTableSize64); + return ERROR_SUCCESS; + + case SFILE_VERIFY_BET_TABLE: + + // Only if we have BET table + if(pHeader->BetTablePos64 && pHeader->BetTableSize64) + return VerifyRawMpqData(ha, pHeader->BetTablePos64, (DWORD)pHeader->BetTableSize64); + return ERROR_SUCCESS; + + case SFILE_VERIFY_HASH_TABLE: + + // Hash table is not protected by MD5 + return ERROR_SUCCESS; + + case SFILE_VERIFY_BLOCK_TABLE: + + // Block table is not protected by MD5 + return ERROR_SUCCESS; + + case SFILE_VERIFY_HIBLOCK_TABLE: + + // It is unknown if the hi-block table is protected my MD5 or not. + return ERROR_SUCCESS; + + case SFILE_VERIFY_FILE: + + // Verify parameters + if(szFileName == NULL || *szFileName == 0) + return ERROR_INVALID_PARAMETER; + + // Get the offset of a file + pFileEntry = GetFileEntryLocale(ha, szFileName, lcFileLocale); + if(pFileEntry == NULL) + return ERROR_FILE_NOT_FOUND; + + return VerifyRawMpqData(ha, pFileEntry->ByteOffset, pFileEntry->dwCmpSize); + } + + return ERROR_INVALID_PARAMETER; +} + + +// Verifies the archive against the signature +DWORD WINAPI SFileVerifyArchive(HANDLE hMpq) +{ + MPQ_SIGNATURE_INFO si; + TMPQArchive * ha = (TMPQArchive *)hMpq; + + // Verify input parameters + if(!IsValidMpqHandle(ha)) + return ERROR_VERIFY_FAILED; + + // Get the MPQ signature and signature type + memset(&si, 0, sizeof(MPQ_SIGNATURE_INFO)); + if(!QueryMpqSignatureInfo(ha, &si)) + return ERROR_VERIFY_FAILED; + + // Verify the signature + switch(si.nSignatureType) + { + case SIGNATURE_TYPE_NONE: + return ERROR_NO_SIGNATURE; + + case SIGNATURE_TYPE_WEAK: + return VerifyWeakSignature(ha, &si); + + case SIGNATURE_TYPE_STRONG: + return VerifyStrongSignature(ha, &si); + } + + return ERROR_VERIFY_FAILED; +} diff --git a/dep/StormLib/src/StormCommon.h b/dep/StormLib/src/StormCommon.h new file mode 100644 index 00000000000..278c44ed810 --- /dev/null +++ b/dep/StormLib/src/StormCommon.h @@ -0,0 +1,270 @@ +/*****************************************************************************/ +/* SCommon.h Copyright (c) Ladislav Zezula 2003 */ +/*---------------------------------------------------------------------------*/ +/* Common functions for encryption/decryption from Storm.dll. Included by */ +/* SFile*** functions, do not include and do not use this file directly */ +/*---------------------------------------------------------------------------*/ +/* Date Ver Who Comment */ +/* -------- ---- --- ------- */ +/* 24.03.03 1.00 Lad The first version of SFileCommon.h */ +/* 12.06.04 1.00 Lad Renamed to SCommon.h */ +/* 06.09.10 1.00 Lad Renamed to StormCommon.h */ +/*****************************************************************************/ + +#ifndef __STORMCOMMON_H__ +#define __STORMCOMMON_H__ + +//----------------------------------------------------------------------------- +// Compression support + +// Include functions from Pkware Data Compression Library +#include "pklib/pklib.h" + +// Include functions from Huffmann compression +#include "huffman/huff.h" + +// Include functions from IMA ADPCM compression +#include "adpcm/adpcm.h" + +// Include functions from SPARSE compression +#include "sparse/sparse.h" + +// Include functions from LZMA compression +#include "lzma/C/LzmaEnc.h" +#include "lzma/C/LzmaDec.h" + +// Include functions from zlib +#ifndef __SYS_ZLIB + #include "zlib/zlib.h" +#else + #include +#endif + +// Include functions from bzlib +#ifndef __SYS_BZLIB + #include "bzip2/bzlib.h" +#else + #include +#endif + +//----------------------------------------------------------------------------- +// Cryptography support + +// Headers from LibTomCrypt +#include "libtomcrypt/src/headers/tomcrypt.h" + +// For HashStringJenkins +#include "jenkins/lookup.h" + +//----------------------------------------------------------------------------- +// StormLib private defines + +#define ID_MPQ_FILE 0x46494c45 // Used internally for checking TMPQFile ('FILE') + +#define MPQ_WEAK_SIGNATURE_SIZE 64 +#define MPQ_STRONG_SIGNATURE_SIZE 256 + +// Prevent problems with CRT "min" and "max" functions, +// as they are not defined on all platforms +#define STORMLIB_MIN(a, b) ((a < b) ? a : b) +#define STORMLIB_MAX(a, b) ((a > b) ? a : b) + +// Macro for building 64-bit file offset from two 32-bit +#define MAKE_OFFSET64(hi, lo) (((ULONGLONG)hi << 32) | lo) + +//----------------------------------------------------------------------------- +// Memory management +// +// We use our own macros for allocating/freeing memory. If you want +// to redefine them, please keep the following rules +// +// - The memory allocation must return NULL if not enough memory +// (i.e not to throw exception) +// - It is not necessary to fill the allocated buffer with zeros +// - Memory freeing function doesn't have to test the pointer to NULL. +// + +#if defined(_MSC_VER) && defined(_DEBUG) +__inline void * DebugMalloc(char * /* szFile */, int /* nLine */, size_t nSize) +{ +// return new BYTE[nSize]; + return HeapAlloc(GetProcessHeap(), 0, nSize); +} + +__inline void DebugFree(void * ptr) +{ +// delete [] ptr; + HeapFree(GetProcessHeap(), 0, ptr); +} + +#define STORM_ALLOC(type, nitems) (type *)DebugMalloc(__FILE__, __LINE__, (nitems) * sizeof(type)) +#define STORM_FREE(ptr) DebugFree(ptr) +#else + +#define STORM_ALLOC(type, nitems) (type *)malloc((nitems) * sizeof(type)) +#define STORM_FREE(ptr) free(ptr) + +#endif + +//----------------------------------------------------------------------------- +// StormLib internal global variables + +extern DWORD dwGlobalFlags; // Global StormLib flags +extern LCID lcFileLocale; // Preferred file locale + +//----------------------------------------------------------------------------- +// Encryption and decryption functions + +#define MPQ_HASH_TABLE_INDEX 0x000 +#define MPQ_HASH_NAME_A 0x100 +#define MPQ_HASH_NAME_B 0x200 +#define MPQ_HASH_FILE_KEY 0x300 + +DWORD HashString(const char * szFileName, DWORD dwHashType); + +void InitializeMpqCryptography(); + +DWORD GetHashTableSizeForFileCount(DWORD dwFileCount); + +bool IsPseudoFileName(const char * szFileName, LPDWORD pdwFileIndex); +ULONGLONG HashStringJenkins(const char * szFileName); + +int ConvertMpqHeaderToFormat4(TMPQArchive * ha, ULONGLONG FileSize, DWORD dwFlags); + +void EncryptMpqBlock(void * pvFileBlock, DWORD dwLength, DWORD dwKey); +void DecryptMpqBlock(void * pvFileBlock, DWORD dwLength, DWORD dwKey); + +DWORD DetectFileKeyBySectorSize(LPDWORD SectorOffsets, DWORD decrypted); +DWORD DetectFileKeyByContent(void * pvFileContent, DWORD dwFileSize); +DWORD DecryptFileKey(const char * szFileName, ULONGLONG MpqPos, DWORD dwFileSize, DWORD dwFlags); + +bool IsValidMD5(LPBYTE pbMd5); +bool VerifyDataBlockHash(void * pvDataBlock, DWORD cbDataBlock, LPBYTE expected_md5); +void CalculateDataBlockHash(void * pvDataBlock, DWORD cbDataBlock, LPBYTE md5_hash); + +//----------------------------------------------------------------------------- +// Handle validation functions + +bool IsValidMpqHandle(TMPQArchive * ha); +bool IsValidFileHandle(TMPQFile * hf); + +//----------------------------------------------------------------------------- +// Hash table and block table manipulation + +TMPQHash * GetFirstHashEntry(TMPQArchive * ha, const char * szFileName); +TMPQHash * GetNextHashEntry(TMPQArchive * ha, TMPQHash * pFirstHash, TMPQHash * pPrevHash); +DWORD AllocateHashEntry(TMPQArchive * ha, TFileEntry * pFileEntry); +DWORD AllocateHetEntry(TMPQArchive * ha, TFileEntry * pFileEntry); + +void FindFreeMpqSpace(TMPQArchive * ha, ULONGLONG * pFreeSpacePos); + +// Functions that load the HET abd BET tables +int CreateHashTable(TMPQArchive * ha, DWORD dwHashTableSize); +int LoadAnyHashTable(TMPQArchive * ha); +int BuildFileTable(TMPQArchive * ha, ULONGLONG FileSize); +int SaveMPQTables(TMPQArchive * ha); + +TMPQHetTable * CreateHetTable(DWORD dwMaxFileCount, DWORD dwHashBitSize, bool bCreateEmpty); +void FreeHetTable(TMPQHetTable * pHetTable); + +TMPQBetTable * CreateBetTable(DWORD dwMaxFileCount); +void FreeBetTable(TMPQBetTable * pBetTable); + +// Functions for finding files in the file table +TFileEntry * GetFileEntryAny(TMPQArchive * ha, const char * szFileName); +TFileEntry * GetFileEntryLocale(TMPQArchive * ha, const char * szFileName, LCID lcLocale); +TFileEntry * GetFileEntryExact(TMPQArchive * ha, const char * szFileName, LCID lcLocale); +TFileEntry * GetFileEntryByIndex(TMPQArchive * ha, DWORD dwIndex); + +// Allocates file name in the file entry +void AllocateFileName(TFileEntry * pFileEntry, const char * szFileName); + +// Allocates new file entry in the MPQ tables. Reuses existing, if possible +TFileEntry * FindFreeFileEntry(TMPQArchive * ha); +TFileEntry * AllocateFileEntry(TMPQArchive * ha, const char * szFileName, LCID lcLocale); +int RenameFileEntry(TMPQArchive * ha, TFileEntry * pFileEntry, const char * szNewFileName); +void ClearFileEntry(TMPQArchive * ha, TFileEntry * pFileEntry); +int FreeFileEntry(TMPQArchive * ha, TFileEntry * pFileEntry); + +// Invalidates entries for (listfile) and (attributes) +void InvalidateInternalFiles(TMPQArchive * ha); + +//----------------------------------------------------------------------------- +// Common functions - MPQ File + +TMPQFile * CreateMpqFile(TMPQArchive * ha); +int LoadMpqTable(TMPQArchive * ha, ULONGLONG ByteOffset, void * pvTable, DWORD dwCompressedSize, DWORD dwRealSize, DWORD dwKey); +int AllocateSectorBuffer(TMPQFile * hf); +int AllocatePatchInfo(TMPQFile * hf, bool bLoadFromFile); +int AllocateSectorOffsets(TMPQFile * hf, bool bLoadFromFile); +int AllocateSectorChecksums(TMPQFile * hf, bool bLoadFromFile); +void CalculateRawSectorOffset(ULONGLONG & RawFilePos, TMPQFile * hf, DWORD dwSectorOffset); +int WritePatchInfo(TMPQFile * hf); +int WriteSectorOffsets(TMPQFile * hf); +int WriteSectorChecksums(TMPQFile * hf); +int WriteMemDataMD5(TFileStream * pStream, ULONGLONG RawDataOffs, void * pvRawData, DWORD dwRawDataSize, DWORD dwChunkSize, LPDWORD pcbTotalSize); +int WriteMpqDataMD5(TFileStream * pStream, ULONGLONG RawDataOffs, DWORD dwRawDataSize, DWORD dwChunkSize); +void FreeMPQFile(TMPQFile *& hf); + +bool IsPatchData(const void * pvData, DWORD cbData, LPDWORD pdwPatchedFileSize); +int PatchFileData(TMPQFile * hf); + +void FreeMPQArchive(TMPQArchive *& ha); + +//----------------------------------------------------------------------------- +// Utility functions + +bool CheckWildCard(const char * szString, const char * szWildCard); +const char * GetPlainFileNameA(const char * szFileName); +const TCHAR * GetPlainFileNameT(const TCHAR * szFileName); +bool IsInternalMpqFileName(const char * szFileName); + +//----------------------------------------------------------------------------- +// Support for adding files to the MPQ + +int SFileAddFile_Init( + TMPQArchive * ha, + const char * szArchivedName, + ULONGLONG ft, + DWORD dwFileSize, + LCID lcLocale, + DWORD dwFlags, + TMPQFile ** phf + ); + +int SFileAddFile_Write( + TMPQFile * hf, + const void * pvData, + DWORD dwSize, + DWORD dwCompression + ); + +int SFileAddFile_Finish( + TMPQFile * hf + ); + +//----------------------------------------------------------------------------- +// Attributes support + +int SAttrLoadAttributes(TMPQArchive * ha); +int SAttrFileSaveToMpq(TMPQArchive * ha); + +//----------------------------------------------------------------------------- +// Listfile functions + +int SListFileSaveToMpq(TMPQArchive * ha); + +//----------------------------------------------------------------------------- +// Dump data support + +#ifdef __STORMLIB_DUMP_DATA__ +void DumpMpqHeader(TMPQHeader * pHeader); +void DumpHetAndBetTable(TMPQHetTable * pHetTable, TMPQBetTable * pBetTable); + +#else +#define DumpMpqHeader(h) /* */ +#define DumpHetAndBetTable(h, b) /* */ +#endif + +#endif // __STORMCOMMON_H__ + diff --git a/dep/StormLib/src/StormLib.h b/dep/StormLib/src/StormLib.h new file mode 100644 index 00000000000..1f75ffd26c1 --- /dev/null +++ b/dep/StormLib/src/StormLib.h @@ -0,0 +1,975 @@ +/*****************************************************************************/ +/* StormLib.h Copyright (c) Ladislav Zezula 1999-2010 */ +/*---------------------------------------------------------------------------*/ +/* StormLib library v 7.02 */ +/* */ +/* Author : Ladislav Zezula */ +/* E-mail : ladik@zezula.net */ +/* WWW : http://www.zezula.net */ +/*---------------------------------------------------------------------------*/ +/* Date Ver Who Comment */ +/* -------- ---- --- ------- */ +/* xx.xx.99 1.00 Lad Created */ +/* 24.03.03 2.50 Lad Version 2.50 */ +/* 02.04.03 3.00 Lad Version 3.00 with compression */ +/* 11.04.03 3.01 Lad Renamed to StormLib.h for compatibility with */ +/* original headers for Storm.dll */ +/* 10.05.03 3.02 Lad Added Pkware DCL compression */ +/* 26.05.03 4.00 Lad Completed all compressions */ +/* 18.06.03 4.01 Lad Added SFileSetFileLocale */ +/* Added SFileExtractFile */ +/* 26.07.03 4.02 Lad Implemented nameless rename and delete */ +/* 26.07.03 4.03 Lad Added support for protected MPQs */ +/* 28.08.03 4.10 Lad Fixed bugs that caused StormLib incorrectly work */ +/* with Diablo I savegames and with files having full */ +/* hash table */ +/* 08.12.03 4.11 DCH Fixed bug in reading file sector larger than 0x1000 */ +/* on certain files. */ +/* Fixed bug in AddFile with MPQ_FILE_REPLACE_EXISTING */ +/* (Thanx Daniel Chiamarello, dchiamarello@madvawes.com)*/ +/* 21.12.03 4.50 Lad Completed port for Mac */ +/* Fixed bug in compacting (if fsize is mul of 0x1000) */ +/* Fixed bug in SCompCompress */ +/* 27.05.04 4.51 Lad Changed memory management from new/delete to our */ +/* own macros */ +/* 22.06.04 4.60 Lad Optimized search. Support for multiple listfiles. */ +/* 30.09.04 4.61 Lad Fixed some bugs (Aaargh !!!) */ +/* Correctly works if HashTableSize > BlockTableSize */ +/* 29.12.04 4.70 Lad Fixed compatibility problem with MPQs from WoW */ +/* 14.07.05 5.00 Lad Added the BZLIB compression support */ +/* Added suport of files stored as single unit */ +/* 17.04.06 5.01 Lad Converted to MS Visual Studio 8.0 */ +/* Fixed issue with protected Warcraft 3 protected maps */ +/* 15.05.06 5.02 Lad Fixed issue with WoW 1.10+ */ +/* 07.09.06 5.10 Lad Fixed processing files longer than 2GB */ +/* 22.11.06 6.00 Lad Support for MPQ archives V2 */ +/* 12.06.07 6.10 Lad Support for (attributes) file */ +/* 10.09.07 6.12 Lad Support for MPQs protected by corrupting hash table */ +/* 03.12.07 6.13 Lad Support for MPQs with hash tbl size > block tbl size */ +/* 07.04.08 6.20 Lad Added SFileFlushArchive */ +/* 09.04.08 Lad Removed FilePointer variable from MPQ handle */ +/* structure, as it caused more problems than benefits */ +/* 12.05.08 6.22 Lad Support for w3xMaster map protector */ +/* 05.10.08 6.23 Lad Support for protectors who set negative values in */ +/* the table of file blocks */ +/* 26.05.09 6.24 Lad Fixed search for multiple lang files with deleted */ +/* entries */ +/* 03.09.09 6.25 Lad Fixed decompression bug in huffmann decompression */ +/* 22.03.10 6.50 Lad New compressions in Starcraft II (LZMA, sparse) */ +/* Fixed compacting MPQs that contain single unit files */ +/* 26.04.10 7.00 Lad Major rewrite */ +/* 08.06.10 7.10 Lad Support for partial MPQs */ +/* 08.07.10 7.11 Lad Support for MPQs v 3.0 */ +/* 20.08.10 7.20 Lad Support for opening multiple MPQs in patch mode */ +/* 20.09.10 8.00 Lad MPQs v 4, HET and BET tables */ +/* 07.01.11 8.01 Lad Write support for MPQs v 3 and 4 */ +/* 15.09.11 8.04 Lad Bug fixes, testing for Diablo III MPQs */ +/*****************************************************************************/ + +#ifndef __STORMLIB_H__ +#define __STORMLIB_H__ + +#ifdef _MSC_VER +#pragma warning(disable:4668) // 'XXX' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' +#pragma warning(disable:4820) // 'XXX' : '2' bytes padding added after data member 'XXX::yyy' +#endif + +#include "StormPort.h" + +#ifdef __cplusplus +extern "C" { +#endif + +//----------------------------------------------------------------------------- +// Use the apropriate library +// +// The library type is encoded in the library name as the following +// StormLibXYZ.lib +// +// X - D for Debug version, R for Release version +// Y - A for ANSI version, U for Unicode version +// Z - S for static-linked CRT library, D for multithreaded DLL CRT library +// + +#if 0 +#if defined(_MSC_VER) && !defined(__STORMLIB_SELF__) + + #ifdef _DEBUG // DEBUG VERSIONS + #ifndef _UNICODE + #ifdef _DLL + #pragma comment(lib, "StormLibDAD.lib") // Debug Ansi CRT-DLL version + #else + #pragma comment(lib, "StormLibDAS.lib") // Debug Ansi CRT-LIB version + #endif + #else + #ifdef _DLL + #pragma comment(lib, "StormLibDUD.lib") // Debug Unicode CRT-DLL version + #else + #pragma comment(lib, "StormLibDUS.lib") // Debug Unicode CRT-LIB version + #endif + #endif + #else // RELEASE VERSIONS + #ifndef _UNICODE + #ifdef _DLL + #pragma comment(lib, "StormLibRAD.lib") // Release Ansi CRT-DLL version + #else + #pragma comment(lib, "StormLibRAS.lib") // Release Ansi CRT-LIB version + #endif + #else + #ifdef _DLL + #pragma comment(lib, "StormLibRUD.lib") // Release Unicode CRT-DLL version + #else + #pragma comment(lib, "StormLibRUS.lib") // Release Unicode CRT-LIB version + #endif + #endif + #endif + +#endif +#endif + +//----------------------------------------------------------------------------- +// Defines + +#define ID_MPQ 0x1A51504D // MPQ archive header ID ('MPQ\x1A') +#define ID_MPQ_USERDATA 0x1B51504D // MPQ userdata entry ('MPQ\x1B') + +#define ERROR_AVI_FILE 10000 // No MPQ file, but AVI file. +#define ERROR_UNKNOWN_FILE_KEY 10001 // Returned by SFileReadFile when can't find file key +#define ERROR_CHECKSUM_ERROR 10002 // Returned by SFileReadFile when sector CRC doesn't match +#define ERROR_INTERNAL_FILE 10003 // The given operation is not allowed on internal file +#define ERROR_BASE_FILE_MISSING 10004 // The file is present as incremental patch file, but base file is missing +#define ERROR_MARKED_FOR_DELETE 10005 // The file was marked as "deleted" in the MPQ + +// Values for SFileCreateArchive +#define HASH_TABLE_SIZE_MIN 0x00000004 // Minimum acceptable hash table size +#define HASH_TABLE_SIZE_DEFAULT 0x00001000 // Default hash table size for empty MPQs +#define HASH_TABLE_SIZE_MAX 0x00080000 // Maximum acceptable hash table size + +#define HASH_ENTRY_DELETED 0xFFFFFFFE // Block index for deleted entry in the hash table +#define HASH_ENTRY_FREE 0xFFFFFFFF // Block index for free entry in the hash table + +#define HET_ENTRY_DELETED 0x80 // HET hash value for a deleted entry +#define HET_ENTRY_FREE 0x00 // HET hash value for free entry + +#define HASH_STATE_SIZE 0x60 // Size of LibTomCrypt's hash_state structure + +#define MPQ_PATCH_PREFIX_LEN 0x20 // Maximum length of the patch prefix + +// Values for TFileStream::Flags +#define STREAM_FLAG_READ_ONLY 0x01 // The stream is read only +#define STREAM_FLAG_PART_FILE 0x02 // The stream is a PART file. +#define STREAM_FLAG_ENCRYPTED_FILE 0x04 // The stream is an encrypted MPQ (MPQE). + +// Values for SFileOpenArchive +#define SFILE_OPEN_HARD_DISK_FILE 2 // Open the archive on HDD +#define SFILE_OPEN_CDROM_FILE 3 // Open the archive only if it is on CDROM + +// Values for SFileOpenFile +#define SFILE_OPEN_FROM_MPQ 0x00000000 // Open the file from the MPQ archive +#define SFILE_OPEN_PATCHED_FILE 0x00000001 // Open the file from the MPQ archive +#define SFILE_OPEN_ANY_LOCALE 0xFFFFFFFE // Reserved for StormLib internal use +#define SFILE_OPEN_LOCAL_FILE 0xFFFFFFFF // Open a local file + +// Flags for TMPQArchive::dwFlags +#define MPQ_FLAG_READ_ONLY 0x00000001 // If set, the MPQ has been open for read-only access +#define MPQ_FLAG_CHANGED 0x00000002 // If set, the MPQ tables have been changed +#define MPQ_FLAG_PROTECTED 0x00000004 // Set on protected MPQs (like W3M maps) +#define MPQ_FLAG_CHECK_SECTOR_CRC 0x0000008 // Checking sector CRC when reading files +#define MPQ_FLAG_NEED_FIX_SIZE 0x00000010 // Used during opening the archive +#define MPQ_FLAG_INV_LISTFILE 0x00000020 // If set, it means that the (listfile) has been invalidated +#define MPQ_FLAG_INV_ATTRIBUTES 0x00000040 // If set, it means that the (attributes) has been invalidated + +// Return value for SFilGetFileSize and SFileSetFilePointer +#define SFILE_INVALID_SIZE 0xFFFFFFFF +#define SFILE_INVALID_POS 0xFFFFFFFF +#define SFILE_INVALID_ATTRIBUTES 0xFFFFFFFF + +// Flags for SFileAddFile +#define MPQ_FILE_IMPLODE 0x00000100 // Implode method (By PKWARE Data Compression Library) +#define MPQ_FILE_COMPRESS 0x00000200 // Compress methods (By multiple methods) +#define MPQ_FILE_COMPRESSED 0x0000FF00 // File is compressed +#define MPQ_FILE_ENCRYPTED 0x00010000 // Indicates whether file is encrypted +#define MPQ_FILE_FIX_KEY 0x00020000 // File decryption key has to be fixed +#define MPQ_FILE_PATCH_FILE 0x00100000 // The file is a patch file. Raw file data begin with TPatchInfo structure +#define MPQ_FILE_SINGLE_UNIT 0x01000000 // File is stored as a single unit, rather than split into sectors (Thx, Quantam) +#define MPQ_FILE_DELETE_MARKER 0x02000000 // File is a deletion marker, indicating that the file no longer exists. +#define MPQ_FILE_SECTOR_CRC 0x04000000 // File has checksums for each sector. + // Ignored if file is not compressed or imploded. +#define MPQ_FILE_EXISTS 0x80000000 // Set if file exists, reset when the file was deleted +#define MPQ_FILE_REPLACEEXISTING 0x80000000 // Replace when the file exist (SFileAddFile) + +#define MPQ_FILE_VALID_FLAGS (MPQ_FILE_IMPLODE | \ + MPQ_FILE_COMPRESS | \ + MPQ_FILE_ENCRYPTED | \ + MPQ_FILE_FIX_KEY | \ + MPQ_FILE_PATCH_FILE | \ + MPQ_FILE_SINGLE_UNIT | \ + MPQ_FILE_DELETE_MARKER | \ + MPQ_FILE_SECTOR_CRC | \ + MPQ_FILE_EXISTS) + +// Compression types for multiple compressions +#define MPQ_COMPRESSION_HUFFMANN 0x01 // Huffmann compression (used on WAVE files only) +#define MPQ_COMPRESSION_ZLIB 0x02 // ZLIB compression +#define MPQ_COMPRESSION_PKWARE 0x08 // PKWARE DCL compression +#define MPQ_COMPRESSION_BZIP2 0x10 // BZIP2 compression (added in Warcraft III) +#define MPQ_COMPRESSION_SPARSE 0x20 // Sparse compression (added in Starcraft 2) +#define MPQ_COMPRESSION_ADPCM_MONO 0x40 // IMA ADPCM compression (mono) +#define MPQ_COMPRESSION_ADPCM_STEREO 0x80 // IMA ADPCM compression (stereo) + +// For backward compatibility +#define MPQ_COMPRESSION_WAVE_MONO 0x40 // IMA ADPCM compression (mono) +#define MPQ_COMPRESSION_WAVE_STEREO 0x80 // IMA ADPCM compression (stereo) + +// LZMA compression. Added in Starcraft 2. This value is NOT a combination of flags. +#define MPQ_COMPRESSION_LZMA 0x12 + +// Constants for SFileAddWave +#define MPQ_WAVE_QUALITY_HIGH 0 // Best quality, the worst compression +#define MPQ_WAVE_QUALITY_MEDIUM 1 // Medium quality, medium compression +#define MPQ_WAVE_QUALITY_LOW 2 // Low quality, the best compression + +// Signatures for HET and BET table +#define HET_TABLE_SIGNATURE 0x1A544548 // 'HET\x1a' +#define BET_TABLE_SIGNATURE 0x1A544542 // 'BET\x1a' + +// Decryption keys for MPQ tables +#define MPQ_KEY_HASH_TABLE 0xC3AF3770 // Obtained by HashString("(hash table)", MPQ_HASH_FILE_KEY) +#define MPQ_KEY_BLOCK_TABLE 0xEC83B3A3 // Obtained by HashString("(block table)", MPQ_HASH_FILE_KEY) + +// Constants for SFileGetFileInfo +#define SFILE_INFO_ARCHIVE_NAME 1 // MPQ size (value from header) +#define SFILE_INFO_ARCHIVE_SIZE 2 // MPQ size (value from header) +#define SFILE_INFO_MAX_FILE_COUNT 3 // Max number of files in the MPQ +#define SFILE_INFO_HASH_TABLE_SIZE 4 // Size of hash table, in entries +#define SFILE_INFO_BLOCK_TABLE_SIZE 5 // Number of entries in the block table +#define SFILE_INFO_SECTOR_SIZE 6 // Size of file sector (in bytes) +#define SFILE_INFO_HASH_TABLE 7 // Pointer to Hash table (TMPQHash *) +#define SFILE_INFO_BLOCK_TABLE 8 // Pointer to Block Table (TMPQBlock *) +#define SFILE_INFO_NUM_FILES 9 // Real number of files within archive +#define SFILE_INFO_STREAM_FLAGS 10 // Stream flags for the MPQ. See STREAM_FLAG_XXX +#define SFILE_INFO_IS_READ_ONLY 11 // TRUE of the MPQ was open as read only +//------ +#define SFILE_INFO_HASH_INDEX 100 // Hash index of file in MPQ +#define SFILE_INFO_CODENAME1 101 // The first codename of the file +#define SFILE_INFO_CODENAME2 102 // The second codename of the file +#define SFILE_INFO_LOCALEID 103 // Locale ID of file in MPQ +#define SFILE_INFO_BLOCKINDEX 104 // Index to Block Table +#define SFILE_INFO_FILE_SIZE 105 // Original file size (from the block table) +#define SFILE_INFO_COMPRESSED_SIZE 106 // Compressed file size (from the block table) +#define SFILE_INFO_FLAGS 107 // File flags +#define SFILE_INFO_POSITION 108 // File position within archive +#define SFILE_INFO_KEY 109 // File decryption key +#define SFILE_INFO_KEY_UNFIXED 110 // Decryption key not fixed to file pos and size +#define SFILE_INFO_FILETIME 111 // TMPQFileTime +#define SFILE_INFO_PATCH_CHAIN 112 // Chain of patches + +#define LISTFILE_NAME "(listfile)" // Name of internal listfile +#define SIGNATURE_NAME "(signature)" // Name of internal signature +#define ATTRIBUTES_NAME "(attributes)" // Name of internal attributes file +#define PATCH_METADATA_NAME "(patch_metadata)" + +#define STORMLIB_VERSION 0x0804 // Current version of StormLib (8.04) +#define STORMLIB_VERSION_STRING "8.04" + +#define MPQ_FORMAT_VERSION_1 0 // Up to The Burning Crusade +#define MPQ_FORMAT_VERSION_2 1 // The Burning Crusade and newer +#define MPQ_FORMAT_VERSION_3 2 // WoW Cataclysm Beta +#define MPQ_FORMAT_VERSION_4 3 // WoW Cataclysm and newer + +// Flags for MPQ attributes +#define MPQ_ATTRIBUTE_CRC32 0x00000001 // The "(attributes)" contains CRC32 for each file +#define MPQ_ATTRIBUTE_FILETIME 0x00000002 // The "(attributes)" contains file time for each file +#define MPQ_ATTRIBUTE_MD5 0x00000004 // The "(attributes)" contains MD5 for each file +#define MPQ_ATTRIBUTE_ALL 0x00000007 // Summary mask + +#define MPQ_ATTRIBUTES_V1 100 // (attributes) format version 1.00 + +// Flags for SFileOpenArchive +#define MPQ_OPEN_NO_LISTFILE 0x0010 // Don't load the internal listfile +#define MPQ_OPEN_NO_ATTRIBUTES 0x0020 // Don't open the attributes +#define MPQ_OPEN_FORCE_MPQ_V1 0x0040 // Always open the archive as MPQ v 1.00, ignore the "wFormatVersion" variable in the header +#define MPQ_OPEN_CHECK_SECTOR_CRC 0x0080 // On files with MPQ_FILE_SECTOR_CRC, the CRC will be checked when reading file +#define MPQ_OPEN_READ_ONLY 0x0100 // Open the archive for read-only access +#define MPQ_OPEN_ENCRYPTED 0x0200 // Opens an encrypted MPQ archive (Example: Starcraft II installation) + +// Flags for SFileCreateArchive +#define MPQ_CREATE_ATTRIBUTES 0x00000001 // Also add the (attributes) file +#define MPQ_CREATE_ARCHIVE_V1 0x00000000 // Creates archive of version 1 (size up to 4GB) +#define MPQ_CREATE_ARCHIVE_V2 0x00010000 // Creates archive of version 2 (larger than 4 GB) +#define MPQ_CREATE_ARCHIVE_V3 0x00020000 // Creates archive of version 3 +#define MPQ_CREATE_ARCHIVE_V4 0x00030000 // Creates archive of version 4 +#define MPQ_CREATE_ARCHIVE_VMASK 0x000F0000 // Mask for archive version + +// Flags for SFileVerifyFile +#define SFILE_VERIFY_SECTOR_CRC 0x0001 // Verify sector checksum for the file, if available +#define SFILE_VERIFY_FILE_CRC 0x0002 // Verify file CRC, if available +#define SFILE_VERIFY_FILE_MD5 0x0004 // Verify file MD5, if available +#define SFILE_VERIFY_RAW_MD5 0x0008 // Verify raw file MD5, if available +#define SFILE_VERIFY_ALL 0x000F // Verify every checksum possible + +// Return values for SFileVerifyFile +#define VERIFY_OPEN_ERROR 0x0001 // Failed to open the file +#define VERIFY_READ_ERROR 0x0002 // Failed to read all data from the file +#define VERIFY_FILE_HAS_SECTOR_CRC 0x0004 // File has sector CRC +#define VERIFY_FILE_SECTOR_CRC_ERROR 0x0008 // Sector CRC check failed +#define VERIFY_FILE_HAS_CHECKSUM 0x0010 // File has CRC32 +#define VERIFY_FILE_CHECKSUM_ERROR 0x0020 // CRC32 check failed +#define VERIFY_FILE_HAS_MD5 0x0040 // File has data MD5 +#define VERIFY_FILE_MD5_ERROR 0x0080 // MD5 check failed +#define VERIFY_FILE_HAS_RAW_MD5 0x0100 // File has raw data MD5 +#define VERIFY_FILE_RAW_MD5_ERROR 0x0200 // Raw MD5 check failed +#define VERIFY_FILE_ERROR_MASK (VERIFY_OPEN_ERROR | VERIFY_READ_ERROR | VERIFY_FILE_SECTOR_CRC_ERROR | VERIFY_FILE_CHECKSUM_ERROR | VERIFY_FILE_MD5_ERROR | VERIFY_FILE_RAW_MD5_ERROR) + +// Flags for SFileVerifyRawData (for MPQs version 4.0 or higher) +#define SFILE_VERIFY_MPQ_HEADER 0x0001 // Verify raw MPQ header +#define SFILE_VERIFY_HET_TABLE 0x0002 // Verify raw data of the HET table +#define SFILE_VERIFY_BET_TABLE 0x0003 // Verify raw data of the BET table +#define SFILE_VERIFY_HASH_TABLE 0x0004 // Verify raw data of the hash table +#define SFILE_VERIFY_BLOCK_TABLE 0x0005 // Verify raw data of the block table +#define SFILE_VERIFY_HIBLOCK_TABLE 0x0006 // Verify raw data of the hi-block table +#define SFILE_VERIFY_FILE 0x0007 // Verify raw data of a file + +// Return values for SFileVerifyArchive +#define ERROR_NO_SIGNATURE 0 // There is no signature in the MPQ +#define ERROR_VERIFY_FAILED 1 // There was an error during verifying signature (like no memory) +#define ERROR_WEAK_SIGNATURE_OK 2 // There is a weak signature and sign check passed +#define ERROR_WEAK_SIGNATURE_ERROR 3 // There is a weak signature but sign check failed +#define ERROR_STRONG_SIGNATURE_OK 4 // There is a strong signature and sign check passed +#define ERROR_STRONG_SIGNATURE_ERROR 5 // There is a strong signature but sign check failed + +#ifndef MD5_DIGEST_SIZE +#define MD5_DIGEST_SIZE 0x10 +#endif + +#ifndef SHA1_DIGEST_SIZE +#define SHA1_DIGEST_SIZE 0x14 // 160 bits +#endif + +#ifndef LANG_NEUTRAL +#define LANG_NEUTRAL 0x00 // Neutral locale +#endif + +//----------------------------------------------------------------------------- +// Callback functions + +// Values for compact callback +#define CCB_CHECKING_FILES 1 // Checking archive (dwParam1 = current, dwParam2 = total) +#define CCB_CHECKING_HASH_TABLE 2 // Checking hash table (dwParam1 = current, dwParam2 = total) +#define CCB_COPYING_NON_MPQ_DATA 3 // Copying non-MPQ data: No params used +#define CCB_COMPACTING_FILES 4 // Compacting archive (dwParam1 = current, dwParam2 = total) +#define CCB_CLOSING_ARCHIVE 5 // Closing archive: No params used + +typedef void (WINAPI * SFILE_ADDFILE_CALLBACK)(void * pvUserData, DWORD dwBytesWritten, DWORD dwTotalBytes, bool bFinalCall); +typedef void (WINAPI * SFILE_COMPACT_CALLBACK)(void * pvUserData, DWORD dwWorkType, ULONGLONG BytesProcessed, ULONGLONG TotalBytes); + +//----------------------------------------------------------------------------- +// Stream support - structures + +struct TFileStream; + +typedef bool (*STREAM_GETPOS)( + struct TFileStream * pStream, // Pointer to an open stream + ULONGLONG & ByteOffset // Pointer to store current file position + ); + +typedef bool (*STREAM_READ)( + struct TFileStream * pStream, // Pointer to an open stream + ULONGLONG * pByteOffset, // Pointer to file byte offset. If NULL, it reads from the current position + void * pvBuffer, // Pointer to data to be read + DWORD dwBytesToRead // Number of bytes to read from the file + ); + +typedef bool (*STREAM_WRITE)( + struct TFileStream * pStream, // Pointer to an open stream + ULONGLONG * pByteOffset, // Pointer to file byte offset. If NULL, it writes to the current position + const void * pvBuffer, // Pointer to data to be written + DWORD dwBytesToWrite // Number of bytes to read from the file + ); + +typedef bool (*STREAM_GETSIZE)( + struct TFileStream * pStream, // Pointer to an open stream + ULONGLONG & FileSize // Receives the file size, in bytes + ); + +typedef bool (*STREAM_SETSIZE)( + struct TFileStream * pStream, // Pointer to an open stream + ULONGLONG FileSize // New size for the file, in bytes + ); + +// Common stream structure. Can be variable length +struct TFileStream +{ + ULONGLONG RawFilePos; // Current position in raw file + HANDLE hFile; // File handle. Do not use directly. + TCHAR szFileName[MAX_PATH];// Name of the file + BYTE StreamFlags; // See STREAM_FLAG_XXXX + + STREAM_GETPOS StreamGetPos; // Pointer to function that returns current file position + STREAM_READ StreamRead; // Pointer to stream read function for this archive. Do not use directly. + STREAM_WRITE StreamWrite; // Pointer to stream write function for this archive. Do not use directly. + STREAM_GETSIZE StreamGetSize; // Pointer to function returning file size + STREAM_SETSIZE StreamSetSize; // Pointer to function changing file size + + // Extra members may follow +}; + +//----------------------------------------------------------------------------- +// Structure for bit arrays used for HET and BET tables + +struct TBitArray +{ + void GetBits(unsigned int nBitPosition, unsigned int nBitLength, void * pvBuffer, int nResultSize); + void SetBits(unsigned int nBitPosition, unsigned int nBitLength, void * pvBuffer, int nResultSize); + + DWORD NumberOfBits; // Total number of bits that are available + BYTE Elements[1]; // Array of elements (variable length) +}; + +//----------------------------------------------------------------------------- +// Structures related to MPQ format +// +// Note: All structures in this header file are supposed to remain private +// to StormLib. The structures may (and will) change over time, as the MPQ +// file format evolves. Programmers directly using these structures need to +// be aware of this. And the last, but not least, NEVER do any modifications +// to those structures directly, always use SFile* functions. +// + +#define MPQ_HEADER_SIZE_V1 0x20 +#define MPQ_HEADER_SIZE_V2 0x2C +#define MPQ_HEADER_SIZE_V3 0x44 +#define MPQ_HEADER_SIZE_V4 0xD0 + +struct TMPQUserData +{ + // The ID_MPQ_USERDATA ('MPQ\x1B') signature + DWORD dwID; + + // Maximum size of the user data + DWORD cbUserDataSize; + + // Offset of the MPQ header, relative to the begin of this header + DWORD dwHeaderOffs; + + // Appears to be size of user data header (Starcraft II maps) + DWORD cbUserDataHeader; +}; + +// MPQ file header +// +// We have to make sure that the header is packed OK. +// Reason: A 64-bit integer at the beginning of 3.0 part, +// which is offset 0x2C +#pragma pack(push, 1) +struct TMPQHeader +{ + // The ID_MPQ ('MPQ\x1A') signature + DWORD dwID; + + // Size of the archive header + DWORD dwHeaderSize; + + // 32-bit size of MPQ archive + // This field is deprecated in the Burning Crusade MoPaQ format, and the size of the archive + // is calculated as the size from the beginning of the archive to the end of the hash table, + // block table, or hi-block table (whichever is largest). + DWORD dwArchiveSize; + + // 0 = Format 1 (up to The Burning Crusade) + // 1 = Format 2 (The Burning Crusade and newer) + // 2 = Format 3 (WoW - Cataclysm beta or newer) + // 3 = Format 4 (WoW - Cataclysm beta or newer) + USHORT wFormatVersion; + + // Power of two exponent specifying the number of 512-byte disk sectors in each file sector + // in the archive. The size of each file sector in the archive is 512 * 2 ^ wSectorSize. + USHORT wSectorSize; + + // Offset to the beginning of the hash table, relative to the beginning of the archive. + DWORD dwHashTablePos; + + // Offset to the beginning of the block table, relative to the beginning of the archive. + DWORD dwBlockTablePos; + + // Number of entries in the hash table. Must be a power of two, and must be less than 2^16 for + // the original MoPaQ format, or less than 2^20 for the Burning Crusade format. + DWORD dwHashTableSize; + + // Number of entries in the block table + DWORD dwBlockTableSize; + + //-- MPQ HEADER v 2 ------------------------------------------- + + // Offset to the beginning of array of 16-bit high parts of file offsets. + ULONGLONG HiBlockTablePos64; + + // High 16 bits of the hash table offset for large archives. + USHORT wHashTablePosHi; + + // High 16 bits of the block table offset for large archives. + USHORT wBlockTablePosHi; + + //-- MPQ HEADER v 3 ------------------------------------------- + + // 64-bit version of the archive size + ULONGLONG ArchiveSize64; + + // 64-bit position of the BET table + ULONGLONG BetTablePos64; + + // 64-bit position of the HET table + ULONGLONG HetTablePos64; + + //-- MPQ HEADER v 4 ------------------------------------------- + + // Compressed size of the hash table + ULONGLONG HashTableSize64; + + // Compressed size of the block table + ULONGLONG BlockTableSize64; + + // Compressed size of the hi-block table + ULONGLONG HiBlockTableSize64; + + // Compressed size of the HET block + ULONGLONG HetTableSize64; + + // Compressed size of the BET block + ULONGLONG BetTableSize64; + + // Size of raw data chunk to calculate MD5. + // MD5 of each data chunk follows the raw file data. + DWORD dwRawChunkSize; + + // MD5 of MPQ tables + unsigned char MD5_BlockTable[MD5_DIGEST_SIZE]; // MD5 of the block table before decryption + unsigned char MD5_HashTable[MD5_DIGEST_SIZE]; // MD5 of the hash table before decryption + unsigned char MD5_HiBlockTable[MD5_DIGEST_SIZE]; // MD5 of the hi-block table + unsigned char MD5_BetTable[MD5_DIGEST_SIZE]; // MD5 of the BET table before decryption + unsigned char MD5_HetTable[MD5_DIGEST_SIZE]; // MD5 of the HET table before decryption + unsigned char MD5_MpqHeader[MD5_DIGEST_SIZE]; // MD5 of the MPQ header from signature to (including) MD5_HetTable +}; +#pragma pack(pop) + + +// Hash entry. All files in the archive are searched by their hashes. +struct TMPQHash +{ + // The hash of the file path, using method A. + DWORD dwName1; + + // The hash of the file path, using method B. + DWORD dwName2; + +#ifdef PLATFORM_LITTLE_ENDIAN + + // The language of the file. This is a Windows LANGID data type, and uses the same values. + // 0 indicates the default language (American English), or that the file is language-neutral. + USHORT lcLocale; + + // The platform the file is used for. 0 indicates the default platform. + // No other values have been observed. + // Note: wPlatform is actually just BYTE, but since it has never been used, we don't care. + USHORT wPlatform; + +#else + + USHORT wPlatform; + USHORT lcLocale; + +#endif + + // If the hash table entry is valid, this is the index into the block table of the file. + // Otherwise, one of the following two values: + // - FFFFFFFFh: Hash table entry is empty, and has always been empty. + // Terminates searches for a given file. + // - FFFFFFFEh: Hash table entry is empty, but was valid at some point (a deleted file). + // Does not terminate searches for a given file. + DWORD dwBlockIndex; +}; + + +// File description block contains informations about the file +struct TMPQBlock +{ + // Offset of the beginning of the file, relative to the beginning of the archive. + DWORD dwFilePos; + + // Compressed file size + DWORD dwCSize; + + // Only valid if the block is a file; otherwise meaningless, and should be 0. + // If the file is compressed, this is the size of the uncompressed file data. + DWORD dwFSize; + + // Flags for the file. See MPQ_FILE_XXXX constants + DWORD dwFlags; +}; + +// Patch file information, preceding the sector offset table +struct TPatchInfo +{ + DWORD dwLength; // Length of patch info header, in bytes + DWORD dwFlags; // Flags. 0x80000000 = MD5 (?) + DWORD dwDataSize; // Uncompressed size of the patch file + BYTE md5[0x10]; // MD5 of the entire patch file after decompression + + // Followed by the sector table (variable length) +}; + +// Header for PTCH files +struct TPatchHeader +{ + //-- PATCH header ----------------------------------- + DWORD dwSignature; // 'PTCH' + DWORD dwSizeOfPatchData; // Size of the entire patch (decompressed) + DWORD dwSizeBeforePatch; // Size of the file before patch + DWORD dwSizeAfterPatch; // Size of file after patch + + //-- MD5 block -------------------------------------- + DWORD dwMD5; // 'MD5_' + DWORD dwMd5BlockSize; // Size of the MD5 block, including the signature and size itself + BYTE md5_before_patch[0x10]; // MD5 of the original (unpached) file + BYTE md5_after_patch[0x10]; // MD5 of the patched file + + //-- XFRM block ------------------------------------- + DWORD dwXFRM; // 'XFRM' + DWORD dwXfrmBlockSize; // Size of the XFRM block, includes XFRM header and patch data + DWORD dwPatchType; // Type of patch ('BSD0' or 'COPY') + + // Followed by the patch data +}; + +#define SIZE_OF_XFRM_HEADER 0x0C + +// This is the combined file entry for maintaining file list in the MPQ. +// This structure is combined from block table, hi-block table, +// (attributes) file and from (listfile). +struct TFileEntry +{ + ULONGLONG ByteOffset; // Position of the file content in the MPQ, relative to the MPQ header + ULONGLONG FileTime; // FileTime from the (attributes) file. 0 if not present. + ULONGLONG BetHash; // Lower part of the file name hash. Only used when the MPQ has BET table. + DWORD dwHashIndex; // Index to the hash table. Only used when the MPQ has classic hash table + DWORD dwHetIndex; // Index to the HET table. Only used when the MPQ has HET table + DWORD dwFileSize; // Decompressed size of the file + DWORD dwCmpSize; // Compressed size of the file (i.e., size of the file data in the MPQ) + DWORD dwFlags; // File flags (from block table) + USHORT lcLocale; // Locale ID for the file + USHORT wPlatform; // Platform ID for the file + DWORD dwCrc32; // CRC32 from (attributes) file. 0 if not present. + unsigned char md5[MD5_DIGEST_SIZE]; // File MD5 from the (attributes) file. 0 if not present. + char * szFileName; // File name. NULL if not known. +}; + +// Common header for HET and BET tables +struct TMPQExtTable +{ + DWORD dwSignature; // 'HET\x1A' or 'BET\x1A' + DWORD dwVersion; // Version. Seems to be always 1 + DWORD dwDataSize; // Size of the contained table + + // Followed by the table header + // Followed by the table data + +}; + +// Structure for parsed HET table +struct TMPQHetTable +{ + TBitArray * pBetIndexes; // Bit array of indexes to BET tables + LPBYTE pHetHashes; // Array of HET hashes. Each entry has size of 1 byte + ULONGLONG AndMask64; // AND mask used for calculating file name hash + ULONGLONG OrMask64; // OR mask used for setting the highest bit of the file name hash + + DWORD dwIndexSizeTotal; // Total size of one entry in pBetIndexes (in bits) + DWORD dwIndexSizeExtra; // Extra bits in the entry in pBetIndexes + DWORD dwIndexSize; // Effective size of one entry in pBetIndexes (in bits) + DWORD dwMaxFileCount; // Maximum number of files in the MPQ + DWORD dwHashTableSize; // Number of entries in pBetHashes + DWORD dwHashBitSize; // Effective number of bits in the hash +}; + +// Structure for parsed BET table +struct TMPQBetTable +{ + TBitArray * pBetHashes; // Array of BET hashes + TBitArray * pFileTable; // Bit-based file table + LPDWORD pFileFlags; // Array of file flags + + DWORD dwTableEntrySize; // Size of one table entry, in bits + DWORD dwBitIndex_FilePos; // Bit index of the file position in the table entry + DWORD dwBitIndex_FileSize; // Bit index of the file size in the table entry + DWORD dwBitIndex_CmpSize; // Bit index of the compressed size in the table entry + DWORD dwBitIndex_FlagIndex; // Bit index of the flag index in the table entry + DWORD dwBitIndex_Unknown; // Bit index of ??? in the table entry + DWORD dwBitCount_FilePos; // Size of file offset (in bits) within table entry + DWORD dwBitCount_FileSize; // Size of file size (in bits) within table entry + DWORD dwBitCount_CmpSize; // Size of compressed file size (in bits) within table entry + DWORD dwBitCount_FlagIndex; // Size of flag index (in bits) within table entry + DWORD dwBitCount_Unknown; // Size of ??? (in bits) within table entry + DWORD dwBetHashSizeTotal; // Total size of bet hash + DWORD dwBetHashSizeExtra; // Extra bits in the bet hash + DWORD dwBetHashSize; // Effective size of the bet hash + DWORD dwFileCount; // Number of files (usually equal to maximum number of files) + DWORD dwFlagCount; // Number of entries in pFileFlags +}; + +// Archive handle structure +struct TMPQArchive +{ + TFileStream * pStream; // Open stream for the MPQ + + ULONGLONG UserDataPos; // Position of user data (relative to the begin of the file) + ULONGLONG MpqPos; // MPQ header offset (relative to the begin of the file) + + TMPQArchive * haPatch; // Pointer to patch archive, if any + TMPQArchive * haBase; // Pointer to base ("previous version") archive, if any + char szPatchPrefix[MPQ_PATCH_PREFIX_LEN]; // Prefix for file names in patch MPQs + size_t cchPatchPrefix; // Length of the patch prefix, in characters + + TMPQUserData * pUserData; // MPQ user data (NULL if not present in the file) + TMPQHeader * pHeader; // MPQ file header + TMPQHash * pHashTable; // Hash table + TMPQHetTable * pHetTable; // Het table + TFileEntry * pFileTable; // File table + + TMPQUserData UserData; // MPQ user data. Valid only when ID_MPQ_USERDATA has been found + BYTE HeaderData[MPQ_HEADER_SIZE_V4]; // Storage for MPQ header + + DWORD dwHETBlockSize; + DWORD dwBETBlockSize; + DWORD dwFileTableSize; // Current size of the file table, e.g. index of the entry past the last occupied one + DWORD dwMaxFileCount; // Maximum number of files in the MPQ + DWORD dwSectorSize; // Default size of one file sector + DWORD dwFileFlags1; // Flags for (listfile) + DWORD dwFileFlags2; // Flags for (attributes) + DWORD dwAttrFlags; // Flags for the (attributes) file, see MPQ_ATTRIBUTE_XXX + DWORD dwFlags; // See MPQ_FLAG_XXXXX +}; + +// File handle structure +struct TMPQFile +{ + TFileStream * pStream; // File stream. Only used on local files + TMPQArchive * ha; // Archive handle + TFileEntry * pFileEntry; // File entry for the file + DWORD dwFileKey; // Decryption key + DWORD dwFilePos; // Current file position + ULONGLONG RawFilePos; // Offset in MPQ archive (relative to file begin) + ULONGLONG MpqFilePos; // Offset in MPQ archive (relative to MPQ header) + DWORD dwMagic; // 'FILE' + + TMPQFile * hfPatchFile; // Pointer to opened patch file + TPatchHeader * pPatchHeader; // Patch header. Only used if the file is a patch file + LPBYTE pbFileData; // Loaded and patched file data. Only used if the file is a patch file + DWORD cbFileData; // Size of loaded patched data + + TPatchInfo * pPatchInfo; // Patch info block, preceding the sector table + DWORD * SectorOffsets; // Position of each file sector, relative to the begin of the file. Only for compressed files. + DWORD * SectorChksums; // Array of sector checksums (either ADLER32 or MD5) values for each file sector + DWORD dwSectorCount; // Number of sectors in the file + DWORD dwPatchedFileSize; // Size of patched file. Used when saving patch file to the MPQ + DWORD dwDataSize; // Size of data in the file (on patch files, this differs from file size in block table entry) + + LPBYTE pbFileSector; // Last loaded file sector. For single unit files, entire file content + DWORD dwSectorOffs; // File position of currently loaded file sector + DWORD dwSectorSize; // Size of the file sector. For single unit files, this is equal to the file size + + unsigned char hctx[HASH_STATE_SIZE];// Hash state for MD5. Used when saving file to MPQ + DWORD dwCrc32; // CRC32 value, used when saving file to MPQ + BYTE PreviousCompression; // Compression of previous sector + + bool bLoadedSectorCRCs; // If true, we already tried to load sector CRCs + bool bCheckSectorCRCs; // If true, then SFileReadFile will check sector CRCs when reading the file + bool bIsWriteHandle; // If true, this handle has been created by SFileCreateFile + bool bErrorOccured; // If true, then at least one error occured during saving the file to the archive +}; + +// Structure for SFileFindFirstFile and SFileFindNextFile +typedef struct _SFILE_FIND_DATA +{ + char cFileName[MAX_PATH]; // Full name of the found file + char * szPlainName; // Plain name of the found file + DWORD dwHashIndex; // Hash table index for the file + DWORD dwBlockIndex; // Block table index for the file + DWORD dwFileSize; // File size in bytes + DWORD dwFileFlags; // MPQ file flags + DWORD dwCompSize; // Compressed file size + DWORD dwFileTimeLo; // Low 32-bits of the file time (0 if not present) + DWORD dwFileTimeHi; // High 32-bits of the file time (0 if not present) + LCID lcLocale; // Locale version + +} SFILE_FIND_DATA, *PSFILE_FIND_DATA; + +//----------------------------------------------------------------------------- +// Stream support - functions + +TFileStream * FileStream_CreateFile(const TCHAR * szFileName); +TFileStream * FileStream_OpenFile(const TCHAR * szFileName, bool bWriteAccess); +TFileStream * FileStream_OpenEncrypted(const TCHAR * szFileName); +bool FileStream_GetPos(TFileStream * pStream, ULONGLONG & ByteOffset); +bool FileStream_Read(TFileStream * pStream, ULONGLONG * pByteOffset, void * pvBuffer, DWORD dwBytesToRead); +bool FileStream_Write(TFileStream * pStream, ULONGLONG * pByteOffset, const void * pvBuffer, DWORD dwBytesToWrite); +bool FileStream_GetLastWriteTime(TFileStream * pStream, ULONGLONG * pFT); +bool FileStream_GetSize(TFileStream * pStream, ULONGLONG & FileSize); +bool FileStream_SetSize(TFileStream * pStream, ULONGLONG NewFileSize); +bool FileStream_MoveFile(TFileStream * pStream, TFileStream * pTempStream); +void FileStream_Close(TFileStream * pStream); + +//----------------------------------------------------------------------------- +// Functions prototypes for Storm.dll + +// Typedefs for functions exported by Storm.dll +typedef LCID (WINAPI * SFILESETLOCALE)(LCID); +typedef bool (WINAPI * SFILEOPENARCHIVE)(const char *, DWORD, DWORD, HANDLE *); +typedef bool (WINAPI * SFILECLOSEARCHIVE)(HANDLE); +typedef bool (WINAPI * SFILEOPENFILEEX)(HANDLE, const char *, DWORD, HANDLE *); +typedef bool (WINAPI * SFILECLOSEFILE)(HANDLE); +typedef DWORD (WINAPI * SFILEGETFILESIZE)(HANDLE, LPDWORD); +typedef DWORD (WINAPI * SFILESETFILEPOINTER)(HANDLE, LONG, LONG *, DWORD); +typedef bool (WINAPI * SFILEREADFILE)(HANDLE, void *, DWORD, LPDWORD, LPOVERLAPPED); + +//----------------------------------------------------------------------------- +// Functions for manipulation with StormLib global flags + +#define SFILE_FLAG_ALLOW_WRITE_SHARE 0x00000001 // When a MPQ is open for write by StormLib, + // it is allowed to open it for write with another application. + +DWORD WINAPI SFileGetGlobalFlags(); +DWORD WINAPI SFileSetGlobalFlags(DWORD dwNewFlags); + +LCID WINAPI SFileGetLocale(); +LCID WINAPI SFileSetLocale(LCID lcNewLocale); + +//----------------------------------------------------------------------------- +// Functions for archive manipulation + +bool WINAPI SFileOpenArchive(const TCHAR * szMpqName, DWORD dwPriority, DWORD dwFlags, HANDLE * phMpq); +bool WINAPI SFileCreateArchive(const TCHAR * szMpqName, DWORD dwFlags, DWORD dwMaxFileCount, HANDLE * phMpq); + +bool WINAPI SFileFlushArchive(HANDLE hMpq); +bool WINAPI SFileCloseArchive(HANDLE hMpq); + +// Adds another listfile into MPQ. The currently added listfile(s) remain, +// so you can use this API to combining more listfiles. +// Note that this function is internally called by SFileFindFirstFile +int WINAPI SFileAddListFile(HANDLE hMpq, const char * szListFile); + +// Archive compacting +bool WINAPI SFileSetCompactCallback(HANDLE hMpq, SFILE_COMPACT_CALLBACK CompactCB, void * pvData); +bool WINAPI SFileCompactArchive(HANDLE hMpq, const char * szListFile = NULL, bool bReserved = 0); + +// Changing the maximum file count +DWORD WINAPI SFileGetMaxFileCount(HANDLE hMpq); +bool WINAPI SFileSetMaxFileCount(HANDLE hMpq, DWORD dwMaxFileCount); + +// Changing (attributes) file +DWORD WINAPI SFileGetAttributes(HANDLE hMpq); +bool WINAPI SFileSetAttributes(HANDLE hMpq, DWORD dwFlags); +bool WINAPI SFileUpdateFileAttributes(HANDLE hMpq, const char * szFileName); + +//----------------------------------------------------------------------------- +// Functions for manipulation with patch archives + +bool WINAPI SFileOpenPatchArchive(HANDLE hMpq, const TCHAR * szPatchMpqName, const char * szPatchPathPrefix, DWORD dwFlags); +bool WINAPI SFileIsPatchedArchive(HANDLE hMpq); + +//----------------------------------------------------------------------------- +// Functions for file manipulation + +// Reading from MPQ file +bool WINAPI SFileOpenFileEx(HANDLE hMpq, const char * szFileName, DWORD dwSearchScope, HANDLE * phFile); +DWORD WINAPI SFileGetFileSize(HANDLE hFile, LPDWORD pdwFileSizeHigh = NULL); +DWORD WINAPI SFileSetFilePointer(HANDLE hFile, LONG lFilePos, LONG * plFilePosHigh, DWORD dwMoveMethod); +bool WINAPI SFileReadFile(HANDLE hFile, void * lpBuffer, DWORD dwToRead, LPDWORD pdwRead = NULL, LPOVERLAPPED lpOverlapped = NULL); +bool WINAPI SFileCloseFile(HANDLE hFile); + +// Retrieving info about the file +bool WINAPI SFileHasFile(HANDLE hMpq, const char * szFileName); +bool WINAPI SFileGetFileName(HANDLE hFile, char * szFileName); +bool WINAPI SFileGetFileInfo(HANDLE hMpqOrFile, DWORD dwInfoType, void * pvFileInfo, DWORD cbFileInfo, LPDWORD pcbLengthNeeded = NULL); + +// High-level extract function +bool WINAPI SFileExtractFile(HANDLE hMpq, const char * szToExtract, const TCHAR * szExtracted, DWORD dwSearchScope = SFILE_OPEN_FROM_MPQ); + +//----------------------------------------------------------------------------- +// Functions for file and archive verification + +// Generates file CRC32 +bool WINAPI SFileGetFileChecksums(HANDLE hMpq, const char * szFileName, LPDWORD pdwCrc32, char * pMD5); + +// Verifies file against its checksums stored in (attributes) attributes (depending on dwFlags). +// For dwFlags, use one or more of MPQ_ATTRIBUTE_MD5 +DWORD WINAPI SFileVerifyFile(HANDLE hMpq, const char * szFileName, DWORD dwFlags); + +// Verifies raw data of the archive. Only works for MPQs version 4 or newer +int WINAPI SFileVerifyRawData(HANDLE hMpq, DWORD dwWhatToVerify, const char * szFileName); + +// Verifies the signature, if present +DWORD WINAPI SFileVerifyArchive(HANDLE hMpq); + +//----------------------------------------------------------------------------- +// Functions for file searching + +HANDLE WINAPI SFileFindFirstFile(HANDLE hMpq, const char * szMask, SFILE_FIND_DATA * lpFindFileData, const char * szListFile); +bool WINAPI SFileFindNextFile(HANDLE hFind, SFILE_FIND_DATA * lpFindFileData); +bool WINAPI SFileFindClose(HANDLE hFind); + +HANDLE WINAPI SListFileFindFirstFile(HANDLE hMpq, const char * szListFile, const char * szMask, SFILE_FIND_DATA * lpFindFileData); +bool WINAPI SListFileFindNextFile(HANDLE hFind, SFILE_FIND_DATA * lpFindFileData); +bool WINAPI SListFileFindClose(HANDLE hFind); + +// Locale support +int WINAPI SFileEnumLocales(HANDLE hMpq, const char * szFileName, LCID * plcLocales, LPDWORD pdwMaxLocales, DWORD dwSearchScope); + +//----------------------------------------------------------------------------- +// Support for adding files to the MPQ + +bool WINAPI SFileCreateFile(HANDLE hMpq, const char * szArchivedName, ULONGLONG FileTime, DWORD dwFileSize, LCID lcLocale, DWORD dwFlags, HANDLE * phFile); +bool WINAPI SFileWriteFile(HANDLE hFile, const void * pvData, DWORD dwSize, DWORD dwCompression); +bool WINAPI SFileFinishFile(HANDLE hFile); + +bool WINAPI SFileAddFileEx(HANDLE hMpq, const TCHAR * szFileName, const char * szArchivedName, DWORD dwFlags, DWORD dwCompression, DWORD dwCompressionNext = 0xFFFFFFFF); +bool WINAPI SFileAddFile(HANDLE hMpq, const TCHAR * szFileName, const char * szArchivedName, DWORD dwFlags); +bool WINAPI SFileAddWave(HANDLE hMpq, const TCHAR * szFileName, const char * szArchivedName, DWORD dwFlags, DWORD dwQuality); +bool WINAPI SFileRemoveFile(HANDLE hMpq, const char * szFileName, DWORD dwSearchScope = SFILE_OPEN_FROM_MPQ); +bool WINAPI SFileRenameFile(HANDLE hMpq, const char * szOldFileName, const char * szNewFileName); +bool WINAPI SFileSetFileLocale(HANDLE hFile, LCID lcNewLocale); +bool WINAPI SFileSetDataCompression(DWORD DataCompression); + +bool WINAPI SFileSetAddFileCallback(HANDLE hMpq, SFILE_ADDFILE_CALLBACK AddFileCB, void * pvData); + +//----------------------------------------------------------------------------- +// Compression and decompression + +int WINAPI SCompImplode (char * pbOutBuffer, int * pcbOutBuffer, char * pbInBuffer, int cbInBuffer); +int WINAPI SCompExplode (char * pbOutBuffer, int * pcbOutBuffer, char * pbInBuffer, int cbInBuffer); +int WINAPI SCompCompress (char * pbOutBuffer, int * pcbOutBuffer, char * pbInBuffer, int cbInBuffer, unsigned uCompressionMask, int nCmpType, int nCmpLevel); +int WINAPI SCompDecompress (char * pbOutBuffer, int * pcbOutBuffer, char * pbInBuffer, int cbInBuffer); + +//----------------------------------------------------------------------------- +// Non-Windows support for SetLastError/GetLastError + +#ifndef PLATFORM_WINDOWS + +void SetLastError(int err); +int GetLastError(); + +#endif + +//----------------------------------------------------------------------------- +// Functions from Storm.dll. They use slightly different names for keeping +// possibility to use them together with StormLib (StormXXX instead of SFileXXX) + +#ifdef __LINK_STORM_DLL__ + #define STORM_ALTERNATE_NAMES // Force storm_dll.h to use alternate fnc names + #include "..\storm_dll\storm_dll.h" +#endif // __LINK_STORM_DLL__ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // __STORMLIB_H__ diff --git a/dep/StormLib/src/StormPort.h b/dep/StormLib/src/StormPort.h new file mode 100644 index 00000000000..a8f5835bdfb --- /dev/null +++ b/dep/StormLib/src/StormPort.h @@ -0,0 +1,235 @@ +/*****************************************************************************/ +/* StormPort.h Copyright (c) Marko Friedemann 2001 */ +/*---------------------------------------------------------------------------*/ +/* Portability module for the StormLib library. Contains a wrapper symbols */ +/* to make the compilation under Linux work */ +/* */ +/* Author: Marko Friedemann */ +/* Created at: Mon Jan 29 18:26:01 CEST 2001 */ +/* Computer: whiplash.flachland-chemnitz.de */ +/* System: Linux 2.4.0 on i686 */ +/* */ +/* Author: Sam Wilkins */ +/* System: Mac OS X and port to big endian processor */ +/* */ +/*---------------------------------------------------------------------------*/ +/* Date Ver Who Comment */ +/* -------- ---- --- ------- */ +/* 29.01.01 1.00 Mar Created */ +/* 24.03.03 1.01 Lad Some cosmetic changes */ +/* 12.11.03 1.02 Dan Macintosh compatibility */ +/* 24.07.04 1.03 Sam Mac OS X compatibility */ +/* 22.11.06 1.04 Sam Mac OS X compatibility (for StormLib 6.0) */ +/* 31.12.06 1.05 XPinguin Full GNU/Linux compatibility */ +/*****************************************************************************/ + +#ifndef __STORMPORT_H__ +#define __STORMPORT_H__ + +#ifndef __cplusplus + #define bool char + #define true 1 + #define false 0 +#endif + +// Defines for Windows +#if !defined(PLATFORM_DEFINED) && (defined(WIN32) || defined(WIN64)) + + // In MSVC 8.0, there are some functions declared as deprecated. + #if _MSC_VER >= 1400 + #define _CRT_SECURE_NO_DEPRECATE + #define _CRT_NON_CONFORMING_SWPRINTFS + #endif + + #include + #include + #include + #include + #include + #define PLATFORM_LITTLE_ENDIAN + + #ifdef WIN64 + #define PLATFORM_64BIT + #else + #define PLATFORM_32BIT + #endif + + #define PLATFORM_WINDOWS + #define PLATFORM_DEFINED // The platform is known now + +#endif + +// Defines for Mac Carbon +#if !defined(PLATFORM_DEFINED) && defined(__APPLE__) // Mac Carbon API + + // Macintosh using Carbon + #include // Mac OS X + + #define PKEXPORT + #define __SYS_ZLIB + #define __SYS_BZLIB + + #ifndef __BIG_ENDIAN__ + #define PLATFORM_LITTLE_ENDIAN // Apple is now making Macs with Intel CPUs + #endif + + #define PLATFORM_MAC + #define PLATFORM_DEFINED // The platform is known now + +#endif + +// Assumption: we are not on Windows nor Macintosh, so this must be linux *grin* +#if !defined(PLATFORM_DEFINED) + + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + + #define PLATFORM_LITTLE_ENDIAN + #define PLATFORM_LINUX + #define PLATFORM_DEFINED + +#endif + +// Definition of Windows-specific structures for non-Windows platforms +#ifndef PLATFORM_WINDOWS + #if __LP64__ + #define PLATFORM_64BIT + #else + #define PLATFORM_32BIT + #endif + + // Typedefs for ANSI C + typedef unsigned char BYTE; + typedef unsigned short USHORT; + typedef int LONG; + typedef unsigned int DWORD; + typedef unsigned long DWORD_PTR; + typedef long LONG_PTR; + typedef long INT_PTR; + typedef long long LONGLONG; + typedef unsigned long long ULONGLONG; + typedef void * HANDLE; + typedef void * LPOVERLAPPED; // Unsupported on Linux and Mac + typedef char TCHAR; + typedef unsigned int LCID; + typedef LONG * PLONG; + typedef DWORD * LPDWORD; + typedef BYTE * LPBYTE; + + #ifdef PLATFORM_32BIT + #define _LZMA_UINT32_IS_ULONG + #endif + + // Some Windows-specific defines + #ifndef MAX_PATH + #define MAX_PATH 1024 + #endif + + #define WINAPI + + #define FILE_BEGIN SEEK_SET + #define FILE_CURRENT SEEK_CUR + #define FILE_END SEEK_END + + #define _T(x) x + #define _tcslen strlen + #define _tcscpy strcpy + #define _tcscat strcat + #define _tcsrchr strrchr + #define _tprintf printf + #define _stprintf sprintf + #define _tremove remove + + #define _stricmp strcasecmp + #define _strnicmp strncasecmp + +#endif // !WIN32 + +// Platform-specific error codes +#ifdef PLATFORM_MAC + #define ERROR_SUCCESS noErr + #define ERROR_FILE_NOT_FOUND fnfErr + #define ERROR_ACCESS_DENIED permErr + #define ERROR_INVALID_HANDLE rfNumErr + #define ERROR_NOT_ENOUGH_MEMORY mFulErr + #define ERROR_BAD_FORMAT 200 // Returned when the opened file is in format that is not recognized by StormLib + #define ERROR_NO_MORE_FILES errFSNoMoreItems + #define ERROR_HANDLE_EOF eofErr + #define ERROR_NOT_SUPPORTED 201 + #define ERROR_INVALID_PARAMETER paramErr + #define ERROR_DISK_FULL dskFulErr + #define ERROR_ALREADY_EXISTS dupFNErr + #define ERROR_CAN_NOT_COMPLETE 202 // A generic error, when any operation fails from an unknown reason + #define ERROR_FILE_CORRUPT 203 // At any point when there is bad data format in the file + #define ERROR_INSUFFICIENT_BUFFER errFSBadBuffer +#endif + +#ifdef PLATFORM_LINUX + #define ERROR_SUCCESS 0 + #define ERROR_FILE_NOT_FOUND ENOENT + #define ERROR_ACCESS_DENIED EPERM + #define ERROR_INVALID_HANDLE EBADF + #define ERROR_NOT_ENOUGH_MEMORY ENOMEM + #define ERROR_BAD_FORMAT 105 // No such error code under Linux + #define ERROR_NO_MORE_FILES 106 + #define ERROR_HANDLE_EOF 107 // No such error code under Linux + #define ERROR_NOT_SUPPORTED ENOTSUP + #define ERROR_INVALID_PARAMETER EINVAL + #define ERROR_DISK_FULL ENOSPC + #define ERROR_ALREADY_EXISTS EEXIST + #define ERROR_CAN_NOT_COMPLETE 108 // No such error code under Linux + #define ERROR_FILE_CORRUPT 109 // No such error code under Linux + #define ERROR_INSUFFICIENT_BUFFER ENOBUFS +#endif + +#ifdef PLATFORM_LITTLE_ENDIAN + #define BSWAP_INT16_UNSIGNED(a) (a) + #define BSWAP_INT16_SIGNED(a) (a) + #define BSWAP_INT32_UNSIGNED(a) (a) + #define BSWAP_INT32_SIGNED(a) (a) + #define BSWAP_INT64_SIGNED(a) (a) + #define BSWAP_INT64_UNSIGNED(a) (a) + #define BSWAP_ARRAY16_UNSIGNED(a,b) {} + #define BSWAP_ARRAY32_UNSIGNED(a,b) {} + #define BSWAP_ARRAY64_UNSIGNED(a,b) {} + #define BSWAP_PART_HEADER(a) {} + #define BSWAP_TMPQUSERDATA(a) {} + #define BSWAP_TMPQHEADER(a) {} +#else + int16_t SwapInt16(uint16_t); + uint16_t SwapUInt16(uint16_t); + int32_t SwapInt32(uint32_t); + uint32_t SwapUInt32(uint32_t); + int64_t SwapInt64(uint64_t); + uint64_t SwapUInt64(uint64_t); + void ConvertUInt16Buffer(void * ptr, size_t length); + void ConvertUInt32Buffer(void * ptr, size_t length); + void ConvertUInt64Buffer(void * ptr, size_t length); + void ConvertPartHeader(void * partHeader); + void ConvertTMPQUserData(void *userData); + void ConvertTMPQHeader(void *header); + #define BSWAP_INT16_SIGNED(a) SwapInt16((a)) + #define BSWAP_INT16_UNSIGNED(a) SwapUInt16((a)) + #define BSWAP_INT32_SIGNED(a) SwapInt32((a)) + #define BSWAP_INT32_UNSIGNED(a) SwapUInt32((a)) + #define BSWAP_INT64_SIGNED(a) SwapInt64((a)) + #define BSWAP_INT64_UNSIGNED(a) SwapUInt64((a)) + #define BSWAP_ARRAY16_UNSIGNED(a,b) ConvertUInt16Buffer((a),(b)) + #define BSWAP_ARRAY32_UNSIGNED(a,b) ConvertUInt32Buffer((a),(b)) + #define BSWAP_ARRAY64_UNSIGNED(a,b) ConvertUInt64Buffer((a),(b)) + #define BSWAP_PART_HEADER(a) ConvertPartHeader(a) + #define BSWAP_TMPQUSERDATA(a) ConvertTMPQUserData((a)) + #define BSWAP_TMPQHEADER(a) ConvertTMPQHeader((a)) +#endif + +#endif // __STORMPORT_H__ diff --git a/dep/StormLib/src/adpcm/adpcm.cpp b/dep/StormLib/src/adpcm/adpcm.cpp new file mode 100644 index 00000000000..c43d2234c18 --- /dev/null +++ b/dep/StormLib/src/adpcm/adpcm.cpp @@ -0,0 +1,357 @@ +/*****************************************************************************/ +/* adpcm.cpp Copyright (c) Ladislav Zezula 2003 */ +/*---------------------------------------------------------------------------*/ +/* This module contains implementation of adpcm decompression method used by */ +/* Storm.dll to decompress WAVE files. Thanks to Tom Amigo for releasing */ +/* his sources. */ +/*---------------------------------------------------------------------------*/ +/* Date Ver Who Comment */ +/* -------- ---- --- ------- */ +/* 11.03.03 1.00 Lad Splitted from Pkware.cpp */ +/* 20.05.03 2.00 Lad Added compression */ +/* 19.11.03 2.01 Dan Big endian handling */ +/*****************************************************************************/ + +#include "adpcm.h" + +//------------------------------------------------------------------------------ +// Structures + +union TByteAndWordPtr +{ + short * pw; + unsigned char * pb; +}; + +union TWordAndByteArray +{ + short w; + unsigned char b[2]; +}; + +//----------------------------------------------------------------------------- +// Tables necessary dor decompression + +static long Table1503F120[] = +{ + 0xFFFFFFFF, 0x00000000, 0xFFFFFFFF, 0x00000004, 0xFFFFFFFF, 0x00000002, 0xFFFFFFFF, 0x00000006, + 0xFFFFFFFF, 0x00000001, 0xFFFFFFFF, 0x00000005, 0xFFFFFFFF, 0x00000003, 0xFFFFFFFF, 0x00000007, + 0xFFFFFFFF, 0x00000001, 0xFFFFFFFF, 0x00000005, 0xFFFFFFFF, 0x00000003, 0xFFFFFFFF, 0x00000007, + 0xFFFFFFFF, 0x00000002, 0xFFFFFFFF, 0x00000004, 0xFFFFFFFF, 0x00000006, 0xFFFFFFFF, 0x00000008 +}; + +static long step_table[] = +{ + 0x00000007, 0x00000008, 0x00000009, 0x0000000A, 0x0000000B, 0x0000000C, 0x0000000D, 0x0000000E, + 0x00000010, 0x00000011, 0x00000013, 0x00000015, 0x00000017, 0x00000019, 0x0000001C, 0x0000001F, + 0x00000022, 0x00000025, 0x00000029, 0x0000002D, 0x00000032, 0x00000037, 0x0000003C, 0x00000042, + 0x00000049, 0x00000050, 0x00000058, 0x00000061, 0x0000006B, 0x00000076, 0x00000082, 0x0000008F, + 0x0000009D, 0x000000AD, 0x000000BE, 0x000000D1, 0x000000E6, 0x000000FD, 0x00000117, 0x00000133, + 0x00000151, 0x00000173, 0x00000198, 0x000001C1, 0x000001EE, 0x00000220, 0x00000256, 0x00000292, + 0x000002D4, 0x0000031C, 0x0000036C, 0x000003C3, 0x00000424, 0x0000048E, 0x00000502, 0x00000583, + 0x00000610, 0x000006AB, 0x00000756, 0x00000812, 0x000008E0, 0x000009C3, 0x00000ABD, 0x00000BD0, + 0x00000CFF, 0x00000E4C, 0x00000FBA, 0x0000114C, 0x00001307, 0x000014EE, 0x00001706, 0x00001954, + 0x00001BDC, 0x00001EA5, 0x000021B6, 0x00002515, 0x000028CA, 0x00002CDF, 0x0000315B, 0x0000364B, + 0x00003BB9, 0x000041B2, 0x00004844, 0x00004F7E, 0x00005771, 0x0000602F, 0x000069CE, 0x00007462, + 0x00007FFF +}; + +//---------------------------------------------------------------------------- +// CompressWave + +// 1500EF70 +int CompressADPCM(unsigned char * pbOutBuffer, int dwOutLength, short * pwInBuffer, int dwInLength, int nChannels, int nCmpLevel) +// ECX EDX +{ + TWordAndByteArray Wcmp; + TByteAndWordPtr out; // Pointer to the output buffer + long SInt32Array1[2]; + long SInt32Array2[2]; + long SInt32Array3[2]; + long nBytesRemains = dwOutLength; // Number of bytes remaining + long nWordsRemains; // Number of words remaining +// unsigned char * pbSaveOutBuffer; // Copy of output buffer (actually not used) + unsigned long dwBitBuff; + unsigned long dwStopBit; + unsigned long dwBit; + unsigned long ebx; + unsigned long esi; + long nTableValue; + long nOneWord; + long var_1C; + long var_2C; + int nLength; + int nIndex; + int nValue; + + // If less than 2 bytes remain, don't decompress anything +// pbSaveOutBuffer = pbOutBuffer; + out.pb = pbOutBuffer; + if(nBytesRemains < 2) + return 2; + + Wcmp.b[1] = (unsigned char)(nCmpLevel - 1); + Wcmp.b[0] = (unsigned char)0; + + *out.pw++ = BSWAP_INT16_SIGNED(Wcmp.w); + if((out.pb - pbOutBuffer + (nChannels * 2)) > nBytesRemains) + return (int)(out.pb - pbOutBuffer + (nChannels * 2)); + + SInt32Array1[0] = SInt32Array1[1] = 0x2C; + + for(int i = 0; i < nChannels; i++) + { + nOneWord = BSWAP_INT16_SIGNED(*pwInBuffer++); + *out.pw++ = BSWAP_INT16_SIGNED((short)nOneWord); + SInt32Array2[i] = nOneWord; + } + + // Weird. But it's there + nLength = dwInLength; + if(nLength < 0) // mov eax, dwInLength; cdq; sub eax, edx; + nLength++; + + nLength = (nLength / 2) - (int)(out.pb - pbOutBuffer); + nLength = (nLength < 0) ? 0 : nLength; + + nIndex = nChannels - 1; // edi + nWordsRemains = dwInLength / 2; // eax + + // ebx - nChannels + // ecx - pwOutPos + for(int chnl = nChannels; chnl < nWordsRemains; chnl++) + { + // 1500F030 + if((out.pb - pbOutBuffer + 2) > nBytesRemains) + return (int)(out.pb - pbOutBuffer + 2); + + // Switch index + if(nChannels == 2) + nIndex = (nIndex == 0) ? 1 : 0; + + // Load one word from the input stream + nOneWord = BSWAP_INT16_SIGNED(*pwInBuffer++); // ecx - nOneWord + SInt32Array3[nIndex] = nOneWord; + + // esi - SInt32Array2[nIndex] + // eax - nValue + nValue = nOneWord - SInt32Array2[nIndex]; + nValue = (nValue < 0) ? ((nValue ^ 0xFFFFFFFF) + 1) : nValue; + + ebx = (nOneWord >= SInt32Array2[nIndex]) ? 0 : 0x40; + + // esi - SInt32Array2[nIndex] + // edx - step_table[SInt32Array2[nIndex]] + // edi - (step_table[SInt32Array1[nIndex]] >> nCmpLevel) + nTableValue = step_table[SInt32Array1[nIndex]]; + dwStopBit = (unsigned long)nCmpLevel; + + // edi - nIndex; + if(nValue < (nTableValue >> nCmpLevel)) + { + if(SInt32Array1[nIndex] != 0) + SInt32Array1[nIndex]--; + *out.pb++ = 0x80; + } + else + { + while(nValue > nTableValue * 2) + { + if(SInt32Array1[nIndex] >= 0x58 || nLength == 0) + break; + + SInt32Array1[nIndex] += 8; + if(SInt32Array1[nIndex] > 0x58) + SInt32Array1[nIndex] = 0x58; + + nTableValue = step_table[SInt32Array1[nIndex]]; + *out.pb++ = 0x81; + nLength--; + } + + var_2C = nTableValue >> Wcmp.b[1]; + dwBitBuff = 0; + + esi = (1 << (dwStopBit - 2)); + dwStopBit = (esi <= 0x20) ? esi : 0x20; + + for(var_1C = 0, dwBit = 1; ; dwBit <<= 1) + { +// esi = var_1C + nTableValue; + if((var_1C + nTableValue) <= nValue) + { + var_1C += nTableValue; + dwBitBuff |= dwBit; + } + if(dwBit == dwStopBit) + break; + + nTableValue >>= 1; + } + + nValue = SInt32Array2[nIndex]; + if(ebx != 0) + { + nValue -= (var_1C + var_2C); + if(nValue < -32768) + nValue = -32768; + } + else + { + nValue += (var_1C + var_2C); + if(nValue > 32767) + nValue = 32767; + } + + SInt32Array2[nIndex] = nValue; + *out.pb++ = (unsigned char)(dwBitBuff | ebx); + nTableValue = Table1503F120[dwBitBuff & 0x1F]; + SInt32Array1[nIndex] = SInt32Array1[nIndex] + nTableValue; + if(SInt32Array1[nIndex] < 0) + SInt32Array1[nIndex] = 0; + else if(SInt32Array1[nIndex] > 0x58) + SInt32Array1[nIndex] = 0x58; + } + } + + return (int)(out.pb - pbOutBuffer); +} + +//---------------------------------------------------------------------------- +// DecompressADPCM + +// 1500F230 +int DecompressADPCM(unsigned char * pbOutBuffer, int dwOutLength, unsigned char * pbInBuffer, int dwInLength, int nChannels) +{ + TByteAndWordPtr out; // Output buffer + TByteAndWordPtr in; + unsigned char * pbInBufferEnd = (pbInBuffer + dwInLength); + long SInt32Array1[2]; + long SInt32Array2[2]; + long nOneWord; + int dwOutLengthCopy = dwOutLength; + int nIndex; + + SInt32Array1[0] = SInt32Array1[1] = 0x2C; + out.pb = pbOutBuffer; + in.pb = pbInBuffer; + in.pw++; + + // Fill the Uint32Array2 array by channel values. + for(int i = 0; i < nChannels; i++) + { + nOneWord = BSWAP_INT16_SIGNED(*in.pw++); + SInt32Array2[i] = nOneWord; + if(dwOutLengthCopy < 2) + return (int)(out.pb - pbOutBuffer); + + *out.pw++ = BSWAP_INT16_SIGNED((short)nOneWord); + dwOutLengthCopy -= sizeof(short); + } + + // Get the initial index + nIndex = nChannels - 1; + + // Perform the decompression + while(in.pb < pbInBufferEnd) + { + unsigned char nOneByte = *in.pb++; + + // Switch index + if(nChannels == 2) + nIndex = (nIndex == 0) ? 1 : 0; + + // 1500F2A2: Get one byte from input buffer + if(nOneByte & 0x80) + { + switch(nOneByte & 0x7F) + { + case 0: // 1500F315 + if(SInt32Array1[nIndex] != 0) + SInt32Array1[nIndex]--; + + if(dwOutLengthCopy < 2) + return (int)(out.pb - pbOutBuffer); + + *out.pw++ = BSWAP_INT16_SIGNED((unsigned short)SInt32Array2[nIndex]); + dwOutLength -= sizeof(unsigned short); + break; + + case 1: // 1500F2E8 + SInt32Array1[nIndex] += 8; + if(SInt32Array1[nIndex] > 0x58) + SInt32Array1[nIndex] = 0x58; + + if(nChannels == 2) + nIndex = (nIndex == 0) ? 1 : 0; + break; + + case 2: // 1500F41E + break; + + default: // 1500F2C4 + SInt32Array1[nIndex] -= 8; + if(SInt32Array1[nIndex] < 0) + SInt32Array1[nIndex] = 0; + + if(nChannels == 2) + nIndex = (nIndex == 0) ? 1 : 0; + break; + } + } + else + { + // 1500F349 + long temp1 = step_table[SInt32Array1[nIndex]]; // EDI + long temp2 = temp1 >> pbInBuffer[1]; // ESI + long temp3 = SInt32Array2[nIndex]; // ECX + + if(nOneByte & 0x01) // EBX = nOneByte + temp2 += (temp1 >> 0); + + if(nOneByte & 0x02) + temp2 += (temp1 >> 1); + + if(nOneByte & 0x04) + temp2 += (temp1 >> 2); + + if(nOneByte & 0x08) + temp2 += (temp1 >> 3); + + if(nOneByte & 0x10) + temp2 += (temp1 >> 4); + + if(nOneByte & 0x20) + temp2 += (temp1 >> 5); + + if(nOneByte & 0x40) + { + temp3 = temp3 - temp2; + if(temp3 <= -32768) + temp3 = -32768; + } + else + { + temp3 = temp3 + temp2; + if(temp3 >= 32767) + temp3 = 32767; + } + + SInt32Array2[nIndex] = temp3; + if(dwOutLength < 2) + break; + + // Store the output 16-bit value + *out.pw++ = BSWAP_INT16_SIGNED((short)SInt32Array2[nIndex]); + dwOutLength -= 2; + + SInt32Array1[nIndex] += Table1503F120[nOneByte & 0x1F]; + + if(SInt32Array1[nIndex] < 0) + SInt32Array1[nIndex] = 0; + else if(SInt32Array1[nIndex] > 0x58) + SInt32Array1[nIndex] = 0x58; + } + } + return (int)(out.pb - pbOutBuffer); +} diff --git a/dep/StormLib/src/adpcm/adpcm.h b/dep/StormLib/src/adpcm/adpcm.h new file mode 100644 index 00000000000..beb96159720 --- /dev/null +++ b/dep/StormLib/src/adpcm/adpcm.h @@ -0,0 +1,22 @@ +/*****************************************************************************/ +/* adpcm.h Copyright (c) Ladislav Zezula 2003 */ +/*---------------------------------------------------------------------------*/ +/* Header file for adpcm decompress functions */ +/*---------------------------------------------------------------------------*/ +/* Date Ver Who Comment */ +/* -------- ---- --- ------- */ +/* 31.03.03 1.00 Lad The first version of adpcm.h */ +/*****************************************************************************/ + +#ifndef __ADPCM_H__ +#define __ADPCM_H__ + +//----------------------------------------------------------------------------- +// Functions + +#include "../StormPort.h" + +int CompressADPCM (unsigned char * pbOutBuffer, int dwOutLength, short * pwInBuffer, int dwInLength, int nCmpType, int nChannels); +int DecompressADPCM(unsigned char * pbOutBuffer, int dwOutLength, unsigned char * pbInBuffer, int dwInLength, int nChannels); + +#endif // __ADPCM_H__ diff --git a/dep/StormLib/src/bzip2/blocksort.c b/dep/StormLib/src/bzip2/blocksort.c new file mode 100644 index 00000000000..bd2dec157fa --- /dev/null +++ b/dep/StormLib/src/bzip2/blocksort.c @@ -0,0 +1,1094 @@ + +/*-------------------------------------------------------------*/ +/*--- Block sorting machinery ---*/ +/*--- blocksort.c ---*/ +/*-------------------------------------------------------------*/ + +/* ------------------------------------------------------------------ + This file is part of bzip2/libbzip2, a program and library for + lossless, block-sorting data compression. + + bzip2/libbzip2 version 1.0.5 of 10 December 2007 + Copyright (C) 1996-2007 Julian Seward + + Please read the WARNING, DISCLAIMER and PATENTS sections in the + README file. + + This program is released under the terms of the license contained + in the file LICENSE. + ------------------------------------------------------------------ */ + + +#include "bzlib_private.h" + +/*---------------------------------------------*/ +/*--- Fallback O(N log(N)^2) sorting ---*/ +/*--- algorithm, for repetitive blocks ---*/ +/*---------------------------------------------*/ + +/*---------------------------------------------*/ +static +__inline__ +void fallbackSimpleSort ( UInt32* fmap, + UInt32* eclass, + Int32 lo, + Int32 hi ) +{ + Int32 i, j, tmp; + UInt32 ec_tmp; + + if (lo == hi) return; + + if (hi - lo > 3) { + for ( i = hi-4; i >= lo; i-- ) { + tmp = fmap[i]; + ec_tmp = eclass[tmp]; + for ( j = i+4; j <= hi && ec_tmp > eclass[fmap[j]]; j += 4 ) + fmap[j-4] = fmap[j]; + fmap[j-4] = tmp; + } + } + + for ( i = hi-1; i >= lo; i-- ) { + tmp = fmap[i]; + ec_tmp = eclass[tmp]; + for ( j = i+1; j <= hi && ec_tmp > eclass[fmap[j]]; j++ ) + fmap[j-1] = fmap[j]; + fmap[j-1] = tmp; + } +} + + +/*---------------------------------------------*/ +#define fswap(zz1, zz2) \ + { Int32 zztmp = zz1; zz1 = zz2; zz2 = zztmp; } + +#define fvswap(zzp1, zzp2, zzn) \ +{ \ + Int32 yyp1 = (zzp1); \ + Int32 yyp2 = (zzp2); \ + Int32 yyn = (zzn); \ + while (yyn > 0) { \ + fswap(fmap[yyp1], fmap[yyp2]); \ + yyp1++; yyp2++; yyn--; \ + } \ +} + + +#define fmin(a,b) ((a) < (b)) ? (a) : (b) + +#define fpush(lz,hz) { stackLo[sp] = lz; \ + stackHi[sp] = hz; \ + sp++; } + +#define fpop(lz,hz) { sp--; \ + lz = stackLo[sp]; \ + hz = stackHi[sp]; } + +#define FALLBACK_QSORT_SMALL_THRESH 10 +#define FALLBACK_QSORT_STACK_SIZE 100 + + +static +void fallbackQSort3 ( UInt32* fmap, + UInt32* eclass, + Int32 loSt, + Int32 hiSt ) +{ + Int32 unLo, unHi, ltLo, gtHi, n, m; + Int32 sp, lo, hi; + UInt32 med, r, r3; + Int32 stackLo[FALLBACK_QSORT_STACK_SIZE]; + Int32 stackHi[FALLBACK_QSORT_STACK_SIZE]; + + r = 0; + + sp = 0; + fpush ( loSt, hiSt ); + + while (sp > 0) { + + AssertH ( sp < FALLBACK_QSORT_STACK_SIZE - 1, 1004 ); + + fpop ( lo, hi ); + if (hi - lo < FALLBACK_QSORT_SMALL_THRESH) { + fallbackSimpleSort ( fmap, eclass, lo, hi ); + continue; + } + + /* Random partitioning. Median of 3 sometimes fails to + avoid bad cases. Median of 9 seems to help but + looks rather expensive. This too seems to work but + is cheaper. Guidance for the magic constants + 7621 and 32768 is taken from Sedgewick's algorithms + book, chapter 35. + */ + r = ((r * 7621) + 1) % 32768; + r3 = r % 3; + if (r3 == 0) med = eclass[fmap[lo]]; else + if (r3 == 1) med = eclass[fmap[(lo+hi)>>1]]; else + med = eclass[fmap[hi]]; + + unLo = ltLo = lo; + unHi = gtHi = hi; + + while (1) { + while (1) { + if (unLo > unHi) break; + n = (Int32)eclass[fmap[unLo]] - (Int32)med; + if (n == 0) { + fswap(fmap[unLo], fmap[ltLo]); + ltLo++; unLo++; + continue; + }; + if (n > 0) break; + unLo++; + } + while (1) { + if (unLo > unHi) break; + n = (Int32)eclass[fmap[unHi]] - (Int32)med; + if (n == 0) { + fswap(fmap[unHi], fmap[gtHi]); + gtHi--; unHi--; + continue; + }; + if (n < 0) break; + unHi--; + } + if (unLo > unHi) break; + fswap(fmap[unLo], fmap[unHi]); unLo++; unHi--; + } + + AssertD ( unHi == unLo-1, "fallbackQSort3(2)" ); + + if (gtHi < ltLo) continue; + + n = fmin(ltLo-lo, unLo-ltLo); fvswap(lo, unLo-n, n); + m = fmin(hi-gtHi, gtHi-unHi); fvswap(unLo, hi-m+1, m); + + n = lo + unLo - ltLo - 1; + m = hi - (gtHi - unHi) + 1; + + if (n - lo > hi - m) { + fpush ( lo, n ); + fpush ( m, hi ); + } else { + fpush ( m, hi ); + fpush ( lo, n ); + } + } +} + +#undef fmin +#undef fpush +#undef fpop +#undef fswap +#undef fvswap +#undef FALLBACK_QSORT_SMALL_THRESH +#undef FALLBACK_QSORT_STACK_SIZE + + +/*---------------------------------------------*/ +/* Pre: + nblock > 0 + eclass exists for [0 .. nblock-1] + ((UChar*)eclass) [0 .. nblock-1] holds block + ptr exists for [0 .. nblock-1] + + Post: + ((UChar*)eclass) [0 .. nblock-1] holds block + All other areas of eclass destroyed + fmap [0 .. nblock-1] holds sorted order + bhtab [ 0 .. 2+(nblock/32) ] destroyed +*/ + +#define SET_BH(zz) bhtab[(zz) >> 5] |= (1 << ((zz) & 31)) +#define CLEAR_BH(zz) bhtab[(zz) >> 5] &= ~(1 << ((zz) & 31)) +#define ISSET_BH(zz) (bhtab[(zz) >> 5] & (1 << ((zz) & 31))) +#define WORD_BH(zz) bhtab[(zz) >> 5] +#define UNALIGNED_BH(zz) ((zz) & 0x01f) + +static +void fallbackSort ( UInt32* fmap, + UInt32* eclass, + UInt32* bhtab, + Int32 nblock, + Int32 verb ) +{ + Int32 ftab[257]; + Int32 ftabCopy[256]; + Int32 H, i, j, k, l, r, cc, cc1; + Int32 nNotDone; + Int32 nBhtab; + UChar* eclass8 = (UChar*)eclass; + + /*-- + Initial 1-char radix sort to generate + initial fmap and initial BH bits. + --*/ + if (verb >= 4) + VPrintf0 ( " bucket sorting ...\n" ); + for (i = 0; i < 257; i++) ftab[i] = 0; + for (i = 0; i < nblock; i++) ftab[eclass8[i]]++; + for (i = 0; i < 256; i++) ftabCopy[i] = ftab[i]; + for (i = 1; i < 257; i++) ftab[i] += ftab[i-1]; + + for (i = 0; i < nblock; i++) { + j = eclass8[i]; + k = ftab[j] - 1; + ftab[j] = k; + fmap[k] = i; + } + + nBhtab = 2 + (nblock / 32); + for (i = 0; i < nBhtab; i++) bhtab[i] = 0; + for (i = 0; i < 256; i++) SET_BH(ftab[i]); + + /*-- + Inductively refine the buckets. Kind-of an + "exponential radix sort" (!), inspired by the + Manber-Myers suffix array construction algorithm. + --*/ + + /*-- set sentinel bits for block-end detection --*/ + for (i = 0; i < 32; i++) { + SET_BH(nblock + 2*i); + CLEAR_BH(nblock + 2*i + 1); + } + + /*-- the log(N) loop --*/ + H = 1; + while (1) { + + if (verb >= 4) + VPrintf1 ( " depth %6d has ", H ); + + j = 0; + for (i = 0; i < nblock; i++) { + if (ISSET_BH(i)) j = i; + k = fmap[i] - H; if (k < 0) k += nblock; + eclass[k] = j; + } + + nNotDone = 0; + r = -1; + while (1) { + + /*-- find the next non-singleton bucket --*/ + k = r + 1; + while (ISSET_BH(k) && UNALIGNED_BH(k)) k++; + if (ISSET_BH(k)) { + while (WORD_BH(k) == 0xffffffff) k += 32; + while (ISSET_BH(k)) k++; + } + l = k - 1; + if (l >= nblock) break; + while (!ISSET_BH(k) && UNALIGNED_BH(k)) k++; + if (!ISSET_BH(k)) { + while (WORD_BH(k) == 0x00000000) k += 32; + while (!ISSET_BH(k)) k++; + } + r = k - 1; + if (r >= nblock) break; + + /*-- now [l, r] bracket current bucket --*/ + if (r > l) { + nNotDone += (r - l + 1); + fallbackQSort3 ( fmap, eclass, l, r ); + + /*-- scan bucket and generate header bits-- */ + cc = -1; + for (i = l; i <= r; i++) { + cc1 = eclass[fmap[i]]; + if (cc != cc1) { SET_BH(i); cc = cc1; }; + } + } + } + + if (verb >= 4) + VPrintf1 ( "%6d unresolved strings\n", nNotDone ); + + H *= 2; + if (H > nblock || nNotDone == 0) break; + } + + /*-- + Reconstruct the original block in + eclass8 [0 .. nblock-1], since the + previous phase destroyed it. + --*/ + if (verb >= 4) + VPrintf0 ( " reconstructing block ...\n" ); + j = 0; + for (i = 0; i < nblock; i++) { + while (ftabCopy[j] == 0) j++; + ftabCopy[j]--; + eclass8[fmap[i]] = (UChar)j; + } + AssertH ( j < 256, 1005 ); +} + +#undef SET_BH +#undef CLEAR_BH +#undef ISSET_BH +#undef WORD_BH +#undef UNALIGNED_BH + + +/*---------------------------------------------*/ +/*--- The main, O(N^2 log(N)) sorting ---*/ +/*--- algorithm. Faster for "normal" ---*/ +/*--- non-repetitive blocks. ---*/ +/*---------------------------------------------*/ + +/*---------------------------------------------*/ +static +__inline__ +Bool mainGtU ( UInt32 i1, + UInt32 i2, + UChar* block, + UInt16* quadrant, + UInt32 nblock, + Int32* budget ) +{ + Int32 k; + UChar c1, c2; + UInt16 s1, s2; + + AssertD ( i1 != i2, "mainGtU" ); + /* 1 */ + c1 = block[i1]; c2 = block[i2]; + if (c1 != c2) return (c1 > c2); + i1++; i2++; + /* 2 */ + c1 = block[i1]; c2 = block[i2]; + if (c1 != c2) return (c1 > c2); + i1++; i2++; + /* 3 */ + c1 = block[i1]; c2 = block[i2]; + if (c1 != c2) return (c1 > c2); + i1++; i2++; + /* 4 */ + c1 = block[i1]; c2 = block[i2]; + if (c1 != c2) return (c1 > c2); + i1++; i2++; + /* 5 */ + c1 = block[i1]; c2 = block[i2]; + if (c1 != c2) return (c1 > c2); + i1++; i2++; + /* 6 */ + c1 = block[i1]; c2 = block[i2]; + if (c1 != c2) return (c1 > c2); + i1++; i2++; + /* 7 */ + c1 = block[i1]; c2 = block[i2]; + if (c1 != c2) return (c1 > c2); + i1++; i2++; + /* 8 */ + c1 = block[i1]; c2 = block[i2]; + if (c1 != c2) return (c1 > c2); + i1++; i2++; + /* 9 */ + c1 = block[i1]; c2 = block[i2]; + if (c1 != c2) return (c1 > c2); + i1++; i2++; + /* 10 */ + c1 = block[i1]; c2 = block[i2]; + if (c1 != c2) return (c1 > c2); + i1++; i2++; + /* 11 */ + c1 = block[i1]; c2 = block[i2]; + if (c1 != c2) return (c1 > c2); + i1++; i2++; + /* 12 */ + c1 = block[i1]; c2 = block[i2]; + if (c1 != c2) return (c1 > c2); + i1++; i2++; + + k = nblock + 8; + + do { + /* 1 */ + c1 = block[i1]; c2 = block[i2]; + if (c1 != c2) return (c1 > c2); + s1 = quadrant[i1]; s2 = quadrant[i2]; + if (s1 != s2) return (s1 > s2); + i1++; i2++; + /* 2 */ + c1 = block[i1]; c2 = block[i2]; + if (c1 != c2) return (c1 > c2); + s1 = quadrant[i1]; s2 = quadrant[i2]; + if (s1 != s2) return (s1 > s2); + i1++; i2++; + /* 3 */ + c1 = block[i1]; c2 = block[i2]; + if (c1 != c2) return (c1 > c2); + s1 = quadrant[i1]; s2 = quadrant[i2]; + if (s1 != s2) return (s1 > s2); + i1++; i2++; + /* 4 */ + c1 = block[i1]; c2 = block[i2]; + if (c1 != c2) return (c1 > c2); + s1 = quadrant[i1]; s2 = quadrant[i2]; + if (s1 != s2) return (s1 > s2); + i1++; i2++; + /* 5 */ + c1 = block[i1]; c2 = block[i2]; + if (c1 != c2) return (c1 > c2); + s1 = quadrant[i1]; s2 = quadrant[i2]; + if (s1 != s2) return (s1 > s2); + i1++; i2++; + /* 6 */ + c1 = block[i1]; c2 = block[i2]; + if (c1 != c2) return (c1 > c2); + s1 = quadrant[i1]; s2 = quadrant[i2]; + if (s1 != s2) return (s1 > s2); + i1++; i2++; + /* 7 */ + c1 = block[i1]; c2 = block[i2]; + if (c1 != c2) return (c1 > c2); + s1 = quadrant[i1]; s2 = quadrant[i2]; + if (s1 != s2) return (s1 > s2); + i1++; i2++; + /* 8 */ + c1 = block[i1]; c2 = block[i2]; + if (c1 != c2) return (c1 > c2); + s1 = quadrant[i1]; s2 = quadrant[i2]; + if (s1 != s2) return (s1 > s2); + i1++; i2++; + + if (i1 >= nblock) i1 -= nblock; + if (i2 >= nblock) i2 -= nblock; + + k -= 8; + (*budget)--; + } + while (k >= 0); + + return False; +} + + +/*---------------------------------------------*/ +/*-- + Knuth's increments seem to work better + than Incerpi-Sedgewick here. Possibly + because the number of elems to sort is + usually small, typically <= 20. +--*/ +static +Int32 incs[14] = { 1, 4, 13, 40, 121, 364, 1093, 3280, + 9841, 29524, 88573, 265720, + 797161, 2391484 }; + +static +void mainSimpleSort ( UInt32* ptr, + UChar* block, + UInt16* quadrant, + Int32 nblock, + Int32 lo, + Int32 hi, + Int32 d, + Int32* budget ) +{ + Int32 i, j, h, bigN, hp; + UInt32 v; + + bigN = hi - lo + 1; + if (bigN < 2) return; + + hp = 0; + while (incs[hp] < bigN) hp++; + hp--; + + for (; hp >= 0; hp--) { + h = incs[hp]; + + i = lo + h; + while (True) { + + /*-- copy 1 --*/ + if (i > hi) break; + v = ptr[i]; + j = i; + while ( mainGtU ( + ptr[j-h]+d, v+d, block, quadrant, nblock, budget + ) ) { + ptr[j] = ptr[j-h]; + j = j - h; + if (j <= (lo + h - 1)) break; + } + ptr[j] = v; + i++; + + /*-- copy 2 --*/ + if (i > hi) break; + v = ptr[i]; + j = i; + while ( mainGtU ( + ptr[j-h]+d, v+d, block, quadrant, nblock, budget + ) ) { + ptr[j] = ptr[j-h]; + j = j - h; + if (j <= (lo + h - 1)) break; + } + ptr[j] = v; + i++; + + /*-- copy 3 --*/ + if (i > hi) break; + v = ptr[i]; + j = i; + while ( mainGtU ( + ptr[j-h]+d, v+d, block, quadrant, nblock, budget + ) ) { + ptr[j] = ptr[j-h]; + j = j - h; + if (j <= (lo + h - 1)) break; + } + ptr[j] = v; + i++; + + if (*budget < 0) return; + } + } +} + + +/*---------------------------------------------*/ +/*-- + The following is an implementation of + an elegant 3-way quicksort for strings, + described in a paper "Fast Algorithms for + Sorting and Searching Strings", by Robert + Sedgewick and Jon L. Bentley. +--*/ + +#define mswap(zz1, zz2) \ + { Int32 zztmp = zz1; zz1 = zz2; zz2 = zztmp; } + +#define mvswap(zzp1, zzp2, zzn) \ +{ \ + Int32 yyp1 = (zzp1); \ + Int32 yyp2 = (zzp2); \ + Int32 yyn = (zzn); \ + while (yyn > 0) { \ + mswap(ptr[yyp1], ptr[yyp2]); \ + yyp1++; yyp2++; yyn--; \ + } \ +} + +static +__inline__ +UChar mmed3 ( UChar a, UChar b, UChar c ) +{ + UChar t; + if (a > b) { t = a; a = b; b = t; }; + if (b > c) { + b = c; + if (a > b) b = a; + } + return b; +} + +#define mmin(a,b) ((a) < (b)) ? (a) : (b) + +#define mpush(lz,hz,dz) { stackLo[sp] = lz; \ + stackHi[sp] = hz; \ + stackD [sp] = dz; \ + sp++; } + +#define mpop(lz,hz,dz) { sp--; \ + lz = stackLo[sp]; \ + hz = stackHi[sp]; \ + dz = stackD [sp]; } + + +#define mnextsize(az) (nextHi[az]-nextLo[az]) + +#define mnextswap(az,bz) \ + { Int32 tz; \ + tz = nextLo[az]; nextLo[az] = nextLo[bz]; nextLo[bz] = tz; \ + tz = nextHi[az]; nextHi[az] = nextHi[bz]; nextHi[bz] = tz; \ + tz = nextD [az]; nextD [az] = nextD [bz]; nextD [bz] = tz; } + + +#define MAIN_QSORT_SMALL_THRESH 20 +#define MAIN_QSORT_DEPTH_THRESH (BZ_N_RADIX + BZ_N_QSORT) +#define MAIN_QSORT_STACK_SIZE 100 + +static +void mainQSort3 ( UInt32* ptr, + UChar* block, + UInt16* quadrant, + Int32 nblock, + Int32 loSt, + Int32 hiSt, + Int32 dSt, + Int32* budget ) +{ + Int32 unLo, unHi, ltLo, gtHi, n, m, med; + Int32 sp, lo, hi, d; + + Int32 stackLo[MAIN_QSORT_STACK_SIZE]; + Int32 stackHi[MAIN_QSORT_STACK_SIZE]; + Int32 stackD [MAIN_QSORT_STACK_SIZE]; + + Int32 nextLo[3]; + Int32 nextHi[3]; + Int32 nextD [3]; + + sp = 0; + mpush ( loSt, hiSt, dSt ); + + while (sp > 0) { + + AssertH ( sp < MAIN_QSORT_STACK_SIZE - 2, 1001 ); + + mpop ( lo, hi, d ); + if (hi - lo < MAIN_QSORT_SMALL_THRESH || + d > MAIN_QSORT_DEPTH_THRESH) { + mainSimpleSort ( ptr, block, quadrant, nblock, lo, hi, d, budget ); + if (*budget < 0) return; + continue; + } + + med = (Int32) + mmed3 ( block[ptr[ lo ]+d], + block[ptr[ hi ]+d], + block[ptr[ (lo+hi)>>1 ]+d] ); + + unLo = ltLo = lo; + unHi = gtHi = hi; + + while (True) { + while (True) { + if (unLo > unHi) break; + n = ((Int32)block[ptr[unLo]+d]) - med; + if (n == 0) { + mswap(ptr[unLo], ptr[ltLo]); + ltLo++; unLo++; continue; + }; + if (n > 0) break; + unLo++; + } + while (True) { + if (unLo > unHi) break; + n = ((Int32)block[ptr[unHi]+d]) - med; + if (n == 0) { + mswap(ptr[unHi], ptr[gtHi]); + gtHi--; unHi--; continue; + }; + if (n < 0) break; + unHi--; + } + if (unLo > unHi) break; + mswap(ptr[unLo], ptr[unHi]); unLo++; unHi--; + } + + AssertD ( unHi == unLo-1, "mainQSort3(2)" ); + + if (gtHi < ltLo) { + mpush(lo, hi, d+1 ); + continue; + } + + n = mmin(ltLo-lo, unLo-ltLo); mvswap(lo, unLo-n, n); + m = mmin(hi-gtHi, gtHi-unHi); mvswap(unLo, hi-m+1, m); + + n = lo + unLo - ltLo - 1; + m = hi - (gtHi - unHi) + 1; + + nextLo[0] = lo; nextHi[0] = n; nextD[0] = d; + nextLo[1] = m; nextHi[1] = hi; nextD[1] = d; + nextLo[2] = n+1; nextHi[2] = m-1; nextD[2] = d+1; + + if (mnextsize(0) < mnextsize(1)) mnextswap(0,1); + if (mnextsize(1) < mnextsize(2)) mnextswap(1,2); + if (mnextsize(0) < mnextsize(1)) mnextswap(0,1); + + AssertD (mnextsize(0) >= mnextsize(1), "mainQSort3(8)" ); + AssertD (mnextsize(1) >= mnextsize(2), "mainQSort3(9)" ); + + mpush (nextLo[0], nextHi[0], nextD[0]); + mpush (nextLo[1], nextHi[1], nextD[1]); + mpush (nextLo[2], nextHi[2], nextD[2]); + } +} + +#undef mswap +#undef mvswap +#undef mpush +#undef mpop +#undef mmin +#undef mnextsize +#undef mnextswap +#undef MAIN_QSORT_SMALL_THRESH +#undef MAIN_QSORT_DEPTH_THRESH +#undef MAIN_QSORT_STACK_SIZE + + +/*---------------------------------------------*/ +/* Pre: + nblock > N_OVERSHOOT + block32 exists for [0 .. nblock-1 +N_OVERSHOOT] + ((UChar*)block32) [0 .. nblock-1] holds block + ptr exists for [0 .. nblock-1] + + Post: + ((UChar*)block32) [0 .. nblock-1] holds block + All other areas of block32 destroyed + ftab [0 .. 65536 ] destroyed + ptr [0 .. nblock-1] holds sorted order + if (*budget < 0), sorting was abandoned +*/ + +#define BIGFREQ(b) (ftab[((b)+1) << 8] - ftab[(b) << 8]) +#define SETMASK (1 << 21) +#define CLEARMASK (~(SETMASK)) + +static +void mainSort ( UInt32* ptr, + UChar* block, + UInt16* quadrant, + UInt32* ftab, + Int32 nblock, + Int32 verb, + Int32* budget ) +{ + Int32 i, j, k, ss, sb; + Int32 runningOrder[256]; + Bool bigDone[256]; + Int32 copyStart[256]; + Int32 copyEnd [256]; + UChar c1; + Int32 numQSorted; + UInt16 s; + if (verb >= 4) VPrintf0 ( " main sort initialise ...\n" ); + + /*-- set up the 2-byte frequency table --*/ + for (i = 65536; i >= 0; i--) ftab[i] = 0; + + j = block[0] << 8; + i = nblock-1; + for (; i >= 3; i -= 4) { + quadrant[i] = 0; + j = (j >> 8) | ( ((UInt16)block[i]) << 8); + ftab[j]++; + quadrant[i-1] = 0; + j = (j >> 8) | ( ((UInt16)block[i-1]) << 8); + ftab[j]++; + quadrant[i-2] = 0; + j = (j >> 8) | ( ((UInt16)block[i-2]) << 8); + ftab[j]++; + quadrant[i-3] = 0; + j = (j >> 8) | ( ((UInt16)block[i-3]) << 8); + ftab[j]++; + } + for (; i >= 0; i--) { + quadrant[i] = 0; + j = (j >> 8) | ( ((UInt16)block[i]) << 8); + ftab[j]++; + } + + /*-- (emphasises close relationship of block & quadrant) --*/ + for (i = 0; i < BZ_N_OVERSHOOT; i++) { + block [nblock+i] = block[i]; + quadrant[nblock+i] = 0; + } + + if (verb >= 4) VPrintf0 ( " bucket sorting ...\n" ); + + /*-- Complete the initial radix sort --*/ + for (i = 1; i <= 65536; i++) ftab[i] += ftab[i-1]; + + s = block[0] << 8; + i = nblock-1; + for (; i >= 3; i -= 4) { + s = (s >> 8) | (block[i] << 8); + j = ftab[s] -1; + ftab[s] = j; + ptr[j] = i; + s = (s >> 8) | (block[i-1] << 8); + j = ftab[s] -1; + ftab[s] = j; + ptr[j] = i-1; + s = (s >> 8) | (block[i-2] << 8); + j = ftab[s] -1; + ftab[s] = j; + ptr[j] = i-2; + s = (s >> 8) | (block[i-3] << 8); + j = ftab[s] -1; + ftab[s] = j; + ptr[j] = i-3; + } + for (; i >= 0; i--) { + s = (s >> 8) | (block[i] << 8); + j = ftab[s] -1; + ftab[s] = j; + ptr[j] = i; + } + + /*-- + Now ftab contains the first loc of every small bucket. + Calculate the running order, from smallest to largest + big bucket. + --*/ + for (i = 0; i <= 255; i++) { + bigDone [i] = False; + runningOrder[i] = i; + } + + { + Int32 vv; + Int32 h = 1; + do h = 3 * h + 1; while (h <= 256); + do { + h = h / 3; + for (i = h; i <= 255; i++) { + vv = runningOrder[i]; + j = i; + while ( BIGFREQ(runningOrder[j-h]) > BIGFREQ(vv) ) { + runningOrder[j] = runningOrder[j-h]; + j = j - h; + if (j <= (h - 1)) goto zero; + } + zero: + runningOrder[j] = vv; + } + } while (h != 1); + } + + /*-- + The main sorting loop. + --*/ + + numQSorted = 0; + + for (i = 0; i <= 255; i++) { + + /*-- + Process big buckets, starting with the least full. + Basically this is a 3-step process in which we call + mainQSort3 to sort the small buckets [ss, j], but + also make a big effort to avoid the calls if we can. + --*/ + ss = runningOrder[i]; + + /*-- + Step 1: + Complete the big bucket [ss] by quicksorting + any unsorted small buckets [ss, j], for j != ss. + Hopefully previous pointer-scanning phases have already + completed many of the small buckets [ss, j], so + we don't have to sort them at all. + --*/ + for (j = 0; j <= 255; j++) { + if (j != ss) { + sb = (ss << 8) + j; + if ( ! (ftab[sb] & SETMASK) ) { + Int32 lo = ftab[sb] & CLEARMASK; + Int32 hi = (ftab[sb+1] & CLEARMASK) - 1; + if (hi > lo) { + if (verb >= 4) + VPrintf4 ( " qsort [0x%x, 0x%x] " + "done %d this %d\n", + ss, j, numQSorted, hi - lo + 1 ); + mainQSort3 ( + ptr, block, quadrant, nblock, + lo, hi, BZ_N_RADIX, budget + ); + numQSorted += (hi - lo + 1); + if (*budget < 0) return; + } + } + ftab[sb] |= SETMASK; + } + } + + AssertH ( !bigDone[ss], 1006 ); + + /*-- + Step 2: + Now scan this big bucket [ss] so as to synthesise the + sorted order for small buckets [t, ss] for all t, + including, magically, the bucket [ss,ss] too. + This will avoid doing Real Work in subsequent Step 1's. + --*/ + { + for (j = 0; j <= 255; j++) { + copyStart[j] = ftab[(j << 8) + ss] & CLEARMASK; + copyEnd [j] = (ftab[(j << 8) + ss + 1] & CLEARMASK) - 1; + } + for (j = ftab[ss << 8] & CLEARMASK; j < copyStart[ss]; j++) { + k = ptr[j]-1; if (k < 0) k += nblock; + c1 = block[k]; + if (!bigDone[c1]) + ptr[ copyStart[c1]++ ] = k; + } + for (j = (ftab[(ss+1) << 8] & CLEARMASK) - 1; j > copyEnd[ss]; j--) { + k = ptr[j]-1; if (k < 0) k += nblock; + c1 = block[k]; + if (!bigDone[c1]) + ptr[ copyEnd[c1]-- ] = k; + } + } + + AssertH ( (copyStart[ss]-1 == copyEnd[ss]) + || + /* Extremely rare case missing in bzip2-1.0.0 and 1.0.1. + Necessity for this case is demonstrated by compressing + a sequence of approximately 48.5 million of character + 251; 1.0.0/1.0.1 will then die here. */ + (copyStart[ss] == 0 && copyEnd[ss] == nblock-1), + 1007 ) + + for (j = 0; j <= 255; j++) ftab[(j << 8) + ss] |= SETMASK; + + /*-- + Step 3: + The [ss] big bucket is now done. Record this fact, + and update the quadrant descriptors. Remember to + update quadrants in the overshoot area too, if + necessary. The "if (i < 255)" test merely skips + this updating for the last bucket processed, since + updating for the last bucket is pointless. + + The quadrant array provides a way to incrementally + cache sort orderings, as they appear, so as to + make subsequent comparisons in fullGtU() complete + faster. For repetitive blocks this makes a big + difference (but not big enough to be able to avoid + the fallback sorting mechanism, exponential radix sort). + + The precise meaning is: at all times: + + for 0 <= i < nblock and 0 <= j <= nblock + + if block[i] != block[j], + + then the relative values of quadrant[i] and + quadrant[j] are meaningless. + + else { + if quadrant[i] < quadrant[j] + then the string starting at i lexicographically + precedes the string starting at j + + else if quadrant[i] > quadrant[j] + then the string starting at j lexicographically + precedes the string starting at i + + else + the relative ordering of the strings starting + at i and j has not yet been determined. + } + --*/ + bigDone[ss] = True; + + if (i < 255) { + Int32 bbStart = ftab[ss << 8] & CLEARMASK; + Int32 bbSize = (ftab[(ss+1) << 8] & CLEARMASK) - bbStart; + Int32 shifts = 0; + + while ((bbSize >> shifts) > 65534) shifts++; + + for (j = bbSize-1; j >= 0; j--) { + Int32 a2update = ptr[bbStart + j]; + UInt16 qVal = (UInt16)(j >> shifts); + quadrant[a2update] = qVal; + if (a2update < BZ_N_OVERSHOOT) + quadrant[a2update + nblock] = qVal; + } + AssertH ( ((bbSize-1) >> shifts) <= 65535, 1002 ); + } + + } + + if (verb >= 4) + VPrintf3 ( " %d pointers, %d sorted, %d scanned\n", + nblock, numQSorted, nblock - numQSorted ); +} + +#undef BIGFREQ +#undef SETMASK +#undef CLEARMASK + + +/*---------------------------------------------*/ +/* Pre: + nblock > 0 + arr2 exists for [0 .. nblock-1 +N_OVERSHOOT] + ((UChar*)arr2) [0 .. nblock-1] holds block + arr1 exists for [0 .. nblock-1] + + Post: + ((UChar*)arr2) [0 .. nblock-1] holds block + All other areas of block destroyed + ftab [ 0 .. 65536 ] destroyed + arr1 [0 .. nblock-1] holds sorted order +*/ +void BZ2_blockSort ( EState* s ) +{ + UInt32* ptr = s->ptr; + UChar* block = s->block; + UInt32* ftab = s->ftab; + Int32 nblock = s->nblock; + Int32 verb = s->verbosity; + Int32 wfact = s->workFactor; + UInt16* quadrant; + Int32 budget; + Int32 budgetInit; + Int32 i; + + if (nblock < 10000) { + fallbackSort ( s->arr1, s->arr2, ftab, nblock, verb ); + } else { + /* Calculate the location for quadrant, remembering to get + the alignment right. Assumes that &(block[0]) is at least + 2-byte aligned -- this should be ok since block is really + the first section of arr2. + */ + i = nblock+BZ_N_OVERSHOOT; + if (i & 1) i++; + quadrant = (UInt16*)(&(block[i])); + + /* (wfact-1) / 3 puts the default-factor-30 + transition point at very roughly the same place as + with v0.1 and v0.9.0. + Not that it particularly matters any more, since the + resulting compressed stream is now the same regardless + of whether or not we use the main sort or fallback sort. + */ + if (wfact < 1 ) wfact = 1; + if (wfact > 100) wfact = 100; + budgetInit = nblock * ((wfact-1) / 3); + budget = budgetInit; + + mainSort ( ptr, block, quadrant, ftab, nblock, verb, &budget ); + if (verb >= 3) + VPrintf3 ( " %d work, %d block, ratio %5.2f\n", + budgetInit - budget, + nblock, + (float)(budgetInit - budget) / + (float)(nblock==0 ? 1 : nblock) ); + if (budget < 0) { + if (verb >= 2) + VPrintf0 ( " too repetitive; using fallback" + " sorting algorithm\n" ); + fallbackSort ( s->arr1, s->arr2, ftab, nblock, verb ); + } + } + + s->origPtr = -1; + for (i = 0; i < s->nblock; i++) + if (ptr[i] == 0) + { s->origPtr = i; break; }; + + AssertH( s->origPtr != -1, 1003 ); +} + + +/*-------------------------------------------------------------*/ +/*--- end blocksort.c ---*/ +/*-------------------------------------------------------------*/ diff --git a/dep/StormLib/src/bzip2/bzlib.c b/dep/StormLib/src/bzip2/bzlib.c new file mode 100644 index 00000000000..b98f3e586bc --- /dev/null +++ b/dep/StormLib/src/bzip2/bzlib.c @@ -0,0 +1,1573 @@ + +/*-------------------------------------------------------------*/ +/*--- Library top-level functions. ---*/ +/*--- bzlib.c ---*/ +/*-------------------------------------------------------------*/ + +/* ------------------------------------------------------------------ + This file is part of bzip2/libbzip2, a program and library for + lossless, block-sorting data compression. + + bzip2/libbzip2 version 1.0.5 of 10 December 2007 + Copyright (C) 1996-2007 Julian Seward + + Please read the WARNING, DISCLAIMER and PATENTS sections in the + README file. + + This program is released under the terms of the license contained + in the file LICENSE. + ------------------------------------------------------------------ */ + +/* CHANGES + 0.9.0 -- original version. + 0.9.0a/b -- no changes in this file. + 0.9.0c -- made zero-length BZ_FLUSH work correctly in bzCompress(). + fixed bzWrite/bzRead to ignore zero-length requests. + fixed bzread to correctly handle read requests after EOF. + wrong parameter order in call to bzDecompressInit in + bzBuffToBuffDecompress. Fixed. +*/ + +#define _CRT_SECURE_NO_WARNINGS +#include "bzlib_private.h" + + +/*---------------------------------------------------*/ +/*--- Compression stuff ---*/ +/*---------------------------------------------------*/ + + +/*---------------------------------------------------*/ +#ifndef BZ_NO_STDIO +void BZ2_bz__AssertH__fail ( int errcode ) +{ + fprintf(stderr, + "\n\nbzip2/libbzip2: internal error number %d.\n" + "This is a bug in bzip2/libbzip2, %s.\n" + "Please report it to me at: jseward@bzip.org. If this happened\n" + "when you were using some program which uses libbzip2 as a\n" + "component, you should also report this bug to the author(s)\n" + "of that program. Please make an effort to report this bug;\n" + "timely and accurate bug reports eventually lead to higher\n" + "quality software. Thanks. Julian Seward, 10 December 2007.\n\n", + errcode, + BZ2_bzlibVersion() + ); + + if (errcode == 1007) { + fprintf(stderr, + "\n*** A special note about internal error number 1007 ***\n" + "\n" + "Experience suggests that a common cause of i.e. 1007\n" + "is unreliable memory or other hardware. The 1007 assertion\n" + "just happens to cross-check the results of huge numbers of\n" + "memory reads/writes, and so acts (unintendedly) as a stress\n" + "test of your memory system.\n" + "\n" + "I suggest the following: try compressing the file again,\n" + "possibly monitoring progress in detail with the -vv flag.\n" + "\n" + "* If the error cannot be reproduced, and/or happens at different\n" + " points in compression, you may have a flaky memory system.\n" + " Try a memory-test program. I have used Memtest86\n" + " (www.memtest86.com). At the time of writing it is free (GPLd).\n" + " Memtest86 tests memory much more thorougly than your BIOSs\n" + " power-on test, and may find failures that the BIOS doesn't.\n" + "\n" + "* If the error can be repeatably reproduced, this is a bug in\n" + " bzip2, and I would very much like to hear about it. Please\n" + " let me know, and, ideally, save a copy of the file causing the\n" + " problem -- without which I will be unable to investigate it.\n" + "\n" + ); + } + + exit(3); +} +#endif + + +/*---------------------------------------------------*/ +static +int bz_config_ok ( void ) +{ + if (sizeof(int) != 4) return 0; + if (sizeof(short) != 2) return 0; + if (sizeof(char) != 1) return 0; + return 1; +} + + +/*---------------------------------------------------*/ +static +void* default_bzalloc ( void* opaque, Int32 items, Int32 size ) +{ + void* v = malloc ( items * size ); + return v; +} + +static +void default_bzfree ( void* opaque, void* addr ) +{ + if (addr != NULL) free ( addr ); +} + + +/*---------------------------------------------------*/ +static +void prepare_new_block ( EState* s ) +{ + Int32 i; + s->nblock = 0; + s->numZ = 0; + s->state_out_pos = 0; + BZ_INITIALISE_CRC ( s->blockCRC ); + for (i = 0; i < 256; i++) s->inUse[i] = False; + s->blockNo++; +} + + +/*---------------------------------------------------*/ +static +void init_RL ( EState* s ) +{ + s->state_in_ch = 256; + s->state_in_len = 0; +} + + +static +Bool isempty_RL ( EState* s ) +{ + if (s->state_in_ch < 256 && s->state_in_len > 0) + return False; else + return True; +} + + +/*---------------------------------------------------*/ +int BZ_API(BZ2_bzCompressInit) + ( bz_stream* strm, + int blockSize100k, + int verbosity, + int workFactor ) +{ + Int32 n; + EState* s; + + if (!bz_config_ok()) return BZ_CONFIG_ERROR; + + if (strm == NULL || + blockSize100k < 1 || blockSize100k > 9 || + workFactor < 0 || workFactor > 250) + return BZ_PARAM_ERROR; + + if (workFactor == 0) workFactor = 30; + if (strm->bzalloc == NULL) strm->bzalloc = default_bzalloc; + if (strm->bzfree == NULL) strm->bzfree = default_bzfree; + + s = BZALLOC( sizeof(EState) ); + if (s == NULL) return BZ_MEM_ERROR; + s->strm = strm; + + s->arr1 = NULL; + s->arr2 = NULL; + s->ftab = NULL; + + n = 100000 * blockSize100k; + s->arr1 = BZALLOC( n * sizeof(UInt32) ); + s->arr2 = BZALLOC( (n+BZ_N_OVERSHOOT) * sizeof(UInt32) ); + s->ftab = BZALLOC( 65537 * sizeof(UInt32) ); + + if (s->arr1 == NULL || s->arr2 == NULL || s->ftab == NULL) { + if (s->arr1 != NULL) BZFREE(s->arr1); + if (s->arr2 != NULL) BZFREE(s->arr2); + if (s->ftab != NULL) BZFREE(s->ftab); + if (s != NULL) BZFREE(s); + return BZ_MEM_ERROR; + } + + s->blockNo = 0; + s->state = BZ_S_INPUT; + s->mode = BZ_M_RUNNING; + s->combinedCRC = 0; + s->blockSize100k = blockSize100k; + s->nblockMAX = 100000 * blockSize100k - 19; + s->verbosity = verbosity; + s->workFactor = workFactor; + + s->block = (UChar*)s->arr2; + s->mtfv = (UInt16*)s->arr1; + s->zbits = NULL; + s->ptr = (UInt32*)s->arr1; + + strm->state = s; + strm->total_in_lo32 = 0; + strm->total_in_hi32 = 0; + strm->total_out_lo32 = 0; + strm->total_out_hi32 = 0; + init_RL ( s ); + prepare_new_block ( s ); + return BZ_OK; +} + + +/*---------------------------------------------------*/ +static +void add_pair_to_block ( EState* s ) +{ + Int32 i; + UChar ch = (UChar)(s->state_in_ch); + for (i = 0; i < s->state_in_len; i++) { + BZ_UPDATE_CRC( s->blockCRC, ch ); + } + s->inUse[s->state_in_ch] = True; + switch (s->state_in_len) { + case 1: + s->block[s->nblock] = (UChar)ch; s->nblock++; + break; + case 2: + s->block[s->nblock] = (UChar)ch; s->nblock++; + s->block[s->nblock] = (UChar)ch; s->nblock++; + break; + case 3: + s->block[s->nblock] = (UChar)ch; s->nblock++; + s->block[s->nblock] = (UChar)ch; s->nblock++; + s->block[s->nblock] = (UChar)ch; s->nblock++; + break; + default: + s->inUse[s->state_in_len-4] = True; + s->block[s->nblock] = (UChar)ch; s->nblock++; + s->block[s->nblock] = (UChar)ch; s->nblock++; + s->block[s->nblock] = (UChar)ch; s->nblock++; + s->block[s->nblock] = (UChar)ch; s->nblock++; + s->block[s->nblock] = ((UChar)(s->state_in_len-4)); + s->nblock++; + break; + } +} + + +/*---------------------------------------------------*/ +static +void flush_RL ( EState* s ) +{ + if (s->state_in_ch < 256) add_pair_to_block ( s ); + init_RL ( s ); +} + + +/*---------------------------------------------------*/ +#define ADD_CHAR_TO_BLOCK(zs,zchh0) \ +{ \ + UInt32 zchh = (UInt32)(zchh0); \ + /*-- fast track the common case --*/ \ + if (zchh != zs->state_in_ch && \ + zs->state_in_len == 1) { \ + UChar ch = (UChar)(zs->state_in_ch); \ + BZ_UPDATE_CRC( zs->blockCRC, ch ); \ + zs->inUse[zs->state_in_ch] = True; \ + zs->block[zs->nblock] = (UChar)ch; \ + zs->nblock++; \ + zs->state_in_ch = zchh; \ + } \ + else \ + /*-- general, uncommon cases --*/ \ + if (zchh != zs->state_in_ch || \ + zs->state_in_len == 255) { \ + if (zs->state_in_ch < 256) \ + add_pair_to_block ( zs ); \ + zs->state_in_ch = zchh; \ + zs->state_in_len = 1; \ + } else { \ + zs->state_in_len++; \ + } \ +} + + +/*---------------------------------------------------*/ +static +Bool copy_input_until_stop ( EState* s ) +{ + Bool progress_in = False; + + if (s->mode == BZ_M_RUNNING) { + + /*-- fast track the common case --*/ + while (True) { + /*-- block full? --*/ + if (s->nblock >= s->nblockMAX) break; + /*-- no input? --*/ + if (s->strm->avail_in == 0) break; + progress_in = True; + ADD_CHAR_TO_BLOCK ( s, (UInt32)(*((UChar*)(s->strm->next_in))) ); + s->strm->next_in++; + s->strm->avail_in--; + s->strm->total_in_lo32++; + if (s->strm->total_in_lo32 == 0) s->strm->total_in_hi32++; + } + + } else { + + /*-- general, uncommon case --*/ + while (True) { + /*-- block full? --*/ + if (s->nblock >= s->nblockMAX) break; + /*-- no input? --*/ + if (s->strm->avail_in == 0) break; + /*-- flush/finish end? --*/ + if (s->avail_in_expect == 0) break; + progress_in = True; + ADD_CHAR_TO_BLOCK ( s, (UInt32)(*((UChar*)(s->strm->next_in))) ); + s->strm->next_in++; + s->strm->avail_in--; + s->strm->total_in_lo32++; + if (s->strm->total_in_lo32 == 0) s->strm->total_in_hi32++; + s->avail_in_expect--; + } + } + return progress_in; +} + + +/*---------------------------------------------------*/ +static +Bool copy_output_until_stop ( EState* s ) +{ + Bool progress_out = False; + + while (True) { + + /*-- no output space? --*/ + if (s->strm->avail_out == 0) break; + + /*-- block done? --*/ + if (s->state_out_pos >= s->numZ) break; + + progress_out = True; + *(s->strm->next_out) = s->zbits[s->state_out_pos]; + s->state_out_pos++; + s->strm->avail_out--; + s->strm->next_out++; + s->strm->total_out_lo32++; + if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++; + } + + return progress_out; +} + + +/*---------------------------------------------------*/ +static +Bool handle_compress ( bz_stream* strm ) +{ + Bool progress_in = False; + Bool progress_out = False; + EState* s = strm->state; + + while (True) { + + if (s->state == BZ_S_OUTPUT) { + progress_out |= copy_output_until_stop ( s ); + if (s->state_out_pos < s->numZ) break; + if (s->mode == BZ_M_FINISHING && + s->avail_in_expect == 0 && + isempty_RL(s)) break; + prepare_new_block ( s ); + s->state = BZ_S_INPUT; + if (s->mode == BZ_M_FLUSHING && + s->avail_in_expect == 0 && + isempty_RL(s)) break; + } + + if (s->state == BZ_S_INPUT) { + progress_in |= copy_input_until_stop ( s ); + if (s->mode != BZ_M_RUNNING && s->avail_in_expect == 0) { + flush_RL ( s ); + BZ2_compressBlock ( s, (Bool)(s->mode == BZ_M_FINISHING) ); + s->state = BZ_S_OUTPUT; + } + else + if (s->nblock >= s->nblockMAX) { + BZ2_compressBlock ( s, False ); + s->state = BZ_S_OUTPUT; + } + else + if (s->strm->avail_in == 0) { + break; + } + } + + } + + return progress_in || progress_out; +} + + +/*---------------------------------------------------*/ +int BZ_API(BZ2_bzCompress) ( bz_stream *strm, int action ) +{ + Bool progress; + EState* s; + if (strm == NULL) return BZ_PARAM_ERROR; + s = strm->state; + if (s == NULL) return BZ_PARAM_ERROR; + if (s->strm != strm) return BZ_PARAM_ERROR; + + preswitch: + switch (s->mode) { + + case BZ_M_IDLE: + return BZ_SEQUENCE_ERROR; + + case BZ_M_RUNNING: + if (action == BZ_RUN) { + progress = handle_compress ( strm ); + return progress ? BZ_RUN_OK : BZ_PARAM_ERROR; + } + else + if (action == BZ_FLUSH) { + s->avail_in_expect = strm->avail_in; + s->mode = BZ_M_FLUSHING; + goto preswitch; + } + else + if (action == BZ_FINISH) { + s->avail_in_expect = strm->avail_in; + s->mode = BZ_M_FINISHING; + goto preswitch; + } + else + return BZ_PARAM_ERROR; + + case BZ_M_FLUSHING: + if (action != BZ_FLUSH) return BZ_SEQUENCE_ERROR; + if (s->avail_in_expect != s->strm->avail_in) + return BZ_SEQUENCE_ERROR; + progress = handle_compress ( strm ); + if (s->avail_in_expect > 0 || !isempty_RL(s) || + s->state_out_pos < s->numZ) return BZ_FLUSH_OK; + s->mode = BZ_M_RUNNING; + return BZ_RUN_OK; + + case BZ_M_FINISHING: + if (action != BZ_FINISH) return BZ_SEQUENCE_ERROR; + if (s->avail_in_expect != s->strm->avail_in) + return BZ_SEQUENCE_ERROR; + progress = handle_compress ( strm ); + if (!progress) return BZ_SEQUENCE_ERROR; + if (s->avail_in_expect > 0 || !isempty_RL(s) || + s->state_out_pos < s->numZ) return BZ_FINISH_OK; + s->mode = BZ_M_IDLE; + return BZ_STREAM_END; + } + return BZ_OK; /*--not reached--*/ +} + + +/*---------------------------------------------------*/ +int BZ_API(BZ2_bzCompressEnd) ( bz_stream *strm ) +{ + EState* s; + if (strm == NULL) return BZ_PARAM_ERROR; + s = strm->state; + if (s == NULL) return BZ_PARAM_ERROR; + if (s->strm != strm) return BZ_PARAM_ERROR; + + if (s->arr1 != NULL) BZFREE(s->arr1); + if (s->arr2 != NULL) BZFREE(s->arr2); + if (s->ftab != NULL) BZFREE(s->ftab); + BZFREE(strm->state); + + strm->state = NULL; + + return BZ_OK; +} + + +/*---------------------------------------------------*/ +/*--- Decompression stuff ---*/ +/*---------------------------------------------------*/ + +/*---------------------------------------------------*/ +int BZ_API(BZ2_bzDecompressInit) + ( bz_stream* strm, + int verbosity, + int small ) +{ + DState* s; + + if (!bz_config_ok()) return BZ_CONFIG_ERROR; + + if (strm == NULL) return BZ_PARAM_ERROR; + if (small != 0 && small != 1) return BZ_PARAM_ERROR; + if (verbosity < 0 || verbosity > 4) return BZ_PARAM_ERROR; + + if (strm->bzalloc == NULL) strm->bzalloc = default_bzalloc; + if (strm->bzfree == NULL) strm->bzfree = default_bzfree; + + s = BZALLOC( sizeof(DState) ); + if (s == NULL) return BZ_MEM_ERROR; + s->strm = strm; + strm->state = s; + s->state = BZ_X_MAGIC_1; + s->bsLive = 0; + s->bsBuff = 0; + s->calculatedCombinedCRC = 0; + strm->total_in_lo32 = 0; + strm->total_in_hi32 = 0; + strm->total_out_lo32 = 0; + strm->total_out_hi32 = 0; + s->smallDecompress = (Bool)small; + s->ll4 = NULL; + s->ll16 = NULL; + s->tt = NULL; + s->currBlockNo = 0; + s->verbosity = verbosity; + + return BZ_OK; +} + + +/*---------------------------------------------------*/ +/* Return True iff data corruption is discovered. + Returns False if there is no problem. +*/ +static +Bool unRLE_obuf_to_output_FAST ( DState* s ) +{ + UChar k1; + + if (s->blockRandomised) { + + while (True) { + /* try to finish existing run */ + while (True) { + if (s->strm->avail_out == 0) return False; + if (s->state_out_len == 0) break; + *( (UChar*)(s->strm->next_out) ) = s->state_out_ch; + BZ_UPDATE_CRC ( s->calculatedBlockCRC, s->state_out_ch ); + s->state_out_len--; + s->strm->next_out++; + s->strm->avail_out--; + s->strm->total_out_lo32++; + if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++; + } + + /* can a new run be started? */ + if (s->nblock_used == s->save_nblock+1) return False; + + /* Only caused by corrupt data stream? */ + if (s->nblock_used > s->save_nblock+1) + return True; + + s->state_out_len = 1; + s->state_out_ch = s->k0; + BZ_GET_FAST(k1); BZ_RAND_UPD_MASK; + k1 ^= BZ_RAND_MASK; s->nblock_used++; + if (s->nblock_used == s->save_nblock+1) continue; + if (k1 != s->k0) { s->k0 = k1; continue; }; + + s->state_out_len = 2; + BZ_GET_FAST(k1); BZ_RAND_UPD_MASK; + k1 ^= BZ_RAND_MASK; s->nblock_used++; + if (s->nblock_used == s->save_nblock+1) continue; + if (k1 != s->k0) { s->k0 = k1; continue; }; + + s->state_out_len = 3; + BZ_GET_FAST(k1); BZ_RAND_UPD_MASK; + k1 ^= BZ_RAND_MASK; s->nblock_used++; + if (s->nblock_used == s->save_nblock+1) continue; + if (k1 != s->k0) { s->k0 = k1; continue; }; + + BZ_GET_FAST(k1); BZ_RAND_UPD_MASK; + k1 ^= BZ_RAND_MASK; s->nblock_used++; + s->state_out_len = ((Int32)k1) + 4; + BZ_GET_FAST(s->k0); BZ_RAND_UPD_MASK; + s->k0 ^= BZ_RAND_MASK; s->nblock_used++; + } + + } else { + + /* restore */ + UInt32 c_calculatedBlockCRC = s->calculatedBlockCRC; + UChar c_state_out_ch = s->state_out_ch; + Int32 c_state_out_len = s->state_out_len; + Int32 c_nblock_used = s->nblock_used; + Int32 c_k0 = s->k0; + UInt32* c_tt = s->tt; + UInt32 c_tPos = s->tPos; + char* cs_next_out = s->strm->next_out; + unsigned int cs_avail_out = s->strm->avail_out; + Int32 ro_blockSize100k = s->blockSize100k; + /* end restore */ + + UInt32 avail_out_INIT = cs_avail_out; + Int32 s_save_nblockPP = s->save_nblock+1; + unsigned int total_out_lo32_old; + + while (True) { + + /* try to finish existing run */ + if (c_state_out_len > 0) { + while (True) { + if (cs_avail_out == 0) goto return_notr; + if (c_state_out_len == 1) break; + *( (UChar*)(cs_next_out) ) = c_state_out_ch; + BZ_UPDATE_CRC ( c_calculatedBlockCRC, c_state_out_ch ); + c_state_out_len--; + cs_next_out++; + cs_avail_out--; + } + s_state_out_len_eq_one: + { + if (cs_avail_out == 0) { + c_state_out_len = 1; goto return_notr; + }; + *( (UChar*)(cs_next_out) ) = c_state_out_ch; + BZ_UPDATE_CRC ( c_calculatedBlockCRC, c_state_out_ch ); + cs_next_out++; + cs_avail_out--; + } + } + /* Only caused by corrupt data stream? */ + if (c_nblock_used > s_save_nblockPP) + return True; + + /* can a new run be started? */ + if (c_nblock_used == s_save_nblockPP) { + c_state_out_len = 0; goto return_notr; + }; + c_state_out_ch = c_k0; + BZ_GET_FAST_C(k1); c_nblock_used++; + if (k1 != c_k0) { + c_k0 = k1; goto s_state_out_len_eq_one; + }; + if (c_nblock_used == s_save_nblockPP) + goto s_state_out_len_eq_one; + + c_state_out_len = 2; + BZ_GET_FAST_C(k1); c_nblock_used++; + if (c_nblock_used == s_save_nblockPP) continue; + if (k1 != c_k0) { c_k0 = k1; continue; }; + + c_state_out_len = 3; + BZ_GET_FAST_C(k1); c_nblock_used++; + if (c_nblock_used == s_save_nblockPP) continue; + if (k1 != c_k0) { c_k0 = k1; continue; }; + + BZ_GET_FAST_C(k1); c_nblock_used++; + c_state_out_len = ((Int32)k1) + 4; + BZ_GET_FAST_C(c_k0); c_nblock_used++; + } + + return_notr: + total_out_lo32_old = s->strm->total_out_lo32; + s->strm->total_out_lo32 += (avail_out_INIT - cs_avail_out); + if (s->strm->total_out_lo32 < total_out_lo32_old) + s->strm->total_out_hi32++; + + /* save */ + s->calculatedBlockCRC = c_calculatedBlockCRC; + s->state_out_ch = c_state_out_ch; + s->state_out_len = c_state_out_len; + s->nblock_used = c_nblock_used; + s->k0 = c_k0; + s->tt = c_tt; + s->tPos = c_tPos; + s->strm->next_out = cs_next_out; + s->strm->avail_out = cs_avail_out; + /* end save */ + } + return False; +} + + + +/*---------------------------------------------------*/ +__inline__ Int32 BZ2_indexIntoF ( Int32 indx, Int32 *cftab ) +{ + Int32 nb, na, mid; + nb = 0; + na = 256; + do { + mid = (nb + na) >> 1; + if (indx >= cftab[mid]) nb = mid; else na = mid; + } + while (na - nb != 1); + return nb; +} + + +/*---------------------------------------------------*/ +/* Return True iff data corruption is discovered. + Returns False if there is no problem. +*/ +static +Bool unRLE_obuf_to_output_SMALL ( DState* s ) +{ + UChar k1; + + if (s->blockRandomised) { + + while (True) { + /* try to finish existing run */ + while (True) { + if (s->strm->avail_out == 0) return False; + if (s->state_out_len == 0) break; + *( (UChar*)(s->strm->next_out) ) = s->state_out_ch; + BZ_UPDATE_CRC ( s->calculatedBlockCRC, s->state_out_ch ); + s->state_out_len--; + s->strm->next_out++; + s->strm->avail_out--; + s->strm->total_out_lo32++; + if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++; + } + + /* can a new run be started? */ + if (s->nblock_used == s->save_nblock+1) return False; + + /* Only caused by corrupt data stream? */ + if (s->nblock_used > s->save_nblock+1) + return True; + + s->state_out_len = 1; + s->state_out_ch = s->k0; + BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK; + k1 ^= BZ_RAND_MASK; s->nblock_used++; + if (s->nblock_used == s->save_nblock+1) continue; + if (k1 != s->k0) { s->k0 = k1; continue; }; + + s->state_out_len = 2; + BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK; + k1 ^= BZ_RAND_MASK; s->nblock_used++; + if (s->nblock_used == s->save_nblock+1) continue; + if (k1 != s->k0) { s->k0 = k1; continue; }; + + s->state_out_len = 3; + BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK; + k1 ^= BZ_RAND_MASK; s->nblock_used++; + if (s->nblock_used == s->save_nblock+1) continue; + if (k1 != s->k0) { s->k0 = k1; continue; }; + + BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK; + k1 ^= BZ_RAND_MASK; s->nblock_used++; + s->state_out_len = ((Int32)k1) + 4; + BZ_GET_SMALL(s->k0); BZ_RAND_UPD_MASK; + s->k0 ^= BZ_RAND_MASK; s->nblock_used++; + } + + } else { + + while (True) { + /* try to finish existing run */ + while (True) { + if (s->strm->avail_out == 0) return False; + if (s->state_out_len == 0) break; + *( (UChar*)(s->strm->next_out) ) = s->state_out_ch; + BZ_UPDATE_CRC ( s->calculatedBlockCRC, s->state_out_ch ); + s->state_out_len--; + s->strm->next_out++; + s->strm->avail_out--; + s->strm->total_out_lo32++; + if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++; + } + + /* can a new run be started? */ + if (s->nblock_used == s->save_nblock+1) return False; + + /* Only caused by corrupt data stream? */ + if (s->nblock_used > s->save_nblock+1) + return True; + + s->state_out_len = 1; + s->state_out_ch = s->k0; + BZ_GET_SMALL(k1); s->nblock_used++; + if (s->nblock_used == s->save_nblock+1) continue; + if (k1 != s->k0) { s->k0 = k1; continue; }; + + s->state_out_len = 2; + BZ_GET_SMALL(k1); s->nblock_used++; + if (s->nblock_used == s->save_nblock+1) continue; + if (k1 != s->k0) { s->k0 = k1; continue; }; + + s->state_out_len = 3; + BZ_GET_SMALL(k1); s->nblock_used++; + if (s->nblock_used == s->save_nblock+1) continue; + if (k1 != s->k0) { s->k0 = k1; continue; }; + + BZ_GET_SMALL(k1); s->nblock_used++; + s->state_out_len = ((Int32)k1) + 4; + BZ_GET_SMALL(s->k0); s->nblock_used++; + } + + } +} + + +/*---------------------------------------------------*/ +int BZ_API(BZ2_bzDecompress) ( bz_stream *strm ) +{ + Bool corrupt; + DState* s; + if (strm == NULL) return BZ_PARAM_ERROR; + s = strm->state; + if (s == NULL) return BZ_PARAM_ERROR; + if (s->strm != strm) return BZ_PARAM_ERROR; + + while (True) { + if (s->state == BZ_X_IDLE) return BZ_SEQUENCE_ERROR; + if (s->state == BZ_X_OUTPUT) { + if (s->smallDecompress) + corrupt = unRLE_obuf_to_output_SMALL ( s ); else + corrupt = unRLE_obuf_to_output_FAST ( s ); + if (corrupt) return BZ_DATA_ERROR; + if (s->nblock_used == s->save_nblock+1 && s->state_out_len == 0) { + BZ_FINALISE_CRC ( s->calculatedBlockCRC ); + if (s->verbosity >= 3) + VPrintf2 ( " {0x%08x, 0x%08x}", s->storedBlockCRC, + s->calculatedBlockCRC ); + if (s->verbosity >= 2) VPrintf0 ( "]" ); + if (s->calculatedBlockCRC != s->storedBlockCRC) + return BZ_DATA_ERROR; + s->calculatedCombinedCRC + = (s->calculatedCombinedCRC << 1) | + (s->calculatedCombinedCRC >> 31); + s->calculatedCombinedCRC ^= s->calculatedBlockCRC; + s->state = BZ_X_BLKHDR_1; + } else { + return BZ_OK; + } + } + if (s->state >= BZ_X_MAGIC_1) { + Int32 r = BZ2_decompress ( s ); + if (r == BZ_STREAM_END) { + if (s->verbosity >= 3) + VPrintf2 ( "\n combined CRCs: stored = 0x%08x, computed = 0x%08x", + s->storedCombinedCRC, s->calculatedCombinedCRC ); + if (s->calculatedCombinedCRC != s->storedCombinedCRC) + return BZ_DATA_ERROR; + return r; + } + if (s->state != BZ_X_OUTPUT) return r; + } + } + + AssertH ( 0, 6001 ); + + return 0; /*NOTREACHED*/ +} + + +/*---------------------------------------------------*/ +int BZ_API(BZ2_bzDecompressEnd) ( bz_stream *strm ) +{ + DState* s; + if (strm == NULL) return BZ_PARAM_ERROR; + s = strm->state; + if (s == NULL) return BZ_PARAM_ERROR; + if (s->strm != strm) return BZ_PARAM_ERROR; + + if (s->tt != NULL) BZFREE(s->tt); + if (s->ll16 != NULL) BZFREE(s->ll16); + if (s->ll4 != NULL) BZFREE(s->ll4); + + BZFREE(strm->state); + strm->state = NULL; + + return BZ_OK; +} + + +#ifndef BZ_NO_STDIO +/*---------------------------------------------------*/ +/*--- File I/O stuff ---*/ +/*---------------------------------------------------*/ + +#define BZ_SETERR(eee) \ +{ \ + if (bzerror != NULL) *bzerror = eee; \ + if (bzf != NULL) bzf->lastErr = eee; \ +} + +typedef + struct { + FILE* handle; + Char buf[BZ_MAX_UNUSED]; + Int32 bufN; + Bool writing; + bz_stream strm; + Int32 lastErr; + Bool initialisedOk; + } + bzFile; + + +/*---------------------------------------------*/ +static Bool myfeof ( FILE* f ) +{ + Int32 c = fgetc ( f ); + if (c == EOF) return True; + ungetc ( c, f ); + return False; +} + + +/*---------------------------------------------------*/ +BZFILE* BZ_API(BZ2_bzWriteOpen) + ( int* bzerror, + FILE* f, + int blockSize100k, + int verbosity, + int workFactor ) +{ + Int32 ret; + bzFile* bzf = NULL; + + BZ_SETERR(BZ_OK); + + if (f == NULL || + (blockSize100k < 1 || blockSize100k > 9) || + (workFactor < 0 || workFactor > 250) || + (verbosity < 0 || verbosity > 4)) + { BZ_SETERR(BZ_PARAM_ERROR); return NULL; }; + + if (ferror(f)) + { BZ_SETERR(BZ_IO_ERROR); return NULL; }; + + bzf = malloc ( sizeof(bzFile) ); + if (bzf == NULL) + { BZ_SETERR(BZ_MEM_ERROR); return NULL; }; + + BZ_SETERR(BZ_OK); + bzf->initialisedOk = False; + bzf->bufN = 0; + bzf->handle = f; + bzf->writing = True; + bzf->strm.bzalloc = NULL; + bzf->strm.bzfree = NULL; + bzf->strm.opaque = NULL; + + if (workFactor == 0) workFactor = 30; + ret = BZ2_bzCompressInit ( &(bzf->strm), blockSize100k, + verbosity, workFactor ); + if (ret != BZ_OK) + { BZ_SETERR(ret); free(bzf); return NULL; }; + + bzf->strm.avail_in = 0; + bzf->initialisedOk = True; + return bzf; +} + + + +/*---------------------------------------------------*/ +void BZ_API(BZ2_bzWrite) + ( int* bzerror, + BZFILE* b, + void* buf, + int len ) +{ + Int32 n, n2, ret; + bzFile* bzf = (bzFile*)b; + + BZ_SETERR(BZ_OK); + if (bzf == NULL || buf == NULL || len < 0) + { BZ_SETERR(BZ_PARAM_ERROR); return; }; + if (!(bzf->writing)) + { BZ_SETERR(BZ_SEQUENCE_ERROR); return; }; + if (ferror(bzf->handle)) + { BZ_SETERR(BZ_IO_ERROR); return; }; + + if (len == 0) + { BZ_SETERR(BZ_OK); return; }; + + bzf->strm.avail_in = len; + bzf->strm.next_in = buf; + + while (True) { + bzf->strm.avail_out = BZ_MAX_UNUSED; + bzf->strm.next_out = bzf->buf; + ret = BZ2_bzCompress ( &(bzf->strm), BZ_RUN ); + if (ret != BZ_RUN_OK) + { BZ_SETERR(ret); return; }; + + if (bzf->strm.avail_out < BZ_MAX_UNUSED) { + n = BZ_MAX_UNUSED - bzf->strm.avail_out; + n2 = fwrite ( (void*)(bzf->buf), sizeof(UChar), + n, bzf->handle ); + if (n != n2 || ferror(bzf->handle)) + { BZ_SETERR(BZ_IO_ERROR); return; }; + } + + if (bzf->strm.avail_in == 0) + { BZ_SETERR(BZ_OK); return; }; + } +} + + +/*---------------------------------------------------*/ +void BZ_API(BZ2_bzWriteClose) + ( int* bzerror, + BZFILE* b, + int abandon, + unsigned int* nbytes_in, + unsigned int* nbytes_out ) +{ + BZ2_bzWriteClose64 ( bzerror, b, abandon, + nbytes_in, NULL, nbytes_out, NULL ); +} + + +void BZ_API(BZ2_bzWriteClose64) + ( int* bzerror, + BZFILE* b, + int abandon, + unsigned int* nbytes_in_lo32, + unsigned int* nbytes_in_hi32, + unsigned int* nbytes_out_lo32, + unsigned int* nbytes_out_hi32 ) +{ + Int32 n, n2, ret; + bzFile* bzf = (bzFile*)b; + + if (bzf == NULL) + { BZ_SETERR(BZ_OK); return; }; + if (!(bzf->writing)) + { BZ_SETERR(BZ_SEQUENCE_ERROR); return; }; + if (ferror(bzf->handle)) + { BZ_SETERR(BZ_IO_ERROR); return; }; + + if (nbytes_in_lo32 != NULL) *nbytes_in_lo32 = 0; + if (nbytes_in_hi32 != NULL) *nbytes_in_hi32 = 0; + if (nbytes_out_lo32 != NULL) *nbytes_out_lo32 = 0; + if (nbytes_out_hi32 != NULL) *nbytes_out_hi32 = 0; + + if ((!abandon) && bzf->lastErr == BZ_OK) { + while (True) { + bzf->strm.avail_out = BZ_MAX_UNUSED; + bzf->strm.next_out = bzf->buf; + ret = BZ2_bzCompress ( &(bzf->strm), BZ_FINISH ); + if (ret != BZ_FINISH_OK && ret != BZ_STREAM_END) + { BZ_SETERR(ret); return; }; + + if (bzf->strm.avail_out < BZ_MAX_UNUSED) { + n = BZ_MAX_UNUSED - bzf->strm.avail_out; + n2 = fwrite ( (void*)(bzf->buf), sizeof(UChar), + n, bzf->handle ); + if (n != n2 || ferror(bzf->handle)) + { BZ_SETERR(BZ_IO_ERROR); return; }; + } + + if (ret == BZ_STREAM_END) break; + } + } + + if ( !abandon && !ferror ( bzf->handle ) ) { + fflush ( bzf->handle ); + if (ferror(bzf->handle)) + { BZ_SETERR(BZ_IO_ERROR); return; }; + } + + if (nbytes_in_lo32 != NULL) + *nbytes_in_lo32 = bzf->strm.total_in_lo32; + if (nbytes_in_hi32 != NULL) + *nbytes_in_hi32 = bzf->strm.total_in_hi32; + if (nbytes_out_lo32 != NULL) + *nbytes_out_lo32 = bzf->strm.total_out_lo32; + if (nbytes_out_hi32 != NULL) + *nbytes_out_hi32 = bzf->strm.total_out_hi32; + + BZ_SETERR(BZ_OK); + BZ2_bzCompressEnd ( &(bzf->strm) ); + free ( bzf ); +} + + +/*---------------------------------------------------*/ +BZFILE* BZ_API(BZ2_bzReadOpen) + ( int* bzerror, + FILE* f, + int verbosity, + int small, + void* unused, + int nUnused ) +{ + bzFile* bzf = NULL; + int ret; + + BZ_SETERR(BZ_OK); + + if (f == NULL || + (small != 0 && small != 1) || + (verbosity < 0 || verbosity > 4) || + (unused == NULL && nUnused != 0) || + (unused != NULL && (nUnused < 0 || nUnused > BZ_MAX_UNUSED))) + { BZ_SETERR(BZ_PARAM_ERROR); return NULL; }; + + if (ferror(f)) + { BZ_SETERR(BZ_IO_ERROR); return NULL; }; + + bzf = malloc ( sizeof(bzFile) ); + if (bzf == NULL) + { BZ_SETERR(BZ_MEM_ERROR); return NULL; }; + + BZ_SETERR(BZ_OK); + + bzf->initialisedOk = False; + bzf->handle = f; + bzf->bufN = 0; + bzf->writing = False; + bzf->strm.bzalloc = NULL; + bzf->strm.bzfree = NULL; + bzf->strm.opaque = NULL; + + while (nUnused > 0) { + bzf->buf[bzf->bufN] = *((UChar*)(unused)); bzf->bufN++; + unused = ((void*)( 1 + ((UChar*)(unused)) )); + nUnused--; + } + + ret = BZ2_bzDecompressInit ( &(bzf->strm), verbosity, small ); + if (ret != BZ_OK) + { BZ_SETERR(ret); free(bzf); return NULL; }; + + bzf->strm.avail_in = bzf->bufN; + bzf->strm.next_in = bzf->buf; + + bzf->initialisedOk = True; + return bzf; +} + + +/*---------------------------------------------------*/ +void BZ_API(BZ2_bzReadClose) ( int *bzerror, BZFILE *b ) +{ + bzFile* bzf = (bzFile*)b; + + BZ_SETERR(BZ_OK); + if (bzf == NULL) + { BZ_SETERR(BZ_OK); return; }; + + if (bzf->writing) + { BZ_SETERR(BZ_SEQUENCE_ERROR); return; }; + + if (bzf->initialisedOk) + (void)BZ2_bzDecompressEnd ( &(bzf->strm) ); + free ( bzf ); +} + + +/*---------------------------------------------------*/ +int BZ_API(BZ2_bzRead) + ( int* bzerror, + BZFILE* b, + void* buf, + int len ) +{ + Int32 n, ret; + bzFile* bzf = (bzFile*)b; + + BZ_SETERR(BZ_OK); + + if (bzf == NULL || buf == NULL || len < 0) + { BZ_SETERR(BZ_PARAM_ERROR); return 0; }; + + if (bzf->writing) + { BZ_SETERR(BZ_SEQUENCE_ERROR); return 0; }; + + if (len == 0) + { BZ_SETERR(BZ_OK); return 0; }; + + bzf->strm.avail_out = len; + bzf->strm.next_out = buf; + + while (True) { + + if (ferror(bzf->handle)) + { BZ_SETERR(BZ_IO_ERROR); return 0; }; + + if (bzf->strm.avail_in == 0 && !myfeof(bzf->handle)) { + n = fread ( bzf->buf, sizeof(UChar), + BZ_MAX_UNUSED, bzf->handle ); + if (ferror(bzf->handle)) + { BZ_SETERR(BZ_IO_ERROR); return 0; }; + bzf->bufN = n; + bzf->strm.avail_in = bzf->bufN; + bzf->strm.next_in = bzf->buf; + } + + ret = BZ2_bzDecompress ( &(bzf->strm) ); + + if (ret != BZ_OK && ret != BZ_STREAM_END) + { BZ_SETERR(ret); return 0; }; + + if (ret == BZ_OK && myfeof(bzf->handle) && + bzf->strm.avail_in == 0 && bzf->strm.avail_out > 0) + { BZ_SETERR(BZ_UNEXPECTED_EOF); return 0; }; + + if (ret == BZ_STREAM_END) + { BZ_SETERR(BZ_STREAM_END); + return len - bzf->strm.avail_out; }; + if (bzf->strm.avail_out == 0) + { BZ_SETERR(BZ_OK); return len; }; + + } + + return 0; /*not reached*/ +} + + +/*---------------------------------------------------*/ +void BZ_API(BZ2_bzReadGetUnused) + ( int* bzerror, + BZFILE* b, + void** unused, + int* nUnused ) +{ + bzFile* bzf = (bzFile*)b; + if (bzf == NULL) + { BZ_SETERR(BZ_PARAM_ERROR); return; }; + if (bzf->lastErr != BZ_STREAM_END) + { BZ_SETERR(BZ_SEQUENCE_ERROR); return; }; + if (unused == NULL || nUnused == NULL) + { BZ_SETERR(BZ_PARAM_ERROR); return; }; + + BZ_SETERR(BZ_OK); + *nUnused = bzf->strm.avail_in; + *unused = bzf->strm.next_in; +} +#endif + + +/*---------------------------------------------------*/ +/*--- Misc convenience stuff ---*/ +/*---------------------------------------------------*/ + +/*---------------------------------------------------*/ +int BZ_API(BZ2_bzBuffToBuffCompress) + ( char* dest, + unsigned int* destLen, + char* source, + unsigned int sourceLen, + int blockSize100k, + int verbosity, + int workFactor ) +{ + bz_stream strm; + int ret; + + if (dest == NULL || destLen == NULL || + source == NULL || + blockSize100k < 1 || blockSize100k > 9 || + verbosity < 0 || verbosity > 4 || + workFactor < 0 || workFactor > 250) + return BZ_PARAM_ERROR; + + if (workFactor == 0) workFactor = 30; + strm.bzalloc = NULL; + strm.bzfree = NULL; + strm.opaque = NULL; + ret = BZ2_bzCompressInit ( &strm, blockSize100k, + verbosity, workFactor ); + if (ret != BZ_OK) return ret; + + strm.next_in = source; + strm.next_out = dest; + strm.avail_in = sourceLen; + strm.avail_out = *destLen; + + ret = BZ2_bzCompress ( &strm, BZ_FINISH ); + if (ret == BZ_FINISH_OK) goto output_overflow; + if (ret != BZ_STREAM_END) goto errhandler; + + /* normal termination */ + *destLen -= strm.avail_out; + BZ2_bzCompressEnd ( &strm ); + return BZ_OK; + + output_overflow: + BZ2_bzCompressEnd ( &strm ); + return BZ_OUTBUFF_FULL; + + errhandler: + BZ2_bzCompressEnd ( &strm ); + return ret; +} + + +/*---------------------------------------------------*/ +int BZ_API(BZ2_bzBuffToBuffDecompress) + ( char* dest, + unsigned int* destLen, + char* source, + unsigned int sourceLen, + int small, + int verbosity ) +{ + bz_stream strm; + int ret; + + if (dest == NULL || destLen == NULL || + source == NULL || + (small != 0 && small != 1) || + verbosity < 0 || verbosity > 4) + return BZ_PARAM_ERROR; + + strm.bzalloc = NULL; + strm.bzfree = NULL; + strm.opaque = NULL; + ret = BZ2_bzDecompressInit ( &strm, verbosity, small ); + if (ret != BZ_OK) return ret; + + strm.next_in = source; + strm.next_out = dest; + strm.avail_in = sourceLen; + strm.avail_out = *destLen; + + ret = BZ2_bzDecompress ( &strm ); + if (ret == BZ_OK) goto output_overflow_or_eof; + if (ret != BZ_STREAM_END) goto errhandler; + + /* normal termination */ + *destLen -= strm.avail_out; + BZ2_bzDecompressEnd ( &strm ); + return BZ_OK; + + output_overflow_or_eof: + if (strm.avail_out > 0) { + BZ2_bzDecompressEnd ( &strm ); + return BZ_UNEXPECTED_EOF; + } else { + BZ2_bzDecompressEnd ( &strm ); + return BZ_OUTBUFF_FULL; + }; + + errhandler: + BZ2_bzDecompressEnd ( &strm ); + return ret; +} + + +/*---------------------------------------------------*/ +/*-- + Code contributed by Yoshioka Tsuneo (tsuneo@rr.iij4u.or.jp) + to support better zlib compatibility. + This code is not _officially_ part of libbzip2 (yet); + I haven't tested it, documented it, or considered the + threading-safeness of it. + If this code breaks, please contact both Yoshioka and me. +--*/ +/*---------------------------------------------------*/ + +/*---------------------------------------------------*/ +/*-- + return version like "0.9.5d, 4-Sept-1999". +--*/ +const char * BZ_API(BZ2_bzlibVersion)(void) +{ + return BZ_VERSION; +} + + +#ifndef BZ_NO_STDIO +/*---------------------------------------------------*/ + +#if defined(_WIN32) || defined(OS2) || defined(MSDOS) +# include +# include +# define SET_BINARY_MODE(file) _setmode(_fileno(file),O_BINARY) +#else +# define SET_BINARY_MODE(file) +#endif +static +BZFILE * bzopen_or_bzdopen + ( const char *path, /* no use when bzdopen */ + int fd, /* no use when bzdopen */ + const char *mode, + int open_mode) /* bzopen: 0, bzdopen:1 */ +{ + int bzerr; + char unused[BZ_MAX_UNUSED]; + int blockSize100k = 9; + int writing = 0; + char mode2[10] = ""; + FILE *fp = NULL; + BZFILE *bzfp = NULL; + int verbosity = 0; + int workFactor = 30; + int smallMode = 0; + int nUnused = 0; + + if (mode == NULL) return NULL; + while (*mode) { + switch (*mode) { + case 'r': + writing = 0; break; + case 'w': + writing = 1; break; + case 's': + smallMode = 1; break; + default: + if (isdigit((int)(*mode))) { + blockSize100k = *mode-BZ_HDR_0; + } + } + mode++; + } + strcat(mode2, writing ? "w" : "r" ); + strcat(mode2,"b"); /* binary mode */ + + if (open_mode==0) { + if (path==NULL || strcmp(path,"")==0) { + fp = (writing ? stdout : stdin); + SET_BINARY_MODE(fp); + } else { + fp = fopen(path,mode2); + } + } else { +#ifdef BZ_STRICT_ANSI + fp = NULL; +#else + fp = _fdopen(fd,mode2); +#endif + } + if (fp == NULL) return NULL; + + if (writing) { + /* Guard against total chaos and anarchy -- JRS */ + if (blockSize100k < 1) blockSize100k = 1; + if (blockSize100k > 9) blockSize100k = 9; + bzfp = BZ2_bzWriteOpen(&bzerr,fp,blockSize100k, + verbosity,workFactor); + } else { + bzfp = BZ2_bzReadOpen(&bzerr,fp,verbosity,smallMode, + unused,nUnused); + } + if (bzfp == NULL) { + if (fp != stdin && fp != stdout) fclose(fp); + return NULL; + } + return bzfp; +} + + +/*---------------------------------------------------*/ +/*-- + open file for read or write. + ex) bzopen("file","w9") + case path="" or NULL => use stdin or stdout. +--*/ +BZFILE * BZ_API(BZ2_bzopen) + ( const char *path, + const char *mode ) +{ + return bzopen_or_bzdopen(path,-1,mode,/*bzopen*/0); +} + + +/*---------------------------------------------------*/ +BZFILE * BZ_API(BZ2_bzdopen) + ( int fd, + const char *mode ) +{ + return bzopen_or_bzdopen(NULL,fd,mode,/*bzdopen*/1); +} + + +/*---------------------------------------------------*/ +int BZ_API(BZ2_bzread) (BZFILE* b, void* buf, int len ) +{ + int bzerr, nread; + if (((bzFile*)b)->lastErr == BZ_STREAM_END) return 0; + nread = BZ2_bzRead(&bzerr,b,buf,len); + if (bzerr == BZ_OK || bzerr == BZ_STREAM_END) { + return nread; + } else { + return -1; + } +} + + +/*---------------------------------------------------*/ +int BZ_API(BZ2_bzwrite) (BZFILE* b, void* buf, int len ) +{ + int bzerr; + + BZ2_bzWrite(&bzerr,b,buf,len); + if(bzerr == BZ_OK){ + return len; + }else{ + return -1; + } +} + + +/*---------------------------------------------------*/ +int BZ_API(BZ2_bzflush) (BZFILE *b) +{ + /* do nothing now... */ + return 0; +} + + +/*---------------------------------------------------*/ +void BZ_API(BZ2_bzclose) (BZFILE* b) +{ + int bzerr; + FILE *fp; + + if (b==NULL) {return;} + fp = ((bzFile *)b)->handle; + if(((bzFile*)b)->writing){ + BZ2_bzWriteClose(&bzerr,b,0,NULL,NULL); + if(bzerr != BZ_OK){ + BZ2_bzWriteClose(NULL,b,1,NULL,NULL); + } + }else{ + BZ2_bzReadClose(&bzerr,b); + } + if(fp!=stdin && fp!=stdout){ + fclose(fp); + } +} + + +/*---------------------------------------------------*/ +/*-- + return last error code +--*/ +static const char *bzerrorstrings[] = { + "OK" + ,"SEQUENCE_ERROR" + ,"PARAM_ERROR" + ,"MEM_ERROR" + ,"DATA_ERROR" + ,"DATA_ERROR_MAGIC" + ,"IO_ERROR" + ,"UNEXPECTED_EOF" + ,"OUTBUFF_FULL" + ,"CONFIG_ERROR" + ,"???" /* for future */ + ,"???" /* for future */ + ,"???" /* for future */ + ,"???" /* for future */ + ,"???" /* for future */ + ,"???" /* for future */ +}; + + +const char * BZ_API(BZ2_bzerror) (BZFILE *b, int *errnum) +{ + int err = ((bzFile *)b)->lastErr; + + if(err>0) err = 0; + *errnum = err; + return bzerrorstrings[err*-1]; +} +#endif + + +/*-------------------------------------------------------------*/ +/*--- end bzlib.c ---*/ +/*-------------------------------------------------------------*/ diff --git a/dep/StormLib/src/bzip2/bzlib.h b/dep/StormLib/src/bzip2/bzlib.h new file mode 100644 index 00000000000..c5b75d6d8ff --- /dev/null +++ b/dep/StormLib/src/bzip2/bzlib.h @@ -0,0 +1,282 @@ + +/*-------------------------------------------------------------*/ +/*--- Public header file for the library. ---*/ +/*--- bzlib.h ---*/ +/*-------------------------------------------------------------*/ + +/* ------------------------------------------------------------------ + This file is part of bzip2/libbzip2, a program and library for + lossless, block-sorting data compression. + + bzip2/libbzip2 version 1.0.5 of 10 December 2007 + Copyright (C) 1996-2007 Julian Seward + + Please read the WARNING, DISCLAIMER and PATENTS sections in the + README file. + + This program is released under the terms of the license contained + in the file LICENSE. + ------------------------------------------------------------------ */ + + +#ifndef _BZLIB_H +#define _BZLIB_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define BZ_RUN 0 +#define BZ_FLUSH 1 +#define BZ_FINISH 2 + +#define BZ_OK 0 +#define BZ_RUN_OK 1 +#define BZ_FLUSH_OK 2 +#define BZ_FINISH_OK 3 +#define BZ_STREAM_END 4 +#define BZ_SEQUENCE_ERROR (-1) +#define BZ_PARAM_ERROR (-2) +#define BZ_MEM_ERROR (-3) +#define BZ_DATA_ERROR (-4) +#define BZ_DATA_ERROR_MAGIC (-5) +#define BZ_IO_ERROR (-6) +#define BZ_UNEXPECTED_EOF (-7) +#define BZ_OUTBUFF_FULL (-8) +#define BZ_CONFIG_ERROR (-9) + +typedef + struct { + char *next_in; + unsigned int avail_in; + unsigned int total_in_lo32; + unsigned int total_in_hi32; + + char *next_out; + unsigned int avail_out; + unsigned int total_out_lo32; + unsigned int total_out_hi32; + + void *state; + + void *(*bzalloc)(void *,int,int); + void (*bzfree)(void *,void *); + void *opaque; + } + bz_stream; + + +#ifndef BZ_IMPORT +#define BZ_EXPORT +#endif + +#ifndef BZ_NO_STDIO +/* Need a definitition for FILE */ +#include +#endif + +#ifdef _WIN32 +# include +# ifdef small + /* windows.h define small to char */ +# undef small +# endif +# ifdef BZ_EXPORT +# define BZ_API(func) WINAPI func +# define BZ_EXTERN extern +# else + /* import windows dll dynamically */ +# define BZ_API(func) (WINAPI * func) +# define BZ_EXTERN +# endif +#else +# define BZ_API(func) func +# define BZ_EXTERN extern +#endif + + +/*-- Core (low-level) library functions --*/ + +BZ_EXTERN int BZ_API(BZ2_bzCompressInit) ( + bz_stream* strm, + int blockSize100k, + int verbosity, + int workFactor + ); + +BZ_EXTERN int BZ_API(BZ2_bzCompress) ( + bz_stream* strm, + int action + ); + +BZ_EXTERN int BZ_API(BZ2_bzCompressEnd) ( + bz_stream* strm + ); + +BZ_EXTERN int BZ_API(BZ2_bzDecompressInit) ( + bz_stream *strm, + int verbosity, + int small + ); + +BZ_EXTERN int BZ_API(BZ2_bzDecompress) ( + bz_stream* strm + ); + +BZ_EXTERN int BZ_API(BZ2_bzDecompressEnd) ( + bz_stream *strm + ); + + + +/*-- High(er) level library functions --*/ + +#ifndef BZ_NO_STDIO +#define BZ_MAX_UNUSED 5000 + +typedef void BZFILE; + +BZ_EXTERN BZFILE* BZ_API(BZ2_bzReadOpen) ( + int* bzerror, + FILE* f, + int verbosity, + int small, + void* unused, + int nUnused + ); + +BZ_EXTERN void BZ_API(BZ2_bzReadClose) ( + int* bzerror, + BZFILE* b + ); + +BZ_EXTERN void BZ_API(BZ2_bzReadGetUnused) ( + int* bzerror, + BZFILE* b, + void** unused, + int* nUnused + ); + +BZ_EXTERN int BZ_API(BZ2_bzRead) ( + int* bzerror, + BZFILE* b, + void* buf, + int len + ); + +BZ_EXTERN BZFILE* BZ_API(BZ2_bzWriteOpen) ( + int* bzerror, + FILE* f, + int blockSize100k, + int verbosity, + int workFactor + ); + +BZ_EXTERN void BZ_API(BZ2_bzWrite) ( + int* bzerror, + BZFILE* b, + void* buf, + int len + ); + +BZ_EXTERN void BZ_API(BZ2_bzWriteClose) ( + int* bzerror, + BZFILE* b, + int abandon, + unsigned int* nbytes_in, + unsigned int* nbytes_out + ); + +BZ_EXTERN void BZ_API(BZ2_bzWriteClose64) ( + int* bzerror, + BZFILE* b, + int abandon, + unsigned int* nbytes_in_lo32, + unsigned int* nbytes_in_hi32, + unsigned int* nbytes_out_lo32, + unsigned int* nbytes_out_hi32 + ); +#endif + + +/*-- Utility functions --*/ + +BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffCompress) ( + char* dest, + unsigned int* destLen, + char* source, + unsigned int sourceLen, + int blockSize100k, + int verbosity, + int workFactor + ); + +BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffDecompress) ( + char* dest, + unsigned int* destLen, + char* source, + unsigned int sourceLen, + int small, + int verbosity + ); + + +/*-- + Code contributed by Yoshioka Tsuneo (tsuneo@rr.iij4u.or.jp) + to support better zlib compatibility. + This code is not _officially_ part of libbzip2 (yet); + I haven't tested it, documented it, or considered the + threading-safeness of it. + If this code breaks, please contact both Yoshioka and me. +--*/ + +BZ_EXTERN const char * BZ_API(BZ2_bzlibVersion) ( + void + ); + +#ifndef BZ_NO_STDIO +BZ_EXTERN BZFILE * BZ_API(BZ2_bzopen) ( + const char *path, + const char *mode + ); + +BZ_EXTERN BZFILE * BZ_API(BZ2_bzdopen) ( + int fd, + const char *mode + ); + +BZ_EXTERN int BZ_API(BZ2_bzread) ( + BZFILE* b, + void* buf, + int len + ); + +BZ_EXTERN int BZ_API(BZ2_bzwrite) ( + BZFILE* b, + void* buf, + int len + ); + +BZ_EXTERN int BZ_API(BZ2_bzflush) ( + BZFILE* b + ); + +BZ_EXTERN void BZ_API(BZ2_bzclose) ( + BZFILE* b + ); + +BZ_EXTERN const char * BZ_API(BZ2_bzerror) ( + BZFILE *b, + int *errnum + ); +#endif + +#ifdef __cplusplus +} +#endif + +#endif + +/*-------------------------------------------------------------*/ +/*--- end bzlib.h ---*/ +/*-------------------------------------------------------------*/ diff --git a/dep/StormLib/src/bzip2/bzlib_private.h b/dep/StormLib/src/bzip2/bzlib_private.h new file mode 100644 index 00000000000..23427879b18 --- /dev/null +++ b/dep/StormLib/src/bzip2/bzlib_private.h @@ -0,0 +1,509 @@ + +/*-------------------------------------------------------------*/ +/*--- Private header file for the library. ---*/ +/*--- bzlib_private.h ---*/ +/*-------------------------------------------------------------*/ + +/* ------------------------------------------------------------------ + This file is part of bzip2/libbzip2, a program and library for + lossless, block-sorting data compression. + + bzip2/libbzip2 version 1.0.5 of 10 December 2007 + Copyright (C) 1996-2007 Julian Seward + + Please read the WARNING, DISCLAIMER and PATENTS sections in the + README file. + + This program is released under the terms of the license contained + in the file LICENSE. + ------------------------------------------------------------------ */ + + +#ifndef _BZLIB_PRIVATE_H +#define _BZLIB_PRIVATE_H + +#include + +#ifndef BZ_NO_STDIO +#include +#include +#include +#endif + +#include "bzlib.h" + + + +/*-- General stuff. --*/ + +#define BZ_VERSION "1.0.5, 10-Dec-2007" + +typedef char Char; +typedef unsigned char Bool; +typedef unsigned char UChar; +typedef int Int32; +typedef unsigned int UInt32; +typedef short Int16; +typedef unsigned short UInt16; + +#define True ((Bool)1) +#define False ((Bool)0) + +#ifndef __GNUC__ +#define __inline__ /* */ +#endif + +#ifndef BZ_NO_STDIO + +extern void BZ2_bz__AssertH__fail ( int errcode ); +#define AssertH(cond,errcode) \ + { if (!(cond)) BZ2_bz__AssertH__fail ( errcode ); } + +#if BZ_DEBUG +#define AssertD(cond,msg) \ + { if (!(cond)) { \ + fprintf ( stderr, \ + "\n\nlibbzip2(debug build): internal error\n\t%s\n", msg );\ + exit(1); \ + }} +#else +#define AssertD(cond,msg) /* */ +#endif + +#define VPrintf0(zf) \ + fprintf(stderr,zf) +#define VPrintf1(zf,za1) \ + fprintf(stderr,zf,za1) +#define VPrintf2(zf,za1,za2) \ + fprintf(stderr,zf,za1,za2) +#define VPrintf3(zf,za1,za2,za3) \ + fprintf(stderr,zf,za1,za2,za3) +#define VPrintf4(zf,za1,za2,za3,za4) \ + fprintf(stderr,zf,za1,za2,za3,za4) +#define VPrintf5(zf,za1,za2,za3,za4,za5) \ + fprintf(stderr,zf,za1,za2,za3,za4,za5) + +#else + +extern void bz_internal_error ( int errcode ); +#define AssertH(cond,errcode) \ + { if (!(cond)) bz_internal_error ( errcode ); } +#define AssertD(cond,msg) do { } while (0) +#define VPrintf0(zf) do { } while (0) +#define VPrintf1(zf,za1) do { } while (0) +#define VPrintf2(zf,za1,za2) do { } while (0) +#define VPrintf3(zf,za1,za2,za3) do { } while (0) +#define VPrintf4(zf,za1,za2,za3,za4) do { } while (0) +#define VPrintf5(zf,za1,za2,za3,za4,za5) do { } while (0) + +#endif + + +#define BZALLOC(nnn) (strm->bzalloc)(strm->opaque,(nnn),1) +#define BZFREE(ppp) (strm->bzfree)(strm->opaque,(ppp)) + + +/*-- Header bytes. --*/ + +#define BZ_HDR_B 0x42 /* 'B' */ +#define BZ_HDR_Z 0x5a /* 'Z' */ +#define BZ_HDR_h 0x68 /* 'h' */ +#define BZ_HDR_0 0x30 /* '0' */ + +/*-- Constants for the back end. --*/ + +#define BZ_MAX_ALPHA_SIZE 258 +#define BZ_MAX_CODE_LEN 23 + +#define BZ_RUNA 0 +#define BZ_RUNB 1 + +#define BZ_N_GROUPS 6 +#define BZ_G_SIZE 50 +#define BZ_N_ITERS 4 + +#define BZ_MAX_SELECTORS (2 + (900000 / BZ_G_SIZE)) + + + +/*-- Stuff for randomising repetitive blocks. --*/ + +extern Int32 BZ2_rNums[512]; + +#define BZ_RAND_DECLS \ + Int32 rNToGo; \ + Int32 rTPos \ + +#define BZ_RAND_INIT_MASK \ + s->rNToGo = 0; \ + s->rTPos = 0 \ + +#define BZ_RAND_MASK ((s->rNToGo == 1) ? 1 : 0) + +#define BZ_RAND_UPD_MASK \ + if (s->rNToGo == 0) { \ + s->rNToGo = BZ2_rNums[s->rTPos]; \ + s->rTPos++; \ + if (s->rTPos == 512) s->rTPos = 0; \ + } \ + s->rNToGo--; + + + +/*-- Stuff for doing CRCs. --*/ + +extern UInt32 BZ2_crc32Table[256]; + +#define BZ_INITIALISE_CRC(crcVar) \ +{ \ + crcVar = 0xffffffffL; \ +} + +#define BZ_FINALISE_CRC(crcVar) \ +{ \ + crcVar = ~(crcVar); \ +} + +#define BZ_UPDATE_CRC(crcVar,cha) \ +{ \ + crcVar = (crcVar << 8) ^ \ + BZ2_crc32Table[(crcVar >> 24) ^ \ + ((UChar)cha)]; \ +} + + + +/*-- States and modes for compression. --*/ + +#define BZ_M_IDLE 1 +#define BZ_M_RUNNING 2 +#define BZ_M_FLUSHING 3 +#define BZ_M_FINISHING 4 + +#define BZ_S_OUTPUT 1 +#define BZ_S_INPUT 2 + +#define BZ_N_RADIX 2 +#define BZ_N_QSORT 12 +#define BZ_N_SHELL 18 +#define BZ_N_OVERSHOOT (BZ_N_RADIX + BZ_N_QSORT + BZ_N_SHELL + 2) + + + + +/*-- Structure holding all the compression-side stuff. --*/ + +typedef + struct { + /* pointer back to the struct bz_stream */ + bz_stream* strm; + + /* mode this stream is in, and whether inputting */ + /* or outputting data */ + Int32 mode; + Int32 state; + + /* remembers avail_in when flush/finish requested */ + UInt32 avail_in_expect; + + /* for doing the block sorting */ + UInt32* arr1; + UInt32* arr2; + UInt32* ftab; + Int32 origPtr; + + /* aliases for arr1 and arr2 */ + UInt32* ptr; + UChar* block; + UInt16* mtfv; + UChar* zbits; + + /* for deciding when to use the fallback sorting algorithm */ + Int32 workFactor; + + /* run-length-encoding of the input */ + UInt32 state_in_ch; + Int32 state_in_len; + BZ_RAND_DECLS; + + /* input and output limits and current posns */ + Int32 nblock; + Int32 nblockMAX; + Int32 numZ; + Int32 state_out_pos; + + /* map of bytes used in block */ + Int32 nInUse; + Bool inUse[256]; + UChar unseqToSeq[256]; + + /* the buffer for bit stream creation */ + UInt32 bsBuff; + Int32 bsLive; + + /* block and combined CRCs */ + UInt32 blockCRC; + UInt32 combinedCRC; + + /* misc administratium */ + Int32 verbosity; + Int32 blockNo; + Int32 blockSize100k; + + /* stuff for coding the MTF values */ + Int32 nMTF; + Int32 mtfFreq [BZ_MAX_ALPHA_SIZE]; + UChar selector [BZ_MAX_SELECTORS]; + UChar selectorMtf[BZ_MAX_SELECTORS]; + + UChar len [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; + Int32 code [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; + Int32 rfreq [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; + /* second dimension: only 3 needed; 4 makes index calculations faster */ + UInt32 len_pack[BZ_MAX_ALPHA_SIZE][4]; + + } + EState; + + + +/*-- externs for compression. --*/ + +extern void +BZ2_blockSort ( EState* ); + +extern void +BZ2_compressBlock ( EState*, Bool ); + +extern void +BZ2_bsInitWrite ( EState* ); + +extern void +BZ2_hbAssignCodes ( Int32*, UChar*, Int32, Int32, Int32 ); + +extern void +BZ2_hbMakeCodeLengths ( UChar*, Int32*, Int32, Int32 ); + + + +/*-- states for decompression. --*/ + +#define BZ_X_IDLE 1 +#define BZ_X_OUTPUT 2 + +#define BZ_X_MAGIC_1 10 +#define BZ_X_MAGIC_2 11 +#define BZ_X_MAGIC_3 12 +#define BZ_X_MAGIC_4 13 +#define BZ_X_BLKHDR_1 14 +#define BZ_X_BLKHDR_2 15 +#define BZ_X_BLKHDR_3 16 +#define BZ_X_BLKHDR_4 17 +#define BZ_X_BLKHDR_5 18 +#define BZ_X_BLKHDR_6 19 +#define BZ_X_BCRC_1 20 +#define BZ_X_BCRC_2 21 +#define BZ_X_BCRC_3 22 +#define BZ_X_BCRC_4 23 +#define BZ_X_RANDBIT 24 +#define BZ_X_ORIGPTR_1 25 +#define BZ_X_ORIGPTR_2 26 +#define BZ_X_ORIGPTR_3 27 +#define BZ_X_MAPPING_1 28 +#define BZ_X_MAPPING_2 29 +#define BZ_X_SELECTOR_1 30 +#define BZ_X_SELECTOR_2 31 +#define BZ_X_SELECTOR_3 32 +#define BZ_X_CODING_1 33 +#define BZ_X_CODING_2 34 +#define BZ_X_CODING_3 35 +#define BZ_X_MTF_1 36 +#define BZ_X_MTF_2 37 +#define BZ_X_MTF_3 38 +#define BZ_X_MTF_4 39 +#define BZ_X_MTF_5 40 +#define BZ_X_MTF_6 41 +#define BZ_X_ENDHDR_2 42 +#define BZ_X_ENDHDR_3 43 +#define BZ_X_ENDHDR_4 44 +#define BZ_X_ENDHDR_5 45 +#define BZ_X_ENDHDR_6 46 +#define BZ_X_CCRC_1 47 +#define BZ_X_CCRC_2 48 +#define BZ_X_CCRC_3 49 +#define BZ_X_CCRC_4 50 + + + +/*-- Constants for the fast MTF decoder. --*/ + +#define MTFA_SIZE 4096 +#define MTFL_SIZE 16 + + + +/*-- Structure holding all the decompression-side stuff. --*/ + +typedef + struct { + /* pointer back to the struct bz_stream */ + bz_stream* strm; + + /* state indicator for this stream */ + Int32 state; + + /* for doing the final run-length decoding */ + UChar state_out_ch; + Int32 state_out_len; + Bool blockRandomised; + BZ_RAND_DECLS; + + /* the buffer for bit stream reading */ + UInt32 bsBuff; + Int32 bsLive; + + /* misc administratium */ + Int32 blockSize100k; + Bool smallDecompress; + Int32 currBlockNo; + Int32 verbosity; + + /* for undoing the Burrows-Wheeler transform */ + Int32 origPtr; + UInt32 tPos; + Int32 k0; + Int32 unzftab[256]; + Int32 nblock_used; + Int32 cftab[257]; + Int32 cftabCopy[257]; + + /* for undoing the Burrows-Wheeler transform (FAST) */ + UInt32 *tt; + + /* for undoing the Burrows-Wheeler transform (SMALL) */ + UInt16 *ll16; + UChar *ll4; + + /* stored and calculated CRCs */ + UInt32 storedBlockCRC; + UInt32 storedCombinedCRC; + UInt32 calculatedBlockCRC; + UInt32 calculatedCombinedCRC; + + /* map of bytes used in block */ + Int32 nInUse; + Bool inUse[256]; + Bool inUse16[16]; + UChar seqToUnseq[256]; + + /* for decoding the MTF values */ + UChar mtfa [MTFA_SIZE]; + Int32 mtfbase[256 / MTFL_SIZE]; + UChar selector [BZ_MAX_SELECTORS]; + UChar selectorMtf[BZ_MAX_SELECTORS]; + UChar len [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; + + Int32 limit [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; + Int32 base [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; + Int32 perm [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; + Int32 minLens[BZ_N_GROUPS]; + + /* save area for scalars in the main decompress code */ + Int32 save_i; + Int32 save_j; + Int32 save_t; + Int32 save_alphaSize; + Int32 save_nGroups; + Int32 save_nSelectors; + Int32 save_EOB; + Int32 save_groupNo; + Int32 save_groupPos; + Int32 save_nextSym; + Int32 save_nblockMAX; + Int32 save_nblock; + Int32 save_es; + Int32 save_N; + Int32 save_curr; + Int32 save_zt; + Int32 save_zn; + Int32 save_zvec; + Int32 save_zj; + Int32 save_gSel; + Int32 save_gMinlen; + Int32* save_gLimit; + Int32* save_gBase; + Int32* save_gPerm; + + } + DState; + + + +/*-- Macros for decompression. --*/ + +#define BZ_GET_FAST(cccc) \ + /* c_tPos is unsigned, hence test < 0 is pointless. */ \ + if (s->tPos >= (UInt32)100000 * (UInt32)s->blockSize100k) return True; \ + s->tPos = s->tt[s->tPos]; \ + cccc = (UChar)(s->tPos & 0xff); \ + s->tPos >>= 8; + +#define BZ_GET_FAST_C(cccc) \ + /* c_tPos is unsigned, hence test < 0 is pointless. */ \ + if (c_tPos >= (UInt32)100000 * (UInt32)ro_blockSize100k) return True; \ + c_tPos = c_tt[c_tPos]; \ + cccc = (UChar)(c_tPos & 0xff); \ + c_tPos >>= 8; + +#define SET_LL4(i,n) \ + { if (((i) & 0x1) == 0) \ + s->ll4[(i) >> 1] = (s->ll4[(i) >> 1] & 0xf0) | (n); else \ + s->ll4[(i) >> 1] = (s->ll4[(i) >> 1] & 0x0f) | ((n) << 4); \ + } + +#define GET_LL4(i) \ + ((((UInt32)(s->ll4[(i) >> 1])) >> (((i) << 2) & 0x4)) & 0xF) + +#define SET_LL(i,n) \ + { s->ll16[i] = (UInt16)(n & 0x0000ffff); \ + SET_LL4(i, n >> 16); \ + } + +#define GET_LL(i) \ + (((UInt32)s->ll16[i]) | (GET_LL4(i) << 16)) + +#define BZ_GET_SMALL(cccc) \ + /* c_tPos is unsigned, hence test < 0 is pointless. */ \ + if (s->tPos >= (UInt32)100000 * (UInt32)s->blockSize100k) return True; \ + cccc = BZ2_indexIntoF ( s->tPos, s->cftab ); \ + s->tPos = GET_LL(s->tPos); + + +/*-- externs for decompression. --*/ + +extern Int32 +BZ2_indexIntoF ( Int32, Int32* ); + +extern Int32 +BZ2_decompress ( DState* ); + +extern void +BZ2_hbCreateDecodeTables ( Int32*, Int32*, Int32*, UChar*, + Int32, Int32, Int32 ); + + +#endif + + +/*-- BZ_NO_STDIO seems to make NULL disappear on some platforms. --*/ + +#ifdef BZ_NO_STDIO +#ifndef NULL +#define NULL 0 +#endif +#endif + + +/*-------------------------------------------------------------*/ +/*--- end bzlib_private.h ---*/ +/*-------------------------------------------------------------*/ diff --git a/dep/StormLib/src/bzip2/compress.c b/dep/StormLib/src/bzip2/compress.c new file mode 100644 index 00000000000..8c80a079700 --- /dev/null +++ b/dep/StormLib/src/bzip2/compress.c @@ -0,0 +1,672 @@ + +/*-------------------------------------------------------------*/ +/*--- Compression machinery (not incl block sorting) ---*/ +/*--- compress.c ---*/ +/*-------------------------------------------------------------*/ + +/* ------------------------------------------------------------------ + This file is part of bzip2/libbzip2, a program and library for + lossless, block-sorting data compression. + + bzip2/libbzip2 version 1.0.5 of 10 December 2007 + Copyright (C) 1996-2007 Julian Seward + + Please read the WARNING, DISCLAIMER and PATENTS sections in the + README file. + + This program is released under the terms of the license contained + in the file LICENSE. + ------------------------------------------------------------------ */ + + +/* CHANGES + 0.9.0 -- original version. + 0.9.0a/b -- no changes in this file. + 0.9.0c -- changed setting of nGroups in sendMTFValues() + so as to do a bit better on small files +*/ + +#include "bzlib_private.h" + + +/*---------------------------------------------------*/ +/*--- Bit stream I/O ---*/ +/*---------------------------------------------------*/ + +/*---------------------------------------------------*/ +void BZ2_bsInitWrite ( EState* s ) +{ + s->bsLive = 0; + s->bsBuff = 0; +} + + +/*---------------------------------------------------*/ +static +void bsFinishWrite ( EState* s ) +{ + while (s->bsLive > 0) { + s->zbits[s->numZ] = (UChar)(s->bsBuff >> 24); + s->numZ++; + s->bsBuff <<= 8; + s->bsLive -= 8; + } +} + + +/*---------------------------------------------------*/ +#define bsNEEDW(nz) \ +{ \ + while (s->bsLive >= 8) { \ + s->zbits[s->numZ] \ + = (UChar)(s->bsBuff >> 24); \ + s->numZ++; \ + s->bsBuff <<= 8; \ + s->bsLive -= 8; \ + } \ +} + + +/*---------------------------------------------------*/ +static +__inline__ +void bsW ( EState* s, Int32 n, UInt32 v ) +{ + bsNEEDW ( n ); + s->bsBuff |= (v << (32 - s->bsLive - n)); + s->bsLive += n; +} + + +/*---------------------------------------------------*/ +static +void bsPutUInt32 ( EState* s, UInt32 u ) +{ + bsW ( s, 8, (u >> 24) & 0xffL ); + bsW ( s, 8, (u >> 16) & 0xffL ); + bsW ( s, 8, (u >> 8) & 0xffL ); + bsW ( s, 8, u & 0xffL ); +} + + +/*---------------------------------------------------*/ +static +void bsPutUChar ( EState* s, UChar c ) +{ + bsW( s, 8, (UInt32)c ); +} + + +/*---------------------------------------------------*/ +/*--- The back end proper ---*/ +/*---------------------------------------------------*/ + +/*---------------------------------------------------*/ +static +void makeMaps_e ( EState* s ) +{ + Int32 i; + s->nInUse = 0; + for (i = 0; i < 256; i++) + if (s->inUse[i]) { + s->unseqToSeq[i] = s->nInUse; + s->nInUse++; + } +} + + +/*---------------------------------------------------*/ +static +void generateMTFValues ( EState* s ) +{ + UChar yy[256]; + Int32 i, j; + Int32 zPend; + Int32 wr; + Int32 EOB; + + /* + After sorting (eg, here), + s->arr1 [ 0 .. s->nblock-1 ] holds sorted order, + and + ((UChar*)s->arr2) [ 0 .. s->nblock-1 ] + holds the original block data. + + The first thing to do is generate the MTF values, + and put them in + ((UInt16*)s->arr1) [ 0 .. s->nblock-1 ]. + Because there are strictly fewer or equal MTF values + than block values, ptr values in this area are overwritten + with MTF values only when they are no longer needed. + + The final compressed bitstream is generated into the + area starting at + (UChar*) (&((UChar*)s->arr2)[s->nblock]) + + These storage aliases are set up in bzCompressInit(), + except for the last one, which is arranged in + compressBlock(). + */ + UInt32* ptr = s->ptr; + UChar* block = s->block; + UInt16* mtfv = s->mtfv; + + makeMaps_e ( s ); + EOB = s->nInUse+1; + + for (i = 0; i <= EOB; i++) s->mtfFreq[i] = 0; + + wr = 0; + zPend = 0; + for (i = 0; i < s->nInUse; i++) yy[i] = (UChar) i; + + for (i = 0; i < s->nblock; i++) { + UChar ll_i; + AssertD ( wr <= i, "generateMTFValues(1)" ); + j = ptr[i]-1; if (j < 0) j += s->nblock; + ll_i = s->unseqToSeq[block[j]]; + AssertD ( ll_i < s->nInUse, "generateMTFValues(2a)" ); + + if (yy[0] == ll_i) { + zPend++; + } else { + + if (zPend > 0) { + zPend--; + while (True) { + if (zPend & 1) { + mtfv[wr] = BZ_RUNB; wr++; + s->mtfFreq[BZ_RUNB]++; + } else { + mtfv[wr] = BZ_RUNA; wr++; + s->mtfFreq[BZ_RUNA]++; + } + if (zPend < 2) break; + zPend = (zPend - 2) / 2; + }; + zPend = 0; + } + { + register UChar rtmp; + register UChar* ryy_j; + register UChar rll_i; + rtmp = yy[1]; + yy[1] = yy[0]; + ryy_j = &(yy[1]); + rll_i = ll_i; + while ( rll_i != rtmp ) { + register UChar rtmp2; + ryy_j++; + rtmp2 = rtmp; + rtmp = *ryy_j; + *ryy_j = rtmp2; + }; + yy[0] = rtmp; + j = ryy_j - &(yy[0]); + mtfv[wr] = j+1; wr++; s->mtfFreq[j+1]++; + } + + } + } + + if (zPend > 0) { + zPend--; + while (True) { + if (zPend & 1) { + mtfv[wr] = BZ_RUNB; wr++; + s->mtfFreq[BZ_RUNB]++; + } else { + mtfv[wr] = BZ_RUNA; wr++; + s->mtfFreq[BZ_RUNA]++; + } + if (zPend < 2) break; + zPend = (zPend - 2) / 2; + }; + zPend = 0; + } + + mtfv[wr] = EOB; wr++; s->mtfFreq[EOB]++; + + s->nMTF = wr; +} + + +/*---------------------------------------------------*/ +#define BZ_LESSER_ICOST 0 +#define BZ_GREATER_ICOST 15 + +static +void sendMTFValues ( EState* s ) +{ + Int32 v, t, i, j, gs, ge, totc, bt, bc, iter; + Int32 nSelectors, alphaSize, minLen, maxLen, selCtr; + Int32 nGroups, nBytes; + + /*-- + UChar len [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; + is a global since the decoder also needs it. + + Int32 code[BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; + Int32 rfreq[BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; + are also globals only used in this proc. + Made global to keep stack frame size small. + --*/ + + + UInt16 cost[BZ_N_GROUPS]; + Int32 fave[BZ_N_GROUPS]; + + UInt16* mtfv = s->mtfv; + + if (s->verbosity >= 3) + VPrintf3( " %d in block, %d after MTF & 1-2 coding, " + "%d+2 syms in use\n", + s->nblock, s->nMTF, s->nInUse ); + + alphaSize = s->nInUse+2; + for (t = 0; t < BZ_N_GROUPS; t++) + for (v = 0; v < alphaSize; v++) + s->len[t][v] = BZ_GREATER_ICOST; + + /*--- Decide how many coding tables to use ---*/ + AssertH ( s->nMTF > 0, 3001 ); + if (s->nMTF < 200) nGroups = 2; else + if (s->nMTF < 600) nGroups = 3; else + if (s->nMTF < 1200) nGroups = 4; else + if (s->nMTF < 2400) nGroups = 5; else + nGroups = 6; + + /*--- Generate an initial set of coding tables ---*/ + { + Int32 nPart, remF, tFreq, aFreq; + + nPart = nGroups; + remF = s->nMTF; + gs = 0; + while (nPart > 0) { + tFreq = remF / nPart; + ge = gs-1; + aFreq = 0; + while (aFreq < tFreq && ge < alphaSize-1) { + ge++; + aFreq += s->mtfFreq[ge]; + } + + if (ge > gs + && nPart != nGroups && nPart != 1 + && ((nGroups-nPart) % 2 == 1)) { + aFreq -= s->mtfFreq[ge]; + ge--; + } + + if (s->verbosity >= 3) + VPrintf5( " initial group %d, [%d .. %d], " + "has %d syms (%4.1f%%)\n", + nPart, gs, ge, aFreq, + (100.0 * (float)aFreq) / (float)(s->nMTF) ); + + for (v = 0; v < alphaSize; v++) + if (v >= gs && v <= ge) + s->len[nPart-1][v] = BZ_LESSER_ICOST; else + s->len[nPart-1][v] = BZ_GREATER_ICOST; + + nPart--; + gs = ge+1; + remF -= aFreq; + } + } + + /*--- + Iterate up to BZ_N_ITERS times to improve the tables. + ---*/ + for (iter = 0; iter < BZ_N_ITERS; iter++) { + + for (t = 0; t < nGroups; t++) fave[t] = 0; + + for (t = 0; t < nGroups; t++) + for (v = 0; v < alphaSize; v++) + s->rfreq[t][v] = 0; + + /*--- + Set up an auxiliary length table which is used to fast-track + the common case (nGroups == 6). + ---*/ + if (nGroups == 6) { + for (v = 0; v < alphaSize; v++) { + s->len_pack[v][0] = (s->len[1][v] << 16) | s->len[0][v]; + s->len_pack[v][1] = (s->len[3][v] << 16) | s->len[2][v]; + s->len_pack[v][2] = (s->len[5][v] << 16) | s->len[4][v]; + } + } + + nSelectors = 0; + totc = 0; + gs = 0; + while (True) { + + /*--- Set group start & end marks. --*/ + if (gs >= s->nMTF) break; + ge = gs + BZ_G_SIZE - 1; + if (ge >= s->nMTF) ge = s->nMTF-1; + + /*-- + Calculate the cost of this group as coded + by each of the coding tables. + --*/ + for (t = 0; t < nGroups; t++) cost[t] = 0; + + if (nGroups == 6 && 50 == ge-gs+1) { + /*--- fast track the common case ---*/ + register UInt32 cost01, cost23, cost45; + register UInt16 icv; + cost01 = cost23 = cost45 = 0; + +# define BZ_ITER(nn) \ + icv = mtfv[gs+(nn)]; \ + cost01 += s->len_pack[icv][0]; \ + cost23 += s->len_pack[icv][1]; \ + cost45 += s->len_pack[icv][2]; \ + + BZ_ITER(0); BZ_ITER(1); BZ_ITER(2); BZ_ITER(3); BZ_ITER(4); + BZ_ITER(5); BZ_ITER(6); BZ_ITER(7); BZ_ITER(8); BZ_ITER(9); + BZ_ITER(10); BZ_ITER(11); BZ_ITER(12); BZ_ITER(13); BZ_ITER(14); + BZ_ITER(15); BZ_ITER(16); BZ_ITER(17); BZ_ITER(18); BZ_ITER(19); + BZ_ITER(20); BZ_ITER(21); BZ_ITER(22); BZ_ITER(23); BZ_ITER(24); + BZ_ITER(25); BZ_ITER(26); BZ_ITER(27); BZ_ITER(28); BZ_ITER(29); + BZ_ITER(30); BZ_ITER(31); BZ_ITER(32); BZ_ITER(33); BZ_ITER(34); + BZ_ITER(35); BZ_ITER(36); BZ_ITER(37); BZ_ITER(38); BZ_ITER(39); + BZ_ITER(40); BZ_ITER(41); BZ_ITER(42); BZ_ITER(43); BZ_ITER(44); + BZ_ITER(45); BZ_ITER(46); BZ_ITER(47); BZ_ITER(48); BZ_ITER(49); + +# undef BZ_ITER + + cost[0] = cost01 & 0xffff; cost[1] = cost01 >> 16; + cost[2] = cost23 & 0xffff; cost[3] = cost23 >> 16; + cost[4] = cost45 & 0xffff; cost[5] = cost45 >> 16; + + } else { + /*--- slow version which correctly handles all situations ---*/ + for (i = gs; i <= ge; i++) { + UInt16 icv = mtfv[i]; + for (t = 0; t < nGroups; t++) cost[t] += s->len[t][icv]; + } + } + + /*-- + Find the coding table which is best for this group, + and record its identity in the selector table. + --*/ + bc = 999999999; bt = -1; + for (t = 0; t < nGroups; t++) + if (cost[t] < bc) { bc = cost[t]; bt = t; }; + totc += bc; + fave[bt]++; + s->selector[nSelectors] = bt; + nSelectors++; + + /*-- + Increment the symbol frequencies for the selected table. + --*/ + if (nGroups == 6 && 50 == ge-gs+1) { + /*--- fast track the common case ---*/ + +# define BZ_ITUR(nn) s->rfreq[bt][ mtfv[gs+(nn)] ]++ + + BZ_ITUR(0); BZ_ITUR(1); BZ_ITUR(2); BZ_ITUR(3); BZ_ITUR(4); + BZ_ITUR(5); BZ_ITUR(6); BZ_ITUR(7); BZ_ITUR(8); BZ_ITUR(9); + BZ_ITUR(10); BZ_ITUR(11); BZ_ITUR(12); BZ_ITUR(13); BZ_ITUR(14); + BZ_ITUR(15); BZ_ITUR(16); BZ_ITUR(17); BZ_ITUR(18); BZ_ITUR(19); + BZ_ITUR(20); BZ_ITUR(21); BZ_ITUR(22); BZ_ITUR(23); BZ_ITUR(24); + BZ_ITUR(25); BZ_ITUR(26); BZ_ITUR(27); BZ_ITUR(28); BZ_ITUR(29); + BZ_ITUR(30); BZ_ITUR(31); BZ_ITUR(32); BZ_ITUR(33); BZ_ITUR(34); + BZ_ITUR(35); BZ_ITUR(36); BZ_ITUR(37); BZ_ITUR(38); BZ_ITUR(39); + BZ_ITUR(40); BZ_ITUR(41); BZ_ITUR(42); BZ_ITUR(43); BZ_ITUR(44); + BZ_ITUR(45); BZ_ITUR(46); BZ_ITUR(47); BZ_ITUR(48); BZ_ITUR(49); + +# undef BZ_ITUR + + } else { + /*--- slow version which correctly handles all situations ---*/ + for (i = gs; i <= ge; i++) + s->rfreq[bt][ mtfv[i] ]++; + } + + gs = ge+1; + } + if (s->verbosity >= 3) { + VPrintf2 ( " pass %d: size is %d, grp uses are ", + iter+1, totc/8 ); + for (t = 0; t < nGroups; t++) + VPrintf1 ( "%d ", fave[t] ); + VPrintf0 ( "\n" ); + } + + /*-- + Recompute the tables based on the accumulated frequencies. + --*/ + /* maxLen was changed from 20 to 17 in bzip2-1.0.3. See + comment in huffman.c for details. */ + for (t = 0; t < nGroups; t++) + BZ2_hbMakeCodeLengths ( &(s->len[t][0]), &(s->rfreq[t][0]), + alphaSize, 17 /*20*/ ); + } + + + AssertH( nGroups < 8, 3002 ); + AssertH( nSelectors < 32768 && + nSelectors <= (2 + (900000 / BZ_G_SIZE)), + 3003 ); + + + /*--- Compute MTF values for the selectors. ---*/ + { + UChar pos[BZ_N_GROUPS], ll_i, tmp2, tmp; + for (i = 0; i < nGroups; i++) pos[i] = i; + for (i = 0; i < nSelectors; i++) { + ll_i = s->selector[i]; + j = 0; + tmp = pos[j]; + while ( ll_i != tmp ) { + j++; + tmp2 = tmp; + tmp = pos[j]; + pos[j] = tmp2; + }; + pos[0] = tmp; + s->selectorMtf[i] = j; + } + }; + + /*--- Assign actual codes for the tables. --*/ + for (t = 0; t < nGroups; t++) { + minLen = 32; + maxLen = 0; + for (i = 0; i < alphaSize; i++) { + if (s->len[t][i] > maxLen) maxLen = s->len[t][i]; + if (s->len[t][i] < minLen) minLen = s->len[t][i]; + } + AssertH ( !(maxLen > 17 /*20*/ ), 3004 ); + AssertH ( !(minLen < 1), 3005 ); + BZ2_hbAssignCodes ( &(s->code[t][0]), &(s->len[t][0]), + minLen, maxLen, alphaSize ); + } + + /*--- Transmit the mapping table. ---*/ + { + Bool inUse16[16]; + for (i = 0; i < 16; i++) { + inUse16[i] = False; + for (j = 0; j < 16; j++) + if (s->inUse[i * 16 + j]) inUse16[i] = True; + } + + nBytes = s->numZ; + for (i = 0; i < 16; i++) + if (inUse16[i]) bsW(s,1,1); else bsW(s,1,0); + + for (i = 0; i < 16; i++) + if (inUse16[i]) + for (j = 0; j < 16; j++) { + if (s->inUse[i * 16 + j]) bsW(s,1,1); else bsW(s,1,0); + } + + if (s->verbosity >= 3) + VPrintf1( " bytes: mapping %d, ", s->numZ-nBytes ); + } + + /*--- Now the selectors. ---*/ + nBytes = s->numZ; + bsW ( s, 3, nGroups ); + bsW ( s, 15, nSelectors ); + for (i = 0; i < nSelectors; i++) { + for (j = 0; j < s->selectorMtf[i]; j++) bsW(s,1,1); + bsW(s,1,0); + } + if (s->verbosity >= 3) + VPrintf1( "selectors %d, ", s->numZ-nBytes ); + + /*--- Now the coding tables. ---*/ + nBytes = s->numZ; + + for (t = 0; t < nGroups; t++) { + Int32 curr = s->len[t][0]; + bsW ( s, 5, curr ); + for (i = 0; i < alphaSize; i++) { + while (curr < s->len[t][i]) { bsW(s,2,2); curr++; /* 10 */ }; + while (curr > s->len[t][i]) { bsW(s,2,3); curr--; /* 11 */ }; + bsW ( s, 1, 0 ); + } + } + + if (s->verbosity >= 3) + VPrintf1 ( "code lengths %d, ", s->numZ-nBytes ); + + /*--- And finally, the block data proper ---*/ + nBytes = s->numZ; + selCtr = 0; + gs = 0; + while (True) { + if (gs >= s->nMTF) break; + ge = gs + BZ_G_SIZE - 1; + if (ge >= s->nMTF) ge = s->nMTF-1; + AssertH ( s->selector[selCtr] < nGroups, 3006 ); + + if (nGroups == 6 && 50 == ge-gs+1) { + /*--- fast track the common case ---*/ + UInt16 mtfv_i; + UChar* s_len_sel_selCtr + = &(s->len[s->selector[selCtr]][0]); + Int32* s_code_sel_selCtr + = &(s->code[s->selector[selCtr]][0]); + +# define BZ_ITAH(nn) \ + mtfv_i = mtfv[gs+(nn)]; \ + bsW ( s, \ + s_len_sel_selCtr[mtfv_i], \ + s_code_sel_selCtr[mtfv_i] ) + + BZ_ITAH(0); BZ_ITAH(1); BZ_ITAH(2); BZ_ITAH(3); BZ_ITAH(4); + BZ_ITAH(5); BZ_ITAH(6); BZ_ITAH(7); BZ_ITAH(8); BZ_ITAH(9); + BZ_ITAH(10); BZ_ITAH(11); BZ_ITAH(12); BZ_ITAH(13); BZ_ITAH(14); + BZ_ITAH(15); BZ_ITAH(16); BZ_ITAH(17); BZ_ITAH(18); BZ_ITAH(19); + BZ_ITAH(20); BZ_ITAH(21); BZ_ITAH(22); BZ_ITAH(23); BZ_ITAH(24); + BZ_ITAH(25); BZ_ITAH(26); BZ_ITAH(27); BZ_ITAH(28); BZ_ITAH(29); + BZ_ITAH(30); BZ_ITAH(31); BZ_ITAH(32); BZ_ITAH(33); BZ_ITAH(34); + BZ_ITAH(35); BZ_ITAH(36); BZ_ITAH(37); BZ_ITAH(38); BZ_ITAH(39); + BZ_ITAH(40); BZ_ITAH(41); BZ_ITAH(42); BZ_ITAH(43); BZ_ITAH(44); + BZ_ITAH(45); BZ_ITAH(46); BZ_ITAH(47); BZ_ITAH(48); BZ_ITAH(49); + +# undef BZ_ITAH + + } else { + /*--- slow version which correctly handles all situations ---*/ + for (i = gs; i <= ge; i++) { + bsW ( s, + s->len [s->selector[selCtr]] [mtfv[i]], + s->code [s->selector[selCtr]] [mtfv[i]] ); + } + } + + + gs = ge+1; + selCtr++; + } + AssertH( selCtr == nSelectors, 3007 ); + + if (s->verbosity >= 3) + VPrintf1( "codes %d\n", s->numZ-nBytes ); +} + + +/*---------------------------------------------------*/ +void BZ2_compressBlock ( EState* s, Bool is_last_block ) +{ + if (s->nblock > 0) { + + BZ_FINALISE_CRC ( s->blockCRC ); + s->combinedCRC = (s->combinedCRC << 1) | (s->combinedCRC >> 31); + s->combinedCRC ^= s->blockCRC; + if (s->blockNo > 1) s->numZ = 0; + + if (s->verbosity >= 2) + VPrintf4( " block %d: crc = 0x%08x, " + "combined CRC = 0x%08x, size = %d\n", + s->blockNo, s->blockCRC, s->combinedCRC, s->nblock ); + + BZ2_blockSort ( s ); + } + + s->zbits = (UChar*) (&((UChar*)s->arr2)[s->nblock]); + + /*-- If this is the first block, create the stream header. --*/ + if (s->blockNo == 1) { + BZ2_bsInitWrite ( s ); + bsPutUChar ( s, BZ_HDR_B ); + bsPutUChar ( s, BZ_HDR_Z ); + bsPutUChar ( s, BZ_HDR_h ); + bsPutUChar ( s, (UChar)(BZ_HDR_0 + s->blockSize100k) ); + } + + if (s->nblock > 0) { + + bsPutUChar ( s, 0x31 ); bsPutUChar ( s, 0x41 ); + bsPutUChar ( s, 0x59 ); bsPutUChar ( s, 0x26 ); + bsPutUChar ( s, 0x53 ); bsPutUChar ( s, 0x59 ); + + /*-- Now the block's CRC, so it is in a known place. --*/ + bsPutUInt32 ( s, s->blockCRC ); + + /*-- + Now a single bit indicating (non-)randomisation. + As of version 0.9.5, we use a better sorting algorithm + which makes randomisation unnecessary. So always set + the randomised bit to 'no'. Of course, the decoder + still needs to be able to handle randomised blocks + so as to maintain backwards compatibility with + older versions of bzip2. + --*/ + bsW(s,1,0); + + bsW ( s, 24, s->origPtr ); + generateMTFValues ( s ); + sendMTFValues ( s ); + } + + + /*-- If this is the last block, add the stream trailer. --*/ + if (is_last_block) { + + bsPutUChar ( s, 0x17 ); bsPutUChar ( s, 0x72 ); + bsPutUChar ( s, 0x45 ); bsPutUChar ( s, 0x38 ); + bsPutUChar ( s, 0x50 ); bsPutUChar ( s, 0x90 ); + bsPutUInt32 ( s, s->combinedCRC ); + if (s->verbosity >= 2) + VPrintf1( " final combined CRC = 0x%08x\n ", s->combinedCRC ); + bsFinishWrite ( s ); + } +} + + +/*-------------------------------------------------------------*/ +/*--- end compress.c ---*/ +/*-------------------------------------------------------------*/ diff --git a/dep/StormLib/src/bzip2/crctable.c b/dep/StormLib/src/bzip2/crctable.c new file mode 100644 index 00000000000..215687b2c05 --- /dev/null +++ b/dep/StormLib/src/bzip2/crctable.c @@ -0,0 +1,104 @@ + +/*-------------------------------------------------------------*/ +/*--- Table for doing CRCs ---*/ +/*--- crctable.c ---*/ +/*-------------------------------------------------------------*/ + +/* ------------------------------------------------------------------ + This file is part of bzip2/libbzip2, a program and library for + lossless, block-sorting data compression. + + bzip2/libbzip2 version 1.0.5 of 10 December 2007 + Copyright (C) 1996-2007 Julian Seward + + Please read the WARNING, DISCLAIMER and PATENTS sections in the + README file. + + This program is released under the terms of the license contained + in the file LICENSE. + ------------------------------------------------------------------ */ + + +#include "bzlib_private.h" + +/*-- + I think this is an implementation of the AUTODIN-II, + Ethernet & FDDI 32-bit CRC standard. Vaguely derived + from code by Rob Warnock, in Section 51 of the + comp.compression FAQ. +--*/ + +UInt32 BZ2_crc32Table[256] = { + + /*-- Ugly, innit? --*/ + + 0x00000000L, 0x04c11db7L, 0x09823b6eL, 0x0d4326d9L, + 0x130476dcL, 0x17c56b6bL, 0x1a864db2L, 0x1e475005L, + 0x2608edb8L, 0x22c9f00fL, 0x2f8ad6d6L, 0x2b4bcb61L, + 0x350c9b64L, 0x31cd86d3L, 0x3c8ea00aL, 0x384fbdbdL, + 0x4c11db70L, 0x48d0c6c7L, 0x4593e01eL, 0x4152fda9L, + 0x5f15adacL, 0x5bd4b01bL, 0x569796c2L, 0x52568b75L, + 0x6a1936c8L, 0x6ed82b7fL, 0x639b0da6L, 0x675a1011L, + 0x791d4014L, 0x7ddc5da3L, 0x709f7b7aL, 0x745e66cdL, + 0x9823b6e0L, 0x9ce2ab57L, 0x91a18d8eL, 0x95609039L, + 0x8b27c03cL, 0x8fe6dd8bL, 0x82a5fb52L, 0x8664e6e5L, + 0xbe2b5b58L, 0xbaea46efL, 0xb7a96036L, 0xb3687d81L, + 0xad2f2d84L, 0xa9ee3033L, 0xa4ad16eaL, 0xa06c0b5dL, + 0xd4326d90L, 0xd0f37027L, 0xddb056feL, 0xd9714b49L, + 0xc7361b4cL, 0xc3f706fbL, 0xceb42022L, 0xca753d95L, + 0xf23a8028L, 0xf6fb9d9fL, 0xfbb8bb46L, 0xff79a6f1L, + 0xe13ef6f4L, 0xe5ffeb43L, 0xe8bccd9aL, 0xec7dd02dL, + 0x34867077L, 0x30476dc0L, 0x3d044b19L, 0x39c556aeL, + 0x278206abL, 0x23431b1cL, 0x2e003dc5L, 0x2ac12072L, + 0x128e9dcfL, 0x164f8078L, 0x1b0ca6a1L, 0x1fcdbb16L, + 0x018aeb13L, 0x054bf6a4L, 0x0808d07dL, 0x0cc9cdcaL, + 0x7897ab07L, 0x7c56b6b0L, 0x71159069L, 0x75d48ddeL, + 0x6b93dddbL, 0x6f52c06cL, 0x6211e6b5L, 0x66d0fb02L, + 0x5e9f46bfL, 0x5a5e5b08L, 0x571d7dd1L, 0x53dc6066L, + 0x4d9b3063L, 0x495a2dd4L, 0x44190b0dL, 0x40d816baL, + 0xaca5c697L, 0xa864db20L, 0xa527fdf9L, 0xa1e6e04eL, + 0xbfa1b04bL, 0xbb60adfcL, 0xb6238b25L, 0xb2e29692L, + 0x8aad2b2fL, 0x8e6c3698L, 0x832f1041L, 0x87ee0df6L, + 0x99a95df3L, 0x9d684044L, 0x902b669dL, 0x94ea7b2aL, + 0xe0b41de7L, 0xe4750050L, 0xe9362689L, 0xedf73b3eL, + 0xf3b06b3bL, 0xf771768cL, 0xfa325055L, 0xfef34de2L, + 0xc6bcf05fL, 0xc27dede8L, 0xcf3ecb31L, 0xcbffd686L, + 0xd5b88683L, 0xd1799b34L, 0xdc3abdedL, 0xd8fba05aL, + 0x690ce0eeL, 0x6dcdfd59L, 0x608edb80L, 0x644fc637L, + 0x7a089632L, 0x7ec98b85L, 0x738aad5cL, 0x774bb0ebL, + 0x4f040d56L, 0x4bc510e1L, 0x46863638L, 0x42472b8fL, + 0x5c007b8aL, 0x58c1663dL, 0x558240e4L, 0x51435d53L, + 0x251d3b9eL, 0x21dc2629L, 0x2c9f00f0L, 0x285e1d47L, + 0x36194d42L, 0x32d850f5L, 0x3f9b762cL, 0x3b5a6b9bL, + 0x0315d626L, 0x07d4cb91L, 0x0a97ed48L, 0x0e56f0ffL, + 0x1011a0faL, 0x14d0bd4dL, 0x19939b94L, 0x1d528623L, + 0xf12f560eL, 0xf5ee4bb9L, 0xf8ad6d60L, 0xfc6c70d7L, + 0xe22b20d2L, 0xe6ea3d65L, 0xeba91bbcL, 0xef68060bL, + 0xd727bbb6L, 0xd3e6a601L, 0xdea580d8L, 0xda649d6fL, + 0xc423cd6aL, 0xc0e2d0ddL, 0xcda1f604L, 0xc960ebb3L, + 0xbd3e8d7eL, 0xb9ff90c9L, 0xb4bcb610L, 0xb07daba7L, + 0xae3afba2L, 0xaafbe615L, 0xa7b8c0ccL, 0xa379dd7bL, + 0x9b3660c6L, 0x9ff77d71L, 0x92b45ba8L, 0x9675461fL, + 0x8832161aL, 0x8cf30badL, 0x81b02d74L, 0x857130c3L, + 0x5d8a9099L, 0x594b8d2eL, 0x5408abf7L, 0x50c9b640L, + 0x4e8ee645L, 0x4a4ffbf2L, 0x470cdd2bL, 0x43cdc09cL, + 0x7b827d21L, 0x7f436096L, 0x7200464fL, 0x76c15bf8L, + 0x68860bfdL, 0x6c47164aL, 0x61043093L, 0x65c52d24L, + 0x119b4be9L, 0x155a565eL, 0x18197087L, 0x1cd86d30L, + 0x029f3d35L, 0x065e2082L, 0x0b1d065bL, 0x0fdc1becL, + 0x3793a651L, 0x3352bbe6L, 0x3e119d3fL, 0x3ad08088L, + 0x2497d08dL, 0x2056cd3aL, 0x2d15ebe3L, 0x29d4f654L, + 0xc5a92679L, 0xc1683bceL, 0xcc2b1d17L, 0xc8ea00a0L, + 0xd6ad50a5L, 0xd26c4d12L, 0xdf2f6bcbL, 0xdbee767cL, + 0xe3a1cbc1L, 0xe760d676L, 0xea23f0afL, 0xeee2ed18L, + 0xf0a5bd1dL, 0xf464a0aaL, 0xf9278673L, 0xfde69bc4L, + 0x89b8fd09L, 0x8d79e0beL, 0x803ac667L, 0x84fbdbd0L, + 0x9abc8bd5L, 0x9e7d9662L, 0x933eb0bbL, 0x97ffad0cL, + 0xafb010b1L, 0xab710d06L, 0xa6322bdfL, 0xa2f33668L, + 0xbcb4666dL, 0xb8757bdaL, 0xb5365d03L, 0xb1f740b4L +}; + + +/*-------------------------------------------------------------*/ +/*--- end crctable.c ---*/ +/*-------------------------------------------------------------*/ diff --git a/dep/StormLib/src/bzip2/decompress.c b/dep/StormLib/src/bzip2/decompress.c new file mode 100644 index 00000000000..bba5e0fa36d --- /dev/null +++ b/dep/StormLib/src/bzip2/decompress.c @@ -0,0 +1,626 @@ + +/*-------------------------------------------------------------*/ +/*--- Decompression machinery ---*/ +/*--- decompress.c ---*/ +/*-------------------------------------------------------------*/ + +/* ------------------------------------------------------------------ + This file is part of bzip2/libbzip2, a program and library for + lossless, block-sorting data compression. + + bzip2/libbzip2 version 1.0.5 of 10 December 2007 + Copyright (C) 1996-2007 Julian Seward + + Please read the WARNING, DISCLAIMER and PATENTS sections in the + README file. + + This program is released under the terms of the license contained + in the file LICENSE. + ------------------------------------------------------------------ */ + + +#include "bzlib_private.h" + + +/*---------------------------------------------------*/ +static +void makeMaps_d ( DState* s ) +{ + Int32 i; + s->nInUse = 0; + for (i = 0; i < 256; i++) + if (s->inUse[i]) { + s->seqToUnseq[s->nInUse] = i; + s->nInUse++; + } +} + + +/*---------------------------------------------------*/ +#define RETURN(rrr) \ + { retVal = rrr; goto save_state_and_return; }; + +#define GET_BITS(lll,vvv,nnn) \ + case lll: s->state = lll; \ + while (True) { \ + if (s->bsLive >= nnn) { \ + UInt32 v; \ + v = (s->bsBuff >> \ + (s->bsLive-nnn)) & ((1 << nnn)-1); \ + s->bsLive -= nnn; \ + vvv = v; \ + break; \ + } \ + if (s->strm->avail_in == 0) RETURN(BZ_OK); \ + s->bsBuff \ + = (s->bsBuff << 8) | \ + ((UInt32) \ + (*((UChar*)(s->strm->next_in)))); \ + s->bsLive += 8; \ + s->strm->next_in++; \ + s->strm->avail_in--; \ + s->strm->total_in_lo32++; \ + if (s->strm->total_in_lo32 == 0) \ + s->strm->total_in_hi32++; \ + } + +#define GET_UCHAR(lll,uuu) \ + GET_BITS(lll,uuu,8) + +#define GET_BIT(lll,uuu) \ + GET_BITS(lll,uuu,1) + +/*---------------------------------------------------*/ +#define GET_MTF_VAL(label1,label2,lval) \ +{ \ + if (groupPos == 0) { \ + groupNo++; \ + if (groupNo >= nSelectors) \ + RETURN(BZ_DATA_ERROR); \ + groupPos = BZ_G_SIZE; \ + gSel = s->selector[groupNo]; \ + gMinlen = s->minLens[gSel]; \ + gLimit = &(s->limit[gSel][0]); \ + gPerm = &(s->perm[gSel][0]); \ + gBase = &(s->base[gSel][0]); \ + } \ + groupPos--; \ + zn = gMinlen; \ + GET_BITS(label1, zvec, zn); \ + while (1) { \ + if (zn > 20 /* the longest code */) \ + RETURN(BZ_DATA_ERROR); \ + if (zvec <= gLimit[zn]) break; \ + zn++; \ + GET_BIT(label2, zj); \ + zvec = (zvec << 1) | zj; \ + }; \ + if (zvec - gBase[zn] < 0 \ + || zvec - gBase[zn] >= BZ_MAX_ALPHA_SIZE) \ + RETURN(BZ_DATA_ERROR); \ + lval = gPerm[zvec - gBase[zn]]; \ +} + + +/*---------------------------------------------------*/ +Int32 BZ2_decompress ( DState* s ) +{ + UChar uc; + Int32 retVal; + Int32 minLen, maxLen; + bz_stream* strm = s->strm; + + /* stuff that needs to be saved/restored */ + Int32 i; + Int32 j; + Int32 t; + Int32 alphaSize; + Int32 nGroups; + Int32 nSelectors; + Int32 EOB; + Int32 groupNo; + Int32 groupPos; + Int32 nextSym; + Int32 nblockMAX; + Int32 nblock; + Int32 es; + Int32 N; + Int32 curr; + Int32 zt; + Int32 zn; + Int32 zvec; + Int32 zj; + Int32 gSel; + Int32 gMinlen; + Int32* gLimit; + Int32* gBase; + Int32* gPerm; + + if (s->state == BZ_X_MAGIC_1) { + /*initialise the save area*/ + s->save_i = 0; + s->save_j = 0; + s->save_t = 0; + s->save_alphaSize = 0; + s->save_nGroups = 0; + s->save_nSelectors = 0; + s->save_EOB = 0; + s->save_groupNo = 0; + s->save_groupPos = 0; + s->save_nextSym = 0; + s->save_nblockMAX = 0; + s->save_nblock = 0; + s->save_es = 0; + s->save_N = 0; + s->save_curr = 0; + s->save_zt = 0; + s->save_zn = 0; + s->save_zvec = 0; + s->save_zj = 0; + s->save_gSel = 0; + s->save_gMinlen = 0; + s->save_gLimit = NULL; + s->save_gBase = NULL; + s->save_gPerm = NULL; + } + + /*restore from the save area*/ + i = s->save_i; + j = s->save_j; + t = s->save_t; + alphaSize = s->save_alphaSize; + nGroups = s->save_nGroups; + nSelectors = s->save_nSelectors; + EOB = s->save_EOB; + groupNo = s->save_groupNo; + groupPos = s->save_groupPos; + nextSym = s->save_nextSym; + nblockMAX = s->save_nblockMAX; + nblock = s->save_nblock; + es = s->save_es; + N = s->save_N; + curr = s->save_curr; + zt = s->save_zt; + zn = s->save_zn; + zvec = s->save_zvec; + zj = s->save_zj; + gSel = s->save_gSel; + gMinlen = s->save_gMinlen; + gLimit = s->save_gLimit; + gBase = s->save_gBase; + gPerm = s->save_gPerm; + + retVal = BZ_OK; + + switch (s->state) { + + GET_UCHAR(BZ_X_MAGIC_1, uc); + if (uc != BZ_HDR_B) RETURN(BZ_DATA_ERROR_MAGIC); + + GET_UCHAR(BZ_X_MAGIC_2, uc); + if (uc != BZ_HDR_Z) RETURN(BZ_DATA_ERROR_MAGIC); + + GET_UCHAR(BZ_X_MAGIC_3, uc) + if (uc != BZ_HDR_h) RETURN(BZ_DATA_ERROR_MAGIC); + + GET_BITS(BZ_X_MAGIC_4, s->blockSize100k, 8) + if (s->blockSize100k < (BZ_HDR_0 + 1) || + s->blockSize100k > (BZ_HDR_0 + 9)) RETURN(BZ_DATA_ERROR_MAGIC); + s->blockSize100k -= BZ_HDR_0; + + if (s->smallDecompress) { + s->ll16 = BZALLOC( s->blockSize100k * 100000 * sizeof(UInt16) ); + s->ll4 = BZALLOC( + ((1 + s->blockSize100k * 100000) >> 1) * sizeof(UChar) + ); + if (s->ll16 == NULL || s->ll4 == NULL) RETURN(BZ_MEM_ERROR); + } else { + s->tt = BZALLOC( s->blockSize100k * 100000 * sizeof(Int32) ); + if (s->tt == NULL) RETURN(BZ_MEM_ERROR); + } + + GET_UCHAR(BZ_X_BLKHDR_1, uc); + + if (uc == 0x17) goto endhdr_2; + if (uc != 0x31) RETURN(BZ_DATA_ERROR); + GET_UCHAR(BZ_X_BLKHDR_2, uc); + if (uc != 0x41) RETURN(BZ_DATA_ERROR); + GET_UCHAR(BZ_X_BLKHDR_3, uc); + if (uc != 0x59) RETURN(BZ_DATA_ERROR); + GET_UCHAR(BZ_X_BLKHDR_4, uc); + if (uc != 0x26) RETURN(BZ_DATA_ERROR); + GET_UCHAR(BZ_X_BLKHDR_5, uc); + if (uc != 0x53) RETURN(BZ_DATA_ERROR); + GET_UCHAR(BZ_X_BLKHDR_6, uc); + if (uc != 0x59) RETURN(BZ_DATA_ERROR); + + s->currBlockNo++; + if (s->verbosity >= 2) + VPrintf1 ( "\n [%d: huff+mtf ", s->currBlockNo ); + + s->storedBlockCRC = 0; + GET_UCHAR(BZ_X_BCRC_1, uc); + s->storedBlockCRC = (s->storedBlockCRC << 8) | ((UInt32)uc); + GET_UCHAR(BZ_X_BCRC_2, uc); + s->storedBlockCRC = (s->storedBlockCRC << 8) | ((UInt32)uc); + GET_UCHAR(BZ_X_BCRC_3, uc); + s->storedBlockCRC = (s->storedBlockCRC << 8) | ((UInt32)uc); + GET_UCHAR(BZ_X_BCRC_4, uc); + s->storedBlockCRC = (s->storedBlockCRC << 8) | ((UInt32)uc); + + GET_BITS(BZ_X_RANDBIT, s->blockRandomised, 1); + + s->origPtr = 0; + GET_UCHAR(BZ_X_ORIGPTR_1, uc); + s->origPtr = (s->origPtr << 8) | ((Int32)uc); + GET_UCHAR(BZ_X_ORIGPTR_2, uc); + s->origPtr = (s->origPtr << 8) | ((Int32)uc); + GET_UCHAR(BZ_X_ORIGPTR_3, uc); + s->origPtr = (s->origPtr << 8) | ((Int32)uc); + + if (s->origPtr < 0) + RETURN(BZ_DATA_ERROR); + if (s->origPtr > 10 + 100000*s->blockSize100k) + RETURN(BZ_DATA_ERROR); + + /*--- Receive the mapping table ---*/ + for (i = 0; i < 16; i++) { + GET_BIT(BZ_X_MAPPING_1, uc); + if (uc == 1) + s->inUse16[i] = True; else + s->inUse16[i] = False; + } + + for (i = 0; i < 256; i++) s->inUse[i] = False; + + for (i = 0; i < 16; i++) + if (s->inUse16[i]) + for (j = 0; j < 16; j++) { + GET_BIT(BZ_X_MAPPING_2, uc); + if (uc == 1) s->inUse[i * 16 + j] = True; + } + makeMaps_d ( s ); + if (s->nInUse == 0) RETURN(BZ_DATA_ERROR); + alphaSize = s->nInUse+2; + + /*--- Now the selectors ---*/ + GET_BITS(BZ_X_SELECTOR_1, nGroups, 3); + if (nGroups < 2 || nGroups > 6) RETURN(BZ_DATA_ERROR); + GET_BITS(BZ_X_SELECTOR_2, nSelectors, 15); + if (nSelectors < 1) RETURN(BZ_DATA_ERROR); + for (i = 0; i < nSelectors; i++) { + j = 0; + while (True) { + GET_BIT(BZ_X_SELECTOR_3, uc); + if (uc == 0) break; + j++; + if (j >= nGroups) RETURN(BZ_DATA_ERROR); + } + s->selectorMtf[i] = j; + } + + /*--- Undo the MTF values for the selectors. ---*/ + { + UChar pos[BZ_N_GROUPS], tmp, v; + for (v = 0; v < nGroups; v++) pos[v] = v; + + for (i = 0; i < nSelectors; i++) { + v = s->selectorMtf[i]; + tmp = pos[v]; + while (v > 0) { pos[v] = pos[v-1]; v--; } + pos[0] = tmp; + s->selector[i] = tmp; + } + } + + /*--- Now the coding tables ---*/ + for (t = 0; t < nGroups; t++) { + GET_BITS(BZ_X_CODING_1, curr, 5); + for (i = 0; i < alphaSize; i++) { + while (True) { + if (curr < 1 || curr > 20) RETURN(BZ_DATA_ERROR); + GET_BIT(BZ_X_CODING_2, uc); + if (uc == 0) break; + GET_BIT(BZ_X_CODING_3, uc); + if (uc == 0) curr++; else curr--; + } + s->len[t][i] = curr; + } + } + + /*--- Create the Huffman decoding tables ---*/ + for (t = 0; t < nGroups; t++) { + minLen = 32; + maxLen = 0; + for (i = 0; i < alphaSize; i++) { + if (s->len[t][i] > maxLen) maxLen = s->len[t][i]; + if (s->len[t][i] < minLen) minLen = s->len[t][i]; + } + BZ2_hbCreateDecodeTables ( + &(s->limit[t][0]), + &(s->base[t][0]), + &(s->perm[t][0]), + &(s->len[t][0]), + minLen, maxLen, alphaSize + ); + s->minLens[t] = minLen; + } + + /*--- Now the MTF values ---*/ + + EOB = s->nInUse+1; + nblockMAX = 100000 * s->blockSize100k; + groupNo = -1; + groupPos = 0; + + for (i = 0; i <= 255; i++) s->unzftab[i] = 0; + + /*-- MTF init --*/ + { + Int32 ii, jj, kk; + kk = MTFA_SIZE-1; + for (ii = 256 / MTFL_SIZE - 1; ii >= 0; ii--) { + for (jj = MTFL_SIZE-1; jj >= 0; jj--) { + s->mtfa[kk] = (UChar)(ii * MTFL_SIZE + jj); + kk--; + } + s->mtfbase[ii] = kk + 1; + } + } + /*-- end MTF init --*/ + + nblock = 0; + GET_MTF_VAL(BZ_X_MTF_1, BZ_X_MTF_2, nextSym); + + while (True) { + + if (nextSym == EOB) break; + + if (nextSym == BZ_RUNA || nextSym == BZ_RUNB) { + + es = -1; + N = 1; + do { + if (nextSym == BZ_RUNA) es = es + (0+1) * N; else + if (nextSym == BZ_RUNB) es = es + (1+1) * N; + N = N * 2; + GET_MTF_VAL(BZ_X_MTF_3, BZ_X_MTF_4, nextSym); + } + while (nextSym == BZ_RUNA || nextSym == BZ_RUNB); + + es++; + uc = s->seqToUnseq[ s->mtfa[s->mtfbase[0]] ]; + s->unzftab[uc] += es; + + if (s->smallDecompress) + while (es > 0) { + if (nblock >= nblockMAX) RETURN(BZ_DATA_ERROR); + s->ll16[nblock] = (UInt16)uc; + nblock++; + es--; + } + else + while (es > 0) { + if (nblock >= nblockMAX) RETURN(BZ_DATA_ERROR); + s->tt[nblock] = (UInt32)uc; + nblock++; + es--; + }; + + continue; + + } else { + + if (nblock >= nblockMAX) RETURN(BZ_DATA_ERROR); + + /*-- uc = MTF ( nextSym-1 ) --*/ + { + Int32 ii, jj, kk, pp, lno, off; + UInt32 nn; + nn = (UInt32)(nextSym - 1); + + if (nn < MTFL_SIZE) { + /* avoid general-case expense */ + pp = s->mtfbase[0]; + uc = s->mtfa[pp+nn]; + while (nn > 3) { + Int32 z = pp+nn; + s->mtfa[(z) ] = s->mtfa[(z)-1]; + s->mtfa[(z)-1] = s->mtfa[(z)-2]; + s->mtfa[(z)-2] = s->mtfa[(z)-3]; + s->mtfa[(z)-3] = s->mtfa[(z)-4]; + nn -= 4; + } + while (nn > 0) { + s->mtfa[(pp+nn)] = s->mtfa[(pp+nn)-1]; nn--; + }; + s->mtfa[pp] = uc; + } else { + /* general case */ + lno = nn / MTFL_SIZE; + off = nn % MTFL_SIZE; + pp = s->mtfbase[lno] + off; + uc = s->mtfa[pp]; + while (pp > s->mtfbase[lno]) { + s->mtfa[pp] = s->mtfa[pp-1]; pp--; + }; + s->mtfbase[lno]++; + while (lno > 0) { + s->mtfbase[lno]--; + s->mtfa[s->mtfbase[lno]] + = s->mtfa[s->mtfbase[lno-1] + MTFL_SIZE - 1]; + lno--; + } + s->mtfbase[0]--; + s->mtfa[s->mtfbase[0]] = uc; + if (s->mtfbase[0] == 0) { + kk = MTFA_SIZE-1; + for (ii = 256 / MTFL_SIZE-1; ii >= 0; ii--) { + for (jj = MTFL_SIZE-1; jj >= 0; jj--) { + s->mtfa[kk] = s->mtfa[s->mtfbase[ii] + jj]; + kk--; + } + s->mtfbase[ii] = kk + 1; + } + } + } + } + /*-- end uc = MTF ( nextSym-1 ) --*/ + + s->unzftab[s->seqToUnseq[uc]]++; + if (s->smallDecompress) + s->ll16[nblock] = (UInt16)(s->seqToUnseq[uc]); else + s->tt[nblock] = (UInt32)(s->seqToUnseq[uc]); + nblock++; + + GET_MTF_VAL(BZ_X_MTF_5, BZ_X_MTF_6, nextSym); + continue; + } + } + + /* Now we know what nblock is, we can do a better sanity + check on s->origPtr. + */ + if (s->origPtr < 0 || s->origPtr >= nblock) + RETURN(BZ_DATA_ERROR); + + /*-- Set up cftab to facilitate generation of T^(-1) --*/ + s->cftab[0] = 0; + for (i = 1; i <= 256; i++) s->cftab[i] = s->unzftab[i-1]; + for (i = 1; i <= 256; i++) s->cftab[i] += s->cftab[i-1]; + for (i = 0; i <= 256; i++) { + if (s->cftab[i] < 0 || s->cftab[i] > nblock) { + /* s->cftab[i] can legitimately be == nblock */ + RETURN(BZ_DATA_ERROR); + } + } + + s->state_out_len = 0; + s->state_out_ch = 0; + BZ_INITIALISE_CRC ( s->calculatedBlockCRC ); + s->state = BZ_X_OUTPUT; + if (s->verbosity >= 2) VPrintf0 ( "rt+rld" ); + + if (s->smallDecompress) { + + /*-- Make a copy of cftab, used in generation of T --*/ + for (i = 0; i <= 256; i++) s->cftabCopy[i] = s->cftab[i]; + + /*-- compute the T vector --*/ + for (i = 0; i < nblock; i++) { + uc = (UChar)(s->ll16[i]); + SET_LL(i, s->cftabCopy[uc]); + s->cftabCopy[uc]++; + } + + /*-- Compute T^(-1) by pointer reversal on T --*/ + i = s->origPtr; + j = GET_LL(i); + do { + Int32 tmp = GET_LL(j); + SET_LL(j, i); + i = j; + j = tmp; + } + while (i != s->origPtr); + + s->tPos = s->origPtr; + s->nblock_used = 0; + if (s->blockRandomised) { + BZ_RAND_INIT_MASK; + BZ_GET_SMALL(s->k0); s->nblock_used++; + BZ_RAND_UPD_MASK; s->k0 ^= BZ_RAND_MASK; + } else { + BZ_GET_SMALL(s->k0); s->nblock_used++; + } + + } else { + + /*-- compute the T^(-1) vector --*/ + for (i = 0; i < nblock; i++) { + uc = (UChar)(s->tt[i] & 0xff); + s->tt[s->cftab[uc]] |= (i << 8); + s->cftab[uc]++; + } + + s->tPos = s->tt[s->origPtr] >> 8; + s->nblock_used = 0; + if (s->blockRandomised) { + BZ_RAND_INIT_MASK; + BZ_GET_FAST(s->k0); s->nblock_used++; + BZ_RAND_UPD_MASK; s->k0 ^= BZ_RAND_MASK; + } else { + BZ_GET_FAST(s->k0); s->nblock_used++; + } + + } + + RETURN(BZ_OK); + + + + endhdr_2: + + GET_UCHAR(BZ_X_ENDHDR_2, uc); + if (uc != 0x72) RETURN(BZ_DATA_ERROR); + GET_UCHAR(BZ_X_ENDHDR_3, uc); + if (uc != 0x45) RETURN(BZ_DATA_ERROR); + GET_UCHAR(BZ_X_ENDHDR_4, uc); + if (uc != 0x38) RETURN(BZ_DATA_ERROR); + GET_UCHAR(BZ_X_ENDHDR_5, uc); + if (uc != 0x50) RETURN(BZ_DATA_ERROR); + GET_UCHAR(BZ_X_ENDHDR_6, uc); + if (uc != 0x90) RETURN(BZ_DATA_ERROR); + + s->storedCombinedCRC = 0; + GET_UCHAR(BZ_X_CCRC_1, uc); + s->storedCombinedCRC = (s->storedCombinedCRC << 8) | ((UInt32)uc); + GET_UCHAR(BZ_X_CCRC_2, uc); + s->storedCombinedCRC = (s->storedCombinedCRC << 8) | ((UInt32)uc); + GET_UCHAR(BZ_X_CCRC_3, uc); + s->storedCombinedCRC = (s->storedCombinedCRC << 8) | ((UInt32)uc); + GET_UCHAR(BZ_X_CCRC_4, uc); + s->storedCombinedCRC = (s->storedCombinedCRC << 8) | ((UInt32)uc); + + s->state = BZ_X_IDLE; + RETURN(BZ_STREAM_END); + + default: AssertH ( False, 4001 ); + } + + AssertH ( False, 4002 ); + + save_state_and_return: + + s->save_i = i; + s->save_j = j; + s->save_t = t; + s->save_alphaSize = alphaSize; + s->save_nGroups = nGroups; + s->save_nSelectors = nSelectors; + s->save_EOB = EOB; + s->save_groupNo = groupNo; + s->save_groupPos = groupPos; + s->save_nextSym = nextSym; + s->save_nblockMAX = nblockMAX; + s->save_nblock = nblock; + s->save_es = es; + s->save_N = N; + s->save_curr = curr; + s->save_zt = zt; + s->save_zn = zn; + s->save_zvec = zvec; + s->save_zj = zj; + s->save_gSel = gSel; + s->save_gMinlen = gMinlen; + s->save_gLimit = gLimit; + s->save_gBase = gBase; + s->save_gPerm = gPerm; + + return retVal; +} + + +/*-------------------------------------------------------------*/ +/*--- end decompress.c ---*/ +/*-------------------------------------------------------------*/ diff --git a/dep/StormLib/src/bzip2/huffman.c b/dep/StormLib/src/bzip2/huffman.c new file mode 100644 index 00000000000..87e79e38af0 --- /dev/null +++ b/dep/StormLib/src/bzip2/huffman.c @@ -0,0 +1,205 @@ + +/*-------------------------------------------------------------*/ +/*--- Huffman coding low-level stuff ---*/ +/*--- huffman.c ---*/ +/*-------------------------------------------------------------*/ + +/* ------------------------------------------------------------------ + This file is part of bzip2/libbzip2, a program and library for + lossless, block-sorting data compression. + + bzip2/libbzip2 version 1.0.5 of 10 December 2007 + Copyright (C) 1996-2007 Julian Seward + + Please read the WARNING, DISCLAIMER and PATENTS sections in the + README file. + + This program is released under the terms of the license contained + in the file LICENSE. + ------------------------------------------------------------------ */ + + +#include "bzlib_private.h" + +/*---------------------------------------------------*/ +#define WEIGHTOF(zz0) ((zz0) & 0xffffff00) +#define DEPTHOF(zz1) ((zz1) & 0x000000ff) +#define MYMAX(zz2,zz3) ((zz2) > (zz3) ? (zz2) : (zz3)) + +#define ADDWEIGHTS(zw1,zw2) \ + (WEIGHTOF(zw1)+WEIGHTOF(zw2)) | \ + (1 + MYMAX(DEPTHOF(zw1),DEPTHOF(zw2))) + +#define UPHEAP(z) \ +{ \ + Int32 zz, tmp; \ + zz = z; tmp = heap[zz]; \ + while (weight[tmp] < weight[heap[zz >> 1]]) { \ + heap[zz] = heap[zz >> 1]; \ + zz >>= 1; \ + } \ + heap[zz] = tmp; \ +} + +#define DOWNHEAP(z) \ +{ \ + Int32 zz, yy, tmp; \ + zz = z; tmp = heap[zz]; \ + while (True) { \ + yy = zz << 1; \ + if (yy > nHeap) break; \ + if (yy < nHeap && \ + weight[heap[yy+1]] < weight[heap[yy]]) \ + yy++; \ + if (weight[tmp] < weight[heap[yy]]) break; \ + heap[zz] = heap[yy]; \ + zz = yy; \ + } \ + heap[zz] = tmp; \ +} + + +/*---------------------------------------------------*/ +void BZ2_hbMakeCodeLengths ( UChar *len, + Int32 *freq, + Int32 alphaSize, + Int32 maxLen ) +{ + /*-- + Nodes and heap entries run from 1. Entry 0 + for both the heap and nodes is a sentinel. + --*/ + Int32 nNodes, nHeap, n1, n2, i, j, k; + Bool tooLong; + + Int32 heap [ BZ_MAX_ALPHA_SIZE + 2 ]; + Int32 weight [ BZ_MAX_ALPHA_SIZE * 2 ]; + Int32 parent [ BZ_MAX_ALPHA_SIZE * 2 ]; + + for (i = 0; i < alphaSize; i++) + weight[i+1] = (freq[i] == 0 ? 1 : freq[i]) << 8; + + while (True) { + + nNodes = alphaSize; + nHeap = 0; + + heap[0] = 0; + weight[0] = 0; + parent[0] = -2; + + for (i = 1; i <= alphaSize; i++) { + parent[i] = -1; + nHeap++; + heap[nHeap] = i; + UPHEAP(nHeap); + } + + AssertH( nHeap < (BZ_MAX_ALPHA_SIZE+2), 2001 ); + + while (nHeap > 1) { + n1 = heap[1]; heap[1] = heap[nHeap]; nHeap--; DOWNHEAP(1); + n2 = heap[1]; heap[1] = heap[nHeap]; nHeap--; DOWNHEAP(1); + nNodes++; + parent[n1] = parent[n2] = nNodes; + weight[nNodes] = ADDWEIGHTS(weight[n1], weight[n2]); + parent[nNodes] = -1; + nHeap++; + heap[nHeap] = nNodes; + UPHEAP(nHeap); + } + + AssertH( nNodes < (BZ_MAX_ALPHA_SIZE * 2), 2002 ); + + tooLong = False; + for (i = 1; i <= alphaSize; i++) { + j = 0; + k = i; + while (parent[k] >= 0) { k = parent[k]; j++; } + len[i-1] = j; + if (j > maxLen) tooLong = True; + } + + if (! tooLong) break; + + /* 17 Oct 04: keep-going condition for the following loop used + to be 'i < alphaSize', which missed the last element, + theoretically leading to the possibility of the compressor + looping. However, this count-scaling step is only needed if + one of the generated Huffman code words is longer than + maxLen, which up to and including version 1.0.2 was 20 bits, + which is extremely unlikely. In version 1.0.3 maxLen was + changed to 17 bits, which has minimal effect on compression + ratio, but does mean this scaling step is used from time to + time, enough to verify that it works. + + This means that bzip2-1.0.3 and later will only produce + Huffman codes with a maximum length of 17 bits. However, in + order to preserve backwards compatibility with bitstreams + produced by versions pre-1.0.3, the decompressor must still + handle lengths of up to 20. */ + + for (i = 1; i <= alphaSize; i++) { + j = weight[i] >> 8; + j = 1 + (j / 2); + weight[i] = j << 8; + } + } +} + + +/*---------------------------------------------------*/ +void BZ2_hbAssignCodes ( Int32 *code, + UChar *length, + Int32 minLen, + Int32 maxLen, + Int32 alphaSize ) +{ + Int32 n, vec, i; + + vec = 0; + for (n = minLen; n <= maxLen; n++) { + for (i = 0; i < alphaSize; i++) + if (length[i] == n) { code[i] = vec; vec++; }; + vec <<= 1; + } +} + + +/*---------------------------------------------------*/ +void BZ2_hbCreateDecodeTables ( Int32 *limit, + Int32 *base, + Int32 *perm, + UChar *length, + Int32 minLen, + Int32 maxLen, + Int32 alphaSize ) +{ + Int32 pp, i, j, vec; + + pp = 0; + for (i = minLen; i <= maxLen; i++) + for (j = 0; j < alphaSize; j++) + if (length[j] == i) { perm[pp] = j; pp++; }; + + for (i = 0; i < BZ_MAX_CODE_LEN; i++) base[i] = 0; + for (i = 0; i < alphaSize; i++) base[length[i]+1]++; + + for (i = 1; i < BZ_MAX_CODE_LEN; i++) base[i] += base[i-1]; + + for (i = 0; i < BZ_MAX_CODE_LEN; i++) limit[i] = 0; + vec = 0; + + for (i = minLen; i <= maxLen; i++) { + vec += (base[i+1] - base[i]); + limit[i] = vec-1; + vec <<= 1; + } + for (i = minLen + 1; i <= maxLen; i++) + base[i] = ((limit[i-1] + 1) << 1) - base[i]; +} + + +/*-------------------------------------------------------------*/ +/*--- end huffman.c ---*/ +/*-------------------------------------------------------------*/ diff --git a/dep/StormLib/src/bzip2/randtable.c b/dep/StormLib/src/bzip2/randtable.c new file mode 100644 index 00000000000..068b76367bc --- /dev/null +++ b/dep/StormLib/src/bzip2/randtable.c @@ -0,0 +1,84 @@ + +/*-------------------------------------------------------------*/ +/*--- Table for randomising repetitive blocks ---*/ +/*--- randtable.c ---*/ +/*-------------------------------------------------------------*/ + +/* ------------------------------------------------------------------ + This file is part of bzip2/libbzip2, a program and library for + lossless, block-sorting data compression. + + bzip2/libbzip2 version 1.0.5 of 10 December 2007 + Copyright (C) 1996-2007 Julian Seward + + Please read the WARNING, DISCLAIMER and PATENTS sections in the + README file. + + This program is released under the terms of the license contained + in the file LICENSE. + ------------------------------------------------------------------ */ + + +#include "bzlib_private.h" + + +/*---------------------------------------------*/ +Int32 BZ2_rNums[512] = { + 619, 720, 127, 481, 931, 816, 813, 233, 566, 247, + 985, 724, 205, 454, 863, 491, 741, 242, 949, 214, + 733, 859, 335, 708, 621, 574, 73, 654, 730, 472, + 419, 436, 278, 496, 867, 210, 399, 680, 480, 51, + 878, 465, 811, 169, 869, 675, 611, 697, 867, 561, + 862, 687, 507, 283, 482, 129, 807, 591, 733, 623, + 150, 238, 59, 379, 684, 877, 625, 169, 643, 105, + 170, 607, 520, 932, 727, 476, 693, 425, 174, 647, + 73, 122, 335, 530, 442, 853, 695, 249, 445, 515, + 909, 545, 703, 919, 874, 474, 882, 500, 594, 612, + 641, 801, 220, 162, 819, 984, 589, 513, 495, 799, + 161, 604, 958, 533, 221, 400, 386, 867, 600, 782, + 382, 596, 414, 171, 516, 375, 682, 485, 911, 276, + 98, 553, 163, 354, 666, 933, 424, 341, 533, 870, + 227, 730, 475, 186, 263, 647, 537, 686, 600, 224, + 469, 68, 770, 919, 190, 373, 294, 822, 808, 206, + 184, 943, 795, 384, 383, 461, 404, 758, 839, 887, + 715, 67, 618, 276, 204, 918, 873, 777, 604, 560, + 951, 160, 578, 722, 79, 804, 96, 409, 713, 940, + 652, 934, 970, 447, 318, 353, 859, 672, 112, 785, + 645, 863, 803, 350, 139, 93, 354, 99, 820, 908, + 609, 772, 154, 274, 580, 184, 79, 626, 630, 742, + 653, 282, 762, 623, 680, 81, 927, 626, 789, 125, + 411, 521, 938, 300, 821, 78, 343, 175, 128, 250, + 170, 774, 972, 275, 999, 639, 495, 78, 352, 126, + 857, 956, 358, 619, 580, 124, 737, 594, 701, 612, + 669, 112, 134, 694, 363, 992, 809, 743, 168, 974, + 944, 375, 748, 52, 600, 747, 642, 182, 862, 81, + 344, 805, 988, 739, 511, 655, 814, 334, 249, 515, + 897, 955, 664, 981, 649, 113, 974, 459, 893, 228, + 433, 837, 553, 268, 926, 240, 102, 654, 459, 51, + 686, 754, 806, 760, 493, 403, 415, 394, 687, 700, + 946, 670, 656, 610, 738, 392, 760, 799, 887, 653, + 978, 321, 576, 617, 626, 502, 894, 679, 243, 440, + 680, 879, 194, 572, 640, 724, 926, 56, 204, 700, + 707, 151, 457, 449, 797, 195, 791, 558, 945, 679, + 297, 59, 87, 824, 713, 663, 412, 693, 342, 606, + 134, 108, 571, 364, 631, 212, 174, 643, 304, 329, + 343, 97, 430, 751, 497, 314, 983, 374, 822, 928, + 140, 206, 73, 263, 980, 736, 876, 478, 430, 305, + 170, 514, 364, 692, 829, 82, 855, 953, 676, 246, + 369, 970, 294, 750, 807, 827, 150, 790, 288, 923, + 804, 378, 215, 828, 592, 281, 565, 555, 710, 82, + 896, 831, 547, 261, 524, 462, 293, 465, 502, 56, + 661, 821, 976, 991, 658, 869, 905, 758, 745, 193, + 768, 550, 608, 933, 378, 286, 215, 979, 792, 961, + 61, 688, 793, 644, 986, 403, 106, 366, 905, 644, + 372, 567, 466, 434, 645, 210, 389, 550, 919, 135, + 780, 773, 635, 389, 707, 100, 626, 958, 165, 504, + 920, 176, 193, 713, 857, 265, 203, 50, 668, 108, + 645, 990, 626, 197, 510, 357, 358, 850, 858, 364, + 936, 638 +}; + + +/*-------------------------------------------------------------*/ +/*--- end randtable.c ---*/ +/*-------------------------------------------------------------*/ diff --git a/dep/StormLib/src/huffman/huff.cpp b/dep/StormLib/src/huffman/huff.cpp new file mode 100644 index 00000000000..34203a8108f --- /dev/null +++ b/dep/StormLib/src/huffman/huff.cpp @@ -0,0 +1,1295 @@ +/*****************************************************************************/ +/* huffman.cpp Copyright (c) Ladislav Zezula 1998-2003 */ +/*---------------------------------------------------------------------------*/ +/* This module contains Huffmann (de)compression methods */ +/* */ +/* Authors : Ladislav Zezula (ladik@zezula.net) */ +/* ShadowFlare (BlakFlare@hotmail.com) */ +/* */ +/*---------------------------------------------------------------------------*/ +/* Date Ver Who Comment */ +/* -------- ---- --- ------- */ +/* xx.xx.xx 1.00 Lad The first version of dcmp.cpp */ +/* 03.05.03 1.00 Lad Added compression methods */ +/* 19.11.03 1.01 Dan Big endian handling */ +/* 08.12.03 2.01 Dan High-memory handling (> 0x80000000) */ +/*****************************************************************************/ + +#include +#include + +#include "huff.h" + +// Special for Mac - we have to know if normal pointer greater or less +// than 0x80000000. This variable is used in the PTR_VALID and PTR_INVALID +// macros +static long mul = 1; + +#define PTR_VALID(ptr) (((LONG_PTR)(ptr) * mul) > 0) +#define PTR_INVALID(ptr) (((LONG_PTR)(ptr) * mul) < 0) +#define PTR_INVALID_OR_NULL(ptr) (((LONG_PTR)(ptr) * mul) <= 0) + + +//----------------------------------------------------------------------------- +// Methods of the THTreeItem struct + +// 1501DB70 +THTreeItem * THTreeItem::Call1501DB70(THTreeItem * pLast) +{ + if(pLast == NULL) + pLast = this + 1; + return pLast; +} + +// Gets previous Huffman tree item (?) +THTreeItem * THTreeItem::GetPrevItem(LONG_PTR value) +{ + if(PTR_INVALID(prev)) + return PTR_NOT(prev); + + if(value == -1 || PTR_INVALID(value)) + value = (LONG_PTR)(this - next->prev); + return prev + value; + +// OLD VERSION +// if(PTR_INT(value) < 0) +// value = PTR_INT((item - item->next->prev)); +// return (THTreeItem *)((char *)prev + value); +} + +// 1500F5E0 +void THTreeItem::ClearItemLinks() +{ + next = prev = NULL; +} + +// 1500BC90 +void THTreeItem::RemoveItem() +{ + THTreeItem * pTemp; // EDX + + if(next != NULL) + { + pTemp = prev; + + if(PTR_INVALID_OR_NULL(pTemp)) + pTemp = PTR_NOT(pTemp); + else + pTemp += (this - next->prev); + + pTemp->next = next; + next->prev = prev; + next = prev = NULL; + } +} + +/* +// OLD VERSION : Removes item from the tree (?) +static void RemoveItem(THTreeItem * item) +{ + THTreeItem * next = item->next; // ESI + THTreeItem * prev = item->prev; // EDX + + if(next == NULL) + return; + + if(PTR_INT(prev) < 0) + prev = PTR_NOT(prev); + else + // ??? usually item == next->prev, so what is it ? + prev = (THTreeItem *)((unsigned char *)prev + (unsigned long)((unsigned char *)item - (unsigned char *)(next->prev))); + + // Remove HTree item from the chain + prev->next = next; // Sets the 'first' pointer + next->prev = item->prev; + + // Invalidate pointers + item->next = NULL; + item->prev = NULL; +} +*/ + +//----------------------------------------------------------------------------- +// TOutputStream functions + +void TOutputStream::PutBits(unsigned long dwBuff, unsigned int nPutBits) +{ + dwBitBuff |= (dwBuff << nBits); + nBits += nPutBits; + + // Flush completed bytes + while(nBits >= 8) + { + if(cbOutSize != 0) + { + *pbOutPos++ = (unsigned char)dwBitBuff; + cbOutSize--; + } + + dwBitBuff >>= 8; + nBits -= 8; + } +} + +//----------------------------------------------------------------------------- +// TInputStream functions + +// Gets one bit from input stream +unsigned long TInputStream::GetBit() +{ + unsigned long dwOneBit = 0; + + // Ensure that the input stream is reloaded, if there are no bits left + if(BitCount == 0) + { + // Refill the bit buffer + BitBuffer = *pbInBuffer++; + BitCount = 8; + } + + // Copy the bit from bit buffer to the variable + dwOneBit = (BitBuffer & 0x01); + BitBuffer >>= 1; + BitCount--; + + return dwOneBit; +} + +// Gets 7 bits from the stream. DOES NOT remove the bits from input stream +unsigned long TInputStream::Get7Bits() +{ + unsigned long dwReloadByte = 0; + + // If there is not enough bits to get the value, + // we have to add 8 more bits from the input buffer + if(BitCount < 7) + { + dwReloadByte = *pbInBuffer++; + BitBuffer |= dwReloadByte << BitCount; + BitCount += 8; + } + + // Return the first available 7 bits. DO NOT remove them from the input stream + return (BitBuffer & 0x7F); +} + +// Gets the whole byte from the input stream. +unsigned long TInputStream::Get8Bits() +{ + unsigned long dwReloadByte = 0; + unsigned long dwOneByte = 0; + + // If there is not enough bits to get the value, + // we have to add 8 more bits from the input buffer + if(BitCount < 8) + { + dwReloadByte = *pbInBuffer++; + BitBuffer |= dwReloadByte << BitCount; + BitCount += 8; + } + + // Return the lowest 8 its + dwOneByte = (BitBuffer & 0xFF); + BitBuffer >>= 8; + BitCount -= 8; + return dwOneByte; +} + +void TInputStream::SkipBits(unsigned int dwBitsToSkip) +{ + unsigned long dwReloadByte = 0; + + // If there is not enough bits in the buffer, + // we have to add 8 more bits from the input buffer + if(BitCount < dwBitsToSkip) + { + dwReloadByte = *pbInBuffer++; + BitBuffer |= dwReloadByte << BitCount; + BitCount += 8; + } + + // Skip the remaining bits + BitBuffer >>= dwBitsToSkip; + BitCount -= dwBitsToSkip; +} + +//----------------------------------------------------------------------------- +// Functions for huffmann tree items + +// Inserts item into the tree (?) +static void InsertItem(THTreeItem ** itemPtr, THTreeItem * item, unsigned long nWhere, THTreeItem * item2) +{ + THTreeItem * next = item->next; // EDI - next to the first item + THTreeItem * prev = item->prev; // ESI - prev to the first item + THTreeItem * prev2; // Pointer to previous item + LONG_PTR next2; // Pointer to the next item + + // The same code like in RemoveItem(item); + if(next != 0) // If the first item already has next one + { + if(PTR_INVALID(prev)) + prev = PTR_NOT(prev); + else + prev += (item - next->prev); + + // 150083C1 + // Remove the item from the tree + prev->next = next; + next->prev = prev; + + // Invalidate 'prev' and 'next' pointer + item->next = 0; + item->prev = 0; + } + + if(item2 == NULL) // EDX - If the second item is not entered, + item2 = PTR_PTR(&itemPtr[1]); // take the first tree item + + switch(nWhere) + { + case SWITCH_ITEMS : // Switch the two items + item->next = item2->next; // item2->next (Pointer to pointer to first) + item->prev = item2->next->prev; + item2->next->prev = item; + item2->next = item; // Set the first item + return; + + case INSERT_ITEM: // Insert as the last item + item->next = item2; // Set next item (or pointer to pointer to first item) + item->prev = item2->prev; // Set prev item (or last item in the tree) + + next2 = PTR_INT(itemPtr[0]);// Usually NULL + prev2 = item2->prev; // Prev item to the second (or last tree item) + + if(PTR_INVALID(prev2)) + { + prev2 = PTR_NOT(prev); + + prev2->next = item; + item2->prev = item; // Next after last item + return; + } + + if(PTR_INVALID(next2)) + next2 = (LONG_PTR)(item2 - item2->next->prev); +// next2 = (THTreeItem *)(unsigned long)((unsigned char *)item2 - (unsigned char *)(item2->next->prev)); + +// prev2 = (THTreeItem *)((char *)prev2 + (unsigned long)next2);// ??? + prev2 += next2; + prev2->next = item; + item2->prev = item; // Set the next/last item + return; + + default: + return; + } +} + +//----------------------------------------------------------------------------- +// THuffmannTree class functions + +THuffmannTree::THuffmannTree() +{ + // We have to check if the "this" pointer is less than zero + if((LONG_PTR)this < 0) + mul = -1; +} + +void THuffmannTree::InitTree(bool bCompression) +{ + THTreeItem * pItem; + unsigned int nCount; + + // Clear links for all the items in the tree + for(pItem = items0008, nCount = 0x203; nCount != 0; pItem++, nCount--) + pItem->ClearItemLinks(); + + pItem3050 = NULL; + pItem3054 = PTR_PTR(&pItem3054); + pItem3058 = PTR_NOT(pItem3054); + + pItem305C = NULL; + pFirst = PTR_PTR(&pFirst); + pLast = PTR_NOT(pFirst); + + offs0004 = 1; + nItems = 0; + + // Clear all TQDecompress items. Do this only if preparing for decompression + if(bCompression == false) + { + for(nCount = 0; nCount < sizeof(qd3474) / sizeof(TQDecompress); nCount++) + qd3474[nCount].offs00 = 0; + } +} + +// Builds Huffman tree. Called with the first 8 bits loaded from input stream +void THuffmannTree::BuildTree(unsigned int nCmpType) +{ + unsigned long maxByte; // [ESP+10] - The greatest character found in table + THTreeItem ** itemPtr; // [ESP+14] - Pointer to Huffman tree item pointer array + unsigned char * byteArray; // [ESP+1C] - Pointer to unsigned char in Table1502A630 + THTreeItem * child1; + unsigned long i; // egcs in linux doesn't like multiple for loops without an explicit i + + // Loop while pointer has a valid value + while(PTR_VALID(pLast)) // ESI - Last entry + { + THTreeItem * temp; // EAX + + if(pLast->next != NULL) // ESI->next + pLast->RemoveItem(); + // EDI = &offs3054 + pItem3058 = PTR_PTR(&pItem3054); // [EDI+4] + pLast->prev = pItem3058; // EAX + + temp = PTR_PTR(&pItem3054)->GetPrevItem(PTR_INT(&pItem3050)); + + temp->next = pLast; + pItem3054 = pLast; + } + + // Clear all pointers in HTree item array + memset(items306C, 0, sizeof(items306C)); + + maxByte = 0; // Greatest character found init to zero. + itemPtr = (THTreeItem **)&items306C; // Pointer to current entry in HTree item pointer array + + // Ensure we have low 8 bits only + nCmpType &= 0xFF; + byteArray = Table1502A630 + nCmpType * 258; // EDI also + + for(i = 0; i < 0x100; i++, itemPtr++) + { + THTreeItem * item = pItem3058; // Item to be created + THTreeItem * pItem3 = pItem3058; + unsigned char oneByte = byteArray[i]; + + // Skip all the bytes which are zero. + if(byteArray[i] == 0) + continue; + + // If not valid pointer, take the first available item in the array + if(PTR_INVALID_OR_NULL(item)) + item = &items0008[nItems++]; + + // Insert this item as the top of the tree + InsertItem(&pItem305C, item, SWITCH_ITEMS, NULL); + + item->parent = NULL; // Invalidate child and parent + item->child = NULL; + *itemPtr = item; // Store pointer into pointer array + + item->dcmpByte = i; // Store counter + item->byteValue = oneByte; // Store byte value + if(oneByte >= maxByte) + { + maxByte = oneByte; + continue; + } + + // Find the first item which has byte value greater than current one byte + if(PTR_VALID(pItem3 = pLast)) // EDI - Pointer to the last item + { + // 15006AF7 + if(pItem3 != NULL) + { + do // 15006AFB + { + if(pItem3->byteValue >= oneByte) + goto _15006B09; + pItem3 = pItem3->prev; + } + while(PTR_VALID(pItem3)); + } + } + pItem3 = NULL; + + // 15006B09 + _15006B09: + if(item->next != NULL) + item->RemoveItem(); + + // 15006B15 + if(pItem3 == NULL) + pItem3 = PTR_PTR(&pFirst); + + // 15006B1F + item->next = pItem3->next; + item->prev = pItem3->next->prev; + pItem3->next->prev = item; + pItem3->next = item; + } + + // 15006B4A + for(; i < 0x102; i++) + { + THTreeItem ** itemPtr = &items306C[i]; // EDI + + // 15006B59 + THTreeItem * item = pItem3058; // ESI + if(PTR_INVALID_OR_NULL(item)) + item = &items0008[nItems++]; + + InsertItem(&pItem305C, item, INSERT_ITEM, NULL); + + // 15006B89 + item->dcmpByte = i; + item->byteValue = 1; + item->parent = NULL; + item->child = NULL; + *itemPtr++ = item; + } + + // 15006BAA + if(PTR_VALID(child1 = pLast)) // EDI - last item (first child to item + { + THTreeItem * child2; // EBP + THTreeItem * item; // ESI + + // 15006BB8 + while(PTR_VALID(child2 = child1->prev)) + { + if(PTR_INVALID_OR_NULL(item = pItem3058)) + item = &items0008[nItems++]; + + // 15006BE3 + InsertItem(&pItem305C, item, SWITCH_ITEMS, NULL); + + // 15006BF3 + item->parent = NULL; + item->child = NULL; + + //EDX = child2->byteValue + child1->byteValue; + //EAX = child1->byteValue; + //ECX = maxByte; // The greatest character (0xFF usually) + + item->byteValue = child1->byteValue + child2->byteValue; // 0x02 + item->child = child1; // Prev item in the + child1->parent = item; + child2->parent = item; + + // EAX = item->byteValue; + if(item->byteValue >= maxByte) + maxByte = item->byteValue; + else + { + THTreeItem * pItem2 = child2->prev; // EDI + + // 15006C2D + while(PTR_VALID(pItem2)) + { + if(pItem2->byteValue >= item->byteValue) + goto _15006C3B; + pItem2 = pItem2->prev; + } + pItem2 = NULL; + + _15006C3B: + if(item->next != 0) + { + THTreeItem * temp4 = item->GetPrevItem(-1); + + temp4->next = item->next; // The first item changed + item->next->prev = item->prev; // First->prev changed to negative value + item->next = NULL; + item->prev = NULL; + } + + // 15006C62 + if(pItem2 == NULL) + pItem2 = PTR_PTR(&pFirst); + + item->next = pItem2->next; // Set item with 0x100 byte value + item->prev = pItem2->next->prev; // Set item with 0x17 byte value + pItem2->next->prev = item; // Changed prev of item with + pItem2->next = item; + } + + // 15006C7B + if(PTR_INVALID_OR_NULL(child1 = child2->prev)) + break; + } + } + // 15006C88 + offs0004 = 1; +} +/* +// Modifies Huffman tree. Adds new item and changes +void THuffmannTree::ModifyTree(unsigned long dwIndex) +{ + THTreeItem * pItem1 = pItem3058; // ESI + THTreeItem * pSaveLast = (PTR_INT(pLast) <= 0) ? NULL : pLast; // EBX + THTreeItem * temp; // EAX + + // Prepare the first item to insert to the tree + if(PTR_INT(pItem1) <= 0) + pItem1 = &items0008[nItems++]; + + // If item has any next item, remove it from the chain + if(pItem1->next != NULL) + { + THTreeItem * temp = pItem1->GetPrevItem(-1); // EAX + + temp->next = pItem1->next; + pItem1->next->prev = pItem1->prev; + pItem1->next = NULL; + pItem1->prev = NULL; + } + + pItem1->next = PTR_PTR(&pFirst); + pItem1->prev = pLast; + temp = pItem1->next->GetPrevItem(PTR_INT(pItem305C)); + + // 150068E9 + temp->next = pItem1; + pLast = pItem1; + + pItem1->parent = NULL; + pItem1->child = NULL; + + // 150068F6 + pItem1->dcmpByte = pSaveLast->dcmpByte; // Copy item index + pItem1->byteValue = pSaveLast->byteValue; // Copy item byte value + pItem1->parent = pSaveLast; // Set parent to last item + items306C[pSaveLast->dcmpByte] = pItem1; // Insert item into item pointer array + + // Prepare the second item to insert into the tree + if(PTR_INT((pItem1 = pItem3058)) <= 0) + pItem1 = &items0008[nItems++]; + + // 1500692E + if(pItem1->next != NULL) + { + temp = pItem1->GetPrevItem(-1); // EAX + + temp->next = pItem1->next; + pItem1->next->prev = pItem1->prev; + pItem1->next = NULL; + pItem1->prev = NULL; + } + // 1500694C + pItem1->next = PTR_PTR(&pFirst); + pItem1->prev = pLast; + temp = pItem1->next->GetPrevItem(PTR_INT(pItem305C)); + + // 15006968 + temp->next = pItem1; + pLast = pItem1; + + // 1500696E + pItem1->child = NULL; + pItem1->dcmpByte = dwIndex; + pItem1->byteValue = 0; + pItem1->parent = pSaveLast; + pSaveLast->child = pItem1; + items306C[dwIndex] = pItem1; + + do + { + THTreeItem * pItem2 = pItem1; + THTreeItem * pItem3; + unsigned long byteValue; + + // 15006993 + byteValue = ++pItem1->byteValue; + + // Pass through all previous which have its value greater than byteValue + while(PTR_INT((pItem3 = pItem2->prev)) > 0) // EBX + { + if(pItem3->byteValue >= byteValue) + goto _150069AE; + + pItem2 = pItem2->prev; + } + // 150069AC + pItem3 = NULL; + + _150069AE: + if(pItem2 == pItem1) + continue; + + // 150069B2 + // Switch pItem2 with item + InsertItem(&pItem305C, pItem2, SWITCH_ITEMS, pItem1); + InsertItem(&pItem305C, pItem1, SWITCH_ITEMS, pItem3); + + // 150069D0 + // Switch parents of pItem1 and pItem2 + temp = pItem2->parent->child; + if(pItem1 == pItem1->parent->child) + pItem1->parent->child = pItem2; + + if(pItem2 == temp) + pItem2->parent->child = pItem1; + + // 150069ED + // Switch parents of pItem1 and pItem3 + temp = pItem1->parent; + pItem1 ->parent = pItem2->parent; + pItem2->parent = temp; + offs0004++; + } + while(PTR_INT((pItem1 = pItem1->parent)) > 0); +} + +void THuffmannTree::UninitTree() +{ + while(PTR_INT(pLast) > 0) + { + pItem = pItem305C->Call1501DB70(pLast); + pItem->RemoveItem(); + } + + for(pItem = pFirst; PTR_INT(pItem3058) > 0; pItem = pItem3058) + pItem->RemoveItem(); + PTR_PTR(&pItem3054)->RemoveItem(); + + for(pItem = items0008 + 0x203, nCount = 0x203; nCount != 0; nCount--) + { + pItem--; + pItem->RemoveItem(); + pItem->RemoveItem(); + } +} +*/ + +THTreeItem * THuffmannTree::Call1500E740(unsigned int nValue) +{ + THTreeItem * pItem1 = pItem3058; // EDX + THTreeItem * pItem2; // EAX + THTreeItem * pNext; + THTreeItem * pPrev; + THTreeItem ** ppItem; + + if(PTR_INVALID_OR_NULL(pItem1) || (pItem2 = pItem1) == NULL) + { + if((pItem2 = &items0008[nItems++]) != NULL) + pItem1 = pItem2; + else + pItem1 = pFirst; + } + else + pItem1 = pItem2; + + pNext = pItem1->next; + if(pNext != NULL) + { + pPrev = pItem1->prev; + if(PTR_INVALID_OR_NULL(pPrev)) + pPrev = PTR_NOT(pPrev); + else + pPrev += (pItem1 - pItem1->next->prev); + + pPrev->next = pNext; + pNext->prev = pPrev; + pItem1->next = NULL; + pItem1->prev = NULL; + } + + ppItem = &pFirst; // esi + if(nValue > 1) + { + // ecx = pFirst->next; + pItem1->next = *ppItem; + pItem1->prev = (*ppItem)->prev; + + (*ppItem)->prev = pItem2; + *ppItem = pItem1; + + pItem2->parent = NULL; + pItem2->child = NULL; + } + else + { + pItem1->next = (THTreeItem *)ppItem; + pItem1->prev = ppItem[1]; + // edi = pItem305C; + pPrev = ppItem[1]; // ecx + if(PTR_INVALID_OR_NULL(pPrev)) + { + pPrev = PTR_NOT(pPrev); + pPrev->next = pItem1; + pPrev->prev = pItem2; + + pItem2->parent = NULL; + pItem2->child = NULL; + } + else + { + if(PTR_INVALID(pItem305C)) + pPrev += (THTreeItem *)ppItem - (*ppItem)->prev; + else + pPrev += PTR_INT(pItem305C); + + pPrev->next = pItem1; + ppItem[1] = pItem2; + pItem2->parent = NULL; + pItem2->child = NULL; + } + } + return pItem2; +} + +void THuffmannTree::Call1500E820(THTreeItem * pItem) +{ + THTreeItem * pItem1; // edi + THTreeItem * pItem2 = NULL; // eax + THTreeItem * pItem3; // edx + THTreeItem * pPrev; // ebx + + for(; pItem != NULL; pItem = pItem->parent) + { + pItem->byteValue++; + + for(pItem1 = pItem; ; pItem1 = pPrev) + { + pPrev = pItem1->prev; + if(PTR_INVALID_OR_NULL(pPrev)) + { + pPrev = NULL; + break; + } + + if(pPrev->byteValue >= pItem->byteValue) + break; + } + + if(pItem1 == pItem) + continue; + + if(pItem1->next != NULL) + { + pItem2 = pItem1->GetPrevItem(-1); + pItem2->next = pItem1->next; + pItem1->next->prev = pItem1->prev; + pItem1->next = NULL; + pItem1->prev = NULL; + } + + pItem2 = pItem->next; + pItem1->next = pItem2; + pItem1->prev = pItem2->prev; + pItem2->prev = pItem1; + pItem->next = pItem1; + if((pItem2 = pItem1) != NULL) + { + pItem2 = pItem->GetPrevItem(-1); + pItem2->next = pItem->next; + pItem->next->prev = pItem->prev; + pItem->next = NULL; + pItem->prev = NULL; + } + + if(pPrev == NULL) + pPrev = PTR_PTR(&pFirst); + + pItem2 = pPrev->next; + pItem->next = pItem2; + pItem->prev = pItem2->prev; + pItem2->prev = pItem; + pPrev->next = pItem; + + pItem3 = pItem1->parent->child; + pItem2 = pItem->parent; + if(pItem2->child == pItem) + pItem2->child = pItem1; + if(pItem3 == pItem1) + pItem1->parent->child = pItem; + + pItem2 = pItem->parent; + pItem->parent = pItem1->parent; + pItem1->parent = pItem2; + offs0004++; + } +} + +// 1500E920 +unsigned int THuffmannTree::DoCompression(TOutputStream * os, unsigned char * pbInBuffer, int nInLength, int nCmpType) +{ + THTreeItem * pItem1; + THTreeItem * pItem2; + THTreeItem * pItem3; + THTreeItem * pTemp; + unsigned long dwBitBuff; + unsigned int nBits; + unsigned int nBit; + + BuildTree(nCmpType); + bIsCmp0 = (nCmpType == 0); + + // Store the compression type into output buffer + os->dwBitBuff |= (nCmpType << os->nBits); + os->nBits += 8; + + // Flush completed bytes + while(os->nBits >= 8) + { + if(os->cbOutSize != 0) + { + *os->pbOutPos++ = (unsigned char)os->dwBitBuff; + os->cbOutSize--; + } + + os->dwBitBuff >>= 8; + os->nBits -= 8; + } + + for(; nInLength != 0; nInLength--) + { + unsigned char bOneByte = *pbInBuffer++; + + if((pItem1 = items306C[bOneByte]) == NULL) + { + pItem2 = items306C[0x101]; // ecx + pItem3 = pItem2->parent; // eax + dwBitBuff = 0; + nBits = 0; + + for(; pItem3 != NULL; pItem3 = pItem3->parent) + { + nBit = (pItem3->child != pItem2) ? 1 : 0; + dwBitBuff = (dwBitBuff << 1) | nBit; + nBits++; + pItem2 = pItem3; + } + os->PutBits(dwBitBuff, nBits); + + // Store the loaded byte into output stream + os->dwBitBuff |= (bOneByte << os->nBits); + os->nBits += 8; + + // Flush the whole byte(s) + while(os->nBits >= 8) + { + if(os->cbOutSize != 0) + { + *os->pbOutPos++ = (unsigned char)os->dwBitBuff; + os->cbOutSize--; + } + os->dwBitBuff >>= 8; + os->nBits -= 8; + } + + pItem1 = (PTR_INVALID_OR_NULL(pLast)) ? NULL : pLast; + pItem2 = Call1500E740(1); + pItem2->dcmpByte = pItem1->dcmpByte; + pItem2->byteValue = pItem1->byteValue; + pItem2->parent = pItem1; + items306C[pItem2->dcmpByte] = pItem2; + + pItem2 = Call1500E740(1); + pItem2->dcmpByte = bOneByte; + pItem2->byteValue = 0; + pItem2->parent = pItem1; + items306C[pItem2->dcmpByte] = pItem2; + pItem1->child = pItem2; + + Call1500E820(pItem2); + + if(bIsCmp0 != 0) + { + Call1500E820(items306C[bOneByte]); + continue; + } + + for(pItem1 = items306C[bOneByte]; pItem1 != NULL; pItem1 = pItem1->parent) + { + pItem1->byteValue++; + pItem2 = pItem1; + + for(;;) + { + pItem3 = pItem2->prev; + if(PTR_INVALID_OR_NULL(pItem3)) + { + pItem3 = NULL; + break; + } + if(pItem3->byteValue >= pItem1->byteValue) + break; + pItem2 = pItem3; + } + + if(pItem2 != pItem1) + { + InsertItem(&pItem305C, pItem2, SWITCH_ITEMS, pItem1); + InsertItem(&pItem305C, pItem1, SWITCH_ITEMS, pItem3); + + pItem3 = pItem2->parent->child; + if(pItem1->parent->child == pItem1) + pItem1->parent->child = pItem2; + + if(pItem3 == pItem2) + pItem2->parent->child = pItem1; + + pTemp = pItem1->parent; + pItem1->parent = pItem2->parent; + pItem2->parent = pTemp; + offs0004++; + } + } + } +// 1500EB62 + else + { + dwBitBuff = 0; + nBits = 0; + for(pItem2 = pItem1->parent; pItem2 != NULL; pItem2 = pItem2->parent) + { + nBit = (pItem2->child != pItem1) ? 1 : 0; + dwBitBuff = (dwBitBuff << 1) | nBit; + nBits++; + pItem1 = pItem2; + } + os->PutBits(dwBitBuff, nBits); + } + +// 1500EB98 + if(bIsCmp0 != 0) + Call1500E820(items306C[bOneByte]); // 1500EB9D +// 1500EBAF + } // for(; nInLength != 0; nInLength--) + +// 1500EBB8 + pItem1 = items306C[0x100]; + dwBitBuff = 0; + nBits = 0; + for(pItem2 = pItem1->parent; pItem2 != NULL; pItem2 = pItem2->parent) + { + nBit = (pItem2->child != pItem1) ? 1 : 0; + dwBitBuff = (dwBitBuff << 1) | nBit; + nBits++; + pItem1 = pItem2; + } + +// 1500EBE6 + os->PutBits(dwBitBuff, nBits); + +// 1500EBEF + // Flush the remaining bits + while(os->nBits != 0) + { + if(os->cbOutSize != 0) + { + *os->pbOutPos++ = (unsigned char)os->dwBitBuff; + os->cbOutSize--; + } + os->dwBitBuff >>= 8; + os->nBits -= ((os->nBits > 8) ? 8 : os->nBits); + } + + return (unsigned int)(os->pbOutPos - os->pbOutBuffer); +} + +// Decompression using Huffman tree (1500E450) +unsigned int THuffmannTree::DoDecompression(unsigned char * pbOutBuffer, unsigned int dwOutLength, TInputStream * is) +{ + TQDecompress * qd; + THTreeItem * pItem1; + THTreeItem * pItem2; + unsigned char * pbOutPos = pbOutBuffer; + unsigned long nBitCount; + unsigned int nDcmpByte = 0; + unsigned int n8Bits; // 8 bits loaded from input stream + unsigned int n7Bits; // 7 bits loaded from input stream + bool bHasQdEntry; + + // Test the output length. Must not be NULL. + if(dwOutLength == 0) + return 0; + + // Get the compression type from the input stream + n8Bits = is->Get8Bits(); + + // Build the Huffman tree + BuildTree(n8Bits); + bIsCmp0 = (n8Bits == 0) ? 1 : 0; + + for(;;) + { + // Security check: If we are at the end of the input buffer, + // it means that the data are corrupt. + if(is->pbInBuffer > is->pbInBufferEnd) + return 0; + + // Get 7 bits from input stream + n7Bits = is->Get7Bits(); + + // Try to use quick decompression. Check TQDecompress array for corresponding item. + // If found, ise the result byte instead. + qd = &qd3474[n7Bits]; + + // If there is a quick-pass possible (ebx) + bHasQdEntry = (qd->offs00 >= offs0004) ? true : false; + + // If we can use quick decompress, use it. + if(bHasQdEntry) + { + if(qd->nBits > 7) + { + is->SkipBits(7); + pItem1 = qd->pItem; + goto _1500E549; + } + is->SkipBits(qd->nBits); + nDcmpByte = qd->dcmpByte; + } + else + { + pItem1 = pFirst->next->prev; + if(PTR_INVALID_OR_NULL(pItem1)) + pItem1 = NULL; +_1500E549: + nBitCount = 0; + pItem2 = NULL; + + do + { + pItem1 = pItem1->child; // Move down by one level + if(is->GetBit()) // If current bit is set, move to previous + pItem1 = pItem1->prev; + + if(++nBitCount == 7) // If we are at 7th bit, save current HTree item. + pItem2 = pItem1; + } + while(pItem1->child != NULL); // Walk until tree has no deeper level + + if(bHasQdEntry == false) + { + if(nBitCount > 7) + { + qd->offs00 = offs0004; + qd->nBits = nBitCount; + qd->pItem = pItem2; + } + else + { + unsigned long nIndex = n7Bits & (0xFFFFFFFF >> (32 - nBitCount)); + unsigned long nAdd = (1 << nBitCount); + + for(qd = &qd3474[nIndex]; nIndex <= 0x7F; nIndex += nAdd, qd += nAdd) + { + qd->offs00 = offs0004; + qd->nBits = nBitCount; + qd->dcmpByte = pItem1->dcmpByte; + } + } + } + nDcmpByte = pItem1->dcmpByte; + } + + if(nDcmpByte == 0x101) // Huffman tree needs to be modified + { + n8Bits = is->Get8Bits(); + pItem1 = (PTR_INVALID_OR_NULL(pLast)) ? NULL : pLast; + + pItem2 = Call1500E740(1); + pItem2->parent = pItem1; + pItem2->dcmpByte = pItem1->dcmpByte; + pItem2->byteValue = pItem1->byteValue; + items306C[pItem2->dcmpByte] = pItem2; + + pItem2 = Call1500E740(1); + pItem2->parent = pItem1; + pItem2->dcmpByte = n8Bits; + pItem2->byteValue = 0; + items306C[pItem2->dcmpByte] = pItem2; + + pItem1->child = pItem2; + Call1500E820(pItem2); + if(bIsCmp0 == 0) + Call1500E820(items306C[n8Bits]); + + nDcmpByte = n8Bits; + } + + if(nDcmpByte == 0x100) + break; + + *pbOutPos++ = (unsigned char)nDcmpByte; + if(--dwOutLength == 0) + break; + + if(bIsCmp0) + Call1500E820(items306C[nDcmpByte]); + } + + return (unsigned int)(pbOutPos - pbOutBuffer); +} + + +// Table for (de)compression. Every compression type has 258 entries +unsigned char THuffmannTree::Table1502A630[] = +{ + // Data for compression type 0x00 + 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, + + // Data for compression type 0x01 + 0x54, 0x16, 0x16, 0x0D, 0x0C, 0x08, 0x06, 0x05, 0x06, 0x05, 0x06, 0x03, 0x04, 0x04, 0x03, 0x05, + 0x0E, 0x0B, 0x14, 0x13, 0x13, 0x09, 0x0B, 0x06, 0x05, 0x04, 0x03, 0x02, 0x03, 0x02, 0x02, 0x02, + 0x0D, 0x07, 0x09, 0x06, 0x06, 0x04, 0x03, 0x02, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, + 0x09, 0x06, 0x04, 0x04, 0x04, 0x04, 0x03, 0x02, 0x03, 0x02, 0x02, 0x02, 0x02, 0x03, 0x02, 0x04, + 0x08, 0x03, 0x04, 0x07, 0x09, 0x05, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, 0x03, 0x02, 0x02, + 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x02, 0x01, 0x02, 0x02, + 0x06, 0x0A, 0x08, 0x08, 0x06, 0x07, 0x04, 0x03, 0x04, 0x04, 0x02, 0x02, 0x04, 0x02, 0x03, 0x03, + 0x04, 0x03, 0x07, 0x07, 0x09, 0x06, 0x04, 0x03, 0x03, 0x02, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x0A, 0x02, 0x02, 0x03, 0x02, 0x02, 0x01, 0x01, 0x02, 0x02, 0x02, 0x06, 0x03, 0x05, 0x02, 0x03, + 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x03, 0x01, 0x01, 0x01, + 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x04, 0x04, 0x04, 0x07, 0x09, 0x08, 0x0C, 0x02, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x03, + 0x04, 0x01, 0x02, 0x04, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, + 0x04, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x01, 0x01, 0x02, 0x02, 0x02, 0x06, 0x4B, + 0x00, 0x00, + + // Data for compression type 0x02 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x27, 0x00, 0x00, 0x23, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x01, 0x01, 0x06, 0x0E, 0x10, 0x04, + 0x06, 0x08, 0x05, 0x04, 0x04, 0x03, 0x03, 0x02, 0x02, 0x03, 0x03, 0x01, 0x01, 0x02, 0x01, 0x01, + 0x01, 0x04, 0x02, 0x04, 0x02, 0x02, 0x02, 0x01, 0x01, 0x04, 0x01, 0x01, 0x02, 0x03, 0x03, 0x02, + 0x03, 0x01, 0x03, 0x06, 0x04, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x01, 0x02, 0x01, 0x01, + 0x01, 0x29, 0x07, 0x16, 0x12, 0x40, 0x0A, 0x0A, 0x11, 0x25, 0x01, 0x03, 0x17, 0x10, 0x26, 0x2A, + 0x10, 0x01, 0x23, 0x23, 0x2F, 0x10, 0x06, 0x07, 0x02, 0x09, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, + + // Data for compression type 0x03 + 0xFF, 0x0B, 0x07, 0x05, 0x0B, 0x02, 0x02, 0x02, 0x06, 0x02, 0x02, 0x01, 0x04, 0x02, 0x01, 0x03, + 0x09, 0x01, 0x01, 0x01, 0x03, 0x04, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, + 0x05, 0x01, 0x01, 0x01, 0x0D, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x02, 0x01, 0x01, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, + 0x0A, 0x04, 0x02, 0x01, 0x06, 0x03, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x03, 0x01, 0x01, 0x01, + 0x05, 0x02, 0x03, 0x04, 0x03, 0x03, 0x03, 0x02, 0x01, 0x01, 0x01, 0x02, 0x01, 0x02, 0x03, 0x03, + 0x01, 0x03, 0x01, 0x01, 0x02, 0x05, 0x01, 0x01, 0x04, 0x03, 0x05, 0x01, 0x03, 0x01, 0x03, 0x03, + 0x02, 0x01, 0x04, 0x03, 0x0A, 0x06, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x02, 0x02, 0x01, 0x0A, 0x02, 0x05, 0x01, 0x01, 0x02, 0x07, 0x02, 0x17, 0x01, 0x05, 0x01, 0x01, + 0x0E, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x06, 0x02, 0x01, 0x04, 0x05, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x07, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, + 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x11, + 0x00, 0x00, + + // Data for compression type 0x04 + 0xFF, 0xFB, 0x98, 0x9A, 0x84, 0x85, 0x63, 0x64, 0x3E, 0x3E, 0x22, 0x22, 0x13, 0x13, 0x18, 0x17, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, + + // Data for compression type 0x05 + 0xFF, 0xF1, 0x9D, 0x9E, 0x9A, 0x9B, 0x9A, 0x97, 0x93, 0x93, 0x8C, 0x8E, 0x86, 0x88, 0x80, 0x82, + 0x7C, 0x7C, 0x72, 0x73, 0x69, 0x6B, 0x5F, 0x60, 0x55, 0x56, 0x4A, 0x4B, 0x40, 0x41, 0x37, 0x37, + 0x2F, 0x2F, 0x27, 0x27, 0x21, 0x21, 0x1B, 0x1C, 0x17, 0x17, 0x13, 0x13, 0x10, 0x10, 0x0D, 0x0D, + 0x0B, 0x0B, 0x09, 0x09, 0x08, 0x08, 0x07, 0x07, 0x06, 0x05, 0x05, 0x04, 0x04, 0x04, 0x19, 0x18, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, + + // Data for compression type 0x06 + 0xC3, 0xCB, 0xF5, 0x41, 0xFF, 0x7B, 0xF7, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xBF, 0xCC, 0xF2, 0x40, 0xFD, 0x7C, 0xF7, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x7A, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, + + // Data for compression type 0x07 + 0xC3, 0xD9, 0xEF, 0x3D, 0xF9, 0x7C, 0xE9, 0x1E, 0xFD, 0xAB, 0xF1, 0x2C, 0xFC, 0x5B, 0xFE, 0x17, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xBD, 0xD9, 0xEC, 0x3D, 0xF5, 0x7D, 0xE8, 0x1D, 0xFB, 0xAE, 0xF0, 0x2C, 0xFB, 0x5C, 0xFF, 0x18, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x70, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, + + // Data for compression type 0x08 + 0xBA, 0xC5, 0xDA, 0x33, 0xE3, 0x6D, 0xD8, 0x18, 0xE5, 0x94, 0xDA, 0x23, 0xDF, 0x4A, 0xD1, 0x10, + 0xEE, 0xAF, 0xE4, 0x2C, 0xEA, 0x5A, 0xDE, 0x15, 0xF4, 0x87, 0xE9, 0x21, 0xF6, 0x43, 0xFC, 0x12, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xB0, 0xC7, 0xD8, 0x33, 0xE3, 0x6B, 0xD6, 0x18, 0xE7, 0x95, 0xD8, 0x23, 0xDB, 0x49, 0xD0, 0x11, + 0xE9, 0xB2, 0xE2, 0x2B, 0xE8, 0x5C, 0xDD, 0x15, 0xF1, 0x87, 0xE7, 0x20, 0xF7, 0x44, 0xFF, 0x13, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x5F, 0x9E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00 +}; diff --git a/dep/StormLib/src/huffman/huff.h b/dep/StormLib/src/huffman/huff.h new file mode 100644 index 00000000000..6af4ac638bb --- /dev/null +++ b/dep/StormLib/src/huffman/huff.h @@ -0,0 +1,144 @@ +/*****************************************************************************/ +/* huffman.h Copyright (c) Ladislav Zezula 2003 */ +/*---------------------------------------------------------------------------*/ +/* Description : */ +/*---------------------------------------------------------------------------*/ +/* Date Ver Who Comment */ +/* -------- ---- --- ------- */ +/* xx.xx.xx 1.00 Lad The first version of huffman.h */ +/* 03.05.03 2.00 Lad Added compression */ +/* 08.12.03 2.01 Dan High-memory handling (> 0x80000000) */ +/*****************************************************************************/ + +#ifndef __HUFFMAN_H__ +#define __HUFFMAN_H__ + +#include "../StormPort.h" + +//----------------------------------------------------------------------------- +// Defines + +#define INSERT_ITEM 1 +#define SWITCH_ITEMS 2 // Switch the item1 and item2 + +#define PTR_NOT(ptr) (THTreeItem *)(~(DWORD_PTR)(ptr)) +#define PTR_PTR(ptr) ((THTreeItem *)(ptr)) +#define PTR_INT(ptr) (INT_PTR)(ptr) + +#ifndef NULL +#define NULL 0 +#endif + +//----------------------------------------------------------------------------- +// Structures and classes + +// Input stream for Huffmann decompression +class TInputStream +{ + public: + + unsigned long GetBit(); + unsigned long Get7Bits(); + unsigned long Get8Bits(); + void SkipBits(unsigned int BitCount); + + unsigned char * pbInBuffer; // Input data + unsigned char * pbInBufferEnd; // End of the input buffer + unsigned long BitBuffer; // Input bit buffer + unsigned int BitCount; // Number of bits remaining in 'dwBitBuff' +}; + +// Output stream for Huffmann compression +class TOutputStream +{ + public: + + void PutBits(unsigned long dwBuff, unsigned int nPutBits); + + unsigned char * pbOutBuffer; // 00 : Output buffer + unsigned long cbOutSize; // 04 : Size of output buffer + unsigned char * pbOutPos; // 08 : Current output position + unsigned long dwBitBuff; // 0C : Bit buffer + unsigned long nBits; // 10 : Number of bits in the bit buffer +}; + +// Huffmann tree item (?) +struct THTreeItem +{ + public: + + THTreeItem * Call1501DB70(THTreeItem * pLast); + THTreeItem * GetPrevItem(LONG_PTR value); + void ClearItemLinks(); + void RemoveItem(); + + THTreeItem * next; // 00 - Pointer to next THTreeItem + THTreeItem * prev; // 04 - Pointer to prev THTreeItem (< 0 if none) + unsigned long dcmpByte; // 08 - Index of this item in item pointer array, decompressed byte value + unsigned long byteValue; // 0C - Some byte value + THTreeItem * parent; // 10 - Pointer to parent THTreeItem (NULL if none) + THTreeItem * child; // 14 - Pointer to child THTreeItem + int addressMultiplier; // -1 if object on negative address (>0x80000000), +1 if positive +}; + +// Structure used for quick decompress. The 'bitCount' contains number of bits +// and byte value contains result decompressed byte value. +// After each walk through Huffman tree are filled all entries which are +// multiplies of number of bits loaded from input stream. These entries +// contain number of bits and result value. At the next 7 bits is tested this +// structure first. If corresponding entry found, decompression routine will +// not walk through Huffman tree and directly stores output byte to output stream. +struct TQDecompress +{ + unsigned long offs00; // 00 - 1 if resolved + unsigned long nBits; // 04 - Bit count + union + { + unsigned long dcmpByte; // 08 - Byte value for decompress (if bitCount <= 7) + THTreeItem * pItem; // 08 - THTreeItem (if number of bits is greater than 7 + }; +}; + +// Structure for Huffman tree (Size 0x3674 bytes). Because I'm not expert +// for the decompression, I do not know actually if the class is really a Hufmann +// tree. If someone knows the decompression details, please let me know +class THuffmannTree +{ + public: + + THuffmannTree(); + void InitTree(bool bCompression); + void BuildTree(unsigned int nCmpType); +// void ModifyTree(unsigned long dwIndex); +// void UninitTree(); + +// void Call15007010(Bit32 dwInLength, THTreeItem * item); + THTreeItem * Call1500E740(unsigned int nValue); + void Call1500E820(THTreeItem * pItem); + unsigned int DoCompression(TOutputStream * os, unsigned char * pbInBuffer, int nInLength, int nCmpType); + unsigned int DoDecompression(unsigned char * pbOutBuffer, unsigned int dwOutLength, TInputStream * is); + + unsigned long bIsCmp0; // 0000 - 1 if compression type 0 + unsigned long offs0004; // 0004 - Some flag + THTreeItem items0008[0x203]; // 0008 - HTree items + + //- Sometimes used as HTree item ----------- + THTreeItem * pItem3050; // 3050 - Always NULL (?) + THTreeItem * pItem3054; // 3054 - Pointer to Huffman tree item + THTreeItem * pItem3058; // 3058 - Pointer to Huffman tree item (< 0 if invalid) + + //- Sometimes used as HTree item ----------- + THTreeItem * pItem305C; // 305C - Usually NULL + THTreeItem * pFirst; // 3060 - Pointer to top (first) Huffman tree item + THTreeItem * pLast; // 3064 - Pointer to bottom (last) Huffman tree item (< 0 if invalid) + unsigned long nItems; // 3068 - Number of used HTree items + + //------------------------------------------- + THTreeItem * items306C[0x102]; // 306C - THTreeItem pointer array + TQDecompress qd3474[0x80]; // 3474 - Array for quick decompression + int addressMultiplier; // -1 if object on negative address (>0x80000000), +1 if positive + + static unsigned char Table1502A630[];// Some table +}; + +#endif // __HUFFMAN_H__ diff --git a/dep/StormLib/src/huffman/huff_patch.cpp b/dep/StormLib/src/huffman/huff_patch.cpp new file mode 100644 index 00000000000..6176a9b1f77 --- /dev/null +++ b/dep/StormLib/src/huffman/huff_patch.cpp @@ -0,0 +1,1120 @@ +/*****************************************************************************/ +/* huffman.cpp Copyright (c) Ladislav Zezula 1998-2003 */ +/*---------------------------------------------------------------------------*/ +/* This module contains Huffmann (de)compression methods */ +/* */ +/* Authors : Ladislav Zezula (ladik@zezula.net) */ +/* ShadowFlare (BlakFlare@hotmail.com) */ +/* */ +/*---------------------------------------------------------------------------*/ +/* Date Ver Who Comment */ +/* -------- ---- --- ------- */ +/* xx.xx.xx 1.00 Lad The first version of dcmp.cpp */ +/* 03.05.03 1.00 Lad Added compression methods */ +/* 19.11.03 1.01 Dan Big endian handling */ +/* 08.12.03 2.01 Dan High-memory handling (> 0x80000000) */ +/*****************************************************************************/ + +#include +#include + +#include "huff.h" + +THTreeItem * gcpFirst, * gpFirst, * gcpItem3054, * gpItem3054; + +#define PTR_VALID(ptr) ((ptr) != gcpFirst && (ptr) != gcpItem3054) +#define PTR_INVALID(ptr) (!PTR_VALID(ptr)) +#define PTR_INVALID_OR_NULL(ptr) (0 == (ptr) || PTR_INVALID(ptr)) + +//----------------------------------------------------------------------------- +// Methods of the THTreeItem struct + +// 1501DB70 +THTreeItem * THTreeItem::Call1501DB70(THTreeItem * pLast) +{ + if(pLast == NULL) + pLast = this + 1; + return pLast; +} + +// Gets previous Huffman tree item (?) +THTreeItem * THTreeItem::GetPrevItem(SIntPtr value) +{ + if(PTR_INVALID(prev)) + return PTR_NOT(prev); + + if(value == -1 || PTR_INVALID((THTreeItem *) value)) + value = (SIntPtr)(this - next->prev); + return prev + value; +} + +// 1500F5E0 +void THTreeItem::ClearItemLinks() +{ + next = prev = NULL; +} + +// 1500BC90 +void THTreeItem::RemoveItem() +{ + THTreeItem * pTemp; // EDX + + if(next != NULL) + { + pTemp = prev; + + if(PTR_INVALID(pTemp)) + pTemp = PTR_NOT(pTemp); + else + pTemp += (this - next->prev); + + pTemp->next = next; + next->prev = prev; + next = prev = NULL; + } +} + +//----------------------------------------------------------------------------- +// TOutputStream functions + +void TOutputStream::PutBits(unsigned long dwBuff, unsigned int nPutBits) +{ + dwBitBuff |= (dwBuff << nBits); + nBits += nPutBits; + + // Flush completed bytes + while(nBits >= 8) + { + if(cbOutSize != 0) + { + *pbOutPos++ = (unsigned char)dwBitBuff; + cbOutSize--; + } + + dwBitBuff >>= 8; + nBits -= 8; + } +} + +//----------------------------------------------------------------------------- +// TInputStream functions + +// Gets one bit from input stream +unsigned long TInputStream::GetBit() +{ + unsigned long dwOneBit = 0; + + // Ensure that the input stream is reloaded, if there are no bits left + if(BitCount == 0) + { + // Refill the bit buffer + BitBuffer = *pbInBuffer++; + BitCount = 8; + } + + // Copy the bit from bit buffer to the variable + dwOneBit = (BitBuffer & 0x01); + BitBuffer >>= 1; + BitCount--; + + return dwOneBit; +} + +// Gets 7 bits from the stream. DOES NOT remove the bits from input stream +unsigned long TInputStream::Get7Bits() +{ + unsigned long dwReloadByte = 0; + + // If there is not enough bits to get the value, + // we have to add 8 more bits from the input buffer + if(BitCount < 7) + { + dwReloadByte = *pbInBuffer++; + BitBuffer |= dwReloadByte << BitCount; + BitCount += 8; + } + + // Return the first available 7 bits. DO NOT remove them from the input stream + return (BitBuffer & 0x7F); +} + +// Gets the whole byte from the input stream. +unsigned long TInputStream::Get8Bits() +{ + unsigned long dwReloadByte = 0; + unsigned long dwOneByte = 0; + + // If there is not enough bits to get the value, + // we have to add 8 more bits from the input buffer + if(BitCount < 8) + { + dwReloadByte = *pbInBuffer++; + BitBuffer |= dwReloadByte << BitCount; + BitCount += 8; + } + + // Return the lowest 8 its + dwOneByte = (BitBuffer & 0xFF); + BitBuffer >>= 8; + BitCount -= 8; + return dwOneByte; +} + +void TInputStream::SkipBits(unsigned int dwBitsToSkip) +{ + unsigned long dwReloadByte = 0; + + // If there is not enough bits in the buffer, + // we have to add 8 more bits from the input buffer + if(BitCount < dwBitsToSkip) + { + dwReloadByte = *pbInBuffer++; + BitBuffer |= dwReloadByte << BitCount; + BitCount += 8; + } + + // Skip the remaining bits + BitBuffer >>= dwBitsToSkip; + BitCount -= dwBitsToSkip; +} + +//----------------------------------------------------------------------------- +// Functions for huffmann tree items + +// Inserts item into the tree (?) +static void InsertItem(THTreeItem ** itemPtr, THTreeItem * item, unsigned long where, THTreeItem * item2) +{ + THTreeItem * next = item->next; // EDI - next to the first item + THTreeItem * prev = item->prev; // ESI - prev to the first item + THTreeItem * prev2; // Pointer to previous item + THTreeItem * next2; // Pointer to the next item + + // The same code like in RemoveItem(item); + if(next != 0) // If the first item already has next one + { + if(PTR_INVALID(prev)) + prev = PTR_NOT(prev); + else + prev += (item - next->prev); + + // 150083C1 + // Remove the item from the tree + prev->next = next; + next->prev = prev; + + // Invalidate 'prev' and 'next' pointer + item->next = 0; + item->prev = 0; + } + + if(item2 == NULL) // EDX - If the second item is not entered, + item2 = PTR_PTR(&itemPtr[1]); // take the first tree item + + switch(where) + { + case SWITCH_ITEMS : // Switch the two items + item->next = item2->next; // item2->next (Pointer to pointer to first) + item->prev = item2->next->prev; + item2->next->prev = item; + item2->next = item; // Set the first item + return; + + case INSERT_ITEM: // Insert as the last item + item->next = item2; // Set next item (or pointer to pointer to first item) + item->prev = item2->prev; // Set prev item (or last item in the tree) + + next2 = itemPtr[0];// Usually NULL + prev2 = item2->prev; // Prev item to the second (or last tree item) + + if(PTR_INVALID(prev2)) + { + prev2 = PTR_NOT(prev); + + prev2->next = item; + item2->prev = item; // Next after last item + return; + } + + if(PTR_INVALID(next2)) + next2 = (THTreeItem *)(item2 - item2->next->prev); + + prev2 += (long) next2; + prev2->next = item; + item2->prev = item; // Set the next/last item + return; + + default: + return; + } +} + +//----------------------------------------------------------------------------- +// THuffmannTree class functions + +THuffmannTree::THuffmannTree() +{ +} + +void THuffmannTree::InitTree(bool bCompression) +{ + THTreeItem * pItem; + unsigned int nCount; + + // Clear links for all the items in the tree + for(pItem = items0008, nCount = 0x203; nCount != 0; pItem++, nCount--) + pItem->ClearItemLinks(); + + gcpItem3054 = (THTreeItem *) &gcpItem3054; + pItem3050 = NULL; + pItem3054 = PTR_PTR(&pItem3054); + pItem3058 = gcpItem3054; + gpItem3054 = pItem3054; + + gcpFirst = (THTreeItem *) &gcpFirst; + pItem305C = NULL; + pFirst = PTR_PTR(&pFirst); + pLast = gcpFirst; + gpFirst = pFirst; + + offs0004 = 1; + nItems = 0; + + // Clear all TQDecompress items. Do this only if preparing for decompression + if(bCompression == false) + { + for(nCount = 0; nCount < sizeof(qd3474) / sizeof(TQDecompress); nCount++) + qd3474[nCount].offs00 = 0; + } +} + +// Builds Huffman tree. Called with the first 8 bits loaded from input stream +void THuffmannTree::BuildTree(unsigned int nCmpType) +{ + unsigned long maxByte; // [ESP+10] - The greatest character found in table + THTreeItem ** itemPtr; // [ESP+14] - Pointer to Huffman tree item pointer array + unsigned char * byteArray; // [ESP+1C] - Pointer to unsigned char in Table1502A630 + THTreeItem * child1; + unsigned long i; // egcs in linux doesn't like multiple for loops without an explicit i + + // Loop while pointer has a valid value + while(PTR_VALID(pLast)) // ESI - Last entry + { + THTreeItem * temp; // EAX + + if(pLast->next != NULL) // ESI->next + pLast->RemoveItem(); + // EDI = &offs3054 + pItem3058 = PTR_PTR(&pItem3054); // [EDI+4] + pLast->prev = pItem3058; // EAX + + temp = PTR_PTR(&pItem3054)->GetPrevItem((SIntPtr)(&pItem3050)); + + temp->next = pLast; + pItem3054 = pLast; + } + + // Clear all pointers in HTree item array + memset(items306C, 0, sizeof(items306C)); + + maxByte = 0; // Greatest character found init to zero. + itemPtr = (THTreeItem **)&items306C; // Pointer to current entry in HTree item pointer array + + // Ensure we have low 8 bits only + nCmpType &= 0xFF; + byteArray = Table1502A630 + nCmpType * 258; // EDI also + + for(i = 0; i < 0x100; i++, itemPtr++) + { + THTreeItem * item = pItem3058; // Item to be created + THTreeItem * pItem3 = pItem3058; + unsigned char oneByte = byteArray[i]; + + // Skip all the bytes which are zero. + if(byteArray[i] == 0) + continue; + + // If not valid pointer, take the first available item in the array + if(PTR_INVALID_OR_NULL(item)) + item = &items0008[nItems++]; + + // Insert this item as the top of the tree + InsertItem(&pItem305C, item, SWITCH_ITEMS, NULL); + + item->parent = NULL; // Invalidate child and parent + item->child = NULL; + *itemPtr = item; // Store pointer into pointer array + + item->dcmpByte = i; // Store counter + item->byteValue = oneByte; // Store byte value + if(oneByte >= maxByte) + { + maxByte = oneByte; + continue; + } + + // Find the first item which has byte value greater than current one byte + if(PTR_VALID(pItem3 = pLast)) // EDI - Pointer to the last item + { + // 15006AF7 + if(pItem3 != NULL) + { + do // 15006AFB + { + if(pItem3->byteValue >= oneByte) + goto _15006B09; + pItem3 = pItem3->prev; + } + while(PTR_VALID(pItem3)); + } + } + pItem3 = NULL; + + // 15006B09 + _15006B09: + if(item->next != NULL) + item->RemoveItem(); + + // 15006B15 + if(pItem3 == NULL) + pItem3 = PTR_PTR(&pFirst); + + // 15006B1F + item->next = pItem3->next; + item->prev = pItem3->next->prev; + pItem3->next->prev = item; + pItem3->next = item; + } + + // 15006B4A + for(; i < 0x102; i++) + { + THTreeItem ** itemPtr = &items306C[i]; // EDI + + // 15006B59 + THTreeItem * item = pItem3058; // ESI + if(PTR_INVALID_OR_NULL(item)) + item = &items0008[nItems++]; + + InsertItem(&pItem305C, item, INSERT_ITEM, NULL); + + // 15006B89 + item->dcmpByte = i; + item->byteValue = 1; + item->parent = NULL; + item->child = NULL; + *itemPtr++ = item; + } + + // 15006BAA + if(PTR_VALID(child1 = pLast)) // EDI - last item (first child to item + { + THTreeItem * child2; // EBP + THTreeItem * item; // ESI + + // 15006BB8 + while(PTR_VALID(child2 = child1->prev)) + { + if(PTR_INVALID_OR_NULL(item = pItem3058)) + item = &items0008[nItems++]; + + // 15006BE3 + InsertItem(&pItem305C, item, SWITCH_ITEMS, NULL); + + // 15006BF3 + item->parent = NULL; + item->child = NULL; + + //EDX = child2->byteValue + child1->byteValue; + //EAX = child1->byteValue; + //ECX = maxByte; // The greatest character (0xFF usually) + + item->byteValue = child1->byteValue + child2->byteValue; // 0x02 + item->child = child1; // Prev item in the + child1->parent = item; + child2->parent = item; + + // EAX = item->byteValue; + if(item->byteValue >= maxByte) + maxByte = item->byteValue; + else + { + THTreeItem * pItem2 = child2->prev; // EDI + + // 15006C2D + while(PTR_VALID(pItem2)) + { + if(pItem2->byteValue >= item->byteValue) + goto _15006C3B; + pItem2 = pItem2->prev; + } + pItem2 = NULL; + + _15006C3B: + if(item->next != 0) + { + THTreeItem * temp4 = item->GetPrevItem(-1); + + temp4->next = item->next; // The first item changed + item->next->prev = item->prev; // First->prev changed to negative value + item->next = NULL; + item->prev = NULL; + } + + // 15006C62 + if(pItem2 == NULL) + pItem2 = PTR_PTR(&pFirst); + + item->next = pItem2->next; // Set item with 0x100 byte value + item->prev = pItem2->next->prev; // Set item with 0x17 byte value + pItem2->next->prev = item; // Changed prev of item with + pItem2->next = item; + } + + // 15006C7B + if(PTR_INVALID_OR_NULL(child1 = child2->prev)) + break; + } + } + // 15006C88 + offs0004 = 1; +} + +THTreeItem * THuffmannTree::Call1500E740(unsigned int nValue) +{ + THTreeItem * pItem1 = pItem3058; // EDX + THTreeItem * pItem2; // EAX + THTreeItem * pNext; + THTreeItem * pPrev; + THTreeItem ** ppItem; + + if(PTR_INVALID_OR_NULL(pItem1) || (pItem2 = pItem1) == NULL) + { + if((pItem2 = &items0008[nItems++]) != NULL) + pItem1 = pItem2; + else + pItem1 = pFirst; + } + else + pItem1 = pItem2; + + pNext = pItem1->next; + if(pNext != NULL) + { + pPrev = pItem1->prev; + if(PTR_INVALID(pPrev)) + pPrev = PTR_NOT(pPrev); + else + pPrev += (pItem1 - pItem1->next->prev); + + pPrev->next = pNext; + pNext->prev = pPrev; + pItem1->next = NULL; + pItem1->prev = NULL; + } + + ppItem = &pFirst; // esi + if(nValue > 1) + { + // ecx = pFirst->next; + pItem1->next = *ppItem; + pItem1->prev = (*ppItem)->prev; + + (*ppItem)->prev = pItem2; + *ppItem = pItem1; + + pItem2->parent = NULL; + pItem2->child = NULL; + } + else + { + pItem1->next = (THTreeItem *)ppItem; + pItem1->prev = ppItem[1]; + // edi = pItem305C; + pPrev = ppItem[1]; // ecx + if(PTR_INVALID(pPrev)) + { + pPrev = PTR_NOT(pPrev); + pPrev->next = pItem1; + pPrev->prev = pItem2; + + pItem2->parent = NULL; + pItem2->child = NULL; + } + else + { + if(PTR_INVALID(pItem305C)) + pPrev += (THTreeItem *)ppItem - (*ppItem)->prev; + else + pPrev += (long)pItem305C; + + pPrev->next = pItem1; + ppItem[1] = pItem2; + pItem2->parent = NULL; + pItem2->child = NULL; + } + } + return pItem2; +} + +void THuffmannTree::Call1500E820(THTreeItem * pItem) +{ + THTreeItem * pItem1; // edi + THTreeItem * pItem2 = NULL; // eax + THTreeItem * pItem3; // edx + THTreeItem * pPrev; // ebx + + for(; pItem != NULL; pItem = pItem->parent) + { + pItem->byteValue++; + + for(pItem1 = pItem; ; pItem1 = pPrev) + { + pPrev = pItem1->prev; + if(PTR_INVALID_OR_NULL(pPrev)) + { + pPrev = NULL; + break; + } + + if(pPrev->byteValue >= pItem->byteValue) + break; + } + + if(pItem1 == pItem) + continue; + + if(pItem1->next != NULL) + { + pItem2 = pItem1->GetPrevItem(-1); + pItem2->next = pItem1->next; + pItem1->next->prev = pItem1->prev; + pItem1->next = NULL; + pItem1->prev = NULL; + } + + pItem2 = pItem->next; + pItem1->next = pItem2; + pItem1->prev = pItem2->prev; + pItem2->prev = pItem1; + pItem->next = pItem1; + if((pItem2 = pItem1) != NULL) + { + pItem2 = pItem->GetPrevItem(-1); + pItem2->next = pItem->next; + pItem->next->prev = pItem->prev; + pItem->next = NULL; + pItem->prev = NULL; + } + + if(pPrev == NULL) + pPrev = PTR_PTR(&pFirst); + + pItem2 = pPrev->next; + pItem->next = pItem2; + pItem->prev = pItem2->prev; + pItem2->prev = pItem; + pPrev->next = pItem; + + pItem3 = pItem1->parent->child; + pItem2 = pItem->parent; + if(pItem2->child == pItem) + pItem2->child = pItem1; + if(pItem3 == pItem1) + pItem1->parent->child = pItem; + + pItem2 = pItem->parent; + pItem->parent = pItem1->parent; + pItem1->parent = pItem2; + offs0004++; + } +} + +// 1500E920 +unsigned int THuffmannTree::DoCompression(TOutputStream * os, unsigned char * pbInBuffer, int nInLength, int nCmpType) +{ + THTreeItem * pItem1; + THTreeItem * pItem2; + THTreeItem * pItem3; + THTreeItem * pTemp; + unsigned long dwBitBuff; + unsigned int nBits; + unsigned int nBit; + + BuildTree(nCmpType); + bIsCmp0 = (nCmpType == 0); + + // Store the compression type into output buffer + os->dwBitBuff |= (nCmpType << os->nBits); + os->nBits += 8; + + // Flush completed bytes + while(os->nBits >= 8) + { + if(os->cbOutSize != 0) + { + *os->pbOutPos++ = (unsigned char)os->dwBitBuff; + os->cbOutSize--; + } + + os->dwBitBuff >>= 8; + os->nBits -= 8; + } + + for(; nInLength != 0; nInLength--) + { + unsigned char bOneByte = *pbInBuffer++; + + if((pItem1 = items306C[bOneByte]) == NULL) + { + pItem2 = items306C[0x101]; // ecx + pItem3 = pItem2->parent; // eax + dwBitBuff = 0; + nBits = 0; + + for(; pItem3 != NULL; pItem3 = pItem3->parent) + { + nBit = (pItem3->child != pItem2) ? 1 : 0; + dwBitBuff = (dwBitBuff << 1) | nBit; + nBits++; + pItem2 = pItem3; + } + os->PutBits(dwBitBuff, nBits); + + // Store the loaded byte into output stream + os->dwBitBuff |= (bOneByte << os->nBits); + os->nBits += 8; + + // Flush the whole byte(s) + while(os->nBits >= 8) + { + if(os->cbOutSize != 0) + { + *os->pbOutPos++ = (unsigned char)os->dwBitBuff; + os->cbOutSize--; + } + os->dwBitBuff >>= 8; + os->nBits -= 8; + } + + pItem1 = (PTR_INVALID_OR_NULL(pLast)) ? NULL : pLast; + pItem2 = Call1500E740(1); + pItem2->dcmpByte = pItem1->dcmpByte; + pItem2->byteValue = pItem1->byteValue; + pItem2->parent = pItem1; + items306C[pItem2->dcmpByte] = pItem2; + + pItem2 = Call1500E740(1); + pItem2->dcmpByte = bOneByte; + pItem2->byteValue = 0; + pItem2->parent = pItem1; + items306C[pItem2->dcmpByte] = pItem2; + pItem1->child = pItem2; + + Call1500E820(pItem2); + + if(bIsCmp0 != 0) + { + Call1500E820(items306C[bOneByte]); + continue; + } + + for(pItem1 = items306C[bOneByte]; pItem1 != NULL; pItem1 = pItem1->parent) + { + pItem1->byteValue++; + pItem2 = pItem1; + + for(;;) + { + pItem3 = pItem2->prev; + if(PTR_INVALID_OR_NULL(pItem3)) + { + pItem3 = NULL; + break; + } + if(pItem3->byteValue >= pItem1->byteValue) + break; + pItem2 = pItem3; + } + + if(pItem2 != pItem1) + { + InsertItem(&pItem305C, pItem2, SWITCH_ITEMS, pItem1); + InsertItem(&pItem305C, pItem1, SWITCH_ITEMS, pItem3); + + pItem3 = pItem2->parent->child; + if(pItem1->parent->child == pItem1) + pItem1->parent->child = pItem2; + + if(pItem3 == pItem2) + pItem2->parent->child = pItem1; + + pTemp = pItem1->parent; + pItem1->parent = pItem2->parent; + pItem2->parent = pTemp; + offs0004++; + } + } + } +// 1500EB62 + else + { + dwBitBuff = 0; + nBits = 0; + for(pItem2 = pItem1->parent; pItem2 != NULL; pItem2 = pItem2->parent) + { + nBit = (pItem2->child != pItem1) ? 1 : 0; + dwBitBuff = (dwBitBuff << 1) | nBit; + nBits++; + pItem1 = pItem2; + } + os->PutBits(dwBitBuff, nBits); + } + +// 1500EB98 + if(bIsCmp0 != 0) + Call1500E820(items306C[bOneByte]); // 1500EB9D +// 1500EBAF + } // for(; nInLength != 0; nInLength--) + +// 1500EBB8 + pItem1 = items306C[0x100]; + dwBitBuff = 0; + nBits = 0; + for(pItem2 = pItem1->parent; pItem2 != NULL; pItem2 = pItem2->parent) + { + nBit = (pItem2->child != pItem1) ? 1 : 0; + dwBitBuff = (dwBitBuff << 1) | nBit; + nBits++; + pItem1 = pItem2; + } + +// 1500EBE6 + os->PutBits(dwBitBuff, nBits); + +// 1500EBEF + // Flush the remaining bits + while(os->nBits != 0) + { + if(os->cbOutSize != 0) + { + *os->pbOutPos++ = (unsigned char)os->dwBitBuff; + os->cbOutSize--; + } + os->dwBitBuff >>= 8; + os->nBits -= ((os->nBits > 8) ? 8 : os->nBits); + } + + return (unsigned int)(os->pbOutPos - os->pbOutBuffer); +} + +// Decompression using Huffman tree (1500E450) +unsigned int THuffmannTree::DoDecompression(unsigned char * pbOutBuffer, unsigned int dwOutLength, TInputStream * is) +{ + TQDecompress * qd; + THTreeItem * pItem1; + THTreeItem * pItem2; + unsigned char * pbOutPos = pbOutBuffer; + unsigned long nBitCount; + unsigned int nDcmpByte = 0; + unsigned int n8Bits; // 8 bits loaded from input stream + unsigned int n7Bits; // 7 bits loaded from input stream + bool bHasQdEntry; + + // Test the output length. Must not be NULL. + if(dwOutLength == 0) + return 0; + + // Get the compression type from the input stream + n8Bits = is->Get8Bits(); + + // Build the Huffman tree + BuildTree(n8Bits); + bIsCmp0 = (n8Bits == 0) ? 1 : 0; + + for(;;) + { + // Security check: If we are at the end of the input buffer, + // it means that the data are corrupt. + if(is->pbInBuffer > is->pbInBufferEnd) + return 0; + + // Get 7 bits from input stream + n7Bits = is->Get7Bits(); + + // Try to use quick decompression. Check TQDecompress array for corresponding item. + // If found, ise the result byte instead. + qd = &qd3474[n7Bits]; + + // If there is a quick-pass possible (ebx) + bHasQdEntry = (qd->offs00 >= offs0004) ? true : false; + + // If we can use quick decompress, use it. + if(bHasQdEntry) + { + if(qd->nBits > 7) + { + is->SkipBits(7); + pItem1 = qd->pItem; + goto _1500E549; + } + is->SkipBits(qd->nBits); + nDcmpByte = qd->dcmpByte; + } + else + { + pItem1 = pFirst->next->prev; + if(PTR_INVALID_OR_NULL(pItem1)) + pItem1 = NULL; +_1500E549: + nBitCount = 0; + pItem2 = NULL; + + do + { + pItem1 = pItem1->child; // Move down by one level + if(is->GetBit()) // If current bit is set, move to previous + pItem1 = pItem1->prev; + + if(++nBitCount == 7) // If we are at 7th bit, save current HTree item. + pItem2 = pItem1; + } + while(pItem1->child != NULL); // Walk until tree has no deeper level + + if(bHasQdEntry == false) + { + if(nBitCount > 7) + { + qd->offs00 = offs0004; + qd->nBits = nBitCount; + qd->pItem = pItem2; + } + else + { + unsigned long nIndex = n7Bits & (0xFFFFFFFF >> (32 - nBitCount)); + unsigned long nAdd = (1 << nBitCount); + + for(qd = &qd3474[nIndex]; nIndex <= 0x7F; nIndex += nAdd, qd += nAdd) + { + qd->offs00 = offs0004; + qd->nBits = nBitCount; + qd->dcmpByte = pItem1->dcmpByte; + } + } + } + nDcmpByte = pItem1->dcmpByte; + } + + if(nDcmpByte == 0x101) // Huffman tree needs to be modified + { + n8Bits = is->Get8Bits(); + pItem1 = (PTR_INVALID_OR_NULL(pLast)) ? NULL : pLast; + + pItem2 = Call1500E740(1); + pItem2->parent = pItem1; + pItem2->dcmpByte = pItem1->dcmpByte; + pItem2->byteValue = pItem1->byteValue; + items306C[pItem2->dcmpByte] = pItem2; + + pItem2 = Call1500E740(1); + pItem2->parent = pItem1; + pItem2->dcmpByte = n8Bits; + pItem2->byteValue = 0; + items306C[pItem2->dcmpByte] = pItem2; + + pItem1->child = pItem2; + Call1500E820(pItem2); + if(bIsCmp0 == 0) + Call1500E820(items306C[n8Bits]); + + nDcmpByte = n8Bits; + } + + if(nDcmpByte == 0x100) + break; + + *pbOutPos++ = (unsigned char)nDcmpByte; + if(--dwOutLength == 0) + break; + + if(bIsCmp0) + Call1500E820(items306C[nDcmpByte]); + } + + return (unsigned int)(pbOutPos - pbOutBuffer); +} + + +// Table for (de)compression. Every compression type has 258 entries +unsigned char THuffmannTree::Table1502A630[] = +{ + // Data for compression type 0x00 + 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, + + // Data for compression type 0x01 + 0x54, 0x16, 0x16, 0x0D, 0x0C, 0x08, 0x06, 0x05, 0x06, 0x05, 0x06, 0x03, 0x04, 0x04, 0x03, 0x05, + 0x0E, 0x0B, 0x14, 0x13, 0x13, 0x09, 0x0B, 0x06, 0x05, 0x04, 0x03, 0x02, 0x03, 0x02, 0x02, 0x02, + 0x0D, 0x07, 0x09, 0x06, 0x06, 0x04, 0x03, 0x02, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, + 0x09, 0x06, 0x04, 0x04, 0x04, 0x04, 0x03, 0x02, 0x03, 0x02, 0x02, 0x02, 0x02, 0x03, 0x02, 0x04, + 0x08, 0x03, 0x04, 0x07, 0x09, 0x05, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, 0x03, 0x02, 0x02, + 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x02, 0x01, 0x02, 0x02, + 0x06, 0x0A, 0x08, 0x08, 0x06, 0x07, 0x04, 0x03, 0x04, 0x04, 0x02, 0x02, 0x04, 0x02, 0x03, 0x03, + 0x04, 0x03, 0x07, 0x07, 0x09, 0x06, 0x04, 0x03, 0x03, 0x02, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x0A, 0x02, 0x02, 0x03, 0x02, 0x02, 0x01, 0x01, 0x02, 0x02, 0x02, 0x06, 0x03, 0x05, 0x02, 0x03, + 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x03, 0x01, 0x01, 0x01, + 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x04, 0x04, 0x04, 0x07, 0x09, 0x08, 0x0C, 0x02, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x03, + 0x04, 0x01, 0x02, 0x04, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, + 0x04, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x01, 0x01, 0x02, 0x02, 0x02, 0x06, 0x4B, + 0x00, 0x00, + + // Data for compression type 0x02 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x27, 0x00, 0x00, 0x23, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x01, 0x01, 0x06, 0x0E, 0x10, 0x04, + 0x06, 0x08, 0x05, 0x04, 0x04, 0x03, 0x03, 0x02, 0x02, 0x03, 0x03, 0x01, 0x01, 0x02, 0x01, 0x01, + 0x01, 0x04, 0x02, 0x04, 0x02, 0x02, 0x02, 0x01, 0x01, 0x04, 0x01, 0x01, 0x02, 0x03, 0x03, 0x02, + 0x03, 0x01, 0x03, 0x06, 0x04, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x01, 0x02, 0x01, 0x01, + 0x01, 0x29, 0x07, 0x16, 0x12, 0x40, 0x0A, 0x0A, 0x11, 0x25, 0x01, 0x03, 0x17, 0x10, 0x26, 0x2A, + 0x10, 0x01, 0x23, 0x23, 0x2F, 0x10, 0x06, 0x07, 0x02, 0x09, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, + + // Data for compression type 0x03 + 0xFF, 0x0B, 0x07, 0x05, 0x0B, 0x02, 0x02, 0x02, 0x06, 0x02, 0x02, 0x01, 0x04, 0x02, 0x01, 0x03, + 0x09, 0x01, 0x01, 0x01, 0x03, 0x04, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, + 0x05, 0x01, 0x01, 0x01, 0x0D, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x02, 0x01, 0x01, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, + 0x0A, 0x04, 0x02, 0x01, 0x06, 0x03, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x03, 0x01, 0x01, 0x01, + 0x05, 0x02, 0x03, 0x04, 0x03, 0x03, 0x03, 0x02, 0x01, 0x01, 0x01, 0x02, 0x01, 0x02, 0x03, 0x03, + 0x01, 0x03, 0x01, 0x01, 0x02, 0x05, 0x01, 0x01, 0x04, 0x03, 0x05, 0x01, 0x03, 0x01, 0x03, 0x03, + 0x02, 0x01, 0x04, 0x03, 0x0A, 0x06, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x02, 0x02, 0x01, 0x0A, 0x02, 0x05, 0x01, 0x01, 0x02, 0x07, 0x02, 0x17, 0x01, 0x05, 0x01, 0x01, + 0x0E, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x06, 0x02, 0x01, 0x04, 0x05, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x07, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, + 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x11, + 0x00, 0x00, + + // Data for compression type 0x04 + 0xFF, 0xFB, 0x98, 0x9A, 0x84, 0x85, 0x63, 0x64, 0x3E, 0x3E, 0x22, 0x22, 0x13, 0x13, 0x18, 0x17, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, + + // Data for compression type 0x05 + 0xFF, 0xF1, 0x9D, 0x9E, 0x9A, 0x9B, 0x9A, 0x97, 0x93, 0x93, 0x8C, 0x8E, 0x86, 0x88, 0x80, 0x82, + 0x7C, 0x7C, 0x72, 0x73, 0x69, 0x6B, 0x5F, 0x60, 0x55, 0x56, 0x4A, 0x4B, 0x40, 0x41, 0x37, 0x37, + 0x2F, 0x2F, 0x27, 0x27, 0x21, 0x21, 0x1B, 0x1C, 0x17, 0x17, 0x13, 0x13, 0x10, 0x10, 0x0D, 0x0D, + 0x0B, 0x0B, 0x09, 0x09, 0x08, 0x08, 0x07, 0x07, 0x06, 0x05, 0x05, 0x04, 0x04, 0x04, 0x19, 0x18, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, + + // Data for compression type 0x06 + 0xC3, 0xCB, 0xF5, 0x41, 0xFF, 0x7B, 0xF7, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xBF, 0xCC, 0xF2, 0x40, 0xFD, 0x7C, 0xF7, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x7A, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, + + // Data for compression type 0x07 + 0xC3, 0xD9, 0xEF, 0x3D, 0xF9, 0x7C, 0xE9, 0x1E, 0xFD, 0xAB, 0xF1, 0x2C, 0xFC, 0x5B, 0xFE, 0x17, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xBD, 0xD9, 0xEC, 0x3D, 0xF5, 0x7D, 0xE8, 0x1D, 0xFB, 0xAE, 0xF0, 0x2C, 0xFB, 0x5C, 0xFF, 0x18, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x70, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, + + // Data for compression type 0x08 + 0xBA, 0xC5, 0xDA, 0x33, 0xE3, 0x6D, 0xD8, 0x18, 0xE5, 0x94, 0xDA, 0x23, 0xDF, 0x4A, 0xD1, 0x10, + 0xEE, 0xAF, 0xE4, 0x2C, 0xEA, 0x5A, 0xDE, 0x15, 0xF4, 0x87, 0xE9, 0x21, 0xF6, 0x43, 0xFC, 0x12, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xB0, 0xC7, 0xD8, 0x33, 0xE3, 0x6B, 0xD6, 0x18, 0xE7, 0x95, 0xD8, 0x23, 0xDB, 0x49, 0xD0, 0x11, + 0xE9, 0xB2, 0xE2, 0x2B, 0xE8, 0x5C, 0xDD, 0x15, 0xF1, 0x87, 0xE7, 0x20, 0xF7, 0x44, 0xFF, 0x13, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x5F, 0x9E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00 +}; diff --git a/dep/StormLib/src/huffman/huff_patch.h b/dep/StormLib/src/huffman/huff_patch.h new file mode 100644 index 00000000000..c1c03e67860 --- /dev/null +++ b/dep/StormLib/src/huffman/huff_patch.h @@ -0,0 +1,145 @@ +/*****************************************************************************/ +/* huffman.h Copyright (c) Ladislav Zezula 2003 */ +/*---------------------------------------------------------------------------*/ +/* Description : */ +/*---------------------------------------------------------------------------*/ +/* Date Ver Who Comment */ +/* -------- ---- --- ------- */ +/* xx.xx.xx 1.00 Lad The first version of huffman.h */ +/* 03.05.03 2.00 Lad Added compression */ +/* 08.12.03 2.01 Dan High-memory handling (> 0x80000000) */ +/*****************************************************************************/ + +#ifndef __HUFFMAN_H__ +#define __HUFFMAN_H__ + +#include + +#define SIntPtr intptr_t + +//----------------------------------------------------------------------------- +// Defines + +#define INSERT_ITEM 1 +#define SWITCH_ITEMS 2 // Switch the item1 and item2 + +#define PTR_NOT(ptr) ((ptr) == gcpFirst ? gpFirst : gpItem3054) +#define PTR_PTR(ptr) ((THTreeItem *)(ptr)) + +#ifndef NULL +#define NULL 0 +#endif + +//----------------------------------------------------------------------------- +// Structures and classes + +// Input stream for Huffmann decompression +class TInputStream +{ + public: + + unsigned long GetBit(); + unsigned long Get7Bits(); + unsigned long Get8Bits(); + void SkipBits(unsigned int BitCount); + + unsigned char * pbInBuffer; // Input data + unsigned char * pbInBufferEnd; // End of the input buffer + unsigned long BitBuffer; // Input bit buffer + unsigned int BitCount; // Number of bits remaining in 'dwBitBuff' +}; + +// Output stream for Huffmann compression +class TOutputStream +{ + public: + + void PutBits(unsigned long dwBuff, unsigned int nPutBits); + + unsigned char * pbOutBuffer; // 00 : Output buffer + unsigned long cbOutSize; // 04 : Size of output buffer + unsigned char * pbOutPos; // 08 : Current output position + unsigned long dwBitBuff; // 0C : Bit buffer + unsigned long nBits; // 10 : Number of bits in the bit buffer +}; + +// Huffmann tree item (?) +struct THTreeItem +{ + public: + + THTreeItem * Call1501DB70(THTreeItem * pLast); + THTreeItem * GetPrevItem(SIntPtr value); + void ClearItemLinks(); + void RemoveItem(); + + THTreeItem * next; // 00 - Pointer to next THTreeItem + THTreeItem * prev; // 04 - Pointer to prev THTreeItem (< 0 if none) + unsigned long dcmpByte; // 08 - Index of this item in item pointer array, decompressed byte value + unsigned long byteValue; // 0C - Some byte value + THTreeItem * parent; // 10 - Pointer to parent THTreeItem (NULL if none) + THTreeItem * child; // 14 - Pointer to child THTreeItem + int addressMultiplier; // -1 if object on negative address (>0x80000000), +1 if positive +}; + +// Structure used for quick decompress. The 'bitCount' contains number of bits +// and byte value contains result decompressed byte value. +// After each walk through Huffman tree are filled all entries which are +// multiplies of number of bits loaded from input stream. These entries +// contain number of bits and result value. At the next 7 bits is tested this +// structure first. If corresponding entry found, decompression routine will +// not walk through Huffman tree and directly stores output byte to output stream. +struct TQDecompress +{ + unsigned long offs00; // 00 - 1 if resolved + unsigned long nBits; // 04 - Bit count + union + { + unsigned long dcmpByte; // 08 - Byte value for decompress (if bitCount <= 7) + THTreeItem * pItem; // 08 - THTreeItem (if number of bits is greater than 7 + }; +}; + +// Structure for Huffman tree (Size 0x3674 bytes). Because I'm not expert +// for the decompression, I do not know actually if the class is really a Hufmann +// tree. If someone knows the decompression details, please let me know +class THuffmannTree +{ + public: + + THuffmannTree(); + void InitTree(bool bCompression); + void BuildTree(unsigned int nCmpType); +// void ModifyTree(unsigned long dwIndex); +// void UninitTree(); + +// void Call15007010(Bit32 dwInLength, THTreeItem * item); + THTreeItem * Call1500E740(unsigned int nValue); + void Call1500E820(THTreeItem * pItem); + unsigned int DoCompression(TOutputStream * os, unsigned char * pbInBuffer, int nInLength, int nCmpType); + unsigned int DoDecompression(unsigned char * pbOutBuffer, unsigned int dwOutLength, TInputStream * is); + + unsigned long bIsCmp0; // 0000 - 1 if compression type 0 + unsigned long offs0004; // 0004 - Some flag + THTreeItem items0008[0x203]; // 0008 - HTree items + + //- Sometimes used as HTree item ----------- + THTreeItem * pItem3050; // 3050 - Always NULL (?) + THTreeItem * pItem3054; // 3054 - Pointer to Huffman tree item + THTreeItem * pItem3058; // 3058 - Pointer to Huffman tree item (< 0 if invalid) + + //- Sometimes used as HTree item ----------- + THTreeItem * pItem305C; // 305C - Usually NULL + THTreeItem * pFirst; // 3060 - Pointer to top (first) Huffman tree item + THTreeItem * pLast; // 3064 - Pointer to bottom (last) Huffman tree item (< 0 if invalid) + unsigned long nItems; // 3068 - Number of used HTree items + + //------------------------------------------- + THTreeItem * items306C[0x102]; // 306C - THTreeItem pointer array + TQDecompress qd3474[0x80]; // 3474 - Array for quick decompression + int addressMultiplier; // -1 if object on negative address (>0x80000000), +1 if positive + + static unsigned char Table1502A630[];// Some table +}; + +#endif // __HUFFMAN_H__ diff --git a/dep/StormLib/src/jenkins/lookup.h b/dep/StormLib/src/jenkins/lookup.h new file mode 100644 index 00000000000..54ccc979ca6 --- /dev/null +++ b/dep/StormLib/src/jenkins/lookup.h @@ -0,0 +1,24 @@ +#ifndef __LOOKUP3_H__ +#define __LOOKUP3_H__ + +#ifdef WIN32 +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +#else +#include /* defines uint32_t etc */ +#endif + +#ifdef __cplusplus +extern "C" +{ +#endif + +uint32_t hashlittle(const void *key, size_t length, uint32_t initval); +void hashlittle2(const void *key, size_t length, uint32_t *pc, uint32_t *pb); + +#ifdef __cplusplus +} +#endif + +#endif // __LOOKUP3_H__ diff --git a/dep/StormLib/src/jenkins/lookup3.c b/dep/StormLib/src/jenkins/lookup3.c new file mode 100644 index 00000000000..6af56b481ad --- /dev/null +++ b/dep/StormLib/src/jenkins/lookup3.c @@ -0,0 +1,1003 @@ +/* +------------------------------------------------------------------------------- +lookup3.c, by Bob Jenkins, May 2006, Public Domain. + +These are functions for producing 32-bit hashes for hash table lookup. +hashword(), hashlittle(), hashlittle2(), hashbig(), mix(), and final() +are externally useful functions. Routines to test the hash are included +if SELF_TEST is defined. You can use this free for any purpose. It's in +the public domain. It has no warranty. + +You probably want to use hashlittle(). hashlittle() and hashbig() +hash byte arrays. hashlittle() is is faster than hashbig() on +little-endian machines. Intel and AMD are little-endian machines. +On second thought, you probably want hashlittle2(), which is identical to +hashlittle() except it returns two 32-bit hashes for the price of one. +You could implement hashbig2() if you wanted but I haven't bothered here. + +If you want to find a hash of, say, exactly 7 integers, do + a = i1; b = i2; c = i3; + mix(a,b,c); + a += i4; b += i5; c += i6; + mix(a,b,c); + a += i7; + final(a,b,c); +then use c as the hash value. If you have a variable length array of +4-byte integers to hash, use hashword(). If you have a byte array (like +a character string), use hashlittle(). If you have several byte arrays, or +a mix of things, see the comments above hashlittle(). + +Why is this so big? I read 12 bytes at a time into 3 4-byte integers, +then mix those integers. This is fast (you can do a lot more thorough +mixing with 12*3 instructions on 3 integers than you can with 3 instructions +on 1 byte), but shoehorning those bytes into integers efficiently is messy. +------------------------------------------------------------------------------- +*/ +//#define SELF_TEST 1 + +#include /* defines printf for tests */ +#include /* defines time_t for timings in the test */ + +#ifdef linux +#include /* attempt to define endianness */ +#include /* attempt to define endianness */ +#endif + +#include "lookup.h" + +/* + * My best guess at if you are big-endian or little-endian. This may + * need adjustment. + */ +#if (defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && \ + __BYTE_ORDER == __LITTLE_ENDIAN) || \ + (defined(i386) || defined(__i386__) || defined(__i486__) || \ + defined(__i586__) || defined(__i686__) || defined(vax) || defined(MIPSEL)) +# define HASH_LITTLE_ENDIAN 1 +# define HASH_BIG_ENDIAN 0 +#elif (defined(__BYTE_ORDER) && defined(__BIG_ENDIAN) && \ + __BYTE_ORDER == __BIG_ENDIAN) || \ + (defined(sparc) || defined(POWERPC) || defined(mc68000) || defined(sel)) +# define HASH_LITTLE_ENDIAN 0 +# define HASH_BIG_ENDIAN 1 +#else +# define HASH_LITTLE_ENDIAN 0 +# define HASH_BIG_ENDIAN 0 +#endif + +#define hashsize(n) ((uint32_t)1<<(n)) +#define hashmask(n) (hashsize(n)-1) +#define rot(x,k) (((x)<<(k)) | ((x)>>(32-(k)))) + +/* +------------------------------------------------------------------------------- +mix -- mix 3 32-bit values reversibly. + +This is reversible, so any information in (a,b,c) before mix() is +still in (a,b,c) after mix(). + +If four pairs of (a,b,c) inputs are run through mix(), or through +mix() in reverse, there are at least 32 bits of the output that +are sometimes the same for one pair and different for another pair. +This was tested for: +* pairs that differed by one bit, by two bits, in any combination + of top bits of (a,b,c), or in any combination of bottom bits of + (a,b,c). +* "differ" is defined as +, -, ^, or ~^. For + and -, I transformed + the output delta to a Gray code (a^(a>>1)) so a string of 1's (as + is commonly produced by subtraction) look like a single 1-bit + difference. +* the base values were pseudorandom, all zero but one bit set, or + all zero plus a counter that starts at zero. + +Some k values for my "a-=c; a^=rot(c,k); c+=b;" arrangement that +satisfy this are + 4 6 8 16 19 4 + 9 15 3 18 27 15 + 14 9 3 7 17 3 +Well, "9 15 3 18 27 15" didn't quite get 32 bits diffing +for "differ" defined as + with a one-bit base and a two-bit delta. I +used http://burtleburtle.net/bob/hash/avalanche.html to choose +the operations, constants, and arrangements of the variables. + +This does not achieve avalanche. There are input bits of (a,b,c) +that fail to affect some output bits of (a,b,c), especially of a. The +most thoroughly mixed value is c, but it doesn't really even achieve +avalanche in c. + +This allows some parallelism. Read-after-writes are good at doubling +the number of bits affected, so the goal of mixing pulls in the opposite +direction as the goal of parallelism. I did what I could. Rotates +seem to cost as much as shifts on every machine I could lay my hands +on, and rotates are much kinder to the top and bottom bits, so I used +rotates. +------------------------------------------------------------------------------- +*/ +#define mix(a,b,c) \ +{ \ + a -= c; a ^= rot(c, 4); c += b; \ + b -= a; b ^= rot(a, 6); a += c; \ + c -= b; c ^= rot(b, 8); b += a; \ + a -= c; a ^= rot(c,16); c += b; \ + b -= a; b ^= rot(a,19); a += c; \ + c -= b; c ^= rot(b, 4); b += a; \ +} + +/* +------------------------------------------------------------------------------- +final -- final mixing of 3 32-bit values (a,b,c) into c + +Pairs of (a,b,c) values differing in only a few bits will usually +produce values of c that look totally different. This was tested for +* pairs that differed by one bit, by two bits, in any combination + of top bits of (a,b,c), or in any combination of bottom bits of + (a,b,c). +* "differ" is defined as +, -, ^, or ~^. For + and -, I transformed + the output delta to a Gray code (a^(a>>1)) so a string of 1's (as + is commonly produced by subtraction) look like a single 1-bit + difference. +* the base values were pseudorandom, all zero but one bit set, or + all zero plus a counter that starts at zero. + +These constants passed: + 14 11 25 16 4 14 24 + 12 14 25 16 4 14 24 +and these came close: + 4 8 15 26 3 22 24 + 10 8 15 26 3 22 24 + 11 8 15 26 3 22 24 +------------------------------------------------------------------------------- +*/ +#define final(a,b,c) \ +{ \ + c ^= b; c -= rot(b,14); \ + a ^= c; a -= rot(c,11); \ + b ^= a; b -= rot(a,25); \ + c ^= b; c -= rot(b,16); \ + a ^= c; a -= rot(c,4); \ + b ^= a; b -= rot(a,14); \ + c ^= b; c -= rot(b,24); \ +} + +/* +-------------------------------------------------------------------- + This works on all machines. To be useful, it requires + -- that the key be an array of uint32_t's, and + -- that the length be the number of uint32_t's in the key + + The function hashword() is identical to hashlittle() on little-endian + machines, and identical to hashbig() on big-endian machines, + except that the length has to be measured in uint32_ts rather than in + bytes. hashlittle() is more complicated than hashword() only because + hashlittle() has to dance around fitting the key bytes into registers. +-------------------------------------------------------------------- +*/ +uint32_t hashword( +const uint32_t *k, /* the key, an array of uint32_t values */ +size_t length, /* the length of the key, in uint32_ts */ +uint32_t initval) /* the previous hash, or an arbitrary value */ +{ + uint32_t a,b,c; + + /* Set up the internal state */ + a = b = c = 0xdeadbeef + (((uint32_t)length)<<2) + initval; + + /*------------------------------------------------- handle most of the key */ + while (length > 3) + { + a += k[0]; + b += k[1]; + c += k[2]; + mix(a,b,c); + length -= 3; + k += 3; + } + + /*------------------------------------------- handle the last 3 uint32_t's */ + switch(length) /* all the case statements fall through */ + { + case 3 : c+=k[2]; + case 2 : b+=k[1]; + case 1 : a+=k[0]; + final(a,b,c); + case 0: /* case 0: nothing left to add */ + break; + } + /*------------------------------------------------------ report the result */ + return c; +} + + +/* +-------------------------------------------------------------------- +hashword2() -- same as hashword(), but take two seeds and return two +32-bit values. pc and pb must both be nonnull, and *pc and *pb must +both be initialized with seeds. If you pass in (*pb)==0, the output +(*pc) will be the same as the return value from hashword(). +-------------------------------------------------------------------- +*/ +void hashword2 ( +const uint32_t *k, /* the key, an array of uint32_t values */ +size_t length, /* the length of the key, in uint32_ts */ +uint32_t *pc, /* IN: seed OUT: primary hash value */ +uint32_t *pb) /* IN: more seed OUT: secondary hash value */ +{ + uint32_t a,b,c; + + /* Set up the internal state */ + a = b = c = 0xdeadbeef + ((uint32_t)(length<<2)) + *pc; + c += *pb; + + /*------------------------------------------------- handle most of the key */ + while (length > 3) + { + a += k[0]; + b += k[1]; + c += k[2]; + mix(a,b,c); + length -= 3; + k += 3; + } + + /*------------------------------------------- handle the last 3 uint32_t's */ + switch(length) /* all the case statements fall through */ + { + case 3 : c+=k[2]; + case 2 : b+=k[1]; + case 1 : a+=k[0]; + final(a,b,c); + case 0: /* case 0: nothing left to add */ + break; + } + /*------------------------------------------------------ report the result */ + *pc=c; *pb=b; +} + + +/* +------------------------------------------------------------------------------- +hashlittle() -- hash a variable-length key into a 32-bit value + k : the key (the unaligned variable-length array of bytes) + length : the length of the key, counting by bytes + initval : can be any 4-byte value +Returns a 32-bit value. Every bit of the key affects every bit of +the return value. Two keys differing by one or two bits will have +totally different hash values. + +The best hash table sizes are powers of 2. There is no need to do +mod a prime (mod is sooo slow!). If you need less than 32 bits, +use a bitmask. For example, if you need only 10 bits, do + h = (h & hashmask(10)); +In which case, the hash table should have hashsize(10) elements. + +If you are hashing n strings (uint8_t **)k, do it like this: + for (i=0, h=0; i 12) + { + a += k[0]; + b += k[1]; + c += k[2]; + mix(a,b,c); + length -= 12; + k += 3; + } + + /*----------------------------- handle the last (probably partial) block */ + /* + * "k[2]&0xffffff" actually reads beyond the end of the string, but + * then masks off the part it's not allowed to read. Because the + * string is aligned, the masked-off tail is in the same word as the + * rest of the string. Every machine with memory protection I've seen + * does it on word boundaries, so is OK with this. But VALGRIND will + * still catch it and complain. The masking trick does make the hash + * noticably faster for short strings (like English words). + */ +#ifndef VALGRIND + + switch(length) + { + case 12: c+=k[2]; b+=k[1]; a+=k[0]; break; + case 11: c+=k[2]&0xffffff; b+=k[1]; a+=k[0]; break; + case 10: c+=k[2]&0xffff; b+=k[1]; a+=k[0]; break; + case 9 : c+=k[2]&0xff; b+=k[1]; a+=k[0]; break; + case 8 : b+=k[1]; a+=k[0]; break; + case 7 : b+=k[1]&0xffffff; a+=k[0]; break; + case 6 : b+=k[1]&0xffff; a+=k[0]; break; + case 5 : b+=k[1]&0xff; a+=k[0]; break; + case 4 : a+=k[0]; break; + case 3 : a+=k[0]&0xffffff; break; + case 2 : a+=k[0]&0xffff; break; + case 1 : a+=k[0]&0xff; break; + case 0 : return c; /* zero length strings require no mixing */ + } + +#else /* make valgrind happy */ + + k8 = (const uint8_t *)k; + switch(length) + { + case 12: c+=k[2]; b+=k[1]; a+=k[0]; break; + case 11: c+=((uint32_t)k8[10])<<16; /* fall through */ + case 10: c+=((uint32_t)k8[9])<<8; /* fall through */ + case 9 : c+=k8[8]; /* fall through */ + case 8 : b+=k[1]; a+=k[0]; break; + case 7 : b+=((uint32_t)k8[6])<<16; /* fall through */ + case 6 : b+=((uint32_t)k8[5])<<8; /* fall through */ + case 5 : b+=k8[4]; /* fall through */ + case 4 : a+=k[0]; break; + case 3 : a+=((uint32_t)k8[2])<<16; /* fall through */ + case 2 : a+=((uint32_t)k8[1])<<8; /* fall through */ + case 1 : a+=k8[0]; break; + case 0 : return c; + } + +#endif /* !valgrind */ + + } else if (HASH_LITTLE_ENDIAN && ((u.i & 0x1) == 0)) { + const uint16_t *k = (const uint16_t *)key; /* read 16-bit chunks */ + const uint8_t *k8; + + /*--------------- all but last block: aligned reads and different mixing */ + while (length > 12) + { + a += k[0] + (((uint32_t)k[1])<<16); + b += k[2] + (((uint32_t)k[3])<<16); + c += k[4] + (((uint32_t)k[5])<<16); + mix(a,b,c); + length -= 12; + k += 6; + } + + /*----------------------------- handle the last (probably partial) block */ + k8 = (const uint8_t *)k; + switch(length) + { + case 12: c+=k[4]+(((uint32_t)k[5])<<16); + b+=k[2]+(((uint32_t)k[3])<<16); + a+=k[0]+(((uint32_t)k[1])<<16); + break; + case 11: c+=((uint32_t)k8[10])<<16; /* fall through */ + case 10: c+=k[4]; + b+=k[2]+(((uint32_t)k[3])<<16); + a+=k[0]+(((uint32_t)k[1])<<16); + break; + case 9 : c+=k8[8]; /* fall through */ + case 8 : b+=k[2]+(((uint32_t)k[3])<<16); + a+=k[0]+(((uint32_t)k[1])<<16); + break; + case 7 : b+=((uint32_t)k8[6])<<16; /* fall through */ + case 6 : b+=k[2]; + a+=k[0]+(((uint32_t)k[1])<<16); + break; + case 5 : b+=k8[4]; /* fall through */ + case 4 : a+=k[0]+(((uint32_t)k[1])<<16); + break; + case 3 : a+=((uint32_t)k8[2])<<16; /* fall through */ + case 2 : a+=k[0]; + break; + case 1 : a+=k8[0]; + break; + case 0 : return c; /* zero length requires no mixing */ + } + + } else { /* need to read the key one byte at a time */ + const uint8_t *k = (const uint8_t *)key; + + /*--------------- all but the last block: affect some 32 bits of (a,b,c) */ + while (length > 12) + { + a += k[0]; + a += ((uint32_t)k[1])<<8; + a += ((uint32_t)k[2])<<16; + a += ((uint32_t)k[3])<<24; + b += k[4]; + b += ((uint32_t)k[5])<<8; + b += ((uint32_t)k[6])<<16; + b += ((uint32_t)k[7])<<24; + c += k[8]; + c += ((uint32_t)k[9])<<8; + c += ((uint32_t)k[10])<<16; + c += ((uint32_t)k[11])<<24; + mix(a,b,c); + length -= 12; + k += 12; + } + + /*-------------------------------- last block: affect all 32 bits of (c) */ + switch(length) /* all the case statements fall through */ + { + case 12: c+=((uint32_t)k[11])<<24; + case 11: c+=((uint32_t)k[10])<<16; + case 10: c+=((uint32_t)k[9])<<8; + case 9 : c+=k[8]; + case 8 : b+=((uint32_t)k[7])<<24; + case 7 : b+=((uint32_t)k[6])<<16; + case 6 : b+=((uint32_t)k[5])<<8; + case 5 : b+=k[4]; + case 4 : a+=((uint32_t)k[3])<<24; + case 3 : a+=((uint32_t)k[2])<<16; + case 2 : a+=((uint32_t)k[1])<<8; + case 1 : a+=k[0]; + break; + case 0 : return c; + } + } + + final(a,b,c); + return c; +} + + +/* + * hashlittle2: return 2 32-bit hash values + * + * This is identical to hashlittle(), except it returns two 32-bit hash + * values instead of just one. This is good enough for hash table + * lookup with 2^^64 buckets, or if you want a second hash if you're not + * happy with the first, or if you want a probably-unique 64-bit ID for + * the key. *pc is better mixed than *pb, so use *pc first. If you want + * a 64-bit value do something like "*pc + (((uint64_t)*pb)<<32)". + */ +void hashlittle2( + const void *key, /* the key to hash */ + size_t length, /* length of the key */ + uint32_t *pc, /* IN: primary initval, OUT: primary hash */ + uint32_t *pb) /* IN: secondary initval, OUT: secondary hash */ +{ + uint32_t a,b,c; /* internal state */ + union { const void *ptr; size_t i; } u; /* needed for Mac Powerbook G4 */ + + /* Set up the internal state */ + a = b = c = 0xdeadbeef + ((uint32_t)length) + *pc; + c += *pb; + + u.ptr = key; + if (HASH_LITTLE_ENDIAN && ((u.i & 0x3) == 0)) { + const uint32_t *k = (const uint32_t *)key; /* read 32-bit chunks */ + const uint8_t *k8; + + /*------ all but last block: aligned reads and affect 32 bits of (a,b,c) */ + while (length > 12) + { + a += k[0]; + b += k[1]; + c += k[2]; + mix(a,b,c); + length -= 12; + k += 3; + } + + /*----------------------------- handle the last (probably partial) block */ + /* + * "k[2]&0xffffff" actually reads beyond the end of the string, but + * then masks off the part it's not allowed to read. Because the + * string is aligned, the masked-off tail is in the same word as the + * rest of the string. Every machine with memory protection I've seen + * does it on word boundaries, so is OK with this. But VALGRIND will + * still catch it and complain. The masking trick does make the hash + * noticably faster for short strings (like English words). + */ +#ifndef VALGRIND + + switch(length) + { + case 12: c+=k[2]; b+=k[1]; a+=k[0]; break; + case 11: c+=k[2]&0xffffff; b+=k[1]; a+=k[0]; break; + case 10: c+=k[2]&0xffff; b+=k[1]; a+=k[0]; break; + case 9 : c+=k[2]&0xff; b+=k[1]; a+=k[0]; break; + case 8 : b+=k[1]; a+=k[0]; break; + case 7 : b+=k[1]&0xffffff; a+=k[0]; break; + case 6 : b+=k[1]&0xffff; a+=k[0]; break; + case 5 : b+=k[1]&0xff; a+=k[0]; break; + case 4 : a+=k[0]; break; + case 3 : a+=k[0]&0xffffff; break; + case 2 : a+=k[0]&0xffff; break; + case 1 : a+=k[0]&0xff; break; + case 0 : *pc=c; *pb=b; return; /* zero length strings require no mixing */ + } + +#else /* make valgrind happy */ + + k8 = (const uint8_t *)k; + switch(length) + { + case 12: c+=k[2]; b+=k[1]; a+=k[0]; break; + case 11: c+=((uint32_t)k8[10])<<16; /* fall through */ + case 10: c+=((uint32_t)k8[9])<<8; /* fall through */ + case 9 : c+=k8[8]; /* fall through */ + case 8 : b+=k[1]; a+=k[0]; break; + case 7 : b+=((uint32_t)k8[6])<<16; /* fall through */ + case 6 : b+=((uint32_t)k8[5])<<8; /* fall through */ + case 5 : b+=k8[4]; /* fall through */ + case 4 : a+=k[0]; break; + case 3 : a+=((uint32_t)k8[2])<<16; /* fall through */ + case 2 : a+=((uint32_t)k8[1])<<8; /* fall through */ + case 1 : a+=k8[0]; break; + case 0 : *pc=c; *pb=b; return; /* zero length strings require no mixing */ + } + +#endif /* !valgrind */ + + } else if (HASH_LITTLE_ENDIAN && ((u.i & 0x1) == 0)) { + const uint16_t *k = (const uint16_t *)key; /* read 16-bit chunks */ + const uint8_t *k8; + + /*--------------- all but last block: aligned reads and different mixing */ + while (length > 12) + { + a += k[0] + (((uint32_t)k[1])<<16); + b += k[2] + (((uint32_t)k[3])<<16); + c += k[4] + (((uint32_t)k[5])<<16); + mix(a,b,c); + length -= 12; + k += 6; + } + + /*----------------------------- handle the last (probably partial) block */ + k8 = (const uint8_t *)k; + switch(length) + { + case 12: c+=k[4]+(((uint32_t)k[5])<<16); + b+=k[2]+(((uint32_t)k[3])<<16); + a+=k[0]+(((uint32_t)k[1])<<16); + break; + case 11: c+=((uint32_t)k8[10])<<16; /* fall through */ + case 10: c+=k[4]; + b+=k[2]+(((uint32_t)k[3])<<16); + a+=k[0]+(((uint32_t)k[1])<<16); + break; + case 9 : c+=k8[8]; /* fall through */ + case 8 : b+=k[2]+(((uint32_t)k[3])<<16); + a+=k[0]+(((uint32_t)k[1])<<16); + break; + case 7 : b+=((uint32_t)k8[6])<<16; /* fall through */ + case 6 : b+=k[2]; + a+=k[0]+(((uint32_t)k[1])<<16); + break; + case 5 : b+=k8[4]; /* fall through */ + case 4 : a+=k[0]+(((uint32_t)k[1])<<16); + break; + case 3 : a+=((uint32_t)k8[2])<<16; /* fall through */ + case 2 : a+=k[0]; + break; + case 1 : a+=k8[0]; + break; + case 0 : *pc=c; *pb=b; return; /* zero length strings require no mixing */ + } + + } else { /* need to read the key one byte at a time */ + const uint8_t *k = (const uint8_t *)key; + + /*--------------- all but the last block: affect some 32 bits of (a,b,c) */ + while (length > 12) + { + a += k[0]; + a += ((uint32_t)k[1])<<8; + a += ((uint32_t)k[2])<<16; + a += ((uint32_t)k[3])<<24; + b += k[4]; + b += ((uint32_t)k[5])<<8; + b += ((uint32_t)k[6])<<16; + b += ((uint32_t)k[7])<<24; + c += k[8]; + c += ((uint32_t)k[9])<<8; + c += ((uint32_t)k[10])<<16; + c += ((uint32_t)k[11])<<24; + mix(a,b,c); + length -= 12; + k += 12; + } + + /*-------------------------------- last block: affect all 32 bits of (c) */ + switch(length) /* all the case statements fall through */ + { + case 12: c+=((uint32_t)k[11])<<24; + case 11: c+=((uint32_t)k[10])<<16; + case 10: c+=((uint32_t)k[9])<<8; + case 9 : c+=k[8]; + case 8 : b+=((uint32_t)k[7])<<24; + case 7 : b+=((uint32_t)k[6])<<16; + case 6 : b+=((uint32_t)k[5])<<8; + case 5 : b+=k[4]; + case 4 : a+=((uint32_t)k[3])<<24; + case 3 : a+=((uint32_t)k[2])<<16; + case 2 : a+=((uint32_t)k[1])<<8; + case 1 : a+=k[0]; + break; + case 0 : *pc=c; *pb=b; return; /* zero length strings require no mixing */ + } + } + + final(a,b,c); + *pc=c; *pb=b; +} + + + +/* + * hashbig(): + * This is the same as hashword() on big-endian machines. It is different + * from hashlittle() on all machines. hashbig() takes advantage of + * big-endian byte ordering. + */ +uint32_t hashbig( const void *key, size_t length, uint32_t initval) +{ + uint32_t a,b,c; + union { const void *ptr; size_t i; } u; /* to cast key to (size_t) happily */ + + /* Set up the internal state */ + a = b = c = 0xdeadbeef + ((uint32_t)length) + initval; + + u.ptr = key; + if (HASH_BIG_ENDIAN && ((u.i & 0x3) == 0)) { + const uint32_t *k = (const uint32_t *)key; /* read 32-bit chunks */ + const uint8_t *k8; + + /*------ all but last block: aligned reads and affect 32 bits of (a,b,c) */ + while (length > 12) + { + a += k[0]; + b += k[1]; + c += k[2]; + mix(a,b,c); + length -= 12; + k += 3; + } + + /*----------------------------- handle the last (probably partial) block */ + /* + * "k[2]<<8" actually reads beyond the end of the string, but + * then shifts out the part it's not allowed to read. Because the + * string is aligned, the illegal read is in the same word as the + * rest of the string. Every machine with memory protection I've seen + * does it on word boundaries, so is OK with this. But VALGRIND will + * still catch it and complain. The masking trick does make the hash + * noticably faster for short strings (like English words). + */ +#ifndef VALGRIND + + switch(length) + { + case 12: c+=k[2]; b+=k[1]; a+=k[0]; break; + case 11: c+=k[2]&0xffffff00; b+=k[1]; a+=k[0]; break; + case 10: c+=k[2]&0xffff0000; b+=k[1]; a+=k[0]; break; + case 9 : c+=k[2]&0xff000000; b+=k[1]; a+=k[0]; break; + case 8 : b+=k[1]; a+=k[0]; break; + case 7 : b+=k[1]&0xffffff00; a+=k[0]; break; + case 6 : b+=k[1]&0xffff0000; a+=k[0]; break; + case 5 : b+=k[1]&0xff000000; a+=k[0]; break; + case 4 : a+=k[0]; break; + case 3 : a+=k[0]&0xffffff00; break; + case 2 : a+=k[0]&0xffff0000; break; + case 1 : a+=k[0]&0xff000000; break; + case 0 : return c; /* zero length strings require no mixing */ + } + +#else /* make valgrind happy */ + + k8 = (const uint8_t *)k; + switch(length) /* all the case statements fall through */ + { + case 12: c+=k[2]; b+=k[1]; a+=k[0]; break; + case 11: c+=((uint32_t)k8[10])<<8; /* fall through */ + case 10: c+=((uint32_t)k8[9])<<16; /* fall through */ + case 9 : c+=((uint32_t)k8[8])<<24; /* fall through */ + case 8 : b+=k[1]; a+=k[0]; break; + case 7 : b+=((uint32_t)k8[6])<<8; /* fall through */ + case 6 : b+=((uint32_t)k8[5])<<16; /* fall through */ + case 5 : b+=((uint32_t)k8[4])<<24; /* fall through */ + case 4 : a+=k[0]; break; + case 3 : a+=((uint32_t)k8[2])<<8; /* fall through */ + case 2 : a+=((uint32_t)k8[1])<<16; /* fall through */ + case 1 : a+=((uint32_t)k8[0])<<24; break; + case 0 : return c; + } + +#endif /* !VALGRIND */ + + } else { /* need to read the key one byte at a time */ + const uint8_t *k = (const uint8_t *)key; + + /*--------------- all but the last block: affect some 32 bits of (a,b,c) */ + while (length > 12) + { + a += ((uint32_t)k[0])<<24; + a += ((uint32_t)k[1])<<16; + a += ((uint32_t)k[2])<<8; + a += ((uint32_t)k[3]); + b += ((uint32_t)k[4])<<24; + b += ((uint32_t)k[5])<<16; + b += ((uint32_t)k[6])<<8; + b += ((uint32_t)k[7]); + c += ((uint32_t)k[8])<<24; + c += ((uint32_t)k[9])<<16; + c += ((uint32_t)k[10])<<8; + c += ((uint32_t)k[11]); + mix(a,b,c); + length -= 12; + k += 12; + } + + /*-------------------------------- last block: affect all 32 bits of (c) */ + switch(length) /* all the case statements fall through */ + { + case 12: c+=k[11]; + case 11: c+=((uint32_t)k[10])<<8; + case 10: c+=((uint32_t)k[9])<<16; + case 9 : c+=((uint32_t)k[8])<<24; + case 8 : b+=k[7]; + case 7 : b+=((uint32_t)k[6])<<8; + case 6 : b+=((uint32_t)k[5])<<16; + case 5 : b+=((uint32_t)k[4])<<24; + case 4 : a+=k[3]; + case 3 : a+=((uint32_t)k[2])<<8; + case 2 : a+=((uint32_t)k[1])<<16; + case 1 : a+=((uint32_t)k[0])<<24; + break; + case 0 : return c; + } + } + + final(a,b,c); + return c; +} + + +#ifdef SELF_TEST + +/* used for timings */ +void driver1() +{ + uint8_t buf[256]; + uint32_t i; + uint32_t h=0; + time_t a,z; + + time(&a); + for (i=0; i<256; ++i) buf[i] = 'x'; + for (i=0; i<1; ++i) + { + h = hashlittle(&buf[0],1,h); + } + time(&z); + if (z-a > 0) printf("time %d %.8x\n", z-a, h); +} + +/* check that every input bit changes every output bit half the time */ +#define HASHSTATE 1 +#define HASHLEN 1 +#define MAXPAIR 60 +#define MAXLEN 70 +void driver2() +{ + uint8_t qa[MAXLEN+1], qb[MAXLEN+2], *a = &qa[0], *b = &qb[1]; + uint32_t c[HASHSTATE], d[HASHSTATE], i=0, j=0, k, l, m=0, z; + uint32_t e[HASHSTATE],f[HASHSTATE],g[HASHSTATE],h[HASHSTATE]; + uint32_t x[HASHSTATE],y[HASHSTATE]; + uint32_t hlen; + + printf("No more than %d trials should ever be needed \n",MAXPAIR/2); + for (hlen=0; hlen < MAXLEN; ++hlen) + { + z=0; + for (i=0; i>(8-j)); + c[0] = hashlittle(a, hlen, m); + b[i] ^= ((k+1)<>(8-j)); + d[0] = hashlittle(b, hlen, m); + /* check every bit is 1, 0, set, and not set at least once */ + for (l=0; lz) z=k; + if (k==MAXPAIR) + { + printf("Some bit didn't change: "); + printf("%.8x %.8x %.8x %.8x %.8x %.8x ", + e[0],f[0],g[0],h[0],x[0],y[0]); + printf("i %d j %d m %d len %d\n", i, j, m, hlen); + } + if (z==MAXPAIR) goto done; + } + } + } + done: + if (z < MAXPAIR) + { + printf("Mix success %2d bytes %2d initvals ",i,m); + printf("required %d trials\n", z/2); + } + } + printf("\n"); +} + +/* Check for reading beyond the end of the buffer and alignment problems */ +void driver3() +{ + uint8_t buf[MAXLEN+20], *b; + uint32_t len; + uint8_t q[] = "This is the time for all good men to come to the aid of their country..."; + uint32_t h; + uint8_t qq[] = "xThis is the time for all good men to come to the aid of their country..."; + uint32_t i; + uint8_t qqq[] = "xxThis is the time for all good men to come to the aid of their country..."; + uint32_t j; + uint8_t qqqq[] = "xxxThis is the time for all good men to come to the aid of their country..."; + uint32_t ref,x,y; + uint8_t *p; + + printf("Endianness. These lines should all be the same (for values filled in):\n"); + printf("%.8x %.8x %.8x\n", + hashword((const uint32_t *)q, (sizeof(q)-1)/4, 13), + hashword((const uint32_t *)q, (sizeof(q)-5)/4, 13), + hashword((const uint32_t *)q, (sizeof(q)-9)/4, 13)); + p = q; + printf("%.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x\n", + hashlittle(p, sizeof(q)-1, 13), hashlittle(p, sizeof(q)-2, 13), + hashlittle(p, sizeof(q)-3, 13), hashlittle(p, sizeof(q)-4, 13), + hashlittle(p, sizeof(q)-5, 13), hashlittle(p, sizeof(q)-6, 13), + hashlittle(p, sizeof(q)-7, 13), hashlittle(p, sizeof(q)-8, 13), + hashlittle(p, sizeof(q)-9, 13), hashlittle(p, sizeof(q)-10, 13), + hashlittle(p, sizeof(q)-11, 13), hashlittle(p, sizeof(q)-12, 13)); + p = &qq[1]; + printf("%.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x\n", + hashlittle(p, sizeof(q)-1, 13), hashlittle(p, sizeof(q)-2, 13), + hashlittle(p, sizeof(q)-3, 13), hashlittle(p, sizeof(q)-4, 13), + hashlittle(p, sizeof(q)-5, 13), hashlittle(p, sizeof(q)-6, 13), + hashlittle(p, sizeof(q)-7, 13), hashlittle(p, sizeof(q)-8, 13), + hashlittle(p, sizeof(q)-9, 13), hashlittle(p, sizeof(q)-10, 13), + hashlittle(p, sizeof(q)-11, 13), hashlittle(p, sizeof(q)-12, 13)); + p = &qqq[2]; + printf("%.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x\n", + hashlittle(p, sizeof(q)-1, 13), hashlittle(p, sizeof(q)-2, 13), + hashlittle(p, sizeof(q)-3, 13), hashlittle(p, sizeof(q)-4, 13), + hashlittle(p, sizeof(q)-5, 13), hashlittle(p, sizeof(q)-6, 13), + hashlittle(p, sizeof(q)-7, 13), hashlittle(p, sizeof(q)-8, 13), + hashlittle(p, sizeof(q)-9, 13), hashlittle(p, sizeof(q)-10, 13), + hashlittle(p, sizeof(q)-11, 13), hashlittle(p, sizeof(q)-12, 13)); + p = &qqqq[3]; + printf("%.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x %.8x\n", + hashlittle(p, sizeof(q)-1, 13), hashlittle(p, sizeof(q)-2, 13), + hashlittle(p, sizeof(q)-3, 13), hashlittle(p, sizeof(q)-4, 13), + hashlittle(p, sizeof(q)-5, 13), hashlittle(p, sizeof(q)-6, 13), + hashlittle(p, sizeof(q)-7, 13), hashlittle(p, sizeof(q)-8, 13), + hashlittle(p, sizeof(q)-9, 13), hashlittle(p, sizeof(q)-10, 13), + hashlittle(p, sizeof(q)-11, 13), hashlittle(p, sizeof(q)-12, 13)); + printf("\n"); + + /* check that hashlittle2 and hashlittle produce the same results */ + i=47; j=0; + hashlittle2(q, sizeof(q), &i, &j); + if (hashlittle(q, sizeof(q), 47) != i) + printf("hashlittle2 and hashlittle mismatch\n"); + + /* check that hashword2 and hashword produce the same results */ + len = 0xdeadbeef; + i=47, j=0; + hashword2(&len, 1, &i, &j); + if (hashword(&len, 1, 47) != i) + printf("hashword2 and hashword mismatch %x %x\n", + i, hashword(&len, 1, 47)); + + /* check hashlittle doesn't read before or after the ends of the string */ + for (h=0, b=buf+1; h<8; ++h, ++b) + { + for (i=0; imd5.state[0]; + b = md->md5.state[1]; + c = md->md5.state[2]; + d = md->md5.state[3]; + +#ifdef LTC_SMALL_CODE + for (i = 0; i < 16; ++i) { + FF(a,b,c,d,W[Worder[i]],Rorder[i],Korder[i]); + t = d; d = c; c = b; b = a; a = t; + } + + for (; i < 32; ++i) { + GG(a,b,c,d,W[Worder[i]],Rorder[i],Korder[i]); + t = d; d = c; c = b; b = a; a = t; + } + + for (; i < 48; ++i) { + HH(a,b,c,d,W[Worder[i]],Rorder[i],Korder[i]); + t = d; d = c; c = b; b = a; a = t; + } + + for (; i < 64; ++i) { + II(a,b,c,d,W[Worder[i]],Rorder[i],Korder[i]); + t = d; d = c; c = b; b = a; a = t; + } + +#else + FF(a,b,c,d,W[0],7,0xd76aa478UL) + FF(d,a,b,c,W[1],12,0xe8c7b756UL) + FF(c,d,a,b,W[2],17,0x242070dbUL) + FF(b,c,d,a,W[3],22,0xc1bdceeeUL) + FF(a,b,c,d,W[4],7,0xf57c0fafUL) + FF(d,a,b,c,W[5],12,0x4787c62aUL) + FF(c,d,a,b,W[6],17,0xa8304613UL) + FF(b,c,d,a,W[7],22,0xfd469501UL) + FF(a,b,c,d,W[8],7,0x698098d8UL) + FF(d,a,b,c,W[9],12,0x8b44f7afUL) + FF(c,d,a,b,W[10],17,0xffff5bb1UL) + FF(b,c,d,a,W[11],22,0x895cd7beUL) + FF(a,b,c,d,W[12],7,0x6b901122UL) + FF(d,a,b,c,W[13],12,0xfd987193UL) + FF(c,d,a,b,W[14],17,0xa679438eUL) + FF(b,c,d,a,W[15],22,0x49b40821UL) + GG(a,b,c,d,W[1],5,0xf61e2562UL) + GG(d,a,b,c,W[6],9,0xc040b340UL) + GG(c,d,a,b,W[11],14,0x265e5a51UL) + GG(b,c,d,a,W[0],20,0xe9b6c7aaUL) + GG(a,b,c,d,W[5],5,0xd62f105dUL) + GG(d,a,b,c,W[10],9,0x02441453UL) + GG(c,d,a,b,W[15],14,0xd8a1e681UL) + GG(b,c,d,a,W[4],20,0xe7d3fbc8UL) + GG(a,b,c,d,W[9],5,0x21e1cde6UL) + GG(d,a,b,c,W[14],9,0xc33707d6UL) + GG(c,d,a,b,W[3],14,0xf4d50d87UL) + GG(b,c,d,a,W[8],20,0x455a14edUL) + GG(a,b,c,d,W[13],5,0xa9e3e905UL) + GG(d,a,b,c,W[2],9,0xfcefa3f8UL) + GG(c,d,a,b,W[7],14,0x676f02d9UL) + GG(b,c,d,a,W[12],20,0x8d2a4c8aUL) + HH(a,b,c,d,W[5],4,0xfffa3942UL) + HH(d,a,b,c,W[8],11,0x8771f681UL) + HH(c,d,a,b,W[11],16,0x6d9d6122UL) + HH(b,c,d,a,W[14],23,0xfde5380cUL) + HH(a,b,c,d,W[1],4,0xa4beea44UL) + HH(d,a,b,c,W[4],11,0x4bdecfa9UL) + HH(c,d,a,b,W[7],16,0xf6bb4b60UL) + HH(b,c,d,a,W[10],23,0xbebfbc70UL) + HH(a,b,c,d,W[13],4,0x289b7ec6UL) + HH(d,a,b,c,W[0],11,0xeaa127faUL) + HH(c,d,a,b,W[3],16,0xd4ef3085UL) + HH(b,c,d,a,W[6],23,0x04881d05UL) + HH(a,b,c,d,W[9],4,0xd9d4d039UL) + HH(d,a,b,c,W[12],11,0xe6db99e5UL) + HH(c,d,a,b,W[15],16,0x1fa27cf8UL) + HH(b,c,d,a,W[2],23,0xc4ac5665UL) + II(a,b,c,d,W[0],6,0xf4292244UL) + II(d,a,b,c,W[7],10,0x432aff97UL) + II(c,d,a,b,W[14],15,0xab9423a7UL) + II(b,c,d,a,W[5],21,0xfc93a039UL) + II(a,b,c,d,W[12],6,0x655b59c3UL) + II(d,a,b,c,W[3],10,0x8f0ccc92UL) + II(c,d,a,b,W[10],15,0xffeff47dUL) + II(b,c,d,a,W[1],21,0x85845dd1UL) + II(a,b,c,d,W[8],6,0x6fa87e4fUL) + II(d,a,b,c,W[15],10,0xfe2ce6e0UL) + II(c,d,a,b,W[6],15,0xa3014314UL) + II(b,c,d,a,W[13],21,0x4e0811a1UL) + II(a,b,c,d,W[4],6,0xf7537e82UL) + II(d,a,b,c,W[11],10,0xbd3af235UL) + II(c,d,a,b,W[2],15,0x2ad7d2bbUL) + II(b,c,d,a,W[9],21,0xeb86d391UL) +#endif + + md->md5.state[0] = md->md5.state[0] + a; + md->md5.state[1] = md->md5.state[1] + b; + md->md5.state[2] = md->md5.state[2] + c; + md->md5.state[3] = md->md5.state[3] + d; + + return CRYPT_OK; +} + +#ifdef LTC_CLEAN_STACK +static int md5_compress(hash_state *md, unsigned char *buf) +{ + int err; + err = _md5_compress(md, buf); + burn_stack(sizeof(ulong32) * 21); + return err; +} +#endif + +/** + Initialize the hash state + @param md The hash state you wish to initialize + @return CRYPT_OK if successful +*/ +int md5_init(hash_state * md) +{ + LTC_ARGCHK(md != NULL); + md->md5.state[0] = 0x67452301UL; + md->md5.state[1] = 0xefcdab89UL; + md->md5.state[2] = 0x98badcfeUL; + md->md5.state[3] = 0x10325476UL; + md->md5.curlen = 0; + md->md5.length = 0; + return CRYPT_OK; +} + +/** + Process a block of memory though the hash + @param md The hash state + @param in The data to hash + @param inlen The length of the data (octets) + @return CRYPT_OK if successful +*/ +HASH_PROCESS(md5_process, md5_compress, md5, 64) + +/** + Terminate the hash to get the digest + @param md The hash state + @param out [out] The destination of the hash (16 bytes) + @return CRYPT_OK if successful +*/ +int md5_done(hash_state * md, unsigned char *out) +{ + int i; + + LTC_ARGCHK(md != NULL); + LTC_ARGCHK(out != NULL); + + if (md->md5.curlen >= sizeof(md->md5.buf)) { + return CRYPT_INVALID_ARG; + } + + + /* increase the length of the message */ + md->md5.length += md->md5.curlen * 8; + + /* append the '1' bit */ + md->md5.buf[md->md5.curlen++] = (unsigned char)0x80; + + /* if the length is currently above 56 bytes we append zeros + * then compress. Then we can fall back to padding zeros and length + * encoding like normal. + */ + if (md->md5.curlen > 56) { + while (md->md5.curlen < 64) { + md->md5.buf[md->md5.curlen++] = (unsigned char)0; + } + md5_compress(md, md->md5.buf); + md->md5.curlen = 0; + } + + /* pad upto 56 bytes of zeroes */ + while (md->md5.curlen < 56) { + md->md5.buf[md->md5.curlen++] = (unsigned char)0; + } + + /* store length */ + STORE64L(md->md5.length, md->md5.buf+56); + md5_compress(md, md->md5.buf); + + /* copy output */ + for (i = 0; i < 4; i++) { + STORE32L(md->md5.state[i], out+(4*i)); + } +#ifdef LTC_CLEAN_STACK + zeromem(md, sizeof(hash_state)); +#endif + return CRYPT_OK; +} + +/** + Self-test the hash + @return CRYPT_OK if successful, CRYPT_NOP if self-tests have been disabled +*/ +int md5_test(void) +{ + #ifndef LTC_TEST + return CRYPT_NOP; + #else + static const struct { + char *msg; + unsigned char hash[16]; + } tests[] = { + { "", + { 0xd4, 0x1d, 0x8c, 0xd9, 0x8f, 0x00, 0xb2, 0x04, + 0xe9, 0x80, 0x09, 0x98, 0xec, 0xf8, 0x42, 0x7e } }, + { "a", + {0x0c, 0xc1, 0x75, 0xb9, 0xc0, 0xf1, 0xb6, 0xa8, + 0x31, 0xc3, 0x99, 0xe2, 0x69, 0x77, 0x26, 0x61 } }, + { "abc", + { 0x90, 0x01, 0x50, 0x98, 0x3c, 0xd2, 0x4f, 0xb0, + 0xd6, 0x96, 0x3f, 0x7d, 0x28, 0xe1, 0x7f, 0x72 } }, + { "message digest", + { 0xf9, 0x6b, 0x69, 0x7d, 0x7c, 0xb7, 0x93, 0x8d, + 0x52, 0x5a, 0x2f, 0x31, 0xaa, 0xf1, 0x61, 0xd0 } }, + { "abcdefghijklmnopqrstuvwxyz", + { 0xc3, 0xfc, 0xd3, 0xd7, 0x61, 0x92, 0xe4, 0x00, + 0x7d, 0xfb, 0x49, 0x6c, 0xca, 0x67, 0xe1, 0x3b } }, + { "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", + { 0xd1, 0x74, 0xab, 0x98, 0xd2, 0x77, 0xd9, 0xf5, + 0xa5, 0x61, 0x1c, 0x2c, 0x9f, 0x41, 0x9d, 0x9f } }, + { "12345678901234567890123456789012345678901234567890123456789012345678901234567890", + { 0x57, 0xed, 0xf4, 0xa2, 0x2b, 0xe3, 0xc9, 0x55, + 0xac, 0x49, 0xda, 0x2e, 0x21, 0x07, 0xb6, 0x7a } }, + { NULL, { 0 } } + }; + + int i; + unsigned char tmp[16]; + hash_state md; + + for (i = 0; tests[i].msg != NULL; i++) { + md5_init(&md); + md5_process(&md, (unsigned char *)tests[i].msg, (unsigned long)strlen(tests[i].msg)); + md5_done(&md, tmp); + if (XMEMCMP(tmp, tests[i].hash, 16) != 0) { + return CRYPT_FAIL_TESTVECTOR; + } + } + return CRYPT_OK; + #endif +} + +#endif + + + +/* $Source: /cvs/libtom/libtomcrypt/src/hashes/md5.c,v $ */ +/* $Revision: 1.10 $ */ +/* $Date: 2007/05/12 14:25:28 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/hashes/sha1.c b/dep/StormLib/src/libtomcrypt/src/hashes/sha1.c new file mode 100644 index 00000000000..409d0954241 --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/hashes/sha1.c @@ -0,0 +1,288 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../headers/tomcrypt.h" + +/** + @file sha1.c + LTC_SHA1 code by Tom St Denis +*/ + + +#ifdef LTC_SHA1 + +const struct ltc_hash_descriptor sha1_desc = +{ + "sha1", + 2, + 20, + 64, + + /* OID */ + { 1, 3, 14, 3, 2, 26, }, + 6, + + &sha1_init, + &sha1_process, + &sha1_done, + &sha1_test, + NULL +}; + +#define F0(x,y,z) (z ^ (x & (y ^ z))) +#define F1(x,y,z) (x ^ y ^ z) +#define F2(x,y,z) ((x & y) | (z & (x | y))) +#define F3(x,y,z) (x ^ y ^ z) + +#ifdef LTC_CLEAN_STACK +static int _sha1_compress(hash_state *md, unsigned char *buf) +#else +static int sha1_compress(hash_state *md, unsigned char *buf) +#endif +{ + ulong32 a,b,c,d,e,W[80],i; +#ifdef LTC_SMALL_CODE + ulong32 t; +#endif + + /* copy the state into 512-bits into W[0..15] */ + for (i = 0; i < 16; i++) { + LOAD32H(W[i], buf + (4*i)); + } + + /* copy state */ + a = md->sha1.state[0]; + b = md->sha1.state[1]; + c = md->sha1.state[2]; + d = md->sha1.state[3]; + e = md->sha1.state[4]; + + /* expand it */ + for (i = 16; i < 80; i++) { + W[i] = ROL(W[i-3] ^ W[i-8] ^ W[i-14] ^ W[i-16], 1); + } + + /* compress */ + /* round one */ + #define FF0(a,b,c,d,e,i) e = (ROLc(a, 5) + F0(b,c,d) + e + W[i] + 0x5a827999UL); b = ROLc(b, 30); + #define FF1(a,b,c,d,e,i) e = (ROLc(a, 5) + F1(b,c,d) + e + W[i] + 0x6ed9eba1UL); b = ROLc(b, 30); + #define FF2(a,b,c,d,e,i) e = (ROLc(a, 5) + F2(b,c,d) + e + W[i] + 0x8f1bbcdcUL); b = ROLc(b, 30); + #define FF3(a,b,c,d,e,i) e = (ROLc(a, 5) + F3(b,c,d) + e + W[i] + 0xca62c1d6UL); b = ROLc(b, 30); + +#ifdef LTC_SMALL_CODE + + for (i = 0; i < 20; ) { + FF0(a,b,c,d,e,i++); t = e; e = d; d = c; c = b; b = a; a = t; + } + + for (; i < 40; ) { + FF1(a,b,c,d,e,i++); t = e; e = d; d = c; c = b; b = a; a = t; + } + + for (; i < 60; ) { + FF2(a,b,c,d,e,i++); t = e; e = d; d = c; c = b; b = a; a = t; + } + + for (; i < 80; ) { + FF3(a,b,c,d,e,i++); t = e; e = d; d = c; c = b; b = a; a = t; + } + +#else + + for (i = 0; i < 20; ) { + FF0(a,b,c,d,e,i++); + FF0(e,a,b,c,d,i++); + FF0(d,e,a,b,c,i++); + FF0(c,d,e,a,b,i++); + FF0(b,c,d,e,a,i++); + } + + /* round two */ + for (; i < 40; ) { + FF1(a,b,c,d,e,i++); + FF1(e,a,b,c,d,i++); + FF1(d,e,a,b,c,i++); + FF1(c,d,e,a,b,i++); + FF1(b,c,d,e,a,i++); + } + + /* round three */ + for (; i < 60; ) { + FF2(a,b,c,d,e,i++); + FF2(e,a,b,c,d,i++); + FF2(d,e,a,b,c,i++); + FF2(c,d,e,a,b,i++); + FF2(b,c,d,e,a,i++); + } + + /* round four */ + for (; i < 80; ) { + FF3(a,b,c,d,e,i++); + FF3(e,a,b,c,d,i++); + FF3(d,e,a,b,c,i++); + FF3(c,d,e,a,b,i++); + FF3(b,c,d,e,a,i++); + } +#endif + + #undef FF0 + #undef FF1 + #undef FF2 + #undef FF3 + + /* store */ + md->sha1.state[0] = md->sha1.state[0] + a; + md->sha1.state[1] = md->sha1.state[1] + b; + md->sha1.state[2] = md->sha1.state[2] + c; + md->sha1.state[3] = md->sha1.state[3] + d; + md->sha1.state[4] = md->sha1.state[4] + e; + + return CRYPT_OK; +} + +#ifdef LTC_CLEAN_STACK +static int sha1_compress(hash_state *md, unsigned char *buf) +{ + int err; + err = _sha1_compress(md, buf); + burn_stack(sizeof(ulong32) * 87); + return err; +} +#endif + +/** + Initialize the hash state + @param md The hash state you wish to initialize + @return CRYPT_OK if successful +*/ +int sha1_init(hash_state * md) +{ + LTC_ARGCHK(md != NULL); + md->sha1.state[0] = 0x67452301UL; + md->sha1.state[1] = 0xefcdab89UL; + md->sha1.state[2] = 0x98badcfeUL; + md->sha1.state[3] = 0x10325476UL; + md->sha1.state[4] = 0xc3d2e1f0UL; + md->sha1.curlen = 0; + md->sha1.length = 0; + return CRYPT_OK; +} + +/** + Process a block of memory though the hash + @param md The hash state + @param in The data to hash + @param inlen The length of the data (octets) + @return CRYPT_OK if successful +*/ +HASH_PROCESS(sha1_process, sha1_compress, sha1, 64) + +/** + Terminate the hash to get the digest + @param md The hash state + @param out [out] The destination of the hash (20 bytes) + @return CRYPT_OK if successful +*/ +int sha1_done(hash_state * md, unsigned char *out) +{ + int i; + + LTC_ARGCHK(md != NULL); + LTC_ARGCHK(out != NULL); + + if (md->sha1.curlen >= sizeof(md->sha1.buf)) { + return CRYPT_INVALID_ARG; + } + + /* increase the length of the message */ + md->sha1.length += md->sha1.curlen * 8; + + /* append the '1' bit */ + md->sha1.buf[md->sha1.curlen++] = (unsigned char)0x80; + + /* if the length is currently above 56 bytes we append zeros + * then compress. Then we can fall back to padding zeros and length + * encoding like normal. + */ + if (md->sha1.curlen > 56) { + while (md->sha1.curlen < 64) { + md->sha1.buf[md->sha1.curlen++] = (unsigned char)0; + } + sha1_compress(md, md->sha1.buf); + md->sha1.curlen = 0; + } + + /* pad upto 56 bytes of zeroes */ + while (md->sha1.curlen < 56) { + md->sha1.buf[md->sha1.curlen++] = (unsigned char)0; + } + + /* store length */ + STORE64H(md->sha1.length, md->sha1.buf+56); + sha1_compress(md, md->sha1.buf); + + /* copy output */ + for (i = 0; i < 5; i++) { + STORE32H(md->sha1.state[i], out+(4*i)); + } +#ifdef LTC_CLEAN_STACK + zeromem(md, sizeof(hash_state)); +#endif + return CRYPT_OK; +} + +/** + Self-test the hash + @return CRYPT_OK if successful, CRYPT_NOP if self-tests have been disabled +*/ +int sha1_test(void) +{ + #ifndef LTC_TEST + return CRYPT_NOP; + #else + static const struct { + char *msg; + unsigned char hash[20]; + } tests[] = { + { "abc", + { 0xa9, 0x99, 0x3e, 0x36, 0x47, 0x06, 0x81, 0x6a, + 0xba, 0x3e, 0x25, 0x71, 0x78, 0x50, 0xc2, 0x6c, + 0x9c, 0xd0, 0xd8, 0x9d } + }, + { "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", + { 0x84, 0x98, 0x3E, 0x44, 0x1C, 0x3B, 0xD2, 0x6E, + 0xBA, 0xAE, 0x4A, 0xA1, 0xF9, 0x51, 0x29, 0xE5, + 0xE5, 0x46, 0x70, 0xF1 } + } + }; + + int i; + unsigned char tmp[20]; + hash_state md; + + for (i = 0; i < (int)(sizeof(tests) / sizeof(tests[0])); i++) { + sha1_init(&md); + sha1_process(&md, (unsigned char*)tests[i].msg, (unsigned long)strlen(tests[i].msg)); + sha1_done(&md, tmp); + if (XMEMCMP(tmp, tests[i].hash, 20) != 0) { + return CRYPT_FAIL_TESTVECTOR; + } + } + return CRYPT_OK; + #endif +} + +#endif + + + +/* $Source: /cvs/libtom/libtomcrypt/src/hashes/sha1.c,v $ */ +/* $Revision: 1.10 $ */ +/* $Date: 2007/05/12 14:25:28 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/headers/tomcrypt.h b/dep/StormLib/src/libtomcrypt/src/headers/tomcrypt.h new file mode 100644 index 00000000000..74cdff47549 --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/headers/tomcrypt.h @@ -0,0 +1,87 @@ +#ifndef TOMCRYPT_H_ +#define TOMCRYPT_H_ +#include +#include +#include +#include +#include +#include +#include + +/* use configuration data */ +#include "tomcrypt_custom.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* version */ +#define CRYPT 0x0117 +#define SCRYPT "1.17" + +/* max size of either a cipher/hash block or symmetric key [largest of the two] */ +#define MAXBLOCKSIZE 128 + +/* descriptor table size */ +#define TAB_SIZE 32 + +/* error codes [will be expanded in future releases] */ +enum { + CRYPT_OK=0, /* Result OK */ + CRYPT_ERROR, /* Generic Error */ + CRYPT_NOP, /* Not a failure but no operation was performed */ + + CRYPT_INVALID_KEYSIZE, /* Invalid key size given */ + CRYPT_INVALID_ROUNDS, /* Invalid number of rounds */ + CRYPT_FAIL_TESTVECTOR, /* Algorithm failed test vectors */ + + CRYPT_BUFFER_OVERFLOW, /* Not enough space for output */ + CRYPT_INVALID_PACKET, /* Invalid input packet given */ + + CRYPT_INVALID_PRNGSIZE, /* Invalid number of bits for a PRNG */ + CRYPT_ERROR_READPRNG, /* Could not read enough from PRNG */ + + CRYPT_INVALID_CIPHER, /* Invalid cipher specified */ + CRYPT_INVALID_HASH, /* Invalid hash specified */ + CRYPT_INVALID_PRNG, /* Invalid PRNG specified */ + + CRYPT_MEM, /* Out of memory */ + + CRYPT_PK_TYPE_MISMATCH, /* Not equivalent types of PK keys */ + CRYPT_PK_NOT_PRIVATE, /* Requires a private PK key */ + + CRYPT_INVALID_ARG, /* Generic invalid argument */ + CRYPT_FILE_NOTFOUND, /* File Not Found */ + + CRYPT_PK_INVALID_TYPE, /* Invalid type of PK key */ + CRYPT_PK_INVALID_SYSTEM,/* Invalid PK system specified */ + CRYPT_PK_DUP, /* Duplicate key already in key ring */ + CRYPT_PK_NOT_FOUND, /* Key not found in keyring */ + CRYPT_PK_INVALID_SIZE, /* Invalid size input for PK parameters */ + + CRYPT_INVALID_PRIME_SIZE,/* Invalid size of prime requested */ + CRYPT_PK_INVALID_PADDING /* Invalid padding on input */ +}; + +#include "tomcrypt_cfg.h" +#include "tomcrypt_macros.h" +#include "tomcrypt_cipher.h" +#include "tomcrypt_hash.h" +#include "tomcrypt_mac.h" +#include "tomcrypt_prng.h" +#include "tomcrypt_pk.h" +#include "tomcrypt_math.h" +#include "tomcrypt_misc.h" +#include "tomcrypt_argchk.h" +#include "tomcrypt_pkcs.h" + +#ifdef __cplusplus + } +#endif + +#endif /* TOMCRYPT_H_ */ + + +/* $Source: /cvs/libtom/libtomcrypt/src/headers/tomcrypt.h,v $ */ +/* $Revision: 1.21 $ */ +/* $Date: 2006/12/16 19:34:05 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_argchk.h b/dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_argchk.h new file mode 100644 index 00000000000..cfc93ad7ea6 --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_argchk.h @@ -0,0 +1,38 @@ +/* Defines the LTC_ARGCHK macro used within the library */ +/* ARGTYPE is defined in mycrypt_cfg.h */ +#if ARGTYPE == 0 + +#include + +/* this is the default LibTomCrypt macro */ +void crypt_argchk(char *v, char *s, int d); +#define LTC_ARGCHK(x) if (!(x)) { crypt_argchk(#x, __FILE__, __LINE__); } +#define LTC_ARGCHKVD(x) LTC_ARGCHK(x) + +#elif ARGTYPE == 1 + +/* fatal type of error */ +#define LTC_ARGCHK(x) assert((x)) +#define LTC_ARGCHKVD(x) LTC_ARGCHK(x) + +#elif ARGTYPE == 2 + +#define LTC_ARGCHK(x) if (!(x)) { fprintf(stderr, "\nwarning: ARGCHK failed at %s:%d\n", __FILE__, __LINE__); } +#define LTC_ARGCHKVD(x) LTC_ARGCHK(x) + +#elif ARGTYPE == 3 + +#define LTC_ARGCHK(x) +#define LTC_ARGCHKVD(x) LTC_ARGCHK(x) + +#elif ARGTYPE == 4 + +#define LTC_ARGCHK(x) if (!(x)) return CRYPT_INVALID_ARG; +#define LTC_ARGCHKVD(x) if (!(x)) return; + +#endif + + +/* $Source: /cvs/libtom/libtomcrypt/src/headers/tomcrypt_argchk.h,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/08/27 20:50:21 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_cfg.h b/dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_cfg.h new file mode 100644 index 00000000000..7feae6e8bdc --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_cfg.h @@ -0,0 +1,136 @@ +/* This is the build config file. + * + * With this you can setup what to inlcude/exclude automatically during any build. Just comment + * out the line that #define's the word for the thing you want to remove. phew! + */ + +#ifndef TOMCRYPT_CFG_H +#define TOMCRYPT_CFG_H + +#if defined(_WIN32) || defined(_MSC_VER) +#define LTC_CALL __cdecl +#else +#ifndef LTC_CALL + #define LTC_CALL +#endif +#endif + +#ifndef LTC_EXPORT +#define LTC_EXPORT +#endif + +/* certain platforms use macros for these, making the prototypes broken */ +#ifndef LTC_NO_PROTOTYPES + +/* you can change how memory allocation works ... */ +LTC_EXPORT void * LTC_CALL XMALLOC(size_t n); +LTC_EXPORT void * LTC_CALL XREALLOC(void *p, size_t n); +LTC_EXPORT void * LTC_CALL XCALLOC(size_t n, size_t s); +LTC_EXPORT void LTC_CALL XFREE(void *p); + +LTC_EXPORT void LTC_CALL XQSORT(void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *)); + + +/* change the clock function too */ +LTC_EXPORT clock_t LTC_CALL XCLOCK(void); + +/* various other functions */ +LTC_EXPORT void * LTC_CALL XMEMCPY(void *dest, const void *src, size_t n); +LTC_EXPORT int LTC_CALL XMEMCMP(const void *s1, const void *s2, size_t n); +LTC_EXPORT void * LTC_CALL XMEMSET(void *s, int c, size_t n); + +LTC_EXPORT int LTC_CALL XSTRCMP(const char *s1, const char *s2); + +#endif + +/* type of argument checking, 0=default, 1=fatal and 2=error+continue, 3=nothing */ +#ifndef ARGTYPE + #define ARGTYPE 0 +#endif + +/* Controls endianess and size of registers. Leave uncommented to get platform neutral [slower] code + * + * Note: in order to use the optimized macros your platform must support unaligned 32 and 64 bit read/writes. + * The x86 platforms allow this but some others [ARM for instance] do not. On those platforms you **MUST** + * use the portable [slower] macros. + */ + +/* detect x86-32 machines somewhat */ +#if !defined(__STRICT_ANSI__) && (defined(INTEL_CC) || (defined(_MSC_VER) && defined(WIN32)) || (defined(__GNUC__) && (defined(__DJGPP__) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__i386__)))) + #define ENDIAN_LITTLE + #define ENDIAN_32BITWORD + #define LTC_FAST + #define LTC_FAST_TYPE unsigned long +#endif + +/* detects MIPS R5900 processors (PS2) */ +#if (defined(__R5900) || defined(R5900) || defined(__R5900__)) && (defined(_mips) || defined(__mips__) || defined(mips)) + #define ENDIAN_LITTLE + #define ENDIAN_64BITWORD +#endif + +/* detect amd64 */ +#if !defined(__STRICT_ANSI__) && defined(__x86_64__) + #define ENDIAN_LITTLE + #define ENDIAN_64BITWORD + #define LTC_FAST + #define LTC_FAST_TYPE unsigned long +#endif + +/* detect PPC32 */ +#if !defined(__STRICT_ANSI__) && defined(LTC_PPC32) + #define ENDIAN_BIG + #define ENDIAN_32BITWORD + #define LTC_FAST + #define LTC_FAST_TYPE unsigned long +#endif + +/* detect sparc and sparc64 */ +#if defined(__sparc__) + #define ENDIAN_BIG + #if defined(__arch64__) + #define ENDIAN_64BITWORD + #else + #define ENDIAN_32BITWORD + #endif +#endif + + +#ifdef LTC_NO_FAST + #ifdef LTC_FAST + #undef LTC_FAST + #endif +#endif + +/* No asm is a quick way to disable anything "not portable" */ +#ifdef LTC_NO_ASM + #undef ENDIAN_LITTLE + #undef ENDIAN_BIG + #undef ENDIAN_32BITWORD + #undef ENDIAN_64BITWORD + #undef LTC_FAST + #undef LTC_FAST_TYPE + #define LTC_NO_ROLC + #define LTC_NO_BSWAP +#endif + +/* #define ENDIAN_LITTLE */ +/* #define ENDIAN_BIG */ + +/* #define ENDIAN_32BITWORD */ +/* #define ENDIAN_64BITWORD */ + +#if (defined(ENDIAN_BIG) || defined(ENDIAN_LITTLE)) && !(defined(ENDIAN_32BITWORD) || defined(ENDIAN_64BITWORD)) + #error You must specify a word size as well as endianess in tomcrypt_cfg.h +#endif + +#if !(defined(ENDIAN_BIG) || defined(ENDIAN_LITTLE)) + #define ENDIAN_NEUTRAL +#endif + +#endif + + +/* $Source: /cvs/libtom/libtomcrypt/src/headers/tomcrypt_cfg.h,v $ */ +/* $Revision: 1.19 $ */ +/* $Date: 2006/12/04 02:19:48 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_cipher.h b/dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_cipher.h new file mode 100644 index 00000000000..bd740bf4a0c --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_cipher.h @@ -0,0 +1,891 @@ +/* ---- SYMMETRIC KEY STUFF ----- + * + * We put each of the ciphers scheduled keys in their own structs then we put all of + * the key formats in one union. This makes the function prototypes easier to use. + */ +#ifdef LTC_BLOWFISH +struct blowfish_key { + ulong32 S[4][256]; + ulong32 K[18]; +}; +#endif + +#ifdef LTC_RC5 +struct rc5_key { + int rounds; + ulong32 K[50]; +}; +#endif + +#ifdef LTC_RC6 +struct rc6_key { + ulong32 K[44]; +}; +#endif + +#ifdef LTC_SAFERP +struct saferp_key { + unsigned char K[33][16]; + long rounds; +}; +#endif + +#ifdef LTC_RIJNDAEL +struct rijndael_key { + ulong32 eK[60], dK[60]; + int Nr; +}; +#endif + +#ifdef LTC_KSEED +struct kseed_key { + ulong32 K[32], dK[32]; +}; +#endif + +#ifdef LTC_KASUMI +struct kasumi_key { + ulong32 KLi1[8], KLi2[8], + KOi1[8], KOi2[8], KOi3[8], + KIi1[8], KIi2[8], KIi3[8]; +}; +#endif + +#ifdef LTC_XTEA +struct xtea_key { + unsigned long A[32], B[32]; +}; +#endif + +#ifdef LTC_TWOFISH +#ifndef LTC_TWOFISH_SMALL + struct twofish_key { + ulong32 S[4][256], K[40]; + }; +#else + struct twofish_key { + ulong32 K[40]; + unsigned char S[32], start; + }; +#endif +#endif + +#ifdef LTC_SAFER +#define LTC_SAFER_K64_DEFAULT_NOF_ROUNDS 6 +#define LTC_SAFER_K128_DEFAULT_NOF_ROUNDS 10 +#define LTC_SAFER_SK64_DEFAULT_NOF_ROUNDS 8 +#define LTC_SAFER_SK128_DEFAULT_NOF_ROUNDS 10 +#define LTC_SAFER_MAX_NOF_ROUNDS 13 +#define LTC_SAFER_BLOCK_LEN 8 +#define LTC_SAFER_KEY_LEN (1 + LTC_SAFER_BLOCK_LEN * (1 + 2 * LTC_SAFER_MAX_NOF_ROUNDS)) +typedef unsigned char safer_block_t[LTC_SAFER_BLOCK_LEN]; +typedef unsigned char safer_key_t[LTC_SAFER_KEY_LEN]; +struct safer_key { safer_key_t key; }; +#endif + +#ifdef LTC_RC2 +struct rc2_key { unsigned xkey[64]; }; +#endif + +#ifdef LTC_DES +struct des_key { + ulong32 ek[32], dk[32]; +}; + +struct des3_key { + ulong32 ek[3][32], dk[3][32]; +}; +#endif + +#ifdef LTC_CAST5 +struct cast5_key { + ulong32 K[32], keylen; +}; +#endif + +#ifdef LTC_NOEKEON +struct noekeon_key { + ulong32 K[4], dK[4]; +}; +#endif + +#ifdef LTC_SKIPJACK +struct skipjack_key { + unsigned char key[10]; +}; +#endif + +#ifdef LTC_KHAZAD +struct khazad_key { + ulong64 roundKeyEnc[8 + 1]; + ulong64 roundKeyDec[8 + 1]; +}; +#endif + +#ifdef LTC_ANUBIS +struct anubis_key { + int keyBits; + int R; + ulong32 roundKeyEnc[18 + 1][4]; + ulong32 roundKeyDec[18 + 1][4]; +}; +#endif + +#ifdef LTC_MULTI2 +struct multi2_key { + int N; + ulong32 uk[8]; +}; +#endif + +typedef union Symmetric_key { +#ifdef LTC_DES + struct des_key des; + struct des3_key des3; +#endif +#ifdef LTC_RC2 + struct rc2_key rc2; +#endif +#ifdef LTC_SAFER + struct safer_key safer; +#endif +#ifdef LTC_TWOFISH + struct twofish_key twofish; +#endif +#ifdef LTC_BLOWFISH + struct blowfish_key blowfish; +#endif +#ifdef LTC_RC5 + struct rc5_key rc5; +#endif +#ifdef LTC_RC6 + struct rc6_key rc6; +#endif +#ifdef LTC_SAFERP + struct saferp_key saferp; +#endif +#ifdef LTC_RIJNDAEL + struct rijndael_key rijndael; +#endif +#ifdef LTC_XTEA + struct xtea_key xtea; +#endif +#ifdef LTC_CAST5 + struct cast5_key cast5; +#endif +#ifdef LTC_NOEKEON + struct noekeon_key noekeon; +#endif +#ifdef LTC_SKIPJACK + struct skipjack_key skipjack; +#endif +#ifdef LTC_KHAZAD + struct khazad_key khazad; +#endif +#ifdef LTC_ANUBIS + struct anubis_key anubis; +#endif +#ifdef LTC_KSEED + struct kseed_key kseed; +#endif +#ifdef LTC_KASUMI + struct kasumi_key kasumi; +#endif +#ifdef LTC_MULTI2 + struct multi2_key multi2; +#endif + void *data; +} symmetric_key; + +#ifdef LTC_ECB_MODE +/** A block cipher ECB structure */ +typedef struct { + /** The index of the cipher chosen */ + int cipher, + /** The block size of the given cipher */ + blocklen; + /** The scheduled key */ + symmetric_key key; +} symmetric_ECB; +#endif + +#ifdef LTC_CFB_MODE +/** A block cipher CFB structure */ +typedef struct { + /** The index of the cipher chosen */ + int cipher, + /** The block size of the given cipher */ + blocklen, + /** The padding offset */ + padlen; + /** The current IV */ + unsigned char IV[MAXBLOCKSIZE], + /** The pad used to encrypt/decrypt */ + pad[MAXBLOCKSIZE]; + /** The scheduled key */ + symmetric_key key; +} symmetric_CFB; +#endif + +#ifdef LTC_OFB_MODE +/** A block cipher OFB structure */ +typedef struct { + /** The index of the cipher chosen */ + int cipher, + /** The block size of the given cipher */ + blocklen, + /** The padding offset */ + padlen; + /** The current IV */ + unsigned char IV[MAXBLOCKSIZE]; + /** The scheduled key */ + symmetric_key key; +} symmetric_OFB; +#endif + +#ifdef LTC_CBC_MODE +/** A block cipher CBC structure */ +typedef struct { + /** The index of the cipher chosen */ + int cipher, + /** The block size of the given cipher */ + blocklen; + /** The current IV */ + unsigned char IV[MAXBLOCKSIZE]; + /** The scheduled key */ + symmetric_key key; +} symmetric_CBC; +#endif + + +#ifdef LTC_CTR_MODE +/** A block cipher CTR structure */ +typedef struct { + /** The index of the cipher chosen */ + int cipher, + /** The block size of the given cipher */ + blocklen, + /** The padding offset */ + padlen, + /** The mode (endianess) of the CTR, 0==little, 1==big */ + mode, + /** counter width */ + ctrlen; + + /** The counter */ + unsigned char ctr[MAXBLOCKSIZE], + /** The pad used to encrypt/decrypt */ + pad[MAXBLOCKSIZE]; + /** The scheduled key */ + symmetric_key key; +} symmetric_CTR; +#endif + + +#ifdef LTC_LRW_MODE +/** A LRW structure */ +typedef struct { + /** The index of the cipher chosen (must be a 128-bit block cipher) */ + int cipher; + + /** The current IV */ + unsigned char IV[16], + + /** the tweak key */ + tweak[16], + + /** The current pad, it's the product of the first 15 bytes against the tweak key */ + pad[16]; + + /** The scheduled symmetric key */ + symmetric_key key; + +#ifdef LRW_TABLES + /** The pre-computed multiplication table */ + unsigned char PC[16][256][16]; +#endif +} symmetric_LRW; +#endif + +#ifdef LTC_F8_MODE +/** A block cipher F8 structure */ +typedef struct { + /** The index of the cipher chosen */ + int cipher, + /** The block size of the given cipher */ + blocklen, + /** The padding offset */ + padlen; + /** The current IV */ + unsigned char IV[MAXBLOCKSIZE], + MIV[MAXBLOCKSIZE]; + /** Current block count */ + ulong32 blockcnt; + /** The scheduled key */ + symmetric_key key; +} symmetric_F8; +#endif + + +/** cipher descriptor table, last entry has "name == NULL" to mark the end of table */ +extern struct ltc_cipher_descriptor { + /** name of cipher */ + char *name; + /** internal ID */ + unsigned char ID; + /** min keysize (octets) */ + int min_key_length, + /** max keysize (octets) */ + max_key_length, + /** block size (octets) */ + block_length, + /** default number of rounds */ + default_rounds; + /** Setup the cipher + @param key The input symmetric key + @param keylen The length of the input key (octets) + @param num_rounds The requested number of rounds (0==default) + @param skey [out] The destination of the scheduled key + @return CRYPT_OK if successful + */ + int (*setup)(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey); + /** Encrypt a block + @param pt The plaintext + @param ct [out] The ciphertext + @param skey The scheduled key + @return CRYPT_OK if successful + */ + int (*ecb_encrypt)(const unsigned char *pt, unsigned char *ct, symmetric_key *skey); + /** Decrypt a block + @param ct The ciphertext + @param pt [out] The plaintext + @param skey The scheduled key + @return CRYPT_OK if successful + */ + int (*ecb_decrypt)(const unsigned char *ct, unsigned char *pt, symmetric_key *skey); + /** Test the block cipher + @return CRYPT_OK if successful, CRYPT_NOP if self-testing has been disabled + */ + int (*test)(void); + + /** Terminate the context + @param skey The scheduled key + */ + void (*done)(symmetric_key *skey); + + /** Determine a key size + @param keysize [in/out] The size of the key desired and the suggested size + @return CRYPT_OK if successful + */ + int (*keysize)(int *keysize); + +/** Accelerators **/ + /** Accelerated ECB encryption + @param pt Plaintext + @param ct Ciphertext + @param blocks The number of complete blocks to process + @param skey The scheduled key context + @return CRYPT_OK if successful + */ + int (*accel_ecb_encrypt)(const unsigned char *pt, unsigned char *ct, unsigned long blocks, symmetric_key *skey); + + /** Accelerated ECB decryption + @param pt Plaintext + @param ct Ciphertext + @param blocks The number of complete blocks to process + @param skey The scheduled key context + @return CRYPT_OK if successful + */ + int (*accel_ecb_decrypt)(const unsigned char *ct, unsigned char *pt, unsigned long blocks, symmetric_key *skey); + + /** Accelerated CBC encryption + @param pt Plaintext + @param ct Ciphertext + @param blocks The number of complete blocks to process + @param IV The initial value (input/output) + @param skey The scheduled key context + @return CRYPT_OK if successful + */ + int (*accel_cbc_encrypt)(const unsigned char *pt, unsigned char *ct, unsigned long blocks, unsigned char *IV, symmetric_key *skey); + + /** Accelerated CBC decryption + @param pt Plaintext + @param ct Ciphertext + @param blocks The number of complete blocks to process + @param IV The initial value (input/output) + @param skey The scheduled key context + @return CRYPT_OK if successful + */ + int (*accel_cbc_decrypt)(const unsigned char *ct, unsigned char *pt, unsigned long blocks, unsigned char *IV, symmetric_key *skey); + + /** Accelerated CTR encryption + @param pt Plaintext + @param ct Ciphertext + @param blocks The number of complete blocks to process + @param IV The initial value (input/output) + @param mode little or big endian counter (mode=0 or mode=1) + @param skey The scheduled key context + @return CRYPT_OK if successful + */ + int (*accel_ctr_encrypt)(const unsigned char *pt, unsigned char *ct, unsigned long blocks, unsigned char *IV, int mode, symmetric_key *skey); + + /** Accelerated LRW + @param pt Plaintext + @param ct Ciphertext + @param blocks The number of complete blocks to process + @param IV The initial value (input/output) + @param tweak The LRW tweak + @param skey The scheduled key context + @return CRYPT_OK if successful + */ + int (*accel_lrw_encrypt)(const unsigned char *pt, unsigned char *ct, unsigned long blocks, unsigned char *IV, const unsigned char *tweak, symmetric_key *skey); + + /** Accelerated LRW + @param ct Ciphertext + @param pt Plaintext + @param blocks The number of complete blocks to process + @param IV The initial value (input/output) + @param tweak The LRW tweak + @param skey The scheduled key context + @return CRYPT_OK if successful + */ + int (*accel_lrw_decrypt)(const unsigned char *ct, unsigned char *pt, unsigned long blocks, unsigned char *IV, const unsigned char *tweak, symmetric_key *skey); + + /** Accelerated CCM packet (one-shot) + @param key The secret key to use + @param keylen The length of the secret key (octets) + @param uskey A previously scheduled key [optional can be NULL] + @param nonce The session nonce [use once] + @param noncelen The length of the nonce + @param header The header for the session + @param headerlen The length of the header (octets) + @param pt [out] The plaintext + @param ptlen The length of the plaintext (octets) + @param ct [out] The ciphertext + @param tag [out] The destination tag + @param taglen [in/out] The max size and resulting size of the authentication tag + @param direction Encrypt or Decrypt direction (0 or 1) + @return CRYPT_OK if successful + */ + int (*accel_ccm_memory)( + const unsigned char *key, unsigned long keylen, + symmetric_key *uskey, + const unsigned char *nonce, unsigned long noncelen, + const unsigned char *header, unsigned long headerlen, + unsigned char *pt, unsigned long ptlen, + unsigned char *ct, + unsigned char *tag, unsigned long *taglen, + int direction); + + /** Accelerated GCM packet (one shot) + @param key The secret key + @param keylen The length of the secret key + @param IV The initial vector + @param IVlen The length of the initial vector + @param adata The additional authentication data (header) + @param adatalen The length of the adata + @param pt The plaintext + @param ptlen The length of the plaintext (ciphertext length is the same) + @param ct The ciphertext + @param tag [out] The MAC tag + @param taglen [in/out] The MAC tag length + @param direction Encrypt or Decrypt mode (GCM_ENCRYPT or GCM_DECRYPT) + @return CRYPT_OK on success + */ + int (*accel_gcm_memory)( + const unsigned char *key, unsigned long keylen, + const unsigned char *IV, unsigned long IVlen, + const unsigned char *adata, unsigned long adatalen, + unsigned char *pt, unsigned long ptlen, + unsigned char *ct, + unsigned char *tag, unsigned long *taglen, + int direction); + + /** Accelerated one shot LTC_OMAC + @param key The secret key + @param keylen The key length (octets) + @param in The message + @param inlen Length of message (octets) + @param out [out] Destination for tag + @param outlen [in/out] Initial and final size of out + @return CRYPT_OK on success + */ + int (*omac_memory)( + const unsigned char *key, unsigned long keylen, + const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen); + + /** Accelerated one shot XCBC + @param key The secret key + @param keylen The key length (octets) + @param in The message + @param inlen Length of message (octets) + @param out [out] Destination for tag + @param outlen [in/out] Initial and final size of out + @return CRYPT_OK on success + */ + int (*xcbc_memory)( + const unsigned char *key, unsigned long keylen, + const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen); + + /** Accelerated one shot F9 + @param key The secret key + @param keylen The key length (octets) + @param in The message + @param inlen Length of message (octets) + @param out [out] Destination for tag + @param outlen [in/out] Initial and final size of out + @return CRYPT_OK on success + @remark Requires manual padding + */ + int (*f9_memory)( + const unsigned char *key, unsigned long keylen, + const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen); +} cipher_descriptor[]; + +#ifdef LTC_BLOWFISH +int blowfish_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey); +int blowfish_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey); +int blowfish_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey); +int blowfish_test(void); +void blowfish_done(symmetric_key *skey); +int blowfish_keysize(int *keysize); +extern const struct ltc_cipher_descriptor blowfish_desc; +#endif + +#ifdef LTC_RC5 +int rc5_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey); +int rc5_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey); +int rc5_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey); +int rc5_test(void); +void rc5_done(symmetric_key *skey); +int rc5_keysize(int *keysize); +extern const struct ltc_cipher_descriptor rc5_desc; +#endif + +#ifdef LTC_RC6 +int rc6_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey); +int rc6_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey); +int rc6_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey); +int rc6_test(void); +void rc6_done(symmetric_key *skey); +int rc6_keysize(int *keysize); +extern const struct ltc_cipher_descriptor rc6_desc; +#endif + +#ifdef LTC_RC2 +int rc2_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey); +int rc2_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey); +int rc2_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey); +int rc2_test(void); +void rc2_done(symmetric_key *skey); +int rc2_keysize(int *keysize); +extern const struct ltc_cipher_descriptor rc2_desc; +#endif + +#ifdef LTC_SAFERP +int saferp_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey); +int saferp_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey); +int saferp_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey); +int saferp_test(void); +void saferp_done(symmetric_key *skey); +int saferp_keysize(int *keysize); +extern const struct ltc_cipher_descriptor saferp_desc; +#endif + +#ifdef LTC_SAFER +int safer_k64_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey); +int safer_sk64_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey); +int safer_k128_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey); +int safer_sk128_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey); +int safer_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *key); +int safer_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *key); +int safer_k64_test(void); +int safer_sk64_test(void); +int safer_sk128_test(void); +void safer_done(symmetric_key *skey); +int safer_64_keysize(int *keysize); +int safer_128_keysize(int *keysize); +extern const struct ltc_cipher_descriptor safer_k64_desc, safer_k128_desc, safer_sk64_desc, safer_sk128_desc; +#endif + +#ifdef LTC_RIJNDAEL + +/* make aes an alias */ +#define aes_setup rijndael_setup +#define aes_ecb_encrypt rijndael_ecb_encrypt +#define aes_ecb_decrypt rijndael_ecb_decrypt +#define aes_test rijndael_test +#define aes_done rijndael_done +#define aes_keysize rijndael_keysize + +#define aes_enc_setup rijndael_enc_setup +#define aes_enc_ecb_encrypt rijndael_enc_ecb_encrypt +#define aes_enc_keysize rijndael_enc_keysize + +int rijndael_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey); +int rijndael_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey); +int rijndael_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey); +int rijndael_test(void); +void rijndael_done(symmetric_key *skey); +int rijndael_keysize(int *keysize); +int rijndael_enc_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey); +int rijndael_enc_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey); +void rijndael_enc_done(symmetric_key *skey); +int rijndael_enc_keysize(int *keysize); +extern const struct ltc_cipher_descriptor rijndael_desc, aes_desc; +extern const struct ltc_cipher_descriptor rijndael_enc_desc, aes_enc_desc; +#endif + +#ifdef LTC_XTEA +int xtea_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey); +int xtea_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey); +int xtea_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey); +int xtea_test(void); +void xtea_done(symmetric_key *skey); +int xtea_keysize(int *keysize); +extern const struct ltc_cipher_descriptor xtea_desc; +#endif + +#ifdef LTC_TWOFISH +int twofish_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey); +int twofish_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey); +int twofish_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey); +int twofish_test(void); +void twofish_done(symmetric_key *skey); +int twofish_keysize(int *keysize); +extern const struct ltc_cipher_descriptor twofish_desc; +#endif + +#ifdef LTC_DES +int des_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey); +int des_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey); +int des_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey); +int des_test(void); +void des_done(symmetric_key *skey); +int des_keysize(int *keysize); +int des3_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey); +int des3_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey); +int des3_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey); +int des3_test(void); +void des3_done(symmetric_key *skey); +int des3_keysize(int *keysize); +extern const struct ltc_cipher_descriptor des_desc, des3_desc; +#endif + +#ifdef LTC_CAST5 +int cast5_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey); +int cast5_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey); +int cast5_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey); +int cast5_test(void); +void cast5_done(symmetric_key *skey); +int cast5_keysize(int *keysize); +extern const struct ltc_cipher_descriptor cast5_desc; +#endif + +#ifdef LTC_NOEKEON +int noekeon_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey); +int noekeon_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey); +int noekeon_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey); +int noekeon_test(void); +void noekeon_done(symmetric_key *skey); +int noekeon_keysize(int *keysize); +extern const struct ltc_cipher_descriptor noekeon_desc; +#endif + +#ifdef LTC_SKIPJACK +int skipjack_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey); +int skipjack_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey); +int skipjack_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey); +int skipjack_test(void); +void skipjack_done(symmetric_key *skey); +int skipjack_keysize(int *keysize); +extern const struct ltc_cipher_descriptor skipjack_desc; +#endif + +#ifdef LTC_KHAZAD +int khazad_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey); +int khazad_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey); +int khazad_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey); +int khazad_test(void); +void khazad_done(symmetric_key *skey); +int khazad_keysize(int *keysize); +extern const struct ltc_cipher_descriptor khazad_desc; +#endif + +#ifdef LTC_ANUBIS +int anubis_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey); +int anubis_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey); +int anubis_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey); +int anubis_test(void); +void anubis_done(symmetric_key *skey); +int anubis_keysize(int *keysize); +extern const struct ltc_cipher_descriptor anubis_desc; +#endif + +#ifdef LTC_KSEED +int kseed_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey); +int kseed_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey); +int kseed_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey); +int kseed_test(void); +void kseed_done(symmetric_key *skey); +int kseed_keysize(int *keysize); +extern const struct ltc_cipher_descriptor kseed_desc; +#endif + +#ifdef LTC_KASUMI +int kasumi_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey); +int kasumi_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey); +int kasumi_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey); +int kasumi_test(void); +void kasumi_done(symmetric_key *skey); +int kasumi_keysize(int *keysize); +extern const struct ltc_cipher_descriptor kasumi_desc; +#endif + + +#ifdef LTC_MULTI2 +int multi2_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey); +int multi2_ecb_encrypt(const unsigned char *pt, unsigned char *ct, symmetric_key *skey); +int multi2_ecb_decrypt(const unsigned char *ct, unsigned char *pt, symmetric_key *skey); +int multi2_test(void); +void multi2_done(symmetric_key *skey); +int multi2_keysize(int *keysize); +extern const struct ltc_cipher_descriptor multi2_desc; +#endif + +#ifdef LTC_ECB_MODE +int ecb_start(int cipher, const unsigned char *key, + int keylen, int num_rounds, symmetric_ECB *ecb); +int ecb_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, symmetric_ECB *ecb); +int ecb_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long len, symmetric_ECB *ecb); +int ecb_done(symmetric_ECB *ecb); +#endif + +#ifdef LTC_CFB_MODE +int cfb_start(int cipher, const unsigned char *IV, const unsigned char *key, + int keylen, int num_rounds, symmetric_CFB *cfb); +int cfb_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, symmetric_CFB *cfb); +int cfb_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long len, symmetric_CFB *cfb); +int cfb_getiv(unsigned char *IV, unsigned long *len, symmetric_CFB *cfb); +int cfb_setiv(const unsigned char *IV, unsigned long len, symmetric_CFB *cfb); +int cfb_done(symmetric_CFB *cfb); +#endif + +#ifdef LTC_OFB_MODE +int ofb_start(int cipher, const unsigned char *IV, const unsigned char *key, + int keylen, int num_rounds, symmetric_OFB *ofb); +int ofb_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, symmetric_OFB *ofb); +int ofb_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long len, symmetric_OFB *ofb); +int ofb_getiv(unsigned char *IV, unsigned long *len, symmetric_OFB *ofb); +int ofb_setiv(const unsigned char *IV, unsigned long len, symmetric_OFB *ofb); +int ofb_done(symmetric_OFB *ofb); +#endif + +#ifdef LTC_CBC_MODE +int cbc_start(int cipher, const unsigned char *IV, const unsigned char *key, + int keylen, int num_rounds, symmetric_CBC *cbc); +int cbc_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, symmetric_CBC *cbc); +int cbc_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long len, symmetric_CBC *cbc); +int cbc_getiv(unsigned char *IV, unsigned long *len, symmetric_CBC *cbc); +int cbc_setiv(const unsigned char *IV, unsigned long len, symmetric_CBC *cbc); +int cbc_done(symmetric_CBC *cbc); +#endif + +#ifdef LTC_CTR_MODE + +#define CTR_COUNTER_LITTLE_ENDIAN 0x0000 +#define CTR_COUNTER_BIG_ENDIAN 0x1000 +#define LTC_CTR_RFC3686 0x2000 + +int ctr_start( int cipher, + const unsigned char *IV, + const unsigned char *key, int keylen, + int num_rounds, int ctr_mode, + symmetric_CTR *ctr); +int ctr_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, symmetric_CTR *ctr); +int ctr_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long len, symmetric_CTR *ctr); +int ctr_getiv(unsigned char *IV, unsigned long *len, symmetric_CTR *ctr); +int ctr_setiv(const unsigned char *IV, unsigned long len, symmetric_CTR *ctr); +int ctr_done(symmetric_CTR *ctr); +int ctr_test(void); +#endif + +#ifdef LTC_LRW_MODE + +#define LRW_ENCRYPT 0 +#define LRW_DECRYPT 1 + +int lrw_start( int cipher, + const unsigned char *IV, + const unsigned char *key, int keylen, + const unsigned char *tweak, + int num_rounds, + symmetric_LRW *lrw); +int lrw_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, symmetric_LRW *lrw); +int lrw_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long len, symmetric_LRW *lrw); +int lrw_getiv(unsigned char *IV, unsigned long *len, symmetric_LRW *lrw); +int lrw_setiv(const unsigned char *IV, unsigned long len, symmetric_LRW *lrw); +int lrw_done(symmetric_LRW *lrw); +int lrw_test(void); + +/* don't call */ +int lrw_process(const unsigned char *pt, unsigned char *ct, unsigned long len, int mode, symmetric_LRW *lrw); +#endif + +#ifdef LTC_F8_MODE +int f8_start( int cipher, const unsigned char *IV, + const unsigned char *key, int keylen, + const unsigned char *salt_key, int skeylen, + int num_rounds, symmetric_F8 *f8); +int f8_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, symmetric_F8 *f8); +int f8_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long len, symmetric_F8 *f8); +int f8_getiv(unsigned char *IV, unsigned long *len, symmetric_F8 *f8); +int f8_setiv(const unsigned char *IV, unsigned long len, symmetric_F8 *f8); +int f8_done(symmetric_F8 *f8); +int f8_test_mode(void); +#endif + +#ifdef LTC_XTS_MODE +typedef struct { + symmetric_key key1, key2; + int cipher; +} symmetric_xts; + +int xts_start( int cipher, + const unsigned char *key1, + const unsigned char *key2, + unsigned long keylen, + int num_rounds, + symmetric_xts *xts); + +int xts_encrypt( + const unsigned char *pt, unsigned long ptlen, + unsigned char *ct, + const unsigned char *tweak, + symmetric_xts *xts); +int xts_decrypt( + const unsigned char *ct, unsigned long ptlen, + unsigned char *pt, + const unsigned char *tweak, + symmetric_xts *xts); + +void xts_done(symmetric_xts *xts); +int xts_test(void); +void xts_mult_x(unsigned char *I); +#endif + +int find_cipher(const char *name); +int find_cipher_any(const char *name, int blocklen, int keylen); +int find_cipher_id(unsigned char ID); +int register_cipher(const struct ltc_cipher_descriptor *cipher); +int unregister_cipher(const struct ltc_cipher_descriptor *cipher); +int cipher_is_valid(int idx); + +LTC_MUTEX_PROTO(ltc_cipher_mutex) + +/* $Source: /cvs/libtom/libtomcrypt/src/headers/tomcrypt_cipher.h,v $ */ +/* $Revision: 1.54 $ */ +/* $Date: 2007/05/12 14:37:41 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_custom.h b/dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_custom.h new file mode 100644 index 00000000000..88ec8f984ab --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_custom.h @@ -0,0 +1,424 @@ +#ifndef TOMCRYPT_CUSTOM_H_ +#define TOMCRYPT_CUSTOM_H_ + +#define LTC_NO_CIPHERS +#define LTC_NO_HASHES +#define LTC_NO_MACS +#define LTC_NO_PRNGS +#define LTC_NO_CURVES +#define LTC_NO_MODES +#define LTC_NO_PKCS +#define LTC_NO_ROLC + +#define LTC_SOURCE +#define LTC_SHA1 +#define LTC_MD5 +#define LTC_DER +#define LTC_RC4 + +#define USE_LTM +#define LTM_DESC + +/* macros for various libc functions you can change for embedded targets */ +#ifndef XMALLOC + #ifdef malloc + #define LTC_NO_PROTOTYPES + #endif +#define XMALLOC LibTomMalloc +#endif +#ifndef XREALLOC + #ifdef realloc + #define LTC_NO_PROTOTYPES + #endif +#define XREALLOC LibTomRealloc +#endif +#ifndef XCALLOC + #ifdef calloc + #define LTC_NO_PROTOTYPES + #endif +#define XCALLOC LibTomCalloc +#endif +#ifndef XFREE + #ifdef free + #define LTC_NO_PROTOTYPES + #endif +#define XFREE LibTomFree +#endif + +#ifndef XMEMSET + #ifdef memset + #define LTC_NO_PROTOTYPES + #endif +#define XMEMSET memset +#endif +#ifndef XMEMCPY + #ifdef memcpy + #define LTC_NO_PROTOTYPES + #endif +#define XMEMCPY memcpy +#endif +#ifndef XMEMCMP + #ifdef memcmp + #define LTC_NO_PROTOTYPES + #endif +#define XMEMCMP memcmp +#endif +#ifndef XSTRCMP + #ifdef strcmp + #define LTC_NO_PROTOTYPES + #endif +#define XSTRCMP strcmp +#endif + +#ifndef XCLOCK +#define XCLOCK LibTomClock +#endif +#ifndef XCLOCKS_PER_SEC +#define XCLOCKS_PER_SEC CLOCKS_PER_SEC +#endif + +#ifndef XQSORT + #ifdef qsort + #define LTC_NO_PROTOTYPES + #endif +#define XQSORT LibTomQsort +#endif + +/* Easy button? */ +#ifdef LTC_EASY + #define LTC_NO_CIPHERS + #define LTC_RIJNDAEL + #define LTC_BLOWFISH + #define LTC_DES + #define LTC_CAST5 + + #define LTC_NO_MODES + #define LTC_ECB_MODE + #define LTC_CBC_MODE + #define LTC_CTR_MODE + + #define LTC_NO_HASHES + #define LTC_SHA1 + #define LTC_SHA512 + #define LTC_SHA384 + #define LTC_SHA256 + #define LTC_SHA224 + + #define LTC_NO_MACS + #define LTC_HMAC + #define LTC_OMAC + #define LTC_CCM_MODE + + #define LTC_NO_PRNGS + #define LTC_SPRNG + #define LTC_YARROW + #define LTC_DEVRANDOM + #define TRY_URANDOM_FIRST + + #define LTC_NO_PK + #define LTC_MRSA + #define LTC_MECC +#endif + +/* Use small code where possible */ +/* #define LTC_SMALL_CODE */ + +/* Enable self-test test vector checking */ +#ifndef LTC_NO_TEST + #define LTC_TEST +#endif + +/* clean the stack of functions which put private information on stack */ +/* #define LTC_CLEAN_STACK */ + +/* disable all file related functions */ +/* #define LTC_NO_FILE */ + +/* disable all forms of ASM */ +/* #define LTC_NO_ASM */ + +/* disable FAST mode */ +/* #define LTC_NO_FAST */ + +/* disable BSWAP on x86 */ +/* #define LTC_NO_BSWAP */ + +/* ---> Symmetric Block Ciphers <--- */ +#ifndef LTC_NO_CIPHERS + +#define LTC_BLOWFISH +#define LTC_RC2 +#define LTC_RC5 +#define LTC_RC6 +#define LTC_SAFERP +#define LTC_RIJNDAEL +#define LTC_XTEA +/* _TABLES tells it to use tables during setup, _SMALL means to use the smaller scheduled key format + * (saves 4KB of ram), _ALL_TABLES enables all tables during setup */ +#define LTC_TWOFISH +#ifndef LTC_NO_TABLES + #define LTC_TWOFISH_TABLES + /* #define LTC_TWOFISH_ALL_TABLES */ +#else + #define LTC_TWOFISH_SMALL +#endif +/* #define LTC_TWOFISH_SMALL */ +/* LTC_DES includes EDE triple-LTC_DES */ +#define LTC_DES +#define LTC_CAST5 +#define LTC_NOEKEON +#define LTC_SKIPJACK +#define LTC_SAFER +#define LTC_KHAZAD +#define LTC_ANUBIS +#define LTC_ANUBIS_TWEAK +#define LTC_KSEED +#define LTC_KASUMI + +#endif /* LTC_NO_CIPHERS */ + + +/* ---> Block Cipher Modes of Operation <--- */ +#ifndef LTC_NO_MODES + +#define LTC_CFB_MODE +#define LTC_OFB_MODE +#define LTC_ECB_MODE +#define LTC_CBC_MODE +#define LTC_CTR_MODE + +/* F8 chaining mode */ +#define LTC_F8_MODE + +/* LRW mode */ +#define LTC_LRW_MODE +#ifndef LTC_NO_TABLES + /* like GCM mode this will enable 16 8x128 tables [64KB] that make + * seeking very fast. + */ + #define LRW_TABLES +#endif + +/* XTS mode */ +#define LTC_XTS_MODE + +#endif /* LTC_NO_MODES */ + +/* ---> One-Way Hash Functions <--- */ +#ifndef LTC_NO_HASHES + +#define LTC_CHC_HASH +#define LTC_WHIRLPOOL +#define LTC_SHA512 +#define LTC_SHA384 +#define LTC_SHA256 +#define LTC_SHA224 +#define LTC_TIGER +#define LTC_SHA1 +#define LTC_MD5 +#define LTC_MD4 +#define LTC_MD2 +#define LTC_RIPEMD128 +#define LTC_RIPEMD160 +#define LTC_RIPEMD256 +#define LTC_RIPEMD320 + +#endif /* LTC_NO_HASHES */ + +/* ---> MAC functions <--- */ +#ifndef LTC_NO_MACS + +#define LTC_HMAC +#define LTC_OMAC +#define LTC_PMAC +#define LTC_XCBC +#define LTC_F9_MODE +#define LTC_PELICAN + +#if defined(LTC_PELICAN) && !defined(LTC_RIJNDAEL) + #error Pelican-MAC requires LTC_RIJNDAEL +#endif + +/* ---> Encrypt + Authenticate Modes <--- */ + +#define LTC_EAX_MODE +#if defined(LTC_EAX_MODE) && !(defined(LTC_CTR_MODE) && defined(LTC_OMAC)) + #error LTC_EAX_MODE requires CTR and LTC_OMAC mode +#endif + +#define LTC_OCB_MODE +#define LTC_CCM_MODE +#define LTC_GCM_MODE + +/* Use 64KiB tables */ +#ifndef LTC_NO_TABLES + #define LTC_GCM_TABLES +#endif + +/* USE SSE2? requires GCC works on x86_32 and x86_64*/ +#ifdef LTC_GCM_TABLES +/* #define LTC_GCM_TABLES_SSE2 */ +#endif + +#endif /* LTC_NO_MACS */ + +/* Various tidbits of modern neatoness */ +#define LTC_BASE64 + +/* --> Pseudo Random Number Generators <--- */ +#ifndef LTC_NO_PRNGS + +/* Yarrow */ +#define LTC_YARROW +/* which descriptor of AES to use? */ +/* 0 = rijndael_enc 1 = aes_enc, 2 = rijndael [full], 3 = aes [full] */ +#define LTC_YARROW_AES 0 + +#if defined(LTC_YARROW) && !defined(LTC_CTR_MODE) + #error LTC_YARROW requires LTC_CTR_MODE chaining mode to be defined! +#endif + +/* a PRNG that simply reads from an available system source */ +#define LTC_SPRNG + +/* The LTC_RC4 stream cipher */ +#define LTC_RC4 + +/* Fortuna PRNG */ +#define LTC_FORTUNA +/* reseed every N calls to the read function */ +#define LTC_FORTUNA_WD 10 +/* number of pools (4..32) can save a bit of ram by lowering the count */ +#define LTC_FORTUNA_POOLS 32 + +/* Greg's LTC_SOBER128 PRNG ;-0 */ +#define LTC_SOBER128 + +/* the *nix style /dev/random device */ +#define LTC_DEVRANDOM +/* try /dev/urandom before trying /dev/random */ +#define TRY_URANDOM_FIRST + +#endif /* LTC_NO_PRNGS */ + +/* ---> math provider? <--- */ +#ifndef LTC_NO_MATH + +/* LibTomMath */ +#define LTM_LTC_DESC + +/* TomsFastMath */ +//#define TFM_LTC_DESC + +#endif /* LTC_NO_MATH */ + +/* ---> Public Key Crypto <--- */ +#ifndef LTC_NO_PK + +/* Include RSA support */ +#define LTC_MRSA + +/* Include Katja (a Rabin variant like RSA) */ +/* #define MKAT */ + +/* Digital Signature Algorithm */ +#define LTC_MDSA + +/* ECC */ +#define LTC_MECC + +/* use Shamir's trick for point mul (speeds up signature verification) */ +#define LTC_ECC_SHAMIR + +#if defined(TFM_LTC_DESC) && defined(LTC_MECC) + #define LTC_MECC_ACCEL +#endif + +/* do we want fixed point ECC */ +/* #define LTC_MECC_FP */ + +/* Timing Resistant? */ +/* #define LTC_ECC_TIMING_RESISTANT */ + +#endif /* LTC_NO_PK */ + +/* LTC_PKCS #1 (RSA) and #5 (Password Handling) stuff */ +#ifndef LTC_NO_PKCS + +#define LTC_PKCS_1 +#define LTC_PKCS_5 + +/* Include ASN.1 DER (required by DSA/RSA) */ +#define LTC_DER + +#endif /* LTC_NO_PKCS */ + +/* cleanup */ + +#ifdef LTC_MECC +/* Supported ECC Key Sizes */ +#ifndef LTC_NO_CURVES + #define ECC112 + #define ECC128 + #define ECC160 + #define ECC192 + #define ECC224 + #define ECC256 + #define ECC384 + #define ECC521 +#endif +#endif + +#if defined(LTC_MECC) || defined(LTC_MRSA) || defined(LTC_MDSA) || defined(MKATJA) + /* Include the MPI functionality? (required by the PK algorithms) */ + #define MPI +#endif + +#ifdef LTC_MRSA + #define LTC_PKCS_1 +#endif + +#if defined(LTC_DER) && !defined(MPI) + #error ASN.1 DER requires MPI functionality +#endif + +#if (defined(LTC_MDSA) || defined(LTC_MRSA) || defined(LTC_MECC) || defined(MKATJA)) && !defined(LTC_DER) + #error PK requires ASN.1 DER functionality, make sure LTC_DER is enabled +#endif + +/* THREAD management */ +#ifdef LTC_PTHREAD + +#include + +#define LTC_MUTEX_GLOBAL(x) pthread_mutex_t x = PTHREAD_MUTEX_INITIALIZER; +#define LTC_MUTEX_PROTO(x) extern pthread_mutex_t x; +#define LTC_MUTEX_TYPE(x) pthread_mutex_t x; +#define LTC_MUTEX_INIT(x) pthread_mutex_init(x, NULL); +#define LTC_MUTEX_LOCK(x) pthread_mutex_lock(x); +#define LTC_MUTEX_UNLOCK(x) pthread_mutex_unlock(x); + +#else + +/* default no functions */ +#define LTC_MUTEX_GLOBAL(x) +#define LTC_MUTEX_PROTO(x) +#define LTC_MUTEX_TYPE(x) +#define LTC_MUTEX_INIT(x) +#define LTC_MUTEX_LOCK(x) +#define LTC_MUTEX_UNLOCK(x) + +#endif + +/* Debuggers */ + +/* define this if you use Valgrind, note: it CHANGES the way SOBER-128 and LTC_RC4 work (see the code) */ +/* #define LTC_VALGRIND */ + +#endif + + + +/* $Source: /cvs/libtom/libtomcrypt/src/headers/tomcrypt_custom.h,v $ */ +/* $Revision: 1.73 $ */ +/* $Date: 2007/05/12 14:37:41 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_hash.h b/dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_hash.h new file mode 100644 index 00000000000..18553ebf9da --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_hash.h @@ -0,0 +1,378 @@ +/* ---- HASH FUNCTIONS ---- */ +#ifdef LTC_SHA512 +struct sha512_state { + ulong64 length, state[8]; + unsigned long curlen; + unsigned char buf[128]; +}; +#endif + +#ifdef LTC_SHA256 +struct sha256_state { + ulong64 length; + ulong32 state[8], curlen; + unsigned char buf[64]; +}; +#endif + +#ifdef LTC_SHA1 +struct sha1_state { + ulong64 length; + ulong32 state[5], curlen; + unsigned char buf[64]; +}; +#endif + +#ifdef LTC_MD5 +struct md5_state { + ulong64 length; + ulong32 state[4], curlen; + unsigned char buf[64]; +}; +#endif + +#ifdef LTC_MD4 +struct md4_state { + ulong64 length; + ulong32 state[4], curlen; + unsigned char buf[64]; +}; +#endif + +#ifdef LTC_TIGER +struct tiger_state { + ulong64 state[3], length; + unsigned long curlen; + unsigned char buf[64]; +}; +#endif + +#ifdef LTC_MD2 +struct md2_state { + unsigned char chksum[16], X[48], buf[16]; + unsigned long curlen; +}; +#endif + +#ifdef LTC_RIPEMD128 +struct rmd128_state { + ulong64 length; + unsigned char buf[64]; + ulong32 curlen, state[4]; +}; +#endif + +#ifdef LTC_RIPEMD160 +struct rmd160_state { + ulong64 length; + unsigned char buf[64]; + ulong32 curlen, state[5]; +}; +#endif + +#ifdef LTC_RIPEMD256 +struct rmd256_state { + ulong64 length; + unsigned char buf[64]; + ulong32 curlen, state[8]; +}; +#endif + +#ifdef LTC_RIPEMD320 +struct rmd320_state { + ulong64 length; + unsigned char buf[64]; + ulong32 curlen, state[10]; +}; +#endif + +#ifdef LTC_WHIRLPOOL +struct whirlpool_state { + ulong64 length, state[8]; + unsigned char buf[64]; + ulong32 curlen; +}; +#endif + +#ifdef LTC_CHC_HASH +struct chc_state { + ulong64 length; + unsigned char state[MAXBLOCKSIZE], buf[MAXBLOCKSIZE]; + ulong32 curlen; +}; +#endif + +typedef union Hash_state { +#ifdef LTC_CHC_HASH + struct chc_state chc; +#endif +#ifdef LTC_WHIRLPOOL + struct whirlpool_state whirlpool; +#endif +#ifdef LTC_SHA512 + struct sha512_state sha512; +#endif +#ifdef LTC_SHA256 + struct sha256_state sha256; +#endif +#ifdef LTC_SHA1 + struct sha1_state sha1; +#endif +#ifdef LTC_MD5 + struct md5_state md5; +#endif +#ifdef LTC_MD4 + struct md4_state md4; +#endif +#ifdef LTC_MD2 + struct md2_state md2; +#endif +#ifdef LTC_TIGER + struct tiger_state tiger; +#endif +#ifdef LTC_RIPEMD128 + struct rmd128_state rmd128; +#endif +#ifdef LTC_RIPEMD160 + struct rmd160_state rmd160; +#endif +#ifdef LTC_RIPEMD256 + struct rmd256_state rmd256; +#endif +#ifdef LTC_RIPEMD320 + struct rmd320_state rmd320; +#endif + void *data; +} hash_state; + +/** hash descriptor */ +extern struct ltc_hash_descriptor { + /** name of hash */ + char *name; + /** internal ID */ + unsigned char ID; + /** Size of digest in octets */ + unsigned long hashsize; + /** Input block size in octets */ + unsigned long blocksize; + /** ASN.1 OID */ + unsigned long OID[16]; + /** Length of DER encoding */ + unsigned long OIDlen; + + /** Init a hash state + @param hash The hash to initialize + @return CRYPT_OK if successful + */ + int (*init)(hash_state *hash); + /** Process a block of data + @param hash The hash state + @param in The data to hash + @param inlen The length of the data (octets) + @return CRYPT_OK if successful + */ + int (*process)(hash_state *hash, const unsigned char *in, unsigned long inlen); + /** Produce the digest and store it + @param hash The hash state + @param out [out] The destination of the digest + @return CRYPT_OK if successful + */ + int (*done)(hash_state *hash, unsigned char *out); + /** Self-test + @return CRYPT_OK if successful, CRYPT_NOP if self-tests have been disabled + */ + int (*test)(void); + + /* accelerated hmac callback: if you need to-do multiple packets just use the generic hmac_memory and provide a hash callback */ + int (*hmac_block)(const unsigned char *key, unsigned long keylen, + const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen); + +} hash_descriptor[]; + +#ifdef LTC_CHC_HASH +int chc_register(int cipher); +int chc_init(hash_state * md); +int chc_process(hash_state * md, const unsigned char *in, unsigned long inlen); +int chc_done(hash_state * md, unsigned char *hash); +int chc_test(void); +extern const struct ltc_hash_descriptor chc_desc; +#endif + +#ifdef LTC_WHIRLPOOL +int whirlpool_init(hash_state * md); +int whirlpool_process(hash_state * md, const unsigned char *in, unsigned long inlen); +int whirlpool_done(hash_state * md, unsigned char *hash); +int whirlpool_test(void); +extern const struct ltc_hash_descriptor whirlpool_desc; +#endif + +#ifdef LTC_SHA512 +int sha512_init(hash_state * md); +int sha512_process(hash_state * md, const unsigned char *in, unsigned long inlen); +int sha512_done(hash_state * md, unsigned char *hash); +int sha512_test(void); +extern const struct ltc_hash_descriptor sha512_desc; +#endif + +#ifdef LTC_SHA384 +#ifndef LTC_SHA512 + #error LTC_SHA512 is required for LTC_SHA384 +#endif +int sha384_init(hash_state * md); +#define sha384_process sha512_process +int sha384_done(hash_state * md, unsigned char *hash); +int sha384_test(void); +extern const struct ltc_hash_descriptor sha384_desc; +#endif + +#ifdef LTC_SHA256 +int sha256_init(hash_state * md); +int sha256_process(hash_state * md, const unsigned char *in, unsigned long inlen); +int sha256_done(hash_state * md, unsigned char *hash); +int sha256_test(void); +extern const struct ltc_hash_descriptor sha256_desc; + +#ifdef LTC_SHA224 +#ifndef LTC_SHA256 + #error LTC_SHA256 is required for LTC_SHA224 +#endif +int sha224_init(hash_state * md); +#define sha224_process sha256_process +int sha224_done(hash_state * md, unsigned char *hash); +int sha224_test(void); +extern const struct ltc_hash_descriptor sha224_desc; +#endif +#endif + +#ifdef LTC_SHA1 +int sha1_init(hash_state * md); +int sha1_process(hash_state * md, const unsigned char *in, unsigned long inlen); +int sha1_done(hash_state * md, unsigned char *hash); +int sha1_test(void); +extern const struct ltc_hash_descriptor sha1_desc; +#endif + +#ifdef LTC_MD5 +int md5_init(hash_state * md); +int md5_process(hash_state * md, const unsigned char *in, unsigned long inlen); +int md5_done(hash_state * md, unsigned char *hash); +int md5_test(void); +extern const struct ltc_hash_descriptor md5_desc; +#endif + +#ifdef LTC_MD4 +int md4_init(hash_state * md); +int md4_process(hash_state * md, const unsigned char *in, unsigned long inlen); +int md4_done(hash_state * md, unsigned char *hash); +int md4_test(void); +extern const struct ltc_hash_descriptor md4_desc; +#endif + +#ifdef LTC_MD2 +int md2_init(hash_state * md); +int md2_process(hash_state * md, const unsigned char *in, unsigned long inlen); +int md2_done(hash_state * md, unsigned char *hash); +int md2_test(void); +extern const struct ltc_hash_descriptor md2_desc; +#endif + +#ifdef LTC_TIGER +int tiger_init(hash_state * md); +int tiger_process(hash_state * md, const unsigned char *in, unsigned long inlen); +int tiger_done(hash_state * md, unsigned char *hash); +int tiger_test(void); +extern const struct ltc_hash_descriptor tiger_desc; +#endif + +#ifdef LTC_RIPEMD128 +int rmd128_init(hash_state * md); +int rmd128_process(hash_state * md, const unsigned char *in, unsigned long inlen); +int rmd128_done(hash_state * md, unsigned char *hash); +int rmd128_test(void); +extern const struct ltc_hash_descriptor rmd128_desc; +#endif + +#ifdef LTC_RIPEMD160 +int rmd160_init(hash_state * md); +int rmd160_process(hash_state * md, const unsigned char *in, unsigned long inlen); +int rmd160_done(hash_state * md, unsigned char *hash); +int rmd160_test(void); +extern const struct ltc_hash_descriptor rmd160_desc; +#endif + +#ifdef LTC_RIPEMD256 +int rmd256_init(hash_state * md); +int rmd256_process(hash_state * md, const unsigned char *in, unsigned long inlen); +int rmd256_done(hash_state * md, unsigned char *hash); +int rmd256_test(void); +extern const struct ltc_hash_descriptor rmd256_desc; +#endif + +#ifdef LTC_RIPEMD320 +int rmd320_init(hash_state * md); +int rmd320_process(hash_state * md, const unsigned char *in, unsigned long inlen); +int rmd320_done(hash_state * md, unsigned char *hash); +int rmd320_test(void); +extern const struct ltc_hash_descriptor rmd320_desc; +#endif + + +int find_hash(const char *name); +int find_hash_id(unsigned char ID); +int find_hash_oid(const unsigned long *ID, unsigned long IDlen); +int find_hash_any(const char *name, int digestlen); +int register_hash(const struct ltc_hash_descriptor *hash); +int unregister_hash(const struct ltc_hash_descriptor *hash); +int hash_is_valid(int idx); + +LTC_MUTEX_PROTO(ltc_hash_mutex) + +int hash_memory(int hash, + const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen); +int hash_memory_multi(int hash, unsigned char *out, unsigned long *outlen, + const unsigned char *in, unsigned long inlen, ...); +int hash_filehandle(int hash, FILE *in, unsigned char *out, unsigned long *outlen); +int hash_file(int hash, const char *fname, unsigned char *out, unsigned long *outlen); + +/* a simple macro for making hash "process" functions */ +#define HASH_PROCESS(func_name, compress_name, state_var, block_size) \ +int func_name (hash_state * md, const unsigned char *in, unsigned long inlen) \ +{ \ + unsigned long n; \ + int err; \ + LTC_ARGCHK(md != NULL); \ + LTC_ARGCHK(in != NULL); \ + if (md-> state_var .curlen > sizeof(md-> state_var .buf)) { \ + return CRYPT_INVALID_ARG; \ + } \ + while (inlen > 0) { \ + if (md-> state_var .curlen == 0 && inlen >= block_size) { \ + if ((err = compress_name (md, (unsigned char *)in)) != CRYPT_OK) { \ + return err; \ + } \ + md-> state_var .length += block_size * 8; \ + in += block_size; \ + inlen -= block_size; \ + } else { \ + n = MIN(inlen, (block_size - md-> state_var .curlen)); \ + memcpy(md-> state_var .buf + md-> state_var.curlen, in, (size_t)n); \ + md-> state_var .curlen += n; \ + in += n; \ + inlen -= n; \ + if (md-> state_var .curlen == block_size) { \ + if ((err = compress_name (md, md-> state_var .buf)) != CRYPT_OK) { \ + return err; \ + } \ + md-> state_var .length += 8*block_size; \ + md-> state_var .curlen = 0; \ + } \ + } \ + } \ + return CRYPT_OK; \ +} + +/* $Source: /cvs/libtom/libtomcrypt/src/headers/tomcrypt_hash.h,v $ */ +/* $Revision: 1.22 $ */ +/* $Date: 2007/05/12 14:32:35 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_mac.h b/dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_mac.h new file mode 100644 index 00000000000..7ad9516bd29 --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_mac.h @@ -0,0 +1,384 @@ +#ifdef LTC_HMAC +typedef struct Hmac_state { + hash_state md; + int hash; + hash_state hashstate; + unsigned char *key; +} hmac_state; + +int hmac_init(hmac_state *hmac, int hash, const unsigned char *key, unsigned long keylen); +int hmac_process(hmac_state *hmac, const unsigned char *in, unsigned long inlen); +int hmac_done(hmac_state *hmac, unsigned char *out, unsigned long *outlen); +int hmac_test(void); +int hmac_memory(int hash, + const unsigned char *key, unsigned long keylen, + const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen); +int hmac_memory_multi(int hash, + const unsigned char *key, unsigned long keylen, + unsigned char *out, unsigned long *outlen, + const unsigned char *in, unsigned long inlen, ...); +int hmac_file(int hash, const char *fname, const unsigned char *key, + unsigned long keylen, + unsigned char *dst, unsigned long *dstlen); +#endif + +#ifdef LTC_OMAC + +typedef struct { + int cipher_idx, + buflen, + blklen; + unsigned char block[MAXBLOCKSIZE], + prev[MAXBLOCKSIZE], + Lu[2][MAXBLOCKSIZE]; + symmetric_key key; +} omac_state; + +int omac_init(omac_state *omac, int cipher, const unsigned char *key, unsigned long keylen); +int omac_process(omac_state *omac, const unsigned char *in, unsigned long inlen); +int omac_done(omac_state *omac, unsigned char *out, unsigned long *outlen); +int omac_memory(int cipher, + const unsigned char *key, unsigned long keylen, + const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen); +int omac_memory_multi(int cipher, + const unsigned char *key, unsigned long keylen, + unsigned char *out, unsigned long *outlen, + const unsigned char *in, unsigned long inlen, ...); +int omac_file(int cipher, + const unsigned char *key, unsigned long keylen, + const char *filename, + unsigned char *out, unsigned long *outlen); +int omac_test(void); +#endif /* LTC_OMAC */ + +#ifdef LTC_PMAC + +typedef struct { + unsigned char Ls[32][MAXBLOCKSIZE], /* L shifted by i bits to the left */ + Li[MAXBLOCKSIZE], /* value of Li [current value, we calc from previous recall] */ + Lr[MAXBLOCKSIZE], /* L * x^-1 */ + block[MAXBLOCKSIZE], /* currently accumulated block */ + checksum[MAXBLOCKSIZE]; /* current checksum */ + + symmetric_key key; /* scheduled key for cipher */ + unsigned long block_index; /* index # for current block */ + int cipher_idx, /* cipher idx */ + block_len, /* length of block */ + buflen; /* number of bytes in the buffer */ +} pmac_state; + +int pmac_init(pmac_state *pmac, int cipher, const unsigned char *key, unsigned long keylen); +int pmac_process(pmac_state *pmac, const unsigned char *in, unsigned long inlen); +int pmac_done(pmac_state *pmac, unsigned char *out, unsigned long *outlen); + +int pmac_memory(int cipher, + const unsigned char *key, unsigned long keylen, + const unsigned char *msg, unsigned long msglen, + unsigned char *out, unsigned long *outlen); + +int pmac_memory_multi(int cipher, + const unsigned char *key, unsigned long keylen, + unsigned char *out, unsigned long *outlen, + const unsigned char *in, unsigned long inlen, ...); + +int pmac_file(int cipher, + const unsigned char *key, unsigned long keylen, + const char *filename, + unsigned char *out, unsigned long *outlen); + +int pmac_test(void); + +/* internal functions */ +int pmac_ntz(unsigned long x); +void pmac_shift_xor(pmac_state *pmac); + +#endif /* PMAC */ + +#ifdef LTC_EAX_MODE + +#if !(defined(LTC_OMAC) && defined(LTC_CTR_MODE)) + #error LTC_EAX_MODE requires LTC_OMAC and CTR +#endif + +typedef struct { + unsigned char N[MAXBLOCKSIZE]; + symmetric_CTR ctr; + omac_state headeromac, ctomac; +} eax_state; + +int eax_init(eax_state *eax, int cipher, const unsigned char *key, unsigned long keylen, + const unsigned char *nonce, unsigned long noncelen, + const unsigned char *header, unsigned long headerlen); + +int eax_encrypt(eax_state *eax, const unsigned char *pt, unsigned char *ct, unsigned long length); +int eax_decrypt(eax_state *eax, const unsigned char *ct, unsigned char *pt, unsigned long length); +int eax_addheader(eax_state *eax, const unsigned char *header, unsigned long length); +int eax_done(eax_state *eax, unsigned char *tag, unsigned long *taglen); + +int eax_encrypt_authenticate_memory(int cipher, + const unsigned char *key, unsigned long keylen, + const unsigned char *nonce, unsigned long noncelen, + const unsigned char *header, unsigned long headerlen, + const unsigned char *pt, unsigned long ptlen, + unsigned char *ct, + unsigned char *tag, unsigned long *taglen); + +int eax_decrypt_verify_memory(int cipher, + const unsigned char *key, unsigned long keylen, + const unsigned char *nonce, unsigned long noncelen, + const unsigned char *header, unsigned long headerlen, + const unsigned char *ct, unsigned long ctlen, + unsigned char *pt, + unsigned char *tag, unsigned long taglen, + int *stat); + + int eax_test(void); +#endif /* EAX MODE */ + +#ifdef LTC_OCB_MODE +typedef struct { + unsigned char L[MAXBLOCKSIZE], /* L value */ + Ls[32][MAXBLOCKSIZE], /* L shifted by i bits to the left */ + Li[MAXBLOCKSIZE], /* value of Li [current value, we calc from previous recall] */ + Lr[MAXBLOCKSIZE], /* L * x^-1 */ + R[MAXBLOCKSIZE], /* R value */ + checksum[MAXBLOCKSIZE]; /* current checksum */ + + symmetric_key key; /* scheduled key for cipher */ + unsigned long block_index; /* index # for current block */ + int cipher, /* cipher idx */ + block_len; /* length of block */ +} ocb_state; + +int ocb_init(ocb_state *ocb, int cipher, + const unsigned char *key, unsigned long keylen, const unsigned char *nonce); + +int ocb_encrypt(ocb_state *ocb, const unsigned char *pt, unsigned char *ct); +int ocb_decrypt(ocb_state *ocb, const unsigned char *ct, unsigned char *pt); + +int ocb_done_encrypt(ocb_state *ocb, + const unsigned char *pt, unsigned long ptlen, + unsigned char *ct, + unsigned char *tag, unsigned long *taglen); + +int ocb_done_decrypt(ocb_state *ocb, + const unsigned char *ct, unsigned long ctlen, + unsigned char *pt, + const unsigned char *tag, unsigned long taglen, int *stat); + +int ocb_encrypt_authenticate_memory(int cipher, + const unsigned char *key, unsigned long keylen, + const unsigned char *nonce, + const unsigned char *pt, unsigned long ptlen, + unsigned char *ct, + unsigned char *tag, unsigned long *taglen); + +int ocb_decrypt_verify_memory(int cipher, + const unsigned char *key, unsigned long keylen, + const unsigned char *nonce, + const unsigned char *ct, unsigned long ctlen, + unsigned char *pt, + const unsigned char *tag, unsigned long taglen, + int *stat); + +int ocb_test(void); + +/* internal functions */ +void ocb_shift_xor(ocb_state *ocb, unsigned char *Z); +int ocb_ntz(unsigned long x); +int s_ocb_done(ocb_state *ocb, const unsigned char *pt, unsigned long ptlen, + unsigned char *ct, unsigned char *tag, unsigned long *taglen, int mode); + +#endif /* LTC_OCB_MODE */ + +#ifdef LTC_CCM_MODE + +#define CCM_ENCRYPT 0 +#define CCM_DECRYPT 1 + +int ccm_memory(int cipher, + const unsigned char *key, unsigned long keylen, + symmetric_key *uskey, + const unsigned char *nonce, unsigned long noncelen, + const unsigned char *header, unsigned long headerlen, + unsigned char *pt, unsigned long ptlen, + unsigned char *ct, + unsigned char *tag, unsigned long *taglen, + int direction); + +int ccm_test(void); + +#endif /* LTC_CCM_MODE */ + +#if defined(LRW_MODE) || defined(LTC_GCM_MODE) +void gcm_gf_mult(const unsigned char *a, const unsigned char *b, unsigned char *c); +#endif + + +/* table shared between GCM and LRW */ +#if defined(LTC_GCM_TABLES) || defined(LRW_TABLES) || ((defined(LTC_GCM_MODE) || defined(LTC_GCM_MODE)) && defined(LTC_FAST)) +extern const unsigned char gcm_shift_table[]; +#endif + +#ifdef LTC_GCM_MODE + +#define GCM_ENCRYPT 0 +#define GCM_DECRYPT 1 + +#define LTC_GCM_MODE_IV 0 +#define LTC_GCM_MODE_AAD 1 +#define LTC_GCM_MODE_TEXT 2 + +typedef struct { + symmetric_key K; + unsigned char H[16], /* multiplier */ + X[16], /* accumulator */ + Y[16], /* counter */ + Y_0[16], /* initial counter */ + buf[16]; /* buffer for stuff */ + + int cipher, /* which cipher */ + ivmode, /* Which mode is the IV in? */ + mode, /* mode the GCM code is in */ + buflen; /* length of data in buf */ + + ulong64 totlen, /* 64-bit counter used for IV and AAD */ + pttotlen; /* 64-bit counter for the PT */ + +#ifdef LTC_GCM_TABLES + unsigned char PC[16][256][16] /* 16 tables of 8x128 */ +#ifdef LTC_GCM_TABLES_SSE2 +__attribute__ ((aligned (16))) +#endif +; +#endif +} gcm_state; + +void gcm_mult_h(gcm_state *gcm, unsigned char *I); + +int gcm_init(gcm_state *gcm, int cipher, + const unsigned char *key, int keylen); + +int gcm_reset(gcm_state *gcm); + +int gcm_add_iv(gcm_state *gcm, + const unsigned char *IV, unsigned long IVlen); + +int gcm_add_aad(gcm_state *gcm, + const unsigned char *adata, unsigned long adatalen); + +int gcm_process(gcm_state *gcm, + unsigned char *pt, unsigned long ptlen, + unsigned char *ct, + int direction); + +int gcm_done(gcm_state *gcm, + unsigned char *tag, unsigned long *taglen); + +int gcm_memory( int cipher, + const unsigned char *key, unsigned long keylen, + const unsigned char *IV, unsigned long IVlen, + const unsigned char *adata, unsigned long adatalen, + unsigned char *pt, unsigned long ptlen, + unsigned char *ct, + unsigned char *tag, unsigned long *taglen, + int direction); +int gcm_test(void); + +#endif /* LTC_GCM_MODE */ + +#ifdef LTC_PELICAN + +typedef struct pelican_state +{ + symmetric_key K; + unsigned char state[16]; + int buflen; +} pelican_state; + +int pelican_init(pelican_state *pelmac, const unsigned char *key, unsigned long keylen); +int pelican_process(pelican_state *pelmac, const unsigned char *in, unsigned long inlen); +int pelican_done(pelican_state *pelmac, unsigned char *out); +int pelican_test(void); + +int pelican_memory(const unsigned char *key, unsigned long keylen, + const unsigned char *in, unsigned long inlen, + unsigned char *out); + +#endif + +#ifdef LTC_XCBC + +/* add this to "keylen" to xcbc_init to use a pure three-key XCBC MAC */ +#define LTC_XCBC_PURE 0x8000UL + +typedef struct { + unsigned char K[3][MAXBLOCKSIZE], + IV[MAXBLOCKSIZE]; + + symmetric_key key; + + int cipher, + buflen, + blocksize; +} xcbc_state; + +int xcbc_init(xcbc_state *xcbc, int cipher, const unsigned char *key, unsigned long keylen); +int xcbc_process(xcbc_state *xcbc, const unsigned char *in, unsigned long inlen); +int xcbc_done(xcbc_state *xcbc, unsigned char *out, unsigned long *outlen); +int xcbc_memory(int cipher, + const unsigned char *key, unsigned long keylen, + const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen); +int xcbc_memory_multi(int cipher, + const unsigned char *key, unsigned long keylen, + unsigned char *out, unsigned long *outlen, + const unsigned char *in, unsigned long inlen, ...); +int xcbc_file(int cipher, + const unsigned char *key, unsigned long keylen, + const char *filename, + unsigned char *out, unsigned long *outlen); +int xcbc_test(void); + +#endif + +#ifdef LTC_F9_MODE + +typedef struct { + unsigned char akey[MAXBLOCKSIZE], + ACC[MAXBLOCKSIZE], + IV[MAXBLOCKSIZE]; + + symmetric_key key; + + int cipher, + buflen, + keylen, + blocksize; +} f9_state; + +int f9_init(f9_state *f9, int cipher, const unsigned char *key, unsigned long keylen); +int f9_process(f9_state *f9, const unsigned char *in, unsigned long inlen); +int f9_done(f9_state *f9, unsigned char *out, unsigned long *outlen); +int f9_memory(int cipher, + const unsigned char *key, unsigned long keylen, + const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen); +int f9_memory_multi(int cipher, + const unsigned char *key, unsigned long keylen, + unsigned char *out, unsigned long *outlen, + const unsigned char *in, unsigned long inlen, ...); +int f9_file(int cipher, + const unsigned char *key, unsigned long keylen, + const char *filename, + unsigned char *out, unsigned long *outlen); +int f9_test(void); + +#endif + + +/* $Source: /cvs/libtom/libtomcrypt/src/headers/tomcrypt_mac.h,v $ */ +/* $Revision: 1.23 $ */ +/* $Date: 2007/05/12 14:37:41 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_macros.h b/dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_macros.h new file mode 100644 index 00000000000..53bda9bb4ba --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_macros.h @@ -0,0 +1,424 @@ +/* fix for MSVC ...evil! */ +#ifdef _MSC_VER + #define CONST64(n) n ## ui64 + typedef unsigned __int64 ulong64; +#else + #define CONST64(n) n ## ULL + typedef unsigned long long ulong64; +#endif + +/* this is the "32-bit at least" data type + * Re-define it to suit your platform but it must be at least 32-bits + */ +#if defined(__x86_64__) || (defined(__sparc__) && defined(__arch64__)) + typedef unsigned ulong32; +#else + typedef unsigned long ulong32; +#endif + +/* ---- HELPER MACROS ---- */ +#ifdef ENDIAN_NEUTRAL + +#define STORE32L(x, y) \ + { (y)[3] = (unsigned char)(((x)>>24)&255); (y)[2] = (unsigned char)(((x)>>16)&255); \ + (y)[1] = (unsigned char)(((x)>>8)&255); (y)[0] = (unsigned char)((x)&255); } + +#define LOAD32L(x, y) \ + { x = ((unsigned long)((y)[3] & 255)<<24) | \ + ((unsigned long)((y)[2] & 255)<<16) | \ + ((unsigned long)((y)[1] & 255)<<8) | \ + ((unsigned long)((y)[0] & 255)); } + +#define STORE64L(x, y) \ + { (y)[7] = (unsigned char)(((x)>>56)&255); (y)[6] = (unsigned char)(((x)>>48)&255); \ + (y)[5] = (unsigned char)(((x)>>40)&255); (y)[4] = (unsigned char)(((x)>>32)&255); \ + (y)[3] = (unsigned char)(((x)>>24)&255); (y)[2] = (unsigned char)(((x)>>16)&255); \ + (y)[1] = (unsigned char)(((x)>>8)&255); (y)[0] = (unsigned char)((x)&255); } + +#define LOAD64L(x, y) \ + { x = (((ulong64)((y)[7] & 255))<<56)|(((ulong64)((y)[6] & 255))<<48)| \ + (((ulong64)((y)[5] & 255))<<40)|(((ulong64)((y)[4] & 255))<<32)| \ + (((ulong64)((y)[3] & 255))<<24)|(((ulong64)((y)[2] & 255))<<16)| \ + (((ulong64)((y)[1] & 255))<<8)|(((ulong64)((y)[0] & 255))); } + +#define STORE32H(x, y) \ + { (y)[0] = (unsigned char)(((x)>>24)&255); (y)[1] = (unsigned char)(((x)>>16)&255); \ + (y)[2] = (unsigned char)(((x)>>8)&255); (y)[3] = (unsigned char)((x)&255); } + +#define LOAD32H(x, y) \ + { x = ((unsigned long)((y)[0] & 255)<<24) | \ + ((unsigned long)((y)[1] & 255)<<16) | \ + ((unsigned long)((y)[2] & 255)<<8) | \ + ((unsigned long)((y)[3] & 255)); } + +#define STORE64H(x, y) \ + { (y)[0] = (unsigned char)(((x)>>56)&255); (y)[1] = (unsigned char)(((x)>>48)&255); \ + (y)[2] = (unsigned char)(((x)>>40)&255); (y)[3] = (unsigned char)(((x)>>32)&255); \ + (y)[4] = (unsigned char)(((x)>>24)&255); (y)[5] = (unsigned char)(((x)>>16)&255); \ + (y)[6] = (unsigned char)(((x)>>8)&255); (y)[7] = (unsigned char)((x)&255); } + +#define LOAD64H(x, y) \ + { x = (((ulong64)((y)[0] & 255))<<56)|(((ulong64)((y)[1] & 255))<<48) | \ + (((ulong64)((y)[2] & 255))<<40)|(((ulong64)((y)[3] & 255))<<32) | \ + (((ulong64)((y)[4] & 255))<<24)|(((ulong64)((y)[5] & 255))<<16) | \ + (((ulong64)((y)[6] & 255))<<8)|(((ulong64)((y)[7] & 255))); } + +#endif /* ENDIAN_NEUTRAL */ + +#ifdef ENDIAN_LITTLE + +#if !defined(LTC_NO_BSWAP) && (defined(INTEL_CC) || (defined(__GNUC__) && (defined(__DJGPP__) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__i386__) || defined(__x86_64__)))) + +#define STORE32H(x, y) \ +asm __volatile__ ( \ + "bswapl %0 \n\t" \ + "movl %0,(%1)\n\t" \ + "bswapl %0 \n\t" \ + ::"r"(x), "r"(y)); + +#define LOAD32H(x, y) \ +asm __volatile__ ( \ + "movl (%1),%0\n\t" \ + "bswapl %0\n\t" \ + :"=r"(x): "r"(y)); + +#else + +#define STORE32H(x, y) \ + { (y)[0] = (unsigned char)(((x)>>24)&255); (y)[1] = (unsigned char)(((x)>>16)&255); \ + (y)[2] = (unsigned char)(((x)>>8)&255); (y)[3] = (unsigned char)((x)&255); } + +#define LOAD32H(x, y) \ + { x = ((unsigned long)((y)[0] & 255)<<24) | \ + ((unsigned long)((y)[1] & 255)<<16) | \ + ((unsigned long)((y)[2] & 255)<<8) | \ + ((unsigned long)((y)[3] & 255)); } + +#endif + + +/* x86_64 processor */ +#if !defined(LTC_NO_BSWAP) && (defined(__GNUC__) && defined(__x86_64__)) + +#define STORE64H(x, y) \ +asm __volatile__ ( \ + "bswapq %0 \n\t" \ + "movq %0,(%1)\n\t" \ + "bswapq %0 \n\t" \ + ::"r"(x), "r"(y)); + +#define LOAD64H(x, y) \ +asm __volatile__ ( \ + "movq (%1),%0\n\t" \ + "bswapq %0\n\t" \ + :"=r"(x): "r"(y)); + +#else + +#define STORE64H(x, y) \ + { (y)[0] = (unsigned char)(((x)>>56)&255); (y)[1] = (unsigned char)(((x)>>48)&255); \ + (y)[2] = (unsigned char)(((x)>>40)&255); (y)[3] = (unsigned char)(((x)>>32)&255); \ + (y)[4] = (unsigned char)(((x)>>24)&255); (y)[5] = (unsigned char)(((x)>>16)&255); \ + (y)[6] = (unsigned char)(((x)>>8)&255); (y)[7] = (unsigned char)((x)&255); } + +#define LOAD64H(x, y) \ + { x = (((ulong64)((y)[0] & 255))<<56)|(((ulong64)((y)[1] & 255))<<48) | \ + (((ulong64)((y)[2] & 255))<<40)|(((ulong64)((y)[3] & 255))<<32) | \ + (((ulong64)((y)[4] & 255))<<24)|(((ulong64)((y)[5] & 255))<<16) | \ + (((ulong64)((y)[6] & 255))<<8)|(((ulong64)((y)[7] & 255))); } + +#endif + +#ifdef ENDIAN_32BITWORD + +#define STORE32L(x, y) \ + { ulong32 __t = (x); XMEMCPY(y, &__t, 4); } + +#define LOAD32L(x, y) \ + XMEMCPY(&(x), y, 4); + +#define STORE64L(x, y) \ + { (y)[7] = (unsigned char)(((x)>>56)&255); (y)[6] = (unsigned char)(((x)>>48)&255); \ + (y)[5] = (unsigned char)(((x)>>40)&255); (y)[4] = (unsigned char)(((x)>>32)&255); \ + (y)[3] = (unsigned char)(((x)>>24)&255); (y)[2] = (unsigned char)(((x)>>16)&255); \ + (y)[1] = (unsigned char)(((x)>>8)&255); (y)[0] = (unsigned char)((x)&255); } + +#define LOAD64L(x, y) \ + { x = (((ulong64)((y)[7] & 255))<<56)|(((ulong64)((y)[6] & 255))<<48)| \ + (((ulong64)((y)[5] & 255))<<40)|(((ulong64)((y)[4] & 255))<<32)| \ + (((ulong64)((y)[3] & 255))<<24)|(((ulong64)((y)[2] & 255))<<16)| \ + (((ulong64)((y)[1] & 255))<<8)|(((ulong64)((y)[0] & 255))); } + +#else /* 64-bit words then */ + +#define STORE32L(x, y) \ + { ulong32 __t = (x); XMEMCPY(y, &__t, 4); } + +#define LOAD32L(x, y) \ + { XMEMCPY(&(x), y, 4); x &= 0xFFFFFFFF; } + +#define STORE64L(x, y) \ + { ulong64 __t = (x); XMEMCPY(y, &__t, 8); } + +#define LOAD64L(x, y) \ + { XMEMCPY(&(x), y, 8); } + +#endif /* ENDIAN_64BITWORD */ + +#endif /* ENDIAN_LITTLE */ + +#ifdef ENDIAN_BIG +#define STORE32L(x, y) \ + { (y)[3] = (unsigned char)(((x)>>24)&255); (y)[2] = (unsigned char)(((x)>>16)&255); \ + (y)[1] = (unsigned char)(((x)>>8)&255); (y)[0] = (unsigned char)((x)&255); } + +#define LOAD32L(x, y) \ + { x = ((unsigned long)((y)[3] & 255)<<24) | \ + ((unsigned long)((y)[2] & 255)<<16) | \ + ((unsigned long)((y)[1] & 255)<<8) | \ + ((unsigned long)((y)[0] & 255)); } + +#define STORE64L(x, y) \ + { (y)[7] = (unsigned char)(((x)>>56)&255); (y)[6] = (unsigned char)(((x)>>48)&255); \ + (y)[5] = (unsigned char)(((x)>>40)&255); (y)[4] = (unsigned char)(((x)>>32)&255); \ + (y)[3] = (unsigned char)(((x)>>24)&255); (y)[2] = (unsigned char)(((x)>>16)&255); \ + (y)[1] = (unsigned char)(((x)>>8)&255); (y)[0] = (unsigned char)((x)&255); } + +#define LOAD64L(x, y) \ + { x = (((ulong64)((y)[7] & 255))<<56)|(((ulong64)((y)[6] & 255))<<48) | \ + (((ulong64)((y)[5] & 255))<<40)|(((ulong64)((y)[4] & 255))<<32) | \ + (((ulong64)((y)[3] & 255))<<24)|(((ulong64)((y)[2] & 255))<<16) | \ + (((ulong64)((y)[1] & 255))<<8)|(((ulong64)((y)[0] & 255))); } + +#ifdef ENDIAN_32BITWORD + +#define STORE32H(x, y) \ + { ulong32 __t = (x); XMEMCPY(y, &__t, 4); } + +#define LOAD32H(x, y) \ + XMEMCPY(&(x), y, 4); + +#define STORE64H(x, y) \ + { (y)[0] = (unsigned char)(((x)>>56)&255); (y)[1] = (unsigned char)(((x)>>48)&255); \ + (y)[2] = (unsigned char)(((x)>>40)&255); (y)[3] = (unsigned char)(((x)>>32)&255); \ + (y)[4] = (unsigned char)(((x)>>24)&255); (y)[5] = (unsigned char)(((x)>>16)&255); \ + (y)[6] = (unsigned char)(((x)>>8)&255); (y)[7] = (unsigned char)((x)&255); } + +#define LOAD64H(x, y) \ + { x = (((ulong64)((y)[0] & 255))<<56)|(((ulong64)((y)[1] & 255))<<48)| \ + (((ulong64)((y)[2] & 255))<<40)|(((ulong64)((y)[3] & 255))<<32)| \ + (((ulong64)((y)[4] & 255))<<24)|(((ulong64)((y)[5] & 255))<<16)| \ + (((ulong64)((y)[6] & 255))<<8)| (((ulong64)((y)[7] & 255))); } + +#else /* 64-bit words then */ + +#define STORE32H(x, y) \ + { ulong32 __t = (x); XMEMCPY(y, &__t, 4); } + +#define LOAD32H(x, y) \ + { XMEMCPY(&(x), y, 4); x &= 0xFFFFFFFF; } + +#define STORE64H(x, y) \ + { ulong64 __t = (x); XMEMCPY(y, &__t, 8); } + +#define LOAD64H(x, y) \ + { XMEMCPY(&(x), y, 8); } + +#endif /* ENDIAN_64BITWORD */ +#endif /* ENDIAN_BIG */ + +#define BSWAP(x) ( ((x>>24)&0x000000FFUL) | ((x<<24)&0xFF000000UL) | \ + ((x>>8)&0x0000FF00UL) | ((x<<8)&0x00FF0000UL) ) + + +/* 32-bit Rotates */ +#if defined(_MSC_VER) + +/* instrinsic rotate */ +#include +#pragma intrinsic(_lrotr,_lrotl) +#define ROR(x,n) _lrotr(x,n) +#define ROL(x,n) _lrotl(x,n) +#define RORc(x,n) _lrotr(x,n) +#define ROLc(x,n) _lrotl(x,n) + +#elif !defined(__STRICT_ANSI__) && defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) && !defined(INTEL_CC) && !defined(LTC_NO_ASM) + +static inline unsigned ROL(unsigned word, int i) +{ + asm ("roll %%cl,%0" + :"=r" (word) + :"0" (word),"c" (i)); + return word; +} + +static inline unsigned ROR(unsigned word, int i) +{ + asm ("rorl %%cl,%0" + :"=r" (word) + :"0" (word),"c" (i)); + return word; +} + +#ifndef LTC_NO_ROLC + +static inline unsigned ROLc(unsigned word, const int i) +{ + asm ("roll %2,%0" + :"=r" (word) + :"0" (word),"I" (i)); + return word; +} + +static inline unsigned RORc(unsigned word, const int i) +{ + asm ("rorl %2,%0" + :"=r" (word) + :"0" (word),"I" (i)); + return word; +} + +#else + +#define ROLc ROL +#define RORc ROR + +#endif + +#elif !defined(__STRICT_ANSI__) && defined(LTC_PPC32) + +static inline unsigned ROL(unsigned word, int i) +{ + asm ("rotlw %0,%0,%2" + :"=r" (word) + :"0" (word),"r" (i)); + return word; +} + +static inline unsigned ROR(unsigned word, int i) +{ + asm ("rotlw %0,%0,%2" + :"=r" (word) + :"0" (word),"r" (32-i)); + return word; +} + +#ifndef LTC_NO_ROLC + +static inline unsigned ROLc(unsigned word, const int i) +{ + asm ("rotlwi %0,%0,%2" + :"=r" (word) + :"0" (word),"I" (i)); + return word; +} + +static inline unsigned RORc(unsigned word, const int i) +{ + asm ("rotrwi %0,%0,%2" + :"=r" (word) + :"0" (word),"I" (i)); + return word; +} + +#else + +#define ROLc ROL +#define RORc ROR + +#endif + + +#else + +/* rotates the hard way */ +#define ROL(x, y) ( (((unsigned long)(x)<<(unsigned long)((y)&31)) | (((unsigned long)(x)&0xFFFFFFFFUL)>>(unsigned long)(32-((y)&31)))) & 0xFFFFFFFFUL) +#define ROR(x, y) ( ((((unsigned long)(x)&0xFFFFFFFFUL)>>(unsigned long)((y)&31)) | ((unsigned long)(x)<<(unsigned long)(32-((y)&31)))) & 0xFFFFFFFFUL) +#define ROLc(x, y) ( (((unsigned long)(x)<<(unsigned long)((y)&31)) | (((unsigned long)(x)&0xFFFFFFFFUL)>>(unsigned long)(32-((y)&31)))) & 0xFFFFFFFFUL) +#define RORc(x, y) ( ((((unsigned long)(x)&0xFFFFFFFFUL)>>(unsigned long)((y)&31)) | ((unsigned long)(x)<<(unsigned long)(32-((y)&31)))) & 0xFFFFFFFFUL) + +#endif + + +/* 64-bit Rotates */ +#if !defined(__STRICT_ANSI__) && defined(__GNUC__) && defined(__x86_64__) && !defined(LTC_NO_ASM) + +static inline unsigned long ROL64(unsigned long word, int i) +{ + asm("rolq %%cl,%0" + :"=r" (word) + :"0" (word),"c" (i)); + return word; +} + +static inline unsigned long ROR64(unsigned long word, int i) +{ + asm("rorq %%cl,%0" + :"=r" (word) + :"0" (word),"c" (i)); + return word; +} + +#ifndef LTC_NO_ROLC + +static inline unsigned long ROL64c(unsigned long word, const int i) +{ + asm("rolq %2,%0" + :"=r" (word) + :"0" (word),"J" (i)); + return word; +} + +static inline unsigned long ROR64c(unsigned long word, const int i) +{ + asm("rorq %2,%0" + :"=r" (word) + :"0" (word),"J" (i)); + return word; +} + +#else /* LTC_NO_ROLC */ + +#define ROL64c ROL64 +#define ROR64c ROR64 + +#endif + +#else /* Not x86_64 */ + +#define ROL64(x, y) \ + ( (((x)<<((ulong64)(y)&63)) | \ + (((x)&CONST64(0xFFFFFFFFFFFFFFFF))>>((ulong64)64-((y)&63)))) & CONST64(0xFFFFFFFFFFFFFFFF)) + +#define ROR64(x, y) \ + ( ((((x)&CONST64(0xFFFFFFFFFFFFFFFF))>>((ulong64)(y)&CONST64(63))) | \ + ((x)<<((ulong64)(64-((y)&CONST64(63)))))) & CONST64(0xFFFFFFFFFFFFFFFF)) + +#define ROL64c(x, y) \ + ( (((x)<<((ulong64)(y)&63)) | \ + (((x)&CONST64(0xFFFFFFFFFFFFFFFF))>>((ulong64)64-((y)&63)))) & CONST64(0xFFFFFFFFFFFFFFFF)) + +#define ROR64c(x, y) \ + ( ((((x)&CONST64(0xFFFFFFFFFFFFFFFF))>>((ulong64)(y)&CONST64(63))) | \ + ((x)<<((ulong64)(64-((y)&CONST64(63)))))) & CONST64(0xFFFFFFFFFFFFFFFF)) + +#endif + +#ifndef MAX + #define MAX(x, y) ( ((x)>(y))?(x):(y) ) +#endif + +#ifndef MIN + #define MIN(x, y) ( ((x)<(y))?(x):(y) ) +#endif + +/* extract a byte portably */ +#ifdef _MSC_VER + #define byte(x, n) ((unsigned char)((x) >> (8 * (n)))) +#else + #define byte(x, n) (((x) >> (8 * (n))) & 255) +#endif + +/* $Source: /cvs/libtom/libtomcrypt/src/headers/tomcrypt_macros.h,v $ */ +/* $Revision: 1.15 $ */ +/* $Date: 2006/11/29 23:43:57 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_math.h b/dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_math.h new file mode 100644 index 00000000000..a05d7fff942 --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_math.h @@ -0,0 +1,500 @@ +/** math functions **/ + +#define LTC_MP_LT -1 +#define LTC_MP_EQ 0 +#define LTC_MP_GT 1 + +#define LTC_MP_NO 0 +#define LTC_MP_YES 1 + +#ifndef LTC_MECC + typedef void ecc_point; +#endif + +#ifndef LTC_MRSA + typedef void rsa_key; +#endif + +/** math descriptor */ +typedef struct { + /** Name of the math provider */ + char *name; + + /** Bits per digit, amount of bits must fit in an unsigned long */ + int bits_per_digit; + +/* ---- init/deinit functions ---- */ + + /** initialize a bignum + @param a The number to initialize + @return CRYPT_OK on success + */ + int (*init)(void **a); + + /** init copy + @param dst The number to initialize and write to + @param src The number to copy from + @return CRYPT_OK on success + */ + int (*init_copy)(void **dst, void *src); + + /** deinit + @param a The number to free + @return CRYPT_OK on success + */ + void (*deinit)(void *a); + +/* ---- data movement ---- */ + + /** negate + @param src The number to negate + @param dst The destination + @return CRYPT_OK on success + */ + int (*neg)(void *src, void *dst); + + /** copy + @param src The number to copy from + @param dst The number to write to + @return CRYPT_OK on success + */ + int (*copy)(void *src, void *dst); + +/* ---- trivial low level functions ---- */ + + /** set small constant + @param a Number to write to + @param n Source upto bits_per_digit (actually meant for very small constants) + @return CRYPT_OK on succcess + */ + int (*set_int)(void *a, unsigned long n); + + /** get small constant + @param a Number to read, only fetches upto bits_per_digit from the number + @return The lower bits_per_digit of the integer (unsigned) + */ + unsigned long (*get_int)(void *a); + + /** get digit n + @param a The number to read from + @param n The number of the digit to fetch + @return The bits_per_digit sized n'th digit of a + */ + unsigned long (*get_digit)(void *a, int n); + + /** Get the number of digits that represent the number + @param a The number to count + @return The number of digits used to represent the number + */ + int (*get_digit_count)(void *a); + + /** compare two integers + @param a The left side integer + @param b The right side integer + @return LTC_MP_LT if a < b, LTC_MP_GT if a > b and LTC_MP_EQ otherwise. (signed comparison) + */ + int (*compare)(void *a, void *b); + + /** compare against int + @param a The left side integer + @param b The right side integer (upto bits_per_digit) + @return LTC_MP_LT if a < b, LTC_MP_GT if a > b and LTC_MP_EQ otherwise. (signed comparison) + */ + int (*compare_d)(void *a, unsigned long n); + + /** Count the number of bits used to represent the integer + @param a The integer to count + @return The number of bits required to represent the integer + */ + int (*count_bits)(void * a); + + /** Count the number of LSB bits which are zero + @param a The integer to count + @return The number of contiguous zero LSB bits + */ + int (*count_lsb_bits)(void *a); + + /** Compute a power of two + @param a The integer to store the power in + @param n The power of two you want to store (a = 2^n) + @return CRYPT_OK on success + */ + int (*twoexpt)(void *a , int n); + +/* ---- radix conversions ---- */ + + /** read ascii string + @param a The integer to store into + @param str The string to read + @param radix The radix the integer has been represented in (2-64) + @return CRYPT_OK on success + */ + int (*read_radix)(void *a, const char *str, int radix); + + /** write number to string + @param a The integer to store + @param str The destination for the string + @param radix The radix the integer is to be represented in (2-64) + @return CRYPT_OK on success + */ + int (*write_radix)(void *a, char *str, int radix); + + /** get size as unsigned char string + @param a The integer to get the size (when stored in array of octets) + @return The length of the integer + */ + unsigned long (*unsigned_size)(void *a); + + /** store an integer as an array of octets + @param src The integer to store + @param dst The buffer to store the integer in + @return CRYPT_OK on success + */ + int (*unsigned_write)(void *src, unsigned char *dst); + + /** read an array of octets and store as integer + @param dst The integer to load + @param src The array of octets + @param len The number of octets + @return CRYPT_OK on success + */ + int (*unsigned_read)(void *dst, unsigned char *src, unsigned long len); + +/* ---- basic math ---- */ + + /** add two integers + @param a The first source integer + @param b The second source integer + @param c The destination of "a + b" + @return CRYPT_OK on success + */ + int (*add)(void *a, void *b, void *c); + + + /** add two integers + @param a The first source integer + @param b The second source integer (single digit of upto bits_per_digit in length) + @param c The destination of "a + b" + @return CRYPT_OK on success + */ + int (*addi)(void *a, unsigned long b, void *c); + + /** subtract two integers + @param a The first source integer + @param b The second source integer + @param c The destination of "a - b" + @return CRYPT_OK on success + */ + int (*sub)(void *a, void *b, void *c); + + /** subtract two integers + @param a The first source integer + @param b The second source integer (single digit of upto bits_per_digit in length) + @param c The destination of "a - b" + @return CRYPT_OK on success + */ + int (*subi)(void *a, unsigned long b, void *c); + + /** multiply two integers + @param a The first source integer + @param b The second source integer (single digit of upto bits_per_digit in length) + @param c The destination of "a * b" + @return CRYPT_OK on success + */ + int (*mul)(void *a, void *b, void *c); + + /** multiply two integers + @param a The first source integer + @param b The second source integer (single digit of upto bits_per_digit in length) + @param c The destination of "a * b" + @return CRYPT_OK on success + */ + int (*muli)(void *a, unsigned long b, void *c); + + /** Square an integer + @param a The integer to square + @param b The destination + @return CRYPT_OK on success + */ + int (*sqr)(void *a, void *b); + + /** Divide an integer + @param a The dividend + @param b The divisor + @param c The quotient (can be NULL to signify don't care) + @param d The remainder (can be NULL to signify don't care) + @return CRYPT_OK on success + */ + int (*mpdiv)(void *a, void *b, void *c, void *d); + + /** divide by two + @param a The integer to divide (shift right) + @param b The destination + @return CRYPT_OK on success + */ + int (*div_2)(void *a, void *b); + + /** Get remainder (small value) + @param a The integer to reduce + @param b The modulus (upto bits_per_digit in length) + @param c The destination for the residue + @return CRYPT_OK on success + */ + int (*modi)(void *a, unsigned long b, unsigned long *c); + + /** gcd + @param a The first integer + @param b The second integer + @param c The destination for (a, b) + @return CRYPT_OK on success + */ + int (*gcd)(void *a, void *b, void *c); + + /** lcm + @param a The first integer + @param b The second integer + @param c The destination for [a, b] + @return CRYPT_OK on success + */ + int (*lcm)(void *a, void *b, void *c); + + /** Modular multiplication + @param a The first source + @param b The second source + @param c The modulus + @param d The destination (a*b mod c) + @return CRYPT_OK on success + */ + int (*mulmod)(void *a, void *b, void *c, void *d); + + /** Modular squaring + @param a The first source + @param b The modulus + @param c The destination (a*a mod b) + @return CRYPT_OK on success + */ + int (*sqrmod)(void *a, void *b, void *c); + + /** Modular inversion + @param a The value to invert + @param b The modulus + @param c The destination (1/a mod b) + @return CRYPT_OK on success + */ + int (*invmod)(void *, void *, void *); + +/* ---- reduction ---- */ + + /** setup montgomery + @param a The modulus + @param b The destination for the reduction digit + @return CRYPT_OK on success + */ + int (*montgomery_setup)(void *a, void **b); + + /** get normalization value + @param a The destination for the normalization value + @param b The modulus + @return CRYPT_OK on success + */ + int (*montgomery_normalization)(void *a, void *b); + + /** reduce a number + @param a The number [and dest] to reduce + @param b The modulus + @param c The value "b" from montgomery_setup() + @return CRYPT_OK on success + */ + int (*montgomery_reduce)(void *a, void *b, void *c); + + /** clean up (frees memory) + @param a The value "b" from montgomery_setup() + @return CRYPT_OK on success + */ + void (*montgomery_deinit)(void *a); + +/* ---- exponentiation ---- */ + + /** Modular exponentiation + @param a The base integer + @param b The power (can be negative) integer + @param c The modulus integer + @param d The destination + @return CRYPT_OK on success + */ + int (*exptmod)(void *a, void *b, void *c, void *d); + + /** Primality testing + @param a The integer to test + @param b The destination of the result (FP_YES if prime) + @return CRYPT_OK on success + */ + int (*isprime)(void *a, int *b); + +/* ---- (optional) ecc point math ---- */ + + /** ECC GF(p) point multiplication (from the NIST curves) + @param k The integer to multiply the point by + @param G The point to multiply + @param R The destination for kG + @param modulus The modulus for the field + @param map Boolean indicated whether to map back to affine or not (can be ignored if you work in affine only) + @return CRYPT_OK on success + */ + int (*ecc_ptmul)(void *k, ecc_point *G, ecc_point *R, void *modulus, int map); + + /** ECC GF(p) point addition + @param P The first point + @param Q The second point + @param R The destination of P + Q + @param modulus The modulus + @param mp The "b" value from montgomery_setup() + @return CRYPT_OK on success + */ + int (*ecc_ptadd)(ecc_point *P, ecc_point *Q, ecc_point *R, void *modulus, void *mp); + + /** ECC GF(p) point double + @param P The first point + @param R The destination of 2P + @param modulus The modulus + @param mp The "b" value from montgomery_setup() + @return CRYPT_OK on success + */ + int (*ecc_ptdbl)(ecc_point *P, ecc_point *R, void *modulus, void *mp); + + /** ECC mapping from projective to affine, currently uses (x,y,z) => (x/z^2, y/z^3, 1) + @param P The point to map + @param modulus The modulus + @param mp The "b" value from montgomery_setup() + @return CRYPT_OK on success + @remark The mapping can be different but keep in mind a ecc_point only has three + integers (x,y,z) so if you use a different mapping you have to make it fit. + */ + int (*ecc_map)(ecc_point *P, void *modulus, void *mp); + + /** Computes kA*A + kB*B = C using Shamir's Trick + @param A First point to multiply + @param kA What to multiple A by + @param B Second point to multiply + @param kB What to multiple B by + @param C [out] Destination point (can overlap with A or B + @param modulus Modulus for curve + @return CRYPT_OK on success + */ + int (*ecc_mul2add)(ecc_point *A, void *kA, + ecc_point *B, void *kB, + ecc_point *C, + void *modulus); + +/* ---- (optional) rsa optimized math (for internal CRT) ---- */ + + /** RSA Key Generation + @param prng An active PRNG state + @param wprng The index of the PRNG desired + @param size The size of the modulus (key size) desired (octets) + @param e The "e" value (public key). e==65537 is a good choice + @param key [out] Destination of a newly created private key pair + @return CRYPT_OK if successful, upon error all allocated ram is freed + */ + int (*rsa_keygen)(prng_state *prng, int wprng, int size, long e, rsa_key *key); + + + /** RSA exponentiation + @param in The octet array representing the base + @param inlen The length of the input + @param out The destination (to be stored in an octet array format) + @param outlen The length of the output buffer and the resulting size (zero padded to the size of the modulus) + @param which PK_PUBLIC for public RSA and PK_PRIVATE for private RSA + @param key The RSA key to use + @return CRYPT_OK on success + */ + int (*rsa_me)(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen, int which, + rsa_key *key); +} ltc_math_descriptor; + +extern ltc_math_descriptor ltc_mp; + +int ltc_init_multi(void **a, ...); +void ltc_deinit_multi(void *a, ...); + +#ifdef LTM_DESC +extern const ltc_math_descriptor ltm_desc; +#endif + +#ifdef TFM_DESC +extern const ltc_math_descriptor tfm_desc; +#endif + +#ifdef GMP_DESC +extern const ltc_math_descriptor gmp_desc; +#endif + +#if !defined(DESC_DEF_ONLY) && defined(LTC_SOURCE) + +#define MP_DIGIT_BIT ltc_mp.bits_per_digit + +/* some handy macros */ +#define mp_init(a) ltc_mp.init(a) +#define mp_init_multi ltc_init_multi +#define mp_clear(a) ltc_mp.deinit(a) +#define mp_clear_multi ltc_deinit_multi +#define mp_init_copy(a, b) ltc_mp.init_copy(a, b) + +#define mp_neg(a, b) ltc_mp.neg(a, b) +#define mp_copy(a, b) ltc_mp.copy(a, b) + +#define mp_set(a, b) ltc_mp.set_int(a, b) +#define mp_set_int(a, b) ltc_mp.set_int(a, b) +#define mp_get_int(a) ltc_mp.get_int(a) +#define mp_get_digit(a, n) ltc_mp.get_digit(a, n) +#define mp_get_digit_count(a) ltc_mp.get_digit_count(a) +#define mp_cmp(a, b) ltc_mp.compare(a, b) +#define mp_cmp_d(a, b) ltc_mp.compare_d(a, b) +#define mp_count_bits(a) ltc_mp.count_bits(a) +#define mp_cnt_lsb(a) ltc_mp.count_lsb_bits(a) +#define mp_2expt(a, b) ltc_mp.twoexpt(a, b) + +#define mp_read_radix(a, b, c) ltc_mp.read_radix(a, b, c) +#define mp_toradix(a, b, c) ltc_mp.write_radix(a, b, c) +#define mp_unsigned_bin_size(a) ltc_mp.unsigned_size(a) +#define mp_to_unsigned_bin(a, b) ltc_mp.unsigned_write(a, b) +#define mp_read_unsigned_bin(a, b, c) ltc_mp.unsigned_read(a, b, c) + +#define mp_add(a, b, c) ltc_mp.add(a, b, c) +#define mp_add_d(a, b, c) ltc_mp.addi(a, b, c) +#define mp_sub(a, b, c) ltc_mp.sub(a, b, c) +#define mp_sub_d(a, b, c) ltc_mp.subi(a, b, c) +#define mp_mul(a, b, c) ltc_mp.mul(a, b, c) +#define mp_mul_d(a, b, c) ltc_mp.muli(a, b, c) +#define mp_sqr(a, b) ltc_mp.sqr(a, b) +#define mp_div(a, b, c, d) ltc_mp.mpdiv(a, b, c, d) +#define mp_div_2(a, b) ltc_mp.div_2(a, b) +#define mp_mod(a, b, c) ltc_mp.mpdiv(a, b, NULL, c) +#define mp_mod_d(a, b, c) ltc_mp.modi(a, b, c) +#define mp_gcd(a, b, c) ltc_mp.gcd(a, b, c) +#define mp_lcm(a, b, c) ltc_mp.lcm(a, b, c) + +#define mp_mulmod(a, b, c, d) ltc_mp.mulmod(a, b, c, d) +#define mp_sqrmod(a, b, c) ltc_mp.sqrmod(a, b, c) +#define mp_invmod(a, b, c) ltc_mp.invmod(a, b, c) + +#define mp_montgomery_setup(a, b) ltc_mp.montgomery_setup(a, b) +#define mp_montgomery_normalization(a, b) ltc_mp.montgomery_normalization(a, b) +#define mp_montgomery_reduce(a, b, c) ltc_mp.montgomery_reduce(a, b, c) +#define mp_montgomery_free(a) ltc_mp.montgomery_deinit(a) + +#define mp_exptmod(a,b,c,d) ltc_mp.exptmod(a,b,c,d) +#define mp_prime_is_prime(a, b, c) ltc_mp.isprime(a, c) + +#define mp_iszero(a) (mp_cmp_d(a, 0) == LTC_MP_EQ ? LTC_MP_YES : LTC_MP_NO) +#define mp_isodd(a) (mp_get_digit_count(a) > 0 ? (mp_get_digit(a, 0) & 1 ? LTC_MP_YES : LTC_MP_NO) : LTC_MP_NO) +#define mp_exch(a, b) do { void *ABC__tmp = a; a = b; b = ABC__tmp; } while(0); + +#define mp_tohex(a, b) mp_toradix(a, b, 16) + +#endif + +/* $Source: /cvs/libtom/libtomcrypt/src/headers/tomcrypt_math.h,v $ */ +/* $Revision: 1.44 $ */ +/* $Date: 2007/05/12 14:32:35 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_misc.h b/dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_misc.h new file mode 100644 index 00000000000..f5384cacc51 --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_misc.h @@ -0,0 +1,23 @@ +/* ---- LTC_BASE64 Routines ---- */ +#ifdef LTC_BASE64 +int base64_encode(const unsigned char *in, unsigned long len, + unsigned char *out, unsigned long *outlen); + +int base64_decode(const unsigned char *in, unsigned long len, + unsigned char *out, unsigned long *outlen); +#endif + +/* ---- MEM routines ---- */ +void zeromem(void *dst, size_t len); +void burn_stack(unsigned long len); + +const char *error_to_string(int err); + +extern const char *crypt_build_settings; + +/* ---- HMM ---- */ +int crypt_fsa(void *mp, ...); + +/* $Source: /cvs/libtom/libtomcrypt/src/headers/tomcrypt_misc.h,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2007/05/12 14:32:35 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_pk.h b/dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_pk.h new file mode 100644 index 00000000000..b5f277a8848 --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_pk.h @@ -0,0 +1,558 @@ +/* ---- NUMBER THEORY ---- */ + +enum { + PK_PUBLIC=0, + PK_PRIVATE=1 +}; + +int rand_prime(void *N, long len, prng_state *prng, int wprng); + +/* ---- RSA ---- */ +#ifdef LTC_MRSA + +/* Min and Max RSA key sizes (in bits) */ +#define MIN_RSA_SIZE 1024 +#define MAX_RSA_SIZE 4096 + +/** RSA LTC_PKCS style key */ +typedef struct Rsa_key { + /** Type of key, PK_PRIVATE or PK_PUBLIC */ + int type; + /** The public exponent */ + void *e; + /** The private exponent */ + void *d; + /** The modulus */ + void *N; + /** The p factor of N */ + void *p; + /** The q factor of N */ + void *q; + /** The 1/q mod p CRT param */ + void *qP; + /** The d mod (p - 1) CRT param */ + void *dP; + /** The d mod (q - 1) CRT param */ + void *dQ; +} rsa_key; + +int rsa_make_key(prng_state *prng, int wprng, int size, long e, rsa_key *key); + +int rsa_exptmod(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen, int which, + rsa_key *key); + +void rsa_free(rsa_key *key); + +/* These use LTC_PKCS #1 v2.0 padding */ +#define rsa_encrypt_key(_in, _inlen, _out, _outlen, _lparam, _lparamlen, _prng, _prng_idx, _hash_idx, _key) \ + rsa_encrypt_key_ex(_in, _inlen, _out, _outlen, _lparam, _lparamlen, _prng, _prng_idx, _hash_idx, LTC_LTC_PKCS_1_OAEP, _key) + +#define rsa_decrypt_key(_in, _inlen, _out, _outlen, _lparam, _lparamlen, _hash_idx, _stat, _key) \ + rsa_decrypt_key_ex(_in, _inlen, _out, _outlen, _lparam, _lparamlen, _hash_idx, LTC_LTC_PKCS_1_OAEP, _stat, _key) + +#define rsa_sign_hash(_in, _inlen, _out, _outlen, _prng, _prng_idx, _hash_idx, _saltlen, _key) \ + rsa_sign_hash_ex(_in, _inlen, _out, _outlen, LTC_LTC_PKCS_1_PSS, _prng, _prng_idx, _hash_idx, _saltlen, _key) + +#define rsa_verify_hash(_sig, _siglen, _hash, _hashlen, _hash_idx, _saltlen, _stat, _key) \ + rsa_verify_hash_ex(_sig, _siglen, _hash, _hashlen, LTC_LTC_PKCS_1_PSS, _hash_idx, _saltlen, _stat, _key) + +/* These can be switched between LTC_PKCS #1 v2.x and LTC_PKCS #1 v1.5 paddings */ +int rsa_encrypt_key_ex(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen, + const unsigned char *lparam, unsigned long lparamlen, + prng_state *prng, int prng_idx, int hash_idx, int padding, rsa_key *key); + +int rsa_decrypt_key_ex(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen, + const unsigned char *lparam, unsigned long lparamlen, + int hash_idx, int padding, + int *stat, rsa_key *key); + +int rsa_sign_hash_ex(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen, + int padding, + prng_state *prng, int prng_idx, + int hash_idx, unsigned long saltlen, + rsa_key *key); + +int rsa_verify_hash_ex(const unsigned char *sig, unsigned long siglen, + const unsigned char *hash, unsigned long hashlen, + int padding, + int hash_idx, unsigned long saltlen, + int *stat, rsa_key *key); + +/* LTC_PKCS #1 import/export */ +int rsa_export(unsigned char *out, unsigned long *outlen, int type, rsa_key *key); +int rsa_import(const unsigned char *in, unsigned long inlen, rsa_key *key); + +/* Ladik: Added for verifying Blizzard strong signature verification */ +int rsa_verify_simple(const unsigned char *sig, unsigned long siglen, + const unsigned char *hash, unsigned long hashlen, + int *stat, + rsa_key *key); + +#endif + +/* ---- Katja ---- */ +#ifdef MKAT + +/* Min and Max KAT key sizes (in bits) */ +#define MIN_KAT_SIZE 1024 +#define MAX_KAT_SIZE 4096 + +/** Katja LTC_PKCS style key */ +typedef struct KAT_key { + /** Type of key, PK_PRIVATE or PK_PUBLIC */ + int type; + /** The private exponent */ + void *d; + /** The modulus */ + void *N; + /** The p factor of N */ + void *p; + /** The q factor of N */ + void *q; + /** The 1/q mod p CRT param */ + void *qP; + /** The d mod (p - 1) CRT param */ + void *dP; + /** The d mod (q - 1) CRT param */ + void *dQ; + /** The pq param */ + void *pq; +} katja_key; + +int katja_make_key(prng_state *prng, int wprng, int size, katja_key *key); + +int katja_exptmod(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen, int which, + katja_key *key); + +void katja_free(katja_key *key); + +/* These use LTC_PKCS #1 v2.0 padding */ +int katja_encrypt_key(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen, + const unsigned char *lparam, unsigned long lparamlen, + prng_state *prng, int prng_idx, int hash_idx, katja_key *key); + +int katja_decrypt_key(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen, + const unsigned char *lparam, unsigned long lparamlen, + int hash_idx, int *stat, + katja_key *key); + +/* LTC_PKCS #1 import/export */ +int katja_export(unsigned char *out, unsigned long *outlen, int type, katja_key *key); +int katja_import(const unsigned char *in, unsigned long inlen, katja_key *key); + +#endif + +/* ---- ECC Routines ---- */ +#ifdef LTC_MECC + +/* size of our temp buffers for exported keys */ +#define ECC_BUF_SIZE 256 + +/* max private key size */ +#define ECC_MAXSIZE 66 + +/** Structure defines a NIST GF(p) curve */ +typedef struct { + /** The size of the curve in octets */ + int size; + + /** name of curve */ + char *name; + + /** The prime that defines the field the curve is in (encoded in hex) */ + char *prime; + + /** The fields B param (hex) */ + char *B; + + /** The order of the curve (hex) */ + char *order; + + /** The x co-ordinate of the base point on the curve (hex) */ + char *Gx; + + /** The y co-ordinate of the base point on the curve (hex) */ + char *Gy; +} ltc_ecc_set_type; + +/** A point on a ECC curve, stored in Jacbobian format such that (x,y,z) => (x/z^2, y/z^3, 1) when interpretted as affine */ +typedef struct { + /** The x co-ordinate */ + void *x; + + /** The y co-ordinate */ + void *y; + + /** The z co-ordinate */ + void *z; +} ecc_point; + +/** An ECC key */ +typedef struct { + /** Type of key, PK_PRIVATE or PK_PUBLIC */ + int type; + + /** Index into the ltc_ecc_sets[] for the parameters of this curve; if -1, then this key is using user supplied curve in dp */ + int idx; + + /** pointer to domain parameters; either points to NIST curves (identified by idx >= 0) or user supplied curve */ + const ltc_ecc_set_type *dp; + + /** The public key */ + ecc_point pubkey; + + /** The private key */ + void *k; +} ecc_key; + +/** the ECC params provided */ +extern const ltc_ecc_set_type ltc_ecc_sets[]; + +int ecc_test(void); +void ecc_sizes(int *low, int *high); +int ecc_get_size(ecc_key *key); + +int ecc_make_key(prng_state *prng, int wprng, int keysize, ecc_key *key); +int ecc_make_key_ex(prng_state *prng, int wprng, ecc_key *key, const ltc_ecc_set_type *dp); +void ecc_free(ecc_key *key); + +int ecc_export(unsigned char *out, unsigned long *outlen, int type, ecc_key *key); +int ecc_import(const unsigned char *in, unsigned long inlen, ecc_key *key); +int ecc_import_ex(const unsigned char *in, unsigned long inlen, ecc_key *key, const ltc_ecc_set_type *dp); + +int ecc_ansi_x963_export(ecc_key *key, unsigned char *out, unsigned long *outlen); +int ecc_ansi_x963_import(const unsigned char *in, unsigned long inlen, ecc_key *key); +int ecc_ansi_x963_import_ex(const unsigned char *in, unsigned long inlen, ecc_key *key, ltc_ecc_set_type *dp); + +int ecc_shared_secret(ecc_key *private_key, ecc_key *public_key, + unsigned char *out, unsigned long *outlen); + +int ecc_encrypt_key(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen, + prng_state *prng, int wprng, int hash, + ecc_key *key); + +int ecc_decrypt_key(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen, + ecc_key *key); + +int ecc_sign_hash(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen, + prng_state *prng, int wprng, ecc_key *key); + +int ecc_verify_hash(const unsigned char *sig, unsigned long siglen, + const unsigned char *hash, unsigned long hashlen, + int *stat, ecc_key *key); + +/* low level functions */ +ecc_point *ltc_ecc_new_point(void); +void ltc_ecc_del_point(ecc_point *p); +int ltc_ecc_is_valid_idx(int n); + +/* point ops (mp == montgomery digit) */ +#if !defined(LTC_MECC_ACCEL) || defined(LTM_LTC_DESC) || defined(GMP_LTC_DESC) +/* R = 2P */ +int ltc_ecc_projective_dbl_point(ecc_point *P, ecc_point *R, void *modulus, void *mp); + +/* R = P + Q */ +int ltc_ecc_projective_add_point(ecc_point *P, ecc_point *Q, ecc_point *R, void *modulus, void *mp); +#endif + +#if defined(LTC_MECC_FP) +/* optimized point multiplication using fixed point cache (HAC algorithm 14.117) */ +int ltc_ecc_fp_mulmod(void *k, ecc_point *G, ecc_point *R, void *modulus, int map); + +/* functions for saving/loading/freeing/adding to fixed point cache */ +int ltc_ecc_fp_save_state(unsigned char **out, unsigned long *outlen); +int ltc_ecc_fp_restore_state(unsigned char *in, unsigned long inlen); +void ltc_ecc_fp_free(void); +int ltc_ecc_fp_add_point(ecc_point *g, void *modulus, int lock); + +/* lock/unlock all points currently in fixed point cache */ +void ltc_ecc_fp_tablelock(int lock); +#endif + +/* R = kG */ +int ltc_ecc_mulmod(void *k, ecc_point *G, ecc_point *R, void *modulus, int map); + +#ifdef LTC_ECC_SHAMIR +/* kA*A + kB*B = C */ +int ltc_ecc_mul2add(ecc_point *A, void *kA, + ecc_point *B, void *kB, + ecc_point *C, + void *modulus); + +#ifdef LTC_MECC_FP +/* Shamir's trick with optimized point multiplication using fixed point cache */ +int ltc_ecc_fp_mul2add(ecc_point *A, void *kA, + ecc_point *B, void *kB, + ecc_point *C, void *modulus); +#endif + +#endif + + +/* map P to affine from projective */ +int ltc_ecc_map(ecc_point *P, void *modulus, void *mp); + +#endif + +#ifdef LTC_MDSA + +/* Max diff between group and modulus size in bytes */ +#define LTC_MDSA_DELTA 512 + +/* Max DSA group size in bytes (default allows 4k-bit groups) */ +#define LTC_MDSA_MAX_GROUP 512 + +/** DSA key structure */ +typedef struct { + /** The key type, PK_PRIVATE or PK_PUBLIC */ + int type; + + /** The order of the sub-group used in octets */ + int qord; + + /** The generator */ + void *g; + + /** The prime used to generate the sub-group */ + void *q; + + /** The large prime that generats the field the contains the sub-group */ + void *p; + + /** The private key */ + void *x; + + /** The public key */ + void *y; +} dsa_key; + +int dsa_make_key(prng_state *prng, int wprng, int group_size, int modulus_size, dsa_key *key); +void dsa_free(dsa_key *key); + +int dsa_sign_hash_raw(const unsigned char *in, unsigned long inlen, + void *r, void *s, + prng_state *prng, int wprng, dsa_key *key); + +int dsa_sign_hash(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen, + prng_state *prng, int wprng, dsa_key *key); + +int dsa_verify_hash_raw( void *r, void *s, + const unsigned char *hash, unsigned long hashlen, + int *stat, dsa_key *key); + +int dsa_verify_hash(const unsigned char *sig, unsigned long siglen, + const unsigned char *hash, unsigned long hashlen, + int *stat, dsa_key *key); + +int dsa_encrypt_key(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen, + prng_state *prng, int wprng, int hash, + dsa_key *key); + +int dsa_decrypt_key(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen, + dsa_key *key); + +int dsa_import(const unsigned char *in, unsigned long inlen, dsa_key *key); +int dsa_export(unsigned char *out, unsigned long *outlen, int type, dsa_key *key); +int dsa_verify_key(dsa_key *key, int *stat); + +int dsa_shared_secret(void *private_key, void *base, + dsa_key *public_key, + unsigned char *out, unsigned long *outlen); +#endif + +#ifdef LTC_DER +/* DER handling */ + +enum { + LTC_ASN1_EOL, + LTC_ASN1_BOOLEAN, + LTC_ASN1_INTEGER, + LTC_ASN1_SHORT_INTEGER, + LTC_ASN1_BIT_STRING, + LTC_ASN1_OCTET_STRING, + LTC_ASN1_NULL, + LTC_ASN1_OBJECT_IDENTIFIER, + LTC_ASN1_IA5_STRING, + LTC_ASN1_PRINTABLE_STRING, + LTC_ASN1_UTF8_STRING, + LTC_ASN1_UTCTIME, + LTC_ASN1_CHOICE, + LTC_ASN1_SEQUENCE, + LTC_ASN1_SET, + LTC_ASN1_SETOF +}; + +/** A LTC ASN.1 list type */ +typedef struct ltc_asn1_list_ { + /** The LTC ASN.1 enumerated type identifier */ + int type; + /** The data to encode or place for decoding */ + void *data; + /** The size of the input or resulting output */ + unsigned long size; + /** The used flag, this is used by the CHOICE ASN.1 type to indicate which choice was made */ + int used; + /** prev/next entry in the list */ + struct ltc_asn1_list_ *prev, *next, *child, *parent; +} ltc_asn1_list; + +#define LTC_SET_ASN1(list, index, Type, Data, Size) \ + do { \ + int LTC_MACRO_temp = (index); \ + ltc_asn1_list *LTC_MACRO_list = (list); \ + LTC_MACRO_list[LTC_MACRO_temp].type = (Type); \ + LTC_MACRO_list[LTC_MACRO_temp].data = (void*)(Data); \ + LTC_MACRO_list[LTC_MACRO_temp].size = (Size); \ + LTC_MACRO_list[LTC_MACRO_temp].used = 0; \ + } while (0); + +/* SEQUENCE */ +int der_encode_sequence_ex(ltc_asn1_list *list, unsigned long inlen, + unsigned char *out, unsigned long *outlen, int type_of); + +#define der_encode_sequence(list, inlen, out, outlen) der_encode_sequence_ex(list, inlen, out, outlen, LTC_ASN1_SEQUENCE) + +int der_decode_sequence_ex(const unsigned char *in, unsigned long inlen, + ltc_asn1_list *list, unsigned long outlen, int ordered); + +#define der_decode_sequence(in, inlen, list, outlen) der_decode_sequence_ex(in, inlen, list, outlen, 1) + +int der_length_sequence(ltc_asn1_list *list, unsigned long inlen, + unsigned long *outlen); + +/* SET */ +#define der_decode_set(in, inlen, list, outlen) der_decode_sequence_ex(in, inlen, list, outlen, 0) +#define der_length_set der_length_sequence +int der_encode_set(ltc_asn1_list *list, unsigned long inlen, + unsigned char *out, unsigned long *outlen); + +int der_encode_setof(ltc_asn1_list *list, unsigned long inlen, + unsigned char *out, unsigned long *outlen); + +/* VA list handy helpers with triplets of */ +int der_encode_sequence_multi(unsigned char *out, unsigned long *outlen, ...); +int der_decode_sequence_multi(const unsigned char *in, unsigned long inlen, ...); + +/* FLEXI DECODER handle unknown list decoder */ +int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, ltc_asn1_list **out); +void der_free_sequence_flexi(ltc_asn1_list *list); +void der_sequence_free(ltc_asn1_list *in); + +/* BOOLEAN */ +int der_length_boolean(unsigned long *outlen); +int der_encode_boolean(int in, + unsigned char *out, unsigned long *outlen); +int der_decode_boolean(const unsigned char *in, unsigned long inlen, + int *out); +/* INTEGER */ +int der_encode_integer(void *num, unsigned char *out, unsigned long *outlen); +int der_decode_integer(const unsigned char *in, unsigned long inlen, void *num); +int der_length_integer(void *num, unsigned long *len); + +/* INTEGER -- handy for 0..2^32-1 values */ +int der_decode_short_integer(const unsigned char *in, unsigned long inlen, unsigned long *num); +int der_encode_short_integer(unsigned long num, unsigned char *out, unsigned long *outlen); +int der_length_short_integer(unsigned long num, unsigned long *outlen); + +/* BIT STRING */ +int der_encode_bit_string(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen); +int der_decode_bit_string(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen); +int der_length_bit_string(unsigned long nbits, unsigned long *outlen); + +/* OCTET STRING */ +int der_encode_octet_string(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen); +int der_decode_octet_string(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen); +int der_length_octet_string(unsigned long noctets, unsigned long *outlen); + +/* OBJECT IDENTIFIER */ +int der_encode_object_identifier(unsigned long *words, unsigned long nwords, + unsigned char *out, unsigned long *outlen); +int der_decode_object_identifier(const unsigned char *in, unsigned long inlen, + unsigned long *words, unsigned long *outlen); +int der_length_object_identifier(unsigned long *words, unsigned long nwords, unsigned long *outlen); +unsigned long der_object_identifier_bits(unsigned long x); + +/* IA5 STRING */ +int der_encode_ia5_string(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen); +int der_decode_ia5_string(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen); +int der_length_ia5_string(const unsigned char *octets, unsigned long noctets, unsigned long *outlen); + +int der_ia5_char_encode(int c); +int der_ia5_value_decode(int v); + +/* Printable STRING */ +int der_encode_printable_string(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen); +int der_decode_printable_string(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen); +int der_length_printable_string(const unsigned char *octets, unsigned long noctets, unsigned long *outlen); + +int der_printable_char_encode(int c); +int der_printable_value_decode(int v); + +/* UTF-8 */ +#if (defined(SIZE_MAX) || __STDC_VERSION__ >= 199901L || defined(WCHAR_MAX) || defined(_WCHAR_T) || defined(_WCHAR_T_DEFINED) || defined (__WCHAR_TYPE__)) && !defined(LTC_NO_WCHAR) +#include +#else +typedef ulong32 wchar_t; +#endif + +int der_encode_utf8_string(const wchar_t *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen); + +int der_decode_utf8_string(const unsigned char *in, unsigned long inlen, + wchar_t *out, unsigned long *outlen); +unsigned long der_utf8_charsize(const wchar_t c); +int der_length_utf8_string(const wchar_t *in, unsigned long noctets, unsigned long *outlen); + + +/* CHOICE */ +int der_decode_choice(const unsigned char *in, unsigned long *inlen, + ltc_asn1_list *list, unsigned long outlen); + +/* UTCTime */ +typedef struct { + unsigned YY, /* year */ + MM, /* month */ + DD, /* day */ + hh, /* hour */ + mm, /* minute */ + ss, /* second */ + off_dir, /* timezone offset direction 0 == +, 1 == - */ + off_hh, /* timezone offset hours */ + off_mm; /* timezone offset minutes */ +} ltc_utctime; + +int der_encode_utctime(ltc_utctime *utctime, + unsigned char *out, unsigned long *outlen); + +int der_decode_utctime(const unsigned char *in, unsigned long *inlen, + ltc_utctime *out); + +int der_length_utctime(ltc_utctime *utctime, unsigned long *outlen); + + +#endif + +/* $Source: /cvs/libtom/libtomcrypt/src/headers/tomcrypt_pk.h,v $ */ +/* $Revision: 1.81 $ */ +/* $Date: 2007/05/12 14:32:35 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_pkcs.h b/dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_pkcs.h new file mode 100644 index 00000000000..84fb82a6229 --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_pkcs.h @@ -0,0 +1,89 @@ +/* LTC_PKCS Header Info */ + +/* ===> LTC_PKCS #1 -- RSA Cryptography <=== */ +#ifdef LTC_PKCS_1 + +enum ltc_pkcs_1_v1_5_blocks +{ + LTC_LTC_PKCS_1_EMSA = 1, /* Block type 1 (LTC_PKCS #1 v1.5 signature padding) */ + LTC_LTC_PKCS_1_EME = 2 /* Block type 2 (LTC_PKCS #1 v1.5 encryption padding) */ +}; + +enum ltc_pkcs_1_paddings +{ + LTC_LTC_PKCS_1_V1_5 = 1, /* LTC_PKCS #1 v1.5 padding (\sa ltc_pkcs_1_v1_5_blocks) */ + LTC_LTC_PKCS_1_OAEP = 2, /* LTC_PKCS #1 v2.0 encryption padding */ + LTC_LTC_PKCS_1_PSS = 3 /* LTC_PKCS #1 v2.1 signature padding */ +}; + +int pkcs_1_mgf1( int hash_idx, + const unsigned char *seed, unsigned long seedlen, + unsigned char *mask, unsigned long masklen); + +int pkcs_1_i2osp(void *n, unsigned long modulus_len, unsigned char *out); +int pkcs_1_os2ip(void *n, unsigned char *in, unsigned long inlen); + +/* *** v1.5 padding */ +int pkcs_1_v1_5_encode(const unsigned char *msg, + unsigned long msglen, + int block_type, + unsigned long modulus_bitlen, + prng_state *prng, + int prng_idx, + unsigned char *out, + unsigned long *outlen); + +int pkcs_1_v1_5_decode(const unsigned char *msg, + unsigned long msglen, + int block_type, + unsigned long modulus_bitlen, + unsigned char *out, + unsigned long *outlen, + int *is_valid); + +/* *** v2.1 padding */ +int pkcs_1_oaep_encode(const unsigned char *msg, unsigned long msglen, + const unsigned char *lparam, unsigned long lparamlen, + unsigned long modulus_bitlen, prng_state *prng, + int prng_idx, int hash_idx, + unsigned char *out, unsigned long *outlen); + +int pkcs_1_oaep_decode(const unsigned char *msg, unsigned long msglen, + const unsigned char *lparam, unsigned long lparamlen, + unsigned long modulus_bitlen, int hash_idx, + unsigned char *out, unsigned long *outlen, + int *res); + +int pkcs_1_pss_encode(const unsigned char *msghash, unsigned long msghashlen, + unsigned long saltlen, prng_state *prng, + int prng_idx, int hash_idx, + unsigned long modulus_bitlen, + unsigned char *out, unsigned long *outlen); + +int pkcs_1_pss_decode(const unsigned char *msghash, unsigned long msghashlen, + const unsigned char *sig, unsigned long siglen, + unsigned long saltlen, int hash_idx, + unsigned long modulus_bitlen, int *res); + +#endif /* LTC_PKCS_1 */ + +/* ===> LTC_PKCS #5 -- Password Based Cryptography <=== */ +#ifdef LTC_PKCS_5 + +/* Algorithm #1 (old) */ +int pkcs_5_alg1(const unsigned char *password, unsigned long password_len, + const unsigned char *salt, + int iteration_count, int hash_idx, + unsigned char *out, unsigned long *outlen); + +/* Algorithm #2 (new) */ +int pkcs_5_alg2(const unsigned char *password, unsigned long password_len, + const unsigned char *salt, unsigned long salt_len, + int iteration_count, int hash_idx, + unsigned char *out, unsigned long *outlen); + +#endif /* LTC_PKCS_5 */ + +/* $Source: /cvs/libtom/libtomcrypt/src/headers/tomcrypt_pkcs.h,v $ */ +/* $Revision: 1.8 $ */ +/* $Date: 2007/05/12 14:32:35 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_prng.h b/dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_prng.h new file mode 100644 index 00000000000..f3e3e550e88 --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/headers/tomcrypt_prng.h @@ -0,0 +1,199 @@ +/* ---- PRNG Stuff ---- */ +#ifdef LTC_YARROW +struct yarrow_prng { + int cipher, hash; + unsigned char pool[MAXBLOCKSIZE]; + symmetric_CTR ctr; + LTC_MUTEX_TYPE(prng_lock) +}; +#endif + +#ifdef LTC_RC4 +struct rc4_prng { + int x, y; + unsigned char buf[256]; +}; +#endif + +#ifdef LTC_FORTUNA +struct fortuna_prng { + hash_state pool[LTC_FORTUNA_POOLS]; /* the pools */ + + symmetric_key skey; + + unsigned char K[32], /* the current key */ + IV[16]; /* IV for CTR mode */ + + unsigned long pool_idx, /* current pool we will add to */ + pool0_len, /* length of 0'th pool */ + wd; + + ulong64 reset_cnt; /* number of times we have reset */ + LTC_MUTEX_TYPE(prng_lock) +}; +#endif + +#ifdef LTC_SOBER128 +struct sober128_prng { + ulong32 R[17], /* Working storage for the shift register */ + initR[17], /* saved register contents */ + konst, /* key dependent constant */ + sbuf; /* partial word encryption buffer */ + + int nbuf, /* number of part-word stream bits buffered */ + flag, /* first add_entropy call or not? */ + set; /* did we call add_entropy to set key? */ + +}; +#endif + +typedef union Prng_state { + char dummy[1]; +#ifdef LTC_YARROW + struct yarrow_prng yarrow; +#endif +#ifdef LTC_RC4 + struct rc4_prng rc4; +#endif +#ifdef LTC_FORTUNA + struct fortuna_prng fortuna; +#endif +#ifdef LTC_SOBER128 + struct sober128_prng sober128; +#endif +} prng_state; + +/** PRNG descriptor */ +extern struct ltc_prng_descriptor { + /** Name of the PRNG */ + char *name; + /** size in bytes of exported state */ + int export_size; + /** Start a PRNG state + @param prng [out] The state to initialize + @return CRYPT_OK if successful + */ + int (*start)(prng_state *prng); + /** Add entropy to the PRNG + @param in The entropy + @param inlen Length of the entropy (octets)\ + @param prng The PRNG state + @return CRYPT_OK if successful + */ + int (*add_entropy)(const unsigned char *in, unsigned long inlen, prng_state *prng); + /** Ready a PRNG state to read from + @param prng The PRNG state to ready + @return CRYPT_OK if successful + */ + int (*ready)(prng_state *prng); + /** Read from the PRNG + @param out [out] Where to store the data + @param outlen Length of data desired (octets) + @param prng The PRNG state to read from + @return Number of octets read + */ + unsigned long (*read)(unsigned char *out, unsigned long outlen, prng_state *prng); + /** Terminate a PRNG state + @param prng The PRNG state to terminate + @return CRYPT_OK if successful + */ + int (*done)(prng_state *prng); + /** Export a PRNG state + @param out [out] The destination for the state + @param outlen [in/out] The max size and resulting size of the PRNG state + @param prng The PRNG to export + @return CRYPT_OK if successful + */ + int (*pexport)(unsigned char *out, unsigned long *outlen, prng_state *prng); + /** Import a PRNG state + @param in The data to import + @param inlen The length of the data to import (octets) + @param prng The PRNG to initialize/import + @return CRYPT_OK if successful + */ + int (*pimport)(const unsigned char *in, unsigned long inlen, prng_state *prng); + /** Self-test the PRNG + @return CRYPT_OK if successful, CRYPT_NOP if self-testing has been disabled + */ + int (*test)(void); +} prng_descriptor[]; + +#ifdef LTC_YARROW +int yarrow_start(prng_state *prng); +int yarrow_add_entropy(const unsigned char *in, unsigned long inlen, prng_state *prng); +int yarrow_ready(prng_state *prng); +unsigned long yarrow_read(unsigned char *out, unsigned long outlen, prng_state *prng); +int yarrow_done(prng_state *prng); +int yarrow_export(unsigned char *out, unsigned long *outlen, prng_state *prng); +int yarrow_import(const unsigned char *in, unsigned long inlen, prng_state *prng); +int yarrow_test(void); +extern const struct ltc_prng_descriptor yarrow_desc; +#endif + +#ifdef LTC_FORTUNA +int fortuna_start(prng_state *prng); +int fortuna_add_entropy(const unsigned char *in, unsigned long inlen, prng_state *prng); +int fortuna_ready(prng_state *prng); +unsigned long fortuna_read(unsigned char *out, unsigned long outlen, prng_state *prng); +int fortuna_done(prng_state *prng); +int fortuna_export(unsigned char *out, unsigned long *outlen, prng_state *prng); +int fortuna_import(const unsigned char *in, unsigned long inlen, prng_state *prng); +int fortuna_test(void); +extern const struct ltc_prng_descriptor fortuna_desc; +#endif + +#ifdef LTC_RC4 +int rc4_start(prng_state *prng); +int rc4_add_entropy(const unsigned char *in, unsigned long inlen, prng_state *prng); +int rc4_ready(prng_state *prng); +unsigned long rc4_read(unsigned char *out, unsigned long outlen, prng_state *prng); +int rc4_done(prng_state *prng); +int rc4_export(unsigned char *out, unsigned long *outlen, prng_state *prng); +int rc4_import(const unsigned char *in, unsigned long inlen, prng_state *prng); +int rc4_test(void); +extern const struct ltc_prng_descriptor rc4_desc; +#endif + +#ifdef LTC_SPRNG +int sprng_start(prng_state *prng); +int sprng_add_entropy(const unsigned char *in, unsigned long inlen, prng_state *prng); +int sprng_ready(prng_state *prng); +unsigned long sprng_read(unsigned char *out, unsigned long outlen, prng_state *prng); +int sprng_done(prng_state *prng); +int sprng_export(unsigned char *out, unsigned long *outlen, prng_state *prng); +int sprng_import(const unsigned char *in, unsigned long inlen, prng_state *prng); +int sprng_test(void); +extern const struct ltc_prng_descriptor sprng_desc; +#endif + +#ifdef LTC_SOBER128 +int sober128_start(prng_state *prng); +int sober128_add_entropy(const unsigned char *in, unsigned long inlen, prng_state *prng); +int sober128_ready(prng_state *prng); +unsigned long sober128_read(unsigned char *out, unsigned long outlen, prng_state *prng); +int sober128_done(prng_state *prng); +int sober128_export(unsigned char *out, unsigned long *outlen, prng_state *prng); +int sober128_import(const unsigned char *in, unsigned long inlen, prng_state *prng); +int sober128_test(void); +extern const struct ltc_prng_descriptor sober128_desc; +#endif + +int find_prng(const char *name); +int register_prng(const struct ltc_prng_descriptor *prng); +int unregister_prng(const struct ltc_prng_descriptor *prng); +int prng_is_valid(int idx); +LTC_MUTEX_PROTO(ltc_prng_mutex) + +/* Slow RNG you **might** be able to use to seed a PRNG with. Be careful as this + * might not work on all platforms as planned + */ +unsigned long rng_get_bytes(unsigned char *out, + unsigned long outlen, + void (*callback)(void)); + +int rng_make_prng(int bits, int wprng, prng_state *prng, void (*callback)(void)); + + +/* $Source: /cvs/libtom/libtomcrypt/src/headers/tomcrypt_prng.h,v $ */ +/* $Revision: 1.9 $ */ +/* $Date: 2007/05/12 14:32:35 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/math/ltm_desc.c b/dep/StormLib/src/libtomcrypt/src/math/ltm_desc.c new file mode 100644 index 00000000000..25dc0b32279 --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/math/ltm_desc.c @@ -0,0 +1,483 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +#define DESC_DEF_ONLY +#include "../headers/tomcrypt.h" + +#ifdef LTM_DESC + +#include "../../../libtommath/tommath.h" + +static const struct { + int mpi_code, ltc_code; +} mpi_to_ltc_codes[] = { + { MP_OKAY , CRYPT_OK}, + { MP_MEM , CRYPT_MEM}, + { MP_VAL , CRYPT_INVALID_ARG}, +}; + +/** + Convert a MPI error to a LTC error (Possibly the most powerful function ever! Oh wait... no) + @param err The error to convert + @return The equivalent LTC error code or CRYPT_ERROR if none found +*/ +static int mpi_to_ltc_error(int err) +{ + int x; + + for (x = 0; x < (int)(sizeof(mpi_to_ltc_codes)/sizeof(mpi_to_ltc_codes[0])); x++) { + if (err == mpi_to_ltc_codes[x].mpi_code) { + return mpi_to_ltc_codes[x].ltc_code; + } + } + return CRYPT_ERROR; +} + +static int init(void **a) +{ + int err; + + LTC_ARGCHK(a != NULL); + + *a = XCALLOC(1, sizeof(mp_int)); + if (*a == NULL) { + return CRYPT_MEM; + } + + if ((err = mpi_to_ltc_error(mp_init(*a))) != CRYPT_OK) { + XFREE(*a); + } + return err; +} + +static void deinit(void *a) +{ + LTC_ARGCHKVD(a != NULL); + mp_clear(a); + XFREE(a); +} + +static int neg(void *a, void *b) +{ + LTC_ARGCHK(a != NULL); + LTC_ARGCHK(b != NULL); + return mpi_to_ltc_error(mp_neg(a, b)); +} + +static int copy(void *a, void *b) +{ + LTC_ARGCHK(a != NULL); + LTC_ARGCHK(b != NULL); + return mpi_to_ltc_error(mp_copy(a, b)); +} + +static int init_copy(void **a, void *b) +{ + if (init(a) != CRYPT_OK) { + return CRYPT_MEM; + } + return copy(b, *a); +} + +/* ---- trivial ---- */ +static int set_int(void *a, unsigned long b) +{ + LTC_ARGCHK(a != NULL); + return mpi_to_ltc_error(mp_set_int(a, b)); +} + +static unsigned long get_int(void *a) +{ + LTC_ARGCHK(a != NULL); + return mp_get_int(a); +} + +static unsigned long get_digit(void *a, int n) +{ + mp_int *A; + LTC_ARGCHK(a != NULL); + A = a; + return (n >= A->used || n < 0) ? 0 : A->dp[n]; +} + +static int get_digit_count(void *a) +{ + mp_int *A; + LTC_ARGCHK(a != NULL); + A = a; + return A->used; +} + +static int compare(void *a, void *b) +{ + int ret; + LTC_ARGCHK(a != NULL); + LTC_ARGCHK(b != NULL); + ret = mp_cmp(a, b); + switch (ret) { + case MP_LT: return LTC_MP_LT; + case MP_EQ: return LTC_MP_EQ; + case MP_GT: return LTC_MP_GT; + } + return 0; +} + +static int compare_d(void *a, unsigned long b) +{ + int ret; + LTC_ARGCHK(a != NULL); + ret = mp_cmp_d(a, b); + switch (ret) { + case MP_LT: return LTC_MP_LT; + case MP_EQ: return LTC_MP_EQ; + case MP_GT: return LTC_MP_GT; + } + return 0; +} + +static int count_bits(void *a) +{ + LTC_ARGCHK(a != NULL); + return mp_count_bits(a); +} + +static int count_lsb_bits(void *a) +{ + LTC_ARGCHK(a != NULL); + return mp_cnt_lsb(a); +} + + +static int twoexpt(void *a, int n) +{ + LTC_ARGCHK(a != NULL); + return mpi_to_ltc_error(mp_2expt(a, n)); +} + +/* ---- conversions ---- */ + +/* read ascii string */ +static int read_radix(void *a, const char *b, int radix) +{ + LTC_ARGCHK(a != NULL); + LTC_ARGCHK(b != NULL); + return mpi_to_ltc_error(mp_read_radix(a, b, radix)); +} + +/* write one */ +static int write_radix(void *a, char *b, int radix) +{ + LTC_ARGCHK(a != NULL); + LTC_ARGCHK(b != NULL); + return mpi_to_ltc_error(mp_toradix(a, b, radix)); +} + +/* get size as unsigned char string */ +static unsigned long unsigned_size(void *a) +{ + LTC_ARGCHK(a != NULL); + return mp_unsigned_bin_size(a); +} + +/* store */ +static int unsigned_write(void *a, unsigned char *b) +{ + LTC_ARGCHK(a != NULL); + LTC_ARGCHK(b != NULL); + return mpi_to_ltc_error(mp_to_unsigned_bin(a, b)); +} + +/* read */ +static int unsigned_read(void *a, unsigned char *b, unsigned long len) +{ + LTC_ARGCHK(a != NULL); + LTC_ARGCHK(b != NULL); + return mpi_to_ltc_error(mp_read_unsigned_bin(a, b, len)); +} + +/* add */ +static int add(void *a, void *b, void *c) +{ + LTC_ARGCHK(a != NULL); + LTC_ARGCHK(b != NULL); + LTC_ARGCHK(c != NULL); + return mpi_to_ltc_error(mp_add(a, b, c)); +} + +static int addi(void *a, unsigned long b, void *c) +{ + LTC_ARGCHK(a != NULL); + LTC_ARGCHK(c != NULL); + return mpi_to_ltc_error(mp_add_d(a, b, c)); +} + +/* sub */ +static int sub(void *a, void *b, void *c) +{ + LTC_ARGCHK(a != NULL); + LTC_ARGCHK(b != NULL); + LTC_ARGCHK(c != NULL); + return mpi_to_ltc_error(mp_sub(a, b, c)); +} + +static int subi(void *a, unsigned long b, void *c) +{ + LTC_ARGCHK(a != NULL); + LTC_ARGCHK(c != NULL); + return mpi_to_ltc_error(mp_sub_d(a, b, c)); +} + +/* mul */ +static int mul(void *a, void *b, void *c) +{ + LTC_ARGCHK(a != NULL); + LTC_ARGCHK(b != NULL); + LTC_ARGCHK(c != NULL); + return mpi_to_ltc_error(mp_mul(a, b, c)); +} + +static int muli(void *a, unsigned long b, void *c) +{ + LTC_ARGCHK(a != NULL); + LTC_ARGCHK(c != NULL); + return mpi_to_ltc_error(mp_mul_d(a, b, c)); +} + +/* sqr */ +static int sqr(void *a, void *b) +{ + LTC_ARGCHK(a != NULL); + LTC_ARGCHK(b != NULL); + return mpi_to_ltc_error(mp_sqr(a, b)); +} + +/* div */ +static int divide(void *a, void *b, void *c, void *d) +{ + LTC_ARGCHK(a != NULL); + LTC_ARGCHK(b != NULL); + return mpi_to_ltc_error(mp_div(a, b, c, d)); +} + +static int div_2(void *a, void *b) +{ + LTC_ARGCHK(a != NULL); + LTC_ARGCHK(b != NULL); + return mpi_to_ltc_error(mp_div_2(a, b)); +} + +/* modi */ +static int modi(void *a, unsigned long b, unsigned long *c) +{ + mp_digit tmp; + int err; + + LTC_ARGCHK(a != NULL); + LTC_ARGCHK(c != NULL); + + if ((err = mpi_to_ltc_error(mp_mod_d(a, b, &tmp))) != CRYPT_OK) { + return err; + } + *c = tmp; + return CRYPT_OK; +} + +/* gcd */ +static int gcd(void *a, void *b, void *c) +{ + LTC_ARGCHK(a != NULL); + LTC_ARGCHK(b != NULL); + LTC_ARGCHK(c != NULL); + return mpi_to_ltc_error(mp_gcd(a, b, c)); +} + +/* lcm */ +static int lcm(void *a, void *b, void *c) +{ + LTC_ARGCHK(a != NULL); + LTC_ARGCHK(b != NULL); + LTC_ARGCHK(c != NULL); + return mpi_to_ltc_error(mp_lcm(a, b, c)); +} + +static int mulmod(void *a, void *b, void *c, void *d) +{ + LTC_ARGCHK(a != NULL); + LTC_ARGCHK(b != NULL); + LTC_ARGCHK(c != NULL); + LTC_ARGCHK(d != NULL); + return mpi_to_ltc_error(mp_mulmod(a,b,c,d)); +} + +static int sqrmod(void *a, void *b, void *c) +{ + LTC_ARGCHK(a != NULL); + LTC_ARGCHK(b != NULL); + LTC_ARGCHK(c != NULL); + return mpi_to_ltc_error(mp_sqrmod(a,b,c)); +} + +/* invmod */ +static int invmod(void *a, void *b, void *c) +{ + LTC_ARGCHK(a != NULL); + LTC_ARGCHK(b != NULL); + LTC_ARGCHK(c != NULL); + return mpi_to_ltc_error(mp_invmod(a, b, c)); +} + +/* setup */ +static int montgomery_setup(void *a, void **b) +{ + int err; + LTC_ARGCHK(a != NULL); + LTC_ARGCHK(b != NULL); + *b = XCALLOC(1, sizeof(mp_digit)); + if (*b == NULL) { + return CRYPT_MEM; + } + if ((err = mpi_to_ltc_error(mp_montgomery_setup(a, (mp_digit *)*b))) != CRYPT_OK) { + XFREE(*b); + } + return err; +} + +/* get normalization value */ +static int montgomery_normalization(void *a, void *b) +{ + LTC_ARGCHK(a != NULL); + LTC_ARGCHK(b != NULL); + return mpi_to_ltc_error(mp_montgomery_calc_normalization(a, b)); +} + +/* reduce */ +static int montgomery_reduce(void *a, void *b, void *c) +{ + LTC_ARGCHK(a != NULL); + LTC_ARGCHK(b != NULL); + LTC_ARGCHK(c != NULL); + return mpi_to_ltc_error(mp_montgomery_reduce(a, b, *((mp_digit *)c))); +} + +/* clean up */ +static void montgomery_deinit(void *a) +{ + XFREE(a); +} + +static int exptmod(void *a, void *b, void *c, void *d) +{ + LTC_ARGCHK(a != NULL); + LTC_ARGCHK(b != NULL); + LTC_ARGCHK(c != NULL); + LTC_ARGCHK(d != NULL); + return mpi_to_ltc_error(mp_exptmod(a,b,c,d)); +} + +static int isprime(void *a, int *b) +{ + int err; + LTC_ARGCHK(a != NULL); + LTC_ARGCHK(b != NULL); + err = mpi_to_ltc_error(mp_prime_is_prime(a, 8, b)); + *b = (*b == MP_YES) ? LTC_MP_YES : LTC_MP_NO; + return err; +} + +const ltc_math_descriptor ltm_desc = { + + "LibTomMath", + (int)DIGIT_BIT, + + &init, + &init_copy, + &deinit, + + &neg, + ©, + + &set_int, + &get_int, + &get_digit, + &get_digit_count, + &compare, + &compare_d, + &count_bits, + &count_lsb_bits, + &twoexpt, + + &read_radix, + &write_radix, + &unsigned_size, + &unsigned_write, + &unsigned_read, + + &add, + &addi, + &sub, + &subi, + &mul, + &muli, + &sqr, + ÷, + &div_2, + &modi, + &gcd, + &lcm, + + &mulmod, + &sqrmod, + &invmod, + + &montgomery_setup, + &montgomery_normalization, + &montgomery_reduce, + &montgomery_deinit, + + &exptmod, + &isprime, + +#ifdef LTC_MECC +#ifdef LTC_MECC_FP + <c_ecc_fp_mulmod, +#else + <c_ecc_mulmod, +#endif + <c_ecc_projective_add_point, + <c_ecc_projective_dbl_point, + <c_ecc_map, +#ifdef LTC_ECC_SHAMIR +#ifdef LTC_MECC_FP + <c_ecc_fp_mul2add, +#else + <c_ecc_mul2add, +#endif /* LTC_MECC_FP */ +#else + NULL, +#endif /* LTC_ECC_SHAMIR */ +#else + NULL, NULL, NULL, NULL, NULL, +#endif /* LTC_MECC */ + +#ifdef LTC_MRSA + &rsa_make_key, + &rsa_exptmod, +#else + NULL, NULL +#endif +}; + + +#endif + +/* $Source: /cvs/libtom/libtomcrypt/src/math/ltm_desc.c,v $ */ +/* $Revision: 1.31 $ */ +/* $Date: 2007/05/12 14:32:35 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/math/multi.c b/dep/StormLib/src/libtomcrypt/src/math/multi.c new file mode 100644 index 00000000000..7d40040a1de --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/math/multi.c @@ -0,0 +1,61 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../headers/tomcrypt.h" + +#ifdef MPI +#include + +int ltc_init_multi(void **a, ...) +{ + void **cur = a; + int np = 0; + va_list args; + + va_start(args, a); + while (cur != NULL) { + if (mp_init(cur) != CRYPT_OK) { + /* failed */ + va_list clean_list; + + va_start(clean_list, a); + cur = a; + while (np--) { + mp_clear(*cur); + cur = va_arg(clean_list, void**); + } + va_end(clean_list); + return CRYPT_MEM; + } + ++np; + cur = va_arg(args, void**); + } + va_end(args); + return CRYPT_OK; +} + +void ltc_deinit_multi(void *a, ...) +{ + void *cur = a; + va_list args; + + va_start(args, a); + while (cur != NULL) { + mp_clear(cur); + cur = va_arg(args, void *); + } + va_end(args); +} + +#endif + +/* $Source: /cvs/libtom/libtomcrypt/src/math/multi.c,v $ */ +/* $Revision: 1.6 $ */ +/* $Date: 2006/12/28 01:27:23 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/math/rand_prime.c b/dep/StormLib/src/libtomcrypt/src/math/rand_prime.c new file mode 100644 index 00000000000..913fa95a4a3 --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/math/rand_prime.c @@ -0,0 +1,87 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../headers/tomcrypt.h" + +/** + @file rand_prime.c + Generate a random prime, Tom St Denis +*/ + +#define USE_BBS 1 + +int rand_prime(void *N, long len, prng_state *prng, int wprng) +{ + int err, res, type; + unsigned char *buf; + + LTC_ARGCHK(N != NULL); + + /* get type */ + if (len < 0) { + type = USE_BBS; + len = -len; + } else { + type = 0; + } + + /* allow sizes between 2 and 512 bytes for a prime size */ + if (len < 2 || len > 512) { + return CRYPT_INVALID_PRIME_SIZE; + } + + /* valid PRNG? Better be! */ + if ((err = prng_is_valid(wprng)) != CRYPT_OK) { + return err; + } + + /* allocate buffer to work with */ + buf = XCALLOC(1, len); + if (buf == NULL) { + return CRYPT_MEM; + } + + do { + /* generate value */ + if (prng_descriptor[wprng].read(buf, len, prng) != (unsigned long)len) { + XFREE(buf); + return CRYPT_ERROR_READPRNG; + } + + /* munge bits */ + buf[0] |= 0x80 | 0x40; + buf[len-1] |= 0x01 | ((type & USE_BBS) ? 0x02 : 0x00); + + /* load value */ + if ((err = mp_read_unsigned_bin(N, buf, len)) != CRYPT_OK) { + XFREE(buf); + return err; + } + + /* test */ + if ((err = mp_prime_is_prime(N, 8, &res)) != CRYPT_OK) { + XFREE(buf); + return err; + } + } while (res == LTC_MP_NO); + +#ifdef LTC_CLEAN_STACK + zeromem(buf, len); +#endif + + XFREE(buf); + return CRYPT_OK; +} + + + +/* $Source: /cvs/libtom/libtomcrypt/src/math/rand_prime.c,v $ */ +/* $Revision: 1.7 $ */ +/* $Date: 2006/12/28 01:27:23 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/misc/base64_decode.c b/dep/StormLib/src/libtomcrypt/src/misc/base64_decode.c new file mode 100644 index 00000000000..3d13393a1dc --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/misc/base64_decode.c @@ -0,0 +1,104 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../headers/tomcrypt.h" + +/** + @file base64_decode.c + Compliant base64 code donated by Wayne Scott (wscott@bitmover.com) +*/ + + +#ifdef LTC_BASE64 + +static const unsigned char map[256] = { +255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, +255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, +255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, +255, 255, 255, 255, 255, 255, 255, 62, 255, 255, 255, 63, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 255, 255, +255, 254, 255, 255, 255, 0, 1, 2, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 255, 255, 255, 255, 255, +255, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 255, 255, 255, 255, 255, 255, 255, 255, 255, +255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, +255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, +255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, +255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, +255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, +255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, +255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, +255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, +255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, +255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, +255, 255, 255, 255 }; + +/** + base64 decode a block of memory + @param in The base64 data to decode + @param inlen The length of the base64 data + @param out [out] The destination of the binary decoded data + @param outlen [in/out] The max size and resulting size of the decoded data + @return CRYPT_OK if successful +*/ +int base64_decode(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen) +{ + unsigned long t, x, y, z; + unsigned char c; + int g; + + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(out != NULL); + LTC_ARGCHK(outlen != NULL); + + g = 3; + for (x = y = z = t = 0; x < inlen; x++) { + c = map[in[x]&0xFF]; + if (c == 255) continue; + /* the final = symbols are read and used to trim the remaining bytes */ + if (c == 254) { + c = 0; + /* prevent g < 0 which would potentially allow an overflow later */ + if (--g < 0) { + return CRYPT_INVALID_PACKET; + } + } else if (g != 3) { + /* we only allow = to be at the end */ + return CRYPT_INVALID_PACKET; + } + + t = (t<<6)|c; + + if (++y == 4) { + if (z + g > *outlen) { + return CRYPT_BUFFER_OVERFLOW; + } + out[z++] = (unsigned char)((t>>16)&255); + if (g > 1) out[z++] = (unsigned char)((t>>8)&255); + if (g > 2) out[z++] = (unsigned char)(t&255); + y = t = 0; + } + } + if (y != 0) { + return CRYPT_INVALID_PACKET; + } + *outlen = z; + return CRYPT_OK; +} + +#endif + + +/* $Source: /cvs/libtom/libtomcrypt/src/misc/base64/base64_decode.c,v $ */ +/* $Revision: 1.6 $ */ +/* $Date: 2007/05/12 14:32:35 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/misc/crypt_argchk.c b/dep/StormLib/src/libtomcrypt/src/misc/crypt_argchk.c new file mode 100644 index 00000000000..537516d80d9 --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/misc/crypt_argchk.c @@ -0,0 +1,30 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../headers/tomcrypt.h" +#include + +/** + @file crypt_argchk.c + Perform argument checking, Tom St Denis +*/ + +#if (ARGTYPE == 0) +void crypt_argchk(char *v, char *s, int d) +{ + fprintf(stderr, "LTC_ARGCHK '%s' failure on line %d of file %s\n", + v, d, s); + (void)raise(SIGABRT); +} +#endif + +/* $Source: /cvs/libtom/libtomcrypt/src/misc/crypt/crypt_argchk.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:27:24 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/misc/crypt_find_hash.c b/dep/StormLib/src/libtomcrypt/src/misc/crypt_find_hash.c new file mode 100644 index 00000000000..fef2d8cca32 --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/misc/crypt_find_hash.c @@ -0,0 +1,40 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../headers/tomcrypt.h" + +/** + @file crypt_find_hash.c + Find a hash, Tom St Denis +*/ + +/** + Find a registered hash by name + @param name The name of the hash to look for + @return >= 0 if found, -1 if not present +*/ +int find_hash(const char *name) +{ + int x; + LTC_ARGCHK(name != NULL); + LTC_MUTEX_LOCK(<c_hash_mutex); + for (x = 0; x < TAB_SIZE; x++) { + if (hash_descriptor[x].name != NULL && XSTRCMP(hash_descriptor[x].name, name) == 0) { + LTC_MUTEX_UNLOCK(<c_hash_mutex); + return x; + } + } + LTC_MUTEX_UNLOCK(<c_hash_mutex); + return -1; +} + +/* $Source: /cvs/libtom/libtomcrypt/src/misc/crypt/crypt_find_hash.c,v $ */ +/* $Revision: 1.7 $ */ +/* $Date: 2006/12/28 01:27:24 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/misc/crypt_find_prng.c b/dep/StormLib/src/libtomcrypt/src/misc/crypt_find_prng.c new file mode 100644 index 00000000000..fafbb0e226f --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/misc/crypt_find_prng.c @@ -0,0 +1,41 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../headers/tomcrypt.h" + +/** + @file crypt_find_prng.c + Find a PRNG, Tom St Denis +*/ + +/** + Find a registered PRNG by name + @param name The name of the PRNG to look for + @return >= 0 if found, -1 if not present +*/ +int find_prng(const char *name) +{ + int x; + LTC_ARGCHK(name != NULL); + LTC_MUTEX_LOCK(<c_prng_mutex); + for (x = 0; x < TAB_SIZE; x++) { + if ((prng_descriptor[x].name != NULL) && XSTRCMP(prng_descriptor[x].name, name) == 0) { + LTC_MUTEX_UNLOCK(<c_prng_mutex); + return x; + } + } + LTC_MUTEX_UNLOCK(<c_prng_mutex); + return -1; +} + + +/* $Source: /cvs/libtom/libtomcrypt/src/misc/crypt/crypt_find_prng.c,v $ */ +/* $Revision: 1.7 $ */ +/* $Date: 2006/12/28 01:27:24 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/misc/crypt_hash_descriptor.c b/dep/StormLib/src/libtomcrypt/src/misc/crypt_hash_descriptor.c new file mode 100644 index 00000000000..5925fd27302 --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/misc/crypt_hash_descriptor.c @@ -0,0 +1,27 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../headers/tomcrypt.h" + +/** + @file crypt_hash_descriptor.c + Stores the hash descriptor table, Tom St Denis +*/ + +struct ltc_hash_descriptor hash_descriptor[TAB_SIZE] = { +{ NULL, 0, 0, 0, { 0 }, 0, NULL, NULL, NULL, NULL, NULL } +}; + +LTC_MUTEX_GLOBAL(ltc_hash_mutex) + + +/* $Source: /cvs/libtom/libtomcrypt/src/misc/crypt/crypt_hash_descriptor.c,v $ */ +/* $Revision: 1.10 $ */ +/* $Date: 2006/12/28 01:27:24 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/misc/crypt_hash_is_valid.c b/dep/StormLib/src/libtomcrypt/src/misc/crypt_hash_is_valid.c new file mode 100644 index 00000000000..8ed5105b56c --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/misc/crypt_hash_is_valid.c @@ -0,0 +1,36 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../headers/tomcrypt.h" + +/** + @file crypt_hash_is_valid.c + Determine if hash is valid, Tom St Denis +*/ + +/* + Test if a hash index is valid + @param idx The index of the hash to search for + @return CRYPT_OK if valid +*/ +int hash_is_valid(int idx) +{ + LTC_MUTEX_LOCK(<c_hash_mutex); + if (idx < 0 || idx >= TAB_SIZE || hash_descriptor[idx].name == NULL) { + LTC_MUTEX_UNLOCK(<c_hash_mutex); + return CRYPT_INVALID_HASH; + } + LTC_MUTEX_UNLOCK(<c_hash_mutex); + return CRYPT_OK; +} + +/* $Source: /cvs/libtom/libtomcrypt/src/misc/crypt/crypt_hash_is_valid.c,v $ */ +/* $Revision: 1.6 $ */ +/* $Date: 2006/12/28 01:27:24 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/misc/crypt_libc.c b/dep/StormLib/src/libtomcrypt/src/misc/crypt_libc.c new file mode 100644 index 00000000000..bcc89f4f94d --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/misc/crypt_libc.c @@ -0,0 +1,43 @@ +/*****************************************************************************/ +/* crypt_libc.c Copyright (c) Ladislav Zezula 2010 */ +/*---------------------------------------------------------------------------*/ +/* Description: */ +/*---------------------------------------------------------------------------*/ +/* Date Ver Who Comment */ +/* -------- ---- --- ------- */ +/* 05.05.10 1.00 Lad The first version of crypt_libc.c */ +/*****************************************************************************/ + +// LibTomCrypt header +#include +#include "../headers/tomcrypt.h" + +void * LibTomMalloc(size_t n) +{ + return malloc(n); +} + +void * LibTomCalloc(size_t n, size_t s) +{ + return calloc(n, s); +} + +void * LibTomRealloc(void *p, size_t n) +{ + return realloc(p, n); +} + +void LibTomFree(void * p) +{ + free(p); +} + +clock_t LibTomClock(void) +{ + return clock(); +} + +void LibTomQsort(void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *)) +{ + qsort(base, nmemb, size, compar); +} diff --git a/dep/StormLib/src/libtomcrypt/src/misc/crypt_ltc_mp_descriptor.c b/dep/StormLib/src/libtomcrypt/src/misc/crypt_ltc_mp_descriptor.c new file mode 100644 index 00000000000..91ba9d162d2 --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/misc/crypt_ltc_mp_descriptor.c @@ -0,0 +1,13 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../headers/tomcrypt.h" + +ltc_math_descriptor ltc_mp; diff --git a/dep/StormLib/src/libtomcrypt/src/misc/crypt_prng_descriptor.c b/dep/StormLib/src/libtomcrypt/src/misc/crypt_prng_descriptor.c new file mode 100644 index 00000000000..c5b39e0c26f --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/misc/crypt_prng_descriptor.c @@ -0,0 +1,26 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../headers/tomcrypt.h" + +/** + @file crypt_prng_descriptor.c + Stores the PRNG descriptors, Tom St Denis +*/ +struct ltc_prng_descriptor prng_descriptor[TAB_SIZE] = { +{ NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL } +}; + +LTC_MUTEX_GLOBAL(ltc_prng_mutex) + + +/* $Source: /cvs/libtom/libtomcrypt/src/misc/crypt/crypt_prng_descriptor.c,v $ */ +/* $Revision: 1.8 $ */ +/* $Date: 2006/12/28 01:27:24 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/misc/crypt_prng_is_valid.c b/dep/StormLib/src/libtomcrypt/src/misc/crypt_prng_is_valid.c new file mode 100644 index 00000000000..d38fd3a3c9d --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/misc/crypt_prng_is_valid.c @@ -0,0 +1,36 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../headers/tomcrypt.h" + +/** + @file crypt_prng_is_valid.c + Determine if PRNG is valid, Tom St Denis +*/ + +/* + Test if a PRNG index is valid + @param idx The index of the PRNG to search for + @return CRYPT_OK if valid +*/ +int prng_is_valid(int idx) +{ + LTC_MUTEX_LOCK(<c_prng_mutex); + if (idx < 0 || idx >= TAB_SIZE || prng_descriptor[idx].name == NULL) { + LTC_MUTEX_UNLOCK(<c_prng_mutex); + return CRYPT_INVALID_PRNG; + } + LTC_MUTEX_UNLOCK(<c_prng_mutex); + return CRYPT_OK; +} + +/* $Source: /cvs/libtom/libtomcrypt/src/misc/crypt/crypt_prng_is_valid.c,v $ */ +/* $Revision: 1.6 $ */ +/* $Date: 2006/12/28 01:27:24 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/misc/crypt_register_hash.c b/dep/StormLib/src/libtomcrypt/src/misc/crypt_register_hash.c new file mode 100644 index 00000000000..17300915487 --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/misc/crypt_register_hash.c @@ -0,0 +1,54 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../headers/tomcrypt.h" + +/** + @file crypt_register_hash.c + Register a HASH, Tom St Denis +*/ + +/** + Register a hash with the descriptor table + @param hash The hash you wish to register + @return value >= 0 if successfully added (or already present), -1 if unsuccessful +*/ +int register_hash(const struct ltc_hash_descriptor *hash) +{ + int x; + + LTC_ARGCHK(hash != NULL); + + /* is it already registered? */ + LTC_MUTEX_LOCK(<c_hash_mutex); + for (x = 0; x < TAB_SIZE; x++) { + if (XMEMCMP(&hash_descriptor[x], hash, sizeof(struct ltc_hash_descriptor)) == 0) { + LTC_MUTEX_UNLOCK(<c_hash_mutex); + return x; + } + } + + /* find a blank spot */ + for (x = 0; x < TAB_SIZE; x++) { + if (hash_descriptor[x].name == NULL) { + XMEMCPY(&hash_descriptor[x], hash, sizeof(struct ltc_hash_descriptor)); + LTC_MUTEX_UNLOCK(<c_hash_mutex); + return x; + } + } + + /* no spot */ + LTC_MUTEX_UNLOCK(<c_hash_mutex); + return -1; +} + +/* $Source: /cvs/libtom/libtomcrypt/src/misc/crypt/crypt_register_hash.c,v $ */ +/* $Revision: 1.7 $ */ +/* $Date: 2006/12/28 01:27:24 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/misc/crypt_register_prng.c b/dep/StormLib/src/libtomcrypt/src/misc/crypt_register_prng.c new file mode 100644 index 00000000000..29fc9bdf63d --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/misc/crypt_register_prng.c @@ -0,0 +1,54 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../headers/tomcrypt.h" + +/** + @file crypt_register_prng.c + Register a PRNG, Tom St Denis +*/ + +/** + Register a PRNG with the descriptor table + @param prng The PRNG you wish to register + @return value >= 0 if successfully added (or already present), -1 if unsuccessful +*/ +int register_prng(const struct ltc_prng_descriptor *prng) +{ + int x; + + LTC_ARGCHK(prng != NULL); + + /* is it already registered? */ + LTC_MUTEX_LOCK(<c_prng_mutex); + for (x = 0; x < TAB_SIZE; x++) { + if (XMEMCMP(&prng_descriptor[x], prng, sizeof(struct ltc_prng_descriptor)) == 0) { + LTC_MUTEX_UNLOCK(<c_prng_mutex); + return x; + } + } + + /* find a blank spot */ + for (x = 0; x < TAB_SIZE; x++) { + if (prng_descriptor[x].name == NULL) { + XMEMCPY(&prng_descriptor[x], prng, sizeof(struct ltc_prng_descriptor)); + LTC_MUTEX_UNLOCK(<c_prng_mutex); + return x; + } + } + + /* no spot */ + LTC_MUTEX_UNLOCK(<c_prng_mutex); + return -1; +} + +/* $Source: /cvs/libtom/libtomcrypt/src/misc/crypt/crypt_register_prng.c,v $ */ +/* $Revision: 1.8 $ */ +/* $Date: 2006/12/28 01:27:24 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/misc/zeromem.c b/dep/StormLib/src/libtomcrypt/src/misc/zeromem.c new file mode 100644 index 00000000000..faa0efa7842 --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/misc/zeromem.c @@ -0,0 +1,34 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../headers/tomcrypt.h" + +/** + @file zeromem.c + Zero a block of memory, Tom St Denis +*/ + +/** + Zero a block of memory + @param out The destination of the area to zero + @param outlen The length of the area to zero (octets) +*/ +void zeromem(void *out, size_t outlen) +{ + unsigned char *mem = out; + LTC_ARGCHKVD(out != NULL); + while (outlen-- > 0) { + *mem++ = 0; + } +} + +/* $Source: /cvs/libtom/libtomcrypt/src/misc/zeromem.c,v $ */ +/* $Revision: 1.7 $ */ +/* $Date: 2006/12/28 01:27:24 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_bit_string.c b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_bit_string.c new file mode 100644 index 00000000000..e53686750fd --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_bit_string.c @@ -0,0 +1,102 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../../headers/tomcrypt.h" + +/** + @file der_decode_bit_string.c + ASN.1 DER, encode a BIT STRING, Tom St Denis +*/ + + +#ifdef LTC_DER + +/** + Store a BIT STRING + @param in The DER encoded BIT STRING + @param inlen The size of the DER BIT STRING + @param out [out] The array of bits stored (one per char) + @param outlen [in/out] The number of bits stored + @return CRYPT_OK if successful +*/ +int der_decode_bit_string(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen) +{ + unsigned long dlen, blen, x, y; + + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(out != NULL); + LTC_ARGCHK(outlen != NULL); + + /* packet must be at least 4 bytes */ + if (inlen < 4) { + return CRYPT_INVALID_ARG; + } + + /* check for 0x03 */ + if ((in[0]&0x1F) != 0x03) { + return CRYPT_INVALID_PACKET; + } + + /* offset in the data */ + x = 1; + + /* get the length of the data */ + if (in[x] & 0x80) { + /* long format get number of length bytes */ + y = in[x++] & 0x7F; + + /* invalid if 0 or > 2 */ + if (y == 0 || y > 2) { + return CRYPT_INVALID_PACKET; + } + + /* read the data len */ + dlen = 0; + while (y--) { + dlen = (dlen << 8) | (unsigned long)in[x++]; + } + } else { + /* short format */ + dlen = in[x++] & 0x7F; + } + + /* is the data len too long or too short? */ + if ((dlen == 0) || (dlen + x > inlen)) { + return CRYPT_INVALID_PACKET; + } + + /* get padding count */ + blen = ((dlen - 1) << 3) - (in[x++] & 7); + + /* too many bits? */ + if (blen > *outlen) { + *outlen = blen; + return CRYPT_BUFFER_OVERFLOW; + } + + /* decode/store the bits */ + for (y = 0; y < blen; y++) { + out[y] = (in[x] & (1 << (7 - (y & 7)))) ? 1 : 0; + if ((y & 7) == 7) { + ++x; + } + } + + /* we done */ + *outlen = blen; + return CRYPT_OK; +} + +#endif + +/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/bit/der_decode_bit_string.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:27:24 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_boolean.c b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_boolean.c new file mode 100644 index 00000000000..617d4e8611d --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_boolean.c @@ -0,0 +1,47 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../../headers/tomcrypt.h" + +/** + @file der_decode_boolean.c + ASN.1 DER, decode a BOOLEAN, Tom St Denis +*/ + + +#ifdef LTC_DER + +/** + Read a BOOLEAN + @param in The destination for the DER encoded BOOLEAN + @param inlen The size of the DER BOOLEAN + @param out [out] The boolean to decode + @return CRYPT_OK if successful +*/ +int der_decode_boolean(const unsigned char *in, unsigned long inlen, + int *out) +{ + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(out != NULL); + + if (inlen != 3 || in[0] != 0x01 || in[1] != 0x01 || (in[2] != 0x00 && in[2] != 0xFF)) { + return CRYPT_INVALID_ARG; + } + + *out = (in[2]==0xFF) ? 1 : 0; + + return CRYPT_OK; +} + +#endif + +/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/boolean/der_decode_boolean.c,v $ */ +/* $Revision: 1.2 $ */ +/* $Date: 2006/12/28 01:27:24 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_choice.c b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_choice.c new file mode 100644 index 00000000000..44a0891bead --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_choice.c @@ -0,0 +1,182 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../../headers/tomcrypt.h" + +/** + @file der_decode_choice.c + ASN.1 DER, decode a CHOICE, Tom St Denis +*/ + +#ifdef LTC_DER + +/** + Decode a CHOICE + @param in The DER encoded input + @param inlen [in/out] The size of the input and resulting size of read type + @param list The list of items to decode + @param outlen The number of items in the list + @return CRYPT_OK on success +*/ +int der_decode_choice(const unsigned char *in, unsigned long *inlen, + ltc_asn1_list *list, unsigned long outlen) +{ + unsigned long size, x, z; + void *data; + + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(inlen != NULL); + LTC_ARGCHK(list != NULL); + + /* get blk size */ + if (*inlen < 2) { + return CRYPT_INVALID_PACKET; + } + + /* set all of the "used" flags to zero */ + for (x = 0; x < outlen; x++) { + list[x].used = 0; + } + + /* now scan until we have a winner */ + for (x = 0; x < outlen; x++) { + size = list[x].size; + data = list[x].data; + + switch (list[x].type) { + case LTC_ASN1_INTEGER: + if (der_decode_integer(in, *inlen, data) == CRYPT_OK) { + if (der_length_integer(data, &z) == CRYPT_OK) { + list[x].used = 1; + *inlen = z; + return CRYPT_OK; + } + } + break; + + case LTC_ASN1_SHORT_INTEGER: + if (der_decode_short_integer(in, *inlen, data) == CRYPT_OK) { + if (der_length_short_integer(size, &z) == CRYPT_OK) { + list[x].used = 1; + *inlen = z; + return CRYPT_OK; + } + } + break; + + case LTC_ASN1_BIT_STRING: + if (der_decode_bit_string(in, *inlen, data, &size) == CRYPT_OK) { + if (der_length_bit_string(size, &z) == CRYPT_OK) { + list[x].used = 1; + list[x].size = size; + *inlen = z; + return CRYPT_OK; + } + } + break; + + case LTC_ASN1_OCTET_STRING: + if (der_decode_octet_string(in, *inlen, data, &size) == CRYPT_OK) { + if (der_length_octet_string(size, &z) == CRYPT_OK) { + list[x].used = 1; + list[x].size = size; + *inlen = z; + return CRYPT_OK; + } + } + break; + + case LTC_ASN1_NULL: + if (*inlen == 2 && in[x] == 0x05 && in[x+1] == 0x00) { + *inlen = 2; + list[x].used = 1; + return CRYPT_OK; + } + break; + + case LTC_ASN1_OBJECT_IDENTIFIER: + if (der_decode_object_identifier(in, *inlen, data, &size) == CRYPT_OK) { + if (der_length_object_identifier(data, size, &z) == CRYPT_OK) { + list[x].used = 1; + list[x].size = size; + *inlen = z; + return CRYPT_OK; + } + } + break; + + case LTC_ASN1_IA5_STRING: + if (der_decode_ia5_string(in, *inlen, data, &size) == CRYPT_OK) { + if (der_length_ia5_string(data, size, &z) == CRYPT_OK) { + list[x].used = 1; + list[x].size = size; + *inlen = z; + return CRYPT_OK; + } + } + break; + + + case LTC_ASN1_PRINTABLE_STRING: + if (der_decode_printable_string(in, *inlen, data, &size) == CRYPT_OK) { + if (der_length_printable_string(data, size, &z) == CRYPT_OK) { + list[x].used = 1; + list[x].size = size; + *inlen = z; + return CRYPT_OK; + } + } + break; + + case LTC_ASN1_UTF8_STRING: + if (der_decode_utf8_string(in, *inlen, data, &size) == CRYPT_OK) { + if (der_length_utf8_string(data, size, &z) == CRYPT_OK) { + list[x].used = 1; + list[x].size = size; + *inlen = z; + return CRYPT_OK; + } + } + break; + + case LTC_ASN1_UTCTIME: + z = *inlen; + if (der_decode_utctime(in, &z, data) == CRYPT_OK) { + list[x].used = 1; + *inlen = z; + return CRYPT_OK; + } + break; + + case LTC_ASN1_SET: + case LTC_ASN1_SETOF: + case LTC_ASN1_SEQUENCE: + if (der_decode_sequence(in, *inlen, data, size) == CRYPT_OK) { + if (der_length_sequence(data, size, &z) == CRYPT_OK) { + list[x].used = 1; + *inlen = z; + return CRYPT_OK; + } + } + break; + + default: + return CRYPT_INVALID_ARG; + } + } + + return CRYPT_INVALID_PACKET; +} + +#endif + +/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/choice/der_decode_choice.c,v $ */ +/* $Revision: 1.9 $ */ +/* $Date: 2006/12/28 01:27:24 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_ia5_string.c b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_ia5_string.c new file mode 100644 index 00000000000..f2e073b8d84 --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_ia5_string.c @@ -0,0 +1,96 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../../headers/tomcrypt.h" + +/** + @file der_decode_ia5_string.c + ASN.1 DER, encode a IA5 STRING, Tom St Denis +*/ + + +#ifdef LTC_DER + +/** + Store a IA5 STRING + @param in The DER encoded IA5 STRING + @param inlen The size of the DER IA5 STRING + @param out [out] The array of octets stored (one per char) + @param outlen [in/out] The number of octets stored + @return CRYPT_OK if successful +*/ +int der_decode_ia5_string(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen) +{ + unsigned long x, y, len; + int t; + + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(out != NULL); + LTC_ARGCHK(outlen != NULL); + + /* must have header at least */ + if (inlen < 2) { + return CRYPT_INVALID_PACKET; + } + + /* check for 0x16 */ + if ((in[0] & 0x1F) != 0x16) { + return CRYPT_INVALID_PACKET; + } + x = 1; + + /* decode the length */ + if (in[x] & 0x80) { + /* valid # of bytes in length are 1,2,3 */ + y = in[x] & 0x7F; + if ((y == 0) || (y > 3) || ((x + y) > inlen)) { + return CRYPT_INVALID_PACKET; + } + + /* read the length in */ + len = 0; + ++x; + while (y--) { + len = (len << 8) | in[x++]; + } + } else { + len = in[x++] & 0x7F; + } + + /* is it too long? */ + if (len > *outlen) { + *outlen = len; + return CRYPT_BUFFER_OVERFLOW; + } + + if (len + x > inlen) { + return CRYPT_INVALID_PACKET; + } + + /* read the data */ + for (y = 0; y < len; y++) { + t = der_ia5_value_decode(in[x++]); + if (t == -1) { + return CRYPT_INVALID_ARG; + } + out[y] = t; + } + + *outlen = y; + + return CRYPT_OK; +} + +#endif + +/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/ia5/der_decode_ia5_string.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:27:24 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_integer.c b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_integer.c new file mode 100644 index 00000000000..cca27451963 --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_integer.c @@ -0,0 +1,110 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../../headers/tomcrypt.h" + +/** + @file der_decode_integer.c + ASN.1 DER, decode an integer, Tom St Denis +*/ + + +#ifdef LTC_DER + +/** + Read a mp_int integer + @param in The DER encoded data + @param inlen Size of DER encoded data + @param num The first mp_int to decode + @return CRYPT_OK if successful +*/ +int der_decode_integer(const unsigned char *in, unsigned long inlen, void *num) +{ + unsigned long x, y, z; + int err; + + LTC_ARGCHK(num != NULL); + LTC_ARGCHK(in != NULL); + + /* min DER INTEGER is 0x02 01 00 == 0 */ + if (inlen < (1 + 1 + 1)) { + return CRYPT_INVALID_PACKET; + } + + /* ok expect 0x02 when we AND with 0001 1111 [1F] */ + x = 0; + if ((in[x++] & 0x1F) != 0x02) { + return CRYPT_INVALID_PACKET; + } + + /* now decode the len stuff */ + z = in[x++]; + + if ((z & 0x80) == 0x00) { + /* short form */ + + /* will it overflow? */ + if (x + z > inlen) { + return CRYPT_INVALID_PACKET; + } + + /* no so read it */ + if ((err = mp_read_unsigned_bin(num, (unsigned char *)in + x, z)) != CRYPT_OK) { + return err; + } + } else { + /* long form */ + z &= 0x7F; + + /* will number of length bytes overflow? (or > 4) */ + if (((x + z) > inlen) || (z > 4) || (z == 0)) { + return CRYPT_INVALID_PACKET; + } + + /* now read it in */ + y = 0; + while (z--) { + y = ((unsigned long)(in[x++])) | (y << 8); + } + + /* now will reading y bytes overrun? */ + if ((x + y) > inlen) { + return CRYPT_INVALID_PACKET; + } + + /* no so read it */ + if ((err = mp_read_unsigned_bin(num, (unsigned char *)in + x, y)) != CRYPT_OK) { + return err; + } + } + + /* see if it's negative */ + if (in[x] & 0x80) { + void *tmp; + if (mp_init(&tmp) != CRYPT_OK) { + return CRYPT_MEM; + } + + if (mp_2expt(tmp, mp_count_bits(num)) != CRYPT_OK || mp_sub(num, tmp, num) != CRYPT_OK) { + mp_clear(tmp); + return CRYPT_MEM; + } + mp_clear(tmp); + } + + return CRYPT_OK; + +} + +#endif + +/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/integer/der_decode_integer.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:27:24 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_object_identifier.c b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_object_identifier.c new file mode 100644 index 00000000000..e7baae88e0c --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_object_identifier.c @@ -0,0 +1,99 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../../headers/tomcrypt.h" + +/** + @file der_decode_object_identifier.c + ASN.1 DER, Decode Object Identifier, Tom St Denis +*/ + +#ifdef LTC_DER +/** + Decode OID data and store the array of integers in words + @param in The OID DER encoded data + @param inlen The length of the OID data + @param words [out] The destination of the OID words + @param outlen [in/out] The number of OID words + @return CRYPT_OK if successful +*/ +int der_decode_object_identifier(const unsigned char *in, unsigned long inlen, + unsigned long *words, unsigned long *outlen) +{ + unsigned long x, y, t, len; + + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(words != NULL); + LTC_ARGCHK(outlen != NULL); + + /* header is at least 3 bytes */ + if (inlen < 3) { + return CRYPT_INVALID_PACKET; + } + + /* must be room for at least two words */ + if (*outlen < 2) { + return CRYPT_BUFFER_OVERFLOW; + } + + /* decode the packet header */ + x = 0; + if ((in[x++] & 0x1F) != 0x06) { + return CRYPT_INVALID_PACKET; + } + + /* get the length */ + if (in[x] < 128) { + len = in[x++]; + } else { + if (in[x] < 0x81 || in[x] > 0x82) { + return CRYPT_INVALID_PACKET; + } + y = in[x++] & 0x7F; + len = 0; + while (y--) { + len = (len << 8) | (unsigned long)in[x++]; + } + } + + if (len < 1 || (len + x) > inlen) { + return CRYPT_INVALID_PACKET; + } + + /* decode words */ + y = 0; + t = 0; + while (len--) { + t = (t << 7) | (in[x] & 0x7F); + if (!(in[x++] & 0x80)) { + /* store t */ + if (y >= *outlen) { + return CRYPT_BUFFER_OVERFLOW; + } + if (y == 0) { + words[0] = t / 40; + words[1] = t % 40; + y = 2; + } else { + words[y++] = t; + } + t = 0; + } + } + + *outlen = y; + return CRYPT_OK; +} + +#endif + +/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/object_identifier/der_decode_object_identifier.c,v $ */ +/* $Revision: 1.6 $ */ +/* $Date: 2006/12/28 01:27:24 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_octet_string.c b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_octet_string.c new file mode 100644 index 00000000000..523d0baa057 --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_octet_string.c @@ -0,0 +1,91 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../../headers/tomcrypt.h" + +/** + @file der_decode_octet_string.c + ASN.1 DER, encode a OCTET STRING, Tom St Denis +*/ + + +#ifdef LTC_DER + +/** + Store a OCTET STRING + @param in The DER encoded OCTET STRING + @param inlen The size of the DER OCTET STRING + @param out [out] The array of octets stored (one per char) + @param outlen [in/out] The number of octets stored + @return CRYPT_OK if successful +*/ +int der_decode_octet_string(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen) +{ + unsigned long x, y, len; + + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(out != NULL); + LTC_ARGCHK(outlen != NULL); + + /* must have header at least */ + if (inlen < 2) { + return CRYPT_INVALID_PACKET; + } + + /* check for 0x04 */ + if ((in[0] & 0x1F) != 0x04) { + return CRYPT_INVALID_PACKET; + } + x = 1; + + /* decode the length */ + if (in[x] & 0x80) { + /* valid # of bytes in length are 1,2,3 */ + y = in[x] & 0x7F; + if ((y == 0) || (y > 3) || ((x + y) > inlen)) { + return CRYPT_INVALID_PACKET; + } + + /* read the length in */ + len = 0; + ++x; + while (y--) { + len = (len << 8) | in[x++]; + } + } else { + len = in[x++] & 0x7F; + } + + /* is it too long? */ + if (len > *outlen) { + *outlen = len; + return CRYPT_BUFFER_OVERFLOW; + } + + if (len + x > inlen) { + return CRYPT_INVALID_PACKET; + } + + /* read the data */ + for (y = 0; y < len; y++) { + out[y] = in[x++]; + } + + *outlen = y; + + return CRYPT_OK; +} + +#endif + +/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/octet/der_decode_octet_string.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:27:24 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_printable_string.c b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_printable_string.c new file mode 100644 index 00000000000..f8325934395 --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_printable_string.c @@ -0,0 +1,96 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../../headers/tomcrypt.h" + +/** + @file der_decode_printable_string.c + ASN.1 DER, encode a printable STRING, Tom St Denis +*/ + + +#ifdef LTC_DER + +/** + Store a printable STRING + @param in The DER encoded printable STRING + @param inlen The size of the DER printable STRING + @param out [out] The array of octets stored (one per char) + @param outlen [in/out] The number of octets stored + @return CRYPT_OK if successful +*/ +int der_decode_printable_string(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen) +{ + unsigned long x, y, len; + int t; + + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(out != NULL); + LTC_ARGCHK(outlen != NULL); + + /* must have header at least */ + if (inlen < 2) { + return CRYPT_INVALID_PACKET; + } + + /* check for 0x13 */ + if ((in[0] & 0x1F) != 0x13) { + return CRYPT_INVALID_PACKET; + } + x = 1; + + /* decode the length */ + if (in[x] & 0x80) { + /* valid # of bytes in length are 1,2,3 */ + y = in[x] & 0x7F; + if ((y == 0) || (y > 3) || ((x + y) > inlen)) { + return CRYPT_INVALID_PACKET; + } + + /* read the length in */ + len = 0; + ++x; + while (y--) { + len = (len << 8) | in[x++]; + } + } else { + len = in[x++] & 0x7F; + } + + /* is it too long? */ + if (len > *outlen) { + *outlen = len; + return CRYPT_BUFFER_OVERFLOW; + } + + if (len + x > inlen) { + return CRYPT_INVALID_PACKET; + } + + /* read the data */ + for (y = 0; y < len; y++) { + t = der_printable_value_decode(in[x++]); + if (t == -1) { + return CRYPT_INVALID_ARG; + } + out[y] = t; + } + + *outlen = y; + + return CRYPT_OK; +} + +#endif + +/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/printable_string/der_decode_printable_string.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:27:24 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_sequence_ex.c b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_sequence_ex.c new file mode 100644 index 00000000000..9b00f61b09a --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_sequence_ex.c @@ -0,0 +1,287 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../../headers/tomcrypt.h" +#include + + +/** + @file der_decode_sequence_ex.c + ASN.1 DER, decode a SEQUENCE, Tom St Denis +*/ + +#ifdef LTC_DER + +/** + Decode a SEQUENCE + @param in The DER encoded input + @param inlen The size of the input + @param list The list of items to decode + @param outlen The number of items in the list + @param ordered Search an unordeded or ordered list + @return CRYPT_OK on success +*/ +int der_decode_sequence_ex(const unsigned char *in, unsigned long inlen, + ltc_asn1_list *list, unsigned long outlen, int ordered) +{ + int err, type; + unsigned long size, x, y, z, i, blksize; + void *data; + + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(list != NULL); + + /* get blk size */ + if (inlen < 2) { + return CRYPT_INVALID_PACKET; + } + + /* sequence type? We allow 0x30 SEQUENCE and 0x31 SET since fundamentally they're the same structure */ + x = 0; + if (in[x] != 0x30 && in[x] != 0x31) { + return CRYPT_INVALID_PACKET; + } + ++x; + + if (in[x] < 128) { + blksize = in[x++]; + } else if (in[x] & 0x80) { + if (in[x] < 0x81 || in[x] > 0x83) { + return CRYPT_INVALID_PACKET; + } + y = in[x++] & 0x7F; + + /* would reading the len bytes overrun? */ + if (x + y > inlen) { + return CRYPT_INVALID_PACKET; + } + + /* read len */ + blksize = 0; + while (y--) { + blksize = (blksize << 8) | (unsigned long)in[x++]; + } + } + + /* would this blksize overflow? */ + if (x + blksize > inlen) { + return CRYPT_INVALID_PACKET; + } + + /* mark all as unused */ + for (i = 0; i < outlen; i++) { + list[i].used = 0; + } + + /* ok read data */ + inlen = blksize; + for (i = 0; i < outlen; i++) { + z = 0; + type = list[i].type; + size = list[i].size; + data = list[i].data; + if (!ordered && list[i].used == 1) { continue; } + + if (type == LTC_ASN1_EOL) { + break; + } + + switch (type) { + case LTC_ASN1_BOOLEAN: + z = inlen; + if ((err = der_decode_boolean(in + x, z, ((int *)data))) != CRYPT_OK) { + goto LBL_ERR; + } + if ((err = der_length_boolean(&z)) != CRYPT_OK) { + goto LBL_ERR; + } + break; + + case LTC_ASN1_INTEGER: + z = inlen; + if ((err = der_decode_integer(in + x, z, data)) != CRYPT_OK) { + if (!ordered) { continue; } + goto LBL_ERR; + } + if ((err = der_length_integer(data, &z)) != CRYPT_OK) { + goto LBL_ERR; + } + break; + + case LTC_ASN1_SHORT_INTEGER: + z = inlen; + if ((err = der_decode_short_integer(in + x, z, data)) != CRYPT_OK) { + if (!ordered) { continue; } + goto LBL_ERR; + } + if ((err = der_length_short_integer(((unsigned long*)data)[0], &z)) != CRYPT_OK) { + goto LBL_ERR; + } + + break; + + case LTC_ASN1_BIT_STRING: + z = inlen; + if ((err = der_decode_bit_string(in + x, z, data, &size)) != CRYPT_OK) { + if (!ordered) { continue; } + goto LBL_ERR; + } + list[i].size = size; + if ((err = der_length_bit_string(size, &z)) != CRYPT_OK) { + goto LBL_ERR; + } + break; + + case LTC_ASN1_OCTET_STRING: + z = inlen; + if ((err = der_decode_octet_string(in + x, z, data, &size)) != CRYPT_OK) { + if (!ordered) { continue; } + goto LBL_ERR; + } + list[i].size = size; + if ((err = der_length_octet_string(size, &z)) != CRYPT_OK) { + goto LBL_ERR; + } + break; + + case LTC_ASN1_NULL: + if (inlen < 2 || in[x] != 0x05 || in[x+1] != 0x00) { + if (!ordered) { continue; } + err = CRYPT_INVALID_PACKET; + goto LBL_ERR; + } + z = 2; + break; + + case LTC_ASN1_OBJECT_IDENTIFIER: + z = inlen; + if ((err = der_decode_object_identifier(in + x, z, data, &size)) != CRYPT_OK) { + if (!ordered) { continue; } + goto LBL_ERR; + } + list[i].size = size; + if ((err = der_length_object_identifier(data, size, &z)) != CRYPT_OK) { + goto LBL_ERR; + } + break; + + case LTC_ASN1_IA5_STRING: + z = inlen; + if ((err = der_decode_ia5_string(in + x, z, data, &size)) != CRYPT_OK) { + if (!ordered) { continue; } + goto LBL_ERR; + } + list[i].size = size; + if ((err = der_length_ia5_string(data, size, &z)) != CRYPT_OK) { + goto LBL_ERR; + } + break; + + + case LTC_ASN1_PRINTABLE_STRING: + z = inlen; + if ((err = der_decode_printable_string(in + x, z, data, &size)) != CRYPT_OK) { + if (!ordered) { continue; } + goto LBL_ERR; + } + list[i].size = size; + if ((err = der_length_printable_string(data, size, &z)) != CRYPT_OK) { + goto LBL_ERR; + } + break; + + case LTC_ASN1_UTF8_STRING: + z = inlen; + if ((err = der_decode_utf8_string(in + x, z, data, &size)) != CRYPT_OK) { + if (!ordered) { continue; } + goto LBL_ERR; + } + list[i].size = size; + if ((err = der_length_utf8_string(data, size, &z)) != CRYPT_OK) { + goto LBL_ERR; + } + break; + + case LTC_ASN1_UTCTIME: + z = inlen; + if ((err = der_decode_utctime(in + x, &z, data)) != CRYPT_OK) { + if (!ordered) { continue; } + goto LBL_ERR; + } + break; + + case LTC_ASN1_SET: + z = inlen; + if ((err = der_decode_set(in + x, z, data, size)) != CRYPT_OK) { + if (!ordered) { continue; } + goto LBL_ERR; + } + if ((err = der_length_sequence(data, size, &z)) != CRYPT_OK) { + goto LBL_ERR; + } + break; + + case LTC_ASN1_SETOF: + case LTC_ASN1_SEQUENCE: + /* detect if we have the right type */ + if ((type == LTC_ASN1_SETOF && (in[x] & 0x3F) != 0x31) || (type == LTC_ASN1_SEQUENCE && (in[x] & 0x3F) != 0x30)) { + err = CRYPT_INVALID_PACKET; + goto LBL_ERR; + } + + z = inlen; + if ((err = der_decode_sequence(in + x, z, data, size)) != CRYPT_OK) { + if (!ordered) { continue; } + goto LBL_ERR; + } + if ((err = der_length_sequence(data, size, &z)) != CRYPT_OK) { + goto LBL_ERR; + } + break; + + + case LTC_ASN1_CHOICE: + z = inlen; + if ((err = der_decode_choice(in + x, &z, data, size)) != CRYPT_OK) { + if (!ordered) { continue; } + goto LBL_ERR; + } + break; + + default: + err = CRYPT_INVALID_ARG; + goto LBL_ERR; + } + x += z; + inlen -= z; + list[i].used = 1; + if (!ordered) { + /* restart the decoder */ + i = -1; + } + } + + for (i = 0; i < outlen; i++) { + if (list[i].used == 0) { + err = CRYPT_INVALID_PACKET; + goto LBL_ERR; + } + } + err = CRYPT_OK; + +LBL_ERR: + return err; +} + +#endif + +/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/sequence/der_decode_sequence_ex.c,v $ */ +/* $Revision: 1.16 $ */ +/* $Date: 2006/12/28 01:27:24 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_sequence_flexi.c b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_sequence_flexi.c new file mode 100644 index 00000000000..9c648bc89c6 --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_sequence_flexi.c @@ -0,0 +1,386 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../../headers/tomcrypt.h" + +/** + @file der_decode_sequence_flexi.c + ASN.1 DER, decode an array of ASN.1 types with a flexi parser, Tom St Denis +*/ + +#ifdef LTC_DER + +static unsigned long fetch_length(const unsigned char *in, unsigned long inlen) +{ + unsigned long x, y, z; + + y = 0; + + /* skip type and read len */ + if (inlen < 2) { + return 0xFFFFFFFF; + } + ++in; ++y; + + /* read len */ + x = *in++; ++y; + + /* <128 means literal */ + if (x < 128) { + return x+y; + } + x &= 0x7F; /* the lower 7 bits are the length of the length */ + inlen -= 2; + + /* len means len of len! */ + if (x == 0 || x > 4 || x > inlen) { + return 0xFFFFFFFF; + } + + y += x; + z = 0; + while (x--) { + z = (z<<8) | ((unsigned long)*in); + ++in; + } + return z+y; +} + +/** + ASN.1 DER Flexi(ble) decoder will decode arbitrary DER packets and create a linked list of the decoded elements. + @param in The input buffer + @param inlen [in/out] The length of the input buffer and on output the amount of decoded data + @param out [out] A pointer to the linked list + @return CRYPT_OK on success. +*/ +int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, ltc_asn1_list **out) +{ + ltc_asn1_list *l; + unsigned long err, type, len, totlen, x, y; + void *realloc_tmp; + + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(inlen != NULL); + LTC_ARGCHK(out != NULL); + + l = NULL; + totlen = 0; + + /* scan the input and and get lengths and what not */ + while (*inlen) { + /* read the type byte */ + type = *in; + + /* fetch length */ + len = fetch_length(in, *inlen); + if (len > *inlen) { + err = CRYPT_INVALID_PACKET; + goto error; + } + + /* alloc new link */ + if (l == NULL) { + l = XCALLOC(1, sizeof(*l)); + if (l == NULL) { + err = CRYPT_MEM; + goto error; + } + } else { + l->next = XCALLOC(1, sizeof(*l)); + if (l->next == NULL) { + err = CRYPT_MEM; + goto error; + } + l->next->prev = l; + l = l->next; + } + + /* now switch on type */ + switch (type) { + case 0x01: /* BOOLEAN */ + l->type = LTC_ASN1_BOOLEAN; + l->size = 1; + l->data = XCALLOC(1, sizeof(int)); + + if ((err = der_decode_boolean(in, *inlen, l->data)) != CRYPT_OK) { + goto error; + } + + if ((err = der_length_boolean(&len)) != CRYPT_OK) { + goto error; + } + break; + + case 0x02: /* INTEGER */ + /* init field */ + l->type = LTC_ASN1_INTEGER; + l->size = 1; + if ((err = mp_init(&l->data)) != CRYPT_OK) { + goto error; + } + + /* decode field */ + if ((err = der_decode_integer(in, *inlen, l->data)) != CRYPT_OK) { + goto error; + } + + /* calc length of object */ + if ((err = der_length_integer(l->data, &len)) != CRYPT_OK) { + goto error; + } + break; + + case 0x03: /* BIT */ + /* init field */ + l->type = LTC_ASN1_BIT_STRING; + l->size = len * 8; /* *8 because we store decoded bits one per char and they are encoded 8 per char. */ + + if ((l->data = XCALLOC(1, l->size)) == NULL) { + err = CRYPT_MEM; + goto error; + } + + if ((err = der_decode_bit_string(in, *inlen, l->data, &l->size)) != CRYPT_OK) { + goto error; + } + + if ((err = der_length_bit_string(l->size, &len)) != CRYPT_OK) { + goto error; + } + break; + + case 0x04: /* OCTET */ + + /* init field */ + l->type = LTC_ASN1_OCTET_STRING; + l->size = len; + + if ((l->data = XCALLOC(1, l->size)) == NULL) { + err = CRYPT_MEM; + goto error; + } + + if ((err = der_decode_octet_string(in, *inlen, l->data, &l->size)) != CRYPT_OK) { + goto error; + } + + if ((err = der_length_octet_string(l->size, &len)) != CRYPT_OK) { + goto error; + } + break; + + case 0x05: /* NULL */ + + /* valid NULL is 0x05 0x00 */ + if (in[0] != 0x05 || in[1] != 0x00) { + err = CRYPT_INVALID_PACKET; + goto error; + } + + /* simple to store ;-) */ + l->type = LTC_ASN1_NULL; + l->data = NULL; + l->size = 0; + len = 2; + + break; + + case 0x06: /* OID */ + + /* init field */ + l->type = LTC_ASN1_OBJECT_IDENTIFIER; + l->size = len; + + if ((l->data = XCALLOC(len, sizeof(unsigned long))) == NULL) { + err = CRYPT_MEM; + goto error; + } + + if ((err = der_decode_object_identifier(in, *inlen, l->data, &l->size)) != CRYPT_OK) { + goto error; + } + + if ((err = der_length_object_identifier(l->data, l->size, &len)) != CRYPT_OK) { + goto error; + } + + /* resize it to save a bunch of mem */ + if ((realloc_tmp = XREALLOC(l->data, l->size * sizeof(unsigned long))) == NULL) { + /* out of heap but this is not an error */ + break; + } + l->data = realloc_tmp; + break; + + case 0x0C: /* UTF8 */ + + /* init field */ + l->type = LTC_ASN1_UTF8_STRING; + l->size = len; + + if ((l->data = XCALLOC(sizeof(wchar_t), l->size)) == NULL) { + err = CRYPT_MEM; + goto error; + } + + if ((err = der_decode_utf8_string(in, *inlen, l->data, &l->size)) != CRYPT_OK) { + goto error; + } + + if ((err = der_length_utf8_string(l->data, l->size, &len)) != CRYPT_OK) { + goto error; + } + break; + + case 0x13: /* PRINTABLE */ + + /* init field */ + l->type = LTC_ASN1_PRINTABLE_STRING; + l->size = len; + + if ((l->data = XCALLOC(1, l->size)) == NULL) { + err = CRYPT_MEM; + goto error; + } + + if ((err = der_decode_printable_string(in, *inlen, l->data, &l->size)) != CRYPT_OK) { + goto error; + } + + if ((err = der_length_printable_string(l->data, l->size, &len)) != CRYPT_OK) { + goto error; + } + break; + + case 0x16: /* IA5 */ + + /* init field */ + l->type = LTC_ASN1_IA5_STRING; + l->size = len; + + if ((l->data = XCALLOC(1, l->size)) == NULL) { + err = CRYPT_MEM; + goto error; + } + + if ((err = der_decode_ia5_string(in, *inlen, l->data, &l->size)) != CRYPT_OK) { + goto error; + } + + if ((err = der_length_ia5_string(l->data, l->size, &len)) != CRYPT_OK) { + goto error; + } + break; + + case 0x17: /* UTC TIME */ + + /* init field */ + l->type = LTC_ASN1_UTCTIME; + l->size = 1; + + if ((l->data = XCALLOC(1, sizeof(ltc_utctime))) == NULL) { + err = CRYPT_MEM; + goto error; + } + + len = *inlen; + if ((err = der_decode_utctime(in, &len, l->data)) != CRYPT_OK) { + goto error; + } + + if ((err = der_length_utctime(l->data, &len)) != CRYPT_OK) { + goto error; + } + break; + + case 0x30: /* SEQUENCE */ + case 0x31: /* SET */ + + /* init field */ + l->type = (type == 0x30) ? LTC_ASN1_SEQUENCE : LTC_ASN1_SET; + + /* we have to decode the SEQUENCE header and get it's length */ + + /* move past type */ + ++in; --(*inlen); + + /* read length byte */ + x = *in++; --(*inlen); + + /* smallest SEQUENCE/SET header */ + y = 2; + + /* now if it's > 127 the next bytes are the length of the length */ + if (x > 128) { + x &= 0x7F; + in += x; + *inlen -= x; + + /* update sequence header len */ + y += x; + } + + /* Sequence elements go as child */ + len = len - y; + if ((err = der_decode_sequence_flexi(in, &len, &(l->child))) != CRYPT_OK) { + goto error; + } + + /* len update */ + totlen += y; + + /* link them up y0 */ + l->child->parent = l; + + break; + default: + /* invalid byte ... this is a soft error */ + /* remove link */ + l = l->prev; + XFREE(l->next); + l->next = NULL; + goto outside; + } + + /* advance pointers */ + totlen += len; + in += len; + *inlen -= len; + } + +outside: + + /* rewind l please */ + while (l->prev != NULL || l->parent != NULL) { + if (l->parent != NULL) { + l = l->parent; + } else { + l = l->prev; + } + } + + /* return */ + *out = l; + *inlen = totlen; + return CRYPT_OK; + +error: + /* free list */ + der_sequence_free(l); + + return err; +} + +#endif + + +/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c,v $ */ +/* $Revision: 1.26 $ */ +/* $Date: 2006/12/28 01:27:24 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_sequence_multi.c b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_sequence_multi.c new file mode 100644 index 00000000000..ff633df3511 --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_sequence_multi.c @@ -0,0 +1,139 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../../headers/tomcrypt.h" +#include + + +/** + @file der_decode_sequence_multi.c + ASN.1 DER, decode a SEQUENCE, Tom St Denis +*/ + +#ifdef LTC_DER + +/** + Decode a SEQUENCE type using a VA list + @param in Input buffer + @param inlen Length of input in octets + @remark <...> is of the form (int, unsigned long, void*) + @return CRYPT_OK on success +*/ +int der_decode_sequence_multi(const unsigned char *in, unsigned long inlen, ...) +{ + int err, type; + unsigned long size, x; + void *data; + va_list args; + ltc_asn1_list *list; + + LTC_ARGCHK(in != NULL); + + /* get size of output that will be required */ + va_start(args, inlen); + x = 0; + for (;;) { + type = va_arg(args, int); + size = va_arg(args, unsigned long); + data = va_arg(args, void*); + + if (type == LTC_ASN1_EOL) { + break; + } + + switch (type) { + case LTC_ASN1_BOOLEAN: + case LTC_ASN1_INTEGER: + case LTC_ASN1_SHORT_INTEGER: + case LTC_ASN1_BIT_STRING: + case LTC_ASN1_OCTET_STRING: + case LTC_ASN1_NULL: + case LTC_ASN1_OBJECT_IDENTIFIER: + case LTC_ASN1_IA5_STRING: + case LTC_ASN1_PRINTABLE_STRING: + case LTC_ASN1_UTF8_STRING: + case LTC_ASN1_UTCTIME: + case LTC_ASN1_SET: + case LTC_ASN1_SETOF: + case LTC_ASN1_SEQUENCE: + case LTC_ASN1_CHOICE: + ++x; + break; + + default: + va_end(args); + return CRYPT_INVALID_ARG; + } + } + va_end(args); + + /* allocate structure for x elements */ + if (x == 0) { + return CRYPT_NOP; + } + + list = XCALLOC(sizeof(*list), x); + if (list == NULL) { + return CRYPT_MEM; + } + + /* fill in the structure */ + va_start(args, inlen); + x = 0; + for (;;) { + type = va_arg(args, int); + size = va_arg(args, unsigned long); + data = va_arg(args, void*); + + if (type == LTC_ASN1_EOL) { + break; + } + + switch (type) { + case LTC_ASN1_BOOLEAN: + case LTC_ASN1_INTEGER: + case LTC_ASN1_SHORT_INTEGER: + case LTC_ASN1_BIT_STRING: + case LTC_ASN1_OCTET_STRING: + case LTC_ASN1_NULL: + case LTC_ASN1_OBJECT_IDENTIFIER: + case LTC_ASN1_IA5_STRING: + case LTC_ASN1_PRINTABLE_STRING: + case LTC_ASN1_UTF8_STRING: + case LTC_ASN1_UTCTIME: + case LTC_ASN1_SEQUENCE: + case LTC_ASN1_SET: + case LTC_ASN1_SETOF: + case LTC_ASN1_CHOICE: + list[x].type = type; + list[x].size = size; + list[x++].data = data; + break; + + default: + va_end(args); + err = CRYPT_INVALID_ARG; + goto LBL_ERR; + } + } + va_end(args); + + err = der_decode_sequence(in, inlen, list, x); +LBL_ERR: + XFREE(list); + return err; +} + +#endif + + +/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/sequence/der_decode_sequence_multi.c,v $ */ +/* $Revision: 1.13 $ */ +/* $Date: 2006/12/28 01:27:24 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_short_integer.c b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_short_integer.c new file mode 100644 index 00000000000..907e4e1c3bb --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_short_integer.c @@ -0,0 +1,68 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../../headers/tomcrypt.h" + +/** + @file der_decode_short_integer.c + ASN.1 DER, decode an integer, Tom St Denis +*/ + + +#ifdef LTC_DER + +/** + Read a short integer + @param in The DER encoded data + @param inlen Size of data + @param num [out] The integer to decode + @return CRYPT_OK if successful +*/ +int der_decode_short_integer(const unsigned char *in, unsigned long inlen, unsigned long *num) +{ + unsigned long len, x, y; + + LTC_ARGCHK(num != NULL); + LTC_ARGCHK(in != NULL); + + /* check length */ + if (inlen < 2) { + return CRYPT_INVALID_PACKET; + } + + /* check header */ + x = 0; + if ((in[x++] & 0x1F) != 0x02) { + return CRYPT_INVALID_PACKET; + } + + /* get the packet len */ + len = in[x++]; + + if (x + len > inlen) { + return CRYPT_INVALID_PACKET; + } + + /* read number */ + y = 0; + while (len--) { + y = (y<<8) | (unsigned long)in[x++]; + } + *num = y; + + return CRYPT_OK; + +} + +#endif + +/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/short_integer/der_decode_short_integer.c,v $ */ +/* $Revision: 1.7 $ */ +/* $Date: 2006/12/28 01:27:24 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_utctime.c b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_utctime.c new file mode 100644 index 00000000000..7f3f0d76683 --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_utctime.c @@ -0,0 +1,127 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../../headers/tomcrypt.h" + +/** + @file der_decode_utctime.c + ASN.1 DER, decode a UTCTIME, Tom St Denis +*/ + +#ifdef LTC_DER + +static int char_to_int(unsigned char x) +{ + switch (x) { + case '0': return 0; + case '1': return 1; + case '2': return 2; + case '3': return 3; + case '4': return 4; + case '5': return 5; + case '6': return 6; + case '7': return 7; + case '8': return 8; + case '9': return 9; + } + return 100; +} + +#define DECODE_V(y, max) \ + y = char_to_int(buf[x])*10 + char_to_int(buf[x+1]); \ + if (y >= max) return CRYPT_INVALID_PACKET; \ + x += 2; + +/** + Decodes a UTC time structure in DER format (reads all 6 valid encoding formats) + @param in Input buffer + @param inlen Length of input buffer in octets + @param out [out] Destination of UTC time structure + @return CRYPT_OK if successful +*/ +int der_decode_utctime(const unsigned char *in, unsigned long *inlen, + ltc_utctime *out) +{ + unsigned char buf[32]; + unsigned long x; + int y; + + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(inlen != NULL); + LTC_ARGCHK(out != NULL); + + /* check header */ + if (*inlen < 2UL || (in[1] >= sizeof(buf)) || ((in[1] + 2UL) > *inlen)) { + return CRYPT_INVALID_PACKET; + } + + /* decode the string */ + for (x = 0; x < in[1]; x++) { + y = der_ia5_value_decode(in[x+2]); + if (y == -1) { + return CRYPT_INVALID_PACKET; + } + buf[x] = y; + } + *inlen = 2 + x; + + + /* possible encodings are +YYMMDDhhmmZ +YYMMDDhhmm+hh'mm' +YYMMDDhhmm-hh'mm' +YYMMDDhhmmssZ +YYMMDDhhmmss+hh'mm' +YYMMDDhhmmss-hh'mm' + + So let's do a trivial decode upto [including] mm + */ + + x = 0; + DECODE_V(out->YY, 100); + DECODE_V(out->MM, 13); + DECODE_V(out->DD, 32); + DECODE_V(out->hh, 24); + DECODE_V(out->mm, 60); + + /* clear timezone and seconds info */ + out->off_dir = out->off_hh = out->off_mm = out->ss = 0; + + /* now is it Z, +, - or 0-9 */ + if (buf[x] == 'Z') { + return CRYPT_OK; + } else if (buf[x] == '+' || buf[x] == '-') { + out->off_dir = (buf[x++] == '+') ? 0 : 1; + DECODE_V(out->off_hh, 24); + DECODE_V(out->off_mm, 60); + return CRYPT_OK; + } + + /* decode seconds */ + DECODE_V(out->ss, 60); + + /* now is it Z, +, - */ + if (buf[x] == 'Z') { + return CRYPT_OK; + } else if (buf[x] == '+' || buf[x] == '-') { + out->off_dir = (buf[x++] == '+') ? 0 : 1; + DECODE_V(out->off_hh, 24); + DECODE_V(out->off_mm, 60); + return CRYPT_OK; + } else { + return CRYPT_INVALID_PACKET; + } +} + +#endif + +/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/utctime/der_decode_utctime.c,v $ */ +/* $Revision: 1.9 $ */ +/* $Date: 2006/12/28 01:27:24 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_utf8_string.c b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_utf8_string.c new file mode 100644 index 00000000000..898d6cd2a76 --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_decode_utf8_string.c @@ -0,0 +1,111 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../../headers/tomcrypt.h" + +/** + @file der_decode_utf8_string.c + ASN.1 DER, encode a UTF8 STRING, Tom St Denis +*/ + + +#ifdef LTC_DER + +/** + Store a UTF8 STRING + @param in The DER encoded UTF8 STRING + @param inlen The size of the DER UTF8 STRING + @param out [out] The array of utf8s stored (one per char) + @param outlen [in/out] The number of utf8s stored + @return CRYPT_OK if successful +*/ +int der_decode_utf8_string(const unsigned char *in, unsigned long inlen, + wchar_t *out, unsigned long *outlen) +{ + wchar_t tmp; + unsigned long x, y, z, len; + + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(out != NULL); + LTC_ARGCHK(outlen != NULL); + + /* must have header at least */ + if (inlen < 2) { + return CRYPT_INVALID_PACKET; + } + + /* check for 0x0C */ + if ((in[0] & 0x1F) != 0x0C) { + return CRYPT_INVALID_PACKET; + } + x = 1; + + /* decode the length */ + if (in[x] & 0x80) { + /* valid # of bytes in length are 1,2,3 */ + y = in[x] & 0x7F; + if ((y == 0) || (y > 3) || ((x + y) > inlen)) { + return CRYPT_INVALID_PACKET; + } + + /* read the length in */ + len = 0; + ++x; + while (y--) { + len = (len << 8) | in[x++]; + } + } else { + len = in[x++] & 0x7F; + } + + if (len + x > inlen) { + return CRYPT_INVALID_PACKET; + } + + /* proceed to decode */ + for (y = 0; x < inlen; ) { + /* get first byte */ + tmp = in[x++]; + + /* count number of bytes */ + for (z = 0; (tmp & 0x80) && (z <= 4); z++, tmp = (tmp << 1) & 0xFF); + + if (z > 4 || (x + (z - 1) > inlen)) { + return CRYPT_INVALID_PACKET; + } + + /* decode, grab upper bits */ + tmp >>= z; + + /* grab remaining bytes */ + if (z > 1) { --z; } + while (z-- != 0) { + if ((in[x] & 0xC0) != 0x80) { + return CRYPT_INVALID_PACKET; + } + tmp = (tmp << 6) | ((wchar_t)in[x++] & 0x3F); + } + + if (y > *outlen) { + *outlen = y; + return CRYPT_BUFFER_OVERFLOW; + } + out[y++] = tmp; + } + *outlen = y; + + return CRYPT_OK; +} + +#endif + +/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/utf8/der_decode_utf8_string.c,v $ */ +/* $Revision: 1.8 $ */ +/* $Date: 2006/12/28 01:27:24 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_length_bit_string.c b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_length_bit_string.c new file mode 100644 index 00000000000..2bffa3b6341 --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_length_bit_string.c @@ -0,0 +1,54 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../../headers/tomcrypt.h" + +/** + @file der_length_bit_string.c + ASN.1 DER, get length of BIT STRING, Tom St Denis +*/ + +#ifdef LTC_DER +/** + Gets length of DER encoding of BIT STRING + @param nbits The number of bits in the string to encode + @param outlen [out] The length of the DER encoding for the given string + @return CRYPT_OK if successful +*/ +int der_length_bit_string(unsigned long nbits, unsigned long *outlen) +{ + unsigned long nbytes; + LTC_ARGCHK(outlen != NULL); + + /* get the number of the bytes */ + nbytes = (nbits >> 3) + ((nbits & 7) ? 1 : 0) + 1; + + if (nbytes < 128) { + /* 03 LL PP DD DD DD ... */ + *outlen = 2 + nbytes; + } else if (nbytes < 256) { + /* 03 81 LL PP DD DD DD ... */ + *outlen = 3 + nbytes; + } else if (nbytes < 65536) { + /* 03 82 LL LL PP DD DD DD ... */ + *outlen = 4 + nbytes; + } else { + return CRYPT_INVALID_ARG; + } + + return CRYPT_OK; +} + +#endif + + +/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/bit/der_length_bit_string.c,v $ */ +/* $Revision: 1.3 $ */ +/* $Date: 2006/12/28 01:27:24 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_length_boolean.c b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_length_boolean.c new file mode 100644 index 00000000000..e34ce5c65d8 --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_length_boolean.c @@ -0,0 +1,35 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../../headers/tomcrypt.h" + +/** + @file der_length_boolean.c + ASN.1 DER, get length of a BOOLEAN, Tom St Denis +*/ + +#ifdef LTC_DER +/** + Gets length of DER encoding of a BOOLEAN + @param outlen [out] The length of the DER encoding + @return CRYPT_OK if successful +*/ +int der_length_boolean(unsigned long *outlen) +{ + LTC_ARGCHK(outlen != NULL); + *outlen = 3; + return CRYPT_OK; +} + +#endif + +/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/boolean/der_length_boolean.c,v $ */ +/* $Revision: 1.3 $ */ +/* $Date: 2006/12/28 01:27:24 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_length_ia5_string.c b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_length_ia5_string.c new file mode 100644 index 00000000000..473bc793257 --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_length_ia5_string.c @@ -0,0 +1,194 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../../headers/tomcrypt.h" + +/** + @file der_length_ia5_string.c + ASN.1 DER, get length of IA5 STRING, Tom St Denis +*/ + +#ifdef LTC_DER + +static const struct { + int code, value; +} ia5_table[] = { +{ '\0', 0 }, +{ '\a', 7 }, +{ '\b', 8 }, +{ '\t', 9 }, +{ '\n', 10 }, +{ '\f', 12 }, +{ '\r', 13 }, +{ ' ', 32 }, +{ '!', 33 }, +{ '"', 34 }, +{ '#', 35 }, +{ '$', 36 }, +{ '%', 37 }, +{ '&', 38 }, +{ '\'', 39 }, +{ '(', 40 }, +{ ')', 41 }, +{ '*', 42 }, +{ '+', 43 }, +{ ',', 44 }, +{ '-', 45 }, +{ '.', 46 }, +{ '/', 47 }, +{ '0', 48 }, +{ '1', 49 }, +{ '2', 50 }, +{ '3', 51 }, +{ '4', 52 }, +{ '5', 53 }, +{ '6', 54 }, +{ '7', 55 }, +{ '8', 56 }, +{ '9', 57 }, +{ ':', 58 }, +{ ';', 59 }, +{ '<', 60 }, +{ '=', 61 }, +{ '>', 62 }, +{ '?', 63 }, +{ '@', 64 }, +{ 'A', 65 }, +{ 'B', 66 }, +{ 'C', 67 }, +{ 'D', 68 }, +{ 'E', 69 }, +{ 'F', 70 }, +{ 'G', 71 }, +{ 'H', 72 }, +{ 'I', 73 }, +{ 'J', 74 }, +{ 'K', 75 }, +{ 'L', 76 }, +{ 'M', 77 }, +{ 'N', 78 }, +{ 'O', 79 }, +{ 'P', 80 }, +{ 'Q', 81 }, +{ 'R', 82 }, +{ 'S', 83 }, +{ 'T', 84 }, +{ 'U', 85 }, +{ 'V', 86 }, +{ 'W', 87 }, +{ 'X', 88 }, +{ 'Y', 89 }, +{ 'Z', 90 }, +{ '[', 91 }, +{ '\\', 92 }, +{ ']', 93 }, +{ '^', 94 }, +{ '_', 95 }, +{ '`', 96 }, +{ 'a', 97 }, +{ 'b', 98 }, +{ 'c', 99 }, +{ 'd', 100 }, +{ 'e', 101 }, +{ 'f', 102 }, +{ 'g', 103 }, +{ 'h', 104 }, +{ 'i', 105 }, +{ 'j', 106 }, +{ 'k', 107 }, +{ 'l', 108 }, +{ 'm', 109 }, +{ 'n', 110 }, +{ 'o', 111 }, +{ 'p', 112 }, +{ 'q', 113 }, +{ 'r', 114 }, +{ 's', 115 }, +{ 't', 116 }, +{ 'u', 117 }, +{ 'v', 118 }, +{ 'w', 119 }, +{ 'x', 120 }, +{ 'y', 121 }, +{ 'z', 122 }, +{ '{', 123 }, +{ '|', 124 }, +{ '}', 125 }, +{ '~', 126 } +}; + +int der_ia5_char_encode(int c) +{ + int x; + for (x = 0; x < (int)(sizeof(ia5_table)/sizeof(ia5_table[0])); x++) { + if (ia5_table[x].code == c) { + return ia5_table[x].value; + } + } + return -1; +} + +int der_ia5_value_decode(int v) +{ + int x; + for (x = 0; x < (int)(sizeof(ia5_table)/sizeof(ia5_table[0])); x++) { + if (ia5_table[x].value == v) { + return ia5_table[x].code; + } + } + return -1; +} + +/** + Gets length of DER encoding of IA5 STRING + @param octets The values you want to encode + @param noctets The number of octets in the string to encode + @param outlen [out] The length of the DER encoding for the given string + @return CRYPT_OK if successful +*/ +int der_length_ia5_string(const unsigned char *octets, unsigned long noctets, unsigned long *outlen) +{ + unsigned long x; + + LTC_ARGCHK(outlen != NULL); + LTC_ARGCHK(octets != NULL); + + /* scan string for validity */ + for (x = 0; x < noctets; x++) { + if (der_ia5_char_encode(octets[x]) == -1) { + return CRYPT_INVALID_ARG; + } + } + + if (noctets < 128) { + /* 16 LL DD DD DD ... */ + *outlen = 2 + noctets; + } else if (noctets < 256) { + /* 16 81 LL DD DD DD ... */ + *outlen = 3 + noctets; + } else if (noctets < 65536UL) { + /* 16 82 LL LL DD DD DD ... */ + *outlen = 4 + noctets; + } else if (noctets < 16777216UL) { + /* 16 83 LL LL LL DD DD DD ... */ + *outlen = 5 + noctets; + } else { + return CRYPT_INVALID_ARG; + } + + return CRYPT_OK; +} + +#endif + + +/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/ia5/der_length_ia5_string.c,v $ */ +/* $Revision: 1.3 $ */ +/* $Date: 2006/12/28 01:27:24 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_length_integer.c b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_length_integer.c new file mode 100644 index 00000000000..540d205f028 --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_length_integer.c @@ -0,0 +1,82 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../../headers/tomcrypt.h" + +/** + @file der_length_integer.c + ASN.1 DER, get length of encoding, Tom St Denis +*/ + + +#ifdef LTC_DER +/** + Gets length of DER encoding of num + @param num The int to get the size of + @param outlen [out] The length of the DER encoding for the given integer + @return CRYPT_OK if successful +*/ +int der_length_integer(void *num, unsigned long *outlen) +{ + unsigned long z, len; + int leading_zero; + + LTC_ARGCHK(num != NULL); + LTC_ARGCHK(outlen != NULL); + + if (mp_cmp_d(num, 0) != LTC_MP_LT) { + /* positive */ + + /* we only need a leading zero if the msb of the first byte is one */ + if ((mp_count_bits(num) & 7) == 0 || mp_iszero(num) == LTC_MP_YES) { + leading_zero = 1; + } else { + leading_zero = 0; + } + + /* size for bignum */ + z = len = leading_zero + mp_unsigned_bin_size(num); + } else { + /* it's negative */ + /* find power of 2 that is a multiple of eight and greater than count bits */ + leading_zero = 0; + z = mp_count_bits(num); + z = z + (8 - (z & 7)); + if (((mp_cnt_lsb(num)+1)==mp_count_bits(num)) && ((mp_count_bits(num)&7)==0)) --z; + len = z = z >> 3; + } + + /* now we need a length */ + if (z < 128) { + /* short form */ + ++len; + } else { + /* long form (relies on z != 0), assumes length bytes < 128 */ + ++len; + + while (z) { + ++len; + z >>= 8; + } + } + + /* we need a 0x02 to indicate it's INTEGER */ + ++len; + + /* return length */ + *outlen = len; + return CRYPT_OK; +} + +#endif + +/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/integer/der_length_integer.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:27:24 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_length_object_identifier.c b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_length_object_identifier.c new file mode 100644 index 00000000000..94c326f7cac --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_length_object_identifier.c @@ -0,0 +1,89 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../../headers/tomcrypt.h" + +/** + @file der_length_object_identifier.c + ASN.1 DER, get length of Object Identifier, Tom St Denis +*/ + +#ifdef LTC_DER + +unsigned long der_object_identifier_bits(unsigned long x) +{ + unsigned long c; + x &= 0xFFFFFFFF; + c = 0; + while (x) { + ++c; + x >>= 1; + } + return c; +} + + +/** + Gets length of DER encoding of Object Identifier + @param nwords The number of OID words + @param words The actual OID words to get the size of + @param outlen [out] The length of the DER encoding for the given string + @return CRYPT_OK if successful +*/ +int der_length_object_identifier(unsigned long *words, unsigned long nwords, unsigned long *outlen) +{ + unsigned long y, z, t, wordbuf; + + LTC_ARGCHK(words != NULL); + LTC_ARGCHK(outlen != NULL); + + + /* must be >= 2 words */ + if (nwords < 2) { + return CRYPT_INVALID_ARG; + } + + /* word1 = 0,1,2,3 and word2 0..39 */ + if (words[0] > 3 || (words[0] < 2 && words[1] > 39)) { + return CRYPT_INVALID_ARG; + } + + /* leading word is the first two */ + z = 0; + wordbuf = words[0] * 40 + words[1]; + for (y = 1; y < nwords; y++) { + t = der_object_identifier_bits(wordbuf); + z += t/7 + ((t%7) ? 1 : 0) + (wordbuf == 0 ? 1 : 0); + if (y < nwords - 1) { + /* grab next word */ + wordbuf = words[y+1]; + } + } + + /* now depending on the length our length encoding changes */ + if (z < 128) { + z += 2; + } else if (z < 256) { + z += 3; + } else if (z < 65536UL) { + z += 4; + } else { + return CRYPT_INVALID_ARG; + } + + *outlen = z; + return CRYPT_OK; +} + +#endif + +/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/object_identifier/der_length_object_identifier.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:27:24 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_length_octet_string.c b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_length_octet_string.c new file mode 100644 index 00000000000..acd4053c16a --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_length_octet_string.c @@ -0,0 +1,53 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../../headers/tomcrypt.h" + +/** + @file der_length_octet_string.c + ASN.1 DER, get length of OCTET STRING, Tom St Denis +*/ + +#ifdef LTC_DER +/** + Gets length of DER encoding of OCTET STRING + @param noctets The number of octets in the string to encode + @param outlen [out] The length of the DER encoding for the given string + @return CRYPT_OK if successful +*/ +int der_length_octet_string(unsigned long noctets, unsigned long *outlen) +{ + LTC_ARGCHK(outlen != NULL); + + if (noctets < 128) { + /* 04 LL DD DD DD ... */ + *outlen = 2 + noctets; + } else if (noctets < 256) { + /* 04 81 LL DD DD DD ... */ + *outlen = 3 + noctets; + } else if (noctets < 65536UL) { + /* 04 82 LL LL DD DD DD ... */ + *outlen = 4 + noctets; + } else if (noctets < 16777216UL) { + /* 04 83 LL LL LL DD DD DD ... */ + *outlen = 5 + noctets; + } else { + return CRYPT_INVALID_ARG; + } + + return CRYPT_OK; +} + +#endif + + +/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/octet/der_length_octet_string.c,v $ */ +/* $Revision: 1.3 $ */ +/* $Date: 2006/12/28 01:27:24 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_length_printable_string.c b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_length_printable_string.c new file mode 100644 index 00000000000..ef1ed0ede37 --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_length_printable_string.c @@ -0,0 +1,166 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../../headers/tomcrypt.h" + +/** + @file der_length_printable_string.c + ASN.1 DER, get length of Printable STRING, Tom St Denis +*/ + +#ifdef LTC_DER + +static const struct { + int code, value; +} printable_table[] = { +{ ' ', 32 }, +{ '\'', 39 }, +{ '(', 40 }, +{ ')', 41 }, +{ '+', 43 }, +{ ',', 44 }, +{ '-', 45 }, +{ '.', 46 }, +{ '/', 47 }, +{ '0', 48 }, +{ '1', 49 }, +{ '2', 50 }, +{ '3', 51 }, +{ '4', 52 }, +{ '5', 53 }, +{ '6', 54 }, +{ '7', 55 }, +{ '8', 56 }, +{ '9', 57 }, +{ ':', 58 }, +{ '=', 61 }, +{ '?', 63 }, +{ 'A', 65 }, +{ 'B', 66 }, +{ 'C', 67 }, +{ 'D', 68 }, +{ 'E', 69 }, +{ 'F', 70 }, +{ 'G', 71 }, +{ 'H', 72 }, +{ 'I', 73 }, +{ 'J', 74 }, +{ 'K', 75 }, +{ 'L', 76 }, +{ 'M', 77 }, +{ 'N', 78 }, +{ 'O', 79 }, +{ 'P', 80 }, +{ 'Q', 81 }, +{ 'R', 82 }, +{ 'S', 83 }, +{ 'T', 84 }, +{ 'U', 85 }, +{ 'V', 86 }, +{ 'W', 87 }, +{ 'X', 88 }, +{ 'Y', 89 }, +{ 'Z', 90 }, +{ 'a', 97 }, +{ 'b', 98 }, +{ 'c', 99 }, +{ 'd', 100 }, +{ 'e', 101 }, +{ 'f', 102 }, +{ 'g', 103 }, +{ 'h', 104 }, +{ 'i', 105 }, +{ 'j', 106 }, +{ 'k', 107 }, +{ 'l', 108 }, +{ 'm', 109 }, +{ 'n', 110 }, +{ 'o', 111 }, +{ 'p', 112 }, +{ 'q', 113 }, +{ 'r', 114 }, +{ 's', 115 }, +{ 't', 116 }, +{ 'u', 117 }, +{ 'v', 118 }, +{ 'w', 119 }, +{ 'x', 120 }, +{ 'y', 121 }, +{ 'z', 122 }, +}; + +int der_printable_char_encode(int c) +{ + int x; + for (x = 0; x < (int)(sizeof(printable_table)/sizeof(printable_table[0])); x++) { + if (printable_table[x].code == c) { + return printable_table[x].value; + } + } + return -1; +} + +int der_printable_value_decode(int v) +{ + int x; + for (x = 0; x < (int)(sizeof(printable_table)/sizeof(printable_table[0])); x++) { + if (printable_table[x].value == v) { + return printable_table[x].code; + } + } + return -1; +} + +/** + Gets length of DER encoding of Printable STRING + @param octets The values you want to encode + @param noctets The number of octets in the string to encode + @param outlen [out] The length of the DER encoding for the given string + @return CRYPT_OK if successful +*/ +int der_length_printable_string(const unsigned char *octets, unsigned long noctets, unsigned long *outlen) +{ + unsigned long x; + + LTC_ARGCHK(outlen != NULL); + LTC_ARGCHK(octets != NULL); + + /* scan string for validity */ + for (x = 0; x < noctets; x++) { + if (der_printable_char_encode(octets[x]) == -1) { + return CRYPT_INVALID_ARG; + } + } + + if (noctets < 128) { + /* 16 LL DD DD DD ... */ + *outlen = 2 + noctets; + } else if (noctets < 256) { + /* 16 81 LL DD DD DD ... */ + *outlen = 3 + noctets; + } else if (noctets < 65536UL) { + /* 16 82 LL LL DD DD DD ... */ + *outlen = 4 + noctets; + } else if (noctets < 16777216UL) { + /* 16 83 LL LL LL DD DD DD ... */ + *outlen = 5 + noctets; + } else { + return CRYPT_INVALID_ARG; + } + + return CRYPT_OK; +} + +#endif + + +/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/printable_string/der_length_printable_string.c,v $ */ +/* $Revision: 1.3 $ */ +/* $Date: 2006/12/28 01:27:24 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_length_sequence.c b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_length_sequence.c new file mode 100644 index 00000000000..e75ed7e7eeb --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_length_sequence.c @@ -0,0 +1,169 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../../headers/tomcrypt.h" + +/** + @file der_length_sequence.c + ASN.1 DER, length a SEQUENCE, Tom St Denis +*/ + +#ifdef LTC_DER + +/** + Get the length of a DER sequence + @param list The sequences of items in the SEQUENCE + @param inlen The number of items + @param outlen [out] The length required in octets to store it + @return CRYPT_OK on success +*/ +int der_length_sequence(ltc_asn1_list *list, unsigned long inlen, + unsigned long *outlen) +{ + int err, type; + unsigned long size, x, y, z, i; + void *data; + + LTC_ARGCHK(list != NULL); + LTC_ARGCHK(outlen != NULL); + + /* get size of output that will be required */ + y = 0; + for (i = 0; i < inlen; i++) { + type = list[i].type; + size = list[i].size; + data = list[i].data; + + if (type == LTC_ASN1_EOL) { + break; + } + + switch (type) { + case LTC_ASN1_BOOLEAN: + if ((err = der_length_boolean(&x)) != CRYPT_OK) { + goto LBL_ERR; + } + y += x; + break; + + case LTC_ASN1_INTEGER: + if ((err = der_length_integer(data, &x)) != CRYPT_OK) { + goto LBL_ERR; + } + y += x; + break; + + case LTC_ASN1_SHORT_INTEGER: + if ((err = der_length_short_integer(*((unsigned long *)data), &x)) != CRYPT_OK) { + goto LBL_ERR; + } + y += x; + break; + + case LTC_ASN1_BIT_STRING: + if ((err = der_length_bit_string(size, &x)) != CRYPT_OK) { + goto LBL_ERR; + } + y += x; + break; + + case LTC_ASN1_OCTET_STRING: + if ((err = der_length_octet_string(size, &x)) != CRYPT_OK) { + goto LBL_ERR; + } + y += x; + break; + + case LTC_ASN1_NULL: + y += 2; + break; + + case LTC_ASN1_OBJECT_IDENTIFIER: + if ((err = der_length_object_identifier(data, size, &x)) != CRYPT_OK) { + goto LBL_ERR; + } + y += x; + break; + + case LTC_ASN1_IA5_STRING: + if ((err = der_length_ia5_string(data, size, &x)) != CRYPT_OK) { + goto LBL_ERR; + } + y += x; + break; + + case LTC_ASN1_PRINTABLE_STRING: + if ((err = der_length_printable_string(data, size, &x)) != CRYPT_OK) { + goto LBL_ERR; + } + y += x; + break; + + case LTC_ASN1_UTCTIME: + if ((err = der_length_utctime(data, &x)) != CRYPT_OK) { + goto LBL_ERR; + } + y += x; + break; + + case LTC_ASN1_UTF8_STRING: + if ((err = der_length_utf8_string(data, size, &x)) != CRYPT_OK) { + goto LBL_ERR; + } + y += x; + break; + + case LTC_ASN1_SET: + case LTC_ASN1_SETOF: + case LTC_ASN1_SEQUENCE: + if ((err = der_length_sequence(data, size, &x)) != CRYPT_OK) { + goto LBL_ERR; + } + y += x; + break; + + + default: + err = CRYPT_INVALID_ARG; + goto LBL_ERR; + } + } + + /* calc header size */ + z = y; + if (y < 128) { + y += 2; + } else if (y < 256) { + /* 0x30 0x81 LL */ + y += 3; + } else if (y < 65536UL) { + /* 0x30 0x82 LL LL */ + y += 4; + } else if (y < 16777216UL) { + /* 0x30 0x83 LL LL LL */ + y += 5; + } else { + err = CRYPT_INVALID_ARG; + goto LBL_ERR; + } + + /* store size */ + *outlen = y; + err = CRYPT_OK; + +LBL_ERR: + return err; +} + +#endif + +/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/sequence/der_length_sequence.c,v $ */ +/* $Revision: 1.14 $ */ +/* $Date: 2006/12/28 01:27:24 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_length_short_integer.c b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_length_short_integer.c new file mode 100644 index 00000000000..afa6dd0ee61 --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_length_short_integer.c @@ -0,0 +1,70 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../../headers/tomcrypt.h" + +/** + @file der_length_short_integer.c + ASN.1 DER, get length of encoding, Tom St Denis +*/ + + +#ifdef LTC_DER +/** + Gets length of DER encoding of num + @param num The integer to get the size of + @param outlen [out] The length of the DER encoding for the given integer + @return CRYPT_OK if successful +*/ +int der_length_short_integer(unsigned long num, unsigned long *outlen) +{ + unsigned long z, y, len; + + LTC_ARGCHK(outlen != NULL); + + /* force to 32 bits */ + num &= 0xFFFFFFFFUL; + + /* get the number of bytes */ + z = 0; + y = num; + while (y) { + ++z; + y >>= 8; + } + + /* handle zero */ + if (z == 0) { + z = 1; + } + + /* we need a 0x02 to indicate it's INTEGER */ + len = 1; + + /* length byte */ + ++len; + + /* bytes in value */ + len += z; + + /* see if msb is set */ + len += (num&(1UL<<((z<<3) - 1))) ? 1 : 0; + + /* return length */ + *outlen = len; + + return CRYPT_OK; +} + +#endif + +/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/short_integer/der_length_short_integer.c,v $ */ +/* $Revision: 1.6 $ */ +/* $Date: 2006/12/28 01:27:24 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_length_utctime.c b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_length_utctime.c new file mode 100644 index 00000000000..1296babbadf --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_length_utctime.c @@ -0,0 +1,46 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../../headers/tomcrypt.h" + +/** + @file der_length_utctime.c + ASN.1 DER, get length of UTCTIME, Tom St Denis +*/ + +#ifdef LTC_DER + +/** + Gets length of DER encoding of UTCTIME + @param utctime The UTC time structure to get the size of + @param outlen [out] The length of the DER encoding + @return CRYPT_OK if successful +*/ +int der_length_utctime(ltc_utctime *utctime, unsigned long *outlen) +{ + LTC_ARGCHK(outlen != NULL); + LTC_ARGCHK(utctime != NULL); + + if (utctime->off_hh == 0 && utctime->off_mm == 0) { + /* we encode as YYMMDDhhmmssZ */ + *outlen = 2 + 13; + } else { + /* we encode as YYMMDDhhmmss{+|-}hh'mm' */ + *outlen = 2 + 17; + } + + return CRYPT_OK; +} + +#endif + +/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/utctime/der_length_utctime.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:27:24 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_length_utf8_string.c b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_length_utf8_string.c new file mode 100644 index 00000000000..514db8450ef --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_length_utf8_string.c @@ -0,0 +1,83 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../../headers/tomcrypt.h" + +/** + @file der_length_utf8_string.c + ASN.1 DER, get length of UTF8 STRING, Tom St Denis +*/ + +#ifdef LTC_DER + +/** Return the size in bytes of a UTF-8 character + @param c The UTF-8 character to measure + @return The size in bytes +*/ +unsigned long der_utf8_charsize(const wchar_t c) +{ + if (c <= 0x7F) { + return 1; + } else if (c <= 0x7FF) { + return 2; + } else if (c <= 0xFFFF) { + return 3; + } else { + return 4; + } +} + +/** + Gets length of DER encoding of UTF8 STRING + @param in The characters to measure the length of + @param noctets The number of octets in the string to encode + @param outlen [out] The length of the DER encoding for the given string + @return CRYPT_OK if successful +*/ +int der_length_utf8_string(const wchar_t *in, unsigned long noctets, unsigned long *outlen) +{ + unsigned long x, len; + + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(outlen != NULL); + + len = 0; + for (x = 0; x < noctets; x++) { + if (in[x] < 0 || in[x] > 0x10FFFF) { + return CRYPT_INVALID_ARG; + } + len += der_utf8_charsize(in[x]); + } + + if (len < 128) { + /* 0C LL DD DD DD ... */ + *outlen = 2 + len; + } else if (len < 256) { + /* 0C 81 LL DD DD DD ... */ + *outlen = 3 + len; + } else if (len < 65536UL) { + /* 0C 82 LL LL DD DD DD ... */ + *outlen = 4 + len; + } else if (len < 16777216UL) { + /* 0C 83 LL LL LL DD DD DD ... */ + *outlen = 5 + len; + } else { + return CRYPT_INVALID_ARG; + } + + return CRYPT_OK; +} + +#endif + + +/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/utf8/der_length_utf8_string.c,v $ */ +/* $Revision: 1.6 $ */ +/* $Date: 2006/12/28 01:27:24 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_sequence_free.c b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_sequence_free.c new file mode 100644 index 00000000000..4887215397f --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/pk/asn1/der_sequence_free.c @@ -0,0 +1,65 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../../headers/tomcrypt.h" + +/** + @file der_sequence_free.c + ASN.1 DER, free's a structure allocated by der_decode_sequence_flexi(), Tom St Denis +*/ + +#ifdef LTC_DER + +/** + Free memory allocated by der_decode_sequence_flexi() + @param in The list to free +*/ +void der_sequence_free(ltc_asn1_list *in) +{ + ltc_asn1_list *l; + + /* walk to the start of the chain */ + while (in->prev != NULL || in->parent != NULL) { + if (in->parent != NULL) { + in = in->parent; + } else { + in = in->prev; + } + } + + /* now walk the list and free stuff */ + while (in != NULL) { + /* is there a child? */ + if (in->child) { + /* disconnect */ + in->child->parent = NULL; + der_sequence_free(in->child); + } + + switch (in->type) { + case LTC_ASN1_SET: + case LTC_ASN1_SETOF: + case LTC_ASN1_SEQUENCE: break; + case LTC_ASN1_INTEGER : if (in->data != NULL) { mp_clear(in->data); } break; + default : if (in->data != NULL) { XFREE(in->data); } + } + + /* move to next and free current */ + l = in->next; + free(in); + in = l; + } +} + +#endif + +/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/sequence/der_sequence_free.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:27:24 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/pk/ecc/ltc_ecc_map.c b/dep/StormLib/src/libtomcrypt/src/pk/ecc/ltc_ecc_map.c new file mode 100644 index 00000000000..5a1324c4986 --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/pk/ecc/ltc_ecc_map.c @@ -0,0 +1,76 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* Implements ECC over Z/pZ for curve y^2 = x^3 - 3x + b + * + * All curves taken from NIST recommendation paper of July 1999 + * Available at http://csrc.nist.gov/cryptval/dss.htm + */ +#include "../../headers/tomcrypt.h" + +/** + @file ltc_ecc_map.c + ECC Crypto, Tom St Denis +*/ + +#ifdef LTC_MECC + +/** + Map a projective jacbobian point back to affine space + @param P [in/out] The point to map + @param modulus The modulus of the field the ECC curve is in + @param mp The "b" value from montgomery_setup() + @return CRYPT_OK on success +*/ +int ltc_ecc_map(ecc_point *P, void *modulus, void *mp) +{ + void *t1, *t2; + int err; + + LTC_ARGCHK(P != NULL); + LTC_ARGCHK(modulus != NULL); + LTC_ARGCHK(mp != NULL); + + if ((err = mp_init_multi(&t1, &t2, NULL)) != CRYPT_OK) { + return CRYPT_MEM; + } + + /* first map z back to normal */ + if ((err = mp_montgomery_reduce(P->z, modulus, mp)) != CRYPT_OK) { goto done; } + + /* get 1/z */ + if ((err = mp_invmod(P->z, modulus, t1)) != CRYPT_OK) { goto done; } + + /* get 1/z^2 and 1/z^3 */ + if ((err = mp_sqr(t1, t2)) != CRYPT_OK) { goto done; } + if ((err = mp_mod(t2, modulus, t2)) != CRYPT_OK) { goto done; } + if ((err = mp_mul(t1, t2, t1)) != CRYPT_OK) { goto done; } + if ((err = mp_mod(t1, modulus, t1)) != CRYPT_OK) { goto done; } + + /* multiply against x/y */ + if ((err = mp_mul(P->x, t2, P->x)) != CRYPT_OK) { goto done; } + if ((err = mp_montgomery_reduce(P->x, modulus, mp)) != CRYPT_OK) { goto done; } + if ((err = mp_mul(P->y, t1, P->y)) != CRYPT_OK) { goto done; } + if ((err = mp_montgomery_reduce(P->y, modulus, mp)) != CRYPT_OK) { goto done; } + if ((err = mp_set(P->z, 1)) != CRYPT_OK) { goto done; } + + err = CRYPT_OK; +done: + mp_clear_multi(t1, t2, NULL); + return err; +} + +#endif + +/* $Source: /cvs/libtom/libtomcrypt/src/pk/ecc/ltc_ecc_map.c,v $ */ +/* $Revision: 1.7 $ */ +/* $Date: 2007/05/12 14:32:35 $ */ + diff --git a/dep/StormLib/src/libtomcrypt/src/pk/ecc/ltc_ecc_mul2add.c b/dep/StormLib/src/libtomcrypt/src/pk/ecc/ltc_ecc_mul2add.c new file mode 100644 index 00000000000..2c468eaafa1 --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/pk/ecc/ltc_ecc_mul2add.c @@ -0,0 +1,207 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* Implements ECC over Z/pZ for curve y^2 = x^3 - 3x + b + * + * All curves taken from NIST recommendation paper of July 1999 + * Available at http://csrc.nist.gov/cryptval/dss.htm + */ +#include "../../headers/tomcrypt.h" + +/** + @file ltc_ecc_mul2add.c + ECC Crypto, Shamir's Trick, Tom St Denis +*/ + +#ifdef LTC_MECC + +#ifdef LTC_ECC_SHAMIR + +/** Computes kA*A + kB*B = C using Shamir's Trick + @param A First point to multiply + @param kA What to multiple A by + @param B Second point to multiply + @param kB What to multiple B by + @param C [out] Destination point (can overlap with A or B + @param modulus Modulus for curve + @return CRYPT_OK on success +*/ +int ltc_ecc_mul2add(ecc_point *A, void *kA, + ecc_point *B, void *kB, + ecc_point *C, + void *modulus) +{ + ecc_point *precomp[16]; + unsigned bitbufA, bitbufB, lenA, lenB, len, x, y, nA, nB, nibble; + unsigned char *tA, *tB; + int err, first; + void *mp, *mu; + + /* argchks */ + LTC_ARGCHK(A != NULL); + LTC_ARGCHK(B != NULL); + LTC_ARGCHK(C != NULL); + LTC_ARGCHK(kA != NULL); + LTC_ARGCHK(kB != NULL); + LTC_ARGCHK(modulus != NULL); + + /* allocate memory */ + tA = XCALLOC(1, ECC_BUF_SIZE); + if (tA == NULL) { + return CRYPT_MEM; + } + tB = XCALLOC(1, ECC_BUF_SIZE); + if (tB == NULL) { + XFREE(tA); + return CRYPT_MEM; + } + + /* get sizes */ + lenA = mp_unsigned_bin_size(kA); + lenB = mp_unsigned_bin_size(kB); + len = MAX(lenA, lenB); + + /* sanity check */ + if ((lenA > ECC_BUF_SIZE) || (lenB > ECC_BUF_SIZE)) { + err = CRYPT_INVALID_ARG; + goto ERR_T; + } + + /* extract and justify kA */ + mp_to_unsigned_bin(kA, (len - lenA) + tA); + + /* extract and justify kB */ + mp_to_unsigned_bin(kB, (len - lenB) + tB); + + /* allocate the table */ + for (x = 0; x < 16; x++) { + precomp[x] = ltc_ecc_new_point(); + if (precomp[x] == NULL) { + for (y = 0; y < x; ++y) { + ltc_ecc_del_point(precomp[y]); + } + err = CRYPT_MEM; + goto ERR_T; + } + } + + /* init montgomery reduction */ + if ((err = mp_montgomery_setup(modulus, &mp)) != CRYPT_OK) { + goto ERR_P; + } + if ((err = mp_init(&mu)) != CRYPT_OK) { + goto ERR_MP; + } + if ((err = mp_montgomery_normalization(mu, modulus)) != CRYPT_OK) { + goto ERR_MU; + } + + /* copy ones ... */ + if ((err = mp_mulmod(A->x, mu, modulus, precomp[1]->x)) != CRYPT_OK) { goto ERR_MU; } + if ((err = mp_mulmod(A->y, mu, modulus, precomp[1]->y)) != CRYPT_OK) { goto ERR_MU; } + if ((err = mp_mulmod(A->z, mu, modulus, precomp[1]->z)) != CRYPT_OK) { goto ERR_MU; } + + if ((err = mp_mulmod(B->x, mu, modulus, precomp[1<<2]->x)) != CRYPT_OK) { goto ERR_MU; } + if ((err = mp_mulmod(B->y, mu, modulus, precomp[1<<2]->y)) != CRYPT_OK) { goto ERR_MU; } + if ((err = mp_mulmod(B->z, mu, modulus, precomp[1<<2]->z)) != CRYPT_OK) { goto ERR_MU; } + + /* precomp [i,0](A + B) table */ + if ((err = ltc_mp.ecc_ptdbl(precomp[1], precomp[2], modulus, mp)) != CRYPT_OK) { goto ERR_MU; } + if ((err = ltc_mp.ecc_ptadd(precomp[1], precomp[2], precomp[3], modulus, mp)) != CRYPT_OK) { goto ERR_MU; } + + /* precomp [0,i](A + B) table */ + if ((err = ltc_mp.ecc_ptdbl(precomp[1<<2], precomp[2<<2], modulus, mp)) != CRYPT_OK) { goto ERR_MU; } + if ((err = ltc_mp.ecc_ptadd(precomp[1<<2], precomp[2<<2], precomp[3<<2], modulus, mp)) != CRYPT_OK) { goto ERR_MU; } + + /* precomp [i,j](A + B) table (i != 0, j != 0) */ + for (x = 1; x < 4; x++) { + for (y = 1; y < 4; y++) { + if ((err = ltc_mp.ecc_ptadd(precomp[x], precomp[(y<<2)], precomp[x+(y<<2)], modulus, mp)) != CRYPT_OK) { goto ERR_MU; } + } + } + + nibble = 3; + first = 1; + bitbufA = tA[0]; + bitbufB = tB[0]; + + /* for every byte of the multiplicands */ + for (x = -1;; ) { + /* grab a nibble */ + if (++nibble == 4) { + ++x; if (x == len) break; + bitbufA = tA[x]; + bitbufB = tB[x]; + nibble = 0; + } + + /* extract two bits from both, shift/update */ + nA = (bitbufA >> 6) & 0x03; + nB = (bitbufB >> 6) & 0x03; + bitbufA = (bitbufA << 2) & 0xFF; + bitbufB = (bitbufB << 2) & 0xFF; + + /* if both zero, if first, continue */ + if ((nA == 0) && (nB == 0) && (first == 1)) { + continue; + } + + /* double twice, only if this isn't the first */ + if (first == 0) { + /* double twice */ + if ((err = ltc_mp.ecc_ptdbl(C, C, modulus, mp)) != CRYPT_OK) { goto ERR_MU; } + if ((err = ltc_mp.ecc_ptdbl(C, C, modulus, mp)) != CRYPT_OK) { goto ERR_MU; } + } + + /* if not both zero */ + if ((nA != 0) || (nB != 0)) { + if (first == 1) { + /* if first, copy from table */ + first = 0; + if ((err = mp_copy(precomp[nA + (nB<<2)]->x, C->x)) != CRYPT_OK) { goto ERR_MU; } + if ((err = mp_copy(precomp[nA + (nB<<2)]->y, C->y)) != CRYPT_OK) { goto ERR_MU; } + if ((err = mp_copy(precomp[nA + (nB<<2)]->z, C->z)) != CRYPT_OK) { goto ERR_MU; } + } else { + /* if not first, add from table */ + if ((err = ltc_mp.ecc_ptadd(C, precomp[nA + (nB<<2)], C, modulus, mp)) != CRYPT_OK) { goto ERR_MU; } + } + } + } + + /* reduce to affine */ + err = ltc_ecc_map(C, modulus, mp); + + /* clean up */ +ERR_MU: + mp_clear(mu); +ERR_MP: + mp_montgomery_free(mp); +ERR_P: + for (x = 0; x < 16; x++) { + ltc_ecc_del_point(precomp[x]); + } +ERR_T: +#ifdef LTC_CLEAN_STACK + zeromem(tA, ECC_BUF_SIZE); + zeromem(tB, ECC_BUF_SIZE); +#endif + XFREE(tA); + XFREE(tB); + + return err; +} + +#endif +#endif + +/* $Source: /cvs/libtom/libtomcrypt/src/pk/ecc/ltc_ecc_mul2add.c,v $ */ +/* $Revision: 1.8 $ */ +/* $Date: 2007/05/12 14:32:35 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/pk/ecc/ltc_ecc_mulmod.c b/dep/StormLib/src/libtomcrypt/src/pk/ecc/ltc_ecc_mulmod.c new file mode 100644 index 00000000000..f9d0cad832d --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/pk/ecc/ltc_ecc_mulmod.c @@ -0,0 +1,222 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* Implements ECC over Z/pZ for curve y^2 = x^3 - 3x + b + * + * All curves taken from NIST recommendation paper of July 1999 + * Available at http://csrc.nist.gov/cryptval/dss.htm + */ +#include "../../headers/tomcrypt.h" + +/** + @file ltc_ecc_mulmod.c + ECC Crypto, Tom St Denis +*/ + +#ifdef LTC_MECC +#ifndef LTC_ECC_TIMING_RESISTANT + +/* size of sliding window, don't change this! */ +#define WINSIZE 4 + +/** + Perform a point multiplication + @param k The scalar to multiply by + @param G The base point + @param R [out] Destination for kG + @param modulus The modulus of the field the ECC curve is in + @param map Boolean whether to map back to affine or not (1==map, 0 == leave in projective) + @return CRYPT_OK on success +*/ +int ltc_ecc_mulmod(void *k, ecc_point *G, ecc_point *R, void *modulus, int map) +{ + ecc_point *tG, *M[8]; + int i, j, err; + void *mu, *mp; + unsigned long buf; + int first, bitbuf, bitcpy, bitcnt, mode, digidx; + + LTC_ARGCHK(k != NULL); + LTC_ARGCHK(G != NULL); + LTC_ARGCHK(R != NULL); + LTC_ARGCHK(modulus != NULL); + + /* init montgomery reduction */ + if ((err = mp_montgomery_setup(modulus, &mp)) != CRYPT_OK) { + return err; + } + if ((err = mp_init(&mu)) != CRYPT_OK) { + mp_montgomery_free(mp); + return err; + } + if ((err = mp_montgomery_normalization(mu, modulus)) != CRYPT_OK) { + mp_montgomery_free(mp); + mp_clear(mu); + return err; + } + + /* alloc ram for window temps */ + for (i = 0; i < 8; i++) { + M[i] = ltc_ecc_new_point(); + if (M[i] == NULL) { + for (j = 0; j < i; j++) { + ltc_ecc_del_point(M[j]); + } + mp_montgomery_free(mp); + mp_clear(mu); + return CRYPT_MEM; + } + } + + /* make a copy of G incase R==G */ + tG = ltc_ecc_new_point(); + if (tG == NULL) { err = CRYPT_MEM; goto done; } + + /* tG = G and convert to montgomery */ + if (mp_cmp_d(mu, 1) == LTC_MP_EQ) { + if ((err = mp_copy(G->x, tG->x)) != CRYPT_OK) { goto done; } + if ((err = mp_copy(G->y, tG->y)) != CRYPT_OK) { goto done; } + if ((err = mp_copy(G->z, tG->z)) != CRYPT_OK) { goto done; } + } else { + if ((err = mp_mulmod(G->x, mu, modulus, tG->x)) != CRYPT_OK) { goto done; } + if ((err = mp_mulmod(G->y, mu, modulus, tG->y)) != CRYPT_OK) { goto done; } + if ((err = mp_mulmod(G->z, mu, modulus, tG->z)) != CRYPT_OK) { goto done; } + } + mp_clear(mu); + mu = NULL; + + /* calc the M tab, which holds kG for k==8..15 */ + /* M[0] == 8G */ + if ((err = ltc_mp.ecc_ptdbl(tG, M[0], modulus, mp)) != CRYPT_OK) { goto done; } + if ((err = ltc_mp.ecc_ptdbl(M[0], M[0], modulus, mp)) != CRYPT_OK) { goto done; } + if ((err = ltc_mp.ecc_ptdbl(M[0], M[0], modulus, mp)) != CRYPT_OK) { goto done; } + + /* now find (8+k)G for k=1..7 */ + for (j = 9; j < 16; j++) { + if ((err = ltc_mp.ecc_ptadd(M[j-9], tG, M[j-8], modulus, mp)) != CRYPT_OK) { goto done; } + } + + /* setup sliding window */ + mode = 0; + bitcnt = 1; + buf = 0; + digidx = mp_get_digit_count(k) - 1; + bitcpy = bitbuf = 0; + first = 1; + + /* perform ops */ + for (;;) { + /* grab next digit as required */ + if (--bitcnt == 0) { + if (digidx == -1) { + break; + } + buf = mp_get_digit(k, digidx); + bitcnt = (int) ltc_mp.bits_per_digit; + --digidx; + } + + /* grab the next msb from the ltiplicand */ + i = (buf >> (ltc_mp.bits_per_digit - 1)) & 1; + buf <<= 1; + + /* skip leading zero bits */ + if (mode == 0 && i == 0) { + continue; + } + + /* if the bit is zero and mode == 1 then we double */ + if (mode == 1 && i == 0) { + if ((err = ltc_mp.ecc_ptdbl(R, R, modulus, mp)) != CRYPT_OK) { goto done; } + continue; + } + + /* else we add it to the window */ + bitbuf |= (i << (WINSIZE - ++bitcpy)); + mode = 2; + + if (bitcpy == WINSIZE) { + /* if this is the first window we do a simple copy */ + if (first == 1) { + /* R = kG [k = first window] */ + if ((err = mp_copy(M[bitbuf-8]->x, R->x)) != CRYPT_OK) { goto done; } + if ((err = mp_copy(M[bitbuf-8]->y, R->y)) != CRYPT_OK) { goto done; } + if ((err = mp_copy(M[bitbuf-8]->z, R->z)) != CRYPT_OK) { goto done; } + first = 0; + } else { + /* normal window */ + /* ok window is filled so double as required and add */ + /* double first */ + for (j = 0; j < WINSIZE; j++) { + if ((err = ltc_mp.ecc_ptdbl(R, R, modulus, mp)) != CRYPT_OK) { goto done; } + } + + /* then add, bitbuf will be 8..15 [8..2^WINSIZE] guaranteed */ + if ((err = ltc_mp.ecc_ptadd(R, M[bitbuf-8], R, modulus, mp)) != CRYPT_OK) { goto done; } + } + /* empty window and reset */ + bitcpy = bitbuf = 0; + mode = 1; + } + } + + /* if bits remain then double/add */ + if (mode == 2 && bitcpy > 0) { + /* double then add */ + for (j = 0; j < bitcpy; j++) { + /* only double if we have had at least one add first */ + if (first == 0) { + if ((err = ltc_mp.ecc_ptdbl(R, R, modulus, mp)) != CRYPT_OK) { goto done; } + } + + bitbuf <<= 1; + if ((bitbuf & (1 << WINSIZE)) != 0) { + if (first == 1){ + /* first add, so copy */ + if ((err = mp_copy(tG->x, R->x)) != CRYPT_OK) { goto done; } + if ((err = mp_copy(tG->y, R->y)) != CRYPT_OK) { goto done; } + if ((err = mp_copy(tG->z, R->z)) != CRYPT_OK) { goto done; } + first = 0; + } else { + /* then add */ + if ((err = ltc_mp.ecc_ptadd(R, tG, R, modulus, mp)) != CRYPT_OK) { goto done; } + } + } + } + } + + /* map R back from projective space */ + if (map) { + err = ltc_ecc_map(R, modulus, mp); + } else { + err = CRYPT_OK; + } +done: + if (mu != NULL) { + mp_clear(mu); + } + mp_montgomery_free(mp); + ltc_ecc_del_point(tG); + for (i = 0; i < 8; i++) { + ltc_ecc_del_point(M[i]); + } + return err; +} + +#endif + +#undef WINSIZE + +#endif + +/* $Source: /cvs/libtom/libtomcrypt/src/pk/ecc/ltc_ecc_mulmod.c,v $ */ +/* $Revision: 1.26 $ */ +/* $Date: 2007/05/12 14:32:35 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/pk/ecc/ltc_ecc_points.c b/dep/StormLib/src/libtomcrypt/src/pk/ecc/ltc_ecc_points.c new file mode 100644 index 00000000000..f5a4acb4c5a --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/pk/ecc/ltc_ecc_points.c @@ -0,0 +1,60 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* Implements ECC over Z/pZ for curve y^2 = x^3 - 3x + b + * + * All curves taken from NIST recommendation paper of July 1999 + * Available at http://csrc.nist.gov/cryptval/dss.htm + */ +#include "../../headers/tomcrypt.h" + +/** + @file ltc_ecc_points.c + ECC Crypto, Tom St Denis +*/ + +#ifdef LTC_MECC + +/** + Allocate a new ECC point + @return A newly allocated point or NULL on error +*/ +ecc_point *ltc_ecc_new_point(void) +{ + ecc_point *p; + p = XCALLOC(1, sizeof(*p)); + if (p == NULL) { + return NULL; + } + if (mp_init_multi(&p->x, &p->y, &p->z, NULL) != CRYPT_OK) { + XFREE(p); + return NULL; + } + return p; +} + +/** Free an ECC point from memory + @param p The point to free +*/ +void ltc_ecc_del_point(ecc_point *p) +{ + /* prevents free'ing null arguments */ + if (p != NULL) { + mp_clear_multi(p->x, p->y, p->z, NULL); /* note: p->z may be NULL but that's ok with this function anyways */ + XFREE(p); + } +} + +#endif +/* $Source: /cvs/libtom/libtomcrypt/src/pk/ecc/ltc_ecc_points.c,v $ */ +/* $Revision: 1.7 $ */ +/* $Date: 2007/05/12 14:32:35 $ */ + diff --git a/dep/StormLib/src/libtomcrypt/src/pk/ecc/ltc_ecc_projective_add_point.c b/dep/StormLib/src/libtomcrypt/src/pk/ecc/ltc_ecc_projective_add_point.c new file mode 100644 index 00000000000..b4416fc77de --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/pk/ecc/ltc_ecc_projective_add_point.c @@ -0,0 +1,196 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* Implements ECC over Z/pZ for curve y^2 = x^3 - 3x + b + * + * All curves taken from NIST recommendation paper of July 1999 + * Available at http://csrc.nist.gov/cryptval/dss.htm + */ +#include "../../headers/tomcrypt.h" + +/** + @file ltc_ecc_projective_add_point.c + ECC Crypto, Tom St Denis +*/ + +#if defined(LTC_MECC) && (!defined(LTC_MECC_ACCEL) || defined(LTM_LTC_DESC)) + +/** + Add two ECC points + @param P The point to add + @param Q The point to add + @param R [out] The destination of the double + @param modulus The modulus of the field the ECC curve is in + @param mp The "b" value from montgomery_setup() + @return CRYPT_OK on success +*/ +int ltc_ecc_projective_add_point(ecc_point *P, ecc_point *Q, ecc_point *R, void *modulus, void *mp) +{ + void *t1, *t2, *x, *y, *z; + int err; + + LTC_ARGCHK(P != NULL); + LTC_ARGCHK(Q != NULL); + LTC_ARGCHK(R != NULL); + LTC_ARGCHK(modulus != NULL); + LTC_ARGCHK(mp != NULL); + + if ((err = mp_init_multi(&t1, &t2, &x, &y, &z, NULL)) != CRYPT_OK) { + return err; + } + + /* should we dbl instead? */ + if ((err = mp_sub(modulus, Q->y, t1)) != CRYPT_OK) { goto done; } + + if ( (mp_cmp(P->x, Q->x) == LTC_MP_EQ) && + (Q->z != NULL && mp_cmp(P->z, Q->z) == LTC_MP_EQ) && + (mp_cmp(P->y, Q->y) == LTC_MP_EQ || mp_cmp(P->y, t1) == LTC_MP_EQ)) { + mp_clear_multi(t1, t2, x, y, z, NULL); + return ltc_ecc_projective_dbl_point(P, R, modulus, mp); + } + + if ((err = mp_copy(P->x, x)) != CRYPT_OK) { goto done; } + if ((err = mp_copy(P->y, y)) != CRYPT_OK) { goto done; } + if ((err = mp_copy(P->z, z)) != CRYPT_OK) { goto done; } + + /* if Z is one then these are no-operations */ + if (Q->z != NULL) { + /* T1 = Z' * Z' */ + if ((err = mp_sqr(Q->z, t1)) != CRYPT_OK) { goto done; } + if ((err = mp_montgomery_reduce(t1, modulus, mp)) != CRYPT_OK) { goto done; } + /* X = X * T1 */ + if ((err = mp_mul(t1, x, x)) != CRYPT_OK) { goto done; } + if ((err = mp_montgomery_reduce(x, modulus, mp)) != CRYPT_OK) { goto done; } + /* T1 = Z' * T1 */ + if ((err = mp_mul(Q->z, t1, t1)) != CRYPT_OK) { goto done; } + if ((err = mp_montgomery_reduce(t1, modulus, mp)) != CRYPT_OK) { goto done; } + /* Y = Y * T1 */ + if ((err = mp_mul(t1, y, y)) != CRYPT_OK) { goto done; } + if ((err = mp_montgomery_reduce(y, modulus, mp)) != CRYPT_OK) { goto done; } + } + + /* T1 = Z*Z */ + if ((err = mp_sqr(z, t1)) != CRYPT_OK) { goto done; } + if ((err = mp_montgomery_reduce(t1, modulus, mp)) != CRYPT_OK) { goto done; } + /* T2 = X' * T1 */ + if ((err = mp_mul(Q->x, t1, t2)) != CRYPT_OK) { goto done; } + if ((err = mp_montgomery_reduce(t2, modulus, mp)) != CRYPT_OK) { goto done; } + /* T1 = Z * T1 */ + if ((err = mp_mul(z, t1, t1)) != CRYPT_OK) { goto done; } + if ((err = mp_montgomery_reduce(t1, modulus, mp)) != CRYPT_OK) { goto done; } + /* T1 = Y' * T1 */ + if ((err = mp_mul(Q->y, t1, t1)) != CRYPT_OK) { goto done; } + if ((err = mp_montgomery_reduce(t1, modulus, mp)) != CRYPT_OK) { goto done; } + + /* Y = Y - T1 */ + if ((err = mp_sub(y, t1, y)) != CRYPT_OK) { goto done; } + if (mp_cmp_d(y, 0) == LTC_MP_LT) { + if ((err = mp_add(y, modulus, y)) != CRYPT_OK) { goto done; } + } + /* T1 = 2T1 */ + if ((err = mp_add(t1, t1, t1)) != CRYPT_OK) { goto done; } + if (mp_cmp(t1, modulus) != LTC_MP_LT) { + if ((err = mp_sub(t1, modulus, t1)) != CRYPT_OK) { goto done; } + } + /* T1 = Y + T1 */ + if ((err = mp_add(t1, y, t1)) != CRYPT_OK) { goto done; } + if (mp_cmp(t1, modulus) != LTC_MP_LT) { + if ((err = mp_sub(t1, modulus, t1)) != CRYPT_OK) { goto done; } + } + /* X = X - T2 */ + if ((err = mp_sub(x, t2, x)) != CRYPT_OK) { goto done; } + if (mp_cmp_d(x, 0) == LTC_MP_LT) { + if ((err = mp_add(x, modulus, x)) != CRYPT_OK) { goto done; } + } + /* T2 = 2T2 */ + if ((err = mp_add(t2, t2, t2)) != CRYPT_OK) { goto done; } + if (mp_cmp(t2, modulus) != LTC_MP_LT) { + if ((err = mp_sub(t2, modulus, t2)) != CRYPT_OK) { goto done; } + } + /* T2 = X + T2 */ + if ((err = mp_add(t2, x, t2)) != CRYPT_OK) { goto done; } + if (mp_cmp(t2, modulus) != LTC_MP_LT) { + if ((err = mp_sub(t2, modulus, t2)) != CRYPT_OK) { goto done; } + } + + /* if Z' != 1 */ + if (Q->z != NULL) { + /* Z = Z * Z' */ + if ((err = mp_mul(z, Q->z, z)) != CRYPT_OK) { goto done; } + if ((err = mp_montgomery_reduce(z, modulus, mp)) != CRYPT_OK) { goto done; } + } + + /* Z = Z * X */ + if ((err = mp_mul(z, x, z)) != CRYPT_OK) { goto done; } + if ((err = mp_montgomery_reduce(z, modulus, mp)) != CRYPT_OK) { goto done; } + + /* T1 = T1 * X */ + if ((err = mp_mul(t1, x, t1)) != CRYPT_OK) { goto done; } + if ((err = mp_montgomery_reduce(t1, modulus, mp)) != CRYPT_OK) { goto done; } + /* X = X * X */ + if ((err = mp_sqr(x, x)) != CRYPT_OK) { goto done; } + if ((err = mp_montgomery_reduce(x, modulus, mp)) != CRYPT_OK) { goto done; } + /* T2 = T2 * x */ + if ((err = mp_mul(t2, x, t2)) != CRYPT_OK) { goto done; } + if ((err = mp_montgomery_reduce(t2, modulus, mp)) != CRYPT_OK) { goto done; } + /* T1 = T1 * X */ + if ((err = mp_mul(t1, x, t1)) != CRYPT_OK) { goto done; } + if ((err = mp_montgomery_reduce(t1, modulus, mp)) != CRYPT_OK) { goto done; } + + /* X = Y*Y */ + if ((err = mp_sqr(y, x)) != CRYPT_OK) { goto done; } + if ((err = mp_montgomery_reduce(x, modulus, mp)) != CRYPT_OK) { goto done; } + /* X = X - T2 */ + if ((err = mp_sub(x, t2, x)) != CRYPT_OK) { goto done; } + if (mp_cmp_d(x, 0) == LTC_MP_LT) { + if ((err = mp_add(x, modulus, x)) != CRYPT_OK) { goto done; } + } + + /* T2 = T2 - X */ + if ((err = mp_sub(t2, x, t2)) != CRYPT_OK) { goto done; } + if (mp_cmp_d(t2, 0) == LTC_MP_LT) { + if ((err = mp_add(t2, modulus, t2)) != CRYPT_OK) { goto done; } + } + /* T2 = T2 - X */ + if ((err = mp_sub(t2, x, t2)) != CRYPT_OK) { goto done; } + if (mp_cmp_d(t2, 0) == LTC_MP_LT) { + if ((err = mp_add(t2, modulus, t2)) != CRYPT_OK) { goto done; } + } + /* T2 = T2 * Y */ + if ((err = mp_mul(t2, y, t2)) != CRYPT_OK) { goto done; } + if ((err = mp_montgomery_reduce(t2, modulus, mp)) != CRYPT_OK) { goto done; } + /* Y = T2 - T1 */ + if ((err = mp_sub(t2, t1, y)) != CRYPT_OK) { goto done; } + if (mp_cmp_d(y, 0) == LTC_MP_LT) { + if ((err = mp_add(y, modulus, y)) != CRYPT_OK) { goto done; } + } + /* Y = Y/2 */ + if (mp_isodd(y)) { + if ((err = mp_add(y, modulus, y)) != CRYPT_OK) { goto done; } + } + if ((err = mp_div_2(y, y)) != CRYPT_OK) { goto done; } + + if ((err = mp_copy(x, R->x)) != CRYPT_OK) { goto done; } + if ((err = mp_copy(y, R->y)) != CRYPT_OK) { goto done; } + if ((err = mp_copy(z, R->z)) != CRYPT_OK) { goto done; } + + err = CRYPT_OK; +done: + mp_clear_multi(t1, t2, x, y, z, NULL); + return err; +} + +#endif + +/* $Source: /cvs/libtom/libtomcrypt/src/pk/ecc/ltc_ecc_projective_add_point.c,v $ */ +/* $Revision: 1.16 $ */ +/* $Date: 2007/05/12 14:32:35 $ */ + diff --git a/dep/StormLib/src/libtomcrypt/src/pk/ecc/ltc_ecc_projective_dbl_point.c b/dep/StormLib/src/libtomcrypt/src/pk/ecc/ltc_ecc_projective_dbl_point.c new file mode 100644 index 00000000000..b990e0a14aa --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/pk/ecc/ltc_ecc_projective_dbl_point.c @@ -0,0 +1,147 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* Implements ECC over Z/pZ for curve y^2 = x^3 - 3x + b + * + * All curves taken from NIST recommendation paper of July 1999 + * Available at http://csrc.nist.gov/cryptval/dss.htm + */ +#include "../../headers/tomcrypt.h" + +/** + @file ltc_ecc_projective_dbl_point.c + ECC Crypto, Tom St Denis +*/ + +#if defined(LTC_MECC) && (!defined(LTC_MECC_ACCEL) || defined(LTM_LTC_DESC)) + +/** + Double an ECC point + @param P The point to double + @param R [out] The destination of the double + @param modulus The modulus of the field the ECC curve is in + @param mp The "b" value from montgomery_setup() + @return CRYPT_OK on success +*/ +int ltc_ecc_projective_dbl_point(ecc_point *P, ecc_point *R, void *modulus, void *mp) +{ + void *t1, *t2; + int err; + + LTC_ARGCHK(P != NULL); + LTC_ARGCHK(R != NULL); + LTC_ARGCHK(modulus != NULL); + LTC_ARGCHK(mp != NULL); + + if ((err = mp_init_multi(&t1, &t2, NULL)) != CRYPT_OK) { + return err; + } + + if (P != R) { + if ((err = mp_copy(P->x, R->x)) != CRYPT_OK) { goto done; } + if ((err = mp_copy(P->y, R->y)) != CRYPT_OK) { goto done; } + if ((err = mp_copy(P->z, R->z)) != CRYPT_OK) { goto done; } + } + + /* t1 = Z * Z */ + if ((err = mp_sqr(R->z, t1)) != CRYPT_OK) { goto done; } + if ((err = mp_montgomery_reduce(t1, modulus, mp)) != CRYPT_OK) { goto done; } + /* Z = Y * Z */ + if ((err = mp_mul(R->z, R->y, R->z)) != CRYPT_OK) { goto done; } + if ((err = mp_montgomery_reduce(R->z, modulus, mp)) != CRYPT_OK) { goto done; } + /* Z = 2Z */ + if ((err = mp_add(R->z, R->z, R->z)) != CRYPT_OK) { goto done; } + if (mp_cmp(R->z, modulus) != LTC_MP_LT) { + if ((err = mp_sub(R->z, modulus, R->z)) != CRYPT_OK) { goto done; } + } + + /* T2 = X - T1 */ + if ((err = mp_sub(R->x, t1, t2)) != CRYPT_OK) { goto done; } + if (mp_cmp_d(t2, 0) == LTC_MP_LT) { + if ((err = mp_add(t2, modulus, t2)) != CRYPT_OK) { goto done; } + } + /* T1 = X + T1 */ + if ((err = mp_add(t1, R->x, t1)) != CRYPT_OK) { goto done; } + if (mp_cmp(t1, modulus) != LTC_MP_LT) { + if ((err = mp_sub(t1, modulus, t1)) != CRYPT_OK) { goto done; } + } + /* T2 = T1 * T2 */ + if ((err = mp_mul(t1, t2, t2)) != CRYPT_OK) { goto done; } + if ((err = mp_montgomery_reduce(t2, modulus, mp)) != CRYPT_OK) { goto done; } + /* T1 = 2T2 */ + if ((err = mp_add(t2, t2, t1)) != CRYPT_OK) { goto done; } + if (mp_cmp(t1, modulus) != LTC_MP_LT) { + if ((err = mp_sub(t1, modulus, t1)) != CRYPT_OK) { goto done; } + } + /* T1 = T1 + T2 */ + if ((err = mp_add(t1, t2, t1)) != CRYPT_OK) { goto done; } + if (mp_cmp(t1, modulus) != LTC_MP_LT) { + if ((err = mp_sub(t1, modulus, t1)) != CRYPT_OK) { goto done; } + } + + /* Y = 2Y */ + if ((err = mp_add(R->y, R->y, R->y)) != CRYPT_OK) { goto done; } + if (mp_cmp(R->y, modulus) != LTC_MP_LT) { + if ((err = mp_sub(R->y, modulus, R->y)) != CRYPT_OK) { goto done; } + } + /* Y = Y * Y */ + if ((err = mp_sqr(R->y, R->y)) != CRYPT_OK) { goto done; } + if ((err = mp_montgomery_reduce(R->y, modulus, mp)) != CRYPT_OK) { goto done; } + /* T2 = Y * Y */ + if ((err = mp_sqr(R->y, t2)) != CRYPT_OK) { goto done; } + if ((err = mp_montgomery_reduce(t2, modulus, mp)) != CRYPT_OK) { goto done; } + /* T2 = T2/2 */ + if (mp_isodd(t2)) { + if ((err = mp_add(t2, modulus, t2)) != CRYPT_OK) { goto done; } + } + if ((err = mp_div_2(t2, t2)) != CRYPT_OK) { goto done; } + /* Y = Y * X */ + if ((err = mp_mul(R->y, R->x, R->y)) != CRYPT_OK) { goto done; } + if ((err = mp_montgomery_reduce(R->y, modulus, mp)) != CRYPT_OK) { goto done; } + + /* X = T1 * T1 */ + if ((err = mp_sqr(t1, R->x)) != CRYPT_OK) { goto done; } + if ((err = mp_montgomery_reduce(R->x, modulus, mp)) != CRYPT_OK) { goto done; } + /* X = X - Y */ + if ((err = mp_sub(R->x, R->y, R->x)) != CRYPT_OK) { goto done; } + if (mp_cmp_d(R->x, 0) == LTC_MP_LT) { + if ((err = mp_add(R->x, modulus, R->x)) != CRYPT_OK) { goto done; } + } + /* X = X - Y */ + if ((err = mp_sub(R->x, R->y, R->x)) != CRYPT_OK) { goto done; } + if (mp_cmp_d(R->x, 0) == LTC_MP_LT) { + if ((err = mp_add(R->x, modulus, R->x)) != CRYPT_OK) { goto done; } + } + + /* Y = Y - X */ + if ((err = mp_sub(R->y, R->x, R->y)) != CRYPT_OK) { goto done; } + if (mp_cmp_d(R->y, 0) == LTC_MP_LT) { + if ((err = mp_add(R->y, modulus, R->y)) != CRYPT_OK) { goto done; } + } + /* Y = Y * T1 */ + if ((err = mp_mul(R->y, t1, R->y)) != CRYPT_OK) { goto done; } + if ((err = mp_montgomery_reduce(R->y, modulus, mp)) != CRYPT_OK) { goto done; } + /* Y = Y - T2 */ + if ((err = mp_sub(R->y, t2, R->y)) != CRYPT_OK) { goto done; } + if (mp_cmp_d(R->y, 0) == LTC_MP_LT) { + if ((err = mp_add(R->y, modulus, R->y)) != CRYPT_OK) { goto done; } + } + + err = CRYPT_OK; +done: + mp_clear_multi(t1, t2, NULL); + return err; +} +#endif +/* $Source: /cvs/libtom/libtomcrypt/src/pk/ecc/ltc_ecc_projective_dbl_point.c,v $ */ +/* $Revision: 1.11 $ */ +/* $Date: 2007/05/12 14:32:35 $ */ + diff --git a/dep/StormLib/src/libtomcrypt/src/pk/pkcs1/pkcs_1_mgf1.c b/dep/StormLib/src/libtomcrypt/src/pk/pkcs1/pkcs_1_mgf1.c new file mode 100644 index 00000000000..e8f6418067c --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/pk/pkcs1/pkcs_1_mgf1.c @@ -0,0 +1,108 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../../headers/tomcrypt.h" + +/** + @file pkcs_1_mgf1.c + The Mask Generation Function (MGF1) for LTC_PKCS #1, Tom St Denis +*/ + +#ifdef LTC_PKCS_1 + +/** + Perform LTC_PKCS #1 MGF1 (internal) + @param seed The seed for MGF1 + @param seedlen The length of the seed + @param hash_idx The index of the hash desired + @param mask [out] The destination + @param masklen The length of the mask desired + @return CRYPT_OK if successful +*/ +int pkcs_1_mgf1(int hash_idx, + const unsigned char *seed, unsigned long seedlen, + unsigned char *mask, unsigned long masklen) +{ + unsigned long hLen, x; + ulong32 counter; + int err; + hash_state *md; + unsigned char *buf; + + LTC_ARGCHK(seed != NULL); + LTC_ARGCHK(mask != NULL); + + /* ensure valid hash */ + if ((err = hash_is_valid(hash_idx)) != CRYPT_OK) { + return err; + } + + /* get hash output size */ + hLen = hash_descriptor[hash_idx].hashsize; + + /* allocate memory */ + md = XMALLOC(sizeof(hash_state)); + buf = XMALLOC(hLen); + if (md == NULL || buf == NULL) { + if (md != NULL) { + XFREE(md); + } + if (buf != NULL) { + XFREE(buf); + } + return CRYPT_MEM; + } + + /* start counter */ + counter = 0; + + while (masklen > 0) { + /* handle counter */ + STORE32H(counter, buf); + ++counter; + + /* get hash of seed || counter */ + if ((err = hash_descriptor[hash_idx].init(md)) != CRYPT_OK) { + goto LBL_ERR; + } + if ((err = hash_descriptor[hash_idx].process(md, seed, seedlen)) != CRYPT_OK) { + goto LBL_ERR; + } + if ((err = hash_descriptor[hash_idx].process(md, buf, 4)) != CRYPT_OK) { + goto LBL_ERR; + } + if ((err = hash_descriptor[hash_idx].done(md, buf)) != CRYPT_OK) { + goto LBL_ERR; + } + + /* store it */ + for (x = 0; x < hLen && masklen > 0; x++, masklen--) { + *mask++ = buf[x]; + } + } + + err = CRYPT_OK; +LBL_ERR: +#ifdef LTC_CLEAN_STACK + zeromem(buf, hLen); + zeromem(md, sizeof(hash_state)); +#endif + + XFREE(buf); + XFREE(md); + + return err; +} + +#endif /* LTC_PKCS_1 */ + +/* $Source: /cvs/libtom/libtomcrypt/src/pk/pkcs1/pkcs_1_mgf1.c,v $ */ +/* $Revision: 1.8 $ */ +/* $Date: 2007/05/12 14:32:35 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/pk/pkcs1/pkcs_1_oaep_decode.c b/dep/StormLib/src/libtomcrypt/src/pk/pkcs1/pkcs_1_oaep_decode.c new file mode 100644 index 00000000000..709ab8a8cd2 --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/pk/pkcs1/pkcs_1_oaep_decode.c @@ -0,0 +1,189 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../../headers/tomcrypt.h" + +/** + @file pkcs_1_oaep_decode.c + OAEP Padding for LTC_PKCS #1, Tom St Denis +*/ + +#ifdef LTC_PKCS_1 + +/** + LTC_PKCS #1 v2.00 OAEP decode + @param msg The encoded data to decode + @param msglen The length of the encoded data (octets) + @param lparam The session or system data (can be NULL) + @param lparamlen The length of the lparam + @param modulus_bitlen The bit length of the RSA modulus + @param hash_idx The index of the hash desired + @param out [out] Destination of decoding + @param outlen [in/out] The max size and resulting size of the decoding + @param res [out] Result of decoding, 1==valid, 0==invalid + @return CRYPT_OK if successful (even if invalid) +*/ +int pkcs_1_oaep_decode(const unsigned char *msg, unsigned long msglen, + const unsigned char *lparam, unsigned long lparamlen, + unsigned long modulus_bitlen, int hash_idx, + unsigned char *out, unsigned long *outlen, + int *res) +{ + unsigned char *DB, *seed, *mask; + unsigned long hLen, x, y, modulus_len; + int err; + + LTC_ARGCHK(msg != NULL); + LTC_ARGCHK(out != NULL); + LTC_ARGCHK(outlen != NULL); + LTC_ARGCHK(res != NULL); + + /* default to invalid packet */ + *res = 0; + + /* test valid hash */ + if ((err = hash_is_valid(hash_idx)) != CRYPT_OK) { + return err; + } + hLen = hash_descriptor[hash_idx].hashsize; + modulus_len = (modulus_bitlen >> 3) + (modulus_bitlen & 7 ? 1 : 0); + + /* test hash/message size */ + if ((2*hLen >= (modulus_len - 2)) || (msglen != modulus_len)) { + return CRYPT_PK_INVALID_SIZE; + } + + /* allocate ram for DB/mask/salt of size modulus_len */ + DB = XMALLOC(modulus_len); + mask = XMALLOC(modulus_len); + seed = XMALLOC(hLen); + if (DB == NULL || mask == NULL || seed == NULL) { + if (DB != NULL) { + XFREE(DB); + } + if (mask != NULL) { + XFREE(mask); + } + if (seed != NULL) { + XFREE(seed); + } + return CRYPT_MEM; + } + + /* ok so it's now in the form + + 0x00 || maskedseed || maskedDB + + 1 || hLen || modulus_len - hLen - 1 + + */ + + /* must have leading 0x00 byte */ + if (msg[0] != 0x00) { + err = CRYPT_OK; + goto LBL_ERR; + } + + /* now read the masked seed */ + x = 1; + XMEMCPY(seed, msg + x, hLen); + x += hLen; + + /* now read the masked DB */ + XMEMCPY(DB, msg + x, modulus_len - hLen - 1); + x += modulus_len - hLen - 1; + + /* compute MGF1 of maskedDB (hLen) */ + if ((err = pkcs_1_mgf1(hash_idx, DB, modulus_len - hLen - 1, mask, hLen)) != CRYPT_OK) { + goto LBL_ERR; + } + + /* XOR against seed */ + for (y = 0; y < hLen; y++) { + seed[y] ^= mask[y]; + } + + /* compute MGF1 of seed (k - hlen - 1) */ + if ((err = pkcs_1_mgf1(hash_idx, seed, hLen, mask, modulus_len - hLen - 1)) != CRYPT_OK) { + goto LBL_ERR; + } + + /* xor against DB */ + for (y = 0; y < (modulus_len - hLen - 1); y++) { + DB[y] ^= mask[y]; + } + + /* now DB == lhash || PS || 0x01 || M, PS == k - mlen - 2hlen - 2 zeroes */ + + /* compute lhash and store it in seed [reuse temps!] */ + x = modulus_len; + if (lparam != NULL) { + if ((err = hash_memory(hash_idx, lparam, lparamlen, seed, &x)) != CRYPT_OK) { + goto LBL_ERR; + } + } else { + /* can't pass hash_memory a NULL so use DB with zero length */ + if ((err = hash_memory(hash_idx, DB, 0, seed, &x)) != CRYPT_OK) { + goto LBL_ERR; + } + } + + /* compare the lhash'es */ + if (XMEMCMP(seed, DB, hLen) != 0) { + err = CRYPT_OK; + goto LBL_ERR; + } + + /* now zeroes before a 0x01 */ + for (x = hLen; x < (modulus_len - hLen - 1) && DB[x] == 0x00; x++) { + /* step... */ + } + + /* error out if wasn't 0x01 */ + if (x == (modulus_len - hLen - 1) || DB[x] != 0x01) { + err = CRYPT_INVALID_PACKET; + goto LBL_ERR; + } + + /* rest is the message (and skip 0x01) */ + if ((modulus_len - hLen - 1 - ++x) > *outlen) { + *outlen = modulus_len - hLen - 1 - x; + err = CRYPT_BUFFER_OVERFLOW; + goto LBL_ERR; + } + + /* copy message */ + *outlen = modulus_len - hLen - 1 - x; + XMEMCPY(out, DB + x, modulus_len - hLen - 1 - x); + x += modulus_len - hLen - 1; + + /* valid packet */ + *res = 1; + + err = CRYPT_OK; +LBL_ERR: +#ifdef LTC_CLEAN_STACK + zeromem(DB, modulus_len); + zeromem(seed, hLen); + zeromem(mask, modulus_len); +#endif + + XFREE(seed); + XFREE(mask); + XFREE(DB); + + return err; +} + +#endif /* LTC_PKCS_1 */ + +/* $Source: /cvs/libtom/libtomcrypt/src/pk/pkcs1/pkcs_1_oaep_decode.c,v $ */ +/* $Revision: 1.13 $ */ +/* $Date: 2007/05/12 14:32:35 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/pk/pkcs1/pkcs_1_pss_decode.c b/dep/StormLib/src/libtomcrypt/src/pk/pkcs1/pkcs_1_pss_decode.c new file mode 100644 index 00000000000..c3a7211ef9c --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/pk/pkcs1/pkcs_1_pss_decode.c @@ -0,0 +1,177 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../../headers/tomcrypt.h" + +/** + @file pkcs_1_pss_decode.c + LTC_PKCS #1 PSS Signature Padding, Tom St Denis +*/ + +#ifdef LTC_PKCS_1 + +/** + LTC_PKCS #1 v2.00 PSS decode + @param msghash The hash to verify + @param msghashlen The length of the hash (octets) + @param sig The signature data (encoded data) + @param siglen The length of the signature data (octets) + @param saltlen The length of the salt used (octets) + @param hash_idx The index of the hash desired + @param modulus_bitlen The bit length of the RSA modulus + @param res [out] The result of the comparison, 1==valid, 0==invalid + @return CRYPT_OK if successful (even if the comparison failed) +*/ +int pkcs_1_pss_decode(const unsigned char *msghash, unsigned long msghashlen, + const unsigned char *sig, unsigned long siglen, + unsigned long saltlen, int hash_idx, + unsigned long modulus_bitlen, int *res) +{ + unsigned char *DB, *mask, *salt, *hash; + unsigned long x, y, hLen, modulus_len; + int err; + hash_state md; + + LTC_ARGCHK(msghash != NULL); + LTC_ARGCHK(res != NULL); + + /* default to invalid */ + *res = 0; + + /* ensure hash is valid */ + if ((err = hash_is_valid(hash_idx)) != CRYPT_OK) { + return err; + } + + hLen = hash_descriptor[hash_idx].hashsize; + modulus_len = (modulus_bitlen>>3) + (modulus_bitlen & 7 ? 1 : 0); + + /* check sizes */ + if ((saltlen > modulus_len) || + (modulus_len < hLen + saltlen + 2) || (siglen != modulus_len)) { + return CRYPT_PK_INVALID_SIZE; + } + + /* allocate ram for DB/mask/salt/hash of size modulus_len */ + DB = XMALLOC(modulus_len); + mask = XMALLOC(modulus_len); + salt = XMALLOC(modulus_len); + hash = XMALLOC(modulus_len); + if (DB == NULL || mask == NULL || salt == NULL || hash == NULL) { + if (DB != NULL) { + XFREE(DB); + } + if (mask != NULL) { + XFREE(mask); + } + if (salt != NULL) { + XFREE(salt); + } + if (hash != NULL) { + XFREE(hash); + } + return CRYPT_MEM; + } + + /* ensure the 0xBC byte */ + if (sig[siglen-1] != 0xBC) { + err = CRYPT_INVALID_PACKET; + goto LBL_ERR; + } + + /* copy out the DB */ + x = 0; + XMEMCPY(DB, sig + x, modulus_len - hLen - 1); + x += modulus_len - hLen - 1; + + /* copy out the hash */ + XMEMCPY(hash, sig + x, hLen); + x += hLen; + + /* check the MSB */ + if ((sig[0] & ~(0xFF >> ((modulus_len<<3) - (modulus_bitlen-1)))) != 0) { + err = CRYPT_INVALID_PACKET; + goto LBL_ERR; + } + + /* generate mask of length modulus_len - hLen - 1 from hash */ + if ((err = pkcs_1_mgf1(hash_idx, hash, hLen, mask, modulus_len - hLen - 1)) != CRYPT_OK) { + goto LBL_ERR; + } + + /* xor against DB */ + for (y = 0; y < (modulus_len - hLen - 1); y++) { + DB[y] ^= mask[y]; + } + + /* now clear the first byte [make sure smaller than modulus] */ + DB[0] &= 0xFF >> ((modulus_len<<3) - (modulus_bitlen-1)); + + /* DB = PS || 0x01 || salt, PS == modulus_len - saltlen - hLen - 2 zero bytes */ + + /* check for zeroes and 0x01 */ + for (x = 0; x < modulus_len - saltlen - hLen - 2; x++) { + if (DB[x] != 0x00) { + err = CRYPT_INVALID_PACKET; + goto LBL_ERR; + } + } + + /* check for the 0x01 */ + if (DB[x++] != 0x01) { + err = CRYPT_INVALID_PACKET; + goto LBL_ERR; + } + + /* M = (eight) 0x00 || msghash || salt, mask = H(M) */ + if ((err = hash_descriptor[hash_idx].init(&md)) != CRYPT_OK) { + goto LBL_ERR; + } + zeromem(mask, 8); + if ((err = hash_descriptor[hash_idx].process(&md, mask, 8)) != CRYPT_OK) { + goto LBL_ERR; + } + if ((err = hash_descriptor[hash_idx].process(&md, msghash, msghashlen)) != CRYPT_OK) { + goto LBL_ERR; + } + if ((err = hash_descriptor[hash_idx].process(&md, DB+x, saltlen)) != CRYPT_OK) { + goto LBL_ERR; + } + if ((err = hash_descriptor[hash_idx].done(&md, mask)) != CRYPT_OK) { + goto LBL_ERR; + } + + /* mask == hash means valid signature */ + if (XMEMCMP(mask, hash, hLen) == 0) { + *res = 1; + } + + err = CRYPT_OK; +LBL_ERR: +#ifdef LTC_CLEAN_STACK + zeromem(DB, modulus_len); + zeromem(mask, modulus_len); + zeromem(salt, modulus_len); + zeromem(hash, modulus_len); +#endif + + XFREE(hash); + XFREE(salt); + XFREE(mask); + XFREE(DB); + + return err; +} + +#endif /* LTC_PKCS_1 */ + +/* $Source: /cvs/libtom/libtomcrypt/src/pk/pkcs1/pkcs_1_pss_decode.c,v $ */ +/* $Revision: 1.11 $ */ +/* $Date: 2007/05/12 14:32:35 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/pk/pkcs1/pkcs_1_v1_5_decode.c b/dep/StormLib/src/libtomcrypt/src/pk/pkcs1/pkcs_1_v1_5_decode.c new file mode 100644 index 00000000000..7c3711c17c9 --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/pk/pkcs1/pkcs_1_v1_5_decode.c @@ -0,0 +1,110 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../../headers/tomcrypt.h" + +/** @file pkcs_1_v1_5_decode.c + * + * LTC_PKCS #1 v1.5 Padding. (Andreas Lange) + */ + +#ifdef LTC_PKCS_1 + +/** @brief LTC_PKCS #1 v1.5 decode. + * + * @param msg The encoded data to decode + * @param msglen The length of the encoded data (octets) + * @param block_type Block type to use in padding (\sa ltc_pkcs_1_v1_5_blocks) + * @param modulus_bitlen The bit length of the RSA modulus + * @param out [out] Destination of decoding + * @param outlen [in/out] The max size and resulting size of the decoding + * @param is_valid [out] Boolean whether the padding was valid + * + * @return CRYPT_OK if successful (even if invalid) + */ +int pkcs_1_v1_5_decode(const unsigned char *msg, + unsigned long msglen, + int block_type, + unsigned long modulus_bitlen, + unsigned char *out, + unsigned long *outlen, + int *is_valid) +{ + unsigned long modulus_len, ps_len, i; + int result; + + /* default to invalid packet */ + *is_valid = 0; + + modulus_len = (modulus_bitlen >> 3) + (modulus_bitlen & 7 ? 1 : 0); + + /* test message size */ + + if ((msglen > modulus_len) || (modulus_len < 11)) { + return CRYPT_PK_INVALID_SIZE; + } + + /* separate encoded message */ + + if ((msg[0] != 0x00) || (msg[1] != (unsigned char)block_type)) { + result = CRYPT_INVALID_PACKET; + goto bail; + } + + if (block_type == LTC_LTC_PKCS_1_EME) { + for (i = 2; i < modulus_len; i++) { + /* separator */ + if (msg[i] == 0x00) { break; } + } + ps_len = i++ - 2; + + if ((i >= modulus_len) || (ps_len < 8)) { + /* There was no octet with hexadecimal value 0x00 to separate ps from m, + * or the length of ps is less than 8 octets. + */ + result = CRYPT_INVALID_PACKET; + goto bail; + } + } else { + for (i = 2; i < modulus_len - 1; i++) { + if (msg[i] != 0xFF) { break; } + } + + /* separator check */ + if (msg[i] != 0) { + /* There was no octet with hexadecimal value 0x00 to separate ps from m. */ + result = CRYPT_INVALID_PACKET; + goto bail; + } + + ps_len = i - 2; + } + + if (*outlen < (msglen - (2 + ps_len + 1))) { + *outlen = msglen - (2 + ps_len + 1); + result = CRYPT_BUFFER_OVERFLOW; + goto bail; + } + + *outlen = (msglen - (2 + ps_len + 1)); + XMEMCPY(out, &msg[2 + ps_len + 1], *outlen); + + /* valid packet */ + *is_valid = 1; + result = CRYPT_OK; +bail: + return result; +} /* pkcs_1_v1_5_decode */ + +#endif /* #ifdef LTC_PKCS_1 */ + +/* $Source: /cvs/libtom/libtomcrypt/src/pk/pkcs1/pkcs_1_v1_5_decode.c,v $ */ +/* $Revision: 1.7 $ */ +/* $Date: 2007/05/12 14:32:35 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/pk/rsa/rsa_exptmod.c b/dep/StormLib/src/libtomcrypt/src/pk/rsa/rsa_exptmod.c new file mode 100644 index 00000000000..ba44106f2b7 --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/pk/rsa/rsa_exptmod.c @@ -0,0 +1,113 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../../headers/tomcrypt.h" + +/** + @file rsa_exptmod.c + RSA LTC_PKCS exptmod, Tom St Denis +*/ + +#ifdef LTC_MRSA + +/** + Compute an RSA modular exponentiation + @param in The input data to send into RSA + @param inlen The length of the input (octets) + @param out [out] The destination + @param outlen [in/out] The max size and resulting size of the output + @param which Which exponent to use, e.g. PK_PRIVATE or PK_PUBLIC + @param key The RSA key to use + @return CRYPT_OK if successful +*/ +int rsa_exptmod(const unsigned char *in, unsigned long inlen, + unsigned char *out, unsigned long *outlen, int which, + rsa_key *key) +{ + void *tmp, *tmpa, *tmpb; + unsigned long x; + int err; + + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(out != NULL); + LTC_ARGCHK(outlen != NULL); + LTC_ARGCHK(key != NULL); + + /* is the key of the right type for the operation? */ + if (which == PK_PRIVATE && (key->type != PK_PRIVATE)) { + return CRYPT_PK_NOT_PRIVATE; + } + + /* must be a private or public operation */ + if (which != PK_PRIVATE && which != PK_PUBLIC) { + return CRYPT_PK_INVALID_TYPE; + } + + /* init and copy into tmp */ + if ((err = mp_init_multi(&tmp, &tmpa, &tmpb, NULL)) != CRYPT_OK) { return err; } + if ((err = mp_read_unsigned_bin(tmp, (unsigned char *)in, (int)inlen)) != CRYPT_OK) { goto error; } + + /* sanity check on the input */ + if (mp_cmp(key->N, tmp) == LTC_MP_LT) { + err = CRYPT_PK_INVALID_SIZE; + goto error; + } + + /* are we using the private exponent and is the key optimized? */ + if (which == PK_PRIVATE) { + /* tmpa = tmp^dP mod p */ + if ((err = mp_exptmod(tmp, key->dP, key->p, tmpa)) != CRYPT_OK) { goto error; } + + /* tmpb = tmp^dQ mod q */ + if ((err = mp_exptmod(tmp, key->dQ, key->q, tmpb)) != CRYPT_OK) { goto error; } + + /* tmp = (tmpa - tmpb) * qInv (mod p) */ + if ((err = mp_sub(tmpa, tmpb, tmp)) != CRYPT_OK) { goto error; } + if ((err = mp_mulmod(tmp, key->qP, key->p, tmp)) != CRYPT_OK) { goto error; } + + /* tmp = tmpb + q * tmp */ + if ((err = mp_mul(tmp, key->q, tmp)) != CRYPT_OK) { goto error; } + if ((err = mp_add(tmp, tmpb, tmp)) != CRYPT_OK) { goto error; } + } else { + /* exptmod it */ + if ((err = mp_exptmod(tmp, key->e, key->N, tmp)) != CRYPT_OK) { goto error; } + } + + /* read it back */ + x = (unsigned long)mp_unsigned_bin_size(key->N); + if (x > *outlen) { + *outlen = x; + err = CRYPT_BUFFER_OVERFLOW; + goto error; + } + + /* this should never happen ... */ + if (mp_unsigned_bin_size(tmp) > mp_unsigned_bin_size(key->N)) { + err = CRYPT_ERROR; + goto error; + } + *outlen = x; + + /* convert it */ + zeromem(out, x); + if ((err = mp_to_unsigned_bin(tmp, out+(x-mp_unsigned_bin_size(tmp)))) != CRYPT_OK) { goto error; } + + /* clean up and return */ + err = CRYPT_OK; +error: + mp_clear_multi(tmp, tmpa, tmpb, NULL); + return err; +} + +#endif + +/* $Source: /cvs/libtom/libtomcrypt/src/pk/rsa/rsa_exptmod.c,v $ */ +/* $Revision: 1.18 $ */ +/* $Date: 2007/05/12 14:32:35 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/pk/rsa/rsa_free.c b/dep/StormLib/src/libtomcrypt/src/pk/rsa/rsa_free.c new file mode 100644 index 00000000000..a10ed5928ce --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/pk/rsa/rsa_free.c @@ -0,0 +1,34 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../../headers/tomcrypt.h" + +/** + @file rsa_free.c + Free an RSA key, Tom St Denis +*/ + +#ifdef LTC_MRSA + +/** + Free an RSA key from memory + @param key The RSA key to free +*/ +void rsa_free(rsa_key *key) +{ + LTC_ARGCHKVD(key != NULL); + mp_clear_multi(key->e, key->d, key->N, key->dQ, key->dP, key->qP, key->p, key->q, NULL); +} + +#endif + +/* $Source: /cvs/libtom/libtomcrypt/src/pk/rsa/rsa_free.c,v $ */ +/* $Revision: 1.10 $ */ +/* $Date: 2007/05/12 14:32:35 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/pk/rsa/rsa_import.c b/dep/StormLib/src/libtomcrypt/src/pk/rsa/rsa_import.c new file mode 100644 index 00000000000..6254fd7ff86 --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/pk/rsa/rsa_import.c @@ -0,0 +1,143 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../../headers/tomcrypt.h" + +/** + @file rsa_import.c + Import a LTC_PKCS RSA key, Tom St Denis +*/ + +#ifdef LTC_MRSA + +/** + Import an RSAPublicKey or RSAPrivateKey [two-prime only, only support >= 1024-bit keys, defined in LTC_PKCS #1 v2.1] + @param in The packet to import from + @param inlen It's length (octets) + @param key [out] Destination for newly imported key + @return CRYPT_OK if successful, upon error allocated memory is freed +*/ +int rsa_import(const unsigned char *in, unsigned long inlen, rsa_key *key) +{ + int err; + void *zero; + unsigned char *tmpbuf; + unsigned long t, x, y, z, tmpoid[16]; + ltc_asn1_list ssl_pubkey_hashoid[2]; + ltc_asn1_list ssl_pubkey[2]; + + LTC_ARGCHK(in != NULL); + LTC_ARGCHK(key != NULL); + LTC_ARGCHK(ltc_mp.name != NULL); + + /* init key */ + if ((err = mp_init_multi(&key->e, &key->d, &key->N, &key->dQ, + &key->dP, &key->qP, &key->p, &key->q, NULL)) != CRYPT_OK) { + return err; + } + + /* see if the OpenSSL DER format RSA public key will work */ + tmpbuf = XCALLOC(1, MAX_RSA_SIZE*8); + if (tmpbuf == NULL) { + err = CRYPT_MEM; + goto LBL_ERR; + } + + /* this includes the internal hash ID and optional params (NULL in this case) */ + LTC_SET_ASN1(ssl_pubkey_hashoid, 0, LTC_ASN1_OBJECT_IDENTIFIER, tmpoid, sizeof(tmpoid)/sizeof(tmpoid[0])); + LTC_SET_ASN1(ssl_pubkey_hashoid, 1, LTC_ASN1_NULL, NULL, 0); + + /* the actual format of the SSL DER key is odd, it stores a RSAPublicKey in a **BIT** string ... so we have to extract it + then proceed to convert bit to octet + */ + LTC_SET_ASN1(ssl_pubkey, 0, LTC_ASN1_SEQUENCE, &ssl_pubkey_hashoid, 2); + LTC_SET_ASN1(ssl_pubkey, 1, LTC_ASN1_BIT_STRING, tmpbuf, MAX_RSA_SIZE*8); + + if (der_decode_sequence(in, inlen, + ssl_pubkey, 2UL) == CRYPT_OK) { + + /* ok now we have to reassemble the BIT STRING to an OCTET STRING. Thanks OpenSSL... */ + for (t = y = z = x = 0; x < ssl_pubkey[1].size; x++) { + y = (y << 1) | tmpbuf[x]; + if (++z == 8) { + tmpbuf[t++] = (unsigned char)y; + y = 0; + z = 0; + } + } + + /* now it should be SEQUENCE { INTEGER, INTEGER } */ + if ((err = der_decode_sequence_multi(tmpbuf, t, + LTC_ASN1_INTEGER, 1UL, key->N, + LTC_ASN1_INTEGER, 1UL, key->e, + LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { + XFREE(tmpbuf); + goto LBL_ERR; + } + XFREE(tmpbuf); + key->type = PK_PUBLIC; + return CRYPT_OK; + } + XFREE(tmpbuf); + + /* not SSL public key, try to match against LTC_PKCS #1 standards */ + if ((err = der_decode_sequence_multi(in, inlen, + LTC_ASN1_INTEGER, 1UL, key->N, + LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { + goto LBL_ERR; + } + + if (mp_cmp_d(key->N, 0) == LTC_MP_EQ) { + if ((err = mp_init(&zero)) != CRYPT_OK) { + goto LBL_ERR; + } + /* it's a private key */ + if ((err = der_decode_sequence_multi(in, inlen, + LTC_ASN1_INTEGER, 1UL, zero, + LTC_ASN1_INTEGER, 1UL, key->N, + LTC_ASN1_INTEGER, 1UL, key->e, + LTC_ASN1_INTEGER, 1UL, key->d, + LTC_ASN1_INTEGER, 1UL, key->p, + LTC_ASN1_INTEGER, 1UL, key->q, + LTC_ASN1_INTEGER, 1UL, key->dP, + LTC_ASN1_INTEGER, 1UL, key->dQ, + LTC_ASN1_INTEGER, 1UL, key->qP, + LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { + mp_clear(zero); + goto LBL_ERR; + } + mp_clear(zero); + key->type = PK_PRIVATE; + } else if (mp_cmp_d(key->N, 1) == LTC_MP_EQ) { + /* we don't support multi-prime RSA */ + err = CRYPT_PK_INVALID_TYPE; + goto LBL_ERR; + } else { + /* it's a public key and we lack e */ + if ((err = der_decode_sequence_multi(in, inlen, + LTC_ASN1_INTEGER, 1UL, key->N, + LTC_ASN1_INTEGER, 1UL, key->e, + LTC_ASN1_EOL, 0UL, NULL)) != CRYPT_OK) { + goto LBL_ERR; + } + key->type = PK_PUBLIC; + } + return CRYPT_OK; +LBL_ERR: + mp_clear_multi(key->d, key->e, key->N, key->dQ, key->dP, key->qP, key->p, key->q, NULL); + return err; +} + +#endif /* LTC_MRSA */ + + +/* $Source: /cvs/libtom/libtomcrypt/src/pk/rsa/rsa_import.c,v $ */ +/* $Revision: 1.23 $ */ +/* $Date: 2007/05/12 14:32:35 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/pk/rsa/rsa_make_key.c b/dep/StormLib/src/libtomcrypt/src/pk/rsa/rsa_make_key.c new file mode 100644 index 00000000000..bd37b4ae1cb --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/pk/rsa/rsa_make_key.c @@ -0,0 +1,112 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../../headers/tomcrypt.h" + +/** + @file rsa_make_key.c + RSA key generation, Tom St Denis +*/ + +#ifdef LTC_MRSA + +/** + Create an RSA key + @param prng An active PRNG state + @param wprng The index of the PRNG desired + @param size The size of the modulus (key size) desired (octets) + @param e The "e" value (public key). e==65537 is a good choice + @param key [out] Destination of a newly created private key pair + @return CRYPT_OK if successful, upon error all allocated ram is freed +*/ +int rsa_make_key(prng_state *prng, int wprng, int size, long e, rsa_key *key) +{ + void *p, *q, *tmp1, *tmp2, *tmp3; + int err; + + LTC_ARGCHK(ltc_mp.name != NULL); + LTC_ARGCHK(key != NULL); + + if ((size < (MIN_RSA_SIZE/8)) || (size > (MAX_RSA_SIZE/8))) { + return CRYPT_INVALID_KEYSIZE; + } + + if ((e < 3) || ((e & 1) == 0)) { + return CRYPT_INVALID_ARG; + } + + if ((err = prng_is_valid(wprng)) != CRYPT_OK) { + return err; + } + + if ((err = mp_init_multi(&p, &q, &tmp1, &tmp2, &tmp3, NULL)) != CRYPT_OK) { + return err; + } + + /* make primes p and q (optimization provided by Wayne Scott) */ + if ((err = mp_set_int(tmp3, e)) != CRYPT_OK) { goto errkey; } /* tmp3 = e */ + + /* make prime "p" */ + do { + if ((err = rand_prime( p, size/2, prng, wprng)) != CRYPT_OK) { goto errkey; } + if ((err = mp_sub_d( p, 1, tmp1)) != CRYPT_OK) { goto errkey; } /* tmp1 = p-1 */ + if ((err = mp_gcd( tmp1, tmp3, tmp2)) != CRYPT_OK) { goto errkey; } /* tmp2 = gcd(p-1, e) */ + } while (mp_cmp_d( tmp2, 1) != 0); /* while e divides p-1 */ + + /* make prime "q" */ + do { + if ((err = rand_prime( q, size/2, prng, wprng)) != CRYPT_OK) { goto errkey; } + if ((err = mp_sub_d( q, 1, tmp1)) != CRYPT_OK) { goto errkey; } /* tmp1 = q-1 */ + if ((err = mp_gcd( tmp1, tmp3, tmp2)) != CRYPT_OK) { goto errkey; } /* tmp2 = gcd(q-1, e) */ + } while (mp_cmp_d( tmp2, 1) != 0); /* while e divides q-1 */ + + /* tmp1 = lcm(p-1, q-1) */ + if ((err = mp_sub_d( p, 1, tmp2)) != CRYPT_OK) { goto errkey; } /* tmp2 = p-1 */ + /* tmp1 = q-1 (previous do/while loop) */ + if ((err = mp_lcm( tmp1, tmp2, tmp1)) != CRYPT_OK) { goto errkey; } /* tmp1 = lcm(p-1, q-1) */ + + /* make key */ + if ((err = mp_init_multi(&key->e, &key->d, &key->N, &key->dQ, &key->dP, &key->qP, &key->p, &key->q, NULL)) != CRYPT_OK) { + goto errkey; + } + + if ((err = mp_set_int( key->e, e)) != CRYPT_OK) { goto errkey; } /* key->e = e */ + if ((err = mp_invmod( key->e, tmp1, key->d)) != CRYPT_OK) { goto errkey; } /* key->d = 1/e mod lcm(p-1,q-1) */ + if ((err = mp_mul( p, q, key->N)) != CRYPT_OK) { goto errkey; } /* key->N = pq */ + + /* optimize for CRT now */ + /* find d mod q-1 and d mod p-1 */ + if ((err = mp_sub_d( p, 1, tmp1)) != CRYPT_OK) { goto errkey; } /* tmp1 = q-1 */ + if ((err = mp_sub_d( q, 1, tmp2)) != CRYPT_OK) { goto errkey; } /* tmp2 = p-1 */ + if ((err = mp_mod( key->d, tmp1, key->dP)) != CRYPT_OK) { goto errkey; } /* dP = d mod p-1 */ + if ((err = mp_mod( key->d, tmp2, key->dQ)) != CRYPT_OK) { goto errkey; } /* dQ = d mod q-1 */ + if ((err = mp_invmod( q, p, key->qP)) != CRYPT_OK) { goto errkey; } /* qP = 1/q mod p */ + + if ((err = mp_copy( p, key->p)) != CRYPT_OK) { goto errkey; } + if ((err = mp_copy( q, key->q)) != CRYPT_OK) { goto errkey; } + + /* set key type (in this case it's CRT optimized) */ + key->type = PK_PRIVATE; + + /* return ok and free temps */ + err = CRYPT_OK; + goto cleanup; +errkey: + mp_clear_multi(key->d, key->e, key->N, key->dQ, key->dP, key->qP, key->p, key->q, NULL); +cleanup: + mp_clear_multi(tmp3, tmp2, tmp1, p, q, NULL); + return err; +} + +#endif + +/* $Source: /cvs/libtom/libtomcrypt/src/pk/rsa/rsa_make_key.c,v $ */ +/* $Revision: 1.16 $ */ +/* $Date: 2007/05/12 14:32:35 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/pk/rsa/rsa_verify_hash.c b/dep/StormLib/src/libtomcrypt/src/pk/rsa/rsa_verify_hash.c new file mode 100644 index 00000000000..103ae2f5303 --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/pk/rsa/rsa_verify_hash.c @@ -0,0 +1,167 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../../headers/tomcrypt.h" + +/** + @file rsa_verify_hash.c + RSA LTC_PKCS #1 v1.5 or v2 PSS signature verification, Tom St Denis and Andreas Lange +*/ + +#ifdef LTC_MRSA + +/** + LTC_PKCS #1 de-sign then v1.5 or PSS depad + @param sig The signature data + @param siglen The length of the signature data (octets) + @param hash The hash of the message that was signed + @param hashlen The length of the hash of the message that was signed (octets) + @param padding Type of padding (LTC_LTC_PKCS_1_PSS or LTC_LTC_PKCS_1_V1_5) + @param hash_idx The index of the desired hash + @param saltlen The length of the salt used during signature + @param stat [out] The result of the signature comparison, 1==valid, 0==invalid + @param key The public RSA key corresponding to the key that performed the signature + @return CRYPT_OK on success (even if the signature is invalid) +*/ +int rsa_verify_hash_ex(const unsigned char *sig, unsigned long siglen, + const unsigned char *hash, unsigned long hashlen, + int padding, + int hash_idx, unsigned long saltlen, + int *stat, rsa_key *key) +{ + unsigned long modulus_bitlen, modulus_bytelen, x; + int err; + unsigned char *tmpbuf; + + LTC_ARGCHK(hash != NULL); + LTC_ARGCHK(sig != NULL); + LTC_ARGCHK(stat != NULL); + LTC_ARGCHK(key != NULL); + + /* default to invalid */ + *stat = 0; + + /* valid padding? */ + + if ((padding != LTC_LTC_PKCS_1_V1_5) && + (padding != LTC_LTC_PKCS_1_PSS)) { + return CRYPT_PK_INVALID_PADDING; + } + + if (padding == LTC_LTC_PKCS_1_PSS) { + /* valid hash ? */ + if ((err = hash_is_valid(hash_idx)) != CRYPT_OK) { + return err; + } + } + + /* get modulus len in bits */ + modulus_bitlen = mp_count_bits( (key->N)); + + /* outlen must be at least the size of the modulus */ + modulus_bytelen = mp_unsigned_bin_size( (key->N)); + if (modulus_bytelen != siglen) { + return CRYPT_INVALID_PACKET; + } + + /* allocate temp buffer for decoded sig */ + tmpbuf = XMALLOC(siglen); + if (tmpbuf == NULL) { + return CRYPT_MEM; + } + + /* RSA decode it */ + x = siglen; + if ((err = ltc_mp.rsa_me(sig, siglen, tmpbuf, &x, PK_PUBLIC, key)) != CRYPT_OK) { + XFREE(tmpbuf); + return err; + } + + /* make sure the output is the right size */ + if (x != siglen) { + XFREE(tmpbuf); + return CRYPT_INVALID_PACKET; + } + + if (padding == LTC_LTC_PKCS_1_PSS) { + /* PSS decode and verify it */ + err = pkcs_1_pss_decode(hash, hashlen, tmpbuf, x, saltlen, hash_idx, modulus_bitlen, stat); + } else { + /* LTC_PKCS #1 v1.5 decode it */ + unsigned char *out; + unsigned long outlen, loid[16]; + int decoded; + ltc_asn1_list digestinfo[2], siginfo[2]; + + /* not all hashes have OIDs... so sad */ + if (hash_descriptor[hash_idx].OIDlen == 0) { + err = CRYPT_INVALID_ARG; + goto bail_2; + } + + /* allocate temp buffer for decoded hash */ + outlen = ((modulus_bitlen >> 3) + (modulus_bitlen & 7 ? 1 : 0)) - 3; + out = XMALLOC(outlen); + if (out == NULL) { + err = CRYPT_MEM; + goto bail_2; + } + + if ((err = pkcs_1_v1_5_decode(tmpbuf, x, LTC_LTC_PKCS_1_EMSA, modulus_bitlen, out, &outlen, &decoded)) != CRYPT_OK) { + XFREE(out); + goto bail_2; + } + + /* now we must decode out[0...outlen-1] using ASN.1, test the OID and then test the hash */ + /* construct the SEQUENCE + SEQUENCE { + SEQUENCE {hashoid OID + blah NULL + } + hash OCTET STRING + } + */ + LTC_SET_ASN1(digestinfo, 0, LTC_ASN1_OBJECT_IDENTIFIER, loid, sizeof(loid)/sizeof(loid[0])); + LTC_SET_ASN1(digestinfo, 1, LTC_ASN1_NULL, NULL, 0); + LTC_SET_ASN1(siginfo, 0, LTC_ASN1_SEQUENCE, digestinfo, 2); + LTC_SET_ASN1(siginfo, 1, LTC_ASN1_OCTET_STRING, tmpbuf, siglen); + + if ((err = der_decode_sequence(out, outlen, siginfo, 2)) != CRYPT_OK) { + XFREE(out); + goto bail_2; + } + + /* test OID */ + if ((digestinfo[0].size == hash_descriptor[hash_idx].OIDlen) && + (XMEMCMP(digestinfo[0].data, hash_descriptor[hash_idx].OID, sizeof(unsigned long) * hash_descriptor[hash_idx].OIDlen) == 0) && + (siginfo[1].size == hashlen) && + (XMEMCMP(siginfo[1].data, hash, hashlen) == 0)) { + *stat = 1; + } + +#ifdef LTC_CLEAN_STACK + zeromem(out, outlen); +#endif + XFREE(out); + } + +bail_2: +#ifdef LTC_CLEAN_STACK + zeromem(tmpbuf, siglen); +#endif + XFREE(tmpbuf); + return err; +} + +#endif /* LTC_MRSA */ + +/* $Source: /cvs/libtom/libtomcrypt/src/pk/rsa/rsa_verify_hash.c,v $ */ +/* $Revision: 1.13 $ */ +/* $Date: 2007/05/12 14:32:35 $ */ diff --git a/dep/StormLib/src/libtomcrypt/src/pk/rsa/rsa_verify_simple.c b/dep/StormLib/src/libtomcrypt/src/pk/rsa/rsa_verify_simple.c new file mode 100644 index 00000000000..6d8888c858d --- /dev/null +++ b/dep/StormLib/src/libtomcrypt/src/pk/rsa/rsa_verify_simple.c @@ -0,0 +1,87 @@ +/* LibTomCrypt, modular cryptographic library -- Tom St Denis + * + * LibTomCrypt is a library that provides various cryptographic + * algorithms in a highly modular and flexible manner. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include "../../headers/tomcrypt.h" + +/** + @file rsa_verify_simple.c + Created by Ladislav Zezula (zezula@volny.cz) as modification + for Blizzard strong signature verification +*/ + +#ifdef LTC_MRSA + +/** + Simple RSA decryption + @param sig The signature data + @param siglen The length of the signature data (octets) + @param hash The hash of the message that was signed + @param hashlen The length of the hash of the message that was signed (octets) + @param stat [out] The result of the signature comparison, 1==valid, 0==invalid + @param key The public RSA key corresponding + @return Error code +*/ +int rsa_verify_simple(const unsigned char *sig, unsigned long siglen, + const unsigned char *hash, unsigned long hashlen, + int *stat, + rsa_key *key) +{ + unsigned long modulus_bitlen, modulus_bytelen, x; + unsigned char *tmpbuf; + int err; + + LTC_ARGCHK(sig != NULL); + LTC_ARGCHK(hash != NULL); + LTC_ARGCHK(stat != NULL); + LTC_ARGCHK(key != NULL); + + /* default to invalid */ + *stat = 0; + + /* get modulus len in bits */ + modulus_bitlen = mp_count_bits( (key->N)); + + /* outlen must be at least the size of the modulus */ + modulus_bytelen = mp_unsigned_bin_size( (key->N)); + if (modulus_bytelen != siglen) { + return CRYPT_INVALID_PACKET; + } + + /* allocate temp buffer for decoded sig */ + tmpbuf = XMALLOC(siglen); + if (tmpbuf == NULL) { + return CRYPT_MEM; + } + + /* RSA decode it */ + x = siglen; + if ((err = ltc_mp.rsa_me(sig, siglen, tmpbuf, &x, PK_PUBLIC, key)) != CRYPT_OK) { + XFREE(tmpbuf); + return err; + } + + /* make sure the output is the right size */ + if (x != siglen) { + XFREE(tmpbuf); + return CRYPT_INVALID_PACKET; + } + + /* compare the decrypted signature with the given hash */ + if(x == hashlen && XMEMCMP(tmpbuf, hash, hashlen) == 0) + *stat = 1; + +#ifdef LTC_CLEAN_STACK + zeromem(tmpbuf, siglen); +#endif + XFREE(tmpbuf); + return CRYPT_OK; +} + +#endif /* LTC_MRSA */ diff --git a/dep/StormLib/src/libtommath/bn_fast_mp_invmod.c b/dep/StormLib/src/libtommath/bn_fast_mp_invmod.c new file mode 100644 index 00000000000..597d7a9b5fa --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_fast_mp_invmod.c @@ -0,0 +1,148 @@ +#include "tommath.h" +#ifdef BN_FAST_MP_INVMOD_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* computes the modular inverse via binary extended euclidean algorithm, + * that is c = 1/a mod b + * + * Based on slow invmod except this is optimized for the case where b is + * odd as per HAC Note 14.64 on pp. 610 + */ +int fast_mp_invmod (mp_int * a, mp_int * b, mp_int * c) +{ + mp_int x, y, u, v, B, D; + int res, neg; + + /* 2. [modified] b must be odd */ + if (mp_iseven (b) == 1) { + return MP_VAL; + } + + /* init all our temps */ + if ((res = mp_init_multi(&x, &y, &u, &v, &B, &D, NULL)) != MP_OKAY) { + return res; + } + + /* x == modulus, y == value to invert */ + if ((res = mp_copy (b, &x)) != MP_OKAY) { + goto LBL_ERR; + } + + /* we need y = |a| */ + if ((res = mp_mod (a, b, &y)) != MP_OKAY) { + goto LBL_ERR; + } + + /* 3. u=x, v=y, A=1, B=0, C=0,D=1 */ + if ((res = mp_copy (&x, &u)) != MP_OKAY) { + goto LBL_ERR; + } + if ((res = mp_copy (&y, &v)) != MP_OKAY) { + goto LBL_ERR; + } + mp_set (&D, 1); + +top: + /* 4. while u is even do */ + while (mp_iseven (&u) == 1) { + /* 4.1 u = u/2 */ + if ((res = mp_div_2 (&u, &u)) != MP_OKAY) { + goto LBL_ERR; + } + /* 4.2 if B is odd then */ + if (mp_isodd (&B) == 1) { + if ((res = mp_sub (&B, &x, &B)) != MP_OKAY) { + goto LBL_ERR; + } + } + /* B = B/2 */ + if ((res = mp_div_2 (&B, &B)) != MP_OKAY) { + goto LBL_ERR; + } + } + + /* 5. while v is even do */ + while (mp_iseven (&v) == 1) { + /* 5.1 v = v/2 */ + if ((res = mp_div_2 (&v, &v)) != MP_OKAY) { + goto LBL_ERR; + } + /* 5.2 if D is odd then */ + if (mp_isodd (&D) == 1) { + /* D = (D-x)/2 */ + if ((res = mp_sub (&D, &x, &D)) != MP_OKAY) { + goto LBL_ERR; + } + } + /* D = D/2 */ + if ((res = mp_div_2 (&D, &D)) != MP_OKAY) { + goto LBL_ERR; + } + } + + /* 6. if u >= v then */ + if (mp_cmp (&u, &v) != MP_LT) { + /* u = u - v, B = B - D */ + if ((res = mp_sub (&u, &v, &u)) != MP_OKAY) { + goto LBL_ERR; + } + + if ((res = mp_sub (&B, &D, &B)) != MP_OKAY) { + goto LBL_ERR; + } + } else { + /* v - v - u, D = D - B */ + if ((res = mp_sub (&v, &u, &v)) != MP_OKAY) { + goto LBL_ERR; + } + + if ((res = mp_sub (&D, &B, &D)) != MP_OKAY) { + goto LBL_ERR; + } + } + + /* if not zero goto step 4 */ + if (mp_iszero (&u) == 0) { + goto top; + } + + /* now a = C, b = D, gcd == g*v */ + + /* if v != 1 then there is no inverse */ + if (mp_cmp_d (&v, 1) != MP_EQ) { + res = MP_VAL; + goto LBL_ERR; + } + + /* b is now the inverse */ + neg = a->sign; + while (D.sign == MP_NEG) { + if ((res = mp_add (&D, b, &D)) != MP_OKAY) { + goto LBL_ERR; + } + } + mp_exch (&D, c); + c->sign = neg; + res = MP_OKAY; + +LBL_ERR:mp_clear_multi (&x, &y, &u, &v, &B, &D, NULL); + return res; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_fast_mp_invmod.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_fast_mp_montgomery_reduce.c b/dep/StormLib/src/libtommath/bn_fast_mp_montgomery_reduce.c new file mode 100644 index 00000000000..65eed7da1fe --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_fast_mp_montgomery_reduce.c @@ -0,0 +1,172 @@ +#include "tommath.h" +#ifdef BN_FAST_MP_MONTGOMERY_REDUCE_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* computes xR**-1 == x (mod N) via Montgomery Reduction + * + * This is an optimized implementation of montgomery_reduce + * which uses the comba method to quickly calculate the columns of the + * reduction. + * + * Based on Algorithm 14.32 on pp.601 of HAC. +*/ +int fast_mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho) +{ + int ix, res, olduse; + mp_word W[MP_WARRAY]; + + /* get old used count */ + olduse = x->used; + + /* grow a as required */ + if (x->alloc < n->used + 1) { + if ((res = mp_grow (x, n->used + 1)) != MP_OKAY) { + return res; + } + } + + /* first we have to get the digits of the input into + * an array of double precision words W[...] + */ + { + register mp_word *_W; + register mp_digit *tmpx; + + /* alias for the W[] array */ + _W = W; + + /* alias for the digits of x*/ + tmpx = x->dp; + + /* copy the digits of a into W[0..a->used-1] */ + for (ix = 0; ix < x->used; ix++) { + *_W++ = *tmpx++; + } + + /* zero the high words of W[a->used..m->used*2] */ + for (; ix < n->used * 2 + 1; ix++) { + *_W++ = 0; + } + } + + /* now we proceed to zero successive digits + * from the least significant upwards + */ + for (ix = 0; ix < n->used; ix++) { + /* mu = ai * m' mod b + * + * We avoid a double precision multiplication (which isn't required) + * by casting the value down to a mp_digit. Note this requires + * that W[ix-1] have the carry cleared (see after the inner loop) + */ + register mp_digit mu; + mu = (mp_digit) (((W[ix] & MP_MASK) * rho) & MP_MASK); + + /* a = a + mu * m * b**i + * + * This is computed in place and on the fly. The multiplication + * by b**i is handled by offseting which columns the results + * are added to. + * + * Note the comba method normally doesn't handle carries in the + * inner loop In this case we fix the carry from the previous + * column since the Montgomery reduction requires digits of the + * result (so far) [see above] to work. This is + * handled by fixing up one carry after the inner loop. The + * carry fixups are done in order so after these loops the + * first m->used words of W[] have the carries fixed + */ + { + register int iy; + register mp_digit *tmpn; + register mp_word *_W; + + /* alias for the digits of the modulus */ + tmpn = n->dp; + + /* Alias for the columns set by an offset of ix */ + _W = W + ix; + + /* inner loop */ + for (iy = 0; iy < n->used; iy++) { + *_W++ += ((mp_word)mu) * ((mp_word)*tmpn++); + } + } + + /* now fix carry for next digit, W[ix+1] */ + W[ix + 1] += W[ix] >> ((mp_word) DIGIT_BIT); + } + + /* now we have to propagate the carries and + * shift the words downward [all those least + * significant digits we zeroed]. + */ + { + register mp_digit *tmpx; + register mp_word *_W, *_W1; + + /* nox fix rest of carries */ + + /* alias for current word */ + _W1 = W + ix; + + /* alias for next word, where the carry goes */ + _W = W + ++ix; + + for (; ix <= n->used * 2 + 1; ix++) { + *_W++ += *_W1++ >> ((mp_word) DIGIT_BIT); + } + + /* copy out, A = A/b**n + * + * The result is A/b**n but instead of converting from an + * array of mp_word to mp_digit than calling mp_rshd + * we just copy them in the right order + */ + + /* alias for destination word */ + tmpx = x->dp; + + /* alias for shifted double precision result */ + _W = W + n->used; + + for (ix = 0; ix < n->used + 1; ix++) { + *tmpx++ = (mp_digit)(*_W++ & ((mp_word) MP_MASK)); + } + + /* zero oldused digits, if the input a was larger than + * m->used+1 we'll have to clear the digits + */ + for (; ix < olduse; ix++) { + *tmpx++ = 0; + } + } + + /* set the max used and clamp */ + x->used = n->used + 1; + mp_clamp (x); + + /* if A >= m then A = A - m */ + if (mp_cmp_mag (x, n) != MP_LT) { + return s_mp_sub (x, n, x); + } + return MP_OKAY; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_fast_mp_montgomery_reduce.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_fast_s_mp_mul_digs.c b/dep/StormLib/src/libtommath/bn_fast_s_mp_mul_digs.c new file mode 100644 index 00000000000..df83f89ecab --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_fast_s_mp_mul_digs.c @@ -0,0 +1,107 @@ +#include "tommath.h" +#ifdef BN_FAST_S_MP_MUL_DIGS_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* Fast (comba) multiplier + * + * This is the fast column-array [comba] multiplier. It is + * designed to compute the columns of the product first + * then handle the carries afterwards. This has the effect + * of making the nested loops that compute the columns very + * simple and schedulable on super-scalar processors. + * + * This has been modified to produce a variable number of + * digits of output so if say only a half-product is required + * you don't have to compute the upper half (a feature + * required for fast Barrett reduction). + * + * Based on Algorithm 14.12 on pp.595 of HAC. + * + */ +int fast_s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs) +{ + int olduse, res, pa, ix, iz; + mp_digit W[MP_WARRAY]; + register mp_word _W; + + /* grow the destination as required */ + if (c->alloc < digs) { + if ((res = mp_grow (c, digs)) != MP_OKAY) { + return res; + } + } + + /* number of output digits to produce */ + pa = MIN(digs, a->used + b->used); + + /* clear the carry */ + _W = 0; + for (ix = 0; ix < pa; ix++) { + int tx, ty; + int iy; + mp_digit *tmpx, *tmpy; + + /* get offsets into the two bignums */ + ty = MIN(b->used-1, ix); + tx = ix - ty; + + /* setup temp aliases */ + tmpx = a->dp + tx; + tmpy = b->dp + ty; + + /* this is the number of times the loop will iterrate, essentially + while (tx++ < a->used && ty-- >= 0) { ... } + */ + iy = MIN(a->used-tx, ty+1); + + /* execute loop */ + for (iz = 0; iz < iy; ++iz) { + _W += ((mp_word)*tmpx++)*((mp_word)*tmpy--); + + } + + /* store term */ + W[ix] = ((mp_digit)_W) & MP_MASK; + + /* make next carry */ + _W = _W >> ((mp_word)DIGIT_BIT); + } + + /* setup dest */ + olduse = c->used; + c->used = pa; + + { + register mp_digit *tmpc; + tmpc = c->dp; + for (ix = 0; ix < pa+1; ix++) { + /* now extract the previous digit [below the carry] */ + *tmpc++ = W[ix]; + } + + /* clear unused digits [that existed in the old copy of c] */ + for (; ix < olduse; ix++) { + *tmpc++ = 0; + } + } + mp_clamp (c); + return MP_OKAY; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_fast_s_mp_mul_digs.c,v $ */ +/* $Revision: 1.8 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_fast_s_mp_mul_high_digs.c b/dep/StormLib/src/libtommath/bn_fast_s_mp_mul_high_digs.c new file mode 100644 index 00000000000..6866aab7529 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_fast_s_mp_mul_high_digs.c @@ -0,0 +1,98 @@ +#include "tommath.h" +#ifdef BN_FAST_S_MP_MUL_HIGH_DIGS_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* this is a modified version of fast_s_mul_digs that only produces + * output digits *above* digs. See the comments for fast_s_mul_digs + * to see how it works. + * + * This is used in the Barrett reduction since for one of the multiplications + * only the higher digits were needed. This essentially halves the work. + * + * Based on Algorithm 14.12 on pp.595 of HAC. + */ +int fast_s_mp_mul_high_digs (mp_int * a, mp_int * b, mp_int * c, int digs) +{ + int olduse, res, pa, ix, iz; + mp_digit W[MP_WARRAY]; + mp_word _W; + + /* grow the destination as required */ + pa = a->used + b->used; + if (c->alloc < pa) { + if ((res = mp_grow (c, pa)) != MP_OKAY) { + return res; + } + } + + /* number of output digits to produce */ + pa = a->used + b->used; + _W = 0; + for (ix = digs; ix < pa; ix++) { + int tx, ty, iy; + mp_digit *tmpx, *tmpy; + + /* get offsets into the two bignums */ + ty = MIN(b->used-1, ix); + tx = ix - ty; + + /* setup temp aliases */ + tmpx = a->dp + tx; + tmpy = b->dp + ty; + + /* this is the number of times the loop will iterrate, essentially its + while (tx++ < a->used && ty-- >= 0) { ... } + */ + iy = MIN(a->used-tx, ty+1); + + /* execute loop */ + for (iz = 0; iz < iy; iz++) { + _W += ((mp_word)*tmpx++)*((mp_word)*tmpy--); + } + + /* store term */ + W[ix] = ((mp_digit)_W) & MP_MASK; + + /* make next carry */ + _W = _W >> ((mp_word)DIGIT_BIT); + } + + /* setup dest */ + olduse = c->used; + c->used = pa; + + { + register mp_digit *tmpc; + + tmpc = c->dp + digs; + for (ix = digs; ix < pa; ix++) { + /* now extract the previous digit [below the carry] */ + *tmpc++ = W[ix]; + } + + /* clear unused digits [that existed in the old copy of c] */ + for (; ix < olduse; ix++) { + *tmpc++ = 0; + } + } + mp_clamp (c); + return MP_OKAY; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_fast_s_mp_mul_high_digs.c,v $ */ +/* $Revision: 1.6 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_fast_s_mp_sqr.c b/dep/StormLib/src/libtommath/bn_fast_s_mp_sqr.c new file mode 100644 index 00000000000..5f9d58cac62 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_fast_s_mp_sqr.c @@ -0,0 +1,114 @@ +#include "tommath.h" +#ifdef BN_FAST_S_MP_SQR_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* the jist of squaring... + * you do like mult except the offset of the tmpx [one that + * starts closer to zero] can't equal the offset of tmpy. + * So basically you set up iy like before then you min it with + * (ty-tx) so that it never happens. You double all those + * you add in the inner loop + +After that loop you do the squares and add them in. +*/ + +int fast_s_mp_sqr (mp_int * a, mp_int * b) +{ + int olduse, res, pa, ix, iz; + mp_digit W[MP_WARRAY], *tmpx; + mp_word W1; + + /* grow the destination as required */ + pa = a->used + a->used; + if (b->alloc < pa) { + if ((res = mp_grow (b, pa)) != MP_OKAY) { + return res; + } + } + + /* number of output digits to produce */ + W1 = 0; + for (ix = 0; ix < pa; ix++) { + int tx, ty, iy; + mp_word _W; + mp_digit *tmpy; + + /* clear counter */ + _W = 0; + + /* get offsets into the two bignums */ + ty = MIN(a->used-1, ix); + tx = ix - ty; + + /* setup temp aliases */ + tmpx = a->dp + tx; + tmpy = a->dp + ty; + + /* this is the number of times the loop will iterrate, essentially + while (tx++ < a->used && ty-- >= 0) { ... } + */ + iy = MIN(a->used-tx, ty+1); + + /* now for squaring tx can never equal ty + * we halve the distance since they approach at a rate of 2x + * and we have to round because odd cases need to be executed + */ + iy = MIN(iy, (ty-tx+1)>>1); + + /* execute loop */ + for (iz = 0; iz < iy; iz++) { + _W += ((mp_word)*tmpx++)*((mp_word)*tmpy--); + } + + /* double the inner product and add carry */ + _W = _W + _W + W1; + + /* even columns have the square term in them */ + if ((ix&1) == 0) { + _W += ((mp_word)a->dp[ix>>1])*((mp_word)a->dp[ix>>1]); + } + + /* store it */ + W[ix] = (mp_digit)(_W & MP_MASK); + + /* make next carry */ + W1 = _W >> ((mp_word)DIGIT_BIT); + } + + /* setup dest */ + olduse = b->used; + b->used = a->used+a->used; + + { + mp_digit *tmpb; + tmpb = b->dp; + for (ix = 0; ix < pa; ix++) { + *tmpb++ = W[ix] & MP_MASK; + } + + /* clear unused digits [that existed in the old copy of c] */ + for (; ix < olduse; ix++) { + *tmpb++ = 0; + } + } + mp_clamp (b); + return MP_OKAY; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_fast_s_mp_sqr.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_2expt.c b/dep/StormLib/src/libtommath/bn_mp_2expt.c new file mode 100644 index 00000000000..f899eaee43e --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_2expt.c @@ -0,0 +1,48 @@ +#include "tommath.h" +#ifdef BN_MP_2EXPT_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* computes a = 2**b + * + * Simple algorithm which zeroes the int, grows it then just sets one bit + * as required. + */ +int +mp_2expt (mp_int * a, int b) +{ + int res; + + /* zero a as per default */ + mp_zero (a); + + /* grow a to accomodate the single bit */ + if ((res = mp_grow (a, b / DIGIT_BIT + 1)) != MP_OKAY) { + return res; + } + + /* set the used count of where the bit will go */ + a->used = b / DIGIT_BIT + 1; + + /* put the single bit in its place */ + a->dp[b / DIGIT_BIT] = ((mp_digit)1) << (b % DIGIT_BIT); + + return MP_OKAY; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_2expt.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_abs.c b/dep/StormLib/src/libtommath/bn_mp_abs.c new file mode 100644 index 00000000000..14f3a7e074d --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_abs.c @@ -0,0 +1,43 @@ +#include "tommath.h" +#ifdef BN_MP_ABS_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* b = |a| + * + * Simple function copies the input and fixes the sign to positive + */ +int +mp_abs (mp_int * a, mp_int * b) +{ + int res; + + /* copy a to b */ + if (a != b) { + if ((res = mp_copy (a, b)) != MP_OKAY) { + return res; + } + } + + /* force the sign of b to positive */ + b->sign = MP_ZPOS; + + return MP_OKAY; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_abs.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_add.c b/dep/StormLib/src/libtommath/bn_mp_add.c new file mode 100644 index 00000000000..b368b21c7cb --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_add.c @@ -0,0 +1,53 @@ +#include "tommath.h" +#ifdef BN_MP_ADD_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* high level addition (handles signs) */ +int mp_add (mp_int * a, mp_int * b, mp_int * c) +{ + int sa, sb, res; + + /* get sign of both inputs */ + sa = a->sign; + sb = b->sign; + + /* handle two cases, not four */ + if (sa == sb) { + /* both positive or both negative */ + /* add their magnitudes, copy the sign */ + c->sign = sa; + res = s_mp_add (a, b, c); + } else { + /* one positive, the other negative */ + /* subtract the one with the greater magnitude from */ + /* the one of the lesser magnitude. The result gets */ + /* the sign of the one with the greater magnitude. */ + if (mp_cmp_mag (a, b) == MP_LT) { + c->sign = sb; + res = s_mp_sub (b, a, c); + } else { + c->sign = sa; + res = s_mp_sub (a, b, c); + } + } + return res; +} + +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_add.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_add_d.c b/dep/StormLib/src/libtommath/bn_mp_add_d.c new file mode 100644 index 00000000000..c147554bdb8 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_add_d.c @@ -0,0 +1,112 @@ +#include "tommath.h" +#ifdef BN_MP_ADD_D_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* single digit addition */ +int +mp_add_d (mp_int * a, mp_digit b, mp_int * c) +{ + int res, ix, oldused; + mp_digit *tmpa, *tmpc, mu; + + /* grow c as required */ + if (c->alloc < a->used + 1) { + if ((res = mp_grow(c, a->used + 1)) != MP_OKAY) { + return res; + } + } + + /* if a is negative and |a| >= b, call c = |a| - b */ + if (a->sign == MP_NEG && (a->used > 1 || a->dp[0] >= b)) { + /* temporarily fix sign of a */ + a->sign = MP_ZPOS; + + /* c = |a| - b */ + res = mp_sub_d(a, b, c); + + /* fix sign */ + a->sign = c->sign = MP_NEG; + + /* clamp */ + mp_clamp(c); + + return res; + } + + /* old number of used digits in c */ + oldused = c->used; + + /* sign always positive */ + c->sign = MP_ZPOS; + + /* source alias */ + tmpa = a->dp; + + /* destination alias */ + tmpc = c->dp; + + /* if a is positive */ + if (a->sign == MP_ZPOS) { + /* add digit, after this we're propagating + * the carry. + */ + *tmpc = *tmpa++ + b; + mu = *tmpc >> DIGIT_BIT; + *tmpc++ &= MP_MASK; + + /* now handle rest of the digits */ + for (ix = 1; ix < a->used; ix++) { + *tmpc = *tmpa++ + mu; + mu = *tmpc >> DIGIT_BIT; + *tmpc++ &= MP_MASK; + } + /* set final carry */ + ix++; + *tmpc++ = mu; + + /* setup size */ + c->used = a->used + 1; + } else { + /* a was negative and |a| < b */ + c->used = 1; + + /* the result is a single digit */ + if (a->used == 1) { + *tmpc++ = b - a->dp[0]; + } else { + *tmpc++ = b; + } + + /* setup count so the clearing of oldused + * can fall through correctly + */ + ix = 1; + } + + /* now zero to oldused */ + while (ix++ < oldused) { + *tmpc++ = 0; + } + mp_clamp(c); + + return MP_OKAY; +} + +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_add_d.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_addmod.c b/dep/StormLib/src/libtommath/bn_mp_addmod.c new file mode 100644 index 00000000000..0a21f62e9a6 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_addmod.c @@ -0,0 +1,41 @@ +#include "tommath.h" +#ifdef BN_MP_ADDMOD_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* d = a + b (mod c) */ +int +mp_addmod (mp_int * a, mp_int * b, mp_int * c, mp_int * d) +{ + int res; + mp_int t; + + if ((res = mp_init (&t)) != MP_OKAY) { + return res; + } + + if ((res = mp_add (a, b, &t)) != MP_OKAY) { + mp_clear (&t); + return res; + } + res = mp_mod (&t, c, d); + mp_clear (&t); + return res; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_addmod.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_and.c b/dep/StormLib/src/libtommath/bn_mp_and.c new file mode 100644 index 00000000000..6b7afc104a8 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_and.c @@ -0,0 +1,57 @@ +#include "tommath.h" +#ifdef BN_MP_AND_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* AND two ints together */ +int +mp_and (mp_int * a, mp_int * b, mp_int * c) +{ + int res, ix, px; + mp_int t, *x; + + if (a->used > b->used) { + if ((res = mp_init_copy (&t, a)) != MP_OKAY) { + return res; + } + px = b->used; + x = b; + } else { + if ((res = mp_init_copy (&t, b)) != MP_OKAY) { + return res; + } + px = a->used; + x = a; + } + + for (ix = 0; ix < px; ix++) { + t.dp[ix] &= x->dp[ix]; + } + + /* zero digits above the last from the smallest mp_int */ + for (; ix < t.used; ix++) { + t.dp[ix] = 0; + } + + mp_clamp (&t); + mp_exch (c, &t); + mp_clear (&t); + return MP_OKAY; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_and.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_clamp.c b/dep/StormLib/src/libtommath/bn_mp_clamp.c new file mode 100644 index 00000000000..d3cc21c3eff --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_clamp.c @@ -0,0 +1,44 @@ +#include "tommath.h" +#ifdef BN_MP_CLAMP_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* trim unused digits + * + * This is used to ensure that leading zero digits are + * trimed and the leading "used" digit will be non-zero + * Typically very fast. Also fixes the sign if there + * are no more leading digits + */ +void +mp_clamp (mp_int * a) +{ + /* decrease used while the most significant digit is + * zero. + */ + while (a->used > 0 && a->dp[a->used - 1] == 0) { + --(a->used); + } + + /* reset the sign flag if used == 0 */ + if (a->used == 0) { + a->sign = MP_ZPOS; + } +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_clamp.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_clear.c b/dep/StormLib/src/libtommath/bn_mp_clear.c new file mode 100644 index 00000000000..7644c382512 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_clear.c @@ -0,0 +1,44 @@ +#include "tommath.h" +#ifdef BN_MP_CLEAR_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* clear one (frees) */ +void +mp_clear (mp_int * a) +{ + int i; + + /* only do anything if a hasn't been freed previously */ + if (a->dp != NULL) { + /* first zero the digits */ + for (i = 0; i < a->used; i++) { + a->dp[i] = 0; + } + + /* free ram */ + XFREE(a->dp); + + /* reset members to make debugging easier */ + a->dp = NULL; + a->alloc = a->used = 0; + a->sign = MP_ZPOS; + } +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_clear.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_clear_multi.c b/dep/StormLib/src/libtommath/bn_mp_clear_multi.c new file mode 100644 index 00000000000..a1076243675 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_clear_multi.c @@ -0,0 +1,34 @@ +#include "tommath.h" +#ifdef BN_MP_CLEAR_MULTI_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include + +void mp_clear_multi(mp_int *mp, ...) +{ + mp_int* next_mp = mp; + va_list args; + va_start(args, mp); + while (next_mp != NULL) { + mp_clear(next_mp); + next_mp = va_arg(args, mp_int*); + } + va_end(args); +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_clear_multi.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_cmp.c b/dep/StormLib/src/libtommath/bn_mp_cmp.c new file mode 100644 index 00000000000..761d2b0dc75 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_cmp.c @@ -0,0 +1,43 @@ +#include "tommath.h" +#ifdef BN_MP_CMP_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* compare two ints (signed)*/ +int +mp_cmp (mp_int * a, mp_int * b) +{ + /* compare based on sign */ + if (a->sign != b->sign) { + if (a->sign == MP_NEG) { + return MP_LT; + } else { + return MP_GT; + } + } + + /* compare digits */ + if (a->sign == MP_NEG) { + /* if negative compare opposite direction */ + return mp_cmp_mag(b, a); + } else { + return mp_cmp_mag(a, b); + } +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_cmp.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_cmp_d.c b/dep/StormLib/src/libtommath/bn_mp_cmp_d.c new file mode 100644 index 00000000000..420dfd31aa1 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_cmp_d.c @@ -0,0 +1,44 @@ +#include "tommath.h" +#ifdef BN_MP_CMP_D_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* compare a digit */ +int mp_cmp_d(mp_int * a, mp_digit b) +{ + /* compare based on sign */ + if (a->sign == MP_NEG) { + return MP_LT; + } + + /* compare based on magnitude */ + if (a->used > 1) { + return MP_GT; + } + + /* compare the only digit of a to b */ + if (a->dp[0] > b) { + return MP_GT; + } else if (a->dp[0] < b) { + return MP_LT; + } else { + return MP_EQ; + } +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_cmp_d.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_cmp_mag.c b/dep/StormLib/src/libtommath/bn_mp_cmp_mag.c new file mode 100644 index 00000000000..92565a3b896 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_cmp_mag.c @@ -0,0 +1,55 @@ +#include "tommath.h" +#ifdef BN_MP_CMP_MAG_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* compare maginitude of two ints (unsigned) */ +int mp_cmp_mag (mp_int * a, mp_int * b) +{ + int n; + mp_digit *tmpa, *tmpb; + + /* compare based on # of non-zero digits */ + if (a->used > b->used) { + return MP_GT; + } + + if (a->used < b->used) { + return MP_LT; + } + + /* alias for a */ + tmpa = a->dp + (a->used - 1); + + /* alias for b */ + tmpb = b->dp + (a->used - 1); + + /* compare based on digits */ + for (n = 0; n < a->used; ++n, --tmpa, --tmpb) { + if (*tmpa > *tmpb) { + return MP_GT; + } + + if (*tmpa < *tmpb) { + return MP_LT; + } + } + return MP_EQ; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_cmp_mag.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_cnt_lsb.c b/dep/StormLib/src/libtommath/bn_mp_cnt_lsb.c new file mode 100644 index 00000000000..60406610ed6 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_cnt_lsb.c @@ -0,0 +1,53 @@ +#include "tommath.h" +#ifdef BN_MP_CNT_LSB_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +static const int lnz[16] = { + 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0 +}; + +/* Counts the number of lsbs which are zero before the first zero bit */ +int mp_cnt_lsb(mp_int *a) +{ + int x; + mp_digit q, qq; + + /* easy out */ + if (mp_iszero(a) == 1) { + return 0; + } + + /* scan lower digits until non-zero */ + for (x = 0; x < a->used && a->dp[x] == 0; x++); + q = a->dp[x]; + x *= DIGIT_BIT; + + /* now scan this digit until a 1 is found */ + if ((q & 1) == 0) { + do { + qq = q & 15; + x += lnz[qq]; + q >>= 4; + } while (qq == 0); + } + return x; +} + +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_cnt_lsb.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_copy.c b/dep/StormLib/src/libtommath/bn_mp_copy.c new file mode 100644 index 00000000000..7828592da5d --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_copy.c @@ -0,0 +1,68 @@ +#include "tommath.h" +#ifdef BN_MP_COPY_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* copy, b = a */ +int +mp_copy (mp_int * a, mp_int * b) +{ + int res, n; + + /* if dst == src do nothing */ + if (a == b) { + return MP_OKAY; + } + + /* grow dest */ + if (b->alloc < a->used) { + if ((res = mp_grow (b, a->used)) != MP_OKAY) { + return res; + } + } + + /* zero b and copy the parameters over */ + { + register mp_digit *tmpa, *tmpb; + + /* pointer aliases */ + + /* source */ + tmpa = a->dp; + + /* destination */ + tmpb = b->dp; + + /* copy all the digits */ + for (n = 0; n < a->used; n++) { + *tmpb++ = *tmpa++; + } + + /* clear high digits */ + for (; n < b->used; n++) { + *tmpb++ = 0; + } + } + + /* copy used count and sign */ + b->used = a->used; + b->sign = a->sign; + return MP_OKAY; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_copy.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_count_bits.c b/dep/StormLib/src/libtommath/bn_mp_count_bits.c new file mode 100644 index 00000000000..9d8640fdfce --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_count_bits.c @@ -0,0 +1,45 @@ +#include "tommath.h" +#ifdef BN_MP_COUNT_BITS_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* returns the number of bits in an int */ +int +mp_count_bits (mp_int * a) +{ + int r; + mp_digit q; + + /* shortcut */ + if (a->used == 0) { + return 0; + } + + /* get number of digits and add that */ + r = (a->used - 1) * DIGIT_BIT; + + /* take the last digit and count the bits in it */ + q = a->dp[a->used - 1]; + while (q > ((mp_digit) 0)) { + ++r; + q >>= ((mp_digit) 1); + } + return r; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_count_bits.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_div.c b/dep/StormLib/src/libtommath/bn_mp_div.c new file mode 100644 index 00000000000..3004a3ea016 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_div.c @@ -0,0 +1,292 @@ +#include "tommath.h" +#ifdef BN_MP_DIV_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +#ifdef BN_MP_DIV_SMALL + +/* slower bit-bang division... also smaller */ +int mp_div(mp_int * a, mp_int * b, mp_int * c, mp_int * d) +{ + mp_int ta, tb, tq, q; + int res, n, n2; + + /* is divisor zero ? */ + if (mp_iszero (b) == 1) { + return MP_VAL; + } + + /* if a < b then q=0, r = a */ + if (mp_cmp_mag (a, b) == MP_LT) { + if (d != NULL) { + res = mp_copy (a, d); + } else { + res = MP_OKAY; + } + if (c != NULL) { + mp_zero (c); + } + return res; + } + + /* init our temps */ + if ((res = mp_init_multi(&ta, &tb, &tq, &q, NULL) != MP_OKAY)) { + return res; + } + + + mp_set(&tq, 1); + n = mp_count_bits(a) - mp_count_bits(b); + if (((res = mp_abs(a, &ta)) != MP_OKAY) || + ((res = mp_abs(b, &tb)) != MP_OKAY) || + ((res = mp_mul_2d(&tb, n, &tb)) != MP_OKAY) || + ((res = mp_mul_2d(&tq, n, &tq)) != MP_OKAY)) { + goto LBL_ERR; + } + + while (n-- >= 0) { + if (mp_cmp(&tb, &ta) != MP_GT) { + if (((res = mp_sub(&ta, &tb, &ta)) != MP_OKAY) || + ((res = mp_add(&q, &tq, &q)) != MP_OKAY)) { + goto LBL_ERR; + } + } + if (((res = mp_div_2d(&tb, 1, &tb, NULL)) != MP_OKAY) || + ((res = mp_div_2d(&tq, 1, &tq, NULL)) != MP_OKAY)) { + goto LBL_ERR; + } + } + + /* now q == quotient and ta == remainder */ + n = a->sign; + n2 = (a->sign == b->sign ? MP_ZPOS : MP_NEG); + if (c != NULL) { + mp_exch(c, &q); + c->sign = (mp_iszero(c) == MP_YES) ? MP_ZPOS : n2; + } + if (d != NULL) { + mp_exch(d, &ta); + d->sign = (mp_iszero(d) == MP_YES) ? MP_ZPOS : n; + } +LBL_ERR: + mp_clear_multi(&ta, &tb, &tq, &q, NULL); + return res; +} + +#else + +/* integer signed division. + * c*b + d == a [e.g. a/b, c=quotient, d=remainder] + * HAC pp.598 Algorithm 14.20 + * + * Note that the description in HAC is horribly + * incomplete. For example, it doesn't consider + * the case where digits are removed from 'x' in + * the inner loop. It also doesn't consider the + * case that y has fewer than three digits, etc.. + * + * The overall algorithm is as described as + * 14.20 from HAC but fixed to treat these cases. +*/ +int mp_div (mp_int * a, mp_int * b, mp_int * c, mp_int * d) +{ + mp_int q, x, y, t1, t2; + int res, n, t, i, norm, neg; + + /* is divisor zero ? */ + if (mp_iszero (b) == 1) { + return MP_VAL; + } + + /* if a < b then q=0, r = a */ + if (mp_cmp_mag (a, b) == MP_LT) { + if (d != NULL) { + res = mp_copy (a, d); + } else { + res = MP_OKAY; + } + if (c != NULL) { + mp_zero (c); + } + return res; + } + + if ((res = mp_init_size (&q, a->used + 2)) != MP_OKAY) { + return res; + } + q.used = a->used + 2; + + if ((res = mp_init (&t1)) != MP_OKAY) { + goto LBL_Q; + } + + if ((res = mp_init (&t2)) != MP_OKAY) { + goto LBL_T1; + } + + if ((res = mp_init_copy (&x, a)) != MP_OKAY) { + goto LBL_T2; + } + + if ((res = mp_init_copy (&y, b)) != MP_OKAY) { + goto LBL_X; + } + + /* fix the sign */ + neg = (a->sign == b->sign) ? MP_ZPOS : MP_NEG; + x.sign = y.sign = MP_ZPOS; + + /* normalize both x and y, ensure that y >= b/2, [b == 2**DIGIT_BIT] */ + norm = mp_count_bits(&y) % DIGIT_BIT; + if (norm < (int)(DIGIT_BIT-1)) { + norm = (DIGIT_BIT-1) - norm; + if ((res = mp_mul_2d (&x, norm, &x)) != MP_OKAY) { + goto LBL_Y; + } + if ((res = mp_mul_2d (&y, norm, &y)) != MP_OKAY) { + goto LBL_Y; + } + } else { + norm = 0; + } + + /* note hac does 0 based, so if used==5 then its 0,1,2,3,4, e.g. use 4 */ + n = x.used - 1; + t = y.used - 1; + + /* while (x >= y*b**n-t) do { q[n-t] += 1; x -= y*b**{n-t} } */ + if ((res = mp_lshd (&y, n - t)) != MP_OKAY) { /* y = y*b**{n-t} */ + goto LBL_Y; + } + + while (mp_cmp (&x, &y) != MP_LT) { + ++(q.dp[n - t]); + if ((res = mp_sub (&x, &y, &x)) != MP_OKAY) { + goto LBL_Y; + } + } + + /* reset y by shifting it back down */ + mp_rshd (&y, n - t); + + /* step 3. for i from n down to (t + 1) */ + for (i = n; i >= (t + 1); i--) { + if (i > x.used) { + continue; + } + + /* step 3.1 if xi == yt then set q{i-t-1} to b-1, + * otherwise set q{i-t-1} to (xi*b + x{i-1})/yt */ + if (x.dp[i] == y.dp[t]) { + q.dp[i - t - 1] = ((((mp_digit)1) << DIGIT_BIT) - 1); + } else { + mp_word tmp; + tmp = ((mp_word) x.dp[i]) << ((mp_word) DIGIT_BIT); + tmp |= ((mp_word) x.dp[i - 1]); + tmp /= ((mp_word) y.dp[t]); + if (tmp > (mp_word) MP_MASK) + tmp = MP_MASK; + q.dp[i - t - 1] = (mp_digit) (tmp & (mp_word) (MP_MASK)); + } + + /* while (q{i-t-1} * (yt * b + y{t-1})) > + xi * b**2 + xi-1 * b + xi-2 + + do q{i-t-1} -= 1; + */ + q.dp[i - t - 1] = (q.dp[i - t - 1] + 1) & MP_MASK; + do { + q.dp[i - t - 1] = (q.dp[i - t - 1] - 1) & MP_MASK; + + /* find left hand */ + mp_zero (&t1); + t1.dp[0] = (t - 1 < 0) ? 0 : y.dp[t - 1]; + t1.dp[1] = y.dp[t]; + t1.used = 2; + if ((res = mp_mul_d (&t1, q.dp[i - t - 1], &t1)) != MP_OKAY) { + goto LBL_Y; + } + + /* find right hand */ + t2.dp[0] = (i - 2 < 0) ? 0 : x.dp[i - 2]; + t2.dp[1] = (i - 1 < 0) ? 0 : x.dp[i - 1]; + t2.dp[2] = x.dp[i]; + t2.used = 3; + } while (mp_cmp_mag(&t1, &t2) == MP_GT); + + /* step 3.3 x = x - q{i-t-1} * y * b**{i-t-1} */ + if ((res = mp_mul_d (&y, q.dp[i - t - 1], &t1)) != MP_OKAY) { + goto LBL_Y; + } + + if ((res = mp_lshd (&t1, i - t - 1)) != MP_OKAY) { + goto LBL_Y; + } + + if ((res = mp_sub (&x, &t1, &x)) != MP_OKAY) { + goto LBL_Y; + } + + /* if x < 0 then { x = x + y*b**{i-t-1}; q{i-t-1} -= 1; } */ + if (x.sign == MP_NEG) { + if ((res = mp_copy (&y, &t1)) != MP_OKAY) { + goto LBL_Y; + } + if ((res = mp_lshd (&t1, i - t - 1)) != MP_OKAY) { + goto LBL_Y; + } + if ((res = mp_add (&x, &t1, &x)) != MP_OKAY) { + goto LBL_Y; + } + + q.dp[i - t - 1] = (q.dp[i - t - 1] - 1UL) & MP_MASK; + } + } + + /* now q is the quotient and x is the remainder + * [which we have to normalize] + */ + + /* get sign before writing to c */ + x.sign = x.used == 0 ? MP_ZPOS : a->sign; + + if (c != NULL) { + mp_clamp (&q); + mp_exch (&q, c); + c->sign = neg; + } + + if (d != NULL) { + mp_div_2d (&x, norm, &x, NULL); + mp_exch (&x, d); + } + + res = MP_OKAY; + +LBL_Y:mp_clear (&y); +LBL_X:mp_clear (&x); +LBL_T2:mp_clear (&t2); +LBL_T1:mp_clear (&t1); +LBL_Q:mp_clear (&q); + return res; +} + +#endif + +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_div.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_div_2.c b/dep/StormLib/src/libtommath/bn_mp_div_2.c new file mode 100644 index 00000000000..f3b9d16fa37 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_div_2.c @@ -0,0 +1,68 @@ +#include "tommath.h" +#ifdef BN_MP_DIV_2_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* b = a/2 */ +int mp_div_2(mp_int * a, mp_int * b) +{ + int x, res, oldused; + + /* copy */ + if (b->alloc < a->used) { + if ((res = mp_grow (b, a->used)) != MP_OKAY) { + return res; + } + } + + oldused = b->used; + b->used = a->used; + { + register mp_digit r, rr, *tmpa, *tmpb; + + /* source alias */ + tmpa = a->dp + b->used - 1; + + /* dest alias */ + tmpb = b->dp + b->used - 1; + + /* carry */ + r = 0; + for (x = b->used - 1; x >= 0; x--) { + /* get the carry for the next iteration */ + rr = *tmpa & 1; + + /* shift the current digit, add in carry and store */ + *tmpb-- = (*tmpa-- >> 1) | (r << (DIGIT_BIT - 1)); + + /* forward carry to next iteration */ + r = rr; + } + + /* zero excess digits */ + tmpb = b->dp + b->used; + for (x = b->used; x < oldused; x++) { + *tmpb++ = 0; + } + } + b->sign = a->sign; + mp_clamp (b); + return MP_OKAY; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_div_2.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_div_2d.c b/dep/StormLib/src/libtommath/bn_mp_div_2d.c new file mode 100644 index 00000000000..861ea23a31a --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_div_2d.c @@ -0,0 +1,97 @@ +#include "tommath.h" +#ifdef BN_MP_DIV_2D_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* shift right by a certain bit count (store quotient in c, optional remainder in d) */ +int mp_div_2d (mp_int * a, int b, mp_int * c, mp_int * d) +{ + mp_digit D, r, rr; + int x, res; + mp_int t; + + + /* if the shift count is <= 0 then we do no work */ + if (b <= 0) { + res = mp_copy (a, c); + if (d != NULL) { + mp_zero (d); + } + return res; + } + + if ((res = mp_init (&t)) != MP_OKAY) { + return res; + } + + /* get the remainder */ + if (d != NULL) { + if ((res = mp_mod_2d (a, b, &t)) != MP_OKAY) { + mp_clear (&t); + return res; + } + } + + /* copy */ + if ((res = mp_copy (a, c)) != MP_OKAY) { + mp_clear (&t); + return res; + } + + /* shift by as many digits in the bit count */ + if (b >= (int)DIGIT_BIT) { + mp_rshd (c, b / DIGIT_BIT); + } + + /* shift any bit count < DIGIT_BIT */ + D = (mp_digit) (b % DIGIT_BIT); + if (D != 0) { + register mp_digit *tmpc, mask, shift; + + /* mask */ + mask = (((mp_digit)1) << D) - 1; + + /* shift for lsb */ + shift = DIGIT_BIT - D; + + /* alias */ + tmpc = c->dp + (c->used - 1); + + /* carry */ + r = 0; + for (x = c->used - 1; x >= 0; x--) { + /* get the lower bits of this word in a temp */ + rr = *tmpc & mask; + + /* shift the current word and mix in the carry bits from the previous word */ + *tmpc = (*tmpc >> D) | (r << shift); + --tmpc; + + /* set the carry to the carry bits of the current word found above */ + r = rr; + } + } + mp_clamp (c); + if (d != NULL) { + mp_exch (&t, d); + } + mp_clear (&t); + return MP_OKAY; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_div_2d.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_div_3.c b/dep/StormLib/src/libtommath/bn_mp_div_3.c new file mode 100644 index 00000000000..4fc08fc4da4 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_div_3.c @@ -0,0 +1,79 @@ +#include "tommath.h" +#ifdef BN_MP_DIV_3_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* divide by three (based on routine from MPI and the GMP manual) */ +int +mp_div_3 (mp_int * a, mp_int *c, mp_digit * d) +{ + mp_int q; + mp_word w, t; + mp_digit b; + int res, ix; + + /* b = 2**DIGIT_BIT / 3 */ + b = (((mp_word)1) << ((mp_word)DIGIT_BIT)) / ((mp_word)3); + + if ((res = mp_init_size(&q, a->used)) != MP_OKAY) { + return res; + } + + q.used = a->used; + q.sign = a->sign; + w = 0; + for (ix = a->used - 1; ix >= 0; ix--) { + w = (w << ((mp_word)DIGIT_BIT)) | ((mp_word)a->dp[ix]); + + if (w >= 3) { + /* multiply w by [1/3] */ + t = (w * ((mp_word)b)) >> ((mp_word)DIGIT_BIT); + + /* now subtract 3 * [w/3] from w, to get the remainder */ + w -= t+t+t; + + /* fixup the remainder as required since + * the optimization is not exact. + */ + while (w >= 3) { + t += 1; + w -= 3; + } + } else { + t = 0; + } + q.dp[ix] = (mp_digit)t; + } + + /* [optional] store the remainder */ + if (d != NULL) { + *d = (mp_digit)w; + } + + /* [optional] store the quotient */ + if (c != NULL) { + mp_clamp(&q); + mp_exch(&q, c); + } + mp_clear(&q); + + return res; +} + +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_div_3.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_div_d.c b/dep/StormLib/src/libtommath/bn_mp_div_d.c new file mode 100644 index 00000000000..c0318a4a1be --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_div_d.c @@ -0,0 +1,115 @@ +#include "tommath.h" +#ifdef BN_MP_DIV_D_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +static int s_is_power_of_two(mp_digit b, int *p) +{ + int x; + + /* fast return if no power of two */ + if ((b==0) || (b & (b-1))) { + return 0; + } + + for (x = 0; x < DIGIT_BIT; x++) { + if (b == (((mp_digit)1)<dp[0] & ((((mp_digit)1)<used)) != MP_OKAY) { + return res; + } + + q.used = a->used; + q.sign = a->sign; + w = 0; + for (ix = a->used - 1; ix >= 0; ix--) { + w = (w << ((mp_word)DIGIT_BIT)) | ((mp_word)a->dp[ix]); + + if (w >= b) { + t = (mp_digit)(w / b); + w -= ((mp_word)t) * ((mp_word)b); + } else { + t = 0; + } + q.dp[ix] = (mp_digit)t; + } + + if (d != NULL) { + *d = (mp_digit)w; + } + + if (c != NULL) { + mp_clamp(&q); + mp_exch(&q, c); + } + mp_clear(&q); + + return res; +} + +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_div_d.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2007/01/09 04:44:32 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_dr_is_modulus.c b/dep/StormLib/src/libtommath/bn_mp_dr_is_modulus.c new file mode 100644 index 00000000000..22ba5df3d0a --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_dr_is_modulus.c @@ -0,0 +1,43 @@ +#include "tommath.h" +#ifdef BN_MP_DR_IS_MODULUS_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* determines if a number is a valid DR modulus */ +int mp_dr_is_modulus(mp_int *a) +{ + int ix; + + /* must be at least two digits */ + if (a->used < 2) { + return 0; + } + + /* must be of the form b**k - a [a <= b] so all + * but the first digit must be equal to -1 (mod b). + */ + for (ix = 1; ix < a->used; ix++) { + if (a->dp[ix] != MP_MASK) { + return 0; + } + } + return 1; +} + +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_dr_is_modulus.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_dr_reduce.c b/dep/StormLib/src/libtommath/bn_mp_dr_reduce.c new file mode 100644 index 00000000000..0afac941fca --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_dr_reduce.c @@ -0,0 +1,94 @@ +#include "tommath.h" +#ifdef BN_MP_DR_REDUCE_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* reduce "x" in place modulo "n" using the Diminished Radix algorithm. + * + * Based on algorithm from the paper + * + * "Generating Efficient Primes for Discrete Log Cryptosystems" + * Chae Hoon Lim, Pil Joong Lee, + * POSTECH Information Research Laboratories + * + * The modulus must be of a special format [see manual] + * + * Has been modified to use algorithm 7.10 from the LTM book instead + * + * Input x must be in the range 0 <= x <= (n-1)**2 + */ +int +mp_dr_reduce (mp_int * x, mp_int * n, mp_digit k) +{ + int err, i, m; + mp_word r; + mp_digit mu, *tmpx1, *tmpx2; + + /* m = digits in modulus */ + m = n->used; + + /* ensure that "x" has at least 2m digits */ + if (x->alloc < m + m) { + if ((err = mp_grow (x, m + m)) != MP_OKAY) { + return err; + } + } + +/* top of loop, this is where the code resumes if + * another reduction pass is required. + */ +top: + /* aliases for digits */ + /* alias for lower half of x */ + tmpx1 = x->dp; + + /* alias for upper half of x, or x/B**m */ + tmpx2 = x->dp + m; + + /* set carry to zero */ + mu = 0; + + /* compute (x mod B**m) + k * [x/B**m] inline and inplace */ + for (i = 0; i < m; i++) { + r = ((mp_word)*tmpx2++) * ((mp_word)k) + *tmpx1 + mu; + *tmpx1++ = (mp_digit)(r & MP_MASK); + mu = (mp_digit)(r >> ((mp_word)DIGIT_BIT)); + } + + /* set final carry */ + *tmpx1++ = mu; + + /* zero words above m */ + for (i = m + 1; i < x->used; i++) { + *tmpx1++ = 0; + } + + /* clamp, sub and return */ + mp_clamp (x); + + /* if x >= n then subtract and reduce again + * Each successive "recursion" makes the input smaller and smaller. + */ + if (mp_cmp_mag (x, n) != MP_LT) { + s_mp_sub(x, n, x); + goto top; + } + return MP_OKAY; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_dr_reduce.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_dr_setup.c b/dep/StormLib/src/libtommath/bn_mp_dr_setup.c new file mode 100644 index 00000000000..a5152f713bd --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_dr_setup.c @@ -0,0 +1,32 @@ +#include "tommath.h" +#ifdef BN_MP_DR_SETUP_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* determines the setup value */ +void mp_dr_setup(mp_int *a, mp_digit *d) +{ + /* the casts are required if DIGIT_BIT is one less than + * the number of bits in a mp_digit [e.g. DIGIT_BIT==31] + */ + *d = (mp_digit)((((mp_word)1) << ((mp_word)DIGIT_BIT)) - + ((mp_word)a->dp[0])); +} + +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_dr_setup.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_exch.c b/dep/StormLib/src/libtommath/bn_mp_exch.c new file mode 100644 index 00000000000..e5ec7f57730 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_exch.c @@ -0,0 +1,34 @@ +#include "tommath.h" +#ifdef BN_MP_EXCH_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* swap the elements of two integers, for cases where you can't simply swap the + * mp_int pointers around + */ +void +mp_exch (mp_int * a, mp_int * b) +{ + mp_int t; + + t = *a; + *a = *b; + *b = t; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_exch.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_expt_d.c b/dep/StormLib/src/libtommath/bn_mp_expt_d.c new file mode 100644 index 00000000000..7bf371ce6ae --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_expt_d.c @@ -0,0 +1,57 @@ +#include "tommath.h" +#ifdef BN_MP_EXPT_D_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* calculate c = a**b using a square-multiply algorithm */ +int mp_expt_d (mp_int * a, mp_digit b, mp_int * c) +{ + int res, x; + mp_int g; + + if ((res = mp_init_copy (&g, a)) != MP_OKAY) { + return res; + } + + /* set initial result */ + mp_set (c, 1); + + for (x = 0; x < (int) DIGIT_BIT; x++) { + /* square */ + if ((res = mp_sqr (c, c)) != MP_OKAY) { + mp_clear (&g); + return res; + } + + /* if the bit is set multiply */ + if ((b & (mp_digit) (((mp_digit)1) << (DIGIT_BIT - 1))) != 0) { + if ((res = mp_mul (c, &g, c)) != MP_OKAY) { + mp_clear (&g); + return res; + } + } + + /* shift to next bit */ + b <<= 1; + } + + mp_clear (&g); + return MP_OKAY; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_expt_d.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_exptmod.c b/dep/StormLib/src/libtommath/bn_mp_exptmod.c new file mode 100644 index 00000000000..27c46ea0ab2 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_exptmod.c @@ -0,0 +1,112 @@ +#include "tommath.h" +#ifdef BN_MP_EXPTMOD_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + + +/* this is a shell function that calls either the normal or Montgomery + * exptmod functions. Originally the call to the montgomery code was + * embedded in the normal function but that wasted alot of stack space + * for nothing (since 99% of the time the Montgomery code would be called) + */ +int mp_exptmod (mp_int * G, mp_int * X, mp_int * P, mp_int * Y) +{ + int dr; + + /* modulus P must be positive */ + if (P->sign == MP_NEG) { + return MP_VAL; + } + + /* if exponent X is negative we have to recurse */ + if (X->sign == MP_NEG) { +#ifdef BN_MP_INVMOD_C + mp_int tmpG, tmpX; + int err; + + /* first compute 1/G mod P */ + if ((err = mp_init(&tmpG)) != MP_OKAY) { + return err; + } + if ((err = mp_invmod(G, P, &tmpG)) != MP_OKAY) { + mp_clear(&tmpG); + return err; + } + + /* now get |X| */ + if ((err = mp_init(&tmpX)) != MP_OKAY) { + mp_clear(&tmpG); + return err; + } + if ((err = mp_abs(X, &tmpX)) != MP_OKAY) { + mp_clear_multi(&tmpG, &tmpX, NULL); + return err; + } + + /* and now compute (1/G)**|X| instead of G**X [X < 0] */ + err = mp_exptmod(&tmpG, &tmpX, P, Y); + mp_clear_multi(&tmpG, &tmpX, NULL); + return err; +#else + /* no invmod */ + return MP_VAL; +#endif + } + +/* modified diminished radix reduction */ +#if defined(BN_MP_REDUCE_IS_2K_L_C) && defined(BN_MP_REDUCE_2K_L_C) && defined(BN_S_MP_EXPTMOD_C) + if (mp_reduce_is_2k_l(P) == MP_YES) { + return s_mp_exptmod(G, X, P, Y, 1); + } +#endif + +#ifdef BN_MP_DR_IS_MODULUS_C + /* is it a DR modulus? */ + dr = mp_dr_is_modulus(P); +#else + /* default to no */ + dr = 0; +#endif + +#ifdef BN_MP_REDUCE_IS_2K_C + /* if not, is it a unrestricted DR modulus? */ + if (dr == 0) { + dr = mp_reduce_is_2k(P) << 1; + } +#endif + + /* if the modulus is odd or dr != 0 use the montgomery method */ +#ifdef BN_MP_EXPTMOD_FAST_C + if (mp_isodd (P) == 1 || dr != 0) { + return mp_exptmod_fast (G, X, P, Y, dr); + } else { +#endif +#ifdef BN_S_MP_EXPTMOD_C + /* otherwise use the generic Barrett reduction technique */ + return s_mp_exptmod (G, X, P, Y, 0); +#else + /* no exptmod for evens */ + return MP_VAL; +#endif +#ifdef BN_MP_EXPTMOD_FAST_C + } +#endif +} + +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_exptmod.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_exptmod_fast.c b/dep/StormLib/src/libtommath/bn_mp_exptmod_fast.c new file mode 100644 index 00000000000..31205d4e20c --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_exptmod_fast.c @@ -0,0 +1,321 @@ +#include "tommath.h" +#ifdef BN_MP_EXPTMOD_FAST_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* computes Y == G**X mod P, HAC pp.616, Algorithm 14.85 + * + * Uses a left-to-right k-ary sliding window to compute the modular exponentiation. + * The value of k changes based on the size of the exponent. + * + * Uses Montgomery or Diminished Radix reduction [whichever appropriate] + */ + +#ifdef MP_LOW_MEM + #define TAB_SIZE 32 +#else + #define TAB_SIZE 256 +#endif + +int mp_exptmod_fast (mp_int * G, mp_int * X, mp_int * P, mp_int * Y, int redmode) +{ + mp_int M[TAB_SIZE], res; + mp_digit buf, mp; + int err, bitbuf, bitcpy, bitcnt, mode, digidx, x, y, winsize; + + /* use a pointer to the reduction algorithm. This allows us to use + * one of many reduction algorithms without modding the guts of + * the code with if statements everywhere. + */ + int (*redux)(mp_int*,mp_int*,mp_digit); + + /* find window size */ + x = mp_count_bits (X); + if (x <= 7) { + winsize = 2; + } else if (x <= 36) { + winsize = 3; + } else if (x <= 140) { + winsize = 4; + } else if (x <= 450) { + winsize = 5; + } else if (x <= 1303) { + winsize = 6; + } else if (x <= 3529) { + winsize = 7; + } else { + winsize = 8; + } + +#ifdef MP_LOW_MEM + if (winsize > 5) { + winsize = 5; + } +#endif + + /* init M array */ + /* init first cell */ + if ((err = mp_init(&M[1])) != MP_OKAY) { + return err; + } + + /* now init the second half of the array */ + for (x = 1<<(winsize-1); x < (1 << winsize); x++) { + if ((err = mp_init(&M[x])) != MP_OKAY) { + for (y = 1<<(winsize-1); y < x; y++) { + mp_clear (&M[y]); + } + mp_clear(&M[1]); + return err; + } + } + + /* determine and setup reduction code */ + if (redmode == 0) { +#ifdef BN_MP_MONTGOMERY_SETUP_C + /* now setup montgomery */ + if ((err = mp_montgomery_setup (P, &mp)) != MP_OKAY) { + goto LBL_M; + } +#else + err = MP_VAL; + goto LBL_M; +#endif + + /* automatically pick the comba one if available (saves quite a few calls/ifs) */ +#ifdef BN_FAST_MP_MONTGOMERY_REDUCE_C + if (((P->used * 2 + 1) < MP_WARRAY) && + P->used < (1 << ((CHAR_BIT * sizeof (mp_word)) - (2 * DIGIT_BIT)))) { + redux = fast_mp_montgomery_reduce; + } else +#endif + { +#ifdef BN_MP_MONTGOMERY_REDUCE_C + /* use slower baseline Montgomery method */ + redux = mp_montgomery_reduce; +#else + err = MP_VAL; + goto LBL_M; +#endif + } + } else if (redmode == 1) { +#if defined(BN_MP_DR_SETUP_C) && defined(BN_MP_DR_REDUCE_C) + /* setup DR reduction for moduli of the form B**k - b */ + mp_dr_setup(P, &mp); + redux = mp_dr_reduce; +#else + err = MP_VAL; + goto LBL_M; +#endif + } else { +#if defined(BN_MP_REDUCE_2K_SETUP_C) && defined(BN_MP_REDUCE_2K_C) + /* setup DR reduction for moduli of the form 2**k - b */ + if ((err = mp_reduce_2k_setup(P, &mp)) != MP_OKAY) { + goto LBL_M; + } + redux = mp_reduce_2k; +#else + err = MP_VAL; + goto LBL_M; +#endif + } + + /* setup result */ + if ((err = mp_init (&res)) != MP_OKAY) { + goto LBL_M; + } + + /* create M table + * + + * + * The first half of the table is not computed though accept for M[0] and M[1] + */ + + if (redmode == 0) { +#ifdef BN_MP_MONTGOMERY_CALC_NORMALIZATION_C + /* now we need R mod m */ + if ((err = mp_montgomery_calc_normalization (&res, P)) != MP_OKAY) { + goto LBL_RES; + } +#else + err = MP_VAL; + goto LBL_RES; +#endif + + /* now set M[1] to G * R mod m */ + if ((err = mp_mulmod (G, &res, P, &M[1])) != MP_OKAY) { + goto LBL_RES; + } + } else { + mp_set(&res, 1); + if ((err = mp_mod(G, P, &M[1])) != MP_OKAY) { + goto LBL_RES; + } + } + + /* compute the value at M[1<<(winsize-1)] by squaring M[1] (winsize-1) times */ + if ((err = mp_copy (&M[1], &M[1 << (winsize - 1)])) != MP_OKAY) { + goto LBL_RES; + } + + for (x = 0; x < (winsize - 1); x++) { + if ((err = mp_sqr (&M[1 << (winsize - 1)], &M[1 << (winsize - 1)])) != MP_OKAY) { + goto LBL_RES; + } + if ((err = redux (&M[1 << (winsize - 1)], P, mp)) != MP_OKAY) { + goto LBL_RES; + } + } + + /* create upper table */ + for (x = (1 << (winsize - 1)) + 1; x < (1 << winsize); x++) { + if ((err = mp_mul (&M[x - 1], &M[1], &M[x])) != MP_OKAY) { + goto LBL_RES; + } + if ((err = redux (&M[x], P, mp)) != MP_OKAY) { + goto LBL_RES; + } + } + + /* set initial mode and bit cnt */ + mode = 0; + bitcnt = 1; + buf = 0; + digidx = X->used - 1; + bitcpy = 0; + bitbuf = 0; + + for (;;) { + /* grab next digit as required */ + if (--bitcnt == 0) { + /* if digidx == -1 we are out of digits so break */ + if (digidx == -1) { + break; + } + /* read next digit and reset bitcnt */ + buf = X->dp[digidx--]; + bitcnt = (int)DIGIT_BIT; + } + + /* grab the next msb from the exponent */ + y = (mp_digit)(buf >> (DIGIT_BIT - 1)) & 1; + buf <<= (mp_digit)1; + + /* if the bit is zero and mode == 0 then we ignore it + * These represent the leading zero bits before the first 1 bit + * in the exponent. Technically this opt is not required but it + * does lower the # of trivial squaring/reductions used + */ + if (mode == 0 && y == 0) { + continue; + } + + /* if the bit is zero and mode == 1 then we square */ + if (mode == 1 && y == 0) { + if ((err = mp_sqr (&res, &res)) != MP_OKAY) { + goto LBL_RES; + } + if ((err = redux (&res, P, mp)) != MP_OKAY) { + goto LBL_RES; + } + continue; + } + + /* else we add it to the window */ + bitbuf |= (y << (winsize - ++bitcpy)); + mode = 2; + + if (bitcpy == winsize) { + /* ok window is filled so square as required and multiply */ + /* square first */ + for (x = 0; x < winsize; x++) { + if ((err = mp_sqr (&res, &res)) != MP_OKAY) { + goto LBL_RES; + } + if ((err = redux (&res, P, mp)) != MP_OKAY) { + goto LBL_RES; + } + } + + /* then multiply */ + if ((err = mp_mul (&res, &M[bitbuf], &res)) != MP_OKAY) { + goto LBL_RES; + } + if ((err = redux (&res, P, mp)) != MP_OKAY) { + goto LBL_RES; + } + + /* empty window and reset */ + bitcpy = 0; + bitbuf = 0; + mode = 1; + } + } + + /* if bits remain then square/multiply */ + if (mode == 2 && bitcpy > 0) { + /* square then multiply if the bit is set */ + for (x = 0; x < bitcpy; x++) { + if ((err = mp_sqr (&res, &res)) != MP_OKAY) { + goto LBL_RES; + } + if ((err = redux (&res, P, mp)) != MP_OKAY) { + goto LBL_RES; + } + + /* get next bit of the window */ + bitbuf <<= 1; + if ((bitbuf & (1 << winsize)) != 0) { + /* then multiply */ + if ((err = mp_mul (&res, &M[1], &res)) != MP_OKAY) { + goto LBL_RES; + } + if ((err = redux (&res, P, mp)) != MP_OKAY) { + goto LBL_RES; + } + } + } + } + + if (redmode == 0) { + /* fixup result if Montgomery reduction is used + * recall that any value in a Montgomery system is + * actually multiplied by R mod n. So we have + * to reduce one more time to cancel out the factor + * of R. + */ + if ((err = redux(&res, P, mp)) != MP_OKAY) { + goto LBL_RES; + } + } + + /* swap res with Y */ + mp_exch (&res, Y); + err = MP_OKAY; +LBL_RES:mp_clear (&res); +LBL_M: + mp_clear(&M[1]); + for (x = 1<<(winsize-1); x < (1 << winsize); x++) { + mp_clear (&M[x]); + } + return err; +} +#endif + + +/* $Source: /cvs/libtom/libtommath/bn_mp_exptmod_fast.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_exteuclid.c b/dep/StormLib/src/libtommath/bn_mp_exteuclid.c new file mode 100644 index 00000000000..9881d6edc80 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_exteuclid.c @@ -0,0 +1,82 @@ +#include "tommath.h" +#ifdef BN_MP_EXTEUCLID_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* Extended euclidean algorithm of (a, b) produces + a*u1 + b*u2 = u3 + */ +int mp_exteuclid(mp_int *a, mp_int *b, mp_int *U1, mp_int *U2, mp_int *U3) +{ + mp_int u1,u2,u3,v1,v2,v3,t1,t2,t3,q,tmp; + int err; + + if ((err = mp_init_multi(&u1, &u2, &u3, &v1, &v2, &v3, &t1, &t2, &t3, &q, &tmp, NULL)) != MP_OKAY) { + return err; + } + + /* initialize, (u1,u2,u3) = (1,0,a) */ + mp_set(&u1, 1); + if ((err = mp_copy(a, &u3)) != MP_OKAY) { goto _ERR; } + + /* initialize, (v1,v2,v3) = (0,1,b) */ + mp_set(&v2, 1); + if ((err = mp_copy(b, &v3)) != MP_OKAY) { goto _ERR; } + + /* loop while v3 != 0 */ + while (mp_iszero(&v3) == MP_NO) { + /* q = u3/v3 */ + if ((err = mp_div(&u3, &v3, &q, NULL)) != MP_OKAY) { goto _ERR; } + + /* (t1,t2,t3) = (u1,u2,u3) - (v1,v2,v3)q */ + if ((err = mp_mul(&v1, &q, &tmp)) != MP_OKAY) { goto _ERR; } + if ((err = mp_sub(&u1, &tmp, &t1)) != MP_OKAY) { goto _ERR; } + if ((err = mp_mul(&v2, &q, &tmp)) != MP_OKAY) { goto _ERR; } + if ((err = mp_sub(&u2, &tmp, &t2)) != MP_OKAY) { goto _ERR; } + if ((err = mp_mul(&v3, &q, &tmp)) != MP_OKAY) { goto _ERR; } + if ((err = mp_sub(&u3, &tmp, &t3)) != MP_OKAY) { goto _ERR; } + + /* (u1,u2,u3) = (v1,v2,v3) */ + if ((err = mp_copy(&v1, &u1)) != MP_OKAY) { goto _ERR; } + if ((err = mp_copy(&v2, &u2)) != MP_OKAY) { goto _ERR; } + if ((err = mp_copy(&v3, &u3)) != MP_OKAY) { goto _ERR; } + + /* (v1,v2,v3) = (t1,t2,t3) */ + if ((err = mp_copy(&t1, &v1)) != MP_OKAY) { goto _ERR; } + if ((err = mp_copy(&t2, &v2)) != MP_OKAY) { goto _ERR; } + if ((err = mp_copy(&t3, &v3)) != MP_OKAY) { goto _ERR; } + } + + /* make sure U3 >= 0 */ + if (u3.sign == MP_NEG) { + mp_neg(&u1, &u1); + mp_neg(&u2, &u2); + mp_neg(&u3, &u3); + } + + /* copy result out */ + if (U1 != NULL) { mp_exch(U1, &u1); } + if (U2 != NULL) { mp_exch(U2, &u2); } + if (U3 != NULL) { mp_exch(U3, &u3); } + + err = MP_OKAY; +_ERR: mp_clear_multi(&u1, &u2, &u3, &v1, &v2, &v3, &t1, &t2, &t3, &q, &tmp, NULL); + return err; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_exteuclid.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_fread.c b/dep/StormLib/src/libtommath/bn_mp_fread.c new file mode 100644 index 00000000000..2976b30aa68 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_fread.c @@ -0,0 +1,67 @@ +#include "tommath.h" +#ifdef BN_MP_FREAD_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* read a bigint from a file stream in ASCII */ +int mp_fread(mp_int *a, int radix, FILE *stream) +{ + int err, ch, neg, y; + + /* clear a */ + mp_zero(a); + + /* if first digit is - then set negative */ + ch = fgetc(stream); + if (ch == '-') { + neg = MP_NEG; + ch = fgetc(stream); + } else { + neg = MP_ZPOS; + } + + for (;;) { + /* find y in the radix map */ + for (y = 0; y < radix; y++) { + if (mp_s_rmap[y] == ch) { + break; + } + } + if (y == radix) { + break; + } + + /* shift up and add */ + if ((err = mp_mul_d(a, radix, a)) != MP_OKAY) { + return err; + } + if ((err = mp_add_d(a, y, a)) != MP_OKAY) { + return err; + } + + ch = fgetc(stream); + } + if (mp_cmp_d(a, 0) != MP_EQ) { + a->sign = neg; + } + + return MP_OKAY; +} + +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_fread.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_fwrite.c b/dep/StormLib/src/libtommath/bn_mp_fwrite.c new file mode 100644 index 00000000000..6782b2e19f7 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_fwrite.c @@ -0,0 +1,52 @@ +#include "tommath.h" +#ifdef BN_MP_FWRITE_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +int mp_fwrite(mp_int *a, int radix, FILE *stream) +{ + char *buf; + int err, len, x; + + if ((err = mp_radix_size(a, radix, &len)) != MP_OKAY) { + return err; + } + + buf = OPT_CAST(char) XMALLOC (len); + if (buf == NULL) { + return MP_MEM; + } + + if ((err = mp_toradix(a, buf, radix)) != MP_OKAY) { + XFREE (buf); + return err; + } + + for (x = 0; x < len; x++) { + if (fputc(buf[x], stream) == EOF) { + XFREE (buf); + return MP_VAL; + } + } + + XFREE (buf); + return MP_OKAY; +} + +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_fwrite.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_gcd.c b/dep/StormLib/src/libtommath/bn_mp_gcd.c new file mode 100644 index 00000000000..ce980eb6bb0 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_gcd.c @@ -0,0 +1,105 @@ +#include "tommath.h" +#ifdef BN_MP_GCD_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* Greatest Common Divisor using the binary method */ +int mp_gcd (mp_int * a, mp_int * b, mp_int * c) +{ + mp_int u, v; + int k, u_lsb, v_lsb, res; + + /* either zero than gcd is the largest */ + if (mp_iszero (a) == MP_YES) { + return mp_abs (b, c); + } + if (mp_iszero (b) == MP_YES) { + return mp_abs (a, c); + } + + /* get copies of a and b we can modify */ + if ((res = mp_init_copy (&u, a)) != MP_OKAY) { + return res; + } + + if ((res = mp_init_copy (&v, b)) != MP_OKAY) { + goto LBL_U; + } + + /* must be positive for the remainder of the algorithm */ + u.sign = v.sign = MP_ZPOS; + + /* B1. Find the common power of two for u and v */ + u_lsb = mp_cnt_lsb(&u); + v_lsb = mp_cnt_lsb(&v); + k = MIN(u_lsb, v_lsb); + + if (k > 0) { + /* divide the power of two out */ + if ((res = mp_div_2d(&u, k, &u, NULL)) != MP_OKAY) { + goto LBL_V; + } + + if ((res = mp_div_2d(&v, k, &v, NULL)) != MP_OKAY) { + goto LBL_V; + } + } + + /* divide any remaining factors of two out */ + if (u_lsb != k) { + if ((res = mp_div_2d(&u, u_lsb - k, &u, NULL)) != MP_OKAY) { + goto LBL_V; + } + } + + if (v_lsb != k) { + if ((res = mp_div_2d(&v, v_lsb - k, &v, NULL)) != MP_OKAY) { + goto LBL_V; + } + } + + while (mp_iszero(&v) == 0) { + /* make sure v is the largest */ + if (mp_cmp_mag(&u, &v) == MP_GT) { + /* swap u and v to make sure v is >= u */ + mp_exch(&u, &v); + } + + /* subtract smallest from largest */ + if ((res = s_mp_sub(&v, &u, &v)) != MP_OKAY) { + goto LBL_V; + } + + /* Divide out all factors of two */ + if ((res = mp_div_2d(&v, mp_cnt_lsb(&v), &v, NULL)) != MP_OKAY) { + goto LBL_V; + } + } + + /* multiply by 2**k which we divided out at the beginning */ + if ((res = mp_mul_2d (&u, k, c)) != MP_OKAY) { + goto LBL_V; + } + c->sign = MP_ZPOS; + res = MP_OKAY; +LBL_V:mp_clear (&u); +LBL_U:mp_clear (&v); + return res; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_gcd.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_get_int.c b/dep/StormLib/src/libtommath/bn_mp_get_int.c new file mode 100644 index 00000000000..d9c76d0d15c --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_get_int.c @@ -0,0 +1,45 @@ +#include "tommath.h" +#ifdef BN_MP_GET_INT_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* get the lower 32-bits of an mp_int */ +unsigned long mp_get_int(mp_int * a) +{ + int i; + unsigned long res; + + if (a->used == 0) { + return 0; + } + + /* get number of digits of the lsb we have to read */ + i = MIN(a->used,(int)((sizeof(unsigned long)*CHAR_BIT+DIGIT_BIT-1)/DIGIT_BIT))-1; + + /* get most significant digit of result */ + res = DIGIT(a,i); + + while (--i >= 0) { + res = (res << DIGIT_BIT) | DIGIT(a,i); + } + + /* force result to 32-bits always so it is consistent on non 32-bit platforms */ + return res & 0xFFFFFFFFUL; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_get_int.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_grow.c b/dep/StormLib/src/libtommath/bn_mp_grow.c new file mode 100644 index 00000000000..a05dad73bc1 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_grow.c @@ -0,0 +1,57 @@ +#include "tommath.h" +#ifdef BN_MP_GROW_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* grow as required */ +int mp_grow (mp_int * a, int size) +{ + int i; + mp_digit *tmp; + + /* if the alloc size is smaller alloc more ram */ + if (a->alloc < size) { + /* ensure there are always at least MP_PREC digits extra on top */ + size += (MP_PREC * 2) - (size % MP_PREC); + + /* reallocate the array a->dp + * + * We store the return in a temporary variable + * in case the operation failed we don't want + * to overwrite the dp member of a. + */ + tmp = OPT_CAST(mp_digit) XREALLOC (a->dp, sizeof (mp_digit) * size); + if (tmp == NULL) { + /* reallocation failed but "a" is still valid [can be freed] */ + return MP_MEM; + } + + /* reallocation succeeded so set a->dp */ + a->dp = tmp; + + /* zero excess digits */ + i = a->alloc; + a->alloc = size; + for (; i < a->alloc; i++) { + a->dp[i] = 0; + } + } + return MP_OKAY; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_grow.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_init.c b/dep/StormLib/src/libtommath/bn_mp_init.c new file mode 100644 index 00000000000..107d98be6e8 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_init.c @@ -0,0 +1,46 @@ +#include "tommath.h" +#ifdef BN_MP_INIT_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* init a new mp_int */ +int mp_init (mp_int * a) +{ + int i; + + /* allocate memory required and clear it */ + a->dp = OPT_CAST(mp_digit) XMALLOC (sizeof (mp_digit) * MP_PREC); + if (a->dp == NULL) { + return MP_MEM; + } + + /* set the digits to zero */ + for (i = 0; i < MP_PREC; i++) { + a->dp[i] = 0; + } + + /* set the used to zero, allocated digits to the default precision + * and sign to positive */ + a->used = 0; + a->alloc = MP_PREC; + a->sign = MP_ZPOS; + + return MP_OKAY; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_init.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_init_copy.c b/dep/StormLib/src/libtommath/bn_mp_init_copy.c new file mode 100644 index 00000000000..3ca1186ce1d --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_init_copy.c @@ -0,0 +1,32 @@ +#include "tommath.h" +#ifdef BN_MP_INIT_COPY_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* creates "a" then copies b into it */ +int mp_init_copy (mp_int * a, mp_int * b) +{ + int res; + + if ((res = mp_init (a)) != MP_OKAY) { + return res; + } + return mp_copy (b, a); +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_init_copy.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_init_multi.c b/dep/StormLib/src/libtommath/bn_mp_init_multi.c new file mode 100644 index 00000000000..4f6f367ffd5 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_init_multi.c @@ -0,0 +1,59 @@ +#include "tommath.h" +#ifdef BN_MP_INIT_MULTI_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#include + +int mp_init_multi(mp_int *mp, ...) +{ + mp_err res = MP_OKAY; /* Assume ok until proven otherwise */ + int n = 0; /* Number of ok inits */ + mp_int* cur_arg = mp; + va_list args; + + va_start(args, mp); /* init args to next argument from caller */ + while (cur_arg != NULL) { + if (mp_init(cur_arg) != MP_OKAY) { + /* Oops - error! Back-track and mp_clear what we already + succeeded in init-ing, then return error. + */ + va_list clean_args; + + /* end the current list */ + va_end(args); + + /* now start cleaning up */ + cur_arg = mp; + va_start(clean_args, mp); + while (n--) { + mp_clear(cur_arg); + cur_arg = va_arg(clean_args, mp_int*); + } + va_end(clean_args); + res = MP_MEM; + break; + } + n++; + cur_arg = va_arg(args, mp_int*); + } + va_end(args); + return res; /* Assumed ok, if error flagged above. */ +} + +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_init_multi.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_init_set.c b/dep/StormLib/src/libtommath/bn_mp_init_set.c new file mode 100644 index 00000000000..853323f3aaa --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_init_set.c @@ -0,0 +1,32 @@ +#include "tommath.h" +#ifdef BN_MP_INIT_SET_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* initialize and set a digit */ +int mp_init_set (mp_int * a, mp_digit b) +{ + int err; + if ((err = mp_init(a)) != MP_OKAY) { + return err; + } + mp_set(a, b); + return err; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_init_set.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_init_set_int.c b/dep/StormLib/src/libtommath/bn_mp_init_set_int.c new file mode 100644 index 00000000000..b2f8727e336 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_init_set_int.c @@ -0,0 +1,31 @@ +#include "tommath.h" +#ifdef BN_MP_INIT_SET_INT_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* initialize and set a digit */ +int mp_init_set_int (mp_int * a, unsigned long b) +{ + int err; + if ((err = mp_init(a)) != MP_OKAY) { + return err; + } + return mp_set_int(a, b); +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_init_set_int.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_init_size.c b/dep/StormLib/src/libtommath/bn_mp_init_size.c new file mode 100644 index 00000000000..17b8d9fceb0 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_init_size.c @@ -0,0 +1,48 @@ +#include "tommath.h" +#ifdef BN_MP_INIT_SIZE_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* init an mp_init for a given size */ +int mp_init_size (mp_int * a, int size) +{ + int x; + + /* pad size so there are always extra digits */ + size += (MP_PREC * 2) - (size % MP_PREC); + + /* alloc mem */ + a->dp = OPT_CAST(mp_digit) XMALLOC (sizeof (mp_digit) * size); + if (a->dp == NULL) { + return MP_MEM; + } + + /* set the members */ + a->used = 0; + a->alloc = size; + a->sign = MP_ZPOS; + + /* zero the digits */ + for (x = 0; x < size; x++) { + a->dp[x] = 0; + } + + return MP_OKAY; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_init_size.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_invmod.c b/dep/StormLib/src/libtommath/bn_mp_invmod.c new file mode 100644 index 00000000000..038e584a25c --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_invmod.c @@ -0,0 +1,43 @@ +#include "tommath.h" +#ifdef BN_MP_INVMOD_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* hac 14.61, pp608 */ +int mp_invmod (mp_int * a, mp_int * b, mp_int * c) +{ + /* b cannot be negative */ + if (b->sign == MP_NEG || mp_iszero(b) == 1) { + return MP_VAL; + } + +#ifdef BN_FAST_MP_INVMOD_C + /* if the modulus is odd we can use a faster routine instead */ + if (mp_isodd (b) == 1) { + return fast_mp_invmod (a, b, c); + } +#endif + +#ifdef BN_MP_INVMOD_SLOW_C + return mp_invmod_slow(a, b, c); +#endif + + return MP_VAL; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_invmod.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_invmod_slow.c b/dep/StormLib/src/libtommath/bn_mp_invmod_slow.c new file mode 100644 index 00000000000..3792a4c2333 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_invmod_slow.c @@ -0,0 +1,175 @@ +#include "tommath.h" +#ifdef BN_MP_INVMOD_SLOW_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* hac 14.61, pp608 */ +int mp_invmod_slow (mp_int * a, mp_int * b, mp_int * c) +{ + mp_int x, y, u, v, A, B, C, D; + int res; + + /* b cannot be negative */ + if (b->sign == MP_NEG || mp_iszero(b) == 1) { + return MP_VAL; + } + + /* init temps */ + if ((res = mp_init_multi(&x, &y, &u, &v, + &A, &B, &C, &D, NULL)) != MP_OKAY) { + return res; + } + + /* x = a, y = b */ + if ((res = mp_mod(a, b, &x)) != MP_OKAY) { + goto LBL_ERR; + } + if ((res = mp_copy (b, &y)) != MP_OKAY) { + goto LBL_ERR; + } + + /* 2. [modified] if x,y are both even then return an error! */ + if (mp_iseven (&x) == 1 && mp_iseven (&y) == 1) { + res = MP_VAL; + goto LBL_ERR; + } + + /* 3. u=x, v=y, A=1, B=0, C=0,D=1 */ + if ((res = mp_copy (&x, &u)) != MP_OKAY) { + goto LBL_ERR; + } + if ((res = mp_copy (&y, &v)) != MP_OKAY) { + goto LBL_ERR; + } + mp_set (&A, 1); + mp_set (&D, 1); + +top: + /* 4. while u is even do */ + while (mp_iseven (&u) == 1) { + /* 4.1 u = u/2 */ + if ((res = mp_div_2 (&u, &u)) != MP_OKAY) { + goto LBL_ERR; + } + /* 4.2 if A or B is odd then */ + if (mp_isodd (&A) == 1 || mp_isodd (&B) == 1) { + /* A = (A+y)/2, B = (B-x)/2 */ + if ((res = mp_add (&A, &y, &A)) != MP_OKAY) { + goto LBL_ERR; + } + if ((res = mp_sub (&B, &x, &B)) != MP_OKAY) { + goto LBL_ERR; + } + } + /* A = A/2, B = B/2 */ + if ((res = mp_div_2 (&A, &A)) != MP_OKAY) { + goto LBL_ERR; + } + if ((res = mp_div_2 (&B, &B)) != MP_OKAY) { + goto LBL_ERR; + } + } + + /* 5. while v is even do */ + while (mp_iseven (&v) == 1) { + /* 5.1 v = v/2 */ + if ((res = mp_div_2 (&v, &v)) != MP_OKAY) { + goto LBL_ERR; + } + /* 5.2 if C or D is odd then */ + if (mp_isodd (&C) == 1 || mp_isodd (&D) == 1) { + /* C = (C+y)/2, D = (D-x)/2 */ + if ((res = mp_add (&C, &y, &C)) != MP_OKAY) { + goto LBL_ERR; + } + if ((res = mp_sub (&D, &x, &D)) != MP_OKAY) { + goto LBL_ERR; + } + } + /* C = C/2, D = D/2 */ + if ((res = mp_div_2 (&C, &C)) != MP_OKAY) { + goto LBL_ERR; + } + if ((res = mp_div_2 (&D, &D)) != MP_OKAY) { + goto LBL_ERR; + } + } + + /* 6. if u >= v then */ + if (mp_cmp (&u, &v) != MP_LT) { + /* u = u - v, A = A - C, B = B - D */ + if ((res = mp_sub (&u, &v, &u)) != MP_OKAY) { + goto LBL_ERR; + } + + if ((res = mp_sub (&A, &C, &A)) != MP_OKAY) { + goto LBL_ERR; + } + + if ((res = mp_sub (&B, &D, &B)) != MP_OKAY) { + goto LBL_ERR; + } + } else { + /* v - v - u, C = C - A, D = D - B */ + if ((res = mp_sub (&v, &u, &v)) != MP_OKAY) { + goto LBL_ERR; + } + + if ((res = mp_sub (&C, &A, &C)) != MP_OKAY) { + goto LBL_ERR; + } + + if ((res = mp_sub (&D, &B, &D)) != MP_OKAY) { + goto LBL_ERR; + } + } + + /* if not zero goto step 4 */ + if (mp_iszero (&u) == 0) + goto top; + + /* now a = C, b = D, gcd == g*v */ + + /* if v != 1 then there is no inverse */ + if (mp_cmp_d (&v, 1) != MP_EQ) { + res = MP_VAL; + goto LBL_ERR; + } + + /* if its too low */ + while (mp_cmp_d(&C, 0) == MP_LT) { + if ((res = mp_add(&C, b, &C)) != MP_OKAY) { + goto LBL_ERR; + } + } + + /* too big */ + while (mp_cmp_mag(&C, b) != MP_LT) { + if ((res = mp_sub(&C, b, &C)) != MP_OKAY) { + goto LBL_ERR; + } + } + + /* C is now the inverse */ + mp_exch (&C, c); + res = MP_OKAY; +LBL_ERR:mp_clear_multi (&x, &y, &u, &v, &A, &B, &C, &D, NULL); + return res; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_invmod_slow.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_is_square.c b/dep/StormLib/src/libtommath/bn_mp_is_square.c new file mode 100644 index 00000000000..5d2fa072ce9 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_is_square.c @@ -0,0 +1,109 @@ +#include "tommath.h" +#ifdef BN_MP_IS_SQUARE_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* Check if remainders are possible squares - fast exclude non-squares */ +static const char rem_128[128] = { + 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, + 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, + 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, + 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, + 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, + 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, + 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, + 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1 +}; + +static const char rem_105[105] = { + 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, + 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, + 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, + 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, + 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, + 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, + 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1 +}; + +/* Store non-zero to ret if arg is square, and zero if not */ +int mp_is_square(mp_int *arg,int *ret) +{ + int res; + mp_digit c; + mp_int t; + unsigned long r; + + /* Default to Non-square :) */ + *ret = MP_NO; + + if (arg->sign == MP_NEG) { + return MP_VAL; + } + + /* digits used? (TSD) */ + if (arg->used == 0) { + return MP_OKAY; + } + + /* First check mod 128 (suppose that DIGIT_BIT is at least 7) */ + if (rem_128[127 & DIGIT(arg,0)] == 1) { + return MP_OKAY; + } + + /* Next check mod 105 (3*5*7) */ + if ((res = mp_mod_d(arg,105,&c)) != MP_OKAY) { + return res; + } + if (rem_105[c] == 1) { + return MP_OKAY; + } + + + if ((res = mp_init_set_int(&t,11L*13L*17L*19L*23L*29L*31L)) != MP_OKAY) { + return res; + } + if ((res = mp_mod(arg,&t,&t)) != MP_OKAY) { + goto ERR; + } + r = mp_get_int(&t); + /* Check for other prime modules, note it's not an ERROR but we must + * free "t" so the easiest way is to goto ERR. We know that res + * is already equal to MP_OKAY from the mp_mod call + */ + if ( (1L<<(r%11)) & 0x5C4L ) goto ERR; + if ( (1L<<(r%13)) & 0x9E4L ) goto ERR; + if ( (1L<<(r%17)) & 0x5CE8L ) goto ERR; + if ( (1L<<(r%19)) & 0x4F50CL ) goto ERR; + if ( (1L<<(r%23)) & 0x7ACCA0L ) goto ERR; + if ( (1L<<(r%29)) & 0xC2EDD0CL ) goto ERR; + if ( (1L<<(r%31)) & 0x6DE2B848L ) goto ERR; + + /* Final check - is sqr(sqrt(arg)) == arg ? */ + if ((res = mp_sqrt(arg,&t)) != MP_OKAY) { + goto ERR; + } + if ((res = mp_sqr(&t,&t)) != MP_OKAY) { + goto ERR; + } + + *ret = (mp_cmp_mag(&t,arg) == MP_EQ) ? MP_YES : MP_NO; +ERR:mp_clear(&t); + return res; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_is_square.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_jacobi.c b/dep/StormLib/src/libtommath/bn_mp_jacobi.c new file mode 100644 index 00000000000..c70b946f316 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_jacobi.c @@ -0,0 +1,105 @@ +#include "tommath.h" +#ifdef BN_MP_JACOBI_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* computes the jacobi c = (a | n) (or Legendre if n is prime) + * HAC pp. 73 Algorithm 2.149 + */ +int mp_jacobi (mp_int * a, mp_int * p, int *c) +{ + mp_int a1, p1; + int k, s, r, res; + mp_digit residue; + + /* if p <= 0 return MP_VAL */ + if (mp_cmp_d(p, 0) != MP_GT) { + return MP_VAL; + } + + /* step 1. if a == 0, return 0 */ + if (mp_iszero (a) == 1) { + *c = 0; + return MP_OKAY; + } + + /* step 2. if a == 1, return 1 */ + if (mp_cmp_d (a, 1) == MP_EQ) { + *c = 1; + return MP_OKAY; + } + + /* default */ + s = 0; + + /* step 3. write a = a1 * 2**k */ + if ((res = mp_init_copy (&a1, a)) != MP_OKAY) { + return res; + } + + if ((res = mp_init (&p1)) != MP_OKAY) { + goto LBL_A1; + } + + /* divide out larger power of two */ + k = mp_cnt_lsb(&a1); + if ((res = mp_div_2d(&a1, k, &a1, NULL)) != MP_OKAY) { + goto LBL_P1; + } + + /* step 4. if e is even set s=1 */ + if ((k & 1) == 0) { + s = 1; + } else { + /* else set s=1 if p = 1/7 (mod 8) or s=-1 if p = 3/5 (mod 8) */ + residue = p->dp[0] & 7; + + if (residue == 1 || residue == 7) { + s = 1; + } else if (residue == 3 || residue == 5) { + s = -1; + } + } + + /* step 5. if p == 3 (mod 4) *and* a1 == 3 (mod 4) then s = -s */ + if ( ((p->dp[0] & 3) == 3) && ((a1.dp[0] & 3) == 3)) { + s = -s; + } + + /* if a1 == 1 we're done */ + if (mp_cmp_d (&a1, 1) == MP_EQ) { + *c = s; + } else { + /* n1 = n mod a1 */ + if ((res = mp_mod (p, &a1, &p1)) != MP_OKAY) { + goto LBL_P1; + } + if ((res = mp_jacobi (&p1, &a1, &r)) != MP_OKAY) { + goto LBL_P1; + } + *c = s * r; + } + + /* done */ + res = MP_OKAY; +LBL_P1:mp_clear (&p1); +LBL_A1:mp_clear (&a1); + return res; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_jacobi.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_karatsuba_mul.c b/dep/StormLib/src/libtommath/bn_mp_karatsuba_mul.c new file mode 100644 index 00000000000..b15ec24966b --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_karatsuba_mul.c @@ -0,0 +1,167 @@ +#include "tommath.h" +#ifdef BN_MP_KARATSUBA_MUL_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* c = |a| * |b| using Karatsuba Multiplication using + * three half size multiplications + * + * Let B represent the radix [e.g. 2**DIGIT_BIT] and + * let n represent half of the number of digits in + * the min(a,b) + * + * a = a1 * B**n + a0 + * b = b1 * B**n + b0 + * + * Then, a * b => + a1b1 * B**2n + ((a1 + a0)(b1 + b0) - (a0b0 + a1b1)) * B + a0b0 + * + * Note that a1b1 and a0b0 are used twice and only need to be + * computed once. So in total three half size (half # of + * digit) multiplications are performed, a0b0, a1b1 and + * (a1+b1)(a0+b0) + * + * Note that a multiplication of half the digits requires + * 1/4th the number of single precision multiplications so in + * total after one call 25% of the single precision multiplications + * are saved. Note also that the call to mp_mul can end up back + * in this function if the a0, a1, b0, or b1 are above the threshold. + * This is known as divide-and-conquer and leads to the famous + * O(N**lg(3)) or O(N**1.584) work which is asymptopically lower than + * the standard O(N**2) that the baseline/comba methods use. + * Generally though the overhead of this method doesn't pay off + * until a certain size (N ~ 80) is reached. + */ +int mp_karatsuba_mul (mp_int * a, mp_int * b, mp_int * c) +{ + mp_int x0, x1, y0, y1, t1, x0y0, x1y1; + int B, err; + + /* default the return code to an error */ + err = MP_MEM; + + /* min # of digits */ + B = MIN (a->used, b->used); + + /* now divide in two */ + B = B >> 1; + + /* init copy all the temps */ + if (mp_init_size (&x0, B) != MP_OKAY) + goto ERR; + if (mp_init_size (&x1, a->used - B) != MP_OKAY) + goto X0; + if (mp_init_size (&y0, B) != MP_OKAY) + goto X1; + if (mp_init_size (&y1, b->used - B) != MP_OKAY) + goto Y0; + + /* init temps */ + if (mp_init_size (&t1, B * 2) != MP_OKAY) + goto Y1; + if (mp_init_size (&x0y0, B * 2) != MP_OKAY) + goto T1; + if (mp_init_size (&x1y1, B * 2) != MP_OKAY) + goto X0Y0; + + /* now shift the digits */ + x0.used = y0.used = B; + x1.used = a->used - B; + y1.used = b->used - B; + + { + register int x; + register mp_digit *tmpa, *tmpb, *tmpx, *tmpy; + + /* we copy the digits directly instead of using higher level functions + * since we also need to shift the digits + */ + tmpa = a->dp; + tmpb = b->dp; + + tmpx = x0.dp; + tmpy = y0.dp; + for (x = 0; x < B; x++) { + *tmpx++ = *tmpa++; + *tmpy++ = *tmpb++; + } + + tmpx = x1.dp; + for (x = B; x < a->used; x++) { + *tmpx++ = *tmpa++; + } + + tmpy = y1.dp; + for (x = B; x < b->used; x++) { + *tmpy++ = *tmpb++; + } + } + + /* only need to clamp the lower words since by definition the + * upper words x1/y1 must have a known number of digits + */ + mp_clamp (&x0); + mp_clamp (&y0); + + /* now calc the products x0y0 and x1y1 */ + /* after this x0 is no longer required, free temp [x0==t2]! */ + if (mp_mul (&x0, &y0, &x0y0) != MP_OKAY) + goto X1Y1; /* x0y0 = x0*y0 */ + if (mp_mul (&x1, &y1, &x1y1) != MP_OKAY) + goto X1Y1; /* x1y1 = x1*y1 */ + + /* now calc x1+x0 and y1+y0 */ + if (s_mp_add (&x1, &x0, &t1) != MP_OKAY) + goto X1Y1; /* t1 = x1 - x0 */ + if (s_mp_add (&y1, &y0, &x0) != MP_OKAY) + goto X1Y1; /* t2 = y1 - y0 */ + if (mp_mul (&t1, &x0, &t1) != MP_OKAY) + goto X1Y1; /* t1 = (x1 + x0) * (y1 + y0) */ + + /* add x0y0 */ + if (mp_add (&x0y0, &x1y1, &x0) != MP_OKAY) + goto X1Y1; /* t2 = x0y0 + x1y1 */ + if (s_mp_sub (&t1, &x0, &t1) != MP_OKAY) + goto X1Y1; /* t1 = (x1+x0)*(y1+y0) - (x1y1 + x0y0) */ + + /* shift by B */ + if (mp_lshd (&t1, B) != MP_OKAY) + goto X1Y1; /* t1 = (x0y0 + x1y1 - (x1-x0)*(y1-y0))<used; + + /* now divide in two */ + B = B >> 1; + + /* init copy all the temps */ + if (mp_init_size (&x0, B) != MP_OKAY) + goto ERR; + if (mp_init_size (&x1, a->used - B) != MP_OKAY) + goto X0; + + /* init temps */ + if (mp_init_size (&t1, a->used * 2) != MP_OKAY) + goto X1; + if (mp_init_size (&t2, a->used * 2) != MP_OKAY) + goto T1; + if (mp_init_size (&x0x0, B * 2) != MP_OKAY) + goto T2; + if (mp_init_size (&x1x1, (a->used - B) * 2) != MP_OKAY) + goto X0X0; + + { + register int x; + register mp_digit *dst, *src; + + src = a->dp; + + /* now shift the digits */ + dst = x0.dp; + for (x = 0; x < B; x++) { + *dst++ = *src++; + } + + dst = x1.dp; + for (x = B; x < a->used; x++) { + *dst++ = *src++; + } + } + + x0.used = B; + x1.used = a->used - B; + + mp_clamp (&x0); + + /* now calc the products x0*x0 and x1*x1 */ + if (mp_sqr (&x0, &x0x0) != MP_OKAY) + goto X1X1; /* x0x0 = x0*x0 */ + if (mp_sqr (&x1, &x1x1) != MP_OKAY) + goto X1X1; /* x1x1 = x1*x1 */ + + /* now calc (x1+x0)**2 */ + if (s_mp_add (&x1, &x0, &t1) != MP_OKAY) + goto X1X1; /* t1 = x1 - x0 */ + if (mp_sqr (&t1, &t1) != MP_OKAY) + goto X1X1; /* t1 = (x1 - x0) * (x1 - x0) */ + + /* add x0y0 */ + if (s_mp_add (&x0x0, &x1x1, &t2) != MP_OKAY) + goto X1X1; /* t2 = x0x0 + x1x1 */ + if (s_mp_sub (&t1, &t2, &t1) != MP_OKAY) + goto X1X1; /* t1 = (x1+x0)**2 - (x0x0 + x1x1) */ + + /* shift by B */ + if (mp_lshd (&t1, B) != MP_OKAY) + goto X1X1; /* t1 = (x0x0 + x1x1 - (x1-x0)*(x1-x0))<sign = MP_ZPOS; + +LBL_T: + mp_clear_multi (&t1, &t2, NULL); + return res; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_lcm.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_lshd.c b/dep/StormLib/src/libtommath/bn_mp_lshd.c new file mode 100644 index 00000000000..ffb0defd06b --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_lshd.c @@ -0,0 +1,67 @@ +#include "tommath.h" +#ifdef BN_MP_LSHD_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* shift left a certain amount of digits */ +int mp_lshd (mp_int * a, int b) +{ + int x, res; + + /* if its less than zero return */ + if (b <= 0) { + return MP_OKAY; + } + + /* grow to fit the new digits */ + if (a->alloc < a->used + b) { + if ((res = mp_grow (a, a->used + b)) != MP_OKAY) { + return res; + } + } + + { + register mp_digit *top, *bottom; + + /* increment the used by the shift amount then copy upwards */ + a->used += b; + + /* top */ + top = a->dp + a->used - 1; + + /* base */ + bottom = a->dp + a->used - 1 - b; + + /* much like mp_rshd this is implemented using a sliding window + * except the window goes the otherway around. Copying from + * the bottom to the top. see bn_mp_rshd.c for more info. + */ + for (x = a->used - 1; x >= b; x--) { + *top-- = *bottom--; + } + + /* zero the lower digits */ + top = a->dp; + for (x = 0; x < b; x++) { + *top++ = 0; + } + } + return MP_OKAY; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_lshd.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_mod.c b/dep/StormLib/src/libtommath/bn_mp_mod.c new file mode 100644 index 00000000000..b24c71f9d95 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_mod.c @@ -0,0 +1,48 @@ +#include "tommath.h" +#ifdef BN_MP_MOD_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* c = a mod b, 0 <= c < b */ +int +mp_mod (mp_int * a, mp_int * b, mp_int * c) +{ + mp_int t; + int res; + + if ((res = mp_init (&t)) != MP_OKAY) { + return res; + } + + if ((res = mp_div (a, b, NULL, &t)) != MP_OKAY) { + mp_clear (&t); + return res; + } + + if (t.sign != b->sign) { + res = mp_add (b, &t, c); + } else { + res = MP_OKAY; + mp_exch (&t, c); + } + + mp_clear (&t); + return res; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_mod.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_mod_2d.c b/dep/StormLib/src/libtommath/bn_mp_mod_2d.c new file mode 100644 index 00000000000..a54a0242644 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_mod_2d.c @@ -0,0 +1,55 @@ +#include "tommath.h" +#ifdef BN_MP_MOD_2D_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* calc a value mod 2**b */ +int +mp_mod_2d (mp_int * a, int b, mp_int * c) +{ + int x, res; + + /* if b is <= 0 then zero the int */ + if (b <= 0) { + mp_zero (c); + return MP_OKAY; + } + + /* if the modulus is larger than the value than return */ + if (b >= (int) (a->used * DIGIT_BIT)) { + res = mp_copy (a, c); + return res; + } + + /* copy */ + if ((res = mp_copy (a, c)) != MP_OKAY) { + return res; + } + + /* zero digits above the last digit of the modulus */ + for (x = (b / DIGIT_BIT) + ((b % DIGIT_BIT) == 0 ? 0 : 1); x < c->used; x++) { + c->dp[x] = 0; + } + /* clear the digit that is not completely outside/inside the modulus */ + c->dp[b / DIGIT_BIT] &= + (mp_digit) ((((mp_digit) 1) << (((mp_digit) b) % DIGIT_BIT)) - ((mp_digit) 1)); + mp_clamp (c); + return MP_OKAY; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_mod_2d.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_mod_d.c b/dep/StormLib/src/libtommath/bn_mp_mod_d.c new file mode 100644 index 00000000000..59886e7734a --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_mod_d.c @@ -0,0 +1,27 @@ +#include "tommath.h" +#ifdef BN_MP_MOD_D_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +int +mp_mod_d (mp_int * a, mp_digit b, mp_digit * c) +{ + return mp_div_d(a, b, NULL, c); +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_mod_d.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_montgomery_calc_normalization.c b/dep/StormLib/src/libtommath/bn_mp_montgomery_calc_normalization.c new file mode 100644 index 00000000000..fdefcbd99d2 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_montgomery_calc_normalization.c @@ -0,0 +1,59 @@ +#include "tommath.h" +#ifdef BN_MP_MONTGOMERY_CALC_NORMALIZATION_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* + * shifts with subtractions when the result is greater than b. + * + * The method is slightly modified to shift B unconditionally upto just under + * the leading bit of b. This saves alot of multiple precision shifting. + */ +int mp_montgomery_calc_normalization (mp_int * a, mp_int * b) +{ + int x, bits, res; + + /* how many bits of last digit does b use */ + bits = mp_count_bits (b) % DIGIT_BIT; + + if (b->used > 1) { + if ((res = mp_2expt (a, (b->used - 1) * DIGIT_BIT + bits - 1)) != MP_OKAY) { + return res; + } + } else { + mp_set(a, 1); + bits = 1; + } + + + /* now compute C = A * B mod b */ + for (x = bits - 1; x < (int)DIGIT_BIT; x++) { + if ((res = mp_mul_2 (a, a)) != MP_OKAY) { + return res; + } + if (mp_cmp_mag (a, b) != MP_LT) { + if ((res = s_mp_sub (a, b, a)) != MP_OKAY) { + return res; + } + } + } + + return MP_OKAY; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_montgomery_calc_normalization.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_montgomery_reduce.c b/dep/StormLib/src/libtommath/bn_mp_montgomery_reduce.c new file mode 100644 index 00000000000..173848e0ac8 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_montgomery_reduce.c @@ -0,0 +1,118 @@ +#include "tommath.h" +#ifdef BN_MP_MONTGOMERY_REDUCE_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* computes xR**-1 == x (mod N) via Montgomery Reduction */ +int +mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho) +{ + int ix, res, digs; + mp_digit mu; + + /* can the fast reduction [comba] method be used? + * + * Note that unlike in mul you're safely allowed *less* + * than the available columns [255 per default] since carries + * are fixed up in the inner loop. + */ + digs = n->used * 2 + 1; + if ((digs < MP_WARRAY) && + n->used < + (1 << ((CHAR_BIT * sizeof (mp_word)) - (2 * DIGIT_BIT)))) { + return fast_mp_montgomery_reduce (x, n, rho); + } + + /* grow the input as required */ + if (x->alloc < digs) { + if ((res = mp_grow (x, digs)) != MP_OKAY) { + return res; + } + } + x->used = digs; + + for (ix = 0; ix < n->used; ix++) { + /* mu = ai * rho mod b + * + * The value of rho must be precalculated via + * montgomery_setup() such that + * it equals -1/n0 mod b this allows the + * following inner loop to reduce the + * input one digit at a time + */ + mu = (mp_digit) (((mp_word)x->dp[ix]) * ((mp_word)rho) & MP_MASK); + + /* a = a + mu * m * b**i */ + { + register int iy; + register mp_digit *tmpn, *tmpx, u; + register mp_word r; + + /* alias for digits of the modulus */ + tmpn = n->dp; + + /* alias for the digits of x [the input] */ + tmpx = x->dp + ix; + + /* set the carry to zero */ + u = 0; + + /* Multiply and add in place */ + for (iy = 0; iy < n->used; iy++) { + /* compute product and sum */ + r = ((mp_word)mu) * ((mp_word)*tmpn++) + + ((mp_word) u) + ((mp_word) * tmpx); + + /* get carry */ + u = (mp_digit)(r >> ((mp_word) DIGIT_BIT)); + + /* fix digit */ + *tmpx++ = (mp_digit)(r & ((mp_word) MP_MASK)); + } + /* At this point the ix'th digit of x should be zero */ + + + /* propagate carries upwards as required*/ + while (u) { + *tmpx += u; + u = *tmpx >> DIGIT_BIT; + *tmpx++ &= MP_MASK; + } + } + } + + /* at this point the n.used'th least + * significant digits of x are all zero + * which means we can shift x to the + * right by n.used digits and the + * residue is unchanged. + */ + + /* x = x/b**n.used */ + mp_clamp(x); + mp_rshd (x, n->used); + + /* if x >= n then x = x - n */ + if (mp_cmp_mag (x, n) != MP_LT) { + return s_mp_sub (x, n, x); + } + + return MP_OKAY; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_montgomery_reduce.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_montgomery_setup.c b/dep/StormLib/src/libtommath/bn_mp_montgomery_setup.c new file mode 100644 index 00000000000..6f277320eb7 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_montgomery_setup.c @@ -0,0 +1,59 @@ +#include "tommath.h" +#ifdef BN_MP_MONTGOMERY_SETUP_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* setups the montgomery reduction stuff */ +int +mp_montgomery_setup (mp_int * n, mp_digit * rho) +{ + mp_digit x, b; + +/* fast inversion mod 2**k + * + * Based on the fact that + * + * XA = 1 (mod 2**n) => (X(2-XA)) A = 1 (mod 2**2n) + * => 2*X*A - X*X*A*A = 1 + * => 2*(1) - (1) = 1 + */ + b = n->dp[0]; + + if ((b & 1) == 0) { + return MP_VAL; + } + + x = (((b + 2) & 4) << 1) + b; /* here x*a==1 mod 2**4 */ + x *= 2 - b * x; /* here x*a==1 mod 2**8 */ +#if !defined(MP_8BIT) + x *= 2 - b * x; /* here x*a==1 mod 2**16 */ +#endif +#if defined(MP_64BIT) || !(defined(MP_8BIT) || defined(MP_16BIT)) + x *= 2 - b * x; /* here x*a==1 mod 2**32 */ +#endif +#ifdef MP_64BIT + x *= 2 - b * x; /* here x*a==1 mod 2**64 */ +#endif + + /* rho = -1/m mod b */ + *rho = (unsigned long)(((mp_word)1 << ((mp_word) DIGIT_BIT)) - x) & MP_MASK; + + return MP_OKAY; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_montgomery_setup.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_mul.c b/dep/StormLib/src/libtommath/bn_mp_mul.c new file mode 100644 index 00000000000..a1315dac30c --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_mul.c @@ -0,0 +1,66 @@ +#include "tommath.h" +#ifdef BN_MP_MUL_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* high level multiplication (handles sign) */ +int mp_mul (mp_int * a, mp_int * b, mp_int * c) +{ + int res, neg; + neg = (a->sign == b->sign) ? MP_ZPOS : MP_NEG; + + /* use Toom-Cook? */ +#ifdef BN_MP_TOOM_MUL_C + if (MIN (a->used, b->used) >= TOOM_MUL_CUTOFF) { + res = mp_toom_mul(a, b, c); + } else +#endif +#ifdef BN_MP_KARATSUBA_MUL_C + /* use Karatsuba? */ + if (MIN (a->used, b->used) >= KARATSUBA_MUL_CUTOFF) { + res = mp_karatsuba_mul (a, b, c); + } else +#endif + { + /* can we use the fast multiplier? + * + * The fast multiplier can be used if the output will + * have less than MP_WARRAY digits and the number of + * digits won't affect carry propagation + */ + int digs = a->used + b->used + 1; + +#ifdef BN_FAST_S_MP_MUL_DIGS_C + if ((digs < MP_WARRAY) && + MIN(a->used, b->used) <= + (1 << ((CHAR_BIT * sizeof (mp_word)) - (2 * DIGIT_BIT)))) { + res = fast_s_mp_mul_digs (a, b, c, digs); + } else +#endif +#ifdef BN_S_MP_MUL_DIGS_C + res = s_mp_mul (a, b, c); /* uses s_mp_mul_digs */ +#else + res = MP_VAL; +#endif + + } + c->sign = (c->used > 0) ? neg : MP_ZPOS; + return res; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_mul.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_mul_2.c b/dep/StormLib/src/libtommath/bn_mp_mul_2.c new file mode 100644 index 00000000000..3315744f1ec --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_mul_2.c @@ -0,0 +1,82 @@ +#include "tommath.h" +#ifdef BN_MP_MUL_2_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* b = a*2 */ +int mp_mul_2(mp_int * a, mp_int * b) +{ + int x, res, oldused; + + /* grow to accomodate result */ + if (b->alloc < a->used + 1) { + if ((res = mp_grow (b, a->used + 1)) != MP_OKAY) { + return res; + } + } + + oldused = b->used; + b->used = a->used; + + { + register mp_digit r, rr, *tmpa, *tmpb; + + /* alias for source */ + tmpa = a->dp; + + /* alias for dest */ + tmpb = b->dp; + + /* carry */ + r = 0; + for (x = 0; x < a->used; x++) { + + /* get what will be the *next* carry bit from the + * MSB of the current digit + */ + rr = *tmpa >> ((mp_digit)(DIGIT_BIT - 1)); + + /* now shift up this digit, add in the carry [from the previous] */ + *tmpb++ = ((*tmpa++ << ((mp_digit)1)) | r) & MP_MASK; + + /* copy the carry that would be from the source + * digit into the next iteration + */ + r = rr; + } + + /* new leading digit? */ + if (r != 0) { + /* add a MSB which is always 1 at this point */ + *tmpb = 1; + ++(b->used); + } + + /* now zero any excess digits on the destination + * that we didn't write to + */ + tmpb = b->dp + b->used; + for (x = b->used; x < oldused; x++) { + *tmpb++ = 0; + } + } + b->sign = a->sign; + return MP_OKAY; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_mul_2.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_mul_2d.c b/dep/StormLib/src/libtommath/bn_mp_mul_2d.c new file mode 100644 index 00000000000..c636c179884 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_mul_2d.c @@ -0,0 +1,85 @@ +#include "tommath.h" +#ifdef BN_MP_MUL_2D_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* shift left by a certain bit count */ +int mp_mul_2d (mp_int * a, int b, mp_int * c) +{ + mp_digit d; + int res; + + /* copy */ + if (a != c) { + if ((res = mp_copy (a, c)) != MP_OKAY) { + return res; + } + } + + if (c->alloc < (int)(c->used + b/DIGIT_BIT + 1)) { + if ((res = mp_grow (c, c->used + b / DIGIT_BIT + 1)) != MP_OKAY) { + return res; + } + } + + /* shift by as many digits in the bit count */ + if (b >= (int)DIGIT_BIT) { + if ((res = mp_lshd (c, b / DIGIT_BIT)) != MP_OKAY) { + return res; + } + } + + /* shift any bit count < DIGIT_BIT */ + d = (mp_digit) (b % DIGIT_BIT); + if (d != 0) { + register mp_digit *tmpc, shift, mask, r, rr; + register int x; + + /* bitmask for carries */ + mask = (((mp_digit)1) << d) - 1; + + /* shift for msbs */ + shift = DIGIT_BIT - d; + + /* alias */ + tmpc = c->dp; + + /* carry */ + r = 0; + for (x = 0; x < c->used; x++) { + /* get the higher bits of the current word */ + rr = (*tmpc >> shift) & mask; + + /* shift the current word and OR in the carry */ + *tmpc = ((*tmpc << d) | r) & MP_MASK; + ++tmpc; + + /* set the carry to the carry bits of the current word */ + r = rr; + } + + /* set final carry */ + if (r != 0) { + c->dp[(c->used)++] = r; + } + } + mp_clamp (c); + return MP_OKAY; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_mul_2d.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_mul_d.c b/dep/StormLib/src/libtommath/bn_mp_mul_d.c new file mode 100644 index 00000000000..a36a76bbacf --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_mul_d.c @@ -0,0 +1,79 @@ +#include "tommath.h" +#ifdef BN_MP_MUL_D_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* multiply by a digit */ +int +mp_mul_d (mp_int * a, mp_digit b, mp_int * c) +{ + mp_digit u, *tmpa, *tmpc; + mp_word r; + int ix, res, olduse; + + /* make sure c is big enough to hold a*b */ + if (c->alloc < a->used + 1) { + if ((res = mp_grow (c, a->used + 1)) != MP_OKAY) { + return res; + } + } + + /* get the original destinations used count */ + olduse = c->used; + + /* set the sign */ + c->sign = a->sign; + + /* alias for a->dp [source] */ + tmpa = a->dp; + + /* alias for c->dp [dest] */ + tmpc = c->dp; + + /* zero carry */ + u = 0; + + /* compute columns */ + for (ix = 0; ix < a->used; ix++) { + /* compute product and carry sum for this term */ + r = ((mp_word) u) + ((mp_word)*tmpa++) * ((mp_word)b); + + /* mask off higher bits to get a single digit */ + *tmpc++ = (mp_digit) (r & ((mp_word) MP_MASK)); + + /* send carry into next iteration */ + u = (mp_digit) (r >> ((mp_word) DIGIT_BIT)); + } + + /* store final carry [if any] and increment ix offset */ + *tmpc++ = u; + ++ix; + + /* now zero digits above the top */ + while (ix++ < olduse) { + *tmpc++ = 0; + } + + /* set used count */ + c->used = a->used + 1; + mp_clamp(c); + + return MP_OKAY; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_mul_d.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_mulmod.c b/dep/StormLib/src/libtommath/bn_mp_mulmod.c new file mode 100644 index 00000000000..8ec98bbddb2 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_mulmod.c @@ -0,0 +1,40 @@ +#include "tommath.h" +#ifdef BN_MP_MULMOD_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* d = a * b (mod c) */ +int mp_mulmod (mp_int * a, mp_int * b, mp_int * c, mp_int * d) +{ + int res; + mp_int t; + + if ((res = mp_init (&t)) != MP_OKAY) { + return res; + } + + if ((res = mp_mul (a, b, &t)) != MP_OKAY) { + mp_clear (&t); + return res; + } + res = mp_mod (&t, c, d); + mp_clear (&t); + return res; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_mulmod.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_n_root.c b/dep/StormLib/src/libtommath/bn_mp_n_root.c new file mode 100644 index 00000000000..f188f5255b3 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_n_root.c @@ -0,0 +1,132 @@ +#include "tommath.h" +#ifdef BN_MP_N_ROOT_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* find the n'th root of an integer + * + * Result found such that (c)**b <= a and (c+1)**b > a + * + * This algorithm uses Newton's approximation + * x[i+1] = x[i] - f(x[i])/f'(x[i]) + * which will find the root in log(N) time where + * each step involves a fair bit. This is not meant to + * find huge roots [square and cube, etc]. + */ +int mp_n_root (mp_int * a, mp_digit b, mp_int * c) +{ + mp_int t1, t2, t3; + int res, neg; + + /* input must be positive if b is even */ + if ((b & 1) == 0 && a->sign == MP_NEG) { + return MP_VAL; + } + + if ((res = mp_init (&t1)) != MP_OKAY) { + return res; + } + + if ((res = mp_init (&t2)) != MP_OKAY) { + goto LBL_T1; + } + + if ((res = mp_init (&t3)) != MP_OKAY) { + goto LBL_T2; + } + + /* if a is negative fudge the sign but keep track */ + neg = a->sign; + a->sign = MP_ZPOS; + + /* t2 = 2 */ + mp_set (&t2, 2); + + do { + /* t1 = t2 */ + if ((res = mp_copy (&t2, &t1)) != MP_OKAY) { + goto LBL_T3; + } + + /* t2 = t1 - ((t1**b - a) / (b * t1**(b-1))) */ + + /* t3 = t1**(b-1) */ + if ((res = mp_expt_d (&t1, b - 1, &t3)) != MP_OKAY) { + goto LBL_T3; + } + + /* numerator */ + /* t2 = t1**b */ + if ((res = mp_mul (&t3, &t1, &t2)) != MP_OKAY) { + goto LBL_T3; + } + + /* t2 = t1**b - a */ + if ((res = mp_sub (&t2, a, &t2)) != MP_OKAY) { + goto LBL_T3; + } + + /* denominator */ + /* t3 = t1**(b-1) * b */ + if ((res = mp_mul_d (&t3, b, &t3)) != MP_OKAY) { + goto LBL_T3; + } + + /* t3 = (t1**b - a)/(b * t1**(b-1)) */ + if ((res = mp_div (&t2, &t3, &t3, NULL)) != MP_OKAY) { + goto LBL_T3; + } + + if ((res = mp_sub (&t1, &t3, &t2)) != MP_OKAY) { + goto LBL_T3; + } + } while (mp_cmp (&t1, &t2) != MP_EQ); + + /* result can be off by a few so check */ + for (;;) { + if ((res = mp_expt_d (&t1, b, &t2)) != MP_OKAY) { + goto LBL_T3; + } + + if (mp_cmp (&t2, a) == MP_GT) { + if ((res = mp_sub_d (&t1, 1, &t1)) != MP_OKAY) { + goto LBL_T3; + } + } else { + break; + } + } + + /* reset the sign of a first */ + a->sign = neg; + + /* set the result */ + mp_exch (&t1, c); + + /* set the sign of the result */ + c->sign = neg; + + res = MP_OKAY; + +LBL_T3:mp_clear (&t3); +LBL_T2:mp_clear (&t2); +LBL_T1:mp_clear (&t1); + return res; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_n_root.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_neg.c b/dep/StormLib/src/libtommath/bn_mp_neg.c new file mode 100644 index 00000000000..87a8b500449 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_neg.c @@ -0,0 +1,40 @@ +#include "tommath.h" +#ifdef BN_MP_NEG_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* b = -a */ +int mp_neg (mp_int * a, mp_int * b) +{ + int res; + if (a != b) { + if ((res = mp_copy (a, b)) != MP_OKAY) { + return res; + } + } + + if (mp_iszero(b) != MP_YES) { + b->sign = (a->sign == MP_ZPOS) ? MP_NEG : MP_ZPOS; + } else { + b->sign = MP_ZPOS; + } + + return MP_OKAY; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_neg.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_or.c b/dep/StormLib/src/libtommath/bn_mp_or.c new file mode 100644 index 00000000000..12601eaf78e --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_or.c @@ -0,0 +1,50 @@ +#include "tommath.h" +#ifdef BN_MP_OR_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* OR two ints together */ +int mp_or (mp_int * a, mp_int * b, mp_int * c) +{ + int res, ix, px; + mp_int t, *x; + + if (a->used > b->used) { + if ((res = mp_init_copy (&t, a)) != MP_OKAY) { + return res; + } + px = b->used; + x = b; + } else { + if ((res = mp_init_copy (&t, b)) != MP_OKAY) { + return res; + } + px = a->used; + x = a; + } + + for (ix = 0; ix < px; ix++) { + t.dp[ix] |= x->dp[ix]; + } + mp_clamp (&t); + mp_exch (c, &t); + mp_clear (&t); + return MP_OKAY; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_or.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_prime_fermat.c b/dep/StormLib/src/libtommath/bn_mp_prime_fermat.c new file mode 100644 index 00000000000..297e13c7960 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_prime_fermat.c @@ -0,0 +1,62 @@ +#include "tommath.h" +#ifdef BN_MP_PRIME_FERMAT_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* performs one Fermat test. + * + * If "a" were prime then b**a == b (mod a) since the order of + * the multiplicative sub-group would be phi(a) = a-1. That means + * it would be the same as b**(a mod (a-1)) == b**1 == b (mod a). + * + * Sets result to 1 if the congruence holds, or zero otherwise. + */ +int mp_prime_fermat (mp_int * a, mp_int * b, int *result) +{ + mp_int t; + int err; + + /* default to composite */ + *result = MP_NO; + + /* ensure b > 1 */ + if (mp_cmp_d(b, 1) != MP_GT) { + return MP_VAL; + } + + /* init t */ + if ((err = mp_init (&t)) != MP_OKAY) { + return err; + } + + /* compute t = b**a mod a */ + if ((err = mp_exptmod (b, a, a, &t)) != MP_OKAY) { + goto LBL_T; + } + + /* is it equal to b? */ + if (mp_cmp (&t, b) == MP_EQ) { + *result = MP_YES; + } + + err = MP_OKAY; +LBL_T:mp_clear (&t); + return err; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_prime_fermat.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_prime_is_divisible.c b/dep/StormLib/src/libtommath/bn_mp_prime_is_divisible.c new file mode 100644 index 00000000000..0ae64983512 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_prime_is_divisible.c @@ -0,0 +1,50 @@ +#include "tommath.h" +#ifdef BN_MP_PRIME_IS_DIVISIBLE_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* determines if an integers is divisible by one + * of the first PRIME_SIZE primes or not + * + * sets result to 0 if not, 1 if yes + */ +int mp_prime_is_divisible (mp_int * a, int *result) +{ + int err, ix; + mp_digit res; + + /* default to not */ + *result = MP_NO; + + for (ix = 0; ix < PRIME_SIZE; ix++) { + /* what is a mod LBL_prime_tab[ix] */ + if ((err = mp_mod_d (a, ltm_prime_tab[ix], &res)) != MP_OKAY) { + return err; + } + + /* is the residue zero? */ + if (res == 0) { + *result = MP_YES; + return MP_OKAY; + } + } + + return MP_OKAY; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_prime_is_divisible.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_prime_is_prime.c b/dep/StormLib/src/libtommath/bn_mp_prime_is_prime.c new file mode 100644 index 00000000000..0e1e94bad5b --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_prime_is_prime.c @@ -0,0 +1,83 @@ +#include "tommath.h" +#ifdef BN_MP_PRIME_IS_PRIME_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* performs a variable number of rounds of Miller-Rabin + * + * Probability of error after t rounds is no more than + + * + * Sets result to 1 if probably prime, 0 otherwise + */ +int mp_prime_is_prime (mp_int * a, int t, int *result) +{ + mp_int b; + int ix, err, res; + + /* default to no */ + *result = MP_NO; + + /* valid value of t? */ + if (t <= 0 || t > PRIME_SIZE) { + return MP_VAL; + } + + /* is the input equal to one of the primes in the table? */ + for (ix = 0; ix < PRIME_SIZE; ix++) { + if (mp_cmp_d(a, ltm_prime_tab[ix]) == MP_EQ) { + *result = 1; + return MP_OKAY; + } + } + + /* first perform trial division */ + if ((err = mp_prime_is_divisible (a, &res)) != MP_OKAY) { + return err; + } + + /* return if it was trivially divisible */ + if (res == MP_YES) { + return MP_OKAY; + } + + /* now perform the miller-rabin rounds */ + if ((err = mp_init (&b)) != MP_OKAY) { + return err; + } + + for (ix = 0; ix < t; ix++) { + /* set the prime */ + mp_set (&b, ltm_prime_tab[ix]); + + if ((err = mp_prime_miller_rabin (a, &b, &res)) != MP_OKAY) { + goto LBL_B; + } + + if (res == MP_NO) { + goto LBL_B; + } + } + + /* passed the test */ + *result = MP_YES; +LBL_B:mp_clear (&b); + return err; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_prime_is_prime.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_prime_miller_rabin.c b/dep/StormLib/src/libtommath/bn_mp_prime_miller_rabin.c new file mode 100644 index 00000000000..47385bc815c --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_prime_miller_rabin.c @@ -0,0 +1,103 @@ +#include "tommath.h" +#ifdef BN_MP_PRIME_MILLER_RABIN_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* Miller-Rabin test of "a" to the base of "b" as described in + * HAC pp. 139 Algorithm 4.24 + * + * Sets result to 0 if definitely composite or 1 if probably prime. + * Randomly the chance of error is no more than 1/4 and often + * very much lower. + */ +int mp_prime_miller_rabin (mp_int * a, mp_int * b, int *result) +{ + mp_int n1, y, r; + int s, j, err; + + /* default */ + *result = MP_NO; + + /* ensure b > 1 */ + if (mp_cmp_d(b, 1) != MP_GT) { + return MP_VAL; + } + + /* get n1 = a - 1 */ + if ((err = mp_init_copy (&n1, a)) != MP_OKAY) { + return err; + } + if ((err = mp_sub_d (&n1, 1, &n1)) != MP_OKAY) { + goto LBL_N1; + } + + /* set 2**s * r = n1 */ + if ((err = mp_init_copy (&r, &n1)) != MP_OKAY) { + goto LBL_N1; + } + + /* count the number of least significant bits + * which are zero + */ + s = mp_cnt_lsb(&r); + + /* now divide n - 1 by 2**s */ + if ((err = mp_div_2d (&r, s, &r, NULL)) != MP_OKAY) { + goto LBL_R; + } + + /* compute y = b**r mod a */ + if ((err = mp_init (&y)) != MP_OKAY) { + goto LBL_R; + } + if ((err = mp_exptmod (b, &r, a, &y)) != MP_OKAY) { + goto LBL_Y; + } + + /* if y != 1 and y != n1 do */ + if (mp_cmp_d (&y, 1) != MP_EQ && mp_cmp (&y, &n1) != MP_EQ) { + j = 1; + /* while j <= s-1 and y != n1 */ + while ((j <= (s - 1)) && mp_cmp (&y, &n1) != MP_EQ) { + if ((err = mp_sqrmod (&y, a, &y)) != MP_OKAY) { + goto LBL_Y; + } + + /* if y == 1 then composite */ + if (mp_cmp_d (&y, 1) == MP_EQ) { + goto LBL_Y; + } + + ++j; + } + + /* if y != n1 then composite */ + if (mp_cmp (&y, &n1) != MP_EQ) { + goto LBL_Y; + } + } + + /* probably prime now */ + *result = MP_YES; +LBL_Y:mp_clear (&y); +LBL_R:mp_clear (&r); +LBL_N1:mp_clear (&n1); + return err; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_prime_miller_rabin.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_prime_next_prime.c b/dep/StormLib/src/libtommath/bn_mp_prime_next_prime.c new file mode 100644 index 00000000000..833992bac48 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_prime_next_prime.c @@ -0,0 +1,170 @@ +#include "tommath.h" +#ifdef BN_MP_PRIME_NEXT_PRIME_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* finds the next prime after the number "a" using "t" trials + * of Miller-Rabin. + * + * bbs_style = 1 means the prime must be congruent to 3 mod 4 + */ +int mp_prime_next_prime(mp_int *a, int t, int bbs_style) +{ + int err, res, x, y; + mp_digit res_tab[PRIME_SIZE], step, kstep; + mp_int b; + + /* ensure t is valid */ + if (t <= 0 || t > PRIME_SIZE) { + return MP_VAL; + } + + /* force positive */ + a->sign = MP_ZPOS; + + /* simple algo if a is less than the largest prime in the table */ + if (mp_cmp_d(a, ltm_prime_tab[PRIME_SIZE-1]) == MP_LT) { + /* find which prime it is bigger than */ + for (x = PRIME_SIZE - 2; x >= 0; x--) { + if (mp_cmp_d(a, ltm_prime_tab[x]) != MP_LT) { + if (bbs_style == 1) { + /* ok we found a prime smaller or + * equal [so the next is larger] + * + * however, the prime must be + * congruent to 3 mod 4 + */ + if ((ltm_prime_tab[x + 1] & 3) != 3) { + /* scan upwards for a prime congruent to 3 mod 4 */ + for (y = x + 1; y < PRIME_SIZE; y++) { + if ((ltm_prime_tab[y] & 3) == 3) { + mp_set(a, ltm_prime_tab[y]); + return MP_OKAY; + } + } + } + } else { + mp_set(a, ltm_prime_tab[x + 1]); + return MP_OKAY; + } + } + } + /* at this point a maybe 1 */ + if (mp_cmp_d(a, 1) == MP_EQ) { + mp_set(a, 2); + return MP_OKAY; + } + /* fall through to the sieve */ + } + + /* generate a prime congruent to 3 mod 4 or 1/3 mod 4? */ + if (bbs_style == 1) { + kstep = 4; + } else { + kstep = 2; + } + + /* at this point we will use a combination of a sieve and Miller-Rabin */ + + if (bbs_style == 1) { + /* if a mod 4 != 3 subtract the correct value to make it so */ + if ((a->dp[0] & 3) != 3) { + if ((err = mp_sub_d(a, (a->dp[0] & 3) + 1, a)) != MP_OKAY) { return err; }; + } + } else { + if (mp_iseven(a) == 1) { + /* force odd */ + if ((err = mp_sub_d(a, 1, a)) != MP_OKAY) { + return err; + } + } + } + + /* generate the restable */ + for (x = 1; x < PRIME_SIZE; x++) { + if ((err = mp_mod_d(a, ltm_prime_tab[x], res_tab + x)) != MP_OKAY) { + return err; + } + } + + /* init temp used for Miller-Rabin Testing */ + if ((err = mp_init(&b)) != MP_OKAY) { + return err; + } + + for (;;) { + /* skip to the next non-trivially divisible candidate */ + step = 0; + do { + /* y == 1 if any residue was zero [e.g. cannot be prime] */ + y = 0; + + /* increase step to next candidate */ + step += kstep; + + /* compute the new residue without using division */ + for (x = 1; x < PRIME_SIZE; x++) { + /* add the step to each residue */ + res_tab[x] += kstep; + + /* subtract the modulus [instead of using division] */ + if (res_tab[x] >= ltm_prime_tab[x]) { + res_tab[x] -= ltm_prime_tab[x]; + } + + /* set flag if zero */ + if (res_tab[x] == 0) { + y = 1; + } + } + } while (y == 1 && step < ((((mp_digit)1)<= ((((mp_digit)1)< size) { + return (x == 0) ? sizes[0].t : sizes[x - 1].t; + } + } + return sizes[x-1].t + 1; +} + + +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_prime_rabin_miller_trials.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_prime_random_ex.c b/dep/StormLib/src/libtommath/bn_mp_prime_random_ex.c new file mode 100644 index 00000000000..4eec3f69e3e --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_prime_random_ex.c @@ -0,0 +1,125 @@ +#include "tommath.h" +#ifdef BN_MP_PRIME_RANDOM_EX_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* makes a truly random prime of a given size (bits), + * + * Flags are as follows: + * + * LTM_PRIME_BBS - make prime congruent to 3 mod 4 + * LTM_PRIME_SAFE - make sure (p-1)/2 is prime as well (implies LTM_PRIME_BBS) + * LTM_PRIME_2MSB_OFF - make the 2nd highest bit zero + * LTM_PRIME_2MSB_ON - make the 2nd highest bit one + * + * You have to supply a callback which fills in a buffer with random bytes. "dat" is a parameter you can + * have passed to the callback (e.g. a state or something). This function doesn't use "dat" itself + * so it can be NULL + * + */ + +/* This is possibly the mother of all prime generation functions, muahahahahaha! */ +int mp_prime_random_ex(mp_int *a, int t, int size, int flags, ltm_prime_callback cb, void *dat) +{ + unsigned char *tmp, maskAND, maskOR_msb, maskOR_lsb; + int res, err, bsize, maskOR_msb_offset; + + /* sanity check the input */ + if (size <= 1 || t <= 0) { + return MP_VAL; + } + + /* LTM_PRIME_SAFE implies LTM_PRIME_BBS */ + if (flags & LTM_PRIME_SAFE) { + flags |= LTM_PRIME_BBS; + } + + /* calc the byte size */ + bsize = (size>>3) + ((size&7)?1:0); + + /* we need a buffer of bsize bytes */ + tmp = OPT_CAST(unsigned char) XMALLOC(bsize); + if (tmp == NULL) { + return MP_MEM; + } + + /* calc the maskAND value for the MSbyte*/ + maskAND = ((size&7) == 0) ? 0xFF : (0xFF >> (8 - (size & 7))); + + /* calc the maskOR_msb */ + maskOR_msb = 0; + maskOR_msb_offset = ((size & 7) == 1) ? 1 : 0; + if (flags & LTM_PRIME_2MSB_ON) { + maskOR_msb |= 0x80 >> ((9 - size) & 7); + } + + /* get the maskOR_lsb */ + maskOR_lsb = 1; + if (flags & LTM_PRIME_BBS) { + maskOR_lsb |= 3; + } + + do { + /* read the bytes */ + if (cb(tmp, bsize, dat) != bsize) { + err = MP_VAL; + goto error; + } + + /* work over the MSbyte */ + tmp[0] &= maskAND; + tmp[0] |= 1 << ((size - 1) & 7); + + /* mix in the maskORs */ + tmp[maskOR_msb_offset] |= maskOR_msb; + tmp[bsize-1] |= maskOR_lsb; + + /* read it in */ + if ((err = mp_read_unsigned_bin(a, tmp, bsize)) != MP_OKAY) { goto error; } + + /* is it prime? */ + if ((err = mp_prime_is_prime(a, t, &res)) != MP_OKAY) { goto error; } + if (res == MP_NO) { + continue; + } + + if (flags & LTM_PRIME_SAFE) { + /* see if (a-1)/2 is prime */ + if ((err = mp_sub_d(a, 1, a)) != MP_OKAY) { goto error; } + if ((err = mp_div_2(a, a)) != MP_OKAY) { goto error; } + + /* is it prime? */ + if ((err = mp_prime_is_prime(a, t, &res)) != MP_OKAY) { goto error; } + } + } while (res == MP_NO); + + if (flags & LTM_PRIME_SAFE) { + /* restore a to the original value */ + if ((err = mp_mul_2(a, a)) != MP_OKAY) { goto error; } + if ((err = mp_add_d(a, 1, a)) != MP_OKAY) { goto error; } + } + + err = MP_OKAY; +error: + XFREE(tmp); + return err; +} + + +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_prime_random_ex.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_radix_size.c b/dep/StormLib/src/libtommath/bn_mp_radix_size.c new file mode 100644 index 00000000000..2378f1fc1ac --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_radix_size.c @@ -0,0 +1,78 @@ +#include "tommath.h" +#ifdef BN_MP_RADIX_SIZE_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* returns size of ASCII reprensentation */ +int mp_radix_size (mp_int * a, int radix, int *size) +{ + int res, digs; + mp_int t; + mp_digit d; + + *size = 0; + + /* special case for binary */ + if (radix == 2) { + *size = mp_count_bits (a) + (a->sign == MP_NEG ? 1 : 0) + 1; + return MP_OKAY; + } + + /* make sure the radix is in range */ + if (radix < 2 || radix > 64) { + return MP_VAL; + } + + if (mp_iszero(a) == MP_YES) { + *size = 2; + return MP_OKAY; + } + + /* digs is the digit count */ + digs = 0; + + /* if it's negative add one for the sign */ + if (a->sign == MP_NEG) { + ++digs; + } + + /* init a copy of the input */ + if ((res = mp_init_copy (&t, a)) != MP_OKAY) { + return res; + } + + /* force temp to positive */ + t.sign = MP_ZPOS; + + /* fetch out all of the digits */ + while (mp_iszero (&t) == MP_NO) { + if ((res = mp_div_d (&t, (mp_digit) radix, &t, &d)) != MP_OKAY) { + mp_clear (&t); + return res; + } + ++digs; + } + mp_clear (&t); + + /* return digs + 1, the 1 is for the NULL byte that would be required. */ + *size = digs + 1; + return MP_OKAY; +} + +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_radix_size.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_radix_smap.c b/dep/StormLib/src/libtommath/bn_mp_radix_smap.c new file mode 100644 index 00000000000..5cbe9520b5b --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_radix_smap.c @@ -0,0 +1,24 @@ +#include "tommath.h" +#ifdef BN_MP_RADIX_SMAP_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* chars used in radix conversions */ +const char *mp_s_rmap = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+/"; +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_radix_smap.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_rand.c b/dep/StormLib/src/libtommath/bn_mp_rand.c new file mode 100644 index 00000000000..e1241785e88 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_rand.c @@ -0,0 +1,55 @@ +#include "tommath.h" +#ifdef BN_MP_RAND_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* makes a pseudo-random int of a given size */ +int +mp_rand (mp_int * a, int digits) +{ + int res; + mp_digit d; + + mp_zero (a); + if (digits <= 0) { + return MP_OKAY; + } + + /* first place a random non-zero digit */ + do { + d = ((mp_digit) abs (rand ())) & MP_MASK; + } while (d == 0); + + if ((res = mp_add_d (a, d, a)) != MP_OKAY) { + return res; + } + + while (--digits > 0) { + if ((res = mp_lshd (a, 1)) != MP_OKAY) { + return res; + } + + if ((res = mp_add_d (a, ((mp_digit) abs (rand ())), a)) != MP_OKAY) { + return res; + } + } + + return MP_OKAY; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_rand.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_read_radix.c b/dep/StormLib/src/libtommath/bn_mp_read_radix.c new file mode 100644 index 00000000000..6869668fb88 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_read_radix.c @@ -0,0 +1,85 @@ +#include "tommath.h" +#ifdef BN_MP_READ_RADIX_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* read a string [ASCII] in a given radix */ +int mp_read_radix (mp_int * a, const char *str, int radix) +{ + int y, res, neg; + char ch; + + /* zero the digit bignum */ + mp_zero(a); + + /* make sure the radix is ok */ + if (radix < 2 || radix > 64) { + return MP_VAL; + } + + /* if the leading digit is a + * minus set the sign to negative. + */ + if (*str == '-') { + ++str; + neg = MP_NEG; + } else { + neg = MP_ZPOS; + } + + /* set the integer to the default of zero */ + mp_zero (a); + + /* process each digit of the string */ + while (*str) { + /* if the radix < 36 the conversion is case insensitive + * this allows numbers like 1AB and 1ab to represent the same value + * [e.g. in hex] + */ + ch = (char) ((radix < 36) ? toupper (*str) : *str); + for (y = 0; y < 64; y++) { + if (ch == mp_s_rmap[y]) { + break; + } + } + + /* if the char was found in the map + * and is less than the given radix add it + * to the number, otherwise exit the loop. + */ + if (y < radix) { + if ((res = mp_mul_d (a, (mp_digit) radix, a)) != MP_OKAY) { + return res; + } + if ((res = mp_add_d (a, (mp_digit) y, a)) != MP_OKAY) { + return res; + } + } else { + break; + } + ++str; + } + + /* set the sign only if a != 0 */ + if (mp_iszero(a) != 1) { + a->sign = neg; + } + return MP_OKAY; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_read_radix.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_read_signed_bin.c b/dep/StormLib/src/libtommath/bn_mp_read_signed_bin.c new file mode 100644 index 00000000000..e9a780c28aa --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_read_signed_bin.c @@ -0,0 +1,41 @@ +#include "tommath.h" +#ifdef BN_MP_READ_SIGNED_BIN_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* read signed bin, big endian, first byte is 0==positive or 1==negative */ +int mp_read_signed_bin (mp_int * a, const unsigned char *b, int c) +{ + int res; + + /* read magnitude */ + if ((res = mp_read_unsigned_bin (a, b + 1, c - 1)) != MP_OKAY) { + return res; + } + + /* first byte is 0 for positive, non-zero for negative */ + if (b[0] == 0) { + a->sign = MP_ZPOS; + } else { + a->sign = MP_NEG; + } + + return MP_OKAY; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_read_signed_bin.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_read_unsigned_bin.c b/dep/StormLib/src/libtommath/bn_mp_read_unsigned_bin.c new file mode 100644 index 00000000000..7d35370418c --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_read_unsigned_bin.c @@ -0,0 +1,55 @@ +#include "tommath.h" +#ifdef BN_MP_READ_UNSIGNED_BIN_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* reads a unsigned char array, assumes the msb is stored first [big endian] */ +int mp_read_unsigned_bin (mp_int * a, const unsigned char *b, int c) +{ + int res; + + /* make sure there are at least two digits */ + if (a->alloc < 2) { + if ((res = mp_grow(a, 2)) != MP_OKAY) { + return res; + } + } + + /* zero the int */ + mp_zero (a); + + /* read the bytes in */ + while (c-- > 0) { + if ((res = mp_mul_2d (a, 8, a)) != MP_OKAY) { + return res; + } + +#ifndef MP_8BIT + a->dp[0] |= *b++; + a->used += 1; +#else + a->dp[0] = (*b & MP_MASK); + a->dp[1] |= ((*b++ >> 7U) & 1); + a->used += 2; +#endif + } + mp_clamp (a); + return MP_OKAY; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_read_unsigned_bin.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_reduce.c b/dep/StormLib/src/libtommath/bn_mp_reduce.c new file mode 100644 index 00000000000..3a6bb5aca90 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_reduce.c @@ -0,0 +1,100 @@ +#include "tommath.h" +#ifdef BN_MP_REDUCE_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* reduces x mod m, assumes 0 < x < m**2, mu is + * precomputed via mp_reduce_setup. + * From HAC pp.604 Algorithm 14.42 + */ +int mp_reduce (mp_int * x, mp_int * m, mp_int * mu) +{ + mp_int q; + int res, um = m->used; + + /* q = x */ + if ((res = mp_init_copy (&q, x)) != MP_OKAY) { + return res; + } + + /* q1 = x / b**(k-1) */ + mp_rshd (&q, um - 1); + + /* according to HAC this optimization is ok */ + if (((unsigned long) um) > (((mp_digit)1) << (DIGIT_BIT - 1))) { + if ((res = mp_mul (&q, mu, &q)) != MP_OKAY) { + goto CLEANUP; + } + } else { +#ifdef BN_S_MP_MUL_HIGH_DIGS_C + if ((res = s_mp_mul_high_digs (&q, mu, &q, um)) != MP_OKAY) { + goto CLEANUP; + } +#elif defined(BN_FAST_S_MP_MUL_HIGH_DIGS_C) + if ((res = fast_s_mp_mul_high_digs (&q, mu, &q, um)) != MP_OKAY) { + goto CLEANUP; + } +#else + { + res = MP_VAL; + goto CLEANUP; + } +#endif + } + + /* q3 = q2 / b**(k+1) */ + mp_rshd (&q, um + 1); + + /* x = x mod b**(k+1), quick (no division) */ + if ((res = mp_mod_2d (x, DIGIT_BIT * (um + 1), x)) != MP_OKAY) { + goto CLEANUP; + } + + /* q = q * m mod b**(k+1), quick (no division) */ + if ((res = s_mp_mul_digs (&q, m, &q, um + 1)) != MP_OKAY) { + goto CLEANUP; + } + + /* x = x - q */ + if ((res = mp_sub (x, &q, x)) != MP_OKAY) { + goto CLEANUP; + } + + /* If x < 0, add b**(k+1) to it */ + if (mp_cmp_d (x, 0) == MP_LT) { + mp_set (&q, 1); + if ((res = mp_lshd (&q, um + 1)) != MP_OKAY) + goto CLEANUP; + if ((res = mp_add (x, &q, x)) != MP_OKAY) + goto CLEANUP; + } + + /* Back off if it's too big */ + while (mp_cmp (x, m) != MP_LT) { + if ((res = s_mp_sub (x, m, x)) != MP_OKAY) { + goto CLEANUP; + } + } + +CLEANUP: + mp_clear (&q); + + return res; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_reduce.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_reduce_2k.c b/dep/StormLib/src/libtommath/bn_mp_reduce_2k.c new file mode 100644 index 00000000000..3191d829179 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_reduce_2k.c @@ -0,0 +1,61 @@ +#include "tommath.h" +#ifdef BN_MP_REDUCE_2K_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* reduces a modulo n where n is of the form 2**p - d */ +int mp_reduce_2k(mp_int *a, mp_int *n, mp_digit d) +{ + mp_int q; + int p, res; + + if ((res = mp_init(&q)) != MP_OKAY) { + return res; + } + + p = mp_count_bits(n); +top: + /* q = a/2**p, a = a mod 2**p */ + if ((res = mp_div_2d(a, p, &q, a)) != MP_OKAY) { + goto ERR; + } + + if (d != 1) { + /* q = q * d */ + if ((res = mp_mul_d(&q, d, &q)) != MP_OKAY) { + goto ERR; + } + } + + /* a = a + q */ + if ((res = s_mp_add(a, &q, a)) != MP_OKAY) { + goto ERR; + } + + if (mp_cmp_mag(a, n) != MP_LT) { + s_mp_sub(a, n, a); + goto top; + } + +ERR: + mp_clear(&q); + return res; +} + +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_2k.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_reduce_2k_l.c b/dep/StormLib/src/libtommath/bn_mp_reduce_2k_l.c new file mode 100644 index 00000000000..49b7e344ed9 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_reduce_2k_l.c @@ -0,0 +1,62 @@ +#include "tommath.h" +#ifdef BN_MP_REDUCE_2K_L_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* reduces a modulo n where n is of the form 2**p - d + This differs from reduce_2k since "d" can be larger + than a single digit. +*/ +int mp_reduce_2k_l(mp_int *a, mp_int *n, mp_int *d) +{ + mp_int q; + int p, res; + + if ((res = mp_init(&q)) != MP_OKAY) { + return res; + } + + p = mp_count_bits(n); +top: + /* q = a/2**p, a = a mod 2**p */ + if ((res = mp_div_2d(a, p, &q, a)) != MP_OKAY) { + goto ERR; + } + + /* q = q * d */ + if ((res = mp_mul(&q, d, &q)) != MP_OKAY) { + goto ERR; + } + + /* a = a + q */ + if ((res = s_mp_add(a, &q, a)) != MP_OKAY) { + goto ERR; + } + + if (mp_cmp_mag(a, n) != MP_LT) { + s_mp_sub(a, n, a); + goto top; + } + +ERR: + mp_clear(&q); + return res; +} + +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_2k_l.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_reduce_2k_setup.c b/dep/StormLib/src/libtommath/bn_mp_reduce_2k_setup.c new file mode 100644 index 00000000000..aa3b3bad8db --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_reduce_2k_setup.c @@ -0,0 +1,47 @@ +#include "tommath.h" +#ifdef BN_MP_REDUCE_2K_SETUP_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* determines the setup value */ +int mp_reduce_2k_setup(mp_int *a, mp_digit *d) +{ + int res, p; + mp_int tmp; + + if ((res = mp_init(&tmp)) != MP_OKAY) { + return res; + } + + p = mp_count_bits(a); + if ((res = mp_2expt(&tmp, p)) != MP_OKAY) { + mp_clear(&tmp); + return res; + } + + if ((res = s_mp_sub(&tmp, a, &tmp)) != MP_OKAY) { + mp_clear(&tmp); + return res; + } + + *d = tmp.dp[0]; + mp_clear(&tmp); + return MP_OKAY; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_2k_setup.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_reduce_2k_setup_l.c b/dep/StormLib/src/libtommath/bn_mp_reduce_2k_setup_l.c new file mode 100644 index 00000000000..4eca87040bc --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_reduce_2k_setup_l.c @@ -0,0 +1,44 @@ +#include "tommath.h" +#ifdef BN_MP_REDUCE_2K_SETUP_L_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* determines the setup value */ +int mp_reduce_2k_setup_l(mp_int *a, mp_int *d) +{ + int res; + mp_int tmp; + + if ((res = mp_init(&tmp)) != MP_OKAY) { + return res; + } + + if ((res = mp_2expt(&tmp, mp_count_bits(a))) != MP_OKAY) { + goto ERR; + } + + if ((res = s_mp_sub(&tmp, a, d)) != MP_OKAY) { + goto ERR; + } + +ERR: + mp_clear(&tmp); + return res; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_2k_setup_l.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_reduce_is_2k.c b/dep/StormLib/src/libtommath/bn_mp_reduce_is_2k.c new file mode 100644 index 00000000000..b9ede978964 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_reduce_is_2k.c @@ -0,0 +1,52 @@ +#include "tommath.h" +#ifdef BN_MP_REDUCE_IS_2K_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* determines if mp_reduce_2k can be used */ +int mp_reduce_is_2k(mp_int *a) +{ + int ix, iy, iw; + mp_digit iz; + + if (a->used == 0) { + return MP_NO; + } else if (a->used == 1) { + return MP_YES; + } else if (a->used > 1) { + iy = mp_count_bits(a); + iz = 1; + iw = 1; + + /* Test every bit from the second digit up, must be 1 */ + for (ix = DIGIT_BIT; ix < iy; ix++) { + if ((a->dp[iw] & iz) == 0) { + return MP_NO; + } + iz <<= 1; + if (iz > (mp_digit)MP_MASK) { + ++iw; + iz = 1; + } + } + } + return MP_YES; +} + +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_is_2k.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_reduce_is_2k_l.c b/dep/StormLib/src/libtommath/bn_mp_reduce_is_2k_l.c new file mode 100644 index 00000000000..787875f8bbb --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_reduce_is_2k_l.c @@ -0,0 +1,44 @@ +#include "tommath.h" +#ifdef BN_MP_REDUCE_IS_2K_L_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* determines if reduce_2k_l can be used */ +int mp_reduce_is_2k_l(mp_int *a) +{ + int ix, iy; + + if (a->used == 0) { + return MP_NO; + } else if (a->used == 1) { + return MP_YES; + } else if (a->used > 1) { + /* if more than half of the digits are -1 we're sold */ + for (iy = ix = 0; ix < a->used; ix++) { + if (a->dp[ix] == MP_MASK) { + ++iy; + } + } + return (iy >= (a->used/2)) ? MP_YES : MP_NO; + + } + return MP_NO; +} + +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_is_2k_l.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_reduce_setup.c b/dep/StormLib/src/libtommath/bn_mp_reduce_setup.c new file mode 100644 index 00000000000..00e0a62b9bd --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_reduce_setup.c @@ -0,0 +1,34 @@ +#include "tommath.h" +#ifdef BN_MP_REDUCE_SETUP_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* pre-calculate the value required for Barrett reduction + * For a given modulus "b" it calulates the value required in "a" + */ +int mp_reduce_setup (mp_int * a, mp_int * b) +{ + int res; + + if ((res = mp_2expt (a, b->used * 2 * DIGIT_BIT)) != MP_OKAY) { + return res; + } + return mp_div (a, b, a, NULL); +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_reduce_setup.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_rshd.c b/dep/StormLib/src/libtommath/bn_mp_rshd.c new file mode 100644 index 00000000000..eac6721baf0 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_rshd.c @@ -0,0 +1,72 @@ +#include "tommath.h" +#ifdef BN_MP_RSHD_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* shift right a certain amount of digits */ +void mp_rshd (mp_int * a, int b) +{ + int x; + + /* if b <= 0 then ignore it */ + if (b <= 0) { + return; + } + + /* if b > used then simply zero it and return */ + if (a->used <= b) { + mp_zero (a); + return; + } + + { + register mp_digit *bottom, *top; + + /* shift the digits down */ + + /* bottom */ + bottom = a->dp; + + /* top [offset into digits] */ + top = a->dp + b; + + /* this is implemented as a sliding window where + * the window is b-digits long and digits from + * the top of the window are copied to the bottom + * + * e.g. + + b-2 | b-1 | b0 | b1 | b2 | ... | bb | ----> + /\ | ----> + \-------------------/ ----> + */ + for (x = 0; x < (a->used - b); x++) { + *bottom++ = *top++; + } + + /* zero the top digits */ + for (; x < a->used; x++) { + *bottom++ = 0; + } + } + + /* remove excess digits */ + a->used -= b; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_rshd.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_set.c b/dep/StormLib/src/libtommath/bn_mp_set.c new file mode 100644 index 00000000000..d76d5bbd324 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_set.c @@ -0,0 +1,29 @@ +#include "tommath.h" +#ifdef BN_MP_SET_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* set to a digit */ +void mp_set (mp_int * a, mp_digit b) +{ + mp_zero (a); + a->dp[0] = b & MP_MASK; + a->used = (a->dp[0] != 0) ? 1 : 0; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_set.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_set_int.c b/dep/StormLib/src/libtommath/bn_mp_set_int.c new file mode 100644 index 00000000000..68cf0e32b27 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_set_int.c @@ -0,0 +1,48 @@ +#include "tommath.h" +#ifdef BN_MP_SET_INT_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* set a 32-bit const */ +int mp_set_int (mp_int * a, unsigned long b) +{ + int x, res; + + mp_zero (a); + + /* set four bits at a time */ + for (x = 0; x < 8; x++) { + /* shift the number up four bits */ + if ((res = mp_mul_2d (a, 4, a)) != MP_OKAY) { + return res; + } + + /* OR in the top four bits of the source */ + a->dp[0] |= (b >> 28) & 15; + + /* shift the source up to the next four bits */ + b <<= 4; + + /* ensure that digits are not clamped off */ + a->used += 1; + } + mp_clamp (a); + return MP_OKAY; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_set_int.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_shrink.c b/dep/StormLib/src/libtommath/bn_mp_shrink.c new file mode 100644 index 00000000000..54920d1400a --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_shrink.c @@ -0,0 +1,35 @@ +#include "tommath.h" +#ifdef BN_MP_SHRINK_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* shrink a bignum */ +int mp_shrink (mp_int * a) +{ + mp_digit *tmp; + if (a->alloc != a->used && a->used > 0) { + if ((tmp = OPT_CAST(mp_digit) XREALLOC (a->dp, sizeof (mp_digit) * a->used)) == NULL) { + return MP_MEM; + } + a->dp = tmp; + a->alloc = a->used; + } + return MP_OKAY; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_shrink.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_signed_bin_size.c b/dep/StormLib/src/libtommath/bn_mp_signed_bin_size.c new file mode 100644 index 00000000000..b9492a5e5ed --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_signed_bin_size.c @@ -0,0 +1,27 @@ +#include "tommath.h" +#ifdef BN_MP_SIGNED_BIN_SIZE_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* get the size for an signed equivalent */ +int mp_signed_bin_size (mp_int * a) +{ + return 1 + mp_unsigned_bin_size (a); +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_signed_bin_size.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_sqr.c b/dep/StormLib/src/libtommath/bn_mp_sqr.c new file mode 100644 index 00000000000..c10fa6f3b6e --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_sqr.c @@ -0,0 +1,58 @@ +#include "tommath.h" +#ifdef BN_MP_SQR_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* computes b = a*a */ +int +mp_sqr (mp_int * a, mp_int * b) +{ + int res; + +#ifdef BN_MP_TOOM_SQR_C + /* use Toom-Cook? */ + if (a->used >= TOOM_SQR_CUTOFF) { + res = mp_toom_sqr(a, b); + /* Karatsuba? */ + } else +#endif +#ifdef BN_MP_KARATSUBA_SQR_C +if (a->used >= KARATSUBA_SQR_CUTOFF) { + res = mp_karatsuba_sqr (a, b); + } else +#endif + { +#ifdef BN_FAST_S_MP_SQR_C + /* can we use the fast comba multiplier? */ + if ((a->used * 2 + 1) < MP_WARRAY && + a->used < + (1 << (sizeof(mp_word) * CHAR_BIT - 2*DIGIT_BIT - 1))) { + res = fast_s_mp_sqr (a, b); + } else +#endif +#ifdef BN_S_MP_SQR_C + res = s_mp_sqr (a, b); +#else + res = MP_VAL; +#endif + } + b->sign = MP_ZPOS; + return res; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_sqr.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_sqrmod.c b/dep/StormLib/src/libtommath/bn_mp_sqrmod.c new file mode 100644 index 00000000000..5f4b2f3d663 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_sqrmod.c @@ -0,0 +1,41 @@ +#include "tommath.h" +#ifdef BN_MP_SQRMOD_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* c = a * a (mod b) */ +int +mp_sqrmod (mp_int * a, mp_int * b, mp_int * c) +{ + int res; + mp_int t; + + if ((res = mp_init (&t)) != MP_OKAY) { + return res; + } + + if ((res = mp_sqr (a, &t)) != MP_OKAY) { + mp_clear (&t); + return res; + } + res = mp_mod (&t, b, c); + mp_clear (&t); + return res; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_sqrmod.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_sqrt.c b/dep/StormLib/src/libtommath/bn_mp_sqrt.c new file mode 100644 index 00000000000..e15ba98ca88 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_sqrt.c @@ -0,0 +1,81 @@ +#include "tommath.h" +#ifdef BN_MP_SQRT_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* this function is less generic than mp_n_root, simpler and faster */ +int mp_sqrt(mp_int *arg, mp_int *ret) +{ + int res; + mp_int t1,t2; + + /* must be positive */ + if (arg->sign == MP_NEG) { + return MP_VAL; + } + + /* easy out */ + if (mp_iszero(arg) == MP_YES) { + mp_zero(ret); + return MP_OKAY; + } + + if ((res = mp_init_copy(&t1, arg)) != MP_OKAY) { + return res; + } + + if ((res = mp_init(&t2)) != MP_OKAY) { + goto E2; + } + + /* First approx. (not very bad for large arg) */ + mp_rshd (&t1,t1.used/2); + + /* t1 > 0 */ + if ((res = mp_div(arg,&t1,&t2,NULL)) != MP_OKAY) { + goto E1; + } + if ((res = mp_add(&t1,&t2,&t1)) != MP_OKAY) { + goto E1; + } + if ((res = mp_div_2(&t1,&t1)) != MP_OKAY) { + goto E1; + } + /* And now t1 > sqrt(arg) */ + do { + if ((res = mp_div(arg,&t1,&t2,NULL)) != MP_OKAY) { + goto E1; + } + if ((res = mp_add(&t1,&t2,&t1)) != MP_OKAY) { + goto E1; + } + if ((res = mp_div_2(&t1,&t1)) != MP_OKAY) { + goto E1; + } + /* t1 >= sqrt(arg) >= t2 at this point */ + } while (mp_cmp_mag(&t1,&t2) == MP_GT); + + mp_exch(&t1,ret); + +E1: mp_clear(&t2); +E2: mp_clear(&t1); + return res; +} + +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_sqrt.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_sub.c b/dep/StormLib/src/libtommath/bn_mp_sub.c new file mode 100644 index 00000000000..6e72138610f --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_sub.c @@ -0,0 +1,59 @@ +#include "tommath.h" +#ifdef BN_MP_SUB_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* high level subtraction (handles signs) */ +int +mp_sub (mp_int * a, mp_int * b, mp_int * c) +{ + int sa, sb, res; + + sa = a->sign; + sb = b->sign; + + if (sa != sb) { + /* subtract a negative from a positive, OR */ + /* subtract a positive from a negative. */ + /* In either case, ADD their magnitudes, */ + /* and use the sign of the first number. */ + c->sign = sa; + res = s_mp_add (a, b, c); + } else { + /* subtract a positive from a positive, OR */ + /* subtract a negative from a negative. */ + /* First, take the difference between their */ + /* magnitudes, then... */ + if (mp_cmp_mag (a, b) != MP_LT) { + /* Copy the sign from the first */ + c->sign = sa; + /* The first has a larger or equal magnitude */ + res = s_mp_sub (a, b, c); + } else { + /* The result has the *opposite* sign from */ + /* the first number. */ + c->sign = (sa == MP_ZPOS) ? MP_NEG : MP_ZPOS; + /* The second has a larger magnitude */ + res = s_mp_sub (b, a, c); + } + } + return res; +} + +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_sub.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_sub_d.c b/dep/StormLib/src/libtommath/bn_mp_sub_d.c new file mode 100644 index 00000000000..aa08e31b30b --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_sub_d.c @@ -0,0 +1,93 @@ +#include "tommath.h" +#ifdef BN_MP_SUB_D_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* single digit subtraction */ +int +mp_sub_d (mp_int * a, mp_digit b, mp_int * c) +{ + mp_digit *tmpa, *tmpc, mu; + int res, ix, oldused; + + /* grow c as required */ + if (c->alloc < a->used + 1) { + if ((res = mp_grow(c, a->used + 1)) != MP_OKAY) { + return res; + } + } + + /* if a is negative just do an unsigned + * addition [with fudged signs] + */ + if (a->sign == MP_NEG) { + a->sign = MP_ZPOS; + res = mp_add_d(a, b, c); + a->sign = c->sign = MP_NEG; + + /* clamp */ + mp_clamp(c); + + return res; + } + + /* setup regs */ + oldused = c->used; + tmpa = a->dp; + tmpc = c->dp; + + /* if a <= b simply fix the single digit */ + if ((a->used == 1 && a->dp[0] <= b) || a->used == 0) { + if (a->used == 1) { + *tmpc++ = b - *tmpa; + } else { + *tmpc++ = b; + } + ix = 1; + + /* negative/1digit */ + c->sign = MP_NEG; + c->used = 1; + } else { + /* positive/size */ + c->sign = MP_ZPOS; + c->used = a->used; + + /* subtract first digit */ + *tmpc = *tmpa++ - b; + mu = *tmpc >> (sizeof(mp_digit) * CHAR_BIT - 1); + *tmpc++ &= MP_MASK; + + /* handle rest of the digits */ + for (ix = 1; ix < a->used; ix++) { + *tmpc = *tmpa++ - mu; + mu = *tmpc >> (sizeof(mp_digit) * CHAR_BIT - 1); + *tmpc++ &= MP_MASK; + } + } + + /* zero excess digits */ + while (ix++ < oldused) { + *tmpc++ = 0; + } + mp_clamp(c); + return MP_OKAY; +} + +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_sub_d.c,v $ */ +/* $Revision: 1.6 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_submod.c b/dep/StormLib/src/libtommath/bn_mp_submod.c new file mode 100644 index 00000000000..6617ff42ceb --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_submod.c @@ -0,0 +1,42 @@ +#include "tommath.h" +#ifdef BN_MP_SUBMOD_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* d = a - b (mod c) */ +int +mp_submod (mp_int * a, mp_int * b, mp_int * c, mp_int * d) +{ + int res; + mp_int t; + + + if ((res = mp_init (&t)) != MP_OKAY) { + return res; + } + + if ((res = mp_sub (a, b, &t)) != MP_OKAY) { + mp_clear (&t); + return res; + } + res = mp_mod (&t, c, d); + mp_clear (&t); + return res; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_submod.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_to_signed_bin.c b/dep/StormLib/src/libtommath/bn_mp_to_signed_bin.c new file mode 100644 index 00000000000..154f64b5667 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_to_signed_bin.c @@ -0,0 +1,33 @@ +#include "tommath.h" +#ifdef BN_MP_TO_SIGNED_BIN_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* store in signed [big endian] format */ +int mp_to_signed_bin (mp_int * a, unsigned char *b) +{ + int res; + + if ((res = mp_to_unsigned_bin (a, b + 1)) != MP_OKAY) { + return res; + } + b[0] = (unsigned char) ((a->sign == MP_ZPOS) ? 0 : 1); + return MP_OKAY; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_to_signed_bin.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_to_signed_bin_n.c b/dep/StormLib/src/libtommath/bn_mp_to_signed_bin_n.c new file mode 100644 index 00000000000..e119c380a91 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_to_signed_bin_n.c @@ -0,0 +1,31 @@ +#include "tommath.h" +#ifdef BN_MP_TO_SIGNED_BIN_N_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* store in signed [big endian] format */ +int mp_to_signed_bin_n (mp_int * a, unsigned char *b, unsigned long *outlen) +{ + if (*outlen < (unsigned long)mp_signed_bin_size(a)) { + return MP_VAL; + } + *outlen = mp_signed_bin_size(a); + return mp_to_signed_bin(a, b); +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_to_signed_bin_n.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_to_unsigned_bin.c b/dep/StormLib/src/libtommath/bn_mp_to_unsigned_bin.c new file mode 100644 index 00000000000..ce69e5bf364 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_to_unsigned_bin.c @@ -0,0 +1,48 @@ +#include "tommath.h" +#ifdef BN_MP_TO_UNSIGNED_BIN_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* store in unsigned [big endian] format */ +int mp_to_unsigned_bin (mp_int * a, unsigned char *b) +{ + int x, res; + mp_int t; + + if ((res = mp_init_copy (&t, a)) != MP_OKAY) { + return res; + } + + x = 0; + while (mp_iszero (&t) == 0) { +#ifndef MP_8BIT + b[x++] = (unsigned char) (t.dp[0] & 255); +#else + b[x++] = (unsigned char) (t.dp[0] | ((t.dp[1] & 0x01) << 7)); +#endif + if ((res = mp_div_2d (&t, 8, &t, NULL)) != MP_OKAY) { + mp_clear (&t); + return res; + } + } + bn_reverse (b, x); + mp_clear (&t); + return MP_OKAY; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_to_unsigned_bin.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_to_unsigned_bin_n.c b/dep/StormLib/src/libtommath/bn_mp_to_unsigned_bin_n.c new file mode 100644 index 00000000000..dfa27c41bab --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_to_unsigned_bin_n.c @@ -0,0 +1,31 @@ +#include "tommath.h" +#ifdef BN_MP_TO_UNSIGNED_BIN_N_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* store in unsigned [big endian] format */ +int mp_to_unsigned_bin_n (mp_int * a, unsigned char *b, unsigned long *outlen) +{ + if (*outlen < (unsigned long)mp_unsigned_bin_size(a)) { + return MP_VAL; + } + *outlen = mp_unsigned_bin_size(a); + return mp_to_unsigned_bin(a, b); +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_to_unsigned_bin_n.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_toom_mul.c b/dep/StormLib/src/libtommath/bn_mp_toom_mul.c new file mode 100644 index 00000000000..e48c6b355c0 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_toom_mul.c @@ -0,0 +1,284 @@ +#include "tommath.h" +#ifdef BN_MP_TOOM_MUL_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* multiplication using the Toom-Cook 3-way algorithm + * + * Much more complicated than Karatsuba but has a lower + * asymptotic running time of O(N**1.464). This algorithm is + * only particularly useful on VERY large inputs + * (we're talking 1000s of digits here...). +*/ +int mp_toom_mul(mp_int *a, mp_int *b, mp_int *c) +{ + mp_int w0, w1, w2, w3, w4, tmp1, tmp2, a0, a1, a2, b0, b1, b2; + int res, B; + + /* init temps */ + if ((res = mp_init_multi(&w0, &w1, &w2, &w3, &w4, + &a0, &a1, &a2, &b0, &b1, + &b2, &tmp1, &tmp2, NULL)) != MP_OKAY) { + return res; + } + + /* B */ + B = MIN(a->used, b->used) / 3; + + /* a = a2 * B**2 + a1 * B + a0 */ + if ((res = mp_mod_2d(a, DIGIT_BIT * B, &a0)) != MP_OKAY) { + goto ERR; + } + + if ((res = mp_copy(a, &a1)) != MP_OKAY) { + goto ERR; + } + mp_rshd(&a1, B); + mp_mod_2d(&a1, DIGIT_BIT * B, &a1); + + if ((res = mp_copy(a, &a2)) != MP_OKAY) { + goto ERR; + } + mp_rshd(&a2, B*2); + + /* b = b2 * B**2 + b1 * B + b0 */ + if ((res = mp_mod_2d(b, DIGIT_BIT * B, &b0)) != MP_OKAY) { + goto ERR; + } + + if ((res = mp_copy(b, &b1)) != MP_OKAY) { + goto ERR; + } + mp_rshd(&b1, B); + mp_mod_2d(&b1, DIGIT_BIT * B, &b1); + + if ((res = mp_copy(b, &b2)) != MP_OKAY) { + goto ERR; + } + mp_rshd(&b2, B*2); + + /* w0 = a0*b0 */ + if ((res = mp_mul(&a0, &b0, &w0)) != MP_OKAY) { + goto ERR; + } + + /* w4 = a2 * b2 */ + if ((res = mp_mul(&a2, &b2, &w4)) != MP_OKAY) { + goto ERR; + } + + /* w1 = (a2 + 2(a1 + 2a0))(b2 + 2(b1 + 2b0)) */ + if ((res = mp_mul_2(&a0, &tmp1)) != MP_OKAY) { + goto ERR; + } + if ((res = mp_add(&tmp1, &a1, &tmp1)) != MP_OKAY) { + goto ERR; + } + if ((res = mp_mul_2(&tmp1, &tmp1)) != MP_OKAY) { + goto ERR; + } + if ((res = mp_add(&tmp1, &a2, &tmp1)) != MP_OKAY) { + goto ERR; + } + + if ((res = mp_mul_2(&b0, &tmp2)) != MP_OKAY) { + goto ERR; + } + if ((res = mp_add(&tmp2, &b1, &tmp2)) != MP_OKAY) { + goto ERR; + } + if ((res = mp_mul_2(&tmp2, &tmp2)) != MP_OKAY) { + goto ERR; + } + if ((res = mp_add(&tmp2, &b2, &tmp2)) != MP_OKAY) { + goto ERR; + } + + if ((res = mp_mul(&tmp1, &tmp2, &w1)) != MP_OKAY) { + goto ERR; + } + + /* w3 = (a0 + 2(a1 + 2a2))(b0 + 2(b1 + 2b2)) */ + if ((res = mp_mul_2(&a2, &tmp1)) != MP_OKAY) { + goto ERR; + } + if ((res = mp_add(&tmp1, &a1, &tmp1)) != MP_OKAY) { + goto ERR; + } + if ((res = mp_mul_2(&tmp1, &tmp1)) != MP_OKAY) { + goto ERR; + } + if ((res = mp_add(&tmp1, &a0, &tmp1)) != MP_OKAY) { + goto ERR; + } + + if ((res = mp_mul_2(&b2, &tmp2)) != MP_OKAY) { + goto ERR; + } + if ((res = mp_add(&tmp2, &b1, &tmp2)) != MP_OKAY) { + goto ERR; + } + if ((res = mp_mul_2(&tmp2, &tmp2)) != MP_OKAY) { + goto ERR; + } + if ((res = mp_add(&tmp2, &b0, &tmp2)) != MP_OKAY) { + goto ERR; + } + + if ((res = mp_mul(&tmp1, &tmp2, &w3)) != MP_OKAY) { + goto ERR; + } + + + /* w2 = (a2 + a1 + a0)(b2 + b1 + b0) */ + if ((res = mp_add(&a2, &a1, &tmp1)) != MP_OKAY) { + goto ERR; + } + if ((res = mp_add(&tmp1, &a0, &tmp1)) != MP_OKAY) { + goto ERR; + } + if ((res = mp_add(&b2, &b1, &tmp2)) != MP_OKAY) { + goto ERR; + } + if ((res = mp_add(&tmp2, &b0, &tmp2)) != MP_OKAY) { + goto ERR; + } + if ((res = mp_mul(&tmp1, &tmp2, &w2)) != MP_OKAY) { + goto ERR; + } + + /* now solve the matrix + + 0 0 0 0 1 + 1 2 4 8 16 + 1 1 1 1 1 + 16 8 4 2 1 + 1 0 0 0 0 + + using 12 subtractions, 4 shifts, + 2 small divisions and 1 small multiplication + */ + + /* r1 - r4 */ + if ((res = mp_sub(&w1, &w4, &w1)) != MP_OKAY) { + goto ERR; + } + /* r3 - r0 */ + if ((res = mp_sub(&w3, &w0, &w3)) != MP_OKAY) { + goto ERR; + } + /* r1/2 */ + if ((res = mp_div_2(&w1, &w1)) != MP_OKAY) { + goto ERR; + } + /* r3/2 */ + if ((res = mp_div_2(&w3, &w3)) != MP_OKAY) { + goto ERR; + } + /* r2 - r0 - r4 */ + if ((res = mp_sub(&w2, &w0, &w2)) != MP_OKAY) { + goto ERR; + } + if ((res = mp_sub(&w2, &w4, &w2)) != MP_OKAY) { + goto ERR; + } + /* r1 - r2 */ + if ((res = mp_sub(&w1, &w2, &w1)) != MP_OKAY) { + goto ERR; + } + /* r3 - r2 */ + if ((res = mp_sub(&w3, &w2, &w3)) != MP_OKAY) { + goto ERR; + } + /* r1 - 8r0 */ + if ((res = mp_mul_2d(&w0, 3, &tmp1)) != MP_OKAY) { + goto ERR; + } + if ((res = mp_sub(&w1, &tmp1, &w1)) != MP_OKAY) { + goto ERR; + } + /* r3 - 8r4 */ + if ((res = mp_mul_2d(&w4, 3, &tmp1)) != MP_OKAY) { + goto ERR; + } + if ((res = mp_sub(&w3, &tmp1, &w3)) != MP_OKAY) { + goto ERR; + } + /* 3r2 - r1 - r3 */ + if ((res = mp_mul_d(&w2, 3, &w2)) != MP_OKAY) { + goto ERR; + } + if ((res = mp_sub(&w2, &w1, &w2)) != MP_OKAY) { + goto ERR; + } + if ((res = mp_sub(&w2, &w3, &w2)) != MP_OKAY) { + goto ERR; + } + /* r1 - r2 */ + if ((res = mp_sub(&w1, &w2, &w1)) != MP_OKAY) { + goto ERR; + } + /* r3 - r2 */ + if ((res = mp_sub(&w3, &w2, &w3)) != MP_OKAY) { + goto ERR; + } + /* r1/3 */ + if ((res = mp_div_3(&w1, &w1, NULL)) != MP_OKAY) { + goto ERR; + } + /* r3/3 */ + if ((res = mp_div_3(&w3, &w3, NULL)) != MP_OKAY) { + goto ERR; + } + + /* at this point shift W[n] by B*n */ + if ((res = mp_lshd(&w1, 1*B)) != MP_OKAY) { + goto ERR; + } + if ((res = mp_lshd(&w2, 2*B)) != MP_OKAY) { + goto ERR; + } + if ((res = mp_lshd(&w3, 3*B)) != MP_OKAY) { + goto ERR; + } + if ((res = mp_lshd(&w4, 4*B)) != MP_OKAY) { + goto ERR; + } + + if ((res = mp_add(&w0, &w1, c)) != MP_OKAY) { + goto ERR; + } + if ((res = mp_add(&w2, &w3, &tmp1)) != MP_OKAY) { + goto ERR; + } + if ((res = mp_add(&w4, &tmp1, &tmp1)) != MP_OKAY) { + goto ERR; + } + if ((res = mp_add(&tmp1, c, c)) != MP_OKAY) { + goto ERR; + } + +ERR: + mp_clear_multi(&w0, &w1, &w2, &w3, &w4, + &a0, &a1, &a2, &b0, &b1, + &b2, &tmp1, &tmp2, NULL); + return res; +} + +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_toom_mul.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_toom_sqr.c b/dep/StormLib/src/libtommath/bn_mp_toom_sqr.c new file mode 100644 index 00000000000..fd8bc672a1a --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_toom_sqr.c @@ -0,0 +1,226 @@ +#include "tommath.h" +#ifdef BN_MP_TOOM_SQR_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* squaring using Toom-Cook 3-way algorithm */ +int +mp_toom_sqr(mp_int *a, mp_int *b) +{ + mp_int w0, w1, w2, w3, w4, tmp1, a0, a1, a2; + int res, B; + + /* init temps */ + if ((res = mp_init_multi(&w0, &w1, &w2, &w3, &w4, &a0, &a1, &a2, &tmp1, NULL)) != MP_OKAY) { + return res; + } + + /* B */ + B = a->used / 3; + + /* a = a2 * B**2 + a1 * B + a0 */ + if ((res = mp_mod_2d(a, DIGIT_BIT * B, &a0)) != MP_OKAY) { + goto ERR; + } + + if ((res = mp_copy(a, &a1)) != MP_OKAY) { + goto ERR; + } + mp_rshd(&a1, B); + mp_mod_2d(&a1, DIGIT_BIT * B, &a1); + + if ((res = mp_copy(a, &a2)) != MP_OKAY) { + goto ERR; + } + mp_rshd(&a2, B*2); + + /* w0 = a0*a0 */ + if ((res = mp_sqr(&a0, &w0)) != MP_OKAY) { + goto ERR; + } + + /* w4 = a2 * a2 */ + if ((res = mp_sqr(&a2, &w4)) != MP_OKAY) { + goto ERR; + } + + /* w1 = (a2 + 2(a1 + 2a0))**2 */ + if ((res = mp_mul_2(&a0, &tmp1)) != MP_OKAY) { + goto ERR; + } + if ((res = mp_add(&tmp1, &a1, &tmp1)) != MP_OKAY) { + goto ERR; + } + if ((res = mp_mul_2(&tmp1, &tmp1)) != MP_OKAY) { + goto ERR; + } + if ((res = mp_add(&tmp1, &a2, &tmp1)) != MP_OKAY) { + goto ERR; + } + + if ((res = mp_sqr(&tmp1, &w1)) != MP_OKAY) { + goto ERR; + } + + /* w3 = (a0 + 2(a1 + 2a2))**2 */ + if ((res = mp_mul_2(&a2, &tmp1)) != MP_OKAY) { + goto ERR; + } + if ((res = mp_add(&tmp1, &a1, &tmp1)) != MP_OKAY) { + goto ERR; + } + if ((res = mp_mul_2(&tmp1, &tmp1)) != MP_OKAY) { + goto ERR; + } + if ((res = mp_add(&tmp1, &a0, &tmp1)) != MP_OKAY) { + goto ERR; + } + + if ((res = mp_sqr(&tmp1, &w3)) != MP_OKAY) { + goto ERR; + } + + + /* w2 = (a2 + a1 + a0)**2 */ + if ((res = mp_add(&a2, &a1, &tmp1)) != MP_OKAY) { + goto ERR; + } + if ((res = mp_add(&tmp1, &a0, &tmp1)) != MP_OKAY) { + goto ERR; + } + if ((res = mp_sqr(&tmp1, &w2)) != MP_OKAY) { + goto ERR; + } + + /* now solve the matrix + + 0 0 0 0 1 + 1 2 4 8 16 + 1 1 1 1 1 + 16 8 4 2 1 + 1 0 0 0 0 + + using 12 subtractions, 4 shifts, 2 small divisions and 1 small multiplication. + */ + + /* r1 - r4 */ + if ((res = mp_sub(&w1, &w4, &w1)) != MP_OKAY) { + goto ERR; + } + /* r3 - r0 */ + if ((res = mp_sub(&w3, &w0, &w3)) != MP_OKAY) { + goto ERR; + } + /* r1/2 */ + if ((res = mp_div_2(&w1, &w1)) != MP_OKAY) { + goto ERR; + } + /* r3/2 */ + if ((res = mp_div_2(&w3, &w3)) != MP_OKAY) { + goto ERR; + } + /* r2 - r0 - r4 */ + if ((res = mp_sub(&w2, &w0, &w2)) != MP_OKAY) { + goto ERR; + } + if ((res = mp_sub(&w2, &w4, &w2)) != MP_OKAY) { + goto ERR; + } + /* r1 - r2 */ + if ((res = mp_sub(&w1, &w2, &w1)) != MP_OKAY) { + goto ERR; + } + /* r3 - r2 */ + if ((res = mp_sub(&w3, &w2, &w3)) != MP_OKAY) { + goto ERR; + } + /* r1 - 8r0 */ + if ((res = mp_mul_2d(&w0, 3, &tmp1)) != MP_OKAY) { + goto ERR; + } + if ((res = mp_sub(&w1, &tmp1, &w1)) != MP_OKAY) { + goto ERR; + } + /* r3 - 8r4 */ + if ((res = mp_mul_2d(&w4, 3, &tmp1)) != MP_OKAY) { + goto ERR; + } + if ((res = mp_sub(&w3, &tmp1, &w3)) != MP_OKAY) { + goto ERR; + } + /* 3r2 - r1 - r3 */ + if ((res = mp_mul_d(&w2, 3, &w2)) != MP_OKAY) { + goto ERR; + } + if ((res = mp_sub(&w2, &w1, &w2)) != MP_OKAY) { + goto ERR; + } + if ((res = mp_sub(&w2, &w3, &w2)) != MP_OKAY) { + goto ERR; + } + /* r1 - r2 */ + if ((res = mp_sub(&w1, &w2, &w1)) != MP_OKAY) { + goto ERR; + } + /* r3 - r2 */ + if ((res = mp_sub(&w3, &w2, &w3)) != MP_OKAY) { + goto ERR; + } + /* r1/3 */ + if ((res = mp_div_3(&w1, &w1, NULL)) != MP_OKAY) { + goto ERR; + } + /* r3/3 */ + if ((res = mp_div_3(&w3, &w3, NULL)) != MP_OKAY) { + goto ERR; + } + + /* at this point shift W[n] by B*n */ + if ((res = mp_lshd(&w1, 1*B)) != MP_OKAY) { + goto ERR; + } + if ((res = mp_lshd(&w2, 2*B)) != MP_OKAY) { + goto ERR; + } + if ((res = mp_lshd(&w3, 3*B)) != MP_OKAY) { + goto ERR; + } + if ((res = mp_lshd(&w4, 4*B)) != MP_OKAY) { + goto ERR; + } + + if ((res = mp_add(&w0, &w1, b)) != MP_OKAY) { + goto ERR; + } + if ((res = mp_add(&w2, &w3, &tmp1)) != MP_OKAY) { + goto ERR; + } + if ((res = mp_add(&w4, &tmp1, &tmp1)) != MP_OKAY) { + goto ERR; + } + if ((res = mp_add(&tmp1, b, b)) != MP_OKAY) { + goto ERR; + } + +ERR: + mp_clear_multi(&w0, &w1, &w2, &w3, &w4, &a0, &a1, &a2, &tmp1, NULL); + return res; +} + +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_toom_sqr.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_toradix.c b/dep/StormLib/src/libtommath/bn_mp_toradix.c new file mode 100644 index 00000000000..539abe9ba6d --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_toradix.c @@ -0,0 +1,75 @@ +#include "tommath.h" +#ifdef BN_MP_TORADIX_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* stores a bignum as a ASCII string in a given radix (2..64) */ +int mp_toradix (mp_int * a, char *str, int radix) +{ + int res, digs; + mp_int t; + mp_digit d; + char *_s = str; + + /* check range of the radix */ + if (radix < 2 || radix > 64) { + return MP_VAL; + } + + /* quick out if its zero */ + if (mp_iszero(a) == 1) { + *str++ = '0'; + *str = '\0'; + return MP_OKAY; + } + + if ((res = mp_init_copy (&t, a)) != MP_OKAY) { + return res; + } + + /* if it is negative output a - */ + if (t.sign == MP_NEG) { + ++_s; + *str++ = '-'; + t.sign = MP_ZPOS; + } + + digs = 0; + while (mp_iszero (&t) == 0) { + if ((res = mp_div_d (&t, (mp_digit) radix, &t, &d)) != MP_OKAY) { + mp_clear (&t); + return res; + } + *str++ = mp_s_rmap[d]; + ++digs; + } + + /* reverse the digits of the string. In this case _s points + * to the first digit [exluding the sign] of the number] + */ + bn_reverse ((unsigned char *)_s, digs); + + /* append a NULL so the string is properly terminated */ + *str = '\0'; + + mp_clear (&t); + return MP_OKAY; +} + +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_toradix.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_toradix_n.c b/dep/StormLib/src/libtommath/bn_mp_toradix_n.c new file mode 100644 index 00000000000..0322f8d4b2a --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_toradix_n.c @@ -0,0 +1,88 @@ +#include "tommath.h" +#ifdef BN_MP_TORADIX_N_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* stores a bignum as a ASCII string in a given radix (2..64) + * + * Stores upto maxlen-1 chars and always a NULL byte + */ +int mp_toradix_n(mp_int * a, char *str, int radix, int maxlen) +{ + int res, digs; + mp_int t; + mp_digit d; + char *_s = str; + + /* check range of the maxlen, radix */ + if (maxlen < 2 || radix < 2 || radix > 64) { + return MP_VAL; + } + + /* quick out if its zero */ + if (mp_iszero(a) == MP_YES) { + *str++ = '0'; + *str = '\0'; + return MP_OKAY; + } + + if ((res = mp_init_copy (&t, a)) != MP_OKAY) { + return res; + } + + /* if it is negative output a - */ + if (t.sign == MP_NEG) { + /* we have to reverse our digits later... but not the - sign!! */ + ++_s; + + /* store the flag and mark the number as positive */ + *str++ = '-'; + t.sign = MP_ZPOS; + + /* subtract a char */ + --maxlen; + } + + digs = 0; + while (mp_iszero (&t) == 0) { + if (--maxlen < 1) { + /* no more room */ + break; + } + if ((res = mp_div_d (&t, (mp_digit) radix, &t, &d)) != MP_OKAY) { + mp_clear (&t); + return res; + } + *str++ = mp_s_rmap[d]; + ++digs; + } + + /* reverse the digits of the string. In this case _s points + * to the first digit [exluding the sign] of the number + */ + bn_reverse ((unsigned char *)_s, digs); + + /* append a NULL so the string is properly terminated */ + *str = '\0'; + + mp_clear (&t); + return MP_OKAY; +} + +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_toradix_n.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_unsigned_bin_size.c b/dep/StormLib/src/libtommath/bn_mp_unsigned_bin_size.c new file mode 100644 index 00000000000..88f3e92dde8 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_unsigned_bin_size.c @@ -0,0 +1,28 @@ +#include "tommath.h" +#ifdef BN_MP_UNSIGNED_BIN_SIZE_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* get the size for an unsigned equivalent */ +int mp_unsigned_bin_size (mp_int * a) +{ + int size = mp_count_bits (a); + return (size / 8 + ((size & 7) != 0 ? 1 : 0)); +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_unsigned_bin_size.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_xor.c b/dep/StormLib/src/libtommath/bn_mp_xor.c new file mode 100644 index 00000000000..bf0446ecfe8 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_xor.c @@ -0,0 +1,51 @@ +#include "tommath.h" +#ifdef BN_MP_XOR_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* XOR two ints together */ +int +mp_xor (mp_int * a, mp_int * b, mp_int * c) +{ + int res, ix, px; + mp_int t, *x; + + if (a->used > b->used) { + if ((res = mp_init_copy (&t, a)) != MP_OKAY) { + return res; + } + px = b->used; + x = b; + } else { + if ((res = mp_init_copy (&t, b)) != MP_OKAY) { + return res; + } + px = a->used; + x = a; + } + + for (ix = 0; ix < px; ix++) { + t.dp[ix] ^= x->dp[ix]; + } + mp_clamp (&t); + mp_exch (c, &t); + mp_clear (&t); + return MP_OKAY; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_xor.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_mp_zero.c b/dep/StormLib/src/libtommath/bn_mp_zero.c new file mode 100644 index 00000000000..f21db5ed589 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_mp_zero.c @@ -0,0 +1,36 @@ +#include "tommath.h" +#ifdef BN_MP_ZERO_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* set to zero */ +void mp_zero (mp_int * a) +{ + int n; + mp_digit *tmp; + + a->sign = MP_ZPOS; + a->used = 0; + + tmp = a->dp; + for (n = 0; n < a->alloc; n++) { + *tmp++ = 0; + } +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_mp_zero.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_prime_tab.c b/dep/StormLib/src/libtommath/bn_prime_tab.c new file mode 100644 index 00000000000..7d306dd56a6 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_prime_tab.c @@ -0,0 +1,61 @@ +#include "tommath.h" +#ifdef BN_PRIME_TAB_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +const mp_digit ltm_prime_tab[] = { + 0x0002, 0x0003, 0x0005, 0x0007, 0x000B, 0x000D, 0x0011, 0x0013, + 0x0017, 0x001D, 0x001F, 0x0025, 0x0029, 0x002B, 0x002F, 0x0035, + 0x003B, 0x003D, 0x0043, 0x0047, 0x0049, 0x004F, 0x0053, 0x0059, + 0x0061, 0x0065, 0x0067, 0x006B, 0x006D, 0x0071, 0x007F, +#ifndef MP_8BIT + 0x0083, + 0x0089, 0x008B, 0x0095, 0x0097, 0x009D, 0x00A3, 0x00A7, 0x00AD, + 0x00B3, 0x00B5, 0x00BF, 0x00C1, 0x00C5, 0x00C7, 0x00D3, 0x00DF, + 0x00E3, 0x00E5, 0x00E9, 0x00EF, 0x00F1, 0x00FB, 0x0101, 0x0107, + 0x010D, 0x010F, 0x0115, 0x0119, 0x011B, 0x0125, 0x0133, 0x0137, + + 0x0139, 0x013D, 0x014B, 0x0151, 0x015B, 0x015D, 0x0161, 0x0167, + 0x016F, 0x0175, 0x017B, 0x017F, 0x0185, 0x018D, 0x0191, 0x0199, + 0x01A3, 0x01A5, 0x01AF, 0x01B1, 0x01B7, 0x01BB, 0x01C1, 0x01C9, + 0x01CD, 0x01CF, 0x01D3, 0x01DF, 0x01E7, 0x01EB, 0x01F3, 0x01F7, + 0x01FD, 0x0209, 0x020B, 0x021D, 0x0223, 0x022D, 0x0233, 0x0239, + 0x023B, 0x0241, 0x024B, 0x0251, 0x0257, 0x0259, 0x025F, 0x0265, + 0x0269, 0x026B, 0x0277, 0x0281, 0x0283, 0x0287, 0x028D, 0x0293, + 0x0295, 0x02A1, 0x02A5, 0x02AB, 0x02B3, 0x02BD, 0x02C5, 0x02CF, + + 0x02D7, 0x02DD, 0x02E3, 0x02E7, 0x02EF, 0x02F5, 0x02F9, 0x0301, + 0x0305, 0x0313, 0x031D, 0x0329, 0x032B, 0x0335, 0x0337, 0x033B, + 0x033D, 0x0347, 0x0355, 0x0359, 0x035B, 0x035F, 0x036D, 0x0371, + 0x0373, 0x0377, 0x038B, 0x038F, 0x0397, 0x03A1, 0x03A9, 0x03AD, + 0x03B3, 0x03B9, 0x03C7, 0x03CB, 0x03D1, 0x03D7, 0x03DF, 0x03E5, + 0x03F1, 0x03F5, 0x03FB, 0x03FD, 0x0407, 0x0409, 0x040F, 0x0419, + 0x041B, 0x0425, 0x0427, 0x042D, 0x043F, 0x0443, 0x0445, 0x0449, + 0x044F, 0x0455, 0x045D, 0x0463, 0x0469, 0x047F, 0x0481, 0x048B, + + 0x0493, 0x049D, 0x04A3, 0x04A9, 0x04B1, 0x04BD, 0x04C1, 0x04C7, + 0x04CD, 0x04CF, 0x04D5, 0x04E1, 0x04EB, 0x04FD, 0x04FF, 0x0503, + 0x0509, 0x050B, 0x0511, 0x0515, 0x0517, 0x051B, 0x0527, 0x0529, + 0x052F, 0x0551, 0x0557, 0x055D, 0x0565, 0x0577, 0x0581, 0x058F, + 0x0593, 0x0595, 0x0599, 0x059F, 0x05A7, 0x05AB, 0x05AD, 0x05B3, + 0x05BF, 0x05C9, 0x05CB, 0x05CF, 0x05D1, 0x05D5, 0x05DB, 0x05E7, + 0x05F3, 0x05FB, 0x0607, 0x060D, 0x0611, 0x0617, 0x061F, 0x0623, + 0x062B, 0x062F, 0x063D, 0x0641, 0x0647, 0x0649, 0x064D, 0x0653 +#endif +}; +#endif + +/* $Source: /cvs/libtom/libtommath/bn_prime_tab.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_reverse.c b/dep/StormLib/src/libtommath/bn_reverse.c new file mode 100644 index 00000000000..d4a919af486 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_reverse.c @@ -0,0 +1,39 @@ +#include "tommath.h" +#ifdef BN_REVERSE_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* reverse an array, used for radix code */ +void +bn_reverse (unsigned char *s, int len) +{ + int ix, iy; + unsigned char t; + + ix = 0; + iy = len - 1; + while (ix < iy) { + t = s[ix]; + s[ix] = s[iy]; + s[iy] = t; + ++ix; + --iy; + } +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_reverse.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_s_mp_add.c b/dep/StormLib/src/libtommath/bn_s_mp_add.c new file mode 100644 index 00000000000..5ea9c6d205c --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_s_mp_add.c @@ -0,0 +1,109 @@ +#include "tommath.h" +#ifdef BN_S_MP_ADD_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* low level addition, based on HAC pp.594, Algorithm 14.7 */ +int +s_mp_add (mp_int * a, mp_int * b, mp_int * c) +{ + mp_int *x; + int olduse, res, min, max; + + /* find sizes, we let |a| <= |b| which means we have to sort + * them. "x" will point to the input with the most digits + */ + if (a->used > b->used) { + min = b->used; + max = a->used; + x = a; + } else { + min = a->used; + max = b->used; + x = b; + } + + /* init result */ + if (c->alloc < max + 1) { + if ((res = mp_grow (c, max + 1)) != MP_OKAY) { + return res; + } + } + + /* get old used digit count and set new one */ + olduse = c->used; + c->used = max + 1; + + { + register mp_digit u, *tmpa, *tmpb, *tmpc; + register int i; + + /* alias for digit pointers */ + + /* first input */ + tmpa = a->dp; + + /* second input */ + tmpb = b->dp; + + /* destination */ + tmpc = c->dp; + + /* zero the carry */ + u = 0; + for (i = 0; i < min; i++) { + /* Compute the sum at one digit, T[i] = A[i] + B[i] + U */ + *tmpc = *tmpa++ + *tmpb++ + u; + + /* U = carry bit of T[i] */ + u = *tmpc >> ((mp_digit)DIGIT_BIT); + + /* take away carry bit from T[i] */ + *tmpc++ &= MP_MASK; + } + + /* now copy higher words if any, that is in A+B + * if A or B has more digits add those in + */ + if (min != max) { + for (; i < max; i++) { + /* T[i] = X[i] + U */ + *tmpc = x->dp[i] + u; + + /* U = carry bit of T[i] */ + u = *tmpc >> ((mp_digit)DIGIT_BIT); + + /* take away carry bit from T[i] */ + *tmpc++ &= MP_MASK; + } + } + + /* add carry */ + *tmpc++ = u; + + /* clear digits above oldused */ + for (i = c->used; i < olduse; i++) { + *tmpc++ = 0; + } + } + + mp_clamp (c); + return MP_OKAY; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_s_mp_add.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_s_mp_exptmod.c b/dep/StormLib/src/libtommath/bn_s_mp_exptmod.c new file mode 100644 index 00000000000..9fb2da8fd21 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_s_mp_exptmod.c @@ -0,0 +1,252 @@ +#include "tommath.h" +#ifdef BN_S_MP_EXPTMOD_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ +#ifdef MP_LOW_MEM + #define TAB_SIZE 32 +#else + #define TAB_SIZE 256 +#endif + +int s_mp_exptmod (mp_int * G, mp_int * X, mp_int * P, mp_int * Y, int redmode) +{ + mp_int M[TAB_SIZE], res, mu; + mp_digit buf; + int err, bitbuf, bitcpy, bitcnt, mode, digidx, x, y, winsize; + int (*redux)(mp_int*,mp_int*,mp_int*); + + /* find window size */ + x = mp_count_bits (X); + if (x <= 7) { + winsize = 2; + } else if (x <= 36) { + winsize = 3; + } else if (x <= 140) { + winsize = 4; + } else if (x <= 450) { + winsize = 5; + } else if (x <= 1303) { + winsize = 6; + } else if (x <= 3529) { + winsize = 7; + } else { + winsize = 8; + } + +#ifdef MP_LOW_MEM + if (winsize > 5) { + winsize = 5; + } +#endif + + /* init M array */ + /* init first cell */ + if ((err = mp_init(&M[1])) != MP_OKAY) { + return err; + } + + /* now init the second half of the array */ + for (x = 1<<(winsize-1); x < (1 << winsize); x++) { + if ((err = mp_init(&M[x])) != MP_OKAY) { + for (y = 1<<(winsize-1); y < x; y++) { + mp_clear (&M[y]); + } + mp_clear(&M[1]); + return err; + } + } + + /* create mu, used for Barrett reduction */ + if ((err = mp_init (&mu)) != MP_OKAY) { + goto LBL_M; + } + + if (redmode == 0) { + if ((err = mp_reduce_setup (&mu, P)) != MP_OKAY) { + goto LBL_MU; + } + redux = mp_reduce; + } else { + if ((err = mp_reduce_2k_setup_l (P, &mu)) != MP_OKAY) { + goto LBL_MU; + } + redux = mp_reduce_2k_l; + } + + /* create M table + * + * The M table contains powers of the base, + * e.g. M[x] = G**x mod P + * + * The first half of the table is not + * computed though accept for M[0] and M[1] + */ + if ((err = mp_mod (G, P, &M[1])) != MP_OKAY) { + goto LBL_MU; + } + + /* compute the value at M[1<<(winsize-1)] by squaring + * M[1] (winsize-1) times + */ + if ((err = mp_copy (&M[1], &M[1 << (winsize - 1)])) != MP_OKAY) { + goto LBL_MU; + } + + for (x = 0; x < (winsize - 1); x++) { + /* square it */ + if ((err = mp_sqr (&M[1 << (winsize - 1)], + &M[1 << (winsize - 1)])) != MP_OKAY) { + goto LBL_MU; + } + + /* reduce modulo P */ + if ((err = redux (&M[1 << (winsize - 1)], P, &mu)) != MP_OKAY) { + goto LBL_MU; + } + } + + /* create upper table, that is M[x] = M[x-1] * M[1] (mod P) + * for x = (2**(winsize - 1) + 1) to (2**winsize - 1) + */ + for (x = (1 << (winsize - 1)) + 1; x < (1 << winsize); x++) { + if ((err = mp_mul (&M[x - 1], &M[1], &M[x])) != MP_OKAY) { + goto LBL_MU; + } + if ((err = redux (&M[x], P, &mu)) != MP_OKAY) { + goto LBL_MU; + } + } + + /* setup result */ + if ((err = mp_init (&res)) != MP_OKAY) { + goto LBL_MU; + } + mp_set (&res, 1); + + /* set initial mode and bit cnt */ + mode = 0; + bitcnt = 1; + buf = 0; + digidx = X->used - 1; + bitcpy = 0; + bitbuf = 0; + + for (;;) { + /* grab next digit as required */ + if (--bitcnt == 0) { + /* if digidx == -1 we are out of digits */ + if (digidx == -1) { + break; + } + /* read next digit and reset the bitcnt */ + buf = X->dp[digidx--]; + bitcnt = (int) DIGIT_BIT; + } + + /* grab the next msb from the exponent */ + y = (buf >> (mp_digit)(DIGIT_BIT - 1)) & 1; + buf <<= (mp_digit)1; + + /* if the bit is zero and mode == 0 then we ignore it + * These represent the leading zero bits before the first 1 bit + * in the exponent. Technically this opt is not required but it + * does lower the # of trivial squaring/reductions used + */ + if (mode == 0 && y == 0) { + continue; + } + + /* if the bit is zero and mode == 1 then we square */ + if (mode == 1 && y == 0) { + if ((err = mp_sqr (&res, &res)) != MP_OKAY) { + goto LBL_RES; + } + if ((err = redux (&res, P, &mu)) != MP_OKAY) { + goto LBL_RES; + } + continue; + } + + /* else we add it to the window */ + bitbuf |= (y << (winsize - ++bitcpy)); + mode = 2; + + if (bitcpy == winsize) { + /* ok window is filled so square as required and multiply */ + /* square first */ + for (x = 0; x < winsize; x++) { + if ((err = mp_sqr (&res, &res)) != MP_OKAY) { + goto LBL_RES; + } + if ((err = redux (&res, P, &mu)) != MP_OKAY) { + goto LBL_RES; + } + } + + /* then multiply */ + if ((err = mp_mul (&res, &M[bitbuf], &res)) != MP_OKAY) { + goto LBL_RES; + } + if ((err = redux (&res, P, &mu)) != MP_OKAY) { + goto LBL_RES; + } + + /* empty window and reset */ + bitcpy = 0; + bitbuf = 0; + mode = 1; + } + } + + /* if bits remain then square/multiply */ + if (mode == 2 && bitcpy > 0) { + /* square then multiply if the bit is set */ + for (x = 0; x < bitcpy; x++) { + if ((err = mp_sqr (&res, &res)) != MP_OKAY) { + goto LBL_RES; + } + if ((err = redux (&res, P, &mu)) != MP_OKAY) { + goto LBL_RES; + } + + bitbuf <<= 1; + if ((bitbuf & (1 << winsize)) != 0) { + /* then multiply */ + if ((err = mp_mul (&res, &M[1], &res)) != MP_OKAY) { + goto LBL_RES; + } + if ((err = redux (&res, P, &mu)) != MP_OKAY) { + goto LBL_RES; + } + } + } + } + + mp_exch (&res, Y); + err = MP_OKAY; +LBL_RES:mp_clear (&res); +LBL_MU:mp_clear (&mu); +LBL_M: + mp_clear(&M[1]); + for (x = 1<<(winsize-1); x < (1 << winsize); x++) { + mp_clear (&M[x]); + } + return err; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_s_mp_exptmod.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_s_mp_mul_digs.c b/dep/StormLib/src/libtommath/bn_s_mp_mul_digs.c new file mode 100644 index 00000000000..f04dacfb9ea --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_s_mp_mul_digs.c @@ -0,0 +1,90 @@ +#include "tommath.h" +#ifdef BN_S_MP_MUL_DIGS_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* multiplies |a| * |b| and only computes upto digs digits of result + * HAC pp. 595, Algorithm 14.12 Modified so you can control how + * many digits of output are created. + */ +int s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs) +{ + mp_int t; + int res, pa, pb, ix, iy; + mp_digit u; + mp_word r; + mp_digit tmpx, *tmpt, *tmpy; + + /* can we use the fast multiplier? */ + if (((digs) < MP_WARRAY) && + MIN (a->used, b->used) < + (1 << ((CHAR_BIT * sizeof (mp_word)) - (2 * DIGIT_BIT)))) { + return fast_s_mp_mul_digs (a, b, c, digs); + } + + if ((res = mp_init_size (&t, digs)) != MP_OKAY) { + return res; + } + t.used = digs; + + /* compute the digits of the product directly */ + pa = a->used; + for (ix = 0; ix < pa; ix++) { + /* set the carry to zero */ + u = 0; + + /* limit ourselves to making digs digits of output */ + pb = MIN (b->used, digs - ix); + + /* setup some aliases */ + /* copy of the digit from a used within the nested loop */ + tmpx = a->dp[ix]; + + /* an alias for the destination shifted ix places */ + tmpt = t.dp + ix; + + /* an alias for the digits of b */ + tmpy = b->dp; + + /* compute the columns of the output and propagate the carry */ + for (iy = 0; iy < pb; iy++) { + /* compute the column as a mp_word */ + r = ((mp_word)*tmpt) + + ((mp_word)tmpx) * ((mp_word)*tmpy++) + + ((mp_word) u); + + /* the new column is the lower part of the result */ + *tmpt++ = (mp_digit) (r & ((mp_word) MP_MASK)); + + /* get the carry word from the result */ + u = (mp_digit) (r >> ((mp_word) DIGIT_BIT)); + } + /* set carry if it is placed below digs */ + if (ix + iy < digs) { + *tmpt = u; + } + } + + mp_clamp (&t); + mp_exch (&t, c); + + mp_clear (&t); + return MP_OKAY; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_s_mp_mul_digs.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_s_mp_mul_high_digs.c b/dep/StormLib/src/libtommath/bn_s_mp_mul_high_digs.c new file mode 100644 index 00000000000..b1d019925a6 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_s_mp_mul_high_digs.c @@ -0,0 +1,81 @@ +#include "tommath.h" +#ifdef BN_S_MP_MUL_HIGH_DIGS_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* multiplies |a| * |b| and does not compute the lower digs digits + * [meant to get the higher part of the product] + */ +int +s_mp_mul_high_digs (mp_int * a, mp_int * b, mp_int * c, int digs) +{ + mp_int t; + int res, pa, pb, ix, iy; + mp_digit u; + mp_word r; + mp_digit tmpx, *tmpt, *tmpy; + + /* can we use the fast multiplier? */ +#ifdef BN_FAST_S_MP_MUL_HIGH_DIGS_C + if (((a->used + b->used + 1) < MP_WARRAY) + && MIN (a->used, b->used) < (1 << ((CHAR_BIT * sizeof (mp_word)) - (2 * DIGIT_BIT)))) { + return fast_s_mp_mul_high_digs (a, b, c, digs); + } +#endif + + if ((res = mp_init_size (&t, a->used + b->used + 1)) != MP_OKAY) { + return res; + } + t.used = a->used + b->used + 1; + + pa = a->used; + pb = b->used; + for (ix = 0; ix < pa; ix++) { + /* clear the carry */ + u = 0; + + /* left hand side of A[ix] * B[iy] */ + tmpx = a->dp[ix]; + + /* alias to the address of where the digits will be stored */ + tmpt = &(t.dp[digs]); + + /* alias for where to read the right hand side from */ + tmpy = b->dp + (digs - ix); + + for (iy = digs - ix; iy < pb; iy++) { + /* calculate the double precision result */ + r = ((mp_word)*tmpt) + + ((mp_word)tmpx) * ((mp_word)*tmpy++) + + ((mp_word) u); + + /* get the lower part */ + *tmpt++ = (mp_digit) (r & ((mp_word) MP_MASK)); + + /* carry the carry */ + u = (mp_digit) (r >> ((mp_word) DIGIT_BIT)); + } + *tmpt = u; + } + mp_clamp (&t); + mp_exch (&t, c); + mp_clear (&t); + return MP_OKAY; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_s_mp_mul_high_digs.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_s_mp_sqr.c b/dep/StormLib/src/libtommath/bn_s_mp_sqr.c new file mode 100644 index 00000000000..c1e994efddf --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_s_mp_sqr.c @@ -0,0 +1,84 @@ +#include "tommath.h" +#ifdef BN_S_MP_SQR_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* low level squaring, b = a*a, HAC pp.596-597, Algorithm 14.16 */ +int s_mp_sqr (mp_int * a, mp_int * b) +{ + mp_int t; + int res, ix, iy, pa; + mp_word r; + mp_digit u, tmpx, *tmpt; + + pa = a->used; + if ((res = mp_init_size (&t, 2*pa + 1)) != MP_OKAY) { + return res; + } + + /* default used is maximum possible size */ + t.used = 2*pa + 1; + + for (ix = 0; ix < pa; ix++) { + /* first calculate the digit at 2*ix */ + /* calculate double precision result */ + r = ((mp_word) t.dp[2*ix]) + + ((mp_word)a->dp[ix])*((mp_word)a->dp[ix]); + + /* store lower part in result */ + t.dp[ix+ix] = (mp_digit) (r & ((mp_word) MP_MASK)); + + /* get the carry */ + u = (mp_digit)(r >> ((mp_word) DIGIT_BIT)); + + /* left hand side of A[ix] * A[iy] */ + tmpx = a->dp[ix]; + + /* alias for where to store the results */ + tmpt = t.dp + (2*ix + 1); + + for (iy = ix + 1; iy < pa; iy++) { + /* first calculate the product */ + r = ((mp_word)tmpx) * ((mp_word)a->dp[iy]); + + /* now calculate the double precision result, note we use + * addition instead of *2 since it's easier to optimize + */ + r = ((mp_word) *tmpt) + r + r + ((mp_word) u); + + /* store lower part */ + *tmpt++ = (mp_digit) (r & ((mp_word) MP_MASK)); + + /* get carry */ + u = (mp_digit)(r >> ((mp_word) DIGIT_BIT)); + } + /* propagate upwards */ + while (u != ((mp_digit) 0)) { + r = ((mp_word) *tmpt) + ((mp_word) u); + *tmpt++ = (mp_digit) (r & ((mp_word) MP_MASK)); + u = (mp_digit)(r >> ((mp_word) DIGIT_BIT)); + } + } + + mp_clamp (&t); + mp_exch (&t, b); + mp_clear (&t); + return MP_OKAY; +} +#endif + +/* $Source: /cvs/libtom/libtommath/bn_s_mp_sqr.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bn_s_mp_sub.c b/dep/StormLib/src/libtommath/bn_s_mp_sub.c new file mode 100644 index 00000000000..0ae91cc4d17 --- /dev/null +++ b/dep/StormLib/src/libtommath/bn_s_mp_sub.c @@ -0,0 +1,89 @@ +#include "tommath.h" +#ifdef BN_S_MP_SUB_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* low level subtraction (assumes |a| > |b|), HAC pp.595 Algorithm 14.9 */ +int +s_mp_sub (mp_int * a, mp_int * b, mp_int * c) +{ + int olduse, res, min, max; + + /* find sizes */ + min = b->used; + max = a->used; + + /* init result */ + if (c->alloc < max) { + if ((res = mp_grow (c, max)) != MP_OKAY) { + return res; + } + } + olduse = c->used; + c->used = max; + + { + register mp_digit u, *tmpa, *tmpb, *tmpc; + register int i; + + /* alias for digit pointers */ + tmpa = a->dp; + tmpb = b->dp; + tmpc = c->dp; + + /* set carry to zero */ + u = 0; + for (i = 0; i < min; i++) { + /* T[i] = A[i] - B[i] - U */ + *tmpc = *tmpa++ - *tmpb++ - u; + + /* U = carry bit of T[i] + * Note this saves performing an AND operation since + * if a carry does occur it will propagate all the way to the + * MSB. As a result a single shift is enough to get the carry + */ + u = *tmpc >> ((mp_digit)(CHAR_BIT * sizeof (mp_digit) - 1)); + + /* Clear carry from T[i] */ + *tmpc++ &= MP_MASK; + } + + /* now copy higher words if any, e.g. if A has more digits than B */ + for (; i < max; i++) { + /* T[i] = A[i] - U */ + *tmpc = *tmpa++ - u; + + /* U = carry bit of T[i] */ + u = *tmpc >> ((mp_digit)(CHAR_BIT * sizeof (mp_digit) - 1)); + + /* Clear carry from T[i] */ + *tmpc++ &= MP_MASK; + } + + /* clear digits above used (since we may not have grown result above) */ + for (i = c->used; i < olduse; i++) { + *tmpc++ = 0; + } + } + + mp_clamp (c); + return MP_OKAY; +} + +#endif + +/* $Source: /cvs/libtom/libtommath/bn_s_mp_sub.c,v $ */ +/* $Revision: 1.4 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/bncore.c b/dep/StormLib/src/libtommath/bncore.c new file mode 100644 index 00000000000..ad7347f8424 --- /dev/null +++ b/dep/StormLib/src/libtommath/bncore.c @@ -0,0 +1,36 @@ +#include "tommath.h" +#ifdef BNCORE_C +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://libtom.org + */ + +/* Known optimal configurations + + CPU /Compiler /MUL CUTOFF/SQR CUTOFF +------------------------------------------------------------- + Intel P4 Northwood /GCC v3.4.1 / 88/ 128/LTM 0.32 ;-) + AMD Athlon64 /GCC v3.4.4 / 80/ 120/LTM 0.35 + +*/ + +int KARATSUBA_MUL_CUTOFF = 80, /* Min. number of digits before Karatsuba multiplication is used. */ + KARATSUBA_SQR_CUTOFF = 120, /* Min. number of digits before Karatsuba squaring is used. */ + + TOOM_MUL_CUTOFF = 350, /* no optimal values of these are known yet so set em high */ + TOOM_SQR_CUTOFF = 400; +#endif + +/* $Source: /cvs/libtom/libtommath/bncore.c,v $ */ +/* $Revision: 1.5 $ */ +/* $Date: 2006/12/28 01:25:13 $ */ diff --git a/dep/StormLib/src/libtommath/tommath.h b/dep/StormLib/src/libtommath/tommath.h new file mode 100644 index 00000000000..1ead3d04bf5 --- /dev/null +++ b/dep/StormLib/src/libtommath/tommath.h @@ -0,0 +1,584 @@ +/* LibTomMath, multiple-precision integer library -- Tom St Denis + * + * LibTomMath is a library that provides multiple-precision + * integer arithmetic as well as number theoretic functionality. + * + * The library was designed directly after the MPI library by + * Michael Fromberger but has been written from scratch with + * additional optimizations in place. + * + * The library is free for all purposes without any express + * guarantee it works. + * + * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com + */ +#ifndef BN_H_ +#define BN_H_ + +#include +#include +#include +#include +#include + +#include "tommath_class.h" + +#ifndef MIN + #define MIN(x,y) ((x)<(y)?(x):(y)) +#endif + +#ifndef MAX + #define MAX(x,y) ((x)>(y)?(x):(y)) +#endif + +#ifdef __cplusplus +extern "C" { + +/* C++ compilers don't like assigning void * to mp_digit * */ +#define OPT_CAST(x) (x *) + +#else + +/* C on the other hand doesn't care */ +#define OPT_CAST(x) + +#endif + + +/* detect 64-bit mode if possible */ +#if defined(__x86_64__) + #if !(defined(MP_64BIT) && defined(MP_16BIT) && defined(MP_8BIT)) + #define MP_64BIT + #endif +#endif + +/* some default configurations. + * + * A "mp_digit" must be able to hold DIGIT_BIT + 1 bits + * A "mp_word" must be able to hold 2*DIGIT_BIT + 1 bits + * + * At the very least a mp_digit must be able to hold 7 bits + * [any size beyond that is ok provided it doesn't overflow the data type] + */ +#ifdef MP_8BIT + typedef unsigned char mp_digit; + typedef unsigned short mp_word; +#elif defined(MP_16BIT) + typedef unsigned short mp_digit; + typedef unsigned long mp_word; +#elif defined(MP_64BIT) + /* for GCC only on supported platforms */ +#ifndef CRYPT + typedef unsigned long long ulong64; + typedef signed long long long64; +#endif + + typedef unsigned long mp_digit; + typedef unsigned long mp_word __attribute__ ((mode(TI))); + + #define DIGIT_BIT 60 +#else + /* this is the default case, 28-bit digits */ + + /* this is to make porting into LibTomCrypt easier :-) */ +#ifndef CRYPT + #if defined(_MSC_VER) || defined(__BORLANDC__) + typedef unsigned __int64 ulong64; + typedef signed __int64 long64; + #else + typedef unsigned long long ulong64; + typedef signed long long long64; + #endif +#endif + + typedef unsigned long mp_digit; + typedef ulong64 mp_word; + +#ifdef MP_31BIT + /* this is an extension that uses 31-bit digits */ + #define DIGIT_BIT 31 +#else + /* default case is 28-bit digits, defines MP_28BIT as a handy macro to test */ + #define DIGIT_BIT 28 + #define MP_28BIT +#endif +#endif + +/* define heap macros */ +#ifndef CRYPT + /* default to libc stuff */ + #ifndef XMALLOC + #define XMALLOC malloc + #define XFREE free + #define XREALLOC realloc + #define XCALLOC calloc + #else + /* prototypes for our heap functions */ + extern void *XMALLOC(size_t n); + extern void *XREALLOC(void *p, size_t n); + extern void *XCALLOC(size_t n, size_t s); + extern void XFREE(void *p); + #endif +#endif + + +/* otherwise the bits per digit is calculated automatically from the size of a mp_digit */ +#ifndef DIGIT_BIT + #define DIGIT_BIT ((int)((CHAR_BIT * sizeof(mp_digit) - 1))) /* bits per digit */ +#endif + +#define MP_DIGIT_BIT DIGIT_BIT +#define MP_MASK ((((mp_digit)1)<<((mp_digit)DIGIT_BIT))-((mp_digit)1)) +#define MP_DIGIT_MAX MP_MASK + +/* equalities */ +#define MP_LT -1 /* less than */ +#define MP_EQ 0 /* equal to */ +#define MP_GT 1 /* greater than */ + +#define MP_ZPOS 0 /* positive integer */ +#define MP_NEG 1 /* negative */ + +#define MP_OKAY 0 /* ok result */ +#define MP_MEM -2 /* out of mem */ +#define MP_VAL -3 /* invalid input */ +#define MP_RANGE MP_VAL + +#define MP_YES 1 /* yes response */ +#define MP_NO 0 /* no response */ + +/* Primality generation flags */ +#define LTM_PRIME_BBS 0x0001 /* BBS style prime */ +#define LTM_PRIME_SAFE 0x0002 /* Safe prime (p-1)/2 == prime */ +#define LTM_PRIME_2MSB_ON 0x0008 /* force 2nd MSB to 1 */ + +typedef int mp_err; + +/* you'll have to tune these... */ +extern int KARATSUBA_MUL_CUTOFF, + KARATSUBA_SQR_CUTOFF, + TOOM_MUL_CUTOFF, + TOOM_SQR_CUTOFF; + +/* define this to use lower memory usage routines (exptmods mostly) */ +/* #define MP_LOW_MEM */ + +/* default precision */ +#ifndef MP_PREC + #ifndef MP_LOW_MEM + #define MP_PREC 32 /* default digits of precision */ + #else + #define MP_PREC 8 /* default digits of precision */ + #endif +#endif + +/* size of comba arrays, should be at least 2 * 2**(BITS_PER_WORD - BITS_PER_DIGIT*2) */ +#define MP_WARRAY (1 << (sizeof(mp_word) * CHAR_BIT - 2 * DIGIT_BIT + 1)) + +/* the infamous mp_int structure */ +typedef struct { + int used, alloc, sign; + mp_digit *dp; +} mp_int; + +/* callback for mp_prime_random, should fill dst with random bytes and return how many read [upto len] */ +typedef int ltm_prime_callback(unsigned char *dst, int len, void *dat); + + +#define USED(m) ((m)->used) +#define DIGIT(m,k) ((m)->dp[(k)]) +#define SIGN(m) ((m)->sign) + +/* error code to char* string */ +char *mp_error_to_string(int code); + +/* ---> init and deinit bignum functions <--- */ +/* init a bignum */ +int mp_init(mp_int *a); + +/* free a bignum */ +void mp_clear(mp_int *a); + +/* init a null terminated series of arguments */ +int mp_init_multi(mp_int *mp, ...); + +/* clear a null terminated series of arguments */ +void mp_clear_multi(mp_int *mp, ...); + +/* exchange two ints */ +void mp_exch(mp_int *a, mp_int *b); + +/* shrink ram required for a bignum */ +int mp_shrink(mp_int *a); + +/* grow an int to a given size */ +int mp_grow(mp_int *a, int size); + +/* init to a given number of digits */ +int mp_init_size(mp_int *a, int size); + +/* ---> Basic Manipulations <--- */ +#define mp_iszero(a) (((a)->used == 0) ? MP_YES : MP_NO) +#define mp_iseven(a) (((a)->used > 0 && (((a)->dp[0] & 1) == 0)) ? MP_YES : MP_NO) +#define mp_isodd(a) (((a)->used > 0 && (((a)->dp[0] & 1) == 1)) ? MP_YES : MP_NO) + +/* set to zero */ +void mp_zero(mp_int *a); + +/* set to a digit */ +void mp_set(mp_int *a, mp_digit b); + +/* set a 32-bit const */ +int mp_set_int(mp_int *a, unsigned long b); + +/* get a 32-bit value */ +unsigned long mp_get_int(mp_int * a); + +/* initialize and set a digit */ +int mp_init_set (mp_int * a, mp_digit b); + +/* initialize and set 32-bit value */ +int mp_init_set_int (mp_int * a, unsigned long b); + +/* copy, b = a */ +int mp_copy(mp_int *a, mp_int *b); + +/* inits and copies, a = b */ +int mp_init_copy(mp_int *a, mp_int *b); + +/* trim unused digits */ +void mp_clamp(mp_int *a); + +/* ---> digit manipulation <--- */ + +/* right shift by "b" digits */ +void mp_rshd(mp_int *a, int b); + +/* left shift by "b" digits */ +int mp_lshd(mp_int *a, int b); + +/* c = a / 2**b */ +int mp_div_2d(mp_int *a, int b, mp_int *c, mp_int *d); + +/* b = a/2 */ +int mp_div_2(mp_int *a, mp_int *b); + +/* c = a * 2**b */ +int mp_mul_2d(mp_int *a, int b, mp_int *c); + +/* b = a*2 */ +int mp_mul_2(mp_int *a, mp_int *b); + +/* c = a mod 2**d */ +int mp_mod_2d(mp_int *a, int b, mp_int *c); + +/* computes a = 2**b */ +int mp_2expt(mp_int *a, int b); + +/* Counts the number of lsbs which are zero before the first zero bit */ +int mp_cnt_lsb(mp_int *a); + +/* I Love Earth! */ + +/* makes a pseudo-random int of a given size */ +int mp_rand(mp_int *a, int digits); + +/* ---> binary operations <--- */ +/* c = a XOR b */ +int mp_xor(mp_int *a, mp_int *b, mp_int *c); + +/* c = a OR b */ +int mp_or(mp_int *a, mp_int *b, mp_int *c); + +/* c = a AND b */ +int mp_and(mp_int *a, mp_int *b, mp_int *c); + +/* ---> Basic arithmetic <--- */ + +/* b = -a */ +int mp_neg(mp_int *a, mp_int *b); + +/* b = |a| */ +int mp_abs(mp_int *a, mp_int *b); + +/* compare a to b */ +int mp_cmp(mp_int *a, mp_int *b); + +/* compare |a| to |b| */ +int mp_cmp_mag(mp_int *a, mp_int *b); + +/* c = a + b */ +int mp_add(mp_int *a, mp_int *b, mp_int *c); + +/* c = a - b */ +int mp_sub(mp_int *a, mp_int *b, mp_int *c); + +/* c = a * b */ +int mp_mul(mp_int *a, mp_int *b, mp_int *c); + +/* b = a*a */ +int mp_sqr(mp_int *a, mp_int *b); + +/* a/b => cb + d == a */ +int mp_div(mp_int *a, mp_int *b, mp_int *c, mp_int *d); + +/* c = a mod b, 0 <= c < b */ +int mp_mod(mp_int *a, mp_int *b, mp_int *c); + +/* ---> single digit functions <--- */ + +/* compare against a single digit */ +int mp_cmp_d(mp_int *a, mp_digit b); + +/* c = a + b */ +int mp_add_d(mp_int *a, mp_digit b, mp_int *c); + +/* c = a - b */ +int mp_sub_d(mp_int *a, mp_digit b, mp_int *c); + +/* c = a * b */ +int mp_mul_d(mp_int *a, mp_digit b, mp_int *c); + +/* a/b => cb + d == a */ +int mp_div_d(mp_int *a, mp_digit b, mp_int *c, mp_digit *d); + +/* a/3 => 3c + d == a */ +int mp_div_3(mp_int *a, mp_int *c, mp_digit *d); + +/* c = a**b */ +int mp_expt_d(mp_int *a, mp_digit b, mp_int *c); + +/* c = a mod b, 0 <= c < b */ +int mp_mod_d(mp_int *a, mp_digit b, mp_digit *c); + +/* ---> number theory <--- */ + +/* d = a + b (mod c) */ +int mp_addmod(mp_int *a, mp_int *b, mp_int *c, mp_int *d); + +/* d = a - b (mod c) */ +int mp_submod(mp_int *a, mp_int *b, mp_int *c, mp_int *d); + +/* d = a * b (mod c) */ +int mp_mulmod(mp_int *a, mp_int *b, mp_int *c, mp_int *d); + +/* c = a * a (mod b) */ +int mp_sqrmod(mp_int *a, mp_int *b, mp_int *c); + +/* c = 1/a (mod b) */ +int mp_invmod(mp_int *a, mp_int *b, mp_int *c); + +/* c = (a, b) */ +int mp_gcd(mp_int *a, mp_int *b, mp_int *c); + +/* produces value such that U1*a + U2*b = U3 */ +int mp_exteuclid(mp_int *a, mp_int *b, mp_int *U1, mp_int *U2, mp_int *U3); + +/* c = [a, b] or (a*b)/(a, b) */ +int mp_lcm(mp_int *a, mp_int *b, mp_int *c); + +/* finds one of the b'th root of a, such that |c|**b <= |a| + * + * returns error if a < 0 and b is even + */ +int mp_n_root(mp_int *a, mp_digit b, mp_int *c); + +/* special sqrt algo */ +int mp_sqrt(mp_int *arg, mp_int *ret); + +/* is number a square? */ +int mp_is_square(mp_int *arg, int *ret); + +/* computes the jacobi c = (a | n) (or Legendre if b is prime) */ +int mp_jacobi(mp_int *a, mp_int *n, int *c); + +/* used to setup the Barrett reduction for a given modulus b */ +int mp_reduce_setup(mp_int *a, mp_int *b); + +/* Barrett Reduction, computes a (mod b) with a precomputed value c + * + * Assumes that 0 < a <= b*b, note if 0 > a > -(b*b) then you can merely + * compute the reduction as -1 * mp_reduce(mp_abs(a)) [pseudo code]. + */ +int mp_reduce(mp_int *a, mp_int *b, mp_int *c); + +/* setups the montgomery reduction */ +int mp_montgomery_setup(mp_int *a, mp_digit *mp); + +/* computes a = B**n mod b without division or multiplication useful for + * normalizing numbers in a Montgomery system. + */ +int mp_montgomery_calc_normalization(mp_int *a, mp_int *b); + +/* computes x/R == x (mod N) via Montgomery Reduction */ +int mp_montgomery_reduce(mp_int *a, mp_int *m, mp_digit mp); + +/* returns 1 if a is a valid DR modulus */ +int mp_dr_is_modulus(mp_int *a); + +/* sets the value of "d" required for mp_dr_reduce */ +void mp_dr_setup(mp_int *a, mp_digit *d); + +/* reduces a modulo b using the Diminished Radix method */ +int mp_dr_reduce(mp_int *a, mp_int *b, mp_digit mp); + +/* returns true if a can be reduced with mp_reduce_2k */ +int mp_reduce_is_2k(mp_int *a); + +/* determines k value for 2k reduction */ +int mp_reduce_2k_setup(mp_int *a, mp_digit *d); + +/* reduces a modulo b where b is of the form 2**p - k [0 <= a] */ +int mp_reduce_2k(mp_int *a, mp_int *n, mp_digit d); + +/* returns true if a can be reduced with mp_reduce_2k_l */ +int mp_reduce_is_2k_l(mp_int *a); + +/* determines k value for 2k reduction */ +int mp_reduce_2k_setup_l(mp_int *a, mp_int *d); + +/* reduces a modulo b where b is of the form 2**p - k [0 <= a] */ +int mp_reduce_2k_l(mp_int *a, mp_int *n, mp_int *d); + +/* d = a**b (mod c) */ +int mp_exptmod(mp_int *a, mp_int *b, mp_int *c, mp_int *d); + +/* ---> Primes <--- */ + +/* number of primes */ +#ifdef MP_8BIT + #define PRIME_SIZE 31 +#else + #define PRIME_SIZE 256 +#endif + +/* table of first PRIME_SIZE primes */ +extern const mp_digit ltm_prime_tab[]; + +/* result=1 if a is divisible by one of the first PRIME_SIZE primes */ +int mp_prime_is_divisible(mp_int *a, int *result); + +/* performs one Fermat test of "a" using base "b". + * Sets result to 0 if composite or 1 if probable prime + */ +int mp_prime_fermat(mp_int *a, mp_int *b, int *result); + +/* performs one Miller-Rabin test of "a" using base "b". + * Sets result to 0 if composite or 1 if probable prime + */ +int mp_prime_miller_rabin(mp_int *a, mp_int *b, int *result); + +/* This gives [for a given bit size] the number of trials required + * such that Miller-Rabin gives a prob of failure lower than 2^-96 + */ +int mp_prime_rabin_miller_trials(int size); + +/* performs t rounds of Miller-Rabin on "a" using the first + * t prime bases. Also performs an initial sieve of trial + * division. Determines if "a" is prime with probability + * of error no more than (1/4)**t. + * + * Sets result to 1 if probably prime, 0 otherwise + */ +int mp_prime_is_prime(mp_int *a, int t, int *result); + +/* finds the next prime after the number "a" using "t" trials + * of Miller-Rabin. + * + * bbs_style = 1 means the prime must be congruent to 3 mod 4 + */ +int mp_prime_next_prime(mp_int *a, int t, int bbs_style); + +/* makes a truly random prime of a given size (bytes), + * call with bbs = 1 if you want it to be congruent to 3 mod 4 + * + * You have to supply a callback which fills in a buffer with random bytes. "dat" is a parameter you can + * have passed to the callback (e.g. a state or something). This function doesn't use "dat" itself + * so it can be NULL + * + * The prime generated will be larger than 2^(8*size). + */ +#define mp_prime_random(a, t, size, bbs, cb, dat) mp_prime_random_ex(a, t, ((size) * 8) + 1, (bbs==1)?LTM_PRIME_BBS:0, cb, dat) + +/* makes a truly random prime of a given size (bits), + * + * Flags are as follows: + * + * LTM_PRIME_BBS - make prime congruent to 3 mod 4 + * LTM_PRIME_SAFE - make sure (p-1)/2 is prime as well (implies LTM_PRIME_BBS) + * LTM_PRIME_2MSB_OFF - make the 2nd highest bit zero + * LTM_PRIME_2MSB_ON - make the 2nd highest bit one + * + * You have to supply a callback which fills in a buffer with random bytes. "dat" is a parameter you can + * have passed to the callback (e.g. a state or something). This function doesn't use "dat" itself + * so it can be NULL + * + */ +int mp_prime_random_ex(mp_int *a, int t, int size, int flags, ltm_prime_callback cb, void *dat); + +/* ---> radix conversion <--- */ +int mp_count_bits(mp_int *a); + +int mp_unsigned_bin_size(mp_int *a); +int mp_read_unsigned_bin(mp_int *a, const unsigned char *b, int c); +int mp_to_unsigned_bin(mp_int *a, unsigned char *b); +int mp_to_unsigned_bin_n (mp_int * a, unsigned char *b, unsigned long *outlen); + +int mp_signed_bin_size(mp_int *a); +int mp_read_signed_bin(mp_int *a, const unsigned char *b, int c); +int mp_to_signed_bin(mp_int *a, unsigned char *b); +int mp_to_signed_bin_n (mp_int * a, unsigned char *b, unsigned long *outlen); + +int mp_read_radix(mp_int *a, const char *str, int radix); +int mp_toradix(mp_int *a, char *str, int radix); +int mp_toradix_n(mp_int * a, char *str, int radix, int maxlen); +int mp_radix_size(mp_int *a, int radix, int *size); + +int mp_fread(mp_int *a, int radix, FILE *stream); +int mp_fwrite(mp_int *a, int radix, FILE *stream); + +#define mp_read_raw(mp, str, len) mp_read_signed_bin((mp), (str), (len)) +#define mp_raw_size(mp) mp_signed_bin_size(mp) +#define mp_toraw(mp, str) mp_to_signed_bin((mp), (str)) +#define mp_read_mag(mp, str, len) mp_read_unsigned_bin((mp), (str), (len)) +#define mp_mag_size(mp) mp_unsigned_bin_size(mp) +#define mp_tomag(mp, str) mp_to_unsigned_bin((mp), (str)) + +#define mp_tobinary(M, S) mp_toradix((M), (S), 2) +#define mp_tooctal(M, S) mp_toradix((M), (S), 8) +#define mp_todecimal(M, S) mp_toradix((M), (S), 10) +#define mp_tohex(M, S) mp_toradix((M), (S), 16) + +/* lowlevel functions, do not call! */ +int s_mp_add(mp_int *a, mp_int *b, mp_int *c); +int s_mp_sub(mp_int *a, mp_int *b, mp_int *c); +#define s_mp_mul(a, b, c) s_mp_mul_digs(a, b, c, (a)->used + (b)->used + 1) +int fast_s_mp_mul_digs(mp_int *a, mp_int *b, mp_int *c, int digs); +int s_mp_mul_digs(mp_int *a, mp_int *b, mp_int *c, int digs); +int fast_s_mp_mul_high_digs(mp_int *a, mp_int *b, mp_int *c, int digs); +int s_mp_mul_high_digs(mp_int *a, mp_int *b, mp_int *c, int digs); +int fast_s_mp_sqr(mp_int *a, mp_int *b); +int s_mp_sqr(mp_int *a, mp_int *b); +int mp_karatsuba_mul(mp_int *a, mp_int *b, mp_int *c); +int mp_toom_mul(mp_int *a, mp_int *b, mp_int *c); +int mp_karatsuba_sqr(mp_int *a, mp_int *b); +int mp_toom_sqr(mp_int *a, mp_int *b); +int fast_mp_invmod(mp_int *a, mp_int *b, mp_int *c); +int mp_invmod_slow (mp_int * a, mp_int * b, mp_int * c); +int fast_mp_montgomery_reduce(mp_int *a, mp_int *m, mp_digit mp); +int mp_exptmod_fast(mp_int *G, mp_int *X, mp_int *P, mp_int *Y, int mode); +int s_mp_exptmod (mp_int * G, mp_int * X, mp_int * P, mp_int * Y, int mode); +void bn_reverse(unsigned char *s, int len); + +extern const char *mp_s_rmap; + +#ifdef __cplusplus + } +#endif + +#endif + + +/* $Source: /cvs/libtom/libtommath/tommath.h,v $ */ +/* $Revision: 1.8 $ */ +/* $Date: 2006/03/31 14:18:44 $ */ diff --git a/dep/StormLib/src/libtommath/tommath_class.h b/dep/StormLib/src/libtommath/tommath_class.h new file mode 100644 index 00000000000..18d1553dee7 --- /dev/null +++ b/dep/StormLib/src/libtommath/tommath_class.h @@ -0,0 +1,999 @@ +#if !(defined(LTM1) && defined(LTM2) && defined(LTM3)) +#if defined(LTM2) +#define LTM3 +#endif +#if defined(LTM1) +#define LTM2 +#endif +#define LTM1 + +#if defined(LTM_ALL) +#define BN_ERROR_C +#define BN_FAST_MP_INVMOD_C +#define BN_FAST_MP_MONTGOMERY_REDUCE_C +#define BN_FAST_S_MP_MUL_DIGS_C +#define BN_FAST_S_MP_MUL_HIGH_DIGS_C +#define BN_FAST_S_MP_SQR_C +#define BN_MP_2EXPT_C +#define BN_MP_ABS_C +#define BN_MP_ADD_C +#define BN_MP_ADD_D_C +#define BN_MP_ADDMOD_C +#define BN_MP_AND_C +#define BN_MP_CLAMP_C +#define BN_MP_CLEAR_C +#define BN_MP_CLEAR_MULTI_C +#define BN_MP_CMP_C +#define BN_MP_CMP_D_C +#define BN_MP_CMP_MAG_C +#define BN_MP_CNT_LSB_C +#define BN_MP_COPY_C +#define BN_MP_COUNT_BITS_C +#define BN_MP_DIV_C +#define BN_MP_DIV_2_C +#define BN_MP_DIV_2D_C +#define BN_MP_DIV_3_C +#define BN_MP_DIV_D_C +#define BN_MP_DR_IS_MODULUS_C +#define BN_MP_DR_REDUCE_C +#define BN_MP_DR_SETUP_C +#define BN_MP_EXCH_C +#define BN_MP_EXPT_D_C +#define BN_MP_EXPTMOD_C +#define BN_MP_EXPTMOD_FAST_C +#define BN_MP_EXTEUCLID_C +#define BN_MP_FREAD_C +#define BN_MP_FWRITE_C +#define BN_MP_GCD_C +#define BN_MP_GET_INT_C +#define BN_MP_GROW_C +#define BN_MP_INIT_C +#define BN_MP_INIT_COPY_C +#define BN_MP_INIT_MULTI_C +#define BN_MP_INIT_SET_C +#define BN_MP_INIT_SET_INT_C +#define BN_MP_INIT_SIZE_C +#define BN_MP_INVMOD_C +#define BN_MP_INVMOD_SLOW_C +#define BN_MP_IS_SQUARE_C +#define BN_MP_JACOBI_C +#define BN_MP_KARATSUBA_MUL_C +#define BN_MP_KARATSUBA_SQR_C +#define BN_MP_LCM_C +#define BN_MP_LSHD_C +#define BN_MP_MOD_C +#define BN_MP_MOD_2D_C +#define BN_MP_MOD_D_C +#define BN_MP_MONTGOMERY_CALC_NORMALIZATION_C +#define BN_MP_MONTGOMERY_REDUCE_C +#define BN_MP_MONTGOMERY_SETUP_C +#define BN_MP_MUL_C +#define BN_MP_MUL_2_C +#define BN_MP_MUL_2D_C +#define BN_MP_MUL_D_C +#define BN_MP_MULMOD_C +#define BN_MP_N_ROOT_C +#define BN_MP_NEG_C +#define BN_MP_OR_C +#define BN_MP_PRIME_FERMAT_C +#define BN_MP_PRIME_IS_DIVISIBLE_C +#define BN_MP_PRIME_IS_PRIME_C +#define BN_MP_PRIME_MILLER_RABIN_C +#define BN_MP_PRIME_NEXT_PRIME_C +#define BN_MP_PRIME_RABIN_MILLER_TRIALS_C +#define BN_MP_PRIME_RANDOM_EX_C +#define BN_MP_RADIX_SIZE_C +#define BN_MP_RADIX_SMAP_C +#define BN_MP_RAND_C +#define BN_MP_READ_RADIX_C +#define BN_MP_READ_SIGNED_BIN_C +#define BN_MP_READ_UNSIGNED_BIN_C +#define BN_MP_REDUCE_C +#define BN_MP_REDUCE_2K_C +#define BN_MP_REDUCE_2K_L_C +#define BN_MP_REDUCE_2K_SETUP_C +#define BN_MP_REDUCE_2K_SETUP_L_C +#define BN_MP_REDUCE_IS_2K_C +#define BN_MP_REDUCE_IS_2K_L_C +#define BN_MP_REDUCE_SETUP_C +#define BN_MP_RSHD_C +#define BN_MP_SET_C +#define BN_MP_SET_INT_C +#define BN_MP_SHRINK_C +#define BN_MP_SIGNED_BIN_SIZE_C +#define BN_MP_SQR_C +#define BN_MP_SQRMOD_C +#define BN_MP_SQRT_C +#define BN_MP_SUB_C +#define BN_MP_SUB_D_C +#define BN_MP_SUBMOD_C +#define BN_MP_TO_SIGNED_BIN_C +#define BN_MP_TO_SIGNED_BIN_N_C +#define BN_MP_TO_UNSIGNED_BIN_C +#define BN_MP_TO_UNSIGNED_BIN_N_C +#define BN_MP_TOOM_MUL_C +#define BN_MP_TOOM_SQR_C +#define BN_MP_TORADIX_C +#define BN_MP_TORADIX_N_C +#define BN_MP_UNSIGNED_BIN_SIZE_C +#define BN_MP_XOR_C +#define BN_MP_ZERO_C +#define BN_PRIME_TAB_C +#define BN_REVERSE_C +#define BN_S_MP_ADD_C +#define BN_S_MP_EXPTMOD_C +#define BN_S_MP_MUL_DIGS_C +#define BN_S_MP_MUL_HIGH_DIGS_C +#define BN_S_MP_SQR_C +#define BN_S_MP_SUB_C +#define BNCORE_C +#endif + +#if defined(BN_ERROR_C) + #define BN_MP_ERROR_TO_STRING_C +#endif + +#if defined(BN_FAST_MP_INVMOD_C) + #define BN_MP_ISEVEN_C + #define BN_MP_INIT_MULTI_C + #define BN_MP_COPY_C + #define BN_MP_MOD_C + #define BN_MP_SET_C + #define BN_MP_DIV_2_C + #define BN_MP_ISODD_C + #define BN_MP_SUB_C + #define BN_MP_CMP_C + #define BN_MP_ISZERO_C + #define BN_MP_CMP_D_C + #define BN_MP_ADD_C + #define BN_MP_EXCH_C + #define BN_MP_CLEAR_MULTI_C +#endif + +#if defined(BN_FAST_MP_MONTGOMERY_REDUCE_C) + #define BN_MP_GROW_C + #define BN_MP_RSHD_C + #define BN_MP_CLAMP_C + #define BN_MP_CMP_MAG_C + #define BN_S_MP_SUB_C +#endif + +#if defined(BN_FAST_S_MP_MUL_DIGS_C) + #define BN_MP_GROW_C + #define BN_MP_CLAMP_C +#endif + +#if defined(BN_FAST_S_MP_MUL_HIGH_DIGS_C) + #define BN_MP_GROW_C + #define BN_MP_CLAMP_C +#endif + +#if defined(BN_FAST_S_MP_SQR_C) + #define BN_MP_GROW_C + #define BN_MP_CLAMP_C +#endif + +#if defined(BN_MP_2EXPT_C) + #define BN_MP_ZERO_C + #define BN_MP_GROW_C +#endif + +#if defined(BN_MP_ABS_C) + #define BN_MP_COPY_C +#endif + +#if defined(BN_MP_ADD_C) + #define BN_S_MP_ADD_C + #define BN_MP_CMP_MAG_C + #define BN_S_MP_SUB_C +#endif + +#if defined(BN_MP_ADD_D_C) + #define BN_MP_GROW_C + #define BN_MP_SUB_D_C + #define BN_MP_CLAMP_C +#endif + +#if defined(BN_MP_ADDMOD_C) + #define BN_MP_INIT_C + #define BN_MP_ADD_C + #define BN_MP_CLEAR_C + #define BN_MP_MOD_C +#endif + +#if defined(BN_MP_AND_C) + #define BN_MP_INIT_COPY_C + #define BN_MP_CLAMP_C + #define BN_MP_EXCH_C + #define BN_MP_CLEAR_C +#endif + +#if defined(BN_MP_CLAMP_C) +#endif + +#if defined(BN_MP_CLEAR_C) +#endif + +#if defined(BN_MP_CLEAR_MULTI_C) + #define BN_MP_CLEAR_C +#endif + +#if defined(BN_MP_CMP_C) + #define BN_MP_CMP_MAG_C +#endif + +#if defined(BN_MP_CMP_D_C) +#endif + +#if defined(BN_MP_CMP_MAG_C) +#endif + +#if defined(BN_MP_CNT_LSB_C) + #define BN_MP_ISZERO_C +#endif + +#if defined(BN_MP_COPY_C) + #define BN_MP_GROW_C +#endif + +#if defined(BN_MP_COUNT_BITS_C) +#endif + +#if defined(BN_MP_DIV_C) + #define BN_MP_ISZERO_C + #define BN_MP_CMP_MAG_C + #define BN_MP_COPY_C + #define BN_MP_ZERO_C + #define BN_MP_INIT_MULTI_C + #define BN_MP_SET_C + #define BN_MP_COUNT_BITS_C + #define BN_MP_ABS_C + #define BN_MP_MUL_2D_C + #define BN_MP_CMP_C + #define BN_MP_SUB_C + #define BN_MP_ADD_C + #define BN_MP_DIV_2D_C + #define BN_MP_EXCH_C + #define BN_MP_CLEAR_MULTI_C + #define BN_MP_INIT_SIZE_C + #define BN_MP_INIT_C + #define BN_MP_INIT_COPY_C + #define BN_MP_LSHD_C + #define BN_MP_RSHD_C + #define BN_MP_MUL_D_C + #define BN_MP_CLAMP_C + #define BN_MP_CLEAR_C +#endif + +#if defined(BN_MP_DIV_2_C) + #define BN_MP_GROW_C + #define BN_MP_CLAMP_C +#endif + +#if defined(BN_MP_DIV_2D_C) + #define BN_MP_COPY_C + #define BN_MP_ZERO_C + #define BN_MP_INIT_C + #define BN_MP_MOD_2D_C + #define BN_MP_CLEAR_C + #define BN_MP_RSHD_C + #define BN_MP_CLAMP_C + #define BN_MP_EXCH_C +#endif + +#if defined(BN_MP_DIV_3_C) + #define BN_MP_INIT_SIZE_C + #define BN_MP_CLAMP_C + #define BN_MP_EXCH_C + #define BN_MP_CLEAR_C +#endif + +#if defined(BN_MP_DIV_D_C) + #define BN_MP_ISZERO_C + #define BN_MP_COPY_C + #define BN_MP_DIV_2D_C + #define BN_MP_DIV_3_C + #define BN_MP_INIT_SIZE_C + #define BN_MP_CLAMP_C + #define BN_MP_EXCH_C + #define BN_MP_CLEAR_C +#endif + +#if defined(BN_MP_DR_IS_MODULUS_C) +#endif + +#if defined(BN_MP_DR_REDUCE_C) + #define BN_MP_GROW_C + #define BN_MP_CLAMP_C + #define BN_MP_CMP_MAG_C + #define BN_S_MP_SUB_C +#endif + +#if defined(BN_MP_DR_SETUP_C) +#endif + +#if defined(BN_MP_EXCH_C) +#endif + +#if defined(BN_MP_EXPT_D_C) + #define BN_MP_INIT_COPY_C + #define BN_MP_SET_C + #define BN_MP_SQR_C + #define BN_MP_CLEAR_C + #define BN_MP_MUL_C +#endif + +#if defined(BN_MP_EXPTMOD_C) + #define BN_MP_INIT_C + #define BN_MP_INVMOD_C + #define BN_MP_CLEAR_C + #define BN_MP_ABS_C + #define BN_MP_CLEAR_MULTI_C + #define BN_MP_REDUCE_IS_2K_L_C + #define BN_S_MP_EXPTMOD_C + #define BN_MP_DR_IS_MODULUS_C + #define BN_MP_REDUCE_IS_2K_C + #define BN_MP_ISODD_C + #define BN_MP_EXPTMOD_FAST_C +#endif + +#if defined(BN_MP_EXPTMOD_FAST_C) + #define BN_MP_COUNT_BITS_C + #define BN_MP_INIT_C + #define BN_MP_CLEAR_C + #define BN_MP_MONTGOMERY_SETUP_C + #define BN_FAST_MP_MONTGOMERY_REDUCE_C + #define BN_MP_MONTGOMERY_REDUCE_C + #define BN_MP_DR_SETUP_C + #define BN_MP_DR_REDUCE_C + #define BN_MP_REDUCE_2K_SETUP_C + #define BN_MP_REDUCE_2K_C + #define BN_MP_MONTGOMERY_CALC_NORMALIZATION_C + #define BN_MP_MULMOD_C + #define BN_MP_SET_C + #define BN_MP_MOD_C + #define BN_MP_COPY_C + #define BN_MP_SQR_C + #define BN_MP_MUL_C + #define BN_MP_EXCH_C +#endif + +#if defined(BN_MP_EXTEUCLID_C) + #define BN_MP_INIT_MULTI_C + #define BN_MP_SET_C + #define BN_MP_COPY_C + #define BN_MP_ISZERO_C + #define BN_MP_DIV_C + #define BN_MP_MUL_C + #define BN_MP_SUB_C + #define BN_MP_NEG_C + #define BN_MP_EXCH_C + #define BN_MP_CLEAR_MULTI_C +#endif + +#if defined(BN_MP_FREAD_C) + #define BN_MP_ZERO_C + #define BN_MP_S_RMAP_C + #define BN_MP_MUL_D_C + #define BN_MP_ADD_D_C + #define BN_MP_CMP_D_C +#endif + +#if defined(BN_MP_FWRITE_C) + #define BN_MP_RADIX_SIZE_C + #define BN_MP_TORADIX_C +#endif + +#if defined(BN_MP_GCD_C) + #define BN_MP_ISZERO_C + #define BN_MP_ABS_C + #define BN_MP_ZERO_C + #define BN_MP_INIT_COPY_C + #define BN_MP_CNT_LSB_C + #define BN_MP_DIV_2D_C + #define BN_MP_CMP_MAG_C + #define BN_MP_EXCH_C + #define BN_S_MP_SUB_C + #define BN_MP_MUL_2D_C + #define BN_MP_CLEAR_C +#endif + +#if defined(BN_MP_GET_INT_C) +#endif + +#if defined(BN_MP_GROW_C) +#endif + +#if defined(BN_MP_INIT_C) +#endif + +#if defined(BN_MP_INIT_COPY_C) + #define BN_MP_COPY_C +#endif + +#if defined(BN_MP_INIT_MULTI_C) + #define BN_MP_ERR_C + #define BN_MP_INIT_C + #define BN_MP_CLEAR_C +#endif + +#if defined(BN_MP_INIT_SET_C) + #define BN_MP_INIT_C + #define BN_MP_SET_C +#endif + +#if defined(BN_MP_INIT_SET_INT_C) + #define BN_MP_INIT_C + #define BN_MP_SET_INT_C +#endif + +#if defined(BN_MP_INIT_SIZE_C) + #define BN_MP_INIT_C +#endif + +#if defined(BN_MP_INVMOD_C) + #define BN_MP_ISZERO_C + #define BN_MP_ISODD_C + #define BN_FAST_MP_INVMOD_C + #define BN_MP_INVMOD_SLOW_C +#endif + +#if defined(BN_MP_INVMOD_SLOW_C) + #define BN_MP_ISZERO_C + #define BN_MP_INIT_MULTI_C + #define BN_MP_MOD_C + #define BN_MP_COPY_C + #define BN_MP_ISEVEN_C + #define BN_MP_SET_C + #define BN_MP_DIV_2_C + #define BN_MP_ISODD_C + #define BN_MP_ADD_C + #define BN_MP_SUB_C + #define BN_MP_CMP_C + #define BN_MP_CMP_D_C + #define BN_MP_CMP_MAG_C + #define BN_MP_EXCH_C + #define BN_MP_CLEAR_MULTI_C +#endif + +#if defined(BN_MP_IS_SQUARE_C) + #define BN_MP_MOD_D_C + #define BN_MP_INIT_SET_INT_C + #define BN_MP_MOD_C + #define BN_MP_GET_INT_C + #define BN_MP_SQRT_C + #define BN_MP_SQR_C + #define BN_MP_CMP_MAG_C + #define BN_MP_CLEAR_C +#endif + +#if defined(BN_MP_JACOBI_C) + #define BN_MP_CMP_D_C + #define BN_MP_ISZERO_C + #define BN_MP_INIT_COPY_C + #define BN_MP_CNT_LSB_C + #define BN_MP_DIV_2D_C + #define BN_MP_MOD_C + #define BN_MP_CLEAR_C +#endif + +#if defined(BN_MP_KARATSUBA_MUL_C) + #define BN_MP_MUL_C + #define BN_MP_INIT_SIZE_C + #define BN_MP_CLAMP_C + #define BN_MP_SUB_C + #define BN_MP_ADD_C + #define BN_MP_LSHD_C + #define BN_MP_CLEAR_C +#endif + +#if defined(BN_MP_KARATSUBA_SQR_C) + #define BN_MP_INIT_SIZE_C + #define BN_MP_CLAMP_C + #define BN_MP_SQR_C + #define BN_MP_SUB_C + #define BN_S_MP_ADD_C + #define BN_MP_LSHD_C + #define BN_MP_ADD_C + #define BN_MP_CLEAR_C +#endif + +#if defined(BN_MP_LCM_C) + #define BN_MP_INIT_MULTI_C + #define BN_MP_GCD_C + #define BN_MP_CMP_MAG_C + #define BN_MP_DIV_C + #define BN_MP_MUL_C + #define BN_MP_CLEAR_MULTI_C +#endif + +#if defined(BN_MP_LSHD_C) + #define BN_MP_GROW_C + #define BN_MP_RSHD_C +#endif + +#if defined(BN_MP_MOD_C) + #define BN_MP_INIT_C + #define BN_MP_DIV_C + #define BN_MP_CLEAR_C + #define BN_MP_ADD_C + #define BN_MP_EXCH_C +#endif + +#if defined(BN_MP_MOD_2D_C) + #define BN_MP_ZERO_C + #define BN_MP_COPY_C + #define BN_MP_CLAMP_C +#endif + +#if defined(BN_MP_MOD_D_C) + #define BN_MP_DIV_D_C +#endif + +#if defined(BN_MP_MONTGOMERY_CALC_NORMALIZATION_C) + #define BN_MP_COUNT_BITS_C + #define BN_MP_2EXPT_C + #define BN_MP_SET_C + #define BN_MP_MUL_2_C + #define BN_MP_CMP_MAG_C + #define BN_S_MP_SUB_C +#endif + +#if defined(BN_MP_MONTGOMERY_REDUCE_C) + #define BN_FAST_MP_MONTGOMERY_REDUCE_C + #define BN_MP_GROW_C + #define BN_MP_CLAMP_C + #define BN_MP_RSHD_C + #define BN_MP_CMP_MAG_C + #define BN_S_MP_SUB_C +#endif + +#if defined(BN_MP_MONTGOMERY_SETUP_C) +#endif + +#if defined(BN_MP_MUL_C) + #define BN_MP_TOOM_MUL_C + #define BN_MP_KARATSUBA_MUL_C + #define BN_FAST_S_MP_MUL_DIGS_C + #define BN_S_MP_MUL_C + #define BN_S_MP_MUL_DIGS_C +#endif + +#if defined(BN_MP_MUL_2_C) + #define BN_MP_GROW_C +#endif + +#if defined(BN_MP_MUL_2D_C) + #define BN_MP_COPY_C + #define BN_MP_GROW_C + #define BN_MP_LSHD_C + #define BN_MP_CLAMP_C +#endif + +#if defined(BN_MP_MUL_D_C) + #define BN_MP_GROW_C + #define BN_MP_CLAMP_C +#endif + +#if defined(BN_MP_MULMOD_C) + #define BN_MP_INIT_C + #define BN_MP_MUL_C + #define BN_MP_CLEAR_C + #define BN_MP_MOD_C +#endif + +#if defined(BN_MP_N_ROOT_C) + #define BN_MP_INIT_C + #define BN_MP_SET_C + #define BN_MP_COPY_C + #define BN_MP_EXPT_D_C + #define BN_MP_MUL_C + #define BN_MP_SUB_C + #define BN_MP_MUL_D_C + #define BN_MP_DIV_C + #define BN_MP_CMP_C + #define BN_MP_SUB_D_C + #define BN_MP_EXCH_C + #define BN_MP_CLEAR_C +#endif + +#if defined(BN_MP_NEG_C) + #define BN_MP_COPY_C + #define BN_MP_ISZERO_C +#endif + +#if defined(BN_MP_OR_C) + #define BN_MP_INIT_COPY_C + #define BN_MP_CLAMP_C + #define BN_MP_EXCH_C + #define BN_MP_CLEAR_C +#endif + +#if defined(BN_MP_PRIME_FERMAT_C) + #define BN_MP_CMP_D_C + #define BN_MP_INIT_C + #define BN_MP_EXPTMOD_C + #define BN_MP_CMP_C + #define BN_MP_CLEAR_C +#endif + +#if defined(BN_MP_PRIME_IS_DIVISIBLE_C) + #define BN_MP_MOD_D_C +#endif + +#if defined(BN_MP_PRIME_IS_PRIME_C) + #define BN_MP_CMP_D_C + #define BN_MP_PRIME_IS_DIVISIBLE_C + #define BN_MP_INIT_C + #define BN_MP_SET_C + #define BN_MP_PRIME_MILLER_RABIN_C + #define BN_MP_CLEAR_C +#endif + +#if defined(BN_MP_PRIME_MILLER_RABIN_C) + #define BN_MP_CMP_D_C + #define BN_MP_INIT_COPY_C + #define BN_MP_SUB_D_C + #define BN_MP_CNT_LSB_C + #define BN_MP_DIV_2D_C + #define BN_MP_EXPTMOD_C + #define BN_MP_CMP_C + #define BN_MP_SQRMOD_C + #define BN_MP_CLEAR_C +#endif + +#if defined(BN_MP_PRIME_NEXT_PRIME_C) + #define BN_MP_CMP_D_C + #define BN_MP_SET_C + #define BN_MP_SUB_D_C + #define BN_MP_ISEVEN_C + #define BN_MP_MOD_D_C + #define BN_MP_INIT_C + #define BN_MP_ADD_D_C + #define BN_MP_PRIME_MILLER_RABIN_C + #define BN_MP_CLEAR_C +#endif + +#if defined(BN_MP_PRIME_RABIN_MILLER_TRIALS_C) +#endif + +#if defined(BN_MP_PRIME_RANDOM_EX_C) + #define BN_MP_READ_UNSIGNED_BIN_C + #define BN_MP_PRIME_IS_PRIME_C + #define BN_MP_SUB_D_C + #define BN_MP_DIV_2_C + #define BN_MP_MUL_2_C + #define BN_MP_ADD_D_C +#endif + +#if defined(BN_MP_RADIX_SIZE_C) + #define BN_MP_COUNT_BITS_C + #define BN_MP_INIT_COPY_C + #define BN_MP_ISZERO_C + #define BN_MP_DIV_D_C + #define BN_MP_CLEAR_C +#endif + +#if defined(BN_MP_RADIX_SMAP_C) + #define BN_MP_S_RMAP_C +#endif + +#if defined(BN_MP_RAND_C) + #define BN_MP_ZERO_C + #define BN_MP_ADD_D_C + #define BN_MP_LSHD_C +#endif + +#if defined(BN_MP_READ_RADIX_C) + #define BN_MP_ZERO_C + #define BN_MP_S_RMAP_C + #define BN_MP_RADIX_SMAP_C + #define BN_MP_MUL_D_C + #define BN_MP_ADD_D_C + #define BN_MP_ISZERO_C +#endif + +#if defined(BN_MP_READ_SIGNED_BIN_C) + #define BN_MP_READ_UNSIGNED_BIN_C +#endif + +#if defined(BN_MP_READ_UNSIGNED_BIN_C) + #define BN_MP_GROW_C + #define BN_MP_ZERO_C + #define BN_MP_MUL_2D_C + #define BN_MP_CLAMP_C +#endif + +#if defined(BN_MP_REDUCE_C) + #define BN_MP_REDUCE_SETUP_C + #define BN_MP_INIT_COPY_C + #define BN_MP_RSHD_C + #define BN_MP_MUL_C + #define BN_S_MP_MUL_HIGH_DIGS_C + #define BN_FAST_S_MP_MUL_HIGH_DIGS_C + #define BN_MP_MOD_2D_C + #define BN_S_MP_MUL_DIGS_C + #define BN_MP_SUB_C + #define BN_MP_CMP_D_C + #define BN_MP_SET_C + #define BN_MP_LSHD_C + #define BN_MP_ADD_C + #define BN_MP_CMP_C + #define BN_S_MP_SUB_C + #define BN_MP_CLEAR_C +#endif + +#if defined(BN_MP_REDUCE_2K_C) + #define BN_MP_INIT_C + #define BN_MP_COUNT_BITS_C + #define BN_MP_DIV_2D_C + #define BN_MP_MUL_D_C + #define BN_S_MP_ADD_C + #define BN_MP_CMP_MAG_C + #define BN_S_MP_SUB_C + #define BN_MP_CLEAR_C +#endif + +#if defined(BN_MP_REDUCE_2K_L_C) + #define BN_MP_INIT_C + #define BN_MP_COUNT_BITS_C + #define BN_MP_DIV_2D_C + #define BN_MP_MUL_C + #define BN_S_MP_ADD_C + #define BN_MP_CMP_MAG_C + #define BN_S_MP_SUB_C + #define BN_MP_CLEAR_C +#endif + +#if defined(BN_MP_REDUCE_2K_SETUP_C) + #define BN_MP_INIT_C + #define BN_MP_COUNT_BITS_C + #define BN_MP_2EXPT_C + #define BN_MP_CLEAR_C + #define BN_S_MP_SUB_C +#endif + +#if defined(BN_MP_REDUCE_2K_SETUP_L_C) + #define BN_MP_INIT_C + #define BN_MP_2EXPT_C + #define BN_MP_COUNT_BITS_C + #define BN_S_MP_SUB_C + #define BN_MP_CLEAR_C +#endif + +#if defined(BN_MP_REDUCE_IS_2K_C) + #define BN_MP_REDUCE_2K_C + #define BN_MP_COUNT_BITS_C +#endif + +#if defined(BN_MP_REDUCE_IS_2K_L_C) +#endif + +#if defined(BN_MP_REDUCE_SETUP_C) + #define BN_MP_2EXPT_C + #define BN_MP_DIV_C +#endif + +#if defined(BN_MP_RSHD_C) + #define BN_MP_ZERO_C +#endif + +#if defined(BN_MP_SET_C) + #define BN_MP_ZERO_C +#endif + +#if defined(BN_MP_SET_INT_C) + #define BN_MP_ZERO_C + #define BN_MP_MUL_2D_C + #define BN_MP_CLAMP_C +#endif + +#if defined(BN_MP_SHRINK_C) +#endif + +#if defined(BN_MP_SIGNED_BIN_SIZE_C) + #define BN_MP_UNSIGNED_BIN_SIZE_C +#endif + +#if defined(BN_MP_SQR_C) + #define BN_MP_TOOM_SQR_C + #define BN_MP_KARATSUBA_SQR_C + #define BN_FAST_S_MP_SQR_C + #define BN_S_MP_SQR_C +#endif + +#if defined(BN_MP_SQRMOD_C) + #define BN_MP_INIT_C + #define BN_MP_SQR_C + #define BN_MP_CLEAR_C + #define BN_MP_MOD_C +#endif + +#if defined(BN_MP_SQRT_C) + #define BN_MP_N_ROOT_C + #define BN_MP_ISZERO_C + #define BN_MP_ZERO_C + #define BN_MP_INIT_COPY_C + #define BN_MP_RSHD_C + #define BN_MP_DIV_C + #define BN_MP_ADD_C + #define BN_MP_DIV_2_C + #define BN_MP_CMP_MAG_C + #define BN_MP_EXCH_C + #define BN_MP_CLEAR_C +#endif + +#if defined(BN_MP_SUB_C) + #define BN_S_MP_ADD_C + #define BN_MP_CMP_MAG_C + #define BN_S_MP_SUB_C +#endif + +#if defined(BN_MP_SUB_D_C) + #define BN_MP_GROW_C + #define BN_MP_ADD_D_C + #define BN_MP_CLAMP_C +#endif + +#if defined(BN_MP_SUBMOD_C) + #define BN_MP_INIT_C + #define BN_MP_SUB_C + #define BN_MP_CLEAR_C + #define BN_MP_MOD_C +#endif + +#if defined(BN_MP_TO_SIGNED_BIN_C) + #define BN_MP_TO_UNSIGNED_BIN_C +#endif + +#if defined(BN_MP_TO_SIGNED_BIN_N_C) + #define BN_MP_SIGNED_BIN_SIZE_C + #define BN_MP_TO_SIGNED_BIN_C +#endif + +#if defined(BN_MP_TO_UNSIGNED_BIN_C) + #define BN_MP_INIT_COPY_C + #define BN_MP_ISZERO_C + #define BN_MP_DIV_2D_C + #define BN_MP_CLEAR_C +#endif + +#if defined(BN_MP_TO_UNSIGNED_BIN_N_C) + #define BN_MP_UNSIGNED_BIN_SIZE_C + #define BN_MP_TO_UNSIGNED_BIN_C +#endif + +#if defined(BN_MP_TOOM_MUL_C) + #define BN_MP_INIT_MULTI_C + #define BN_MP_MOD_2D_C + #define BN_MP_COPY_C + #define BN_MP_RSHD_C + #define BN_MP_MUL_C + #define BN_MP_MUL_2_C + #define BN_MP_ADD_C + #define BN_MP_SUB_C + #define BN_MP_DIV_2_C + #define BN_MP_MUL_2D_C + #define BN_MP_MUL_D_C + #define BN_MP_DIV_3_C + #define BN_MP_LSHD_C + #define BN_MP_CLEAR_MULTI_C +#endif + +#if defined(BN_MP_TOOM_SQR_C) + #define BN_MP_INIT_MULTI_C + #define BN_MP_MOD_2D_C + #define BN_MP_COPY_C + #define BN_MP_RSHD_C + #define BN_MP_SQR_C + #define BN_MP_MUL_2_C + #define BN_MP_ADD_C + #define BN_MP_SUB_C + #define BN_MP_DIV_2_C + #define BN_MP_MUL_2D_C + #define BN_MP_MUL_D_C + #define BN_MP_DIV_3_C + #define BN_MP_LSHD_C + #define BN_MP_CLEAR_MULTI_C +#endif + +#if defined(BN_MP_TORADIX_C) + #define BN_MP_ISZERO_C + #define BN_MP_INIT_COPY_C + #define BN_MP_DIV_D_C + #define BN_MP_CLEAR_C + #define BN_MP_S_RMAP_C +#endif + +#if defined(BN_MP_TORADIX_N_C) + #define BN_MP_ISZERO_C + #define BN_MP_INIT_COPY_C + #define BN_MP_DIV_D_C + #define BN_MP_CLEAR_C + #define BN_MP_S_RMAP_C +#endif + +#if defined(BN_MP_UNSIGNED_BIN_SIZE_C) + #define BN_MP_COUNT_BITS_C +#endif + +#if defined(BN_MP_XOR_C) + #define BN_MP_INIT_COPY_C + #define BN_MP_CLAMP_C + #define BN_MP_EXCH_C + #define BN_MP_CLEAR_C +#endif + +#if defined(BN_MP_ZERO_C) +#endif + +#if defined(BN_PRIME_TAB_C) +#endif + +#if defined(BN_REVERSE_C) +#endif + +#if defined(BN_S_MP_ADD_C) + #define BN_MP_GROW_C + #define BN_MP_CLAMP_C +#endif + +#if defined(BN_S_MP_EXPTMOD_C) + #define BN_MP_COUNT_BITS_C + #define BN_MP_INIT_C + #define BN_MP_CLEAR_C + #define BN_MP_REDUCE_SETUP_C + #define BN_MP_REDUCE_C + #define BN_MP_REDUCE_2K_SETUP_L_C + #define BN_MP_REDUCE_2K_L_C + #define BN_MP_MOD_C + #define BN_MP_COPY_C + #define BN_MP_SQR_C + #define BN_MP_MUL_C + #define BN_MP_SET_C + #define BN_MP_EXCH_C +#endif + +#if defined(BN_S_MP_MUL_DIGS_C) + #define BN_FAST_S_MP_MUL_DIGS_C + #define BN_MP_INIT_SIZE_C + #define BN_MP_CLAMP_C + #define BN_MP_EXCH_C + #define BN_MP_CLEAR_C +#endif + +#if defined(BN_S_MP_MUL_HIGH_DIGS_C) + #define BN_FAST_S_MP_MUL_HIGH_DIGS_C + #define BN_MP_INIT_SIZE_C + #define BN_MP_CLAMP_C + #define BN_MP_EXCH_C + #define BN_MP_CLEAR_C +#endif + +#if defined(BN_S_MP_SQR_C) + #define BN_MP_INIT_SIZE_C + #define BN_MP_CLAMP_C + #define BN_MP_EXCH_C + #define BN_MP_CLEAR_C +#endif + +#if defined(BN_S_MP_SUB_C) + #define BN_MP_GROW_C + #define BN_MP_CLAMP_C +#endif + +#if defined(BNCORE_C) +#endif + +#ifdef LTM3 +#define LTM_LAST +#endif +#include "tommath_superclass.h" +#include "tommath_class.h" +#else +#define LTM_LAST +#endif + +/* $Source: /cvs/libtom/libtommath/tommath_class.h,v $ */ +/* $Revision: 1.3 $ */ +/* $Date: 2005/07/28 11:59:32 $ */ diff --git a/dep/StormLib/src/libtommath/tommath_superclass.h b/dep/StormLib/src/libtommath/tommath_superclass.h new file mode 100644 index 00000000000..2fdebe6838f --- /dev/null +++ b/dep/StormLib/src/libtommath/tommath_superclass.h @@ -0,0 +1,76 @@ +/* super class file for PK algos */ + +/* default ... include all MPI */ +#define LTM_ALL + +/* RSA only (does not support DH/DSA/ECC) */ +/* #define SC_RSA_1 */ + +/* For reference.... On an Athlon64 optimizing for speed... + + LTM's mpi.o with all functions [striped] is 142KiB in size. + +*/ + +/* Works for RSA only, mpi.o is 68KiB */ +#ifdef SC_RSA_1 + #define BN_MP_SHRINK_C + #define BN_MP_LCM_C + #define BN_MP_PRIME_RANDOM_EX_C + #define BN_MP_INVMOD_C + #define BN_MP_GCD_C + #define BN_MP_MOD_C + #define BN_MP_MULMOD_C + #define BN_MP_ADDMOD_C + #define BN_MP_EXPTMOD_C + #define BN_MP_SET_INT_C + #define BN_MP_INIT_MULTI_C + #define BN_MP_CLEAR_MULTI_C + #define BN_MP_UNSIGNED_BIN_SIZE_C + #define BN_MP_TO_UNSIGNED_BIN_C + #define BN_MP_MOD_D_C + #define BN_MP_PRIME_RABIN_MILLER_TRIALS_C + #define BN_REVERSE_C + #define BN_PRIME_TAB_C + + /* other modifiers */ + #define BN_MP_DIV_SMALL /* Slower division, not critical */ + + /* here we are on the last pass so we turn things off. The functions classes are still there + * but we remove them specifically from the build. This also invokes tweaks in functions + * like removing support for even moduli, etc... + */ +#ifdef LTM_LAST + #undef BN_MP_TOOM_MUL_C + #undef BN_MP_TOOM_SQR_C + #undef BN_MP_KARATSUBA_MUL_C + #undef BN_MP_KARATSUBA_SQR_C + #undef BN_MP_REDUCE_C + #undef BN_MP_REDUCE_SETUP_C + #undef BN_MP_DR_IS_MODULUS_C + #undef BN_MP_DR_SETUP_C + #undef BN_MP_DR_REDUCE_C + #undef BN_MP_REDUCE_IS_2K_C + #undef BN_MP_REDUCE_2K_SETUP_C + #undef BN_MP_REDUCE_2K_C + #undef BN_S_MP_EXPTMOD_C + #undef BN_MP_DIV_3_C + #undef BN_S_MP_MUL_HIGH_DIGS_C + #undef BN_FAST_S_MP_MUL_HIGH_DIGS_C + #undef BN_FAST_MP_INVMOD_C + + /* To safely undefine these you have to make sure your RSA key won't exceed the Comba threshold + * which is roughly 255 digits [7140 bits for 32-bit machines, 15300 bits for 64-bit machines] + * which means roughly speaking you can handle upto 2536-bit RSA keys with these defined without + * trouble. + */ + #undef BN_S_MP_MUL_DIGS_C + #undef BN_S_MP_SQR_C + #undef BN_MP_MONTGOMERY_REDUCE_C +#endif + +#endif + +/* $Source: /cvs/libtom/libtommath/tommath_superclass.h,v $ */ +/* $Revision: 1.3 $ */ +/* $Date: 2005/05/14 13:29:17 $ */ diff --git a/dep/StormLib/src/lzma/C/LzFind.c b/dep/StormLib/src/lzma/C/LzFind.c new file mode 100644 index 00000000000..e3ecb05420e --- /dev/null +++ b/dep/StormLib/src/lzma/C/LzFind.c @@ -0,0 +1,761 @@ +/* LzFind.c -- Match finder for LZ algorithms +2009-04-22 : Igor Pavlov : Public domain */ + +#include + +#include "LzFind.h" +#include "LzHash.h" + +#define kEmptyHashValue 0 +#define kMaxValForNormalize ((UInt32)0xFFFFFFFF) +#define kNormalizeStepMin (1 << 10) /* it must be power of 2 */ +#define kNormalizeMask (~(kNormalizeStepMin - 1)) +#define kMaxHistorySize ((UInt32)3 << 30) + +#define kStartMaxLen 3 + +static void LzInWindow_Free(CMatchFinder *p, ISzAlloc *alloc) +{ + if (!p->directInput) + { + alloc->Free(alloc, p->bufferBase); + p->bufferBase = 0; + } +} + +/* keepSizeBefore + keepSizeAfter + keepSizeReserv must be < 4G) */ + +static int LzInWindow_Create(CMatchFinder *p, UInt32 keepSizeReserv, ISzAlloc *alloc) +{ + UInt32 blockSize = p->keepSizeBefore + p->keepSizeAfter + keepSizeReserv; + if (p->directInput) + { + p->blockSize = blockSize; + return 1; + } + if (p->bufferBase == 0 || p->blockSize != blockSize) + { + LzInWindow_Free(p, alloc); + p->blockSize = blockSize; + p->bufferBase = (Byte *)alloc->Alloc(alloc, (size_t)blockSize); + } + return (p->bufferBase != 0); +} + +Byte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p) { return p->buffer; } +Byte MatchFinder_GetIndexByte(CMatchFinder *p, Int32 index) { return p->buffer[index]; } + +UInt32 MatchFinder_GetNumAvailableBytes(CMatchFinder *p) { return p->streamPos - p->pos; } + +void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue) +{ + p->posLimit -= subValue; + p->pos -= subValue; + p->streamPos -= subValue; +} + +static void MatchFinder_ReadBlock(CMatchFinder *p) +{ + if (p->streamEndWasReached || p->result != SZ_OK) + return; + if (p->directInput) + { + UInt32 curSize = 0xFFFFFFFF - p->streamPos; + if (curSize > p->directInputRem) + curSize = (UInt32)p->directInputRem; + p->directInputRem -= curSize; + p->streamPos += curSize; + if (p->directInputRem == 0) + p->streamEndWasReached = 1; + return; + } + for (;;) + { + Byte *dest = p->buffer + (p->streamPos - p->pos); + size_t size = (p->bufferBase + p->blockSize - dest); + if (size == 0) + return; + p->result = p->stream->Read(p->stream, dest, &size); + if (p->result != SZ_OK) + return; + if (size == 0) + { + p->streamEndWasReached = 1; + return; + } + p->streamPos += (UInt32)size; + if (p->streamPos - p->pos > p->keepSizeAfter) + return; + } +} + +void MatchFinder_MoveBlock(CMatchFinder *p) +{ + memmove(p->bufferBase, + p->buffer - p->keepSizeBefore, + (size_t)(p->streamPos - p->pos + p->keepSizeBefore)); + p->buffer = p->bufferBase + p->keepSizeBefore; +} + +int MatchFinder_NeedMove(CMatchFinder *p) +{ + if (p->directInput) + return 0; + /* if (p->streamEndWasReached) return 0; */ + return ((size_t)(p->bufferBase + p->blockSize - p->buffer) <= p->keepSizeAfter); +} + +void MatchFinder_ReadIfRequired(CMatchFinder *p) +{ + if (p->streamEndWasReached) + return; + if (p->keepSizeAfter >= p->streamPos - p->pos) + MatchFinder_ReadBlock(p); +} + +static void MatchFinder_CheckAndMoveAndRead(CMatchFinder *p) +{ + if (MatchFinder_NeedMove(p)) + MatchFinder_MoveBlock(p); + MatchFinder_ReadBlock(p); +} + +static void MatchFinder_SetDefaultSettings(CMatchFinder *p) +{ + p->cutValue = 32; + p->btMode = 1; + p->numHashBytes = 4; + p->bigHash = 0; +} + +#define kCrcPoly 0xEDB88320 + +void MatchFinder_Construct(CMatchFinder *p) +{ + UInt32 i; + p->bufferBase = 0; + p->directInput = 0; + p->hash = 0; + MatchFinder_SetDefaultSettings(p); + + for (i = 0; i < 256; i++) + { + UInt32 r = i; + int j; + for (j = 0; j < 8; j++) + r = (r >> 1) ^ (kCrcPoly & ~((r & 1) - 1)); + p->crc[i] = r; + } +} + +static void MatchFinder_FreeThisClassMemory(CMatchFinder *p, ISzAlloc *alloc) +{ + alloc->Free(alloc, p->hash); + p->hash = 0; +} + +void MatchFinder_Free(CMatchFinder *p, ISzAlloc *alloc) +{ + MatchFinder_FreeThisClassMemory(p, alloc); + LzInWindow_Free(p, alloc); +} + +static CLzRef* AllocRefs(UInt32 num, ISzAlloc *alloc) +{ + size_t sizeInBytes = (size_t)num * sizeof(CLzRef); + if (sizeInBytes / sizeof(CLzRef) != num) + return 0; + return (CLzRef *)alloc->Alloc(alloc, sizeInBytes); +} + +int MatchFinder_Create(CMatchFinder *p, UInt32 historySize, + UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter, + ISzAlloc *alloc) +{ + UInt32 sizeReserv; + if (historySize > kMaxHistorySize) + { + MatchFinder_Free(p, alloc); + return 0; + } + sizeReserv = historySize >> 1; + if (historySize > ((UInt32)2 << 30)) + sizeReserv = historySize >> 2; + sizeReserv += (keepAddBufferBefore + matchMaxLen + keepAddBufferAfter) / 2 + (1 << 19); + + p->keepSizeBefore = historySize + keepAddBufferBefore + 1; + p->keepSizeAfter = matchMaxLen + keepAddBufferAfter; + /* we need one additional byte, since we use MoveBlock after pos++ and before dictionary using */ + if (LzInWindow_Create(p, sizeReserv, alloc)) + { + UInt32 newCyclicBufferSize = historySize + 1; + UInt32 hs; + p->matchMaxLen = matchMaxLen; + { + p->fixedHashSize = 0; + if (p->numHashBytes == 2) + hs = (1 << 16) - 1; + else + { + hs = historySize - 1; + hs |= (hs >> 1); + hs |= (hs >> 2); + hs |= (hs >> 4); + hs |= (hs >> 8); + hs >>= 1; + hs |= 0xFFFF; /* don't change it! It's required for Deflate */ + if (hs > (1 << 24)) + { + if (p->numHashBytes == 3) + hs = (1 << 24) - 1; + else + hs >>= 1; + } + } + p->hashMask = hs; + hs++; + if (p->numHashBytes > 2) p->fixedHashSize += kHash2Size; + if (p->numHashBytes > 3) p->fixedHashSize += kHash3Size; + if (p->numHashBytes > 4) p->fixedHashSize += kHash4Size; + hs += p->fixedHashSize; + } + + { + UInt32 prevSize = p->hashSizeSum + p->numSons; + UInt32 newSize; + p->historySize = historySize; + p->hashSizeSum = hs; + p->cyclicBufferSize = newCyclicBufferSize; + p->numSons = (p->btMode ? newCyclicBufferSize * 2 : newCyclicBufferSize); + newSize = p->hashSizeSum + p->numSons; + if (p->hash != 0 && prevSize == newSize) + return 1; + MatchFinder_FreeThisClassMemory(p, alloc); + p->hash = AllocRefs(newSize, alloc); + if (p->hash != 0) + { + p->son = p->hash + p->hashSizeSum; + return 1; + } + } + } + MatchFinder_Free(p, alloc); + return 0; +} + +static void MatchFinder_SetLimits(CMatchFinder *p) +{ + UInt32 limit = kMaxValForNormalize - p->pos; + UInt32 limit2 = p->cyclicBufferSize - p->cyclicBufferPos; + if (limit2 < limit) + limit = limit2; + limit2 = p->streamPos - p->pos; + if (limit2 <= p->keepSizeAfter) + { + if (limit2 > 0) + limit2 = 1; + } + else + limit2 -= p->keepSizeAfter; + if (limit2 < limit) + limit = limit2; + { + UInt32 lenLimit = p->streamPos - p->pos; + if (lenLimit > p->matchMaxLen) + lenLimit = p->matchMaxLen; + p->lenLimit = lenLimit; + } + p->posLimit = p->pos + limit; +} + +void MatchFinder_Init(CMatchFinder *p) +{ + UInt32 i; + for (i = 0; i < p->hashSizeSum; i++) + p->hash[i] = kEmptyHashValue; + p->cyclicBufferPos = 0; + p->buffer = p->bufferBase; + p->pos = p->streamPos = p->cyclicBufferSize; + p->result = SZ_OK; + p->streamEndWasReached = 0; + MatchFinder_ReadBlock(p); + MatchFinder_SetLimits(p); +} + +static UInt32 MatchFinder_GetSubValue(CMatchFinder *p) +{ + return (p->pos - p->historySize - 1) & kNormalizeMask; +} + +void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, UInt32 numItems) +{ + UInt32 i; + for (i = 0; i < numItems; i++) + { + UInt32 value = items[i]; + if (value <= subValue) + value = kEmptyHashValue; + else + value -= subValue; + items[i] = value; + } +} + +static void MatchFinder_Normalize(CMatchFinder *p) +{ + UInt32 subValue = MatchFinder_GetSubValue(p); + MatchFinder_Normalize3(subValue, p->hash, p->hashSizeSum + p->numSons); + MatchFinder_ReduceOffsets(p, subValue); +} + +static void MatchFinder_CheckLimits(CMatchFinder *p) +{ + if (p->pos == kMaxValForNormalize) + MatchFinder_Normalize(p); + if (!p->streamEndWasReached && p->keepSizeAfter == p->streamPos - p->pos) + MatchFinder_CheckAndMoveAndRead(p); + if (p->cyclicBufferPos == p->cyclicBufferSize) + p->cyclicBufferPos = 0; + MatchFinder_SetLimits(p); +} + +static UInt32 * Hc_GetMatchesSpec(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son, + UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue, + UInt32 *distances, UInt32 maxLen) +{ + son[_cyclicBufferPos] = curMatch; + for (;;) + { + UInt32 delta = pos - curMatch; + if (cutValue-- == 0 || delta >= _cyclicBufferSize) + return distances; + { + const Byte *pb = cur - delta; + curMatch = son[_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)]; + if (pb[maxLen] == cur[maxLen] && *pb == *cur) + { + UInt32 len = 0; + while (++len != lenLimit) + if (pb[len] != cur[len]) + break; + if (maxLen < len) + { + *distances++ = maxLen = len; + *distances++ = delta - 1; + if (len == lenLimit) + return distances; + } + } + } + } +} + +UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son, + UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue, + UInt32 *distances, UInt32 maxLen) +{ + CLzRef *ptr0 = son + (_cyclicBufferPos << 1) + 1; + CLzRef *ptr1 = son + (_cyclicBufferPos << 1); + UInt32 len0 = 0, len1 = 0; + for (;;) + { + UInt32 delta = pos - curMatch; + if (cutValue-- == 0 || delta >= _cyclicBufferSize) + { + *ptr0 = *ptr1 = kEmptyHashValue; + return distances; + } + { + CLzRef *pair = son + ((_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)) << 1); + const Byte *pb = cur - delta; + UInt32 len = (len0 < len1 ? len0 : len1); + if (pb[len] == cur[len]) + { + if (++len != lenLimit && pb[len] == cur[len]) + while (++len != lenLimit) + if (pb[len] != cur[len]) + break; + if (maxLen < len) + { + *distances++ = maxLen = len; + *distances++ = delta - 1; + if (len == lenLimit) + { + *ptr1 = pair[0]; + *ptr0 = pair[1]; + return distances; + } + } + } + if (pb[len] < cur[len]) + { + *ptr1 = curMatch; + ptr1 = pair + 1; + curMatch = *ptr1; + len1 = len; + } + else + { + *ptr0 = curMatch; + ptr0 = pair; + curMatch = *ptr0; + len0 = len; + } + } + } +} + +static void SkipMatchesSpec(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son, + UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue) +{ + CLzRef *ptr0 = son + (_cyclicBufferPos << 1) + 1; + CLzRef *ptr1 = son + (_cyclicBufferPos << 1); + UInt32 len0 = 0, len1 = 0; + for (;;) + { + UInt32 delta = pos - curMatch; + if (cutValue-- == 0 || delta >= _cyclicBufferSize) + { + *ptr0 = *ptr1 = kEmptyHashValue; + return; + } + { + CLzRef *pair = son + ((_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)) << 1); + const Byte *pb = cur - delta; + UInt32 len = (len0 < len1 ? len0 : len1); + if (pb[len] == cur[len]) + { + while (++len != lenLimit) + if (pb[len] != cur[len]) + break; + { + if (len == lenLimit) + { + *ptr1 = pair[0]; + *ptr0 = pair[1]; + return; + } + } + } + if (pb[len] < cur[len]) + { + *ptr1 = curMatch; + ptr1 = pair + 1; + curMatch = *ptr1; + len1 = len; + } + else + { + *ptr0 = curMatch; + ptr0 = pair; + curMatch = *ptr0; + len0 = len; + } + } + } +} + +#define MOVE_POS \ + ++p->cyclicBufferPos; \ + p->buffer++; \ + if (++p->pos == p->posLimit) MatchFinder_CheckLimits(p); + +#define MOVE_POS_RET MOVE_POS return offset; + +static void MatchFinder_MovePos(CMatchFinder *p) { MOVE_POS; } + +#define GET_MATCHES_HEADER2(minLen, ret_op) \ + UInt32 lenLimit; UInt32 hashValue; const Byte *cur; UInt32 curMatch; \ + lenLimit = p->lenLimit; { if (lenLimit < minLen) { MatchFinder_MovePos(p); ret_op; }} \ + cur = p->buffer; + +#define GET_MATCHES_HEADER(minLen) GET_MATCHES_HEADER2(minLen, return 0) +#define SKIP_HEADER(minLen) GET_MATCHES_HEADER2(minLen, continue) + +#define MF_PARAMS(p) p->pos, p->buffer, p->son, p->cyclicBufferPos, p->cyclicBufferSize, p->cutValue + +#define GET_MATCHES_FOOTER(offset, maxLen) \ + offset = (UInt32)(GetMatchesSpec1(lenLimit, curMatch, MF_PARAMS(p), \ + distances + offset, maxLen) - distances); MOVE_POS_RET; + +#define SKIP_FOOTER \ + SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p)); MOVE_POS; + +static UInt32 Bt2_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) +{ + UInt32 offset; + GET_MATCHES_HEADER(2) + HASH2_CALC; + curMatch = p->hash[hashValue]; + p->hash[hashValue] = p->pos; + offset = 0; + GET_MATCHES_FOOTER(offset, 1) +} + +UInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) +{ + UInt32 offset; + GET_MATCHES_HEADER(3) + HASH_ZIP_CALC; + curMatch = p->hash[hashValue]; + p->hash[hashValue] = p->pos; + offset = 0; + GET_MATCHES_FOOTER(offset, 2) +} + +static UInt32 Bt3_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) +{ + UInt32 hash2Value, delta2, maxLen, offset; + GET_MATCHES_HEADER(3) + + HASH3_CALC; + + delta2 = p->pos - p->hash[hash2Value]; + curMatch = p->hash[kFix3HashSize + hashValue]; + + p->hash[hash2Value] = + p->hash[kFix3HashSize + hashValue] = p->pos; + + + maxLen = 2; + offset = 0; + if (delta2 < p->cyclicBufferSize && *(cur - delta2) == *cur) + { + for (; maxLen != lenLimit; maxLen++) + if (cur[(ptrdiff_t)maxLen - delta2] != cur[maxLen]) + break; + distances[0] = maxLen; + distances[1] = delta2 - 1; + offset = 2; + if (maxLen == lenLimit) + { + SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p)); + MOVE_POS_RET; + } + } + GET_MATCHES_FOOTER(offset, maxLen) +} + +static UInt32 Bt4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) +{ + UInt32 hash2Value, hash3Value, delta2, delta3, maxLen, offset; + GET_MATCHES_HEADER(4) + + HASH4_CALC; + + delta2 = p->pos - p->hash[ hash2Value]; + delta3 = p->pos - p->hash[kFix3HashSize + hash3Value]; + curMatch = p->hash[kFix4HashSize + hashValue]; + + p->hash[ hash2Value] = + p->hash[kFix3HashSize + hash3Value] = + p->hash[kFix4HashSize + hashValue] = p->pos; + + maxLen = 1; + offset = 0; + if (delta2 < p->cyclicBufferSize && *(cur - delta2) == *cur) + { + distances[0] = maxLen = 2; + distances[1] = delta2 - 1; + offset = 2; + } + if (delta2 != delta3 && delta3 < p->cyclicBufferSize && *(cur - delta3) == *cur) + { + maxLen = 3; + distances[offset + 1] = delta3 - 1; + offset += 2; + delta2 = delta3; + } + if (offset != 0) + { + for (; maxLen != lenLimit; maxLen++) + if (cur[(ptrdiff_t)maxLen - delta2] != cur[maxLen]) + break; + distances[offset - 2] = maxLen; + if (maxLen == lenLimit) + { + SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p)); + MOVE_POS_RET; + } + } + if (maxLen < 3) + maxLen = 3; + GET_MATCHES_FOOTER(offset, maxLen) +} + +static UInt32 Hc4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) +{ + UInt32 hash2Value, hash3Value, delta2, delta3, maxLen, offset; + GET_MATCHES_HEADER(4) + + HASH4_CALC; + + delta2 = p->pos - p->hash[ hash2Value]; + delta3 = p->pos - p->hash[kFix3HashSize + hash3Value]; + curMatch = p->hash[kFix4HashSize + hashValue]; + + p->hash[ hash2Value] = + p->hash[kFix3HashSize + hash3Value] = + p->hash[kFix4HashSize + hashValue] = p->pos; + + maxLen = 1; + offset = 0; + if (delta2 < p->cyclicBufferSize && *(cur - delta2) == *cur) + { + distances[0] = maxLen = 2; + distances[1] = delta2 - 1; + offset = 2; + } + if (delta2 != delta3 && delta3 < p->cyclicBufferSize && *(cur - delta3) == *cur) + { + maxLen = 3; + distances[offset + 1] = delta3 - 1; + offset += 2; + delta2 = delta3; + } + if (offset != 0) + { + for (; maxLen != lenLimit; maxLen++) + if (cur[(ptrdiff_t)maxLen - delta2] != cur[maxLen]) + break; + distances[offset - 2] = maxLen; + if (maxLen == lenLimit) + { + p->son[p->cyclicBufferPos] = curMatch; + MOVE_POS_RET; + } + } + if (maxLen < 3) + maxLen = 3; + offset = (UInt32)(Hc_GetMatchesSpec(lenLimit, curMatch, MF_PARAMS(p), + distances + offset, maxLen) - (distances)); + MOVE_POS_RET +} + +UInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) +{ + UInt32 offset; + GET_MATCHES_HEADER(3) + HASH_ZIP_CALC; + curMatch = p->hash[hashValue]; + p->hash[hashValue] = p->pos; + offset = (UInt32)(Hc_GetMatchesSpec(lenLimit, curMatch, MF_PARAMS(p), + distances, 2) - (distances)); + MOVE_POS_RET +} + +static void Bt2_MatchFinder_Skip(CMatchFinder *p, UInt32 num) +{ + do + { + SKIP_HEADER(2) + HASH2_CALC; + curMatch = p->hash[hashValue]; + p->hash[hashValue] = p->pos; + SKIP_FOOTER + } + while (--num != 0); +} + +void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num) +{ + do + { + SKIP_HEADER(3) + HASH_ZIP_CALC; + curMatch = p->hash[hashValue]; + p->hash[hashValue] = p->pos; + SKIP_FOOTER + } + while (--num != 0); +} + +static void Bt3_MatchFinder_Skip(CMatchFinder *p, UInt32 num) +{ + do + { + UInt32 hash2Value; + SKIP_HEADER(3) + HASH3_CALC; + curMatch = p->hash[kFix3HashSize + hashValue]; + p->hash[hash2Value] = + p->hash[kFix3HashSize + hashValue] = p->pos; + SKIP_FOOTER + } + while (--num != 0); +} + +static void Bt4_MatchFinder_Skip(CMatchFinder *p, UInt32 num) +{ + do + { + UInt32 hash2Value, hash3Value; + SKIP_HEADER(4) + HASH4_CALC; + curMatch = p->hash[kFix4HashSize + hashValue]; + p->hash[ hash2Value] = + p->hash[kFix3HashSize + hash3Value] = p->pos; + p->hash[kFix4HashSize + hashValue] = p->pos; + SKIP_FOOTER + } + while (--num != 0); +} + +static void Hc4_MatchFinder_Skip(CMatchFinder *p, UInt32 num) +{ + do + { + UInt32 hash2Value, hash3Value; + SKIP_HEADER(4) + HASH4_CALC; + curMatch = p->hash[kFix4HashSize + hashValue]; + p->hash[ hash2Value] = + p->hash[kFix3HashSize + hash3Value] = + p->hash[kFix4HashSize + hashValue] = p->pos; + p->son[p->cyclicBufferPos] = curMatch; + MOVE_POS + } + while (--num != 0); +} + +void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num) +{ + do + { + SKIP_HEADER(3) + HASH_ZIP_CALC; + curMatch = p->hash[hashValue]; + p->hash[hashValue] = p->pos; + p->son[p->cyclicBufferPos] = curMatch; + MOVE_POS + } + while (--num != 0); +} + +void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder *vTable) +{ + vTable->Init = (Mf_Init_Func)MatchFinder_Init; + vTable->GetIndexByte = (Mf_GetIndexByte_Func)MatchFinder_GetIndexByte; + vTable->GetNumAvailableBytes = (Mf_GetNumAvailableBytes_Func)MatchFinder_GetNumAvailableBytes; + vTable->GetPointerToCurrentPos = (Mf_GetPointerToCurrentPos_Func)MatchFinder_GetPointerToCurrentPos; + if (!p->btMode) + { + vTable->GetMatches = (Mf_GetMatches_Func)Hc4_MatchFinder_GetMatches; + vTable->Skip = (Mf_Skip_Func)Hc4_MatchFinder_Skip; + } + else if (p->numHashBytes == 2) + { + vTable->GetMatches = (Mf_GetMatches_Func)Bt2_MatchFinder_GetMatches; + vTable->Skip = (Mf_Skip_Func)Bt2_MatchFinder_Skip; + } + else if (p->numHashBytes == 3) + { + vTable->GetMatches = (Mf_GetMatches_Func)Bt3_MatchFinder_GetMatches; + vTable->Skip = (Mf_Skip_Func)Bt3_MatchFinder_Skip; + } + else + { + vTable->GetMatches = (Mf_GetMatches_Func)Bt4_MatchFinder_GetMatches; + vTable->Skip = (Mf_Skip_Func)Bt4_MatchFinder_Skip; + } +} diff --git a/dep/StormLib/src/lzma/C/LzFind.h b/dep/StormLib/src/lzma/C/LzFind.h new file mode 100644 index 00000000000..010c4b92ba3 --- /dev/null +++ b/dep/StormLib/src/lzma/C/LzFind.h @@ -0,0 +1,115 @@ +/* LzFind.h -- Match finder for LZ algorithms +2009-04-22 : Igor Pavlov : Public domain */ + +#ifndef __LZ_FIND_H +#define __LZ_FIND_H + +#include "Types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef UInt32 CLzRef; + +typedef struct _CMatchFinder +{ + Byte *buffer; + UInt32 pos; + UInt32 posLimit; + UInt32 streamPos; + UInt32 lenLimit; + + UInt32 cyclicBufferPos; + UInt32 cyclicBufferSize; /* it must be = (historySize + 1) */ + + UInt32 matchMaxLen; + CLzRef *hash; + CLzRef *son; + UInt32 hashMask; + UInt32 cutValue; + + Byte *bufferBase; + ISeqInStream *stream; + int streamEndWasReached; + + UInt32 blockSize; + UInt32 keepSizeBefore; + UInt32 keepSizeAfter; + + UInt32 numHashBytes; + int directInput; + size_t directInputRem; + int btMode; + int bigHash; + UInt32 historySize; + UInt32 fixedHashSize; + UInt32 hashSizeSum; + UInt32 numSons; + SRes result; + UInt32 crc[256]; +} CMatchFinder; + +#define Inline_MatchFinder_GetPointerToCurrentPos(p) ((p)->buffer) +#define Inline_MatchFinder_GetIndexByte(p, index) ((p)->buffer[(Int32)(index)]) + +#define Inline_MatchFinder_GetNumAvailableBytes(p) ((p)->streamPos - (p)->pos) + +int MatchFinder_NeedMove(CMatchFinder *p); +Byte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p); +void MatchFinder_MoveBlock(CMatchFinder *p); +void MatchFinder_ReadIfRequired(CMatchFinder *p); + +void MatchFinder_Construct(CMatchFinder *p); + +/* Conditions: + historySize <= 3 GB + keepAddBufferBefore + matchMaxLen + keepAddBufferAfter < 511MB +*/ +int MatchFinder_Create(CMatchFinder *p, UInt32 historySize, + UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter, + ISzAlloc *alloc); +void MatchFinder_Free(CMatchFinder *p, ISzAlloc *alloc); +void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, UInt32 numItems); +void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue); + +UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *buffer, CLzRef *son, + UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 _cutValue, + UInt32 *distances, UInt32 maxLen); + +/* +Conditions: + Mf_GetNumAvailableBytes_Func must be called before each Mf_GetMatchLen_Func. + Mf_GetPointerToCurrentPos_Func's result must be used only before any other function +*/ + +typedef void (*Mf_Init_Func)(void *object); +typedef Byte (*Mf_GetIndexByte_Func)(void *object, Int32 index); +typedef UInt32 (*Mf_GetNumAvailableBytes_Func)(void *object); +typedef const Byte * (*Mf_GetPointerToCurrentPos_Func)(void *object); +typedef UInt32 (*Mf_GetMatches_Func)(void *object, UInt32 *distances); +typedef void (*Mf_Skip_Func)(void *object, UInt32); + +typedef struct _IMatchFinder +{ + Mf_Init_Func Init; + Mf_GetIndexByte_Func GetIndexByte; + Mf_GetNumAvailableBytes_Func GetNumAvailableBytes; + Mf_GetPointerToCurrentPos_Func GetPointerToCurrentPos; + Mf_GetMatches_Func GetMatches; + Mf_Skip_Func Skip; +} IMatchFinder; + +void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder *vTable); + +void MatchFinder_Init(CMatchFinder *p); +UInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances); +UInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances); +void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num); +void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/dep/StormLib/src/lzma/C/LzFindMt.c b/dep/StormLib/src/lzma/C/LzFindMt.c new file mode 100644 index 00000000000..aa41ed98a57 --- /dev/null +++ b/dep/StormLib/src/lzma/C/LzFindMt.c @@ -0,0 +1,793 @@ +/* LzFindMt.c -- multithreaded Match finder for LZ algorithms +2009-09-20 : Igor Pavlov : Public domain */ + +#include "LzHash.h" + +#include "LzFindMt.h" + +void MtSync_Construct(CMtSync *p) +{ + p->wasCreated = False; + p->csWasInitialized = False; + p->csWasEntered = False; + Thread_Construct(&p->thread); + Event_Construct(&p->canStart); + Event_Construct(&p->wasStarted); + Event_Construct(&p->wasStopped); + Semaphore_Construct(&p->freeSemaphore); + Semaphore_Construct(&p->filledSemaphore); +} + +void MtSync_GetNextBlock(CMtSync *p) +{ + if (p->needStart) + { + p->numProcessedBlocks = 1; + p->needStart = False; + p->stopWriting = False; + p->exit = False; + Event_Reset(&p->wasStarted); + Event_Reset(&p->wasStopped); + + Event_Set(&p->canStart); + Event_Wait(&p->wasStarted); + } + else + { + CriticalSection_Leave(&p->cs); + p->csWasEntered = False; + p->numProcessedBlocks++; + Semaphore_Release1(&p->freeSemaphore); + } + Semaphore_Wait(&p->filledSemaphore); + CriticalSection_Enter(&p->cs); + p->csWasEntered = True; +} + +/* MtSync_StopWriting must be called if Writing was started */ + +void MtSync_StopWriting(CMtSync *p) +{ + UInt32 myNumBlocks = p->numProcessedBlocks; + if (!Thread_WasCreated(&p->thread) || p->needStart) + return; + p->stopWriting = True; + if (p->csWasEntered) + { + CriticalSection_Leave(&p->cs); + p->csWasEntered = False; + } + Semaphore_Release1(&p->freeSemaphore); + + Event_Wait(&p->wasStopped); + + while (myNumBlocks++ != p->numProcessedBlocks) + { + Semaphore_Wait(&p->filledSemaphore); + Semaphore_Release1(&p->freeSemaphore); + } + p->needStart = True; +} + +void MtSync_Destruct(CMtSync *p) +{ + if (Thread_WasCreated(&p->thread)) + { + MtSync_StopWriting(p); + p->exit = True; + if (p->needStart) + Event_Set(&p->canStart); + Thread_Wait(&p->thread); + Thread_Close(&p->thread); + } + if (p->csWasInitialized) + { + CriticalSection_Delete(&p->cs); + p->csWasInitialized = False; + } + + Event_Close(&p->canStart); + Event_Close(&p->wasStarted); + Event_Close(&p->wasStopped); + Semaphore_Close(&p->freeSemaphore); + Semaphore_Close(&p->filledSemaphore); + + p->wasCreated = False; +} + +#define RINOK_THREAD(x) { if ((x) != 0) return SZ_ERROR_THREAD; } + +static SRes MtSync_Create2(CMtSync *p, unsigned (MY_STD_CALL *startAddress)(void *), void *obj, UInt32 numBlocks) +{ + if (p->wasCreated) + return SZ_OK; + + RINOK_THREAD(CriticalSection_Init(&p->cs)); + p->csWasInitialized = True; + + RINOK_THREAD(AutoResetEvent_CreateNotSignaled(&p->canStart)); + RINOK_THREAD(AutoResetEvent_CreateNotSignaled(&p->wasStarted)); + RINOK_THREAD(AutoResetEvent_CreateNotSignaled(&p->wasStopped)); + + RINOK_THREAD(Semaphore_Create(&p->freeSemaphore, numBlocks, numBlocks)); + RINOK_THREAD(Semaphore_Create(&p->filledSemaphore, 0, numBlocks)); + + p->needStart = True; + + RINOK_THREAD(Thread_Create(&p->thread, startAddress, obj)); + p->wasCreated = True; + return SZ_OK; +} + +static SRes MtSync_Create(CMtSync *p, unsigned (MY_STD_CALL *startAddress)(void *), void *obj, UInt32 numBlocks) +{ + SRes res = MtSync_Create2(p, startAddress, obj, numBlocks); + if (res != SZ_OK) + MtSync_Destruct(p); + return res; +} + +void MtSync_Init(CMtSync *p) { p->needStart = True; } + +#define kMtMaxValForNormalize 0xFFFFFFFF + +#define DEF_GetHeads2(name, v, action) \ +static void GetHeads ## name(const Byte *p, UInt32 pos, \ +UInt32 *hash, UInt32 hashMask, UInt32 *heads, UInt32 numHeads, const UInt32 *crc) \ +{ action; for (; numHeads != 0; numHeads--) { \ +const UInt32 value = (v); p++; *heads++ = pos - hash[value]; hash[value] = pos++; } } + +#define DEF_GetHeads(name, v) DEF_GetHeads2(name, v, ;) + +DEF_GetHeads2(2, (p[0] | ((UInt32)p[1] << 8)), hashMask = hashMask; crc = crc; ) +DEF_GetHeads(3, (crc[p[0]] ^ p[1] ^ ((UInt32)p[2] << 8)) & hashMask) +DEF_GetHeads(4, (crc[p[0]] ^ p[1] ^ ((UInt32)p[2] << 8) ^ (crc[p[3]] << 5)) & hashMask) +DEF_GetHeads(4b, (crc[p[0]] ^ p[1] ^ ((UInt32)p[2] << 8) ^ ((UInt32)p[3] << 16)) & hashMask) +/* DEF_GetHeads(5, (crc[p[0]] ^ p[1] ^ ((UInt32)p[2] << 8) ^ (crc[p[3]] << 5) ^ (crc[p[4]] << 3)) & hashMask) */ + +void HashThreadFunc(CMatchFinderMt *mt) +{ + CMtSync *p = &mt->hashSync; + for (;;) + { + UInt32 numProcessedBlocks = 0; + Event_Wait(&p->canStart); + Event_Set(&p->wasStarted); + for (;;) + { + if (p->exit) + return; + if (p->stopWriting) + { + p->numProcessedBlocks = numProcessedBlocks; + Event_Set(&p->wasStopped); + break; + } + + { + CMatchFinder *mf = mt->MatchFinder; + if (MatchFinder_NeedMove(mf)) + { + CriticalSection_Enter(&mt->btSync.cs); + CriticalSection_Enter(&mt->hashSync.cs); + { + const Byte *beforePtr = MatchFinder_GetPointerToCurrentPos(mf); + const Byte *afterPtr; + MatchFinder_MoveBlock(mf); + afterPtr = MatchFinder_GetPointerToCurrentPos(mf); + mt->pointerToCurPos -= beforePtr - afterPtr; + mt->buffer -= beforePtr - afterPtr; + } + CriticalSection_Leave(&mt->btSync.cs); + CriticalSection_Leave(&mt->hashSync.cs); + continue; + } + + Semaphore_Wait(&p->freeSemaphore); + + MatchFinder_ReadIfRequired(mf); + if (mf->pos > (kMtMaxValForNormalize - kMtHashBlockSize)) + { + UInt32 subValue = (mf->pos - mf->historySize - 1); + MatchFinder_ReduceOffsets(mf, subValue); + MatchFinder_Normalize3(subValue, mf->hash + mf->fixedHashSize, mf->hashMask + 1); + } + { + UInt32 *heads = mt->hashBuf + ((numProcessedBlocks++) & kMtHashNumBlocksMask) * kMtHashBlockSize; + UInt32 num = mf->streamPos - mf->pos; + heads[0] = 2; + heads[1] = num; + if (num >= mf->numHashBytes) + { + num = num - mf->numHashBytes + 1; + if (num > kMtHashBlockSize - 2) + num = kMtHashBlockSize - 2; + mt->GetHeadsFunc(mf->buffer, mf->pos, mf->hash + mf->fixedHashSize, mf->hashMask, heads + 2, num, mf->crc); + heads[0] += num; + } + mf->pos += num; + mf->buffer += num; + } + } + + Semaphore_Release1(&p->filledSemaphore); + } + } +} + +void MatchFinderMt_GetNextBlock_Hash(CMatchFinderMt *p) +{ + MtSync_GetNextBlock(&p->hashSync); + p->hashBufPosLimit = p->hashBufPos = ((p->hashSync.numProcessedBlocks - 1) & kMtHashNumBlocksMask) * kMtHashBlockSize; + p->hashBufPosLimit += p->hashBuf[p->hashBufPos++]; + p->hashNumAvail = p->hashBuf[p->hashBufPos++]; +} + +#define kEmptyHashValue 0 + +/* #define MFMT_GM_INLINE */ + +#ifdef MFMT_GM_INLINE + +#define NO_INLINE MY_FAST_CALL + +Int32 NO_INLINE GetMatchesSpecN(UInt32 lenLimit, UInt32 pos, const Byte *cur, CLzRef *son, + UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 _cutValue, + UInt32 *_distances, UInt32 _maxLen, const UInt32 *hash, Int32 limit, UInt32 size, UInt32 *posRes) +{ + do + { + UInt32 *distances = _distances + 1; + UInt32 curMatch = pos - *hash++; + + CLzRef *ptr0 = son + (_cyclicBufferPos << 1) + 1; + CLzRef *ptr1 = son + (_cyclicBufferPos << 1); + UInt32 len0 = 0, len1 = 0; + UInt32 cutValue = _cutValue; + UInt32 maxLen = _maxLen; + for (;;) + { + UInt32 delta = pos - curMatch; + if (cutValue-- == 0 || delta >= _cyclicBufferSize) + { + *ptr0 = *ptr1 = kEmptyHashValue; + break; + } + { + CLzRef *pair = son + ((_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)) << 1); + const Byte *pb = cur - delta; + UInt32 len = (len0 < len1 ? len0 : len1); + if (pb[len] == cur[len]) + { + if (++len != lenLimit && pb[len] == cur[len]) + while (++len != lenLimit) + if (pb[len] != cur[len]) + break; + if (maxLen < len) + { + *distances++ = maxLen = len; + *distances++ = delta - 1; + if (len == lenLimit) + { + *ptr1 = pair[0]; + *ptr0 = pair[1]; + break; + } + } + } + if (pb[len] < cur[len]) + { + *ptr1 = curMatch; + ptr1 = pair + 1; + curMatch = *ptr1; + len1 = len; + } + else + { + *ptr0 = curMatch; + ptr0 = pair; + curMatch = *ptr0; + len0 = len; + } + } + } + pos++; + _cyclicBufferPos++; + cur++; + { + UInt32 num = (UInt32)(distances - _distances); + *_distances = num - 1; + _distances += num; + limit -= num; + } + } + while (limit > 0 && --size != 0); + *posRes = pos; + return limit; +} + +#endif + +void BtGetMatches(CMatchFinderMt *p, UInt32 *distances) +{ + UInt32 numProcessed = 0; + UInt32 curPos = 2; + UInt32 limit = kMtBtBlockSize - (p->matchMaxLen * 2); + distances[1] = p->hashNumAvail; + while (curPos < limit) + { + if (p->hashBufPos == p->hashBufPosLimit) + { + MatchFinderMt_GetNextBlock_Hash(p); + distances[1] = numProcessed + p->hashNumAvail; + if (p->hashNumAvail >= p->numHashBytes) + continue; + for (; p->hashNumAvail != 0; p->hashNumAvail--) + distances[curPos++] = 0; + break; + } + { + UInt32 size = p->hashBufPosLimit - p->hashBufPos; + UInt32 lenLimit = p->matchMaxLen; + UInt32 pos = p->pos; + UInt32 cyclicBufferPos = p->cyclicBufferPos; + if (lenLimit >= p->hashNumAvail) + lenLimit = p->hashNumAvail; + { + UInt32 size2 = p->hashNumAvail - lenLimit + 1; + if (size2 < size) + size = size2; + size2 = p->cyclicBufferSize - cyclicBufferPos; + if (size2 < size) + size = size2; + } + #ifndef MFMT_GM_INLINE + while (curPos < limit && size-- != 0) + { + UInt32 *startDistances = distances + curPos; + UInt32 num = (UInt32)(GetMatchesSpec1(lenLimit, pos - p->hashBuf[p->hashBufPos++], + pos, p->buffer, p->son, cyclicBufferPos, p->cyclicBufferSize, p->cutValue, + startDistances + 1, p->numHashBytes - 1) - startDistances); + *startDistances = num - 1; + curPos += num; + cyclicBufferPos++; + pos++; + p->buffer++; + } + #else + { + UInt32 posRes; + curPos = limit - GetMatchesSpecN(lenLimit, pos, p->buffer, p->son, cyclicBufferPos, p->cyclicBufferSize, p->cutValue, + distances + curPos, p->numHashBytes - 1, p->hashBuf + p->hashBufPos, (Int32)(limit - curPos) , size, &posRes); + p->hashBufPos += posRes - pos; + cyclicBufferPos += posRes - pos; + p->buffer += posRes - pos; + pos = posRes; + } + #endif + + numProcessed += pos - p->pos; + p->hashNumAvail -= pos - p->pos; + p->pos = pos; + if (cyclicBufferPos == p->cyclicBufferSize) + cyclicBufferPos = 0; + p->cyclicBufferPos = cyclicBufferPos; + } + } + distances[0] = curPos; +} + +void BtFillBlock(CMatchFinderMt *p, UInt32 globalBlockIndex) +{ + CMtSync *sync = &p->hashSync; + if (!sync->needStart) + { + CriticalSection_Enter(&sync->cs); + sync->csWasEntered = True; + } + + BtGetMatches(p, p->btBuf + (globalBlockIndex & kMtBtNumBlocksMask) * kMtBtBlockSize); + + if (p->pos > kMtMaxValForNormalize - kMtBtBlockSize) + { + UInt32 subValue = p->pos - p->cyclicBufferSize; + MatchFinder_Normalize3(subValue, p->son, p->cyclicBufferSize * 2); + p->pos -= subValue; + } + + if (!sync->needStart) + { + CriticalSection_Leave(&sync->cs); + sync->csWasEntered = False; + } +} + +void BtThreadFunc(CMatchFinderMt *mt) +{ + CMtSync *p = &mt->btSync; + for (;;) + { + UInt32 blockIndex = 0; + Event_Wait(&p->canStart); + Event_Set(&p->wasStarted); + for (;;) + { + if (p->exit) + return; + if (p->stopWriting) + { + p->numProcessedBlocks = blockIndex; + MtSync_StopWriting(&mt->hashSync); + Event_Set(&p->wasStopped); + break; + } + Semaphore_Wait(&p->freeSemaphore); + BtFillBlock(mt, blockIndex++); + Semaphore_Release1(&p->filledSemaphore); + } + } +} + +void MatchFinderMt_Construct(CMatchFinderMt *p) +{ + p->hashBuf = 0; + MtSync_Construct(&p->hashSync); + MtSync_Construct(&p->btSync); +} + +void MatchFinderMt_FreeMem(CMatchFinderMt *p, ISzAlloc *alloc) +{ + alloc->Free(alloc, p->hashBuf); + p->hashBuf = 0; +} + +void MatchFinderMt_Destruct(CMatchFinderMt *p, ISzAlloc *alloc) +{ + MtSync_Destruct(&p->hashSync); + MtSync_Destruct(&p->btSync); + MatchFinderMt_FreeMem(p, alloc); +} + +#define kHashBufferSize (kMtHashBlockSize * kMtHashNumBlocks) +#define kBtBufferSize (kMtBtBlockSize * kMtBtNumBlocks) + +static unsigned MY_STD_CALL HashThreadFunc2(void *p) { HashThreadFunc((CMatchFinderMt *)p); return 0; } +static unsigned MY_STD_CALL BtThreadFunc2(void *p) +{ + Byte allocaDummy[0x180]; + int i = 0; + for (i = 0; i < 16; i++) + allocaDummy[i] = (Byte)i; + BtThreadFunc((CMatchFinderMt *)p); + return 0; +} + +SRes MatchFinderMt_Create(CMatchFinderMt *p, UInt32 historySize, UInt32 keepAddBufferBefore, + UInt32 matchMaxLen, UInt32 keepAddBufferAfter, ISzAlloc *alloc) +{ + CMatchFinder *mf = p->MatchFinder; + p->historySize = historySize; + if (kMtBtBlockSize <= matchMaxLen * 4) + return SZ_ERROR_PARAM; + if (p->hashBuf == 0) + { + p->hashBuf = (UInt32 *)alloc->Alloc(alloc, (kHashBufferSize + kBtBufferSize) * sizeof(UInt32)); + if (p->hashBuf == 0) + return SZ_ERROR_MEM; + p->btBuf = p->hashBuf + kHashBufferSize; + } + keepAddBufferBefore += (kHashBufferSize + kBtBufferSize); + keepAddBufferAfter += kMtHashBlockSize; + if (!MatchFinder_Create(mf, historySize, keepAddBufferBefore, matchMaxLen, keepAddBufferAfter, alloc)) + return SZ_ERROR_MEM; + + RINOK(MtSync_Create(&p->hashSync, HashThreadFunc2, p, kMtHashNumBlocks)); + RINOK(MtSync_Create(&p->btSync, BtThreadFunc2, p, kMtBtNumBlocks)); + return SZ_OK; +} + +/* Call it after ReleaseStream / SetStream */ +void MatchFinderMt_Init(CMatchFinderMt *p) +{ + CMatchFinder *mf = p->MatchFinder; + p->btBufPos = p->btBufPosLimit = 0; + p->hashBufPos = p->hashBufPosLimit = 0; + MatchFinder_Init(mf); + p->pointerToCurPos = MatchFinder_GetPointerToCurrentPos(mf); + p->btNumAvailBytes = 0; + p->lzPos = p->historySize + 1; + + p->hash = mf->hash; + p->fixedHashSize = mf->fixedHashSize; + p->crc = mf->crc; + + p->son = mf->son; + p->matchMaxLen = mf->matchMaxLen; + p->numHashBytes = mf->numHashBytes; + p->pos = mf->pos; + p->buffer = mf->buffer; + p->cyclicBufferPos = mf->cyclicBufferPos; + p->cyclicBufferSize = mf->cyclicBufferSize; + p->cutValue = mf->cutValue; +} + +/* ReleaseStream is required to finish multithreading */ +void MatchFinderMt_ReleaseStream(CMatchFinderMt *p) +{ + MtSync_StopWriting(&p->btSync); + /* p->MatchFinder->ReleaseStream(); */ +} + +void MatchFinderMt_Normalize(CMatchFinderMt *p) +{ + MatchFinder_Normalize3(p->lzPos - p->historySize - 1, p->hash, p->fixedHashSize); + p->lzPos = p->historySize + 1; +} + +void MatchFinderMt_GetNextBlock_Bt(CMatchFinderMt *p) +{ + UInt32 blockIndex; + MtSync_GetNextBlock(&p->btSync); + blockIndex = ((p->btSync.numProcessedBlocks - 1) & kMtBtNumBlocksMask); + p->btBufPosLimit = p->btBufPos = blockIndex * kMtBtBlockSize; + p->btBufPosLimit += p->btBuf[p->btBufPos++]; + p->btNumAvailBytes = p->btBuf[p->btBufPos++]; + if (p->lzPos >= kMtMaxValForNormalize - kMtBtBlockSize) + MatchFinderMt_Normalize(p); +} + +const Byte * MatchFinderMt_GetPointerToCurrentPos(CMatchFinderMt *p) +{ + return p->pointerToCurPos; +} + +#define GET_NEXT_BLOCK_IF_REQUIRED if (p->btBufPos == p->btBufPosLimit) MatchFinderMt_GetNextBlock_Bt(p); + +UInt32 MatchFinderMt_GetNumAvailableBytes(CMatchFinderMt *p) +{ + GET_NEXT_BLOCK_IF_REQUIRED; + return p->btNumAvailBytes; +} + +Byte MatchFinderMt_GetIndexByte(CMatchFinderMt *p, Int32 index) +{ + return p->pointerToCurPos[index]; +} + +UInt32 * MixMatches2(CMatchFinderMt *p, UInt32 matchMinPos, UInt32 *distances) +{ + UInt32 hash2Value, curMatch2; + UInt32 *hash = p->hash; + const Byte *cur = p->pointerToCurPos; + UInt32 lzPos = p->lzPos; + MT_HASH2_CALC + + curMatch2 = hash[hash2Value]; + hash[hash2Value] = lzPos; + + if (curMatch2 >= matchMinPos) + if (cur[(ptrdiff_t)curMatch2 - lzPos] == cur[0]) + { + *distances++ = 2; + *distances++ = lzPos - curMatch2 - 1; + } + return distances; +} + +UInt32 * MixMatches3(CMatchFinderMt *p, UInt32 matchMinPos, UInt32 *distances) +{ + UInt32 hash2Value, hash3Value, curMatch2, curMatch3; + UInt32 *hash = p->hash; + const Byte *cur = p->pointerToCurPos; + UInt32 lzPos = p->lzPos; + MT_HASH3_CALC + + curMatch2 = hash[ hash2Value]; + curMatch3 = hash[kFix3HashSize + hash3Value]; + + hash[ hash2Value] = + hash[kFix3HashSize + hash3Value] = + lzPos; + + if (curMatch2 >= matchMinPos && cur[(ptrdiff_t)curMatch2 - lzPos] == cur[0]) + { + distances[1] = lzPos - curMatch2 - 1; + if (cur[(ptrdiff_t)curMatch2 - lzPos + 2] == cur[2]) + { + distances[0] = 3; + return distances + 2; + } + distances[0] = 2; + distances += 2; + } + if (curMatch3 >= matchMinPos && cur[(ptrdiff_t)curMatch3 - lzPos] == cur[0]) + { + *distances++ = 3; + *distances++ = lzPos - curMatch3 - 1; + } + return distances; +} + +/* +UInt32 *MixMatches4(CMatchFinderMt *p, UInt32 matchMinPos, UInt32 *distances) +{ + UInt32 hash2Value, hash3Value, hash4Value, curMatch2, curMatch3, curMatch4; + UInt32 *hash = p->hash; + const Byte *cur = p->pointerToCurPos; + UInt32 lzPos = p->lzPos; + MT_HASH4_CALC + + curMatch2 = hash[ hash2Value]; + curMatch3 = hash[kFix3HashSize + hash3Value]; + curMatch4 = hash[kFix4HashSize + hash4Value]; + + hash[ hash2Value] = + hash[kFix3HashSize + hash3Value] = + hash[kFix4HashSize + hash4Value] = + lzPos; + + if (curMatch2 >= matchMinPos && cur[(ptrdiff_t)curMatch2 - lzPos] == cur[0]) + { + distances[1] = lzPos - curMatch2 - 1; + if (cur[(ptrdiff_t)curMatch2 - lzPos + 2] == cur[2]) + { + distances[0] = (cur[(ptrdiff_t)curMatch2 - lzPos + 3] == cur[3]) ? 4 : 3; + return distances + 2; + } + distances[0] = 2; + distances += 2; + } + if (curMatch3 >= matchMinPos && cur[(ptrdiff_t)curMatch3 - lzPos] == cur[0]) + { + distances[1] = lzPos - curMatch3 - 1; + if (cur[(ptrdiff_t)curMatch3 - lzPos + 3] == cur[3]) + { + distances[0] = 4; + return distances + 2; + } + distances[0] = 3; + distances += 2; + } + + if (curMatch4 >= matchMinPos) + if ( + cur[(ptrdiff_t)curMatch4 - lzPos] == cur[0] && + cur[(ptrdiff_t)curMatch4 - lzPos + 3] == cur[3] + ) + { + *distances++ = 4; + *distances++ = lzPos - curMatch4 - 1; + } + return distances; +} +*/ + +#define INCREASE_LZ_POS p->lzPos++; p->pointerToCurPos++; + +UInt32 MatchFinderMt2_GetMatches(CMatchFinderMt *p, UInt32 *distances) +{ + const UInt32 *btBuf = p->btBuf + p->btBufPos; + UInt32 len = *btBuf++; + p->btBufPos += 1 + len; + p->btNumAvailBytes--; + { + UInt32 i; + for (i = 0; i < len; i += 2) + { + *distances++ = *btBuf++; + *distances++ = *btBuf++; + } + } + INCREASE_LZ_POS + return len; +} + +UInt32 MatchFinderMt_GetMatches(CMatchFinderMt *p, UInt32 *distances) +{ + const UInt32 *btBuf = p->btBuf + p->btBufPos; + UInt32 len = *btBuf++; + p->btBufPos += 1 + len; + + if (len == 0) + { + if (p->btNumAvailBytes-- >= 4) + len = (UInt32)(p->MixMatchesFunc(p, p->lzPos - p->historySize, distances) - (distances)); + } + else + { + /* Condition: there are matches in btBuf with length < p->numHashBytes */ + UInt32 *distances2; + p->btNumAvailBytes--; + distances2 = p->MixMatchesFunc(p, p->lzPos - btBuf[1], distances); + do + { + *distances2++ = *btBuf++; + *distances2++ = *btBuf++; + } + while ((len -= 2) != 0); + len = (UInt32)(distances2 - (distances)); + } + INCREASE_LZ_POS + return len; +} + +#define SKIP_HEADER2_MT do { GET_NEXT_BLOCK_IF_REQUIRED +#define SKIP_HEADER_MT(n) SKIP_HEADER2_MT if (p->btNumAvailBytes-- >= (n)) { const Byte *cur = p->pointerToCurPos; UInt32 *hash = p->hash; +#define SKIP_FOOTER_MT } INCREASE_LZ_POS p->btBufPos += p->btBuf[p->btBufPos] + 1; } while (--num != 0); + +void MatchFinderMt0_Skip(CMatchFinderMt *p, UInt32 num) +{ + SKIP_HEADER2_MT { p->btNumAvailBytes--; + SKIP_FOOTER_MT +} + +void MatchFinderMt2_Skip(CMatchFinderMt *p, UInt32 num) +{ + SKIP_HEADER_MT(2) + UInt32 hash2Value; + MT_HASH2_CALC + hash[hash2Value] = p->lzPos; + SKIP_FOOTER_MT +} + +void MatchFinderMt3_Skip(CMatchFinderMt *p, UInt32 num) +{ + SKIP_HEADER_MT(3) + UInt32 hash2Value, hash3Value; + MT_HASH3_CALC + hash[kFix3HashSize + hash3Value] = + hash[ hash2Value] = + p->lzPos; + SKIP_FOOTER_MT +} + +/* +void MatchFinderMt4_Skip(CMatchFinderMt *p, UInt32 num) +{ + SKIP_HEADER_MT(4) + UInt32 hash2Value, hash3Value, hash4Value; + MT_HASH4_CALC + hash[kFix4HashSize + hash4Value] = + hash[kFix3HashSize + hash3Value] = + hash[ hash2Value] = + p->lzPos; + SKIP_FOOTER_MT +} +*/ + +void MatchFinderMt_CreateVTable(CMatchFinderMt *p, IMatchFinder *vTable) +{ + vTable->Init = (Mf_Init_Func)MatchFinderMt_Init; + vTable->GetIndexByte = (Mf_GetIndexByte_Func)MatchFinderMt_GetIndexByte; + vTable->GetNumAvailableBytes = (Mf_GetNumAvailableBytes_Func)MatchFinderMt_GetNumAvailableBytes; + vTable->GetPointerToCurrentPos = (Mf_GetPointerToCurrentPos_Func)MatchFinderMt_GetPointerToCurrentPos; + vTable->GetMatches = (Mf_GetMatches_Func)MatchFinderMt_GetMatches; + switch(p->MatchFinder->numHashBytes) + { + case 2: + p->GetHeadsFunc = GetHeads2; + p->MixMatchesFunc = (Mf_Mix_Matches)0; + vTable->Skip = (Mf_Skip_Func)MatchFinderMt0_Skip; + vTable->GetMatches = (Mf_GetMatches_Func)MatchFinderMt2_GetMatches; + break; + case 3: + p->GetHeadsFunc = GetHeads3; + p->MixMatchesFunc = (Mf_Mix_Matches)MixMatches2; + vTable->Skip = (Mf_Skip_Func)MatchFinderMt2_Skip; + break; + default: + /* case 4: */ + p->GetHeadsFunc = p->MatchFinder->bigHash ? GetHeads4b : GetHeads4; + /* p->GetHeadsFunc = GetHeads4; */ + p->MixMatchesFunc = (Mf_Mix_Matches)MixMatches3; + vTable->Skip = (Mf_Skip_Func)MatchFinderMt3_Skip; + break; + /* + default: + p->GetHeadsFunc = GetHeads5; + p->MixMatchesFunc = (Mf_Mix_Matches)MixMatches4; + vTable->Skip = (Mf_Skip_Func)MatchFinderMt4_Skip; + break; + */ + } +} diff --git a/dep/StormLib/src/lzma/C/LzFindMt.h b/dep/StormLib/src/lzma/C/LzFindMt.h new file mode 100644 index 00000000000..b985af5fee2 --- /dev/null +++ b/dep/StormLib/src/lzma/C/LzFindMt.h @@ -0,0 +1,105 @@ +/* LzFindMt.h -- multithreaded Match finder for LZ algorithms +2009-02-07 : Igor Pavlov : Public domain */ + +#ifndef __LZ_FIND_MT_H +#define __LZ_FIND_MT_H + +#include "LzFind.h" +#include "Threads.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define kMtHashBlockSize (1 << 13) +#define kMtHashNumBlocks (1 << 3) +#define kMtHashNumBlocksMask (kMtHashNumBlocks - 1) + +#define kMtBtBlockSize (1 << 14) +#define kMtBtNumBlocks (1 << 6) +#define kMtBtNumBlocksMask (kMtBtNumBlocks - 1) + +typedef struct _CMtSync +{ + Bool wasCreated; + Bool needStart; + Bool exit; + Bool stopWriting; + + CThread thread; + CAutoResetEvent canStart; + CAutoResetEvent wasStarted; + CAutoResetEvent wasStopped; + CSemaphore freeSemaphore; + CSemaphore filledSemaphore; + Bool csWasInitialized; + Bool csWasEntered; + CCriticalSection cs; + UInt32 numProcessedBlocks; +} CMtSync; + +typedef UInt32 * (*Mf_Mix_Matches)(void *p, UInt32 matchMinPos, UInt32 *distances); + +/* kMtCacheLineDummy must be >= size_of_CPU_cache_line */ +#define kMtCacheLineDummy 128 + +typedef void (*Mf_GetHeads)(const Byte *buffer, UInt32 pos, + UInt32 *hash, UInt32 hashMask, UInt32 *heads, UInt32 numHeads, const UInt32 *crc); + +typedef struct _CMatchFinderMt +{ + /* LZ */ + const Byte *pointerToCurPos; + UInt32 *btBuf; + UInt32 btBufPos; + UInt32 btBufPosLimit; + UInt32 lzPos; + UInt32 btNumAvailBytes; + + UInt32 *hash; + UInt32 fixedHashSize; + UInt32 historySize; + const UInt32 *crc; + + Mf_Mix_Matches MixMatchesFunc; + + /* LZ + BT */ + CMtSync btSync; + Byte btDummy[kMtCacheLineDummy]; + + /* BT */ + UInt32 *hashBuf; + UInt32 hashBufPos; + UInt32 hashBufPosLimit; + UInt32 hashNumAvail; + + CLzRef *son; + UInt32 matchMaxLen; + UInt32 numHashBytes; + UInt32 pos; + Byte *buffer; + UInt32 cyclicBufferPos; + UInt32 cyclicBufferSize; /* it must be historySize + 1 */ + UInt32 cutValue; + + /* BT + Hash */ + CMtSync hashSync; + /* Byte hashDummy[kMtCacheLineDummy]; */ + + /* Hash */ + Mf_GetHeads GetHeadsFunc; + CMatchFinder *MatchFinder; +} CMatchFinderMt; + +void MatchFinderMt_Construct(CMatchFinderMt *p); +void MatchFinderMt_Destruct(CMatchFinderMt *p, ISzAlloc *alloc); +SRes MatchFinderMt_Create(CMatchFinderMt *p, UInt32 historySize, UInt32 keepAddBufferBefore, + UInt32 matchMaxLen, UInt32 keepAddBufferAfter, ISzAlloc *alloc); +void MatchFinderMt_CreateVTable(CMatchFinderMt *p, IMatchFinder *vTable); +void MatchFinderMt_ReleaseStream(CMatchFinderMt *p); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/dep/StormLib/src/lzma/C/LzHash.h b/dep/StormLib/src/lzma/C/LzHash.h new file mode 100644 index 00000000000..f3e89966cc7 --- /dev/null +++ b/dep/StormLib/src/lzma/C/LzHash.h @@ -0,0 +1,54 @@ +/* LzHash.h -- HASH functions for LZ algorithms +2009-02-07 : Igor Pavlov : Public domain */ + +#ifndef __LZ_HASH_H +#define __LZ_HASH_H + +#define kHash2Size (1 << 10) +#define kHash3Size (1 << 16) +#define kHash4Size (1 << 20) + +#define kFix3HashSize (kHash2Size) +#define kFix4HashSize (kHash2Size + kHash3Size) +#define kFix5HashSize (kHash2Size + kHash3Size + kHash4Size) + +#define HASH2_CALC hashValue = cur[0] | ((UInt32)cur[1] << 8); + +#define HASH3_CALC { \ + UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ + hash2Value = temp & (kHash2Size - 1); \ + hashValue = (temp ^ ((UInt32)cur[2] << 8)) & p->hashMask; } + +#define HASH4_CALC { \ + UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ + hash2Value = temp & (kHash2Size - 1); \ + hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); \ + hashValue = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)) & p->hashMask; } + +#define HASH5_CALC { \ + UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ + hash2Value = temp & (kHash2Size - 1); \ + hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); \ + hash4Value = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)); \ + hashValue = (hash4Value ^ (p->crc[cur[4]] << 3)) & p->hashMask; \ + hash4Value &= (kHash4Size - 1); } + +/* #define HASH_ZIP_CALC hashValue = ((cur[0] | ((UInt32)cur[1] << 8)) ^ p->crc[cur[2]]) & 0xFFFF; */ +#define HASH_ZIP_CALC hashValue = ((cur[2] | ((UInt32)cur[0] << 8)) ^ p->crc[cur[1]]) & 0xFFFF; + + +#define MT_HASH2_CALC \ + hash2Value = (p->crc[cur[0]] ^ cur[1]) & (kHash2Size - 1); + +#define MT_HASH3_CALC { \ + UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ + hash2Value = temp & (kHash2Size - 1); \ + hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); } + +#define MT_HASH4_CALC { \ + UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ + hash2Value = temp & (kHash2Size - 1); \ + hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); \ + hash4Value = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)) & (kHash4Size - 1); } + +#endif diff --git a/dep/StormLib/src/lzma/C/LzmaDec.c b/dep/StormLib/src/lzma/C/LzmaDec.c new file mode 100644 index 00000000000..2036761bf14 --- /dev/null +++ b/dep/StormLib/src/lzma/C/LzmaDec.c @@ -0,0 +1,999 @@ +/* LzmaDec.c -- LZMA Decoder +2009-09-20 : Igor Pavlov : Public domain */ + +#include "LzmaDec.h" + +#include + +#define kNumTopBits 24 +#define kTopValue ((UInt32)1 << kNumTopBits) + +#define kNumBitModelTotalBits 11 +#define kBitModelTotal (1 << kNumBitModelTotalBits) +#define kNumMoveBits 5 + +#define RC_INIT_SIZE 5 + +#define NORMALIZE if (range < kTopValue) { range <<= 8; code = (code << 8) | (*buf++); } + +#define IF_BIT_0(p) ttt = *(p); NORMALIZE; bound = (range >> kNumBitModelTotalBits) * ttt; if (code < bound) +#define UPDATE_0(p) range = bound; *(p) = (CLzmaProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits)); +#define UPDATE_1(p) range -= bound; code -= bound; *(p) = (CLzmaProb)(ttt - (ttt >> kNumMoveBits)); +#define GET_BIT2(p, i, A0, A1) IF_BIT_0(p) \ + { UPDATE_0(p); i = (i + i); A0; } else \ + { UPDATE_1(p); i = (i + i) + 1; A1; } +#define GET_BIT(p, i) GET_BIT2(p, i, ; , ;) + +#define TREE_GET_BIT(probs, i) { GET_BIT((probs + i), i); } +#define TREE_DECODE(probs, limit, i) \ + { i = 1; do { TREE_GET_BIT(probs, i); } while (i < limit); i -= limit; } + +/* #define _LZMA_SIZE_OPT */ + +#ifdef _LZMA_SIZE_OPT +#define TREE_6_DECODE(probs, i) TREE_DECODE(probs, (1 << 6), i) +#else +#define TREE_6_DECODE(probs, i) \ + { i = 1; \ + TREE_GET_BIT(probs, i); \ + TREE_GET_BIT(probs, i); \ + TREE_GET_BIT(probs, i); \ + TREE_GET_BIT(probs, i); \ + TREE_GET_BIT(probs, i); \ + TREE_GET_BIT(probs, i); \ + i -= 0x40; } +#endif + +#define NORMALIZE_CHECK if (range < kTopValue) { if (buf >= bufLimit) return DUMMY_ERROR; range <<= 8; code = (code << 8) | (*buf++); } + +#define IF_BIT_0_CHECK(p) ttt = *(p); NORMALIZE_CHECK; bound = (range >> kNumBitModelTotalBits) * ttt; if (code < bound) +#define UPDATE_0_CHECK range = bound; +#define UPDATE_1_CHECK range -= bound; code -= bound; +#define GET_BIT2_CHECK(p, i, A0, A1) IF_BIT_0_CHECK(p) \ + { UPDATE_0_CHECK; i = (i + i); A0; } else \ + { UPDATE_1_CHECK; i = (i + i) + 1; A1; } +#define GET_BIT_CHECK(p, i) GET_BIT2_CHECK(p, i, ; , ;) +#define TREE_DECODE_CHECK(probs, limit, i) \ + { i = 1; do { GET_BIT_CHECK(probs + i, i) } while (i < limit); i -= limit; } + + +#define kNumPosBitsMax 4 +#define kNumPosStatesMax (1 << kNumPosBitsMax) + +#define kLenNumLowBits 3 +#define kLenNumLowSymbols (1 << kLenNumLowBits) +#define kLenNumMidBits 3 +#define kLenNumMidSymbols (1 << kLenNumMidBits) +#define kLenNumHighBits 8 +#define kLenNumHighSymbols (1 << kLenNumHighBits) + +#define LenChoice 0 +#define LenChoice2 (LenChoice + 1) +#define LenLow (LenChoice2 + 1) +#define LenMid (LenLow + (kNumPosStatesMax << kLenNumLowBits)) +#define LenHigh (LenMid + (kNumPosStatesMax << kLenNumMidBits)) +#define kNumLenProbs (LenHigh + kLenNumHighSymbols) + + +#define kNumStates 12 +#define kNumLitStates 7 + +#define kStartPosModelIndex 4 +#define kEndPosModelIndex 14 +#define kNumFullDistances (1 << (kEndPosModelIndex >> 1)) + +#define kNumPosSlotBits 6 +#define kNumLenToPosStates 4 + +#define kNumAlignBits 4 +#define kAlignTableSize (1 << kNumAlignBits) + +#define kMatchMinLen 2 +#define kMatchSpecLenStart (kMatchMinLen + kLenNumLowSymbols + kLenNumMidSymbols + kLenNumHighSymbols) + +#define IsMatch 0 +#define IsRep (IsMatch + (kNumStates << kNumPosBitsMax)) +#define IsRepG0 (IsRep + kNumStates) +#define IsRepG1 (IsRepG0 + kNumStates) +#define IsRepG2 (IsRepG1 + kNumStates) +#define IsRep0Long (IsRepG2 + kNumStates) +#define PosSlot (IsRep0Long + (kNumStates << kNumPosBitsMax)) +#define SpecPos (PosSlot + (kNumLenToPosStates << kNumPosSlotBits)) +#define Align (SpecPos + kNumFullDistances - kEndPosModelIndex) +#define LenCoder (Align + kAlignTableSize) +#define RepLenCoder (LenCoder + kNumLenProbs) +#define Literal (RepLenCoder + kNumLenProbs) + +#define LZMA_BASE_SIZE 1846 +#define LZMA_LIT_SIZE 768 + +#define LzmaProps_GetNumProbs(p) ((UInt32)LZMA_BASE_SIZE + (LZMA_LIT_SIZE << ((p)->lc + (p)->lp))) + +#if Literal != LZMA_BASE_SIZE +StopCompilingDueBUG +#endif + +#define LZMA_DIC_MIN (1 << 12) + +/* First LZMA-symbol is always decoded. +And it decodes new LZMA-symbols while (buf < bufLimit), but "buf" is without last normalization +Out: + Result: + SZ_OK - OK + SZ_ERROR_DATA - Error + p->remainLen: + < kMatchSpecLenStart : normal remain + = kMatchSpecLenStart : finished + = kMatchSpecLenStart + 1 : Flush marker + = kMatchSpecLenStart + 2 : State Init Marker +*/ + +static int MY_FAST_CALL LzmaDec_DecodeReal(CLzmaDec *p, SizeT limit, const Byte *bufLimit) +{ + CLzmaProb *probs = p->probs; + + unsigned state = p->state; + UInt32 rep0 = p->reps[0], rep1 = p->reps[1], rep2 = p->reps[2], rep3 = p->reps[3]; + unsigned pbMask = ((unsigned)1 << (p->prop.pb)) - 1; + unsigned lpMask = ((unsigned)1 << (p->prop.lp)) - 1; + unsigned lc = p->prop.lc; + + Byte *dic = p->dic; + SizeT dicBufSize = p->dicBufSize; + SizeT dicPos = p->dicPos; + + UInt32 processedPos = p->processedPos; + UInt32 checkDicSize = p->checkDicSize; + unsigned len = 0; + + const Byte *buf = p->buf; + UInt32 range = p->range; + UInt32 code = p->code; + + do + { + CLzmaProb *prob; + UInt32 bound; + unsigned ttt; + unsigned posState = processedPos & pbMask; + + prob = probs + IsMatch + (state << kNumPosBitsMax) + posState; + IF_BIT_0(prob) + { + unsigned symbol; + UPDATE_0(prob); + prob = probs + Literal; + if (checkDicSize != 0 || processedPos != 0) + prob += (LZMA_LIT_SIZE * (((processedPos & lpMask) << lc) + + (dic[(dicPos == 0 ? dicBufSize : dicPos) - 1] >> (8 - lc)))); + + if (state < kNumLitStates) + { + state -= (state < 4) ? state : 3; + symbol = 1; + do { GET_BIT(prob + symbol, symbol) } while (symbol < 0x100); + } + else + { + unsigned matchByte = p->dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)]; + unsigned offs = 0x100; + state -= (state < 10) ? 3 : 6; + symbol = 1; + do + { + unsigned bit; + CLzmaProb *probLit; + matchByte <<= 1; + bit = (matchByte & offs); + probLit = prob + offs + bit + symbol; + GET_BIT2(probLit, symbol, offs &= ~bit, offs &= bit) + } + while (symbol < 0x100); + } + dic[dicPos++] = (Byte)symbol; + processedPos++; + continue; + } + else + { + UPDATE_1(prob); + prob = probs + IsRep + state; + IF_BIT_0(prob) + { + UPDATE_0(prob); + state += kNumStates; + prob = probs + LenCoder; + } + else + { + UPDATE_1(prob); + if (checkDicSize == 0 && processedPos == 0) + return SZ_ERROR_DATA; + prob = probs + IsRepG0 + state; + IF_BIT_0(prob) + { + UPDATE_0(prob); + prob = probs + IsRep0Long + (state << kNumPosBitsMax) + posState; + IF_BIT_0(prob) + { + UPDATE_0(prob); + dic[dicPos] = dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)]; + dicPos++; + processedPos++; + state = state < kNumLitStates ? 9 : 11; + continue; + } + UPDATE_1(prob); + } + else + { + UInt32 distance; + UPDATE_1(prob); + prob = probs + IsRepG1 + state; + IF_BIT_0(prob) + { + UPDATE_0(prob); + distance = rep1; + } + else + { + UPDATE_1(prob); + prob = probs + IsRepG2 + state; + IF_BIT_0(prob) + { + UPDATE_0(prob); + distance = rep2; + } + else + { + UPDATE_1(prob); + distance = rep3; + rep3 = rep2; + } + rep2 = rep1; + } + rep1 = rep0; + rep0 = distance; + } + state = state < kNumLitStates ? 8 : 11; + prob = probs + RepLenCoder; + } + { + unsigned limit, offset; + CLzmaProb *probLen = prob + LenChoice; + IF_BIT_0(probLen) + { + UPDATE_0(probLen); + probLen = prob + LenLow + (posState << kLenNumLowBits); + offset = 0; + limit = (1 << kLenNumLowBits); + } + else + { + UPDATE_1(probLen); + probLen = prob + LenChoice2; + IF_BIT_0(probLen) + { + UPDATE_0(probLen); + probLen = prob + LenMid + (posState << kLenNumMidBits); + offset = kLenNumLowSymbols; + limit = (1 << kLenNumMidBits); + } + else + { + UPDATE_1(probLen); + probLen = prob + LenHigh; + offset = kLenNumLowSymbols + kLenNumMidSymbols; + limit = (1 << kLenNumHighBits); + } + } + TREE_DECODE(probLen, limit, len); + len += offset; + } + + if (state >= kNumStates) + { + UInt32 distance; + prob = probs + PosSlot + + ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) << kNumPosSlotBits); + TREE_6_DECODE(prob, distance); + if (distance >= kStartPosModelIndex) + { + unsigned posSlot = (unsigned)distance; + int numDirectBits = (int)(((distance >> 1) - 1)); + distance = (2 | (distance & 1)); + if (posSlot < kEndPosModelIndex) + { + distance <<= numDirectBits; + prob = probs + SpecPos + distance - posSlot - 1; + { + UInt32 mask = 1; + unsigned i = 1; + do + { + GET_BIT2(prob + i, i, ; , distance |= mask); + mask <<= 1; + } + while (--numDirectBits != 0); + } + } + else + { + numDirectBits -= kNumAlignBits; + do + { + NORMALIZE + range >>= 1; + + { + UInt32 t; + code -= range; + t = (0 - ((UInt32)code >> 31)); /* (UInt32)((Int32)code >> 31) */ + distance = (distance << 1) + (t + 1); + code += range & t; + } + /* + distance <<= 1; + if (code >= range) + { + code -= range; + distance |= 1; + } + */ + } + while (--numDirectBits != 0); + prob = probs + Align; + distance <<= kNumAlignBits; + { + unsigned i = 1; + GET_BIT2(prob + i, i, ; , distance |= 1); + GET_BIT2(prob + i, i, ; , distance |= 2); + GET_BIT2(prob + i, i, ; , distance |= 4); + GET_BIT2(prob + i, i, ; , distance |= 8); + } + if (distance == (UInt32)0xFFFFFFFF) + { + len += kMatchSpecLenStart; + state -= kNumStates; + break; + } + } + } + rep3 = rep2; + rep2 = rep1; + rep1 = rep0; + rep0 = distance + 1; + if (checkDicSize == 0) + { + if (distance >= processedPos) + return SZ_ERROR_DATA; + } + else if (distance >= checkDicSize) + return SZ_ERROR_DATA; + state = (state < kNumStates + kNumLitStates) ? kNumLitStates : kNumLitStates + 3; + } + + len += kMatchMinLen; + + if (limit == dicPos) + return SZ_ERROR_DATA; + { + SizeT rem = limit - dicPos; + unsigned curLen = ((rem < len) ? (unsigned)rem : len); + SizeT pos = (dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0); + + processedPos += curLen; + + len -= curLen; + if (pos + curLen <= dicBufSize) + { + Byte *dest = dic + dicPos; + ptrdiff_t src = (ptrdiff_t)pos - (ptrdiff_t)dicPos; + const Byte *lim = dest + curLen; + dicPos += curLen; + do + *(dest) = (Byte)*(dest + src); + while (++dest != lim); + } + else + { + do + { + dic[dicPos++] = dic[pos]; + if (++pos == dicBufSize) + pos = 0; + } + while (--curLen != 0); + } + } + } + } + while (dicPos < limit && buf < bufLimit); + NORMALIZE; + p->buf = buf; + p->range = range; + p->code = code; + p->remainLen = len; + p->dicPos = dicPos; + p->processedPos = processedPos; + p->reps[0] = rep0; + p->reps[1] = rep1; + p->reps[2] = rep2; + p->reps[3] = rep3; + p->state = state; + + return SZ_OK; +} + +static void MY_FAST_CALL LzmaDec_WriteRem(CLzmaDec *p, SizeT limit) +{ + if (p->remainLen != 0 && p->remainLen < kMatchSpecLenStart) + { + Byte *dic = p->dic; + SizeT dicPos = p->dicPos; + SizeT dicBufSize = p->dicBufSize; + unsigned len = p->remainLen; + UInt32 rep0 = p->reps[0]; + if (limit - dicPos < len) + len = (unsigned)(limit - dicPos); + + if (p->checkDicSize == 0 && p->prop.dicSize - p->processedPos <= len) + p->checkDicSize = p->prop.dicSize; + + p->processedPos += len; + p->remainLen -= len; + while (len-- != 0) + { + dic[dicPos] = dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)]; + dicPos++; + } + p->dicPos = dicPos; + } +} + +static int MY_FAST_CALL LzmaDec_DecodeReal2(CLzmaDec *p, SizeT limit, const Byte *bufLimit) +{ + do + { + SizeT limit2 = limit; + if (p->checkDicSize == 0) + { + UInt32 rem = p->prop.dicSize - p->processedPos; + if (limit - p->dicPos > rem) + limit2 = p->dicPos + rem; + } + RINOK(LzmaDec_DecodeReal(p, limit2, bufLimit)); + if (p->processedPos >= p->prop.dicSize) + p->checkDicSize = p->prop.dicSize; + LzmaDec_WriteRem(p, limit); + } + while (p->dicPos < limit && p->buf < bufLimit && p->remainLen < kMatchSpecLenStart); + + if (p->remainLen > kMatchSpecLenStart) + { + p->remainLen = kMatchSpecLenStart; + } + return 0; +} + +typedef enum +{ + DUMMY_ERROR, /* unexpected end of input stream */ + DUMMY_LIT, + DUMMY_MATCH, + DUMMY_REP +} ELzmaDummy; + +static ELzmaDummy LzmaDec_TryDummy(const CLzmaDec *p, const Byte *buf, SizeT inSize) +{ + UInt32 range = p->range; + UInt32 code = p->code; + const Byte *bufLimit = buf + inSize; + CLzmaProb *probs = p->probs; + unsigned state = p->state; + ELzmaDummy res; + + { + CLzmaProb *prob; + UInt32 bound; + unsigned ttt; + unsigned posState = (p->processedPos) & ((1 << p->prop.pb) - 1); + + prob = probs + IsMatch + (state << kNumPosBitsMax) + posState; + IF_BIT_0_CHECK(prob) + { + UPDATE_0_CHECK + + /* if (bufLimit - buf >= 7) return DUMMY_LIT; */ + + prob = probs + Literal; + if (p->checkDicSize != 0 || p->processedPos != 0) + prob += (LZMA_LIT_SIZE * + ((((p->processedPos) & ((1 << (p->prop.lp)) - 1)) << p->prop.lc) + + (p->dic[(p->dicPos == 0 ? p->dicBufSize : p->dicPos) - 1] >> (8 - p->prop.lc)))); + + if (state < kNumLitStates) + { + unsigned symbol = 1; + do { GET_BIT_CHECK(prob + symbol, symbol) } while (symbol < 0x100); + } + else + { + unsigned matchByte = p->dic[p->dicPos - p->reps[0] + + ((p->dicPos < p->reps[0]) ? p->dicBufSize : 0)]; + unsigned offs = 0x100; + unsigned symbol = 1; + do + { + unsigned bit; + CLzmaProb *probLit; + matchByte <<= 1; + bit = (matchByte & offs); + probLit = prob + offs + bit + symbol; + GET_BIT2_CHECK(probLit, symbol, offs &= ~bit, offs &= bit) + } + while (symbol < 0x100); + } + res = DUMMY_LIT; + } + else + { + unsigned len; + UPDATE_1_CHECK; + + prob = probs + IsRep + state; + IF_BIT_0_CHECK(prob) + { + UPDATE_0_CHECK; + state = 0; + prob = probs + LenCoder; + res = DUMMY_MATCH; + } + else + { + UPDATE_1_CHECK; + res = DUMMY_REP; + prob = probs + IsRepG0 + state; + IF_BIT_0_CHECK(prob) + { + UPDATE_0_CHECK; + prob = probs + IsRep0Long + (state << kNumPosBitsMax) + posState; + IF_BIT_0_CHECK(prob) + { + UPDATE_0_CHECK; + NORMALIZE_CHECK; + return DUMMY_REP; + } + else + { + UPDATE_1_CHECK; + } + } + else + { + UPDATE_1_CHECK; + prob = probs + IsRepG1 + state; + IF_BIT_0_CHECK(prob) + { + UPDATE_0_CHECK; + } + else + { + UPDATE_1_CHECK; + prob = probs + IsRepG2 + state; + IF_BIT_0_CHECK(prob) + { + UPDATE_0_CHECK; + } + else + { + UPDATE_1_CHECK; + } + } + } + state = kNumStates; + prob = probs + RepLenCoder; + } + { + unsigned limit, offset; + CLzmaProb *probLen = prob + LenChoice; + IF_BIT_0_CHECK(probLen) + { + UPDATE_0_CHECK; + probLen = prob + LenLow + (posState << kLenNumLowBits); + offset = 0; + limit = 1 << kLenNumLowBits; + } + else + { + UPDATE_1_CHECK; + probLen = prob + LenChoice2; + IF_BIT_0_CHECK(probLen) + { + UPDATE_0_CHECK; + probLen = prob + LenMid + (posState << kLenNumMidBits); + offset = kLenNumLowSymbols; + limit = 1 << kLenNumMidBits; + } + else + { + UPDATE_1_CHECK; + probLen = prob + LenHigh; + offset = kLenNumLowSymbols + kLenNumMidSymbols; + limit = 1 << kLenNumHighBits; + } + } + TREE_DECODE_CHECK(probLen, limit, len); + len += offset; + } + + if (state < 4) + { + unsigned posSlot; + prob = probs + PosSlot + + ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) << + kNumPosSlotBits); + TREE_DECODE_CHECK(prob, 1 << kNumPosSlotBits, posSlot); + if (posSlot >= kStartPosModelIndex) + { + int numDirectBits = ((posSlot >> 1) - 1); + + /* if (bufLimit - buf >= 8) return DUMMY_MATCH; */ + + if (posSlot < kEndPosModelIndex) + { + prob = probs + SpecPos + ((2 | (posSlot & 1)) << numDirectBits) - posSlot - 1; + } + else + { + numDirectBits -= kNumAlignBits; + do + { + NORMALIZE_CHECK + range >>= 1; + code -= range & (((code - range) >> 31) - 1); + /* if (code >= range) code -= range; */ + } + while (--numDirectBits != 0); + prob = probs + Align; + numDirectBits = kNumAlignBits; + } + { + unsigned i = 1; + do + { + GET_BIT_CHECK(prob + i, i); + } + while (--numDirectBits != 0); + } + } + } + } + } + NORMALIZE_CHECK; + return res; +} + + +static void LzmaDec_InitRc(CLzmaDec *p, const Byte *data) +{ + p->code = ((UInt32)data[1] << 24) | ((UInt32)data[2] << 16) | ((UInt32)data[3] << 8) | ((UInt32)data[4]); + p->range = 0xFFFFFFFF; + p->needFlush = 0; +} + +void LzmaDec_InitDicAndState(CLzmaDec *p, Bool initDic, Bool initState) +{ + p->needFlush = 1; + p->remainLen = 0; + p->tempBufSize = 0; + + if (initDic) + { + p->processedPos = 0; + p->checkDicSize = 0; + p->needInitState = 1; + } + if (initState) + p->needInitState = 1; +} + +void LzmaDec_Init(CLzmaDec *p) +{ + p->dicPos = 0; + LzmaDec_InitDicAndState(p, True, True); +} + +static void LzmaDec_InitStateReal(CLzmaDec *p) +{ + UInt32 numProbs = Literal + ((UInt32)LZMA_LIT_SIZE << (p->prop.lc + p->prop.lp)); + UInt32 i; + CLzmaProb *probs = p->probs; + for (i = 0; i < numProbs; i++) + probs[i] = kBitModelTotal >> 1; + p->reps[0] = p->reps[1] = p->reps[2] = p->reps[3] = 1; + p->state = 0; + p->needInitState = 0; +} + +SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit, const Byte *src, SizeT *srcLen, + ELzmaFinishMode finishMode, ELzmaStatus *status) +{ + SizeT inSize = *srcLen; + (*srcLen) = 0; + LzmaDec_WriteRem(p, dicLimit); + + *status = LZMA_STATUS_NOT_SPECIFIED; + + while (p->remainLen != kMatchSpecLenStart) + { + int checkEndMarkNow; + + if (p->needFlush != 0) + { + for (; inSize > 0 && p->tempBufSize < RC_INIT_SIZE; (*srcLen)++, inSize--) + p->tempBuf[p->tempBufSize++] = *src++; + if (p->tempBufSize < RC_INIT_SIZE) + { + *status = LZMA_STATUS_NEEDS_MORE_INPUT; + return SZ_OK; + } + if (p->tempBuf[0] != 0) + return SZ_ERROR_DATA; + + LzmaDec_InitRc(p, p->tempBuf); + p->tempBufSize = 0; + } + + checkEndMarkNow = 0; + if (p->dicPos >= dicLimit) + { + if (p->remainLen == 0 && p->code == 0) + { + *status = LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK; + return SZ_OK; + } + if (finishMode == LZMA_FINISH_ANY) + { + *status = LZMA_STATUS_NOT_FINISHED; + return SZ_OK; + } + if (p->remainLen != 0) + { + *status = LZMA_STATUS_NOT_FINISHED; + return SZ_ERROR_DATA; + } + checkEndMarkNow = 1; + } + + if (p->needInitState) + LzmaDec_InitStateReal(p); + + if (p->tempBufSize == 0) + { + SizeT processed; + const Byte *bufLimit; + if (inSize < LZMA_REQUIRED_INPUT_MAX || checkEndMarkNow) + { + int dummyRes = LzmaDec_TryDummy(p, src, inSize); + if (dummyRes == DUMMY_ERROR) + { + memcpy(p->tempBuf, src, inSize); + p->tempBufSize = (unsigned)inSize; + (*srcLen) += inSize; + *status = LZMA_STATUS_NEEDS_MORE_INPUT; + return SZ_OK; + } + if (checkEndMarkNow && dummyRes != DUMMY_MATCH) + { + *status = LZMA_STATUS_NOT_FINISHED; + return SZ_ERROR_DATA; + } + bufLimit = src; + } + else + bufLimit = src + inSize - LZMA_REQUIRED_INPUT_MAX; + p->buf = src; + if (LzmaDec_DecodeReal2(p, dicLimit, bufLimit) != 0) + return SZ_ERROR_DATA; + processed = (SizeT)(p->buf - src); + (*srcLen) += processed; + src += processed; + inSize -= processed; + } + else + { + unsigned rem = p->tempBufSize, lookAhead = 0; + while (rem < LZMA_REQUIRED_INPUT_MAX && lookAhead < inSize) + p->tempBuf[rem++] = src[lookAhead++]; + p->tempBufSize = rem; + if (rem < LZMA_REQUIRED_INPUT_MAX || checkEndMarkNow) + { + int dummyRes = LzmaDec_TryDummy(p, p->tempBuf, rem); + if (dummyRes == DUMMY_ERROR) + { + (*srcLen) += lookAhead; + *status = LZMA_STATUS_NEEDS_MORE_INPUT; + return SZ_OK; + } + if (checkEndMarkNow && dummyRes != DUMMY_MATCH) + { + *status = LZMA_STATUS_NOT_FINISHED; + return SZ_ERROR_DATA; + } + } + p->buf = p->tempBuf; + if (LzmaDec_DecodeReal2(p, dicLimit, p->buf) != 0) + return SZ_ERROR_DATA; + lookAhead -= (rem - (unsigned)(p->buf - p->tempBuf)); + (*srcLen) += lookAhead; + src += lookAhead; + inSize -= lookAhead; + p->tempBufSize = 0; + } + } + if (p->code == 0) + *status = LZMA_STATUS_FINISHED_WITH_MARK; + return (p->code == 0) ? SZ_OK : SZ_ERROR_DATA; +} + +SRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status) +{ + SizeT outSize = *destLen; + SizeT inSize = *srcLen; + *srcLen = *destLen = 0; + for (;;) + { + SizeT inSizeCur = inSize, outSizeCur, dicPos; + ELzmaFinishMode curFinishMode; + SRes res; + if (p->dicPos == p->dicBufSize) + p->dicPos = 0; + dicPos = p->dicPos; + if (outSize > p->dicBufSize - dicPos) + { + outSizeCur = p->dicBufSize; + curFinishMode = LZMA_FINISH_ANY; + } + else + { + outSizeCur = dicPos + outSize; + curFinishMode = finishMode; + } + + res = LzmaDec_DecodeToDic(p, outSizeCur, src, &inSizeCur, curFinishMode, status); + src += inSizeCur; + inSize -= inSizeCur; + *srcLen += inSizeCur; + outSizeCur = p->dicPos - dicPos; + memcpy(dest, p->dic + dicPos, outSizeCur); + dest += outSizeCur; + outSize -= outSizeCur; + *destLen += outSizeCur; + if (res != 0) + return res; + if (outSizeCur == 0 || outSize == 0) + return SZ_OK; + } +} + +void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc) +{ + alloc->Free(alloc, p->probs); + p->probs = 0; +} + +static void LzmaDec_FreeDict(CLzmaDec *p, ISzAlloc *alloc) +{ + alloc->Free(alloc, p->dic); + p->dic = 0; +} + +void LzmaDec_Free(CLzmaDec *p, ISzAlloc *alloc) +{ + LzmaDec_FreeProbs(p, alloc); + LzmaDec_FreeDict(p, alloc); +} + +SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size) +{ + UInt32 dicSize; + Byte d; + + if (size < LZMA_PROPS_SIZE) + return SZ_ERROR_UNSUPPORTED; + else + dicSize = data[1] | ((UInt32)data[2] << 8) | ((UInt32)data[3] << 16) | ((UInt32)data[4] << 24); + + if (dicSize < LZMA_DIC_MIN) + dicSize = LZMA_DIC_MIN; + p->dicSize = dicSize; + + d = data[0]; + if (d >= (9 * 5 * 5)) + return SZ_ERROR_UNSUPPORTED; + + p->lc = d % 9; + d /= 9; + p->pb = d / 5; + p->lp = d % 5; + + return SZ_OK; +} + +static SRes LzmaDec_AllocateProbs2(CLzmaDec *p, const CLzmaProps *propNew, ISzAlloc *alloc) +{ + UInt32 numProbs = LzmaProps_GetNumProbs(propNew); + if (p->probs == 0 || numProbs != p->numProbs) + { + LzmaDec_FreeProbs(p, alloc); + p->probs = (CLzmaProb *)alloc->Alloc(alloc, numProbs * sizeof(CLzmaProb)); + p->numProbs = numProbs; + if (p->probs == 0) + return SZ_ERROR_MEM; + } + return SZ_OK; +} + +SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc) +{ + CLzmaProps propNew; + RINOK(LzmaProps_Decode(&propNew, props, propsSize)); + RINOK(LzmaDec_AllocateProbs2(p, &propNew, alloc)); + p->prop = propNew; + return SZ_OK; +} + +SRes LzmaDec_Allocate(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc) +{ + CLzmaProps propNew; + SizeT dicBufSize; + RINOK(LzmaProps_Decode(&propNew, props, propsSize)); + RINOK(LzmaDec_AllocateProbs2(p, &propNew, alloc)); + dicBufSize = propNew.dicSize; + if (p->dic == 0 || dicBufSize != p->dicBufSize) + { + LzmaDec_FreeDict(p, alloc); + p->dic = (Byte *)alloc->Alloc(alloc, dicBufSize); + if (p->dic == 0) + { + LzmaDec_FreeProbs(p, alloc); + return SZ_ERROR_MEM; + } + } + p->dicBufSize = dicBufSize; + p->prop = propNew; + return SZ_OK; +} + +SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, + const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode, + ELzmaStatus *status, ISzAlloc *alloc) +{ + CLzmaDec p; + SRes res; + SizeT inSize = *srcLen; + SizeT outSize = *destLen; + *srcLen = *destLen = 0; + if (inSize < RC_INIT_SIZE) + return SZ_ERROR_INPUT_EOF; + + LzmaDec_Construct(&p); + res = LzmaDec_AllocateProbs(&p, propData, propSize, alloc); + if (res != 0) + return res; + p.dic = dest; + p.dicBufSize = outSize; + + LzmaDec_Init(&p); + + *srcLen = inSize; + res = LzmaDec_DecodeToDic(&p, outSize, src, srcLen, finishMode, status); + + if (res == SZ_OK && *status == LZMA_STATUS_NEEDS_MORE_INPUT) + res = SZ_ERROR_INPUT_EOF; + + (*destLen) = p.dicPos; + LzmaDec_FreeProbs(&p, alloc); + return res; +} diff --git a/dep/StormLib/src/lzma/C/LzmaDec.h b/dep/StormLib/src/lzma/C/LzmaDec.h new file mode 100644 index 00000000000..bf7f084ba3d --- /dev/null +++ b/dep/StormLib/src/lzma/C/LzmaDec.h @@ -0,0 +1,231 @@ +/* LzmaDec.h -- LZMA Decoder +2009-02-07 : Igor Pavlov : Public domain */ + +#ifndef __LZMA_DEC_H +#define __LZMA_DEC_H + +#include "Types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* #define _LZMA_PROB32 */ +/* _LZMA_PROB32 can increase the speed on some CPUs, + but memory usage for CLzmaDec::probs will be doubled in that case */ + +#ifdef _LZMA_PROB32 +#define CLzmaProb UInt32 +#else +#define CLzmaProb UInt16 +#endif + + +/* ---------- LZMA Properties ---------- */ + +#define LZMA_PROPS_SIZE 5 + +typedef struct _CLzmaProps +{ + unsigned lc, lp, pb; + UInt32 dicSize; +} CLzmaProps; + +/* LzmaProps_Decode - decodes properties +Returns: + SZ_OK + SZ_ERROR_UNSUPPORTED - Unsupported properties +*/ + +SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size); + + +/* ---------- LZMA Decoder state ---------- */ + +/* LZMA_REQUIRED_INPUT_MAX = number of required input bytes for worst case. + Num bits = log2((2^11 / 31) ^ 22) + 26 < 134 + 26 = 160; */ + +#define LZMA_REQUIRED_INPUT_MAX 20 + +typedef struct +{ + CLzmaProps prop; + CLzmaProb *probs; + Byte *dic; + const Byte *buf; + UInt32 range, code; + SizeT dicPos; + SizeT dicBufSize; + UInt32 processedPos; + UInt32 checkDicSize; + unsigned state; + UInt32 reps[4]; + unsigned remainLen; + int needFlush; + int needInitState; + UInt32 numProbs; + unsigned tempBufSize; + Byte tempBuf[LZMA_REQUIRED_INPUT_MAX]; +} CLzmaDec; + +#define LzmaDec_Construct(p) { (p)->dic = 0; (p)->probs = 0; } + +void LzmaDec_Init(CLzmaDec *p); + +/* There are two types of LZMA streams: + 0) Stream with end mark. That end mark adds about 6 bytes to compressed size. + 1) Stream without end mark. You must know exact uncompressed size to decompress such stream. */ + +typedef enum +{ + LZMA_FINISH_ANY, /* finish at any point */ + LZMA_FINISH_END /* block must be finished at the end */ +} ELzmaFinishMode; + +/* ELzmaFinishMode has meaning only if the decoding reaches output limit !!! + + You must use LZMA_FINISH_END, when you know that current output buffer + covers last bytes of block. In other cases you must use LZMA_FINISH_ANY. + + If LZMA decoder sees end marker before reaching output limit, it returns SZ_OK, + and output value of destLen will be less than output buffer size limit. + You can check status result also. + + You can use multiple checks to test data integrity after full decompression: + 1) Check Result and "status" variable. + 2) Check that output(destLen) = uncompressedSize, if you know real uncompressedSize. + 3) Check that output(srcLen) = compressedSize, if you know real compressedSize. + You must use correct finish mode in that case. */ + +typedef enum +{ + LZMA_STATUS_NOT_SPECIFIED, /* use main error code instead */ + LZMA_STATUS_FINISHED_WITH_MARK, /* stream was finished with end mark. */ + LZMA_STATUS_NOT_FINISHED, /* stream was not finished */ + LZMA_STATUS_NEEDS_MORE_INPUT, /* you must provide more input bytes */ + LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK /* there is probability that stream was finished without end mark */ +} ELzmaStatus; + +/* ELzmaStatus is used only as output value for function call */ + + +/* ---------- Interfaces ---------- */ + +/* There are 3 levels of interfaces: + 1) Dictionary Interface + 2) Buffer Interface + 3) One Call Interface + You can select any of these interfaces, but don't mix functions from different + groups for same object. */ + + +/* There are two variants to allocate state for Dictionary Interface: + 1) LzmaDec_Allocate / LzmaDec_Free + 2) LzmaDec_AllocateProbs / LzmaDec_FreeProbs + You can use variant 2, if you set dictionary buffer manually. + For Buffer Interface you must always use variant 1. + +LzmaDec_Allocate* can return: + SZ_OK + SZ_ERROR_MEM - Memory allocation error + SZ_ERROR_UNSUPPORTED - Unsupported properties +*/ + +SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc); +void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc); + +SRes LzmaDec_Allocate(CLzmaDec *state, const Byte *prop, unsigned propsSize, ISzAlloc *alloc); +void LzmaDec_Free(CLzmaDec *state, ISzAlloc *alloc); + +/* ---------- Dictionary Interface ---------- */ + +/* You can use it, if you want to eliminate the overhead for data copying from + dictionary to some other external buffer. + You must work with CLzmaDec variables directly in this interface. + + STEPS: + LzmaDec_Constr() + LzmaDec_Allocate() + for (each new stream) + { + LzmaDec_Init() + while (it needs more decompression) + { + LzmaDec_DecodeToDic() + use data from CLzmaDec::dic and update CLzmaDec::dicPos + } + } + LzmaDec_Free() +*/ + +/* LzmaDec_DecodeToDic + + The decoding to internal dictionary buffer (CLzmaDec::dic). + You must manually update CLzmaDec::dicPos, if it reaches CLzmaDec::dicBufSize !!! + +finishMode: + It has meaning only if the decoding reaches output limit (dicLimit). + LZMA_FINISH_ANY - Decode just dicLimit bytes. + LZMA_FINISH_END - Stream must be finished after dicLimit. + +Returns: + SZ_OK + status: + LZMA_STATUS_FINISHED_WITH_MARK + LZMA_STATUS_NOT_FINISHED + LZMA_STATUS_NEEDS_MORE_INPUT + LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK + SZ_ERROR_DATA - Data error +*/ + +SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit, + const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status); + + +/* ---------- Buffer Interface ---------- */ + +/* It's zlib-like interface. + See LzmaDec_DecodeToDic description for information about STEPS and return results, + but you must use LzmaDec_DecodeToBuf instead of LzmaDec_DecodeToDic and you don't need + to work with CLzmaDec variables manually. + +finishMode: + It has meaning only if the decoding reaches output limit (*destLen). + LZMA_FINISH_ANY - Decode just destLen bytes. + LZMA_FINISH_END - Stream must be finished after (*destLen). +*/ + +SRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen, + const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status); + + +/* ---------- One Call Interface ---------- */ + +/* LzmaDecode + +finishMode: + It has meaning only if the decoding reaches output limit (*destLen). + LZMA_FINISH_ANY - Decode just destLen bytes. + LZMA_FINISH_END - Stream must be finished after (*destLen). + +Returns: + SZ_OK + status: + LZMA_STATUS_FINISHED_WITH_MARK + LZMA_STATUS_NOT_FINISHED + LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK + SZ_ERROR_DATA - Data error + SZ_ERROR_MEM - Memory allocation error + SZ_ERROR_UNSUPPORTED - Unsupported properties + SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src). +*/ + +SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, + const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode, + ELzmaStatus *status, ISzAlloc *alloc); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/dep/StormLib/src/lzma/C/LzmaEnc.c b/dep/StormLib/src/lzma/C/LzmaEnc.c new file mode 100644 index 00000000000..169d4f4639e --- /dev/null +++ b/dep/StormLib/src/lzma/C/LzmaEnc.c @@ -0,0 +1,2268 @@ +/* LzmaEnc.c -- LZMA Encoder +2009-11-24 : Igor Pavlov : Public domain */ + +#include + +/* #define SHOW_STAT */ +/* #define SHOW_STAT2 */ + +#if defined(SHOW_STAT) || defined(SHOW_STAT2) +#include +#endif + +#include "LzmaEnc.h" + +#include "LzFind.h" +#ifndef _7ZIP_ST +#include "LzFindMt.h" +#endif + +#ifdef SHOW_STAT +static int ttt = 0; +#endif + +#define kBlockSizeMax ((1 << LZMA_NUM_BLOCK_SIZE_BITS) - 1) + +#define kBlockSize (9 << 10) +#define kUnpackBlockSize (1 << 18) +#define kMatchArraySize (1 << 21) +#define kMatchRecordMaxSize ((LZMA_MATCH_LEN_MAX * 2 + 3) * LZMA_MATCH_LEN_MAX) + +#define kNumMaxDirectBits (31) + +#define kNumTopBits 24 +#define kTopValue ((UInt32)1 << kNumTopBits) + +#define kNumBitModelTotalBits 11 +#define kBitModelTotal (1 << kNumBitModelTotalBits) +#define kNumMoveBits 5 +#define kProbInitValue (kBitModelTotal >> 1) + +#define kNumMoveReducingBits 4 +#define kNumBitPriceShiftBits 4 +#define kBitPrice (1 << kNumBitPriceShiftBits) + +void LzmaEncProps_Init(CLzmaEncProps *p) +{ + p->level = 5; + p->dictSize = p->mc = 0; + p->lc = p->lp = p->pb = p->algo = p->fb = p->btMode = p->numHashBytes = p->numThreads = -1; + p->writeEndMark = 0; +} + +void LzmaEncProps_Normalize(CLzmaEncProps *p) +{ + int level = p->level; + if (level < 0) level = 5; + p->level = level; + if (p->dictSize == 0) p->dictSize = (level <= 5 ? (1 << (level * 2 + 14)) : (level == 6 ? (1 << 25) : (1 << 26))); + if (p->lc < 0) p->lc = 3; + if (p->lp < 0) p->lp = 0; + if (p->pb < 0) p->pb = 2; + if (p->algo < 0) p->algo = (level < 5 ? 0 : 1); + if (p->fb < 0) p->fb = (level < 7 ? 32 : 64); + if (p->btMode < 0) p->btMode = (p->algo == 0 ? 0 : 1); + if (p->numHashBytes < 0) p->numHashBytes = 4; + if (p->mc == 0) p->mc = (16 + (p->fb >> 1)) >> (p->btMode ? 0 : 1); + if (p->numThreads < 0) + p->numThreads = + #ifndef _7ZIP_ST + ((p->btMode && p->algo) ? 2 : 1); + #else + 1; + #endif +} + +UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2) +{ + CLzmaEncProps props = *props2; + LzmaEncProps_Normalize(&props); + return props.dictSize; +} + +/* #define LZMA_LOG_BSR */ +/* Define it for Intel's CPU */ + + +#ifdef LZMA_LOG_BSR + +#define kDicLogSizeMaxCompress 30 + +#define BSR2_RET(pos, res) { unsigned long i; _BitScanReverse(&i, (pos)); res = (i + i) + ((pos >> (i - 1)) & 1); } + +UInt32 GetPosSlot1(UInt32 pos) +{ + UInt32 res; + BSR2_RET(pos, res); + return res; +} +#define GetPosSlot2(pos, res) { BSR2_RET(pos, res); } +#define GetPosSlot(pos, res) { if (pos < 2) res = pos; else BSR2_RET(pos, res); } + +#else + +#define kNumLogBits (9 + (int)sizeof(size_t) / 2) +#define kDicLogSizeMaxCompress ((kNumLogBits - 1) * 2 + 7) + +void LzmaEnc_FastPosInit(Byte *g_FastPos) +{ + int c = 2, slotFast; + g_FastPos[0] = 0; + g_FastPos[1] = 1; + + for (slotFast = 2; slotFast < kNumLogBits * 2; slotFast++) + { + UInt32 k = (1 << ((slotFast >> 1) - 1)); + UInt32 j; + for (j = 0; j < k; j++, c++) + g_FastPos[c] = (Byte)slotFast; + } +} + +#define BSR2_RET(pos, res) { UInt32 i = 6 + ((kNumLogBits - 1) & \ + (0 - (((((UInt32)1 << (kNumLogBits + 6)) - 1) - pos) >> 31))); \ + res = p->g_FastPos[pos >> i] + (i * 2); } +/* +#define BSR2_RET(pos, res) { res = (pos < (1 << (kNumLogBits + 6))) ? \ + p->g_FastPos[pos >> 6] + 12 : \ + p->g_FastPos[pos >> (6 + kNumLogBits - 1)] + (6 + (kNumLogBits - 1)) * 2; } +*/ + +#define GetPosSlot1(pos) p->g_FastPos[pos] +#define GetPosSlot2(pos, res) { BSR2_RET(pos, res); } +#define GetPosSlot(pos, res) { if (pos < kNumFullDistances) res = p->g_FastPos[pos]; else BSR2_RET(pos, res); } + +#endif + + +#define LZMA_NUM_REPS 4 + +typedef unsigned CState; + +typedef struct +{ + UInt32 price; + + CState state; + int prev1IsChar; + int prev2; + + UInt32 posPrev2; + UInt32 backPrev2; + + UInt32 posPrev; + UInt32 backPrev; + UInt32 backs[LZMA_NUM_REPS]; +} COptimal; + +#define kNumOpts (1 << 12) + +#define kNumLenToPosStates 4 +#define kNumPosSlotBits 6 +#define kDicLogSizeMin 0 +#define kDicLogSizeMax 32 +#define kDistTableSizeMax (kDicLogSizeMax * 2) + + +#define kNumAlignBits 4 +#define kAlignTableSize (1 << kNumAlignBits) +#define kAlignMask (kAlignTableSize - 1) + +#define kStartPosModelIndex 4 +#define kEndPosModelIndex 14 +#define kNumPosModels (kEndPosModelIndex - kStartPosModelIndex) + +#define kNumFullDistances (1 << (kEndPosModelIndex >> 1)) + +#ifdef _LZMA_PROB32 +#define CLzmaProb UInt32 +#else +#define CLzmaProb UInt16 +#endif + +#define LZMA_PB_MAX 4 +#define LZMA_LC_MAX 8 +#define LZMA_LP_MAX 4 + +#define LZMA_NUM_PB_STATES_MAX (1 << LZMA_PB_MAX) + + +#define kLenNumLowBits 3 +#define kLenNumLowSymbols (1 << kLenNumLowBits) +#define kLenNumMidBits 3 +#define kLenNumMidSymbols (1 << kLenNumMidBits) +#define kLenNumHighBits 8 +#define kLenNumHighSymbols (1 << kLenNumHighBits) + +#define kLenNumSymbolsTotal (kLenNumLowSymbols + kLenNumMidSymbols + kLenNumHighSymbols) + +#define LZMA_MATCH_LEN_MIN 2 +#define LZMA_MATCH_LEN_MAX (LZMA_MATCH_LEN_MIN + kLenNumSymbolsTotal - 1) + +#define kNumStates 12 + +typedef struct +{ + CLzmaProb choice; + CLzmaProb choice2; + CLzmaProb low[LZMA_NUM_PB_STATES_MAX << kLenNumLowBits]; + CLzmaProb mid[LZMA_NUM_PB_STATES_MAX << kLenNumMidBits]; + CLzmaProb high[kLenNumHighSymbols]; +} CLenEnc; + +typedef struct +{ + CLenEnc p; + UInt32 prices[LZMA_NUM_PB_STATES_MAX][kLenNumSymbolsTotal]; + UInt32 tableSize; + UInt32 counters[LZMA_NUM_PB_STATES_MAX]; +} CLenPriceEnc; + +typedef struct +{ + UInt32 range; + Byte cache; + UInt64 low; + UInt64 cacheSize; + Byte *buf; + Byte *bufLim; + Byte *bufBase; + ISeqOutStream *outStream; + UInt64 processed; + SRes res; +} CRangeEnc; + +typedef struct +{ + CLzmaProb *litProbs; + + CLzmaProb isMatch[kNumStates][LZMA_NUM_PB_STATES_MAX]; + CLzmaProb isRep[kNumStates]; + CLzmaProb isRepG0[kNumStates]; + CLzmaProb isRepG1[kNumStates]; + CLzmaProb isRepG2[kNumStates]; + CLzmaProb isRep0Long[kNumStates][LZMA_NUM_PB_STATES_MAX]; + + CLzmaProb posSlotEncoder[kNumLenToPosStates][1 << kNumPosSlotBits]; + CLzmaProb posEncoders[kNumFullDistances - kEndPosModelIndex]; + CLzmaProb posAlignEncoder[1 << kNumAlignBits]; + + CLenPriceEnc lenEnc; + CLenPriceEnc repLenEnc; + + UInt32 reps[LZMA_NUM_REPS]; + UInt32 state; +} CSaveState; + +typedef struct +{ + IMatchFinder matchFinder; + void *matchFinderObj; + + #ifndef _7ZIP_ST + Bool mtMode; + CMatchFinderMt matchFinderMt; + #endif + + CMatchFinder matchFinderBase; + + #ifndef _7ZIP_ST + Byte pad[128]; + #endif + + UInt32 optimumEndIndex; + UInt32 optimumCurrentIndex; + + UInt32 longestMatchLength; + UInt32 numPairs; + UInt32 numAvail; + COptimal opt[kNumOpts]; + + #ifndef LZMA_LOG_BSR + Byte g_FastPos[1 << kNumLogBits]; + #endif + + UInt32 ProbPrices[kBitModelTotal >> kNumMoveReducingBits]; + UInt32 matches[LZMA_MATCH_LEN_MAX * 2 + 2 + 1]; + UInt32 numFastBytes; + UInt32 additionalOffset; + UInt32 reps[LZMA_NUM_REPS]; + UInt32 state; + + UInt32 posSlotPrices[kNumLenToPosStates][kDistTableSizeMax]; + UInt32 distancesPrices[kNumLenToPosStates][kNumFullDistances]; + UInt32 alignPrices[kAlignTableSize]; + UInt32 alignPriceCount; + + UInt32 distTableSize; + + unsigned lc, lp, pb; + unsigned lpMask, pbMask; + + CLzmaProb *litProbs; + + CLzmaProb isMatch[kNumStates][LZMA_NUM_PB_STATES_MAX]; + CLzmaProb isRep[kNumStates]; + CLzmaProb isRepG0[kNumStates]; + CLzmaProb isRepG1[kNumStates]; + CLzmaProb isRepG2[kNumStates]; + CLzmaProb isRep0Long[kNumStates][LZMA_NUM_PB_STATES_MAX]; + + CLzmaProb posSlotEncoder[kNumLenToPosStates][1 << kNumPosSlotBits]; + CLzmaProb posEncoders[kNumFullDistances - kEndPosModelIndex]; + CLzmaProb posAlignEncoder[1 << kNumAlignBits]; + + CLenPriceEnc lenEnc; + CLenPriceEnc repLenEnc; + + unsigned lclp; + + Bool fastMode; + + CRangeEnc rc; + + Bool writeEndMark; + UInt64 nowPos64; + UInt32 matchPriceCount; + Bool finished; + Bool multiThread; + + SRes result; + UInt32 dictSize; + UInt32 matchFinderCycles; + + int needInit; + + CSaveState saveState; +} CLzmaEnc; + +void LzmaEnc_SaveState(CLzmaEncHandle pp) +{ + CLzmaEnc *p = (CLzmaEnc *)pp; + CSaveState *dest = &p->saveState; + int i; + dest->lenEnc = p->lenEnc; + dest->repLenEnc = p->repLenEnc; + dest->state = p->state; + + for (i = 0; i < kNumStates; i++) + { + memcpy(dest->isMatch[i], p->isMatch[i], sizeof(p->isMatch[i])); + memcpy(dest->isRep0Long[i], p->isRep0Long[i], sizeof(p->isRep0Long[i])); + } + for (i = 0; i < kNumLenToPosStates; i++) + memcpy(dest->posSlotEncoder[i], p->posSlotEncoder[i], sizeof(p->posSlotEncoder[i])); + memcpy(dest->isRep, p->isRep, sizeof(p->isRep)); + memcpy(dest->isRepG0, p->isRepG0, sizeof(p->isRepG0)); + memcpy(dest->isRepG1, p->isRepG1, sizeof(p->isRepG1)); + memcpy(dest->isRepG2, p->isRepG2, sizeof(p->isRepG2)); + memcpy(dest->posEncoders, p->posEncoders, sizeof(p->posEncoders)); + memcpy(dest->posAlignEncoder, p->posAlignEncoder, sizeof(p->posAlignEncoder)); + memcpy(dest->reps, p->reps, sizeof(p->reps)); + memcpy(dest->litProbs, p->litProbs, (0x300 << p->lclp) * sizeof(CLzmaProb)); +} + +void LzmaEnc_RestoreState(CLzmaEncHandle pp) +{ + CLzmaEnc *dest = (CLzmaEnc *)pp; + const CSaveState *p = &dest->saveState; + int i; + dest->lenEnc = p->lenEnc; + dest->repLenEnc = p->repLenEnc; + dest->state = p->state; + + for (i = 0; i < kNumStates; i++) + { + memcpy(dest->isMatch[i], p->isMatch[i], sizeof(p->isMatch[i])); + memcpy(dest->isRep0Long[i], p->isRep0Long[i], sizeof(p->isRep0Long[i])); + } + for (i = 0; i < kNumLenToPosStates; i++) + memcpy(dest->posSlotEncoder[i], p->posSlotEncoder[i], sizeof(p->posSlotEncoder[i])); + memcpy(dest->isRep, p->isRep, sizeof(p->isRep)); + memcpy(dest->isRepG0, p->isRepG0, sizeof(p->isRepG0)); + memcpy(dest->isRepG1, p->isRepG1, sizeof(p->isRepG1)); + memcpy(dest->isRepG2, p->isRepG2, sizeof(p->isRepG2)); + memcpy(dest->posEncoders, p->posEncoders, sizeof(p->posEncoders)); + memcpy(dest->posAlignEncoder, p->posAlignEncoder, sizeof(p->posAlignEncoder)); + memcpy(dest->reps, p->reps, sizeof(p->reps)); + memcpy(dest->litProbs, p->litProbs, (0x300 << dest->lclp) * sizeof(CLzmaProb)); +} + +SRes LzmaEnc_SetProps(CLzmaEncHandle pp, const CLzmaEncProps *props2) +{ + CLzmaEnc *p = (CLzmaEnc *)pp; + CLzmaEncProps props = *props2; + LzmaEncProps_Normalize(&props); + + if (props.lc > LZMA_LC_MAX || props.lp > LZMA_LP_MAX || props.pb > LZMA_PB_MAX || + props.dictSize > (1 << kDicLogSizeMaxCompress) || props.dictSize > (1 << 30)) + return SZ_ERROR_PARAM; + p->dictSize = props.dictSize; + p->matchFinderCycles = props.mc; + { + unsigned fb = props.fb; + if (fb < 5) + fb = 5; + if (fb > LZMA_MATCH_LEN_MAX) + fb = LZMA_MATCH_LEN_MAX; + p->numFastBytes = fb; + } + p->lc = props.lc; + p->lp = props.lp; + p->pb = props.pb; + p->fastMode = (props.algo == 0); + p->matchFinderBase.btMode = props.btMode; + { + UInt32 numHashBytes = 4; + if (props.btMode) + { + if (props.numHashBytes < 2) + numHashBytes = 2; + else if (props.numHashBytes < 4) + numHashBytes = props.numHashBytes; + } + p->matchFinderBase.numHashBytes = numHashBytes; + } + + p->matchFinderBase.cutValue = props.mc; + + p->writeEndMark = props.writeEndMark; + + #ifndef _7ZIP_ST + /* + if (newMultiThread != _multiThread) + { + ReleaseMatchFinder(); + _multiThread = newMultiThread; + } + */ + p->multiThread = (props.numThreads > 1); + #endif + + return SZ_OK; +} + +static const int kLiteralNextStates[kNumStates] = {0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 4, 5}; +static const int kMatchNextStates[kNumStates] = {7, 7, 7, 7, 7, 7, 7, 10, 10, 10, 10, 10}; +static const int kRepNextStates[kNumStates] = {8, 8, 8, 8, 8, 8, 8, 11, 11, 11, 11, 11}; +static const int kShortRepNextStates[kNumStates]= {9, 9, 9, 9, 9, 9, 9, 11, 11, 11, 11, 11}; + +#define IsCharState(s) ((s) < 7) + +#define GetLenToPosState(len) (((len) < kNumLenToPosStates + 1) ? (len) - 2 : kNumLenToPosStates - 1) + +#define kInfinityPrice (1 << 30) + +static void RangeEnc_Construct(CRangeEnc *p) +{ + p->outStream = 0; + p->bufBase = 0; +} + +#define RangeEnc_GetProcessed(p) ((p)->processed + ((p)->buf - (p)->bufBase) + (p)->cacheSize) + +#define RC_BUF_SIZE (1 << 16) +static int RangeEnc_Alloc(CRangeEnc *p, ISzAlloc *alloc) +{ + if (p->bufBase == 0) + { + p->bufBase = (Byte *)alloc->Alloc(alloc, RC_BUF_SIZE); + if (p->bufBase == 0) + return 0; + p->bufLim = p->bufBase + RC_BUF_SIZE; + } + return 1; +} + +static void RangeEnc_Free(CRangeEnc *p, ISzAlloc *alloc) +{ + alloc->Free(alloc, p->bufBase); + p->bufBase = 0; +} + +static void RangeEnc_Init(CRangeEnc *p) +{ + /* Stream.Init(); */ + p->low = 0; + p->range = 0xFFFFFFFF; + p->cacheSize = 1; + p->cache = 0; + + p->buf = p->bufBase; + + p->processed = 0; + p->res = SZ_OK; +} + +static void RangeEnc_FlushStream(CRangeEnc *p) +{ + size_t num; + if (p->res != SZ_OK) + return; + num = p->buf - p->bufBase; + if (num != p->outStream->Write(p->outStream, p->bufBase, num)) + p->res = SZ_ERROR_WRITE; + p->processed += num; + p->buf = p->bufBase; +} + +static void MY_FAST_CALL RangeEnc_ShiftLow(CRangeEnc *p) +{ + if ((UInt32)p->low < (UInt32)0xFF000000 || (int)(p->low >> 32) != 0) + { + Byte temp = p->cache; + do + { + Byte *buf = p->buf; + *buf++ = (Byte)(temp + (Byte)(p->low >> 32)); + p->buf = buf; + if (buf == p->bufLim) + RangeEnc_FlushStream(p); + temp = 0xFF; + } + while (--p->cacheSize != 0); + p->cache = (Byte)((UInt32)p->low >> 24); + } + p->cacheSize++; + p->low = (UInt32)p->low << 8; +} + +static void RangeEnc_FlushData(CRangeEnc *p) +{ + int i; + for (i = 0; i < 5; i++) + RangeEnc_ShiftLow(p); +} + +static void RangeEnc_EncodeDirectBits(CRangeEnc *p, UInt32 value, int numBits) +{ + do + { + p->range >>= 1; + p->low += p->range & (0 - ((value >> --numBits) & 1)); + if (p->range < kTopValue) + { + p->range <<= 8; + RangeEnc_ShiftLow(p); + } + } + while (numBits != 0); +} + +static void RangeEnc_EncodeBit(CRangeEnc *p, CLzmaProb *prob, UInt32 symbol) +{ + UInt32 ttt = *prob; + UInt32 newBound = (p->range >> kNumBitModelTotalBits) * ttt; + if (symbol == 0) + { + p->range = newBound; + ttt += (kBitModelTotal - ttt) >> kNumMoveBits; + } + else + { + p->low += newBound; + p->range -= newBound; + ttt -= ttt >> kNumMoveBits; + } + *prob = (CLzmaProb)ttt; + if (p->range < kTopValue) + { + p->range <<= 8; + RangeEnc_ShiftLow(p); + } +} + +static void LitEnc_Encode(CRangeEnc *p, CLzmaProb *probs, UInt32 symbol) +{ + symbol |= 0x100; + do + { + RangeEnc_EncodeBit(p, probs + (symbol >> 8), (symbol >> 7) & 1); + symbol <<= 1; + } + while (symbol < 0x10000); +} + +static void LitEnc_EncodeMatched(CRangeEnc *p, CLzmaProb *probs, UInt32 symbol, UInt32 matchByte) +{ + UInt32 offs = 0x100; + symbol |= 0x100; + do + { + matchByte <<= 1; + RangeEnc_EncodeBit(p, probs + (offs + (matchByte & offs) + (symbol >> 8)), (symbol >> 7) & 1); + symbol <<= 1; + offs &= ~(matchByte ^ symbol); + } + while (symbol < 0x10000); +} + +void LzmaEnc_InitPriceTables(UInt32 *ProbPrices) +{ + UInt32 i; + for (i = (1 << kNumMoveReducingBits) / 2; i < kBitModelTotal; i += (1 << kNumMoveReducingBits)) + { + const int kCyclesBits = kNumBitPriceShiftBits; + UInt32 w = i; + UInt32 bitCount = 0; + int j; + for (j = 0; j < kCyclesBits; j++) + { + w = w * w; + bitCount <<= 1; + while (w >= ((UInt32)1 << 16)) + { + w >>= 1; + bitCount++; + } + } + ProbPrices[i >> kNumMoveReducingBits] = ((kNumBitModelTotalBits << kCyclesBits) - 15 - bitCount); + } +} + + +#define GET_PRICE(prob, symbol) \ + p->ProbPrices[((prob) ^ (((-(int)(symbol))) & (kBitModelTotal - 1))) >> kNumMoveReducingBits]; + +#define GET_PRICEa(prob, symbol) \ + ProbPrices[((prob) ^ ((-((int)(symbol))) & (kBitModelTotal - 1))) >> kNumMoveReducingBits]; + +#define GET_PRICE_0(prob) p->ProbPrices[(prob) >> kNumMoveReducingBits] +#define GET_PRICE_1(prob) p->ProbPrices[((prob) ^ (kBitModelTotal - 1)) >> kNumMoveReducingBits] + +#define GET_PRICE_0a(prob) ProbPrices[(prob) >> kNumMoveReducingBits] +#define GET_PRICE_1a(prob) ProbPrices[((prob) ^ (kBitModelTotal - 1)) >> kNumMoveReducingBits] + +static UInt32 LitEnc_GetPrice(const CLzmaProb *probs, UInt32 symbol, UInt32 *ProbPrices) +{ + UInt32 price = 0; + symbol |= 0x100; + do + { + price += GET_PRICEa(probs[symbol >> 8], (symbol >> 7) & 1); + symbol <<= 1; + } + while (symbol < 0x10000); + return price; +} + +static UInt32 LitEnc_GetPriceMatched(const CLzmaProb *probs, UInt32 symbol, UInt32 matchByte, UInt32 *ProbPrices) +{ + UInt32 price = 0; + UInt32 offs = 0x100; + symbol |= 0x100; + do + { + matchByte <<= 1; + price += GET_PRICEa(probs[offs + (matchByte & offs) + (symbol >> 8)], (symbol >> 7) & 1); + symbol <<= 1; + offs &= ~(matchByte ^ symbol); + } + while (symbol < 0x10000); + return price; +} + + +static void RcTree_Encode(CRangeEnc *rc, CLzmaProb *probs, int numBitLevels, UInt32 symbol) +{ + UInt32 m = 1; + int i; + for (i = numBitLevels; i != 0;) + { + UInt32 bit; + i--; + bit = (symbol >> i) & 1; + RangeEnc_EncodeBit(rc, probs + m, bit); + m = (m << 1) | bit; + } +} + +static void RcTree_ReverseEncode(CRangeEnc *rc, CLzmaProb *probs, int numBitLevels, UInt32 symbol) +{ + UInt32 m = 1; + int i; + for (i = 0; i < numBitLevels; i++) + { + UInt32 bit = symbol & 1; + RangeEnc_EncodeBit(rc, probs + m, bit); + m = (m << 1) | bit; + symbol >>= 1; + } +} + +static UInt32 RcTree_GetPrice(const CLzmaProb *probs, int numBitLevels, UInt32 symbol, UInt32 *ProbPrices) +{ + UInt32 price = 0; + symbol |= (1 << numBitLevels); + while (symbol != 1) + { + price += GET_PRICEa(probs[symbol >> 1], symbol & 1); + symbol >>= 1; + } + return price; +} + +static UInt32 RcTree_ReverseGetPrice(const CLzmaProb *probs, int numBitLevels, UInt32 symbol, UInt32 *ProbPrices) +{ + UInt32 price = 0; + UInt32 m = 1; + int i; + for (i = numBitLevels; i != 0; i--) + { + UInt32 bit = symbol & 1; + symbol >>= 1; + price += GET_PRICEa(probs[m], bit); + m = (m << 1) | bit; + } + return price; +} + + +static void LenEnc_Init(CLenEnc *p) +{ + unsigned i; + p->choice = p->choice2 = kProbInitValue; + for (i = 0; i < (LZMA_NUM_PB_STATES_MAX << kLenNumLowBits); i++) + p->low[i] = kProbInitValue; + for (i = 0; i < (LZMA_NUM_PB_STATES_MAX << kLenNumMidBits); i++) + p->mid[i] = kProbInitValue; + for (i = 0; i < kLenNumHighSymbols; i++) + p->high[i] = kProbInitValue; +} + +static void LenEnc_Encode(CLenEnc *p, CRangeEnc *rc, UInt32 symbol, UInt32 posState) +{ + if (symbol < kLenNumLowSymbols) + { + RangeEnc_EncodeBit(rc, &p->choice, 0); + RcTree_Encode(rc, p->low + (posState << kLenNumLowBits), kLenNumLowBits, symbol); + } + else + { + RangeEnc_EncodeBit(rc, &p->choice, 1); + if (symbol < kLenNumLowSymbols + kLenNumMidSymbols) + { + RangeEnc_EncodeBit(rc, &p->choice2, 0); + RcTree_Encode(rc, p->mid + (posState << kLenNumMidBits), kLenNumMidBits, symbol - kLenNumLowSymbols); + } + else + { + RangeEnc_EncodeBit(rc, &p->choice2, 1); + RcTree_Encode(rc, p->high, kLenNumHighBits, symbol - kLenNumLowSymbols - kLenNumMidSymbols); + } + } +} + +static void LenEnc_SetPrices(CLenEnc *p, UInt32 posState, UInt32 numSymbols, UInt32 *prices, UInt32 *ProbPrices) +{ + UInt32 a0 = GET_PRICE_0a(p->choice); + UInt32 a1 = GET_PRICE_1a(p->choice); + UInt32 b0 = a1 + GET_PRICE_0a(p->choice2); + UInt32 b1 = a1 + GET_PRICE_1a(p->choice2); + UInt32 i = 0; + for (i = 0; i < kLenNumLowSymbols; i++) + { + if (i >= numSymbols) + return; + prices[i] = a0 + RcTree_GetPrice(p->low + (posState << kLenNumLowBits), kLenNumLowBits, i, ProbPrices); + } + for (; i < kLenNumLowSymbols + kLenNumMidSymbols; i++) + { + if (i >= numSymbols) + return; + prices[i] = b0 + RcTree_GetPrice(p->mid + (posState << kLenNumMidBits), kLenNumMidBits, i - kLenNumLowSymbols, ProbPrices); + } + for (; i < numSymbols; i++) + prices[i] = b1 + RcTree_GetPrice(p->high, kLenNumHighBits, i - kLenNumLowSymbols - kLenNumMidSymbols, ProbPrices); +} + +static void MY_FAST_CALL LenPriceEnc_UpdateTable(CLenPriceEnc *p, UInt32 posState, UInt32 *ProbPrices) +{ + LenEnc_SetPrices(&p->p, posState, p->tableSize, p->prices[posState], ProbPrices); + p->counters[posState] = p->tableSize; +} + +static void LenPriceEnc_UpdateTables(CLenPriceEnc *p, UInt32 numPosStates, UInt32 *ProbPrices) +{ + UInt32 posState; + for (posState = 0; posState < numPosStates; posState++) + LenPriceEnc_UpdateTable(p, posState, ProbPrices); +} + +static void LenEnc_Encode2(CLenPriceEnc *p, CRangeEnc *rc, UInt32 symbol, UInt32 posState, Bool updatePrice, UInt32 *ProbPrices) +{ + LenEnc_Encode(&p->p, rc, symbol, posState); + if (updatePrice) + if (--p->counters[posState] == 0) + LenPriceEnc_UpdateTable(p, posState, ProbPrices); +} + + + + +static void MovePos(CLzmaEnc *p, UInt32 num) +{ + #ifdef SHOW_STAT + ttt += num; + printf("\n MovePos %d", num); + #endif + if (num != 0) + { + p->additionalOffset += num; + p->matchFinder.Skip(p->matchFinderObj, num); + } +} + +static UInt32 ReadMatchDistances(CLzmaEnc *p, UInt32 *numDistancePairsRes) +{ + UInt32 lenRes = 0, numPairs; + p->numAvail = p->matchFinder.GetNumAvailableBytes(p->matchFinderObj); + numPairs = p->matchFinder.GetMatches(p->matchFinderObj, p->matches); + #ifdef SHOW_STAT + printf("\n i = %d numPairs = %d ", ttt, numPairs / 2); + ttt++; + { + UInt32 i; + for (i = 0; i < numPairs; i += 2) + printf("%2d %6d | ", p->matches[i], p->matches[i + 1]); + } + #endif + if (numPairs > 0) + { + lenRes = p->matches[numPairs - 2]; + if (lenRes == p->numFastBytes) + { + const Byte *pby = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1; + UInt32 distance = p->matches[numPairs - 1] + 1; + UInt32 numAvail = p->numAvail; + if (numAvail > LZMA_MATCH_LEN_MAX) + numAvail = LZMA_MATCH_LEN_MAX; + { + const Byte *pby2 = pby - distance; + for (; lenRes < numAvail && pby[lenRes] == pby2[lenRes]; lenRes++); + } + } + } + p->additionalOffset++; + *numDistancePairsRes = numPairs; + return lenRes; +} + + +#define MakeAsChar(p) (p)->backPrev = (UInt32)(-1); (p)->prev1IsChar = False; +#define MakeAsShortRep(p) (p)->backPrev = 0; (p)->prev1IsChar = False; +#define IsShortRep(p) ((p)->backPrev == 0) + +static UInt32 GetRepLen1Price(CLzmaEnc *p, UInt32 state, UInt32 posState) +{ + return + GET_PRICE_0(p->isRepG0[state]) + + GET_PRICE_0(p->isRep0Long[state][posState]); +} + +static UInt32 GetPureRepPrice(CLzmaEnc *p, UInt32 repIndex, UInt32 state, UInt32 posState) +{ + UInt32 price; + if (repIndex == 0) + { + price = GET_PRICE_0(p->isRepG0[state]); + price += GET_PRICE_1(p->isRep0Long[state][posState]); + } + else + { + price = GET_PRICE_1(p->isRepG0[state]); + if (repIndex == 1) + price += GET_PRICE_0(p->isRepG1[state]); + else + { + price += GET_PRICE_1(p->isRepG1[state]); + price += GET_PRICE(p->isRepG2[state], repIndex - 2); + } + } + return price; +} + +static UInt32 GetRepPrice(CLzmaEnc *p, UInt32 repIndex, UInt32 len, UInt32 state, UInt32 posState) +{ + return p->repLenEnc.prices[posState][len - LZMA_MATCH_LEN_MIN] + + GetPureRepPrice(p, repIndex, state, posState); +} + +static UInt32 Backward(CLzmaEnc *p, UInt32 *backRes, UInt32 cur) +{ + UInt32 posMem = p->opt[cur].posPrev; + UInt32 backMem = p->opt[cur].backPrev; + p->optimumEndIndex = cur; + do + { + if (p->opt[cur].prev1IsChar) + { + MakeAsChar(&p->opt[posMem]) + p->opt[posMem].posPrev = posMem - 1; + if (p->opt[cur].prev2) + { + p->opt[posMem - 1].prev1IsChar = False; + p->opt[posMem - 1].posPrev = p->opt[cur].posPrev2; + p->opt[posMem - 1].backPrev = p->opt[cur].backPrev2; + } + } + { + UInt32 posPrev = posMem; + UInt32 backCur = backMem; + + backMem = p->opt[posPrev].backPrev; + posMem = p->opt[posPrev].posPrev; + + p->opt[posPrev].backPrev = backCur; + p->opt[posPrev].posPrev = cur; + cur = posPrev; + } + } + while (cur != 0); + *backRes = p->opt[0].backPrev; + p->optimumCurrentIndex = p->opt[0].posPrev; + return p->optimumCurrentIndex; +} + +#define LIT_PROBS(pos, prevByte) (p->litProbs + ((((pos) & p->lpMask) << p->lc) + ((prevByte) >> (8 - p->lc))) * 0x300) + +static UInt32 GetOptimum(CLzmaEnc *p, UInt32 position, UInt32 *backRes) +{ + UInt32 numAvail, mainLen, numPairs, repMaxIndex, i, posState, lenEnd, len, cur; + UInt32 matchPrice, repMatchPrice, normalMatchPrice; + UInt32 reps[LZMA_NUM_REPS], repLens[LZMA_NUM_REPS]; + UInt32 *matches; + const Byte *data; + Byte curByte, matchByte; + if (p->optimumEndIndex != p->optimumCurrentIndex) + { + const COptimal *opt = &p->opt[p->optimumCurrentIndex]; + UInt32 lenRes = opt->posPrev - p->optimumCurrentIndex; + *backRes = opt->backPrev; + p->optimumCurrentIndex = opt->posPrev; + return lenRes; + } + p->optimumCurrentIndex = p->optimumEndIndex = 0; + + if (p->additionalOffset == 0) + mainLen = ReadMatchDistances(p, &numPairs); + else + { + mainLen = p->longestMatchLength; + numPairs = p->numPairs; + } + + numAvail = p->numAvail; + if (numAvail < 2) + { + *backRes = (UInt32)(-1); + return 1; + } + if (numAvail > LZMA_MATCH_LEN_MAX) + numAvail = LZMA_MATCH_LEN_MAX; + + data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1; + repMaxIndex = 0; + for (i = 0; i < LZMA_NUM_REPS; i++) + { + UInt32 lenTest; + const Byte *data2; + reps[i] = p->reps[i]; + data2 = data - (reps[i] + 1); + if (data[0] != data2[0] || data[1] != data2[1]) + { + repLens[i] = 0; + continue; + } + for (lenTest = 2; lenTest < numAvail && data[lenTest] == data2[lenTest]; lenTest++); + repLens[i] = lenTest; + if (lenTest > repLens[repMaxIndex]) + repMaxIndex = i; + } + if (repLens[repMaxIndex] >= p->numFastBytes) + { + UInt32 lenRes; + *backRes = repMaxIndex; + lenRes = repLens[repMaxIndex]; + MovePos(p, lenRes - 1); + return lenRes; + } + + matches = p->matches; + if (mainLen >= p->numFastBytes) + { + *backRes = matches[numPairs - 1] + LZMA_NUM_REPS; + MovePos(p, mainLen - 1); + return mainLen; + } + curByte = *data; + matchByte = *(data - (reps[0] + 1)); + + if (mainLen < 2 && curByte != matchByte && repLens[repMaxIndex] < 2) + { + *backRes = (UInt32)-1; + return 1; + } + + p->opt[0].state = (CState)p->state; + + posState = (position & p->pbMask); + + { + const CLzmaProb *probs = LIT_PROBS(position, *(data - 1)); + p->opt[1].price = GET_PRICE_0(p->isMatch[p->state][posState]) + + (!IsCharState(p->state) ? + LitEnc_GetPriceMatched(probs, curByte, matchByte, p->ProbPrices) : + LitEnc_GetPrice(probs, curByte, p->ProbPrices)); + } + + MakeAsChar(&p->opt[1]); + + matchPrice = GET_PRICE_1(p->isMatch[p->state][posState]); + repMatchPrice = matchPrice + GET_PRICE_1(p->isRep[p->state]); + + if (matchByte == curByte) + { + UInt32 shortRepPrice = repMatchPrice + GetRepLen1Price(p, p->state, posState); + if (shortRepPrice < p->opt[1].price) + { + p->opt[1].price = shortRepPrice; + MakeAsShortRep(&p->opt[1]); + } + } + lenEnd = ((mainLen >= repLens[repMaxIndex]) ? mainLen : repLens[repMaxIndex]); + + if (lenEnd < 2) + { + *backRes = p->opt[1].backPrev; + return 1; + } + + p->opt[1].posPrev = 0; + for (i = 0; i < LZMA_NUM_REPS; i++) + p->opt[0].backs[i] = reps[i]; + + len = lenEnd; + do + p->opt[len--].price = kInfinityPrice; + while (len >= 2); + + for (i = 0; i < LZMA_NUM_REPS; i++) + { + UInt32 repLen = repLens[i]; + UInt32 price; + if (repLen < 2) + continue; + price = repMatchPrice + GetPureRepPrice(p, i, p->state, posState); + do + { + UInt32 curAndLenPrice = price + p->repLenEnc.prices[posState][repLen - 2]; + COptimal *opt = &p->opt[repLen]; + if (curAndLenPrice < opt->price) + { + opt->price = curAndLenPrice; + opt->posPrev = 0; + opt->backPrev = i; + opt->prev1IsChar = False; + } + } + while (--repLen >= 2); + } + + normalMatchPrice = matchPrice + GET_PRICE_0(p->isRep[p->state]); + + len = ((repLens[0] >= 2) ? repLens[0] + 1 : 2); + if (len <= mainLen) + { + UInt32 offs = 0; + while (len > matches[offs]) + offs += 2; + for (; ; len++) + { + COptimal *opt; + UInt32 distance = matches[offs + 1]; + + UInt32 curAndLenPrice = normalMatchPrice + p->lenEnc.prices[posState][len - LZMA_MATCH_LEN_MIN]; + UInt32 lenToPosState = GetLenToPosState(len); + if (distance < kNumFullDistances) + curAndLenPrice += p->distancesPrices[lenToPosState][distance]; + else + { + UInt32 slot; + GetPosSlot2(distance, slot); + curAndLenPrice += p->alignPrices[distance & kAlignMask] + p->posSlotPrices[lenToPosState][slot]; + } + opt = &p->opt[len]; + if (curAndLenPrice < opt->price) + { + opt->price = curAndLenPrice; + opt->posPrev = 0; + opt->backPrev = distance + LZMA_NUM_REPS; + opt->prev1IsChar = False; + } + if (len == matches[offs]) + { + offs += 2; + if (offs == numPairs) + break; + } + } + } + + cur = 0; + + #ifdef SHOW_STAT2 + if (position >= 0) + { + unsigned i; + printf("\n pos = %4X", position); + for (i = cur; i <= lenEnd; i++) + printf("\nprice[%4X] = %d", position - cur + i, p->opt[i].price); + } + #endif + + for (;;) + { + UInt32 numAvailFull, newLen, numPairs, posPrev, state, posState, startLen; + UInt32 curPrice, curAnd1Price, matchPrice, repMatchPrice; + Bool nextIsChar; + Byte curByte, matchByte; + const Byte *data; + COptimal *curOpt; + COptimal *nextOpt; + + cur++; + if (cur == lenEnd) + return Backward(p, backRes, cur); + + newLen = ReadMatchDistances(p, &numPairs); + if (newLen >= p->numFastBytes) + { + p->numPairs = numPairs; + p->longestMatchLength = newLen; + return Backward(p, backRes, cur); + } + position++; + curOpt = &p->opt[cur]; + posPrev = curOpt->posPrev; + if (curOpt->prev1IsChar) + { + posPrev--; + if (curOpt->prev2) + { + state = p->opt[curOpt->posPrev2].state; + if (curOpt->backPrev2 < LZMA_NUM_REPS) + state = kRepNextStates[state]; + else + state = kMatchNextStates[state]; + } + else + state = p->opt[posPrev].state; + state = kLiteralNextStates[state]; + } + else + state = p->opt[posPrev].state; + if (posPrev == cur - 1) + { + if (IsShortRep(curOpt)) + state = kShortRepNextStates[state]; + else + state = kLiteralNextStates[state]; + } + else + { + UInt32 pos; + const COptimal *prevOpt; + if (curOpt->prev1IsChar && curOpt->prev2) + { + posPrev = curOpt->posPrev2; + pos = curOpt->backPrev2; + state = kRepNextStates[state]; + } + else + { + pos = curOpt->backPrev; + if (pos < LZMA_NUM_REPS) + state = kRepNextStates[state]; + else + state = kMatchNextStates[state]; + } + prevOpt = &p->opt[posPrev]; + if (pos < LZMA_NUM_REPS) + { + UInt32 i; + reps[0] = prevOpt->backs[pos]; + for (i = 1; i <= pos; i++) + reps[i] = prevOpt->backs[i - 1]; + for (; i < LZMA_NUM_REPS; i++) + reps[i] = prevOpt->backs[i]; + } + else + { + UInt32 i; + reps[0] = (pos - LZMA_NUM_REPS); + for (i = 1; i < LZMA_NUM_REPS; i++) + reps[i] = prevOpt->backs[i - 1]; + } + } + curOpt->state = (CState)state; + + curOpt->backs[0] = reps[0]; + curOpt->backs[1] = reps[1]; + curOpt->backs[2] = reps[2]; + curOpt->backs[3] = reps[3]; + + curPrice = curOpt->price; + nextIsChar = False; + data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1; + curByte = *data; + matchByte = *(data - (reps[0] + 1)); + + posState = (position & p->pbMask); + + curAnd1Price = curPrice + GET_PRICE_0(p->isMatch[state][posState]); + { + const CLzmaProb *probs = LIT_PROBS(position, *(data - 1)); + curAnd1Price += + (!IsCharState(state) ? + LitEnc_GetPriceMatched(probs, curByte, matchByte, p->ProbPrices) : + LitEnc_GetPrice(probs, curByte, p->ProbPrices)); + } + + nextOpt = &p->opt[cur + 1]; + + if (curAnd1Price < nextOpt->price) + { + nextOpt->price = curAnd1Price; + nextOpt->posPrev = cur; + MakeAsChar(nextOpt); + nextIsChar = True; + } + + matchPrice = curPrice + GET_PRICE_1(p->isMatch[state][posState]); + repMatchPrice = matchPrice + GET_PRICE_1(p->isRep[state]); + + if (matchByte == curByte && !(nextOpt->posPrev < cur && nextOpt->backPrev == 0)) + { + UInt32 shortRepPrice = repMatchPrice + GetRepLen1Price(p, state, posState); + if (shortRepPrice <= nextOpt->price) + { + nextOpt->price = shortRepPrice; + nextOpt->posPrev = cur; + MakeAsShortRep(nextOpt); + nextIsChar = True; + } + } + numAvailFull = p->numAvail; + { + UInt32 temp = kNumOpts - 1 - cur; + if (temp < numAvailFull) + numAvailFull = temp; + } + + if (numAvailFull < 2) + continue; + numAvail = (numAvailFull <= p->numFastBytes ? numAvailFull : p->numFastBytes); + + if (!nextIsChar && matchByte != curByte) /* speed optimization */ + { + /* try Literal + rep0 */ + UInt32 temp; + UInt32 lenTest2; + const Byte *data2 = data - (reps[0] + 1); + UInt32 limit = p->numFastBytes + 1; + if (limit > numAvailFull) + limit = numAvailFull; + + for (temp = 1; temp < limit && data[temp] == data2[temp]; temp++); + lenTest2 = temp - 1; + if (lenTest2 >= 2) + { + UInt32 state2 = kLiteralNextStates[state]; + UInt32 posStateNext = (position + 1) & p->pbMask; + UInt32 nextRepMatchPrice = curAnd1Price + + GET_PRICE_1(p->isMatch[state2][posStateNext]) + + GET_PRICE_1(p->isRep[state2]); + /* for (; lenTest2 >= 2; lenTest2--) */ + { + UInt32 curAndLenPrice; + COptimal *opt; + UInt32 offset = cur + 1 + lenTest2; + while (lenEnd < offset) + p->opt[++lenEnd].price = kInfinityPrice; + curAndLenPrice = nextRepMatchPrice + GetRepPrice(p, 0, lenTest2, state2, posStateNext); + opt = &p->opt[offset]; + if (curAndLenPrice < opt->price) + { + opt->price = curAndLenPrice; + opt->posPrev = cur + 1; + opt->backPrev = 0; + opt->prev1IsChar = True; + opt->prev2 = False; + } + } + } + } + + startLen = 2; /* speed optimization */ + { + UInt32 repIndex; + for (repIndex = 0; repIndex < LZMA_NUM_REPS; repIndex++) + { + UInt32 lenTest; + UInt32 lenTestTemp; + UInt32 price; + const Byte *data2 = data - (reps[repIndex] + 1); + if (data[0] != data2[0] || data[1] != data2[1]) + continue; + for (lenTest = 2; lenTest < numAvail && data[lenTest] == data2[lenTest]; lenTest++); + while (lenEnd < cur + lenTest) + p->opt[++lenEnd].price = kInfinityPrice; + lenTestTemp = lenTest; + price = repMatchPrice + GetPureRepPrice(p, repIndex, state, posState); + do + { + UInt32 curAndLenPrice = price + p->repLenEnc.prices[posState][lenTest - 2]; + COptimal *opt = &p->opt[cur + lenTest]; + if (curAndLenPrice < opt->price) + { + opt->price = curAndLenPrice; + opt->posPrev = cur; + opt->backPrev = repIndex; + opt->prev1IsChar = False; + } + } + while (--lenTest >= 2); + lenTest = lenTestTemp; + + if (repIndex == 0) + startLen = lenTest + 1; + + /* if (_maxMode) */ + { + UInt32 lenTest2 = lenTest + 1; + UInt32 limit = lenTest2 + p->numFastBytes; + UInt32 nextRepMatchPrice; + if (limit > numAvailFull) + limit = numAvailFull; + for (; lenTest2 < limit && data[lenTest2] == data2[lenTest2]; lenTest2++); + lenTest2 -= lenTest + 1; + if (lenTest2 >= 2) + { + UInt32 state2 = kRepNextStates[state]; + UInt32 posStateNext = (position + lenTest) & p->pbMask; + UInt32 curAndLenCharPrice = + price + p->repLenEnc.prices[posState][lenTest - 2] + + GET_PRICE_0(p->isMatch[state2][posStateNext]) + + LitEnc_GetPriceMatched(LIT_PROBS(position + lenTest, data[lenTest - 1]), + data[lenTest], data2[lenTest], p->ProbPrices); + state2 = kLiteralNextStates[state2]; + posStateNext = (position + lenTest + 1) & p->pbMask; + nextRepMatchPrice = curAndLenCharPrice + + GET_PRICE_1(p->isMatch[state2][posStateNext]) + + GET_PRICE_1(p->isRep[state2]); + + /* for (; lenTest2 >= 2; lenTest2--) */ + { + UInt32 curAndLenPrice; + COptimal *opt; + UInt32 offset = cur + lenTest + 1 + lenTest2; + while (lenEnd < offset) + p->opt[++lenEnd].price = kInfinityPrice; + curAndLenPrice = nextRepMatchPrice + GetRepPrice(p, 0, lenTest2, state2, posStateNext); + opt = &p->opt[offset]; + if (curAndLenPrice < opt->price) + { + opt->price = curAndLenPrice; + opt->posPrev = cur + lenTest + 1; + opt->backPrev = 0; + opt->prev1IsChar = True; + opt->prev2 = True; + opt->posPrev2 = cur; + opt->backPrev2 = repIndex; + } + } + } + } + } + } + /* for (UInt32 lenTest = 2; lenTest <= newLen; lenTest++) */ + if (newLen > numAvail) + { + newLen = numAvail; + for (numPairs = 0; newLen > matches[numPairs]; numPairs += 2); + matches[numPairs] = newLen; + numPairs += 2; + } + if (newLen >= startLen) + { + UInt32 normalMatchPrice = matchPrice + GET_PRICE_0(p->isRep[state]); + UInt32 offs, curBack, posSlot; + UInt32 lenTest; + while (lenEnd < cur + newLen) + p->opt[++lenEnd].price = kInfinityPrice; + + offs = 0; + while (startLen > matches[offs]) + offs += 2; + curBack = matches[offs + 1]; + GetPosSlot2(curBack, posSlot); + for (lenTest = /*2*/ startLen; ; lenTest++) + { + UInt32 curAndLenPrice = normalMatchPrice + p->lenEnc.prices[posState][lenTest - LZMA_MATCH_LEN_MIN]; + UInt32 lenToPosState = GetLenToPosState(lenTest); + COptimal *opt; + if (curBack < kNumFullDistances) + curAndLenPrice += p->distancesPrices[lenToPosState][curBack]; + else + curAndLenPrice += p->posSlotPrices[lenToPosState][posSlot] + p->alignPrices[curBack & kAlignMask]; + + opt = &p->opt[cur + lenTest]; + if (curAndLenPrice < opt->price) + { + opt->price = curAndLenPrice; + opt->posPrev = cur; + opt->backPrev = curBack + LZMA_NUM_REPS; + opt->prev1IsChar = False; + } + + if (/*_maxMode && */lenTest == matches[offs]) + { + /* Try Match + Literal + Rep0 */ + const Byte *data2 = data - (curBack + 1); + UInt32 lenTest2 = lenTest + 1; + UInt32 limit = lenTest2 + p->numFastBytes; + UInt32 nextRepMatchPrice; + if (limit > numAvailFull) + limit = numAvailFull; + for (; lenTest2 < limit && data[lenTest2] == data2[lenTest2]; lenTest2++); + lenTest2 -= lenTest + 1; + if (lenTest2 >= 2) + { + UInt32 state2 = kMatchNextStates[state]; + UInt32 posStateNext = (position + lenTest) & p->pbMask; + UInt32 curAndLenCharPrice = curAndLenPrice + + GET_PRICE_0(p->isMatch[state2][posStateNext]) + + LitEnc_GetPriceMatched(LIT_PROBS(position + lenTest, data[lenTest - 1]), + data[lenTest], data2[lenTest], p->ProbPrices); + state2 = kLiteralNextStates[state2]; + posStateNext = (posStateNext + 1) & p->pbMask; + nextRepMatchPrice = curAndLenCharPrice + + GET_PRICE_1(p->isMatch[state2][posStateNext]) + + GET_PRICE_1(p->isRep[state2]); + + /* for (; lenTest2 >= 2; lenTest2--) */ + { + UInt32 offset = cur + lenTest + 1 + lenTest2; + UInt32 curAndLenPrice; + COptimal *opt; + while (lenEnd < offset) + p->opt[++lenEnd].price = kInfinityPrice; + curAndLenPrice = nextRepMatchPrice + GetRepPrice(p, 0, lenTest2, state2, posStateNext); + opt = &p->opt[offset]; + if (curAndLenPrice < opt->price) + { + opt->price = curAndLenPrice; + opt->posPrev = cur + lenTest + 1; + opt->backPrev = 0; + opt->prev1IsChar = True; + opt->prev2 = True; + opt->posPrev2 = cur; + opt->backPrev2 = curBack + LZMA_NUM_REPS; + } + } + } + offs += 2; + if (offs == numPairs) + break; + curBack = matches[offs + 1]; + if (curBack >= kNumFullDistances) + GetPosSlot2(curBack, posSlot); + } + } + } + } +} + +#define ChangePair(smallDist, bigDist) (((bigDist) >> 7) > (smallDist)) + +static UInt32 GetOptimumFast(CLzmaEnc *p, UInt32 *backRes) +{ + UInt32 numAvail, mainLen, mainDist, numPairs, repIndex, repLen, i; + const Byte *data; + const UInt32 *matches; + + if (p->additionalOffset == 0) + mainLen = ReadMatchDistances(p, &numPairs); + else + { + mainLen = p->longestMatchLength; + numPairs = p->numPairs; + } + + numAvail = p->numAvail; + *backRes = (UInt32)-1; + if (numAvail < 2) + return 1; + if (numAvail > LZMA_MATCH_LEN_MAX) + numAvail = LZMA_MATCH_LEN_MAX; + data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1; + + repLen = repIndex = 0; + for (i = 0; i < LZMA_NUM_REPS; i++) + { + UInt32 len; + const Byte *data2 = data - (p->reps[i] + 1); + if (data[0] != data2[0] || data[1] != data2[1]) + continue; + for (len = 2; len < numAvail && data[len] == data2[len]; len++); + if (len >= p->numFastBytes) + { + *backRes = i; + MovePos(p, len - 1); + return len; + } + if (len > repLen) + { + repIndex = i; + repLen = len; + } + } + + matches = p->matches; + if (mainLen >= p->numFastBytes) + { + *backRes = matches[numPairs - 1] + LZMA_NUM_REPS; + MovePos(p, mainLen - 1); + return mainLen; + } + + mainDist = 0; /* for GCC */ + if (mainLen >= 2) + { + mainDist = matches[numPairs - 1]; + while (numPairs > 2 && mainLen == matches[numPairs - 4] + 1) + { + if (!ChangePair(matches[numPairs - 3], mainDist)) + break; + numPairs -= 2; + mainLen = matches[numPairs - 2]; + mainDist = matches[numPairs - 1]; + } + if (mainLen == 2 && mainDist >= 0x80) + mainLen = 1; + } + + if (repLen >= 2 && ( + (repLen + 1 >= mainLen) || + (repLen + 2 >= mainLen && mainDist >= (1 << 9)) || + (repLen + 3 >= mainLen && mainDist >= (1 << 15)))) + { + *backRes = repIndex; + MovePos(p, repLen - 1); + return repLen; + } + + if (mainLen < 2 || numAvail <= 2) + return 1; + + p->longestMatchLength = ReadMatchDistances(p, &p->numPairs); + if (p->longestMatchLength >= 2) + { + UInt32 newDistance = matches[p->numPairs - 1]; + if ((p->longestMatchLength >= mainLen && newDistance < mainDist) || + (p->longestMatchLength == mainLen + 1 && !ChangePair(mainDist, newDistance)) || + (p->longestMatchLength > mainLen + 1) || + (p->longestMatchLength + 1 >= mainLen && mainLen >= 3 && ChangePair(newDistance, mainDist))) + return 1; + } + + data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1; + for (i = 0; i < LZMA_NUM_REPS; i++) + { + UInt32 len, limit; + const Byte *data2 = data - (p->reps[i] + 1); + if (data[0] != data2[0] || data[1] != data2[1]) + continue; + limit = mainLen - 1; + for (len = 2; len < limit && data[len] == data2[len]; len++); + if (len >= limit) + return 1; + } + *backRes = mainDist + LZMA_NUM_REPS; + MovePos(p, mainLen - 2); + return mainLen; +} + +static void WriteEndMarker(CLzmaEnc *p, UInt32 posState) +{ + UInt32 len; + RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][posState], 1); + RangeEnc_EncodeBit(&p->rc, &p->isRep[p->state], 0); + p->state = kMatchNextStates[p->state]; + len = LZMA_MATCH_LEN_MIN; + LenEnc_Encode2(&p->lenEnc, &p->rc, len - LZMA_MATCH_LEN_MIN, posState, !p->fastMode, p->ProbPrices); + RcTree_Encode(&p->rc, p->posSlotEncoder[GetLenToPosState(len)], kNumPosSlotBits, (1 << kNumPosSlotBits) - 1); + RangeEnc_EncodeDirectBits(&p->rc, (((UInt32)1 << 30) - 1) >> kNumAlignBits, 30 - kNumAlignBits); + RcTree_ReverseEncode(&p->rc, p->posAlignEncoder, kNumAlignBits, kAlignMask); +} + +static SRes CheckErrors(CLzmaEnc *p) +{ + if (p->result != SZ_OK) + return p->result; + if (p->rc.res != SZ_OK) + p->result = SZ_ERROR_WRITE; + if (p->matchFinderBase.result != SZ_OK) + p->result = SZ_ERROR_READ; + if (p->result != SZ_OK) + p->finished = True; + return p->result; +} + +static SRes Flush(CLzmaEnc *p, UInt32 nowPos) +{ + /* ReleaseMFStream(); */ + p->finished = True; + if (p->writeEndMark) + WriteEndMarker(p, nowPos & p->pbMask); + RangeEnc_FlushData(&p->rc); + RangeEnc_FlushStream(&p->rc); + return CheckErrors(p); +} + +static void FillAlignPrices(CLzmaEnc *p) +{ + UInt32 i; + for (i = 0; i < kAlignTableSize; i++) + p->alignPrices[i] = RcTree_ReverseGetPrice(p->posAlignEncoder, kNumAlignBits, i, p->ProbPrices); + p->alignPriceCount = 0; +} + +static void FillDistancesPrices(CLzmaEnc *p) +{ + UInt32 tempPrices[kNumFullDistances]; + UInt32 i, lenToPosState; + for (i = kStartPosModelIndex; i < kNumFullDistances; i++) + { + UInt32 posSlot = GetPosSlot1(i); + UInt32 footerBits = ((posSlot >> 1) - 1); + UInt32 base = ((2 | (posSlot & 1)) << footerBits); + tempPrices[i] = RcTree_ReverseGetPrice(p->posEncoders + base - posSlot - 1, footerBits, i - base, p->ProbPrices); + } + + for (lenToPosState = 0; lenToPosState < kNumLenToPosStates; lenToPosState++) + { + UInt32 posSlot; + const CLzmaProb *encoder = p->posSlotEncoder[lenToPosState]; + UInt32 *posSlotPrices = p->posSlotPrices[lenToPosState]; + for (posSlot = 0; posSlot < p->distTableSize; posSlot++) + posSlotPrices[posSlot] = RcTree_GetPrice(encoder, kNumPosSlotBits, posSlot, p->ProbPrices); + for (posSlot = kEndPosModelIndex; posSlot < p->distTableSize; posSlot++) + posSlotPrices[posSlot] += ((((posSlot >> 1) - 1) - kNumAlignBits) << kNumBitPriceShiftBits); + + { + UInt32 *distancesPrices = p->distancesPrices[lenToPosState]; + UInt32 i; + for (i = 0; i < kStartPosModelIndex; i++) + distancesPrices[i] = posSlotPrices[i]; + for (; i < kNumFullDistances; i++) + distancesPrices[i] = posSlotPrices[GetPosSlot1(i)] + tempPrices[i]; + } + } + p->matchPriceCount = 0; +} + +void LzmaEnc_Construct(CLzmaEnc *p) +{ + RangeEnc_Construct(&p->rc); + MatchFinder_Construct(&p->matchFinderBase); + #ifndef _7ZIP_ST + MatchFinderMt_Construct(&p->matchFinderMt); + p->matchFinderMt.MatchFinder = &p->matchFinderBase; + #endif + + { + CLzmaEncProps props; + LzmaEncProps_Init(&props); + LzmaEnc_SetProps(p, &props); + } + + #ifndef LZMA_LOG_BSR + LzmaEnc_FastPosInit(p->g_FastPos); + #endif + + LzmaEnc_InitPriceTables(p->ProbPrices); + p->litProbs = 0; + p->saveState.litProbs = 0; +} + +CLzmaEncHandle LzmaEnc_Create(ISzAlloc *alloc) +{ + void *p; + p = alloc->Alloc(alloc, sizeof(CLzmaEnc)); + if (p != 0) + LzmaEnc_Construct((CLzmaEnc *)p); + return p; +} + +void LzmaEnc_FreeLits(CLzmaEnc *p, ISzAlloc *alloc) +{ + alloc->Free(alloc, p->litProbs); + alloc->Free(alloc, p->saveState.litProbs); + p->litProbs = 0; + p->saveState.litProbs = 0; +} + +void LzmaEnc_Destruct(CLzmaEnc *p, ISzAlloc *alloc, ISzAlloc *allocBig) +{ + #ifndef _7ZIP_ST + MatchFinderMt_Destruct(&p->matchFinderMt, allocBig); + #endif + MatchFinder_Free(&p->matchFinderBase, allocBig); + LzmaEnc_FreeLits(p, alloc); + RangeEnc_Free(&p->rc, alloc); +} + +void LzmaEnc_Destroy(CLzmaEncHandle p, ISzAlloc *alloc, ISzAlloc *allocBig) +{ + LzmaEnc_Destruct((CLzmaEnc *)p, alloc, allocBig); + alloc->Free(alloc, p); +} + +static SRes LzmaEnc_CodeOneBlock(CLzmaEnc *p, Bool useLimits, UInt32 maxPackSize, UInt32 maxUnpackSize) +{ + UInt32 nowPos32, startPos32; + if (p->needInit) + { + p->matchFinder.Init(p->matchFinderObj); + p->needInit = 0; + } + + if (p->finished) + return p->result; + RINOK(CheckErrors(p)); + + nowPos32 = (UInt32)p->nowPos64; + startPos32 = nowPos32; + + if (p->nowPos64 == 0) + { + UInt32 numPairs; + Byte curByte; + if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) == 0) + return Flush(p, nowPos32); + ReadMatchDistances(p, &numPairs); + RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][0], 0); + p->state = kLiteralNextStates[p->state]; + curByte = p->matchFinder.GetIndexByte(p->matchFinderObj, 0 - p->additionalOffset); + LitEnc_Encode(&p->rc, p->litProbs, curByte); + p->additionalOffset--; + nowPos32++; + } + + if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) != 0) + for (;;) + { + UInt32 pos, len, posState; + + if (p->fastMode) + len = GetOptimumFast(p, &pos); + else + len = GetOptimum(p, nowPos32, &pos); + + #ifdef SHOW_STAT2 + printf("\n pos = %4X, len = %d pos = %d", nowPos32, len, pos); + #endif + + posState = nowPos32 & p->pbMask; + if (len == 1 && pos == (UInt32)-1) + { + Byte curByte; + CLzmaProb *probs; + const Byte *data; + + RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][posState], 0); + data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - p->additionalOffset; + curByte = *data; + probs = LIT_PROBS(nowPos32, *(data - 1)); + if (IsCharState(p->state)) + LitEnc_Encode(&p->rc, probs, curByte); + else + LitEnc_EncodeMatched(&p->rc, probs, curByte, *(data - p->reps[0] - 1)); + p->state = kLiteralNextStates[p->state]; + } + else + { + RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][posState], 1); + if (pos < LZMA_NUM_REPS) + { + RangeEnc_EncodeBit(&p->rc, &p->isRep[p->state], 1); + if (pos == 0) + { + RangeEnc_EncodeBit(&p->rc, &p->isRepG0[p->state], 0); + RangeEnc_EncodeBit(&p->rc, &p->isRep0Long[p->state][posState], ((len == 1) ? 0 : 1)); + } + else + { + UInt32 distance = p->reps[pos]; + RangeEnc_EncodeBit(&p->rc, &p->isRepG0[p->state], 1); + if (pos == 1) + RangeEnc_EncodeBit(&p->rc, &p->isRepG1[p->state], 0); + else + { + RangeEnc_EncodeBit(&p->rc, &p->isRepG1[p->state], 1); + RangeEnc_EncodeBit(&p->rc, &p->isRepG2[p->state], pos - 2); + if (pos == 3) + p->reps[3] = p->reps[2]; + p->reps[2] = p->reps[1]; + } + p->reps[1] = p->reps[0]; + p->reps[0] = distance; + } + if (len == 1) + p->state = kShortRepNextStates[p->state]; + else + { + LenEnc_Encode2(&p->repLenEnc, &p->rc, len - LZMA_MATCH_LEN_MIN, posState, !p->fastMode, p->ProbPrices); + p->state = kRepNextStates[p->state]; + } + } + else + { + UInt32 posSlot; + RangeEnc_EncodeBit(&p->rc, &p->isRep[p->state], 0); + p->state = kMatchNextStates[p->state]; + LenEnc_Encode2(&p->lenEnc, &p->rc, len - LZMA_MATCH_LEN_MIN, posState, !p->fastMode, p->ProbPrices); + pos -= LZMA_NUM_REPS; + GetPosSlot(pos, posSlot); + RcTree_Encode(&p->rc, p->posSlotEncoder[GetLenToPosState(len)], kNumPosSlotBits, posSlot); + + if (posSlot >= kStartPosModelIndex) + { + UInt32 footerBits = ((posSlot >> 1) - 1); + UInt32 base = ((2 | (posSlot & 1)) << footerBits); + UInt32 posReduced = pos - base; + + if (posSlot < kEndPosModelIndex) + RcTree_ReverseEncode(&p->rc, p->posEncoders + base - posSlot - 1, footerBits, posReduced); + else + { + RangeEnc_EncodeDirectBits(&p->rc, posReduced >> kNumAlignBits, footerBits - kNumAlignBits); + RcTree_ReverseEncode(&p->rc, p->posAlignEncoder, kNumAlignBits, posReduced & kAlignMask); + p->alignPriceCount++; + } + } + p->reps[3] = p->reps[2]; + p->reps[2] = p->reps[1]; + p->reps[1] = p->reps[0]; + p->reps[0] = pos; + p->matchPriceCount++; + } + } + p->additionalOffset -= len; + nowPos32 += len; + if (p->additionalOffset == 0) + { + UInt32 processed; + if (!p->fastMode) + { + if (p->matchPriceCount >= (1 << 7)) + FillDistancesPrices(p); + if (p->alignPriceCount >= kAlignTableSize) + FillAlignPrices(p); + } + if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) == 0) + break; + processed = nowPos32 - startPos32; + if (useLimits) + { + if (processed + kNumOpts + 300 >= maxUnpackSize || + RangeEnc_GetProcessed(&p->rc) + kNumOpts * 2 >= maxPackSize) + break; + } + else if (processed >= (1 << 15)) + { + p->nowPos64 += nowPos32 - startPos32; + return CheckErrors(p); + } + } + } + p->nowPos64 += nowPos32 - startPos32; + return Flush(p, nowPos32); +} + +#define kBigHashDicLimit ((UInt32)1 << 24) + +static SRes LzmaEnc_Alloc(CLzmaEnc *p, UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig) +{ + UInt32 beforeSize = kNumOpts; + Bool btMode; + if (!RangeEnc_Alloc(&p->rc, alloc)) + return SZ_ERROR_MEM; + btMode = (p->matchFinderBase.btMode != 0); + #ifndef _7ZIP_ST + p->mtMode = (p->multiThread && !p->fastMode && btMode); + #endif + + { + unsigned lclp = p->lc + p->lp; + if (p->litProbs == 0 || p->saveState.litProbs == 0 || p->lclp != lclp) + { + LzmaEnc_FreeLits(p, alloc); + p->litProbs = (CLzmaProb *)alloc->Alloc(alloc, (0x300 << lclp) * sizeof(CLzmaProb)); + p->saveState.litProbs = (CLzmaProb *)alloc->Alloc(alloc, (0x300 << lclp) * sizeof(CLzmaProb)); + if (p->litProbs == 0 || p->saveState.litProbs == 0) + { + LzmaEnc_FreeLits(p, alloc); + return SZ_ERROR_MEM; + } + p->lclp = lclp; + } + } + + p->matchFinderBase.bigHash = (p->dictSize > kBigHashDicLimit); + + if (beforeSize + p->dictSize < keepWindowSize) + beforeSize = keepWindowSize - p->dictSize; + + #ifndef _7ZIP_ST + if (p->mtMode) + { + RINOK(MatchFinderMt_Create(&p->matchFinderMt, p->dictSize, beforeSize, p->numFastBytes, LZMA_MATCH_LEN_MAX, allocBig)); + p->matchFinderObj = &p->matchFinderMt; + MatchFinderMt_CreateVTable(&p->matchFinderMt, &p->matchFinder); + } + else + #endif + { + if (!MatchFinder_Create(&p->matchFinderBase, p->dictSize, beforeSize, p->numFastBytes, LZMA_MATCH_LEN_MAX, allocBig)) + return SZ_ERROR_MEM; + p->matchFinderObj = &p->matchFinderBase; + MatchFinder_CreateVTable(&p->matchFinderBase, &p->matchFinder); + } + return SZ_OK; +} + +void LzmaEnc_Init(CLzmaEnc *p) +{ + UInt32 i; + p->state = 0; + for (i = 0 ; i < LZMA_NUM_REPS; i++) + p->reps[i] = 0; + + RangeEnc_Init(&p->rc); + + + for (i = 0; i < kNumStates; i++) + { + UInt32 j; + for (j = 0; j < LZMA_NUM_PB_STATES_MAX; j++) + { + p->isMatch[i][j] = kProbInitValue; + p->isRep0Long[i][j] = kProbInitValue; + } + p->isRep[i] = kProbInitValue; + p->isRepG0[i] = kProbInitValue; + p->isRepG1[i] = kProbInitValue; + p->isRepG2[i] = kProbInitValue; + } + + { + UInt32 num = 0x300 << (p->lp + p->lc); + for (i = 0; i < num; i++) + p->litProbs[i] = kProbInitValue; + } + + { + for (i = 0; i < kNumLenToPosStates; i++) + { + CLzmaProb *probs = p->posSlotEncoder[i]; + UInt32 j; + for (j = 0; j < (1 << kNumPosSlotBits); j++) + probs[j] = kProbInitValue; + } + } + { + for (i = 0; i < kNumFullDistances - kEndPosModelIndex; i++) + p->posEncoders[i] = kProbInitValue; + } + + LenEnc_Init(&p->lenEnc.p); + LenEnc_Init(&p->repLenEnc.p); + + for (i = 0; i < (1 << kNumAlignBits); i++) + p->posAlignEncoder[i] = kProbInitValue; + + p->optimumEndIndex = 0; + p->optimumCurrentIndex = 0; + p->additionalOffset = 0; + + p->pbMask = (1 << p->pb) - 1; + p->lpMask = (1 << p->lp) - 1; +} + +void LzmaEnc_InitPrices(CLzmaEnc *p) +{ + if (!p->fastMode) + { + FillDistancesPrices(p); + FillAlignPrices(p); + } + + p->lenEnc.tableSize = + p->repLenEnc.tableSize = + p->numFastBytes + 1 - LZMA_MATCH_LEN_MIN; + LenPriceEnc_UpdateTables(&p->lenEnc, 1 << p->pb, p->ProbPrices); + LenPriceEnc_UpdateTables(&p->repLenEnc, 1 << p->pb, p->ProbPrices); +} + +static SRes LzmaEnc_AllocAndInit(CLzmaEnc *p, UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig) +{ + UInt32 i; + for (i = 0; i < (UInt32)kDicLogSizeMaxCompress; i++) + if (p->dictSize <= ((UInt32)1 << i)) + break; + p->distTableSize = i * 2; + + p->finished = False; + p->result = SZ_OK; + RINOK(LzmaEnc_Alloc(p, keepWindowSize, alloc, allocBig)); + LzmaEnc_Init(p); + LzmaEnc_InitPrices(p); + p->nowPos64 = 0; + return SZ_OK; +} + +static SRes LzmaEnc_Prepare(CLzmaEncHandle pp, ISeqOutStream *outStream, ISeqInStream *inStream, + ISzAlloc *alloc, ISzAlloc *allocBig) +{ + CLzmaEnc *p = (CLzmaEnc *)pp; + p->matchFinderBase.stream = inStream; + p->needInit = 1; + p->rc.outStream = outStream; + return LzmaEnc_AllocAndInit(p, 0, alloc, allocBig); +} + +SRes LzmaEnc_PrepareForLzma2(CLzmaEncHandle pp, + ISeqInStream *inStream, UInt32 keepWindowSize, + ISzAlloc *alloc, ISzAlloc *allocBig) +{ + CLzmaEnc *p = (CLzmaEnc *)pp; + p->matchFinderBase.stream = inStream; + p->needInit = 1; + return LzmaEnc_AllocAndInit(p, keepWindowSize, alloc, allocBig); +} + +static void LzmaEnc_SetInputBuf(CLzmaEnc *p, const Byte *src, SizeT srcLen) +{ + p->matchFinderBase.directInput = 1; + p->matchFinderBase.bufferBase = (Byte *)src; + p->matchFinderBase.directInputRem = srcLen; +} + +SRes LzmaEnc_MemPrepare(CLzmaEncHandle pp, const Byte *src, SizeT srcLen, + UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig) +{ + CLzmaEnc *p = (CLzmaEnc *)pp; + LzmaEnc_SetInputBuf(p, src, srcLen); + p->needInit = 1; + + return LzmaEnc_AllocAndInit(p, keepWindowSize, alloc, allocBig); +} + +void LzmaEnc_Finish(CLzmaEncHandle pp) +{ + #ifndef _7ZIP_ST + CLzmaEnc *p = (CLzmaEnc *)pp; + if (p->mtMode) + MatchFinderMt_ReleaseStream(&p->matchFinderMt); + #else + pp = pp; + #endif +} + +typedef struct +{ + ISeqOutStream funcTable; + Byte *data; + SizeT rem; + Bool overflow; +} CSeqOutStreamBuf; + +static size_t MyWrite(void *pp, const void *data, size_t size) +{ + CSeqOutStreamBuf *p = (CSeqOutStreamBuf *)pp; + if (p->rem < size) + { + size = p->rem; + p->overflow = True; + } + memcpy(p->data, data, size); + p->rem -= size; + p->data += size; + return size; +} + + +UInt32 LzmaEnc_GetNumAvailableBytes(CLzmaEncHandle pp) +{ + const CLzmaEnc *p = (CLzmaEnc *)pp; + return p->matchFinder.GetNumAvailableBytes(p->matchFinderObj); +} + +const Byte *LzmaEnc_GetCurBuf(CLzmaEncHandle pp) +{ + const CLzmaEnc *p = (CLzmaEnc *)pp; + return p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - p->additionalOffset; +} + +SRes LzmaEnc_CodeOneMemBlock(CLzmaEncHandle pp, Bool reInit, + Byte *dest, size_t *destLen, UInt32 desiredPackSize, UInt32 *unpackSize) +{ + CLzmaEnc *p = (CLzmaEnc *)pp; + UInt64 nowPos64; + SRes res; + CSeqOutStreamBuf outStream; + + outStream.funcTable.Write = MyWrite; + outStream.data = dest; + outStream.rem = *destLen; + outStream.overflow = False; + + p->writeEndMark = False; + p->finished = False; + p->result = SZ_OK; + + if (reInit) + LzmaEnc_Init(p); + LzmaEnc_InitPrices(p); + nowPos64 = p->nowPos64; + RangeEnc_Init(&p->rc); + p->rc.outStream = &outStream.funcTable; + + res = LzmaEnc_CodeOneBlock(p, True, desiredPackSize, *unpackSize); + + *unpackSize = (UInt32)(p->nowPos64 - nowPos64); + *destLen -= outStream.rem; + if (outStream.overflow) + return SZ_ERROR_OUTPUT_EOF; + + return res; +} + +static SRes LzmaEnc_Encode2(CLzmaEnc *p, ICompressProgress *progress) +{ + SRes res = SZ_OK; + + #ifndef _7ZIP_ST + Byte allocaDummy[0x300]; + int i = 0; + for (i = 0; i < 16; i++) + allocaDummy[i] = (Byte)i; + #endif + + for (;;) + { + res = LzmaEnc_CodeOneBlock(p, False, 0, 0); + if (res != SZ_OK || p->finished != 0) + break; + if (progress != 0) + { + res = progress->Progress(progress, p->nowPos64, RangeEnc_GetProcessed(&p->rc)); + if (res != SZ_OK) + { + res = SZ_ERROR_PROGRESS; + break; + } + } + } + LzmaEnc_Finish(p); + return res; +} + +SRes LzmaEnc_Encode(CLzmaEncHandle pp, ISeqOutStream *outStream, ISeqInStream *inStream, ICompressProgress *progress, + ISzAlloc *alloc, ISzAlloc *allocBig) +{ + RINOK(LzmaEnc_Prepare(pp, outStream, inStream, alloc, allocBig)); + return LzmaEnc_Encode2((CLzmaEnc *)pp, progress); +} + +SRes LzmaEnc_WriteProperties(CLzmaEncHandle pp, Byte *props, SizeT *size) +{ + CLzmaEnc *p = (CLzmaEnc *)pp; + int i; + UInt32 dictSize = p->dictSize; + if (*size < LZMA_PROPS_SIZE) + return SZ_ERROR_PARAM; + *size = LZMA_PROPS_SIZE; + props[0] = (Byte)((p->pb * 5 + p->lp) * 9 + p->lc); + + for (i = 11; i <= 30; i++) + { + if (dictSize <= ((UInt32)2 << i)) + { + dictSize = (2 << i); + break; + } + if (dictSize <= ((UInt32)3 << i)) + { + dictSize = (3 << i); + break; + } + } + + for (i = 0; i < 4; i++) + props[1 + i] = (Byte)(dictSize >> (8 * i)); + return SZ_OK; +} + +SRes LzmaEnc_MemEncode(CLzmaEncHandle pp, Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, + int writeEndMark, ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig) +{ + SRes res; + CLzmaEnc *p = (CLzmaEnc *)pp; + + CSeqOutStreamBuf outStream; + + LzmaEnc_SetInputBuf(p, src, srcLen); + + outStream.funcTable.Write = MyWrite; + outStream.data = dest; + outStream.rem = *destLen; + outStream.overflow = False; + + p->writeEndMark = writeEndMark; + + p->rc.outStream = &outStream.funcTable; + res = LzmaEnc_MemPrepare(pp, src, srcLen, 0, alloc, allocBig); + if (res == SZ_OK) + res = LzmaEnc_Encode2(p, progress); + + *destLen -= outStream.rem; + if (outStream.overflow) + return SZ_ERROR_OUTPUT_EOF; + return res; +} + +SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, + const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark, + ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig) +{ + CLzmaEnc *p = (CLzmaEnc *)LzmaEnc_Create(alloc); + SRes res; + if (p == 0) + return SZ_ERROR_MEM; + + res = LzmaEnc_SetProps(p, props); + if (res == SZ_OK) + { + res = LzmaEnc_WriteProperties(p, propsEncoded, propsSize); + if (res == SZ_OK) + res = LzmaEnc_MemEncode(p, dest, destLen, src, srcLen, + writeEndMark, progress, alloc, allocBig); + } + + LzmaEnc_Destroy(p, alloc, allocBig); + return res; +} diff --git a/dep/StormLib/src/lzma/C/LzmaEnc.h b/dep/StormLib/src/lzma/C/LzmaEnc.h new file mode 100644 index 00000000000..200d60eb83c --- /dev/null +++ b/dep/StormLib/src/lzma/C/LzmaEnc.h @@ -0,0 +1,80 @@ +/* LzmaEnc.h -- LZMA Encoder +2009-02-07 : Igor Pavlov : Public domain */ + +#ifndef __LZMA_ENC_H +#define __LZMA_ENC_H + +#include "Types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define LZMA_PROPS_SIZE 5 + +typedef struct _CLzmaEncProps +{ + int level; /* 0 <= level <= 9 */ + UInt32 dictSize; /* (1 << 12) <= dictSize <= (1 << 27) for 32-bit version + (1 << 12) <= dictSize <= (1 << 30) for 64-bit version + default = (1 << 24) */ + int lc; /* 0 <= lc <= 8, default = 3 */ + int lp; /* 0 <= lp <= 4, default = 0 */ + int pb; /* 0 <= pb <= 4, default = 2 */ + int algo; /* 0 - fast, 1 - normal, default = 1 */ + int fb; /* 5 <= fb <= 273, default = 32 */ + int btMode; /* 0 - hashChain Mode, 1 - binTree mode - normal, default = 1 */ + int numHashBytes; /* 2, 3 or 4, default = 4 */ + UInt32 mc; /* 1 <= mc <= (1 << 30), default = 32 */ + unsigned writeEndMark; /* 0 - do not write EOPM, 1 - write EOPM, default = 0 */ + int numThreads; /* 1 or 2, default = 2 */ +} CLzmaEncProps; + +void LzmaEncProps_Init(CLzmaEncProps *p); +void LzmaEncProps_Normalize(CLzmaEncProps *p); +UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2); + + +/* ---------- CLzmaEncHandle Interface ---------- */ + +/* LzmaEnc_* functions can return the following exit codes: +Returns: + SZ_OK - OK + SZ_ERROR_MEM - Memory allocation error + SZ_ERROR_PARAM - Incorrect paramater in props + SZ_ERROR_WRITE - Write callback error. + SZ_ERROR_PROGRESS - some break from progress callback + SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version) +*/ + +typedef void * CLzmaEncHandle; + +CLzmaEncHandle LzmaEnc_Create(ISzAlloc *alloc); +void LzmaEnc_Destroy(CLzmaEncHandle p, ISzAlloc *alloc, ISzAlloc *allocBig); +SRes LzmaEnc_SetProps(CLzmaEncHandle p, const CLzmaEncProps *props); +SRes LzmaEnc_WriteProperties(CLzmaEncHandle p, Byte *properties, SizeT *size); +SRes LzmaEnc_Encode(CLzmaEncHandle p, ISeqOutStream *outStream, ISeqInStream *inStream, + ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig); +SRes LzmaEnc_MemEncode(CLzmaEncHandle p, Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, + int writeEndMark, ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig); + +/* ---------- One Call Interface ---------- */ + +/* LzmaEncode +Return code: + SZ_OK - OK + SZ_ERROR_MEM - Memory allocation error + SZ_ERROR_PARAM - Incorrect paramater + SZ_ERROR_OUTPUT_EOF - output buffer overflow + SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version) +*/ + +SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, + const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark, + ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/dep/StormLib/src/lzma/C/Threads.c b/dep/StormLib/src/lzma/C/Threads.c new file mode 100644 index 00000000000..7af1da2e26e --- /dev/null +++ b/dep/StormLib/src/lzma/C/Threads.c @@ -0,0 +1,84 @@ +/* Threads.c -- multithreading library +2009-09-20 : Igor Pavlov : Public domain */ + +#ifndef _WIN32_WCE +#include +#endif + +#include "Threads.h" + +static WRes GetError() +{ + DWORD res = GetLastError(); + return (res) ? (WRes)(res) : 1; +} + +WRes HandleToWRes(HANDLE h) { return (h != 0) ? 0 : GetError(); } +WRes BOOLToWRes(BOOL v) { return v ? 0 : GetError(); } + +WRes HandlePtr_Close(HANDLE *p) +{ + if (*p != NULL) + if (!CloseHandle(*p)) + return GetError(); + *p = NULL; + return 0; +} + +WRes Handle_WaitObject(HANDLE h) { return (WRes)WaitForSingleObject(h, INFINITE); } + +WRes Thread_Create(CThread *p, THREAD_FUNC_TYPE func, LPVOID param) +{ + unsigned threadId; /* Windows Me/98/95: threadId parameter may not be NULL in _beginthreadex/CreateThread functions */ + *p = + #ifdef UNDER_CE + CreateThread(0, 0, func, param, 0, &threadId); + #else + (HANDLE)_beginthreadex(NULL, 0, func, param, 0, &threadId); + #endif + /* maybe we must use errno here, but probably GetLastError() is also OK. */ + return HandleToWRes(*p); +} + +WRes Event_Create(CEvent *p, BOOL manualReset, int signaled) +{ + *p = CreateEvent(NULL, manualReset, (signaled ? TRUE : FALSE), NULL); + return HandleToWRes(*p); +} + +WRes Event_Set(CEvent *p) { return BOOLToWRes(SetEvent(*p)); } +WRes Event_Reset(CEvent *p) { return BOOLToWRes(ResetEvent(*p)); } + +WRes ManualResetEvent_Create(CManualResetEvent *p, int signaled) { return Event_Create(p, TRUE, signaled); } +WRes AutoResetEvent_Create(CAutoResetEvent *p, int signaled) { return Event_Create(p, FALSE, signaled); } +WRes ManualResetEvent_CreateNotSignaled(CManualResetEvent *p) { return ManualResetEvent_Create(p, 0); } +WRes AutoResetEvent_CreateNotSignaled(CAutoResetEvent *p) { return AutoResetEvent_Create(p, 0); } + + +WRes Semaphore_Create(CSemaphore *p, UInt32 initCount, UInt32 maxCount) +{ + *p = CreateSemaphore(NULL, (LONG)initCount, (LONG)maxCount, NULL); + return HandleToWRes(*p); +} + +static WRes Semaphore_Release(CSemaphore *p, LONG releaseCount, LONG *previousCount) + { return BOOLToWRes(ReleaseSemaphore(*p, releaseCount, previousCount)); } +WRes Semaphore_ReleaseN(CSemaphore *p, UInt32 num) + { return Semaphore_Release(p, (LONG)num, NULL); } +WRes Semaphore_Release1(CSemaphore *p) { return Semaphore_ReleaseN(p, 1); } + +WRes CriticalSection_Init(CCriticalSection *p) +{ + /* InitializeCriticalSection can raise only STATUS_NO_MEMORY exception */ + #ifdef _MSC_VER + __try + #endif + { + InitializeCriticalSection(p); + /* InitializeCriticalSectionAndSpinCount(p, 0); */ + } + #ifdef _MSC_VER + __except (EXCEPTION_EXECUTE_HANDLER) { return 1; } + #endif + return 0; +} diff --git a/dep/StormLib/src/lzma/C/Threads.h b/dep/StormLib/src/lzma/C/Threads.h new file mode 100644 index 00000000000..d0ddd80e227 --- /dev/null +++ b/dep/StormLib/src/lzma/C/Threads.h @@ -0,0 +1,59 @@ +/* Threads.h -- multithreading library +2009-03-27 : Igor Pavlov : Public domain */ + +#ifndef __7Z_THREADS_H +#define __7Z_THREADS_H + +#include "Types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +WRes HandlePtr_Close(HANDLE *h); +WRes Handle_WaitObject(HANDLE h); + +typedef HANDLE CThread; +#define Thread_Construct(p) *(p) = NULL +#define Thread_WasCreated(p) (*(p) != NULL) +#define Thread_Close(p) HandlePtr_Close(p) +#define Thread_Wait(p) Handle_WaitObject(*(p)) +typedef unsigned THREAD_FUNC_RET_TYPE; +#define THREAD_FUNC_CALL_TYPE MY_STD_CALL +#define THREAD_FUNC_DECL THREAD_FUNC_RET_TYPE THREAD_FUNC_CALL_TYPE +typedef THREAD_FUNC_RET_TYPE (THREAD_FUNC_CALL_TYPE * THREAD_FUNC_TYPE)(void *); +WRes Thread_Create(CThread *p, THREAD_FUNC_TYPE func, LPVOID param); + +typedef HANDLE CEvent; +typedef CEvent CAutoResetEvent; +typedef CEvent CManualResetEvent; +#define Event_Construct(p) *(p) = NULL +#define Event_IsCreated(p) (*(p) != NULL) +#define Event_Close(p) HandlePtr_Close(p) +#define Event_Wait(p) Handle_WaitObject(*(p)) +WRes Event_Set(CEvent *p); +WRes Event_Reset(CEvent *p); +WRes ManualResetEvent_Create(CManualResetEvent *p, int signaled); +WRes ManualResetEvent_CreateNotSignaled(CManualResetEvent *p); +WRes AutoResetEvent_Create(CAutoResetEvent *p, int signaled); +WRes AutoResetEvent_CreateNotSignaled(CAutoResetEvent *p); + +typedef HANDLE CSemaphore; +#define Semaphore_Construct(p) (*p) = NULL +#define Semaphore_Close(p) HandlePtr_Close(p) +#define Semaphore_Wait(p) Handle_WaitObject(*(p)) +WRes Semaphore_Create(CSemaphore *p, UInt32 initCount, UInt32 maxCount); +WRes Semaphore_ReleaseN(CSemaphore *p, UInt32 num); +WRes Semaphore_Release1(CSemaphore *p); + +typedef CRITICAL_SECTION CCriticalSection; +WRes CriticalSection_Init(CCriticalSection *p); +#define CriticalSection_Delete(p) DeleteCriticalSection(p) +#define CriticalSection_Enter(p) EnterCriticalSection(p) +#define CriticalSection_Leave(p) LeaveCriticalSection(p) + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/dep/StormLib/src/lzma/C/Types.h b/dep/StormLib/src/lzma/C/Types.h new file mode 100644 index 00000000000..0526cb47b6e --- /dev/null +++ b/dep/StormLib/src/lzma/C/Types.h @@ -0,0 +1,236 @@ +/* Types.h -- Basic types +2010-03-11 : Igor Pavlov : Public domain */ + +#ifndef __7Z_TYPES_H +#define __7Z_TYPES_H + +#include + +#ifdef _WIN32 +#include +#endif + +#ifndef EXTERN_C_BEGIN +#ifdef __cplusplus +#define EXTERN_C_BEGIN extern "C" { +#define EXTERN_C_END } +#else +#define EXTERN_C_BEGIN +#define EXTERN_C_END +#endif +#endif + +EXTERN_C_BEGIN + +#define SZ_OK 0 + +#define SZ_ERROR_DATA 1 +#define SZ_ERROR_MEM 2 +#define SZ_ERROR_CRC 3 +#define SZ_ERROR_UNSUPPORTED 4 +#define SZ_ERROR_PARAM 5 +#define SZ_ERROR_INPUT_EOF 6 +#define SZ_ERROR_OUTPUT_EOF 7 +#define SZ_ERROR_READ 8 +#define SZ_ERROR_WRITE 9 +#define SZ_ERROR_PROGRESS 10 +#define SZ_ERROR_FAIL 11 +#define SZ_ERROR_THREAD 12 + +#define SZ_ERROR_ARCHIVE 16 +#define SZ_ERROR_NO_ARCHIVE 17 + +typedef int SRes; + +#ifdef _WIN32 +typedef DWORD WRes; +#else +typedef int WRes; +#endif + +#ifndef RINOK +#define RINOK(x) { int __result__ = (x); if (__result__ != 0) return __result__; } +#endif + +typedef unsigned char Byte; +typedef short Int16; +typedef unsigned short UInt16; + +#ifdef _LZMA_UINT32_IS_ULONG +typedef long Int32; +typedef unsigned long UInt32; +#else +typedef int Int32; +typedef unsigned int UInt32; +#endif + +#ifdef _SZ_NO_INT_64 + +/* define _SZ_NO_INT_64, if your compiler doesn't support 64-bit integers. + NOTES: Some code will work incorrectly in that case! */ + +typedef long Int64; +typedef unsigned long UInt64; + +#else + +#if defined(_MSC_VER) || defined(__BORLANDC__) +typedef __int64 Int64; +typedef unsigned __int64 UInt64; +#else +typedef long long int Int64; +typedef unsigned long long int UInt64; +#endif + +#endif + +#ifdef _LZMA_NO_SYSTEM_SIZE_T +typedef UInt32 SizeT; +#else +typedef size_t SizeT; +#endif + +typedef int Bool; +#define True 1 +#define False 0 + + +#ifdef _WIN32 +#define MY_STD_CALL __stdcall +#else +#define MY_STD_CALL +#endif + +#ifdef _MSC_VER + +#if _MSC_VER >= 1300 +#define MY_NO_INLINE __declspec(noinline) +#else +#define MY_NO_INLINE +#endif + +#define MY_CDECL __cdecl +#define MY_FAST_CALL __fastcall + +#else + +#define MY_CDECL +#define MY_FAST_CALL + +#endif + + +/* The following interfaces use first parameter as pointer to structure */ + +typedef struct +{ + Byte (*Read)(void *p); /* reads one byte, returns 0 in case of EOF or error */ +} IByteIn; + +typedef struct +{ + void (*Write)(void *p, Byte b); +} IByteOut; + +typedef struct +{ + SRes (*Read)(void *p, void *buf, size_t *size); + /* if (input(*size) != 0 && output(*size) == 0) means end_of_stream. + (output(*size) < input(*size)) is allowed */ +} ISeqInStream; + +/* it can return SZ_ERROR_INPUT_EOF */ +SRes SeqInStream_Read(ISeqInStream *stream, void *buf, size_t size); +SRes SeqInStream_Read2(ISeqInStream *stream, void *buf, size_t size, SRes errorType); +SRes SeqInStream_ReadByte(ISeqInStream *stream, Byte *buf); + +typedef struct +{ + size_t (*Write)(void *p, const void *buf, size_t size); + /* Returns: result - the number of actually written bytes. + (result < size) means error */ +} ISeqOutStream; + +typedef enum +{ + SZ_SEEK_SET = 0, + SZ_SEEK_CUR = 1, + SZ_SEEK_END = 2 +} ESzSeek; + +typedef struct +{ + SRes (*Read)(void *p, void *buf, size_t *size); /* same as ISeqInStream::Read */ + SRes (*Seek)(void *p, Int64 *pos, ESzSeek origin); +} ISeekInStream; + +typedef struct +{ + SRes (*Look)(void *p, const void **buf, size_t *size); + /* if (input(*size) != 0 && output(*size) == 0) means end_of_stream. + (output(*size) > input(*size)) is not allowed + (output(*size) < input(*size)) is allowed */ + SRes (*Skip)(void *p, size_t offset); + /* offset must be <= output(*size) of Look */ + + SRes (*Read)(void *p, void *buf, size_t *size); + /* reads directly (without buffer). It's same as ISeqInStream::Read */ + SRes (*Seek)(void *p, Int64 *pos, ESzSeek origin); +} ILookInStream; + +SRes LookInStream_LookRead(ILookInStream *stream, void *buf, size_t *size); +SRes LookInStream_SeekTo(ILookInStream *stream, UInt64 offset); + +/* reads via ILookInStream::Read */ +SRes LookInStream_Read2(ILookInStream *stream, void *buf, size_t size, SRes errorType); +SRes LookInStream_Read(ILookInStream *stream, void *buf, size_t size); + +#define LookToRead_BUF_SIZE (1 << 14) + +typedef struct +{ + ILookInStream s; + ISeekInStream *realStream; + size_t pos; + size_t size; + Byte buf[LookToRead_BUF_SIZE]; +} CLookToRead; + +void LookToRead_CreateVTable(CLookToRead *p, int lookahead); +void LookToRead_Init(CLookToRead *p); + +typedef struct +{ + ISeqInStream s; + ILookInStream *realStream; +} CSecToLook; + +void SecToLook_CreateVTable(CSecToLook *p); + +typedef struct +{ + ISeqInStream s; + ILookInStream *realStream; +} CSecToRead; + +void SecToRead_CreateVTable(CSecToRead *p); + +typedef struct +{ + SRes (*Progress)(void *p, UInt64 inSize, UInt64 outSize); + /* Returns: result. (result != SZ_OK) means break. + Value (UInt64)(Int64)-1 for size means unknown value. */ +} ICompressProgress; + +typedef struct +{ + void *(*Alloc)(void *p, size_t size); + void (*Free)(void *p, void *address); /* address can be 0 */ +} ISzAlloc; + +#define IAlloc_Alloc(p, size) (p)->Alloc((p), size) +#define IAlloc_Free(p, a) (p)->Free((p), a) + +EXTERN_C_END + +#endif diff --git a/dep/StormLib/src/pklib/crc32.c b/dep/StormLib/src/pklib/crc32.c new file mode 100644 index 00000000000..cd47b1d4a9b --- /dev/null +++ b/dep/StormLib/src/pklib/crc32.c @@ -0,0 +1,66 @@ +/*****************************************************************************/ +/* crc32.c Copyright (c) Ladislav Zezula 2003 */ +/*---------------------------------------------------------------------------*/ +/* Pkware Data Compression Library Version 1.11 */ +/* Dissassembled method crc32 - cdecl version */ +/*---------------------------------------------------------------------------*/ +/* Date Ver Who Comment */ +/* -------- ---- --- ------- */ +/* 09.04.03 1.00 Lad The first version of crc32.c */ +/* 02.05.03 1.00 Lad Stress test done */ +/*****************************************************************************/ + +#include "pklib.h" + +static unsigned long crc_table[] = +{ + 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, + 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, + 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, + 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5, + 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, + 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, + 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F, + 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, + 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433, + 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, + 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, + 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65, + 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, + 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, + 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, + 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, + 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683, + 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, + 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7, + 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, + 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B, + 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79, + 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, + 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D, + 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, + 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, + 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777, + 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, + 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, + 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, + 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF, + 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D +}; + + +unsigned long PKEXPORT crc32_pklib(char * buffer, unsigned int * psize, unsigned long * old_crc) +{ + unsigned int size = *psize; + unsigned long ch; + unsigned long crc_value = *old_crc; + + while(size-- != 0) + { + ch = *buffer++ ^ (char)crc_value; + crc_value >>= 8; + + crc_value = crc_table[ch & 0x0FF] ^ crc_value; + } + return crc_value; +} diff --git a/dep/StormLib/src/pklib/explode.c b/dep/StormLib/src/pklib/explode.c new file mode 100644 index 00000000000..0d327a5da84 --- /dev/null +++ b/dep/StormLib/src/pklib/explode.c @@ -0,0 +1,522 @@ +/*****************************************************************************/ +/* explode.c Copyright (c) Ladislav Zezula 2003 */ +/*---------------------------------------------------------------------------*/ +/* Implode function of PKWARE Data Compression library */ +/*---------------------------------------------------------------------------*/ +/* Date Ver Who Comment */ +/* -------- ---- --- ------- */ +/* 11.03.03 1.00 Lad Splitted from Pkware.cpp */ +/* 08.04.03 1.01 Lad Renamed to explode.c to be compatible with pklib */ +/* 02.05.03 1.01 Lad Stress test done */ +/* 22.04.10 1.01 Lad Documented */ +/*****************************************************************************/ + +#include +#include + +#include "pklib.h" + +#define PKDCL_OK 0 +#define PKDCL_STREAM_END 1 // All data from the input stream is read +#define PKDCL_NEED_DICT 2 // Need more data (dictionary) +#define PKDCL_CONTINUE 10 // Internal flag, not returned to user +#define PKDCL_GET_INPUT 11 // Internal flag, not returned to user + +char CopyrightPkware[] = "PKWARE Data Compression Library for Win32\r\n" + "Copyright 1989-1995 PKWARE Inc. All Rights Reserved\r\n" + "Patent No. 5,051,745\r\n" + "PKWARE Data Compression Library Reg. U.S. Pat. and Tm. Off.\r\n" + "Version 1.11\r\n"; + +//----------------------------------------------------------------------------- +// Tables + +static unsigned char DistBits[] = +{ + 0x02, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, + 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 +}; + +static unsigned char DistCode[] = +{ + 0x03, 0x0D, 0x05, 0x19, 0x09, 0x11, 0x01, 0x3E, 0x1E, 0x2E, 0x0E, 0x36, 0x16, 0x26, 0x06, 0x3A, + 0x1A, 0x2A, 0x0A, 0x32, 0x12, 0x22, 0x42, 0x02, 0x7C, 0x3C, 0x5C, 0x1C, 0x6C, 0x2C, 0x4C, 0x0C, + 0x74, 0x34, 0x54, 0x14, 0x64, 0x24, 0x44, 0x04, 0x78, 0x38, 0x58, 0x18, 0x68, 0x28, 0x48, 0x08, + 0xF0, 0x70, 0xB0, 0x30, 0xD0, 0x50, 0x90, 0x10, 0xE0, 0x60, 0xA0, 0x20, 0xC0, 0x40, 0x80, 0x00 +}; + +static unsigned char ExLenBits[] = +{ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 +}; + +static unsigned short LenBase[] = +{ + 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, + 0x0008, 0x000A, 0x000E, 0x0016, 0x0026, 0x0046, 0x0086, 0x0106 +}; + +static unsigned char LenBits[] = +{ + 0x03, 0x02, 0x03, 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, 0x06, 0x07, 0x07 +}; + +static unsigned char LenCode[] = +{ + 0x05, 0x03, 0x01, 0x06, 0x0A, 0x02, 0x0C, 0x14, 0x04, 0x18, 0x08, 0x30, 0x10, 0x20, 0x40, 0x00 +}; + +static unsigned char ChBitsAsc[] = +{ + 0x0B, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x08, 0x07, 0x0C, 0x0C, 0x07, 0x0C, 0x0C, + 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0D, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, + 0x04, 0x0A, 0x08, 0x0C, 0x0A, 0x0C, 0x0A, 0x08, 0x07, 0x07, 0x08, 0x09, 0x07, 0x06, 0x07, 0x08, + 0x07, 0x06, 0x07, 0x07, 0x07, 0x07, 0x08, 0x07, 0x07, 0x08, 0x08, 0x0C, 0x0B, 0x07, 0x09, 0x0B, + 0x0C, 0x06, 0x07, 0x06, 0x06, 0x05, 0x07, 0x08, 0x08, 0x06, 0x0B, 0x09, 0x06, 0x07, 0x06, 0x06, + 0x07, 0x0B, 0x06, 0x06, 0x06, 0x07, 0x09, 0x08, 0x09, 0x09, 0x0B, 0x08, 0x0B, 0x09, 0x0C, 0x08, + 0x0C, 0x05, 0x06, 0x06, 0x06, 0x05, 0x06, 0x06, 0x06, 0x05, 0x0B, 0x07, 0x05, 0x06, 0x05, 0x05, + 0x06, 0x0A, 0x05, 0x05, 0x05, 0x05, 0x08, 0x07, 0x08, 0x08, 0x0A, 0x0B, 0x0B, 0x0C, 0x0C, 0x0C, + 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, + 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, + 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, + 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, + 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, + 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, + 0x0D, 0x0C, 0x0D, 0x0D, 0x0D, 0x0C, 0x0D, 0x0D, 0x0D, 0x0C, 0x0D, 0x0D, 0x0D, 0x0D, 0x0C, 0x0D, + 0x0D, 0x0D, 0x0C, 0x0C, 0x0C, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D +}; + +static unsigned short ChCodeAsc[] = +{ + 0x0490, 0x0FE0, 0x07E0, 0x0BE0, 0x03E0, 0x0DE0, 0x05E0, 0x09E0, + 0x01E0, 0x00B8, 0x0062, 0x0EE0, 0x06E0, 0x0022, 0x0AE0, 0x02E0, + 0x0CE0, 0x04E0, 0x08E0, 0x00E0, 0x0F60, 0x0760, 0x0B60, 0x0360, + 0x0D60, 0x0560, 0x1240, 0x0960, 0x0160, 0x0E60, 0x0660, 0x0A60, + 0x000F, 0x0250, 0x0038, 0x0260, 0x0050, 0x0C60, 0x0390, 0x00D8, + 0x0042, 0x0002, 0x0058, 0x01B0, 0x007C, 0x0029, 0x003C, 0x0098, + 0x005C, 0x0009, 0x001C, 0x006C, 0x002C, 0x004C, 0x0018, 0x000C, + 0x0074, 0x00E8, 0x0068, 0x0460, 0x0090, 0x0034, 0x00B0, 0x0710, + 0x0860, 0x0031, 0x0054, 0x0011, 0x0021, 0x0017, 0x0014, 0x00A8, + 0x0028, 0x0001, 0x0310, 0x0130, 0x003E, 0x0064, 0x001E, 0x002E, + 0x0024, 0x0510, 0x000E, 0x0036, 0x0016, 0x0044, 0x0030, 0x00C8, + 0x01D0, 0x00D0, 0x0110, 0x0048, 0x0610, 0x0150, 0x0060, 0x0088, + 0x0FA0, 0x0007, 0x0026, 0x0006, 0x003A, 0x001B, 0x001A, 0x002A, + 0x000A, 0x000B, 0x0210, 0x0004, 0x0013, 0x0032, 0x0003, 0x001D, + 0x0012, 0x0190, 0x000D, 0x0015, 0x0005, 0x0019, 0x0008, 0x0078, + 0x00F0, 0x0070, 0x0290, 0x0410, 0x0010, 0x07A0, 0x0BA0, 0x03A0, + 0x0240, 0x1C40, 0x0C40, 0x1440, 0x0440, 0x1840, 0x0840, 0x1040, + 0x0040, 0x1F80, 0x0F80, 0x1780, 0x0780, 0x1B80, 0x0B80, 0x1380, + 0x0380, 0x1D80, 0x0D80, 0x1580, 0x0580, 0x1980, 0x0980, 0x1180, + 0x0180, 0x1E80, 0x0E80, 0x1680, 0x0680, 0x1A80, 0x0A80, 0x1280, + 0x0280, 0x1C80, 0x0C80, 0x1480, 0x0480, 0x1880, 0x0880, 0x1080, + 0x0080, 0x1F00, 0x0F00, 0x1700, 0x0700, 0x1B00, 0x0B00, 0x1300, + 0x0DA0, 0x05A0, 0x09A0, 0x01A0, 0x0EA0, 0x06A0, 0x0AA0, 0x02A0, + 0x0CA0, 0x04A0, 0x08A0, 0x00A0, 0x0F20, 0x0720, 0x0B20, 0x0320, + 0x0D20, 0x0520, 0x0920, 0x0120, 0x0E20, 0x0620, 0x0A20, 0x0220, + 0x0C20, 0x0420, 0x0820, 0x0020, 0x0FC0, 0x07C0, 0x0BC0, 0x03C0, + 0x0DC0, 0x05C0, 0x09C0, 0x01C0, 0x0EC0, 0x06C0, 0x0AC0, 0x02C0, + 0x0CC0, 0x04C0, 0x08C0, 0x00C0, 0x0F40, 0x0740, 0x0B40, 0x0340, + 0x0300, 0x0D40, 0x1D00, 0x0D00, 0x1500, 0x0540, 0x0500, 0x1900, + 0x0900, 0x0940, 0x1100, 0x0100, 0x1E00, 0x0E00, 0x0140, 0x1600, + 0x0600, 0x1A00, 0x0E40, 0x0640, 0x0A40, 0x0A00, 0x1200, 0x0200, + 0x1C00, 0x0C00, 0x1400, 0x0400, 0x1800, 0x0800, 0x1000, 0x0000 +}; + +//----------------------------------------------------------------------------- +// Local functions + +static void GenDecodeTabs( + unsigned char * positions, // [out] Table of positions + unsigned char * start_indexes, // [in] Table of start indexes + unsigned char * length_bits, // [in] Table of lengths. Each length is stored as number of bits + size_t elements) // [in] Number of elements in start_indexes and length_bits +{ + unsigned long index; + unsigned long length; + size_t i; + + for(i = 0; i < elements; i++) + { + length = 1 << length_bits[i]; // Get the length in bytes + + for(index = start_indexes[i]; index < 0x100; index += length) + { + positions[index] = (unsigned char)i; + } + } +} + +static void GenAscTabs(TDcmpStruct * pWork) +{ + unsigned short * pChCodeAsc = &ChCodeAsc[0xFF]; + unsigned long acc, add; + unsigned short count; + + for(count = 0x00FF; pChCodeAsc >= ChCodeAsc; pChCodeAsc--, count--) + { + unsigned char * pChBitsAsc = pWork->ChBitsAsc + count; + unsigned char bits_asc = *pChBitsAsc; + + if(bits_asc <= 8) + { + add = (1 << bits_asc); + acc = *pChCodeAsc; + + do + { + pWork->offs2C34[acc] = (unsigned char)count; + acc += add; + } + while(acc < 0x100); + } + else if((acc = (*pChCodeAsc & 0xFF)) != 0) + { + pWork->offs2C34[acc] = 0xFF; + + if(*pChCodeAsc & 0x3F) + { + bits_asc -= 4; + *pChBitsAsc = bits_asc; + + add = (1 << bits_asc); + acc = *pChCodeAsc >> 4; + do + { + pWork->offs2D34[acc] = (unsigned char)count; + acc += add; + } + while(acc < 0x100); + } + else + { + bits_asc -= 6; + *pChBitsAsc = bits_asc; + + add = (1 << bits_asc); + acc = *pChCodeAsc >> 6; + do + { + pWork->offs2E34[acc] = (unsigned char)count; + acc += add; + } + while(acc < 0x80); + } + } + else + { + bits_asc -= 8; + *pChBitsAsc = bits_asc; + + add = (1 << bits_asc); + acc = *pChCodeAsc >> 8; + do + { + pWork->offs2EB4[acc] = (unsigned char)count; + acc += add; + } + while(acc < 0x100); + } + } +} + +//----------------------------------------------------------------------------- +// Removes given number of bits in the bit buffer. New bits are reloaded from +// the input buffer, if needed. +// Returns: PKDCL_OK: Operation was successful +// PKDCL_STREAM_END: There are no more bits in the input buffer + +static int WasteBits(TDcmpStruct * pWork, unsigned long nBits) +{ + // If number of bits required is less than number of (bits in the buffer) ? + if(nBits <= pWork->extra_bits) + { + pWork->extra_bits -= nBits; + pWork->bit_buff >>= nBits; + return PKDCL_OK; + } + + // Load input buffer if necessary + pWork->bit_buff >>= pWork->extra_bits; + if(pWork->in_pos == pWork->in_bytes) + { + pWork->in_pos = sizeof(pWork->in_buff); + if((pWork->in_bytes = pWork->read_buf((char *)pWork->in_buff, &pWork->in_pos, pWork->param)) == 0) + return PKDCL_STREAM_END; + pWork->in_pos = 0; + } + + // Update bit buffer + pWork->bit_buff |= (pWork->in_buff[pWork->in_pos++] << 8); + pWork->bit_buff >>= (nBits - pWork->extra_bits); + pWork->extra_bits = (pWork->extra_bits - nBits) + 8; + return PKDCL_OK; +} + +//----------------------------------------------------------------------------- +// Decodes next literal from the input (compressed) data. +// Returns : 0x000: One byte 0x00 +// 0x001: One byte 0x01 +// ... +// 0x0FF: One byte 0xFF +// 0x100: Repetition, length of 0x02 bytes +// 0x101: Repetition, length of 0x03 bytes +// ... +// 0x304: Repetition, length of 0x206 bytes +// 0x305: End of stream +// 0x306: Error + +static unsigned long DecodeLit(TDcmpStruct * pWork) +{ + unsigned long extra_length_bits; // Number of bits of extra literal length + unsigned long length_code; // Length code + unsigned long value; + + // Test the current bit in byte buffer. If is not set, simply return the next 8 bits. + if(pWork->bit_buff & 1) + { + // Remove one bit from the input data + if(WasteBits(pWork, 1)) + return 0x306; + + // The next 8 bits hold the index to the length code table + length_code = pWork->LengthCodes[pWork->bit_buff & 0xFF]; + + // Remove the apropriate number of bits + if(WasteBits(pWork, pWork->LenBits[length_code])) + return 0x306; + + // Are there some extra bits for the obtained length code ? + if((extra_length_bits = pWork->ExLenBits[length_code]) != 0) + { + unsigned long extra_length = pWork->bit_buff & ((1 << extra_length_bits) - 1); + + if(WasteBits(pWork, extra_length_bits)) + { + if((length_code + extra_length) != 0x10E) + return 0x306; + } + length_code = pWork->LenBase[length_code] + extra_length; + } + + // In order to distinguish uncompressed byte from repetition length, + // we have to add 0x100 to the length. + return length_code + 0x100; + } + + // Remove one bit from the input data + if(WasteBits(pWork, 1)) + return 0x306; + + // If the binary compression type, read 8 bits and return them as one byte. + if(pWork->ctype == CMP_BINARY) + { + unsigned long uncompressed_byte = pWork->bit_buff & 0xFF; + + if(WasteBits(pWork, 8)) + return 0x306; + return uncompressed_byte; + } + + // When ASCII compression ... + if(pWork->bit_buff & 0xFF) + { + value = pWork->offs2C34[pWork->bit_buff & 0xFF]; + + if(value == 0xFF) + { + if(pWork->bit_buff & 0x3F) + { + if(WasteBits(pWork, 4)) + return 0x306; + + value = pWork->offs2D34[pWork->bit_buff & 0xFF]; + } + else + { + if(WasteBits(pWork, 6)) + return 0x306; + + value = pWork->offs2E34[pWork->bit_buff & 0x7F]; + } + } + } + else + { + if(WasteBits(pWork, 8)) + return 0x306; + + value = pWork->offs2EB4[pWork->bit_buff & 0xFF]; + } + + return WasteBits(pWork, pWork->ChBitsAsc[value]) ? 0x306 : value; +} + +//----------------------------------------------------------------------------- +// Decodes the distance of the repetition, backwards relative to the +// current output buffer position + +static unsigned long DecodeDist(TDcmpStruct * pWork, unsigned long rep_length) +{ + unsigned long dist_pos_code; // Distance position code + unsigned long dist_pos_bits; // Number of bits of distance position + unsigned long distance; // Distance position + + // Next 2-8 bits in the input buffer is the distance position code + dist_pos_code = pWork->DistPosCodes[pWork->bit_buff & 0xFF]; + dist_pos_bits = pWork->DistBits[dist_pos_code]; + if(WasteBits(pWork, dist_pos_bits)) + return 0; + + if(rep_length == 2) + { + // If the repetition is only 2 bytes length, + // then take 2 bits from the stream in order to get the distance + distance = (dist_pos_code << 2) | (pWork->bit_buff & 0x03); + if(WasteBits(pWork, 2)) + return 0; + } + else + { + // If the repetition is more than 2 bytes length, + // then take "dsize_bits" bits in order to get the distance + distance = (dist_pos_code << pWork->dsize_bits) | (pWork->bit_buff & pWork->dsize_mask); + if(WasteBits(pWork, pWork->dsize_bits)) + return 0; + } + return distance + 1; +} + +static unsigned long Expand(TDcmpStruct * pWork) +{ + unsigned long next_literal; // Literal decoded from the compressed data + unsigned long result; // Value to be returned + unsigned int copyBytes; // Number of bytes to copy to the output buffer + + pWork->outputPos = 0x1000; // Initialize output buffer position + + // Decode the next literal from the input data. + // The returned literal can either be an uncompressed byte (next_literal < 0x100) + // or an encoded length of the repeating byte sequence that + // is to be copied to the current buffer position + while((result = next_literal = DecodeLit(pWork)) < 0x305) + { + // If the literal is greater than 0x100, it holds length + // of repeating byte sequence + // literal of 0x100 means repeating sequence of 0x2 bytes + // literal of 0x101 means repeating sequence of 0x3 bytes + // ... + // literal of 0x305 means repeating sequence of 0x207 bytes + if(next_literal >= 0x100) + { + unsigned char * source; + unsigned char * target; + unsigned long rep_length; // Length of the repetition, in bytes + unsigned long minus_dist; // Backward distance to the repetition, relative to the current buffer position + + // Get the length of the repeating sequence. + // Note that the repeating block may overlap the current output position, + // for example if there was a sequence of equal bytes + rep_length = next_literal - 0xFE; + + // Get backward distance to the repetition + if((minus_dist = DecodeDist(pWork, rep_length)) == 0) + { + result = 0x306; + break; + } + + // Target and source pointer + target = &pWork->out_buff[pWork->outputPos]; + source = target - minus_dist; + + // Update buffer output position + pWork->outputPos += rep_length; + + // Copy the repeating sequence + while(rep_length-- > 0) + *target++ = *source++; + } + else + { + pWork->out_buff[pWork->outputPos++] = (unsigned char)next_literal; + } + + // Flush the output buffer, if number of extracted bytes has reached the end + if(pWork->outputPos >= 0x2000) + { + // Copy decompressed data into user buffer + copyBytes = 0x1000; + pWork->write_buf((char *)&pWork->out_buff[0x1000], ©Bytes, pWork->param); + + // Now copy the decompressed data to the first half of the buffer. + // This is needed because the decompression might reuse them as repetitions. + // Note that if the output buffer overflowed previously, the extra decompressed bytes + // are stored in "out_buff_overflow", and they will now be + // within decompressed part of the output buffer. + memcpy(pWork->out_buff, &pWork->out_buff[0x1000], pWork->outputPos - 0x1000); + pWork->outputPos -= 0x1000; + } + } + + // Flush any remaining decompressed bytes + copyBytes = pWork->outputPos - 0x1000; + pWork->write_buf((char *)&pWork->out_buff[0x1000], ©Bytes, pWork->param); + return result; +} + + +//----------------------------------------------------------------------------- +// Main exploding function. + +unsigned int explode( + unsigned int (*read_buf)(char *buf, unsigned int *size, void *param), + void (*write_buf)(char *buf, unsigned int *size, void *param), + char *work_buf, + void *param) +{ + TDcmpStruct * pWork = (TDcmpStruct *)work_buf; + + // Initialize work struct and load compressed data + // Note: The caller must zero the "work_buff" before passing it to explode + pWork->read_buf = read_buf; + pWork->write_buf = write_buf; + pWork->param = param; + pWork->in_pos = sizeof(pWork->in_buff); + pWork->in_bytes = pWork->read_buf((char *)pWork->in_buff, &pWork->in_pos, pWork->param); + if(pWork->in_bytes <= 4) + return CMP_BAD_DATA; + + pWork->ctype = pWork->in_buff[0]; // Get the compression type (CMP_BINARY or CMP_ASCII) + pWork->dsize_bits = pWork->in_buff[1]; // Get the dictionary size + pWork->bit_buff = pWork->in_buff[2]; // Initialize 16-bit bit buffer + pWork->extra_bits = 0; // Extra (over 8) bits + pWork->in_pos = 3; // Position in input buffer + + // Test for the valid dictionary size + if(4 > pWork->dsize_bits || pWork->dsize_bits > 6) + return CMP_INVALID_DICTSIZE; + + pWork->dsize_mask = 0xFFFF >> (0x10 - pWork->dsize_bits); // Shifted by 'sar' instruction + + if(pWork->ctype != CMP_BINARY) + { + if(pWork->ctype != CMP_ASCII) + return CMP_INVALID_MODE; + + memcpy(pWork->ChBitsAsc, ChBitsAsc, sizeof(pWork->ChBitsAsc)); + GenAscTabs(pWork); + } + + memcpy(pWork->LenBits, LenBits, sizeof(pWork->LenBits)); + GenDecodeTabs(pWork->LengthCodes, LenCode, pWork->LenBits, sizeof(pWork->LenBits)); + memcpy(pWork->ExLenBits, ExLenBits, sizeof(pWork->ExLenBits)); + memcpy(pWork->LenBase, LenBase, sizeof(pWork->LenBase)); + memcpy(pWork->DistBits, DistBits, sizeof(pWork->DistBits)); + GenDecodeTabs(pWork->DistPosCodes, DistCode, pWork->DistBits, sizeof(pWork->DistBits)); + if(Expand(pWork) != 0x306) + return CMP_NO_ERROR; + + return CMP_ABORT; +} diff --git a/dep/StormLib/src/pklib/implode.c b/dep/StormLib/src/pklib/implode.c new file mode 100644 index 00000000000..1771b1862a0 --- /dev/null +++ b/dep/StormLib/src/pklib/implode.c @@ -0,0 +1,769 @@ +/*****************************************************************************/ +/* implode.c Copyright (c) Ladislav Zezula 2003 */ +/*---------------------------------------------------------------------------*/ +/* Implode function of PKWARE Data Compression library */ +/*---------------------------------------------------------------------------*/ +/* Date Ver Who Comment */ +/* -------- ---- --- ------- */ +/* 11.04.03 1.00 Lad First version of implode.c */ +/* 02.05.03 1.00 Lad Stress test done */ +/* 22.04.10 1.01 Lad Documented */ +/*****************************************************************************/ + +#include +#include + +#include "pklib.h" + +#if ((1200 < _MSC_VER) && (_MSC_VER < 1400)) +#pragma optimize("", off) // Fucking Microsoft VS.NET 2003 compiler !!! (_MSC_VER=1310) +#endif + +//----------------------------------------------------------------------------- +// Defines + +#define MAX_REP_LENGTH 0x204 // The longest allowed repetition + +//----------------------------------------------------------------------------- +// Tables + +static unsigned char DistBits[] = +{ + 0x02, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, + 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 +}; + +static unsigned char DistCode[] = +{ + 0x03, 0x0D, 0x05, 0x19, 0x09, 0x11, 0x01, 0x3E, 0x1E, 0x2E, 0x0E, 0x36, 0x16, 0x26, 0x06, 0x3A, + 0x1A, 0x2A, 0x0A, 0x32, 0x12, 0x22, 0x42, 0x02, 0x7C, 0x3C, 0x5C, 0x1C, 0x6C, 0x2C, 0x4C, 0x0C, + 0x74, 0x34, 0x54, 0x14, 0x64, 0x24, 0x44, 0x04, 0x78, 0x38, 0x58, 0x18, 0x68, 0x28, 0x48, 0x08, + 0xF0, 0x70, 0xB0, 0x30, 0xD0, 0x50, 0x90, 0x10, 0xE0, 0x60, 0xA0, 0x20, 0xC0, 0x40, 0x80, 0x00 +}; + +static unsigned char ExLenBits[] = +{ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 +}; + +static unsigned char LenBits[] = +{ + 0x03, 0x02, 0x03, 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, 0x06, 0x07, 0x07 +}; + +static unsigned char LenCode[] = +{ + 0x05, 0x03, 0x01, 0x06, 0x0A, 0x02, 0x0C, 0x14, 0x04, 0x18, 0x08, 0x30, 0x10, 0x20, 0x40, 0x00 +}; + +static unsigned char ChBitsAsc[] = +{ + 0x0B, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x08, 0x07, 0x0C, 0x0C, 0x07, 0x0C, 0x0C, + 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0D, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, + 0x04, 0x0A, 0x08, 0x0C, 0x0A, 0x0C, 0x0A, 0x08, 0x07, 0x07, 0x08, 0x09, 0x07, 0x06, 0x07, 0x08, + 0x07, 0x06, 0x07, 0x07, 0x07, 0x07, 0x08, 0x07, 0x07, 0x08, 0x08, 0x0C, 0x0B, 0x07, 0x09, 0x0B, + 0x0C, 0x06, 0x07, 0x06, 0x06, 0x05, 0x07, 0x08, 0x08, 0x06, 0x0B, 0x09, 0x06, 0x07, 0x06, 0x06, + 0x07, 0x0B, 0x06, 0x06, 0x06, 0x07, 0x09, 0x08, 0x09, 0x09, 0x0B, 0x08, 0x0B, 0x09, 0x0C, 0x08, + 0x0C, 0x05, 0x06, 0x06, 0x06, 0x05, 0x06, 0x06, 0x06, 0x05, 0x0B, 0x07, 0x05, 0x06, 0x05, 0x05, + 0x06, 0x0A, 0x05, 0x05, 0x05, 0x05, 0x08, 0x07, 0x08, 0x08, 0x0A, 0x0B, 0x0B, 0x0C, 0x0C, 0x0C, + 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, + 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, + 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, + 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, + 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, + 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, + 0x0D, 0x0C, 0x0D, 0x0D, 0x0D, 0x0C, 0x0D, 0x0D, 0x0D, 0x0C, 0x0D, 0x0D, 0x0D, 0x0D, 0x0C, 0x0D, + 0x0D, 0x0D, 0x0C, 0x0C, 0x0C, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D +}; + +static unsigned short ChCodeAsc[] = +{ + 0x0490, 0x0FE0, 0x07E0, 0x0BE0, 0x03E0, 0x0DE0, 0x05E0, 0x09E0, + 0x01E0, 0x00B8, 0x0062, 0x0EE0, 0x06E0, 0x0022, 0x0AE0, 0x02E0, + 0x0CE0, 0x04E0, 0x08E0, 0x00E0, 0x0F60, 0x0760, 0x0B60, 0x0360, + 0x0D60, 0x0560, 0x1240, 0x0960, 0x0160, 0x0E60, 0x0660, 0x0A60, + 0x000F, 0x0250, 0x0038, 0x0260, 0x0050, 0x0C60, 0x0390, 0x00D8, + 0x0042, 0x0002, 0x0058, 0x01B0, 0x007C, 0x0029, 0x003C, 0x0098, + 0x005C, 0x0009, 0x001C, 0x006C, 0x002C, 0x004C, 0x0018, 0x000C, + 0x0074, 0x00E8, 0x0068, 0x0460, 0x0090, 0x0034, 0x00B0, 0x0710, + 0x0860, 0x0031, 0x0054, 0x0011, 0x0021, 0x0017, 0x0014, 0x00A8, + 0x0028, 0x0001, 0x0310, 0x0130, 0x003E, 0x0064, 0x001E, 0x002E, + 0x0024, 0x0510, 0x000E, 0x0036, 0x0016, 0x0044, 0x0030, 0x00C8, + 0x01D0, 0x00D0, 0x0110, 0x0048, 0x0610, 0x0150, 0x0060, 0x0088, + 0x0FA0, 0x0007, 0x0026, 0x0006, 0x003A, 0x001B, 0x001A, 0x002A, + 0x000A, 0x000B, 0x0210, 0x0004, 0x0013, 0x0032, 0x0003, 0x001D, + 0x0012, 0x0190, 0x000D, 0x0015, 0x0005, 0x0019, 0x0008, 0x0078, + 0x00F0, 0x0070, 0x0290, 0x0410, 0x0010, 0x07A0, 0x0BA0, 0x03A0, + 0x0240, 0x1C40, 0x0C40, 0x1440, 0x0440, 0x1840, 0x0840, 0x1040, + 0x0040, 0x1F80, 0x0F80, 0x1780, 0x0780, 0x1B80, 0x0B80, 0x1380, + 0x0380, 0x1D80, 0x0D80, 0x1580, 0x0580, 0x1980, 0x0980, 0x1180, + 0x0180, 0x1E80, 0x0E80, 0x1680, 0x0680, 0x1A80, 0x0A80, 0x1280, + 0x0280, 0x1C80, 0x0C80, 0x1480, 0x0480, 0x1880, 0x0880, 0x1080, + 0x0080, 0x1F00, 0x0F00, 0x1700, 0x0700, 0x1B00, 0x0B00, 0x1300, + 0x0DA0, 0x05A0, 0x09A0, 0x01A0, 0x0EA0, 0x06A0, 0x0AA0, 0x02A0, + 0x0CA0, 0x04A0, 0x08A0, 0x00A0, 0x0F20, 0x0720, 0x0B20, 0x0320, + 0x0D20, 0x0520, 0x0920, 0x0120, 0x0E20, 0x0620, 0x0A20, 0x0220, + 0x0C20, 0x0420, 0x0820, 0x0020, 0x0FC0, 0x07C0, 0x0BC0, 0x03C0, + 0x0DC0, 0x05C0, 0x09C0, 0x01C0, 0x0EC0, 0x06C0, 0x0AC0, 0x02C0, + 0x0CC0, 0x04C0, 0x08C0, 0x00C0, 0x0F40, 0x0740, 0x0B40, 0x0340, + 0x0300, 0x0D40, 0x1D00, 0x0D00, 0x1500, 0x0540, 0x0500, 0x1900, + 0x0900, 0x0940, 0x1100, 0x0100, 0x1E00, 0x0E00, 0x0140, 0x1600, + 0x0600, 0x1A00, 0x0E40, 0x0640, 0x0A40, 0x0A00, 0x1200, 0x0200, + 0x1C00, 0x0C00, 0x1400, 0x0400, 0x1800, 0x0800, 0x1000, 0x0000 +}; + +//----------------------------------------------------------------------------- +// Macros + +// Macro for calculating hash of the current byte pair. +// Note that most exact byte pair hash would be buffer[0] + buffer[1] << 0x08, +// but even this way gives nice indication of equal byte pairs, with significantly +// smaller size of the array that holds numbers of those hashes +#define BYTE_PAIR_HASH(buffer) ((buffer[0] * 4) + (buffer[1] * 5)) + +//----------------------------------------------------------------------------- +// Local functions + +// Builds the "hash_to_index" table and "pair_hash_offsets" table. +// Every element of "hash_to_index" will contain lowest index to the +// "pair_hash_offsets" table, effectively giving offset of the first +// occurence of the given PAIR_HASH in the input data. +static void SortBuffer(TCmpStruct * pWork, unsigned char * buffer_begin, unsigned char * buffer_end) +{ + unsigned short * phash_to_index; + unsigned char * buffer_ptr; + unsigned short total_sum = 0; + unsigned long byte_pair_hash; // Hash value of the byte pair + unsigned short byte_pair_offs; // Offset of the byte pair, relative to "work_buff" + + // Zero the entire "phash_to_index" table + memset(pWork->phash_to_index, 0, sizeof(pWork->phash_to_index)); + + // Step 1: Count amount of each PAIR_HASH in the input buffer + // The table will look like this: + // offs 0x000: Number of occurences of PAIR_HASH 0 + // offs 0x001: Number of occurences of PAIR_HASH 1 + // ... + // offs 0x8F7: Number of occurences of PAIR_HASH 0x8F7 (the highest hash value) + for(buffer_ptr = buffer_begin; buffer_ptr < buffer_end; buffer_ptr++) + pWork->phash_to_index[BYTE_PAIR_HASH(buffer_ptr)]++; + + // Step 2: Convert the table to the array of PAIR_HASH amounts. + // Each element contains count of PAIR_HASHes that is less or equal + // to element index + // The table will look like this: + // offs 0x000: Number of occurences of PAIR_HASH 0 or lower + // offs 0x001: Number of occurences of PAIR_HASH 1 or lower + // ... + // offs 0x8F7: Number of occurences of PAIR_HASH 0x8F7 or lower + for(phash_to_index = pWork->phash_to_index; phash_to_index < &pWork->phash_to_index_end; phash_to_index++) + { + total_sum = total_sum + phash_to_index[0]; + phash_to_index[0] = total_sum; + } + + // Step 3: Convert the table to the array of indexes. + // Now, each element contains index to the first occurence of given PAIR_HASH + for(buffer_end--; buffer_end >= buffer_begin; buffer_end--) + { + byte_pair_hash = BYTE_PAIR_HASH(buffer_end); + byte_pair_offs = (unsigned short)(buffer_end - pWork->work_buff); + + pWork->phash_to_index[byte_pair_hash]--; + pWork->phash_offs[pWork->phash_to_index[byte_pair_hash]] = byte_pair_offs; + } +} + +static void FlushBuf(TCmpStruct * pWork) +{ + unsigned char save_ch1; + unsigned char save_ch2; + unsigned int size = 0x800; + + pWork->write_buf(pWork->out_buff, &size, pWork->param); + + save_ch1 = pWork->out_buff[0x800]; + save_ch2 = pWork->out_buff[pWork->out_bytes]; + pWork->out_bytes -= 0x800; + + memset(pWork->out_buff, 0, sizeof(pWork->out_buff)); + + if(pWork->out_bytes != 0) + pWork->out_buff[0] = save_ch1; + if(pWork->out_bits != 0) + pWork->out_buff[pWork->out_bytes] = save_ch2; +} + +static void OutputBits(TCmpStruct * pWork, unsigned int nbits, unsigned long bit_buff) +{ + unsigned int out_bits; + + // If more than 8 bits to output, do recursion + if(nbits > 8) + { + OutputBits(pWork, 8, bit_buff); + bit_buff >>= 8; + nbits -= 8; + } + + // Add bits to the last out byte in out_buff; + out_bits = pWork->out_bits; + pWork->out_buff[pWork->out_bytes] |= (unsigned char)(bit_buff << out_bits); + pWork->out_bits += nbits; + + // If 8 or more bits, increment number of bytes + if(pWork->out_bits > 8) + { + pWork->out_bytes++; + bit_buff >>= (8 - out_bits); + + pWork->out_buff[pWork->out_bytes] = (unsigned char)bit_buff; + pWork->out_bits &= 7; + } + else + { + pWork->out_bits &= 7; + if(pWork->out_bits == 0) + pWork->out_bytes++; + } + + // If there is enough compressed bytes, flush them + if(pWork->out_bytes >= 0x800) + FlushBuf(pWork); +} + +// This function searches for a repetition +// (a previous occurence of the current byte sequence) +// Returns length of the repetition, and stores the backward distance +// to pWork structure. +static unsigned int FindRep(TCmpStruct * pWork, unsigned char * input_data) +{ + unsigned short * phash_to_index; // Pointer into pWork->phash_to_index table + unsigned short * phash_offs; // Pointer to the table containing offsets of each PAIR_HASH + unsigned char * repetition_limit; // An eventual repetition must be at position below this pointer + unsigned char * prev_repetition; // Pointer to the previous occurence of the current PAIR_HASH + unsigned char * prev_rep_end; // End of the previous repetition + unsigned char * input_data_ptr; + unsigned short phash_offs_index; // Index to the table with PAIR_HASH positions + unsigned short min_phash_offs; // The lowest allowed hash offset + unsigned short offs_in_rep; // Offset within found repetition + unsigned int equal_byte_count; // Number of bytes that are equal to the previous occurence + unsigned int rep_length = 1; // Length of the found repetition + unsigned int rep_length2; // Secondary repetition + unsigned char pre_last_byte; // Last but one byte from a repetion + unsigned short di_val; + + // Calculate the previous position of the PAIR_HASH + phash_to_index = pWork->phash_to_index + BYTE_PAIR_HASH(input_data); + min_phash_offs = (unsigned short)((input_data - pWork->work_buff) - pWork->dsize_bytes + 1); + phash_offs_index = phash_to_index[0]; + + // If the PAIR_HASH offset is below the limit, find a next one + phash_offs = pWork->phash_offs + phash_offs_index; + if(*phash_offs < min_phash_offs) + { + while(*phash_offs < min_phash_offs) + { + phash_offs_index++; + phash_offs++; + } + *phash_to_index = phash_offs_index; + } + + // Get the first location of the PAIR_HASH, + // and thus the first eventual location of byte repetition + phash_offs = pWork->phash_offs + phash_offs_index; + prev_repetition = pWork->work_buff + phash_offs[0]; + repetition_limit = input_data - 1; + + // If the current PAIR_HASH was not encountered before, + // we haven't found a repetition. + if(prev_repetition >= repetition_limit) + return 0; + + // We have found a match of a PAIR_HASH. Now we have to make sure + // that it is also a byte match, because PAIR_HASH is not unique. + // We compare the bytes and count the length of the repetition + input_data_ptr = input_data; + for(;;) + { + // If the first byte of the repetition and the so-far-last byte + // of the repetition are equal, we will compare the blocks. + if(*input_data_ptr == *prev_repetition && input_data_ptr[rep_length-1] == prev_repetition[rep_length-1]) + { + // Skip the current byte + prev_repetition++; + input_data_ptr++; + equal_byte_count = 2; + + // Now count how many more bytes are equal + while(equal_byte_count < MAX_REP_LENGTH) + { + prev_repetition++; + input_data_ptr++; + + // Are the bytes different ? + if(*prev_repetition != *input_data_ptr) + break; + + equal_byte_count++; + } + + // If we found a repetition of at least the same length, take it. + // If there are multiple repetitions in the input buffer, this will + // make sure that we find the most recent one, which in turn allows + // us to store backward length in less amount of bits + input_data_ptr = input_data; + if(equal_byte_count >= rep_length) + { + // Calculate the backward distance of the repetition. + // Note that the distance is stored as decremented by 1 + pWork->distance = (unsigned int)(input_data - prev_repetition + equal_byte_count - 1); + + // Repetitions longer than 10 bytes will be stored in more bits, + // so they need a bit different handling + if((rep_length = equal_byte_count) > 10) + break; + } + } + + // Move forward in the table of PAIR_HASH repetitions. + // There might be a more recent occurence of the same repetition. + phash_offs_index++; + phash_offs++; + prev_repetition = pWork->work_buff + phash_offs[0]; + + // If the next repetition is beyond the minimum allowed repetition, we are done. + if(prev_repetition >= repetition_limit) + { + // A repetition must have at least 2 bytes, otherwise it's not worth it + return (rep_length >= 2) ? rep_length : 0; + } + } + + // If the repetition has max length of 0x204 bytes, we can't go any fuhrter + if(equal_byte_count == MAX_REP_LENGTH) + { + pWork->distance--; + return equal_byte_count; + } + + // Check for possibility of a repetition that occurs at more recent position + phash_offs = pWork->phash_offs + phash_offs_index; + if(pWork->work_buff + phash_offs[1] >= repetition_limit) + return rep_length; + + // + // The following part checks if there isn't a longer repetition at + // a latter offset, that would lead to better compression. + // + // Example of data that can trigger this optimization: + // + // "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEQQQQQQQQQQQQ" + // "XYZ" + // "EEEEEEEEEEEEEEEEQQQQQQQQQQQQ"; + // + // Description of data in this buffer + // [0x00] Single byte "E" + // [0x01] Single byte "E" + // [0x02] Repeat 0x1E bytes from [0x00] + // [0x20] Single byte "X" + // [0x21] Single byte "Y" + // [0x22] Single byte "Z" + // [0x23] 17 possible previous repetitions of length at least 0x10 bytes: + // - Repetition of 0x10 bytes from [0x00] "EEEEEEEEEEEEEEEE" + // - Repetition of 0x10 bytes from [0x01] "EEEEEEEEEEEEEEEE" + // - Repetition of 0x10 bytes from [0x02] "EEEEEEEEEEEEEEEE" + // ... + // - Repetition of 0x10 bytes from [0x0F] "EEEEEEEEEEEEEEEE" + // - Repetition of 0x1C bytes from [0x10] "EEEEEEEEEEEEEEEEQQQQQQQQQQQQ" + // The last repetition is the best one. + // + + pWork->offs09BC[0] = 0xFFFF; + pWork->offs09BC[1] = 0x0000; + di_val = 0; + + // Note: I failed to figure out what does the table "offs09BC" mean. + // If anyone has an idea, let me know to zezula_at_volny_dot_cz + for(offs_in_rep = 1; offs_in_rep < rep_length; ) + { + if(input_data[offs_in_rep] != input_data[di_val]) + { + di_val = pWork->offs09BC[di_val]; + if(di_val != 0xFFFF) + continue; + } + pWork->offs09BC[++offs_in_rep] = ++di_val; + } + + // + // Now go through all the repetitions from the first found one + // to the current input data, and check if any of them migh be + // a start of a greater sequence match. + // + + prev_repetition = pWork->work_buff + phash_offs[0]; + prev_rep_end = prev_repetition + rep_length; + rep_length2 = rep_length; + + for(;;) + { + rep_length2 = pWork->offs09BC[rep_length2]; + if(rep_length2 == 0xFFFF) + rep_length2 = 0; + + // Get the pointer to the previous repetition + phash_offs = pWork->phash_offs + phash_offs_index; + + // Skip those repetitions that don't reach the end + // of the first found repetition + do + { + phash_offs++; + phash_offs_index++; + prev_repetition = pWork->work_buff + *phash_offs; + if(prev_repetition >= repetition_limit) + return rep_length; + } + while(prev_repetition + rep_length2 < prev_rep_end); + + // Verify if the last but one byte from the repetition matches + // the last but one byte from the input data. + // If not, find a next repetition + pre_last_byte = input_data[rep_length - 2]; + if(pre_last_byte == prev_repetition[rep_length - 2]) + { + // If the new repetition reaches beyond the end + // of previously found repetition, reset the repetition length to zero. + if(prev_repetition + rep_length2 != prev_rep_end) + { + prev_rep_end = prev_repetition; + rep_length2 = 0; + } + } + else + { + phash_offs = pWork->phash_offs + phash_offs_index; + do + { + phash_offs++; + phash_offs_index++; + prev_repetition = pWork->work_buff + *phash_offs; + if(prev_repetition >= repetition_limit) + return rep_length; + } + while(prev_repetition[rep_length - 2] != pre_last_byte || prev_repetition[0] != input_data[0]); + + // Reset the length of the repetition to 2 bytes only + prev_rep_end = prev_repetition + 2; + rep_length2 = 2; + } + + // Find out how many more characters are equal to the first repetition. + while(*prev_rep_end == input_data[rep_length2]) + { + if(++rep_length2 >= 0x204) + break; + prev_rep_end++; + } + + // Is the newly found repetion at least as long as the previous one ? + if(rep_length2 >= rep_length) + { + // Calculate the distance of the new repetition + pWork->distance = (unsigned int)(input_data - prev_repetition - 1); + if((rep_length = rep_length2) == 0x204) + return rep_length; + + // Update the additional elements in the "offs09BC" table + // to reflect new rep length + while(offs_in_rep < rep_length2) + { + if(input_data[offs_in_rep] != input_data[di_val]) + { + di_val = pWork->offs09BC[di_val]; + if(di_val != 0xFFFF) + continue; + } + pWork->offs09BC[++offs_in_rep] = ++di_val; + } + } + } +} + +static void WriteCmpData(TCmpStruct * pWork) +{ + unsigned char * input_data_end; // Pointer to the end of the input data + unsigned char * input_data = pWork->work_buff + pWork->dsize_bytes + 0x204; + unsigned int input_data_ended = 0; // If 1, then all data from the input stream have been already loaded + unsigned int save_rep_length; // Saved length of current repetition + unsigned int save_distance = 0; // Saved distance of current repetition + unsigned int rep_length; // Length of the found repetition + unsigned int phase = 0; // + + // Store the compression type and dictionary size + pWork->out_buff[0] = (char)pWork->ctype; + pWork->out_buff[1] = (char)pWork->dsize_bits; + pWork->out_bytes = 2; + + // Reset output buffer to zero + memset(&pWork->out_buff[2], 0, sizeof(pWork->out_buff) - 2); + pWork->out_bits = 0; + + while(input_data_ended == 0) + { + unsigned int bytes_to_load = 0x1000; + int total_loaded = 0; + int bytes_loaded; + + // Load the bytes from the input stream, up to 0x1000 bytes + while(bytes_to_load != 0) + { + bytes_loaded = pWork->read_buf((char *)pWork->work_buff + pWork->dsize_bytes + 0x204 + total_loaded, + &bytes_to_load, + pWork->param); + if(bytes_loaded == 0) + { + if(total_loaded == 0 && phase == 0) + goto __Exit; + input_data_ended = 1; + break; + } + else + { + bytes_to_load -= bytes_loaded; + total_loaded += bytes_loaded; + } + } + + input_data_end = pWork->work_buff + pWork->dsize_bytes + total_loaded; + if(input_data_ended) + input_data_end += 0x204; + + // + // Warning: The end of the buffer passed to "SortBuffer" is actually 2 bytes beyond + // valid data. It is questionable if this is actually a bug or not, + // but it might cause the compressed data output to be dependent on random bytes + // that are in the buffer. + // To prevent that, the calling application must always zero the compression + // buffer before passing it to "implode" + // + + // Search the PAIR_HASHes of the loaded blocks. Also, include + // previously compressed data, if any. + switch(phase) + { + case 0: + SortBuffer(pWork, input_data, input_data_end + 1); + phase++; + if(pWork->dsize_bytes != 0x1000) + phase++; + break; + + case 1: + SortBuffer(pWork, input_data - pWork->dsize_bytes + 0x204, input_data_end + 1); + phase++; + break; + + default: + SortBuffer(pWork, input_data - pWork->dsize_bytes, input_data_end + 1); + break; + } + + // Perform the compression of the current block + while(input_data < input_data_end) + { + // Find if the current byte sequence wasn't there before. + rep_length = FindRep(pWork, input_data); + while(rep_length != 0) + { + // If we found repetition of 2 bytes, that is 0x100 or fuhrter back, + // don't bother. Storing the distance of 0x100 bytes would actually + // take more space than storing the 2 bytes as-is. + if(rep_length == 2 && pWork->distance >= 0x100) + break; + + // When we are at the end of the input data, we cannot allow + // the repetition to go past the end of the input data. + if(input_data_ended && input_data + rep_length > input_data_end) + { + // Shorten the repetition length so that it only covers valid data + rep_length = (unsigned long)(input_data_end - input_data); + if(rep_length < 2) + break; + + // If we got repetition of 2 bytes, that is 0x100 or more backward, don't bother + if(rep_length == 2 && pWork->distance >= 0x100) + break; + goto __FlushRepetition; + } + + if(rep_length >= 8 || input_data + 1 >= input_data_end) + goto __FlushRepetition; + + // Try to find better repetition 1 byte later. + // Example: "ARROCKFORT" "AROCKFORT" + // When "input_data" points to the second string, FindRep + // returns the occurence of "AR". But there is longer repetition "ROCKFORT", + // beginning 1 byte after. + save_rep_length = rep_length; + save_distance = pWork->distance; + rep_length = FindRep(pWork, input_data + 1); + + // Only use the new repetition if it's length is greater than the previous one + if(rep_length > save_rep_length) + { + // If the new repetition if only 1 byte better + // and the previous distance is less than 0x80 bytes, use the previous repetition + if(rep_length > save_rep_length + 1 || save_distance > 0x80) + { + // Flush one byte, so that input_data will point to the secondary repetition + OutputBits(pWork, pWork->nChBits[*input_data], pWork->nChCodes[*input_data]); + input_data++; + continue; + } + } + + // Revert to the previous repetition + rep_length = save_rep_length; + pWork->distance = save_distance; + + __FlushRepetition: + + OutputBits(pWork, pWork->nChBits[rep_length + 0xFE], pWork->nChCodes[rep_length + 0xFE]); + if(rep_length == 2) + { + OutputBits(pWork, pWork->dist_bits[pWork->distance >> 2], + pWork->dist_codes[pWork->distance >> 2]); + OutputBits(pWork, 2, pWork->distance & 3); + } + else + { + OutputBits(pWork, pWork->dist_bits[pWork->distance >> pWork->dsize_bits], + pWork->dist_codes[pWork->distance >> pWork->dsize_bits]); + OutputBits(pWork, pWork->dsize_bits, pWork->dsize_mask & pWork->distance); + } + + // Move the begin of the input data by the length of the repetition + input_data += rep_length; + goto _00402252; + } + + // If there was no previous repetition for the current position in the input data, + // just output the 9-bit literal for the one character + OutputBits(pWork, pWork->nChBits[*input_data], pWork->nChCodes[*input_data]); + input_data++; +_00402252:; + } + + if(input_data_ended == 0) + { + input_data -= 0x1000; + memcpy(pWork->work_buff, pWork->work_buff + 0x1000, pWork->dsize_bytes + 0x204); + } + } + +__Exit: + + // Write the termination literal + OutputBits(pWork, pWork->nChBits[0x305], pWork->nChCodes[0x305]); + if(pWork->out_bits != 0) + pWork->out_bytes++; + pWork->write_buf(pWork->out_buff, &pWork->out_bytes, pWork->param); + return; +} + +//----------------------------------------------------------------------------- +// Main imploding function + +unsigned int PKEXPORT implode( + unsigned int (*read_buf)(char *buf, unsigned int *size, void *param), + void (*write_buf)(char *buf, unsigned int *size, void *param), + char *work_buf, + void *param, + unsigned int *type, + unsigned int *dsize) +{ + TCmpStruct * pWork = (TCmpStruct *)work_buf; + unsigned int nChCode; + unsigned int nCount; + unsigned int i; + int nCount2; + + // Fill the work buffer information + // Note: The caller must zero the "work_buff" before passing it to implode + pWork->read_buf = read_buf; + pWork->write_buf = write_buf; + pWork->dsize_bytes = *dsize; + pWork->ctype = *type; + pWork->param = param; + pWork->dsize_bits = 4; + pWork->dsize_mask = 0x0F; + + // Test dictionary size + switch(*dsize) + { + case CMP_IMPLODE_DICT_SIZE3: // 0x1000 bytes + pWork->dsize_bits++; + pWork->dsize_mask |= 0x20; + // No break here !!! + + case CMP_IMPLODE_DICT_SIZE2: // 0x800 bytes + pWork->dsize_bits++; + pWork->dsize_mask |= 0x10; + // No break here !!! + + case CMP_IMPLODE_DICT_SIZE1: // 0x400 + break; + + default: + return CMP_INVALID_DICTSIZE; + } + + // Test the compression type + switch(*type) + { + case CMP_BINARY: // We will compress data with binary compression type + for(nChCode = 0, nCount = 0; nCount < 0x100; nCount++) + { + pWork->nChBits[nCount] = 9; + pWork->nChCodes[nCount] = (unsigned short)nChCode; + nChCode = (nChCode & 0x0000FFFF) + 2; + } + break; + + + case CMP_ASCII: // We will compress data with ASCII compression type + for(nCount = 0; nCount < 0x100; nCount++) + { + pWork->nChBits[nCount] = (unsigned char )(ChBitsAsc[nCount] + 1); + pWork->nChCodes[nCount] = (unsigned short)(ChCodeAsc[nCount] * 2); + } + break; + + default: + return CMP_INVALID_MODE; + } + + for(i = 0; i < 0x10; i++) + { + if(1 << ExLenBits[i]) + { + for(nCount2 = 0; nCount2 < (1 << ExLenBits[i]); nCount2++) + { + pWork->nChBits[nCount] = (unsigned char)(ExLenBits[i] + LenBits[i] + 1); + pWork->nChCodes[nCount] = (unsigned short)((nCount2 << (LenBits[i] + 1)) | ((LenCode[i] & 0xFFFF00FF) * 2) | 1); + nCount++; + } + } + } + + // Copy the distance codes and distance bits and perform the compression + memcpy(&pWork->dist_codes, DistCode, sizeof(DistCode)); + memcpy(&pWork->dist_bits, DistBits, sizeof(DistBits)); + WriteCmpData(pWork); + return CMP_NO_ERROR; +} diff --git a/dep/StormLib/src/pklib/pklib.h b/dep/StormLib/src/pklib/pklib.h new file mode 100644 index 00000000000..f43da153be6 --- /dev/null +++ b/dep/StormLib/src/pklib/pklib.h @@ -0,0 +1,148 @@ +/*****************************************************************************/ +/* pklib.h Copyright (c) Ladislav Zezula 2003 */ +/*---------------------------------------------------------------------------*/ +/* Header file for PKWARE Data Compression Library */ +/*---------------------------------------------------------------------------*/ +/* Date Ver Who Comment */ +/* -------- ---- --- ------- */ +/* 31.03.03 1.00 Lad The first version of pkware.h */ +/*****************************************************************************/ + +#ifndef __PKLIB_H__ +#define __PKLIB_H__ + +#include "../StormPort.h" + +//----------------------------------------------------------------------------- +// Defines + +#define CMP_BINARY 0 // Binary compression +#define CMP_ASCII 1 // Ascii compression + +#define CMP_NO_ERROR 0 +#define CMP_INVALID_DICTSIZE 1 +#define CMP_INVALID_MODE 2 +#define CMP_BAD_DATA 3 +#define CMP_ABORT 4 + +#define CMP_IMPLODE_DICT_SIZE1 1024 // Dictionary size of 1024 +#define CMP_IMPLODE_DICT_SIZE2 2048 // Dictionary size of 2048 +#define CMP_IMPLODE_DICT_SIZE3 4096 // Dictionary size of 4096 + +//----------------------------------------------------------------------------- +// Define calling convention + +#ifndef PKEXPORT +#ifdef WIN32 +#define PKEXPORT __cdecl // Use for normal __cdecl calling +#else +#define PKEXPORT +#endif +#endif + +//----------------------------------------------------------------------------- +// Internal structures + +// Compression structure +typedef struct +{ + unsigned int distance; // 0000: Backward distance of the currently found repetition, decreased by 1 + unsigned int out_bytes; // 0004: # bytes available in out_buff + unsigned int out_bits; // 0008: # of bits available in the last out byte + unsigned int dsize_bits; // 000C: Number of bits needed for dictionary size. 4 = 0x400, 5 = 0x800, 6 = 0x1000 + unsigned int dsize_mask; // 0010: Bit mask for dictionary. 0x0F = 0x400, 0x1F = 0x800, 0x3F = 0x1000 + unsigned int ctype; // 0014: Compression type (CMP_ASCII or CMP_BINARY) + unsigned int dsize_bytes; // 0018: Dictionary size in bytes + unsigned char dist_bits[0x40]; // 001C: Distance bits + unsigned char dist_codes[0x40]; // 005C: Distance codes + unsigned char nChBits[0x306]; // 009C: Table of literal bit lengths to be put to the output stream + unsigned short nChCodes[0x306]; // 03A2: Table of literal codes to be put to the output stream + unsigned short offs09AE; // 09AE: + + void * param; // 09B0: User parameter + unsigned int (*read_buf)(char *buf, unsigned int *size, void *param); // 9B4 + void (*write_buf)(char *buf, unsigned int *size, void *param); // 9B8 + + unsigned short offs09BC[0x204]; // 09BC: + unsigned long offs0DC4; // 0DC4: + unsigned short phash_to_index[0x900]; // 0DC8: Array of indexes (one for each PAIR_HASH) to the "pair_hash_offsets" table + unsigned short phash_to_index_end; // 1FC8: End marker for "phash_to_index" table + char out_buff[0x802]; // 1FCA: Compressed data + unsigned char work_buff[0x2204]; // 27CC: Work buffer + // + DICT_OFFSET => Dictionary + // + UNCMP_OFFSET => Uncompressed data + unsigned short phash_offs[0x2204]; // 49D0: Table of offsets for each PAIR_HASH +} TCmpStruct; + +#define CMP_BUFFER_SIZE sizeof(TCmpStruct) // Size of compression structure. + // Defined as 36312 in pkware header file + + +// Decompression structure +typedef struct +{ + unsigned long offs0000; // 0000 + unsigned long ctype; // 0004: Compression type (CMP_BINARY or CMP_ASCII) + unsigned long outputPos; // 0008: Position in output buffer + unsigned long dsize_bits; // 000C: Dict size (4, 5, 6 for 0x400, 0x800, 0x1000) + unsigned long dsize_mask; // 0010: Dict size bitmask (0x0F, 0x1F, 0x3F for 0x400, 0x800, 0x1000) + unsigned long bit_buff; // 0014: 16-bit buffer for processing input data + unsigned long extra_bits; // 0018: Number of extra (above 8) bits in bit buffer + unsigned int in_pos; // 001C: Position in in_buff + unsigned long in_bytes; // 0020: Number of bytes in input buffer + void * param; // 0024: Custom parameter + unsigned int (*read_buf)(char *buf, unsigned int *size, void *param); // Pointer to function that reads data from the input stream + void (*write_buf)(char *buf, unsigned int *size, void *param);// Pointer to function that writes data to the output stream + + unsigned char out_buff[0x2204]; // 0030: Output circle buffer. + // 0x0000 - 0x0FFF: Previous uncompressed data, kept for repetitions + // 0x1000 - 0x1FFF: Currently decompressed data + // 0x2000 - 0x2203: Reserve space for the longest possible repetition + unsigned char in_buff[0x800]; // 2234: Buffer for data to be decompressed + unsigned char DistPosCodes[0x100]; // 2A34: Table of distance position codes + unsigned char LengthCodes[0x100]; // 2B34: Table of length codes + unsigned char offs2C34[0x100]; // 2C34: Buffer for + unsigned char offs2D34[0x100]; // 2D34: Buffer for + unsigned char offs2E34[0x80]; // 2EB4: Buffer for + unsigned char offs2EB4[0x100]; // 2EB4: Buffer for + unsigned char ChBitsAsc[0x100]; // 2FB4: Buffer for + unsigned char DistBits[0x40]; // 30B4: Numbers of bytes to skip copied block length + unsigned char LenBits[0x10]; // 30F4: Numbers of bits for skip copied block length + unsigned char ExLenBits[0x10]; // 3104: Number of valid bits for copied block + unsigned short LenBase[0x10]; // 3114: Buffer for +} TDcmpStruct; + +#define EXP_BUFFER_SIZE sizeof(TDcmpStruct) // Size of decompression structure + // Defined as 12596 in pkware headers + +//----------------------------------------------------------------------------- +// Public functions + +#ifdef __cplusplus + extern "C" { +#endif + +unsigned int PKEXPORT implode( + unsigned int (*read_buf)(char *buf, unsigned int *size, void *param), + void (*write_buf)(char *buf, unsigned int *size, void *param), + char *work_buf, + void *param, + unsigned int *type, + unsigned int *dsize); + + +unsigned int PKEXPORT explode( + unsigned int (*read_buf)(char *buf, unsigned int *size, void *param), + void (*write_buf)(char *buf, unsigned int *size, void *param), + char *work_buf, + void *param); + +// The original name "crc32" was changed to "crc32pk" due +// to compatibility with zlib +unsigned long PKEXPORT crc32_pklib(char *buffer, unsigned int *size, unsigned long *old_crc); + +#ifdef __cplusplus + } // End of 'extern "C"' declaration +#endif + +#endif // __PKLIB_H__ diff --git a/dep/StormLib/src/sparse/sparse.cpp b/dep/StormLib/src/sparse/sparse.cpp new file mode 100644 index 00000000000..5b37f6d0f8e --- /dev/null +++ b/dep/StormLib/src/sparse/sparse.cpp @@ -0,0 +1,288 @@ +/*****************************************************************************/ +/* huffman.cpp Copyright (c) Ladislav Zezula 1998-2003 */ +/*---------------------------------------------------------------------------*/ +/* This module contains Huffmann (de)compression methods */ +/* */ +/* Authors : Ladislav Zezula (ladik.zezula.net) */ +/* ShadowFlare (BlakFlare@hotmail.com) */ +/* */ +/*---------------------------------------------------------------------------*/ +/* Date Ver Who Comment */ +/* -------- ---- --- ------- */ +/* xx.xx.xx 1.00 Lad The first version of dcmp.cpp */ +/* 03.05.03 1.00 Lad Added compression methods */ +/* 19.11.03 1.01 Dan Big endian handling */ +/* 08.12.03 2.01 Dan High-memory handling (> 0x80000000) */ +/*****************************************************************************/ + +#include +#include + +#include "sparse.h" + +//----------------------------------------------------------------------------- +// Public functions + +void CompressSparse(unsigned char * pbOutBuffer, int * pcbOutBuffer, unsigned char * pbInBuffer, int cbInBuffer) +{ + unsigned char * pbOutBufferEnd = pbOutBuffer + *pcbOutBuffer; + unsigned char * pbInBufferEnd = pbInBuffer + cbInBuffer; + unsigned char * pbLastNonZero = pbInBuffer; + unsigned char * pbOutBuffer0 = pbOutBuffer; + unsigned char * pbInBuffPtr = pbInBuffer; + size_t NumberOfNonZeros; + size_t NumberOfZeros; + + // There must be at least 4 bytes of free space in the output buffer now + if((pbInBuffer + 4) >= pbInBufferEnd) + return; + + // Put the original data length (in little endian) + *pbOutBuffer++ = (unsigned char)(cbInBuffer >> 0x18); + *pbOutBuffer++ = (unsigned char)(cbInBuffer >> 0x10); + *pbOutBuffer++ = (unsigned char)(cbInBuffer >> 0x08); + *pbOutBuffer++ = (unsigned char)(cbInBuffer >> 0x00); + + // If there is at least 3 bytes in the input buffer, do this loop + while(pbInBuffer < (pbInBufferEnd - 3)) + { + // Reset the zero count and frontal pointer + pbLastNonZero = pbInBuffer; + pbInBuffPtr = pbInBuffer; + NumberOfZeros = 0; + + if(pbInBuffPtr < pbInBufferEnd) + { + do + { + // Count number of zeros + if(*pbInBuffPtr == 0) + { + NumberOfZeros++; + } + else + { + // Were there at least 3 zeros before? If yes, we need to flush the data + if(NumberOfZeros >= 3) + break; + pbLastNonZero = pbInBuffPtr + 1; + NumberOfZeros = 0; + } + } + while(++pbInBuffPtr < pbInBufferEnd); + } + + // Get number of nonzeros that we found so far and flush them + NumberOfNonZeros = pbLastNonZero - pbInBuffer; + if(NumberOfNonZeros != 0) + { + // Process blocks that are longer than 0x81 nonzero bytes + while(NumberOfNonZeros > 0x81) + { + // Verify if we still have enough space in output buffer + if((pbOutBuffer + 0x81) >= pbOutBufferEnd) + return; + + // Put marker that means "0x80 of nonzeros" + *pbOutBuffer++ = 0xFF; + memcpy(pbOutBuffer, pbInBuffer, 0x80); + + // Adjust counter of nonzeros and both pointers + NumberOfNonZeros -= 0x80; + pbOutBuffer += 0x80; + pbInBuffer += 0x80; + } + + // BUGBUG: The following code will be triggered if the NumberOfNonZeros + // was 0x81 before. It will copy just one byte. This seems like a bug to me, + // but since I want StormLib to be exact like Blizzard code is, I will keep + // it that way here + if(NumberOfNonZeros > 0x80) + { + // Verify if we still have enough space in output buffer + if((pbOutBuffer + 2) >= pbOutBufferEnd) + return; + + // Put marker that means "1 nonzero byte" + *pbOutBuffer++ = 0x80; + memcpy(pbOutBuffer, pbInBuffer, 1); + + // Adjust counter of nonzeros and both pointers + NumberOfNonZeros--; + pbOutBuffer++; + pbInBuffer++; + } + + // If there is 1 nonzero or more, put the block + if(NumberOfNonZeros >= 0x01) + { + // Verify if we still have enough space in output buffer + if((pbOutBuffer + NumberOfNonZeros + 1) >= pbOutBufferEnd) + return; + + // Put marker that means "Several nonzero bytes" + *pbOutBuffer++ = (unsigned char)(0x80 | (NumberOfNonZeros - 1)); + memcpy(pbOutBuffer, pbInBuffer, NumberOfNonZeros); + + // Adjust pointers + pbOutBuffer += NumberOfNonZeros; + pbInBuffer += NumberOfNonZeros; + } + else + { + // Verify if we still have enough space in output buffer + if((pbOutBuffer + 2) >= pbOutBufferEnd) + return; + + // Put marker that means "1 nonzero byte" + *pbOutBuffer++ = 0x80; + memcpy(pbOutBuffer, pbInBuffer, 1); + + // Adjust pointers + pbOutBuffer++; + pbInBuffer++; + } + } + + // Now flush all zero bytes + while(NumberOfZeros > 0x85) + { + // Do we have at least 2 bytes in the output buffer ? + if((pbOutBuffer + 1) >= pbOutBufferEnd) + return; + + // Put marker that means "0x82 zeros" + *pbOutBuffer++ = 0x7F; + + // Adjust zero counter and input pointer + NumberOfZeros -= 0x82; + pbInBuffer += 0x82; + } + + // If we got more than 0x82 zeros, flush 3 of them now + if(NumberOfZeros > 0x82) + { + // Do we have at least 2 bytes in the output buffer ? + if((pbOutBuffer + 1) >= pbOutBufferEnd) + return; + + // Put marker that means "0x03 zeros" + *pbOutBuffer++ = 0; + + // Adjust zero counter and input pointer + NumberOfZeros -= 0x03; + pbInBuffer += 0x03; + } + + // Is there at least three zeros ? + if(NumberOfZeros >= 3) + { + // Do we have at least 2 bytes in the output buffer ? + if((pbOutBuffer + 1) >= pbOutBufferEnd) + return; + + // Put marker that means "Several zeros" + *pbOutBuffer++ = (unsigned char)(NumberOfZeros - 3); + + // Adjust pointer + pbInBuffer += NumberOfZeros; + } + } + + // Flush last three bytes + if(pbInBuffer < pbInBufferEnd) + { + pbInBuffPtr = pbInBuffer; + + for(;;) + { + if(*pbInBuffPtr++ != 0) + { + // Get number of bytes remaining + NumberOfNonZeros = (pbInBufferEnd - pbInBuffer); + + // Not enough space in the output buffer ==> exit + if((pbOutBuffer + NumberOfNonZeros + 1) >= pbOutBufferEnd) + return; + + // Terminate with a marker that means "0x80 of nonzeros" + *pbOutBuffer++ = 0xFF; + memcpy(pbOutBuffer, pbInBuffer, NumberOfNonZeros); + + // Adjust pointer + pbOutBuffer += NumberOfNonZeros; + break; + } + else + { + // Is there are more chars in the input buffer + if(pbInBuffPtr < pbInBufferEnd) + continue; + + // If the compression will not compress it by even 1 byte, do nothing + if((pbOutBuffer + 1) >= pbOutBufferEnd) + return; + + // Terminate with a chunk that means "0x82 of zeros" + *pbOutBuffer++ = 0x7F; + break; + } + } + } + + // Out the length of the output buffer + *pcbOutBuffer = (int)(pbOutBuffer - pbOutBuffer0); +} + +int DecompressSparse(unsigned char * pbOutBuffer, int * pcbOutBuffer, unsigned char * pbInBuffer, int cbInBuffer) +{ + unsigned char * pbInBufferEnd = pbInBuffer + cbInBuffer; + unsigned int cbChunkSize; + unsigned int cbOutBuffer = 0; + unsigned int OneByte; + + // Don't decompress anything that is shorter than 5 bytes + if(cbInBuffer < 5) + return 0; + + // Get the 32-bits from the input stream + OneByte = *pbInBuffer++; + cbOutBuffer |= (OneByte << 0x18); + OneByte = *pbInBuffer++; + cbOutBuffer |= (OneByte << 0x10); + OneByte = *pbInBuffer++; + cbOutBuffer |= (OneByte << 0x08); + OneByte = *pbInBuffer++; + cbOutBuffer |= (OneByte << 0x00); + + // Put the output size to the buffer + *pcbOutBuffer = cbOutBuffer; + + // Process the input buffer + while(pbInBuffer < pbInBufferEnd) + { + // Get (next) byte from the stream + OneByte = *pbInBuffer++; + + // If highest bit, it means that that normal data follow + if(OneByte & 0x80) + { + cbChunkSize = (OneByte & 0x7F) + 1; + cbChunkSize = (cbChunkSize < cbOutBuffer) ? cbChunkSize : cbOutBuffer; + memcpy(pbOutBuffer, pbInBuffer, cbChunkSize); + pbInBuffer += cbChunkSize; + } + else + { + cbChunkSize = (OneByte & 0x7F) + 3; + cbChunkSize = (cbChunkSize < cbOutBuffer) ? cbChunkSize : cbOutBuffer; + memset(pbOutBuffer, 0, cbChunkSize); + } + + // Increment output buffer pointer + pbOutBuffer += cbChunkSize; + cbOutBuffer -= cbChunkSize; + } + + return 1; +} diff --git a/dep/StormLib/src/sparse/sparse.h b/dep/StormLib/src/sparse/sparse.h new file mode 100644 index 00000000000..032395f0b94 --- /dev/null +++ b/dep/StormLib/src/sparse/sparse.h @@ -0,0 +1,19 @@ +/*****************************************************************************/ +/* sparse.h Copyright (c) Ladislav Zezula 2010 */ +/*---------------------------------------------------------------------------*/ +/* implementation of Sparse compression, used in Starcraft II */ +/*---------------------------------------------------------------------------*/ +/* Date Ver Who Comment */ +/* -------- ---- --- ------- */ +/* 05.03.10 1.00 Lad The first version of sparse.h */ +/*****************************************************************************/ + +#ifndef __SPARSE_H__ +#define __SPARSE_H__ + +#include "../StormPort.h" + +void CompressSparse(unsigned char * pbOutBuffer, int * pcbOutLength, unsigned char * pbInBuffer, int cbInLength); +int DecompressSparse(unsigned char * pbOutBuffer, int * pcbOutLength, unsigned char * pbInBuffer, int cbInLength); + +#endif // __SPARSE_H__ diff --git a/dep/StormLib/src/zlib/adler32.c b/dep/StormLib/src/zlib/adler32.c new file mode 100644 index 00000000000..007ba26277c --- /dev/null +++ b/dep/StormLib/src/zlib/adler32.c @@ -0,0 +1,149 @@ +/* adler32.c -- compute the Adler-32 checksum of a data stream + * Copyright (C) 1995-2004 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* @(#) $Id$ */ + +#define ZLIB_INTERNAL +#include "zlib.h" + +#define BASE 65521UL /* largest prime smaller than 65536 */ +#define NMAX 5552 +/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */ + +#define DO1(buf,i) {adler += (buf)[i]; sum2 += adler;} +#define DO2(buf,i) DO1(buf,i); DO1(buf,i+1); +#define DO4(buf,i) DO2(buf,i); DO2(buf,i+2); +#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4); +#define DO16(buf) DO8(buf,0); DO8(buf,8); + +/* use NO_DIVIDE if your processor does not do division in hardware */ +#ifdef NO_DIVIDE +# define MOD(a) \ + do { \ + if (a >= (BASE << 16)) a -= (BASE << 16); \ + if (a >= (BASE << 15)) a -= (BASE << 15); \ + if (a >= (BASE << 14)) a -= (BASE << 14); \ + if (a >= (BASE << 13)) a -= (BASE << 13); \ + if (a >= (BASE << 12)) a -= (BASE << 12); \ + if (a >= (BASE << 11)) a -= (BASE << 11); \ + if (a >= (BASE << 10)) a -= (BASE << 10); \ + if (a >= (BASE << 9)) a -= (BASE << 9); \ + if (a >= (BASE << 8)) a -= (BASE << 8); \ + if (a >= (BASE << 7)) a -= (BASE << 7); \ + if (a >= (BASE << 6)) a -= (BASE << 6); \ + if (a >= (BASE << 5)) a -= (BASE << 5); \ + if (a >= (BASE << 4)) a -= (BASE << 4); \ + if (a >= (BASE << 3)) a -= (BASE << 3); \ + if (a >= (BASE << 2)) a -= (BASE << 2); \ + if (a >= (BASE << 1)) a -= (BASE << 1); \ + if (a >= BASE) a -= BASE; \ + } while (0) +# define MOD4(a) \ + do { \ + if (a >= (BASE << 4)) a -= (BASE << 4); \ + if (a >= (BASE << 3)) a -= (BASE << 3); \ + if (a >= (BASE << 2)) a -= (BASE << 2); \ + if (a >= (BASE << 1)) a -= (BASE << 1); \ + if (a >= BASE) a -= BASE; \ + } while (0) +#else +# define MOD(a) a %= BASE +# define MOD4(a) a %= BASE +#endif + +/* ========================================================================= */ +uLong ZEXPORT adler32(adler, buf, len) + uLong adler; + const Bytef *buf; + uInt len; +{ + unsigned long sum2; + unsigned n; + + /* split Adler-32 into component sums */ + sum2 = (adler >> 16) & 0xffff; + adler &= 0xffff; + + /* in case user likes doing a byte at a time, keep it fast */ + if (len == 1) { + adler += buf[0]; + if (adler >= BASE) + adler -= BASE; + sum2 += adler; + if (sum2 >= BASE) + sum2 -= BASE; + return adler | (sum2 << 16); + } + + /* initial Adler-32 value (deferred check for len == 1 speed) */ + if (buf == Z_NULL) + return 1L; + + /* in case short lengths are provided, keep it somewhat fast */ + if (len < 16) { + while (len--) { + adler += *buf++; + sum2 += adler; + } + if (adler >= BASE) + adler -= BASE; + MOD4(sum2); /* only added so many BASE's */ + return adler | (sum2 << 16); + } + + /* do length NMAX blocks -- requires just one modulo operation */ + while (len >= NMAX) { + len -= NMAX; + n = NMAX / 16; /* NMAX is divisible by 16 */ + do { + DO16(buf); /* 16 sums unrolled */ + buf += 16; + } while (--n); + MOD(adler); + MOD(sum2); + } + + /* do remaining bytes (less than NMAX, still just one modulo) */ + if (len) { /* avoid modulos if none remaining */ + while (len >= 16) { + len -= 16; + DO16(buf); + buf += 16; + } + while (len--) { + adler += *buf++; + sum2 += adler; + } + MOD(adler); + MOD(sum2); + } + + /* return recombined sums */ + return adler | (sum2 << 16); +} + +/* ========================================================================= */ +uLong ZEXPORT adler32_combine(adler1, adler2, len2) + uLong adler1; + uLong adler2; + z_off_t len2; +{ + unsigned long sum1; + unsigned long sum2; + unsigned rem; + + /* the derivation of this formula is left as an exercise for the reader */ + rem = (unsigned)(len2 % BASE); + sum1 = adler1 & 0xffff; + sum2 = rem * sum1; + MOD(sum2); + sum1 += (adler2 & 0xffff) + BASE - 1; + sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + BASE - rem; + if (sum1 > BASE) sum1 -= BASE; + if (sum1 > BASE) sum1 -= BASE; + if (sum2 > (BASE << 1)) sum2 -= (BASE << 1); + if (sum2 > BASE) sum2 -= BASE; + return sum1 | (sum2 << 16); +} diff --git a/dep/StormLib/src/zlib/compress2.c b/dep/StormLib/src/zlib/compress2.c new file mode 100644 index 00000000000..df04f0148e6 --- /dev/null +++ b/dep/StormLib/src/zlib/compress2.c @@ -0,0 +1,79 @@ +/* compress.c -- compress a memory buffer + * Copyright (C) 1995-2003 Jean-loup Gailly. + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* @(#) $Id$ */ + +#define ZLIB_INTERNAL +#include "zlib.h" + +/* =========================================================================== + Compresses the source buffer into the destination buffer. The level + parameter has the same meaning as in deflateInit. sourceLen is the byte + length of the source buffer. Upon entry, destLen is the total size of the + destination buffer, which must be at least 0.1% larger than sourceLen plus + 12 bytes. Upon exit, destLen is the actual size of the compressed buffer. + + compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_BUF_ERROR if there was not enough room in the output buffer, + Z_STREAM_ERROR if the level parameter is invalid. +*/ +int ZEXPORT compress2 (dest, destLen, source, sourceLen, level) + Bytef *dest; + uLongf *destLen; + const Bytef *source; + uLong sourceLen; + int level; +{ + z_stream stream; + int err; + + stream.next_in = (Bytef*)source; + stream.avail_in = (uInt)sourceLen; +#ifdef MAXSEG_64K + /* Check for source > 64K on 16-bit machine: */ + if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR; +#endif + stream.next_out = dest; + stream.avail_out = (uInt)*destLen; + if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR; + + stream.zalloc = (alloc_func)0; + stream.zfree = (free_func)0; + stream.opaque = (voidpf)0; + + err = deflateInit(&stream, level); + if (err != Z_OK) return err; + + err = deflate(&stream, Z_FINISH); + if (err != Z_STREAM_END) { + deflateEnd(&stream); + return err == Z_OK ? Z_BUF_ERROR : err; + } + *destLen = stream.total_out; + + err = deflateEnd(&stream); + return err; +} + +/* =========================================================================== + */ +int ZEXPORT compress (dest, destLen, source, sourceLen) + Bytef *dest; + uLongf *destLen; + const Bytef *source; + uLong sourceLen; +{ + return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION); +} + +/* =========================================================================== + If the default memLevel or windowBits for deflateInit() is changed, then + this function needs to be updated. + */ +uLong ZEXPORT compressBound (sourceLen) + uLong sourceLen; +{ + return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + 11; +} diff --git a/dep/StormLib/src/zlib/crc32.c b/dep/StormLib/src/zlib/crc32.c new file mode 100644 index 00000000000..f658a9ef55e --- /dev/null +++ b/dep/StormLib/src/zlib/crc32.c @@ -0,0 +1,423 @@ +/* crc32.c -- compute the CRC-32 of a data stream + * Copyright (C) 1995-2005 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + * + * Thanks to Rodney Brown for his contribution of faster + * CRC methods: exclusive-oring 32 bits of data at a time, and pre-computing + * tables for updating the shift register in one step with three exclusive-ors + * instead of four steps with four exclusive-ors. This results in about a + * factor of two increase in speed on a Power PC G4 (PPC7455) using gcc -O3. + */ + +/* @(#) $Id$ */ + +/* + Note on the use of DYNAMIC_CRC_TABLE: there is no mutex or semaphore + protection on the static variables used to control the first-use generation + of the crc tables. Therefore, if you #define DYNAMIC_CRC_TABLE, you should + first call get_crc_table() to initialize the tables before allowing more than + one thread to use crc32(). + */ + +#ifdef MAKECRCH +# include +# ifndef DYNAMIC_CRC_TABLE +# define DYNAMIC_CRC_TABLE +# endif /* !DYNAMIC_CRC_TABLE */ +#endif /* MAKECRCH */ + +#include "zutil.h" /* for STDC and FAR definitions */ + +#define local static + +/* Find a four-byte integer type for crc32_little() and crc32_big(). */ +#ifndef NOBYFOUR +# ifdef STDC /* need ANSI C limits.h to determine sizes */ +# include +# define BYFOUR +# if (UINT_MAX == 0xffffffffUL) + typedef unsigned int u4; +# else +# if (ULONG_MAX == 0xffffffffUL) + typedef unsigned long u4; +# else +# if (USHRT_MAX == 0xffffffffUL) + typedef unsigned short u4; +# else +# undef BYFOUR /* can't find a four-byte integer type! */ +# endif +# endif +# endif +# endif /* STDC */ +#endif /* !NOBYFOUR */ + +/* Definitions for doing the crc four data bytes at a time. */ +#ifdef BYFOUR +# define REV(w) (((w)>>24)+(((w)>>8)&0xff00)+ \ + (((w)&0xff00)<<8)+(((w)&0xff)<<24)) + local unsigned long crc32_little OF((unsigned long, + const unsigned char FAR *, unsigned)); + local unsigned long crc32_big OF((unsigned long, + const unsigned char FAR *, unsigned)); +# define TBLS 8 +#else +# define TBLS 1 +#endif /* BYFOUR */ + +/* Local functions for crc concatenation */ +local unsigned long gf2_matrix_times OF((unsigned long *mat, + unsigned long vec)); +local void gf2_matrix_square OF((unsigned long *square, unsigned long *mat)); + +#ifdef DYNAMIC_CRC_TABLE + +local volatile int crc_table_empty = 1; +local unsigned long FAR crc_table[TBLS][256]; +local void make_crc_table OF((void)); +#ifdef MAKECRCH + local void write_table OF((FILE *, const unsigned long FAR *)); +#endif /* MAKECRCH */ +/* + Generate tables for a byte-wise 32-bit CRC calculation on the polynomial: + x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1. + + Polynomials over GF(2) are represented in binary, one bit per coefficient, + with the lowest powers in the most significant bit. Then adding polynomials + is just exclusive-or, and multiplying a polynomial by x is a right shift by + one. If we call the above polynomial p, and represent a byte as the + polynomial q, also with the lowest power in the most significant bit (so the + byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p, + where a mod b means the remainder after dividing a by b. + + This calculation is done using the shift-register method of multiplying and + taking the remainder. The register is initialized to zero, and for each + incoming bit, x^32 is added mod p to the register if the bit is a one (where + x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by + x (which is shifting right by one and adding x^32 mod p if the bit shifted + out is a one). We start with the highest power (least significant bit) of + q and repeat for all eight bits of q. + + The first table is simply the CRC of all possible eight bit values. This is + all the information needed to generate CRCs on data a byte at a time for all + combinations of CRC register values and incoming bytes. The remaining tables + allow for word-at-a-time CRC calculation for both big-endian and little- + endian machines, where a word is four bytes. +*/ +local void make_crc_table() +{ + unsigned long c; + int n, k; + unsigned long poly; /* polynomial exclusive-or pattern */ + /* terms of polynomial defining this crc (except x^32): */ + static volatile int first = 1; /* flag to limit concurrent making */ + static const unsigned char p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26}; + + /* See if another task is already doing this (not thread-safe, but better + than nothing -- significantly reduces duration of vulnerability in + case the advice about DYNAMIC_CRC_TABLE is ignored) */ + if (first) { + first = 0; + + /* make exclusive-or pattern from polynomial (0xedb88320UL) */ + poly = 0UL; + for (n = 0; n < sizeof(p)/sizeof(unsigned char); n++) + poly |= 1UL << (31 - p[n]); + + /* generate a crc for every 8-bit value */ + for (n = 0; n < 256; n++) { + c = (unsigned long)n; + for (k = 0; k < 8; k++) + c = c & 1 ? poly ^ (c >> 1) : c >> 1; + crc_table[0][n] = c; + } + +#ifdef BYFOUR + /* generate crc for each value followed by one, two, and three zeros, + and then the byte reversal of those as well as the first table */ + for (n = 0; n < 256; n++) { + c = crc_table[0][n]; + crc_table[4][n] = REV(c); + for (k = 1; k < 4; k++) { + c = crc_table[0][c & 0xff] ^ (c >> 8); + crc_table[k][n] = c; + crc_table[k + 4][n] = REV(c); + } + } +#endif /* BYFOUR */ + + crc_table_empty = 0; + } + else { /* not first */ + /* wait for the other guy to finish (not efficient, but rare) */ + while (crc_table_empty) + ; + } + +#ifdef MAKECRCH + /* write out CRC tables to crc32.h */ + { + FILE *out; + + out = fopen("crc32.h", "w"); + if (out == NULL) return; + fprintf(out, "/* crc32.h -- tables for rapid CRC calculation\n"); + fprintf(out, " * Generated automatically by crc32.c\n */\n\n"); + fprintf(out, "local const unsigned long FAR "); + fprintf(out, "crc_table[TBLS][256] =\n{\n {\n"); + write_table(out, crc_table[0]); +# ifdef BYFOUR + fprintf(out, "#ifdef BYFOUR\n"); + for (k = 1; k < 8; k++) { + fprintf(out, " },\n {\n"); + write_table(out, crc_table[k]); + } + fprintf(out, "#endif\n"); +# endif /* BYFOUR */ + fprintf(out, " }\n};\n"); + fclose(out); + } +#endif /* MAKECRCH */ +} + +#ifdef MAKECRCH +local void write_table(out, table) + FILE *out; + const unsigned long FAR *table; +{ + int n; + + for (n = 0; n < 256; n++) + fprintf(out, "%s0x%08lxUL%s", n % 5 ? "" : " ", table[n], + n == 255 ? "\n" : (n % 5 == 4 ? ",\n" : ", ")); +} +#endif /* MAKECRCH */ + +#else /* !DYNAMIC_CRC_TABLE */ +/* ======================================================================== + * Tables of CRC-32s of all single-byte values, made by make_crc_table(). + */ +#include "crc32.h" +#endif /* DYNAMIC_CRC_TABLE */ + +/* ========================================================================= + * This function can be used by asm versions of crc32() + */ +const unsigned long FAR * ZEXPORT get_crc_table() +{ +#ifdef DYNAMIC_CRC_TABLE + if (crc_table_empty) + make_crc_table(); +#endif /* DYNAMIC_CRC_TABLE */ + return (const unsigned long FAR *)crc_table; +} + +/* ========================================================================= */ +#define DO1 crc = crc_table[0][((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8) +#define DO8 DO1; DO1; DO1; DO1; DO1; DO1; DO1; DO1 + +/* ========================================================================= */ +unsigned long ZEXPORT crc32(crc, buf, len) + unsigned long crc; + const unsigned char FAR *buf; + unsigned len; +{ + if (buf == Z_NULL) return 0UL; + +#ifdef DYNAMIC_CRC_TABLE + if (crc_table_empty) + make_crc_table(); +#endif /* DYNAMIC_CRC_TABLE */ + +#ifdef BYFOUR + if (sizeof(void *) == sizeof(ptrdiff_t)) { + u4 endian; + + endian = 1; + if (*((unsigned char *)(&endian))) + return crc32_little(crc, buf, len); + else + return crc32_big(crc, buf, len); + } +#endif /* BYFOUR */ + crc = crc ^ 0xffffffffUL; + while (len >= 8) { + DO8; + len -= 8; + } + if (len) do { + DO1; + } while (--len); + return crc ^ 0xffffffffUL; +} + +#ifdef BYFOUR + +/* ========================================================================= */ +#define DOLIT4 c ^= *buf4++; \ + c = crc_table[3][c & 0xff] ^ crc_table[2][(c >> 8) & 0xff] ^ \ + crc_table[1][(c >> 16) & 0xff] ^ crc_table[0][c >> 24] +#define DOLIT32 DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4 + +/* ========================================================================= */ +local unsigned long crc32_little(crc, buf, len) + unsigned long crc; + const unsigned char FAR *buf; + unsigned len; +{ + register u4 c; + register const u4 FAR *buf4; + + c = (u4)crc; + c = ~c; + while (len && ((ptrdiff_t)buf & 3)) { + c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8); + len--; + } + + buf4 = (const u4 FAR *)(const void FAR *)buf; + while (len >= 32) { + DOLIT32; + len -= 32; + } + while (len >= 4) { + DOLIT4; + len -= 4; + } + buf = (const unsigned char FAR *)buf4; + + if (len) do { + c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8); + } while (--len); + c = ~c; + return (unsigned long)c; +} + +/* ========================================================================= */ +#define DOBIG4 c ^= *++buf4; \ + c = crc_table[4][c & 0xff] ^ crc_table[5][(c >> 8) & 0xff] ^ \ + crc_table[6][(c >> 16) & 0xff] ^ crc_table[7][c >> 24] +#define DOBIG32 DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4 + +/* ========================================================================= */ +local unsigned long crc32_big(crc, buf, len) + unsigned long crc; + const unsigned char FAR *buf; + unsigned len; +{ + register u4 c; + register const u4 FAR *buf4; + + c = REV((u4)crc); + c = ~c; + while (len && ((ptrdiff_t)buf & 3)) { + c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8); + len--; + } + + buf4 = (const u4 FAR *)(const void FAR *)buf; + buf4--; + while (len >= 32) { + DOBIG32; + len -= 32; + } + while (len >= 4) { + DOBIG4; + len -= 4; + } + buf4++; + buf = (const unsigned char FAR *)buf4; + + if (len) do { + c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8); + } while (--len); + c = ~c; + return (unsigned long)(REV(c)); +} + +#endif /* BYFOUR */ + +#define GF2_DIM 32 /* dimension of GF(2) vectors (length of CRC) */ + +/* ========================================================================= */ +local unsigned long gf2_matrix_times(mat, vec) + unsigned long *mat; + unsigned long vec; +{ + unsigned long sum; + + sum = 0; + while (vec) { + if (vec & 1) + sum ^= *mat; + vec >>= 1; + mat++; + } + return sum; +} + +/* ========================================================================= */ +local void gf2_matrix_square(square, mat) + unsigned long *square; + unsigned long *mat; +{ + int n; + + for (n = 0; n < GF2_DIM; n++) + square[n] = gf2_matrix_times(mat, mat[n]); +} + +/* ========================================================================= */ +uLong ZEXPORT crc32_combine(crc1, crc2, len2) + uLong crc1; + uLong crc2; + z_off_t len2; +{ + int n; + unsigned long row; + unsigned long even[GF2_DIM]; /* even-power-of-two zeros operator */ + unsigned long odd[GF2_DIM]; /* odd-power-of-two zeros operator */ + + /* degenerate case */ + if (len2 == 0) + return crc1; + + /* put operator for one zero bit in odd */ + odd[0] = 0xedb88320L; /* CRC-32 polynomial */ + row = 1; + for (n = 1; n < GF2_DIM; n++) { + odd[n] = row; + row <<= 1; + } + + /* put operator for two zero bits in even */ + gf2_matrix_square(even, odd); + + /* put operator for four zero bits in odd */ + gf2_matrix_square(odd, even); + + /* apply len2 zeros to crc1 (first square will put the operator for one + zero byte, eight zero bits, in even) */ + do { + /* apply zeros operator for this bit of len2 */ + gf2_matrix_square(even, odd); + if (len2 & 1) + crc1 = gf2_matrix_times(even, crc1); + len2 >>= 1; + + /* if no more bits set, then done */ + if (len2 == 0) + break; + + /* another iteration of the loop with odd and even swapped */ + gf2_matrix_square(odd, even); + if (len2 & 1) + crc1 = gf2_matrix_times(odd, crc1); + len2 >>= 1; + + /* if no more bits set, then done */ + } while (len2 != 0); + + /* return combined crc */ + crc1 ^= crc2; + return crc1; +} diff --git a/dep/StormLib/src/zlib/crc32.h b/dep/StormLib/src/zlib/crc32.h new file mode 100644 index 00000000000..8053b6117c0 --- /dev/null +++ b/dep/StormLib/src/zlib/crc32.h @@ -0,0 +1,441 @@ +/* crc32.h -- tables for rapid CRC calculation + * Generated automatically by crc32.c + */ + +local const unsigned long FAR crc_table[TBLS][256] = +{ + { + 0x00000000UL, 0x77073096UL, 0xee0e612cUL, 0x990951baUL, 0x076dc419UL, + 0x706af48fUL, 0xe963a535UL, 0x9e6495a3UL, 0x0edb8832UL, 0x79dcb8a4UL, + 0xe0d5e91eUL, 0x97d2d988UL, 0x09b64c2bUL, 0x7eb17cbdUL, 0xe7b82d07UL, + 0x90bf1d91UL, 0x1db71064UL, 0x6ab020f2UL, 0xf3b97148UL, 0x84be41deUL, + 0x1adad47dUL, 0x6ddde4ebUL, 0xf4d4b551UL, 0x83d385c7UL, 0x136c9856UL, + 0x646ba8c0UL, 0xfd62f97aUL, 0x8a65c9ecUL, 0x14015c4fUL, 0x63066cd9UL, + 0xfa0f3d63UL, 0x8d080df5UL, 0x3b6e20c8UL, 0x4c69105eUL, 0xd56041e4UL, + 0xa2677172UL, 0x3c03e4d1UL, 0x4b04d447UL, 0xd20d85fdUL, 0xa50ab56bUL, + 0x35b5a8faUL, 0x42b2986cUL, 0xdbbbc9d6UL, 0xacbcf940UL, 0x32d86ce3UL, + 0x45df5c75UL, 0xdcd60dcfUL, 0xabd13d59UL, 0x26d930acUL, 0x51de003aUL, + 0xc8d75180UL, 0xbfd06116UL, 0x21b4f4b5UL, 0x56b3c423UL, 0xcfba9599UL, + 0xb8bda50fUL, 0x2802b89eUL, 0x5f058808UL, 0xc60cd9b2UL, 0xb10be924UL, + 0x2f6f7c87UL, 0x58684c11UL, 0xc1611dabUL, 0xb6662d3dUL, 0x76dc4190UL, + 0x01db7106UL, 0x98d220bcUL, 0xefd5102aUL, 0x71b18589UL, 0x06b6b51fUL, + 0x9fbfe4a5UL, 0xe8b8d433UL, 0x7807c9a2UL, 0x0f00f934UL, 0x9609a88eUL, + 0xe10e9818UL, 0x7f6a0dbbUL, 0x086d3d2dUL, 0x91646c97UL, 0xe6635c01UL, + 0x6b6b51f4UL, 0x1c6c6162UL, 0x856530d8UL, 0xf262004eUL, 0x6c0695edUL, + 0x1b01a57bUL, 0x8208f4c1UL, 0xf50fc457UL, 0x65b0d9c6UL, 0x12b7e950UL, + 0x8bbeb8eaUL, 0xfcb9887cUL, 0x62dd1ddfUL, 0x15da2d49UL, 0x8cd37cf3UL, + 0xfbd44c65UL, 0x4db26158UL, 0x3ab551ceUL, 0xa3bc0074UL, 0xd4bb30e2UL, + 0x4adfa541UL, 0x3dd895d7UL, 0xa4d1c46dUL, 0xd3d6f4fbUL, 0x4369e96aUL, + 0x346ed9fcUL, 0xad678846UL, 0xda60b8d0UL, 0x44042d73UL, 0x33031de5UL, + 0xaa0a4c5fUL, 0xdd0d7cc9UL, 0x5005713cUL, 0x270241aaUL, 0xbe0b1010UL, + 0xc90c2086UL, 0x5768b525UL, 0x206f85b3UL, 0xb966d409UL, 0xce61e49fUL, + 0x5edef90eUL, 0x29d9c998UL, 0xb0d09822UL, 0xc7d7a8b4UL, 0x59b33d17UL, + 0x2eb40d81UL, 0xb7bd5c3bUL, 0xc0ba6cadUL, 0xedb88320UL, 0x9abfb3b6UL, + 0x03b6e20cUL, 0x74b1d29aUL, 0xead54739UL, 0x9dd277afUL, 0x04db2615UL, + 0x73dc1683UL, 0xe3630b12UL, 0x94643b84UL, 0x0d6d6a3eUL, 0x7a6a5aa8UL, + 0xe40ecf0bUL, 0x9309ff9dUL, 0x0a00ae27UL, 0x7d079eb1UL, 0xf00f9344UL, + 0x8708a3d2UL, 0x1e01f268UL, 0x6906c2feUL, 0xf762575dUL, 0x806567cbUL, + 0x196c3671UL, 0x6e6b06e7UL, 0xfed41b76UL, 0x89d32be0UL, 0x10da7a5aUL, + 0x67dd4accUL, 0xf9b9df6fUL, 0x8ebeeff9UL, 0x17b7be43UL, 0x60b08ed5UL, + 0xd6d6a3e8UL, 0xa1d1937eUL, 0x38d8c2c4UL, 0x4fdff252UL, 0xd1bb67f1UL, + 0xa6bc5767UL, 0x3fb506ddUL, 0x48b2364bUL, 0xd80d2bdaUL, 0xaf0a1b4cUL, + 0x36034af6UL, 0x41047a60UL, 0xdf60efc3UL, 0xa867df55UL, 0x316e8eefUL, + 0x4669be79UL, 0xcb61b38cUL, 0xbc66831aUL, 0x256fd2a0UL, 0x5268e236UL, + 0xcc0c7795UL, 0xbb0b4703UL, 0x220216b9UL, 0x5505262fUL, 0xc5ba3bbeUL, + 0xb2bd0b28UL, 0x2bb45a92UL, 0x5cb36a04UL, 0xc2d7ffa7UL, 0xb5d0cf31UL, + 0x2cd99e8bUL, 0x5bdeae1dUL, 0x9b64c2b0UL, 0xec63f226UL, 0x756aa39cUL, + 0x026d930aUL, 0x9c0906a9UL, 0xeb0e363fUL, 0x72076785UL, 0x05005713UL, + 0x95bf4a82UL, 0xe2b87a14UL, 0x7bb12baeUL, 0x0cb61b38UL, 0x92d28e9bUL, + 0xe5d5be0dUL, 0x7cdcefb7UL, 0x0bdbdf21UL, 0x86d3d2d4UL, 0xf1d4e242UL, + 0x68ddb3f8UL, 0x1fda836eUL, 0x81be16cdUL, 0xf6b9265bUL, 0x6fb077e1UL, + 0x18b74777UL, 0x88085ae6UL, 0xff0f6a70UL, 0x66063bcaUL, 0x11010b5cUL, + 0x8f659effUL, 0xf862ae69UL, 0x616bffd3UL, 0x166ccf45UL, 0xa00ae278UL, + 0xd70dd2eeUL, 0x4e048354UL, 0x3903b3c2UL, 0xa7672661UL, 0xd06016f7UL, + 0x4969474dUL, 0x3e6e77dbUL, 0xaed16a4aUL, 0xd9d65adcUL, 0x40df0b66UL, + 0x37d83bf0UL, 0xa9bcae53UL, 0xdebb9ec5UL, 0x47b2cf7fUL, 0x30b5ffe9UL, + 0xbdbdf21cUL, 0xcabac28aUL, 0x53b39330UL, 0x24b4a3a6UL, 0xbad03605UL, + 0xcdd70693UL, 0x54de5729UL, 0x23d967bfUL, 0xb3667a2eUL, 0xc4614ab8UL, + 0x5d681b02UL, 0x2a6f2b94UL, 0xb40bbe37UL, 0xc30c8ea1UL, 0x5a05df1bUL, + 0x2d02ef8dUL +#ifdef BYFOUR + }, + { + 0x00000000UL, 0x191b3141UL, 0x32366282UL, 0x2b2d53c3UL, 0x646cc504UL, + 0x7d77f445UL, 0x565aa786UL, 0x4f4196c7UL, 0xc8d98a08UL, 0xd1c2bb49UL, + 0xfaefe88aUL, 0xe3f4d9cbUL, 0xacb54f0cUL, 0xb5ae7e4dUL, 0x9e832d8eUL, + 0x87981ccfUL, 0x4ac21251UL, 0x53d92310UL, 0x78f470d3UL, 0x61ef4192UL, + 0x2eaed755UL, 0x37b5e614UL, 0x1c98b5d7UL, 0x05838496UL, 0x821b9859UL, + 0x9b00a918UL, 0xb02dfadbUL, 0xa936cb9aUL, 0xe6775d5dUL, 0xff6c6c1cUL, + 0xd4413fdfUL, 0xcd5a0e9eUL, 0x958424a2UL, 0x8c9f15e3UL, 0xa7b24620UL, + 0xbea97761UL, 0xf1e8e1a6UL, 0xe8f3d0e7UL, 0xc3de8324UL, 0xdac5b265UL, + 0x5d5daeaaUL, 0x44469febUL, 0x6f6bcc28UL, 0x7670fd69UL, 0x39316baeUL, + 0x202a5aefUL, 0x0b07092cUL, 0x121c386dUL, 0xdf4636f3UL, 0xc65d07b2UL, + 0xed705471UL, 0xf46b6530UL, 0xbb2af3f7UL, 0xa231c2b6UL, 0x891c9175UL, + 0x9007a034UL, 0x179fbcfbUL, 0x0e848dbaUL, 0x25a9de79UL, 0x3cb2ef38UL, + 0x73f379ffUL, 0x6ae848beUL, 0x41c51b7dUL, 0x58de2a3cUL, 0xf0794f05UL, + 0xe9627e44UL, 0xc24f2d87UL, 0xdb541cc6UL, 0x94158a01UL, 0x8d0ebb40UL, + 0xa623e883UL, 0xbf38d9c2UL, 0x38a0c50dUL, 0x21bbf44cUL, 0x0a96a78fUL, + 0x138d96ceUL, 0x5ccc0009UL, 0x45d73148UL, 0x6efa628bUL, 0x77e153caUL, + 0xbabb5d54UL, 0xa3a06c15UL, 0x888d3fd6UL, 0x91960e97UL, 0xded79850UL, + 0xc7cca911UL, 0xece1fad2UL, 0xf5facb93UL, 0x7262d75cUL, 0x6b79e61dUL, + 0x4054b5deUL, 0x594f849fUL, 0x160e1258UL, 0x0f152319UL, 0x243870daUL, + 0x3d23419bUL, 0x65fd6ba7UL, 0x7ce65ae6UL, 0x57cb0925UL, 0x4ed03864UL, + 0x0191aea3UL, 0x188a9fe2UL, 0x33a7cc21UL, 0x2abcfd60UL, 0xad24e1afUL, + 0xb43fd0eeUL, 0x9f12832dUL, 0x8609b26cUL, 0xc94824abUL, 0xd05315eaUL, + 0xfb7e4629UL, 0xe2657768UL, 0x2f3f79f6UL, 0x362448b7UL, 0x1d091b74UL, + 0x04122a35UL, 0x4b53bcf2UL, 0x52488db3UL, 0x7965de70UL, 0x607eef31UL, + 0xe7e6f3feUL, 0xfefdc2bfUL, 0xd5d0917cUL, 0xcccba03dUL, 0x838a36faUL, + 0x9a9107bbUL, 0xb1bc5478UL, 0xa8a76539UL, 0x3b83984bUL, 0x2298a90aUL, + 0x09b5fac9UL, 0x10aecb88UL, 0x5fef5d4fUL, 0x46f46c0eUL, 0x6dd93fcdUL, + 0x74c20e8cUL, 0xf35a1243UL, 0xea412302UL, 0xc16c70c1UL, 0xd8774180UL, + 0x9736d747UL, 0x8e2de606UL, 0xa500b5c5UL, 0xbc1b8484UL, 0x71418a1aUL, + 0x685abb5bUL, 0x4377e898UL, 0x5a6cd9d9UL, 0x152d4f1eUL, 0x0c367e5fUL, + 0x271b2d9cUL, 0x3e001cddUL, 0xb9980012UL, 0xa0833153UL, 0x8bae6290UL, + 0x92b553d1UL, 0xddf4c516UL, 0xc4eff457UL, 0xefc2a794UL, 0xf6d996d5UL, + 0xae07bce9UL, 0xb71c8da8UL, 0x9c31de6bUL, 0x852aef2aUL, 0xca6b79edUL, + 0xd37048acUL, 0xf85d1b6fUL, 0xe1462a2eUL, 0x66de36e1UL, 0x7fc507a0UL, + 0x54e85463UL, 0x4df36522UL, 0x02b2f3e5UL, 0x1ba9c2a4UL, 0x30849167UL, + 0x299fa026UL, 0xe4c5aeb8UL, 0xfdde9ff9UL, 0xd6f3cc3aUL, 0xcfe8fd7bUL, + 0x80a96bbcUL, 0x99b25afdUL, 0xb29f093eUL, 0xab84387fUL, 0x2c1c24b0UL, + 0x350715f1UL, 0x1e2a4632UL, 0x07317773UL, 0x4870e1b4UL, 0x516bd0f5UL, + 0x7a468336UL, 0x635db277UL, 0xcbfad74eUL, 0xd2e1e60fUL, 0xf9ccb5ccUL, + 0xe0d7848dUL, 0xaf96124aUL, 0xb68d230bUL, 0x9da070c8UL, 0x84bb4189UL, + 0x03235d46UL, 0x1a386c07UL, 0x31153fc4UL, 0x280e0e85UL, 0x674f9842UL, + 0x7e54a903UL, 0x5579fac0UL, 0x4c62cb81UL, 0x8138c51fUL, 0x9823f45eUL, + 0xb30ea79dUL, 0xaa1596dcUL, 0xe554001bUL, 0xfc4f315aUL, 0xd7626299UL, + 0xce7953d8UL, 0x49e14f17UL, 0x50fa7e56UL, 0x7bd72d95UL, 0x62cc1cd4UL, + 0x2d8d8a13UL, 0x3496bb52UL, 0x1fbbe891UL, 0x06a0d9d0UL, 0x5e7ef3ecUL, + 0x4765c2adUL, 0x6c48916eUL, 0x7553a02fUL, 0x3a1236e8UL, 0x230907a9UL, + 0x0824546aUL, 0x113f652bUL, 0x96a779e4UL, 0x8fbc48a5UL, 0xa4911b66UL, + 0xbd8a2a27UL, 0xf2cbbce0UL, 0xebd08da1UL, 0xc0fdde62UL, 0xd9e6ef23UL, + 0x14bce1bdUL, 0x0da7d0fcUL, 0x268a833fUL, 0x3f91b27eUL, 0x70d024b9UL, + 0x69cb15f8UL, 0x42e6463bUL, 0x5bfd777aUL, 0xdc656bb5UL, 0xc57e5af4UL, + 0xee530937UL, 0xf7483876UL, 0xb809aeb1UL, 0xa1129ff0UL, 0x8a3fcc33UL, + 0x9324fd72UL + }, + { + 0x00000000UL, 0x01c26a37UL, 0x0384d46eUL, 0x0246be59UL, 0x0709a8dcUL, + 0x06cbc2ebUL, 0x048d7cb2UL, 0x054f1685UL, 0x0e1351b8UL, 0x0fd13b8fUL, + 0x0d9785d6UL, 0x0c55efe1UL, 0x091af964UL, 0x08d89353UL, 0x0a9e2d0aUL, + 0x0b5c473dUL, 0x1c26a370UL, 0x1de4c947UL, 0x1fa2771eUL, 0x1e601d29UL, + 0x1b2f0bacUL, 0x1aed619bUL, 0x18abdfc2UL, 0x1969b5f5UL, 0x1235f2c8UL, + 0x13f798ffUL, 0x11b126a6UL, 0x10734c91UL, 0x153c5a14UL, 0x14fe3023UL, + 0x16b88e7aUL, 0x177ae44dUL, 0x384d46e0UL, 0x398f2cd7UL, 0x3bc9928eUL, + 0x3a0bf8b9UL, 0x3f44ee3cUL, 0x3e86840bUL, 0x3cc03a52UL, 0x3d025065UL, + 0x365e1758UL, 0x379c7d6fUL, 0x35dac336UL, 0x3418a901UL, 0x3157bf84UL, + 0x3095d5b3UL, 0x32d36beaUL, 0x331101ddUL, 0x246be590UL, 0x25a98fa7UL, + 0x27ef31feUL, 0x262d5bc9UL, 0x23624d4cUL, 0x22a0277bUL, 0x20e69922UL, + 0x2124f315UL, 0x2a78b428UL, 0x2bbade1fUL, 0x29fc6046UL, 0x283e0a71UL, + 0x2d711cf4UL, 0x2cb376c3UL, 0x2ef5c89aUL, 0x2f37a2adUL, 0x709a8dc0UL, + 0x7158e7f7UL, 0x731e59aeUL, 0x72dc3399UL, 0x7793251cUL, 0x76514f2bUL, + 0x7417f172UL, 0x75d59b45UL, 0x7e89dc78UL, 0x7f4bb64fUL, 0x7d0d0816UL, + 0x7ccf6221UL, 0x798074a4UL, 0x78421e93UL, 0x7a04a0caUL, 0x7bc6cafdUL, + 0x6cbc2eb0UL, 0x6d7e4487UL, 0x6f38fadeUL, 0x6efa90e9UL, 0x6bb5866cUL, + 0x6a77ec5bUL, 0x68315202UL, 0x69f33835UL, 0x62af7f08UL, 0x636d153fUL, + 0x612bab66UL, 0x60e9c151UL, 0x65a6d7d4UL, 0x6464bde3UL, 0x662203baUL, + 0x67e0698dUL, 0x48d7cb20UL, 0x4915a117UL, 0x4b531f4eUL, 0x4a917579UL, + 0x4fde63fcUL, 0x4e1c09cbUL, 0x4c5ab792UL, 0x4d98dda5UL, 0x46c49a98UL, + 0x4706f0afUL, 0x45404ef6UL, 0x448224c1UL, 0x41cd3244UL, 0x400f5873UL, + 0x4249e62aUL, 0x438b8c1dUL, 0x54f16850UL, 0x55330267UL, 0x5775bc3eUL, + 0x56b7d609UL, 0x53f8c08cUL, 0x523aaabbUL, 0x507c14e2UL, 0x51be7ed5UL, + 0x5ae239e8UL, 0x5b2053dfUL, 0x5966ed86UL, 0x58a487b1UL, 0x5deb9134UL, + 0x5c29fb03UL, 0x5e6f455aUL, 0x5fad2f6dUL, 0xe1351b80UL, 0xe0f771b7UL, + 0xe2b1cfeeUL, 0xe373a5d9UL, 0xe63cb35cUL, 0xe7fed96bUL, 0xe5b86732UL, + 0xe47a0d05UL, 0xef264a38UL, 0xeee4200fUL, 0xeca29e56UL, 0xed60f461UL, + 0xe82fe2e4UL, 0xe9ed88d3UL, 0xebab368aUL, 0xea695cbdUL, 0xfd13b8f0UL, + 0xfcd1d2c7UL, 0xfe976c9eUL, 0xff5506a9UL, 0xfa1a102cUL, 0xfbd87a1bUL, + 0xf99ec442UL, 0xf85cae75UL, 0xf300e948UL, 0xf2c2837fUL, 0xf0843d26UL, + 0xf1465711UL, 0xf4094194UL, 0xf5cb2ba3UL, 0xf78d95faUL, 0xf64fffcdUL, + 0xd9785d60UL, 0xd8ba3757UL, 0xdafc890eUL, 0xdb3ee339UL, 0xde71f5bcUL, + 0xdfb39f8bUL, 0xddf521d2UL, 0xdc374be5UL, 0xd76b0cd8UL, 0xd6a966efUL, + 0xd4efd8b6UL, 0xd52db281UL, 0xd062a404UL, 0xd1a0ce33UL, 0xd3e6706aUL, + 0xd2241a5dUL, 0xc55efe10UL, 0xc49c9427UL, 0xc6da2a7eUL, 0xc7184049UL, + 0xc25756ccUL, 0xc3953cfbUL, 0xc1d382a2UL, 0xc011e895UL, 0xcb4dafa8UL, + 0xca8fc59fUL, 0xc8c97bc6UL, 0xc90b11f1UL, 0xcc440774UL, 0xcd866d43UL, + 0xcfc0d31aUL, 0xce02b92dUL, 0x91af9640UL, 0x906dfc77UL, 0x922b422eUL, + 0x93e92819UL, 0x96a63e9cUL, 0x976454abUL, 0x9522eaf2UL, 0x94e080c5UL, + 0x9fbcc7f8UL, 0x9e7eadcfUL, 0x9c381396UL, 0x9dfa79a1UL, 0x98b56f24UL, + 0x99770513UL, 0x9b31bb4aUL, 0x9af3d17dUL, 0x8d893530UL, 0x8c4b5f07UL, + 0x8e0de15eUL, 0x8fcf8b69UL, 0x8a809decUL, 0x8b42f7dbUL, 0x89044982UL, + 0x88c623b5UL, 0x839a6488UL, 0x82580ebfUL, 0x801eb0e6UL, 0x81dcdad1UL, + 0x8493cc54UL, 0x8551a663UL, 0x8717183aUL, 0x86d5720dUL, 0xa9e2d0a0UL, + 0xa820ba97UL, 0xaa6604ceUL, 0xaba46ef9UL, 0xaeeb787cUL, 0xaf29124bUL, + 0xad6fac12UL, 0xacadc625UL, 0xa7f18118UL, 0xa633eb2fUL, 0xa4755576UL, + 0xa5b73f41UL, 0xa0f829c4UL, 0xa13a43f3UL, 0xa37cfdaaUL, 0xa2be979dUL, + 0xb5c473d0UL, 0xb40619e7UL, 0xb640a7beUL, 0xb782cd89UL, 0xb2cddb0cUL, + 0xb30fb13bUL, 0xb1490f62UL, 0xb08b6555UL, 0xbbd72268UL, 0xba15485fUL, + 0xb853f606UL, 0xb9919c31UL, 0xbcde8ab4UL, 0xbd1ce083UL, 0xbf5a5edaUL, + 0xbe9834edUL + }, + { + 0x00000000UL, 0xb8bc6765UL, 0xaa09c88bUL, 0x12b5afeeUL, 0x8f629757UL, + 0x37def032UL, 0x256b5fdcUL, 0x9dd738b9UL, 0xc5b428efUL, 0x7d084f8aUL, + 0x6fbde064UL, 0xd7018701UL, 0x4ad6bfb8UL, 0xf26ad8ddUL, 0xe0df7733UL, + 0x58631056UL, 0x5019579fUL, 0xe8a530faUL, 0xfa109f14UL, 0x42acf871UL, + 0xdf7bc0c8UL, 0x67c7a7adUL, 0x75720843UL, 0xcdce6f26UL, 0x95ad7f70UL, + 0x2d111815UL, 0x3fa4b7fbUL, 0x8718d09eUL, 0x1acfe827UL, 0xa2738f42UL, + 0xb0c620acUL, 0x087a47c9UL, 0xa032af3eUL, 0x188ec85bUL, 0x0a3b67b5UL, + 0xb28700d0UL, 0x2f503869UL, 0x97ec5f0cUL, 0x8559f0e2UL, 0x3de59787UL, + 0x658687d1UL, 0xdd3ae0b4UL, 0xcf8f4f5aUL, 0x7733283fUL, 0xeae41086UL, + 0x525877e3UL, 0x40edd80dUL, 0xf851bf68UL, 0xf02bf8a1UL, 0x48979fc4UL, + 0x5a22302aUL, 0xe29e574fUL, 0x7f496ff6UL, 0xc7f50893UL, 0xd540a77dUL, + 0x6dfcc018UL, 0x359fd04eUL, 0x8d23b72bUL, 0x9f9618c5UL, 0x272a7fa0UL, + 0xbafd4719UL, 0x0241207cUL, 0x10f48f92UL, 0xa848e8f7UL, 0x9b14583dUL, + 0x23a83f58UL, 0x311d90b6UL, 0x89a1f7d3UL, 0x1476cf6aUL, 0xaccaa80fUL, + 0xbe7f07e1UL, 0x06c36084UL, 0x5ea070d2UL, 0xe61c17b7UL, 0xf4a9b859UL, + 0x4c15df3cUL, 0xd1c2e785UL, 0x697e80e0UL, 0x7bcb2f0eUL, 0xc377486bUL, + 0xcb0d0fa2UL, 0x73b168c7UL, 0x6104c729UL, 0xd9b8a04cUL, 0x446f98f5UL, + 0xfcd3ff90UL, 0xee66507eUL, 0x56da371bUL, 0x0eb9274dUL, 0xb6054028UL, + 0xa4b0efc6UL, 0x1c0c88a3UL, 0x81dbb01aUL, 0x3967d77fUL, 0x2bd27891UL, + 0x936e1ff4UL, 0x3b26f703UL, 0x839a9066UL, 0x912f3f88UL, 0x299358edUL, + 0xb4446054UL, 0x0cf80731UL, 0x1e4da8dfUL, 0xa6f1cfbaUL, 0xfe92dfecUL, + 0x462eb889UL, 0x549b1767UL, 0xec277002UL, 0x71f048bbUL, 0xc94c2fdeUL, + 0xdbf98030UL, 0x6345e755UL, 0x6b3fa09cUL, 0xd383c7f9UL, 0xc1366817UL, + 0x798a0f72UL, 0xe45d37cbUL, 0x5ce150aeUL, 0x4e54ff40UL, 0xf6e89825UL, + 0xae8b8873UL, 0x1637ef16UL, 0x048240f8UL, 0xbc3e279dUL, 0x21e91f24UL, + 0x99557841UL, 0x8be0d7afUL, 0x335cb0caUL, 0xed59b63bUL, 0x55e5d15eUL, + 0x47507eb0UL, 0xffec19d5UL, 0x623b216cUL, 0xda874609UL, 0xc832e9e7UL, + 0x708e8e82UL, 0x28ed9ed4UL, 0x9051f9b1UL, 0x82e4565fUL, 0x3a58313aUL, + 0xa78f0983UL, 0x1f336ee6UL, 0x0d86c108UL, 0xb53aa66dUL, 0xbd40e1a4UL, + 0x05fc86c1UL, 0x1749292fUL, 0xaff54e4aUL, 0x322276f3UL, 0x8a9e1196UL, + 0x982bbe78UL, 0x2097d91dUL, 0x78f4c94bUL, 0xc048ae2eUL, 0xd2fd01c0UL, + 0x6a4166a5UL, 0xf7965e1cUL, 0x4f2a3979UL, 0x5d9f9697UL, 0xe523f1f2UL, + 0x4d6b1905UL, 0xf5d77e60UL, 0xe762d18eUL, 0x5fdeb6ebUL, 0xc2098e52UL, + 0x7ab5e937UL, 0x680046d9UL, 0xd0bc21bcUL, 0x88df31eaUL, 0x3063568fUL, + 0x22d6f961UL, 0x9a6a9e04UL, 0x07bda6bdUL, 0xbf01c1d8UL, 0xadb46e36UL, + 0x15080953UL, 0x1d724e9aUL, 0xa5ce29ffUL, 0xb77b8611UL, 0x0fc7e174UL, + 0x9210d9cdUL, 0x2aacbea8UL, 0x38191146UL, 0x80a57623UL, 0xd8c66675UL, + 0x607a0110UL, 0x72cfaefeUL, 0xca73c99bUL, 0x57a4f122UL, 0xef189647UL, + 0xfdad39a9UL, 0x45115eccUL, 0x764dee06UL, 0xcef18963UL, 0xdc44268dUL, + 0x64f841e8UL, 0xf92f7951UL, 0x41931e34UL, 0x5326b1daUL, 0xeb9ad6bfUL, + 0xb3f9c6e9UL, 0x0b45a18cUL, 0x19f00e62UL, 0xa14c6907UL, 0x3c9b51beUL, + 0x842736dbUL, 0x96929935UL, 0x2e2efe50UL, 0x2654b999UL, 0x9ee8defcUL, + 0x8c5d7112UL, 0x34e11677UL, 0xa9362eceUL, 0x118a49abUL, 0x033fe645UL, + 0xbb838120UL, 0xe3e09176UL, 0x5b5cf613UL, 0x49e959fdUL, 0xf1553e98UL, + 0x6c820621UL, 0xd43e6144UL, 0xc68bceaaUL, 0x7e37a9cfUL, 0xd67f4138UL, + 0x6ec3265dUL, 0x7c7689b3UL, 0xc4caeed6UL, 0x591dd66fUL, 0xe1a1b10aUL, + 0xf3141ee4UL, 0x4ba87981UL, 0x13cb69d7UL, 0xab770eb2UL, 0xb9c2a15cUL, + 0x017ec639UL, 0x9ca9fe80UL, 0x241599e5UL, 0x36a0360bUL, 0x8e1c516eUL, + 0x866616a7UL, 0x3eda71c2UL, 0x2c6fde2cUL, 0x94d3b949UL, 0x090481f0UL, + 0xb1b8e695UL, 0xa30d497bUL, 0x1bb12e1eUL, 0x43d23e48UL, 0xfb6e592dUL, + 0xe9dbf6c3UL, 0x516791a6UL, 0xccb0a91fUL, 0x740cce7aUL, 0x66b96194UL, + 0xde0506f1UL + }, + { + 0x00000000UL, 0x96300777UL, 0x2c610eeeUL, 0xba510999UL, 0x19c46d07UL, + 0x8ff46a70UL, 0x35a563e9UL, 0xa395649eUL, 0x3288db0eUL, 0xa4b8dc79UL, + 0x1ee9d5e0UL, 0x88d9d297UL, 0x2b4cb609UL, 0xbd7cb17eUL, 0x072db8e7UL, + 0x911dbf90UL, 0x6410b71dUL, 0xf220b06aUL, 0x4871b9f3UL, 0xde41be84UL, + 0x7dd4da1aUL, 0xebe4dd6dUL, 0x51b5d4f4UL, 0xc785d383UL, 0x56986c13UL, + 0xc0a86b64UL, 0x7af962fdUL, 0xecc9658aUL, 0x4f5c0114UL, 0xd96c0663UL, + 0x633d0ffaUL, 0xf50d088dUL, 0xc8206e3bUL, 0x5e10694cUL, 0xe44160d5UL, + 0x727167a2UL, 0xd1e4033cUL, 0x47d4044bUL, 0xfd850dd2UL, 0x6bb50aa5UL, + 0xfaa8b535UL, 0x6c98b242UL, 0xd6c9bbdbUL, 0x40f9bcacUL, 0xe36cd832UL, + 0x755cdf45UL, 0xcf0dd6dcUL, 0x593dd1abUL, 0xac30d926UL, 0x3a00de51UL, + 0x8051d7c8UL, 0x1661d0bfUL, 0xb5f4b421UL, 0x23c4b356UL, 0x9995bacfUL, + 0x0fa5bdb8UL, 0x9eb80228UL, 0x0888055fUL, 0xb2d90cc6UL, 0x24e90bb1UL, + 0x877c6f2fUL, 0x114c6858UL, 0xab1d61c1UL, 0x3d2d66b6UL, 0x9041dc76UL, + 0x0671db01UL, 0xbc20d298UL, 0x2a10d5efUL, 0x8985b171UL, 0x1fb5b606UL, + 0xa5e4bf9fUL, 0x33d4b8e8UL, 0xa2c90778UL, 0x34f9000fUL, 0x8ea80996UL, + 0x18980ee1UL, 0xbb0d6a7fUL, 0x2d3d6d08UL, 0x976c6491UL, 0x015c63e6UL, + 0xf4516b6bUL, 0x62616c1cUL, 0xd8306585UL, 0x4e0062f2UL, 0xed95066cUL, + 0x7ba5011bUL, 0xc1f40882UL, 0x57c40ff5UL, 0xc6d9b065UL, 0x50e9b712UL, + 0xeab8be8bUL, 0x7c88b9fcUL, 0xdf1ddd62UL, 0x492dda15UL, 0xf37cd38cUL, + 0x654cd4fbUL, 0x5861b24dUL, 0xce51b53aUL, 0x7400bca3UL, 0xe230bbd4UL, + 0x41a5df4aUL, 0xd795d83dUL, 0x6dc4d1a4UL, 0xfbf4d6d3UL, 0x6ae96943UL, + 0xfcd96e34UL, 0x468867adUL, 0xd0b860daUL, 0x732d0444UL, 0xe51d0333UL, + 0x5f4c0aaaUL, 0xc97c0dddUL, 0x3c710550UL, 0xaa410227UL, 0x10100bbeUL, + 0x86200cc9UL, 0x25b56857UL, 0xb3856f20UL, 0x09d466b9UL, 0x9fe461ceUL, + 0x0ef9de5eUL, 0x98c9d929UL, 0x2298d0b0UL, 0xb4a8d7c7UL, 0x173db359UL, + 0x810db42eUL, 0x3b5cbdb7UL, 0xad6cbac0UL, 0x2083b8edUL, 0xb6b3bf9aUL, + 0x0ce2b603UL, 0x9ad2b174UL, 0x3947d5eaUL, 0xaf77d29dUL, 0x1526db04UL, + 0x8316dc73UL, 0x120b63e3UL, 0x843b6494UL, 0x3e6a6d0dUL, 0xa85a6a7aUL, + 0x0bcf0ee4UL, 0x9dff0993UL, 0x27ae000aUL, 0xb19e077dUL, 0x44930ff0UL, + 0xd2a30887UL, 0x68f2011eUL, 0xfec20669UL, 0x5d5762f7UL, 0xcb676580UL, + 0x71366c19UL, 0xe7066b6eUL, 0x761bd4feUL, 0xe02bd389UL, 0x5a7ada10UL, + 0xcc4add67UL, 0x6fdfb9f9UL, 0xf9efbe8eUL, 0x43beb717UL, 0xd58eb060UL, + 0xe8a3d6d6UL, 0x7e93d1a1UL, 0xc4c2d838UL, 0x52f2df4fUL, 0xf167bbd1UL, + 0x6757bca6UL, 0xdd06b53fUL, 0x4b36b248UL, 0xda2b0dd8UL, 0x4c1b0aafUL, + 0xf64a0336UL, 0x607a0441UL, 0xc3ef60dfUL, 0x55df67a8UL, 0xef8e6e31UL, + 0x79be6946UL, 0x8cb361cbUL, 0x1a8366bcUL, 0xa0d26f25UL, 0x36e26852UL, + 0x95770cccUL, 0x03470bbbUL, 0xb9160222UL, 0x2f260555UL, 0xbe3bbac5UL, + 0x280bbdb2UL, 0x925ab42bUL, 0x046ab35cUL, 0xa7ffd7c2UL, 0x31cfd0b5UL, + 0x8b9ed92cUL, 0x1daede5bUL, 0xb0c2649bUL, 0x26f263ecUL, 0x9ca36a75UL, + 0x0a936d02UL, 0xa906099cUL, 0x3f360eebUL, 0x85670772UL, 0x13570005UL, + 0x824abf95UL, 0x147ab8e2UL, 0xae2bb17bUL, 0x381bb60cUL, 0x9b8ed292UL, + 0x0dbed5e5UL, 0xb7efdc7cUL, 0x21dfdb0bUL, 0xd4d2d386UL, 0x42e2d4f1UL, + 0xf8b3dd68UL, 0x6e83da1fUL, 0xcd16be81UL, 0x5b26b9f6UL, 0xe177b06fUL, + 0x7747b718UL, 0xe65a0888UL, 0x706a0fffUL, 0xca3b0666UL, 0x5c0b0111UL, + 0xff9e658fUL, 0x69ae62f8UL, 0xd3ff6b61UL, 0x45cf6c16UL, 0x78e20aa0UL, + 0xeed20dd7UL, 0x5483044eUL, 0xc2b30339UL, 0x612667a7UL, 0xf71660d0UL, + 0x4d476949UL, 0xdb776e3eUL, 0x4a6ad1aeUL, 0xdc5ad6d9UL, 0x660bdf40UL, + 0xf03bd837UL, 0x53aebca9UL, 0xc59ebbdeUL, 0x7fcfb247UL, 0xe9ffb530UL, + 0x1cf2bdbdUL, 0x8ac2bacaUL, 0x3093b353UL, 0xa6a3b424UL, 0x0536d0baUL, + 0x9306d7cdUL, 0x2957de54UL, 0xbf67d923UL, 0x2e7a66b3UL, 0xb84a61c4UL, + 0x021b685dUL, 0x942b6f2aUL, 0x37be0bb4UL, 0xa18e0cc3UL, 0x1bdf055aUL, + 0x8def022dUL + }, + { + 0x00000000UL, 0x41311b19UL, 0x82623632UL, 0xc3532d2bUL, 0x04c56c64UL, + 0x45f4777dUL, 0x86a75a56UL, 0xc796414fUL, 0x088ad9c8UL, 0x49bbc2d1UL, + 0x8ae8effaUL, 0xcbd9f4e3UL, 0x0c4fb5acUL, 0x4d7eaeb5UL, 0x8e2d839eUL, + 0xcf1c9887UL, 0x5112c24aUL, 0x1023d953UL, 0xd370f478UL, 0x9241ef61UL, + 0x55d7ae2eUL, 0x14e6b537UL, 0xd7b5981cUL, 0x96848305UL, 0x59981b82UL, + 0x18a9009bUL, 0xdbfa2db0UL, 0x9acb36a9UL, 0x5d5d77e6UL, 0x1c6c6cffUL, + 0xdf3f41d4UL, 0x9e0e5acdUL, 0xa2248495UL, 0xe3159f8cUL, 0x2046b2a7UL, + 0x6177a9beUL, 0xa6e1e8f1UL, 0xe7d0f3e8UL, 0x2483dec3UL, 0x65b2c5daUL, + 0xaaae5d5dUL, 0xeb9f4644UL, 0x28cc6b6fUL, 0x69fd7076UL, 0xae6b3139UL, + 0xef5a2a20UL, 0x2c09070bUL, 0x6d381c12UL, 0xf33646dfUL, 0xb2075dc6UL, + 0x715470edUL, 0x30656bf4UL, 0xf7f32abbUL, 0xb6c231a2UL, 0x75911c89UL, + 0x34a00790UL, 0xfbbc9f17UL, 0xba8d840eUL, 0x79dea925UL, 0x38efb23cUL, + 0xff79f373UL, 0xbe48e86aUL, 0x7d1bc541UL, 0x3c2ade58UL, 0x054f79f0UL, + 0x447e62e9UL, 0x872d4fc2UL, 0xc61c54dbUL, 0x018a1594UL, 0x40bb0e8dUL, + 0x83e823a6UL, 0xc2d938bfUL, 0x0dc5a038UL, 0x4cf4bb21UL, 0x8fa7960aUL, + 0xce968d13UL, 0x0900cc5cUL, 0x4831d745UL, 0x8b62fa6eUL, 0xca53e177UL, + 0x545dbbbaUL, 0x156ca0a3UL, 0xd63f8d88UL, 0x970e9691UL, 0x5098d7deUL, + 0x11a9ccc7UL, 0xd2fae1ecUL, 0x93cbfaf5UL, 0x5cd76272UL, 0x1de6796bUL, + 0xdeb55440UL, 0x9f844f59UL, 0x58120e16UL, 0x1923150fUL, 0xda703824UL, + 0x9b41233dUL, 0xa76bfd65UL, 0xe65ae67cUL, 0x2509cb57UL, 0x6438d04eUL, + 0xa3ae9101UL, 0xe29f8a18UL, 0x21cca733UL, 0x60fdbc2aUL, 0xafe124adUL, + 0xeed03fb4UL, 0x2d83129fUL, 0x6cb20986UL, 0xab2448c9UL, 0xea1553d0UL, + 0x29467efbUL, 0x687765e2UL, 0xf6793f2fUL, 0xb7482436UL, 0x741b091dUL, + 0x352a1204UL, 0xf2bc534bUL, 0xb38d4852UL, 0x70de6579UL, 0x31ef7e60UL, + 0xfef3e6e7UL, 0xbfc2fdfeUL, 0x7c91d0d5UL, 0x3da0cbccUL, 0xfa368a83UL, + 0xbb07919aUL, 0x7854bcb1UL, 0x3965a7a8UL, 0x4b98833bUL, 0x0aa99822UL, + 0xc9fab509UL, 0x88cbae10UL, 0x4f5def5fUL, 0x0e6cf446UL, 0xcd3fd96dUL, + 0x8c0ec274UL, 0x43125af3UL, 0x022341eaUL, 0xc1706cc1UL, 0x804177d8UL, + 0x47d73697UL, 0x06e62d8eUL, 0xc5b500a5UL, 0x84841bbcUL, 0x1a8a4171UL, + 0x5bbb5a68UL, 0x98e87743UL, 0xd9d96c5aUL, 0x1e4f2d15UL, 0x5f7e360cUL, + 0x9c2d1b27UL, 0xdd1c003eUL, 0x120098b9UL, 0x533183a0UL, 0x9062ae8bUL, + 0xd153b592UL, 0x16c5f4ddUL, 0x57f4efc4UL, 0x94a7c2efUL, 0xd596d9f6UL, + 0xe9bc07aeUL, 0xa88d1cb7UL, 0x6bde319cUL, 0x2aef2a85UL, 0xed796bcaUL, + 0xac4870d3UL, 0x6f1b5df8UL, 0x2e2a46e1UL, 0xe136de66UL, 0xa007c57fUL, + 0x6354e854UL, 0x2265f34dUL, 0xe5f3b202UL, 0xa4c2a91bUL, 0x67918430UL, + 0x26a09f29UL, 0xb8aec5e4UL, 0xf99fdefdUL, 0x3accf3d6UL, 0x7bfde8cfUL, + 0xbc6ba980UL, 0xfd5ab299UL, 0x3e099fb2UL, 0x7f3884abUL, 0xb0241c2cUL, + 0xf1150735UL, 0x32462a1eUL, 0x73773107UL, 0xb4e17048UL, 0xf5d06b51UL, + 0x3683467aUL, 0x77b25d63UL, 0x4ed7facbUL, 0x0fe6e1d2UL, 0xccb5ccf9UL, + 0x8d84d7e0UL, 0x4a1296afUL, 0x0b238db6UL, 0xc870a09dUL, 0x8941bb84UL, + 0x465d2303UL, 0x076c381aUL, 0xc43f1531UL, 0x850e0e28UL, 0x42984f67UL, + 0x03a9547eUL, 0xc0fa7955UL, 0x81cb624cUL, 0x1fc53881UL, 0x5ef42398UL, + 0x9da70eb3UL, 0xdc9615aaUL, 0x1b0054e5UL, 0x5a314ffcUL, 0x996262d7UL, + 0xd85379ceUL, 0x174fe149UL, 0x567efa50UL, 0x952dd77bUL, 0xd41ccc62UL, + 0x138a8d2dUL, 0x52bb9634UL, 0x91e8bb1fUL, 0xd0d9a006UL, 0xecf37e5eUL, + 0xadc26547UL, 0x6e91486cUL, 0x2fa05375UL, 0xe836123aUL, 0xa9070923UL, + 0x6a542408UL, 0x2b653f11UL, 0xe479a796UL, 0xa548bc8fUL, 0x661b91a4UL, + 0x272a8abdUL, 0xe0bccbf2UL, 0xa18dd0ebUL, 0x62defdc0UL, 0x23efe6d9UL, + 0xbde1bc14UL, 0xfcd0a70dUL, 0x3f838a26UL, 0x7eb2913fUL, 0xb924d070UL, + 0xf815cb69UL, 0x3b46e642UL, 0x7a77fd5bUL, 0xb56b65dcUL, 0xf45a7ec5UL, + 0x370953eeUL, 0x763848f7UL, 0xb1ae09b8UL, 0xf09f12a1UL, 0x33cc3f8aUL, + 0x72fd2493UL + }, + { + 0x00000000UL, 0x376ac201UL, 0x6ed48403UL, 0x59be4602UL, 0xdca80907UL, + 0xebc2cb06UL, 0xb27c8d04UL, 0x85164f05UL, 0xb851130eUL, 0x8f3bd10fUL, + 0xd685970dUL, 0xe1ef550cUL, 0x64f91a09UL, 0x5393d808UL, 0x0a2d9e0aUL, + 0x3d475c0bUL, 0x70a3261cUL, 0x47c9e41dUL, 0x1e77a21fUL, 0x291d601eUL, + 0xac0b2f1bUL, 0x9b61ed1aUL, 0xc2dfab18UL, 0xf5b56919UL, 0xc8f23512UL, + 0xff98f713UL, 0xa626b111UL, 0x914c7310UL, 0x145a3c15UL, 0x2330fe14UL, + 0x7a8eb816UL, 0x4de47a17UL, 0xe0464d38UL, 0xd72c8f39UL, 0x8e92c93bUL, + 0xb9f80b3aUL, 0x3cee443fUL, 0x0b84863eUL, 0x523ac03cUL, 0x6550023dUL, + 0x58175e36UL, 0x6f7d9c37UL, 0x36c3da35UL, 0x01a91834UL, 0x84bf5731UL, + 0xb3d59530UL, 0xea6bd332UL, 0xdd011133UL, 0x90e56b24UL, 0xa78fa925UL, + 0xfe31ef27UL, 0xc95b2d26UL, 0x4c4d6223UL, 0x7b27a022UL, 0x2299e620UL, + 0x15f32421UL, 0x28b4782aUL, 0x1fdeba2bUL, 0x4660fc29UL, 0x710a3e28UL, + 0xf41c712dUL, 0xc376b32cUL, 0x9ac8f52eUL, 0xada2372fUL, 0xc08d9a70UL, + 0xf7e75871UL, 0xae591e73UL, 0x9933dc72UL, 0x1c259377UL, 0x2b4f5176UL, + 0x72f11774UL, 0x459bd575UL, 0x78dc897eUL, 0x4fb64b7fUL, 0x16080d7dUL, + 0x2162cf7cUL, 0xa4748079UL, 0x931e4278UL, 0xcaa0047aUL, 0xfdcac67bUL, + 0xb02ebc6cUL, 0x87447e6dUL, 0xdefa386fUL, 0xe990fa6eUL, 0x6c86b56bUL, + 0x5bec776aUL, 0x02523168UL, 0x3538f369UL, 0x087faf62UL, 0x3f156d63UL, + 0x66ab2b61UL, 0x51c1e960UL, 0xd4d7a665UL, 0xe3bd6464UL, 0xba032266UL, + 0x8d69e067UL, 0x20cbd748UL, 0x17a11549UL, 0x4e1f534bUL, 0x7975914aUL, + 0xfc63de4fUL, 0xcb091c4eUL, 0x92b75a4cUL, 0xa5dd984dUL, 0x989ac446UL, + 0xaff00647UL, 0xf64e4045UL, 0xc1248244UL, 0x4432cd41UL, 0x73580f40UL, + 0x2ae64942UL, 0x1d8c8b43UL, 0x5068f154UL, 0x67023355UL, 0x3ebc7557UL, + 0x09d6b756UL, 0x8cc0f853UL, 0xbbaa3a52UL, 0xe2147c50UL, 0xd57ebe51UL, + 0xe839e25aUL, 0xdf53205bUL, 0x86ed6659UL, 0xb187a458UL, 0x3491eb5dUL, + 0x03fb295cUL, 0x5a456f5eUL, 0x6d2fad5fUL, 0x801b35e1UL, 0xb771f7e0UL, + 0xeecfb1e2UL, 0xd9a573e3UL, 0x5cb33ce6UL, 0x6bd9fee7UL, 0x3267b8e5UL, + 0x050d7ae4UL, 0x384a26efUL, 0x0f20e4eeUL, 0x569ea2ecUL, 0x61f460edUL, + 0xe4e22fe8UL, 0xd388ede9UL, 0x8a36abebUL, 0xbd5c69eaUL, 0xf0b813fdUL, + 0xc7d2d1fcUL, 0x9e6c97feUL, 0xa90655ffUL, 0x2c101afaUL, 0x1b7ad8fbUL, + 0x42c49ef9UL, 0x75ae5cf8UL, 0x48e900f3UL, 0x7f83c2f2UL, 0x263d84f0UL, + 0x115746f1UL, 0x944109f4UL, 0xa32bcbf5UL, 0xfa958df7UL, 0xcdff4ff6UL, + 0x605d78d9UL, 0x5737bad8UL, 0x0e89fcdaUL, 0x39e33edbUL, 0xbcf571deUL, + 0x8b9fb3dfUL, 0xd221f5ddUL, 0xe54b37dcUL, 0xd80c6bd7UL, 0xef66a9d6UL, + 0xb6d8efd4UL, 0x81b22dd5UL, 0x04a462d0UL, 0x33cea0d1UL, 0x6a70e6d3UL, + 0x5d1a24d2UL, 0x10fe5ec5UL, 0x27949cc4UL, 0x7e2adac6UL, 0x494018c7UL, + 0xcc5657c2UL, 0xfb3c95c3UL, 0xa282d3c1UL, 0x95e811c0UL, 0xa8af4dcbUL, + 0x9fc58fcaUL, 0xc67bc9c8UL, 0xf1110bc9UL, 0x740744ccUL, 0x436d86cdUL, + 0x1ad3c0cfUL, 0x2db902ceUL, 0x4096af91UL, 0x77fc6d90UL, 0x2e422b92UL, + 0x1928e993UL, 0x9c3ea696UL, 0xab546497UL, 0xf2ea2295UL, 0xc580e094UL, + 0xf8c7bc9fUL, 0xcfad7e9eUL, 0x9613389cUL, 0xa179fa9dUL, 0x246fb598UL, + 0x13057799UL, 0x4abb319bUL, 0x7dd1f39aUL, 0x3035898dUL, 0x075f4b8cUL, + 0x5ee10d8eUL, 0x698bcf8fUL, 0xec9d808aUL, 0xdbf7428bUL, 0x82490489UL, + 0xb523c688UL, 0x88649a83UL, 0xbf0e5882UL, 0xe6b01e80UL, 0xd1dadc81UL, + 0x54cc9384UL, 0x63a65185UL, 0x3a181787UL, 0x0d72d586UL, 0xa0d0e2a9UL, + 0x97ba20a8UL, 0xce0466aaUL, 0xf96ea4abUL, 0x7c78ebaeUL, 0x4b1229afUL, + 0x12ac6fadUL, 0x25c6adacUL, 0x1881f1a7UL, 0x2feb33a6UL, 0x765575a4UL, + 0x413fb7a5UL, 0xc429f8a0UL, 0xf3433aa1UL, 0xaafd7ca3UL, 0x9d97bea2UL, + 0xd073c4b5UL, 0xe71906b4UL, 0xbea740b6UL, 0x89cd82b7UL, 0x0cdbcdb2UL, + 0x3bb10fb3UL, 0x620f49b1UL, 0x55658bb0UL, 0x6822d7bbUL, 0x5f4815baUL, + 0x06f653b8UL, 0x319c91b9UL, 0xb48adebcUL, 0x83e01cbdUL, 0xda5e5abfUL, + 0xed3498beUL + }, + { + 0x00000000UL, 0x6567bcb8UL, 0x8bc809aaUL, 0xeeafb512UL, 0x5797628fUL, + 0x32f0de37UL, 0xdc5f6b25UL, 0xb938d79dUL, 0xef28b4c5UL, 0x8a4f087dUL, + 0x64e0bd6fUL, 0x018701d7UL, 0xb8bfd64aUL, 0xddd86af2UL, 0x3377dfe0UL, + 0x56106358UL, 0x9f571950UL, 0xfa30a5e8UL, 0x149f10faUL, 0x71f8ac42UL, + 0xc8c07bdfUL, 0xada7c767UL, 0x43087275UL, 0x266fcecdUL, 0x707fad95UL, + 0x1518112dUL, 0xfbb7a43fUL, 0x9ed01887UL, 0x27e8cf1aUL, 0x428f73a2UL, + 0xac20c6b0UL, 0xc9477a08UL, 0x3eaf32a0UL, 0x5bc88e18UL, 0xb5673b0aUL, + 0xd00087b2UL, 0x6938502fUL, 0x0c5fec97UL, 0xe2f05985UL, 0x8797e53dUL, + 0xd1878665UL, 0xb4e03addUL, 0x5a4f8fcfUL, 0x3f283377UL, 0x8610e4eaUL, + 0xe3775852UL, 0x0dd8ed40UL, 0x68bf51f8UL, 0xa1f82bf0UL, 0xc49f9748UL, + 0x2a30225aUL, 0x4f579ee2UL, 0xf66f497fUL, 0x9308f5c7UL, 0x7da740d5UL, + 0x18c0fc6dUL, 0x4ed09f35UL, 0x2bb7238dUL, 0xc518969fUL, 0xa07f2a27UL, + 0x1947fdbaUL, 0x7c204102UL, 0x928ff410UL, 0xf7e848a8UL, 0x3d58149bUL, + 0x583fa823UL, 0xb6901d31UL, 0xd3f7a189UL, 0x6acf7614UL, 0x0fa8caacUL, + 0xe1077fbeUL, 0x8460c306UL, 0xd270a05eUL, 0xb7171ce6UL, 0x59b8a9f4UL, + 0x3cdf154cUL, 0x85e7c2d1UL, 0xe0807e69UL, 0x0e2fcb7bUL, 0x6b4877c3UL, + 0xa20f0dcbUL, 0xc768b173UL, 0x29c70461UL, 0x4ca0b8d9UL, 0xf5986f44UL, + 0x90ffd3fcUL, 0x7e5066eeUL, 0x1b37da56UL, 0x4d27b90eUL, 0x284005b6UL, + 0xc6efb0a4UL, 0xa3880c1cUL, 0x1ab0db81UL, 0x7fd76739UL, 0x9178d22bUL, + 0xf41f6e93UL, 0x03f7263bUL, 0x66909a83UL, 0x883f2f91UL, 0xed589329UL, + 0x546044b4UL, 0x3107f80cUL, 0xdfa84d1eUL, 0xbacff1a6UL, 0xecdf92feUL, + 0x89b82e46UL, 0x67179b54UL, 0x027027ecUL, 0xbb48f071UL, 0xde2f4cc9UL, + 0x3080f9dbUL, 0x55e74563UL, 0x9ca03f6bUL, 0xf9c783d3UL, 0x176836c1UL, + 0x720f8a79UL, 0xcb375de4UL, 0xae50e15cUL, 0x40ff544eUL, 0x2598e8f6UL, + 0x73888baeUL, 0x16ef3716UL, 0xf8408204UL, 0x9d273ebcUL, 0x241fe921UL, + 0x41785599UL, 0xafd7e08bUL, 0xcab05c33UL, 0x3bb659edUL, 0x5ed1e555UL, + 0xb07e5047UL, 0xd519ecffUL, 0x6c213b62UL, 0x094687daUL, 0xe7e932c8UL, + 0x828e8e70UL, 0xd49eed28UL, 0xb1f95190UL, 0x5f56e482UL, 0x3a31583aUL, + 0x83098fa7UL, 0xe66e331fUL, 0x08c1860dUL, 0x6da63ab5UL, 0xa4e140bdUL, + 0xc186fc05UL, 0x2f294917UL, 0x4a4ef5afUL, 0xf3762232UL, 0x96119e8aUL, + 0x78be2b98UL, 0x1dd99720UL, 0x4bc9f478UL, 0x2eae48c0UL, 0xc001fdd2UL, + 0xa566416aUL, 0x1c5e96f7UL, 0x79392a4fUL, 0x97969f5dUL, 0xf2f123e5UL, + 0x05196b4dUL, 0x607ed7f5UL, 0x8ed162e7UL, 0xebb6de5fUL, 0x528e09c2UL, + 0x37e9b57aUL, 0xd9460068UL, 0xbc21bcd0UL, 0xea31df88UL, 0x8f566330UL, + 0x61f9d622UL, 0x049e6a9aUL, 0xbda6bd07UL, 0xd8c101bfUL, 0x366eb4adUL, + 0x53090815UL, 0x9a4e721dUL, 0xff29cea5UL, 0x11867bb7UL, 0x74e1c70fUL, + 0xcdd91092UL, 0xa8beac2aUL, 0x46111938UL, 0x2376a580UL, 0x7566c6d8UL, + 0x10017a60UL, 0xfeaecf72UL, 0x9bc973caUL, 0x22f1a457UL, 0x479618efUL, + 0xa939adfdUL, 0xcc5e1145UL, 0x06ee4d76UL, 0x6389f1ceUL, 0x8d2644dcUL, + 0xe841f864UL, 0x51792ff9UL, 0x341e9341UL, 0xdab12653UL, 0xbfd69aebUL, + 0xe9c6f9b3UL, 0x8ca1450bUL, 0x620ef019UL, 0x07694ca1UL, 0xbe519b3cUL, + 0xdb362784UL, 0x35999296UL, 0x50fe2e2eUL, 0x99b95426UL, 0xfcdee89eUL, + 0x12715d8cUL, 0x7716e134UL, 0xce2e36a9UL, 0xab498a11UL, 0x45e63f03UL, + 0x208183bbUL, 0x7691e0e3UL, 0x13f65c5bUL, 0xfd59e949UL, 0x983e55f1UL, + 0x2106826cUL, 0x44613ed4UL, 0xaace8bc6UL, 0xcfa9377eUL, 0x38417fd6UL, + 0x5d26c36eUL, 0xb389767cUL, 0xd6eecac4UL, 0x6fd61d59UL, 0x0ab1a1e1UL, + 0xe41e14f3UL, 0x8179a84bUL, 0xd769cb13UL, 0xb20e77abUL, 0x5ca1c2b9UL, + 0x39c67e01UL, 0x80fea99cUL, 0xe5991524UL, 0x0b36a036UL, 0x6e511c8eUL, + 0xa7166686UL, 0xc271da3eUL, 0x2cde6f2cUL, 0x49b9d394UL, 0xf0810409UL, + 0x95e6b8b1UL, 0x7b490da3UL, 0x1e2eb11bUL, 0x483ed243UL, 0x2d596efbUL, + 0xc3f6dbe9UL, 0xa6916751UL, 0x1fa9b0ccUL, 0x7ace0c74UL, 0x9461b966UL, + 0xf10605deUL +#endif + } +}; diff --git a/dep/StormLib/src/zlib/deflate.c b/dep/StormLib/src/zlib/deflate.c new file mode 100644 index 00000000000..29ce1f64a57 --- /dev/null +++ b/dep/StormLib/src/zlib/deflate.c @@ -0,0 +1,1736 @@ +/* deflate.c -- compress data using the deflation algorithm + * Copyright (C) 1995-2005 Jean-loup Gailly. + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* + * ALGORITHM + * + * The "deflation" process depends on being able to identify portions + * of the input text which are identical to earlier input (within a + * sliding window trailing behind the input currently being processed). + * + * The most straightforward technique turns out to be the fastest for + * most input files: try all possible matches and select the longest. + * The key feature of this algorithm is that insertions into the string + * dictionary are very simple and thus fast, and deletions are avoided + * completely. Insertions are performed at each input character, whereas + * string matches are performed only when the previous match ends. So it + * is preferable to spend more time in matches to allow very fast string + * insertions and avoid deletions. The matching algorithm for small + * strings is inspired from that of Rabin & Karp. A brute force approach + * is used to find longer strings when a small match has been found. + * A similar algorithm is used in comic (by Jan-Mark Wams) and freeze + * (by Leonid Broukhis). + * A previous version of this file used a more sophisticated algorithm + * (by Fiala and Greene) which is guaranteed to run in linear amortized + * time, but has a larger average cost, uses more memory and is patented. + * However the F&G algorithm may be faster for some highly redundant + * files if the parameter max_chain_length (described below) is too large. + * + * ACKNOWLEDGEMENTS + * + * The idea of lazy evaluation of matches is due to Jan-Mark Wams, and + * I found it in 'freeze' written by Leonid Broukhis. + * Thanks to many people for bug reports and testing. + * + * REFERENCES + * + * Deutsch, L.P.,"DEFLATE Compressed Data Format Specification". + * Available in http://www.ietf.org/rfc/rfc1951.txt + * + * A description of the Rabin and Karp algorithm is given in the book + * "Algorithms" by R. Sedgewick, Addison-Wesley, p252. + * + * Fiala,E.R., and Greene,D.H. + * Data Compression with Finite Windows, Comm.ACM, 32,4 (1989) 490-595 + * + */ + +/* @(#) $Id$ */ + +#include "deflate.h" + +const char deflate_copyright[] = + " deflate 1.2.3 Copyright 1995-2005 Jean-loup Gailly "; +/* + If you use the zlib library in a product, an acknowledgment is welcome + in the documentation of your product. If for some reason you cannot + include such an acknowledgment, I would appreciate that you keep this + copyright string in the executable of your product. + */ + +/* =========================================================================== + * Function prototypes. + */ +typedef enum { + need_more, /* block not completed, need more input or more output */ + block_done, /* block flush performed */ + finish_started, /* finish started, need only more output at next deflate */ + finish_done /* finish done, accept no more input or output */ +} block_state; + +typedef block_state (*compress_func) OF((deflate_state *s, int flush)); +/* Compression function. Returns the block state after the call. */ + +local void fill_window OF((deflate_state *s)); +local block_state deflate_stored OF((deflate_state *s, int flush)); +local block_state deflate_fast OF((deflate_state *s, int flush)); +#ifndef FASTEST +local block_state deflate_slow OF((deflate_state *s, int flush)); +#endif +local void lm_init OF((deflate_state *s)); +local void putShortMSB OF((deflate_state *s, uInt b)); +local void flush_pending OF((z_streamp strm)); +local int read_buf OF((z_streamp strm, Bytef *buf, unsigned size)); +#ifndef FASTEST +#ifdef ASMV + void match_init OF((void)); /* asm code initialization */ + uInt longest_match OF((deflate_state *s, IPos cur_match)); +#else +local uInt longest_match OF((deflate_state *s, IPos cur_match)); +#endif +#endif +local uInt longest_match_fast OF((deflate_state *s, IPos cur_match)); + +#ifdef DEBUG +local void check_match OF((deflate_state *s, IPos start, IPos match, + int length)); +#endif + +/* =========================================================================== + * Local data + */ + +#define NIL 0 +/* Tail of hash chains */ + +#ifndef TOO_FAR +# define TOO_FAR 4096 +#endif +/* Matches of length 3 are discarded if their distance exceeds TOO_FAR */ + +#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1) +/* Minimum amount of lookahead, except at the end of the input file. + * See deflate.c for comments about the MIN_MATCH+1. + */ + +/* Values for max_lazy_match, good_match and max_chain_length, depending on + * the desired pack level (0..9). The values given below have been tuned to + * exclude worst case performance for pathological files. Better values may be + * found for specific files. + */ +typedef struct config_s { + ush good_length; /* reduce lazy search above this match length */ + ush max_lazy; /* do not perform lazy search above this match length */ + ush nice_length; /* quit search above this match length */ + ush max_chain; + compress_func func; +} config; + +#ifdef FASTEST +local const config configuration_table[2] = { +/* good lazy nice chain */ +/* 0 */ {0, 0, 0, 0, deflate_stored}, /* store only */ +/* 1 */ {4, 4, 8, 4, deflate_fast}}; /* max speed, no lazy matches */ +#else +local const config configuration_table[10] = { +/* good lazy nice chain */ +/* 0 */ {0, 0, 0, 0, deflate_stored}, /* store only */ +/* 1 */ {4, 4, 8, 4, deflate_fast}, /* max speed, no lazy matches */ +/* 2 */ {4, 5, 16, 8, deflate_fast}, +/* 3 */ {4, 6, 32, 32, deflate_fast}, + +/* 4 */ {4, 4, 16, 16, deflate_slow}, /* lazy matches */ +/* 5 */ {8, 16, 32, 32, deflate_slow}, +/* 6 */ {8, 16, 128, 128, deflate_slow}, +/* 7 */ {8, 32, 128, 256, deflate_slow}, +/* 8 */ {32, 128, 258, 1024, deflate_slow}, +/* 9 */ {32, 258, 258, 4096, deflate_slow}}; /* max compression */ +#endif + +/* Note: the deflate() code requires max_lazy >= MIN_MATCH and max_chain >= 4 + * For deflate_fast() (levels <= 3) good is ignored and lazy has a different + * meaning. + */ + +#define EQUAL 0 +/* result of memcmp for equal strings */ + +#ifndef NO_DUMMY_DECL +struct static_tree_desc_s {int dummy;}; /* for buggy compilers */ +#endif + +/* =========================================================================== + * Update a hash value with the given input byte + * IN assertion: all calls to to UPDATE_HASH are made with consecutive + * input characters, so that a running hash key can be computed from the + * previous key instead of complete recalculation each time. + */ +#define UPDATE_HASH(s,h,c) (h = (((h)<hash_shift) ^ (c)) & s->hash_mask) + + +/* =========================================================================== + * Insert string str in the dictionary and set match_head to the previous head + * of the hash chain (the most recent string with same hash key). Return + * the previous length of the hash chain. + * If this file is compiled with -DFASTEST, the compression level is forced + * to 1, and no hash chains are maintained. + * IN assertion: all calls to to INSERT_STRING are made with consecutive + * input characters and the first MIN_MATCH bytes of str are valid + * (except for the last MIN_MATCH-1 bytes of the input file). + */ +#ifdef FASTEST +#define INSERT_STRING(s, str, match_head) \ + (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \ + match_head = s->head[s->ins_h], \ + s->head[s->ins_h] = (Pos)(str)) +#else +#define INSERT_STRING(s, str, match_head) \ + (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \ + match_head = s->prev[(str) & s->w_mask] = s->head[s->ins_h], \ + s->head[s->ins_h] = (Pos)(str)) +#endif + +/* =========================================================================== + * Initialize the hash table (avoiding 64K overflow for 16 bit systems). + * prev[] will be initialized on the fly. + */ +#define CLEAR_HASH(s) \ + s->head[s->hash_size-1] = NIL; \ + zmemzero((Bytef *)s->head, (unsigned)(s->hash_size-1)*sizeof(*s->head)); + +/* ========================================================================= */ +int ZEXPORT deflateInit_(strm, level, version, stream_size) + z_streamp strm; + int level; + const char *version; + int stream_size; +{ + return deflateInit2_(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, + Z_DEFAULT_STRATEGY, version, stream_size); + /* To do: ignore strm->next_in if we use it as window */ +} + +/* ========================================================================= */ +int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, + version, stream_size) + z_streamp strm; + int level; + int method; + int windowBits; + int memLevel; + int strategy; + const char *version; + int stream_size; +{ + deflate_state *s; + int wrap = 1; + static const char my_version[] = ZLIB_VERSION; + + ushf *overlay; + /* We overlay pending_buf and d_buf+l_buf. This works since the average + * output size for (length,distance) codes is <= 24 bits. + */ + + if (version == Z_NULL || version[0] != my_version[0] || + stream_size != sizeof(z_stream)) { + return Z_VERSION_ERROR; + } + if (strm == Z_NULL) return Z_STREAM_ERROR; + + strm->msg = Z_NULL; + if (strm->zalloc == (alloc_func)0) { + strm->zalloc = zcalloc; + strm->opaque = (voidpf)0; + } + if (strm->zfree == (free_func)0) strm->zfree = zcfree; + +#ifdef FASTEST + if (level != 0) level = 1; +#else + if (level == Z_DEFAULT_COMPRESSION) level = 6; +#endif + + if (windowBits < 0) { /* suppress zlib wrapper */ + wrap = 0; + windowBits = -windowBits; + } +#ifdef GZIP + else if (windowBits > 15) { + wrap = 2; /* write gzip wrapper instead */ + windowBits -= 16; + } +#endif + if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED || + windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || + strategy < 0 || strategy > Z_FIXED) { + return Z_STREAM_ERROR; + } + if (windowBits == 8) windowBits = 9; /* until 256-byte window bug fixed */ + s = (deflate_state *) ZALLOC(strm, 1, sizeof(deflate_state)); + if (s == Z_NULL) return Z_MEM_ERROR; + strm->state = (struct internal_state FAR *)s; + s->strm = strm; + + s->wrap = wrap; + s->gzhead = Z_NULL; + s->w_bits = windowBits; + s->w_size = 1 << s->w_bits; + s->w_mask = s->w_size - 1; + + s->hash_bits = memLevel + 7; + s->hash_size = 1 << s->hash_bits; + s->hash_mask = s->hash_size - 1; + s->hash_shift = ((s->hash_bits+MIN_MATCH-1)/MIN_MATCH); + + s->window = (Bytef *) ZALLOC(strm, s->w_size, 2*sizeof(Byte)); + s->prev = (Posf *) ZALLOC(strm, s->w_size, sizeof(Pos)); + s->head = (Posf *) ZALLOC(strm, s->hash_size, sizeof(Pos)); + + s->lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */ + + overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2); + s->pending_buf = (uchf *) overlay; + s->pending_buf_size = (ulg)s->lit_bufsize * (sizeof(ush)+2L); + + if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL || + s->pending_buf == Z_NULL) { + s->status = FINISH_STATE; + strm->msg = (char*)ERR_MSG(Z_MEM_ERROR); + deflateEnd (strm); + return Z_MEM_ERROR; + } + s->d_buf = overlay + s->lit_bufsize/sizeof(ush); + s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize; + + s->level = level; + s->strategy = strategy; + s->method = (Byte)method; + + return deflateReset(strm); +} + +/* ========================================================================= */ +int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength) + z_streamp strm; + const Bytef *dictionary; + uInt dictLength; +{ + deflate_state *s; + uInt length = dictLength; + uInt n; + IPos hash_head = 0; + + if (strm == Z_NULL || strm->state == Z_NULL || dictionary == Z_NULL || + strm->state->wrap == 2 || + (strm->state->wrap == 1 && strm->state->status != INIT_STATE)) + return Z_STREAM_ERROR; + + s = strm->state; + if (s->wrap) + strm->adler = adler32(strm->adler, dictionary, dictLength); + + if (length < MIN_MATCH) return Z_OK; + if (length > MAX_DIST(s)) { + length = MAX_DIST(s); + dictionary += dictLength - length; /* use the tail of the dictionary */ + } + zmemcpy(s->window, dictionary, length); + s->strstart = length; + s->block_start = (long)length; + + /* Insert all strings in the hash table (except for the last two bytes). + * s->lookahead stays null, so s->ins_h will be recomputed at the next + * call of fill_window. + */ + s->ins_h = s->window[0]; + UPDATE_HASH(s, s->ins_h, s->window[1]); + for (n = 0; n <= length - MIN_MATCH; n++) { + INSERT_STRING(s, n, hash_head); + } + if (hash_head) hash_head = 0; /* to make compiler happy */ + return Z_OK; +} + +/* ========================================================================= */ +int ZEXPORT deflateReset (strm) + z_streamp strm; +{ + deflate_state *s; + + if (strm == Z_NULL || strm->state == Z_NULL || + strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0) { + return Z_STREAM_ERROR; + } + + strm->total_in = strm->total_out = 0; + strm->msg = Z_NULL; /* use zfree if we ever allocate msg dynamically */ + strm->data_type = Z_UNKNOWN; + + s = (deflate_state *)strm->state; + s->pending = 0; + s->pending_out = s->pending_buf; + + if (s->wrap < 0) { + s->wrap = -s->wrap; /* was made negative by deflate(..., Z_FINISH); */ + } + s->status = s->wrap ? INIT_STATE : BUSY_STATE; + strm->adler = +#ifdef GZIP + s->wrap == 2 ? crc32(0L, Z_NULL, 0) : +#endif + adler32(0L, Z_NULL, 0); + s->last_flush = Z_NO_FLUSH; + + _tr_init(s); + lm_init(s); + + return Z_OK; +} + +/* ========================================================================= */ +int ZEXPORT deflateSetHeader (strm, head) + z_streamp strm; + gz_headerp head; +{ + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + if (strm->state->wrap != 2) return Z_STREAM_ERROR; + strm->state->gzhead = head; + return Z_OK; +} + +/* ========================================================================= */ +int ZEXPORT deflatePrime (strm, bits, value) + z_streamp strm; + int bits; + int value; +{ + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + strm->state->bi_valid = bits; + strm->state->bi_buf = (ush)(value & ((1 << bits) - 1)); + return Z_OK; +} + +/* ========================================================================= */ +int ZEXPORT deflateParams(strm, level, strategy) + z_streamp strm; + int level; + int strategy; +{ + deflate_state *s; + compress_func func; + int err = Z_OK; + + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + s = strm->state; + +#ifdef FASTEST + if (level != 0) level = 1; +#else + if (level == Z_DEFAULT_COMPRESSION) level = 6; +#endif + if (level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED) { + return Z_STREAM_ERROR; + } + func = configuration_table[s->level].func; + + if (func != configuration_table[level].func && strm->total_in != 0) { + /* Flush the last buffer: */ + err = deflate(strm, Z_PARTIAL_FLUSH); + } + if (s->level != level) { + s->level = level; + s->max_lazy_match = configuration_table[level].max_lazy; + s->good_match = configuration_table[level].good_length; + s->nice_match = configuration_table[level].nice_length; + s->max_chain_length = configuration_table[level].max_chain; + } + s->strategy = strategy; + return err; +} + +/* ========================================================================= */ +int ZEXPORT deflateTune(strm, good_length, max_lazy, nice_length, max_chain) + z_streamp strm; + int good_length; + int max_lazy; + int nice_length; + int max_chain; +{ + deflate_state *s; + + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + s = strm->state; + s->good_match = good_length; + s->max_lazy_match = max_lazy; + s->nice_match = nice_length; + s->max_chain_length = max_chain; + return Z_OK; +} + +/* ========================================================================= + * For the default windowBits of 15 and memLevel of 8, this function returns + * a close to exact, as well as small, upper bound on the compressed size. + * They are coded as constants here for a reason--if the #define's are + * changed, then this function needs to be changed as well. The return + * value for 15 and 8 only works for those exact settings. + * + * For any setting other than those defaults for windowBits and memLevel, + * the value returned is a conservative worst case for the maximum expansion + * resulting from using fixed blocks instead of stored blocks, which deflate + * can emit on compressed data for some combinations of the parameters. + * + * This function could be more sophisticated to provide closer upper bounds + * for every combination of windowBits and memLevel, as well as wrap. + * But even the conservative upper bound of about 14% expansion does not + * seem onerous for output buffer allocation. + */ +uLong ZEXPORT deflateBound(strm, sourceLen) + z_streamp strm; + uLong sourceLen; +{ + deflate_state *s; + uLong destLen; + + /* conservative upper bound */ + destLen = sourceLen + + ((sourceLen + 7) >> 3) + ((sourceLen + 63) >> 6) + 11; + + /* if can't get parameters, return conservative bound */ + if (strm == Z_NULL || strm->state == Z_NULL) + return destLen; + + /* if not default parameters, return conservative bound */ + s = strm->state; + if (s->w_bits != 15 || s->hash_bits != 8 + 7) + return destLen; + + /* default settings: return tight bound for that case */ + return compressBound(sourceLen); +} + +/* ========================================================================= + * Put a short in the pending buffer. The 16-bit value is put in MSB order. + * IN assertion: the stream state is correct and there is enough room in + * pending_buf. + */ +local void putShortMSB (s, b) + deflate_state *s; + uInt b; +{ + put_byte(s, (Byte)(b >> 8)); + put_byte(s, (Byte)(b & 0xff)); +} + +/* ========================================================================= + * Flush as much pending output as possible. All deflate() output goes + * through this function so some applications may wish to modify it + * to avoid allocating a large strm->next_out buffer and copying into it. + * (See also read_buf()). + */ +local void flush_pending(strm) + z_streamp strm; +{ + unsigned len = strm->state->pending; + + if (len > strm->avail_out) len = strm->avail_out; + if (len == 0) return; + + zmemcpy(strm->next_out, strm->state->pending_out, len); + strm->next_out += len; + strm->state->pending_out += len; + strm->total_out += len; + strm->avail_out -= len; + strm->state->pending -= len; + if (strm->state->pending == 0) { + strm->state->pending_out = strm->state->pending_buf; + } +} + +/* ========================================================================= */ +int ZEXPORT deflate (strm, flush) + z_streamp strm; + int flush; +{ + int old_flush; /* value of flush param for previous deflate call */ + deflate_state *s; + + if (strm == Z_NULL || strm->state == Z_NULL || + flush > Z_FINISH || flush < 0) { + return Z_STREAM_ERROR; + } + s = strm->state; + + if (strm->next_out == Z_NULL || + (strm->next_in == Z_NULL && strm->avail_in != 0) || + (s->status == FINISH_STATE && flush != Z_FINISH)) { + ERR_RETURN(strm, Z_STREAM_ERROR); + } + if (strm->avail_out == 0) ERR_RETURN(strm, Z_BUF_ERROR); + + s->strm = strm; /* just in case */ + old_flush = s->last_flush; + s->last_flush = flush; + + /* Write the header */ + if (s->status == INIT_STATE) { +#ifdef GZIP + if (s->wrap == 2) { + strm->adler = crc32(0L, Z_NULL, 0); + put_byte(s, 31); + put_byte(s, 139); + put_byte(s, 8); + if (s->gzhead == NULL) { + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, s->level == 9 ? 2 : + (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ? + 4 : 0)); + put_byte(s, OS_CODE); + s->status = BUSY_STATE; + } + else { + put_byte(s, (s->gzhead->text ? 1 : 0) + + (s->gzhead->hcrc ? 2 : 0) + + (s->gzhead->extra == Z_NULL ? 0 : 4) + + (s->gzhead->name == Z_NULL ? 0 : 8) + + (s->gzhead->comment == Z_NULL ? 0 : 16) + ); + put_byte(s, (Byte)(s->gzhead->time & 0xff)); + put_byte(s, (Byte)((s->gzhead->time >> 8) & 0xff)); + put_byte(s, (Byte)((s->gzhead->time >> 16) & 0xff)); + put_byte(s, (Byte)((s->gzhead->time >> 24) & 0xff)); + put_byte(s, s->level == 9 ? 2 : + (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ? + 4 : 0)); + put_byte(s, s->gzhead->os & 0xff); + if (s->gzhead->extra != NULL) { + put_byte(s, s->gzhead->extra_len & 0xff); + put_byte(s, (s->gzhead->extra_len >> 8) & 0xff); + } + if (s->gzhead->hcrc) + strm->adler = crc32(strm->adler, s->pending_buf, + s->pending); + s->gzindex = 0; + s->status = EXTRA_STATE; + } + } + else +#endif + { + uInt header = (Z_DEFLATED + ((s->w_bits-8)<<4)) << 8; + uInt level_flags; + + if (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2) + level_flags = 0; + else if (s->level < 6) + level_flags = 1; + else if (s->level == 6) + level_flags = 2; + else + level_flags = 3; + header |= (level_flags << 6); + if (s->strstart != 0) header |= PRESET_DICT; + header += 31 - (header % 31); + + s->status = BUSY_STATE; + putShortMSB(s, header); + + /* Save the adler32 of the preset dictionary: */ + if (s->strstart != 0) { + putShortMSB(s, (uInt)(strm->adler >> 16)); + putShortMSB(s, (uInt)(strm->adler & 0xffff)); + } + strm->adler = adler32(0L, Z_NULL, 0); + } + } +#ifdef GZIP + if (s->status == EXTRA_STATE) { + if (s->gzhead->extra != NULL) { + uInt beg = s->pending; /* start of bytes to update crc */ + + while (s->gzindex < (s->gzhead->extra_len & 0xffff)) { + if (s->pending == s->pending_buf_size) { + if (s->gzhead->hcrc && s->pending > beg) + strm->adler = crc32(strm->adler, s->pending_buf + beg, + s->pending - beg); + flush_pending(strm); + beg = s->pending; + if (s->pending == s->pending_buf_size) + break; + } + put_byte(s, s->gzhead->extra[s->gzindex]); + s->gzindex++; + } + if (s->gzhead->hcrc && s->pending > beg) + strm->adler = crc32(strm->adler, s->pending_buf + beg, + s->pending - beg); + if (s->gzindex == s->gzhead->extra_len) { + s->gzindex = 0; + s->status = NAME_STATE; + } + } + else + s->status = NAME_STATE; + } + if (s->status == NAME_STATE) { + if (s->gzhead->name != NULL) { + uInt beg = s->pending; /* start of bytes to update crc */ + int val; + + do { + if (s->pending == s->pending_buf_size) { + if (s->gzhead->hcrc && s->pending > beg) + strm->adler = crc32(strm->adler, s->pending_buf + beg, + s->pending - beg); + flush_pending(strm); + beg = s->pending; + if (s->pending == s->pending_buf_size) { + val = 1; + break; + } + } + val = s->gzhead->name[s->gzindex++]; + put_byte(s, val); + } while (val != 0); + if (s->gzhead->hcrc && s->pending > beg) + strm->adler = crc32(strm->adler, s->pending_buf + beg, + s->pending - beg); + if (val == 0) { + s->gzindex = 0; + s->status = COMMENT_STATE; + } + } + else + s->status = COMMENT_STATE; + } + if (s->status == COMMENT_STATE) { + if (s->gzhead->comment != NULL) { + uInt beg = s->pending; /* start of bytes to update crc */ + int val; + + do { + if (s->pending == s->pending_buf_size) { + if (s->gzhead->hcrc && s->pending > beg) + strm->adler = crc32(strm->adler, s->pending_buf + beg, + s->pending - beg); + flush_pending(strm); + beg = s->pending; + if (s->pending == s->pending_buf_size) { + val = 1; + break; + } + } + val = s->gzhead->comment[s->gzindex++]; + put_byte(s, val); + } while (val != 0); + if (s->gzhead->hcrc && s->pending > beg) + strm->adler = crc32(strm->adler, s->pending_buf + beg, + s->pending - beg); + if (val == 0) + s->status = HCRC_STATE; + } + else + s->status = HCRC_STATE; + } + if (s->status == HCRC_STATE) { + if (s->gzhead->hcrc) { + if (s->pending + 2 > s->pending_buf_size) + flush_pending(strm); + if (s->pending + 2 <= s->pending_buf_size) { + put_byte(s, (Byte)(strm->adler & 0xff)); + put_byte(s, (Byte)((strm->adler >> 8) & 0xff)); + strm->adler = crc32(0L, Z_NULL, 0); + s->status = BUSY_STATE; + } + } + else + s->status = BUSY_STATE; + } +#endif + + /* Flush as much pending output as possible */ + if (s->pending != 0) { + flush_pending(strm); + if (strm->avail_out == 0) { + /* Since avail_out is 0, deflate will be called again with + * more output space, but possibly with both pending and + * avail_in equal to zero. There won't be anything to do, + * but this is not an error situation so make sure we + * return OK instead of BUF_ERROR at next call of deflate: + */ + s->last_flush = -1; + return Z_OK; + } + + /* Make sure there is something to do and avoid duplicate consecutive + * flushes. For repeated and useless calls with Z_FINISH, we keep + * returning Z_STREAM_END instead of Z_BUF_ERROR. + */ + } else if (strm->avail_in == 0 && flush <= old_flush && + flush != Z_FINISH) { + ERR_RETURN(strm, Z_BUF_ERROR); + } + + /* User must not provide more input after the first FINISH: */ + if (s->status == FINISH_STATE && strm->avail_in != 0) { + ERR_RETURN(strm, Z_BUF_ERROR); + } + + /* Start a new block or continue the current one. + */ + if (strm->avail_in != 0 || s->lookahead != 0 || + (flush != Z_NO_FLUSH && s->status != FINISH_STATE)) { + block_state bstate; + + bstate = (*(configuration_table[s->level].func))(s, flush); + + if (bstate == finish_started || bstate == finish_done) { + s->status = FINISH_STATE; + } + if (bstate == need_more || bstate == finish_started) { + if (strm->avail_out == 0) { + s->last_flush = -1; /* avoid BUF_ERROR next call, see above */ + } + return Z_OK; + /* If flush != Z_NO_FLUSH && avail_out == 0, the next call + * of deflate should use the same flush parameter to make sure + * that the flush is complete. So we don't have to output an + * empty block here, this will be done at next call. This also + * ensures that for a very small output buffer, we emit at most + * one empty block. + */ + } + if (bstate == block_done) { + if (flush == Z_PARTIAL_FLUSH) { + _tr_align(s); + } else { /* FULL_FLUSH or SYNC_FLUSH */ + _tr_stored_block(s, (char*)0, 0L, 0); + /* For a full flush, this empty block will be recognized + * as a special marker by inflate_sync(). + */ + if (flush == Z_FULL_FLUSH) { + CLEAR_HASH(s); /* forget history */ + } + } + flush_pending(strm); + if (strm->avail_out == 0) { + s->last_flush = -1; /* avoid BUF_ERROR at next call, see above */ + return Z_OK; + } + } + } + Assert(strm->avail_out > 0, "bug2"); + + if (flush != Z_FINISH) return Z_OK; + if (s->wrap <= 0) return Z_STREAM_END; + + /* Write the trailer */ +#ifdef GZIP + if (s->wrap == 2) { + put_byte(s, (Byte)(strm->adler & 0xff)); + put_byte(s, (Byte)((strm->adler >> 8) & 0xff)); + put_byte(s, (Byte)((strm->adler >> 16) & 0xff)); + put_byte(s, (Byte)((strm->adler >> 24) & 0xff)); + put_byte(s, (Byte)(strm->total_in & 0xff)); + put_byte(s, (Byte)((strm->total_in >> 8) & 0xff)); + put_byte(s, (Byte)((strm->total_in >> 16) & 0xff)); + put_byte(s, (Byte)((strm->total_in >> 24) & 0xff)); + } + else +#endif + { + putShortMSB(s, (uInt)(strm->adler >> 16)); + putShortMSB(s, (uInt)(strm->adler & 0xffff)); + } + flush_pending(strm); + /* If avail_out is zero, the application will call deflate again + * to flush the rest. + */ + if (s->wrap > 0) s->wrap = -s->wrap; /* write the trailer only once! */ + return s->pending != 0 ? Z_OK : Z_STREAM_END; +} + +/* ========================================================================= */ +int ZEXPORT deflateEnd (strm) + z_streamp strm; +{ + int status; + + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + + status = strm->state->status; + if (status != INIT_STATE && + status != EXTRA_STATE && + status != NAME_STATE && + status != COMMENT_STATE && + status != HCRC_STATE && + status != BUSY_STATE && + status != FINISH_STATE) { + return Z_STREAM_ERROR; + } + + /* Deallocate in reverse order of allocations: */ + TRY_FREE(strm, strm->state->pending_buf); + TRY_FREE(strm, strm->state->head); + TRY_FREE(strm, strm->state->prev); + TRY_FREE(strm, strm->state->window); + + ZFREE(strm, strm->state); + strm->state = Z_NULL; + + return status == BUSY_STATE ? Z_DATA_ERROR : Z_OK; +} + +/* ========================================================================= + * Copy the source state to the destination state. + * To simplify the source, this is not supported for 16-bit MSDOS (which + * doesn't have enough memory anyway to duplicate compression states). + */ +int ZEXPORT deflateCopy (dest, source) + z_streamp dest; + z_streamp source; +{ +#ifdef MAXSEG_64K + return Z_STREAM_ERROR; +#else + deflate_state *ds; + deflate_state *ss; + ushf *overlay; + + + if (source == Z_NULL || dest == Z_NULL || source->state == Z_NULL) { + return Z_STREAM_ERROR; + } + + ss = source->state; + + zmemcpy(dest, source, sizeof(z_stream)); + + ds = (deflate_state *) ZALLOC(dest, 1, sizeof(deflate_state)); + if (ds == Z_NULL) return Z_MEM_ERROR; + dest->state = (struct internal_state FAR *) ds; + zmemcpy(ds, ss, sizeof(deflate_state)); + ds->strm = dest; + + ds->window = (Bytef *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte)); + ds->prev = (Posf *) ZALLOC(dest, ds->w_size, sizeof(Pos)); + ds->head = (Posf *) ZALLOC(dest, ds->hash_size, sizeof(Pos)); + overlay = (ushf *) ZALLOC(dest, ds->lit_bufsize, sizeof(ush)+2); + ds->pending_buf = (uchf *) overlay; + + if (ds->window == Z_NULL || ds->prev == Z_NULL || ds->head == Z_NULL || + ds->pending_buf == Z_NULL) { + deflateEnd (dest); + return Z_MEM_ERROR; + } + /* following zmemcpy do not work for 16-bit MSDOS */ + zmemcpy(ds->window, ss->window, ds->w_size * 2 * sizeof(Byte)); + zmemcpy(ds->prev, ss->prev, ds->w_size * sizeof(Pos)); + zmemcpy(ds->head, ss->head, ds->hash_size * sizeof(Pos)); + zmemcpy(ds->pending_buf, ss->pending_buf, (uInt)ds->pending_buf_size); + + ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf); + ds->d_buf = overlay + ds->lit_bufsize/sizeof(ush); + ds->l_buf = ds->pending_buf + (1+sizeof(ush))*ds->lit_bufsize; + + ds->l_desc.dyn_tree = ds->dyn_ltree; + ds->d_desc.dyn_tree = ds->dyn_dtree; + ds->bl_desc.dyn_tree = ds->bl_tree; + + return Z_OK; +#endif /* MAXSEG_64K */ +} + +/* =========================================================================== + * Read a new buffer from the current input stream, update the adler32 + * and total number of bytes read. All deflate() input goes through + * this function so some applications may wish to modify it to avoid + * allocating a large strm->next_in buffer and copying from it. + * (See also flush_pending()). + */ +local int read_buf(strm, buf, size) + z_streamp strm; + Bytef *buf; + unsigned size; +{ + unsigned len = strm->avail_in; + + if (len > size) len = size; + if (len == 0) return 0; + + strm->avail_in -= len; + + if (strm->state->wrap == 1) { + strm->adler = adler32(strm->adler, strm->next_in, len); + } +#ifdef GZIP + else if (strm->state->wrap == 2) { + strm->adler = crc32(strm->adler, strm->next_in, len); + } +#endif + zmemcpy(buf, strm->next_in, len); + strm->next_in += len; + strm->total_in += len; + + return (int)len; +} + +/* =========================================================================== + * Initialize the "longest match" routines for a new zlib stream + */ +local void lm_init (s) + deflate_state *s; +{ + s->window_size = (ulg)2L*s->w_size; + + CLEAR_HASH(s); + + /* Set the default configuration parameters: + */ + s->max_lazy_match = configuration_table[s->level].max_lazy; + s->good_match = configuration_table[s->level].good_length; + s->nice_match = configuration_table[s->level].nice_length; + s->max_chain_length = configuration_table[s->level].max_chain; + + s->strstart = 0; + s->block_start = 0L; + s->lookahead = 0; + s->match_length = s->prev_length = MIN_MATCH-1; + s->match_available = 0; + s->ins_h = 0; +#ifndef FASTEST +#ifdef ASMV + match_init(); /* initialize the asm code */ +#endif +#endif +} + +#ifndef FASTEST +/* =========================================================================== + * Set match_start to the longest match starting at the given string and + * return its length. Matches shorter or equal to prev_length are discarded, + * in which case the result is equal to prev_length and match_start is + * garbage. + * IN assertions: cur_match is the head of the hash chain for the current + * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1 + * OUT assertion: the match length is not greater than s->lookahead. + */ +#ifndef ASMV +/* For 80x86 and 680x0, an optimized version will be provided in match.asm or + * match.S. The code will be functionally equivalent. + */ +local uInt longest_match(s, cur_match) + deflate_state *s; + IPos cur_match; /* current match */ +{ + unsigned chain_length = s->max_chain_length;/* max hash chain length */ + register Bytef *scan = s->window + s->strstart; /* current string */ + register Bytef *match; /* matched string */ + register int len; /* length of current match */ + int best_len = s->prev_length; /* best match length so far */ + int nice_match = s->nice_match; /* stop if match long enough */ + IPos limit = s->strstart > (IPos)MAX_DIST(s) ? + s->strstart - (IPos)MAX_DIST(s) : NIL; + /* Stop when cur_match becomes <= limit. To simplify the code, + * we prevent matches with the string of window index 0. + */ + Posf *prev = s->prev; + uInt wmask = s->w_mask; + +#ifdef UNALIGNED_OK + /* Compare two bytes at a time. Note: this is not always beneficial. + * Try with and without -DUNALIGNED_OK to check. + */ + register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1; + register ush scan_start = *(ushf*)scan; + register ush scan_end = *(ushf*)(scan+best_len-1); +#else + register Bytef *strend = s->window + s->strstart + MAX_MATCH; + register Byte scan_end1 = scan[best_len-1]; + register Byte scan_end = scan[best_len]; +#endif + + /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16. + * It is easy to get rid of this optimization if necessary. + */ + Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever"); + + /* Do not waste too much time if we already have a good match: */ + if (s->prev_length >= s->good_match) { + chain_length >>= 2; + } + /* Do not look for matches beyond the end of the input. This is necessary + * to make deflate deterministic. + */ + if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead; + + Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead"); + + do { + Assert(cur_match < s->strstart, "no future"); + match = s->window + cur_match; + + /* Skip to next match if the match length cannot increase + * or if the match length is less than 2. Note that the checks below + * for insufficient lookahead only occur occasionally for performance + * reasons. Therefore uninitialized memory will be accessed, and + * conditional jumps will be made that depend on those values. + * However the length of the match is limited to the lookahead, so + * the output of deflate is not affected by the uninitialized values. + */ +#if (defined(UNALIGNED_OK) && MAX_MATCH == 258) + /* This code assumes sizeof(unsigned short) == 2. Do not use + * UNALIGNED_OK if your compiler uses a different size. + */ + if (*(ushf*)(match+best_len-1) != scan_end || + *(ushf*)match != scan_start) continue; + + /* It is not necessary to compare scan[2] and match[2] since they are + * always equal when the other bytes match, given that the hash keys + * are equal and that HASH_BITS >= 8. Compare 2 bytes at a time at + * strstart+3, +5, ... up to strstart+257. We check for insufficient + * lookahead only every 4th comparison; the 128th check will be made + * at strstart+257. If MAX_MATCH-2 is not a multiple of 8, it is + * necessary to put more guard bytes at the end of the window, or + * to check more often for insufficient lookahead. + */ + Assert(scan[2] == match[2], "scan[2]?"); + scan++, match++; + do { + } while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) && + *(ushf*)(scan+=2) == *(ushf*)(match+=2) && + *(ushf*)(scan+=2) == *(ushf*)(match+=2) && + *(ushf*)(scan+=2) == *(ushf*)(match+=2) && + scan < strend); + /* The funny "do {}" generates better code on most compilers */ + + /* Here, scan <= window+strstart+257 */ + Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); + if (*scan == *match) scan++; + + len = (MAX_MATCH - 1) - (int)(strend-scan); + scan = strend - (MAX_MATCH-1); + +#else /* UNALIGNED_OK */ + + if (match[best_len] != scan_end || + match[best_len-1] != scan_end1 || + *match != *scan || + *++match != scan[1]) continue; + + /* The check at best_len-1 can be removed because it will be made + * again later. (This heuristic is not always a win.) + * It is not necessary to compare scan[2] and match[2] since they + * are always equal when the other bytes match, given that + * the hash keys are equal and that HASH_BITS >= 8. + */ + scan += 2, match++; + Assert(*scan == *match, "match[2]?"); + + /* We check for insufficient lookahead only every 8th comparison; + * the 256th check will be made at strstart+258. + */ + do { + } while (*++scan == *++match && *++scan == *++match && + *++scan == *++match && *++scan == *++match && + *++scan == *++match && *++scan == *++match && + *++scan == *++match && *++scan == *++match && + scan < strend); + + Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); + + len = MAX_MATCH - (int)(strend - scan); + scan = strend - MAX_MATCH; + +#endif /* UNALIGNED_OK */ + + if (len > best_len) { + s->match_start = cur_match; + best_len = len; + if (len >= nice_match) break; +#ifdef UNALIGNED_OK + scan_end = *(ushf*)(scan+best_len-1); +#else + scan_end1 = scan[best_len-1]; + scan_end = scan[best_len]; +#endif + } + } while ((cur_match = prev[cur_match & wmask]) > limit + && --chain_length != 0); + + if ((uInt)best_len <= s->lookahead) return (uInt)best_len; + return s->lookahead; +} +#endif /* ASMV */ +#endif /* FASTEST */ + +/* --------------------------------------------------------------------------- + * Optimized version for level == 1 or strategy == Z_RLE only + */ +local uInt longest_match_fast(s, cur_match) + deflate_state *s; + IPos cur_match; /* current match */ +{ + register Bytef *scan = s->window + s->strstart; /* current string */ + register Bytef *match; /* matched string */ + register int len; /* length of current match */ + register Bytef *strend = s->window + s->strstart + MAX_MATCH; + + /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16. + * It is easy to get rid of this optimization if necessary. + */ + Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever"); + + Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead"); + + Assert(cur_match < s->strstart, "no future"); + + match = s->window + cur_match; + + /* Return failure if the match length is less than 2: + */ + if (match[0] != scan[0] || match[1] != scan[1]) return MIN_MATCH-1; + + /* The check at best_len-1 can be removed because it will be made + * again later. (This heuristic is not always a win.) + * It is not necessary to compare scan[2] and match[2] since they + * are always equal when the other bytes match, given that + * the hash keys are equal and that HASH_BITS >= 8. + */ + scan += 2, match += 2; + Assert(*scan == *match, "match[2]?"); + + /* We check for insufficient lookahead only every 8th comparison; + * the 256th check will be made at strstart+258. + */ + do { + } while (*++scan == *++match && *++scan == *++match && + *++scan == *++match && *++scan == *++match && + *++scan == *++match && *++scan == *++match && + *++scan == *++match && *++scan == *++match && + scan < strend); + + Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); + + len = MAX_MATCH - (int)(strend - scan); + + if (len < MIN_MATCH) return MIN_MATCH - 1; + + s->match_start = cur_match; + return (uInt)len <= s->lookahead ? (uInt)len : s->lookahead; +} + +#ifdef DEBUG +/* =========================================================================== + * Check that the match at match_start is indeed a match. + */ +local void check_match(s, start, match, length) + deflate_state *s; + IPos start, match; + int length; +{ + /* check that the match is indeed a match */ + if (zmemcmp(s->window + match, + s->window + start, length) != EQUAL) { + fprintf(stderr, " start %u, match %u, length %d\n", + start, match, length); + do { + fprintf(stderr, "%c%c", s->window[match++], s->window[start++]); + } while (--length != 0); + z_error("invalid match"); + } + if (z_verbose > 1) { + fprintf(stderr,"\\[%d,%d]", start-match, length); + do { putc(s->window[start++], stderr); } while (--length != 0); + } +} +#else +# define check_match(s, start, match, length) +#endif /* DEBUG */ + +/* =========================================================================== + * Fill the window when the lookahead becomes insufficient. + * Updates strstart and lookahead. + * + * IN assertion: lookahead < MIN_LOOKAHEAD + * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD + * At least one byte has been read, or avail_in == 0; reads are + * performed for at least two bytes (required for the zip translate_eol + * option -- not supported here). + */ +local void fill_window(s) + deflate_state *s; +{ + register unsigned n, m; + register Posf *p; + unsigned more; /* Amount of free space at the end of the window. */ + uInt wsize = s->w_size; + + do { + more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart); + + /* Deal with !@#$% 64K limit: */ + if (sizeof(int) <= 2) { + if (more == 0 && s->strstart == 0 && s->lookahead == 0) { + more = wsize; + + } else if (more == (unsigned)(-1)) { + /* Very unlikely, but possible on 16 bit machine if + * strstart == 0 && lookahead == 1 (input done a byte at time) + */ + more--; + } + } + + /* If the window is almost full and there is insufficient lookahead, + * move the upper half to the lower one to make room in the upper half. + */ + if (s->strstart >= wsize+MAX_DIST(s)) { + + zmemcpy(s->window, s->window+wsize, (unsigned)wsize); + s->match_start -= wsize; + s->strstart -= wsize; /* we now have strstart >= MAX_DIST */ + s->block_start -= (long) wsize; + + /* Slide the hash table (could be avoided with 32 bit values + at the expense of memory usage). We slide even when level == 0 + to keep the hash table consistent if we switch back to level > 0 + later. (Using level 0 permanently is not an optimal usage of + zlib, so we don't care about this pathological case.) + */ + /* %%% avoid this when Z_RLE */ + n = s->hash_size; + p = &s->head[n]; + do { + m = *--p; + *p = (Pos)(m >= wsize ? m-wsize : NIL); + } while (--n); + + n = wsize; +#ifndef FASTEST + p = &s->prev[n]; + do { + m = *--p; + *p = (Pos)(m >= wsize ? m-wsize : NIL); + /* If n is not on any hash chain, prev[n] is garbage but + * its value will never be used. + */ + } while (--n); +#endif + more += wsize; + } + if (s->strm->avail_in == 0) return; + + /* If there was no sliding: + * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 && + * more == window_size - lookahead - strstart + * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1) + * => more >= window_size - 2*WSIZE + 2 + * In the BIG_MEM or MMAP case (not yet supported), + * window_size == input_size + MIN_LOOKAHEAD && + * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD. + * Otherwise, window_size == 2*WSIZE so more >= 2. + * If there was sliding, more >= WSIZE. So in all cases, more >= 2. + */ + Assert(more >= 2, "more < 2"); + + n = read_buf(s->strm, s->window + s->strstart + s->lookahead, more); + s->lookahead += n; + + /* Initialize the hash value now that we have some input: */ + if (s->lookahead >= MIN_MATCH) { + s->ins_h = s->window[s->strstart]; + UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]); +#if MIN_MATCH != 3 + Call UPDATE_HASH() MIN_MATCH-3 more times +#endif + } + /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage, + * but this is not important since only literal bytes will be emitted. + */ + + } while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0); +} + +/* =========================================================================== + * Flush the current block, with given end-of-file flag. + * IN assertion: strstart is set to the end of the current match. + */ +#define FLUSH_BLOCK_ONLY(s, eof) { \ + _tr_flush_block(s, (s->block_start >= 0L ? \ + (charf *)&s->window[(unsigned)s->block_start] : \ + (charf *)Z_NULL), \ + (ulg)((long)s->strstart - s->block_start), \ + (eof)); \ + s->block_start = s->strstart; \ + flush_pending(s->strm); \ + Tracev((stderr,"[FLUSH]")); \ +} + +/* Same but force premature exit if necessary. */ +#define FLUSH_BLOCK(s, eof) { \ + FLUSH_BLOCK_ONLY(s, eof); \ + if (s->strm->avail_out == 0) return (eof) ? finish_started : need_more; \ +} + +/* =========================================================================== + * Copy without compression as much as possible from the input stream, return + * the current block state. + * This function does not insert new strings in the dictionary since + * uncompressible data is probably not useful. This function is used + * only for the level=0 compression option. + * NOTE: this function should be optimized to avoid extra copying from + * window to pending_buf. + */ +local block_state deflate_stored(s, flush) + deflate_state *s; + int flush; +{ + /* Stored blocks are limited to 0xffff bytes, pending_buf is limited + * to pending_buf_size, and each stored block has a 5 byte header: + */ + ulg max_block_size = 0xffff; + ulg max_start; + + if (max_block_size > s->pending_buf_size - 5) { + max_block_size = s->pending_buf_size - 5; + } + + /* Copy as much as possible from input to output: */ + for (;;) { + /* Fill the window as much as possible: */ + if (s->lookahead <= 1) { + + Assert(s->strstart < s->w_size+MAX_DIST(s) || + s->block_start >= (long)s->w_size, "slide too late"); + + fill_window(s); + if (s->lookahead == 0 && flush == Z_NO_FLUSH) return need_more; + + if (s->lookahead == 0) break; /* flush the current block */ + } + Assert(s->block_start >= 0L, "block gone"); + + s->strstart += s->lookahead; + s->lookahead = 0; + + /* Emit a stored block if pending_buf will be full: */ + max_start = s->block_start + max_block_size; + if (s->strstart == 0 || (ulg)s->strstart >= max_start) { + /* strstart == 0 is possible when wraparound on 16-bit machine */ + s->lookahead = (uInt)(s->strstart - max_start); + s->strstart = (uInt)max_start; + FLUSH_BLOCK(s, 0); + } + /* Flush if we may have to slide, otherwise block_start may become + * negative and the data will be gone: + */ + if (s->strstart - (uInt)s->block_start >= MAX_DIST(s)) { + FLUSH_BLOCK(s, 0); + } + } + FLUSH_BLOCK(s, flush == Z_FINISH); + return flush == Z_FINISH ? finish_done : block_done; +} + +/* =========================================================================== + * Compress as much as possible from the input stream, return the current + * block state. + * This function does not perform lazy evaluation of matches and inserts + * new strings in the dictionary only for unmatched strings or for short + * matches. It is used only for the fast compression options. + */ +local block_state deflate_fast(s, flush) + deflate_state *s; + int flush; +{ + IPos hash_head = NIL; /* head of the hash chain */ + int bflush; /* set if current block must be flushed */ + + for (;;) { + /* Make sure that we always have enough lookahead, except + * at the end of the input file. We need MAX_MATCH bytes + * for the next match, plus MIN_MATCH bytes to insert the + * string following the next match. + */ + if (s->lookahead < MIN_LOOKAHEAD) { + fill_window(s); + if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) { + return need_more; + } + if (s->lookahead == 0) break; /* flush the current block */ + } + + /* Insert the string window[strstart .. strstart+2] in the + * dictionary, and set hash_head to the head of the hash chain: + */ + if (s->lookahead >= MIN_MATCH) { + INSERT_STRING(s, s->strstart, hash_head); + } + + /* Find the longest match, discarding those <= prev_length. + * At this point we have always match_length < MIN_MATCH + */ + if (hash_head != NIL && s->strstart - hash_head <= MAX_DIST(s)) { + /* To simplify the code, we prevent matches with the string + * of window index 0 (in particular we have to avoid a match + * of the string with itself at the start of the input file). + */ +#ifdef FASTEST + if ((s->strategy != Z_HUFFMAN_ONLY && s->strategy != Z_RLE) || + (s->strategy == Z_RLE && s->strstart - hash_head == 1)) { + s->match_length = longest_match_fast (s, hash_head); + } +#else + if (s->strategy != Z_HUFFMAN_ONLY && s->strategy != Z_RLE) { + s->match_length = longest_match (s, hash_head); + } else if (s->strategy == Z_RLE && s->strstart - hash_head == 1) { + s->match_length = longest_match_fast (s, hash_head); + } +#endif + /* longest_match() or longest_match_fast() sets match_start */ + } + if (s->match_length >= MIN_MATCH) { + check_match(s, s->strstart, s->match_start, s->match_length); + + _tr_tally_dist(s, s->strstart - s->match_start, + s->match_length - MIN_MATCH, bflush); + + s->lookahead -= s->match_length; + + /* Insert new strings in the hash table only if the match length + * is not too large. This saves time but degrades compression. + */ +#ifndef FASTEST + if (s->match_length <= s->max_insert_length && + s->lookahead >= MIN_MATCH) { + s->match_length--; /* string at strstart already in table */ + do { + s->strstart++; + INSERT_STRING(s, s->strstart, hash_head); + /* strstart never exceeds WSIZE-MAX_MATCH, so there are + * always MIN_MATCH bytes ahead. + */ + } while (--s->match_length != 0); + s->strstart++; + } else +#endif + { + s->strstart += s->match_length; + s->match_length = 0; + s->ins_h = s->window[s->strstart]; + UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]); +#if MIN_MATCH != 3 + Call UPDATE_HASH() MIN_MATCH-3 more times +#endif + /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not + * matter since it will be recomputed at next deflate call. + */ + } + } else { + /* No match, output a literal byte */ + Tracevv((stderr,"%c", s->window[s->strstart])); + _tr_tally_lit (s, s->window[s->strstart], bflush); + s->lookahead--; + s->strstart++; + } + if (bflush) FLUSH_BLOCK(s, 0); + } + FLUSH_BLOCK(s, flush == Z_FINISH); + return flush == Z_FINISH ? finish_done : block_done; +} + +#ifndef FASTEST +/* =========================================================================== + * Same as above, but achieves better compression. We use a lazy + * evaluation for matches: a match is finally adopted only if there is + * no better match at the next window position. + */ +local block_state deflate_slow(s, flush) + deflate_state *s; + int flush; +{ + IPos hash_head = NIL; /* head of hash chain */ + int bflush; /* set if current block must be flushed */ + + /* Process the input block. */ + for (;;) { + /* Make sure that we always have enough lookahead, except + * at the end of the input file. We need MAX_MATCH bytes + * for the next match, plus MIN_MATCH bytes to insert the + * string following the next match. + */ + if (s->lookahead < MIN_LOOKAHEAD) { + fill_window(s); + if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) { + return need_more; + } + if (s->lookahead == 0) break; /* flush the current block */ + } + + /* Insert the string window[strstart .. strstart+2] in the + * dictionary, and set hash_head to the head of the hash chain: + */ + if (s->lookahead >= MIN_MATCH) { + INSERT_STRING(s, s->strstart, hash_head); + } + + /* Find the longest match, discarding those <= prev_length. + */ + s->prev_length = s->match_length, s->prev_match = s->match_start; + s->match_length = MIN_MATCH-1; + + if (hash_head != NIL && s->prev_length < s->max_lazy_match && + s->strstart - hash_head <= MAX_DIST(s)) { + /* To simplify the code, we prevent matches with the string + * of window index 0 (in particular we have to avoid a match + * of the string with itself at the start of the input file). + */ + if (s->strategy != Z_HUFFMAN_ONLY && s->strategy != Z_RLE) { + s->match_length = longest_match (s, hash_head); + } else if (s->strategy == Z_RLE && s->strstart - hash_head == 1) { + s->match_length = longest_match_fast (s, hash_head); + } + /* longest_match() or longest_match_fast() sets match_start */ + + if (s->match_length <= 5 && (s->strategy == Z_FILTERED +#if TOO_FAR <= 32767 + || (s->match_length == MIN_MATCH && + s->strstart - s->match_start > TOO_FAR) +#endif + )) { + + /* If prev_match is also MIN_MATCH, match_start is garbage + * but we will ignore the current match anyway. + */ + s->match_length = MIN_MATCH-1; + } + } + /* If there was a match at the previous step and the current + * match is not better, output the previous match: + */ + if (s->prev_length >= MIN_MATCH && s->match_length <= s->prev_length) { + uInt max_insert = s->strstart + s->lookahead - MIN_MATCH; + /* Do not insert strings in hash table beyond this. */ + + check_match(s, s->strstart-1, s->prev_match, s->prev_length); + + _tr_tally_dist(s, s->strstart -1 - s->prev_match, + s->prev_length - MIN_MATCH, bflush); + + /* Insert in hash table all strings up to the end of the match. + * strstart-1 and strstart are already inserted. If there is not + * enough lookahead, the last two strings are not inserted in + * the hash table. + */ + s->lookahead -= s->prev_length-1; + s->prev_length -= 2; + do { + if (++s->strstart <= max_insert) { + INSERT_STRING(s, s->strstart, hash_head); + } + } while (--s->prev_length != 0); + s->match_available = 0; + s->match_length = MIN_MATCH-1; + s->strstart++; + + if (bflush) FLUSH_BLOCK(s, 0); + + } else if (s->match_available) { + /* If there was no match at the previous position, output a + * single literal. If there was a match but the current match + * is longer, truncate the previous match to a single literal. + */ + Tracevv((stderr,"%c", s->window[s->strstart-1])); + _tr_tally_lit(s, s->window[s->strstart-1], bflush); + if (bflush) { + FLUSH_BLOCK_ONLY(s, 0); + } + s->strstart++; + s->lookahead--; + if (s->strm->avail_out == 0) return need_more; + } else { + /* There is no previous match to compare with, wait for + * the next step to decide. + */ + s->match_available = 1; + s->strstart++; + s->lookahead--; + } + } + Assert (flush != Z_NO_FLUSH, "no flush?"); + if (s->match_available) { + Tracevv((stderr,"%c", s->window[s->strstart-1])); + _tr_tally_lit(s, s->window[s->strstart-1], bflush); + s->match_available = 0; + } + FLUSH_BLOCK(s, flush == Z_FINISH); + return flush == Z_FINISH ? finish_done : block_done; +} +#endif /* FASTEST */ + +#if 0 +/* =========================================================================== + * For Z_RLE, simply look for runs of bytes, generate matches only of distance + * one. Do not maintain a hash table. (It will be regenerated if this run of + * deflate switches away from Z_RLE.) + */ +local block_state deflate_rle(s, flush) + deflate_state *s; + int flush; +{ + int bflush; /* set if current block must be flushed */ + uInt run; /* length of run */ + uInt max; /* maximum length of run */ + uInt prev; /* byte at distance one to match */ + Bytef *scan; /* scan for end of run */ + + for (;;) { + /* Make sure that we always have enough lookahead, except + * at the end of the input file. We need MAX_MATCH bytes + * for the longest encodable run. + */ + if (s->lookahead < MAX_MATCH) { + fill_window(s); + if (s->lookahead < MAX_MATCH && flush == Z_NO_FLUSH) { + return need_more; + } + if (s->lookahead == 0) break; /* flush the current block */ + } + + /* See how many times the previous byte repeats */ + run = 0; + if (s->strstart > 0) { /* if there is a previous byte, that is */ + max = s->lookahead < MAX_MATCH ? s->lookahead : MAX_MATCH; + scan = s->window + s->strstart - 1; + prev = *scan++; + do { + if (*scan++ != prev) + break; + } while (++run < max); + } + + /* Emit match if have run of MIN_MATCH or longer, else emit literal */ + if (run >= MIN_MATCH) { + check_match(s, s->strstart, s->strstart - 1, run); + _tr_tally_dist(s, 1, run - MIN_MATCH, bflush); + s->lookahead -= run; + s->strstart += run; + } else { + /* No match, output a literal byte */ + Tracevv((stderr,"%c", s->window[s->strstart])); + _tr_tally_lit (s, s->window[s->strstart], bflush); + s->lookahead--; + s->strstart++; + } + if (bflush) FLUSH_BLOCK(s, 0); + } + FLUSH_BLOCK(s, flush == Z_FINISH); + return flush == Z_FINISH ? finish_done : block_done; +} +#endif diff --git a/dep/StormLib/src/zlib/deflate.h b/dep/StormLib/src/zlib/deflate.h new file mode 100644 index 00000000000..05a5ab3a2c1 --- /dev/null +++ b/dep/StormLib/src/zlib/deflate.h @@ -0,0 +1,331 @@ +/* deflate.h -- internal compression state + * Copyright (C) 1995-2004 Jean-loup Gailly + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +/* @(#) $Id$ */ + +#ifndef DEFLATE_H +#define DEFLATE_H + +#include "zutil.h" + +/* define NO_GZIP when compiling if you want to disable gzip header and + trailer creation by deflate(). NO_GZIP would be used to avoid linking in + the crc code when it is not needed. For shared libraries, gzip encoding + should be left enabled. */ +#ifndef NO_GZIP +# define GZIP +#endif + +/* =========================================================================== + * Internal compression state. + */ + +#define LENGTH_CODES 29 +/* number of length codes, not counting the special END_BLOCK code */ + +#define LITERALS 256 +/* number of literal bytes 0..255 */ + +#define L_CODES (LITERALS+1+LENGTH_CODES) +/* number of Literal or Length codes, including the END_BLOCK code */ + +#define D_CODES 30 +/* number of distance codes */ + +#define BL_CODES 19 +/* number of codes used to transfer the bit lengths */ + +#define HEAP_SIZE (2*L_CODES+1) +/* maximum heap size */ + +#define MAX_BITS 15 +/* All codes must not exceed MAX_BITS bits */ + +#define INIT_STATE 42 +#define EXTRA_STATE 69 +#define NAME_STATE 73 +#define COMMENT_STATE 91 +#define HCRC_STATE 103 +#define BUSY_STATE 113 +#define FINISH_STATE 666 +/* Stream status */ + + +/* Data structure describing a single value and its code string. */ +typedef struct ct_data_s { + union { + ush freq; /* frequency count */ + ush code; /* bit string */ + } fc; + union { + ush dad; /* father node in Huffman tree */ + ush len; /* length of bit string */ + } dl; +} FAR ct_data; + +#define Freq fc.freq +#define Code fc.code +#define Dad dl.dad +#define Len dl.len + +typedef struct static_tree_desc_s static_tree_desc; + +typedef struct tree_desc_s { + ct_data *dyn_tree; /* the dynamic tree */ + int max_code; /* largest code with non zero frequency */ + static_tree_desc *stat_desc; /* the corresponding static tree */ +} FAR tree_desc; + +typedef ush Pos; +typedef Pos FAR Posf; +typedef unsigned IPos; + +/* A Pos is an index in the character window. We use short instead of int to + * save space in the various tables. IPos is used only for parameter passing. + */ + +typedef struct internal_state { + z_streamp strm; /* pointer back to this zlib stream */ + int status; /* as the name implies */ + Bytef *pending_buf; /* output still pending */ + ulg pending_buf_size; /* size of pending_buf */ + Bytef *pending_out; /* next pending byte to output to the stream */ + uInt pending; /* nb of bytes in the pending buffer */ + int wrap; /* bit 0 true for zlib, bit 1 true for gzip */ + gz_headerp gzhead; /* gzip header information to write */ + uInt gzindex; /* where in extra, name, or comment */ + Byte method; /* STORED (for zip only) or DEFLATED */ + int last_flush; /* value of flush param for previous deflate call */ + + /* used by deflate.c: */ + + uInt w_size; /* LZ77 window size (32K by default) */ + uInt w_bits; /* log2(w_size) (8..16) */ + uInt w_mask; /* w_size - 1 */ + + Bytef *window; + /* Sliding window. Input bytes are read into the second half of the window, + * and move to the first half later to keep a dictionary of at least wSize + * bytes. With this organization, matches are limited to a distance of + * wSize-MAX_MATCH bytes, but this ensures that IO is always + * performed with a length multiple of the block size. Also, it limits + * the window size to 64K, which is quite useful on MSDOS. + * To do: use the user input buffer as sliding window. + */ + + ulg window_size; + /* Actual size of window: 2*wSize, except when the user input buffer + * is directly used as sliding window. + */ + + Posf *prev; + /* Link to older string with same hash index. To limit the size of this + * array to 64K, this link is maintained only for the last 32K strings. + * An index in this array is thus a window index modulo 32K. + */ + + Posf *head; /* Heads of the hash chains or NIL. */ + + uInt ins_h; /* hash index of string to be inserted */ + uInt hash_size; /* number of elements in hash table */ + uInt hash_bits; /* log2(hash_size) */ + uInt hash_mask; /* hash_size-1 */ + + uInt hash_shift; + /* Number of bits by which ins_h must be shifted at each input + * step. It must be such that after MIN_MATCH steps, the oldest + * byte no longer takes part in the hash key, that is: + * hash_shift * MIN_MATCH >= hash_bits + */ + + long block_start; + /* Window position at the beginning of the current output block. Gets + * negative when the window is moved backwards. + */ + + uInt match_length; /* length of best match */ + IPos prev_match; /* previous match */ + int match_available; /* set if previous match exists */ + uInt strstart; /* start of string to insert */ + uInt match_start; /* start of matching string */ + uInt lookahead; /* number of valid bytes ahead in window */ + + uInt prev_length; + /* Length of the best match at previous step. Matches not greater than this + * are discarded. This is used in the lazy match evaluation. + */ + + uInt max_chain_length; + /* To speed up deflation, hash chains are never searched beyond this + * length. A higher limit improves compression ratio but degrades the + * speed. + */ + + uInt max_lazy_match; + /* Attempt to find a better match only when the current match is strictly + * smaller than this value. This mechanism is used only for compression + * levels >= 4. + */ +# define max_insert_length max_lazy_match + /* Insert new strings in the hash table only if the match length is not + * greater than this length. This saves time but degrades compression. + * max_insert_length is used only for compression levels <= 3. + */ + + int level; /* compression level (1..9) */ + int strategy; /* favor or force Huffman coding*/ + + uInt good_match; + /* Use a faster search when the previous match is longer than this */ + + int nice_match; /* Stop searching when current match exceeds this */ + + /* used by trees.c: */ + /* Didn't use ct_data typedef below to supress compiler warning */ + struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */ + struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */ + struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */ + + struct tree_desc_s l_desc; /* desc. for literal tree */ + struct tree_desc_s d_desc; /* desc. for distance tree */ + struct tree_desc_s bl_desc; /* desc. for bit length tree */ + + ush bl_count[MAX_BITS+1]; + /* number of codes at each bit length for an optimal tree */ + + int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */ + int heap_len; /* number of elements in the heap */ + int heap_max; /* element of largest frequency */ + /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used. + * The same heap array is used to build all trees. + */ + + uch depth[2*L_CODES+1]; + /* Depth of each subtree used as tie breaker for trees of equal frequency + */ + + uchf *l_buf; /* buffer for literals or lengths */ + + uInt lit_bufsize; + /* Size of match buffer for literals/lengths. There are 4 reasons for + * limiting lit_bufsize to 64K: + * - frequencies can be kept in 16 bit counters + * - if compression is not successful for the first block, all input + * data is still in the window so we can still emit a stored block even + * when input comes from standard input. (This can also be done for + * all blocks if lit_bufsize is not greater than 32K.) + * - if compression is not successful for a file smaller than 64K, we can + * even emit a stored file instead of a stored block (saving 5 bytes). + * This is applicable only for zip (not gzip or zlib). + * - creating new Huffman trees less frequently may not provide fast + * adaptation to changes in the input data statistics. (Take for + * example a binary file with poorly compressible code followed by + * a highly compressible string table.) Smaller buffer sizes give + * fast adaptation but have of course the overhead of transmitting + * trees more frequently. + * - I can't count above 4 + */ + + uInt last_lit; /* running index in l_buf */ + + ushf *d_buf; + /* Buffer for distances. To simplify the code, d_buf and l_buf have + * the same number of elements. To use different lengths, an extra flag + * array would be necessary. + */ + + ulg opt_len; /* bit length of current block with optimal trees */ + ulg static_len; /* bit length of current block with static trees */ + uInt matches; /* number of string matches in current block */ + int last_eob_len; /* bit length of EOB code for last block */ + +#ifdef DEBUG + ulg compressed_len; /* total bit length of compressed file mod 2^32 */ + ulg bits_sent; /* bit length of compressed data sent mod 2^32 */ +#endif + + ush bi_buf; + /* Output buffer. bits are inserted starting at the bottom (least + * significant bits). + */ + int bi_valid; + /* Number of valid bits in bi_buf. All bits above the last valid bit + * are always zero. + */ + +} FAR deflate_state; + +/* Output a byte on the stream. + * IN assertion: there is enough room in pending_buf. + */ +#define put_byte(s, c) {s->pending_buf[s->pending++] = (c);} + + +#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1) +/* Minimum amount of lookahead, except at the end of the input file. + * See deflate.c for comments about the MIN_MATCH+1. + */ + +#define MAX_DIST(s) ((s)->w_size-MIN_LOOKAHEAD) +/* In order to simplify the code, particularly on 16 bit machines, match + * distances are limited to MAX_DIST instead of WSIZE. + */ + + /* in trees.c */ +void _tr_init OF((deflate_state *s)); +int _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc)); +void _tr_flush_block OF((deflate_state *s, charf *buf, ulg stored_len, + int eof)); +void _tr_align OF((deflate_state *s)); +void _tr_stored_block OF((deflate_state *s, charf *buf, ulg stored_len, + int eof)); + +#define d_code(dist) \ + ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)]) +/* Mapping from a distance to a distance code. dist is the distance - 1 and + * must not have side effects. _dist_code[256] and _dist_code[257] are never + * used. + */ + +#ifndef DEBUG +/* Inline versions of _tr_tally for speed: */ + +#if defined(GEN_TREES_H) || !defined(STDC) + extern uch _length_code[]; + extern uch _dist_code[]; +#else + extern const uch _length_code[]; + extern const uch _dist_code[]; +#endif + +# define _tr_tally_lit(s, c, flush) \ + { uch cc = (c); \ + s->d_buf[s->last_lit] = 0; \ + s->l_buf[s->last_lit++] = cc; \ + s->dyn_ltree[cc].Freq++; \ + flush = (s->last_lit == s->lit_bufsize-1); \ + } +# define _tr_tally_dist(s, distance, length, flush) \ + { uch len = (length); \ + ush dist = (distance); \ + s->d_buf[s->last_lit] = dist; \ + s->l_buf[s->last_lit++] = len; \ + dist--; \ + s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \ + s->dyn_dtree[d_code(dist)].Freq++; \ + flush = (s->last_lit == s->lit_bufsize-1); \ + } +#else +# define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c) +# define _tr_tally_dist(s, distance, length, flush) \ + flush = _tr_tally(s, distance, length) +#endif + +#endif /* DEFLATE_H */ diff --git a/dep/StormLib/src/zlib/inffast.c b/dep/StormLib/src/zlib/inffast.c new file mode 100644 index 00000000000..bbee92ed1e6 --- /dev/null +++ b/dep/StormLib/src/zlib/inffast.c @@ -0,0 +1,318 @@ +/* inffast.c -- fast decoding + * Copyright (C) 1995-2004 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +#include "zutil.h" +#include "inftrees.h" +#include "inflate.h" +#include "inffast.h" + +#ifndef ASMINF + +/* Allow machine dependent optimization for post-increment or pre-increment. + Based on testing to date, + Pre-increment preferred for: + - PowerPC G3 (Adler) + - MIPS R5000 (Randers-Pehrson) + Post-increment preferred for: + - none + No measurable difference: + - Pentium III (Anderson) + - M68060 (Nikl) + */ +#ifdef POSTINC +# define OFF 0 +# define PUP(a) *(a)++ +#else +# define OFF 1 +# define PUP(a) *++(a) +#endif + +/* + Decode literal, length, and distance codes and write out the resulting + literal and match bytes until either not enough input or output is + available, an end-of-block is encountered, or a data error is encountered. + When large enough input and output buffers are supplied to inflate(), for + example, a 16K input buffer and a 64K output buffer, more than 95% of the + inflate execution time is spent in this routine. + + Entry assumptions: + + state->mode == LEN + strm->avail_in >= 6 + strm->avail_out >= 258 + start >= strm->avail_out + state->bits < 8 + + On return, state->mode is one of: + + LEN -- ran out of enough output space or enough available input + TYPE -- reached end of block code, inflate() to interpret next block + BAD -- error in block data + + Notes: + + - The maximum input bits used by a length/distance pair is 15 bits for the + length code, 5 bits for the length extra, 15 bits for the distance code, + and 13 bits for the distance extra. This totals 48 bits, or six bytes. + Therefore if strm->avail_in >= 6, then there is enough input to avoid + checking for available input while decoding. + + - The maximum bytes that a single length/distance pair can output is 258 + bytes, which is the maximum length that can be coded. inflate_fast() + requires strm->avail_out >= 258 for each loop to avoid checking for + output space. + */ +void inflate_fast(strm, start) +z_streamp strm; +unsigned start; /* inflate()'s starting value for strm->avail_out */ +{ + struct inflate_state FAR *state; + unsigned char FAR *in; /* local strm->next_in */ + unsigned char FAR *last; /* while in < last, enough input available */ + unsigned char FAR *out; /* local strm->next_out */ + unsigned char FAR *beg; /* inflate()'s initial strm->next_out */ + unsigned char FAR *end; /* while out < end, enough space available */ +#ifdef INFLATE_STRICT + unsigned dmax; /* maximum distance from zlib header */ +#endif + unsigned wsize; /* window size or zero if not using window */ + unsigned whave; /* valid bytes in the window */ + unsigned write; /* window write index */ + unsigned char FAR *window; /* allocated sliding window, if wsize != 0 */ + unsigned long hold; /* local strm->hold */ + unsigned bits; /* local strm->bits */ + code const FAR *lcode; /* local strm->lencode */ + code const FAR *dcode; /* local strm->distcode */ + unsigned lmask; /* mask for first level of length codes */ + unsigned dmask; /* mask for first level of distance codes */ + code this; /* retrieved table entry */ + unsigned op; /* code bits, operation, extra bits, or */ + /* window position, window bytes to copy */ + unsigned len; /* match length, unused bytes */ + unsigned dist; /* match distance */ + unsigned char FAR *from; /* where to copy match from */ + + /* copy state to local variables */ + state = (struct inflate_state FAR *)strm->state; + in = strm->next_in - OFF; + last = in + (strm->avail_in - 5); + out = strm->next_out - OFF; + beg = out - (start - strm->avail_out); + end = out + (strm->avail_out - 257); +#ifdef INFLATE_STRICT + dmax = state->dmax; +#endif + wsize = state->wsize; + whave = state->whave; + write = state->write; + window = state->window; + hold = state->hold; + bits = state->bits; + lcode = state->lencode; + dcode = state->distcode; + lmask = (1U << state->lenbits) - 1; + dmask = (1U << state->distbits) - 1; + + /* decode literals and length/distances until end-of-block or not enough + input data or output space */ + do { + if (bits < 15) { + hold += (unsigned long)(PUP(in)) << bits; + bits += 8; + hold += (unsigned long)(PUP(in)) << bits; + bits += 8; + } + this = lcode[hold & lmask]; + dolen: + op = (unsigned)(this.bits); + hold >>= op; + bits -= op; + op = (unsigned)(this.op); + if (op == 0) { /* literal */ + Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ? + "inflate: literal '%c'\n" : + "inflate: literal 0x%02x\n", this.val)); + PUP(out) = (unsigned char)(this.val); + } + else if (op & 16) { /* length base */ + len = (unsigned)(this.val); + op &= 15; /* number of extra bits */ + if (op) { + if (bits < op) { + hold += (unsigned long)(PUP(in)) << bits; + bits += 8; + } + len += (unsigned)hold & ((1U << op) - 1); + hold >>= op; + bits -= op; + } + Tracevv((stderr, "inflate: length %u\n", len)); + if (bits < 15) { + hold += (unsigned long)(PUP(in)) << bits; + bits += 8; + hold += (unsigned long)(PUP(in)) << bits; + bits += 8; + } + this = dcode[hold & dmask]; + dodist: + op = (unsigned)(this.bits); + hold >>= op; + bits -= op; + op = (unsigned)(this.op); + if (op & 16) { /* distance base */ + dist = (unsigned)(this.val); + op &= 15; /* number of extra bits */ + if (bits < op) { + hold += (unsigned long)(PUP(in)) << bits; + bits += 8; + if (bits < op) { + hold += (unsigned long)(PUP(in)) << bits; + bits += 8; + } + } + dist += (unsigned)hold & ((1U << op) - 1); +#ifdef INFLATE_STRICT + if (dist > dmax) { + strm->msg = (char *)"invalid distance too far back"; + state->mode = BAD; + break; + } +#endif + hold >>= op; + bits -= op; + Tracevv((stderr, "inflate: distance %u\n", dist)); + op = (unsigned)(out - beg); /* max distance in output */ + if (dist > op) { /* see if copy from window */ + op = dist - op; /* distance back in window */ + if (op > whave) { + strm->msg = (char *)"invalid distance too far back"; + state->mode = BAD; + break; + } + from = window - OFF; + if (write == 0) { /* very common case */ + from += wsize - op; + if (op < len) { /* some from window */ + len -= op; + do { + PUP(out) = PUP(from); + } while (--op); + from = out - dist; /* rest from output */ + } + } + else if (write < op) { /* wrap around window */ + from += wsize + write - op; + op -= write; + if (op < len) { /* some from end of window */ + len -= op; + do { + PUP(out) = PUP(from); + } while (--op); + from = window - OFF; + if (write < len) { /* some from start of window */ + op = write; + len -= op; + do { + PUP(out) = PUP(from); + } while (--op); + from = out - dist; /* rest from output */ + } + } + } + else { /* contiguous in window */ + from += write - op; + if (op < len) { /* some from window */ + len -= op; + do { + PUP(out) = PUP(from); + } while (--op); + from = out - dist; /* rest from output */ + } + } + while (len > 2) { + PUP(out) = PUP(from); + PUP(out) = PUP(from); + PUP(out) = PUP(from); + len -= 3; + } + if (len) { + PUP(out) = PUP(from); + if (len > 1) + PUP(out) = PUP(from); + } + } + else { + from = out - dist; /* copy direct from output */ + do { /* minimum length is three */ + PUP(out) = PUP(from); + PUP(out) = PUP(from); + PUP(out) = PUP(from); + len -= 3; + } while (len > 2); + if (len) { + PUP(out) = PUP(from); + if (len > 1) + PUP(out) = PUP(from); + } + } + } + else if ((op & 64) == 0) { /* 2nd level distance code */ + this = dcode[this.val + (hold & ((1U << op) - 1))]; + goto dodist; + } + else { + strm->msg = (char *)"invalid distance code"; + state->mode = BAD; + break; + } + } + else if ((op & 64) == 0) { /* 2nd level length code */ + this = lcode[this.val + (hold & ((1U << op) - 1))]; + goto dolen; + } + else if (op & 32) { /* end-of-block */ + Tracevv((stderr, "inflate: end of block\n")); + state->mode = TYPE; + break; + } + else { + strm->msg = (char *)"invalid literal/length code"; + state->mode = BAD; + break; + } + } while (in < last && out < end); + + /* return unused bytes (on entry, bits < 8, so in won't go too far back) */ + len = bits >> 3; + in -= len; + bits -= len << 3; + hold &= (1U << bits) - 1; + + /* update state and return */ + strm->next_in = in + OFF; + strm->next_out = out + OFF; + strm->avail_in = (unsigned)(in < last ? 5 + (last - in) : 5 - (in - last)); + strm->avail_out = (unsigned)(out < end ? + 257 + (end - out) : 257 - (out - end)); + state->hold = hold; + state->bits = bits; + return; +} + +/* + inflate_fast() speedups that turned out slower (on a PowerPC G3 750CXe): + - Using bit fields for code structure + - Different op definition to avoid & for extra bits (do & for table bits) + - Three separate decoding do-loops for direct, window, and write == 0 + - Special case for distance > 1 copies to do overlapped load and store copy + - Explicit branch predictions (based on measured branch probabilities) + - Deferring match copy and interspersed it with decoding subsequent codes + - Swapping literal/length else + - Swapping window/direct else + - Larger unrolled copy loops (three is about right) + - Moving len -= 3 statement into middle of loop + */ + +#endif /* !ASMINF */ diff --git a/dep/StormLib/src/zlib/inffast.h b/dep/StormLib/src/zlib/inffast.h new file mode 100644 index 00000000000..1e88d2d97b5 --- /dev/null +++ b/dep/StormLib/src/zlib/inffast.h @@ -0,0 +1,11 @@ +/* inffast.h -- header to use inffast.c + * Copyright (C) 1995-2003 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +void inflate_fast OF((z_streamp strm, unsigned start)); diff --git a/dep/StormLib/src/zlib/inffixed.h b/dep/StormLib/src/zlib/inffixed.h new file mode 100644 index 00000000000..75ed4b5978d --- /dev/null +++ b/dep/StormLib/src/zlib/inffixed.h @@ -0,0 +1,94 @@ + /* inffixed.h -- table for decoding fixed codes + * Generated automatically by makefixed(). + */ + + /* WARNING: this file should *not* be used by applications. It + is part of the implementation of the compression library and + is subject to change. Applications should only use zlib.h. + */ + + static const code lenfix[512] = { + {96,7,0},{0,8,80},{0,8,16},{20,8,115},{18,7,31},{0,8,112},{0,8,48}, + {0,9,192},{16,7,10},{0,8,96},{0,8,32},{0,9,160},{0,8,0},{0,8,128}, + {0,8,64},{0,9,224},{16,7,6},{0,8,88},{0,8,24},{0,9,144},{19,7,59}, + {0,8,120},{0,8,56},{0,9,208},{17,7,17},{0,8,104},{0,8,40},{0,9,176}, + {0,8,8},{0,8,136},{0,8,72},{0,9,240},{16,7,4},{0,8,84},{0,8,20}, + {21,8,227},{19,7,43},{0,8,116},{0,8,52},{0,9,200},{17,7,13},{0,8,100}, + {0,8,36},{0,9,168},{0,8,4},{0,8,132},{0,8,68},{0,9,232},{16,7,8}, + {0,8,92},{0,8,28},{0,9,152},{20,7,83},{0,8,124},{0,8,60},{0,9,216}, + {18,7,23},{0,8,108},{0,8,44},{0,9,184},{0,8,12},{0,8,140},{0,8,76}, + {0,9,248},{16,7,3},{0,8,82},{0,8,18},{21,8,163},{19,7,35},{0,8,114}, + {0,8,50},{0,9,196},{17,7,11},{0,8,98},{0,8,34},{0,9,164},{0,8,2}, + {0,8,130},{0,8,66},{0,9,228},{16,7,7},{0,8,90},{0,8,26},{0,9,148}, + {20,7,67},{0,8,122},{0,8,58},{0,9,212},{18,7,19},{0,8,106},{0,8,42}, + {0,9,180},{0,8,10},{0,8,138},{0,8,74},{0,9,244},{16,7,5},{0,8,86}, + {0,8,22},{64,8,0},{19,7,51},{0,8,118},{0,8,54},{0,9,204},{17,7,15}, + {0,8,102},{0,8,38},{0,9,172},{0,8,6},{0,8,134},{0,8,70},{0,9,236}, + {16,7,9},{0,8,94},{0,8,30},{0,9,156},{20,7,99},{0,8,126},{0,8,62}, + {0,9,220},{18,7,27},{0,8,110},{0,8,46},{0,9,188},{0,8,14},{0,8,142}, + {0,8,78},{0,9,252},{96,7,0},{0,8,81},{0,8,17},{21,8,131},{18,7,31}, + {0,8,113},{0,8,49},{0,9,194},{16,7,10},{0,8,97},{0,8,33},{0,9,162}, + {0,8,1},{0,8,129},{0,8,65},{0,9,226},{16,7,6},{0,8,89},{0,8,25}, + {0,9,146},{19,7,59},{0,8,121},{0,8,57},{0,9,210},{17,7,17},{0,8,105}, + {0,8,41},{0,9,178},{0,8,9},{0,8,137},{0,8,73},{0,9,242},{16,7,4}, + {0,8,85},{0,8,21},{16,8,258},{19,7,43},{0,8,117},{0,8,53},{0,9,202}, + {17,7,13},{0,8,101},{0,8,37},{0,9,170},{0,8,5},{0,8,133},{0,8,69}, + {0,9,234},{16,7,8},{0,8,93},{0,8,29},{0,9,154},{20,7,83},{0,8,125}, + {0,8,61},{0,9,218},{18,7,23},{0,8,109},{0,8,45},{0,9,186},{0,8,13}, + {0,8,141},{0,8,77},{0,9,250},{16,7,3},{0,8,83},{0,8,19},{21,8,195}, + {19,7,35},{0,8,115},{0,8,51},{0,9,198},{17,7,11},{0,8,99},{0,8,35}, + {0,9,166},{0,8,3},{0,8,131},{0,8,67},{0,9,230},{16,7,7},{0,8,91}, + {0,8,27},{0,9,150},{20,7,67},{0,8,123},{0,8,59},{0,9,214},{18,7,19}, + {0,8,107},{0,8,43},{0,9,182},{0,8,11},{0,8,139},{0,8,75},{0,9,246}, + {16,7,5},{0,8,87},{0,8,23},{64,8,0},{19,7,51},{0,8,119},{0,8,55}, + {0,9,206},{17,7,15},{0,8,103},{0,8,39},{0,9,174},{0,8,7},{0,8,135}, + {0,8,71},{0,9,238},{16,7,9},{0,8,95},{0,8,31},{0,9,158},{20,7,99}, + {0,8,127},{0,8,63},{0,9,222},{18,7,27},{0,8,111},{0,8,47},{0,9,190}, + {0,8,15},{0,8,143},{0,8,79},{0,9,254},{96,7,0},{0,8,80},{0,8,16}, + {20,8,115},{18,7,31},{0,8,112},{0,8,48},{0,9,193},{16,7,10},{0,8,96}, + {0,8,32},{0,9,161},{0,8,0},{0,8,128},{0,8,64},{0,9,225},{16,7,6}, + {0,8,88},{0,8,24},{0,9,145},{19,7,59},{0,8,120},{0,8,56},{0,9,209}, + {17,7,17},{0,8,104},{0,8,40},{0,9,177},{0,8,8},{0,8,136},{0,8,72}, + {0,9,241},{16,7,4},{0,8,84},{0,8,20},{21,8,227},{19,7,43},{0,8,116}, + {0,8,52},{0,9,201},{17,7,13},{0,8,100},{0,8,36},{0,9,169},{0,8,4}, + {0,8,132},{0,8,68},{0,9,233},{16,7,8},{0,8,92},{0,8,28},{0,9,153}, + {20,7,83},{0,8,124},{0,8,60},{0,9,217},{18,7,23},{0,8,108},{0,8,44}, + {0,9,185},{0,8,12},{0,8,140},{0,8,76},{0,9,249},{16,7,3},{0,8,82}, + {0,8,18},{21,8,163},{19,7,35},{0,8,114},{0,8,50},{0,9,197},{17,7,11}, + {0,8,98},{0,8,34},{0,9,165},{0,8,2},{0,8,130},{0,8,66},{0,9,229}, + {16,7,7},{0,8,90},{0,8,26},{0,9,149},{20,7,67},{0,8,122},{0,8,58}, + {0,9,213},{18,7,19},{0,8,106},{0,8,42},{0,9,181},{0,8,10},{0,8,138}, + {0,8,74},{0,9,245},{16,7,5},{0,8,86},{0,8,22},{64,8,0},{19,7,51}, + {0,8,118},{0,8,54},{0,9,205},{17,7,15},{0,8,102},{0,8,38},{0,9,173}, + {0,8,6},{0,8,134},{0,8,70},{0,9,237},{16,7,9},{0,8,94},{0,8,30}, + {0,9,157},{20,7,99},{0,8,126},{0,8,62},{0,9,221},{18,7,27},{0,8,110}, + {0,8,46},{0,9,189},{0,8,14},{0,8,142},{0,8,78},{0,9,253},{96,7,0}, + {0,8,81},{0,8,17},{21,8,131},{18,7,31},{0,8,113},{0,8,49},{0,9,195}, + {16,7,10},{0,8,97},{0,8,33},{0,9,163},{0,8,1},{0,8,129},{0,8,65}, + {0,9,227},{16,7,6},{0,8,89},{0,8,25},{0,9,147},{19,7,59},{0,8,121}, + {0,8,57},{0,9,211},{17,7,17},{0,8,105},{0,8,41},{0,9,179},{0,8,9}, + {0,8,137},{0,8,73},{0,9,243},{16,7,4},{0,8,85},{0,8,21},{16,8,258}, + {19,7,43},{0,8,117},{0,8,53},{0,9,203},{17,7,13},{0,8,101},{0,8,37}, + {0,9,171},{0,8,5},{0,8,133},{0,8,69},{0,9,235},{16,7,8},{0,8,93}, + {0,8,29},{0,9,155},{20,7,83},{0,8,125},{0,8,61},{0,9,219},{18,7,23}, + {0,8,109},{0,8,45},{0,9,187},{0,8,13},{0,8,141},{0,8,77},{0,9,251}, + {16,7,3},{0,8,83},{0,8,19},{21,8,195},{19,7,35},{0,8,115},{0,8,51}, + {0,9,199},{17,7,11},{0,8,99},{0,8,35},{0,9,167},{0,8,3},{0,8,131}, + {0,8,67},{0,9,231},{16,7,7},{0,8,91},{0,8,27},{0,9,151},{20,7,67}, + {0,8,123},{0,8,59},{0,9,215},{18,7,19},{0,8,107},{0,8,43},{0,9,183}, + {0,8,11},{0,8,139},{0,8,75},{0,9,247},{16,7,5},{0,8,87},{0,8,23}, + {64,8,0},{19,7,51},{0,8,119},{0,8,55},{0,9,207},{17,7,15},{0,8,103}, + {0,8,39},{0,9,175},{0,8,7},{0,8,135},{0,8,71},{0,9,239},{16,7,9}, + {0,8,95},{0,8,31},{0,9,159},{20,7,99},{0,8,127},{0,8,63},{0,9,223}, + {18,7,27},{0,8,111},{0,8,47},{0,9,191},{0,8,15},{0,8,143},{0,8,79}, + {0,9,255} + }; + + static const code distfix[32] = { + {16,5,1},{23,5,257},{19,5,17},{27,5,4097},{17,5,5},{25,5,1025}, + {21,5,65},{29,5,16385},{16,5,3},{24,5,513},{20,5,33},{28,5,8193}, + {18,5,9},{26,5,2049},{22,5,129},{64,5,0},{16,5,2},{23,5,385}, + {19,5,25},{27,5,6145},{17,5,7},{25,5,1537},{21,5,97},{29,5,24577}, + {16,5,4},{24,5,769},{20,5,49},{28,5,12289},{18,5,13},{26,5,3073}, + {22,5,193},{64,5,0} + }; diff --git a/dep/StormLib/src/zlib/inflate.c b/dep/StormLib/src/zlib/inflate.c new file mode 100644 index 00000000000..792fdee8e9c --- /dev/null +++ b/dep/StormLib/src/zlib/inflate.c @@ -0,0 +1,1368 @@ +/* inflate.c -- zlib decompression + * Copyright (C) 1995-2005 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* + * Change history: + * + * 1.2.beta0 24 Nov 2002 + * - First version -- complete rewrite of inflate to simplify code, avoid + * creation of window when not needed, minimize use of window when it is + * needed, make inffast.c even faster, implement gzip decoding, and to + * improve code readability and style over the previous zlib inflate code + * + * 1.2.beta1 25 Nov 2002 + * - Use pointers for available input and output checking in inffast.c + * - Remove input and output counters in inffast.c + * - Change inffast.c entry and loop from avail_in >= 7 to >= 6 + * - Remove unnecessary second byte pull from length extra in inffast.c + * - Unroll direct copy to three copies per loop in inffast.c + * + * 1.2.beta2 4 Dec 2002 + * - Change external routine names to reduce potential conflicts + * - Correct filename to inffixed.h for fixed tables in inflate.c + * - Make hbuf[] unsigned char to match parameter type in inflate.c + * - Change strm->next_out[-state->offset] to *(strm->next_out - state->offset) + * to avoid negation problem on Alphas (64 bit) in inflate.c + * + * 1.2.beta3 22 Dec 2002 + * - Add comments on state->bits assertion in inffast.c + * - Add comments on op field in inftrees.h + * - Fix bug in reuse of allocated window after inflateReset() + * - Remove bit fields--back to byte structure for speed + * - Remove distance extra == 0 check in inflate_fast()--only helps for lengths + * - Change post-increments to pre-increments in inflate_fast(), PPC biased? + * - Add compile time option, POSTINC, to use post-increments instead (Intel?) + * - Make MATCH copy in inflate() much faster for when inflate_fast() not used + * - Use local copies of stream next and avail values, as well as local bit + * buffer and bit count in inflate()--for speed when inflate_fast() not used + * + * 1.2.beta4 1 Jan 2003 + * - Split ptr - 257 statements in inflate_table() to avoid compiler warnings + * - Move a comment on output buffer sizes from inffast.c to inflate.c + * - Add comments in inffast.c to introduce the inflate_fast() routine + * - Rearrange window copies in inflate_fast() for speed and simplification + * - Unroll last copy for window match in inflate_fast() + * - Use local copies of window variables in inflate_fast() for speed + * - Pull out common write == 0 case for speed in inflate_fast() + * - Make op and len in inflate_fast() unsigned for consistency + * - Add FAR to lcode and dcode declarations in inflate_fast() + * - Simplified bad distance check in inflate_fast() + * - Added inflateBackInit(), inflateBack(), and inflateBackEnd() in new + * source file infback.c to provide a call-back interface to inflate for + * programs like gzip and unzip -- uses window as output buffer to avoid + * window copying + * + * 1.2.beta5 1 Jan 2003 + * - Improved inflateBack() interface to allow the caller to provide initial + * input in strm. + * - Fixed stored blocks bug in inflateBack() + * + * 1.2.beta6 4 Jan 2003 + * - Added comments in inffast.c on effectiveness of POSTINC + * - Typecasting all around to reduce compiler warnings + * - Changed loops from while (1) or do {} while (1) to for (;;), again to + * make compilers happy + * - Changed type of window in inflateBackInit() to unsigned char * + * + * 1.2.beta7 27 Jan 2003 + * - Changed many types to unsigned or unsigned short to avoid warnings + * - Added inflateCopy() function + * + * 1.2.0 9 Mar 2003 + * - Changed inflateBack() interface to provide separate opaque descriptors + * for the in() and out() functions + * - Changed inflateBack() argument and in_func typedef to swap the length + * and buffer address return values for the input function + * - Check next_in and next_out for Z_NULL on entry to inflate() + * + * The history for versions after 1.2.0 are in ChangeLog in zlib distribution. + */ + +#include "zutil.h" +#include "inftrees.h" +#include "inflate.h" +#include "inffast.h" + +#ifdef MAKEFIXED +# ifndef BUILDFIXED +# define BUILDFIXED +# endif +#endif + +/* function prototypes */ +local void fixedtables OF((struct inflate_state FAR *state)); +local int updatewindow OF((z_streamp strm, unsigned out)); +#ifdef BUILDFIXED + void makefixed OF((void)); +#endif +local unsigned syncsearch OF((unsigned FAR *have, unsigned char FAR *buf, + unsigned len)); + +int ZEXPORT inflateReset(strm) +z_streamp strm; +{ + struct inflate_state FAR *state; + + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)strm->state; + strm->total_in = strm->total_out = state->total = 0; + strm->msg = Z_NULL; + strm->adler = 1; /* to support ill-conceived Java test suite */ + state->mode = HEAD; + state->last = 0; + state->havedict = 0; + state->dmax = 32768U; + state->head = Z_NULL; + state->wsize = 0; + state->whave = 0; + state->write = 0; + state->hold = 0; + state->bits = 0; + state->lencode = state->distcode = state->next = state->codes; + Tracev((stderr, "inflate: reset\n")); + return Z_OK; +} + +int ZEXPORT inflatePrime(strm, bits, value) +z_streamp strm; +int bits; +int value; +{ + struct inflate_state FAR *state; + + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)strm->state; + if (bits > 16 || state->bits + bits > 32) return Z_STREAM_ERROR; + value &= (1L << bits) - 1; + state->hold += value << state->bits; + state->bits += bits; + return Z_OK; +} + +int ZEXPORT inflateInit2_(strm, windowBits, version, stream_size) +z_streamp strm; +int windowBits; +const char *version; +int stream_size; +{ + struct inflate_state FAR *state; + + if (version == Z_NULL || version[0] != ZLIB_VERSION[0] || + stream_size != (int)(sizeof(z_stream))) + return Z_VERSION_ERROR; + if (strm == Z_NULL) return Z_STREAM_ERROR; + strm->msg = Z_NULL; /* in case we return an error */ + if (strm->zalloc == (alloc_func)0) { + strm->zalloc = zcalloc; + strm->opaque = (voidpf)0; + } + if (strm->zfree == (free_func)0) strm->zfree = zcfree; + state = (struct inflate_state FAR *) + ZALLOC(strm, 1, sizeof(struct inflate_state)); + if (state == Z_NULL) return Z_MEM_ERROR; + Tracev((stderr, "inflate: allocated\n")); + strm->state = (struct internal_state FAR *)state; + if (windowBits < 0) { + state->wrap = 0; + windowBits = -windowBits; + } + else { + state->wrap = (windowBits >> 4) + 1; +#ifdef GUNZIP + if (windowBits < 48) windowBits &= 15; +#endif + } + if (windowBits < 8 || windowBits > 15) { + ZFREE(strm, state); + strm->state = Z_NULL; + return Z_STREAM_ERROR; + } + state->wbits = (unsigned)windowBits; + state->window = Z_NULL; + return inflateReset(strm); +} + +int ZEXPORT inflateInit_(strm, version, stream_size) +z_streamp strm; +const char *version; +int stream_size; +{ + return inflateInit2_(strm, DEF_WBITS, version, stream_size); +} + +/* + Return state with length and distance decoding tables and index sizes set to + fixed code decoding. Normally this returns fixed tables from inffixed.h. + If BUILDFIXED is defined, then instead this routine builds the tables the + first time it's called, and returns those tables the first time and + thereafter. This reduces the size of the code by about 2K bytes, in + exchange for a little execution time. However, BUILDFIXED should not be + used for threaded applications, since the rewriting of the tables and virgin + may not be thread-safe. + */ +local void fixedtables(state) +struct inflate_state FAR *state; +{ +#ifdef BUILDFIXED + static int virgin = 1; + static code *lenfix, *distfix; + static code fixed[544]; + + /* build fixed huffman tables if first call (may not be thread safe) */ + if (virgin) { + unsigned sym, bits; + static code *next; + + /* literal/length table */ + sym = 0; + while (sym < 144) state->lens[sym++] = 8; + while (sym < 256) state->lens[sym++] = 9; + while (sym < 280) state->lens[sym++] = 7; + while (sym < 288) state->lens[sym++] = 8; + next = fixed; + lenfix = next; + bits = 9; + inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work); + + /* distance table */ + sym = 0; + while (sym < 32) state->lens[sym++] = 5; + distfix = next; + bits = 5; + inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work); + + /* do this just once */ + virgin = 0; + } +#else /* !BUILDFIXED */ +# include "inffixed.h" +#endif /* BUILDFIXED */ + state->lencode = lenfix; + state->lenbits = 9; + state->distcode = distfix; + state->distbits = 5; +} + +#ifdef MAKEFIXED +#include + +/* + Write out the inffixed.h that is #include'd above. Defining MAKEFIXED also + defines BUILDFIXED, so the tables are built on the fly. makefixed() writes + those tables to stdout, which would be piped to inffixed.h. A small program + can simply call makefixed to do this: + + void makefixed(void); + + int main(void) + { + makefixed(); + return 0; + } + + Then that can be linked with zlib built with MAKEFIXED defined and run: + + a.out > inffixed.h + */ +void makefixed() +{ + unsigned low, size; + struct inflate_state state; + + fixedtables(&state); + puts(" /* inffixed.h -- table for decoding fixed codes"); + puts(" * Generated automatically by makefixed()."); + puts(" */"); + puts(""); + puts(" /* WARNING: this file should *not* be used by applications."); + puts(" It is part of the implementation of this library and is"); + puts(" subject to change. Applications should only use zlib.h."); + puts(" */"); + puts(""); + size = 1U << 9; + printf(" static const code lenfix[%u] = {", size); + low = 0; + for (;;) { + if ((low % 7) == 0) printf("\n "); + printf("{%u,%u,%d}", state.lencode[low].op, state.lencode[low].bits, + state.lencode[low].val); + if (++low == size) break; + putchar(','); + } + puts("\n };"); + size = 1U << 5; + printf("\n static const code distfix[%u] = {", size); + low = 0; + for (;;) { + if ((low % 6) == 0) printf("\n "); + printf("{%u,%u,%d}", state.distcode[low].op, state.distcode[low].bits, + state.distcode[low].val); + if (++low == size) break; + putchar(','); + } + puts("\n };"); +} +#endif /* MAKEFIXED */ + +/* + Update the window with the last wsize (normally 32K) bytes written before + returning. If window does not exist yet, create it. This is only called + when a window is already in use, or when output has been written during this + inflate call, but the end of the deflate stream has not been reached yet. + It is also called to create a window for dictionary data when a dictionary + is loaded. + + Providing output buffers larger than 32K to inflate() should provide a speed + advantage, since only the last 32K of output is copied to the sliding window + upon return from inflate(), and since all distances after the first 32K of + output will fall in the output data, making match copies simpler and faster. + The advantage may be dependent on the size of the processor's data caches. + */ +local int updatewindow(strm, out) +z_streamp strm; +unsigned out; +{ + struct inflate_state FAR *state; + unsigned copy, dist; + + state = (struct inflate_state FAR *)strm->state; + + /* if it hasn't been done already, allocate space for the window */ + if (state->window == Z_NULL) { + state->window = (unsigned char FAR *) + ZALLOC(strm, 1U << state->wbits, + sizeof(unsigned char)); + if (state->window == Z_NULL) return 1; + } + + /* if window not in use yet, initialize */ + if (state->wsize == 0) { + state->wsize = 1U << state->wbits; + state->write = 0; + state->whave = 0; + } + + /* copy state->wsize or less output bytes into the circular window */ + copy = out - strm->avail_out; + if (copy >= state->wsize) { + zmemcpy(state->window, strm->next_out - state->wsize, state->wsize); + state->write = 0; + state->whave = state->wsize; + } + else { + dist = state->wsize - state->write; + if (dist > copy) dist = copy; + zmemcpy(state->window + state->write, strm->next_out - copy, dist); + copy -= dist; + if (copy) { + zmemcpy(state->window, strm->next_out - copy, copy); + state->write = copy; + state->whave = state->wsize; + } + else { + state->write += dist; + if (state->write == state->wsize) state->write = 0; + if (state->whave < state->wsize) state->whave += dist; + } + } + return 0; +} + +/* Macros for inflate(): */ + +/* check function to use adler32() for zlib or crc32() for gzip */ +#ifdef GUNZIP +# define UPDATE(check, buf, len) \ + (state->flags ? crc32(check, buf, len) : adler32(check, buf, len)) +#else +# define UPDATE(check, buf, len) adler32(check, buf, len) +#endif + +/* check macros for header crc */ +#ifdef GUNZIP +# define CRC2(check, word) \ + do { \ + hbuf[0] = (unsigned char)(word); \ + hbuf[1] = (unsigned char)((word) >> 8); \ + check = crc32(check, hbuf, 2); \ + } while (0) + +# define CRC4(check, word) \ + do { \ + hbuf[0] = (unsigned char)(word); \ + hbuf[1] = (unsigned char)((word) >> 8); \ + hbuf[2] = (unsigned char)((word) >> 16); \ + hbuf[3] = (unsigned char)((word) >> 24); \ + check = crc32(check, hbuf, 4); \ + } while (0) +#endif + +/* Load registers with state in inflate() for speed */ +#define LOAD() \ + do { \ + put = strm->next_out; \ + left = strm->avail_out; \ + next = strm->next_in; \ + have = strm->avail_in; \ + hold = state->hold; \ + bits = state->bits; \ + } while (0) + +/* Restore state from registers in inflate() */ +#define RESTORE() \ + do { \ + strm->next_out = put; \ + strm->avail_out = left; \ + strm->next_in = next; \ + strm->avail_in = have; \ + state->hold = hold; \ + state->bits = bits; \ + } while (0) + +/* Clear the input bit accumulator */ +#define INITBITS() \ + do { \ + hold = 0; \ + bits = 0; \ + } while (0) + +/* Get a byte of input into the bit accumulator, or return from inflate() + if there is no input available. */ +#define PULLBYTE() \ + do { \ + if (have == 0) goto inf_leave; \ + have--; \ + hold += (unsigned long)(*next++) << bits; \ + bits += 8; \ + } while (0) + +/* Assure that there are at least n bits in the bit accumulator. If there is + not enough available input to do that, then return from inflate(). */ +#define NEEDBITS(n) \ + do { \ + while (bits < (unsigned)(n)) \ + PULLBYTE(); \ + } while (0) + +/* Return the low n bits of the bit accumulator (n < 16) */ +#define BITS(n) \ + ((unsigned)hold & ((1U << (n)) - 1)) + +/* Remove n bits from the bit accumulator */ +#define DROPBITS(n) \ + do { \ + hold >>= (n); \ + bits -= (unsigned)(n); \ + } while (0) + +/* Remove zero to seven bits as needed to go to a byte boundary */ +#define BYTEBITS() \ + do { \ + hold >>= bits & 7; \ + bits -= bits & 7; \ + } while (0) + +/* Reverse the bytes in a 32-bit value */ +#define REVERSE(q) \ + ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \ + (((q) & 0xff00) << 8) + (((q) & 0xff) << 24)) + +/* + inflate() uses a state machine to process as much input data and generate as + much output data as possible before returning. The state machine is + structured roughly as follows: + + for (;;) switch (state) { + ... + case STATEn: + if (not enough input data or output space to make progress) + return; + ... make progress ... + state = STATEm; + break; + ... + } + + so when inflate() is called again, the same case is attempted again, and + if the appropriate resources are provided, the machine proceeds to the + next state. The NEEDBITS() macro is usually the way the state evaluates + whether it can proceed or should return. NEEDBITS() does the return if + the requested bits are not available. The typical use of the BITS macros + is: + + NEEDBITS(n); + ... do something with BITS(n) ... + DROPBITS(n); + + where NEEDBITS(n) either returns from inflate() if there isn't enough + input left to load n bits into the accumulator, or it continues. BITS(n) + gives the low n bits in the accumulator. When done, DROPBITS(n) drops + the low n bits off the accumulator. INITBITS() clears the accumulator + and sets the number of available bits to zero. BYTEBITS() discards just + enough bits to put the accumulator on a byte boundary. After BYTEBITS() + and a NEEDBITS(8), then BITS(8) would return the next byte in the stream. + + NEEDBITS(n) uses PULLBYTE() to get an available byte of input, or to return + if there is no input available. The decoding of variable length codes uses + PULLBYTE() directly in order to pull just enough bytes to decode the next + code, and no more. + + Some states loop until they get enough input, making sure that enough + state information is maintained to continue the loop where it left off + if NEEDBITS() returns in the loop. For example, want, need, and keep + would all have to actually be part of the saved state in case NEEDBITS() + returns: + + case STATEw: + while (want < need) { + NEEDBITS(n); + keep[want++] = BITS(n); + DROPBITS(n); + } + state = STATEx; + case STATEx: + + As shown above, if the next state is also the next case, then the break + is omitted. + + A state may also return if there is not enough output space available to + complete that state. Those states are copying stored data, writing a + literal byte, and copying a matching string. + + When returning, a "goto inf_leave" is used to update the total counters, + update the check value, and determine whether any progress has been made + during that inflate() call in order to return the proper return code. + Progress is defined as a change in either strm->avail_in or strm->avail_out. + When there is a window, goto inf_leave will update the window with the last + output written. If a goto inf_leave occurs in the middle of decompression + and there is no window currently, goto inf_leave will create one and copy + output to the window for the next call of inflate(). + + In this implementation, the flush parameter of inflate() only affects the + return code (per zlib.h). inflate() always writes as much as possible to + strm->next_out, given the space available and the provided input--the effect + documented in zlib.h of Z_SYNC_FLUSH. Furthermore, inflate() always defers + the allocation of and copying into a sliding window until necessary, which + provides the effect documented in zlib.h for Z_FINISH when the entire input + stream available. So the only thing the flush parameter actually does is: + when flush is set to Z_FINISH, inflate() cannot return Z_OK. Instead it + will return Z_BUF_ERROR if it has not reached the end of the stream. + */ + +int ZEXPORT inflate(strm, flush) +z_streamp strm; +int flush; +{ + struct inflate_state FAR *state; + unsigned char FAR *next; /* next input */ + unsigned char FAR *put; /* next output */ + unsigned have, left; /* available input and output */ + unsigned long hold; /* bit buffer */ + unsigned bits; /* bits in bit buffer */ + unsigned in, out; /* save starting available input and output */ + unsigned copy; /* number of stored or match bytes to copy */ + unsigned char FAR *from; /* where to copy match bytes from */ + code this; /* current decoding table entry */ + code last; /* parent table entry */ + unsigned len; /* length to copy for repeats, bits to drop */ + int ret; /* return code */ +#ifdef GUNZIP + unsigned char hbuf[4]; /* buffer for gzip header crc calculation */ +#endif + static const unsigned short order[19] = /* permutation of code lengths */ + {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; + + if (strm == Z_NULL || strm->state == Z_NULL || strm->next_out == Z_NULL || + (strm->next_in == Z_NULL && strm->avail_in != 0)) + return Z_STREAM_ERROR; + + state = (struct inflate_state FAR *)strm->state; + if (state->mode == TYPE) state->mode = TYPEDO; /* skip check */ + LOAD(); + in = have; + out = left; + ret = Z_OK; + for (;;) + switch (state->mode) { + case HEAD: + if (state->wrap == 0) { + state->mode = TYPEDO; + break; + } + NEEDBITS(16); +#ifdef GUNZIP + if ((state->wrap & 2) && hold == 0x8b1f) { /* gzip header */ + state->check = crc32(0L, Z_NULL, 0); + CRC2(state->check, hold); + INITBITS(); + state->mode = FLAGS; + break; + } + state->flags = 0; /* expect zlib header */ + if (state->head != Z_NULL) + state->head->done = -1; + if (!(state->wrap & 1) || /* check if zlib header allowed */ +#else + if ( +#endif + ((BITS(8) << 8) + (hold >> 8)) % 31) { + strm->msg = (char *)"incorrect header check"; + state->mode = BAD; + break; + } + if (BITS(4) != Z_DEFLATED) { + strm->msg = (char *)"unknown compression method"; + state->mode = BAD; + break; + } + DROPBITS(4); + len = BITS(4) + 8; + if (len > state->wbits) { + strm->msg = (char *)"invalid window size"; + state->mode = BAD; + break; + } + state->dmax = 1U << len; + Tracev((stderr, "inflate: zlib header ok\n")); + strm->adler = state->check = adler32(0L, Z_NULL, 0); + state->mode = hold & 0x200 ? DICTID : TYPE; + INITBITS(); + break; +#ifdef GUNZIP + case FLAGS: + NEEDBITS(16); + state->flags = (int)(hold); + if ((state->flags & 0xff) != Z_DEFLATED) { + strm->msg = (char *)"unknown compression method"; + state->mode = BAD; + break; + } + if (state->flags & 0xe000) { + strm->msg = (char *)"unknown header flags set"; + state->mode = BAD; + break; + } + if (state->head != Z_NULL) + state->head->text = (int)((hold >> 8) & 1); + if (state->flags & 0x0200) CRC2(state->check, hold); + INITBITS(); + state->mode = TIME; + case TIME: + NEEDBITS(32); + if (state->head != Z_NULL) + state->head->time = hold; + if (state->flags & 0x0200) CRC4(state->check, hold); + INITBITS(); + state->mode = OS; + case OS: + NEEDBITS(16); + if (state->head != Z_NULL) { + state->head->xflags = (int)(hold & 0xff); + state->head->os = (int)(hold >> 8); + } + if (state->flags & 0x0200) CRC2(state->check, hold); + INITBITS(); + state->mode = EXLEN; + case EXLEN: + if (state->flags & 0x0400) { + NEEDBITS(16); + state->length = (unsigned)(hold); + if (state->head != Z_NULL) + state->head->extra_len = (unsigned)hold; + if (state->flags & 0x0200) CRC2(state->check, hold); + INITBITS(); + } + else if (state->head != Z_NULL) + state->head->extra = Z_NULL; + state->mode = EXTRA; + case EXTRA: + if (state->flags & 0x0400) { + copy = state->length; + if (copy > have) copy = have; + if (copy) { + if (state->head != Z_NULL && + state->head->extra != Z_NULL) { + len = state->head->extra_len - state->length; + zmemcpy(state->head->extra + len, next, + len + copy > state->head->extra_max ? + state->head->extra_max - len : copy); + } + if (state->flags & 0x0200) + state->check = crc32(state->check, next, copy); + have -= copy; + next += copy; + state->length -= copy; + } + if (state->length) goto inf_leave; + } + state->length = 0; + state->mode = NAME; + case NAME: + if (state->flags & 0x0800) { + if (have == 0) goto inf_leave; + copy = 0; + do { + len = (unsigned)(next[copy++]); + if (state->head != Z_NULL && + state->head->name != Z_NULL && + state->length < state->head->name_max) + state->head->name[state->length++] = len; + } while (len && copy < have); + if (state->flags & 0x0200) + state->check = crc32(state->check, next, copy); + have -= copy; + next += copy; + if (len) goto inf_leave; + } + else if (state->head != Z_NULL) + state->head->name = Z_NULL; + state->length = 0; + state->mode = COMMENT; + case COMMENT: + if (state->flags & 0x1000) { + if (have == 0) goto inf_leave; + copy = 0; + do { + len = (unsigned)(next[copy++]); + if (state->head != Z_NULL && + state->head->comment != Z_NULL && + state->length < state->head->comm_max) + state->head->comment[state->length++] = len; + } while (len && copy < have); + if (state->flags & 0x0200) + state->check = crc32(state->check, next, copy); + have -= copy; + next += copy; + if (len) goto inf_leave; + } + else if (state->head != Z_NULL) + state->head->comment = Z_NULL; + state->mode = HCRC; + case HCRC: + if (state->flags & 0x0200) { + NEEDBITS(16); + if (hold != (state->check & 0xffff)) { + strm->msg = (char *)"header crc mismatch"; + state->mode = BAD; + break; + } + INITBITS(); + } + if (state->head != Z_NULL) { + state->head->hcrc = (int)((state->flags >> 9) & 1); + state->head->done = 1; + } + strm->adler = state->check = crc32(0L, Z_NULL, 0); + state->mode = TYPE; + break; +#endif + case DICTID: + NEEDBITS(32); + strm->adler = state->check = REVERSE(hold); + INITBITS(); + state->mode = DICT; + case DICT: + if (state->havedict == 0) { + RESTORE(); + return Z_NEED_DICT; + } + strm->adler = state->check = adler32(0L, Z_NULL, 0); + state->mode = TYPE; + case TYPE: + if (flush == Z_BLOCK) goto inf_leave; + case TYPEDO: + if (state->last) { + BYTEBITS(); + state->mode = CHECK; + break; + } + NEEDBITS(3); + state->last = BITS(1); + DROPBITS(1); + switch (BITS(2)) { + case 0: /* stored block */ + Tracev((stderr, "inflate: stored block%s\n", + state->last ? " (last)" : "")); + state->mode = STORED; + break; + case 1: /* fixed block */ + fixedtables(state); + Tracev((stderr, "inflate: fixed codes block%s\n", + state->last ? " (last)" : "")); + state->mode = LEN; /* decode codes */ + break; + case 2: /* dynamic block */ + Tracev((stderr, "inflate: dynamic codes block%s\n", + state->last ? " (last)" : "")); + state->mode = TABLE; + break; + case 3: + strm->msg = (char *)"invalid block type"; + state->mode = BAD; + } + DROPBITS(2); + break; + case STORED: + BYTEBITS(); /* go to byte boundary */ + NEEDBITS(32); + if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) { + strm->msg = (char *)"invalid stored block lengths"; + state->mode = BAD; + break; + } + state->length = (unsigned)hold & 0xffff; + Tracev((stderr, "inflate: stored length %u\n", + state->length)); + INITBITS(); + state->mode = COPY; + case COPY: + copy = state->length; + if (copy) { + if (copy > have) copy = have; + if (copy > left) copy = left; + if (copy == 0) goto inf_leave; + zmemcpy(put, next, copy); + have -= copy; + next += copy; + left -= copy; + put += copy; + state->length -= copy; + break; + } + Tracev((stderr, "inflate: stored end\n")); + state->mode = TYPE; + break; + case TABLE: + NEEDBITS(14); + state->nlen = BITS(5) + 257; + DROPBITS(5); + state->ndist = BITS(5) + 1; + DROPBITS(5); + state->ncode = BITS(4) + 4; + DROPBITS(4); +#ifndef PKZIP_BUG_WORKAROUND + if (state->nlen > 286 || state->ndist > 30) { + strm->msg = (char *)"too many length or distance symbols"; + state->mode = BAD; + break; + } +#endif + Tracev((stderr, "inflate: table sizes ok\n")); + state->have = 0; + state->mode = LENLENS; + case LENLENS: + while (state->have < state->ncode) { + NEEDBITS(3); + state->lens[order[state->have++]] = (unsigned short)BITS(3); + DROPBITS(3); + } + while (state->have < 19) + state->lens[order[state->have++]] = 0; + state->next = state->codes; + state->lencode = (code const FAR *)(state->next); + state->lenbits = 7; + ret = inflate_table(CODES, state->lens, 19, &(state->next), + &(state->lenbits), state->work); + if (ret) { + strm->msg = (char *)"invalid code lengths set"; + state->mode = BAD; + break; + } + Tracev((stderr, "inflate: code lengths ok\n")); + state->have = 0; + state->mode = CODELENS; + case CODELENS: + while (state->have < state->nlen + state->ndist) { + for (;;) { + this = state->lencode[BITS(state->lenbits)]; + if ((unsigned)(this.bits) <= bits) break; + PULLBYTE(); + } + if (this.val < 16) { + NEEDBITS(this.bits); + DROPBITS(this.bits); + state->lens[state->have++] = this.val; + } + else { + if (this.val == 16) { + NEEDBITS(this.bits + 2); + DROPBITS(this.bits); + if (state->have == 0) { + strm->msg = (char *)"invalid bit length repeat"; + state->mode = BAD; + break; + } + len = state->lens[state->have - 1]; + copy = 3 + BITS(2); + DROPBITS(2); + } + else if (this.val == 17) { + NEEDBITS(this.bits + 3); + DROPBITS(this.bits); + len = 0; + copy = 3 + BITS(3); + DROPBITS(3); + } + else { + NEEDBITS(this.bits + 7); + DROPBITS(this.bits); + len = 0; + copy = 11 + BITS(7); + DROPBITS(7); + } + if (state->have + copy > state->nlen + state->ndist) { + strm->msg = (char *)"invalid bit length repeat"; + state->mode = BAD; + break; + } + while (copy--) + state->lens[state->have++] = (unsigned short)len; + } + } + + /* handle error breaks in while */ + if (state->mode == BAD) break; + + /* build code tables */ + state->next = state->codes; + state->lencode = (code const FAR *)(state->next); + state->lenbits = 9; + ret = inflate_table(LENS, state->lens, state->nlen, &(state->next), + &(state->lenbits), state->work); + if (ret) { + strm->msg = (char *)"invalid literal/lengths set"; + state->mode = BAD; + break; + } + state->distcode = (code const FAR *)(state->next); + state->distbits = 6; + ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist, + &(state->next), &(state->distbits), state->work); + if (ret) { + strm->msg = (char *)"invalid distances set"; + state->mode = BAD; + break; + } + Tracev((stderr, "inflate: codes ok\n")); + state->mode = LEN; + case LEN: + if (have >= 6 && left >= 258) { + RESTORE(); + inflate_fast(strm, out); + LOAD(); + break; + } + for (;;) { + this = state->lencode[BITS(state->lenbits)]; + if ((unsigned)(this.bits) <= bits) break; + PULLBYTE(); + } + if (this.op && (this.op & 0xf0) == 0) { + last = this; + for (;;) { + this = state->lencode[last.val + + (BITS(last.bits + last.op) >> last.bits)]; + if ((unsigned)(last.bits + this.bits) <= bits) break; + PULLBYTE(); + } + DROPBITS(last.bits); + } + DROPBITS(this.bits); + state->length = (unsigned)this.val; + if ((int)(this.op) == 0) { + Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ? + "inflate: literal '%c'\n" : + "inflate: literal 0x%02x\n", this.val)); + state->mode = LIT; + break; + } + if (this.op & 32) { + Tracevv((stderr, "inflate: end of block\n")); + state->mode = TYPE; + break; + } + if (this.op & 64) { + strm->msg = (char *)"invalid literal/length code"; + state->mode = BAD; + break; + } + state->extra = (unsigned)(this.op) & 15; + state->mode = LENEXT; + case LENEXT: + if (state->extra) { + NEEDBITS(state->extra); + state->length += BITS(state->extra); + DROPBITS(state->extra); + } + Tracevv((stderr, "inflate: length %u\n", state->length)); + state->mode = DIST; + case DIST: + for (;;) { + this = state->distcode[BITS(state->distbits)]; + if ((unsigned)(this.bits) <= bits) break; + PULLBYTE(); + } + if ((this.op & 0xf0) == 0) { + last = this; + for (;;) { + this = state->distcode[last.val + + (BITS(last.bits + last.op) >> last.bits)]; + if ((unsigned)(last.bits + this.bits) <= bits) break; + PULLBYTE(); + } + DROPBITS(last.bits); + } + DROPBITS(this.bits); + if (this.op & 64) { + strm->msg = (char *)"invalid distance code"; + state->mode = BAD; + break; + } + state->offset = (unsigned)this.val; + state->extra = (unsigned)(this.op) & 15; + state->mode = DISTEXT; + case DISTEXT: + if (state->extra) { + NEEDBITS(state->extra); + state->offset += BITS(state->extra); + DROPBITS(state->extra); + } +#ifdef INFLATE_STRICT + if (state->offset > state->dmax) { + strm->msg = (char *)"invalid distance too far back"; + state->mode = BAD; + break; + } +#endif + if (state->offset > state->whave + out - left) { + strm->msg = (char *)"invalid distance too far back"; + state->mode = BAD; + break; + } + Tracevv((stderr, "inflate: distance %u\n", state->offset)); + state->mode = MATCH; + case MATCH: + if (left == 0) goto inf_leave; + copy = out - left; + if (state->offset > copy) { /* copy from window */ + copy = state->offset - copy; + if (copy > state->write) { + copy -= state->write; + from = state->window + (state->wsize - copy); + } + else + from = state->window + (state->write - copy); + if (copy > state->length) copy = state->length; + } + else { /* copy from output */ + from = put - state->offset; + copy = state->length; + } + if (copy > left) copy = left; + left -= copy; + state->length -= copy; + do { + *put++ = *from++; + } while (--copy); + if (state->length == 0) state->mode = LEN; + break; + case LIT: + if (left == 0) goto inf_leave; + *put++ = (unsigned char)(state->length); + left--; + state->mode = LEN; + break; + case CHECK: + if (state->wrap) { + NEEDBITS(32); + out -= left; + strm->total_out += out; + state->total += out; + if (out) + strm->adler = state->check = + UPDATE(state->check, put - out, out); + out = left; + if (( +#ifdef GUNZIP + state->flags ? hold : +#endif + REVERSE(hold)) != state->check) { + strm->msg = (char *)"incorrect data check"; + state->mode = BAD; + break; + } + INITBITS(); + Tracev((stderr, "inflate: check matches trailer\n")); + } +#ifdef GUNZIP + state->mode = LENGTH; + case LENGTH: + if (state->wrap && state->flags) { + NEEDBITS(32); + if (hold != (state->total & 0xffffffffUL)) { + strm->msg = (char *)"incorrect length check"; + state->mode = BAD; + break; + } + INITBITS(); + Tracev((stderr, "inflate: length matches trailer\n")); + } +#endif + state->mode = DONE; + case DONE: + ret = Z_STREAM_END; + goto inf_leave; + case BAD: + ret = Z_DATA_ERROR; + goto inf_leave; + case MEM: + return Z_MEM_ERROR; + case SYNC: + default: + return Z_STREAM_ERROR; + } + + /* + Return from inflate(), updating the total counts and the check value. + If there was no progress during the inflate() call, return a buffer + error. Call updatewindow() to create and/or update the window state. + Note: a memory error from inflate() is non-recoverable. + */ + inf_leave: + RESTORE(); + if (state->wsize || (state->mode < CHECK && out != strm->avail_out)) + if (updatewindow(strm, out)) { + state->mode = MEM; + return Z_MEM_ERROR; + } + in -= strm->avail_in; + out -= strm->avail_out; + strm->total_in += in; + strm->total_out += out; + state->total += out; + if (state->wrap && out) + strm->adler = state->check = + UPDATE(state->check, strm->next_out - out, out); + strm->data_type = state->bits + (state->last ? 64 : 0) + + (state->mode == TYPE ? 128 : 0); + if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK) + ret = Z_BUF_ERROR; + return ret; +} + +int ZEXPORT inflateEnd(strm) +z_streamp strm; +{ + struct inflate_state FAR *state; + if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0) + return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)strm->state; + if (state->window != Z_NULL) ZFREE(strm, state->window); + ZFREE(strm, strm->state); + strm->state = Z_NULL; + Tracev((stderr, "inflate: end\n")); + return Z_OK; +} + +int ZEXPORT inflateSetDictionary(strm, dictionary, dictLength) +z_streamp strm; +const Bytef *dictionary; +uInt dictLength; +{ + struct inflate_state FAR *state; + unsigned long id; + + /* check state */ + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)strm->state; + if (state->wrap != 0 && state->mode != DICT) + return Z_STREAM_ERROR; + + /* check for correct dictionary id */ + if (state->mode == DICT) { + id = adler32(0L, Z_NULL, 0); + id = adler32(id, dictionary, dictLength); + if (id != state->check) + return Z_DATA_ERROR; + } + + /* copy dictionary to window */ + if (updatewindow(strm, strm->avail_out)) { + state->mode = MEM; + return Z_MEM_ERROR; + } + if (dictLength > state->wsize) { + zmemcpy(state->window, dictionary + dictLength - state->wsize, + state->wsize); + state->whave = state->wsize; + } + else { + zmemcpy(state->window + state->wsize - dictLength, dictionary, + dictLength); + state->whave = dictLength; + } + state->havedict = 1; + Tracev((stderr, "inflate: dictionary set\n")); + return Z_OK; +} + +int ZEXPORT inflateGetHeader(strm, head) +z_streamp strm; +gz_headerp head; +{ + struct inflate_state FAR *state; + + /* check state */ + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)strm->state; + if ((state->wrap & 2) == 0) return Z_STREAM_ERROR; + + /* save header structure */ + state->head = head; + head->done = 0; + return Z_OK; +} + +/* + Search buf[0..len-1] for the pattern: 0, 0, 0xff, 0xff. Return when found + or when out of input. When called, *have is the number of pattern bytes + found in order so far, in 0..3. On return *have is updated to the new + state. If on return *have equals four, then the pattern was found and the + return value is how many bytes were read including the last byte of the + pattern. If *have is less than four, then the pattern has not been found + yet and the return value is len. In the latter case, syncsearch() can be + called again with more data and the *have state. *have is initialized to + zero for the first call. + */ +local unsigned syncsearch(have, buf, len) +unsigned FAR *have; +unsigned char FAR *buf; +unsigned len; +{ + unsigned got; + unsigned next; + + got = *have; + next = 0; + while (next < len && got < 4) { + if ((int)(buf[next]) == (got < 2 ? 0 : 0xff)) + got++; + else if (buf[next]) + got = 0; + else + got = 4 - got; + next++; + } + *have = got; + return next; +} + +int ZEXPORT inflateSync(strm) +z_streamp strm; +{ + unsigned len; /* number of bytes to look at or looked at */ + unsigned long in, out; /* temporary to save total_in and total_out */ + unsigned char buf[4]; /* to restore bit buffer to byte string */ + struct inflate_state FAR *state; + + /* check parameters */ + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)strm->state; + if (strm->avail_in == 0 && state->bits < 8) return Z_BUF_ERROR; + + /* if first time, start search in bit buffer */ + if (state->mode != SYNC) { + state->mode = SYNC; + state->hold <<= state->bits & 7; + state->bits -= state->bits & 7; + len = 0; + while (state->bits >= 8) { + buf[len++] = (unsigned char)(state->hold); + state->hold >>= 8; + state->bits -= 8; + } + state->have = 0; + syncsearch(&(state->have), buf, len); + } + + /* search available input */ + len = syncsearch(&(state->have), strm->next_in, strm->avail_in); + strm->avail_in -= len; + strm->next_in += len; + strm->total_in += len; + + /* return no joy or set up to restart inflate() on a new block */ + if (state->have != 4) return Z_DATA_ERROR; + in = strm->total_in; out = strm->total_out; + inflateReset(strm); + strm->total_in = in; strm->total_out = out; + state->mode = TYPE; + return Z_OK; +} + +/* + Returns true if inflate is currently at the end of a block generated by + Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP + implementation to provide an additional safety check. PPP uses + Z_SYNC_FLUSH but removes the length bytes of the resulting empty stored + block. When decompressing, PPP checks that at the end of input packet, + inflate is waiting for these length bytes. + */ +int ZEXPORT inflateSyncPoint(strm) +z_streamp strm; +{ + struct inflate_state FAR *state; + + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)strm->state; + return state->mode == STORED && state->bits == 0; +} + +int ZEXPORT inflateCopy(dest, source) +z_streamp dest; +z_streamp source; +{ + struct inflate_state FAR *state; + struct inflate_state FAR *copy; + unsigned char FAR *window; + unsigned wsize; + + /* check input */ + if (dest == Z_NULL || source == Z_NULL || source->state == Z_NULL || + source->zalloc == (alloc_func)0 || source->zfree == (free_func)0) + return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)source->state; + + /* allocate space */ + copy = (struct inflate_state FAR *) + ZALLOC(source, 1, sizeof(struct inflate_state)); + if (copy == Z_NULL) return Z_MEM_ERROR; + window = Z_NULL; + if (state->window != Z_NULL) { + window = (unsigned char FAR *) + ZALLOC(source, 1U << state->wbits, sizeof(unsigned char)); + if (window == Z_NULL) { + ZFREE(source, copy); + return Z_MEM_ERROR; + } + } + + /* copy state */ + zmemcpy(dest, source, sizeof(z_stream)); + zmemcpy(copy, state, sizeof(struct inflate_state)); + if (state->lencode >= state->codes && + state->lencode <= state->codes + ENOUGH - 1) { + copy->lencode = copy->codes + (state->lencode - state->codes); + copy->distcode = copy->codes + (state->distcode - state->codes); + } + copy->next = copy->codes + (state->next - state->codes); + if (window != Z_NULL) { + wsize = 1U << state->wbits; + zmemcpy(window, state->window, wsize); + } + copy->window = window; + dest->state = (struct internal_state FAR *)copy; + return Z_OK; +} diff --git a/dep/StormLib/src/zlib/inflate.h b/dep/StormLib/src/zlib/inflate.h new file mode 100644 index 00000000000..07bd3e78a7c --- /dev/null +++ b/dep/StormLib/src/zlib/inflate.h @@ -0,0 +1,115 @@ +/* inflate.h -- internal inflate state definition + * Copyright (C) 1995-2004 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +/* define NO_GZIP when compiling if you want to disable gzip header and + trailer decoding by inflate(). NO_GZIP would be used to avoid linking in + the crc code when it is not needed. For shared libraries, gzip decoding + should be left enabled. */ +#ifndef NO_GZIP +# define GUNZIP +#endif + +/* Possible inflate modes between inflate() calls */ +typedef enum { + HEAD, /* i: waiting for magic header */ + FLAGS, /* i: waiting for method and flags (gzip) */ + TIME, /* i: waiting for modification time (gzip) */ + OS, /* i: waiting for extra flags and operating system (gzip) */ + EXLEN, /* i: waiting for extra length (gzip) */ + EXTRA, /* i: waiting for extra bytes (gzip) */ + NAME, /* i: waiting for end of file name (gzip) */ + COMMENT, /* i: waiting for end of comment (gzip) */ + HCRC, /* i: waiting for header crc (gzip) */ + DICTID, /* i: waiting for dictionary check value */ + DICT, /* waiting for inflateSetDictionary() call */ + TYPE, /* i: waiting for type bits, including last-flag bit */ + TYPEDO, /* i: same, but skip check to exit inflate on new block */ + STORED, /* i: waiting for stored size (length and complement) */ + COPY, /* i/o: waiting for input or output to copy stored block */ + TABLE, /* i: waiting for dynamic block table lengths */ + LENLENS, /* i: waiting for code length code lengths */ + CODELENS, /* i: waiting for length/lit and distance code lengths */ + LEN, /* i: waiting for length/lit code */ + LENEXT, /* i: waiting for length extra bits */ + DIST, /* i: waiting for distance code */ + DISTEXT, /* i: waiting for distance extra bits */ + MATCH, /* o: waiting for output space to copy string */ + LIT, /* o: waiting for output space to write literal */ + CHECK, /* i: waiting for 32-bit check value */ + LENGTH, /* i: waiting for 32-bit length (gzip) */ + DONE, /* finished check, done -- remain here until reset */ + BAD, /* got a data error -- remain here until reset */ + MEM, /* got an inflate() memory error -- remain here until reset */ + SYNC /* looking for synchronization bytes to restart inflate() */ +} inflate_mode; + +/* + State transitions between above modes - + + (most modes can go to the BAD or MEM mode -- not shown for clarity) + + Process header: + HEAD -> (gzip) or (zlib) + (gzip) -> FLAGS -> TIME -> OS -> EXLEN -> EXTRA -> NAME + NAME -> COMMENT -> HCRC -> TYPE + (zlib) -> DICTID or TYPE + DICTID -> DICT -> TYPE + Read deflate blocks: + TYPE -> STORED or TABLE or LEN or CHECK + STORED -> COPY -> TYPE + TABLE -> LENLENS -> CODELENS -> LEN + Read deflate codes: + LEN -> LENEXT or LIT or TYPE + LENEXT -> DIST -> DISTEXT -> MATCH -> LEN + LIT -> LEN + Process trailer: + CHECK -> LENGTH -> DONE + */ + +/* state maintained between inflate() calls. Approximately 7K bytes. */ +struct inflate_state { + inflate_mode mode; /* current inflate mode */ + int last; /* true if processing last block */ + int wrap; /* bit 0 true for zlib, bit 1 true for gzip */ + int havedict; /* true if dictionary provided */ + int flags; /* gzip header method and flags (0 if zlib) */ + unsigned dmax; /* zlib header max distance (INFLATE_STRICT) */ + unsigned long check; /* protected copy of check value */ + unsigned long total; /* protected copy of output count */ + gz_headerp head; /* where to save gzip header information */ + /* sliding window */ + unsigned wbits; /* log base 2 of requested window size */ + unsigned wsize; /* window size or zero if not using window */ + unsigned whave; /* valid bytes in the window */ + unsigned write; /* window write index */ + unsigned char FAR *window; /* allocated sliding window, if needed */ + /* bit accumulator */ + unsigned long hold; /* input bit accumulator */ + unsigned bits; /* number of bits in "in" */ + /* for string and stored block copying */ + unsigned length; /* literal or length of data to copy */ + unsigned offset; /* distance back to copy string from */ + /* for table and code decoding */ + unsigned extra; /* extra bits needed */ + /* fixed and dynamic code tables */ + code const FAR *lencode; /* starting table for length/literal codes */ + code const FAR *distcode; /* starting table for distance codes */ + unsigned lenbits; /* index bits for lencode */ + unsigned distbits; /* index bits for distcode */ + /* dynamic table building */ + unsigned ncode; /* number of code length code lengths */ + unsigned nlen; /* number of length code lengths */ + unsigned ndist; /* number of distance code lengths */ + unsigned have; /* number of code lengths in lens[] */ + code FAR *next; /* next available space in codes[] */ + unsigned short lens[320]; /* temporary storage for code lengths */ + unsigned short work[288]; /* work area for code table building */ + code codes[ENOUGH]; /* space for code tables */ +}; diff --git a/dep/StormLib/src/zlib/inftrees.c b/dep/StormLib/src/zlib/inftrees.c new file mode 100644 index 00000000000..8a9c13ff03d --- /dev/null +++ b/dep/StormLib/src/zlib/inftrees.c @@ -0,0 +1,329 @@ +/* inftrees.c -- generate Huffman trees for efficient decoding + * Copyright (C) 1995-2005 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +#include "zutil.h" +#include "inftrees.h" + +#define MAXBITS 15 + +const char inflate_copyright[] = + " inflate 1.2.3 Copyright 1995-2005 Mark Adler "; +/* + If you use the zlib library in a product, an acknowledgment is welcome + in the documentation of your product. If for some reason you cannot + include such an acknowledgment, I would appreciate that you keep this + copyright string in the executable of your product. + */ + +/* + Build a set of tables to decode the provided canonical Huffman code. + The code lengths are lens[0..codes-1]. The result starts at *table, + whose indices are 0..2^bits-1. work is a writable array of at least + lens shorts, which is used as a work area. type is the type of code + to be generated, CODES, LENS, or DISTS. On return, zero is success, + -1 is an invalid code, and +1 means that ENOUGH isn't enough. table + on return points to the next available entry's address. bits is the + requested root table index bits, and on return it is the actual root + table index bits. It will differ if the request is greater than the + longest code or if it is less than the shortest code. + */ +int inflate_table(type, lens, codes, table, bits, work) +codetype type; +unsigned short FAR *lens; +unsigned codes; +code FAR * FAR *table; +unsigned FAR *bits; +unsigned short FAR *work; +{ + unsigned len; /* a code's length in bits */ + unsigned sym; /* index of code symbols */ + unsigned min, max; /* minimum and maximum code lengths */ + unsigned root; /* number of index bits for root table */ + unsigned curr; /* number of index bits for current table */ + unsigned drop; /* code bits to drop for sub-table */ + int left; /* number of prefix codes available */ + unsigned used; /* code entries in table used */ + unsigned huff; /* Huffman code */ + unsigned incr; /* for incrementing code, index */ + unsigned fill; /* index for replicating entries */ + unsigned low; /* low bits for current root entry */ + unsigned mask; /* mask for low root bits */ + code this; /* table entry for duplication */ + code FAR *next; /* next available space in table */ + const unsigned short FAR *base; /* base value table to use */ + const unsigned short FAR *extra; /* extra bits table to use */ + int end; /* use base and extra for symbol > end */ + unsigned short count[MAXBITS+1]; /* number of codes of each length */ + unsigned short offs[MAXBITS+1]; /* offsets in table for each length */ + static const unsigned short lbase[31] = { /* Length codes 257..285 base */ + 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, + 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; + static const unsigned short lext[31] = { /* Length codes 257..285 extra */ + 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, + 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 201, 196}; + static const unsigned short dbase[32] = { /* Distance codes 0..29 base */ + 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, + 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, + 8193, 12289, 16385, 24577, 0, 0}; + static const unsigned short dext[32] = { /* Distance codes 0..29 extra */ + 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, + 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, + 28, 28, 29, 29, 64, 64}; + + /* + Process a set of code lengths to create a canonical Huffman code. The + code lengths are lens[0..codes-1]. Each length corresponds to the + symbols 0..codes-1. The Huffman code is generated by first sorting the + symbols by length from short to long, and retaining the symbol order + for codes with equal lengths. Then the code starts with all zero bits + for the first code of the shortest length, and the codes are integer + increments for the same length, and zeros are appended as the length + increases. For the deflate format, these bits are stored backwards + from their more natural integer increment ordering, and so when the + decoding tables are built in the large loop below, the integer codes + are incremented backwards. + + This routine assumes, but does not check, that all of the entries in + lens[] are in the range 0..MAXBITS. The caller must assure this. + 1..MAXBITS is interpreted as that code length. zero means that that + symbol does not occur in this code. + + The codes are sorted by computing a count of codes for each length, + creating from that a table of starting indices for each length in the + sorted table, and then entering the symbols in order in the sorted + table. The sorted table is work[], with that space being provided by + the caller. + + The length counts are used for other purposes as well, i.e. finding + the minimum and maximum length codes, determining if there are any + codes at all, checking for a valid set of lengths, and looking ahead + at length counts to determine sub-table sizes when building the + decoding tables. + */ + + /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */ + for (len = 0; len <= MAXBITS; len++) + count[len] = 0; + for (sym = 0; sym < codes; sym++) + count[lens[sym]]++; + + /* bound code lengths, force root to be within code lengths */ + root = *bits; + for (max = MAXBITS; max >= 1; max--) + if (count[max] != 0) break; + if (root > max) root = max; + if (max == 0) { /* no symbols to code at all */ + this.op = (unsigned char)64; /* invalid code marker */ + this.bits = (unsigned char)1; + this.val = (unsigned short)0; + *(*table)++ = this; /* make a table to force an error */ + *(*table)++ = this; + *bits = 1; + return 0; /* no symbols, but wait for decoding to report error */ + } + for (min = 1; min <= MAXBITS; min++) + if (count[min] != 0) break; + if (root < min) root = min; + + /* check for an over-subscribed or incomplete set of lengths */ + left = 1; + for (len = 1; len <= MAXBITS; len++) { + left <<= 1; + left -= count[len]; + if (left < 0) return -1; /* over-subscribed */ + } + if (left > 0 && (type == CODES || max != 1)) + return -1; /* incomplete set */ + + /* generate offsets into symbol table for each length for sorting */ + offs[1] = 0; + for (len = 1; len < MAXBITS; len++) + offs[len + 1] = offs[len] + count[len]; + + /* sort symbols by length, by symbol order within each length */ + for (sym = 0; sym < codes; sym++) + if (lens[sym] != 0) work[offs[lens[sym]]++] = (unsigned short)sym; + + /* + Create and fill in decoding tables. In this loop, the table being + filled is at next and has curr index bits. The code being used is huff + with length len. That code is converted to an index by dropping drop + bits off of the bottom. For codes where len is less than drop + curr, + those top drop + curr - len bits are incremented through all values to + fill the table with replicated entries. + + root is the number of index bits for the root table. When len exceeds + root, sub-tables are created pointed to by the root entry with an index + of the low root bits of huff. This is saved in low to check for when a + new sub-table should be started. drop is zero when the root table is + being filled, and drop is root when sub-tables are being filled. + + When a new sub-table is needed, it is necessary to look ahead in the + code lengths to determine what size sub-table is needed. The length + counts are used for this, and so count[] is decremented as codes are + entered in the tables. + + used keeps track of how many table entries have been allocated from the + provided *table space. It is checked when a LENS table is being made + against the space in *table, ENOUGH, minus the maximum space needed by + the worst case distance code, MAXD. This should never happen, but the + sufficiency of ENOUGH has not been proven exhaustively, hence the check. + This assumes that when type == LENS, bits == 9. + + sym increments through all symbols, and the loop terminates when + all codes of length max, i.e. all codes, have been processed. This + routine permits incomplete codes, so another loop after this one fills + in the rest of the decoding tables with invalid code markers. + */ + + /* set up for code type */ + switch (type) { + case CODES: + base = extra = work; /* dummy value--not used */ + end = 19; + break; + case LENS: + base = lbase; + base -= 257; + extra = lext; + extra -= 257; + end = 256; + break; + default: /* DISTS */ + base = dbase; + extra = dext; + end = -1; + } + + /* initialize state for loop */ + huff = 0; /* starting code */ + sym = 0; /* starting code symbol */ + len = min; /* starting code length */ + next = *table; /* current table to fill in */ + curr = root; /* current table index bits */ + drop = 0; /* current bits to drop from code for index */ + low = (unsigned)(-1); /* trigger new sub-table when len > root */ + used = 1U << root; /* use root table entries */ + mask = used - 1; /* mask for comparing low */ + + /* check available table space */ + if (type == LENS && used >= ENOUGH - MAXD) + return 1; + + /* process all codes and make table entries */ + for (;;) { + /* create table entry */ + this.bits = (unsigned char)(len - drop); + if ((int)(work[sym]) < end) { + this.op = (unsigned char)0; + this.val = work[sym]; + } + else if ((int)(work[sym]) > end) { + this.op = (unsigned char)(extra[work[sym]]); + this.val = base[work[sym]]; + } + else { + this.op = (unsigned char)(32 + 64); /* end of block */ + this.val = 0; + } + + /* replicate for those indices with low len bits equal to huff */ + incr = 1U << (len - drop); + fill = 1U << curr; + min = fill; /* save offset to next table */ + do { + fill -= incr; + next[(huff >> drop) + fill] = this; + } while (fill != 0); + + /* backwards increment the len-bit code huff */ + incr = 1U << (len - 1); + while (huff & incr) + incr >>= 1; + if (incr != 0) { + huff &= incr - 1; + huff += incr; + } + else + huff = 0; + + /* go to next symbol, update count, len */ + sym++; + if (--(count[len]) == 0) { + if (len == max) break; + len = lens[work[sym]]; + } + + /* create new sub-table if needed */ + if (len > root && (huff & mask) != low) { + /* if first time, transition to sub-tables */ + if (drop == 0) + drop = root; + + /* increment past last table */ + next += min; /* here min is 1 << curr */ + + /* determine length of next table */ + curr = len - drop; + left = (int)(1 << curr); + while (curr + drop < max) { + left -= count[curr + drop]; + if (left <= 0) break; + curr++; + left <<= 1; + } + + /* check for enough space */ + used += 1U << curr; + if (type == LENS && used >= ENOUGH - MAXD) + return 1; + + /* point entry in root table to sub-table */ + low = huff & mask; + (*table)[low].op = (unsigned char)curr; + (*table)[low].bits = (unsigned char)root; + (*table)[low].val = (unsigned short)(next - *table); + } + } + + /* + Fill in rest of table for incomplete codes. This loop is similar to the + loop above in incrementing huff for table indices. It is assumed that + len is equal to curr + drop, so there is no loop needed to increment + through high index bits. When the current sub-table is filled, the loop + drops back to the root table to fill in any remaining entries there. + */ + this.op = (unsigned char)64; /* invalid code marker */ + this.bits = (unsigned char)(len - drop); + this.val = (unsigned short)0; + while (huff != 0) { + /* when done with sub-table, drop back to root table */ + if (drop != 0 && (huff & mask) != low) { + drop = 0; + len = root; + next = *table; + this.bits = (unsigned char)len; + } + + /* put invalid code marker in table */ + next[huff >> drop] = this; + + /* backwards increment the len-bit code huff */ + incr = 1U << (len - 1); + while (huff & incr) + incr >>= 1; + if (incr != 0) { + huff &= incr - 1; + huff += incr; + } + else + huff = 0; + } + + /* set return parameters */ + *table += used; + *bits = root; + return 0; +} diff --git a/dep/StormLib/src/zlib/inftrees.h b/dep/StormLib/src/zlib/inftrees.h new file mode 100644 index 00000000000..b1104c87e76 --- /dev/null +++ b/dep/StormLib/src/zlib/inftrees.h @@ -0,0 +1,55 @@ +/* inftrees.h -- header to use inftrees.c + * Copyright (C) 1995-2005 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +/* Structure for decoding tables. Each entry provides either the + information needed to do the operation requested by the code that + indexed that table entry, or it provides a pointer to another + table that indexes more bits of the code. op indicates whether + the entry is a pointer to another table, a literal, a length or + distance, an end-of-block, or an invalid code. For a table + pointer, the low four bits of op is the number of index bits of + that table. For a length or distance, the low four bits of op + is the number of extra bits to get after the code. bits is + the number of bits in this code or part of the code to drop off + of the bit buffer. val is the actual byte to output in the case + of a literal, the base length or distance, or the offset from + the current table to the next table. Each entry is four bytes. */ +typedef struct { + unsigned char op; /* operation, extra bits, table bits */ + unsigned char bits; /* bits in this part of the code */ + unsigned short val; /* offset in table or code value */ +} code; + +/* op values as set by inflate_table(): + 00000000 - literal + 0000tttt - table link, tttt != 0 is the number of table index bits + 0001eeee - length or distance, eeee is the number of extra bits + 01100000 - end of block + 01000000 - invalid code + */ + +/* Maximum size of dynamic tree. The maximum found in a long but non- + exhaustive search was 1444 code structures (852 for length/literals + and 592 for distances, the latter actually the result of an + exhaustive search). The true maximum is not known, but the value + below is more than safe. */ +#define ENOUGH 2048 +#define MAXD 592 + +/* Type of code to build for inftable() */ +typedef enum { + CODES, + LENS, + DISTS +} codetype; + +extern int inflate_table OF((codetype type, unsigned short FAR *lens, + unsigned codes, code FAR * FAR *table, + unsigned FAR *bits, unsigned short FAR *work)); diff --git a/dep/StormLib/src/zlib/trees.c b/dep/StormLib/src/zlib/trees.c new file mode 100644 index 00000000000..395e4e16814 --- /dev/null +++ b/dep/StormLib/src/zlib/trees.c @@ -0,0 +1,1219 @@ +/* trees.c -- output deflated data using Huffman coding + * Copyright (C) 1995-2005 Jean-loup Gailly + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* + * ALGORITHM + * + * The "deflation" process uses several Huffman trees. The more + * common source values are represented by shorter bit sequences. + * + * Each code tree is stored in a compressed form which is itself + * a Huffman encoding of the lengths of all the code strings (in + * ascending order by source values). The actual code strings are + * reconstructed from the lengths in the inflate process, as described + * in the deflate specification. + * + * REFERENCES + * + * Deutsch, L.P.,"'Deflate' Compressed Data Format Specification". + * Available in ftp.uu.net:/pub/archiving/zip/doc/deflate-1.1.doc + * + * Storer, James A. + * Data Compression: Methods and Theory, pp. 49-50. + * Computer Science Press, 1988. ISBN 0-7167-8156-5. + * + * Sedgewick, R. + * Algorithms, p290. + * Addison-Wesley, 1983. ISBN 0-201-06672-6. + */ + +/* @(#) $Id$ */ + +/* #define GEN_TREES_H */ + +#include "deflate.h" + +#ifdef DEBUG +# include +#endif + +/* =========================================================================== + * Constants + */ + +#define MAX_BL_BITS 7 +/* Bit length codes must not exceed MAX_BL_BITS bits */ + +#define END_BLOCK 256 +/* end of block literal code */ + +#define REP_3_6 16 +/* repeat previous bit length 3-6 times (2 bits of repeat count) */ + +#define REPZ_3_10 17 +/* repeat a zero length 3-10 times (3 bits of repeat count) */ + +#define REPZ_11_138 18 +/* repeat a zero length 11-138 times (7 bits of repeat count) */ + +local const int extra_lbits[LENGTH_CODES] /* extra bits for each length code */ + = {0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0}; + +local const int extra_dbits[D_CODES] /* extra bits for each distance code */ + = {0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13}; + +local const int extra_blbits[BL_CODES]/* extra bits for each bit length code */ + = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7}; + +local const uch bl_order[BL_CODES] + = {16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15}; +/* The lengths of the bit length codes are sent in order of decreasing + * probability, to avoid transmitting the lengths for unused bit length codes. + */ + +#define Buf_size (8 * 2*sizeof(char)) +/* Number of bits used within bi_buf. (bi_buf might be implemented on + * more than 16 bits on some systems.) + */ + +/* =========================================================================== + * Local data. These are initialized only once. + */ + +#define DIST_CODE_LEN 512 /* see definition of array dist_code below */ + +#if defined(GEN_TREES_H) || !defined(STDC) +/* non ANSI compilers may not accept trees.h */ + +local ct_data static_ltree[L_CODES+2]; +/* The static literal tree. Since the bit lengths are imposed, there is no + * need for the L_CODES extra codes used during heap construction. However + * The codes 286 and 287 are needed to build a canonical tree (see _tr_init + * below). + */ + +local ct_data static_dtree[D_CODES]; +/* The static distance tree. (Actually a trivial tree since all codes use + * 5 bits.) + */ + +uch _dist_code[DIST_CODE_LEN]; +/* Distance codes. The first 256 values correspond to the distances + * 3 .. 258, the last 256 values correspond to the top 8 bits of + * the 15 bit distances. + */ + +uch _length_code[MAX_MATCH-MIN_MATCH+1]; +/* length code for each normalized match length (0 == MIN_MATCH) */ + +local int base_length[LENGTH_CODES]; +/* First normalized length for each code (0 = MIN_MATCH) */ + +local int base_dist[D_CODES]; +/* First normalized distance for each code (0 = distance of 1) */ + +#else +# include "trees.h" +#endif /* GEN_TREES_H */ + +struct static_tree_desc_s { + const ct_data *static_tree; /* static tree or NULL */ + const intf *extra_bits; /* extra bits for each code or NULL */ + int extra_base; /* base index for extra_bits */ + int elems; /* max number of elements in the tree */ + int max_length; /* max bit length for the codes */ +}; + +local static_tree_desc static_l_desc = +{static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS}; + +local static_tree_desc static_d_desc = +{static_dtree, extra_dbits, 0, D_CODES, MAX_BITS}; + +local static_tree_desc static_bl_desc = +{(const ct_data *)0, extra_blbits, 0, BL_CODES, MAX_BL_BITS}; + +/* =========================================================================== + * Local (static) routines in this file. + */ + +local void tr_static_init OF((void)); +local void init_block OF((deflate_state *s)); +local void pqdownheap OF((deflate_state *s, ct_data *tree, int k)); +local void gen_bitlen OF((deflate_state *s, tree_desc *desc)); +local void gen_codes OF((ct_data *tree, int max_code, ushf *bl_count)); +local void build_tree OF((deflate_state *s, tree_desc *desc)); +local void scan_tree OF((deflate_state *s, ct_data *tree, int max_code)); +local void send_tree OF((deflate_state *s, ct_data *tree, int max_code)); +local int build_bl_tree OF((deflate_state *s)); +local void send_all_trees OF((deflate_state *s, int lcodes, int dcodes, + int blcodes)); +local void compress_block OF((deflate_state *s, ct_data *ltree, + ct_data *dtree)); +local void set_data_type OF((deflate_state *s)); +local unsigned bi_reverse OF((unsigned value, int length)); +local void bi_windup OF((deflate_state *s)); +local void bi_flush OF((deflate_state *s)); +local void copy_block OF((deflate_state *s, charf *buf, unsigned len, + int header)); + +#ifdef GEN_TREES_H +local void gen_trees_header OF((void)); +#endif + +#ifndef DEBUG +# define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len) + /* Send a code of the given tree. c and tree must not have side effects */ + +#else /* DEBUG */ +# define send_code(s, c, tree) \ + { if (z_verbose>2) fprintf(stderr,"\ncd %3d ",(c)); \ + send_bits(s, tree[c].Code, tree[c].Len); } +#endif + +/* =========================================================================== + * Output a short LSB first on the stream. + * IN assertion: there is enough room in pendingBuf. + */ +#define put_short(s, w) { \ + put_byte(s, (uch)((w) & 0xff)); \ + put_byte(s, (uch)((ush)(w) >> 8)); \ +} + +/* =========================================================================== + * Send a value on a given number of bits. + * IN assertion: length <= 16 and value fits in length bits. + */ +#ifdef DEBUG +local void send_bits OF((deflate_state *s, int value, int length)); + +local void send_bits(s, value, length) + deflate_state *s; + int value; /* value to send */ + int length; /* number of bits */ +{ + Tracevv((stderr," l %2d v %4x ", length, value)); + Assert(length > 0 && length <= 15, "invalid length"); + s->bits_sent += (ulg)length; + + /* If not enough room in bi_buf, use (valid) bits from bi_buf and + * (16 - bi_valid) bits from value, leaving (width - (16-bi_valid)) + * unused bits in value. + */ + if (s->bi_valid > (int)Buf_size - length) { + s->bi_buf |= (value << s->bi_valid); + put_short(s, s->bi_buf); + s->bi_buf = (ush)value >> (Buf_size - s->bi_valid); + s->bi_valid += length - Buf_size; + } else { + s->bi_buf |= value << s->bi_valid; + s->bi_valid += length; + } +} +#else /* !DEBUG */ + +#define send_bits(s, value, length) \ +{ int len = length;\ + if (s->bi_valid > (int)Buf_size - len) {\ + int val = value;\ + s->bi_buf |= (val << s->bi_valid);\ + put_short(s, s->bi_buf);\ + s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\ + s->bi_valid += len - Buf_size;\ + } else {\ + s->bi_buf |= (value) << s->bi_valid;\ + s->bi_valid += len;\ + }\ +} +#endif /* DEBUG */ + + +/* the arguments must not have side effects */ + +/* =========================================================================== + * Initialize the various 'constant' tables. + */ +local void tr_static_init() +{ +#if defined(GEN_TREES_H) || !defined(STDC) + static int static_init_done = 0; + int n; /* iterates over tree elements */ + int bits; /* bit counter */ + int length; /* length value */ + int code; /* code value */ + int dist; /* distance index */ + ush bl_count[MAX_BITS+1]; + /* number of codes at each bit length for an optimal tree */ + + if (static_init_done) return; + + /* For some embedded targets, global variables are not initialized: */ + static_l_desc.static_tree = static_ltree; + static_l_desc.extra_bits = extra_lbits; + static_d_desc.static_tree = static_dtree; + static_d_desc.extra_bits = extra_dbits; + static_bl_desc.extra_bits = extra_blbits; + + /* Initialize the mapping length (0..255) -> length code (0..28) */ + length = 0; + for (code = 0; code < LENGTH_CODES-1; code++) { + base_length[code] = length; + for (n = 0; n < (1< dist code (0..29) */ + dist = 0; + for (code = 0 ; code < 16; code++) { + base_dist[code] = dist; + for (n = 0; n < (1<>= 7; /* from now on, all distances are divided by 128 */ + for ( ; code < D_CODES; code++) { + base_dist[code] = dist << 7; + for (n = 0; n < (1<<(extra_dbits[code]-7)); n++) { + _dist_code[256 + dist++] = (uch)code; + } + } + Assert (dist == 256, "tr_static_init: 256+dist != 512"); + + /* Construct the codes of the static literal tree */ + for (bits = 0; bits <= MAX_BITS; bits++) bl_count[bits] = 0; + n = 0; + while (n <= 143) static_ltree[n++].Len = 8, bl_count[8]++; + while (n <= 255) static_ltree[n++].Len = 9, bl_count[9]++; + while (n <= 279) static_ltree[n++].Len = 7, bl_count[7]++; + while (n <= 287) static_ltree[n++].Len = 8, bl_count[8]++; + /* Codes 286 and 287 do not exist, but we must include them in the + * tree construction to get a canonical Huffman tree (longest code + * all ones) + */ + gen_codes((ct_data *)static_ltree, L_CODES+1, bl_count); + + /* The static distance tree is trivial: */ + for (n = 0; n < D_CODES; n++) { + static_dtree[n].Len = 5; + static_dtree[n].Code = bi_reverse((unsigned)n, 5); + } + static_init_done = 1; + +# ifdef GEN_TREES_H + gen_trees_header(); +# endif +#endif /* defined(GEN_TREES_H) || !defined(STDC) */ +} + +/* =========================================================================== + * Genererate the file trees.h describing the static trees. + */ +#ifdef GEN_TREES_H +# ifndef DEBUG +# include +# endif + +# define SEPARATOR(i, last, width) \ + ((i) == (last)? "\n};\n\n" : \ + ((i) % (width) == (width)-1 ? ",\n" : ", ")) + +void gen_trees_header() +{ + FILE *header = fopen("trees.h", "w"); + int i; + + Assert (header != NULL, "Can't open trees.h"); + fprintf(header, + "/* header created automatically with -DGEN_TREES_H */\n\n"); + + fprintf(header, "local const ct_data static_ltree[L_CODES+2] = {\n"); + for (i = 0; i < L_CODES+2; i++) { + fprintf(header, "{{%3u},{%3u}}%s", static_ltree[i].Code, + static_ltree[i].Len, SEPARATOR(i, L_CODES+1, 5)); + } + + fprintf(header, "local const ct_data static_dtree[D_CODES] = {\n"); + for (i = 0; i < D_CODES; i++) { + fprintf(header, "{{%2u},{%2u}}%s", static_dtree[i].Code, + static_dtree[i].Len, SEPARATOR(i, D_CODES-1, 5)); + } + + fprintf(header, "const uch _dist_code[DIST_CODE_LEN] = {\n"); + for (i = 0; i < DIST_CODE_LEN; i++) { + fprintf(header, "%2u%s", _dist_code[i], + SEPARATOR(i, DIST_CODE_LEN-1, 20)); + } + + fprintf(header, "const uch _length_code[MAX_MATCH-MIN_MATCH+1]= {\n"); + for (i = 0; i < MAX_MATCH-MIN_MATCH+1; i++) { + fprintf(header, "%2u%s", _length_code[i], + SEPARATOR(i, MAX_MATCH-MIN_MATCH, 20)); + } + + fprintf(header, "local const int base_length[LENGTH_CODES] = {\n"); + for (i = 0; i < LENGTH_CODES; i++) { + fprintf(header, "%1u%s", base_length[i], + SEPARATOR(i, LENGTH_CODES-1, 20)); + } + + fprintf(header, "local const int base_dist[D_CODES] = {\n"); + for (i = 0; i < D_CODES; i++) { + fprintf(header, "%5u%s", base_dist[i], + SEPARATOR(i, D_CODES-1, 10)); + } + + fclose(header); +} +#endif /* GEN_TREES_H */ + +/* =========================================================================== + * Initialize the tree data structures for a new zlib stream. + */ +void _tr_init(s) + deflate_state *s; +{ + tr_static_init(); + + s->l_desc.dyn_tree = s->dyn_ltree; + s->l_desc.stat_desc = &static_l_desc; + + s->d_desc.dyn_tree = s->dyn_dtree; + s->d_desc.stat_desc = &static_d_desc; + + s->bl_desc.dyn_tree = s->bl_tree; + s->bl_desc.stat_desc = &static_bl_desc; + + s->bi_buf = 0; + s->bi_valid = 0; + s->last_eob_len = 8; /* enough lookahead for inflate */ +#ifdef DEBUG + s->compressed_len = 0L; + s->bits_sent = 0L; +#endif + + /* Initialize the first block of the first file: */ + init_block(s); +} + +/* =========================================================================== + * Initialize a new block. + */ +local void init_block(s) + deflate_state *s; +{ + int n; /* iterates over tree elements */ + + /* Initialize the trees. */ + for (n = 0; n < L_CODES; n++) s->dyn_ltree[n].Freq = 0; + for (n = 0; n < D_CODES; n++) s->dyn_dtree[n].Freq = 0; + for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0; + + s->dyn_ltree[END_BLOCK].Freq = 1; + s->opt_len = s->static_len = 0L; + s->last_lit = s->matches = 0; +} + +#define SMALLEST 1 +/* Index within the heap array of least frequent node in the Huffman tree */ + + +/* =========================================================================== + * Remove the smallest element from the heap and recreate the heap with + * one less element. Updates heap and heap_len. + */ +#define pqremove(s, tree, top) \ +{\ + top = s->heap[SMALLEST]; \ + s->heap[SMALLEST] = s->heap[s->heap_len--]; \ + pqdownheap(s, tree, SMALLEST); \ +} + +/* =========================================================================== + * Compares to subtrees, using the tree depth as tie breaker when + * the subtrees have equal frequency. This minimizes the worst case length. + */ +#define smaller(tree, n, m, depth) \ + (tree[n].Freq < tree[m].Freq || \ + (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m])) + +/* =========================================================================== + * Restore the heap property by moving down the tree starting at node k, + * exchanging a node with the smallest of its two sons if necessary, stopping + * when the heap property is re-established (each father smaller than its + * two sons). + */ +local void pqdownheap(s, tree, k) + deflate_state *s; + ct_data *tree; /* the tree to restore */ + int k; /* node to move down */ +{ + int v = s->heap[k]; + int j = k << 1; /* left son of k */ + while (j <= s->heap_len) { + /* Set j to the smallest of the two sons: */ + if (j < s->heap_len && + smaller(tree, s->heap[j+1], s->heap[j], s->depth)) { + j++; + } + /* Exit if v is smaller than both sons */ + if (smaller(tree, v, s->heap[j], s->depth)) break; + + /* Exchange v with the smallest son */ + s->heap[k] = s->heap[j]; k = j; + + /* And continue down the tree, setting j to the left son of k */ + j <<= 1; + } + s->heap[k] = v; +} + +/* =========================================================================== + * Compute the optimal bit lengths for a tree and update the total bit length + * for the current block. + * IN assertion: the fields freq and dad are set, heap[heap_max] and + * above are the tree nodes sorted by increasing frequency. + * OUT assertions: the field len is set to the optimal bit length, the + * array bl_count contains the frequencies for each bit length. + * The length opt_len is updated; static_len is also updated if stree is + * not null. + */ +local void gen_bitlen(s, desc) + deflate_state *s; + tree_desc *desc; /* the tree descriptor */ +{ + ct_data *tree = desc->dyn_tree; + int max_code = desc->max_code; + const ct_data *stree = desc->stat_desc->static_tree; + const intf *extra = desc->stat_desc->extra_bits; + int base = desc->stat_desc->extra_base; + int max_length = desc->stat_desc->max_length; + int h; /* heap index */ + int n, m; /* iterate over the tree elements */ + int bits; /* bit length */ + int xbits; /* extra bits */ + ush f; /* frequency */ + int overflow = 0; /* number of elements with bit length too large */ + + for (bits = 0; bits <= MAX_BITS; bits++) s->bl_count[bits] = 0; + + /* In a first pass, compute the optimal bit lengths (which may + * overflow in the case of the bit length tree). + */ + tree[s->heap[s->heap_max]].Len = 0; /* root of the heap */ + + for (h = s->heap_max+1; h < HEAP_SIZE; h++) { + n = s->heap[h]; + bits = tree[tree[n].Dad].Len + 1; + if (bits > max_length) bits = max_length, overflow++; + tree[n].Len = (ush)bits; + /* We overwrite tree[n].Dad which is no longer needed */ + + if (n > max_code) continue; /* not a leaf node */ + + s->bl_count[bits]++; + xbits = 0; + if (n >= base) xbits = extra[n-base]; + f = tree[n].Freq; + s->opt_len += (ulg)f * (bits + xbits); + if (stree) s->static_len += (ulg)f * (stree[n].Len + xbits); + } + if (overflow == 0) return; + + Trace((stderr,"\nbit length overflow\n")); + /* This happens for example on obj2 and pic of the Calgary corpus */ + + /* Find the first bit length which could increase: */ + do { + bits = max_length-1; + while (s->bl_count[bits] == 0) bits--; + s->bl_count[bits]--; /* move one leaf down the tree */ + s->bl_count[bits+1] += 2; /* move one overflow item as its brother */ + s->bl_count[max_length]--; + /* The brother of the overflow item also moves one step up, + * but this does not affect bl_count[max_length] + */ + overflow -= 2; + } while (overflow > 0); + + /* Now recompute all bit lengths, scanning in increasing frequency. + * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all + * lengths instead of fixing only the wrong ones. This idea is taken + * from 'ar' written by Haruhiko Okumura.) + */ + for (bits = max_length; bits != 0; bits--) { + n = s->bl_count[bits]; + while (n != 0) { + m = s->heap[--h]; + if (m > max_code) continue; + if ((unsigned) tree[m].Len != (unsigned) bits) { + Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits)); + s->opt_len += ((long)bits - (long)tree[m].Len) + *(long)tree[m].Freq; + tree[m].Len = (ush)bits; + } + n--; + } + } +} + +/* =========================================================================== + * Generate the codes for a given tree and bit counts (which need not be + * optimal). + * IN assertion: the array bl_count contains the bit length statistics for + * the given tree and the field len is set for all tree elements. + * OUT assertion: the field code is set for all tree elements of non + * zero code length. + */ +local void gen_codes (tree, max_code, bl_count) + ct_data *tree; /* the tree to decorate */ + int max_code; /* largest code with non zero frequency */ + ushf *bl_count; /* number of codes at each bit length */ +{ + ush next_code[MAX_BITS+1]; /* next code value for each bit length */ + ush code = 0; /* running code value */ + int bits; /* bit index */ + int n; /* code index */ + + /* The distribution counts are first used to generate the code values + * without bit reversal. + */ + for (bits = 1; bits <= MAX_BITS; bits++) { + next_code[bits] = code = (code + bl_count[bits-1]) << 1; + } + /* Check that the bit counts in bl_count are consistent. The last code + * must be all ones. + */ + Assert (code + bl_count[MAX_BITS]-1 == (1<dyn_tree; + const ct_data *stree = desc->stat_desc->static_tree; + int elems = desc->stat_desc->elems; + int n, m; /* iterate over heap elements */ + int max_code = -1; /* largest code with non zero frequency */ + int node; /* new node being created */ + + /* Construct the initial heap, with least frequent element in + * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1]. + * heap[0] is not used. + */ + s->heap_len = 0, s->heap_max = HEAP_SIZE; + + for (n = 0; n < elems; n++) { + if (tree[n].Freq != 0) { + s->heap[++(s->heap_len)] = max_code = n; + s->depth[n] = 0; + } else { + tree[n].Len = 0; + } + } + + /* The pkzip format requires that at least one distance code exists, + * and that at least one bit should be sent even if there is only one + * possible code. So to avoid special checks later on we force at least + * two codes of non zero frequency. + */ + while (s->heap_len < 2) { + node = s->heap[++(s->heap_len)] = (max_code < 2 ? ++max_code : 0); + tree[node].Freq = 1; + s->depth[node] = 0; + s->opt_len--; if (stree) s->static_len -= stree[node].Len; + /* node is 0 or 1 so it does not have extra bits */ + } + desc->max_code = max_code; + + /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree, + * establish sub-heaps of increasing lengths: + */ + for (n = s->heap_len/2; n >= 1; n--) pqdownheap(s, tree, n); + + /* Construct the Huffman tree by repeatedly combining the least two + * frequent nodes. + */ + node = elems; /* next internal node of the tree */ + do { + pqremove(s, tree, n); /* n = node of least frequency */ + m = s->heap[SMALLEST]; /* m = node of next least frequency */ + + s->heap[--(s->heap_max)] = n; /* keep the nodes sorted by frequency */ + s->heap[--(s->heap_max)] = m; + + /* Create a new node father of n and m */ + tree[node].Freq = tree[n].Freq + tree[m].Freq; + s->depth[node] = (uch)((s->depth[n] >= s->depth[m] ? + s->depth[n] : s->depth[m]) + 1); + tree[n].Dad = tree[m].Dad = (ush)node; +#ifdef DUMP_BL_TREE + if (tree == s->bl_tree) { + fprintf(stderr,"\nnode %d(%d), sons %d(%d) %d(%d)", + node, tree[node].Freq, n, tree[n].Freq, m, tree[m].Freq); + } +#endif + /* and insert the new node in the heap */ + s->heap[SMALLEST] = node++; + pqdownheap(s, tree, SMALLEST); + + } while (s->heap_len >= 2); + + s->heap[--(s->heap_max)] = s->heap[SMALLEST]; + + /* At this point, the fields freq and dad are set. We can now + * generate the bit lengths. + */ + gen_bitlen(s, (tree_desc *)desc); + + /* The field len is now set, we can generate the bit codes */ + gen_codes ((ct_data *)tree, max_code, s->bl_count); +} + +/* =========================================================================== + * Scan a literal or distance tree to determine the frequencies of the codes + * in the bit length tree. + */ +local void scan_tree (s, tree, max_code) + deflate_state *s; + ct_data *tree; /* the tree to be scanned */ + int max_code; /* and its largest code of non zero frequency */ +{ + int n; /* iterates over all tree elements */ + int prevlen = -1; /* last emitted length */ + int curlen; /* length of current code */ + int nextlen = tree[0].Len; /* length of next code */ + int count = 0; /* repeat count of the current code */ + int max_count = 7; /* max repeat count */ + int min_count = 4; /* min repeat count */ + + if (nextlen == 0) max_count = 138, min_count = 3; + tree[max_code+1].Len = (ush)0xffff; /* guard */ + + for (n = 0; n <= max_code; n++) { + curlen = nextlen; nextlen = tree[n+1].Len; + if (++count < max_count && curlen == nextlen) { + continue; + } else if (count < min_count) { + s->bl_tree[curlen].Freq += count; + } else if (curlen != 0) { + if (curlen != prevlen) s->bl_tree[curlen].Freq++; + s->bl_tree[REP_3_6].Freq++; + } else if (count <= 10) { + s->bl_tree[REPZ_3_10].Freq++; + } else { + s->bl_tree[REPZ_11_138].Freq++; + } + count = 0; prevlen = curlen; + if (nextlen == 0) { + max_count = 138, min_count = 3; + } else if (curlen == nextlen) { + max_count = 6, min_count = 3; + } else { + max_count = 7, min_count = 4; + } + } +} + +/* =========================================================================== + * Send a literal or distance tree in compressed form, using the codes in + * bl_tree. + */ +local void send_tree (s, tree, max_code) + deflate_state *s; + ct_data *tree; /* the tree to be scanned */ + int max_code; /* and its largest code of non zero frequency */ +{ + int n; /* iterates over all tree elements */ + int prevlen = -1; /* last emitted length */ + int curlen; /* length of current code */ + int nextlen = tree[0].Len; /* length of next code */ + int count = 0; /* repeat count of the current code */ + int max_count = 7; /* max repeat count */ + int min_count = 4; /* min repeat count */ + + /* tree[max_code+1].Len = -1; */ /* guard already set */ + if (nextlen == 0) max_count = 138, min_count = 3; + + for (n = 0; n <= max_code; n++) { + curlen = nextlen; nextlen = tree[n+1].Len; + if (++count < max_count && curlen == nextlen) { + continue; + } else if (count < min_count) { + do { send_code(s, curlen, s->bl_tree); } while (--count != 0); + + } else if (curlen != 0) { + if (curlen != prevlen) { + send_code(s, curlen, s->bl_tree); count--; + } + Assert(count >= 3 && count <= 6, " 3_6?"); + send_code(s, REP_3_6, s->bl_tree); send_bits(s, count-3, 2); + + } else if (count <= 10) { + send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count-3, 3); + + } else { + send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count-11, 7); + } + count = 0; prevlen = curlen; + if (nextlen == 0) { + max_count = 138, min_count = 3; + } else if (curlen == nextlen) { + max_count = 6, min_count = 3; + } else { + max_count = 7, min_count = 4; + } + } +} + +/* =========================================================================== + * Construct the Huffman tree for the bit lengths and return the index in + * bl_order of the last bit length code to send. + */ +local int build_bl_tree(s) + deflate_state *s; +{ + int max_blindex; /* index of last bit length code of non zero freq */ + + /* Determine the bit length frequencies for literal and distance trees */ + scan_tree(s, (ct_data *)s->dyn_ltree, s->l_desc.max_code); + scan_tree(s, (ct_data *)s->dyn_dtree, s->d_desc.max_code); + + /* Build the bit length tree: */ + build_tree(s, (tree_desc *)(&(s->bl_desc))); + /* opt_len now includes the length of the tree representations, except + * the lengths of the bit lengths codes and the 5+5+4 bits for the counts. + */ + + /* Determine the number of bit length codes to send. The pkzip format + * requires that at least 4 bit length codes be sent. (appnote.txt says + * 3 but the actual value used is 4.) + */ + for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) { + if (s->bl_tree[bl_order[max_blindex]].Len != 0) break; + } + /* Update opt_len to include the bit length tree and counts */ + s->opt_len += 3*(max_blindex+1) + 5+5+4; + Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld", + s->opt_len, s->static_len)); + + return max_blindex; +} + +/* =========================================================================== + * Send the header for a block using dynamic Huffman trees: the counts, the + * lengths of the bit length codes, the literal tree and the distance tree. + * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4. + */ +local void send_all_trees(s, lcodes, dcodes, blcodes) + deflate_state *s; + int lcodes, dcodes, blcodes; /* number of codes for each tree */ +{ + int rank; /* index in bl_order */ + + Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes"); + Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES, + "too many codes"); + Tracev((stderr, "\nbl counts: ")); + send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */ + send_bits(s, dcodes-1, 5); + send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */ + for (rank = 0; rank < blcodes; rank++) { + Tracev((stderr, "\nbl code %2d ", bl_order[rank])); + send_bits(s, s->bl_tree[bl_order[rank]].Len, 3); + } + Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent)); + + send_tree(s, (ct_data *)s->dyn_ltree, lcodes-1); /* literal tree */ + Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent)); + + send_tree(s, (ct_data *)s->dyn_dtree, dcodes-1); /* distance tree */ + Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent)); +} + +/* =========================================================================== + * Send a stored block + */ +void _tr_stored_block(s, buf, stored_len, eof) + deflate_state *s; + charf *buf; /* input block */ + ulg stored_len; /* length of input block */ + int eof; /* true if this is the last block for a file */ +{ + send_bits(s, (STORED_BLOCK<<1)+eof, 3); /* send block type */ +#ifdef DEBUG + s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L; + s->compressed_len += (stored_len + 4) << 3; +#endif + copy_block(s, buf, (unsigned)stored_len, 1); /* with header */ +} + +/* =========================================================================== + * Send one empty static block to give enough lookahead for inflate. + * This takes 10 bits, of which 7 may remain in the bit buffer. + * The current inflate code requires 9 bits of lookahead. If the + * last two codes for the previous block (real code plus EOB) were coded + * on 5 bits or less, inflate may have only 5+3 bits of lookahead to decode + * the last real code. In this case we send two empty static blocks instead + * of one. (There are no problems if the previous block is stored or fixed.) + * To simplify the code, we assume the worst case of last real code encoded + * on one bit only. + */ +void _tr_align(s) + deflate_state *s; +{ + send_bits(s, STATIC_TREES<<1, 3); + send_code(s, END_BLOCK, static_ltree); +#ifdef DEBUG + s->compressed_len += 10L; /* 3 for block type, 7 for EOB */ +#endif + bi_flush(s); + /* Of the 10 bits for the empty block, we have already sent + * (10 - bi_valid) bits. The lookahead for the last real code (before + * the EOB of the previous block) was thus at least one plus the length + * of the EOB plus what we have just sent of the empty static block. + */ + if (1 + s->last_eob_len + 10 - s->bi_valid < 9) { + send_bits(s, STATIC_TREES<<1, 3); + send_code(s, END_BLOCK, static_ltree); +#ifdef DEBUG + s->compressed_len += 10L; +#endif + bi_flush(s); + } + s->last_eob_len = 7; +} + +/* =========================================================================== + * Determine the best encoding for the current block: dynamic trees, static + * trees or store, and output the encoded block to the zip file. + */ +void _tr_flush_block(s, buf, stored_len, eof) + deflate_state *s; + charf *buf; /* input block, or NULL if too old */ + ulg stored_len; /* length of input block */ + int eof; /* true if this is the last block for a file */ +{ + ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */ + int max_blindex = 0; /* index of last bit length code of non zero freq */ + + /* Build the Huffman trees unless a stored block is forced */ + if (s->level > 0) { + + /* Check if the file is binary or text */ + if (stored_len > 0 && s->strm->data_type == Z_UNKNOWN) + set_data_type(s); + + /* Construct the literal and distance trees */ + build_tree(s, (tree_desc *)(&(s->l_desc))); + Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len, + s->static_len)); + + build_tree(s, (tree_desc *)(&(s->d_desc))); + Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len, + s->static_len)); + /* At this point, opt_len and static_len are the total bit lengths of + * the compressed block data, excluding the tree representations. + */ + + /* Build the bit length tree for the above two trees, and get the index + * in bl_order of the last bit length code to send. + */ + max_blindex = build_bl_tree(s); + + /* Determine the best encoding. Compute the block lengths in bytes. */ + opt_lenb = (s->opt_len+3+7)>>3; + static_lenb = (s->static_len+3+7)>>3; + + Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ", + opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len, + s->last_lit)); + + if (static_lenb <= opt_lenb) opt_lenb = static_lenb; + + } else { + Assert(buf != (char*)0, "lost buf"); + opt_lenb = static_lenb = stored_len + 5; /* force a stored block */ + } + +#ifdef FORCE_STORED + if (buf != (char*)0) { /* force stored block */ +#else + if (stored_len+4 <= opt_lenb && buf != (char*)0) { + /* 4: two words for the lengths */ +#endif + /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE. + * Otherwise we can't have processed more than WSIZE input bytes since + * the last block flush, because compression would have been + * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to + * transform a block into a stored block. + */ + _tr_stored_block(s, buf, stored_len, eof); + +#ifdef FORCE_STATIC + } else if (static_lenb >= 0) { /* force static trees */ +#else + } else if (s->strategy == Z_FIXED || static_lenb == opt_lenb) { +#endif + send_bits(s, (STATIC_TREES<<1)+eof, 3); + compress_block(s, (ct_data *)static_ltree, (ct_data *)static_dtree); +#ifdef DEBUG + s->compressed_len += 3 + s->static_len; +#endif + } else { + send_bits(s, (DYN_TREES<<1)+eof, 3); + send_all_trees(s, s->l_desc.max_code+1, s->d_desc.max_code+1, + max_blindex+1); + compress_block(s, (ct_data *)s->dyn_ltree, (ct_data *)s->dyn_dtree); +#ifdef DEBUG + s->compressed_len += 3 + s->opt_len; +#endif + } + Assert (s->compressed_len == s->bits_sent, "bad compressed size"); + /* The above check is made mod 2^32, for files larger than 512 MB + * and uLong implemented on 32 bits. + */ + init_block(s); + + if (eof) { + bi_windup(s); +#ifdef DEBUG + s->compressed_len += 7; /* align on byte boundary */ +#endif + } + Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3, + s->compressed_len-7*eof)); +} + +/* =========================================================================== + * Save the match info and tally the frequency counts. Return true if + * the current block must be flushed. + */ +int _tr_tally (s, dist, lc) + deflate_state *s; + unsigned dist; /* distance of matched string */ + unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */ +{ + s->d_buf[s->last_lit] = (ush)dist; + s->l_buf[s->last_lit++] = (uch)lc; + if (dist == 0) { + /* lc is the unmatched char */ + s->dyn_ltree[lc].Freq++; + } else { + s->matches++; + /* Here, lc is the match length - MIN_MATCH */ + dist--; /* dist = match distance - 1 */ + Assert((ush)dist < (ush)MAX_DIST(s) && + (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) && + (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match"); + + s->dyn_ltree[_length_code[lc]+LITERALS+1].Freq++; + s->dyn_dtree[d_code(dist)].Freq++; + } + +#ifdef TRUNCATE_BLOCK + /* Try to guess if it is profitable to stop the current block here */ + if ((s->last_lit & 0x1fff) == 0 && s->level > 2) { + /* Compute an upper bound for the compressed length */ + ulg out_length = (ulg)s->last_lit*8L; + ulg in_length = (ulg)((long)s->strstart - s->block_start); + int dcode; + for (dcode = 0; dcode < D_CODES; dcode++) { + out_length += (ulg)s->dyn_dtree[dcode].Freq * + (5L+extra_dbits[dcode]); + } + out_length >>= 3; + Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ", + s->last_lit, in_length, out_length, + 100L - out_length*100L/in_length)); + if (s->matches < s->last_lit/2 && out_length < in_length/2) return 1; + } +#endif + return (s->last_lit == s->lit_bufsize-1); + /* We avoid equality with lit_bufsize because of wraparound at 64K + * on 16 bit machines and because stored blocks are restricted to + * 64K-1 bytes. + */ +} + +/* =========================================================================== + * Send the block data compressed using the given Huffman trees + */ +local void compress_block(s, ltree, dtree) + deflate_state *s; + ct_data *ltree; /* literal tree */ + ct_data *dtree; /* distance tree */ +{ + unsigned dist; /* distance of matched string */ + int lc; /* match length or unmatched char (if dist == 0) */ + unsigned lx = 0; /* running index in l_buf */ + unsigned code; /* the code to send */ + int extra; /* number of extra bits to send */ + + if (s->last_lit != 0) do { + dist = s->d_buf[lx]; + lc = s->l_buf[lx++]; + if (dist == 0) { + send_code(s, lc, ltree); /* send a literal byte */ + Tracecv(isgraph(lc), (stderr," '%c' ", lc)); + } else { + /* Here, lc is the match length - MIN_MATCH */ + code = _length_code[lc]; + send_code(s, code+LITERALS+1, ltree); /* send the length code */ + extra = extra_lbits[code]; + if (extra != 0) { + lc -= base_length[code]; + send_bits(s, lc, extra); /* send the extra length bits */ + } + dist--; /* dist is now the match distance - 1 */ + code = d_code(dist); + Assert (code < D_CODES, "bad d_code"); + + send_code(s, code, dtree); /* send the distance code */ + extra = extra_dbits[code]; + if (extra != 0) { + dist -= base_dist[code]; + send_bits(s, dist, extra); /* send the extra distance bits */ + } + } /* literal or match pair ? */ + + /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */ + Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx, + "pendingBuf overflow"); + + } while (lx < s->last_lit); + + send_code(s, END_BLOCK, ltree); + s->last_eob_len = ltree[END_BLOCK].Len; +} + +/* =========================================================================== + * Set the data type to BINARY or TEXT, using a crude approximation: + * set it to Z_TEXT if all symbols are either printable characters (33 to 255) + * or white spaces (9 to 13, or 32); or set it to Z_BINARY otherwise. + * IN assertion: the fields Freq of dyn_ltree are set. + */ +local void set_data_type(s) + deflate_state *s; +{ + int n; + + for (n = 0; n < 9; n++) + if (s->dyn_ltree[n].Freq != 0) + break; + if (n == 9) + for (n = 14; n < 32; n++) + if (s->dyn_ltree[n].Freq != 0) + break; + s->strm->data_type = (n == 32) ? Z_TEXT : Z_BINARY; +} + +/* =========================================================================== + * Reverse the first len bits of a code, using straightforward code (a faster + * method would use a table) + * IN assertion: 1 <= len <= 15 + */ +local unsigned bi_reverse(code, len) + unsigned code; /* the value to invert */ + int len; /* its bit length */ +{ + register unsigned res = 0; + do { + res |= code & 1; + code >>= 1, res <<= 1; + } while (--len > 0); + return res >> 1; +} + +/* =========================================================================== + * Flush the bit buffer, keeping at most 7 bits in it. + */ +local void bi_flush(s) + deflate_state *s; +{ + if (s->bi_valid == 16) { + put_short(s, s->bi_buf); + s->bi_buf = 0; + s->bi_valid = 0; + } else if (s->bi_valid >= 8) { + put_byte(s, (Byte)s->bi_buf); + s->bi_buf >>= 8; + s->bi_valid -= 8; + } +} + +/* =========================================================================== + * Flush the bit buffer and align the output on a byte boundary + */ +local void bi_windup(s) + deflate_state *s; +{ + if (s->bi_valid > 8) { + put_short(s, s->bi_buf); + } else if (s->bi_valid > 0) { + put_byte(s, (Byte)s->bi_buf); + } + s->bi_buf = 0; + s->bi_valid = 0; +#ifdef DEBUG + s->bits_sent = (s->bits_sent+7) & ~7; +#endif +} + +/* =========================================================================== + * Copy a stored block, storing first the length and its + * one's complement if requested. + */ +local void copy_block(s, buf, len, header) + deflate_state *s; + charf *buf; /* the input data */ + unsigned len; /* its length */ + int header; /* true if block header must be written */ +{ + bi_windup(s); /* align on byte boundary */ + s->last_eob_len = 8; /* enough lookahead for inflate */ + + if (header) { + put_short(s, (ush)len); + put_short(s, (ush)~len); +#ifdef DEBUG + s->bits_sent += 2*16; +#endif + } +#ifdef DEBUG + s->bits_sent += (ulg)len<<3; +#endif + while (len--) { + put_byte(s, *buf++); + } +} diff --git a/dep/StormLib/src/zlib/trees.h b/dep/StormLib/src/zlib/trees.h new file mode 100644 index 00000000000..72facf900f7 --- /dev/null +++ b/dep/StormLib/src/zlib/trees.h @@ -0,0 +1,128 @@ +/* header created automatically with -DGEN_TREES_H */ + +local const ct_data static_ltree[L_CODES+2] = { +{{ 12},{ 8}}, {{140},{ 8}}, {{ 76},{ 8}}, {{204},{ 8}}, {{ 44},{ 8}}, +{{172},{ 8}}, {{108},{ 8}}, {{236},{ 8}}, {{ 28},{ 8}}, {{156},{ 8}}, +{{ 92},{ 8}}, {{220},{ 8}}, {{ 60},{ 8}}, {{188},{ 8}}, {{124},{ 8}}, +{{252},{ 8}}, {{ 2},{ 8}}, {{130},{ 8}}, {{ 66},{ 8}}, {{194},{ 8}}, +{{ 34},{ 8}}, {{162},{ 8}}, {{ 98},{ 8}}, {{226},{ 8}}, {{ 18},{ 8}}, +{{146},{ 8}}, {{ 82},{ 8}}, {{210},{ 8}}, {{ 50},{ 8}}, {{178},{ 8}}, +{{114},{ 8}}, {{242},{ 8}}, {{ 10},{ 8}}, {{138},{ 8}}, {{ 74},{ 8}}, +{{202},{ 8}}, {{ 42},{ 8}}, {{170},{ 8}}, {{106},{ 8}}, {{234},{ 8}}, +{{ 26},{ 8}}, {{154},{ 8}}, {{ 90},{ 8}}, {{218},{ 8}}, {{ 58},{ 8}}, +{{186},{ 8}}, {{122},{ 8}}, {{250},{ 8}}, {{ 6},{ 8}}, {{134},{ 8}}, +{{ 70},{ 8}}, {{198},{ 8}}, {{ 38},{ 8}}, {{166},{ 8}}, {{102},{ 8}}, +{{230},{ 8}}, {{ 22},{ 8}}, {{150},{ 8}}, {{ 86},{ 8}}, {{214},{ 8}}, +{{ 54},{ 8}}, {{182},{ 8}}, {{118},{ 8}}, {{246},{ 8}}, {{ 14},{ 8}}, +{{142},{ 8}}, {{ 78},{ 8}}, {{206},{ 8}}, {{ 46},{ 8}}, {{174},{ 8}}, +{{110},{ 8}}, {{238},{ 8}}, {{ 30},{ 8}}, {{158},{ 8}}, {{ 94},{ 8}}, +{{222},{ 8}}, {{ 62},{ 8}}, {{190},{ 8}}, {{126},{ 8}}, {{254},{ 8}}, +{{ 1},{ 8}}, {{129},{ 8}}, {{ 65},{ 8}}, {{193},{ 8}}, {{ 33},{ 8}}, +{{161},{ 8}}, {{ 97},{ 8}}, {{225},{ 8}}, {{ 17},{ 8}}, {{145},{ 8}}, +{{ 81},{ 8}}, {{209},{ 8}}, {{ 49},{ 8}}, {{177},{ 8}}, {{113},{ 8}}, +{{241},{ 8}}, {{ 9},{ 8}}, {{137},{ 8}}, {{ 73},{ 8}}, {{201},{ 8}}, +{{ 41},{ 8}}, {{169},{ 8}}, {{105},{ 8}}, {{233},{ 8}}, {{ 25},{ 8}}, +{{153},{ 8}}, {{ 89},{ 8}}, {{217},{ 8}}, {{ 57},{ 8}}, {{185},{ 8}}, +{{121},{ 8}}, {{249},{ 8}}, {{ 5},{ 8}}, {{133},{ 8}}, {{ 69},{ 8}}, +{{197},{ 8}}, {{ 37},{ 8}}, {{165},{ 8}}, {{101},{ 8}}, {{229},{ 8}}, +{{ 21},{ 8}}, {{149},{ 8}}, {{ 85},{ 8}}, {{213},{ 8}}, {{ 53},{ 8}}, +{{181},{ 8}}, {{117},{ 8}}, {{245},{ 8}}, {{ 13},{ 8}}, {{141},{ 8}}, +{{ 77},{ 8}}, {{205},{ 8}}, {{ 45},{ 8}}, {{173},{ 8}}, {{109},{ 8}}, +{{237},{ 8}}, {{ 29},{ 8}}, {{157},{ 8}}, {{ 93},{ 8}}, {{221},{ 8}}, +{{ 61},{ 8}}, {{189},{ 8}}, {{125},{ 8}}, {{253},{ 8}}, {{ 19},{ 9}}, +{{275},{ 9}}, {{147},{ 9}}, {{403},{ 9}}, {{ 83},{ 9}}, {{339},{ 9}}, +{{211},{ 9}}, {{467},{ 9}}, {{ 51},{ 9}}, {{307},{ 9}}, {{179},{ 9}}, +{{435},{ 9}}, {{115},{ 9}}, {{371},{ 9}}, {{243},{ 9}}, {{499},{ 9}}, +{{ 11},{ 9}}, {{267},{ 9}}, {{139},{ 9}}, {{395},{ 9}}, {{ 75},{ 9}}, +{{331},{ 9}}, {{203},{ 9}}, {{459},{ 9}}, {{ 43},{ 9}}, {{299},{ 9}}, +{{171},{ 9}}, {{427},{ 9}}, {{107},{ 9}}, {{363},{ 9}}, {{235},{ 9}}, +{{491},{ 9}}, {{ 27},{ 9}}, {{283},{ 9}}, {{155},{ 9}}, {{411},{ 9}}, +{{ 91},{ 9}}, {{347},{ 9}}, {{219},{ 9}}, {{475},{ 9}}, {{ 59},{ 9}}, +{{315},{ 9}}, {{187},{ 9}}, {{443},{ 9}}, {{123},{ 9}}, {{379},{ 9}}, +{{251},{ 9}}, {{507},{ 9}}, {{ 7},{ 9}}, {{263},{ 9}}, {{135},{ 9}}, +{{391},{ 9}}, {{ 71},{ 9}}, {{327},{ 9}}, {{199},{ 9}}, {{455},{ 9}}, +{{ 39},{ 9}}, {{295},{ 9}}, {{167},{ 9}}, {{423},{ 9}}, {{103},{ 9}}, +{{359},{ 9}}, {{231},{ 9}}, {{487},{ 9}}, {{ 23},{ 9}}, {{279},{ 9}}, +{{151},{ 9}}, {{407},{ 9}}, {{ 87},{ 9}}, {{343},{ 9}}, {{215},{ 9}}, +{{471},{ 9}}, {{ 55},{ 9}}, {{311},{ 9}}, {{183},{ 9}}, {{439},{ 9}}, +{{119},{ 9}}, {{375},{ 9}}, {{247},{ 9}}, {{503},{ 9}}, {{ 15},{ 9}}, +{{271},{ 9}}, {{143},{ 9}}, {{399},{ 9}}, {{ 79},{ 9}}, {{335},{ 9}}, +{{207},{ 9}}, {{463},{ 9}}, {{ 47},{ 9}}, {{303},{ 9}}, {{175},{ 9}}, +{{431},{ 9}}, {{111},{ 9}}, {{367},{ 9}}, {{239},{ 9}}, {{495},{ 9}}, +{{ 31},{ 9}}, {{287},{ 9}}, {{159},{ 9}}, {{415},{ 9}}, {{ 95},{ 9}}, +{{351},{ 9}}, {{223},{ 9}}, {{479},{ 9}}, {{ 63},{ 9}}, {{319},{ 9}}, +{{191},{ 9}}, {{447},{ 9}}, {{127},{ 9}}, {{383},{ 9}}, {{255},{ 9}}, +{{511},{ 9}}, {{ 0},{ 7}}, {{ 64},{ 7}}, {{ 32},{ 7}}, {{ 96},{ 7}}, +{{ 16},{ 7}}, {{ 80},{ 7}}, {{ 48},{ 7}}, {{112},{ 7}}, {{ 8},{ 7}}, +{{ 72},{ 7}}, {{ 40},{ 7}}, {{104},{ 7}}, {{ 24},{ 7}}, {{ 88},{ 7}}, +{{ 56},{ 7}}, {{120},{ 7}}, {{ 4},{ 7}}, {{ 68},{ 7}}, {{ 36},{ 7}}, +{{100},{ 7}}, {{ 20},{ 7}}, {{ 84},{ 7}}, {{ 52},{ 7}}, {{116},{ 7}}, +{{ 3},{ 8}}, {{131},{ 8}}, {{ 67},{ 8}}, {{195},{ 8}}, {{ 35},{ 8}}, +{{163},{ 8}}, {{ 99},{ 8}}, {{227},{ 8}} +}; + +local const ct_data static_dtree[D_CODES] = { +{{ 0},{ 5}}, {{16},{ 5}}, {{ 8},{ 5}}, {{24},{ 5}}, {{ 4},{ 5}}, +{{20},{ 5}}, {{12},{ 5}}, {{28},{ 5}}, {{ 2},{ 5}}, {{18},{ 5}}, +{{10},{ 5}}, {{26},{ 5}}, {{ 6},{ 5}}, {{22},{ 5}}, {{14},{ 5}}, +{{30},{ 5}}, {{ 1},{ 5}}, {{17},{ 5}}, {{ 9},{ 5}}, {{25},{ 5}}, +{{ 5},{ 5}}, {{21},{ 5}}, {{13},{ 5}}, {{29},{ 5}}, {{ 3},{ 5}}, +{{19},{ 5}}, {{11},{ 5}}, {{27},{ 5}}, {{ 7},{ 5}}, {{23},{ 5}} +}; + +const uch _dist_code[DIST_CODE_LEN] = { + 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, + 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, +10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, +11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, +12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, +13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, +13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, +14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, +14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, +14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, +15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, +15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, +15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 16, 17, +18, 18, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, +23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, +24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, +26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, +26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, +27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, +27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, +28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, +28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, +28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, +29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, +29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, +29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29 +}; + +const uch _length_code[MAX_MATCH-MIN_MATCH+1]= { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, +13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, +17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, +19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, +21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, +22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, +23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, +24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, +25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, +25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, +26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, +26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, +27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28 +}; + +local const int base_length[LENGTH_CODES] = { +0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56, +64, 80, 96, 112, 128, 160, 192, 224, 0 +}; + +local const int base_dist[D_CODES] = { + 0, 1, 2, 3, 4, 6, 8, 12, 16, 24, + 32, 48, 64, 96, 128, 192, 256, 384, 512, 768, + 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576 +}; + diff --git a/dep/StormLib/src/zlib/zconf.h b/dep/StormLib/src/zlib/zconf.h new file mode 100644 index 00000000000..03a9431c8be --- /dev/null +++ b/dep/StormLib/src/zlib/zconf.h @@ -0,0 +1,332 @@ +/* zconf.h -- configuration of the zlib compression library + * Copyright (C) 1995-2005 Jean-loup Gailly. + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* @(#) $Id$ */ + +#ifndef ZCONF_H +#define ZCONF_H + +/* + * If you *really* need a unique prefix for all types and library functions, + * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. + */ +#ifdef Z_PREFIX +# define deflateInit_ z_deflateInit_ +# define deflate z_deflate +# define deflateEnd z_deflateEnd +# define inflateInit_ z_inflateInit_ +# define inflate z_inflate +# define inflateEnd z_inflateEnd +# define deflateInit2_ z_deflateInit2_ +# define deflateSetDictionary z_deflateSetDictionary +# define deflateCopy z_deflateCopy +# define deflateReset z_deflateReset +# define deflateParams z_deflateParams +# define deflateBound z_deflateBound +# define deflatePrime z_deflatePrime +# define inflateInit2_ z_inflateInit2_ +# define inflateSetDictionary z_inflateSetDictionary +# define inflateSync z_inflateSync +# define inflateSyncPoint z_inflateSyncPoint +# define inflateCopy z_inflateCopy +# define inflateReset z_inflateReset +# define inflateBack z_inflateBack +# define inflateBackEnd z_inflateBackEnd +# define compress z_compress +# define compress2 z_compress2 +# define compressBound z_compressBound +# define uncompress z_uncompress +# define adler32 z_adler32 +# define crc32 z_crc32 +# define get_crc_table z_get_crc_table +# define zError z_zError + +# define alloc_func z_alloc_func +# define free_func z_free_func +# define in_func z_in_func +# define out_func z_out_func +# define Byte z_Byte +# define uInt z_uInt +# define uLong z_uLong +# define Bytef z_Bytef +# define charf z_charf +# define intf z_intf +# define uIntf z_uIntf +# define uLongf z_uLongf +# define voidpf z_voidpf +# define voidp z_voidp +#endif + +#if defined(__MSDOS__) && !defined(MSDOS) +# define MSDOS +#endif +#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) +# define OS2 +#endif +#if defined(_WINDOWS) && !defined(WINDOWS) +# define WINDOWS +#endif +#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) +# ifndef WIN32 +# define WIN32 +# endif +#endif +#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) +# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) +# ifndef SYS16BIT +# define SYS16BIT +# endif +# endif +#endif + +/* + * Compile with -DMAXSEG_64K if the alloc function cannot allocate more + * than 64k bytes at a time (needed on systems with 16-bit int). + */ +#ifdef SYS16BIT +# define MAXSEG_64K +#endif +#ifdef MSDOS +# define UNALIGNED_OK +#endif + +#ifdef __STDC_VERSION__ +# ifndef STDC +# define STDC +# endif +# if __STDC_VERSION__ >= 199901L +# ifndef STDC99 +# define STDC99 +# endif +# endif +#endif +#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) +# define STDC +#endif +#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) +# define STDC +#endif +#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) +# define STDC +#endif +#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) +# define STDC +#endif + +#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ +# define STDC +#endif + +#ifndef STDC +# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ +# define const /* note: need a more gentle solution here */ +# endif +#endif + +/* Some Mac compilers merge all .h files incorrectly: */ +#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__) +# define NO_DUMMY_DECL +#endif + +/* Maximum value for memLevel in deflateInit2 */ +#ifndef MAX_MEM_LEVEL +# ifdef MAXSEG_64K +# define MAX_MEM_LEVEL 8 +# else +# define MAX_MEM_LEVEL 9 +# endif +#endif + +/* Maximum value for windowBits in deflateInit2 and inflateInit2. + * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files + * created by gzip. (Files created by minigzip can still be extracted by + * gzip.) + */ +#ifndef MAX_WBITS +# define MAX_WBITS 15 /* 32K LZ77 window */ +#endif + +/* The memory requirements for deflate are (in bytes): + (1 << (windowBits+2)) + (1 << (memLevel+9)) + that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) + plus a few kilobytes for small objects. For example, if you want to reduce + the default memory requirements from 256K to 128K, compile with + make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" + Of course this will generally degrade compression (there's no free lunch). + + The memory requirements for inflate are (in bytes) 1 << windowBits + that is, 32K for windowBits=15 (default value) plus a few kilobytes + for small objects. +*/ + + /* Type declarations */ + +#ifndef OF /* function prototypes */ +# ifdef STDC +# define OF(args) args +# else +# define OF(args) () +# endif +#endif + +/* The following definitions for FAR are needed only for MSDOS mixed + * model programming (small or medium model with some far allocations). + * This was tested only with MSC; for other MSDOS compilers you may have + * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, + * just define FAR to be empty. + */ +#ifdef SYS16BIT +# if defined(M_I86SM) || defined(M_I86MM) + /* MSC small or medium model */ +# define SMALL_MEDIUM +# ifdef _MSC_VER +# define FAR _far +# else +# define FAR far +# endif +# endif +# if (defined(__SMALL__) || defined(__MEDIUM__)) + /* Turbo C small or medium model */ +# define SMALL_MEDIUM +# ifdef __BORLANDC__ +# define FAR _far +# else +# define FAR far +# endif +# endif +#endif + +#if defined(WINDOWS) || defined(WIN32) + /* If building or using zlib as a DLL, define ZLIB_DLL. + * This is not mandatory, but it offers a little performance increase. + */ +# ifdef ZLIB_DLL +# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) +# ifdef ZLIB_INTERNAL +# define ZEXTERN extern __declspec(dllexport) +# else +# define ZEXTERN extern __declspec(dllimport) +# endif +# endif +# endif /* ZLIB_DLL */ + /* If building or using zlib with the WINAPI/WINAPIV calling convention, + * define ZLIB_WINAPI. + * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. + */ +# ifdef ZLIB_WINAPI +# ifdef FAR +# undef FAR +# endif +# include + /* No need for _export, use ZLIB.DEF instead. */ + /* For complete Windows compatibility, use WINAPI, not __stdcall. */ +# define ZEXPORT WINAPI +# ifdef WIN32 +# define ZEXPORTVA WINAPIV +# else +# define ZEXPORTVA FAR CDECL +# endif +# endif +#endif + +#if defined (__BEOS__) +# ifdef ZLIB_DLL +# ifdef ZLIB_INTERNAL +# define ZEXPORT __declspec(dllexport) +# define ZEXPORTVA __declspec(dllexport) +# else +# define ZEXPORT __declspec(dllimport) +# define ZEXPORTVA __declspec(dllimport) +# endif +# endif +#endif + +#ifndef ZEXTERN +# define ZEXTERN extern +#endif +#ifndef ZEXPORT +# define ZEXPORT +#endif +#ifndef ZEXPORTVA +# define ZEXPORTVA +#endif + +#ifndef FAR +# define FAR +#endif + +#if !defined(__MACTYPES__) +typedef unsigned char Byte; /* 8 bits */ +#endif +typedef unsigned int uInt; /* 16 bits or more */ +typedef unsigned long uLong; /* 32 bits or more */ + +#ifdef SMALL_MEDIUM + /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ +# define Bytef Byte FAR +#else + typedef Byte FAR Bytef; +#endif +typedef char FAR charf; +typedef int FAR intf; +typedef uInt FAR uIntf; +typedef uLong FAR uLongf; + +#ifdef STDC + typedef void const *voidpc; + typedef void FAR *voidpf; + typedef void *voidp; +#else + typedef Byte const *voidpc; + typedef Byte FAR *voidpf; + typedef Byte *voidp; +#endif + +#if 0 /* HAVE_UNISTD_H -- this line is updated by ./configure */ +# include /* for off_t */ +# include /* for SEEK_* and off_t */ +# ifdef VMS +# include /* for off_t */ +# endif +# define z_off_t off_t +#endif +#ifndef SEEK_SET +# define SEEK_SET 0 /* Seek from beginning of file. */ +# define SEEK_CUR 1 /* Seek from current position. */ +# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ +#endif +#ifndef z_off_t +# define z_off_t long +#endif + +#if defined(__OS400__) +# define NO_vsnprintf +#endif + +#if defined(__MVS__) +# define NO_vsnprintf +# ifdef FAR +# undef FAR +# endif +#endif + +/* MVS linker does not support external names larger than 8 bytes */ +#if defined(__MVS__) +# pragma map(deflateInit_,"DEIN") +# pragma map(deflateInit2_,"DEIN2") +# pragma map(deflateEnd,"DEEND") +# pragma map(deflateBound,"DEBND") +# pragma map(inflateInit_,"ININ") +# pragma map(inflateInit2_,"ININ2") +# pragma map(inflateEnd,"INEND") +# pragma map(inflateSync,"INSY") +# pragma map(inflateSetDictionary,"INSEDI") +# pragma map(compressBound,"CMBND") +# pragma map(inflate_table,"INTABL") +# pragma map(inflate_fast,"INFA") +# pragma map(inflate_copyright,"INCOPY") +#endif + +#endif /* ZCONF_H */ diff --git a/dep/StormLib/src/zlib/zlib.h b/dep/StormLib/src/zlib/zlib.h new file mode 100644 index 00000000000..022817927ce --- /dev/null +++ b/dep/StormLib/src/zlib/zlib.h @@ -0,0 +1,1357 @@ +/* zlib.h -- interface of the 'zlib' general purpose compression library + version 1.2.3, July 18th, 2005 + + Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu + + + The data format used by the zlib library is described by RFCs (Request for + Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt + (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format). +*/ + +#ifndef ZLIB_H +#define ZLIB_H + +#include "zconf.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define ZLIB_VERSION "1.2.3" +#define ZLIB_VERNUM 0x1230 + +/* + The 'zlib' compression library provides in-memory compression and + decompression functions, including integrity checks of the uncompressed + data. This version of the library supports only one compression method + (deflation) but other algorithms will be added later and will have the same + stream interface. + + Compression can be done in a single step if the buffers are large + enough (for example if an input file is mmap'ed), or can be done by + repeated calls of the compression function. In the latter case, the + application must provide more input and/or consume the output + (providing more output space) before each call. + + The compressed data format used by default by the in-memory functions is + the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped + around a deflate stream, which is itself documented in RFC 1951. + + The library also supports reading and writing files in gzip (.gz) format + with an interface similar to that of stdio using the functions that start + with "gz". The gzip format is different from the zlib format. gzip is a + gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. + + This library can optionally read and write gzip streams in memory as well. + + The zlib format was designed to be compact and fast for use in memory + and on communications channels. The gzip format was designed for single- + file compression on file systems, has a larger header than zlib to maintain + directory information, and uses a different, slower check method than zlib. + + The library does not install any signal handler. The decoder checks + the consistency of the compressed data, so the library should never + crash even in case of corrupted input. +*/ + +typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); +typedef void (*free_func) OF((voidpf opaque, voidpf address)); + +struct internal_state; + +typedef struct z_stream_s { + Bytef *next_in; /* next input byte */ + uInt avail_in; /* number of bytes available at next_in */ + uLong total_in; /* total nb of input bytes read so far */ + + Bytef *next_out; /* next output byte should be put there */ + uInt avail_out; /* remaining free space at next_out */ + uLong total_out; /* total nb of bytes output so far */ + + char *msg; /* last error message, NULL if no error */ + struct internal_state FAR *state; /* not visible by applications */ + + alloc_func zalloc; /* used to allocate the internal state */ + free_func zfree; /* used to free the internal state */ + voidpf opaque; /* private data object passed to zalloc and zfree */ + + int data_type; /* best guess about the data type: binary or text */ + uLong adler; /* adler32 value of the uncompressed data */ + uLong reserved; /* reserved for future use */ +} z_stream; + +typedef z_stream FAR *z_streamp; + +/* + gzip header information passed to and from zlib routines. See RFC 1952 + for more details on the meanings of these fields. +*/ +typedef struct gz_header_s { + int text; /* true if compressed data believed to be text */ + uLong time; /* modification time */ + int xflags; /* extra flags (not used when writing a gzip file) */ + int os; /* operating system */ + Bytef *extra; /* pointer to extra field or Z_NULL if none */ + uInt extra_len; /* extra field length (valid if extra != Z_NULL) */ + uInt extra_max; /* space at extra (only when reading header) */ + Bytef *name; /* pointer to zero-terminated file name or Z_NULL */ + uInt name_max; /* space at name (only when reading header) */ + Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */ + uInt comm_max; /* space at comment (only when reading header) */ + int hcrc; /* true if there was or will be a header crc */ + int done; /* true when done reading gzip header (not used + when writing a gzip file) */ +} gz_header; + +typedef gz_header FAR *gz_headerp; + +/* + The application must update next_in and avail_in when avail_in has + dropped to zero. It must update next_out and avail_out when avail_out + has dropped to zero. The application must initialize zalloc, zfree and + opaque before calling the init function. All other fields are set by the + compression library and must not be updated by the application. + + The opaque value provided by the application will be passed as the first + parameter for calls of zalloc and zfree. This can be useful for custom + memory management. The compression library attaches no meaning to the + opaque value. + + zalloc must return Z_NULL if there is not enough memory for the object. + If zlib is used in a multi-threaded application, zalloc and zfree must be + thread safe. + + On 16-bit systems, the functions zalloc and zfree must be able to allocate + exactly 65536 bytes, but will not be required to allocate more than this + if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, + pointers returned by zalloc for objects of exactly 65536 bytes *must* + have their offset normalized to zero. The default allocation function + provided by this library ensures this (see zutil.c). To reduce memory + requirements and avoid any allocation of 64K objects, at the expense of + compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h). + + The fields total_in and total_out can be used for statistics or + progress reports. After compression, total_in holds the total size of + the uncompressed data and may be saved for use in the decompressor + (particularly if the decompressor wants to decompress everything in + a single step). +*/ + + /* constants */ + +#define Z_NO_FLUSH 0 +#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */ +#define Z_SYNC_FLUSH 2 +#define Z_FULL_FLUSH 3 +#define Z_FINISH 4 +#define Z_BLOCK 5 +/* Allowed flush values; see deflate() and inflate() below for details */ + +#define Z_OK 0 +#define Z_STREAM_END 1 +#define Z_NEED_DICT 2 +#define Z_ERRNO (-1) +#define Z_STREAM_ERROR (-2) +#define Z_DATA_ERROR (-3) +#define Z_MEM_ERROR (-4) +#define Z_BUF_ERROR (-5) +#define Z_VERSION_ERROR (-6) +/* Return codes for the compression/decompression functions. Negative + * values are errors, positive values are used for special but normal events. + */ + +#define Z_NO_COMPRESSION 0 +#define Z_BEST_SPEED 1 +#define Z_BEST_COMPRESSION 9 +#define Z_DEFAULT_COMPRESSION (-1) +/* compression levels */ + +#define Z_FILTERED 1 +#define Z_HUFFMAN_ONLY 2 +#define Z_RLE 3 +#define Z_FIXED 4 +#define Z_DEFAULT_STRATEGY 0 +/* compression strategy; see deflateInit2() below for details */ + +#define Z_BINARY 0 +#define Z_TEXT 1 +#define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */ +#define Z_UNKNOWN 2 +/* Possible values of the data_type field (though see inflate()) */ + +#define Z_DEFLATED 8 +/* The deflate compression method (the only one supported in this version) */ + +#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ + +#define zlib_version zlibVersion() +/* for compatibility with versions < 1.0.2 */ + + /* basic functions */ + +ZEXTERN const char * ZEXPORT zlibVersion OF((void)); +/* The application can compare zlibVersion and ZLIB_VERSION for consistency. + If the first character differs, the library code actually used is + not compatible with the zlib.h header file used by the application. + This check is automatically made by deflateInit and inflateInit. + */ + +/* +ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); + + Initializes the internal stream state for compression. The fields + zalloc, zfree and opaque must be initialized before by the caller. + If zalloc and zfree are set to Z_NULL, deflateInit updates them to + use default allocation functions. + + The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: + 1 gives best speed, 9 gives best compression, 0 gives no compression at + all (the input data is simply copied a block at a time). + Z_DEFAULT_COMPRESSION requests a default compromise between speed and + compression (currently equivalent to level 6). + + deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_STREAM_ERROR if level is not a valid compression level, + Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible + with the version assumed by the caller (ZLIB_VERSION). + msg is set to null if there is no error message. deflateInit does not + perform any compression: this will be done by deflate(). +*/ + + +ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); +/* + deflate compresses as much data as possible, and stops when the input + buffer becomes empty or the output buffer becomes full. It may introduce some + output latency (reading input without producing any output) except when + forced to flush. + + The detailed semantics are as follows. deflate performs one or both of the + following actions: + + - Compress more input starting at next_in and update next_in and avail_in + accordingly. If not all input can be processed (because there is not + enough room in the output buffer), next_in and avail_in are updated and + processing will resume at this point for the next call of deflate(). + + - Provide more output starting at next_out and update next_out and avail_out + accordingly. This action is forced if the parameter flush is non zero. + Forcing flush frequently degrades the compression ratio, so this parameter + should be set only when necessary (in interactive applications). + Some output may be provided even if flush is not set. + + Before the call of deflate(), the application should ensure that at least + one of the actions is possible, by providing more input and/or consuming + more output, and updating avail_in or avail_out accordingly; avail_out + should never be zero before the call. The application can consume the + compressed output when it wants, for example when the output buffer is full + (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK + and with zero avail_out, it must be called again after making room in the + output buffer because there might be more output pending. + + Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to + decide how much data to accumualte before producing output, in order to + maximize compression. + + If the parameter flush is set to Z_SYNC_FLUSH, all pending output is + flushed to the output buffer and the output is aligned on a byte boundary, so + that the decompressor can get all input data available so far. (In particular + avail_in is zero after the call if enough output space has been provided + before the call.) Flushing may degrade compression for some compression + algorithms and so it should be used only when necessary. + + If flush is set to Z_FULL_FLUSH, all output is flushed as with + Z_SYNC_FLUSH, and the compression state is reset so that decompression can + restart from this point if previous compressed data has been damaged or if + random access is desired. Using Z_FULL_FLUSH too often can seriously degrade + compression. + + If deflate returns with avail_out == 0, this function must be called again + with the same value of the flush parameter and more output space (updated + avail_out), until the flush is complete (deflate returns with non-zero + avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that + avail_out is greater than six to avoid repeated flush markers due to + avail_out == 0 on return. + + If the parameter flush is set to Z_FINISH, pending input is processed, + pending output is flushed and deflate returns with Z_STREAM_END if there + was enough output space; if deflate returns with Z_OK, this function must be + called again with Z_FINISH and more output space (updated avail_out) but no + more input data, until it returns with Z_STREAM_END or an error. After + deflate has returned Z_STREAM_END, the only possible operations on the + stream are deflateReset or deflateEnd. + + Z_FINISH can be used immediately after deflateInit if all the compression + is to be done in a single step. In this case, avail_out must be at least + the value returned by deflateBound (see below). If deflate does not return + Z_STREAM_END, then it must be called again as described above. + + deflate() sets strm->adler to the adler32 checksum of all input read + so far (that is, total_in bytes). + + deflate() may update strm->data_type if it can make a good guess about + the input data type (Z_BINARY or Z_TEXT). In doubt, the data is considered + binary. This field is only for information purposes and does not affect + the compression algorithm in any manner. + + deflate() returns Z_OK if some progress has been made (more input + processed or more output produced), Z_STREAM_END if all input has been + consumed and all output has been produced (only when flush is set to + Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example + if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible + (for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is not + fatal, and deflate() can be called again with more input and more output + space to continue compressing. +*/ + + +ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); +/* + All dynamically allocated data structures for this stream are freed. + This function discards any unprocessed input and does not flush any + pending output. + + deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the + stream state was inconsistent, Z_DATA_ERROR if the stream was freed + prematurely (some input or output was discarded). In the error case, + msg may be set but then points to a static string (which must not be + deallocated). +*/ + + +/* +ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); + + Initializes the internal stream state for decompression. The fields + next_in, avail_in, zalloc, zfree and opaque must be initialized before by + the caller. If next_in is not Z_NULL and avail_in is large enough (the exact + value depends on the compression method), inflateInit determines the + compression method from the zlib header and allocates all data structures + accordingly; otherwise the allocation will be deferred to the first call of + inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to + use default allocation functions. + + inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_VERSION_ERROR if the zlib library version is incompatible with the + version assumed by the caller. msg is set to null if there is no error + message. inflateInit does not perform any decompression apart from reading + the zlib header if present: this will be done by inflate(). (So next_in and + avail_in may be modified, but next_out and avail_out are unchanged.) +*/ + + +ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); +/* + inflate decompresses as much data as possible, and stops when the input + buffer becomes empty or the output buffer becomes full. It may introduce + some output latency (reading input without producing any output) except when + forced to flush. + + The detailed semantics are as follows. inflate performs one or both of the + following actions: + + - Decompress more input starting at next_in and update next_in and avail_in + accordingly. If not all input can be processed (because there is not + enough room in the output buffer), next_in is updated and processing + will resume at this point for the next call of inflate(). + + - Provide more output starting at next_out and update next_out and avail_out + accordingly. inflate() provides as much output as possible, until there + is no more input data or no more space in the output buffer (see below + about the flush parameter). + + Before the call of inflate(), the application should ensure that at least + one of the actions is possible, by providing more input and/or consuming + more output, and updating the next_* and avail_* values accordingly. + The application can consume the uncompressed output when it wants, for + example when the output buffer is full (avail_out == 0), or after each + call of inflate(). If inflate returns Z_OK and with zero avail_out, it + must be called again after making room in the output buffer because there + might be more output pending. + + The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, + Z_FINISH, or Z_BLOCK. Z_SYNC_FLUSH requests that inflate() flush as much + output as possible to the output buffer. Z_BLOCK requests that inflate() stop + if and when it gets to the next deflate block boundary. When decoding the + zlib or gzip format, this will cause inflate() to return immediately after + the header and before the first block. When doing a raw inflate, inflate() + will go ahead and process the first block, and will return when it gets to + the end of that block, or when it runs out of data. + + The Z_BLOCK option assists in appending to or combining deflate streams. + Also to assist in this, on return inflate() will set strm->data_type to the + number of unused bits in the last byte taken from strm->next_in, plus 64 + if inflate() is currently decoding the last block in the deflate stream, + plus 128 if inflate() returned immediately after decoding an end-of-block + code or decoding the complete header up to just before the first byte of the + deflate stream. The end-of-block will not be indicated until all of the + uncompressed data from that block has been written to strm->next_out. The + number of unused bits may in general be greater than seven, except when + bit 7 of data_type is set, in which case the number of unused bits will be + less than eight. + + inflate() should normally be called until it returns Z_STREAM_END or an + error. However if all decompression is to be performed in a single step + (a single call of inflate), the parameter flush should be set to + Z_FINISH. In this case all pending input is processed and all pending + output is flushed; avail_out must be large enough to hold all the + uncompressed data. (The size of the uncompressed data may have been saved + by the compressor for this purpose.) The next operation on this stream must + be inflateEnd to deallocate the decompression state. The use of Z_FINISH + is never required, but can be used to inform inflate that a faster approach + may be used for the single inflate() call. + + In this implementation, inflate() always flushes as much output as + possible to the output buffer, and always uses the faster approach on the + first call. So the only effect of the flush parameter in this implementation + is on the return value of inflate(), as noted below, or when it returns early + because Z_BLOCK is used. + + If a preset dictionary is needed after this call (see inflateSetDictionary + below), inflate sets strm->adler to the adler32 checksum of the dictionary + chosen by the compressor and returns Z_NEED_DICT; otherwise it sets + strm->adler to the adler32 checksum of all output produced so far (that is, + total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described + below. At the end of the stream, inflate() checks that its computed adler32 + checksum is equal to that saved by the compressor and returns Z_STREAM_END + only if the checksum is correct. + + inflate() will decompress and check either zlib-wrapped or gzip-wrapped + deflate data. The header type is detected automatically. Any information + contained in the gzip header is not retained, so applications that need that + information should instead use raw inflate, see inflateInit2() below, or + inflateBack() and perform their own processing of the gzip header and + trailer. + + inflate() returns Z_OK if some progress has been made (more input processed + or more output produced), Z_STREAM_END if the end of the compressed data has + been reached and all uncompressed output has been produced, Z_NEED_DICT if a + preset dictionary is needed at this point, Z_DATA_ERROR if the input data was + corrupted (input stream not conforming to the zlib format or incorrect check + value), Z_STREAM_ERROR if the stream structure was inconsistent (for example + if next_in or next_out was NULL), Z_MEM_ERROR if there was not enough memory, + Z_BUF_ERROR if no progress is possible or if there was not enough room in the + output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and + inflate() can be called again with more input and more output space to + continue decompressing. If Z_DATA_ERROR is returned, the application may then + call inflateSync() to look for a good compression block if a partial recovery + of the data is desired. +*/ + + +ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); +/* + All dynamically allocated data structures for this stream are freed. + This function discards any unprocessed input and does not flush any + pending output. + + inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state + was inconsistent. In the error case, msg may be set but then points to a + static string (which must not be deallocated). +*/ + + /* Advanced functions */ + +/* + The following functions are needed only in some special applications. +*/ + +/* +ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, + int level, + int method, + int windowBits, + int memLevel, + int strategy)); + + This is another version of deflateInit with more compression options. The + fields next_in, zalloc, zfree and opaque must be initialized before by + the caller. + + The method parameter is the compression method. It must be Z_DEFLATED in + this version of the library. + + The windowBits parameter is the base two logarithm of the window size + (the size of the history buffer). It should be in the range 8..15 for this + version of the library. Larger values of this parameter result in better + compression at the expense of memory usage. The default value is 15 if + deflateInit is used instead. + + windowBits can also be -8..-15 for raw deflate. In this case, -windowBits + determines the window size. deflate() will then generate raw deflate data + with no zlib header or trailer, and will not compute an adler32 check value. + + windowBits can also be greater than 15 for optional gzip encoding. Add + 16 to windowBits to write a simple gzip header and trailer around the + compressed data instead of a zlib wrapper. The gzip header will have no + file name, no extra data, no comment, no modification time (set to zero), + no header crc, and the operating system will be set to 255 (unknown). If a + gzip stream is being written, strm->adler is a crc32 instead of an adler32. + + The memLevel parameter specifies how much memory should be allocated + for the internal compression state. memLevel=1 uses minimum memory but + is slow and reduces compression ratio; memLevel=9 uses maximum memory + for optimal speed. The default value is 8. See zconf.h for total memory + usage as a function of windowBits and memLevel. + + The strategy parameter is used to tune the compression algorithm. Use the + value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a + filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no + string match), or Z_RLE to limit match distances to one (run-length + encoding). Filtered data consists mostly of small values with a somewhat + random distribution. In this case, the compression algorithm is tuned to + compress them better. The effect of Z_FILTERED is to force more Huffman + coding and less string matching; it is somewhat intermediate between + Z_DEFAULT and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as fast as + Z_HUFFMAN_ONLY, but give better compression for PNG image data. The strategy + parameter only affects the compression ratio but not the correctness of the + compressed output even if it is not set appropriately. Z_FIXED prevents the + use of dynamic Huffman codes, allowing for a simpler decoder for special + applications. + + deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid + method). msg is set to null if there is no error message. deflateInit2 does + not perform any compression: this will be done by deflate(). +*/ + +ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, + const Bytef *dictionary, + uInt dictLength)); +/* + Initializes the compression dictionary from the given byte sequence + without producing any compressed output. This function must be called + immediately after deflateInit, deflateInit2 or deflateReset, before any + call of deflate. The compressor and decompressor must use exactly the same + dictionary (see inflateSetDictionary). + + The dictionary should consist of strings (byte sequences) that are likely + to be encountered later in the data to be compressed, with the most commonly + used strings preferably put towards the end of the dictionary. Using a + dictionary is most useful when the data to be compressed is short and can be + predicted with good accuracy; the data can then be compressed better than + with the default empty dictionary. + + Depending on the size of the compression data structures selected by + deflateInit or deflateInit2, a part of the dictionary may in effect be + discarded, for example if the dictionary is larger than the window size in + deflate or deflate2. Thus the strings most likely to be useful should be + put at the end of the dictionary, not at the front. In addition, the + current implementation of deflate will use at most the window size minus + 262 bytes of the provided dictionary. + + Upon return of this function, strm->adler is set to the adler32 value + of the dictionary; the decompressor may later use this value to determine + which dictionary has been used by the compressor. (The adler32 value + applies to the whole dictionary even if only a subset of the dictionary is + actually used by the compressor.) If a raw deflate was requested, then the + adler32 value is not computed and strm->adler is not set. + + deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a + parameter is invalid (such as NULL dictionary) or the stream state is + inconsistent (for example if deflate has already been called for this stream + or if the compression method is bsort). deflateSetDictionary does not + perform any compression: this will be done by deflate(). +*/ + +ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, + z_streamp source)); +/* + Sets the destination stream as a complete copy of the source stream. + + This function can be useful when several compression strategies will be + tried, for example when there are several ways of pre-processing the input + data with a filter. The streams that will be discarded should then be freed + by calling deflateEnd. Note that deflateCopy duplicates the internal + compression state which can be quite large, so this strategy is slow and + can consume lots of memory. + + deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_STREAM_ERROR if the source stream state was inconsistent + (such as zalloc being NULL). msg is left unchanged in both source and + destination. +*/ + +ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm)); +/* + This function is equivalent to deflateEnd followed by deflateInit, + but does not free and reallocate all the internal compression state. + The stream will keep the same compression level and any other attributes + that may have been set by deflateInit2. + + deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent (such as zalloc or state being NULL). +*/ + +ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, + int level, + int strategy)); +/* + Dynamically update the compression level and compression strategy. The + interpretation of level and strategy is as in deflateInit2. This can be + used to switch between compression and straight copy of the input data, or + to switch to a different kind of input data requiring a different + strategy. If the compression level is changed, the input available so far + is compressed with the old level (and may be flushed); the new level will + take effect only at the next call of deflate(). + + Before the call of deflateParams, the stream state must be set as for + a call of deflate(), since the currently available input may have to + be compressed and flushed. In particular, strm->avail_out must be non-zero. + + deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source + stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR + if strm->avail_out was zero. +*/ + +ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm, + int good_length, + int max_lazy, + int nice_length, + int max_chain)); +/* + Fine tune deflate's internal compression parameters. This should only be + used by someone who understands the algorithm used by zlib's deflate for + searching for the best matching string, and even then only by the most + fanatic optimizer trying to squeeze out the last compressed bit for their + specific input data. Read the deflate.c source code for the meaning of the + max_lazy, good_length, nice_length, and max_chain parameters. + + deflateTune() can be called after deflateInit() or deflateInit2(), and + returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream. + */ + +ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm, + uLong sourceLen)); +/* + deflateBound() returns an upper bound on the compressed size after + deflation of sourceLen bytes. It must be called after deflateInit() + or deflateInit2(). This would be used to allocate an output buffer + for deflation in a single pass, and so would be called before deflate(). +*/ + +ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm, + int bits, + int value)); +/* + deflatePrime() inserts bits in the deflate output stream. The intent + is that this function is used to start off the deflate output with the + bits leftover from a previous deflate stream when appending to it. As such, + this function can only be used for raw deflate, and must be used before the + first deflate() call after a deflateInit2() or deflateReset(). bits must be + less than or equal to 16, and that many of the least significant bits of + value will be inserted in the output. + + deflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent. +*/ + +ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm, + gz_headerp head)); +/* + deflateSetHeader() provides gzip header information for when a gzip + stream is requested by deflateInit2(). deflateSetHeader() may be called + after deflateInit2() or deflateReset() and before the first call of + deflate(). The text, time, os, extra field, name, and comment information + in the provided gz_header structure are written to the gzip header (xflag is + ignored -- the extra flags are set according to the compression level). The + caller must assure that, if not Z_NULL, name and comment are terminated with + a zero byte, and that if extra is not Z_NULL, that extra_len bytes are + available there. If hcrc is true, a gzip header crc is included. Note that + the current versions of the command-line version of gzip (up through version + 1.3.x) do not support header crc's, and will report that it is a "multi-part + gzip file" and give up. + + If deflateSetHeader is not used, the default gzip header has text false, + the time set to zero, and os set to 255, with no extra, name, or comment + fields. The gzip header is returned to the default state by deflateReset(). + + deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent. +*/ + +/* +ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, + int windowBits)); + + This is another version of inflateInit with an extra parameter. The + fields next_in, avail_in, zalloc, zfree and opaque must be initialized + before by the caller. + + The windowBits parameter is the base two logarithm of the maximum window + size (the size of the history buffer). It should be in the range 8..15 for + this version of the library. The default value is 15 if inflateInit is used + instead. windowBits must be greater than or equal to the windowBits value + provided to deflateInit2() while compressing, or it must be equal to 15 if + deflateInit2() was not used. If a compressed stream with a larger window + size is given as input, inflate() will return with the error code + Z_DATA_ERROR instead of trying to allocate a larger window. + + windowBits can also be -8..-15 for raw inflate. In this case, -windowBits + determines the window size. inflate() will then process raw deflate data, + not looking for a zlib or gzip header, not generating a check value, and not + looking for any check values for comparison at the end of the stream. This + is for use with other formats that use the deflate compressed data format + such as zip. Those formats provide their own check values. If a custom + format is developed using the raw deflate format for compressed data, it is + recommended that a check value such as an adler32 or a crc32 be applied to + the uncompressed data as is done in the zlib, gzip, and zip formats. For + most applications, the zlib format should be used as is. Note that comments + above on the use in deflateInit2() applies to the magnitude of windowBits. + + windowBits can also be greater than 15 for optional gzip decoding. Add + 32 to windowBits to enable zlib and gzip decoding with automatic header + detection, or add 16 to decode only the gzip format (the zlib format will + return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is + a crc32 instead of an adler32. + + inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_STREAM_ERROR if a parameter is invalid (such as a null strm). msg + is set to null if there is no error message. inflateInit2 does not perform + any decompression apart from reading the zlib header if present: this will + be done by inflate(). (So next_in and avail_in may be modified, but next_out + and avail_out are unchanged.) +*/ + +ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, + const Bytef *dictionary, + uInt dictLength)); +/* + Initializes the decompression dictionary from the given uncompressed byte + sequence. This function must be called immediately after a call of inflate, + if that call returned Z_NEED_DICT. The dictionary chosen by the compressor + can be determined from the adler32 value returned by that call of inflate. + The compressor and decompressor must use exactly the same dictionary (see + deflateSetDictionary). For raw inflate, this function can be called + immediately after inflateInit2() or inflateReset() and before any call of + inflate() to set the dictionary. The application must insure that the + dictionary that was used for compression is provided. + + inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a + parameter is invalid (such as NULL dictionary) or the stream state is + inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the + expected one (incorrect adler32 value). inflateSetDictionary does not + perform any decompression: this will be done by subsequent calls of + inflate(). +*/ + +ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); +/* + Skips invalid compressed data until a full flush point (see above the + description of deflate with Z_FULL_FLUSH) can be found, or until all + available input is skipped. No output is provided. + + inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR + if no more input was provided, Z_DATA_ERROR if no flush point has been found, + or Z_STREAM_ERROR if the stream structure was inconsistent. In the success + case, the application may save the current current value of total_in which + indicates where valid compressed data was found. In the error case, the + application may repeatedly call inflateSync, providing more input each time, + until success or end of the input data. +*/ + +ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest, + z_streamp source)); +/* + Sets the destination stream as a complete copy of the source stream. + + This function can be useful when randomly accessing a large stream. The + first pass through the stream can periodically record the inflate state, + allowing restarting inflate at those points when randomly accessing the + stream. + + inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_STREAM_ERROR if the source stream state was inconsistent + (such as zalloc being NULL). msg is left unchanged in both source and + destination. +*/ + +ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); +/* + This function is equivalent to inflateEnd followed by inflateInit, + but does not free and reallocate all the internal decompression state. + The stream will keep attributes that may have been set by inflateInit2. + + inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent (such as zalloc or state being NULL). +*/ + +ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm, + int bits, + int value)); +/* + This function inserts bits in the inflate input stream. The intent is + that this function is used to start inflating at a bit position in the + middle of a byte. The provided bits will be used before any bytes are used + from next_in. This function should only be used with raw inflate, and + should be used before the first inflate() call after inflateInit2() or + inflateReset(). bits must be less than or equal to 16, and that many of the + least significant bits of value will be inserted in the input. + + inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent. +*/ + +ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm, + gz_headerp head)); +/* + inflateGetHeader() requests that gzip header information be stored in the + provided gz_header structure. inflateGetHeader() may be called after + inflateInit2() or inflateReset(), and before the first call of inflate(). + As inflate() processes the gzip stream, head->done is zero until the header + is completed, at which time head->done is set to one. If a zlib stream is + being decoded, then head->done is set to -1 to indicate that there will be + no gzip header information forthcoming. Note that Z_BLOCK can be used to + force inflate() to return immediately after header processing is complete + and before any actual data is decompressed. + + The text, time, xflags, and os fields are filled in with the gzip header + contents. hcrc is set to true if there is a header CRC. (The header CRC + was valid if done is set to one.) If extra is not Z_NULL, then extra_max + contains the maximum number of bytes to write to extra. Once done is true, + extra_len contains the actual extra field length, and extra contains the + extra field, or that field truncated if extra_max is less than extra_len. + If name is not Z_NULL, then up to name_max characters are written there, + terminated with a zero unless the length is greater than name_max. If + comment is not Z_NULL, then up to comm_max characters are written there, + terminated with a zero unless the length is greater than comm_max. When + any of extra, name, or comment are not Z_NULL and the respective field is + not present in the header, then that field is set to Z_NULL to signal its + absence. This allows the use of deflateSetHeader() with the returned + structure to duplicate the header. However if those fields are set to + allocated memory, then the application will need to save those pointers + elsewhere so that they can be eventually freed. + + If inflateGetHeader is not used, then the header information is simply + discarded. The header is always checked for validity, including the header + CRC if present. inflateReset() will reset the process to discard the header + information. The application would need to call inflateGetHeader() again to + retrieve the header from the next gzip stream. + + inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent. +*/ + +/* +ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, + unsigned char FAR *window)); + + Initialize the internal stream state for decompression using inflateBack() + calls. The fields zalloc, zfree and opaque in strm must be initialized + before the call. If zalloc and zfree are Z_NULL, then the default library- + derived memory allocation routines are used. windowBits is the base two + logarithm of the window size, in the range 8..15. window is a caller + supplied buffer of that size. Except for special applications where it is + assured that deflate was used with small window sizes, windowBits must be 15 + and a 32K byte window must be supplied to be able to decompress general + deflate streams. + + See inflateBack() for the usage of these routines. + + inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of + the paramaters are invalid, Z_MEM_ERROR if the internal state could not + be allocated, or Z_VERSION_ERROR if the version of the library does not + match the version of the header file. +*/ + +typedef unsigned (*in_func) OF((void FAR *, unsigned char FAR * FAR *)); +typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned)); + +ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, + in_func in, void FAR *in_desc, + out_func out, void FAR *out_desc)); +/* + inflateBack() does a raw inflate with a single call using a call-back + interface for input and output. This is more efficient than inflate() for + file i/o applications in that it avoids copying between the output and the + sliding window by simply making the window itself the output buffer. This + function trusts the application to not change the output buffer passed by + the output function, at least until inflateBack() returns. + + inflateBackInit() must be called first to allocate the internal state + and to initialize the state with the user-provided window buffer. + inflateBack() may then be used multiple times to inflate a complete, raw + deflate stream with each call. inflateBackEnd() is then called to free + the allocated state. + + A raw deflate stream is one with no zlib or gzip header or trailer. + This routine would normally be used in a utility that reads zip or gzip + files and writes out uncompressed files. The utility would decode the + header and process the trailer on its own, hence this routine expects + only the raw deflate stream to decompress. This is different from the + normal behavior of inflate(), which expects either a zlib or gzip header and + trailer around the deflate stream. + + inflateBack() uses two subroutines supplied by the caller that are then + called by inflateBack() for input and output. inflateBack() calls those + routines until it reads a complete deflate stream and writes out all of the + uncompressed data, or until it encounters an error. The function's + parameters and return types are defined above in the in_func and out_func + typedefs. inflateBack() will call in(in_desc, &buf) which should return the + number of bytes of provided input, and a pointer to that input in buf. If + there is no input available, in() must return zero--buf is ignored in that + case--and inflateBack() will return a buffer error. inflateBack() will call + out(out_desc, buf, len) to write the uncompressed data buf[0..len-1]. out() + should return zero on success, or non-zero on failure. If out() returns + non-zero, inflateBack() will return with an error. Neither in() nor out() + are permitted to change the contents of the window provided to + inflateBackInit(), which is also the buffer that out() uses to write from. + The length written by out() will be at most the window size. Any non-zero + amount of input may be provided by in(). + + For convenience, inflateBack() can be provided input on the first call by + setting strm->next_in and strm->avail_in. If that input is exhausted, then + in() will be called. Therefore strm->next_in must be initialized before + calling inflateBack(). If strm->next_in is Z_NULL, then in() will be called + immediately for input. If strm->next_in is not Z_NULL, then strm->avail_in + must also be initialized, and then if strm->avail_in is not zero, input will + initially be taken from strm->next_in[0 .. strm->avail_in - 1]. + + The in_desc and out_desc parameters of inflateBack() is passed as the + first parameter of in() and out() respectively when they are called. These + descriptors can be optionally used to pass any information that the caller- + supplied in() and out() functions need to do their job. + + On return, inflateBack() will set strm->next_in and strm->avail_in to + pass back any unused input that was provided by the last in() call. The + return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR + if in() or out() returned an error, Z_DATA_ERROR if there was a format + error in the deflate stream (in which case strm->msg is set to indicate the + nature of the error), or Z_STREAM_ERROR if the stream was not properly + initialized. In the case of Z_BUF_ERROR, an input or output error can be + distinguished using strm->next_in which will be Z_NULL only if in() returned + an error. If strm->next is not Z_NULL, then the Z_BUF_ERROR was due to + out() returning non-zero. (in() will always be called before out(), so + strm->next_in is assured to be defined if out() returns non-zero.) Note + that inflateBack() cannot return Z_OK. +*/ + +ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm)); +/* + All memory allocated by inflateBackInit() is freed. + + inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream + state was inconsistent. +*/ + +ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void)); +/* Return flags indicating compile-time options. + + Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other: + 1.0: size of uInt + 3.2: size of uLong + 5.4: size of voidpf (pointer) + 7.6: size of z_off_t + + Compiler, assembler, and debug options: + 8: DEBUG + 9: ASMV or ASMINF -- use ASM code + 10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention + 11: 0 (reserved) + + One-time table building (smaller code, but not thread-safe if true): + 12: BUILDFIXED -- build static block decoding tables when needed + 13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed + 14,15: 0 (reserved) + + Library content (indicates missing functionality): + 16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking + deflate code when not needed) + 17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect + and decode gzip streams (to avoid linking crc code) + 18-19: 0 (reserved) + + Operation variations (changes in library functionality): + 20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate + 21: FASTEST -- deflate algorithm with only one, lowest compression level + 22,23: 0 (reserved) + + The sprintf variant used by gzprintf (zero is best): + 24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format + 25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure! + 26: 0 = returns value, 1 = void -- 1 means inferred string length returned + + Remainder: + 27-31: 0 (reserved) + */ + + + /* utility functions */ + +/* + The following utility functions are implemented on top of the + basic stream-oriented functions. To simplify the interface, some + default options are assumed (compression level and memory usage, + standard memory allocation functions). The source code of these + utility functions can easily be modified if you need special options. +*/ + +ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen)); +/* + Compresses the source buffer into the destination buffer. sourceLen is + the byte length of the source buffer. Upon entry, destLen is the total + size of the destination buffer, which must be at least the value returned + by compressBound(sourceLen). Upon exit, destLen is the actual size of the + compressed buffer. + This function can be used to compress a whole file at once if the + input file is mmap'ed. + compress returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if there was not enough room in the output + buffer. +*/ + +ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen, + int level)); +/* + Compresses the source buffer into the destination buffer. The level + parameter has the same meaning as in deflateInit. sourceLen is the byte + length of the source buffer. Upon entry, destLen is the total size of the + destination buffer, which must be at least the value returned by + compressBound(sourceLen). Upon exit, destLen is the actual size of the + compressed buffer. + + compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_BUF_ERROR if there was not enough room in the output buffer, + Z_STREAM_ERROR if the level parameter is invalid. +*/ + +ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen)); +/* + compressBound() returns an upper bound on the compressed size after + compress() or compress2() on sourceLen bytes. It would be used before + a compress() or compress2() call to allocate the destination buffer. +*/ + +ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen)); +/* + Decompresses the source buffer into the destination buffer. sourceLen is + the byte length of the source buffer. Upon entry, destLen is the total + size of the destination buffer, which must be large enough to hold the + entire uncompressed data. (The size of the uncompressed data must have + been saved previously by the compressor and transmitted to the decompressor + by some mechanism outside the scope of this compression library.) + Upon exit, destLen is the actual size of the compressed buffer. + This function can be used to decompress a whole file at once if the + input file is mmap'ed. + + uncompress returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if there was not enough room in the output + buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete. +*/ + + +typedef voidp gzFile; + +ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); +/* + Opens a gzip (.gz) file for reading or writing. The mode parameter + is as in fopen ("rb" or "wb") but can also include a compression level + ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for + Huffman only compression as in "wb1h", or 'R' for run-length encoding + as in "wb1R". (See the description of deflateInit2 for more information + about the strategy parameter.) + + gzopen can be used to read a file which is not in gzip format; in this + case gzread will directly read from the file without decompression. + + gzopen returns NULL if the file could not be opened or if there was + insufficient memory to allocate the (de)compression state; errno + can be checked to distinguish the two cases (if errno is zero, the + zlib error is Z_MEM_ERROR). */ + +ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); +/* + gzdopen() associates a gzFile with the file descriptor fd. File + descriptors are obtained from calls like open, dup, creat, pipe or + fileno (in the file has been previously opened with fopen). + The mode parameter is as in gzopen. + The next call of gzclose on the returned gzFile will also close the + file descriptor fd, just like fclose(fdopen(fd), mode) closes the file + descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode). + gzdopen returns NULL if there was insufficient memory to allocate + the (de)compression state. +*/ + +ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); +/* + Dynamically update the compression level or strategy. See the description + of deflateInit2 for the meaning of these parameters. + gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not + opened for writing. +*/ + +ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); +/* + Reads the given number of uncompressed bytes from the compressed file. + If the input file was not in gzip format, gzread copies the given number + of bytes into the buffer. + gzread returns the number of uncompressed bytes actually read (0 for + end of file, -1 for error). */ + +ZEXTERN int ZEXPORT gzwrite OF((gzFile file, + voidpc buf, unsigned len)); +/* + Writes the given number of uncompressed bytes into the compressed file. + gzwrite returns the number of uncompressed bytes actually written + (0 in case of error). +*/ + +ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...)); +/* + Converts, formats, and writes the args to the compressed file under + control of the format string, as in fprintf. gzprintf returns the number of + uncompressed bytes actually written (0 in case of error). The number of + uncompressed bytes written is limited to 4095. The caller should assure that + this limit is not exceeded. If it is exceeded, then gzprintf() will return + return an error (0) with nothing written. In this case, there may also be a + buffer overflow with unpredictable consequences, which is possible only if + zlib was compiled with the insecure functions sprintf() or vsprintf() + because the secure snprintf() or vsnprintf() functions were not available. +*/ + +ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); +/* + Writes the given null-terminated string to the compressed file, excluding + the terminating null character. + gzputs returns the number of characters written, or -1 in case of error. +*/ + +ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len)); +/* + Reads bytes from the compressed file until len-1 characters are read, or + a newline character is read and transferred to buf, or an end-of-file + condition is encountered. The string is then terminated with a null + character. + gzgets returns buf, or Z_NULL in case of error. +*/ + +ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); +/* + Writes c, converted to an unsigned char, into the compressed file. + gzputc returns the value that was written, or -1 in case of error. +*/ + +ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); +/* + Reads one byte from the compressed file. gzgetc returns this byte + or -1 in case of end of file or error. +*/ + +ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file)); +/* + Push one character back onto the stream to be read again later. + Only one character of push-back is allowed. gzungetc() returns the + character pushed, or -1 on failure. gzungetc() will fail if a + character has been pushed but not read yet, or if c is -1. The pushed + character will be discarded if the stream is repositioned with gzseek() + or gzrewind(). +*/ + +ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); +/* + Flushes all pending output into the compressed file. The parameter + flush is as in the deflate() function. The return value is the zlib + error number (see function gzerror below). gzflush returns Z_OK if + the flush parameter is Z_FINISH and all output could be flushed. + gzflush should be called only when strictly necessary because it can + degrade compression. +*/ + +ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, + z_off_t offset, int whence)); +/* + Sets the starting position for the next gzread or gzwrite on the + given compressed file. The offset represents a number of bytes in the + uncompressed data stream. The whence parameter is defined as in lseek(2); + the value SEEK_END is not supported. + If the file is opened for reading, this function is emulated but can be + extremely slow. If the file is opened for writing, only forward seeks are + supported; gzseek then compresses a sequence of zeroes up to the new + starting position. + + gzseek returns the resulting offset location as measured in bytes from + the beginning of the uncompressed stream, or -1 in case of error, in + particular if the file is opened for writing and the new starting position + would be before the current position. +*/ + +ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); +/* + Rewinds the given file. This function is supported only for reading. + + gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET) +*/ + +ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); +/* + Returns the starting position for the next gzread or gzwrite on the + given compressed file. This position represents a number of bytes in the + uncompressed data stream. + + gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) +*/ + +ZEXTERN int ZEXPORT gzeof OF((gzFile file)); +/* + Returns 1 when EOF has previously been detected reading the given + input stream, otherwise zero. +*/ + +ZEXTERN int ZEXPORT gzdirect OF((gzFile file)); +/* + Returns 1 if file is being read directly without decompression, otherwise + zero. +*/ + +ZEXTERN int ZEXPORT gzclose OF((gzFile file)); +/* + Flushes all pending output if necessary, closes the compressed file + and deallocates all the (de)compression state. The return value is the zlib + error number (see function gzerror below). +*/ + +ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); +/* + Returns the error message for the last error which occurred on the + given compressed file. errnum is set to zlib error number. If an + error occurred in the file system and not in the compression library, + errnum is set to Z_ERRNO and the application may consult errno + to get the exact error code. +*/ + +ZEXTERN void ZEXPORT gzclearerr OF((gzFile file)); +/* + Clears the error and end-of-file flags for file. This is analogous to the + clearerr() function in stdio. This is useful for continuing to read a gzip + file that is being written concurrently. +*/ + + /* checksum functions */ + +/* + These functions are not related to compression but are exported + anyway because they might be useful in applications using the + compression library. +*/ + +ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); +/* + Update a running Adler-32 checksum with the bytes buf[0..len-1] and + return the updated checksum. If buf is NULL, this function returns + the required initial value for the checksum. + An Adler-32 checksum is almost as reliable as a CRC32 but can be computed + much faster. Usage example: + + uLong adler = adler32(0L, Z_NULL, 0); + + while (read_buffer(buffer, length) != EOF) { + adler = adler32(adler, buffer, length); + } + if (adler != original_adler) error(); +*/ + +ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2, + z_off_t len2)); +/* + Combine two Adler-32 checksums into one. For two sequences of bytes, seq1 + and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for + each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of + seq1 and seq2 concatenated, requiring only adler1, adler2, and len2. +*/ + +ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); +/* + Update a running CRC-32 with the bytes buf[0..len-1] and return the + updated CRC-32. If buf is NULL, this function returns the required initial + value for the for the crc. Pre- and post-conditioning (one's complement) is + performed within this function so it shouldn't be done by the application. + Usage example: + + uLong crc = crc32(0L, Z_NULL, 0); + + while (read_buffer(buffer, length) != EOF) { + crc = crc32(crc, buffer, length); + } + if (crc != original_crc) error(); +*/ + +ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2)); + +/* + Combine two CRC-32 check values into one. For two sequences of bytes, + seq1 and seq2 with lengths len1 and len2, CRC-32 check values were + calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 + check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and + len2. +*/ + + + /* various hacks, don't look :) */ + +/* deflateInit and inflateInit are macros to allow checking the zlib version + * and the compiler's view of z_stream: + */ +ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level, + const char *version, int stream_size)); +ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm, + const char *version, int stream_size)); +ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method, + int windowBits, int memLevel, + int strategy, const char *version, + int stream_size)); +ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, + const char *version, int stream_size)); +ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits, + unsigned char FAR *window, + const char *version, + int stream_size)); +#define deflateInit(strm, level) \ + deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) +#define inflateInit(strm) \ + inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) +#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ + deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ + (strategy), ZLIB_VERSION, sizeof(z_stream)) +#define inflateInit2(strm, windowBits) \ + inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) +#define inflateBackInit(strm, windowBits, window) \ + inflateBackInit_((strm), (windowBits), (window), \ + ZLIB_VERSION, sizeof(z_stream)) + + +#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL) + struct internal_state {int dummy;}; /* hack for buggy compilers */ +#endif + +ZEXTERN const char * ZEXPORT zError OF((int)); +ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp z)); +ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void)); + +#ifdef __cplusplus +} +#endif + +#endif /* ZLIB_H */ diff --git a/dep/StormLib/src/zlib/zutil.c b/dep/StormLib/src/zlib/zutil.c new file mode 100644 index 00000000000..d55f5948a37 --- /dev/null +++ b/dep/StormLib/src/zlib/zutil.c @@ -0,0 +1,318 @@ +/* zutil.c -- target dependent utility functions for the compression library + * Copyright (C) 1995-2005 Jean-loup Gailly. + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* @(#) $Id$ */ + +#include "zutil.h" + +#ifndef NO_DUMMY_DECL +struct internal_state {int dummy;}; /* for buggy compilers */ +#endif + +const char * const z_errmsg[10] = { +"need dictionary", /* Z_NEED_DICT 2 */ +"stream end", /* Z_STREAM_END 1 */ +"", /* Z_OK 0 */ +"file error", /* Z_ERRNO (-1) */ +"stream error", /* Z_STREAM_ERROR (-2) */ +"data error", /* Z_DATA_ERROR (-3) */ +"insufficient memory", /* Z_MEM_ERROR (-4) */ +"buffer error", /* Z_BUF_ERROR (-5) */ +"incompatible version",/* Z_VERSION_ERROR (-6) */ +""}; + + +const char * ZEXPORT zlibVersion() +{ + return ZLIB_VERSION; +} + +uLong ZEXPORT zlibCompileFlags() +{ + uLong flags; + + flags = 0; + switch (sizeof(uInt)) { + case 2: break; + case 4: flags += 1; break; + case 8: flags += 2; break; + default: flags += 3; + } + switch (sizeof(uLong)) { + case 2: break; + case 4: flags += 1 << 2; break; + case 8: flags += 2 << 2; break; + default: flags += 3 << 2; + } + switch (sizeof(voidpf)) { + case 2: break; + case 4: flags += 1 << 4; break; + case 8: flags += 2 << 4; break; + default: flags += 3 << 4; + } + switch (sizeof(z_off_t)) { + case 2: break; + case 4: flags += 1 << 6; break; + case 8: flags += 2 << 6; break; + default: flags += 3 << 6; + } +#ifdef DEBUG + flags += 1 << 8; +#endif +#if defined(ASMV) || defined(ASMINF) + flags += 1 << 9; +#endif +#ifdef ZLIB_WINAPI + flags += 1 << 10; +#endif +#ifdef BUILDFIXED + flags += 1 << 12; +#endif +#ifdef DYNAMIC_CRC_TABLE + flags += 1 << 13; +#endif +#ifdef NO_GZCOMPRESS + flags += 1L << 16; +#endif +#ifdef NO_GZIP + flags += 1L << 17; +#endif +#ifdef PKZIP_BUG_WORKAROUND + flags += 1L << 20; +#endif +#ifdef FASTEST + flags += 1L << 21; +#endif +#ifdef STDC +# ifdef NO_vsnprintf + flags += 1L << 25; +# ifdef HAS_vsprintf_void + flags += 1L << 26; +# endif +# else +# ifdef HAS_vsnprintf_void + flags += 1L << 26; +# endif +# endif +#else + flags += 1L << 24; +# ifdef NO_snprintf + flags += 1L << 25; +# ifdef HAS_sprintf_void + flags += 1L << 26; +# endif +# else +# ifdef HAS_snprintf_void + flags += 1L << 26; +# endif +# endif +#endif + return flags; +} + +#ifdef DEBUG + +# ifndef verbose +# define verbose 0 +# endif +int z_verbose = verbose; + +void z_error (m) + char *m; +{ + fprintf(stderr, "%s\n", m); + exit(1); +} +#endif + +/* exported to allow conversion of error code to string for compress() and + * uncompress() + */ +const char * ZEXPORT zError(err) + int err; +{ + return ERR_MSG(err); +} + +#if defined(_WIN32_WCE) + /* The Microsoft C Run-Time Library for Windows CE doesn't have + * errno. We define it as a global variable to simplify porting. + * Its value is always 0 and should not be used. + */ + int errno = 0; +#endif + +#ifndef HAVE_MEMCPY + +void zmemcpy(dest, source, len) + Bytef* dest; + const Bytef* source; + uInt len; +{ + if (len == 0) return; + do { + *dest++ = *source++; /* ??? to be unrolled */ + } while (--len != 0); +} + +int zmemcmp(s1, s2, len) + const Bytef* s1; + const Bytef* s2; + uInt len; +{ + uInt j; + + for (j = 0; j < len; j++) { + if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1; + } + return 0; +} + +void zmemzero(dest, len) + Bytef* dest; + uInt len; +{ + if (len == 0) return; + do { + *dest++ = 0; /* ??? to be unrolled */ + } while (--len != 0); +} +#endif + + +#ifdef SYS16BIT + +#ifdef __TURBOC__ +/* Turbo C in 16-bit mode */ + +# define MY_ZCALLOC + +/* Turbo C malloc() does not allow dynamic allocation of 64K bytes + * and farmalloc(64K) returns a pointer with an offset of 8, so we + * must fix the pointer. Warning: the pointer must be put back to its + * original form in order to free it, use zcfree(). + */ + +#define MAX_PTR 10 +/* 10*64K = 640K */ + +local int next_ptr = 0; + +typedef struct ptr_table_s { + voidpf org_ptr; + voidpf new_ptr; +} ptr_table; + +local ptr_table table[MAX_PTR]; +/* This table is used to remember the original form of pointers + * to large buffers (64K). Such pointers are normalized with a zero offset. + * Since MSDOS is not a preemptive multitasking OS, this table is not + * protected from concurrent access. This hack doesn't work anyway on + * a protected system like OS/2. Use Microsoft C instead. + */ + +voidpf zcalloc (voidpf opaque, unsigned items, unsigned size) +{ + voidpf buf = opaque; /* just to make some compilers happy */ + ulg bsize = (ulg)items*size; + + /* If we allocate less than 65520 bytes, we assume that farmalloc + * will return a usable pointer which doesn't have to be normalized. + */ + if (bsize < 65520L) { + buf = farmalloc(bsize); + if (*(ush*)&buf != 0) return buf; + } else { + buf = farmalloc(bsize + 16L); + } + if (buf == NULL || next_ptr >= MAX_PTR) return NULL; + table[next_ptr].org_ptr = buf; + + /* Normalize the pointer to seg:0 */ + *((ush*)&buf+1) += ((ush)((uch*)buf-0) + 15) >> 4; + *(ush*)&buf = 0; + table[next_ptr++].new_ptr = buf; + return buf; +} + +void zcfree (voidpf opaque, voidpf ptr) +{ + int n; + if (*(ush*)&ptr != 0) { /* object < 64K */ + farfree(ptr); + return; + } + /* Find the original pointer */ + for (n = 0; n < next_ptr; n++) { + if (ptr != table[n].new_ptr) continue; + + farfree(table[n].org_ptr); + while (++n < next_ptr) { + table[n-1] = table[n]; + } + next_ptr--; + return; + } + ptr = opaque; /* just to make some compilers happy */ + Assert(0, "zcfree: ptr not found"); +} + +#endif /* __TURBOC__ */ + + +#ifdef M_I86 +/* Microsoft C in 16-bit mode */ + +# define MY_ZCALLOC + +#if (!defined(_MSC_VER) || (_MSC_VER <= 600)) +# define _halloc halloc +# define _hfree hfree +#endif + +voidpf zcalloc (voidpf opaque, unsigned items, unsigned size) +{ + if (opaque) opaque = 0; /* to make compiler happy */ + return _halloc((long)items, size); +} + +void zcfree (voidpf opaque, voidpf ptr) +{ + if (opaque) opaque = 0; /* to make compiler happy */ + _hfree(ptr); +} + +#endif /* M_I86 */ + +#endif /* SYS16BIT */ + + +#ifndef MY_ZCALLOC /* Any system without a special alloc function */ + +#ifndef STDC +extern voidp malloc OF((uInt size)); +extern voidp calloc OF((uInt items, uInt size)); +extern void free OF((voidpf ptr)); +#endif + +voidpf zcalloc (opaque, items, size) + voidpf opaque; + unsigned items; + unsigned size; +{ + if (opaque) items += size - size; /* make compiler happy */ + return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) : + (voidpf)calloc(items, size); +} + +void zcfree (opaque, ptr) + voidpf opaque; + voidpf ptr; +{ + free(ptr); + if (opaque) return; /* make compiler happy */ +} + +#endif /* MY_ZCALLOC */ diff --git a/dep/StormLib/src/zlib/zutil.h b/dep/StormLib/src/zlib/zutil.h new file mode 100644 index 00000000000..b7d5eff81b6 --- /dev/null +++ b/dep/StormLib/src/zlib/zutil.h @@ -0,0 +1,269 @@ +/* zutil.h -- internal interface and configuration of the compression library + * Copyright (C) 1995-2005 Jean-loup Gailly. + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* WARNING: this file should *not* be used by applications. It is + part of the implementation of the compression library and is + subject to change. Applications should only use zlib.h. + */ + +/* @(#) $Id$ */ + +#ifndef ZUTIL_H +#define ZUTIL_H + +#define ZLIB_INTERNAL +#include "zlib.h" + +#ifdef STDC +# ifndef _WIN32_WCE +# include +# endif +# include +# include +#endif +#ifdef NO_ERRNO_H +# ifdef _WIN32_WCE + /* The Microsoft C Run-Time Library for Windows CE doesn't have + * errno. We define it as a global variable to simplify porting. + * Its value is always 0 and should not be used. We rename it to + * avoid conflict with other libraries that use the same workaround. + */ +# define errno z_errno +# endif + extern int errno; +#else +# ifndef _WIN32_WCE +# include +# endif +#endif + +#ifndef local +# define local static +#endif +/* compile with -Dlocal if your debugger can't find static symbols */ + +typedef unsigned char uch; +typedef uch FAR uchf; +typedef unsigned short ush; +typedef ush FAR ushf; +typedef unsigned long ulg; + +extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ +/* (size given to avoid silly warnings with Visual C++) */ + +#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)] + +#define ERR_RETURN(strm,err) \ + return (strm->msg = (char*)ERR_MSG(err), (err)) +/* To be used only when the state is known to be valid */ + + /* common constants */ + +#ifndef DEF_WBITS +# define DEF_WBITS MAX_WBITS +#endif +/* default windowBits for decompression. MAX_WBITS is for compression only */ + +#if MAX_MEM_LEVEL >= 8 +# define DEF_MEM_LEVEL 8 +#else +# define DEF_MEM_LEVEL MAX_MEM_LEVEL +#endif +/* default memLevel */ + +#define STORED_BLOCK 0 +#define STATIC_TREES 1 +#define DYN_TREES 2 +/* The three kinds of block type */ + +#define MIN_MATCH 3 +#define MAX_MATCH 258 +/* The minimum and maximum match lengths */ + +#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */ + + /* target dependencies */ + +#if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32)) +# define OS_CODE 0x00 +# if defined(__TURBOC__) || defined(__BORLANDC__) +# if(__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__)) + /* Allow compilation with ANSI keywords only enabled */ + void _Cdecl farfree( void *block ); + void *_Cdecl farmalloc( unsigned long nbytes ); +# else +# include +# endif +# else /* MSC or DJGPP */ +# include +# endif +#endif + +#ifdef AMIGA +# define OS_CODE 0x01 +#endif + +#if defined(VAXC) || defined(VMS) +# define OS_CODE 0x02 +# define F_OPEN(name, mode) \ + fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512") +#endif + +#if defined(ATARI) || defined(atarist) +# define OS_CODE 0x05 +#endif + +#ifdef OS2 +# define OS_CODE 0x06 +# ifdef M_I86 + #include +# endif +#endif + +#if defined(MACOS) || defined(TARGET_OS_MAC) +# define OS_CODE 0x07 +# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os +# include /* for fdopen */ +# else +# ifndef fdopen +# define fdopen(fd,mode) NULL /* No fdopen() */ +# endif +# endif +#endif + +#ifdef TOPS20 +# define OS_CODE 0x0a +#endif + +#ifdef WIN32 +# ifndef __CYGWIN__ /* Cygwin is Unix, not Win32 */ +# define OS_CODE 0x0b +# endif +#endif + +#ifdef __50SERIES /* Prime/PRIMOS */ +# define OS_CODE 0x0f +#endif + +#if defined(_BEOS_) || defined(RISCOS) +# define fdopen(fd,mode) NULL /* No fdopen() */ +#endif + +#if (defined(_MSC_VER) && (_MSC_VER > 600)) +# if defined(_WIN32_WCE) +# define fdopen(fd,mode) NULL /* No fdopen() */ +# ifndef _PTRDIFF_T_DEFINED + typedef int ptrdiff_t; +# define _PTRDIFF_T_DEFINED +# endif +# else +# define fdopen(fd,type) _fdopen(fd,type) +# endif +#endif + + /* common defaults */ + +#ifndef OS_CODE +# define OS_CODE 0x03 /* assume Unix */ +#endif + +#ifndef F_OPEN +# define F_OPEN(name, mode) fopen((name), (mode)) +#endif + + /* functions */ + +#if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550) +# ifndef HAVE_VSNPRINTF +# define HAVE_VSNPRINTF +# endif +#endif +#if defined(__CYGWIN__) +# ifndef HAVE_VSNPRINTF +# define HAVE_VSNPRINTF +# endif +#endif +#ifndef HAVE_VSNPRINTF +# ifdef MSDOS + /* vsnprintf may exist on some MS-DOS compilers (DJGPP?), + but for now we just assume it doesn't. */ +# define NO_vsnprintf +# endif +# ifdef __TURBOC__ +# define NO_vsnprintf +# endif +# ifdef WIN32 + /* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */ +# if !defined(vsnprintf) && !defined(NO_vsnprintf) +# define vsnprintf _vsnprintf +# endif +# endif +# ifdef __SASC +# define NO_vsnprintf +# endif +#endif +#ifdef VMS +# define NO_vsnprintf +#endif + +#if defined(pyr) +# define NO_MEMCPY +#endif +#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__) + /* Use our own functions for small and medium model with MSC <= 5.0. + * You may have to use the same strategy for Borland C (untested). + * The __SC__ check is for Symantec. + */ +# define NO_MEMCPY +#endif +#if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY) +# define HAVE_MEMCPY +#endif +#ifdef HAVE_MEMCPY +# ifdef SMALL_MEDIUM /* MSDOS small or medium model */ +# define zmemcpy _fmemcpy +# define zmemcmp _fmemcmp +# define zmemzero(dest, len) _fmemset(dest, 0, len) +# else +# define zmemcpy memcpy +# define zmemcmp memcmp +# define zmemzero(dest, len) memset(dest, 0, len) +# endif +#else + extern void zmemcpy OF((Bytef* dest, const Bytef* source, uInt len)); + extern int zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len)); + extern void zmemzero OF((Bytef* dest, uInt len)); +#endif + +/* Diagnostic functions */ +#ifdef DEBUG +# include + extern int z_verbose; + extern void z_error OF((char *m)); +# define Assert(cond,msg) {if(!(cond)) z_error(msg);} +# define Trace(x) {if (z_verbose>=0) fprintf x ;} +# define Tracev(x) {if (z_verbose>0) fprintf x ;} +# define Tracevv(x) {if (z_verbose>1) fprintf x ;} +# define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;} +# define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;} +#else +# define Assert(cond,msg) +# define Trace(x) +# define Tracev(x) +# define Tracevv(x) +# define Tracec(c,x) +# define Tracecv(c,x) +#endif + + +voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size)); +void zcfree OF((voidpf opaque, voidpf ptr)); + +#define ZALLOC(strm, items, size) \ + (*((strm)->zalloc))((strm)->opaque, (items), (size)) +#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr)) +#define TRY_FREE(s, p) {if (p) ZFREE(s, p);} + +#endif /* ZUTIL_H */ diff --git a/dep/StormLib/storm_dll/storm_dll.cpp b/dep/StormLib/storm_dll/storm_dll.cpp new file mode 100644 index 00000000000..2941f2a37f5 --- /dev/null +++ b/dep/StormLib/storm_dll/storm_dll.cpp @@ -0,0 +1,117 @@ +/*****************************************************************************/ +/* Storm.cpp Copyright (c) Ladislav Zezula 2003 */ +/*---------------------------------------------------------------------------*/ +/* This is just a dummy module for building import library for Storm.dll */ +/*---------------------------------------------------------------------------*/ +/* Date Ver Who Comment */ +/* -------- ---- --- ------- */ +/* 11.04.03 1.00 Lad The first version of Storm.cpp */ +/*****************************************************************************/ + +#include + +#define BUILDING_STORM_CPP +#define STORM_ALTERNATE_NAMES +#include "storm_dll.h" + +BOOL WINAPI SFILE(OpenArchive)(LPCSTR lpFileName, DWORD dwPriority, DWORD dwFlags, HANDLE *hMPQ) +{ + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +BOOL WINAPI SFILE(CloseArchive)(HANDLE hMPQ) +{ + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +BOOL WINAPI SFILE(GetArchiveName)(HANDLE hMPQ, LPCSTR lpBuffer, DWORD dwBufferLength) +{ + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +BOOL WINAPI SFILE(OpenFile)(LPCSTR lpFileName, HANDLE *hFile) +{ + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +BOOL WINAPI SFILE(OpenFileEx)(HANDLE hMPQ, LPCSTR lpFileName, DWORD dwSearchScope, HANDLE *hFile) +{ + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +BOOL WINAPI SFILE(CloseFile)(HANDLE hFile) +{ + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +DWORD WINAPI SFILE(GetFileSize)(HANDLE hFile, LPDWORD lpFileSizeHigh) +{ + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +BOOL WINAPI SFILE(GetFileArchive)(HANDLE hFile, HANDLE *hMPQ) +{ + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +BOOL WINAPI SFILE(GetFileName)(HANDLE hFile, LPCSTR lpBuffer, DWORD dwBufferLength) +{ + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +DWORD WINAPI SFILE(SetFilePointer)(HANDLE hFile, long lDistanceToMove, PLONG lplDistanceToMoveHigh, DWORD dwMoveMethod) +{ + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +BOOL WINAPI SFILE(ReadFile)(HANDLE hFile,LPVOID lpBuffer,DWORD nNumberOfBytesToRead,LPDWORD lpNumberOfBytesRead,LPOVERLAPPED lpOverlapped) +{ + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +LCID WINAPI SFILE(SetLocale)(LCID nNewLocale) +{ + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +BOOL WINAPI SFILE(GetBasePath)(LPCSTR lpBuffer, DWORD dwBufferLength) +{ + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +BOOL WINAPI SFILE(SetBasePath)(LPCSTR lpNewBasePath) +{ + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +BOOL WINAPI SFILE(Destroy)() +{ + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +BOOL WINAPI SCOMP(Compress)(char * pbOutBuffer, int * pdwOutLength, char * pbInBuffer, int dwInLength, int uCmp, int uCmpType, int nCmpLevel) +{ + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +BOOL WINAPI SCOMP(Decompress)(char * pbOutBuffer, int * pdwOutLength, char * pbInBuffer, int dwInLength) +{ + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} diff --git a/dep/StormLib/storm_dll/storm_dll.def b/dep/StormLib/storm_dll/storm_dll.def new file mode 100644 index 00000000000..8de88f5db3d --- /dev/null +++ b/dep/StormLib/storm_dll/storm_dll.def @@ -0,0 +1,25 @@ +; Storm definition file with alternate Storm.dll names +LIBRARY "Storm" + +EXPORTS + StormCloseArchive @252 ; 0x0FC + StormCloseFile @253 ; 0x0FD + StormDestroy @262 ; 0x106 + StormGetFileArchive @264 ; 0x108 + StormGetFileSize @265 ; 0x109 + StormOpenArchive @266 ; 0x10A + StormOpenFile @267 ; 0x10B + StormOpenFileEx @268 ; 0x10C + StormReadFile @269 ; 0x10D + StormSetBasePath @270 ; 0x10E + StormSetFilePointer @271 ; 0x10F + StormSetLocale @272 ; 0x110 + StormGetBasePath @273 ; 0x111 + StormGetArchiveName @275 ; 0x113 + StormGetFileName @276 ; 0x114 + +; StormSetLastError @465 ; 0x + + StormCompress @551 ; 0x227 + StormDecompress @552 ; 0x228 + \ No newline at end of file diff --git a/dep/StormLib/storm_dll/storm_dll.h b/dep/StormLib/storm_dll/storm_dll.h new file mode 100644 index 00000000000..6d67820a22f --- /dev/null +++ b/dep/StormLib/storm_dll/storm_dll.h @@ -0,0 +1,67 @@ +/*****************************************************************************/ +/* Storm.h Copyright Justin Olbrantz(Quantam) 2000 */ +/*---------------------------------------------------------------------------*/ +/* Storm Interface Library v1.0 for Windows */ +/* */ +/* Author : Justin Olbrantz(Quantam) */ +/* E-mail : omega@dragonfire.net */ +/* WWW : www.campaigncreations.com/starcraft/mpq2k/inside_mopaq/ */ +/*---------------------------------------------------------------------------*/ +/* Date Ver Who Comment */ +/* -------- ---- --- ------- */ +/* xx.xx.00 1.00 Qua The first version of Storm.h */ +/* 11.04.03 1.00 Lad Added some functions */ +/*****************************************************************************/ + +// We need the Windows data types for the Storm prototypes +#include + +#ifndef __STORM_H__ +#define __STORM_H__ + +// Somethimes is necessary to change the function names so they +// will not conflict with other MPQ tools. +#ifdef STORM_ALTERNATE_NAMES + #define SFILE(Name) Storm##Name + #define SCOMP(Name) Storm##Name +#else + #define SFILE(Name) SFile##Name + #define SCOMP(Name) SComp##Name +#endif + + +// Just in case anyone is still using C out there +#ifdef __cplusplus +extern "C" { +#endif + +// Storm file function prototypes +BOOL WINAPI SFILE(OpenArchive)(LPCSTR lpFileName, DWORD dwPriority, DWORD dwFlags, HANDLE *hMPQ); +BOOL WINAPI SFILE(CloseArchive)(HANDLE hMPQ); +BOOL WINAPI SFILE(GetArchiveName)(HANDLE hMPQ, LPCSTR lpBuffer, DWORD dwBufferLength); +BOOL WINAPI SFILE(OpenFile)(LPCSTR lpFileName, HANDLE *hFile); +BOOL WINAPI SFILE(OpenFileEx)(HANDLE hMPQ, LPCSTR lpFileName, DWORD dwSearchScope, HANDLE *hFile); +BOOL WINAPI SFILE(CloseFile)(HANDLE hFile); +DWORD WINAPI SFILE(GetFileSize)(HANDLE hFile, LPDWORD lpFileSizeHigh); +BOOL WINAPI SFILE(GetFileArchive)(HANDLE hFile, HANDLE *hMPQ); +BOOL WINAPI SFILE(GetFileName)(HANDLE hFile, LPCSTR lpBuffer, DWORD dwBufferLength); +DWORD WINAPI SFILE(SetFilePointer)(HANDLE hFile, long lDistanceToMove, PLONG lplDistanceToMoveHigh, DWORD dwMoveMethod); +BOOL WINAPI SFILE(ReadFile)(HANDLE hFile,LPVOID lpBuffer,DWORD nNumberOfBytesToRead,LPDWORD lpNumberOfBytesRead,LPOVERLAPPED lpOverlapped); +LCID WINAPI SFILE(SetLocale)(LCID nNewLocale); +BOOL WINAPI SFILE(GetBasePath)(LPCSTR lpBuffer, DWORD dwBufferLength); +BOOL WINAPI SFILE(SetBasePath)(LPCSTR lpNewBasePath); + +// Storm (de)compression functions +BOOL WINAPI SCOMP(Compress) (char * pbOutBuffer, int * pdwOutLength, char * pbInBuffer, int dwInLength, int uCmp, int uCmpType, int nCmpLevel); +BOOL WINAPI SCOMP(Decompress)(char * pbOutBuffer, int * pdwOutLength, char * pbInBuffer, int dwInLength); + + +#if defined(_MSC_VER) && !defined(BUILDING_STORM_CPP) +#pragma comment(lib, "Storm.lib") // Force linking Storm.lib and thus Storm.dll +#endif + +#ifdef __cplusplus +} +#endif + +#endif // __STORM_H__ diff --git a/dep/StormLib/stormlib_dll/DllMain.c b/dep/StormLib/stormlib_dll/DllMain.c new file mode 100644 index 00000000000..cbfa84a08a8 --- /dev/null +++ b/dep/StormLib/stormlib_dll/DllMain.c @@ -0,0 +1,24 @@ +/*****************************************************************************/ +/* DllMain.c Copyright (c) Ladislav Zezula 2006 */ +/*---------------------------------------------------------------------------*/ +/* Description: DllMain for the StormLib.dll library */ +/*---------------------------------------------------------------------------*/ +/* Date Ver Who Comment */ +/* -------- ---- --- ------- */ +/* 23.11.06 1.00 Lad The first version of DllMain.c */ +/*****************************************************************************/ + +#define WIN32_LEAN_AND_MEAN +#include + +//----------------------------------------------------------------------------- +// DllMain + +DWORD WINAPI DllMain(HINSTANCE hInst, DWORD dwReason, LPVOID lpReserved) +{ + UNREFERENCED_PARAMETER(hInst); + UNREFERENCED_PARAMETER(dwReason); + UNREFERENCED_PARAMETER(lpReserved); + + return TRUE; +} diff --git a/dep/StormLib/stormlib_dll/StormLib.def b/dep/StormLib/stormlib_dll/StormLib.def new file mode 100644 index 00000000000..2b00766ef9d --- /dev/null +++ b/dep/StormLib/stormlib_dll/StormLib.def @@ -0,0 +1,77 @@ +; +; Export file for Windows +; Copyright (c) 2007-2010 Ladislav Zezula +; ladik@zezula.net +; + +LIBRARY StormLib.dll + +EXPORTS + + SFileGetGlobalFlags + SFileSetGlobalFlags + SFileSetLocale + SFileGetLocale + + SFileOpenArchive + SFileCreateArchive + SFileFlushArchive + SFileCloseArchive + + SFileAddListFile + + SFileSetCompactCallback + SFileCompactArchive + + SFileGetMaxFileCount + SFileSetMaxFileCount + + SFileGetAttributes + SFileSetAttributes + SFileUpdateFileAttributes + + SFileOpenPatchArchive + SFileIsPatchedArchive + + SFileOpenFileEx + SFileGetFileSize + SFileSetFilePointer + SFileReadFile + SFileCloseFile + + SFileHasFile + SFileGetFileName + SFileGetFileInfo + + SFileExtractFile + + SFileVerifyFile + SFileVerifyRawData + SFileVerifyArchive + + SFileFindFirstFile + SFileFindNextFile + SFileFindClose + + SListFileFindFirstFile + SListFileFindNextFile + SListFileFindClose + + SFileEnumLocales + + SFileCreateFile + SFileWriteFile + SFileFinishFile + SFileAddFileEx + SFileAddFile + SFileAddWave + SFileRemoveFile + SFileRenameFile + SFileSetFileLocale + SFileSetDataCompression + SFileSetAddFileCallback + + SCompImplode + SCompExplode + SCompCompress + SCompDecompress diff --git a/dep/StormLib/stormlib_dll/StormLib.exp b/dep/StormLib/stormlib_dll/StormLib.exp new file mode 100644 index 00000000000..aa2b71db1f1 --- /dev/null +++ b/dep/StormLib/stormlib_dll/StormLib.exp @@ -0,0 +1,76 @@ +# +# Export file for Mac OS X +# Copyright (c) 2009 Sam Wilkins +# swilkins1337@gmail.com +# + +_SFileGetGlobalFlags +_SFileSetGlobalFlags +_SFileSetLocale +_SFileGetLocale + +_SFileOpenArchive +_SFileCreateArchive +_SFileFlushArchive +_SFileCloseArchive + +_SFileAddListFile + +_SFileSetCompactCallback +_SFileCompactArchive + +_SFileGetMaxFileCount +_SFileSetMaxFileCount + +_SFileGetAttributes +_SFileSetAttributes +_SFileUpdateFileAttributes + +_SFileOpenPatchArchive +_SFileIsPatchedArchive + +_SFileOpenFileEx +_SFileGetFileSize +_SFileSetFilePointer +_SFileReadFile +_SFileCloseFile + +_SFileHasFile +_SFileGetFileName +_SFileGetFileInfo + +_SFileExtractFile + +_SFileVerifyFile +_SFileVerifyRawData +_SFileVerifyArchive + +_SFileFindFirstFile +_SFileFindNextFile +_SFileFindClose + +_SListFileFindFirstFile +_SListFileFindNextFile +_SListFileFindClose + +_SFileEnumLocales + +_SFileCreateFile +_SFileWriteFile +_SFileFinishFile +_SFileAddFileEx +_SFileAddFile +_SFileAddWave +_SFileRemoveFile +_SFileRenameFile +_SFileSetFileLocale +_SFileSetDataCompression +_SFileSetAddFileCallback + +_SCompImplode +_SCompExplode +_SCompCompress +_SCompDecompress + +_SetLastError +_GetLastError diff --git a/dep/StormLib/test/Test.cpp b/dep/StormLib/test/Test.cpp new file mode 100644 index 00000000000..c061b34936f --- /dev/null +++ b/dep/StormLib/test/Test.cpp @@ -0,0 +1,1804 @@ +/*****************************************************************************/ +/* StormLibTest.cpp Copyright (c) Ladislav Zezula 2003 */ +/*---------------------------------------------------------------------------*/ +/* Test module for StormLib */ +/*---------------------------------------------------------------------------*/ +/* Date Ver Who Comment */ +/* -------- ---- --- ------- */ +/* 25.03.03 1.00 Lad The first version of StormLibTest.cpp */ +/*****************************************************************************/ + +#define _CRT_SECURE_NO_DEPRECATE +#define __INCLUDE_CRYPTOGRAPHY__ +#define __STORMLIB_SELF__ // Don't use StormLib.lib +#include + +#ifdef _MSC_VER +#include +#endif + +#include "../src/StormLib.h" +#include "../src/StormCommon.h" + +#ifdef _MSC_VER +#pragma warning(disable: 4505) // 'XXX' : unreferenced local function has been removed +#endif + +//------------------------------------------------------------------------------ +// Defines + +#ifdef PLATFORM_WINDOWS +#define WORK_PATH_ROOT "E:\\Multimedia\\MPQs\\" +#endif + +#ifdef PLATFORM_LINUX +#define WORK_PATH_ROOT "/home/user/MPQs/" +#endif + +#ifdef PLATFORM_MAC +#define WORK_PATH_ROOT "/Users/sam/Downloads/" +#endif + +#ifndef LANG_CZECH +#define LANG_CZECH 0x0405 +#endif + +#define MPQ_SECTOR_SIZE 0x1000 + +#define MAKE_PATH(path) _T(WORK_PATH_ROOT) _T(path) + +// Unicode MPQ names +/* Czech */ static const wchar_t szUnicodeName1[] = {0x010C, 0x0065, 0x0073, 0x006B, 0x00FD, _T('.'), _T('m'), _T('p'), _T('q'), 0}; +/* Russian */ static const wchar_t szUnicodeName2[] = {0x0420, 0x0443, 0x0441, 0x0441, 0x043A, 0x0438, 0x0439, _T('.'), _T('m'), _T('p'), _T('q'), 0}; +/* Greece */ static const wchar_t szUnicodeName3[] = {0x03B5, 0x03BB, 0x03BB, 0x03B7, 0x03BD, 0x03B9, 0x03BA, 0x03AC, _T('.'), _T('m'), _T('p'), _T('q'), 0}; +/* Chinese */ static const wchar_t szUnicodeName4[] = {0x65E5, 0x672C, 0x8A9E, _T('.'), _T('m'), _T('p'), _T('q'), 0}; +/* Japanese */ static const wchar_t szUnicodeName5[] = {0x7B80, 0x4F53, 0x4E2D, 0x6587, _T('.'), _T('m'), _T('p'), _T('q'), 0}; +/* Arabic */ static const wchar_t szUnicodeName6[] = {0x0627, 0x0644, 0x0639, 0x0639, 0x0631, 0x0628, 0x064A, 0x0629, _T('.'), _T('m'), _T('p'), _T('q'), 0}; + +//----------------------------------------------------------------------------- +// Constants + +static const TCHAR * szWorkDir = MAKE_PATH("Work"); + +static unsigned int AddFlags[] = +{ +// Compression Encryption Fixed key Single Unit Sector CRC + 0 | 0 | 0 | 0 | 0, + 0 | MPQ_FILE_ENCRYPTED | 0 | 0 | 0, + 0 | MPQ_FILE_ENCRYPTED | MPQ_FILE_FIX_KEY | 0 | 0, + 0 | 0 | 0 | MPQ_FILE_SINGLE_UNIT | 0, + 0 | MPQ_FILE_ENCRYPTED | 0 | MPQ_FILE_SINGLE_UNIT | 0, + 0 | MPQ_FILE_ENCRYPTED | MPQ_FILE_FIX_KEY | MPQ_FILE_SINGLE_UNIT | 0, + MPQ_FILE_IMPLODE | 0 | 0 | 0 | 0, + MPQ_FILE_IMPLODE | MPQ_FILE_ENCRYPTED | 0 | 0 | 0, + MPQ_FILE_IMPLODE | MPQ_FILE_ENCRYPTED | MPQ_FILE_FIX_KEY | 0 | 0, + MPQ_FILE_IMPLODE | 0 | 0 | MPQ_FILE_SINGLE_UNIT | 0, + MPQ_FILE_IMPLODE | MPQ_FILE_ENCRYPTED | 0 | MPQ_FILE_SINGLE_UNIT | 0, + MPQ_FILE_IMPLODE | MPQ_FILE_ENCRYPTED | MPQ_FILE_FIX_KEY | MPQ_FILE_SINGLE_UNIT | 0, + MPQ_FILE_IMPLODE | 0 | 0 | 0 | MPQ_FILE_SECTOR_CRC, + MPQ_FILE_IMPLODE | MPQ_FILE_ENCRYPTED | 0 | 0 | MPQ_FILE_SECTOR_CRC, + MPQ_FILE_IMPLODE | MPQ_FILE_ENCRYPTED | MPQ_FILE_FIX_KEY | 0 | MPQ_FILE_SECTOR_CRC, + MPQ_FILE_COMPRESS | 0 | 0 | 0 | 0, + MPQ_FILE_COMPRESS | MPQ_FILE_ENCRYPTED | 0 | 0 | 0, + MPQ_FILE_COMPRESS | MPQ_FILE_ENCRYPTED | MPQ_FILE_FIX_KEY | 0 | 0, + MPQ_FILE_COMPRESS | 0 | 0 | MPQ_FILE_SINGLE_UNIT | 0, + MPQ_FILE_COMPRESS | MPQ_FILE_ENCRYPTED | 0 | MPQ_FILE_SINGLE_UNIT | 0, + MPQ_FILE_COMPRESS | MPQ_FILE_ENCRYPTED | MPQ_FILE_FIX_KEY | MPQ_FILE_SINGLE_UNIT | 0, + MPQ_FILE_COMPRESS | 0 | 0 | 0 | MPQ_FILE_SECTOR_CRC, + MPQ_FILE_COMPRESS | MPQ_FILE_ENCRYPTED | 0 | 0 | MPQ_FILE_SECTOR_CRC, + MPQ_FILE_COMPRESS | MPQ_FILE_ENCRYPTED | MPQ_FILE_FIX_KEY | 0 | MPQ_FILE_SECTOR_CRC, + 0xFFFFFFFF +}; + +//----------------------------------------------------------------------------- +// Local testing functions + +static void clreol() +{ +#ifdef PLATFORM_WINDOWS + CONSOLE_SCREEN_BUFFER_INFO ScreenInfo; + HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE); + LPTSTR szConsoleLine; + int nConsoleChars; + int i = 0; + + GetConsoleScreenBufferInfo(hConsole, &ScreenInfo); + nConsoleChars = (ScreenInfo.srWindow.Right - ScreenInfo.srWindow.Left); + if(nConsoleChars > 0) + { + szConsoleLine = new TCHAR[nConsoleChars + 3]; + if(szConsoleLine != NULL) + { + szConsoleLine[i++] = '\r'; + for(; i < nConsoleChars; i++) + szConsoleLine[i] = ' '; + szConsoleLine[i++] = '\r'; + szConsoleLine[i] = 0; + + _tprintf(szConsoleLine); + delete [] szConsoleLine; + } + } +#endif // PLATFORM_WINDOWS +} + +static void PrintfTA(const TCHAR * szFormat, const TCHAR * szStrT, const char * szStrA, int lcLocale = 0) +{ + TCHAR * szTemp; + TCHAR szBuffer[MAX_PATH]; + + // Convert ANSI string to TCHAR + for(szTemp = szBuffer; *szStrA != 0; szTemp++, szStrA++) + szTemp[0] = szStrA[0]; + szTemp[0] = 0; + + _tprintf(szFormat, szStrT, szBuffer, lcLocale); +} + +static void MergeLocalPath(TCHAR * szBuffer, const TCHAR * szPart1, const char * szPart2) +{ + // Copy directory name + while(*szPart1 != 0) + *szBuffer++ = *szPart1++; + + // Add separator + *szBuffer++ = _T('/'); + + // Copy file name + while(*szPart2 != 0) + *szBuffer++ = *szPart2++; + + // Terminate the string + *szBuffer = 0; +} + +int GetFirstDiffer(void * ptr1, void * ptr2, int nSize) +{ + char * buff1 = (char *)ptr1; + char * buff2 = (char *)ptr2; + int nDiffer; + + for(nDiffer = 0; nDiffer < nSize; nDiffer++) + { + if(*buff1++ != *buff2++) + return nDiffer; + } + return -1; +} + +static void WINAPI CompactCB(void * /* lpParam */, DWORD dwWork, ULONGLONG BytesDone, ULONGLONG TotalBytes) +{ + clreol(); + + _tprintf(_T("%u of %u "), (DWORD)BytesDone, (DWORD)TotalBytes); + switch(dwWork) + { + case CCB_CHECKING_FILES: + _tprintf(_T("Checking files in archive ...\r")); + break; + + case CCB_CHECKING_HASH_TABLE: + _tprintf(_T("Checking hash table ...\r")); + break; + + case CCB_COPYING_NON_MPQ_DATA: + _tprintf(_T("Copying non-MPQ data ...\r")); + break; + + case CCB_COMPACTING_FILES: + _tprintf(_T("Compacting archive ...\r")); + break; + + case CCB_CLOSING_ARCHIVE: + _tprintf(_T("Closing archive ...\r")); + break; + } +} + +static void GenerateRandomDataBlock(LPBYTE pbBuffer, DWORD cbBuffer) +{ + LPBYTE pbBufferEnd = pbBuffer + cbBuffer; + LPBYTE pbPtr = pbBuffer; + DWORD cbBytesToPut = 0; + BYTE ByteToPut = 0; + bool bRandomData = false; + + while(pbPtr < pbBufferEnd) + { + // If there are no bytes to put, we will generate new byte and length + if(cbBytesToPut == 0) + { + bRandomData = false; + switch(rand() % 10) + { + case 0: // A short sequence of zeros + cbBytesToPut = rand() % 0x08; + ByteToPut = 0; + break; + + case 1: // A long sequence of zeros + cbBytesToPut = rand() % 0x80; + ByteToPut = 0; + break; + + case 2: // A short sequence of non-zeros + cbBytesToPut = rand() % 0x08; + ByteToPut = (BYTE)(rand() % 0x100); + break; + + case 3: // A long sequence of non-zeros + cbBytesToPut = rand() % 0x80; + ByteToPut = (BYTE)(rand() % 0x100); + break; + + case 4: // A short random data + cbBytesToPut = rand() % 0x08; + bRandomData = true; + break; + + case 5: // A long random data + cbBytesToPut = rand() % 0x80; + bRandomData = true; + break; + + default: // A single random byte + cbBytesToPut = 1; + ByteToPut = (BYTE)(rand() % 0x100); + break; + } + } + + // Generate random byte, if needed + if(bRandomData) + ByteToPut = (BYTE)(rand() % 0x100); + + // Put next byte to the output buffer + *pbPtr++ = ByteToPut; + cbBytesToPut--; + } +} + +static bool CompareArchivedFiles(const char * szFileName, HANDLE hFile1, HANDLE hFile2, DWORD dwBlockSize) +{ + LPBYTE pbBuffer1 = NULL; + LPBYTE pbBuffer2 = NULL; + DWORD dwRead1; // Number of bytes read (Storm.dll) + DWORD dwRead2; // Number of bytes read (StormLib) + bool bResult1 = false; // Result from Storm.dll + bool bResult2 = false; // Result from StormLib + bool bResult = true; + int nDiff; + + szFileName = szFileName; + + // Allocate buffers + pbBuffer1 = new BYTE[dwBlockSize]; + pbBuffer2 = new BYTE[dwBlockSize]; + + for(;;) + { + // Read the file's content by both methods and compare the result + memset(pbBuffer1, 0, dwBlockSize); + memset(pbBuffer2, 0, dwBlockSize); + bResult1 = SFileReadFile(hFile1, pbBuffer1, dwBlockSize, &dwRead1, NULL); + bResult2 = SFileReadFile(hFile2, pbBuffer2, dwBlockSize, &dwRead2, NULL); + if(bResult1 != bResult2) + { + _tprintf(_T("Different results from SFileReadFile, Mpq1 %u, Mpq2 %u\n"), bResult1, bResult2); + bResult = false; + break; + } + + // Test the number of bytes read + if(dwRead1 != dwRead2) + { + _tprintf(_T("Different bytes read from SFileReadFile, Mpq1 %u, Mpq2 %u\n"), dwRead1, dwRead2); + bResult = false; + break; + } + + // No more bytes ==> OK + if(dwRead1 == 0) + break; + + // Test the content + if((nDiff = GetFirstDiffer(pbBuffer1, pbBuffer2, dwRead1)) != -1) + { + bResult = false; + break; + } + } + + delete [] pbBuffer2; + delete [] pbBuffer1; + return bResult; +} + +// Random read version +static bool CompareArchivedFilesRR(const char * /* szFileName */, HANDLE hFile1, HANDLE hFile2, DWORD dwBlockSize) +{ + const char * szPositions[3] = {"FILE_BEGIN ", "FILE_CURRENT", "FILE_END "}; + LPBYTE pbBuffer1 = NULL; + LPBYTE pbBuffer2 = NULL; + DWORD dwFileSize1; // File size (Storm.dll) + DWORD dwFileSize2; // File size (StormLib) + DWORD dwRead1; // Number of bytes read (Storm.dll) + DWORD dwRead2; // Number of bytes read (StormLib) + bool bResult1 = false; // Result from Storm.dll + bool bResult2 = false; // Result from StormLib + int nError = ERROR_SUCCESS; + + // Test the file size + dwFileSize1 = SFileGetFileSize(hFile1, NULL); + dwFileSize2 = SFileGetFileSize(hFile2, NULL); + if(dwFileSize1 != dwFileSize2) + { + _tprintf(_T("Different size from SFileGetFileSize (file1: %u, file2: %u)\n"), dwFileSize1, dwFileSize2); + return false; + } + + if(dwFileSize1 != 0) + { + for(int i = 0; i < 10000; i++) + { + DWORD dwRandom = rand() * rand(); + DWORD dwMoveMethod = dwRandom % 3; + DWORD dwPosition = dwRandom % dwFileSize1; + DWORD dwToRead = dwRandom % dwBlockSize; + + // Also test negative seek + if(rand() & 1) + { + int nPosition = (int)dwPosition; + dwPosition = (DWORD)(-nPosition); + } + + // Allocate buffers + pbBuffer1 = new BYTE[dwToRead]; + pbBuffer2 = new BYTE[dwToRead]; + + // Set the file pointer + _tprintf(_T("RndRead (%u): pos %8i from %s, size %u ...\r"), i, dwPosition, szPositions[dwMoveMethod], dwToRead); + dwRead1 = SFileSetFilePointer(hFile1, dwPosition, NULL, dwMoveMethod); + dwRead2 = SFileSetFilePointer(hFile2, dwPosition, NULL, dwMoveMethod); + if(dwRead1 != dwRead2) + { + _tprintf(_T("Difference returned by SFileSetFilePointer (file1: %u, file2: %u)\n"), dwRead1, dwRead2); + nError = ERROR_CAN_NOT_COMPLETE; + break; + } + + // Read the file's content by both methods and compare the result + bResult1 = SFileReadFile(hFile1, pbBuffer1, dwToRead, &dwRead1, NULL); + bResult2 = SFileReadFile(hFile2, pbBuffer2, dwToRead, &dwRead2, NULL); + if(bResult1 != bResult2) + { + _tprintf(_T("Different results from SFileReadFile (file1: %u, file2: %u)\n\n"), bResult1, bResult2); + nError = ERROR_CAN_NOT_COMPLETE; + break; + } + + // Test the number of bytes read + if(dwRead1 != dwRead2) + { + _tprintf(_T("Different bytes read from SFileReadFile (file1: %u, file2: %u)\n\n"), dwRead1, dwRead2); + nError = ERROR_CAN_NOT_COMPLETE; + break; + } + + // Test the content + if(dwRead1 != 0 && memcmp(pbBuffer1, pbBuffer2, dwRead1)) + { + _tprintf(_T("Different data content from SFileReadFile\n")); + nError = ERROR_CAN_NOT_COMPLETE; + break; + } + + delete [] pbBuffer2; + delete [] pbBuffer1; + } + } + clreol(); + return (nError == ERROR_SUCCESS) ? true : false; +} + +//----------------------------------------------------------------------------- +// Opening local file + +static int TestOpenLocalFile(const char * szFileName) +{ + HANDLE hFile; + char szRetrievedName[MAX_PATH]; + + if(SFileOpenFileEx(NULL, szFileName, SFILE_OPEN_LOCAL_FILE, &hFile)) + { + SFileGetFileName(hFile, szRetrievedName); + SFileCloseFile(hFile); + } + + return ERROR_SUCCESS; +} + +//----------------------------------------------------------------------------- +// Partial file reading + +static int TestPartFileRead(const TCHAR * szFileName) +{ + ULONGLONG ByteOffset; + ULONGLONG FileSize = 0; + TFileStream * pStream; + BYTE BigBuffer[0x7000]; + BYTE Buffer[0x100]; + int nError = ERROR_SUCCESS; + + // Open the partial file + pStream = FileStream_OpenFile(szFileName, false); + if(pStream == NULL) + nError = GetLastError(); + + // Get the size of the stream + if(nError == ERROR_SUCCESS) + { + if(!FileStream_GetSize(pStream, FileSize)) + nError = GetLastError(); + } + + // Read the last 0x7000 bytes + if(nError == ERROR_SUCCESS) + { + ByteOffset = FileSize - sizeof(BigBuffer); + if(!FileStream_Read(pStream, &ByteOffset, BigBuffer, sizeof(BigBuffer))) + nError = GetLastError(); + } + + // Read the last 0x100 bytes + if(nError == ERROR_SUCCESS) + { + ByteOffset = FileSize - sizeof(Buffer); + if(!FileStream_Read(pStream, &ByteOffset, Buffer, sizeof(Buffer))) + nError = GetLastError(); + } + + // Read 0x100 bytes from position (FileSize - 0xFF) + if(nError == ERROR_SUCCESS) + { + ByteOffset = FileSize - sizeof(Buffer) + 1; + if(!FileStream_Read(pStream, &ByteOffset, Buffer, sizeof(Buffer))) + nError = GetLastError(); + } + + FileStream_Close(pStream); + return nError; +} + +//----------------------------------------------------------------------------- +// Compare LZMA decompression + +#ifdef PLATFORM_WINDOWS +typedef void * (*ALLOC_MEMORY)(size_t); +typedef void (*FREE_MEMORY)(void *); +typedef int (GIVE_DATA)(void *); + +extern "C" int starcraft_decompress_lzma(char * pbInBuffer, int cbInBuffer, char * pbOutBuffer, int cbOutBuffer, int * pcbOutBuffer, ALLOC_MEMORY pfnAllocMemory, FREE_MEMORY pfnFreeMemory); +extern "C" int starcraft_compress_lzma(char * pbInBuffer, int cbInBuffer, int dummy1, char * pbOutBuffer, int cbOutBuffer, int dummy2, int * pcbOutBuffer, ALLOC_MEMORY pfnAllocMemory, FREE_MEMORY pfnFreeMemory, GIVE_DATA pfnGiveData); +void Compress_LZMA(char * pbOutBuffer, int * pcbOutBuffer, char * pbInBuffer, int cbInBuffer, int *, int); +int Decompress_LZMA(char * pbOutBuffer, int * pcbOutBuffer, char * pbInBuffer, int cbInBuffer); + +extern "C" void * operator_new(size_t sz) +{ + return malloc(sz); +} + +void * Memory_Allocate(size_t byte_size) +{ + return malloc(byte_size); +} + +void Memory_Free(void * address) +{ + if(address != NULL) + free(address); +} + +int GiveData(void *) +{ + return 0; +} + +static int StarcraftCompress_LZMA(char * pbOutBuffer, int * pcbOutBuffer, char * pbInBuffer, int cbInBuffer) +{ + return starcraft_compress_lzma(pbInBuffer, + cbInBuffer, + 0, + pbOutBuffer, + *pcbOutBuffer, + 0, + pcbOutBuffer, + Memory_Allocate, + Memory_Free, + GiveData); +} + +static int StarcraftDecompress_LZMA(char * pbOutBuffer, int * pcbOutBuffer, char * pbInBuffer, int cbInBuffer) +{ + return starcraft_decompress_lzma(pbInBuffer, + cbInBuffer, + pbOutBuffer, + *pcbOutBuffer, + pcbOutBuffer, + Memory_Allocate, + Memory_Free); +} + +static int CompareLzmaCompressions(int nSectorSize) +{ + LPBYTE pbCompressed1 = NULL; // Compressed by our code + LPBYTE pbCompressed2 = NULL; // Compressed by Blizzard's code + LPBYTE pbDecompressed1 = NULL; // Decompressed by our code + LPBYTE pbDecompressed2 = NULL; // Decompressed by Blizzard's code + LPBYTE pbOriginalData = NULL; + int nError = ERROR_SUCCESS; + + // Allocate buffers + // Must allocate twice blocks due to probable bug in Storm.dll. + // Storm.dll corrupts stack when uncompresses data with PKWARE DCL + // and no compression occurs. + pbDecompressed1 = new BYTE [nSectorSize]; + pbDecompressed2 = new BYTE [nSectorSize]; + pbCompressed1 = new BYTE [nSectorSize]; + pbCompressed2 = new BYTE [nSectorSize]; + pbOriginalData = new BYTE[nSectorSize]; + if(!pbDecompressed1 || !pbDecompressed2 || !pbCompressed1 || !pbCompressed2 || !pbOriginalData) + nError = ERROR_NOT_ENOUGH_MEMORY; + + if(nError == ERROR_SUCCESS) + { + for(int i = 0; i < 100000; i++) + { + int nDcmpLength1; + int nDcmpLength2; + int nCmpLength1; + int nCmpLength2; + int nDiff; + + clreol(); + _tprintf(_T("Testing compression of sector %u\r"), i + 1); + + // Generate random data sector + GenerateRandomDataBlock(pbOriginalData, nSectorSize); + + // Compress the sector by both methods + nCmpLength1 = nCmpLength2 = nSectorSize; +// Compress_LZMA((char *)pbCompressed1, &nCmpLength1, (char *)pbOriginalData, nSectorSize, 0, 0); + StarcraftCompress_LZMA((char *)pbCompressed1, &nCmpLength2, (char *)pbOriginalData, nSectorSize); + +__TryToDecompress: + + // Only test decompression when the compression actually succeeded + if(nCmpLength1 < nSectorSize) + { + // Decompress both data + nDcmpLength2 = nDcmpLength1 = nSectorSize; +// Decompress_LZMA((char *)pbDecompressed1, &nDcmpLength1, (char *)pbCompressed1, nCmpLength1); + StarcraftDecompress_LZMA((char *)pbDecompressed2, &nDcmpLength2, (char *)pbCompressed1, nCmpLength1); + + // Compare the length of the output data + if(nDcmpLength1 != nDcmpLength2) + { + _tprintf(_T("Difference in compressed blocks lengths (%u vs %u)\n"), nDcmpLength1, nDcmpLength2); + goto __TryToDecompress; + } + + // Compare the output + if((nDiff = GetFirstDiffer(pbDecompressed1, pbDecompressed2, nDcmpLength1)) != -1) + { + _tprintf(_T("Difference in decompressed blocks (offset 0x%08X)\n"), nDiff); + goto __TryToDecompress; + } + + // Check for data overflow + if(pbDecompressed1[nSectorSize] != 0xFD || pbDecompressed1[nSectorSize] != 0xFD) + { + _tprintf(_T("Damage after decompressed sector !!!\n")); + goto __TryToDecompress; + } + + // Compare the decompressed data against original data + if((nDiff = GetFirstDiffer(pbDecompressed1, pbOriginalData, nDcmpLength1)) != -1) + { + _tprintf(_T("Difference between original data and decompressed data (offset 0x%08X)\n"), nDiff); + goto __TryToDecompress; + } + } + } + } + + // Cleanup + if(pbOriginalData != NULL) + delete [] pbOriginalData; + if(pbCompressed2 != NULL) + delete [] pbCompressed2; + if(pbCompressed1 != NULL) + delete [] pbCompressed1; + if(pbDecompressed2 != NULL) + delete [] pbDecompressed2; + if(pbDecompressed1 != NULL) + delete [] pbDecompressed1; + clreol(); + return nError; +} +#endif // PLATFORM_WINDOWS + +//----------------------------------------------------------------------------- +// Compression method test + +static int TestSectorCompress(int nSectorSize) +{ + LPBYTE pbDecompressed = NULL; + LPBYTE pbCompressed = NULL; + LPBYTE pbOriginal = NULL; + int nError = ERROR_SUCCESS; + + // Allocate buffers + pbDecompressed = new BYTE[nSectorSize]; + pbCompressed = new BYTE[nSectorSize]; + pbOriginal = new BYTE[nSectorSize]; + if(!pbDecompressed || !pbCompressed || !pbOriginal) + nError = ERROR_NOT_ENOUGH_MEMORY; + + if(nError == ERROR_SUCCESS) + { + for(int i = 0; i < 100000; i++) + { + int nOriginalLength = nSectorSize % (rand() + 1); + int nCompressedLength; + int nDecompressedLength; + int nCmp = MPQ_COMPRESSION_SPARSE | MPQ_COMPRESSION_ZLIB | MPQ_COMPRESSION_BZIP2 | MPQ_COMPRESSION_PKWARE; + int nDiff; + + clreol(); + _tprintf(_T("Testing compression of sector %u\r"), i + 1); + + // Generate random data sector + GenerateRandomDataBlock(pbOriginal, nOriginalLength); + if(nOriginalLength == 0x123) + nOriginalLength = 0; + +__TryAgain: + + // Compress the sector + nCompressedLength = nOriginalLength; + SCompCompress((char *)pbCompressed, &nCompressedLength, (char *)pbOriginal, nOriginalLength, nCmp, 0, -1); +// SCompImplode((char *)pbCompressed, &nCompressedLength, (char *)pbOriginal, nOriginalLength); + + // When the method was unable to compress data, + // the compressed data must be identical to original data + if(nCompressedLength == nOriginalLength) + { + if((nDiff = GetFirstDiffer(pbCompressed, pbOriginal, nOriginalLength)) != -1) + { + _tprintf(_T("Compression error: Fail when unable to compress the data (Offset 0x%08X).\n"), nDiff); + goto __TryAgain; + } + } + + // Uncompress the sector + nDecompressedLength = nOriginalLength; + SCompDecompress((char *)pbDecompressed, &nDecompressedLength, (char *)pbCompressed, nCompressedLength); +// SCompExplode((char *)pbDecompressed, &nDecompressedLength, (char *)pbCompressed, nCompressedLength); + + // Check the decompressed length against original length + if(nDecompressedLength != nOriginalLength) + { + _tprintf(_T("Length of uncompressed data does not agree with original data length !!!\n")); + goto __TryAgain; + } + + // Check decompressed block against original block + if((nDiff = GetFirstDiffer(pbDecompressed, pbOriginal, nOriginalLength)) != -1) + { + _tprintf(_T("Decompressed sector does not agree with the original data !!! (Offset 0x%08X)\n"), nDiff); + goto __TryAgain; + } + } + } + + // Cleanup + delete [] pbOriginal; + delete [] pbCompressed; + delete [] pbDecompressed; + clreol(); + return nError; +} + +static int TestArchiveOpenAndClose(const TCHAR * szMpqName) +{ + const char * szFileName1 = "world\\maps\\AhnQiraj\\AhnQiraj_27_51_tex1.adt"; +// const char * szFileName2 = "items\\map\\mapz_deleted.cel"; + TMPQArchive * ha = NULL; + HANDLE hFile1 = NULL; +// HANDLE hFile2 = NULL; + HANDLE hMpq = NULL; + int nError = ERROR_SUCCESS; + + if(nError == ERROR_SUCCESS) + { + _tprintf(_T("Opening archive %s ...\n"), szMpqName); + if(!SFileOpenArchive(szMpqName, 0, 0, /* MPQ_OPEN_ENCRYPTED,*/ &hMpq)) + nError = GetLastError(); + ha = (TMPQArchive *)hMpq; + } +/* + // Test for TBitArray + if(nError == ERROR_SUCCESS && ha->pHetTable != NULL) + { + TBitArray * pBitArray = ha->pHetTable->pBetIndexes; + + for(ULONG i = 0; i < 0x10000; i++) + { + BYTE LoadedBits[0x20]; + BYTE SaveBits[0x40]; + unsigned int nBitPosition = (i >> 0x08); + unsigned int nBitCount = (i & 0xFF); + + memset(LoadedBits, 0, sizeof(LoadedBits)); + memcpy(SaveBits, pBitArray->Elements, sizeof(SaveBits)); + + // Load the index to the BET table + pBitArray->GetBits(nBitPosition, nBitCount, LoadedBits, sizeof(LoadedBits)); + + // Load the index to the BET table + pBitArray->SetBits(nBitPosition, nBitCount, LoadedBits, sizeof(LoadedBits)); + + // Verify the bits + if(memcmp(SaveBits, pBitArray->Elements, sizeof(SaveBits))) + assert(false); + } + } +*/ + // Verify the raw data in the archive + if(nError == ERROR_SUCCESS) + { + // Verify the archive + SFileVerifyRawData(hMpq, SFILE_VERIFY_FILE, szFileName1); + + // Try to open a file + if(!SFileOpenFileEx(hMpq, szFileName1, SFILE_OPEN_FROM_MPQ, &hFile1)) + { + nError = GetLastError(); + printf("%s - file not found in the MPQ\n", szFileName1); + } + } + + // Dummy read from the file + if(nError == ERROR_SUCCESS) + { + DWORD dwBytesRead = 0; + BYTE Buffer[0x1000]; + + SFileSetFileLocale(hFile1, 0x405); + SFileReadFile(hFile1, Buffer, sizeof(Buffer), &dwBytesRead); + } +/* + // Verify the MPQ listfile + if(nError == ERROR_SUCCESS) + { + SFileVerifyFile(hMpq, szFileName1, 0xFFFFFFFF); + if(!CompareArchivedFilesRR(szFileName1, hFile1, hFile2, 0x100000)) + nError = ERROR_CAN_NOT_COMPLETE; + } +*/ + if(hFile1 != NULL) + SFileCloseFile(hFile1); + if(hMpq != NULL) + SFileCloseArchive(hMpq); + return nError; +} + +static int TestFindFiles(const TCHAR * szMpqName) +{ + TMPQFile * hf; + HANDLE hFile; + HANDLE hMpq = NULL; + BYTE Buffer[100]; + int nError = ERROR_SUCCESS; + int nFiles = 0; + int nFound = 0; + + // Open the archive + if(nError == ERROR_SUCCESS) + { + _tprintf(_T("Opening \"%s\" for finding files ...\n"), szMpqName); + if(!SFileOpenArchive(szMpqName, 0, 0, &hMpq)) + nError = GetLastError(); + } + + // Compact the archive + if(nError == ERROR_SUCCESS) + { + SFILE_FIND_DATA sf; + HANDLE hFind; + DWORD dwExtraDataSize; + bool bFound = true; + + hFind = SFileFindFirstFile(hMpq, "*", &sf, "c:\\Tools32\\ListFiles\\ListFile.txt"); + while(hFind != NULL && bFound != false) + { + if(SFileOpenFileEx(hMpq, sf.cFileName, 0, &hFile)) + { + hf = (TMPQFile *)hFile; + SFileReadFile(hFile, Buffer, sizeof(Buffer)); + nFiles++; + + if(sf.dwFileFlags & MPQ_FILE_SECTOR_CRC) + { + dwExtraDataSize = hf->SectorOffsets[hf->dwSectorCount + 1] - hf->SectorOffsets[hf->dwSectorCount]; + if(dwExtraDataSize != 0) + nFound++; + } + + SFileCloseFile(hFile); + } + + bFound = SFileFindNextFile(hFind, &sf); + } + } + + if(hMpq != NULL) + SFileCloseArchive(hMpq); + if(nError == ERROR_SUCCESS) + _tprintf(_T("Search complete\n")); + return nError; +} + +static int TestMpqCompacting(const TCHAR * szMpqName) +{ + HANDLE hMpq = NULL; + int nError = ERROR_SUCCESS; + + // Open the archive + if(nError == ERROR_SUCCESS) + { + _tprintf(_T("Opening \"%s\" for compacting ...\n"), szMpqName); + if(!SFileOpenArchive(szMpqName, 0, 0, &hMpq)) + nError = GetLastError(); + } + + if(nError == ERROR_SUCCESS) + { + char * szFileName = "Shaders\\Effects\\shadowmap.wfx"; + + printf("Deleting file %s ...\r", szFileName); + if(!SFileRemoveFile(hMpq, szFileName)) + nError = GetLastError(); + } +/* + // Compact the archive + if(nError == ERROR_SUCCESS) + { + _tprintf(_T("Compacting archive ...\r")); + SFileSetCompactCallback(hMpq, CompactCB, NULL); + if(!SFileCompactArchive(hMpq, "c:\\Tools32\\ListFiles\\ListFile.txt")) + nError = GetLastError(); + } +*/ + if(hMpq != NULL) + SFileCloseArchive(hMpq); + if(nError == ERROR_SUCCESS) + _tprintf(_T("Compacting complete (No errors)\n")); + return nError; +} + +static int TestCreateArchive(const TCHAR * szMpqName) +{ + TFileStream * pStream; + const TCHAR * szFileName1 = MAKE_PATH("FileTest.exe"); + const TCHAR * szFileName2 = MAKE_PATH("ZeroSize.txt"); + HANDLE hMpq = NULL; // Handle of created archive + DWORD dwVerifyResult; + DWORD dwFileCount = 0; + LCID LocaleIDs[] = {0x000, 0x405, 0x406, 0x407, 0xFFFF}; + char szMpqFileName[MAX_PATH]; + int nError = ERROR_SUCCESS; + int i; + + // Create the new file + _tprintf(_T("Creating %s ...\n"), szMpqName); + pStream = FileStream_CreateFile(szMpqName); + if(pStream == NULL) + nError = GetLastError(); + + // Write some data + if(nError == ERROR_SUCCESS) + { + ULONGLONG FileSize = 0x100000; + + FileStream_SetSize(pStream, FileSize); + FileStream_Close(pStream); + } + + // Well, now create the MPQ archive + if(nError == ERROR_SUCCESS) + { + if(!SFileCreateArchive(szMpqName, + MPQ_CREATE_ARCHIVE_V4 | MPQ_CREATE_ATTRIBUTES, + 17, + &hMpq)) + { + nError = GetLastError(); + } + } + + // Add the same file multiple times + if(nError == ERROR_SUCCESS) + { + // Add FileTest.exe + for(i = 0; AddFlags[i] != 0xFFFFFFFF; i++) + { + sprintf(szMpqFileName, "FileTest_%02u.exe", i); + PrintfTA(_T("Adding %s as %s ...\n"), szFileName1, szMpqFileName); + if(SFileAddFileEx(hMpq, szFileName1, szMpqFileName, AddFlags[i], MPQ_COMPRESSION_ZLIB)) + { + dwVerifyResult = SFileVerifyFile(hMpq, szMpqFileName, MPQ_ATTRIBUTE_CRC32 | MPQ_ATTRIBUTE_MD5); + if(dwVerifyResult & (VERIFY_OPEN_ERROR | VERIFY_READ_ERROR | VERIFY_FILE_SECTOR_CRC_ERROR | VERIFY_FILE_CHECKSUM_ERROR | VERIFY_FILE_MD5_ERROR)) + printf("CRC error on \"%s\"\n", szMpqFileName); + dwFileCount++; + } + else + { + printf("Failed to add the file \"%s\".\n", szMpqFileName); + } + } + + + // Delete a file in the middle of the file table + SFileRemoveFile(hMpq, "FileTest_10.exe"); + SFileAddFileEx(hMpq, szFileName1, "FileTest_xx.exe", MPQ_FILE_COMPRESS | MPQ_FILE_ENCRYPTED, MPQ_COMPRESSION_ZLIB); + + // Try to decrement max file count + dwFileCount = SFileGetMaxFileCount(hMpq); + SFileSetMaxFileCount(hMpq, dwFileCount - 1); + + // Add ZeroSize.txt (1) + sprintf(szMpqFileName, "ZeroSize_1.txt"); + for(i = 0; LocaleIDs[i] != 0xFFFF; i++) + { + PrintfTA(_T("Adding %s as %s (locale %04x) ...\n"), szFileName2, szMpqFileName, LocaleIDs[i]); + SFileSetLocale(LocaleIDs[i]); + if(!SFileAddFileEx(hMpq, szFileName2, szMpqFileName, MPQ_FILE_COMPRESS | MPQ_FILE_ENCRYPTED, MPQ_COMPRESSION_ZLIB)) + printf("Cannot add the file\n"); + } + + // Add ZeroSize.txt (1) + sprintf(szMpqFileName, "ZeroSize_2.txt"); + for(int i = 0; LocaleIDs[i] != 0xFFFF; i++) + { + PrintfTA(_T("Adding %s as %s (locale %04x) ...\n"), szFileName2, szMpqFileName, LocaleIDs[i]); + SFileSetLocale(LocaleIDs[i]); + if(!SFileAddFileEx(hMpq, szFileName2, szMpqFileName, MPQ_FILE_COMPRESS | MPQ_FILE_ENCRYPTED, MPQ_COMPRESSION_ZLIB)) + printf("Cannot add the file\n"); + } + } + + // Test rename function + if(nError == ERROR_SUCCESS) + { + _tprintf(_T("Testing rename files ...\n")); + SFileSetLocale(LANG_NEUTRAL); + if(!SFileRenameFile(hMpq, "FileTest_08.exe", "FileTest_08a.exe")) + { + nError = GetLastError(); + _tprintf(_T("Failed to rename the file\n")); + } + + if(!SFileRenameFile(hMpq, "FileTest_08a.exe", "FileTest_08.exe")) + { + nError = GetLastError(); + _tprintf(_T("Failed to rename the file\n")); + } + + if(!SFileRenameFile(hMpq, "FileTest_10.exe", "FileTest_10a.exe")) + { + nError = GetLastError(); + _tprintf(_T("Failed to rename the file\n")); + } + + if(!SFileRenameFile(hMpq, "FileTest_10a.exe", "FileTest_10.exe")) + { + nError = GetLastError(); + _tprintf(_T("Failed to rename the file\n")); + } + + if(nError == ERROR_SUCCESS) + _tprintf(_T("Rename test succeeded.\n\n")); + else + _tprintf(_T("Rename test failed.\n\n")); + } + + // Compact the archive +// if(nError == ERROR_SUCCESS) +// SFileCompactArchive(hMpq); + + // Test changing hash table size + if(nError == ERROR_SUCCESS) + SFileSetMaxFileCount(hMpq, 0x95); + + if(hMpq != NULL) + SFileCloseArchive(hMpq); + + // Try to reopen the archive + if(SFileOpenArchive(szMpqName, 0, 0, &hMpq)) + SFileCloseArchive(hMpq); + + _tprintf(_T("\n")); + return nError; +} + +static int TestCreateArchive_PaliRoharBug(const TCHAR * szMpqName) +{ + const TCHAR * szFileName = MAKE_PATH("FileTest.exe"); + HANDLE hMpq = NULL; // Handle of created archive + DWORD dwMaxFileCount = 0; + DWORD dwMpqFlags = MPQ_FILE_ENCRYPTED | MPQ_FILE_COMPRESS; + char szMpqFileName[MAX_PATH]; + int nError = ERROR_SUCCESS; + int i; + + _tremove(szMpqName); + if(SFileCreateArchive(szMpqName, + MPQ_CREATE_ARCHIVE_V4 | MPQ_CREATE_ATTRIBUTES, + 1, + &hMpq)) + { + // Add the file there + SFileAddFileEx(hMpq, szFileName, "FileTest_base.exe", dwMpqFlags, MPQ_COMPRESSION_ZLIB); + SFileFlushArchive(hMpq); + SFileCloseArchive(hMpq); + + // Add the same file 10 times + for(i = 0; i < 10; i++) + { + if(SFileOpenArchive(szMpqName, 0, 0, &hMpq)) + { + dwMaxFileCount = SFileGetMaxFileCount(hMpq) + 1; + _tprintf(_T("Increasing max file count to %u ...\n"), dwMaxFileCount); + SFileSetMaxFileCount(hMpq, dwMaxFileCount); + + sprintf(szMpqFileName, "FileTest_%02u.exe", dwMaxFileCount); + PrintfTA(_T("Adding %s as %s\n"), szFileName, szMpqFileName); + if(!SFileAddFileEx(hMpq, szFileName, szMpqFileName, dwMpqFlags, MPQ_COMPRESSION_ZLIB)) + { + printf("Failed to add the file \"%s\".\n", szMpqFileName); + break; + } + + SFileFlushArchive(hMpq); + SFileCompactArchive(hMpq); + SFileCloseArchive(hMpq); + } + } + } + + _tprintf(_T("\n")); + return nError; +} + + +static int TestAddFilesToMpq( + const TCHAR * szMpqName, + ... + ) +{ + const TCHAR * szFileName; + const TCHAR * szSrc; + char * szTrg; + HANDLE hMpq; + va_list argList; + char szMpqFileName[MAX_PATH]; + int nError = ERROR_SUCCESS; + + if(!SFileOpenArchive(szMpqName, 0, 0, &hMpq)) + return GetLastError(); + + va_start(argList, szMpqName); + while((szFileName = va_arg(argList, const TCHAR *)) != NULL) + { + // Convert the plain name to ANSI + szSrc = GetPlainFileNameT(szFileName); + szTrg = szMpqFileName; + while(*szSrc != 0) + *szTrg++ = (char)*szSrc++; + *szTrg = 0; + + // Add the file to MPQ + if(!SFileAddFileEx(hMpq, szFileName, + szMpqFileName, + MPQ_FILE_COMPRESS, + MPQ_COMPRESSION_ZLIB)) + { + nError = GetLastError(); + printf("Failed to add the file \"%s\"\n", szFileName); + } + } + + SFileCloseArchive(hMpq); + return nError; +} + +static int TestCreateArchiveFromMemory(const TCHAR * szMpqName) +{ +#define FILE_SIZE 65535 + + HANDLE hFile; + HANDLE hMPQ; + char* data = new char [FILE_SIZE]; // random memory data + char szFileName[100]; + int i; + + // Create an mpq file for testing + if(SFileCreateArchive(szMpqName, MPQ_CREATE_ARCHIVE_V2|MPQ_CREATE_ATTRIBUTES, 0x100000, &hMPQ)) + { + for(i = 0; i < 1000; i++) + { + sprintf(szFileName, "File%03u.bin", i); + printf("Adding file %s\r", szFileName); + + if(SFileCreateFile(hMPQ, szFileName, 0, FILE_SIZE, 0, MPQ_FILE_COMPRESS, &hFile)) + { + SFileWriteFile(hFile, data, FILE_SIZE, MPQ_COMPRESSION_ZLIB); + SFileFinishFile(hFile); + } + } + } + SFileCloseArchive(hMPQ); + delete [] data; + return ERROR_SUCCESS; +} + +static int TestFileReadAndWrite( + const TCHAR * szMpqName, + const char * szFileName) +{ + LPBYTE pvFile = NULL; + HANDLE hFile = NULL; + HANDLE hMpq = NULL; + DWORD dwBytesRead; + DWORD dwFileSize = 0; + int nError = ERROR_SUCCESS; + + if(!SFileOpenArchive(szMpqName, 0, 0, &hMpq)) + { + nError = GetLastError(); + _tprintf(_T("Failed to open the archive %s (%u).\n"), szMpqName, nError); + } + + if(nError == ERROR_SUCCESS) + { + if(!SFileOpenFileEx(hMpq, szFileName, 0, &hFile)) + { + nError = GetLastError(); + printf("Failed to open the file %s (%u).\n", szFileName, nError); + } + } + + if(nError == ERROR_SUCCESS) + { + if(!SFileGetFileInfo(hFile, SFILE_INFO_FILE_SIZE, &dwFileSize, sizeof(DWORD))) + { + nError = GetLastError(); + _tprintf(_T("Failed to get the file size (%u).\n"), nError); + } + } + + if(nError == ERROR_SUCCESS) + { + pvFile = new BYTE[dwFileSize]; + if(pvFile == NULL) + { + nError = ERROR_NOT_ENOUGH_MEMORY; + printf("Failed to allocate buffer for the file (%u).\n", nError); + } + } + + if(nError == ERROR_SUCCESS) + { + if(!SFileReadFile(hFile, pvFile, dwFileSize, &dwBytesRead)) + { + nError = GetLastError(); + printf("Failed to read file (%u).\n", nError); + } + } + + if(hFile != NULL) + { + SFileCloseFile(hFile); + hFile = NULL; + } + + if(nError == ERROR_SUCCESS) + { + if(!SFileCreateFile(hMpq, szFileName, 0, dwFileSize, 0, MPQ_FILE_REPLACEEXISTING, &hFile)) + { + nError = GetLastError(); + printf("Failed to create %s in the archive (%u).\n", szFileName, nError); + } + } + + if(nError == ERROR_SUCCESS) + { + if(!SFileWriteFile(hFile, pvFile, dwFileSize, 0)) + { + nError = GetLastError(); + printf("Failed to write the data to the MPQ (%u).\n", nError); + } + } + + if(hFile != NULL) + { + if(!SFileFinishFile(hFile)) + { + nError = GetLastError(); + printf("Failed to finalize file creation (%u).\n", nError); + } + } + + if(pvFile != NULL) + delete [] pvFile; + if(hMpq != NULL) + SFileCloseArchive(hMpq); + return nError; +} + +static int TestSignatureVerify(const TCHAR * szMpqName) +{ + HANDLE hMpq; + + if(SFileOpenArchive(szMpqName, 0, 0, &hMpq)) + { + _tprintf(_T("Verifying digital signature in %s:\n"), szMpqName); + switch(SFileVerifyArchive(hMpq)) + { + case ERROR_NO_SIGNATURE: + _tprintf(_T("No digital signature present.\n")); + break; + + case ERROR_VERIFY_FAILED: + _tprintf(_T("Failed to verify signature.\n")); + break; + + case ERROR_WEAK_SIGNATURE_OK: + _tprintf(_T("Weak signature is OK.\n")); + break; + + case ERROR_WEAK_SIGNATURE_ERROR: + _tprintf(_T("Weak signature mismatch.\n")); + break; + + case ERROR_STRONG_SIGNATURE_OK: + _tprintf(_T("Strong signature is OK.\n")); + break; + + case ERROR_STRONG_SIGNATURE_ERROR: + _tprintf(_T("Strong signature mismatch.\n")); + break; + } + + SFileCloseArchive(hMpq); + _tprintf(_T("\n")); + } + + return 0; +} + + +static int TestCreateArchiveCopy(const TCHAR * szMpqName, const TCHAR * szMpqCopyName, const char * szListFile) +{ + TFileStream * pStream; + TCHAR szLocalFile[MAX_PATH]; + HANDLE hMpq1 = NULL; // Handle of existing archive + HANDLE hMpq2 = NULL; // Handle of created archive + DWORD dwHashTableSize = 0; + int nError = ERROR_SUCCESS; + + // If no listfile or an empty one, use NULL + if(szListFile == NULL || *szListFile == 0) + szListFile = NULL; + + // Create the new file + pStream = FileStream_CreateFile(szMpqCopyName); + if(pStream == NULL) + nError = GetLastError(); + + // Write some data + if(nError == ERROR_SUCCESS) + { + ULONGLONG FileSize = 0x100000; + + FileStream_SetSize(pStream, FileSize); + FileStream_Close(pStream); + } + + // Open the existing MPQ archive + if(nError == ERROR_SUCCESS) + { + _tprintf(_T("Opening %s ...\n"), szMpqName); + if(!SFileOpenArchive(szMpqName, 0, 0, &hMpq1)) + nError = GetLastError(); + } + + // Well, now create the MPQ archive + if(nError == ERROR_SUCCESS) + { + _tprintf(_T("Creating %s ...\n"), szMpqCopyName); + SFileGetFileInfo(hMpq1, SFILE_INFO_HASH_TABLE_SIZE, &dwHashTableSize, 4); + if(!SFileCreateArchive(szMpqCopyName, 0, dwHashTableSize, &hMpq2)) + nError = GetLastError(); + } + + // Copy all files from one archive to another + if(nError == ERROR_SUCCESS) + { + SFILE_FIND_DATA sf; + HANDLE hFind = SFileFindFirstFile(hMpq1, "*", &sf, szListFile); + bool bResult = true; + + _tprintf(_T("Copying files ...\n")); + + if(hFind != NULL) + { + while(bResult) + { + if(strcmp(sf.cFileName, LISTFILE_NAME) && strcmp(sf.cFileName, ATTRIBUTES_NAME)) + { + SFileSetLocale(sf.lcLocale); + + // Create the local file name + MergeLocalPath(szLocalFile, szWorkDir, sf.szPlainName); + if(SFileExtractFile(hMpq1, sf.cFileName, szLocalFile)) + { + printf("Extracting %s ... OK\n", sf.cFileName); + if(!SFileAddFile(hMpq2, szLocalFile, sf.cFileName, sf.dwFileFlags)) + { + nError = GetLastError(); + printf("Adding %s ... Failed\n\n", sf.cFileName); + _tremove(szLocalFile); + break; + } + else + { + printf("Adding %s ... OK\n", sf.cFileName); + } + } + else + { + printf("Extracting %s ... Failed\n", sf.cFileName); + } + + // Delete the added file + _tremove(szLocalFile); + } + + // Find the next file + bResult = SFileFindNextFile(hFind, &sf); + } + + // Close the search handle + SFileFindClose(hFind); + printf("\n"); + } + } + + // Close both archives + if(hMpq2 != NULL) + SFileCloseArchive(hMpq2); + if(hMpq1 != NULL) + SFileCloseArchive(hMpq1); + return nError; +} + +static int TestCompareTwoArchives( + const TCHAR * szMpqName1, + const TCHAR * szMpqName2, + const char * szListFile, + DWORD dwBlockSize) +{ + TMPQArchive * ha1 = NULL; + TMPQArchive * ha2 = NULL; + LPBYTE pbBuffer1 = NULL; + LPBYTE pbBuffer2 = NULL; + HANDLE hMpq1 = NULL; // Handle of the first archive + HANDLE hMpq2 = NULL; // Handle of the second archive + HANDLE hFile1 = NULL; + HANDLE hFile2 = NULL; + int nError = ERROR_SUCCESS; + + // If no listfile or an empty one, use NULL + if(szListFile == NULL || *szListFile == 0) + szListFile = NULL; + + // Allocate both buffers + pbBuffer1 = new BYTE[dwBlockSize]; + pbBuffer2 = new BYTE[dwBlockSize]; + if(pbBuffer1 == NULL || pbBuffer2 == NULL) + nError = ERROR_NOT_ENOUGH_MEMORY; + + _tprintf(_T("=============== Comparing MPQ archives ===============\n")); + + // Open the first MPQ archive + if(nError == ERROR_SUCCESS && szMpqName1 != NULL) + { + _tprintf(_T("Opening %s ...\n"), szMpqName1); + if(!SFileOpenArchive(szMpqName1, 0, 0, &hMpq1)) + nError = GetLastError(); + ha1 = (TMPQArchive *)hMpq1; + } + + // Open the second MPQ archive + if(nError == ERROR_SUCCESS && szMpqName2 != NULL) + { + _tprintf(_T("Opening %s ...\n"), szMpqName2); + if(!SFileOpenArchive(szMpqName2, 0, 0, &hMpq2)) + nError = GetLastError(); + ha2 = (TMPQArchive *)hMpq2; + } + + // Compare the header + if(nError == ERROR_SUCCESS && (ha1 != NULL && ha2 != NULL)) + { + if(ha1->pHeader->dwHeaderSize != ha2->pHeader->dwHeaderSize) + printf(" - Header size is different\n"); + if(ha1->pHeader->wFormatVersion != ha2->pHeader->wFormatVersion) + printf(" - Format version is different\n"); + if(ha1->pHeader->wSectorSize != ha2->pHeader->wSectorSize) + printf(" - Sector size is different\n"); + if(ha1->pHeader->HetTableSize64 != ha2->pHeader->HetTableSize64) + printf(" - HET table size is different\n"); + if(ha1->pHeader->BetTableSize64 != ha2->pHeader->BetTableSize64) + printf(" - BET table size is different\n"); + if(ha1->pHeader->dwHashTableSize != ha2->pHeader->dwHashTableSize) + printf(" - Hash table size is different\n"); + if(ha1->pHeader->dwBlockTableSize != ha2->pHeader->dwBlockTableSize) + printf(" - Block table size is different\n"); + } + + // Find all files in the first archive and compare them + if(nError == ERROR_SUCCESS) + { + SFILE_FIND_DATA sf; + HANDLE hFind = SFileFindFirstFile(hMpq1, "*", &sf, szListFile); + DWORD dwSearchScope1 = SFILE_OPEN_FROM_MPQ; + DWORD dwSearchScope2 = SFILE_OPEN_FROM_MPQ; + bool bResult = true; + + if(hMpq1 == NULL) + dwSearchScope1 = SFILE_OPEN_LOCAL_FILE; + if(hMpq2 == NULL) + dwSearchScope2 = SFILE_OPEN_LOCAL_FILE; + + while(hFind != NULL && bResult == true) + { + printf("%s\n", sf.cFileName); + SFileSetLocale(sf.lcLocale); + + // Open the first file + if(!SFileOpenFileEx(hMpq1, sf.cFileName, dwSearchScope1, &hFile1)) + { + printf("Failed to open the file %s in the first archive\n", sf.cFileName); + continue; + } + + if(!SFileOpenFileEx(hMpq2, sf.cFileName, dwSearchScope2, &hFile2)) + { + printf("Failed to open the file %s in the second archive\n", sf.cFileName); + continue; + } + + if(dwSearchScope1 == SFILE_OPEN_FROM_MPQ && dwSearchScope2 == SFILE_OPEN_FROM_MPQ) + { + TMPQFile * hf1 = (TMPQFile *)hFile1; + TMPQFile * hf2 = (TMPQFile *)hFile2; + + // Compare the file sizes + if(hf1->pFileEntry->dwFileSize != hf2->pFileEntry->dwFileSize) + printf(" - %s different size (%u x %u)\n", sf.cFileName, hf1->pFileEntry->dwFileSize, hf2->pFileEntry->dwFileSize); + + if(hf1->pFileEntry->dwFlags != hf2->pFileEntry->dwFlags) + printf(" - %s different flags (%08X x %08X)\n", sf.cFileName, hf1->pFileEntry->dwFlags, hf2->pFileEntry->dwFlags); + } + + if(!CompareArchivedFiles(sf.cFileName, hFile1, hFile2, 0x1001)) + printf(" - %s different content\n", sf.cFileName); + + if(!CompareArchivedFilesRR(sf.cFileName, hFile1, hFile2, 0x100000)) + printf(" - %s different content\n", sf.cFileName); + + // Close both files + SFileCloseFile(hFile2); + SFileCloseFile(hFile1); + hFile2 = hFile1 = NULL; + + // Find the next file + bResult = SFileFindNextFile(hFind, &sf); + } + + // Close all handles + if(hFile2 != NULL) + SFileCloseFile(hFile2); + if(hFile1 != NULL) + SFileCloseFile(hFile1); + if(hFind != NULL) + SFileFindClose(hFind); + } + + // Close both archives + clreol(); + printf("================ MPQ compare complete ================\n"); + if(hMpq2 != NULL) + SFileCloseArchive(hMpq2); + if(hMpq1 != NULL) + SFileCloseArchive(hMpq1); + if(pbBuffer2 != NULL) + delete [] pbBuffer2; + if(pbBuffer1 != NULL) + delete [] pbBuffer1; + return nError; +} + +static int TestOpenPatchedArchive(const TCHAR * szMpqName, ...) +{ + TFileStream * pStream; + HANDLE hFile = NULL; + HANDLE hMpq = NULL; + va_list argList; + const char * szFileName = "World\\Minimaps\\Azeroth\\noLiquid_map20_44.blp"; + TCHAR szLocFileName[MAX_PATH]; + LPBYTE pbFullFile = NULL; + DWORD dwFileSize; + int nError = ERROR_SUCCESS; + + // Open the primary MPQ + _tprintf(_T("Opening %s ...\n"), szMpqName); + if(!SFileOpenArchive(szMpqName, 0, MPQ_OPEN_READ_ONLY, &hMpq)) + { + nError = GetLastError(); + _tprintf(_T("Failed to open the archive %s ...\n"), szMpqName); + } + + // Add all patches + if(nError == ERROR_SUCCESS) + { + va_start(argList, szMpqName); + while((szMpqName = va_arg(argList, const TCHAR *)) != NULL) + { + _tprintf(_T("Adding patch %s ...\n"), szMpqName); + if(!SFileOpenPatchArchive(hMpq, szMpqName, NULL, 0)) + { + nError = GetLastError(); + printf("Failed to add patch %s ...\n", szMpqName); + } + } + va_end(argList); + } + + // Now search all files + if(nError == ERROR_SUCCESS) + { + SFILE_FIND_DATA sf; + HANDLE hFind; + bool bResult = true; + + hFind = SFileFindFirstFile(hMpq, "World\\Minimaps\\Azeroth\\noLiquid_map20_44.*", &sf, NULL); + while(hFind && bResult) + { + printf("%s\n", sf.cFileName); + bResult = SFileFindNextFile(hFind, &sf); + } + } + + // Now try to open patched version of a file + if(nError == ERROR_SUCCESS) + { + SFileExtractFile(hMpq, szFileName, _T("E:\\noLiquid_map20_44.blp")); + } + + // Now try to open patched version of "Achievement.dbc" + if(nError == ERROR_SUCCESS) + { + printf("Opening patched file \"%s\" ...\n", szFileName); + SFileVerifyFile(hMpq, szFileName, SFILE_VERIFY_RAW_MD5); + if(!SFileOpenFileEx(hMpq, szFileName, SFILE_OPEN_PATCHED_FILE, &hFile)) + { + nError = GetLastError(); + printf("Failed to open patched file \"%s\"\n", szFileName); + } + } + + // Verify of the patched version is correct + if(nError == ERROR_SUCCESS) + { + TCHAR * szPatchChain = NULL; + DWORD cbPatchChain = 0; + + // Get the patch chain + SFileGetFileInfo(hFile, SFILE_INFO_PATCH_CHAIN, szPatchChain, cbPatchChain, &cbPatchChain); + szPatchChain = (TCHAR *)(new BYTE[cbPatchChain]); + SFileGetFileInfo(hFile, SFILE_INFO_PATCH_CHAIN, szPatchChain, cbPatchChain, &cbPatchChain); + delete [] szPatchChain; + + // Get the size of the full patched file + dwFileSize = SFileGetFileSize(hFile, NULL); + if(dwFileSize != 0) + { + DWORD dwBytesRead = 0; + BYTE TempData[0x100]; + + SFileReadFile(hFile, TempData, sizeof(TempData), &dwBytesRead); + SFileSetFilePointer(hFile, 0, NULL, FILE_BEGIN); + + // Allocate space for the full file + pbFullFile = new BYTE[dwFileSize]; + if(pbFullFile != NULL) + { + if(!SFileReadFile(hFile, pbFullFile, dwFileSize)) + { + nError = GetLastError(); + printf("Failed to read full patched file data \"%s\"\n", szFileName); + } + + if(nError == ERROR_SUCCESS) + { + MergeLocalPath(szLocFileName, MAKE_PATH("Work//"), GetPlainFileNameA(szFileName)); + pStream = FileStream_CreateFile(szLocFileName); + if(pStream != NULL) + { + FileStream_Write(pStream, NULL, pbFullFile, dwFileSize); + FileStream_Close(pStream); + } + } + + delete [] pbFullFile; + } + } + } + + // Close handles + if(hFile != NULL) + SFileCloseFile(hFile); + if(hMpq != NULL) + SFileCloseArchive(hMpq); + return nError; +} + +//----------------------------------------------------------------------------- +// Main +// + +int main(void) +{ + int nError = ERROR_SUCCESS; + +#if defined(_MSC_VER) && defined(_DEBUG) + _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); +#endif // defined(_MSC_VER) && defined(_DEBUG) + +// FileStream_OpenEncrypted(_T("e:\\Multimedia\\MPQs\\2010 - Starcraft II\\Installer UI 2 deDE.MPQE")); + + // Mix the random number generator +// srand(GetTickCount()); + + // Test structure sizes +// if(nError == ERROR_SUCCESS) +// nError = TestStructureSizes(); + +// if(nError == ERROR_SUCCESS) +// nError = TestOpenLocalFile("C:\\autoexec.bat"); + + // Test reading partial file +// if(nError == ERROR_SUCCESS) +// nError = TestPartFileRead(MAKE_PATH("2009 - PartialMPQs/patch.MPQ.part")); + + // Test LZMA compression method against the code ripped from Starcraft II +// if(nError == ERROR_SUCCESS) +// nError = CompareLzmaCompressions(MPQ_SECTOR_SIZE); + + // Test compression methods +// if(nError == ERROR_SUCCESS) +// nError = TestSectorCompress(MPQ_SECTOR_SIZE); + + // Test the archive open and close + if(nError == ERROR_SUCCESS) + nError = TestArchiveOpenAndClose(MAKE_PATH("2011 - WoW/15050/world.MPQ")); +// nError = TestArchiveOpenAndClose(MAKE_PATH("2011 - WoW BETA/wow-update-13202.MPQ")); +// nError = TestArchiveOpenAndClose(MAKE_PATH("2002 - Warcraft III/ProtectedMap_HashTable_FakeValid.w3x")); +// nError = TestArchiveOpenAndClose(MAKE_PATH("2010 - Starcraft II/Installer Tome 1 enGB.MPQE")); +// nError = TestArchiveOpenAndClose(MAKE_PATH("1997 - Diablo I/DIABDAT_orig.MPQ")); +// nError = TestArchiveOpenAndClose(MAKE_PATH("2004 - World of Warcraft/SoundCache-enUS.MPQ")); +// nError = TestArchiveOpenAndClose(MAKE_PATH("smpq.mpq ")); + +// if(nError == ERROR_SUCCESS) +// nError = TestFindFiles(MAKE_PATH("2002 - Warcraft III/HumanEd.mpq")); + + // Create a big MPQ archive +// if(nError == ERROR_SUCCESS) +// nError = TestCreateArchive_PaliRoharBug(MAKE_PATH("Test.mpq")); +// nError = TestCreateArchive(MAKE_PATH("Test.mpq")); +// nError = TestCreateArchive((const TCHAR*)szUnicodeName1); +// nError = TestCreateArchive((const TCHAR*)szUnicodeName2); +// nError = TestCreateArchive((const TCHAR*)szUnicodeName3); +// nError = TestCreateArchive((const TCHAR*)szUnicodeName4); +// nError = TestCreateArchive((const TCHAR*)szUnicodeName5); +// nError = TestCreateArchive((const TCHAR*)szUnicodeName6); + +// if(nError == ERROR_SUCCESS) +// nError = TestAddFilesToMpq(MAKE_PATH("wow-update-13202.MPQ"), +// "c:\\Tools32\\Arj32.exe", +// "c:\\Tools32\\autoruns.chm", +// "c:\\Tools32\\CPUEater.exe", +// "c:\\Tools32\\dumpbin.exe", +// "c:\\Tools32\\editbin.exe", +// "c:\\Tools32\\fsg.ini", +// "c:\\Tools32\\hiew8.ini", +// "c:\\Tools32\\ida.bat", +// "c:\\Tools32\\mp3.ini", +// NULL); + +// if(nError == ERROR_SUCCESS) +// nError = TestCreateArchiveFromMemory(MAKE_PATH("Test-leak.mpq")); + +// if(nError == ERROR_SUCCESS) +// nError = TestFileReadAndWrite(MAKE_PATH("2002 - Warcraft III/(10)DustwallowKeys.w3m"), "war3map.j"); + + // Verify the archive signature +// if(nError == ERROR_SUCCESS) +// nError = TestSignatureVerify(MAKE_PATH("1998 - Starcraft/BW-1152.exe")); +// nError = TestSignatureVerify(MAKE_PATH("2002 - Warcraft III/(10)DustwallowKeys.w3m")); +// nError = TestSignatureVerify(MAKE_PATH("2002 - Warcraft III/War3TFT_121b_English.exe")); +// nError = TestSignatureVerify(MAKE_PATH("2004 - World of Warcraft/WoW-2.3.3.7799-to-2.4.0.8089-enUS-patch.exe")); +// nError = TestSignatureVerify(MAKE_PATH("2004 - World of Warcraft/standalone.MPQ")); + + // Compact the archive +// if(nError == ERROR_SUCCESS) +// nError = TestMpqCompacting(MAKE_PATH("wow-update-base-14333.MPQ")); + + // Create copy of the archive, appending some bytes before the MPQ header +// if(nError == ERROR_SUCCESS) +// nError = TestCreateArchiveCopy(MAKE_PATH("PartialMPQs/interface.MPQ.part"), MAKE_PATH("PartialMPQs/interface-copy.MPQ.part"), NULL); +/* + if(nError == ERROR_SUCCESS) + { + nError = TestCompareTwoArchives(MAKE_PATH("2011 - WoW-Cataclysm/wow-update-13189.MPQ"), + MAKE_PATH("wow-update-13189.MPQ"), + NULL, + 0x1001); + } +*/ + + if(nError == ERROR_SUCCESS) + { + nError = TestOpenPatchedArchive(MAKE_PATH("2004 - Wow 3.x/lichking.MPQ"), + MAKE_PATH("2011 - WoW 4.x/wow-update-13287.MPQ"), + NULL); +/* + nError = TestOpenPatchedArchive(MAKE_PATH("2011 - WoW 4.x/locale-enGB.MPQ"), + MAKE_PATH("2011 - WoW 4.x/wow-update-13164.MPQ"), + MAKE_PATH("2011 - WoW 4.x/wow-update-13205.MPQ"), + MAKE_PATH("2011 - WoW 4.x/wow-update-13287.MPQ"), + MAKE_PATH("2011 - WoW 4.x/wow-update-13329.MPQ"), + MAKE_PATH("2011 - WoW 4.x/wow-update-13596.MPQ"), + MAKE_PATH("2011 - WoW 4.x/wow-update-13623.MPQ"), + MAKE_PATH("2011 - WoW 4.x/wow-update-enGB-13914.MPQ"), + MAKE_PATH("2011 - WoW 4.x/wow-update-enGB-14007.MPQ"), + MAKE_PATH("2011 - WoW 4.x/wow-update-enGB-14333.MPQ"), + MAKE_PATH("2011 - WoW 4.x/wow-update-enGB-14480.MPQ"), + NULL); +*/ + } + + // Remove the working directory + clreol(); + if(nError != ERROR_SUCCESS) + printf("One or more errors occurred when testing StormLib\n"); + + printf("Work complete.\n"); + return nError; +} diff --git a/dep/StormLib/test/x86_ripped_code.asm b/dep/StormLib/test/x86_ripped_code.asm new file mode 100644 index 00000000000..4b4be328a6c --- /dev/null +++ b/dep/StormLib/test/x86_ripped_code.asm @@ -0,0 +1,1231 @@ +.686P +.MODEL FLAT +ASSUME FS: NOTHING +.CODE + +extrn _memset:PROC +extrn _memcpy:PROC +extrn _memmove:PROC + +;------------------------------------------------------------------------------ +; Structures +; + +;------------------------------------------------------------------------------ +; Functions +; + +_aullrem proc near ; CODE XREF: sub_6CC140+3Ap + ; sub_6CC1E0+57p ... + +DividendLo = dword ptr 8 +DividendHi = dword ptr 0Ch +DivisorLo = dword ptr 10h +DivisorHi = dword ptr 14h + + push ebx + mov eax, [esp+DivisorHi] + or eax, eax + jnz short loc_8F8FE1 + mov ecx, [esp+DivisorLo] + mov eax, [esp+DividendHi] + xor edx, edx + div ecx + mov eax, [esp+DividendLo] + div ecx + mov eax, edx + xor edx, edx + jmp short loc_8F9031 +; --------------------------------------------------------------------------- + +loc_8F8FE1: ; CODE XREF: _aullrem+7j + mov ecx, eax + mov ebx, [esp+DivisorLo] + mov edx, [esp+DividendHi] + mov eax, [esp+DividendLo] + +loc_8F8FEF: ; CODE XREF: _aullrem+39j + shr ecx, 1 + rcr ebx, 1 + shr edx, 1 + rcr eax, 1 + or ecx, ecx + jnz short loc_8F8FEF + div ebx + mov ecx, eax + mul [esp+DivisorHi] + xchg eax, ecx + mul [esp+DivisorLo] + add edx, ecx + jb short loc_8F901A + cmp edx, [esp+DividendHi] + ja short loc_8F901A + jb short loc_8F9022 + cmp eax, [esp+DividendLo] + jbe short loc_8F9022 + +loc_8F901A: ; CODE XREF: _aullrem+4Aj + ; _aullrem+50j + sub eax, [esp+DivisorLo] + sbb edx, [esp+DivisorHi] + +loc_8F9022: ; CODE XREF: _aullrem+52j + ; _aullrem+58j + sub eax, [esp+DividendLo] + sbb edx, [esp+DividendHi] + neg edx + neg eax + sbb edx, 0 + +loc_8F9031: ; CODE XREF: _aullrem+1Fj + pop ebx + retn 10h +_aullrem endp + +_aullshr proc near ; CODE XREF: sub_40E2B6+1ECp + ; sub_40E2B6+240p ... + cmp cl, 40h + jnb short loc_414BDA + cmp cl, 20h + jnb short loc_414BD0 + shrd eax, edx, cl + shr edx, cl + retn +; --------------------------------------------------------------------------- + +loc_414BD0: ; CODE XREF: _aullshr+8j + mov eax, edx + xor edx, edx + and cl, 1Fh + shr eax, cl + retn +; --------------------------------------------------------------------------- + +loc_414BDA: ; CODE XREF: _aullshr+3j + xor eax, eax + xor edx, edx + retn +_aullshr endp + + +; =============== S U B R O U T I N E ======================================= + +; Attributes: bp-based frame + +SFileDecryptMpqHeader proc near ; CODE XREF: sub_6D00E0+AEp + ; sub_6D00E0+D3p + +EncryptedDataAligned= dword ptr -88h +var_48 = dword ptr -48h +DecryptBuffer = dword ptr -44h +var_40 = dword ptr -40h +var_3C = dword ptr -3Ch +var_38 = dword ptr -38h +var_34 = dword ptr -34h +var_30 = dword ptr -30h +var_2C = dword ptr -2Ch +var_28 = dword ptr -28h +var_24 = dword ptr -24h +var_20 = dword ptr -20h +var_1C = dword ptr -1Ch +var_18 = dword ptr -18h +var_14 = dword ptr -14h +var_10 = dword ptr -10h +var_0C = dword ptr -0Ch +var_8 = dword ptr -8 +var_4 = dword ptr -4 +arg_FFFFFFF8 = dword ptr 0 +arg_FFFFFFFC = dword ptr 4 +arg_0 = dword ptr 8 + + push ebp + mov ebp, esp + sub esp, 88h + mov eax, [ecx+8] + mov edx, [ecx+14h] + push ebx + mov ebx, [ecx+10h] + mov [ebp+var_0C], eax + mov eax, [ebp+arg_0] + push esi + push edi + mov edi, [ecx+0Ch] + mov [ebp+DecryptBuffer], ecx + mov [ebp+var_10], edx + test al, 3 + jz short loc_6C9F03 + mov ecx, [eax] + mov [ebp+EncryptedDataAligned], ecx + mov ecx, [eax+4] + mov [ebp+EncryptedDataAligned+4], ecx + mov ecx, [eax+8] + mov [ebp+EncryptedDataAligned+8], ecx + mov ecx, [eax+0Ch] + mov [ebp+EncryptedDataAligned+0Ch], ecx + mov ecx, [eax+10h] + mov [ebp+EncryptedDataAligned+10h], ecx + mov ecx, [eax+14h] + mov [ebp+EncryptedDataAligned+14h], ecx + mov ecx, [eax+18h] + mov [ebp+EncryptedDataAligned+18h], ecx + mov ecx, [eax+1Ch] + mov [ebp+EncryptedDataAligned+1Ch], ecx + mov ecx, [eax+20h] + mov [ebp+EncryptedDataAligned+20h], ecx + mov ecx, [eax+24h] + mov [ebp+EncryptedDataAligned+24h], ecx + mov ecx, [eax+28h] + mov [ebp+EncryptedDataAligned+28h], ecx + mov ecx, [eax+2Ch] + mov [ebp+EncryptedDataAligned+2Ch], ecx + mov ecx, [eax+30h] + mov [ebp+EncryptedDataAligned+30h], ecx + mov ecx, [eax+34h] + mov [ebp+EncryptedDataAligned+34h], ecx + mov ecx, [eax+38h] + mov eax, [eax+3Ch] + mov [ebp+EncryptedDataAligned+3Ch], eax + mov [ebp+EncryptedDataAligned+38h], ecx + lea eax, [ebp+EncryptedDataAligned] + +loc_6C9F03: ; CODE XREF: SFileDecryptMpqHeader+26j + mov ecx, [eax] + mov [ebp+var_30], ecx + mov esi, edi + not esi + and esi, edx + mov edx, ebx + and edx, edi + or esi, edx + add esi, ecx + mov ecx, [ebp+var_0C] + lea edx, [esi+ecx-28955B88h] + mov ecx, [eax+4] + rol edx, 7 + add edx, edi + mov [ebp+var_2C], ecx + mov ecx, edx + not ecx + and ecx, ebx + mov esi, edi + and esi, edx + or ecx, esi + add ecx, [ebp+var_2C] + mov esi, [ebp+var_10] + lea esi, [ecx+esi-173848AAh] + mov ecx, [eax+8] + mov [ebp+var_40], ecx + rol esi, 0Ch + add esi, edx + mov ecx, esi + not ecx + and ecx, edi + mov edi, esi + and edi, edx + or ecx, edi + add ecx, [ebp+var_40] + lea edi, [ecx+ebx+242070DBh] + mov ecx, [eax+0Ch] + ror edi, 0Fh + add edi, esi + mov [ebp+var_1C], ecx + mov ebx, edi + not ebx + and ebx, edx + mov ecx, esi + and ecx, edi + or ebx, ecx + add ebx, [ebp+var_1C] + mov ecx, [ebp+DecryptBuffer] + mov ecx, [ecx+0Ch] + lea ecx, [ebx+ecx-3E423112h] + ror ecx, 0Ah + add ecx, edi + mov [ebp+var_4], edi + and edi, ecx + mov ebx, ecx + not ebx + and ebx, esi + or ebx, edi + mov edi, [eax+10h] + add ebx, edi + lea edx, [ebx+edx-0A83F051h] + rol edx, 7 + add edx, ecx + mov [ebp+arg_0], edx + not edx + and edx, [ebp+var_4] + mov ebx, ecx + and ebx, [ebp+arg_0] + mov [ebp+var_10], edi + mov edi, [eax+14h] + or edx, ebx + add edx, edi + lea esi, [edx+esi+4787C62Ah] + mov edx, [eax+18h] + mov [ebp+var_34], edi + mov edi, [ebp+arg_0] + rol esi, 0Ch + add esi, edi + mov [ebp+var_20], edx + mov edx, esi + not edx + and edx, ecx + mov ebx, esi + and ebx, edi + or edx, ebx + add edx, [ebp+var_20] + mov ebx, [ebp+var_4] + lea edx, [edx+ebx-57CFB9EDh] + ror edx, 0Fh + add edx, esi + mov ebx, edx + not ebx + and ebx, edi + mov edi, esi + and edi, edx + or ebx, edi + mov edi, [eax+1Ch] + add ebx, edi + lea ecx, [ebx+ecx-2B96AFFh] + ror ecx, 0Ah + add ecx, edx + mov [ebp+var_3C], edi + mov edi, [eax+20h] + mov [ebp+var_14], edi + mov edi, ecx + not edi + and edi, esi + mov ebx, edx + and ebx, ecx + or edi, ebx + add edi, [ebp+var_14] + mov ebx, [ebp+arg_0] + lea edi, [edi+ebx+698098D8h] + mov [ebp+var_8], ecx + rol edi, 7 + add edi, ecx + and ecx, edi + mov ebx, edi + not ebx + and ebx, edx + or ebx, ecx + mov ecx, [eax+24h] + add ebx, ecx + mov [ebp+var_0C], ecx + mov ecx, [eax+28h] + lea esi, [ebx+esi-74BB0851h] + mov [ebp+var_24], ecx + rol esi, 0Ch + add esi, edi + mov ecx, esi + not ecx + and ecx, [ebp+var_8] + mov ebx, esi + and ebx, edi + or ecx, ebx + add ecx, [ebp+var_24] + mov ebx, esi + lea edx, [ecx+edx-0A44Fh] + mov ecx, [eax+2Ch] + ror edx, 0Fh + add edx, esi + mov [ebp+var_18], ecx + and ebx, edx + mov ecx, edx + not ecx + and ecx, edi + or ecx, ebx + add ecx, [ebp+var_18] + mov ebx, [ebp+var_8] + lea ecx, [ecx+ebx-76A32842h] + ror ecx, 0Ah + add ecx, edx + mov ebx, ecx + not ebx + mov [ebp+var_4], edx + and edx, ecx + and ebx, esi + or ebx, edx + mov edx, [eax+30h] + add ebx, edx + mov [ebp+var_38], edx + lea edi, [ebx+edi+6B901122h] + mov edx, [eax+34h] + rol edi, 7 + add edi, ecx + mov [ebp+arg_0], edi + not edi + and edi, [ebp+var_4] + mov ebx, ecx + and ebx, [ebp+arg_0] + mov [ebp+var_8], edx + or edi, ebx + add edi, edx + mov edx, [eax+38h] + mov eax, [eax+3Ch] + lea esi, [edi+esi-2678E6Dh] + rol esi, 0Ch + add esi, [ebp+arg_0] + mov [ebp+var_28], edx + mov edi, esi + not edi + mov edx, edi + and edx, ecx + mov ebx, esi + and ebx, [ebp+arg_0] + or edx, ebx + add edx, [ebp+var_28] + mov ebx, [ebp+var_4] + lea edx, [edx+ebx-5986BC72h] + mov [ebp+var_4], eax + ror edx, 0Fh + add edx, esi + mov ebx, edx + not ebx + mov [ebp+var_48], ebx + and ebx, [ebp+arg_0] + mov eax, esi + and eax, edx + or ebx, eax + add ebx, [ebp+var_4] + and edi, edx + lea ecx, [ebx+ecx+49B40821h] + ror ecx, 0Ah + add ecx, edx + mov eax, esi + and eax, ecx + or edi, eax + add edi, [ebp+var_2C] + mov eax, [ebp+arg_0] + lea edi, [edi+eax-9E1DA9Eh] + mov eax, [ebp+var_48] + and eax, ecx + rol edi, 5 + add edi, ecx + mov ebx, edx + and ebx, edi + or eax, ebx + add eax, [ebp+var_20] + lea esi, [eax+esi-3FBF4CC0h] + rol esi, 9 + add esi, edi + mov eax, ecx + not eax + and eax, edi + mov ebx, esi + and ebx, ecx + or eax, ebx + add eax, [ebp+var_18] + lea edx, [eax+edx+265E5A51h] + rol edx, 0Eh + add edx, esi + mov eax, edi + not eax + and eax, esi + mov ebx, edx + and ebx, edi + or eax, ebx + add eax, [ebp+var_30] + lea ecx, [eax+ecx-16493856h] + ror ecx, 0Ch + mov eax, esi + add ecx, edx + not eax + and eax, edx + mov ebx, esi + and ebx, ecx + or eax, ebx + add eax, [ebp+var_34] + lea edi, [eax+edi-29D0EFA3h] + rol edi, 5 + add edi, ecx + mov [ebp+arg_0], edi + mov eax, edx + not eax + and eax, ecx + mov edi, edx + and edi, [ebp+arg_0] + or eax, edi + add eax, [ebp+var_24] + mov edi, ecx + lea esi, [eax+esi+2441453h] + mov eax, [ebp+arg_0] + not edi + and edi, eax + rol esi, 9 + add esi, eax + not eax + and eax, esi + mov ebx, esi + and ebx, ecx + or edi, ebx + add edi, [ebp+var_4] + lea edx, [edi+edx-275E197Fh] + rol edx, 0Eh + add edx, esi + mov edi, edx + and edi, [ebp+arg_0] + or eax, edi + add eax, [ebp+var_10] + mov edi, esi + lea ecx, [eax+ecx-182C0438h] + ror ecx, 0Ch + add ecx, edx + and edi, ecx + mov eax, esi + not eax + and eax, edx + or eax, edi + add eax, [ebp+var_0C] + mov edi, [ebp+arg_0] + lea eax, [eax+edi+21E1CDE6h] + rol eax, 5 + add eax, ecx + mov [ebp+arg_0], eax + mov eax, edx + not eax + and eax, ecx + mov edi, edx + and edi, [ebp+arg_0] + or eax, edi + add eax, [ebp+var_28] + mov edi, ecx + lea esi, [eax+esi-3CC8F82Ah] + mov eax, [ebp+arg_0] + rol esi, 9 + add esi, eax + not edi + and edi, eax + mov ebx, esi + and ebx, ecx + or edi, ebx + add edi, [ebp+var_1C] + not eax + lea edx, [edi+edx-0B2AF279h] + rol edx, 0Eh + add edx, esi + and eax, esi + mov edi, edx + and edi, [ebp+arg_0] + or eax, edi + add eax, [ebp+var_14] + lea ecx, [eax+ecx+455A14EDh] + ror ecx, 0Ch + add ecx, edx + mov eax, esi + not eax + and eax, edx + mov edi, esi + and edi, ecx + or eax, edi + add eax, [ebp+var_8] + mov edi, [ebp+arg_0] + lea eax, [eax+edi-561C16FBh] + rol eax, 5 + add eax, ecx + mov [ebp+arg_0], eax + mov eax, edx + not eax + and eax, ecx + mov edi, edx + and edi, [ebp+arg_0] + or eax, edi + add eax, [ebp+var_40] + mov edi, ecx + lea esi, [eax+esi-3105C08h] + mov eax, [ebp+arg_0] + not edi + and edi, eax + rol esi, 9 + add esi, eax + mov ebx, esi + and ebx, ecx + or edi, ebx + add edi, [ebp+var_3C] + not eax + lea edx, [edi+edx+676F02D9h] + and eax, esi + rol edx, 0Eh + add edx, esi + mov edi, edx + and edi, [ebp+arg_0] + or eax, edi + add eax, [ebp+var_38] + mov edi, [ebp+arg_0] + lea ecx, [eax+ecx-72D5B376h] + ror ecx, 0Ch + add ecx, edx + mov eax, esi + xor eax, edx + xor eax, ecx + add eax, [ebp+var_34] + lea eax, [eax+edi-5C6BEh] + rol eax, 4 + add eax, ecx + mov edi, edx + xor edi, ecx + xor edi, eax + add edi, [ebp+var_14] + lea esi, [edi+esi-788E097Fh] + rol esi, 0Bh + add esi, eax + mov edi, esi + xor edi, ecx + xor edi, eax + add edi, [ebp+var_18] + lea edx, [edi+edx+6D9D6122h] + rol edx, 10h + add edx, esi + mov edi, esi + xor edi, edx + mov ebx, edi + xor ebx, eax + add ebx, [ebp+var_28] + lea ecx, [ebx+ecx-21AC7F4h] + ror ecx, 9 + add ecx, edx + xor edi, ecx + add edi, [ebp+var_2C] + lea eax, [edi+eax-5B4115BCh] + rol eax, 4 + mov edi, edx + add eax, ecx + xor edi, ecx + xor edi, eax + add edi, [ebp+var_10] + lea esi, [edi+esi+4BDECFA9h] + rol esi, 0Bh + add esi, eax + mov edi, esi + xor edi, ecx + xor edi, eax + add edi, [ebp+var_3C] + lea edx, [edi+edx-944B4A0h] + rol edx, 10h + add edx, esi + mov edi, esi + xor edi, edx + mov ebx, edi + xor ebx, eax + add ebx, [ebp+var_24] + lea ecx, [ebx+ecx-41404390h] + ror ecx, 9 + add ecx, edx + xor edi, ecx + add edi, [ebp+var_8] + lea eax, [edi+eax+289B7EC6h] + rol eax, 4 + add eax, ecx + mov edi, edx + xor edi, ecx + xor edi, eax + add edi, [ebp+var_30] + lea esi, [edi+esi-155ED806h] + rol esi, 0Bh + add esi, eax + mov edi, esi + xor edi, ecx + xor edi, eax + add edi, [ebp+var_1C] + lea edi, [edi+edx-2B10CF7Bh] + rol edi, 10h + add edi, esi + mov edx, esi + xor edx, edi + mov ebx, edx + xor ebx, eax + add ebx, [ebp+var_20] + lea ecx, [ebx+ecx+4881D05h] + ror ecx, 9 + add ecx, edi + xor edx, ecx + add edx, [ebp+var_0C] + lea eax, [edx+eax-262B2FC7h] + rol eax, 4 + add eax, ecx + mov edx, edi + xor edx, ecx + xor edx, eax + add edx, [ebp+var_38] + lea edx, [edx+esi-1924661Bh] + rol edx, 0Bh + add edx, eax + mov esi, edx + xor esi, ecx + xor esi, eax + add esi, [ebp+var_4] + mov ebx, edx + lea esi, [esi+edi+1FA27CF8h] + mov edi, [ebp+var_40] + rol esi, 10h + add esi, edx + xor ebx, esi + xor ebx, eax + add ebx, edi + lea ecx, [ebx+ecx-3B53A99Bh] + ror ecx, 9 + add ecx, esi + mov ebx, edx + not ebx + or ebx, ecx + xor ebx, esi + add ebx, [ebp+var_30] + lea eax, [ebx+eax-0BD6DDBCh] + rol eax, 6 + add eax, ecx + mov ebx, esi + not ebx + or ebx, eax + xor ebx, ecx + add ebx, [ebp+var_3C] + lea edx, [ebx+edx+432AFF97h] + rol edx, 0Ah + add edx, eax + mov ebx, ecx + not ebx + or ebx, edx + xor ebx, eax + add ebx, [ebp+var_28] + lea esi, [ebx+esi-546BDC59h] + rol esi, 0Fh + add esi, edx + mov ebx, eax + not ebx + or ebx, esi + xor ebx, edx + add ebx, [ebp+var_34] + lea ecx, [ebx+ecx-36C5FC7h] + ror ecx, 0Bh + add ecx, esi + mov ebx, edx + not ebx + or ebx, ecx + xor ebx, esi + add ebx, [ebp+var_38] + lea eax, [ebx+eax+655B59C3h] + rol eax, 6 + add eax, ecx + mov ebx, esi + not ebx + or ebx, eax + xor ebx, ecx + add ebx, [ebp+var_1C] + lea edx, [ebx+edx-70F3336Eh] + rol edx, 0Ah + add edx, eax + mov ebx, ecx + not ebx + or ebx, edx + xor ebx, eax + add ebx, [ebp+var_24] + lea esi, [ebx+esi-100B83h] + rol esi, 0Fh + add esi, edx + mov ebx, eax + not ebx + or ebx, esi + xor ebx, edx + add ebx, [ebp+var_2C] + lea ecx, [ebx+ecx-7A7BA22Fh] + ror ecx, 0Bh + add ecx, esi + mov ebx, edx + not ebx + or ebx, ecx + xor ebx, esi + add ebx, [ebp+var_14] + lea eax, [ebx+eax+6FA87E4Fh] + rol eax, 6 + add eax, ecx + mov ebx, esi + not ebx + or ebx, eax + xor ebx, ecx + add ebx, [ebp+var_4] + lea edx, [ebx+edx-1D31920h] + rol edx, 0Ah + add edx, eax + mov ebx, ecx + not ebx + or ebx, edx + xor ebx, eax + add ebx, [ebp+var_20] + lea esi, [ebx+esi-5CFEBCECh] + rol esi, 0Fh + mov ebx, eax + add esi, edx + not ebx + or ebx, esi + xor ebx, edx + add ebx, [ebp+var_8] + lea ecx, [ebx+ecx+4E0811A1h] + ror ecx, 0Bh + add ecx, esi + mov ebx, edx + not ebx + or ebx, ecx + xor ebx, esi + add ebx, [ebp+var_10] + lea eax, [ebx+eax-8AC817Eh] + rol eax, 6 + add eax, ecx + mov ebx, esi + not ebx + or ebx, eax + xor ebx, ecx + add ebx, [ebp+var_18] + lea edx, [ebx+edx-42C50DCBh] + rol edx, 0Ah + add edx, eax + mov ebx, ecx + not ebx + or ebx, edx + xor ebx, eax + add ebx, edi + lea esi, [ebx+esi+2AD7D2BBh] + mov edi, eax + not edi + rol esi, 0Fh + add esi, edx + or edi, esi + xor edi, edx + add edi, [ebp+var_0C] + lea edi, [edi+ecx-14792C6Fh] + mov ecx, [ebp+DecryptBuffer] + mov ebx, [ecx+8] + add ebx, eax + mov eax, [ecx+10h] + ror edi, 0Bh + add edi, [ecx+0Ch] + add eax, esi + add edi, esi + mov [ecx+10h], eax + mov eax, [ecx+14h] + mov [ecx+0Ch], edi + pop edi + add eax, edx + pop esi + mov [ecx+8], ebx + mov [ecx+14h], eax + pop ebx + mov esp, ebp + pop ebp + retn 4 +SFileDecryptMpqHeader endp + +; --------------------------------------------------------------------------- + +; --------------------------------------------------------------------------- + +sub_6D00E0 proc near ; CODE XREF: sub_6D0210+59p + ; sub_6D0210+66p ... + +var_10 = dword ptr -10h +pbMpqHeader = dword ptr -4 +pMpqHeader = dword ptr 8 +dwSize = dword ptr 0Ch + + push ebp + mov ebp, esp + push ecx + mov eax, [ebp+pMpqHeader] ; EAX = MPQ Header + push ebx + mov ebx, [ebp+dwSize] ; EBX - size of MPQ Header + push esi + push edi + mov esi, ecx ; ESI - decryption buffer (6 DWORDs) + mov edi, [esi] + shr edi, 3 + and edi, 3Fh + mov [ebp+pbMpqHeader], eax + lea ecx, ds:0[ebx*8] ; ECX = sizeof header * 8 + test ebx, ebx + jbe loc_6D01F8 + add [esi], ecx + mov edx, ebx ; EDX = size of header + shr edx, 1Dh + add [esi+4], edx + mov edx, [esi+4] + cmp [esi], ecx + jnb short loc_6D011E + inc edx + mov [esi+4], edx + +loc_6D011E: ; CODE XREF: sub_6D00E0+38j + test edi, edi + jz short loc_6D0196 + lea eax, [edi+ebx] + cmp eax, 40h + jbe short loc_6D0136 + mov eax, 40h + sub eax, edi + mov [ebp+dwSize], eax + jmp short loc_6D013B +; --------------------------------------------------------------------------- + +loc_6D0136: ; CODE XREF: sub_6D00E0+48j + mov [ebp+dwSize], ebx + mov eax, ebx + +loc_6D013B: ; CODE XREF: sub_6D00E0+54j + mov edx, [ebp+pMpqHeader] + add edx, eax + lea ecx, [edi+esi+18h] + mov [ebp+pbMpqHeader], edx + cmp ecx, edx + jnb short loc_6D0163 + lea edx, [ecx+eax] + mov ecx, [ebp+pMpqHeader] + cmp edx, ecx + jbe short loc_6D0166 + push eax + push ecx + lea eax, [edi+esi+18h] + push eax + call _memmove + jmp short loc_6D0172 +; --------------------------------------------------------------------------- + +loc_6D0163: ; CODE XREF: sub_6D00E0+69j + mov ecx, [ebp+pMpqHeader] + +loc_6D0166: ; CODE XREF: sub_6D00E0+73j + push eax + push ecx + lea eax, [edi+esi+18h] + push eax + call _memcpy + +loc_6D0172: ; CODE XREF: sub_6D00E0+81j + mov eax, [ebp+dwSize] + lea ecx, [eax+edi] + add esp, 0Ch + cmp ecx, 40h + jl short loc_6D01F8 + mov edx, [ebp+pbMpqHeader] + sub ebx, eax + lea eax, [esi+18h] + push eax + mov ecx, esi + mov [ebp+pbMpqHeader], edx + call SFileDecryptMpqHeader + mov eax, [ebp+pbMpqHeader] + +loc_6D0196: ; CODE XREF: sub_6D00E0+40j + cmp ebx, 40h + jl short loc_6D01C4 + mov edi, ebx + shr edi, 6 + mov ecx, edi + neg ecx + shl ecx, 6 + add ebx, ecx + lea esp, [esp+0] + +loc_6D01B0: ; CODE XREF: sub_6D00E0+E2j + push eax + mov ecx, esi + call SFileDecryptMpqHeader + add [ebp+pbMpqHeader], 40h + sub edi, 1 + mov eax, [ebp+pbMpqHeader] + jnz short loc_6D01B0 + +loc_6D01C4: ; CODE XREF: sub_6D00E0+B9j + test ebx, ebx + jz short loc_6D01F8 + add esi, 18h + lea edx, [ebx+eax] + cmp esi, edx + jnb short loc_6D01ED + lea ecx, [esi+ebx] + cmp ecx, eax + jbe short loc_6D01ED + push ebx + push eax + push esi + call _memmove + add esp, 0Ch + pop edi + pop esi + pop ebx + mov esp, ebp + pop ebp + retn 8 +; --------------------------------------------------------------------------- + +loc_6D01ED: ; CODE XREF: sub_6D00E0+F0j + ; sub_6D00E0+F7j + push ebx + push eax + push esi + call _memcpy + add esp, 0Ch + +loc_6D01F8: ; CODE XREF: sub_6D00E0+23j + ; sub_6D00E0+9Ej ... + pop edi + pop esi + pop ebx + mov esp, ebp + pop ebp + retn 8 +sub_6D00E0 endp + +aA_1: ; DATA XREF: sub_6249D0+68o + ; sub_6D0210+4Fo ... + dw 80h, 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + db 0 + +sub_6D0210 proc near ; CODE XREF: SFileVerifyMpqHeaderMD5+42p + ; sub_6D2D60+A9p ... + +var_8 = byte ptr -8 +var_6 = byte ptr -6 +var_5 = byte ptr -5 +var_4 = byte ptr -4 +var_3 = byte ptr -3 +var_2 = byte ptr -2 +var_1 = byte ptr -1 +arg_0 = dword ptr 8 + + push ebp + mov ebp, esp + sub esp, 8 + push esi + mov esi, ecx ; Source address + mov eax, [esi] + mov ecx, eax + shr ecx, 8 + mov [ebp-7], cl + mov ecx, eax + shr ecx, 18h + mov [ebp+var_5], cl + mov ecx, [esi+4] + mov edx, eax + shr edx, 10h + mov [ebp+var_6], dl + mov edx, ecx + mov [ebp+var_4], cl + shr edx, 8 + mov [ebp+var_3], dl + mov edx, ecx + shr ecx, 18h + mov [ebp+var_1], cl + mov [ebp+var_8], al + shr eax, 3 + mov ecx, 0FFFFFFF7h + sub ecx, eax + and ecx, 3Fh + push edi + inc ecx + push ecx + shr edx, 10h + push offset aA_1 ; "" + mov ecx, esi + mov [ebp+var_2], dl + call sub_6D00E0 + push 8 + lea edx, [ebp+var_8] + push edx + mov ecx, esi + call sub_6D00E0 + mov edi, [ebp+arg_0] + xor eax, eax + +loc_6D0280: ; CODE XREF: sub_6D0210+8Ej + mov ecx, eax + and ecx, 3 + add ecx, ecx + mov edx, eax + sar edx, 2 + mov edx, [esi+edx*4+8] + add ecx, ecx + add ecx, ecx + shr edx, cl + inc eax + cmp eax, 10h + mov [eax+edi-1], dl + jl short loc_6D0280 + pop edi + pop esi + mov esp, ebp + pop ebp + retn 4 +sub_6D0210 endp + + +sub_6CEBE0 proc near ; CODE XREF: sub_4A72D0+49p + ; SFileVerifyMpqHeaderMD5+51p ... + +var_4 = dword ptr -4 +arg_0 = dword ptr 8 + + push ebp + mov ebp, esp + mov edx, [ebp+arg_0] + mov eax, 10h + push esi + lea esp, [esp+0] + +loc_6CEBF0: ; CODE XREF: sub_6CEBE0+22j + mov esi, [ecx] + cmp esi, [edx] + jnz short loc_6CEC14 + sub eax, 4 + add edx, 4 + add ecx, 4 + cmp eax, 4 + jnb short loc_6CEBF0 + xor eax, eax + xor edx, edx + test eax, eax + setz dl + mov al, dl + pop esi + pop ebp + retn 4 +; --------------------------------------------------------------------------- + +loc_6CEC14: ; CODE XREF: sub_6CEBE0+14j + movzx eax, byte ptr [ecx] + movzx esi, byte ptr [edx] + sub eax, esi + jnz short loc_6CEC40 + movzx eax, byte ptr [ecx+1] + movzx esi, byte ptr [edx+1] + sub eax, esi + jnz short loc_6CEC40 + movzx eax, byte ptr [ecx+2] + movzx esi, byte ptr [edx+2] + sub eax, esi + jnz short loc_6CEC40 + movzx eax, byte ptr [ecx+3] + movzx ecx, byte ptr [edx+3] + sub eax, ecx + +loc_6CEC40: ; CODE XREF: sub_6CEBE0+3Cj + ; sub_6CEBE0+48j ... + sar eax, 1Fh + or eax, 1 + xor edx, edx + test eax, eax + setz dl + mov al, dl + pop esi + pop ebp + retn 4 +sub_6CEBE0 endp + +SFileVerifyMpqHeaderMD5 proc near ; CODE XREF: SFileVerifyMpqHeader+6Bp + +var_68 = dword ptr -68h +var_64 = dword ptr -64h +var_60 = dword ptr -60h +var_5C = dword ptr -5Ch +var_58 = dword ptr -58h +var_54 = dword ptr -54h +var_10 = dword ptr -10h + + push ebp + mov ebp, esp + sub esp, 68h + push esi + mov esi, eax ; ESI = pointer to MPQ Header + xor eax, eax + push 0C0h + push esi + lea ecx, [ebp+var_68] + mov [ebp+var_64], eax + mov [ebp+var_68], eax + mov [ebp+var_60], 67452301h + mov [ebp+var_5C], 0EFCDAB89h + mov [ebp+var_58], 98BADCFEh + mov [ebp+var_54], 10325476h + call sub_6D00E0 + lea eax, [ebp+var_10] + push eax + lea ecx, [ebp+var_68] + call sub_6D0210 + add esi, 0C0h + push esi + lea ecx, [ebp+var_10] + call sub_6CEBE0 + pop esi + mov esp, ebp + pop ebp + retn +SFileVerifyMpqHeaderMD5 endp + + +_wow_SFileVerifyMpqHeaderMD5 proc + push ebp + mov ebp, esp + mov eax, [ebp+8] + call SFileVerifyMpqHeaderMD5 + mov esp, ebp + pop ebp + retn +_wow_SFileVerifyMpqHeaderMD5 endp + +END diff --git a/dep/StormLib/test/x86_starcraft_lzma.asm b/dep/StormLib/test/x86_starcraft_lzma.asm new file mode 100644 index 00000000000..bb13200b432 --- /dev/null +++ b/dep/StormLib/test/x86_starcraft_lzma.asm @@ -0,0 +1,11066 @@ +; +; LZMA compression code ripped from Starctaft II BEta +; Used while StormLib's LZMA implementation was tested against Starcraft compression +; Not used in StormLib. +; + +.686P +.MODEL FLAT +ASSUME FS: NOTHING + +.DATA + +;--------------------------------------------------------------------------- +; Data + +byte_4CB248 db 0, 0Bh, 0Bh, 0Bh ; indirect table for switch statement + db 0Bh, 0Bh, 0Bh, 0Bh + db 0Bh, 0Bh, 0Bh, 0Bh + db 0Bh, 0Bh, 0Bh, 0Bh + db 0Bh, 0Bh, 0Bh, 0Bh + db 0Bh, 0Bh, 0Bh, 0Bh + db 0Bh, 0Bh, 0Bh, 0Bh + db 0Bh, 0Bh, 0Bh, 0Bh + db 0Bh, 0Bh, 0Bh, 0Bh + db 0Bh, 0Bh, 0Bh, 0Bh + db 0Bh, 0Bh, 0Bh, 0Bh + db 0Bh, 0Bh, 0Bh, 0Bh + db 0Bh, 0Bh, 0Bh, 0Bh + db 0Bh, 0Bh, 0Bh, 0Bh + db 0Bh, 0Bh, 0Bh, 0Bh + db 0Bh, 0Bh, 0Bh, 0Bh + db 1, 2, 3, 0Bh + db 0Bh, 0Bh, 0Bh, 0Bh + db 0Bh, 0Bh, 0Bh, 0Bh + db 0Bh, 0Bh, 0Bh, 0Bh + db 4, 5, 6, 0Bh + db 0Bh, 0Bh, 0Bh, 0Bh + db 0Bh, 0Bh, 0Bh, 0Bh + db 0Bh, 0Bh, 0Bh, 0Bh + db 0Bh, 0Bh, 0Bh, 0Bh + db 0Bh, 0Bh, 0Bh, 0Bh + db 0Bh, 0Bh, 0Bh, 0Bh + db 0Bh, 0Bh, 0Bh, 0Bh + db 7, 0Bh, 0Bh, 0Bh + db 0Bh, 0Bh, 0Bh, 0Bh + db 0Bh, 0Bh, 0Bh, 0Bh + db 0Bh, 0Bh, 0Bh, 0Bh + db 8, 9, 0Bh, 0Bh + db 0Bh, 0Bh, 0Bh, 0Bh + db 0Bh, 0Bh, 0Bh, 0Bh + db 0Bh, 0Bh, 0Bh, 0Bh + db 0Ah + align 10h + +dword_544960 dd 0BB40E64Eh ; DATA XREF: sub_401C72+B +dword_553598 dd ? ; DATA XREF: sub_4CB8A0+9 + +off_50CD3C dd offset sub_4A0605 ; DATA XREF: sub_4A05F7+1o + ; .data:off_52A004o ... +dword_50CD40 dd 0E06D7363h ; DATA XREF: _CxxThrowException(x,x)+Eo + dd 1 + dd 0 + dd 0 + dd 3 + dd 19930520h + dd 0 + dd 0 + +; --------------------------------------------------------------------------- + +off_546E20 dd offset sub_4CDD70 ; DATA XREF: sub_4D0270:loc_4D0324o +off_546E24 dd offset sub_4CDD90 ; DATA XREF: sub_4CF810+53r +off_546E28 dd offset off_50CD3C ; DATA XREF: .rdata:off_51B888o + dd 0 + db '.?AUISequentialInStream@@',0 + db 0 + db 0 +off_546E4C dd offset off_50CD3C ; DATA XREF: .rdata:off_51B8C0o + dd 0 + db '.?AUISequentialOutStream@@',0 + db 0 +off_546E70 dd offset off_50CD3C ; DATA XREF: .rdata:off_51B8F8o + dd 0 + db '.?AUICompressCoder@@',0 + db 0 + db 0 + db 0 +off_546E90 dd offset off_50CD3C ; DATA XREF: .rdata:off_51B944o + dd 0 + db '.?AUICompressSetOutStream@@',0 +off_546EB4 dd offset off_50CD3C ; DATA XREF: .rdata:0051B96Co + dd 0 + db '.?AUICompressSetCoderProperties@@',0 + db 0 + db 0 +off_546EE0 dd offset off_50CD3C ; DATA XREF: .rdata:0051B9B8o + dd 0 + db '.?AUICompressWriteCoderProperties@@',0 + dd offset off_50CD3C + dd 0 + db '.?AUCSystemException@@',0 + db 0 + dd offset off_50CD3C + dd 0 + db '.?AUCOutBufferException@@',0 + db 0 + db 0 +off_546F50 dd offset off_50CD3C ; DATA XREF: .rdata:0051BA04o + dd 0 + db '.?AVCInStreamMemory@@',0 + db 0 + db 0 +off_546F70 dd offset off_50CD3C ; DATA XREF: .rdata:off_51BA4Co + dd 0 + db '.?AVCMyUnknownImp@@',0 +off_546F8C dd offset off_50CD3C ; DATA XREF: .rdata:0051BAA8o + dd 0 + db '.?AVCOutStreamMemory@@',0 + db 0 +off_546FAC dd offset off_50CD3C ; DATA XREF: .rdata:0051BAFCo + dd 0 + db '.?AVCEncoder@NLZMA@NCompress@@',0 + db 0 +off_546FD4 dd offset off_50CD3C ; DATA XREF: .rdata:off_51BBECo + dd 0 + db '.?AVCBaseState@NLZMA@NCompress@@',0 + db 0 + db 0 + db 0 + +; --------------------------------------------------------------------------- + +dword_51B960 dd 0 ; DATA XREF: .rdata:00517A64o + dd 0 + dd 0 + dd offset off_546EB4 + dd 0 ; offset dword_51B974 + +dword_51B9AC dd 0 ; DATA XREF: .rdata:00517A78o + dd 0 + dd 0 + dd offset off_546EE0 + dd 0 ;offset dword_51B9C0 + +dword_51B9F8 dd 0 ; DATA XREF: .rdata:00517A8Co + dd 0 + dd 0 + dd offset off_546F50 + dd 0 ; offset dword_51BA0C + +dword_51BA9C dd 0 ; DATA XREF: .rdata:00517AA0o + dd 0 + dd 0 + dd offset off_546F8C + dd 0 ; offset dword_51BAB0 + +dword_51BAF0 dd 0 ; DATA XREF: .rdata:00517AF8o + dd 0 + dd 0 + dd offset off_546FAC + dd 0 ; offset dword_51BB04 + +dword_51BC58 dd 0 ; DATA XREF: .rdata:00517AE0o + dd 4 + dd 0 + dd offset off_546FAC + dd 0 ; offset dword_51BB04 + +dword_51BC6C dd 0 ; DATA XREF: .rdata:00517ACCo + dd 8 + dd 0 + dd offset off_546FAC + dd 0 ; offset dword_51BB04 + +dword_51BC80 dd 0 ; DATA XREF: .rdata:00517AB8o + dd 0Ch + dd 0 + dd offset off_546FAC + dd 0 ; offset dword_51BB04 + +; --------------------------------------------------------------------------- + +dword_512730 dd 0 ; DATA XREF: sub_48DB4D+B9o +dword_512734 dd 0 ; DATA XREF: CCmdTarget::GetInterface(void const *)+2Dr +dword_512738 dd 0C0h ; DATA XREF: CCmdTarget::GetInterface(void const *)+38r +dword_51273C dd 46000000h ; DATA XREF: CCmdTarget::GetInterface(void const *)+43r + +dword_5535A0 dd ? ; DATA XREF: sub_4CF900:loc_4CF94Co +dword_5535A4 dd ? ; DATA XREF: .text:004DAF37w +dword_5535A8 dd ? ; DATA XREF: .text:004DAF3Cw +dword_5535AC dd ? ; DATA XREF: .text:004DAF41w + +dword_5535B0 dd ? ; DATA XREF: sub_4CF900+5Eo +dword_5535B4 dd ? ; DATA XREF: .text:004DAF17w +dword_5535B8 dd ? ; DATA XREF: .text:004DAF1Cw +dword_5535BC dd ? ; DATA XREF: .text:004DAF21w + +dword_5535C0 dd ? ; DATA XREF: sub_4CF900:loc_4CF98Fo +dword_5535C4 dd ? ; DATA XREF: .text:004DAEF7w +dword_5535C8 dd ? ; DATA XREF: .text:004DAEFCw +dword_5535CC dd ? ; DATA XREF: .text:004DAF01w + + +dword_526DD0 dd 0 ; DATA XREF: .text:loc_4CF6CBo + dd 0 + dd 0 + dd 0 ; offset dword_526DE0 + +kLiteralNextStates db 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 4, 5 +kMatchNextStates db 7, 7, 7, 7, 7, 7, 7, 0Ah, 0Ah, 0Ah, 0Ah, 0Ah +kRepNextStates db 8, 8, 8, 8, 8, 8, 8, 0Bh, 0Bh, 0Bh, 0Bh, 0Bh +kShortRepNextStates db 9, 9, 9, 9, 9, 9, 9, 0Bh, 0Bh, 0Bh, 0Bh, 0Bh + +dword_550998 dd 200h dup(?) +dword_551198 dd 800h dup(?) +dword_553198 dd 100h dup(?) + +ICompressSetOutStream_vftable dd offset __purecall ; DATA XREF: NCompress_NLZMA_CEncoder_CEncoder+2o + dd offset __purecall + dd offset __purecall + dd offset __purecall + dd offset __purecall + dd offset dword_51B960 +ICompressSetCoderProperties_vftable dd offset __purecall ; DATA XREF: NCompress_NLZMA_CEncoder_CEncoder+9o + dd offset __purecall + dd offset __purecall + dd offset __purecall + dd offset dword_51B9AC +ICompressWriteCoderProperties_vftable dd offset __purecall ; DATA XREF: NCompress_NLZMA_CEncoder_CEncoder+10o + dd offset __purecall + dd offset __purecall + dd offset __purecall + dd offset dword_51B9F8 +off_517A90 dd offset Interface1_QueryInterface + dd offset Interface1_AddRef + dd offset Interface1_Release + dd offset sub_4CCB20 + dd offset dword_51BA9C +off_517AA4 dd offset Interface1_QueryInterface ; DATA XREF: sub_4CF610+Eo + dd offset Interface1_AddRef + dd offset Interface2_Release + dd offset sub_4CCB90 + dd offset sub_4CF590 + dd offset dword_51BC80 +NCompress_NLZMA_CEncoder_vftable_ICompressWriteCoderProperties dd offset sub_4CFA50 ; DATA XREF: sub_4CF810+3Do + dd offset sub_4CFA10 + dd offset sub_4CFA70 + dd offset sub_4CDDB0 + dd offset dword_51BC6C +NCompress_NLZMA_CEncoder_vftable_ICompressSetCoderProperties dd offset ICompressSetCoderProperties_QueryInterface ; DATA XREF: sub_4CF810+36o + dd offset ICompressSetCoderProperties_AddRef + dd offset ICompressSetCoderProperties_Release + dd offset ICompressSetCoderProperties_SetCoderProperties + dd offset dword_51BC58 +NCompress_NLZMA_CEncoder_vftable_ICompressSetOutStream dd offset sub_4CFA20 ; DATA XREF: sub_4CF810+2Fo + dd offset sub_4CFA80 + dd offset sub_4CFA40 + dd offset sub_4CFA90 + dd offset sub_4CDE70 + dd offset dword_51BAF0 +NCompress_NLZMA_CEncoder_vftable dd offset sub_4CF900 ; DATA XREF: sub_4CF810+29o + dd offset sub_4CF9D0 + dd offset sub_4CF9E0 + dd offset CEncoder_Code + dd offset sub_4D0250 + +.CODE + +extrn _operator_new:PROC +extrn __allshr: PROC +extrn _free: PROC +extrn _memcmp: PROC +extrn _memcpy: PROC +extrn _memset: PROC +extrn ___report_gsfailure: PROC +extrn __purecall: PROC +VirtualAlloc PROTO STDCALL :DWORD,:DWORD,:DWORD,:DWORD +VirtualFree PROTO STDCALL :DWORD,:DWORD,:DWORD + +; --------------------------------------------------------------------------- + +; void __cdecl j__free(void *Memory) +; 004843B8 +j__free proc near ; CODE XREF: sub_401048+16p + ; .text:004010CFp ... + jmp _free +j__free endp + + +; --------------------------------------------------------------------------- + +; int __cdecl unknown_libname_324(void *Buf1, void *Buf2) +unknown_libname_324 proc near +; sub_48B7BA + +Buf1 = dword ptr 4 +Buf2 = dword ptr 8 + + push 10h ; Size + push [esp+4+Buf2] ; Buf2 + push [esp+8+Buf1] ; Buf1 + call _memcmp + add esp, 0Ch + neg eax + sbb eax, eax + inc eax + retn +unknown_libname_324 endp + +; --------------------------------------------------------------------------- + +sub_4A05F7 proc near ; CODE XREF: sub_4A0605+3p + push ecx + mov dword ptr [ecx], offset off_50CD3C + call sub_4A98B8 + pop ecx + retn +sub_4A05F7 endp + +; --------------------------------------------------------------------------- + +; int __thiscall sub_4A0605(void *Memory, char) +sub_4A0605 proc near ; DATA XREF: .rdata:off_50CD3Co + +arg_0 = byte ptr 4 + + push esi + mov esi, ecx + call sub_4A05F7 + test [esp+4+arg_0], 1 + jz short loc_4A061B + push esi ; Memory + call j__free + pop ecx + +loc_4A061B: ; CODE XREF: sub_4A0605+Dj + mov eax, esi + pop esi + retn 4 +sub_4A0605 endp + +; --------------------------------------------------------------------------- + +sub_4A0686 proc near ; CODE XREF: sub_401C72+49p + ; sub_40222F+15Cp ... + cmp ecx, dword_544960 + jnz short loc_4A0690 + retn +loc_4A0690: ; CODE XREF: sub_4A0686+6j + jmp ___report_gsfailure +sub_4A0686 endp + +; --------------------------------------------------------------------------- + +sub_4A98B8 proc near ; CODE XREF: sub_4A05F7+7p + + int 3 + retn +sub_4A98B8 endp + +; =============== S U B R O U T I N E ======================================= + + +sub_4CAEC0 proc near ; CODE XREF: CEncoder_GetOptimum+514p + +arg_0 = dword ptr 4 +arg_4 = dword ptr 8 +arg_8 = dword ptr 0Ch + + push esi + push edi + mov edi, [esp+8+arg_4] + lea eax, [edi-2] + cmp eax, 4 + mov esi, ecx + jb short loc_4CAED5 + mov eax, 3 + +loc_4CAED5: ; CODE XREF: sub_4CAEC0+Ej + mov edx, [esp+8+arg_0] + cmp edx, 80h + jnb short loc_4CAEEF + shl eax, 7 + add eax, edx + mov ecx, [esi+eax*4+33314h] + jmp short loc_4CAF25 +; --------------------------------------------------------------------------- + +loc_4CAEEF: ; CODE XREF: sub_4CAEC0+1Fj + mov ecx, 7FFFFh + sub ecx, edx + sar ecx, 1Fh + push ebx + and ecx, 0Ch + add ecx, 6 + mov ebx, edx + shr ebx, cl + shl eax, 5 + add eax, ecx + and edx, 0Fh + movzx ebx, byte ptr dword_551198[ebx] + lea eax, [ebx+eax*2] + mov ecx, [esi+eax*4+32F14h] + add ecx, [esi+edx*4+33B14h] + pop ebx + +loc_4CAF25: ; CODE XREF: sub_4CAEC0+2Dj + mov edx, [esp+8+arg_8] + imul edx, 110h + add edx, edi + mov eax, [esi+edx*4+295B8h] + pop edi + add eax, ecx + pop esi + retn 0Ch +sub_4CAEC0 endp + +; --------------------------------------------------------------------------- + align 10h + +loc_4CAF40: ; CODE XREF: .text:004DAED5j + push ecx + push ebx + push ebp + push esi + mov ebp, 2 + mov bl, 2 + push edi + mov byte ptr dword_551198, 0 + mov byte ptr dword_551198+1, 1 + mov [esp+10h], bl + mov edi, ebp + +loc_4CAF60: ; CODE XREF: .text:004CAF96j + mov ecx, edi + shr ecx, 1 + sub ecx, 1 + mov esi, 1 + shl esi, cl + test esi, esi + jbe short loc_4CAF89 + mov ecx, [esp+10h] + push esi + lea eax, dword_551198[ebp] + push ecx + push eax + call _memset + add esp, 0Ch + add ebp, esi + +loc_4CAF89: ; CODE XREF: .text:004CAF70j + add bl, 1 + add edi, 1 + cmp bl, 1Ah + mov [esp+10h], bl + jb short loc_4CAF60 + pop edi + pop esi + pop ebp + pop ebx + pop ecx + retn +; --------------------------------------------------------------------------- + align 10h +; =============== S U B R O U T I N E ======================================= + +sub_4CAFA0 proc near ; CODE XREF: sub_4CAFC0+90p + +arg_0 = dword ptr 4 + + mov eax, [esp+arg_0] + lea ecx, [eax-61h] + cmp cx, 19h + ja short locret_4CAFB2 + add eax, 0FFE0h + +locret_4CAFB2: ; CODE XREF: sub_4CAFA0+Bj + retn +sub_4CAFA0 endp + +; --------------------------------------------------------------------------- + align 10h + +; =============== S U B R O U T I N E ======================================= + +sub_4CAFC0 proc near ; CODE XREF: ICompressSetCoderProperties_SetCoderProperties+A5p + movzx ecx, word ptr [eax] + lea edx, [ecx-61h] + cmp dx, 19h + ja short loc_4CAFD2 + add ecx, 0FFE0h + +loc_4CAFD2: ; CODE XREF: sub_4CAFC0+Aj + add eax, 2 + cmp cx, 48h + jnz short loc_4CB01B + movzx ecx, word ptr [eax] + lea edx, [ecx-61h] + cmp dx, 19h + ja short loc_4CAFED + add ecx, 0FFE0h + +loc_4CAFED: ; CODE XREF: sub_4CAFC0+25j + add eax, 2 + cmp cx, 43h + jz short loc_4CAFF9 + +loc_4CAFF6: ; CODE XREF: sub_4CAFC0+44j + ; sub_4CAFC0+4Bj ... + xor eax, eax + retn +; --------------------------------------------------------------------------- + +loc_4CAFF9: ; CODE XREF: sub_4CAFC0+34j + movzx ecx, word ptr [eax] + sub ecx, 30h + lea edx, [ecx-4] + test edx, edx + ja short loc_4CAFF6 + cmp word ptr [eax+2], 0 + jnz short loc_4CAFF6 + mov dword ptr [ebx], 0 + mov [edi], ecx + mov eax, 1 + retn +; --------------------------------------------------------------------------- + +loc_4CB01B: ; CODE XREF: sub_4CAFC0+19j + cmp cx, 42h + jnz short loc_4CAFF6 + movzx ecx, word ptr [eax] + lea edx, [ecx-61h] + cmp dx, 19h + ja short loc_4CB033 + add ecx, 0FFE0h + +loc_4CB033: ; CODE XREF: sub_4CAFC0+6Bj + add eax, 2 + cmp cx, 54h + jnz short loc_4CAFF6 + push esi + movzx esi, word ptr [eax] + sub esi, 30h + lea ecx, [esi-2] + cmp ecx, 2 + ja short loc_4CB06C + movzx eax, word ptr [eax+2] + push eax + call sub_4CAFA0 + add esp, 4 + test ax, ax + jnz short loc_4CB06C + mov dword ptr [ebx], 1 + mov [edi], esi + mov eax, 1 + pop esi + retn +; --------------------------------------------------------------------------- + +loc_4CB06C: ; CODE XREF: sub_4CAFC0+89j + ; sub_4CAFC0+9Bj + xor eax, eax + pop esi + retn +sub_4CAFC0 endp + + +ICompressSetCoderProperties_SetCoderProperties proc near ; DATA XREF: .rdata:00517ADCo + +var_4 = dword ptr -4 +pThis = dword ptr 4 +propIDs = dword ptr 8 +properties = dword ptr 0Ch +numProperties = dword ptr 10h + + push ecx + push ebx + push ebp + xor edx, edx + cmp [esp+0Ch+numProperties], edx + push esi + push edi + mov [esp+14h+var_4], edx + jbe loc_4CB20D + mov esi, [esp+14h+properties] + mov ebp, [esp+14h+pThis] + lea ecx, [ecx+0] + +loc_4CB090: ; CODE XREF: sub_4CB070+197j + mov eax, [esp+14h+propIDs] + mov eax, [eax+edx*4] + add eax, 0FFFFFC00h + cmp eax, 90h ; switch 145 cases + ja loc_4CB131 ; default + ; jumptable 004CB0AE cases 1-63,67-79,83-111,113-127,130-143 + movzx ecx, ds:byte_4CB248[eax] + jmp ds:off_4CB218[ecx*4] ; switch jump + +loc_4CB0B5: ; DATA XREF: .text:off_4CB218o + cmp word ptr [esi], 13h ; jumptable 004CB0AE case 80 + jnz short loc_4CB131 ; default + ; jumptable 004CB0AE cases 1-63,67-79,83-111,113-127,130-143 + mov eax, [esi+8] + lea ecx, [eax-5] + cmp ecx, 10Ch + ja short loc_4CB131 ; default + ; jumptable 004CB0AE cases 1-63,67-79,83-111,113-127,130-143 + mov [ebp+32EF0h], eax + jmp loc_4CB1F9 +; --------------------------------------------------------------------------- + +loc_4CB0D4: ; CODE XREF: sub_4CB070+3Ej + ; DATA XREF: .text:off_4CB218o + cmp word ptr [esi], 13h ; jumptable 004CB0AE case 82 + jnz short loc_4CB131 ; default + ; jumptable 004CB0AE cases 1-63,67-79,83-111,113-127,130-143 + mov eax, [esi+8] + mov [ebp+33B88h], eax + jmp loc_4CB1F9 +; --------------------------------------------------------------------------- + +loc_4CB0E8: ; CODE XREF: sub_4CB070+3Ej + ; DATA XREF: .text:off_4CB218o + cmp word ptr [esi], 13h ; jumptable 004CB0AE case 112 + jnz short loc_4CB131 ; default + ; jumptable 004CB0AE cases 1-63,67-79,83-111,113-127,130-143 + cmp dword ptr [esi+8], 0 + setz cl + mov [ebp+32EECh], cl + jmp loc_4CB1F9 +; --------------------------------------------------------------------------- + +loc_4CB100: ; CODE XREF: sub_4CB070+3Ej + ; DATA XREF: .text:off_4CB218o + cmp word ptr [esi], 8 ; jumptable 004CB0AE case 81 + jnz short loc_4CB131 ; default + ; jumptable 004CB0AE cases 1-63,67-79,83-111,113-127,130-143 + mov eax, [esi+8] + lea edi, [ebp+0C4h] + lea ebx, [ebp+0CCh] + call sub_4CAFC0 + test eax, eax + jz short loc_4CB131 ; default + ; jumptable 004CB0AE cases 1-63,67-79,83-111,113-127,130-143 + mov edx, [esp+14h+var_4] + jmp loc_4CB1F9 +; --------------------------------------------------------------------------- + +loc_4CB127: ; CODE XREF: sub_4CB070+3Ej + ; DATA XREF: .text:off_4CB218o + cmp word ptr [esi], 0Bh ; jumptable 004CB0AE case 128 + jz loc_4CB1F9 + +loc_4CB131: ; CODE XREF: sub_4CB070+31j + ; sub_4CB070+3Ej ... + pop edi ; default + ; jumptable 004CB0AE cases 1-63,67-79,83-111,113-127,130-143 + pop esi + pop ebp + mov eax, 80070057h + pop ebx + pop ecx + retn 10h +; --------------------------------------------------------------------------- + +loc_4CB13E: ; CODE XREF: sub_4CB070+3Ej + ; DATA XREF: .text:off_4CB218o + cmp word ptr [esi], 13h ; jumptable 004CB0AE case 129 + jnz short loc_4CB131 ; default + ; jumptable 004CB0AE cases 1-63,67-79,83-111,113-127,130-143 + jmp loc_4CB1F9 +; --------------------------------------------------------------------------- + +loc_4CB149: ; CODE XREF: sub_4CB070+3Ej + ; DATA XREF: .text:off_4CB218o + cmp word ptr [esi], 13h ; jumptable 004CB0AE case 0 + jnz short loc_4CB131 ; default + ; jumptable 004CB0AE cases 1-63,67-79,83-111,113-127,130-143 + mov eax, [esi+8] + lea ecx, [eax-1] + cmp ecx, 3FFFFFFFh + ja short loc_4CB131 ; default + ; jumptable 004CB0AE cases 1-63,67-79,83-111,113-127,130-143 + mov [ebp+33B64h], eax + xor ecx, ecx + +loc_4CB165: ; CODE XREF: sub_4CB070+106j + mov edi, 1 + shl edi, cl + cmp eax, edi + jbe short loc_4CB178 + add ecx, 1 + cmp ecx, 1Eh + jb short loc_4CB165 + +loc_4CB178: ; CODE XREF: sub_4CB070+FEj + lea eax, [ecx+ecx] + mov [ebp+33B50h], eax + jmp short loc_4CB1F9 +; --------------------------------------------------------------------------- + +loc_4CB183: ; CODE XREF: sub_4CB070+3Ej + ; DATA XREF: .text:off_4CB218o + cmp word ptr [esi], 13h ; jumptable 004CB0AE case 64 + jnz short loc_4CB131 ; default + ; jumptable 004CB0AE cases 1-63,67-79,83-111,113-127,130-143 + mov ecx, [esi+8] + cmp ecx, 4 + ja short loc_4CB131 ; default + ; jumptable 004CB0AE cases 1-63,67-79,83-111,113-127,130-143 + mov eax, 1 + shl eax, cl + mov [ebp+33B54h], ecx + sub eax, 1 + mov [ebp+33B58h], eax + jmp short loc_4CB1F9 +; --------------------------------------------------------------------------- + +loc_4CB1A9: ; CODE XREF: sub_4CB070+3Ej + ; DATA XREF: .text:off_4CB218o + cmp word ptr [esi], 13h ; jumptable 004CB0AE case 66 + jnz short loc_4CB131 ; default + ; jumptable 004CB0AE cases 1-63,67-79,83-111,113-127,130-143 + mov eax, [esi+8] + cmp eax, 4 + ja loc_4CB131 ; default + ; jumptable 004CB0AE cases 1-63,67-79,83-111,113-127,130-143 + mov [ebp+33B5Ch], eax + jmp short loc_4CB1F9 +; --------------------------------------------------------------------------- + +loc_4CB1C3: ; CODE XREF: sub_4CB070+3Ej + ; DATA XREF: .text:off_4CB218o + cmp word ptr [esi], 13h ; jumptable 004CB0AE case 65 + jnz loc_4CB131 ; default + ; jumptable 004CB0AE cases 1-63,67-79,83-111,113-127,130-143 + mov eax, [esi+8] + cmp eax, 8 + ja loc_4CB131 ; default + ; jumptable 004CB0AE cases 1-63,67-79,83-111,113-127,130-143 + mov [ebp+33B60h], eax + jmp short loc_4CB1F9 +; --------------------------------------------------------------------------- + +loc_4CB1E1: ; CODE XREF: sub_4CB070+3Ej + ; DATA XREF: .text:off_4CB218o + cmp word ptr [esi], 0Bh ; jumptable 004CB0AE case 144 + jnz loc_4CB131 ; default + ; jumptable 004CB0AE cases 1-63,67-79,83-111,113-127,130-143 + cmp word ptr [esi+8], 0FFFFh + setz cl + mov [ebp+33B8Ch], cl + +loc_4CB1F9: ; CODE XREF: sub_4CB070+5Fj + ; sub_4CB070+73j ... + add edx, 1 + add esi, 10h + cmp edx, [esp+14h+numProperties] + mov [esp+14h+var_4], edx + jb loc_4CB090 + +loc_4CB20D: ; CODE XREF: sub_4CB070+Fj + pop edi + pop esi + pop ebp + xor eax, eax + pop ebx + pop ecx + retn 10h + +off_4CB218 dd offset loc_4CB149, offset loc_4CB183, offset loc_4CB1C3 + dd offset loc_4CB1A9, offset loc_4CB0B5, offset loc_4CB100 ; jump table for switch statement + dd offset loc_4CB0D4, offset loc_4CB0E8, offset loc_4CB127 + dd offset loc_4CB13E, offset loc_4CB1E1, offset loc_4CB131 + +ICompressSetCoderProperties_SetCoderProperties endp + +; =============== S U B R O U T I N E ======================================= + +sub_4CB2E0 proc near ; CODE XREF: CEncoder_GetOptimum+1199p + +arg_0 = dword ptr 4 +arg_4 = dword ptr 8 + + push ebx + push ebp + push esi + mov esi, [esp+0Ch+arg_4] + lea eax, [esi+esi*4] + lea edx, [ecx+eax*8] + mov [ecx+32F08h], esi + mov eax, [edx+100h] + mov ebx, [edx+104h] + push edi + +loc_4CB300: ; CODE XREF: sub_4CB2E0+A6j + lea edx, [esi+esi*4] + cmp byte ptr [ecx+edx*8+0F1h], 0 + lea edi, [ecx+edx*8] + jz short loc_4CB359 + lea edx, [eax+eax*4+1Eh] + lea edx, [ecx+edx*8] + mov dword ptr [edx+14h], 0FFFFFFFFh + mov byte ptr [edx+1], 0 + lea edx, [eax+eax*4] + lea edx, [ecx+edx*8] + lea ebp, [eax-1] + mov [edx+100h], ebp + cmp byte ptr [edi+0F2h], 0 + jz short loc_4CB359 + mov byte ptr [edx+0C9h], 0 + mov ebp, [edi+0F4h] + mov [edx+0D8h], ebp + mov edi, [edi+0F8h] + mov [edx+0DCh], edi + +loc_4CB359: ; CODE XREF: sub_4CB2E0+2Ej + ; sub_4CB2E0+58j + lea edx, [eax+eax*4] + add edx, edx + add edx, edx + add edx, edx + mov edi, eax + test edi, edi + mov eax, [edx+ecx+100h] + mov ebp, ebx + mov ebx, [edx+ecx+104h] + mov [edx+ecx+100h], esi + mov [edx+ecx+104h], ebp + mov esi, edi + jnz loc_4CB300 + mov eax, [ecx+104h] + mov edx, [esp+10h+arg_0] + pop edi + pop esi + mov [edx], eax + mov eax, [ecx+100h] + pop ebp + mov [ecx+32F0Ch], eax + pop ebx + retn 8 +sub_4CB2E0 endp + +; --------------------------------------------------------------------------- + align 10h +; =============== S U B R O U T I N E ======================================= + +sub_4CB3B0 proc near ; CODE XREF: CEncoder_GetOptimumFast+2Dp + ; CEncoder_GetOptimumFast+28Fp ... + +arg_0 = dword ptr 4 + + push ebx + push ebp + push esi + mov esi, ecx + mov ecx, [esi+80h] + mov edx, [esi+78h] + lea eax, [esi+32660h] + push eax + push ecx + xor ebx, ebx + call edx + mov ebp, [esp+14h+arg_0] + add esp, 8 + test eax, eax + mov [ebp+0], eax + jbe short loc_4CB446 + mov ebx, [esi+eax*4+32658h] + cmp ebx, [esi+32EF8h] + jnz short loc_4CB446 + mov eax, [esi+80h] + mov ecx, [esi+70h] + push edi + push eax + call ecx + mov edx, [esi+80h] + mov edi, eax + mov eax, [esi+74h] + push edx + add edi, 1 + call eax + mov ecx, [ebp+0] + mov ecx, [esi+ecx*4+3265Ch] + add esp, 8 + sub eax, 1 + add ecx, 1 + cmp edi, 111h + jbe short loc_4CB425 + mov edi, 111h + +loc_4CB425: ; CODE XREF: sub_4CB3B0+6Ej + mov edx, eax + sub edx, ecx + cmp ebx, edi + jnb short loc_4CB445 + mov ebp, edx + lea ecx, [eax+ebx] + sub ebp, eax + +loc_4CB434: ; CODE XREF: sub_4CB3B0+93j + mov dl, [ecx] + cmp dl, [ecx+ebp] + jnz short loc_4CB445 + add ebx, 1 + add ecx, 1 + cmp ebx, edi + jb short loc_4CB434 + +loc_4CB445: ; CODE XREF: sub_4CB3B0+7Bj + ; sub_4CB3B0+89j + pop edi + +loc_4CB446: ; CODE XREF: sub_4CB3B0+26j + ; sub_4CB3B0+35j + add dword ptr [esi+32F04h], 1 + pop esi + pop ebp + mov eax, ebx + pop ebx + retn 4 +sub_4CB3B0 endp + +; --------------------------------------------------------------------------- + align 10h +; =============== S U B R O U T I N E ======================================= + +CEncoder_GetOptimumFast proc near ; CODE XREF: CEncoder_CodeOneBlock+1F4p + +var_28 = dword ptr -28h +var_24 = dword ptr -24h +var_20 = dword ptr -20h +var_1C = dword ptr -1Ch +var_18 = dword ptr -18h +var_14 = dword ptr -14h +var_10 = dword ptr -10h +arg_0 = dword ptr 4 + + sub esp, 28h + push ebx + push esi + push edi + mov edi, ecx + mov eax, [edi+80h] + mov ecx, [edi+70h] + push eax + call ecx + add esp, 4 + cmp byte ptr [edi+32F10h], 0 + mov esi, eax + mov [esp+34h+var_24], esi + jnz short loc_4CB498 + lea edx, [esp+34h+var_20] + push edx + mov ecx, edi + call sub_4CB3B0 + mov ebx, [esp+34h+var_20] + jmp short loc_4CB4AF +; --------------------------------------------------------------------------- + +loc_4CB498: ; CODE XREF: CEncoder_GetOptimumFast+24j + mov ebx, [edi+32F00h] + mov eax, [edi+32EFCh] + mov [esp+34h+var_20], ebx + mov byte ptr [edi+32F10h], 0 + +loc_4CB4AF: ; CODE XREF: CEncoder_GetOptimumFast+36j + mov ecx, [edi+80h] + mov edx, [edi+74h] + push ecx + mov [esp+38h+var_28], eax + call edx + add esp, 4 + sub eax, 1 + cmp esi, 111h + jbe loc_4CB55E + mov [esp+34h+var_24], 111h + +loc_4CB4D9: ; CODE XREF: CEncoder_GetOptimumFast+101j + push ebp + xor ebp, ebp + lea ecx, [edi+14h] + mov [esp+38h+var_18], ebp + mov [esp+38h+var_14], ebp + mov [esp+38h+var_1C], ecx + jmp short loc_4CB4F0 +; --------------------------------------------------------------------------- + align 10h + +loc_4CB4F0: ; CODE XREF: CEncoder_GetOptimumFast+8Bj + ; CEncoder_GetOptimumFast+132j + mov edx, [esp+38h+var_1C] + mov ecx, eax + sub ecx, [edx] + mov dl, [eax] + sub ecx, 1 + cmp dl, [ecx] + jnz short loc_4CB57F + mov dl, [eax+1] + cmp dl, [ecx+1] + jnz short loc_4CB57F + mov esi, 2 + cmp [esp+38h+var_24], esi + jbe short loc_4CB537 + lea edx, [eax+2] + sub ecx, eax + lea esp, [esp+0] + +loc_4CB520: ; CODE XREF: CEncoder_GetOptimumFast+D1j + mov bl, [edx] + cmp bl, [ecx+edx] + jnz short loc_4CB533 + add esi, 1 + add edx, 1 + cmp esi, [esp+38h+var_24] + jb short loc_4CB520 + +loc_4CB533: ; CODE XREF: CEncoder_GetOptimumFast+C5j + mov ebx, [esp+38h+var_20] + +loc_4CB537: ; CODE XREF: CEncoder_GetOptimumFast+B2j + cmp esi, [edi+32EF8h] + jnb short loc_4CB5B9 + mov edx, [esp+38h+var_14] + lea ecx, ds:0[ebp*4] + mov [esp+ecx+38h+var_10], esi + cmp esi, [esp+edx+38h+var_10] + jbe short loc_4CB587 + mov [esp+38h+var_18], ebp + mov [esp+38h+var_14], ecx + jmp short loc_4CB587 +; --------------------------------------------------------------------------- + +loc_4CB55E: ; CODE XREF: CEncoder_GetOptimumFast+6Bj + cmp esi, 2 + jnb loc_4CB4D9 + mov eax, [esp+34h+arg_0] + pop edi + pop esi + mov dword ptr [eax], 0FFFFFFFFh + mov eax, 1 + pop ebx + add esp, 28h + retn 4 +; --------------------------------------------------------------------------- + +loc_4CB57F: ; CODE XREF: CEncoder_GetOptimumFast+9Fj + ; CEncoder_GetOptimumFast+A7j + mov [esp+ebp*4+38h+var_10], 0 + +loc_4CB587: ; CODE XREF: CEncoder_GetOptimumFast+F2j + ; CEncoder_GetOptimumFast+FCj + add [esp+38h+var_1C], 4 + add ebp, 1 + cmp ebp, 4 + jb loc_4CB4F0 + mov esi, [esp+38h+var_28] + cmp esi, [edi+32EF8h] + jb short loc_4CB5EC + mov eax, [edi+ebx*4+3265Ch] + mov ecx, [esp+38h+arg_0] + add eax, 4 + mov [ecx], eax + jmp loc_4CB69A +; --------------------------------------------------------------------------- + +loc_4CB5B9: ; CODE XREF: CEncoder_GetOptimumFast+DDj + mov eax, [esp+38h+arg_0] + mov [eax], ebp + lea eax, [esi-1] + test eax, eax + jz loc_4CB82E + mov ecx, [edi+80h] + mov edx, [edi+7Ch] + add [edi+32F04h], eax + push eax + push ecx + call edx + add esp, 8 + pop ebp + pop edi + mov eax, esi + pop esi + pop ebx + add esp, 28h + retn 4 +; --------------------------------------------------------------------------- + +loc_4CB5EC: ; CODE XREF: CEncoder_GetOptimumFast+142j + xor ebp, ebp + cmp esi, 2 + mov [esp+38h+var_20], ebp + jb short loc_4CB65A + cmp ebx, 2 + mov ecx, [edi+ebx*4+3265Ch] + mov [esp+38h+var_20], ecx + jbe short loc_4CB63F + lea eax, [edi+ebx*4+32654h] + mov edi, edi + +loc_4CB610: ; CODE XREF: CEncoder_GetOptimumFast+1DDj + mov edx, [eax-4] + add edx, 1 + cmp esi, edx + jnz short loc_4CB63F + mov ecx, [esp+38h+var_20] + shr ecx, 7 + cmp ecx, [eax] + jbe short loc_4CB63F + mov edx, [eax-4] + mov ecx, [eax] + sub eax, 8 + sub ebx, 2 + cmp ebx, 2 + mov [esp+38h+var_28], edx + mov [esp+38h+var_20], ecx + mov esi, edx + ja short loc_4CB610 + +loc_4CB63F: ; CODE XREF: CEncoder_GetOptimumFast+1A5j + ; CEncoder_GetOptimumFast+1B8j ... + cmp esi, 2 + jnz short loc_4CB656 + cmp [esp+38h+var_20], 80h + jb short loc_4CB656 + mov [esp+38h+var_28], 1 + +loc_4CB656: ; CODE XREF: CEncoder_GetOptimumFast+1E2j + ; CEncoder_GetOptimumFast+1ECj + mov ebp, [esp+38h+var_20] + +loc_4CB65A: ; CODE XREF: CEncoder_GetOptimumFast+195j + mov edx, [esp+38h+var_18] + mov esi, [esp+edx*4+38h+var_10] + cmp esi, 2 + mov ebx, [esp+38h+var_28] + jb short loc_4CB6C7 + lea eax, [esi+1] + cmp eax, ebx + jnb short loc_4CB690 + lea ecx, [esi+2] + cmp ecx, ebx + jb short loc_4CB681 + cmp ebp, 200h + ja short loc_4CB690 + +loc_4CB681: ; CODE XREF: CEncoder_GetOptimumFast+217j + lea edx, [esi+3] + cmp edx, ebx + jb short loc_4CB6C7 + cmp ebp, 8000h + jbe short loc_4CB6C7 + +loc_4CB690: ; CODE XREF: CEncoder_GetOptimumFast+210j + ; CEncoder_GetOptimumFast+21Fj + mov eax, [esp+38h+arg_0] + mov ecx, [esp+38h+var_18] + mov [eax], ecx + +loc_4CB69A: ; CODE XREF: CEncoder_GetOptimumFast+154j + lea eax, [esi-1] + test eax, eax + jz loc_4CB82E + mov edx, [edi+80h] + add [edi+32F04h], eax + push eax + mov eax, [edi+7Ch] + push edx + call eax + add esp, 8 + pop ebp + pop edi + mov eax, esi + pop esi + pop ebx + add esp, 28h + retn 4 +; --------------------------------------------------------------------------- + +loc_4CB6C7: ; CODE XREF: CEncoder_GetOptimumFast+209j + ; CEncoder_GetOptimumFast+226j ... + cmp ebx, 2 + jb short loc_4CB73E + cmp [esp+38h+var_24], 2 + jbe short loc_4CB73E + mov ecx, [edi+80h] + mov edx, [edi+70h] + push ecx + call edx + add esp, 4 + lea esi, [edi+32F00h] + push esi + mov ecx, edi + mov [esp+3Ch+var_24], eax + call sub_4CB3B0 + cmp eax, 2 + mov [edi+32EFCh], eax + jb short loc_4CB757 + cmp eax, ebx + mov ecx, [esi] + mov edx, [edi+ecx*4+3265Ch] + jb short loc_4CB710 + cmp edx, ebp + jb short loc_4CB737 + +loc_4CB710: ; CODE XREF: CEncoder_GetOptimumFast+2AAj + lea ecx, [ebx+1] + cmp eax, ecx + jnz short loc_4CB722 + mov esi, edx + shr esi, 7 + cmp esi, ebp + jbe short loc_4CB737 + cmp eax, ecx + +loc_4CB722: ; CODE XREF: CEncoder_GetOptimumFast+2B5j + ja short loc_4CB737 + add eax, 1 + cmp eax, ebx + jb short loc_4CB757 + cmp ebx, 3 + jb short loc_4CB757 + shr ebp, 7 + cmp ebp, edx + jbe short loc_4CB757 + +loc_4CB737: ; CODE XREF: CEncoder_GetOptimumFast+2AEj + ; CEncoder_GetOptimumFast+2BEj ... + mov byte ptr [edi+32F10h], 1 + +loc_4CB73E: ; CODE XREF: CEncoder_GetOptimumFast+26Aj + ; CEncoder_GetOptimumFast+271j + mov edx, [esp+38h+arg_0] + pop ebp + pop edi + pop esi + mov dword ptr [edx], 0FFFFFFFFh + mov eax, 1 + pop ebx + add esp, 28h + retn 4 +; --------------------------------------------------------------------------- + +loc_4CB757: ; CODE XREF: CEncoder_GetOptimumFast+29Dj + ; CEncoder_GetOptimumFast+2C9j ... + mov eax, [edi+80h] + mov ecx, [edi+74h] + push eax + call ecx + lea ecx, [edi+14h] + add esp, 4 + sub eax, 1 + mov [esp+38h+var_18], 0 + mov ebx, ecx + +loc_4CB776: ; CODE XREF: CEncoder_GetOptimumFast+39Aj + mov dl, [eax+1] + mov ecx, eax + sub ecx, [ebx] + sub ecx, 1 + cmp dl, [ecx+1] + jnz short loc_4CB7DD + mov dl, [eax+2] + cmp dl, [ecx+2] + lea ebp, [eax+2] + jnz short loc_4CB7DD + mov esi, 2 + cmp [esp+38h+var_24], esi + jbe short loc_4CB7B4 + mov edx, ebp + mov ebp, ecx + sub ebp, eax + +loc_4CB7A1: ; CODE XREF: CEncoder_GetOptimumFast+352j + mov cl, [edx] + cmp cl, [edx+ebp] + jnz short loc_4CB7B4 + add esi, 1 + add edx, 1 + cmp esi, [esp+38h+var_24] + jb short loc_4CB7A1 + +loc_4CB7B4: ; CODE XREF: CEncoder_GetOptimumFast+339j + ; CEncoder_GetOptimumFast+346j + add esi, 1 + cmp esi, [esp+38h+var_28] + jb short loc_4CB7E9 + mov eax, [esp+38h+arg_0] + pop ebp + mov byte ptr [edi+32F10h], 1 + pop edi + pop esi + mov dword ptr [eax], 0FFFFFFFFh + mov eax, 1 + pop ebx + add esp, 28h + retn 4 +; --------------------------------------------------------------------------- + +loc_4CB7DD: ; CODE XREF: CEncoder_GetOptimumFast+323j + ; CEncoder_GetOptimumFast+32Ej + mov edx, [esp+38h+var_18] + mov [esp+edx*4+38h+var_10], 0 + +loc_4CB7E9: ; CODE XREF: CEncoder_GetOptimumFast+35Bj + mov ecx, [esp+38h+var_18] + add ecx, 1 + add ebx, 4 + cmp ecx, 4 + mov [esp+38h+var_18], ecx + jb loc_4CB776 + mov esi, [esp+38h+var_28] + mov ecx, [esp+38h+var_20] + mov edx, [esp+38h+arg_0] + add ecx, 4 + lea eax, [esi-2] + test eax, eax + mov [edx], ecx + jz short loc_4CB82E + add [edi+32F04h], eax + mov ecx, [edi+7Ch] + push eax + mov eax, [edi+80h] + push eax + call ecx + add esp, 8 + +loc_4CB82E: ; CODE XREF: CEncoder_GetOptimumFast+164j + ; CEncoder_GetOptimumFast+23Fj ... + pop ebp + pop edi + mov eax, esi + pop esi + pop ebx + add esp, 28h + retn 4 +CEncoder_GetOptimumFast endp + +; =============== S U B R O U T I N E ======================================= + +sub_4CB8A0 proc near ; CODE XREF: sub_4CD940+37p + +arg_0 = dword ptr 4 + + push edi + mov edi, [esp+4+arg_0] + test edi, edi + jz short loc_4CB8EB + mov eax, dword_553598 + test eax, eax + jnz short loc_4CB8DD + push 0Ch ; Size + call _operator_new ; operator new(uint) + add esp, 4 + test eax, eax + jz short loc_4CB8D6 + mov dword ptr [eax], 0 + mov dword ptr [eax+4], 0 + mov dword ptr [eax+8], 0 + jmp short loc_4CB8D8 +; --------------------------------------------------------------------------- + +loc_4CB8D6: ; CODE XREF: sub_4CB8A0+1Ej + xor eax, eax + +loc_4CB8D8: ; CODE XREF: sub_4CB8A0+34j + mov dword_553598, eax + +loc_4CB8DD: ; CODE XREF: sub_4CB8A0+10j + mov eax, [eax] + test eax, eax + jz short loc_4CB8EB + push edi + call eax + add esp, 4 + pop edi + retn +; --------------------------------------------------------------------------- + +loc_4CB8EB: ; CODE XREF: sub_4CB8A0+7j + ; sub_4CB8A0+41j + xor eax, eax + pop edi + retn +sub_4CB8A0 endp + +; --------------------------------------------------------------------------- + align 10h +; =============== S U B R O U T I N E ======================================= + +sub_4CB8F0 proc near ; CODE XREF: sub_4CBA60+85p + +arg_0 = dword ptr 4 +arg_4 = dword ptr 8 +arg_8 = dword ptr 0Ch + + push esi + mov esi, [esp+4+arg_0] + push edi + mov edi, [esi+44h] + add edi, [esi+40h] + add edi, [esp+8+arg_4] + cmp dword ptr [esi+4Ch], 0 + jz short loc_4CB911 + mov [esi+3Ch], edi + pop edi + mov eax, 1 + pop esi + retn +; --------------------------------------------------------------------------- + +loc_4CB911: ; CODE XREF: sub_4CB8F0+14j + mov eax, [esi+30h] + test eax, eax + jz short loc_4CB91D + cmp [esi+3Ch], edi + jz short loc_4CB93E + +loc_4CB91D: ; CODE XREF: sub_4CB8F0+26j + push ebx + mov ebx, [esp+0Ch+arg_8] + push eax + mov eax, [ebx+4] + call eax + mov dword ptr [esi+30h], 0 + mov [esi+3Ch], edi + mov ecx, [ebx] + push edi + call ecx + add esp, 8 + mov [esi+30h], eax + pop ebx + +loc_4CB93E: ; CODE XREF: sub_4CB8F0+2Bj + xor eax, eax + cmp [esi+30h], eax + pop edi + setnz al + pop esi + retn +sub_4CB8F0 endp + +; --------------------------------------------------------------------------- + align 10h + +loc_4CB950: ; DATA XREF: sub_4CCAA0+1Co + mov eax, [esp+4] + mov eax, [eax] + retn +; --------------------------------------------------------------------------- + align 10h + +loc_4CB960: ; DATA XREF: sub_4CCAA0+Eo + mov eax, [esp+4] + mov ecx, [eax] + mov edx, [esp+8] + mov al, [edx+ecx] + retn +; --------------------------------------------------------------------------- + align 10h +loc_4CB970: ; DATA XREF: sub_4CCAA0+15o + mov ecx, [esp+4] + +; =============== S U B R O U T I N E ======================================= + +; Attributes: library function + +; public: int __thiscall CRect::Height(void)const +?Height@CRect@@QBEHXZ proc near + mov eax, [ecx+0Ch] + sub eax, [ecx+4] + retn +?Height@CRect@@QBEHXZ endp + +; --------------------------------------------------------------------------- + align 10h +; =============== S U B R O U T I N E ======================================= + +sub_4CB980 proc near ; CODE XREF: sub_4CBC80+46p + ; sub_4CBD50+61p + +arg_0 = dword ptr 4 + + push esi + mov esi, [esp+4+arg_0] + cmp dword ptr [esi+38h], 0 + jnz short loc_4CB9F0 + cmp dword ptr [esi+68h], 0 + jnz short loc_4CB9F0 + mov eax, [esi] + sub eax, [esi+4] + mov ecx, [esi+30h] + add eax, [esi+0Ch] + sub ecx, eax + add ecx, [esi+3Ch] + jz short loc_4CB9F0 + push edi + +loc_4CB9A4: ; CODE XREF: sub_4CB980+63j + mov edx, [esi+34h] + lea edi, [esp+8+arg_0] + push edi + push ecx + push eax + mov eax, [edx] + push edx + call eax + add esp, 10h + test eax, eax + mov [esi+68h], eax + jnz short loc_4CB9EF + mov eax, [esp+8+arg_0] + test eax, eax + jz short loc_4CB9E8 + add [esi+0Ch], eax + mov eax, [esi+0Ch] + sub eax, [esi+4] + cmp eax, [esi+44h] + ja short loc_4CB9EF + mov eax, [esi] + sub eax, [esi+4] + mov ecx, [esi+30h] + add eax, [esi+0Ch] + sub ecx, eax + add ecx, [esi+3Ch] + jnz short loc_4CB9A4 + pop edi + pop esi + retn +; --------------------------------------------------------------------------- + +loc_4CB9E8: ; CODE XREF: sub_4CB980+43j + mov dword ptr [esi+38h], 1 + +loc_4CB9EF: ; CODE XREF: sub_4CB980+3Bj + ; sub_4CB980+51j + pop edi + +loc_4CB9F0: ; CODE XREF: sub_4CB980+9j + ; sub_4CB980+Fj ... + pop esi + retn +sub_4CB980 endp + +; --------------------------------------------------------------------------- + align 10h +; =============== S U B R O U T I N E ======================================= + +sub_4CBA00 proc near ; CODE XREF: sub_4CBD50+58p + +arg_0 = dword ptr 4 + + push ebx + push ebp + push esi + push edi + mov edi, [esp+10h+arg_0] + mov esi, [edi+0Ch] + mov eax, [edi+40h] + sub esi, [edi+4] + mov ebx, [edi] + mov ebp, [edi+30h] + add esi, eax + sub ebx, eax + mov eax, dword_553598 + test eax, eax + jnz short loc_4CBA44 + push 0Ch ; Size + call _operator_new ; operator new(uint) + xor ecx, ecx + add esp, 4 + cmp eax, ecx + jz short loc_4CBA3D + mov [eax], ecx + mov [eax+4], ecx + mov [eax+8], ecx + jmp short loc_4CBA3F +; --------------------------------------------------------------------------- + +loc_4CBA3D: ; CODE XREF: sub_4CBA00+31j + xor eax, eax + +loc_4CBA3F: ; CODE XREF: sub_4CBA00+3Bj + mov dword_553598, eax + +loc_4CBA44: ; CODE XREF: sub_4CBA00+21j + mov eax, [eax+8] + test eax, eax + jz short loc_4CBA53 + push esi + push ebx + push ebp + call eax + add esp, 0Ch + +loc_4CBA53: ; CODE XREF: sub_4CBA00+49j + mov eax, [edi+30h] + add eax, [edi+40h] + mov [edi], eax + pop edi + pop esi + pop ebp + pop ebx + retn +sub_4CBA00 endp + +; =============== S U B R O U T I N E ======================================= + +sub_4CBA60 proc near ; CODE XREF: sub_4D0270+D2p + +arg_0 = dword ptr 4 +arg_4 = dword ptr 8 +arg_8 = dword ptr 0Ch +arg_C = dword ptr 10h +arg_10 = dword ptr 14h +arg_14 = dword ptr 18h + + push ebx + push esi + push edi + mov edi, [esp+0Ch+arg_4] + cmp edi, 0C0000000h + jbe short loc_4CBAA2 + mov esi, [esp+0Ch+arg_0] + mov eax, [esi+20h] + mov edi, [esp+0Ch+arg_14] + mov ecx, [edi+4] + push eax + call ecx + xor ebx, ebx + add esp, 4 + cmp [esi+4Ch], ebx + mov [esi+20h], ebx + jnz short loc_4CBA9C + mov edx, [esi+30h] + mov eax, [edi+4] + push edx + call eax + add esp, 4 + mov [esi+30h], ebx + +loc_4CBA9C: ; CODE XREF: sub_4CBA60+2Bj + pop edi + pop esi + xor eax, eax + pop ebx + retn +; --------------------------------------------------------------------------- + +loc_4CBAA2: ; CODE XREF: sub_4CBA60+Dj + mov eax, edi + shr eax, 1 + cmp edi, 80000000h + jbe short loc_4CBAB3 + mov eax, edi + shr eax, 2 + +loc_4CBAB3: ; CODE XREF: sub_4CBA60+4Cj + mov ecx, [esp+0Ch+arg_8] + mov esi, [esp+0Ch+arg_0] + mov ebx, [esp+0Ch+arg_C] + lea edx, [edi+ecx+1] + push ebp + mov [esi+40h], edx + mov edx, [esp+10h+arg_10] + add ecx, ebx + lea ebp, [ebx+edx] + add ecx, edx + mov [esi+44h], ebp + mov ebp, [esp+10h+arg_14] + shr ecx, 1 + push ebp + lea eax, [ecx+eax+80000h] + push eax + push esi + call sub_4CB8F0 + add esp, 0Ch + test eax, eax + jz loc_4CBBEA + mov edx, [esi+48h] + mov [esi+1Ch], ebx + xor ebx, ebx + cmp edx, 2 + lea ebp, [edi+1] + mov [esi+5Ch], ebx + jnz short loc_4CBB0F + mov eax, 0FFFFh + jmp short loc_4CBB49 +; --------------------------------------------------------------------------- + +loc_4CBB0F: ; CODE XREF: sub_4CBA60+A6j + lea ecx, [edi-1] + mov eax, ecx + shr eax, 1 + or ecx, eax + mov eax, ecx + shr eax, 2 + or ecx, eax + mov eax, ecx + shr eax, 4 + or ecx, eax + mov eax, ecx + or eax, 1FFFE00h + shr eax, 8 + or eax, ecx + shr eax, 1 + cmp eax, 1000000h + jbe short loc_4CBB49 + cmp edx, 3 + jnz short loc_4CBB47 + mov eax, 0FFFFFFh + jmp short loc_4CBB49 +; --------------------------------------------------------------------------- + +loc_4CBB47: ; CODE XREF: sub_4CBA60+DEj + shr eax, 1 + +loc_4CBB49: ; CODE XREF: sub_4CBA60+ADj + ; sub_4CBA60+D9j ... + mov [esi+28h], eax + add eax, 1 + cmp edx, 2 + jbe short loc_4CBB5B + mov dword ptr [esi+5Ch], 400h + +loc_4CBB5B: ; CODE XREF: sub_4CBA60+F2j + cmp edx, 3 + jbe short loc_4CBB67 + add dword ptr [esi+5Ch], 10000h + +loc_4CBB67: ; CODE XREF: sub_4CBA60+FEj + cmp edx, 4 + jbe short loc_4CBB73 + add dword ptr [esi+5Ch], 100000h + +loc_4CBB73: ; CODE XREF: sub_4CBA60+10Aj + mov ecx, [esi+60h] + mov edx, [esi+5Ch] + add ecx, [esi+64h] + add eax, edx + cmp [esi+50h], ebx + mov [esi+58h], edi + mov [esi+60h], eax + mov [esi+18h], ebp + lea edx, [ebp+ebp+0] + jnz short loc_4CBB92 + mov edx, ebp + +loc_4CBB92: ; CODE XREF: sub_4CBA60+12Ej + lea edi, [eax+edx] + mov eax, [esi+20h] + cmp eax, ebx + mov [esi+64h], edx + jz short loc_4CBBA3 + cmp ecx, edi + jz short loc_4CBBE0 + +loc_4CBBA3: ; CODE XREF: sub_4CBA60+13Dj + mov ebp, [esp+10h+arg_14] + push eax + mov eax, [ebp+4] + call eax + lea eax, ds:0[edi*4] + mov ecx, eax + shr ecx, 2 + add esp, 4 + cmp ecx, edi + mov [esi+20h], ebx + jz short loc_4CBBC7 + xor eax, eax + jmp short loc_4CBBD0 +; --------------------------------------------------------------------------- + +loc_4CBBC7: ; CODE XREF: sub_4CBA60+161j + mov edx, [ebp+0] + push eax + call edx + add esp, 4 + +loc_4CBBD0: ; CODE XREF: sub_4CBA60+165j + cmp eax, ebx + mov [esi+20h], eax + jz short loc_4CBBEC + mov ecx, [esi+60h] + lea edx, [eax+ecx*4] + mov [esi+24h], edx + +loc_4CBBE0: ; CODE XREF: sub_4CBA60+141j + pop ebp + pop edi + pop esi + mov eax, 1 + pop ebx + retn +; --------------------------------------------------------------------------- + +loc_4CBBEA: ; CODE XREF: sub_4CBA60+8Fj + xor ebx, ebx + +loc_4CBBEC: ; CODE XREF: sub_4CBA60+175j + mov eax, [esi+20h] + mov ecx, [ebp+4] + push eax + call ecx + add esp, 4 + cmp [esi+4Ch], ebx + mov [esi+20h], ebx + jnz short loc_4CBC0F + mov edx, [esi+30h] + mov eax, [ebp+4] + push edx + call eax + add esp, 4 + mov [esi+30h], ebx + +loc_4CBC0F: ; CODE XREF: sub_4CBA60+19Ej + pop ebp + pop edi + pop esi + xor eax, eax + pop ebx + retn +sub_4CBA60 endp + +; --------------------------------------------------------------------------- + align 10h +; =============== S U B R O U T I N E ======================================= + +sub_4CBC20 proc near ; CODE XREF: sub_4CBD50+79p + +arg_0 = dword ptr 4 + + mov eax, [esp+arg_0] + mov edx, [eax+18h] + sub edx, [eax+14h] + push ebx + mov ebx, [eax+4] + or ecx, 0FFFFFFFFh + sub ecx, ebx + cmp edx, ecx + push esi + jnb short loc_4CBC3A + mov ecx, edx + +loc_4CBC3A: ; CODE XREF: sub_4CBC20+16j + mov esi, [eax+0Ch] + sub esi, ebx + push edi + mov edi, [eax+44h] + mov edx, esi + cmp edx, edi + ja short loc_4CBC54 + test edx, edx + jbe short loc_4CBC56 + mov edx, 1 + jmp short loc_4CBC56 +; --------------------------------------------------------------------------- + +loc_4CBC54: ; CODE XREF: sub_4CBC20+27j + sub edx, edi + +loc_4CBC56: ; CODE XREF: sub_4CBC20+2Bj + ; sub_4CBC20+32j + cmp edx, ecx + pop edi + jnb short loc_4CBC5D + mov ecx, edx + +loc_4CBC5D: ; CODE XREF: sub_4CBC20+39j + mov edx, [eax+1Ch] + cmp esi, edx + jbe short loc_4CBC66 + mov esi, edx + +loc_4CBC66: ; CODE XREF: sub_4CBC20+42j + add ebx, ecx + mov [eax+10h], esi + pop esi + mov [eax+8], ebx + pop ebx + retn +sub_4CBC20 endp + +; --------------------------------------------------------------------------- + align 10h +; =============== S U B R O U T I N E ======================================= + +sub_4CBC80 proc near ; DATA XREF: sub_4CCAA0+8o + +arg_0 = dword ptr 4 + + push ebx + push esi + mov esi, [esp+8+arg_0] + xor eax, eax + cmp [esi+60h], eax + jbe short loc_4CBCA2 + lea ecx, [ecx+0] + +loc_4CBC90: ; CODE XREF: sub_4CBC80+20j + mov ecx, [esi+20h] + mov dword ptr [ecx+eax*4], 0 + add eax, 1 + cmp eax, [esi+60h] + jb short loc_4CBC90 + +loc_4CBCA2: ; CODE XREF: sub_4CBC80+Bj + mov eax, [esi+18h] + mov edx, [esi+30h] + push esi + mov dword ptr [esi+14h], 0 + mov [esi], edx + mov [esi+0Ch], eax + mov [esi+4], eax + mov dword ptr [esi+68h], 0 + mov dword ptr [esi+38h], 0 + call sub_4CB980 + mov eax, [esi+18h] + mov ebx, [esi+4] + sub eax, [esi+14h] + or ecx, 0FFFFFFFFh + sub ecx, ebx + add esp, 4 + cmp eax, ecx + jnb short loc_4CBCE2 + mov ecx, eax + +loc_4CBCE2: ; CODE XREF: sub_4CBC80+5Ej + mov edx, [esi+0Ch] + sub edx, ebx + push edi + mov edi, [esi+44h] + mov eax, edx + cmp eax, edi + ja short loc_4CBCFC + test eax, eax + jbe short loc_4CBCFE + mov eax, 1 + jmp short loc_4CBCFE +; --------------------------------------------------------------------------- + +loc_4CBCFC: ; CODE XREF: sub_4CBC80+6Fj + sub eax, edi + +loc_4CBCFE: ; CODE XREF: sub_4CBC80+73j + ; sub_4CBC80+7Aj + cmp eax, ecx + pop edi + jnb short loc_4CBD05 + mov ecx, eax + +loc_4CBD05: ; CODE XREF: sub_4CBC80+81j + mov eax, edx + mov edx, [esi+1Ch] + cmp eax, edx + jbe short loc_4CBD10 + mov eax, edx + +loc_4CBD10: ; CODE XREF: sub_4CBC80+8Cj + add ebx, ecx + mov [esi+8], ebx + mov [esi+10h], eax + pop esi + pop ebx + retn +sub_4CBC80 endp + +; --------------------------------------------------------------------------- + align 10h +; =============== S U B R O U T I N E ======================================= + + +sub_4CBD20 proc near ; CODE XREF: sub_4CBD50+26p + +arg_0 = dword ptr 4 +arg_4 = dword ptr 8 +arg_8 = dword ptr 0Ch + + push edi + mov edi, [esp+4+arg_8] + xor eax, eax + test edi, edi + jbe short loc_4CBD4C + mov edx, [esp+4+arg_4] + push esi + mov esi, [esp+8+arg_0] + +loc_4CBD34: ; CODE XREF: sub_4CBD20+29j + mov ecx, [edx+eax*4] + cmp ecx, esi + ja short loc_4CBD3F + xor ecx, ecx + jmp short loc_4CBD41 +; --------------------------------------------------------------------------- + +loc_4CBD3F: ; CODE XREF: sub_4CBD20+19j + sub ecx, esi + +loc_4CBD41: ; CODE XREF: sub_4CBD20+1Dj + mov [edx+eax*4], ecx + add eax, 1 + cmp eax, edi + jb short loc_4CBD34 + pop esi + +loc_4CBD4C: ; CODE XREF: sub_4CBD20+9j + pop edi + retn +sub_4CBD20 endp + +; --------------------------------------------------------------------------- + align 10h + +; =============== S U B R O U T I N E ======================================= + +sub_4CBD50 proc near ; CODE XREF: .text:004CC1A1p + ; .text:004CC20Ap ... + +arg_0 = dword ptr 4 + + push esi + mov esi, [esp+4+arg_0] + cmp dword ptr [esi+4], 0FFFFFFFFh + jnz short loc_4CBD88 + mov eax, [esi+64h] + add eax, [esi+60h] + mov ecx, [esi+20h] + push edi + mov edi, 0FFFFFFFEh + sub edi, [esi+58h] + push eax + push ecx + and edi, 0FFFFFC00h + push edi + call sub_4CBD20 + sub [esi+8], edi + sub [esi+4], edi + add esp, 0Ch + sub [esi+0Ch], edi + pop edi + +loc_4CBD88: ; CODE XREF: sub_4CBD50+9j + cmp dword ptr [esi+38h], 0 + jnz short loc_4CBDB9 + mov edx, [esi+0Ch] + sub edx, [esi+4] + mov eax, [esi+44h] + cmp eax, edx + jnz short loc_4CBDB9 + mov ecx, [esi+3Ch] + add ecx, [esi+30h] + sub ecx, [esi] + cmp ecx, eax + ja short loc_4CBDB0 + push esi + call sub_4CBA00 + add esp, 4 + +loc_4CBDB0: ; CODE XREF: sub_4CBD50+55j + push esi + call sub_4CB980 + add esp, 4 + +loc_4CBDB9: ; CODE XREF: sub_4CBD50+3Cj + ; sub_4CBD50+49j + mov edx, [esi+14h] + cmp edx, [esi+18h] + jnz short loc_4CBDC8 + mov dword ptr [esi+14h], 0 + +loc_4CBDC8: ; CODE XREF: sub_4CBD50+6Fj + push esi + call sub_4CBC20 + add esp, 4 + pop esi + retn +sub_4CBD50 endp + +; --------------------------------------------------------------------------- + align 10h +; =============== S U B R O U T I N E ======================================= + +sub_4CBDE0 proc near ; CODE XREF: sub_4CC5C0+1B7p + +var_4 = dword ptr -4 +arg_0 = dword ptr 4 +arg_4 = dword ptr 8 +arg_8 = dword ptr 0Ch +arg_C = dword ptr 10h +arg_10 = dword ptr 14h +arg_14 = dword ptr 18h +arg_18 = dword ptr 1Ch +arg_1C = dword ptr 20h +arg_20 = dword ptr 24h +arg_24 = dword ptr 28h + + push ecx + mov edx, [esp+4+arg_4] + mov ecx, [esp+4+arg_10] + mov eax, [esp+4+arg_14] + push ebx + mov [ecx+eax*4], edx + mov ecx, [esp+8+arg_8] + push ebp + push esi + sub ecx, edx + cmp [esp+10h+arg_1C], 0 + push edi + jz loc_4CBEAC + mov ebp, [esp+14h+arg_C] + mov ebx, [esp+14h+arg_24] + jmp short loc_4CBE14 +; --------------------------------------------------------------------------- + align 10h + +loc_4CBE10: ; CODE XREF: sub_4CBDE0+C6j + mov eax, [esp+14h+arg_14] + +loc_4CBE14: ; CODE XREF: sub_4CBDE0+2Dj + mov esi, [esp+14h+arg_18] + sub [esp+14h+arg_1C], 1 + cmp ecx, esi + jnb loc_4CBEAC + mov edx, ebp + sub edx, ecx + cmp eax, ecx + sbb edi, edi + and edi, esi + sub edi, ecx + add edi, eax + mov eax, [esp+14h+arg_10] + mov eax, [eax+edi*4] + mov [esp+14h+arg_4], eax + mov al, [edx+ebx] + cmp al, [ebx+ebp] + jnz short loc_4CBE99 + mov al, [edx] + cmp al, [ebp+0] + jnz short loc_4CBE99 + mov eax, [esp+14h+arg_0] + mov esi, 1 + cmp eax, esi + jz short loc_4CBE7A + sub edx, ebp + lea edi, [ebp+1] + mov [esp+14h+var_4], edx + jmp short loc_4CBE69 +; --------------------------------------------------------------------------- + +loc_4CBE65: ; CODE XREF: sub_4CBDE0+98j + mov edx, [esp+14h+var_4] + +loc_4CBE69: ; CODE XREF: sub_4CBDE0+83j + mov dl, [edx+edi] + cmp dl, [edi] + jnz short loc_4CBE7A + add esi, 1 + add edi, 1 + cmp esi, eax + jnz short loc_4CBE65 + +loc_4CBE7A: ; CODE XREF: sub_4CBDE0+78j + ; sub_4CBDE0+8Ej + cmp ebx, esi + jnb short loc_4CBE99 + mov edx, [esp+14h+arg_20] + mov [edx], esi + add edx, 4 + add ecx, 0FFFFFFFFh + mov [edx], ecx + add edx, 4 + cmp esi, eax + mov ebx, esi + mov [esp+14h+arg_20], edx + jz short loc_4CBEB6 + +loc_4CBE99: ; CODE XREF: sub_4CBDE0+64j + ; sub_4CBDE0+6Bj ... + mov ecx, [esp+14h+arg_8] + sub ecx, [esp+14h+arg_4] + cmp [esp+14h+arg_1C], 0 + jnz loc_4CBE10 + +loc_4CBEAC: ; CODE XREF: sub_4CBDE0+1Fj + ; sub_4CBDE0+3Fj + mov eax, [esp+14h+arg_20] + pop edi + pop esi + pop ebp + pop ebx + pop ecx + retn +; --------------------------------------------------------------------------- + +loc_4CBEB6: ; CODE XREF: sub_4CBDE0+B7j + pop edi + pop esi + pop ebp + mov eax, edx + pop ebx + pop ecx + retn +sub_4CBDE0 endp + +; --------------------------------------------------------------------------- + align 10h +; =============== S U B R O U T I N E ======================================= + +sub_4CBEC0 proc near ; CODE XREF: .text:004CC1E7p + ; sub_4CC220+14Ep ... + +var_10 = dword ptr -10h +var_C = dword ptr -0Ch +var_8 = dword ptr -8 +var_4 = dword ptr -4 +arg_0 = dword ptr 4 +arg_4 = dword ptr 8 +arg_8 = dword ptr 0Ch +arg_C = dword ptr 10h +arg_10 = dword ptr 14h +arg_14 = dword ptr 18h +arg_18 = dword ptr 1Ch +arg_1C = dword ptr 20h +arg_20 = dword ptr 24h +arg_24 = dword ptr 28h + + sub esp, 10h + mov eax, [esp+10h+arg_10] + mov edx, [esp+10h+arg_8] + sub edx, [esp+10h+arg_4] + push ebx + push ebp + push esi + push edi + mov edi, [esp+20h+arg_14] + lea eax, [eax+edi*8] + lea ecx, [eax+4] + mov [esp+20h+var_C], ecx + xor ecx, ecx + xor ebx, ebx + cmp [esp+20h+arg_1C], ecx + mov ebp, eax + mov [esp+20h+var_10], ebp + mov [esp+20h+var_8], ecx + mov [esp+20h+var_4], ebx + jnz short loc_4CBF24 + +loc_4CBEF9: ; CODE XREF: sub_4CBEC0+6Fj + ; sub_4CBEC0+151j + mov edx, [esp+20h+var_C] + mov eax, [esp+20h+arg_20] + pop edi + pop esi + mov dword ptr [ebp+0], 0 + pop ebp + mov dword ptr [edx], 0 + pop ebx + add esp, 10h + retn +; --------------------------------------------------------------------------- + jmp short loc_4CBF20 +; --------------------------------------------------------------------------- + align 10h + +loc_4CBF20: ; CODE XREF: sub_4CBEC0+56j + ; sub_4CBEC0+14Bj + mov edi, [esp+20h+arg_14] + +loc_4CBF24: ; CODE XREF: sub_4CBEC0+37j + mov eax, [esp+20h+arg_18] + sub [esp+20h+arg_1C], 1 + cmp edx, eax + jnb short loc_4CBEF9 + cmp edi, edx + sbb esi, esi + and esi, eax + mov eax, [esp+20h+arg_10] + sub esi, edx + add esi, edi + lea eax, [eax+esi*8] + mov esi, [esp+20h+arg_C] + sub esi, edx + cmp ecx, ebx + jb short loc_4CBF4E + mov ecx, ebx + +loc_4CBF4E: ; CODE XREF: sub_4CBEC0+8Aj + mov bl, [ecx+esi] + mov edi, [esp+20h+arg_C] + cmp bl, [ecx+edi] + jnz short loc_4CBFB8 + add ecx, 1 + cmp ecx, [esp+20h+arg_0] + jz short loc_4CBF93 + mov bl, [ecx+esi] + cmp bl, [ecx+edi] + jnz short loc_4CBF93 + add ecx, 1 + cmp ecx, [esp+20h+arg_0] + jz short loc_4CBF93 + mov ebx, edi + mov ebp, esi + lea edi, [ecx+ebx] + sub ebp, ebx + lea ecx, [ecx+0] + +loc_4CBF80: ; CODE XREF: sub_4CBEC0+D1j + mov bl, [edi+ebp] + cmp bl, [edi] + jnz short loc_4CBF93 + add ecx, 1 + add edi, 1 + cmp ecx, [esp+20h+arg_0] + jnz short loc_4CBF80 + +loc_4CBF93: ; CODE XREF: sub_4CBEC0+A1j + ; sub_4CBEC0+A9j ... + cmp [esp+20h+arg_24], ecx + jnb short loc_4CBFB8 + mov edi, [esp+20h+arg_20] + mov [edi], ecx + add edi, 4 + add edx, 0FFFFFFFFh + mov [edi], edx + add edi, 4 + cmp ecx, [esp+20h+arg_0] + mov [esp+20h+arg_24], ecx + mov [esp+20h+arg_20], edi + jz short loc_4CC016 + +loc_4CBFB8: ; CODE XREF: sub_4CBEC0+98j + ; sub_4CBEC0+D7j + mov dl, [ecx+esi] + mov esi, [esp+20h+arg_C] + cmp dl, [ecx+esi] + mov edx, [esp+20h+arg_4] + jnb short loc_4CBFE4 + mov esi, [esp+20h+var_10] + lea ebp, [eax+4] + mov ebx, ecx + mov ecx, [esp+20h+var_8] + mov [esi], edx + mov eax, [ebp+0] + mov [esp+20h+var_10], ebp + mov [esp+20h+var_4], ebx + jmp short loc_4CBFFC +; --------------------------------------------------------------------------- + +loc_4CBFE4: ; CODE XREF: sub_4CBEC0+106j + mov esi, [esp+20h+var_C] + mov ebp, [esp+20h+var_10] + mov ebx, [esp+20h+var_4] + mov [esi], edx + mov [esp+20h+var_C], eax + mov eax, [eax] + mov [esp+20h+var_8], ecx + +loc_4CBFFC: ; CODE XREF: sub_4CBEC0+122j + mov edx, [esp+20h+arg_8] + sub edx, eax + cmp [esp+20h+arg_1C], 0 + mov [esp+20h+arg_4], eax + jnz loc_4CBF20 + jmp loc_4CBEF9 +; --------------------------------------------------------------------------- + +loc_4CC016: ; CODE XREF: sub_4CBEC0+F6j + mov ecx, [eax] + mov edx, [esp+20h+var_10] + mov [edx], ecx + mov eax, [eax+4] + mov ecx, [esp+20h+var_C] + mov [ecx], eax + mov eax, edi + pop edi + pop esi + pop ebp + pop ebx + add esp, 10h + retn +sub_4CBEC0 endp + +; --------------------------------------------------------------------------- + align 10h +; =============== S U B R O U T I N E ======================================= + + +sub_4CC040 proc near ; CODE XREF: sub_4CC220+F8p + ; sub_4CC3B0+173p ... + +var_10 = dword ptr -10h +var_C = dword ptr -0Ch +var_8 = dword ptr -8 +var_4 = dword ptr -4 +arg_0 = dword ptr 4 +arg_4 = dword ptr 8 +arg_8 = dword ptr 0Ch +arg_C = dword ptr 10h +arg_10 = dword ptr 14h +arg_14 = dword ptr 18h +arg_18 = dword ptr 1Ch +arg_1C = dword ptr 20h + + sub esp, 10h + mov eax, [esp+10h+arg_10] + mov edx, [esp+10h+arg_4] + push ebx + push ebp + push esi + mov esi, [esp+1Ch+arg_14] + lea eax, [eax+esi*8] + lea ecx, [eax+4] + push edi + mov edi, eax + mov eax, [esp+20h+arg_8] + xor ebx, ebx + xor ebp, ebp + sub eax, edx + cmp [esp+20h+arg_1C], ebx + mov [esp+20h+var_C], ecx + mov [esp+20h+var_10], edi + mov [esp+20h+var_8], ebx + mov [esp+20h+var_4], ebp + jz loc_4CC159 + nop + +loc_4CC080: ; CODE XREF: sub_4CC040+114j + sub [esp+20h+arg_1C], 1 + cmp eax, [esp+20h+arg_18] + jnb loc_4CC159 + cmp esi, eax + sbb ecx, ecx + and ecx, [esp+20h+arg_18] + sub ecx, eax + add ecx, esi + mov esi, [esp+20h+arg_10] + lea edi, [esi+ecx*8] + mov ecx, [esp+20h+arg_C] + sub ecx, eax + cmp ebx, ebp + mov eax, ebx + jb short loc_4CC0B0 + mov eax, ebp + +loc_4CC0B0: ; CODE XREF: sub_4CC040+6Cj + mov bl, [eax+ecx] + mov esi, [esp+20h+arg_C] + cmp bl, [eax+esi] + jnz short loc_4CC102 + add eax, 1 + cmp eax, [esp+20h+arg_0] + jz short loc_4CC0E3 + mov ebx, esi + mov ebp, ecx + lea esi, [eax+ebx] + sub ebp, ebx + mov edi, edi + +loc_4CC0D0: ; CODE XREF: sub_4CC040+A1j + mov bl, [esi+ebp] + cmp bl, [esi] + jnz short loc_4CC0FC + add eax, 1 + add esi, 1 + cmp eax, [esp+20h+arg_0] + jnz short loc_4CC0D0 + +loc_4CC0E3: ; CODE XREF: sub_4CC040+83j + ; sub_4CC040+C0j + mov edx, [edi] + mov eax, [esp+20h+var_10] + mov [eax], edx + mov ecx, [edi+4] + mov edx, [esp+20h+var_C] + pop edi + pop esi + pop ebp + mov [edx], ecx + pop ebx + add esp, 10h + retn +; --------------------------------------------------------------------------- + +loc_4CC0FC: ; CODE XREF: sub_4CC040+95j + cmp eax, [esp+20h+arg_0] + jz short loc_4CC0E3 + +loc_4CC102: ; CODE XREF: sub_4CC040+7Aj + mov cl, [eax+ecx] + mov esi, [esp+20h+arg_C] + cmp cl, [eax+esi] + jnb short loc_4CC129 + mov ecx, [esp+20h+var_10] + mov ebx, [esp+20h+var_8] + add edi, 4 + mov ebp, eax + mov [ecx], edx + mov edx, [edi] + mov [esp+20h+var_10], edi + mov [esp+20h+var_4], ebp + jmp short loc_4CC143 +; --------------------------------------------------------------------------- + +loc_4CC129: ; CODE XREF: sub_4CC040+CCj + mov ecx, [esp+20h+var_C] + mov ebp, [esp+20h+var_4] + mov [ecx], edx + mov edx, [edi] + mov ebx, eax + mov [esp+20h+var_C], edi + mov edi, [esp+20h+var_10] + mov [esp+20h+var_8], ebx + +loc_4CC143: ; CODE XREF: sub_4CC040+E7j + mov eax, [esp+20h+arg_8] + sub eax, edx + cmp [esp+20h+arg_1C], 0 + jz short loc_4CC159 + mov esi, [esp+20h+arg_14] + jmp loc_4CC080 +; --------------------------------------------------------------------------- + +loc_4CC159: ; CODE XREF: sub_4CC040+39j + ; sub_4CC040+49j ... + mov eax, [esp+20h+var_C] + mov dword ptr [edi], 0 + pop edi + pop esi + pop ebp + mov dword ptr [eax], 0 + pop ebx + add esp, 10h + retn +sub_4CC040 endp + +; --------------------------------------------------------------------------- + align 10h + +loc_4CC180: ; DATA XREF: sub_4CCAA0+40o + push esi + mov esi, [esp+8] + mov edx, [esi+10h] + cmp edx, 2 + jnb short loc_4CC1AD + add dword ptr [esi+4], 1 + mov eax, [esi+4] + add dword ptr [esi+14h], 1 + add dword ptr [esi], 1 + cmp eax, [esi+8] + jnz short loc_4CC1A9 + push esi + call sub_4CBD50 + add esp, 4 + +loc_4CC1A9: ; CODE XREF: .text:004CC19Ej + xor eax, eax + pop esi + retn +; --------------------------------------------------------------------------- + +loc_4CC1AD: ; CODE XREF: .text:004CC18Bj + mov eax, [esi] + xor ecx, ecx + mov ch, [eax+1] + push ebx + mov ebx, [esp+10h] + push edi + mov edi, [esi+4] + push 1 + push ebx + mov cl, [eax] + mov eax, ecx + mov ecx, [esi+20h] + lea eax, [ecx+eax*4] + mov ecx, [eax] + mov [eax], edi + mov eax, [esi+2Ch] + push eax + mov eax, [esi+18h] + push eax + mov eax, [esi+14h] + push eax + mov eax, [esi+24h] + push eax + mov eax, [esi] + push eax + mov eax, [esi+4] + push eax + push ecx + push edx + call sub_4CBEC0 + add dword ptr [esi+4], 1 + add dword ptr [esi+14h], 1 + add dword ptr [esi], 1 + mov edi, eax + mov eax, [esi+4] + sub edi, ebx + add esp, 28h + sar edi, 2 + cmp eax, [esi+8] + jnz short loc_4CC212 + push esi + call sub_4CBD50 + add esp, 4 + +loc_4CC212: ; CODE XREF: .text:004CC207j + mov eax, edi + pop edi + pop ebx + pop esi + retn + +; --------------------------------------------------------------------------- + align 10h +; =============== S U B R O U T I N E ======================================= + +sub_4CC220 proc near ; DATA XREF: sub_4CCAA0+54o + +var_8 = dword ptr -8 +var_4 = dword ptr -4 +arg_0 = dword ptr 4 +arg_4 = dword ptr 8 + + sub esp, 8 + push esi + mov esi, [esp+0Ch+arg_0] + mov eax, [esi+10h] + cmp eax, 3 + mov [esp+0Ch+arg_0], eax + jnb short loc_4CC259 + mov eax, 1 + add [esi+14h], eax + add [esi], eax + add [esi+4], eax + mov eax, [esi+4] + cmp eax, [esi+8] + jnz short loc_4CC252 + push esi + call sub_4CBD50 + add esp, 4 + +loc_4CC252: ; CODE XREF: sub_4CC220+27j + xor eax, eax + pop esi + add esp, 8 + retn +; --------------------------------------------------------------------------- + +loc_4CC259: ; CODE XREF: sub_4CC220+12j + push ebx + mov ebx, [esi+20h] + push ebp + xor edx, edx + push edi + mov edi, [esi] + mov dh, [edi+2] + movzx ecx, byte ptr [edi] + movzx eax, byte ptr [edi+1] + xor eax, dword_553198[ecx*4] + xor edx, eax + and edx, [esi+28h] + mov ecx, eax + mov ebp, [ebx+edx*4+1000h] + mov eax, [esi+4] + and ecx, 3FFh + sub eax, [ebx+ecx*4] + mov [esp+18h+var_8], ebp + mov ebp, [esi+4] + mov [ebx+edx*4+1000h], ebp + mov ebx, [esi+20h] + mov edx, [ebx+edx*4+1000h] + mov [ebx+ecx*4], edx + mov ebx, [esp+18h+arg_4] + xor ebp, ebp + cmp eax, [esi+18h] + mov ecx, 2 + jnb loc_4CC348 + mov edx, edi + sub edx, eax + mov [esp+18h+var_4], edx + mov dl, [edx] + cmp dl, [edi] + jnz short loc_4CC348 + mov edx, [esp+18h+arg_0] + cmp edx, ecx + jz short loc_4CC2EA + +loc_4CC2D3: ; CODE XREF: sub_4CC220+C4j + mov ebx, [esp+18h+var_4] + mov bl, [ebx+ecx] + cmp bl, [ecx+edi] + jnz short loc_4CC2E6 + add ecx, 1 + cmp ecx, edx + jnz short loc_4CC2D3 + +loc_4CC2E6: ; CODE XREF: sub_4CC220+BDj + mov ebx, [esp+18h+arg_4] + +loc_4CC2EA: ; CODE XREF: sub_4CC220+B1j + add eax, 0FFFFFFFFh + cmp ecx, edx + mov [ebx], ecx + mov [ebx+4], eax + mov ebp, 2 + jnz short loc_4CC34C + mov eax, [esi+2Ch] + mov ecx, [esi+18h] + push eax + mov eax, [esi+14h] + push ecx + mov ecx, [esi+24h] + push eax + mov eax, [esi] + push ecx + mov ecx, [esi+4] + push eax + mov eax, [esp+2Ch+var_8] + push ecx + push eax + push edx + call sub_4CC040 + mov eax, 1 + add [esi+14h], eax + add [esi], eax + add [esi+4], eax + mov eax, [esi+4] + add esp, 20h + cmp eax, [esi+8] + jnz short loc_4CC33E + push esi + call sub_4CBD50 + add esp, 4 + +loc_4CC33E: ; CODE XREF: sub_4CC220+113j + pop edi + mov eax, ebp + pop ebp + pop ebx + pop esi + add esp, 8 + retn +; --------------------------------------------------------------------------- + +loc_4CC348: ; CODE XREF: sub_4CC220+97j + ; sub_4CC220+A9j + mov edx, [esp+18h+arg_0] + +loc_4CC34C: ; CODE XREF: sub_4CC220+D9j + mov eax, [esi+2Ch] + push ecx + lea ecx, [ebx+ebp*4] + push ecx + mov ecx, [esi+18h] + push eax + mov eax, [esi+14h] + push ecx + mov ecx, [esi+24h] + push eax + mov eax, [esi] + push ecx + mov ecx, [esi+4] + push eax + mov eax, [esp+34h+var_8] + push ecx + push eax + push edx + call sub_4CBEC0 + mov edi, eax + mov eax, 1 + add [esi+14h], eax + add [esi], eax + add [esi+4], eax + mov eax, [esi+4] + sub edi, ebx + add esp, 28h + sar edi, 2 + cmp eax, [esi+8] + jnz short loc_4CC39B + push esi + call sub_4CBD50 + add esp, 4 + +loc_4CC39B: ; CODE XREF: sub_4CC220+170j + mov eax, edi + pop edi + pop ebp + pop ebx + pop esi + add esp, 8 + retn +sub_4CC220 endp + +; --------------------------------------------------------------------------- + align 10h +; =============== S U B R O U T I N E ======================================= + +sub_4CC3B0 proc near ; DATA XREF: sub_4CCAA0:loc_4CCB03o + +var_10 = dword ptr -10h +var_8 = dword ptr -8 +var_4 = dword ptr -4 +arg_0 = dword ptr 4 +arg_4 = dword ptr 8 + + sub esp, 10h + push esi + mov esi, [esp+14h+arg_0] + mov eax, [esi+10h] + cmp eax, 4 + mov [esp+14h+arg_0], eax + jnb short loc_4CC3E9 + mov eax, 1 + add [esi+14h], eax + add [esi], eax + add [esi+4], eax + mov eax, [esi+4] + cmp eax, [esi+8] + jnz short loc_4CC3E2 + push esi + call sub_4CBD50 + add esp, 4 + +loc_4CC3E2: ; CODE XREF: sub_4CC3B0+27j + xor eax, eax + pop esi + add esp, 10h + retn +; --------------------------------------------------------------------------- + +loc_4CC3E9: ; CODE XREF: sub_4CC3B0+12j + push ebx + push ebp + push edi + mov edi, [esi] + movzx eax, byte ptr [edi] + movzx edx, byte ptr [edi+1] + xor edx, dword_553198[eax*4] + movzx eax, byte ptr [edi+2] + movzx ebp, byte ptr [edi+3] + mov ecx, eax + add eax, eax + add eax, eax + add eax, eax + xor eax, dword_553198[ebp*4] + mov ebp, [esi+4] + shl eax, 5 + shl ecx, 8 + xor eax, edx + and eax, [esi+28h] + xor ecx, edx + mov ebx, edx + mov edx, [esi+20h] + and ebx, 3FFh + sub ebp, [edx+ebx*4] + and ecx, 0FFFFh + mov [esp+20h+var_4], ebp + mov ebp, [esi+4] + sub ebp, [edx+ecx*4+1000h] + mov [esp+20h+var_10], ebp + mov ebp, [edx+eax*4+41000h] + mov [esp+20h+var_8], ebp + mov ebp, [esi+4] + mov [edx+eax*4+41000h], ebp + mov edx, [esi+20h] + mov eax, [edx+eax*4+41000h] + mov [edx+ecx*4+1000h], eax + mov eax, [esi+20h] + mov ecx, [eax+ecx*4+1000h] + mov [eax+ebx*4], ecx + mov ecx, [esp+20h+var_4] + mov ebx, [esp+20h+arg_4] + xor ebp, ebp + cmp ecx, [esi+18h] + mov eax, 1 + jnb short loc_4CC4A9 + mov edx, edi + sub edx, ecx + mov dl, [edx] + cmp dl, [edi] + jnz short loc_4CC4A9 + mov eax, 2 + lea edx, [ecx-1] + mov [ebx], eax + mov [ebx+4], edx + mov ebp, eax + +loc_4CC4A9: ; CODE XREF: sub_4CC3B0+DEj + ; sub_4CC3B0+E8j + mov edx, [esp+20h+var_10] + cmp ecx, edx + jz short loc_4CC4D5 + cmp edx, [esi+18h] + jnb short loc_4CC4D5 + mov edx, edi + sub edx, [esp+20h+var_10] + mov dl, [edx] + cmp dl, [edi] + jnz short loc_4CC4D5 + mov ecx, [esp+20h+var_10] + lea edx, [ecx-1] + mov [ebx+ebp*4+4], edx + mov eax, 3 + add ebp, 2 + +loc_4CC4D5: ; CODE XREF: sub_4CC3B0+FFj + ; sub_4CC3B0+104j ... + test ebp, ebp + mov edx, [esp+20h+arg_0] + jz short loc_4CC553 + cmp eax, edx + jz short loc_4CC4FE + mov edx, eax + sub edx, ecx + add edx, edi + +loc_4CC4E7: ; CODE XREF: sub_4CC3B0+148j + mov cl, [edx] + cmp cl, [eax+edi] + jnz short loc_4CC4FA + add eax, 1 + add edx, 1 + cmp eax, [esp+20h+arg_0] + jnz short loc_4CC4E7 + +loc_4CC4FA: ; CODE XREF: sub_4CC3B0+13Cj + mov edx, [esp+20h+arg_0] + +loc_4CC4FE: ; CODE XREF: sub_4CC3B0+12Fj + cmp eax, edx + mov [ebx+ebp*4-8], eax + jnz short loc_4CC553 + mov eax, [esi+2Ch] + mov ecx, [esi+18h] + push eax + mov eax, [esi+14h] + push ecx + mov ecx, [esi+24h] + push eax + mov eax, [esi] + push ecx + mov ecx, [esi+4] + push eax + mov eax, [esp+34h+var_8] + push ecx + push eax + push edx + call sub_4CC040 + mov eax, 1 + add [esi+14h], eax + add [esi], eax + add [esi+4], eax + mov eax, [esi+4] + add esp, 20h + cmp eax, [esi+8] + jnz short loc_4CC549 + push esi + call sub_4CBD50 + add esp, 4 + +loc_4CC549: ; CODE XREF: sub_4CC3B0+18Ej + pop edi + mov eax, ebp + pop ebp + pop ebx + pop esi + add esp, 10h + retn +; --------------------------------------------------------------------------- + +loc_4CC553: ; CODE XREF: sub_4CC3B0+12Bj + ; sub_4CC3B0+154j + cmp eax, 3 + jnb short loc_4CC55D + mov eax, 3 + +loc_4CC55D: ; CODE XREF: sub_4CC3B0+1A6j + push eax + mov eax, [esi+2Ch] + lea ecx, [ebx+ebp*4] + push ecx + mov ecx, [esi+18h] + push eax + mov eax, [esi+14h] + push ecx + mov ecx, [esi+24h] + push eax + mov eax, [esi] + push ecx + mov ecx, [esi+4] + push eax + mov eax, [esp+3Ch+var_8] + push ecx + push eax + push edx + call sub_4CBEC0 + mov edi, eax + mov eax, 1 + add [esi+14h], eax + add [esi], eax + add [esi+4], eax + mov eax, [esi+4] + sub edi, ebx + add esp, 28h + sar edi, 2 + cmp eax, [esi+8] + jnz short loc_4CC5AC + push esi + call sub_4CBD50 + add esp, 4 + +loc_4CC5AC: ; CODE XREF: sub_4CC3B0+1F1j + mov eax, edi + pop edi + pop ebp + pop ebx + pop esi + add esp, 10h + retn +sub_4CC3B0 endp + +; --------------------------------------------------------------------------- + align 10h +; =============== S U B R O U T I N E ======================================= + +sub_4CC5C0 proc near ; DATA XREF: sub_4CCAA0+29o + +var_10 = dword ptr -10h +var_8 = dword ptr -8 +var_4 = dword ptr -4 +arg_0 = dword ptr 4 +arg_4 = dword ptr 8 + + sub esp, 10h + push esi + mov esi, [esp+14h+arg_0] + mov eax, [esi+10h] + cmp eax, 4 + mov [esp+14h+arg_0], eax + jnb short loc_4CC5F9 + mov eax, 1 + add [esi+14h], eax + add [esi], eax + add [esi+4], eax + mov eax, [esi+4] + cmp eax, [esi+8] + jnz short loc_4CC5F2 + push esi + call sub_4CBD50 + add esp, 4 + +loc_4CC5F2: ; CODE XREF: sub_4CC5C0+27j + xor eax, eax + pop esi + add esp, 10h + retn +; --------------------------------------------------------------------------- + +loc_4CC5F9: ; CODE XREF: sub_4CC5C0+12j + push ebx + push ebp + push edi + mov edi, [esi] + movzx eax, byte ptr [edi] + movzx edx, byte ptr [edi+1] + xor edx, dword_553198[eax*4] + movzx eax, byte ptr [edi+2] + movzx ebp, byte ptr [edi+3] + mov ecx, eax + add eax, eax + add eax, eax + add eax, eax + xor eax, dword_553198[ebp*4] + mov ebp, [esi+4] + shl eax, 5 + shl ecx, 8 + xor eax, edx + and eax, [esi+28h] + xor ecx, edx + mov ebx, edx + mov edx, [esi+20h] + and ebx, 3FFh + sub ebp, [edx+ebx*4] + and ecx, 0FFFFh + mov [esp+20h+var_4], ebp + mov ebp, [esi+4] + sub ebp, [edx+ecx*4+1000h] + mov [esp+20h+var_10], ebp + mov ebp, [edx+eax*4+41000h] + mov [esp+20h+var_8], ebp + mov ebp, [esi+4] + mov [edx+eax*4+41000h], ebp + mov edx, [esi+20h] + mov eax, [edx+eax*4+41000h] + mov [edx+ecx*4+1000h], eax + mov eax, [esi+20h] + mov ecx, [eax+ecx*4+1000h] + mov [eax+ebx*4], ecx + mov ecx, [esp+20h+var_4] + mov ebx, [esp+20h+arg_4] + xor ebp, ebp + cmp ecx, [esi+18h] + mov eax, 1 + jnb short loc_4CC6B9 + mov edx, edi + sub edx, ecx + mov dl, [edx] + cmp dl, [edi] + jnz short loc_4CC6B9 + mov eax, 2 + lea edx, [ecx-1] + mov [ebx], eax + mov [ebx+4], edx + mov ebp, eax + +loc_4CC6B9: ; CODE XREF: sub_4CC5C0+DEj + ; sub_4CC5C0+E8j + mov edx, [esp+20h+var_10] + cmp ecx, edx + jz short loc_4CC6E5 + cmp edx, [esi+18h] + jnb short loc_4CC6E5 + mov edx, edi + sub edx, [esp+20h+var_10] + mov dl, [edx] + cmp dl, [edi] + jnz short loc_4CC6E5 + mov ecx, [esp+20h+var_10] + lea edx, [ecx-1] + mov [ebx+ebp*4+4], edx + mov eax, 3 + add ebp, 2 + +loc_4CC6E5: ; CODE XREF: sub_4CC5C0+FFj + ; sub_4CC5C0+104j ... + test ebp, ebp + jz short loc_4CC747 + cmp eax, [esp+20h+arg_0] + jz short loc_4CC708 + mov edx, eax + sub edx, ecx + add edx, edi + +loc_4CC6F5: ; CODE XREF: sub_4CC5C0+146j + mov cl, [edx] + cmp cl, [eax+edi] + jnz short loc_4CC708 + add eax, 1 + add edx, 1 + cmp eax, [esp+20h+arg_0] + jnz short loc_4CC6F5 + +loc_4CC708: ; CODE XREF: sub_4CC5C0+12Dj + ; sub_4CC5C0+13Aj + cmp eax, [esp+20h+arg_0] + mov [ebx+ebp*4-8], eax + jnz short loc_4CC747 + mov edx, [esi+14h] + mov eax, [esi+24h] + mov ecx, [esp+20h+var_8] + mov [eax+edx*4], ecx + mov eax, 1 + add [esi+14h], eax + add [esi], eax + add [esi+4], eax + mov eax, [esi+4] + cmp eax, [esi+8] + jnz short loc_4CC73D + push esi + call sub_4CBD50 + add esp, 4 + +loc_4CC73D: ; CODE XREF: sub_4CC5C0+172j + pop edi + mov eax, ebp + pop ebp + pop ebx + pop esi + add esp, 10h + retn +; --------------------------------------------------------------------------- + +loc_4CC747: ; CODE XREF: sub_4CC5C0+127j + ; sub_4CC5C0+150j + cmp eax, 3 + jnb short loc_4CC751 + mov eax, 3 + +loc_4CC751: ; CODE XREF: sub_4CC5C0+18Aj + mov ecx, [esi+18h] + push eax + mov eax, [esi+2Ch] + lea edx, [ebx+ebp*4] + push edx + mov edx, [esi+14h] + push eax + mov eax, [esi+24h] + push ecx + mov ecx, [esi] + push edx + mov edx, [esi+4] + push eax + mov eax, [esp+38h+var_8] + push ecx + mov ecx, [esp+3Ch+arg_0] + push edx + push eax + push ecx + call sub_4CBDE0 + mov edi, eax + mov eax, 1 + add [esi+14h], eax + add [esi], eax + add [esi+4], eax + mov eax, [esi+4] + sub edi, ebx + add esp, 28h + sar edi, 2 + cmp eax, [esi+8] + jnz short loc_4CC7A4 + push esi + call sub_4CBD50 + add esp, 4 + +loc_4CC7A4: ; CODE XREF: sub_4CC5C0+1D9j + mov eax, edi + pop edi + pop ebp + pop ebx + pop esi + add esp, 10h + retn +sub_4CC5C0 endp + +; --------------------------------------------------------------------------- + align 10h +; =============== S U B R O U T I N E ======================================= + +sub_4CC7B0 proc near ; DATA XREF: sub_4CCAA0+47o + +arg_0 = dword ptr 4 +arg_4 = dword ptr 8 + + push ebx + push ebp + mov ebp, [esp+8+arg_4] + push esi + mov esi, [esp+0Ch+arg_0] + push edi + mov edi, 1 + +loc_4CC7C1: ; CODE XREF: sub_4CC7B0+6Dj + mov edx, [esi+10h] + cmp edx, 2 + jb short loc_4CC802 + mov eax, [esi] + mov ebx, [esi+4] + xor ecx, ecx + mov ch, [eax+1] + mov cl, [eax] + mov eax, ecx + mov ecx, [esi+20h] + lea eax, [ecx+eax*4] + mov ecx, [eax] + mov [eax], ebx + mov eax, [esi+2Ch] + push eax + mov eax, [esi+18h] + push eax + mov eax, [esi+14h] + push eax + mov eax, [esi+24h] + push eax + mov eax, [esi] + push eax + mov eax, [esi+4] + push eax + push ecx + push edx + call sub_4CC040 + add esp, 20h + +loc_4CC802: ; CODE XREF: sub_4CC7B0+17j + add [esi+4], edi + mov eax, [esi+4] + add [esi+14h], edi + add [esi], edi + cmp eax, [esi+8] + jnz short loc_4CC81B + push esi + call sub_4CBD50 + add esp, 4 + +loc_4CC81B: ; CODE XREF: sub_4CC7B0+60j + sub ebp, edi + jnz short loc_4CC7C1 + pop edi + pop esi + pop ebp + pop ebx + retn +sub_4CC7B0 endp + +; --------------------------------------------------------------------------- + align 10h +; =============== S U B R O U T I N E ======================================= + +sub_4CC830 proc near ; DATA XREF: sub_4CCAA0+5Bo + +arg_0 = dword ptr 4 +arg_4 = dword ptr 8 + + push ebx + push ebp + push esi + mov esi, [esp+0Ch+arg_0] + push edi + mov edi, 1 + lea ecx, [ecx+0] + +loc_4CC840: ; CODE XREF: sub_4CC830+9Fj + mov ebp, [esi+10h] + cmp ebp, 3 + jb short loc_4CC8B2 + mov ecx, [esi] + movzx edx, byte ptr [ecx] + movzx eax, byte ptr [ecx+1] + xor eax, dword_553198[edx*4] + mov ebx, [esi+4] + xor edx, edx + mov dh, [ecx+2] + xor edx, eax + and edx, [esi+28h] + and eax, 3FFh + mov ecx, edx + mov edx, [esi+20h] + mov edi, [edx+ecx*4+1000h] + lea edx, [edx+ecx*4+1000h] + mov [edx], ebx + mov edx, [esi+20h] + mov ecx, [edx+ecx*4+1000h] + mov [edx+eax*4], ecx + mov edx, [esi+2Ch] + mov eax, [esi+18h] + mov ecx, [esi+14h] + push edx + mov edx, [esi+24h] + push eax + mov eax, [esi] + push ecx + mov ecx, [esi+4] + push edx + push eax + push ecx + push edi + push ebp + call sub_4CC040 + add esp, 20h + mov edi, 1 + +loc_4CC8B2: ; CODE XREF: sub_4CC830+16j + add [esi+4], edi + mov eax, [esi+4] + add [esi+14h], edi + add [esi], edi + cmp eax, [esi+8] + jnz short loc_4CC8CB + push esi + call sub_4CBD50 + add esp, 4 + +loc_4CC8CB: ; CODE XREF: sub_4CC830+90j + sub [esp+10h+arg_4], edi + jnz loc_4CC840 + pop edi + pop esi + pop ebp + pop ebx + retn +sub_4CC830 endp + +; --------------------------------------------------------------------------- + align 10h +; =============== S U B R O U T I N E ======================================= + +sub_4CC8E0 proc near ; DATA XREF: sub_4CCAA0+6Ao + +arg_0 = dword ptr 4 +arg_4 = dword ptr 8 + + push ebx + push ebp + push esi + mov esi, [esp+0Ch+arg_0] + push edi + mov edi, 1 + lea ecx, [ecx+0] + +loc_4CC8F0: ; CODE XREF: sub_4CC8E0+D6j + mov eax, [esi+10h] + cmp eax, 4 + mov [esp+10h+arg_0], eax + jb loc_4CC999 + mov eax, [esi] + movzx edi, byte ptr [eax+2] + movzx edx, byte ptr [eax] + movzx ebx, byte ptr [eax+3] + movzx ecx, byte ptr [eax+1] + xor ecx, dword_553198[edx*4] + mov ebp, [esi+4] + lea eax, ds:0[edi*8] + xor eax, dword_553198[ebx*4] + mov edx, edi + mov edi, [esi+20h] + shl eax, 5 + xor eax, ecx + and eax, [esi+28h] + shl edx, 8 + mov ebx, [edi+eax*4+41000h] + xor edx, ecx + and edx, 0FFFFh + mov [edi+edx*4+1000h], ebp + mov edi, [esi+20h] + mov edx, [edi+edx*4+1000h] + and ecx, 3FFh + mov [edi+ecx*4], edx + mov ecx, [esi+20h] + mov edx, [esi+4] + mov [ecx+eax*4+41000h], edx + mov eax, [esi+2Ch] + mov ecx, [esi+18h] + mov edx, [esi+14h] + push eax + mov eax, [esi+24h] + push ecx + mov ecx, [esi] + push edx + mov edx, [esi+4] + push eax + mov eax, [esp+20h+arg_0] + push ecx + push edx + push ebx + push eax + call sub_4CC040 + add esp, 20h + mov edi, 1 + +loc_4CC999: ; CODE XREF: sub_4CC8E0+1Aj + add [esi+4], edi + mov eax, [esi+4] + add [esi+14h], edi + add [esi], edi + cmp eax, [esi+8] + jnz short loc_4CC9B2 + push esi + call sub_4CBD50 + add esp, 4 + +loc_4CC9B2: ; CODE XREF: sub_4CC8E0+C7j + sub [esp+10h+arg_4], edi + jnz loc_4CC8F0 + pop edi + pop esi + pop ebp + pop ebx + retn +sub_4CC8E0 endp + +; --------------------------------------------------------------------------- + align 10h +; =============== S U B R O U T I N E ======================================= + +sub_4CC9D0 proc near ; DATA XREF: sub_4CCAA0+30o + +arg_0 = dword ptr 4 +arg_4 = dword ptr 8 + + push ebx + push ebp + push esi + mov esi, [esp+0Ch+arg_0] + push edi + mov edi, 1 + lea ecx, [ecx+0] + +loc_4CC9E0: ; CODE XREF: sub_4CC9D0+BAj + cmp dword ptr [esi+10h], 4 + jb loc_4CCA6D + mov eax, [esi] + movzx edi, byte ptr [eax+2] + movzx edx, byte ptr [eax] + movzx ebx, byte ptr [eax+3] + movzx ecx, byte ptr [eax+1] + xor ecx, dword_553198[edx*4] + mov ebp, [esi+4] + lea eax, ds:0[edi*8] + xor eax, dword_553198[ebx*4] + mov edx, edi + mov edi, [esi+20h] + shl eax, 5 + xor eax, ecx + and eax, [esi+28h] + mov ebx, [edi+eax*4+41000h] + lea edi, [edi+eax*4+41000h] + mov [edi], ebp + mov edi, [esi+20h] + mov eax, [edi+eax*4+41000h] + shl edx, 8 + xor edx, ecx + and edx, 0FFFFh + mov [edi+edx*4+1000h], eax + mov eax, [esi+20h] + mov edx, [eax+edx*4+1000h] + and ecx, 3FFh + mov [eax+ecx*4], edx + mov eax, [esi+14h] + mov ecx, [esi+24h] + mov [ecx+eax*4], ebx + mov edi, 1 + +loc_4CCA6D: ; CODE XREF: sub_4CC9D0+14j + add [esi+4], edi + mov eax, [esi+4] + add [esi+14h], edi + add [esi], edi + cmp eax, [esi+8] + jnz short loc_4CCA86 + push esi + call sub_4CBD50 + add esp, 4 + +loc_4CCA86: ; CODE XREF: sub_4CC9D0+ABj + sub [esp+10h+arg_4], edi + jnz loc_4CC9E0 + pop edi + pop esi + pop ebp + pop ebx + retn +sub_4CC9D0 endp + +; =============== S U B R O U T I N E ======================================= + +sub_4CCAA0 proc near ; CODE XREF: sub_4D0270+F3p + +arg_0 = dword ptr 4 +arg_4 = dword ptr 8 + + mov eax, [esp+arg_4] + mov ecx, [esp+arg_0] + mov dword ptr [eax], offset sub_4CBC80 + mov dword ptr [eax+4], offset loc_4CB960 + mov dword ptr [eax+8], offset loc_4CB970 + mov dword ptr [eax+0Ch], offset loc_4CB950 + cmp dword ptr [ecx+50h], 0 + jnz short loc_4CCAD8 + mov dword ptr [eax+10h], offset sub_4CC5C0 + mov dword ptr [eax+14h], offset sub_4CC9D0 + retn +; --------------------------------------------------------------------------- + +loc_4CCAD8: ; CODE XREF: sub_4CCAA0+27j + mov ecx, [ecx+48h] + cmp ecx, 2 + jnz short loc_4CCAEF + mov dword ptr [eax+10h], offset loc_4CC180 + mov dword ptr [eax+14h], offset sub_4CC7B0 + retn +; --------------------------------------------------------------------------- + +loc_4CCAEF: ; CODE XREF: sub_4CCAA0+3Ej + cmp ecx, 3 + jnz short loc_4CCB03 + mov dword ptr [eax+10h], offset sub_4CC220 + mov dword ptr [eax+14h], offset sub_4CC830 + retn +; --------------------------------------------------------------------------- + +loc_4CCB03: ; CODE XREF: sub_4CCAA0+52j + mov dword ptr [eax+10h], offset sub_4CC3B0 + mov dword ptr [eax+14h], offset sub_4CC8E0 + retn +sub_4CCAA0 endp + +; --------------------------------------------------------------------------- + +Interface1_AddRef proc near ; DATA XREF: .rdata:00517A94o +;sub_4CCB80 + +arg_0 = dword ptr 4 + mov eax, [esp+arg_0] + add dword ptr [eax+4], 1 + mov eax, [eax+4] + retn 4 +Interface1_AddRef endp + +; --------------------------------------------------------------------------- + +sub_4CCB20 proc near ; DATA XREF: .rdata:00517A9Co + +arg_0 = dword ptr 4 +arg_4 = dword ptr 8 +arg_8 = dword ptr 0Ch +arg_C = dword ptr 10h + + push esi + mov esi, [esp+4+arg_0] + mov ecx, [esi+10h] + sub ecx, [esi+18h] + mov eax, [esi+14h] + sbb eax, [esi+1Ch] + xor edx, edx + cmp edx, eax + push edi + mov edi, [esp+8+arg_8] + jb short loc_4CCB48 + ja short loc_4CCB42 + cmp edi, ecx + jbe short loc_4CCB48 + +loc_4CCB42: ; CODE XREF: sub_4CCB20+1Cj + mov edi, [esi+10h] + sub edi, [esi+18h] + +loc_4CCB48: ; CODE XREF: sub_4CCB20+1Aj + ; sub_4CCB20+20j + mov eax, [esp+8+arg_C] + test eax, eax + jz short loc_4CCB52 + mov [eax], edi + +loc_4CCB52: ; CODE XREF: sub_4CCB20+2Ej + test edi, edi + jz short loc_4CCB72 + mov eax, [esi+8] + add eax, [esi+18h] + mov ecx, [esp+8+arg_4] + push edi ; size_t + push eax ; void * + push ecx ; void * + call _memcpy ; Microsoft VisualC 2-8/net runtime + add esp, 0Ch + add [esi+18h], edi + adc dword ptr [esi+1Ch], 0 + +loc_4CCB72: ; CODE XREF: sub_4CCB20+34j + pop edi + xor eax, eax + pop esi + retn 10h +sub_4CCB20 endp + +; --------------------------------------------------------------------------- + +sub_4CCB90 proc near ; DATA XREF: .rdata:00517AB0o + +arg_0 = dword ptr 4 +arg_4 = dword ptr 8 +arg_8 = dword ptr 0Ch +arg_C = dword ptr 10h + + push ebx + mov ebx, [esp+4+arg_8] + push esi + mov esi, [esp+8+arg_0] + mov ecx, [esi+10h] + mov eax, [esi+14h] + push edi + xor edi, edi + sub ecx, [esi+18h] + sbb eax, [esi+1Ch] + cmp edi, eax + jb short loc_4CCBC2 + ja short loc_4CCBB3 + cmp ebx, ecx + jbe short loc_4CCBC2 + +loc_4CCBB3: ; CODE XREF: sub_4CCB90+1Dj + pop edi + mov byte ptr [esi+20h], 1 + pop esi + mov eax, 80004005h + pop ebx + retn 10h + +loc_4CCBC2: ; CODE XREF: sub_4CCB90+1Bj + ; sub_4CCB90+21j + mov ecx, [esi+8] + mov eax, [esp+0Ch+arg_4] + add ecx, [esi+18h] + push ebx ; size_t + push eax ; void * + push ecx ; void * + call _memcpy ; Microsoft VisualC 2-8/net runtime + mov eax, [esp+18h+arg_C] + add esp, 0Ch + add [esi+18h], ebx + adc [esi+1Ch], edi + test eax, eax + jz short loc_4CCBE7 + mov [eax], ebx + +loc_4CCBE7: ; CODE XREF: sub_4CCB90+53j + pop edi + pop esi + xor eax, eax + pop ebx + retn 10h +sub_4CCB90 endp + +; --------------------------------------------------------------------------- + align 10h +; --------------------------------------------------------------------------- + +LzmaProps_Decode proc near ; CODE XREF: Decompress_lzma_internal+35p +;sub_4CCBF0 + +propsRes = dword ptr 4 +propsData = dword ptr 8 +propsSize = dword ptr 0Ch + + cmp [esp+propsSize], 5 ; LZMA_PROPS_SIZE + jge short loc_4CCBFD + +loc_4CCBF7: ; CODE XREF: LzmaProps_Decode+16j + mov eax, 1 + retn +; --------------------------------------------------------------------------- + +loc_4CCBFD: ; CODE XREF: LzmaProps_Decode+5j + mov eax, [esp+propsData] + mov cl, [eax] + cmp cl, 0E1h ; 9 * 5 * 5 + jnb short loc_4CCBF7 + cmp cl, 2Dh + push edi + mov edi, [esp+4+propsRes] + mov dword ptr [edi+8], 0 + jb short loc_4CCC40 + push esi + movzx esi, cl + mov eax, 6C16C16Dh + mul esi + mov eax, esi + sub eax, edx + shr eax, 1 + add eax, edx + shr eax, 5 + movzx eax, al + mov edx, eax + pop esi + +loc_4CCC35: ; CODE XREF: LzmaProps_Decode+4Bj + add cl, 0D3h + sub eax, 1 + jnz short loc_4CCC35 + mov [edi+8], edx + +loc_4CCC40: ; CODE XREF: LzmaProps_Decode+27j + cmp cl, 9 + mov dword ptr [edi+4], 0 + jb short loc_4CCC6B + movzx edx, cl + mov eax, 38E38E39h + mul edx + shr edx, 1 + movzx eax, dl + mov edx, eax + lea ecx, [ecx+0] + +loc_4CCC60: ; CODE XREF: LzmaProps_Decode+76j + add cl, 0F7h + sub eax, 1 + jnz short loc_4CCC60 + mov [edi+4], edx + +loc_4CCC6B: ; CODE XREF: LzmaProps_Decode+5Aj + movzx eax, cl + mov [edi], eax + xor eax, eax + pop edi + retn +LzmaProps_Decode endp + +sub_4CCC80 proc near ; CODE XREF: Decompress_lzma_internal+97p + +var_3C = dword ptr -3Ch +var_38 = dword ptr -38h +var_34 = dword ptr -34h +var_30 = dword ptr -30h +var_2C = dword ptr -2Ch +var_28 = dword ptr -28h +var_24 = dword ptr -24h +var_20 = dword ptr -20h +var_1C = dword ptr -1Ch +var_18 = dword ptr -18h +var_14 = dword ptr -14h +var_10 = dword ptr -10h +var_C = dword ptr -0Ch +var_8 = dword ptr -8 +var_4 = dword ptr -4 +arg_0 = dword ptr 4 +arg_4 = dword ptr 8 +arg_8 = dword ptr 0Ch +arg_C = dword ptr 10h +arg_10 = dword ptr 14h +arg_14 = dword ptr 18h +arg_18 = dword ptr 1Ch + + sub esp, 3Ch + mov eax, [esp+3Ch+arg_0] + mov ecx, [eax+8] + push ebx + push ebp + mov ebp, 1 + mov edx, ebp + shl edx, cl + mov ecx, [eax+4] + xor ebx, ebx + push esi + sub edx, ebp + mov [esp+48h+var_C], edx + mov edx, ebp + shl edx, cl + mov ecx, [esp+48h+arg_C] + push edi + mov edi, [eax+0Ch] + sub edx, ebp + mov [esp+4Ch+var_8], edx + mov edx, [eax] + mov [ecx], ebx + mov ecx, [esp+4Ch+arg_18] + mov [ecx], ebx + mov ecx, [eax+4] + add ecx, edx + mov eax, 300h + shl eax, cl + mov [esp+4Ch+var_20], edi + mov [esp+4Ch+var_2C], ebx + mov byte ptr [esp+4Ch+arg_0], bl + add eax, 736h + mov [esp+4Ch+var_14], edx + mov [esp+4Ch+var_34], ebx + mov [esp+4Ch+var_38], ebp + mov [esp+4Ch+var_24], ebp + mov [esp+4Ch+var_28], ebp + mov [esp+4Ch+var_18], ebp + jz short loc_4CCD04 + mov ecx, eax + shr ecx, 1 + mov eax, 4000400h + rep stosd + adc ecx, ecx + rep stosw + +loc_4CCD04: ; CODE XREF: sub_4CCC80+72j + mov edx, [esp+4Ch+arg_8] + mov ecx, [esp+4Ch+arg_4] + lea edi, [ecx+edx] + xor esi, esi + or eax, 0FFFFFFFFh + mov [esp+4Ch+var_3C], edi + xor edx, edx + lea ebx, [ebx+0] + +loc_4CCD20: ; CODE XREF: sub_4CCC80+BCj + cmp ecx, edi + jz loc_4CCF0B + movzx ebp, byte ptr [ecx] + shl esi, 8 + or esi, ebp + mov ebp, 1 + add edx, ebp + add ecx, ebp + cmp edx, 5 + jl short loc_4CCD20 + cmp [esp+4Ch+arg_14], ebx + mov [esp+4Ch+arg_8], ecx + jbe loc_4CCFCD + lea esp, [esp+0] + +loc_4CCD50: ; CODE XREF: sub_4CCC80+32Dj + mov edx, [esp+4Ch+var_34] + mov ecx, [esp+4Ch+var_C] + and ecx, [esp+4Ch+var_2C] + mov edi, [esp+4Ch+var_20] + mov ebx, edx + shl ebx, 4 + add ebx, ecx + cmp eax, 1000000h + lea ebx, [edi+ebx*2] + mov [esp+4Ch+var_1C], ecx + mov [esp+4Ch+var_30], ebx + jnb short loc_4CCD99 + mov ecx, [esp+4Ch+arg_8] + cmp ecx, [esp+4Ch+var_3C] + jz loc_4CD6E2 + movzx ebp, byte ptr [ecx] + shl esi, 8 + shl eax, 8 + or esi, ebp + add ecx, 1 + mov [esp+4Ch+arg_8], ecx + +loc_4CCD99: ; CODE XREF: sub_4CCC80+F7j + movzx ebx, word ptr [ebx] + movzx ebp, bx + mov ecx, eax + shr ecx, 0Bh + imul ecx, ebp + cmp esi, ecx + jnb loc_4CCFF4 + mov edi, [esp+4Ch+var_30] + mov eax, ecx + mov ecx, 800h + sub ecx, ebp + mov ebp, [esp+4Ch+var_8] + sar ecx, 5 + add ecx, ebx + movzx ebx, byte ptr [esp+4Ch+arg_0] + mov [edi], cx + mov edi, [esp+4Ch+var_2C] + mov ecx, 8 + sub cl, byte ptr [esp+4Ch+var_14] + and ebp, edi + shr ebx, cl + mov ecx, [esp+4Ch+var_14] + shl ebp, cl + mov ecx, [esp+4Ch+var_20] + mov edx, 1 + add ebx, ebp + imul ebx, 600h + cmp [esp+4Ch+var_34], 7 + lea ebp, [ebx+ecx+0E6Ch] + mov [esp+4Ch+var_30], ebp + jl loc_4CCEB0 + sub edi, [esp+4Ch+var_38] + mov ecx, [esp+4Ch+arg_10] + movzx ebx, byte ptr [edi+ecx] + jmp short loc_4CCE20 +; --------------------------------------------------------------------------- + align 10h + +loc_4CCE20: ; CODE XREF: sub_4CCC80+197j + ; sub_4CCC80+2C6j + add ebx, ebx + mov [esp+4Ch+var_10], ebx + and ebx, 100h + cmp eax, 1000000h + lea ecx, [ebx+edx] + lea ebp, [ebp+ecx*2+200h] + mov [esp+4Ch+arg_0], ebp + jnb short loc_4CCE61 + mov ecx, [esp+4Ch+arg_8] + cmp ecx, [esp+4Ch+var_3C] + jz loc_4CD6E2 + movzx edi, byte ptr [ecx] + shl esi, 8 + shl eax, 8 + or esi, edi + add ecx, 1 + mov [esp+4Ch+arg_8], ecx + +loc_4CCE61: ; CODE XREF: sub_4CCC80+1BFj + movzx edi, word ptr [ebp+0] + movzx ebp, di + mov ecx, eax + shr ecx, 0Bh + imul ecx, ebp + cmp esi, ecx + jnb loc_4CCF15 + mov eax, ecx + mov ecx, 800h + sub ecx, ebp + sar ecx, 5 + add ecx, edi + mov edi, [esp+4Ch+arg_0] + add edx, edx + test ebx, ebx + mov [edi], cx + jz loc_4CCF36 + +loc_4CCE97: ; CODE XREF: sub_4CCC80+2B0j + cmp edx, 100h + jge loc_4CCF70 + mov ebp, [esp+4Ch+var_30] + jmp short loc_4CCEB0 +; --------------------------------------------------------------------------- + align 10h + +loc_4CCEB0: ; CODE XREF: sub_4CCC80+185j + ; sub_4CCC80+227j ... + cmp eax, 1000000h + lea ecx, [edx+edx] + mov [esp+4Ch+arg_0], ecx + jnb short loc_4CCEDE + mov edi, [esp+4Ch+arg_8] + cmp edi, [esp+4Ch+var_3C] + jz loc_4CD6E2 + movzx ebx, byte ptr [edi] + shl esi, 8 + shl eax, 8 + or esi, ebx + add edi, 1 + mov [esp+4Ch+arg_8], edi + +loc_4CCEDE: ; CODE XREF: sub_4CCC80+23Cj + movzx edi, word ptr [ecx+ebp] + movzx ebx, di + mov ecx, eax + shr ecx, 0Bh + imul ecx, ebx + cmp esi, ecx + jnb short loc_4CCF4B + mov eax, ecx + mov ecx, 800h + sub ecx, ebx + sar ecx, 5 + add ecx, edi + mov edi, [esp+4Ch+arg_0] + mov [edi+ebp], cx + add edx, edx + jmp short loc_4CCF64 +; --------------------------------------------------------------------------- + +loc_4CCF0B: ; CODE XREF: sub_4CCC80+A2j + pop edi + pop esi + mov eax, ebp + pop ebp + pop ebx + add esp, 3Ch + retn +; --------------------------------------------------------------------------- + +loc_4CCF15: ; CODE XREF: sub_4CCC80+1F2j + sub eax, ecx + sub esi, ecx + mov cx, di + shr cx, 5 + sub di, cx + test ebx, ebx + mov ecx, [esp+4Ch+arg_0] + mov [ecx], di + lea edx, [edx+edx+1] + jz loc_4CCE97 + +loc_4CCF36: ; CODE XREF: sub_4CCC80+211j + cmp edx, 100h + jge short loc_4CCF70 + mov ebp, [esp+4Ch+var_30] + mov ebx, [esp+4Ch+var_10] + jmp loc_4CCE20 +; --------------------------------------------------------------------------- + +loc_4CCF4B: ; CODE XREF: sub_4CCC80+26Fj + mov dx, di + shr dx, 5 + sub di, dx + mov edx, [esp+4Ch+arg_0] + sub eax, ecx + sub esi, ecx + mov [edx+ebp], di + add edx, 1 + +loc_4CCF64: ; CODE XREF: sub_4CCC80+289j + cmp edx, 100h + jl loc_4CCEB0 + +loc_4CCF70: ; CODE XREF: sub_4CCC80+21Dj + ; sub_4CCC80+2BCj + mov ecx, [esp+4Ch+var_2C] + mov edi, [esp+4Ch+arg_10] + mov [ecx+edi], dl + add ecx, 1 + mov [esp+4Ch+var_2C], ecx + mov ecx, [esp+4Ch+var_34] + cmp ecx, 4 + mov byte ptr [esp+4Ch+arg_0], dl + jge short loc_4CCF99 + mov [esp+4Ch+var_34], 0 + jmp short loc_4CCFA5 +; --------------------------------------------------------------------------- + +loc_4CCF99: ; CODE XREF: sub_4CCC80+30Dj + cmp ecx, 0Ah + jge short loc_4CCFEF + sub ecx, 3 + +loc_4CCFA1: ; CODE XREF: sub_4CCC80+372j + mov [esp+4Ch+var_34], ecx + +loc_4CCFA5: ; CODE XREF: sub_4CCC80+317j + ; sub_4CCC80+530j ... + mov ecx, [esp+4Ch+var_2C] + cmp ecx, [esp+4Ch+arg_14] + jb loc_4CCD50 + +loc_4CCFB3: ; CODE XREF: sub_4CCC80+A13j + ; sub_4CCC80+A5Aj + cmp eax, 1000000h + jnb short loc_4CCFCD + mov edx, [esp+4Ch+arg_8] + cmp edx, [esp+4Ch+var_3C] + jz loc_4CD6E2 + add [esp+4Ch+arg_8], 1 + +loc_4CCFCD: ; CODE XREF: sub_4CCC80+C6j + ; sub_4CCC80+338j + mov eax, [esp+4Ch+arg_8] + sub eax, [esp+4Ch+arg_4] + mov ecx, [esp+4Ch+arg_C] + mov edx, [esp+4Ch+var_2C] + pop edi + mov [ecx], eax + mov eax, [esp+48h+arg_18] + pop esi + pop ebp + mov [eax], edx + xor eax, eax + pop ebx + add esp, 3Ch + retn +; --------------------------------------------------------------------------- + +loc_4CCFEF: ; CODE XREF: sub_4CCC80+31Cj + sub ecx, 6 + jmp short loc_4CCFA1 +; --------------------------------------------------------------------------- + +loc_4CCFF4: ; CODE XREF: sub_4CCC80+129j + sub eax, ecx + sub esi, ecx + mov cx, bx + shr cx, 5 + sub bx, cx + cmp eax, 1000000h + mov ecx, [esp+4Ch+var_30] + mov [ecx], bx + jnb short loc_4CD030 + mov ecx, [esp+4Ch+arg_8] + cmp ecx, [esp+4Ch+var_3C] + jz loc_4CD6E2 + movzx ebx, byte ptr [ecx] + shl esi, 8 + shl eax, 8 + or esi, ebx + add ecx, 1 + mov [esp+4Ch+arg_8], ecx + +loc_4CD030: ; CODE XREF: sub_4CCC80+38Ej + movzx ebx, word ptr [edi+edx*2+180h] + movzx ebp, bx + mov ecx, eax + shr ecx, 0Bh + imul ecx, ebp + cmp esi, ecx + jnb short loc_4CD096 + mov eax, ecx + mov ecx, 800h + sub ecx, ebp + sar ecx, 5 + add ecx, ebx + mov [edi+edx*2+180h], cx + mov ecx, [esp+4Ch+var_28] + mov ebp, [esp+4Ch+var_1C] + mov [esp+4Ch+var_18], ecx + mov ecx, [esp+4Ch+var_24] + mov [esp+4Ch+var_28], ecx + mov ecx, [esp+4Ch+var_38] + mov [esp+4Ch+var_24], ecx + xor ecx, ecx + cmp edx, 7 + setl cl + sub ecx, 1 + and ecx, 3 + mov [esp+4Ch+var_34], ecx + lea ecx, [edi+664h] + jmp loc_4CD30B +; --------------------------------------------------------------------------- + +loc_4CD096: ; CODE XREF: sub_4CCC80+3C5j + sub eax, ecx + sub esi, ecx + mov cx, bx + shr cx, 5 + sub bx, cx + cmp eax, 1000000h + mov [edi+edx*2+180h], bx + jnb short loc_4CD0D3 + mov ecx, [esp+4Ch+arg_8] + cmp ecx, [esp+4Ch+var_3C] + jz loc_4CD6E2 + movzx ebx, byte ptr [ecx] + shl esi, 8 + shl eax, 8 + or esi, ebx + add ecx, 1 + mov [esp+4Ch+arg_8], ecx + +loc_4CD0D3: ; CODE XREF: sub_4CCC80+431j + movzx ebx, word ptr [edi+edx*2+198h] + movzx ebp, bx + mov ecx, eax + shr ecx, 0Bh + imul ecx, ebp + cmp esi, ecx + mov [esp+4Ch+arg_0], ebx + jnb loc_4CD1D3 + mov ebx, 800h + sub ebx, ebp + mov ebp, [esp+4Ch+var_1C] + sar ebx, 5 + add ebx, [esp+4Ch+arg_0] + mov eax, ecx + mov [edi+edx*2+198h], bx + lea ebx, [edx+0Fh] + shl ebx, 4 + add ebx, ebp + cmp ecx, 1000000h + lea ebx, [edi+ebx*2] + mov [esp+4Ch+var_30], ebx + jnb short loc_4CD147 + mov ebx, [esp+4Ch+arg_8] + cmp ebx, [esp+4Ch+var_3C] + jz loc_4CD6E2 + shl ecx, 8 + mov eax, ecx + movzx ecx, byte ptr [ebx] + shl esi, 8 + or esi, ecx + add ebx, 1 + mov [esp+4Ch+arg_8], ebx + +loc_4CD147: ; CODE XREF: sub_4CCC80+4A3j + mov ecx, [esp+4Ch+var_30] + movzx ecx, word ptr [ecx] + mov [esp+4Ch+arg_0], ecx + movzx ebx, cx + mov ecx, eax + shr ecx, 0Bh + imul ecx, ebx + cmp esi, ecx + jnb short loc_4CD1B5 + mov edi, [esp+4Ch+var_30] + mov eax, ecx + mov ecx, 800h + sub ecx, ebx + sar ecx, 5 + add ecx, [esp+4Ch+arg_0] + mov [edi], cx + mov edi, [esp+4Ch+var_2C] + test edi, edi + jz loc_4CD6E2 + xor ecx, ecx + cmp edx, 7 + mov edx, [esp+4Ch+arg_10] + setnl cl + lea ecx, [ecx+ecx+9] + mov [esp+4Ch+var_34], ecx + mov ecx, edi + sub ecx, [esp+4Ch+var_38] + add edi, 1 + mov cl, [ecx+edx] + mov [edi+edx-1], cl + mov byte ptr [esp+4Ch+arg_0], cl + mov [esp+4Ch+var_2C], edi + jmp loc_4CCFA5 +; --------------------------------------------------------------------------- + +loc_4CD1B5: ; CODE XREF: sub_4CCC80+4DFj + sub eax, ecx + sub esi, ecx + mov ecx, [esp+4Ch+arg_0] + mov bx, cx + shr bx, 5 + sub cx, bx + mov ebx, [esp+4Ch+var_30] + mov [ebx], cx + jmp loc_4CD2F0 +; --------------------------------------------------------------------------- + +loc_4CD1D3: ; CODE XREF: sub_4CCC80+46Cj + sub eax, ecx + sub esi, ecx + mov cx, bx + shr cx, 5 + sub bx, cx + cmp eax, 1000000h + mov [edi+edx*2+198h], bx + jnb short loc_4CD210 + mov ecx, [esp+4Ch+arg_8] + cmp ecx, [esp+4Ch+var_3C] + jz loc_4CD6E2 + movzx ebx, byte ptr [ecx] + shl esi, 8 + shl eax, 8 + or esi, ebx + add ecx, 1 + mov [esp+4Ch+arg_8], ecx + +loc_4CD210: ; CODE XREF: sub_4CCC80+56Ej + movzx ebx, word ptr [edi+edx*2+1B0h] + movzx ebp, bx + mov ecx, eax + shr ecx, 0Bh + imul ecx, ebp + cmp esi, ecx + jnb short loc_4CD246 + mov eax, ecx + mov ecx, 800h + sub ecx, ebp + sar ecx, 5 + add ecx, ebx + mov [edi+edx*2+1B0h], cx + mov ecx, [esp+4Ch+var_24] + jmp loc_4CD2E0 +; --------------------------------------------------------------------------- + +loc_4CD246: ; CODE XREF: sub_4CCC80+5A5j + sub eax, ecx + sub esi, ecx + mov cx, bx + shr cx, 5 + sub bx, cx + cmp eax, 1000000h + mov [edi+edx*2+1B0h], bx + jnb short loc_4CD283 + mov ecx, [esp+4Ch+arg_8] + cmp ecx, [esp+4Ch+var_3C] + jz loc_4CD6E2 + movzx ebx, byte ptr [ecx] + shl esi, 8 + shl eax, 8 + or esi, ebx + add ecx, 1 + mov [esp+4Ch+arg_8], ecx + +loc_4CD283: ; CODE XREF: sub_4CCC80+5E1j + movzx ebx, word ptr [edi+edx*2+1C8h] + movzx ebp, bx + mov ecx, eax + shr ecx, 0Bh + imul ecx, ebp + cmp esi, ecx + jnb short loc_4CD2B6 + mov eax, ecx + mov ecx, 800h + sub ecx, ebp + sar ecx, 5 + add ecx, ebx + mov [edi+edx*2+1C8h], cx + mov ecx, [esp+4Ch+var_28] + jmp short loc_4CD2D8 +; --------------------------------------------------------------------------- + +loc_4CD2B6: ; CODE XREF: sub_4CCC80+618j + sub eax, ecx + sub esi, ecx + mov cx, bx + shr cx, 5 + sub bx, cx + mov ecx, [esp+4Ch+var_18] + mov [edi+edx*2+1C8h], bx + mov ebx, [esp+4Ch+var_28] + mov [esp+4Ch+var_18], ebx + +loc_4CD2D8: ; CODE XREF: sub_4CCC80+634j + mov ebx, [esp+4Ch+var_24] + mov [esp+4Ch+var_28], ebx + +loc_4CD2E0: ; CODE XREF: sub_4CCC80+5C1j + mov ebx, [esp+4Ch+var_38] + mov ebp, [esp+4Ch+var_1C] + mov [esp+4Ch+var_24], ebx + mov [esp+4Ch+var_38], ecx + +loc_4CD2F0: ; CODE XREF: sub_4CCC80+54Ej + xor ecx, ecx + cmp edx, 7 + setnl cl + sub ecx, 1 + and ecx, 0FFFFFFFDh + add ecx, 0Bh + mov [esp+4Ch+var_34], ecx + lea ecx, [edi+0A68h] + +loc_4CD30B: ; CODE XREF: sub_4CCC80+411j + cmp eax, 1000000h + jnb short loc_4CD332 + mov edx, [esp+4Ch+arg_8] + cmp edx, [esp+4Ch+var_3C] + jz loc_4CD6E2 + movzx edi, byte ptr [edx] + shl esi, 8 + shl eax, 8 + or esi, edi + add edx, 1 + mov [esp+4Ch+arg_8], edx + +loc_4CD332: ; CODE XREF: sub_4CCC80+690j + movzx edi, word ptr [ecx] + movzx ebx, di + mov edx, eax + shr edx, 0Bh + imul edx, ebx + cmp esi, edx + jnb short loc_4CD36E + mov eax, edx + mov edx, 800h + sub edx, ebx + sar edx, 5 + add edx, edi + mov [ecx], dx + shl ebp, 4 + lea ecx, [ecx+ebp+4] + mov [esp+4Ch+var_1C], 0 + mov edx, 3 + jmp loc_4CD409 +; --------------------------------------------------------------------------- + +loc_4CD36E: ; CODE XREF: sub_4CCC80+6C2j + sub eax, edx + sub esi, edx + mov dx, di + shr dx, 5 + sub di, dx + cmp eax, 1000000h + mov [ecx], di + jnb short loc_4CD3A6 + mov edx, [esp+4Ch+arg_8] + cmp edx, [esp+4Ch+var_3C] + jz loc_4CD6E2 + movzx edi, byte ptr [edx] + shl esi, 8 + shl eax, 8 + or esi, edi + add edx, 1 + mov [esp+4Ch+arg_8], edx + +loc_4CD3A6: ; CODE XREF: sub_4CCC80+704j + movzx edx, word ptr [ecx+2] + movzx ebx, dx + mov edi, eax + shr edi, 0Bh + imul edi, ebx + cmp esi, edi + jnb short loc_4CD3E4 + mov eax, edi + mov edi, 800h + sub edi, ebx + sar edi, 5 + add edi, edx + shl ebp, 4 + mov [ecx+2], di + lea ecx, [ecx+ebp+104h] + mov [esp+4Ch+var_1C], 8 + mov edx, 3 + jmp short loc_4CD409 +; --------------------------------------------------------------------------- + +loc_4CD3E4: ; CODE XREF: sub_4CCC80+737j + sub eax, edi + sub esi, edi + mov di, dx + shr di, 5 + sub dx, di + mov [ecx+2], dx + add ecx, 204h + mov [esp+4Ch+var_1C], 10h + mov edx, 8 + +loc_4CD409: ; CODE XREF: sub_4CCC80+6E9j + ; sub_4CCC80+762j + mov [esp+4Ch+arg_0], edx + mov [esp+4Ch+var_10], edx + mov ebx, 1 + jmp short loc_4CD420 +; --------------------------------------------------------------------------- + align 10h + +loc_4CD420: ; CODE XREF: sub_4CCC80+796j + ; sub_4CCC80+819j + cmp eax, 1000000h + mov edx, [esp+4Ch+arg_8] + lea edi, [ebx+ebx] + mov [esp+4Ch+var_30], edi + jnb short loc_4CD44E + cmp edx, [esp+4Ch+var_3C] + jz loc_4CD6E2 + movzx ebp, byte ptr [edx] + shl esi, 8 + shl eax, 8 + or esi, ebp + add edx, 1 + mov [esp+4Ch+arg_8], edx + +loc_4CD44E: ; CODE XREF: sub_4CCC80+7B0j + movzx edi, word ptr [edi+ecx] + movzx ebp, di + mov edx, eax + shr edx, 0Bh + imul edx, ebp + cmp esi, edx + jnb short loc_4CD47B + mov eax, edx + mov edx, 800h + sub edx, ebp + sar edx, 5 + add edx, edi + mov edi, [esp+4Ch+var_30] + mov [edi+ecx], dx + add ebx, ebx + jmp short loc_4CD494 +; --------------------------------------------------------------------------- + +loc_4CD47B: ; CODE XREF: sub_4CCC80+7DFj + mov ebx, [esp+4Ch+var_30] + sub eax, edx + sub esi, edx + mov dx, di + shr dx, 5 + sub di, dx + mov [ebx+ecx], di + add ebx, 1 + +loc_4CD494: ; CODE XREF: sub_4CCC80+7F9j + sub [esp+4Ch+var_10], 1 + jnz short loc_4CD420 + mov ecx, [esp+4Ch+arg_0] + mov edx, 1 + shl edx, cl + mov ecx, [esp+4Ch+var_1C] + sub ecx, edx + add ebx, ecx + cmp [esp+4Ch+var_34], 4 + mov [esp+4Ch+var_4], ebx + jge loc_4CD69D + add [esp+4Ch+var_34], 7 + cmp ebx, 4 + jl short loc_4CD4CC + mov ebx, 3 + +loc_4CD4CC: ; CODE XREF: sub_4CCC80+845j + mov ecx, [esp+4Ch+var_20] + shl ebx, 7 + lea ecx, [ebx+ecx+360h] + mov [esp+4Ch+var_30], ecx + mov [esp+4Ch+arg_0], 6 + mov edi, 1 + jmp short loc_4CD4F0 +; --------------------------------------------------------------------------- + align 10h + +loc_4CD4F0: ; CODE XREF: sub_4CCC80+86Bj + ; sub_4CCC80+8E3j + cmp eax, 1000000h + mov edx, [esp+4Ch+arg_8] + lea ebx, [edi+edi] + jnb short loc_4CD51A + cmp edx, [esp+4Ch+var_3C] + jz loc_4CD6E2 + movzx ebp, byte ptr [edx] + shl esi, 8 + shl eax, 8 + or esi, ebp + add edx, 1 + mov [esp+4Ch+arg_8], edx + +loc_4CD51A: ; CODE XREF: sub_4CCC80+87Cj + movzx edx, word ptr [ebx+ecx] + movzx ebp, dx + mov ecx, eax + shr ecx, 0Bh + imul ecx, ebp + cmp esi, ecx + jnb short loc_4CD545 + mov eax, ecx + mov ecx, 800h + sub ecx, ebp + sar ecx, 5 + add ecx, edx + mov [esp+4Ch+var_10], ecx + mov edx, ecx + add edi, edi + jmp short loc_4CD556 +; --------------------------------------------------------------------------- + +loc_4CD545: ; CODE XREF: sub_4CCC80+8ABj + sub eax, ecx + sub esi, ecx + mov cx, dx + shr cx, 5 + sub dx, cx + lea edi, [ebx+1] + +loc_4CD556: ; CODE XREF: sub_4CCC80+8C3j + sub [esp+4Ch+arg_0], 1 + mov ecx, [esp+4Ch+var_30] + mov [ebx+ecx], dx + jnz short loc_4CD4F0 + sub edi, 40h + cmp edi, 4 + jl loc_4CD68A + mov ebx, 1 + mov ecx, edi + mov edx, edi + sar ecx, 1 + and edx, ebx + sub ecx, ebx + or edx, 2 + cmp edi, 0Eh + mov [esp+4Ch+var_30], ecx + jge short loc_4CD5A1 + shl edx, cl + mov ecx, [esp+4Ch+var_20] + mov [esp+4Ch+var_38], edx + sub edx, edi + lea ebp, [ecx+edx*2+55Eh] + jmp short loc_4CD5F3 +; --------------------------------------------------------------------------- + +loc_4CD5A1: ; CODE XREF: sub_4CCC80+90Aj + mov edi, [esp+4Ch+arg_8] + sub ecx, 4 + +loc_4CD5A8: ; CODE XREF: sub_4CCC80+958j + cmp eax, 1000000h + jnb short loc_4CD5CA + cmp edi, [esp+4Ch+var_3C] + jz loc_4CD6EF + movzx ebp, byte ptr [edi] + shl esi, 8 + shl eax, 8 + or esi, ebp + add edi, ebx + mov [esp+4Ch+arg_8], edi + +loc_4CD5CA: ; CODE XREF: sub_4CCC80+92Dj + shr eax, 1 + add edx, edx + cmp esi, eax + jb short loc_4CD5D6 + sub esi, eax + or edx, ebx + +loc_4CD5D6: ; CODE XREF: sub_4CCC80+950j + sub ecx, ebx + jnz short loc_4CD5A8 + mov ebp, [esp+4Ch+var_20] + add ebp, 644h + shl edx, 4 + mov [esp+4Ch+var_38], edx + mov [esp+4Ch+var_30], 4 + +loc_4CD5F3: ; CODE XREF: sub_4CCC80+91Fj + mov [esp+4Ch+var_1C], ebx + mov [esp+4Ch+arg_0], ebx + jmp short loc_4CD600 +; --------------------------------------------------------------------------- + align 10h + +loc_4CD600: ; CODE XREF: sub_4CCC80+97Bj + ; sub_4CCC80+A02j + mov ebx, [esp+4Ch+arg_0] + add ebx, ebx + cmp eax, 1000000h + jnb short loc_4CD62D + mov ecx, [esp+4Ch+arg_8] + cmp ecx, [esp+4Ch+var_3C] + jz loc_4CD6E2 + movzx edx, byte ptr [ecx] + shl esi, 8 + shl eax, 8 + or esi, edx + add ecx, 1 + mov [esp+4Ch+arg_8], ecx + +loc_4CD62D: ; CODE XREF: sub_4CCC80+98Bj + movzx edi, word ptr [ebx+ebp] + movzx ecx, di + mov edx, eax + shr edx, 0Bh + imul edx, ecx + cmp esi, edx + jnb short loc_4CD658 + mov eax, edx + mov edx, 800h + sub edx, ecx + sar edx, 5 + add edx, edi + shl [esp+4Ch+arg_0], 1 + mov [ebx+ebp], dx + jmp short loc_4CD679 +; --------------------------------------------------------------------------- + +loc_4CD658: ; CODE XREF: sub_4CCC80+9BEj + mov cx, di + shr cx, 5 + sub di, cx + sub eax, edx + sub esi, edx + mov edx, [esp+4Ch+var_1C] + mov [ebx+ebp], di + add ebx, 1 + or [esp+4Ch+var_38], edx + mov [esp+4Ch+arg_0], ebx + +loc_4CD679: ; CODE XREF: sub_4CCC80+9D6j + shl [esp+4Ch+var_1C], 1 + sub [esp+4Ch+var_30], 1 + jnz loc_4CD600 + jmp short loc_4CD68E +; --------------------------------------------------------------------------- + +loc_4CD68A: ; CODE XREF: sub_4CCC80+8EBj + mov [esp+4Ch+var_38], edi + +loc_4CD68E: ; CODE XREF: sub_4CCC80+A08j + add [esp+4Ch+var_38], 1 + jz loc_4CCFB3 + mov ebx, [esp+4Ch+var_4] + +loc_4CD69D: ; CODE XREF: sub_4CCC80+837j + mov ebp, [esp+4Ch+var_2C] + mov ecx, [esp+4Ch+var_38] + add ebx, 2 + cmp ecx, ebp + ja short loc_4CD6E2 + mov edi, ebp + sub edi, ecx + add edi, [esp+4Ch+arg_10] + +loc_4CD6B4: ; CODE XREF: sub_4CCC80+A60j + mov cl, [edi] + mov edx, [esp+4Ch+arg_10] + sub ebx, 1 + mov [edx+ebp], cl + add ebp, 1 + add edi, 1 + test ebx, ebx + mov byte ptr [esp+4Ch+arg_0], cl + mov [esp+4Ch+var_2C], ebp + jz loc_4CCFA5 + cmp ebp, [esp+4Ch+arg_14] + jnb loc_4CCFB3 + jmp short loc_4CD6B4 +; --------------------------------------------------------------------------- + +loc_4CD6E2: ; CODE XREF: sub_4CCC80+101j + ; sub_4CCC80+1C9j ... + pop edi + pop esi + pop ebp + mov eax, 1 + pop ebx + add esp, 3Ch + retn +; --------------------------------------------------------------------------- + +loc_4CD6EF: ; CODE XREF: sub_4CCC80+933j + pop edi + pop esi + pop ebp + mov eax, ebx + pop ebx + add esp, 3Ch + retn +sub_4CCC80 endp + +_starcraft_decompress_lzma PROC +;sub_4CD700 + +var_14 = byte ptr -14h +var_10 = dword ptr -10h +var_C = dword ptr -0Ch +var_4 = dword ptr -4 +pbInBuffer = dword ptr 4 +cbInBuffer = dword ptr 8 +pbOutBuffer = dword ptr 0Ch +cbOutBuffer = dword ptr 10h +pcbOutBuffer = dword ptr 14h +pfnAllocateMemory= dword ptr 18h +pfnFreeMemory = dword ptr 1Ch + + sub esp, 14h + push ebx + mov ebx, [esp+18h+cbInBuffer] + cmp ebx, 0Eh ; LZMA_PROPS_SIZE + 8 + jnb short loc_4CD714 + xor al, al + pop ebx + add esp, 14h + retn +; --------------------------------------------------------------------------- + +loc_4CD714: ; CODE XREF: Decompress_lzma_internal+Bj + push ebp + mov ebp, [esp+1Ch+pcbOutBuffer] + push edi + mov edi, [esp+20h+pbInBuffer] + mov dword ptr [ebp+0], 0 + cmp byte ptr [edi], 0 + jnz short loc_4CD741 + push 5 + lea eax, [edi+1] + push eax + lea ecx, [esp+28h+var_10] + push ecx + call LzmaProps_Decode + add esp, 0Ch + test eax, eax + jz short loc_4CD74A + +loc_4CD741: ; CODE XREF: Decompress_lzma_internal+28j + pop edi + pop ebp + xor al, al + pop ebx + add esp, 14h + retn +; --------------------------------------------------------------------------- + +loc_4CD74A: ; CODE XREF: Decompress_lzma_internal+3Fj + mov edx, [esp+20h+var_10] + mov eax, [esp+20h+var_C] + lea ecx, [eax+edx] + mov edx, 300h + shl edx, cl + push esi + lea eax, [edx+edx+0E6Ch] + push eax + call [esp+28h+pfnAllocateMemory] + mov esi, eax + add esp, 4 + test esi, esi + mov [esp+24h+var_4], esi + jz short loc_4CD7AA + mov edx, [esp+24h+cbOutBuffer] + mov eax, [esp+24h+pbOutBuffer] + lea ecx, [esp+24h+cbInBuffer] + push ecx ; cbInBuffer + push edx ; cbOutBuffer + push eax ; pbOutBuffer + lea ecx, [esp+30h+var_14] + push ecx ; &var_14 + add ebx, 0FFFFFFF2h + push ebx ; cbInBuffer - LZMA86_HEADER_SIZE + add edi, 0Eh + lea edx, [esp+38h+var_10] + push edi ; pbInBuffer + LZMA86_HEADER_SIZE + push edx ; dest + call sub_4CCC80 + push esi + mov edi, eax + call [esp+44h+pfnFreeMemory] + add esp, 20h + test edi, edi + jz short loc_4CD7B4 + +loc_4CD7AA: ; CODE XREF: Decompress_lzma_internal+74j + pop esi + pop edi + pop ebp + xor al, al + pop ebx + add esp, 14h + retn +; --------------------------------------------------------------------------- + +loc_4CD7B4: ; CODE XREF: Decompress_lzma_internal+A8j + mov eax, [esp+24h+cbInBuffer] + pop esi + pop edi + mov [ebp+0], eax + pop ebp + mov al, 1 + pop ebx + add esp, 14h + retn +_starcraft_decompress_lzma ENDP + +; =============== S U B R O U T I N E ======================================= + +sub_4CD7D0 proc near ; CODE XREF: sub_4CDC00+74p + +arg_0 = dword ptr 4 + + push esi + mov esi, [esp+4+arg_0] + or esi, 8 + xor eax, eax + cmp esi, 1 + jz short loc_4CD806 + push edi + +loc_4CD7E0: ; CODE XREF: sub_4CD7D0+33j + mov edx, esi + shr esi, 1 + mov edi, [ecx+esi*4] + and edx, 1 + sub edi, edx + neg edx + xor edi, edx + shr edi, 2 + and edi, 1FFh + add eax, dword_550998[edi*4] + cmp esi, 1 + jnz short loc_4CD7E0 + pop edi + +loc_4CD806: ; CODE XREF: sub_4CD7D0+Dj + pop esi + retn 4 +sub_4CD7D0 endp + +; --------------------------------------------------------------------------- + align 10h +; =============== S U B R O U T I N E ======================================= + +sub_4CD810 proc near ; CODE XREF: CEncoder_FillAlignPrices+17p + +var_4 = dword ptr -4 +arg_0 = dword ptr 4 + + push ecx + push ebx + push ebp + push esi + xor eax, eax + push edi + mov edi, [esp+14h+arg_0] + mov [esp+14h+var_4], ecx + lea esi, [eax+1] + lea ebx, [eax+4] + +loc_4CD825: ; CODE XREF: sub_4CD810+42j + mov ecx, [esp+14h+var_4] + mov ecx, [ecx+esi*4] + mov edx, edi + and edx, 1 + sub ecx, edx + mov ebp, edx + neg ebp + xor ecx, ebp + shr ecx, 2 + and ecx, 1FFh + add eax, dword_550998[ecx*4] + add esi, esi + shr edi, 1 + or esi, edx + sub ebx, 1 + jnz short loc_4CD825 + pop edi + pop esi + pop ebp + pop ebx + pop ecx + retn 4 +sub_4CD810 endp + +; --------------------------------------------------------------------------- + align 10h +; =============== S U B R O U T I N E ======================================= + +sub_4CD860 proc near ; CODE XREF: CEncoder_FillDistancesPrices+6Bp + +arg_0 = dword ptr 4 +arg_4 = dword ptr 8 +arg_8 = dword ptr 0Ch + + push edi + mov edi, [esp+4+arg_4] + xor eax, eax + test edi, edi + lea edx, [eax+1] + jz short loc_4CD8A7 + push ebx + push ebp + push esi + mov esi, [esp+10h+arg_8] + +loc_4CD875: ; CODE XREF: sub_4CD860+42j + mov ebx, [esp+10h+arg_0] + mov ebx, [ebx+edx*4] + mov ecx, esi + and ecx, 1 + sub ebx, ecx + mov ebp, ecx + neg ebp + xor ebx, ebp + shr ebx, 2 + and ebx, 1FFh + add eax, dword_550998[ebx*4] + add edx, edx + shr esi, 1 + or edx, ecx + sub edi, 1 + jnz short loc_4CD875 + pop esi + pop ebp + pop ebx + +loc_4CD8A7: ; CODE XREF: sub_4CD860+Cj + pop edi + retn +sub_4CD860 endp + +; --------------------------------------------------------------------------- + align 10h +; =============== S U B R O U T I N E ======================================= + +sub_4CD8B0 proc near ; CODE XREF: CEncoder_CodeOneBlock+7B8p + mov eax, [ecx+24h] + mov edx, [ecx+1Ch] + push ebx + push esi + mov esi, [ecx+30h] + xor ebx, ebx + push edi + mov edi, [ecx+34h] + sub esi, eax + sbb edi, ebx + add esi, edx + adc edi, ebx + cmp eax, edx + jbe short loc_4CD8D4 + mov eax, [ecx+28h] + add esi, eax + adc edi, ebx + +loc_4CD8D4: ; CODE XREF: sub_4CD8B0+1Bj + mov eax, [ecx] + xor edx, edx + add eax, esi + adc edx, edi + pop edi + add eax, 4 + pop esi + adc edx, ebx + pop ebx + retn +sub_4CD8B0 endp + +; --------------------------------------------------------------------------- + align 10h +; =============== S U B R O U T I N E ======================================= + +sub_4CD8F0 proc near ; CODE XREF: sub_4CD940+21p + ; .text:loc_4CF730j ... + mov eax, dword_553598 + test eax, eax + push esi + mov esi, ecx + push edi + mov edi, [esi] + jnz short loc_4CD92A + push 0Ch ; Size + call _operator_new ; operator new(uint) + add esp, 4 + test eax, eax + jz short loc_4CD923 + mov dword ptr [eax], 0 + mov dword ptr [eax+4], 0 + mov dword ptr [eax+8], 0 + jmp short loc_4CD925 +; --------------------------------------------------------------------------- + +loc_4CD923: ; CODE XREF: sub_4CD8F0+1Bj + xor eax, eax + +loc_4CD925: ; CODE XREF: sub_4CD8F0+31j + mov dword_553598, eax + +loc_4CD92A: ; CODE XREF: sub_4CD8F0+Dj + mov eax, [eax+4] + test eax, eax + jz short loc_4CD937 + push edi + call eax + add esp, 4 + +loc_4CD937: ; CODE XREF: sub_4CD8F0+3Fj + pop edi + mov dword ptr [esi], 0 + pop esi + retn +sub_4CD8F0 endp + +; =============== S U B R O U T I N E ======================================= + +sub_4CD940 proc near ; CODE XREF: sub_4D0270+74p + +arg_0 = dword ptr 4 +arg_4 = dword ptr 8 + + push ebx + mov ebx, [esp+4+arg_4] + push esi + mov esi, ecx + cmp dword ptr [esi], 0 + push edi + mov edi, [esp+0Ch+arg_0] + jz short loc_4CD95F + mov eax, [esi+8] + add eax, [esi+4] + lea ecx, [edi+ebx] + cmp ecx, eax + jz short loc_4CD981 + +loc_4CD95F: ; CODE XREF: sub_4CD940+10j + mov ecx, esi + call sub_4CD8F0 + lea ecx, [edi+ebx] + mov edx, 1 + shl edx, cl + imul edx, 0C00h + push edx + call sub_4CB8A0 + add esp, 4 + mov [esi], eax + +loc_4CD981: ; CODE XREF: sub_4CD940+1Dj + mov ecx, edi + mov eax, 1 + shl eax, cl + mov [esi+8], edi + pop edi + mov [esi+4], ebx + sub eax, 1 + mov [esi+0Ch], eax + xor eax, eax + cmp [esi], eax + pop esi + setnz al + pop ebx + retn 8 +sub_4CD940 endp + +; --------------------------------------------------------------------------- + align 10h +; =============== S U B R O U T I N E ======================================= + + +sub_4CD9B0 proc near ; CODE XREF: CEncoder_GetOptimum+436p + ; CEncoder_GetOptimum+AE1p + +arg_0 = dword ptr 4 +arg_4 = byte ptr 8 +arg_8 = dword ptr 0Ch + + mov edx, [esp+arg_0] + test edx, edx + push esi + jnz short loc_4CD9F2 + movzx eax, [esp+4+arg_4] + mov edx, eax + shl edx, 4 + add edx, [esp+4+arg_8] + mov esi, 800h + sub esi, [ecx+edx*4+284B0h] + mov ecx, [ecx+eax*4+28420h] + shr esi, 2 + mov eax, dword_550998[esi*4] + shr ecx, 2 + add eax, dword_550998[ecx*4] + pop esi + retn 0Ch +; --------------------------------------------------------------------------- + +loc_4CD9F2: ; CODE XREF: sub_4CD9B0+7j + movzx esi, [esp+4+arg_4] + mov eax, 800h + sub eax, [ecx+esi*4+28420h] + shr eax, 2 + cmp edx, 1 + mov eax, dword_550998[eax*4] + jnz short loc_4CDA27 + mov ecx, [ecx+esi*4+28450h] + shr ecx, 2 + add eax, dword_550998[ecx*4] + pop esi + retn 0Ch +; --------------------------------------------------------------------------- + +loc_4CDA27: ; CODE XREF: sub_4CD9B0+60j + push edi + add edx, 0FFFFFFFEh + mov edi, 800h + sub edi, [ecx+esi*4+28450h] + mov ecx, [ecx+esi*4+28480h] + sub ecx, edx + neg edx + xor ecx, edx + shr edi, 2 + mov edx, dword_550998[edi*4] + shr ecx, 2 + and ecx, 1FFh + add edx, dword_550998[ecx*4] + pop edi + add eax, edx + pop esi + retn 0Ch +sub_4CD9B0 endp + +; --------------------------------------------------------------------------- + align 10h + +; =============== S U B R O U T I N E ======================================= + + +sub_4CDA70 proc near ; CODE XREF: CEncoder_CodeReal+10Cp + ; CEncoder_CodeReal+134p ... + push esi + mov esi, [ecx] + cmp dword ptr [esi+80h], 0 + jz short loc_4CDA8C + cmp byte ptr [esi+33B95h], 0 + jz short loc_4CDA8C + mov byte ptr [esi+33B95h], 0 + +loc_4CDA8C: ; CODE XREF: sub_4CDA70+Aj + ; sub_4CDA70+13j + mov eax, [esi+33B8Ch] + test eax, eax + jz short loc_4CDAA8 + mov ecx, [eax] + mov edx, [ecx+8] + push eax + call edx + mov dword ptr [esi+33B8Ch], 0 + +loc_4CDAA8: ; CODE XREF: sub_4CDA70+24j + mov ecx, [esi+4] + mov edx, [ecx+10h] + lea eax, [esi+4] + push eax + call edx + pop esi + retn +sub_4CDA70 endp + +; --------------------------------------------------------------------------- + align 10h +; =============== S U B R O U T I N E ======================================= + + +sub_4CDAC0 proc near ; CODE XREF: CEncoder_GetOptimum+2C4p + ; CEncoder_GetOptimum+7ACp ... + +var_4 = dword ptr -4 +arg_0 = dword ptr 4 +arg_4 = byte ptr 8 +arg_8 = byte ptr 0Ch + + push ecx + push ebx + push ebp + xor ebp, ebp + cmp byte ptr [esp+0Ch+arg_0], 0 + push esi + mov eax, ecx + push edi + mov [esp+14h+var_4], eax + lea edi, [ebp+1] + lea ebx, [ebp+8] + jz short loc_4CDB3B + movzx ecx, [esp+14h+arg_8] + mov [esp+14h+arg_0], ecx + +loc_4CDAE3: ; CODE XREF: sub_4CDAC0+71j + movzx esi, [esp+14h+arg_4] + mov edx, [esp+14h+arg_0] + sub ebx, 1 + movzx ecx, bl + shr esi, cl + shr edx, cl + and esi, 1 + mov ecx, esi + shl ecx, 8 + add ecx, edi + mov eax, [eax+ecx*4+400h] + and edx, 1 + sub eax, edx + mov ecx, edx + neg ecx + xor eax, ecx + shr eax, 2 + and eax, 1FFh + add ebp, dword_550998[eax*4] + add edi, edi + or edi, edx + cmp esi, edx + jnz short loc_4CDB33 + test ebx, ebx + jz short loc_4CDB75 + mov eax, [esp+14h+var_4] + jmp short loc_4CDAE3 +; --------------------------------------------------------------------------- + +loc_4CDB33: ; CODE XREF: sub_4CDAC0+67j + test ebx, ebx + jz short loc_4CDB75 + mov eax, [esp+14h+var_4] + +loc_4CDB3B: ; CODE XREF: sub_4CDAC0+18j + movzx edx, [esp+14h+arg_8] + mov [esp+14h+arg_0], edx + +loc_4CDB44: ; CODE XREF: sub_4CDAC0+B3j + mov edx, [esp+14h+arg_0] + sub ebx, 1 + mov cl, bl + shr edx, cl + mov ecx, [eax+edi*4] + add edi, edi + and edx, 1 + sub ecx, edx + mov esi, edx + neg esi + xor ecx, esi + shr ecx, 2 + and ecx, 1FFh + add ebp, dword_550998[ecx*4] + or edi, edx + test ebx, ebx + jnz short loc_4CDB44 + +loc_4CDB75: ; CODE XREF: sub_4CDAC0+6Bj + ; sub_4CDAC0+75j + pop edi + pop esi + mov eax, ebp + pop ebp + pop ebx + pop ecx + retn 0Ch +sub_4CDAC0 endp + +; --------------------------------------------------------------------------- + align 10h +; =============== S U B R O U T I N E ======================================= + +sub_4CDB80 proc near ; CODE XREF: sub_4CDEA0+11Ep + ; sub_4CDEA0+137p + +arg_0 = dword ptr 4 + + push esi + mov esi, [esp+4+arg_0] + test esi, esi + mov edx, 400h + push edi + mov [ecx], edx + mov [ecx+4], edx + jbe short loc_4CDBE6 + lea eax, [ecx+20Ch] + lea ebx, [ebx+0] + +loc_4CDBA0: ; CODE XREF: sub_4CDB80+64j + mov [eax-200h], edx + mov [eax-1FCh], edx + mov [eax-1F8h], edx + mov [eax-1F4h], edx + mov [eax-1F0h], edx + mov [eax-1ECh], edx + mov [eax-1E8h], edx + mov [eax], edx + mov [eax+4], edx + mov [eax+8], edx + mov [eax+0Ch], edx + mov [eax+10h], edx + mov [eax+14h], edx + mov [eax+18h], edx + add eax, 20h + sub esi, 1 + jnz short loc_4CDBA0 + +loc_4CDBE6: ; CODE XREF: sub_4CDB80+12j + lea edi, [ecx+40Ch] + mov ecx, 0FFh + mov eax, edx + rep stosd + pop edi + pop esi + retn 4 +sub_4CDB80 endp + +; --------------------------------------------------------------------------- + align 10h +; =============== S U B R O U T I N E ======================================= + +sub_4CDC00 proc near ; CODE XREF: sub_4CF740+22p + ; sub_4CF780+2Bp + +var_C = dword ptr -0Ch +var_8 = dword ptr -8 +var_4 = dword ptr -4 +arg_0 = dword ptr 4 +arg_4 = dword ptr 8 +arg_8 = dword ptr 0Ch + + sub esp, 0Ch + push ebx + push ebp + push esi + push edi + mov edi, ecx + mov eax, [edi] + mov ebx, [esp+1Ch+arg_0] + mov ecx, eax + shr ecx, 2 + mov edx, dword_550998[ecx*4] + mov ecx, 800h + sub ecx, eax + shr ecx, 2 + mov eax, dword_550998[ecx*4] + mov ecx, [edi+4] + mov [esp+1Ch+var_C], edx + mov edx, ecx + shr edx, 2 + mov ebp, dword_550998[edx*4] + mov edx, 800h + sub edx, ecx + shr edx, 2 + mov ecx, dword_550998[edx*4] + add ebp, eax + add ecx, eax + mov [esp+1Ch+var_8], ebp + mov [esp+1Ch+var_4], ecx + xor esi, esi + mov edi, edi + +loc_4CDC60: ; CODE XREF: sub_4CDC00+8Aj + cmp esi, [esp+1Ch+arg_4] + jnb loc_4CDD62 + mov eax, ebx + shl eax, 5 + push esi + lea ecx, [eax+edi+8] + call sub_4CD7D0 + add eax, [esp+1Ch+var_C] + mov ecx, [esp+1Ch+arg_8] + mov [ecx+esi*4], eax + add esi, 1 + cmp esi, 8 + jb short loc_4CDC60 + cmp esi, 10h + jnb short loc_4CDD00 + lea ecx, [esi-8] + mov [esp+1Ch+arg_0], ecx + jmp short loc_4CDCA0 +; --------------------------------------------------------------------------- + align 10h + +loc_4CDCA0: ; CODE XREF: sub_4CDC00+98j + ; sub_4CDC00+FEj + cmp esi, [esp+1Ch+arg_4] + jnb loc_4CDD62 + or ecx, 8 + xor edx, edx + cmp ecx, 1 + jz short loc_4CDCE4 + +loc_4CDCB4: ; CODE XREF: sub_4CDC00+DEj + mov eax, ecx + shr ecx, 1 + and eax, 1 + lea ebp, [ecx+ebx*8] + mov ebp, [edi+ebp*4+208h] + sub ebp, eax + neg eax + xor ebp, eax + shr ebp, 2 + and ebp, 1FFh + add edx, dword_550998[ebp*4] + cmp ecx, 1 + jnz short loc_4CDCB4 + mov ebp, [esp+1Ch+var_8] + +loc_4CDCE4: ; CODE XREF: sub_4CDC00+B2j + mov eax, [esp+1Ch+arg_8] + mov ecx, [esp+1Ch+arg_0] + add edx, ebp + mov [eax+esi*4], edx + add esi, 1 + add ecx, 1 + cmp esi, 10h + mov [esp+1Ch+arg_0], ecx + jb short loc_4CDCA0 + +loc_4CDD00: ; CODE XREF: sub_4CDC00+8Fj + cmp esi, [esp+1Ch+arg_4] + jnb short loc_4CDD62 + lea ebx, [esi-10h] + lea esp, [esp+0] + +loc_4CDD10: ; CODE XREF: sub_4CDC00+160j + mov ecx, ebx + or ecx, 100h + xor edx, edx + cmp ecx, 1 + jz short loc_4CDD49 + nop + +loc_4CDD20: ; CODE XREF: sub_4CDC00+147j + mov eax, ecx + shr ecx, 1 + mov ebp, [edi+ecx*4+408h] + and eax, 1 + sub ebp, eax + neg eax + xor ebp, eax + shr ebp, 2 + and ebp, 1FFh + add edx, dword_550998[ebp*4] + cmp ecx, 1 + jnz short loc_4CDD20 + +loc_4CDD49: ; CODE XREF: sub_4CDC00+11Dj + mov ecx, [esp+1Ch+var_4] + mov eax, [esp+1Ch+arg_8] + add edx, ecx + mov [eax+esi*4], edx + add esi, 1 + add ebx, 1 + cmp esi, [esp+1Ch+arg_4] + jb short loc_4CDD10 + +loc_4CDD62: ; CODE XREF: sub_4CDC00+64j + ; sub_4CDC00+A4j ... + pop edi + pop esi + pop ebp + pop ebx + add esp, 0Ch + retn 0Ch +sub_4CDC00 endp + +; --------------------------------------------------------------------------- + align 10h +; =============== S U B R O U T I N E ======================================= + +; int __cdecl sub_4CDD70(SIZE_T dwSize) +sub_4CDD70 proc near ; DATA XREF: .data:off_546E20o + +dwSize = dword ptr 4 + + mov eax, [esp+dwSize] + test eax, eax + jnz short loc_4CDD79 + retn +; --------------------------------------------------------------------------- + +loc_4CDD79: ; CODE XREF: sub_4CDD70+6j + push 4 ; flProtect + push 1000h ; flAllocationType + push eax ; dwSize + push 0 ; lpAddress + call ds:VirtualAlloc + retn +sub_4CDD70 endp + +; --------------------------------------------------------------------------- + align 10h +; =============== S U B R O U T I N E ======================================= + + +; int __cdecl sub_4CDD90(void * lpAddress) +sub_4CDD90 proc near ; CODE XREF: sub_4CF810+53p + ; sub_4CF810+73p + ; DATA XREF: ... + +lpAddress = dword ptr 4 + + mov eax, [esp+lpAddress] + test eax, eax + jz short locret_4CDDA6 + push 8000h ; dwFreeType + push 0 ; dwSize + push eax ; lpAddress + call ds:VirtualFree + +locret_4CDDA6: ; CODE XREF: sub_4CDD90+6j + retn +sub_4CDD90 endp + +; --------------------------------------------------------------------------- + align 10h +; =============== S U B R O U T I N E ======================================= + + +sub_4CDDB0 proc near ; DATA XREF: .rdata:00517AC8o + +var_10 = dword ptr -10h +var_C = byte ptr -0Ch +var_B = byte ptr -0Bh +var_A = byte ptr -0Ah +var_9 = byte ptr -9 +var_8 = byte ptr -8 +var_4 = dword ptr -4 +arg_0 = dword ptr 4 +arg_4 = dword ptr 8 + + sub esp, 10h + mov eax, dword_544960 + xor eax, esp + mov [esp+10h+var_4], eax + mov ecx, [esp+10h+arg_0] + mov al, [ecx+33B50h] + mov dl, 5 + imul dl + add al, [ecx+33B58h] + mov dl, 9 + imul dl + add al, [ecx+33B5Ch] + push ebp + mov ebp, [esp+14h+arg_4] + mov [esp+14h+var_C], al + mov eax, [ecx+33B60h] + mov ecx, eax + mov edx, eax + push esi + shr ecx, 8 + shr edx, 10h + mov [esp+18h+var_B], al + shr eax, 18h + push edi + mov [esp+1Ch+var_A], cl + mov [esp+1Ch+var_9], dl + mov [esp+1Ch+var_8], al + mov esi, 5 + lea edi, [esp+1Ch+var_C] + +loc_4CDE13: ; CODE XREF: sub_4CDDB0+85j + mov eax, [ebp+0] + mov edx, [eax+0Ch] + lea ecx, [esp+1Ch+var_10] + push ecx + push esi + push edi + push ebp + call edx + mov ecx, [esp+1Ch+var_10] + add edi, ecx + sub esi, ecx + test eax, eax + jnz short loc_4CDE37 + test ecx, ecx + jz short loc_4CDE4B + test esi, esi + jnz short loc_4CDE13 + +loc_4CDE37: ; CODE XREF: sub_4CDDB0+7Dj + pop edi + pop esi + pop ebp + mov ecx, [esp+10h+var_4] + xor ecx, esp + call sub_4A0686 + add esp, 10h + retn 8 +; --------------------------------------------------------------------------- + +loc_4CDE4B: ; CODE XREF: sub_4CDDB0+81j + mov ecx, [esp+1Ch+var_4] + pop edi + pop esi + pop ebp + xor ecx, esp + mov eax, 80004005h + call sub_4A0686 + add esp, 10h + retn 8 +sub_4CDDB0 endp + + align 10h + +; =============== S U B R O U T I N E ======================================= + +sub_4CDE70 proc near ; DATA XREF: .rdata:00517AF4o + +arg_0 = dword ptr 4 + + push esi + mov esi, [esp+4+arg_0] + mov eax, [esi+50h] + test eax, eax + jz short loc_4CDE8B + mov ecx, [eax] + mov edx, [ecx+8] + push eax + call edx + mov dword ptr [esi+50h], 0 + +loc_4CDE8B: ; CODE XREF: sub_4CDE70+Aj + xor eax, eax + pop esi + retn 4 +sub_4CDE70 endp + +; --------------------------------------------------------------------------- + align 10h +; =============== S U B R O U T I N E ======================================= + + +sub_4CDEA0 proc near ; CODE XREF: CEncoder_SetStreams+3Cp + +var_4 = dword ptr -4 + + push ecx + push ebx + xor ebx, ebx + push ebp + push esi + mov esi, ecx + mov byte ptr [esi+10h], 0 + mov byte ptr [esi+11h], 0 + mov [esi+14h], ebx + mov [esi+18h], ebx + mov [esi+1Ch], ebx + mov [esi+20h], ebx + mov eax, [esi+50h] + mov [esi+4Ch], ebx + mov [esi+48h], eax + mov [esi+44h], ebx + mov [esi+58h], ebx + mov [esi+5Ch], ebx + mov [esi+64h], bl + push edi + mov [esi+30h], ebx + mov [esi+34h], ebx + mov dword ptr [esi+38h], 0FFFFFFFFh + mov dword ptr [esi+28h], 1 + mov [esi+2Ch], bl + lea ecx, [esi+28420h] + lea edi, [esi+284B0h] + mov [esp+14h+var_4], 0Ch + mov ebp, 400h + +loc_4CDF02: ; CODE XREF: sub_4CDEA0+9Cj + xor edx, edx + mov eax, edi + jmp short loc_4CDF10 +; --------------------------------------------------------------------------- + align 10h + +loc_4CDF10: ; CODE XREF: sub_4CDEA0+66j + ; sub_4CDEA0+84j + mov [eax-3C0h], ebp + mov [eax], ebp + add edx, 1 + add eax, 4 + cmp edx, [esi+33B60h] + jbe short loc_4CDF10 + mov [ecx-30h], ebp + mov [ecx], ebp + mov [ecx+30h], ebp + mov [ecx+60h], ebp + add ecx, 4 + add edi, 40h + sub [esp+14h+var_4], 1 + jnz short loc_4CDF02 + mov ecx, [esi+32658h] + add ecx, [esi+32654h] + mov eax, 1 + shl eax, cl + cmp eax, ebx + jbe short loc_4CDF7C + xor edx, edx + mov ebx, eax + lea esp, [esp+0] + +loc_4CDF60: ; CODE XREF: sub_4CDEA0+DAj + mov edi, [esi+32650h] + add edi, edx + mov ecx, 300h + mov eax, ebp + add edx, 0C00h + sub ebx, 1 + rep stosd + jnz short loc_4CDF60 + +loc_4CDF7C: ; CODE XREF: sub_4CDEA0+B3j + lea edx, [esi+287B4h] + mov ebx, 4 + +loc_4CDF87: ; CODE XREF: sub_4CDEA0+FBj + mov edi, edx + mov ecx, 3Fh + mov eax, ebp + add edx, 100h + sub ebx, 1 + rep stosd + jnz short loc_4CDF87 + lea edi, [esi+28BB0h] + mov ecx, 72h + rep stosd + mov ecx, [esi+33B5Ch] + mov edx, 1 + shl edx, cl + lea ecx, [esi+28DB8h] + push edx + call sub_4CDB80 + mov ecx, [esi+33B5Ch] + mov eax, 1 + shl eax, cl + lea ecx, [esi+2DA04h] + push eax + call sub_4CDB80 + mov eax, ebp + mov [esi+28D7Ch], eax + mov [esi+28D80h], eax + mov [esi+28D84h], eax + mov [esi+28D88h], eax + mov [esi+28D8Ch], eax + mov [esi+28D90h], eax + mov [esi+28D94h], eax + mov [esi+28D98h], eax + mov [esi+28D9Ch], eax + mov [esi+28DA0h], eax + mov [esi+28DA4h], eax + mov [esi+28DA8h], eax + mov [esi+28DACh], eax + mov [esi+28DB0h], eax + mov [esi+28DB4h], eax + xor eax, eax + pop edi + mov [esi+32F10h], bl + mov [esi+32F08h], eax + mov [esi+32F0Ch], eax + mov [esi+32F04h], eax + pop esi + pop ebp + pop ebx + pop ecx + retn +sub_4CDEA0 endp + +; --------------------------------------------------------------------------- + align 10h +; =============== S U B R O U T I N E ======================================= + +sub_4CF450 proc near ; CODE XREF: .text:004CF692p + ; CEncoder_Flush+42p + +var_8 = dword ptr -8 +var_4 = dword ptr -4 + + sub esp, 8 + push esi + mov esi, ecx + mov eax, [esi+0Ch] + push edi + mov edi, [esi+4] + cmp eax, edi + jb short loc_4CF464 + mov edi, [esi+10h] + +loc_4CF464: ; CODE XREF: sub_4CF450+Fj + push ebp + mov ebp, [esi+20h] + xor edx, edx + sub edi, eax + cmp ebp, edx + mov [esp+14h+var_4], edx + jz short loc_4CF4BA + push ebx + mov ebx, [esi] + add ebx, eax + mov eax, dword_553598 + cmp eax, edx + jnz short loc_4CF4A5 + push 0Ch ; Size + call _operator_new ; operator new(uint) + xor ecx, ecx + add esp, 4 + cmp eax, ecx + jz short loc_4CF49C + mov [eax], ecx + mov [eax+4], ecx + mov [eax+8], ecx + jmp short loc_4CF49E +; --------------------------------------------------------------------------- + +loc_4CF49C: ; CODE XREF: sub_4CF450+40j + xor eax, eax + +loc_4CF49E: ; CODE XREF: sub_4CF450+4Aj + mov dword_553598, eax + xor edx, edx + +loc_4CF4A5: ; CODE XREF: sub_4CF450+30j + mov eax, [eax+8] + cmp eax, edx + jz short loc_4CF4B6 + push edi + push ebx + push ebp + call eax + add esp, 0Ch + xor edx, edx + +loc_4CF4B6: ; CODE XREF: sub_4CF450+5Aj + add [esi+20h], edi + pop ebx + +loc_4CF4BA: ; CODE XREF: sub_4CF450+22j + mov eax, [esi+14h] + cmp eax, edx + pop ebp + jz short loc_4CF4E4 + mov [esp+10h+var_8], edx + mov ecx, [eax] + lea edx, [esp+10h+var_8] + push edx + mov edx, [esi] + add edx, [esi+0Ch] + push edi + push edx + push eax + mov eax, [ecx+0Ch] + call eax + mov edi, [esp+10h+var_8] + mov [esp+10h+var_4], eax + xor edx, edx + +loc_4CF4E4: ; CODE XREF: sub_4CF450+70j + add [esi+0Ch], edi + mov ecx, [esi+0Ch] + mov eax, [esi+10h] + cmp ecx, eax + jnz short loc_4CF4F4 + mov [esi+0Ch], edx + +loc_4CF4F4: ; CODE XREF: sub_4CF450+9Fj + cmp [esi+4], eax + jnz short loc_4CF500 + mov byte ptr [esi+24h], 1 + mov [esi+4], edx + +loc_4CF500: ; CODE XREF: sub_4CF450+A7j + mov ecx, [esi+0Ch] + cmp ecx, [esi+4] + jbe short loc_4CF50A + mov eax, ecx + +loc_4CF50A: ; CODE XREF: sub_4CF450+B6j + add [esi+18h], edi + mov [esi+8], eax + mov eax, [esp+10h+var_4] + adc [esi+1Ch], edx + pop edi + pop esi + add esp, 8 + retn +sub_4CF450 endp + +; --------------------------------------------------------------------------- + align 10h + + +; --------------------------------------------------------------------------- + +; int __stdcall Interface1_QueryInterface(int, void *Buf1, int) +Interface1_QueryInterface proc near ; DATA XREF: .rdata:off_517A90o +; sub_4CF520 + +arg_0 = dword ptr 4 +Buf1 = dword ptr 8 +arg_8 = dword ptr 0Ch + + mov eax, [esp+Buf1] + push offset dword_512730 ; Buf2 + push eax ; Buf1 + call unknown_libname_324 ; MFC 3.1/4.0/4.2/8.0 32bit + add esp, 8 + test eax, eax + jz short loc_4CF54D + mov eax, [esp+arg_0] + mov ecx, [esp+arg_8] + mov [ecx], eax + mov edx, [eax] + push eax + mov eax, [edx+4] + call eax + xor eax, eax + retn 0Ch +loc_4CF54D: ; CODE XREF: Interface1_QueryInterface+14j + mov eax, 80004002h + retn 0Ch +Interface1_QueryInterface endp + +; --------------------------------------------------------------------------- + +; int __stdcall Interface1_Release(void *pUnknown) +Interface1_Release proc near ; DATA XREF: .rdata:00517A98o + +pUnknown = dword ptr 4 + + mov ecx, [esp+pUnknown] + add dword ptr [ecx+4], 0FFFFFFFFh + mov eax, [ecx+4] + jnz short locret_4CF585 + push ecx ; Memory + mov dword ptr [ecx], offset off_517A90 + mov dword ptr [ecx+8], 0 + call j__free + add esp, 4 + xor eax, eax + +locret_4CF585: ; CODE XREF: Interface1_Release+Bj + retn 4 +Interface1_Release endp + +; --------------------------------------------------------------------------- + +sub_4CF590 proc near ; DATA XREF: .rdata:00517AB4o + +arg_0 = dword ptr 4 +arg_4 = byte ptr 8 +arg_8 = dword ptr 0Ch +arg_C = dword ptr 10h + + mov eax, [esp+arg_0] + mov edx, [eax+10h] + sub edx, [eax+18h] + mov ecx, [eax+14h] + sbb ecx, [eax+1Ch] + push ebx + mov ebx, [esp+4+arg_8] + push edi + mov edi, [esp+8+arg_C] + cmp edi, ecx + jb short loc_4CF5C2 + ja short loc_4CF5B4 + cmp ebx, edx + jbe short loc_4CF5C2 + +loc_4CF5B4: ; CODE XREF: sub_4CF590+1Ej + pop edi + mov byte ptr [eax+20h], 1 + mov eax, 80004005h + pop ebx + retn 10h +; --------------------------------------------------------------------------- + +loc_4CF5C2: ; CODE XREF: sub_4CF590+1Cj + ; sub_4CF590+22j + push esi + xor esi, esi + xor ecx, ecx + test edi, edi + jb short loc_4CF5FA + ja short loc_4CF5D1 + test ebx, ebx + jbe short loc_4CF5FA + +loc_4CF5D1: ; CODE XREF: sub_4CF590+3Bj + mov dl, [esp+0Ch+arg_4] + push ebp + +loc_4CF5D6: ; CODE XREF: sub_4CF590+5Fj + ; sub_4CF590+67j + mov ebp, [eax+18h] + mov ebx, [eax+8] + mov [ebx+ebp], dl + add dword ptr [eax+18h], 1 + adc dword ptr [eax+1Ch], 0 + add esi, 1 + adc ecx, 0 + cmp ecx, edi + jb short loc_4CF5D6 + ja short loc_4CF5F9 + cmp esi, [esp+10h+arg_8] + jb short loc_4CF5D6 + +loc_4CF5F9: ; CODE XREF: sub_4CF590+61j + pop ebp + +loc_4CF5FA: ; CODE XREF: sub_4CF590+39j + ; sub_4CF590+3Fj + pop esi + pop edi + xor eax, eax + pop ebx + retn 10h +sub_4CF590 endp + +; =============== S U B R O U T I N E ======================================= + +; int __stdcall Interface2_Release(void *pUnknown) +Interface2_Release proc near ; DATA XREF: .rdata:00517AACo +; sub_4CF610 + +pUnknown = dword ptr 4 + + mov ecx, [esp+pUnknown] + add dword ptr [ecx+4], 0FFFFFFFFh + mov eax, [ecx+4] + jnz short locret_4CF635 + push ecx ; Memory + mov dword ptr [ecx], offset off_517AA4 + mov dword ptr [ecx+8], 0 + call j__free + add esp, 4 + xor eax, eax + +locret_4CF635: ; CODE XREF: Interface2_Release+Bj + retn 4 +Interface2_Release endp + +; =============== S U B R O U T I N E ======================================= + +loc_4CF640: ; CODE XREF: sub_4CF6E0+39p + ; sub_4CFAC0+57p ... + push ecx + push ebx + push esi + push edi + mov edi, ecx + mov esi, [edi+8] + cmp esi, 0FF000000h + jb short loc_4CF661 + mov edx, [edi+0Ch] + mov eax, esi + mov cl, 20h + call __allshr ; Microsoft VisualC 2-8/net runtime + test eax, eax + jz short loc_4CF6B6 + +loc_4CF661: ; CODE XREF: .text:004CF64Fj + mov bl, [edi+4] + lea esi, [edi+18h] + +loc_4CF667: ; CODE XREF: .text:004CF6A9j + mov eax, [edi+8] + mov edx, [edi+0Ch] + mov cl, 20h + call __allshr ; Microsoft VisualC 2-8/net runtime + mov ecx, [esi+4] + mov edx, [esi] + add al, bl + mov [ecx+edx], al + add dword ptr [esi+4], 1 + mov eax, [esi+4] + cmp eax, [esi+8] + jnz short loc_4CF6A3 + cmp [esi+0Ch], eax + jz short loc_4CF6A3 + nop + +loc_4CF690: ; CODE XREF: .text:004CF6A1j + mov ecx, esi + call sub_4CF450 + test eax, eax + jnz short loc_4CF6CB + mov eax, [esi+0Ch] + cmp eax, [esi+4] + jnz short loc_4CF690 + +loc_4CF6A3: ; CODE XREF: .text:004CF688j + ; .text:004CF68Dj + or bl, 0FFh + add dword ptr [edi], 0FFFFFFFFh + jnz short loc_4CF667 + mov esi, [edi+8] + mov edx, esi + shr edx, 18h + mov [edi+4], dl + +loc_4CF6B6: ; CODE XREF: .text:004CF65Fj + add dword ptr [edi], 1 + shl esi, 8 + mov [edi+8], esi + mov dword ptr [edi+0Ch], 0 + pop edi + pop esi + pop ebx + pop ecx + retn + +; --------------------------------------------------------------------------- + +loc_4CF6CB: ; CODE XREF: .text:004CF699j + push offset dword_526DD0 + lea ecx, [esp+10h] + push ecx + mov [esp+14h], eax + int 3 +; call __CxxThrowException@8 ; _CxxThrowException(x,x) +; --------------------------------------------------------------------------- + + db 2 dup(0CCh) + +; =============== S U B R O U T I N E ======================================= + + +sub_4CF6E0 proc near ; CODE XREF: sub_4D0770+FBp + ; CEncoder_CodeOneBlock+6C5p + +arg_0 = dword ptr 4 +arg_4 = dword ptr 8 + + push esi + push edi + mov edi, [esp+8+arg_4] + add edi, 0FFFFFFFFh + mov esi, ecx + js short loc_4CF724 + push ebp + mov ebp, [esp+0Ch+arg_0] + +loc_4CF6F2: ; CODE XREF: sub_4CF6E0+41j + shr dword ptr [esi+10h], 1 + mov eax, [esi+10h] + mov edx, ebp + mov ecx, edi + shr edx, cl + test dl, 1 + jz short loc_4CF70A + add [esi+8], eax + adc dword ptr [esi+0Ch], 0 + +loc_4CF70A: ; CODE XREF: sub_4CF6E0+21j + cmp eax, 1000000h + jnb short loc_4CF71E + shl eax, 8 + mov ecx, esi + mov [esi+10h], eax + call loc_4CF640 + +loc_4CF71E: ; CODE XREF: sub_4CF6E0+2Fj + sub edi, 1 + jns short loc_4CF6F2 + pop ebp + +loc_4CF724: ; CODE XREF: sub_4CF6E0+Bj + pop edi + pop esi + retn 8 +sub_4CF6E0 endp + +; --------------------------------------------------------------------------- + align 10h +; =============== S U B R O U T I N E ======================================= + +sub_4CF740 proc near ; CODE XREF: sub_4D0770+DFp + ; CEncoder_CodeOneBlock+58Ap ... + +arg_0 = dword ptr 4 + + push esi + push edi + mov edi, [esp+8+arg_0] + mov eax, edi + imul eax, 440h + mov esi, ecx + mov edx, [esi+4C08h] + lea ecx, [eax+esi+808h] + push ecx + push edx + push edi + mov ecx, esi + call sub_4CDC00 + mov eax, [esi+4C08h] + mov [esi+edi*4+4C0Ch], eax + pop edi + pop esi + retn 4 +sub_4CF740 endp + +; --------------------------------------------------------------------------- + align 10h +; =============== S U B R O U T I N E ======================================= + +sub_4CF780 proc near ; CODE XREF: CEncoder_SetStreams+7Ep + ; CEncoder_SetStreams+A6p + +arg_0 = dword ptr 4 + + push esi + push edi + xor edi, edi + cmp [esp+8+arg_0], edi + mov esi, ecx + jbe short loc_4CF7CC + push ebx + push ebp + lea ebx, [esi+4C0Ch] + lea ebp, [esi+808h] + lea ebx, [ebx+0] + +loc_4CF7A0: ; CODE XREF: sub_4CF780+48j + mov eax, [esi+4C08h] + push ebp + push eax + push edi + mov ecx, esi + call sub_4CDC00 + mov ecx, [esi+4C08h] + mov [ebx], ecx + add edi, 1 + add ebx, 4 + add ebp, 440h + cmp edi, [esp+10h+arg_0] + jb short loc_4CF7A0 + pop ebp + pop ebx + +loc_4CF7CC: ; CODE XREF: sub_4CF780+Aj + pop edi + pop esi + retn 4 +sub_4CF780 endp + +; --------------------------------------------------------------------------- + align 10h +CEncoder_GetOptimum proc near ; CODE XREF: CEncoder_CodeOneBlock+201p + +var_7D = byte ptr -7Dh +var_7C = dword ptr -7Ch +var_78 = dword ptr -78h +var_74 = dword ptr -74h +var_70 = dword ptr -70h +var_6C = dword ptr -6Ch +var_68 = dword ptr -68h +var_64 = dword ptr -64h +var_60 = dword ptr -60h +var_5C = dword ptr -5Ch +var_58 = dword ptr -58h +var_54 = dword ptr -54h +var_50 = dword ptr -50h +var_4C = dword ptr -4Ch +var_48 = dword ptr -48h +var_44 = dword ptr -44h +var_40 = dword ptr -40h +var_3C = dword ptr -3Ch +var_38 = dword ptr -38h +var_34 = dword ptr -34h +var_30 = dword ptr -30h +var_2C = dword ptr -2Ch +var_28 = dword ptr -28h +var_24 = dword ptr -24h +var_20 = dword ptr -20h +var_1C = dword ptr -1Ch +var_18 = dword ptr -18h +var_14 = dword ptr -14h +var_10 = dword ptr -10h +arg_0 = dword ptr 4 +arg_4 = dword ptr 8 + + sub esp, 80h + push ebp + mov ebp, ecx + mov edx, [ebp+32F0Ch] + cmp [ebp+32F08h], edx + push esi + jz short loc_4CE0A5 + mov esi, [esp+88h+arg_4] + lea eax, [edx+edx*4+1Eh] + lea ecx, [ebp+eax*8+0] + mov eax, [ecx+10h] + sub eax, edx + mov edx, [ecx+14h] + mov [esi], edx + mov ecx, [ecx+10h] + pop esi + mov [ebp+32F0Ch], ecx + pop ebp + add esp, 80h + retn 8 +; --------------------------------------------------------------------------- + +loc_4CE0A5: ; CODE XREF: CEncoder_GetOptimum+16j + mov edx, [ebp+80h] + mov eax, [ebp+70h] + push ebx + xor esi, esi + push edx + mov [ebp+32F08h], esi + mov [ebp+32F0Ch], esi + call eax + add esp, 4 + cmp byte ptr [ebp+32F10h], 0 + mov ebx, eax + mov [esp+8Ch+var_60], eax + jnz short loc_4CE0E4 + lea ecx, [esp+8Ch+var_70] + push ecx + mov ecx, ebp + call sub_4CB3B0 + mov [esp+8Ch+var_68], eax + jmp short loc_4CE0FF +; --------------------------------------------------------------------------- + +loc_4CE0E4: ; CODE XREF: CEncoder_GetOptimum+70j + mov edx, [ebp+32EFCh] + mov eax, [ebp+32F00h] + mov [esp+8Ch+var_68], edx + mov [esp+8Ch+var_70], eax + mov byte ptr [ebp+32F10h], 0 + +loc_4CE0FF: ; CODE XREF: CEncoder_GetOptimum+82j + mov ecx, [ebp+80h] + mov edx, [ebp+74h] + push edi + push ecx + call edx + mov edi, eax + add esp, 4 + sub edi, 1 + cmp ebx, 2 + jnb short loc_4CE138 + mov eax, [esp+90h+arg_4] + pop edi + pop ebx + pop esi + mov dword ptr [eax], 0FFFFFFFFh + mov eax, 1 + pop ebp + add esp, 80h + retn 8 +; --------------------------------------------------------------------------- + +loc_4CE138: ; CODE XREF: CEncoder_GetOptimum+B7j + cmp ebx, 111h + jbe short loc_4CE149 + mov ebx, 111h + mov [esp+90h+var_60], ebx + +loc_4CE149: ; CODE XREF: CEncoder_GetOptimum+DEj + lea ecx, [ebp+14h] + mov [esp+90h+var_50], esi + mov [esp+90h+var_64], esi + xor edx, edx + mov [esp+90h+var_4C], esi + mov [esp+90h+var_6C], ecx + mov edi, edi + +loc_4CE160: ; CODE XREF: CEncoder_GetOptimum+180j + mov eax, [esp+90h+var_6C] + mov eax, [eax] + mov ecx, edi + sub ecx, eax + mov [esp+edx+90h+var_20], eax + mov al, [edi] + sub ecx, 1 + cmp al, [ecx] + jnz short loc_4CE1C9 + mov al, [edi+1] + cmp al, [ecx+1] + jnz short loc_4CE1C9 + mov eax, 2 + cmp ebx, eax + jbe short loc_4CE1A7 + lea esi, [edi+2] + sub ecx, edi + lea ecx, [ecx+0] + +loc_4CE190: ; CODE XREF: CEncoder_GetOptimum+143j + mov bl, [esi] + cmp bl, [ecx+esi] + mov ebx, [esp+90h+var_60] + jnz short loc_4CE1A5 + add eax, 1 + add esi, 1 + cmp eax, ebx + jb short loc_4CE190 + +loc_4CE1A5: ; CODE XREF: CEncoder_GetOptimum+139j + xor esi, esi + +loc_4CE1A7: ; CODE XREF: CEncoder_GetOptimum+126j + mov ecx, [esp+90h+var_4C] + mov [esp+edx+90h+var_10], eax + cmp eax, [esp+ecx+90h+var_10] + jbe short loc_4CE1D0 + mov eax, [esp+90h+var_64] + mov [esp+90h+var_50], eax + mov [esp+90h+var_4C], edx + jmp short loc_4CE1D0 +; --------------------------------------------------------------------------- + +loc_4CE1C9: ; CODE XREF: CEncoder_GetOptimum+115j + ; CEncoder_GetOptimum+11Dj + mov [esp+edx+90h+var_10], esi + +loc_4CE1D0: ; CODE XREF: CEncoder_GetOptimum+159j + ; CEncoder_GetOptimum+167j + add [esp+90h+var_64], 1 + add [esp+90h+var_6C], 4 + add edx, 4 + cmp edx, 10h + jb loc_4CE160 + mov ecx, [esp+90h+var_50] + mov ebx, [esp+ecx*4+90h+var_10] + mov eax, [ebp+32EF8h] + cmp ebx, eax + mov [esp+90h+var_40], ebx + jb short loc_4CE234 + mov edx, [esp+90h+arg_4] + lea eax, [ebx-1] + cmp eax, esi + mov [edx], ecx + jz short loc_4CE225 + add [ebp+32F04h], eax + mov ecx, [ebp+7Ch] + push eax + mov eax, [ebp+80h] + push eax + call ecx + add esp, 8 + +loc_4CE225: ; CODE XREF: CEncoder_GetOptimum+1ADj + pop edi + mov eax, ebx + pop ebx + pop esi + pop ebp + add esp, 80h + retn 8 +; --------------------------------------------------------------------------- + +loc_4CE234: ; CODE XREF: CEncoder_GetOptimum+19Dj + mov esi, [esp+90h+var_68] + cmp esi, eax + jb short loc_4CE27F + mov edx, [esp+90h+var_70] + mov eax, [ebp+edx*4+3265Ch] + mov ecx, [esp+90h+arg_4] + add eax, 4 + mov [ecx], eax + lea eax, [esi-1] + test eax, eax + jz short loc_4CE270 + mov edx, [ebp+80h] + add [ebp+32F04h], eax + push eax + mov eax, [ebp+7Ch] + push edx + call eax + add esp, 8 + +loc_4CE270: ; CODE XREF: CEncoder_GetOptimum+1F8j + pop edi + pop ebx + mov eax, esi + pop esi + pop ebp + add esp, 80h + retn 8 +; --------------------------------------------------------------------------- + +loc_4CE27F: ; CODE XREF: CEncoder_GetOptimum+1DAj + mov al, [edi] + mov esi, [esp+90h+var_20] + sub edi, esi + cmp [esp+90h+var_68], 2 + mov cl, [edi-1] + mov byte ptr [esp+90h+var_4C], al + mov byte ptr [esp+90h+var_50], cl + jnb short loc_4CE2C1 + cmp al, cl + jz short loc_4CE2C1 + cmp ebx, 2 + jnb short loc_4CE2C1 + mov ecx, [esp+90h+arg_4] + pop edi + pop ebx + pop esi + mov dword ptr [ecx], 0FFFFFFFFh + mov eax, 1 + pop ebp + add esp, 80h + retn 8 +; --------------------------------------------------------------------------- + +loc_4CE2C1: ; CODE XREF: CEncoder_GetOptimum+237j + ; CEncoder_GetOptimum+23Bj ... + mov edx, [esp+90h+var_4C] + mov bl, [ebp+10h] + mov edi, [ebp+33B60h] + and edi, [esp+90h+arg_0] + mov ecx, [esp+90h+var_50] + push edx + cmp bl, 7 + setnb dl + push ecx + mov [ebp+0F0h], bl + mov eax, [ebp+32654h] + mov ecx, 8 + sub cl, al + push edx + movzx edx, byte ptr [ebp+11h] + shr edx, cl + mov ecx, [ebp+3265Ch] + and ecx, [esp+9Ch+arg_0] + mov [esp+9Ch+var_3C], ecx + mov ecx, eax + mov eax, [esp+9Ch+var_3C] + shl eax, cl + add edx, eax + imul edx, 0C00h + add edx, [ebp+32650h] + mov ecx, edx + call sub_4CDAC0 + movzx ecx, bl + shl ecx, 4 + add ecx, edi + mov edx, [ebp+ecx*4+280F0h] + shr edx, 2 + add eax, dword_550998[edx*4] + mov ebx, 800h + mov [ebp+124h], eax + mov dword ptr [ebp+12Ch], 0FFFFFFFFh + mov byte ptr [ebp+119h], 0 + mov cl, [ebp+10h] + movzx eax, cl + mov edx, eax + shl edx, 4 + add edx, edi + sub ebx, [ebp+edx*4+280F0h] + mov edx, 800h + sub edx, [ebp+eax*4+283F0h] + mov al, byte ptr [esp+90h+var_4C] + shr edx, 2 + mov edx, dword_550998[edx*4] + shr ebx, 2 + mov ebx, dword_550998[ebx*4] + add edx, ebx + cmp byte ptr [esp+90h+var_50], al + mov [esp+90h+var_44], ebx + mov [esp+90h+var_3C], edx + jnz short loc_4CE3F3 + movzx eax, cl + mov ebx, [ebp+eax*4+28420h] + mov ecx, eax + shl ecx, 4 + add ecx, edi + mov ecx, [ebp+ecx*4+284B0h] + shr ecx, 2 + mov eax, dword_550998[ecx*4] + shr ebx, 2 + add eax, dword_550998[ebx*4] + add eax, edx + cmp eax, [ebp+124h] + jnb short loc_4CE3F3 + mov [ebp+124h], eax + mov dword ptr [ebp+12Ch], 0 + mov byte ptr [ebp+119h], 0 + +loc_4CE3F3: ; CODE XREF: CEncoder_GetOptimum+344j + ; CEncoder_GetOptimum+37Aj + mov eax, [esp+90h+var_68] + mov ecx, [esp+90h+var_40] + cmp eax, ecx + jb short loc_4CE405 + mov [esp+90h+var_7C], eax + jmp short loc_4CE40B +; --------------------------------------------------------------------------- + +loc_4CE405: ; CODE XREF: CEncoder_GetOptimum+39Dj + mov [esp+90h+var_7C], ecx + mov eax, ecx + +loc_4CE40B: ; CODE XREF: CEncoder_GetOptimum+3A3j + cmp eax, 2 + jnb short loc_4CE431 + mov edx, [ebp+12Ch] + mov eax, [esp+90h+arg_4] + pop edi + pop ebx + pop esi + mov [eax], edx + mov eax, 1 + pop ebp + add esp, 80h + retn 8 +; --------------------------------------------------------------------------- + +loc_4CE431: ; CODE XREF: CEncoder_GetOptimum+3AEj + mov ecx, [esp+90h+var_1C] + mov edx, [esp+90h+var_18] + xor ebx, ebx + mov [ebp+128h], ebx + mov [ebp+10Ch], ecx + mov ecx, [esp+90h+var_14] + mov [ebp+110h], edx + lea edx, [eax+eax*4] + mov [ebp+114h], ecx + mov [ebp+108h], esi + lea ecx, [ebp+edx*8+0FCh] + jmp short loc_4CE470 +; --------------------------------------------------------------------------- + align 10h + +loc_4CE470: ; CODE XREF: CEncoder_GetOptimum+407j + ; CEncoder_GetOptimum+41Fj + mov dword ptr [ecx], 0FFFFFFFh + sub eax, 1 + sub ecx, 28h + cmp eax, 2 + jnb short loc_4CE470 + +loc_4CE481: ; CODE XREF: CEncoder_GetOptimum+48Ej + mov esi, [esp+ebx*4+90h+var_10] + cmp esi, 2 + jb short loc_4CE4E8 + movzx eax, byte ptr [ebp+10h] + push edi + push eax + push ebx + mov ecx, ebp + call sub_4CD9B0 + add eax, [esp+90h+var_3C] + mov ecx, edi + imul ecx, 110h + add ecx, esi + mov [esp+90h+var_40], eax + lea edx, [esi+esi*4] + lea eax, [ebp+ecx*4+2E204h] + lea ecx, [ebp+edx*8+0FCh] + mov edi, edi + +loc_4CE4C0: ; CODE XREF: CEncoder_GetOptimum+486j + mov edx, [eax] + add edx, [esp+90h+var_40] + cmp edx, [ecx] + jnb short loc_4CE4DA + mov [ecx], edx + mov dword ptr [ecx+4], 0 + mov [ecx+8], ebx + mov byte ptr [ecx-0Bh], 0 + +loc_4CE4DA: ; CODE XREF: CEncoder_GetOptimum+468j + sub esi, 1 + sub eax, 4 + sub ecx, 28h + cmp esi, 2 + jnb short loc_4CE4C0 + +loc_4CE4E8: ; CODE XREF: CEncoder_GetOptimum+42Bj + add ebx, 1 + cmp ebx, 4 + jb short loc_4CE481 + movzx eax, byte ptr [ebp+10h] + mov ecx, [ebp+eax*4+283F0h] + shr ecx, 2 + mov eax, dword_550998[ecx*4] + add eax, [esp+90h+var_44] + mov [esp+90h+var_3C], eax + mov eax, [esp+90h+var_10] + cmp eax, 2 + lea ebx, [eax+1] + jnb short loc_4CE521 + mov ebx, 2 + +loc_4CE521: ; CODE XREF: CEncoder_GetOptimum+4BAj + cmp ebx, [esp+90h+var_68] + ja loc_4CE5BA + xor eax, eax + cmp ebx, [ebp+32660h] + mov [esp+90h+var_60], eax + jbe short loc_4CE550 + lea esp, [esp+0] + +loc_4CE540: ; CODE XREF: CEncoder_GetOptimum+4EAj + add eax, 2 + cmp ebx, [ebp+eax*4+32660h] + ja short loc_4CE540 + mov [esp+90h+var_60], eax + +loc_4CE550: ; CODE XREF: CEncoder_GetOptimum+4D7j + lea edx, [ebx+ebx*4] + lea esi, [ebp+edx*8+0FCh] + lea ebx, [ebx+0] + +loc_4CE560: ; CODE XREF: CEncoder_GetOptimum+558j + mov eax, [esp+90h+var_60] + mov eax, [ebp+eax*4+32664h] + push edi + push ebx + push eax + mov ecx, ebp + mov [esp+9Ch+var_40], eax + call sub_4CAEC0 + add eax, [esp+90h+var_3C] + cmp eax, [esi] + jnb short loc_4CE598 + mov ecx, [esp+90h+var_40] + add ecx, 4 + mov [esi], eax + mov dword ptr [esi+4], 0 + mov [esi+8], ecx + mov byte ptr [esi-0Bh], 0 + +loc_4CE598: ; CODE XREF: CEncoder_GetOptimum+51Fj + mov eax, [esp+90h+var_60] + cmp ebx, [ebp+eax*4+32660h] + jnz short loc_4CE5B2 + add eax, 2 + cmp eax, [esp+90h+var_70] + mov [esp+90h+var_60], eax + jz short loc_4CE5BA + +loc_4CE5B2: ; CODE XREF: CEncoder_GetOptimum+543j + add ebx, 1 + add esi, 28h + jmp short loc_4CE560 +; --------------------------------------------------------------------------- + +loc_4CE5BA: ; CODE XREF: CEncoder_GetOptimum+4C5j + ; CEncoder_GetOptimum+550j + mov eax, 1 + cmp [esp+90h+var_7C], eax + mov [esp+90h+var_78], eax + jz loc_4CF1D0 + mov esi, eax + jmp short loc_4CE5D5 +; --------------------------------------------------------------------------- + +loc_4CE5D1: ; CODE XREF: CEncoder_GetOptimum+116Aj + mov esi, [esp+90h+var_78] + +loc_4CE5D5: ; CODE XREF: CEncoder_GetOptimum+56Fj + mov edx, [ebp+80h] + mov eax, [ebp+70h] + push edx + call eax + add esp, 4 + lea ecx, [esp+90h+var_4C] + push ecx + mov ecx, ebp + mov [esp+94h+var_60], eax + call sub_4CB3B0 + cmp eax, [ebp+32EF8h] + mov [esp+90h+var_28], eax + jnb loc_4CF1D7 + add [esp+90h+arg_0], 1 + lea edx, [esi+esi*4+1Eh] + mov bl, [ebp+edx*8+1] + test bl, bl + lea eax, [ebp+edx*8+0] + mov edx, [eax+10h] + jz short loc_4CE673 + sub edx, 1 + cmp byte ptr [eax+2], 0 + jz short loc_4CE660 + mov ecx, [eax+4] + add ecx, 6 + cmp dword ptr [eax+8], 4 + lea ecx, [ecx+ecx*4] + mov cl, [ebp+ecx*8+0] + movzx ecx, cl + jnb short loc_4CE64F + mov cl, ds:kRepNextStates[ecx] + movzx ecx, cl + mov cl, ds:kLiteralNextStates[ecx] + jmp short loc_4CE67B +; --------------------------------------------------------------------------- + +loc_4CE64F: ; CODE XREF: CEncoder_GetOptimum+5DCj + mov cl, ds:kMatchNextStates[ecx] + movzx ecx, cl + mov cl, ds:kLiteralNextStates[ecx] + jmp short loc_4CE67B +; --------------------------------------------------------------------------- + +loc_4CE660: ; CODE XREF: CEncoder_GetOptimum+5C6j + lea ecx, [edx+edx*4+1Eh] + mov cl, [ebp+ecx*8+0] + movzx ecx, cl + mov cl, ds:kLiteralNextStates[ecx] + jmp short loc_4CE67B +; --------------------------------------------------------------------------- + +loc_4CE673: ; CODE XREF: CEncoder_GetOptimum+5BDj + lea ecx, [edx+edx*4+1Eh] + mov cl, [ebp+ecx*8+0] + +loc_4CE67B: ; CODE XREF: CEncoder_GetOptimum+5EDj + ; CEncoder_GetOptimum+5FEj ... + add esi, 0FFFFFFFFh + cmp edx, esi + jnz short loc_4CE6AC + cmp dword ptr [eax+14h], 0 + jnz short loc_4CE69A + movzx edx, cl + mov bl, ds:kShortRepNextStates[edx] + mov byte ptr [esp+90h+var_64], bl + jmp loc_4CE754 +; --------------------------------------------------------------------------- + +loc_4CE69A: ; CODE XREF: CEncoder_GetOptimum+626j + movzx ecx, cl + mov bl, ds:kLiteralNextStates[ecx] + mov byte ptr [esp+90h+var_64], bl + jmp loc_4CE754 +; --------------------------------------------------------------------------- + +loc_4CE6AC: ; CODE XREF: CEncoder_GetOptimum+620j + test bl, bl + jz short loc_4CE6CB + cmp byte ptr [eax+2], 0 + jz short loc_4CE6CB + mov edi, [eax+8] + mov edx, [eax+4] + movzx ecx, cl + mov bl, ds:kRepNextStates[ecx] + mov [esp+90h+var_68], edi + jmp short loc_4CE6EA +; --------------------------------------------------------------------------- + +loc_4CE6CB: ; CODE XREF: CEncoder_GetOptimum+64Ej + ; CEncoder_GetOptimum+654j + mov esi, [eax+14h] + cmp esi, 4 + mov [esp+90h+var_68], esi + movzx ecx, cl + mov edi, esi + jnb short loc_4CE6E4 + mov bl, ds:kRepNextStates[ecx] + jmp short loc_4CE6EA +; --------------------------------------------------------------------------- + +loc_4CE6E4: ; CODE XREF: CEncoder_GetOptimum+67Aj + mov bl, ds:kMatchNextStates[ecx] + +loc_4CE6EA: ; CODE XREF: CEncoder_GetOptimum+669j + ; CEncoder_GetOptimum+682j + cmp edi, 4 + lea edx, [edx+edx*4+1Eh] + mov byte ptr [esp+90h+var_64], bl + lea edx, [ebp+edx*8+0] + jnb short loc_4CE738 + mov ecx, [edx+edi*4+18h] + mov esi, 1 + cmp edi, esi + mov [esp+90h+var_20], ecx + jb short loc_4CE723 + mov ecx, edi + lea esi, [edx+18h] + lea edi, [esp+90h+var_1C] + rep movsd + mov esi, [esp+90h+var_68] + add esi, 1 + cmp esi, 4 + jnb short loc_4CE754 + +loc_4CE723: ; CODE XREF: CEncoder_GetOptimum+6AAj + lea edx, [edx+esi*4+18h] + mov ecx, 4 + lea edi, [esp+esi*4+90h+var_20] + sub ecx, esi + mov esi, edx + rep movsd + jmp short loc_4CE754 +; --------------------------------------------------------------------------- + +loc_4CE738: ; CODE XREF: CEncoder_GetOptimum+699j + mov ecx, [edx+18h] + mov [esp+90h+var_1C], ecx + mov ecx, [edx+1Ch] + mov edx, [edx+20h] + add edi, 0FFFFFFFCh + mov [esp+90h+var_20], edi + mov [esp+90h+var_18], ecx + mov [esp+90h+var_14], edx + +loc_4CE754: ; CODE XREF: CEncoder_GetOptimum+635j + ; CEncoder_GetOptimum+647j ... + mov ecx, [esp+90h+var_1C] + mov edx, [esp+90h+var_18] + mov edi, [esp+90h+var_20] + mov [eax], bl + mov [eax+1Ch], ecx + mov ecx, [esp+90h+var_14] + mov [eax+18h], edi + mov [eax+20h], edx + mov [eax+24h], ecx + mov esi, [eax+0Ch] + mov edx, [ebp+80h] + mov eax, [ebp+74h] + push edx + mov [esp+94h+var_3C], esi + call eax + movzx ecx, byte ptr [eax-1] + sub eax, 1 + mov edx, eax + mov byte ptr [esp+94h+var_5C], cl + sub edx, edi + movzx ecx, byte ptr [edx-1] + lea edi, [edx-1] + mov edx, [ebp+32654h] + mov byte ptr [esp+94h+var_58], cl + mov ecx, [ebp+33B60h] + and ecx, [esp+94h+arg_0] + mov [esp+94h+var_40], edi + movzx edi, bl + mov [esp+94h+var_54], ecx + mov [esp+94h+var_68], edi + add esp, 4 + shl edi, 4 + add edi, ecx + mov ecx, [esp+90h+var_5C] + push ecx + mov ecx, [esp+94h+var_58] + push ecx + cmp bl, 7 + mov ebx, [ebp+3265Ch] + setnb cl + and ebx, [esp+98h+arg_0] + mov [esp+98h+var_74], eax + movzx eax, byte ptr [eax-1] + push ecx + mov ecx, 8 + sub cl, dl + shr eax, cl + mov ecx, edx + shl ebx, cl + add eax, ebx + imul eax, 0C00h + add eax, [ebp+32650h] + mov ecx, eax + call sub_4CDAC0 + mov ecx, [ebp+edi*4+280F0h] + shr ecx, 2 + add eax, dword_550998[ecx*4] + mov ecx, [esp+90h+var_78] + add eax, esi + lea edx, [ecx+ecx*4+23h] + cmp eax, [ebp+edx*8+0Ch] + lea esi, [ebp+edx*8+0] + mov [esp+90h+var_7D], 0 + jnb short loc_4CE851 + mov [esi+0Ch], eax + mov [esi+10h], ecx + mov dword ptr [esi+14h], 0FFFFFFFFh + mov byte ptr [esi+1], 0 + mov [esp+90h+var_7D], 1 + +loc_4CE851: ; CODE XREF: CEncoder_GetOptimum+7D9j + mov ebx, [esp+90h+var_68] + mov edx, 800h + sub edx, [ebp+edi*4+280F0h] + shr edx, 2 + mov ecx, dword_550998[edx*4] + add ecx, [esp+90h+var_3C] + mov edx, 800h + sub edx, [ebp+ebx*4+283F0h] + mov ebx, [esp+90h+var_78] + shr edx, 2 + mov edx, dword_550998[edx*4] + add edx, ecx + mov [esp+90h+var_24], ecx + mov cl, byte ptr [esp+90h+var_58] + cmp cl, byte ptr [esp+90h+var_5C] + mov [esp+90h+var_38], edx + jnz short loc_4CE8EB + cmp [esi+10h], ebx + jnb short loc_4CE8A8 + cmp dword ptr [esi+14h], 0 + jz short loc_4CE8EB + +loc_4CE8A8: ; CODE XREF: CEncoder_GetOptimum+840j + mov ecx, [esp+90h+var_68] + mov ecx, [ebp+ecx*4+28420h] + mov edi, [ebp+edi*4+284B0h] + shr ecx, 2 + mov ecx, dword_550998[ecx*4] + shr edi, 2 + add ecx, dword_550998[edi*4] + add ecx, edx + cmp ecx, [esi+0Ch] + ja short loc_4CE8EB + mov [esi+0Ch], ecx + mov [esi+10h], ebx + mov dword ptr [esi+14h], 0 + mov byte ptr [esi+1], 0 + mov [esp+90h+var_7D], 1 + +loc_4CE8EB: ; CODE XREF: CEncoder_GetOptimum+83Bj + ; CEncoder_GetOptimum+846j ... + mov edx, [esp+90h+var_60] + mov ecx, 0FFFh + sub ecx, ebx + cmp ecx, edx + jnb short loc_4CE900 + mov edx, ecx + mov [esp+90h+var_60], edx + +loc_4CE900: ; CODE XREF: CEncoder_GetOptimum+898j + cmp edx, 2 + mov ebx, edx + mov [esp+90h+var_6C], ebx + jb loc_4CF1BB + mov esi, [ebp+32EF8h] + mov edi, [esp+90h+var_60] + cmp edi, esi + jbe short loc_4CE923 + mov ebx, esi + mov [esp+90h+var_6C], esi + +loc_4CE923: ; CODE XREF: CEncoder_GetOptimum+8BBj + cmp [esp+90h+var_7D], 0 + jnz loc_4CEA90 + mov dl, byte ptr [esp+90h+var_5C] + cmp byte ptr [esp+90h+var_58], dl + jz loc_4CEA90 + lea ecx, [esi+1] + cmp edi, ecx + jb short loc_4CE945 + mov edi, ecx + +loc_4CE945: ; CODE XREF: CEncoder_GetOptimum+8E1j + mov esi, 1 + cmp edi, esi + jbe short loc_4CE975 + mov ebx, [esp+90h+var_74] + mov edx, [esp+90h+var_40] + lea ecx, [ebx+1] + sub edx, ebx + jmp short loc_4CE960 +; --------------------------------------------------------------------------- + align 10h + +loc_4CE960: ; CODE XREF: CEncoder_GetOptimum+8FBj + ; CEncoder_GetOptimum+90Fj + mov bl, [ecx] + cmp bl, [edx+ecx] + jnz short loc_4CE971 + add esi, 1 + add ecx, 1 + cmp esi, edi + jb short loc_4CE960 + +loc_4CE971: ; CODE XREF: CEncoder_GetOptimum+905j + mov ebx, [esp+90h+var_6C] + +loc_4CE975: ; CODE XREF: CEncoder_GetOptimum+8ECj + add esi, 0FFFFFFFFh + cmp esi, 2 + mov [esp+90h+var_50], esi + jb loc_4CEA90 + mov ecx, [esp+90h+var_68] + mov dl, ds:kLiteralNextStates[ecx] + mov ecx, [esp+90h+arg_0] + movzx ebx, dl + add ecx, 1 + and ecx, [ebp+33B60h] + mov edx, ebx + shl edx, 4 + lea esi, [edx+ecx] + mov edx, 800h + sub edx, [ebp+ebx*4+283F0h] + mov edi, 800h + sub edi, [ebp+esi*4+280F0h] + shr edx, 2 + mov edx, dword_550998[edx*4] + shr edi, 2 + add edx, dword_550998[edi*4] + mov edi, [esp+90h+var_78] + add edx, eax + mov eax, [esp+90h+var_50] + lea edi, [eax+edi+1] + mov eax, [esp+90h+var_7C] + cmp eax, edi + mov [esp+90h+var_40], esi + jnb short loc_4CEA22 + mov esi, [esp+90h+var_7C] + lea eax, [eax+eax*4] + lea eax, [ebp+eax*8+0FCh] + mov [esp+90h+var_3C], eax + mov eax, edi + sub eax, esi + add esi, eax + mov [esp+90h+var_7C], esi + mov esi, [esp+90h+var_3C] + +loc_4CEA10: ; CODE XREF: CEncoder_GetOptimum+9BCj + add esi, 28h + sub eax, 1 + mov dword ptr [esi], 0FFFFFFFh + jnz short loc_4CEA10 + mov esi, [esp+90h+var_40] + +loc_4CEA22: ; CODE XREF: CEncoder_GetOptimum+98Ej + imul ecx, 110h + add ecx, [esp+90h+var_50] + mov eax, 800h + sub eax, [ebp+esi*4+284B0h] + mov esi, [ebp+ebx*4+28420h] + mov ebx, [esp+90h+var_6C] + shr eax, 2 + mov eax, dword_550998[eax*4] + shr esi, 2 + add eax, dword_550998[esi*4] + mov esi, [esp+90h+var_7C] + add eax, [ebp+ecx*4+2E204h] + lea ecx, [edi+edi*4+1Eh] + add eax, edx + cmp eax, [ebp+ecx*8+0Ch] + lea ecx, [ebp+ecx*8+0] + jnb short loc_4CEA94 + mov edx, [esp+90h+var_78] + add edx, 1 + mov [ecx+0Ch], eax + mov [ecx+10h], edx + mov dword ptr [ecx+14h], 0 + mov byte ptr [ecx+1], 1 + mov byte ptr [ecx+2], 0 + jmp short loc_4CEA94 +; --------------------------------------------------------------------------- + +loc_4CEA90: ; CODE XREF: CEncoder_GetOptimum+8C8j + ; CEncoder_GetOptimum+8D6j ... + mov esi, [esp+90h+var_7C] + +loc_4CEA94: ; CODE XREF: CEncoder_GetOptimum+A10j + ; CEncoder_GetOptimum+A2Ej + mov [esp+90h+var_70], 0 + mov ecx, [esp+90h+var_70] + mov [esp+90h+var_40], 2 + jmp short loc_4CEAB8 +; --------------------------------------------------------------------------- + align 10h + +loc_4CEAB0: ; CODE XREF: CEncoder_GetOptimum+D63j + mov ebx, [esp+90h+var_6C] + mov esi, [esp+90h+var_7C] + +loc_4CEAB8: ; CODE XREF: CEncoder_GetOptimum+A48j + mov edx, [esp+90h+var_74] + mov eax, edx + sub eax, [esp+ecx*4+90h+var_20] + mov cl, [edx] + sub eax, 1 + cmp cl, [eax] + mov [esp+90h+var_48], eax + jnz loc_4CEDB5 + mov cl, [edx+1] + cmp cl, [eax+1] + jnz loc_4CEDB5 + mov edi, 2 + cmp ebx, edi + jbe short loc_4CEB01 + lea ecx, [edx+2] + sub eax, edx + lea ecx, [ecx+0] + +loc_4CEAF0: ; CODE XREF: CEncoder_GetOptimum+A9Fj + mov dl, [ecx] + cmp dl, [eax+ecx] + jnz short loc_4CEB01 + add edi, 1 + add ecx, 1 + cmp edi, ebx + jb short loc_4CEAF0 + +loc_4CEB01: ; CODE XREF: CEncoder_GetOptimum+A86j + ; CEncoder_GetOptimum+A95j + mov eax, [esp+90h+var_78] + lea ebx, [edi+eax] + cmp esi, ebx + jnb short loc_4CEB2E + mov eax, ebx + lea ecx, [esi+esi*4] + sub eax, esi + add esi, eax + lea ecx, [ebp+ecx*8+0FCh] + mov [esp+90h+var_7C], esi + +loc_4CEB20: ; CODE XREF: CEncoder_GetOptimum+ACCj + add ecx, 28h + sub eax, 1 + mov dword ptr [ecx], 0FFFFFFFh + jnz short loc_4CEB20 + +loc_4CEB2E: ; CODE XREF: CEncoder_GetOptimum+AAAj + mov edx, [esp+90h+var_54] + mov eax, [esp+90h+var_64] + mov ecx, [esp+90h+var_70] + push edx + push eax + push ecx + mov ecx, ebp + mov esi, edi + call sub_4CD9B0 + add eax, [esp+90h+var_38] + mov ecx, [esp+90h+var_54] + imul ecx, 110h + lea edx, [edi+ecx] + mov [esp+90h+var_34], ecx + lea ecx, [ebp+edx*4+2E204h] + mov [esp+90h+var_50], ecx + lea edx, [ebx+ebx*4] + mov ebx, [esp+90h+var_50] + mov [esp+90h+var_2C], eax + lea ecx, [ebp+edx*8+0FCh] + +loc_4CEB78: ; CODE XREF: CEncoder_GetOptimum+B40j + mov edx, [ebx] + add edx, eax + cmp edx, [ecx] + jnb short loc_4CEB94 + mov [ecx], edx + mov edx, [esp+90h+var_78] + mov [ecx+4], edx + mov edx, [esp+90h+var_70] + mov [ecx+8], edx + mov byte ptr [ecx-0Bh], 0 + +loc_4CEB94: ; CODE XREF: CEncoder_GetOptimum+B1Ej + sub edi, 1 + sub ebx, 4 + sub ecx, 28h + cmp edi, 2 + jnb short loc_4CEB78 + cmp [esp+90h+var_70], 0 + jnz short loc_4CEBB0 + lea eax, [esi+1] + mov [esp+90h+var_40], eax + +loc_4CEBB0: ; CODE XREF: CEncoder_GetOptimum+B47j + mov ecx, [ebp+32EF8h] + mov edx, [esp+90h+var_60] + lea eax, [esi+1] + add ecx, eax + cmp edx, ecx + jnb short loc_4CEBC5 + mov ecx, edx + +loc_4CEBC5: ; CODE XREF: CEncoder_GetOptimum+B61j + cmp eax, ecx + jnb short loc_4CEBE7 + mov ebx, [esp+90h+var_74] + mov edi, [esp+90h+var_48] + lea edx, [eax+ebx] + sub edi, ebx + +loc_4CEBD6: ; CODE XREF: CEncoder_GetOptimum+B85j + mov bl, [edx] + cmp bl, [edx+edi] + jnz short loc_4CEBE7 + add eax, 1 + add edx, 1 + cmp eax, ecx + jb short loc_4CEBD6 + +loc_4CEBE7: ; CODE XREF: CEncoder_GetOptimum+B67j + ; CEncoder_GetOptimum+B7Bj + or ecx, 0FFFFFFFFh + sub ecx, esi + add eax, ecx + cmp eax, 2 + mov [esp+90h+var_44], eax + jb loc_4CEDB5 + mov edx, [esp+90h+var_68] + mov cl, ds:kRepNextStates[edx] + mov eax, [ebp+33B60h] + mov edi, [esp+90h+arg_0] + movzx ecx, cl + mov ebx, eax + lea edx, [esi+edi] + and ebx, edx + mov edx, ecx + mov cl, ds:kLiteralNextStates[ecx] + shl edx, 4 + add ebx, edx + mov edx, [ebp+ebx*4+280F0h] + movzx ebx, cl + shr edx, 2 + mov edx, dword_550998[edx*4] + mov [esp+90h+var_30], edx + lea edi, [esi+edi+1] + and edi, eax + mov eax, [ebp+32654h] + mov ecx, ebx + shl ecx, 4 + add ecx, edi + mov [esp+90h+var_50], ecx + mov ecx, [esp+90h+var_74] + movzx edx, byte ptr [esi+ecx] + push edx + mov edx, [esp+94h+var_48] + movzx edx, byte ptr [esi+edx] + push edx + movzx edx, byte ptr [ecx+esi-1] + mov ecx, 8 + sub cl, al + shr edx, cl + mov ecx, [esp+98h+arg_0] + lea eax, [esi+ecx] + mov ecx, [ebp+3265Ch] + and ecx, eax + mov eax, ecx + mov ecx, [ebp+32654h] + shl eax, cl + push 1 + add edx, eax + imul edx, 0C00h + add edx, [ebp+32650h] + mov ecx, edx + call sub_4CDAC0 + mov ecx, [esp+90h+var_50] + mov edx, 800h + sub edx, [ebp+ecx*4+280F0h] + mov ecx, [esp+90h+var_34] + shr edx, 2 + add eax, dword_550998[edx*4] + mov edx, 800h + sub edx, [ebp+ebx*4+283F0h] + shr edx, 2 + add eax, dword_550998[edx*4] + lea edx, [esi+ecx] + add eax, [ebp+edx*4+2E204h] + mov ecx, [esp+90h+var_44] + add eax, [esp+90h+var_30] + mov edx, [esp+90h+var_78] + add eax, [esp+90h+var_2C] + add ecx, esi + lea ecx, [ecx+edx+1] + cmp [esp+90h+var_7C], ecx + mov [esp+90h+var_30], ecx + jnb short loc_4CED3E + mov edx, [esp+90h+var_7C] + lea edx, [edx+edx*4] + lea edx, [ebp+edx*8+0FCh] + mov [esp+90h+var_2C], edx + mov edx, [esp+90h+var_7C] + sub ecx, edx + add edx, ecx + mov [esp+90h+var_7C], edx + mov edx, [esp+90h+var_2C] + jmp short loc_4CED30 +; --------------------------------------------------------------------------- + align 10h + +loc_4CED30: ; CODE XREF: CEncoder_GetOptimum+CCBj + ; CEncoder_GetOptimum+CDCj + add edx, 28h + sub ecx, 1 + mov dword ptr [edx], 0FFFFFFFh + jnz short loc_4CED30 + +loc_4CED3E: ; CODE XREF: CEncoder_GetOptimum+CA7j + mov edx, [esp+90h+var_50] + imul edi, 110h + add edi, [esp+90h+var_44] + mov ecx, 800h + sub ecx, [ebp+edx*4+284B0h] + mov edx, [ebp+ebx*4+28420h] + shr ecx, 2 + mov ecx, dword_550998[ecx*4] + shr edx, 2 + add ecx, dword_550998[edx*4] + add ecx, [ebp+edi*4+2E204h] + add ecx, eax + mov eax, [esp+90h+var_30] + lea eax, [eax+eax*4+1Eh] + cmp ecx, [ebp+eax*8+0Ch] + lea eax, [ebp+eax*8+0] + jnb short loc_4CEDB5 + mov [eax+0Ch], ecx + mov ecx, [esp+90h+var_78] + lea edx, [esi+ecx+1] + mov [eax+4], ecx + mov ecx, [esp+90h+var_70] + mov [eax+10h], edx + mov dword ptr [eax+14h], 0 + mov byte ptr [eax+1], 1 + mov byte ptr [eax+2], 1 + mov [eax+8], ecx + +loc_4CEDB5: ; CODE XREF: CEncoder_GetOptimum+A6Dj + ; CEncoder_GetOptimum+A79j ... + mov ecx, [esp+90h+var_70] + add ecx, 1 + cmp ecx, 4 + mov [esp+90h+var_70], ecx + jb loc_4CEAB0 + mov edx, [esp+90h+var_28] + mov ecx, [esp+90h+var_6C] + cmp edx, ecx + jbe short loc_4CEDFB + xor eax, eax + cmp ecx, [ebp+32660h] + mov edx, ecx + jbe short loc_4CEDED + +loc_4CEDE1: ; CODE XREF: CEncoder_GetOptimum+D8Bj + add eax, 2 + cmp ecx, [ebp+eax*4+32660h] + ja short loc_4CEDE1 + +loc_4CEDED: ; CODE XREF: CEncoder_GetOptimum+D7Fj + mov [ebp+eax*4+32660h], ecx + add eax, 2 + mov [esp+90h+var_4C], eax + +loc_4CEDFB: ; CODE XREF: CEncoder_GetOptimum+D73j + mov esi, [esp+90h+var_40] + cmp edx, esi + jb loc_4CF1BB + mov eax, [esp+90h+var_68] + mov ecx, [ebp+eax*4+283F0h] + shr ecx, 2 + mov eax, dword_550998[ecx*4] + add eax, [esp+90h+var_24] + mov ecx, [esp+90h+var_7C] + mov [esp+90h+var_40], eax + mov eax, [esp+90h+var_78] + add eax, edx + cmp ecx, eax + jnb short loc_4CEE52 + lea edx, [ecx+ecx*4] + sub eax, ecx + add ecx, eax + lea edx, [ebp+edx*8+0FCh] + mov [esp+90h+var_7C], ecx + +loc_4CEE44: ; CODE XREF: CEncoder_GetOptimum+DF0j + add edx, 28h + sub eax, 1 + mov dword ptr [edx], 0FFFFFFFh + jnz short loc_4CEE44 + +loc_4CEE52: ; CODE XREF: CEncoder_GetOptimum+DD0j + xor eax, eax + cmp esi, [ebp+32660h] + mov [esp+90h+var_70], eax + jbe short loc_4CEE70 + +loc_4CEE60: ; CODE XREF: CEncoder_GetOptimum+E0Aj + add eax, 2 + cmp esi, [ebp+eax*4+32660h] + ja short loc_4CEE60 + mov [esp+90h+var_70], eax + +loc_4CEE70: ; CODE XREF: CEncoder_GetOptimum+DFEj + lea ebx, ds:0[eax*4] + mov edx, [ebx+ebp+32664h] + mov ecx, 7FFFFh + sub ecx, edx + sar ecx, 1Fh + and ecx, 0Ch + add ecx, 6 + mov eax, edx + shr eax, cl + mov [esp+90h+var_6C], edx + lea edi, [esi+1] + movzx eax, byte ptr dword_551198[eax] + lea ecx, [eax+ecx*2] + mov eax, [esp+90h+var_54] + imul eax, 110h + add eax, esi + lea eax, [ebp+eax*4+295B8h] + mov [esp+90h+var_3C], ecx + mov ecx, [esp+90h+var_78] + mov [esp+90h+var_54], eax + lea eax, [esi+ecx] + lea eax, [eax+eax*4] + lea ecx, [ebp+eax*8+0FCh] + mov [esp+90h+var_50], ecx + +loc_4CEED3: ; CODE XREF: CEncoder_GetOptimum+1156j + lea eax, [edi-3] + cmp eax, 4 + jb short loc_4CEEE0 + mov eax, 3 + +loc_4CEEE0: ; CODE XREF: CEncoder_GetOptimum+E79j + cmp edx, 80h + jnb short loc_4CEEF6 + shl eax, 7 + add eax, edx + mov eax, [ebp+eax*4+33314h] + jmp short loc_4CEF10 +; --------------------------------------------------------------------------- + +loc_4CEEF6: ; CODE XREF: CEncoder_GetOptimum+E86j + shl eax, 6 + add eax, [esp+90h+var_3C] + mov esi, edx + mov eax, [ebp+eax*4+32F14h] + and esi, 0Fh + add eax, [ebp+esi*4+33B14h] + +loc_4CEF10: ; CODE XREF: CEncoder_GetOptimum+E94j + add eax, [esp+90h+var_40] + mov esi, [esp+90h+var_54] + add eax, [esi] + cmp eax, [ecx] + mov [esp+90h+var_2C], eax + jnb short loc_4CEF35 + mov [ecx], eax + mov eax, [esp+90h+var_78] + add edx, 4 + mov [ecx+4], eax + mov [ecx+8], edx + mov byte ptr [ecx-0Bh], 0 + +loc_4CEF35: ; CODE XREF: CEncoder_GetOptimum+EC0j + lea eax, [edi-1] + cmp eax, [ebx+ebp+32660h] + jnz loc_4CF1A1 + mov ebx, [esp+90h+var_74] + mov eax, [ebp+32EF8h] + mov esi, [esp+90h+var_60] + mov edx, ebx + sub edx, [esp+90h+var_6C] + add eax, edi + sub edx, 1 + cmp esi, eax + mov ecx, edi + jnb short loc_4CEF6C + mov eax, esi + mov [esp+90h+var_44], esi + jmp short loc_4CEF70 +; --------------------------------------------------------------------------- + +loc_4CEF6C: ; CODE XREF: CEncoder_GetOptimum+F02j + mov [esp+90h+var_44], eax + +loc_4CEF70: ; CODE XREF: CEncoder_GetOptimum+F0Aj + cmp edi, eax + jnb short loc_4CEF93 + lea esi, [edi+edx] + sub ebx, edx + lea esp, [esp+0] + +loc_4CEF80: ; CODE XREF: CEncoder_GetOptimum+F31j + mov al, [ebx+esi] + cmp al, [esi] + jnz short loc_4CEF93 + add ecx, 1 + add esi, 1 + cmp ecx, [esp+90h+var_44] + jb short loc_4CEF80 + +loc_4CEF93: ; CODE XREF: CEncoder_GetOptimum+F12j + ; CEncoder_GetOptimum+F25j + or esi, 0FFFFFFFFh + lea eax, [edi-1] + sub esi, eax + add ecx, esi + cmp ecx, 2 + mov [esp+90h+var_48], ecx + jb loc_4CF157 + mov ecx, [esp+90h+var_68] + mov bl, ds:kMatchNextStates[ecx] + mov ecx, [ebp+33B60h] + mov eax, [esp+90h+arg_0] + lea esi, [edi+eax-1] + mov eax, ecx + and eax, esi + movzx esi, bl + movzx edx, byte ptr [edi+edx-1] + mov ebx, esi + shl ebx, 4 + add ebx, eax + mov ebx, [ebp+ebx*4+280F0h] + shr ebx, 2 + mov ebx, dword_550998[ebx*4] + mov [esp+90h+var_28], ebx + mov bl, ds:kLiteralNextStates[esi] + lea esi, [eax+1] + mov eax, [ebp+32654h] + and esi, ecx + movzx ebx, bl + mov ecx, ebx + shl ecx, 4 + add ecx, esi + mov [esp+90h+var_44], ecx + mov ecx, [esp+90h+var_74] + movzx ecx, byte ptr [ecx+edi-1] + push ecx + mov ecx, [esp+94h+var_74] + push edx + movzx edx, byte ptr [edi+ecx-2] + mov ecx, 8 + sub cl, al + shr edx, cl + mov ecx, [esp+98h+arg_0] + lea eax, [edi+ecx-1] + mov ecx, [ebp+3265Ch] + and ecx, eax + mov eax, ecx + mov ecx, [ebp+32654h] + shl eax, cl + push 1 + add edx, eax + imul edx, 0C00h + add edx, [ebp+32650h] + mov ecx, edx + call sub_4CDAC0 + mov edx, 800h + sub edx, [ebp+ebx*4+283F0h] + mov ecx, 800h + shr edx, 2 + add eax, dword_550998[edx*4] + mov edx, [esp+90h+var_44] + sub ecx, [ebp+edx*4+280F0h] + mov edx, [esp+90h+var_78] + shr ecx, 2 + add eax, dword_550998[ecx*4] + mov ecx, [esp+90h+var_48] + add eax, [esp+90h+var_28] + add ecx, edx + add eax, [esp+90h+var_2C] + add ecx, edi + cmp [esp+90h+var_7C], ecx + mov [esp+90h+var_28], ecx + jnb short loc_4CF0DE + mov edx, [esp+90h+var_7C] + lea edx, [edx+edx*4] + lea edx, [ebp+edx*8+0FCh] + mov [esp+90h+var_24], edx + mov edx, [esp+90h+var_7C] + sub ecx, edx + add edx, ecx + mov [esp+90h+var_7C], edx + mov edx, [esp+90h+var_24] + lea ecx, [ecx+0] + +loc_4CF0D0: ; CODE XREF: CEncoder_GetOptimum+107Cj + add edx, 28h + sub ecx, 1 + mov dword ptr [edx], 0FFFFFFFh + jnz short loc_4CF0D0 + +loc_4CF0DE: ; CODE XREF: CEncoder_GetOptimum+1049j + mov edx, [esp+90h+var_44] + imul esi, 110h + add esi, [esp+90h+var_48] + mov ecx, 800h + sub ecx, [ebp+edx*4+284B0h] + mov edx, [ebp+ebx*4+28420h] + shr ecx, 2 + mov ecx, dword_550998[ecx*4] + shr edx, 2 + add ecx, dword_550998[edx*4] + add ecx, [ebp+esi*4+2E204h] + add ecx, eax + mov eax, [esp+90h+var_28] + lea eax, [eax+eax*4+1Eh] + cmp ecx, [ebp+eax*8+0Ch] + lea eax, [ebp+eax*8+0] + jnb short loc_4CF157 + mov [eax+0Ch], ecx + mov ecx, [esp+90h+var_78] + lea edx, [ecx+edi] + mov [eax+4], ecx + mov ecx, [esp+90h+var_6C] + add ecx, 4 + mov [eax+10h], edx + mov dword ptr [eax+14h], 0 + mov byte ptr [eax+1], 1 + mov byte ptr [eax+2], 1 + mov [eax+8], ecx + +loc_4CF157: ; CODE XREF: CEncoder_GetOptimum+F44j + ; CEncoder_GetOptimum+10CCj + mov eax, [esp+90h+var_70] + add eax, 2 + cmp eax, [esp+90h+var_4C] + mov [esp+90h+var_70], eax + jz short loc_4CF1BB + lea ebx, ds:0[eax*4] + mov eax, [ebx+ebp+32664h] + cmp eax, 80h + mov [esp+90h+var_6C], eax + jb short loc_4CF1A1 + mov ecx, 7FFFFh + sub ecx, eax + sar ecx, 1Fh + and ecx, 0Ch + add ecx, 6 + shr eax, cl + movzx edx, byte ptr dword_551198[eax] + lea eax, [edx+ecx*2] + mov [esp+90h+var_3C], eax + +loc_4CF1A1: ; CODE XREF: CEncoder_GetOptimum+EDFj + ; CEncoder_GetOptimum+111Fj + add [esp+90h+var_50], 28h + add [esp+90h+var_54], 4 + mov ecx, [esp+90h+var_50] + mov edx, [esp+90h+var_6C] + add edi, 1 + jmp loc_4CEED3 +; --------------------------------------------------------------------------- + +loc_4CF1BB: ; CODE XREF: CEncoder_GetOptimum+8A9j + ; CEncoder_GetOptimum+DA1j ... + mov eax, [esp+90h+var_78] + add eax, 1 + cmp eax, [esp+90h+var_7C] + mov [esp+90h+var_78], eax + jnz loc_4CE5D1 + +loc_4CF1D0: ; CODE XREF: CEncoder_GetOptimum+567j + mov ecx, [esp+90h+var_78] + push ecx + jmp short loc_4CF1EF +; --------------------------------------------------------------------------- + +loc_4CF1D7: ; CODE XREF: CEncoder_GetOptimum+59Ej + mov ecx, [esp+90h+var_4C] + mov [ebp+32F00h], ecx + mov [ebp+32EFCh], eax + mov byte ptr [ebp+32F10h], 1 + push esi + +loc_4CF1EF: ; CODE XREF: CEncoder_GetOptimum+1175j + mov edx, [esp+94h+arg_4] + push edx + mov ecx, ebp + call sub_4CB2E0 + pop edi + pop ebx + pop esi + pop ebp + add esp, 80h + retn 8 +CEncoder_GetOptimum endp + +; --------------------------------------------------------------------------- + align 10h + +loc_4CF210: ; DATA XREF: CEncoder_CodeOneBlock+44o + mov edx, [esp+10h] + mov eax, [esp+4] + mov eax, [eax+4] + mov ecx, [eax] + push edx + mov edx, [esp+10h] + push edx + mov edx, [esp+10h] + push edx + push eax + mov eax, [ecx+0Ch] + call eax + retn +; --------------------------------------------------------------------------- + align 10h +; =============== S U B R O U T I N E ======================================= + +CEncoder_FillDistancesPrices proc near ; CODE XREF: CEncoder_SetStreams+4Fp + ; CEncoder_CodeOneBlock+751p + +var_20C = dword ptr -20Ch +var_208 = dword ptr -208h +var_204 = dword ptr -204h +var_200 = dword ptr -200h + + sub esp, 20Ch + push ebx + push ebp + push esi + push edi + mov ebx, ecx + mov esi, 4 + +loc_4CF241: ; CODE XREF: CEncoder_FillDistancesPrices+80j + cmp esi, 2000h + jnb short loc_4CF252 + movzx edx, byte ptr dword_551198[esi] + jmp short loc_4CF27A +; --------------------------------------------------------------------------- + +loc_4CF252: ; CODE XREF: CEncoder_FillDistancesPrices+17j + cmp esi, 2000000h + jnb short loc_4CF26B + mov eax, esi + shr eax, 0Ch + movzx edx, byte ptr dword_551198[eax] + add edx, 18h + jmp short loc_4CF27A +; --------------------------------------------------------------------------- + +loc_4CF26B: ; CODE XREF: CEncoder_FillDistancesPrices+28j + mov ecx, esi + shr ecx, 18h + movzx edx, byte ptr dword_551198[ecx] + add edx, 30h + +loc_4CF27A: ; CODE XREF: CEncoder_FillDistancesPrices+20j + ; CEncoder_FillDistancesPrices+39j + mov ecx, edx + mov eax, edx + and eax, 1 + shr ecx, 1 + sub ecx, 1 + or eax, 2 + shl eax, cl + mov edi, esi + sub edi, eax + push edi + sub eax, edx + push ecx + lea edx, [ebx+eax*4+28BACh] + push edx + call sub_4CD860 + mov [esp+esi*4+228h+var_200], eax + add esi, 1 + add esp, 0Ch + cmp esi, 80h + jb short loc_4CF241 + lea ebp, [esp+21Ch+var_200] + sub ebp, ebx + lea esi, [ebx+3331Ch] + sub ebp, 33314h + lea edx, [ebx+32F14h] + mov [esp+21Ch+var_20C], esi + mov [esp+21Ch+var_208], ebp + mov [esp+21Ch+var_204], 4 + jmp short loc_4CF2E4 +; --------------------------------------------------------------------------- + align 10h + +loc_4CF2E0: ; CODE XREF: CEncoder_FillDistancesPrices+1BDj + mov esi, [esp+21Ch+var_20C] + +loc_4CF2E4: ; CODE XREF: CEncoder_FillDistancesPrices+AAj + xor edi, edi + cmp [ebx+33B58h], edi + jbe short loc_4CF33F + mov edi, edi + +loc_4CF2F0: ; CODE XREF: CEncoder_FillDistancesPrices+109j + mov ecx, edi + or ecx, 40h + xor esi, esi + cmp ecx, 1 + jz short loc_4CF32D + lea esp, [esp+0] + +loc_4CF300: ; CODE XREF: CEncoder_FillDistancesPrices+F7j + mov eax, ecx + shr ecx, 1 + mov ebp, [edx+ecx*4-0A764h] + and eax, 1 + sub ebp, eax + neg eax + xor ebp, eax + shr ebp, 2 + and ebp, 1FFh + add esi, dword_550998[ebp*4] + cmp ecx, 1 + jnz short loc_4CF300 + mov ebp, [esp+21Ch+var_208] + +loc_4CF32D: ; CODE XREF: CEncoder_FillDistancesPrices+CAj + mov [edx+edi*4], esi + add edi, 1 + cmp edi, [ebx+33B58h] + jb short loc_4CF2F0 + mov esi, [esp+21Ch+var_20C] + +loc_4CF33F: ; CODE XREF: CEncoder_FillDistancesPrices+BCj + mov eax, 0Eh + cmp [ebx+33B58h], eax + jbe short loc_4CF368 + lea esp, [esp+0] + +loc_4CF350: ; CODE XREF: CEncoder_FillDistancesPrices+136j + mov ecx, eax + shr ecx, 1 + sub ecx, 5 + shl ecx, 6 + add [edx+eax*4], ecx + add eax, 1 + cmp eax, [ebx+33B58h] + jb short loc_4CF350 + +loc_4CF368: ; CODE XREF: CEncoder_FillDistancesPrices+11Aj + mov eax, [edx] + mov [esi-8], eax + mov ecx, [edx+4] + mov [esi-4], ecx + mov eax, [edx+8] + mov [esi], eax + mov ecx, [edx+0Ch] + mov [esi+4], ecx + mov eax, 4 + add esi, 8 + +loc_4CF386: ; CODE XREF: CEncoder_FillDistancesPrices+19Ej + cmp eax, 2000h + jnb short loc_4CF396 + movzx ecx, byte ptr dword_551198[eax] + jmp short loc_4CF3BB +; --------------------------------------------------------------------------- + +loc_4CF396: ; CODE XREF: CEncoder_FillDistancesPrices+15Bj + cmp eax, 2000000h + mov ecx, eax + jnb short loc_4CF3AE + shr ecx, 0Ch + movzx ecx, byte ptr dword_551198[ecx] + add ecx, 18h + jmp short loc_4CF3BB +; --------------------------------------------------------------------------- + +loc_4CF3AE: ; CODE XREF: CEncoder_FillDistancesPrices+16Dj + shr ecx, 18h + movzx ecx, byte ptr dword_551198[ecx] + add ecx, 30h + +loc_4CF3BB: ; CODE XREF: CEncoder_FillDistancesPrices+164j + ; CEncoder_FillDistancesPrices+17Cj + mov ecx, [edx+ecx*4] + add ecx, [esi+ebp] + add eax, 1 + mov [esi], ecx + add esi, 4 + cmp eax, 80h + jb short loc_4CF386 + add [esp+21Ch+var_20C], 200h + sub ebp, 200h + add edx, 100h + sub [esp+21Ch+var_204], 1 + mov [esp+21Ch+var_208], ebp + jnz loc_4CF2E0 + pop edi + pop esi + pop ebp + mov dword ptr [ebx+33B70h], 0 + pop ebx + add esp, 20Ch + retn +CEncoder_FillDistancesPrices endp + +; --------------------------------------------------------------------------- + align 10h +; =============== S U B R O U T I N E ======================================= + +CEncoder_FillAlignPrices proc near ; CODE XREF: CEncoder_SetStreams+56p + ; CEncoder_CodeOneBlock+761p + push ebx + push ebp + push esi + mov ebp, ecx + push edi + xor esi, esi + lea ebx, [ebp+28D78h] + lea edi, [ebp+33B14h] + +loc_4CF424: ; CODE XREF: CEncoder_FillAlignPrices+27j + push esi + mov ecx, ebx + call sub_4CD810 + mov [edi], eax + add esi, 1 + add edi, 4 + cmp esi, 10h + jb short loc_4CF424 + pop edi + pop esi + mov dword ptr [ebp+33B54h], 0 + pop ebp + pop ebx + retn +CEncoder_FillAlignPrices endp + +; --------------------------------------------------------------------------- + align 10h +; =============== S U B R O U T I N E ======================================= + +sub_4CF810 proc near ; CODE XREF: sub_4D0250+3p + +var_10 = dword ptr -10h +var_C = dword ptr -0Ch +var_4 = dword ptr -4 + + push 0FFFFFFFFh + push offset loc_4DA0C9 + mov eax, dword ptr fs:[0] + push eax + push ecx + push ebx + push esi + mov eax, dword_544960 + xor eax, esp + push eax + lea eax, [esp+1Ch+var_C] + mov dword ptr fs:[0], eax + mov esi, ecx + mov [esp+1Ch+var_10], esi + mov dword ptr [esi], offset NCompress_NLZMA_CEncoder_vftable + mov dword ptr [esi+4], offset NCompress_NLZMA_CEncoder_vftable_ICompressSetOutStream + mov dword ptr [esi+8], offset NCompress_NLZMA_CEncoder_vftable_ICompressSetCoderProperties + mov dword ptr [esi+0Ch], offset NCompress_NLZMA_CEncoder_vftable_ICompressWriteCoderProperties + mov eax, [esi+0A4h] + push eax ; lpAddress + mov [esp+20h+var_4], 1 + call off_546E24 + xor ebx, ebx + add esp, 4 + cmp [esi+0D0h], ebx + mov [esi+0A4h], ebx + jnz short loc_4CF892 + mov ecx, [esi+0B4h] + push ecx ; lpAddress + call off_546E24 + add esp, 4 + mov [esi+0B4h], ebx + +loc_4CF892: ; CODE XREF: sub_4CF810+6Aj + mov eax, [esi+33B8Ch] + cmp eax, ebx + jz short loc_4CF8A4 + mov edx, [eax] + push eax + mov eax, [edx+8] + call eax + +loc_4CF8A4: ; CODE XREF: sub_4CF810+8Aj + lea ecx, [esi+32650h] + mov byte ptr [esp+1Ch+var_4], bl + call sub_4CD8F0 + mov eax, [esi+40h] + cmp eax, ebx + mov [esp+1Ch+var_4], 0FFFFFFFFh + jz short loc_4CF8CF + push 8000h ; dwFreeType + push ebx ; dwSize + push eax ; lpAddress + call ds:VirtualFree + +loc_4CF8CF: ; CODE XREF: sub_4CF810+B0j + mov [esi+40h], ebx + mov esi, [esi+54h] + cmp esi, ebx + jz short loc_4CF8E1 + mov ecx, [esi] + mov edx, [ecx+8] + push esi + call edx + +loc_4CF8E1: ; CODE XREF: sub_4CF810+C7j + mov ecx, [esp+1Ch+var_C] + mov dword ptr fs:[0], ecx + pop ecx + pop esi + pop ebx + add esp, 10h + retn +sub_4CF810 endp + +; =============== S U B R O U T I N E ======================================= + +; int __stdcall sub_4CF900(int, void *Buf1, int) +sub_4CF900 proc near ; CODE XREF: sub_4CFA20+5j + ; ICompressSetCoderProperties_QueryInterface+5j ... + +arg_0 = dword ptr 4 +Buf1 = dword ptr 8 +arg_8 = dword ptr 0Ch + + push esi + mov esi, [esp+4+Buf1] + push offset dword_512730 ; Buf2 + push esi ; Buf1 + call unknown_libname_324 ; MFC 3.1/4.0/4.2/8.0 32bit + add esp, 8 + test eax, eax + jz short loc_4CF94C + +loc_4CF917: ; CODE XREF: sub_4CF900+5Cj + mov eax, [esp+4+arg_0] + test eax, eax + jz short loc_4CF936 + mov edx, [esp+4+arg_8] + lea ecx, [eax+4] + mov [edx], ecx + mov ecx, [eax] + mov edx, [ecx+4] + push eax + call edx + xor eax, eax + pop esi + retn 0Ch +; --------------------------------------------------------------------------- + +loc_4CF936: ; CODE XREF: sub_4CF900+1Dj + ; sub_4CF900+76j ... + mov edx, [esp+4+arg_8] + xor ecx, ecx + mov [edx], ecx + mov ecx, [eax] + mov edx, [ecx+4] + push eax + call edx + xor eax, eax + pop esi + retn 0Ch +; --------------------------------------------------------------------------- + +loc_4CF94C: ; CODE XREF: sub_4CF900+15j + push offset dword_5535A0 ; Buf2 + push esi ; Buf1 + call unknown_libname_324 ; MFC 3.1/4.0/4.2/8.0 32bit + add esp, 8 + test eax, eax + jnz short loc_4CF917 + push offset dword_5535B0 ; Buf2 + push esi ; Buf1 + call unknown_libname_324 ; MFC 3.1/4.0/4.2/8.0 32bit + add esp, 8 + test eax, eax + jz short loc_4CF98F + mov eax, [esp+4+arg_0] + test eax, eax + jz short loc_4CF936 + mov edx, [esp+4+arg_8] + lea ecx, [eax+8] + mov [edx], ecx + mov ecx, [eax] + mov edx, [ecx+4] + push eax + call edx + xor eax, eax + pop esi + retn 0Ch +; --------------------------------------------------------------------------- + +loc_4CF98F: ; CODE XREF: sub_4CF900+6Ej + push offset dword_5535C0 ; Buf2 + push esi ; Buf1 + call unknown_libname_324 ; MFC 3.1/4.0/4.2/8.0 32bit + add esp, 8 + test eax, eax + jz short loc_4CF9C0 + mov eax, [esp+4+arg_0] + test eax, eax + jz short loc_4CF936 + mov edx, [esp+4+arg_8] + lea ecx, [eax+0Ch] + mov [edx], ecx + mov ecx, [eax] + mov edx, [ecx+4] + push eax + call edx + xor eax, eax + pop esi + retn 0Ch +; --------------------------------------------------------------------------- + +loc_4CF9C0: ; CODE XREF: sub_4CF900+9Fj + mov eax, 80004002h + pop esi + retn 0Ch +sub_4CF900 endp + +; --------------------------------------------------------------------------- + align 10h +; =============== S U B R O U T I N E ======================================= + + +sub_4CF9D0 proc near ; CODE XREF: ICompressSetCoderProperties_AddRef+5j + ; sub_4CFA10+5j ... + +arg_0 = dword ptr 4 + + mov eax, [esp+arg_0] + add dword ptr [eax+24h], 1 + mov eax, [eax+24h] + retn 4 +sub_4CF9D0 endp + +; --------------------------------------------------------------------------- + align 10h + +; =============== S U B R O U T I N E ======================================= + + +sub_4CF9E0 proc near ; CODE XREF: sub_4CFA40+5j + ; ICompressSetCoderProperties_Release+5j ... + +arg_0 = dword ptr 4 + + mov ecx, [esp+arg_0] + add dword ptr [ecx+24h], 0FFFFFFFFh + mov eax, [ecx+24h] + jnz short locret_4CF9F8 + mov eax, [ecx] + mov edx, [eax+10h] + push 1 + call edx + xor eax, eax + +locret_4CF9F8: ; CODE XREF: sub_4CF9E0+Bj + retn 4 +sub_4CF9E0 endp + +; --------------------------------------------------------------------------- + align 10h + +; =============== S U B R O U T I N E ======================================= + + +ICompressSetCoderProperties_AddRef proc near ; DATA XREF: .rdata:00517AD4o + +arg_0 = dword ptr 4 + + sub [esp+arg_0], 8 + jmp sub_4CF9D0 +ICompressSetCoderProperties_AddRef endp + +; --------------------------------------------------------------------------- + align 10h + +; =============== S U B R O U T I N E ======================================= + + +sub_4CFA10 proc near ; DATA XREF: .rdata:00517AC0o + +arg_0 = dword ptr 4 + + sub [esp+arg_0], 0Ch + jmp sub_4CF9D0 +sub_4CFA10 endp + +; --------------------------------------------------------------------------- + align 10h + +; =============== S U B R O U T I N E ======================================= + + +sub_4CFA20 proc near ; DATA XREF: .rdata:NCompress_NLZMA_CEncoder_vftable_ICompressSetOutStreamo + +arg_0 = dword ptr 4 + + sub [esp+arg_0], 4 + jmp sub_4CF900 +sub_4CFA20 endp + +; --------------------------------------------------------------------------- + align 10h + +; =============== S U B R O U T I N E ======================================= + + +ICompressSetCoderProperties_QueryInterface proc near ; DATA XREF: .rdata:NCompress_NLZMA_CEncoder_vftable_ICompressSetCoderPropertieso + +arg_0 = dword ptr 4 + + sub [esp+arg_0], 8 + jmp sub_4CF900 +ICompressSetCoderProperties_QueryInterface endp + +; --------------------------------------------------------------------------- + align 10h + +; =============== S U B R O U T I N E ======================================= + + +sub_4CFA40 proc near ; DATA XREF: .rdata:00517AECo + +arg_0 = dword ptr 4 + + sub [esp+arg_0], 4 + jmp sub_4CF9E0 +sub_4CFA40 endp + +; --------------------------------------------------------------------------- + align 10h + +; =============== S U B R O U T I N E ======================================= + + +sub_4CFA50 proc near ; DATA XREF: .rdata:NCompress_NLZMA_CEncoder_vftable_ICompressWriteCoderPropertieso + +arg_0 = dword ptr 4 +arg_4 = dword ptr 8 +arg_8 = dword ptr 0Ch + + sub [esp+arg_0], 0Ch + jmp sub_4CF900 +sub_4CFA50 endp + +; --------------------------------------------------------------------------- + align 10h + +; =============== S U B R O U T I N E ======================================= + + +ICompressSetCoderProperties_Release proc near ; DATA XREF: .rdata:00517AD8o + +arg_0 = dword ptr 4 + + sub [esp+arg_0], 8 + jmp sub_4CF9E0 +ICompressSetCoderProperties_Release endp + +; --------------------------------------------------------------------------- + align 10h + +; =============== S U B R O U T I N E ======================================= + + +sub_4CFA70 proc near ; DATA XREF: .rdata:00517AC4o + +arg_0 = dword ptr 4 + + sub [esp+arg_0], 0Ch + jmp sub_4CF9E0 +sub_4CFA70 endp + +; --------------------------------------------------------------------------- + align 10h + +; =============== S U B R O U T I N E ======================================= + + +sub_4CFA80 proc near ; DATA XREF: .rdata:00517AE8o + +arg_0 = dword ptr 4 + + sub [esp+arg_0], 4 + jmp sub_4CF9D0 +sub_4CFA80 endp + +; --------------------------------------------------------------------------- + align 10h + +; =============== S U B R O U T I N E ======================================= + + +sub_4CFA90 proc near ; DATA XREF: .rdata:00517AF0o + +arg_0 = dword ptr 4 +arg_4 = dword ptr 8 + + push esi + mov esi, [esp+4+arg_4] + test esi, esi + push edi + mov edi, [esp+8+arg_0] + jz short loc_4CFAA6 + mov eax, [esi] + mov ecx, [eax+4] + push esi + call ecx + +loc_4CFAA6: ; CODE XREF: sub_4CFA90+Cj + mov eax, [edi+50h] + test eax, eax + jz short loc_4CFAB5 + mov edx, [eax] + push eax + mov eax, [edx+8] + call eax + +loc_4CFAB5: ; CODE XREF: sub_4CFA90+1Bj + mov [edi+50h], esi + pop edi + xor eax, eax + pop esi + retn 8 +sub_4CFA90 endp + +; =============== S U B R O U T I N E ======================================= + +sub_4CFAC0 proc near ; CODE XREF: CEncoder_CodeOneBlock+42Ap + ; CEncoder_CodeOneBlock+517p + +arg_0 = dword ptr 4 +arg_4 = dword ptr 8 + + mov eax, [esp+arg_0] + push esi + mov esi, [eax+10h] + mov edx, esi + shr edx, 0Bh + imul edx, [ecx] + cmp [esp+4+arg_4], 0 + jnz short loc_4CFAEC + mov [eax+10h], edx + mov edx, [ecx] + mov esi, 800h + sub esi, edx + shr esi, 5 + add esi, edx + mov [ecx], esi + jmp short loc_4CFB03 +; --------------------------------------------------------------------------- + +loc_4CFAEC: ; CODE XREF: sub_4CFAC0+15j + add [eax+8], edx + adc dword ptr [eax+0Ch], 0 + sub esi, edx + mov [eax+10h], esi + mov edx, [ecx] + mov esi, edx + shr esi, 5 + sub edx, esi + mov [ecx], edx + +loc_4CFB03: ; CODE XREF: sub_4CFAC0+2Aj + mov ecx, [eax+10h] + cmp ecx, 1000000h + pop esi + jnb short locret_4CFB1C + shl ecx, 8 + mov [eax+10h], ecx + mov ecx, eax + call loc_4CF640 + +locret_4CFB1C: ; CODE XREF: sub_4CFAC0+4Dj + retn 8 +sub_4CFAC0 endp + +; --------------------------------------------------------------------------- + align 10h +; =============== S U B R O U T I N E ======================================= + + +sub_4CFB20 proc near ; CODE XREF: sub_4D0020+52p + ; sub_4D0020+E4p + +arg_0 = dword ptr 4 +arg_4 = dword ptr 8 + + push ebx + push ebp + push esi + mov esi, [esp+0Ch+arg_0] + push edi + mov ebp, ecx + mov ebx, 1 + mov edx, 3 + +loc_4CFB34: ; CODE XREF: sub_4CFB20+8Cj + mov edi, [esp+10h+arg_4] + sub edx, 1 + mov ecx, edx + shr edi, cl + mov ecx, [esi+10h] + mov eax, ecx + shr eax, 0Bh + imul eax, [ebp+ebx*4+0] + and edi, 1 + test edi, edi + mov [esp+10h+arg_0], edx + jnz short loc_4CFB70 + mov [esi+10h], eax + mov eax, [ebp+ebx*4+0] + mov ecx, 800h + sub ecx, eax + shr ecx, 5 + add ecx, eax + mov [ebp+ebx*4+0], ecx + jmp short loc_4CFB8B +; --------------------------------------------------------------------------- + +loc_4CFB70: ; CODE XREF: sub_4CFB20+35j + add [esi+8], eax + adc dword ptr [esi+0Ch], 0 + sub ecx, eax + mov [esi+10h], ecx + mov eax, [ebp+ebx*4+0] + mov ecx, eax + shr ecx, 5 + sub eax, ecx + mov [ebp+ebx*4+0], eax + +loc_4CFB8B: ; CODE XREF: sub_4CFB20+4Ej + mov eax, [esi+10h] + cmp eax, 1000000h + jnb short loc_4CFBA6 + shl eax, 8 + mov ecx, esi + mov [esi+10h], eax + call loc_4CF640 + mov edx, [esp+10h+arg_0] + +loc_4CFBA6: ; CODE XREF: sub_4CFB20+73j + add ebx, ebx + or ebx, edi + test edx, edx + jnz short loc_4CFB34 + pop edi + pop esi + pop ebp + pop ebx + retn 8 +sub_4CFB20 endp + +; --------------------------------------------------------------------------- + align 10h + +; =============== S U B R O U T I N E ======================================= + + +sub_4CFBC0 proc near ; CODE XREF: sub_4D0020+136p + +arg_0 = dword ptr 4 +arg_4 = dword ptr 8 + + push ebx + push ebp + push esi + mov esi, [esp+0Ch+arg_0] + push edi + mov ebp, ecx + mov ebx, 1 + mov edx, 8 + +loc_4CFBD4: ; CODE XREF: sub_4CFBC0+8Cj + mov edi, [esp+10h+arg_4] + sub edx, 1 + mov ecx, edx + shr edi, cl + mov ecx, [esi+10h] + mov eax, ecx + shr eax, 0Bh + imul eax, [ebp+ebx*4+0] + and edi, 1 + test edi, edi + mov [esp+10h+arg_0], edx + jnz short loc_4CFC10 + mov [esi+10h], eax + mov eax, [ebp+ebx*4+0] + mov ecx, 800h + sub ecx, eax + shr ecx, 5 + add ecx, eax + mov [ebp+ebx*4+0], ecx + jmp short loc_4CFC2B +; --------------------------------------------------------------------------- + +loc_4CFC10: ; CODE XREF: sub_4CFBC0+35j + add [esi+8], eax + adc dword ptr [esi+0Ch], 0 + sub ecx, eax + mov [esi+10h], ecx + mov eax, [ebp+ebx*4+0] + mov ecx, eax + shr ecx, 5 + sub eax, ecx + mov [ebp+ebx*4+0], eax + +loc_4CFC2B: ; CODE XREF: sub_4CFBC0+4Ej + mov eax, [esi+10h] + cmp eax, 1000000h + jnb short loc_4CFC46 + shl eax, 8 + mov ecx, esi + mov [esi+10h], eax + call loc_4CF640 + mov edx, [esp+10h+arg_0] + +loc_4CFC46: ; CODE XREF: sub_4CFBC0+73j + add ebx, ebx + or ebx, edi + test edx, edx + jnz short loc_4CFBD4 + pop edi + pop esi + pop ebp + pop ebx + retn 8 +sub_4CFBC0 endp + +; --------------------------------------------------------------------------- + align 10h + +; =============== S U B R O U T I N E ======================================= + + +sub_4CFC60 proc near ; CODE XREF: sub_4D0770+EDp + ; CEncoder_CodeOneBlock+67Cp + +arg_0 = dword ptr 4 +arg_4 = dword ptr 8 + + push ebx + push ebp + push esi + mov esi, [esp+0Ch+arg_0] + push edi + mov ebp, ecx + mov ebx, 1 + mov edx, 6 + +loc_4CFC74: ; CODE XREF: sub_4CFC60+8Cj + mov edi, [esp+10h+arg_4] + sub edx, 1 + mov ecx, edx + shr edi, cl + mov ecx, [esi+10h] + mov eax, ecx + shr eax, 0Bh + imul eax, [ebp+ebx*4+0] + and edi, 1 + test edi, edi + mov [esp+10h+arg_0], edx + jnz short loc_4CFCB0 + mov [esi+10h], eax + mov eax, [ebp+ebx*4+0] + mov ecx, 800h + sub ecx, eax + shr ecx, 5 + add ecx, eax + mov [ebp+ebx*4+0], ecx + jmp short loc_4CFCCB +; --------------------------------------------------------------------------- + +loc_4CFCB0: ; CODE XREF: sub_4CFC60+35j + add [esi+8], eax + adc dword ptr [esi+0Ch], 0 + sub ecx, eax + mov [esi+10h], ecx + mov eax, [ebp+ebx*4+0] + mov ecx, eax + shr ecx, 5 + sub eax, ecx + mov [ebp+ebx*4+0], eax + +loc_4CFCCB: ; CODE XREF: sub_4CFC60+4Ej + mov eax, [esi+10h] + cmp eax, 1000000h + jnb short loc_4CFCE6 + shl eax, 8 + mov ecx, esi + mov [esi+10h], eax + call loc_4CF640 + mov edx, [esp+10h+arg_0] + +loc_4CFCE6: ; CODE XREF: sub_4CFC60+73j + add ebx, ebx + or ebx, edi + test edx, edx + jnz short loc_4CFC74 + pop edi + pop esi + pop ebp + pop ebx + retn 8 +sub_4CFC60 endp + +; --------------------------------------------------------------------------- + align 10h + +; =============== S U B R O U T I N E ======================================= + + +sub_4CFD00 proc near ; CODE XREF: sub_4D0770+109p + ; CEncoder_CodeOneBlock+6D5p + +arg_0 = dword ptr 4 +arg_4 = dword ptr 8 + + push ebx + push ebp + push esi + mov esi, [esp+0Ch+arg_0] + push edi + mov ebp, ecx + mov edi, 1 + mov [esp+10h+arg_0], 4 + +loc_4CFD17: ; CODE XREF: sub_4CFD00+87j + mov ecx, [esi+10h] + mov ebx, [esp+10h+arg_4] + mov eax, ecx + shr eax, 0Bh + imul eax, [ebp+edi*4+0] + and ebx, 1 + test ebx, ebx + jnz short loc_4CFD48 + mov [esi+10h], eax + mov eax, [ebp+edi*4+0] + mov ecx, 800h + sub ecx, eax + shr ecx, 5 + add ecx, eax + mov [ebp+edi*4+0], ecx + jmp short loc_4CFD63 +; --------------------------------------------------------------------------- + +loc_4CFD48: ; CODE XREF: sub_4CFD00+2Dj + add [esi+8], eax + adc dword ptr [esi+0Ch], 0 + sub ecx, eax + mov [esi+10h], ecx + mov eax, [ebp+edi*4+0] + mov edx, eax + shr edx, 5 + sub eax, edx + mov [ebp+edi*4+0], eax + +loc_4CFD63: ; CODE XREF: sub_4CFD00+46j + mov eax, [esi+10h] + cmp eax, 1000000h + jnb short loc_4CFD7A + shl eax, 8 + mov ecx, esi + mov [esi+10h], eax + call loc_4CF640 + +loc_4CFD7A: ; CODE XREF: sub_4CFD00+6Bj + shr [esp+10h+arg_4], 1 + add edi, edi + or edi, ebx + sub [esp+10h+arg_0], 1 + jnz short loc_4CFD17 + pop edi + pop esi + pop ebp + pop ebx + retn 8 +sub_4CFD00 endp + + +; =============== S U B R O U T I N E ======================================= + + +sub_4CFD90 proc near ; CODE XREF: CEncoder_CodeOneBlock+6AFp + +arg_0 = dword ptr 4 +arg_4 = dword ptr 8 +arg_8 = dword ptr 0Ch +arg_C = dword ptr 10h + + mov eax, [esp+arg_8] + test eax, eax + push edi + mov edi, 1 + jle loc_4CFE26 + push ebx + push ebp + mov ebp, [esp+0Ch+arg_0] + push esi + mov esi, [esp+10h+arg_4] + mov [esp+10h+arg_8], eax + +loc_4CFDB1: ; CODE XREF: sub_4CFD90+91j + mov ecx, [esi+10h] + mov ebx, [esp+10h+arg_C] + mov eax, ecx + shr eax, 0Bh + imul eax, [ebp+edi*4+0] + and ebx, 1 + test ebx, ebx + jnz short loc_4CFDE2 + mov [esi+10h], eax + mov eax, [ebp+edi*4+0] + mov ecx, 800h + sub ecx, eax + shr ecx, 5 + add ecx, eax + mov [ebp+edi*4+0], ecx + jmp short loc_4CFDFD +; --------------------------------------------------------------------------- + +loc_4CFDE2: ; CODE XREF: sub_4CFD90+37j + add [esi+8], eax + adc dword ptr [esi+0Ch], 0 + sub ecx, eax + mov [esi+10h], ecx + mov eax, [ebp+edi*4+0] + mov edx, eax + shr edx, 5 + sub eax, edx + mov [ebp+edi*4+0], eax + +loc_4CFDFD: ; CODE XREF: sub_4CFD90+50j + mov eax, [esi+10h] + cmp eax, 1000000h + jnb short loc_4CFE14 + shl eax, 8 + mov ecx, esi + mov [esi+10h], eax + call loc_4CF640 + +loc_4CFE14: ; CODE XREF: sub_4CFD90+75j + shr [esp+10h+arg_C], 1 + add edi, edi + or edi, ebx + sub [esp+10h+arg_8], 1 + jnz short loc_4CFDB1 + pop esi + pop ebp + pop ebx + +loc_4CFE26: ; CODE XREF: sub_4CFD90+Cj + pop edi + retn +sub_4CFD90 endp + +; --------------------------------------------------------------------------- + align 10h + +; =============== S U B R O U T I N E ======================================= + + +sub_4CFE30 proc near ; CODE XREF: CEncoder_CodeOneBlock+190p + ; CEncoder_CodeOneBlock+2CCp + +arg_0 = dword ptr 4 +arg_4 = byte ptr 8 + + push ebx + push ebp + push esi + mov esi, [esp+0Ch+arg_0] + push edi + mov ebx, ecx + mov ebp, 1 + mov edx, 8 + +loc_4CFE44: ; CODE XREF: sub_4CFE30+88j + movzx edi, [esp+10h+arg_4] + sub edx, 1 + mov cl, dl + shr edi, cl + mov ecx, [esi+10h] + mov eax, ecx + shr eax, 0Bh + imul eax, [ebx+ebp*4] + and edi, 1 + test edi, edi + mov [esp+10h+arg_0], edx + jnz short loc_4CFE7E + mov [esi+10h], eax + mov eax, [ebx+ebp*4] + mov ecx, 800h + sub ecx, eax + shr ecx, 5 + add ecx, eax + mov [ebx+ebp*4], ecx + jmp short loc_4CFE97 +; --------------------------------------------------------------------------- + +loc_4CFE7E: ; CODE XREF: sub_4CFE30+35j + add [esi+8], eax + adc dword ptr [esi+0Ch], 0 + sub ecx, eax + mov [esi+10h], ecx + mov eax, [ebx+ebp*4] + mov ecx, eax + shr ecx, 5 + sub eax, ecx + mov [ebx+ebp*4], eax + +loc_4CFE97: ; CODE XREF: sub_4CFE30+4Cj + mov eax, [esi+10h] + cmp eax, 1000000h + jnb short loc_4CFEB2 + shl eax, 8 + mov ecx, esi + mov [esi+10h], eax + call loc_4CF640 + mov edx, [esp+10h+arg_0] + +loc_4CFEB2: ; CODE XREF: sub_4CFE30+6Fj + add ebp, ebp + or ebp, edi + test edx, edx + jnz short loc_4CFE44 + pop edi + pop esi + pop ebp + pop ebx + retn 8 +sub_4CFE30 endp + +; --------------------------------------------------------------------------- + align 10h +; =============== S U B R O U T I N E ======================================= + +sub_4CFED0 proc near ; CODE XREF: CEncoder_CodeOneBlock+300p + +var_4 = dword ptr -4 +arg_0 = dword ptr 4 +arg_4 = byte ptr 8 +arg_8 = byte ptr 0Ch + + push ecx + push ebx + push ebp + push esi + mov esi, [esp+10h+arg_0] + push edi + mov [esp+14h+var_4], ecx + mov ebx, 1 + mov edx, 8 + jmp short loc_4CFEF0 +; --------------------------------------------------------------------------- + align 10h + +loc_4CFEF0: ; CODE XREF: sub_4CFED0+17j + ; sub_4CFED0+ADj + movzx ebp, [esp+14h+arg_4] + movzx edi, [esp+14h+arg_8] + sub edx, 1 + movzx ecx, dl + shr ebp, cl + shr edi, cl + mov ecx, [esp+14h+var_4] + mov [esp+14h+arg_0], edx + mov edx, [esi+10h] + and ebp, 1 + lea eax, [ebp+1] + shl eax, 8 + add eax, ebx + lea ecx, [ecx+eax*4] + mov eax, edx + shr eax, 0Bh + imul eax, [ecx] + and edi, 1 + test edi, edi + jnz short loc_4CFF41 + mov [esi+10h], eax + mov eax, [ecx] + mov edx, 800h + sub edx, eax + shr edx, 5 + add edx, eax + mov [ecx], edx + jmp short loc_4CFF58 +; --------------------------------------------------------------------------- + +loc_4CFF41: ; CODE XREF: sub_4CFED0+5Aj + add [esi+8], eax + adc dword ptr [esi+0Ch], 0 + sub edx, eax + mov [esi+10h], edx + mov eax, [ecx] + mov edx, eax + shr edx, 5 + sub eax, edx + mov [ecx], eax + +loc_4CFF58: ; CODE XREF: sub_4CFED0+6Fj + mov eax, [esi+10h] + cmp eax, 1000000h + jnb short loc_4CFF6F + shl eax, 8 + mov ecx, esi + mov [esi+10h], eax + call loc_4CF640 + +loc_4CFF6F: ; CODE XREF: sub_4CFED0+90j + mov edx, [esp+14h+arg_0] + add ebx, ebx + or ebx, edi + cmp ebp, edi + jnz short loc_4CFF8B + test edx, edx + jnz loc_4CFEF0 + pop edi + pop esi + pop ebp + pop ebx + pop ecx + retn 0Ch +; --------------------------------------------------------------------------- + +loc_4CFF8B: ; CODE XREF: sub_4CFED0+A9j + test edx, edx + jz loc_4D0012 + +loc_4CFF93: ; CODE XREF: sub_4CFED0+140j + movzx edi, [esp+14h+arg_8] + mov ebp, [esp+14h+var_4] + sub edx, 1 + mov cl, dl + shr edi, cl + mov ecx, [esi+10h] + mov eax, ecx + shr eax, 0Bh + imul eax, [ebp+ebx*4+0] + and edi, 1 + test edi, edi + mov [esp+14h+arg_0], edx + jnz short loc_4CFFD4 + mov [esi+10h], eax + mov eax, [ebp+ebx*4+0] + mov ecx, 800h + sub ecx, eax + shr ecx, 5 + add ecx, eax + mov [ebp+ebx*4+0], ecx + jmp short loc_4CFFEF +; --------------------------------------------------------------------------- + +loc_4CFFD4: ; CODE XREF: sub_4CFED0+E9j + add [esi+8], eax + adc dword ptr [esi+0Ch], 0 + sub ecx, eax + mov [esi+10h], ecx + mov eax, [ebp+ebx*4+0] + mov ecx, eax + shr ecx, 5 + sub eax, ecx + mov [ebp+ebx*4+0], eax + +loc_4CFFEF: ; CODE XREF: sub_4CFED0+102j + mov eax, [esi+10h] + cmp eax, 1000000h + jnb short loc_4D000A + shl eax, 8 + mov ecx, esi + mov [esi+10h], eax + call loc_4CF640 + mov edx, [esp+14h+arg_0] + +loc_4D000A: ; CODE XREF: sub_4CFED0+127j + add ebx, ebx + or ebx, edi + test edx, edx + jnz short loc_4CFF93 + +loc_4D0012: ; CODE XREF: sub_4CFED0+BDj + pop edi + pop esi + pop ebp + pop ebx + pop ecx + retn 0Ch +sub_4CFED0 endp + +; --------------------------------------------------------------------------- + align 10h +; =============== S U B R O U T I N E ======================================= + +sub_4D0020 proc near ; CODE XREF: sub_4D0770+C6p + ; CEncoder_CodeOneBlock+56Dp ... + +arg_0 = dword ptr 4 +arg_4 = dword ptr 8 +arg_8 = dword ptr 0Ch + + push ebp + mov ebp, [esp+4+arg_4] + cmp ebp, 8 + push esi + mov esi, [esp+8+arg_0] + push edi + mov edi, ecx + jnb short loc_4D007D + mov eax, [esi+10h] + shr eax, 0Bh + imul eax, [edi] + mov [esi+10h], eax + mov eax, [edi] + mov ecx, 800h + sub ecx, eax + +loc_4D0047: ; DATA XREF: .rdata:0050C3BCo + shr ecx, 5 + add ecx, eax + mov [edi], ecx + mov eax, [esi+10h] + cmp eax, 1000000h + jnb short loc_4D0065 + shl eax, 8 + +loc_4D005B: ; DATA XREF: .rdata:005064B0o + mov ecx, esi + mov [esi+10h], eax + call loc_4CF640 + +loc_4D0065: ; CODE XREF: sub_4D0020+36j + mov edx, [esp+0Ch+arg_8] + push ebp + shl edx, 5 + push esi + lea ecx, [edx+edi+8] + call sub_4CFB20 + pop edi + pop esi + pop ebp + retn 0Ch +; --------------------------------------------------------------------------- + +loc_4D007D: ; CODE XREF: sub_4D0020+10j + mov ecx, [esi+10h] + mov eax, ecx + shr eax, 0Bh + imul eax, [edi] + add [esi+8], eax + adc dword ptr [esi+0Ch], 0 + sub ecx, eax + mov [esi+10h], ecx + mov eax, [edi] + mov ecx, eax + shr ecx, 5 + sub eax, ecx + mov [edi], eax + mov eax, [esi+10h] + cmp eax, 1000000h + jnb short loc_4D00B6 + shl eax, 8 + mov ecx, esi + mov [esi+10h], eax + call loc_4CF640 + +loc_4D00B6: ; CODE XREF: sub_4D0020+87j + cmp ebp, 10h + jnb short loc_4D010F + mov edx, [esi+10h] + shr edx, 0Bh + imul edx, [edi+4] + mov [esi+10h], edx + mov eax, [edi+4] + mov ecx, 800h + sub ecx, eax + shr ecx, 5 + add ecx, eax + mov [edi+4], ecx + mov eax, [esi+10h] + cmp eax, 1000000h + jnb short loc_4D00F1 + shl eax, 8 + mov ecx, esi + mov [esi+10h], eax + call loc_4CF640 + +loc_4D00F1: ; CODE XREF: sub_4D0020+C2j + mov edx, [esp+0Ch+arg_8] + add ebp, 0FFFFFFF8h + push ebp + shl edx, 5 + push esi + lea ecx, [edx+edi+208h] + call sub_4CFB20 + pop edi + pop esi + pop ebp + retn 0Ch +; --------------------------------------------------------------------------- + +loc_4D010F: ; CODE XREF: sub_4D0020+99j + mov ecx, [esi+10h] + mov eax, ecx + shr eax, 0Bh + imul eax, [edi+4] + add [esi+8], eax + adc dword ptr [esi+0Ch], 0 + sub ecx, eax + mov [esi+10h], ecx + mov eax, [edi+4] + mov ecx, eax + shr ecx, 5 + sub eax, ecx + mov [edi+4], eax + mov eax, [esi+10h] + cmp eax, 1000000h + jnb short loc_4D014B + shl eax, 8 + mov ecx, esi + mov [esi+10h], eax + call loc_4CF640 + +loc_4D014B: ; CODE XREF: sub_4D0020+11Cj + add ebp, 0FFFFFFF0h + push ebp + push esi + lea ecx, [edi+408h] + call sub_4CFBC0 + pop edi + pop esi + pop ebp + retn 0Ch +sub_4D0020 endp + +; =============== S U B R O U T I N E ======================================= + +NCompress_NLZMA_CEncoder_CEncoder proc near ; CODE XREF: Compress_lzma_internal+149p + mov eax, ecx + mov dword ptr [eax+4], offset ICompressSetOutStream_vftable + mov dword ptr [eax+8], offset ICompressSetCoderProperties_vftable + mov dword ptr [eax+0Ch], offset ICompressWriteCoderProperties_vftable + xor ecx, ecx + mov [eax+24h], ecx + mov dword ptr [eax], offset NCompress_NLZMA_CEncoder_vftable + mov dword ptr [eax+4], offset NCompress_NLZMA_CEncoder_vftable_ICompressSetOutStream + mov dword ptr [eax+8], offset NCompress_NLZMA_CEncoder_vftable_ICompressSetCoderProperties + mov dword ptr [eax+0Ch], offset NCompress_NLZMA_CEncoder_vftable_ICompressWriteCoderProperties + mov [eax+40h], ecx + mov [eax+44h], ecx + mov [eax+54h], ecx + mov [eax+60h], ecx + mov [eax+32650h], ecx + mov dword ptr [eax+32EF8h], 20h + mov dword ptr [eax+33B58h], 2Ch + mov dword ptr [eax+33B5Ch], 2 + mov [eax+33B64h], ecx + mov dword ptr [eax+33B6Ch], 00400000h + mov edx, 3 + mov [eax+33B60h], edx + mov [eax+33B68h], edx + mov [eax+33B8Ch], ecx + mov [eax+33B90h], ecx + mov [eax+33B94h], cl + mov [eax+0B4h], ecx + mov [eax+0A4h], ecx + mov dword ptr [eax+0B0h], 20h + mov dword ptr [eax+0D4h], 1 + mov dword ptr [eax+0CCh], 4 + mov [eax+0D0h], ecx + mov [eax+0D8h], ecx + mov [eax+32EF4h], cl + retn +NCompress_NLZMA_CEncoder_CEncoder endp + +; =============== S U B R O U T I N E ======================================= + +; int __thiscall sub_4D0250(void *Memory, char) +sub_4D0250 proc near ; DATA XREF: .rdata:00517B0Co + +arg_0 = byte ptr 4 + + push esi + mov esi, ecx + call sub_4CF810 + test [esp+4+arg_0], 1 + jz short loc_4D0268 + push esi ; Memory + call j__free + add esp, 4 + +loc_4D0268: ; CODE XREF: sub_4D0250+Dj + mov eax, esi + pop esi + retn 4 +sub_4D0250 endp + +; --------------------------------------------------------------------------- + align 10h +; =============== S U B R O U T I N E ======================================= + +sub_4D0270 proc near ; CODE XREF: CEncoder_SetStreams+14p + push esi + mov esi, ecx + mov eax, [esi+40h] + test eax, eax + push edi + mov edi, 100000h + jz short loc_4D0297 + cmp [esi+50h], edi + jz short loc_4D02C5 + test eax, eax + jz short loc_4D0297 + push 8000h ; dwFreeType + push 0 ; dwSize + push eax ; lpAddress + call ds:VirtualFree + +loc_4D0297: ; CODE XREF: sub_4D0270+Ej + ; sub_4D0270+17j + push 4 ; flProtect + push 1000h ; flAllocationType + push edi ; dwSize + push 0 ; lpAddress + mov dword ptr [esi+40h], 0 + mov [esi+50h], edi + call ds:VirtualAlloc + test eax, eax + mov [esi+40h], eax + setnz al + test al, al + jnz short loc_4D02C5 + pop edi + mov eax, 8007000Eh + pop esi + retn +; --------------------------------------------------------------------------- + +loc_4D02C5: ; CODE XREF: sub_4D0270+13j + ; sub_4D0270+4Bj + mov eax, [esi+33B68h] + mov ecx, [esi+33B64h] + cmp dword ptr [esi+0D4h], 0 + push ebx + push eax + push ecx + lea ecx, [esi+32650h] + setnz bl + call sub_4CD940 + test al, al + jz short loc_4D034F + mov ecx, [esi+33B6Ch] + mov edx, 1000000h + cmp edx, ecx + sbb eax, eax + neg eax + push ebp + mov ebp, [esi+32EF8h] + mov [esi+0D8h], eax + mov eax, ebp + shr eax, 1 + add eax, 10h + test bl, bl + jnz short loc_4D0318 + shr eax, 1 + +loc_4D0318: ; CODE XREF: sub_4D0270+A4j + mov edx, [esi+33B90h] + test edx, edx + jz short loc_4D0324 + mov eax, edx + +loc_4D0324: ; CODE XREF: sub_4D0270+B0j + push offset off_546E20 + push 111h + push ebp + push 1000h + push ecx + lea edi, [esi+84h] + push edi + mov [esi+0B0h], eax + call sub_4CBA60 + add esp, 18h + test eax, eax + pop ebp + jnz short loc_4D0358 + +loc_4D034F: ; CODE XREF: sub_4D0270+7Bj + pop ebx + pop edi + mov eax, 8007000Eh + pop esi + retn +; --------------------------------------------------------------------------- + +loc_4D0358: ; CODE XREF: sub_4D0270+DDj + mov [esi+80h], edi + add esi, 68h + push esi + push edi + call sub_4CCAA0 + add esp, 8 + pop ebx + pop edi + xor eax, eax + pop esi + retn +sub_4D0270 endp + +; --------------------------------------------------------------------------- + align 10h +; =============== S U B R O U T I N E ======================================= + +CEncoder_SetStreams proc near ; CODE XREF: CEncoder_CodeReal+4Ap + +arg_0 = dword ptr 4 +arg_4 = dword ptr 8 + + mov eax, [esp+arg_0] + push esi + mov esi, ecx + mov [esi+33B84h], eax + mov byte ptr [esi+33B80h], 0 + call sub_4D0270 + test eax, eax + jnz loc_4D0441 + mov edx, [esp+4+arg_4] + mov ecx, [esi+4] + lea eax, [esi+4] + push edx + push eax + mov eax, [ecx+0Ch] + call eax + test eax, eax + jnz loc_4D0441 + mov ecx, esi + call sub_4CDEA0 + test eax, eax + jnz short loc_4D0441 + cmp [esi+32EF4h], al + jnz short loc_4D03DB + mov ecx, esi + call CEncoder_FillDistancesPrices + mov ecx, esi + call CEncoder_FillAlignPrices + +loc_4D03DB: ; CODE XREF: CEncoder_SetStreams+4Bj + mov ecx, [esi+32EF8h] + sub ecx, 1 + mov [esi+2D9C0h], ecx + mov ecx, [esi+33B5Ch] + mov edx, 1 + shl edx, cl + lea ecx, [esi+28DB8h] + push edx + call sub_4CF780 + mov ecx, [esi+33B5Ch] + mov eax, [esi+32EF8h] + mov edx, 1 + shl edx, cl + sub eax, 1 + lea ecx, [esi+2DA04h] + mov [esi+3260Ch], eax + push edx + call sub_4CF780 + mov dword ptr [esi+33B78h], 0 + mov dword ptr [esi+33B7Ch], 0 + xor eax, eax + +loc_4D0441: ; CODE XREF: CEncoder_SetStreams+1Bj + ; CEncoder_SetStreams+34j ... + pop esi + retn 10h +CEncoder_SetStreams endp + +;Compress_lzma_internal proc near ; CODE XREF: Compress_lzma+34p +_starcraft_compress_lzma proc near ; CODE XREF: Compress_lzma+34p +; sub_4D0450 + +var_58 = dword ptr -58h +var_54 = dword ptr -54h +var_50 = dword ptr -50h +var_4C = dword ptr -4Ch +var_48 = dword ptr -48h +var_44 = dword ptr -44h +var_40 = dword ptr -40h +var_3C = word ptr -3Ch +var_34 = dword ptr -34h +var_2C = word ptr -2Ch +var_24 = dword ptr -24h +var_1C = dword ptr -1Ch +var_14 = dword ptr -14h +var_C = dword ptr -0Ch +var_4 = dword ptr -4 +pbInBuffer = dword ptr 4 +cbInBuffer = dword ptr 8 +pcbInBuffer = dword ptr 0Ch +pbOutBuffer = dword ptr 10h +cbOutBuffer = dword ptr 14h +dummy = dword ptr 18h +pcbOutBuffer = dword ptr 1Ch +pfnAllocateMemory= dword ptr 20h +pfnFreeMemory = dword ptr 24h +pfnGiveData = dword ptr 28h + + push 0FFFFFFFFh + push offset loc_4DA0FB + mov eax, dword ptr fs:[0] + push eax + sub esp, 4Ch + push ebx + push ebp + push esi + push edi + mov eax, dword_544960 + xor eax, esp + push eax + lea eax, [esp+6Ch+var_C] + mov dword ptr fs:[0], eax + mov eax, dword_553598 + xor ebx, ebx + cmp eax, ebx + jnz short loc_4D04A1 + push 0Ch ; Size + call _operator_new ; operator new(uint) + add esp, 4 + cmp eax, ebx + jz short loc_4D049A + mov [eax], ebx + mov [eax+4], ebx + mov [eax+8], ebx + jmp short loc_4D049C +; --------------------------------------------------------------------------- + +loc_4D049A: ; CODE XREF: Compress_lzma_internal+3Ej + xor eax, eax + +loc_4D049C: ; CODE XREF: Compress_lzma_internal+48j + mov dword ptr dword_553598, eax + +loc_4D04A1: ; CODE XREF: Compress_lzma_internal+30j + cmp [eax], ebx + jnz short loc_4D04B3 + mov ecx, [esp+6Ch+pfnAllocateMemory] + mov [eax], ecx + mov eax, dword_553598 + +loc_4D04B3: ; CODE XREF: Compress_lzma_internal+53j + cmp eax, ebx + jnz short loc_4D04D6 + push 0Ch ; Size + call _operator_new ; operator new(uint) + add esp, 4 + cmp eax, ebx + jz short loc_4D04CF + mov [eax], ebx + mov [eax+4], ebx + mov [eax+8], ebx + jmp short loc_4D04D1 +; --------------------------------------------------------------------------- + +loc_4D04CF: ; CODE XREF: Compress_lzma_internal+73j + xor eax, eax + +loc_4D04D1: ; CODE XREF: Compress_lzma_internal+7Dj + mov dword_553598, eax + +loc_4D04D6: ; CODE XREF: Compress_lzma_internal+65j + cmp [eax+4], ebx + jnz short loc_4D04EA + mov edx, [esp+6Ch+pfnFreeMemory] + mov [eax+4], edx + mov eax, dword_553598 + +loc_4D04EA: ; CODE XREF: Compress_lzma_internal+89j + cmp [eax+8], ebx + jnz short loc_4D04F9 + mov ecx, [esp+6Ch+pfnGiveData] + mov [eax+8], ecx + +loc_4D04F9: ; CODE XREF: Compress_lzma_internal+9Dj + mov edx, [esp+6Ch+pcbOutBuffer] + mov ebp, [esp+6Ch+pcbInBuffer] + cmp ebp, ebx + mov esi, [esp+6Ch+cbInBuffer] + mov [edx], ebx + mov edx, 1 + mov eax, esi + mov ecx, ebp + ja short loc_4D0520 + cmp esi, ebx + jbe short loc_4D053A + jmp short loc_4D0520 +; --------------------------------------------------------------------------- + align 10h + +loc_4D0520: ; CODE XREF: Compress_lzma_internal+C5j + ; Compress_lzma_internal+CBj ... + shrd eax, ecx, 1 + add edx, edx + shr ecx, 1 + cmp edx, 2000000h + ja short loc_4D053A + cmp ecx, ebx + ja short loc_4D0520 + jb short loc_4D053A + cmp eax, ebx + ja short loc_4D0520 + +loc_4D053A: ; CODE XREF: Compress_lzma_internal+C9j + ; Compress_lzma_internal+DEj ... + mov eax, 13h + push 33B98h ; Size + mov [esp+70h+var_48], 470h + mov [esp+70h+var_44], 400h + mov [esp+70h+var_40], 450h + mov [esp+70h+var_3C], ax + mov [esp+70h+var_2C], ax + mov word ptr [esp+70h+var_1C], ax + mov [esp+70h+var_34], 2 + mov [esp+70h+var_24], edx + mov [esp+70h+var_14], 40h + mov [esp+70h+var_58], ebx + call _operator_new ; operator new(uint) + add esp, 4 + mov [esp+6Ch+var_4C], eax + cmp eax, ebx + mov [esp+6Ch+var_4], ebx + jz short loc_4D05A4 + mov ecx, eax + call NCompress_NLZMA_CEncoder_CEncoder + mov [esp+6Ch+var_54], eax + jmp short loc_4D05AA +; --------------------------------------------------------------------------- + +loc_4D05A4: ; CODE XREF: Compress_lzma_internal+145j + mov [esp+6Ch+var_54], ebx + mov eax, ebx + +loc_4D05AA: ; CODE XREF: Compress_lzma_internal+152j + or edi, 0FFFFFFFFh + cmp eax, ebx + mov [esp+6Ch+var_4], edi + jz short loc_4D05D1 + mov ecx, [eax+8] + push 3 + lea edx, [esp+70h+var_3C] + push edx + add eax, 8 + lea edx, [esp+74h+var_48] + push edx + push eax + mov eax, [ecx+0Ch] + call eax ; ICompressSetCodeProperties::SetCoderProperties + test eax, eax + jz short loc_4D05D5 + +loc_4D05D1: ; CODE XREF: Compress_lzma_internal+163j + mov [esp+6Ch+var_58], edi + +loc_4D05D5: ; CODE XREF: Compress_lzma_internal+17Fj + push 28h ; Size + call _operator_new ; operator new(uint) + add esp, 4 + cmp eax, ebx + jz short loc_4D060E + mov ecx, [esp+6Ch+pbInBuffer] + mov [eax+4], ebx + add dword ptr [eax+4], 1 + mov dword ptr [eax], offset off_517A90 + mov [eax+8], ecx + mov [eax+10h], esi + mov [eax+14h], ebp + mov [eax+18h], ebx + mov [eax+1Ch], ebx + mov [eax+20h], bl + mov edi, eax ; EDI = pInStreamMemory + mov [esp+6Ch+var_50], eax + jmp short loc_4D0614 +; --------------------------------------------------------------------------- + +loc_4D060E: ; CODE XREF: Compress_lzma_internal+191j + xor edi, edi + mov [esp+6Ch+var_50], edi + +loc_4D0614: ; CODE XREF: Compress_lzma_internal+1BCj + push 28h ; Size + call _operator_new ; operator new(uint) + add esp, 4 + cmp eax, ebx + jz short loc_4D0657 + mov edx, [esp+6Ch+pbOutBuffer] + mov ecx, [esp+6Ch+cbOutBuffer] + mov [eax+4], ebx + add dword ptr [eax+4], 1 + mov [eax+8], edx + mov edx, [esp+6Ch+dummy] + mov dword ptr [eax], offset off_517AA4 + mov [eax+10h], ecx + mov [eax+14h], edx + mov [eax+18h], ebx + mov [eax+1Ch], ebx + mov [eax+20h], bl + mov esi, eax ; ESI = pOutStreamMemory + jmp short loc_4D0659 +; --------------------------------------------------------------------------- + +loc_4D0657: ; CODE XREF: Compress_lzma_internal+1D0j + xor esi, esi + +loc_4D0659: ; CODE XREF: Compress_lzma_internal+205j + cmp edi, ebx + jz short loc_4D0661 + cmp esi, ebx + jnz short loc_4D0669 + +loc_4D0661: ; CODE XREF: Compress_lzma_internal+20Bj + mov [esp+6Ch+var_58], 0FFFFFFFFh + +loc_4D0669: ; CODE XREF: Compress_lzma_internal+20Fj + mov eax, [esi] ; EAX = pOutStreamMemory->vftable + mov ecx, [eax+10h] ; ECX = + push ebx + mov edi, 1 + push edi + push ebx + push esi + call ecx + test eax, eax + jz short loc_4D0681 + mov [esp+6Ch+var_58], edi + +loc_4D0681: ; CODE XREF: Compress_lzma_internal+22Bj + mov eax, [esp+6Ch+var_54] + mov edx, [eax+0Ch] + add eax, 0Ch + push esi + push eax + mov eax, [edx+0Ch] + call eax + test eax, eax + jz short loc_4D069A + mov [esp+6Ch+var_58], edi + +loc_4D069A: ; CODE XREF: Compress_lzma_internal+244j + xor edi, edi + jmp short loc_4D06A4 +; --------------------------------------------------------------------------- + align 10h + +loc_4D06A0: ; CODE XREF: Compress_lzma_internal+27Fj + mov ebp, [esp+6Ch+pcbInBuffer] + +loc_4D06A4: ; CODE XREF: Compress_lzma_internal+24Cj + mov eax, [esp+6Ch+cbInBuffer] + push ebx + push 1 + mov edx, ebp + mov ecx, edi + call __allshr ; Microsoft VisualC 2-8/net runtime + push eax + mov eax, [esi] + mov ecx, [eax+10h] + push esi + call ecx + test eax, eax + jz short loc_4D06C9 + mov [esp+6Ch+var_58], 1 + +loc_4D06C9: ; CODE XREF: Compress_lzma_internal+26Fj + add edi, 8 + cmp edi, 40h + jl short loc_4D06A0 + mov ebp, [esp+6Ch+var_54] + xor edi, edi + cmp [esp+6Ch+var_58], ebx + jnz short loc_4D0723 + mov eax, [esp+6Ch+var_50] + mov edx, [ebp+0] + mov ecx, [edx+0Ch] + push ebx + push ebx + push ebx + push esi + push eax + push ebp + call ecx + mov ecx, [esi+18h] + mov edi, eax + mov eax, [esi+1Ch] + cmp eax, ebx + ja short loc_4D0700 + cmp ecx, 0FFFFFFFFh + jbe short loc_4D0709 + +loc_4D0700: ; CODE XREF: Compress_lzma_internal+2A9j + or ecx, 0FFFFFFFFh + mov [esp+6Ch+pcbInBuffer], ebx + jmp short loc_4D070D +; --------------------------------------------------------------------------- + +loc_4D0709: ; CODE XREF: Compress_lzma_internal+2AEj + mov [esp+6Ch+pcbInBuffer], eax + +loc_4D070D: ; CODE XREF: Compress_lzma_internal+2B7j + mov edx, [esp+6Ch+pcbOutBuffer] + mov [edx], ecx + cmp [esi+20h], bl + jz short loc_4D0723 + mov [esp+6Ch+var_58], 1 + +loc_4D0723: ; CODE XREF: Compress_lzma_internal+28Bj + ; Compress_lzma_internal+2C9j + mov eax, [esp+6Ch+var_50] + cmp eax, ebx + jz short loc_4D0733 + mov ecx, [eax] + mov edx, [ecx+8] + push eax + call edx + +loc_4D0733: ; CODE XREF: Compress_lzma_internal+2D9j + mov eax, [esi] + mov ecx, [eax+8] + push esi + call ecx + mov edx, [ebp+0] + mov eax, [edx+10h] + push 1 + mov ecx, ebp + call eax + mov eax, [esp+6Ch+var_58] + cmp eax, ebx + jnz short loc_4D0755 + neg edi + sbb edi, edi + mov eax, edi + +loc_4D0755: ; CODE XREF: Compress_lzma_internal+2FDj + mov ecx, [esp+6Ch+var_C] + mov dword ptr fs:[0], ecx + pop ecx + pop edi + pop esi + pop ebp + pop ebx + add esp, 58h + retn +_starcraft_compress_lzma endp +;Compress_lzma_internal endp + +; =============== S U B R O U T I N E ======================================= + +Compress_lzma proc near ; DATA XREF: .rdata:00509684o + +pbOutBuffer = dword ptr 4 +pcbOutBuffer = dword ptr 8 +pbInBuffer = dword ptr 0Ch +cbInBuffer = dword ptr 10h + + push esi + push edi +; call sub_47F198 + mov esi, [esp+8+pcbOutBuffer] ; ESI = pcbOutBuffer + mov edi, [esp+8+cbInBuffer] ; EDI = cbInBuffer +; push offset GiveDataToCompress +; push offset FreeMemory_47F3AB +; push offset AllocateMemory_47F396 + push esi ; pcbOutBuffer + push 0 + mov [eax+493E0h], eax + push dword ptr [esi] ; cbOutBuffer + push [esp+20h+pbOutBuffer] ; pbOutBuffer + push 0 + push edi ; cbInBuffer + push [esp+2Ch+pbInBuffer] ; pbInBuffer +; call Compress_lzma_internal + add esp, 28h + sub eax, 0 + jz short loc_47F401 + mov [esi], edi + dec eax + +loc_47F401: ; CODE XREF: Compress_lzma+3Fj + pop edi + pop esi + retn +Compress_lzma endp + +; =============== S U B R O U T I N E ======================================= + +sub_4D0770 proc near ; CODE XREF: CEncoder_Flush+1Ap + +arg_0 = dword ptr 4 + + push edi + mov edi, ecx + cmp byte ptr [edi+33B94h], 0 + jz loc_4D0881 + movzx eax, byte ptr [edi+10h] + mov ecx, [edi+38h] + shl eax, 4 + push ebx + mov ebx, [esp+8+arg_0] + add eax, ebx + lea edx, [edi+eax*4+280F0h] + push ebp + push esi + lea esi, [edi+28h] + mov eax, ecx + shr eax, 0Bh + imul eax, [edx] + add [esi+8], eax + adc dword ptr [esi+0Ch], 0 + sub ecx, eax + mov [esi+10h], ecx + mov eax, [edx] + mov ecx, eax + shr ecx, 5 + sub eax, ecx + mov [edx], eax + mov eax, [esi+10h] + cmp eax, 1000000h + jnb short loc_4D07D3 + shl eax, 8 + mov ecx, esi + mov [esi+10h], eax + call loc_4CF640 + +loc_4D07D3: ; CODE XREF: sub_4D0770+54j + movzx edx, byte ptr [edi+10h] + mov ecx, [esi+10h] + lea eax, [edi+edx*4+283F0h] + shr ecx, 0Bh + imul ecx, [eax] + mov [esi+10h], ecx + mov ecx, [eax] + mov edx, 800h + sub edx, ecx + shr edx, 5 + add edx, ecx + mov [eax], edx + mov eax, [esi+10h] + cmp eax, 1000000h + jnb short loc_4D0811 + shl eax, 8 + mov ecx, esi + mov [esi+10h], eax + call loc_4CF640 + +loc_4D0811: ; CODE XREF: sub_4D0770+92j + movzx eax, byte ptr [edi+10h] + mov cl, ds:kMatchNextStates[eax] + push ebx + mov [edi+10h], cl + cmp byte ptr [edi+32EF4h], 0 + push 0 + lea ebp, [edi+28DB8h] + push esi + mov ecx, ebp + setz byte ptr [esp+1Ch+arg_0] + call sub_4D0020 + cmp byte ptr [esp+10h+arg_0], 0 + jz short loc_4D0854 + add dword ptr [ebp+ebx*4+4C0Ch], 0FFFFFFFFh + jnz short loc_4D0854 + push ebx + mov ecx, ebp + call sub_4CF740 + +loc_4D0854: ; CODE XREF: sub_4D0770+D0j + ; sub_4D0770+DAj + push 3Fh + push esi + lea ecx, [edi+287B0h] + call sub_4CFC60 + push 1Ah + push 3FFFFFFh + mov ecx, esi + call sub_4CF6E0 + push 0Fh + push esi + lea ecx, [edi+28D78h] + call sub_4CFD00 + pop esi + pop ebp + pop ebx + +loc_4D0881: ; CODE XREF: sub_4D0770+Aj + pop edi + retn 4 +sub_4D0770 endp + +; --------------------------------------------------------------------------- + align 10h +; =============== S U B R O U T I N E ======================================= + +CEncoder_Flush proc near ; CODE XREF: CEncoder_CodeOneBlock+BAp + ; CEncoder_CodeOneBlock+1D0p ... + +arg_0 = dword ptr 4 + + push esi + mov esi, ecx + mov eax, [esi+0ECh] + test eax, eax + jnz short loc_4D08E5 + mov eax, [esi+33B60h] + and eax, [esp+4+arg_0] + push ebx + push edi + push eax + call sub_4D0770 + lea ebx, [esi+28h] + mov edi, 5 + +loc_4D08B7: ; CODE XREF: CEncoder_Flush+31j + mov ecx, ebx + call loc_4CF640 + sub edi, 1 + jnz short loc_4D08B7 + mov ecx, [esi+4Ch] + add esi, 40h + cmp ecx, [esi+4] + pop edi + pop ebx + jz short loc_4D08E3 + +loc_4D08D0: ; CODE XREF: CEncoder_Flush+51j + mov ecx, esi + call sub_4CF450 + test eax, eax + jnz short loc_4D08E5 + mov edx, [esi+0Ch] + cmp edx, [esi+4] + jnz short loc_4D08D0 + +loc_4D08E3: ; CODE XREF: CEncoder_Flush+3Ej + xor eax, eax + +loc_4D08E5: ; CODE XREF: CEncoder_Flush+Bj + ; CEncoder_Flush+49j + pop esi + retn 4 +CEncoder_Flush endp + +; --------------------------------------------------------------------------- + align 10h +; =============== S U B R O U T I N E ======================================= + +CEncoder_CodeOneBlock proc near ; CODE XREF: CEncoder_CodeReal+B1p + ; CEncoder_CodeReal+F5p + +var_20 = byte ptr -20h +var_1C = dword ptr -1Ch +var_18 = dword ptr -18h +var_14 = dword ptr -14h +var_10 = dword ptr -10h +var_C = dword ptr -0Ch +var_8 = dword ptr -8 +var_4 = dword ptr -4 +arg_0 = dword ptr 4 +arg_4 = dword ptr 8 +arg_8 = dword ptr 0Ch + + sub esp, 20h + push ebp + push esi + mov esi, ecx + push edi + mov edi, [esi+33B84h] + xor ebp, ebp + cmp edi, ebp + jz short loc_4D0952 + mov eax, [edi] + mov ecx, [eax+4] + push edi + call ecx + mov eax, [esi+33B8Ch] + cmp eax, ebp + jz short loc_4D091E + mov edx, [eax] + push eax + mov eax, [edx+8] + call eax + +loc_4D091E: ; CODE XREF: CEncoder_CodeOneBlock+24j + mov [esi+33B8Ch], edi + mov ecx, [esi+80h] + mov edx, [esi+68h] + lea eax, [esi+33B88h] + push ecx + mov dword ptr [eax], offset loc_4CF210 + mov [esi+0B8h], eax + call edx + add esp, 4 + mov byte ptr [esi+33B95h], 1 + mov [esi+33B84h], ebp + +loc_4D0952: ; CODE XREF: CEncoder_CodeOneBlock+12j + mov eax, [esp+2Ch+arg_8] + mov dword ptr [eax], 1 + cmp byte ptr [esi+33B80h], 0 + jz short loc_4D0974 + mov eax, [esi+0ECh] + pop edi + pop esi + pop ebp + add esp, 20h + retn 0Ch +; --------------------------------------------------------------------------- + +loc_4D0974: ; CODE XREF: CEncoder_CodeOneBlock+73j + mov ecx, [esi+33B78h] + or ecx, [esi+33B7Ch] + push ebx + mov byte ptr [esi+33B80h], 1 + jnz loc_4D0A9C + mov edx, [esi+80h] + mov eax, [esi+70h] + push edx + call eax + add esp, 4 + test eax, eax + jnz short loc_4D09B9 + mov ecx, [esi+33B78h] + push ecx + mov ecx, esi + call CEncoder_Flush + pop ebx + pop edi + pop esi + pop ebp + add esp, 20h + retn 0Ch +; --------------------------------------------------------------------------- + +loc_4D09B9: ; CODE XREF: CEncoder_CodeOneBlock+AFj + lea edx, [esp+30h+var_4] + push edx + mov ecx, esi + call sub_4CB3B0 + movzx ecx, byte ptr [esi+10h] + mov eax, [esi+33B60h] + and eax, [esi+33B78h] + mov edx, [esi+38h] + lea edi, [esi+28h] + shl ecx, 4 + add eax, ecx + shr edx, 0Bh + imul edx, [esi+eax*4+280F0h] + lea eax, [esi+eax*4+280F0h] + mov [edi+10h], edx + mov ecx, [eax] + mov edx, 800h + sub edx, ecx + shr edx, 5 + add edx, ecx + mov [eax], edx + mov eax, [edi+10h] + cmp eax, 1000000h + jnb short loc_4D0A1C + shl eax, 8 + mov ecx, edi + mov [edi+10h], eax + call loc_4CF640 + +loc_4D0A1C: ; CODE XREF: CEncoder_CodeOneBlock+11Dj + movzx eax, byte ptr [esi+10h] + mov cl, ds:kLiteralNextStates[eax] + mov [esi+10h], cl + mov edx, [esi+32F04h] + mov eax, [esi+80h] + mov ecx, [esi+6Ch] + neg edx + push edx + push eax + call ecx + mov bl, al + mov eax, [esi+32654h] + add esp, 8 + mov byte ptr [esp+30h+var_10], bl + mov edx, [esp+30h+var_10] + push edx + movzx edx, byte ptr [esi+11h] + push edi + mov edi, [esi+3265Ch] + and edi, [esi+33B78h] + mov ecx, 8 + sub cl, al + shr edx, cl + mov ecx, eax + shl edi, cl + add edx, edi + imul edx, 0C00h + add edx, [esi+32650h] + mov ecx, edx + call sub_4CFE30 + add dword ptr [esi+32F04h], 0FFFFFFFFh + add dword ptr [esi+33B78h], 1 + mov [esi+11h], bl + adc [esi+33B7Ch], ebp + +loc_4D0A9C: ; CODE XREF: CEncoder_CodeOneBlock+98j + mov edi, [esi+33B78h] + mov eax, [esi+80h] + mov ecx, [esi+70h] + push eax + mov [esp+34h+var_14], edi + mov [esp+34h+var_4], edi + call ecx + add esp, 4 + test eax, eax + jnz short loc_4D0AD4 + push edi + mov ecx, esi + call CEncoder_Flush + pop ebx + pop edi + pop esi + pop ebp + add esp, 20h + retn 0Ch +; --------------------------------------------------------------------------- + align 10h + +loc_4D0AD0: ; CODE XREF: CEncoder_CodeOneBlock+735j + ; CEncoder_CodeOneBlock+78Bj + mov edi, [esp+30h+var_14] + +loc_4D0AD4: ; CODE XREF: CEncoder_CodeOneBlock+1CBj + cmp byte ptr [esi+32EF4h], 0 + mov ecx, esi + jz short loc_4D0AEB + lea edx, [esp+30h+var_1C] + push edx + call CEncoder_GetOptimumFast + jmp short loc_4D0AF6 +; --------------------------------------------------------------------------- + +loc_4D0AEB: ; CODE XREF: CEncoder_CodeOneBlock+1EDj + lea eax, [esp+30h+var_1C] + push eax + push edi + call CEncoder_GetOptimum + +loc_4D0AF6: ; CODE XREF: CEncoder_CodeOneBlock+1F9j + mov ebx, [esi+33B60h] + and ebx, edi + cmp eax, 1 + mov [esp+30h+var_18], eax + jnz loc_4D0C0E + cmp [esp+30h+var_1C], 0FFFFFFFFh + jnz loc_4D0C0E + movzx ecx, byte ptr [esi+10h] + mov edx, [esi+38h] + lea ebp, [esi+28h] + shl ecx, 4 + shr edx, 0Bh + add ecx, ebx + imul edx, [esi+ecx*4+280F0h] + lea eax, [esi+ecx*4+280F0h] + mov [ebp+10h], edx + mov ecx, [eax] + mov edx, 800h + sub edx, ecx + shr edx, 5 + add edx, ecx + mov [eax], edx + mov eax, [ebp+10h] + cmp eax, 1000000h + jnb short loc_4D0B61 + shl eax, 8 + mov ecx, ebp + mov [ebp+10h], eax + call loc_4CF640 + +loc_4D0B61: ; CODE XREF: CEncoder_CodeOneBlock+262j + mov eax, [esi+32F04h] + mov ecx, [esi+80h] + mov edx, [esi+6Ch] + neg eax + push eax + push ecx + call edx + movzx edi, byte ptr [esi+11h] + mov edx, [esi+3265Ch] + and edx, [esp+38h+var_14] + mov bl, al + mov eax, [esi+32654h] + mov ecx, 8 + sub cl, al + shr edi, cl + mov ecx, eax + shl edx, cl + add esp, 8 + mov byte ptr [esp+30h+var_10], bl + add edi, edx + imul edi, 0C00h + add edi, [esi+32650h] + cmp byte ptr [esi+10h], 7 + jnb short loc_4D0BC3 + mov eax, [esp+30h+var_10] + push eax + push ebp + mov ecx, edi + call sub_4CFE30 + jmp short loc_4D0BF5 +; --------------------------------------------------------------------------- + +loc_4D0BC3: ; CODE XREF: CEncoder_CodeOneBlock+2C2j + mov edx, [esi+80h] + mov eax, [esi+6Ch] + or ecx, 0FFFFFFFFh + sub ecx, [esi+14h] + sub ecx, [esi+32F04h] + push ecx + push edx + call eax + mov ecx, [esp+38h+var_10] + add esp, 8 + mov byte ptr [esp+30h+var_C], al + mov edx, [esp+30h+var_C] + push ecx + push edx + push ebp + mov ecx, edi + call sub_4CFED0 + +loc_4D0BF5: ; CODE XREF: CEncoder_CodeOneBlock+2D1j + movzx eax, byte ptr [esi+10h] + mov cl, ds:kLiteralNextStates[eax] + mov ebp, [esp+30h+var_18] + mov [esi+10h], cl + mov [esi+11h], bl + jmp loc_4D1013 +; --------------------------------------------------------------------------- + +loc_4D0C0E: ; CODE XREF: CEncoder_CodeOneBlock+215j + ; CEncoder_CodeOneBlock+220j + movzx edx, byte ptr [esi+10h] + mov ecx, [esi+38h] + lea edi, [esi+28h] + shl edx, 4 + mov eax, ecx + shr eax, 0Bh + add edx, ebx + imul eax, [esi+edx*4+280F0h] + add [edi+8], eax + lea edx, [esi+edx*4+280F0h] + mov ebp, 0 + adc [edi+0Ch], ebp + sub ecx, eax + mov [edi+10h], ecx + mov eax, [edx] + mov ecx, eax + shr ecx, 5 + sub eax, ecx + mov [edx], eax + mov eax, [edi+10h] + cmp eax, 1000000h + jnb short loc_4D0C63 + shl eax, 8 + mov ecx, edi + mov [edi+10h], eax + call loc_4CF640 + +loc_4D0C63: ; CODE XREF: CEncoder_CodeOneBlock+364j + cmp [esp+30h+var_1C], 4 + movzx edx, byte ptr [esi+10h] + mov ecx, [edi+10h] + jnb loc_4D0E91 + mov eax, ecx + shr eax, 0Bh + imul eax, [esi+edx*4+283F0h] + add [edi+8], eax + lea edx, [esi+edx*4+283F0h] + adc [edi+0Ch], ebp + sub ecx, eax + mov [edi+10h], ecx + mov eax, [edx] + mov ecx, eax + shr ecx, 5 + sub eax, ecx + mov [edx], eax + mov eax, [edi+10h] + cmp eax, 1000000h + jnb short loc_4D0CB6 + shl eax, 8 + mov ecx, edi + mov [edi+10h], eax + call loc_4CF640 + +loc_4D0CB6: ; CODE XREF: CEncoder_CodeOneBlock+3B7j + mov eax, [esp+30h+var_1C] + cmp eax, ebp + mov ecx, [edi+10h] + jnz short loc_4D0D24 + movzx edx, byte ptr [esi+10h] + lea eax, [esi+edx*4+28420h] + shr ecx, 0Bh + imul ecx, [eax] + mov [edi+10h], ecx + mov ecx, [eax] + mov edx, 800h + sub edx, ecx + shr edx, 5 + add edx, ecx + mov [eax], edx + mov eax, [edi+10h] + cmp eax, 1000000h + jnb short loc_4D0CFC + shl eax, 8 + mov ecx, edi + mov [edi+10h], eax + call loc_4CF640 + +loc_4D0CFC: ; CODE XREF: CEncoder_CodeOneBlock+3FDj + mov ebp, [esp+30h+var_18] + movzx ecx, byte ptr [esi+10h] + xor eax, eax + cmp ebp, 1 + setnz al + shl ecx, 4 + add ecx, ebx + lea ecx, [esi+ecx*4+284B0h] + push eax + push edi + call sub_4CFAC0 + jmp loc_4D0E2E +; --------------------------------------------------------------------------- + +loc_4D0D24: ; CODE XREF: CEncoder_CodeOneBlock+3CFj + mov edx, [esi+eax*4+14h] + movzx eax, byte ptr [esi+10h] + mov [esp+30h+var_8], edx + lea edx, [esi+eax*4+28420h] + mov eax, ecx + shr eax, 0Bh + imul eax, [edx] + add [edi+8], eax + adc [edi+0Ch], ebp + sub ecx, eax + mov [edi+10h], ecx + mov eax, [edx] + mov ecx, eax + shr ecx, 5 + sub eax, ecx + mov [edx], eax + mov eax, [edi+10h] + cmp eax, 1000000h + jnb short loc_4D0D6C + shl eax, 8 + mov ecx, edi + mov [edi+10h], eax + call loc_4CF640 + +loc_4D0D6C: ; CODE XREF: CEncoder_CodeOneBlock+46Dj + cmp [esp+30h+var_1C], 1 + mov ecx, [edi+10h] + jnz short loc_4D0DB3 + movzx edx, byte ptr [esi+10h] + lea eax, [esi+edx*4+28450h] + shr ecx, 0Bh + imul ecx, [eax] + mov [edi+10h], ecx + mov ecx, [eax] + mov edx, 800h + sub edx, ecx + shr edx, 5 + add edx, ecx + mov [eax], edx + mov eax, [edi+10h] + cmp eax, 1000000h + jnb short loc_4D0E1D + shl eax, 8 + mov ecx, edi + mov [edi+10h], eax + call loc_4CF640 + jmp short loc_4D0E1D +; --------------------------------------------------------------------------- + +loc_4D0DB3: ; CODE XREF: CEncoder_CodeOneBlock+484j + movzx eax, byte ptr [esi+10h] + lea edx, [esi+eax*4+28450h] + mov eax, ecx + shr eax, 0Bh + imul eax, [edx] + add [edi+8], eax + adc [edi+0Ch], ebp + sub ecx, eax + mov [edi+10h], ecx + mov eax, [edx] + mov ecx, eax + shr ecx, 5 + sub eax, ecx + mov [edx], eax + mov eax, [edi+10h] + cmp eax, 1000000h + jnb short loc_4D0DF3 + shl eax, 8 + mov ecx, edi + mov [edi+10h], eax + call loc_4CF640 + +loc_4D0DF3: ; CODE XREF: CEncoder_CodeOneBlock+4F4j + mov ebp, [esp+30h+var_1C] + movzx eax, byte ptr [esi+10h] + lea edx, [ebp-2] + push edx + push edi + lea ecx, [esi+eax*4+28480h] + call sub_4CFAC0 + cmp ebp, 3 + jnz short loc_4D0E17 + mov ecx, [esi+1Ch] + mov [esi+20h], ecx + +loc_4D0E17: ; CODE XREF: CEncoder_CodeOneBlock+51Fj + mov edx, [esi+18h] + mov [esi+1Ch], edx + +loc_4D0E1D: ; CODE XREF: CEncoder_CodeOneBlock+4B2j + ; CEncoder_CodeOneBlock+4C1j + mov eax, [esi+14h] + mov ecx, [esp+30h+var_8] + mov ebp, [esp+30h+var_18] + mov [esi+18h], eax + mov [esi+14h], ecx + +loc_4D0E2E: ; CODE XREF: CEncoder_CodeOneBlock+42Fj + cmp ebp, 1 + jnz short loc_4D0E45 + movzx edx, byte ptr [esi+10h] + mov al, ds:kShortRepNextStates[edx] + mov [esi+10h], al + jmp loc_4D0FF5 +; --------------------------------------------------------------------------- + +loc_4D0E45: ; CODE XREF: CEncoder_CodeOneBlock+541j + cmp byte ptr [esi+32EF4h], 0 + push ebx + lea edx, [ebp-2] + push edx + lea ecx, [esi+2DA04h] + push edi + setz [esp+3Ch+var_20] + call sub_4D0020 + cmp [esp+30h+var_20], 0 + jz short loc_4D0E7F + add dword ptr [esi+ebx*4+32610h], 0FFFFFFFFh + lea ecx, [esi+2DA04h] + jnz short loc_4D0E7F + push ebx + call sub_4CF740 + +loc_4D0E7F: ; CODE XREF: CEncoder_CodeOneBlock+577j + ; CEncoder_CodeOneBlock+587j + movzx eax, byte ptr [esi+10h] + mov cl, ds:kRepNextStates[eax] + mov [esi+10h], cl + jmp loc_4D0FF5 +; --------------------------------------------------------------------------- + +loc_4D0E91: ; CODE XREF: CEncoder_CodeOneBlock+37Fj + lea eax, [esi+edx*4+283F0h] + shr ecx, 0Bh + imul ecx, [eax] + mov [edi+10h], ecx + mov ecx, [eax] + mov edx, 800h + sub edx, ecx + shr edx, 5 + add edx, ecx + mov [eax], edx + mov eax, [edi+10h] + cmp eax, 1000000h + jnb short loc_4D0EC8 + shl eax, 8 + mov ecx, edi + mov [edi+10h], eax + call loc_4CF640 + +loc_4D0EC8: ; CODE XREF: CEncoder_CodeOneBlock+5C9j + movzx eax, byte ptr [esi+10h] + mov cl, ds:kMatchNextStates[eax] + mov eax, [esp+30h+var_18] + mov [esi+10h], cl + cmp byte ptr [esi+32EF4h], 0 + push ebx + setz [esp+34h+var_20] + add eax, 0FFFFFFFEh + push eax + lea ebp, [esi+28DB8h] + push edi + mov ecx, ebp + call sub_4D0020 + cmp [esp+30h+var_20], 0 + jz short loc_4D0F11 + add dword ptr [ebp+ebx*4+4C0Ch], 0FFFFFFFFh + jnz short loc_4D0F11 + push ebx + mov ecx, ebp + call sub_4CF740 + +loc_4D0F11: ; CODE XREF: CEncoder_CodeOneBlock+60Dj + ; CEncoder_CodeOneBlock+617j + mov eax, [esp+30h+var_1C] + sub eax, 4 + cmp eax, 2000h + mov [esp+30h+var_1C], eax + jnb short loc_4D0F2C + movzx ebp, byte ptr dword_551198[eax] + jmp short loc_4D0F4F +; --------------------------------------------------------------------------- + +loc_4D0F2C: ; CODE XREF: CEncoder_CodeOneBlock+631j + cmp eax, 2000000h + jnb short loc_4D0F42 + shr eax, 0Ch + movzx ebp, byte ptr dword_551198[eax] + add ebp, 18h + jmp short loc_4D0F4F +; --------------------------------------------------------------------------- + +loc_4D0F42: ; CODE XREF: CEncoder_CodeOneBlock+641j + shr eax, 18h + movzx ebp, byte ptr dword_551198[eax] + add ebp, 30h + +loc_4D0F4F: ; CODE XREF: CEncoder_CodeOneBlock+63Aj + ; CEncoder_CodeOneBlock+650j + mov eax, [esp+30h+var_18] + add eax, 0FFFFFFFEh + cmp eax, 4 + jb short loc_4D0F60 + mov eax, 3 + +loc_4D0F60: ; CODE XREF: CEncoder_CodeOneBlock+669j + push ebp + shl eax, 8 + push edi + lea ecx, [eax+esi+287B0h] + call sub_4CFC60 + cmp ebp, 4 + jb short loc_4D0FD1 + mov ebx, [esp+30h+var_1C] + mov ecx, ebp + mov eax, ebp + and eax, 1 + shr ecx, 1 + sub ecx, 1 + or eax, 2 + shl eax, cl + sub ebx, eax + cmp ebp, 0Eh + jnb short loc_4D0FA9 + push ebx + push ecx + sub eax, ebp + lea edx, [esi+eax*4+28BACh] + push edi + push edx + call sub_4CFD90 + add esp, 10h + jmp short loc_4D0FD1 +; --------------------------------------------------------------------------- + +loc_4D0FA9: ; CODE XREF: CEncoder_CodeOneBlock+6A0j + add ecx, 0FFFFFFFCh + push ecx + mov eax, ebx + shr eax, 4 + push eax + mov ecx, edi + call sub_4CF6E0 + and ebx, 0Fh + push ebx + push edi + lea ecx, [esi+28D78h] + call sub_4CFD00 + add dword ptr [esi+33B54h], 1 + +loc_4D0FD1: ; CODE XREF: CEncoder_CodeOneBlock+684j + ; CEncoder_CodeOneBlock+6B7j + mov ecx, [esi+1Ch] + mov edx, [esi+18h] + mov eax, [esi+14h] + add dword ptr [esi+33B70h], 1 + mov ebp, [esp+30h+var_18] + mov [esi+20h], ecx + mov ecx, [esp+30h+var_1C] + mov [esi+1Ch], edx + mov [esi+18h], eax + mov [esi+14h], ecx + +loc_4D0FF5: ; CODE XREF: CEncoder_CodeOneBlock+550j + ; CEncoder_CodeOneBlock+59Cj + mov eax, [esi+80h] + mov ecx, [esi+6Ch] + mov edx, ebp + sub edx, [esi+32F04h] + sub edx, 1 + push edx + push eax + call ecx + add esp, 8 + mov [esi+11h], al + +loc_4D1013: ; CODE XREF: CEncoder_CodeOneBlock+319j + sub [esi+32F04h], ebp + mov eax, [esi+32F04h] + add [esp+30h+var_14], ebp + test eax, eax + jnz loc_4D0AD0 + cmp [esi+32EF4h], al + jnz short loc_4D1056 + cmp dword ptr [esi+33B70h], 80h + jb short loc_4D1046 + mov ecx, esi + call CEncoder_FillDistancesPrices + +loc_4D1046: ; CODE XREF: CEncoder_CodeOneBlock+74Dj + cmp dword ptr [esi+33B54h], 10h + jb short loc_4D1056 + mov ecx, esi + call CEncoder_FillAlignPrices + +loc_4D1056: ; CODE XREF: CEncoder_CodeOneBlock+741j + ; CEncoder_CodeOneBlock+75Dj + mov edx, [esi+80h] + mov eax, [esi+70h] + push edx + call eax + add esp, 4 + test eax, eax + mov eax, [esp+30h+var_14] + jz short loc_4D10D7 + mov ecx, [esp+30h+var_4] + mov edx, eax + sub edx, ecx + cmp edx, 4000h + jb loc_4D0AD0 + sub eax, ecx + add [esi+33B78h], eax + mov ecx, [esi+33B78h] + mov eax, [esp+30h+arg_0] + adc dword ptr [esi+33B7Ch], 0 + mov [eax], ecx + mov edx, [esi+33B7Ch] + lea ecx, [esi+28h] + mov [eax+4], edx + call sub_4CD8B0 + mov ecx, [esp+30h+arg_4] + mov [ecx], eax + mov eax, [esp+30h+arg_8] + mov [ecx+4], edx + pop ebx + mov byte ptr [esi+33B80h], 0 + pop edi + mov dword ptr [eax], 0 + mov eax, [esi+0ECh] + pop esi + pop ebp + add esp, 20h + retn 0Ch +; --------------------------------------------------------------------------- + +loc_4D10D7: ; CODE XREF: CEncoder_CodeOneBlock+77Bj + push eax + mov ecx, esi + call CEncoder_Flush + pop ebx + pop edi + pop esi + pop ebp + add esp, 20h + retn 0Ch +CEncoder_CodeOneBlock endp + +; --------------------------------------------------------------------------- + align 10h +CEncoder_CodeReal proc near ; CODE XREF: CEncoder_Code+49p + +var_20 = dword ptr -20h +processedOutSize= byte ptr -1Ch +processedInSize = byte ptr -14h +var_C = dword ptr -0Ch +var_4 = dword ptr -4 +inStream = dword ptr 4 +outStream = dword ptr 8 +inSize = dword ptr 0Ch +outSize = dword ptr 10h +progress = dword ptr 14h + + push 0FFFFFFFFh + push offset loc_4DA128 + mov eax, dword ptr fs:[0] + push eax + sub esp, 14h + push ebp + push esi + push edi + mov eax, dword_544960 + xor eax, esp + push eax + lea eax, [esp+30h+var_C] + mov dword ptr fs:[0], eax + mov esi, ecx + mov [esp+30h+var_20], esi + mov eax, [esp+30h+outSize] + mov ecx, [esp+30h+inSize] + mov edx, [esp+30h+outStream] + push eax + mov eax, [esp+34h+inStream] + push ecx + push edx + push eax + mov ecx, esi + mov [esp+40h+var_4], 0 + call CEncoder_SetStreams + mov edi, eax + test edi, edi + jz short loc_4D1190 + cmp dword ptr [esi+80h], 0 + mov [esp+30h+var_4], 0FFFFFFFFh + jz short loc_4D1166 + cmp byte ptr [esi+33B95h], 0 + jz short loc_4D1166 + mov byte ptr [esi+33B95h], 0 + +loc_4D1166: ; CODE XREF: CEncoder_CodeReal+64j + ; CEncoder_CodeReal+6Dj + mov eax, [esi+33B8Ch] + test eax, eax + jz short loc_4D1182 + mov ecx, [eax] + mov edx, [ecx+8] + push eax + call edx + mov dword ptr [esi+33B8Ch], 0 + +loc_4D1182: ; CODE XREF: CEncoder_CodeReal+7Ej + mov ecx, [esi+4] + mov edx, [ecx+10h] + lea eax, [esi+4] + push eax + call edx + jmp short loc_4D1201 +; --------------------------------------------------------------------------- + +loc_4D1190: ; CODE XREF: CEncoder_CodeReal+53j + lea eax, [esp+30h+outSize] + push eax + lea ecx, [esp+34h+processedOutSize] + push ecx + lea edx, [esp+38h+processedInSize] + push edx + mov ecx, esi + call CEncoder_CodeOneBlock + mov edi, eax + test edi, edi + jnz short loc_4D11F0 + mov ebp, [esp+30h+progress] + +loc_4D11B0: ; CODE XREF: CEncoder_CodeReal+FEj + cmp [esp+30h+outSize], 0 + jnz short loc_4D1218 + test ebp, ebp + jz short loc_4D11D4 + mov eax, [ebp+0] + mov eax, [eax+0Ch] + lea ecx, [esp+30h+processedOutSize] + push ecx + lea edx, [esp+34h+processedInSize] + push edx + push ebp + call eax ; SetRatioInfo + mov edi, eax + test edi, edi + jnz short loc_4D11F0 + +loc_4D11D4: ; CODE XREF: CEncoder_CodeReal+C9j + lea ecx, [esp+30h+outSize] + push ecx + lea edx, [esp+34h+processedOutSize] + push edx + lea eax, [esp+38h+processedInSize] + push eax + mov ecx, esi + call CEncoder_CodeOneBlock + mov edi, eax + test edi, edi + jz short loc_4D11B0 + +loc_4D11F0: ; CODE XREF: CEncoder_CodeReal+BAj + ; CEncoder_CodeReal+E2j + lea ecx, [esp+30h+var_20] + mov [esp+30h+var_4], 0FFFFFFFFh + call sub_4CDA70 + +loc_4D1201: ; CODE XREF: CEncoder_CodeReal+9Ej + mov eax, edi + mov ecx, [esp+30h+var_C] + mov dword ptr fs:[0], ecx + pop ecx + pop edi + pop esi + pop ebp + add esp, 20h + retn 14h +; --------------------------------------------------------------------------- + +loc_4D1218: ; CODE XREF: CEncoder_CodeReal+C5j + lea ecx, [esp+30h+var_20] + mov [esp+30h+var_4], 0FFFFFFFFh + call sub_4CDA70 + xor eax, eax + mov ecx, [esp+30h+var_C] + mov dword ptr fs:[0], ecx + pop ecx + pop edi + pop esi + pop ebp + add esp, 20h + retn 14h +CEncoder_CodeReal endp + +; =============== S U B R O U T I N E ======================================= +; Attributes: bp-based frame + +CEncoder_Code proc near ; DATA XREF: .rdata:00517B08o +; sub_4D1240 + +var_10 = dword ptr -10h +var_C = dword ptr -0Ch +var_4 = dword ptr -4 +pThis = dword ptr 8 +pInStream = dword ptr 0Ch +pOutStream = dword ptr 10h +pInSize = dword ptr 14h +pOutSize = dword ptr 18h +progress = dword ptr 1Ch + + push ebp + mov ebp, esp + push 0FFFFFFFFh + push offset loc_4DA150 + mov eax, dword ptr fs:[0] + push eax + sub esp, 8 + push ebx + push esi + push edi + mov eax, dword_544960 + xor eax, ebp + push eax + lea eax, [ebp+var_C] + mov dword ptr fs:[0], eax + mov [ebp+var_10], esp + mov eax, [ebp+progress] + mov ecx, [ebp+pOutSize] + mov edx, [ebp+pInSize] + push eax + mov eax, [ebp+pOutStream] + push ecx + mov ecx, [ebp+pInStream] + push edx + push eax + push ecx + mov ecx, [ebp+pThis] + mov [ebp+var_4], 0 + call CEncoder_CodeReal + mov ecx, [ebp+var_C] + mov dword ptr fs:[0], ecx + pop ecx + pop edi + pop esi + pop ebx + mov esp, ebp + pop ebp + retn 18h +CEncoder_Code endp + +; --------------------------------------------------------------------------- + +loc_4DA0FB: ; DATA XREF: Compress_lzma_internal+2o + mov edx, [esp+8] + lea eax, [edx-5Ch] + mov ecx, [edx-60h] + xor ecx, eax + call sub_4A0686 + mov eax, 0 ; offset dword_526E44 + int 3; +; jmp ___CxxFrameHandler3 + +loc_4DA0C9: ; DATA XREF: sub_4CF810+2o + mov edx, [esp+8] + lea eax, [edx-0Ch] + mov ecx, [edx-10h] + xor ecx, eax + call sub_4A0686 + mov eax, 0 ; offset dword_526E18 + int 3; +; jmp ___CxxFrameHandler3 + +loc_4DA128: ; DATA XREF: CEncoder_CodeReal+2o + mov edx, [esp+8] + lea eax, [edx-20h] + mov ecx, [edx-24h] + xor ecx, eax + call sub_4A0686 + mov eax, 0 ; offset unk_526E70 + int 3; +; jmp ___CxxFrameHandler3 + +loc_4DA150: ; DATA XREF: CEncoder_Code+5o + mov edx, [esp+8] + lea eax, [edx+0Ch] + mov ecx, [edx-18h] + xor ecx, eax + call sub_4A0686 + mov eax, 0 ; offset unk_526ED8 + int 3; +; jmp ___CxxFrameHandler3 + +END diff --git a/dep/libmpq/AUTHORS b/dep/libmpq/AUTHORS deleted file mode 100644 index 3d7da7bec9a..00000000000 --- a/dep/libmpq/AUTHORS +++ /dev/null @@ -1,10 +0,0 @@ -Project Initiator: - - * Maik Broemme - -Developers: - - * Maik Broemme - * Tilman Sauerbeck - * Forrest Voight - * Georg Lukas diff --git a/dep/libmpq/CMakeLists.txt b/dep/libmpq/CMakeLists.txt deleted file mode 100644 index a18d8b15d8b..00000000000 --- a/dep/libmpq/CMakeLists.txt +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (C) 2008-2012 TrinityCore -# -# This file is free software; as a special exception the author gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -file(GLOB sources_mpq libmpq/*.c libmpq/*.h) - -set(mpq_STAT_SRCS - ${sources_mpq} -) - -if( UNIX ) - include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/dep/zlib - ${CMAKE_SOURCE_DIR}/dep/bzip2 - ) -elseif( WIN32 ) - include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/win - ${CMAKE_SOURCE_DIR}/dep/zlib - ${CMAKE_SOURCE_DIR}/dep/bzip2 - ) -endif() - -add_library(mpq STATIC ${mpq_STAT_SRCS}) - -set_target_properties(mpq PROPERTIES LINKER_LANGUAGE CXX) diff --git a/dep/libmpq/COPYING b/dep/libmpq/COPYING deleted file mode 100644 index 4189933be9f..00000000000 --- a/dep/libmpq/COPYING +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - Appendix: How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) 19yy - - 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; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; 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 USA - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/dep/libmpq/FAQ b/dep/libmpq/FAQ deleted file mode 100644 index 52ca9f3c705..00000000000 --- a/dep/libmpq/FAQ +++ /dev/null @@ -1,68 +0,0 @@ -FAQ - Frequently Asked Questions -================================ - -Q: What is libmpq? -A: libmpq is a library for manipulating MoPaQ mpq archives mostly used - used by Blizzard in their games. - -Q: What can i do with libmpq? -A: With libmpq you can write applications which can extract, create - and manipulate mpq archives. - -Q: Is it legal? -A: Yes, i think so. I have no idea why it should not, all informations - about the fileformat are available. - -Q: Is there a description of the functions? -A: Since version 0.4.0 libmpq comes with a API documentation for - developers. The documentation is written as manual pages. - -Q: Can i help? -A: Yes, help is needed, not only with developing, also with testing. - A good point to start is using a recent SVN version of libmpq and - trying to use it with every mpq archive you could get :) - -Q: Can you give a small example to demonstrate the usage? -A: Of course :) The example below takes first parameter as mpq archive - and extracts the first file to a buffer. - - /* - * Compile with: - * - * x86_32: - * - * gcc \ - * -D_FILE_OFFSET_BITS=64 \ - * -D_LARGE_FILES=1 \ - * -D_LARGEFILE_SOURCE=1 \ - * mpq-example.c -o mpq-example -lmpq -lz -lbz2 -I/usr/local/include/libmpq - * - * x86_64: - * - * gcc \ - * -D_LARGE_FILES=1 \ - * mpq-example.c -o mpq-example -lmpq -lz -lbz2 -I/usr/local/include/libmpq - */ - - #include - #include - #include - - int main(int argc, char **argv) { - mpq_archive_s *mpq_archive; - off_t out_size; - char *out_buf; - - /* open the mpq archive given as first parameter. */ - libmpq__archive_open(&mpq_archive, argv[1], -1); - - /* get size of first file (0) and malloc output buffer. */ - libmpq__file_unpacked_size(mpq_archive, 0, &out_size); - out_buf = malloc(out_size); - - /* read, decrypt and unpack file to output buffer. */ - libmpq__file_read(mpq_archive, 0, out_buf, out_size, NULL); - - /* close the mpq archive. */ - libmpq__archive_close(mpq_archive); - } diff --git a/dep/libmpq/INSTALL b/dep/libmpq/INSTALL deleted file mode 100644 index b42a17ac464..00000000000 --- a/dep/libmpq/INSTALL +++ /dev/null @@ -1,182 +0,0 @@ -Basic Installation -================== - - These are generic installation instructions. - - The `configure' shell script attempts to guess correct values for -various system-dependent variables used during compilation. It uses -those values to create a `Makefile' in each directory of the package. -It may also create one or more `.h' files containing system-dependent -definitions. Finally, it creates a shell script `config.status' that -you can run in the future to recreate the current configuration, a file -`config.cache' that saves the results of its tests to speed up -reconfiguring, and a file `config.log' containing compiler output -(useful mainly for debugging `configure'). - - If you need to do unusual things to compile the package, please try -to figure out how `configure' could check whether to do them, and mail -diffs or instructions to the address given in the `README' so they can -be considered for the next release. If at some point `config.cache' -contains results you don't want to keep, you may remove or edit it. - - The file `configure.in' is used to create `configure' by a program -called `autoconf'. You only need `configure.in' if you want to change -it or regenerate `configure' using a newer version of `autoconf'. - -The simplest way to compile this package is: - - 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. If you're - using `csh' on an old version of System V, you might need to type - `sh ./configure' instead to prevent `csh' from trying to execute - `configure' itself. - - Running `configure' takes awhile. While running, it prints some - messages telling which features it is checking for. - - 2. Type `make' to compile the package. - - 3. Optionally, type `make check' to run any self-tests that come with - the package. - - 4. Type `make install' to install the programs and any data files and - documentation. - - 5. You can remove the program binaries and object files from the - source code directory by typing `make clean'. To also remove the - files that `configure' created (so you can compile the package for - a different kind of computer), type `make distclean'. There is - also a `make maintainer-clean' target, but that is intended mainly - for the package's developers. If you use it, you may have to get - all sorts of other programs in order to regenerate files that came - with the distribution. - -Compilers and Options -===================== - - Some systems require unusual options for compilation or linking that -the `configure' script does not know about. You can give `configure' -initial values for variables by setting them in the environment. Using -a Bourne-compatible shell, you can do that on the command line like -this: - CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure - -Or on systems that have the `env' program, you can do it like this: - env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure - -Compiling For Multiple Architectures -==================================== - - You can compile the package for more than one kind of computer at the -same time, by placing the object files for each architecture in their -own directory. To do this, you must use a version of `make' that -supports the `VPATH' variable, such as GNU `make'. `cd' to the -directory where you want the object files and executables to go and run -the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. - - If you have to use a `make' that does not supports the `VPATH' -variable, you have to compile the package for one architecture at a time -in the source code directory. After you have installed the package for -one architecture, use `make distclean' before reconfiguring for another -architecture. - -Installation Names -================== - - By default, `make install' will install the package's files in -`/usr/local/bin', `/usr/local/man', etc. You can specify an -installation prefix other than `/usr/local' by giving `configure' the -option `--prefix=PATH'. - - You can specify separate installation prefixes for -architecture-specific files and architecture-independent files. If you -give `configure' the option `--exec-prefix=PATH', the package will use -PATH as the prefix for installing programs and libraries. -Documentation and other data files will still use the regular prefix. - - In addition, if you use an unusual directory layout you can give -options like `--bindir=PATH' to specify different values for particular -kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. - - If the package supports it, you can cause programs to be installed -with an extra prefix or suffix on their names by giving `configure' the -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. - -Optional Features -================= - - Some packages pay attention to `--enable-FEATURE' options to -`configure', where FEATURE indicates an optional part of the package. -They may also pay attention to `--with-PACKAGE' options, where PACKAGE -is something like `gnu-as' or `x' (for the X Window System). The -`README' should mention any `--enable-' and `--with-' options that the -package recognizes. - - For packages that use the X Window System, `configure' can usually -find the X include and library files automatically, but if it doesn't, -you can use the `configure' options `--x-includes=DIR' and -`--x-libraries=DIR' to specify their locations. - -Specifying the System Type -========================== - - There may be some features `configure' can not figure out -automatically, but needs to determine by the type of host the package -will run on. Usually `configure' can figure that out, but if it prints -a message saying it can not guess the host type, give it the -`--host=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name with three fields: - CPU-COMPANY-SYSTEM - -See the file `config.sub' for the possible values of each field. If -`config.sub' isn't included in this package, then this package doesn't -need to know the host type. - - If you are building compiler tools for cross-compiling, you can also -use the `--target=TYPE' option to select the type of system they will -produce code for and the `--build=TYPE' option to select the type of -system on which you are compiling the package. - -Sharing Defaults -================ - - If you want to set default values for `configure' scripts to share, -you can create a site shell script called `config.site' that gives -default values for variables like `CC', `cache_file', and `prefix'. -`configure' looks for `PREFIX/share/config.site' if it exists, then -`PREFIX/etc/config.site' if it exists. Or, you can set the -`CONFIG_SITE' environment variable to the location of the site script. -A warning: not all `configure' scripts look for a site script. - -Operation Controls -================== - - `configure' recognizes the following options to control how it -operates. - -`--cache-file=FILE' - Use and save the results of the tests in FILE instead of - `./config.cache'. Set FILE to `/dev/null' to disable caching, for - debugging `configure'. - -`--help' - Print a summary of the options to `configure', and exit. - -`--quiet' -`--silent' -`-q' - Do not print messages saying which checks are being made. To - suppress all normal output, redirect it to `/dev/null' (any error - messages will still be shown). - -`--srcdir=DIR' - Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. - -`--version' - Print the version of Autoconf used to generate the `configure' - script, and exit. - -`configure' also accepts some other, not widely useful, options. diff --git a/dep/libmpq/Makefile.am b/dep/libmpq/Makefile.am deleted file mode 100644 index 0a9b54c2526..00000000000 --- a/dep/libmpq/Makefile.am +++ /dev/null @@ -1,26 +0,0 @@ -# minimum required automake 1.6 -AUTOMAKE_OPTIONS = 1.6 - -# any directories which should be built and installed. -SUBDIRS = libmpq bindings doc - -# the directories which are part of the distribution. -DIST_SUBDIRS = $(SUBDIRS) - -# libmpq runtime configuration script. -bin_SCRIPTS = libmpq-config - -# pkg-config installation directory. -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = libmpq.pc - -# extra stuff. -EXTRA_DIST = \ - AUTHORS \ - COPYING \ - FAQ \ - INSTALL \ - NEWS \ - README \ - THANKS \ - TODO diff --git a/dep/libmpq/NEWS b/dep/libmpq/NEWS deleted file mode 100644 index 74850a8a5bb..00000000000 --- a/dep/libmpq/NEWS +++ /dev/null @@ -1,76 +0,0 @@ -Changes version 0.4.2 (2008-05-16) -================================== - - * added full extraction support for protected maps used in - warcraft 3. - - * added full extraction support for all blizzard titles until - world of warcraft - the burning crusade. - - * added support for archives version 2 with extended header and - extended block table. - - * added support for the bzip2 compression algorithm. - - * added support for archives and files inside archive > 2gb. - - * added generic read functions, which will do decryption, - decompression or exploding. - - * the info functions are no longer exported by the library and - were replaced by separate api functions. - - * the file number and block number are count from 0 instead - of 1. - - * added python bindings. - - * linking against libmpq requires from now on the usual largefile - macros -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES=1 -D_LARGEFILE_SOURCE=1 - -Changes version 0.4.1 (2008-04-02) -================================== - - * memory, speed and stability improvements. - - * split sourcecode into library and utility package. - -Changes version 0.4.0 (2008-03-31) -================================== - - * added robust error handling to make the library and extracting - utility more stable. - - * added c++ bindings to public include and moved internal defines - and functions to private include. - - * added support for 64-bit architectures and removed any stupid - pointer to int arithmetics. - - * added much better member names to the structures to make - developers able to understand the code on reading. - - * added full api documentation using manual pages. - - * added full extraction support for all blizzard titles until - warcraft 3 - the frozen throne. - - * added support for single sector and stored files (neither - compressed nor imploded). - - * added support for files which have compressed size greater than - uncompressed size. - - * removed the external listfile database support from 0.3.0 it - was a weird implementation. - -Changes version 0.3.0 (2004-02-12) -================================== - - * added listfile database support from external files. - -Initial version 0.2.1 (2004-01-17) -================================== - - * first version which was able to extract some of the older mopaq - archives. diff --git a/dep/libmpq/README b/dep/libmpq/README deleted file mode 100644 index 3f1bd3a1e9f..00000000000 --- a/dep/libmpq/README +++ /dev/null @@ -1,34 +0,0 @@ -Introduction -============ - -'libmpq' is a library which can be easily used in own applications -to extract, create or manipulate MoPaQ mpq archives. - -MPQ, or MoPaQ, is a proprietary archive format created by -Mike O'Brien, the man hailed as Blizzard's multiplayer engine -genius, back in 1996 as a general purpose archive for use with -Diablo, and named narcissistically for its creator -"Mike O'brien PaCK". The copyrights to it, however, are held by -Havas Interactive, Blizzard's parent company. The archive format -is used by many Blizzard titles like Diablo, Diablo 2, Starcraft, -Warcraft 2: BNE, a newer version in Warcraft 3 and World of -Warcraft (WoW). - -Manual -====== - -Since version 0.4.0 the 'libmpq' package comes with a manpage for -every library function. If you use 'libmpq' first time it is a good -idea to read the `FAQ' file. - -Reporting Bugs -============== - -Bug reports for 'libmpq' can be send to me directly. - - * Maik Broemme - -Enjoy! - -Maik Broemme -http://www.babelize.org/ diff --git a/dep/libmpq/THANKS b/dep/libmpq/THANKS deleted file mode 100644 index 42da1235476..00000000000 --- a/dep/libmpq/THANKS +++ /dev/null @@ -1,21 +0,0 @@ -'libmpq' was originaly created by Maik Broemme -and i want to thank some people which helped by supplying knowledge, code or -something else. - - * Romy Trompke - - my lovely girlfriend for her patience - - * Ladislav Zezula - - stormlib creator - - * Marko Friedemann - - initial port of stormlib to linux - - * Tom Amigo - - first people who decrypts the MoPaQ archive format - - * ShadowFlare - - creator of the ShadowFlare MPQ API - - * Justin Olbrantz (Quantam) - - creator of the client using ShadowFlare MPQ API diff --git a/dep/libmpq/TODO b/dep/libmpq/TODO deleted file mode 100644 index 0c1951f0b46..00000000000 --- a/dep/libmpq/TODO +++ /dev/null @@ -1,10 +0,0 @@ -Features and functionality which should be added in the future. - - * Porting for big endian systems. - * Porting for Windows? :) - * Creating mpq archives. - * Brute all unknown filenames, Blizzard uses in their - archives. - -Look at the AUTHORS file if you want help me with 'libmpq', or -if you have other interesting features which should be added. diff --git a/dep/libmpq/autogen.sh b/dep/libmpq/autogen.sh deleted file mode 100644 index 16871edd70d..00000000000 --- a/dep/libmpq/autogen.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -# -echo "Generating build information using aclocal, autoheader, automake and autoconf" -echo "This may take a while ..." - -# Touch the timestamps on all the files since CVS messes them up -directory=`dirname $0` -touch $directory/configure.ac - -# Regenerate configuration files -libtoolize --copy -aclocal -autoheader -automake --foreign --add-missing --copy -autoconf - -# Run configure for this platform -#./configure $* -echo "Now you are ready to run ./configure" diff --git a/dep/libmpq/bindings/Makefile.am b/dep/libmpq/bindings/Makefile.am deleted file mode 100644 index b9fefe306ef..00000000000 --- a/dep/libmpq/bindings/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -# any directories which should be built and installed. -SUBDIRS = d - -if HAVE_PYTHON -SUBDIRS += python -endif diff --git a/dep/libmpq/bindings/d/Makefile.am b/dep/libmpq/bindings/d/Makefile.am deleted file mode 100644 index 4de7285ae51..00000000000 --- a/dep/libmpq/bindings/d/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -# minimum required automake 1.6 -AUTOMAKE_OPTIONS = 1.6 - -# install D binding to /usr/include/d by default -libmpq_includedir = $(includedir)/d -libmpq_include_HEADERS = mpq.d diff --git a/dep/libmpq/bindings/d/dsss.conf b/dep/libmpq/bindings/d/dsss.conf deleted file mode 100644 index 252482c4933..00000000000 --- a/dep/libmpq/bindings/d/dsss.conf +++ /dev/null @@ -1,2 +0,0 @@ -[mpq.d] -type=sourcelibrary diff --git a/dep/libmpq/bindings/d/mpq.d b/dep/libmpq/bindings/d/mpq.d deleted file mode 100644 index d72c2d2a986..00000000000 --- a/dep/libmpq/bindings/d/mpq.d +++ /dev/null @@ -1,318 +0,0 @@ -/* - * mpq.d -- D programming language module for libmpq - * - * Copyright (c) 2008 Georg Lukas - * - * 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; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; 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. - * - * This module is written to support Phobos. Patches to allow binding to - * Tango are welcome. - */ - -module mpq; - -/* the following pragma does not work on DMD/Linux, generates a warning on - * GDC/Linux and has not been tested on Windows. Commented out for now. */ -// pragma(lib, "libmpq"); - -import std.string; // for format() and toStringz() -import std.traits; // for ParameterTypeTuple!() - -/* XXX: this assumes that libmpq is compiled with Large File Support on */ -alias long off_t; - -/* libmpq error return values */ -const LIBMPQ_ERROR_OPEN = -1; /* open error on file. */ -const LIBMPQ_ERROR_CLOSE = -2; /* close error on file. */ -const LIBMPQ_ERROR_SEEK = -3; /* lseek error on file. */ -const LIBMPQ_ERROR_READ = -4; /* read error on file. */ -const LIBMPQ_ERROR_WRITE = -5; /* write error on file. */ -const LIBMPQ_ERROR_MALLOC = -6; /* memory allocation error. */ -const LIBMPQ_ERROR_FORMAT = -7; /* format errror. */ -const LIBMPQ_ERROR_NOT_INITIALIZED = -8; /* init() wasn't called. */ -const LIBMPQ_ERROR_SIZE = -9; /* buffer size is to small. */ -const LIBMPQ_ERROR_EXIST = -10; /* file or block does not exist in archive. */ -const LIBMPQ_ERROR_DECRYPT = -11; /* we don't know the decryption seed. */ -const LIBMPQ_ERROR_UNPACK = -12; /* error on unpacking file. */ - -/** libmpq internal meta-data for an archive */ -extern struct mpq_archive_s; - -extern(C) { - -/* libmpq__generic information about library. */ -char *libmpq__version(); - -/* libmpq__generic mpq archive information. */ -int libmpq__archive_open(mpq_archive_s **mpq_archive, char *mpq_filename, off_t archive_offset); -int libmpq__archive_close(mpq_archive_s *mpq_archive); -int libmpq__archive_packed_size(mpq_archive_s *mpq_archive, off_t *packed_size); -int libmpq__archive_unpacked_size(mpq_archive_s *mpq_archive, off_t *unpacked_size); -int libmpq__archive_offset(mpq_archive_s *mpq_archive, off_t *offset); -int libmpq__archive_version(mpq_archive_s *mpq_archive, uint *version_); -int libmpq__archive_files(mpq_archive_s *mpq_archive, uint *files); - -/* libmpq__generic file processing functions. */ -int libmpq__file_packed_size(mpq_archive_s *mpq_archive, uint file_number, off_t *packed_size); -int libmpq__file_unpacked_size(mpq_archive_s *mpq_archive, uint file_number, off_t *unpacked_size); -int libmpq__file_offset(mpq_archive_s *mpq_archive, uint file_number, off_t *offset); -int libmpq__file_blocks(mpq_archive_s *mpq_archive, uint file_number, uint *blocks); -int libmpq__file_encrypted(mpq_archive_s *mpq_archive, uint file_number, uint *encrypted); -int libmpq__file_compressed(mpq_archive_s *mpq_archive, uint file_number, uint *compressed); -int libmpq__file_imploded(mpq_archive_s *mpq_archive, uint file_number, uint *imploded); -int libmpq__file_number(mpq_archive_s *mpq_archive, char *filename, uint *number); -int libmpq__file_read(mpq_archive_s *mpq_archive, uint file_number, ubyte *out_buf, off_t out_size, off_t *transferred); - -/* libmpq__generic block processing functions. */ -int libmpq__block_open_offset(mpq_archive_s *mpq_archive, uint file_number); -int libmpq__block_close_offset(mpq_archive_s *mpq_archive, uint file_number); -int libmpq__block_unpacked_size(mpq_archive_s *mpq_archive, uint file_number, uint block_number, off_t *unpacked_size); -int libmpq__block_read(mpq_archive_s *mpq_archive, uint file_number, uint block_number, ubyte *out_buf, off_t out_size, off_t *transferred); - -} - - -/** exception class for failed libmpq calls */ -class MPQException : Exception { - const string[] Errors = [ - "unknown error", - "open error on file", - "close error on file", - "lseek error on file", - "read error on file", - "write error on file", - "memory allocation error", - "format errror", - "init() wasn't called", - "buffer size is to small", - "file or block does not exist in archive", - "we don't know the decryption seed", - "error on unpacking file"]; - - public int errno; - this(char[] fnname = "unknown_function", int errno = 0) { - - this.errno = errno; - if (-errno >= Errors.length) - errno = 0; - super(std.string.format("Error in %s(): %s (%d)", - fnname, Errors[-errno], errno)); - } -} - - -/** template to wrap function calls and throw exceptions in case of error - * - * thanks for the idea to while(nan) blog, - * http://while-nan.blogspot.com/2007/06/wrapping-functions-for-fun-and-profit.html - * - * use: MPQ_CHECKERR(libmpq__archive_open)(&m, "foo.mpq", -1); - * returns the retval of archive_open on success; - * throws an MPQException on failure. - * - * @param Fn libmpq__function reference - * @param args libmpq__function parameters - * @return return value of libmpq__function on success - * @throw MPQException on error - */ -int MPQ_CHECKERR(alias Fn)(ParameterTypeTuple!(Fn) args) -{ - int result = Fn(args); - if (result < 0) { - /* XXX: relying on non-specified stringof() behaviour */ - throw new MPQException((&Fn).stringof[2..$], result); - } - return result; -} - - -/** mixin alias to wrap library functions into MPQ_CHECKERR. - * - * alias mpq.func_name(...) to MPQ_CHECKERR(libmpq__func_name)(...) - * @param func_name name of the function to be wrapped - */ -template MPQ_FUNC(char[] func_name) { - const char[] MPQ_FUNC = "alias MPQ_CHECKERR!(libmpq__" ~ func_name ~ ") " ~ func_name ~ ";"; -} - -alias libmpq__version libversion; /* must be direct alias because it returns char*, not error int */ -mixin(MPQ_FUNC!("archive_open")); -mixin(MPQ_FUNC!("archive_close")); -mixin(MPQ_FUNC!("archive_packed_size")); -mixin(MPQ_FUNC!("archive_unpacked_size")); -mixin(MPQ_FUNC!("archive_offset")); -mixin(MPQ_FUNC!("archive_version")); -mixin(MPQ_FUNC!("archive_files")); -mixin(MPQ_FUNC!("file_packed_size")); -mixin(MPQ_FUNC!("file_unpacked_size")); -mixin(MPQ_FUNC!("file_offset")); -mixin(MPQ_FUNC!("file_blocks")); -mixin(MPQ_FUNC!("file_encrypted")); -mixin(MPQ_FUNC!("file_compressed")); -mixin(MPQ_FUNC!("file_imploded")); -mixin(MPQ_FUNC!("file_number")); -mixin(MPQ_FUNC!("file_read")); -mixin(MPQ_FUNC!("block_open_offset")); -mixin(MPQ_FUNC!("block_close_offset")); -mixin(MPQ_FUNC!("block_unpacked_size")); -mixin(MPQ_FUNC!("block_read")); - -/** getter function named name for returning archive_* single values: - * - * Archive.() { return libmpq__archive_() } - * - * @param type return type for the original function reference - * @param name name of the original function - * @param name2 name for the prototype (defaults to name, used for "version") - * @return getter function mixin - */ -template MPQ_A_GET(char[] type, char[] name, char[] name2 = name) { - const char[] MPQ_A_GET = type ~ " " ~ name2 ~ "() { " ~ - type ~ " ret; " ~ - "archive_" ~ name ~ "(m, &ret); return ret;" ~ - "}"; -} - -/** wrapper class for an MPQ Archive - * - * syntax: auto a = new mpq.Archive("somefile.mpq"); - */ -class Archive { - mpq_archive_s *m; - File listfile; - char[][] listfiledata; - - this(char[] archivename, off_t offset = -1) { - archive_open(&m, toStringz(archivename), offset); - } - - mixin(MPQ_A_GET!("off_t", "packed_size")); - mixin(MPQ_A_GET!("off_t", "unpacked_size")); - mixin(MPQ_A_GET!("off_t", "offset")); - mixin(MPQ_A_GET!("uint", "version", "version_")); - mixin(MPQ_A_GET!("uint", "files")); - - ~this() { - archive_close(m); - } - - mpq_archive_s* archive() { - return m; - } - - File opIndex(char[] fname) { - return new File(this, fname); - } - File opIndex(int fno) { - return new File(this, fno); - } - - char[][] filelist() { - try { - if (!listfile) { - listfile = this["(listfile)"]; - listfiledata = (cast(char[])listfile.read()).splitlines(); - } - return listfiledata; - } catch (MPQException e) { - return []; - } - } - - /+uint filenumber(char[] filename) { - try { - if (!listfile) { - listfile = this["(listfile)"]; - listfiledata = (cast(char[])listfile.read()).splitlines(); - } - return listfiledata; - } catch (MPQException e) { - return []; - } - }+/ - -} - - -/** getter function named name for returning file_* single values: - * - * File.() { return libmpq__file_() } - * - * @param type return type for the original function reference - * @param name name of the original function - * @param name2 name for the prototype (defaults to name, used for "version") - * @return getter function mixin - */ -template MPQ_F_GET(char[] type, char[] name, char[] name2 = name) { - const char[] MPQ_F_GET = type ~ " " ~ name2 ~ "() { " ~ - type ~ " ret; " ~ - "file_" ~ name ~ "(am, fileno, &ret); " ~ - "return ret;" ~ - "}"; -} - -/** wrapper class for a single file in an MPQ Archive - * - * syntax: - * auto a = new mpq.Archive("somefile.mpq"); - * auto f = a["(listfile)"]; - * auto f2 = a[0]; - * auto f3 = new File(a, "(listfile)"); - */ -class File { - Archive a; - mpq_archive_s* am; - char[] filename; - uint fileno; - - this(Archive a, int fileno) { - this.a = a; - this.am = a.archive(); - if (fileno >= a.files) { - throw new MPQException(format("File(%d)", fileno), - LIBMPQ_ERROR_EXIST); - } - this.filename = format("file%04d.xxx", fileno); - this.fileno = fileno; - } - - this(Archive a, char[] filename) { - this.a = a; - this.am = a.archive(); - this.filename = filename; - /* this line will throw an exception when the file is not there */ - mpq.file_number(am, toStringz(filename), &this.fileno); - } - - mixin(MPQ_F_GET!("off_t", "packed_size")); - mixin(MPQ_F_GET!("off_t", "unpacked_size")); - mixin(MPQ_F_GET!("off_t", "offset")); - mixin(MPQ_F_GET!("uint", "blocks")); - mixin(MPQ_F_GET!("uint", "encrypted")); - mixin(MPQ_F_GET!("uint", "compressed")); - mixin(MPQ_F_GET!("uint", "imploded")); - - uint no() { return fileno; } - char[] name() { return filename; } - - ubyte[] read() { - ubyte[] content; - content.length = this.unpacked_size(); - off_t trans; - mpq.file_read(am, fileno, content.ptr, content.length, &trans); - content.length = trans; - return content; - } -} diff --git a/dep/libmpq/bindings/python/Makefile.am b/dep/libmpq/bindings/python/Makefile.am deleted file mode 100644 index 6971a9b2f6d..00000000000 --- a/dep/libmpq/bindings/python/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -# minimum required automake 1.6 -AUTOMAKE_OPTIONS = 1.6 - -# library information and headers which should not be installed. -python_PYTHON = mpq.py diff --git a/dep/libmpq/bindings/python/mpq-info b/dep/libmpq/bindings/python/mpq-info deleted file mode 100644 index 2c67aa1d0cc..00000000000 --- a/dep/libmpq/bindings/python/mpq-info +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env python - -from __future__ import division - -import sys - -import mpq - -archive = mpq.Archive(sys.argv[1]) - -print "Name: %s" % sys.argv[1] -print "Version: %s" % archive.filename -print "Offset: %s" % archive.offset -print "Packed size: %s" % archive.packed_size -print "Unpacked size: %s" % archive.unpacked_size -print "Compression ratio: %s" % (archive.packed_size/archive.unpacked_size) diff --git a/dep/libmpq/bindings/python/mpq.py b/dep/libmpq/bindings/python/mpq.py deleted file mode 100644 index cf6ecaae800..00000000000 --- a/dep/libmpq/bindings/python/mpq.py +++ /dev/null @@ -1,322 +0,0 @@ -"""wrapper for libmpq""" - -# 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; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; 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. - -import ctypes -import ctypes.util -import os - -libmpq = ctypes.CDLL(ctypes.util.find_library("mpq")) - -class Error(Exception): - pass - -errors = { - -1: (IOError, "open"), - -2: (IOError, "close"), - -3: (IOError, "seek"), - -4: (IOError, "read"), - -5: (IOError, "write"), - -6: (MemoryError,), - -7: (Error, "file is not an mpq or is corrupted"), - -8: (AssertionError, "not initialized"), - -9: (AssertionError, "buffer size too small"), - -10: (IndexError, "file not in archive"), - -11: (AssertionError, "decrypt"), - -12: (AssertionError, "unpack"), -} - -def check_error(result, func, arguments, errors=errors): - try: - error = errors[result] - except KeyError: - return result - else: - raise error[0](*error[1:]) - -libmpq.libmpq__version.restype = ctypes.c_char_p - -libmpq.libmpq__archive_open.errcheck = check_error -libmpq.libmpq__archive_close.errcheck = check_error -libmpq.libmpq__archive_packed_size.errcheck = check_error -libmpq.libmpq__archive_unpacked_size.errcheck = check_error -libmpq.libmpq__archive_offset.errcheck = check_error -libmpq.libmpq__archive_version.errcheck = check_error -libmpq.libmpq__archive_files.errcheck = check_error - -libmpq.libmpq__file_packed_size.errcheck = check_error -libmpq.libmpq__file_unpacked_size.errcheck = check_error -libmpq.libmpq__file_offset.errcheck = check_error -libmpq.libmpq__file_blocks.errcheck = check_error -libmpq.libmpq__file_encrypted.errcheck = check_error -libmpq.libmpq__file_compressed.errcheck = check_error -libmpq.libmpq__file_imploded.errcheck = check_error -libmpq.libmpq__file_number.errcheck = check_error -libmpq.libmpq__file_read.errcheck = check_error - -libmpq.libmpq__block_open_offset.errcheck = check_error -libmpq.libmpq__block_close_offset.errcheck = check_error -libmpq.libmpq__block_unpacked_size.errcheck = check_error -libmpq.libmpq__block_read.errcheck = check_error - -__version__ = libmpq.libmpq__version() - - -class Reader(object): - def __init__(self, file, libmpq=libmpq): - self._file = file - self._pos = 0 - self._buf = [] - self._cur_block = 0 - libmpq.libmpq__block_open_offset(self._file._archive._mpq, - self._file.number) - - def __iter__(self): - return self - - def __repr__(self): - return "iter(%r)" % self._file - - def seek(self, offset, whence=os.SEEK_SET, os=os): - if whence == os.SEEK_SET: - pass - elif whence == os.SEEK_CUR: - offset += self._pos - elif whence == os.SEEK_END: - offset += self._file.unpacked_size - else: - raise ValueError, "invalid whence" - - if offset >= self._pos: - self.read(offset - self._pos) - else: - self._pos = 0 - self._buf = [] - self._cur_block = 0 - self.read(offset) - - def tell(self): - return self._pos - - def _read_block(self, ctypes=ctypes, libmpq=libmpq): - block_size = ctypes.c_uint64() - libmpq.libmpq__block_unpacked_size(self._file._archive._mpq, - self._file.number, self._cur_block, ctypes.byref(block_size)) - block_data = ctypes.create_string_buffer(block_size.value) - libmpq.libmpq__block_read(self._file._archive._mpq, - self._file.number, self._cur_block, - block_data, ctypes.c_uint64(len(block_data)), None) - self._buf.append(block_data.raw) - self._cur_block += 1 - - def read(self, size=-1): - while size < 0 or sum(map(len, self._buf)) < size: - if self._cur_block == self._file.blocks: - break - self._read_block() - buf = "".join(self._buf) - if size < 0: - ret = buf - self._buf = [] - else: - ret = buf[:size] - self._buf = [buf[size:]] - self._pos += len(ret) - return ret - - def readline(self, os=os): - line = [] - while True: - char = self.read(1) - if char == "": - break - if char not in '\r\n' and line and line[-1] in '\r\n': - self.seek(-1, os.SEEK_CUR) - break - line.append(char) - return ''.join(line) - - def next(self): - line = self.readline() - if not line: - raise StopIteration - return line - - def readlines(self, sizehint=-1): - res = [] - while sizehint < 0 or sum(map(len, res)) < sizehint: - line = self.readline() - if not line: - break - res.append(line) - return res - - xreadlines = __iter__ - - def __del__(self, libmpq=libmpq): - libmpq.libmpq__block_close_offset(self._file._archive._mpq, - self._file.number) - - -class File(object): - def __init__(self, archive, number, ctypes=ctypes, libmpq=libmpq): - self._archive = archive - self.number = number - - for name, atype in [ - ("packed_size", ctypes.c_uint64), - ("unpacked_size", ctypes.c_uint64), - ("offset", ctypes.c_uint64), - ("blocks", ctypes.c_uint32), - ("encrypted", ctypes.c_uint32), - ("compressed", ctypes.c_uint32), - ("imploded", ctypes.c_uint32), - ]: - data = atype() - func = getattr(libmpq, "libmpq__file_"+name) - func(self._archive._mpq, self.number, ctypes.byref(data)) - setattr(self, name, data.value) - - def __str__(self, ctypes=ctypes, libmpq=libmpq): - data = ctypes.create_string_buffer(self.unpacked_size) - libmpq.libmpq__file_read(self._archive._mpq, self.number, - data, ctypes.c_uint64(len(data)), None) - return data.raw - - def __repr__(self): - return "%r[%i]" % (self._archive, self.number) - - def __iter__(self, Reader=Reader): - return Reader(self) - - -class Archive(object): - def __init__(self, source, ctypes=ctypes, File=File, libmpq=libmpq): - self._source = source - if isinstance(source, File): - assert not source.encrypted - assert not source.compressed - assert not source.imploded - self.filename = source._archive.filename - offset = source._archive.offset + source.offset - else: - self.filename = source - offset = -1 - - self._mpq = ctypes.c_void_p() - libmpq.libmpq__archive_open(ctypes.byref(self._mpq), self.filename, - ctypes.c_uint64(offset)) - self._opened = True - - for field_name, field_type in [ - ("packed_size", ctypes.c_uint64), - ("unpacked_size", ctypes.c_uint64), - ("offset", ctypes.c_uint64), - ("version", ctypes.c_uint32), - ("files", ctypes.c_uint32), - ]: - func = getattr(libmpq, "libmpq__archive_" + field_name) - data = field_type() - func(self._mpq, ctypes.byref(data)) - setattr(self, field_name, data.value) - - def __del__(self, libmpq=libmpq): - if getattr(self, "_opened", False): - libmpq.libmpq__archive_close(self._mpq) - - def __len__(self): - return self.files - - def __contains__(self, item, ctypes=ctypes, libmpq=libmpq): - if isinstance(item, str): - data = ctypes.c_uint32() - try: - libmpq.libmpq__file_number(self._mpq, ctypes.c_char_p(item), - ctypes.byref(data)) - except IndexError: - return False - return True - return 0 <= item < self.files - - def __getitem__(self, item, ctypes=ctypes, File=File, libmpq=libmpq): - if isinstance(item, str): - data = ctypes.c_int() - libmpq.libmpq__file_number(self._mpq, ctypes.c_char_p(item), - ctypes.byref(data)) - item = data.value - else: - if not 0 <= item < self.files: - raise IndexError, "file not in archive" - return File(self, item) - - def __repr__(self): - return "mpq.Archive(%r)" % self._source - -# Remove clutter - everything except Error and Archive. -del os, check_error, ctypes, errors, File, libmpq, Reader - -if __name__ == "__main__": - import sys, random - archive = Archive(sys.argv[1]) - print repr(archive) - for k, v in archive.__dict__.iteritems(): - #if k[0] == '_': continue - print " " * (4 - 1), k, v - assert '(listfile)' in archive - assert 0 in archive - assert len(archive) == archive.files - files = [x.strip() for x in archive['(listfile)']] - files.extend(xrange(archive.files)) - for key in files: #sys.argv[2:] if sys.argv[2:] else xrange(archive.files): - file = archive[key] - print - print " " * (4 - 1), repr(file) - for k, v in file.__dict__.iteritems(): - #if k[0] == '_': continue - print " " * (8 - 1), k, v - - a = str(file) - - b = iter(file).read() - - reader = iter(file) - c = [] - while True: - l = random.randrange(1, 10) - d = reader.read(l) - if not d: break - assert len(d) <= l - c.append(d) - c = "".join(c) - - d = [] - reader.seek(0) - for line in reader: - d.append(line) - d = "".join(d) - - assert a == b == c == d, map(hash, [a,b,c,d]) - assert len(a) == file.unpacked_size - - repr(iter(file)) - - - reader.seek(0) - a = reader.readlines() - - reader.seek(0) - b = list(reader) - - assert a == b diff --git a/dep/libmpq/config.h b/dep/libmpq/config.h deleted file mode 100644 index c69fb13211b..00000000000 --- a/dep/libmpq/config.h +++ /dev/null @@ -1,74 +0,0 @@ -/* config.h. Generated from config.h.in by configure. */ -/* config.h.in. Generated from configure.ac by autoheader. */ - -/* Define to 1 if you have the header file. */ -#define HAVE_DLFCN_H 1 - -/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ -#define HAVE_FSEEKO 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_INTTYPES_H 1 - -/* Define to 1 if you have the `bz2' library (-lbz2). */ -#define HAVE_LIBBZ2 1 - -/* Define to 1 if you have the `z' library (-lz). */ -#define HAVE_LIBZ 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_MEMORY_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDINT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRINGS_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_STAT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_UNISTD_H 1 - -/* Name of package */ -#define PACKAGE "libmpq" - -/* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "mbroemme@plusserver.de" - -/* Define to the full name of this package. */ -#define PACKAGE_NAME "libmpq" - -/* Define to the full name and version of this package. */ -#define PACKAGE_STRING "libmpq 0.4.2" - -/* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "libmpq" - -/* Define to the version of this package. */ -#define PACKAGE_VERSION "0.4.2" - -/* Define to 1 if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Version number of package */ -#define VERSION "0.4.2" - -/* Number of bits in a file offset, on hosts where this is settable. */ -#define _FILE_OFFSET_BITS 64 - -/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */ -/* #undef _LARGEFILE_SOURCE */ - -/* Define for large files, on AIX-style hosts. */ -/* #undef _LARGE_FILES */ diff --git a/dep/libmpq/configure.ac b/dep/libmpq/configure.ac deleted file mode 100644 index d274eab07c6..00000000000 --- a/dep/libmpq/configure.ac +++ /dev/null @@ -1,84 +0,0 @@ -# the autoconf initilization. -AC_INIT(libmpq, 0.4.2, [mbroemme@plusserver.de], [libmpq]) - -# detect the canonical host and target build environment. -AC_CANONICAL_SYSTEM - -# initialize autoconf and automake system. -AM_INIT_AUTOMAKE([no-dependencies]) -AC_CONFIG_HEADERS([config.h:config.h.in]) - -# notices. -AC_PREREQ(2.53) -AC_REVISION($Revision: 1.6 $) - -# checking for programs. -AC_PROG_LIBTOOL -AC_PROG_MAKE_SET -AC_PROG_CC -AC_SYS_LARGEFILE -AC_FUNC_FSEEKO - -# check if we need to export some largefile flags. -if test "$enable_largefile" != no; then - if test "$ac_cv_sys_file_offset_bits" != 'no'; then - if test -z "$LFS_CFLAGS" ; then - LFS_CFLAGS="-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits" - else - LFS_CFLAGS="$LFS_CFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits" - fi - fi - if test "$ac_cv_sys_large_files" != 'no'; then - if test -z "$LFS_CFLAGS" ; then - LFS_CFLAGS="-D_LARGE_FILES=1" - else - LFS_CFLAGS="$LFS_CFLAGS -D_LARGE_FILES=1" - fi - fi - if test "$ac_cv_sys_largefile_source" != 'no'; then - if test -z "$LFS_CFLAGS" ; then - LFS_CFLAGS="-D_LARGEFILE_SOURCE=1" - else - LFS_CFLAGS="$LFS_CFLAGS -D_LARGEFILE_SOURCE=1" - fi - fi -fi - -# export largefile flags. -AC_SUBST(LFS_CFLAGS) - -# check for zlib library. -AC_CHECK_HEADER([zlib.h], [], [AC_MSG_ERROR([*** zlib.h is required, install zlib header files])]) -AC_CHECK_LIB([z], [inflateEnd], [], [AC_MSG_ERROR([*** inflateEnd is required, install zlib library files])]) - -# check for bzlib2 library. -AC_CHECK_HEADER([bzlib.h], [], [AC_MSG_ERROR([*** bzlib.h is required, install bzip2 header files])]) -AC_CHECK_LIB([bz2], [BZ2_bzDecompressInit], [], [AC_MSG_ERROR([*** BZ2_bzDecompressInit is required, install bzip2 library files])]) - -# When we're running gcc 4 or greater, compile with -fvisibility=hidden. -AC_TRY_COMPILE([ -#if !defined(__GNUC__) || (__GNUC__ < 4) -#error not gcc4 -#endif -], [], [CFLAGS="$CFLAGS -fvisibility=hidden"]) - -# find python for binding -AM_PATH_PYTHON([2.4],,[:]) -AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :]) - -# configuration files. -AC_CONFIG_FILES([libmpq.pc]) -AC_CONFIG_FILES([libmpq-config],[chmod +x libmpq-config]) - -# creating files. -AC_OUTPUT([ -Makefile -libmpq/Makefile -bindings/Makefile -bindings/d/Makefile -bindings/python/Makefile -doc/Makefile -doc/man1/Makefile -doc/man3/Makefile -tools/Makefile -]) diff --git a/dep/libmpq/debian/changelog b/dep/libmpq/debian/changelog deleted file mode 100644 index 55d2d918755..00000000000 --- a/dep/libmpq/debian/changelog +++ /dev/null @@ -1,35 +0,0 @@ -libmpq (0.4.2-svn288-1) unstable; urgency=low - - [ babyface ] - * Due to the nature of MPQ archives which can have valid block entries - * removed function libmpq__init() and libmpq__shutdown(), because they - are no longer required and libmpq__file_name(), because it is up to - the application to provide listfile support - * updated documentation to latest API changes - * removed API documentation for removed function prototypes - * removed no longer required files from target - - [ forrestv ] - * mpq.py fix - * spelling - huffmann to huffman - * changed pkware/pkzip to pkzip and used constants instead of numbers - in extract.c - * sanified huffman decoder a bit - * cleanup + update of mpq.py - * Added support for library finding on platforms besides Linux. - * python bindings - sequence methods on Archive, example code - - [ georg ] - * libmpq: file number search now continued over hashtable end - * debian debug package - - -- Georg Lukas Fri, 22 May 2009 22:38:26 +0200 - -libmpq (0.4.2-svn270-1) unstable; urgency=low - - * First debian package - * compatible to new libmpq API (post 0.4.2) - * contains preliminary python-mpq package - - -- Georg Lukas Tue, 07 Oct 2008 14:38:58 +0200 - diff --git a/dep/libmpq/debian/compat b/dep/libmpq/debian/compat deleted file mode 100644 index 7f8f011eb73..00000000000 --- a/dep/libmpq/debian/compat +++ /dev/null @@ -1 +0,0 @@ -7 diff --git a/dep/libmpq/debian/control b/dep/libmpq/debian/control deleted file mode 100644 index f35bb060015..00000000000 --- a/dep/libmpq/debian/control +++ /dev/null @@ -1,50 +0,0 @@ -Source: libmpq -Priority: extra -Maintainer: Georg Lukas -Build-Depends: debhelper (>= 7), autotools-dev, libbz2-dev -Standards-Version: 3.7.3 -Section: libs -Homepage: https://libmpq.org/ - -Package: libmpq-dev -Section: libdevel -Architecture: any -Depends: libmpq0 (= ${binary:Version}) -Description: Headers for libmpq, a library for MoPaQ mpq archives - libmpq is a library for extracting and manipulating MoPaQ mpq archives. - This package provides header files and bindings for applications using - the libmpq library for the following languages: - * C - * Python - * D - -Package: libmpq0 -Section: libs -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Description: A library for extracting and manipulating MoPaQ mpq archives - MPQ, or MoPaQ, is a proprietary archive format created by - Mike O'Brien, the man hailed as Blizzard's multiplayer engine - genius, back in 1996 as a general purpose archive for use with - Diablo, and named narcissistically for its creator - "Mike O'brien PaCK". The copyrights to it, however, are held by - Havas Interactive, Blizzard's parent company. The archive format - is used by many Blizzard titles like Diablo, Diablo 2, Starcraft, - Warcraft 2: BNE, a newer version in Warcraft 3 and World of - Warcraft (WoW). - -Package: libmpq0-dbg -Section: libdevel -Architecture: any -Depends: libmpq0 (= ${binary:Version}) -Description: Debug symbols for libmpq0 library package - -Package: python-mpq -Architecture: all -Depends: ${python:Depends} -XB-Python-Version: ${python:Versions} -XS-Python-Version: current -Description: Python bindings for libmpq, a library for MoPaQ mpq archives - libmpq is a library for extracting and manipulating MoPaQ mpq archives. - This package provides the python bindings for libmpq. - diff --git a/dep/libmpq/debian/copyright b/dep/libmpq/debian/copyright deleted file mode 100644 index f014cf14de7..00000000000 --- a/dep/libmpq/debian/copyright +++ /dev/null @@ -1,23 +0,0 @@ -This package was debianized by Georg Lukas on -Fri, 04 Jul 2008 18:17:08 +0200. - -It was downloaded from - -Upstream Author: - - Maik Broemme - -Copyright: - - Copyright (C) 2008 Maik Broemme - -License: - - 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; either version 2 of the License, or - (at your option) any later version. - - -The Debian packaging is (C) 2008, Georg Lukas and -is licensed under the GPL, see `/usr/share/common-licenses/GPL'. diff --git a/dep/libmpq/debian/libmpq-dev.dirs b/dep/libmpq/debian/libmpq-dev.dirs deleted file mode 100644 index 7b6c7ee6ec1..00000000000 --- a/dep/libmpq/debian/libmpq-dev.dirs +++ /dev/null @@ -1,6 +0,0 @@ -usr/bin -usr/lib -usr/lib/pkgconfig -usr/include -usr/share/man/man1 -usr/share/man/man3 diff --git a/dep/libmpq/debian/libmpq-dev.install b/dep/libmpq/debian/libmpq-dev.install deleted file mode 100644 index 4e6ab3278e3..00000000000 --- a/dep/libmpq/debian/libmpq-dev.install +++ /dev/null @@ -1,6 +0,0 @@ -usr/bin/* -usr/include/* -usr/lib/lib*.a -usr/lib/pkgconfig/* -usr/lib/*.la -usr/share/man/man?/* diff --git a/dep/libmpq/debian/libmpq0.dirs b/dep/libmpq/debian/libmpq0.dirs deleted file mode 100644 index 68457717bd8..00000000000 --- a/dep/libmpq/debian/libmpq0.dirs +++ /dev/null @@ -1 +0,0 @@ -usr/lib diff --git a/dep/libmpq/debian/libmpq0.docs b/dep/libmpq/debian/libmpq0.docs deleted file mode 100644 index 5ac7060850c..00000000000 --- a/dep/libmpq/debian/libmpq0.docs +++ /dev/null @@ -1,6 +0,0 @@ -FAQ -NEWS -README -TODO -THANKS -AUTHORS diff --git a/dep/libmpq/debian/libmpq0.install b/dep/libmpq/debian/libmpq0.install deleted file mode 100644 index 8aa4466a68e..00000000000 --- a/dep/libmpq/debian/libmpq0.install +++ /dev/null @@ -1 +0,0 @@ -usr/lib/lib*.so* diff --git a/dep/libmpq/debian/python-mpq.install b/dep/libmpq/debian/python-mpq.install deleted file mode 100644 index a7aba2013b0..00000000000 --- a/dep/libmpq/debian/python-mpq.install +++ /dev/null @@ -1 +0,0 @@ -usr/lib/python?.? diff --git a/dep/libmpq/debian/rules b/dep/libmpq/debian/rules deleted file mode 100644 index 1e101be5faf..00000000000 --- a/dep/libmpq/debian/rules +++ /dev/null @@ -1,112 +0,0 @@ -#!/usr/bin/make -f -# -*- makefile -*- -# Sample debian/rules that uses debhelper. -# This file was originally written by Joey Hess and Craig Small. -# As a special exception, when this file is copied by dh-make into a -# dh-make output file, you may use that output file without restriction. -# This special exception was added by Craig Small in version 0.37 of dh-make. - -# Uncomment this to turn on verbose mode. -export DH_VERBOSE=1 - - -# These are used for cross-compiling and for saving the configure script -# from having to guess our platform (since we know it already) -DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) -DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) -ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE)) -CROSS= --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) -else -CROSS= --build $(DEB_BUILD_GNU_TYPE) -endif - - - - -# shared library versions, option 1 -version=2.0.5 -major=2 -# option 2, assuming the library is created as src/.libs/libfoo.so.2.0.5 or so -#version=`ls src/.libs/lib*.so.* | \ -# awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) print substr($$0,RSTART)}'` -#major=`ls src/.libs/lib*.so.* | \ -# awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'` - -config.status: configure - dh_testdir - # Add here commands to configure the package. -ifneq "$(wildcard /usr/share/misc/config.sub)" "" - cp -f /usr/share/misc/config.sub config.sub -endif -ifneq "$(wildcard /usr/share/misc/config.guess)" "" - cp -f /usr/share/misc/config.guess config.guess -endif - ./configure $(CROSS) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info CFLAGS="$(CFLAGS) -ggdb" LDFLAGS="-Wl,-z,defs" - - -build: build-stamp -build-stamp: config.status - dh_testdir - - # Add here commands to compile the package. - $(MAKE) - - touch $@ - -clean: - dh_testdir - dh_testroot - rm -f build-stamp - - # Add here commands to clean up after the build process. - [ ! -f Makefile ] || $(MAKE) distclean - rm -f config.sub config.guess - - dh_clean - -install: build - dh_testdir - dh_testroot - dh_clean -k - dh_installdirs - - # Add here commands to install the package into debian/tmp - $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install - - -# Build architecture-independent files here. -binary-indep: build install - dh_pysupport usr/lib/python?.?/site-packages - -# Build architecture-dependent files here. -binary-arch: build install - dh_testdir - dh_testroot - dh_installchangelogs - dh_installdocs - dh_installexamples - dh_install -# dh_installmenu -# dh_installdebconf -# dh_installlogrotate -# dh_installemacsen -# dh_installpam -# dh_installmime -# dh_installinit -# dh_installcron -# dh_installinfo - dh_installman - dh_link - dh_strip --dbg-package=libmpq0-dbg - dh_compress - dh_fixperms -# dh_perl - dh_makeshlibs - dh_installdeb - dh_shlibdeps - dh_gencontrol - dh_md5sums - dh_builddeb - -binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install diff --git a/dep/libmpq/doc/Makefile.am b/dep/libmpq/doc/Makefile.am deleted file mode 100644 index e7ccd5f4518..00000000000 --- a/dep/libmpq/doc/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -# minimum required automake 1.6 -AUTOMAKE_OPTIONS = 1.6 - -# any directories which should be built and installed. -SUBDIRS = man1 man3 diff --git a/dep/libmpq/doc/man1/Makefile.am b/dep/libmpq/doc/man1/Makefile.am deleted file mode 100644 index 055f1aab533..00000000000 --- a/dep/libmpq/doc/man1/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ -# minimum required automake 1.6 -AUTOMAKE_OPTIONS = 1.6 - -# manual page directory. -EXTRA_DIST = $(man_MANS) - -# manual pages for the installed binaries. -man_MANS = \ - libmpq-config.1 diff --git a/dep/libmpq/doc/man1/libmpq-config.1 b/dep/libmpq/doc/man1/libmpq-config.1 deleted file mode 100644 index c025f5ce4f4..00000000000 --- a/dep/libmpq/doc/man1/libmpq-config.1 +++ /dev/null @@ -1,69 +0,0 @@ -.\" Copyright (c) 2003-2008 Maik Broemme -.\" -.\" This is free documentation; you can redistribute it and/or -.\" modify it under the terms of the GNU General Public License as -.\" published by the Free Software Foundation; either version 2 of -.\" the License, or (at your option) any later version. -.\" -.\" The GNU General Public License's references to "object code" -.\" and "executables" are to be interpreted as the output of any -.\" document formatting or typesetting system, including -.\" intermediate and printed output. -.\" -.\" This manual is distributed in the hope that it will be useful, -.\" but WITHOUT ANY WARRANTY; 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 manual; if not, write to the Free -.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, -.\" USA. -.TH libmpq 1 2008-02-10 "The MoPaQ archive library" -.SH NAME -libmpq-config \- script to get information about the installed version of libmpq. -.SH SYNOPSIS -.B libmpq-config -[\-\-prefix\fI[=DIR]\fP] [\-\-exec\-prefix\fI[=DIR]\fP] [\-\-version] -.br -[\-\-cflags] [\-\-libs] [\-\-static\-libs] -.SH DESCRIPTION -.PP -\fIlibmpq-config\fP is a tool that is used to determine the compiler and linker flags that should be used to compile and link programs that use \fIlibmpq\fP. Finally, it's also used internally by the .m4 macros for GNU autoconf that are included with \fIlibmpq\fP. -.SH OPTIONS -\fIlibmpq-config\fP accepts the following options: -.TP 8 -.B \-\-version -.ti 15 -Print the currently installed version of \fIlibmpq\fP on the standard output. -.TP 8 -.B \-\-libs -.ti 15 -Print the linker flags that are necessary to link \fIlibmpq\fP to a program. -.TP 8 -.B \-\-static\-libs -.ti 15 -Print the linker flags that are necessary to statically link \fIlibmpq\fP to a program. -.TP 8 -.B \-\-cflags -.ti 15 -Print the compiler flags that are necessary to compile a program that use \fIlibmpq\fP. -.TP 8 -.B \-\-prefix=PREFIX -.ti 15 -If specified, use PREFIX instead of the installation prefix that \fIlibmpq\fP was built with when computing the output for the \-\-cflags and \-\-libs options. This option is also used for the exec prefix if \-\-exec\-prefix was not specified. This option must be specified before any \-\-libs or \-\-cflags options. -.TP 8 -.B \-\-exec\-prefix=PREFIX -.ti 15 -If specified, use PREFIX instead of the installation exec prefix that \fIlibmpq\fP was built with when computing the output for the \-\-cflags and \-\-libs options. This option must be specified before any \-\-libs or \-\-cflags options. -.SH NOTE -Instead of using this configuration script you should better use the pkg-config version because this would be more platform independent and makes the usage within GNU autoconf much easier. -.SH SEE ALSO -\fBlibmpq\fR(3) -.SH AUTHOR -Check documentation. -.TP -libmpq is (c) 2003-2008 -.B Maik Broemme -.PP -The above e-mail address can be used to send bug reports, feedbacks or library enhancements. diff --git a/dep/libmpq/doc/man3/Makefile.am b/dep/libmpq/doc/man3/Makefile.am deleted file mode 100644 index cad3d865dc1..00000000000 --- a/dep/libmpq/doc/man3/Makefile.am +++ /dev/null @@ -1,31 +0,0 @@ -# minimum required automake 1.6 -AUTOMAKE_OPTIONS = 1.6 - -# manual page directory. -EXTRA_DIST = $(man_MANS) - -# manual pages for the installed binaries. -man_MANS = \ - libmpq.3 \ - libmpq__archive_close.3 \ - libmpq__archive_files.3 \ - libmpq__archive_offset.3 \ - libmpq__archive_open.3 \ - libmpq__archive_packed_size.3 \ - libmpq__archive_unpacked_size.3 \ - libmpq__archive_version.3 \ - libmpq__block_close_offset.3 \ - libmpq__block_open_offset.3 \ - libmpq__block_read.3 \ - libmpq__block_unpacked_size.3 \ - libmpq__file_blocks.3 \ - libmpq__file_compressed.3 \ - libmpq__file_encrypted.3 \ - libmpq__file_imploded.3 \ - libmpq__file_number.3 \ - libmpq__file_offset.3 \ - libmpq__file_packed_size.3 \ - libmpq__file_read.3 \ - libmpq__file_unpacked_size.3 \ - libmpq__strerror.3 \ - libmpq__version.3 diff --git a/dep/libmpq/doc/man3/libmpq.3 b/dep/libmpq/doc/man3/libmpq.3 deleted file mode 100644 index 768dab0a712..00000000000 --- a/dep/libmpq/doc/man3/libmpq.3 +++ /dev/null @@ -1,207 +0,0 @@ -.\" Copyright (c) 2003-2008 Maik Broemme -.\" -.\" This is free documentation; you can redistribute it and/or -.\" modify it under the terms of the GNU General Public License as -.\" published by the Free Software Foundation; either version 2 of -.\" the License, or (at your option) any later version. -.\" -.\" The GNU General Public License's references to "object code" -.\" and "executables" are to be interpreted as the output of any -.\" document formatting or typesetting system, including -.\" intermediate and printed output. -.\" -.\" This manual is distributed in the hope that it will be useful, -.\" but WITHOUT ANY WARRANTY; 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 manual; if not, write to the Free -.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, -.\" USA. -.TH libmpq 3 2008-04-29 "The MoPaQ archive library" -.SH NAME -libmpq \- cross-platform C library for manipulating mpq archives. -.SH SYNOPSIS -.nf -.B -#include -.sp -.BI "const char *libmpq__version();" -.sp -.BI "const char *libmpq__strerror(int32_t returncode);" -.sp -.BI "int32_t libmpq__archive_open(" -.BI " mpq_archive_s **" "mpq_archive", -.BI " const char *" "mpq_filename", -.BI " off_t " "archive_offset" -.BI ");" -.sp -.BI "int32_t libmpq__archive_close(" -.BI " mpq_archive_s *" "mpq_archive" -.BI ");" -.sp -.BI "int32_t libmpq__archive_packed_size(" -.BI " mpq_archive_s *" "mpq_archive", -.BI " off_t *" "packed_size" -.BI ");" -.sp -.BI "int32_t libmpq__archive_unpacked_size(" -.BI " mpq_archive_s *" "mpq_archive", -.BI " off_t *" "unpacked_size" -.BI ");" -.sp -.BI "int32_t libmpq__archive_offset(" -.BI " mpq_archive_s *" "mpq_archive", -.BI " off_t *" "offset" -.BI ");" -.sp -.BI "int32_t libmpq__archive_version(" -.BI " mpq_archive_s *" "mpq_archive", -.BI " uint32_t *" "version" -.BI ");" -.sp -.BI "int32_t libmpq__archive_files(" -.BI " mpq_archive_s *" "mpq_archive", -.BI " uint32_t *" "files" -.BI ");" -.sp -.BI "int32_t libmpq__file_packed_size(" -.BI " mpq_archive_s *" "mpq_archive", -.BI " uint32_t " "file_number", -.BI " off_t *" "packed_size" -.BI ");" -.sp -.BI "int32_t libmpq__file_unpacked_size(" -.BI " mpq_archive_s *" "mpq_archive", -.BI " uint32_t " "file_number", -.BI " off_t *" "unpacked_size" -.BI ");" -.sp -.BI "int32_t libmpq__file_offset(" -.BI " mpq_archive_s *" "mpq_archive", -.BI " uint32_t " "file_number", -.BI " off_t *" "offset" -.BI ");" -.sp -.BI "int32_t libmpq__file_blocks(" -.BI " mpq_archive_s *" "mpq_archive", -.BI " uint32_t " "file_number", -.BI " off_t *" "blocks" -.BI ");" -.sp -.BI "int32_t libmpq__file_encrypted(" -.BI " mpq_archive_s *" "mpq_archive", -.BI " uint32_t " "file_number", -.BI " off_t *" "encrypted" -.BI ");" -.sp -.BI "int32_t libmpq__file_compressed(" -.BI " mpq_archive_s *" "mpq_archive", -.BI " uint32_t " "file_number", -.BI " off_t *" "compressed" -.BI ");" -.sp -.BI "int32_t libmpq__file_imploded(" -.BI " mpq_archive_s *" "mpq_archive", -.BI " uint32_t " "file_number", -.BI " off_t *" "imploded" -.BI ");" -.sp -.BI "int32_t libmpq__file_number(" -.BI " mpq_archive_s *" "mpq_archive", -.BI " const char *" "filename", -.BI " uint32_t *" "number" -.BI ");" -.sp -.BI "int32_t libmpq__file_read(" -.BI " mpq_archive_s *" "mpq_archive", -.BI " uint32_t " "file_number", -.BI " uint8_t *" "out_buf", -.BI " off_t " "out_size", -.BI " off_t *" "transferred" -.BI ");" -.sp -.BI "int32_t libmpq__block_open_offset(" -.BI " mpq_archive_s *" "mpq_archive", -.BI " uint32_t " "file_number" -.BI ");" -.sp -.BI "int32_t libmpq__block_close_offset(" -.BI " mpq_archive_s *" "mpq_archive", -.BI " uint32_t " "file_number" -.BI ");" -.sp -.BI "int32_t libmpq__block_packed_size(" -.BI " mpq_archive_s *" "mpq_archive", -.BI " uint32_t " "file_number", -.BI " uint32_t " "block_number", -.BI " off_t *" "packed_size" -.BI ");" -.sp -.BI "int32_t libmpq__block_unpacked_size(" -.BI " mpq_archive_s *" "mpq_archive", -.BI " uint32_t " "file_number", -.BI " uint32_t " "block_number", -.BI " off_t *" "unpacked_size" -.BI ");" -.sp -.BI "int32_t libmpq__block_offset(" -.BI " mpq_archive_s *" "mpq_archive", -.BI " uint32_t " "file_number", -.BI " uint32_t " "block_number", -.BI " off_t *" "offset" -.BI ");" -.sp -.BI "int32_t libmpq__block_seed(" -.BI " mpq_archive_s *" "mpq_archive", -.BI " uint32_t " "file_number", -.BI " uint32_t " "block_number", -.BI " uint32_t *" "seed" -.BI ");" -.sp -.BI "int32_t libmpq__block_read(" -.BI " mpq_archive_s *" "mpq_archive", -.BI " uint32_t " "file_number", -.BI " uint32_t " "block_number", -.BI " uint8_t *" "out_buf", -.BI " off_t " "out_size", -.BI " off_t *" "transferred" -.BI ");" -.fi -.SH DESCRIPTION -.PP -The \fIlibmpq\fP library supports decrypting, decompressing, exploding and various manipulations of the MoPaQ archive files. It uses \fIzlib(3)\fP and \fIbzip2(1)\fP compression library. At this moment \fIlibmpq\fP is not able to create MoPaQ archives, this limitation will be removed in a future version. -.SH SEE ALSO -.BR libmpq__version (3), -.BR libmpq__strerror (3), -.BR libmpq__archive_open (3), -.BR libmpq__archive_close (3), -.BR libmpq__archive_packed_size (3), -.BR libmpq__archive_unpacked_size (3), -.BR libmpq__archive_offset (3), -.BR libmpq__archive_version (3), -.BR libmpq__archive_files (3), -.BR libmpq__file_packed_size (3), -.BR libmpq__file_unpacked_size (3), -.BR libmpq__file_offset (3), -.BR libmpq__file_blocks (3), -.BR libmpq__file_encrypted (3), -.BR libmpq__file_compressed (3), -.BR libmpq__file_imploded (3), -.BR libmpq__file_number (3), -.BR libmpq__file_read (3), -.BR libmpq__block_open_offset (3), -.BR libmpq__block_close_offset (3), -.BR libmpq__block_packed_size (3), -.BR libmpq__block_unpacked_size (3), -.BR libmpq__block_offset (3), -.BR libmpq__block_seed (3), -.BR libmpq__block_read (3) -.SH AUTHOR -Check documentation. -.TP -libmpq is (c) 2003-2008 -.B Maik Broemme -.PP -The above e-mail address can be used to send bug reports, feedbacks or library enhancements. diff --git a/dep/libmpq/doc/man3/libmpq__archive_close.3 b/dep/libmpq/doc/man3/libmpq__archive_close.3 deleted file mode 100644 index dfc652a6721..00000000000 --- a/dep/libmpq/doc/man3/libmpq__archive_close.3 +++ /dev/null @@ -1,57 +0,0 @@ -.\" Copyright (c) 2003-2008 Maik Broemme -.\" -.\" This is free documentation; you can redistribute it and/or -.\" modify it under the terms of the GNU General Public License as -.\" published by the Free Software Foundation; either version 2 of -.\" the License, or (at your option) any later version. -.\" -.\" The GNU General Public License's references to "object code" -.\" and "executables" are to be interpreted as the output of any -.\" document formatting or typesetting system, including -.\" intermediate and printed output. -.\" -.\" This manual is distributed in the hope that it will be useful, -.\" but WITHOUT ANY WARRANTY; 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 manual; if not, write to the Free -.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, -.\" USA. -.TH libmpq 3 2008-04-29 "The MoPaQ archive library" -.SH NAME -libmpq \- cross-platform C library for manipulating mpq archives. -.SH SYNOPSIS -.nf -.B -#include -.sp -.BI "int32_t libmpq__archive_close(" -.BI " mpq_archive_s *" "mpq_archive" -.BI ");" -.fi -.SH DESCRIPTION -.PP -Call \fBlibmpq__archive_close\fP() to close a mpq archive which was opened by \fBlibmpq__archive_open\fP(). The function frees the archive structure itself and the contents of it. -.LP -The \fBlibmpq__archive_close\fP() function one takes one argument of the archive structure \fImpq_archive\fP which has to be set by \fBlibmpq__archive_open\fP. -.SH RETURN VALUE -On success, a zero is returned and on error one of the following constants. -.TP -.B LIBMPQ_ERROR_CLOSE -The given file could not be closed. -.SH SEE ALSO -.BR libmpq__archive_open (3), -.BR libmpq__archive_packed_size (3), -.BR libmpq__archive_unpacked_size (3), -.BR libmpq__archive_offset (3), -.BR libmpq__archive_version (3), -.BR libmpq__archive_files (3) -.SH AUTHOR -Check documentation. -.TP -libmpq is (c) 2003-2008 -.B Maik Broemme -.PP -The above e-mail address can be used to send bug reports, feedbacks or library enhancements. diff --git a/dep/libmpq/doc/man3/libmpq__archive_files.3 b/dep/libmpq/doc/man3/libmpq__archive_files.3 deleted file mode 100644 index 6663b99161a..00000000000 --- a/dep/libmpq/doc/man3/libmpq__archive_files.3 +++ /dev/null @@ -1,50 +0,0 @@ -.\" Copyright (c) 2003-2008 Maik Broemme -.\" -.\" This is free documentation; you can redistribute it and/or -.\" modify it under the terms of the GNU General Public License as -.\" published by the Free Software Foundation; either version 2 of -.\" the License, or (at your option) any later version. -.\" -.\" The GNU General Public License's references to "object code" -.\" and "executables" are to be interpreted as the output of any -.\" document formatting or typesetting system, including -.\" intermediate and printed output. -.\" -.\" This manual is distributed in the hope that it will be useful, -.\" but WITHOUT ANY WARRANTY; 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 manual; if not, write to the Free -.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, -.\" USA. -.TH libmpq 3 2008-05-14 "The MoPaQ archive library" -.SH NAME -libmpq \- cross-platform C library for manipulating mpq archives. -.SH SYNOPSIS -.nf -.B -#include -.sp -.BI "int32_t libmpq__archive_files(" -.BI " mpq_archive_s *" "mpq_archive", -.BI " uint32_t *" "files" -.BI ");" -.fi -.SH DESCRIPTION -.PP -Call \fBlibmpq__archive_files\fP() to get the number of files inside the archive. It will count only valid files and skip files which have deleted or freed hash entries. -.LP -The \fBlibmpq__archive_files\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument is a reference to the number of \fIfiles\fP in the archive. -.SH RETURN VALUE -On success, a zero is returned. -.SH SEE ALSO -.BR libmpq__file_blocks (3) -.SH AUTHOR -Check documentation. -.TP -libmpq is (c) 2003-2008 -.B Maik Broemme -.PP -The above e-mail address can be used to send bug reports, feedbacks or library enhancements. diff --git a/dep/libmpq/doc/man3/libmpq__archive_offset.3 b/dep/libmpq/doc/man3/libmpq__archive_offset.3 deleted file mode 100644 index 696ac5e809f..00000000000 --- a/dep/libmpq/doc/man3/libmpq__archive_offset.3 +++ /dev/null @@ -1,51 +0,0 @@ -.\" Copyright (c) 2003-2008 Maik Broemme -.\" -.\" This is free documentation; you can redistribute it and/or -.\" modify it under the terms of the GNU General Public License as -.\" published by the Free Software Foundation; either version 2 of -.\" the License, or (at your option) any later version. -.\" -.\" The GNU General Public License's references to "object code" -.\" and "executables" are to be interpreted as the output of any -.\" document formatting or typesetting system, including -.\" intermediate and printed output. -.\" -.\" This manual is distributed in the hope that it will be useful, -.\" but WITHOUT ANY WARRANTY; 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 manual; if not, write to the Free -.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, -.\" USA. -.TH libmpq 3 2008-05-14 "The MoPaQ archive library" -.SH NAME -libmpq \- cross-platform C library for manipulating mpq archives. -.SH SYNOPSIS -.nf -.B -#include -.sp -.BI "int32_t libmpq__archive_offset(" -.BI " mpq_archive_s *" "mpq_archive", -.BI " off_t *" "offset" -.BI ");" -.fi -.SH DESCRIPTION -.PP -Call \fBlibmpq__archive_offset\fP() to get the offset of the archive, which is the absolute position in the file. It also supports archives within archives. -.LP -The \fBlibmpq__archive_offset\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument is a reference to the archive starting position \fIoffset\fP in file. -.SH RETURN VALUE -On success, a zero is returned. -.SH SEE ALSO -.BR libmpq__file_offset (3), -.BR libmpq__block_offset (3) -.SH AUTHOR -Check documentation. -.TP -libmpq is (c) 2003-2008 -.B Maik Broemme -.PP -The above e-mail address can be used to send bug reports, feedbacks or library enhancements. diff --git a/dep/libmpq/doc/man3/libmpq__archive_open.3 b/dep/libmpq/doc/man3/libmpq__archive_open.3 deleted file mode 100644 index 02c021f8948..00000000000 --- a/dep/libmpq/doc/man3/libmpq__archive_open.3 +++ /dev/null @@ -1,71 +0,0 @@ -.\" Copyright (c) 2003-2008 Maik Broemme -.\" -.\" This is free documentation; you can redistribute it and/or -.\" modify it under the terms of the GNU General Public License as -.\" published by the Free Software Foundation; either version 2 of -.\" the License, or (at your option) any later version. -.\" -.\" The GNU General Public License's references to "object code" -.\" and "executables" are to be interpreted as the output of any -.\" document formatting or typesetting system, including -.\" intermediate and printed output. -.\" -.\" This manual is distributed in the hope that it will be useful, -.\" but WITHOUT ANY WARRANTY; 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 manual; if not, write to the Free -.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, -.\" USA. -.TH libmpq 3 2008-04-29 "The MoPaQ archive library" -.SH NAME -libmpq \- cross-platform C library for manipulating mpq archives. -.SH SYNOPSIS -.nf -.B -#include -.sp -.BI "int32_t libmpq__archive_open(" -.BI " mpq_archive_s **" "mpq_archive", -.BI " const char *" "mpq_filename", -.BI " off_t " "archive_offset" -.BI ");" -.fi -.SH DESCRIPTION -.PP -Call \fBlibmpq__archive_open\fP() to open a given mpq archive for later use to extract or manipulate files inside the archive. It will create all required file structures and you have to call \fBlibmpq__archive_close\fP() on success to clean the opened structures. On failure there is no need to call \fBlibmpq__archive_close\fP() because everything will be cleaned up. -.LP -The \fBlibmpq__archive_open\fP() function takes as first argument a reference to the archive structure \fImpq_archive\fP and will open the file \fImpq_filename\fP to the structure pointed to by \fImpq_archive\fP. The last argument, \fIarchive_offset\fP is normally -1, but can be specified when the archive offset is known, or not 512-byte aligned. -.SH RETURN VALUE -On success, *\fImpq_archive\fP is set to a new \fBmpq_archive_s\fP* and zero is returned, and on error one of the following constants is returned. -.TP -.B LIBMPQ_ERROR_OPEN -The given file could not be opened. -.TP -.B LIBMPQ_ERROR_MALLOC -Not enough memory for creating required structures. -.TP -.B LIBMPQ_ERROR_SEEK -Seeking in file failed. -.TP -.B LIBMPQ_ERROR_FORMAT -The given file is no valid mpq archive. -.TP -.B LIBMPQ_ERROR_READ -Reading in archive failed. -.SH SEE ALSO -.BR libmpq__archive_close (3), -.BR libmpq__archive_packed_size (3), -.BR libmpq__archive_unpacked_size (3), -.BR libmpq__archive_offset (3), -.BR libmpq__archive_version (3), -.BR libmpq__archive_files (3) -.SH AUTHOR -Check documentation. -.TP -libmpq is (c) 2003-2008 -.B Maik Broemme -.PP -The above e-mail address can be used to send bug reports, feedbacks or library enhancements. diff --git a/dep/libmpq/doc/man3/libmpq__archive_packed_size.3 b/dep/libmpq/doc/man3/libmpq__archive_packed_size.3 deleted file mode 100644 index 6c3061f2031..00000000000 --- a/dep/libmpq/doc/man3/libmpq__archive_packed_size.3 +++ /dev/null @@ -1,51 +0,0 @@ -.\" Copyright (c) 2003-2008 Maik Broemme -.\" -.\" This is free documentation; you can redistribute it and/or -.\" modify it under the terms of the GNU General Public License as -.\" published by the Free Software Foundation; either version 2 of -.\" the License, or (at your option) any later version. -.\" -.\" The GNU General Public License's references to "object code" -.\" and "executables" are to be interpreted as the output of any -.\" document formatting or typesetting system, including -.\" intermediate and printed output. -.\" -.\" This manual is distributed in the hope that it will be useful, -.\" but WITHOUT ANY WARRANTY; 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 manual; if not, write to the Free -.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, -.\" USA. -.TH libmpq 3 2008-04-29 "The MoPaQ archive library" -.SH NAME -libmpq \- cross-platform C library for manipulating mpq archives. -.SH SYNOPSIS -.nf -.B -#include -.sp -.BI "int32_t libmpq__archive_packed_size(" -.BI " mpq_archive_s *" "mpq_archive", -.BI " off_t *" "packed_size" -.BI ");" -.fi -.SH DESCRIPTION -.PP -Call \fBlibmpq__archive_packed_size\fP() to get the packed size of all files in the archive. It will count compressed and imploded files as well as stored only. -.LP -The \fBlibmpq__archive_packed_size\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument is a reference to the compressed, imploded or stored size \fIpacked_size\fP of file. -.SH RETURN VALUE -On success, a zero is returned. -.SH SEE ALSO -.BR libmpq__file_packed_size (3), -.BR libmpq__block_packed_size (3) -.SH AUTHOR -Check documentation. -.TP -libmpq is (c) 2003-2008 -.B Maik Broemme -.PP -The above e-mail address can be used to send bug reports, feedbacks or library enhancements. diff --git a/dep/libmpq/doc/man3/libmpq__archive_unpacked_size.3 b/dep/libmpq/doc/man3/libmpq__archive_unpacked_size.3 deleted file mode 100644 index d2ba923c8f0..00000000000 --- a/dep/libmpq/doc/man3/libmpq__archive_unpacked_size.3 +++ /dev/null @@ -1,51 +0,0 @@ -.\" Copyright (c) 2003-2008 Maik Broemme -.\" -.\" This is free documentation; you can redistribute it and/or -.\" modify it under the terms of the GNU General Public License as -.\" published by the Free Software Foundation; either version 2 of -.\" the License, or (at your option) any later version. -.\" -.\" The GNU General Public License's references to "object code" -.\" and "executables" are to be interpreted as the output of any -.\" document formatting or typesetting system, including -.\" intermediate and printed output. -.\" -.\" This manual is distributed in the hope that it will be useful, -.\" but WITHOUT ANY WARRANTY; 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 manual; if not, write to the Free -.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, -.\" USA. -.TH libmpq 3 2008-04-29 "The MoPaQ archive library" -.SH NAME -libmpq \- cross-platform C library for manipulating mpq archives. -.SH SYNOPSIS -.nf -.B -#include -.sp -.BI "int32_t libmpq__archive_unpacked_size(" -.BI " mpq_archive_s *" "mpq_archive", -.BI " off_t *" "unpacked_size" -.BI ");" -.fi -.SH DESCRIPTION -.PP -Call \fBlibmpq__archive_unpacked_size\fP() to get the unpacked size of all files in the archive. It will count uncompressed and exploded files as well as stored only. -.LP -The \fBlibmpq__archive_unpacked_size\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument is a reference to the uncompressed, exploded or stored size \fIunpacked_size\fP of file. -.SH RETURN VALUE -On success, a zero is returned. -.SH SEE ALSO -.BR libmpq__file_unpacked_size (3), -.BR libmpq__block_unpacked_size (3) -.SH AUTHOR -Check documentation. -.TP -libmpq is (c) 2003-2008 -.B Maik Broemme -.PP -The above e-mail address can be used to send bug reports, feedbacks or library enhancements. diff --git a/dep/libmpq/doc/man3/libmpq__archive_version.3 b/dep/libmpq/doc/man3/libmpq__archive_version.3 deleted file mode 100644 index 1764046895a..00000000000 --- a/dep/libmpq/doc/man3/libmpq__archive_version.3 +++ /dev/null @@ -1,48 +0,0 @@ -.\" Copyright (c) 2003-2008 Maik Broemme -.\" -.\" This is free documentation; you can redistribute it and/or -.\" modify it under the terms of the GNU General Public License as -.\" published by the Free Software Foundation; either version 2 of -.\" the License, or (at your option) any later version. -.\" -.\" The GNU General Public License's references to "object code" -.\" and "executables" are to be interpreted as the output of any -.\" document formatting or typesetting system, including -.\" intermediate and printed output. -.\" -.\" This manual is distributed in the hope that it will be useful, -.\" but WITHOUT ANY WARRANTY; 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 manual; if not, write to the Free -.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, -.\" USA. -.TH libmpq 3 2008-05-14 "The MoPaQ archive library" -.SH NAME -libmpq \- cross-platform C library for manipulating mpq archives. -.SH SYNOPSIS -.nf -.B -#include -.sp -.BI "int32_t libmpq__archive_version(" -.BI " mpq_archive_s *" "mpq_archive", -.BI " uint32_t *" "version" -.BI ");" -.fi -.SH DESCRIPTION -.PP -Call \fBlibmpq__archive_version\fP() to get the archive version. Currently there exist two known versions, version 1 which supports archives until 2GB total size and version 2 which supports archives above 2GB total size and both are supported. -.LP -The \fBlibmpq__archive_version\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument is a reference to the \fIversion\fP of archive. -.SH RETURN VALUE -On success, a zero is returned. -.SH AUTHOR -Check documentation. -.TP -libmpq is (c) 2003-2008 -.B Maik Broemme -.PP -The above e-mail address can be used to send bug reports, feedbacks or library enhancements. diff --git a/dep/libmpq/doc/man3/libmpq__block_close_offset.3 b/dep/libmpq/doc/man3/libmpq__block_close_offset.3 deleted file mode 100644 index 1ec0c06f70d..00000000000 --- a/dep/libmpq/doc/man3/libmpq__block_close_offset.3 +++ /dev/null @@ -1,53 +0,0 @@ -.\" Copyright (c) 2003-2008 Maik Broemme -.\" -.\" This is free documentation; you can redistribute it and/or -.\" modify it under the terms of the GNU General Public License as -.\" published by the Free Software Foundation; either version 2 of -.\" the License, or (at your option) any later version. -.\" -.\" The GNU General Public License's references to "object code" -.\" and "executables" are to be interpreted as the output of any -.\" document formatting or typesetting system, including -.\" intermediate and printed output. -.\" -.\" This manual is distributed in the hope that it will be useful, -.\" but WITHOUT ANY WARRANTY; 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 manual; if not, write to the Free -.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, -.\" USA. -.TH libmpq 3 2008-05-16 "The MoPaQ archive library" -.SH NAME -libmpq \- cross-platform C library for manipulating mpq archives. -.SH SYNOPSIS -.nf -.B -#include -.sp -.BI "int32_t libmpq__block_close_offset(" -.BI " mpq_archive_s *" "mpq_archive", -.BI " uint32_t " "file_number" -.BI ");" -.fi -.SH DESCRIPTION -.PP -Call \fBlibmpq__block_close_offset\fP() to close the block offset table for the given file. It will close the block offset table regardless of compression (compressed, imploded or stored) type of file. -.LP -The \fBlibmpq__block_close_offset\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument \fIfile_number\fP is the number of file to close. -.SH RETURN VALUE -On success, a zero is returned and on error one of the following constants. -.TP -.B LIBMPQ_ERROR_EXIST -File or block does not exist in archive. -.SH SEE ALSO -.BR libmpq__block_open_offset (3) -.SH AUTHOR -Check documentation. -.TP -libmpq is (c) 2003-2008 -.B Maik Broemme -.PP -The above e-mail address can be used to send bug reports, feedbacks or library enhancements. diff --git a/dep/libmpq/doc/man3/libmpq__block_open_offset.3 b/dep/libmpq/doc/man3/libmpq__block_open_offset.3 deleted file mode 100644 index a60b133f406..00000000000 --- a/dep/libmpq/doc/man3/libmpq__block_open_offset.3 +++ /dev/null @@ -1,65 +0,0 @@ -.\" Copyright (c) 2003-2008 Maik Broemme -.\" -.\" This is free documentation; you can redistribute it and/or -.\" modify it under the terms of the GNU General Public License as -.\" published by the Free Software Foundation; either version 2 of -.\" the License, or (at your option) any later version. -.\" -.\" The GNU General Public License's references to "object code" -.\" and "executables" are to be interpreted as the output of any -.\" document formatting or typesetting system, including -.\" intermediate and printed output. -.\" -.\" This manual is distributed in the hope that it will be useful, -.\" but WITHOUT ANY WARRANTY; 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 manual; if not, write to the Free -.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, -.\" USA. -.TH libmpq 3 2008-05-16 "The MoPaQ archive library" -.SH NAME -libmpq \- cross-platform C library for manipulating mpq archives. -.SH SYNOPSIS -.nf -.B -#include -.sp -.BI "int32_t libmpq__block_open_offset(" -.BI " mpq_archive_s *" "mpq_archive", -.BI " uint32_t " "file_number" -.BI ");" -.fi -.SH DESCRIPTION -.PP -Call \fBlibmpq__block_open_offset\fP() to open the block offset table for the given file. It will open the block offset table regardless of compression (compressed, imploded or stored) type of file. -.LP -The \fBlibmpq__block_open_offset\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument \fIfile_number\fP is the number of file to open. -.SH RETURN VALUE -On success, a zero is returned and on error one of the following constants. -.TP -.B LIBMPQ_ERROR_EXIST -File or block does not exist in archive. -.TP -.B LIBMPQ_ERROR_SEEK -Seeking in file failed. -.TP -.B LIBMPQ_ERROR_MALLOC -Not enough memory for creating required structures. -.TP -.B LIBMPQ_ERROR_READ -Reading in archive failed. -.TP -.B LIBMPQ_ERROR_DECRYPT -Decrypting block failed. -.SH SEE ALSO -.BR libmpq__block_close_offset (3) -.SH AUTHOR -Check documentation. -.TP -libmpq is (c) 2003-2008 -.B Maik Broemme -.PP -The above e-mail address can be used to send bug reports, feedbacks or library enhancements. diff --git a/dep/libmpq/doc/man3/libmpq__block_read.3 b/dep/libmpq/doc/man3/libmpq__block_read.3 deleted file mode 100644 index 3272c64c7ed..00000000000 --- a/dep/libmpq/doc/man3/libmpq__block_read.3 +++ /dev/null @@ -1,78 +0,0 @@ -.\" Copyright (c) 2003-2008 Maik Broemme -.\" -.\" This is free documentation; you can redistribute it and/or -.\" modify it under the terms of the GNU General Public License as -.\" published by the Free Software Foundation; either version 2 of -.\" the License, or (at your option) any later version. -.\" -.\" The GNU General Public License's references to "object code" -.\" and "executables" are to be interpreted as the output of any -.\" document formatting or typesetting system, including -.\" intermediate and printed output. -.\" -.\" This manual is distributed in the hope that it will be useful, -.\" but WITHOUT ANY WARRANTY; 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 manual; if not, write to the Free -.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, -.\" USA. -.TH libmpq 3 2008-05-16 "The MoPaQ archive library" -.SH NAME -libmpq \- cross-platform C library for manipulating mpq archives. -.SH SYNOPSIS -.nf -.B -#include -.sp -.BI "int32_t libmpq__block_read(" -.BI " mpq_archive_s *" "mpq_archive", -.BI " uint32_t " "file_number", -.BI " uint32_t " "block_number, -.BI " uint8_t *" "out_buf", -.BI " off_t " "out_size", -.BI " off_t " "transferred" -.BI ");" -.fi -.SH DESCRIPTION -.PP -Call \fBlibmpq__block_read\fP() to read a given block into memory. If the block is encrypted it will be first decrypted and then if it is packed (compressed or imploded) it will be unpacked. -.LP -The \fBlibmpq__block_read\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument \fIfile_number\fP is the number of file, the third argument \fIblock_number\fP is the number of block. The fourth argument \fIout_buf\fP is the output data buffer which contains the extracted data and the fifth argument \fIout_size\fP is the size of \fIout_buf\fP. The sixth argument is a reference to the \fItransferred\fP bytes of the file. -.SH RETURN VALUE -On success, a zero is returned and on error one of the following constants. -.TP -.B LIBMPQ_ERROR_EXIST -Block does not exist in archive. -.TP -.B LIBMPQ_ERROR_OPEN -Block offset table was not opened by calling \fBlibmpq__block_open_offset\fP(), or it was closed by an \fBlibmpq__block_close_offset\fP() call. -.TP -.B LIBMPQ_ERROR_SIZE -The output buffer is to small. -.TP -.B LIBMPQ_ERROR_SEEK -Seeking in file failed. -.TP -.B LIBMPQ_ERROR_MALLOC -Not enough memory for creating required structures. -.TP -.B LIBMPQ_ERROR_READ -Reading in archive failed. -.TP -.B LIBMPQ_ERROR_DECRYPT -Decrypting block failed. -.TP -.B LIBMPQ_ERROR_UNPACK -Unpacking block failed. -.SH SEE ALSO -.BR libmpq__file_read (3) -.SH AUTHOR -Check documentation. -.TP -libmpq is (c) 2003-2008 -.B Maik Broemme -.PP -The above e-mail address can be used to send bug reports, feedbacks or library enhancements. diff --git a/dep/libmpq/doc/man3/libmpq__block_unpacked_size.3 b/dep/libmpq/doc/man3/libmpq__block_unpacked_size.3 deleted file mode 100644 index a21ca48159a..00000000000 --- a/dep/libmpq/doc/man3/libmpq__block_unpacked_size.3 +++ /dev/null @@ -1,59 +0,0 @@ -.\" Copyright (c) 2003-2008 Maik Broemme -.\" -.\" This is free documentation; you can redistribute it and/or -.\" modify it under the terms of the GNU General Public License as -.\" published by the Free Software Foundation; either version 2 of -.\" the License, or (at your option) any later version. -.\" -.\" The GNU General Public License's references to "object code" -.\" and "executables" are to be interpreted as the output of any -.\" document formatting or typesetting system, including -.\" intermediate and printed output. -.\" -.\" This manual is distributed in the hope that it will be useful, -.\" but WITHOUT ANY WARRANTY; 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 manual; if not, write to the Free -.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, -.\" USA. -.TH libmpq 3 2008-05-16 "The MoPaQ archive library" -.SH NAME -libmpq \- cross-platform C library for manipulating mpq archives. -.SH SYNOPSIS -.nf -.B -#include -.sp -.BI "int32_t libmpq__block_unpacked_size(" -.BI " mpq_archive_s *" "mpq_archive", -.BI " uint32_t " "file_number", -.BI " uint32_t " "block_number", -.BI " off_t *" "unpacked_size" -.BI ");" -.fi -.SH DESCRIPTION -.PP -Call \fBlibmpq__block_unpacked_size\fP() to get the unpacked size of a given block in the file. It will return a valid size for compressed and imploded blocks as well as stored only. -.LP -The \fBlibmpq__block_unpacked_size\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument \fIfile_number\fP is the number of file, the third argument \fIblock_number\fP is the number of block and the fourth argument is a reference to the uncompressed, exploded or stored size \fIunpacked_size\fP of block. -.SH RETURN VALUE -On success, a zero is returned and on error one of the following constants. -.TP -.B LIBMPQ_ERROR_EXIST -File or block does not exist in archive. -.TP -.B LIBMPQ_ERROR_OPEN -Block offset table was not opened by calling \fBlibmpq__block_open_offset\fP(), or it was closed by an \fBlibmpq__block_close_offset\fP() call. -.SH SEE ALSO -.BR libmpq__archive_unpacked_size (3), -.BR libmpq__file_unpacked_size (3) -.SH AUTHOR -Check documentation. -.TP -libmpq is (c) 2003-2008 -.B Maik Broemme -.PP -The above e-mail address can be used to send bug reports, feedbacks or library enhancements. diff --git a/dep/libmpq/doc/man3/libmpq__file_blocks.3 b/dep/libmpq/doc/man3/libmpq__file_blocks.3 deleted file mode 100644 index 85baeffc603..00000000000 --- a/dep/libmpq/doc/man3/libmpq__file_blocks.3 +++ /dev/null @@ -1,54 +0,0 @@ -.\" Copyright (c) 2003-2008 Maik Broemme -.\" -.\" This is free documentation; you can redistribute it and/or -.\" modify it under the terms of the GNU General Public License as -.\" published by the Free Software Foundation; either version 2 of -.\" the License, or (at your option) any later version. -.\" -.\" The GNU General Public License's references to "object code" -.\" and "executables" are to be interpreted as the output of any -.\" document formatting or typesetting system, including -.\" intermediate and printed output. -.\" -.\" This manual is distributed in the hope that it will be useful, -.\" but WITHOUT ANY WARRANTY; 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 manual; if not, write to the Free -.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, -.\" USA. -.TH libmpq 3 2008-05-16 "The MoPaQ archive library" -.SH NAME -libmpq \- cross-platform C library for manipulating mpq archives. -.SH SYNOPSIS -.nf -.B -#include -.sp -.BI "int32_t libmpq__file_blocks(" -.BI " mpq_archive_s *" "mpq_archive", -.BI " uint32_t " "file_number", -.BI " uint32_t *" "blocks" -.BI ");" -.fi -.SH DESCRIPTION -.PP -Call \fBlibmpq__file_blocks\fP() to get the number of blocks for a given file. It will count all blocks for files stored in multiple sectors or count one for files stored in single sector. -.LP -The \fBlibmpq__file_blocks\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument \fIfile_number\fP is the number of file and the third argument is a reference to the number of \fIblocks\fP of the file. -.SH RETURN VALUE -On success, a zero is returned and on error one of the following constants. -.TP -.B LIBMPQ_ERROR_EXIST -File does not exist in archive. -.SH SEE ALSO -.BR libmpq__archive_files (3) -.SH AUTHOR -Check documentation. -.TP -libmpq is (c) 2003-2008 -.B Maik Broemme -.PP -The above e-mail address can be used to send bug reports, feedbacks or library enhancements. diff --git a/dep/libmpq/doc/man3/libmpq__file_compressed.3 b/dep/libmpq/doc/man3/libmpq__file_compressed.3 deleted file mode 100644 index 24b44f0b666..00000000000 --- a/dep/libmpq/doc/man3/libmpq__file_compressed.3 +++ /dev/null @@ -1,54 +0,0 @@ -.\" Copyright (c) 2003-2008 Maik Broemme -.\" -.\" This is free documentation; you can redistribute it and/or -.\" modify it under the terms of the GNU General Public License as -.\" published by the Free Software Foundation; either version 2 of -.\" the License, or (at your option) any later version. -.\" -.\" The GNU General Public License's references to "object code" -.\" and "executables" are to be interpreted as the output of any -.\" document formatting or typesetting system, including -.\" intermediate and printed output. -.\" -.\" This manual is distributed in the hope that it will be useful, -.\" but WITHOUT ANY WARRANTY; 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 manual; if not, write to the Free -.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, -.\" USA. -.TH libmpq 3 2008-05-16 "The MoPaQ archive library" -.SH NAME -libmpq \- cross-platform C library for manipulating mpq archives. -.SH SYNOPSIS -.nf -.B -#include -.sp -.BI "int32_t libmpq__file_compressed(" -.BI " mpq_archive_s *" "mpq_archive", -.BI " uint32_t " "file_number", -.BI " uint32_t *" "compressed" -.BI ");" -.fi -.SH DESCRIPTION -.PP -Call \fBlibmpq__file_compressed\fP() to get the compression status of the given file. It will return true for compressed files and false otherwise. -.LP -The \fBlibmpq__file_compressed\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument \fIfile_number\fP is the number of file and the third argument is a reference to the compression status \fIcompressed\fP of the file. -.SH RETURN VALUE -On success, a zero is returned and on error one of the following constants. -.TP -.B LIBMPQ_ERROR_EXIST -File does not exist in archive. -.SH SEE ALSO -.BR libmpq__archive_files (3) -.SH AUTHOR -Check documentation. -.TP -libmpq is (c) 2003-2008 -.B Maik Broemme -.PP -The above e-mail address can be used to send bug reports, feedbacks or library enhancements. diff --git a/dep/libmpq/doc/man3/libmpq__file_encrypted.3 b/dep/libmpq/doc/man3/libmpq__file_encrypted.3 deleted file mode 100644 index 798f4019c7a..00000000000 --- a/dep/libmpq/doc/man3/libmpq__file_encrypted.3 +++ /dev/null @@ -1,54 +0,0 @@ -.\" Copyright (c) 2003-2008 Maik Broemme -.\" -.\" This is free documentation; you can redistribute it and/or -.\" modify it under the terms of the GNU General Public License as -.\" published by the Free Software Foundation; either version 2 of -.\" the License, or (at your option) any later version. -.\" -.\" The GNU General Public License's references to "object code" -.\" and "executables" are to be interpreted as the output of any -.\" document formatting or typesetting system, including -.\" intermediate and printed output. -.\" -.\" This manual is distributed in the hope that it will be useful, -.\" but WITHOUT ANY WARRANTY; 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 manual; if not, write to the Free -.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, -.\" USA. -.TH libmpq 3 2008-05-16 "The MoPaQ archive library" -.SH NAME -libmpq \- cross-platform C library for manipulating mpq archives. -.SH SYNOPSIS -.nf -.B -#include -.sp -.BI "int32_t libmpq__file_encrypted(" -.BI " mpq_archive_s *" "mpq_archive", -.BI " uint32_t " "file_number", -.BI " uint32_t *" "encrypted" -.BI ");" -.fi -.SH DESCRIPTION -.PP -Call \fBlibmpq__file_encrypted\fP() to get the encryption status of the given file. It will return true for encrypted files and false otherwise. -.LP -The \fBlibmpq__file_encrypted\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument \fIfile_number\fP is the number of file and the third argument is a reference to the encryption status \fIencrypted\fP of the file. -.SH RETURN VALUE -On success, a zero is returned and on error one of the following constants. -.TP -.B LIBMPQ_ERROR_EXIST -File does not exist in archive. -.SH SEE ALSO -.BR libmpq__archive_files (3) -.SH AUTHOR -Check documentation. -.TP -libmpq is (c) 2003-2008 -.B Maik Broemme -.PP -The above e-mail address can be used to send bug reports, feedbacks or library enhancements. diff --git a/dep/libmpq/doc/man3/libmpq__file_imploded.3 b/dep/libmpq/doc/man3/libmpq__file_imploded.3 deleted file mode 100644 index 9adce38cb5f..00000000000 --- a/dep/libmpq/doc/man3/libmpq__file_imploded.3 +++ /dev/null @@ -1,54 +0,0 @@ -.\" Copyright (c) 2003-2008 Maik Broemme -.\" -.\" This is free documentation; you can redistribute it and/or -.\" modify it under the terms of the GNU General Public License as -.\" published by the Free Software Foundation; either version 2 of -.\" the License, or (at your option) any later version. -.\" -.\" The GNU General Public License's references to "object code" -.\" and "executables" are to be interpreted as the output of any -.\" document formatting or typesetting system, including -.\" intermediate and printed output. -.\" -.\" This manual is distributed in the hope that it will be useful, -.\" but WITHOUT ANY WARRANTY; 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 manual; if not, write to the Free -.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, -.\" USA. -.TH libmpq 3 2008-05-16 "The MoPaQ archive library" -.SH NAME -libmpq \- cross-platform C library for manipulating mpq archives. -.SH SYNOPSIS -.nf -.B -#include -.sp -.BI "int32_t libmpq__file_imploded(" -.BI " mpq_archive_s *" "mpq_archive", -.BI " uint32_t " "file_number", -.BI " uint32_t *" "imploded" -.BI ");" -.fi -.SH DESCRIPTION -.PP -Call \fBlibmpq__file_imploded\fP() to get the implosion status of the given file. It will return true for imploded files and false otherwise. -.LP -The \fBlibmpq__file_imploded\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument \fIfile_number\fP is the number of file and the third argument is a reference to the implosion status \fIimploded\fP of the file. -.SH RETURN VALUE -On success, a zero is returned and on error one of the following constants. -.TP -.B LIBMPQ_ERROR_EXIST -File does not exist in archive. -.SH SEE ALSO -.BR libmpq__archive_files (3) -.SH AUTHOR -Check documentation. -.TP -libmpq is (c) 2003-2008 -.B Maik Broemme -.PP -The above e-mail address can be used to send bug reports, feedbacks or library enhancements. diff --git a/dep/libmpq/doc/man3/libmpq__file_number.3 b/dep/libmpq/doc/man3/libmpq__file_number.3 deleted file mode 100644 index 8d7a47769ee..00000000000 --- a/dep/libmpq/doc/man3/libmpq__file_number.3 +++ /dev/null @@ -1,52 +0,0 @@ -.\" Copyright (c) 2003-2008 Maik Broemme -.\" -.\" This is free documentation; you can redistribute it and/or -.\" modify it under the terms of the GNU General Public License as -.\" published by the Free Software Foundation; either version 2 of -.\" the License, or (at your option) any later version. -.\" -.\" The GNU General Public License's references to "object code" -.\" and "executables" are to be interpreted as the output of any -.\" document formatting or typesetting system, including -.\" intermediate and printed output. -.\" -.\" This manual is distributed in the hope that it will be useful, -.\" but WITHOUT ANY WARRANTY; 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 manual; if not, write to the Free -.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, -.\" USA. -.TH libmpq 3 2008-05-16 "The MoPaQ archive library" -.SH NAME -libmpq \- cross-platform C library for manipulating mpq archives. -.SH SYNOPSIS -.nf -.B -#include -.sp -.BI "int32_t libmpq__file_number(" -.BI " mpq_archive_s *" "mpq_archive", -.BI " const char *" "filename", -.BI " uint32_t *" "number" -.BI ");" -.fi -.SH DESCRIPTION -.PP -Call \fBlibmpq__file_number\fP() to get the number of a given file in the archive. This function will return a file number regardless of a known or opened listfile. -.LP -The \fBlibmpq__file_number\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument \fIfilename\fP is the name of the file and the third argument is a reference to the \fInumber\fP of the file. -.SH RETURN VALUE -On success, the number of the file is returned and on error one of the following constants. -.TP -.B LIBMPQ_ERROR_EXIST -File does not exist in archive. -.SH AUTHOR -Check documentation. -.TP -libmpq is (c) 2003-2008 -.B Maik Broemme -.PP -The above e-mail address can be used to send bug reports, feedbacks or library enhancements. diff --git a/dep/libmpq/doc/man3/libmpq__file_offset.3 b/dep/libmpq/doc/man3/libmpq__file_offset.3 deleted file mode 100644 index 392a66d0b04..00000000000 --- a/dep/libmpq/doc/man3/libmpq__file_offset.3 +++ /dev/null @@ -1,55 +0,0 @@ -.\" Copyright (c) 2003-2008 Maik Broemme -.\" -.\" This is free documentation; you can redistribute it and/or -.\" modify it under the terms of the GNU General Public License as -.\" published by the Free Software Foundation; either version 2 of -.\" the License, or (at your option) any later version. -.\" -.\" The GNU General Public License's references to "object code" -.\" and "executables" are to be interpreted as the output of any -.\" document formatting or typesetting system, including -.\" intermediate and printed output. -.\" -.\" This manual is distributed in the hope that it will be useful, -.\" but WITHOUT ANY WARRANTY; 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 manual; if not, write to the Free -.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, -.\" USA. -.TH libmpq 3 2008-05-15 "The MoPaQ archive library" -.SH NAME -libmpq \- cross-platform C library for manipulating mpq archives. -.SH SYNOPSIS -.nf -.B -#include -.sp -.BI "int32_t libmpq__file_offset(" -.BI " mpq_archive_s *" "mpq_archive", -.BI " uint32_t " "file_number", -.BI " off_t *" "offset" -.BI ");" -.fi -.SH DESCRIPTION -.PP -Call \fBlibmpq__file_offset\fP() to get the offset of the file, which is the absolute position in the archive. It also supports archives within archives. -.LP -The \fBlibmpq__file_offset\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument \fIfile_number\fP is the number of file and the third argument is a reference to the file starting position \fIoffset\fP in archive. -.SH RETURN VALUE -On success, a zero is returned and on error one of the following constants. -.TP -.B LIBMPQ_ERROR_EXIST -File does not exist in archive. -.SH SEE ALSO -.BR libmpq__archive_offset (3), -.BR libmpq__block_offset (3) -.SH AUTHOR -Check documentation. -.TP -libmpq is (c) 2003-2008 -.B Maik Broemme -.PP -The above e-mail address can be used to send bug reports, feedbacks or library enhancements. diff --git a/dep/libmpq/doc/man3/libmpq__file_packed_size.3 b/dep/libmpq/doc/man3/libmpq__file_packed_size.3 deleted file mode 100644 index b584ddf77dd..00000000000 --- a/dep/libmpq/doc/man3/libmpq__file_packed_size.3 +++ /dev/null @@ -1,55 +0,0 @@ -.\" Copyright (c) 2003-2008 Maik Broemme -.\" -.\" This is free documentation; you can redistribute it and/or -.\" modify it under the terms of the GNU General Public License as -.\" published by the Free Software Foundation; either version 2 of -.\" the License, or (at your option) any later version. -.\" -.\" The GNU General Public License's references to "object code" -.\" and "executables" are to be interpreted as the output of any -.\" document formatting or typesetting system, including -.\" intermediate and printed output. -.\" -.\" This manual is distributed in the hope that it will be useful, -.\" but WITHOUT ANY WARRANTY; 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 manual; if not, write to the Free -.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, -.\" USA. -.TH libmpq 3 2008-05-15 "The MoPaQ archive library" -.SH NAME -libmpq \- cross-platform C library for manipulating mpq archives. -.SH SYNOPSIS -.nf -.B -#include -.sp -.BI "int32_t libmpq__file_packed_size(" -.BI " mpq_archive_s *" "mpq_archive", -.BI " uint32_t " "file_number", -.BI " off_t *" "packed_size" -.BI ");" -.fi -.SH DESCRIPTION -.PP -Call \fBlibmpq__file_packed_size\fP() to get the packed size of a given file in the archive. It will return a valid size for compressed and imploded files as well as stored only. -.LP -The \fBlibmpq__file_packed_size\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument \fIfile_number\fP is the number of file and the third argument is a reference to the compressed, imploded or stored size \fIpacked_size\fP of file. -.SH RETURN VALUE -On success, a zero is returned and on error one of the following constants. -.TP -.B LIBMPQ_ERROR_EXIST -File does not exist in archive. -.SH SEE ALSO -.BR libmpq__archive_packed_size (3), -.BR libmpq__block_packed_size (3) -.SH AUTHOR -Check documentation. -.TP -libmpq is (c) 2003-2008 -.B Maik Broemme -.PP -The above e-mail address can be used to send bug reports, feedbacks or library enhancements. diff --git a/dep/libmpq/doc/man3/libmpq__file_read.3 b/dep/libmpq/doc/man3/libmpq__file_read.3 deleted file mode 100644 index cbfafbd0f4f..00000000000 --- a/dep/libmpq/doc/man3/libmpq__file_read.3 +++ /dev/null @@ -1,77 +0,0 @@ -.\" Copyright (c) 2003-2008 Maik Broemme -.\" -.\" This is free documentation; you can redistribute it and/or -.\" modify it under the terms of the GNU General Public License as -.\" published by the Free Software Foundation; either version 2 of -.\" the License, or (at your option) any later version. -.\" -.\" The GNU General Public License's references to "object code" -.\" and "executables" are to be interpreted as the output of any -.\" document formatting or typesetting system, including -.\" intermediate and printed output. -.\" -.\" This manual is distributed in the hope that it will be useful, -.\" but WITHOUT ANY WARRANTY; 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 manual; if not, write to the Free -.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, -.\" USA. -.TH libmpq 3 2008-05-16 "The MoPaQ archive library" -.SH NAME -libmpq \- cross-platform C library for manipulating mpq archives. -.SH SYNOPSIS -.nf -.B -#include -.sp -.BI "int32_t libmpq__file_read(" -.BI " mpq_archive_s *" "mpq_archive", -.BI " uint32_t " "file_number", -.BI " uint8_t *" "out_buf", -.BI " off_t " "out_size", -.BI " off_t *" "transferred" -.BI ");" -.fi -.SH DESCRIPTION -.PP -Call \fBlibmpq__file_read\fP() to read a given file into memory. If the file is encrypted it will be first decrypted and then if it is packed (compressed or imploded) it will be unpacked. -.LP -The \fBlibmpq__file_read\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument \fIfile_number\fP is the file to extract, the third argument \fIout_buf\fP is the output data buffer which contains the extracted data. The fourth argument \fIout_size\fP is the size of \fIout_buf\fP and the fifth argument is a reference to the \fItransferred\fP bytes of the file. -.SH RETURN VALUE -On success, a zero is returned and on error one of the following constants. -.TP -.B LIBMPQ_ERROR_EXIST -File does not exist in archive. -.TP -.B LIBMPQ_ERROR_OPEN -Block offset table was not opened by calling \fBlibmpq__block_open_offset\fP(), or it was closed by an \fBlibmpq__block_close_offset\fP() call. -.TP -.B LIBMPQ_ERROR_SIZE -The output buffer is to small. -.TP -.B LIBMPQ_ERROR_SEEK -Seeking in file failed. -.TP -.B LIBMPQ_ERROR_MALLOC -Not enough memory for creating required structures. -.TP -.B LIBMPQ_ERROR_READ -Reading in archive failed. -.TP -.B LIBMPQ_ERROR_DECRYPT -Decrypting file failed. -.TP -.B LIBMPQ_ERROR_UNPACK -Unpacking file failed. -.SH SEE ALSO -.BR libmpq__block_read (3) -.SH AUTHOR -Check documentation. -.TP -libmpq is (c) 2003-2008 -.B Maik Broemme -.PP -The above e-mail address can be used to send bug reports, feedbacks or library enhancements. diff --git a/dep/libmpq/doc/man3/libmpq__file_unpacked_size.3 b/dep/libmpq/doc/man3/libmpq__file_unpacked_size.3 deleted file mode 100644 index a81cf7a4e76..00000000000 --- a/dep/libmpq/doc/man3/libmpq__file_unpacked_size.3 +++ /dev/null @@ -1,55 +0,0 @@ -.\" Copyright (c) 2003-2008 Maik Broemme -.\" -.\" This is free documentation; you can redistribute it and/or -.\" modify it under the terms of the GNU General Public License as -.\" published by the Free Software Foundation; either version 2 of -.\" the License, or (at your option) any later version. -.\" -.\" The GNU General Public License's references to "object code" -.\" and "executables" are to be interpreted as the output of any -.\" document formatting or typesetting system, including -.\" intermediate and printed output. -.\" -.\" This manual is distributed in the hope that it will be useful, -.\" but WITHOUT ANY WARRANTY; 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 manual; if not, write to the Free -.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, -.\" USA. -.TH libmpq 3 2008-05-15 "The MoPaQ archive library" -.SH NAME -libmpq \- cross-platform C library for manipulating mpq archives. -.SH SYNOPSIS -.nf -.B -#include -.sp -.BI "int32_t libmpq__file_unpacked_size(" -.BI " mpq_archive_s *" "mpq_archive", -.BI " uint32_t " "file_number", -.BI " off_t *" "unpacked_size" -.BI ");" -.fi -.SH DESCRIPTION -.PP -Call \fBlibmpq__file_unpacked_size\fP() to get the unpacked size of a given file in the archive. It will return a valid size for compressed and imploded files as well as stored only. -.LP -The \fBlibmpq__file_unpacked_size\fP() function takes as first argument the archive structure \fImpq_archive\fP which have to be allocated first and opened by \fBlibmpq__archive_open\fP(). The second argument \fIfile_number\fP is the number of file and the third argument is a reference to the uncompressed, exploded or stored size \fIunpacked_size\fP of file. -.SH RETURN VALUE -On success, a zero is returned and on error one of the following constants. -.TP -.B LIBMPQ_ERROR_EXIST -File does not exist in archive. -.SH SEE ALSO -.BR libmpq__archive_unpacked_size (3), -.BR libmpq__block_unpacked_size (3) -.SH AUTHOR -Check documentation. -.TP -libmpq is (c) 2003-2008 -.B Maik Broemme -.PP -The above e-mail address can be used to send bug reports, feedbacks or library enhancements. diff --git a/dep/libmpq/doc/man3/libmpq__strerror.3 b/dep/libmpq/doc/man3/libmpq__strerror.3 deleted file mode 100644 index 246f422eed0..00000000000 --- a/dep/libmpq/doc/man3/libmpq__strerror.3 +++ /dev/null @@ -1,45 +0,0 @@ -.\" Copyright (c) 2010 Georg Lukas -.\" -.\" This is free documentation; you can redistribute it and/or -.\" modify it under the terms of the GNU General Public License as -.\" published by the Free Software Foundation; either version 2 of -.\" the License, or (at your option) any later version. -.\" -.\" The GNU General Public License's references to "object code" -.\" and "executables" are to be interpreted as the output of any -.\" document formatting or typesetting system, including -.\" intermediate and printed output. -.\" -.\" This manual is distributed in the hope that it will be useful, -.\" but WITHOUT ANY WARRANTY; 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 manual; if not, write to the Free -.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, -.\" USA. -.TH libmpq 3 2010-07-18 "The MoPaQ archive library" -.SH NAME -libmpq__strerror \- return string describing libmpq error number -.SH SYNOPSIS -.nf -.B -#include -.sp -.BI "const char *libmpq__strerror(int32_t returncode);" -.fi -.SH DESCRIPTION -.PP -Call \fBlibmpq__strerror\fP() to get a string message for the return code of one of the other libmpq functions. -.SH RETURN VALUE -The function returns a string pointer to non-writable memory or NULL if \fBreturncode\fP is not a return code of a libmpq function. -.SH SEE ALSO -.BR libmpq (3), strerror (3) -.SH AUTHOR -Check documentation. -.TP -libmpq is (c) 2003-2008 -.B Maik Broemme -.PP -The above e-mail address can be used to send bug reports, feedbacks or library enhancements. diff --git a/dep/libmpq/doc/man3/libmpq__version.3 b/dep/libmpq/doc/man3/libmpq__version.3 deleted file mode 100644 index 5500d7314f5..00000000000 --- a/dep/libmpq/doc/man3/libmpq__version.3 +++ /dev/null @@ -1,45 +0,0 @@ -.\" Copyright (c) 2003-2008 Maik Broemme -.\" -.\" This is free documentation; you can redistribute it and/or -.\" modify it under the terms of the GNU General Public License as -.\" published by the Free Software Foundation; either version 2 of -.\" the License, or (at your option) any later version. -.\" -.\" The GNU General Public License's references to "object code" -.\" and "executables" are to be interpreted as the output of any -.\" document formatting or typesetting system, including -.\" intermediate and printed output. -.\" -.\" This manual is distributed in the hope that it will be useful, -.\" but WITHOUT ANY WARRANTY; 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 manual; if not, write to the Free -.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, -.\" USA. -.TH libmpq 3 2008-03-31 "The MoPaQ archive library" -.SH NAME -libmpq \- cross-platform C library for manipulating mpq archives. -.SH SYNOPSIS -.nf -.B -#include -.sp -.BI "const char *libmpq__version();" -.fi -.SH DESCRIPTION -.PP -Call \fBlibmpq__version\fP() to get information about the version of the library, it is useful to create minimum required version verifications. -.SH RETURN VALUE -The function returns the library version. -.SH SEE ALSO -.BR libmpq (3) -.SH AUTHOR -Check documentation. -.TP -libmpq is (c) 2003-2008 -.B Maik Broemme -.PP -The above e-mail address can be used to send bug reports, feedbacks or library enhancements. diff --git a/dep/libmpq/libmpq-config.in b/dep/libmpq/libmpq-config.in deleted file mode 100644 index d345efdbe09..00000000000 --- a/dep/libmpq/libmpq-config.in +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh - -prefix="@prefix@" -exec_prefix="@exec_prefix@" -exec_prefix_set=no - -usage="\ -Usage: libmpq-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--libs] [--cflags]" - -if test "$#" -eq "0"; then - echo "${usage}" 1>&2 - exit 1 -fi - -while test "$#" -gt "0"; do - case "$1" in - -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) optarg= ;; - esac - - case "$1" in - --prefix=*) - prefix="$optarg" - if test "$exec_prefix_set" = "no" ; then - exec_prefix="$optarg" - fi - ;; - --prefix) - echo "$prefix" - ;; - --exec-prefix=*) - exec_prefix="$optarg" - exec_prefix_set=yes - ;; - --exec-prefix) - echo "$exec_prefix" - ;; - --version) - echo "@VERSION@" - ;; - --cflags) - largefile="@LFS_CFLAGS@" - includes=-I@includedir@/libmpq - echo "$includes $largefile" - ;; - --libs) - libdirs="-L@libdir@" - echo "$libdirs -lmpq" - ;; - *) - echo "${usage}" 1>&2 - exit 1 - ;; - esac - shift -done - diff --git a/dep/libmpq/libmpq.pc.in b/dep/libmpq/libmpq.pc.in deleted file mode 100644 index 8c53bea35a0..00000000000 --- a/dep/libmpq/libmpq.pc.in +++ /dev/null @@ -1,10 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: libmpq -Description: GPL version of the libmpq library -Version: @VERSION@ -Libs: -L${libdir} -lmpq -Cflags: -I${includedir}/libmpq @LFS_CFLAGS@ diff --git a/dep/libmpq/libmpq/Makefile.am b/dep/libmpq/libmpq/Makefile.am deleted file mode 100644 index 409e3dfe02f..00000000000 --- a/dep/libmpq/libmpq/Makefile.am +++ /dev/null @@ -1,23 +0,0 @@ -# minimum required automake 1.6 -AUTOMAKE_OPTIONS = 1.6 - -# library information and headers which should not be installed. -lib_LTLIBRARIES = libmpq.la -noinst_HEADERS = common.h explode.h extract.h huffman.h mpq-internal.h wave.h - -# directory where the include files will be installed. -libmpq_includedir = $(includedir)/libmpq - -# header files to install. -libmpq_include_HEADERS = mpq.h - -libmpq_la_SOURCES = $(GENERAL_SRCS) -libmpq_la_LDFLAGS = -release $(PACKAGE_VERSION) - -GENERAL_SRCS = \ - common.c \ - huffman.c \ - extract.c \ - explode.c \ - mpq.c \ - wave.c diff --git a/dep/libmpq/libmpq/common.c b/dep/libmpq/libmpq/common.c deleted file mode 100644 index 879bd902b58..00000000000 --- a/dep/libmpq/libmpq/common.c +++ /dev/null @@ -1,220 +0,0 @@ -/* - * common.c -- shared functions used by mpq-tools. - * - * Copyright (c) 2003-2008 Maik Broemme - * - * 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; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; 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. - */ - -/* generic includes. */ -#include -#include -#include -#include - -/* libmpq main includes. */ -#include "mpq.h" -#include "mpq-internal.h" - -/* libmpq generic includes. */ -#include "extract.h" - -#include "common.h" - -/* the global shared decryption buffer. it's a static array compiled into the - * library, and can be re-created by compiling and running crypt_buf_gen.c - */ -#include "crypt_buf.h" - -/* function to return the hash to a given string. */ -uint32_t libmpq__hash_string(const char *key, uint32_t offset) { - - /* some common variables. */ - uint32_t seed1 = 0x7FED7FED; - uint32_t seed2 = 0xEEEEEEEE; - - /* one key character. */ - uint32_t ch; - - /* prepare seeds. */ - while (*key != 0) { - ch = toupper(*key++); - seed1 = crypt_buf[offset + ch] ^ (seed1 + seed2); - seed2 = ch + seed1 + seed2 + (seed2 << 5) + 3; - } - - return seed1; -} - -/* function to encrypt a block. */ -int32_t libmpq__encrypt_block(uint32_t *in_buf, uint32_t in_size, uint32_t seed) { - - /* some common variables. */ - uint32_t seed2 = 0xEEEEEEEE; - uint32_t ch; - - /* we're processing the data 4 bytes at a time. */ - for (; in_size >= 4; in_size -= 4) { - seed2 += crypt_buf[0x400 + (seed & 0xFF)]; - ch = *in_buf ^ (seed + seed2); - seed = ((~seed << 0x15) + 0x11111111) | (seed >> 0x0B); - seed2 = *in_buf + seed2 + (seed2 << 5) + 3; - *in_buf++ = ch; - } - - /* if no error was found, return decrypted bytes. */ - return LIBMPQ_SUCCESS; -} - - -/* function to decrypt a block. */ -int32_t libmpq__decrypt_block(uint32_t *in_buf, uint32_t in_size, uint32_t seed) { - - /* some common variables. */ - uint32_t seed2 = 0xEEEEEEEE; - uint32_t ch; - - /* we're processing the data 4 bytes at a time. */ - for (; in_size >= 4; in_size -= 4) { - seed2 += crypt_buf[0x400 + (seed & 0xFF)]; - ch = *in_buf ^ (seed + seed2); - seed = ((~seed << 0x15) + 0x11111111) | (seed >> 0x0B); - seed2 = ch + seed2 + (seed2 << 5) + 3; - *in_buf++ = ch; - } - - /* if no error was found, return decrypted bytes. */ - return LIBMPQ_SUCCESS; -} - -/* function to detect decryption key. */ -int32_t libmpq__decrypt_key(uint8_t *in_buf, uint32_t in_size, uint32_t block_size, uint32_t *key) { - - /* some common variables. */ - uint32_t saveseed1; - - /* temp = seed1 + seed2 */ - uint32_t temp; - uint32_t i = 0; - - /* temp = seed1 + buffer[0x400 + (seed1 & 0xFF)] */ - temp = (*(uint32_t *)in_buf ^ in_size) - 0xEEEEEEEE; - - /* try all 255 possibilities. */ - for (i = 0; i < 0x100; i++) { - - /* some common variables. */ - uint32_t seed1; - uint32_t seed2 = 0xEEEEEEEE; - uint32_t ch; - uint32_t ch2; - - /* try the first uint32_t's (we exactly know the value). */ - seed1 = temp - crypt_buf[0x400 + i]; - seed2 += crypt_buf[0x400 + (seed1 & 0xFF)]; - ch = ((uint32_t *)in_buf)[0] ^ (seed1 + seed2); - - if (ch != in_size) { - continue; - } - - /* add one because we are decrypting block positions. */ - saveseed1 = seed1 + 1; - ch2 = ch; - - /* - * if ok, continue and test the second value. we don't know exactly the value, - * but we know that the second one has lower 16 bits set to zero (no compressed - * block is larger than 0xFFFF bytes) - */ - seed1 = ((~seed1 << 0x15) + 0x11111111) | (seed1 >> 0x0B); - seed2 = ch + seed2 + (seed2 << 5) + 3; - seed2 += crypt_buf[0x400 + (seed1 & 0xFF)]; - ch = ((uint32_t *)in_buf)[1] ^ (seed1 + seed2); - - /* check if we found the file seed. */ - if ((ch - ch2) <= block_size) { - - /* file seed found, so return it. */ - *key = saveseed1; - return LIBMPQ_SUCCESS; - } - } - - /* if no file seed was found return with error. */ - return LIBMPQ_ERROR_DECRYPT; -} - -/* function to decompress or explode a block from mpq archive. */ -int32_t libmpq__decompress_block(uint8_t *in_buf, uint32_t in_size, uint8_t *out_buf, uint32_t out_size, uint32_t compression_type) { - - /* some common variables. */ - int32_t tb = 0; - - /* check if buffer is not compressed. */ - if (compression_type == LIBMPQ_FLAG_COMPRESS_NONE) { - - /* no compressed data, so copy input buffer to output buffer. */ - memcpy(out_buf, in_buf, out_size); - - /* store number of bytes copied. */ - tb = out_size; - } - - /* check if one compression mode is used. */ - else if (compression_type == LIBMPQ_FLAG_COMPRESS_PKZIP || - compression_type == LIBMPQ_FLAG_COMPRESS_MULTI) { - - /* check if block is really compressed, some blocks have set the compression flag, but are not compressed. */ - if (in_size < out_size) { - - /* check if we are using pkzip compression algorithm. */ - if (compression_type == LIBMPQ_FLAG_COMPRESS_PKZIP) { - - /* decompress using pkzip. */ - if ((tb = libmpq__decompress_pkzip(in_buf, in_size, out_buf, out_size)) < 0) { - - /* something on decompression failed. */ - return tb; - } - } - - /* check if we are using multiple compression algorithm. */ - else if (compression_type == LIBMPQ_FLAG_COMPRESS_MULTI) { - - /* - * check if it is a file compressed by blizzard's multiple compression, note that storm.dll - * version 1.0.9 distributed with warcraft 3 passes the full path name of the opened archive - * as the new last parameter. - */ - if ((tb = libmpq__decompress_multi(in_buf, in_size, out_buf, out_size)) < 0) { - - /* something on decompression failed. */ - return tb; - } - } - } else { - - /* block has set compression flag, but is not compressed, so copy data to output buffer. */ - memcpy(out_buf, in_buf, out_size); - - /* save the number of transferred bytes. */ - tb = in_size; - } - } - - /* if no error was found, return transferred bytes. */ - return tb; -} diff --git a/dep/libmpq/libmpq/common.h b/dep/libmpq/libmpq/common.h deleted file mode 100644 index b9e03126434..00000000000 --- a/dep/libmpq/libmpq/common.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * common.h -- header functions used by mpq-tools. - * - * Copyright (c) 2003-2008 Maik Broemme - * - * 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; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; 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 _COMMON_H -#define _COMMON_H - -/* function to return the hash to a given string. */ -uint32_t libmpq__hash_string( - const char *key, - uint32_t offset -); - -/* function to encrypt a block. */ -int32_t libmpq__encrypt_block( - uint32_t *in_buf, - uint32_t in_size, - uint32_t seed -); - -/* function to decrypt a block. */ -int32_t libmpq__decrypt_block( - uint32_t *in_buf, - uint32_t in_size, - uint32_t seed -); - -/* function to detect decryption key. */ -int32_t libmpq__decrypt_key( - uint8_t *in_buf, - uint32_t in_size, - uint32_t block_size, - uint32_t *key -); - -/* function to decompress or explode block from archive. */ -int32_t libmpq__decompress_block( - uint8_t *in_buf, - uint32_t in_size, - uint8_t *out_buf, - uint32_t out_size, - uint32_t compression_type -); - -#endif /* _COMMON_H */ diff --git a/dep/libmpq/libmpq/crypt_buf.h b/dep/libmpq/libmpq/crypt_buf.h deleted file mode 100644 index 34184b017fe..00000000000 --- a/dep/libmpq/libmpq/crypt_buf.h +++ /dev/null @@ -1,217 +0,0 @@ -/* DO NOT CHANGE! this file is auto-generated by crypt_buf_gen.c */ -static const uint32_t crypt_buf[0x500] = { - 0x55c636e2, 0x02be0170, 0x584b71d4, 0x2984f00e, 0xb682c809, 0x91cf876b, - 0x775a9c24, 0x597d5ca5, 0x5a1afeb2, 0xd3e9ce0d, 0x32cdcdf8, 0xb18201cd, - 0x3cce05ce, 0xa55d13be, 0xbb0afe71, 0x9376ab33, 0x848f645e, 0x87e45a45, - 0x45b86017, 0x5e656ca8, 0x1b851a95, 0x2542dbd7, 0xab4df9e4, 0x5976ae9b, - 0x6c317e7d, 0xcddd2f94, 0x3c3c13e5, 0x335b1371, 0x31a592ca, 0x51e4fc4c, - 0xf7db5b2f, 0x8abdbe41, 0x8beaa674, 0x20d6b319, 0xde6c9a9d, 0xc5ac84e5, - 0x445a5feb, 0x94958cb0, 0x1e7d3847, 0xf35d29b0, 0xca5cceda, 0xb732c8b5, - 0xfdcc41dd, 0x0edcec16, 0x9d01feae, 0x1165d38e, 0x9ee193c8, 0xbf33b13c, - 0x61bc0dfc, 0xef3e7be9, 0xf8d4d4c5, 0xc79b7694, 0x5a255943, 0x0b3dd20a, - 0x9d1ab5a3, 0xcfa8ba57, 0x5e6d7069, 0xcb89b731, 0x3dc0d15b, 0x0d4d7e7e, - 0x97e37f2b, 0xfefc2bb1, 0xf95b16b5, 0x27a55b93, 0x45f22729, 0x4c986630, - 0x7c666862, 0x5fa40847, 0xa3f16205, 0x791b7764, 0x386b36d6, 0x6e6c3fef, - 0xc75855db, 0x4abc7dc7, 0x4a328f9b, 0xcef20c0f, 0x60b88f07, 0xf7bb4b8f, - 0x830b5192, 0x94f711ec, 0x20250752, 0x399d21a3, 0xe5c0840d, 0xe76cffa5, - 0x624fab29, 0x5df133e6, 0x83e0b9b8, 0xc5796bfb, 0x4a7ab2d0, 0xba59a821, - 0x03a81e4c, 0xcd3adfdb, 0x32b26b8c, 0x8e35c533, 0x9e6300e9, 0x8cf92ac5, - 0x880d18eb, 0x131a53b3, 0x2ed2dc64, 0xb23257c1, 0xa06450c1, 0x1b92cb8e, - 0x72ed730e, 0x19a685f0, 0x82836483, 0x42d94e8a, 0xee9bd6f6, 0x556d0b6a, - 0xba65589a, 0xde24cce4, 0x53329f6c, 0xc754fe8b, 0x503d2dc7, 0x10027ba4, - 0xd3b60a8b, 0x68e68d83, 0x0a9128a9, 0x595fa35f, 0x0b03b5be, 0x150a45c4, - 0xb1629cce, 0xe5f7497b, 0x8a7098a4, 0xb8233e69, 0x8ea0f978, 0x5b579970, - 0xeab14318, 0x4b28b263, 0xb6766cef, 0x06782877, 0x155c6dd0, 0xc711333c, - 0xf819cedf, 0x00eb1d68, 0xd6fffa6e, 0x439e5962, 0xd765d6db, 0xcb0bcee9, - 0x6d3c5647, 0x965466f3, 0x0ca983c9, 0x74ecc1ce, 0xfc0563b6, 0x42b08fee, - 0xc5b38853, 0xfe502ceb, 0x7b432faf, 0xc309e610, 0x2c3997d8, 0x43774654, - 0x15bd9d2c, 0xed6a420d, 0xc7ff520c, 0xb8a97fd1, 0x5e4d60cc, 0xb9738d11, - 0xda2181ff, 0x73ac2597, 0x3a8eec8d, 0xac85e779, 0xf3f975d6, 0xb9fe7b91, - 0x0f155d1e, 0x2860b6dd, 0x835977cb, 0xb0607436, 0x9cab7f6b, 0x8ab91186, - 0xc12b51e9, 0x20084e8b, 0x44ba8ead, 0xa542b130, 0x82bcd5c4, 0xcc747f4e, - 0x0f1909d8, 0xda242e1c, 0x6f7d1aa0, 0xd2626486, 0x88d0781e, 0xab695ccd, - 0xfa569145, 0xb4feb55c, 0xbe47e896, 0xe70a7a88, 0xd56185a2, 0xacf4c871, - 0x09282332, 0x1ddeeaa8, 0x590c7adb, 0xf4a97667, 0xbfd85705, 0x0ea77ccc, - 0xa9f85364, 0x83195869, 0x8bfb041a, 0xdb842f5c, 0xd6f0f315, 0xa7756ea7, - 0x0a51b439, 0xa9edf8a3, 0xd9084e2f, 0x827407f8, 0xd4ac8284, 0x09739d0d, - 0xb3bb6cfc, 0xd539c77d, 0x6bbc9ac0, 0x35c641aa, 0x934c96b0, 0xd17af317, - 0x29c6baef, 0xb275cdac, 0xd72662de, 0x9f5c2544, 0xc1a98f75, 0xd98e8f9a, - 0x47bd5c86, 0x70c610a6, 0xb5482ed4, 0x23b9c68c, 0x3c1bae66, 0x69556e7f, - 0xd902f5e0, 0x653d195b, 0xde6541fb, 0x07bcc6ac, 0xc6ee7788, 0x801534d4, - 0x2c1f35c0, 0xd9de614d, 0xbdccac85, 0xb4d4a0da, 0x242d549b, 0x9d964796, - 0xb9ceb982, 0x59fa99a9, 0xd8986cc1, 0x9e90c1a1, 0x01bbd82f, 0xd7f1c5fd, - 0xdd847eba, 0x883d305d, 0x25f13152, 0x4a92694d, 0x77f1e601, 0x8024e6e7, - 0x02a5f53d, 0x9c3ef4d9, 0xaf403ccc, 0xe2ad03c0, 0x46edf6ec, 0x6f9bd3e6, - 0xcc24ad7a, 0x47afab12, 0x82298df7, 0x708c9eec, 0x76f8c1b1, 0xb39459d2, - 0x3f1e26d9, 0xe1811be7, 0x56ed1c4d, 0xc9d18af8, 0xe828060e, 0x91cada2e, - 0x5ccbf9b7, 0xf1a552d4, 0x3c9d4343, 0xe1008785, 0x2adfeebf, 0xf90240a0, - 0x3d08cce7, 0x426e6fb0, 0x573c984f, 0x13a843ae, 0x406b7439, 0x636085d9, - 0x5000ba9a, 0xad4a47ab, 0xaf001d8d, 0x419907ae, 0x185c8f96, 0xe5e9ed4d, - 0x61764133, 0xd3703d97, 0xac98f0c6, 0xdbc3a37c, 0x85f010c4, 0x90491e32, - 0xf12e18bf, 0xc88c96e1, 0xd3fbd6d9, 0xe3c28b08, 0xd5bf08cc, 0xb1e78859, - 0x2546ddcf, 0xb030b200, 0xaafd2811, 0x55b22d21, 0xd38bf567, 0x469c7a2b, - 0x5ad05792, 0xa1a5981e, 0x7dfb8384, 0x34d1ca0a, 0x7eb0dbe0, 0xd61ce0f6, - 0x398068b7, 0xe6406d1f, 0x95ae6b47, 0xe4281230, 0xb0843061, 0xa70a3a68, - 0xe340f625, 0x72dcbffd, 0x8eb8afcd, 0x18b6661f, 0x17ef5a5c, 0x000c5b22, - 0x6ba13836, 0x6165e383, 0x74481c5b, 0xe56f0711, 0xa26f5024, 0x5ff22e60, - 0x31a5e829, 0xa1094bf0, 0xc680ec6c, 0x8cf327d7, 0xebf1348a, 0x6a227d2f, - 0x74065184, 0x8df65112, 0x2bbd05ee, 0xe4d00ed6, 0x2980ee1a, 0x6ae1da73, - 0xe84614da, 0x6c9906ab, 0xcf8e02db, 0xd3723e97, 0x92f66caf, 0xac8491c7, - 0xaec65696, 0xb98997cf, 0xfa16c762, 0x6d73c65f, 0x205d22a6, 0x4dd3aaa5, - 0x2deb6bc0, 0x9f37686c, 0x71a5282b, 0x376bb9e0, 0x7fff2a1b, 0xde67982f, - 0x9cbf33ce, 0x2e6dab37, 0x6e3424b9, 0x0ee143bc, 0x832a60d9, 0xbb6329e1, - 0x13f6befd, 0x5965fb84, 0xf60b233c, 0x3d695183, 0x433224a1, 0xb5d9cae5, - 0x82459bab, 0x9f21b311, 0xaf6c5247, 0xb447b13a, 0x7b2676c3, 0xc38979cd, - 0x8526ae25, 0xc550ad5b, 0x685099a7, 0x65e9c2bd, 0xe5c6dc36, 0xe10b37a9, - 0x88016878, 0xce81d4e4, 0x24d6fc80, 0x4106152d, 0x6d4f5f90, 0xc4dc74be, - 0xdb48676c, 0x6cb569b7, 0xf3bf598f, 0x042b08d9, 0x02ccb2de, 0xb1056f65, - 0x47994af4, 0xfa141ba4, 0x9376ab2e, 0x07a76737, 0x75e7e6fc, 0x449d80a1, - 0x03b7259d, 0xf6df358a, 0x5a75d5b9, 0x47286923, 0x3b1a30ef, 0xeebe3d6a, - 0x9db1aa00, 0x007a90d9, 0x24667071, 0x019c73cf, 0x69039bcd, 0x95900744, - 0x6518b1eb, 0x6905f202, 0xee3951b2, 0xe141fca9, 0x797fa832, 0x5a95e55b, - 0xd6263b15, 0x5b61f394, 0x897acb1c, 0x005f83a9, 0x22420f71, 0xf495176e, - 0x7e138f3d, 0x1392e384, 0x373bf7aa, 0x8e512816, 0xa960b3ca, 0x0474d74c, - 0xffacd6d7, 0x2ef5ed9e, 0x60992aaa, 0x7e690e99, 0x23c0749d, 0xd8e29105, - 0x555d5909, 0x15631bfe, 0xa69c5a1c, 0x501017ca, 0x99438048, 0x38733ac7, - 0xe682e2c8, 0xd4655fd6, 0x956e4c04, 0x347df643, 0x2f4b177b, 0x93ed3aa4, - 0xa77e1dd5, 0x7ae55702, 0xd2a52fd9, 0xef8ba18c, 0xb7d3c1ee, 0x8078ba8d, - 0xab5aaadb, 0x752be08f, 0x068b31c1, 0x078aae3c, 0xaa5a8343, 0x123d9268, - 0x2ceaee43, 0x8ebdb239, 0x650251f3, 0x04883648, 0x8c62e12e, 0x12b32167, - 0xe5112e9a, 0x10002548, 0x3e7a818d, 0x077e5327, 0xf140cc21, 0x6ce7d75d, - 0x9b99f9a5, 0x3215741c, 0xb6aadbae, 0x738768dc, 0x82a3742f, 0x76517020, - 0xdd872ad8, 0x9d0902b2, 0x7d1a6b04, 0x49381592, 0x63a652a5, 0x0c15e626, - 0xe22f70d6, 0x01e84385, 0xb29de134, 0x20c5000e, 0xe961f443, 0x2d31662e, - 0x3ce6bc28, 0x34f9dd94, 0xfa45de53, 0x497588bd, 0x9468215b, 0x0777fa5c, - 0x6f7114c0, 0xe0e82694, 0xe4371986, 0x57112de2, 0xe0cac289, 0xf2a3cee0, - 0x6a41e1b9, 0xbfcea77d, 0xf927fd52, 0x69747d98, 0xbea76cdb, 0x8dd39557, - 0x04db5ece, 0x2a0885c8, 0x3be4e8ee, 0x21d785dc, 0x09de7c0e, 0x3258ea33, - 0x51922982, 0xee8dd024, 0x3df6965d, 0x30c1237b, 0xf7f6686a, 0x9faca186, - 0x7c400076, 0x85acef8a, 0xf4b6d220, 0xddc3481c, 0x439eaec4, 0x717bbe63, - 0x8259faa7, 0xd682bd68, 0x932a8610, 0x38bf0a7f, 0x6212e2c7, 0x88ee3168, - 0xb3c27047, 0x6133cb1e, 0x15295506, 0x5ae66246, 0x1d208ddd, 0xa91d3dba, - 0xc315968d, 0x6aa2664b, 0x716d0cca, 0x891f4956, 0x80866bff, 0xbd56c847, - 0x9093425a, 0x28dd9e87, 0x84ef3e08, 0x690a49d6, 0x6a7eff82, 0xabcfe400, - 0x3d3be5ca, 0x381b650c, 0x4b7c8622, 0x3e0246f3, 0xa3561654, 0x9488865c, - 0x3aef1bf2, 0x5e5d68a2, 0xd32f1ddc, 0x51972bf0, 0x177a213b, 0x469375c2, - 0x37640bd0, 0xfc3324c8, 0x07091a09, 0x2d63d3fb, 0x2153f023, 0x48223875, - 0x61a55826, 0x8c136538, 0x49f71d98, 0x84c7d51e, 0x85551a73, 0x13d604c5, - 0xd701a626, 0x87b844ca, 0x741eb29d, 0x2a2c977c, 0xc797ca03, 0x6c4085d7, - 0x2dacf79b, 0x734fa2eb, 0xcc290557, 0xfa1e75e4, 0x06b29a27, 0xbece2a7a, - 0x70a4554b, 0xc935942e, 0xa764bbc1, 0x1fe391d6, 0x7807f0c2, 0x40606ed9, - 0xe5153086, 0xe91d7dd2, 0xed5d3ba9, 0xaa14b64a, 0x83b24dd9, 0xec1ff5cd, - 0xba33ead3, 0xe4ef735c, 0xbc062438, 0xd8bfd523, 0x473d1e04, 0x2007f8a7, - 0xb02903ed, 0x86ea8ada, 0x95ab69cf, 0xfd1f9809, 0x9cb3d8bb, 0x51f45958, - 0x9cdd4276, 0xc245865e, 0x8f0c836b, 0x4ee7dc07, 0xf6368d9d, 0xef2c1dc1, - 0xee56b54b, 0xbd62ce2f, 0xf4916aad, 0xc81cb594, 0x41729f49, 0x24bef0a4, - 0xdef487a9, 0x222e05b8, 0x8d3bf5c6, 0x11b55009, 0xad09d2b3, 0x19db9fd1, - 0xd7427085, 0x33dbfc8b, 0x526b9378, 0x790e1bc8, 0xb2998a00, 0xa5641703, - 0x0676d249, 0x6b9185cc, 0x30e4348f, 0x82c52f65, 0x57c7dc24, 0x489c1ecd, - 0x9fcab02a, 0x56d61117, 0xfe869cac, 0x55fc5140, 0x7fbbb382, 0x9e5afc79, - 0x10047c99, 0xfc9f5984, 0x56587e2d, 0xb98193f0, 0x98fe5e8e, 0x29b15b6b, - 0x9561f055, 0xbb0caa25, 0x1e4ecc15, 0x23f5393b, 0x0845b458, 0xceff67ca, - 0xb099900c, 0x00b1564f, 0x39eef3d1, 0xfcc1bf84, 0xac8893b5, 0x6484bf0e, - 0x91c02ab3, 0x8c0c0c70, 0x686fa8c6, 0xe171bed6, 0xdfae37df, 0xd5a1a4e7, - 0xe3eb49a1, 0x5e6014e0, 0x205b21ac, 0xfd58b3da, 0x2e7c07cd, 0xef2cc85a, - 0xd7587b46, 0xf417847d, 0x8a30cec1, 0x70984f6c, 0xf0b63388, 0xc220c98d, - 0xede62936, 0x92c0a7b3, 0x1ef371e8, 0x2005f7af, 0x91a47265, 0xb0cf5504, - 0xd500aba8, 0xcb5c4bd3, 0x9b3bcbc3, 0xcf6644b5, 0xce9488ef, 0x003fc96e, - 0xaa42222f, 0x4844f3d0, 0x4db89d77, 0x08681aae, 0x662f3a28, 0x761552db, - 0x1df7a17a, 0x93feed9a, 0xcc496a4f, 0xa217cfcd, 0x3ba3c930, 0x268f7e77, - 0x0797b4a1, 0x8bebfc51, 0x068930c4, 0x16c874e2, 0xc242da24, 0xfb229f76, - 0xa0795b02, 0x689fc036, 0x17a73732, 0xd21aec00, 0xac00a692, 0x5b217f18, - 0xae421624, 0x2bc05cc0, 0x48c1db7a, 0x4f4e63b4, 0x1667f04e, 0x34020f94, - 0x972b2555, 0x9a07355b, 0x01665970, 0x7db60c6f, 0x3ad7103b, 0x5c3d09c0, - 0xeea3dada, 0x88c21c10, 0x102436d7, 0x6a3b3400, 0xeb523c4c, 0xfb97d896, - 0x964cb86b, 0xdd878038, 0x0529da4d, 0x0b1468a5, 0x18739ac8, 0xf7f26668, - 0xf64f4471, 0x5c14f5c3, 0x44a081fb, 0x39ac7e37, 0x8a17c26b, 0x868f5e67, - 0x3931978d, 0x6edf7817, 0x4951cc67, 0x943407f3, 0xcc5e748f, 0x2b7ee729, - 0xcbb320f0, 0x11fec8e7, 0xfccfc658, 0x03454354, 0x373aa1ec, 0x1d58fe9a, - 0x064710ae, 0xa88aa0ba, 0xd183a23e, 0x40d150a3, 0xf531b8d1, 0xa7d99f85, - 0x11838cd5, 0xb19e64b3, 0x3d67a5e9, 0xb02c5ac6, 0x99b9b9e8, 0x4c202b7a, - 0x15f261d3, 0xa84c2d0d, 0x50f185a6, 0x33ba41d5, 0x39791013, 0x4baff44e, - 0xeeeeaa1c, 0xe0488314, 0x559ccd2b, 0xa104f445, 0x636f37c4, 0x264d5e3b, - 0x75c17f35, 0x75424131, 0xbb115739, 0x74fe755a, 0x7d3a7aa6, 0x2d8be784, - 0x83ed154a, 0xfc2673d8, 0x44dd4a7f, 0x79056cc8, 0x82cc8831, 0x9d3c1b7c, - 0xe9453bfa, 0x24315694, 0x661f3253, 0x75549f5c, 0xbb2b63ed, 0x67e00d96, - 0xf48966c7, 0x0d7bea56, 0xc25f92ef, 0xa947a79d, 0xde4adf6f, 0xac0f0342, - 0xd3eb246b, 0xa4aa118e, 0x3c3e6a46, 0x457f4441, 0xa50a406f, 0x6c508d9f, - 0xe9ac18e7, 0x1ecdb4ba, 0x39ac7e3a, 0x7fb304fa, 0x6f38f8e8, 0x4aecea6d, - 0x61035e73, 0x81708907, 0xebc07205, 0x90fd7614, 0xb52d217f, 0x6c4de195, - 0x1dd49084, 0x64ee482c, 0x94c7a521, 0x540c09d8, 0x75df8dd5, 0x414131f7, - 0x3698fd76, 0xf784db4f, 0xf8c97a03, 0x048f39b9, 0x3bf4f0bd, 0x8cb50992, - 0x9b58d9ee, 0xe5ab79cc, 0x9a5f6052, 0xbd9591b0, 0xfad2232b, 0x5a632254, - 0x0286e618, 0x8ad3c8f7, 0xe4060176, 0x754c4617, 0x5c10490b, 0x6f7d6fff, - 0x2187b42a, 0x5775095b, 0x02f4c663, 0x5a5dca06, 0xfe4ad4c7, 0x53e19f7d, - 0x59ff46b5, 0xbcc42ba5, 0xfd2f4a97, 0xbed6d905, 0x95629b6b, 0x21a1c0db, - 0xaa10b45d, 0xe6ef6d58, 0x2892cf4d, 0x9fed6c10, 0x1e386bf7, 0x9be0c6e8, - 0x2b2f15ef, 0x19f5ac7b, 0x7aff0e72, 0x31da576f, 0x30252cb4, 0x577960ac, - 0x166e9e5a, 0xa9374a61, 0x71369c96, 0x7ff826ae, 0xe8175326, 0xcabbfd33, - 0x0191190e, 0x699d3c3e, 0x36b40b22, 0xb3950513, 0x9b889bfa, 0xa52a5007, - 0xac290fed, 0x3b4e4a4f, 0xb753d8d6, 0x3c531f22, 0x582f6427, 0xa9cd93a9, - 0x546e39ae, 0x242faad2, 0xd2e0f747, 0x09f6325d, 0x59d48719, 0xad7eb66e, - 0xd5512878, 0x56debf9d, 0x5107e5a5, 0xf1c00aa4, 0x814ccca8, 0x600d90f0, - 0x9be97619, 0x915fa5f2, 0x2b5628dd, 0xa33d5f5a, 0x595df7c1, 0x6966215d, - 0x50ec8337, 0xf1d21372, 0x0ee2eefb, 0xad9e70b7, 0xab0d2fe4, 0xcf277b5d, - 0x62585a2c, 0x835a7844, 0x74b1fa6b, 0x49baffd5, 0x2ea9c864, 0x129311a8, - 0xbdfa1867, 0x83ca5997, 0x9d1db719, 0x84bb79e6, 0x9e3f99f2, 0x313f6101, - 0x1b99245b, 0xd15d8fb2, 0xcef90f81, 0x2945268d, 0xdbbcf573, 0xb1021886, - 0x9ee7ec1d, 0x1cf824f7, 0x7eaa2e32, 0x69c0a2b5, 0x7494419c, 0xe253d7d3, - 0x48da3d12, 0x45b8b571, 0xdb4d147a, 0xd82d8dde, 0x265d10a2, 0xb0a6eb9a, - 0x7e1c93a6, 0x36fe2f46, 0xdcad6b00, 0x05439191, 0xb0ce5484, 0x61d1c309, - 0x8da62a03, 0x06d0fe2f, 0xbac6dd3c, 0xca2006f3, 0x8321b1af, 0x0411a6f3, - 0xe8918eac, 0x21a2c152, 0x91c0d54f, 0x6aaa14fa, 0xdd22a440, 0x88cb2075, - 0x7a4eb813, 0x67afa071, 0xd8d98c9c, 0x31f10d47, 0x6ff1a8a8, 0x2faaf0a1, - 0x48a221bb, 0x3be6948b, 0xaa79e79b, 0x0ea7278c, 0x7a3857ef, 0x49b7fe55, - 0xd51cb931, 0x041c018d, 0x00b90501, 0x45ea7881, 0x8fc1dbcf, 0xb80b32a9, - 0xabacd2e9, 0x677bdc40, 0xecace542, 0x6d6514eb, 0x31c09ff7, 0x5e6c1abd, - 0x1c391d0f, 0x0e9d77f1, 0x7119392d, 0x6be9b0ba, 0x6194fa77, 0x45e62148, - 0x42234af2, 0xc3239d66, 0x939cbdbc, 0x56200d9c, 0x6b275208, 0x001a61f3, - 0xccc2a546, 0x4b722be0, 0xee25f2b7, 0x6d86cf9e, 0xaa6be0cd, 0x4dcda7b6, - 0x78d4aa13, 0x36ea7ad9, 0x3f29d700, 0xdeea2d84, 0x6a6af5bd, 0x18afb81c, - 0xd8e4e73c, 0x8aa708ba, 0x658b94d9, 0xa676478c, 0xcfa10c22, 0x25593c74, - 0x8d962235, 0x5f980270, 0x3df6ebc0, 0x8e7d92fa, 0xc3ee55e1, 0xd5f72447, - 0x02b0fa95, 0x52b0b520, 0x70d2c11f, 0x3a6fdd6c, 0x193aa698, 0x5496f7d5, - 0x4208931b, 0x7a4106ec, 0x83e86840, 0xf49b6f8c, 0xba3d9a51, 0x55f54ddd, - 0x2de51372, 0x9afb571b, 0x3ab35406, 0xad64ff1f, 0xc77764fe, 0x7f864466, - 0x416d9cd4, 0xa2489278, 0xe30b86e4, 0x0b5231b6, 0xba67aed6, 0xe5ab2467, - 0x60028b90, 0x1d9e20c6, 0x2a7c692a, 0x6b691cdb, 0x9e51f817, 0x9b763dec, - 0x3d29323f, 0xcfe12b68, 0x754b459b, 0xa2238047, 0xd9c55514, 0x6bdcffc1, - 0x693e6340, 0x82383fe7, 0x1916ea5f, 0xec7bcd59, 0x72de165a, 0xe79a1617, - 0x8ec86234, 0xa8f0d284, 0x20c90226, 0x7bf98884, 0x28a58331, 0x3ec3fa6e, - 0x4ce0895b, 0xc353b4d0, 0x33ef064f, 0x21e5e210, 0xc8bb589d, 0xe85dcab2, - 0xac65829f, 0xa7bf92d0, 0x05a6174d, 0x25a50c2e, 0xe5c78777, 0x3d75021f, - 0x4baa9c98, 0x23bdc884, 0x9653bbd7, 0xbadce7f5, 0xc283a484, 0xc040df2e, - 0x9370a841, 0x2f316022, 0x36eed231, 0xac2cbc0c, 0x13c0a49b, 0xcdd12997, - 0x07fe91b2, 0xcd7eabcd, 0x2c01271d, 0x18432df8, 0x599c6bc7, 0x75e93d5a, - 0xb67a6ee2, 0x8e738e16, 0xff9073fd, 0xaf77026a, 0xf86ea2fc, 0x91509ea3, - 0x33a78dc6, 0x4f79234a, 0x3a7535bc, 0x3539fcb1, 0x3103ee52, 0x4f6f1e69, - 0x6bb3ebbc, 0x4cb77555, 0x8dd1e999, 0x2ade439d, 0x11521fae, 0xb94d2545, - 0x8dde9abd, 0x1909393f, 0xb792a23d, 0x749c455b, 0xb5b60f2c, 0x380459ce, - 0x0dad5820, 0xb130845b, 0x291cbd52, 0xde9a5bb7, 0x51def961, 0x515b6408, - 0xca6e823e, 0x382e6e74, 0xeebe3d71, 0x4c8f0c6a, 0xe676dcea, 0x14e1dc7c, - 0x6f7fc634, 0xcf85a943, 0xd39ea96e, 0x136e7c93, 0x7164b304, 0xf32f1333, - 0x35c34034, 0xde39d721, 0x91a87439, 0xc410111f, 0x29f17aac, 0x1316a6ff, - 0x12f194ee, 0x420b9499, 0xf72db0dc, 0x690b9f93, 0x17d14bb2, 0x8f931ab8, - 0x217500bc, 0x875413f8, 0x98b2e43d, 0xc51f9571, 0x54cebdca, 0x0719cc79, - 0xf3c7080d, 0xe4286771, 0xa3eab3cd, 0x4a6b00e0, 0x11cf0759, 0x7e897379, - 0x5b32876c, 0x5e8cd4f6, 0x0cedfa64, 0x919ac2c7, 0xb214f3b3, 0x0e89c38c, - 0xf0c43a39, 0xeae10522, 0x835bce06, 0x9eec43c2, 0xea26a9d6, 0x69531821, - 0x6725b24a, 0xda81b0e2, 0xd5b4ae33, 0x080f99fb, 0x15a83daf, 0x29dfc720, - 0x91e1900f, 0x28163d58, 0x83d107a2, 0x4eac149a, 0x9f71da18, 0x61d5c4fa, - 0xe3ab2a5f, 0xc7b0d63f, 0xb3cc752a, 0x61ebcfb6, 0x26ffb52a, 0xed789e3f, - 0xaa3bc958, 0x455a8788, 0xc9c082a9, 0x0a1bef0e, 0xc29a5a7e, 0x150d4735, - 0x943809e0, 0x69215510, 0xef0b0da9, 0x3b4e9fb3, 0xd8b5d04c, 0xc7a023a8, - 0xb0d50288, 0x64821375, 0xc260e8cf, 0x8496bd2c, 0xff4f5435, 0x0fb5560c, - 0x7cd74a52, 0x93589c80, 0x88975c47, 0x83bda89d, 0x8bcc4296, 0x01b82c21, - 0xfd821dbf, 0x26520b47, 0x04983e19, 0xd3e1ca27, 0x782c580f, 0x326ff573, - 0xc157bcc7, 0x4f5e6b84, 0x44ebfbfb, 0xda26d9d8, 0x6cd9d08e, 0x1719f1d8, - 0x715c0487, 0x2c2d3c92, 0x53faaba9, 0xbc836146, 0x510c92d6, 0xe089f82a, - 0x4680171f, 0x369f00de, 0x70ec2331, 0x0e253d55, 0xdafb9717, 0xe5dd922d, - 0x95915d21, 0xa0202f96, 0xa161cc47, 0xeacfa6f1, 0xed5e9189, 0xdab87684, - 0xa4b76d4a, 0xfa704897, 0x631f10ba, 0xd39da8f9, 0x5db4c0e4, 0x16fde42a, - 0x2dff7580, 0xb56fec7e, 0xc3ffb370, 0x8e6f36bc, 0x6097d459, 0x514d5d36, - 0xa5a737e2, 0x3977b9b3, 0xfd31a0ca, 0x903368db, 0xe8370d61, 0x98109520, - 0xade23cac, 0x99f82e04, 0x41de7ea3, 0x84a1c295, 0x09191be0, 0x30930d02, - 0x1c9fa44a, 0xc406b6d7, 0xeedca152, 0x6149809c, 0xb0099ef4, 0xc5f653a5, - 0x4c10790d, 0x7303286c -}; diff --git a/dep/libmpq/libmpq/explode.c b/dep/libmpq/libmpq/explode.c deleted file mode 100644 index 2d778d25c39..00000000000 --- a/dep/libmpq/libmpq/explode.c +++ /dev/null @@ -1,602 +0,0 @@ -/* - * explode.c -- explode function of pkware data compression library. - * - * Copyright (c) 2003-2008 Maik Broemme - * - * This source was adepted from the C++ version of pkware.cpp included - * in stormlib. The C++ version belongs to the following authors: - * - * Ladislav Zezula - * - * 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; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; 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. - */ - -/* generic includes. */ -#include - -/* libmpq main includes. */ -#include "mpq.h" - -/* libmpq generic includes. */ -#include "explode.h" - -/* tables used for data extraction. */ -static const uint8_t pkzip_dist_bits[] = { - 0x02, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, - 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, - 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 -}; - -/* tables used for data extraction. */ -static const uint8_t pkzip_dist_code[] = { - 0x03, 0x0D, 0x05, 0x19, 0x09, 0x11, 0x01, 0x3E, 0x1E, 0x2E, 0x0E, 0x36, 0x16, 0x26, 0x06, 0x3A, - 0x1A, 0x2A, 0x0A, 0x32, 0x12, 0x22, 0x42, 0x02, 0x7C, 0x3C, 0x5C, 0x1C, 0x6C, 0x2C, 0x4C, 0x0C, - 0x74, 0x34, 0x54, 0x14, 0x64, 0x24, 0x44, 0x04, 0x78, 0x38, 0x58, 0x18, 0x68, 0x28, 0x48, 0x08, - 0xF0, 0x70, 0xB0, 0x30, 0xD0, 0x50, 0x90, 0x10, 0xE0, 0x60, 0xA0, 0x20, 0xC0, 0x40, 0x80, 0x00 -}; - -/* tables used for data extraction. */ -static const uint8_t pkzip_clen_bits[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 -}; - -/* tables used for data extraction. */ -static const uint16_t pkzip_len_base[] = { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x000A, 0x000E, 0x0016, 0x0026, 0x0046, 0x0086, 0x0106 -}; - -/* tables used for data extraction. */ -static const uint8_t pkzip_slen_bits[] = { - 0x03, 0x02, 0x03, 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, 0x06, 0x07, 0x07 -}; - -/* tables used for data extraction. */ -static const uint8_t pkzip_len_code[] = { - 0x05, 0x03, 0x01, 0x06, 0x0A, 0x02, 0x0C, 0x14, 0x04, 0x18, 0x08, 0x30, 0x10, 0x20, 0x40, 0x00 -}; - -/* tables used for data extraction. */ -static const uint8_t pkzip_bits_asc[] = { - 0x0B, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x08, 0x07, 0x0C, 0x0C, 0x07, 0x0C, 0x0C, - 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0D, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, - 0x04, 0x0A, 0x08, 0x0C, 0x0A, 0x0C, 0x0A, 0x08, 0x07, 0x07, 0x08, 0x09, 0x07, 0x06, 0x07, 0x08, - 0x07, 0x06, 0x07, 0x07, 0x07, 0x07, 0x08, 0x07, 0x07, 0x08, 0x08, 0x0C, 0x0B, 0x07, 0x09, 0x0B, - 0x0C, 0x06, 0x07, 0x06, 0x06, 0x05, 0x07, 0x08, 0x08, 0x06, 0x0B, 0x09, 0x06, 0x07, 0x06, 0x06, - 0x07, 0x0B, 0x06, 0x06, 0x06, 0x07, 0x09, 0x08, 0x09, 0x09, 0x0B, 0x08, 0x0B, 0x09, 0x0C, 0x08, - 0x0C, 0x05, 0x06, 0x06, 0x06, 0x05, 0x06, 0x06, 0x06, 0x05, 0x0B, 0x07, 0x05, 0x06, 0x05, 0x05, - 0x06, 0x0A, 0x05, 0x05, 0x05, 0x05, 0x08, 0x07, 0x08, 0x08, 0x0A, 0x0B, 0x0B, 0x0C, 0x0C, 0x0C, - 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, - 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, - 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, - 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, - 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, - 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, - 0x0D, 0x0C, 0x0D, 0x0D, 0x0D, 0x0C, 0x0D, 0x0D, 0x0D, 0x0C, 0x0D, 0x0D, 0x0D, 0x0D, 0x0C, 0x0D, - 0x0D, 0x0D, 0x0C, 0x0C, 0x0C, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D -}; - -/* tables used for data extraction. */ -static const uint16_t pkzip_code_asc[] = { - 0x0490, 0x0FE0, 0x07E0, 0x0BE0, 0x03E0, 0x0DE0, 0x05E0, 0x09E0, - 0x01E0, 0x00B8, 0x0062, 0x0EE0, 0x06E0, 0x0022, 0x0AE0, 0x02E0, - 0x0CE0, 0x04E0, 0x08E0, 0x00E0, 0x0F60, 0x0760, 0x0B60, 0x0360, - 0x0D60, 0x0560, 0x1240, 0x0960, 0x0160, 0x0E60, 0x0660, 0x0A60, - 0x000F, 0x0250, 0x0038, 0x0260, 0x0050, 0x0C60, 0x0390, 0x00D8, - 0x0042, 0x0002, 0x0058, 0x01B0, 0x007C, 0x0029, 0x003C, 0x0098, - 0x005C, 0x0009, 0x001C, 0x006C, 0x002C, 0x004C, 0x0018, 0x000C, - 0x0074, 0x00E8, 0x0068, 0x0460, 0x0090, 0x0034, 0x00B0, 0x0710, - 0x0860, 0x0031, 0x0054, 0x0011, 0x0021, 0x0017, 0x0014, 0x00A8, - 0x0028, 0x0001, 0x0310, 0x0130, 0x003E, 0x0064, 0x001E, 0x002E, - 0x0024, 0x0510, 0x000E, 0x0036, 0x0016, 0x0044, 0x0030, 0x00C8, - 0x01D0, 0x00D0, 0x0110, 0x0048, 0x0610, 0x0150, 0x0060, 0x0088, - 0x0FA0, 0x0007, 0x0026, 0x0006, 0x003A, 0x001B, 0x001A, 0x002A, - 0x000A, 0x000B, 0x0210, 0x0004, 0x0013, 0x0032, 0x0003, 0x001D, - 0x0012, 0x0190, 0x000D, 0x0015, 0x0005, 0x0019, 0x0008, 0x0078, - 0x00F0, 0x0070, 0x0290, 0x0410, 0x0010, 0x07A0, 0x0BA0, 0x03A0, - 0x0240, 0x1C40, 0x0C40, 0x1440, 0x0440, 0x1840, 0x0840, 0x1040, - 0x0040, 0x1F80, 0x0F80, 0x1780, 0x0780, 0x1B80, 0x0B80, 0x1380, - 0x0380, 0x1D80, 0x0D80, 0x1580, 0x0580, 0x1980, 0x0980, 0x1180, - 0x0180, 0x1E80, 0x0E80, 0x1680, 0x0680, 0x1A80, 0x0A80, 0x1280, - 0x0280, 0x1C80, 0x0C80, 0x1480, 0x0480, 0x1880, 0x0880, 0x1080, - 0x0080, 0x1F00, 0x0F00, 0x1700, 0x0700, 0x1B00, 0x0B00, 0x1300, - 0x0DA0, 0x05A0, 0x09A0, 0x01A0, 0x0EA0, 0x06A0, 0x0AA0, 0x02A0, - 0x0CA0, 0x04A0, 0x08A0, 0x00A0, 0x0F20, 0x0720, 0x0B20, 0x0320, - 0x0D20, 0x0520, 0x0920, 0x0120, 0x0E20, 0x0620, 0x0A20, 0x0220, - 0x0C20, 0x0420, 0x0820, 0x0020, 0x0FC0, 0x07C0, 0x0BC0, 0x03C0, - 0x0DC0, 0x05C0, 0x09C0, 0x01C0, 0x0EC0, 0x06C0, 0x0AC0, 0x02C0, - 0x0CC0, 0x04C0, 0x08C0, 0x00C0, 0x0F40, 0x0740, 0x0B40, 0x0340, - 0x0300, 0x0D40, 0x1D00, 0x0D00, 0x1500, 0x0540, 0x0500, 0x1900, - 0x0900, 0x0940, 0x1100, 0x0100, 0x1E00, 0x0E00, 0x0140, 0x1600, - 0x0600, 0x1A00, 0x0E40, 0x0640, 0x0A40, 0x0A00, 0x1200, 0x0200, - 0x1C00, 0x0C00, 0x1400, 0x0400, 0x1800, 0x0800, 0x1000, 0x0000 -}; - -/* local unused variables. */ -char pkware_copyright[] = "PKWARE Data Compression Library for Win32\r\n" - "Copyright 1989-1995 PKWARE Inc. All Rights Reserved\r\n" - "Patent No. 5,051,745\r\n" - "PKWARE Data Compression Library Reg. U.S. Pat. and Tm. Off.\r\n" - "Version 1.11\r\n"; - -/* skips given number of bits. */ -static int32_t skip_bit(pkzip_cmp_s *mpq_pkzip, uint32_t bits) { - - /* check if number of bits required is less than number of bits in the buffer. */ - if (bits <= mpq_pkzip->extra_bits) { - mpq_pkzip->extra_bits -= bits; - mpq_pkzip->bit_buf >>= bits; - return 0; - } - - /* load input buffer if necessary. */ - mpq_pkzip->bit_buf >>= mpq_pkzip->extra_bits; - if (mpq_pkzip->in_pos == mpq_pkzip->in_bytes) { - mpq_pkzip->in_pos = sizeof(mpq_pkzip->in_buf); - if ((mpq_pkzip->in_bytes = mpq_pkzip->read_buf((char *)mpq_pkzip->in_buf, &mpq_pkzip->in_pos, mpq_pkzip->param)) == 0) { - return 1; - } - mpq_pkzip->in_pos = 0; - } - - /* update bit buffer. */ - mpq_pkzip->bit_buf |= (mpq_pkzip->in_buf[mpq_pkzip->in_pos++] << 8); - mpq_pkzip->bit_buf >>= (bits - mpq_pkzip->extra_bits); - mpq_pkzip->extra_bits = (mpq_pkzip->extra_bits - bits) + 8; - - /* if no error was found, return zero. */ - return 0; -} - -/* this function generate the decode tables used for decryption. */ -static void generate_tables_decode(int32_t count, uint8_t *bits, const uint8_t *code, uint8_t *buf2) { - - /* some common variables. */ - int32_t i; - - /* EBX - count */ - for (i = count-1; i >= 0; i--) { - - /* some common variables. */ - uint32_t idx1 = code[i]; - uint32_t idx2 = 1 << bits[i]; - - /* loop until table is ready. */ - do { - buf2[idx1] = (uint8_t)i; - idx1 += idx2; - } while (idx1 < 0x100); - } -} - -/* this function generate the tables for ascii decompression. */ -static void generate_tables_ascii(pkzip_cmp_s *mpq_pkzip) { - - /* some common variables. */ - const uint16_t *code_asc = &pkzip_code_asc[0xFF]; - uint32_t acc; - uint32_t add; - uint16_t count; - - /* loop through ascii table. */ - for (count = 0x00FF; code_asc >= pkzip_code_asc; code_asc--, count--) { - uint8_t *bits_asc = mpq_pkzip->bits_asc + count; - uint8_t bits_tmp = *bits_asc; - - /* check if byte is finished. */ - if (bits_tmp <= 8) { - add = (1 << bits_tmp); - acc = *code_asc; - do { - mpq_pkzip->offs_2c34[acc] = (uint8_t)count; - acc += add; - } while (acc < 0x100); - } else { - if ((acc = (*code_asc & 0xFF)) != 0) { - mpq_pkzip->offs_2c34[acc] = 0xFF; - if (*code_asc & 0x3F) { - - /* decrease bit by four. */ - bits_tmp -= 4; - *bits_asc = bits_tmp; - add = (1 << bits_tmp); - acc = *code_asc >> 4; - do { - mpq_pkzip->offs_2d34[acc] = (uint8_t)count; - acc += add; - } while (acc < 0x100); - } else { - - /* decrease bit by six. */ - bits_tmp -= 6; - *bits_asc = bits_tmp; - add = (1 << bits_tmp); - acc = *code_asc >> 6; - do { - mpq_pkzip->offs_2e34[acc] = (uint8_t)count; - acc += add; - } while (acc < 0x80); - } - } else { - - /* decrease bit by eight. (one byte) */ - bits_tmp -= 8; - *bits_asc = bits_tmp; - add = (1 << bits_tmp); - acc = *code_asc >> 8; - do { - mpq_pkzip->offs_2eb4[acc] = (uint8_t)count; - acc += add; - } while (acc < 0x100); - } - } - } -} - -/* - * decompress the imploded data using coded literals. - * - * returns: 0x000 - 0x0FF : one byte from compressed file. - * 0x100 - 0x305 : copy previous block. (0x100 = 1 byte) - * 0x306 : out of buffer? - */ -static uint32_t decode_literal(pkzip_cmp_s *mpq_pkzip) { - - /* number of bits to skip. */ - uint32_t bits; - - /* position in buffers. */ - uint32_t value; - - /* check if bit the current buffer is set, if not return the next byte. */ - if (mpq_pkzip->bit_buf & 1) { - - /* skip current bit in the buffer. */ - if (skip_bit(mpq_pkzip, 1)) { - return 0x306; - } - - /* the next bits are position in buffers. */ - value = mpq_pkzip->pos2[(mpq_pkzip->bit_buf & 0xFF)]; - - /* get number of bits to skip. */ - if (skip_bit(mpq_pkzip, mpq_pkzip->slen_bits[value])) { - return 0x306; - } - - /* check bits. */ - if ((bits = mpq_pkzip->clen_bits[value]) != 0) { - - /* some common variables. */ - uint32_t val2 = mpq_pkzip->bit_buf & ((1 << bits) - 1); - - /* check if we should skip one bit. */ - if (skip_bit(mpq_pkzip, bits)) { - - /* check position if we should skip the bit. */ - if ((value + val2) != 0x10E) { - return 0x306; - } - } - - /* fill values. */ - value = mpq_pkzip->len_base[value] + val2; - } - - /* return number of bytes to repeat. */ - return value + 0x100; - } - - /* skip one bit. */ - if (skip_bit(mpq_pkzip, 1)) { - return 0x306; - } - - /* check the binary compression type, read 8 bits and return them as one byte. */ - if (mpq_pkzip->cmp_type == LIBMPQ_PKZIP_CMP_BINARY) { - - /* fill values. */ - value = mpq_pkzip->bit_buf & 0xFF; - - /* check if we should skip one bit. */ - if (skip_bit(mpq_pkzip, 8)) { - return 0x306; - } - - /* return value from bit buffer. */ - return value; - } - - /* check if ascii compression is used. */ - if (mpq_pkzip->bit_buf & 0xFF) { - - /* fill values. */ - value = mpq_pkzip->offs_2c34[mpq_pkzip->bit_buf & 0xFF]; - - /* check value. */ - if (value == 0xFF) { - if (mpq_pkzip->bit_buf & 0x3F) { - - /* check if four bits are in bit buffer for skipping. */ - if (skip_bit(mpq_pkzip, 4)) { - return 0x306; - } - - /* fill values. */ - value = mpq_pkzip->offs_2d34[mpq_pkzip->bit_buf & 0xFF]; - } else { - - /* check if six bits are in bit buffer for skipping. */ - if (skip_bit(mpq_pkzip, 6)) { - return 0x306; - } - - /* fill values. */ - value = mpq_pkzip->offs_2e34[mpq_pkzip->bit_buf & 0x7F]; - } - } - } else { - - /* check if eight bits are in bit buffer for skipping. */ - if (skip_bit(mpq_pkzip, 8)) { - return 0x306; - } - - /* fill values. */ - value = mpq_pkzip->offs_2eb4[mpq_pkzip->bit_buf & 0xFF]; - } - - /* return out of buffer error (0x306) or position in buffer. */ - return skip_bit(mpq_pkzip, mpq_pkzip->bits_asc[value]) ? 0x306 : value; -} - -/* this function retrieves the number of bytes to move back. */ -static uint32_t decode_distance(pkzip_cmp_s *mpq_pkzip, uint32_t length) { - - /* some common variables. */ - uint32_t pos = mpq_pkzip->pos1[(mpq_pkzip->bit_buf & 0xFF)]; - - /* number of bits to skip. */ - uint32_t skip = mpq_pkzip->dist_bits[pos]; - - /* skip the appropriate number of bits. */ - if (skip_bit(mpq_pkzip, skip) == 1) { - return 0; - } - - /* check if length is two. */ - if (length == 2) { - pos = (pos << 2) | (mpq_pkzip->bit_buf & 0x03); - - /* skip the bits. */ - if (skip_bit(mpq_pkzip, 2) == 1) { - return 0; - } - } else { - pos = (pos << mpq_pkzip->dsize_bits) | (mpq_pkzip->bit_buf & mpq_pkzip->dsize_mask); - - /* skip the bits */ - if (skip_bit(mpq_pkzip, mpq_pkzip->dsize_bits) == 1) { - return 0; - } - } - - /* return the bytes to move back. */ - return pos + 1; -} - -/* - * function loads data from the input buffer used by mpq_pkzip - * "implode" and "explode" function as user defined callback and - * returns number of bytes loaded. - * - * char *buf - pointer to a buffer where to store loaded data. - * uint32_t *size - maximum number of bytes to read. - * void *param - custom pointer, parameter of implode/explode. - */ -static uint32_t data_read_input(char *buf, uint32_t *size, void *param) { - - /* some common variables. */ - pkzip_data_s *info = (pkzip_data_s *)param; - uint32_t max_avail = (info->in_bytes - info->in_pos); - uint32_t to_read = *size; - - /* check the case when not enough data available. */ - if (to_read > max_avail) { - to_read = max_avail; - } - - /* load data and increment offsets. */ - memcpy(buf, info->in_buf + info->in_pos, to_read); - info->in_pos += to_read; - - /* return bytes read. */ - return to_read; -} - -/* - * function for store output data used by mpq_pkzip "implode" and - * "explode" as userdefined callback. - * - * char *buf - pointer to data to be written. - * uint32_t *size - number of bytes to write. - * void *param - custom pointer, parameter of implode/explode. - */ -static void data_write_output(char *buf, uint32_t *size, void *param) { - - /* some common variables. */ - pkzip_data_s *info = (pkzip_data_s *)param; - uint32_t max_write = (info->max_out - info->out_pos); - uint32_t to_write = *size; - - /* check the case when not enough space in the output buffer. */ - if (to_write > max_write) { - to_write = max_write; - } - - /* write output data and increments offsets. */ - memcpy(info->out_buf + info->out_pos, buf, to_write); - info->out_pos += to_write; -} - -/* this function extract the data from input stream. */ -static uint32_t expand(pkzip_cmp_s *mpq_pkzip) { - - /* number of bytes to copy. */ - uint32_t copy_bytes; - - /* one byte from compressed file. */ - uint32_t one_byte; - - /* some common variables. */ - uint32_t result; - - /* initialize output buffer position. */ - mpq_pkzip->out_pos = 0x1000; - - /* check if end of data or error, so terminate decompress. */ - while ((result = one_byte = decode_literal(mpq_pkzip)) < 0x305) { - - /* check if one byte is greater than 0x100, which means 'repeat n - 0xFE bytes'. */ - if (one_byte >= 0x100) { - - /* ECX */ - uint8_t *source; - - /* EDX */ - uint8_t *target; - - /* some common variables. */ - uint32_t copy_length = one_byte - 0xFE; - uint32_t move_back; - - /* get length of data to copy. */ - if ((move_back = decode_distance(mpq_pkzip, copy_length)) == 0) { - result = 0x306; - break; - } - - /* target and source pointer. */ - target = &mpq_pkzip->out_buf[mpq_pkzip->out_pos]; - source = target - move_back; - mpq_pkzip->out_pos += copy_length; - - /* copy until nothing left. */ - while (copy_length-- > 0) { - *target++ = *source++; - } - } else { - - /* byte is 0x100 great, so add one byte. */ - mpq_pkzip->out_buf[mpq_pkzip->out_pos++] = (uint8_t)one_byte; - } - - /* check if number of extracted bytes has reached 1/2 of output buffer, so flush output buffer. */ - if (mpq_pkzip->out_pos >= 0x2000) { - - /* copy decompressed data into user buffer. */ - copy_bytes = 0x1000; - mpq_pkzip->write_buf((char *)&mpq_pkzip->out_buf[0x1000], ©_bytes, mpq_pkzip->param); - - /* check if there are some data left, keep them alive. */ - memcpy(mpq_pkzip->out_buf, &mpq_pkzip->out_buf[0x1000], mpq_pkzip->out_pos - 0x1000); - mpq_pkzip->out_pos -= 0x1000; - } - } - - /* copy the rest. */ - copy_bytes = mpq_pkzip->out_pos - 0x1000; - mpq_pkzip->write_buf((char *)&mpq_pkzip->out_buf[0x1000], ©_bytes, mpq_pkzip->param); - - /* return copied bytes. */ - return result; -} - -/* this function explode the data stream. */ -uint32_t libmpq__do_decompress_pkzip(uint8_t *work_buf, void *param) { - - /* some common variables. */ - pkzip_cmp_s *mpq_pkzip = (pkzip_cmp_s *)work_buf; - - /* set the whole work buffer to zeros. */ - memset(mpq_pkzip, 0, sizeof(pkzip_cmp_s)); - - /* initialize work struct and load compressed data. */ - mpq_pkzip->read_buf = data_read_input; - mpq_pkzip->write_buf = data_write_output; - mpq_pkzip->param = param; - mpq_pkzip->in_pos = sizeof(mpq_pkzip->in_buf); - mpq_pkzip->in_bytes = mpq_pkzip->read_buf((char *)mpq_pkzip->in_buf, &mpq_pkzip->in_pos, mpq_pkzip->param); - - /* check if we have pkzip data. */ - if (mpq_pkzip->in_bytes <= 4) { - return LIBMPQ_PKZIP_CMP_BAD_DATA; - } - - /* get the compression type. */ - mpq_pkzip->cmp_type = mpq_pkzip->in_buf[0]; - - /* get the dictionary size. */ - mpq_pkzip->dsize_bits = mpq_pkzip->in_buf[1]; - - /* initialize 16-bit bit buffer. */ - mpq_pkzip->bit_buf = mpq_pkzip->in_buf[2]; - - /* extra (over 8) bits. */ - mpq_pkzip->extra_bits = 0; - - /* position in input buffer. */ - mpq_pkzip->in_pos = 3; - - /* check if valid dictionary size. */ - if (4 > mpq_pkzip->dsize_bits || mpq_pkzip->dsize_bits > 6) { - return LIBMPQ_PKZIP_CMP_INV_DICTSIZE; - } - - /* shifted by 'sar' instruction. */ - mpq_pkzip->dsize_mask = 0xFFFF >> (0x10 - mpq_pkzip->dsize_bits); - - /* check if we are using binary compression. */ - if (mpq_pkzip->cmp_type != LIBMPQ_PKZIP_CMP_BINARY) { - - /* check if we are using ascii compression. */ - if (mpq_pkzip->cmp_type != LIBMPQ_PKZIP_CMP_ASCII) { - return LIBMPQ_PKZIP_CMP_INV_MODE; - } - - /* create ascii buffer. */ - memcpy(mpq_pkzip->bits_asc, pkzip_bits_asc, sizeof(mpq_pkzip->bits_asc)); - generate_tables_ascii(mpq_pkzip); - } - - /* create the tables for decode. */ - memcpy(mpq_pkzip->slen_bits, pkzip_slen_bits, sizeof(mpq_pkzip->slen_bits)); - generate_tables_decode(0x10, mpq_pkzip->slen_bits, pkzip_len_code, mpq_pkzip->pos2); - - /* create the tables for decode. */ - memcpy(mpq_pkzip->clen_bits, pkzip_clen_bits, sizeof(mpq_pkzip->clen_bits)); - memcpy(mpq_pkzip->len_base, pkzip_len_base, sizeof(mpq_pkzip->len_base)); - memcpy(mpq_pkzip->dist_bits, pkzip_dist_bits, sizeof(mpq_pkzip->dist_bits)); - generate_tables_decode(0x40, mpq_pkzip->dist_bits, pkzip_dist_code, mpq_pkzip->pos1); - - /* check if data extraction works. */ - if (expand(mpq_pkzip) != 0x306) { - return LIBMPQ_PKZIP_CMP_NO_ERROR; - } - - /* something failed, so return error. */ - return LIBMPQ_PKZIP_CMP_ABORT; -} diff --git a/dep/libmpq/libmpq/explode.h b/dep/libmpq/libmpq/explode.h deleted file mode 100644 index 1d14dfc0e0a..00000000000 --- a/dep/libmpq/libmpq/explode.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - * explode.h -- header file for pkware data decompression library - * used by mpq-tools. - * - * Copyright (c) 2003-2008 Maik Broemme - * - * This source was adepted from the C++ version of pklib.h included - * in stormlib. The C++ version belongs to the following authors: - * - * Ladislav Zezula - * - * 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; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; 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 _EXPLODE_H -#define _EXPLODE_H - -/* define compression constants and return values. */ -#define LIBMPQ_PKZIP_CMP_BINARY 0 /* binary compression. */ -#define LIBMPQ_PKZIP_CMP_ASCII 1 /* ascii compression. */ -#define LIBMPQ_PKZIP_CMP_NO_ERROR 0 -#define LIBMPQ_PKZIP_CMP_INV_DICTSIZE 1 -#define LIBMPQ_PKZIP_CMP_INV_MODE 2 -#define LIBMPQ_PKZIP_CMP_BAD_DATA 3 -#define LIBMPQ_PKZIP_CMP_ABORT 4 - -#include "pack_begin.h" -/* compression structure. */ -typedef struct { - uint32_t offs0000; /* 0000 - start. */ - uint32_t cmp_type; /* 0004 - compression type (binary or ascii). */ - uint32_t out_pos; /* 0008 - position in output buffer. */ - uint32_t dsize_bits; /* 000C - dict size (4, 5, 6 for 0x400, 0x800, 0x1000). */ - uint32_t dsize_mask; /* 0010 - dict size bitmask (0x0F, 0x1F, 0x3F for 0x400, 0x800, 0x1000). */ - uint32_t bit_buf; /* 0014 - 16-bit buffer for processing input data. */ - uint32_t extra_bits; /* 0018 - number of extra (above 8) bits in bit buffer. */ - uint32_t in_pos; /* 001C - position in in_buf. */ - uint32_t in_bytes; /* 0020 - number of bytes in input buffer. */ - void *param; /* 0024 - custom parameter. */ - uint32_t (*read_buf)(char *buf, uint32_t *size, void *param); /* 0028 offset.*/ - void (*write_buf)(char *buf, uint32_t *size, void *param); /* 002C offset. */ - uint8_t out_buf[0x2000]; /* 0030 - output circle buffer, starting position is 0x1000. */ - uint8_t offs_2030[0x204]; /* 2030 - whats that? */ - uint8_t in_buf[0x800]; /* 2234 - buffer for data to be decompressed. */ - uint8_t pos1[0x100]; /* 2A34 - positions in buffers. */ - uint8_t pos2[0x100]; /* 2B34 - positions in buffers. */ - uint8_t offs_2c34[0x100]; /* 2C34 - buffer. */ - uint8_t offs_2d34[0x100]; /* 2D34 - buffer. */ - uint8_t offs_2e34[0x80]; /* 2EB4 - buffer. */ - uint8_t offs_2eb4[0x100]; /* 2EB4 - buffer. */ - uint8_t bits_asc[0x100]; /* 2FB4 - buffer. */ - uint8_t dist_bits[0x40]; /* 30B4 - numbers of bytes to skip copied block length. */ - uint8_t slen_bits[0x10]; /* 30F4 - numbers of bits for skip copied block length. */ - uint8_t clen_bits[0x10]; /* 3104 - number of valid bits for copied block. */ - uint16_t len_base[0x10]; /* 3114 - buffer. */ -} PACK_STRUCT pkzip_cmp_s; -#include "pack_end.h" - -/* data structure. */ -typedef struct { - uint8_t *in_buf; /* pointer to input data buffer. */ - uint32_t in_pos; /* current offset in input data buffer. */ - int32_t in_bytes; /* number of bytes in the input buffer. */ - uint8_t *out_buf; /* pointer to output data buffer. */ - uint32_t out_pos; /* position in the output buffer. */ - int32_t max_out; /* maximum number of bytes in the output buffer. */ -} pkzip_data_s; - -/* decompress the stream using pkzip compression. */ -uint32_t libmpq__do_decompress_pkzip( - uint8_t *work_buf, - void *param -); - -#endif /* _EXPLODE_H */ diff --git a/dep/libmpq/libmpq/extract.c b/dep/libmpq/libmpq/extract.c deleted file mode 100644 index 11de1071683..00000000000 --- a/dep/libmpq/libmpq/extract.c +++ /dev/null @@ -1,361 +0,0 @@ -/* - * extract.c -- global extracting function for all known file compressions - * in a mpq archive. - * - * Copyright (c) 2003-2008 Maik Broemme - * - * 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; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; 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. - */ - -/* generic includes. */ -#include -#include - -/* zlib includes. */ -#include -#include - -/* libmpq main includes. */ -#include "mpq.h" - -/* libmpq generic includes. */ -#include "explode.h" -#include "extract.h" -#include "huffman.h" -#include "wave.h" - -/* table with decompression bits and functions. */ -static decompress_table_s dcmp_table[] = { - {LIBMPQ_COMPRESSION_HUFFMAN, libmpq__decompress_huffman}, /* decompression using huffman trees. */ - {LIBMPQ_COMPRESSION_ZLIB, libmpq__decompress_zlib}, /* decompression with the zlib library. */ - {LIBMPQ_COMPRESSION_PKZIP, libmpq__decompress_pkzip}, /* decompression with pkware data compression library. */ - {LIBMPQ_COMPRESSION_BZIP2, libmpq__decompress_bzip2}, /* decompression with bzip2 library. */ - {LIBMPQ_COMPRESSION_WAVE_MONO, libmpq__decompress_wave_mono}, /* decompression for mono waves. */ - {LIBMPQ_COMPRESSION_WAVE_STEREO, libmpq__decompress_wave_stereo} /* decompression for stereo waves. */ -}; - -/* this function decompress a stream using huffman algorithm. */ -int32_t libmpq__decompress_huffman(uint8_t *in_buf, uint32_t in_size, uint8_t *out_buf, uint32_t out_size) { - - /* TODO: make typdefs of this structs? */ - /* some common variables. */ - int32_t tb = 0; - struct huffman_tree_s *ht; - struct huffman_input_stream_s *is; - - /* allocate memory for the huffman tree. */ - if ((ht = malloc(sizeof(struct huffman_tree_s))) == NULL || - (is = malloc(sizeof(struct huffman_input_stream_s))) == NULL) { - - /* memory allocation problem. */ - return LIBMPQ_ERROR_MALLOC; - } - - /* cleanup structures. */ - memset(ht, 0, sizeof(struct huffman_tree_s)); - memset(is, 0, sizeof(struct huffman_input_stream_s)); - - /* initialize input stream. */ - is->bit_buf = *(uint32_t *)in_buf; - in_buf += sizeof(int32_t); - is->in_buf = (uint8_t *)in_buf; - is->bits = 32; - -// TODO: add all the mallocs to init function and add function libmpq__huffman_tree_free() */ -// if ((result = libmpq__huffman_tree_init(ht, LIBMPQ_HUFF_DECOMPRESS)) < 0) { -// -// /* something on zlib initialization failed. */ -// return LIBMPQ_ERROR_UNPACK; -// } - - /* initialize the huffman tree for decompression. */ - libmpq__huffman_tree_init(ht, LIBMPQ_HUFF_DECOMPRESS); - - /* save the number of copied bytes. */ - tb = libmpq__do_decompress_huffman(ht, is, out_buf, out_size); - - /* free structures. */ - free(is); - free(ht); - - /* return transferred bytes. */ - return tb; -} - -/* this function decompress a stream using zlib algorithm. */ -int32_t libmpq__decompress_zlib(uint8_t *in_buf, uint32_t in_size, uint8_t *out_buf, uint32_t out_size) { - - /* some common variables. */ - int32_t result = 0; - int32_t tb = 0; - z_stream z; - - /* fill the stream structure for zlib. */ - z.next_in = (Bytef *)in_buf; - z.avail_in = (uInt)in_size; - z.total_in = in_size; - z.next_out = (Bytef *)out_buf; - z.avail_out = (uInt)out_size; - z.total_out = 0; - z.zalloc = NULL; - z.zfree = NULL; - - /* initialize the decompression structure, storm.dll uses zlib version 1.1.3. */ - if ((result = inflateInit(&z)) != Z_OK) { - - /* something on zlib initialization failed. */ - return result; - } - - /* call zlib to decompress the data. */ - if ((result = inflate(&z, Z_FINISH)) != Z_STREAM_END) { - - /* something on zlib decompression failed. */ - return result; - } - - /* save transferred bytes. */ - tb = z.total_out; - - /* cleanup zlib. */ - if ((result = inflateEnd(&z)) != Z_OK) { - - /* something on zlib finalization failed. */ - return result; - } - - /* return transferred bytes. */ - return tb; -} - -/* this function decompress a stream using pkzip algorithm. */ -int32_t libmpq__decompress_pkzip(uint8_t *in_buf, uint32_t in_size, uint8_t *out_buf, uint32_t out_size) { - - /* some common variables. */ - int32_t tb = 0; - uint8_t *work_buf; - pkzip_data_s info; - - /* allocate memory for pkzip data structure. */ - if ((work_buf = malloc(sizeof(pkzip_cmp_s))) == NULL) { - - /* memory allocation problem. */ - return LIBMPQ_ERROR_MALLOC; - } - - /* cleanup. */ - memset(work_buf, 0, sizeof(pkzip_cmp_s)); - - /* fill data information structure. */ - info.in_buf = in_buf; - info.in_pos = 0; - info.in_bytes = in_size; - info.out_buf = out_buf; - info.out_pos = 0; - info.max_out = out_size; - - /* do the decompression. */ - if ((tb = libmpq__do_decompress_pkzip(work_buf, &info)) < 0) { - - /* free working buffer. */ - free(work_buf); - - /* something failed on pkzip decompression. */ - return tb; - } - - /* save transferred bytes. */ - tb = info.out_pos; - - /* free working buffer. */ - free(work_buf); - - /* return transferred bytes. */ - return tb; -} - -/* this function decompress a stream using bzip2 library. */ -int32_t libmpq__decompress_bzip2(uint8_t *in_buf, uint32_t in_size, uint8_t *out_buf, uint32_t out_size) { - - /* some common variables. */ - int32_t result = 0; - int32_t tb = 0; - bz_stream strm; - - /* initialize the bzlib decompression. */ - strm.bzalloc = NULL; - strm.bzfree = NULL; - - /* initialize the structure. */ - if ((result = BZ2_bzDecompressInit(&strm, 0, 0)) != BZ_OK) { - - /* something on bzlib initialization failed. */ - return result; - } - - /* fill the stream structure for bzlib. */ - strm.next_in = (char *)in_buf; - strm.avail_in = in_size; - strm.next_out = (char *)out_buf; - strm.avail_out = out_size; - - /* do the decompression. */ - while (BZ2_bzDecompress(&strm) != BZ_STREAM_END); - - /* save transferred bytes. */ - tb = strm.total_out_lo32; - - /* cleanup of bzip stream. */ - BZ2_bzDecompressEnd(&strm); - - /* return transferred bytes. */ - return tb; -} - -/* this function decompress a stream using wave algorithm. (1 channel) */ -int32_t libmpq__decompress_wave_mono(uint8_t *in_buf, uint32_t in_size, uint8_t *out_buf, uint32_t out_size) { - - /* some common variables. */ - int32_t tb = 0; - - /* save the number of copied bytes. */ - if ((tb = libmpq__do_decompress_wave(out_buf, out_size, in_buf, in_size, 1)) < 0) { - - /* something on wave decompression failed. */ - return tb; - } - - /* return transferred bytes. */ - return tb; -} - -/* this function decompress a stream using wave algorithm. (2 channels) */ -int32_t libmpq__decompress_wave_stereo(uint8_t *in_buf, uint32_t in_size, uint8_t *out_buf, uint32_t out_size) { - - /* some common variables. */ - int32_t tb = 0; - - /* save the number of copied bytes. */ - if ((tb = libmpq__do_decompress_wave(out_buf, out_size, in_buf, in_size, 2)) < 0) { - - /* something on wave decompression failed. */ - return tb; - } - - /* return transferred bytes. */ - return tb; -} - -/* this function decompress a stream using a combination of the other compression algorithm. */ -int32_t libmpq__decompress_multi(uint8_t *in_buf, uint32_t in_size, uint8_t *out_buf, uint32_t out_size) { - - /* some common variables. */ - int32_t tb = 0; - uint32_t count = 0; - uint32_t entries = (sizeof(dcmp_table) / sizeof(decompress_table_s)); - uint8_t *temp_buf = NULL; - uint8_t *work_buf = 0; - uint8_t decompress_flag, decompress_unsupp; - uint32_t i; - - /* get applied compression types. */ - decompress_flag = decompress_unsupp = *in_buf++; - - /* decrement data size. */ - in_size--; - - /* search decompression table type and get all types of compression. */ - for (i = 0; i < entries; i++) { - - /* check if have to apply this decompression. */ - if (decompress_flag & dcmp_table[i].mask) { - - /* increase counter for used compression algorithms. */ - count++; - /* this algorithm is supported, remove from unsupp mask */ - decompress_unsupp &= ~dcmp_table[i].mask; - } - } - - /* check if there is some method unhandled. (e.g. compressed by future versions) */ - if (decompress_unsupp) { - - /* compression type is unknown and we need to implement it. :) */ - return LIBMPQ_ERROR_UNPACK; - } - - /* if multiple decompressions should be made, we need temporary buffer for the data. */ - if (count > 1) { - - /* allocate memory for temporary buffer. */ - if ((temp_buf = malloc(out_size)) == NULL) { - - /* memory allocation problem. */ - return LIBMPQ_ERROR_MALLOC; - } - - /* cleanup. */ - memset(temp_buf, 0, out_size); - } - - /* apply all decompressions. */ - for (i = 0, count = 0; i < entries; i++) { - - /* check if not used this kind of compression. */ - if (decompress_flag & dcmp_table[i].mask) { - - /* if multiple decompressions should be made, we need temporary buffer for the data. */ - if (count == 0) { - - /* use output buffer as working buffer. */ - work_buf = out_buf; - } else { - - /* use temporary buffer as working buffer. */ - work_buf = temp_buf; - } - - /* decompress buffer using corresponding function. */ - if ((tb = dcmp_table[i].decompress(in_buf, in_size, work_buf, out_size)) < 0) { - - /* free temporary buffer. */ - free(temp_buf); - - /* something on decompression failed. */ - return tb; - } - - /* move output size to source size for next compression. */ - in_size = out_size; - in_buf = work_buf; - - /* increase counter. */ - count++; - } - } - - /* if output buffer is not the same like target buffer, we have to copy data (this will happen on multiple decompressions). */ - if (work_buf != out_buf) { - - /* copy buffer. */ - memcpy(out_buf, in_buf, out_size); - } - - /* free temporary buffer. */ - free(temp_buf); - - /* return transferred bytes. */ - return tb; -} diff --git a/dep/libmpq/libmpq/extract.h b/dep/libmpq/libmpq/extract.h deleted file mode 100644 index d6ea794f162..00000000000 --- a/dep/libmpq/libmpq/extract.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - * extract.h -- header for the extraction functions used by mpq-tools. - * - * Copyright (c) 2003-2008 Maik Broemme - * - * 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; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; 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 _EXTRACT_H -#define _EXTRACT_H - -/* define compression types for multilpe compressions. */ -#define LIBMPQ_COMPRESSION_HUFFMAN 0x01 /* huffman compression. (used on wave files only and introduced in starcraft) */ -#define LIBMPQ_COMPRESSION_ZLIB 0x02 /* zlib compression. (introduced in warcraft 3) */ -#define LIBMPQ_COMPRESSION_PKZIP 0x08 /* pkware dcl compression. (first used compression algorithm) */ -#define LIBMPQ_COMPRESSION_BZIP2 0x10 /* bzip compression. (introduced in warcraft 3 - the frozen throne) */ -#define LIBMPQ_COMPRESSION_WAVE_MONO 0x40 /* adpcm 4:1 compression. (introduced in starcraft) */ -#define LIBMPQ_COMPRESSION_WAVE_STEREO 0x80 /* adpcm 4:1 compression. (introduced in starcraft) */ - -/* - * table for decompression functions, return value for all functions - * is the transferred data size or one of the following error constants: - * - * LIBMPQ_ERROR_MALLOC - * LIBMPQ_ERROR_DECOMPRESS - */ -typedef int32_t (*DECOMPRESS)(uint8_t *, uint32_t, uint8_t *, uint32_t); -typedef struct { - uint32_t mask; /* decompression bit. */ - DECOMPRESS decompress; /* decompression function. */ -} decompress_table_s; - -/* - * huffman decompression routine, the in_size parameter is not used, - * but needs to be specified due to compatibility reasons. - * - * 1500F5F0 - */ -extern int32_t libmpq__decompress_huffman( - uint8_t *in_buf, - uint32_t in_size, - uint8_t *out_buf, - uint32_t out_size -); - -/* decompression using zlib. */ -extern int32_t libmpq__decompress_zlib( - uint8_t *in_buf, - uint32_t in_size, - uint8_t *out_buf, - uint32_t out_size -); - -/* decompression using pkzip. */ -extern int32_t libmpq__decompress_pkzip( - uint8_t *in_buf, - uint32_t in_size, - uint8_t *out_buf, - uint32_t out_size -); - -/* decompression using bzip2. */ -extern int32_t libmpq__decompress_bzip2( - uint8_t *in_buf, - uint32_t in_size, - uint8_t *out_buf, - uint32_t out_size -); - -/* decompression using wave. (1 channel) */ -extern int32_t libmpq__decompress_wave_mono( - uint8_t *in_buf, - uint32_t in_size, - uint8_t *out_buf, - uint32_t out_size -); - -/* decompression using wave. (2 channels) */ -extern int32_t libmpq__decompress_wave_stereo( - uint8_t *in_buf, - uint32_t in_size, - uint8_t *out_buf, - uint32_t out_size -); - -/* decompression using multiple of the above algorithm. */ -extern int32_t libmpq__decompress_multi( - uint8_t *in_buf, - uint32_t in_size, - uint8_t *out_buf, - uint32_t out_size -); - -#endif /* _EXTRACT_H */ diff --git a/dep/libmpq/libmpq/huffman.c b/dep/libmpq/libmpq/huffman.c deleted file mode 100644 index 8fc87be2f60..00000000000 --- a/dep/libmpq/libmpq/huffman.c +++ /dev/null @@ -1,1101 +0,0 @@ -/* - * huffman.c -- functions do decompress files in mpq files which - * uses a modified huffman version. - * - * Copyright (c) 2003-2008 Maik Broemme - * - * Differences between C++ and C version: - * - * - Removed the object oriented stuff. - * - Replaced the goto things with some better C code. - * - * This source was adepted from the C++ version of huffman.cpp included - * in stormlib. The C++ version belongs to the following authors: - * - * Ladislav Zezula - * ShadowFlare - * - * 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; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; 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. - */ - -/* generic includes. */ -#include -#include - -/* libmpq main includes. */ -#include "mpq.h" -#include "mpq-internal.h" - -/* libmpq generic includes. */ -#include "huffman.h" - -/* tables for huffman tree. */ -static const uint8_t table_1502A630[] = { - - /* data for compression type 0x00. */ - 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, - 0x00, 0x00, - - /* data for compression type 0x01. */ - 0x54, 0x16, 0x16, 0x0D, 0x0C, 0x08, 0x06, 0x05, 0x06, 0x05, 0x06, 0x03, 0x04, 0x04, 0x03, 0x05, - 0x0E, 0x0B, 0x14, 0x13, 0x13, 0x09, 0x0B, 0x06, 0x05, 0x04, 0x03, 0x02, 0x03, 0x02, 0x02, 0x02, - 0x0D, 0x07, 0x09, 0x06, 0x06, 0x04, 0x03, 0x02, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, - 0x09, 0x06, 0x04, 0x04, 0x04, 0x04, 0x03, 0x02, 0x03, 0x02, 0x02, 0x02, 0x02, 0x03, 0x02, 0x04, - 0x08, 0x03, 0x04, 0x07, 0x09, 0x05, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, 0x03, 0x02, 0x02, - 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x02, 0x01, 0x02, 0x02, - 0x06, 0x0A, 0x08, 0x08, 0x06, 0x07, 0x04, 0x03, 0x04, 0x04, 0x02, 0x02, 0x04, 0x02, 0x03, 0x03, - 0x04, 0x03, 0x07, 0x07, 0x09, 0x06, 0x04, 0x03, 0x03, 0x02, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x0A, 0x02, 0x02, 0x03, 0x02, 0x02, 0x01, 0x01, 0x02, 0x02, 0x02, 0x06, 0x03, 0x05, 0x02, 0x03, - 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x03, 0x01, 0x01, 0x01, - 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x04, 0x04, 0x04, 0x07, 0x09, 0x08, 0x0C, 0x02, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x03, - 0x04, 0x01, 0x02, 0x04, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, - 0x04, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x01, 0x01, 0x02, 0x02, 0x02, 0x06, 0x4B, - 0x00, 0x00, - - /* data for compression type 0x02. */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x27, 0x00, 0x00, 0x23, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x01, 0x01, 0x06, 0x0E, 0x10, 0x04, - 0x06, 0x08, 0x05, 0x04, 0x04, 0x03, 0x03, 0x02, 0x02, 0x03, 0x03, 0x01, 0x01, 0x02, 0x01, 0x01, - 0x01, 0x04, 0x02, 0x04, 0x02, 0x02, 0x02, 0x01, 0x01, 0x04, 0x01, 0x01, 0x02, 0x03, 0x03, 0x02, - 0x03, 0x01, 0x03, 0x06, 0x04, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x01, 0x02, 0x01, 0x01, - 0x01, 0x29, 0x07, 0x16, 0x12, 0x40, 0x0A, 0x0A, 0x11, 0x25, 0x01, 0x03, 0x17, 0x10, 0x26, 0x2A, - 0x10, 0x01, 0x23, 0x23, 0x2F, 0x10, 0x06, 0x07, 0x02, 0x09, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, - - /* data for compression type 0x03. */ - 0xFF, 0x0B, 0x07, 0x05, 0x0B, 0x02, 0x02, 0x02, 0x06, 0x02, 0x02, 0x01, 0x04, 0x02, 0x01, 0x03, - 0x09, 0x01, 0x01, 0x01, 0x03, 0x04, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, - 0x05, 0x01, 0x01, 0x01, 0x0D, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x02, 0x01, 0x01, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, - 0x0A, 0x04, 0x02, 0x01, 0x06, 0x03, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x03, 0x01, 0x01, 0x01, - 0x05, 0x02, 0x03, 0x04, 0x03, 0x03, 0x03, 0x02, 0x01, 0x01, 0x01, 0x02, 0x01, 0x02, 0x03, 0x03, - 0x01, 0x03, 0x01, 0x01, 0x02, 0x05, 0x01, 0x01, 0x04, 0x03, 0x05, 0x01, 0x03, 0x01, 0x03, 0x03, - 0x02, 0x01, 0x04, 0x03, 0x0A, 0x06, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x02, 0x02, 0x01, 0x0A, 0x02, 0x05, 0x01, 0x01, 0x02, 0x07, 0x02, 0x17, 0x01, 0x05, 0x01, 0x01, - 0x0E, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x06, 0x02, 0x01, 0x04, 0x05, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x07, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, - 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x11, - 0x00, 0x00, - - /* data for compression type 0x04. */ - 0xFF, 0xFB, 0x98, 0x9A, 0x84, 0x85, 0x63, 0x64, 0x3E, 0x3E, 0x22, 0x22, 0x13, 0x13, 0x18, 0x17, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, - - /* data for compression type 0x05. */ - 0xFF, 0xF1, 0x9D, 0x9E, 0x9A, 0x9B, 0x9A, 0x97, 0x93, 0x93, 0x8C, 0x8E, 0x86, 0x88, 0x80, 0x82, - 0x7C, 0x7C, 0x72, 0x73, 0x69, 0x6B, 0x5F, 0x60, 0x55, 0x56, 0x4A, 0x4B, 0x40, 0x41, 0x37, 0x37, - 0x2F, 0x2F, 0x27, 0x27, 0x21, 0x21, 0x1B, 0x1C, 0x17, 0x17, 0x13, 0x13, 0x10, 0x10, 0x0D, 0x0D, - 0x0B, 0x0B, 0x09, 0x09, 0x08, 0x08, 0x07, 0x07, 0x06, 0x05, 0x05, 0x04, 0x04, 0x04, 0x19, 0x18, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, - - /* data for compression type 0x06. */ - 0xC3, 0xCB, 0xF5, 0x41, 0xFF, 0x7B, 0xF7, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xBF, 0xCC, 0xF2, 0x40, 0xFD, 0x7C, 0xF7, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x7A, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, - - /* data for compression type 0x07. */ - 0xC3, 0xD9, 0xEF, 0x3D, 0xF9, 0x7C, 0xE9, 0x1E, 0xFD, 0xAB, 0xF1, 0x2C, 0xFC, 0x5B, 0xFE, 0x17, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xBD, 0xD9, 0xEC, 0x3D, 0xF5, 0x7D, 0xE8, 0x1D, 0xFB, 0xAE, 0xF0, 0x2C, 0xFB, 0x5C, 0xFF, 0x18, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x70, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, - - /* data for compression type 0x08. */ - 0xBA, 0xC5, 0xDA, 0x33, 0xE3, 0x6D, 0xD8, 0x18, 0xE5, 0x94, 0xDA, 0x23, 0xDF, 0x4A, 0xD1, 0x10, - 0xEE, 0xAF, 0xE4, 0x2C, 0xEA, 0x5A, 0xDE, 0x15, 0xF4, 0x87, 0xE9, 0x21, 0xF6, 0x43, 0xFC, 0x12, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xB0, 0xC7, 0xD8, 0x33, 0xE3, 0x6B, 0xD6, 0x18, 0xE7, 0x95, 0xD8, 0x23, 0xDB, 0x49, 0xD0, 0x11, - 0xE9, 0xB2, 0xE2, 0x2B, 0xE8, 0x5C, 0xDD, 0x15, 0xF1, 0x87, 0xE7, 0x20, 0xF7, 0x44, 0xFF, 0x13, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x5F, 0x9E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00 -}; - -/* this function insert an item to a huffman tree. */ -void libmpq__huffman_insert_item(struct huffman_tree_item_s **p_item, struct huffman_tree_item_s *item, uint32_t where, struct huffman_tree_item_s *item2) { - - /* EDI - next to the first item. */ - struct huffman_tree_item_s *next = item->next; - - /* ESI - prev to the first item. */ - struct huffman_tree_item_s *prev = item->prev; - - /* pointer to previous item. */ - struct huffman_tree_item_s *prev2; - - /* pointer to next item. */ - long next2; - - /* check the first item already has next one. */ - if (next != 0) { - - /* check if previous item exist. */ - if (PTR_INT(prev) < 0) { - - /* return previous item. */ - prev = PTR_NOT(prev); - } else { - - /* add item. */ - prev += (item - next->prev); - } - - /* 150083C1 - remove the item from the tree. */ - prev->next = next; - next->prev = prev; - - /* invalidate prev and next pointer. */ - item->next = 0; - item->prev = 0; - } - - /* EDX - check if the second item is not entered. */ - if (item2 == NULL) { - - /* take the first tree item. */ - item2 = PTR_PTR(&p_item[1]); - } - - /* check if items should be switched or new one inserted. */ - switch (where) { - case SWITCH_ITEMS: - - /* item2->next (pointer to pointer to first). */ - item->next = item2->next; - item->prev = item2->next->prev; - item2->next->prev = item; - - /* set the first item. */ - item2->next = item; - - /* return from function. */ - return; - case INSERT_ITEM: - - /* set next item (or pointer to pointer to first item) - insert as last item. */ - item->next = item2; - - /* set previous item (or last item in the tree). */ - item->prev = item2->prev; - - /* usually NULL. */ - next2 = PTR_INT(p_item[0]); - - /* previous item to the second (or last tree item). */ - prev2 = item2->prev; - - /* check if previous item is a valid pointer. */ - if (PTR_INT(prev2) < 0) { - - /* set values. */ - prev2 = PTR_NOT(prev); - prev2->next = item; - - /* next after last item. */ - item2->prev = item; - - /* return from function. */ - return; - } - - /* check if next item is empty. */ - if (next2 < 0) { - - /* set next item. */ - next2 = item2 - item2->next->prev; - } - - /* add next item to previous one. */ - prev2 += next2; - prev2->next = item; - - /* set the next and last item. */ - item2->prev = item; - - /* return from function. */ - return; - default: - - /* nothing to do, so return from function. */ - return; - } -} - -/* 1500BC90 - remove item from huffman tree.*/ -void libmpq__huffman_remove_item(struct huffman_tree_item_s *hi) { - - /* EDX - some common variables. */ - struct huffman_tree_item_s *temp; - - /* check if next item is not empty. */ - if (hi->next != NULL) { - - /* fetch previous item. */ - temp = hi->prev; - - /* check if previous item is a pointer. */ - if (PTR_INT(temp) <= 0) { - temp = PTR_NOT(temp); - } else { - temp += (hi - hi->next->prev); - } - - /* reorganize tree. */ - temp->next = hi->next; - hi->next->prev = hi->prev; - hi->next = hi->prev = NULL; - } -} - -/* get previous huffman tree item. */ -struct huffman_tree_item_s *libmpq__huffman_previous_item(struct huffman_tree_item_s *hi, long value) { - - /* check if previous item exist. */ - if (PTR_INT(hi->prev) < 0) { - - /* return previous item. */ - return PTR_NOT(hi->prev); - } - - /* check if something else should returned. */ - if (value < 0) { - - /* fetch previous item of next item. */ - value = hi - hi->next->prev; - } - - /* return previous item with value. */ - return hi->prev + value; -} - -/* get one bit from input stream. */ -uint32_t libmpq__huffman_get_1bit(struct huffman_input_stream_s *is) { - - /* some common variables. */ - uint32_t bit = (is->bit_buf & 1); - - /* shift bit right by one. */ - is->bit_buf >>= 1; - - /* check if we should extract bits. */ - if (--is->bits == 0) { - is->bit_buf = *(uint32_t *)is->in_buf; - is->in_buf += sizeof(int32_t); - is->bits = 32; - } - - /* return the bit. */ - return bit; -} - -/* get 7 bits from the input stream. */ -uint32_t libmpq__huffman_get_7bit(struct huffman_input_stream_s *is) { - - /* check if we should extract bits. */ - if (is->bits <= 7) { - is->bit_buf |= *(uint16_t *)is->in_buf << is->bits; - is->in_buf += sizeof(int16_t); - is->bits += 16; - } - - /* get 7 bits from input stream. */ - return (is->bit_buf & 0x7F); -} - -/* get the whole byte from the input stream. */ -uint32_t libmpq__huffman_get_8bit(struct huffman_input_stream_s *is) { - - /* some common variables. */ - uint32_t one_byte; - - /* check if we should extract bits. */ - if (is->bits <= 8) { - is->bit_buf |= *(uint16_t *)is->in_buf << is->bits; - is->in_buf += sizeof(int16_t); - is->bits += 16; - } - - /* fill values. */ - one_byte = (is->bit_buf & 0xFF); - is->bit_buf >>= 8; - is->bits -= 8; - - /* return the 8 bits. */ - return one_byte; -} - -/* return struct for 1500E740. */ -struct huffman_tree_item_s *libmpq__huffman_call_1500E740(struct huffman_tree_s *ht) { - - /* EDX */ - struct huffman_tree_item_s *p_item1 = ht->item3058; - - /* EAX */ - struct huffman_tree_item_s *p_item2; - - /* some common variables. */ - struct huffman_tree_item_s *p_next; - struct huffman_tree_item_s *p_prev; - struct huffman_tree_item_s **pp_item; - - /* check if item is empty. */ - if (PTR_INT(p_item1) <= 0 || (p_item2 = p_item1) == NULL) { - - /* check if item is not empty. */ - if ((p_item2 = &ht->items0008[ht->items++]) != NULL) { - p_item1 = p_item2; - } else { - p_item1 = ht->first; - } - } else { - p_item1 = p_item2; - } - - /* set next item. */ - p_next = p_item1->next; - - /* check if next item is not empty. */ - if (p_next != NULL) { - - /* set previous item. */ - p_prev = p_item1->prev; - - /* check if previous item is a valid pointer. */ - if (PTR_INT(p_prev) <= 0) { - p_prev = PTR_NOT(p_prev); - } else { - p_prev += (p_item1 - p_item1->next->prev); - } - - /* fill values. */ - p_prev->next = p_next; - p_next->prev = p_prev; - p_item1->next = NULL; - p_item1->prev = NULL; - } - - /* ESI */ - pp_item = &ht->first; - p_item1->next = (struct huffman_tree_item_s *)pp_item; - p_item1->prev = pp_item[1]; - - /* EDI = ht->item305C - ECX */ - p_prev = pp_item[1]; - - /* check if previous pointer is valid. */ - if (p_prev <= 0) { - - /* fill values. */ - p_prev = PTR_NOT(p_prev); - p_prev->next = p_item1; - p_prev->prev = p_item2; - p_item2->parent = NULL; - p_item2->child = NULL; - } else { - - /* check if pointer is valid. */ - if (PTR_INT(ht->item305C) < 0) { - p_prev += (struct huffman_tree_item_s *)pp_item - (*pp_item)->prev; - } else { - p_prev += PTR_INT(ht->item305C); - } - - /* fill values. */ - p_prev->next = p_item1; - pp_item[1] = p_item2; - p_item2->parent = NULL; - p_item2->child = NULL; - } - - /* return item. */ - return p_item2; -} - -/* return struct for 1500E820. */ -void libmpq__huffman_call_1500E820(struct huffman_tree_s *ht, struct huffman_tree_item_s *p_item) { - - /* EDI */ - struct huffman_tree_item_s *p_item1; - - /* EAX */ - struct huffman_tree_item_s *p_item2 = NULL; - - /* EDX */ - struct huffman_tree_item_s *p_item3; - - /* EBX */ - struct huffman_tree_item_s *p_prev; - - /* loop through parent items. */ - for (; p_item != NULL; p_item = p_item->parent) { - - /* increase byte counter. */ - p_item->byte_value++; - - /* loop through previous items. */ - for (p_item1 = p_item; ; p_item1 = p_prev) { - - /* set previous item. */ - p_prev = p_item1->prev; - - /* check if pointer is valid. */ - if (PTR_INT(p_prev) <= 0) { - p_prev = NULL; - break; - } - - /* check if byte value of previous item is higher than actual item. */ - if (p_prev->byte_value >= p_item->byte_value) { - break; - } - } - - /* check if previous item is same like actual item. */ - if (p_item1 == p_item) { - continue; - } - - /* check if next item is not empty, */ - if (p_item1->next != NULL) { - - /* fill values. */ - p_item2 = libmpq__huffman_previous_item(p_item1, -1); - p_item2->next = p_item1->next; - p_item1->next->prev = p_item1->prev; - p_item1->next = NULL; - p_item1->prev = NULL; - } - - /* fill values. */ - p_item2 = p_item->next; - p_item1->next = p_item2; - p_item1->prev = p_item2->prev; - p_item2->prev = p_item1; - p_item->next = p_item1; - - /* check if both items are not empty. */ - if ((p_item2 = p_item1) != NULL) { - - /* fill values. */ - p_item2 = libmpq__huffman_previous_item(p_item, -1); - p_item2->next = p_item->next; - p_item->next->prev = p_item->prev; - p_item->next = NULL; - p_item->prev = NULL; - } - - /* check if previous item is empty. */ - if (p_prev == NULL) { - p_prev = PTR_PTR(&ht->first); - } - - /* fill values. */ - p_item2 = p_prev->next; - p_item->next = p_item2; - p_item->prev = p_item2->prev; - p_item2->prev = p_item; - p_prev->next = p_item; - p_item3 = p_item1->parent->child; - p_item2 = p_item->parent; - - /* check if child item and parent item match. */ - if (p_item2->child == p_item) { - p_item2->child = p_item1; - } - - /* check if items match. */ - if (p_item3 == p_item1) { - p_item1->parent->child = p_item; - } - - /* fill values. */ - p_item2 = p_item->parent; - p_item->parent = p_item1->parent; - p_item1->parent = p_item2; - - /* increase counter. */ - ht->offs0004++; - } -} - -/* this function initialize a huffman tree. */ -void libmpq__huffman_tree_init(struct huffman_tree_s *ht, uint32_t cmp) { - - /* some common variables. */ - uint32_t count; - struct huffman_tree_item_s *hi; - - /* clear links for all the items in the tree. */ - for (hi = ht->items0008, count = 0x203; count != 0; hi++, count--) { - hi->next = hi->prev = NULL; - } - - /* fill values. */ - ht->item3050 = NULL; - ht->item3054 = PTR_PTR(&ht->item3054); - ht->item3058 = PTR_NOT(ht->item3054); - ht->item305C = NULL; - ht->first = PTR_PTR(&ht->first); - ht->last = PTR_NOT(ht->first); - ht->offs0004 = 1; - ht->items = 0; - - /* clear all huffman decompress items, do this only if preparing for decompression. */ - if (cmp == LIBMPQ_HUFF_DECOMPRESS) { - for (count = 0; count < sizeof(ht->qd3474) / sizeof(struct huffman_decompress_s); count++) { - ht->qd3474[count].offs00 = 0; - } - } -} - -/* this function build a huffman tree, called with the first 8 bits loaded from input stream. */ -void libmpq__huffman_tree_build(struct huffman_tree_s *ht, uint32_t cmp_type) { - - /* [ESP+10] - the greatest character found in table. */ - uint32_t max_byte; - - /* [ESP+1C] - pointer to uint8_t in table_1502A630. */ - const uint8_t *byte_array; - - /* thats needed to replace the goto stuff from original source. :) */ - uint32_t found; - - /* [ESP+14] - Pointer to Huffman tree item pointer array. */ - struct huffman_tree_item_s **p_item; - struct huffman_tree_item_s *child1; - - /* some common variables. */ - uint32_t i; - - /* ESI - loop while pointer has a negative value (last entry). */ - while (PTR_INT(ht->last) > 0) { - - /* EAX */ - struct huffman_tree_item_s *temp; - - /* ESI->next */ - if (ht->last->next != NULL) { - libmpq__huffman_remove_item(ht->last); - } - - /* [EDI+4] */ - ht->item3058 = PTR_PTR(&ht->item3054); - - /* EAX */ - ht->last->prev = ht->item3058; - temp = libmpq__huffman_previous_item(PTR_PTR(&ht->item3054), PTR_INT(&ht->item3050)); - temp->next = ht->last; - ht->item3054 = ht->last; - } - - /* clear all pointers in huffman tree item array. */ - memset(ht->items306C, 0, sizeof(ht->items306C)); - - /* greatest character found init to zero. */ - max_byte = 0; - - /* pointer to current entry in huffman tree item pointer array. */ - p_item = (struct huffman_tree_item_s **)&ht->items306C; - - /* ensure we have low 8 bits only. */ - cmp_type &= 0xFF; - - /* EDI also. */ - byte_array = table_1502A630 + cmp_type * 258; - - /* loop to build huffman tree. */ - for (i = 0; i < 0x100; i++, p_item++) { - - /* item to be created. */ - struct huffman_tree_item_s *item = ht->item3058; - struct huffman_tree_item_s *p_item3 = ht->item3058; - uint8_t one_byte = byte_array[i]; - - /* skip all the bytes which are zero. */ - if (byte_array[i] == 0) { - continue; - } - - /* if not valid pointer, take the first available item in the array. */ - if (PTR_INT(item) <= 0) { - item = &ht->items0008[ht->items++]; - } - - /* insert this item as the top of the tree. */ - libmpq__huffman_insert_item(&ht->item305C, item, SWITCH_ITEMS, NULL); - - /* invalidate child and parent. */ - item->parent = NULL; - item->child = NULL; - - /* store pointer into pointer array. */ - *p_item = item; - - /* store counter. */ - item->dcmp_byte = i; - - /* store byte value. */ - item->byte_value = one_byte; - - /* check if byte is to big. */ - if (one_byte >= max_byte) { - - /* set max byte to highest value. */ - max_byte = one_byte; - - /* continue loop. */ - continue; - } - - /* find the first item which has byte value greater than current one byte. */ - found = 0; - - /* EDI - Pointer to the last item. */ - if (PTR_INT((p_item3 = ht->last)) > 0) { - - /* 15006AF7 */ - if (p_item3 != NULL) { - - /* 15006AFB */ - do { - - /* check if we found item. */ - if (p_item3->byte_value >= one_byte) { - found = 1; - break; - } - - /* switch to previous item. */ - p_item3 = p_item3->prev; - } while (PTR_INT(p_item3) > 0); - } - } - - /* check if item was not found. */ - if (found == 0) { - p_item3 = NULL; - } - - /* 15006B09 */ - if (item->next != NULL) { - libmpq__huffman_remove_item(item); - } - - /* 15006B15 */ - if (p_item3 == NULL) { - p_item3 = PTR_PTR(&ht->first); - } - - /* 15006B1F */ - item->next = p_item3->next; - item->prev = p_item3->next->prev; - p_item3->next->prev = item; - p_item3->next = item; - } - - /* 15006B4A */ - for (; i < 0x102; i++) { - - /* EDI */ - struct huffman_tree_item_s **p_item2 = &ht->items306C[i]; - - /* 15006B59 - ESI */ - struct huffman_tree_item_s *item2 = ht->item3058; - - /* check if item is a valid pointer. */ - if (PTR_INT(item2) <= 0) { - item2 = &ht->items0008[ht->items++]; - } - - /* insert the item into tree. */ - libmpq__huffman_insert_item(&ht->item305C, item2, INSERT_ITEM, NULL); - - /* 15006B89 */ - item2->dcmp_byte = i; - item2->byte_value = 1; - item2->parent = NULL; - item2->child = NULL; - *p_item2++ = item2; - } - - /* 15006BAA - EDI - last item (first child to item). */ - if (PTR_INT((child1 = ht->last)) > 0) { - - /* EBP */ - struct huffman_tree_item_s *child2; - - /* ESI */ - struct huffman_tree_item_s *item; - - /* 15006BB8 */ - while (PTR_INT((child2 = child1->prev)) > 0) { - if (PTR_INT((item = ht->item3058)) <= 0) { - item = &ht->items0008[ht->items++]; - } - - /* 15006BE3 */ - libmpq__huffman_insert_item(&ht->item305C, item, SWITCH_ITEMS, NULL); - - /* 15006BF3 */ - item->parent = NULL; - item->child = NULL; - - /* - * EDX = child2->byte_value + child1->byte_value; - * EAX = child1->byte_value; - * ECX = max_byte; (the greatest character (0xFF usually)) - * item->byte_value (0x02 usually) - */ - item->byte_value = child1->byte_value + child2->byte_value; - - /* previous item in the tree. */ - item->child = child1; - child1->parent = item; - child2->parent = item; - - /* EAX = item->byte_value */ - if (item->byte_value >= max_byte) { - max_byte = item->byte_value; - } else { - - /* EDI */ - struct huffman_tree_item_s *p_item2 = child2->prev; - found = 0; - - /* check if item is a valid pointer. */ - if (PTR_INT(p_item2) > 0) { - - /* 15006C2D */ - do { - - /* check if we found item. */ - if (p_item2->byte_value >= item->byte_value) { - found = 1; - break; - } - - /* switch to previous item. */ - p_item2 = p_item2->prev; - } while (PTR_INT(p_item2) > 0); - } - - /* check if item was not found. */ - if (found == 0) { - p_item2 = NULL; - } - - /* check if next item exist. */ - if (item->next != 0) { - - /* some common variables. */ - struct huffman_tree_item_s *temp4 = libmpq__huffman_previous_item(item, -1); - - /* zhe first item changed. */ - temp4->next = item->next; - - /* first->prev changed to negative value. */ - item->next->prev = item->prev; - item->next = NULL; - item->prev = NULL; - } - - /* 15006C62 */ - if (p_item2 == NULL) { - p_item2 = PTR_PTR(&ht->first); - } - - /* set item with 0x100 byte value. */ - item->next = p_item2->next; - - /* set item with 0x17 byte value. */ - item->prev = p_item2->next->prev; - - /* changed prev of item with. */ - p_item2->next->prev = item; - p_item2->next = item; - } - - /* 15006C7B */ - if (PTR_INT((child1 = child2->prev)) <= 0) { - break; - } - } - } - - /* 15006C88 */ - ht->offs0004 = 1; -} - -/* this function did the real decompression. */ -int32_t libmpq__do_decompress_huffman(struct huffman_tree_s *ht, struct huffman_input_stream_s *is, uint8_t *out_buf, uint32_t out_length) { - - /* some common variables. */ - uint32_t dcmp_byte = 0; - uint8_t *out_pos = out_buf; - uint32_t bit_count; - struct huffman_decompress_s *qd; - struct huffman_tree_item_s *p_item1; - struct huffman_tree_item_s *p_item2; - - /* 8 bits loaded from input stream. */ - uint32_t n8bits; - - /* 7 bits loaded from input stream. */ - uint32_t n7bits; - - /* thats needed to replace the goto stuff from original source. :) */ - uint32_t found; - - /* can we use quick decompression */ - uint32_t has_qd; - - /* test the output length, must not be non zero. */ - if (out_length == 0) { - return 0; - } - - /* get the compression type from the input stream. */ - n8bits = libmpq__huffman_get_8bit(is); - - /* build the Huffman tree. */ - libmpq__huffman_tree_build(ht, n8bits); - - /* compression 8 bit or not? */ - ht->cmp0 = (n8bits == 0) ? TRUE : FALSE; - - /* loop until break. */ - for(;;) { - - /* get 7 bits from input stream. */ - n7bits = libmpq__huffman_get_7bit(is); - - /* try to use quick decompression, check huffman decompress struct for corresponding item. */ - qd = &ht->qd3474[n7bits]; - - /* if there is a quick-pass possible (ebx). */ - has_qd = (qd->offs00 >= ht->offs0004) ? TRUE : FALSE; - - /* if we can use quick decompress, use it. */ - if (has_qd) { - found = 0; - if (qd->bits > 7) { - is->bit_buf >>= 7; - is->bits -= 7; - p_item1 = qd->p_item; - found = 1; - } - if (found == 0) { - is->bit_buf >>= qd->bits; - is->bits -= qd->bits; - dcmp_byte = qd->dcmp_byte; - } - } else { - found = 1; - p_item1 = ht->first->next->prev; - if (PTR_INT(p_item1) <= 0) { - p_item1 = NULL; - } - } - - /* check if item was found. */ - if (found == 1) { - bit_count = 0; - p_item2 = NULL; - - /* loop until tree has no deeper level. */ - do { - - /* move down by one level. */ - p_item1 = p_item1->child; - - /* check if current bit is set, move to previous. */ - if (libmpq__huffman_get_1bit(is)) { - p_item1 = p_item1->prev; - } - - /* check if we are at 7th bit, save current huffman tree item. */ - if (++bit_count == 7) { - p_item2 = p_item1; - } - } while (p_item1->child != NULL); - - /* no quick decompression. :( */ - if (has_qd == FALSE) { - - /* check bit counter. */ - if (bit_count > 7) { - qd->offs00 = ht->offs0004; - qd->bits = bit_count; - qd->p_item = p_item2; - } else { - uint32_t index = n7bits & (0xFFFFFFFF >> (32 - bit_count)); - uint32_t add = (1 << bit_count); - - /* loop through compression. */ - for (qd = &ht->qd3474[index]; index <= 0x7F; index += add, qd += add) { - qd->offs00 = ht->offs0004; - qd->bits = bit_count; - qd->dcmp_byte = p_item1->dcmp_byte; - } - } - } - - /* set compression byte. */ - dcmp_byte = p_item1->dcmp_byte; - } - - /* check if huffman tree needs to be modified. */ - if (dcmp_byte == 0x101) { - - /* fill values. */ - n8bits = libmpq__huffman_get_8bit(is); - p_item1 = (ht->last <= 0) ? NULL : ht->last; - p_item2 = libmpq__huffman_call_1500E740(ht); - p_item2->parent = p_item1; - p_item2->dcmp_byte = p_item1->dcmp_byte; - p_item2->byte_value = p_item1->byte_value; - ht->items306C[p_item2->dcmp_byte] = p_item2; - p_item2 = libmpq__huffman_call_1500E740(ht); - p_item2->parent = p_item1; - p_item2->dcmp_byte = n8bits; - p_item2->byte_value = 0; - ht->items306C[p_item2->dcmp_byte] = p_item2; - p_item1->child = p_item2; - - /* call 1500E820. */ - libmpq__huffman_call_1500E820(ht, p_item2); - - /* check if compression is not set. */ - if (ht->cmp0 == 0) { - libmpq__huffman_call_1500E820(ht, ht->items306C[n8bits]); - } - - /* set compression byte. */ - dcmp_byte = n8bits; - } - - /* check for compression. */ - if (dcmp_byte == 0x100) { - break; - } - - /* increase position by compression byte. */ - *out_pos++ = (uint8_t)dcmp_byte; - if (--out_length == 0) { - break; - } - - /* check if compression is not set. */ - if (ht->cmp0) { - libmpq__huffman_call_1500E820(ht, ht->items306C[dcmp_byte]); - } - } - - /* return copied bytes. */ - return (out_pos - out_buf); -} diff --git a/dep/libmpq/libmpq/huffman.h b/dep/libmpq/libmpq/huffman.h deleted file mode 100644 index 6f691088fa0..00000000000 --- a/dep/libmpq/libmpq/huffman.h +++ /dev/null @@ -1,151 +0,0 @@ -/* - * huffman.h -- structures used for huffman compression. - * - * Copyright (c) 2003-2008 Maik Broemme - * - * This source was adepted from the C++ version of huffman.h included - * in stormlib. The C++ version belongs to the following authors: - * - * Ladislav Zezula - * ShadowFlare - * - * 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; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; 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 _HUFFMAN_H -#define _HUFFMAN_H - -/* define huffman compression and decompression values. */ -#define LIBMPQ_HUFF_DECOMPRESS 0 /* we want to decompress using huffman trees. */ - -/* define pointer conversions. */ -#define PTR_NOT(ptr) (struct huffman_tree_item_s *)(~(unsigned long)(ptr)) -#define PTR_PTR(ptr) ((struct huffman_tree_item_s *)(ptr)) -#define PTR_INT(ptr) (long)(ptr) - -/* define item handling. */ -#define INSERT_ITEM 1 /* insert item into huffman tree. */ -#define SWITCH_ITEMS 2 /* switch items isnide huffman tree. */ - -/* input stream for huffman decompression. */ -struct huffman_input_stream_s { - uint8_t *in_buf; /* 00 - input data. */ - uint32_t bit_buf; /* 04 - input bit buffer. */ - uint32_t bits; /* 08 - number of bits remaining in byte. */ -}; - -/* huffman tree item. */ -struct huffman_tree_item_s { - struct huffman_tree_item_s *next; /* 00 - pointer to next huffman tree item. */ - struct huffman_tree_item_s *prev; /* 04 - pointer to prev huffman tree item (< 0 if none). */ - uint32_t dcmp_byte; /* 08 - index of this item in item pointer array, decompressed byte value. */ - uint32_t byte_value; /* 0C - some byte value. */ - struct huffman_tree_item_s *parent; /* 10 - pointer to parent huffman tree item (NULL if none). */ - struct huffman_tree_item_s *child; /* 14 - pointer to child huffman tree item. */ -}; - -/* structure used for quick decompression. */ -struct huffman_decompress_s { - uint32_t offs00; /* 00 - 1 if resolved. */ - uint32_t bits; /* 04 - bit count. */ - union { - uint32_t dcmp_byte; /* 08 - byte value for decompress (if bitCount <= 7). */ - struct huffman_tree_item_s *p_item; /* 08 - huffman tree item (if number of bits is greater than 7). */ - }; -}; - -/* structure for huffman tree. */ -struct huffman_tree_s { - uint32_t cmp0; /* 0000 - 1 if compression type 0. */ - uint32_t offs0004; /* 0004 - some flag. */ - struct huffman_tree_item_s items0008[0x203]; /* 0008 - huffman tree items. */ - struct huffman_tree_item_s *item3050; /* 3050 - always NULL? */ - struct huffman_tree_item_s *item3054; /* 3054 - pointer to huffman tree item. */ - struct huffman_tree_item_s *item3058; /* 3058 - pointer to huffman tree item (< 0 if invalid). */ - struct huffman_tree_item_s *item305C; /* 305C - usually NULL. */ - struct huffman_tree_item_s *first; /* 3060 - pointer to top (first) huffman tree item. */ - struct huffman_tree_item_s *last; /* 3064 - pointer to bottom (last) huffman tree item (< 0 if invalid). */ - uint32_t items; /* 3068 - number of used huffman tree items. */ - struct huffman_tree_item_s *items306C[0x102]; /* 306C - huffman tree item pointer array. */ - struct huffman_decompress_s qd3474[0x80]; /* 3474 - array for quick decompression. */ - uint8_t table_1502A630[]; /* some table to make struct size flexible. */ -}; - -/* insert a new item into huffman tree. */ -void libmpq__huffman_insert_item( - struct huffman_tree_item_s **p_item, - struct huffman_tree_item_s *item, - uint32_t where, - struct huffman_tree_item_s *item2 -); - -/* remove item from huffman tree. */ -void libmpq__huffman_remove_item( - struct huffman_tree_item_s *hi -); - -/* get previous item from huffman tree. */ -struct huffman_tree_item_s *libmpq__huffman_previous_item( - struct huffman_tree_item_s *hi, - long value -); - -/* get one bit from stream. */ -uint32_t libmpq__huffman_get_1bit( - struct huffman_input_stream_s *is -); - -/* get seven bit from stream. */ -uint32_t libmpq__huffman_get_7bit( - struct huffman_input_stream_s *is -); - -/* get eight bit from stream. */ -uint32_t libmpq__huffman_get_8bit( - struct huffman_input_stream_s *is -); - -/* call 1500E740. */ -struct huffman_tree_item_s *libmpq__huffman_call_1500E740( - struct huffman_tree_s *ht -); - -/* call 1500E820- */ -void libmpq__huffman_call_1500E820( - struct huffman_tree_s *ht, - struct huffman_tree_item_s *p_item -); - -/* initialize the huffman tree. */ -void libmpq__huffman_tree_init( - struct huffman_tree_s *ht, - uint32_t cmp -); - -/* build the huffman tree. */ -void libmpq__huffman_tree_build( - struct huffman_tree_s *ht, - uint32_t cmp_type -); - -/* decompress the stream using huffman compression. */ -int32_t libmpq__do_decompress_huffman( - struct huffman_tree_s *ht, - struct huffman_input_stream_s *is, - uint8_t *out_buf, - uint32_t out_length -); - -#endif /* _HUFFMAN_H */ diff --git a/dep/libmpq/libmpq/mpq-internal.h b/dep/libmpq/libmpq/mpq-internal.h deleted file mode 100644 index 76eabe4190a..00000000000 --- a/dep/libmpq/libmpq/mpq-internal.h +++ /dev/null @@ -1,145 +0,0 @@ -/* - * mpq-internal.h -- some default types and defines, but only required for - * compilation of the library. - * - * Copyright (c) 2003-2008 Maik Broemme - * - * 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; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; 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 _MPQ_INTERNAL_H -#define _MPQ_INTERNAL_H - -/* generic includes. */ -#include -#include - -/* define return value if nothing failed. */ -#define LIBMPQ_SUCCESS 0 /* return value for all functions which success. */ - -/* define generic mpq archive information. */ -#define LIBMPQ_HEADER 0x1A51504D /* mpq archive header ('MPQ\x1A') */ - -/* define the known archive versions. */ -#define LIBMPQ_ARCHIVE_VERSION_ONE 0 /* version one used until world of warcraft. */ -#define LIBMPQ_ARCHIVE_VERSION_TWO 1 /* version two used from world of warcraft - the burning crusade. */ - -/* define values used by blizzard as flags. */ -#define LIBMPQ_FLAG_EXISTS 0x80000000 /* set if file exists, reset when the file was deleted. */ -#define LIBMPQ_FLAG_ENCRYPTED 0x00010000 /* indicates whether file is encrypted. */ -#define LIBMPQ_FLAG_COMPRESSED 0x0000FF00 /* file is compressed. */ -#define LIBMPQ_FLAG_COMPRESS_PKZIP 0x00000100 /* compression made by pkware data compression library. */ -#define LIBMPQ_FLAG_COMPRESS_MULTI 0x00000200 /* multiple compressions. */ -#define LIBMPQ_FLAG_COMPRESS_NONE 0x00000300 /* no compression (no blizzard flag used by myself). */ -#define LIBMPQ_FLAG_SINGLE 0x01000000 /* file is stored in one single sector, first seen in world of warcraft. */ -#define LIBMPQ_FLAG_CRC 0x04000000 /* compressed block offset table has CRC checksum. */ - -/* define generic hash values. */ -#define LIBMPQ_HASH_FREE 0xFFFFFFFF /* hash table entry is empty and has always been empty. */ - -/* define special files. */ -#define LIBMPQ_LISTFILE_NAME "(listfile)" /* internal listfile. */ -#define LIBMPQ_SIGNATURE_NAME "(signature)" /* internal signature file. */ -#define LIBMPQ_ATTRIBUTES_NAME "(attributes)" /* internal attributes file. */ - -/* define true and false, because not all systems have them. */ -#ifndef FALSE -#define FALSE 0 -#endif -#ifndef TRUE -#define TRUE 1 -#endif - -#include "pack_begin.h" -/* mpq archive header. */ -typedef struct { - uint32_t mpq_magic; /* the 0x1A51504D ('MPQ\x1A') signature. */ - uint32_t header_size; /* mpq archive header size. */ - uint32_t archive_size; /* size of mpq archive. */ - uint16_t version; /* 0000 for starcraft and broodwar. */ - uint16_t block_size; /* size of file block is (512 * 2 ^ block size). */ - uint32_t hash_table_offset; /* file position of mpq_hash. */ - uint32_t block_table_offset; /* file position of mpq_block, each entry has 16 bytes. */ - uint32_t hash_table_count; /* number of entries in hash table. */ - uint32_t block_table_count; /* number of entries in the block table. */ -} PACK_STRUCT mpq_header_s; - -/* mpq extended archive header, used since world of warcraft - the burning crusade. */ -typedef struct { - uint64_t extended_offset; /* offset to the beginning of the extended block table, relative to the beginning of the archive. */ - uint16_t hash_table_offset_high; /* upper 16 bits of the hash table offset for large archives. */ - uint16_t block_table_offset_high;/* upper 16 bits of the block table offset for large archives.*/ -} PACK_STRUCT mpq_header_ex_s; - -/* hash entry, all files in the archive are searched by their hashes. */ -typedef struct { - uint32_t hash_a; /* the first two uint32_ts are the encrypted file. */ - uint32_t hash_b; /* the first two uint32_ts are the encrypted file. */ - uint16_t locale; /* locale information. */ - uint16_t platform; /* platform information and zero is default. */ - uint32_t block_table_index; /* index to file description block. */ -} PACK_STRUCT mpq_hash_s; - -/* file description block contains informations about the file. */ -typedef struct { - uint32_t offset; /* block file starting position in the archive. */ - uint32_t packed_size; /* packed file size. */ - uint32_t unpacked_size; /* unpacked file size. */ - uint32_t flags; /* flags. */ -} PACK_STRUCT mpq_block_s; - -/* extended file description block contains information about the offset beyond 2^32 (4GB). */ -typedef struct { - uint16_t offset_high; /* upper 16 bit of the file offset in archive. */ -} PACK_STRUCT mpq_block_ex_s; - -/* file structure used since diablo 1.00 (0x38 bytes). */ -typedef struct { - uint32_t seed; /* seed used for file decrypt. */ - uint32_t *packed_offset; /* position of each file block (only for packed files). */ - uint32_t open_count; /* number of times it has been opened - used for freeing */ -} PACK_STRUCT mpq_file_s; - -/* map structure for valid blocks and hashes (first seen in warcraft 3 archives). */ -typedef struct { - uint32_t block_table_indices; /* real mapping for file number to block entry. */ - uint32_t block_table_diff; /* block table difference between valid blocks and invalid blocks before. */ -} PACK_STRUCT mpq_map_s; -#include "pack_end.h" - -/* archive structure used since diablo 1.00 by blizzard. */ -struct mpq_archive { - - /* generic file information. */ - FILE *fp; /* file handle. */ - - /* generic size information. */ - uint32_t block_size; /* size of the mpq block. */ - off_t archive_offset; /* absolute start position of archive. */ - - /* archive related buffers and tables. */ - mpq_header_s mpq_header; /* mpq file header. */ - mpq_header_ex_s mpq_header_ex; /* mpq extended file header. */ - mpq_hash_s *mpq_hash; /* hash table. */ - mpq_block_s *mpq_block; /* block table. */ - mpq_block_ex_s *mpq_block_ex; /* extended block table. */ - mpq_file_s **mpq_file; /* pointer to the file pointers which are opened. */ - - /* non archive structure related members. */ - mpq_map_s *mpq_map; /* map table between valid blocks and hashes. */ - uint32_t files; /* number of files in archive, which could be extracted. */ -}; - -#endif /* _MPQ_INTERNAL_H */ diff --git a/dep/libmpq/libmpq/mpq.c b/dep/libmpq/libmpq/mpq.c deleted file mode 100644 index a6ab5db82d9..00000000000 --- a/dep/libmpq/libmpq/mpq.c +++ /dev/null @@ -1,1004 +0,0 @@ -/* - * mpq.c -- functions for developers using libmpq. - * - * Copyright (c) 2003-2008 Maik Broemme - * - * 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; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; 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. - */ - -/* mpq-tools configuration includes. */ -#include "config.h" - -/* libmpq main includes. */ -#include "mpq.h" -#include "mpq-internal.h" - -/* libmpq generic includes. */ -#include "common.h" - -/* generic includes. */ -#include -#include -#include -#include - -/* support for platform specific things */ -#include "platform.h" - -/* this function returns the library version information. */ -const char *libmpq__version(void) { - - /* return version information. */ - return VERSION; -} - -static const char *__libmpq_error_strings[] = { - "success", - "open error on file", - "close error on file", - "lseek error on file", - "read error on file", - "write error on file", - "memory allocation error", - "format errror", - "init() wasn't called", - "buffer size is to small", - "file or block does not exist in archive", - "we don't know the decryption seed", - "error on unpacking file" - }; - -/* this function returns a string message for a return code. */ -const char *libmpq__strerror(int32_t returncode) { - /* check for array bounds */ - if (-returncode < 0 || -returncode > sizeof(__libmpq_error_strings)/sizeof(char*)) - return NULL; - - /* return appropriate string */ - return __libmpq_error_strings[-returncode]; -} - -/* this function read a file and verify if it is a valid mpq archive, then it read and decrypt the hash table. */ -int32_t libmpq__archive_open(mpq_archive_s **mpq_archive, const char *mpq_filename, libmpq__off_t archive_offset) { - - /* some common variables. */ - uint32_t rb = 0; - uint32_t i = 0; - uint32_t count = 0; - int32_t result = 0; - uint32_t header_search = FALSE; - - if (archive_offset == -1) { - archive_offset = 0; - header_search = TRUE; - } - - if ((*mpq_archive = calloc(1, sizeof(mpq_archive_s))) == NULL) { - - /* archive struct could not be allocated */ - return LIBMPQ_ERROR_MALLOC; - } - - /* check if file exists and is readable */ - if (((*mpq_archive)->fp = fopen(mpq_filename, "rb")) == NULL) { - - /* file could not be opened. */ - result = LIBMPQ_ERROR_OPEN; - goto error; - } - - /* assign some default values. */ - (*mpq_archive)->mpq_header.mpq_magic = 0; - (*mpq_archive)->files = 0; - - /* loop through file and search for mpq signature. */ - while (TRUE) { - - /* reset header values. */ - (*mpq_archive)->mpq_header.mpq_magic = 0; - - /* seek in file. */ - if (fseeko((*mpq_archive)->fp, archive_offset, SEEK_SET) < 0) { - - /* seek in file failed. */ - result = LIBMPQ_ERROR_SEEK; - goto error; - } - - /* read header from file. */ - if ((rb = fread(&(*mpq_archive)->mpq_header, 1, sizeof(mpq_header_s), (*mpq_archive)->fp)) != sizeof(mpq_header_s)) { - - /* no valid mpq archive. */ - result = LIBMPQ_ERROR_FORMAT; - goto error; - } - - /* check if we found a valid mpq header. */ - if ((*mpq_archive)->mpq_header.mpq_magic == LIBMPQ_HEADER) { - - /* check if we process old mpq archive version. */ - if ((*mpq_archive)->mpq_header.version == LIBMPQ_ARCHIVE_VERSION_ONE) { - - /* check if the archive is protected. */ - if ((*mpq_archive)->mpq_header.header_size != sizeof(mpq_header_s)) { - - /* correct header size. */ - (*mpq_archive)->mpq_header.header_size = sizeof(mpq_header_s); - } - } - - /* check if we process new mpq archive version. */ - if ((*mpq_archive)->mpq_header.version == LIBMPQ_ARCHIVE_VERSION_TWO) { - - /* check if the archive is protected. */ - if ((*mpq_archive)->mpq_header.header_size != sizeof(mpq_header_s) + sizeof(mpq_header_ex_s)) { - - /* correct header size. */ - (*mpq_archive)->mpq_header.header_size = sizeof(mpq_header_s) + sizeof(mpq_header_ex_s); - } - } - - /* break the loop, because header was found. */ - break; - } - - /* move to the next possible offset. */ - if (!header_search) { - - /* no valid mpq archive. */ - result = LIBMPQ_ERROR_FORMAT; - goto error; - } - archive_offset += 512; - } - - /* store block size for later use. */ - (*mpq_archive)->block_size = 512 << (*mpq_archive)->mpq_header.block_size; - - /* store archive offset and size for later use. */ - (*mpq_archive)->archive_offset = archive_offset; - - /* check if we process new mpq archive version. */ - if ((*mpq_archive)->mpq_header.version == LIBMPQ_ARCHIVE_VERSION_TWO) { - - /* seek in file. */ - if (fseeko((*mpq_archive)->fp, sizeof(mpq_header_s) + archive_offset, SEEK_SET) < 0) { - - /* seek in file failed. */ - result = LIBMPQ_ERROR_SEEK; - goto error; - } - - /* read header from file. */ - if ((rb = fread(&(*mpq_archive)->mpq_header_ex, 1, sizeof(mpq_header_ex_s), (*mpq_archive)->fp)) != sizeof(mpq_header_ex_s)) { - - /* no valid mpq archive. */ - result = LIBMPQ_ERROR_FORMAT; - goto error; - } - } - - /* allocate memory for the block table, hash table, file and block table to file mapping. */ - if (((*mpq_archive)->mpq_block = calloc((*mpq_archive)->mpq_header.block_table_count, sizeof(mpq_block_s))) == NULL || - ((*mpq_archive)->mpq_block_ex = calloc((*mpq_archive)->mpq_header.block_table_count, sizeof(mpq_block_ex_s))) == NULL || - ((*mpq_archive)->mpq_hash = calloc((*mpq_archive)->mpq_header.hash_table_count, sizeof(mpq_hash_s))) == NULL || - ((*mpq_archive)->mpq_file = calloc((*mpq_archive)->mpq_header.block_table_count, sizeof(mpq_file_s))) == NULL || - ((*mpq_archive)->mpq_map = calloc((*mpq_archive)->mpq_header.block_table_count, sizeof(mpq_map_s))) == NULL) { - - /* memory allocation problem. */ - result = LIBMPQ_ERROR_MALLOC; - goto error; - } - - /* seek in file. */ - if (fseeko((*mpq_archive)->fp, (*mpq_archive)->mpq_header.hash_table_offset + (((long long)((*mpq_archive)->mpq_header_ex.hash_table_offset_high)) << 32) + (*mpq_archive)->archive_offset, SEEK_SET) < 0) { - - /* seek in file failed. */ - result = LIBMPQ_ERROR_SEEK; - goto error; - } - - /* read the hash table into the buffer. */ - if ((rb = fread((*mpq_archive)->mpq_hash, 1, (*mpq_archive)->mpq_header.hash_table_count * sizeof(mpq_hash_s), (*mpq_archive)->fp)) < 0) { - - /* something on read failed. */ - result = LIBMPQ_ERROR_READ; - goto error; - } - - /* decrypt the hashtable. */ - libmpq__decrypt_block((uint32_t *)((*mpq_archive)->mpq_hash), (*mpq_archive)->mpq_header.hash_table_count * sizeof(mpq_hash_s), libmpq__hash_string("(hash table)", 0x300)); - - /* seek in file. */ - if (fseeko((*mpq_archive)->fp, (*mpq_archive)->mpq_header.block_table_offset + (((long long)((*mpq_archive)->mpq_header_ex.block_table_offset_high)) << 32) + (*mpq_archive)->archive_offset, SEEK_SET) < 0) { - - /* seek in file failed. */ - result = LIBMPQ_ERROR_SEEK; - goto error; - } - - /* read the block table into the buffer. */ - if ((rb = fread((*mpq_archive)->mpq_block, 1, (*mpq_archive)->mpq_header.block_table_count * sizeof(mpq_block_s), (*mpq_archive)->fp)) < 0) { - - /* something on read failed. */ - result = LIBMPQ_ERROR_READ; - goto error; - } - - /* decrypt block table. */ - libmpq__decrypt_block((uint32_t *)((*mpq_archive)->mpq_block), (*mpq_archive)->mpq_header.block_table_count * sizeof(mpq_block_s), libmpq__hash_string("(block table)", 0x300)); - - /* check if extended block table is present, regardless of version 2 it is only present in archives > 4GB. */ - if ((*mpq_archive)->mpq_header_ex.extended_offset > 0) { - - /* seek in file. */ - if (fseeko((*mpq_archive)->fp, (*mpq_archive)->mpq_header_ex.extended_offset + archive_offset, SEEK_SET) < 0) { - - /* seek in file failed. */ - result = LIBMPQ_ERROR_SEEK; - goto error; - } - - /* read header from file. */ - if ((rb = fread((*mpq_archive)->mpq_block_ex, 1, (*mpq_archive)->mpq_header.block_table_count * sizeof(mpq_block_ex_s), (*mpq_archive)->fp)) < 0) { - - /* no valid mpq archive. */ - result = LIBMPQ_ERROR_FORMAT; - goto error; - } - } - - /* loop through all files in mpq archive and check if they are valid. */ - for (i = 0; i < (*mpq_archive)->mpq_header.block_table_count; i++) { - - /* save block difference between valid and invalid blocks. */ - (*mpq_archive)->mpq_map[i].block_table_diff = i - count; - - /* check if file exists, sizes and offsets are correct. */ - if (((*mpq_archive)->mpq_block[i].flags & LIBMPQ_FLAG_EXISTS) == 0) { - - /* file does not exist, so nothing to do with that block. */ - continue; - } - - /* create final indices tables. */ - (*mpq_archive)->mpq_map[count].block_table_indices = i; - - /* increase file counter. */ - count++; - } - - /* save the number of files. */ - (*mpq_archive)->files = count; - - /* if no error was found, return zero. */ - return LIBMPQ_SUCCESS; - -error: - if ((*mpq_archive)->fp) - fclose((*mpq_archive)->fp); - - free((*mpq_archive)->mpq_map); - free((*mpq_archive)->mpq_file); - free((*mpq_archive)->mpq_hash); - free((*mpq_archive)->mpq_block); - free((*mpq_archive)->mpq_block_ex); - free(*mpq_archive); - - *mpq_archive = NULL; - - return result; -} - -/* this function close the file descriptor, free the decryption buffer and the file list. */ -int32_t libmpq__archive_close(mpq_archive_s *mpq_archive) { - - /* try to close the file */ - if ((fclose(mpq_archive->fp)) < 0) { - - /* don't free anything here, so the caller can try calling us - * again. - */ - return LIBMPQ_ERROR_CLOSE; - } - - /* free header, tables and list. */ - free(mpq_archive->mpq_map); - free(mpq_archive->mpq_file); - free(mpq_archive->mpq_hash); - free(mpq_archive->mpq_block); - free(mpq_archive->mpq_block_ex); - free(mpq_archive); - - /* if no error was found, return zero. */ - return LIBMPQ_SUCCESS; -} - -/* this function return the packed size of all files in the archive. */ -int32_t libmpq__archive_packed_size(mpq_archive_s *mpq_archive, libmpq__off_t *packed_size) { - - /* some common variables. */ - uint32_t i; - - /* loop through all files in archive and count packed size. */ - for (i = 0; i < mpq_archive->files; i++) { - *packed_size += mpq_archive->mpq_block[mpq_archive->mpq_map[i].block_table_indices].packed_size; - } - - /* if no error was found, return zero. */ - return LIBMPQ_SUCCESS; -} - -/* this function return the unpacked size of all files in the archive. */ -int32_t libmpq__archive_unpacked_size(mpq_archive_s *mpq_archive, libmpq__off_t *unpacked_size) { - - /* some common variables. */ - uint32_t i; - - /* loop through all files in archive and count unpacked size. */ - for (i = 0; i < mpq_archive->files; i++) { - *unpacked_size += mpq_archive->mpq_block[mpq_archive->mpq_map[i].block_table_indices].unpacked_size; - } - - /* if no error was found, return zero. */ - return LIBMPQ_SUCCESS; -} - -/* this function return the archive offset (beginning of archive in file). */ -int32_t libmpq__archive_offset(mpq_archive_s *mpq_archive, libmpq__off_t *offset) { - - /* return archive offset. */ - *offset = mpq_archive->archive_offset; - - /* if no error was found, return zero. */ - return LIBMPQ_SUCCESS; -} - -/* this function return the archive offset. */ -int32_t libmpq__archive_version(mpq_archive_s *mpq_archive, uint32_t *version) { - - /* return archive version. */ - *version = mpq_archive->mpq_header.version + 1; - - /* if no error was found, return zero. */ - return LIBMPQ_SUCCESS; -} - -/* this function return the number of valid files in archive. */ -int32_t libmpq__archive_files(mpq_archive_s *mpq_archive, uint32_t *files) { - - /* return archive version. */ - *files = mpq_archive->files; - - /* if no error was found, return zero. */ - return LIBMPQ_SUCCESS; -} - -#define CHECK_FILE_NUM(file_number, mpq_archive) \ - if (file_number < 0 || file_number > mpq_archive->files - 1) { \ - return LIBMPQ_ERROR_EXIST; \ - } - -#define CHECK_BLOCK_NUM(block_number, mpq_archive) \ - if (block_number < 0 || block_number >= ((mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].flags & LIBMPQ_FLAG_SINGLE) != 0 ? 1 : (mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].unpacked_size + mpq_archive->block_size - 1) / mpq_archive->block_size)) { \ - return LIBMPQ_ERROR_EXIST; \ - } - -/* this function return the packed size of the given files in the archive. */ -int32_t libmpq__file_packed_size(mpq_archive_s *mpq_archive, uint32_t file_number, libmpq__off_t *packed_size) { - - /* check if given file number is not out of range. */ - CHECK_FILE_NUM(file_number, mpq_archive) - - /* get the packed size of file. */ - *packed_size = mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].packed_size; - - /* if no error was found, return zero. */ - return LIBMPQ_SUCCESS; -} - -/* this function return the unpacked size of the given file in the archive. */ -int32_t libmpq__file_unpacked_size(mpq_archive_s *mpq_archive, uint32_t file_number, libmpq__off_t *unpacked_size) { - - /* check if given file number is not out of range. */ - CHECK_FILE_NUM(file_number, mpq_archive) - - /* get the unpacked size of file. */ - *unpacked_size = mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].unpacked_size; - - /* if no error was found, return zero. */ - return LIBMPQ_SUCCESS; -} - -/* this function return the file offset (beginning of file in archive). */ -int32_t libmpq__file_offset(mpq_archive_s *mpq_archive, uint32_t file_number, libmpq__off_t *offset) { - - /* check if given file number is not out of range. */ - CHECK_FILE_NUM(file_number, mpq_archive) - - /* return file offset relative to archive start. */ - *offset = mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].offset + (((long long)mpq_archive->mpq_block_ex[mpq_archive->mpq_map[file_number].block_table_indices].offset_high) << 32); - - /* if no error was found, return zero. */ - return LIBMPQ_SUCCESS; -} - -/* this function return the number of blocks for the given file in the archive. */ -int32_t libmpq__file_blocks(mpq_archive_s *mpq_archive, uint32_t file_number, uint32_t *blocks) { - - /* check if given file number is not out of range. */ - CHECK_FILE_NUM(file_number, mpq_archive) - - /* return the number of blocks for the given file. */ - *blocks = (mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].flags & LIBMPQ_FLAG_SINGLE) != 0 ? 1 : (mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].unpacked_size + mpq_archive->block_size - 1) / mpq_archive->block_size; - - /* if no error was found, return zero. */ - return LIBMPQ_SUCCESS; -} - -/* this function return if the file is encrypted or not. */ -int32_t libmpq__file_encrypted(mpq_archive_s *mpq_archive, uint32_t file_number, uint32_t *encrypted) { - - /* check if given file number is not out of range. */ - CHECK_FILE_NUM(file_number, mpq_archive) - - /* return the encryption status of file. */ - *encrypted = (mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].flags & LIBMPQ_FLAG_ENCRYPTED) != 0 ? TRUE : FALSE; - - /* if no error was found, return zero. */ - return LIBMPQ_SUCCESS; -} - -/* this function return if the file is compressed or not. */ -int32_t libmpq__file_compressed(mpq_archive_s *mpq_archive, uint32_t file_number, uint32_t *compressed) { - - /* check if given file number is not out of range. */ - CHECK_FILE_NUM(file_number, mpq_archive) - - /* return the compression status of file. */ - *compressed = (mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].flags & LIBMPQ_FLAG_COMPRESS_MULTI) != 0 ? TRUE : FALSE; - - /* if no error was found, return zero. */ - return LIBMPQ_SUCCESS; -} - -/* this function return if the file is imploded or not. */ -int32_t libmpq__file_imploded(mpq_archive_s *mpq_archive, uint32_t file_number, uint32_t *imploded) { - - /* check if given file number is not out of range. */ - CHECK_FILE_NUM(file_number, mpq_archive) - - /* return the implosion status of file. */ - *imploded = (mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].flags & LIBMPQ_FLAG_COMPRESS_PKZIP) != 0 ? TRUE : FALSE; - - /* if no error was found, return zero. */ - return LIBMPQ_SUCCESS; -} - -/* this function return filenumber by the given name. */ -int32_t libmpq__file_number(mpq_archive_s *mpq_archive, const char *filename, uint32_t *number) { - - /* some common variables. */ - uint32_t i, hash1, hash2, hash3, ht_count; - - /* if the list of file names doesn't include this one, we'll have - * to figure out the file number the "hard" way. - */ - ht_count = mpq_archive->mpq_header.hash_table_count; - - hash1 = libmpq__hash_string (filename, 0x0) & (ht_count - 1); - hash2 = libmpq__hash_string (filename, 0x100); - hash3 = libmpq__hash_string (filename, 0x200); - - /* loop through all files in mpq archive. - * hash1 gives us a clue about the starting position of this - * search. - */ - for (i = hash1; mpq_archive->mpq_hash[i].block_table_index != LIBMPQ_HASH_FREE; i = (i + 1) & (ht_count - 1)) { - - /* if the other two hashes match, we found our file number. */ - if (mpq_archive->mpq_hash[i].hash_a == hash2 && - mpq_archive->mpq_hash[i].hash_b == hash3) { - - /* return the file number. */ - *number = mpq_archive->mpq_hash[i].block_table_index - mpq_archive->mpq_map[mpq_archive->mpq_hash[i].block_table_index].block_table_diff; - - /* we found our file, return zero. */ - return LIBMPQ_SUCCESS; - } - - /* check if we have cycled through the whole hash table */ - if (((i + 1) & (ht_count - 1)) == hash1) { - break; - } - } - - /* if no matching entry found, so return error. */ - return LIBMPQ_ERROR_EXIST; -} - -/* this function read the given file from archive into a buffer. */ -int32_t libmpq__file_read(mpq_archive_s *mpq_archive, uint32_t file_number, uint8_t *out_buf, libmpq__off_t out_size, libmpq__off_t *transferred) { - - /* some common variables. */ - uint32_t i; - uint32_t blocks = 0; - int32_t result = 0; - libmpq__off_t file_offset = 0; - libmpq__off_t unpacked_size = 0; - libmpq__off_t transferred_block = 0; - libmpq__off_t transferred_total = 0; - - /* check if given file number is not out of range. */ - CHECK_FILE_NUM(file_number, mpq_archive) - - /* get target size of block. */ - libmpq__file_unpacked_size(mpq_archive, file_number, &unpacked_size); - - /* check if target buffer is to small. */ - if (unpacked_size > out_size) { - - /* output buffer size is to small or block size is unknown. */ - return LIBMPQ_ERROR_SIZE; - } - - /* fetch file offset. */ - libmpq__file_offset(mpq_archive, file_number, &file_offset); - - /* get block count for file. */ - libmpq__file_blocks(mpq_archive, file_number, &blocks); - - /* open the packed block offset table. */ - if ((result = libmpq__block_open_offset(mpq_archive, file_number)) < 0) { - - /* something on opening packed block offset table failed. */ - return result; - } - - /* loop through all blocks. */ - for (i = 0; i < blocks; i++) { - - /* cleanup size variable. */ - unpacked_size = 0; - - /* get unpacked block size. */ - libmpq__block_unpacked_size(mpq_archive, file_number, i, &unpacked_size); - - /* read block. */ - if ((result = libmpq__block_read(mpq_archive, file_number, i, out_buf + transferred_total, unpacked_size, &transferred_block)) < 0) { - - /* close the packed block offset table. */ - libmpq__block_close_offset(mpq_archive, file_number); - - /* something on reading block failed. */ - return result; - } - - transferred_total += transferred_block; - - } - - /* close the packed block offset table. */ - libmpq__block_close_offset(mpq_archive, file_number); - - /* check for null pointer. */ - if (transferred != NULL) { - - /* store transferred bytes. */ - *transferred = transferred_total; - } - - /* if no error was found, return zero. */ - return LIBMPQ_SUCCESS; -} - -/* this function open a file in the given archive and caches the block offset information. */ -int32_t libmpq__block_open_offset(mpq_archive_s *mpq_archive, uint32_t file_number) { - - /* some common variables. */ - uint32_t i; - uint32_t packed_size; - int32_t rb = 0; - int32_t result = 0; - - /* check if given file number is not out of range. */ - CHECK_FILE_NUM(file_number, mpq_archive) - - if (mpq_archive->mpq_file[file_number]) { - - /* file already opened, so increment counter */ - mpq_archive->mpq_file[file_number]->open_count++; - return LIBMPQ_SUCCESS; - } - - /* check if file is not stored in a single sector. */ - if ((mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].flags & LIBMPQ_FLAG_SINGLE) == 0) { - - /* get packed size based on block size and block count. */ - packed_size = sizeof(uint32_t) * (((mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].unpacked_size + mpq_archive->block_size - 1) / mpq_archive->block_size) + 1); - } else { - - /* file is stored in single sector and we need only two entries for the packed block offset table. */ - packed_size = sizeof(uint32_t) * 2; - } - - /* check if data has one extra entry. */ - if ((mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].flags & LIBMPQ_FLAG_CRC) != 0) { - - /* add one uint32_t. */ - packed_size += sizeof(uint32_t); - } - - /* allocate memory for the file. */ - if ((mpq_archive->mpq_file[file_number] = calloc(1, sizeof(mpq_file_s))) == NULL) { - - /* memory allocation problem. */ - result = LIBMPQ_ERROR_MALLOC; - goto error; - } - - /* allocate memory for the packed block offset table. */ - if ((mpq_archive->mpq_file[file_number]->packed_offset = calloc(1, packed_size)) == NULL) { - - /* memory allocation problem. */ - result = LIBMPQ_ERROR_MALLOC; - goto error; - } - - /* initialize counter to one opening */ - mpq_archive->mpq_file[file_number]->open_count = 1; - - /* check if we need to load the packed block offset table, we will maintain this table for unpacked files too. */ - if ((mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].flags & LIBMPQ_FLAG_COMPRESSED) != 0 && - (mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].flags & LIBMPQ_FLAG_SINGLE) == 0) { - - /* seek to block position. */ - if (fseeko(mpq_archive->fp, mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].offset + (((long long)mpq_archive->mpq_block_ex[mpq_archive->mpq_map[file_number].block_table_indices].offset_high) << 32) + mpq_archive->archive_offset, SEEK_SET) < 0) { - - /* seek in file failed. */ - result = LIBMPQ_ERROR_SEEK; - goto error; - } - - /* read block positions from begin of file. */ - if ((rb = fread(mpq_archive->mpq_file[file_number]->packed_offset, 1, packed_size, mpq_archive->fp)) < 0) { - - /* something on read from archive failed. */ - result = LIBMPQ_ERROR_READ; - goto error; - } - - /* check if the archive is protected some way, sometimes the file appears not to be encrypted, but it is. - * a special case are files with an additional sector but LIBMPQ_FLAG_CRC not set. we don't want to handle - * them as encrypted. */ - if (mpq_archive->mpq_file[file_number]->packed_offset[0] != rb && - mpq_archive->mpq_file[file_number]->packed_offset[0] != rb + 4) { - - /* file is encrypted. */ - mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].flags |= LIBMPQ_FLAG_ENCRYPTED; - } - - /* check if packed offset block is encrypted, we have to decrypt it. */ - if (mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].flags & LIBMPQ_FLAG_ENCRYPTED) { - - /* check if we don't know the file seed, try to find it. */ - if (libmpq__decrypt_key((uint8_t *)mpq_archive->mpq_file[file_number]->packed_offset, packed_size, mpq_archive->block_size, &mpq_archive->mpq_file[file_number]->seed) < 0) { - - /* sorry without seed, we cannot extract file. */ - result = LIBMPQ_ERROR_DECRYPT; - goto error; - } - - /* decrypt block in input buffer. */ - if (libmpq__decrypt_block(mpq_archive->mpq_file[file_number]->packed_offset, packed_size, mpq_archive->mpq_file[file_number]->seed - 1) < 0 ) { - - /* something on decrypt failed. */ - result = LIBMPQ_ERROR_DECRYPT; - goto error; - } - - /* check if the block positions are correctly decrypted. */ - if (mpq_archive->mpq_file[file_number]->packed_offset[0] != packed_size) { - - /* sorry without seed, we cannot extract file. */ - result = LIBMPQ_ERROR_DECRYPT; - goto error; - } - } - } else { - - /* check if file is not stored in a single sector. */ - if ((mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].flags & LIBMPQ_FLAG_SINGLE) == 0) { - - /* loop through all blocks and create packed block offset table based on block size. */ - for (i = 0; i < ((mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].unpacked_size + mpq_archive->block_size - 1) / mpq_archive->block_size + 1); i++) { - - /* check if we process the last block. */ - if (i == ((mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].unpacked_size + mpq_archive->block_size - 1) / mpq_archive->block_size)) { - - /* store size of last block. */ - mpq_archive->mpq_file[file_number]->packed_offset[i] = mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].unpacked_size; - } else { - - /* store default block size. */ - mpq_archive->mpq_file[file_number]->packed_offset[i] = i * mpq_archive->block_size; - } - } - } else { - - /* store offsets. */ - mpq_archive->mpq_file[file_number]->packed_offset[0] = 0; - mpq_archive->mpq_file[file_number]->packed_offset[1] = mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].packed_size; - } - } - - /* if no error was found, return zero. */ - return LIBMPQ_SUCCESS; - -error: - - /* free packed block offset table and file pointer. */ - free(mpq_archive->mpq_file[file_number]->packed_offset); - free(mpq_archive->mpq_file[file_number]); - - /* return error constant. */ - return result; -} - -/* this function free the file pointer to the opened file in archive. */ -int32_t libmpq__block_close_offset(mpq_archive_s *mpq_archive, uint32_t file_number) { - - /* check if given file number is not out of range. */ - CHECK_FILE_NUM(file_number, mpq_archive) - - if (mpq_archive->mpq_file[file_number] == NULL) { - - /* packed block offset table is not opened. */ - return LIBMPQ_ERROR_OPEN; - } - - mpq_archive->mpq_file[file_number]->open_count--; - - if (mpq_archive->mpq_file[file_number]->open_count != 0) { - - /* still in use */ - return LIBMPQ_SUCCESS; - } - - /* free packed block offset table and file pointer. */ - free(mpq_archive->mpq_file[file_number]->packed_offset); - free(mpq_archive->mpq_file[file_number]); - - /* mark it as unopened - libmpq__block_open_offset checks for this to decide whether to increment the counter */ - mpq_archive->mpq_file[file_number] = NULL; - - /* if no error was found, return zero. */ - return LIBMPQ_SUCCESS; -} - -/* this function return the unpacked size of the given file and block in the archive. */ -int32_t libmpq__block_unpacked_size(mpq_archive_s *mpq_archive, uint32_t file_number, uint32_t block_number, libmpq__off_t *unpacked_size) { - - /* check if given file number is not out of range. */ - CHECK_FILE_NUM(file_number, mpq_archive) - - /* check if given block number is not out of range. */ - CHECK_BLOCK_NUM(block_number, mpq_archive) - - /* check if packed block offset table is opened. */ - if (mpq_archive->mpq_file[file_number] == NULL || - mpq_archive->mpq_file[file_number]->packed_offset == NULL) { - - /* packed block offset table is not opened. */ - return LIBMPQ_ERROR_OPEN; - } - - /* check if block is stored as single sector. */ - if ((mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].flags & LIBMPQ_FLAG_SINGLE) != 0) { - - /* return the unpacked size of the block in the mpq archive. */ - *unpacked_size = mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].unpacked_size; - } - - /* check if block is not stored as single sector. */ - if ((mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].flags & LIBMPQ_FLAG_SINGLE) == 0) { - - /* check if we not process the last block. */ - if (block_number < ((mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].unpacked_size + mpq_archive->block_size - 1) / mpq_archive->block_size) - 1) { - - /* return the block size as unpacked size. */ - *unpacked_size = mpq_archive->block_size; - } else { - - /* return the unpacked size of the last block in the mpq archive. */ - *unpacked_size = mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].unpacked_size - mpq_archive->block_size * block_number; - } - } - - /* if no error was found, return zero. */ - return LIBMPQ_SUCCESS; -} - -/* this function return the decryption seed for the given file and block. */ -int32_t libmpq__block_seed(mpq_archive_s *mpq_archive, uint32_t file_number, uint32_t block_number, uint32_t *seed) { - - /* check if given file number is not out of range. */ - CHECK_FILE_NUM(file_number, mpq_archive) - - /* check if given block number is not out of range. */ - CHECK_BLOCK_NUM(block_number, mpq_archive) - - /* check if packed block offset table is opened. */ - if (mpq_archive->mpq_file[file_number] == NULL || - mpq_archive->mpq_file[file_number]->packed_offset == NULL) { - - /* packed block offset table is not opened. */ - return LIBMPQ_ERROR_OPEN; - } - - /* return the decryption key. */ - *seed = mpq_archive->mpq_file[file_number]->seed + block_number; - - /* if no error was found, return zero. */ - return LIBMPQ_SUCCESS; -} - -/* this function read the given block from archive into a buffer. */ -int32_t libmpq__block_read(mpq_archive_s *mpq_archive, uint32_t file_number, uint32_t block_number, uint8_t *out_buf, libmpq__off_t out_size, libmpq__off_t *transferred) { - - /* some common variables. */ - uint8_t *in_buf; - uint32_t seed = 0; - uint32_t encrypted = 0; - uint32_t compressed = 0; - uint32_t imploded = 0; - int32_t tb = 0; - libmpq__off_t block_offset = 0; - off_t in_size = 0; - libmpq__off_t unpacked_size = 0; - - /* check if given file number is not out of range. */ - CHECK_FILE_NUM(file_number, mpq_archive) - - /* check if given block number is not out of range. */ - CHECK_BLOCK_NUM(block_number, mpq_archive) - - /* check if packed block offset table is opened. */ - if (mpq_archive->mpq_file[file_number] == NULL || - mpq_archive->mpq_file[file_number]->packed_offset == NULL) { - - /* packed block offset table is not opened. */ - return LIBMPQ_ERROR_OPEN; - } - - /* get target size of block. */ - libmpq__block_unpacked_size(mpq_archive, file_number, block_number, &unpacked_size); - - /* check if target buffer is to small. */ - if (unpacked_size > out_size) { - - /* output buffer size is to small or block size is unknown. */ - return LIBMPQ_ERROR_SIZE; - } - - /* fetch some required values like input buffer size and block offset. */ - block_offset = mpq_archive->mpq_block[mpq_archive->mpq_map[file_number].block_table_indices].offset + (((long long)mpq_archive->mpq_block_ex[mpq_archive->mpq_map[file_number].block_table_indices].offset_high) << 32) + mpq_archive->mpq_file[file_number]->packed_offset[block_number]; - in_size = mpq_archive->mpq_file[file_number]->packed_offset[block_number + 1] - mpq_archive->mpq_file[file_number]->packed_offset[block_number]; - - /* seek in file. */ - if (fseeko(mpq_archive->fp, block_offset + mpq_archive->archive_offset, SEEK_SET) < 0) { - - /* something with seek in file failed. */ - return LIBMPQ_ERROR_SEEK; - } - - /* allocate memory for the read buffer. */ - if ((in_buf = calloc(1, in_size)) == NULL) { - - /* memory allocation problem. */ - return LIBMPQ_ERROR_MALLOC; - } - - /* read block from file. */ - if (fread(in_buf, 1, in_size, mpq_archive->fp) < 0) { - - /* free buffers. */ - free(in_buf); - - /* something on reading block failed. */ - return LIBMPQ_ERROR_READ; - } - - /* get encryption status. */ - libmpq__file_encrypted(mpq_archive, file_number, &encrypted); - - /* check if file is encrypted. */ - if (encrypted == 1) { - - /* get decryption key. */ - libmpq__block_seed(mpq_archive, file_number, block_number, &seed); - - /* decrypt block. */ - if (libmpq__decrypt_block((uint32_t *)in_buf, in_size, seed) < 0) { - - /* free buffers. */ - free(in_buf); - - /* something on decrypting block failed. */ - return LIBMPQ_ERROR_DECRYPT; - } - } - - /* get compression status. */ - libmpq__file_compressed(mpq_archive, file_number, &compressed); - - /* check if file is compressed. */ - if (compressed == 1) { - - /* decompress block. */ - if ((tb = libmpq__decompress_block(in_buf, in_size, out_buf, out_size, LIBMPQ_FLAG_COMPRESS_MULTI)) < 0) { - - /* free temporary buffer. */ - free(in_buf); - - /* something on decompressing block failed. */ - return LIBMPQ_ERROR_UNPACK; - } - } - - /* get implosion status. */ - libmpq__file_imploded(mpq_archive, file_number, &imploded); - - /* check if file is imploded. */ - if (imploded == 1) { - - /* explode block. */ - if ((tb = libmpq__decompress_block(in_buf, in_size, out_buf, out_size, LIBMPQ_FLAG_COMPRESS_PKZIP)) < 0) { - - /* free temporary buffer. */ - free(in_buf); - - /* something on decompressing block failed. */ - return LIBMPQ_ERROR_UNPACK; - } - } - - /* check if file is neither compressed nor imploded. */ - if (compressed == 0 && imploded == 0) { - - /* copy block. */ - if ((tb = libmpq__decompress_block(in_buf, in_size, out_buf, out_size, LIBMPQ_FLAG_COMPRESS_NONE)) < 0) { - - /* free temporary buffer. */ - free(in_buf); - - /* something on decompressing block failed. */ - return LIBMPQ_ERROR_UNPACK; - } - } - - /* free read buffer. */ - free(in_buf); - - /* check for null pointer. */ - if (transferred != NULL) { - - /* store transferred bytes. */ - *transferred = tb; - } - - /* if no error was found, return zero. */ - return LIBMPQ_SUCCESS; -} diff --git a/dep/libmpq/libmpq/mpq.h b/dep/libmpq/libmpq/mpq.h deleted file mode 100644 index abd4862c334..00000000000 --- a/dep/libmpq/libmpq/mpq.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * mpq.h -- some default types and defines. - * - * Copyright (c) 2003-2008 Maik Broemme - * - * Some parts (the encryption and decryption stuff) were adapted from - * the C++ version of StormLib.h and StormPort.h included in stormlib. - * The C++ version belongs to the following authors: - * - * Ladislav Zezula - * Marko Friedemann - * - * 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; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; 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 _MPQ_H -#define _MPQ_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* generic includes. */ -#include -#include - -#if defined(__GNUC__) && (__GNUC__ >= 4) -# define LIBMPQ_API __attribute__((visibility("default"))) -#else -# define LIBMPQ_API -#endif - -/* define errors. */ -#define LIBMPQ_ERROR_OPEN -1 /* open error on file. */ -#define LIBMPQ_ERROR_CLOSE -2 /* close error on file. */ -#define LIBMPQ_ERROR_SEEK -3 /* lseek error on file. */ -#define LIBMPQ_ERROR_READ -4 /* read error on file. */ -#define LIBMPQ_ERROR_WRITE -5 /* write error on file. */ -#define LIBMPQ_ERROR_MALLOC -6 /* memory allocation error. */ -#define LIBMPQ_ERROR_FORMAT -7 /* format errror. */ -#define LIBMPQ_ERROR_NOT_INITIALIZED -8 /* libmpq__init() wasn't called. */ -#define LIBMPQ_ERROR_SIZE -9 /* buffer size is to small. */ -#define LIBMPQ_ERROR_EXIST -10 /* file or block does not exist in archive. */ -#define LIBMPQ_ERROR_DECRYPT -11 /* we don't know the decryption seed. */ -#define LIBMPQ_ERROR_UNPACK -12 /* error on unpacking file. */ - -/* internal data structure. */ -typedef struct mpq_archive mpq_archive_s; - -/* file offset data type for API*/ -typedef int64_t libmpq__off_t; - -/* generic information about library. */ -extern LIBMPQ_API const char *libmpq__version(void); - -/* string error message for a libmpq return code. */ -extern LIBMPQ_API const char *libmpq__strerror(int32_t returncode); - -/* generic mpq archive information. */ -extern LIBMPQ_API int32_t libmpq__archive_open(mpq_archive_s **mpq_archive, const char *mpq_filename, libmpq__off_t archive_offset); -extern LIBMPQ_API int32_t libmpq__archive_close(mpq_archive_s *mpq_archive); -extern LIBMPQ_API int32_t libmpq__archive_packed_size(mpq_archive_s *mpq_archive, libmpq__off_t *packed_size); -extern LIBMPQ_API int32_t libmpq__archive_unpacked_size(mpq_archive_s *mpq_archive, libmpq__off_t *unpacked_size); -extern LIBMPQ_API int32_t libmpq__archive_offset(mpq_archive_s *mpq_archive, libmpq__off_t *offset); -extern LIBMPQ_API int32_t libmpq__archive_version(mpq_archive_s *mpq_archive, uint32_t *version); -extern LIBMPQ_API int32_t libmpq__archive_files(mpq_archive_s *mpq_archive, uint32_t *files); - -/* generic file processing functions. */ -extern LIBMPQ_API int32_t libmpq__file_packed_size(mpq_archive_s *mpq_archive, uint32_t file_number, libmpq__off_t *packed_size); -extern LIBMPQ_API int32_t libmpq__file_unpacked_size(mpq_archive_s *mpq_archive, uint32_t file_number, libmpq__off_t *unpacked_size); -extern LIBMPQ_API int32_t libmpq__file_offset(mpq_archive_s *mpq_archive, uint32_t file_number, libmpq__off_t *offset); -extern LIBMPQ_API int32_t libmpq__file_blocks(mpq_archive_s *mpq_archive, uint32_t file_number, uint32_t *blocks); -extern LIBMPQ_API int32_t libmpq__file_encrypted(mpq_archive_s *mpq_archive, uint32_t file_number, uint32_t *encrypted); -extern LIBMPQ_API int32_t libmpq__file_compressed(mpq_archive_s *mpq_archive, uint32_t file_number, uint32_t *compressed); -extern LIBMPQ_API int32_t libmpq__file_imploded(mpq_archive_s *mpq_archive, uint32_t file_number, uint32_t *imploded); -extern LIBMPQ_API int32_t libmpq__file_number(mpq_archive_s *mpq_archive, const char *filename, uint32_t *number); -extern LIBMPQ_API int32_t libmpq__file_read(mpq_archive_s *mpq_archive, uint32_t file_number, uint8_t *out_buf, libmpq__off_t out_size, libmpq__off_t *transferred); - -/* generic block processing functions. */ -extern LIBMPQ_API int32_t libmpq__block_open_offset(mpq_archive_s *mpq_archive, uint32_t file_number); -extern LIBMPQ_API int32_t libmpq__block_close_offset(mpq_archive_s *mpq_archive, uint32_t file_number); -extern LIBMPQ_API int32_t libmpq__block_unpacked_size(mpq_archive_s *mpq_archive, uint32_t file_number, uint32_t block_number, libmpq__off_t *unpacked_size); -extern LIBMPQ_API int32_t libmpq__block_read(mpq_archive_s *mpq_archive, uint32_t file_number, uint32_t block_number, uint8_t *out_buf, libmpq__off_t out_size, libmpq__off_t *transferred); - -#ifdef __cplusplus -} -#endif - -#endif /* _MPQ_H */ diff --git a/dep/libmpq/libmpq/pack_begin.h b/dep/libmpq/libmpq/pack_begin.h deleted file mode 100644 index eb4a6ddebbb..00000000000 --- a/dep/libmpq/libmpq/pack_begin.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * pack_begin.h -- header file for struct packing used by libmpq. - * - * Copyright (c) 2010 Georg Lukas - * - * 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; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; 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 _PACK_BEGIN -#define _PACK_BEGIN -#else -#error "pack_begin.h may not be included twice!" -#endif - -#ifdef _MSC_VER - #pragma pack(push,1) - #define PACK_STRUCT -#else - /* we assume GNU here */ - #define PACK_STRUCT __attribute__((packed)) -#endif - diff --git a/dep/libmpq/libmpq/pack_end.h b/dep/libmpq/libmpq/pack_end.h deleted file mode 100644 index a8a35113bfb..00000000000 --- a/dep/libmpq/libmpq/pack_end.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * pack_end.h -- header file for struct packing used by libmpq. - * - * Copyright (c) 2010 Georg Lukas - * - * 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; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; 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. - */ - -#ifdef _PACK_BEGIN -#undef _PACK_BEGIN -#else -#error "pack_begin.h must be includede before pack_end.h" -#endif - -#ifdef _MSC_VER - #pragma pack(pop) -#endif - -#undef PACK_STRUCT diff --git a/dep/libmpq/libmpq/platform.h b/dep/libmpq/libmpq/platform.h deleted file mode 100644 index 68fdfdc5ded..00000000000 --- a/dep/libmpq/libmpq/platform.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * platform.h -- header file for platform specific parts. - * - * Copyright (c) 2010 Georg Lukas - * - * 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; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; 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 _PLATFORM_H -#define _PLATFORM_H - -#ifdef _MSC_VER - #define fseeko _fseeki64 -#endif - -#endif /* _PLATFORM_H */ diff --git a/dep/libmpq/libmpq/wave.c b/dep/libmpq/libmpq/wave.c deleted file mode 100644 index 628593fce83..00000000000 --- a/dep/libmpq/libmpq/wave.c +++ /dev/null @@ -1,250 +0,0 @@ -/* - * wave.c -- this file contains decompression methods used by mpq-tools - * to decompress wave files. - * - * Copyright (c) 2003-2007 Maik Broemme - * - * This source was adepted from the C++ version of wave.cpp included - * in stormlib. The C++ version belongs to the following authors: - * - * Ladislav Zezula - * Tom Amigo - * - * 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; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; 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. - */ - -/* generic includes. */ -#include - -/* libmpq generic includes. */ -#include "wave.h" - -/* table necessary dor decompression. */ -static const uint32_t wave_table_1503f120[] = { - 0xFFFFFFFF, 0x00000000, 0xFFFFFFFF, 0x00000004, 0xFFFFFFFF, 0x00000002, 0xFFFFFFFF, 0x00000006, - 0xFFFFFFFF, 0x00000001, 0xFFFFFFFF, 0x00000005, 0xFFFFFFFF, 0x00000003, 0xFFFFFFFF, 0x00000007, - 0xFFFFFFFF, 0x00000001, 0xFFFFFFFF, 0x00000005, 0xFFFFFFFF, 0x00000003, 0xFFFFFFFF, 0x00000007, - 0xFFFFFFFF, 0x00000002, 0xFFFFFFFF, 0x00000004, 0xFFFFFFFF, 0x00000006, 0xFFFFFFFF, 0x00000008 -}; - -/* table necessary dor decompression. */ -static const uint32_t wave_table_1503f1a0[] = { - 0x00000007, 0x00000008, 0x00000009, 0x0000000A, 0x0000000B, 0x0000000C, 0x0000000D, 0x0000000E, - 0x00000010, 0x00000011, 0x00000013, 0x00000015, 0x00000017, 0x00000019, 0x0000001C, 0x0000001F, - 0x00000022, 0x00000025, 0x00000029, 0x0000002D, 0x00000032, 0x00000037, 0x0000003C, 0x00000042, - 0x00000049, 0x00000050, 0x00000058, 0x00000061, 0x0000006B, 0x00000076, 0x00000082, 0x0000008F, - 0x0000009D, 0x000000AD, 0x000000BE, 0x000000D1, 0x000000E6, 0x000000FD, 0x00000117, 0x00000133, - 0x00000151, 0x00000173, 0x00000198, 0x000001C1, 0x000001EE, 0x00000220, 0x00000256, 0x00000292, - 0x000002D4, 0x0000031C, 0x0000036C, 0x000003C3, 0x00000424, 0x0000048E, 0x00000502, 0x00000583, - 0x00000610, 0x000006AB, 0x00000756, 0x00000812, 0x000008E0, 0x000009C3, 0x00000ABD, 0x00000BD0, - 0x00000CFF, 0x00000E4C, 0x00000FBA, 0x0000114C, 0x00001307, 0x000014EE, 0x00001706, 0x00001954, - 0x00001BDC, 0x00001EA5, 0x000021B6, 0x00002515, 0x000028CA, 0x00002CDF, 0x0000315B, 0x0000364B, - 0x00003BB9, 0x000041B2, 0x00004844, 0x00004F7E, 0x00005771, 0x0000602F, 0x000069CE, 0x00007462, - 0x00007FFF -}; - -/* this function decompress a wave file, mono or stereo, 1500F230 offset. */ -int32_t libmpq__do_decompress_wave(uint8_t *out_buf, int32_t out_length, uint8_t *in_buf, int32_t in_length, int32_t channels) { - - /* some common variables. */ - byte_and_int16_t out; - byte_and_int16_t in; - uint32_t index; - int32_t nr_array1[2]; - int32_t nr_array2[2]; - int32_t count = 0; - - /* end on input buffer. */ - uint8_t *in_end = in_buf + in_length; - - /* assign default values. */ - out.pb = out_buf; - in.pb = in_buf; - nr_array1[0] = 0x2C; - nr_array1[1] = 0x2C; - - /* increase. */ - in.pw++; - - /* 15007AD7 */ - for (count = 0; count < channels; count++) { - - /* some common variables. */ - int32_t temp; - - /* save pointer. */ - temp = *(int16_t *)in.pw++; - nr_array2[count] = temp; - - /* check if should break. */ - if (out_length < 2) { - return out.pb - out_buf; - } - - /* return values. */ - *out.pw++ = (uint16_t)temp; - out_length -= 2; - } - - /* decrease channels. */ - index = channels - 1; - - /* loop through input buffer until end reached. */ - while (in.pb < in_end) { - - /* save the byte. */ - uint8_t one_byte = *in.pb++; - - /* check how many channels and set index. */ - if (channels == 2) { - index = (index == 0) ? 1 : 0; - } - - /* 15007B25 - get one byte from input buffer. */ - if (one_byte & 0x80) { - - /* 15007B32 */ - switch (one_byte & 0x7F) { - case 0: - - /* 15007B8E */ - if (nr_array1[index] != 0) { - nr_array1[index]--; - } - - /* check if should break. */ - if (out_length < 2) { - break; - } - - /* return values. */ - *out.pw++ = (uint16_t)nr_array2[index]; - out_length -= 2; - - /* continue loop. */ - continue; - case 1: - /* 15007B72 and EBX. */ - nr_array1[index] += 8; - - /* check index. */ - if (nr_array1[index] > 0x58) { - nr_array1[index] = 0x58; - } - - /* check how many channels and set index. */ - if (channels == 2) { - index = (index == 0) ? 1 : 0; - } - - /* continue loop. */ - continue; - case 2: - - /* nothing todo, so continue. */ - continue; - default: - - /* decrease index. */ - nr_array1[index] -= 8; - - /* check index. */ - if (nr_array1[index] < 0) { - nr_array1[index] = 0; - } - - /* check if two channels left. */ - if (channels != 2) { - continue; - } - index = (index == 0) ? 1 : 0; - - /* continue loop. */ - continue; - } - } else { - - /* EDI */ - uint32_t temp1 = wave_table_1503f1a0[nr_array1[index]]; - - /* ESI */ - uint32_t temp2 = temp1 >> in_buf[1]; - - /* ECX */ - int32_t temp3 = nr_array2[index]; - - /* EBX = one byte. */ - if (one_byte & 0x01) { - temp2 += (temp1 >> 0); - } - if (one_byte & 0x02) { - temp2 += (temp1 >> 1); - } - if (one_byte & 0x04) { - temp2 += (temp1 >> 2); - } - if (one_byte & 0x08) { - temp2 += (temp1 >> 3); - } - if (one_byte & 0x10) { - temp2 += (temp1 >> 4); - } - if (one_byte & 0x20) { - temp2 += (temp1 >> 5); - } - if (one_byte & 0x40) { - temp3 -= temp2; - if (temp3 <= (int32_t)0xFFFF8000) { - temp3 = (int32_t)0xFFFF8000; - } - } else { - temp3 += temp2; - if (temp3 >= 0x7FFF) { - temp3 = 0x7FFF; - } - } - - /* restore index. */ - nr_array2[index] = temp3; - - /* check if should break. */ - if (out_length < 2) { - break; - } - - /* assign values. */ - temp2 = nr_array1[index]; - one_byte &= 0x1F; - *out.pw++ = (uint16_t)temp3; - out_length -= 2; - temp2 += wave_table_1503f120[one_byte]; - nr_array1[index] = temp2; - - /* check index. */ - if (nr_array1[index] < 0) { - nr_array1[index] = 0; - } else { - - /* check index. */ - if (nr_array1[index] > 0x58) { - nr_array1[index] = 0x58; - } - } - } - } - - /* return copied bytes. */ - return (out.pb - out_buf); -} diff --git a/dep/libmpq/libmpq/wave.h b/dep/libmpq/libmpq/wave.h deleted file mode 100644 index 1b9491bd70a..00000000000 --- a/dep/libmpq/libmpq/wave.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * wave.h -- header file for wav unplode functions used by mpq-tools. - * - * Copyright (c) 2003-2007 Maik Broemme - * - * This source was adepted from the C++ version of wave.h included - * in stormlib. The C++ version belongs to the following authors: - * - * Ladislav Zezula - * Tom Amigo - * - * 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; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; 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 _WAVE_H -#define _WAVE_H - -/* buffer. */ -typedef union { - uint16_t *pw; - uint8_t *pb; -} byte_and_int16_t; - -/* decompress a wave file, mono or stereo, 1500F230 offset. */ -int32_t libmpq__do_decompress_wave( - uint8_t *out_buf, - int32_t out_length, - uint8_t *in_buf, - int32_t in_length, - int32_t channels -); - -#endif /* _WAVE_H */ diff --git a/dep/libmpq/tools/Makefile.am b/dep/libmpq/tools/Makefile.am deleted file mode 100644 index 607205379a4..00000000000 --- a/dep/libmpq/tools/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -# minimum required automake 1.6 -AUTOMAKE_OPTIONS = 1.6 - -# the main programs. -bin_PROGRAMS = crypt_buf_gen - -# sources for crypt_buf_gen program. -crypt_buf_gen_SOURCES = crypt_buf_gen.c diff --git a/dep/libmpq/tools/crypt_buf_gen.c b/dep/libmpq/tools/crypt_buf_gen.c deleted file mode 100644 index 3d150fc661f..00000000000 --- a/dep/libmpq/tools/crypt_buf_gen.c +++ /dev/null @@ -1,85 +0,0 @@ -/* - * crypt_buf_gen.c -- tool to re-create the static decryption buffer. - * - * Copyright (c) 2003-2008 Maik Broemme - * Copyright (c) 2008 Georg Lukas - * - * 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; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; 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. - * - * - * Usage: - * $ make crypt_buf_gen - * $ ./crypt_buf_gen > crypt_buf.h - * - */ -#include -#include -#include - -static uint32_t *buffer; - -int32_t libmpq__buffer_init() { - buffer = malloc(sizeof(uint32_t) * 0x500); - - if (!buffer) - return -1; - - /* some common variables. */ - uint32_t seed = 0x00100001; - uint32_t index1 = 0; - uint32_t index2 = 0; - uint32_t i; - - /* initialize the decryption buffer. */ - for (index1 = 0; index1 < 0x100; index1++) { - for(index2 = index1, i = 0; i < 5; i++, index2 += 0x100) { - - /* some common variables. */ - uint32_t temp1, temp2; - - /* temporary copy. */ - seed = (seed * 125 + 3) % 0x2AAAAB; - temp1 = (seed & 0xFFFF) << 0x10; - - /* temporary copy. */ - seed = (seed * 125 + 3) % 0x2AAAAB; - temp2 = (seed & 0xFFFF); - - /* assign buffer. */ - buffer[index2] = (temp1 | temp2); - } - } - - /* if no error was found, return zero. */ - return 0; -} - -int main() { - if (libmpq__buffer_init() != 0) - perror("libmpq__buffer_init()"); - int x; - printf("/* DO NOT CHANGE! this file is auto-generated by crypt_buf_gen.c */\n"); - printf("static const uint32_t crypt_buf[0x500] = {\n\t"); - for (x = 0; x < 0x500; x++) { - printf("0x%08x", buffer[x]); - if (x < 0x500 - 1) { - if (x % 6 == 5) - printf(",\n\t"); - else - printf(", "); - } - } - printf("\n};\n"); -} diff --git a/dep/libmpq/win/config.h b/dep/libmpq/win/config.h deleted file mode 100644 index 6833494624d..00000000000 --- a/dep/libmpq/win/config.h +++ /dev/null @@ -1,81 +0,0 @@ -/* config.h. Generated from config.h.in by configure. */ -/* config.h.in. Generated from configure.ac by autoheader. */ - -/* Define to 1 if you have the header file. */ -#define HAVE_DLFCN_H 1 - -/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ -#define HAVE_FSEEKO 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_INTTYPES_H 1 - -/* Define to 1 if you have the `bz2' library (-lbz2). */ -#define HAVE_LIBBZ2 1 - -/* Define to 1 if you have the `z' library (-lz). */ -#define HAVE_LIBZ 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_MEMORY_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDINT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRINGS_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_STAT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_UNISTD_H 0 - -/* Define to the sub-directory in which libtool stores uninstalled libraries. - */ -#define LT_OBJDIR ".libs/" - -/* Name of package */ -#define PACKAGE "libmpq" - -/* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "mbroemme@plusserver.de" - -/* Define to the full name of this package. */ -#define PACKAGE_NAME "libmpq" - -/* Define to the full name and version of this package. */ -#define PACKAGE_STRING "libmpq 0.4.2" - -/* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "libmpq" - -/* Define to the home page for this package. */ -#define PACKAGE_URL "" - -/* Define to the version of this package. */ -#define PACKAGE_VERSION "0.4.2" - -/* Define to 1 if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Version number of package */ -#define VERSION "0.4.2" - -/* Number of bits in a file offset, on hosts where this is settable. */ -/* #undef _FILE_OFFSET_BITS */ - -/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */ -/* #undef _LARGEFILE_SOURCE */ - -/* Define for large files, on AIX-style hosts. */ -/* #undef _LARGE_FILES */ diff --git a/dep/libmpq/win/dirent.h b/dep/libmpq/win/dirent.h deleted file mode 100644 index 6425174092d..00000000000 --- a/dep/libmpq/win/dirent.h +++ /dev/null @@ -1,230 +0,0 @@ -/***************************************************************************** - * dirent.h - dirent API for Microsoft Visual Studio - * - * Copyright (C) 2006 Toni Ronkko - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * ``Software''), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL TONI RONKKO BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * Dec 15, 2009, John Cunningham - * Added rewinddir member function - * - * Jan 18, 2008, Toni Ronkko - * Using FindFirstFileA and WIN32_FIND_DATAA to avoid converting string - * between multi-byte and unicode representations. This makes the - * code simpler and also allows the code to be compiled under MingW. Thanks - * to Azriel Fasten for the suggestion. - * - * Mar 4, 2007, Toni Ronkko - * Bug fix: due to the strncpy_s() function this file only compiled in - * Visual Studio 2005. Using the new string functions only when the - * compiler version allows. - * - * Nov 2, 2006, Toni Ronkko - * Major update: removed support for Watcom C, MS-DOS and Turbo C to - * simplify the file, updated the code to compile cleanly on Visual - * Studio 2005 with both unicode and multi-byte character strings, - * removed rewinddir() as it had a bug. - * - * Aug 20, 2006, Toni Ronkko - * Removed all remarks about MSVC 1.0, which is antiqued now. Simplified - * comments by removing SGML tags. - * - * May 14 2002, Toni Ronkko - * Embedded the function definitions directly to the header so that no - * source modules need to be included in the Visual Studio project. Removed - * all the dependencies to other projects so that this very header can be - * used independently. - * - * May 28 1998, Toni Ronkko - * First version. - *****************************************************************************/ -#ifndef DIRENT_H -#define DIRENT_H - -#include -#include -#include - - -typedef struct dirent -{ - char d_name[MAX_PATH + 1]; /* current dir entry (multi-byte char string) */ - WIN32_FIND_DATAA data; /* file attributes */ -} dirent; - - -typedef struct DIR -{ - dirent current; /* Current directory entry */ - int cached; /* Indicates un-processed entry in memory */ - HANDLE search_handle; /* File search handle */ - char patt[MAX_PATH + 3]; /* search pattern (3 = pattern + "\\*\0") */ -} DIR; - - -/* Forward declarations */ -static DIR *opendir (const char *dirname); -static struct dirent *readdir (DIR *dirp); -static int closedir (DIR *dirp); -static void rewinddir(DIR* dirp); - - -/* Use the new safe string functions introduced in Visual Studio 2005 */ -#if defined(_MSC_VER) && _MSC_VER >= 1400 -# define STRNCPY(dest,src,size) strncpy_s((dest),(size),(src),_TRUNCATE) -#else -# define STRNCPY(dest,src,size) strncpy((dest),(src),(size)) -#endif - - -/***************************************************************************** - * Open directory stream DIRNAME for read and return a pointer to the - * internal working area that is used to retrieve individual directory - * entries. - */ -static DIR *opendir(const char *dirname) -{ - DIR *dirp; - assert (dirname != NULL); - assert (strlen (dirname) < MAX_PATH); - - /* construct new DIR structure */ - dirp = (DIR*) malloc (sizeof (struct DIR)); - if (dirp != NULL) { - char *p; - - /* take directory name... */ - STRNCPY (dirp->patt, dirname, sizeof(dirp->patt)); - dirp->patt[MAX_PATH] = '\0'; - - /* ... and append search pattern to it */ - p = strchr (dirp->patt, '\0'); - if (dirp->patt < p && *(p-1) != '\\' && *(p-1) != ':') { - *p++ = '\\'; - } - *p++ = '*'; - *p = '\0'; - - /* open stream and retrieve first file */ - dirp->search_handle = FindFirstFileA (dirp->patt, &dirp->current.data); - if (dirp->search_handle == INVALID_HANDLE_VALUE) { - /* invalid search pattern? */ - free (dirp); - return NULL; - } - - /* there is an un-processed directory entry in memory now */ - dirp->cached = 1; - } - - return dirp; -} - - -/***************************************************************************** - * Read a directory entry, and return a pointer to a dirent structure - * containing the name of the entry in d_name field. Individual directory - * entries returned by this very function include regular files, - * sub-directories, pseudo-directories "." and "..", but also volume labels, - * hidden files and system files may be returned. - */ -static struct dirent *readdir(DIR *dirp) -{ - assert (dirp != NULL); - - if (dirp->search_handle == INVALID_HANDLE_VALUE) { - /* directory stream was opened/rewound incorrectly or ended normally */ - return NULL; - } - - /* get next directory entry */ - if (dirp->cached != 0) { - /* a valid directory entry already in memory */ - dirp->cached = 0; - } else { - /* read next directory entry from disk */ - if (FindNextFileA (dirp->search_handle, &dirp->current.data) == FALSE) { - /* the very last file has been processed or an error occured */ - FindClose (dirp->search_handle); - dirp->search_handle = INVALID_HANDLE_VALUE; - return NULL; - } - } - - /* copy as a multibyte character string */ - STRNCPY ( dirp->current.d_name, - dirp->current.data.cFileName, - sizeof(dirp->current.d_name) ); - dirp->current.d_name[MAX_PATH] = '\0'; - - return &dirp->current; -} - - -/***************************************************************************** - * Close directory stream opened by opendir() function. Close of the - * directory stream invalidates the DIR structure as well as any previously - * read directory entry. - */ -static int closedir(DIR *dirp) -{ - assert (dirp != NULL); - - /* release search handle */ - if (dirp->search_handle != INVALID_HANDLE_VALUE) { - FindClose (dirp->search_handle); - dirp->search_handle = INVALID_HANDLE_VALUE; - } - - /* release directory handle */ - free (dirp); - return 0; -} - - -/***************************************************************************** - * Resets the position of the directory stream to which dirp refers to the - * beginning of the directory. It also causes the directory stream to refer - * to the current state of the corresponding directory, as a call to opendir() - * would have done. If dirp does not refer to a directory stream, the effect - * is undefined. - */ -static void rewinddir(DIR* dirp) -{ - /* release search handle */ - if (dirp->search_handle != INVALID_HANDLE_VALUE) { - FindClose (dirp->search_handle); - dirp->search_handle = INVALID_HANDLE_VALUE; - } - - /* open new search handle and retrieve first file */ - dirp->search_handle = FindFirstFileA (dirp->patt, &dirp->current.data); - if (dirp->search_handle == INVALID_HANDLE_VALUE) { - /* invalid search pattern? */ - free (dirp); - return; - } - - /* there is an un-processed directory entry in memory now */ - dirp->cached = 1; -} - - -#endif /*DIRENT_H*/ diff --git a/dep/libmpq/win/stdint.h b/dep/libmpq/win/stdint.h deleted file mode 100644 index d02608a5972..00000000000 --- a/dep/libmpq/win/stdint.h +++ /dev/null @@ -1,247 +0,0 @@ -// ISO C9x compliant stdint.h for Microsoft Visual Studio -// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 -// -// Copyright (c) 2006-2008 Alexander Chemeris -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. The name of the author may be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED -// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _MSC_VER // [ -#error "Use this header only with Microsoft Visual C++ compilers!" -#endif // _MSC_VER ] - -#ifndef _MSC_STDINT_H_ // [ -#define _MSC_STDINT_H_ - -#if _MSC_VER > 1000 -#pragma once -#endif - -#include - -// For Visual Studio 6 in C++ mode and for many Visual Studio versions when -// compiling for ARM we should wrap include with 'extern "C++" {}' -// or compiler give many errors like this: -// error C2733: second C linkage of overloaded function 'wmemchr' not allowed -#ifdef __cplusplus -extern "C" { -#endif -# include -#ifdef __cplusplus -} -#endif - -// Define _W64 macros to mark types changing their size, like intptr_t. -#ifndef _W64 -# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 -# define _W64 __w64 -# else -# define _W64 -# endif -#endif - - -// 7.18.1 Integer types - -// 7.18.1.1 Exact-width integer types - -// Visual Studio 6 and Embedded Visual C++ 4 doesn't -// realize that, e.g. char has the same size as __int8 -// so we give up on __intX for them. -#if (_MSC_VER < 1300) - typedef signed char int8_t; - typedef signed short int16_t; - typedef signed int int32_t; - typedef unsigned char uint8_t; - typedef unsigned short uint16_t; - typedef unsigned int uint32_t; -#else - typedef signed __int8 int8_t; - typedef signed __int16 int16_t; - typedef signed __int32 int32_t; - typedef unsigned __int8 uint8_t; - typedef unsigned __int16 uint16_t; - typedef unsigned __int32 uint32_t; -#endif -typedef signed __int64 int64_t; -typedef unsigned __int64 uint64_t; - - -// 7.18.1.2 Minimum-width integer types -typedef int8_t int_least8_t; -typedef int16_t int_least16_t; -typedef int32_t int_least32_t; -typedef int64_t int_least64_t; -typedef uint8_t uint_least8_t; -typedef uint16_t uint_least16_t; -typedef uint32_t uint_least32_t; -typedef uint64_t uint_least64_t; - -// 7.18.1.3 Fastest minimum-width integer types -typedef int8_t int_fast8_t; -typedef int16_t int_fast16_t; -typedef int32_t int_fast32_t; -typedef int64_t int_fast64_t; -typedef uint8_t uint_fast8_t; -typedef uint16_t uint_fast16_t; -typedef uint32_t uint_fast32_t; -typedef uint64_t uint_fast64_t; - -// 7.18.1.4 Integer types capable of holding object pointers -#ifdef _WIN64 // [ - typedef signed __int64 intptr_t; - typedef unsigned __int64 uintptr_t; -#else // _WIN64 ][ - typedef _W64 signed int intptr_t; - typedef _W64 unsigned int uintptr_t; -#endif // _WIN64 ] - -// 7.18.1.5 Greatest-width integer types -typedef int64_t intmax_t; -typedef uint64_t uintmax_t; - - -// 7.18.2 Limits of specified-width integer types - -#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259 - -// 7.18.2.1 Limits of exact-width integer types -#define INT8_MIN ((int8_t)_I8_MIN) -#define INT8_MAX _I8_MAX -#define INT16_MIN ((int16_t)_I16_MIN) -#define INT16_MAX _I16_MAX -#define INT32_MIN ((int32_t)_I32_MIN) -#define INT32_MAX _I32_MAX -#define INT64_MIN ((int64_t)_I64_MIN) -#define INT64_MAX _I64_MAX -#define UINT8_MAX _UI8_MAX -#define UINT16_MAX _UI16_MAX -#define UINT32_MAX _UI32_MAX -#define UINT64_MAX _UI64_MAX - -// 7.18.2.2 Limits of minimum-width integer types -#define INT_LEAST8_MIN INT8_MIN -#define INT_LEAST8_MAX INT8_MAX -#define INT_LEAST16_MIN INT16_MIN -#define INT_LEAST16_MAX INT16_MAX -#define INT_LEAST32_MIN INT32_MIN -#define INT_LEAST32_MAX INT32_MAX -#define INT_LEAST64_MIN INT64_MIN -#define INT_LEAST64_MAX INT64_MAX -#define UINT_LEAST8_MAX UINT8_MAX -#define UINT_LEAST16_MAX UINT16_MAX -#define UINT_LEAST32_MAX UINT32_MAX -#define UINT_LEAST64_MAX UINT64_MAX - -// 7.18.2.3 Limits of fastest minimum-width integer types -#define INT_FAST8_MIN INT8_MIN -#define INT_FAST8_MAX INT8_MAX -#define INT_FAST16_MIN INT16_MIN -#define INT_FAST16_MAX INT16_MAX -#define INT_FAST32_MIN INT32_MIN -#define INT_FAST32_MAX INT32_MAX -#define INT_FAST64_MIN INT64_MIN -#define INT_FAST64_MAX INT64_MAX -#define UINT_FAST8_MAX UINT8_MAX -#define UINT_FAST16_MAX UINT16_MAX -#define UINT_FAST32_MAX UINT32_MAX -#define UINT_FAST64_MAX UINT64_MAX - -// 7.18.2.4 Limits of integer types capable of holding object pointers -#ifdef _WIN64 // [ -# define INTPTR_MIN INT64_MIN -# define INTPTR_MAX INT64_MAX -# define UINTPTR_MAX UINT64_MAX -#else // _WIN64 ][ -# define INTPTR_MIN INT32_MIN -# define INTPTR_MAX INT32_MAX -# define UINTPTR_MAX UINT32_MAX -#endif // _WIN64 ] - -// 7.18.2.5 Limits of greatest-width integer types -#define INTMAX_MIN INT64_MIN -#define INTMAX_MAX INT64_MAX -#define UINTMAX_MAX UINT64_MAX - -// 7.18.3 Limits of other integer types - -#ifdef _WIN64 // [ -# define PTRDIFF_MIN _I64_MIN -# define PTRDIFF_MAX _I64_MAX -#else // _WIN64 ][ -# define PTRDIFF_MIN _I32_MIN -# define PTRDIFF_MAX _I32_MAX -#endif // _WIN64 ] - -#define SIG_ATOMIC_MIN INT_MIN -#define SIG_ATOMIC_MAX INT_MAX - -#ifndef SIZE_MAX // [ -# ifdef _WIN64 // [ -# define SIZE_MAX _UI64_MAX -# else // _WIN64 ][ -# define SIZE_MAX _UI32_MAX -# endif // _WIN64 ] -#endif // SIZE_MAX ] - -// WCHAR_MIN and WCHAR_MAX are also defined in -#ifndef WCHAR_MIN // [ -# define WCHAR_MIN 0 -#endif // WCHAR_MIN ] -#ifndef WCHAR_MAX // [ -# define WCHAR_MAX _UI16_MAX -#endif // WCHAR_MAX ] - -#define WINT_MIN 0 -#define WINT_MAX _UI16_MAX - -#endif // __STDC_LIMIT_MACROS ] - - -// 7.18.4 Limits of other integer types - -#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260 - -// 7.18.4.1 Macros for minimum-width integer constants - -#define INT8_C(val) val##i8 -#define INT16_C(val) val##i16 -#define INT32_C(val) val##i32 -#define INT64_C(val) val##i64 - -#define UINT8_C(val) val##ui8 -#define UINT16_C(val) val##ui16 -#define UINT32_C(val) val##ui32 -#define UINT64_C(val) val##ui64 - -// 7.18.4.2 Macros for greatest-width integer constants -#define INTMAX_C INT64_C -#define UINTMAX_C UINT64_C - -#endif // __STDC_CONSTANT_MACROS ] - - -#endif // _MSC_STDINT_H_ ] diff --git a/src/tools/map_extractor/CMakeLists.txt b/src/tools/map_extractor/CMakeLists.txt index afeb8af99ba..af66b73827e 100644 --- a/src/tools/map_extractor/CMakeLists.txt +++ b/src/tools/map_extractor/CMakeLists.txt @@ -11,22 +11,12 @@ file(GLOB_RECURSE sources *.cpp *.h) -if( UNIX ) - include_directories ( - ${CMAKE_SOURCE_DIR}/src/server/shared - ${CMAKE_SOURCE_DIR}/dep/libmpq - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/loadlib - ) -elseif( WIN32 ) - include_directories ( - ${CMAKE_SOURCE_DIR}/src/server/shared - ${CMAKE_SOURCE_DIR}/dep/libmpq - ${CMAKE_SOURCE_DIR}/dep/libmpq/win - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/loadlib - ) -endif() +include_directories ( + ${CMAKE_SOURCE_DIR}/src/server/shared + ${CMAKE_SOURCE_DIR}/dep/StormLib/src + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/loadlib +) add_executable(mapextractor ${sources} @@ -35,10 +25,10 @@ add_executable(mapextractor target_link_libraries(mapextractor ${BZIP2_LIBRARIES} ${ZLIB_LIBRARIES} - mpq + storm ) -add_dependencies(mapextractor mpq) +add_dependencies(mapextractor storm) if( UNIX ) install(TARGETS mapextractor DESTINATION bin) diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp index 335fd924be8..443e9a9ada6 100644 --- a/src/tools/map_extractor/System.cpp +++ b/src/tools/map_extractor/System.cpp @@ -2,7 +2,7 @@ #include #include -#include +#include #include #ifdef _WIN32 @@ -11,8 +11,8 @@ #include #endif +#include "StormLib.h" #include "dbcfile.h" -#include "mpq_libmpq04.h" #include "adt.h" #include "wdt.h" @@ -29,11 +29,15 @@ #endif #ifdef O_LARGEFILE - #define OPEN_FLAGS (O_RDONLY | O_BINARY | O_LARGEFILE) + #define OPEN_FLAGS (O_RDONLY | O_BINARY | O_LARGEFILE) #else #define OPEN_FLAGS (O_RDONLY | O_BINARY) #endif -extern ArchiveSet gOpenArchives; + +typedef std::list Archives; +Archives WorldMpqs; +HANDLE WorldMpq = NULL; +HANDLE LocaleMpq = NULL; typedef struct { @@ -59,6 +63,7 @@ enum Extract // Select data for extract int CONF_extract = EXTRACT_MAP | EXTRACT_DBC; + // This option allow limit minimum height to some value (Allow save some memory) bool CONF_allow_height_limit = true; float CONF_use_minHeight = -500.0f; @@ -70,34 +75,46 @@ float CONF_float_to_int16_limit = 2048.0f; // Max accuracy = val/65536 float CONF_flat_height_delta_limit = 0.005f; // If max - min less this value - surface is flat float CONF_flat_liquid_delta_limit = 0.001f; // If max - min less this value - liquid surface is flat -// List MPQ for extract from -char *CONF_mpq_list[]={ - "common.MPQ", - "common-2.MPQ", - "lichking.MPQ", - "expansion.MPQ", - "patch.MPQ", - "patch-2.MPQ", - "patch-3.MPQ", - "patch-4.MPQ", - "patch-5.MPQ", +uint32 CONF_TargetBuild = 14545; // 4.2.2.14545 + +// List MPQ for extract maps from +char const* CONF_mpq_list[]= +{ + "world.MPQ", + "world2.MPQ", + "expansion1.MPQ", + "expansion2.MPQ", + "expansion3.MPQ", }; -static char* const langs[] = {"enGB", "enUS", "deDE", "esES", "frFR", "koKR", "zhCN", "zhTW", "enCN", "enTW", "esMX", "ruRU" }; -#define LANG_COUNT 12 +uint32 const Builds[] = {13164, 13205, 13287, 13329, 13596, 13623, 13914, 14007, 14333, 14480, 14545, 15005, 15050, 15211, 0}; +#define LAST_DBC_IN_DATA_BUILD 13623 // after this build mpqs with dbc are back to locale folder -void CreateDir( const std::string& Path ) +char* const Locales[] = {"enGB", "enUS", "deDE", "esES", "frFR", "koKR", "zhCN", "zhTW", "enCN", "enTW", "esMX", "ruRU"}; +TCHAR* const LocalesT[] = { - #ifdef _WIN32 - _mkdir( Path.c_str()); - #else - mkdir( Path.c_str(), 0777 ); - #endif + _T("enGB"), _T("enUS"), + _T("deDE"), _T("esES"), + _T("frFR"), _T("koKR"), + _T("zhCN"), _T("zhTW"), + _T("enCN"), _T("enTW"), + _T("esMX"), _T("ruRU"), +}; + +#define LOCALES_COUNT 12 + +void CreateDir(std::string const& path) +{ +#ifdef _WIN32 + _mkdir(path.c_str()); +#else + mkdir(path.c_str(), 777); +#endif } -bool FileExists( const char* FileName ) +bool FileExists(TCHAR const* fileName) { - int fp = _open(FileName, OPEN_FLAGS); + int fp = _open(fileName, OPEN_FLAGS); if(fp != -1) { _close(fp); @@ -116,52 +133,62 @@ void Usage(char* prg) "-o set output path\n"\ "-e extract only MAP(1)/DBC(2) - standard: both(3)\n"\ "-f height stored as int (less map size but lost some accuracy) 1 by default\n"\ + "-b target build (default 14545)"\ "Example: %s -f 0 -i \"c:\\games\\game\"", prg, prg); exit(1); } void HandleArgs(int argc, char * arg[]) { - for(int c = 1; c < argc; ++c) + for (int c = 1; c < argc; ++c) { // i - input path // o - output path // e - extract only MAP(1)/DBC(2) - standard both(3) // f - use float to int conversion // h - limit minimum height - if(arg[c][0] != '-') + // b - target client build + if (arg[c][0] != '-') Usage(arg[0]); - switch(arg[c][1]) + switch (arg[c][1]) { case 'i': - if(c + 1 < argc) // all ok - strcpy(input_path, arg[(c++) + 1]); + if (c + 1 < argc) // all ok + strcpy(input_path, arg[c++ + 1]); else Usage(arg[0]); break; case 'o': - if(c + 1 < argc) // all ok - strcpy(output_path, arg[(c++) + 1]); + if (c + 1 < argc) // all ok + strcpy(output_path, arg[c++ + 1]); else Usage(arg[0]); break; case 'f': - if(c + 1 < argc) // all ok - CONF_allow_float_to_int=atoi(arg[(c++) + 1])!=0; + if (c + 1 < argc) // all ok + CONF_allow_float_to_int = atoi(arg[c++ + 1])!=0; else Usage(arg[0]); break; case 'e': - if(c + 1 < argc) // all ok + if (c + 1 < argc) // all ok { - CONF_extract=atoi(arg[(c++) + 1]); - if(!(CONF_extract > 0 && CONF_extract < 4)) + CONF_extract = atoi(arg[c++ + 1]); + if (!(CONF_extract > 0 && CONF_extract < 4)) Usage(arg[0]); } else Usage(arg[0]); break; + case 'b': + if (c + 1 < argc) // all ok + CONF_TargetBuild = atoi(arg[c++ + 1]); + else + Usage(arg[0]); + break; + default: + break; } } } @@ -169,22 +196,31 @@ void HandleArgs(int argc, char * arg[]) uint32 ReadBuild(int locale) { // include build info file also - std::string filename = std::string("component.wow-")+langs[locale]+".txt"; + std::string filename = std::string("component.wow-") + Locales[locale] + ".txt"; //printf("Read %s file... ", filename.c_str()); - MPQFile m(filename.c_str()); - if(m.isEof()) + HANDLE dbcFile; + if (!SFileOpenFileEx(LocaleMpq, filename.c_str(), SFILE_OPEN_PATCHED_FILE, &dbcFile)) + { + printf("Fatal error: Not found %s file!\n", filename.c_str()); + exit(1); + } + + char buff[512]; + DWORD readBytes = 0; + SFileReadFile(dbcFile, buff, 512, &readBytes, NULL); + if (!readBytes) { printf("Fatal error: Not found %s file!\n", filename.c_str()); exit(1); } - std::string text = m.getPointer(); - m.close(); + std::string text = buff; + SFileCloseFile(dbcFile); size_t pos = text.find("version=\""); size_t pos1 = pos + strlen("version=\""); - size_t pos2 = text.find("\"",pos1); + size_t pos2 = text.find("\"", pos1); if (pos == text.npos || pos2 == text.npos || pos1 >= pos2) { printf("Fatal error: Invalid %s file format!\n", filename.c_str()); @@ -206,9 +242,16 @@ uint32 ReadBuild(int locale) uint32 ReadMapDBC() { printf("Read Map.dbc file... "); - DBCFile dbc("DBFilesClient\\Map.dbc"); - if(!dbc.open()) + HANDLE dbcFile; + if (!SFileOpenFileEx(LocaleMpq, "DBFilesClient\\Map.dbc", SFILE_OPEN_PATCHED_FILE, &dbcFile)) + { + printf("Fatal error: Cannot find Map.dbc in archive!\n"); + exit(1); + } + + DBCFile dbc(dbcFile); + if (!dbc.open()) { printf("Fatal error: Invalid Map.dbc file format!\n"); exit(1); @@ -221,6 +264,8 @@ uint32 ReadMapDBC() map_ids[x].id = dbc.getRecord(x).getUInt(0); strcpy(map_ids[x].name, dbc.getRecord(x).getString(1)); } + + SFileCloseFile(dbcFile); printf("Done! (%u maps loaded)\n", map_count); return map_count; } @@ -228,8 +273,14 @@ uint32 ReadMapDBC() void ReadAreaTableDBC() { printf("Read AreaTable.dbc file..."); - DBCFile dbc("DBFilesClient\\AreaTable.dbc"); + HANDLE dbcFile; + if (!SFileOpenFileEx(LocaleMpq, "DBFilesClient\\AreaTable.dbc", SFILE_OPEN_PATCHED_FILE, &dbcFile)) + { + printf("Fatal error: Cannot find AreaTable.dbc in archive!\n"); + exit(1); + } + DBCFile dbc(dbcFile); if(!dbc.open()) { printf("Fatal error: Invalid AreaTable.dbc file format!\n"); @@ -246,13 +297,21 @@ void ReadAreaTableDBC() maxAreaId = dbc.getMaxId(); + SFileCloseFile(dbcFile); printf("Done! (%u areas loaded)\n", area_count); } void ReadLiquidTypeTableDBC() { printf("Read LiquidType.dbc file..."); - DBCFile dbc("DBFilesClient\\LiquidType.dbc"); + HANDLE dbcFile; + if (!SFileOpenFileEx(LocaleMpq, "DBFilesClient\\LiquidType.dbc", SFILE_OPEN_PATCHED_FILE, &dbcFile)) + { + printf("Fatal error: Cannot find LiquidType.dbc in archive!\n"); + exit(1); + } + + DBCFile dbc(dbcFile); if(!dbc.open()) { printf("Fatal error: Invalid LiquidType.dbc file format!\n"); @@ -267,6 +326,7 @@ void ReadLiquidTypeTableDBC() for(uint32 x = 0; x < LiqType_count; ++x) LiqType[dbc.getRecord(x).getUInt(0)] = dbc.getRecord(x).getUInt(3); + SFileCloseFile(dbcFile); printf("Done! (%u LiqTypes loaded)\n", LiqType_count); } @@ -367,7 +427,7 @@ bool ConvertADT(char *filename, char *filename2, int cell_y, int cell_x, uint32 { ADT_file adt; - if (!adt.loadFile(filename)) + if (!adt.loadFile(WorldMpq, filename)) return false; adt_MCIN *cells = adt.a_grid->getMCIN(); @@ -887,135 +947,192 @@ void ExtractMapsFromMpq(uint32 build) CreateDir(path); printf("Convert map files\n"); - for(uint32 z = 0; z < map_count; ++z) + for (uint32 z = 0; z < map_count; ++z) { printf("Extract %s (%d/%d) \n", map_ids[z].name, z+1, map_count); // Loadup map grid data sprintf(mpq_map_name, "World\\Maps\\%s\\%s.wdt", map_ids[z].name, map_ids[z].name); WDT_file wdt; - if (!wdt.loadFile(mpq_map_name, false)) - { -// printf("Error loading %s map wdt data\n", map_ids[z].name); + if (!wdt.loadFile(WorldMpq, mpq_map_name, false)) continue; - } - for(uint32 y = 0; y < WDT_MAP_SIZE; ++y) + for (uint32 y = 0; y < WDT_MAP_SIZE; ++y) { - for(uint32 x = 0; x < WDT_MAP_SIZE; ++x) + for (uint32 x = 0; x < WDT_MAP_SIZE; ++x) { - if (!wdt.main->adt_list[y][x].exist) + if (!(wdt.main->adt_list[y][x].flag & 0x1)) continue; + sprintf(mpq_filename, "World\\Maps\\%s\\%s_%u_%u.adt", map_ids[z].name, map_ids[z].name, x, y); sprintf(output_filename, "%s/maps/%03u%02u%02u.map", output_path, map_ids[z].id, y, x); ConvertADT(mpq_filename, output_filename, y, x, build); } + // draw progress bar printf("Processing........................%d%%\r", (100 * (y+1)) / WDT_MAP_SIZE); } } + printf("\n"); delete [] areas; delete [] map_ids; } -bool ExtractFile( char const* mpq_name, std::string const& filename ) +bool ExtractFile(HANDLE fileInArchive, char const* filename) { - FILE *output = fopen(filename.c_str(), "wb"); + FILE* output = fopen(filename, "wb"); if(!output) { - printf("Can't create the output file '%s'\n", filename.c_str()); + printf("Can't create the output file '%s'\n", filename); return false; } - MPQFile m(mpq_name); - if(!m.isEof()) - fwrite(m.getPointer(), 1, m.getSize(), output); + + char buffer[0x10000]; + DWORD readBytes = 1; + + while (readBytes > 0) + { + SFileReadFile(fileInArchive, buffer, sizeof(buffer), &readBytes, NULL); + if (readBytes > 0) + fwrite(buffer, 1, readBytes, output); + } fclose(output); return true; } -void ExtractDBCFiles(int locale, bool basicLocale) +void ExtractDBCFiles(int l, bool basicLocale) { printf("Extracting dbc files...\n"); - std::set dbcfiles; - - // get DBC file list - for(ArchiveSet::iterator i = gOpenArchives.begin(); i != gOpenArchives.end();++i) + SFILE_FIND_DATA foundFile; + memset(&foundFile, 0, sizeof(foundFile)); + HANDLE listFile = SListFileFindFirstFile(LocaleMpq, NULL, "DBFilesClient\\*dbc", &foundFile); + HANDLE dbcFile = NULL; + uint32 count = 0; + if (listFile) { - vector files; - (*i)->GetFileListTo(files); - for (vector::iterator iter = files.begin(); iter != files.end(); ++iter) - if (iter->rfind(".dbc") == iter->length() - strlen(".dbc")) - dbcfiles.insert(*iter); - } - - std::string path = output_path; - path += "/dbc/"; - CreateDir(path); - if(!basicLocale) - { - path += langs[locale]; - path += "/"; - CreateDir(path); - } + std::string outputPath = "./dbc/"; + CreateDir(outputPath); + if (!basicLocale) + { + outputPath += Locales[l]; + outputPath += "/"; + CreateDir(outputPath); + } - // extract Build info file - { - string mpq_name = std::string("component.wow-") + langs[locale] + ".txt"; - string filename = path + mpq_name; + std::string filename; - ExtractFile(mpq_name.c_str(), filename); - } + do + { + if (!SFileOpenFileEx(LocaleMpq, foundFile.cFileName, SFILE_OPEN_PATCHED_FILE, &dbcFile)) + continue; - // extract DBCs - int count = 0; - for (set::iterator iter = dbcfiles.begin(); iter != dbcfiles.end(); ++iter) - { - string filename = path; - filename += (iter->c_str() + strlen("DBFilesClient\\")); + filename = foundFile.cFileName; + filename = outputPath + filename.substr(filename.rfind('\\')); + if (ExtractFile(dbcFile, filename.c_str())) + ++count; - if(ExtractFile(iter->c_str(), filename)) - ++count; + SFileCloseFile(dbcFile); + } while (SListFileFindNextFile(listFile, &foundFile)); } + printf("Extracted %u DBC files\n\n", count); } -void LoadLocaleMPQFiles(int const locale) +bool LoadLocaleMPQFile(int locale) { - char filename[512]; - - sprintf(filename,"%s/Data/%s/locale-%s.MPQ", input_path, langs[locale], langs[locale]); - new MPQArchive(filename); + TCHAR buff[512]; + memset(buff, 0, sizeof(buff)); + _stprintf(buff, _T("./Data/%s/locale-%s.MPQ"), LocalesT[locale], LocalesT[locale]); + if (!SFileOpenArchive(buff, 0, MPQ_OPEN_READ_ONLY, &LocaleMpq)) + { + if (GetLastError() != ERROR_PATH_NOT_FOUND) + _tprintf(_T("Cannot open archive %s\n"), buff); + return false; + } - for(int i = 1; i < 5; ++i) + char const* prefix = NULL; + for (int i = 0; Builds[i] && Builds[i] <= CONF_TargetBuild; ++i) { - char ext[3] = ""; - if(i > 1) - sprintf(ext, "-%i", i); + memset(buff, 0, sizeof(buff)); + if (Builds[i] > LAST_DBC_IN_DATA_BUILD) + { + prefix = NULL; + _stprintf(buff, _T("./Data/%s/wow-update-%s-%u.MPQ"), LocalesT[locale], LocalesT[locale], Builds[i]); + } + else + { + prefix = Locales[locale]; + _stprintf(buff, _T("./Data/wow-update-%u.MPQ"), Builds[i]); + } - sprintf(filename,"%s/Data/%s/patch-%s%s.MPQ", input_path, langs[locale], langs[locale], ext); - if(FileExists(filename)) - new MPQArchive(filename); + if (!SFileOpenPatchArchive(LocaleMpq, buff, prefix, 0)) + { + if (GetLastError() != ERROR_FILE_NOT_FOUND) + _tprintf(_T("Cannot open patch archive %s\n"), buff); + //SFileCloseArchive(mpq); + //err = true; + //break; + continue; + } } + + return true; } void LoadCommonMPQFiles() { - char filename[512]; + TCHAR filename[512]; + _stprintf(filename, _T("%s/Data/world.MPQ"), input_path); + if (!SFileOpenArchive(filename, 0, MPQ_OPEN_READ_ONLY, &WorldMpq)) + { + if (GetLastError() != ERROR_PATH_NOT_FOUND) + _tprintf(_T("Cannot open archive %s\n"), filename); + return; + } + int count = sizeof(CONF_mpq_list)/sizeof(char*); - for(int i = 0; i < count; ++i) + for(int i = 1; i < count; ++i) { - sprintf(filename, "%s/Data/%s", input_path, CONF_mpq_list[i]); - if(FileExists(filename)) - new MPQArchive(filename); + _stprintf(filename, _T("%s/Data/%s"), input_path, CONF_mpq_list[i]); + //if (FileExists(filename)) + { + if (!SFileOpenPatchArchive(WorldMpq, filename, NULL, 0)) + { + if (GetLastError() != ERROR_PATH_NOT_FOUND) + _tprintf(_T("Cannot open archive %s\n"), filename); + break; + } + } + } + + char const* prefix = NULL; + for (int i = 0; Builds[i] && Builds[i] <= CONF_TargetBuild; ++i) + { + memset(filename, 0, sizeof(filename)); + if (Builds[i] > LAST_DBC_IN_DATA_BUILD) + { + prefix = NULL; + _stprintf(filename, _T("%s/Data/wow-update-base-%u.MPQ"), input_path, Builds[i]); + } + else + { + prefix = "base"; + _stprintf(filename, _T("%s/Data/wow-update-%u.MPQ"), input_path, Builds[i]); + } + + if (!SFileOpenPatchArchive(LocaleMpq, filename, prefix, 0)) + { + if (GetLastError() != ERROR_PATH_NOT_FOUND) + _tprintf(_T("Cannot open patch archive %s\n"), filename); + //SFileCloseArchive(mpq); + //err = true; + //break; + continue; + } } -} -inline void CloseMPQFiles() -{ - for(ArchiveSet::iterator j = gOpenArchives.begin(); j != gOpenArchives.end();++j) (*j)->close(); - gOpenArchives.clear(); } int main(int argc, char * arg[]) @@ -1028,42 +1145,58 @@ int main(int argc, char * arg[]) int FirstLocale = -1; uint32 build = 0; - for (int i = 0; i < LANG_COUNT; i++) + for (int i = 0; i < LOCALES_COUNT; ++i) { - char tmp1[512]; - sprintf(tmp1, "%s/Data/%s/locale-%s.MPQ", input_path, langs[i], langs[i]); - if (FileExists(tmp1)) + TCHAR tmp1[512]; + _stprintf(tmp1, _T("%s/Data/%s/locale-%s.MPQ"), input_path, Locales[i], Locales[i]); + //if (FileExists(tmp1)) { - printf("Detected locale: %s\n", langs[i]); //Open MPQs - LoadLocaleMPQFiles(i); + if (!LoadLocaleMPQFile(i)) + { + if (GetLastError() != ERROR_PATH_NOT_FOUND) + printf("Unable to load %s locale archives!\n", Locales[i]); + continue; + } - if((CONF_extract & EXTRACT_DBC) == 0) + printf("Detected locale: %s\n", Locales[i]); + if ((CONF_extract & EXTRACT_DBC) == 0) { FirstLocale = i; build = ReadBuild(FirstLocale); + if (build > CONF_TargetBuild) + { + printf("Base locale-%s.MPQ has build higher than target build (%u > %u), nothing extracted!\n", Locales[i], build, CONF_TargetBuild); + break; + } printf("Detected client build: %u\n", build); break; } //Extract DBC files - if(FirstLocale < 0) + uint32 tempBuild = ReadBuild(i); + printf("Detected client build %u for locale %s\n", tempBuild, Locales[i]); + if (tempBuild > CONF_TargetBuild) + { + printf("Base locale-%s.MPQ has build higher than target build (%u > %u), nothing extracted!\n", Locales[i], tempBuild, CONF_TargetBuild); + continue; + } + + ExtractDBCFiles(i, FirstLocale < 0); + + if (FirstLocale < 0) { FirstLocale = i; - build = ReadBuild(FirstLocale); - printf("Detected client build: %u\n", build); - ExtractDBCFiles(i, true); + build = tempBuild; } - else - ExtractDBCFiles(i, false); //Close MPQs - CloseMPQFiles(); + SFileCloseArchive(LocaleMpq); } } - if(FirstLocale < 0) + if (FirstLocale < 0) { printf("No locales detected\n"); return 0; @@ -1071,17 +1204,18 @@ int main(int argc, char * arg[]) if (CONF_extract & EXTRACT_MAP) { - printf("Using locale: %s\n", langs[FirstLocale]); + printf("Using locale: %s\n", Locales[FirstLocale]); // Open MPQs - LoadLocaleMPQFiles(FirstLocale); + LoadLocaleMPQFile(FirstLocale); LoadCommonMPQFiles(); // Extract maps ExtractMapsFromMpq(build); // Close MPQs - CloseMPQFiles(); + SFileCloseArchive(WorldMpq); + SFileCloseArchive(LocaleMpq); } return 0; diff --git a/src/tools/map_extractor/adt.h b/src/tools/map_extractor/adt.h index 5daf5820c3f..e8f79788169 100644 --- a/src/tools/map_extractor/adt.h +++ b/src/tools/map_extractor/adt.h @@ -271,8 +271,8 @@ class adt_MHDR uint32 data5; public: bool prepareLoadedData(); - adt_MCIN *getMCIN(){ return (adt_MCIN *)((uint8 *)&pad+offsMCIN);} - adt_MH2O *getMH2O(){ return offsMH2O ? (adt_MH2O *)((uint8 *)&pad+offsMH2O) : 0;} + adt_MCIN *getMCIN(){ return offsMCIN ? (adt_MCIN *)((uint8 *)&pad+offsMCIN) : NULL;} + adt_MH2O *getMH2O(){ return offsMH2O ? (adt_MH2O *)((uint8 *)&pad+offsMH2O) : NULL;} }; diff --git a/src/tools/map_extractor/dbcfile.cpp b/src/tools/map_extractor/dbcfile.cpp index 927d3d62b7f..021dc6f6e33 100644 --- a/src/tools/map_extractor/dbcfile.cpp +++ b/src/tools/map_extractor/dbcfile.cpp @@ -1,83 +1,91 @@ #define _CRT_SECURE_NO_DEPRECATE #include "dbcfile.h" -#include "mpq_libmpq04.h" -DBCFile::DBCFile(const std::string &filename): - filename(filename), - data(0) +DBCFile::DBCFile(HANDLE file) : + _file(file), _data(NULL), _stringTable(NULL) { - } + bool DBCFile::open() { - MPQFile f(filename.c_str()); char header[4]; - unsigned int na,nb,es,ss; + unsigned int na, nb, es, ss; - if(f.read(header,4)!=4) // Number of records + DWORD readBytes = 0; + SFileReadFile(_file, header, 4, &readBytes, NULL); + if (readBytes != 4) // Number of records return false; - if(header[0]!='W' || header[1]!='D' || header[2]!='B' || header[3]!='C') + if (header[0] != 'W' || header[1] != 'D' || header[2] != 'B' || header[3] != 'C') return false; - if(f.read(&na,4)!=4) // Number of records + SFileReadFile(_file, &na, 4, &readBytes, NULL); + if (readBytes != 4) // Number of records return false; - if(f.read(&nb,4)!=4) // Number of fields + + SFileReadFile(_file, &nb, 4, &readBytes, NULL); + if (readBytes != 4) // Number of fields return false; - if(f.read(&es,4)!=4) // Size of a record + + SFileReadFile(_file, &es, 4, &readBytes, NULL); + if (readBytes != 4) // Size of a record return false; - if(f.read(&ss,4)!=4) // String size + + SFileReadFile(_file, &ss, 4, &readBytes, NULL); + if (readBytes != 4) // String size return false; - recordSize = es; - recordCount = na; - fieldCount = nb; - stringSize = ss; - if(fieldCount*4 != recordSize) + _recordSize = es; + _recordCount = na; + _fieldCount = nb; + _stringSize = ss; + if (_fieldCount * 4 != _recordSize) return false; - data = new unsigned char[recordSize*recordCount+stringSize]; - stringTable = data + recordSize*recordCount; + _data = new unsigned char[_recordSize * _recordCount + _stringSize]; + _stringTable = _data + _recordSize*_recordCount; - size_t data_size = recordSize*recordCount+stringSize; - if(f.read(data,data_size)!=data_size) + size_t data_size = _recordSize * _recordCount + _stringSize; + SFileReadFile(_file, _data, data_size, &readBytes, NULL); + if (readBytes != data_size) return false; - f.close(); + return true; } + DBCFile::~DBCFile() { - delete [] data; + delete [] _data; } DBCFile::Record DBCFile::getRecord(size_t id) { - assert(data); - return Record(*this, data + id*recordSize); + assert(_data); + return Record(*this, _data + id*_recordSize); } size_t DBCFile::getMaxId() { - assert(data); + assert(_data); size_t maxId = 0; for(size_t i = 0; i < getRecordCount(); ++i) - { - if(maxId < getRecord(i).getUInt(0)) + if (maxId < getRecord(i).getUInt(0)) maxId = getRecord(i).getUInt(0); - } + return maxId; } DBCFile::Iterator DBCFile::begin() { - assert(data); - return Iterator(*this, data); + assert(_data); + return Iterator(*this, _data); } + DBCFile::Iterator DBCFile::end() { - assert(data); - return Iterator(*this, stringTable); + assert(_data); + return Iterator(*this, _stringTable); } diff --git a/src/tools/map_extractor/dbcfile.h b/src/tools/map_extractor/dbcfile.h index aef61df7aaa..ce7d8e85ed3 100644 --- a/src/tools/map_extractor/dbcfile.h +++ b/src/tools/map_extractor/dbcfile.h @@ -2,118 +2,124 @@ #define DBCFILE_H #include #include +#include "StormLib.h" class DBCFile { -public: - DBCFile(const std::string &filename); - ~DBCFile(); + public: + DBCFile(HANDLE file); + ~DBCFile(); - // Open database. It must be openened before it can be used. - bool open(); + // Open database. It must be openened before it can be used. + bool open(); - // Database exceptions - class Exception - { - public: - Exception(const std::string &message): message(message) - { } - virtual ~Exception() - { } - const std::string &getMessage() {return message;} - private: - std::string message; - }; - class NotFound: public Exception - { - public: - NotFound(): Exception("Key was not found") - { } - }; - // Iteration over database - class Iterator; - class Record - { - public: - float getFloat(size_t field) const - { - assert(field < file.fieldCount); - return *reinterpret_cast(offset+field*4); - } - unsigned int getUInt(size_t field) const + // Database exceptions + class Exception { - assert(field < file.fieldCount); - return *reinterpret_cast(offset+field*4); - } - int getInt(size_t field) const - { - assert(field < file.fieldCount); - return *reinterpret_cast(offset+field*4); - } - const char *getString(size_t field) const + public: + Exception(const std::string &message) : message(message) { } + virtual ~Exception() { } + const std::string &getMessage() { return message; } + private: + std::string message; + }; + + class NotFound: public Exception { - assert(field < file.fieldCount); - size_t stringOffset = getUInt(field); - assert(stringOffset < file.stringSize); - return reinterpret_cast(file.stringTable + stringOffset); - } - private: - Record(DBCFile &file, unsigned char *offset): file(file), offset(offset) {} - unsigned char *offset; - DBCFile &file; - - friend class DBCFile; - friend class DBCFile::Iterator; - }; - /** Iterator that iterates over records - */ - class Iterator - { - public: - Iterator(DBCFile &file, unsigned char *offset): - record(file, offset) {} - /// Advance (prefix only) - Iterator & operator++() { - record.offset += record.file.recordSize; - return *this; - } - /// Return address of current instance - Record const & operator*() const { return record; } - const Record* operator->() const { - return &record; - } - /// Comparison - bool operator==(const Iterator &b) const + public: + NotFound(): Exception("Key was not found") { } + }; + + // Iteration over database + class Iterator; + class Record { - return record.offset == b.record.offset; - } - bool operator!=(const Iterator &b) const + public: + float getFloat(size_t field) const + { + assert(field < file._fieldCount); + return *reinterpret_cast(offset+field*4); + } + + unsigned int getUInt(size_t field) const + { + assert(field < file._fieldCount); + return *reinterpret_cast(offset+field*4); + } + + int getInt(size_t field) const + { + assert(field < file._fieldCount); + return *reinterpret_cast(offset+field*4); + } + + const char *getString(size_t field) const + { + assert(field < file._fieldCount); + size_t stringOffset = getUInt(field); + assert(stringOffset < file._stringSize); + return reinterpret_cast(file._stringTable + stringOffset); + } + + private: + Record(DBCFile &file, unsigned char *offset): file(file), offset(offset) {} + unsigned char *offset; + DBCFile &file; + + friend class DBCFile; + friend class DBCFile::Iterator; + }; + /** Iterator that iterates over records + */ + class Iterator { - return record.offset != b.record.offset; - } + public: + Iterator(DBCFile &file, unsigned char *offset) : record(file, offset) { } + + /// Advance (prefix only) + Iterator & operator++() + { + record.offset += record.file._recordSize; + return *this; + } + + /// Return address of current instance + Record const & operator*() const { return record; } + const Record* operator->() const { return &record; } + + /// Comparison + bool operator==(const Iterator &b) const + { + return record.offset == b.record.offset; + } + + bool operator!=(const Iterator &b) const + { + return record.offset != b.record.offset; + } + private: + Record record; + }; + + // Get record by id + Record getRecord(size_t id); + /// Get begin iterator over records + Iterator begin(); + /// Get begin iterator over records + Iterator end(); + /// Trivial + size_t getRecordCount() const { return _recordCount; } + size_t getFieldCount() const { return _fieldCount; } + size_t getMaxId(); + private: - Record record; - }; - - // Get record by id - Record getRecord(size_t id); - /// Get begin iterator over records - Iterator begin(); - /// Get begin iterator over records - Iterator end(); - /// Trivial - size_t getRecordCount() const { return recordCount;} - size_t getFieldCount() const { return fieldCount; } - size_t getMaxId(); -private: - std::string filename; - size_t recordSize; - size_t recordCount; - size_t fieldCount; - size_t stringSize; - unsigned char *data; - unsigned char *stringTable; + HANDLE _file; + size_t _recordSize; + size_t _recordCount; + size_t _fieldCount; + size_t _stringSize; + unsigned char *_data; + unsigned char* _stringTable; }; #endif - diff --git a/src/tools/map_extractor/loadlib.cpp b/src/tools/map_extractor/loadlib.cpp index 465eb04083f..0e2112b2f26 100644 --- a/src/tools/map_extractor/loadlib.cpp +++ b/src/tools/map_extractor/loadlib.cpp @@ -1,11 +1,8 @@ #define _CRT_SECURE_NO_DEPRECATE #include "loadlib.h" -#include "mpq_libmpq04.h" #include -class MPQFile; - FileLoader::FileLoader() { data = 0; @@ -18,29 +15,31 @@ FileLoader::~FileLoader() free(); } -bool FileLoader::loadFile(char *filename, bool log) +bool FileLoader::loadFile(HANDLE mpq, char* filename, bool log) { free(); - MPQFile mf(filename); - if(mf.isEof()) + HANDLE file; + if (!SFileOpenFileEx(mpq, filename, SFILE_OPEN_PATCHED_FILE, &file)) { if (log) printf("No such file %s\n", filename); return false; } - data_size = mf.getSize(); - - data = new uint8 [data_size]; + data_size = SFileGetFileSize(file, NULL); + data = new uint8[data_size]; if (data) { - mf.read(data, data_size); - mf.close(); + SFileReadFile(file, data, data_size, NULL/*bytesRead*/, NULL); if (prepareLoadedData()) + { + SFileCloseFile(file); return true; + } } - printf("Error loading %s", filename); - mf.close(); + + printf("Error loading %s\n", filename); + SFileCloseFile(file); free(); return false; } diff --git a/src/tools/map_extractor/loadlib/loadlib.h b/src/tools/map_extractor/loadlib/loadlib.h index bf6c0706d46..7a158ddfcf1 100644 --- a/src/tools/map_extractor/loadlib/loadlib.h +++ b/src/tools/map_extractor/loadlib/loadlib.h @@ -1,6 +1,8 @@ #ifndef LOAD_LIB_H #define LOAD_LIB_H +#include "StormLib.h" + #ifdef _WIN32 typedef __int64 int64; typedef __int32 int32; @@ -42,6 +44,7 @@ struct file_MVER uint32 ver; }; + class FileLoader{ uint8 *data; uint32 data_size; @@ -53,7 +56,7 @@ public: file_MVER *version; FileLoader(); ~FileLoader(); - bool loadFile(char *filename, bool log = true); + bool loadFile(HANDLE mpq, char *filename, bool log = true); virtual void free(); }; #endif diff --git a/src/tools/map_extractor/mpq_libmpq.cpp b/src/tools/map_extractor/mpq_libmpq.cpp deleted file mode 100644 index 81aa8cc2894..00000000000 --- a/src/tools/map_extractor/mpq_libmpq.cpp +++ /dev/null @@ -1,111 +0,0 @@ -#include "mpq_libmpq04.h" -#include -#include - -ArchiveSet gOpenArchives; - -MPQArchive::MPQArchive(const char* filename) -{ - int result = libmpq__archive_open(&mpq_a, filename, -1); - printf("Opening %s\n", filename); - if(result) { - switch(result) { - case LIBMPQ_ERROR_OPEN : - printf("Error opening archive '%s': Does file really exist?\n", filename); - break; - case LIBMPQ_ERROR_FORMAT : /* bad file format */ - printf("Error opening archive '%s': Bad file format\n", filename); - break; - case LIBMPQ_ERROR_SEEK : /* seeking in file failed */ - printf("Error opening archive '%s': Seeking in file failed\n", filename); - break; - case LIBMPQ_ERROR_READ : /* Read error in archive */ - printf("Error opening archive '%s': Read error in archive\n", filename); - break; - case LIBMPQ_ERROR_MALLOC : /* maybe not enough memory? :) */ - printf("Error opening archive '%s': Maybe not enough memory\n", filename); - break; - default: - printf("Error opening archive '%s': Unknown error\n", filename); - break; - } - return; - } - gOpenArchives.push_front(this); -} - -void MPQArchive::close() -{ - //gOpenArchives.erase(erase(&mpq_a); - libmpq__archive_close(mpq_a); -} - -MPQFile::MPQFile(const char* filename): - eof(false), - buffer(0), - pointer(0), - size(0) -{ - for(ArchiveSet::iterator i=gOpenArchives.begin(); i!=gOpenArchives.end();++i) - { - mpq_archive *mpq_a = (*i)->mpq_a; - - uint32_t filenum; - if(libmpq__file_number(mpq_a, filename, &filenum)) continue; - libmpq__off_t transferred; - libmpq__file_unpacked_size(mpq_a, filenum, &size); - - // HACK: in patch.mpq some files don't want to open and give 1 for filesize - if (size<=1) { -// printf("warning: file %s has size %d; cannot read.\n", filename, size); - eof = true; - buffer = 0; - return; - } - buffer = new char[size]; - - //libmpq_file_getdata - libmpq__file_read(mpq_a, filenum, (unsigned char*)buffer, size, &transferred); - /*libmpq_file_getdata(&mpq_a, hash, fileno, (unsigned char*)buffer);*/ - return; - - } - eof = true; - buffer = 0; -} - -size_t MPQFile::read(void* dest, size_t bytes) -{ - if (eof) return 0; - - size_t rpos = pointer + bytes; - if (rpos > size) { - bytes = size - pointer; - eof = true; - } - - memcpy(dest, &(buffer[pointer]), bytes); - - pointer = rpos; - - return bytes; -} - -void MPQFile::seek(int offset) -{ - pointer = offset; - eof = (pointer >= size); -} - -void MPQFile::seekRelative(int offset) -{ - pointer += offset; - eof = (pointer >= size); -} - -void MPQFile::close() -{ - if (buffer) delete[] buffer; - buffer = 0; - eof = true; -} diff --git a/src/tools/map_extractor/mpq_libmpq04.h b/src/tools/map_extractor/mpq_libmpq04.h deleted file mode 100644 index 1f3b259bbfc..00000000000 --- a/src/tools/map_extractor/mpq_libmpq04.h +++ /dev/null @@ -1,91 +0,0 @@ -#define _CRT_SECURE_NO_DEPRECATE -#define _CRT_SECURE_NO_WARNINGS - -#ifndef MPQ_H -#define MPQ_H - -#include "loadlib/loadlib.h" -#include "libmpq/mpq.h" -#include -#include -#include -#include -#include - -using namespace std; - -class MPQArchive -{ - -public: - mpq_archive_s *mpq_a; - - MPQArchive(const char* filename); - void close(); - - void GetFileListTo(vector& filelist) { - uint32_t filenum; - if(libmpq__file_number(mpq_a, "(listfile)", &filenum)) return; - libmpq__off_t size, transferred; - libmpq__file_unpacked_size(mpq_a, filenum, &size); - - char *buffer = new char[size]; - - libmpq__file_read(mpq_a, filenum, (unsigned char*)buffer, size, &transferred); - - char seps[] = "\n"; - char *token; - - token = strtok( buffer, seps ); - uint32 counter = 0; - while ((token != NULL) && (counter < size)) { - //cout << token << endl; - token[strlen(token) - 1] = 0; - string s = token; - filelist.push_back(s); - counter += strlen(token) + 2; - token = strtok(NULL, seps); - } - - delete[] buffer; - } -}; -typedef std::deque ArchiveSet; - -class MPQFile -{ - //MPQHANDLE handle; - bool eof; - char *buffer; - libmpq__off_t pointer,size; - - // disable copying - MPQFile(const MPQFile &f) {} - void operator=(const MPQFile &f) {} - -public: - MPQFile(const char* filename); // filenames are not case sensitive - ~MPQFile() { close(); } - size_t read(void* dest, size_t bytes); - size_t getSize() { return size; } - size_t getPos() { return pointer; } - char* getBuffer() { return buffer; } - char* getPointer() { return buffer + pointer; } - bool isEof() { return eof; } - void seek(int offset); - void seekRelative(int offset); - void close(); -}; - -inline void flipcc(char *fcc) -{ - char t; - t=fcc[0]; - fcc[0]=fcc[3]; - fcc[3]=t; - t=fcc[1]; - fcc[1]=fcc[2]; - fcc[2]=t; -} - -#endif diff --git a/src/tools/map_extractor/wdt.cpp b/src/tools/map_extractor/wdt.cpp index dedefbb64e5..6c2fa337d4f 100644 --- a/src/tools/map_extractor/wdt.cpp +++ b/src/tools/map_extractor/wdt.cpp @@ -57,6 +57,6 @@ bool WDT_file::prepareLoadedData() return false; wmo = (wdt_MWMO *)((uint8*)main+ main->size+8); if (!wmo->prepareLoadedData()) - return false; + wmo = NULL; // optional as of cataclysm return true; } \ No newline at end of file diff --git a/src/tools/map_extractor/wdt.h b/src/tools/map_extractor/wdt.h index fcee8ac64f2..be6df3f173d 100644 --- a/src/tools/map_extractor/wdt.h +++ b/src/tools/map_extractor/wdt.h @@ -45,7 +45,7 @@ public: uint32 size; struct adtData{ - uint32 exist; + uint32 flag; uint32 data1; } adt_list[64][64]; diff --git a/src/tools/vmap3_extractor/CMakeLists.txt b/src/tools/vmap3_extractor/CMakeLists.txt index 2ff2fd0cf6b..2763487cea4 100644 --- a/src/tools/vmap3_extractor/CMakeLists.txt +++ b/src/tools/vmap3_extractor/CMakeLists.txt @@ -15,31 +15,23 @@ file(GLOB_RECURSE sources *.cpp *.h) add_definitions("-DIOMAP_DEBUG") # build setup currently only supports libmpq 0.4.x -add_definitions("-DUSE_LIBMPQ04") add_definitions("-Wall") add_definitions("-ggdb") add_definitions("-O3") -if( UNIX ) - include_directories( - ${CMAKE_SOURCE_DIR}/dep/libmpq - ) -elseif( WIN32 ) - include_directories( - ${CMAKE_SOURCE_DIR}/dep/libmpq - ${CMAKE_SOURCE_DIR}/dep/libmpq/win - ) -endif() +include_directories( + ${CMAKE_SOURCE_DIR}/dep/StormLib/src +) add_executable(vmap3extractor ${sources}) target_link_libraries(vmap3extractor ${BZIP2_LIBRARIES} ${ZLIB_LIBRARIES} - mpq + storm ) -add_dependencies(vmap3extractor mpq) +add_dependencies(vmap3extractor storm) if( UNIX ) install(TARGETS vmap3extractor DESTINATION bin) diff --git a/src/tools/vmap3_extractor/dbcfile.cpp b/src/tools/vmap3_extractor/dbcfile.cpp index 8b8afe9f23c..021dc6f6e33 100644 --- a/src/tools/vmap3_extractor/dbcfile.cpp +++ b/src/tools/vmap3_extractor/dbcfile.cpp @@ -1,77 +1,91 @@ -#include "dbcfile.h" -#include "mpq_libmpq04.h" -#undef min -#undef max +#define _CRT_SECURE_NO_DEPRECATE -#include +#include "dbcfile.h" -DBCFile::DBCFile(const std::string &filename) : filename(filename) +DBCFile::DBCFile(HANDLE file) : + _file(file), _data(NULL), _stringTable(NULL) { - data = NULL; } bool DBCFile::open() { - MPQFile f(filename.c_str()); + char header[4]; + unsigned int na, nb, es, ss; + + DWORD readBytes = 0; + SFileReadFile(_file, header, 4, &readBytes, NULL); + if (readBytes != 4) // Number of records + return false; + + if (header[0] != 'W' || header[1] != 'D' || header[2] != 'B' || header[3] != 'C') + return false; + + SFileReadFile(_file, &na, 4, &readBytes, NULL); + if (readBytes != 4) // Number of records + return false; + + SFileReadFile(_file, &nb, 4, &readBytes, NULL); + if (readBytes != 4) // Number of fields + return false; - // Need some error checking, otherwise an unhandled exception error occurs - // if people screw with the data path. - if (f.isEof() == true) + SFileReadFile(_file, &es, 4, &readBytes, NULL); + if (readBytes != 4) // Size of a record return false; - unsigned char header[4]; - unsigned int na,nb,es,ss; + SFileReadFile(_file, &ss, 4, &readBytes, NULL); + if (readBytes != 4) // String size + return false; + + _recordSize = es; + _recordCount = na; + _fieldCount = nb; + _stringSize = ss; + if (_fieldCount * 4 != _recordSize) + return false; - f.read(header,4); // File Header + _data = new unsigned char[_recordSize * _recordCount + _stringSize]; + _stringTable = _data + _recordSize*_recordCount; - if (header[0]!='W' || header[1]!='D' || header[2]!='B' || header[3] != 'C') - { - f.close(); - data = NULL; - printf("Critical Error: An error occured while trying to read the DBCFile %s.", filename.c_str()); + size_t data_size = _recordSize * _recordCount + _stringSize; + SFileReadFile(_file, _data, data_size, &readBytes, NULL); + if (readBytes != data_size) return false; - } - - //assert(header[0]=='W' && header[1]=='D' && header[2]=='B' && header[3] == 'C'); - - f.read(&na,4); // Number of records - f.read(&nb,4); // Number of fields - f.read(&es,4); // Size of a record - f.read(&ss,4); // String size - - recordSize = es; - recordCount = na; - fieldCount = nb; - stringSize = ss; - //assert(fieldCount*4 == recordSize); - assert(fieldCount*4 >= recordSize); - - data = new unsigned char[recordSize*recordCount+stringSize]; - stringTable = data + recordSize*recordCount; - f.read(data,recordSize*recordCount+stringSize); - f.close(); + return true; } DBCFile::~DBCFile() { - delete [] data; + delete [] _data; } DBCFile::Record DBCFile::getRecord(size_t id) { - assert(data); - return Record(*this, data + id*recordSize); + assert(_data); + return Record(*this, _data + id*_recordSize); +} + +size_t DBCFile::getMaxId() +{ + assert(_data); + + size_t maxId = 0; + for(size_t i = 0; i < getRecordCount(); ++i) + if (maxId < getRecord(i).getUInt(0)) + maxId = getRecord(i).getUInt(0); + + return maxId; } DBCFile::Iterator DBCFile::begin() { - assert(data); - return Iterator(*this, data); + assert(_data); + return Iterator(*this, _data); } DBCFile::Iterator DBCFile::end() { - assert(data); - return Iterator(*this, stringTable); + assert(_data); + return Iterator(*this, _stringTable); } + diff --git a/src/tools/vmap3_extractor/dbcfile.h b/src/tools/vmap3_extractor/dbcfile.h index d405d6ffd60..ce7d8e85ed3 100644 --- a/src/tools/vmap3_extractor/dbcfile.h +++ b/src/tools/vmap3_extractor/dbcfile.h @@ -1,155 +1,125 @@ -/* - * Copyright (C) 2008-2010 TrinityCore - * Copyright (C) 2005-2010 MaNGOS - * - * 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; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; 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, see . - */ - #ifndef DBCFILE_H #define DBCFILE_H - #include #include +#include "StormLib.h" class DBCFile { -public: - DBCFile(const std::string &filename); - ~DBCFile(); - - // Open database. It must be openened before it can be used. - bool open(); - - // TODO: Add a close function? - - // Database exceptions - class Exception - { public: - Exception(const std::string &message): message(message) - { } - virtual ~Exception() - { } - const std::string &getMessage() {return message;} - private: - std::string message; - }; + DBCFile(HANDLE file); + ~DBCFile(); - // - class NotFound: public Exception - { - public: - NotFound(): Exception("Key was not found") - { } - }; - - // Iteration over database - class Iterator; - class Record - { - public: - Record& operator= (const Record& r) - { - file = r.file; - offset = r.offset; - return *this; - } - float getFloat(size_t field) const - { - assert(field < file.fieldCount); - return *reinterpret_cast(offset+field*4); - } - unsigned int getUInt(size_t field) const - { - assert(field < file.fieldCount); - return *reinterpret_cast(offset+(field*4)); - } - int getInt(size_t field) const + // Open database. It must be openened before it can be used. + bool open(); + + // Database exceptions + class Exception { - assert(field < file.fieldCount); - return *reinterpret_cast(offset+field*4); - } - unsigned char getByte(size_t ofs) const + public: + Exception(const std::string &message) : message(message) { } + virtual ~Exception() { } + const std::string &getMessage() { return message; } + private: + std::string message; + }; + + class NotFound: public Exception { - assert(ofs < file.recordSize); - return *reinterpret_cast(offset+ofs); - } - const char *getString(size_t field) const + public: + NotFound(): Exception("Key was not found") { } + }; + + // Iteration over database + class Iterator; + class Record { - assert(field < file.fieldCount); - size_t stringOffset = getUInt(field); - assert(stringOffset < file.stringSize); - //char * tmp = (char*)file.stringTable + stringOffset; - //unsigned char * tmp2 = file.stringTable + stringOffset; - return reinterpret_cast(file.stringTable + stringOffset); - } - private: - Record(DBCFile &file, unsigned char *offset): file(file), offset(offset) {} - DBCFile &file; - unsigned char *offset; + public: + float getFloat(size_t field) const + { + assert(field < file._fieldCount); + return *reinterpret_cast(offset+field*4); + } - friend class DBCFile; - friend class Iterator; - }; + unsigned int getUInt(size_t field) const + { + assert(field < file._fieldCount); + return *reinterpret_cast(offset+field*4); + } - /* Iterator that iterates over records */ - class Iterator - { - public: - Iterator(DBCFile &file, unsigned char *offset): - record(file, offset) {} - /// Advance (prefix only) - Iterator & operator++() { - record.offset += record.file.recordSize; - return *this; - } - /// Return address of current instance - Record const & operator*() const { return record; } - const Record* operator->() const { - return &record; - } - /// Comparison - bool operator==(const Iterator &b) const - { - return record.offset == b.record.offset; - } - bool operator!=(const Iterator &b) const + int getInt(size_t field) const + { + assert(field < file._fieldCount); + return *reinterpret_cast(offset+field*4); + } + + const char *getString(size_t field) const + { + assert(field < file._fieldCount); + size_t stringOffset = getUInt(field); + assert(stringOffset < file._stringSize); + return reinterpret_cast(file._stringTable + stringOffset); + } + + private: + Record(DBCFile &file, unsigned char *offset): file(file), offset(offset) {} + unsigned char *offset; + DBCFile &file; + + friend class DBCFile; + friend class DBCFile::Iterator; + }; + /** Iterator that iterates over records + */ + class Iterator { - return record.offset != b.record.offset; - } + public: + Iterator(DBCFile &file, unsigned char *offset) : record(file, offset) { } + + /// Advance (prefix only) + Iterator & operator++() + { + record.offset += record.file._recordSize; + return *this; + } + + /// Return address of current instance + Record const & operator*() const { return record; } + const Record* operator->() const { return &record; } + + /// Comparison + bool operator==(const Iterator &b) const + { + return record.offset == b.record.offset; + } + + bool operator!=(const Iterator &b) const + { + return record.offset != b.record.offset; + } + private: + Record record; + }; + + // Get record by id + Record getRecord(size_t id); + /// Get begin iterator over records + Iterator begin(); + /// Get begin iterator over records + Iterator end(); + /// Trivial + size_t getRecordCount() const { return _recordCount; } + size_t getFieldCount() const { return _fieldCount; } + size_t getMaxId(); + private: - Record record; - }; - - // Get record by id - Record getRecord(size_t id); - /// Get begin iterator over records - Iterator begin(); - /// Get begin iterator over records - Iterator end(); - /// Trivial - size_t getRecordCount() const { return recordCount;} - size_t getFieldCount() const { return fieldCount; } - -private: - std::string filename; - size_t recordSize; - size_t recordCount; - size_t fieldCount; - size_t stringSize; - unsigned char *data; - unsigned char *stringTable; + HANDLE _file; + size_t _recordSize; + size_t _recordCount; + size_t _fieldCount; + size_t _stringSize; + unsigned char *_data; + unsigned char* _stringTable; }; #endif diff --git a/src/tools/vmap3_extractor/loadlib/loadlib.h b/src/tools/vmap3_extractor/loadlib/loadlib.h deleted file mode 100644 index bf6c0706d46..00000000000 --- a/src/tools/vmap3_extractor/loadlib/loadlib.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef LOAD_LIB_H -#define LOAD_LIB_H - -#ifdef _WIN32 -typedef __int64 int64; -typedef __int32 int32; -typedef __int16 int16; -typedef __int8 int8; -typedef unsigned __int64 uint64; -typedef unsigned __int32 uint32; -typedef unsigned __int16 uint16; -typedef unsigned __int8 uint8; -#else -#include -#ifndef uint64_t -#ifdef __linux__ -#include -#endif -#endif -typedef int64_t int64; -typedef int32_t int32; -typedef int16_t int16; -typedef int8_t int8; -typedef uint64_t uint64; -typedef uint32_t uint32; -typedef uint16_t uint16; -typedef uint8_t uint8; -#endif - -#define FILE_FORMAT_VERSION 18 - -// -// File version chunk -// -struct file_MVER -{ - union{ - uint32 fcc; - char fcc_txt[4]; - }; - uint32 size; - uint32 ver; -}; - -class FileLoader{ - uint8 *data; - uint32 data_size; -public: - virtual bool prepareLoadedData(); - uint8 *GetData() {return data;} - uint32 GetDataSize() {return data_size;} - - file_MVER *version; - FileLoader(); - ~FileLoader(); - bool loadFile(char *filename, bool log = true); - virtual void free(); -}; -#endif diff --git a/src/tools/vmap3_extractor/model.h b/src/tools/vmap3_extractor/model.h index c131645bd73..f16396bdd40 100644 --- a/src/tools/vmap3_extractor/model.h +++ b/src/tools/vmap3_extractor/model.h @@ -1,7 +1,6 @@ #ifndef MODEL_H #define MODEL_H -#include "loadlib/loadlib.h" #include "vec3d.h" //#include "mpq.h" #include "modelheaders.h" diff --git a/src/tools/vmap3_extractor/mpq_libmpq04.h b/src/tools/vmap3_extractor/mpq_libmpq04.h index f32f09badde..e0c42ba0bfd 100644 --- a/src/tools/vmap3_extractor/mpq_libmpq04.h +++ b/src/tools/vmap3_extractor/mpq_libmpq04.h @@ -1,7 +1,6 @@ #ifndef MPQ_H #define MPQ_H -#include "loadlib/loadlib.h" #include "libmpq/mpq.h" #include #include diff --git a/src/tools/vmap3_extractor/wmo.h b/src/tools/vmap3_extractor/wmo.h index 12979bc13d9..1632b6c5893 100644 --- a/src/tools/vmap3_extractor/wmo.h +++ b/src/tools/vmap3_extractor/wmo.h @@ -6,7 +6,6 @@ #include #include #include "vec3d.h" -#include "loadlib/loadlib.h" // MOPY flags #define WMO_MATERIAL_NOCAMCOLLIDE 0x01 -- cgit v1.2.3 From 5ced6edbcff4f0bcc05ddebd169debf93b95df37 Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 20 Feb 2012 21:40:31 +0100 Subject: Tools/Extractors: Updated map extractor to cataclysm, enjoy new maps --- src/tools/map_extractor/System.cpp | 38 ++++++++++---------------------------- src/tools/map_extractor/adt.cpp | 21 +++++++++++++++++++++ src/tools/map_extractor/adt.h | 13 ++++++++----- 3 files changed, 39 insertions(+), 33 deletions(-) (limited to 'src') diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp index 443e9a9ada6..34c55490b2f 100644 --- a/src/tools/map_extractor/System.cpp +++ b/src/tools/map_extractor/System.cpp @@ -34,8 +34,6 @@ #define OPEN_FLAGS (O_RDONLY | O_BINARY) #endif -typedef std::list Archives; -Archives WorldMpqs; HANDLE WorldMpq = NULL; HANDLE LocaleMpq = NULL; @@ -430,13 +428,6 @@ bool ConvertADT(char *filename, char *filename2, int cell_y, int cell_x, uint32 if (!adt.loadFile(WorldMpq, filename)) return false; - adt_MCIN *cells = adt.a_grid->getMCIN(); - if (!cells) - { - printf("Can't find cells in '%s'\n", filename); - return false; - } - memset(liquid_show, 0, sizeof(liquid_show)); memset(liquid_type, 0, sizeof(liquid_type)); @@ -451,7 +442,7 @@ bool ConvertADT(char *filename, char *filename2, int cell_y, int cell_x, uint32 { for(int j=0;jgetMCNK(i,j); + adt_MCNK * cell = adt.cells[i][j]; uint32 areaid = cell->areaid; if(areaid && areaid <= maxAreaId) { @@ -506,7 +497,7 @@ bool ConvertADT(char *filename, char *filename2, int cell_y, int cell_x, uint32 { for(int j=0;jgetMCNK(i,j); + adt_MCNK * cell = adt.cells[i][j]; if (!cell) continue; // Height values for triangles stored in order: @@ -748,7 +739,7 @@ bool ConvertADT(char *filename, char *filename2, int cell_y, int cell_x, uint32 { for(int j=0;jgetMCNK(i, j); + adt_MCNK *cell = adt.cells[i][j]; if (!cell) continue; @@ -1058,7 +1049,7 @@ bool LoadLocaleMPQFile(int locale) memset(buff, 0, sizeof(buff)); if (Builds[i] > LAST_DBC_IN_DATA_BUILD) { - prefix = NULL; + prefix = ""; _stprintf(buff, _T("./Data/%s/wow-update-%s-%u.MPQ"), LocalesT[locale], LocalesT[locale], Builds[i]); } else @@ -1071,9 +1062,6 @@ bool LoadLocaleMPQFile(int locale) { if (GetLastError() != ERROR_FILE_NOT_FOUND) _tprintf(_T("Cannot open patch archive %s\n"), buff); - //SFileCloseArchive(mpq); - //err = true; - //break; continue; } } @@ -1096,14 +1084,11 @@ void LoadCommonMPQFiles() for(int i = 1; i < count; ++i) { _stprintf(filename, _T("%s/Data/%s"), input_path, CONF_mpq_list[i]); - //if (FileExists(filename)) + if (!SFileOpenPatchArchive(WorldMpq, filename, "", 0)) { - if (!SFileOpenPatchArchive(WorldMpq, filename, NULL, 0)) - { - if (GetLastError() != ERROR_PATH_NOT_FOUND) - _tprintf(_T("Cannot open archive %s\n"), filename); - break; - } + if (GetLastError() != ERROR_PATH_NOT_FOUND) + _tprintf(_T("Cannot open archive %s\n"), filename); + break; } } @@ -1113,7 +1098,7 @@ void LoadCommonMPQFiles() memset(filename, 0, sizeof(filename)); if (Builds[i] > LAST_DBC_IN_DATA_BUILD) { - prefix = NULL; + prefix = ""; _stprintf(filename, _T("%s/Data/wow-update-base-%u.MPQ"), input_path, Builds[i]); } else @@ -1122,13 +1107,10 @@ void LoadCommonMPQFiles() _stprintf(filename, _T("%s/Data/wow-update-%u.MPQ"), input_path, Builds[i]); } - if (!SFileOpenPatchArchive(LocaleMpq, filename, prefix, 0)) + if (!SFileOpenPatchArchive(WorldMpq, filename, prefix, 0)) { if (GetLastError() != ERROR_PATH_NOT_FOUND) _tprintf(_T("Cannot open patch archive %s\n"), filename); - //SFileCloseArchive(mpq); - //err = true; - //break; continue; } } diff --git a/src/tools/map_extractor/adt.cpp b/src/tools/map_extractor/adt.cpp index fde70681113..bb1e3bfcc45 100644 --- a/src/tools/map_extractor/adt.cpp +++ b/src/tools/map_extractor/adt.cpp @@ -48,6 +48,27 @@ bool ADT_file::prepareLoadedData() if (!a_grid->prepareLoadedData()) return false; + // funny offsets calculations because there is no mapping for them and they have variable lengths + uint8* ptr = (uint8*)a_grid + a_grid->size + 8; + uint32 mcnk_count = 0; + memset(cells, 0, ADT_CELLS_PER_GRID * ADT_CELLS_PER_GRID * sizeof(adt_MCNK*)); + while (ptr < GetData() + GetDataSize()) + { + uint32 header = *(uint32*)ptr; + uint32 size = *(uint32*)(ptr + 4); + if (header == 'MCNK') + { + cells[mcnk_count / ADT_CELLS_PER_GRID][mcnk_count % ADT_CELLS_PER_GRID] = (adt_MCNK*)ptr; + ++mcnk_count; + } + + // move to next chunk + ptr += size + 8; + } + + if (mcnk_count != ADT_CELLS_PER_GRID * ADT_CELLS_PER_GRID) + return false; + return true; } diff --git a/src/tools/map_extractor/adt.h b/src/tools/map_extractor/adt.h index e8f79788169..20b5ac93540 100644 --- a/src/tools/map_extractor/adt.h +++ b/src/tools/map_extractor/adt.h @@ -245,15 +245,18 @@ public: // // Adt file header chunk // +class ADT_file; class adt_MHDR { + friend class ADT_file; + union{ uint32 fcc; char fcc_txt[4]; }; uint32 size; - uint32 pad; + uint32 flags; uint32 offsMCIN; // MCIN uint32 offsTex; // MTEX uint32 offsModels; // MMDX @@ -271,9 +274,8 @@ class adt_MHDR uint32 data5; public: bool prepareLoadedData(); - adt_MCIN *getMCIN(){ return offsMCIN ? (adt_MCIN *)((uint8 *)&pad+offsMCIN) : NULL;} - adt_MH2O *getMH2O(){ return offsMH2O ? (adt_MH2O *)((uint8 *)&pad+offsMH2O) : NULL;} - + adt_MCIN* getMCIN() { return offsMCIN ? (adt_MCIN *)((uint8 *)&flags+offsMCIN) : NULL; } + adt_MH2O* getMH2O() { return offsMH2O ? (adt_MH2O *)((uint8 *)&flags+offsMH2O) : NULL; } }; class ADT_file : public FileLoader{ @@ -283,7 +285,8 @@ public: ~ADT_file(); void free(); - adt_MHDR *a_grid; + adt_MHDR* a_grid; + adt_MCNK* cells[ADT_CELLS_PER_GRID][ADT_CELLS_PER_GRID]; }; #endif -- cgit v1.2.3 From 19a4ac4d926750523921a33f6cb635ee8c09e74f Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 21 Feb 2012 14:21:06 +0000 Subject: Core/Opcodes: MSG_RAID_READY_CHECK was not changed --- src/server/game/Handlers/GroupHandler.cpp | 4 ++-- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- src/server/game/Server/Protocol/Opcodes.h | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp index 7d99213acf0..3d919335e1a 100755 --- a/src/server/game/Handlers/GroupHandler.cpp +++ b/src/server/game/Handlers/GroupHandler.cpp @@ -710,7 +710,7 @@ void WorldSession::HandlePartyAssignmentOpcode(WorldPacket & recv_data) void WorldSession::HandleRaidReadyCheckOpcode(WorldPacket & recv_data) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received SMSG_RAID_READY_CHECK"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_RAID_READY_CHECK"); Group* group = GetPlayer()->GetGroup(); if (!group) @@ -724,7 +724,7 @@ void WorldSession::HandleRaidReadyCheckOpcode(WorldPacket & recv_data) /********************/ // everything's fine, do it - WorldPacket data(SMSG_RAID_READY_CHECK, 8); + WorldPacket data(MSG_RAID_READY_CHECK, 8); data << GetPlayer()->GetGUID(); group->BroadcastPacket(&data, false, -1); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index e5cdc7da4b4..4ed8f90b10e 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -862,7 +862,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_RESET_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_LAST_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(MSG_RAID_TARGET_UPDATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidTargetUpdateOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_RAID_READY_CHECK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidReadyCheckOpcode ); + DEFINE_OPCODE_HANDLER(MSG_RAID_READY_CHECK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidReadyCheckOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LUA_USAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(SMSG_PET_ACTION_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PET_DISMISS_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 3714218540c..6f5e9f588f6 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -524,7 +524,8 @@ enum Opcodes MSG_QUERY_GUILD_BANK_TEXT = 0x8CCF, MSG_QUERY_NEXT_MAIL_TIME = 0xCEE6, MSG_QUEST_PUSH_RESULT = 0x1863, - MSG_RAID_READY_CHECK_CONFIRM = 0x584E, + MSG_RAID_READY_CHECK = 0x584E, + MSG_RAID_READY_CHECK_CONFIRM = 0x00, MSG_RAID_READY_CHECK_FINISHED = 0x00, MSG_RAID_TARGET_UPDATE = 0x1E5F, MSG_RANDOM_ROLL = 0x4C57, @@ -961,7 +962,6 @@ enum Opcodes SMSG_RAID_GROUP_ONLY = 0xDCDB, SMSG_RAID_INSTANCE_INFO = 0x4ACA, SMSG_RAID_INSTANCE_MESSAGE = 0xD862, - SMSG_RAID_READY_CHECK = 0x584E, SMSG_RANDOMIZE_CHAR_NAME = 0xF0DC, SMSG_READ_ITEM_FAILED = 0x0C5B, SMSG_READ_ITEM_OK = 0x9ECE, -- cgit v1.2.3 From 4c2a181cdd71d6a960fc91b98a2629ce815764ab Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 21 Feb 2012 21:12:00 +0100 Subject: Tools/Extractors: Map extractor will now skip world2.MPQ before patch 4.3.2 --- src/tools/map_extractor/System.cpp | 106 ++++++++++++++++++------------------- src/tools/map_extractor/dbcfile.h | 4 +- 2 files changed, 54 insertions(+), 56 deletions(-) (limited to 'src') diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp index 34c55490b2f..842fdb16722 100644 --- a/src/tools/map_extractor/System.cpp +++ b/src/tools/map_extractor/System.cpp @@ -286,15 +286,12 @@ void ReadAreaTableDBC() } size_t area_count = dbc.getRecordCount(); - size_t maxid = dbc.getMaxId(); - areas = new uint16[maxid + 1]; - memset(areas, 0xff, (maxid + 1) * sizeof(uint16)); + maxAreaId = dbc.getMaxId(); + areas = new uint16[maxAreaId + 1]; - for(uint32 x = 0; x < area_count; ++x) + for (uint32 x = 0; x < area_count; ++x) areas[dbc.getRecord(x).getUInt(0)] = dbc.getRecord(x).getUInt(3); - maxAreaId = dbc.getMaxId(); - SFileCloseFile(dbcFile); printf("Done! (%u areas loaded)\n", area_count); } @@ -438,24 +435,27 @@ bool ConvertADT(char *filename, char *filename2, int cell_y, int cell_x, uint32 map.buildMagic = build; // Get area flags data - for (int i=0;iareaid; - if(areaid && areaid <= maxAreaId) + if (areaid && areaid <= maxAreaId) { - if(areas[areaid] != 0xffff) + if (areas[areaid] != 0xFFFF) { area_flags[i][j] = areas[areaid]; continue; } + printf("File: %s\nCan't find area flag for areaid %u [%d, %d].\n", filename, areaid, cell->ix, cell->iy); } + area_flags[i][j] = 0xffff; } } + //============================================ // Try pack area data //============================================ @@ -1069,7 +1069,7 @@ bool LoadLocaleMPQFile(int locale) return true; } -void LoadCommonMPQFiles() +void LoadCommonMPQFiles(uint32 build) { TCHAR filename[512]; _stprintf(filename, _T("%s/Data/world.MPQ"), input_path); @@ -1080,16 +1080,16 @@ void LoadCommonMPQFiles() return; } - int count = sizeof(CONF_mpq_list)/sizeof(char*); - for(int i = 1; i < count; ++i) + int count = sizeof(CONF_mpq_list) / sizeof(char*); + for (int i = 1; i < count; ++i) { + if (build < 15211 && !strcmp("world2.MPQ", CONF_mpq_list[i])) // 4.3.2 and higher MPQ + continue; + _stprintf(filename, _T("%s/Data/%s"), input_path, CONF_mpq_list[i]); if (!SFileOpenPatchArchive(WorldMpq, filename, "", 0)) - { if (GetLastError() != ERROR_PATH_NOT_FOUND) _tprintf(_T("Cannot open archive %s\n"), filename); - break; - } } char const* prefix = NULL; @@ -1131,51 +1131,49 @@ int main(int argc, char * arg[]) { TCHAR tmp1[512]; _stprintf(tmp1, _T("%s/Data/%s/locale-%s.MPQ"), input_path, Locales[i], Locales[i]); - //if (FileExists(tmp1)) - { - //Open MPQs - if (!LoadLocaleMPQFile(i)) - { - if (GetLastError() != ERROR_PATH_NOT_FOUND) - printf("Unable to load %s locale archives!\n", Locales[i]); - continue; - } + //Open MPQs + if (!LoadLocaleMPQFile(i)) + { + if (GetLastError() != ERROR_PATH_NOT_FOUND) + printf("Unable to load %s locale archives!\n", Locales[i]); + continue; + } - printf("Detected locale: %s\n", Locales[i]); - if ((CONF_extract & EXTRACT_DBC) == 0) + printf("Detected locale: %s\n", Locales[i]); + if ((CONF_extract & EXTRACT_DBC) == 0) + { + FirstLocale = i; + build = ReadBuild(i); + if (build > CONF_TargetBuild) { - FirstLocale = i; - build = ReadBuild(FirstLocale); - if (build > CONF_TargetBuild) - { - printf("Base locale-%s.MPQ has build higher than target build (%u > %u), nothing extracted!\n", Locales[i], build, CONF_TargetBuild); - break; - } - printf("Detected client build: %u\n", build); - break; + printf("Base locale-%s.MPQ has build higher than target build (%u > %u), nothing extracted!\n", Locales[i], build, CONF_TargetBuild); + return; } - //Extract DBC files - uint32 tempBuild = ReadBuild(i); - printf("Detected client build %u for locale %s\n", tempBuild, Locales[i]); - if (tempBuild > CONF_TargetBuild) - { - printf("Base locale-%s.MPQ has build higher than target build (%u > %u), nothing extracted!\n", Locales[i], tempBuild, CONF_TargetBuild); - continue; - } + printf("Detected client build: %u\n", build); + break; + } - ExtractDBCFiles(i, FirstLocale < 0); + //Extract DBC files + uint32 tempBuild = ReadBuild(i); + printf("Detected client build %u for locale %s\n", tempBuild, Locales[i]); + if (tempBuild > CONF_TargetBuild) + { + printf("Base locale-%s.MPQ has build higher than target build (%u > %u), nothing extracted!\n", Locales[i], tempBuild, CONF_TargetBuild); + continue; + } - if (FirstLocale < 0) - { - FirstLocale = i; - build = tempBuild; - } + ExtractDBCFiles(i, FirstLocale < 0); - //Close MPQs - SFileCloseArchive(LocaleMpq); + if (FirstLocale < 0) + { + FirstLocale = i; + build = tempBuild; } + + //Close MPQs + SFileCloseArchive(LocaleMpq); } if (FirstLocale < 0) @@ -1190,7 +1188,7 @@ int main(int argc, char * arg[]) // Open MPQs LoadLocaleMPQFile(FirstLocale); - LoadCommonMPQFiles(); + LoadCommonMPQFiles(build); // Extract maps ExtractMapsFromMpq(build); diff --git a/src/tools/map_extractor/dbcfile.h b/src/tools/map_extractor/dbcfile.h index ce7d8e85ed3..adb4a34f473 100644 --- a/src/tools/map_extractor/dbcfile.h +++ b/src/tools/map_extractor/dbcfile.h @@ -26,8 +26,8 @@ class DBCFile class NotFound: public Exception { - public: - NotFound(): Exception("Key was not found") { } + public: + NotFound(): Exception("Key was not found") { } }; // Iteration over database -- cgit v1.2.3 From 26f1abdbcafde2425346eb54983cb83eff9b7925 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 21 Feb 2012 21:12:28 +0100 Subject: And a compile fix --- src/tools/map_extractor/System.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp index 842fdb16722..8db9599ef2e 100644 --- a/src/tools/map_extractor/System.cpp +++ b/src/tools/map_extractor/System.cpp @@ -1148,7 +1148,7 @@ int main(int argc, char * arg[]) if (build > CONF_TargetBuild) { printf("Base locale-%s.MPQ has build higher than target build (%u > %u), nothing extracted!\n", Locales[i], build, CONF_TargetBuild); - return; + return 0; } printf("Detected client build: %u\n", build); -- cgit v1.2.3 From 45201fd49f434dd2f9960bd25a1e30b97a3092a6 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 21 Feb 2012 21:29:19 +0100 Subject: Tools/Extractors: Map extractor will now also extract *.db2 files --- src/tools/map_extractor/System.cpp | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'src') diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp index 8db9599ef2e..94639e5ba06 100644 --- a/src/tools/map_extractor/System.cpp +++ b/src/tools/map_extractor/System.cpp @@ -1031,6 +1031,43 @@ void ExtractDBCFiles(int l, bool basicLocale) printf("Extracted %u DBC files\n\n", count); } +void ExtractDB2Files(int l, bool basicLocale) +{ + printf("Extracting db2 files...\n"); + + SFILE_FIND_DATA foundFile; + memset(&foundFile, 0, sizeof(foundFile)); + HANDLE listFile = SListFileFindFirstFile(LocaleMpq, NULL, "DBFilesClient\\*db2", &foundFile); + HANDLE dbcFile = NULL; + uint32 count = 0; + if (listFile) + { + std::string outputPath = "./dbc/"; + if (!basicLocale) + { + outputPath += Locales[l]; + outputPath += "/"; + } + + std::string filename; + + do + { + if (!SFileOpenFileEx(LocaleMpq, foundFile.cFileName, SFILE_OPEN_PATCHED_FILE, &dbcFile)) + continue; + + filename = foundFile.cFileName; + filename = outputPath + filename.substr(filename.rfind('\\')); + if (ExtractFile(dbcFile, filename.c_str())) + ++count; + + SFileCloseFile(dbcFile); + } while (SListFileFindNextFile(listFile, &foundFile)); + } + + printf("Extracted %u DB2 files\n\n", count); +} + bool LoadLocaleMPQFile(int locale) { TCHAR buff[512]; @@ -1165,6 +1202,7 @@ int main(int argc, char * arg[]) } ExtractDBCFiles(i, FirstLocale < 0); + ExtractDB2Files(i, FirstLocale < 0); if (FirstLocale < 0) { -- cgit v1.2.3 From f0ca875a216eaab3d213feae8ba75c07795c9304 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 21 Feb 2012 22:39:53 +0100 Subject: Tools/Extractors: Changed search method, it will no longer miss some dbc files --- dep/StormLib/searchFix.patch | 49 ++++++++++++++++++++++++++++++++++++++ dep/StormLib/src/SFileFindFile.cpp | 10 ++++---- src/tools/map_extractor/System.cpp | 24 +++++++++++++------ 3 files changed, 72 insertions(+), 11 deletions(-) create mode 100644 dep/StormLib/searchFix.patch (limited to 'src') diff --git a/dep/StormLib/searchFix.patch b/dep/StormLib/searchFix.patch new file mode 100644 index 00000000000..d4ba11d8645 --- /dev/null +++ b/dep/StormLib/searchFix.patch @@ -0,0 +1,49 @@ +diff --git a/dep/StormLib/src/SFileFindFile.cpp b/dep/StormLib/src/SFileFindFile.cpp +index aa065d2..542637b 100644 +--- a/dep/StormLib/src/SFileFindFile.cpp ++++ b/dep/StormLib/src/SFileFindFile.cpp +@@ -31,7 +31,7 @@ struct TMPQSearch + DWORD dwSearchTableItems; // Number of items in the search table + DWORD dwNextIndex; // Next file index to be checked + DWORD dwFlagMask; // For checking flag mask +- char szSearchMask[1]; // Search mask (variable length) ++ char * szSearchMask; // Search mask (variable length) + }; + + //----------------------------------------------------------------------------- +@@ -69,7 +69,7 @@ bool CheckWildCard(const char * szString, const char * szWildCard) + szString++; + } + +- // If there is '*', means zero or more chars. We have to ++ // If there is '*', means zero or more chars. We have to + // find the sequence after '*' + if(*szWildCard == '*') + { +@@ -337,6 +337,8 @@ static void FreeMPQSearch(TMPQSearch *& hs) + { + if(hs->pSearchTable != NULL) + STORM_FREE(hs->pSearchTable); ++ if(hs->szSearchMask != NULL) ++ free(hs->szSearchMask); // allocated with strdup + STORM_FREE(hs); + hs = NULL; + } +@@ -376,7 +378,7 @@ HANDLE WINAPI SFileFindFirstFile(HANDLE hMpq, const char * szMask, SFILE_FIND_DA + if(nError == ERROR_SUCCESS) + { + memset(hs, 0, sizeof(TMPQSearch)); +- strcpy(hs->szSearchMask, szMask); ++ hs->szSearchMask = strdup(szMask); + hs->dwFlagMask = MPQ_FILE_EXISTS; + hs->ha = ha; + +@@ -406,7 +408,7 @@ HANDLE WINAPI SFileFindFirstFile(HANDLE hMpq, const char * szMask, SFILE_FIND_DA + FreeMPQSearch(hs); + SetLastError(nError); + } +- ++ + // Return the result value + return (HANDLE)hs; + } diff --git a/dep/StormLib/src/SFileFindFile.cpp b/dep/StormLib/src/SFileFindFile.cpp index aa065d23a84..542637b3668 100644 --- a/dep/StormLib/src/SFileFindFile.cpp +++ b/dep/StormLib/src/SFileFindFile.cpp @@ -31,7 +31,7 @@ struct TMPQSearch DWORD dwSearchTableItems; // Number of items in the search table DWORD dwNextIndex; // Next file index to be checked DWORD dwFlagMask; // For checking flag mask - char szSearchMask[1]; // Search mask (variable length) + char * szSearchMask; // Search mask (variable length) }; //----------------------------------------------------------------------------- @@ -69,7 +69,7 @@ bool CheckWildCard(const char * szString, const char * szWildCard) szString++; } - // If there is '*', means zero or more chars. We have to + // If there is '*', means zero or more chars. We have to // find the sequence after '*' if(*szWildCard == '*') { @@ -337,6 +337,8 @@ static void FreeMPQSearch(TMPQSearch *& hs) { if(hs->pSearchTable != NULL) STORM_FREE(hs->pSearchTable); + if(hs->szSearchMask != NULL) + free(hs->szSearchMask); // allocated with strdup STORM_FREE(hs); hs = NULL; } @@ -376,7 +378,7 @@ HANDLE WINAPI SFileFindFirstFile(HANDLE hMpq, const char * szMask, SFILE_FIND_DA if(nError == ERROR_SUCCESS) { memset(hs, 0, sizeof(TMPQSearch)); - strcpy(hs->szSearchMask, szMask); + hs->szSearchMask = strdup(szMask); hs->dwFlagMask = MPQ_FILE_EXISTS; hs->ha = ha; @@ -406,7 +408,7 @@ HANDLE WINAPI SFileFindFirstFile(HANDLE hMpq, const char * szMask, SFILE_FIND_DA FreeMPQSearch(hs); SetLastError(nError); } - + // Return the result value return (HANDLE)hs; } diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp index 94639e5ba06..fb64adb3c61 100644 --- a/src/tools/map_extractor/System.cpp +++ b/src/tools/map_extractor/System.cpp @@ -998,7 +998,7 @@ void ExtractDBCFiles(int l, bool basicLocale) SFILE_FIND_DATA foundFile; memset(&foundFile, 0, sizeof(foundFile)); - HANDLE listFile = SListFileFindFirstFile(LocaleMpq, NULL, "DBFilesClient\\*dbc", &foundFile); + HANDLE listFile = SFileFindFirstFile(LocaleMpq, "DBFilesClient\\*dbc", &foundFile, NULL); HANDLE dbcFile = NULL; uint32 count = 0; if (listFile) @@ -1017,7 +1017,10 @@ void ExtractDBCFiles(int l, bool basicLocale) do { if (!SFileOpenFileEx(LocaleMpq, foundFile.cFileName, SFILE_OPEN_PATCHED_FILE, &dbcFile)) + { + printf("Unable to open file %s in the archive\n", foundFile.cFileName); continue; + } filename = foundFile.cFileName; filename = outputPath + filename.substr(filename.rfind('\\')); @@ -1025,7 +1028,9 @@ void ExtractDBCFiles(int l, bool basicLocale) ++count; SFileCloseFile(dbcFile); - } while (SListFileFindNextFile(listFile, &foundFile)); + } while (SFileFindNextFile(listFile, &foundFile)); + + SFileFindClose(listFile); } printf("Extracted %u DBC files\n\n", count); @@ -1037,7 +1042,7 @@ void ExtractDB2Files(int l, bool basicLocale) SFILE_FIND_DATA foundFile; memset(&foundFile, 0, sizeof(foundFile)); - HANDLE listFile = SListFileFindFirstFile(LocaleMpq, NULL, "DBFilesClient\\*db2", &foundFile); + HANDLE listFile = SFileFindFirstFile(LocaleMpq, "DBFilesClient\\*db2", &foundFile, NULL); HANDLE dbcFile = NULL; uint32 count = 0; if (listFile) @@ -1054,7 +1059,10 @@ void ExtractDB2Files(int l, bool basicLocale) do { if (!SFileOpenFileEx(LocaleMpq, foundFile.cFileName, SFILE_OPEN_PATCHED_FILE, &dbcFile)) + { + printf("Unable to open file %s in the archive\n", foundFile.cFileName); continue; + } filename = foundFile.cFileName; filename = outputPath + filename.substr(filename.rfind('\\')); @@ -1062,7 +1070,9 @@ void ExtractDB2Files(int l, bool basicLocale) ++count; SFileCloseFile(dbcFile); - } while (SListFileFindNextFile(listFile, &foundFile)); + } while (SFileFindNextFile(listFile, &foundFile)); + + SFileFindClose(listFile); } printf("Extracted %u DB2 files\n\n", count); @@ -1072,7 +1082,7 @@ bool LoadLocaleMPQFile(int locale) { TCHAR buff[512]; memset(buff, 0, sizeof(buff)); - _stprintf(buff, _T("./Data/%s/locale-%s.MPQ"), LocalesT[locale], LocalesT[locale]); + _stprintf(buff, _T("%s/Data/%s/locale-%s.MPQ"), input_path, LocalesT[locale], LocalesT[locale]); if (!SFileOpenArchive(buff, 0, MPQ_OPEN_READ_ONLY, &LocaleMpq)) { if (GetLastError() != ERROR_PATH_NOT_FOUND) @@ -1087,12 +1097,12 @@ bool LoadLocaleMPQFile(int locale) if (Builds[i] > LAST_DBC_IN_DATA_BUILD) { prefix = ""; - _stprintf(buff, _T("./Data/%s/wow-update-%s-%u.MPQ"), LocalesT[locale], LocalesT[locale], Builds[i]); + _stprintf(buff, _T("%s/Data/%s/wow-update-%s-%u.MPQ"), input_path, LocalesT[locale], LocalesT[locale], Builds[i]); } else { prefix = Locales[locale]; - _stprintf(buff, _T("./Data/wow-update-%u.MPQ"), Builds[i]); + _stprintf(buff, _T("%s/Data/wow-update-%u.MPQ"), input_path, Builds[i]); } if (!SFileOpenPatchArchive(LocaleMpq, buff, prefix, 0)) -- cgit v1.2.3 From 030f80d66f5bf988e5bc9c1422518f813fec3ca8 Mon Sep 17 00:00:00 2001 From: Spp Date: Thu, 23 Feb 2012 14:07:58 +0100 Subject: Missing changes to previous commit... (Grr didn't wanted to commit before compiling) --- src/server/game/AuctionHouse/AuctionHouseMgr.cpp | 12 ++++++------ src/server/game/Globals/ObjectMgr.cpp | 10 +++++----- src/server/game/Server/WorldSocket.cpp | 9 ++++----- src/server/game/Spells/Auras/SpellAuras.cpp | 2 +- src/server/game/Spells/Spell.cpp | 9 +++------ 5 files changed, 19 insertions(+), 23 deletions(-) (limited to 'src') diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp index 4f95413c49a..5b42ebe45b7 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp @@ -666,16 +666,16 @@ bool AuctionEntry::BuildAuctionInfo(WorldPacket& data) const data << uint32(item->GetEnchantmentCharges(EnchantmentSlot(i))); } - data << int32(pItem->GetItemRandomPropertyId()); // random item property id - data << uint32(pItem->GetItemSuffixFactor()); // SuffixFactor - data << uint32(pItem->GetCount()); // item->count - data << uint32(pItem->GetSpellCharges()); // item->charge FFFFFFF + data << int32(item->GetItemRandomPropertyId()); // Random item property id + data << uint32(item->GetItemSuffixFactor()); // SuffixFactor + data << uint32(item->GetCount()); // item->count + data << uint32(item->GetSpellCharges()); // item->charge FFFFFFF data << uint32(0); // Unknown data << uint64(owner); // Auction->owner data << uint64(startbid); // Auction->startbid (not sure if useful) data << uint64(bid ? GetAuctionOutBid() : 0); - //minimal outbid - data << uint64(buyout); // auction->buyout + // Minimal outbid + data << uint64(buyout); // Auction->buyout data << uint32((expire_time - time(NULL)) * IN_MILLISECONDS); // time left data << uint64(bidder); // auction->bidder current data << uint64(bid); // current bid diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index d055707f68c..b30b36dbdc1 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -2207,7 +2207,7 @@ void ObjectMgr::LoadItemTemplates() if (!sparse || !db2Data) continue; - ItemTemplate& itemTemplate = ItemTemplateStore[itemId]; + ItemTemplate& itemTemplate = _itemTemplateStore[itemId]; itemTemplate.ItemId = itemId; itemTemplate.Class = db2Data->Class; @@ -2352,10 +2352,10 @@ void ObjectMgr::LoadItemTemplates() { Field* fields = result->Fetch(); uint32 itemId = fields[0].GetUInt32(); - if (ItemTemplateStore.find(itemId) != ItemTemplateStore.end()) + if (_itemTemplateStore.find(itemId) != _itemTemplateStore.end()) --sparseCount; - ItemTemplate& itemTemplate = ItemTemplateStore[itemId]; + ItemTemplate& itemTemplate = _itemTemplateStore[itemId]; itemTemplate.ItemId = itemId; itemTemplate.Class = fields[1].GetUInt32(); @@ -2517,7 +2517,7 @@ void ObjectMgr::LoadItemTemplateAddon() std::swap(minMoneyLoot, maxMoneyLoot); } - ItemTemplate& itemTemplate = ItemTemplateStore[itemId]; + ItemTemplate& itemTemplate = _itemTemplateStore[itemId]; itemTemplate.BuyCount = buyCount; itemTemplate.FoodType = foodType; itemTemplate.MinMoneyLoot = minMoneyLoot; @@ -2549,7 +2549,7 @@ void ObjectMgr::LoadItemScriptNames() continue; } - ItemTemplateStore[itemId].ScriptId = GetScriptId(fields[1].GetCString()); + _itemTemplateStore[itemId].ScriptId = GetScriptId(fields[1].GetCString()); ++count; } while (result->NextRow()); } diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index 22689e40c2b..761d64b200c 100755 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -801,15 +801,14 @@ int WorldSocket::HandleSendAuthSession() int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) { uint8 digest[20]; + uint32 clientSeed; uint16 clientBuild, security; uint32 id; uint32 m_addonSize; - uint32 clientSeed; - std::string account; LocaleConstant locale; - - SHA1Hash sha1; - BigNumber v, s, g, N, K; + std::string account; + SHA1Hash sha; + BigNumber v, s, g, N, k; WorldPacket packet; recvPacket.read_skip(); diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 6015a944bdb..add50042aa5 100755 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -153,7 +153,7 @@ void AuraApplication::_InitFlags(Unit* caster, uint8 effMask) { if (((1 << i) & effMask) && GetBase()->GetSpellInfo()->Effects[i].ApplyAuraName == SPELL_AURA_MOUNTED) { - m_flags |= AFLAG_ANY_EFFECT_AMOUNT_SENT; + _flags |= AFLAG_ANY_EFFECT_AMOUNT_SENT; break; } } diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 88654dcc4b1..8d98e4c2777 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -1026,7 +1026,7 @@ void Spell::SelectImplicitConeTargets(SpellEffIndex effIndex, SpellImplicitTarge { Unit::AuraEffectList const& Auras = m_caster->GetAuraEffectsByType(SPELL_AURA_MOD_MAX_AFFECTED_TARGETS); for (Unit::AuraEffectList::const_iterator j = Auras.begin(); j != Auras.end(); ++j) - if ((*j)->IsAffectedOnSpell(m_spellInfo)) + if ((*j)->IsAffectingSpell(m_spellInfo)) maxTargets += (*j)->GetAmount(); Trinity::RandomResizeList(targets, maxTargets); @@ -1319,7 +1319,7 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge { Unit::AuraEffectList const& Auras = m_caster->GetAuraEffectsByType(SPELL_AURA_MOD_MAX_AFFECTED_TARGETS); for (Unit::AuraEffectList::const_iterator j = Auras.begin(); j != Auras.end(); ++j) - if ((*j)->IsAffectedOnSpell(m_spellInfo)) + if ((*j)->IsAffectingSpell(m_spellInfo)) maxTargets += (*j)->GetAmount(); if (m_spellInfo->Id == 5246) //Intimidating Shout @@ -1339,7 +1339,7 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge { Unit::AuraEffectList const& Auras = m_caster->GetAuraEffectsByType(SPELL_AURA_MOD_MAX_AFFECTED_TARGETS); for (Unit::AuraEffectList::const_iterator j = Auras.begin(); j != Auras.end(); ++j) - if ((*j)->IsAffectedOnSpell(m_spellInfo)) + if ((*j)->IsAffectingSpell(m_spellInfo)) maxTargets += (*j)->GetAmount(); Trinity::RandomResizeList(gObjTargets, maxTargets); @@ -3771,9 +3771,6 @@ void Spell::SendCastResult(Player* caster, SpellInfo const* spellInfo, uint8 cas case SPELL_FAILED_NEED_EXOTIC_AMMO: data << uint32(spellInfo->EquippedItemSubClassMask); // seems correct... break; - case SPELL_FAILED_REAGENTS: - data << uint32(0); // Item id - break; case SPELL_FAILED_NEED_MORE_ITEMS: data << uint32(0); // Item id data << uint32(0); // Item count? -- cgit v1.2.3 From b95d148dbed15b2932cd618dbf2c74479fde30f0 Mon Sep 17 00:00:00 2001 From: Subv Date: Thu, 22 Mar 2012 19:34:23 -0500 Subject: Protocol/Opcodes: Added a few more opcodes --- src/server/game/Entities/Player/Player.h | 2 +- src/server/game/Server/Protocol/Opcodes.cpp | 12 ++++++------ src/server/game/Server/Protocol/Opcodes.h | 10 +++++----- 3 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index c79cec42315..b3315ceec9f 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -486,7 +486,7 @@ enum MirrorTimerType { FATIGUE_TIMER = 0, BREATH_TIMER = 1, - FIRE_TIMER = 2 + FIRE_TIMER = 2 // feign death }; #define MAX_TIMERS 3 #define DISABLED_MIRROR_TIMER -1 diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 707dd65e2ad..711bc5a4162 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -499,7 +499,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_BINDER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBinderActivateOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_PLAYERBINDERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_BANKER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBankerActivateOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_SHOW_BANK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SHOW_BANK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_BUY_BANK_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyBankSlotOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_BUY_BANK_SLOT_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_PETITION_SHOWLIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionShowListOpcode ); @@ -532,9 +532,9 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_RESISTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ENCHANTMENTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SET_SKILL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_START_MIRROR_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PAUSE_MIRROR_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_STOP_MIRROR_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_START_MIRROR_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PAUSE_MIRROR_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_STOP_MIRROR_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_PING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); DEFINE_OPCODE_HANDLER(SMSG_PONG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1185,7 +1185,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_NOTES_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_UPDATE_MISSILE_TRAJECTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ACCOUNT_DATA_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_TRIGGER_MOVIE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TRIGGER_MOVIE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_COMPLETE_MOVIE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_GLYPH_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_GLYPH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -1220,7 +1220,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_THREAT_REMOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_THREAT_CLEAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CONVERT_RUNE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RESYNC_RUNES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_RESYNC_RUNES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ADD_RUNE_POWER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_START_QUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_REMOVE_GLYPH, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRemoveGlyph ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 6f5e9f588f6..b86f0fddb5f 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -894,7 +894,7 @@ enum Opcodes SMSG_PARTY_MEMBER_STATS = 0xDC5A, SMSG_PARTY_MEMBER_STATS_FULL = 0x0EDF, SMSG_PARTYKILLLOG = 0xCCC2, - SMSG_PAUSE_MIRROR_TIMER = 0x00, + SMSG_PAUSE_MIRROR_TIMER = 0xD8EE, SMSG_PERIODICAURALOG = 0x00, SMSG_PET_ACTION_FEEDBACK = 0x4E5A, SMSG_PET_ACTION_SOUND = 0x0CC7, @@ -977,7 +977,7 @@ enum Opcodes SMSG_RESISTLOG = 0x00, SMSG_RESPOND_INSPECT_ACHIEVEMENTS = 0x00, SMSG_RESURRECT_REQUEST = 0x0AFE, - SMSG_RESYNC_RUNES = 0x00, + SMSG_RESYNC_RUNES = 0x9E76, SMSG_RWHOIS = 0xCCE2, SMSG_SELL_ITEM = 0x9CD3, SMSG_SEND_MAIL_RESULT = 0x8CC2, @@ -1019,9 +1019,9 @@ enum Opcodes SMSG_SPIRIT_HEALER_CONFIRM = 0x0A4A, SMSG_STABLE_RESULT = 0x0A5B, SMSG_STANDSTATE_UPDATE = 0x4E52, - SMSG_START_MIRROR_TIMER = 0x00, + SMSG_START_MIRROR_TIMER = 0xDA66, SMSG_STOP_DANCE = 0x8E5F, - SMSG_STOP_MIRROR_TIMER = 0x00, + SMSG_STOP_MIRROR_TIMER = 0x1E52, SMSG_SUMMON_CANCEL = 0x8A4E, SMSG_SUMMON_REQUEST = 0x9A52, SMSG_SUPERCEDED_SPELL = 0xDE53, @@ -1046,7 +1046,7 @@ enum Opcodes SMSG_TRANSFER_ABORTED = 0x0CF7, SMSG_TRANSFER_PENDING = 0xCA6E, SMSG_TRIGGER_CINEMATIC = 0xCE5B, - SMSG_TRIGGER_MOVIE = 0x00, + SMSG_TRIGGER_MOVIE = 0x1A7B, SMSG_TURN_IN_PETITION_RESULTS = 0x08DB, SMSG_TUTORIAL_FLAGS = 0x1A46, SMSG_UNIT_SPELLCAST_START = 0x8C63, -- cgit v1.2.3 From 6e75c15850a4ae6efc50bb594c4766d927465cff Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 23 Mar 2012 22:45:44 +0100 Subject: Core/Achievements: Updated structure of SMSG_ALL_ACHIEVEMENT_DATA --- src/server/game/Achievements/AchievementMgr.cpp | 49 ++++++++++++++++++------- src/server/game/Server/Protocol/Opcodes.cpp | 3 +- src/server/game/Server/Protocol/Opcodes.h | 4 +- 3 files changed, 41 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index d07a19c486a..aa6c39f351d 100755 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -1957,6 +1957,9 @@ void AchievementMgr::SendAllAchievementData() const { WorldPacket data(SMSG_ALL_ACHIEVEMENT_DATA, m_completedAchievements.size()*8+4+m_criteriaProgress.size()*38+4); BuildAllDataPacket(&data); + if (data.size() > 0x1000) + data.Compress(SMSG_COMPRESSED_ACHIEVEMENT_DATA); + GetPlayer()->GetSession()->SendPacket(&data); } @@ -1973,6 +1976,17 @@ void AchievementMgr::SendRespondInspectAchievements(Player* player) const */ void AchievementMgr::BuildAllDataPacket(WorldPacket* data) const { + size_t numCriterias = m_criteriaProgress.size(); + uint32 achievementCount = 0; + ByteBuffer bitBuffer(numCriterias * 2 / 8 + 1); // 2 bits per criteria/8 bits per byte + ByteBuffer counterBuffer(numCriterias * 8); // uint64 values + ByteBuffer guidBuffer(numCriterias * 8); + ByteBuffer criteriaDateBuffer(numCriterias * 4); + ByteBuffer zeros(numCriterias * 4, true); // fill with zeros + ByteBuffer criteriaIdBuffer(numCriterias * 4); + ByteBuffer achievementDateBuffer(m_completedAchievements.size() * 4); + ByteBuffer achievementIdBuffer(m_completedAchievements.size() * 4); + AchievementEntry const* achievement = NULL; for (CompletedAchievementMap::const_iterator iter = m_completedAchievements.begin(); iter != m_completedAchievements.end(); ++iter) { @@ -1981,23 +1995,32 @@ void AchievementMgr::BuildAllDataPacket(WorldPacket* data) const if (achievement->flags & ACHIEVEMENT_FLAG_HIDDEN) continue; - *data << uint32(iter->first); - *data << uint32(secsToTimeBitFields(iter->second.date)); + achievementDateBuffer << uint32(secsToTimeBitFields(iter->second.date)); + achievementIdBuffer << uint32(achievement->ID); + ++achievementCount; } - *data << int32(-1); - for (CriteriaProgressMap::const_iterator iter = m_criteriaProgress.begin(); iter != m_criteriaProgress.end(); ++iter) + for (CriteriaProgressMap::const_iterator itr = m_criteriaProgress.begin(); itr != m_criteriaProgress.end(); ++itr) { - *data << uint32(iter->first); - data->appendPackGUID(iter->second.counter); - data->append(GetPlayer()->GetPackGUID()); - *data << uint32(0); - *data << uint32(secsToTimeBitFields(iter->second.date)); - *data << uint32(0); - *data << uint32(0); + bitBuffer.WriteBits(0, 2); + counterBuffer << uint64(itr->second.counter); + guidBuffer << uint64(GetPlayer()->GetGUID()); + criteriaDateBuffer << uint32(secsToTimeBitFields(itr->second.date)); + criteriaIdBuffer << uint32(itr->first); } - *data << int32(-1); + bitBuffer.FlushBits(); + *data << uint32(numCriterias); + data->append(bitBuffer); + data->append(counterBuffer); + *data << uint32(achievementCount); + data->append(achievementDateBuffer); + data->append(guidBuffer); + data->append(criteriaDateBuffer); + data->append(zeros); + data->append(achievementIdBuffer); + data->append(criteriaIdBuffer); + data->append(zeros); } bool AchievementMgr::HasAchieved(uint32 achievementId) const @@ -2040,7 +2063,7 @@ bool AchievementMgr::CanUpdateCriteria(AchievementCriteriaEntry const* criteria, break; } } - + // additional conditions for (int8 i = 0; i < MAX_ADDITIONAL_CRITERIA_CONDITIONS; ++i) { diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 711bc5a4162..ca886d2b3d6 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -1210,7 +1210,8 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_PET_LEARN_TALENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetLearnTalent ); //DEFINE_OPCODE_HANDLER(CMSG_PET_UNLEARN_TALENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_SET_PHASE_SHIFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ALL_ACHIEVEMENT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ALL_ACHIEVEMENT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_ACHIEVEMENT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_FORCE_SAY_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_HEALTH_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_POWER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index b86f0fddb5f..34bd89cc388 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -543,7 +543,7 @@ enum Opcodes SMSG_ADD_RUNE_POWER = 0x00, SMSG_ADDON_INFO = 0x9863, SMSG_AI_REACTION = 0xCEC2, - SMSG_ALL_ACHIEVEMENT_DATA = 0x00, + SMSG_ALL_ACHIEVEMENT_DATA = 0xE6EC, SMSG_AREA_SPIRIT_HEALER_TIME = 0x00, SMSG_AREA_TRIGGER_MESSAGE = 0xCC42, SMSG_ARENA_ERROR = 0x08C7, @@ -633,6 +633,7 @@ enum Opcodes SMSG_COMMENTATOR_PLAYER_INFO = 0x9A6E, SMSG_COMMENTATOR_STATE_CHANGED = 0x4EEE, SMSG_COMPLAIN_RESULT = 0x8A4B, + SMSG_COMPRESSED_ACHIEVEMENT_DATA = 0x5C3B, SMSG_COMPRESSED_CHAR_ENUM = 0x380A, SMSG_COMPRESSED_GUILD_ROSTER = 0x5A29, SMSG_COMPRESSED_MOVES = 0x0862, @@ -713,6 +714,7 @@ enum Opcodes SMSG_GROUP_LIST = 0x5C7E, SMSG_GROUP_SET_LEADER = 0xCCF2, SMSG_GROUP_UNINVITE = 0x00, + SMSG_GUILD_ACHIEVEMENT_DATA = 0xA67E, SMSG_GUILD_BANK_LIST = 0x5EFB, SMSG_GUILD_CANCEL = 0x08C3, SMSG_GUILD_COMMAND_RESULT = 0xDAD7, -- cgit v1.2.3 From f231d73fe41e15b8c504e0fb17f5f41bbdb7dd13 Mon Sep 17 00:00:00 2001 From: Subv Date: Fri, 23 Mar 2012 17:28:17 -0500 Subject: Protocol/Opcodes: Added 1 more opcodes --- src/server/game/Server/Protocol/Opcodes.cpp | 4 ++-- src/server/game/Server/Protocol/Opcodes.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index ca886d2b3d6..e4b6c1f0a9f 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -492,7 +492,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_ACTIVATETAXIREPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_NEW_TAXI_PATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_TRAINER_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerListOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TRAINER_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_TRAINER_BUY_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerBuySpellOpcode ); DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_SUCCEEDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1104,7 +1104,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_DECLINE_CHANNEL_INVITE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleChannelDeclineInvite ); //DEFINE_OPCODE_HANDLER(SMSG_GROUPACTION_THROTTLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_OVERRIDE_LIGHT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_TOTEM_CREATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TOTEM_CREATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_TOTEM_DESTROYED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTotemDestroyed ); //DEFINE_OPCODE_HANDLER(CMSG_EXPIRE_RAID_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_NO_SPELL_VARIANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 34bd89cc388..cbf06d38c5d 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -1039,7 +1039,7 @@ enum Opcodes SMSG_TIME_SYNC_REQ = 0xE46E, SMSG_TITLE_EARNED = 0x1AFA, SMSG_TOGGLE_XP_GAIN = 0x8A5B, - SMSG_TOTEM_CREATED = 0x00, + SMSG_TOTEM_CREATED = 0xCEF6, SMSG_TRADE_STATUS = 0xA0DC, SMSG_TRADE_STATUS_EXTENDED = 0xF0EC, SMSG_TRAINER_BUY_RESULT = 0x00, -- cgit v1.2.3 From cd65b3986086d1b5f93cabd6144d75ec9e1048d5 Mon Sep 17 00:00:00 2001 From: Subv Date: Fri, 23 Mar 2012 18:24:22 -0500 Subject: Protocol/Opcodes: More opcodes --- src/server/game/Server/Protocol/Opcodes.cpp | 5 +++-- src/server/game/Server/Protocol/Opcodes.h | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index e4b6c1f0a9f..37b4b694318 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -431,7 +431,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_MOUNTSPECIAL_ANIM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMountSpecialAnimOpcode ); DEFINE_OPCODE_HANDLER(SMSG_MOUNTSPECIAL_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_TAME_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_PET_SET_ACTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetSetAction ); + DEFINE_OPCODE_HANDLER(CMSG_PET_SET_ACTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetSetAction ); DEFINE_OPCODE_HANDLER(CMSG_PET_ACTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetAction ); //DEFINE_OPCODE_HANDLER(CMSG_PET_ABANDON, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetAbandon ); //DEFINE_OPCODE_HANDLER(CMSG_PET_RENAME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetRename ); @@ -805,7 +805,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_WARDEN_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleWardenDataOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_GROUP_JOINED_BATTLEGROUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(MSG_BATTLEGROUND_PLAYER_POSITIONS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlegroundPlayerPositionsOpcode); - //DEFINE_OPCODE_HANDLER(CMSG_PET_STOP_ATTACK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetStopAttack ); + DEFINE_OPCODE_HANDLER(CMSG_PET_STOP_ATTACK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetStopAttack ); DEFINE_OPCODE_HANDLER(SMSG_BINDER_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_PLAYER_JOINED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_PLAYER_LEFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1383,6 +1383,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_REQUEST_HOTFIX, STATUS_AUTHED, PROCESS_INPLACE, &WorldSession::HandleRequestHotfix ); DEFINE_OPCODE_HANDLER(SMSG_HOTFIX_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_REQUEST_SCORE_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); Need to send the response + DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_SETQUEUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); #undef DEFINE_OPCODE_HANDLER }; diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index cbf06d38c5d..fc2620f01f5 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -327,9 +327,9 @@ enum Opcodes CMSG_PET_LEARN_TALENT = 0x48E6, CMSG_PET_NAME_QUERY = 0xDA76, CMSG_PET_RENAME = 0x00, - CMSG_PET_SET_ACTION = 0x00, + CMSG_PET_SET_ACTION = 0x18CF, CMSG_PET_SPELL_AUTOCAST = 0x00, - CMSG_PET_STOP_ATTACK = 0x00, + CMSG_PET_STOP_ATTACK = 0x9E46, CMSG_PETITION_BUY = 0x8E4E, CMSG_PETITION_QUERY = 0xCEF3, CMSG_PETITION_SHOW_SIGNATURES = 0x1E66, @@ -806,7 +806,7 @@ enum Opcodes SMSG_MEETINGSTONE_COMPLETE = 0xDA43, SMSG_MEETINGSTONE_IN_PROGRESS = 0xCACE, SMSG_MEETINGSTONE_MEMBER_ADDED = 0x1AFF, - SMSG_MEETINGSTONE_SETQUEUE = 0x00, + SMSG_MEETINGSTONE_SETQUEUE = 0x0A73, SMSG_MESSAGECHAT = 0x5E52, SMSG_MIRRORIMAGE_DATA = 0x8AFB, SMSG_MODIFY_COOLDOWN = 0xD8DF, -- cgit v1.2.3 From ac2629f5e7db877311995ed7ffe77b5f1e6defba Mon Sep 17 00:00:00 2001 From: Subv Date: Sat, 24 Mar 2012 18:52:57 -0500 Subject: Protocol/Opcodes: More opcodes Fixed structure of SMSG_INSPECT_TALENT --- src/server/game/Handlers/MiscHandler.cpp | 9 ++++++++- src/server/game/Server/Protocol/Opcodes.cpp | 16 ++++++++-------- src/server/game/Server/Protocol/Opcodes.h | 6 +++--- 3 files changed, 19 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 1cd4df5de2c..3daf1a09bb7 100755 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -1221,7 +1221,7 @@ void WorldSession::HandleInspectOpcode(WorldPacket& recv_data) uint32 talent_points = 41; uint32 guid_size = player->GetPackGUID().wpos(); WorldPacket data(SMSG_INSPECT_TALENT, guid_size+4+talent_points); - data.append(player->GetPackGUID()); + data << player->GetGUID(); if (sWorld->getBoolConfig(CONFIG_TALENTS_INSPECTING) || _player->isGameMaster()) { @@ -1235,6 +1235,13 @@ void WorldSession::HandleInspectOpcode(WorldPacket& recv_data) } player->BuildEnchantmentsInfoData(&data); + if (Guild* guild = sGuildMgr->GetGuildById(player->GetGuildId())) + { + data << uint64(MAKE_NEW_GUID(guild->GetId(), 0, HIGHGUID_GUILD)); + data << uint32(0 /*guild->GetLevel()*/); // guild level + data << uint64(player->GetGUID()); // not sure + data << uint32(0/*guild->GetMembersCount()*/); // number of members + } SendPacket(&data); } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 37b4b694318..f1b0e9747f9 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -158,12 +158,12 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_GROUP_DECLINE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_UNINVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupUninviteOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_UNINVITE_GUID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupUninviteGuidOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_GROUP_UNINVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GROUP_UNINVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_SET_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupSetLeaderOpcode ); DEFINE_OPCODE_HANDLER(SMSG_GROUP_SET_LEADER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_LOOT_METHOD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMethodOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_DISBAND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupDisbandOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_GROUP_DESTROYED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GROUP_DESTROYED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GROUP_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PARTY_MEMBER_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PARTY_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -175,7 +175,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_GUILD_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDeclineOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_DECLINE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildInfoOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_ROSTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildRosterOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_ROSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_PROMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildPromoteOpcode ); @@ -186,7 +186,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_GUILD_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildLeaderOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_MOTD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildMOTDOpcode ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(UMSG_UPDATE_GUILD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_BATTLEGROUND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_GUILD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); @@ -393,7 +393,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_PORT_DENIED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_PERFORM_ACTION_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_RESUME_CAST_BAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CANCEL_COMBAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CANCEL_COMBAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELLBREAKLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPELLHEALLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPELLENERGIZELOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -557,7 +557,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(MSG_GM_SHOWLABEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_PET_CAST_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetCastSpellOpcode ); DEFINE_OPCODE_HANDLER(MSG_SAVE_GUILD_EMBLEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSaveGuildEmblemOpcode ); - //DEFINE_OPCODE_HANDLER(MSG_TABARDVENDOR_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTabardVendorActivateOpcode); + DEFINE_OPCODE_HANDLER(MSG_TABARDVENDOR_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTabardVendorActivateOpcode); //DEFINE_OPCODE_HANDLER(SMSG_PLAY_SPELL_VISUAL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_ZONEUPDATE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleZoneUpdateOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_PARTYKILLLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -980,7 +980,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_SEND_COMBAT_TRIGGER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_MAELSTROM_GM_SENT_MAIL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_RESET_FAILED_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_REAL_GROUP_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_REAL_GROUP_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LFG_DISABLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_ACTIVE_PVP_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -1073,7 +1073,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_USERLIST_REMOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_USERLIST_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_CHANNEL_WATCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_INSPECT_TALENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_INSPECT_TALENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GOGOGO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ECHO_PARTY_SQUELCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_SET_TITLE_SUFFIX, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index fc2620f01f5..1fbdb7b35c3 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -607,7 +607,7 @@ enum Opcodes SMSG_CALENDAR_SEND_NUM_PENDING = 0x00, SMSG_CAMERA_SHAKE = 0x5CFB, SMSG_CANCEL_AUTO_REPEAT = 0x5ACB, - SMSG_CANCEL_COMBAT = 0x00, + SMSG_CANCEL_COMBAT = 0x4AC7, SMSG_CAST_FAILED = 0x1AEB, SMSG_CHANNEL_LIST = 0x9C47, SMSG_CHANNEL_MEMBER_COUNT = 0x5EEA, @@ -708,12 +708,12 @@ enum Opcodes SMSG_GOSSIP_POI = 0x1866, SMSG_GROUP_CANCEL = 0x0ED6, SMSG_GROUP_DECLINE = 0x0863, - SMSG_GROUP_DESTROYED = 0x00, + SMSG_GROUP_DESTROYED = 0x8ACF, SMSG_GROUP_INVITE = 0x00, SMSG_GROUP_JOINED_BATTLEGROUND = 0x0000, SMSG_GROUP_LIST = 0x5C7E, SMSG_GROUP_SET_LEADER = 0xCCF2, - SMSG_GROUP_UNINVITE = 0x00, + SMSG_GROUP_UNINVITE = 0x9CEA, SMSG_GUILD_ACHIEVEMENT_DATA = 0xA67E, SMSG_GUILD_BANK_LIST = 0x5EFB, SMSG_GUILD_CANCEL = 0x08C3, -- cgit v1.2.3 From bff41739bcdf6a1d5f4dfc349e08e0ab851c3a25 Mon Sep 17 00:00:00 2001 From: Subv Date: Sat, 24 Mar 2012 19:05:12 -0500 Subject: Protocol/Opcodes: Adjusted a bit the size of SMSG_INSPECT_TALENT --- src/server/game/Handlers/MiscHandler.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 3daf1a09bb7..e04704785e0 100755 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -1219,14 +1219,11 @@ void WorldSession::HandleInspectOpcode(WorldPacket& recv_data) return; uint32 talent_points = 41; - uint32 guid_size = player->GetPackGUID().wpos(); - WorldPacket data(SMSG_INSPECT_TALENT, guid_size+4+talent_points); + WorldPacket data(SMSG_INSPECT_TALENT, 8 + 4 + 1 + 1 + talent_points + 8 + 4 + 8 + 4); data << player->GetGUID(); if (sWorld->getBoolConfig(CONFIG_TALENTS_INSPECTING) || _player->isGameMaster()) - { player->BuildPlayerTalentsInfoData(&data); - } else { data << uint32(0); // unspentTalentPoints -- cgit v1.2.3 From bdf6cf5146b884591e3a033a31ca5b729fdff0ff Mon Sep 17 00:00:00 2001 From: Subv Date: Sat, 24 Mar 2012 19:16:07 -0500 Subject: Protocol/Opcodes: More opcodes --- src/server/game/Server/Protocol/Opcodes.cpp | 8 ++++---- src/server/game/Server/Protocol/Opcodes.h | 7 ++++--- src/server/game/Tickets/TicketMgr.cpp | 4 ---- 3 files changed, 8 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index f1b0e9747f9..8e53d6230c4 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -577,7 +577,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_REMOVED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_DECHARGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_CREATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketCreateOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_CREATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_CREATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_UPDATETEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketUpdateOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_UPDATETEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ACCOUNT_DATA_TIMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -595,7 +595,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_DESPAWN_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(MSG_CORPSE_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCorpseQueryOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_DELETETICKET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketDeleteOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_DELETETICKET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_DELETETICKET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHAT_WRONG_FACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_SYSTEMSTATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketSystemStatusOpcode); DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_SYSTEMSTATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1325,8 +1325,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(MSG_SET_RAID_DIFFICULTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetRaidDifficultyOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_TOGGLE_XP_GAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_TOGGLE_XP_GAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GMRESPONSE_DB_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GMRESPONSE_RECEIVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GMRESPONSE_DB_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GMRESPONSE_RECEIVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_GMRESPONSE_RESOLVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMResponseResolve ); //DEFINE_OPCODE_HANDLER(SMSG_GMRESPONSE_STATUS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GMRESPONSE_CREATE_TICKET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 1fbdb7b35c3..65fa2a5a950 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -695,10 +695,10 @@ enum Opcodes SMSG_GAMETIME_SET = 0x9C4A, SMSG_GAMETIME_UPDATE = 0x18E3, SMSG_GM_MESSAGECHAT = 0x8E5E, - SMSG_GMRESPONSE_RECEIVED = 0x00, + SMSG_GMRESPONSE_RECEIVED = 0xCCEA, SMSG_GMRESPONSE_STATUS_UPDATE = 0x00, - SMSG_GMTICKET_CREATE = 0x00, - SMSG_GMTICKET_DELETETICKET = 0x00, + SMSG_GMTICKET_CREATE = 0xC84A, + SMSG_GMTICKET_DELETETICKET = 0x1A6E, SMSG_GMTICKET_GETTICKET = 0x00, SMSG_GMTICKET_SYSTEMSTATUS = 0x9C7E, SMSG_GMTICKET_UPDATETEXT = 0x00, @@ -1077,6 +1077,7 @@ enum Opcodes SMSG_WHOIS = 0x9CFF, SMSG_WORLD_STATE_UI_TIMER_UPDATE = 0xDE5E, SMSG_ZONE_UNDER_ATTACK = 0x08CF, + SMSG_GMRESPONSE_DB_ERROR = 0x5843, }; /// Player state diff --git a/src/server/game/Tickets/TicketMgr.cpp b/src/server/game/Tickets/TicketMgr.cpp index 96f4438544f..fe8a8c64607 100755 --- a/src/server/game/Tickets/TicketMgr.cpp +++ b/src/server/game/Tickets/TicketMgr.cpp @@ -129,10 +129,6 @@ void GmTicket::SendResponse(WorldSession* session) const data << uint32(0); // can-edit - always 1 or 0, not flags data << _message.c_str(); data << _response.c_str(); - // 3 null strings - data << uint8(0); - data << uint8(0); - data << uint8(0); session->SendPacket(&data); } -- cgit v1.2.3 From ac81411db461184a9d20cb43b44eca414df5e81e Mon Sep 17 00:00:00 2001 From: kaelima Date: Fri, 30 Mar 2012 02:43:17 +0200 Subject: Core/Protocol: - 5 new opcodes - Some spell research and fixed MSG_CHANNEL_START - Fixed SMSG_UPDATE_INSTANCE_ENCOUNTER_UNIT for 4.2.2, and removed SMSG_GAMEOBJECT_SPAWN_ANIM_OBSOLETE (which does not exist) --- src/server/game/Instances/InstanceScript.cpp | 21 ++++++++++++--------- src/server/game/Instances/InstanceScript.h | 13 +++++++++++-- src/server/game/Server/Protocol/Opcodes.cpp | 14 +++++++------- src/server/game/Server/Protocol/Opcodes.h | 14 +++++++------- src/server/game/Spells/Spell.cpp | 22 ++++++++++++++++++++-- src/server/game/Spells/Spell.h | 2 +- 6 files changed, 58 insertions(+), 28 deletions(-) (limited to 'src') diff --git a/src/server/game/Instances/InstanceScript.cpp b/src/server/game/Instances/InstanceScript.cpp index d0a96e3b62e..2a0f62d8de2 100755 --- a/src/server/game/Instances/InstanceScript.cpp +++ b/src/server/game/Instances/InstanceScript.cpp @@ -397,22 +397,25 @@ void InstanceScript::SendEncounterUnit(uint32 type, Unit* unit /*= NULL*/, uint8 switch (type) { - case ENCOUNTER_FRAME_ADD: - case ENCOUNTER_FRAME_REMOVE: - case 2: + case ENCOUNTER_FRAME_ENGAGE: + case ENCOUNTER_FRAME_DISENGAGE: + case ENCOUNTER_FRAME_UPDATE_PRIORITY: + if (!unit) + return; data.append(unit->GetPackGUID()); data << uint8(param1); break; - case 3: - case 4: - case 6: + case ENCOUNTER_FRAME_ADD_TIMER: + case ENCOUNTER_FRAME_ENABLE_OBJECTIVE: + case ENCOUNTER_FRAME_DISABLE_OBJECTIVE: + case ENCOUNTER_FRAME_COMBAT_RES_LIMIT: data << uint8(param1); - data << uint8(param2); break; - case 5: + case ENCOUNTER_FRAME_UPDATE_OBJECTIVE: data << uint8(param1); + data << uint8(param2); break; - case 7: + case ENCOUNTER_FRAME_UNK7: default: break; } diff --git a/src/server/game/Instances/InstanceScript.h b/src/server/game/Instances/InstanceScript.h index 69f11c203c1..469948d8e2d 100755 --- a/src/server/game/Instances/InstanceScript.h +++ b/src/server/game/Instances/InstanceScript.h @@ -42,8 +42,17 @@ typedef std::set MinionSet; enum EncounterFrameType { - ENCOUNTER_FRAME_ADD = 0, - ENCOUNTER_FRAME_REMOVE = 1, + ENCOUNTER_FRAME_SET_COMBAT_RES_LIMIT = 0, + ENCOUNTER_FRAME_RESET_COMBAT_RES_LIMIT = 1, + ENCOUNTER_FRAME_ENGAGE = 2, + ENCOUNTER_FRAME_DISENGAGE = 3, + ENCOUNTER_FRAME_UPDATE_PRIORITY = 4, + ENCOUNTER_FRAME_ADD_TIMER = 5, + ENCOUNTER_FRAME_ENABLE_OBJECTIVE = 6, + ENCOUNTER_FRAME_UPDATE_OBJECTIVE = 7, + ENCOUNTER_FRAME_DISABLE_OBJECTIVE = 8, + ENCOUNTER_FRAME_UNK7 = 9, // Seems to have something to do with sorting the encounter units + ENCOUNTER_FRAME_ADD_COMBAT_RES_LIMIT = 10, }; enum EncounterState diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 8e53d6230c4..541fd054e89 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -91,7 +91,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_DEBUG_AISTATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_DISABLE_PVP_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_ADVANCE_SPAWN_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_DESTRUCTIBLE_BUILDING_DAMAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(SMSG_DESTRUCTIBLE_BUILDING_DAMAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_AUTH_SRP6_BEGIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_AUTH_SRP6_PROOF, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_AUTH_SRP6_RECODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -235,7 +235,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_READ_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReadItem ); DEFINE_OPCODE_HANDLER(SMSG_READ_ITEM_OK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_READ_ITEM_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ITEM_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ITEM_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJ_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGameObjectUseOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_DESTROY_ITEMS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_CUSTOM_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -372,7 +372,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_CANCEL_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelAuraOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_EQUIPMENT_SET_SAVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_CAST_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(MSG_CHANNEL_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(MSG_CHANNEL_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_CHANNEL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_CANCEL_CHANNELLING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelChanneling ); DEFINE_OPCODE_HANDLER(SMSG_AI_REACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -384,8 +384,8 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_ATTACKSTOP, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleAttackStopOpcode ); DEFINE_OPCODE_HANDLER(SMSG_ATTACKSTART, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ATTACKSTOP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ATTACKSWING_NOTINRANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ATTACKSWING_BADFACING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ATTACKSWING_NOTINRANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ATTACKSWING_BADFACING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_LOCK_WARNING_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ATTACKSWING_DEADTARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ATTACKSWING_CANT_ATTACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -591,7 +591,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_GETTICKET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketGetTicketOpcode ); //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_GETTICKET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_TALENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_SPAWN_ANIM_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_UPDATE_INSTANCE_ENCOUNTER_UNIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_DESPAWN_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(MSG_CORPSE_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCorpseQueryOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_DELETETICKET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketDeleteOpcode ); @@ -1020,7 +1020,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_ENTER_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_EXIT_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_INSTANCE_COMMAND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_TARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CLEAR_TARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_BOT_DETECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(SMSG_CROSSED_INEBRIATION_THRESHOLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_PLAYER_LOGIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 65fa2a5a950..0f6dcb48677 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -558,10 +558,10 @@ enum Opcodes SMSG_ATTACKERSTATEUPDATE = 0x0E6A, SMSG_ATTACKSTART = 0xCA4A, SMSG_ATTACKSTOP = 0xCED7, - SMSG_ATTACKSWING_BADFACING = 0x00, - SMSG_ATTACKSWING_CANT_ATTACK = 0x00, - SMSG_ATTACKSWING_DEADTARGET = 0x00, - SMSG_ATTACKSWING_NOTINRANGE = 0x00, + SMSG_ATTACKSWING_BADFACING = 0x18E2, + SMSG_ATTACKSWING_CANT_ATTACK = 0x00, // 0x1CEA or 0x4CFE + SMSG_ATTACKSWING_DEADTARGET = 0x00, // 0x1CEA or 0x4CFE + SMSG_ATTACKSWING_NOTINRANGE = 0xCC62, SMSG_AUCTION_BIDDER_LIST_RESULT = 0x88E3, SMSG_AUCTION_BIDDER_NOTIFICATION = 0xC85B, SMSG_AUCTION_COMMAND_RESULT = 0xCCCE, @@ -625,7 +625,7 @@ enum Opcodes SMSG_CHAT_WRONG_FACTION = 0x0E66, SMSG_CHECK_FOR_BOTS = 0x00, SMSG_CLEAR_COOLDOWN = 0x986F, - SMSG_CLEAR_TARGET = 0x00, + SMSG_CLEAR_TARGET = 0xDA7A, SMSG_CLIENT_CONTROL_UPDATE = 0x08CB, SMSG_CLIENTCACHE_VERSION = 0x88F2, SMSG_COMBAT_LOG_MULTIPLE = 0x5C56, @@ -671,7 +671,7 @@ enum Opcodes SMSG_EMOTE = 0x0C67, SMSG_ENABLE_BARBER_SHOP = 0x9C7A, SMSG_ENCHANTMENTLOG = 0x48E2, - SMSG_ENVIRONMENTALDAMAGELOG = 0x00, + SMSG_ENVIRONMENTALDAMAGELOG = 0x5A6B, SMSG_EQUIPMENT_SET_LIST = 0x18DF, SMSG_EQUIPMENT_SET_SAVED = 0x00, SMSG_EQUIPMENT_SET_USE_RESULT = 0x00, @@ -1057,7 +1057,7 @@ enum Opcodes SMSG_UPDATE_COMBO_POINTS = 0x9AF6, SMSG_UPDATE_CURRENCY = 0x00, SMSG_UPDATE_CURRENCY_WEEK_LIMIT = 0x00, - SMSG_UPDATE_INSTANCE_ENCOUNTER_UNIT = 0x00, + SMSG_UPDATE_INSTANCE_ENCOUNTER_UNIT = 0x8C4A, SMSG_UPDATE_INSTANCE_OWNERSHIP = 0xCA73, SMSG_UPDATE_ITEM_ENCHANTMENTS = 0xCA43, SMSG_UPDATE_LAST_INSTANCE = 0x58FE, diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 8d98e4c2777..531a944bada 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3858,7 +3858,7 @@ void Spell::SendSpellStart() data << uint32(0); } - if (castFlags & CAST_FLAG_UNKNOWN_31) + if (castFlags & CAST_FLAG_HEAL_PREDICTION) { data << uint32(0); data << uint8(0); // unkByte @@ -4175,7 +4175,25 @@ void Spell::SendChannelStart(uint32 duration) data.append(m_caster->GetPackGUID()); data << uint32(m_spellInfo->Id); data << uint32(duration); - + data << uint8(0); // immunity (castflag & 0x04000000) + /* + if (immunity) + { + data << uint32(); // CastSchoolImmunities + data << uint32(); // CastImmunities + } + */ + data << uint8(0); // healPrediction (castflag & 0x40000000) + /* + if (healPrediction) + { + data.appendPackGUID(channelTarget); // target packguid + data << uint32(); // spellid + data << uint8(0); // unk3 + if (unk3 == 2) + data.append(); // unk packed guid (unused ?) + } + */ m_caster->SendMessageToSet(&data, true); m_timer = duration; diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h index dd377d66feb..ca069046677 100755 --- a/src/server/game/Spells/Spell.h +++ b/src/server/game/Spells/Spell.h @@ -68,7 +68,7 @@ enum SpellCastFlags CAST_FLAG_UNKNOWN_28 = 0x08000000, CAST_FLAG_UNKNOWN_29 = 0x10000000, CAST_FLAG_UNKNOWN_30 = 0x20000000, - CAST_FLAG_UNKNOWN_31 = 0x40000000, + CAST_FLAG_HEAL_PREDICTION = 0x40000000, CAST_FLAG_UNKNOWN_32 = 0x80000000, }; -- cgit v1.2.3 From fc673fce920fca74652576276dee3df991c117bf Mon Sep 17 00:00:00 2001 From: kaelima Date: Fri, 30 Mar 2012 15:13:54 +0200 Subject: Core/Protocol: Missing changes from ac81411db461184a9d20cb43b44eca414df5e81e --- src/server/game/Instances/InstanceScript.cpp | 4 +++- .../IcecrownCitadel/boss_blood_prince_council.cpp | 18 +++++++++--------- .../IcecrownCitadel/boss_valithria_dreamwalker.cpp | 10 +++++----- 3 files changed, 17 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/server/game/Instances/InstanceScript.cpp b/src/server/game/Instances/InstanceScript.cpp index 2a0f62d8de2..90a669b8615 100755 --- a/src/server/game/Instances/InstanceScript.cpp +++ b/src/server/game/Instances/InstanceScript.cpp @@ -408,7 +408,7 @@ void InstanceScript::SendEncounterUnit(uint32 type, Unit* unit /*= NULL*/, uint8 case ENCOUNTER_FRAME_ADD_TIMER: case ENCOUNTER_FRAME_ENABLE_OBJECTIVE: case ENCOUNTER_FRAME_DISABLE_OBJECTIVE: - case ENCOUNTER_FRAME_COMBAT_RES_LIMIT: + case ENCOUNTER_FRAME_SET_COMBAT_RES_LIMIT: data << uint8(param1); break; case ENCOUNTER_FRAME_UPDATE_OBJECTIVE: @@ -416,6 +416,8 @@ void InstanceScript::SendEncounterUnit(uint32 type, Unit* unit /*= NULL*/, uint8 data << uint8(param2); break; case ENCOUNTER_FRAME_UNK7: + case ENCOUNTER_FRAME_ADD_COMBAT_RES_LIMIT: + case ENCOUNTER_FRAME_RESET_COMBAT_RES_LIMIT: default: break; } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp index 70b07c61e79..22717279c5a 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp @@ -210,19 +210,19 @@ class boss_blood_council_controller : public CreatureScript if (Creature* keleseth = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_PRINCE_KELESETH_GUID))) { - instance->SendEncounterUnit(ENCOUNTER_FRAME_ADD, keleseth); + instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, keleseth); DoZoneInCombat(keleseth); } if (Creature* taldaram = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_PRINCE_TALDARAM_GUID))) { - instance->SendEncounterUnit(ENCOUNTER_FRAME_ADD, taldaram); + instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, taldaram); DoZoneInCombat(taldaram); } if (Creature* valanar = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_PRINCE_VALANAR_GUID))) { - instance->SendEncounterUnit(ENCOUNTER_FRAME_ADD, valanar); + instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, valanar); DoZoneInCombat(valanar); } @@ -412,12 +412,12 @@ class boss_prince_keleseth_icc : public CreatureScript summons.DespawnAll(); Talk(SAY_KELESETH_DEATH); - instance->SendEncounterUnit(ENCOUNTER_FRAME_REMOVE, me); + instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); } void JustReachedHome() { - instance->SendEncounterUnit(ENCOUNTER_FRAME_REMOVE, me); + instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); me->SetHealth(_spawnHealth); _isEmpowered = false; if (Creature* controller = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_BLOOD_PRINCES_CONTROL))) @@ -636,12 +636,12 @@ class boss_prince_taldaram_icc : public CreatureScript summons.DespawnAll(); Talk(EMOTE_TALDARAM_DEATH); - instance->SendEncounterUnit(ENCOUNTER_FRAME_REMOVE, me); + instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); } void JustReachedHome() { - instance->SendEncounterUnit(ENCOUNTER_FRAME_REMOVE, me); + instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); me->SetHealth(_spawnHealth); _isEmpowered = false; if (Creature* controller = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_BLOOD_PRINCES_CONTROL))) @@ -859,12 +859,12 @@ class boss_prince_valanar_icc : public CreatureScript summons.DespawnAll(); Talk(SAY_VALANAR_DEATH); - instance->SendEncounterUnit(ENCOUNTER_FRAME_REMOVE, me); + instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); } void JustReachedHome() { - instance->SendEncounterUnit(ENCOUNTER_FRAME_REMOVE, me); + instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); me->SetHealth(me->GetMaxHealth()); _isEmpowered = false; if (Creature* controller = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_BLOOD_PRINCES_CONTROL))) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp index e0993178890..2298e9fe65f 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp @@ -232,7 +232,7 @@ class ValithriaDespawner : public BasicEvent { case NPC_VALITHRIA_DREAMWALKER: if (InstanceScript* instance = creature->GetInstanceScript()) - instance->SendEncounterUnit(ENCOUNTER_FRAME_REMOVE, creature); + instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, creature); break; case NPC_BLAZING_SKELETON: case NPC_SUPPRESSER: @@ -304,7 +304,7 @@ class boss_valithria_dreamwalker : public CreatureScript me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_HEAL_PCT, true); // Glyph of Dispel Magic - not a percent heal by effect, its cast with custom basepoints me->ApplySpellImmune(0, IMMUNITY_ID, 56131, true); - _instance->SendEncounterUnit(ENCOUNTER_FRAME_REMOVE, me); + _instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); _missedPortals = 0; _under25PercentTalkDone = false; _over75PercentTalkDone = false; @@ -322,7 +322,7 @@ class boss_valithria_dreamwalker : public CreatureScript return; DoCast(me, SPELL_COPY_DAMAGE); - _instance->SendEncounterUnit(ENCOUNTER_FRAME_ADD, me); + _instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me); _events.ScheduleEvent(EVENT_INTRO_TALK, 15000); _events.ScheduleEvent(EVENT_DREAM_PORTAL, urand(45000, 48000)); if (IsHeroic()) @@ -336,7 +336,7 @@ class boss_valithria_dreamwalker : public CreatureScript { _done = true; Talk(SAY_VALITHRIA_SUCCESS); - _instance->SendEncounterUnit(ENCOUNTER_FRAME_REMOVE, me); + _instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); me->RemoveAurasDueToSpell(SPELL_CORRUPTION_VALITHRIA); DoCast(me, SPELL_ACHIEVEMENT_CHECK); DoCastAOE(SPELL_DREAMWALKERS_RAGE); @@ -371,7 +371,7 @@ class boss_valithria_dreamwalker : public CreatureScript { _justDied = true; Talk(SAY_VALITHRIA_DEATH); - _instance->SendEncounterUnit(ENCOUNTER_FRAME_REMOVE, me); + _instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); if (Creature* trigger = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_VALITHRIA_TRIGGER))) trigger->AI()->DoAction(ACTION_DEATH); } -- cgit v1.2.3 From 56cd111c64cecaa9ac5df0a1e57cd3fdcd6a19b8 Mon Sep 17 00:00:00 2001 From: Subv Date: Tue, 3 Apr 2012 20:19:29 -0500 Subject: Core/Protocol: Fixed structure of CMSG_GUILD_ROSTER and added a new opcode --- src/server/game/Handlers/GuildHandler.cpp | 40 +++++++++++++++++++++++------ src/server/game/Server/Protocol/Opcodes.cpp | 1 + src/server/game/Server/Protocol/Opcodes.h | 2 +- src/server/game/Server/WorldSession.h | 1 + 4 files changed, 35 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/GuildHandler.cpp b/src/server/game/Handlers/GuildHandler.cpp index fd3f0c07fb4..f2a905def42 100755 --- a/src/server/game/Handlers/GuildHandler.cpp +++ b/src/server/game/Handlers/GuildHandler.cpp @@ -134,13 +134,13 @@ void WorldSession::HandleGuildRosterOpcode(WorldPacket& recvPacket) ByteBuffer bytes(8, true); recvPacket.ReadXorByte(mask[0], bytes[7]); - recvPacket.ReadXorByte(mask[5], bytes[4]); - recvPacket.ReadXorByte(mask[4], bytes[5]); - recvPacket.ReadXorByte(mask[7], bytes[0]); - recvPacket.ReadXorByte(mask[3], bytes[1]); - recvPacket.ReadXorByte(mask[2], bytes[2]); - recvPacket.ReadXorByte(mask[1], bytes[6]); - recvPacket.ReadXorByte(mask[6], bytes[3]); + recvPacket.ReadXorByte(mask[3], bytes[5]); + recvPacket.ReadXorByte(mask[4], bytes[4]); + recvPacket.ReadXorByte(mask[5], bytes[0]); + recvPacket.ReadXorByte(mask[6], bytes[1]); + recvPacket.ReadXorByte(mask[1], bytes[2]); + recvPacket.ReadXorByte(mask[2], bytes[6]); + recvPacket.ReadXorByte(mask[7], bytes[3]); uint64 guildGuid = BitConverter::ToUInt64(bytes); @@ -576,7 +576,7 @@ void WorldSession::HandleQueryGuildBankTabText(WorldPacket &recv_data) guild->SendBankTabText(this, tabId); } -void WorldSession::HandleSetGuildBankTabText(WorldPacket &recv_data) +void WorldSession::HandleSetGuildBankTabText(WorldPacket& recv_data) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_SET_GUILD_BANK_TEXT"); @@ -589,3 +589,27 @@ void WorldSession::HandleSetGuildBankTabText(WorldPacket &recv_data) if (Guild* guild = _GetPlayerGuild(this)) guild->SetBankTabText(tabId, text); } + +void WorldSession::HandleGuildQueryXPOpcode(WorldPacket& recv_data) +{ + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUERY_GUILD_XP"); + /* + Bitstream is correct, it just needs a proper guild implementation + uint64 playerGuid = 0; + + BitStream mask = recv_data.ReadBitStream(8); + + ByteBuffer bytes(8, true); + + recv_data.ReadXorByte(mask[5], bytes[6]); + recv_data.ReadXorByte(mask[1], bytes[2]); + recv_data.ReadXorByte(mask[7], bytes[1]); + recv_data.ReadXorByte(mask[4], bytes[4]); + recv_data.ReadXorByte(mask[0], bytes[0]); + recv_data.ReadXorByte(mask[6], bytes[3]); + recv_data.ReadXorByte(mask[3], bytes[5]); + recv_data.ReadXorByte(mask[2], bytes[7]); + + playerGuid = BitConverter::ToUInt64(bytes); + */ +} \ No newline at end of file diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 541fd054e89..98af62e85b5 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -127,6 +127,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_PET_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetNameQuery ); DEFINE_OPCODE_HANDLER(SMSG_PET_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_QUERY, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildQueryOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_XP, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildQueryXPOpcode ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_DB_REPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(CMSG_PAGE_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePageTextQueryOpcode ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 0f6dcb48677..4a628c3c50a 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -345,7 +345,7 @@ enum Opcodes CMSG_PUSHQUESTTOPARTY = 0xA47, CMSG_QUERY_GUILD_MAX_XP = 0x00, CMSG_QUERY_GUILD_REWARDS = 0x00, - CMSG_QUERY_GUILD_XP = 0x00, + CMSG_QUERY_GUILD_XP = 0x0952, CMSG_QUERY_QUESTS_COMPLETED = 0x98DF, CMSG_QUERY_TIME = 0x18FE, CMSG_QUEST_CONFIRM_ACCEPT = 0x8CD3, diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 21cc3991b9f..dcfab847504 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -873,6 +873,7 @@ class WorldSession void HandleGuildBankBuyTab(WorldPacket& recv_data); void HandleQueryGuildBankTabText(WorldPacket& recv_data); void HandleSetGuildBankTabText(WorldPacket& recv_data); + void HandleGuildQueryXPOpcode(WorldPacket& recv_data); // Refer-a-Friend void HandleGrantLevel(WorldPacket& recv_data); -- cgit v1.2.3 From 34442e83b08affa9862c7106355e2f6adc5de4fa Mon Sep 17 00:00:00 2001 From: kaelima Date: Wed, 4 Apr 2012 04:27:18 +0200 Subject: Core/Protocol: 4 opcodez --- src/server/game/Server/Protocol/Opcodes.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 4a628c3c50a..f1b54acf57f 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -897,7 +897,7 @@ enum Opcodes SMSG_PARTY_MEMBER_STATS_FULL = 0x0EDF, SMSG_PARTYKILLLOG = 0xCCC2, SMSG_PAUSE_MIRROR_TIMER = 0xD8EE, - SMSG_PERIODICAURALOG = 0x00, + SMSG_PERIODICAURALOG = 0x8CF2, SMSG_PET_ACTION_FEEDBACK = 0x4E5A, SMSG_PET_ACTION_SOUND = 0x0CC7, SMSG_PET_CAST_FAILED = 0x00, @@ -1007,9 +1007,9 @@ enum Opcodes SMSG_SPELL_GO = 0x0A53, SMSG_SPELL_START = 0xCE43, SMSG_SPELL_UPDATE_CHAIN_TARGETS = 0x98EE, - SMSG_SPELLBREAKLOG = 0x00, + SMSG_SPELLBREAKLOG = 0x9E5F, SMSG_SPELLDAMAGESHIELD = 0x8AFE, - SMSG_SPELLDISPELLOG = 0x00, + SMSG_SPELLDISPELLOG = 0x08EA, SMSG_SPELLENERGIZELOG = 0xD8FB, SMSG_SPELLHEALLOG = 0xDE4A, SMSG_SPELLINSTAKILLLOG = 0x8ED2, @@ -1017,7 +1017,7 @@ enum Opcodes SMSG_SPELLLOGMISS = 0x1CFF, SMSG_SPELLNONMELEEDAMAGELOG = 0x5CCF, SMSG_SPELLORDAMAGE_IMMUNE = 0x48FA, - SMSG_SPELLSTEALLOG = 0x00, + SMSG_SPELLSTEALLOG = 0x08E3, SMSG_SPIRIT_HEALER_CONFIRM = 0x0A4A, SMSG_STABLE_RESULT = 0x0A5B, SMSG_STANDSTATE_UPDATE = 0x4E52, -- cgit v1.2.3 From 3d14384c32971096b49f88ff785d92879480af76 Mon Sep 17 00:00:00 2001 From: kaelima Date: Wed, 30 May 2012 08:01:02 +0200 Subject: Merge git://github.com/TrinityCore/TrinityCore into 4.x Conflicts: dep/PackageList.txt sql/base/auth_database.sql src/server/authserver/Server/AuthSocket.cpp src/server/game/Battlegrounds/BattlegroundMgr.cpp src/server/game/Chat/Commands/Level1.cpp src/server/game/Chat/Commands/Level3.cpp src/server/game/DataStores/DBCEnums.h src/server/game/DataStores/DBCStores.cpp src/server/game/DataStores/DBCStores.h src/server/game/DataStores/DBCStructure.h src/server/game/DataStores/DBCfmt.h src/server/game/Entities/Corpse/Corpse.cpp src/server/game/Entities/Creature/Creature.cpp src/server/game/Entities/DynamicObject/DynamicObject.cpp src/server/game/Entities/GameObject/GameObject.cpp src/server/game/Entities/Item/Item.cpp src/server/game/Entities/Object/Object.cpp src/server/game/Entities/Object/Updates/UpdateData.h src/server/game/Entities/Pet/Pet.cpp src/server/game/Entities/Player/Player.cpp src/server/game/Entities/Player/Player.h src/server/game/Entities/Transport/Transport.cpp src/server/game/Entities/Unit/Unit.cpp src/server/game/Globals/ObjectMgr.cpp src/server/game/Globals/ObjectMgr.h src/server/game/Guilds/Guild.cpp src/server/game/Handlers/CharacterHandler.cpp src/server/game/Handlers/MiscHandler.cpp src/server/game/Handlers/MovementHandler.cpp src/server/game/Handlers/QuestHandler.cpp src/server/game/Loot/LootMgr.cpp src/server/game/Miscellaneous/SharedDefines.h src/server/game/Quests/QuestDef.cpp src/server/game/Server/Protocol/Opcodes.cpp src/server/game/Server/Protocol/Opcodes.h src/server/game/Server/WorldSession.cpp src/server/game/Server/WorldSocket.cpp src/server/game/Spells/Auras/SpellAuraEffects.cpp src/server/game/Spells/Spell.cpp src/server/game/Spells/Spell.h src/server/game/Spells/SpellEffects.cpp src/server/game/Tickets/TicketMgr.cpp src/server/scripts/Commands/cs_gps.cpp src/server/scripts/Commands/cs_modify.cpp src/server/shared/Database/Implementation/CharacterDatabase.cpp src/server/shared/Logging/Log.h src/tools/map_extractor/CMakeLists.txt src/tools/map_extractor/System.cpp src/tools/map_extractor/mpq_libmpq04.h src/tools/vmap4_extractor/CMakeLists.txt --- PreLoad.cmake | 2 +- cmake/compiler/gcc/settings.cmake | 12 +- cmake/compiler/icc/settings.cmake | 11 +- cmake/compiler/msvc/settings.cmake | 7 +- cmake/genrev.cmake | 2 +- cmake/macros/CheckBuildDir.cmake | 2 +- cmake/options.cmake | 3 +- cmake/platform/unix/settings.cmake | 4 +- cmake/showoptions.cmake | 13 +- contrib/conf_merge/tc-conf-merger.pl | 2 +- dep/CMakeLists.txt | 4 +- dep/PackageList.txt | 8 +- dep/SFMT/SFMT.h | 51 +- dep/SFMT/randomc.h | 2 +- dep/mersennetwister/MersenneTwister.h | 405 - doc/UnixInstall.txt | 2 +- revision.h.in.cmake | 2 +- sql/base/auth_database.sql | 89 +- sql/base/characters_database.sql | 8 +- sql/old/3.3.5a/2012_02_13_00_world_version.sql | 1 + ...12_02_14_00_world_achievement_criteria_data.sql | 7 + .../3.3.5a/2012_02_15_00_world_quest_template.sql | 1 + .../2012_02_15_01_world_areatrigger_tavern.sql | 13 + .../3.3.5a/2012_02_15_02_world_item_template.sql | 3 + .../3.3.5a/2012_02_15_03_world_quest_template.sql | 18 + .../3.3.5a/2012_02_15_04_world_quest_template.sql | 17 + ...12_02_15_06_world_creature_involvedrelation.sql | 3 + sql/old/3.3.5a/2012_02_15_07_00_world_creature.sql | 57 + .../2012_02_15_07_01_world_waypoint_data.sql | 147 + sql/old/3.3.5a/2012_02_15_07_02_world_misc.sql | 120 + sql/old/3.3.5a/2012_02_15_08_world_sai.sql | 9 + .../2012_02_15_09_world_spell_proc_event.sql | 6 + sql/old/3.3.5a/2012_02_16_00_world_conditions.sql | 12800 +++++++++++++++++++ sql/old/3.3.5a/2012_02_16_01_world_conditions.sql | 3 + sql/old/3.3.5a/2012_02_17_00_world_waypoints.sql | 77 + .../2012_02_18_00_world_spell_script_names.sql | 69 + sql/old/3.3.5a/2012_02_18_01_world_spell_dbc.sql | 3 + sql/old/3.3.5a/2012_02_18_02_world_gossip.sql | 52 + sql/old/3.3.5a/2012_02_18_03_world_gossip.sql | 1068 ++ .../2012_02_18_04_world_spell_script_names.sql | 6 + sql/old/3.3.5a/2012_02_18_05_world_creatures.sql | 3 + sql/old/3.3.5a/2012_02_18_06_world_gossip.sql | 166 + sql/old/3.3.5a/2012_02_18_07_world_gossip.sql | 44 + sql/old/3.3.5a/2012_02_18_08_world_gossip.sql | 5 + sql/old/3.3.5a/2012_02_19_00_auth_account.sql | 2 + .../2012_02_19_00_characters_warden_action.sql | 7 + .../3.3.5a/2012_02_19_00_world_quest_template.sql | 14 + .../3.3.5a/2012_02_19_01_world_quest_template.sql | 11 + sql/old/3.3.5a/2012_02_19_02_world_gameobject.sql | 4 + .../3.3.5a/2012_02_19_03_world_warden_checks.sql | 802 ++ .../3.3.5a/2012_02_19_04_world_misc_db_updates.sql | 21 + .../3.3.5a/2012_02_19_05_world_creature_text.sql | 7 + .../3.3.5a/2012_02_19_06_world_creature_text.sql | 20 + sql/old/3.3.5a/2012_02_20_00_world_sai.sql | 4 + sql/old/3.3.5a/2012_02_20_01_world_gossip.sql | 8 + sql/old/3.3.5a/2012_02_20_02_world_conditons.sql | 277 + .../2012_02_21_00_world_creature_loot_template.sql | 78 + sql/old/3.3.5a/2012_02_21_01_world_conditions.sql | 3592 ++++++ .../2012_02_21_02_world_creature_loot_template.sql | 11 + .../2012_02_21_03_world_creature_loot_template.sql | 26 + .../2012_02_21_04_world_creature_loot_template.sql | 16 + sql/old/3.3.5a/2012_02_21_05_world_gossip.sql | 39 + sql/old/3.3.5a/2012_02_21_06_world_Gossip.sql | 184 + sql/old/3.3.5a/2012_02_22_00_world_sai.sql | 39 + .../3.3.5a/2012_02_22_01_world_creature_text.sql | 34 + sql/old/3.3.5a/2012_02_22_02_world_misc.sql | 57 + sql/old/3.3.5a/2012_02_22_03_world_conditions.sql | 3 + .../2012_02_23_00_world_spell_script_names.sql | 7 + ...012_02_24_00_world_gameobject_loot_template.sql | 10 + sql/old/3.3.5a/2012_02_24_01_world_sai.sql | 44 + .../2012_02_25_00_world_spell_script_names.sql | 1 + sql/old/3.3.5a/2012_02_25_01_world_command.sql | 6 + sql/old/3.3.5a/2012_02_25_01_world_misc.sql | 11 + sql/old/3.3.5a/2012_02_25_02_world_sai.sql | 28 + sql/old/3.3.5a/2012_02_26_00_world_misc.sql | 13 + .../2012_02_26_01_world_spell_script_names.sql | 4 + .../2012_02_27_00_world_creature_template.sql | 8 + .../2012_02_28_00_world_wintergrasp_spawns.sql | 366 + .../3.3.5a/2012_02_29_00_world_conditions_misc.sql | 126 + sql/old/3.3.5a/2012_02_29_01_world_conditions.sql | 5 + sql/old/3.3.5a/2012_02_29_02_world_conditions.sql | 5 + .../3.3.5a/2012_02_29_03_world_creature_text.sql | 18 + .../3.3.5a/2012_02_29_04_world_creature_text.sql | 11 + .../3.3.5a/2012_02_29_05_world_creature_text.sql | 15 + sql/old/3.3.5a/2012_03_01_00_world_conditions.sql | 5 + .../3.3.5a/2012_03_01_01_world_creature_text.sql | 15 + .../2012_03_01_02_world_locales_creature_text.sql | 15 + sql/old/3.3.5a/2012_03_03_00_world_command.sql | 9 + sql/old/3.3.5a/2012_03_04_00_world_misc.sql | 13 + .../2012_03_04_01_world_areatrigger_scripts.sql | 7 + sql/old/3.3.5a/2012_03_06_00_world_commands.sql | 3 + sql/old/3.3.5a/2012_03_06_01_world_misc.sql | 4 + .../2012_03_06_02_world_queststatus_seasonal.sql | 1 + .../3.3.5a/2012_03_06_03_world_smart_scripts.sql | 17 + .../3.3.5a/2012_03_06_04_world_creature_text.sql | 6 + .../3.3.5a/2012_03_07_00_world_trinity_string.sql | 3 + sql/old/3.3.5a/2012_03_10_00_world_creature.sql | 21 + .../3.3.5a/2012_03_10_00_world_smart_scripts.sql | 129 + .../3.3.5a/2012_03_10_00_world_waypoint_data.sql | 25 + sql/old/3.3.5a/2012_03_11_00_world_sai.sql | 60 + .../2012_03_12_00_world_creature_template.sql | 1 + sql/old/3.3.5a/2012_03_12_01_world_conditions.sql | 3 + sql/old/3.3.5a/2012_03_12_01_world_gameobject.sql | 4 + .../2012_03_12_01_world_spell_script_names.sql | 3 + .../3.3.5a/2012_03_14_00_world_creature_addon.sql | 2 + .../3.3.5a/2012_03_19_00_world_smart_scripts.sql | 21 + sql/old/3.3.5a/2012_03_20_00_world_gossip.sql | 88 + sql/old/3.3.5a/2012_03_21_00_world_creature.sql | 71 + .../2012_03_22_00_world_creature_template.sql | 2 + sql/old/3.3.5a/2012_03_22_01_world_conditions.sql | 2 + sql/old/3.3.5a/2012_03_23_00_world_ip2nation.sql | 21 + sql/old/3.3.5a/2012_03_24_00_world_misc.sql | 22 + .../2012_03_24_01_world_creature_loot_template.sql | 290 + .../2012_03_24_02_world_creature_loot_template.sql | 136 + sql/old/3.3.5a/2012_03_25_00_auth_misc.sql | 8 + sql/old/3.3.5a/2012_03_25_00_world_game_event.sql | 4 + sql/old/3.3.5a/2012_03_26_00_auth_realmlist.sql | 2 + .../2012_03_26_00_world_creature_template.sql | 73 + .../2012_03_26_01_world_spell_script_names.sql | 4 + sql/old/3.3.5a/2012_03_27_00_world_misc.sql | 49 + sql/old/3.3.5a/2012_03_27_01_world_misc.sql | 15 + sql/old/3.3.5a/2012_03_27_02_world_misc.sql | 78 + sql/old/3.3.5a/2012_03_27_03_world_misc.sql | 59 + sql/old/3.3.5a/2012_03_27_04_world_misc.sql | 3 + sql/old/3.3.5a/2012_03_28_00_auth_account.sql | 13 + .../3.3.5a/2012_03_28_01_auth_account_access.sql | 3 + .../2012_03_28_01_world_spell_bonus_data.sql | 2 + .../3.3.5a/2012_03_28_02_auth_account_banned.sql | 4 + sql/old/3.3.5a/2012_03_28_03_auth_ip_banned.sql | 2 + sql/old/3.3.5a/2012_03_28_04_auth_logs.sql | 5 + .../3.3.5a/2012_03_28_05_auth_realmcharacters.sql | 4 + sql/old/3.3.5a/2012_03_28_06_auth_realmlist.sql | 6 + sql/old/3.3.5a/2012_03_28_07_auth_uptime.sql | 6 + .../3.3.5a/2012_03_30_00_world_smart_scripts.sql | 94 + .../2012_03_31_00_world_creature_loot_template.sql | 191 + sql/old/3.3.5a/2012_04_01_00_auth_realmlist.sql | 1 + sql/old/3.3.5a/2012_04_01_00_world_creature.sql | 17 + .../2012_04_01_00_world_spell_script_names.sql | 6 + sql/old/3.3.5a/2012_04_01_01_world_creature.sql | 26 + ...2012_04_01_02_world_spell_group_stack_rules.sql | 9 + sql/old/3.3.5a/2012_04_01_03_world_trainers.sql | 83 + sql/old/3.3.5a/2012_04_01_04_world_conditions.sql | 5 + .../2012_04_01_05_world_creature_template.sql | 2 + sql/old/3.3.5a/2012_04_01_06_world_sai.sql | 7 + sql/old/3.3.5a/2012_04_01_07_world_misc.sql | 4 + .../2012_04_03_00_world_spell_script_names.sql | 3 + sql/old/3.3.5a/2012_04_04_00_auth_realmlist.sql | 1 + sql/old/3.3.5a/2012_04_04_00_world_conditions.sql | 7 + sql/old/3.3.5a/2012_04_04_01_world_spell_dbc.sql | 1 + .../2012_04_05_00_world_gameobject_template.sql | 32 + .../2012_04_05_00_world_spell_script_names.sql | 6 + .../2012_04_05_01_world_spell_proc_event.sql | 2 + .../2012_04_06_00_world_spell_proc_event.sql | 1 + sql/old/3.3.5a/2012_04_06_01_world_spell_dbc.sql | 3 + .../2012_04_06_02_world_gameobject_template.sql | 4 + sql/old/3.3.5a/2012_04_06_03_world_spell_dbc.sql | 3 + sql/old/3.3.5a/2012_04_06_04_world_page_text.sql | 25 + .../2012_04_07_00_characters_lag_reports.sql | 2 + sql/old/3.3.5a/2012_04_07_00_world_gameobject.sql | 5 + sql/old/3.3.5a/2012_04_07_01_world_game_event.sql | 2 + .../2012_04_07_02_world_spell_proc_event.sql | 1 + .../2012_04_08_00_world_spell_script_names.sql | 3 + .../2012_04_08_01_world_creature_template.sql | 2 + sql/old/3.3.5a/2012_04_08_02_world_spell_dbc.sql | 3 + .../2012_04_08_02_world_spell_script_names.sql | 6 + .../2012_04_08_03_world_spell_script_names.sql | 3 + .../2012_04_12_00_world_creature_template.sql | 2 + .../2012_04_12_01_world_creature_template.sql | 6 + .../2012_04_12_02_world_spell_bonus_data.sql | 29 + .../2012_04_12_03_world_spell_bonus_data.sql | 8 + .../2012_04_12_04_world_creature_template.sql | 2 + sql/old/3.3.5a/2012_04_12_05_world_command.sql | 2 + sql/old/3.3.5a/2012_04_13_00_world_sai.sql | 25 + sql/old/3.3.5a/2012_04_13_01_world_misc.sql | 219 + sql/old/3.3.5a/2012_04_13_02_world_misc.sql | 18 + sql/old/3.3.5a/2012_04_13_03_world_bg_template.sql | 7 + .../2012_04_13_04_world_spell_proc_event.sql | 4 + ...012_04_14_00_world_gameobject_loot_template.sql | 3 + ...012_04_14_01_world_gameobject_loot_template.sql | 11 + ...2012_04_14_02_world_creature_template_addon.sql | 3 + .../2012_04_14_03_world_spell_bonus_data.sql | 1 + .../2012_04_14_04_world_spell_proc_event.sql | 3 + .../2012_04_14_05_world_spell_proc_event.sql | 1 + sql/old/3.3.5a/2012_04_16_00_world_game_event.sql | 4 + sql/old/3.3.5a/2012_04_17_00_world_creature.sql | 28 + .../2012_04_18_00_world_npc_spellclick_spells.sql | 2 + sql/old/3.3.5a/2012_04_18_01_world_creature.sql | 1 + ...2012_04_18_02_world_reference_loot_template.sql | 377 + .../2012_04_18_03_world_creature_loot_template.sql | 2 + ..._04_18_04_world_pickpocketing_loot_template.sql | 501 + sql/old/3.3.5a/2012_04_18_05_world_conditions.sql | 4 + .../2012_04_18_06_world_creature_template.sql | 2 + .../2012_04_18_07_world_fishing_loot_template.sql | 2 + .../2012_04_18_08_world_creature_loot_template.sql | 22 + .../2012_04_19_00_world_creature_template.sql | 7 + ..._04_19_01_world_pickpocketing_loot_template.sql | 202 + .../2012_04_19_02_world_creature_loot_template.sql | 2 + .../3.3.5a/2012_04_19_03_world_instance_ulduar.sql | 174 + ...012_04_20_00_world_gameobject_loot_template.sql | 15 + .../2012_04_20_01_world_item_loot_template.sql | 10 + .../2012_04_20_02_world_creature_loot_template.sql | 4 + .../2012_04_20_03_world_creature_loot_template.sql | 7 + .../2012_04_20_04_world_creature_loot_template.sql | 3 + .../3.3.5a/2012_04_20_05_gameobject_template.sql | 8 + .../2012_04_21_00_world_spell_script_names.sql | 14 + sql/old/3.3.5a/2012_04_22_00_world_sai.sql | 63 + sql/old/3.3.5a/2012_04_23_00_world_creatures.sql | 12 + sql/old/3.3.5a/2012_04_23_01_world_conditions.sql | 5 + ...12_04_23_02_world_prospecting_loot_template.sql | 112 + .../2012_04_23_03_world_skinning_loot_template.sql | 44 + .../2012_04_23_04_world_creature_loot_template.sql | 2 + .../2012_04_23_05_world_creature_loot_template.sql | 3 + sql/old/3.3.5a/2012_04_24_00_world_command.sql | 10 + .../2012_04_24_01_world_spell_proc_event.sql | 4 + .../3.3.5a/2012_04_24_02_world_warden_checks.sql | 8 + .../2012_04_24_03_world_spell_script_names.sql | 4 + .../2012_04_24_04_world_spell_proc_event.sql | 4 + .../2012_04_24_05_world_creature_loot_template.sql | 9 + sql/old/3.3.5a/2012_04_24_06_world_misc.sql | 31 + sql/old/3.3.5a/2012_04_25_00_world_misc.sql | 3 + .../2012_04_25_01_world_spell_script_names.sql | 3 + .../2012_04_25_02_world_spell_script_names.sql | 11 + sql/old/3.3.5a/2012_04_25_03_world_spell_group.sql | 11 + sql/old/3.3.5a/2012_04_26_00_world_conditions.sql | 1 + .../3.3.5a/2012_04_26_01_world_smart_scripts.sql | 1 + .../3.3.5a/2012_04_27_00_world_instance_icc.sql | 5 + ...2012_04_28_00_world_reference_loot_template.sql | 158 + ...2012_04_28_01_world_reference_loot_template.sql | 22 + sql/old/3.3.5a/2012_05_01_00_world_creature.sql | 9 + .../2012_05_02_00_world_creature_loot_template.sql | 8 + sql/old/3.3.5a/2012_05_03_00_world_creature.sql | 29 + sql/old/3.3.5a/2012_05_03_01_world_cos_misc.sql | 153 + .../3.3.5a/2012_05_03_02_world_quest_template.sql | 28 + .../2012_05_03_03_world_creature_questrelation.sql | 2 + ...12_05_03_04_world_game_event_creature_quest.sql | 57 + sql/old/3.3.5a/2012_05_04_00_world_waypoints.sql | 137 + sql/old/3.3.5a/2012_05_04_01_world_sai.sql | 32 + sql/old/3.3.5a/2012_05_05_00_world_sai.sql | 205 + .../2012_05_05_01_world_creature_template.sql | 2 + sql/old/3.3.5a/2012_05_05_02_world_gameobject.sql | 10 + sql/old/3.3.5a/2012_05_05_03_world_sai.sql | 17 + .../2012_05_05_04_world_creature_template.sql | 27 + .../2012_05_05_05_world_creature_template.sql | 2 + sql/old/3.3.5a/2012_05_05_06_world_sai.sql | 13 + .../2012_05_06_00_world_creature_template.sql | 5 + .../2012_05_06_01_world_creature_template.sql | 11 + sql/old/3.3.5a/2012_05_07_00_world_waypoints.sql | 73 + sql/old/3.3.5a/2012_05_07_01_world_sai.sql | 51 + sql/old/3.3.5a/2012_05_08_00_world_sai.sql | 89 + sql/old/3.3.5a/2012_05_08_01_world_gameobject.sql | 5 + sql/old/3.3.5a/2012_05_08_01_world_misc.sql | 9 + .../2012_05_09_00_world_spell_target_position.sql | 7 + sql/old/3.3.5a/2012_05_09_01_world_commands.sql | 8 + sql/old/3.3.5a/2012_05_09_02_world_sai.sql | 116 + sql/old/3.3.5a/2012_05_09_03_world_misc.sql | 56 + sql/old/3.3.5a/2012_05_10_00_world_sai.sql | 42 + sql/old/3.3.5a/2012_05_10_01_world_misc.sql | 37 + .../2012_05_10_02_world_creature_template.sql | 2 + sql/old/3.3.5a/2012_05_10_03_world_misc.sql | 129 + sql/old/3.3.5a/2012_05_10_04_world_ceature_sai.sql | 14 + sql/old/3.3.5a/2012_05_10_05_world_waypoints.sql | 88 + sql/old/3.3.5a/2012_05_10_06_world_waypoints.sql | 40 + sql/old/3.3.5a/2012_05_11_00_world_waypoints.sql | 31 + .../2012_05_11_01_world_gameobject_template.sql | 4 + sql/old/3.3.5a/2012_05_11_02_world_conditions.sql | 23 + .../2012_05_12_00_world_gameobject_template.sql | 2 + .../2012_05_12_01_world_item_loot_template.sql | 92 + ...012_05_12_02_world_gameobject_loot_template.sql | 37 + .../3.3.5a/2012_05_13_00_world_creature_text.sql | 13 + .../3.3.5a/2012_05_13_01_world_creature_text.sql | 14 + sql/old/3.3.5a/2012_05_16_00_world_scripts.sql | 2 + .../3.3.5a/2012_05_17_00_world_creature_text.sql | 7 + sql/old/3.3.5a/2012_05_18_00_world_conditions.sql | 3 + sql/old/3.3.5a/2012_05_18_01_world_misc.sql | 7 + .../2012_05_18_01_world_spell_target_position.sql | 9 + .../3.3.5a/2012_05_19_00_world_quest_template.sql | 2 + .../3.3.5a/2012_05_19_01_world_smart_scripts.sql | 7 + sql/old/3.3.5a/2012_05_19_02_world_misc.sql | 6 + sql/updates/auth/2012_02_19_00_auth_account.sql | 2 - .../2012_02_19_00_characters_warden_action.sql | 7 - sql/updates/world/2012_02_13_00_world_version.sql | 1 - ...12_02_14_00_world_achievement_criteria_data.sql | 7 - .../world/2012_02_15_00_world_quest_template.sql | 1 - .../2012_02_15_01_world_areatrigger_tavern.sql | 13 - .../world/2012_02_15_02_world_item_template.sql | 3 - .../world/2012_02_15_03_world_quest_template.sql | 18 - .../world/2012_02_15_04_world_quest_template.sql | 17 - ...12_02_15_06_world_creature_involvedrelation.sql | 3 - .../world/2012_02_15_07_00_world_creature.sql | 57 - .../world/2012_02_15_07_01_world_waypoint_data.sql | 147 - sql/updates/world/2012_02_15_07_02_world_misc.sql | 120 - sql/updates/world/2012_02_15_08_world_sai.sql | 9 - .../world/2012_02_15_09_world_spell_proc_event.sql | 6 - .../world/2012_02_16_00_world_conditions.sql | 12800 ------------------- .../world/2012_02_16_01_world_conditions.sql | 3 - .../world/2012_02_17_00_world_waypoints.sql | 77 - .../2012_02_18_00_world_spell_script_names.sql | 69 - .../world/2012_02_18_01_world_spell_dbc.sql | 3 - sql/updates/world/2012_02_18_02_world_gossip.sql | 52 - sql/updates/world/2012_02_18_03_world_gossip.sql | 1068 -- .../2012_02_18_04_world_spell_script_names.sql | 6 - .../world/2012_02_18_05_world_creatures.sql | 3 - sql/updates/world/2012_02_18_06_world_gossip.sql | 166 - sql/updates/world/2012_02_18_07_world_gossip.sql | 44 - sql/updates/world/2012_02_18_08_world_gossip.sql | 5 - .../world/2012_02_19_00_world_quest_template.sql | 14 - .../world/2012_02_19_01_world_quest_template.sql | 11 - .../world/2012_02_19_02_world_gameobject.sql | 4 - .../world/2012_02_19_03_world_warden_checks.sql | 802 -- .../world/2012_02_19_04_world_misc_db_updates.sql | 21 - sql/updates/world/2012_02_19_05_world_say_text.sql | 7 - sql/updates/world/2012_02_19_06_world_say_text.sql | 20 - sql/updates/world/2012_02_20_00_world_sai.sql | 4 - sql/updates/world/2012_02_20_01_world_misc_db.sql | 8 - .../world/2012_02_20_02_world_conditons.sql | 275 - .../2012_02_21_00_world_creature_loot_template.sql | 78 - .../world/2012_02_21_01_world_conditions.sql | 3592 ------ .../2012_02_21_02_world_creature_loot_template.sql | 11 - .../2012_02_21_03_world_creature_loot_template.sql | 26 - .../2012_02_21_04_world_creature_loot_template.sql | 16 - .../world/2012_02_21_05_world_Gossip_SAI.sql | 39 - sql/updates/world/2012_02_21_06_world_Gossip.sql | 184 - sql/updates/world/2012_02_22_00_world_SAI.sql | 39 - sql/updates/world/2012_02_22_01_world_say_text.sql | 34 - sql/updates/world/2012_02_22_02_world_misc.sql | 57 - .../world/2012_02_22_03_world_conditions.sql | 3 - sql/updates/world/2012_05_19_03_world_version.sql | 1 + .../world/2012_05_19_04_creature_loot_template.sql | 1 + .../2012_05_19_05_gameobject_loot_template.sql | 93 + .../2012_05_19_06_gameobject_loot_template.sql | 13 + sql/updates/world/2012_05_20_00_world_misc.sql | 16 + .../world/2012_05_20_01_world_spell_bonus_data.sql | 2 + .../world/2012_05_22_00_world_spell_proc_event.sql | 1 + .../2012_05_22_01_world_creature_loot_template.sql | 2 + sql/updates/world/2012_05_23_00_world_creature.sql | 55 + sql/updates/world/2012_05_23_01_world_sai.sql | 14 + sql/updates/world/2012_05_23_02_world_sai.sql | 21 + ...012_05_23_03_world_gameobject_loot_template.sql | 32 + .../world/2012_05_23_04_world_gameobject.sql | 3 + sql/updates/world/2012_05_23_05_world_creature.sql | 12 + .../world/2012_05_24_00_world_creature_misc.sql | 5 + .../world/2012_05_24_01_world_gameobject.sql | 3 + sql/updates/world/2012_05_25_00_world_sai.sql | 6 + .../world/2012_05_25_01_world_waypoints.sql | 149 + .../2012_05_25_02_world_creature_template.sql | 2 + sql/updates/world/2012_05_25_03_world_template.sql | 8 + sql/updates/world/2012_05_26_00_world_scripts.sql | 20 + .../world/2012_05_26_01_world_spell_dbc.sql | 4 + .../2012_05_26_02_world_creature_template.sql | 5 + .../world/2012_05_26_03_world_page_text.sql | 4 + .../2012_05_26_04_world_creature_template.sql | 4 + .../2012_05_26_05_world_creature_template.sql | 8 + .../world/2012_05_26_06_world_smart_scripts.sql | 143 + .../2012_05_27_00_world_gameobject_template.sql | 7 + .../world/2012_05_27_01_world_waypoints.sql | 7 + sql/updates/world/2012_05_27_02_world_creature.sql | 4 + sql/updates/world/2012_05_27_03_world_creature.sql | 2 + .../world/2012_05_27_04_world_smart_scripts.sql | 24 + .../world/2012_05_27_05_world_gameobject.sql | 13 + sql/updates/world/2012_05_27_06_world_creature.sql | 113 + .../world/2012_05_27_07_world_game_event.sql | 8 + .../world/2012_05_27_07_world_waypoints.sql | 8 + .../2012_05_28_00_world_creature_ai_scripts.sql | 9 + sql/updates/world/2012_05_28_01_world_creature.sql | 18 + sql/updates/world/2012_05_28_02_world_creature.sql | 26 + sql/updates/world/2012_05_28_03_waypoint_data.sql | 3 + .../2012_05_28_04_world_creature_template.sql | 3 + sql/updates/world/2012_05_28_05_world_creature.sql | 216 + .../world/2012_05_28_06_world_creature_addon.sql | 2 + .../world/2012_05_28_06_world_waypoint_data.sql | 524 + .../world/2012_05_28_07_world_quest_template.sql | 20 + src/server/authserver/Realms/RealmList.cpp | 24 +- src/server/authserver/Realms/RealmList.h | 17 +- src/server/authserver/Server/AuthSocket.cpp | 11 +- src/server/authserver/Server/AuthSocket.h | 13 - src/server/authserver/authserver.conf.dist | 8 + src/server/collision/Management/VMapManager2.cpp | 8 +- src/server/collision/Management/VMapManager2.h | 2 +- src/server/collision/Maps/MapTree.cpp | 4 +- src/server/collision/Maps/TileAssembler.cpp | 2 +- src/server/collision/Models/GameObjectModel.cpp | 24 +- src/server/collision/Models/WorldModel.cpp | 6 +- src/server/collision/Models/WorldModel.h | 1 - src/server/collision/VMapDefinitions.h | 6 +- src/server/game/AI/CoreAI/GameObjectAI.h | 23 +- src/server/game/AI/CoreAI/GuardAI.cpp | 87 +- src/server/game/AI/CoreAI/GuardAI.h | 23 +- src/server/game/AI/CoreAI/PetAI.cpp | 120 +- src/server/game/AI/CoreAI/PetAI.h | 2 + src/server/game/AI/CoreAI/TotemAI.cpp | 14 +- src/server/game/AI/CoreAI/TotemAI.h | 8 +- src/server/game/AI/CoreAI/UnitAI.h | 2 +- src/server/game/AI/CreatureAI.cpp | 1 + src/server/game/AI/CreatureAI.h | 8 +- src/server/game/AI/CreatureAIImpl.h | 5 + src/server/game/AI/CreatureAISelector.cpp | 7 +- src/server/game/AI/EventAI/CreatureEventAI.cpp | 16 +- src/server/game/AI/EventAI/CreatureEventAI.h | 2 +- src/server/game/AI/EventAI/CreatureEventAIMgr.cpp | 34 +- src/server/game/AI/ScriptedAI/ScriptedCreature.cpp | 41 +- src/server/game/AI/ScriptedAI/ScriptedCreature.h | 29 +- src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp | 22 +- .../game/AI/ScriptedAI/ScriptedFollowerAI.cpp | 8 +- src/server/game/AI/ScriptedAI/ScriptedSimpleAI.cpp | 280 - src/server/game/AI/ScriptedAI/ScriptedSimpleAI.h | 73 - src/server/game/AI/SmartScripts/SmartAI.cpp | 40 +- src/server/game/AI/SmartScripts/SmartAI.h | 11 +- src/server/game/AI/SmartScripts/SmartScript.cpp | 131 +- src/server/game/AI/SmartScripts/SmartScript.h | 7 +- src/server/game/AI/SmartScripts/SmartScriptMgr.cpp | 217 +- src/server/game/AI/SmartScripts/SmartScriptMgr.h | 42 +- src/server/game/Accounts/AccountMgr.cpp | 97 +- src/server/game/Accounts/AccountMgr.h | 38 +- src/server/game/Achievements/AchievementMgr.cpp | 23 +- src/server/game/AuctionHouse/AuctionHouseMgr.cpp | 6 +- src/server/game/Battlegrounds/ArenaTeam.cpp | 46 +- src/server/game/Battlegrounds/ArenaTeamMgr.cpp | 19 +- src/server/game/Battlegrounds/Battleground.cpp | 65 +- src/server/game/Battlegrounds/Battleground.h | 4 + src/server/game/Battlegrounds/BattlegroundMgr.cpp | 35 +- src/server/game/Battlegrounds/BattlegroundMgr.h | 1 + .../game/Battlegrounds/BattlegroundQueue.cpp | 2 +- .../game/Battlegrounds/Zones/BattlegroundAB.cpp | 4 +- .../game/Battlegrounds/Zones/BattlegroundAB.h | 12 +- .../game/Battlegrounds/Zones/BattlegroundAV.cpp | 39 +- .../game/Battlegrounds/Zones/BattlegroundAV.h | 47 +- .../game/Battlegrounds/Zones/BattlegroundDS.cpp | 55 +- .../game/Battlegrounds/Zones/BattlegroundDS.h | 42 +- .../game/Battlegrounds/Zones/BattlegroundEY.cpp | 3 +- .../game/Battlegrounds/Zones/BattlegroundEY.h | 5 +- .../game/Battlegrounds/Zones/BattlegroundIC.cpp | 9 +- .../game/Battlegrounds/Zones/BattlegroundRV.cpp | 46 +- .../game/Battlegrounds/Zones/BattlegroundRV.h | 15 +- .../game/Battlegrounds/Zones/BattlegroundSA.cpp | 26 +- .../game/Battlegrounds/Zones/BattlegroundSA.h | 209 +- .../game/Battlegrounds/Zones/BattlegroundWS.cpp | 28 +- src/server/game/CMakeLists.txt | 1 - src/server/game/Calendar/Calendar.cpp | 82 + src/server/game/Calendar/Calendar.h | 165 +- src/server/game/Calendar/CalendarMgr.cpp | 593 + src/server/game/Calendar/CalendarMgr.h | 80 + src/server/game/Chat/Channels/Channel.cpp | 3 +- src/server/game/Chat/Chat.cpp | 26 +- src/server/game/Chat/Chat.h | 5 +- src/server/game/Chat/Commands/Level0.cpp | 30 +- src/server/game/Chat/Commands/Level1.cpp | 27 +- src/server/game/Chat/Commands/Level2.cpp | 204 +- src/server/game/Chat/Commands/Level3.cpp | 297 +- src/server/game/Combat/ThreatManager.cpp | 4 +- src/server/game/Combat/ThreatManager.h | 2 +- src/server/game/Conditions/ConditionMgr.cpp | 91 +- src/server/game/Conditions/ConditionMgr.h | 29 +- src/server/game/DataStores/DBCEnums.h | 4 +- src/server/game/DataStores/DBCStores.cpp | 23 +- src/server/game/DataStores/DBCStores.h | 1 + src/server/game/DataStores/DBCStructure.h | 43 +- src/server/game/DataStores/DBCfmt.h | 2 +- src/server/game/DungeonFinding/LFGMgr.cpp | 7 +- src/server/game/DungeonFinding/LFGScripts.cpp | 78 +- src/server/game/DungeonFinding/LFGScripts.h | 24 +- src/server/game/Entities/Corpse/Corpse.cpp | 4 +- src/server/game/Entities/Corpse/Corpse.h | 1 - src/server/game/Entities/Creature/Creature.cpp | 323 +- src/server/game/Entities/Creature/Creature.h | 44 +- .../game/Entities/Creature/CreatureGroups.cpp | 27 +- src/server/game/Entities/Creature/CreatureGroups.h | 21 +- src/server/game/Entities/Creature/GossipDef.cpp | 3 - .../game/Entities/Creature/TemporarySummon.h | 1 - .../game/Entities/DynamicObject/DynamicObject.cpp | 8 +- src/server/game/Entities/GameObject/GameObject.cpp | 142 +- src/server/game/Entities/GameObject/GameObject.h | 12 +- src/server/game/Entities/Item/Container/Bag.cpp | 2 +- src/server/game/Entities/Item/Item.cpp | 76 +- src/server/game/Entities/Item/Item.h | 2 +- .../game/Entities/Item/ItemEnchantmentMgr.cpp | 9 +- src/server/game/Entities/Object/Object.cpp | 159 +- src/server/game/Entities/Object/Object.h | 55 +- .../game/Entities/Object/ObjectPosSelector.cpp | 10 +- .../game/Entities/Object/Updates/UpdateData.h | 30 +- src/server/game/Entities/Pet/Pet.cpp | 269 +- src/server/game/Entities/Player/Player.cpp | 1261 +- src/server/game/Entities/Player/Player.h | 46 +- src/server/game/Entities/Player/SocialMgr.cpp | 16 +- src/server/game/Entities/Player/SocialMgr.h | 4 +- src/server/game/Entities/Totem/Totem.h | 1 - src/server/game/Entities/Transport/Transport.cpp | 23 +- src/server/game/Entities/Unit/StatSystem.cpp | 14 +- src/server/game/Entities/Unit/Unit.cpp | 1588 ++- src/server/game/Entities/Unit/Unit.h | 210 +- src/server/game/Entities/Vehicle/Vehicle.cpp | 18 +- src/server/game/Events/GameEventMgr.cpp | 67 +- src/server/game/Globals/ObjectAccessor.cpp | 12 +- src/server/game/Globals/ObjectMgr.cpp | 558 +- src/server/game/Globals/ObjectMgr.h | 13 +- src/server/game/Grids/Cells/CellImpl.h | 2 +- src/server/game/Grids/GridDefines.h | 18 +- src/server/game/Grids/GridStates.h | 1 + src/server/game/Grids/Notifiers/GridNotifiers.cpp | 2 +- src/server/game/Grids/Notifiers/GridNotifiers.h | 43 +- .../game/Grids/Notifiers/GridNotifiersImpl.h | 25 +- src/server/game/Groups/Group.cpp | 49 +- src/server/game/Groups/GroupMgr.cpp | 8 +- src/server/game/Guilds/Guild.cpp | 114 +- src/server/game/Guilds/GuildMgr.cpp | 1 - src/server/game/Handlers/AuctionHouseHandler.cpp | 35 +- src/server/game/Handlers/BattleGroundHandler.cpp | 7 +- src/server/game/Handlers/CalendarHandler.cpp | 911 +- src/server/game/Handlers/CharacterHandler.cpp | 258 +- src/server/game/Handlers/GroupHandler.cpp | 14 +- src/server/game/Handlers/GuildHandler.cpp | 8 +- src/server/game/Handlers/ItemHandler.cpp | 12 +- src/server/game/Handlers/LFGHandler.cpp | 6 +- src/server/game/Handlers/LootHandler.cpp | 29 +- src/server/game/Handlers/MailHandler.cpp | 33 +- src/server/game/Handlers/MiscHandler.cpp | 94 +- src/server/game/Handlers/MovementHandler.cpp | 138 +- src/server/game/Handlers/NPCHandler.cpp | 8 +- src/server/game/Handlers/PetHandler.cpp | 26 +- src/server/game/Handlers/PetitionsHandler.cpp | 121 +- src/server/game/Handlers/QueryHandler.cpp | 48 +- src/server/game/Handlers/QuestHandler.cpp | 150 +- src/server/game/Handlers/SkillHandler.cpp | 1 - src/server/game/Handlers/SpellHandler.cpp | 20 +- src/server/game/Handlers/TaxiHandler.cpp | 2 +- src/server/game/Handlers/TicketHandler.cpp | 12 +- src/server/game/Handlers/TradeHandler.cpp | 14 +- src/server/game/Handlers/VehicleHandler.cpp | 4 +- src/server/game/Instances/InstanceSaveMgr.cpp | 51 +- src/server/game/Instances/InstanceScript.cpp | 18 +- src/server/game/Instances/InstanceScript.h | 10 +- src/server/game/Loot/LootMgr.cpp | 189 +- src/server/game/Mails/Mail.h | 1 + src/server/game/Maps/Map.cpp | 173 +- src/server/game/Maps/Map.h | 16 +- src/server/game/Maps/MapInstanced.cpp | 24 +- src/server/game/Maps/MapManager.cpp | 16 +- src/server/game/Maps/MapUpdater.cpp | 2 +- src/server/game/Miscellaneous/Formulas.h | 4 +- src/server/game/Miscellaneous/Language.h | 11 +- src/server/game/Miscellaneous/SharedDefines.h | 172 +- src/server/game/Movement/MotionMaster.cpp | 13 +- src/server/game/Movement/MovementGenerator.h | 6 +- .../ConfusedMovementGenerator.cpp | 64 +- .../MovementGenerators/ConfusedMovementGenerator.h | 5 +- .../FleeingMovementGenerator.cpp | 33 +- .../MovementGenerators/FleeingMovementGenerator.h | 8 +- .../MovementGenerators/HomeMovementGenerator.cpp | 4 - .../MovementGenerators/HomeMovementGenerator.h | 3 +- .../MovementGenerators/IdleMovementGenerator.cpp | 21 +- .../MovementGenerators/IdleMovementGenerator.h | 6 +- .../MovementGenerators/PointMovementGenerator.cpp | 8 +- .../MovementGenerators/PointMovementGenerator.h | 8 +- .../MovementGenerators/RandomMovementGenerator.cpp | 8 +- .../MovementGenerators/RandomMovementGenerator.h | 3 +- .../TargetedMovementGenerator.cpp | 8 +- .../MovementGenerators/TargetedMovementGenerator.h | 3 +- .../WaypointMovementGenerator.cpp | 11 +- .../MovementGenerators/WaypointMovementGenerator.h | 12 +- src/server/game/Movement/Spline/MoveSpline.cpp | 2 +- src/server/game/Movement/Spline/MoveSplineInit.cpp | 14 +- .../game/Movement/Spline/MovementPacketBuilder.cpp | 46 +- .../game/Movement/Waypoints/WaypointManager.cpp | 10 +- src/server/game/OutdoorPvP/OutdoorPvP.cpp | 10 +- src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp | 6 +- src/server/game/OutdoorPvP/OutdoorPvPMgr.h | 5 +- src/server/game/Pools/PoolMgr.cpp | 13 +- src/server/game/Quests/QuestDef.cpp | 66 +- src/server/game/Reputation/ReputationMgr.cpp | 42 +- src/server/game/Reputation/ReputationMgr.h | 5 +- src/server/game/Scripting/MapScripts.cpp | 96 +- src/server/game/Scripting/ScriptLoader.cpp | 6 +- src/server/game/Scripting/ScriptLoader.h | 19 +- src/server/game/Scripting/ScriptMgr.cpp | 49 +- src/server/game/Scripting/ScriptMgr.h | 17 + src/server/game/Scripting/ScriptSystem.cpp | 31 +- src/server/game/Scripting/ScriptSystem.h | 1 + src/server/game/Server/Protocol/Opcodes.cpp | 2 +- src/server/game/Server/Protocol/Opcodes.h | 3 +- src/server/game/Server/Protocol/WorldLog.cpp | 1 + src/server/game/Server/WorldSession.cpp | 56 +- src/server/game/Server/WorldSession.h | 73 +- src/server/game/Server/WorldSocket.cpp | 84 +- src/server/game/Server/WorldSocket.h | 2 +- src/server/game/Server/WorldSocketMgr.cpp | 10 +- src/server/game/Skills/SkillDiscovery.cpp | 6 +- src/server/game/Skills/SkillDiscovery.h | 1 - src/server/game/Skills/SkillExtraItems.cpp | 3 +- src/server/game/Skills/SkillExtraItems.h | 1 - src/server/game/Spells/Auras/SpellAuraEffects.cpp | 391 +- src/server/game/Spells/Auras/SpellAuras.cpp | 123 +- src/server/game/Spells/Spell.cpp | 582 +- src/server/game/Spells/Spell.h | 61 +- src/server/game/Spells/SpellEffects.cpp | 277 +- src/server/game/Spells/SpellInfo.cpp | 183 +- src/server/game/Spells/SpellInfo.h | 27 +- src/server/game/Spells/SpellMgr.cpp | 199 +- src/server/game/Spells/SpellMgr.h | 3 +- src/server/game/Spells/SpellScript.cpp | 34 +- src/server/game/Spells/SpellScript.h | 37 +- src/server/game/Texts/CreatureTextMgr.cpp | 402 +- src/server/game/Texts/CreatureTextMgr.h | 172 +- src/server/game/Tickets/TicketMgr.cpp | 55 +- src/server/game/Tickets/TicketMgr.h | 9 +- src/server/game/Tools/PlayerDump.cpp | 42 +- src/server/game/Warden/Modules/WardenModuleWin.h | 2389 ++-- src/server/game/Warden/Warden.cpp | 10 +- src/server/game/Warden/Warden.h | 2 +- src/server/game/Warden/WardenCheckMgr.cpp | 77 +- src/server/game/Warden/WardenCheckMgr.h | 6 +- src/server/game/Warden/WardenMac.cpp | 2 +- src/server/game/Warden/WardenWin.cpp | 42 +- src/server/game/Weather/Weather.cpp | 2 +- src/server/game/Weather/Weather.h | 1 - src/server/game/Weather/WeatherMgr.cpp | 10 +- src/server/game/World/World.cpp | 85 +- src/server/game/World/World.h | 5 +- src/server/scripts/CMakeLists.txt | 3 +- src/server/scripts/Commands/CMakeLists.txt | 3 +- src/server/scripts/Commands/cs_account.cpp | 37 +- src/server/scripts/Commands/cs_achievement.cpp | 2 +- src/server/scripts/Commands/cs_debug.cpp | 57 +- src/server/scripts/Commands/cs_gm.cpp | 6 +- src/server/scripts/Commands/cs_gobject.cpp | 16 +- src/server/scripts/Commands/cs_gps.cpp | 144 - src/server/scripts/Commands/cs_learn.cpp | 2 +- src/server/scripts/Commands/cs_misc.cpp | 90 +- src/server/scripts/Commands/cs_modify.cpp | 54 +- src/server/scripts/Commands/cs_npc.cpp | 87 +- src/server/scripts/Commands/cs_reload.cpp | 196 +- src/server/scripts/Commands/cs_tele.cpp | 9 +- src/server/scripts/Commands/cs_wp.cpp | 137 +- src/server/scripts/Custom/CMakeLists.txt | 2 +- .../EasternKingdoms/AlteracValley/boss_balinda.cpp | 2 +- .../BlackrockDepths/blackrock_depths.cpp | 531 +- .../BlackrockDepths/boss_ambassador_flamelash.cpp | 4 +- .../BlackrockDepths/boss_anubshiah.cpp | 10 +- .../boss_emperor_dagran_thaurissan.cpp | 10 +- .../BlackrockDepths/boss_general_angerforge.cpp | 10 +- .../BlackrockDepths/boss_gorosh_the_dervish.cpp | 4 +- .../BlackrockDepths/boss_grizzle.cpp | 4 +- .../boss_high_interrogator_gerstahn.cpp | 8 +- .../BlackrockDepths/boss_magmus.cpp | 8 +- .../BlackrockDepths/boss_moira_bronzebeard.cpp | 8 +- .../BlackrockDepths/boss_tomb_of_seven.cpp | 16 +- .../BlackrockDepths/instance_blackrock_depths.cpp | 84 +- .../BlackrockSpire/blackrock_spire.h | 39 +- .../BlackrockSpire/boss_drakkisath.cpp | 2 +- .../EasternKingdoms/BlackrockSpire/boss_gyth.cpp | 4 +- .../BlackrockSpire/boss_halycon.cpp | 2 +- .../BlackrockSpire/boss_highlord_omokk.cpp | 2 +- .../BlackrockSpire/boss_mother_smolderweb.cpp | 2 +- .../BlackrockSpire/boss_overlord_wyrmthalak.cpp | 2 +- .../BlackrockSpire/boss_pyroguard_emberseer.cpp | 41 +- .../BlackrockSpire/boss_quartermaster_zigris.cpp | 2 +- .../BlackrockSpire/boss_rend_blackhand.cpp | 2 +- .../boss_shadow_hunter_voshgajin.cpp | 2 +- .../BlackrockSpire/boss_the_beast.cpp | 2 +- .../BlackrockSpire/boss_warmaster_voone.cpp | 2 +- .../BlackrockSpire/instance_blackrock_spire.cpp | 77 +- .../BlackwingLair/boss_broodlord_lashlayer.cpp | 8 +- .../BlackwingLair/boss_chromaggus.cpp | 2 +- .../BlackwingLair/boss_nefarian.cpp | 16 +- .../BlackwingLair/boss_razorgore.cpp | 2 +- .../BlackwingLair/boss_vaelastrasz.cpp | 36 +- .../BlackwingLair/boss_victor_nefarius.cpp | 18 +- src/server/scripts/EasternKingdoms/CMakeLists.txt | 3 +- .../EasternKingdoms/Deadmines/boss_mr_smite.cpp | 5 +- .../EasternKingdoms/Deadmines/deadmines.cpp | 7 +- .../scripts/EasternKingdoms/Deadmines/deadmines.h | 1 - .../Deadmines/instance_deadmines.cpp | 2 +- .../EasternKingdoms/Gnomeregan/gnomeregan.cpp | 24 +- .../EasternKingdoms/Karazhan/boss_curator.cpp | 4 +- .../Karazhan/boss_maiden_of_virtue.cpp | 4 +- .../EasternKingdoms/Karazhan/boss_midnight.cpp | 20 +- .../EasternKingdoms/Karazhan/boss_moroes.cpp | 29 +- .../EasternKingdoms/Karazhan/boss_netherspite.cpp | 4 +- .../EasternKingdoms/Karazhan/boss_nightbane.cpp | 14 +- .../Karazhan/boss_prince_malchezaar.cpp | 12 +- .../Karazhan/boss_shade_of_aran.cpp | 34 +- .../Karazhan/boss_terestian_illhoof.cpp | 20 +- .../EasternKingdoms/Karazhan/bosses_opera.cpp | 42 +- .../scripts/EasternKingdoms/Karazhan/karazhan.cpp | 26 +- .../MagistersTerrace/boss_felblood_kaelthas.cpp | 40 +- .../MagistersTerrace/boss_priestess_delrissa.cpp | 27 +- .../MagistersTerrace/boss_selin_fireheart.cpp | 8 +- .../MagistersTerrace/boss_vexallus.cpp | 8 +- .../instance_magisters_terrace.cpp | 132 +- .../MagistersTerrace/magisters_terrace.cpp | 4 +- .../MagistersTerrace/magisters_terrace.h | 40 +- .../MoltenCore/boss_majordomo_executus.cpp | 2 +- .../EasternKingdoms/MoltenCore/boss_ragnaros.cpp | 4 +- .../MoltenCore/boss_sulfuron_harbinger.cpp | 2 +- .../EasternKingdoms/MoltenCore/molten_core.cpp | 86 - .../EasternKingdoms/ScarletEnclave/chapter1.cpp | 79 +- .../EasternKingdoms/ScarletEnclave/chapter2.cpp | 106 +- .../EasternKingdoms/ScarletEnclave/chapter5.cpp | 80 +- .../ScarletEnclave/the_scarlet_enclave.cpp | 6 +- .../ScarletMonastery/boss_headless_horseman.cpp | 45 +- .../ScarletMonastery/boss_herod.cpp | 7 +- .../boss_high_inquisitor_fairbanks.cpp | 8 +- .../ScarletMonastery/boss_interrogator_vishas.cpp | 4 +- .../boss_mograine_and_whitemane.cpp | 6 +- .../Scholomance/boss_darkmaster_gandling.cpp | 2 +- .../Scholomance/boss_death_knight_darkreaver.cpp | 2 +- .../Scholomance/boss_doctor_theolen_krastinov.cpp | 2 +- .../Scholomance/boss_illucia_barov.cpp | 2 +- .../Scholomance/boss_instructor_malicia.cpp | 2 +- .../Scholomance/boss_jandice_barov.cpp | 4 +- .../EasternKingdoms/Scholomance/boss_kormok.cpp | 2 +- .../Scholomance/boss_lord_alexei_barov.cpp | 2 +- .../Scholomance/boss_lorekeeper_polkelt.cpp | 2 +- .../Scholomance/boss_ras_frostwhisper.cpp | 2 +- .../Scholomance/boss_the_ravenian.cpp | 2 +- .../EasternKingdoms/Scholomance/boss_vectus.cpp | 2 +- .../ShadowfangKeep/shadowfang_keep.cpp | 19 +- .../Stratholme/boss_baron_rivendare.cpp | 4 +- .../Stratholme/boss_baroness_anastari.cpp | 4 +- .../Stratholme/boss_cannon_master_willey.cpp | 4 +- .../Stratholme/boss_dathrohan_balnazzar.cpp | 4 +- .../Stratholme/boss_magistrate_barthilas.cpp | 4 +- .../Stratholme/boss_maleki_the_pallid.cpp | 4 +- .../EasternKingdoms/Stratholme/boss_nerubenkan.cpp | 4 +- .../Stratholme/boss_order_of_silver_hand.cpp | 52 +- .../Stratholme/boss_postmaster_malown.cpp | 2 +- .../Stratholme/boss_ramstein_the_gorger.cpp | 4 +- .../Stratholme/boss_timmy_the_cruel.cpp | 2 +- .../EasternKingdoms/Stratholme/stratholme.cpp | 10 +- .../SunwellPlateau/boss_brutallus.cpp | 8 +- .../SunwellPlateau/boss_eredar_twins.cpp | 26 +- .../SunwellPlateau/boss_felmyst.cpp | 16 +- .../SunwellPlateau/boss_kalecgos.cpp | 24 +- .../SunwellPlateau/boss_kiljaeden.cpp | 51 +- .../EasternKingdoms/SunwellPlateau/boss_muru.cpp | 20 +- .../EasternKingdoms/Uldaman/boss_archaedas.cpp | 6 +- .../EasternKingdoms/Uldaman/instance_uldaman.cpp | 17 +- .../EasternKingdoms/ZulAman/boss_akilzon.cpp | 32 +- .../EasternKingdoms/ZulAman/boss_halazzi.cpp | 8 +- .../EasternKingdoms/ZulAman/boss_hexlord.cpp | 37 +- .../EasternKingdoms/ZulAman/boss_janalai.cpp | 35 +- .../EasternKingdoms/ZulAman/boss_nalorakk.cpp | 8 +- .../EasternKingdoms/ZulAman/boss_zuljin.cpp | 8 +- .../EasternKingdoms/ZulAman/instance_zulaman.cpp | 7 +- .../scripts/EasternKingdoms/ZulAman/zulaman.cpp | 31 +- .../EasternKingdoms/ZulGurub/boss_arlokk.cpp | 20 +- .../EasternKingdoms/ZulGurub/boss_gahzranka.cpp | 8 +- .../EasternKingdoms/ZulGurub/boss_grilek.cpp | 8 +- .../EasternKingdoms/ZulGurub/boss_hakkar.cpp | 26 +- .../EasternKingdoms/ZulGurub/boss_hazzarah.cpp | 2 +- .../EasternKingdoms/ZulGurub/boss_jeklik.cpp | 22 +- .../EasternKingdoms/ZulGurub/boss_jindo.cpp | 10 +- .../EasternKingdoms/ZulGurub/boss_mandokir.cpp | 26 +- .../EasternKingdoms/ZulGurub/boss_marli.cpp | 18 +- .../EasternKingdoms/ZulGurub/boss_renataki.cpp | 2 +- .../EasternKingdoms/ZulGurub/boss_thekal.cpp | 92 +- .../EasternKingdoms/ZulGurub/boss_venoxis.cpp | 6 +- .../EasternKingdoms/ZulGurub/boss_wushoolay.cpp | 2 +- .../scripts/EasternKingdoms/arathi_highlands.cpp | 56 +- .../scripts/EasternKingdoms/blasted_lands.cpp | 5 +- src/server/scripts/EasternKingdoms/boss_kruul.cpp | 3 +- .../scripts/EasternKingdoms/burning_steppes.cpp | 7 +- src/server/scripts/EasternKingdoms/duskwood.cpp | 4 +- .../EasternKingdoms/eastern_plaguelands.cpp | 33 +- .../scripts/EasternKingdoms/eversong_woods.cpp | 22 +- src/server/scripts/EasternKingdoms/ghostlands.cpp | 108 +- src/server/scripts/EasternKingdoms/hinterlands.cpp | 15 +- src/server/scripts/EasternKingdoms/ironforge.cpp | 5 +- .../scripts/EasternKingdoms/isle_of_queldanas.cpp | 10 +- src/server/scripts/EasternKingdoms/loch_modan.cpp | 5 +- .../scripts/EasternKingdoms/redridge_mountains.cpp | 12 +- .../scripts/EasternKingdoms/silvermoon_city.cpp | 3 +- .../scripts/EasternKingdoms/silverpine_forest.cpp | 57 +- .../scripts/EasternKingdoms/stormwind_city.cpp | 33 +- .../scripts/EasternKingdoms/stranglethorn_vale.cpp | 3 +- .../scripts/EasternKingdoms/swamp_of_sorrows.cpp | 32 +- .../scripts/EasternKingdoms/tirisfal_glades.cpp | 3 - src/server/scripts/EasternKingdoms/undercity.cpp | 112 +- .../EasternKingdoms/western_plaguelands.cpp | 31 +- src/server/scripts/EasternKingdoms/westfall.cpp | 34 +- src/server/scripts/EasternKingdoms/wetlands.cpp | 7 +- src/server/scripts/Examples/CMakeLists.txt | 2 +- src/server/scripts/Examples/example_creature.cpp | 6 +- src/server/scripts/Examples/example_escort.cpp | 10 +- .../scripts/Examples/example_gossip_codebox.cpp | 10 +- src/server/scripts/Examples/example_spell.cpp | 4 +- .../BlackfathomDeeps/blackfathom_deeps.cpp | 6 +- src/server/scripts/Kalimdor/CMakeLists.txt | 2 +- .../BattleForMountHyjal/boss_anetheron.cpp | 23 +- .../BattleForMountHyjal/boss_archimonde.cpp | 43 +- .../BattleForMountHyjal/boss_azgalor.cpp | 25 +- .../BattleForMountHyjal/boss_kazrogal.cpp | 17 +- .../BattleForMountHyjal/boss_rage_winterchill.cpp | 17 +- .../CavernsOfTime/BattleForMountHyjal/hyjal.cpp | 13 +- .../CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp | 30 +- .../CavernsOfTime/BattleForMountHyjal/hyjalAI.h | 4 +- .../BattleForMountHyjal/hyjal_trash.cpp | 204 +- .../BattleForMountHyjal/hyjal_trash.h | 2 +- .../BattleForMountHyjal/instance_hyjal.cpp | 30 +- .../CullingOfStratholme/boss_epoch.cpp | 4 +- .../CullingOfStratholme/boss_infinite.cpp | 4 +- .../CullingOfStratholme/boss_mal_ganis.cpp | 4 +- .../CullingOfStratholme/boss_meathook.cpp | 4 +- .../CullingOfStratholme/boss_salramm.cpp | 4 +- .../CullingOfStratholme/culling_of_stratholme.cpp | 16 +- .../instance_culling_of_stratholme.cpp | 1 + .../CavernsOfTime/DarkPortal/boss_aeonus.cpp | 6 +- .../DarkPortal/boss_chrono_lord_deja.cpp | 6 +- .../CavernsOfTime/DarkPortal/boss_temporus.cpp | 6 +- .../CavernsOfTime/DarkPortal/dark_portal.cpp | 24 +- .../DarkPortal/instance_dark_portal.cpp | 4 +- .../boss_captain_skarloc.cpp | 6 +- .../EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp | 6 +- .../boss_leutenant_drake.cpp | 8 +- .../EscapeFromDurnholdeKeep/old_hillsbrad.cpp | 38 +- .../Kalimdor/Maraudon/boss_celebras_the_cursed.cpp | 2 +- .../scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp | 42 +- .../boss_amnennar_the_coldbringer.cpp | 2 +- .../Kalimdor/RazorfenDowns/razorfen_downs.cpp | 13 +- .../Kalimdor/RazorfenKraul/razorfen_kraul.cpp | 87 +- .../scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp | 2 +- .../Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp | 20 +- .../Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp | 29 +- .../Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp | 2 +- .../Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp | 2 +- .../Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp | 2 +- .../Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp | 6 +- .../Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp | 4 +- .../TempleOfAhnQiraj/boss_twinemperors.cpp | 10 +- .../instance_temple_of_ahnqiraj.cpp | 2 +- .../TempleOfAhnQiraj/mob_anubisath_sentinel.cpp | 4 +- .../Kalimdor/WailingCaverns/wailing_caverns.cpp | 24 +- .../Kalimdor/ZulFarrak/instance_zulfarrak.cpp | 8 +- .../scripts/Kalimdor/ZulFarrak/zulfarrak.cpp | 43 +- src/server/scripts/Kalimdor/ashenvale.cpp | 248 +- src/server/scripts/Kalimdor/azshara.cpp | 238 +- src/server/scripts/Kalimdor/azuremyst_isle.cpp | 222 +- src/server/scripts/Kalimdor/bloodmyst_isle.cpp | 30 +- src/server/scripts/Kalimdor/boss_azuregos.cpp | 125 +- src/server/scripts/Kalimdor/darkshore.cpp | 142 +- src/server/scripts/Kalimdor/desolace.cpp | 37 +- src/server/scripts/Kalimdor/durotar.cpp | 127 +- src/server/scripts/Kalimdor/dustwallow_marsh.cpp | 157 +- src/server/scripts/Kalimdor/felwood.cpp | 34 +- src/server/scripts/Kalimdor/feralas.cpp | 20 +- src/server/scripts/Kalimdor/moonglade.cpp | 230 +- src/server/scripts/Kalimdor/mulgore.cpp | 179 +- src/server/scripts/Kalimdor/orgrimmar.cpp | 61 +- src/server/scripts/Kalimdor/silithus.cpp | 129 +- .../scripts/Kalimdor/stonetalon_mountains.cpp | 39 +- src/server/scripts/Kalimdor/tanaris.cpp | 298 +- src/server/scripts/Kalimdor/teldrassil.cpp | 17 +- src/server/scripts/Kalimdor/the_barrens.cpp | 197 +- src/server/scripts/Kalimdor/thousand_needles.cpp | 108 +- src/server/scripts/Kalimdor/thunder_bluff.cpp | 73 +- src/server/scripts/Kalimdor/ungoro_crater.cpp | 121 +- src/server/scripts/Kalimdor/winterspring.cpp | 20 +- .../AzjolNerub/Ahnkahet/boss_amanitar.cpp | 8 +- .../AzjolNerub/Ahnkahet/boss_elder_nadox.cpp | 10 +- .../Ahnkahet/boss_jedoga_shadowseeker.cpp | 24 +- .../AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp | 82 +- .../AzjolNerub/Ahnkahet/instance_ahnkahet.cpp | 66 +- .../AzjolNerub/AzjolNerub/boss_anubarak.cpp | 2 +- .../AzjolNerub/AzjolNerub/boss_hadronox.cpp | 9 +- .../AzjolNerub/boss_krikthir_the_gatewatcher.cpp | 18 +- .../AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp | 3 +- src/server/scripts/Northrend/CMakeLists.txt | 4 +- .../ObsidianSanctum/boss_sartharion.cpp | 8 +- .../RubySanctum/boss_general_zarithrian.cpp | 4 +- .../RubySanctum/boss_saviana_ragefire.cpp | 14 +- .../ChamberOfAspects/RubySanctum/ruby_sanctum.cpp | 2 +- .../TrialOfTheChampion/boss_argent_challenge.cpp | 8 +- .../TrialOfTheChampion/boss_black_knight.cpp | 2 +- .../TrialOfTheChampion/boss_grand_champions.cpp | 12 +- .../TrialOfTheChampion/trial_of_the_champion.cpp | 8 +- .../TrialOfTheCrusader/boss_anubarak_trial.cpp | 61 +- .../TrialOfTheCrusader/boss_faction_champions.cpp | 98 +- .../TrialOfTheCrusader/boss_lord_jaraxxus.cpp | 52 +- .../TrialOfTheCrusader/boss_northrend_beasts.cpp | 71 +- .../TrialOfTheCrusader/boss_twin_valkyr.cpp | 80 +- .../instance_trial_of_the_crusader.cpp | 2 +- .../TrialOfTheCrusader/trial_of_the_crusader.cpp | 301 +- .../scripts/Northrend/DraktharonKeep/boss_dred.cpp | 6 +- .../Northrend/DraktharonKeep/boss_novos.cpp | 12 +- .../Northrend/DraktharonKeep/boss_tharon_ja.cpp | 4 +- .../Northrend/DraktharonKeep/boss_trollgore.cpp | 4 +- .../DraktharonKeep/instance_drak_tharon_keep.cpp | 3 +- .../FrozenHalls/ForgeOfSouls/forge_of_souls.cpp | 587 +- .../HallsOfReflection/halls_of_reflection.cpp | 20 +- .../PitOfSaron/boss_forgemaster_garfrost.cpp | 33 +- .../FrozenHalls/PitOfSaron/boss_krickandick.cpp | 6 +- .../PitOfSaron/boss_scourgelord_tyrannus.cpp | 8 +- .../PitOfSaron/instance_pit_of_saron.cpp | 30 + .../FrozenHalls/PitOfSaron/pit_of_saron.cpp | 81 +- .../FrozenHalls/PitOfSaron/pit_of_saron.h | 2 + src/server/scripts/Northrend/Gundrak/boss_eck.cpp | 10 +- .../scripts/Northrend/Gundrak/boss_gal_darah.cpp | 4 +- .../scripts/Northrend/Gundrak/boss_slad_ran.cpp | 8 +- .../scripts/Northrend/Gundrak/instance_gundrak.cpp | 17 +- .../IcecrownCitadel/boss_blood_prince_council.cpp | 89 +- .../IcecrownCitadel/boss_blood_queen_lana_thel.cpp | 73 +- .../IcecrownCitadel/boss_deathbringer_saurfang.cpp | 148 +- .../Northrend/IcecrownCitadel/boss_festergut.cpp | 2 +- .../IcecrownCitadel/boss_lady_deathwhisper.cpp | 2 +- .../IcecrownCitadel/boss_professor_putricide.cpp | 206 +- .../Northrend/IcecrownCitadel/boss_rotface.cpp | 10 +- .../Northrend/IcecrownCitadel/boss_sindragosa.cpp | 248 +- .../IcecrownCitadel/boss_the_lich_king.cpp | 46 +- .../IcecrownCitadel/boss_valithria_dreamwalker.cpp | 25 +- .../Northrend/IcecrownCitadel/icecrown_citadel.cpp | 34 +- .../Northrend/IcecrownCitadel/icecrown_citadel.h | 4 + .../IcecrownCitadel/instance_icecrown_citadel.cpp | 16 +- .../Northrend/Naxxramas/boss_anubrekhan.cpp | 4 +- .../Northrend/Naxxramas/boss_four_horsemen.cpp | 20 +- .../scripts/Northrend/Naxxramas/boss_gluth.cpp | 2 +- .../scripts/Northrend/Naxxramas/boss_gothik.cpp | 8 +- .../scripts/Northrend/Naxxramas/boss_grobbulus.cpp | 2 +- .../scripts/Northrend/Naxxramas/boss_heigan.cpp | 4 +- .../scripts/Northrend/Naxxramas/boss_kelthuzad.cpp | 46 +- .../scripts/Northrend/Naxxramas/boss_maexxna.cpp | 4 +- .../scripts/Northrend/Naxxramas/boss_noth.cpp | 4 +- .../scripts/Northrend/Naxxramas/boss_patchwerk.cpp | 4 +- .../scripts/Northrend/Naxxramas/boss_razuvious.cpp | 2 +- .../scripts/Northrend/Naxxramas/boss_sapphiron.cpp | 10 +- .../scripts/Northrend/Naxxramas/boss_thaddius.cpp | 12 +- .../Northrend/Naxxramas/instance_naxxramas.cpp | 1 - .../Northrend/Nexus/EyeOfEternity/boss_malygos.cpp | 27 +- .../Northrend/Nexus/Nexus/boss_anomalus.cpp | 2 +- .../Northrend/Nexus/Nexus/boss_keristrasza.cpp | 14 +- .../Northrend/Nexus/Nexus/boss_magus_telestra.cpp | 4 +- .../scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp | 10 +- .../Northrend/Nexus/Nexus/commander_kolurg.cpp | 2 +- .../Northrend/Nexus/Nexus/commander_stoutbeard.cpp | 2 +- .../scripts/Northrend/Nexus/Oculus/boss_urom.cpp | 6 +- .../scripts/Northrend/Nexus/Oculus/boss_varos.cpp | 10 +- .../scripts/Northrend/Nexus/Oculus/oculus.cpp | 8 +- .../Ulduar/HallsOfLightning/boss_bjarngrim.cpp | 66 +- .../Ulduar/HallsOfLightning/boss_ionar.cpp | 19 +- .../Ulduar/HallsOfLightning/boss_loken.cpp | 60 +- .../Ulduar/HallsOfLightning/boss_volkhan.cpp | 50 +- .../Ulduar/HallsOfStone/boss_krystallus.cpp | 4 +- .../Ulduar/HallsOfStone/boss_maiden_of_grief.cpp | 2 +- .../Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp | 10 +- .../Ulduar/HallsOfStone/halls_of_stone.cpp | 16 +- .../Northrend/Ulduar/Ulduar/boss_algalon.cpp | 376 - .../Ulduar/Ulduar/boss_algalon_the_observer.cpp | 1374 ++ .../Ulduar/Ulduar/boss_assembly_of_iron.cpp | 12 +- .../Northrend/Ulduar/Ulduar/boss_auriaya.cpp | 10 +- .../Ulduar/Ulduar/boss_flame_leviathan.cpp | 37 +- .../scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp | 32 +- .../Northrend/Ulduar/Ulduar/boss_general_vezax.cpp | 6 +- .../scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp | 18 +- .../scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp | 10 +- .../Northrend/Ulduar/Ulduar/boss_kologarn.cpp | 9 +- .../Northrend/Ulduar/Ulduar/boss_razorscale.cpp | 20 +- .../Northrend/Ulduar/Ulduar/boss_thorim.cpp | 2 +- .../scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp | 10 +- .../Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp | 31 +- .../Northrend/Ulduar/Ulduar/instance_ulduar.cpp | 271 +- .../scripts/Northrend/Ulduar/Ulduar/ulduar.h | 226 +- .../UtgardeKeep/boss_ingvar_the_plunderer.cpp | 11 +- .../UtgardeKeep/boss_skarvald_dalronn.cpp | 28 +- .../UtgardeKeep/instance_utgarde_keep.cpp | 3 +- .../UtgardeKeep/UtgardeKeep/utgarde_keep.cpp | 100 +- .../UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp | 35 +- .../UtgardeKeep/UtgardePinnacle/boss_skadi.cpp | 56 +- .../UtgardeKeep/UtgardePinnacle/boss_svala.cpp | 95 +- .../UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp | 6 +- .../UtgardePinnacle/instance_pinnacle.cpp | 3 +- .../Northrend/VaultOfArchavon/boss_emalon.cpp | 4 +- .../Northrend/VaultOfArchavon/boss_toravon.cpp | 2 +- .../Northrend/VioletHold/boss_cyanigosa.cpp | 6 +- .../scripts/Northrend/VioletHold/boss_erekem.cpp | 8 +- .../Northrend/VioletHold/boss_lavanthor.cpp | 4 +- .../scripts/Northrend/VioletHold/boss_moragg.cpp | 4 +- .../scripts/Northrend/VioletHold/boss_zuramat.cpp | 4 +- .../Northrend/VioletHold/instance_violet_hold.cpp | 8 +- .../scripts/Northrend/VioletHold/violet_hold.cpp | 80 +- src/server/scripts/Northrend/borean_tundra.cpp | 239 +- src/server/scripts/Northrend/dalaran.cpp | 6 +- src/server/scripts/Northrend/dragonblight.cpp | 4 +- src/server/scripts/Northrend/grizzly_hills.cpp | 42 +- src/server/scripts/Northrend/howling_fjord.cpp | 20 +- src/server/scripts/Northrend/icecrown.cpp | 8 +- src/server/scripts/Northrend/sholazar_basin.cpp | 95 +- src/server/scripts/Northrend/storm_peaks.cpp | 124 +- src/server/scripts/Northrend/zuldrak.cpp | 37 +- src/server/scripts/OutdoorPvP/CMakeLists.txt | 2 +- src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp | 1 - src/server/scripts/OutdoorPvP/OutdoorPvPEP.h | 1 - src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp | 1 - src/server/scripts/OutdoorPvP/OutdoorPvPZM.h | 2 +- .../AuchenaiCrypts/boss_exarch_maladaar.cpp | 8 +- .../boss_shirrak_the_dead_watcher.cpp | 4 +- .../ManaTombs/boss_nexusprince_shaffar.cpp | 8 +- .../Auchindoun/ManaTombs/boss_pandemonius.cpp | 4 +- .../SethekkHalls/boss_darkweaver_syth.cpp | 12 +- .../SethekkHalls/boss_tailonking_ikiss.cpp | 8 +- .../ShadowLabyrinth/boss_ambassador_hellmaw.cpp | 30 +- .../boss_blackheart_the_inciter.cpp | 6 +- .../ShadowLabyrinth/boss_grandmaster_vorpil.cpp | 10 +- .../Auchindoun/ShadowLabyrinth/boss_murmur.cpp | 6 +- .../ShadowLabyrinth/instance_shadow_labyrinth.cpp | 3 +- .../scripts/Outland/BlackTemple/black_temple.cpp | 4 +- .../scripts/Outland/BlackTemple/boss_bloodboil.cpp | 8 +- .../scripts/Outland/BlackTemple/boss_illidan.cpp | 95 +- .../Outland/BlackTemple/boss_mother_shahraz.cpp | 8 +- .../BlackTemple/boss_reliquary_of_souls.cpp | 23 +- .../Outland/BlackTemple/boss_shade_of_akama.cpp | 59 +- .../scripts/Outland/BlackTemple/boss_supremus.cpp | 24 +- .../Outland/BlackTemple/boss_teron_gorefiend.cpp | 27 +- .../Outland/BlackTemple/boss_warlord_najentus.cpp | 10 +- .../Outland/BlackTemple/illidari_council.cpp | 44 +- .../Outland/BlackTemple/instance_black_temple.cpp | 142 +- src/server/scripts/Outland/CMakeLists.txt | 2 +- .../SerpentShrine/boss_fathomlord_karathress.cpp | 38 +- .../SerpentShrine/boss_hydross_the_unstable.cpp | 69 +- .../SerpentShrine/boss_lady_vashj.cpp | 625 +- .../SerpentShrine/boss_leotheras_the_blind.cpp | 47 +- .../SerpentShrine/boss_lurker_below.cpp | 139 +- .../SerpentShrine/boss_morogrim_tidewalker.cpp | 8 +- .../SerpentShrine/instance_serpent_shrine.cpp | 2 +- .../SteamVault/boss_hydromancer_thespia.cpp | 8 +- .../SteamVault/boss_mekgineer_steamrigger.cpp | 12 +- .../SteamVault/boss_warlord_kalithresh.cpp | 10 +- .../CoilfangReservoir/underbog/boss_hungarfen.cpp | 4 +- .../underbog/boss_the_black_stalker.cpp | 4 +- .../scripts/Outland/GruulsLair/boss_gruul.cpp | 15 +- .../Outland/GruulsLair/boss_high_king_maulgar.cpp | 40 +- .../Outland/GruulsLair/instance_gruuls_lair.cpp | 19 +- .../HellfireCitadel/BloodFurnace/boss_broggok.cpp | 6 +- .../BloodFurnace/boss_kelidan_the_breaker.cpp | 18 +- .../BloodFurnace/boss_the_maker.cpp | 6 +- .../HellfireRamparts/boss_omor_the_unscarred.cpp | 8 +- .../HellfireRamparts/boss_vazruden_the_herald.cpp | 30 +- .../boss_watchkeeper_gargolmar.cpp | 8 +- .../MagtheridonsLair/boss_magtheridon.cpp | 24 +- .../instance_magtheridons_lair.cpp | 4 +- .../ShatteredHalls/boss_nethekurse.cpp | 12 +- .../ShatteredHalls/boss_warbringer_omrogg.cpp | 6 +- .../boss_warchief_kargath_bladefist.cpp | 16 +- .../scripts/Outland/TempestKeep/Eye/boss_alar.cpp | 24 +- .../Outland/TempestKeep/Eye/boss_astromancer.cpp | 14 +- .../Outland/TempestKeep/Eye/boss_kaelthas.cpp | 117 +- .../Outland/TempestKeep/Eye/boss_void_reaver.cpp | 6 +- .../Outland/TempestKeep/Eye/instance_the_eye.cpp | 3 +- .../Mechanar/boss_gatewatcher_ironhand.cpp | 2 +- .../Mechanar/boss_nethermancer_sepethrea.cpp | 2 +- .../Mechanar/boss_pathaleon_the_calculator.cpp | 2 +- .../TempestKeep/Mechanar/instance_mechanar.cpp | 2 +- .../Outland/TempestKeep/arcatraz/arcatraz.cpp | 4 +- .../arcatraz/boss_harbinger_skyriss.cpp | 2 +- .../TempestKeep/arcatraz/instance_arcatraz.cpp | 47 +- .../botanica/boss_high_botanist_freywinn.cpp | 6 +- .../Outland/TempestKeep/botanica/boss_laj.cpp | 4 +- .../TempestKeep/botanica/boss_warp_splinter.cpp | 10 +- .../scripts/Outland/blades_edge_mountains.cpp | 71 +- .../scripts/Outland/boss_doomlord_kazzak.cpp | 41 +- src/server/scripts/Outland/boss_doomwalker.cpp | 4 +- src/server/scripts/Outland/hellfire_peninsula.cpp | 79 +- src/server/scripts/Outland/nagrand.cpp | 52 +- src/server/scripts/Outland/netherstorm.cpp | 66 +- src/server/scripts/Outland/shadowmoon_valley.cpp | 376 +- src/server/scripts/Outland/shattrath_city.cpp | 140 +- src/server/scripts/Outland/terokkar_forest.cpp | 143 +- src/server/scripts/Outland/zangarmarsh.cpp | 32 +- src/server/scripts/Spells/CMakeLists.txt | 2 +- src/server/scripts/Spells/spell_dk.cpp | 39 +- src/server/scripts/Spells/spell_druid.cpp | 6 +- src/server/scripts/Spells/spell_generic.cpp | 215 +- src/server/scripts/Spells/spell_hunter.cpp | 67 +- src/server/scripts/Spells/spell_item.cpp | 94 +- src/server/scripts/Spells/spell_mage.cpp | 26 +- src/server/scripts/Spells/spell_paladin.cpp | 20 + src/server/scripts/Spells/spell_priest.cpp | 64 +- src/server/scripts/Spells/spell_quest.cpp | 86 +- src/server/scripts/Spells/spell_shaman.cpp | 131 +- src/server/scripts/Spells/spell_warlock.cpp | 134 +- src/server/scripts/Spells/spell_warrior.cpp | 80 +- src/server/scripts/World/CMakeLists.txt | 2 +- src/server/scripts/World/areatrigger_scripts.cpp | 80 +- src/server/scripts/World/boss_emerald_dragons.cpp | 4 +- src/server/scripts/World/go_scripts.cpp | 300 +- src/server/scripts/World/guards.cpp | 25 +- src/server/scripts/World/item_scripts.cpp | 49 +- src/server/scripts/World/mob_generic_creature.cpp | 8 +- src/server/scripts/World/npc_innkeeper.cpp | 6 +- src/server/scripts/World/npc_professions.cpp | 246 +- src/server/scripts/World/npc_taxi.cpp | 11 +- src/server/scripts/World/npcs_special.cpp | 592 +- src/server/shared/AutoPtr.h | 53 + src/server/shared/CMakeLists.txt | 1 - src/server/shared/Common.h | 4 + src/server/shared/Containers.h | 71 + src/server/shared/Cryptography/BigNumber.cpp | 4 + src/server/shared/Cryptography/BigNumber.h | 5 + src/server/shared/Cryptography/HMACSHA1.cpp | 12 +- src/server/shared/Cryptography/HMACSHA1.h | 2 - src/server/shared/Cryptography/SHA1.h | 1 - src/server/shared/Database/DatabaseWorkerPool.h | 181 +- src/server/shared/Database/Field.h | 103 +- .../Database/Implementation/CharacterDatabase.cpp | 193 +- .../Database/Implementation/CharacterDatabase.h | 177 +- .../Database/Implementation/LoginDatabase.cpp | 35 +- .../shared/Database/Implementation/LoginDatabase.h | 29 +- .../Database/Implementation/WorldDatabase.cpp | 30 +- .../shared/Database/Implementation/WorldDatabase.h | 31 +- src/server/shared/Database/MySQLConnection.cpp | 4 - src/server/shared/Database/PreparedStatement.cpp | 51 +- src/server/shared/Database/QueryResult.h | 6 +- src/server/shared/Database/Transaction.h | 2 +- src/server/shared/Debugging/Errors.h | 8 +- .../shared/Debugging/WheatyExceptionReport.cpp | 18 +- .../shared/Dynamic/TypeContainerFunctionsPtr.h | 168 - src/server/shared/Logging/Log.cpp | 24 +- src/server/shared/Logging/Log.h | 44 +- src/server/shared/Packets/ByteBuffer.h | 85 +- src/server/shared/Utilities/Util.cpp | 40 - src/server/shared/Utilities/Util.h | 12 +- src/server/worldserver/CMakeLists.txt | 3 +- src/server/worldserver/CommandLine/CliRunnable.cpp | 34 +- src/server/worldserver/Main.cpp | 4 +- src/server/worldserver/Master.cpp | 41 +- src/server/worldserver/Master.h | 2 +- src/server/worldserver/RemoteAccess/RASocket.cpp | 28 +- src/server/worldserver/RemoteAccess/RASocket.h | 2 +- .../worldserver/WorldThread/WorldRunnable.cpp | 2 + src/server/worldserver/worldserver.conf.dist | 6 +- src/tools/map_extractor/System.cpp | 211 +- src/tools/vmap4_extractor/model.cpp | 2 +- src/tools/vmap4_extractor/mpq_libmpq04.h | 10 +- src/tools/vmap4_extractor/vmapexport.cpp | 17 +- src/tools/vmap4_extractor/vmapexport.h | 4 +- src/tools/vmap4_extractor/wmo.cpp | 48 +- 1132 files changed, 51312 insertions(+), 37093 deletions(-) delete mode 100644 dep/mersennetwister/MersenneTwister.h create mode 100644 sql/old/3.3.5a/2012_02_13_00_world_version.sql create mode 100644 sql/old/3.3.5a/2012_02_14_00_world_achievement_criteria_data.sql create mode 100644 sql/old/3.3.5a/2012_02_15_00_world_quest_template.sql create mode 100644 sql/old/3.3.5a/2012_02_15_01_world_areatrigger_tavern.sql create mode 100644 sql/old/3.3.5a/2012_02_15_02_world_item_template.sql create mode 100644 sql/old/3.3.5a/2012_02_15_03_world_quest_template.sql create mode 100644 sql/old/3.3.5a/2012_02_15_04_world_quest_template.sql create mode 100644 sql/old/3.3.5a/2012_02_15_06_world_creature_involvedrelation.sql create mode 100644 sql/old/3.3.5a/2012_02_15_07_00_world_creature.sql create mode 100644 sql/old/3.3.5a/2012_02_15_07_01_world_waypoint_data.sql create mode 100644 sql/old/3.3.5a/2012_02_15_07_02_world_misc.sql create mode 100644 sql/old/3.3.5a/2012_02_15_08_world_sai.sql create mode 100644 sql/old/3.3.5a/2012_02_15_09_world_spell_proc_event.sql create mode 100644 sql/old/3.3.5a/2012_02_16_00_world_conditions.sql create mode 100644 sql/old/3.3.5a/2012_02_16_01_world_conditions.sql create mode 100644 sql/old/3.3.5a/2012_02_17_00_world_waypoints.sql create mode 100644 sql/old/3.3.5a/2012_02_18_00_world_spell_script_names.sql create mode 100644 sql/old/3.3.5a/2012_02_18_01_world_spell_dbc.sql create mode 100644 sql/old/3.3.5a/2012_02_18_02_world_gossip.sql create mode 100644 sql/old/3.3.5a/2012_02_18_03_world_gossip.sql create mode 100644 sql/old/3.3.5a/2012_02_18_04_world_spell_script_names.sql create mode 100644 sql/old/3.3.5a/2012_02_18_05_world_creatures.sql create mode 100644 sql/old/3.3.5a/2012_02_18_06_world_gossip.sql create mode 100644 sql/old/3.3.5a/2012_02_18_07_world_gossip.sql create mode 100644 sql/old/3.3.5a/2012_02_18_08_world_gossip.sql create mode 100644 sql/old/3.3.5a/2012_02_19_00_auth_account.sql create mode 100644 sql/old/3.3.5a/2012_02_19_00_characters_warden_action.sql create mode 100644 sql/old/3.3.5a/2012_02_19_00_world_quest_template.sql create mode 100644 sql/old/3.3.5a/2012_02_19_01_world_quest_template.sql create mode 100644 sql/old/3.3.5a/2012_02_19_02_world_gameobject.sql create mode 100644 sql/old/3.3.5a/2012_02_19_03_world_warden_checks.sql create mode 100644 sql/old/3.3.5a/2012_02_19_04_world_misc_db_updates.sql create mode 100644 sql/old/3.3.5a/2012_02_19_05_world_creature_text.sql create mode 100644 sql/old/3.3.5a/2012_02_19_06_world_creature_text.sql create mode 100644 sql/old/3.3.5a/2012_02_20_00_world_sai.sql create mode 100644 sql/old/3.3.5a/2012_02_20_01_world_gossip.sql create mode 100644 sql/old/3.3.5a/2012_02_20_02_world_conditons.sql create mode 100644 sql/old/3.3.5a/2012_02_21_00_world_creature_loot_template.sql create mode 100644 sql/old/3.3.5a/2012_02_21_01_world_conditions.sql create mode 100644 sql/old/3.3.5a/2012_02_21_02_world_creature_loot_template.sql create mode 100644 sql/old/3.3.5a/2012_02_21_03_world_creature_loot_template.sql create mode 100644 sql/old/3.3.5a/2012_02_21_04_world_creature_loot_template.sql create mode 100644 sql/old/3.3.5a/2012_02_21_05_world_gossip.sql create mode 100644 sql/old/3.3.5a/2012_02_21_06_world_Gossip.sql create mode 100644 sql/old/3.3.5a/2012_02_22_00_world_sai.sql create mode 100644 sql/old/3.3.5a/2012_02_22_01_world_creature_text.sql create mode 100644 sql/old/3.3.5a/2012_02_22_02_world_misc.sql create mode 100644 sql/old/3.3.5a/2012_02_22_03_world_conditions.sql create mode 100644 sql/old/3.3.5a/2012_02_23_00_world_spell_script_names.sql create mode 100644 sql/old/3.3.5a/2012_02_24_00_world_gameobject_loot_template.sql create mode 100644 sql/old/3.3.5a/2012_02_24_01_world_sai.sql create mode 100644 sql/old/3.3.5a/2012_02_25_00_world_spell_script_names.sql create mode 100644 sql/old/3.3.5a/2012_02_25_01_world_command.sql create mode 100644 sql/old/3.3.5a/2012_02_25_01_world_misc.sql create mode 100644 sql/old/3.3.5a/2012_02_25_02_world_sai.sql create mode 100644 sql/old/3.3.5a/2012_02_26_00_world_misc.sql create mode 100644 sql/old/3.3.5a/2012_02_26_01_world_spell_script_names.sql create mode 100644 sql/old/3.3.5a/2012_02_27_00_world_creature_template.sql create mode 100644 sql/old/3.3.5a/2012_02_28_00_world_wintergrasp_spawns.sql create mode 100644 sql/old/3.3.5a/2012_02_29_00_world_conditions_misc.sql create mode 100644 sql/old/3.3.5a/2012_02_29_01_world_conditions.sql create mode 100644 sql/old/3.3.5a/2012_02_29_02_world_conditions.sql create mode 100644 sql/old/3.3.5a/2012_02_29_03_world_creature_text.sql create mode 100644 sql/old/3.3.5a/2012_02_29_04_world_creature_text.sql create mode 100644 sql/old/3.3.5a/2012_02_29_05_world_creature_text.sql create mode 100644 sql/old/3.3.5a/2012_03_01_00_world_conditions.sql create mode 100644 sql/old/3.3.5a/2012_03_01_01_world_creature_text.sql create mode 100644 sql/old/3.3.5a/2012_03_01_02_world_locales_creature_text.sql create mode 100644 sql/old/3.3.5a/2012_03_03_00_world_command.sql create mode 100644 sql/old/3.3.5a/2012_03_04_00_world_misc.sql create mode 100644 sql/old/3.3.5a/2012_03_04_01_world_areatrigger_scripts.sql create mode 100644 sql/old/3.3.5a/2012_03_06_00_world_commands.sql create mode 100644 sql/old/3.3.5a/2012_03_06_01_world_misc.sql create mode 100644 sql/old/3.3.5a/2012_03_06_02_world_queststatus_seasonal.sql create mode 100644 sql/old/3.3.5a/2012_03_06_03_world_smart_scripts.sql create mode 100644 sql/old/3.3.5a/2012_03_06_04_world_creature_text.sql create mode 100644 sql/old/3.3.5a/2012_03_07_00_world_trinity_string.sql create mode 100644 sql/old/3.3.5a/2012_03_10_00_world_creature.sql create mode 100644 sql/old/3.3.5a/2012_03_10_00_world_smart_scripts.sql create mode 100644 sql/old/3.3.5a/2012_03_10_00_world_waypoint_data.sql create mode 100644 sql/old/3.3.5a/2012_03_11_00_world_sai.sql create mode 100644 sql/old/3.3.5a/2012_03_12_00_world_creature_template.sql create mode 100644 sql/old/3.3.5a/2012_03_12_01_world_conditions.sql create mode 100644 sql/old/3.3.5a/2012_03_12_01_world_gameobject.sql create mode 100644 sql/old/3.3.5a/2012_03_12_01_world_spell_script_names.sql create mode 100644 sql/old/3.3.5a/2012_03_14_00_world_creature_addon.sql create mode 100644 sql/old/3.3.5a/2012_03_19_00_world_smart_scripts.sql create mode 100644 sql/old/3.3.5a/2012_03_20_00_world_gossip.sql create mode 100644 sql/old/3.3.5a/2012_03_21_00_world_creature.sql create mode 100644 sql/old/3.3.5a/2012_03_22_00_world_creature_template.sql create mode 100644 sql/old/3.3.5a/2012_03_22_01_world_conditions.sql create mode 100644 sql/old/3.3.5a/2012_03_23_00_world_ip2nation.sql create mode 100644 sql/old/3.3.5a/2012_03_24_00_world_misc.sql create mode 100644 sql/old/3.3.5a/2012_03_24_01_world_creature_loot_template.sql create mode 100644 sql/old/3.3.5a/2012_03_24_02_world_creature_loot_template.sql create mode 100644 sql/old/3.3.5a/2012_03_25_00_auth_misc.sql create mode 100644 sql/old/3.3.5a/2012_03_25_00_world_game_event.sql create mode 100644 sql/old/3.3.5a/2012_03_26_00_auth_realmlist.sql create mode 100644 sql/old/3.3.5a/2012_03_26_00_world_creature_template.sql create mode 100644 sql/old/3.3.5a/2012_03_26_01_world_spell_script_names.sql create mode 100644 sql/old/3.3.5a/2012_03_27_00_world_misc.sql create mode 100644 sql/old/3.3.5a/2012_03_27_01_world_misc.sql create mode 100644 sql/old/3.3.5a/2012_03_27_02_world_misc.sql create mode 100644 sql/old/3.3.5a/2012_03_27_03_world_misc.sql create mode 100644 sql/old/3.3.5a/2012_03_27_04_world_misc.sql create mode 100644 sql/old/3.3.5a/2012_03_28_00_auth_account.sql create mode 100644 sql/old/3.3.5a/2012_03_28_01_auth_account_access.sql create mode 100644 sql/old/3.3.5a/2012_03_28_01_world_spell_bonus_data.sql create mode 100644 sql/old/3.3.5a/2012_03_28_02_auth_account_banned.sql create mode 100644 sql/old/3.3.5a/2012_03_28_03_auth_ip_banned.sql create mode 100644 sql/old/3.3.5a/2012_03_28_04_auth_logs.sql create mode 100644 sql/old/3.3.5a/2012_03_28_05_auth_realmcharacters.sql create mode 100644 sql/old/3.3.5a/2012_03_28_06_auth_realmlist.sql create mode 100644 sql/old/3.3.5a/2012_03_28_07_auth_uptime.sql create mode 100644 sql/old/3.3.5a/2012_03_30_00_world_smart_scripts.sql create mode 100644 sql/old/3.3.5a/2012_03_31_00_world_creature_loot_template.sql create mode 100644 sql/old/3.3.5a/2012_04_01_00_auth_realmlist.sql create mode 100644 sql/old/3.3.5a/2012_04_01_00_world_creature.sql create mode 100644 sql/old/3.3.5a/2012_04_01_00_world_spell_script_names.sql create mode 100644 sql/old/3.3.5a/2012_04_01_01_world_creature.sql create mode 100644 sql/old/3.3.5a/2012_04_01_02_world_spell_group_stack_rules.sql create mode 100644 sql/old/3.3.5a/2012_04_01_03_world_trainers.sql create mode 100644 sql/old/3.3.5a/2012_04_01_04_world_conditions.sql create mode 100644 sql/old/3.3.5a/2012_04_01_05_world_creature_template.sql create mode 100644 sql/old/3.3.5a/2012_04_01_06_world_sai.sql create mode 100644 sql/old/3.3.5a/2012_04_01_07_world_misc.sql create mode 100644 sql/old/3.3.5a/2012_04_03_00_world_spell_script_names.sql create mode 100644 sql/old/3.3.5a/2012_04_04_00_auth_realmlist.sql create mode 100644 sql/old/3.3.5a/2012_04_04_00_world_conditions.sql create mode 100644 sql/old/3.3.5a/2012_04_04_01_world_spell_dbc.sql create mode 100644 sql/old/3.3.5a/2012_04_05_00_world_gameobject_template.sql create mode 100644 sql/old/3.3.5a/2012_04_05_00_world_spell_script_names.sql create mode 100644 sql/old/3.3.5a/2012_04_05_01_world_spell_proc_event.sql create mode 100644 sql/old/3.3.5a/2012_04_06_00_world_spell_proc_event.sql create mode 100644 sql/old/3.3.5a/2012_04_06_01_world_spell_dbc.sql create mode 100644 sql/old/3.3.5a/2012_04_06_02_world_gameobject_template.sql create mode 100644 sql/old/3.3.5a/2012_04_06_03_world_spell_dbc.sql create mode 100644 sql/old/3.3.5a/2012_04_06_04_world_page_text.sql create mode 100644 sql/old/3.3.5a/2012_04_07_00_characters_lag_reports.sql create mode 100644 sql/old/3.3.5a/2012_04_07_00_world_gameobject.sql create mode 100644 sql/old/3.3.5a/2012_04_07_01_world_game_event.sql create mode 100644 sql/old/3.3.5a/2012_04_07_02_world_spell_proc_event.sql create mode 100644 sql/old/3.3.5a/2012_04_08_00_world_spell_script_names.sql create mode 100644 sql/old/3.3.5a/2012_04_08_01_world_creature_template.sql create mode 100644 sql/old/3.3.5a/2012_04_08_02_world_spell_dbc.sql create mode 100644 sql/old/3.3.5a/2012_04_08_02_world_spell_script_names.sql create mode 100644 sql/old/3.3.5a/2012_04_08_03_world_spell_script_names.sql create mode 100644 sql/old/3.3.5a/2012_04_12_00_world_creature_template.sql create mode 100644 sql/old/3.3.5a/2012_04_12_01_world_creature_template.sql create mode 100644 sql/old/3.3.5a/2012_04_12_02_world_spell_bonus_data.sql create mode 100644 sql/old/3.3.5a/2012_04_12_03_world_spell_bonus_data.sql create mode 100644 sql/old/3.3.5a/2012_04_12_04_world_creature_template.sql create mode 100644 sql/old/3.3.5a/2012_04_12_05_world_command.sql create mode 100644 sql/old/3.3.5a/2012_04_13_00_world_sai.sql create mode 100644 sql/old/3.3.5a/2012_04_13_01_world_misc.sql create mode 100644 sql/old/3.3.5a/2012_04_13_02_world_misc.sql create mode 100644 sql/old/3.3.5a/2012_04_13_03_world_bg_template.sql create mode 100644 sql/old/3.3.5a/2012_04_13_04_world_spell_proc_event.sql create mode 100644 sql/old/3.3.5a/2012_04_14_00_world_gameobject_loot_template.sql create mode 100644 sql/old/3.3.5a/2012_04_14_01_world_gameobject_loot_template.sql create mode 100644 sql/old/3.3.5a/2012_04_14_02_world_creature_template_addon.sql create mode 100644 sql/old/3.3.5a/2012_04_14_03_world_spell_bonus_data.sql create mode 100644 sql/old/3.3.5a/2012_04_14_04_world_spell_proc_event.sql create mode 100644 sql/old/3.3.5a/2012_04_14_05_world_spell_proc_event.sql create mode 100644 sql/old/3.3.5a/2012_04_16_00_world_game_event.sql create mode 100644 sql/old/3.3.5a/2012_04_17_00_world_creature.sql create mode 100644 sql/old/3.3.5a/2012_04_18_00_world_npc_spellclick_spells.sql create mode 100644 sql/old/3.3.5a/2012_04_18_01_world_creature.sql create mode 100644 sql/old/3.3.5a/2012_04_18_02_world_reference_loot_template.sql create mode 100644 sql/old/3.3.5a/2012_04_18_03_world_creature_loot_template.sql create mode 100644 sql/old/3.3.5a/2012_04_18_04_world_pickpocketing_loot_template.sql create mode 100644 sql/old/3.3.5a/2012_04_18_05_world_conditions.sql create mode 100644 sql/old/3.3.5a/2012_04_18_06_world_creature_template.sql create mode 100644 sql/old/3.3.5a/2012_04_18_07_world_fishing_loot_template.sql create mode 100644 sql/old/3.3.5a/2012_04_18_08_world_creature_loot_template.sql create mode 100644 sql/old/3.3.5a/2012_04_19_00_world_creature_template.sql create mode 100644 sql/old/3.3.5a/2012_04_19_01_world_pickpocketing_loot_template.sql create mode 100644 sql/old/3.3.5a/2012_04_19_02_world_creature_loot_template.sql create mode 100644 sql/old/3.3.5a/2012_04_19_03_world_instance_ulduar.sql create mode 100644 sql/old/3.3.5a/2012_04_20_00_world_gameobject_loot_template.sql create mode 100644 sql/old/3.3.5a/2012_04_20_01_world_item_loot_template.sql create mode 100644 sql/old/3.3.5a/2012_04_20_02_world_creature_loot_template.sql create mode 100644 sql/old/3.3.5a/2012_04_20_03_world_creature_loot_template.sql create mode 100644 sql/old/3.3.5a/2012_04_20_04_world_creature_loot_template.sql create mode 100644 sql/old/3.3.5a/2012_04_20_05_gameobject_template.sql create mode 100644 sql/old/3.3.5a/2012_04_21_00_world_spell_script_names.sql create mode 100644 sql/old/3.3.5a/2012_04_22_00_world_sai.sql create mode 100644 sql/old/3.3.5a/2012_04_23_00_world_creatures.sql create mode 100644 sql/old/3.3.5a/2012_04_23_01_world_conditions.sql create mode 100644 sql/old/3.3.5a/2012_04_23_02_world_prospecting_loot_template.sql create mode 100644 sql/old/3.3.5a/2012_04_23_03_world_skinning_loot_template.sql create mode 100644 sql/old/3.3.5a/2012_04_23_04_world_creature_loot_template.sql create mode 100644 sql/old/3.3.5a/2012_04_23_05_world_creature_loot_template.sql create mode 100644 sql/old/3.3.5a/2012_04_24_00_world_command.sql create mode 100644 sql/old/3.3.5a/2012_04_24_01_world_spell_proc_event.sql create mode 100644 sql/old/3.3.5a/2012_04_24_02_world_warden_checks.sql create mode 100644 sql/old/3.3.5a/2012_04_24_03_world_spell_script_names.sql create mode 100644 sql/old/3.3.5a/2012_04_24_04_world_spell_proc_event.sql create mode 100644 sql/old/3.3.5a/2012_04_24_05_world_creature_loot_template.sql create mode 100644 sql/old/3.3.5a/2012_04_24_06_world_misc.sql create mode 100644 sql/old/3.3.5a/2012_04_25_00_world_misc.sql create mode 100644 sql/old/3.3.5a/2012_04_25_01_world_spell_script_names.sql create mode 100644 sql/old/3.3.5a/2012_04_25_02_world_spell_script_names.sql create mode 100644 sql/old/3.3.5a/2012_04_25_03_world_spell_group.sql create mode 100644 sql/old/3.3.5a/2012_04_26_00_world_conditions.sql create mode 100644 sql/old/3.3.5a/2012_04_26_01_world_smart_scripts.sql create mode 100644 sql/old/3.3.5a/2012_04_27_00_world_instance_icc.sql create mode 100644 sql/old/3.3.5a/2012_04_28_00_world_reference_loot_template.sql create mode 100644 sql/old/3.3.5a/2012_04_28_01_world_reference_loot_template.sql create mode 100644 sql/old/3.3.5a/2012_05_01_00_world_creature.sql create mode 100644 sql/old/3.3.5a/2012_05_02_00_world_creature_loot_template.sql create mode 100644 sql/old/3.3.5a/2012_05_03_00_world_creature.sql create mode 100644 sql/old/3.3.5a/2012_05_03_01_world_cos_misc.sql create mode 100644 sql/old/3.3.5a/2012_05_03_02_world_quest_template.sql create mode 100644 sql/old/3.3.5a/2012_05_03_03_world_creature_questrelation.sql create mode 100644 sql/old/3.3.5a/2012_05_03_04_world_game_event_creature_quest.sql create mode 100644 sql/old/3.3.5a/2012_05_04_00_world_waypoints.sql create mode 100644 sql/old/3.3.5a/2012_05_04_01_world_sai.sql create mode 100644 sql/old/3.3.5a/2012_05_05_00_world_sai.sql create mode 100644 sql/old/3.3.5a/2012_05_05_01_world_creature_template.sql create mode 100644 sql/old/3.3.5a/2012_05_05_02_world_gameobject.sql create mode 100644 sql/old/3.3.5a/2012_05_05_03_world_sai.sql create mode 100644 sql/old/3.3.5a/2012_05_05_04_world_creature_template.sql create mode 100644 sql/old/3.3.5a/2012_05_05_05_world_creature_template.sql create mode 100644 sql/old/3.3.5a/2012_05_05_06_world_sai.sql create mode 100644 sql/old/3.3.5a/2012_05_06_00_world_creature_template.sql create mode 100644 sql/old/3.3.5a/2012_05_06_01_world_creature_template.sql create mode 100644 sql/old/3.3.5a/2012_05_07_00_world_waypoints.sql create mode 100644 sql/old/3.3.5a/2012_05_07_01_world_sai.sql create mode 100644 sql/old/3.3.5a/2012_05_08_00_world_sai.sql create mode 100644 sql/old/3.3.5a/2012_05_08_01_world_gameobject.sql create mode 100644 sql/old/3.3.5a/2012_05_08_01_world_misc.sql create mode 100644 sql/old/3.3.5a/2012_05_09_00_world_spell_target_position.sql create mode 100644 sql/old/3.3.5a/2012_05_09_01_world_commands.sql create mode 100644 sql/old/3.3.5a/2012_05_09_02_world_sai.sql create mode 100644 sql/old/3.3.5a/2012_05_09_03_world_misc.sql create mode 100644 sql/old/3.3.5a/2012_05_10_00_world_sai.sql create mode 100644 sql/old/3.3.5a/2012_05_10_01_world_misc.sql create mode 100644 sql/old/3.3.5a/2012_05_10_02_world_creature_template.sql create mode 100644 sql/old/3.3.5a/2012_05_10_03_world_misc.sql create mode 100644 sql/old/3.3.5a/2012_05_10_04_world_ceature_sai.sql create mode 100644 sql/old/3.3.5a/2012_05_10_05_world_waypoints.sql create mode 100644 sql/old/3.3.5a/2012_05_10_06_world_waypoints.sql create mode 100644 sql/old/3.3.5a/2012_05_11_00_world_waypoints.sql create mode 100644 sql/old/3.3.5a/2012_05_11_01_world_gameobject_template.sql create mode 100644 sql/old/3.3.5a/2012_05_11_02_world_conditions.sql create mode 100644 sql/old/3.3.5a/2012_05_12_00_world_gameobject_template.sql create mode 100644 sql/old/3.3.5a/2012_05_12_01_world_item_loot_template.sql create mode 100644 sql/old/3.3.5a/2012_05_12_02_world_gameobject_loot_template.sql create mode 100644 sql/old/3.3.5a/2012_05_13_00_world_creature_text.sql create mode 100644 sql/old/3.3.5a/2012_05_13_01_world_creature_text.sql create mode 100644 sql/old/3.3.5a/2012_05_16_00_world_scripts.sql create mode 100644 sql/old/3.3.5a/2012_05_17_00_world_creature_text.sql create mode 100644 sql/old/3.3.5a/2012_05_18_00_world_conditions.sql create mode 100644 sql/old/3.3.5a/2012_05_18_01_world_misc.sql create mode 100644 sql/old/3.3.5a/2012_05_18_01_world_spell_target_position.sql create mode 100644 sql/old/3.3.5a/2012_05_19_00_world_quest_template.sql create mode 100644 sql/old/3.3.5a/2012_05_19_01_world_smart_scripts.sql create mode 100644 sql/old/3.3.5a/2012_05_19_02_world_misc.sql delete mode 100644 sql/updates/auth/2012_02_19_00_auth_account.sql delete mode 100644 sql/updates/characters/2012_02_19_00_characters_warden_action.sql delete mode 100644 sql/updates/world/2012_02_13_00_world_version.sql delete mode 100644 sql/updates/world/2012_02_14_00_world_achievement_criteria_data.sql delete mode 100644 sql/updates/world/2012_02_15_00_world_quest_template.sql delete mode 100644 sql/updates/world/2012_02_15_01_world_areatrigger_tavern.sql delete mode 100644 sql/updates/world/2012_02_15_02_world_item_template.sql delete mode 100644 sql/updates/world/2012_02_15_03_world_quest_template.sql delete mode 100644 sql/updates/world/2012_02_15_04_world_quest_template.sql delete mode 100644 sql/updates/world/2012_02_15_06_world_creature_involvedrelation.sql delete mode 100644 sql/updates/world/2012_02_15_07_00_world_creature.sql delete mode 100644 sql/updates/world/2012_02_15_07_01_world_waypoint_data.sql delete mode 100644 sql/updates/world/2012_02_15_07_02_world_misc.sql delete mode 100644 sql/updates/world/2012_02_15_08_world_sai.sql delete mode 100644 sql/updates/world/2012_02_15_09_world_spell_proc_event.sql delete mode 100644 sql/updates/world/2012_02_16_00_world_conditions.sql delete mode 100644 sql/updates/world/2012_02_16_01_world_conditions.sql delete mode 100644 sql/updates/world/2012_02_17_00_world_waypoints.sql delete mode 100644 sql/updates/world/2012_02_18_00_world_spell_script_names.sql delete mode 100644 sql/updates/world/2012_02_18_01_world_spell_dbc.sql delete mode 100644 sql/updates/world/2012_02_18_02_world_gossip.sql delete mode 100644 sql/updates/world/2012_02_18_03_world_gossip.sql delete mode 100644 sql/updates/world/2012_02_18_04_world_spell_script_names.sql delete mode 100644 sql/updates/world/2012_02_18_05_world_creatures.sql delete mode 100644 sql/updates/world/2012_02_18_06_world_gossip.sql delete mode 100644 sql/updates/world/2012_02_18_07_world_gossip.sql delete mode 100644 sql/updates/world/2012_02_18_08_world_gossip.sql delete mode 100644 sql/updates/world/2012_02_19_00_world_quest_template.sql delete mode 100644 sql/updates/world/2012_02_19_01_world_quest_template.sql delete mode 100644 sql/updates/world/2012_02_19_02_world_gameobject.sql delete mode 100644 sql/updates/world/2012_02_19_03_world_warden_checks.sql delete mode 100644 sql/updates/world/2012_02_19_04_world_misc_db_updates.sql delete mode 100644 sql/updates/world/2012_02_19_05_world_say_text.sql delete mode 100644 sql/updates/world/2012_02_19_06_world_say_text.sql delete mode 100644 sql/updates/world/2012_02_20_00_world_sai.sql delete mode 100644 sql/updates/world/2012_02_20_01_world_misc_db.sql delete mode 100644 sql/updates/world/2012_02_20_02_world_conditons.sql delete mode 100644 sql/updates/world/2012_02_21_00_world_creature_loot_template.sql delete mode 100644 sql/updates/world/2012_02_21_01_world_conditions.sql delete mode 100644 sql/updates/world/2012_02_21_02_world_creature_loot_template.sql delete mode 100644 sql/updates/world/2012_02_21_03_world_creature_loot_template.sql delete mode 100644 sql/updates/world/2012_02_21_04_world_creature_loot_template.sql delete mode 100644 sql/updates/world/2012_02_21_05_world_Gossip_SAI.sql delete mode 100644 sql/updates/world/2012_02_21_06_world_Gossip.sql delete mode 100644 sql/updates/world/2012_02_22_00_world_SAI.sql delete mode 100644 sql/updates/world/2012_02_22_01_world_say_text.sql delete mode 100644 sql/updates/world/2012_02_22_02_world_misc.sql delete mode 100644 sql/updates/world/2012_02_22_03_world_conditions.sql create mode 100644 sql/updates/world/2012_05_19_03_world_version.sql create mode 100644 sql/updates/world/2012_05_19_04_creature_loot_template.sql create mode 100644 sql/updates/world/2012_05_19_05_gameobject_loot_template.sql create mode 100644 sql/updates/world/2012_05_19_06_gameobject_loot_template.sql create mode 100644 sql/updates/world/2012_05_20_00_world_misc.sql create mode 100644 sql/updates/world/2012_05_20_01_world_spell_bonus_data.sql create mode 100644 sql/updates/world/2012_05_22_00_world_spell_proc_event.sql create mode 100644 sql/updates/world/2012_05_22_01_world_creature_loot_template.sql create mode 100644 sql/updates/world/2012_05_23_00_world_creature.sql create mode 100644 sql/updates/world/2012_05_23_01_world_sai.sql create mode 100644 sql/updates/world/2012_05_23_02_world_sai.sql create mode 100644 sql/updates/world/2012_05_23_03_world_gameobject_loot_template.sql create mode 100644 sql/updates/world/2012_05_23_04_world_gameobject.sql create mode 100644 sql/updates/world/2012_05_23_05_world_creature.sql create mode 100644 sql/updates/world/2012_05_24_00_world_creature_misc.sql create mode 100644 sql/updates/world/2012_05_24_01_world_gameobject.sql create mode 100644 sql/updates/world/2012_05_25_00_world_sai.sql create mode 100644 sql/updates/world/2012_05_25_01_world_waypoints.sql create mode 100644 sql/updates/world/2012_05_25_02_world_creature_template.sql create mode 100644 sql/updates/world/2012_05_25_03_world_template.sql create mode 100644 sql/updates/world/2012_05_26_00_world_scripts.sql create mode 100644 sql/updates/world/2012_05_26_01_world_spell_dbc.sql create mode 100644 sql/updates/world/2012_05_26_02_world_creature_template.sql create mode 100644 sql/updates/world/2012_05_26_03_world_page_text.sql create mode 100644 sql/updates/world/2012_05_26_04_world_creature_template.sql create mode 100644 sql/updates/world/2012_05_26_05_world_creature_template.sql create mode 100644 sql/updates/world/2012_05_26_06_world_smart_scripts.sql create mode 100644 sql/updates/world/2012_05_27_00_world_gameobject_template.sql create mode 100644 sql/updates/world/2012_05_27_01_world_waypoints.sql create mode 100644 sql/updates/world/2012_05_27_02_world_creature.sql create mode 100644 sql/updates/world/2012_05_27_03_world_creature.sql create mode 100644 sql/updates/world/2012_05_27_04_world_smart_scripts.sql create mode 100644 sql/updates/world/2012_05_27_05_world_gameobject.sql create mode 100644 sql/updates/world/2012_05_27_06_world_creature.sql create mode 100644 sql/updates/world/2012_05_27_07_world_game_event.sql create mode 100644 sql/updates/world/2012_05_27_07_world_waypoints.sql create mode 100644 sql/updates/world/2012_05_28_00_world_creature_ai_scripts.sql create mode 100644 sql/updates/world/2012_05_28_01_world_creature.sql create mode 100644 sql/updates/world/2012_05_28_02_world_creature.sql create mode 100644 sql/updates/world/2012_05_28_03_waypoint_data.sql create mode 100644 sql/updates/world/2012_05_28_04_world_creature_template.sql create mode 100644 sql/updates/world/2012_05_28_05_world_creature.sql create mode 100644 sql/updates/world/2012_05_28_06_world_creature_addon.sql create mode 100644 sql/updates/world/2012_05_28_06_world_waypoint_data.sql create mode 100644 sql/updates/world/2012_05_28_07_world_quest_template.sql delete mode 100755 src/server/game/AI/ScriptedAI/ScriptedSimpleAI.cpp delete mode 100644 src/server/game/AI/ScriptedAI/ScriptedSimpleAI.h create mode 100644 src/server/game/Calendar/CalendarMgr.cpp create mode 100644 src/server/game/Calendar/CalendarMgr.h delete mode 100644 src/server/scripts/Commands/cs_gps.cpp delete mode 100644 src/server/scripts/EasternKingdoms/MoltenCore/molten_core.cpp delete mode 100644 src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon.cpp create mode 100644 src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp create mode 100644 src/server/shared/AutoPtr.h create mode 100644 src/server/shared/Containers.h delete mode 100755 src/server/shared/Dynamic/TypeContainerFunctionsPtr.h (limited to 'src') diff --git a/PreLoad.cmake b/PreLoad.cmake index a6dc928b906..0f1c0f6ce19 100644 --- a/PreLoad.cmake +++ b/PreLoad.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2005-2010 Trinity +# Copyright (C) 2005-2012 Trinity # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without diff --git a/cmake/compiler/gcc/settings.cmake b/cmake/compiler/gcc/settings.cmake index 3a2745702c8..8247831fdd8 100644 --- a/cmake/compiler/gcc/settings.cmake +++ b/cmake/compiler/gcc/settings.cmake @@ -3,14 +3,12 @@ add_definitions(-D_BUILD_DIRECTIVE='"${CMAKE_BUILD_TYPE}"') add_definitions(-fno-delete-null-pointer-checks) -if( USE_SFMT) - if(PLATFORM EQUAL 32) - # Required on 32-bit systems to enable SSE2 (standard on x64) - add_definitions(-msse2 -mfpmath=sse) - endif() - add_definitions(-DHAVE_SSE2 -D__SSE2__) - message(STATUS "GCC: SFMT enabled, SSE2 flags forced") +if(PLATFORM EQUAL 32) + # Required on 32-bit systems to enable SSE2 (standard on x64) + add_definitions(-msse2 -mfpmath=sse) endif() +add_definitions(-DHAVE_SSE2 -D__SSE2__) +message(STATUS "GCC: SSE2 flags forced") if( WITH_WARNINGS ) add_definitions(-Wall -Wfatal-errors -Wextra) diff --git a/cmake/compiler/icc/settings.cmake b/cmake/compiler/icc/settings.cmake index 0e614ef97f8..b7e4cb742b3 100644 --- a/cmake/compiler/icc/settings.cmake +++ b/cmake/compiler/icc/settings.cmake @@ -1,13 +1,10 @@ # Set build-directive (used in core to tell which buildtype we used) add_definitions(-D_BUILD_DIRECTIVE="${CMAKE_BUILD_TYPE}") -if( USE_SFMT) - if(PLATFORM EQUAL 32) - add_definitions(-axSSE2) - else() - add_definitions(-xSSE2) - endif() - message(STATUS "ICC: SFMT enabled, SSE2 flags forced") +if(PLATFORM EQUAL 32) + add_definitions(-axSSE2) +else() + add_definitions(-xSSE2) endif() if( WITH_WARNINGS ) diff --git a/cmake/compiler/msvc/settings.cmake b/cmake/compiler/msvc/settings.cmake index eb55dc66c50..3d8fe43b6aa 100644 --- a/cmake/compiler/msvc/settings.cmake +++ b/cmake/compiler/msvc/settings.cmake @@ -20,11 +20,8 @@ else() set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE") message(STATUS "MSVC: Enabled large address awareness") - # Test if we need SSE2-support - if(USE_SFMT) - add_definitions(/arch:SSE2) - message(STATUS "MSVC: Enabled SSE2 support") - endif() + add_definitions(/arch:SSE2) + message(STATUS "MSVC: Enabled SSE2 support") endif() # Set build-directive (used in core to tell which buildtype we used) diff --git a/cmake/genrev.cmake b/cmake/genrev.cmake index 37cea9b3deb..b1112d13c12 100644 --- a/cmake/genrev.cmake +++ b/cmake/genrev.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2010 Trinity +# Copyright (C) 2008-2012 Trinity # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without diff --git a/cmake/macros/CheckBuildDir.cmake b/cmake/macros/CheckBuildDir.cmake index 868643285ef..d67f930df99 100644 --- a/cmake/macros/CheckBuildDir.cmake +++ b/cmake/macros/CheckBuildDir.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2010 Trinity +# Copyright (C) 2008-2012 Trinity # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without diff --git a/cmake/options.cmake b/cmake/options.cmake index 17edc2697b7..11ebe6ddd12 100644 --- a/cmake/options.cmake +++ b/cmake/options.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2010 Trinity +# Copyright (C) 2008-2012 Trinity # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without @@ -13,6 +13,5 @@ option(SCRIPTS "Build core with scripts included" option(TOOLS "Build map/vmap extraction/assembler tools" 0) option(USE_SCRIPTPCH "Use precompiled headers when compiling scripts" 1) option(USE_COREPCH "Use precompiled headers when compiling servers" 1) -option(USE_SFMT "Use SFMT as random numbergenerator" 0) option(WITH_WARNINGS "Show all warnings during compile" 0) option(WITH_COREDEBUG "Include additional debug-code in core" 0) diff --git a/cmake/platform/unix/settings.cmake b/cmake/platform/unix/settings.cmake index 81f438befc9..dd8b7c081f3 100644 --- a/cmake/platform/unix/settings.cmake +++ b/cmake/platform/unix/settings.cmake @@ -1,6 +1,8 @@ # Package overloads - Linux if(CMAKE_SYSTEM_NAME MATCHES "Linux") - set(JEMALLOC_LIBRARY "jemalloc") + if (NOT NOJEM) + set(JEMALLOC_LIBRARY "jemalloc") + endif() endif() # set default configuration directory diff --git a/cmake/showoptions.cmake b/cmake/showoptions.cmake index 31e1b412b32..47ad7b0889b 100644 --- a/cmake/showoptions.cmake +++ b/cmake/showoptions.cmake @@ -50,13 +50,6 @@ else() message("* Build scripts w/PCH : No") endif() -if( USE_SFMT ) - message("* Use SFMT for RNG : Yes") - add_definitions(-DUSE_SFMT_FOR_RNG) -else() - message("* Use SFMT for RNG : No (default)") -endif() - if( WITH_WARNINGS ) message("* Show all warnings : Yes") else() @@ -78,4 +71,10 @@ if( WIN32 ) endif() endif( WIN32 ) +if ( NOJEM ) + message("") + message("*** WARNING: jemalloc linking has been disabled!") + message("*** Please note that this is for DEBUGGING WITH VALGRIND only!") + message("*** DO NOT DISABLE IT UNLESS YOU KNOW WHAT YOU'RE DOING!") +endif() message("") diff --git a/contrib/conf_merge/tc-conf-merger.pl b/contrib/conf_merge/tc-conf-merger.pl index d4902aba279..138d51705d7 100644 --- a/contrib/conf_merge/tc-conf-merger.pl +++ b/contrib/conf_merge/tc-conf-merger.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl -w -# Copyright (C) 2008-2011 TrinityCore +# Copyright (C) 2008-2012 TrinityCore # Author: leak # Date: 2010-12-06 # Note: Based on conf file format of rev 10507 diff --git a/dep/CMakeLists.txt b/dep/CMakeLists.txt index ce80d43b0c1..946dadf33d8 100644 --- a/dep/CMakeLists.txt +++ b/dep/CMakeLists.txt @@ -15,8 +15,8 @@ elseif( MSVC ) endif() if(CMAKE_SYSTEM_NAME MATCHES "Linux") - if(SERVERS) - add_subdirectory(jemalloc) + if(SERVERS AND NOT NOJEM) + add_subdirectory(jemalloc) endif() endif() diff --git a/dep/PackageList.txt b/dep/PackageList.txt index b599bd0e11b..5d3d4bdcc4d 100644 --- a/dep/PackageList.txt +++ b/dep/PackageList.txt @@ -14,12 +14,8 @@ G3D (a commercial-grade C++ 3D engine available as Open Source (BSD License) jemalloc (a general-purpose scalable concurrent malloc-implementation) http://www.canonware.com/jemalloc/ - Version: 2.1.0 + Version: 2.2.5 -MersenneTwister (a very fast random number generator) - http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html - Version: 0.4.2 - MySQL (the world's most popular open source database software) http://www.mysql.com/ Version: 5.5.9 (GA) @@ -38,7 +34,7 @@ zlib (A Massively Spiffy Yet Delicately Unobtrusive Compression Library) gSOAP (a portable development toolkit for C and C++ XML Web services and XML data bindings) http://gsoap2.sourceforge.net/ - Version: 2.8.0 + Version: 2.8.2 StormLib (a pack of modules, written in C++, which are able to read and also to write files from/to the MPQ archives) http://www.zezula.net/en/mpq/stormlib.html diff --git a/dep/SFMT/SFMT.h b/dep/SFMT/SFMT.h index 03a7e853316..5498b9ac5fb 100644 --- a/dep/SFMT/SFMT.h +++ b/dep/SFMT/SFMT.h @@ -7,7 +7,7 @@ * in effect in addition to the GNU General Public License. * Copyright (c) 2006, 2007 by Mutsuo Saito, Makoto Matsumoto and Hiroshima University. * Copyright (c) 2008 by Agner Fog. - * Copyright (c) 2010 Trinity Core + * Copyright (c) 2012 Trinity Core * * BSD License: * Redistribution and use in source and binary forms, with or without @@ -39,6 +39,7 @@ #include // Define SSE2 intrinsics #include "randomc.h" // Define integer types etc #include +#include // Choose one of the possible Mersenne exponents. // Higher values give longer cycle length and use more memory: @@ -149,8 +150,14 @@ __m128i const &c, __m128i const &d, __m128i const &mask) { // Class for SFMT generator class SFMTRand { // Encapsulate random number generator + friend class ACE_TSS; + public: - SFMTRand() { LastInterval = 0; RandomInit((int)(time(0))); } + SFMTRand() + { + LastInterval = 0; + RandomInit((int)(time(0))); + } void RandomInit(int seed) // Re-seed { @@ -298,6 +305,46 @@ private: ix = 0; } + void* operator new(size_t size, std::nothrow_t const&) + { + return _mm_malloc(size, 16); + } + + void operator delete(void* ptr, std::nothrow_t const&) + { + _mm_free(ptr); + } + + void* operator new(size_t size) + { + return _mm_malloc(size, 16); + } + + void operator delete(void* ptr) + { + _mm_free(ptr); + } + + void* operator new[](size_t size, std::nothrow_t const&) + { + return _mm_malloc(size, 16); + } + + void operator delete[](void* ptr, std::nothrow_t const&) + { + _mm_free(ptr); + } + + void* operator new[](size_t size) + { + return _mm_malloc(size, 16); + } + + void operator delete[](void* ptr) + { + _mm_free(ptr); + } + uint32_t ix; // Index into state array uint32_t LastInterval; // Last interval length for IRandom uint32_t RLimit; // Rejection limit used by IRandom diff --git a/dep/SFMT/randomc.h b/dep/SFMT/randomc.h index 5370a701c0e..ee5ad9aa43b 100644 --- a/dep/SFMT/randomc.h +++ b/dep/SFMT/randomc.h @@ -7,7 +7,7 @@ * in effect in addition to the GNU General Public License. * Copyright (c) 2006, 2007 by Mutsuo Saito, Makoto Matsumoto and Hiroshima University. * Copyright (c) 2008 by Agner Fog. - * Copyright (c) 2010 Trinity Core + * Copyright (c) 2012 Trinity Core * * BSD License: * Redistribution and use in source and binary forms, with or without diff --git a/dep/mersennetwister/MersenneTwister.h b/dep/mersennetwister/MersenneTwister.h deleted file mode 100644 index 1cff879643f..00000000000 --- a/dep/mersennetwister/MersenneTwister.h +++ /dev/null @@ -1,405 +0,0 @@ -// MersenneTwister.h -// Mersenne Twister random number generator -- a C++ class MTRand -// Based on code by Makoto Matsumoto, Takuji Nishimura, and Shawn Cokus -// Richard J. Wagner v1.0 15 May 2003 rjwagner@writeme.com - -// The Mersenne Twister is an algorithm for generating random numbers. It -// was designed with consideration of the flaws in various other generators. -// The period, 2^19937-1, and the order of equidistribution, 623 dimensions, -// are far greater. The generator is also fast; it avoids multiplication and -// division, and it benefits from caches and pipelines. For more information -// see the inventors' web page at http://www.math.keio.ac.jp/~matumoto/emt.html - -// Reference -// M. Matsumoto and T. Nishimura, "Mersenne Twister: A 623-Dimensionally -// Equidistributed Uniform Pseudo-Random Number Generator", ACM Transactions on -// Modeling and Computer Simulation, Vol. 8, No. 1, January 1998, pp 3-30. - -// Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, -// Copyright (C) 2000 - 2003, Richard J. Wagner -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. The names of its contributors may not be used to endorse or promote -// products derived from this software without specific prior written -// permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// The original code included the following notice: -// -// When you use this, send an email to: matumoto@math.keio.ac.jp -// with an appropriate reference to your work. -// -// It would be nice to CC: rjwagner@writeme.com and Cokus@math.washington.edu -// when you write. - -#ifndef MERSENNETWISTER_H -#define MERSENNETWISTER_H - -// Not thread safe (unless auto-initialization is avoided and each thread has -// its own MTRand object) - -#include"Define.h" - -#include -#include -#include - -class MTRand { -// Data -public: - typedef ::uint32 uint32; - enum { N = 624 }; // length of state vector - enum { SAVE = N + 1 }; // length of array for save() - -protected: - enum { M = 397 }; // period parameter - - uint32 state[N]; // internal state - uint32 *pNext; // next value to get from state - int left; // number of values left before reload needed - -//Methods -public: - MTRand( const uint32& oneSeed ); // initialize with a simple uint32 - MTRand( uint32 *const bigSeed, uint32 const seedLength = N ); // or an array - MTRand(); // auto-initialize with /dev/urandom or time() and clock() - MTRand(const MTRand&); // prevent copy constructor - MTRand& operator=(const MTRand&); // no-op operator= - - // Do NOT use for CRYPTOGRAPHY without securely hashing several returned - // values together, otherwise the generator state can be learned after - // reading 624 consecutive values. - - // Access to 32-bit random numbers - double rand(); // real number in [0,1] - double rand( const double& n ); // real number in [0,n] - double randExc(); // real number in [0,1) - double randExc( const double& n ); // real number in [0,n) - double randDblExc(); // real number in (0,1) - double randDblExc( const double& n ); // real number in (0,n) - uint32 randInt(); // integer in [0,2^32-1] - uint32 randInt( const uint32& n ); // integer in [0,n] for n < 2^32 - double operator()() { return rand(); } // same as rand() - - // Access to 53-bit random numbers (capacity of IEEE double precision) - double rand53(); // real number in [0,1) - - // Access to nonuniform random number distributions - double randNorm( const double& mean = 0.0, const double& variance = 0.0 ); - - // Re-seeding functions with same behavior as initializers - void seed( const uint32 oneSeed ); - void seed( uint32 *const bigSeed, const uint32 seedLength = N ); - void seed(); - - // Saving and loading generator state - void save( uint32* saveArray ) const; // to array of size SAVE - void load( uint32 *const loadArray ); // from such array - /* Trinity not use streams for random values output - friend std::ostream& operator<<( std::ostream& os, const MTRand& mtrand ); - friend std::istream& operator>>( std::istream& is, MTRand& mtrand ); - */ -protected: - void initialize( const uint32 oneSeed ); - void reload(); - uint32 hiBit( const uint32& u ) const { return u & 0x80000000UL; } - uint32 loBit( const uint32& u ) const { return u & 0x00000001UL; } - uint32 loBits( const uint32& u ) const { return u & 0x7fffffffUL; } - uint32 mixBits( const uint32& u, const uint32& v ) const - { return hiBit(u) | loBits(v); } - uint32 twist( const uint32& m, const uint32& s0, const uint32& s1 ) const - { return m ^ (mixBits(s0,s1)>>1) ^ uint32(-(int32)(loBit(s1) & 0x9908b0dfUL)); } - static uint32 hash( time_t t, clock_t c ); -}; - -inline MTRand::MTRand(const MTRand&) - { seed(); } - -inline MTRand& MTRand::operator=(const MTRand&) - { return *this; } - -inline MTRand::MTRand( const uint32& oneSeed ) - { seed(oneSeed); } - -inline MTRand::MTRand( uint32 *const bigSeed, const uint32 seedLength ) - { seed(bigSeed,seedLength); } - -inline MTRand::MTRand() - { seed(); } - -inline double MTRand::rand() - { return double(randInt()) * (1.0/4294967295.0); } - -inline double MTRand::rand( const double& n ) - { return rand() * n; } - -inline double MTRand::randExc() - { return double(randInt()) * (1.0/4294967296.0); } - -inline double MTRand::randExc( const double& n ) - { return randExc() * n; } - -inline double MTRand::randDblExc() - { return ( double(randInt()) + 0.5 ) * (1.0/4294967296.0); } - -inline double MTRand::randDblExc( const double& n ) - { return randDblExc() * n; } - -inline double MTRand::rand53() -{ - uint32 a = randInt() >> 5, b = randInt() >> 6; - return ( a * 67108864.0 + b ) * (1.0/9007199254740992.0); // by Isaku Wada -} - -inline double MTRand::randNorm( const double& mean, const double& variance ) -{ - // Return a real number from a normal (Gaussian) distribution with given - // mean and variance by Box-Muller method - double r = sqrt( -2.0 * log( 1.0-randDblExc()) ) * variance; - double phi = 2.0 * 3.14159265358979323846264338328 * randExc(); - return mean + r * cos(phi); -} - -inline MTRand::uint32 MTRand::randInt() -{ - // Pull a 32-bit integer from the generator state - // Every other access function simply transforms the numbers extracted here - - if( left == 0 ) reload(); - --left; - - register uint32 s1; - s1 = *pNext++; - s1 ^= (s1 >> 11); - s1 ^= (s1 << 7) & 0x9d2c5680UL; - s1 ^= (s1 << 15) & 0xefc60000UL; - return ( s1 ^ (s1 >> 18) ); -} - -inline MTRand::uint32 MTRand::randInt( const uint32& n ) -{ - // Find which bits are used in n - // Optimized by Magnus Jonsson (magnus@smartelectronix.com) - uint32 used = n; - used |= used >> 1; - used |= used >> 2; - used |= used >> 4; - used |= used >> 8; - used |= used >> 16; - - // Draw numbers until one is found in [0,n] - uint32 i; - do - i = randInt() & used; // toss unused bits to shorten search - while( i > n ); - return i; -} - -inline void MTRand::seed( const uint32 oneSeed ) -{ - // Seed the generator with a simple uint32 - initialize(oneSeed); - reload(); -} - -inline void MTRand::seed( uint32 *const bigSeed, const uint32 seedLength ) -{ - // Seed the generator with an array of uint32's - // There are 2^19937-1 possible initial states. This function allows - // all of those to be accessed by providing at least 19937 bits (with a - // default seed length of N = 624 uint32's). Any bits above the lower 32 - // in each element are discarded. - // Just call seed() if you want to get array from /dev/urandom - initialize(19650218UL); - register int i = 1; - register uint32 j = 0; - register int k = ( N > int(seedLength) ? N : int(seedLength) ); - for (; k; --k ) - { - state[i] = - state[i] ^ ( (state[i-1] ^ (state[i-1] >> 30)) * 1664525UL ); - state[i] += ( bigSeed[j] & 0xffffffffUL ) + j; - state[i] &= 0xffffffffUL; - ++i; ++j; - if( i >= N ) { state[0] = state[N-1]; i = 1; } - if( j >= seedLength ) j = 0; - } - for (k = N - 1; k; --k ) - { - state[i] = - state[i] ^ ( (state[i-1] ^ (state[i-1] >> 30)) * 1566083941UL ); - state[i] -= i; - state[i] &= 0xffffffffUL; - ++i; - if( i >= N ) { state[0] = state[N-1]; i = 1; } - } - state[0] = 0x80000000UL; // MSB is 1, assuring non-zero initial array - reload(); -} - -inline void MTRand::seed() -{ - // Seed the generator with hash of time() and clock() values - seed( hash( time(NULL), clock() ) ); -} - -inline void MTRand::initialize( const uint32 seed ) -{ - // Initialize generator state with seed - // See Knuth TAOCP Vol 2, 3rd Ed, p.106 for multiplier. - // In previous versions, most significant bits (MSBs) of the seed affect - // only MSBs of the state array. Modified 9 Jan 2002 by Makoto Matsumoto. - register uint32 *s = state; - register uint32 *r = state; - register int i = 1; - *s++ = seed & 0xffffffffUL; - for (; i < N; ++i ) - { - *s++ = ( 1812433253UL * ( *r ^ (*r >> 30) ) + i ) & 0xffffffffUL; - r++; - } -} - -inline void MTRand::reload() -{ - // Generate N new values in state - // Made clearer and faster by Matthew Bellew (matthew.bellew@home.com) - register uint32 *p = state; - register int i; - for (i = N - M; i--; ++p ) - *p = twist( p[M], p[0], p[1] ); - for (i = M; --i; ++p ) - *p = twist( p[M-N], p[0], p[1] ); - *p = twist( p[M-N], p[0], state[0] ); - - left = N, pNext = state; -} - -inline MTRand::uint32 MTRand::hash( time_t t, clock_t c ) -{ - // Get a uint32 from t and c - // Better than uint32(x) in case x is floating point in [0,1] - // Based on code by Lawrence Kirby (fred@genesis.demon.co.uk) - - static uint32 differ = 0; // guarantee time-based seeds will change - - uint32 h1 = 0; - unsigned char *p = (unsigned char *) &t; - for (size_t i = 0; i < sizeof(t); ++i ) - { - h1 *= UCHAR_MAX + 2U; - h1 += p[i]; - } - uint32 h2 = 0; - p = (unsigned char *) &c; - for (size_t j = 0; j < sizeof(c); ++j ) - { - h2 *= UCHAR_MAX + 2U; - h2 += p[j]; - } - return ( h1 + differ++ ) ^ h2; -} - -inline void MTRand::save( uint32* saveArray ) const -{ - register uint32 *sa = saveArray; - register const uint32 *s = state; - register int i = N; - for (; i--; *sa++ = *s++ ) {} - *sa = left; -} - -inline void MTRand::load( uint32 *const loadArray ) -{ - register uint32 *s = state; - register uint32 *la = loadArray; - register int i = N; - for (; i--; *s++ = *la++ ) {} - left = *la; - pNext = &state[N-left]; -} - -/* Trinity not use streams for random values output -inline std::ostream& operator<<( std::ostream& os, const MTRand& mtrand ) -{ - register const MTRand::uint32 *s = mtrand.state; - register int i = mtrand.N; - for (; i--; os << *s++ << "\t" ) {} - return os << mtrand.left; -} - -inline std::istream& operator>>( std::istream& is, MTRand& mtrand ) -{ - register MTRand::uint32 *s = mtrand.state; - register int i = mtrand.N; - for (; i--; is >> *s++ ) {} - is >> mtrand.left; - mtrand.pNext = &mtrand.state[mtrand.N-mtrand.left]; - return is; -} -*/ - -#endif // MERSENNETWISTER_H - -// Change log: -// -// v0.1 - First release on 15 May 2000 -// - Based on code by Makoto Matsumoto, Takuji Nishimura, and Shawn Cokus -// - Translated from C to C++ -// - Made completely ANSI compliant -// - Designed convenient interface for initialization, seeding, and -// obtaining numbers in default or user-defined ranges -// - Added automatic seeding from /dev/urandom or time() and clock() -// - Provided functions for saving and loading generator state -// -// v0.2 - Fixed bug which reloaded generator one step too late -// -// v0.3 - Switched to clearer, faster reload() code from Matthew Bellew -// -// v0.4 - Removed trailing newline in saved generator format to be consistent -// with output format of built-in types -// -// v0.5 - Improved portability by replacing static const int's with enum's and -// clarifying return values in seed(); suggested by Eric Heimburg -// - Removed MAXINT constant; use 0xffffffffUL instead -// -// v0.6 - Eliminated seed overflow when uint32 is larger than 32 bits -// - Changed integer [0,n] generator to give better uniformity -// -// v0.7 - Fixed operator precedence ambiguity in reload() -// - Added access for real numbers in (0,1) and (0,n) -// -// v0.8 - Included time.h header to properly support time_t and clock_t -// -// v1.0 - Revised seeding to match 26 Jan 2002 update of Nishimura and Matsumoto -// - Allowed for seeding with arrays of any length -// - Added access for real numbers in [0,1) with 53-bit resolution -// - Added access for real numbers from normal (Gaussian) distributions -// - Increased overall speed by optimizing twist() -// - Doubled speed of integer [0,n] generation -// - Fixed out-of-range number generation on 64-bit machines -// - Improved portability by substituting literal constants for long enum's -// - Changed license from GNU LGPL to BSD - diff --git a/doc/UnixInstall.txt b/doc/UnixInstall.txt index 8691e5cf559..71ee4282a7c 100644 --- a/doc/UnixInstall.txt +++ b/doc/UnixInstall.txt @@ -1,5 +1,5 @@ = TrinityCore -- Linux installation = -Copyright (C) 2008-2011 TrinityCore (http://www.trinitycore.org) +Copyright (C) 2008-2012 TrinityCore (http://www.trinitycore.org) ========================================================= WARNING: THIS DOCUMENTATION IS NOT ALWAYS UP TO DATE. diff --git a/revision.h.in.cmake b/revision.h.in.cmake index 9212b8060ef..b553bb2f26f 100644 --- a/revision.h.in.cmake +++ b/revision.h.in.cmake @@ -3,7 +3,7 @@ #define _HASH "@rev_hash@" #define _DATE "@rev_date@" #define VER_COMPANYNAME_STR "TrinityCore Developers" - #define VER_LEGALCOPYRIGHT_STR "(c)2008-2011 TrinityCore" + #define VER_LEGALCOPYRIGHT_STR "(c)2008-2012 TrinityCore" #define VER_FILEVERSION 0,0,0 #define VER_FILEVERSION_STR "@rev_date@ (@rev_hash@)" #define VER_PRODUCTVERSION VER_FILEVERSION diff --git a/sql/base/auth_database.sql b/sql/base/auth_database.sql index 2a86ad75166..9e894850fd7 100644 --- a/sql/base/auth_database.sql +++ b/sql/base/auth_database.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 5.5.19, for Win64 (x86) +-- MySQL dump 10.13 Distrib 5.5.22, for Win64 (x86) -- -- Host: localhost Database: auth -- ------------------------------------------------------ --- Server version 5.5.19 +-- Server version 5.5.22 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -23,27 +23,27 @@ DROP TABLE IF EXISTS `account`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `account` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Identifier', + `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Identifier', `username` varchar(32) NOT NULL DEFAULT '', `sha_pass_hash` varchar(40) NOT NULL DEFAULT '', - `sessionkey` longtext, - `v` longtext, - `s` longtext, - `email` text, + `sessionkey` varchar(80) NOT NULL DEFAULT '', + `v` varchar(64) NOT NULL DEFAULT '', + `s` varchar(64) NOT NULL DEFAULT '', + `email` varchar(254) NOT NULL DEFAULT '', `joindate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `last_ip` varchar(30) NOT NULL DEFAULT '127.0.0.1', - `failed_logins` int(11) unsigned NOT NULL DEFAULT '0', + `last_ip` varchar(15) NOT NULL DEFAULT '127.0.0.1', + `failed_logins` int(10) unsigned NOT NULL DEFAULT '0', `locked` tinyint(3) unsigned NOT NULL DEFAULT '0', `last_login` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `online` tinyint(4) NOT NULL DEFAULT '0', + `online` tinyint(3) unsigned NOT NULL DEFAULT '0', `expansion` tinyint(3) unsigned NOT NULL DEFAULT '2', - `mutetime` bigint(40) NOT NULL DEFAULT '0', + `mutetime` bigint(20) NOT NULL DEFAULT '0', `locale` tinyint(3) unsigned NOT NULL DEFAULT '0', - `os` varchar(4) NOT NULL DEFAULT '', - `recruiter` int(11) NOT NULL DEFAULT '0', + `os` varchar(3) NOT NULL DEFAULT '', + `recruiter` int(10) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `idx_username` (`username`) -) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Account System'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Account System'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -63,11 +63,11 @@ DROP TABLE IF EXISTS `account_access`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `account_access` ( - `id` int(11) unsigned NOT NULL, + `id` int(10) unsigned NOT NULL, `gmlevel` tinyint(3) unsigned NOT NULL, `RealmID` int(11) NOT NULL DEFAULT '-1', PRIMARY KEY (`id`,`RealmID`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -87,14 +87,14 @@ DROP TABLE IF EXISTS `account_banned`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `account_banned` ( - `id` int(11) NOT NULL DEFAULT '0' COMMENT 'Account id', - `bandate` bigint(40) NOT NULL DEFAULT '0', - `unbandate` bigint(40) NOT NULL DEFAULT '0', + `id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Account id', + `bandate` int(10) unsigned NOT NULL DEFAULT '0', + `unbandate` int(10) unsigned NOT NULL DEFAULT '0', `bannedby` varchar(50) NOT NULL, `banreason` varchar(255) NOT NULL, - `active` tinyint(4) NOT NULL DEFAULT '1', + `active` tinyint(3) unsigned NOT NULL DEFAULT '1', PRIMARY KEY (`id`,`bandate`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Ban List'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Ban List'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -114,13 +114,13 @@ DROP TABLE IF EXISTS `ip_banned`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `ip_banned` ( - `ip` varchar(32) NOT NULL DEFAULT '127.0.0.1', - `bandate` bigint(40) NOT NULL, - `unbandate` bigint(40) NOT NULL, + `ip` varchar(15) NOT NULL DEFAULT '127.0.0.1', + `bandate` int(10) unsigned NOT NULL, + `unbandate` int(10) unsigned NOT NULL, `bannedby` varchar(50) NOT NULL DEFAULT '[Console]', `banreason` varchar(255) NOT NULL DEFAULT 'no reason', PRIMARY KEY (`ip`,`bandate`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Banned IPs'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Banned IPs'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -140,11 +140,11 @@ DROP TABLE IF EXISTS `logs`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `logs` ( - `time` int(14) NOT NULL, - `realm` int(4) NOT NULL, - `type` int(4) NOT NULL, - `string` text -) ENGINE=MyISAM DEFAULT CHARSET=latin1; + `time` int(10) unsigned NOT NULL, + `realm` int(10) unsigned NOT NULL, + `type` tinyint(3) unsigned NOT NULL, + `string` text CHARACTER SET latin1 +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -164,12 +164,12 @@ DROP TABLE IF EXISTS `realmcharacters`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `realmcharacters` ( - `realmid` int(11) unsigned NOT NULL DEFAULT '0', - `acctid` bigint(20) unsigned NOT NULL, + `realmid` int(10) unsigned NOT NULL DEFAULT '0', + `acctid` int(10) unsigned NOT NULL, `numchars` tinyint(3) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`realmid`,`acctid`), KEY `acctid` (`acctid`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Realm Character Tracker'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Realm Character Tracker'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -189,19 +189,19 @@ DROP TABLE IF EXISTS `realmlist`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `realmlist` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(32) NOT NULL DEFAULT '', - `address` varchar(32) NOT NULL DEFAULT '127.0.0.1', - `port` int(11) NOT NULL DEFAULT '8085', + `address` varchar(255) NOT NULL DEFAULT '127.0.0.1', + `port` smallint(5) unsigned NOT NULL DEFAULT '8085', `icon` tinyint(3) unsigned NOT NULL DEFAULT '0', - `color` tinyint(3) unsigned NOT NULL DEFAULT '2', + `flag` tinyint(3) unsigned NOT NULL DEFAULT '2', `timezone` tinyint(3) unsigned NOT NULL DEFAULT '0', `allowedSecurityLevel` tinyint(3) unsigned NOT NULL DEFAULT '0', `population` float unsigned NOT NULL DEFAULT '0', - `gamebuild` int(11) unsigned NOT NULL DEFAULT '14545', + `gamebuild` int(10) unsigned NOT NULL DEFAULT '14545', PRIMARY KEY (`id`), UNIQUE KEY `idx_name` (`name`) -) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Realm System'; +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='Realm System'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -223,14 +223,13 @@ DROP TABLE IF EXISTS `uptime`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `uptime` ( - `realmid` int(11) unsigned NOT NULL, - `starttime` bigint(20) unsigned NOT NULL DEFAULT '0', - `startstring` varchar(64) NOT NULL DEFAULT '', - `uptime` bigint(20) unsigned NOT NULL DEFAULT '0', + `realmid` int(10) unsigned NOT NULL, + `starttime` int(10) unsigned NOT NULL DEFAULT '0', + `uptime` int(10) unsigned NOT NULL DEFAULT '0', `maxplayers` smallint(5) unsigned NOT NULL DEFAULT '0', `revision` varchar(255) NOT NULL DEFAULT 'Trinitycore', PRIMARY KEY (`realmid`,`starttime`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Uptime system'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Uptime system'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -251,4 +250,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2012-02-19 13:18:35 +-- Dump completed on 2012-03-28 18:26:06 diff --git a/sql/base/characters_database.sql b/sql/base/characters_database.sql index 5f4b90d9f17..6820bdee1c0 100644 --- a/sql/base/characters_database.sql +++ b/sql/base/characters_database.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 5.5.9, for Win64 (x86) +-- MySQL dump 10.13 Distrib 5.5.21, for Win64 (x86) -- -- Host: localhost Database: characters -- ------------------------------------------------------ --- Server version 5.5.9 +-- Server version 5.5.21 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -1924,6 +1924,8 @@ CREATE TABLE `lag_reports` ( `posX` float NOT NULL DEFAULT '0', `posY` float NOT NULL DEFAULT '0', `posZ` float NOT NULL DEFAULT '0', + `latency` int(10) unsigned NOT NULL DEFAULT '0', + `createTime` int(10) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`reportId`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Player System'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -2262,3 +2264,5 @@ UNLOCK TABLES; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2012-03-25 21:14:19 diff --git a/sql/old/3.3.5a/2012_02_13_00_world_version.sql b/sql/old/3.3.5a/2012_02_13_00_world_version.sql new file mode 100644 index 00000000000..2dd7ab92ddb --- /dev/null +++ b/sql/old/3.3.5a/2012_02_13_00_world_version.sql @@ -0,0 +1 @@ +UPDATE `version` SET `db_version`='TDB 335.11.46' LIMIT 1; diff --git a/sql/old/3.3.5a/2012_02_14_00_world_achievement_criteria_data.sql b/sql/old/3.3.5a/2012_02_14_00_world_achievement_criteria_data.sql new file mode 100644 index 00000000000..e7993726132 --- /dev/null +++ b/sql/old/3.3.5a/2012_02_14_00_world_achievement_criteria_data.sql @@ -0,0 +1,7 @@ +-- Criteria conditions for Once Bitten, Twice Shy achievement +DELETE FROM `achievement_criteria_data` WHERE `type`=12 AND `criteria_id` IN (13013, 13012, 13011, 12780); +INSERT INTO `achievement_criteria_data` (`criteria_id`,`type`,`value1`,`value2`,`scriptname`) VALUES +(13013, 12, 1, 0, ""), -- heroic +(13012, 12, 1, 0, ""), -- heroic +(13011, 12, 0, 0, ""), -- normal +(12780, 12, 0, 0, ""); -- normal diff --git a/sql/old/3.3.5a/2012_02_15_00_world_quest_template.sql b/sql/old/3.3.5a/2012_02_15_00_world_quest_template.sql new file mode 100644 index 00000000000..e26f52fd0fe --- /dev/null +++ b/sql/old/3.3.5a/2012_02_15_00_world_quest_template.sql @@ -0,0 +1 @@ +UPDATE `quest_template` SET `OfferRewardText` = 'Good, $C. You have done well in serving the Dark Lady. Your continued perseverance and ambition will be of great use to the Lady''s subjects. Return to me again in the future. Perhaps I will have other tasks for you that will aid the Dark Lady in her attempts at overtaking the Lich King and completely freeing the Scourge.', `RequestItemsText` = 'There are a hundred other tasks awaiting my attention, $C. Do you have the books?' WHERE `Id` = 14356; diff --git a/sql/old/3.3.5a/2012_02_15_01_world_areatrigger_tavern.sql b/sql/old/3.3.5a/2012_02_15_01_world_areatrigger_tavern.sql new file mode 100644 index 00000000000..1c3d45dc490 --- /dev/null +++ b/sql/old/3.3.5a/2012_02_15_01_world_areatrigger_tavern.sql @@ -0,0 +1,13 @@ +DELETE FROM `areatrigger_tavern` WHERE `id` IN (98, 4109, 4300, 4378, 4380, 4498, 4608, 5314, 5315, 5316, 5317); +INSERT INTO `areatrigger_tavern` (`id`, `name`) VALUES +(98, 'Nesingwary''s Expedition'), +(4109, 'Tranquillen - Upper level Inn'), +(4300, 'Cenarion Refugee - Outside Inn'), +(4378, 'Stonebreaker Hold Inn'), +(4380, 'Falcon Watch Inn'), +(4498, 'Old Hillsbrad Foothills Inn'), +(4608, 'Sanctum Of The Stars - Upper level Inn'), +(5314, 'Wyrmrest Temple'), +(5315, 'Wyrmrest Temple'), +(5316, 'Wyrmrest Temple'), +(5317, 'Wyrmrest Temple'); diff --git a/sql/old/3.3.5a/2012_02_15_02_world_item_template.sql b/sql/old/3.3.5a/2012_02_15_02_world_item_template.sql new file mode 100644 index 00000000000..463d43368cd --- /dev/null +++ b/sql/old/3.3.5a/2012_02_15_02_world_item_template.sql @@ -0,0 +1,3 @@ +DELETE FROM `item_template` WHERE `entry`=49867; +INSERT INTO `item_template` (`entry`, `class`, `subclass`, `unk0`, `name`, `displayid`, `Quality`, `Flags`, `FlagsExtra`, `BuyCount`, `BuyPrice`, `SellPrice`, `InventoryType`, `AllowableClass`, `AllowableRace`, `ItemLevel`, `RequiredLevel`, `RequiredSkill`, `RequiredSkillRank`, `requiredspell`, `requiredhonorrank`, `RequiredCityRank`, `RequiredReputationFaction`, `RequiredReputationRank`, `maxcount`, `stackable`, `ContainerSlots`, `StatsCount`, `stat_type1`, `stat_value1`, `stat_type2`, `stat_value2`, `stat_type3`, `stat_value3`, `stat_type4`, `stat_value4`, `stat_type5`, `stat_value5`, `stat_type6`, `stat_value6`, `stat_type7`, `stat_value7`, `stat_type8`, `stat_value8`, `stat_type9`, `stat_value9`, `stat_type10`, `stat_value10`, `ScalingStatDistribution`, `ScalingStatValue`, `dmg_min1`, `dmg_max1`, `dmg_type1`, `dmg_min2`, `dmg_max2`, `dmg_type2`, `armor`, `holy_res`, `fire_res`, `nature_res`, `frost_res`, `shadow_res`, `arcane_res`, `delay`, `ammo_type`, `RangedModRange`, `spellid_1`, `spelltrigger_1`, `spellcharges_1`, `spellppmRate_1`, `spellcooldown_1`, `spellcategory_1`, `spellcategorycooldown_1`, `spellid_2`, `spelltrigger_2`, `spellcharges_2`, `spellppmRate_2`, `spellcooldown_2`, `spellcategory_2`, `spellcategorycooldown_2`, `spellid_3`, `spelltrigger_3`, `spellcharges_3`, `spellppmRate_3`, `spellcooldown_3`, `spellcategory_3`, `spellcategorycooldown_3`, `spellid_4`, `spelltrigger_4`, `spellcharges_4`, `spellppmRate_4`, `spellcooldown_4`, `spellcategory_4`, `spellcategorycooldown_4`, `spellid_5`, `spelltrigger_5`, `spellcharges_5`, `spellppmRate_5`, `spellcooldown_5`, `spellcategory_5`, `spellcategorycooldown_5`, `bonding`, `description`, `PageText`, `LanguageID`, `PageMaterial`, `startquest`, `lockid`, `Material`, `sheath`, `RandomProperty`, `RandomSuffix`, `block`, `itemset`, `MaxDurability`, `area`, `Map`, `BagFamily`, `TotemCategory`, `socketColor_1`, `socketContent_1`, `socketColor_2`, `socketContent_2`, `socketColor_3`, `socketContent_3`, `socketBonus`, `GemProperties`, `RequiredDisenchantSkill`, `ArmorDamageModifier`, `Duration`, `ItemLimitCategory`, `HolidayId`, `ScriptName`, `DisenchantID`, `FoodType`, `minMoneyLoot`, `maxMoneyLoot`, `WDBVerified`) VALUES +(49867, 12, 0, -1, 'Crown Chemical Co. Supplies', 11448, 1, 0, 8192, 1, 0, 0, 0, -1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1000, 0, 0, 0, 0, NULL, 0, -1, 0, -1, 0, 0, NULL, 0, -1, 0, -1, 0, 0, NULL, 0, -1, 0, -1, 0, 0, NULL, 0, -1, 0, -1, 0, 0, NULL, 0, -1, 0, -1, 4, 'You can hear the clink of glass... dont drop it!', 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 423, 0, 0, 0, 0, 14545); diff --git a/sql/old/3.3.5a/2012_02_15_03_world_quest_template.sql b/sql/old/3.3.5a/2012_02_15_03_world_quest_template.sql new file mode 100644 index 00000000000..833d36b246c --- /dev/null +++ b/sql/old/3.3.5a/2012_02_15_03_world_quest_template.sql @@ -0,0 +1,18 @@ +-- Love is in the Air +-- Quests Missing Text ... By Albis + +UPDATE `quest_template` SET `RequestItemsText` ='The cologne isn''t going to give itself out, you know.$B$BGet spraying!' , `OfferRewardText` ='Nice work, $N! People will be buying Crown colognes by the crate-load now that they''ve had a chance to try them.$B$BHere''s a little something for helping us out.' WHERE `Id` = 24635; +UPDATE `quest_template` SET `RequestItemsText` ='That perfume''s not going to spray itself, you know.$B$BGet going!' , `OfferRewardText` ='Great work, $N! People will come running to buy Crown perfumes now that they''ve had a chance to sample their wonders.$B$BHere''s a little something for helping us out.' WHERE `Id` = 24629; +UPDATE `quest_template` SET `RequestItemsText` ='You know, those chocolates aren''t going to fling themselves at people.$B$BYou need to get to work!' , `OfferRewardText` ='Lovely work, $N! People will be tripping over one another to get Crown chocolates now that they''ve had a chance to taste those sweet, romantic treats.$B$BHere''s a little something for helping us out.' WHERE `Id` = 24636; +UPDATE `quest_template` SET `OfferRewardText` ='Hey. You got some time on your hands? I could use someone like you.' WHERE `Id` IN (24804,24805); +UPDATE `quest_template` SET `RequestItemsText` ='You analyze that reek yet, kid?' , `OfferRewardText` ='Hey, thanks, kid. Give it over, let''s take a look.$B$B$B$BOh, that ain''t good.' WHERE `Id` IN (24655,24536); +UPDATE `quest_template` SET `RequestItemsText` ='Did they toss ya a crate to deliver?' , `OfferRewardText` ='You got it, huh? Good job, kid. Top notch. Let''s see what we what we got here.$B$B$B$BThat''s not like my Snivel, but what choice is there?' WHERE `Id` = 24848; +UPDATE `quest_template` SET `OfferRewardText` ='You''re not Snivel. He was supposed to be here an hour ago! What have you done with him?$B$B$B$BThis isn''t like my Snivel. Do you think something''s happened to him?' WHERE `Id` = 24850; +UPDATE `quest_template` SET `RequestItemsText` ='Who are you?' , `OfferRewardText` ='All he talked about was leaving town with all his money? Then he really has abandoned me, hasn''t he?$B$BOh, $N. I was such a fool to fall for him, but how could I help myself? He was so irresistible!' WHERE `Id` = 24849; +UPDATE `quest_template` SET `RequestItemsText` ='Who are you?' , `OfferRewardText` ='All he talked about was leaving town with all his money? Then he really has abandoned me, hasn''t he?$B$BI can''t believe I fell for such a horrible goblin! But he was so irresistible when we first met.' WHERE `Id` = 24851; +UPDATE `quest_template` SET `RequestItemsText` ='Did you find the guy, or did he crawl under a rock?' , `OfferRewardText` ='You got his ledger? Really? That''s great, $N. There''s probably loads of good information in here.' WHERE `Id` IN (24657,24576); +UPDATE `quest_template` SET `OfferRewardText` ='Fantastic. Help is exactly what I need.' WHERE `Id` IN (24792,24793); +UPDATE `quest_template` SET `RequestItemsText` ='I don''t remember ordering a cleaing service... why yes, I am Apothecary Hummel.$B$B...wait, what is the meaning of this? You think these meaningless papers can stop me? Hah!' , `OfferRewardText` ='What we do here is none of your business...' WHERE `Id` = 11488; +UPDATE `quest_template` SET `RequestItemsText` ='Did you take care of those no-good scheming villains?' , `OfferRewardText` ='What''ve you got there?$B$BOh hey, this is big. Real big. Most of the crazy details in one little package. Thanks - you really helped us reel this all in. Good working with ya.' WHERE `Id` IN (24745,14483); +UPDATE `quest_template` SET `RequestItemsText` ='Did you teach ''em a lesson?' , `OfferRewardText` ='Good job, kid. You deserve a little somethin''. And hey, come back tomorrow if you get the time; I might have a job for ya.' WHERE `Id` IN (24658,24665,24666,24664,24663,24659,24660,24662,24647,24638,24651,24652,24650,24649,24645,24648); diff --git a/sql/old/3.3.5a/2012_02_15_04_world_quest_template.sql b/sql/old/3.3.5a/2012_02_15_04_world_quest_template.sql new file mode 100644 index 00000000000..8b6ad1d2cf9 --- /dev/null +++ b/sql/old/3.3.5a/2012_02_15_04_world_quest_template.sql @@ -0,0 +1,17 @@ +-- Horde +UPDATE `quest_template` SET `PrevQuestId`=24805 WHERE `Id`=24536; -- Uncommon Scents completed before starting Something Stinks +UPDATE `quest_template` SET `PrevQuestId`=24536 WHERE `Id`=24541; -- Something Stinks completed before starting Pilfering Perfume +UPDATE `quest_template` SET `PrevQuestId`=24541 WHERE `Id`=24850; -- Pilfering Perfume completed before starting Snivel's Sweetheart +UPDATE `quest_template` SET `PrevQuestId`=24850 WHERE `Id`=24851; -- Snivel's Sweetheart completed before starting Hot On The Trail +UPDATE `quest_template` SET `PrevQuestId`=24851 WHERE `Id`=24576; -- Hot On The Trail completed before starting A Friendly Chat... + +UPDATE `quest_template` SET `PrevQuestId`=24576 WHERE `Id` IN (24638,24645,24647,24648,24649,24650,24651,24652); -- A Friendly Chat... completed before starting Crushing the Crown + +-- Alliance +UPDATE `quest_template` SET `PrevQuestId`=24804 WHERE `Id`=24655; -- Uncommon Scents completed before starting Something Stinks +UPDATE `quest_template` SET `PrevQuestId`=24655 WHERE `Id`=24656; -- Something Stinks completed before starting Pilfering Perfume +UPDATE `quest_template` SET `PrevQuestId`=24656 WHERE `Id`=24848; -- Pilfering Perfume completed before starting Snivel's Sweetheart +UPDATE `quest_template` SET `PrevQuestId`=24848 WHERE `Id`=24849; -- Snivel's Sweetheart completed before starting Hot On The Trail +UPDATE `quest_template` SET `PrevQuestId`=24849 WHERE `Id`=24657; -- Hot On The Trail completed before starting A Friendly Chat... + +UPDATE `quest_template` SET `PrevQuestId`=24657 WHERE `Id` IN (24658,24659,24660,24662,24663,24664,24665,24666); -- A Friendly Chat... completed before starting Crushing the Crown diff --git a/sql/old/3.3.5a/2012_02_15_06_world_creature_involvedrelation.sql b/sql/old/3.3.5a/2012_02_15_06_world_creature_involvedrelation.sql new file mode 100644 index 00000000000..431e23b53b8 --- /dev/null +++ b/sql/old/3.3.5a/2012_02_15_06_world_creature_involvedrelation.sql @@ -0,0 +1,3 @@ +DELETE FROM `creature_involvedrelation` WHERE `quest`=24745; +INSERT INTO `creature_involvedrelation` (`id`, `quest`) VALUES +(38066, 24745); -- A - Something is in the Air (and it Ain't Love) - Inspector Snip Snagglebolt diff --git a/sql/old/3.3.5a/2012_02_15_07_00_world_creature.sql b/sql/old/3.3.5a/2012_02_15_07_00_world_creature.sql new file mode 100644 index 00000000000..75beec97d67 --- /dev/null +++ b/sql/old/3.3.5a/2012_02_15_07_00_world_creature.sql @@ -0,0 +1,57 @@ +SET @GUID := 40489; +SET @NPC :=3254; + +DELETE FROM `creature` WHERE `guid` BETWEEN @GUID AND @GUID+7; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES +(@GUID ,@NPC,1,1,1,0,0, 10.3997021, -2316.43555, 92.1945343, 2.91896486,120,0,0,1,0,0,0,0,0), +(@GUID+1,@NPC,1,1,1,0,0,346.736572 , -2606.38916, 91.7916641, 1.58010352,120,0,0,1,0,0,0,0,0), +(@GUID+2,@NPC,1,1,1,0,0, 83.07206 , -2545.2085 , 98.107666 , 1.86412442,120,0,0,1,0,0,0,0,0), +(@GUID+3,@NPC,1,1,1,0,0,-93.53362 , -2287.0835 , 92.35358 , 0.8518014 ,120,0,0,1,0,0,0,0,0), +(@GUID+4,@NPC,1,1,1,0,0,-618.9995,-2738.234,91.91664,4.303216,120,0,0,1,0,0,0,0,0), +(@GUID+5,@NPC,1,1,1,0,0,-491.2982,-2473.443,93.66666,2.670027,120,0,0,1,0,0,0,0,0), +(@GUID+6,@NPC,1,1,1,0,0,-614.9523,-2721.66 ,93.85735,1.412064,120,0,0,1,0,0,0,0,0), +(@GUID+7,@NPC,1,1,1,0,0,-617.4864,-2710.463,96.7657 ,1.582084,120,0,0,1,0,0,0,0,0); + +SET @NPC1=@GUID*10; +SET @NPC2=(@GUID+1)*10; +SET @NPC3=(@GUID+2)*10; +SET @NPC4=(@GUID+3)*10; +SET @NPC5=(@GUID+6)*10; +SET @NPC6=(@GUID+7)*10; + +DELETE FROM `waypoint_data` WHERE `id` IN (@NPC1,@NPC2,@NPC3,@NPC4,@NPC5,@NPC6); +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +-- 1st +(@NPC1,1,6.336712,-2322.309,92.16663,0,0,0,0,100,0), +-- 2nd +(@NPC2,1,346.4289,-2573.332,91.79166,0,0,0,0,100,0), +-- 3rd +(@NPC3,1,81.53384,-2540.826,97.38716,0,0,0,0,100,0), +(@NPC3,2,80.28384,-2537.076,96.63716,0,0,0,0,100,0), +(@NPC3,3,79.03384,-2533.326,95.38716,0,0,0,0,100,0), +(@NPC3,4,78.28384,-2530.326,94.63716,0,0,0,0,100,0), +(@NPC3,5,77.03384,-2526.576,93.63716,0,0,0,0,100,0), +(@NPC3,6,76.49564,-2523.443,93.66665,0,0,0,0,100,0), +-- 4th +(@NPC4,1,-88.46167,-2281.137,92.69763,0,0,0,0,100,0), +(@NPC4,2,-92.46167,-2285.637,91.94763,0,0,0,0,100,0), +-- 5th +(@NPC5,1,-614.9318,-2720.435,94.01199,0,0,0,0,100,0), +-- 6th +(@NPC6,1,-617.2921,-2722.99,93.41664,0,0,0,0,100,0), +(@NPC6,2,-617.3077,-2721.99,93.41664,0,0,0,0,100,0), +(@NPC6,3,-617.3398,-2719.99,94.16664,0,0,0,0,100,0), +(@NPC6,4,-617.3867,-2716.99,95.04164,0,0,0,0,100,0), +(@NPC6,5,-617.4336,-2713.99,95.91664,0,0,0,0,100,0), +(@NPC6,6,-617.4805,-2710.99,96.66664,0,0,0,0,100,0), +(@NPC6,7,-617.503,-2708.995,97.04164,0,0,0,0,100,0), +(@NPC6,8,-617.503,-2708.995,97.04164,0,0,0,0,100,0); + +DELETE FROM `creature_addon` WHERE `guid` IN (@GUID,@GUID+1,@GUID+2,@GUID+3,@GUID+6,@GUID+7); +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(@GUID ,@NPC1,0,0,0,0,''), +(@GUID+1,@NPC2,0,0,0,0,''), +(@GUID+2,@NPC3,0,0,0,0,''), +(@GUID+3,@NPC4,0,0,0,0,''), +(@GUID+6,@NPC5,0,0,0,0,''), +(@GUID+7,@NPC6,0,0,0,0,''); diff --git a/sql/old/3.3.5a/2012_02_15_07_01_world_waypoint_data.sql b/sql/old/3.3.5a/2012_02_15_07_01_world_waypoint_data.sql new file mode 100644 index 00000000000..e47572b2074 --- /dev/null +++ b/sql/old/3.3.5a/2012_02_15_07_01_world_waypoint_data.sql @@ -0,0 +1,147 @@ +SET @NPC := 26841; +SET @GUID := 40497; -- need 9 + +SET @SPAWN0 := (@GUID )*10; +SET @SPAWN1 := (@GUID+1)*10; +SET @SPAWN2 := (@GUID+2)*10; +SET @SPAWN3 := (@GUID+3)*10; +SET @SPAWN4 := (@GUID+4)*10; +SET @SPAWN5 := (@GUID+5)*10; +SET @SPAWN6 := (@GUID+6)*10; +SET @SPAWN7 := (@GUID+7)*10; +SET @SPAWN8 := (@GUID+8)*10; + +DELETE FROM `creature` WHERE `guid` BETWEEN @GUID AND @GUID+8; +INSERT INTO creature (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES +(@GUID ,@NPC,571,1,1,0,0,4690.292,859.291,154.1271,2.914072,120,0,0,1,0,0,0,0,0), +(@GUID+1,@NPC,571,1,1,0,0,4362.418,750.5102,123.7846,6.194367,120,0,0,1,0,0,0,0,0), +(@GUID+2,@NPC,571,1,1,0,0,4191.03,645.8215,109.6868,0.4027403,120,0,0,1,0,0,0,0,0), +(@GUID+3,@NPC,571,1,1,0,0,4098.345,657.0866,99.36436,5.185792,120,0,0,1,0,0,0,0,0), +(@GUID+4,@NPC,571,1,1,0,0,4065.753,709.2308,108.47,1.153499,120,0,0,1,0,0,0,0,0), +(@GUID+5,@NPC,571,1,1,0,0,4012.895,495.4877,82.1595,0.8684024,120,0,0,1,0,0,0,0,0), +(@GUID+6,@NPC,571,1,1,0,0,3941.605,552.9745,144.0994,0.06546114,120,0,0,1,0,0,0,0,0), +(@GUID+7,@NPC,571,1,1,0,0,3995.586,447.6094,88.55691,1.320955,120,0,0,1,0,0,0,0,0), +(@GUID+8,@NPC,571,1,1,0,0,3869.004,707.384,134.3378,4.695541,120,0,0,1,0,0,0,0,0); + +DELETE FROM `creature_addon` WHERE `guid` BETWEEN @GUID AND @GUID+8; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(@GUID ,@SPAWN0,0,0,0,0,''), +(@GUID+1,@SPAWN1,0,0,0,0,''), +(@GUID+2,@SPAWN2,0,0,0,0,''), +(@GUID+3,@SPAWN3,0,0,0,0,''), +(@GUID+4,@SPAWN4,0,0,0,0,''), +(@GUID+5,@SPAWN5,0,0,0,0,''), +(@GUID+6,@SPAWN6,0,0,0,0,''), +(@GUID+7,@SPAWN7,0,0,0,0,''), +(@GUID+8,@SPAWN8,0,0,0,0,''); + +DELETE FROM `waypoint_data` WHERE `id` IN (@SPAWN0,@SPAWN1,@SPAWN2,@SPAWN3,@SPAWN4,@SPAWN5,@SPAWN6,@SPAWN7,@SPAWN8); +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +-- 1st +(@SPAWN0,0,4716.777,833.6211,169.0006,0,0,0,0,100,0), +(@SPAWN0,1,4643.756,855.9798,132.5562,0,0,0,0,100,0), +(@SPAWN0,2,4550.864,812.4362,133.6673,0,0,0,0,100,0), +(@SPAWN0,3,4532.678,762.772,130.1951,0,0,0,0,100,0), +(@SPAWN0,4,4566.182,662.6984,132.7506,0,0,0,0,100,0), +(@SPAWN0,5,4592.511,595.6938,130.1674,0,0,0,0,100,0), +(@SPAWN0,6,4732.632,631.5569,164.584,0,0,0,0,100,0), +(@SPAWN0,7,4716.777,833.6211,169.0006,0,0,0,0,100,0), +(@SPAWN0,8,4643.756,855.9798,132.5562,0,0,0,0,100,0), +(@SPAWN0,9,4550.864,812.4362,133.6673,0,0,0,0,100,0), +-- 2nd +(@SPAWN1,0,4431.805,596.8371,157.1775,0,0,0,0,100,0), +(@SPAWN1,1,4128.16,507.4055,198.8118,0,0,0,0,100,0), +(@SPAWN1,2,4102.405,567.1112,198.8118,0,0,0,0,100,0), +(@SPAWN1,3,4112.486,636.6321,86.95068,0,0,0,0,100,0), +(@SPAWN1,4,4141.771,704.1605,67.97847,0,0,0,0,100,0), +(@SPAWN1,5,4191.388,726.6014,98.11736,0,0,0,0,100,0), +(@SPAWN1,6,4247.502,724.9836,182.4229,0,0,0,0,100,0), +(@SPAWN1,7,4295.807,746.8245,210.1174,0,0,0,0,100,0), +(@SPAWN1,8,4387.15,744.5955,93.08962,0,0,0,0,100,0), +(@SPAWN1,9,4428.509,680.8868,91.33962,0,0,0,0,100,0), +(@SPAWN1,10,4431.805,596.8371,157.1775,0,0,0,0,100,0), +(@SPAWN1,11,4128.16,507.4055,198.8118,0,0,0,0,100,0), +(@SPAWN1,12,4102.405,567.1112,198.8118,0,0,0,0,100,0), +-- 3rd +(@SPAWN2,0,4170.111,627.0887,100.283,0,0,0,0,100,0), +(@SPAWN2,1,4265.816,644.1154,136.2274,0,0,0,0,100,0), +(@SPAWN2,2,4272.799,551.5093,50.92185,0,0,0,0,100,0), +(@SPAWN2,3,4378.531,451.3199,54.28299,0,0,0,0,100,0), +(@SPAWN2,4,4277.019,345.219,121.2274,0,0,0,0,100,0), +(@SPAWN2,5,4185.893,458.5754,118.5608,0,0,0,0,100,0), +(@SPAWN2,6,4170.111,627.0887,100.283,0,0,0,0,100,0), +(@SPAWN2,7,4265.816,644.1154,136.2274,0,0,0,0,100,0), +(@SPAWN2,8,4272.799,551.5093,50.92185,0,0,0,0,100,0), +-- 4th +(@SPAWN3,0,4464.15,712.9612,99.36437,0,0,0,0,100,0), +(@SPAWN3,1,4466.412,769.1019,99.36437,0,0,0,0,100,0), +(@SPAWN3,2,4427.949,785.3342,99.36437,0,0,0,0,100,0), +(@SPAWN3,3,4382.415,794.0613,99.36437,0,0,0,0,100,0), +(@SPAWN3,4,4312.128,808.5213,99.36437,0,0,0,0,100,0), +(@SPAWN3,5,4206.404,817.2534,99.36437,0,0,0,0,100,0), +(@SPAWN3,6,4089.363,771.5425,99.36437,0,0,0,0,100,0), +(@SPAWN3,7,4114.452,637.4808,99.36437,0,0,0,0,100,0), +(@SPAWN3,8,4265.095,661.3358,99.36437,0,0,0,0,100,0), +(@SPAWN3,9,4366.876,678.4272,99.36437,0,0,0,0,100,0), +(@SPAWN3,10,4433.122,674.1555,99.36437,0,0,0,0,100,0), +(@SPAWN3,11,4464.15,712.9612,99.36437,0,0,0,0,100,0), +(@SPAWN3,12,4466.412,769.1019,99.36437,0,0,0,0,100,0), +(@SPAWN3,13,4427.949,785.3342,99.36437,0,0,0,0,100,0), +-- 5th +(@SPAWN4,0,4331.604,778.9,114.7446,0,0,0,0,100,0), +(@SPAWN4,1,4270.823,698.3784,130.4668,0,0,0,0,100,0), +(@SPAWN4,2,4232.598,681.8058,126.7724,0,0,0,0,100,0), +(@SPAWN4,3,4156.661,638.471,129.439,0,0,0,0,100,0), +(@SPAWN4,4,4062.89,681.9251,102.9113,0,0,0,0,100,0), +(@SPAWN4,5,4096.761,758.9566,123.5501,0,0,0,0,100,0), +(@SPAWN4,6,4134.598,799.989,109.8835,0,0,0,0,100,0), +(@SPAWN4,7,4189.475,840.5444,114.6335,0,0,0,0,100,0), +(@SPAWN4,8,4274.875,812.3191,101.3001,0,0,0,0,100,0), +(@SPAWN4,9,4331.604,778.9,114.7446,0,0,0,0,100,0), +(@SPAWN4,10,4270.823,698.3784,130.4668,0,0,0,0,100,0), +(@SPAWN4,11,4232.598,681.8058,126.7724,0,0,0,0,100,0), +-- 6th +(@SPAWN5,0,3769.598,454.0081,82.1595,0,0,0,0,100,0), +(@SPAWN5,1,3879.825,441.5815,82.1595,0,0,0,0,100,0), +(@SPAWN5,2,3926.388,447.295,82.1595,0,0,0,0,100,0), +(@SPAWN5,3,4017.082,501.3171,82.1595,0,0,0,0,100,0), +(@SPAWN5,4,4015.132,597.8423,82.1595,0,0,0,0,100,0), +(@SPAWN5,5,3923.788,576.8113,82.1595,0,0,0,0,100,0), +(@SPAWN5,6,3865.991,561.2335,82.1595,0,0,0,0,100,0), +(@SPAWN5,7,3795.942,538.189,82.1595,0,0,0,0,100,0), +(@SPAWN5,8,3769.598,454.0081,82.1595,0,0,0,0,100,0), +(@SPAWN5,9,3879.825,441.5815,82.1595,0,0,0,0,100,0), +(@SPAWN5,10,3926.388,447.295,82.1595,0,0,0,0,100,0), +-- 7th +(@SPAWN6,0,3886.876,810.7806,134.3378,0,0,0,0,100,0), +(@SPAWN6,1,3868.72,688.4549,134.3378,0,0,0,0,100,0), +(@SPAWN6,2,3883.254,607.1956,134.3378,0,0,0,0,100,0), +(@SPAWN6,3,3904.998,559.2425,134.3378,0,0,0,0,100,0), +(@SPAWN6,4,3969.396,561.8792,148.5877,0,0,0,0,100,0), +(@SPAWN6,5,4010.678,638.0726,130.6155,0,0,0,0,100,0), +(@SPAWN6,6,3976.813,756.3585,134.3378,0,0,0,0,100,0), +(@SPAWN6,7,3886.876,810.7806,134.3378,0,0,0,0,100,0), +(@SPAWN6,8,3868.72,688.4549,134.3378,0,0,0,0,100,0), +(@SPAWN6,9,3883.254,607.1956,134.3378,0,0,0,0,100,0), +-- 8th +(@SPAWN7,0,4187.318,438.9777,88.55692,0,0,0,0,100,0), +(@SPAWN7,1,4151.397,351.4095,88.55692,0,0,0,0,100,0), +(@SPAWN7,2,4106.679,347.3126,88.55692,0,0,0,0,100,0), +(@SPAWN7,3,4056.414,373.3088,88.55692,0,0,0,0,100,0), +(@SPAWN7,4,3994.193,440.1974,88.55692,0,0,0,0,100,0), +(@SPAWN7,5,4076.892,564.8895,88.55692,0,0,0,0,100,0), +(@SPAWN7,6,4178.652,558.3406,88.55692,0,0,0,0,100,0), +(@SPAWN7,7,4187.318,438.9777,88.55692,0,0,0,0,100,0), +(@SPAWN7,8,4151.397,351.4095,88.55692,0,0,0,0,100,0), +(@SPAWN7,9,4106.679,347.3126,88.55692,0,0,0,0,100,0), +-- 9th +(@SPAWN8,0,3886.876,810.7806,134.3378,0,0,0,0,100,0), +(@SPAWN8,1,3868.72,688.4549,134.3378,0,0,0,0,100,0), +(@SPAWN8,2,3883.254,607.1956,134.3378,0,0,0,0,100,0), +(@SPAWN8,3,3904.998,559.2425,134.3378,0,0,0,0,100,0), +(@SPAWN8,4,3969.396,561.8792,148.5877,0,0,0,0,100,0), +(@SPAWN8,5,4010.678,638.0726,130.6155,0,0,0,0,100,0), +(@SPAWN8,6,3976.813,756.3585,134.3378,0,0,0,0,100,0), +(@SPAWN8,7,3886.876,810.7806,134.3378,0,0,0,0,100,0), +(@SPAWN8,8,3868.72,688.4549,134.3378,0,0,0,0,100,0), +(@SPAWN8,9,3883.254,607.1956,134.3378,0,0,0,0,100,0); diff --git a/sql/old/3.3.5a/2012_02_15_07_02_world_misc.sql b/sql/old/3.3.5a/2012_02_15_07_02_world_misc.sql new file mode 100644 index 00000000000..e7ffe54e922 --- /dev/null +++ b/sql/old/3.3.5a/2012_02_15_07_02_world_misc.sql @@ -0,0 +1,120 @@ +-- Love is in the Air +SET @OGUID := 24399; +SET @CGUID := 40506; +SET @OLDGUID := 40489; -- wrong guids +SET @EVENT := 8; + +-- Quest chain +DELETE FROM `creature_questrelation` WHERE `quest` IN (24804,24657,24656,24848,24849); +INSERT INTO `creature_questrelation` (`id`, `quest`) VALUES +(38293, 24804), -- A - Uncommon Scents - Junior Inspector +(38325, 24657), -- A - Friendly Chat... - Marion Sutton +(38066, 24656), -- A - Pilfering Perfume - Inspector Snip Snagglebolt +(38066, 24848), -- A - Fireworks At The Gilded Rose - Inspector Snip Snagglebolt +(38325, 24849); -- A - Hot On The Trail - Marion Sutton + +DELETE FROM `creature_involvedrelation` WHERE `quest` IN (24804,24657,24656,24848,24849); +INSERT INTO `creature_involvedrelation` (`id`, `quest`) VALUES +(38066, 24804), -- A - Uncommon Scents - Inspector Snip Snagglebolt +(38066, 24657), -- A - Friendly Chat... - Inspector Snip Snagglebolt +(38066, 24656), -- A - Pilfering Perfume - Inspector Snip Snagglebolt +(38325, 24848), -- A - Fireworks At The Gilded Rose - Marion Sutton +(38325, 24849); -- A - Hot On The Trail - Marion Sutton + +-- Loot: Crown Chemical Co. Supplies +DELETE FROM `gameobject_loot_template` WHERE `entry`=27766; +INSERT INTO `gameobject_loot_template` VALUES +(27766, 49867, -100, 1, 0, 1, 1); -- Crown Chemical Co. Supplies + +-- GO spawns +DELETE FROM `gameobject` WHERE `id` IN (181086,201752,201778) AND `guid` BETWEEN @OGUID+0 AND @OGUID+42; +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES +-- Valentine Arch +(@OGUID+0, 181086, 1, 1, 1, 9869.12, 2493.13, 1315.88, 6.16653, 0, 0, 0.0582931, -0.9983, 300, 0, 1), +(@OGUID+1, 181086, 530, 1, 1, -4004.66, -11844.5, 0.19541, 4.93701, 0, 0, 0.623403, -0.7819, 300, 0, 1), +(@OGUID+2, 181086, 0, 1, 1, -4918.78, -983.208, 501.455, 2.30465, 0, 0, 0.913711, 0.406364, 300, 0, 1), +(@OGUID+3, 181086, 0, 1, 1, -8869.51, 636.686, 95.7873, 0.794388, 0, 0, 0.386832, 0.92215, 300, 0, 1), +(@OGUID+4, 181086, 1, 1, 1, 1653.44, -4437.37, 18.1863, 1.72627, 0, 0, 0.759883, 0.65006, 300, 0, 1), +(@OGUID+5, 181086, 1, 1, 1, -1224.34, 68.3642, 129.71, 3.17285, 0, 0, 0.999878, -0.015627, 300, 0, 1), +(@OGUID+6, 181086, 530, 1, 1, 9612.28, -7184.77, 14.285, 1.82938, 0, 0, 0.792374, 0.610036, 300, 0, 1), +(@OGUID+7, 181086, 0, 1, 1, 1629.62, 240.116, 63.8516, 0.155664, 0, 0, 0.0777534, 0.996973, 300, 0, 1), +-- Large Crate +(@OGUID+8, 201752, 0, 1, 1, -9029.77, 353.325, 92.923, 0.8808, 0, 0, 0.426301, 0.904581, 300, 0, 1), +(@OGUID+9, 201752, 0, 1, 1, -9029.87, 351.542, 92.9248, 0.489671, 0, 0, 0.242397, 0.970177, 300, 0, 1), +(@OGUID+10, 201752, 0, 1, 1, -9028.41, 352.69, 92.9163, 0.721364, 0, 0, 0.352912, 0.935656, 300, 0, 1), +(@OGUID+11, 201752, 0, 1, 1, -9027.7, 351.062, 92.9193, 0.689162, 0, 0, 0.337803, 0.941217, 300, 0, 1), +(@OGUID+12, 201752, 0, 1, 1, -9029.08, 349.917, 92.932, 0.657746, 0, 0, 0.322977, 0.946407, 300, 0, 1), +(@OGUID+13, 201752, 0, 1, 1, -9028.77, 352.62, 94.1596, 6.02202, 0, 0, 0.130214, -0.991486, 300, 0, 1), +(@OGUID+14, 201752, 0, 1, 1, -9028.84, 350.443, 94.1755, 0.771628, 0, 0, 0.376314, 0.926492, 300, 0, 1), +(@OGUID+15, 201752, 0, 1, 1, -9026.5, 348.864, 93.0359, 2.17356, 0, 0, 0.885134, 0.465337, 300, 0, 1), +(@OGUID+16, 201752, 0, 1, 1, -9028.21, 348.744, 93.024, 0.889436, 0, 0, 0.430203, 0.902732, 300, 0, 1), +(@OGUID+17, 201752, 1, 1, 1, 1381.97, -4431.17, 30.6588, 5.49617, 0, 0, 0.383432, -0.923569, 300, 0, 1), +(@OGUID+18, 201752, 1, 1, 1, 1380.98, -4432.28, 30.6586, 5.55507, 0, 0, 0.356069, -0.93446, 300, 0, 1), +(@OGUID+19, 201752, 1, 1, 1, 1379.73, -4433.4, 30.6569, 5.69644, 0, 0, 0.28918, -0.957275, 300, 0, 1), +(@OGUID+20, 201752, 1, 1, 1, 1377.96, -4432.16, 30.6489, 5.58649, 0, 0, 0.341345, -0.939938, 300, 0, 1), +(@OGUID+21, 201752, 1, 1, 1, 1379.23, -4431.41, 30.6768, 5.559, 0, 0, 0.354231, -0.935158, 300, 0, 1), +(@OGUID+22, 201752, 1, 1, 1, 1379.85, -4432.91, 31.8999, 5.66896, 0, 0, 0.302309, -0.95321, 300, 0, 1), +(@OGUID+23, 201752, 1, 1, 1, 1380.81, -4431.58, 31.902, 5.64147, 0, 0, 0.315381, -0.948965, 300, 0, 1), +(@OGUID+24, 201752, 1, 1, 1, 1377.67, -4434.36, 30.6055, 5.36265, 0, 0, 0.444186, -0.895935, 300, 0, 1), +-- Crown Chemical Co. Supplies +(@OGUID+25, 201778, 0, 1, 1, -9031.18, 354.399, 92.9752, 6.12019, 0, 0, 0.0814081, -0.996681, 300, 0, 1), +(@OGUID+26, 201778, 0, 1, 1, -9028.76, 352.525, 95.4034, 0.503804, 0, 0, 0.249246, 0.96844, 300, 0, 1), +(@OGUID+27, 201778, 0, 1, 1, -9030.19, 351.409, 94.1683, 0.134668, 0, 0, 0.067283, 0.997734, 300, 0, 1), +(@OGUID+28, 201778, 0, 1, 1, -9031.52, 349.739, 92.9068, 0.338872, 0, 0, 0.168626, 0.98568, 300, 0, 1), +(@OGUID+29, 201778, 0, 1, 1, -9030.55, 347.899, 92.9635, 0.751206, 0, 0, 0.366833, 0.930287, 300, 0, 1), +(@OGUID+30, 201778, 0, 1, 1, -9027.59, 348.911, 94.2683, 1.784, 0, 0, 0.77833, 0.627855, 300, 0, 1), +(@OGUID+31, 201778, 0, 1, 1, -9028.87, 349.971, 95.4191, 1.82327, 0, 0, 0.790507, 0.612452, 300, 0, 1), +(@OGUID+32, 201778, 0, 1, 1, -9031.75, 354.82, 92.9939, 6.0605, 0, 0, 0.111113, -0.993808, 300, 0, 1), +(@OGUID+33, 201778, 0, 1, 1, -9032.22, 352.779, 92.9627, 6.0605, 0, 0, 0.111113, -0.993808, 300, 0, 1), +(@OGUID+34, 201778, 1, 1, 1, 1375.84, -4432.46, 30.5735, 5.69645, 0, 0, 0.289178, -0.957275, 300, 0, 1), +(@OGUID+35, 201778, 1, 1, 1, 1377.99, -4431.81, 31.8923, 5.5001, 0, 0, 0.381614, -0.924322, 300, 0, 1), +(@OGUID+36, 201778, 1, 1, 1, 1379.21, -4430.58, 31.9198, 4.81681, 0, 0, 0.669241, -0.743045, 300, 0, 1), +(@OGUID+37, 201778, 1, 1, 1, 1379.35, -4432.78, 33.143, 5.61791, 0, 0, 0.326536, -0.945185, 300, 0, 1), +(@OGUID+38, 201778, 1, 1, 1, 1380.87, -4431.5, 33.1452, 4.66994, 0, 0, 0.721955, -0.69194, 300, 0, 1), +(@OGUID+39, 201778, 1, 1, 1, 1380.96, -4429.36, 30.6772, 4.6503, 0, 0, 0.728713, -0.68482, 300, 0, 1), +(@OGUID+40, 201778, 1, 1, 1, 1383.08, -4429.42, 30.651, 4.53642, 0, 0, 0.766505, -0.642238, 300, 0, 1), +(@OGUID+41, 201778, 1, 1, 1, 1378.64, -4428.42, 30.6846, 5.23543, 0, 0, 0.500243, -0.865885, 300, 0, 1), +(@OGUID+42, 201778, 1, 1, 1, 1377.05, -4429.39, 30.6467, 5.31397, 0, 0, 0.465863, -0.884857, 300, 0, 1); + +DELETE FROM `game_event_gameobject` WHERE `eventEntry`=@EVENT AND `guid` BETWEEN @OGUID AND @OGUID+42; +INSERT INTO `game_event_gameobject` (`guid`, `eventEntry`) VALUES +(@OGUID, @EVENT),(@OGUID+1, @EVENT),(@OGUID+2, @EVENT), +(@OGUID+3, @EVENT),(@OGUID+4, @EVENT),(@OGUID+5, @EVENT), +(@OGUID+6, @EVENT),(@OGUID+7, @EVENT),(@OGUID+8, @EVENT), +(@OGUID+9, @EVENT),(@OGUID+10, @EVENT),(@OGUID+11, @EVENT), +(@OGUID+12, @EVENT),(@OGUID+13, @EVENT),(@OGUID+14, @EVENT), +(@OGUID+15, @EVENT),(@OGUID+16, @EVENT),(@OGUID+17, @EVENT), +(@OGUID+18, @EVENT),(@OGUID+19, @EVENT),(@OGUID+20, @EVENT), +(@OGUID+21, @EVENT),(@OGUID+22, @EVENT),(@OGUID+23, @EVENT), +(@OGUID+24, @EVENT),(@OGUID+25, @EVENT),(@OGUID+26, @EVENT), +(@OGUID+27, @EVENT),(@OGUID+28, @EVENT),(@OGUID+29, @EVENT), +(@OGUID+30, @EVENT),(@OGUID+31, @EVENT),(@OGUID+32, @EVENT), +(@OGUID+33, @EVENT),(@OGUID+34, @EVENT),(@OGUID+35, @EVENT), +(@OGUID+36, @EVENT),(@OGUID+37, @EVENT),(@OGUID+38, @EVENT), +(@OGUID+39, @EVENT),(@OGUID+40, @EVENT),(@OGUID+41, @EVENT), +(@OGUID+42, @EVENT); + +-- [Q]: Pilfering Perfume +-- Note: this is EndText (misleading field name), NOT ObjectiveText1 +UPDATE `quest_template` SET `EndText` = 'Steal perfume package from Crown Chemical Co. outside Stormind' WHERE `Id` = 24656; -- Alliance +UPDATE `quest_template` SET `EndText` = 'Steal perfume package from Crown Chemical Co. outside Orgrimmar' WHERE `Id` = 24541; -- Horde + +-- Creature templates and spawns +UPDATE `creature_template` SET `minlevel`=70, `maxlevel`=75 WHERE `entry`=37671; -- Crown Supply Guard +UPDATE `creature_template` SET `npcflag`=`npcflag`|1, `gossip_menu_id`=10991 WHERE `entry`=38293; -- Junior Inspector (gossip menu not confirmed) + +DELETE FROM `creature` WHERE `id` IN (38293,38065,37671) AND `guid` BETWEEN @CGUID+0 AND @CGUID+3; +DELETE FROM `creature` WHERE `id` IN (38293,38065,37671) AND `guid` BETWEEN @OLDGUID+0 AND @OLDGUID+3; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES +(@CGUID+0, 38293, 530, 1, 1, 0, 0, -4022.81, -11842.7, 0.0062171, 5.89912, 300, 0, 0, 955, 0, 0, 0, 0, 0), -- Junior Inspector +(@CGUID+1, 38065, 1, 1, 1, 0, 0, 1380.22, -4426.79, 30.6681, 2.03572, 300, 0, 0, 12600, 0, 0, 0, 0, 0), -- Crown Supply Sentry +(@CGUID+2, 37671, 0, 1, 1, 30912, 0, -9033.01, 356.408, 93.1543, 2.09345, 300, 0, 0, 42, 0, 0, 0, 0, 0), -- Crown Supply Guard +(@CGUID+3, 37671, 0, 1, 1, 30912, 0, -9028.63, 344.994, 93.2389, 3.37679, 300, 0, 0, 42, 0, 0, 0, 0, 0); -- Crown Supply Guard + +DELETE FROM `game_event_creature` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+3 AND `eventEntry`=@EVENT; +DELETE FROM `game_event_creature` WHERE `guid` BETWEEN @OLDGUID+0 AND @OLDGUID+3 AND `eventEntry`=@EVENT; +INSERT INTO `game_event_creature` (`guid`, `eventEntry`) VALUES +(@CGUID+0, @EVENT), +(@CGUID+1, @EVENT), +(@CGUID+2, @EVENT), +(@CGUID+3, @EVENT); diff --git a/sql/old/3.3.5a/2012_02_15_08_world_sai.sql b/sql/old/3.3.5a/2012_02_15_08_world_sai.sql new file mode 100644 index 00000000000..ef49ff484f3 --- /dev/null +++ b/sql/old/3.3.5a/2012_02_15_08_world_sai.sql @@ -0,0 +1,9 @@ +SET @Pinata := 34632; + +DELETE FROM `smart_scripts` WHERE `entryorguid`=@Pinata AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(@Pinata, 0, 0, 0, 6, 0, 100, 0, 0, 0, 0, 0, 11, 65788, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ogre Pinata - On death cast Pile of Candy'), +(@Pinata, 0, 1, 0, 25, 0, 100, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ogre Pinata - On reset set react state passive'); + +-- same faction of the GO that is spawned by spell 65788 (not sniffed) +UPDATE `creature_template` SET `faction_A`=7,`faction_H`=7,`exp`=0,`AIName`='SmartAI' WHERE `entry`=@Pinata; diff --git a/sql/old/3.3.5a/2012_02_15_09_world_spell_proc_event.sql b/sql/old/3.3.5a/2012_02_15_09_world_spell_proc_event.sql new file mode 100644 index 00000000000..4811e5d66fe --- /dev/null +++ b/sql/old/3.3.5a/2012_02_15_09_world_spell_proc_event.sql @@ -0,0 +1,6 @@ +-- Corrected proc of Misery +DELETE FROM `spell_proc_event` WHERE `entry` IN (33191, 33192, 33193); +INSERT INTO `spell_proc_event` VALUES +(33191, 0x00, 0x06, 0x00008000, 0x00000400, 0x00000040, 0x00000000, 0x00000000, 0, 0, 0), +(33192, 0x00, 0x06, 0x00008000, 0x00000400, 0x00000040, 0x00000000, 0x00000000, 0, 0, 0), +(33193, 0x00, 0x06, 0x00008000, 0x00000400, 0x00000040, 0x00000000, 0x00000000, 0, 0, 0); diff --git a/sql/old/3.3.5a/2012_02_16_00_world_conditions.sql b/sql/old/3.3.5a/2012_02_16_00_world_conditions.sql new file mode 100644 index 00000000000..5bef38fc485 --- /dev/null +++ b/sql/old/3.3.5a/2012_02_16_00_world_conditions.sql @@ -0,0 +1,12800 @@ +CREATE TABLE `temp_convert_spells` +( + `id` INT(11), + PRIMARY KEY (`id`) +); + +-- spells with EffectImplicitTarget In (6,21, 25) + spells having Targets & 1115534 +-- those spells are the ones which require explicit unit target to cast +INSERT INTO `temp_convert_spells` VALUES +(5), +(11), +(12), +(14), +(15), +(17), +(25), +(49), +(50), +(53), +(56), +(58), +(59), +(60), +(61), +(67), +(68), +(72), +(75), +(78), +(89), +(91), +(96), +(100), +(101), +(113), +(116), +(118), +(131), +(132), +(133), +(134), +(139), +(142), +(143), +(145), +(172), +(184), +(205), +(228), +(246), +(260), +(271), +(284), +(285), +(339), +(348), +(355), +(370), +(403), +(408), +(421), +(453), +(457), +(467), +(475), +(512), +(514), +(526), +(527), +(528), +(529), +(530), +(546), +(548), +(550), +(552), +(585), +(589), +(591), +(592), +(594), +(596), +(598), +(600), +(603), +(605), +(606), +(633), +(635), +(639), +(647), +(676), +(686), +(689), +(692), +(694), +(695), +(699), +(700), +(701), +(702), +(703), +(705), +(707), +(709), +(710), +(720), +(731), +(744), +(745), +(746), +(770), +(772), +(774), +(782), +(785), +(812), +(835), +(837), +(845), +(851), +(853), +(879), +(915), +(921), +(930), +(932), +(943), +(970), +(974), +(976), +(980), +(984), +(988), +(992), +(996), +(1004), +(1010), +(1014), +(1026), +(1035), +(1042), +(1044), +(1058), +(1062), +(1075), +(1079), +(1082), +(1088), +(1090), +(1094), +(1098), +(1106), +(1108), +(1120), +(1121), +(1126), +(1130), +(1139), +(1152), +(1159), +(1194), +(1196), +(1210), +(1214), +(1225), +(1228), +(1234), +(1241), +(1243), +(1244), +(1245), +(1249), +(1250), +(1251), +(1266), +(1267), +(1329), +(1330), +(1350), +(1364), +(1373), +(1413), +(1430), +(1446), +(1459), +(1460), +(1461), +(1462), +(1464), +(1467), +(1472), +(1473), +(1474), +(1475), +(1481), +(1485), +(1490), +(1495), +(1513), +(1515), +(1516), +(1536), +(1579), +(1588), +(1604), +(1608), +(1609), +(1650), +(1664), +(1665), +(1666), +(1669), +(1671), +(1672), +(1714), +(1715), +(1752), +(1753), +(1754), +(1755), +(1756), +(1757), +(1758), +(1759), +(1760), +(1766), +(1767), +(1768), +(1769), +(1770), +(1776), +(1777), +(1795), +(1796), +(1797), +(1798), +(1800), +(1809), +(1810), +(1811), +(1822), +(1823), +(1824), +(1831), +(1833), +(1852), +(1906), +(1908), +(1943), +(1950), +(1966), +(1978), +(1991), +(2000), +(2020), +(2021), +(2050), +(2052), +(2053), +(2054), +(2055), +(2060), +(2061), +(2070), +(2090), +(2091), +(2094), +(2096), +(2098), +(2110), +(2118), +(2119), +(2124), +(2125), +(2136), +(2137), +(2138), +(2139), +(2141), +(2142), +(2143), +(2147), +(2148), +(2154), +(2155), +(2275), +(2280), +(2313), +(2372), +(2373), +(2400), +(2425), +(2442), +(2443), +(2444), +(2446), +(2552), +(2589), +(2590), +(2591), +(2601), +(2602), +(2606), +(2607), +(2608), +(2609), +(2610), +(2626), +(2629), +(2630), +(2633), +(2634), +(2636), +(2637), +(2643), +(2647), +(2649), +(2650), +(2653), +(2691), +(2764), +(2767), +(2782), +(2791), +(2800), +(2816), +(2817), +(2818), +(2819), +(2834), +(2850), +(2855), +(2860), +(2871), +(2880), +(2893), +(2908), +(2912), +(2941), +(2944), +(2948), +(2949), +(2969), +(2972), +(2973), +(2974), +(2995), +(3007), +(3009), +(3010), +(3011), +(3018), +(3029), +(3034), +(3043), +(3044), +(3105), +(3108), +(3110), +(3120), +(3121), +(3130), +(3131), +(3132), +(3137), +(3140), +(3145), +(3147), +(3148), +(3150), +(3205), +(3206), +(3207), +(3229), +(3233), +(3234), +(3237), +(3242), +(3243), +(3246), +(3247), +(3252), +(3261), +(3263), +(3267), +(3268), +(3279), +(3280), +(3286), +(3332), +(3355), +(3356), +(3358), +(3360), +(3387), +(3388), +(3393), +(3396), +(3405), +(3409), +(3427), +(3429), +(3436), +(3442), +(3446), +(3465), +(3466), +(3472), +(3510), +(3514), +(3539), +(3542), +(3551), +(3553), +(3571), +(3578), +(3583), +(3584), +(3586), +(3602), +(3603), +(3604), +(3606), +(3607), +(3609), +(3627), +(3635), +(3636), +(3650), +(3674), +(3715), +(3716), +(3747), +(3812), +(3911), +(3912), +(3913), +(3921), +(4011), +(4039), +(4040), +(4041), +(4058), +(4060), +(4089), +(4090), +(4091), +(4101), +(4102), +(4130), +(4131), +(4132), +(4150), +(4159), +(4164), +(4165), +(4166), +(4167), +(4168), +(4169), +(4209), +(4221), +(4240), +(4243), +(4244), +(4262), +(4280), +(4281), +(4282), +(4285), +(4286), +(4294), +(4316), +(4362), +(4423), +(4500), +(4504), +(4505), +(4506), +(4538), +(4630), +(4659), +(4805), +(4877), +(4940), +(4961), +(4962), +(4974), +(4979), +(4980), +(4984), +(4987), +(4996), +(4997), +(4998), +(4999), +(5000), +(5003), +(5019), +(5025), +(5103), +(5105), +(5116), +(5133), +(5137), +(5138), +(5143), +(5144), +(5145), +(5164), +(5165), +(5171), +(5176), +(5177), +(5178), +(5179), +(5180), +(5185), +(5186), +(5187), +(5188), +(5189), +(5195), +(5196), +(5201), +(5208), +(5211), +(5213), +(5221), +(5232), +(5234), +(5246), +(5255), +(5259), +(5260), +(5263), +(5271), +(5276), +(5306), +(5308), +(5320), +(5321), +(5322), +(5323), +(5324), +(5325), +(5337), +(5374), +(5375), +(5376), +(5401), +(5413), +(5416), +(5422), +(5424), +(5433), +(5480), +(5503), +(5507), +(5508), +(5509), +(5513), +(5514), +(5547), +(5565), +(5566), +(5567), +(5570), +(5588), +(5589), +(5595), +(5597), +(5598), +(5614), +(5615), +(5648), +(5649), +(5676), +(5679), +(5696), +(5697), +(5703), +(5726), +(5727), +(5739), +(5760), +(5781), +(5782), +(5862), +(5884), +(5917), +(5918), +(5938), +(5940), +(5951), +(5967), +(6000), +(6016), +(6027), +(6028), +(6041), +(6060), +(6061), +(6063), +(6064), +(6065), +(6066), +(6074), +(6075), +(6076), +(6077), +(6078), +(6121), +(6128), +(6130), +(6132), +(6136), +(6142), +(6144), +(6146), +(6178), +(6199), +(6203), +(6205), +(6213), +(6215), +(6217), +(6222), +(6223), +(6245), +(6252), +(6253), +(6254), +(6255), +(6257), +(6273), +(6277), +(6278), +(6304), +(6327), +(6346), +(6348), +(6349), +(6350), +(6351), +(6352), +(6353), +(6357), +(6358), +(6359), +(6360), +(6362), +(6409), +(6435), +(6460), +(6465), +(6466), +(6483), +(6484), +(6509), +(6530), +(6531), +(6533), +(6546), +(6547), +(6548), +(6552), +(6554), +(6555), +(6572), +(6574), +(6576), +(6580), +(6581), +(6595), +(6607), +(6647), +(6655), +(6660), +(6664), +(6685), +(6713), +(6716), +(6719), +(6726), +(6728), +(6730), +(6742), +(6743), +(6744), +(6745), +(6746), +(6747), +(6748), +(6751), +(6753), +(6754), +(6756), +(6760), +(6761), +(6762), +(6766), +(6767), +(6768), +(6770), +(6774), +(6778), +(6780), +(6785), +(6787), +(6788), +(6789), +(6795), +(6798), +(6800), +(6807), +(6808), +(6809), +(6814), +(6866), +(6870), +(6873), +(6894), +(6907), +(6909), +(6917), +(6922), +(6927), +(6942), +(6946), +(6949), +(6950), +(6951), +(6957), +(6958), +(6960), +(6963), +(6965), +(6979), +(6980), +(6984), +(7001), +(7033), +(7054), +(7057), +(7068), +(7079), +(7081), +(7084), +(7092), +(7093), +(7098), +(7099), +(7101), +(7102), +(7105), +(7120), +(7122), +(7124), +(7125), +(7127), +(7140), +(7145), +(7154), +(7159), +(7160), +(7162), +(7211), +(7266), +(7288), +(7289), +(7290), +(7295), +(7321), +(7322), +(7329), +(7357), +(7365), +(7367), +(7369), +(7372), +(7373), +(7379), +(7384), +(7386), +(7399), +(7400), +(7402), +(7405), +(7414), +(7415), +(7416), +(7439), +(7482), +(7485), +(7588), +(7621), +(7638), +(7641), +(7645), +(7646), +(7648), +(7651), +(7655), +(7656), +(7712), +(7714), +(7715), +(7716), +(7717), +(7718), +(7719), +(7736), +(7761), +(7763), +(7764), +(7799), +(7800), +(7801), +(7802), +(7806), +(7807), +(7808), +(7809), +(7810), +(7811), +(7813), +(7814), +(7815), +(7816), +(7821), +(7829), +(7853), +(7874), +(7875), +(7876), +(7877), +(7878), +(7879), +(7880), +(7881), +(7882), +(7883), +(7884), +(7885), +(7887), +(7891), +(7896), +(7901), +(7914), +(7922), +(7925), +(7926), +(7927), +(7932), +(7933), +(7938), +(7947), +(7951), +(7967), +(7992), +(7994), +(7997), +(8004), +(8008), +(8010), +(8012), +(8014), +(8016), +(8026), +(8028), +(8029), +(8034), +(8037), +(8040), +(8042), +(8044), +(8045), +(8046), +(8050), +(8052), +(8053), +(8056), +(8058), +(8068), +(8070), +(8091), +(8092), +(8094), +(8095), +(8096), +(8097), +(8098), +(8099), +(8100), +(8101), +(8102), +(8103), +(8104), +(8105), +(8106), +(8112), +(8113), +(8114), +(8115), +(8116), +(8117), +(8118), +(8119), +(8120), +(8121), +(8129), +(8137), +(8138), +(8139), +(8140), +(8151), +(8208), +(8211), +(8221), +(8222), +(8242), +(8246), +(8255), +(8256), +(8257), +(8272), +(8275), +(8277), +(8282), +(8288), +(8289), +(8292), +(8295), +(8312), +(8313), +(8314), +(8318), +(8319), +(8344), +(8345), +(8346), +(8347), +(8352), +(8353), +(8355), +(8362), +(8363), +(8365), +(8379), +(8380), +(8382), +(8383), +(8384), +(8385), +(8391), +(8400), +(8401), +(8402), +(8406), +(8407), +(8408), +(8412), +(8413), +(8414), +(8415), +(8416), +(8417), +(8425), +(8426), +(8428), +(8440), +(8441), +(8442), +(8444), +(8445), +(8446), +(8447), +(8448), +(8449), +(8452), +(8453), +(8456), +(8459), +(8460), +(8463), +(8464), +(8493), +(8496), +(8497), +(8552), +(8554), +(8555), +(8595), +(8598), +(8600), +(8613), +(8615), +(8616), +(8617), +(8618), +(8619), +(8620), +(8621), +(8623), +(8624), +(8627), +(8629), +(8631), +(8632), +(8633), +(8637), +(8639), +(8640), +(8643), +(8645), +(8646), +(8647), +(8649), +(8650), +(8654), +(8673), +(8676), +(8680), +(8682), +(8685), +(8689), +(8699), +(8716), +(8721), +(8724), +(8725), +(8733), +(8735), +(8788), +(8806), +(8818), +(8820), +(8903), +(8905), +(8907), +(8910), +(8914), +(8921), +(8924), +(8925), +(8926), +(8927), +(8928), +(8929), +(8936), +(8938), +(8939), +(8940), +(8941), +(8946), +(8947), +(8949), +(8950), +(8951), +(8955), +(8972), +(8983), +(8992), +(8994), +(8998), +(9000), +(9005), +(9007), +(9034), +(9053), +(9057), +(9080), +(9159), +(9176), +(9234), +(9268), +(9275), +(9347), +(9373), +(9454), +(9455), +(9456), +(9459), +(9462), +(9472), +(9473), +(9474), +(9481), +(9482), +(9483), +(9484), +(9485), +(9487), +(9488), +(9492), +(9493), +(9532), +(9552), +(9574), +(9591), +(9612), +(9613), +(9614), +(9654), +(9658), +(9672), +(9734), +(9735), +(9739), +(9745), +(9750), +(9752), +(9756), +(9758), +(9771), +(9775), +(9786), +(9789), +(9790), +(9791), +(9796), +(9806), +(9823), +(9824), +(9826), +(9827), +(9829), +(9830), +(9833), +(9834), +(9835), +(9839), +(9840), +(9841), +(9849), +(9850), +(9852), +(9853), +(9856), +(9857), +(9858), +(9866), +(9867), +(9875), +(9876), +(9880), +(9881), +(9884), +(9885), +(9888), +(9889), +(9892), +(9894), +(9896), +(9901), +(9904), +(9910), +(9912), +(9949), +(9977), +(9991), +(9999), +(10055), +(10056), +(10060), +(10073), +(10101), +(10136), +(10141), +(10142), +(10143), +(10146), +(10147), +(10148), +(10149), +(10150), +(10151), +(10156), +(10157), +(10158), +(10162), +(10163), +(10164), +(10171), +(10172), +(10175), +(10176), +(10178), +(10179), +(10180), +(10181), +(10188), +(10189), +(10190), +(10194), +(10195), +(10196), +(10197), +(10198), +(10199), +(10200), +(10203), +(10204), +(10205), +(10206), +(10207), +(10208), +(10209), +(10210), +(10211), +(10212), +(10217), +(10218), +(10221), +(10222), +(10224), +(10226), +(10227), +(10231), +(10239), +(10244), +(10245), +(10246), +(10277), +(10308), +(10310), +(10312), +(10313), +(10314), +(10321), +(10326), +(10328), +(10329), +(10346), +(10370), +(10371), +(10373), +(10391), +(10392), +(10412), +(10413), +(10414), +(10435), +(10436), +(10444), +(10445), +(10447), +(10448), +(10452), +(10458), +(10466), +(10467), +(10468), +(10472), +(10473), +(10577), +(10578), +(10605), +(10617), +(10651), +(10653), +(10657), +(10659), +(10661), +(10663), +(10689), +(10730), +(10767), +(10768), +(10769), +(10771), +(10833), +(10838), +(10839), +(10843), +(10847), +(10851), +(10855), +(10863), +(10872), +(10892), +(10893), +(10894), +(10898), +(10899), +(10900), +(10901), +(10908), +(10909), +(10915), +(10916), +(10917), +(10921), +(10927), +(10928), +(10929), +(10933), +(10934), +(10937), +(10938), +(10945), +(10946), +(10947), +(10955), +(10957), +(10958), +(10960), +(10961), +(10963), +(10964), +(10965), +(10966), +(11014), +(11016), +(11020), +(11021), +(11027), +(11084), +(11085), +(11131), +(11132), +(11196), +(11197), +(11198), +(11203), +(11204), +(11205), +(11267), +(11268), +(11269), +(11273), +(11274), +(11275), +(11279), +(11280), +(11281), +(11285), +(11286), +(11289), +(11290), +(11293), +(11294), +(11297), +(11299), +(11300), +(11303), +(11335), +(11336), +(11337), +(11353), +(11354), +(11362), +(11366), +(11374), +(11391), +(11397), +(11409), +(11428), +(11430), +(11431), +(11436), +(11442), +(11443), +(11444), +(11446), +(11469), +(11470), +(11471), +(11512), +(11519), +(11520), +(11522), +(11525), +(11528), +(11538), +(11539), +(11545), +(11564), +(11565), +(11566), +(11567), +(11572), +(11573), +(11574), +(11578), +(11584), +(11585), +(11595), +(11596), +(11597), +(11600), +(11601), +(11604), +(11605), +(11608), +(11609), +(11610), +(11612), +(11639), +(11640), +(11641), +(11642), +(11650), +(11658), +(11659), +(11660), +(11661), +(11665), +(11667), +(11668), +(11671), +(11672), +(11675), +(11699), +(11700), +(11707), +(11708), +(11711), +(11712), +(11713), +(11719), +(11721), +(11722), +(11725), +(11726), +(11762), +(11763), +(11772), +(11773), +(11774), +(11775), +(11776), +(11777), +(11778), +(11779), +(11780), +(11781), +(11782), +(11783), +(11784), +(11785), +(11786), +(11787), +(11791), +(11820), +(11821), +(11824), +(11825), +(11835), +(11836), +(11839), +(11877), +(11879), +(11885), +(11886), +(11887), +(11888), +(11889), +(11918), +(11920), +(11921), +(11922), +(11960), +(11962), +(11963), +(11971), +(11972), +(11974), +(11976), +(11977), +(11978), +(11980), +(11981), +(11985), +(11986), +(11994), +(11998), +(12021), +(12023), +(12024), +(12039), +(12054), +(12057), +(12058), +(12096), +(12097), +(12098), +(12118), +(12127), +(12128), +(12130), +(12131), +(12160), +(12161), +(12162), +(12166), +(12167), +(12170), +(12174), +(12175), +(12176), +(12177), +(12178), +(12179), +(12181), +(12242), +(12245), +(12246), +(12248), +(12251), +(12279), +(12280), +(12289), +(12294), +(12355), +(12461), +(12466), +(12471), +(12479), +(12480), +(12484), +(12485), +(12486), +(12491), +(12492), +(12493), +(12494), +(12505), +(12509), +(12510), +(12521), +(12522), +(12523), +(12524), +(12525), +(12526), +(12531), +(12538), +(12540), +(12541), +(12542), +(12545), +(12548), +(12551), +(12553), +(12555), +(12578), +(12579), +(12654), +(12657), +(12668), +(12675), +(12693), +(12699), +(12705), +(12721), +(12723), +(12738), +(12739), +(12742), +(12747), +(12798), +(12809), +(12821), +(12824), +(12825), +(12826), +(12850), +(12868), +(12885), +(12888), +(12890), +(12998), +(13003), +(13005), +(13006), +(13009), +(13013), +(13022), +(13029), +(13044), +(13099), +(13119), +(13120), +(13138), +(13140), +(13142), +(13180), +(13181), +(13218), +(13222), +(13223), +(13224), +(13278), +(13279), +(13281), +(13298), +(13318), +(13319), +(13321), +(13322), +(13323), +(13325), +(13326), +(13327), +(13338), +(13339), +(13340), +(13341), +(13342), +(13374), +(13375), +(13398), +(13424), +(13438), +(13439), +(13440), +(13441), +(13442), +(13443), +(13444), +(13445), +(13446), +(13459), +(13480), +(13482), +(13486), +(13490), +(13491), +(13496), +(13518), +(13519), +(13524), +(13526), +(13527), +(13528), +(13530), +(13534), +(13549), +(13550), +(13551), +(13552), +(13553), +(13554), +(13555), +(13566), +(13567), +(13579), +(13583), +(13584), +(13585), +(13608), +(13619), +(13692), +(13728), +(13729), +(13737), +(13738), +(13748), +(13752), +(13797), +(13860), +(13864), +(13878), +(13880), +(13884), +(13897), +(13901), +(13902), +(13907), +(13921), +(13952), +(13953), +(13977), +(14030), +(14032), +(14033), +(14034), +(14053), +(14087), +(14099), +(14102), +(14103), +(14105), +(14106), +(14109), +(14110), +(14112), +(14118), +(14119), +(14120), +(14122), +(14126), +(14129), +(14130), +(14134), +(14145), +(14156), +(14157), +(14160), +(14178), +(14180), +(14183), +(14189), +(14200), +(14247), +(14251), +(14253), +(14260), +(14261), +(14262), +(14263), +(14264), +(14265), +(14266), +(14269), +(14270), +(14271), +(14278), +(14281), +(14282), +(14283), +(14284), +(14285), +(14286), +(14287), +(14288), +(14289), +(14290), +(14298), +(14299), +(14300), +(14301), +(14308), +(14309), +(14323), +(14324), +(14325), +(14326), +(14327), +(14331), +(14443), +(14515), +(14516), +(14517), +(14518), +(14537), +(14752), +(14792), +(14795), +(14818), +(14819), +(14867), +(14868), +(14873), +(14874), +(14875), +(14890), +(14892), +(14893), +(14894), +(14895), +(14897), +(14902), +(14903), +(14914), +(14916), +(14917), +(14918), +(14919), +(14920), +(14921), +(15037), +(15039), +(15040), +(15042), +(15043), +(15057), +(15065), +(15089), +(15090), +(15095), +(15096), +(15117), +(15120), +(15122), +(15123), +(15124), +(15128), +(15187), +(15207), +(15208), +(15211), +(15228), +(15229), +(15230), +(15232), +(15234), +(15235), +(15236), +(15238), +(15241), +(15242), +(15247), +(15248), +(15249), +(15250), +(15254), +(15257), +(15261), +(15262), +(15263), +(15264), +(15265), +(15266), +(15267), +(15277), +(15279), +(15280), +(15283), +(15284), +(15288), +(15305), +(15306), +(15331), +(15332), +(15342), +(15343), +(15344), +(15346), +(15357), +(15359), +(15362), +(15363), +(15366), +(15398), +(15407), +(15451), +(15471), +(15472), +(15487), +(15493), +(15495), +(15496), +(15497), +(15498), +(15499), +(15500), +(15501), +(15505), +(15530), +(15534), +(15535), +(15536), +(15537), +(15539), +(15547), +(15549), +(15570), +(15572), +(15574), +(15575), +(15580), +(15581), +(15582), +(15583), +(15586), +(15587), +(15592), +(15598), +(15605), +(15607), +(15608), +(15610), +(15611), +(15612), +(15614), +(15615), +(15616), +(15617), +(15618), +(15619), +(15620), +(15621), +(15643), +(15651), +(15652), +(15653), +(15654), +(15655), +(15656), +(15657), +(15659), +(15661), +(15662), +(15664), +(15665), +(15667), +(15691), +(15692), +(15695), +(15698), +(15699), +(15702), +(15708), +(15712), +(15713), +(15729), +(15730), +(15732), +(15734), +(15735), +(15736), +(15749), +(15752), +(15753), +(15784), +(15785), +(15790), +(15791), +(15793), +(15795), +(15797), +(15798), +(15801), +(15802), +(15848), +(15850), +(15859), +(15860), +(15876), +(15878), +(15968), +(15969), +(15970), +(15976), +(15980), +(15981), +(15982), +(16000), +(16001), +(16006), +(16007), +(16029), +(16031), +(16033), +(16034), +(16044), +(16045), +(16050), +(16053), +(16067), +(16071), +(16075), +(16095), +(16100), +(16101), +(16128), +(16143), +(16144), +(16145), +(16168), +(16170), +(16172), +(16176), +(16177), +(16186), +(16231), +(16235), +(16236), +(16237), +(16240), +(16243), +(16247), +(16249), +(16333), +(16336), +(16343), +(16344), +(16351), +(16352), +(16353), +(16366), +(16373), +(16375), +(16391), +(16392), +(16393), +(16400), +(16401), +(16402), +(16403), +(16405), +(16406), +(16407), +(16408), +(16409), +(16410), +(16411), +(16412), +(16413), +(16414), +(16415), +(16427), +(16429), +(16430), +(16431), +(16433), +(16448), +(16449), +(16451), +(16454), +(16455), +(16456), +(16458), +(16460), +(16461), +(16472), +(16495), +(16496), +(16498), +(16508), +(16509), +(16511), +(16527), +(16528), +(16530), +(16536), +(16549), +(16552), +(16553), +(16554), +(16555), +(16561), +(16564), +(16565), +(16568), +(16569), +(16570), +(16573), +(16583), +(16587), +(16588), +(16603), +(16608), +(16610), +(16612), +(16614), +(16618), +(16627), +(16628), +(16636), +(16697), +(16707), +(16708), +(16709), +(16711), +(16712), +(16713), +(16714), +(16716), +(16722), +(16782), +(16783), +(16784), +(16788), +(16790), +(16793), +(16798), +(16799), +(16804), +(16805), +(16827), +(16828), +(16829), +(16830), +(16831), +(16832), +(16844), +(16856), +(16857), +(16868), +(16869), +(16871), +(16898), +(16908), +(16921), +(16922), +(16927), +(16928), +(16953), +(16979), +(16997), +(17008), +(17009), +(17011), +(17012), +(17013), +(17105), +(17134), +(17137), +(17138), +(17139), +(17140), +(17141), +(17142), +(17143), +(17144), +(17146), +(17147), +(17148), +(17149), +(17150), +(17151), +(17153), +(17156), +(17157), +(17158), +(17159), +(17160), +(17165), +(17168), +(17170), +(17171), +(17172), +(17173), +(17174), +(17175), +(17183), +(17194), +(17195), +(17198), +(17201), +(17213), +(17227), +(17230), +(17233), +(17234), +(17238), +(17243), +(17244), +(17246), +(17253), +(17255), +(17256), +(17257), +(17258), +(17259), +(17260), +(17261), +(17273), +(17274), +(17276), +(17281), +(17284), +(17287), +(17289), +(17290), +(17292), +(17293), +(17307), +(17308), +(17311), +(17312), +(17313), +(17314), +(17315), +(17330), +(17331), +(17333), +(17334), +(17347), +(17348), +(17353), +(17364), +(17368), +(17393), +(17405), +(17407), +(17434), +(17435), +(17439), +(17445), +(17451), +(17452), +(17470), +(17483), +(17484), +(17492), +(17494), +(17496), +(17500), +(17503), +(17504), +(17505), +(17506), +(17509), +(17510), +(17511), +(17529), +(17547), +(17607), +(17608), +(17609), +(17610), +(17611), +(17613), +(17615), +(17620), +(17630), +(17633), +(17639), +(17648), +(17649), +(17672), +(17682), +(17692), +(17734), +(17736), +(17738), +(17744), +(17745), +(17749), +(17753), +(17754), +(17755), +(17776), +(17777), +(17794), +(17797), +(17798), +(17799), +(17800), +(17843), +(17855), +(17856), +(17857), +(17859), +(17860), +(17863), +(17877), +(17883), +(17919), +(17920), +(17921), +(17922), +(17923), +(17924), +(17925), +(17926), +(17939), +(17943), +(17944), +(17946), +(17948), +(17950), +(17961), +(17962), +(17963), +(18070), +(18072), +(18075), +(18077), +(18078), +(18081), +(18082), +(18083), +(18084), +(18085), +(18086), +(18088), +(18089), +(18090), +(18091), +(18092), +(18101), +(18103), +(18104), +(18105), +(18106), +(18107), +(18108), +(18111), +(18112), +(18118), +(18138), +(18145), +(18149), +(18151), +(18152), +(18153), +(18159), +(18164), +(18165), +(18172), +(18173), +(18187), +(18197), +(18199), +(18200), +(18202), +(18203), +(18204), +(18205), +(18206), +(18208), +(18209), +(18210), +(18211), +(18214), +(18217), +(18223), +(18266), +(18267), +(18270), +(18276), +(18278), +(18289), +(18347), +(18362), +(18367), +(18368), +(18375), +(18381), +(18387), +(18389), +(18390), +(18395), +(18396), +(18398), +(18425), +(18469), +(18476), +(18498), +(18502), +(18503), +(18543), +(18545), +(18557), +(18561), +(18562), +(18608), +(18610), +(18631), +(18632), +(18633), +(18647), +(18649), +(18651), +(18652), +(18654), +(18656), +(18657), +(18658), +(18663), +(18670), +(18702), +(18761), +(18763), +(18796), +(18798), +(18802), +(18805), +(18807), +(18809), +(18812), +(18813), +(18817), +(18819), +(18833), +(18867), +(18868), +(18869), +(18870), +(18871), +(18945), +(18952), +(18958), +(18968), +(18972), +(18980), +(18988), +(18996), +(19027), +(19128), +(19130), +(19131), +(19132), +(19133), +(19134), +(19136), +(19179), +(19196), +(19213), +(19244), +(19260), +(19276), +(19277), +(19278), +(19279), +(19280), +(19306), +(19319), +(19362), +(19386), +(19391), +(19393), +(19395), +(19397), +(19411), +(19434), +(19437), +(19439), +(19444), +(19445), +(19446), +(19447), +(19448), +(19450), +(19452), +(19460), +(19463), +(19469), +(19471), +(19472), +(19476), +(19481), +(19486), +(19501), +(19503), +(19505), +(19512), +(19548), +(19595), +(19597), +(19632), +(19633), +(19637), +(19639), +(19642), +(19643), +(19644), +(19647), +(19648), +(19650), +(19652), +(19653), +(19654), +(19658), +(19661), +(19662), +(19663), +(19664), +(19674), +(19675), +(19676), +(19677), +(19678), +(19679), +(19680), +(19681), +(19682), +(19683), +(19684), +(19685), +(19686), +(19687), +(19688), +(19689), +(19692), +(19693), +(19694), +(19696), +(19697), +(19699), +(19700), +(19701), +(19725), +(19727), +(19728), +(19729), +(19730), +(19731), +(19734), +(19736), +(19737), +(19738), +(19739), +(19740), +(19742), +(19750), +(19755), +(19767), +(19770), +(19771), +(19775), +(19776), +(19777), +(19779), +(19785), +(19797), +(19801), +(19816), +(19820), +(19834), +(19835), +(19836), +(19837), +(19838), +(19850), +(19852), +(19853), +(19854), +(19869), +(19872), +(19874), +(19881), +(19901), +(19931), +(19938), +(19939), +(19940), +(19941), +(19942), +(19943), +(19970), +(19971), +(19972), +(19973), +(19974), +(19975), +(19983), +(20000), +(20004), +(20005), +(20006), +(20019), +(20066), +(20170), +(20184), +(20185), +(20186), +(20187), +(20211), +(20217), +(20220), +(20221), +(20223), +(20228), +(20233), +(20236), +(20240), +(20243), +(20252), +(20253), +(20271), +(20276), +(20279), +(20294), +(20295), +(20297), +(20298), +(20367), +(20368), +(20369), +(20370), +(20371), +(20372), +(20373), +(20374), +(20410), +(20420), +(20424), +(20425), +(20463), +(20467), +(20473), +(20474), +(20475), +(20477), +(20508), +(20511), +(20534), +(20535), +(20536), +(20537), +(20539), +(20541), +(20543), +(20547), +(20559), +(20560), +(20564), +(20565), +(20569), +(20586), +(20604), +(20605), +(20614), +(20615), +(20616), +(20617), +(20618), +(20623), +(20625), +(20627), +(20629), +(20630), +(20647), +(20655), +(20656), +(20657), +(20658), +(20660), +(20661), +(20662), +(20663), +(20664), +(20665), +(20666), +(20668), +(20677), +(20678), +(20679), +(20682), +(20684), +(20685), +(20688), +(20690), +(20691), +(20692), +(20695), +(20696), +(20698), +(20700), +(20714), +(20720), +(20726), +(20733), +(20735), +(20736), +(20740), +(20751), +(20787), +(20788), +(20790), +(20791), +(20792), +(20793), +(20795), +(20797), +(20800), +(20801), +(20802), +(20804), +(20805), +(20806), +(20807), +(20808), +(20811), +(20812), +(20815), +(20816), +(20819), +(20820), +(20821), +(20822), +(20823), +(20824), +(20825), +(20826), +(20829), +(20830), +(20831), +(20832), +(20869), +(20882), +(20883), +(20893), +(20900), +(20901), +(20902), +(20903), +(20904), +(20909), +(20910), +(20911), +(20929), +(20930), +(20989), +(21008), +(21027), +(21030), +(21047), +(21049), +(21050), +(21055), +(21056), +(21059), +(21060), +(21062), +(21063), +(21064), +(21066), +(21067), +(21068), +(21072), +(21074), +(21077), +(21081), +(21100), +(21128), +(21140), +(21141), +(21150), +(21151), +(21159), +(21162), +(21163), +(21164), +(21170), +(21179), +(21183), +(21187), +(21330), +(21332), +(21335), +(21337), +(21343), +(21356), +(21357), +(21368), +(21369), +(21372), +(21388), +(21390), +(21398), +(21401), +(21402), +(21463), +(21464), +(21465), +(21541), +(21542), +(21543), +(21546), +(21549), +(21551), +(21552), +(21553), +(21647), +(21654), +(21667), +(21668), +(21669), +(21670), +(21731), +(21732), +(21734), +(21735), +(21737), +(21745), +(21787), +(21794), +(21807), +(21829), +(21832), +(21834), +(21835), +(21840), +(21847), +(21866), +(21889), +(21892), +(21898), +(21912), +(21939), +(21949), +(21952), +(21953), +(21960), +(21961), +(21971), +(21979), +(21987), +(21990), +(21992), +(22009), +(22012), +(22048), +(22068), +(22088), +(22108), +(22109), +(22110), +(22111), +(22112), +(22113), +(22114), +(22115), +(22116), +(22117), +(22118), +(22119), +(22120), +(22121), +(22127), +(22128), +(22167), +(22168), +(22187), +(22189), +(22207), +(22227), +(22272), +(22273), +(22274), +(22284), +(22289), +(22290), +(22291), +(22312), +(22335), +(22336), +(22355), +(22357), +(22371), +(22373), +(22411), +(22412), +(22414), +(22415), +(22416), +(22418), +(22423), +(22426), +(22427), +(22428), +(22429), +(22433), +(22438), +(22482), +(22565), +(22568), +(22570), +(22572), +(22574), +(22575), +(22582), +(22591), +(22592), +(22639), +(22641), +(22646), +(22651), +(22661), +(22662), +(22666), +(22667), +(22677), +(22678), +(22682), +(22687), +(22689), +(22690), +(22691), +(22692), +(22695), +(22709), +(22713), +(22715), +(22742), +(22744), +(22745), +(22751), +(22752), +(22784), +(22785), +(22799), +(22800), +(22814), +(22816), +(22817), +(22818), +(22820), +(22822), +(22823), +(22827), +(22828), +(22829), +(22856), +(22858), +(22859), +(22864), +(22883), +(22885), +(22886), +(22887), +(22893), +(22901), +(22907), +(22909), +(22911), +(22916), +(22919), +(22920), +(22935), +(22947), +(22950), +(22951), +(22959), +(22968), +(22993), +(22994), +(22995), +(22997), +(23015), +(23038), +(23059), +(23064), +(23065), +(23073), +(23102), +(23104), +(23106), +(23114), +(23115), +(23122), +(23123), +(23124), +(23125), +(23135), +(23139), +(23153), +(23154), +(23155), +(23169), +(23170), +(23174), +(23205), +(23206), +(23224), +(23256), +(23262), +(23267), +(23268), +(23275), +(23278), +(23298), +(23301), +(23304), +(23333), +(23335), +(23337), +(23340), +(23359), +(23379), +(23380), +(23381), +(23391), +(23392), +(23402), +(23416), +(23417), +(23451), +(23452), +(23454), +(23460), +(23490), +(23491), +(23493), +(23504), +(23505), +(23546), +(23552), +(23567), +(23568), +(23569), +(23577), +(23580), +(23590), +(23592), +(23601), +(23604), +(23605), +(23620), +(23621), +(23622), +(23623), +(23625), +(23626), +(23627), +(23658), +(23661), +(23675), +(23687), +(23693), +(23694), +(23695), +(23696), +(23699), +(23702), +(23735), +(23736), +(23737), +(23738), +(23765), +(23766), +(23767), +(23768), +(23769), +(23774), +(23775), +(23786), +(23848), +(23850), +(23853), +(23859), +(23860), +(23862), +(23865), +(23881), +(23892), +(23893), +(23894), +(23895), +(23921), +(23922), +(23923), +(23924), +(23925), +(23947), +(23948), +(23952), +(23953), +(23958), +(23959), +(23960), +(23961), +(23962), +(23963), +(23964), +(23967), +(23970), +(23978), +(23979), +(24002), +(24003), +(24016), +(24017), +(24020), +(24023), +(24042), +(24049), +(24053), +(24061), +(24064), +(24097), +(24109), +(24111), +(24131), +(24132), +(24133), +(24134), +(24135), +(24178), +(24179), +(24185), +(24187), +(24193), +(24199), +(24201), +(24208), +(24210), +(24212), +(24213), +(24238), +(24239), +(24241), +(24248), +(24251), +(24253), +(24254), +(24257), +(24259), +(24261), +(24267), +(24274), +(24275), +(24300), +(24306), +(24314), +(24315), +(24316), +(24317), +(24327), +(24331), +(24332), +(24333), +(24335), +(24336), +(24337), +(24339), +(24341), +(24374), +(24378), +(24379), +(24388), +(24393), +(24394), +(24407), +(24408), +(24412), +(24413), +(24414), +(24423), +(24435), +(24458), +(24466), +(24530), +(24573), +(24577), +(24578), +(24579), +(24583), +(24585), +(24586), +(24587), +(24596), +(24600), +(24601), +(24611), +(24617), +(24618), +(24619), +(24637), +(24640), +(24648), +(24649), +(24668), +(24671), +(24672), +(24674), +(24680), +(24684), +(24685), +(24686), +(24690), +(24705), +(24708), +(24709), +(24710), +(24711), +(24712), +(24713), +(24714), +(24715), +(24723), +(24725), +(24726), +(24727), +(24730), +(24732), +(24735), +(24736), +(24740), +(24742), +(24745), +(24747), +(24750), +(24751), +(24752), +(24753), +(24755), +(24757), +(24759), +(24761), +(24762), +(24766), +(24767), +(24769), +(24771), +(24773), +(24776), +(24785), +(24787), +(24791), +(24792), +(24793), +(24802), +(24803), +(24816), +(24817), +(24819), +(24824), +(24825), +(24826), +(24829), +(24831), +(24832), +(24844), +(24857), +(24872), +(24873), +(24875), +(24923), +(24928), +(24935), +(24937), +(24942), +(24950), +(24951), +(24952), +(24953), +(24954), +(24955), +(24957), +(24960), +(24961), +(24962), +(24963), +(24964), +(24965), +(24966), +(24974), +(24975), +(24976), +(24977), +(24982), +(24993), +(25006), +(25008), +(25009), +(25010), +(25011), +(25012), +(25021), +(25022), +(25025), +(25028), +(25050), +(25051), +(25052), +(25054), +(25055), +(25058), +(25104), +(25139), +(25140), +(25143), +(25165), +(25174), +(25185), +(25187), +(25189), +(25190), +(25191), +(25208), +(25210), +(25212), +(25213), +(25217), +(25218), +(25221), +(25222), +(25225), +(25231), +(25233), +(25234), +(25235), +(25236), +(25241), +(25242), +(25245), +(25246), +(25248), +(25251), +(25258), +(25262), +(25263), +(25266), +(25269), +(25272), +(25273), +(25274), +(25275), +(25281), +(25282), +(25286), +(25288), +(25290), +(25291), +(25292), +(25294), +(25295), +(25297), +(25298), +(25299), +(25300), +(25302), +(25304), +(25306), +(25307), +(25308), +(25309), +(25311), +(25312), +(25314), +(25315), +(25316), +(25345), +(25349), +(25363), +(25364), +(25367), +(25368), +(25371), +(25372), +(25373), +(25375), +(25383), +(25384), +(25387), +(25389), +(25391), +(25396), +(25420), +(25424), +(25433), +(25439), +(25442), +(25448), +(25449), +(25454), +(25457), +(25462), +(25464), +(25465), +(25467), +(25471), +(25488), +(25497), +(25501), +(25504), +(25514), +(25515), +(25530), +(25531), +(25595), +(25602), +(25603), +(25605), +(25645), +(25646), +(25650), +(25651), +(25652), +(25668), +(25671), +(25673), +(25677), +(25678), +(25686), +(25710), +(25712), +(25721), +(25725), +(25742), +(25748), +(25755), +(25760), +(25761), +(25762), +(25771), +(25772), +(25777), +(25778), +(25779), +(25781), +(25788), +(25800), +(25802), +(25803), +(25806), +(25807), +(25808), +(25809), +(25810), +(25811), +(25816), +(25821), +(25838), +(25840), +(25843), +(25845), +(25847), +(25848), +(25852), +(25854), +(25856), +(25861), +(25902), +(25903), +(25911), +(25912), +(25913), +(25914), +(25947), +(25992), +(25995), +(25997), +(25999), +(26001), +(26004), +(26005), +(26006), +(26007), +(26008), +(26012), +(26013), +(26017), +(26035), +(26044), +(26050), +(26077), +(26078), +(26079), +(26081), +(26082), +(26090), +(26095), +(26097), +(26098), +(26100), +(26108), +(26125), +(26126), +(26134), +(26141), +(26143), +(26170), +(26181), +(26194), +(26195), +(26196), +(26197), +(26198), +(26206), +(26207), +(26211), +(26218), +(26226), +(26233), +(26258), +(26259), +(26275), +(26281), +(26282), +(26339), +(26350), +(26363), +(26364), +(26365), +(26366), +(26367), +(26368), +(26369), +(26370), +(26371), +(26372), +(26374), +(26375), +(26377), +(26406), +(26408), +(26409), +(26410), +(26412), +(26414), +(26415), +(26419), +(26446), +(26448), +(26470), +(26476), +(26548), +(26556), +(26561), +(26565), +(26572), +(26584), +(26601), +(26610), +(26613), +(26616), +(26622), +(26623), +(26624), +(26625), +(26636), +(26639), +(26641), +(26649), +(26654), +(26663), +(26679), +(26688), +(26693), +(26740), +(26742), +(26748), +(26791), +(26796), +(26799), +(26800), +(26839), +(26861), +(26862), +(26863), +(26864), +(26865), +(26866), +(26867), +(26884), +(26890), +(26899), +(26923), +(26924), +(26968), +(26978), +(26979), +(26980), +(26981), +(26982), +(26984), +(26985), +(26986), +(26987), +(26988), +(26989), +(26990), +(26992), +(26995), +(26996), +(27000), +(27001), +(27002), +(27003), +(27004), +(27005), +(27006), +(27007), +(27008), +(27010), +(27013), +(27014), +(27016), +(27019), +(27021), +(27024), +(27030), +(27031), +(27047), +(27048), +(27049), +(27050), +(27051), +(27060), +(27065), +(27067), +(27068), +(27069), +(27070), +(27071), +(27072), +(27073), +(27074), +(27075), +(27078), +(27079), +(27126), +(27132), +(27135), +(27136), +(27137), +(27138), +(27140), +(27142), +(27154), +(27174), +(27175), +(27176), +(27177), +(27180), +(27187), +(27189), +(27209), +(27210), +(27211), +(27215), +(27216), +(27217), +(27218), +(27219), +(27220), +(27223), +(27224), +(27228), +(27243), +(27254), +(27255), +(27258), +(27261), +(27263), +(27267), +(27270), +(27274), +(27275), +(27276), +(27277), +(27281), +(27286), +(27288), +(27290), +(27360), +(27375), +(27376), +(27378), +(27379), +(27380), +(27381), +(27384), +(27385), +(27386), +(27387), +(27389), +(27390), +(27391), +(27392), +(27393), +(27395), +(27396), +(27397), +(27398), +(27441), +(27448), +(27486), +(27526), +(27527), +(27532), +(27541), +(27547), +(27548), +(27549), +(27550), +(27552), +(27553), +(27554), +(27555), +(27556), +(27557), +(27559), +(27565), +(27567), +(27571), +(27572), +(27573), +(27576), +(27577), +(27580), +(27581), +(27582), +(27584), +(27605), +(27606), +(27608), +(27609), +(27611), +(27613), +(27615), +(27620), +(27624), +(27626), +(27632), +(27633), +(27634), +(27635), +(27636), +(27637), +(27638), +(27640), +(27648), +(27655), +(27662), +(27673), +(27677), +(27686), +(27752), +(27754), +(27755), +(27756), +(27760), +(27765), +(27794), +(27806), +(27814), +(27819), +(27841), +(27849), +(27852), +(27860), +(27861), +(27863), +(27864), +(27865), +(27868), +(27873), +(27874), +(27891), +(27907), +(27909), +(27910), +(27915), +(27919), +(27931), +(27937), +(27983), +(27991), +(27992), +(27994), +(27995), +(28030), +(28099), +(28133), +(28147), +(28149), +(28167), +(28169), +(28239), +(28251), +(28252), +(28253), +(28254), +(28255), +(28256), +(28257), +(28258), +(28259), +(28260), +(28261), +(28262), +(28263), +(28265), +(28271), +(28272), +(28276), +(28287), +(28293), +(28299), +(28301), +(28303), +(28306), +(28308), +(28310), +(28314), +(28318), +(28319), +(28320), +(28321), +(28329), +(28336), +(28337), +(28342), +(28350), +(28351), +(28375), +(28393), +(28394), +(28396), +(28397), +(28410), +(28412), +(28418), +(28419), +(28420), +(28428), +(28431), +(28434), +(28439), +(28444), +(28445), +(28467), +(28470), +(28478), +(28516), +(28522), +(28597), +(28601), +(28608), +(28614), +(28624), +(28674), +(28676), +(28678), +(28684), +(28685), +(28689), +(28690), +(28691), +(28692), +(28696), +(28698), +(28702), +(28715), +(28718), +(28720), +(28722), +(28723), +(28724), +(28734), +(28750), +(28772), +(28776), +(28783), +(28788), +(28790), +(28791), +(28793), +(28795), +(28810), +(28824), +(28825), +(28826), +(28827), +(28836), +(28839), +(28858), +(28859), +(28872), +(28873), +(28880), +(28882), +(28883), +(28887), +(28896), +(28899), +(28900), +(28901), +(28902), +(28913), +(28969), +(28993), +(29001), +(29002), +(29003), +(29006), +(29044), +(29054), +(29058), +(29060), +(29098), +(29117), +(29126), +(29127), +(29128), +(29129), +(29134), +(29135), +(29136), +(29137), +(29138), +(29139), +(29151), +(29155), +(29157), +(29158), +(29160), +(29164), +(29166), +(29168), +(29170), +(29175), +(29182), +(29185), +(29188), +(29194), +(29196), +(29198), +(29228), +(29290), +(29295), +(29300), +(29306), +(29314), +(29317), +(29319), +(29320), +(29341), +(29362), +(29364), +(29380), +(29386), +(29395), +(29405), +(29407), +(29408), +(29425), +(29426), +(29427), +(29428), +(29435), +(29436), +(29443), +(29473), +(29487), +(29492), +(29494), +(29495), +(29497), +(29500), +(29502), +(29515), +(29516), +(29519), +(29522), +(29528), +(29539), +(29540), +(29543), +(29544), +(29546), +(29555), +(29560), +(29561), +(29562), +(29563), +(29564), +(29567), +(29570), +(29572), +(29574), +(29575), +(29576), +(29577), +(29578), +(29580), +(29581), +(29582), +(29583), +(29585), +(29586), +(29587), +(29607), +(29609), +(29638), +(29639), +(29640), +(29641), +(29644), +(29646), +(29647), +(29652), +(29653), +(29655), +(29661), +(29665), +(29666), +(29667), +(29670), +(29673), +(29675), +(29676), +(29677), +(29679), +(29684), +(29690), +(29703), +(29704), +(29707), +(29711), +(29712), +(29716), +(29722), +(29765), +(29768), +(29815), +(29832), +(29845), +(29847), +(29848), +(29850), +(29879), +(29881), +(29896), +(29901), +(29903), +(29906), +(29907), +(29909), +(29915), +(29916), +(29917), +(29925), +(29926), +(29927), +(29928), +(29930), +(29953), +(29954), +(29955), +(29956), +(29964), +(29990), +(29991), +(30010), +(30013), +(30014), +(30016), +(30019), +(30022), +(30036), +(30039), +(30044), +(30050), +(30053), +(30055), +(30069), +(30070), +(30077), +(30081), +(30099), +(30100), +(30102), +(30103), +(30104), +(30105), +(30108), +(30112), +(30113), +(30115), +(30121), +(30127), +(30128), +(30130), +(30131), +(30151), +(30153), +(30164), +(30173), +(30175), +(30177), +(30178), +(30180), +(30194), +(30195), +(30197), +(30198), +(30202), +(30213), +(30218), +(30219), +(30223), +(30238), +(30253), +(30269), +(30270), +(30271), +(30280), +(30285), +(30324), +(30330), +(30335), +(30351), +(30353), +(30356), +(30357), +(30358), +(30383), +(30395), +(30400), +(30401), +(30402), +(30404), +(30405), +(30412), +(30421), +(30422), +(30423), +(30424), +(30430), +(30433), +(30435), +(30448), +(30449), +(30451), +(30455), +(30459), +(30463), +(30464), +(30465), +(30466), +(30467), +(30468), +(30471), +(30474), +(30478), +(30479), +(30481), +(30493), +(30495), +(30500), +(30501), +(30504), +(30505), +(30507), +(30512), +(30520), +(30528), +(30530), +(30545), +(30546), +(30601), +(30605), +(30606), +(30607), +(30608), +(30609), +(30614), +(30615), +(30619), +(30621), +(30637), +(30638), +(30639), +(30641), +(30643), +(30646), +(30647), +(30648), +(30651), +(30652), +(30653), +(30654), +(30661), +(30686), +(30687), +(30688), +(30689), +(30691), +(30695), +(30719), +(30736), +(30740), +(30751), +(30753), +(30755), +(30756), +(30768), +(30817), +(30822), +(30830), +(30832), +(30838), +(30839), +(30846), +(30849), +(30850), +(30854), +(30875), +(30876), +(30877), +(30878), +(30888), +(30889), +(30890), +(30900), +(30901), +(30909), +(30910), +(30923), +(30926), +(30932), +(30936), +(30937), +(30942), +(30943), +(30944), +(30945), +(30967), +(30971), +(30977), +(30980), +(30981), +(30984), +(30986), +(30989), +(30990), +(30992), +(31008), +(31009), +(31012), +(31015), +(31016), +(31018), +(31022), +(31041), +(31042), +(31043), +(31046), +(31069), +(31117), +(31125), +(31139), +(31249), +(31257), +(31262), +(31263), +(31270), +(31271), +(31272), +(31274), +(31275), +(31279), +(31280), +(31281), +(31282), +(31284), +(31286), +(31287), +(31288), +(31289), +(31290), +(31292), +(31295), +(31296), +(31305), +(31306), +(31312), +(31316), +(31319), +(31330), +(31334), +(31337), +(31339), +(31345), +(31366), +(31367), +(31368), +(31376), +(31378), +(31381), +(31387), +(31389), +(31390), +(31394), +(31397), +(31399), +(31400), +(31401), +(31402), +(31404), +(31405), +(31406), +(31407), +(31410), +(31415), +(31416), +(31417), +(31418), +(31419), +(31420), +(31423), +(31425), +(31426), +(31427), +(31436), +(31445), +(31446), +(31457), +(31464), +(31477), +(31481), +(31486), +(31513), +(31516), +(31535), +(31547), +(31551), +(31552), +(31553), +(31566), +(31589), +(31595), +(31596), +(31600), +(31601), +(31602), +(31604), +(31609), +(31610), +(31618), +(31620), +(31622), +(31623), +(31626), +(31627), +(31629), +(31651), +(31662), +(31664), +(31703), +(31705), +(31707), +(31709), +(31713), +(31715), +(31717), +(31718), +(31721), +(31724), +(31729), +(31733), +(31734), +(31739), +(31740), +(31741), +(31742), +(31743), +(31747), +(31751), +(31754), +(31758), +(31759), +(31764), +(31766), +(31772), +(31779), +(31782), +(31784), +(31789), +(31790), +(31803), +(31804), +(31807), +(31808), +(31810), +(31811), +(31812), +(31813), +(31814), +(31815), +(31816), +(31819), +(31827), +(31843), +(31863), +(31864), +(31865), +(31893), +(31898), +(31907), +(31911), +(31916), +(31923), +(31935), +(31939), +(31942), +(31946), +(31948), +(31955), +(31956), +(31961), +(31965), +(31966), +(31971), +(31972), +(31973), +(31975), +(31976), +(31977), +(31978), +(31984), +(31988), +(31994), +(31996), +(31999), +(32000), +(32001), +(32002), +(32004), +(32005), +(32006), +(32009), +(32010), +(32011), +(32012), +(32013), +(32015), +(32017), +(32018), +(32019), +(32020), +(32021), +(32022), +(32024), +(32025), +(32026), +(32039), +(32049), +(32055), +(32056), +(32063), +(32065), +(32071), +(32076), +(32077), +(32080), +(32082), +(32092), +(32093), +(32094), +(32095), +(32103), +(32104), +(32105), +(32110), +(32120), +(32125), +(32126), +(32129), +(32131), +(32132), +(32133), +(32139), +(32154), +(32168), +(32175), +(32176), +(32190), +(32197), +(32202), +(32211), +(32224), +(32231), +(32247), +(32248), +(32261), +(32268), +(32270), +(32300), +(32306), +(32315), +(32317), +(32319), +(32320), +(32321), +(32323), +(32325), +(32328), +(32329), +(32330), +(32337), +(32338), +(32346), +(32361), +(32363), +(32364), +(32369), +(32370), +(32376), +(32378), +(32379), +(32386), +(32388), +(32389), +(32390), +(32391), +(32405), +(32414), +(32415), +(32416), +(32417), +(32418), +(32422), +(32428), +(32430), +(32431), +(32441), +(32445), +(32474), +(32491), +(32546), +(32550), +(32578), +(32583), +(32588), +(32593), +(32594), +(32595), +(32605), +(32606), +(32639), +(32643), +(32645), +(32652), +(32654), +(32666), +(32674), +(32675), +(32677), +(32678), +(32679), +(32682), +(32683), +(32684), +(32689), +(32690), +(32691), +(32693), +(32699), +(32700), +(32707), +(32709), +(32716), +(32721), +(32733), +(32734), +(32735), +(32736), +(32738), +(32739), +(32740), +(32741), +(32742), +(32747), +(32748), +(32749), +(32751), +(32752), +(32759), +(32769), +(32770), +(32771), +(32772), +(32774), +(32778), +(32779), +(32784), +(32797), +(32829), +(32830), +(32831), +(32835), +(32846), +(32858), +(32860), +(32862), +(32863), +(32864), +(32889), +(32897), +(32901), +(32902), +(32903), +(32904), +(32905), +(32906), +(32907), +(32908), +(32909), +(32913), +(32915), +(32916), +(32917), +(32919), +(32921), +(32922), +(32924), +(32926), +(32935), +(32940), +(32950), +(32959), +(32960), +(32962), +(32967), +(32969), +(32971), +(32984), +(32996), +(33031), +(33040), +(33044), +(33045), +(33047), +(33049), +(33051), +(33055), +(33056), +(33068), +(33069), +(33072), +(33073), +(33074), +(33077), +(33078), +(33079), +(33080), +(33081), +(33082), +(33086), +(33096), +(33098), +(33126), +(33129), +(33130), +(33144), +(33173), +(33175), +(33196), +(33197), +(33198), +(33206), +(33227), +(33230), +(33246), +(33247), +(33324), +(33326), +(33331), +(33335), +(33346), +(33360), +(33382), +(33383), +(33385), +(33387), +(33389), +(33392), +(33401), +(33404), +(33417), +(33419), +(33462), +(33463), +(33480), +(33482), +(33483), +(33487), +(33493), +(33502), +(33526), +(33527), +(33528), +(33529), +(33534), +(33535), +(33542), +(33552), +(33553), +(33554), +(33619), +(33620), +(33625), +(33626), +(33628), +(33631), +(33632), +(33640), +(33641), +(33643), +(33659), +(33661), +(33665), +(33684), +(33688), +(33689), +(33698), +(33699), +(33700), +(33709), +(33723), +(33728), +(33731), +(33745), +(33750), +(33763), +(33768), +(33781), +(33786), +(33787), +(33789), +(33792), +(33793), +(33794), +(33813), +(33824), +(33825), +(33827), +(33832), +(33833), +(33837), +(33844), +(33849), +(33850), +(33865), +(33871), +(33876), +(33878), +(33899), +(33907), +(33910), +(33911), +(33912), +(33913), +(33914), +(33925), +(33938), +(33947), +(33951), +(33960), +(33964), +(33969), +(33970), +(33975), +(33982), +(33983), +(33985), +(33986), +(33987), +(33988), +(33989), +(34014), +(34020), +(34025), +(34036), +(34071), +(34073), +(34083), +(34087), +(34088), +(34089), +(34092), +(34093), +(34095), +(34097), +(34099), +(34107), +(34108), +(34110), +(34112), +(34113), +(34120), +(34130), +(34132), +(34135), +(34138), +(34139), +(34143), +(34149), +(34150), +(34163), +(34171), +(34172), +(34176), +(34177), +(34213), +(34214), +(34215), +(34216), +(34217), +(34218), +(34219), +(34232), +(34243), +(34259), +(34298), +(34344), +(34345), +(34346), +(34347), +(34348), +(34351), +(34352), +(34353), +(34354), +(34357), +(34361), +(34363), +(34366), +(34370), +(34379), +(34389), +(34390), +(34391), +(34394), +(34400), +(34411), +(34412), +(34413), +(34414), +(34415), +(34416), +(34417), +(34418), +(34419), +(34423), +(34425), +(34428), +(34432), +(34437), +(34438), +(34439), +(34445), +(34446), +(34447), +(34451), +(34463), +(34490), +(34510), +(34520), +(34578), +(34580), +(34587), +(34613), +(34614), +(34615), +(34616), +(34618), +(34620), +(34625), +(34626), +(34629), +(34637), +(34639), +(34640), +(34641), +(34643), +(34644), +(34645), +(34650), +(34653), +(34654), +(34655), +(34661), +(34665), +(34672), +(34694), +(34695), +(34696), +(34697), +(34709), +(34714), +(34715), +(34719), +(34722), +(34745), +(34752), +(34784), +(34786), +(34787), +(34788), +(34789), +(34793), +(34794), +(34797), +(34798), +(34799), +(34800), +(34802), +(34809), +(34811), +(34812), +(34820), +(34824), +(34828), +(34829), +(34841), +(34852), +(34856), +(34875), +(34879), +(34881), +(34883), +(34886), +(34889), +(34891), +(34893), +(34906), +(34907), +(34913), +(34914), +(34916), +(34917), +(34920), +(34922), +(34924), +(34925), +(34930), +(34931), +(34940), +(34941), +(34942), +(34945), +(34969), +(34974), +(34975), +(34976), +(34984), +(34996), +(35004), +(35010), +(35011), +(35012), +(35013), +(35033), +(35034), +(35039), +(35047), +(35049), +(35054), +(35055), +(35056), +(35062), +(35065), +(35066), +(35067), +(35069), +(35071), +(35072), +(35088), +(35089), +(35092), +(35096), +(35101), +(35105), +(35106), +(35107), +(35112), +(35115), +(35117), +(35120), +(35144), +(35147), +(35161), +(35178), +(35179), +(35180), +(35182), +(35183), +(35185), +(35189), +(35195), +(35201), +(35207), +(35229), +(35231), +(35234), +(35238), +(35243), +(35244), +(35263), +(35267), +(35273), +(35280), +(35290), +(35291), +(35292), +(35293), +(35294), +(35295), +(35313), +(35314), +(35316), +(35317), +(35318), +(35321), +(35323), +(35325), +(35326), +(35328), +(35329), +(35331), +(35332), +(35333), +(35334), +(35335), +(35339), +(35346), +(35353), +(35371), +(35376), +(35377), +(35382), +(35387), +(35389), +(35392), +(35395), +(35401), +(35410), +(35412), +(35424), +(35460), +(35466), +(35472), +(35473), +(35493), +(35499), +(35501), +(35506), +(35507), +(35510), +(35511), +(35514), +(35518), +(35519), +(35556), +(35570), +(35621), +(35686), +(35718), +(35727), +(35728), +(35735), +(35741), +(35742), +(35748), +(35759), +(35760), +(35771), +(35772), +(35780), +(35783), +(35839), +(35846), +(35851), +(35853), +(35857), +(35871), +(35873), +(35877), +(35913), +(35914), +(35916), +(35918), +(35919), +(35920), +(35927), +(35928), +(35932), +(35944), +(35945), +(35946), +(35949), +(35954), +(35955), +(35963), +(35964), +(35965), +(35966), +(35967), +(35968), +(35969), +(35970), +(35971), +(35972), +(35973), +(35974), +(35975), +(35976), +(35977), +(35978), +(35979), +(35980), +(35981), +(35982), +(35983), +(35984), +(35985), +(35986), +(35987), +(35988), +(35989), +(35990), +(35997), +(35998), +(35999), +(36002), +(36020), +(36021), +(36023), +(36025), +(36033), +(36052), +(36054), +(36073), +(36088), +(36093), +(36094), +(36095), +(36099), +(36100), +(36102), +(36115), +(36123), +(36138), +(36140), +(36141), +(36145), +(36152), +(36153), +(36170), +(36173), +(36176), +(36181), +(36207), +(36208), +(36224), +(36227), +(36228), +(36237), +(36238), +(36246), +(36247), +(36250), +(36276), +(36277), +(36279), +(36288), +(36295), +(36296), +(36299), +(36310), +(36312), +(36314), +(36328), +(36332), +(36333), +(36339), +(36340), +(36341), +(36342), +(36343), +(36344), +(36345), +(36348), +(36380), +(36398), +(36399), +(36401), +(36402), +(36404), +(36414), +(36415), +(36416), +(36417), +(36433), +(36434), +(36435), +(36436), +(36438), +(36439), +(36441), +(36447), +(36448), +(36457), +(36458), +(36461), +(36464), +(36469), +(36470), +(36475), +(36478), +(36482), +(36483), +(36488), +(36500), +(36507), +(36508), +(36509), +(36516), +(36517), +(36518), +(36527), +(36534), +(36536), +(36538), +(36539), +(36540), +(36541), +(36554), +(36558), +(36570), +(36571), +(36578), +(36586), +(36590), +(36594), +(36601), +(36604), +(36606), +(36608), +(36609), +(36612), +(36622), +(36623), +(36624), +(36625), +(36627), +(36628), +(36632), +(36638), +(36641), +(36642), +(36645), +(36646), +(36647), +(36650), +(36655), +(36656), +(36659), +(36664), +(36671), +(36677), +(36678), +(36679), +(36710), +(36711), +(36712), +(36713), +(36714), +(36732), +(36739), +(36778), +(36779), +(36780), +(36781), +(36787), +(36789), +(36791), +(36796), +(36801), +(36805), +(36806), +(36807), +(36810), +(36812), +(36814), +(36822), +(36825), +(36831), +(36832), +(36833), +(36836), +(36838), +(36839), +(36840), +(36841), +(36842), +(36843), +(36844), +(36863), +(36864), +(36866), +(36872), +(36876), +(36877), +(36886), +(36891), +(36894), +(36905), +(36906), +(36909), +(36913), +(36914), +(36916), +(36917), +(36919), +(36920), +(36921), +(36924), +(36927), +(36929), +(36947), +(36956), +(36957), +(36965), +(36966), +(36971), +(36972), +(36974), +(36979), +(36980), +(36983), +(36984), +(36986), +(36987), +(36988), +(36990), +(36991), +(37027), +(37028), +(37030), +(37031), +(37054), +(37057), +(37067), +(37073), +(37074), +(37082), +(37089), +(37104), +(37110), +(37111), +(37112), +(37113), +(37121), +(37122), +(37123), +(37126), +(37132), +(37133), +(37136), +(37138), +(37154), +(37156), +(37162), +(37176), +(37208), +(37216), +(37221), +(37249), +(37250), +(37251), +(37252), +(37254), +(37255), +(37257), +(37259), +(37260), +(37271), +(37272), +(37273), +(37274), +(37275), +(37276), +(37277), +(37320), +(37321), +(37322), +(37323), +(37328), +(37329), +(37330), +(37331), +(37332), +(37334), +(37335), +(37359), +(37361), +(37369), +(37372), +(37387), +(37389), +(37412), +(37417), +(37421), +(37450), +(37455), +(37456), +(37460), +(37462), +(37463), +(37470), +(37479), +(37486), +(37500), +(37506), +(37511), +(37527), +(37532), +(37537), +(37540), +(37548), +(37551), +(37552), +(37554), +(37563), +(37566), +(37572), +(37577), +(37578), +(37579), +(37580), +(37581), +(37589), +(37591), +(37592), +(37596), +(37597), +(37599), +(37602), +(37621), +(37628), +(37629), +(37630), +(37632), +(37634), +(37646), +(37647), +(37654), +(37661), +(37662), +(37664), +(37667), +(37668), +(37675), +(37681), +(37685), +(37695), +(37700), +(37711), +(37717), +(37718), +(37719), +(37727), +(37749), +(37770), +(37777), +(37778), +(37798), +(37800), +(37801), +(37802), +(37803), +(37804), +(37805), +(37806), +(37807), +(37808), +(37809), +(37810), +(37811), +(37813), +(37823), +(37834), +(37838), +(37839), +(37840), +(37841), +(37847), +(37850), +(37851), +(37856), +(37862), +(37865), +(37867), +(37871), +(37892), +(37894), +(37906), +(37908), +(37910), +(37921), +(37922), +(37930), +(37933), +(37937), +(37940), +(37945), +(37946), +(37950), +(37956), +(37958), +(37962), +(37965), +(37967), +(37968), +(37972), +(37973), +(37974), +(37975), +(37978), +(37979), +(37986), +(37988), +(37992), +(37998), +(38002), +(38007), +(38009), +(38010), +(38023), +(38024), +(38025), +(38027), +(38029), +(38030), +(38032), +(38034), +(38035), +(38047), +(38048), +(38051), +(38052), +(38053), +(38056), +(38058), +(38059), +(38063), +(38065), +(38066), +(38067), +(38074), +(38075), +(38076), +(38078), +(38083), +(38084), +(38085), +(38093), +(38094), +(38095), +(38107), +(38109), +(38113), +(38120), +(38122), +(38125), +(38127), +(38129), +(38133), +(38134), +(38135), +(38136), +(38145), +(38146), +(38147), +(38148), +(38149), +(38153), +(38154), +(38155), +(38167), +(38177), +(38178), +(38182), +(38183), +(38187), +(38193), +(38203), +(38204), +(38205), +(38208), +(38209), +(38210), +(38213), +(38223), +(38226), +(38233), +(38234), +(38238), +(38239), +(38240), +(38243), +(38245), +(38246), +(38252), +(38253), +(38254), +(38259), +(38260), +(38262), +(38263), +(38264), +(38265), +(38267), +(38274), +(38275), +(38276), +(38277), +(38279), +(38280), +(38285), +(38295), +(38310), +(38313), +(38324), +(38328), +(38329), +(38330), +(38333), +(38338), +(38340), +(38342), +(38344), +(38363), +(38366), +(38370), +(38372), +(38374), +(38377), +(38378), +(38383), +(38386), +(38387), +(38391), +(38400), +(38401), +(38441), +(38446), +(38461), +(38465), +(38470), +(38474), +(38495), +(38496), +(38505), +(38509), +(38510), +(38520), +(38523), +(38526), +(38534), +(38535), +(38538), +(38543), +(38554), +(38556), +(38557), +(38558), +(38559), +(38560), +(38561), +(38562), +(38563), +(38564), +(38565), +(38566), +(38567), +(38568), +(38569), +(38570), +(38572), +(38580), +(38582), +(38584), +(38585), +(38586), +(38588), +(38591), +(38595), +(38598), +(38606), +(38616), +(38617), +(38621), +(38625), +(38626), +(38628), +(38630), +(38631), +(38634), +(38636), +(38641), +(38643), +(38645), +(38657), +(38658), +(38661), +(38663), +(38669), +(38692), +(38697), +(38699), +(38704), +(38708), +(38721), +(38723), +(38731), +(38739), +(38742), +(38753), +(38760), +(38762), +(38764), +(38765), +(38767), +(38768), +(38770), +(38772), +(38775), +(38777), +(38791), +(38797), +(38798), +(38801), +(38804), +(38806), +(38807), +(38808), +(38815), +(38816), +(38817), +(38821), +(38822), +(38823), +(38824), +(38825), +(38826), +(38827), +(38846), +(38848), +(38849), +(38851), +(38852), +(38858), +(38859), +(38861), +(38863), +(38864), +(38875), +(38879), +(38880), +(38881), +(38882), +(38883), +(38884), +(38887), +(38894), +(38895), +(38896), +(38897), +(38899), +(38904), +(38907), +(38909), +(38913), +(38914), +(38915), +(38918), +(38919), +(38921), +(38923), +(38926), +(38930), +(38935), +(38940), +(38941), +(38942), +(38943), +(38945), +(38946), +(38950), +(38952), +(38959), +(38967), +(38971), +(38985), +(38986), +(38987), +(38988), +(38989), +(38990), +(38992), +(38995), +(39000), +(39002), +(39006), +(39009), +(39015), +(39016), +(39017), +(39019), +(39020), +(39021), +(39022), +(39023), +(39025), +(39026), +(39029), +(39032), +(39039), +(39044), +(39046), +(39047), +(39053), +(39054), +(39058), +(39060), +(39061), +(39062), +(39064), +(39065), +(39066), +(39068), +(39069), +(39070), +(39076), +(39077), +(39078), +(39079), +(39083), +(39087), +(39097), +(39098), +(39099), +(39101), +(39116), +(39119), +(39120), +(39121), +(39122), +(39123), +(39125), +(39129), +(39135), +(39136), +(39145), +(39153), +(39157), +(39159), +(39160), +(39164), +(39165), +(39171), +(39172), +(39174), +(39176), +(39182), +(39192), +(39196), +(39197), +(39198), +(39202), +(39204), +(39207), +(39210), +(39212), +(39214), +(39215), +(39226), +(39229), +(39230), +(39252), +(39258), +(39262), +(39267), +(39268), +(39270), +(39271), +(39285), +(39293), +(39297), +(39299), +(39309), +(39322), +(39328), +(39329), +(39332), +(39337), +(39339), +(39349), +(39367), +(39371), +(39378), +(39386), +(39396), +(39412), +(39413), +(39415), +(39419), +(39435), +(39436), +(39445), +(39449), +(39456), +(39457), +(39460), +(39474), +(39475), +(39476), +(39477), +(39512), +(39513), +(39528), +(39529), +(39544), +(39560), +(39566), +(39574), +(39582), +(39587), +(39590), +(39592), +(39595), +(39600), +(39609), +(39621), +(39622), +(39661), +(39665), +(39668), +(39669), +(39670), +(39674), +(39675), +(39676), +(39697), +(39703), +(39794), +(39796), +(39810), +(39812), +(39826), +(39830), +(39835), +(39837), +(39838), +(39857), +(39865), +(39883), +(39886), +(39901), +(39904), +(39908), +(39920), +(39928), +(39945), +(39948), +(39955), +(39956), +(39967), +(39972), +(39979), +(39980), +(39995), +(39996), +(40011), +(40019), +(40032), +(40041), +(40055), +(40057), +(40063), +(40066), +(40071), +(40074), +(40081), +(40084), +(40086), +(40097), +(40099), +(40102), +(40109), +(40119), +(40123), +(40124), +(40146), +(40157), +(40165), +(40166), +(40167), +(40173), +(40185), +(40191), +(40193), +(40197), +(40198), +(40199), +(40220), +(40225), +(40227), +(40228), +(40239), +(40248), +(40251), +(40254), +(40259), +(40279), +(40290), +(40293), +(40303), +(40310), +(40311), +(40312), +(40313), +(40317), +(40321), +(40322), +(40325), +(40327), +(40334), +(40337), +(40339), +(40344), +(40346), +(40347), +(40348), +(40351), +(40356), +(40357), +(40358), +(40363), +(40366), +(40367), +(40368), +(40384), +(40385), +(40392), +(40400), +(40406), +(40411), +(40412), +(40413), +(40414), +(40415), +(40416), +(40420), +(40423), +(40427), +(40429), +(40430), +(40431), +(40434), +(40449), +(40450), +(40471), +(40472), +(40481), +(40486), +(40489), +(40491), +(40493), +(40497), +(40504), +(40505), +(40507), +(40508), +(40509), +(40525), +(40536), +(40542), +(40554), +(40560), +(40563), +(40564), +(40565), +(40569), +(40571), +(40581), +(40585), +(40595), +(40597), +(40602), +(40604), +(40605), +(40608), +(40616), +(40620), +(40633), +(40635), +(40639), +(40641), +(40643), +(40645), +(40646), +(40651), +(40652), +(40671), +(40672), +(40685), +(40726), +(40728), +(40736), +(40739), +(40740), +(40742), +(40751), +(40758), +(40770), +(40772), +(40777), +(40778), +(40787), +(40796), +(40801), +(40810), +(40814), +(40822), +(40827), +(40835), +(40837), +(40838), +(40842), +(40843), +(40844), +(40846), +(40856), +(40859), +(40860), +(40861), +(40864), +(40872), +(40873), +(40876), +(40877), +(40881), +(40886), +(40888), +(40890), +(40892), +(40893), +(40894), +(40895), +(40901), +(40903), +(40906), +(40909), +(40917), +(40926), +(40928), +(40930), +(40935), +(40945), +(40951), +(40954), +(40958), +(40964), +(40965), +(40968), +(40969), +(40970), +(40972), +(40976), +(40991), +(41001), +(41003), +(41028), +(41029), +(41032), +(41035), +(41044), +(41047), +(41050), +(41052), +(41054), +(41055), +(41060), +(41063), +(41065), +(41069), +(41070), +(41072), +(41075), +(41080), +(41082), +(41083), +(41084), +(41092), +(41093), +(41103), +(41109), +(41115), +(41116), +(41121), +(41137), +(41139), +(41152), +(41169), +(41170), +(41171), +(41177), +(41178), +(41179), +(41180), +(41182), +(41183), +(41184), +(41186), +(41187), +(41188), +(41189), +(41190), +(41192), +(41197), +(41198), +(41213), +(41214), +(41225), +(41226), +(41227), +(41228), +(41229), +(41230), +(41231), +(41238), +(41241), +(41247), +(41250), +(41255), +(41256), +(41259), +(41264), +(41265), +(41270), +(41272), +(41278), +(41279), +(41280), +(41281), +(41283), +(41291), +(41299), +(41302), +(41332), +(41334), +(41335), +(41336), +(41338), +(41345), +(41346), +(41351), +(41352), +(41353), +(41355), +(41360), +(41363), +(41368), +(41370), +(41372), +(41373), +(41374), +(41375), +(41377), +(41378), +(41383), +(41384), +(41388), +(41389), +(41390), +(41392), +(41394), +(41395), +(41396), +(41407), +(41410), +(41411), +(41419), +(41421), +(41426), +(41439), +(41440), +(41442), +(41448), +(41450), +(41451), +(41456), +(41461), +(41467), +(41468), +(41470), +(41471), +(41472), +(41473), +(41483), +(41484), +(41485), +(41486), +(41487), +(41489), +(41490), +(41491), +(41492), +(41519), +(41526), +(41528), +(41533), +(41540), +(41543), +(41544), +(41546), +(41547), +(41548), +(41549), +(41558), +(41559), +(41563), +(41564), +(41565), +(41567), +(41568), +(41571), +(41578), +(41579), +(41580), +(41581), +(41586), +(41588), +(41592), +(41596), +(41597), +(41598), +(41601), +(41621), +(41622), +(41625), +(41626), +(41633), +(41637), +(41911), +(41914), +(41916), +(41917), +(41926), +(41931), +(41932), +(41933), +(41936), +(41937), +(41939), +(41940), +(41957), +(41958), +(41959), +(41960), +(41961), +(41964), +(41965), +(41978), +(41980), +(41984), +(41985), +(41990), +(42002), +(42003), +(42013), +(42018), +(42020), +(42021), +(42024), +(42025), +(42053), +(42058), +(42129), +(42131), +(42132), +(42133), +(42139), +(42142), +(42144), +(42149), +(42150), +(42152), +(42161), +(42165), +(42169), +(42185), +(42203), +(42246), +(42299), +(42313), +(42315), +(42319), +(42320), +(42322), +(42324), +(42325), +(42326), +(42328), +(42329), +(42330), +(42331), +(42332), +(42333), +(42337), +(42349), +(42360), +(42363), +(42368), +(42369), +(42370), +(42371), +(42372), +(42380), +(42382), +(42383), +(42384), +(42385), +(42389), +(42395), +(42396), +(42397), +(42399), +(42400), +(42401), +(42402), +(42411), +(42414), +(42426), +(42434), +(42435), +(42441), +(42443), +(42447), +(42455), +(42463), +(42476), +(42483), +(42485), +(42486), +(42488), +(42489), +(42502), +(42512), +(42514), +(42516), +(42518), +(42535), +(42537), +(42540), +(42560), +(42561), +(42574), +(42579), +(42580), +(42583), +(42587), +(42611), +(42628), +(42632), +(42633), +(42634), +(42635), +(42653), +(42658), +(42670), +(42671), +(42672), +(42696), +(42702), +(42710), +(42711), +(42717), +(42719), +(42721), +(42724), +(42725), +(42730), +(42733), +(42739), +(42740), +(42741), +(42746), +(42747), +(42756), +(42762), +(42767), +(42772), +(42780), +(42781), +(42782), +(42783), +(42785), +(42789), +(42790), +(42791), +(42793), +(42799), +(42802), +(42803), +(42804), +(42811), +(42826), +(42832), +(42833), +(42834), +(42841), +(42842), +(42843), +(42846), +(42853), +(42858), +(42859), +(42867), +(42869), +(42870), +(42872), +(42873), +(42878), +(42879), +(42880), +(42889), +(42890), +(42891), +(42894), +(42895), +(42896), +(42897), +(42902), +(42903), +(42904), +(42907), +(42908), +(42913), +(42914), +(42953), +(42964), +(42972), +(42978), +(42995), +(42999), +(43003), +(43004), +(43006), +(43036), +(43037), +(43043), +(43044), +(43058), +(43061), +(43063), +(43064), +(43065), +(43067), +(43075), +(43077), +(43083), +(43084), +(43086), +(43087), +(43090), +(43093), +(43094), +(43097), +(43100), +(43103), +(43104), +(43107), +(43108), +(43122), +(43123), +(43125), +(43128), +(43130), +(43131), +(43132), +(43133), +(43137), +(43138), +(43140), +(43150), +(43151), +(43153), +(43156), +(43157), +(43159), +(43178), +(43187), +(43191), +(43192), +(43193), +(43194), +(43195), +(43196), +(43197), +(43198), +(43199), +(43202), +(43205), +(43206), +(43225), +(43228), +(43235), +(43243), +(43245), +(43246), +(43256), +(43259), +(43260), +(43261), +(43262), +(43267), +(43268), +(43270), +(43273), +(43286), +(43287), +(43288), +(43292), +(43297), +(43298), +(43299), +(43300), +(43301), +(43303), +(43305), +(43309), +(43315), +(43325), +(43330), +(43334), +(43337), +(43340), +(43341), +(43345), +(43346), +(43347), +(43348), +(43352), +(43353), +(43354), +(43356), +(43357), +(43358), +(43359), +(43361), +(43362), +(43364), +(43365), +(43368), +(43370), +(43379), +(43380), +(43381), +(43384), +(43393), +(43398), +(43399), +(43409), +(43410), +(43411), +(43413), +(43415), +(43416), +(43417), +(43419), +(43427), +(43428), +(43433), +(43435), +(43439), +(43441), +(43445), +(43451), +(43456), +(43461), +(43469), +(43470), +(43471), +(43472), +(43473), +(43474), +(43475), +(43477), +(43483), +(43484), +(43488), +(43489), +(43492), +(43495), +(43496), +(43497), +(43501), +(43505), +(43507), +(43511), +(43512), +(43515), +(43516), +(43517), +(43518), +(43519), +(43520), +(43522), +(43523), +(43524), +(43525), +(43526), +(43528), +(43529), +(43532), +(43535), +(43543), +(43545), +(43553), +(43556), +(43560), +(43564), +(43565), +(43567), +(43569), +(43571), +(43572), +(43574), +(43575), +(43577), +(43578), +(43579), +(43581), +(43584), +(43585), +(43586), +(43591), +(43592), +(43593), +(43612), +(43613), +(43619), +(43621), +(43622), +(43644), +(43646), +(43648), +(43649), +(43650), +(43651), +(43660), +(43661), +(43663), +(43665), +(43666), +(43667), +(43671), +(43673), +(43680), +(43682), +(43683), +(43684), +(43690), +(43693), +(43695), +(43701), +(43709), +(43714), +(43715), +(43720), +(43726), +(43727), +(43728), +(43729), +(43732), +(43746), +(43767), +(43769), +(43785), +(43786), +(43789), +(43794), +(43795), +(43799), +(43804), +(43807), +(43809), +(43821), +(43834), +(43869), +(43895), +(43903), +(43906), +(43923), +(43928), +(43931), +(43932), +(43933), +(43937), +(43941), +(43948), +(43951), +(43952), +(43969), +(43971), +(43974), +(43976), +(43984), +(43988), +(43993), +(43996), +(43997), +(44000), +(44005), +(44008), +(44015), +(44016), +(44030), +(44031), +(44038), +(44053), +(44078), +(44079), +(44081), +(44082), +(44089), +(44093), +(44095), +(44120), +(44121), +(44126), +(44127), +(44137), +(44138), +(44139), +(44141), +(44142), +(44144), +(44148), +(44149), +(44152), +(44156), +(44159), +(44164), +(44165), +(44168), +(44169), +(44170), +(44171), +(44173), +(44174), +(44176), +(44181), +(44185), +(44188), +(44189), +(44202), +(44211), +(44212), +(44216), +(44219), +(44220), +(44221), +(44222), +(44223), +(44237), +(44241), +(44242), +(44247), +(44248), +(44256), +(44258), +(44262), +(44267), +(44268), +(44271), +(44274), +(44280), +(44285), +(44286), +(44289), +(44294), +(44304), +(44308), +(44310), +(44318), +(44319), +(44323), +(44325), +(44327), +(44328), +(44332), +(44339), +(44351), +(44357), +(44358), +(44361), +(44364), +(44368), +(44370), +(44382), +(44407), +(44408), +(44415), +(44424), +(44425), +(44429), +(44430), +(44454), +(44455), +(44457), +(44464), +(44473), +(44477), +(44478), +(44479), +(44481), +(44482), +(44503), +(44504), +(44512), +(44518), +(44519), +(44525), +(44530), +(44532), +(44533), +(44534), +(44536), +(44541), +(44542), +(44547), +(44553), +(44563), +(44564), +(44572), +(44577), +(44583), +(44586), +(44600), +(44602), +(44606), +(44614), +(44617), +(44618), +(44619), +(44620), +(44622), +(44639), +(44640), +(44641), +(44642), +(44654), +(44657), +(44658), +(44685), +(44732), +(44753), +(44755), +(44765), +(44780), +(44781), +(44787), +(44788), +(44789), +(44790), +(44791), +(44796), +(44808), +(44811), +(44812), +(44813), +(44817), +(44818), +(44823), +(44843), +(44848), +(44868), +(44871), +(44872), +(44876), +(44881), +(44934), +(44937), +(44945), +(44956), +(44957), +(44961), +(44966), +(44985), +(44997), +(45012), +(45017), +(45023), +(45026), +(45029), +(45031), +(45036), +(45055), +(45064), +(45071), +(45075), +(45088), +(45089), +(45090), +(45096), +(45101), +(45102), +(45105), +(45108), +(45110), +(45113), +(45123), +(45124), +(45129), +(45130), +(45133), +(45134), +(45141), +(45145), +(45185), +(45189), +(45192), +(45195), +(45197), +(45199), +(45200), +(45204), +(45205), +(45206), +(45209), +(45214), +(45215), +(45221), +(45228), +(45235), +(45251), +(45256), +(45269), +(45271), +(45274), +(45276), +(45280), +(45284), +(45286), +(45287), +(45288), +(45289), +(45290), +(45291), +(45292), +(45293), +(45294), +(45295), +(45296), +(45297), +(45298), +(45299), +(45300), +(45301), +(45302), +(45314), +(45321), +(45324), +(45327), +(45328), +(45334), +(45337), +(45344), +(45350), +(45352), +(45353), +(45356), +(45362), +(45409), +(45417), +(45419), +(45420), +(45421), +(45425), +(45428), +(45429), +(45430), +(45442), +(45444), +(45447), +(45456), +(45458), +(45462), +(45463), +(45468), +(45469), +(45472), +(45476), +(45477), +(45485), +(45487), +(45491), +(45493), +(45497), +(45504), +(45505), +(45507), +(45509), +(45511), +(45516), +(45524), +(45534), +(45537), +(45543), +(45544), +(45573), +(45576), +(45577), +(45578), +(45580), +(45587), +(45588), +(45589), +(45590), +(45600), +(45603), +(45604), +(45611), +(45625), +(45627), +(45628), +(45629), +(45632), +(45639), +(45645), +(45646), +(45647), +(45648), +(45649), +(45650), +(45659), +(45660), +(45661), +(45664), +(45693), +(45696), +(45716), +(45717), +(45719), +(45724), +(45725), +(45730), +(45739), +(45742), +(45744), +(45748), +(45773), +(45777), +(45778), +(45798), +(45799), +(45800), +(45803), +(45804), +(45815), +(45820), +(45833), +(45837), +(45854), +(45866), +(45873), +(45874), +(45875), +(45889), +(45897), +(45898), +(45899), +(45900), +(45902), +(45906), +(45913), +(45919), +(45924), +(45926), +(45931), +(45940), +(45943), +(45946), +(45947), +(45964), +(45967), +(45975), +(45980), +(45981), +(45983), +(45989), +(45992), +(46010), +(46012), +(46014), +(46015), +(46016), +(46023), +(46027), +(46028), +(46029), +(46031), +(46032), +(46033), +(46035), +(46042), +(46043), +(46044), +(46045), +(46047), +(46049), +(46057), +(46062), +(46065), +(46067), +(46070), +(46074), +(46080), +(46081), +(46083), +(46084), +(46092), +(46093), +(46098), +(46099), +(46101), +(46104), +(46119), +(46145), +(46152), +(46153), +(46155), +(46161), +(46164), +(46166), +(46167), +(46180), +(46181), +(46182), +(46183), +(46187), +(46188), +(46189), +(46190), +(46191), +(46192), +(46194), +(46198), +(46200), +(46202), +(46206), +(46221), +(46231), +(46232), +(46239), +(46260), +(46266), +(46276), +(46279), +(46280), +(46283), +(46285), +(46288), +(46291), +(46292), +(46305), +(46315), +(46323), +(46331), +(46333), +(46341), +(46357), +(46361), +(46362), +(46364), +(46365), +(46366), +(46368), +(46380), +(46381), +(46394), +(46406), +(46411), +(46420), +(46421), +(46422), +(46429), +(46430), +(46432), +(46433), +(46434), +(46440), +(46443), +(46444), +(46447), +(46448), +(46449), +(46459), +(46460), +(46466), +(46468), +(46469), +(46479), +(46480), +(46481), +(46483), +(46485), +(46486), +(46487), +(46543), +(46550), +(46556), +(46557), +(46558), +(46559), +(46560), +(46561), +(46562), +(46563), +(46566), +(46567), +(46568), +(46572), +(46579), +(46580), +(46582), +(46587), +(46590), +(46591), +(46595), +(46598), +(46602), +(46607), +(46611), +(46612), +(46613), +(46614), +(46615), +(46616), +(46617), +(46618), +(46620), +(46621), +(46624), +(46629), +(46630), +(46641), +(46642), +(46651), +(46654), +(46661), +(46664), +(46665), +(46667), +(46671), +(46672), +(46673), +(46674), +(46677), +(46681), +(46686), +(46691), +(46693), +(46696), +(46702), +(46704), +(46709), +(46711), +(46716), +(46717), +(46718), +(46719), +(46720), +(46721), +(46722), +(46723), +(46724), +(46725), +(46726), +(46727), +(46728), +(46729), +(46730), +(46731), +(46734), +(46745), +(46762), +(46764), +(46770), +(46772), +(46773), +(46787), +(46791), +(46801), +(46813), +(46816), +(46824), +(46825), +(46826), +(46841), +(46845), +(46846), +(46856), +(46857), +(46877), +(46879), +(46880), +(46887), +(46906), +(46956), +(46960), +(46962), +(46978), +(46982), +(46983), +(46987), +(46988), +(46990), +(47001), +(47003), +(47009), +(47011), +(47012), +(47014), +(47020), +(47021), +(47028), +(47029), +(47033), +(47034), +(47042), +(47043), +(47057), +(47059), +(47062), +(47063), +(47064), +(47066), +(47068), +(47069), +(47070), +(47071), +(47072), +(47074), +(47076), +(47077), +(47079), +(47081), +(47084), +(47093), +(47096), +(47098), +(47107), +(47117), +(47122), +(47139), +(47143), +(47144), +(47145), +(47146), +(47148), +(47149), +(47151), +(47152), +(47153), +(47155), +(47156), +(47157), +(47158), +(47160), +(47161), +(47162), +(47163), +(47164), +(47165), +(47166), +(47168), +(47171), +(47173), +(47176), +(47206), +(47208), +(47219), +(47244), +(47248), +(47249), +(47257), +(47272), +(47277), +(47282), +(47293), +(47299), +(47305), +(47307), +(47308), +(47316), +(47321), +(47322), +(47323), +(47326), +(47333), +(47334), +(47337), +(47338), +(47339), +(47340), +(47345), +(47380), +(47382), +(47390), +(47392), +(47394), +(47403), +(47405), +(47410), +(47413), +(47414), +(47422), +(47424), +(47431), +(47432), +(47442), +(47447), +(47449), +(47450), +(47451), +(47453), +(47465), +(47467), +(47468), +(47470), +(47471), +(47472), +(47474), +(47475), +(47476), +(47480), +(47481), +(47482), +(47485), +(47486), +(47487), +(47488), +(47489), +(47497), +(47498), +(47504), +(47516), +(47517), +(47519), +(47520), +(47528), +(47530), +(47534), +(47540), +(47541), +(47550), +(47575), +(47601), +(47604), +(47610), +(47611), +(47614), +(47629), +(47632), +(47633), +(47635), +(47637), +(47664), +(47665), +(47673), +(47674), +(47676), +(47679), +(47689), +(47695), +(47697), +(47698), +(47700), +(47702), +(47703), +(47718), +(47721), +(47722), +(47723), +(47724), +(47729), +(47739), +(47740), +(47741), +(47744), +(47749), +(47751), +(47753), +(47757), +(47758), +(47761), +(47767), +(47768), +(47777), +(47778), +(47780), +(47781), +(47782), +(47783), +(47785), +(47788), +(47808), +(47809), +(47810), +(47811), +(47812), +(47813), +(47814), +(47815), +(47824), +(47825), +(47826), +(47827), +(47835), +(47836), +(47837), +(47838), +(47841), +(47843), +(47848), +(47850), +(47851), +(47852), +(47853), +(47855), +(47857), +(47859), +(47860), +(47863), +(47864), +(47865), +(47867), +(47902), +(47914), +(47917), +(47920), +(47926), +(47928), +(47930), +(47938), +(47948), +(47960), +(47961), +(47962), +(47964), +(47968), +(47976), +(47984), +(47991), +(47992), +(47993), +(47994), +(47995), +(47996), +(48011), +(48013), +(48039), +(48045), +(48046), +(48047), +(48048), +(48053), +(48060), +(48062), +(48063), +(48065), +(48066), +(48067), +(48068), +(48070), +(48071), +(48072), +(48073), +(48084), +(48085), +(48098), +(48099), +(48100), +(48101), +(48102), +(48103), +(48104), +(48105), +(48119), +(48120), +(48122), +(48123), +(48124), +(48125), +(48126), +(48127), +(48130), +(48132), +(48133), +(48134), +(48135), +(48137), +(48140), +(48147), +(48155), +(48156), +(48157), +(48158), +(48159), +(48160), +(48161), +(48163), +(48164), +(48165), +(48169), +(48181), +(48184), +(48187), +(48192), +(48208), +(48210), +(48232), +(48245), +(48249), +(48250), +(48261), +(48262), +(48264), +(48267), +(48268), +(48282), +(48283), +(48285), +(48286), +(48287), +(48288), +(48290), +(48291), +(48292), +(48296), +(48298), +(48299), +(48300), +(48301), +(48307), +(48309), +(48310), +(48316), +(48330), +(48334), +(48360), +(48365), +(48374), +(48376), +(48377), +(48378), +(48400), +(48417), +(48423), +(48424), +(48440), +(48441), +(48442), +(48443), +(48450), +(48451), +(48459), +(48461), +(48462), +(48463), +(48464), +(48465), +(48468), +(48469), +(48479), +(48480), +(48489), +(48490), +(48491), +(48504), +(48532), +(48533), +(48540), +(48541), +(48542), +(48543), +(48548), +(48549), +(48563), +(48564), +(48565), +(48566), +(48567), +(48568), +(48569), +(48570), +(48571), +(48572), +(48573), +(48574), +(48575), +(48576), +(48577), +(48578), +(48579), +(48583), +(48585), +(48598), +(48599), +(48601), +(48603), +(48606), +(48617), +(48622), +(48628), +(48637), +(48638), +(48639), +(48640), +(48648), +(48652), +(48656), +(48657), +(48658), +(48659), +(48660), +(48661), +(48662), +(48663), +(48664), +(48665), +(48666), +(48667), +(48668), +(48669), +(48671), +(48672), +(48673), +(48674), +(48675), +(48676), +(48678), +(48679), +(48680), +(48689), +(48690), +(48691), +(48693), +(48696), +(48697), +(48698), +(48699), +(48700), +(48712), +(48714), +(48737), +(48738), +(48746), +(48747), +(48749), +(48750), +(48752), +(48753), +(48754), +(48755), +(48756), +(48759), +(48760), +(48765), +(48770), +(48772), +(48774), +(48775), +(48781), +(48782), +(48784), +(48785), +(48788), +(48800), +(48801), +(48802), +(48805), +(48806), +(48812), +(48813), +(48815), +(48820), +(48821), +(48822), +(48823), +(48824), +(48825), +(48826), +(48827), +(48828), +(48829), +(48830), +(48831), +(48832), +(48845), +(48850), +(48851), +(48852), +(48854), +(48862), +(48871), +(48872), +(48873), +(48876), +(48877), +(48878), +(48880), +(48881), +(48883), +(48895), +(48917), +(48920), +(48931), +(48932), +(48935), +(48936), +(48953), +(48960), +(48974), +(48981), +(48984), +(48995), +(48996), +(48998), +(48999), +(49000), +(49001), +(49005), +(49009), +(49010), +(49011), +(49012), +(49020), +(49021), +(49026), +(49028), +(49029), +(49037), +(49044), +(49045), +(49047), +(49048), +(49049), +(49050), +(49051), +(49052), +(49053), +(49054), +(49078), +(49084), +(49089), +(49090), +(49091), +(49092), +(49093), +(49099), +(49106), +(49110), +(49111), +(49113), +(49119), +(49124), +(49125), +(49127), +(49138), +(49143), +(49158), +(49161), +(49165), +(49177), +(49184), +(49204), +(49206), +(49213), +(49215), +(49230), +(49231), +(49232), +(49233), +(49235), +(49236), +(49237), +(49238), +(49239), +(49240), +(49242), +(49243), +(49256), +(49257), +(49266), +(49267), +(49268), +(49269), +(49270), +(49271), +(49272), +(49273), +(49275), +(49276), +(49278), +(49279), +(49282), +(49283), +(49284), +(49288), +(49294), +(49296), +(49298), +(49305), +(49309), +(49312), +(49317), +(49323), +(49324), +(49348), +(49349), +(49353), +(49354), +(49362), +(49363), +(49364), +(49372), +(49376), +(49381), +(49383), +(49387), +(49404), +(49406), +(49418), +(49427), +(49429), +(49433), +(49439), +(49446), +(49453), +(49454), +(49459), +(49463), +(49466), +(49481), +(49482), +(49485), +(49500), +(49501), +(49511), +(49512), +(49527), +(49537), +(49544), +(49546), +(49547), +(49549), +(49560), +(49576), +(49584), +(49587), +(49592), +(49613), +(49616), +(49617), +(49624), +(49637), +(49639), +(49641), +(49644), +(49675), +(49678), +(49680), +(49681), +(49686), +(49690), +(49696), +(49704), +(49705), +(49706), +(49708), +(49710), +(49711), +(49712), +(49715), +(49718), +(49719), +(49720), +(49723), +(49729), +(49734), +(49742), +(49747), +(49749), +(49753), +(49755), +(49758), +(49759), +(49771), +(49776), +(49797), +(49799), +(49800), +(49802), +(49803), +(49804), +(49805), +(49806), +(49830), +(49836), +(49840), +(49841), +(49843), +(49846), +(49848), +(49859), +(49861), +(49863), +(49865), +(49891), +(49892), +(49893), +(49894), +(49895), +(49896), +(49897), +(49903), +(49904), +(49906), +(49909), +(49913), +(49914), +(49915), +(49916), +(49917), +(49918), +(49919), +(49920), +(49921), +(49922), +(49923), +(49924), +(49926), +(49927), +(49928), +(49929), +(49930), +(49935), +(49942), +(49945), +(49956), +(49961), +(49965), +(49966), +(49967), +(49968), +(49969), +(49970), +(49971), +(49972), +(49973), +(49974), +(49975), +(49978), +(49980), +(49981), +(49985), +(49986), +(49987), +(49989), +(49991), +(49993), +(49994), +(49995), +(49996), +(49997), +(49998), +(49999), +(50004), +(50006), +(50015), +(50021), +(50027), +(50028), +(50035), +(50038), +(50046), +(50047), +(50050), +(50052), +(50064), +(50066), +(50073), +(50075), +(50084), +(50086), +(50089), +(50090), +(50091), +(50092), +(50094), +(50100), +(50101), +(50102), +(50104), +(50135), +(50144), +(50145), +(50146), +(50156), +(50165), +(50169), +(50183), +(50184), +(50185), +(50188), +(50196), +(50198), +(50205), +(50206), +(50207), +(50217), +(50231), +(50232), +(50234), +(50245), +(50251), +(50252), +(50255), +(50256), +(50257), +(50259), +(50265), +(50271), +(50273), +(50276), +(50282), +(50287), +(50288), +(50289), +(50290), +(50291), +(50293), +(50295), +(50299), +(50301), +(50303), +(50305), +(50306), +(50307), +(50319), +(50323), +(50328), +(50335), +(50341), +(50343), +(50344), +(50347), +(50349), +(50356), +(50361), +(50370), +(50375), +(50377), +(50378), +(50379), +(50380), +(50400), +(50401), +(50402), +(50403), +(50405), +(50406), +(50410), +(50411), +(50412), +(50424), +(50431), +(50432), +(50434), +(50435), +(50436), +(50437), +(50439), +(50445), +(50454), +(50455), +(50456), +(50459), +(50462), +(50463), +(50464), +(50477), +(50478), +(50479), +(50484), +(50498), +(50499), +(50500), +(50504), +(50508), +(50509), +(50510), +(50511), +(50512), +(50517), +(50518), +(50519), +(50521), +(50523), +(50533), +(50534), +(50536), +(50537), +(50538), +(50541), +(50545), +(50550), +(50559), +(50566), +(50572), +(50573), +(50578), +(50581), +(50582), +(50588), +(50597), +(50629), +(50631), +(50633), +(50634), +(50635), +(50638), +(50655), +(50658), +(50659), +(50660), +(50661), +(50662), +(50663), +(50666), +(50668), +(50673), +(50675), +(50679), +(50688), +(50691), +(50693), +(50701), +(50704), +(50705), +(50706), +(50721), +(50725), +(50729), +(50731), +(50732), +(50733), +(50737), +(50739), +(50740), +(50744), +(50761), +(50770), +(50773), +(50782), +(50783), +(50796), +(50797), +(50799), +(50804), +(50818), +(50820), +(50821), +(50830), +(50832), +(50834), +(50842), +(50843), +(50844), +(50845), +(50846), +(50853), +(50854), +(50859), +(50861), +(50874), +(50876), +(50894), +(50895), +(50900), +(50905), +(50907), +(50914), +(50918), +(50919), +(50923), +(50924), +(50926), +(50927), +(50978), +(50979), +(50992), +(50997), +(51011), +(51015), +(51016), +(51018), +(51020), +(51026), +(51035), +(51037), +(51046), +(51054), +(51055), +(51057), +(51059), +(51062), +(51064), +(51067), +(51069), +(51072), +(51077), +(51079), +(51081), +(51083), +(51085), +(51087), +(51089), +(51091), +(51093), +(51095), +(51097), +(51100), +(51102), +(51105), +(51107), +(51111), +(51120), +(51121), +(51131), +(51134), +(51135), +(51137), +(51154), +(51156), +(51157), +(51165), +(51187), +(51196), +(51197), +(51198), +(51199), +(51200), +(51203), +(51216), +(51220), +(51221), +(51226), +(51227), +(51228), +(51229), +(51232), +(51233), +(51235), +(51236), +(51240), +(51243), +(51258), +(51259), +(51270), +(51272), +(51275), +(51279), +(51285), +(51287), +(51290), +(51292), +(51298), +(51305), +(51308), +(51310), +(51315), +(51316), +(51325), +(51326), +(51327), +(51328), +(51330), +(51334), +(51339), +(51340), +(51354), +(51356), +(51363), +(51365), +(51372), +(51382), +(51399), +(51409), +(51410), +(51411), +(51413), +(51416), +(51417), +(51418), +(51419), +(51423), +(51424), +(51425), +(51426), +(51427), +(51428), +(51429), +(51430), +(51431), +(51432), +(51440), +(51442), +(51446), +(51447), +(51454), +(51460), +(51467), +(51484), +(51489), +(51491), +(51492), +(51495), +(51496), +(51500), +(51502), +(51503), +(51504), +(51505), +(51506), +(51509), +(51514), +(51515), +(51573), +(51580), +(51584), +(51585), +(51586), +(51587), +(51588), +(51591), +(51592), +(51593), +(51596), +(51598), +(51601), +(51608), +(51609), +(51610), +(51613), +(51614), +(51618), +(51656), +(51657), +(51658), +(51659), +(51662), +(51675), +(51676), +(51677), +(51680), +(51693), +(51695), +(51699), +(51714), +(51718), +(51722), +(51724), +(51726), +(51728), +(51732), +(51734), +(51735), +(51736), +(51740), +(51751), +(51756), +(51757), +(51772), +(51775), +(51776), +(51778), +(51779), +(51786), +(51787), +(51797), +(51798), +(51799), +(51803), +(51804), +(51808), +(51809), +(51811), +(51818), +(51827), +(51830), +(51842), +(51844), +(51853), +(51854), +(51855), +(51856), +(51857), +(51863), +(51864), +(51872), +(51875), +(51876), +(51877), +(51878), +(51879), +(51886), +(51888), +(51889), +(51893), +(51894), +(51895), +(51897), +(51898), +(51899), +(51901), +(51909), +(51912), +(51917), +(51918), +(51919), +(51920), +(51926), +(51934), +(51935), +(51936), +(51937), +(51940), +(51945), +(51949), +(51951), +(51961), +(51962), +(51963), +(51968), +(51973), +(51976), +(51979), +(51981), +(51989), +(51990), +(51997), +(51998), +(51999), +(52000), +(52004), +(52005), +(52007), +(52008), +(52014), +(52025), +(52026), +(52030), +(52032), +(52042), +(52043), +(52045), +(52053), +(52069), +(52078), +(52082), +(52083), +(52086), +(52088), +(52090), +(52108), +(52125), +(52139), +(52149), +(52157), +(52160), +(52163), +(52167), +(52169), +(52171), +(52187), +(52194), +(52196), +(52198), +(52199), +(52206), +(52207), +(52209), +(52210), +(52212), +(52217), +(52219), +(52221), +(52223), +(52224), +(52228), +(52229), +(52230), +(52251), +(52252), +(52253), +(52256), +(52261), +(52263), +(52265), +(52267), +(52270), +(52280), +(52282), +(52292), +(52307), +(52312), +(52318), +(52327), +(52328), +(52334), +(52345), +(52346), +(52352), +(52353), +(52355), +(52356), +(52359), +(52360), +(52361), +(52364), +(52372), +(52373), +(52374), +(52375), +(52383), +(52389), +(52391), +(52401), +(52402), +(52415), +(52425), +(52428), +(52430), +(52431), +(52433), +(52444), +(52445), +(52447), +(52460), +(52463), +(52465), +(52466), +(52468), +(52469), +(52471), +(52472), +(52473), +(52474), +(52475), +(52476), +(52486), +(52487), +(52496), +(52498), +(52499), +(52501), +(52502), +(52504), +(52506), +(52511), +(52515), +(52519), +(52521), +(52522), +(52527), +(52532), +(52534), +(52536), +(52537), +(52538), +(52540), +(52542), +(52544), +(52545), +(52546), +(52547), +(52548), +(52549), +(52554), +(52566), +(52577), +(52581), +(52583), +(52586), +(52587), +(52591), +(52594), +(52595), +(52596), +(52600), +(52601), +(52604), +(52608), +(52609), +(52610), +(52613), +(52620), +(52631), +(52633), +(52643), +(52644), +(52655), +(52657), +(52658), +(52660), +(52672), +(52675), +(52680), +(52684), +(52695), +(52696), +(52699), +(52700), +(52702), +(52705), +(52708), +(52709), +(52711), +(52713), +(52715), +(52718), +(52719), +(52721), +(52722), +(52737), +(52740), +(52741), +(52743), +(52751), +(52752), +(52754), +(52755), +(52758), +(52761), +(52762), +(52764), +(52771), +(52772), +(52773), +(52778), +(52781), +(52782), +(52784), +(52789), +(52794), +(52806), +(52807), +(52813), +(52814), +(52818), +(52825), +(52835), +(52839), +(52851), +(52856), +(52859), +(52862), +(52863), +(52864), +(52871), +(52872), +(52873), +(52883), +(52885), +(52889), +(52890), +(52904), +(52905), +(52909), +(52921), +(52926), +(52931), +(52932), +(52939), +(52943), +(52986), +(52987), +(52988), +(52992), +(52994), +(52996), +(53001), +(53002), +(53003), +(53005), +(53006), +(53007), +(53019), +(53023), +(53027), +(53031), +(53033), +(53043), +(53044), +(53045), +(53051), +(53058), +(53059), +(53060), +(53062), +(53068), +(53069), +(53070), +(53072), +(53073), +(53085), +(53086), +(53087), +(53088), +(53089), +(53094), +(53098), +(53099), +(53100), +(53101), +(53102), +(53108), +(53109), +(53111), +(53116), +(53141), +(53145), +(53148), +(53150), +(53153), +(53158), +(53174), +(53191), +(53193), +(53194), +(53195), +(53208), +(53209), +(53214), +(53254), +(53271), +(53288), +(53289), +(53301), +(53307), +(53308), +(53310), +(53311), +(53313), +(53314), +(53317), +(53318), +(53322), +(53326), +(53327), +(53329), +(53330), +(53332), +(53333), +(53335), +(53338), +(53339), +(53340), +(53346), +(53351), +(53352), +(53353), +(53357), +(53359), +(53364), +(53366), +(53372), +(53388), +(53394), +(53395), +(53396), +(53402), +(53404), +(53407), +(53408), +(53418), +(53422), +(53424), +(53425), +(53431), +(53435), +(53437), +(53438), +(53442), +(53449), +(53460), +(53477), +(53480), +(53492), +(53493), +(53498), +(53499), +(53508), +(53509), +(53526), +(53528), +(53529), +(53532), +(53533), +(53534), +(53536), +(53537), +(53538), +(53540), +(53542), +(53543), +(53544), +(53545), +(53546), +(53547), +(53548), +(53549), +(53550), +(53558), +(53559), +(53560), +(53561), +(53562), +(53564), +(53565), +(53566), +(53567), +(53568), +(53571), +(53572), +(53573), +(53574), +(53575), +(53578), +(53579), +(53580), +(53581), +(53582), +(53584), +(53586), +(53587), +(53588), +(53589), +(53595), +(53600), +(53601), +(53617), +(53618), +(53625), +(53629), +(53631), +(53633), +(53638), +(53639), +(53652), +(53653), +(53654), +(53659), +(53669), +(53697), +(53704), +(53719), +(53726), +(53733), +(53739), +(53742), +(53769), +(53772), +(53786), +(53788), +(53799), +(53807), +(53809), +(53810), +(53815), +(53821), +(53824), +(54016), +(54028), +(54029), +(54035), +(54039), +(54042), +(54049), +(54050), +(54051), +(54052), +(54053), +(54060), +(54063), +(54068), +(54070), +(54071), +(54074), +(54075), +(54076), +(54077), +(54078), +(54079), +(54080), +(54092), +(54094), +(54095), +(54096), +(54113), +(54121), +(54126), +(54129), +(54132), +(54135), +(54158), +(54169), +(54172), +(54175), +(54183), +(54185), +(54188), +(54190), +(54191), +(54195), +(54196), +(54198), +(54203), +(54216), +(54226), +(54235), +(54237), +(54238), +(54249), +(54260), +(54261), +(54273), +(54283), +(54284), +(54290), +(54299), +(54303), +(54309), +(54311), +(54315), +(54316), +(54319), +(54321), +(54324), +(54331), +(54334), +(54335), +(54337), +(54338), +(54339), +(54340), +(54345), +(54350), +(54361), +(54376), +(54378), +(54380), +(54387), +(54393), +(54394), +(54395), +(54396), +(54399), +(54416), +(54417), +(54429), +(54431), +(54433), +(54451), +(54453), +(54458), +(54459), +(54460), +(54468), +(54470), +(54479), +(54485), +(54487), +(54491), +(54495), +(54498), +(54499), +(54502), +(54504), +(54507), +(54511), +(54514), +(54518), +(54521), +(54525), +(54526), +(54527), +(54531), +(54532), +(54540), +(54549), +(54565), +(54573), +(54576), +(54577), +(54578), +(54587), +(54588), +(54593), +(54594), +(54602), +(54604), +(54609), +(54610), +(54611), +(54612), +(54613), +(54615), +(54616), +(54617), +(54618), +(54619), +(54620), +(54622), +(54624), +(54630), +(54631), +(54632), +(54634), +(54640), +(54644), +(54646), +(54648), +(54651), +(54660), +(54662), +(54663), +(54667), +(54668), +(54673), +(54675), +(54677), +(54679), +(54680), +(54688), +(54689), +(54694), +(54702), +(54703), +(54704), +(54706), +(54708), +(54709), +(54716), +(54719), +(54723), +(54755), +(54757), +(54761), +(54770), +(54772), +(54781), +(54785), +(54788), +(54790), +(54791), +(54794), +(54799), +(54801), +(54804), +(54805), +(54820), +(54822), +(54823), +(54843), +(54846), +(54880), +(54881), +(54882), +(54883), +(54884), +(54885), +(54886), +(54887), +(54900), +(54906), +(54908), +(54919), +(54920), +(54932), +(54933), +(54951), +(54956), +(54957), +(54958), +(54965), +(54970), +(54971), +(54973), +(54974), +(54975), +(54976), +(54977), +(54982), +(54983), +(54986), +(54987), +(54992), +(54997), +(55006), +(55007), +(55008), +(55009), +(55021), +(55029), +(55039), +(55041), +(55046), +(55050), +(55051), +(55054), +(55065), +(55066), +(55069), +(55070), +(55071), +(55074), +(55075), +(55078), +(55079), +(55090), +(55093), +(55095), +(55102), +(55104), +(55144), +(55160), +(55168), +(55196), +(55209), +(55210), +(55216), +(55217), +(55218), +(55219), +(55220), +(55224), +(55225), +(55226), +(55240), +(55241), +(55253), +(55255), +(55258), +(55259), +(55260), +(55261), +(55262), +(55263), +(55264), +(55265), +(55268), +(55269), +(55270), +(55271), +(55274), +(55276), +(55277), +(55281), +(55284), +(55313), +(55314), +(55317), +(55318), +(55319), +(55320), +(55321), +(55322), +(55324), +(55331), +(55334), +(55346), +(55348), +(55359), +(55360), +(55363), +(55364), +(55411), +(55412), +(55416), +(55424), +(55425), +(55430), +(55469), +(55470), +(55482), +(55483), +(55484), +(55485), +(55487), +(55488), +(55489), +(55490), +(55491), +(55492), +(55495), +(55496), +(55497), +(55498), +(55499), +(55504), +(55505), +(55506), +(55507), +(55508), +(55509), +(55511), +(55520), +(55521), +(55530), +(55536), +(55549), +(55550), +(55555), +(55556), +(55557), +(55567), +(55568), +(55569), +(55579), +(55581), +(55582), +(55597), +(55598), +(55599), +(55602), +(55604), +(55605), +(55613), +(55622), +(55624), +(55625), +(55643), +(55645), +(55646), +(55648), +(55652), +(55659), +(55700), +(55703), +(55704), +(55716), +(55719), +(55728), +(55736), +(55748), +(55749), +(55750), +(55751), +(55752), +(55753), +(55754), +(55756), +(55770), +(55771), +(55772), +(55778), +(55779), +(55780), +(55781), +(55790), +(55797), +(55802), +(55804), +(55809), +(55813), +(55815), +(55818), +(55823), +(55824), +(55838), +(55840), +(55841), +(55864), +(55874), +(55877), +(55880), +(55890), +(55894), +(55929), +(55931), +(55932), +(55933), +(55935), +(55936), +(55937), +(55939), +(55951), +(55958), +(55959), +(55960), +(55962), +(55963), +(55968), +(55973), +(55978), +(55981), +(55982), +(55983), +(55984), +(56033), +(56036), +(56038), +(56046), +(56061), +(56071), +(56072), +(56090), +(56091), +(56092), +(56098), +(56104), +(56106), +(56107), +(56112), +(56113), +(56115), +(56122), +(56123), +(56125), +(56127), +(56130), +(56131), +(56132), +(56138), +(56139), +(56141), +(56143), +(56144), +(56147), +(56149), +(56160), +(56161), +(56185), +(56190), +(56191), +(56198), +(56200), +(56211), +(56222), +(56223), +(56230), +(56236), +(56239), +(56252), +(56254), +(56260), +(56277), +(56287), +(56305), +(56320), +(56326), +(56329), +(56331), +(56332), +(56346), +(56351), +(56352), +(56361), +(56362), +(56379), +(56404), +(56405), +(56411), +(56425), +(56426), +(56430), +(56433), +(56434), +(56440), +(56442), +(56444), +(56447), +(56448), +(56485), +(56491), +(56506), +(56513), +(56515), +(56517), +(56520), +(56521), +(56525), +(56536), +(56537), +(56539), +(56545), +(56557), +(56559), +(56562), +(56564), +(56565), +(56581), +(56582), +(56584), +(56586), +(56603), +(56605), +(56606), +(56607), +(56609), +(56624), +(56626), +(56627), +(56628), +(56629), +(56630), +(56631), +(56640), +(56641), +(56645), +(56659), +(56662), +(56664), +(56666), +(56668), +(56670), +(56671), +(56672), +(56678), +(56685), +(56687), +(56698), +(56699), +(56701), +(56707), +(56715), +(56718), +(56719), +(56720), +(56721), +(56727), +(56728), +(56729), +(56730), +(56731), +(56734), +(56753), +(56754), +(56755), +(56760), +(56761), +(56770), +(56771), +(56772), +(56773), +(56774), +(56775), +(56776), +(56777), +(56780), +(56781), +(56785), +(56790), +(56791), +(56795), +(56796), +(56797), +(56815), +(56854), +(56860), +(56861), +(56862), +(56891), +(56893), +(56896), +(56898), +(56902), +(56903), +(56905), +(56906), +(56907), +(56909), +(56917), +(56918), +(56919), +(56920), +(56921), +(56922), +(56923), +(56925), +(56933), +(56937), +(56938), +(56939), +(56940), +(56966), +(56969), +(57049), +(57050), +(57052), +(57053), +(57058), +(57062), +(57063), +(57089), +(57090), +(57094), +(57095), +(57108), +(57118), +(57143), +(57292), +(57305), +(57323), +(57337), +(57346), +(57347), +(57369), +(57374), +(57376), +(57380), +(57384), +(57386), +(57388), +(57389), +(57390), +(57391), +(57392), +(57393), +(57395), +(57397), +(57402), +(57407), +(57411), +(57413), +(57420), +(57454), +(57456), +(57461), +(57464), +(57465), +(57466), +(57473), +(57480), +(57486), +(57487), +(57488), +(57490), +(57506), +(57507), +(57528), +(57530), +(57536), +(57537), +(57547), +(57548), +(57553), +(57554), +(57556), +(57573), +(57580), +(57582), +(57587), +(57589), +(57590), +(57593), +(57594), +(57596), +(57599), +(57601), +(57602), +(57603), +(57615), +(57616), +(57617), +(57620), +(57628), +(57635), +(57640), +(57641), +(57644), +(57645), +(57647), +(57648), +(57651), +(57657), +(57661), +(57665), +(57670), +(57671), +(57677), +(57679), +(57723), +(57724), +(57725), +(57745), +(57755), +(57759), +(57765), +(57766), +(57767), +(57770), +(57774), +(57775), +(57777), +(57778), +(57779), +(57780), +(57781), +(57783), +(57785), +(57787), +(57789), +(57790), +(57795), +(57799), +(57802), +(57807), +(57808), +(57823), +(57825), +(57833), +(57834), +(57838), +(57841), +(57842), +(57845), +(57846), +(57860), +(57863), +(57864), +(57871), +(57874), +(57888), +(57896), +(57897), +(57906), +(57908), +(57914), +(57921), +(57922), +(57941), +(57949), +(57951), +(57964), +(57965), +(57969), +(57970), +(57974), +(57975), +(57981), +(57984), +(57992), +(57993), +(57994), +(58012), +(58021), +(58025), +(58044), +(58054), +(58061), +(58062), +(58071), +(58106), +(58117), +(58118), +(58119), +(58151), +(58154), +(58179), +(58180), +(58181), +(58183), +(58184), +(58187), +(58194), +(58203), +(58204), +(58205), +(58207), +(58208), +(58209), +(58210), +(58211), +(58212), +(58213), +(58214), +(58215), +(58216), +(58217), +(58218), +(58219), +(58220), +(58221), +(58222), +(58223), +(58224), +(58230), +(58270), +(58282), +(58283), +(58349), +(58351), +(58352), +(58371), +(58373), +(58412), +(58418), +(58419), +(58420), +(58421), +(58438), +(58448), +(58449), +(58450), +(58451), +(58452), +(58453), +(58456), +(58457), +(58459), +(58460), +(58461), +(58462), +(58464), +(58466), +(58471), +(58475), +(58494), +(58504), +(58505), +(58508), +(58509), +(58510), +(58511), +(58513), +(58514), +(58516), +(58517), +(58518), +(58519), +(58520), +(58526), +(58529), +(58531), +(58534), +(58535), +(58537), +(58544), +(58548), +(58561), +(58563), +(58564), +(58566), +(58567), +(58597), +(58604), +(58605), +(58607), +(58608), +(58609), +(58610), +(58611), +(58612), +(58617), +(58619), +(58621), +(58622), +(58624), +(58628), +(58632), +(58633), +(58642), +(58644), +(58660), +(58663), +(58664), +(58665), +(58666), +(58667), +(58678), +(58681), +(58683), +(58684), +(58691), +(58700), +(58701), +(58702), +(58743), +(58747), +(58758), +(58769), +(58770), +(58772), +(58781), +(58782), +(58786), +(58787), +(58788), +(58797), +(58798), +(58799), +(58810), +(58811), +(58814), +(58815), +(58816), +(58817), +(58822), +(58823), +(58827), +(58829), +(58830), +(58839), +(58840), +(58843), +(58844), +(58845), +(58847), +(58849), +(58850), +(58855), +(58859), +(58861), +(58867), +(58879), +(58890), +(58896), +(58898), +(58902), +(58905), +(58912), +(58913), +(58915), +(58919), +(58921), +(58922), +(58935), +(58940), +(58941), +(58953), +(58955), +(58959), +(58961), +(58966), +(58967), +(58969), +(58971), +(58972), +(58973), +(58976), +(58978), +(58980), +(58981), +(58987), +(58988), +(58989), +(58991), +(58996), +(59001), +(59006), +(59007), +(59011), +(59013), +(59016), +(59017), +(59019), +(59020), +(59021), +(59023), +(59024), +(59025), +(59034), +(59035), +(59039), +(59040), +(59044), +(59047), +(59050), +(59051), +(59060), +(59064), +(59065), +(59069), +(59079), +(59080), +(59081), +(59082), +(59083), +(59085), +(59100), +(59102), +(59104), +(59105), +(59106), +(59109), +(59110), +(59111), +(59114), +(59119), +(59121), +(59124), +(59130), +(59131), +(59132), +(59133), +(59134), +(59138), +(59142), +(59144), +(59146), +(59147), +(59148), +(59150), +(59151), +(59153), +(59155), +(59160), +(59161), +(59163), +(59164), +(59165), +(59166), +(59167), +(59168), +(59169), +(59170), +(59171), +(59172), +(59178), +(59179), +(59180), +(59182), +(59185), +(59186), +(59187), +(59191), +(59192), +(59199), +(59209), +(59210), +(59211), +(59215), +(59220), +(59223), +(59225), +(59226), +(59228), +(59233), +(59235), +(59237), +(59239), +(59241), +(59242), +(59243), +(59244), +(59246), +(59247), +(59248), +(59249), +(59251), +(59252), +(59254), +(59256), +(59257), +(59259), +(59260), +(59261), +(59262), +(59263), +(59264), +(59265), +(59268), +(59269), +(59270), +(59271), +(59273), +(59280), +(59288), +(59290), +(59300), +(59304), +(59318), +(59319), +(59324), +(59325), +(59329), +(59330), +(59331), +(59342), +(59343), +(59344), +(59346), +(59347), +(59348), +(59350), +(59351), +(59352), +(59355), +(59357), +(59359), +(59361), +(59362), +(59364), +(59367), +(59371), +(59373), +(59374), +(59376), +(59381), +(59389), +(59391), +(59392), +(59395), +(59397), +(59398), +(59399), +(59400), +(59401), +(59402), +(59408), +(59409), +(59412), +(59413), +(59423), +(59432), +(59434), +(59439), +(59444), +(59448), +(59455), +(59460), +(59467), +(59468), +(59471), +(59482), +(59485), +(59513), +(59515), +(59517), +(59519), +(59520), +(59525), +(59530), +(59542), +(59543), +(59544), +(59545), +(59547), +(59548), +(59557), +(59558), +(59563), +(59575), +(59577), +(59590), +(59593), +(59594), +(59599), +(59603), +(59604), +(59605), +(59606), +(59607), +(59608), +(59610), +(59611), +(59616), +(59617), +(59633), +(59634), +(59637), +(59638), +(59651), +(59653), +(59656), +(59661), +(59663), +(59679), +(59682), +(59683), +(59684), +(59685), +(59691), +(59695), +(59696), +(59700), +(59703), +(59710), +(59712), +(59713), +(59715), +(59716), +(59717), +(59718), +(59723), +(59727), +(59735), +(59736), +(59742), +(59743), +(59746), +(59750), +(59760), +(59762), +(59763), +(59765), +(59766), +(59767), +(59769), +(59779), +(59795), +(59805), +(59812), +(59813), +(59814), +(59815), +(59817), +(59823), +(59826), +(59827), +(59832), +(59839), +(59840), +(59841), +(59844), +(59846), +(59851), +(59852), +(59855), +(59856), +(59863), +(59864), +(59877), +(59879), +(59881), +(59882), +(59883), +(59884), +(59885), +(59886), +(59894), +(59901), +(59921), +(59963), +(59965), +(59972), +(59974), +(59978), +(59982), +(59984), +(59985), +(59986), +(59987), +(59988), +(59989), +(59991), +(59992), +(59993), +(59994), +(59997), +(59999), +(60003), +(60004), +(60005), +(60006), +(60008), +(60009), +(60011), +(60012), +(60013), +(60015), +(60016), +(60017), +(60018), +(60032), +(60035), +(60039), +(60041), +(60043), +(60051), +(60052), +(60053), +(60067), +(60073), +(60076), +(60078), +(60079), +(60080), +(60085), +(60089), +(60100), +(60103), +(60106), +(60107), +(60111), +(60112), +(60115), +(60117), +(60122), +(60123), +(60127), +(60129), +(60181), +(60183), +(60186), +(60194), +(60195), +(60197), +(60203), +(60204), +(60210), +(60211), +(60212), +(60229), +(60233), +(60234), +(60235), +(60236), +(60239), +(60241), +(60300), +(60307), +(60309), +(60339), +(60351), +(60352), +(60428), +(60431), +(60432), +(60433), +(60440), +(60443), +(60446), +(60447), +(60450), +(60452), +(60453), +(60472), +(60474), +(60483), +(60488), +(60500), +(60504), +(60505), +(60506), +(60518), +(60526), +(60530), +(60540), +(60541), +(60542), +(60578), +(60580), +(60585), +(60588), +(60590), +(60626), +(60642), +(60644), +(60646), +(60654), +(60672), +(60678), +(60682), +(60683), +(60699), +(60708), +(60742), +(60753), +(60781), +(60782), +(60784), +(60785), +(60786), +(60790), +(60802), +(60803), +(60805), +(60809), +(60814), +(60817), +(60842), +(60844), +(60850), +(60856), +(60857), +(60859), +(60868), +(60869), +(60870), +(60871), +(60872), +(60873), +(60876), +(60880), +(60882), +(60890), +(60896), +(60897), +(60898), +(60899), +(60900), +(60901), +(60905), +(60906), +(60917), +(60918), +(60924), +(60926), +(60927), +(60930), +(60932), +(60935), +(60940), +(60941), +(60944), +(60945), +(60946), +(60947), +(60949), +(60950), +(60951), +(60952), +(60954), +(60959), +(60961), +(60962), +(60963), +(60965), +(60968), +(60972), +(60973), +(60979), +(60980), +(60981), +(60982), +(60983), +(60988), +(60991), +(60995), +(61001), +(61005), +(61006), +(61016), +(61018), +(61024), +(61025), +(61029), +(61034), +(61036), +(61039), +(61041), +(61042), +(61046), +(61048), +(61051), +(61064), +(61070), +(61077), +(61080), +(61083), +(61087), +(61091), +(61094), +(61100), +(61101), +(61103), +(61109), +(61110), +(61111), +(61115), +(61123), +(61124), +(61127), +(61129), +(61133), +(61140), +(61143), +(61159), +(61160), +(61162), +(61164), +(61166), +(61168), +(61171), +(61172), +(61173), +(61176), +(61178), +(61182), +(61186), +(61187), +(61191), +(61193), +(61194), +(61195), +(61196), +(61197), +(61198), +(61209), +(61211), +(61213), +(61215), +(61218), +(61223), +(61226), +(61242), +(61243), +(61244), +(61253), +(61259), +(61260), +(61263), +(61269), +(61272), +(61281), +(61282), +(61286), +(61287), +(61291), +(61295), +(61296), +(61299), +(61300), +(61301), +(61302), +(61305), +(61314), +(61319), +(61320), +(61326), +(61327), +(61343), +(61344), +(61347), +(61352), +(61358), +(61372), +(61373), +(61374), +(61375), +(61380), +(61381), +(61382), +(61385), +(61395), +(61398), +(61399), +(61409), +(61411), +(61415), +(61419), +(61420), +(61421), +(61423), +(61424), +(61443), +(61445), +(61448), +(61454), +(61457), +(61461), +(61466), +(61474), +(61479), +(61480), +(61486), +(61490), +(61491), +(61493), +(61507), +(61511), +(61512), +(61515), +(61528), +(61545), +(61549), +(61550), +(61552), +(61554), +(61556), +(61558), +(61561), +(61562), +(61563), +(61565), +(61567), +(61569), +(61572), +(61579), +(61584), +(61590), +(61592), +(61593), +(61596), +(61597), +(61599), +(61600), +(61601), +(61604), +(61606), +(61607), +(61613), +(61621), +(61623), +(61624), +(61626), +(61627), +(61628), +(61634), +(61635), +(61662), +(61663), +(61666), +(61667), +(61668), +(61676), +(61685), +(61696), +(61705), +(61712), +(61716), +(61721), +(61728), +(61729), +(61730), +(61733), +(61747), +(61767), +(61780), +(61781), +(61789), +(61791), +(61793), +(61794), +(61795), +(61796), +(61797), +(61798), +(61799), +(61800), +(61801), +(61802), +(61804), +(61805), +(61806), +(61807), +(61808), +(61815), +(61817), +(61819), +(61821), +(61822), +(61823), +(61824), +(61825), +(61832), +(61833), +(61834), +(61835), +(61836), +(61837), +(61838), +(61839), +(61840), +(61841), +(61842), +(61843), +(61844), +(61845), +(61849), +(61857), +(61859), +(61862), +(61866), +(61868), +(61870), +(61873), +(61879), +(61880), +(61881), +(61888), +(61893), +(61895), +(61896), +(61897), +(61903), +(61909), +(61911), +(61912), +(61923), +(61924), +(61925), +(61926), +(61927), +(61928), +(61929), +(61965), +(61967), +(61973), +(61998), +(62014), +(62026), +(62030), +(62036), +(62053), +(62063), +(62078), +(62089), +(62103), +(62105), +(62117), +(62118), +(62119), +(62120), +(62121), +(62122), +(62124), +(62128), +(62129), +(62130), +(62131), +(62138), +(62167), +(62169), +(62195), +(62198), +(62204), +(62225), +(62226), +(62249), +(62250), +(62261), +(62264), +(62265), +(62280), +(62292), +(62298), +(62305), +(62309), +(62310), +(62312), +(62315), +(62316), +(62317), +(62318), +(62322), +(62326), +(62327), +(62328), +(62331), +(62332), +(62333), +(62334), +(62335), +(62342), +(62347), +(62354), +(62356), +(62368), +(62372), +(62373), +(62382), +(62395), +(62401), +(62402), +(62415), +(62417), +(62418), +(62420), +(62441), +(62442), +(62443), +(62444), +(62445), +(62446), +(62455), +(62456), +(62466), +(62479), +(62482), +(62503), +(62507), +(62526), +(62531), +(62536), +(62540), +(62544), +(62554), +(62563), +(62575), +(62581), +(62583), +(62589), +(62601), +(62607), +(62608), +(62611), +(62613), +(62614), +(62626), +(62638), +(62648), +(62649), +(62653), +(62658), +(62672), +(62673), +(62707), +(62708), +(62711), +(62717), +(62722), +(62726), +(62732), +(62767), +(62768), +(62769), +(62793), +(62796), +(62806), +(62832), +(62836), +(62844), +(62845), +(62846), +(62854), +(62855), +(62863), +(62867), +(62874), +(62875), +(62881), +(62900), +(62901), +(62902), +(62903), +(62904), +(62928), +(62935), +(62938), +(62939), +(62960), +(62961), +(62989), +(62997), +(62998), +(63003), +(63010), +(63012), +(63028), +(63034), +(63035), +(63036), +(63047), +(63082), +(63094), +(63103), +(63104), +(63105), +(63111), +(63112), +(63120), +(63124), +(63125), +(63126), +(63127), +(63134), +(63136), +(63138), +(63147), +(63151), +(63169), +(63171), +(63172), +(63174), +(63175), +(63177), +(63178), +(63179), +(63180), +(63183), +(63184), +(63185), +(63216), +(63221), +(63226), +(63228), +(63233), +(63240), +(63242), +(63259), +(63276), +(63278), +(63301), +(63311), +(63313), +(63314), +(63315), +(63316), +(63336), +(63337), +(63338), +(63344), +(63345), +(63356), +(63359), +(63361), +(63362), +(63363), +(63380), +(63382), +(63413), +(63416), +(63418), +(63459), +(63462), +(63463), +(63464), +(63465), +(63466), +(63468), +(63477), +(63479), +(63487), +(63493), +(63494), +(63495), +(63511), +(63518), +(63519), +(63529), +(63535), +(63536), +(63544), +(63549), +(63550), +(63551), +(63553), +(63556), +(63559), +(63562), +(63564), +(63569), +(63571), +(63573), +(63575), +(63599), +(63605), +(63612), +(63615), +(63619), +(63652), +(63653), +(63654), +(63655), +(63661), +(63668), +(63669), +(63670), +(63671), +(63672), +(63673), +(63675), +(63678), +(63685), +(63689), +(63691), +(63699), +(63700), +(63716), +(63728), +(63736), +(63738), +(63754), +(63755), +(63759), +(63760), +(63789), +(63803), +(63804), +(63809), +(63815), +(63823), +(63825), +(63827), +(63845), +(63846), +(63852), +(63861), +(63913), +(63914), +(63915), +(63916), +(63917), +(63918), +(63919), +(63920), +(63921), +(63922), +(63923), +(63931), +(63980), +(63989), +(63993), +(63995), +(63997), +(63998), +(64003), +(64005), +(64006), +(64014), +(64024), +(64025), +(64026), +(64027), +(64028), +(64029), +(64030), +(64031), +(64032), +(64034), +(64036), +(64039), +(64044), +(64058), +(64065), +(64085), +(64090), +(64097), +(64102), +(64104), +(64107), +(64113), +(64114), +(64115), +(64119), +(64123), +(64128), +(64134), +(64136), +(64138), +(64142), +(64151), +(64152), +(64153), +(64156), +(64157), +(64159), +(64160), +(64186), +(64204), +(64211), +(64212), +(64213), +(64215), +(64230), +(64269), +(64324), +(64328), +(64330), +(64331), +(64332), +(64333), +(64334), +(64335), +(64336), +(64337), +(64338), +(64339), +(64342), +(64346), +(64363), +(64365), +(64367), +(64374), +(64375), +(64376), +(64377), +(64380), +(64382), +(64387), +(64388), +(64390), +(64391), +(64395), +(64396), +(64412), +(64413), +(64429), +(64430), +(64442), +(64467), +(64478), +(64496), +(64499), +(64501), +(64507), +(64528), +(64529), +(64535), +(64542), +(64552), +(64580), +(64583), +(64588), +(64590), +(64591), +(64592), +(64595), +(64627), +(64637), +(64638), +(64640), +(64646), +(64647), +(64648), +(64649), +(64654), +(64665), +(64666), +(64667), +(64668), +(64669), +(64674), +(64682), +(64686), +(64692), +(64696), +(64698), +(64699), +(64705), +(64719), +(64740), +(64757), +(64758), +(64759), +(64766), +(64768), +(64771), +(64773), +(64776), +(64780), +(64787), +(64795), +(64798), +(64801), +(64806), +(64807), +(64821), +(64841), +(64870), +(64874), +(64876), +(64888), +(64891), +(64903), +(64909), +(64918), +(64930), +(64953), +(64967), +(64970), +(64971), +(64974), +(64978), +(64991), +(65030), +(65031), +(65033), +(65035), +(65036), +(65038), +(65039), +(65040), +(65042), +(65054), +(65055), +(65056), +(65057), +(65058), +(65059), +(65061), +(65062), +(65071), +(65080), +(65081), +(65104), +(65111), +(65113), +(65122), +(65123), +(65131), +(65133), +(65147), +(65162), +(65201), +(65210), +(65240), +(65266), +(65280), +(65343), +(65351), +(65359), +(65360), +(65374), +(65378), +(65379), +(65386), +(65391), +(65392), +(65403), +(65431), +(65488), +(65490), +(65492), +(65502), +(65503), +(65512), +(65513), +(65516), +(65531), +(65532), +(65541), +(65542), +(65545), +(65546), +(65564), +(65565), +(65575), +(65576), +(65577), +(65634), +(65635), +(65636), +(65647), +(65648), +(65693), +(65694), +(65703), +(65720), +(65722), +(65723), +(65728), +(65729), +(65744), +(65754), +(65775), +(65778), +(65782), +(65790), +(65791), +(65799), +(65801), +(65807), +(65809), +(65810), +(65812), +(65813), +(65814), +(65815), +(65819), +(65820), +(65821), +(65825), +(65826), +(65854), +(65855), +(65856), +(65857), +(65859), +(65862), +(65863), +(65866), +(65867), +(65868), +(65877), +(65878), +(65881), +(65883), +(65918), +(65924), +(65926), +(65927), +(65929), +(65930), +(65931), +(65934), +(65935), +(65936), +(65940), +(65941), +(65954), +(65957), +(65960), +(65962), +(65970), +(65971), +(65972), +(65973), +(65974), +(65978), +(65987), +(65998), +(66003), +(66005), +(66007), +(66008), +(66009), +(66012), +(66017), +(66018), +(66019), +(66020), +(66021), +(66042), +(66043), +(66045), +(66047), +(66053), +(66054), +(66055), +(66056), +(66057), +(66063), +(66065), +(66066), +(66067), +(66068), +(66069), +(66070), +(66072), +(66075), +(66079), +(66081), +(66093), +(66095), +(66097), +(66099), +(66100), +(66104), +(66109), +(66112), +(66113), +(66114), +(66115), +(66116), +(66125), +(66126), +(66134), +(66154), +(66177), +(66188), +(66196), +(66197), +(66198), +(66206), +(66207), +(66209), +(66213), +(66215), +(66216), +(66217), +(66236), +(66237), +(66240), +(66243), +(66244), +(66245), +(66250), +(66259), +(66260), +(66261), +(66262), +(66265), +(66283), +(66285), +(66290), +(66291), +(66292), +(66293), +(66294), +(66295), +(66313), +(66326), +(66331), +(66334), +(66342), +(66359), +(66377), +(66378), +(66407), +(66408), +(66409), +(66410), +(66417), +(66420), +(66423), +(66425), +(66457), +(66460), +(66461), +(66474), +(66477), +(66479), +(66480), +(66481), +(66489), +(66493), +(66516), +(66528), +(66532), +(66533), +(66536), +(66537), +(66538), +(66548), +(66549), +(66588), +(66592), +(66593), +(66594), +(66595), +(66596), +(66613), +(66619), +(66620), +(66629), +(66638), +(66666), +(66668), +(66669), +(66686), +(66687), +(66688), +(66689), +(66716), +(66717), +(66719), +(66733), +(66735), +(66736), +(66742), +(66744), +(66765), +(66770), +(66773), +(66777), +(66784), +(66796), +(66797), +(66809), +(66813), +(66823), +(66824), +(66863), +(66867), +(66869), +(66879), +(66880), +(66887), +(66888), +(66890), +(66891), +(66892), +(66899), +(66903), +(66904), +(66922), +(66940), +(66941), +(66950), +(66951), +(66952), +(66953), +(66954), +(66955), +(66957), +(66958), +(66959), +(66960), +(66961), +(66962), +(66963), +(66964), +(66965), +(66972), +(66973), +(66974), +(66975), +(66976), +(66977), +(66978), +(66979), +(66988), +(66989), +(66990), +(66991), +(66992), +(66994), +(67029), +(67030), +(67031), +(67033), +(67035), +(67049), +(67050), +(67051), +(67073), +(67074), +(67075), +(67088), +(67089), +(67090), +(67097), +(67098), +(67099), +(67114), +(67148), +(67229), +(67235), +(67237), +(67247), +(67252), +(67253), +(67280), +(67289), +(67290), +(67309), +(67310), +(67311), +(67312), +(67313), +(67314), +(67324), +(67325), +(67330), +(67331), +(67333), +(67366), +(67372), +(67373), +(67387), +(67390), +(67477), +(67478), +(67479), +(67480), +(67481), +(67485), +(67518), +(67519), +(67528), +(67529), +(67530), +(67531), +(67532), +(67533), +(67534), +(67540), +(67542), +(67550), +(67554), +(67560), +(67573), +(67574), +(67577), +(67606), +(67607), +(67608), +(67612), +(67613), +(67614), +(67618), +(67619), +(67620), +(67624), +(67625), +(67626), +(67632), +(67633), +(67634), +(67650), +(67651), +(67652), +(67654), +(67655), +(67656), +(67674), +(67675), +(67676), +(67678), +(67679), +(67680), +(67686), +(67703), +(67708), +(67709), +(67710), +(67714), +(67718), +(67719), +(67721), +(67722), +(67724), +(67725), +(67730), +(67745), +(67749), +(67760), +(67767), +(67772), +(67773), +(67774), +(67793), +(67799), +(67810), +(67811), +(67817), +(67818), +(67819), +(67821), +(67823), +(67830), +(67834), +(67835), +(67836), +(67837), +(67838), +(67846), +(67847), +(67861), +(67862), +(67863), +(67878), +(67879), +(67880), +(67881), +(67882), +(67883), +(67884), +(67885), +(67891), +(67892), +(67905), +(67906), +(67907), +(67929), +(67930), +(67931), +(67932), +(67933), +(67934), +(67935), +(67936), +(67937), +(67938), +(67939), +(67940), +(67941), +(67942), +(67943), +(67944), +(67945), +(67946), +(67947), +(67948), +(67949), +(67951), +(67952), +(67953), +(67957), +(67958), +(67959), +(67965), +(67966), +(67967), +(67968), +(67969), +(67970), +(67971), +(67972), +(67973), +(67977), +(67978), +(67979), +(67980), +(67981), +(67982), +(67983), +(67984), +(67985), +(67988), +(67989), +(67990), +(67991), +(67992), +(67993), +(67994), +(67995), +(67996), +(67997), +(67998), +(67999), +(68003), +(68004), +(68005), +(68008), +(68009), +(68010), +(68011), +(68012), +(68013), +(68014), +(68015), +(68016), +(68017), +(68018), +(68019), +(68023), +(68024), +(68025), +(68026), +(68027), +(68028), +(68032), +(68033), +(68034), +(68035), +(68036), +(68037), +(68038), +(68039), +(68040), +(68042), +(68043), +(68044), +(68055), +(68073), +(68077), +(68078), +(68081), +(68088), +(68089), +(68090), +(68091), +(68092), +(68093), +(68094), +(68095), +(68096), +(68100), +(68101), +(68102), +(68106), +(68107), +(68108), +(68109), +(68110), +(68111), +(68112), +(68113), +(68114), +(68115), +(68116), +(68117), +(68118), +(68119), +(68120), +(68123), +(68124), +(68125), +(68130), +(68133), +(68134), +(68135), +(68136), +(68137), +(68138), +(68139), +(68140), +(68141), +(68148), +(68149), +(68150), +(68151), +(68152), +(68153), +(68154), +(68155), +(68156), +(68157), +(68158), +(68159), +(68272), +(68282), +(68284), +(68301), +(68306), +(68307), +(68310), +(68311), +(68313), +(68315), +(68317), +(68318), +(68319), +(68321), +(68328), +(68333), +(68334), +(68340), +(68341), +(68350), +(68357), +(68362), +(68363), +(68364), +(68365), +(68372), +(68391), +(68415), +(68458), +(68472), +(68478), +(68479), +(68498), +(68501), +(68502), +(68503), +(68504), +(68505), +(68550), +(68551), +(68586), +(68587), +(68588), +(68607), +(68621), +(68622), +(68623), +(68624), +(68625), +(68626), +(68627), +(68628), +(68629), +(68727), +(68753), +(68754), +(68755), +(68756), +(68757), +(68758), +(68762), +(68763), +(68764), +(68778), +(68781), +(68782), +(68783), +(68784), +(68788), +(68799), +(68812), +(68834), +(68839), +(68841), +(68843), +(68868), +(68879), +(68884), +(68900), +(68915), +(68927), +(68934), +(68948), +(68966), +(68971), +(68980), +(68982), +(68984), +(68985), +(68991), +(69000), +(69003), +(69021), +(69023), +(69028), +(69034), +(69038), +(69051), +(69058), +(69063), +(69065), +(69066), +(69067), +(69068), +(69088), +(69091), +(69124), +(69128), +(69130), +(69131), +(69133), +(69137), +(69138), +(69153), +(69155), +(69156), +(69158), +(69160), +(69172), +(69180), +(69181), +(69189), +(69190), +(69198), +(69200), +(69209), +(69210), +(69211), +(69212), +(69218), +(69222), +(69232), +(69243), +(69246), +(69274), +(69275), +(69276), +(69285), +(69308), +(69342), +(69352), +(69387), +(69389), +(69391), +(69397), +(69398), +(69403), +(69404), +(69405), +(69406), +(69409), +(69410), +(69416), +(69420), +(69427), +(69438), +(69445), +(69455), +(69483), +(69489), +(69492), +(69496), +(69497), +(69498), +(69499), +(69500), +(69501), +(69503), +(69504), +(69520), +(69528), +(69542), +(69543), +(69544), +(69548), +(69563), +(69564), +(69566), +(69567), +(69569), +(69570), +(69572), +(69573), +(69574), +(69576), +(69577), +(69578), +(69579), +(69581), +(69583), +(69603), +(69617), +(69623), +(69627), +(69633), +(69644), +(69651), +(69668), +(69672), +(69673), +(69675), +(69681), +(69692), +(69693), +(69696), +(69699), +(69710), +(69722), +(69724), +(69726), +(69729), +(69730), +(69731), +(69733), +(69734), +(69771), +(69772), +(69779), +(69828), +(69837), +(69856), +(69861), +(69866), +(69869), +(69871), +(69882), +(69889), +(69891), +(69892), +(69893), +(69896), +(69898), +(69899), +(69902), +(69903), +(69906), +(69910), +(69911), +(69912), +(69916), +(69917), +(69920), +(69923), +(69926), +(69927), +(69933), +(69956), +(69958), +(69961), +(69963), +(69967), +(69968), +(69969), +(69970), +(69972), +(69973), +(69974), +(69975), +(69984), +(69989), +(70002), +(70043), +(70070), +(70074), +(70080), +(70110), +(70119), +(70122), +(70126), +(70141), +(70144), +(70153), +(70161), +(70162), +(70182), +(70183), +(70191), +(70192), +(70196), +(70205), +(70208), +(70211), +(70213), +(70227), +(70269), +(70270), +(70271), +(70273), +(70275), +(70276), +(70277), +(70278), +(70279), +(70280), +(70281), +(70282), +(70285), +(70289), +(70292), +(70296), +(70302), +(70304), +(70308), +(70309), +(70320), +(70322), +(70327), +(70333), +(70337), +(70355), +(70361), +(70381), +(70386), +(70387), +(70388), +(70391), +(70393), +(70396), +(70400), +(70408), +(70409), +(70410), +(70423), +(70428), +(70429), +(70432), +(70435), +(70437), +(70445), +(70449), +(70451), +(70453), +(70495), +(70510), +(70516), +(70525), +(70538), +(70539), +(70540), +(70542), +(70583), +(70594), +(70599), +(70616), +(70639), +(70640), +(70645), +(70646), +(70648), +(70653), +(70656), +(70659), +(70698), +(70746), +(70751), +(70754), +(70772), +(70781), +(70802), +(70809), +(70821), +(70838), +(70856), +(70857), +(70858), +(70859), +(70860), +(70861), +(70864), +(70867), +(70886), +(70890), +(70895), +(70896), +(70897), +(70906), +(70917), +(70923), +(70928), +(70929), +(70942), +(70946), +(70964), +(70965), +(70971), +(70972), +(70973), +(70974), +(70980), +(71003), +(71004), +(71005), +(71006), +(71020), +(71021), +(71023), +(71038), +(71040), +(71041), +(71087), +(71089), +(71090), +(71103), +(71107), +(71108), +(71112), +(71116), +(71117), +(71119), +(71120), +(71121), +(71124), +(71126), +(71127), +(71129), +(71130), +(71131), +(71133), +(71135), +(71136), +(71138), +(71140), +(71141), +(71142), +(71143), +(71144), +(71145), +(71146), +(71148), +(71153), +(71154), +(71155), +(71157), +(71163), +(71164), +(71169), +(71203), +(71204), +(71237), +(71248), +(71253), +(71254), +(71257), +(71264), +(71289), +(71291), +(71296), +(71297), +(71298), +(71316), +(71317), +(71318), +(71319), +(71326), +(71327), +(71328), +(71330), +(71331), +(71335), +(71339), +(71340), +(71350), +(71361), +(71362), +(71363), +(71392), +(71405), +(71410), +(71420), +(71433), +(71434), +(71443), +(71446), +(71450), +(71459), +(71462), +(71466), +(71473), +(71475), +(71476), +(71477), +(71478), +(71479), +(71480), +(71488), +(71489), +(71490), +(71500), +(71501), +(71504), +(71510), +(71512), +(71522), +(71532), +(71533), +(71539), +(71544), +(71546), +(71547), +(71548), +(71549), +(71551), +(71552), +(71553), +(71554), +(71590), +(71591), +(71594), +(71595), +(71607), +(71623), +(71624), +(71625), +(71626), +(71646), +(71647), +(71686), +(71687), +(71688), +(71713), +(71715), +(71726), +(71727), +(71728), +(71729), +(71738), +(71745), +(71748), +(71750), +(71752), +(71757), +(71758), +(71759), +(71760), +(71778), +(71779), +(71780), +(71781), +(71782), +(71783), +(71784), +(71785), +(71786), +(71788), +(71789), +(71801), +(71806), +(71807), +(71815), +(71818), +(71819), +(71820), +(71821), +(71822), +(71823), +(71824), +(71825), +(71834), +(71838), +(71839), +(71841), +(71842), +(71847), +(71864), +(71866), +(71874), +(71879), +(71909), +(71923), +(71924), +(71925), +(71926), +(71927), +(71928), +(71930), +(71931), +(71932), +(71933), +(71934), +(71936), +(71937), +(71938), +(71951), +(71954), +(71955), +(71972), +(71988), +(72004), +(72005), +(72007), +(72008), +(72010), +(72021), +(72022), +(72023), +(72024), +(72057), +(72065), +(72066), +(72098), +(72106), +(72120), +(72121), +(72123), +(72124), +(72133), +(72163), +(72164), +(72166), +(72167), +(72171), +(72194), +(72196), +(72198), +(72208), +(72211), +(72218), +(72219), +(72222), +(72231), +(72258), +(72264), +(72265), +(72266), +(72267), +(72268), +(72269), +(72293), +(72301), +(72302), +(72303), +(72304), +(72313), +(72318), +(72319), +(72321), +(72322), +(72324), +(72326), +(72327), +(72329), +(72330), +(72333), +(72334), +(72335), +(72336), +(72360), +(72366), +(72367), +(72368), +(72369), +(72373), +(72400), +(72409), +(72410), +(72421), +(72422), +(72423), +(72424), +(72426), +(72427), +(72434), +(72437), +(72447), +(72448), +(72449), +(72451), +(72453), +(72457), +(72463), +(72465), +(72484), +(72485), +(72486), +(72487), +(72488), +(72489), +(72490), +(72491), +(72492), +(72501), +(72502), +(72503), +(72504), +(72531), +(72539), +(72540), +(72541), +(72551), +(72552), +(72553), +(72556), +(72558), +(72566), +(72567), +(72568), +(72569), +(72570), +(72571), +(72586), +(72588), +(72590), +(72597), +(72613), +(72617), +(72645), +(72671), +(72672), +(72688), +(72728), +(72756), +(72796), +(72797), +(72798), +(72804), +(72805), +(72806), +(72809), +(72810), +(72811), +(72847), +(72848), +(72865), +(72875), +(72876), +(72879), +(72883), +(72898), +(72901), +(72930), +(72960), +(72961), +(72963), +(72964), +(72965), +(72966), +(72967), +(72985), +(72995), +(73003), +(73040), +(73075), +(73076), +(73079), +(73395), +(73412), +(73488), +(73489), +(73491), +(73492), +(73499), +(73536), +(73574), +(73712), +(73771), +(73772), +(73782), +(73783), +(73784), +(73788), +(73789), +(73790), +(73797), +(73798), +(73799), +(73830), +(73832), +(73833), +(73879), +(73896), +(73906), +(73912), +(73913), +(73914), +(73943), +(73952), +(73985), +(74035), +(74046), +(74062), +(74080), +(74111), +(74162), +(74163), +(74164), +(74166), +(74184), +(74185), +(74222), +(74307), +(74325), +(74326), +(74327), +(74347), +(74367), +(74394), +(74395), +(74403), +(74404), +(74413), +(74414), +(74417), +(74421), +(74422), +(74424), +(74438), +(74445), +(74451), +(74453), +(74454), +(74470), +(74485), +(74502), +(74506), +(74507), +(74524), +(74562), +(74710), +(74749), +(74762), +(74768), +(74772), +(74774), +(74792), +(74797), +(74807), +(74812), +(74904), +(74905), +(74913), +(74978), +(74982), +(75055), +(75058), +(75082), +(75086), +(75088), +(75102), +(75159), +(75160), +(75161), +(75163), +(75168), +(75182), +(75185), +(75186), +(75188), +(75209), +(75213), +(75234), +(75314), +(75327), +(75329), +(75330), +(75331), +(75332), +(75362), +(75366), +(75367), +(75382), +(75383), +(75384), +(75412), +(75419), +(75421), +(75422), +(75423), +(75434), +(75459), +(75493), +(75494), +(75648), +(75731), +(75760), +(75780), +(75888), +(75889), +(75953), +(76096), +(76221), +(79187), +(79397); +CREATE TABLE `temp_cond_vals` +( + `spellId` INT(11), + `elseGroup` INT(11) AUTO_INCREMENT, + `entry` INT(11), + `dead` INT(11), + `errorTextId` INT(11), + `comment` VARCHAR(255), + PRIMARY KEY (`spellId`, `elseGroup`) +) ENGINE=MYISAM; + +CREATE TABLE `temp_item_spell` +( + `itemId` INT(11), + `spellId` INT(11), + PRIMARY KEY (`itemId`, `spellId`) +); + +CREATE TABLE `temp_item` +( + `itemId` INT(11), + PRIMARY KEY (`itemId`) +); + +INSERT INTO `temp_item` SELECT DISTINCT `SourceEntry` FROM `conditions` WHERE `SourceTypeOrReferenceId` = 18; +INSERT IGNORE INTO `temp_item_spell` SELECT `entry`, `spellid_1` FROM `item_template` WHERE `entry` IN (SELECT * FROM `temp_item`) AND `spellid_1` IN (SELECT * FROM `temp_convert_spells`); +INSERT IGNORE INTO `temp_item_spell` SELECT `entry`, `spellid_2` FROM `item_template` WHERE `entry` IN (SELECT * FROM `temp_item`) AND `spellid_2` IN (SELECT * FROM `temp_convert_spells`); +INSERT IGNORE INTO `temp_item_spell` SELECT `entry`, `spellid_3` FROM `item_template` WHERE `entry` IN (SELECT * FROM `temp_item`) AND `spellid_3` IN (SELECT * FROM `temp_convert_spells`); +INSERT IGNORE INTO `temp_item_spell` SELECT `entry`, `spellid_4` FROM `item_template` WHERE `entry` IN (SELECT * FROM `temp_item`) AND `spellid_4` IN (SELECT * FROM `temp_convert_spells`); +INSERT IGNORE INTO `temp_item_spell` SELECT `entry`, `spellid_5` FROM `item_template` WHERE `entry` IN (SELECT * FROM `temp_item`) AND `spellid_5` IN (SELECT * FROM `temp_convert_spells`); + +INSERT INTO `temp_cond_vals` (`spellId`, `entry`, `dead`, `errorTextId`, `comment`) SELECT DISTINCT (SELECT `spellId` FROM `temp_item_spell` WHERE `itemId` = `SourceEntry`), `ConditionValue2`, (`ConditionValue1` - 1), `ErrorTextId`, `Comment` FROM `conditions` +WHERE `SourceTypeOrReferenceId` = 18; + +-- use CONDITION_OBJECT_ENTRY instead of CONDITION_ITEM_TARGET +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `Comment`) +SELECT DISTINCT 17, 0, `spellId`, 0, `elseGroup` - 1, 31, 1, 3, `entry`, 0, 0, `errorTextId`, `comment` FROM `temp_cond_vals`; +-- for CONDITION_ITEM_TARGET with ConditionValue1 = DEAD we're adding !CONDITION_ALIVE as a second requirement +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `Comment`) +SELECT DISTINCT 17, 0, `spellId`, 0, `elseGroup` - 1, 36, 1, 0, 0, 0, 1, `errorTextId`, `comment` FROM `temp_cond_vals` WHERE `dead`; +-- remove entries which could be converted by this sql +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 18 AND `SourceEntry` IN (SELECT `itemId` FROM `temp_item_spell`); +DROP TABLE `temp_convert_spells`; +DROP TABLE `temp_cond_vals`; +DROP TABLE `temp_item_spell`; +DROP TABLE `temp_item`; + +ALTER TABLE conditions DROP PRIMARY KEY; +ALTER TABLE conditions ADD PRIMARY KEY (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`); diff --git a/sql/old/3.3.5a/2012_02_16_01_world_conditions.sql b/sql/old/3.3.5a/2012_02_16_01_world_conditions.sql new file mode 100644 index 00000000000..4bcf997b8e4 --- /dev/null +++ b/sql/old/3.3.5a/2012_02_16_01_world_conditions.sql @@ -0,0 +1,3 @@ +UPDATE `conditions` SET ConditionValue3 = 0, ConditionTarget = 1 WHERE ConditionTypeOrReference = 1 AND ConditionValue3 = 1; +UPDATE `conditions` SET ConditionTypeOrReference = 31, ConditionValue2 = ConditionValue1, ConditionValue1 = 3, ConditionTarget = 1 WHERE ConditionTypeOrReference = 19; +UPDATE `conditions` SET ConditionTypeOrReference = 38, ConditionValue2 = 4, ConditionTarget = 1 WHERE ConditionTypeOrReference = 20; diff --git a/sql/old/3.3.5a/2012_02_17_00_world_waypoints.sql b/sql/old/3.3.5a/2012_02_17_00_world_waypoints.sql new file mode 100644 index 00000000000..1cff86f5d51 --- /dev/null +++ b/sql/old/3.3.5a/2012_02_17_00_world_waypoints.sql @@ -0,0 +1,77 @@ +-- Pathing for Eye of Thrallmar +SET @NPC :=57585; +SET @PATH :=@NPC*10; +UPDATE `creature` SET `position_x`=203.191,`position_y`=2850.286,`position_z`=160.4257,`spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,197.9876,2842.495,160.4257,0,0,0,100,0), +(@PATH,2,212.5493,2807.971,174.2035,0,0,0,100,0), +(@PATH,3,244.0748,2812.302,156.8424,0,0,0,100,0), +(@PATH,4,262.963,2839.935,173.5923,0,0,0,100,0), +(@PATH,5,249.0294,2865.575,155.9257,0,0,0,100,0), +(@PATH,6,223.3671,2870.441,169.5924,0,0,0,100,0), +(@PATH,7,203.191,2850.286,160.4257,0,0,0,100,0); + +-- Pathing for Eye of Thrallmar +SET @NPC :=57586; +SET @PATH :=@NPC*10; +UPDATE `creature` SET `position_x`=210.6249,`position_y`=2809.285,`position_z`=208.7277,`spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,213.0469,2809.036,207.1722,0,0,0,100,0), +(@PATH,2,223.5349,2797.282,213.4777,0,0,0,100,0), +(@PATH,3,238.895,2805.732,213.4777,0,0,0,100,0), +(@PATH,4,252.788,2818.183,213.4777,0,0,0,100,0), +(@PATH,5,255.2734,2839.056,213.4777,0,0,0,100,0), +(@PATH,6,245.0219,2851.84,213.4777,0,0,0,100,0), +(@PATH,7,229.2117,2860.19,213.4777,0,0,0,100,0), +(@PATH,8,213.6996,2851.376,206.5887,0,0,0,100,0), +(@PATH,9,204.457,2828.248,199.6443,0,0,0,100,0), +(@PATH,10,212.4397,2807.455,199.6443,0,0,0,100,0), +(@PATH,11,241.3802,2813.464,199.6443,0,0,0,100,0), +(@PATH,12,249.7797,2829.964,199.6443,0,0,0,100,0), +(@PATH,13,244.951,2854.129,199.6443,0,0,0,100,0), +(@PATH,14,221.8344,2856.781,199.6443,0,0,0,100,0), +(@PATH,15,210.7503,2837.578,199.6443,0,0,0,100,0), +(@PATH,16,210.6249,2809.285,208.7277,0,0,0,100,0); + +-- Pathing for Eye of Thrallmar +SET @NPC :=57587; +SET @PATH :=@NPC*10; +UPDATE `creature` SET `position_x`=236.1859,`position_y`=2813.747,`position_z`=200.9708,`spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,241.7692,2815.284,200.8042,0,0,0,100,0), +(@PATH,2,255.8273,2833.317,201.443,0,0,0,100,0), +(@PATH,3,247.4309,2853.592,205.1653,0,0,0,100,0), +(@PATH,4,223.9901,2858.107,208.5819,0,0,0,100,0), +(@PATH,5,208.0596,2843.793,192.3596,0,0,0,100,0), +(@PATH,6,213.9734,2816.793,188.4153,0,0,0,100,0), +(@PATH,7,236.1859,2813.747,200.9708,0,0,0,100,0); + +-- Pathing for Eye of Thrallmar +SET @NPC :=57588; +SET @PATH :=@NPC*10; +UPDATE `creature` SET `position_x`=245.9259,`position_y`=2829.09,`position_z`=177.804,`spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,251.6207,2841.322,177.804,0,0,0,100,0), +(@PATH,2,241.4914,2859.113,169.6652,0,0,0,100,0), +(@PATH,3,214.9913,2858.249,176.3595,0,0,0,100,0), +(@PATH,4,210.2245,2836.028,169.7762,0,0,0,100,0), +(@PATH,5,225.7556,2822.145,169.9707,0,0,0,100,0), +(@PATH,6,237.9712,2823.874,170.1096,0,0,0,100,0), +(@PATH,7,245.9259,2829.09,177.804,0,0,0,100,0); + +DELETE FROM `creature` WHERE `guid`=57589; +UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry`=16598; + + diff --git a/sql/old/3.3.5a/2012_02_18_00_world_spell_script_names.sql b/sql/old/3.3.5a/2012_02_18_00_world_spell_script_names.sql new file mode 100644 index 00000000000..993fe3a2f38 --- /dev/null +++ b/sql/old/3.3.5a/2012_02_18_00_world_spell_script_names.sql @@ -0,0 +1,69 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` in (-100,-12162,13567,17251,23019,23448,23453,25860,28089,29200,29858,30458,30507,31225,35745,37674,39090,39093,39096,42784,43723,44875,47170,49357,50243,51582,51961,52759,52845,53808,54171,54577,55004,64385,-1464,-5308,12809,23881,-1454,-50286,8171,52041,52046,52047,52048,52049,52050,52059,52060,52061,52031,52033,52034,52035,52036,58778,58779,58780,60103,-49998,-66188,-47541,52375,59134,-62900,49560,62324,31890); +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(-100,'spell_warr_charge'), +(-12162,'spell_warr_deep_wounds'), +(13567,'spell_gen_dummy_trigger'), +(17251,'spell_gen_spirit_healer_res'), +(23019,'spell_item_crystal_prison_dummy_dnd'), +(23448,'spell_gen_gadgetzan_transporter_backfire'), +(23453,'spell_gen_gnomish_transporter'), +(25860,'spell_item_reindeer_transformation'), +(28089,'spell_thaddius_polarity_shift'), +(29200,'spell_item_purify_helboar_meat'), +(29858,'spell_warl_soulshatter'), +(30458,'spell_item_nigh_invulnerability'), +(30507,'spell_item_poultryizer'), +(31225,'spell_item_shimmering_vessel'), +(35745,'spell_item_socrethars_stone'), +(37674,'spell_gen_chaos_blast'), +(39090,'spell_capacitus_polarity_charge'), +(39093,'spell_capacitus_polarity_charge'), +(39096,'spell_capacitus_polarity_shift'), +(42784,'spell_astromancer_wrath_of_the_astromancer'), +(43723,'spell_item_demon_broiled_surprise'), +(44875,'spell_item_complete_raptor_capture'), +(47170,'spell_item_impale_leviroth'), +(49357,'spell_item_brewfest_mount_transformation'), +(50243,'spell_item_teach_language'), +(51582,'spell_item_rocket_boots'), +(51961,'spell_item_chicken_cover'), +(52759,'spell_sha_ancestral_awakening_proc'), +(52845,'spell_item_brewfest_mount_transformation'), +(53808,'spell_item_pygmy_oil'), +(54577,'spell_item_uded'), +(54171,'spell_pal_divine_storm_dummy'), +(55004,'spell_item_nitro_boots'), +(64385,'spell_item_unusual_compass'), +(-1464,'spell_warr_slam'), +(-5308,'spell_warr_execute'), +(12809,'spell_warr_concussion_blow'), +(23881,'spell_warr_bloodthirst'), +(-1454,'spell_warl_life_tap'), +(-50286,'spell_dru_starfall_dummy'), +(8171,'spell_sha_cleansing_totem_pulse'), +(52041,'spell_sha_healing_stream_totem'), +(52046,'spell_sha_healing_stream_totem'), +(52047,'spell_sha_healing_stream_totem'), +(52048,'spell_sha_healing_stream_totem'), +(52049,'spell_sha_healing_stream_totem'), +(52050,'spell_sha_healing_stream_totem'), +(52059,'spell_sha_healing_stream_totem'), +(52060,'spell_sha_healing_stream_totem'), +(52061,'spell_sha_healing_stream_totem'), +(52031,'spell_sha_mana_spring_totem'), +(52033,'spell_sha_mana_spring_totem'), +(52034,'spell_sha_mana_spring_totem'), +(52035,'spell_sha_mana_spring_totem'), +(52036,'spell_sha_mana_spring_totem'), +(58778,'spell_sha_mana_spring_totem'), +(58779,'spell_sha_mana_spring_totem'), +(58780,'spell_sha_mana_spring_totem'), +(60103,'spell_sha_lava_lash'), +(-49998,'spell_dk_death_strike'), +(-66188,'spell_dk_death_strike'), +(-47541,'spell_dk_death_coil'), +(52375,'spell_dk_death_coil'), +(59134,'spell_dk_death_coil'), +(-62900,'spell_dk_death_coil'), +(49560,'spell_dk_death_grip'), +(62324,'spell_vehicle_throw_passenger'); diff --git a/sql/old/3.3.5a/2012_02_18_01_world_spell_dbc.sql b/sql/old/3.3.5a/2012_02_18_01_world_spell_dbc.sql new file mode 100644 index 00000000000..b343399d7f2 --- /dev/null +++ b/sql/old/3.3.5a/2012_02_18_01_world_spell_dbc.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_dbc` WHERE `id`=31980; +INSERT INTO `spell_dbc` (`Id`,`Dispel`,`Mechanic`,`Attributes`,`AttributesEx`,`AttributesEx2`,`AttributesEx3`,`AttributesEx4`,`AttributesEx5`,`AttributesEx6`,`AttributesEx7`,`Stances`,`StancesNot`,`Targets`,`CastingTimeIndex`,`AuraInterruptFlags`,`ProcFlags`,`ProcChance`,`ProcCharges`,`MaxLevel`,`BaseLevel`,`SpellLevel`,`DurationIndex`,`RangeIndex`,`StackAmount`,`EquippedItemClass`,`EquippedItemSubClassMask`,`EquippedItemInventoryTypeMask`,`Effect1`,`Effect2`,`Effect3`,`EffectDieSides1`,`EffectDieSides2`,`EffectDieSides3`,`EffectRealPointsPerLevel1`,`EffectRealPointsPerLevel2`,`EffectRealPointsPerLevel3`,`EffectBasePoints1`,`EffectBasePoints2`,`EffectBasePoints3`,`EffectMechanic1`,`EffectMechanic2`,`EffectMechanic3`,`EffectImplicitTargetA1`,`EffectImplicitTargetA2`,`EffectImplicitTargetA3`,`EffectImplicitTargetB1`,`EffectImplicitTargetB2`,`EffectImplicitTargetB3`,`EffectRadiusIndex1`,`EffectRadiusIndex2`,`EffectRadiusIndex3`,`EffectApplyAuraName1`,`EffectApplyAuraName2`,`EffectApplyAuraName3`,`EffectAmplitude1`,`EffectAmplitude2`,`EffectAmplitude3`,`EffectMultipleValue1`,`EffectMultipleValue2`,`EffectMultipleValue3`,`EffectMiscValue1`,`EffectMiscValue2`,`EffectMiscValue3`,`EffectMiscValueB1`,`EffectMiscValueB2`,`EffectMiscValueB3`,`EffectTriggerSpell1`,`EffectTriggerSpell2`,`EffectTriggerSpell3`,`EffectSpellClassMaskA1`,`EffectSpellClassMaskA2`,`EffectSpellClassMaskA3`,`EffectSpellClassMaskB1`,`EffectSpellClassMaskB2`,`EffectSpellClassMaskB3`,`EffectSpellClassMaskC1`,`EffectSpellClassMaskC2`,`EffectSpellClassMaskC3`,`MaxTargetLevel`,`SpellFamilyName`,`SpellFamilyFlags1`,`SpellFamilyFlags2`,`SpellFamilyFlags3`,`MaxAffectedTargets`,`DmgClass`,`PreventionType`,`DmgMultiplier1`,`DmgMultiplier2`,`DmgMultiplier3`,`AreaGroupId`,`SchoolMask`,`Comment`) VALUES +(31980,0,0,328064,1024,4,268894208,0,0,0,0,0,0,0,1,0,0,101,0,0,14,14,0,13,0,-1,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22,0,0,15,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,4,0,0,0,0,1,0,0,0,1,"Righteous Defense Trigger Spell"); diff --git a/sql/old/3.3.5a/2012_02_18_02_world_gossip.sql b/sql/old/3.3.5a/2012_02_18_02_world_gossip.sql new file mode 100644 index 00000000000..47882d4eb36 --- /dev/null +++ b/sql/old/3.3.5a/2012_02_18_02_world_gossip.sql @@ -0,0 +1,52 @@ +-- Gossip for Lore Keeper of Norgannon "Uldaman" for quest 2278 "The Platinum Discs" +UPDATE `creature_template` SET `gossip_menu_id`=562 WHERE `entry`=7172; + +-- SAI for Lore Keeper of Norgannon +SET @ENTRY := 7172; +UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,1,62,0,100,0,576,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Lore Keeper of Norgannon - On gossip option select - close gossip'), +(@ENTRY,0,1,0,61,0,100,0,0,0,0,0,26,2278,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Lore Keeper of Norgannon - On gossip option select - give quest credit'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=562 AND `SourceEntry`=0; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,562,0,0,9,2278,0,0,0,'','Show gossip option if player has quest 2278 but not complete'); + +DELETE FROM `gossip_menu` WHERE `entry` BETWEEN 561 AND 576; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES +(561,1080), +(562,1079), +(563,1081), +(564,1082), +(565,1083), +(566,1084), +(567,1085), +(568,1086), +(569,1087), +(570,1088), +(571,1089), +(572,1090), +(573,1091), +(574,1092), +(575,1093), +(576,1094); + +DELETE FROM `gossip_menu_option` WHERE `menu_id` BETWEEN 561 AND 576; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(561,0,0,'What is a "subterranean being matrix"?',1,1,563,0,0,0,''), +(562,0,0,'Who are the Earthen?',1,1,561,0,0,0,''), +(563,0,0,'What are the anomalies you speak of?',1,1,564,0,0,0,''), +(564,0,0,'What is a "resilient foundation of construction"?',1,1,565,0,0,0,''), +(565,0,0,'So... the Earthen were made out of stone?',1,1,566,0,0,0,''), +(566,0,0,'Anything else I should know about the Earthen?',1,1,567,0,0,0,''), +(567,0,0,'I think I understand the Creators'' design intent for the Earthen now. What are the Earthen''s anomalies that you spoke of earlier?',1,1,568,0,0,0,''), +(568,0,0,'What high-stress environments would cause the Earthen to destabilize?',1,1,569,0,0,0,''), +(569,0,0,'What happens when the Earthen destabilize?',1,1,570,0,0,0,''), +(570,0,0,'Troggs?! Are the troggs you mention the same as the ones in the world today?',1,1,571,0,0,0,''), +(571,0,0,'You mentioned two results when the Earthen destabilize. What is the second?',1,1,572,0,0,0,''), +(572,0,0,'Dwarves!!! Now you''re telling me that dwarves originally came from the Earthen?!',1,1,573,0,0,0,''), +(573,0,0,'These dwarves are the same ones today, yes? Do dwarves maintain any other links to the Earthen?',1,1,574,0,0,0,''), +(574,0,0,'Who are the Creators?',1,1,575,0,0,0,''), +(575,0,0,'This is a lot to think about.',1,1,576,0,0,0,''), +(576,0,0,'I will access the discs now.',1,1,0,0,0,0,''); diff --git a/sql/old/3.3.5a/2012_02_18_03_world_gossip.sql b/sql/old/3.3.5a/2012_02_18_03_world_gossip.sql new file mode 100644 index 00000000000..990006f5098 --- /dev/null +++ b/sql/old/3.3.5a/2012_02_18_03_world_gossip.sql @@ -0,0 +1,1068 @@ +-- XXXXXXXXXXXXXXXXXXXX +-- X Rogue Trainers X +-- XXXXXXXXXXXXXXXXXXXX + +UPDATE `creature_template` SET `gossip_menu_id`=410 WHERE `entry`=1234; +UPDATE `creature_template` SET `gossip_menu_id`=85 WHERE `entry`=2122; +UPDATE `creature_template` SET `gossip_menu_id`=3984 WHERE `entry`=6707; +UPDATE `creature_template` SET `gossip_menu_id`=4512 WHERE `entry`=3328; +UPDATE `creature_template` SET `gossip_menu_id`=4575 WHERE `entry`=4215; +UPDATE `creature_template` SET `gossip_menu_id`=4577 WHERE `entry`=4214; +UPDATE `creature_template` SET `gossip_menu_id`=4658 WHERE `entry`=1411; + +-- Gossip Condition for Rogue Trainers +SET @GOSSIP := 85; +SET @TEXTYES := 581; +SET @TEXTNO := 4796; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), +(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I would like to train.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), +(@GOSSIP,4,0,"",1,1,0,0,0,0,''); + +-- Gossip Condition for Rogue Trainers +SET @GOSSIP := 141; +SET @TEXTYES := 638; +SET @TEXTNO := 4793; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), +(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I would like training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), +(@GOSSIP,4,0,"",1,1,0,0,0,0,''); + +-- Gossip Condition for Rogue Trainers +SET @GOSSIP := 381; +SET @TEXTYES := 878; +SET @TEXTNO := 4799; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), +(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am in need of training, Keryn.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), +(@GOSSIP,4,0,"",1,1,0,0,0,0,''); + +-- Gossip Condition for Rogue Trainers +SET @GOSSIP := 410; +SET @TEXTYES := 4795; +SET @TEXTNO := 4797; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), +(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I would like to train.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), +(@GOSSIP,4,0,"",1,1,0,0,0,0,''); + +-- Gossip Condition for Rogue Trainers +SET @GOSSIP := 411; +SET @TEXTYES := 908; +SET @TEXTNO := 4798; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), +(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"Good day, Hulfdan, I am looking for training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), +(@GOSSIP,4,0,"",1,1,0,0,0,0,''); + +-- Gossip Condition for Rogue Trainers +SET @GOSSIP := 436; +SET @TEXTYES := 934; +SET @TEXTNO := 4793; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), +(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"Hello! I am a Rogue in need of training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), +(@GOSSIP,4,0,"",1,1,0,0,0,0,''); + +-- Gossip Condition for Rogue Trainers +SET @GOSSIP := 3984; +SET @TEXTYES := 4838; +SET @TEXTNO := 4839; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), +(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"Yes, I have. Teach me.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), +(@GOSSIP,4,0,"",1,1,0,0,0,0,''); + +-- Gossip Condition for Rogue Trainers +SET @GOSSIP := 4502; +SET @TEXTYES := 4835; +SET @TEXTNO := 4837; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), +(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"Can you train me how to use rogue skills?",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), +(@GOSSIP,4,0,"",1,1,0,0,0,0,''); + +-- Gossip Condition for Rogue Trainers +SET @GOSSIP := 4512; +SET @TEXTYES := 638; +SET @TEXTNO := 4793; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), +(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I would like training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), +(@GOSSIP,4,0,"",1,1,0,0,0,0,''); + +-- Gossip Condition for Rogue Trainers +SET @GOSSIP := 4513; +SET @TEXTYES := 638; +SET @TEXTNO := 4793; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), +(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I would like training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), +(@GOSSIP,4,0,"",1,1,0,0,0,0,''); + +-- Gossip Condition for Rogue Trainers +SET @GOSSIP := 4540; +SET @TEXTYES := 581; +SET @TEXTNO := 4796; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), +(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I would like to train.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), +(@GOSSIP,4,0,"",1,1,0,0,0,0,''); + +-- Gossip Condition for Rogue Trainers +SET @GOSSIP := 4541; +SET @TEXTYES := 581; +SET @TEXTNO := 4796; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), +(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I would like to train.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), +(@GOSSIP,4,0,"",1,1,0,0,0,0,''); + +-- Gossip Condition for Rogue Trainers +SET @GOSSIP := 4542; +SET @TEXTYES := 581; +SET @TEXTNO := 4796; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), +(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I would like to train.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), +(@GOSSIP,4,0,"",1,1,0,0,0,0,''); + +-- Gossip Condition for Rogue Trainers +SET @GOSSIP := 4561; +SET @TEXTYES := 5695; +SET @TEXTNO := 4833; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), +(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I'm lookin' for rogue trainin'.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), +(@GOSSIP,4,0,"",1,1,0,0,0,0,''); + +-- Gossip Condition for Rogue Trainers +SET @GOSSIP := 4562; +SET @TEXTYES := 4834; +SET @TEXTNO := 4833; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), +(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I'm lookin' for rogue trainin'.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), +(@GOSSIP,4,0,"",1,1,0,0,0,0,''); + +-- Gossip Condition for Rogue Trainers +SET @GOSSIP := 4575; +SET @TEXTYES := 4795; +SET @TEXTNO := 4793; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), +(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I seek training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), +(@GOSSIP,4,0,"",1,1,0,0,0,0,''); + +-- Gossip Condition for Rogue Trainers +SET @GOSSIP := 4576; +SET @TEXTYES := 4795; +SET @TEXTNO := 4793; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), +(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I seek training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), +(@GOSSIP,4,0,"",1,1,0,0,0,0,''); + +-- Gossip Condition for Rogue Trainers +SET @GOSSIP := 4577; +SET @TEXTYES := 4795; +SET @TEXTNO := 4793; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), +(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I seek training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), +(@GOSSIP,4,0,"",1,1,0,0,0,0,''); + +-- Gossip Condition for Rogue Trainers +SET @GOSSIP := 4658; +SET @TEXTYES := 6165; +SET @TEXTNO := 6164; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), +(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"Can you train me how to use rogue skills?",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), +(@GOSSIP,4,0,"",1,1,0,0,0,0,''); + +-- Gossip Condition for Rogue Trainers +SET @GOSSIP := 4659; +SET @TEXTYES := 4835; +SET @TEXTNO := 4837; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), +(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"Can you train me how to use rogue skills?",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), +(@GOSSIP,4,0,"",1,1,0,0,0,0,''); + +-- Gossip Condition for Rogue Trainers +SET @GOSSIP := 4676; +SET @TEXTYES := 4835; +SET @TEXTNO := 4833; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), +(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"Can you train me how to use rogue skills?",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), +(@GOSSIP,4,0,"",1,1,0,0,0,0,''); + +-- Gossip Condition for Rogue Trainers +SET @GOSSIP := 4690; +SET @TEXTYES := 4795; +SET @TEXTNO := 4793; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), +(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I seek training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), +(@GOSSIP,4,0,"",1,1,0,0,0,0,''); + +-- Gossip Condition for Rogue Trainers +SET @GOSSIP := 5061; +SET @TEXTYES := 4835; +SET @TEXTNO := 4837; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), +(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"Can you train me how to use rogue skills?",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), +(@GOSSIP,4,0,"",1,1,0,0,0,0,''); + +-- Gossip Condition for Rogue Trainers +SET @GOSSIP := 6650; +SET @TEXTYES := 9188; +SET @TEXTNO := 9187; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), +(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I require rogue training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), +(@GOSSIP,4,0,"",1,1,0,0,0,0,''); + +-- XXXXXXXXXXXXXXXXXXXXX +-- X Hunter Trainers X +-- XXXXXXXXXXXXXXXXXXXXX + +UPDATE `creature_template` SET `gossip_menu_id`=4657 WHERE `entry`=1404; +UPDATE `creature_template` SET `gossip_menu_id`=4695 WHERE `entry`=3596; +UPDATE `creature_template` SET `gossip_menu_id`=4009 WHERE `entry`=3601; +UPDATE `creature_template` SET `gossip_menu_id`=6652 WHERE `entry`=16672; +UPDATE `creature_template` SET `gossip_menu_id`=4101 WHERE `entry`=987; + +-- Gossip Condition for Hunter Trainers +SET @GOSSIP := 4008; +SET @TEXTYES := 4863; +SET @TEXTNO := 4993; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), +(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I'd like to train.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Hunter Trainers +SET @GOSSIP := 4009; +SET @TEXTYES := 4316; +SET @TEXTNO := 4993; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), +(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am in need of training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Hunter Trainers +SET @GOSSIP := 4010; +SET @TEXTYES := 4866; +SET @TEXTNO := 5003; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), +(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I have come for training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Hunter Trainers +SET @GOSSIP := 4011; +SET @TEXTYES := 4867; +SET @TEXTNO := 4998; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), +(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am in need of training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Hunter Trainers +SET @GOSSIP := 4012; +SET @TEXTYES := 4868; +SET @TEXTNO := 4998; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), +(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am a hunter and wish to train.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Hunter Trainers +SET @GOSSIP := 4017; +SET @TEXTYES := 4888; +SET @TEXTNO := 4888; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), +(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"Please train me.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Hunter Trainers +SET @GOSSIP := 4023; +SET @TEXTYES := 4889; +SET @TEXTNO := 4996; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), +(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I wish to train.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Hunter Trainers +SET @GOSSIP := 4101; +SET @TEXTYES := 5001; +SET @TEXTNO := 5002; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), +(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I seek training in the ways of the Hunter.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Hunter Trainers +SET @GOSSIP := 4472; +SET @TEXTYES := 4893; +SET @TEXTNO := 5000; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), +(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I seek training in the ways of the Hunter.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Hunter Trainers +SET @GOSSIP := 4473; +SET @TEXTYES := 4893; +SET @TEXTNO := 5000; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), +(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I seek training in the ways of the Hunter.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Hunter Trainers +SET @GOSSIP := 4474; +SET @TEXTYES := 4893; +SET @TEXTNO := 5000; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), +(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I seek training in the ways of the Hunter.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Hunter Trainers +SET @GOSSIP := 4506; +SET @TEXTYES := 4987; +SET @TEXTNO := 5004; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), +(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I wish to train.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Hunter Trainers +SET @GOSSIP := 4524; +SET @TEXTYES := 4997; +SET @TEXTNO := 4998; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), +(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I seek training in the ways of the Hunter.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Hunter Trainers +SET @GOSSIP := 4549; +SET @TEXTYES := 4999; +SET @TEXTNO := 5000; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), +(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I seek training in the ways of the Hunter.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Hunter Trainers +SET @GOSSIP := 4550; +SET @TEXTYES := 4890; +SET @TEXTNO := 5000; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), +(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am here for training.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Hunter Trainers +SET @GOSSIP := 4551; +SET @TEXTYES := 4999; +SET @TEXTNO := 5000; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), +(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I seek training in the ways of the Hunter.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Hunter Trainers +SET @GOSSIP := 4647; +SET @TEXTYES := 4997; +SET @TEXTNO := 4998; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), +(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I seek training in the ways of the Hunter.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Hunter Trainers +SET @GOSSIP := 4648; +SET @TEXTYES := 4987; +SET @TEXTNO := 5004; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), +(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I wish to train.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Hunter Trainers +SET @GOSSIP := 4657; +SET @TEXTYES := 5001; +SET @TEXTNO := 5002; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), +(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I seek training in the ways of the Hunter.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Hunter Trainers +SET @GOSSIP := 4675; +SET @TEXTYES := 4999; +SET @TEXTNO := 5000; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), +(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I seek training in the ways of the Hunter.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Hunter Trainers +SET @GOSSIP := 4693; +SET @TEXTYES := 6160; +SET @TEXTNO := 4993; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), +(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I'd like to train.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Hunter Trainers +SET @GOSSIP := 4695; +SET @TEXTYES := 4863; +SET @TEXTNO := 4993; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), +(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I'd like to train.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Hunter Trainers +SET @GOSSIP := 6652; +SET @TEXTYES := 9190; +SET @TEXTNO := 9189; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), +(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I seek training in the ways of the Hunter.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Hunter Trainers +SET @GOSSIP := 7262; +SET @TEXTYES := 8585; +SET @TEXTNO := 8586; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), +(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I seek training in the ways of the Hunter.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Gossip Condition for Hunter Trainers +SET @GOSSIP := 7368; +SET @TEXTYES := 8804; +SET @TEXTNO := 8823; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), +(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); +-- Add Any Missing Gossip Menu item +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(@GOSSIP,0,3,"I am a hunter in need of training, Acteon.",5,16,0,0,0,0,''), +(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), +(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); + +-- Add some missing gossip from sniff for Zabra'jin in Zangermarsh +UPDATE `creature_template` SET `gossip_menu_id`=7601 WHERE `entry`=18013; +UPDATE `creature_template` SET `gossip_menu_id`=7602 WHERE `entry`=18014; +UPDATE `creature_template` SET `gossip_menu_id`=7608 WHERE `entry`=18015; +UPDATE `creature_template` SET `gossip_menu_id`=7603 WHERE `entry`=18017; +UPDATE `creature_template` SET `gossip_menu_id`=7609 WHERE `entry`=18018; +UPDATE `creature_template` SET `gossip_menu_id`=9821 WHERE `entry`=18244; +UPDATE `creature_template` SET `gossip_menu_id`=7722 WHERE `entry`=18564; + +DELETE FROM `gossip_menu` WHERE `entry` IN (7601,7602,7603,7608,7609,7722,7946,9821); +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES +(7601,9248),(7602,9249),(7603,9250),(7608,9259), +(7609,9260),(7722,9431),(7946,9752),(9821,13584); + +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (7603,7608,7609) AND `id` IN (0); +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (7609,7722,9821) AND `id` IN (1); +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(7603,0,1,'I would like to buy from you.',3,128,0,0,0,0,''), +(7608,0,1,'I wish to purchase tradeskill supplies.',3,128,0,0,0,0,''), +(7609,0,1,'I wish to purchase fishing supplies.',3,128,0,0,0,0,''), +(7609,1,3,'Give me some pointers on my fishing technique.',5,16,0,0,0,0,''), +(7722,1,1,'I have marks to redeem!',3,128,0,0,0,0,''), +(9821,1,1,'I''m looking for a lost companion.',14,4194304,0,0,0,0,''); + +-- Add some missing gossip from sniff for Thunderlord Stronghold in Blade's Edge Mountains +UPDATE `creature_template` SET `gossip_menu_id`=9856 WHERE `entry`=19471; +UPDATE `creature_template` SET `gossip_menu_id`=9821 WHERE `entry`=19476; +UPDATE `creature_template` SET `gossip_menu_id`=5856 WHERE `entry`=19478; +UPDATE `creature_template` SET `gossip_menu_id`=8283 WHERE `entry`=21311; +UPDATE `creature_template` SET `gossip_menu_id`=8406 WHERE `entry`=21950; +UPDATE `creature_template` SET `gossip_menu_id`=8244 WHERE `entry`=21147; +UPDATE `creature_template` SET `gossip_menu_id`=8525 WHERE `entry`=21984; +UPDATE `creature_template` SET `gossip_menu_id`=8239 WHERE `entry`=21117; + +DELETE FROM `gossip_menu` WHERE `entry` IN (8283,8406,8244,8525,8239); +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES +(8283,10322),(8406,10508),(8244,10259),(8525,10661),(8239,10251); + +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (9856) AND `id` IN (0); +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(9856,0,1,'Show me what you have for sale.',3,128,0,0,0,0,''); + diff --git a/sql/old/3.3.5a/2012_02_18_04_world_spell_script_names.sql b/sql/old/3.3.5a/2012_02_18_04_world_spell_script_names.sql new file mode 100644 index 00000000000..8fa5bc55197 --- /dev/null +++ b/sql/old/3.3.5a/2012_02_18_04_world_spell_script_names.sql @@ -0,0 +1,6 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` IN (52059,52060,52061); +DELETE FROM `spell_script_names` WHERE `spell_id` IN (58759,58760,58761); +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(58759,'spell_sha_healing_stream_totem'), +(58760,'spell_sha_healing_stream_totem'), +(58761,'spell_sha_healing_stream_totem'); diff --git a/sql/old/3.3.5a/2012_02_18_05_world_creatures.sql b/sql/old/3.3.5a/2012_02_18_05_world_creatures.sql new file mode 100644 index 00000000000..3fdac99c854 --- /dev/null +++ b/sql/old/3.3.5a/2012_02_18_05_world_creatures.sql @@ -0,0 +1,3 @@ +UPDATE `creature` SET `MovementType`=1 WHERE `spawndist`!=0 AND `MovementType`=2 AND `guid` IN (49123,49124,49125,49127,49128,49129,49143,49144,49145,49146,49150,49151,49154,49156,49157,49158,49167,49186,49187,49188,49318,49319,49664,49665,49751,49762,51398,51402,51422,51423,123148,127753,137490,137491,202314); +UPDATE `creature` SET `MovementType`=0 WHERE `spawndist`=0 AND `MovementType`=2 AND `guid` IN (49123,49124,49125,49127,49128,49129,49143,49144,49145,49146,49150,49151,49154,49156,49157,49158,49167,49186,49187,49188,49318,49319,49664,49665,49751,49762,51398,51402,51422,51423,123148,127753,137490,137491,202314); +UPDATE `creature_template` SET `MovementType`=0 WHERE `MovementType`=2 AND `entry` NOT IN (21657,30007); diff --git a/sql/old/3.3.5a/2012_02_18_06_world_gossip.sql b/sql/old/3.3.5a/2012_02_18_06_world_gossip.sql new file mode 100644 index 00000000000..e3385ceb5b0 --- /dev/null +++ b/sql/old/3.3.5a/2012_02_18_06_world_gossip.sql @@ -0,0 +1,166 @@ +-- Add some missing gossip to Nagrand From UDB +UPDATE `creature_template` SET `gossip_menu_id`=7675 WHERE `entry`=18261; +UPDATE `creature_template` SET `gossip_menu_id`=7723 WHERE `entry`=18333; +UPDATE `creature_template` SET `gossip_menu_id`=7719 WHERE `entry`=18417; +UPDATE `creature_template` SET `gossip_menu_id`=7724 WHERE `entry`=18581; +UPDATE `creature_template` SET `gossip_menu_id`=7625 WHERE `entry`=18265; +UPDATE `creature_template` SET `gossip_menu_id`=7626 WHERE `entry`=18276; +UPDATE `creature_template` SET `gossip_menu_id`=7631 WHERE `entry`=18335; +UPDATE `creature_template` SET `gossip_menu_id`=7699 WHERE `entry`=18471; +UPDATE `creature_template` SET `gossip_menu_id`=7563 WHERE `entry`=18074; +UPDATE `creature_template` SET `gossip_menu_id`=7592 WHERE `entry`=18200; +UPDATE `creature_template` SET `gossip_menu_id`=7579 WHERE `entry`=18180; +UPDATE `creature_template` SET `gossip_menu_id`=7607 WHERE `entry`=18218; +UPDATE `creature_template` SET `gossip_menu_id`=7704 WHERE `entry`=18482; +UPDATE `creature_template` SET `gossip_menu_id`=8493, `npcflag`=`npcflag`|1 WHERE `entry`=22113; + +DELETE FROM `gossip_menu` WHERE `entry`=7563 AND `text_id`=9181; +DELETE FROM `gossip_menu` WHERE `entry`=7578 AND `text_id`=9220; +DELETE FROM `gossip_menu` WHERE `entry`=7579 AND `text_id` IN (9219,9221,9256,9257); +DELETE FROM `gossip_menu` WHERE `entry`=7592 AND `text_id` IN (9240,9283,9284); +DELETE FROM `gossip_menu` WHERE `entry`=7607 AND `text_id` IN (9258,9286); +DELETE FROM `gossip_menu` WHERE `entry`=7625 AND `text_id`=9287; +DELETE FROM `gossip_menu` WHERE `entry`=7626 AND `text_id`=9288; +DELETE FROM `gossip_menu` WHERE `entry`=7631 AND `text_id`=9312; +DELETE FROM `gossip_menu` WHERE `entry`=7675 AND `text_id` IN (9361,9369); +DELETE FROM `gossip_menu` WHERE `entry`=7676 AND `text_id`=9368; +DELETE FROM `gossip_menu` WHERE `entry`=7677 AND `text_id`=9367; +DELETE FROM `gossip_menu` WHERE `entry`=7678 AND `text_id`=9366; +DELETE FROM `gossip_menu` WHERE `entry`=7679 AND `text_id`=9365; +DELETE FROM `gossip_menu` WHERE `entry`=7680 AND `text_id`=9364; +DELETE FROM `gossip_menu` WHERE `entry`=7681 AND `text_id`=9363; +DELETE FROM `gossip_menu` WHERE `entry`=7682 AND `text_id`=9362; +DELETE FROM `gossip_menu` WHERE `entry`=7699 AND `text_id`=9394; +DELETE FROM `gossip_menu` WHERE `entry`=7704 AND `text_id`=9405; +DELETE FROM `gossip_menu` WHERE `entry`=7705 AND `text_id`=9406; +DELETE FROM `gossip_menu` WHERE `entry`=7714 AND `text_id`=9424; +DELETE FROM `gossip_menu` WHERE `entry`=7715 AND `text_id`=9423; +DELETE FROM `gossip_menu` WHERE `entry`=7716 AND `text_id`=9422; +DELETE FROM `gossip_menu` WHERE `entry`=7717 AND `text_id`=9421; +DELETE FROM `gossip_menu` WHERE `entry`=7718 AND `text_id`=9420; +DELETE FROM `gossip_menu` WHERE `entry`=7719 AND `text_id` IN (9419,9427); +DELETE FROM `gossip_menu` WHERE `entry`=7723 AND `text_id`=9429; +DELETE FROM `gossip_menu` WHERE `entry`=7724 AND `text_id`=9433; +DELETE FROM `gossip_menu` WHERE `entry`=8393 AND `text_id`=10493; +DELETE FROM `gossip_menu` WHERE `entry`=8394 AND `text_id`=10492; +DELETE FROM `gossip_menu` WHERE `entry`=8394 AND `text_id`=10614; -- was incorrect in the db +DELETE FROM `gossip_menu` WHERE `entry`=8395 AND `text_id`=10494; +DELETE FROM `gossip_menu` WHERE `entry`=8395 AND `text_id`=10615; -- was incorrect in the db +DELETE FROM `gossip_menu` WHERE `entry`=8396 AND `text_id`=10495; +DELETE FROM `gossip_menu` WHERE `entry`=8396 AND `text_id`=10616; -- was incorrect in the db +DELETE FROM `gossip_menu` WHERE `entry`=8398 AND `text_id`=10497; +DELETE FROM `gossip_menu` WHERE `entry`=8493 AND `text_id` IN (10606,10655,10854); +DELETE FROM `gossip_menu` WHERE `entry`=8497 AND `text_id`=10616; +DELETE FROM `gossip_menu` WHERE `entry`=8498 AND `text_id`=10615; +DELETE FROM `gossip_menu` WHERE `entry`=8499 AND `text_id`=10614; +DELETE FROM `gossip_menu` WHERE `entry` BETWEEN 21296 AND 21303; -- the old menus assigned to Lantresor which were not sniffed +DELETE FROM `gossip_menu` WHERE `entry` BETWEEN 21304 AND 21309; -- the old menus assigned to Altruis which were not sniffed +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES +(7563,9181), +(7578,9220), +(7579,9219),(7579,9221),(7579,9256),(7579,9257), +(7592,9240),(7592,9283),(7592,9284), +(7625,9287), +(7626,9288), +(7631,9312), +(7699,9394), +(7607,9258),(7607,9286), +(7675,9361),(7675,9369), +(7676,9368), +(7677,9367), +(7678,9366), +(7679,9365), +(7680,9364), +(7681,9363), +(7682,9362), +(7704,9405), +(7705,9406), +(7714,9424), +(7715,9423), +(7716,9422), +(7717,9421), +(7718,9420), +(7719,9419),(7719,9427), +(7723,9429), +(7724,9433), +(8394,10492), +(8393,10493), +(8395,10494), +(8396,10495), +(8398,10497), +(8493,10606),(8493,10655),(8493,10854), +(8497,10616), +(8498,10615), +(8499,10614); + +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (7579,7704,7715,7716,7717,7718,7719,8393,8394,8395,8396,8398,8497,8498,8499) AND `id`=0; +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (7719,7724) AND `id`=1; +DELETE FROM `gossip_menu_option` WHERE `menu_id` BETWEEN 7675 AND 7682 AND `id`=0; +UPDATE `gossip_menu_option` SET `action_menu_id`=8499 WHERE `menu_id`=8397; -- was incorrect +DELETE FROM `gossip_menu_option` WHERE `menu_id` BETWEEN 21296 AND 21303; -- the old options assigned to Lantresor which were not sniffed +DELETE FROM `gossip_menu_option` WHERE `menu_id` BETWEEN 21304 AND 21309; -- the old options assigned to Altruis which was not sniffed +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(7579,0,0,'Hemet Nesingwary, what are you doing here in the Outland?',1,1,7578,0,0,0,''), +(7704,0,0,'Empoor, you''re going to tell me what I want to know, or else!',1,1,0,0,0,0,''), +(7715,0,0,'Forge camps?',1,1,7714,0,0,0,''), +(7716,0,0,'How do you see them now?',1,1,7715,0,0,0,''), +(7717,0,0,'And now?',1,1,7716,0,0,0,''), +(7718,0,0,'Legion?',1,1,7717,0,0,0,''), +(7719,0,0,'I see twisted steel and smell sundered earth.',1,1,7718,0,0,0,''), +(7719,1,0,'Tell me about the demon hunter training grounds at the Ruins of Karabor.',1,1,8394,0,0,0,''), +(7724,1,1,'I have marks to redeem!',3,128,0,0,0,0,''), +(7675,0,0,'I have killed many of your ogres, Lantresor. I have no fear.',1,1,7682,0,0,0,''), +(7682,0,0,'Should I know? You look like an orc to me.',1,1,7681,0,0,0,''), +(7681,0,0,'And the other half?',1,1,7680,0,0,0,''), +(7680,0,0,'I have heard of your kind, but I never thought to see the day when I would meet a half-breed.',1,1,7679,0,0,0,''), +(7679,0,0,'My apologies. I did not mean to offend. I am here on behalf of my people.',1,1,7678,0,0,0,''), +(7678,0,0,'My people ask that you pull back your Boulderfist ogres and cease all attacks on our territories. In return, we will also pull back our forces.',1,1,7677,0,0,0,''), +(7677,0,0,'We will fight you until the end, then, Lantresor. We will not stand idly by as you pillage our towns and kill our people.',1,1,7676,0,0,0,''), +(7676,0,0,'What do I need to do?',1,1,0,0,0,0,''), +(8394,0,0,'I''m listening.',1,1,8393,0,0,0,''), +(8393,0,0,'Go on, please.',1,1,8395,0,0,0,''), +(8395,0,0,'Interesting.',1,1,8396,0,0,0,''), +(8396,0,0,'That''s quite a story.',1,1,8398,0,0,0,''), +(8398,0,0,'There was something else I wanted to ask you, Altruis.',1,1,7719,0,0,0,''), +(8499,0,0,'But you are dragons! How could orcs do this to you?',1,1,8498,0,0,0,''), +(8498,0,0,'Your mate?',1,1,8497,0,0,0,''), +(8497,0,0,'I have battled many beasts, dragon. I will help you.',1,1,0,0,0,0,''); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=7579 AND `SourceEntry` IN (9221,9256,9257); +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=7592 AND `SourceEntry` IN (9283,9284); +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=7607 AND `SourceEntry`=9286; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=7675 AND `SourceEntry`=9369; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=7719 AND `SourceEntry`=9427; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=8493 AND `SourceEntry` IN (10655,10854); +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=7675 AND `SourceEntry`=0; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup` IN (7704,7719) AND `SourceEntry`=0; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup` IN (7719) AND `SourceEntry`=1; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=21304; -- condition for Altruis' gossip that wasn't sniffed +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=21295; -- condition for Lantresor's gossip that wasn't sniffed +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,7579,9221,0,0,8,208,0,0,0,0,'','Show different gossip if player has rewarded quest 208'), +(14,7579,9256,0,0,8,9851,0,0,0,0,'','Show different gossip if player has rewarded quest 9851'), +(14,7579,9257,0,0,8,9852,0,0,0,0,'','Show different gossip if player has rewarded quest 9852'), +(14,7592,9283,0,0,8,9854,0,0,0,0,'','Show different gossip if player has rewarded quest 9854'), +(14,7592,9284,0,0,8,9856,0,0,0,0,'','Show different gossip if player has rewarded quest 9856'), +(14,7607,9286,0,0,8,9859,0,0,0,0,'','Show different gossip if player has rewarded quest 9859'), +(14,7675,9369,0,0,8,10107,0,0,0,0,'','Show different gossip if player has rewarded quest 10107'), +(14,7675,9369,0,1,8,10108,0,0,0,0,'','Show different gossip if player has rewarded quest 10108'), +(14,7719,9427,0,0,8,9991,0,0,0,0,'','Show different gossip if player has rewarded quest 9991'), +(14,8493,10655,0,0,8,10870,0,0,0,0,'','Show different gossip if player has rewarded quest 10870'), +(14,8493,10854,0,0,8,11012,0,0,0,0,'','Show different gossip if player has rewarded quest 11012'), +(15,7675,0,0,0,9,10107,0,0,0,0,'','Show gossip option if player has quest 10107 but not complete'), +(15,7675,0,0,1,9,10108,0,0,0,0,'','Show gossip option if player has quest 10108 but not complete'), +(15,7704,0,0,0,9,9978,0,0,0,0,'','Show gossip option if player has quest 9978 but not complete'), +(15,7719,0,0,0,8,9991,0,0,1,0,'','Show gossip option if player has not rewarded quest 9991'), +(15,7719,1,0,0,9,10646,0,0,0,0,'','Show gossip option if player has quest 10646 but not complete'); + +UPDATE `smart_scripts` SET `event_param1`=7715 WHERE `entryorguid`=18417 AND `id` IN (0,1); -- correct Altruis' script +UPDATE `smart_scripts` SET `event_param1`=8396 WHERE `entryorguid`=18417 AND `id`=2; + +UPDATE `smart_scripts` SET `event_param1`=8497 WHERE `entryorguid`=21657 AND `id`=0; -- correct Neltharaku's script + +UPDATE `smart_scripts` SET `link`=3, `event_param1`=7676 WHERE `entryorguid`=18261 AND `id` IN (1,2); -- correct Lantresor's script +DELETE FROM `smart_scripts` WHERE `entryorguid`=18261 AND `id`=3; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(18261,0,3,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Lantresor - On gossip select - Close gossip'); diff --git a/sql/old/3.3.5a/2012_02_18_07_world_gossip.sql b/sql/old/3.3.5a/2012_02_18_07_world_gossip.sql new file mode 100644 index 00000000000..6246f12cefc --- /dev/null +++ b/sql/old/3.3.5a/2012_02_18_07_world_gossip.sql @@ -0,0 +1,44 @@ +-- Fallen Hero of the Horde http://old.wowhead.com/npc=7572 +DELETE FROM `gossip_menu` WHERE `entry`=840 AND `text_id`=1451; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (840,1451); +DELETE FROM `gossip_menu` WHERE `entry`=880 AND `text_id`=1452; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (880,1452); +DELETE FROM `gossip_menu` WHERE `entry`=881 AND `text_id`=1456; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (881,1456); +DELETE FROM `gossip_menu` WHERE `entry`=882 AND `text_id`=1455; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (882,1455); +DELETE FROM `gossip_menu` WHERE `entry`=883 AND `text_id`=1454; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (883,1454); +DELETE FROM `gossip_menu` WHERE `entry`=884 AND `text_id`=1453; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (884,1453); +-- Text Conditions +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=840 AND `SourceEntry` IN (1391); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,840,1391,0,8,2784,0,0,0,'','Show gossip text if player has quest 2801 or 2784 completed'), -- It's hard to imagine that so much death and despair could be confined to such a small area; yet beyond the swamp is a land plagued by chaos and destruction.$B$BWatch your step, adventurer. The Blasted Lands are the final resting place to far greater beings than you. +(14,840,1391,1,8,2801,0,0,0,'','Show gossip text if player has quest 2801 or 2784 completed'); -- It's hard to imagine that so much death and despair could be confined to such a small area; yet beyond the swamp is a land plagued by chaos and destruction.$B$BWatch your step, adventurer. The Blasted Lands are the final resting place to far greater beings than you. +-- Gossip option conditions +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=840; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,840,0,0,9,2784,0,0,0,'','Show gossip option if player has quest 2784 but not complete'), +(15,840,1,0,9,2801,0,0,0,'','Show gossip option if player has quest 2801 but not complete'), +(15,840,2,0,9,2702,0,0,0,'','Show gossip option if player has quest 2702 but not complete'); +-- Add Any Missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE `menu_id`=840 AND `id` IN (0,1); +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (880,881,882,883,884) AND `id` IN (0); +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(840,0,0,"Please continue, Hero...",1,1,880,0,0,0,''), +(840,1,0,"Please continue, Hero...",1,1,880,0,0,0,''), +(880,0,0,"What could be worse than death?",1,1,884,0,0,0,''), +(881,0,0,"I shall.",1,1,0,0,0,0,''), +(882,0,0,"You can count on me, Hero.",1,1,881,0,0,0,''), +(883,0,0,"What are the stones of binding?",1,1,882,0,0,0,''), +(884,0,0,"Subordinates?",1,1,883,0,0,0,''); +-- Fallen Hero of the Horde SAI +UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='' WHERE `entry`=7572; +DELETE FROM `smart_scripts` WHERE (`entryorguid`=7572 AND `source_type`=0); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(7572,0,0,1,62,0,100,0,881,0,0,0,26,2784,0,0,0,0,0,7,0,0,0,0,0,0,0,'Fallen Hero of the Horde - On Gossip option select - complete quest 2784'), +(7572,0,1,2,61,0,100,0,0,0,0,0,26,2801,0,0,0,0,0,7,0,0,0,0,0,0,0,'Fallen Hero of the Horde - On Gossip option select - complete quest 2801'), +(7572,0,2,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Fallen Hero of the Horde - On Gossip option select - Close Gossip'), +(7572,0,3,4,62,0,100,0,840,2,0,0,12,7750,1,180000,0,0,0,8,0,0,0,-10630.3,-2987.05,28.96,4.54,'Fallen Hero of the Horde - On Gossip option select - Spawn Corporal Thund Splithoof'), +(7572,0,4,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Fallen Hero of the Horde - On Gossip option select - Close Gossip'); diff --git a/sql/old/3.3.5a/2012_02_18_08_world_gossip.sql b/sql/old/3.3.5a/2012_02_18_08_world_gossip.sql new file mode 100644 index 00000000000..a9fef9bcd76 --- /dev/null +++ b/sql/old/3.3.5a/2012_02_18_08_world_gossip.sql @@ -0,0 +1,5 @@ +-- Fix mistake in Fallen Hero of the Horde gossip update +UPDATE `conditions` SET `ConditionValue1`=2784,`Comment`='Show gossip text if player has quest 2801 or 2784 completed' WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=840 AND `ConditionValue1`=2704; +UPDATE `conditions` SET `Comment`='Show gossip text if player has quest 2801 or 2784 completed' WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=840 AND `ConditionValue1`=2801; +UPDATE `conditions` SET `ConditionValue1`=2784,`Comment`='Show gossip option if player has quest 2784 but not complete' WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=840 AND `ConditionValue1`=2704; +UPDATE `smart_scripts` SET `action_param1`=2784 WHERE `entryorguid`=7572 AND `id`=0; diff --git a/sql/old/3.3.5a/2012_02_19_00_auth_account.sql b/sql/old/3.3.5a/2012_02_19_00_auth_account.sql new file mode 100644 index 00000000000..a5b48ede3b4 --- /dev/null +++ b/sql/old/3.3.5a/2012_02_19_00_auth_account.sql @@ -0,0 +1,2 @@ +ALTER TABLE `account` + ADD COLUMN `os` VARCHAR(4) DEFAULT '' NOT NULL AFTER `locale`; diff --git a/sql/old/3.3.5a/2012_02_19_00_characters_warden_action.sql b/sql/old/3.3.5a/2012_02_19_00_characters_warden_action.sql new file mode 100644 index 00000000000..587f65fedc5 --- /dev/null +++ b/sql/old/3.3.5a/2012_02_19_00_characters_warden_action.sql @@ -0,0 +1,7 @@ +DROP TABLE IF EXISTS `warden_action`; + +CREATE TABLE `warden_action` ( + `wardenId` smallint(5) unsigned NOT NULL, + `action` tinyint(3) unsigned DEFAULT NULL, + PRIMARY KEY (`wardenId`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/sql/old/3.3.5a/2012_02_19_00_world_quest_template.sql b/sql/old/3.3.5a/2012_02_19_00_world_quest_template.sql new file mode 100644 index 00000000000..76ab51f803b --- /dev/null +++ b/sql/old/3.3.5a/2012_02_19_00_world_quest_template.sql @@ -0,0 +1,14 @@ +-- Shadowmourne quest chain fix by nelegalno + +-- Limit quests to Warrior, Paladin and Death Knight classes +UPDATE `quest_template` SET `RequiredClasses` = 35 WHERE `Id` IN (24545, 24743, 24547, 24749, 24756, 24757, 24548, 24748); + +-- Quest relations +UPDATE `quest_template` SET `NextQuestId` = 24743 WHERE `Id` = 24545; -- The Sacred and the Corrupt +UPDATE `quest_template` SET `NextQuestId` = 24547 WHERE `Id` = 24743; -- Shadow's Edge +UPDATE `quest_template` SET `NextQuestId` = 24749 WHERE `Id` = 24547; -- A Feast of Souls +UPDATE `quest_template` SET `NextQuestId` = 24756 WHERE `Id` = 24749; -- Unholy Infusion +UPDATE `quest_template` SET `NextQuestId` = 24757 WHERE `Id` = 24756; -- Blood Infusion +UPDATE `quest_template` SET `NextQuestId` = 24548 WHERE `Id` = 24757; -- Frost Infusion +UPDATE `quest_template` SET `NextQuestId` = 24549 WHERE `Id` = 24548; -- The Splintered Throne +UPDATE `quest_template` SET `NextQuestId` = 24748 WHERE `Id` = 24549; -- Shadowmourne... to The Lich King's Last Stand diff --git a/sql/old/3.3.5a/2012_02_19_01_world_quest_template.sql b/sql/old/3.3.5a/2012_02_19_01_world_quest_template.sql new file mode 100644 index 00000000000..2f888f08cdd --- /dev/null +++ b/sql/old/3.3.5a/2012_02_19_01_world_quest_template.sql @@ -0,0 +1,11 @@ +-- Dire Maul Book Quests + +UPDATE `quest_template` SET `RequiredClasses` = 1 WHERE `Id` = 7499; -- Codex of Defense (18357/7499) +UPDATE `quest_template` SET `RequiredClasses` = 2 WHERE `Id` = 7501; -- The Light and How to Swing It (18359/7501) +UPDATE `quest_template` SET `RequiredClasses` = 4 WHERE `Id` = 7503; -- The Greatest Race of Hunters (18361/7503) +UPDATE `quest_template` SET `RequiredClasses` = 8 WHERE `Id` = 7498; -- Garona: A Study on Stealth and Treachery (18356/7498) +UPDATE `quest_template` SET `RequiredClasses` = 16 WHERE `Id` = 7504; -- Holy Bologna: What the Light Won't Tell You (18362/7504) +UPDATE `quest_template` SET `RequiredClasses` = 64 WHERE `Id` = 7505; -- Frost Shock and You (18363/7505) Closes #4727 +UPDATE `quest_template` SET `RequiredClasses` = 128 WHERE `Id` = 7500; -- The Arcanist's Cookbook (18358/7500) +UPDATE `quest_template` SET `RequiredClasses` = 256 WHERE `Id` = 7502; -- Harnessing Shadows (18360/7502) +UPDATE `quest_template` SET `RequiredClasses` = 1024 WHERE `Id` = 7506; -- The Emerald Dream... (18364/7506) diff --git a/sql/old/3.3.5a/2012_02_19_02_world_gameobject.sql b/sql/old/3.3.5a/2012_02_19_02_world_gameobject.sql new file mode 100644 index 00000000000..88a1f2e3a4c --- /dev/null +++ b/sql/old/3.3.5a/2012_02_19_02_world_gameobject.sql @@ -0,0 +1,4 @@ +-- meeting stone for UK +DELETE FROM `gameobject` WHERE `id`=188488; +INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES +(245, 188488, 571, 1, 1, 1237.301, -4948.268, 36.02063, 2.495818, 0, 0, 0.9483232, 0.3173059, 300, 0, 1); diff --git a/sql/old/3.3.5a/2012_02_19_03_world_warden_checks.sql b/sql/old/3.3.5a/2012_02_19_03_world_warden_checks.sql new file mode 100644 index 00000000000..3698c461358 --- /dev/null +++ b/sql/old/3.3.5a/2012_02_19_03_world_warden_checks.sql @@ -0,0 +1,802 @@ +DROP TABLE IF EXISTS `warden_checks`; + +CREATE TABLE `warden_checks` ( + `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, + `type` tinyint(3) unsigned DEFAULT NULL, + `data` varchar(48) DEFAULT NULL, + `str` varchar(20) DEFAULT NULL, + `address` int(10) unsigned DEFAULT NULL, + `length` tinyint(3) unsigned DEFAULT NULL, + `result` varchar(24) DEFAULT NULL, + `comment` varchar(50) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +INSERT INTO `warden_checks`(`id`,`type`,`data`,`str`,`address`,`length`,`result`,`comment`) VALUES +(1,178,'07F223143C69271AA2A851FECF6DC883A9D3A7DBA6FE26CC','',710730,23,'',NULL), +(2,191,'C7D18F99DBC446A4B36E78B9130B6FA2E365B3D2D4199DF5','',28940,17,'',NULL), +(3,191,'AA1A8559776F873F26954F15E49E6041EDC2C3766AD87A59','',21826,11,'',NULL), +(4,178,'5F342A4D0EA9DB35F93FAE6E32670D810F017309817AA7C0','',676970,23,'',NULL), +(5,178,'C57BD89DD447131EA2083784AB4DA8BD58CF3E182F1D8AF6','',690106,23,'',NULL), +(6,191,'69AA85EFE8A1A990DA5ECFED4FAFD5B14F1D52EF2548FD15','',12905,36,'',NULL), +(7,191,'083ECAD073DE2D61E3564B4BF767C9D1F8F15AA0495F5A76','',41096,24,'',NULL), +(8,178,'C774D64EF60AD5A141FC56F3D02AE78AC147770FAE25D8FE','',3037164,22,'',NULL), +(9,191,'502C59CAFEA11E9584C13BFE75F85EB79936AEEE31B44165','',12194860,37,'',NULL), +(10,178,'4FBE8978A662428C616AABD71DA5562E4AC21F54BEB8ADBF','',3037164,22,'',NULL), +(11,178,'83D3F7FD7DCA144AD8219A6A4E20F0CFC6E7EA208C4144FF','',3033068,22,'',NULL), +(12,243,'','',4623652,7,'578B7D08578BF1','Pointer to realmlist address'), +(13,178,'00523153EE2298A8D80D7B26B7067CA7B26AC06FF374FE7B','',673210,23,'',NULL), +(14,191,'91BC368FA14A3FE3E13D0B1056F485F846925E613D8E8903','',12194860,37,'',NULL), +(15,243,'','',10010636,12,'8166443FFF1FFFD9565CD95E',NULL), +(16,178,'8FEFDBC58301AB0E0D0F6EBC5FBDA5ED9A7126873A9AB337','',682394,23,'',NULL), +(17,191,'B40FF92D4F092599EA9014C88B474DE4352C3F1635109882','',448492,48,'',NULL), +(18,191,'42B596FF923054531E4918DC39E08F8564FED16D559B494A','',29852,20,'',NULL), +(19,178,'24291D6733A7CEFA3D54C3BCCAE95D56D8365BAB42AEE1CE','',3037164,22,'',NULL), +(20,178,'6C4E321E2D5A153F2BB664EB6EEDF8D67FDE7ECC8076D087','',3990720,23,'',NULL), +(21,178,'FB649706C8F1AFF5990B5F3118DFE54FF6F9609C6991C161','',3045776,31,'',NULL), +(22,191,'D1B451C906B81261B048FD4025217245950C11660815367F','',28920,23,'',NULL), +(23,191,'40079A1083A6B57E3B713992BD395FB6650B631E4C4B8D4E','',29852,20,'',NULL), +(24,178,'3F8FEFE08CB358D6613656AFDB498AB8C599BA18B5574FB6','',682378,23,'',NULL), +(25,191,'EECA71B5536EE1992FD7825A5CCC4B7F9F3B413C0DA498B6','',29884,20,'',NULL), +(26,191,'B8786BFF2421ED1F1FB30F3F0BAF671FC1DAD5B3B33124C8','',28956,17,'',NULL), +(27,191,'BF0C842D635D9D8B3F6FF84EF6DF7C963C485EBAF02D17B0','',28920,23,'',NULL), +(28,191,'9672ED2A27C4972E04DF4471C95492C721024E241995170C','',36924,24,'',NULL), +(29,191,'63532B056020A261251BD24AB026BBC5D4468AF863136044','',17906,11,'',NULL), +(30,178,'7D38C80FEAB10B857A4A7BEF15D27A58FB43FD875E29C73C','',3990720,23,'',NULL), +(31,178,'B158752316672A90BF29846E7AD64BA4FD1699C638BFD3B6','',2299116,33,'',NULL), +(32,178,'4549AE7CA28700562D996CBC78FA7341DC05F644C01474E4','',3000288,31,'',NULL), +(33,178,'EE77806A4F5723FD9C6FC6F43308C8AB448E0A139CB43700','',690106,23,'',NULL), +(34,191,'046D6EA3E99E275F51CAA591BD8C478B6F964A3072018F43','',21660,15,'',NULL), +(35,178,'B1682CE919907AD7D8990F3D8272CFF24A996162565D52B4','',676970,23,'',NULL), +(36,178,'22E057649A8BF1D9672841EF47A4DA175AAC082FFEF059DA','',710730,23,'',NULL), +(37,178,'7BA62D5F5CFEB545D1AE646962F4EB9A91B93EF8FFD5D1B0','',710554,23,'',NULL), +(38,178,'702802D919D9E5C3FD42CA9188936C73E47F87CFA419025A','',3033068,22,'',NULL), +(39,178,'FDA6D997BFB8A991B57755633D1AB3C7E567A74C1EC09937','',3070052,22,'',NULL), +(40,191,'84F6BDD28490937867774E7BF8D5B78F68BF9EB43DE90F10','',477912,60,'',NULL), +(41,191,'5A5B4BA32BD937FF253016AE836DD44B794F8D05982860A6','',447736,48,'',NULL), +(42,178,'A243986665C7FCA1E60A9F209DE9431C3098D082DF1C4528','',682378,23,'',NULL), +(43,178,'7CC89374CE3A9C07DCD685006690B828931D60085EE5FEE8','',710554,23,'',NULL), +(44,191,'01F10590E6DFED79523D26C043D5424174BEF1011F3F4974','',477928,60,'',NULL), +(45,178,'C9728BDC4B77BAA7B3515AFD3628EDB0986DFA20B46917B4','',672746,23,'',NULL), +(46,191,'179B80E5E054521E44BA8F5978D5FC489CC9E514B350A3FF','',28956,17,'',NULL), +(47,243,'','',5417948,5,'7734FF2485','FrameXML Signature Check'), +(48,191,'7769A67D6E2460450873133B0CFF99B67A58CE6C404A17F8','',17282,15,'',NULL), +(49,178,'CF3896074EEBC0F93B539FD44E4D825227D4C1556B8F2279','',3990720,23,'',NULL), +(50,178,'88F2833B5267A71A0CA72509C40819B99283A6E556FD9038','',198,10,'',NULL), +(51,243,'','',8491566,5,'8B4D10890D','Lua DoString'), +(52,178,'F7229DF2D879A9E8D5BCEDCDC7046D75BAEE1C9D4DA41E55','',3638348,23,'',NULL), +(53,191,'AE78585CD862134059B13669FC416B8124752EC6471DDCE6','',28940,17,'',NULL), +(54,191,'B408E9F9B475E4B6A81F9B7F2E060824F618FFDABBFFE805','',13634,11,'',NULL), +(55,178,'A9DA016B83961F95097E08F2DEBE69517C7573FFF06D8C4B','',668874,23,'',NULL), +(56,191,'0E74160C242EF826D09BCE4ED535E9A9D251B1CD20E31891','',24812,14,'',NULL), +(57,178,'A58E4D44D952C1F9DB7B5E423167EE4C28AD02668C5B86AF','',710730,23,'',NULL), +(58,191,'35A9FC42ACBF3A147B0C8CF67BA04EC979C6534B20249B45','',28956,12,'',NULL), +(59,243,'','',5345746,7,'746583F9177760','Lua Protection Patch'), +(60,191,'1430DC4A627EA5FA2CFF9C010CE16022F259F81DB6047879','',13634,11,'',NULL), +(61,191,'85A005398AF851382267C01BB6FB04AEF2093213C20EC200','',360508,13,'',NULL), +(62,191,'96916CD89649027A9A8BBFBD28AE190CD5D590E24BBAD451','',13033,36,'',NULL), +(63,191,'056D57A5C1A46883400E1F69405750B23DE18C3032C3D91C','',27270,13,'',NULL), +(64,191,'87C641E1EDBD96D9F170C7BE0FA13F45611DCDF41AC02526','',41127,24,'',NULL), +(65,191,'1F378DF1E7BD99164DDC7401A98CA5E9551BD50B4A35D5AA','',34176,25,'',NULL), +(66,178,'B5ED443D6CA2F6095BAC8DAFDC8F3413F7B473916357C17E','',209352,75,'',NULL), +(67,191,'A2BC3FF01787A38CB88B3EF45C1CD97DA113157FC395D38C','',30012,16,'',NULL), +(68,191,'190862E5018F1428E5B12BFDAD08283ECD057B34AD722846','',41228,24,'',NULL), +(69,191,'6E0E55BE8690F64442E275559E6C9F8A3FDCAA00937D1C13','',49347,24,'',NULL), +(70,191,'B6FC4C07BB2CBE7C5C854CD99DAFEC0D1AE4101FC51460F9','',477912,60,'',NULL), +(71,178,'3B5955C3B498489869990F08A4CAE566A7D689C23990518B','',156,8,'',NULL), +(72,243,'','',7246064,6,'8950108B450C','Movement State related'), +(73,178,'F24317DAA28AA477996EEBB9538A89569ABF9B185A3EA4E4','',718842,23,'',NULL), +(74,178,'DA25A4134671325719833878E2556455EC4321A2207B6728','',198,10,'',NULL), +(75,191,'DC9490A7BEB43C64585E013B5260BE843D126EB3BCEBAC11','',50040,26,'',NULL), +(76,178,'4BB92BBD5CA8C192C9D0E1EDB6C21FF3F4A61ED1B151365F','',673210,23,'',NULL), +(77,178,'13E8DD1C9F5501A270A59CC4B61311F6D5D18DC3F2AA351A','',3037164,22,'',NULL), +(78,191,'346CFA39FF98198BDE1C23673FBF51A50CFF5ADED784F077','',17522,15,'',NULL), +(79,113,'0590FC57AB448975FA46C314A8AB75AF96DF0FD0A3D9FB23','Afd32uu',0,0,'',NULL), +(80,178,'E37D413DC96A92D3CEAB8A482B8F5397587A0E654C9A0166','',672954,23,'',NULL), +(81,178,'E7D5551799C2C7F0072BC3149A22F37D09EA1EB83F64C655','',3045912,31,'',NULL), +(82,191,'7CC5260578671130CA5B3392BA5CFD0F3DE0BE1085E556B6','',9977,32,'',NULL), +(83,191,'F44A40945F24385D089E040A733553EEFF92EFAAB0636323','',134968,32,'',NULL), +(84,178,'D3122CF30EE55310CF4A710E61B190D2B108227B746B41AD','',679578,23,'',NULL), +(85,191,'7E3CC1BC53477D84F05F623BBC94B9DE8D01A2607CA935DB','',41188,24,'',NULL), +(86,191,'DC06565CC1512B5A91A848E08BC4FBC6DA705F6503667852','',41127,24,'',NULL), +(87,191,'03DC47CDFBB14C5CF0D0010FA5424556F951585588A2180A','',29916,16,'',NULL), +(88,191,'29EC91C4D87891FECDED381CE65A86A259F00DD788833E4D','',174688,37,'',NULL), +(89,191,'31F024003681765368F6EFB667E83CE1D12799723AA99BF9','',685304,44,'',NULL), +(90,191,'6A82AC1D0BFEF5DA7385510CBC57189FACD42E45E0D2A65E','',30012,16,'',NULL), +(91,191,'3901FBD52655E12ADA4EEDED3B365B1DDFAAA925A140097F','',448492,48,'',NULL), +(92,191,'6E9991A25EC347BEA5813EDE0A842D746779C97606565B5A','',17906,11,'',NULL), +(93,191,'0AC9F2B104AC5AA9131FB14E669B98D30D056936625B0245','',27270,13,'',NULL), +(94,178,'A338B3DA78A6683CBEE08A63C5EEFBE1AF33BF54983D583D','',684876,29,'',NULL), +(95,178,'38759C29F2ACF42DA9D16EF35837A470DC7C42C3284B2A3C','',3049492,22,'',NULL), +(96,191,'F35817564FC39F4DB7994021352FEEB86E2FEE86C11B8DBB','',360508,13,'',NULL), +(97,191,'09FAC087283873DAEE0AD074ABF7DDB1B395F5CF6BC2141E','',28956,17,'',NULL), +(98,178,'87FE57916743AF3C97CC3B583B29E89B6E503D31D1747B64','',676970,23,'',NULL), +(99,178,'97D854645011BAD1F6625679511D78D1B7367A51EB0FCC6E','',668874,23,'',NULL), +(100,178,'12369F6F1B875FB5CC5E67445ADEAE2B295D196596679317','',0,9,'',NULL), +(101,191,'5034278808E93A3DFC9BEFFD8E180FEFA24DFC5056ED3BE1','',433168,48,'',NULL), +(102,178,'55EF16220A7EF3F74A9D895821610DFBD2A757FB05C792D5','',209352,75,'',NULL), +(103,191,'67445533AA0BB737D2F74C9258148C6C667794F0E3D07498','',45324,24,'',NULL), +(104,178,'AA8649100B17A9C5BE227F47F867FADE51AD242BAAD39821','',3045632,31,'',NULL), +(105,191,'85545FE9242B2474574EEBABBF452FBD11497073CB1E46A5','',41080,24,'',NULL), +(106,191,'9DACD6981681F53650B681EAE68065D26F4803682058709D','',448456,48,'',NULL), +(107,191,'96B74F1436A05E658E3282164BC3CBDF4DBBB2CF6A5B866F','',9977,32,'',NULL), +(108,191,'033BD6861DF7878DC9470EC2F699772BB2F3D5000490866F','',90202,13,'',NULL), +(109,113,'B797D0AF3164EE83167D5C054A511A5B209A70C6655C408B','IPSect',0,0,'',NULL), +(110,178,'D91A2764435C5091D3F9471AB8B5F397E609330294694488','',710730,23,'',NULL), +(111,191,'94EED02DCDB71789E50917DA401A03F4B91BDBEA050D8BCA','',3766400,37,'',NULL), +(112,178,'2DF33CBB544E2D5238FB591F2547AC507B4D8A652D789F2B','',2303444,33,'',NULL), +(113,243,'','',7860712,5,'742DF6407C',NULL), +(114,178,'81A74F35F0F887144D59F93647C18C70C5FEEF542A7F3782','',709322,22,'',NULL), +(115,178,'2E1F8A68FDDF084A950B786A1EE7E0CE43E62449A56F92A3','',3045632,31,'',NULL), +(116,191,'B1F8988B6664A90E79503FA5D843C3CB97BFDC23EB8C7690','',433168,48,'',NULL), +(117,178,'0277E26DE31814DFD675A59E526669E39080E033BAE88859','',0,9,'',NULL), +(118,243,'','',10714892,8,'BB8D243FD4D0313E','Wall Climb'), +(119,178,'09BBFC19FCADC69D6B5BF655A5BB6350B4A8120C3EB557D2','',3990720,23,'',NULL), +(120,178,'BF4ABDEB726B0060E74701C03180C3CB02170ADCB7DCB61C','',3049872,31,'',NULL), +(121,243,'','',9990741,9,'8B878000000089463C','No Fall Damage Patch'), +(122,178,'D259A46A6D1855C436BFC96FB9376BDCDF5E9FFAE8B4147C','',3045616,31,'',NULL), +(123,178,'F425A62A44097742D72A05669B6BE93AD9CEFE9E40D71E48','',3045976,31,'',NULL), +(124,191,'B134291F515D136B6576FFBC0133C7859755974611170D07','',20512,16,'',NULL), +(125,191,'125BE691985D8DB37068DC14D74EA2DA1260E4A63D3F74BF','',45324,24,'',NULL), +(126,178,'E06E3C5B356B34BA92F6765108556AD53ABB74B986D5810E','',3070052,22,'',NULL), +(127,178,'8CC87DFF61F2EC82DE033865C9879010D94E1614369FE286','',710554,23,'',NULL), +(128,191,'E1F5233450FEFFB6F0E8F2B17683047A485828FEDD3E5B80','',448456,48,'',NULL), +(129,191,'31BA6EA4DF2362676AB71F4CB60B0D40FA51A3AABD25D5CB','',36924,24,'',NULL), +(130,191,'C14630E1D519EB85C254C536FE81DC490977E869BD5CD884','',12985,36,'',NULL), +(131,191,'B337F892EEDD52A5B978C116A19D927134273626EFC4DAA3','',17890,11,'',NULL), +(132,191,'D97560108AA21A487EC9278759F7615BFA304A933776A201','',18680,35,'',NULL), +(133,178,'DA59505BA61459508532CBEAD246DCD2C8E7BF5C6D3CE676','',3037164,22,'',NULL), +(134,191,'5803CA69E5B7F1DF08D95219894D75F52EDB1AD429E562D9','',174688,37,'',NULL), +(135,178,'8A1099E19139D91573286DBB3DED2CC093A99FD178F7FEC8','',3033068,22,'',NULL), +(136,178,'0331B438B085F55C06F7F697160845BE953D9CE789AA62A4','',3000288,31,'',NULL), +(137,191,'E844078A5671FF7DB0621E7F1C7EDDF9C92F5A9FA0477FCB','',41023,24,'',NULL), +(138,178,'AAD7F47B231861913F353341FD26E5AA89AFB586FB6A5366','',672746,23,'',NULL), +(139,178,'136DFB3FE66D2830DF46EE155FCAEADC9624FFE1410088DA','',3041472,31,'',NULL), +(140,191,'C6015A0D5C9109768BA4233639A51F163CC7ED58749E5026','',25724,20,'',NULL), +(141,178,'9C668CE4D328EEA9B6AB7AD5FF54169289B35B230275A43C','',3049872,31,'',NULL), +(142,178,'FC3C95E71F968C46BD5DB5C9EF9B0A5BDCC5619B805046F5','',2299060,33,'',NULL), +(143,178,'FBE3808C0E36BFBC1D1F5A0E508CA89E81E550CD2FDEEC48','',149,5,'',NULL), +(144,178,'35A8252DBC65514E858256C497141153812EE61C724BF5A9','',710730,23,'',NULL), +(145,178,'CC79AA9AE29A52A998181D183D38974221B8BAC0AB534E7D','',0,9,'',NULL), +(146,178,'B89F25A249D295580E649F5ABE0C65EC24401F4889A4FB16','',668874,23,'',NULL), +(147,178,'742A0A9997B9E857C355AA75797466506BAE73D44D26399D','',3037164,22,'',NULL), +(148,178,'E7975701601B2FDF8262098521B7BB4FF5CCC484F8E919E7','',3045776,31,'',NULL), +(149,178,'43E81BE830F169F4EDD23B84ABFA9D15EF12C978FE134346','',60648,56,'',NULL), +(150,178,'66CA9E464A2122E301A72FAEF13A4853D8CB1A45C177E854','',178504,96,'',NULL), +(151,113,'0A3C294B0799FD2C9EC17C1CCBCD174A51B6A2ECC62FEF17','IPSect',0,0,'',NULL), +(152,178,'6E9CE81BFCAF0C250705FCC599981D2D9E4D474A7E857B37','',2299108,33,'',NULL), +(153,178,'8734D6E081D5C993DCE8161CFDFC6197F39A487E4083A3E1','',149,5,'',NULL), +(154,178,'A33355AF7B5FF3CECB3A6059F6621F30AEE695D69421EA2B','',3049492,22,'',NULL), +(155,191,'BF8CEA63013511BDE0B551DAAC492DFBB9608645140B88F7','',29916,16,'',NULL), +(156,178,'8D5D5E99EAB2ED21A104913B05D6BD7A8E63ADA56B66CDED','',3022016,31,'',NULL), +(157,191,'778256BFEF82EA60C4E0F25083655FB2BB75B83FD60A9C06','',18680,35,'',NULL), +(158,178,'43FB8007D7DD7B01FFBEEA3EF9D0242778565544281EC761','',0,9,'',NULL), +(159,191,'94DCF5D21FE2106F5303216C14AD55EEDC1B19FDC91D5F76','',28704,16,'',NULL), +(160,191,'7EBBF90F7D8462D1453479DF9AC5943AF483FE2828C74FDD','',477928,60,'',NULL), +(161,191,'A171148491E099B12CCD1708B784D8C3B09737772C7780C0','',401992,14,'',NULL), +(162,191,'5350ACB75F9FA498FE0D2A371649C9FD9716BDDE2C32F5FB','',13634,11,'',NULL), +(163,191,'85E53280630956C58D4CA7FD8DC5FE73C9A2A03314DFF294','',45223,24,'',NULL), +(164,191,'391BC8A81D4EB6D526BAF0DC3468CAA36C9207B82E194B7A','',130380,14,'',NULL), +(165,191,'0F88FA5CD9B9950F850C18FE76C948FF43CDDE3E75638FF1','',17938,11,'',NULL), +(166,178,'EB63FC60164AFF92726DA658882BF1CE47CF0BF6C80B1B97','',690106,23,'',NULL), +(167,178,'E30B2494142B416BBE95DA3DAE4A82CBDF3A020715F10E8B','',4011280,23,'',NULL), +(168,191,'6CA1C19D0E9191CBC9CA3D5BC3CF1D19764D8F17C6B54AE4','',59620,13,'',NULL), +(169,178,'4730B7A7EC70544A688211A5C754C357A090116092D3EC4D','',682378,23,'',NULL), +(170,243,'','',10000022,6,'894644894E54',NULL), +(171,191,'713A7B79619AEF3C47E44102F86EDCE0D6AFBC5ABE87F861','',13538,11,'',NULL), +(172,191,'575F1C6AF7C71085C7D9CB2291844D9F2DA3B71391C0B941','',36907,24,'',NULL), +(173,178,'296F233E4FAC4CF419D5FBF2701AC4D5AA0866CB4D0DAEC6','',3045976,31,'',NULL), +(174,178,'933C1A228C99E35DF309838B25B7D5EA3A8E961E81D81D32','',673194,23,'',NULL), +(175,191,'9EC125252C3738478CA942DCB59030097194B284A9162B32','',59620,13,'',NULL), +(176,178,'6665F3FB8DC6BE71C152C3674B5783D6E57FE8BF796D190C','',3634252,23,'',NULL), +(177,191,'E120DD63042FEFF9E7FCEC0CA44D2544F03C5D4CDBA1C008','',12985,36,'',NULL), +(178,113,'09BDABA6CB17BE561B4104124A3D0266C858D194A8765198','drvsys_mon',0,0,'',NULL), +(179,178,'3AAE69E7088E4060EA32EF95E9B6D9532460F5B84EE4EC80','',684876,29,'',NULL), +(180,191,'990D4E1C2D63C8E447F034642686D57B727064E3EDE13B00','',448500,48,'',NULL), +(181,191,'E88F31BDC5513216CF3701CAF8BE954CCC7EAE0E7AC7D942','',594348,26,'',NULL), +(182,178,'81229C1E56FA72E01B52E8CBB8BB5F55ED48A11B72E7729B','',710554,23,'',NULL), +(183,191,'B4D0CDE7D53493A1549328F711013F07DBD3A9BE88DB2EF9','',685304,44,'',NULL), +(184,178,'D6CA6F94FF248F722F97037C1AE7C8DE0191D5F4D1E3A5B8','',156,8,'',NULL), +(185,178,'9C9DF1E868BB33D43676F21096C4F75759C0807096EEB886','',60648,56,'',NULL), +(186,178,'1C79B3B5A74A4F09A1FAE19BB15CDCF26B5F917861071F1C','',198,10,'',NULL), +(187,178,'AC1AD3E831A4C758858350A8A197A24FE82583F4B0E39A85','',3049888,31,'',NULL), +(188,178,'56E4980485E3129E94F370E7066E80B07141C4A669B9FC0F','',672746,23,'',NULL), +(189,178,'C21574305E0377A3D2B72D1E1546B9D62DCFA8B1A4405F16','',3638348,23,'',NULL), +(190,178,'AA74121AF835978BC1C1BB402A8B7388CB7C075C1227C253','',3049888,31,'',NULL), +(191,178,'D6457A86DFADF9825D6093090AED2A807FE7DA6ECF5922AF','',3065956,22,'',NULL), +(192,191,'1BAB7E6B5ACBEED8F54B667EDF13A385B9E146C0C50D9FB7','',448456,48,'',NULL), +(193,243,'','',7517484,7,'7518683B010000','Follow Unit Check'), +(194,178,'01000FEAC61ED76FE04ED1169C40289D96C71A1564E38FCB','',690106,23,'',NULL), +(195,191,'F095338ED87C658C916CC604A427F4ED95309C4A07B7898C','',34176,25,'',NULL), +(196,191,'800E120187DF74A231722FB887B3944AD16A703FB8CB9D39','',28920,23,'',NULL), +(197,191,'2CFCE981C322A54724E1418B6A6D1896B95D584630EEEA43','',38300,21,'',NULL), +(198,243,'','',5081862,8,'6840AAB600C60200',NULL), +(199,178,'481751066D6C97AD5EE90173E8ED107BB1C9FD873B0CE55A','',3037164,22,'',NULL), +(200,178,'7FC57D49535798CDA7E4DC5DCEA2E085AAB9A68BF7F9469D','',149,5,'',NULL), +(201,191,'33357C112DE0195F013FAAC4D57AB1BE77417934CE03A2B9','',3766400,37,'',NULL), +(202,191,'BF8AC678DC3CD354BADBFE46C9173D34CC84D13302190EBB','',21826,11,'',NULL), +(203,178,'4E2F9721D52A7552AE2728B9695F1523DD62DC0569237C3F','',2299108,33,'',NULL), +(204,191,'9F015E7D8A11F30AA1954D9FEA7142D0247E3C09FF2BFF72','',12194860,37,'',NULL), +(205,178,'1EB5AD39B94DB5CDC3294DF49FA589DFBE2C674D07E4B211','',710730,23,'',NULL), +(206,178,'E9D67F07E035A64B89C9E91614DC1930FEF61DC3A5C1BBA6','',690106,23,'',NULL), +(207,191,'36411C2FF2C3AC51B7F6A6B8DF61DBD4E5895C27438847BE','',59620,13,'',NULL), +(208,178,'A77F30CBB8057E0DB37782367C8462FA98D4DB21DE936ECD','',3049492,22,'',NULL), +(209,243,'','',7452688,10,'8B81CC07000025000000','WoWEmuHacker Injection'), +(210,178,'A8C806E1FB7CA3625E6BB6F5E4D9E2BF0EBDBE70BA7226F7','',3049872,31,'',NULL), +(211,191,'B3DD04807DEA2679045F4F197BDDAED5C7CCEEFE19622B43','',360508,13,'',NULL), +(212,178,'B075C8B4D8C5D83FE703677319491DC816EA5103901B44A8','',682394,23,'',NULL), +(213,191,'53DB506C0341B50BEA3897E2E3C0DD74C2CA2D8F5F34A2E4','',59620,13,'',NULL), +(214,191,'E112F38956124FE0F48BF569F5E81B40E293DC6E16B544D6','',17282,15,'',NULL), +(215,191,'0363EF2B1AAE09E6C2B1FA555E706F4EE094BE678DA27598','',3766400,37,'',NULL), +(216,191,'EA256F01B6340C99E27611B39C5ED28CF2FA202436F0972F','',49564,24,'',NULL), +(217,178,'A86C95C4E58495A10F5F1C9B5B62D3365132E8DC62863E8B','',198,12,'',NULL), +(218,191,'56DD8D99991F83AFA2E169315B395BD388B248340E9C64D3','',30044,16,'',NULL), +(219,191,'684B23E010C3D6B88CC12BD9F0B6B0CE00D692C71BFB84A8','',28940,17,'',NULL), +(220,178,'83AEEFCDF4C2E80B18DDF93D99120A89F916C19206D257AB','',668874,23,'',NULL), +(221,178,'D68651921F5CD387C7E860FB7C3B143409735748E3B2FB7F','',682394,23,'',NULL), +(222,113,'A4D501A9DB9D84BD8695A8BF61FC853BF434D2D4B352C7A0','HideEx',0,0,'',NULL), +(223,191,'5E77F12C032D4FEF559F9B837B85BDB9D95ADB10C9F56649','',448504,48,'',NULL), +(224,178,'F08406AEDFA8F19B6FB7C9ADDE0BFEE82CB0D2E275593150','',2303444,33,'',NULL), +(225,178,'AC0EC72522ADA5B2BFFAFAC92D6D0A0225E1D5C727CDFFA7','',672602,23,'',NULL), +(226,178,'4D1A7D1C88AB04438510E3255184E51EAE2036BB09DB553A','',700714,23,'',NULL), +(227,178,'68BBC36F75DC763B573DACAB1D6D8F70E667638AA894BEE9','',717898,23,'',NULL), +(228,178,'2AC3C23FBDE2C1EC46C9ECFF71BD7F603F17C9DFC1328D1C','',3638348,23,'',NULL), +(229,191,'C365E9FE00580EBB14EE863A5CE3C8139B1A59A610520AE7','',3766400,37,'',NULL), +(230,178,'DB2A0451B9753100085C9D149B61CE47A195D77C8B709143','',178504,96,'',NULL), +(231,178,'0871F69205FA62C74C2DDE200A3911FC3E41A4FB8BAB9817','',682378,23,'',NULL), +(232,191,'0017307F2FF889462B0FA06018D99EB1F847F189B6CC9B99','',21826,11,'',NULL), +(233,178,'0FEFCD6B0BF8C2816A9259AB5FD7B89231AEB8D92DE53D26','',3045356,22,'',NULL), +(234,178,'87EAD79656133B3183C2E452886D8F00C5EC6C9D741673A2','',3037164,22,'',NULL), +(235,178,'C2B6C5E19FA98D121B2CDE51789BD2883A324015E7D131E0','',710554,23,'',NULL), +(236,178,'B6F3A7D557A3E3BC4833C3D9B6B0B0609255591CC8AB3B65','',3022016,31,'',NULL), +(237,243,'','',5283280,12,'558BECB8084E0000E8731DF0','AddChatMessage'), +(238,191,'AEA87B23CD9463E9693B6C053C1D9030F8E229DA308DBF29','',90202,13,'',NULL), +(239,178,'8C16C7E8EEAD49AE67E4E91E229FFBCE2F6590A48348914E','',3049888,31,'',NULL), +(240,178,'7B2DCA97CD348E45490C288EADE9303CE270CF57F28EB1E4','',690106,23,'',NULL), +(241,191,'BC10B10BE398F2397FA6962C4E59C8CF11FDD7158EC222A5','',29916,16,'',NULL), +(242,178,'8E53EC1B8ABE90C9A5C087671DE0A3007BEA4488EE5415D0','',3037164,22,'',NULL), +(243,191,'65B5CE07A794164101F7E379D21A7A544EF1EC2A3A39A2D8','',27270,13,'',NULL), +(244,191,'C6C8597824F249180A53196699421ADF7857A5C4E4F80D6F','',13033,36,'',NULL), +(245,178,'FE677759E719178BC5CB49DA252D9B635F76030FC4C9876C','',673194,23,'',NULL), +(246,243,'','',5265823,5,'72118B5518','Language Patch'), +(247,178,'BA2D161EF412084B0229A08E64D5A445C4E9F9F2645535E5','',706314,23,'',NULL), +(248,191,'0174B647A535F206711D3EEEF08D3F421BCABD7016A2F103','',17282,15,'',NULL), +(249,178,'5F5F754FD6E7BAC9650B715387646CF992813730A2BA37DA','',2303444,33,'',NULL), +(250,178,'D2CC7F98209E9A9BBA483BD1E9A916E40EB971EE2129AFF8','',3990720,23,'',NULL), +(251,178,'E8C741CC79005898FFD0026821F61A2E4E67C695C6E1CE1C','',198,10,'',NULL), +(252,191,'23B364A9012EF40A39EC4D04A91F9B60FC7EF7D85E3F240A','',18680,35,'',NULL), +(253,191,'C9363F808D37F13FC09EBB7F700AD09EEB27DA046E41FD52','',36907,24,'',NULL), +(254,191,'2D92FC5B8603E18F50D9CAA0922F5C7BB89E42A4656ED2D5','',3766400,37,'',NULL), +(255,178,'EDEDBC5B1A3D92D2A91192118898FDBF840C967C82968D70','',3045912,31,'',NULL), +(256,113,'BFEF06E80472106B57B15D711F94A25243F6ABA7FE354C95','ndis_x86',0,0,'',NULL), +(257,178,'FB20B0EB9ACF571FE37C6B69CBE86F7906F96B996D7E5EFA','',2303444,33,'',NULL), +(258,191,'917AC1C48C1FF354FD594A3705C70A2C356FE981275E7FB5','',22792,25,'',NULL), +(259,178,'48CD29D8B39DC07B0FD071FD8C643E07A8FC2C9AFC2A3083','',3045356,22,'',NULL), +(260,243,'','',11154396,8,'D893FEC0488C11C1','Jump Momentum'), +(261,191,'FB13A8360C8E23B83ED7309625A7EFBAEE7DCF737068C5A6','',174688,37,'',NULL), +(262,191,'3C8D85F85ED5DD0354561F84EACA575123DE05EE941C28D2','',56063,25,'',NULL), +(263,191,'FBC20EEA52B5882209BC016EC14818376CA7BAF28780BCED','',22792,25,'',NULL), +(264,191,'210D85A84F7BE48F3EB427E0CBCCD9C146320ABAAB5E28D8','',41096,24,'',NULL), +(265,178,'953107F9F718795B6DF9E5E5BEE0EA949800CAD0EB71F891','',3037164,22,'',NULL), +(266,113,'FBBA36D0FC5434D12EE1509E148FF908D51F18719CCBEABC','IPSect',0,0,'',NULL), +(267,178,'82CB32BA2A05B228F2F8D0313C185EB6FDC50A94340F40C8','',209352,75,'',NULL), +(268,191,'079172B91B1768A2650A87BAB06AF700BB4C9A0B5E5B983B','',17522,15,'',NULL), +(269,191,'881751DF112F817E799953E00E94543DA4610968437DB7C6','',12194860,37,'',NULL), +(270,191,'9A47B274EAAC888FA2007B4EC0623580365458E3621CC416','',28956,17,'',NULL), +(271,191,'77344CE014111FAAA66DEF35B670B2E76AE878B054F85285','',61874,42,'',NULL), +(272,191,'0A74CBD8DFF245DA5E8691C1174F037D7ABE823E265226AB','',685656,44,'',NULL), +(273,178,'0E13ADDD413B679E2984060D929440064FAC308FC2B90742','',3049872,31,'',NULL), +(274,178,'D0D8CE5001596C6F4A766FE94726FE7E337F42469CB96CA1','',3065956,22,'',NULL), +(275,191,'313C58F8401B47F716B220B88411CAD0E85966D95B301591','',13033,36,'',NULL), +(276,178,'ACBDC68A4D748C48ED1180DD3DA52632EA6FC275BFC35D5B','',0,9,'',NULL), +(277,191,'BACA83A742B9E09CD07787BC6B50389707EA94C41886BAD0','',448504,48,'',NULL), +(278,178,'549B42D266E7F17B7F30B72E301A9CB3C5E3865DE9B7E90B','',60648,56,'',NULL), +(279,178,'86DB854557D75BEEE7DA820FCA15669B08C760E8B165B06F','',3037164,22,'',NULL), +(280,178,'02D5FBD9E30D43ACED0EFD00CF16DAA69EDD262C292136AB','',178504,96,'',NULL), +(281,191,'B9D920131EFC38767012340CF0FFBFE154DBA28E6EF3B859','',61874,42,'',NULL), +(282,191,'96E6CAE70AF690F5D552E0948C29CA9AA527DEBF9731B16B','',20512,16,'',NULL), +(283,191,'375B22B4990997348A8AEDD53319897BE196398B4F1DBAC3','',30012,16,'',NULL), +(284,178,'932F4622AE9F1B3990900F1F88375FA1DD7C238F7C6133C6','',684876,29,'',NULL), +(285,178,'43583C7BCCD9DF14C64CC84710BEE44DD30E199F579890AE','',3049872,31,'',NULL), +(286,191,'97CF98F0BCABA04BC2BAD40FBD4EBFB3C1FD8A7139D5C9B9','',433168,48,'',NULL), +(287,178,'97A0E0F8F8ACE7F1E6492DAFADE8F45B366446E79C1B0419','',3049452,22,'',NULL), +(288,243,'','',5284488,9,'7507C7451400000000','Language Patch'), +(289,191,'C3546D16052E0DC1838E7A6E18936B88CC8A40C2AEC0BE3B','',21826,11,'',NULL), +(290,178,'4179D6BD8C2F11AD5D5C103A7877504074009AB53AE4D8A6','',3045356,22,'',NULL), +(291,191,'2C360CEAB996C8D6E5DE3FFAC30E412DED48E7814D1CE110','',20512,16,'',NULL), +(292,191,'6F1486BE58078BD453F1B249947BB99CB8E17E9A355CE024','',41228,24,'',NULL), +(293,178,'924F4631DC3167BCFAB02F92DDB49A871DA0C55122EF9EB8','',0,9,'',NULL), +(294,178,'411029C5B28D942ED3C7BC1F4299162D874838A661410894','',700714,23,'',NULL), +(295,191,'B9093BAED730E86AF004119B3B7258938C56902915C2E8BA','',501956,48,'',NULL), +(296,178,'63BD2D7FF6C5442795361031E5768C396A37AE38AF98DB11','',668874,23,'',NULL), +(297,191,'754A2FE56037B971E128FFAA669032C511BDA3A62524CE03','',28956,12,'',NULL), +(298,178,'9AEFDCDB62EBC2DABD6CEBF8C411C1145274FCA7CED890CB','',3037164,22,'',NULL), +(299,178,'3AC57BAC3B782AE5ADBB899CCC060D4E8F66E5217F7DF654','',676970,23,'',NULL), +(300,191,'2F0D9702A58D6D5A8599529A0A816AA101AFE581D98416B2','',56063,25,'',NULL), +(301,178,'77804219E627B4D38C9F95194301A895180B598AEFA9963F','',3022016,31,'',NULL), +(302,178,'0D1B99EDC8E458705A88E72F7FDEEE9233DB21290A0098E6','',149,5,'',NULL), +(303,191,'BB795B4069F985BF44C7418DE264C3B0E9BA6D61A116FF81','',90202,13,'',NULL), +(304,191,'5A6EEBA1E6B9EE71BD4A5F63014E9928302C36FC806DC796','',3766400,37,'',NULL), +(305,191,'BA5777AF7FFF3895935669878D662B585912A759A2DFCE68','',24812,14,'',NULL), +(306,178,'5E690DB1AD8910886334158C6D4452FA2CE896634BCDDF40','',580768,52,'',NULL), +(307,191,'42A8F651F55F697E783ADA1959A2833276F970F1EE0410C7','',41280,16,'',NULL), +(308,243,'','',5296496,12,'558BEC81ECE80D00006A0AE8','SendChatMessage'), +(309,191,'445A6894B8C1838462D7D0D29FBE6BF815B5E6C344971349','',31924,23,'',NULL), +(310,178,'C010786A38F396503B7411FBADA0C1A68795F54A7AAE228E','',679578,23,'',NULL), +(311,113,'E3185EE4428291F9D2E4080C2EB1B19ADB005AD26EF0A993','IPSect',0,0,'',NULL), +(312,243,'','',7739760,11,'01BE80000000E805B6FFFF','Jump related?'), +(313,191,'1995FA3235ADA4B25232DC6403E7463A8D1864528BF9FDD4','',12905,36,'',NULL), +(314,243,'','',5124558,5,'8BF08D4608','GetCharacterInfo'), +(315,191,'30A26827798B7F1646003A9E846E8A9A8FF10A9DF926825A','',49564,24,'',NULL), +(316,178,'A567BBE4CA9D8E976083024E8D68903CF15CEA88C47C9961','',2299060,33,'',NULL), +(317,191,'BEA7165D7DD8E24E31B1C3D791A47A28731E1BACD1189A17','',24812,14,'',NULL), +(318,191,'0971A7CEB84D392670C7B8CBB61776762C25259D8E772CA5','',13538,11,'',NULL), +(319,178,'13200A59A28561A413FADAADFFFE4521A209CB691EA199A5','',690106,23,'',NULL), +(320,243,'','',5090917,8,'E886EE1D0083C40C',NULL), +(321,191,'56CABE081991356465BDE1DA3B8DED099DF9B6E746D1B531','',25724,20,'',NULL), +(322,191,'F98469C704F8B8ABC1A251EF8FC1E4CB5CEF1E007BAB5EA5','',57602,42,'',NULL), +(323,178,'6A64BF5AC652747B47E0B8E6593B7EEAC1EF38E0A84F4F5D','',3049452,22,'',NULL), +(324,191,'978BCD17BC9C81B05A2F0A50EC2CC206EC5F6AB1FE40D38D','',28956,12,'',NULL), +(325,178,'A28EDC898CEB14FB52591754DEF981C7168DD2421D0742FA','',3037164,22,'',NULL), +(326,191,'35E88DF07F0D48A0B7ABD53F4865DB762E6935529DC826DF','',360508,13,'',NULL), +(327,178,'BF1FB7E4C3CDD5D5A93AA1B24FC822AA5537DBB59F696818','',3037164,22,'',NULL), +(328,178,'343F1AFF6DA7A967D2DB958C608A6E2A19F83E862F8E3954','',149,5,'',NULL), +(329,243,'','',10694516,8,'2F549A416F12033B','Wall Climb'), +(330,178,'0B008034F97BD411A9F900D87578258AA1B79873850BC12B','',3049888,31,'',NULL), +(331,178,'C5A35B72E6BC604BAC9AA218908B3747D6850769CEA79C0F','',2299092,33,'',NULL), +(332,191,'FDDB2AA7F8884C8E3A7ED646B3E9E4AF5A8C0704130C39A7','',29852,20,'',NULL), +(333,178,'F57343CEA7133DE6469B1CFD1A749845D553B8D806B2BAA4','',3037164,22,'',NULL), +(334,178,'565A63583AC736E3CAFB95EE5AF9A64D3A7D3C3A8B234121','',3045912,31,'',NULL), +(335,191,'E26CF0E2ED92F608A80733CE703D7EA2C3DB83FE46182519','',3766400,37,'',NULL), +(336,191,'2F44EE3A34EFF98303B3724005EF3A8AC89CB25F9CA1B8BC','',12985,36,'',NULL), +(337,191,'C32F7CDB33BEF7B3093262F89263884DBB44E57D74D646B7','',12985,36,'',NULL), +(338,113,'2357AD2012CEBA72283F93460AC5FF55E4E5719A5AB9F5B9','drvsys_mon',0,0,'',NULL), +(339,178,'1C1595A1A64016D8725619CBC2FC7ABD41835320958A97FD','',676970,23,'',NULL), +(340,191,'DB5765A8B8D5F636D619E44669E9D3EF968BD8011C5D6999','',36907,24,'',NULL), +(341,191,'70B78734AC394D83D45427E0B7C88351E9BB108ED59C7E71','',37136,40,'',NULL), +(342,191,'85F2A5072D2D7557155CBF5157CAA460B19470DEE8AF96BB','',22792,25,'',NULL), +(343,243,'','',4609669,5,'8986100F00','Login Password Pointer'), +(344,191,'6C33FD80565B2860A76C87BB772E794E2FF444D813079A2F','',685656,44,'',NULL), +(345,178,'F09BEAD15FDEBD09240316D9E2E736028B54972B13F14E5E','',673194,23,'',NULL), +(346,191,'302E114D921D40EE54585BD9D63B9BDDFF7A2BD4D678DA97','',30044,16,'',NULL), +(347,178,'24807D7810C58A4B9A070A21B8AE50A0385DD4B4C6BD8B6F','',3049872,31,'',NULL), +(348,178,'B6BDECA858773B6F995AC6496923F5D0CBFDB1F76DB29C58','',198,12,'',NULL), +(349,243,'','',5296823,7,'75166824020000','Language patch (speak all)'), +(350,191,'C125EB3FD1B222ACE1B518959D96C5AC83EEAF109E9C6D20','',12194860,37,'',NULL), +(351,178,'8AFF28C3E6367B10340FB963B093AB52E61B267C541D5659','',2299108,33,'',NULL), +(352,191,'734D3EDDA69D9DD307032245FA0806456E2F02E90C2291E2','',36907,24,'',NULL), +(353,191,'9CB5A848D90B7FA4F58801ABD8A68EF8FDF8C602063C2CD6','',13033,36,'',NULL), +(354,178,'C8BCF785F8B7118D0270016E620E2C3DF6802E034471E5E4','',3033068,22,'',NULL), +(355,178,'8FB282098C8BB4EC10C8398E44C630677C6E2785227E31D3','',0,9,'',NULL), +(356,191,'2381BB2B613C58C364E962738335EBC2F3EFF81009DE49E4','',37180,24,'',NULL), +(357,191,'AA2A24A7C90D149C7817640B0D2D46C8A4B4D52146837605','',501956,48,'',NULL), +(358,191,'6815D749CCA8C1738A5F3236A737F0B70AE037E82D46033A','',448500,48,'',NULL), +(359,178,'F9F131F27BCC37FEF638FB8EDDAC29400652020C290D4F75','',676970,23,'',NULL), +(360,191,'319CBACC4CD2E1F54F8C8FC41EF44A3A9C492A652B00C622','',18700,32,'',NULL), +(361,178,'A4A7DB31BF51180F1ACFEA6C0E59AC84B43D022CB4BB817D','',2299116,33,'',NULL), +(362,191,'0DF639ED45B0C578DD616DD191014727A3C22C346E9FF73C','',50040,26,'',NULL), +(363,191,'72944B7FED63C1D2FC9D2CF6A07B5788731BE2B02215CEE4','',447736,48,'',NULL), +(364,191,'9148E18CF9213B25197C247F08CCA4C0DC60FEA73E3A247C','',13250,15,'',NULL), +(365,191,'ADA39A6A805BDF59271BBCE21734E8F28182164563CA15AA','',29916,16,'',NULL), +(366,191,'D5C852D85FA4393D027615506B7DEE07A1074AA4633019D8','',41023,24,'',NULL), +(367,191,'D06EE8DDC2115E5895E96D26A2A2F11FC566297D1D21BD26','',56063,25,'',NULL), +(368,191,'3AFE3B981D50B26FCAAC9DBE5A4BCB24F5BC3E9348AAA04B','',25724,20,'',NULL), +(369,191,'058E826BD75C26BACE712DF9D67B0A751896515802E9DDAE','',501956,48,'',NULL), +(370,178,'6E4C9CA0F7140E32D9284AF2E0EEB76419696771D4DDE887','',3634252,23,'',NULL), +(371,178,'29E43B1309ACB344AC777636BE838F0BFE6A04570B7FB09C','',700714,23,'',NULL), +(372,191,'5B7AC53977D57C5756A2F61582DD386EC93F5FE180FAB5DC','',27270,13,'',NULL), +(373,191,'22BF8D63A306178F368016E4657CCFCA5B2B21EBC90B8DB2','',50040,26,'',NULL), +(374,178,'1E8729EE000CD5BD8BABC49C368E0FF5AC08BC2B30921BC4','',709322,22,'',NULL), +(375,178,'8A1304B9AB2579F392F92D8A592308728EF76B26AE258A41','',4011280,23,'',NULL), +(376,178,'8A90AA547378BD5930D24FC415AEC08EF52E29B22073335F','',710730,23,'',NULL), +(377,113,'4BBF42A918109CC23F231B8E657076A213601AD681C032D1','HideEx',0,0,'',NULL), +(378,191,'06D9E92AE3953D13A0AC5FA31EC24B16C6A2260E2D32BF8E','',41096,24,'',NULL), +(379,178,'D4D3A9950FA07FAEDAD0658F9128007ADE282C043210A201','',683146,23,'',NULL), +(380,191,'94530FBCCC455105E8BB67E5B19BE0A4534A6F39A1201B52','',13291422,37,'',NULL), +(381,243,'','',4198410,6,'CCCCCCCCCCCC',NULL), +(382,178,'2313AF1E20F446936533F9440B220BEA966D9EB3A0502DCF','',178504,96,'',NULL), +(383,191,'F982BFDF01EB3BC6FFB70E897BFE21376232B2EEEFB25E58','',20512,16,'',NULL), +(384,178,'26308A71C6F483CC7795A01A2F2CF7E7EE97787C12CACC52','',2299108,33,'',NULL), +(385,113,'368334F9A3A549DFD3ABC9793E4EB83E837AA43F010354D1','ndis_x86',0,0,'',NULL), +(386,113,'5DA702DF95570780875ADB4C64259E887CE0A867D9B67711','Afd32uu',0,0,'',NULL), +(387,191,'B51E8DA25AAE556552404F5172642D0808A89E2AFE870B23','',694376,44,'',NULL), +(388,191,'4748EAC0350B1B56D8549157AAAAF4FF35438078A7E37AB5','',34176,25,'',NULL), +(389,191,'FBE20B03C75572D992273F192CE72CE78A65E6764BF8E6F6','',36907,24,'',NULL), +(390,191,'D8C1B9DEF3CA9CA59C5B827F055729B636FD55BA6242F9F0','',694376,44,'',NULL), +(391,191,'448475EBCA685E5A4ECC5F810740C9181825B49613CDDDA8','',477928,60,'',NULL), +(392,191,'2AF2DEE0CA5F307895E5773A083AEB862EA3D5210E037F06','',41080,24,'',NULL), +(393,178,'1708C050FF0C98DE59FE8F070273D80F9C1A612D336AB9FC','',3049452,22,'',NULL), +(394,178,'ED6BB184C9DD307229A023C1905E6EE73981D3E088D69FE6','',676970,23,'',NULL), +(395,191,'EB63A86D51668323A18AE2F8CE2BDD1ADAE57375B5F76C6B','',45223,24,'',NULL), +(396,178,'5837373EE8D4CCB5687045C04A4297450ACDE774FE973917','',673194,23,'',NULL), +(397,191,'65CCA5E079D38DCF32053D8DEE6C5ECF88E6AD8E1CF5379B','',31924,23,'',NULL), +(398,178,'FB895125A69DE5DB112B4731F6216668EB09C4F57943D85A','',706314,23,'',NULL), +(399,191,'A388E8CE523DB7C3C501AC5DB2C8AAE58FD1831E75665C48','',401992,14,'',NULL), +(400,178,'77C74B5E4CBCA9150FB64261E497AC4E7642A316C89B291A','',3045356,22,'',NULL), +(401,178,'8A2C4F7F3367A4648744D8964BB9A6833182ECABFE015B00','',3022016,31,'',NULL), +(402,243,'','',4609675,5,'5E5DC20800','Loggin Result'), +(403,191,'E8A24A78E6A716734CC666B48263B424804A42155C0BDB51','',18700,32,'',NULL), +(404,191,'3C881D2F0634D9223A36DF5266A7CF36B503DCF424441FA5','',28928,17,'',NULL), +(405,191,'7B3D92577810CAB5DA0134FDDA91CE6F36003C5373526774','',41023,24,'',NULL), +(406,178,'7F794E0811DA99DABA76CD9925B3E78045425E32880F05D3','',672746,23,'',NULL), +(407,178,'08235E08E4F83DDEA588D9FE32BD084FB26BDA6DEBB1E416','',668874,23,'',NULL), +(408,191,'5EF7C22867612F48FE5B41E219A1CA389AE8D32D8F0FC46B','',21660,15,'',NULL), +(409,178,'C7C78789911D6B30FA6E67198EF03B73CEE37576AEBFF5EA','',3045356,22,'',NULL), +(410,178,'62BF4E6440FE3F28138094B46FB469CDEB35008DEB652B8B','',3045776,31,'',NULL), +(411,191,'E24027620A1723C203E8084AD6269A852CD50D6F79D50530','',36544,55,'',NULL), +(412,113,'49CA50FCF2699AE5F4A867156A5D8053C4239B36DACE170C','HideEx',0,0,'',NULL), +(413,191,'073F4A76F248FE7C38F799437D475B9A2E9E81FA08B0C6BB','',17666,11,'',NULL), +(414,178,'6ECA7966F2845B9B61C6D9356E4FE4C913FE917808C8AFFE','',684876,29,'',NULL), +(415,178,'30BA488B3964465B142E75F6D1E1BA42DC9F489C3AC70BDA','',2299092,33,'',NULL), +(416,178,'55492051D368975D444428D6218A7D731555ABF7C3391E7D','',3049888,31,'',NULL), +(417,191,'94E0CEC4F7BDE7844C4D4ACF62E5C96ECF1D11FC2169CF8E','',433168,48,'',NULL), +(418,191,'5003A599A1162170A30F1906C0AD5B16DC7041E72D28A4B4','',28956,17,'',NULL), +(419,178,'686F700B2223502053CAFDF9977D8774E905E76B8C960E7C','',3049492,22,'',NULL), +(420,191,'F5A776E794B34ABBF93CA93E9230B7224CA088AB741DCB57','',13291422,37,'',NULL), +(421,191,'4A67D56DDA6B0E7D9117CFDB17EC6572E68B9300609FFE3C','',28956,17,'',NULL), +(422,178,'1B695DF78AA0708221E0EC2F5A69AB7078ED8143B2EAD174','',668874,23,'',NULL), +(423,191,'7C8CD40E29AE999923CD8EAFC233E619C73885A0258A6E3D','',21826,11,'',NULL), +(424,191,'73407824E9064DF5F1161A204A272A9CD69026EB4DF1004A','',29916,16,'',NULL), +(425,191,'B21609972E46C9BC8C6A77A18161A77D0C1D4001DC892DF1','',41080,24,'',NULL), +(426,191,'BB66A6AC45D02568067987834ECD8BF0A2BD0DAD06D12753','',17762,11,'',NULL), +(427,191,'2550EB7C358B7FB86FAF0EACDDC3111118769F448D93BF7A','',49347,24,'',NULL), +(428,178,'B6E4EF9350CA859576DB74D02C115D5A19C79AA58B0F6681','',684876,29,'',NULL), +(429,191,'451D2C8FF751743B52109FF5D95ED633DDBD8BCDB80EB7A9','',17906,11,'',NULL), +(430,191,'4A0161A4E5D50F11F58E1B23B281ABDA106625E3DC5A179C','',685304,44,'',NULL), +(431,178,'E4F21910D4B5D3E7B5461ED384889F6D0969645AE83F7601','',3037164,22,'',NULL), +(432,113,'B9756E3E1093B54511AC5A7B85711E53CEBEA373EF4866EE','Afde32uu',0,0,'',NULL), +(433,178,'A5AD6C8506004101E42165CD95051A7B5F13FBADD027461B','',710730,23,'',NULL), +(434,178,'B8AE30A02C59219D144EE95228C6CC9F99916F6FE423C940','',700714,23,'',NULL), +(435,178,'DAFD84BA8F977F5CFEEC9310C0EEF8F949F8EB6B827EBE71','',3990720,23,'',NULL), +(436,191,'B42986974893A82D73CC497B3252E9B844A11A99ACF46BEA','',41188,24,'',NULL), +(437,243,'','',11287980,8,'04000000903C9F00','Parental Controls related'), +(438,191,'0DC0953AE42E913121092DF17BC2BEE8BE133D1C53C8BFFD','',17762,11,'',NULL), +(439,178,'72C81E9BA425C54DE57BF4B7745D9C8D6B44D56E8FE933BA','',3049888,31,'',NULL), +(440,191,'100426CD22E80090502AA7A087B094B49ACFF4E7A09773ED','',30044,16,'',NULL), +(441,178,'46C797D1E60CC458E6C9D874650B996D10FC52641C2E7AA7','',676970,23,'',NULL), +(442,178,'DEA2C8A5775AA8CA86B8241BD418979D10DF4587E8E95C87','',250,11,'',NULL), +(443,113,'8807783067F9FF2697A61DEE925760682EB894C6F0A798AE','Afd32uu',0,0,'',NULL), +(444,178,'F63823A1F60619FDE6B4D6F3915EFB03EC03DEBEC82AFB9E','',673210,23,'',NULL), +(445,191,'E4DFD66163F2A65ECDD2EE9CA8062D707CC51882336F6483','',130380,14,'',NULL), +(446,178,'88182C96807A6025E628C90CE436C9EC54EC5FEC858A12B2','',690106,23,'',NULL), +(447,178,'EC322863C90B861E66A0008554BB8702EA92E1406F6F1711','',3070052,22,'',NULL), +(448,178,'9C851C7C05E54E5514E7BE038ABC5C669A3F5747EC573333','',3022016,31,'',NULL), +(449,178,'46D70E5C13F6D16BDD01A7481D9AFA51B73202070CA5D712','',673210,23,'',NULL), +(450,178,'CBEBB5F6F4EFB1324D17AB6CB48C573B639A37EAFD6299B4','',683146,23,'',NULL), +(451,191,'684575AAC0D8BC30D5325D56D3D522380E85ABFF380FA80F','',17938,11,'',NULL), +(452,178,'952BC8983C2CAEB6239BB2774F176A7F87A9F2DC10261205','',3045356,22,'',NULL), +(453,191,'4EAE0459E341062DB99658136D494BD79511B883F00BCE6A','',57602,42,'',NULL), +(454,178,'67E6E0A4006561DC5A67026886D1FF37AD14C5AA1AEA3CAD','',149,5,'',NULL), +(455,191,'222FE6B0A70CE2CEE633597E018706B3F78C338D96F6D9DC','',38300,21,'',NULL), +(456,113,'79747D68A5D6CD203671EF43029F17591E42BBCDB60B8B93','IPSect',0,0,'',NULL), +(457,178,'77ECC7613D44E56210F7CCDD6046226B41C8F087E901C94D','',682394,23,'',NULL), +(458,191,'77A59932BC8D497D992A213256ABD52C4D5F4FFB8A06002E','',49564,24,'',NULL), +(459,113,'2D14DD3BC859535580D8D9DC3BE7D59865A4E3FD112598A5','drvsys_mon',0,0,'',NULL), +(460,178,'9B487CD5032D00424A24FF3185AC4C17246729ECCE431951','',3049872,31,'',NULL), +(461,191,'978D8D1F3E1EF11CEBC4B65B13F1C5CE6E9E220E71B255B9','',13033,36,'',NULL), +(462,191,'1F5AD2397EB3CA814C5D156C6777C040F5D73085F3751C35','',433168,48,'',NULL), +(463,178,'912807952F9397C8F2B718C9164424D720E4EFC681DA3099','',3045356,22,'',NULL), +(464,191,'095F1A232F56B3DDA3338B5DE2CA310E5CF0EC0B6F72E87F','',17890,11,'',NULL), +(465,178,'2A5E27A3EE36254F61795E168A98C055772F88CEA5CCD6F1','',3033068,22,'',NULL), +(466,178,'4319BA4F2139568E87BAAC5F7C95121DD98D710B1C901E2B','',718842,23,'',NULL), +(467,191,'74E55BA8CDEFB5BD54BF1C0B0D326721D756440BA33C3ECE','',27270,13,'',NULL), +(468,191,'ED9FED6EE63B6C5E35C9E4615AC444603F6BF1FBC669D8B5','',13033,36,'',NULL), +(469,191,'DF967A96C67C8D6CB1955D1CA06556F37EEFC88D26F1D684','',90202,13,'',NULL), +(470,191,'2BDB1F4509561B2F846AAE7A5354008215C1EF4BDD0EA1D1','',49347,24,'',NULL), +(471,178,'0F3B3F0934C1B1E32DC9F83F67308BF9CFCCEB0EFE10B2FA','',672602,23,'',NULL), +(472,178,'E89980FFE6987D22DF5379283F53DA8DC3B5CD4862BA22C4','',335122,23,'',NULL), +(473,191,'156B3F2929664A16C3DA2D47CE3050B3A1BC32F9C30E4776','',27270,13,'',NULL), +(474,191,'65B03F581DEAA68B6A07C679C6B620A2623FD83EB4C4978B','',28940,17,'',NULL), +(475,178,'044C63CB9F480E28E02D68426C1F3D69BD146B39A7F081B5','',0,9,'',NULL), +(476,178,'B3BC7201BF77B362B943C8C13F9E70A751906F304F9AE133','',673210,23,'',NULL), +(477,191,'4783BF04A6BD423D63CD955407780BE0E15A70BC2643F853','',28928,17,'',NULL), +(478,178,'A71B471FFB4C58A2C99FC6818DD0269C4AE4C5686D5FDA87','',690106,23,'',NULL), +(479,191,'3EA0347F1F7D9BC9CAE387816DFBE4F492F53533400315B4','',17762,11,'',NULL), +(480,178,'AA5ADEE929B0B2FB655080B35D19607695F611672E6AD364','',3045616,31,'',NULL), +(481,191,'2DAAB5C524CA576967A7B0B713C1C34DA8EBF3990A86730C','',28704,16,'',NULL), +(482,191,'D0042CAE82A7121F7783A1382F542074B34ABFDF50A1B13A','',22792,25,'',NULL), +(483,191,'4D30286AD524AB2EB05C1A361A81036F787B1C0ACA36DD74','',30012,16,'',NULL), +(484,191,'03F9E0F9328E7C7025C0D5C59585700F19E29E8C8F9BF5B4','',49564,24,'',NULL), +(485,191,'430C4F44FD7CDF1A51F7A8FA5852ECCDA6CFA92C2A6ACB3A','',28920,23,'',NULL), +(486,178,'A2886E2080C54F25867AEDACDADD8F5175545F44512A3B58','',672746,23,'',NULL), +(487,178,'8438939BFCD0C550664ADE2DD75DD15FA23DC435EB5FC011','',3638348,23,'',NULL), +(488,191,'66480AAA84C5C00B64EEABE96DD21EB3773228B144E25D0E','',20512,16,'',NULL), +(489,191,'76C1B0FAC29E4E41FC6DAC31A0592CB0087BCE0D052904FE','',61874,42,'',NULL), +(490,191,'DA219765DA22ABBDBE5486CF7DB01C283FBF9986732C9A91','',37180,24,'',NULL), +(491,178,'F58BFE40291DD85F45C47E0E255594382DE0180AAE1F1FC9','',149,5,'',NULL), +(492,178,'8D8A305C43A3DD47DE550F256BD5F4B1753EDCC079AF279E','',3070052,22,'',NULL), +(493,191,'69CA60928A9A85D79ED39596C018DF899BD14C6219EFE088','',41080,24,'',NULL), +(494,191,'8D9AA947B904C003D06ACDF4EA0C84104612B274696999C4','',17890,11,'',NULL), +(495,178,'289CBF469FC750449980BFC2CA6AD7E42A69E14595D140A3','',209352,75,'',NULL), +(496,178,'49961CDE71B612E5432EAB389E7AD193476E05BB2778B751','',700714,23,'',NULL), +(497,178,'43818F9575A04BF426F4BE167052859015CC63622F7D4F3A','',672746,23,'',NULL), +(498,191,'7828B55FDE24719EC377E29FAE55BA6324020D00CD42A99D','',360508,13,'',NULL), +(499,178,'5432916108AFDFA313B6D88C886D87B5722E43EEBCAFC627','',0,8,'',NULL), +(500,191,'106F24060B7A4FC87A7971A4B0EFC1021F7181A09598C336','',17906,11,'',NULL), +(501,191,'13AA99805639421566A2652F0A7104939EA52EF0F77CFB03','',24812,14,'',NULL), +(502,178,'D0938B578EC70162A30A25571CD5DC7E765780F6191EAE1B','',710730,23,'',NULL), +(503,178,'70FA2C3749960F1B0D881FDB186DB9992D6EFD30C6674104','',580768,52,'',NULL), +(504,191,'BCA2CC6F5740DEF5D01D314146879036A5B6965C01424B0C','',45223,24,'',NULL), +(505,178,'47DD279576A64BCB3A4AF23D55895600C73BB5C214B70AEF','',3049452,22,'',NULL), +(506,178,'09C9B53C215456866BF764553A7B7E4F1F20F33A8D2CB613','',3638348,23,'',NULL), +(507,178,'3EC2D3876D82F424718D3B8E0B87562244C3F5A11A29F0E8','',682394,23,'',NULL), +(508,191,'7B4E9BBDC89694CCAE5BA6996D4240EB2E0C9C7F03CC5D40','',59620,13,'',NULL), +(509,178,'E2333772B05ABC620076EB66CFBB4AFE2313CCB6D719399F','',3065956,22,'',NULL), +(510,178,'2EB4C04C0946264F5BC8EFBAA832CA97381A8A6523BAB093','',178504,96,'',NULL), +(511,178,'0E3DE8374276C08D5DD241ABA2AC0AC1D2319F5CD22AAB52','',2303444,33,'',NULL), +(512,178,'FDB8DF478DADD2E36619D63D04D106EDB86EBF8FB9EC8CB4','',3000288,31,'',NULL), +(513,191,'BA76761FA5F569497047C3484FBC6FDDD8AFA71B96FE93C8','',24812,14,'',NULL), +(514,191,'2496E15413F7008A01FA53AC109C01E45B80BF2C3BC2F205','',56063,25,'',NULL), +(515,191,'CACB6383E8613E41489D93D7FE7235BE61214F9AE0825F44','',13291422,37,'',NULL), +(516,178,'931C403D2562AEE58EEB2586D73D51323A3A739860290AA6','',690106,23,'',NULL), +(517,191,'1A95AFB270B9C0D170E7280816891492C21E87D92E9EA6E5','',433168,48,'',NULL), +(518,191,'7483929857AE7A16C2D9EB0857EB1D5E9477479C2EEF0B5C','',37180,24,'',NULL), +(519,113,'379E1F6905F203E1026DB54A58AF588EF5726D9F50FCF369','Afde32uu',0,0,'',NULL), +(520,113,'08394625CCD77F36897EF283FAA0C019EE9F36775182584F','Afd32uu',0,0,'',NULL), +(521,191,'D9ADFC0283E75A86A3E1672BF50F5D1AD8E8466AE7086437','',27270,13,'',NULL), +(522,178,'D37F6219417C0E5196D3A4473D57ED767E6D9B49BB2B9555','',0,9,'',NULL), +(523,191,'93AAFBD4B8B50D6AE72F3BA7002D76791942D0EC0E61253A','',41127,24,'',NULL), +(524,191,'F9B132A5E1FFF379EC7175C12A58683C85272CC96E03E161','',41023,24,'',NULL), +(525,178,'1867D3CEC9379D1E6B8A1B9B667BDB1B6084B02ED9A60864','',3037164,22,'',NULL), +(526,178,'86548378A25632100F7E6E872ECF4D591B7542D977B623AE','',3049452,22,'',NULL), +(527,191,'9E00F6F9AF1D63FA2628E60B7BF2B1D63EFDD42D69929A73','',41080,24,'',NULL), +(528,178,'7DDD4CF1352822A1F9D19775498EE865FABB26C69F8FDEFE','',209352,75,'',NULL), +(529,191,'3D793384AD147BDDE98743EBE1E943263EFD6CAD542E2757','',17522,15,'',NULL), +(530,191,'9014AFDE93FDAC6C20971BEE76898FBB300A744CCBC24DA1','',28956,12,'',NULL), +(531,178,'D1212D7155D2C3114DA596070139C0B3610597CA0CE1CB17','',149,5,'',NULL), +(532,178,'BE18517661568A9D7F3CC9548592867F3A987A705866F60F','',3049888,31,'',NULL), +(533,191,'5D833D8DF05A7AF50DF945F5AF6880D325AC52B3ABC815AF','',41188,24,'',NULL), +(534,178,'1AA3B0D9AD368562F181E4E5D498652B3859210C126824D8','',672602,23,'',NULL), +(535,191,'331E027A700CAFDBEAC9E80B68B8304D0895D52947447448','',501956,48,'',NULL), +(536,191,'8E704337CE9F823A8A93947130ED1EE14A99F2EDB5458B94','',12194860,37,'',NULL), +(537,178,'BB1C818F79DB2F1FF71B7CB181021EB4F425311D09DAAE81','',0,9,'',NULL), +(538,178,'F1AD484D3F189A08EBF420C235D16ECAF1B485092FB063D6','',3045776,31,'',NULL), +(539,191,'1CF7028BE4D68B7AC6BB8061BECBFF402860541D04C90C0C','',17906,11,'',NULL), +(540,191,'2550D8249054E57086D4F4CF80396C686A71673C070711DA','',17890,11,'',NULL), +(541,191,'E864BD00AEB4F3D18CFFA7AADEAC7926A9A1E3EA7588F17A','',29884,20,'',NULL), +(542,191,'9E70338B4C8C845F8514925463DB624FC4423F9C467F5E62','',685304,44,'',NULL), +(543,178,'FC5EF49EDEE7A5268395298071BBA270822547A7416AEFB1','',3634252,23,'',NULL), +(544,191,'8282F57B7C3CD9B449B6363D5C9E792C2044EA2C3F381F9F','',17282,15,'',NULL), +(545,191,'B793EEE20E44B2942C6522F79343C58738A1A8489A381FB0','',24812,14,'',NULL), +(546,191,'6178EE9E575927A3505835AC88DA31BE15F0622DA55B31EB','',28956,12,'',NULL), +(547,178,'7BFD2D88793D6AB1A2351A3E8873B1E20CF44BF6563A0930','',3049888,31,'',NULL), +(548,191,'4102F13984A4E146C134D3F607AE7CA1B3263A22B52308C6','',447736,48,'',NULL), +(549,178,'EA1C4CA2A64548757BC2ED1C5BB6D2B5094AAD5B5C331F7D','',683146,23,'',NULL), +(550,178,'BEB42A9DB2B656B2DFF3DD7D1B8D87033F1D99A019CD4BB5','',3045632,31,'',NULL), +(551,191,'4E209437251EBB0CF31CF8A7CCF2C873A4D759B9563D573E','',34176,25,'',NULL), +(552,191,'85EB9C8A36B32287F096CF73F7FAE8B57405321342E9B779','',17666,11,'',NULL), +(553,191,'2EDE42629DD4A72669FFC9BBFBE15F357BF241853DBF7B2E','',27270,13,'',NULL), +(554,191,'FF47A1D9514F4DD81BDA23FC9018F03D894F9096E26EF809','',18680,35,'',NULL), +(555,191,'65185BBCA1D9995EA4B796E908B9F78923FDAE2D0C2500BC','',594348,26,'',NULL), +(556,191,'BD55E51B55A8FAB82CBF45012D761B1BEEE9BC0DAD8A83CD','',28920,17,'',NULL), +(557,178,'AACC3E694ACD478B1F99714734B5A43BD7D7A2A3565ED9B2','',3049492,22,'',NULL), +(558,191,'F3C07663325C5358F58A547725FBDF8DEF591021CD94513D','',685304,44,'',NULL), +(559,191,'503B5AB938616DE7672103919957B421FA8B6C98F72375F6','',20512,16,'',NULL), +(560,191,'3B6EFA3FF9443BEF4CBD2E7CAE08DA1753C79E5EDFA8510F','',37136,40,'',NULL), +(561,191,'3E5D1B5BBAD191442388FBD5236F5406CB2CA68EDF986328','',17666,11,'',NULL), +(562,178,'D8AB51DCC7840369846821B2A6B229CBA2E42C0CA566792D','',0,9,'',NULL), +(563,178,'F8004FA24C4925FAA3ED4993B0D457C5E4C5371915BB93D0','',3037164,22,'',NULL), +(564,178,'EAF4A696D564F6BC800BF0F6D732E4E92B50133DE02EE8C4','',0,9,'',NULL), +(565,191,'30BDC2BC3E4A2055426FA0EC67DBDEB7705C58047EFFA4D6','',61874,42,'',NULL), +(566,191,'3C8BCED97B2F9E5A52587E725004E136DED2B53AB2DB9D4F','',20512,16,'',NULL), +(567,178,'0B586F15A8CFD6B7A96632FF2B48D0F71E9D06BFAC174002','',3049888,31,'',NULL), +(568,191,'B2B3043BF9CDF3DB535D52ABC45BE586E6B8097B58D82C45','',17890,11,'',NULL), +(569,191,'9ED22064CDACF86DAC8C365C325EE428A87B628D137E038E','',28920,17,'',NULL), +(570,178,'2254B046D6D8D1A47E5F9275474B5EEE7A96CD99E8D952E9','',682378,23,'',NULL), +(571,113,'0A268B6DB28320A1956B54C36C61C625B02A48A4768A0823','Afd32uu',0,0,'',NULL), +(572,191,'41B3450DB8D10C506A561C7B95354A7792286D837C08B437','',12194860,37,'',NULL), +(573,191,'5CEDF5982800D9C6D16F9D357AEA17BBBAABADC8F3A12EC6','',45223,24,'',NULL), +(574,178,'3399D1DE6156FDE8614333B6C4AB0F5B2354381AAB7AF818','',3049872,31,'',NULL), +(575,178,'31DA5322A7B1F1715CA35F0976C201122A76D46A719F0C28','',335122,23,'',NULL), +(576,178,'36172791F3ACC5EFD406A7AD6F5D218279B94D458BDD60C3','',700714,23,'',NULL), +(577,178,'C64DDA3E5D94BD0DEFEDDB867DD304177B554C5771CF4DEF','',682378,23,'',NULL), +(578,178,'701D57AFE1315795AFE1340C35E923FE69C36EFC670C0BA5','',0,9,'',NULL), +(579,191,'D55BBE3C196C2FE07829CC54717C0A2A27C13A38ED4CF582','',30012,16,'',NULL), +(580,178,'DAD3C22D23FAB30C9AA6796E19EAB23CB7DCCD639854C14F','',3045976,31,'',NULL), +(581,178,'B3EC9710B55079104420F126BA7257F8FD7DC39D46880E5B','',2299060,33,'',NULL), +(582,191,'7762CCDD012D51167BF42F775CC307238C35EA5DA55B999E','',41096,24,'',NULL), +(583,191,'CEB7B2C893B8410CA8716C77DB679AB860F7F0E86BCF2D8E','',12194860,37,'',NULL), +(584,113,'C584FF543FABE32DBA3206AB324CAFAD92497C4926BBF8B2','HideEx',0,0,'',NULL), +(585,178,'122B96C9AD3D43FA5EE82ADFA464904F304EB7FD4CB5622D','',2299108,33,'',NULL), +(586,178,'3EFBC5B273BFF42D9F704C74DC2381B8A0D50D61C2F1512E','',717898,23,'',NULL), +(587,178,'8C5824E4A6D16714A2BFB5FC9D0CBF4706B8A2170DA87D7B','',0,9,'',NULL), +(588,191,'402282B90E06579656CF454305C0B5A925C95FBF6A7CF265','',477928,60,'',NULL), +(589,191,'71B36C6D650EF0D049328643E5B12E73DF95B58B2F30D0DC','',17938,11,'',NULL), +(590,178,'7C49C303394E1493D897E802528CA8E558B6A7BFE8320F08','',3037164,22,'',NULL), +(591,178,'2C190F9E920AF2EF67DA4D06905C2A6A0A2BC63D0192BAC5','',3045632,31,'',NULL), +(592,191,'E59168C40E1A0C9F8896EA9E2D684988D81A522FFCDC51D5','',3766400,37,'',NULL), +(593,191,'3C825803D3ABF20A11495E54718A2D83A0B35FD7D741B5E1','',12905,36,'',NULL), +(594,191,'DCF32E3E1C5DF813DFB137A2D9B21D95B0AF66CC2AD0F245','',41023,24,'',NULL), +(595,178,'7B66BDB4A0A713A7B315888708B88F90CCF7313832CCE35E','',3045356,22,'',NULL), +(596,178,'FFAF20DD14D7018A4156F000D1455DF36966513EB76F93E7','',2299116,33,'',NULL), +(597,178,'0C59AA1F05D2D9D3C0C5ECF6A38D9FF57187A7A461DEE908','',717898,23,'',NULL), +(598,191,'913AA6D16EBE73143FA4B4EF89C786668C6E7DD0B936DD18','',90202,13,'',NULL), +(599,191,'A9F5CA81A547D8F8051928A287DD280F7FE835B2858CEED5','',20512,16,'',NULL), +(600,178,'16B4D8897AEED4732A47239CDC99603D2F505D0AD602847F','',673210,23,'',NULL), +(601,191,'23F29E10D55E8701A1A699A1C05CED4553676E9FBA5B51F5','',13634,11,'',NULL), +(602,178,'9A65A024256C0D7D677C9F24A9C16A48BEA9B03CCA016098','',3000288,31,'',NULL), +(603,191,'AA0004288ED58DE4324FA521F849807DB1EF33634C7FE8C3','',61874,42,'',NULL), +(604,191,'E400A401BD0376A0475F1216731F5EE0DDF42C9A4FA805D2','',59620,13,'',NULL), +(605,178,'FD434987A57E848192562B61CA0D67BDCEA2392514CDD0AF','',3000288,31,'',NULL), +(606,191,'88C140A6580061C775D9141887FABD3F20E574DC4C0C4BBB','',9977,32,'',NULL), +(607,178,'3623B441A5D414AFD6650C8B8623ECF3C3A9129E1F5A81C1','',672954,23,'',NULL), +(608,178,'393A06D430D287FEC1C02F9945C34BA2A7954241C6357909','',335122,23,'',NULL), +(609,191,'0955A3267A3E576B9BD823BB210E8200F37CCB0421BF208C','',685656,44,'',NULL), +(610,191,'1A00ED18B456ADC1A1F39A5DEF572250FB0CCAC8BECA9DD8','',477928,60,'',NULL), +(611,178,'370B9B6E3AA987595F986C5716BF9FFCF0369438D5DC5D11','',156,8,'',NULL), +(612,191,'E8E85DFE24D8D20852A37D702CDF029C3B1FA30B99CAA4BE','',447736,48,'',NULL), +(613,178,'FA24C5FEEAF4538DD4913F10C99F3F64380B7354EB318386','',3041472,31,'',NULL), +(614,191,'C6AD92AC13B340575AB5D0769A1A7EED47BC42A5968E67D6','',37136,40,'',NULL), +(615,191,'990EFFE367D44A29E82F62C57B6041A66F66C1D100B05639','',28956,12,'',NULL), +(616,191,'631E42C3B6ED8A22F5AFA903176A7EB011754F5ABF2081EF','',3766400,37,'',NULL), +(617,191,'D8AB4091C51177D7BBA7384EE12E0384A7EDB73E38D15920','',13291422,37,'',NULL), +(618,178,'54AAA1926869D259C427870A620AE0C24AFC9B472F424633','',3049888,31,'',NULL), +(619,191,'CC0E40919988E53DA0B447F0984A30D51CC42E9DB54A8F1F','',49564,24,'',NULL), +(620,191,'396E7EC540DC2C74CD6709753CC627517E3A2DB8A1EF3633','',29916,16,'',NULL), +(621,191,'84A5A077180DFB9841E8DF4A4EC49EADE886D905768EE032','',57602,42,'',NULL), +(622,178,'072300C283F8DF72B3ED5F3CD8B7DF47574AECF7B21FBB59','',668874,23,'',NULL), +(623,191,'D4FC9A6022B7CFA81904503E43B813631D4735D80BC61868','',9977,32,'',NULL), +(624,178,'47B5A19B87234257CB6C1485AB2C0CB25513260F60094BEE','',3037164,22,'',NULL), +(625,191,'B8B6F4BA5FD45F0ABDCB060F72987987B6EF62B80C9E378F','',12194860,37,'',NULL), +(626,178,'261F2915266F20B7289A1560176F24198930C61540BEFA01','',3638348,23,'',NULL), +(627,191,'019A378006B0677C0B2F42C6CA882EC571D504E7D8F5B05B','',17282,15,'',NULL), +(628,178,'4E82DD9F04571D6DAB2FFCFCD638699D1D4C84917F720F32','',717898,23,'',NULL), +(629,178,'EAA75F6AE049552C55AFFDABB7268682428B1A9BF028C4D4','',673194,23,'',NULL), +(630,178,'F1431C669453FE0BD95430ECD8328EA0D3CD37BA658F094E','',198,12,'',NULL), +(631,178,'8AD8C581E8BAF7A2140211C4298A93E229493F272F4EFF4A','',3045912,31,'',NULL), +(632,191,'C154E3B6CE0B979BA98FEDAA1829DCCF2A7172642DEF9EFC','',37180,24,'',NULL), +(633,191,'295A29C81B1B9CC9B6758440BED913ED4D8B5E05A90D7CE7','',41023,24,'',NULL), +(634,178,'3ED9105E3D1F31AD1D4376C54B07D18348C56E7453D161B2','',690106,23,'',NULL), +(635,178,'74C75B8F0147ADA8610F6C9BB80C4BDA543C1D95943ADCEB','',0,8,'',NULL), +(636,191,'7BE7A7D3F4AD8B30A0A144D5D4AC5E569BB9A0D18AB590FC','',37180,24,'',NULL), +(637,191,'0B5C54A4850924038D95A3F1C44F300921CEA1E13644842E','',57602,42,'',NULL), +(638,191,'876743AA30D61C83444427F4F18203B2FF443C337E5DD190','',22792,25,'',NULL), +(639,191,'C83A14C21D1E66345574E3E0E3613E924F702883A30A1809','',31924,23,'',NULL), +(640,191,'2545F02B4FC2F5425960A2E5C0299936C99FF2EC68A5ECDB','',501956,48,'',NULL), +(641,191,'85EF9C6353712A8D0E2E27B1702B510A95B1305473F86345','',41023,24,'',NULL), +(642,191,'35282392AA86692A153FC159D6E13C74F9DF01661E4867D6','',13538,11,'',NULL), +(643,191,'0D6CC3008615CD5BFB96A90620805B78D5BFBC6100B1AF0D','',13538,15,'',NULL), +(644,191,'D573179188521C485CFD24A9EE9CDA77C540A31EE68E3E78','',41228,24,'',NULL), +(645,191,'8FA80694C3766FC1B041103EB35EBA3B7C77081A5DA8FFD8','',28940,17,'',NULL), +(646,113,'CD6B8F9D23612C807F7653D29F1F1C54BC8F917C5C5BD8F1','Afd32uu',0,0,'',NULL), +(647,178,'FCB5CF830DB536208D4C58E5838D1C8798F0738247EF0867','',672602,23,'',NULL), +(648,178,'4451680A3F41926C1545701887F93A0A49CC29C3E114AADB','',4011280,23,'',NULL), +(649,191,'6BE2C4F29ADF49AE5BF0485A27A854087E775FA28047168C','',27270,13,'',NULL), +(650,191,'016FF5D8685E37969B1B7C310756DCD93D4AB34256837031','',38300,21,'',NULL), +(651,191,'6726DA4A8F112CC25DD78500CA9BF792DB688F7D8D1FBC4B','',57602,42,'',NULL), +(652,191,'9F8B3A3C70027496420A619969CF1EB7AF447D245DA766A0','',29884,20,'',NULL), +(653,178,'E74FFC8ADF5FE8A0FE0F10BCABCFCEDB3B2B9C2307340D7C','',3041472,31,'',NULL), +(654,178,'B31302D6A47971059B2643B57D2D50EBEBEAA89BE483F1F4','',3037164,22,'',NULL), +(655,191,'2F761DEA3CD3394A0091D745FD2976B52F3B16BB0A48BC80','',29884,20,'',NULL), +(656,178,'8E44EC966A93870696359D3E2474D12C071A381B9403B1B9','',673210,23,'',NULL), +(657,191,'2424AFA7FEC48FF09E5E3BDAF93FAA74743A7551B6FB1495','',56063,25,'',NULL), +(658,178,'ACCF5804D419F30643F87A650C4DC6E0E10266922692AECE','',682378,23,'',NULL), +(659,191,'6EC19D6D1244E3FE787AE448EC905C509DBA3C01FBE34F24','',41280,16,'',NULL), +(660,178,'5B2D2EE40383C33D381998995210918AC6B1AD67C5880F6D','',710554,23,'',NULL), +(661,178,'83FFE0F8F224D5E56C38D731EFE8AD5AD1285B1AD4FA019B','',683146,23,'',NULL), +(662,191,'9D67A809FD8FDA1E1504F0C038E21E1D5FC4C6D11F426228','',28940,17,'',NULL), +(663,191,'2965EC092EC0A4B3D4A3C781F0A0A542824C77B7300BF50C','',45324,24,'',NULL), +(664,191,'FE31901F5558E6555DA6BC5B1BC3415E82CB97DECBB486BB','',41096,24,'',NULL), +(665,191,'B35406A77D6501A50F41981C7C137AD5272EB612F4A74109','',29884,20,'',NULL), +(666,178,'7275397E511B45264BCFA30E3A3F8101894AA3923D91BE6E','',3037164,22,'',NULL), +(667,178,'CA7D8D0E1F20385DCF6FC209799750CE9D0160B0C67196E7','',700714,23,'',NULL), +(668,191,'F5CCDA244D826B3180E7C49193B3B0B5DBF651EC67DCB47A','',594348,26,'',NULL), +(669,191,'7977F1E72B30179072EE1784396AB0406D06162051CA1EDB','',37136,40,'',NULL), +(670,178,'603F8A015D8436CCBCD68B26FF6006E7A81BA9A8D9524B1F','',3045356,22,'',NULL), +(671,178,'9631E9EBC78E0333010E522045852C7BEA44655080D418F3','',3049888,31,'',NULL), +(672,191,'43BE7C00605D9FECAEFAE38D8FFEAED78B8382563A245F10','',9977,32,'',NULL), +(673,191,'E493F1BAED1DBE7A0D429BF1A5D665636D29069060310BF0','',13291422,37,'',NULL), +(674,191,'6C53203FA95EBE4DBB0A7F3E85994058DECA069A5244C29E','',130380,14,'',NULL), +(675,178,'5A07E5A0525DBD5005CBDE16F7393EC8B795ADB2327C2F96','',3045356,22,'',NULL), +(676,178,'D7665366F333BD580C5F8E2FF8971294F69E99EC7E3623F3','',717898,23,'',NULL), +(677,191,'FB87EB8F178C69D9F7576AC7FF75D0479467057A2B6C956D','',9977,32,'',NULL), +(678,178,'292911AC98E7ED34DF021B562D5DEBE8DAA15570B552978B','',3000288,31,'',NULL), +(679,178,'6618F45C49D47C4105070C085FD5C384254A62E4AB614DB9','',3634252,23,'',NULL), +(680,191,'316E531545999AFC533814888434999501FEA8ABFBAF8655','',134968,32,'',NULL), +(681,191,'9945ED64886F68664A4BDF50731F4B4DC680273AB2E0DBCB','',20512,16,'',NULL), +(682,191,'1D4D6EC7B6B26553FC914D28BF9B62FD81D0B865DE606D97','',29884,20,'',NULL), +(683,178,'63B2D2ACF6E912CDC68282B080A2D610BE6AFE8EBB95FD31','',3070052,22,'',NULL), +(684,191,'B0955BAC042D5441496103E7C45E38609A9AE3799D534BD9','',18680,35,'',NULL), +(685,178,'6488E44D4E965581650F73F6E68DD8F863795162D99104F8','',682378,23,'',NULL), +(686,191,'CC0D3F7D8FCF928A55F92F6414F4AEF7AD75DED5819BF870','',13538,15,'',NULL), +(687,191,'CD3835965AF27EC338F828666CD06089B847B04A2DD56AE0','',17938,11,'',NULL), +(688,178,'D04E9CF6A03D4767AFF1E4EE0EFBC333AEBA5B0552F15957','',0,9,'',NULL), +(689,178,'120904F033D78A13DB0971F095C809852B7EB876D1A8AA01','',3045632,31,'',NULL), +(690,191,'7DDD19DCF77E27DF0A31BC21C7F716FF85076AF065F102DC','',36924,24,'',NULL), +(691,178,'5486E2CDD98AC3F25C223FD515CE7EF3FB09AC12ED338C86','',198,10,'',NULL), +(692,178,'F8D6423F01E5369D16F6F70180083B936F0DDE3737B23308','',2299092,33,'',NULL), +(693,191,'EC10CC349A8E654240B27B03EE1232B9CCED28F7104CCB71','',49347,24,'',NULL), +(694,178,'29E064ACC509206873A1D548F4816DB60D29D6EE9FF63A56','',682378,23,'',NULL), +(695,178,'E1A8A2A81920A7BA9F419A6D19CAC3DD9E292EF39F963234','',676970,23,'',NULL), +(696,191,'32393EB09F7C829F58612E5E47018F7203C43218C3506C79','',20512,16,'',NULL), +(697,178,'AFC4D19CACEDE8E9A2FDE3CC3D29CF8556AF4980872DFE1A','',3033068,22,'',NULL), +(698,178,'09A2B97FD351B1D339030233AC51C741E0ECDC21AA7A152B','',3049452,22,'',NULL), +(699,191,'2B2AF2171B8A9FC0D44EFE0ECDCB9DE1A55ACC8D83661E16','',41023,24,'',NULL), +(700,178,'D111B236DC42EB338870E72FF6EE3141714D0437864B02AE','',3045356,22,'',NULL), +(701,178,'E6DC6898929D1DA9F5768A9BFCBE848F8C1F31E8B6910FB8','',335122,23,'',NULL), +(702,113,'85A32F8B5F8430A086D27E62EB17D878E49CE815F6AC91CA','IPSect',0,0,'',NULL), +(703,191,'B6CB7B905A6BDD64BC032BE71927C1FE31153D14D6CF87E1','',447736,48,'',NULL), +(704,178,'40EE7F4EEE1D707ECB770CDBBB54730CB863CC8E268D4208','',3634252,23,'',NULL), +(705,178,'D74E308262D8C52ACE81B66F1D90C160AC86B2E0508176C1','',0,8,'',NULL), +(706,178,'E15287D29EE155299619F8E93E66B55B564FD921FA41CF50','',3049452,22,'',NULL), +(707,191,'58DFAEE44A52F0D5A58B0C94F0E5E63C1C7F76206D7FA7CA','',22792,25,'',NULL), +(708,191,'83705EAE8AAD9709494E52EB05AC0481C998C15730E61099','',30012,16,'',NULL), +(709,178,'0271F4D624304A48CB7CDFA016E3A735DCA3170FAD557468','',3070052,22,'',NULL), +(710,178,'217DFFE3C12F984992E1E0AE7B5864061572BA301B21D869','',178504,96,'',NULL), +(711,178,'C5C7AC33D1E4CF33E661033006BFEDE08523B643CCF51261','',3045356,22,'',NULL), +(712,243,'','',4618113,10,'FF1554F79D003B470C89','WS2_32.Send'), +(713,191,'D45144FC835266270E67CFB1F2900FD227B63204698A3EA7','',50040,26,'',NULL), +(714,191,'B5BB832AEEC591196864E08A392592C5789D76D3DDDD4DBF','',27270,13,'',NULL), +(715,191,'93582814E00150E2DD750ACAD7BD1719C4EBCD4C06F482AB','',28940,17,'',NULL), +(716,191,'FD6B6AC7FA5F2E7828CB1B429A9442383BD93E762A5D7D00','',31924,23,'',NULL), +(717,191,'51DF4EDECBBE42CC7C5D6723318F98E43E14A45F41CBD124','',41080,24,'',NULL), +(718,191,'F2B2260FDD23E5F268FAAE4D1A48E74C452F2AC5D114765D','',57602,42,'',NULL), +(719,191,'69FBDB69EC2E113EF691E47EDD46E40F03D1EBE226A1F7CE','',29884,20,'',NULL), +(720,178,'E3E431D8F8FB38F0F2586D0F50D809BCCEB13651C5EF2619','',682394,23,'',NULL), +(721,178,'2294015927F07D884FE2923FA17B3A8BCABC0A378930CF84','',679578,23,'',NULL), +(722,191,'0A022AB25C52F94404A01F96687B2D6E6BE774237254BD05','',20512,16,'',NULL), +(723,191,'65EEE243504EDC3319C3528B1A1E8061A3E75F4C25B61F95','',41228,24,'',NULL), +(724,178,'877C654036A29FC108FE8D69D416361732D7A0270E51189D','',3022016,31,'',NULL), +(725,178,'1A223564DF9E7BADD3CF858FB8250FE59F892232AC3B412D','',4011280,23,'',NULL), +(726,191,'4FEDF58FB4DE45289C97ACCF16EB2DEA6FBC85C74A52D3C9','',37180,24,'',NULL), +(727,191,'D4BE47EA1D68B92E2AD8307D139877705BE2B6A98B6A916E','',13033,36,'',NULL), +(728,191,'9658AC7EF426A52C327BBC1ED71C6FA6DC5940E35DCC18C7','',18680,35,'',NULL), +(729,113,'1B17998CD8E0CDA4D84B0A0F9DB05E536DACE0348A883D24','ndis_x86',0,0,'',NULL), +(730,178,'BB9B86ED12359A465B02387A1D727F11F78D35C8B7FCC2FC','',2299092,33,'',NULL), +(731,191,'842BC1A8C53902D26018B1C5E05ADCD70D973A968E298331','',50040,26,'',NULL), +(732,178,'3E894F9682573CC0AD54C7E9873C9026AC050929392D0B93','',3049452,22,'',NULL), +(733,191,'4A31E3D24FD6D576D84EF1BFB813D0F066870DEB38C32E47','',21826,11,'',NULL), +(734,191,'EEA122B4C066EC0B196F67511E633EBACB37C4EA6AE4BFF7','',41096,24,'',NULL), +(735,191,'66211671BEF80FB973B1C9595A70B462AD79EC83530DFE89','',12905,36,'',NULL), +(736,178,'3760BBD6FE99A0BBEE0AB61A8BD52A6ABCAC48FF3CB265B8','',3070052,22,'',NULL), +(737,191,'70F425426612D0D8495386C2375F7A4183548C0D4E7DFA46','',594348,26,'',NULL), +(738,178,'BB310E9DDE9259027123500E65F9FA1E8D9D0F5FE8381CD2','',3638348,23,'',NULL), +(739,191,'6FFB5E4982D306680E0C59087DA961CD4F6B068E323C3BB4','',401992,14,'',NULL), +(740,191,'6DDCA79B7460A1F3671532A28FDCEB331DE6CA550E3178D0','',3766400,37,'',NULL), +(741,191,'A8F7B2FB37CF3BEF43D6CE5C0BF85E85077E681490BA1C4C','',37136,40,'',NULL), +(742,191,'052F425E7528B3A7155C45EEE530F915DBB154E5C8876E25','',50040,26,'',NULL), +(743,178,'D6DE200B631AF71BFBC76202D82649942FD6ED9BC4A9EF75','',198,12,'',NULL), +(744,178,'61077261C66B2CF9B199F115A3A656EA6A00068F151E3656','',706314,23,'',NULL), +(745,191,'513FC0F0673A9DF86FA1FA05371040C14634CE08311ED619','',401992,14,'',NULL), +(746,191,'5E0970A6EB246A79DDF427CB76D0D921F971E13921DD5D2C','',134968,32,'',NULL), +(747,178,'53CAC3EF654610AC7E043C6AAD62709EF0B5400DBDE755EB','',149,5,'',NULL), +(748,178,'566637D06BAEA9190B7CE510C697F72CD20FE3D958A95A25','',3049888,31,'',NULL), +(749,113,'3C9B0CC7FE020EEBD43E6B1D88EDDF0EC46AC35974765068','drvsys_mon',0,0,'',NULL), +(750,191,'BDFEE5DCDD37FC5B2A1B3E42FBE5F7997CFED35E86062EB6','',28920,23,'',NULL), +(751,191,'7794AE60131E4D07860DB48047206784B885B30457EAB83E','',12194860,37,'',NULL), +(752,178,'653A308BB00D914AE1ECD773BA4B0BA7724874BC62647D10','',3037164,22,'',NULL), +(753,178,'06B696C35F905E75B451A02E121BDA0330CD44E0D9B872BF','',60648,56,'',NULL), +(754,191,'35E8CD9E8CBD879B1E53278926C634AA8B72B8D9A20009F9','',17522,15,'',NULL), +(755,191,'9B13F2E744904ADAAA062F9113A576D11C2C450D1CD6A4AB','',13033,36,'',NULL), +(756,191,'60851B4A6F7338632A84795FBBB20320E49AD2CC2034BA80','',28940,17,'',NULL), +(757,191,'3BC0BE02AE0B6975974D3B13B811EC6BDACBF9EE122BE633','',90202,13,'',NULL), +(758,191,'E47F7DD8D5B5C29B70AFFD4F25AA286167D411937F9BD247','',36907,24,'',NULL), +(759,178,'35D1CDEE86A410DF087DE6D5F5AC6289C4888B9753293E73','',3037164,22,'',NULL), +(760,191,'2ED2EEB29EE0D48477779E5CA875F1F5F15CCE74CA85BDAA','',28956,17,'',NULL), +(761,191,'A373FDB6A789CC46072A4CC51A429C817C40862DC6C0190F','',30012,16,'',NULL), +(762,178,'3D02551F548DFB58832626FE90A7AAA12824D93A54A0DC14','',709322,22,'',NULL), +(763,191,'09D04CF8ABC51D06D874784442987E5F2631041550607255','',36544,55,'',NULL), +(764,191,'F3CD473F8C85977895CA5BA9DC22185BCCBBF6B977205193','',448492,48,'',NULL), +(765,191,'30E2F23DB1038D16D2DEEAB1D0F1790D961E468368DC5108','',30012,16,'',NULL), +(766,191,'540D465F760320A63981289D30CD40CCC770EE126523C71D','',477912,60,'',NULL), +(767,191,'C461E1BE054FE29A1FD58B33D33890BC4A1279DE4F572B47','',37180,24,'',NULL), +(768,191,'1AC3D903CFCA11321E76A257BDA0608E5060030BE745CCF3','',130380,14,'',NULL), +(769,178,'96281A2887E61232007D7015E4A35DA118794841A8EC84BC','',3037164,22,'',NULL), +(770,178,'8A1AC926B46A9E3D60D3BD87A59FF77D7B80A1510BC327A7','',710730,23,'',NULL), +(771,191,'3620B6BDF3993B87FD35E906FE8376A04FF34684E2023D8E','',41280,16,'',NULL), +(772,191,'025C373F05EC6E809EF5A86A903570FDA14D219286BCED5E','',448492,48,'',NULL), +(773,178,'5C0E4EE98C4E34CBE44F6BD595C13DD675555164A8D491DA','',710554,23,'',NULL), +(774,191,'BECE667BF9443EF6515E8E154F74FC2C5817455C8636DB72','',501956,48,'',NULL), +(775,191,'94F1DA3E0D955761826D6BC932E26F44D321B4838C7567D8','',13538,15,'',NULL), +(776,191,'EA3A3AD71FD14B038C98F256E80C1EFA1F45562A3DF92E7D','',22792,25,'',NULL), +(777,191,'AD5A8CBF55EC436DA968EE0B9744C93F65D9E0D6E3C1B136','',174688,37,'',NULL), +(778,191,'9B6B3B311BA9007C06CF0D146BB979B11CF295C58768DD4F','',31924,23,'',NULL), +(779,217,'','RPE.DLL',0,0,'','rEdoX Packet Editor - injected dll'), +(780,243,'','',5345728,2,'558B','Lua Protection Remover'), +(781,243,'','',7726137,2,'7414','Walk on Water Patch'), +(782,243,'','',8016620,2,'7417','Collision M2 Special'), +(783,243,'','',8016079,6,'0F8462010000','Collision M2 Regular'), +(784,243,'','',8054762,2,'7506','Collision WMD'), +(785,243,'','',9995315,2,'7544','Multi-Jump Patch'), +(786,217,'','WPESPY.DLL',0,0,'','WPE PRO - injected dll'); diff --git a/sql/old/3.3.5a/2012_02_19_04_world_misc_db_updates.sql b/sql/old/3.3.5a/2012_02_19_04_world_misc_db_updates.sql new file mode 100644 index 00000000000..32fada1e895 --- /dev/null +++ b/sql/old/3.3.5a/2012_02_19_04_world_misc_db_updates.sql @@ -0,0 +1,21 @@ +-- Horde Orphan should not have weapons +UPDATE `creature_template` SET `equipment_id`=0 WHERE `entry`=14499; +-- Tog'thar Gossip +UPDATE `creature_template` SET `gossip_menu_id`=264 WHERE `entry`=2238; +DELETE FROM `gossip_menu` WHERE `entry`=264 AND `text_id`=761; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (264,761); +-- Cosmetic Silkwing should have InhabitType 4 +UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry`=21840; +-- Leoroxx +UPDATE `creature_template` SET `gossip_menu_id`=8511 WHERE `entry`=22004; +DELETE FROM `gossip_menu` WHERE `entry`=8511 AND `text_id`=10645; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (8511,10645); +-- Spiritcaller Dohgar +UPDATE `creature_template` SET `gossip_menu_id`=8513 WHERE `entry`=22312; +DELETE FROM `gossip_menu` WHERE `entry`=8513 AND `text_id`=10647; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (8513,10647); +-- Ogrin +UPDATE `creature_template` SET `gossip_menu_id`=9821 WHERE `entry`=22468; +-- Wanted Poster "Blade's Edge Mountains" +DELETE FROM `gossip_menu` WHERE `entry`=8242 AND `text_id`=10257; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (8242,10257); diff --git a/sql/old/3.3.5a/2012_02_19_05_world_creature_text.sql b/sql/old/3.3.5a/2012_02_19_05_world_creature_text.sql new file mode 100644 index 00000000000..b70385660a1 --- /dev/null +++ b/sql/old/3.3.5a/2012_02_19_05_world_creature_text.sql @@ -0,0 +1,7 @@ +-- NPC talk text from sniff +DELETE FROM `creature_text` WHERE `entry`=7604; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(7604,0,0, 'What? How dare you say that to me?!?',12,0,100,6,0,0, 'Sergeant Bly'), +(7604,1,0, 'After all we''ve been through? Well, I didn''t like you anyway!!',12,0,100,5,0,0, 'Sergeant Bly'); +-- Remove old text +DELETE FROM `script_texts` WHERE `entry` IN (-1209002,-1209003); diff --git a/sql/old/3.3.5a/2012_02_19_06_world_creature_text.sql b/sql/old/3.3.5a/2012_02_19_06_world_creature_text.sql new file mode 100644 index 00000000000..f69c4cb86a9 --- /dev/null +++ b/sql/old/3.3.5a/2012_02_19_06_world_creature_text.sql @@ -0,0 +1,20 @@ +-- SAI for Erich Lohan +SET @ENTRY=3627; +UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE (`entryorguid`=@ENTRY AND `source_type`=0); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,1,0,100,0,10000,15000,10000,15000,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Erich Lohan - OOC - Say random text'); +-- Talk text from sniff +DELETE FROM `creature_text` WHERE `entry`=3627; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(3627,0,0, 'Magical studies stressing your brain? Relax at the Blue Recluse!',12,7,100,0,0,0, 'Erich Lohan'), +(3627,0,1, 'Best drinks in Stormwind!',12,7,100,0,0,0, 'Erich Lohan'), +(3627,0,2, 'Come for the beer, stay for the atmosphere!',12,7,100,0,0,0, 'Erich Lohan'), +(3627,0,3, 'The only place in Stormwind where magic and spirits mix, come to the Blue Recluse!',12,7,100,0,0,0, 'Erich Lohan'), +(3627,0,4, 'Free drinks at the Blue Recluse!',12,7,100,0,0,0, 'Erich Lohan'), +(3627,0,5, 'Feeling blue? Come on down to the Blue Recluse for a good time!',12,7,100,0,0,0, 'Erich Lohan'), +(3627,0,6, 'Head on over to the Blue Recluse. Where everybody knows your name!',12,7,100,0,0,0, 'Erich Lohan'); +-- Remove old waypoint text +UPDATE `waypoint_data` SET `action`=0 WHERE `id`=904450; +DELETE FROM `waypoint_scripts` WHERE `id` BETWEEN 432 AND 446; +DELETE FROM `db_script_string` WHERE `entry` BETWEEN 2000005185 AND 2000005199; diff --git a/sql/old/3.3.5a/2012_02_20_00_world_sai.sql b/sql/old/3.3.5a/2012_02_20_00_world_sai.sql new file mode 100644 index 00000000000..44f8ab68d70 --- /dev/null +++ b/sql/old/3.3.5a/2012_02_20_00_world_sai.sql @@ -0,0 +1,4 @@ +UPDATE `smart_scripts` SET `event_param3`=2*60*60*1000, `event_param4`=2*60*60*1000 WHERE `entryorguid`=18481 AND `source_type`=0 AND `id`=0; +UPDATE `smart_scripts` SET `event_flags`=`event_flags`|1 WHERE `entryorguid` IN (-85175,-85176) AND `source_type`=0 AND `id`=5 AND `link`=6; +UPDATE `smart_scripts` SET `event_flags`=`event_flags`|1 WHERE `entryorguid`=30146 AND `source_type`=0 AND `id`=0; +UPDATE `smart_scripts` SET `event_flags`=`event_flags`|0x20 WHERE `entryorguid` IN (-85175,-85176) AND `source_type`=0 AND `id`=2 AND `link`=3; diff --git a/sql/old/3.3.5a/2012_02_20_01_world_gossip.sql b/sql/old/3.3.5a/2012_02_20_01_world_gossip.sql new file mode 100644 index 00000000000..f3943ded29a --- /dev/null +++ b/sql/old/3.3.5a/2012_02_20_01_world_gossip.sql @@ -0,0 +1,8 @@ +-- Fix error in Scourge Deathspeaker SAI +UPDATE `smart_scripts` SET `link`=0 WHERE `entryorguid`=27615 AND `id`=14; +-- Fix up Keeper Remulos SAI +UPDATE `smart_scripts` SET `id`=3 WHERE `entryorguid`=11832 AND `id`=4; +-- Spiritcaller Dohgar +UPDATE `creature_template` SET `gossip_menu_id`=8513 WHERE `entry`=22312; +DELETE FROM `gossip_menu` WHERE `entry`=8513 AND `text_id`=10647; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (8513,10647); diff --git a/sql/old/3.3.5a/2012_02_20_02_world_conditons.sql b/sql/old/3.3.5a/2012_02_20_02_world_conditons.sql new file mode 100644 index 00000000000..f87a95fb1c9 --- /dev/null +++ b/sql/old/3.3.5a/2012_02_20_02_world_conditons.sql @@ -0,0 +1,277 @@ +-- Update a typo in original data entry +UPDATE `npc_spellclick_spells` SET `quest_end`=11999 WHERE `npc_entry`=26477 AND `spell_id`=61832 AND `quest_start`=11999; + +-- Delete redundant data with invalid condition type +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=18; + +-- Static Data +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`, +`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`Comment`) VALUES +(18,24752,44363,0,8,0,11460,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,24752,44363,0,9,0,11460,0,0,0,'Required quest active for spellclick'), +(18,25596,45875,0,8,0,11690,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,25596,45875,0,9,0,11690,0,0,0,'Required quest active for spellclick'), +(18,25841,46166,0,8,0,11795,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,25841,46166,0,9,0,11795,0,0,0,'Required quest active for spellclick'), +(18,26200,39996,0,8,0,11960,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,26200,39996,0,9,0,11960,0,0,0,'Required quest active for spellclick'), +(18,26200,61286,0,8,0,11960,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,26200,61286,0,9,0,11960,0,0,0,'Required quest active for spellclick'), +(18,26421,47575,0,8,0,12092,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,26421,47575,0,8,0,12096,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,26421,47575,0,9,0,12092,0,0,0,'Required quest active for spellclick'), +(18,26421,47575,0,9,0,12096,0,0,0,'Required quest active for spellclick'), +(18,26477,47096,0,8,0,11999,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,26477,47096,0,8,0,12000,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,26477,47096,0,9,0,11999,0,0,0,'Required quest active for spellclick'), +(18,26477,47096,0,9,0,12000,0,0,0,'Required quest active for spellclick'), +(18,26477,61286,0,8,0,11999,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,26477,61286,0,8,0,12000,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,26477,61286,0,9,0,11999,0,0,0,'Required quest active for spellclick'), +(18,26477,61286,0,9,0,12000,0,0,0,'Required quest active for spellclick'), +(18,26477,61832,0,8,0,11999,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,26477,61832,0,8,0,12000,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,26477,61832,0,9,0,11999,0,0,0,'Required quest active for spellclick'), +(18,26477,61832,0,9,0,12000,0,0,0,'Required quest active for spellclick'), +(18,27061,47920,0,8,0,12050,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,27061,47920,0,9,0,12050,0,0,0,'Required quest active for spellclick'), +(18,27354,60944,18,8,0,12244,0,0,0,'Required quest rewarded for spellclick'), +(18,27354,60944,18,9,0,12244,0,0,0,'Required quest active for spellclick'), +(18,28161,39996,0,8,0,12532,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,28161,39996,0,8,0,12702,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,28161,39996,0,9,0,12532,0,0,0,'Required quest active for spellclick'), +(18,28161,39996,0,9,0,12702,0,0,0,'Required quest active for spellclick'), +(18,28161,51037,0,8,0,12532,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,28161,51037,0,8,0,12702,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,28161,51037,0,9,0,12532,0,0,0,'Required quest active for spellclick'), +(18,28161,51037,0,9,0,12702,0,0,0,'Required quest active for spellclick'), +(18,28161,51961,0,8,0,12532,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,28161,51961,0,8,0,12702,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,28161,51961,0,9,0,12532,0,0,0,'Required quest active for spellclick'), +(18,28161,51961,0,9,0,12702,0,0,0,'Required quest active for spellclick'), +(18,28162,39996,0,8,0,12519,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,28162,39996,0,9,0,12519,0,0,0,'Required quest active for spellclick'), +(18,28162,50737,0,8,0,12519,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,28162,50737,0,9,0,12519,0,0,0,'Required quest active for spellclick'), +(18,28162,51026,0,8,0,12519,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,28162,51026,0,9,0,12519,0,0,0,'Required quest active for spellclick'), +(18,28162,61286,0,8,0,12519,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,28162,61286,0,9,0,12519,0,0,0,'Required quest active for spellclick'), +(18,28202,50926,0,8,0,12527,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,28202,50926,0,9,0,12527,0,0,0,'Required quest active for spellclick'), +(18,28202,50927,0,8,0,12527,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,28202,50927,0,9,0,12527,0,0,0,'Required quest active for spellclick'), +(18,28203,50918,0,8,0,12527,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,28203,50918,0,9,0,12527,0,0,0,'Required quest active for spellclick'), +(18,28203,50919,0,8,0,12527,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,28203,50919,0,9,0,12527,0,0,0,'Required quest active for spellclick'), +(18,28222,52082,0,8,0,12546,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,28222,52082,0,9,0,12546,0,0,0,'Required quest active for spellclick'), +(18,28379,51658,0,8,0,12607,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,28379,51658,0,9,0,12607,0,0,0,'Required quest active for spellclick'), +(18,28389,51592,0,8,0,12605,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,28389,51592,0,9,0,12605,0,0,0,'Required quest active for spellclick'), +(18,28389,51593,0,8,0,12605,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,28389,51593,0,9,0,12605,0,0,0,'Required quest active for spellclick'), +(18,28782,52280,0,8,0,12687,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,28782,52280,0,9,0,12687,0,0,0,'Required quest active for spellclick'), +(18,29488,54568,15,8,0,12670,0,0,0,'Required quest rewarded for spellclick'), +(18,29488,54568,15,9,0,12670,0,0,0,'Required quest active for spellclick'), +(18,29563,56795,0,8,0,1,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,29598,54768,0,8,0,12856,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,29708,55028,0,8,0,12856,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,29708,55028,0,9,0,12856,0,0,0,'Required quest active for spellclick'), +(18,29856,55363,0,8,0,12629,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,29856,55363,0,8,0,12643,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,29856,55363,0,9,0,12629,0,0,0,'Required quest active for spellclick'), +(18,29856,55363,0,9,0,12643,0,0,0,'Required quest active for spellclick'), +(18,29857,55457,0,8,0,12910,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,29857,55457,0,9,0,12910,0,0,0,'Required quest active for spellclick'), +(18,30066,43977,0,8,0,12953,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,30337,43671,0,8,0,13069,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,30337,43671,0,9,0,13069,0,0,0,'Required quest active for spellclick'), +(18,30500,56679,0,8,0,13045,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,30500,56679,0,9,0,13045,0,0,0,'Required quest active for spellclick'), +(18,30560,57347,0,1,0,57348,0,0,1,'Forbidden aura for spellclick'), +(18,31736,59592,0,8,0,13280,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,31736,59592,0,9,0,13280,0,0,0,'Required quest active for spellclick'), +(18,31785,59656,0,8,0,13283,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,31785,59656,0,9,0,13283,0,0,0,'Required quest active for spellclick'), +(18,31883,60123,0,1,0,48085,0,0,1,'Forbidden aura for spellclick'), +(18,31893,60123,0,1,0,48084,0,0,1,'Forbidden aura for spellclick'), +(18,31894,60123,0,1,0,28276,0,0,1,'Forbidden aura for spellclick'), +(18,31895,60123,0,1,0,27874,0,0,1,'Forbidden aura for spellclick'), +(18,31896,60123,0,1,0,27873,0,0,1,'Forbidden aura for spellclick'), +(18,31897,60123,0,1,0,7001,0,0,1,'Forbidden aura for spellclick'), +(18,32788,57539,17,8,0,13075,0,0,0,'Required quest rewarded for spellclick'), +(18,32788,57539,17,9,0,13075,0,0,0,'Required quest active for spellclick'), +(18,32790,57654,16,8,0,13073,0,0,0,'Required quest rewarded for spellclick'), +(18,32790,57654,16,9,0,13073,0,0,0,'Required quest active for spellclick'), +(18,33498,63126,0,8,0,13654,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,33498,63126,0,9,0,13654,0,0,0,'Required quest active for spellclick'), +(18,33790,62781,0,8,0,13690,0,0,0,'Required quest rewarded for spellclick'), +(18,33790,62781,0,8,0,13705,0,0,0,'Required quest rewarded for spellclick'), +(18,33791,62786,0,8,0,13696,0,0,0,'Required quest rewarded for spellclick'), +(18,33791,62786,0,8,0,13711,0,0,0,'Required quest rewarded for spellclick'), +(18,33792,62785,0,8,0,13694,0,0,0,'Required quest rewarded for spellclick'), +(18,33792,62785,0,8,0,13709,0,0,0,'Required quest rewarded for spellclick'), +(18,33793,62780,0,8,0,13688,0,0,0,'Required quest rewarded for spellclick'), +(18,33793,62780,0,8,0,13704,0,0,0,'Required quest rewarded for spellclick'), +(18,33794,62782,0,8,0,13689,0,0,0,'Required quest rewarded for spellclick'), +(18,33794,62782,0,8,0,13706,0,0,0,'Required quest rewarded for spellclick'), +(18,33795,62779,0,8,0,13685,0,0,0,'Required quest rewarded for spellclick'), +(18,33795,62779,0,8,0,13703,0,0,0,'Required quest rewarded for spellclick'), +(18,33796,62784,0,8,0,13693,0,0,0,'Required quest rewarded for spellclick'), +(18,33796,62784,0,8,0,13708,0,0,0,'Required quest rewarded for spellclick'), +(18,33798,62787,0,8,0,13695,0,0,0,'Required quest rewarded for spellclick'), +(18,33798,62787,0,8,0,13710,0,0,0,'Required quest rewarded for spellclick'), +(18,33799,62783,0,8,0,13691,0,0,0,'Required quest rewarded for spellclick'), +(18,33799,62783,0,8,0,13707,0,0,0,'Required quest rewarded for spellclick'), +(18,33800,62774,0,8,0,13593,0,0,0,'Required quest rewarded for spellclick'), +(18,33800,62774,0,8,0,13684,0,0,0,'Required quest rewarded for spellclick'), +(18,33842,63791,0,8,0,13668,0,0,0,'Required quest rewarded for spellclick'), +(18,33842,63791,0,8,0,13687,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,33843,63792,0,8,0,13667,0,0,0,'Required quest rewarded for spellclick'), +(18,33843,63792,0,8,0,13686,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,33870,63663,0,8,0,1,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,34125,63215,0,8,0,13847,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,34125,63215,0,8,0,13851,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,34125,63215,0,8,0,13852,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,34125,63215,0,8,0,13854,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,34125,63215,0,8,0,13855,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,34125,63215,0,8,0,13856,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,34125,63215,0,8,0,13857,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,34125,63215,0,8,0,13858,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,34125,63215,0,8,0,13859,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,34125,63215,0,8,0,13860,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,34125,63215,0,8,0,13861,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,34125,63215,0,8,0,13862,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,34125,63215,0,8,0,13863,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,34125,63215,0,8,0,13864,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,34125,63215,0,9,0,13847,0,0,0,'Required quest active for spellclick'), +(18,34125,63215,0,9,0,13851,0,0,0,'Required quest active for spellclick'), +(18,34125,63215,0,9,0,13852,0,0,0,'Required quest active for spellclick'), +(18,34125,63215,0,9,0,13854,0,0,0,'Required quest active for spellclick'), +(18,34125,63215,0,9,0,13855,0,0,0,'Required quest active for spellclick'), +(18,34125,63215,0,9,0,13856,0,0,0,'Required quest active for spellclick'), +(18,34125,63215,0,9,0,13857,0,0,0,'Required quest active for spellclick'), +(18,34125,63215,0,9,0,13858,0,0,0,'Required quest active for spellclick'), +(18,34125,63215,0,9,0,13859,0,0,0,'Required quest active for spellclick'), +(18,34125,63215,0,9,0,13860,0,0,0,'Required quest active for spellclick'), +(18,34125,63215,0,9,0,13861,0,0,0,'Required quest active for spellclick'), +(18,34125,63215,0,9,0,13862,0,0,0,'Required quest active for spellclick'), +(18,34125,63215,0,9,0,13863,0,0,0,'Required quest active for spellclick'), +(18,34125,63215,0,9,0,13864,0,0,0,'Required quest active for spellclick'), +(18,38248,71462,0,1,0,71443,0,0,1,'Forbidden aura for spellclick'), +(18,40176,74904,0,8,0,25444,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,40176,74904,0,9,0,25444,0,0,0,'Required quest active for spellclick'), +(18,40176,74905,0,8,0,25444,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,40176,74905,0,9,0,25444,0,0,0,'Required quest active for spellclick'); + +-- Below is a procedure to dynamically convert custom content to conditions table. +-- However this procedure only works for MySQL server versions >= 5.6 due to +-- a bug / missing feature in older MySQL versions. + +/* + +DROP PROCEDURE IF EXISTS ConvertSpellClickConditions; +DELIMITER // +CREATE PROCEDURE ConvertSpellClickConditions() +BEGIN + DECLARE counter INT DEFAULT 0; + DECLARE recordCount INT DEFAULT 0; + DECLARE counterPlusOne INT DEFAULT 0; + DECLARE npcEntry INT DEFAULT 0; + DECLARE spellId INT DEFAULT 0; + DECLARE aura INT DEFAULT 0; + DECLARE quest INT DEFAULT 0; + DECLARE quest2 INT DEFAULT 0; + DECLARE questStartCanActive INT DEFAULT 0; + DECLARE maxElseGroupId INT DEFAULT 14; -- Change this for custom content + SELECT COUNT(*) INTO recordCount FROM `npc_spellclick_spells` WHERE `aura_required` !=0; + WHILE counter < recordCount DO + SELECT `npc_entry`, `spell_id`, `aura_required` + INTO npcEntry, spellId, aura + FROM `npc_spellclick_spells` WHERE `aura_required` !=0 + LIMIT counter,1; + INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ConditionTypeOrReference`, + `ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`NegativeCondition`,`Comment`) + VALUES (18,npcEntry,spellId,1,0,aura,0,0,'Required aura for spellclick'); + SET counter = counter+1; + END WHILE; + + SET counter = 0; + SET recordCount = 0; + SELECT COUNT(*) INTO recordCount FROM `npc_spellclick_spells` WHERE `aura_forbidden` !=0; + WHILE counter < recordCount DO + SELECT `npc_entry`, `spell_id`, `aura_forbidden` + INTO npcEntry, spellId, aura + FROM `npc_spellclick_spells` WHERE `aura_forbidden` !=0 + LIMIT counter,1; + INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ConditionTypeOrReference`, + `ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`NegativeCondition`,`Comment`) + VALUES (18,npcEntry,spellId,1,0,aura,0,1,'Forbidden aura for spellclick'); + SET counter = counter+1; + END WHILE; + + SET counter = 0; + SET recordCount = 0; + SELECT COUNT(*) INTO recordCount FROM `npc_spellclick_spells` WHERE `quest_start` !=0; + WHILE counter < recordCount DO + SELECT `npc_entry`, `spell_id`, `quest_start`, `quest_start_active`, `quest_end` + INTO npcEntry, spellId, quest, questStartCanActive, quest2 + FROM `npc_spellclick_spells` WHERE `quest_start` !=0 + LIMIT counter,1; + IF questStartCanActive = 1 AND quest2 = 0 THEN + INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`, `ConditionTypeOrReference`, + `ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`NegativeCondition`,`Comment`) + VALUES (18,npcEntry,spellId,maxElseGroupId+1,9,0,quest,0,0,'Required quest active for spellclick'); + INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`, `ConditionTypeOrReference`, + `ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`NegativeCondition`,`Comment`) + VALUES (18,npcEntry,spellId,maxElseGroupId+1,8,0,quest,0,0,'Required quest rewarded for spellclick'); + SET maxElseGroupId = maxElseGroupId+1; + -- ELSE IF quest2 != 0 is handled in next loop (forbidden rewarded quest) + ELSEIF questStartCanActive = 1 && quest2 = quest THEN + INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ConditionTypeOrReference`, + `ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`NegativeCondition`,`Comment`) + VALUES (18,npcEntry,spellId,9,0,quest,0,0,'Required quest active for spellclick'); + -- ^Adds the required active quest condition. Prohibit quest reward is done in next loop + ELSEIF questStartCanActive = 0 THEN + INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ConditionTypeOrReference`, + `ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`NegativeCondition`,`Comment`) + VALUES (18,npcEntry,spellId,8,0,quest,0,0,'Required quest rewarded for spellclick'); + END IF; + + SET counter = counter+1; + END WHILE; + + SET counter = 0; + SET recordCount = 0; + SELECT COUNT(*) INTO recordCount FROM `npc_spellclick_spells` WHERE `quest_end` !=0; + WHILE counter < recordCount DO + SELECT `npc_entry`, `spell_id`, `quest_end` + INTO npcEntry, spellId, quest + FROM `npc_spellclick_spells` WHERE `quest_end` !=0 + LIMIT counter,1; + INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ConditionTypeOrReference`, + `ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`NegativeCondition`,`Comment`) + VALUES (18,npcEntry,spellId,8,0,quest,0,1,'Forbidden rewarded quest for spellclick'); + SET counter = counter+1; + END WHILE; + +END// + +DELIMITER ; + +CALL ConvertSpellClickConditions(); +DROP PROCEDURE ConvertSpellClickConditions; + +*/ + +ALTER TABLE `npc_spellclick_spells` + DROP COLUMN `quest_start`, + DROP COLUMN `quest_start_active`, + DROP COLUMN `quest_end`, + DROP COLUMN `aura_required`, + DROP COLUMN `aura_forbidden` +; diff --git a/sql/old/3.3.5a/2012_02_21_00_world_creature_loot_template.sql b/sql/old/3.3.5a/2012_02_21_00_world_creature_loot_template.sql new file mode 100644 index 00000000000..1d05c031868 --- /dev/null +++ b/sql/old/3.3.5a/2012_02_21_00_world_creature_loot_template.sql @@ -0,0 +1,78 @@ +-- Loot for Hellfire 5-man dungeons Trash (heroic and normal) -- +-- ------------------------------------------------------------- + +-- Hellfire Citadel: Ramparts +SET @Lootid := 17259; +-- set all lootids to same entry (normal and heroic) +UPDATE `creature_template` SET `lootid`=@Lootid WHERE `entry` IN +(17259,17264,17269,17270,17271,17280,17281,17309,17455,17478,17517,18048,18049,18050,18051,18052,18053,18054,18055,18057,18058,18059); +-- populate trashloot table +DELETE FROM `creature_loot_template` WHERE `entry` IN +(17259,17264,17269,17270,17271,17280,17281,17309,17455,17478,17517,18048,18049,18050,18051,18052,18053,18054,18055,18057,18058,18059); +DELETE FROM `creature_loot_template` WHERE `entry`=@Lootid; +INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- rough indication based on wowhead data of ALL mobs in the dungeon +(@Lootid,14047,40,1,0,1,4), -- Runecloth +(@Lootid,21877,20,1,0,1,4), -- Netherweave Cloth +(@Lootid, 8952,10,1,0,1,4), -- Roasted Quail +(@Lootid, 8766, 5,1,0,1,3), -- Morning Glory Dew +-- references for worldgreys +(@Lootid,1,5,1,0,-24000,1), -- Outland Grey Item Reference1 +(@Lootid,2,5,1,0,-24002,1), -- Outland Grey Item Reference2 +(@Lootid,3,5,1,0,-24003,1), -- Outland Grey Item Reference3 +(@Lootid,4,5,1,0,-24011,1), -- Outland Grey Item Reference4 +(@Lootid,5,5,1,0,-24022,1), -- Outland Grey Item Reference5 +(@Lootid,6,5,1,0,-24023,1), -- Outland Grey Item Reference6 +-- specifics +(@Lootid,5759,0.25,1,0,1,1), -- Thorium Lockbox +(@Lootid,5760,0.30,1,0,1,1), -- Eternium Lockbox +-- Scrolls +(@Lootid,7,5,1,0,-24724,1); -- Scroll of IV + +-- ----------------------------------------- +-- -- Hellfire Citadel: The Blood Furnace -- +-- ----------------------------------------- +SET @Lootid := 17370; +UPDATE `creature_template` SET `lootid`=@Lootid WHERE `entry` IN (17256,17370,17371,17395,17397,17398,17399,17414,17429,17477,17491,17624,17626,17653,18894,19016,18608,18619,18617,18615,18612,18614,18618,18603,18606,18610,18611,18609,18620,21645,21646); + +DELETE FROM `creature_loot_template` WHERE `entry` IN (17370,17371,17395,17397,17398,17414,17429,17491,17624,17626,18894); +INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(@Lootid,23894,-100,1,0,1,1), -- Fel Orc Blood (quest) +-- most common items +(@Lootid,14047,40,1,0,1,4), -- Runecloth +(@Lootid,21877,20,1,0,1,4), -- Netherweave Cloth +(@Lootid, 8952,10,1,0,1,4), -- Roasted Quail +(@Lootid, 8766, 5,1,0,1,3), -- Morning Glory Dew +-- references for worldgreys +(@Lootid,1,5,1,0,-24000,1), -- Outland Grey Item Reference1 +(@Lootid,2,5,1,0,-24002,1), -- Outland Grey Item Reference2 +(@Lootid,3,5,1,0,-24003,1), -- Outland Grey Item Reference3 +(@Lootid,4,5,1,0,-24011,1), -- Outland Grey Item Reference4 +(@Lootid,5,5,1,0,-24022,1), -- Outland Grey Item Reference5 +(@Lootid,6,5,1,0,-24023,1), -- Outland Grey Item Reference6 +-- specifics +(@Lootid,5759,0.25,1,0,1,1), -- Thorium Lockbox +(@Lootid,5760,0.30,1,0,1,1), -- Eternium Lockbox +-- Scrolls +(@Lootid,7,5,1,0,-24724,1); -- Scroll of IV + +-- ------------------------------------------- +-- -- Hellfire Citadel: The Shattered Halls -- +-- ------------------------------------------- +SET @Lootid := 16507; +UPDATE `creature_template` SET `lootid`=@Lootid WHERE `entry` IN (17669,16507,17622,17462,17427,17420,17083,16699,16704,17695,17670,16700,16593,16594,17464,17694,17465,17461,17671,20593,20582,20576,20590,20589,20594,20567,20587,20579,20581,20595,20586,20583,20578,20574,20588,20584,20577,20580); + +DELETE FROM `creature_loot_template` WHERE `entry` IN (16507,16593,16594,16699,16700,16704,17083,17420,17427,17461,17462,17464,17465,17669,17670,17671,17694,17695,17669,16594,17694,17427,17695,17461,16593,17465,17671,17464,17420,17670,16700,16699,16507,16704,17462); +INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(@Lootid,21877,40,1,0,2,3), -- Netherweave Cloth +(@Lootid,27854,20,1,0,1,1), -- Smoked Talbuk Venison +(@Lootid,27860,20,1,0,1,1), -- Purified Draenic Water +(@Lootid,31952,2.5,1,0,1,1), -- Khorium Lockbox +-- references +(@Lootid,1,5,1,1,-24002,1), -- Outland Grey Item Reference1 +(@Lootid,2,2,1,1,-24009,1), -- Outland Green Reference1 +(@Lootid,3,5,1,1,-24011,1), -- Outland Grey Item Reference2 +(@Lootid,4,1,1,1,-24012,1), -- Outland Blue Reference1 +(@Lootid,5,5,1,1,-24093,1), -- Outland Plans & patterns +-- Scrolls +(@Lootid,6,5,1,0,-24724,1); -- Scroll of IV diff --git a/sql/old/3.3.5a/2012_02_21_01_world_conditions.sql b/sql/old/3.3.5a/2012_02_21_01_world_conditions.sql new file mode 100644 index 00000000000..95c32703ea4 --- /dev/null +++ b/sql/old/3.3.5a/2012_02_21_01_world_conditions.sql @@ -0,0 +1,3592 @@ +CREATE TABLE `temp_convert_spells` +( + `id` INT(11), + `effMask` INT(11), + `onlyPlayers` TINYINT(3), + PRIMARY KEY (`id`) +); + +INSERT INTO `temp_convert_spells` VALUES +(46174,1,0), +(78002,1,1), +(78001,1,1), +(78000,1,1), +(77999,1,1), +(77984,1,1), +(76379,1,0), +(76098,1,0), +(76092,1,0), +(75920,1,1), +(75767,1,1), +(75765,1,1), +(75396,1,0), +(75389,1,1), +(75364,1,0), +(75319,1,0), +(75313,1,0), +(75244,1,0), +(75197,1,0), +(75195,1,0), +(75181,1,0), +(75107,1,0), +(75100,1,0), +(75078,1,0), +(75053,1,0), +(75018,1,0), +(74977,1,0), +(74903,1,0), +(74801,1,1), +(74758,1,0), +(74735,1,0), +(74549,1,0), +(74548,1,0), +(74486,1,0), +(74455,1,0), +(74444,1,0), +(74313,1,0), +(74285,1,0), +(74219,1,0), +(74182,1,0), +(74148,1,0), +(74098,1,0), +(74090,1,1), +(74086,1,1), +(74074,1,0), +(74033,1,0), +(73980,1,0), +(73955,1,0), +(73953,1,0), +(73886,1,0), +(73846,1,1), +(73845,1,1), +(73844,1,1), +(73843,1,1), +(73837,1,0), +(73836,1,0), +(73835,1,0), +(73787,1,0), +(73786,1,0), +(73785,1,0), +(73725,1,0), +(73659,1,0), +(73650,1,1), +(73582,1,0), +(73556,1,0), +(73555,1,0), +(73548,1,0), +(73331,1,1), +(73288,1,0), +(73165,1,0), +(73164,1,1), +(73159,1,1), +(73129,1,0), +(73128,1,0), +(73082,1,0), +(73071,1,0), +(73035,1,0), +(72959,1,1), +(72934,1,1), +(72928,1,1), +(72900,1,1), +(72830,1,1), +(72748,1,0), +(72747,1,0), +(72746,1,0), +(72745,1,0), +(72728,1,0), +(72706,1,1), +(72618,1,0), +(72595,1,1), +(72527,1,0), +(72479,1,1), +(72431,1,1), +(72429,1,1), +(72401,1,0), +(72347,1,0), +(72346,1,1), +(72280,1,0), +(72279,1,0), +(72278,1,0), +(72262,1,0), +(72260,1,0), +(72257,1,1), +(72209,1,0), +(72202,1,0), +(72099,1,0), +(72033,1,0), +(72032,1,0), +(72031,1,0), +(71952,1,0), +(71949,1,1), +(71948,1,0), +(71946,1,0), +(71848,1,0), +(71811,1,0), +(71809,1,0), +(71753,1,1), +(71693,1,0), +(71620,1,0), +(71617,1,0), +(71599,1,0), +(71538,1,1), +(71536,1,1), +(71520,1,0), +(71440,1,0), +(71415,1,0), +(71412,1,0), +(71365,1,0), +(71352,1,1), +(71322,1,0), +(71310,1,0), +(71308,1,0), +(71306,1,0), +(71281,1,0), +(71272,1,0), +(71189,1,0), +(71082,1,0), +(71081,1,0), +(71080,1,0), +(71079,1,0), +(71078,1,0), +(71075,1,0), +(71070,1,0), +(71032,1,0), +(71024,1,0), +(70995,1,0), +(70983,1,0), +(70966,1,1), +(70939,1,0), +(70936,1,0), +(70933,1,0), +(70931,1,0), +(70921,1,0), +(70881,1,0), +(70861,1,0), +(70860,1,0), +(70859,1,0), +(70858,1,0), +(70857,1,0), +(70856,1,0), +(70792,1,0), +(70790,1,0), +(70784,1,0), +(70781,1,0), +(70743,1,0), +(70713,1,1), +(70643,1,0), +(70639,1,0), +(70638,1,1), +(70636,1,1), +(70635,1,0), +(70623,1,1), +(70614,1,0), +(70611,1,0), +(70602,1,0), +(70595,1,0), +(70588,1,0), +(70586,1,0), +(70572,1,0), +(70569,1,0), +(70527,1,1), +(70525,1,0), +(70488,1,0), +(70485,1,0), +(70471,1,0), +(70466,1,0), +(70464,1,0), +(70444,1,0), +(70443,1,1), +(70403,1,0), +(70397,1,0), +(70383,1,0), +(70374,1,0), +(70366,1,0), +(70360,1,0), +(70338,1,0), +(70331,1,1), +(70299,1,0), +(70293,1,0), +(70290,1,0), +(70267,1,0), +(70266,1,0), +(70265,1,0), +(70246,1,0), +(70225,1,0), +(70224,1,0), +(70143,1,0), +(70130,1,0), +(70104,1,0), +(70100,1,0), +(70098,1,0), +(70079,1,0), +(70078,1,0), +(70053,1,0), +(70041,1,0), +(70040,1,0), +(70021,1,0), +(69960,1,0), +(69959,1,0), +(69922,1,0), +(69907,1,0), +(69886,1,0), +(69857,1,0), +(69843,1,0), +(69801,1,0), +(69798,1,0), +(69796,1,0), +(69784,1,0), +(69782,1,0), +(69768,1,0), +(69753,1,0), +(69705,1,0), +(69682,1,0), +(69614,1,0), +(69610,1,0), +(69601,1,0), +(69600,1,0), +(69593,1,0), +(69553,1,0), +(69538,1,0), +(69508,1,0), +(69431,1,0), +(69372,1,0), +(69347,1,0), +(69298,1,1), +(69171,1,0), +(69125,1,0), +(69101,1,0), +(69098,1,0), +(69097,1,0), +(69048,1,1), +(69039,1,0), +(69016,1,0), +(68957,1,0), +(68922,1,0), +(68919,1,0), +(68901,1,0), +(68881,1,0), +(68880,1,0), +(68861,1,0), +(68847,1,0), +(68842,1,0), +(68798,1,0), +(68663,1,0), +(68644,1,0), +(68617,1,0), +(68616,1,0), +(68614,1,0), +(68515,1,1), +(68471,1,1), +(68470,1,1), +(68401,1,0), +(68400,1,0), +(68360,1,0), +(68359,1,0), +(68358,1,0), +(68206,1,1), +(68198,1,1), +(68197,1,1), +(68193,1,1), +(68186,1,1), +(67888,1,0), +(67864,1,0), +(67857,1,0), +(67856,1,0), +(67855,1,0), +(67804,1,0), +(67757,1,0), +(67756,1,0), +(67755,1,0), +(67748,1,0), +(67732,1,0), +(67715,1,0), +(67705,1,0), +(67551,1,1), +(67547,1,0), +(67482,1,0), +(67400,1,0), +(67397,1,0), +(67369,1,0), +(67335,1,0), +(67328,1,0), +(67163,1,0), +(67162,1,0), +(67161,1,0), +(67160,1,0), +(67159,1,0), +(67158,1,0), +(66986,1,1), +(66810,1,1), +(66798,1,0), +(66785,1,0), +(66774,1,0), +(66718,1,1), +(66665,1,0), +(66637,1,0), +(66636,1,0), +(66630,1,0), +(66551,1,0), +(66550,1,0), +(66513,1,0), +(66512,1,0), +(66508,1,0), +(66401,1,0), +(66391,1,0), +(66390,1,0), +(66387,1,0), +(66386,1,0), +(66385,1,0), +(66384,1,0), +(66383,1,0), +(66382,1,0), +(66379,1,0), +(66357,1,0), +(66356,1,0), +(66355,1,0), +(66354,1,0), +(66353,1,0), +(66352,1,0), +(66350,1,0), +(66349,1,0), +(66348,1,0), +(66345,1,0), +(66339,1,0), +(66332,1,0), +(66314,1,1), +(66312,1,1), +(66287,1,0), +(66256,1,0), +(66193,1,0), +(66181,1,0), +(66153,1,0), +(66152,1,0), +(66141,1,0), +(66140,1,0), +(66135,1,1), +(66133,1,0), +(66132,1,0), +(65872,1,0), +(65861,1,0), +(65719,1,0), +(65718,1,0), +(65699,1,0), +(65685,1,0), +(65652,1,0), +(65614,1,0), +(65613,1,0), +(65611,1,0), +(65594,1,1), +(65589,1,0), +(65588,1,0), +(65587,1,0), +(65509,1,0), +(65357,1,0), +(65354,1,0), +(65350,1,0), +(65349,1,0), +(65346,1,1), +(65312,1,1), +(65311,1,1), +(65265,1,0), +(65258,1,0), +(65238,1,0), +(65224,1,0), +(65206,1,0), +(65200,1,0), +(65192,1,0), +(65184,1,1), +(65140,1,0), +(65109,1,0), +(65061,1,0), +(65042,1,0), +(65040,1,1), +(65034,1,0), +(65016,1,0), +(65015,1,0), +(64996,1,0), +(64995,1,0), +(64898,1,0), +(64887,1,0), +(64886,1,0), +(64880,1,0), +(64828,1,0), +(64799,1,0), +(64767,1,0), +(64623,1,0), +(64620,1,0), +(64619,1,0), +(64618,1,0), +(64597,1,0), +(64543,1,0), +(64539,1,0), +(64503,1,0), +(64499,1,0), +(64480,1,0), +(64475,1,0), +(64474,1,0), +(64466,1,0), +(64465,1,0), +(64463,1,0), +(64449,1,0), +(64444,1,0), +(64425,1,0), +(64414,1,0), +(64402,1,0), +(64397,1,0), +(64320,1,0), +(64229,1,0), +(64225,1,0), +(64224,1,0), +(64201,1,0), +(64185,1,0), +(64184,1,0), +(64183,1,0), +(64173,1,0), +(64172,1,0), +(64098,1,0), +(64069,1,0), +(64063,1,0), +(64061,1,0), +(64059,1,1), +(64032,1,0), +(64031,1,0), +(64030,1,0), +(64029,1,0), +(64028,1,0), +(64027,1,0), +(64026,1,0), +(64025,1,0), +(64024,1,0), +(64014,1,0), +(63984,1,0), +(63979,1,0), +(63947,1,0), +(63886,1,0), +(63882,1,0), +(63820,1,0), +(63813,1,0), +(63812,1,0), +(63764,1,0), +(63763,1,0), +(63762,1,0), +(63761,1,0), +(63749,1,0), +(63747,1,1), +(63745,1,1), +(63744,1,0), +(63702,1,0), +(63676,1,0), +(63659,1,0), +(63658,1,0), +(63657,1,0), +(63629,1,0), +(63628,1,0), +(63576,1,0), +(63524,1,0), +(63499,1,0), +(63446,1,0), +(63445,1,0), +(63444,1,0), +(63443,1,0), +(63442,1,0), +(63441,1,0), +(63440,1,0), +(63439,1,0), +(63438,1,0), +(63352,1,0), +(63348,1,0), +(63322,1,1), +(63274,1,0), +(63255,1,0), +(63238,1,0), +(63109,1,0), +(63037,1,0), +(63013,1,0), +(63001,1,0), +(62990,1,0), +(62978,1,0), +(62976,1,0), +(62943,1,0), +(62911,1,0), +(62909,1,0), +(62906,1,0), +(62888,1,0), +(62883,1,0), +(62882,1,0), +(62834,1,0), +(62809,1,0), +(62797,1,1), +(62778,1,0), +(62731,1,0), +(62727,1,0), +(62711,1,0), +(62708,1,0), +(62706,1,0), +(62701,1,0), +(62669,1,0), +(62646,1,0), +(62603,1,0), +(62584,1,0), +(62577,1,0), +(62567,1,0), +(62533,1,0), +(62525,1,0), +(62524,1,0), +(62521,1,0), +(62509,1,0), +(62505,1,0), +(62496,1,0), +(62488,1,0), +(62485,1,0), +(62484,1,0), +(62483,1,0), +(62480,1,0), +(62464,1,0), +(62378,1,0), +(124,1,0), +(2222,1,0), +(3730,1,0), +(4020,1,0), +(4338,1,0), +(5249,1,0), +(5251,1,0), +(5432,1,0), +(5555,1,0), +(6636,1,0), +(6672,1,0), +(6755,1,0), +(6955,1,0), +(6967,1,0), +(7022,1,0), +(7035,1,0), +(7036,1,0), +(7277,1,0), +(7393,1,0), +(7670,1,0), +(7769,1,0), +(8283,1,0), +(8593,1,0), +(8596,1,0), +(9002,1,0), +(9003,1,0), +(9004,1,0), +(9012,1,0), +(9082,1,0), +(9095,1,0), +(9455,1,0), +(9457,1,0), +(9712,1,0), +(9976,1,0), +(10113,1,0), +(10137,1,0), +(10252,1,0), +(10258,1,0), +(10259,1,0), +(10260,1,0), +(10345,1,0), +(10604,1,0), +(10727,1,0), +(10747,1,0), +(11195,1,0), +(11402,1,0), +(11440,1,0), +(11513,1,0), +(11637,1,0), +(11757,1,0), +(11893,1,0), +(12134,1,0), +(12158,1,0), +(12159,1,0), +(12347,1,0), +(12512,1,0), +(12564,1,0), +(12613,1,0), +(12623,1,0), +(12699,1,0), +(12709,1,0), +(12774,1,0), +(12938,1,0), +(13461,1,0), +(13727,1,0), +(13821,1,0), +(13951,1,0), +(13982,1,0), +(14250,1,0), +(14292,1,0), +(14806,1,0), +(14813,1,0), +(14928,1,0), +(15252,1,0), +(15281,1,0), +(15591,1,0), +(15658,1,0), +(15746,1,0), +(15958,1,0), +(16007,1,0), +(16032,1,0), +(16037,1,0), +(16053,1,0), +(16068,1,0), +(16069,1,0), +(16070,1,0), +(16074,1,0), +(16378,1,0), +(16381,1,0), +(16404,1,0), +(16556,1,0), +(16558,1,0), +(16637,1,0), +(16786,1,0), +(16807,1,0), +(17048,1,0), +(17166,1,0), +(17190,1,0), +(17202,1,0), +(17272,1,0), +(17278,1,0), +(17279,1,0), +(17471,1,0), +(17536,1,0), +(17616,1,0), +(17618,1,0), +(17652,1,0), +(17671,1,0), +(17675,1,0), +(17676,1,0), +(17677,1,0), +(17678,1,0), +(17698,1,0), +(17748,1,0), +(18110,1,0), +(18655,1,0), +(18666,1,0), +(18811,1,0), +(18969,1,0), +(19032,1,0), +(19096,1,0), +(19571,1,0), +(19593,1,0), +(19721,1,0), +(19749,1,0), +(19770,1,0), +(19773,1,0), +(19952,1,0), +(20358,1,0), +(20465,1,0), +(20619,1,0), +(21052,1,0), +(21075,1,0), +(21076,1,0), +(21391,1,0), +(21556,1,0), +(21566,1,0), +(21885,1,0), +(21950,1,0), +(22096,1,0), +(22203,1,0), +(22205,1,0), +(22393,1,0), +(22458,1,0), +(22860,1,0), +(22906,1,0), +(22966,1,0), +(23014,1,0), +(23016,1,0), +(23018,1,0), +(23019,1,0), +(23168,1,0), +(23328,1,0), +(23360,1,0), +(23389,1,0), +(23394,1,0), +(23415,1,0), +(23642,1,0), +(23951,1,0), +(23974,1,0), +(24062,1,0), +(24083,1,0), +(24172,1,0), +(24207,1,0), +(24217,1,0), +(24311,1,0), +(24322,1,0), +(24323,1,0), +(24391,1,0), +(24734,1,0), +(24744,1,0), +(24756,1,0), +(24758,1,0), +(24760,1,0), +(24763,1,0), +(24765,1,0), +(24768,1,0), +(24770,1,0), +(24772,1,0), +(24784,1,0), +(24786,1,0), +(24788,1,0), +(24789,1,0), +(24790,1,0), +(24804,1,0), +(24933,1,0), +(25030,1,0), +(25031,1,0), +(25032,1,0), +(25099,1,0), +(25145,1,0), +(25149,1,0), +(25150,1,0), +(25158,1,0), +(25201,1,0), +(25715,1,0), +(25727,1,0), +(25745,1,0), +(25822,1,0), +(25823,1,0), +(25896,1,0), +(26235,1,0), +(26344,1,0), +(26345,1,0), +(26346,1,0), +(26347,1,0), +(26348,1,0), +(26349,1,0), +(26351,1,0), +(26352,1,0), +(26353,1,0), +(26354,1,0), +(26355,1,0), +(26356,1,0), +(26462,1,0), +(26522,1,1), +(26608,1,0), +(26687,1,1), +(26879,1,0), +(27583,1,0), +(27651,1,0), +(27663,1,0), +(27745,1,0), +(27885,1,0), +(27886,1,0), +(27892,1,0), +(27893,1,0), +(27894,1,0), +(27928,1,0), +(27929,1,0), +(27935,1,0), +(27936,1,0), +(28018,1,0), +(28032,1,0), +(28056,1,0), +(28078,1,0), +(28087,1,0), +(28096,1,0), +(28111,1,0), +(28159,1,0), +(28278,1,0), +(28281,1,0), +(28309,1,0), +(28326,1,0), +(28338,1,0), +(28339,1,0), +(28365,1,0), +(28366,1,0), +(28367,1,0), +(28374,1,0), +(28392,1,0), +(28404,1,0), +(28441,1,0), +(28605,1,0), +(28697,1,0), +(28731,1,0), +(28732,1,0), +(28861,1,0), +(29070,1,0), +(29072,1,0), +(29120,1,0), +(29121,1,0), +(29122,1,0), +(29172,1,0), +(29173,1,0), +(29176,1,0), +(29328,1,1), +(29339,1,0), +(29340,1,0), +(29428,1,0), +(29437,1,0), +(29456,1,0), +(29457,1,0), +(29458,1,0), +(29459,1,0), +(29461,1,0), +(29531,1,0), +(29534,1,0), +(29612,1,0), +(29705,1,0), +(29726,1,0), +(29727,1,0), +(29769,1,0), +(29770,1,0), +(29846,1,1), +(29962,1,0), +(29966,1,0), +(29967,1,0), +(29969,1,0), +(29970,1,0), +(29972,1,0), +(29989,1,0), +(30012,1,0), +(30065,1,0), +(30107,1,0), +(30166,1,0), +(30207,1,0), +(30221,1,0), +(30232,1,0), +(30273,1,0), +(30410,1,0), +(30417,1,0), +(30418,1,0), +(30425,1,0), +(30427,1,0), +(30460,1,0), +(30462,1,0), +(30469,1,0), +(30477,1,0), +(30541,1,0), +(30544,1,0), +(30571,1,1), +(30572,1,0), +(30625,1,0), +(30631,1,1), +(30656,1,0), +(30662,1,0), +(30676,1,0), +(30690,1,0), +(30735,1,0), +(30738,1,0), +(30745,1,0), +(30751,1,0), +(30762,1,0), +(30763,1,0), +(30764,1,0), +(30765,1,0), +(30766,1,0), +(30834,1,0), +(30835,1,0), +(30875,1,0), +(30876,1,0), +(30951,1,0), +(30952,1,0), +(30964,1,0), +(30968,1,0), +(30970,1,0), +(30974,1,0), +(30985,1,0), +(30988,1,0), +(31115,1,0), +(31225,1,0), +(31315,1,0), +(31324,1,0), +(31326,1,0), +(31329,1,0), +(31336,1,0), +(31346,1,0), +(31411,1,0), +(31412,1,0), +(31413,1,0), +(31414,1,0), +(31474,1,0), +(31515,1,0), +(31532,1,0), +(31537,1,0), +(31550,1,0), +(31611,1,0), +(31628,1,0), +(31630,1,0), +(31631,1,0), +(31702,1,0), +(31727,1,0), +(31736,1,0), +(31749,1,0), +(31781,1,0), +(31793,1,0), +(31799,1,0), +(31806,1,0), +(31889,1,0), +(31902,1,0), +(31936,1,0), +(31979,1,0), +(31993,1,0), +(32040,1,0), +(32042,1,0), +(32045,1,0), +(32051,1,0), +(32052,1,0), +(32087,1,0), +(32111,1,0), +(32127,1,0), +(32146,1,0), +(32163,1,0), +(32164,1,0), +(32227,1,0), +(32228,1,0), +(32251,1,0), +(32260,1,0), +(32286,1,0), +(32301,1,0), +(32303,1,0), +(32312,1,0), +(32373,1,0), +(32396,1,0), +(32560,1,0), +(32573,1,0), +(32589,1,0), +(32622,1,0), +(32623,1,0), +(32638,1,0), +(32668,1,0), +(32708,1,1), +(32760,1,0), +(32838,1,0), +(32890,1,0), +(32928,1,0), +(32929,1,0), +(32930,1,0), +(32953,1,0), +(32958,1,0), +(32974,1,0), +(32976,1,0), +(32979,1,0), +(33067,1,0), +(33270,1,1), +(33329,1,0), +(33332,1,0), +(33336,1,0), +(33337,1,0), +(33423,1,0), +(33424,1,0), +(33425,1,0), +(33531,1,0), +(33532,1,0), +(33618,1,0), +(33644,1,0), +(33655,1,0), +(33669,1,0), +(33710,1,0), +(33716,1,1), +(33742,1,0), +(33744,1,0), +(33796,1,0), +(33805,1,0), +(33806,1,0), +(33809,1,0), +(33822,1,0), +(33831,1,0), +(33838,1,0), +(33861,1,0), +(33862,1,0), +(33918,1,0), +(33924,1,0), +(33937,1,0), +(33981,1,0), +(34011,1,0), +(34013,1,0), +(34016,1,0), +(34019,1,0), +(34023,1,0), +(34024,1,0), +(34062,1,0), +(34063,1,0), +(34076,1,0), +(34119,1,0), +(34154,1,0), +(34156,1,0), +(34209,1,0), +(34211,1,0), +(34212,1,0), +(34221,1,0), +(34239,1,0), +(34254,1,0), +(34330,1,0), +(34332,1,0), +(34367,1,0), +(34378,1,0), +(34393,1,0), +(34397,1,0), +(34430,1,0), +(34516,1,0), +(34526,1,0), +(34536,1,0), +(34581,1,0), +(34583,1,0), +(34613,1,0), +(34627,1,0), +(34646,1,0), +(34662,1,0), +(34742,1,0), +(34806,1,0), +(34874,1,0), +(34893,1,0), +(34946,1,0), +(35016,1,0), +(35040,1,0), +(35063,1,0), +(35097,1,0), +(35113,1,0), +(35137,1,0), +(35140,1,0), +(35141,1,0), +(35155,1,0), +(35160,1,0), +(35162,1,0), +(35170,1,0), +(35176,1,0), +(35190,1,0), +(35245,1,0), +(35262,1,0), +(35282,1,0), +(35301,1,0), +(35372,1,0), +(35413,1,0), +(35427,1,0), +(35515,1,0), +(35516,1,0), +(35598,1,0), +(35600,1,0), +(35673,1,0), +(35682,1,0), +(35724,1,0), +(35746,1,0), +(35756,1,0), +(35770,1,0), +(35771,1,0), +(35772,1,0), +(35782,1,0), +(35930,1,0), +(35941,1,1), +(35956,1,1), +(35960,1,0), +(35961,1,0), +(35962,1,0), +(36000,1,0), +(36035,1,0), +(36089,1,0), +(36090,1,0), +(36103,1,0), +(36167,1,0), +(36174,1,0), +(36196,1,0), +(36197,1,0), +(36198,1,0), +(36201,1,0), +(36220,1,0), +(36239,1,0), +(36241,1,0), +(36243,1,0), +(36290,1,0), +(36291,1,0), +(36293,1,0), +(36327,1,0), +(36330,1,0), +(36378,1,0), +(36384,1,0), +(36431,1,0), +(36452,1,0), +(36455,1,1), +(36456,1,0), +(36514,1,0), +(36544,1,0), +(36639,1,0), +(36651,1,0), +(36652,1,0), +(36692,1,0), +(36709,1,0), +(36717,1,1), +(36779,1,0), +(36795,1,0), +(36802,1,0), +(36803,1,0), +(36804,1,0), +(36823,1,0), +(36852,1,0), +(36854,1,0), +(36856,1,0), +(36857,1,0), +(36858,1,0), +(36859,1,0), +(36871,1,0), +(36878,1,0), +(36884,1,0), +(36896,1,0), +(36951,1,0), +(36953,1,0), +(36969,1,0), +(36995,1,0), +(37013,1,0), +(37017,1,0), +(37032,1,0), +(37033,1,0), +(37034,1,0), +(37035,1,0), +(37051,1,0), +(37052,1,0), +(37053,1,0), +(37055,1,0), +(37056,1,0), +(37071,1,0), +(37072,1,0), +(37103,1,0), +(37142,1,0), +(37143,1,0), +(37144,1,0), +(37146,1,0), +(37147,1,0), +(37148,1,0), +(37149,1,0), +(37150,1,0), +(37151,1,0), +(37152,1,0), +(37153,1,0), +(37199,1,0), +(37220,1,0), +(37226,1,0), +(37229,1,0), +(37235,1,0), +(37281,1,0), +(37285,1,0), +(37337,1,0), +(37339,1,0), +(37345,1,0), +(37348,1,0), +(37388,1,0), +(37406,1,0), +(37408,1,1), +(37413,1,0), +(37422,1,0), +(37427,1,0), +(37428,1,0), +(37448,1,1), +(37449,1,1), +(37453,1,0), +(37454,1,0), +(37459,1,0), +(37461,1,0), +(37465,1,0), +(37469,1,0), +(37471,1,0), +(37472,1,0), +(37474,1,0), +(37476,1,0), +(37498,1,0), +(37502,1,0), +(37573,1,0), +(37626,1,0), +(37645,1,0), +(37689,1,0), +(37697,1,0), +(37712,1,0), +(37720,1,0), +(37748,1,0), +(37755,1,0), +(37775,1,0), +(37784,1,0), +(37824,1,0), +(37842,1,0), +(37843,1,0), +(37848,1,0), +(37849,1,1), +(37853,1,0), +(37868,1,0), +(37893,1,0), +(37895,1,0), +(37918,1,0), +(37934,1,0), +(37936,1,0), +(37964,1,0), +(37984,1,0), +(38003,1,0), +(38014,1,0), +(38015,1,0), +(38017,1,0), +(38020,1,0), +(38053,1,0), +(38054,1,0), +(38072,1,0), +(38073,1,0), +(38112,1,0), +(38121,1,0), +(38123,1,0), +(38126,1,0), +(38128,1,0), +(38130,1,0), +(38202,1,0), +(38250,1,0), +(38269,1,0), +(38360,1,0), +(38444,1,0), +(38451,1,0), +(38452,1,0), +(38455,1,0), +(38469,1,0), +(38482,1,0), +(38508,1,0), +(38530,1,0), +(38629,1,0), +(38632,1,0), +(38691,1,0), +(38711,1,0), +(38722,1,0), +(38736,1,0), +(38738,1,0), +(38762,1,0), +(38802,1,0), +(38829,1,1), +(38966,1,0), +(38968,1,0), +(39010,1,0), +(39011,1,0), +(39043,1,0), +(39073,1,0), +(39094,1,0), +(39124,1,0), +(39126,1,0), +(39140,1,0), +(39141,1,0), +(39184,1,0), +(39185,1,0), +(39189,1,0), +(39190,1,0), +(39206,1,0), +(39211,1,0), +(39216,1,0), +(39219,1,0), +(39221,1,0), +(39248,1,0), +(39334,1,0), +(39335,1,0), +(39338,1,0), +(39341,1,0), +(39342,1,0), +(39344,1,0), +(39350,1,0), +(39352,1,0), +(39353,1,0), +(39354,1,0), +(39355,1,0), +(39356,1,0), +(39357,1,0), +(39358,1,0), +(39359,1,0), +(39360,1,0), +(39361,1,0), +(39362,1,0), +(39395,1,0), +(39495,1,0), +(39497,1,1), +(39552,1,0), +(39559,1,0), +(39583,1,0), +(39601,1,0), +(39635,1,0), +(39678,1,0), +(39687,1,0), +(39690,1,0), +(39691,1,0), +(39692,1,0), +(39696,1,0), +(39758,1,0), +(39834,1,1), +(39849,1,0), +(39851,1,1), +(39852,1,1), +(39853,1,1), +(39854,1,1), +(39873,1,0), +(39899,1,0), +(39914,1,0), +(39915,1,0), +(39919,1,0), +(39921,1,0), +(39923,1,1), +(39930,1,0), +(39938,1,0), +(39939,1,0), +(39940,1,0), +(39974,1,0), +(39977,1,0), +(39978,1,0), +(39985,1,0), +(39989,1,0), +(39993,1,0), +(39999,1,0), +(40085,1,0), +(40094,1,0), +(40106,1,0), +(40110,1,0), +(40112,1,1), +(40136,1,0), +(40147,1,0), +(40153,1,0), +(40156,1,0), +(40160,1,0), +(40187,1,0), +(40189,1,0), +(40190,1,0), +(40224,1,0), +(40281,1,0), +(40287,1,0), +(40288,1,0), +(40289,1,0), +(40309,1,0), +(40350,1,0), +(40359,1,0), +(40382,1,0), +(40383,1,0), +(40397,1,0), +(40437,1,0), +(40439,1,0), +(40454,1,0), +(40490,1,0), +(40494,1,0), +(40498,1,0), +(40499,1,0), +(40512,1,0), +(40520,1,0), +(40521,1,0), +(40523,1,0), +(40532,1,0), +(40547,1,0), +(40607,1,0), +(40638,1,0), +(40693,1,0), +(40704,1,0), +(40707,1,0), +(40708,1,0), +(40709,1,0), +(40710,1,0), +(40711,1,0), +(40712,1,0), +(40713,1,0), +(40715,1,0), +(40730,1,1), +(40738,1,0), +(40750,1,0), +(40761,1,0), +(40788,1,0), +(40821,1,0), +(40824,1,0), +(40825,1,0), +(40828,1,0), +(40830,1,0), +(40848,1,1), +(40874,1,0), +(40887,1,0), +(40978,1,0), +(40985,1,1), +(40989,1,0), +(40993,1,1), +(41007,1,1), +(41015,1,1), +(41022,1,1), +(41073,1,0), +(41077,1,0), +(41122,1,0), +(41124,1,0), +(41125,1,0), +(41128,1,0), +(41129,1,0), +(41154,1,0), +(41257,1,0), +(41268,1,0), +(41269,1,0), +(41271,1,0), +(41285,1,1), +(41295,1,0), +(41333,1,0), +(41342,1,0), +(41343,1,0), +(41344,1,0), +(41362,1,0), +(41455,1,0), +(41457,1,0), +(41477,1,0), +(41499,1,0), +(41522,1,0), +(41525,1,0), +(41537,1,0), +(41557,1,0), +(41560,1,0), +(41575,1,0), +(41602,1,0), +(41614,1,0), +(41624,1,1), +(41975,1,0), +(41976,1,0), +(41993,1,0), +(42008,1,0), +(42014,1,0), +(42138,1,1), +(42143,1,0), +(42151,1,0), +(42166,1,0), +(42167,1,0), +(42168,1,0), +(42178,1,0), +(42219,1,0), +(42222,1,0), +(42247,1,0), +(42269,1,0), +(42271,1,0), +(42272,1,0), +(42289,1,0), +(42317,1,0), +(42318,1,0), +(42321,1,0), +(42339,1,0), +(42341,1,0), +(42352,1,0), +(42356,1,0), +(42391,1,0), +(42393,1,0), +(42405,1,0), +(42410,1,0), +(42415,1,0), +(42428,1,0), +(42442,1,0), +(42447,1,0), +(42454,1,0), +(42471,1,0), +(42473,1,0), +(42482,1,0), +(42484,1,0), +(42515,1,0), +(42517,1,0), +(42530,1,0), +(42534,1,0), +(42536,1,0), +(42542,1,0), +(42550,1,0), +(42564,1,0), +(42567,1,0), +(42570,1,0), +(42577,1,0), +(42585,1,0), +(42604,1,0), +(42605,1,0), +(42616,1,0), +(42631,1,0), +(42638,1,1), +(42647,1,0), +(42654,1,0), +(42655,1,0), +(42659,1,0), +(42661,1,0), +(42664,1,0), +(42674,1,1), +(42685,1,0), +(42695,1,0), +(42697,1,0), +(42703,1,0), +(42707,1,0), +(42713,1,0), +(42720,1,0), +(42734,1,0), +(42757,1,1), +(42768,1,0), +(42793,1,0), +(42797,1,0), +(42808,1,0), +(42809,1,0), +(42813,1,0), +(42815,1,0), +(42816,1,0), +(42818,1,0), +(42821,1,0), +(42839,1,0), +(42857,1,0), +(42881,1,0), +(42882,1,0), +(42883,1,0), +(42884,1,0), +(42888,1,0), +(42905,1,0), +(42968,1,0), +(42982,1,0), +(43033,1,0), +(43035,1,0), +(43057,1,0), +(43066,1,0), +(43068,1,0), +(43069,1,0), +(43072,1,0), +(43076,1,0), +(43078,1,0), +(43079,1,0), +(43092,1,0), +(43101,1,0), +(43106,1,0), +(43109,1,0), +(43144,1,0), +(43171,1,0), +(43209,1,0), +(43210,1,0), +(43234,1,0), +(43239,1,0), +(43244,1,0), +(43255,1,0), +(43291,1,0), +(43306,1,0), +(43307,1,0), +(43333,1,0), +(43371,1,0), +(43385,1,0), +(43386,1,0), +(43403,1,0), +(43404,1,0), +(43407,1,0), +(43450,1,0), +(43458,1,0), +(43468,1,0), +(43486,1,0), +(43487,1,0), +(43515,1,0), +(43520,1,0), +(43525,1,0), +(43546,1,0), +(43559,1,0), +(43563,1,0), +(43568,1,0), +(43615,1,0), +(43647,1,0), +(43662,1,0), +(43685,1,0), +(43691,1,0), +(43711,1,0), +(43734,1,0), +(43754,1,0), +(43770,1,0), +(43791,1,0), +(43805,1,0), +(43863,1,0), +(43865,1,0), +(43867,1,0), +(43871,1,0), +(43872,1,0), +(43878,1,0), +(43882,1,0), +(43892,1,0), +(43942,1,0), +(43943,1,0), +(43949,1,0), +(43962,1,0), +(43990,1,0), +(43994,1,0), +(44014,1,0), +(44022,1,0), +(44023,1,0), +(44024,1,0), +(44026,1,0), +(44027,1,0), +(44028,1,0), +(44037,1,0), +(44145,1,0), +(44161,1,0), +(44193,1,0), +(44214,1,0), +(44224,1,1), +(44229,1,0), +(44232,1,1), +(44250,1,0), +(44255,1,0), +(44260,1,0), +(44266,1,0), +(44270,1,0), +(44283,1,0), +(44284,1,0), +(44309,1,0), +(44313,1,0), +(44329,1,0), +(44330,1,0), +(44355,1,0), +(44362,1,0), +(44365,1,0), +(44367,1,0), +(44374,1,0), +(44392,1,0), +(44411,1,0), +(44420,1,0), +(44422,1,0), +(44458,1,0), +(44550,1,0), +(44562,1,0), +(44574,1,0), +(44609,1,0), +(44610,1,0), +(44653,1,0), +(44681,1,0), +(44682,1,1), +(44749,1,0), +(44804,1,0), +(44807,1,0), +(44826,1,0), +(44837,1,0), +(44838,1,0), +(44839,1,0), +(44840,1,0), +(44841,1,0), +(44842,1,0), +(44845,1,0), +(44846,1,0), +(44849,1,1), +(44864,1,0), +(44865,1,0), +(44872,1,0), +(44877,1,0), +(44883,1,0), +(44886,1,0), +(44938,1,0), +(44939,1,0), +(44941,1,0), +(44946,1,0), +(44948,1,0), +(44963,1,0), +(44965,1,0), +(44981,1,0), +(45005,1,0), +(45008,1,0), +(45012,1,0), +(45013,1,0), +(45076,1,0), +(45086,1,0), +(45103,1,0), +(45109,1,0), +(45114,1,0), +(45115,1,0), +(45119,1,0), +(45172,1,0), +(45188,1,0), +(45191,1,0), +(45219,1,0), +(45223,1,0), +(45224,1,0), +(45229,1,0), +(45233,1,0), +(45259,1,0), +(45260,1,1), +(45264,1,0), +(45267,1,0), +(45277,1,0), +(45279,1,0), +(45307,1,0), +(45323,1,0), +(45339,1,0), +(45340,1,0), +(45351,1,0), +(45368,1,0), +(45371,1,0), +(45388,1,0), +(45389,1,0), +(45405,1,0), +(45407,1,0), +(45414,1,0), +(45437,1,0), +(45446,1,0), +(45448,1,0), +(45449,1,0), +(45465,1,0), +(45474,1,0), +(45536,1,0), +(45581,1,0), +(45583,1,0), +(45586,1,0), +(45594,1,0), +(45595,1,0), +(45596,1,0), +(45597,1,0), +(45602,1,0), +(45605,1,0), +(45606,1,0), +(45607,1,0), +(45608,1,0), +(45609,1,0), +(45622,1,0), +(45623,1,0), +(45630,1,0), +(45634,1,0), +(45644,1,1), +(45651,1,0), +(45655,1,0), +(45656,1,0), +(45666,1,0), +(45667,1,0), +(45671,1,1), +(45680,1,1), +(45692,1,0), +(45700,1,0), +(45714,1,0), +(45732,1,0), +(45735,1,0), +(45761,1,0), +(45774,1,0), +(45780,1,0), +(45788,1,0), +(45805,1,0), +(45808,1,0), +(45834,1,0), +(45835,1,0), +(45841,1,0), +(45853,1,0), +(45859,1,0), +(45863,1,0), +(45864,1,0), +(45867,1,0), +(45872,1,0), +(45888,1,0), +(45907,1,0), +(45911,1,0), +(45912,1,0), +(45914,1,0), +(45918,1,1), +(45923,1,0), +(45929,1,0), +(45930,1,0), +(45941,1,0), +(45949,1,0), +(45961,1,0), +(45968,1,0), +(45969,1,0), +(45970,1,0), +(45976,1,0), +(45979,1,0), +(45990,1,0), +(45993,1,0), +(46013,1,0), +(46018,1,1), +(46022,1,0), +(46034,1,0), +(46054,1,0), +(46058,1,0), +(46063,1,0), +(46066,1,0), +(46068,1,0), +(46085,1,0), +(46143,1,0), +(46171,1,0), +(46173,1,0), +(62377,1,0), +(46175,1,0), +(46176,1,0), +(46177,1,0), +(46178,1,0), +(46201,1,0), +(46208,1,0), +(46219,1,0), +(46222,1,0), +(46236,1,0), +(46237,1,0), +(46245,1,0), +(46246,1,0), +(46281,1,0), +(46307,1,1), +(46318,1,0), +(46319,1,0), +(46320,1,1), +(46330,1,0), +(46363,1,0), +(46372,1,1), +(46374,1,0), +(46376,1,0), +(46382,1,0), +(46385,1,0), +(46396,1,1), +(46398,1,0), +(46399,1,0), +(46400,1,0), +(46474,1,0), +(46475,1,0), +(46477,1,0), +(46482,1,0), +(46488,1,0), +(46521,1,0), +(46588,1,1), +(46592,1,0), +(46593,1,0), +(46603,1,0), +(46609,1,0), +(46610,1,0), +(46623,1,0), +(46631,1,0), +(46637,1,0), +(46650,1,0), +(46652,1,0), +(46656,1,0), +(46685,1,0), +(46692,1,0), +(46694,1,0), +(46704,1,0), +(46707,1,0), +(46732,1,1), +(46733,1,0), +(46735,1,0), +(46747,1,0), +(46793,1,0), +(46797,1,0), +(46809,1,0), +(46815,1,0), +(46818,1,0), +(46820,1,0), +(46843,1,0), +(46886,1,0), +(46895,1,0), +(46900,1,0), +(46902,1,0), +(46903,1,0), +(46904,1,0), +(46936,1,0), +(46937,1,0), +(46963,1,0), +(46964,1,0), +(46965,1,1), +(46974,1,0), +(47016,1,0), +(47026,1,0), +(47035,1,0), +(47060,1,0), +(47065,1,0), +(47104,1,0), +(47110,1,0), +(47137,1,0), +(47170,1,0), +(47176,1,0), +(47184,1,0), +(47214,1,0), +(47253,1,0), +(47254,1,0), +(47336,1,0), +(47344,1,0), +(47370,1,1), +(47374,1,0), +(47378,1,0), +(47421,1,0), +(47452,1,0), +(47460,1,0), +(47463,1,0), +(47469,1,0), +(47542,1,0), +(47547,1,0), +(47563,1,0), +(47574,1,0), +(47593,1,0), +(47594,1,0), +(47596,1,0), +(47597,1,0), +(47598,1,0), +(47599,1,0), +(47616,1,0), +(47617,1,0), +(47618,1,0), +(47619,1,0), +(47634,1,0), +(47669,1,0), +(47670,1,0), +(47681,1,0), +(47682,1,0), +(47683,1,0), +(47684,1,0), +(47685,1,0), +(47691,1,1), +(47711,1,0), +(47712,1,0), +(47713,1,0), +(47747,1,0), +(47771,1,0), +(47787,1,0), +(47799,1,0), +(47911,1,0), +(47913,1,0), +(47916,1,0), +(47933,1,0), +(47935,1,0), +(47939,1,0), +(47959,1,0), +(48009,1,0), +(48021,1,0), +(48028,1,1), +(48035,1,0), +(48115,1,0), +(48117,1,0), +(48183,1,0), +(48185,1,0), +(48188,1,0), +(48194,1,1), +(48199,1,0), +(48201,1,0), +(48202,1,0), +(48213,1,0), +(48218,1,0), +(48222,1,0), +(48223,1,0), +(48227,1,0), +(48246,1,1), +(48252,1,0), +(48293,1,0), +(48306,1,0), +(48315,1,0), +(48329,1,0), +(48344,1,0), +(48345,1,0), +(48362,1,0), +(48363,1,0), +(48375,1,0), +(48385,1,0), +(48398,1,0), +(48399,1,0), +(48425,1,0), +(48426,1,0), +(48455,1,0), +(48490,1,0), +(48497,1,0), +(48508,1,0), +(48530,1,0), +(48551,1,0), +(48597,1,0), +(48600,1,0), +(48605,1,0), +(48620,1,0), +(48623,1,0), +(48627,1,0), +(48641,1,0), +(48642,1,0), +(48646,1,0), +(48649,1,0), +(48685,1,0), +(48724,1,0), +(48726,1,0), +(48728,1,0), +(48730,1,0), +(48732,1,0), +(48748,1,0), +(48764,1,0), +(48771,1,0), +(48773,1,0), +(48790,1,0), +(48793,1,0), +(48799,1,0), +(48808,1,0), +(48811,1,0), +(48896,1,0), +(48901,1,0), +(48904,1,0), +(48929,1,0), +(48974,1,0), +(48975,1,0), +(49022,1,0), +(49030,1,0), +(49058,1,0), +(49062,1,0), +(49075,1,0), +(49080,1,0), +(49083,1,0), +(49118,1,0), +(49125,1,0), +(49128,1,0), +(49129,1,0), +(49131,1,0), +(49134,1,0), +(49135,1,0), +(49159,1,0), +(49166,1,0), +(49210,1,0), +(49211,1,0), +(49262,1,0), +(49291,1,0), +(49292,1,0), +(49313,1,0), +(49319,1,0), +(49325,1,0), +(49330,1,0), +(49332,1,0), +(49333,1,0), +(49334,1,0), +(49367,1,0), +(49370,1,0), +(49404,1,0), +(49405,1,0), +(49428,1,0), +(49434,1,0), +(49515,1,0), +(49517,1,0), +(49519,1,0), +(49524,1,0), +(49525,1,0), +(49552,1,0), +(49554,1,0), +(49555,1,0), +(49557,1,0), +(49590,1,0), +(49625,1,0), +(49634,1,0), +(49679,1,0), +(49682,1,0), +(49683,1,0), +(49684,1,0), +(49731,1,0), +(49751,1,0), +(49762,1,0), +(49825,1,0), +(49826,1,0), +(49829,1,0), +(49858,1,0), +(49862,1,0), +(49870,1,0), +(49899,1,0), +(49947,1,0), +(50036,1,0), +(50087,1,0), +(50133,1,0), +(50173,1,0), +(50174,1,0), +(50176,1,0), +(50177,1,0), +(50178,1,0), +(50179,1,0), +(50312,1,0), +(50315,1,1), +(50331,1,0), +(50350,1,0), +(50382,1,0), +(50383,1,0), +(50398,1,1), +(50430,1,0), +(50440,1,0), +(50492,1,0), +(50515,1,0), +(50524,1,0), +(50546,1,0), +(50547,1,0), +(50548,1,0), +(50554,1,0), +(50556,1,0), +(50562,1,0), +(50563,1,0), +(50568,1,0), +(50569,1,0), +(50592,1,0), +(50628,1,0), +(50669,1,0), +(50674,1,0), +(50682,1,1), +(50742,1,0), +(50775,1,0), +(50793,1,0), +(50794,1,0), +(50817,1,0), +(50835,1,0), +(50878,1,0), +(50883,1,1), +(50892,1,0), +(51001,1,0), +(51022,1,0), +(51023,1,0), +(51024,1,0), +(51025,1,0), +(51039,1,0), +(51049,1,0), +(51122,1,0), +(51136,1,0), +(51139,1,0), +(51152,1,0), +(51171,1,0), +(51172,1,0), +(51202,1,0), +(51213,1,0), +(51215,1,0), +(51234,1,0), +(51239,1,0), +(51247,1,0), +(51256,1,0), +(51276,1,0), +(51288,1,0), +(51318,1,0), +(51331,1,0), +(51332,1,0), +(51333,1,0), +(51343,1,0), +(51366,1,0), +(51368,1,0), +(51381,1,0), +(51384,1,0), +(51393,1,0), +(51396,1,0), +(51403,1,0), +(51420,1,0), +(51448,1,1), +(51516,1,0), +(51518,1,0), +(51577,1,0), +(51579,1,0), +(51590,1,0), +(51603,1,0), +(51606,1,0), +(51607,1,0), +(51616,1,0), +(51639,1,0), +(51641,1,0), +(51642,1,0), +(51643,1,0), +(51644,1,0), +(51645,1,0), +(51649,1,0), +(51650,1,0), +(51651,1,0), +(51652,1,0), +(51670,1,0), +(51694,1,0), +(51697,1,0), +(51727,1,0), +(51737,1,0), +(51739,1,0), +(51743,1,0), +(51754,1,0), +(51767,1,0), +(51769,1,0), +(51773,1,0), +(51774,1,0), +(51791,1,0), +(51794,1,0), +(51825,1,0), +(51840,1,0), +(51843,1,0), +(51858,1,0), +(51859,1,0), +(51861,1,0), +(51866,1,0), +(51870,1,0), +(51902,1,0), +(51904,1,0), +(51907,1,0), +(51910,1,0), +(51925,1,0), +(51927,1,0), +(51931,1,0), +(51932,1,0), +(51933,1,0), +(51942,1,0), +(51959,1,0), +(51964,1,0), +(51965,1,0), +(52011,1,0), +(52037,1,0), +(52059,1,0), +(52064,1,0), +(52089,1,0), +(52106,1,0), +(52122,1,0), +(52124,1,0), +(52140,1,0), +(52151,1,0), +(52164,1,0), +(52170,1,0), +(52173,1,0), +(52185,1,0), +(52227,1,0), +(52229,1,0), +(52238,1,0), +(52239,1,0), +(52242,1,0), +(52247,1,0), +(52254,1,0), +(52257,1,0), +(52259,1,0), +(52264,1,0), +(52294,1,0), +(52313,1,0), +(52322,1,0), +(52335,1,0), +(52336,1,0), +(52337,1,1), +(52340,1,0), +(52343,1,0), +(52349,1,0), +(52365,1,1), +(52369,1,0), +(52371,1,0), +(52381,1,0), +(52387,1,0), +(52388,1,0), +(52407,1,0), +(52412,1,0), +(52414,1,0), +(52427,1,0), +(52438,1,0), +(52446,1,0), +(52449,1,0), +(52452,1,0), +(52453,1,0), +(52454,1,0), +(52457,1,0), +(52458,1,0), +(52512,1,0), +(52514,1,0), +(52528,1,0), +(52576,1,0), +(52577,1,0), +(52585,1,0), +(52607,1,0), +(52632,1,0), +(52638,1,0), +(52654,1,0), +(52661,1,0), +(52676,1,0), +(52681,1,0), +(52686,1,0), +(52687,1,0), +(52688,1,0), +(52725,1,0), +(52726,1,0), +(52727,1,0), +(52728,1,0), +(52729,1,0), +(52730,1,0), +(52731,1,0), +(52732,1,0), +(52774,1,0), +(52791,1,0), +(52793,1,0), +(52805,1,0), +(52811,1,0), +(52816,1,0), +(52833,1,0), +(52834,1,0), +(52837,1,0), +(52838,1,0), +(52844,1,0), +(52850,1,0), +(52884,1,0), +(52908,1,0), +(52920,1,0), +(52930,1,0), +(52934,1,0), +(52935,1,0), +(52936,1,0), +(52937,1,0), +(52953,1,0), +(52955,1,0), +(52956,1,0), +(52981,1,0), +(52989,1,0), +(52990,1,0), +(53010,1,0), +(53020,1,0), +(53024,1,0), +(53029,1,0), +(53038,1,0), +(53083,1,0), +(53093,1,0), +(53096,1,0), +(53106,1,0), +(53110,1,0), +(53163,1,0), +(53170,1,0), +(53177,1,0), +(53185,1,0), +(53206,1,0), +(53210,1,0), +(53242,1,1), +(53272,1,0), +(53441,1,0), +(53464,1,0), +(53465,1,0), +(53466,1,0), +(53570,1,0), +(53609,1,0), +(53613,1,0), +(53626,1,0), +(53644,1,0), +(53680,1,0), +(53683,1,0), +(53684,1,0), +(53685,1,0), +(53701,1,0), +(53714,1,1), +(53717,1,0), +(53730,1,0), +(53745,1,0), +(53757,1,1), +(53778,1,0), +(53798,1,0), +(53826,1,0), +(53827,1,0), +(53828,1,0), +(53829,1,0), +(54040,1,0), +(54047,1,0), +(54089,1,0), +(54090,1,0), +(54097,1,0), +(54108,1,0), +(54112,1,0), +(54128,1,0), +(54142,1,0), +(54209,1,0), +(54236,1,0), +(54245,1,0), +(54250,1,0), +(54258,1,0), +(54264,1,0), +(54265,1,0), +(54266,1,0), +(54267,1,0), +(54269,1,0), +(54323,1,0), +(54325,1,0), +(54327,1,0), +(54328,1,0), +(54377,1,0), +(54423,1,0), +(54426,1,0), +(54430,1,0), +(54464,1,0), +(54510,1,0), +(54522,1,0), +(54539,1,0), +(54548,1,0), +(54643,1,0), +(54656,1,0), +(54664,1,0), +(54685,1,0), +(54699,1,1), +(54725,1,1), +(54728,1,0), +(54744,1,1), +(54746,1,1), +(54773,1,0), +(54796,1,0), +(54798,1,0), +(54806,1,0), +(54878,1,0), +(54899,1,0), +(54984,1,0), +(54985,1,0), +(54988,1,0), +(54991,1,0), +(55063,1,0), +(55089,1,0), +(55127,1,0), +(55134,1,0), +(55137,1,0), +(55138,1,0), +(55141,1,0), +(55145,1,0), +(55161,1,0), +(55223,1,0), +(55227,1,0), +(55229,1,0), +(55231,1,0), +(55244,1,0), +(55257,1,0), +(55287,1,0), +(55288,1,0), +(55290,1,0), +(55406,1,0), +(55418,1,0), +(55419,1,0), +(55423,1,1), +(55432,1,0), +(55465,1,0), +(55468,1,0), +(55510,1,0), +(55516,1,0), +(55519,1,0), +(55524,1,0), +(55526,1,0), +(55527,1,0), +(55571,1,0), +(55578,1,0), +(55616,1,1), +(55647,1,0), +(55660,1,0), +(55661,1,0), +(55662,1,0), +(55693,1,0), +(55720,1,0), +(55721,1,0), +(55722,1,0), +(55723,1,0), +(55724,1,0), +(55725,1,0), +(55726,1,0), +(55727,1,0), +(55785,1,0), +(55796,1,0), +(55801,1,0), +(55803,1,0), +(55805,1,0), +(55811,1,0), +(55844,1,0), +(55853,1,0), +(55868,1,0), +(55872,1,0), +(55875,1,0), +(55878,1,1), +(55881,1,1), +(55882,1,0), +(55885,1,1), +(55886,1,0), +(55887,1,1), +(55888,1,0), +(55954,1,0), +(56047,1,0), +(56066,1,0), +(56099,1,0), +(56103,1,0), +(56114,1,0), +(56117,1,0), +(56150,1,0), +(56152,1,0), +(56189,1,0), +(56227,1,0), +(56253,1,0), +(56263,1,0), +(56264,1,0), +(56265,1,0), +(56266,1,0), +(56275,1,0), +(56312,1,0), +(56387,1,0), +(56388,1,0), +(56393,1,0), +(56429,1,0), +(56458,1,0), +(56505,1,0), +(56523,1,0), +(56560,1,0), +(56563,1,0), +(56567,1,0), +(56575,1,0), +(56621,1,0), +(56622,1,0), +(56652,1,0), +(56661,1,0), +(56663,1,0), +(56665,1,0), +(56667,1,0), +(56669,1,0), +(56673,1,0), +(56677,1,0), +(56680,1,0), +(56683,1,0), +(56688,1,0), +(56691,1,0), +(56693,1,0), +(56695,1,0), +(56696,1,0), +(56711,1,0), +(56713,1,0), +(56722,1,0), +(56723,1,0), +(56724,1,0), +(56725,1,0), +(56738,1,0), +(56763,1,0), +(56764,1,0), +(56865,1,0), +(56905,1,0), +(56917,1,0), +(56941,1,1), +(57042,1,0), +(57068,1,0), +(57071,1,0), +(57072,1,0), +(57410,1,0), +(57417,1,0), +(57420,1,0), +(57422,1,0), +(57469,1,0), +(57471,1,0), +(57495,1,0), +(57523,1,0), +(57534,1,0), +(57632,1,0), +(57637,1,0), +(57638,1,0), +(57639,1,0), +(57642,1,0), +(57650,1,0), +(57659,1,0), +(57666,1,0), +(57667,1,0), +(57682,1,0), +(57732,1,0), +(57734,1,0), +(57735,1,0), +(57736,1,0), +(57737,1,0), +(57738,1,0), +(57797,1,0), +(57806,1,0), +(57809,1,0), +(57828,1,0), +(57852,1,0), +(57853,1,0), +(57885,1,0), +(57891,1,0), +(57912,1,0), +(57930,1,0), +(57962,1,0), +(57963,1,0), +(57980,1,0), +(57983,1,0), +(58036,1,0), +(58040,1,0), +(58064,1,0), +(58084,1,0), +(58103,1,0), +(58108,1,0), +(58109,1,0), +(58112,1,0), +(58114,1,0), +(58121,1,0), +(58123,1,0), +(58124,1,0), +(58131,1,0), +(58152,1,0), +(58178,1,0), +(58195,1,1), +(58196,1,1), +(58197,1,1), +(58198,1,1), +(58225,1,0), +(58350,1,0), +(58416,1,0), +(58493,1,1), +(58515,1,0), +(58533,1,0), +(58542,1,0), +(58552,1,0), +(58593,1,0), +(58641,1,0), +(58658,1,0), +(58672,1,0), +(58685,1,0), +(58793,1,0), +(58836,1,0), +(58838,1,0), +(58846,1,1), +(58858,1,0), +(58873,1,0), +(58916,1,0), +(58917,1,0), +(58945,1,0), +(58949,1,0), +(59078,1,0), +(59091,1,0), +(59098,1,0), +(59115,1,0), +(59125,1,0), +(59189,1,0), +(59190,1,0), +(59284,1,0), +(59335,1,0), +(59363,1,0), +(59375,1,0), +(59383,1,0), +(59386,1,0), +(59396,1,0), +(59449,1,0), +(59456,1,0), +(59461,1,1), +(59528,1,0), +(59534,1,0), +(59552,1,0), +(59554,1,0), +(59556,1,1), +(59579,1,0), +(59595,1,0), +(59643,1,0), +(59655,1,0), +(59668,1,0), +(59677,1,0), +(59678,1,0), +(59704,1,0), +(59729,1,0), +(59730,1,0), +(59764,1,0), +(59780,1,0), +(59781,1,0), +(59807,1,0), +(59847,1,0), +(59867,1,0), +(59871,1,0), +(59897,1,0), +(59925,1,0), +(59930,1,0), +(59951,1,0), +(59952,1,0), +(59977,1,0), +(60038,1,0), +(60045,1,0), +(60046,1,0), +(60088,1,0), +(60104,1,0), +(60178,1,1), +(60207,1,0), +(60208,1,0), +(60224,1,0), +(60243,1,0), +(60256,1,0), +(60285,1,0), +(60288,1,0), +(60291,1,1), +(60292,1,1), +(60293,1,1), +(60294,1,1), +(60295,1,1), +(60296,1,1), +(60297,1,1), +(60298,1,0), +(60310,1,0), +(60315,1,0), +(60316,1,0), +(60342,1,0), +(60422,1,0), +(60456,1,0), +(60476,1,1), +(60496,1,0), +(60499,1,1), +(60507,1,1), +(60508,1,1), +(60511,1,0), +(60516,1,0), +(60522,1,1), +(60528,1,0), +(60535,1,0), +(60536,1,0), +(60561,1,0), +(60612,1,0), +(60614,1,0), +(60713,1,0), +(60810,1,0), +(60829,1,0), +(60831,1,0), +(60834,1,0), +(60836,1,0), +(60863,1,0), +(60909,1,0), +(60912,1,1), +(60967,1,0), +(61007,1,0), +(61026,1,0), +(61028,1,0), +(61071,1,0), +(61072,1,0), +(61073,1,0), +(61074,1,0), +(61075,1,0), +(61114,1,0), +(61121,1,0), +(61151,1,0), +(61152,1,0), +(61180,1,0), +(61210,1,0), +(61219,1,0), +(61245,1,0), +(61254,1,0), +(61353,1,0), +(61355,1,0), +(61397,1,0), +(61408,1,0), +(61416,1,0), +(61487,1,0), +(61488,1,0), +(61492,1,0), +(61524,1,0), +(61537,1,0), +(61588,1,0), +(61602,1,0), +(61647,1,0), +(61652,1,0), +(61665,1,0), +(61710,1,0), +(61738,1,0), +(61764,1,0), +(61765,1,0), +(61766,1,0), +(61771,1,0), +(61816,1,1), +(61863,1,1), +(61901,1,0), +(61934,1,0), +(61942,1,0), +(61964,1,0), +(61975,1,0), +(62002,1,0), +(62016,1,0), +(62034,1,0), +(62037,1,1), +(62072,1,0), +(62082,1,0), +(62083,1,0), +(62084,1,0), +(62091,1,0), +(62102,1,0), +(62195,1,0), +(62223,1,0), +(62266,1,0), +(62272,1,0), +(62278,1,0), +(62284,1,0), +(62304,1,0), +(62323,1,0), +(62343,1,0), +(47129,2,0), +(34395,2,0), +(34387,2,0), +(32440,2,0), +(32439,2,0), +(32205,2,0), +(31538,2,0), +(30740,2,0), +(29831,2,0), +(28806,2,0), +(28353,2,0), +(27517,2,0), +(27203,2,0), +(27202,2,0), +(27201,2,0), +(27191,2,0), +(27190,2,0), +(27184,2,0), +(26560,2,0), +(26063,2,0), +(25005,2,0), +(24934,2,0), +(24871,2,0), +(24721,2,0), +(24390,2,0), +(23208,2,0), +(21127,2,0), +(18431,2,0), +(17731,2,0), +(17016,2,0), +(16613,2,0), +(16447,2,0), +(13489,2,0), +(12139,2,0), +(11792,2,0), +(9224,2,0), +(9223,2,0), +(9222,2,0), +(9221,2,0), +(8674,2,0), +(7729,2,0), +(7728,2,0), +(3921,2,0), +(35683,2,0), +(36066,2,0), +(36546,2,0), +(36851,2,0), +(37754,2,0), +(38439,2,0), +(38782,2,0), +(39050,2,0), +(40055,2,0), +(40165,2,0), +(40166,2,0), +(40167,2,0), +(40328,2,0), +(40447,2,0), +(40468,2,0), +(40632,2,0), +(40640,2,0), +(40642,2,0), +(40644,2,0), +(40675,2,0), +(40774,2,0), +(40785,2,0), +(40964,2,0), +(40965,2,0), +(40968,2,0), +(40970,2,0), +(41004,2,0), +(41145,2,0), +(41146,2,0), +(42020,2,0), +(42022,2,0), +(42323,2,0), +(42788,2,0), +(43418,2,0), +(43552,2,0), +(43723,2,0), +(43753,2,0), +(43768,2,0), +(43950,2,0), +(44307,2,0), +(44498,2,0), +(44499,2,0), +(44611,2,0), +(44686,2,0), +(44874,2,0), +(44885,2,0), +(45149,2,0), +(45222,2,0), +(45226,2,0), +(45795,2,0), +(45877,2,0), +(45971,2,0), +(46072,2,0), +(46350,2,0), +(46360,2,1), +(46584,2,0), +(76006,2,0), +(74179,2,0), +(72869,2,0), +(72868,2,0), +(72608,2,0), +(72456,2,0), +(72405,2,0), +(72340,2,1), +(71284,2,1), +(70598,2,1), +(70446,2,1), +(70346,2,0), +(70227,2,0), +(70199,2,0), +(70175,2,0), +(70173,2,0), +(69402,2,0), +(69400,2,0), +(69294,2,0), +(69157,2,0), +(67815,2,0), +(67814,2,0), +(67813,2,0), +(67812,2,0), +(67798,2,0), +(67459,2,0), +(67458,2,0), +(67448,2,0), +(67439,2,0), +(67436,2,0), +(66676,2,0), +(66672,2,0), +(66655,2,0), +(66531,2,0), +(66289,2,0), +(65209,2,0), +(64871,2,0), +(64570,2,0), +(64436,2,0), +(63618,2,0), +(63381,2,0), +(62776,2,0), +(62714,2,0), +(62635,2,0), +(62397,2,0), +(62363,2,0), +(62357,2,0), +(62355,2,0), +(62307,2,0), +(62086,2,0), +(61999,2,1), +(60289,2,0), +(60101,2,0), +(59790,2,0), +(59732,2,0), +(59576,2,0), +(58596,2,0), +(58231,2,0), +(57945,2,0), +(57619,2,0), +(57610,2,0), +(57607,2,0), +(57583,2,0), +(57575,2,0), +(57544,2,0), +(57517,2,0), +(57415,2,0), +(56790,2,0), +(56570,2,0), +(56385,2,0), +(56350,2,0), +(55934,2,0), +(55820,2,0), +(55367,2,0), +(55197,2,0), +(54712,2,0), +(54666,2,0), +(54530,2,0), +(52510,2,0), +(52408,2,0), +(52339,2,0), +(52277,2,0), +(52274,2,0), +(52115,2,0), +(51383,2,0), +(51328,2,0), +(51327,2,0), +(51326,2,0), +(51325,2,0), +(51241,2,0), +(50999,2,0), +(50319,2,0), +(50026,2,0), +(50003,2,0), +(49867,2,0), +(49860,2,0), +(49765,2,0), +(49728,2,0), +(49693,2,0), +(49689,2,0), +(49158,2,0), +(49123,2,0), +(49109,2,0), +(48794,2,0), +(48738,2,0), +(48347,2,0), +(47978,2,0), +(35246,2,0), +(42576,3,0), +(42492,3,0), +(42475,3,0), +(42433,3,0), +(42350,3,0), +(42348,3,0), +(42242,3,1), +(42228,3,0), +(42220,3,0), +(42114,3,0), +(41221,3,0), +(40961,3,0), +(40960,3,0), +(40959,3,0), +(40957,3,0), +(40885,3,0), +(40603,3,0), +(40495,3,0), +(40401,3,0), +(40380,3,0), +(40341,3,0), +(40307,3,0), +(40286,3,0), +(40285,3,0), +(40284,3,0), +(40283,3,0), +(40268,3,0), +(40247,3,0), +(40246,3,0), +(40245,3,0), +(40244,3,0), +(40240,3,0), +(40222,3,0), +(40179,3,0), +(40178,3,0), +(40177,3,0), +(40176,3,0), +(40105,3,0), +(40076,3,0), +(39932,3,0), +(39887,3,0), +(39844,3,0), +(39832,3,1), +(39831,3,0), +(39558,3,0), +(39401,3,0), +(39399,3,0), +(39398,3,0), +(39393,3,0), +(39384,3,0), +(39364,3,0), +(38866,3,0), +(38680,3,0), +(38173,3,0), +(38046,3,0), +(38044,3,0), +(37970,3,0), +(37954,3,0), +(37942,3,0), +(37919,3,0), +(37913,3,0), +(37793,3,1), +(37789,3,0), +(37750,3,1), +(37504,3,0), +(37489,3,0), +(37473,3,1), +(37366,3,0), +(37134,3,0), +(36821,3,0), +(36811,3,0), +(36450,3,0), +(36449,3,1), +(36325,3,0), +(35958,3,0), +(35776,3,0), +(35734,3,0), +(35599,3,0), +(35596,3,0), +(34303,3,0), +(34200,3,0), +(34186,3,0), +(42578,3,0), +(33814,3,0), +(33783,3,0), +(33670,3,0), +(33664,3,0), +(33365,3,0), +(33240,3,0), +(33111,3,0), +(32785,3,0), +(32314,3,0), +(32307,3,0), +(32241,3,0), +(32148,3,0), +(32067,3,0), +(31927,3,0), +(31543,3,0), +(31364,3,0), +(31363,3,0), +(31333,3,0), +(30758,3,0), +(30741,3,0), +(30284,3,0), +(29945,3,0), +(29866,3,0), +(29820,3,1), +(29460,3,0), +(28373,3,0), +(28250,3,0), +(28054,3,0), +(26521,3,0), +(26519,3,0), +(26518,3,0), +(26517,3,0), +(26516,3,0), +(26490,3,0), +(26488,3,0), +(26393,3,1), +(26373,3,0), +(26338,3,0), +(26337,3,0), +(26336,3,0), +(26335,3,0), +(26334,3,0), +(26333,3,0), +(26329,3,0), +(26328,3,0), +(26327,3,0), +(26326,3,0), +(26325,3,0), +(26304,3,0), +(26295,3,0), +(26294,3,0), +(26293,3,0), +(26292,3,0), +(26291,3,0), +(26286,3,0), +(25687,3,0), +(25183,3,0), +(25181,3,0), +(25180,3,0), +(25178,3,0), +(25177,3,0), +(24973,3,0), +(24731,3,0), +(23024,3,0), +(21086,3,0), +(21014,3,0), +(20038,3,0), +(20037,3,0), +(19873,3,0), +(17179,3,0), +(16629,3,0), +(16452,3,0), +(16337,3,0), +(15998,3,0), +(13488,3,0), +(12151,3,0), +(10860,3,0), +(10836,3,0), +(10835,3,0), +(10834,3,0), +(10805,3,0), +(9257,3,0), +(9232,3,0), +(42868,3,0), +(43233,3,0), +(43539,3,0), +(43664,3,0), +(43898,3,0), +(43954,3,0), +(43963,3,0), +(43986,3,0), +(44013,3,0), +(44132,3,0), +(44213,3,0), +(44249,3,0), +(44320,3,0), +(44321,3,0), +(44375,3,0), +(44465,3,0), +(44554,3,0), +(44565,3,0), +(44603,3,0), +(44678,3,0), +(44844,3,0), +(44884,3,0), +(45030,3,0), +(45050,3,1), +(45201,3,0), +(45203,3,0), +(45404,3,0), +(45502,3,0), +(45585,3,0), +(45633,3,0), +(45635,3,0), +(45653,3,0), +(45839,3,0), +(45885,3,1), +(46417,3,0), +(46574,3,0), +(46638,3,1), +(46852,3,0), +(46896,3,0), +(47030,3,1), +(47328,3,0), +(47510,3,0), +(47628,3,0), +(47745,3,0), +(47775,3,1), +(47800,3,0), +(48198,3,0), +(48212,3,0), +(48331,3,0), +(48431,3,0), +(48882,3,0), +(48972,3,0), +(49197,3,0), +(49300,3,0), +(49308,3,0), +(49453,3,0), +(49735,3,0), +(50313,3,1), +(50348,3,0), +(50443,3,0), +(50501,3,0), +(50626,3,0), +(50639,3,0), +(50640,3,0), +(50716,3,0), +(50790,3,0), +(50791,3,0), +(50802,3,0), +(50803,3,0), +(50825,3,0), +(50826,3,0), +(51212,3,0), +(51246,3,0), +(51395,3,0), +(51511,3,0), +(51742,3,0), +(51748,3,0), +(51805,3,0), +(51846,3,0), +(52067,3,1), +(52271,3,0), +(52305,3,0), +(52479,3,0), +(52480,3,0), +(52497,3,0), +(52603,3,0), +(52683,3,0), +(52685,3,0), +(52812,3,0), +(53677,3,0), +(53679,3,0), +(53694,3,0), +(53705,3,0), +(53706,3,0), +(54272,3,0), +(54517,3,0), +(54914,3,0), +(54961,3,0), +(54990,3,0), +(55037,3,0), +(55083,3,0), +(55365,3,0), +(55479,3,0), +(55715,3,0), +(55800,3,0), +(55889,3,1), +(56095,3,0), +(56140,3,0), +(56386,3,0), +(56389,3,0), +(56578,3,0), +(56747,3,0), +(56765,3,0), +(57586,3,0), +(57800,3,0), +(57824,3,0), +(57835,3,0), +(58766,3,0), +(58825,3,0), +(59008,3,0), +(59462,3,0), +(59464,3,0), +(59564,3,0), +(59629,3,0), +(59694,3,0), +(60639,3,0), +(61126,3,0), +(61224,3,0), +(61699,3,0), +(62000,3,0), +(62056,3,0), +(62385,3,0), +(62387,3,0), +(62399,3,0), +(62565,3,0), +(62709,3,0), +(62973,3,0), +(62991,3,0), +(63019,3,0), +(63122,3,1), +(63292,3,0), +(63294,3,0), +(63295,3,0), +(63317,3,0), +(63414,3,0), +(63528,3,0), +(63766,3,0), +(63983,3,0), +(63985,3,0), +(64021,3,0), +(65044,3,0), +(65045,3,0), +(65101,3,0), +(65585,3,0), +(65586,3,0), +(65690,3,0), +(66129,3,0), +(66170,3,0), +(66598,3,0), +(67398,3,0), +(68378,3,0), +(68902,3,0), +(69007,3,0), +(69095,3,0), +(69096,3,0), +(69708,3,0), +(69783,3,0), +(69797,3,0), +(69799,3,0), +(69802,3,0), +(69985,3,0), +(70028,3,0), +(70037,3,0), +(70194,3,0), +(70521,3,0), +(70564,3,0), +(70590,3,0), +(70997,3,0), +(70998,3,0), +(70999,3,0), +(71278,3,1), +(71621,3,0), +(71704,3,0), +(72155,3,1), +(72162,3,1), +(72274,3,1), +(72297,3,1), +(72460,3,1), +(72548,3,1), +(72549,3,1), +(72550,3,1), +(72619,3,1), +(72620,3,1), +(72679,3,0), +(72771,3,0), +(72850,3,0), +(72851,3,0), +(72852,3,0), +(74318,3,0), +(74319,3,0), +(74320,3,0), +(74472,3,0), +(75509,3,0), +(75553,3,1), +(75766,3,1), +(34012,3,0), +(74271,4,0), +(74270,4,0), +(72096,4,1), +(72034,4,1), +(71615,4,0), +(70827,4,0), +(69425,4,0), +(69164,4,0), +(69162,4,0), +(68981,4,0), +(68788,4,1), +(67816,4,0), +(67796,4,0), +(65370,4,0), +(65333,4,0), +(64626,4,0), +(62826,4,0), +(62489,4,0), +(62466,4,0), +(62457,4,0), +(62345,4,0), +(62308,4,0), +(60206,4,0), +(58185,4,0), +(55896,4,0), +(55349,4,0), +(54109,4,0), +(54107,4,0), +(51678,4,0), +(50652,4,0), +(49556,4,0), +(48610,4,0), +(48277,4,0), +(48224,4,0), +(47674,4,0), +(47109,4,0), +(45922,4,0), +(44969,4,0), +(44737,4,0), +(44687,4,0), +(44626,4,0), +(44233,4,0), +(40647,4,0), +(40259,4,0), +(39246,4,0), +(36904,4,0), +(36460,4,0), +(36374,4,0), +(30532,4,0), +(28995,4,0), +(10451,4,0), +(9735,4,0), +(8900,4,0), +(8899,4,0), +(8898,4,0), +(8202,4,0), +(74272,4,0), +(69767,5,0), +(65590,5,0), +(62386,5,0), +(55588,5,0), +(54713,5,0), +(49464,5,0), +(49460,5,0), +(49346,5,0), +(47310,5,1), +(45676,5,0), +(44217,5,0), +(43977,5,0), +(41962,5,0), +(40789,5,0), +(40503,5,0), +(38729,5,0), +(38312,5,0), +(38106,5,0), +(38105,5,0), +(38104,5,0), +(38103,5,0), +(38102,5,0), +(38101,5,0), +(38100,5,0), +(38099,5,0), +(37206,5,0), +(37205,5,0), +(37204,5,0), +(36817,5,0), +(34630,5,0), +(21866,5,0), +(21794,5,0), +(19832,5,0), +(19250,5,0), +(8913,5,0), +(67308,6,0), +(67307,6,0), +(67306,6,0), +(67305,6,0), +(67304,6,0), +(67303,6,0), +(65876,6,0), +(65875,6,0), +(63041,6,0), +(62560,6,0), +(59099,6,1), +(44608,6,0), +(43702,6,0), +(43080,6,0), +(43056,6,0), +(40902,6,0), +(40657,6,0), +(28803,6,1), +(16054,6,0), +(8712,6,0), +(75863,7,1), +(75448,7,1), +(74412,7,1), +(74323,7,0), +(74322,7,0), +(74321,7,0), +(73028,7,0), +(72622,7,1), +(72621,7,1), +(72459,7,1), +(72273,7,0), +(72272,7,0), +(71618,7,0), +(71614,7,0), +(71279,7,1), +(70982,7,0), +(70981,7,0), +(70952,7,0), +(69540,7,0), +(67751,7,0), +(66905,7,0), +(66667,7,0), +(65126,7,0), +(64218,7,0), +(63059,7,0), +(62942,7,0), +(62705,7,0), +(61920,7,0), +(61715,7,0), +(61714,7,0), +(61632,7,0), +(60532,7,0), +(60430,7,0), +(59474,7,0), +(59465,7,0), +(57409,7,0), +(57405,7,0), +(57056,7,1), +(56694,7,0), +(56454,7,0), +(54160,7,0), +(53605,7,0), +(52319,7,0), +(51719,7,0), +(50747,7,0), +(50646,7,0), +(50645,7,0), +(50627,7,0), +(50218,7,0), +(49889,7,0), +(48742,7,0), +(48552,7,0), +(46158,7,0), +(42287,7,0), +(42265,7,1), +(42079,7,0), +(42004,7,1), +(41284,7,0), +(41113,7,0), +(41112,7,0), +(41111,7,0), +(41110,7,0), +(41071,7,0), +(41064,7,1), +(40931,7,0), +(40929,7,0), +(40905,7,0), +(40900,7,0), +(40851,7,0), +(40370,7,0), +(40172,7,0), +(40171,7,0), +(40170,7,0), +(40169,7,0), +(40075,7,1), +(39698,7,0), +(39686,7,0), +(39218,7,0), +(38920,7,0), +(38774,7,0), +(38484,7,0), +(38449,7,0), +(38371,7,0), +(37076,7,0), +(35957,7,1), +(35754,7,0), +(35289,7,0), +(34350,7,0), +(34187,7,0), +(31625,7,0), +(31624,7,0), +(31617,7,0), +(30939,7,1), +(30659,7,0), +(30657,7,0), +(30531,7,0), +(30098,7,0), +(28681,7,1), +(25790,7,0), +(25029,7,0), +(23015,7,0), +(22710,7,0), +(20553,7,0), +(10732,7,0), +(10348,7,0), +(7082,7,0), +(5628,7,0), +(804,7,0), +(802,7,0), +(54069,1,0), +(56251,1,0), +(58630,1,0); + +-- remove redundant entries +DELETE FROM `conditions` WHERE `ConditionTypeOrReference` = 18 AND `ConditionValue1` = 1 AND `ConditionValue2` = 0 AND `SourceEntry` IN (SELECT `id` FROM `temp_convert_spells` WHERE onlyPlayers); + +-- set source group if available in db +UPDATE `conditions` SET `SourceGroup` = `ConditionValue3`, `ConditionValue3` = 0 WHERE `ConditionTypeOrReference` = 18; + +-- set source group in case of old default (not set) source group +UPDATE `conditions` SET `SourceGroup` = (SELECT `effMask` FROM `temp_convert_spells` WHERE `id` = `SourceEntry`) WHERE `SourceGroup` = 0 AND `ConditionTypeOrReference` = 18; + +CREATE TABLE `temp_cond_vals` +( + `sourceGroup` INT(11), + `sourceEntry` INT(11), + `conditionValue1` INT(11), + `conditionValue2` INT(11), + `elseGroup` INT(11) AUTO_INCREMENT, + PRIMARY KEY (`sourceGroup`, `sourceEntry`, `elseGroup`) +) ENGINE=MYISAM; + +INSERT INTO `temp_cond_vals` (`sourceGroup`, `sourceEntry`, `conditionValue1`, `conditionValue2`) SELECT `SourceGroup`, `SourceEntry`, `ConditionValue1`, `ConditionValue2` FROM `conditions` WHERE `ConditionTypeOrReference` = 18; + +-- set correct else group +UPDATE `conditions` SET `ElseGroup` = (SELECT `elseGroup` FROM `temp_cond_vals` WHERE `sourceGroup` = `conditions`.`SourceGroup` AND `sourceEntry` = `conditions`.`SourceEntry` AND `conditionValue1` = `conditions`.`ConditionValue1` AND `conditionValue2` = `conditions`.`ConditionValue2`)-1 WHERE `ConditionTypeOrReference` = 18; + +-- old condition type 3 (caster's minion) +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`) +SELECT `SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `ElseGroup`, 33, 0, 1, 3 FROM `conditions` WHERE `ConditionTypeOrReference` = 18 AND `ConditionValue1` = 3; + +UPDATE `conditions` SET `ConditionTypeOrReference` = 31 WHERE `ConditionTypeOrReference` = 18 AND `ConditionValue1` = 3; + +-- old condition type 2 (dead creature) +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `NegativeCondition`) +SELECT `SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `ElseGroup`, 36, 0, 0, 0, 1 FROM `conditions` WHERE `ConditionTypeOrReference` = 18 AND `ConditionValue1` = 2; + +UPDATE `conditions` SET `ConditionTypeOrReference` = 31, `ConditionValue1` = 3 WHERE `ConditionTypeOrReference` = 18 AND `ConditionValue1` = 2; + +-- old condition type 1 (creature) +UPDATE `conditions` SET `ConditionTypeOrReference` = 31, `ConditionValue1` = 3 WHERE `ConditionTypeOrReference` = 18 AND `ConditionValue1` = 1 AND `ConditionValue2`; + +-- old condition type 1 (player) +UPDATE `conditions` SET `ConditionTypeOrReference` = 32, `ConditionValue1` = 0x90 WHERE `ConditionTypeOrReference` = 18 AND `ConditionValue1` = 1 AND NOT `ConditionValue2`; + +-- old condition type 0 (gameobject) +UPDATE `conditions` SET `ConditionTypeOrReference` = 31, `ConditionValue1` = 5 WHERE `ConditionTypeOrReference` = 18 AND `ConditionValue1` = 0; + +DROP TABLE `temp_convert_spells`; +DROP TABLE `temp_cond_vals`; diff --git a/sql/old/3.3.5a/2012_02_21_02_world_creature_loot_template.sql b/sql/old/3.3.5a/2012_02_21_02_world_creature_loot_template.sql new file mode 100644 index 00000000000..6c6af7ed2a3 --- /dev/null +++ b/sql/old/3.3.5a/2012_02_21_02_world_creature_loot_template.sql @@ -0,0 +1,11 @@ +UPDATE `creature_template` SET `lootid`=`entry` WHERE `entry` IN (38032,37917,38016,38023,37214,38030,38006,37984); +DELETE FROM `creature_loot_template` WHERE `entry`IN (38032,37917,38016,38023,37214,38030,38006,37984); +INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES +(38032,1,100,1,0,-45009,1), -- Crown Sprayer +(37917,1,100,1,0,-45009,1), -- Crown Thug +(38016,1,100,1,0,-45009,1), -- Crown Agent +(38023,1,100,1,0,-45009,1), -- Crown Sprinkler +(37214,1,100,1,0,-45009,1), -- Crown Lackey +(38030,1,100,1,0,-45009,1), -- Crown Underling +(38006,1,100,1,0,-45009,1), -- Crown Hoodlum (level 1??) +(37984,1,100,1,0,-45009,1); -- Crown Duster (level 1??) diff --git a/sql/old/3.3.5a/2012_02_21_03_world_creature_loot_template.sql b/sql/old/3.3.5a/2012_02_21_03_world_creature_loot_template.sql new file mode 100644 index 00000000000..d7d043cbda9 --- /dev/null +++ b/sql/old/3.3.5a/2012_02_21_03_world_creature_loot_template.sql @@ -0,0 +1,26 @@ +-- Razormane Hunter Warrior's Boots 32% to 3.2% +UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=3.2996 WHERE `entry`=3265 AND `item`=2967; +-- Razormane Hunter Hunting Cloak 11% to 1.1% +UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=1.1855 WHERE `entry`=3265 AND `item`=4689; +-- Razormane Defender Pioneer Buckler 87% to 0.8% +UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=0.8789 WHERE `entry`=3266 AND `item`=7109; +-- Razormane Defender Spellbinder Belt 77% to 0.7% +UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=0.7717 WHERE `entry`=3266 AND `item`=4684; +-- Razormane Geomancer Simple Shoes 77% to 0.7% +UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=0.7791 WHERE `entry`=3269 AND `item`=9743; +-- Razormane Geomancer Veteran Bracers 73% to 0.7% +UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=0.7364 WHERE `entry`=3269 AND `item`=3213; +-- Venture Co. Supervisor Burnt Leather Belt 85% to 0.8% +UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=0.8511 WHERE `entry`=2979 AND `item`=4666; +-- Venture Co. Supervisor Warrior's Gloves 74% to 0.7% +UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=0.7433 WHERE `entry`=2979 AND `item`=2968; +-- Venture Co. Supervisor Pioneer Bracers 55% to 0.5% +UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=0.5593 WHERE `entry`=2979 AND `item`=6519; +-- Venture Co. Supervisor Journeyman's Gloves 43% to 0.4% +UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=0.4348 WHERE `entry`=2979 AND `item`=2960; +-- Venture Co. Worker Warrior's Bracers 72% to 0.7% +UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=0.7226 WHERE `entry`=2978 AND `item`=3214; +-- Venture Co. Worker Fine Scimitar 64% to 0.6% +UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=0.6492 WHERE `entry`=2978 AND `item`=4560; +-- Venture Co. Worker Warrior's Girdle 24% to 0.2% +UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=0.2458 WHERE `entry`=2978 AND `item`=4659; diff --git a/sql/old/3.3.5a/2012_02_21_04_world_creature_loot_template.sql b/sql/old/3.3.5a/2012_02_21_04_world_creature_loot_template.sql new file mode 100644 index 00000000000..3deedbf0b0d --- /dev/null +++ b/sql/old/3.3.5a/2012_02_21_04_world_creature_loot_template.sql @@ -0,0 +1,16 @@ +SET @ENTRY := 30409; -- Apprentice Osterkilgr +DELETE FROM `creature_loot_template` WHERE entry=@ENTRY; +INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- Quest related Items +(@ENTRY,43089,-100,1,0,1,1), -- Vrykul Bones +(@ENTRY,42772,-100,1,0,1,1), -- Dr Terrible's "Building a Better Flesh Giant" +(@ENTRY,42422,-50,1,0,1,1), -- Jotunheim Cage Key +-- Other random stuff +(@ENTRY,33470,20,1,0,1,4), -- Frostweave Cloth +(@ENTRY,43851,20,1,0,1,1), -- Fur Clothing Scraps +(@ENTRY,43852,20,1,0,1,1), -- Thick Fur Clothing Scraps +-- References for world drops +(@ENTRY,1,10,1,0,-35063,1), -- Northrend Grey Items +(@ENTRY,2,5,1,0,-35066,1), -- Northrend Green Items +-- hatebook +(@ENTRY,45912,0.1,1,0,1,1); -- Book Glyph of Mastery (honestly screw that thing) diff --git a/sql/old/3.3.5a/2012_02_21_05_world_gossip.sql b/sql/old/3.3.5a/2012_02_21_05_world_gossip.sql new file mode 100644 index 00000000000..1bdccae5c39 --- /dev/null +++ b/sql/old/3.3.5a/2012_02_21_05_world_gossip.sql @@ -0,0 +1,39 @@ +-- SAI for Lothos Riftwaker +SET @ENTRY=14387; +UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE (`entryorguid`=@ENTRY AND `source_type`=0); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,1,62,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Lothos Riftwaker - On Gossip Option select - close gossip'), +(@ENTRY,0,1,0,61,0,100,0,5750,0,0,0,62,409,0,0,0,0,0,7,0,0,0,1096,-467,-104.6,3.64,'Lothos Riftwaker - On Gossip Option select - teleport player'); + +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (5750); +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(5750,0,0,'Teleport me to the Molten Core, Lothos.',1,1,0,0,0,0,''); +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup` IN (5750); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,5750,0,0,0,8,7848,0,0,0,0,'','Show gossip option if player has quest 7848 completed'); + +-- SAI for Zamael Lunthistle +SET @ENTRY=8436; +UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE (`entryorguid`=@ENTRY AND `source_type`=0); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,1,62,0,100,0,1285,0,0,0,26,3377,0,0,0,0,0,7,0,0,0,0,0,0,0,'Zamael Lunthistle - On Gossip Option select - quest credit'), +(@ENTRY,0,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Zamael Lunthistle - On Gossip Option select - close gossip'); + +DELETE FROM `gossip_menu` WHERE `entry`=1285 AND `text_id`=1920; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (1285,1920); +DELETE FROM `gossip_menu` WHERE `entry`=1286 AND `text_id`=1922; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (1286,1922); +DELETE FROM `gossip_menu` WHERE `entry`=1287 AND `text_id`=1921; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (1287,1921); + +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (1285,1286,1287); +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(1285,0,0,'I wish to hear your tale.',1,1,1287,0,0,0,''), +(1286,0,0,'Let me think about it, Zamael.',1,1,1285,0,0,0,''), +(1287,0,0,'Please continue, Zamael.',1,1,1286,0,0,0,''); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup` IN (1285); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,1285,0,0,0,9,3377,0,0,0,0,'','Show gossip option if player has quest 3377 but not complete'); diff --git a/sql/old/3.3.5a/2012_02_21_06_world_Gossip.sql b/sql/old/3.3.5a/2012_02_21_06_world_Gossip.sql new file mode 100644 index 00000000000..a59d330c6a3 --- /dev/null +++ b/sql/old/3.3.5a/2012_02_21_06_world_Gossip.sql @@ -0,0 +1,184 @@ +-- Gossip Update from Pitcrawler +-- Creature Gossip_menu_id Update from sniff +UPDATE `creature_template` SET `gossip_menu_id`=7692 WHERE `entry`=18424; +UPDATE `creature_template` SET `gossip_menu_id`=9033 WHERE `entry`=24838; +UPDATE `creature_template` SET `gossip_menu_id`=9038 WHERE `entry`=24833; +UPDATE `creature_template` SET `gossip_menu_id`=9066 WHERE `entry`=25011; +UPDATE `creature_template` SET `gossip_menu_id`=9067 WHERE `entry`=25015; +UPDATE `creature_template` SET `gossip_menu_id`=9068 WHERE `entry`=25009; +UPDATE `creature_template` SET `gossip_menu_id`=9069 WHERE `entry`=25017; +UPDATE `creature_template` SET `gossip_menu_id`=9070 WHERE `entry`=25018; +UPDATE `creature_template` SET `gossip_menu_id`=9071 WHERE `entry`=25016; +UPDATE `creature_template` SET `gossip_menu_id`=9072 WHERE `entry` IN (25013,25014); +UPDATE `creature_template` SET `gossip_menu_id`=9091 WHERE `entry`=25076; +UPDATE `creature_template` SET `gossip_menu_id`=9107 WHERE `entry`=24929; +UPDATE `creature_template` SET `gossip_menu_id`=9109 WHERE `entry`=24927; +UPDATE `creature_template` SET `gossip_menu_id`=9110 WHERE `entry`=24924; +UPDATE `creature_template` SET `gossip_menu_id`=9116 WHERE `entry`=25105; +UPDATE `creature_template` SET `gossip_menu_id`=9117 WHERE `entry`=25100; +UPDATE `creature_template` SET `gossip_menu_id`=9118 WHERE `entry`=25104; +UPDATE `creature_template` SET `gossip_menu_id`=9120 WHERE `entry`=25107; +UPDATE `creature_template` SET `gossip_menu_id`=9121 WHERE `entry` IN (25101,25102,25103); +UPDATE `creature_template` SET `gossip_menu_id`=9122 WHERE `entry`=25106; +UPDATE `creature_template` SET `gossip_menu_id`=9349 WHERE `entry`=26539; +UPDATE `creature_template` SET `gossip_menu_id`=10120 WHERE `entry` IN (31704,31705,31706,31720,31723,31724); +UPDATE `creature_template` SET `gossip_menu_id`=10259 WHERE `entry`=31716; + +-- Gossip Menu insert from sniff +DELETE FROM `gossip_menu` WHERE `entry`=7692 AND `text_id`=9383; +DELETE FROM `gossip_menu` WHERE `entry`=7696 AND `text_id`=9444; +DELETE FROM `gossip_menu` WHERE `entry`=7704 AND `text_id`=9425; +DELETE FROM `gossip_menu` WHERE `entry`=7726 AND `text_id`=9437; +DELETE FROM `gossip_menu` WHERE `entry`=7727 AND `text_id`=9438; +DELETE FROM `gossip_menu` WHERE `entry`=7728 AND `text_id`=9439; +DELETE FROM `gossip_menu` WHERE `entry`=9033 AND `text_id`=12211; +DELETE FROM `gossip_menu` WHERE `entry`=9038 AND `text_id`=12216; +DELETE FROM `gossip_menu` WHERE `entry`=9040 AND `text_id`=12217; +DELETE FROM `gossip_menu` WHERE `entry`=9041 AND `text_id`=12218; +DELETE FROM `gossip_menu` WHERE `entry`=9042 AND `text_id`=12219; +DELETE FROM `gossip_menu` WHERE `entry`=9043 AND `text_id`=12220; +DELETE FROM `gossip_menu` WHERE `entry`=9066 AND `text_id`=12262; +DELETE FROM `gossip_menu` WHERE `entry`=9067 AND `text_id`=12263; +DELETE FROM `gossip_menu` WHERE `entry`=9068 AND `text_id`=12264; +DELETE FROM `gossip_menu` WHERE `entry`=9069 AND `text_id`=12266; +DELETE FROM `gossip_menu` WHERE `entry`=9070 AND `text_id`=12267; +DELETE FROM `gossip_menu` WHERE `entry`=9091 AND `text_id`=12292; +DELETE FROM `gossip_menu` WHERE `entry`=9109 AND `text_id`=12317; +DELETE FROM `gossip_menu` WHERE `entry`=9110 AND `text_id`=12318; +DELETE FROM `gossip_menu` WHERE `entry`=9116 AND `text_id`=12327; +DELETE FROM `gossip_menu` WHERE `entry`=9117 AND `text_id`=12328; +DELETE FROM `gossip_menu` WHERE `entry`=9118 AND `text_id`=12329; +DELETE FROM `gossip_menu` WHERE `entry`=9120 AND `text_id`=12331; +DELETE FROM `gossip_menu` WHERE `entry`=9121 AND `text_id`=12332; +DELETE FROM `gossip_menu` WHERE `entry`=9122 AND `text_id`=12333; +DELETE FROM `gossip_menu` WHERE `entry`=9349 AND `text_id`=12649; +DELETE FROM `gossip_menu` WHERE `entry`=10120 AND `text_id`=14047; +DELETE FROM `gossip_menu` WHERE `entry`=10259 AND `text_id`=14248; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES +(7692,9383), +(7696,9444), +(7704,9425), +(7726,9437), +(7727,9438), +(7728,9439), +(9033,12211), +(9038,12216), +(9040,12217), +(9041,12218), +(9042,12219), +(9043,12220), +(9066,12262), +(9067,12263), +(9068,12264), +(9069,12266), +(9070,12267), +(9091,12292), +(9109,12317), +(9110,12318), +(9116,12327), +(9117,12328), +(9118,12329), +(9120,12331), +(9121,12332), +(9122,12333), +(9349,12649), +(10120,14047), +(10259,14248); + +-- Insert npc_text from sniff +DELETE FROM `npc_text` WHERE `ID` IN (9437,9438,9439,12211,12266); +INSERT INTO `npc_text` (`ID`,`text0_0`,`text0_1`,`lang0`,`prob0`,`em0_0`,`em0_1`,`em0_2`,`em0_3`,`em0_4`,`em0_5`,`text1_0`,`text1_1`,`lang1`,`prob1`,`em1_0`,`em1_1`,`em1_2`,`em1_3`,`em1_4`,`em1_5`,`text2_0`,`text2_1`,`lang2`,`prob2`,`em2_0`,`em2_1`,`em2_2`,`em2_3`,`em2_4`,`em2_5`,`text3_0`,`text3_1`,`lang3`,`prob3`,`em3_0`,`em3_1`,`em3_2`,`em3_3`,`em3_4`,`em3_5`,`text4_0`,`text4_1`,`lang4`,`prob4`,`em4_0`,`em4_1`,`em4_2`,`em4_3`,`em4_4`,`em4_5`,`text5_0`,`text5_1`,`lang5`,`prob5`,`em5_0`,`em5_1`,`em5_2`,`em5_3`,`em5_4`,`em5_5`,`text6_0`,`text6_1`,`lang6`,`prob6`,`em6_0`,`em6_1`,`em6_2`,`em6_3`,`em6_4`,`em6_5`,`text7_0`,`text7_1`,`lang7`,`prob7`,`em7_0`,`em7_1`,`em7_2`,`em7_3`,`em7_4`,`em7_5`,`WDBVerified`) VALUES +(9437,'$B$BZangarmarsh... too close to truth.$B$B$B$BIs he still watching!?','',0,1,1000,1,1000,6,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,12340), +(9438,'What''s that? Zangarmarsh? Why would I want to go there?$B$B$B$BYes, Zangarmarsh... we... the druids there are getting close to figuring out why the water level is dropping. It''s destroying everything!$B$B$B$BDestroyed us all! Bright light! BOOM!!','',0,1,0,6,1000,1,1000,5,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,12340), +(9439,'The Firewing blood elves... for some reason they want to stop us.$B$B$B$BThey... they sent one of the Broken as ... as an emissary.... But he had a bomb!$B$BThey died, they all died! They tried to run away! The lucky ones didn''t even know.$B$BI must have been at the edge of the blast. It was horr...IT''S WATCHING US AGAIN!$B$B','',0,1,0,18,1000,18,1000,5,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,12340), +(12211,'Fine day fer sailin'', innit?','',7,1,0,1,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,12340), +(12266,'','I''m almost jealous of our Mr. Wavesinger. Why, he may well be prettier than me!',7,1,0,1,3,11,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,12340); + +-- Creature Gossip_menu_option insert from sniff +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (7692,7726,7727) AND `id`=0; +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (9038,9040,9041,9042,9043) AND `id` IN (0,1,2); +DELETE FROM `gossip_menu_option` WHERE `menu_id`=9038 AND `id`=3; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(7692,0,0,'Treelos, I know that the truth is somewhere inside you. Tell me what it is.',1,1,7726,0,0,0,''), +(7726,0,0,'Keep it together man! What about Zangarmarsh?',1,1,7727,0,0,0,''), +(7727,0,0,'I don''t have time for this! Warden, what happened?!',1,1,7728,0,0,0,''), +(9038,0,0,'The Lady Mehley',1,1,9040,0,0,0,''), +(9038,1,0,'Food & Drink',1,1,9041,0,0,0,''), +(9038,2,0,'Goods & Gear',1,1,9042,0,0,0,''), +(9038,3,0,'"Stash?"',1,1,9043,0,0,0,''), +(9040,0,0,'Food & Drink',1,1,9041,0,0,0,''), +(9040,1,0,'Goods & Gear',1,1,9042,0,0,0,''), +(9040,2,0,'"Stash?',1,1,9043,0,0,0,''), +(9041,0,0,'The Lady Mehley',1,1,9040,0,0,0,''), +(9041,1,0,'Goods & Gear',1,1,9042,0,0,0,''), +(9041,2,0,'"Stash?',1,1,9043,0,0,0,''), +(9042,0,0,'The Lady Mehley',1,1,9040,0,0,0,''), +(9042,1,0,'Food & Drink',1,1,9041,0,0,0,''), +(9042,2,0,'"Stash?',1,1,9043,0,0,0,''), +(9043,0,0,'The Lady Mehley',1,1,9040,0,0,0,''), +(9043,1,0,'Food & Drink',1,1,9041,0,0,0,''), +(9043,2,0,'Goods & Gear',1,1,9042,0,0,0,''); + +-- Conditions +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=7704 AND `SourceEntry`=9425; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=7696 AND `SourceEntry`=9444; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup` IN (7704,7692); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,7696,9444,0,0,8,10005,0,0,0,0,'','Show different gossip if player has rewarded quest 10005'), +(14,7696,9444,0,1,8,10006,0,0,0,0,'','Show different gossip if player has rewarded quest 10006'), +(14,7704,9425,0,0,8,9978,0,0,0,0,'','Show different gossip if player has rewarded quest 9978'), +(15,7704,0,0,0,9,9978,0,0,0,0,'','Show gossip option if player has quest 9978 but not complete'), +(15,7692,0,0,0,8,10006,0,0,0,0,'','Show gossip option if player has rewarded quest 10006'), +(15,7692,0,0,1,8,10005,0,0,0,0,'','Show gossip option if player has rewarded quest 10005'); + +-- Gossip Update from Malcrom +DELETE FROM `gossip_menu` WHERE `entry` IN (1042,1043,1044,1045,1046,1047,1048,1049,1050,1052,1053); +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES +(1042,1635),(1043,1640),(1044,1644),(1045,1643),(1045,1753), +(1046,1648),(1047,1754),(1048,1650),(1049,1755), +(1050,1651),(1050,1756),(1052,1652),(1053,1653); +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (1045,1047,1049,1050); +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(1045,0,0,'Acquire Higher Level Access Card',1,1,0,0,0,0,''), +(1047,0,0,'Acquire Higher Level Access Card',1,1,0,0,0,0,''), +(1049,0,0,'Acquire Higher Level Access Card',1,1,0,0,0,0,''), +(1050,0,0,'Acquire high level data card.',1,1,0,0,0,0,''); + +DELETE FROM `gossip_menu` WHERE `entry`=1080 AND `text_id`=1693; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (1080,1693); +DELETE FROM `gossip_menu` WHERE `entry`=1100 AND `text_id`=1713; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (1100,1713); +DELETE FROM `gossip_menu` WHERE `entry`=1143 AND `text_id`=1759; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (1143,1759); +DELETE FROM `gossip_menu` WHERE `entry`=1161 AND `text_id`=1793; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (1161,1793); +DELETE FROM `gossip_menu` WHERE `entry`=1162 AND `text_id`=1794; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (1162,1794); +DELETE FROM `gossip_menu` WHERE `entry`=1201 AND `text_id`=1833; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (1201,1833); +DELETE FROM `gossip_menu` WHERE `entry`=1281 AND `text_id`=1916; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (1281,1916); +DELETE FROM `gossip_menu` WHERE `entry`=1282 AND `text_id`=1918; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (1282,1918); + +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (1282); +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(1282,0,0,'Touch the Suntara stone and call forth Lathoric the Black and his guardian, Obsidion.',1,1,0,0,0,0,''); + +DELETE FROM `gossip_menu` WHERE `entry`=1301 AND `text_id`=1933; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (1301,1933); +DELETE FROM `gossip_menu` WHERE `entry`=1301 AND `text_id`=1934; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (1301,1934); + +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (1301); +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(1301,0,0,'I wish to browse your wares.',3,128,0,0,0,0,''); + +DELETE FROM `gossip_menu` WHERE `entry`=1302 AND `text_id`=1935; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (1302,1935); +DELETE FROM `gossip_menu` WHERE `entry`=1321 AND `text_id`=1955; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (1321,1955); +DELETE FROM `gossip_menu` WHERE `entry`=1322 AND `text_id`=1954; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (1322,1954); +DELETE FROM `gossip_menu` WHERE `entry`=1362 AND `text_id`=1994; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (1362,1994); diff --git a/sql/old/3.3.5a/2012_02_22_00_world_sai.sql b/sql/old/3.3.5a/2012_02_22_00_world_sai.sql new file mode 100644 index 00000000000..2e392f3a45f --- /dev/null +++ b/sql/old/3.3.5a/2012_02_22_00_world_sai.sql @@ -0,0 +1,39 @@ +-- SAI for Kalaran Windblade +SET @ENTRY=8479; +UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE (`entryorguid`=@ENTRY AND `source_type`=0); +DELETE FROM `smart_scripts` WHERE (`entryorguid`=@ENTRY*100 AND `source_type`=9); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +-- AI +(@ENTRY,0,0,1,62,0,100,0,1321,0,0,0,26,3441,0,0,0,0,0,7,0,0,0,0,0,0,0,'Kalaran Windblade - On Gossip Option select - quest credit'), +(@ENTRY,0,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Kalaran Windblade - On Gossip Option select - close gossip'), +(@ENTRY,0,2,3,62,0,100,0,1323,2,0,0,11,19797,0,0,0,0,0,7,0,0,0,0,0,0,0,'Kalaran Windblade - On Gossip Option select - cast 19797'), +(@ENTRY,0,3,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Kalaran Windblade - On Gossip Option select - close gossip'), +(@ENTRY,0,4,0,62,0,100,0,1323,3,0,0,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Kalaran Windblade - On Gossip Option select - run script'), +-- Script +(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Kalaran Windblade - script - close gossip'), +(@ENTRY*100,9,1,0,0,0,100,0,0,0,0,0,83,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Kalaran Windblade - script - remove npc flags'), +(@ENTRY*100,9,2,0,0,0,100,0,1000,1000,1000,1000,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Kalaran Windblade - script - say 0'), +(@ENTRY*100,9,3,0,0,0,100,0,1000,1000,1000,1000,17,69,0,0,0,0,0,1,0,0,0,0,0,0,0,'Kalaran Windblade - script - emotestate usestanding'), +(@ENTRY*100,9,4,0,0,0,100,0,60000,60000,60000,60000,17,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Kalaran Windblade - script - emotestate none'), +(@ENTRY*100,9,5,0,0,0,100,0,1000,1000,1000,1000,26,3453,0,0,0,0,0,7,0,0,0,0,0,0,0,'Kalaran Windblade - script - give quest credit'), +(@ENTRY*100,9,6,0,0,0,100,0,1000,1000,1000,1000,82,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Kalaran Windblade - script - add npc flags'); +-- npc text +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES +(@ENTRY,0,0,'Please be patient, $N',12,0,100,0,0,0,'Kalaran Windblade'); +-- Gossip options +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (1321,1322,1323); +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(1321,0,0,'Let me confer with my colleagues.',1,1,0,0,0,0,''), +(1322,0,0,'Continue please.',1,1,1321,0,0,0,''), +(1323,0,0,'Tell me what drives this vengeance?',1,1,1322,0,0,0,''), +(1323,2,0,'Kalaran, I have misplaced my torch. I require another.',1,1,0,0,0,0,''), +(1323,3,0,'Kalaran, please enchant the torch.',1,1,0,0,0,0,''); +-- Gossip option conditions +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup` IN (1323); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,1323,0,0,0,9,3441,0,0,0,0,'','Show gossip option if player has quest 3441 but not complete'), +(15,1323,2,0,0,8,3454,0,0,0,0,'','Show gossip option if player has quest 3441 complete'), +(15,1323,2,0,0,2,10515,0,1,0,0,'','Show gossip option if player does not have item 10515'), +(15,1323,3,0,0,9,3453,0,0,0,0,'','Show gossip option if player has quest 3453 but not complete'); diff --git a/sql/old/3.3.5a/2012_02_22_01_world_creature_text.sql b/sql/old/3.3.5a/2012_02_22_01_world_creature_text.sql new file mode 100644 index 00000000000..8b7761e48a0 --- /dev/null +++ b/sql/old/3.3.5a/2012_02_22_01_world_creature_text.sql @@ -0,0 +1,34 @@ +-- Invisible Stalker text for Wintergrasp from sniff +DELETE FROM `creature_text` WHERE `entry`=15214; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(15214,0,0, 'Let the battle begin!',41,0,100,0,0,0, 'Invisible Stalker'), +(15214,1,0, 'The Broken Temple siege workshop has been attacked by the Horde!',41,0,100,0,0,0, 'Invisible Stalker'), +(15214,2,0, 'The Broken Temple siege workshop has been captured by the Horde!',41,0,100,0,0,0, 'Invisible Stalker'), +(15214,3,0, 'The Broken Temple siege workshop has been attacked by the Alliance!',41,0,100,0,0,0, 'Invisible Stalker'), +(15214,4,0, 'The Broken Temple siege workshop has been captured by the Alliance!',41,0,100,0,0,0, 'Invisible Stalker'), +(15214,5,0, 'The Sunken Ring siege workshop has been attacked by the Horde!',41,0,100,0,0,0, 'Invisible Stalker'), +(15214,6,0, 'The Sunken Ring siege workshop has been captured by the Horde!',41,0,100,0,0,0, 'Invisible Stalker'), +(15214,7,0, 'The Sunken Ring siege workshop has been attacked by the Alliance!',41,0,100,0,0,0, 'Invisible Stalker'), +(15214,8,0, 'The Sunken Ring siege workshop has been captured by the Alliance!',41,0,100,0,0,0, 'Invisible Stalker'), +(15214,9,0, 'The Eastspark siege workshop has been attacked by the Horde!',41,0,100,0,0,0, 'Invisible Stalker'), +(15214,10,0, 'The Eastspark siege workshop has been captured by the Horde!',41,0,100,0,0,0, 'Invisible Stalker'), +(15214,11,0, 'The Eastspark siege workshop has been attacked by the Alliance!',41,0,100,0,0,0, 'Invisible Stalker'), +(15214,12,0, 'The Eastspark siege workshop has been captured by the Alliance!',41,0,100,0,0,0, 'Invisible Stalker'), +(15214,13,0, 'The Westspark siege workshop has been attacked by the Horde!',41,0,100,0,0,0, 'Invisible Stalker'), +(15214,14,0, 'The Westspark siege workshop has been captured by the Horde!',41,0,100,0,0,0, 'Invisible Stalker'), +(15214,15,0, 'The Westspark siege workshop has been attacked by the Alliance!',41,0,100,0,0,0, 'Invisible Stalker'), +(15214,16,0, 'The Westspark siege workshop has been captured by the Alliance!',41,0,100,0,0,0, 'Invisible Stalker'), +(15214,17,0, 'The north-western keep tower has been damaged!',41,0,100,0,0,0, 'Invisible Stalker'), +(15214,18,0, 'The north-western keep tower has been destroyed!',41,0,100,0,0,0, 'Invisible Stalker'), +(15214,19,0, 'The south-eastern keep tower has been damaged!',41,0,100,0,0,0, 'Invisible Stalker'), +(15214,20,0, 'The south-eastern keep tower has been destroyed!',41,0,100,0,0,0, 'Invisible Stalker'), +(15214,21,0, 'The western tower has been damaged!',41,0,100,0,0,0, 'Invisible Stalker'), +(15214,22,0, 'The western tower has been destroyed!',41,0,100,0,0,0, 'Invisible Stalker'), +(15214,23,0, 'The southern tower has been damaged!',41,0,100,0,0,0, 'Invisible Stalker'), +(15214,24,0, 'The southern tower has been destroyed!',41,0,100,0,0,0, 'Invisible Stalker'), +(15214,25,0, 'The eastern tower has been damaged!',41,0,100,0,0,0, 'Invisible Stalker'), +(15214,26,0, 'The eastern tower has been destroyed!',41,0,100,0,0,0, 'Invisible Stalker'), +(15214,27,0, 'The Horde has defended Wintergrasp Fortress!',41,0,100,0,0,0, 'Invisible Stalker'), +(15214,28,0, 'The Horde has captured Wintergrasp Fortress!',41,0,100,0,0,0, 'Invisible Stalker'), +(15214,29,0, 'The Alliance has defended Wintergrasp Fortress!',41,0,100,0,0,0, 'Invisible Stalker'), +(15214,30,0, 'The Alliance has captured Wintergrasp Fortress!',41,0,100,0,0,0, 'Invisible Stalker'); diff --git a/sql/old/3.3.5a/2012_02_22_02_world_misc.sql b/sql/old/3.3.5a/2012_02_22_02_world_misc.sql new file mode 100644 index 00000000000..33bec2a9b78 --- /dev/null +++ b/sql/old/3.3.5a/2012_02_22_02_world_misc.sql @@ -0,0 +1,57 @@ +-- Mounting Hodir's Helm (12987) + +-- cleanup after Discovered +-- clean all related to npc Hodir's Helm KC Bunny +DELETE FROM `smart_scripts` WHERE `entryorguid`=30210 AND `source_type`=0; +DELETE FROM `creature` WHERE `id`=30210; +DELETE FROM `creature_text` WHERE `entry`=30210; + +SET @HELM := 192080; -- Hodir's Helm +SET @TEMP := 300230; -- TEMP Northern Ice Spike +SET @BUNNY_TARGET := 30215; -- Ice Spike Target Bunny +SET @GUID_GO := 270; -- set by TDB +SET @GUID_NPC := 40514; -- set by TDB +SET @SPELL_READ_PRONOUNCEMENT := 56278; +SET @QUEST := 12987; +SET @AREA := 4438; -- Dun Niffelem +SET @SPELL_AREA := 56305; -- See Quest Invisibility 1 (Ice Spike Bunny) +SET @QUEST := 13006; -- Polishing the Helm + +UPDATE `creature_template` SET `unit_flags`=`unit_flags`|33554432|256,`InhabitType`=7,`flags_extra`=`flags_extra`|128 WHERE `entry`=@BUNNY_TARGET; + +UPDATE `gameobject_template` SET `flags`=`flags`|32 WHERE `entry`=@HELM; +UPDATE `gameobject` SET `phaseMask`=4 WHERE `id`=@TEMP; + +DELETE FROM `gameobject` WHERE `guid`=@GUID_GO; +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES +(@GUID_GO,@HELM,571,1,4,7390.143,-2725.382,874.2561,-3.089183,0,0,-0.9996567,0.02620165,600,255,1); + +DELETE FROM `creature` WHERE `guid` BETWEEN @GUID_NPC+0 AND @GUID_NPC+1; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES +(@GUID_NPC+0,@BUNNY_TARGET,571,1,4,0,0,7386.51,-2726.489,872.5089,5.88176,300,0,0,4979,0,0,0,0,0), +(@GUID_NPC+1,@BUNNY_TARGET,571,1,4,0,0,7388.424,-2724.909,869.8643,0.5934119,300,0,0,4979,0,0,0,0,0); + +DELETE FROM `creature_template_addon` WHERE `entry`=@BUNNY_TARGET; +INSERT INTO `creature_template_addon` (`entry`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(@BUNNY_TARGET,0,0,65536,1,0, '61333 56304 61334'); -- Gigantic Helm Sparkle / Hodir's Helm Bunny: Invisibility / Extra Large Helm Sparkle + +DELETE FROM `spell_script_names` WHERE `spell_id`=@SPELL_READ_PRONOUNCEMENT; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(@SPELL_READ_PRONOUNCEMENT, 'spell_q12987_read_pronouncement'); + +DELETE FROM `spell_area` WHERE `spell`=@SPELL_AREA; +INSERT INTO `spell_area` (`spell`,`area`,`quest_start`,`quest_start_active`,`quest_end`,`aura_spell`,`racemask`,`gender`,`autocast`) VALUES +(@SPELL_AREA,@AREA,@QUEST,1,@QUEST,0,0,2,1); + +-- relation for the daily quest that should be available after finishing Mounting Hodir's Helm + +-- removing flag 4 or else player can't interract with Q giver +UPDATE `gameobject_template` SET `flags`=`flags`&~4 WHERE `entry`=@HELM; + +DELETE FROM `gameobject_questrelation` WHERE `id`=@HELM; +INSERT INTO `gameobject_questrelation` (`id`,`quest`) VALUES +(@HELM,@QUEST); + +DELETE FROM `gameobject_involvedrelation` WHERE `id`=@HELM; +INSERT INTO `gameobject_involvedrelation` (`id`,`quest`) VALUES +(@HELM,@QUEST); diff --git a/sql/old/3.3.5a/2012_02_22_03_world_conditions.sql b/sql/old/3.3.5a/2012_02_22_03_world_conditions.sql new file mode 100644 index 00000000000..9c4d0cdec95 --- /dev/null +++ b/sql/old/3.3.5a/2012_02_22_03_world_conditions.sql @@ -0,0 +1,3 @@ +UPDATE `conditions` SET `SourceTypeOrReferenceId`=13 WHERE `SourceTypeOrReferenceId`=17 AND `SourceGroup`=1; +UPDATE `conditions` SET `ConditionValue2`=1 WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=1323 AND `SourceEntry`=2 AND `ConditionTypeOrReference`=2; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=1 AND `SourceGroup`=17465 AND `SourceEntry`=22554 AND `ConditionTypeOrReference`=7; diff --git a/sql/old/3.3.5a/2012_02_23_00_world_spell_script_names.sql b/sql/old/3.3.5a/2012_02_23_00_world_spell_script_names.sql new file mode 100644 index 00000000000..6ea96033091 --- /dev/null +++ b/sql/old/3.3.5a/2012_02_23_00_world_spell_script_names.sql @@ -0,0 +1,7 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` in (11885,11886,11887,11888,11889); +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(11885,'spell_item_muisek_vessel'), +(11886,'spell_item_muisek_vessel'), +(11887,'spell_item_muisek_vessel'), +(11888,'spell_item_muisek_vessel'), +(11889,'spell_item_muisek_vessel'); diff --git a/sql/old/3.3.5a/2012_02_24_00_world_gameobject_loot_template.sql b/sql/old/3.3.5a/2012_02_24_00_world_gameobject_loot_template.sql new file mode 100644 index 00000000000..daecfc02dfc --- /dev/null +++ b/sql/old/3.3.5a/2012_02_24_00_world_gameobject_loot_template.sql @@ -0,0 +1,10 @@ +DELETE FROM `gameobject_loot_template` WHERE `entry` IN (28058,28074,28088,28064,28082,28096) AND `item`=49908; +INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- Deathbringer's Cache +(28058,49908,20,1,0,1,1), -- Primordial Saronite 10H +(28074,49908,20,1,0,1,1), -- Primordial Saronite 25N +(28088,49908,20,1,0,1,1), -- Primordial Saronite 25H +-- Cache of the Dreamwalker +(28064,49908,20,1,0,1,1), -- Primordial Saronite 10H +(28082,49908,20,1,0,1,1), -- Primordial Saronite 25N +(28096,49908,20,1,0,1,1); -- Primordial Saronite 25H diff --git a/sql/old/3.3.5a/2012_02_24_01_world_sai.sql b/sql/old/3.3.5a/2012_02_24_01_world_sai.sql new file mode 100644 index 00000000000..19e4e8fb772 --- /dev/null +++ b/sql/old/3.3.5a/2012_02_24_01_world_sai.sql @@ -0,0 +1,44 @@ +-- Fix for quest "You've Really Done It This Time, Kul" 14096 Alliance / 14142 Horde +-- SAI for Black Cage +SET @ENTRY=195310; +UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE (`entryorguid`=@ENTRY AND `source_type`=1); +DELETE FROM `smart_scripts` WHERE (`entryorguid`=@ENTRY*100 AND `source_type`=9); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,1,0,0,70,0,100,0,2,0,0,0,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Black Cage - On activate - Run Script'), +(@ENTRY*100,9,0,0,0,0,100,0,6000,6000,6000,6000,32,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Black Cage - Script - set go state'); +-- SAI for Captive Aspirant +SET @ENTRY=34716; +UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE (`entryorguid`=@ENTRY AND `source_type`=0); +DELETE FROM `smart_scripts` WHERE (`entryorguid`=@ENTRY*100 AND `source_type`=9); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,8,0,100,0,66531,0,0,0,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Captive Aspirant - On spellhit - Run Script'), +(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Captive Aspirant - Script - Say random text'), +(@ENTRY*100,9,1,0,0,0,100,0,2000,2000,2000,2000,33,@ENTRY,0,0,0,0,0,7,0,0,0,0,0,0,0,'Captive Aspirant - Script - Kill credit'), +(@ENTRY*100,9,2,0,0,0,100,0,2000,2000,2000,2000,46,10,0,0,0,0,0,1,0,0,0,0,0,0,0,'Captive Aspirant - Script - move 10 yards'), +(@ENTRY*100,9,3,0,0,0,100,0,4000,4000,4000,4000,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Captive Aspirant - Script - despawn'); +-- SAI for Kul the Reckless +SET @ENTRY=34956; +UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE (`entryorguid`=@ENTRY AND `source_type`=0); +DELETE FROM `smart_scripts` WHERE (`entryorguid`=@ENTRY*100 AND `source_type`=9); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,8,0,100,0,66531,0,0,0,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Kul the Reckless - On spellhit - Run Script'), +(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Kul the Reckless - Script - Say random text'), +(@ENTRY*100,9,1,0,0,0,100,0,2000,2000,2000,2000,33,@ENTRY,0,0,0,0,0,7,0,0,0,0,0,0,0,'Kul the Reckless - Script - Kill credit'), +(@ENTRY*100,9,2,0,0,0,100,0,2000,2000,2000,2000,46,10,0,0,0,0,0,1,0,0,0,0,0,0,0,'Kul the Reckless - Script - move 10 yards'), +(@ENTRY*100,9,3,0,0,0,100,0,4000,4000,4000,4000,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Kul the Reckless - Script - despawn'); +-- Captive Aspirant & Kul the Reckless text from sniff +DELETE FROM `creature_text` WHERE `entry` IN (34716,34956); +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(34716,0,0, 'Thank you, $c.',12,0,100,5,0,0, 'Captive Aspirant'), +(34716,0,1, 'They''re killing the prisoners! Hurry, help the others.',12,0,100,5,0,0, 'Captive Aspirant'), +(34716,0,2, 'I knew I shouldn''t have come to the tournament!',12,0,100,5,0,0, 'Captive Aspirant'), +(34716,0,3, 'I thought I was going to die in there!',12,0,100,5,0,0, 'Captive Aspirant'), +(34956,0,0, 'They were seconds from strapping me to one of those altars and sucking my soul out. Let''s get out of here!',12,0,100,5,0,0, 'Kul the Reckless'); +-- Target conditions for spell 66531 +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=66531; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,2,66531,0,0,31,3,34716,0,0,0,'','Spell 66531 targets npc 34716 or npc 34956'), +(13,2,66531,0,1,31,3,34956,0,0,0,'','Spell 66531 targets npc 34716 or npc 34956'); diff --git a/sql/old/3.3.5a/2012_02_25_00_world_spell_script_names.sql b/sql/old/3.3.5a/2012_02_25_00_world_spell_script_names.sql new file mode 100644 index 00000000000..9619121e982 --- /dev/null +++ b/sql/old/3.3.5a/2012_02_25_00_world_spell_script_names.sql @@ -0,0 +1 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_sindragosa_collision_filter'; diff --git a/sql/old/3.3.5a/2012_02_25_01_world_command.sql b/sql/old/3.3.5a/2012_02_25_01_world_command.sql new file mode 100644 index 00000000000..de708b7a9cc --- /dev/null +++ b/sql/old/3.3.5a/2012_02_25_01_world_command.sql @@ -0,0 +1,6 @@ +DELETE FROM `command` WHERE `name` IN ('group','group leader','group disband','group remove'); +INSERT INTO `command` (`name`,`security`,`help`) VALUES +('group', 3, 'Syntax: .group $subcommand\nType .group to see the list of possible subcommands or .help group $subcommand to see info on subcommands'), +('group leader', 3, 'Syntax: .group leader [$characterName]\n\nSets the given character as his group''s leader.'), +('group disband', 3, 'Syntax: .group disband [$characterName]\n\nDisbands the given character''s group.'), +('group remove', 3, 'Syntax: .group remove [$characterName]\n\nRemoves the given character from his group.'); diff --git a/sql/old/3.3.5a/2012_02_25_01_world_misc.sql b/sql/old/3.3.5a/2012_02_25_01_world_misc.sql new file mode 100644 index 00000000000..deedd50a819 --- /dev/null +++ b/sql/old/3.3.5a/2012_02_25_01_world_misc.sql @@ -0,0 +1,11 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` IN (61698); +INSERT INTO `spell_script_names`(`spell_id`,`ScriptName`) VALUES +(61698,'spell_gen_ds_flush_knockback'); + +DELETE FROM `spell_dbc` WHERE `id`=61698; +INSERT INTO `spell_dbc` (`Id`, `Dispel`, `Mechanic`, `Attributes`, `AttributesEx`, `AttributesEx2`, `AttributesEx3`, `AttributesEx4`, `AttributesEx5`, `AttributesEx6`, `AttributesEx7`, `Stances`, `StancesNot`, `Targets`, `CastingTimeIndex`, `AuraInterruptFlags`, `ProcFlags`, `ProcChance`, `ProcCharges`, `MaxLevel`, `BaseLevel`, `SpellLevel`, `DurationIndex`, `RangeIndex`, `StackAmount`, `EquippedItemClass`, `EquippedItemSubClassMask`, `EquippedItemInventoryTypeMask`, `Effect1`, `Effect2`, `Effect3`, `EffectDieSides1`, `EffectDieSides2`, `EffectDieSides3`, `EffectRealPointsPerLevel1`, `EffectRealPointsPerLevel2`, `EffectRealPointsPerLevel3`, `EffectBasePoints1`, `EffectBasePoints2`, `EffectBasePoints3`, `EffectMechanic1`, `EffectMechanic2`, `EffectMechanic3`, `EffectImplicitTargetA1`, `EffectImplicitTargetA2`, `EffectImplicitTargetA3`, `EffectImplicitTargetB1`, `EffectImplicitTargetB2`, `EffectImplicitTargetB3`, `EffectRadiusIndex1`, `EffectRadiusIndex2`, `EffectRadiusIndex3`, `EffectApplyAuraName1`, `EffectApplyAuraName2`, `EffectApplyAuraName3`, `EffectAmplitude1`, `EffectAmplitude2`, `EffectAmplitude3`, `EffectMultipleValue1`, `EffectMultipleValue2`, `EffectMultipleValue3`, `EffectMiscValue1`, `EffectMiscValue2`, `EffectMiscValue3`, `EffectMiscValueB1`, `EffectMiscValueB2`, `EffectMiscValueB3`, `EffectTriggerSpell1`, `EffectTriggerSpell2`, `EffectTriggerSpell3`, `EffectSpellClassMaskA1`, `EffectSpellClassMaskA2`, `EffectSpellClassMaskA3`, `EffectSpellClassMaskB1`, `EffectSpellClassMaskB2`, `EffectSpellClassMaskB3`, `EffectSpellClassMaskC1`, `EffectSpellClassMaskC2`, `EffectSpellClassMaskC3`, `MaxTargetLevel`, `SpellFamilyName`, `SpellFamilyFlags1`, `SpellFamilyFlags2`, `SpellFamilyFlags3`, `MaxAffectedTargets`, `DmgClass`, `PreventionType`, `DmgMultiplier1`, `DmgMultiplier2`, `DmgMultiplier3`, `AreaGroupId`, `SchoolMask`, `Comment`) VALUES +(61698,0,0,536871296,269058048,67108868,268894272,2048,0,1024,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,-1,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'Flush - Knockback effect'); + +UPDATE `battleground_template` SET `HordeStartO`=3.14159 WHERE `id`=10; + +UPDATE `creature_template` SET `flags_extra`=128 WHERE `entry`=28567; diff --git a/sql/old/3.3.5a/2012_02_25_02_world_sai.sql b/sql/old/3.3.5a/2012_02_25_02_world_sai.sql new file mode 100644 index 00000000000..e2ff99534b4 --- /dev/null +++ b/sql/old/3.3.5a/2012_02_25_02_world_sai.sql @@ -0,0 +1,28 @@ +-- Fix for Quest: 12843 "They Took Our Men!" +-- SAI for Rusty Cage +SET @ENTRY=191544; +UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE (`entryorguid`=@ENTRY AND `source_type`=1); +DELETE FROM `smart_scripts` WHERE (`entryorguid`=@ENTRY*100 AND `source_type`=9); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,1,0,1,70,0,100,0,2,0,0,0,45,0,1,0,0,0,0,11,29466,5,0,0,0,0,0,'Rusty Cage - On activate - set data on Goblin Prisoner'), +(@ENTRY,1,1,0,61,0,100,0,0,0,0,0,33,29466,0,0,0,0,0,7,0,0,0,0,0,0,0,'Rusty Cage - On activate - quest credit'); +-- SAI for Goblin Prisoner +SET @ENTRY=29466; +UPDATE `creature` SET `modelid`=0,`spawntimesecs`=120,`curhealth`=1 WHERE `id`=29466; +UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE (`entryorguid`=@ENTRY AND `source_type`=0); +DELETE FROM `smart_scripts` WHERE (`entryorguid`=@ENTRY*100 AND `source_type`=9); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,11,0,100,1,0,0,0,0,32,0,0,0,0,0,0,15,191544,5,0,0,0,0,0,'Goblin Prisoner - On respawn - reset cage'), +(@ENTRY,0,1,0,38,0,100,0,0,1,0,0,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Goblin Prisoner - On dataset - Run Script'), +(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,45,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Goblin Prisoner - Script - set data 0'), +(@ENTRY*100,9,1,0,0,0,100,0,1000,1000,1000,1000,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Goblin Prisoner - Script - Say random text'), +(@ENTRY*100,9,2,0,0,0,100,0,2000,2000,2000,2000,46,10,0,0,0,0,0,1,0,0,0,0,0,0,0,'Goblin Prisoner - Script - move 10 yards'), +(@ENTRY*100,9,3,0,0,0,100,0,4000,4000,4000,4000,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Goblin Prisoner - Script - despawn'); +-- Goblin Prisoner +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0, 'I can''t believe it! I''m free to go!',12,0,100,5,0,0, 'Goblin Prisoner'), +(@ENTRY,0,1, 'I''m free? I''m free!',12,0,100,5,0,0, 'Goblin Prisoner'), +(@ENTRY,0,2, 'Time to hightail it! Thanks, friend!',12,0,100,5,0,0, 'Goblin Prisoner'); diff --git a/sql/old/3.3.5a/2012_02_26_00_world_misc.sql b/sql/old/3.3.5a/2012_02_26_00_world_misc.sql new file mode 100644 index 00000000000..3df42934aa9 --- /dev/null +++ b/sql/old/3.3.5a/2012_02_26_00_world_misc.sql @@ -0,0 +1,13 @@ +UPDATE `spell_area` SET `quest_start`=12987,`quest_end`=12987 WHERE `spell`=56305; + +DELETE FROM `reference_loot_template` WHERE `entry` IN (28058,28074,28088,28064,28082,28096) AND `item`=49908; -- bad data +DELETE FROM `gameobject_loot_template` WHERE `entry` IN (28058,28074,28088,28064,28082,28096) AND `item`=49908; +INSERT INTO `gameobject_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- Deathbringer's Cache +(28058,49908,20,1,0,1,1), -- Primordial Saronite 10H +(28074,49908,20,1,0,1,1), -- Primordial Saronite 25N +(28088,49908,20,1,0,1,1), -- Primordial Saronite 25H +-- Cache of the Dreamwalker +(28064,49908,20,1,0,1,1), -- Primordial Saronite 10H +(28082,49908,20,1,0,1,1), -- Primordial Saronite 25N +(28096,49908,20,1,0,1,1); -- Primordial Saronite 25H diff --git a/sql/old/3.3.5a/2012_02_26_01_world_spell_script_names.sql b/sql/old/3.3.5a/2012_02_26_01_world_spell_script_names.sql new file mode 100644 index 00000000000..7bb38d5f2e0 --- /dev/null +++ b/sql/old/3.3.5a/2012_02_26_01_world_spell_script_names.sql @@ -0,0 +1,4 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` IN (48018, 48020); +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(48018,'spell_warl_demonic_circle_summon'), +(48020,'spell_warl_demonic_circle_teleport'); diff --git a/sql/old/3.3.5a/2012_02_27_00_world_creature_template.sql b/sql/old/3.3.5a/2012_02_27_00_world_creature_template.sql new file mode 100644 index 00000000000..b8936774e36 --- /dev/null +++ b/sql/old/3.3.5a/2012_02_27_00_world_creature_template.sql @@ -0,0 +1,8 @@ +-- Update gold drops in ICC bosses based on old.wowhead.com data +UPDATE `creature_template` SET `mingold`=250000,`maxgold`=300000 WHERE `entry` IN(36612,37957,37958,37959); -- Lord Marrowgar +UPDATE `creature_template` SET `mingold`=175000,`maxgold`=225000 WHERE `entry` IN (36626,37504,37505,37506); -- Festergut +UPDATE `creature_template` SET `mingold`=400000,`maxgold`=500000 WHERE `entry` IN (36627,38390,38549,38550); -- Rotface +UPDATE `creature_template` SET `mingold`=400000,`maxgold`=500000 WHERE `entry` IN (36678,38431,38585,38586); -- Professor Putricide +UPDATE `creature_template` SET `mingold`=300000,`maxgold`=350000 WHERE `entry` IN (37955,38434,38435,38436); -- Blood-Queen Lana'thel +UPDATE `creature_template` SET `mingold`=1330000,`maxgold`=1400000 WHERE `entry` IN (36853,38265,38266,38267); -- Sindragosa +UPDATE `creature_template` SET `mingold`=1300000,`maxgold`=1500000 WHERE `entry` IN (36597,39166,39167,39168); -- The Lich King diff --git a/sql/old/3.3.5a/2012_02_28_00_world_wintergrasp_spawns.sql b/sql/old/3.3.5a/2012_02_28_00_world_wintergrasp_spawns.sql new file mode 100644 index 00000000000..9c07709246f --- /dev/null +++ b/sql/old/3.3.5a/2012_02_28_00_world_wintergrasp_spawns.sql @@ -0,0 +1,366 @@ +-- Delete unused creature_data rows +DELETE FROM `creature_addon` WHERE `guid` IN (131728,131282,131283,131284,131285,131286,131287,131288,131289,131290,131291,131292,131293,131294,131295,131296,131297,131298,131299,131300,131301,131302,131303,131304,131305,131306,131307,131308,131309,131310,131311,131312,131313,131314,131315,131316,131317,131318,131319,131320,131321,131322,131326,131327,131328,131350,131351,131352,131353,131354,131376,131377,131378,131379,131380,131392,131437,131458,131631,131632,131633,131634,131635,131636,131706,131727,13128,131729,131730,131731); + +-- Replace Wintergrasp spawns with properly phased spawns +SET @GUID := 88310; +DELETE FROM `creature` WHERE `id` IN (31841,31842,30400,30499,30489,30869,31036,31051,31052,31054,31108,31109,31153,39172,30870,31053,31091,31101,31102,31106,31107,31151,32294,39173,32296,30488); +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +-- Taunka Spirit Guide (Horde) +(@GUID+0,31841,571,1,0x00000010,0,0,4318.436,2408.06738,392.675751,6.23082542,120,0,0,1,0,0), -- Eastspark Workshop +(@GUID+1,31841,571,1,0x00000010,0,0,4336.25439,3235.51978,390.334,0.628318548,120,0,0,1,0,0), -- Westspark Workshop +(@GUID+2,31841,571,1,0x00000010,0,0,5104.753,2300.9458,368.568054,0.7330383,120,0,0,1,0,0), -- The Sunken Ring +(@GUID+3,31841,571,1,0x00000010,0,0,5103.133,3462.128,368.568054,5.270895,120,0,0,1,0,0), -- The Chilled Quagmire "Outside broker Temple" +(@GUID+4,31841,571,1,0x00000040,0,0,5537.482,2898.90674,517.2589,4.86946869,120,0,0,1,0,0), -- Fortress +(@GUID+5,31841,571,1,0x00000001,0,0,5031.84131,3710.74878,372.4835,0,120,5,0,1,0,0), -- Horde Landing Zone +-- Dwarven Spirit Guide (Alliance) +(@GUID+6,31842,571,1,0x00000020,0,0,4318.436,2408.06738,392.675751,6.23082542,120,0,0,1,0,0), -- Eastspark Workshop +(@GUID+7,31842,571,1,0x00000020,0,0,4336.25439,3235.51978,390.334,0.628318548,120,0,0,1,0,0), -- Westspark Workshop +(@GUID+8,31842,571,1,0x00000020,0,0,5104.753,2300.9458,368.568054,0.7330383,120,0,0,1,0,0), -- The Sunken Ring +(@GUID+9,31842,571,1,0x00000020,0,0,5103.133,3462.128,368.568054,5.270895,120,0,0,1,0,0), -- The Chilled Quagmire "Outside The Broken Temple" +(@GUID+10,31842,571,1,0x00000080,0,0,5537.482,2898.90674,517.2589,4.86946869,120,0,0,1,0,0), -- Fortress +(@GUID+11,31842,571,1,0x00000001,0,0,5140.7876,2179.12451,390.9512,1.97222209,120,0,0,1,0,0), -- Aliance Landing Zone +-- Goblin Mechanic (Horde) +(@GUID+12,30400,571,1,0x00000010,0,0,4964.89,3383.06,382.911,6.12611,180,0,0,1,0,0), -- The Broken Temple +(@GUID+13,30400,571,1,0x00000010,0,0,4939.76,2389.06,326.153,3.26377,180,0,0,1,0,0), -- The Sunken Ring +(@GUID+14,30400,571,1,0x00000010,0,0,4357.67,2357.99,382.007,1.67552,180,0,0,1,0,0), -- Eastspark Workshop +(@GUID+15,30400,571,1,0x00000010,0,0,4354.15,3312.82,378.046,1.67552,180,0,0,1,0,0), -- Westspark Workshop +(@GUID+16,30400,571,1,0x00000040,0,0,5391.61,2707.72,415.051,4.55531,180,0,0,1,0,0), -- Wintergrasp Fortress +(@GUID+17,30400,571,1,0x00000040,0,0,5392.91,2975.26,415.223,4.55531,180,0,0,1,0,0), -- Wintergrasp Fortress +-- Gnomish Engineer (Alliance) +(@GUID+18,30499,571,1,0x00000020,0,0,4964.89,3383.06,382.911,6.12611,180,0,0,1,0,0), -- The Broken Temple +(@GUID+19,30499,571,1,0x00000020,0,0,4939.76,2389.06,326.153,3.26377,180,0,0,1,0,0), -- The Sunken Ring +(@GUID+20,30499,571,1,0x00000020,0,0,4357.67,2357.99,382.007,1.67552,180,0,0,1,0,0), -- Eastspark Workshop +(@GUID+21,30499,571,1,0x00000020,0,0,4354.15,3312.82,378.046,1.67552,180,0,0,1,0,0), -- Westspark Workshop +(@GUID+22,30499,571,1,0x00000080,0,0,5391.61,2707.72,415.051,4.55531,180,0,0,1,0,0), -- Wintergrasp Fortress +(@GUID+23,30499,571,1,0x00000080,0,0,5392.91,2975.26,415.223,4.55531,180,0,0,1,0,0), -- Wintergrasp Fortress +-- Alliance NPC's +(@GUID+24,30489,571,1,0x00000080,0,0,5369.973,2874.83081,409.3225,3.12413931,120,0,0,1,0,0), -- Morgan Day +(@GUID+25,30869,571,1,0x00000001,0,0,5102.75049,2187.82837,365.707855,3.996804,120,0,0,1,0,0), -- Arzo Safeflight +(@GUID+26,31036,571,1,0x00000040,0,0,5078.281,2183.704,365.028564,1.46607661,120,0,0,1,0,0), -- Commander Zanneth +(@GUID+27,31036,571,1,0x00000080,0,0,5358.641,2841.76416,409.3225,1.13262534,120,0,0,1,0,0), +(@GUID+28,31051,571,1,0x00000040,0,0,5081.697,2173.73,365.8777,0.8552113,120,0,0,1,0,0), -- Sorceress Kaylana +(@GUID+29,31051,571,1,0x00000080,0,0,5296.869,2887.67114,409.274658,5.60250664,120,0,0,1,0,0), +(@GUID+30,31052,571,1,0x00000040,0,0,5100.06543,2168.89,365.7788,1.97222209,120,0,0,1,0,0), -- Bowyer Randolph +(@GUID+31,31052,571,1,0x00000080,0,0,5302.57373,2750.40332,409.274658,5.46288061,120,0,0,1,0,0), +(@GUID+32,31054,571,1,0x00000040,0,0,5088.611,2167.66235,365.688751,0.6806784,120,0,0,1,0,0), -- Anchorite Tessa +(@GUID+33,31054,571,1,0x00000080,0,0,5372.05859,3028.33618,409.206024,0.012565271,120,0,0,1,0,0), +(@GUID+34,31108,571,1,0x00000040,0,0,5095.673,2193.284,365.9236,4.939282,120,0,0,1,0,0), -- Siege Master Stouthandle +(@GUID+35,31108,571,1,0x00000080,0,0,5298.267,2924.97632,409.274658,0.9075712,120,0,0,1,0,0), +(@GUID+36,31109,571,1,0x00000040,0,0,5080.403,2199.00244,359.4894,2.96705961,120,0,0,1,0,0), -- Senior Demolitionist Legoso +(@GUID+37,31109,571,1,0x00000080,0,0,5228.2915,2809.888,409.274658,3.19395256,120,0,0,1,0,0), +(@GUID+38,31153,571,1,0x00000040,0,0,5088.48633,2188.17871,365.646973,5.253441,120,0,0,1,0,0), -- Tactical Officer Ahbramis +(@GUID+39,31153,571,1,0x00000080,0,0,5364.784,2835.135,409.3225,3.12413931,120,0,0,1,0,0), +(@GUID+40,32294,571,1,0x00000080,0,0,5374.568,2790.784,409.3225,2.72271371,120,0,0,1,0,0), -- Knight Dameron +(@GUID+41,39172,571,1,0x00000080,0,0,5372.672,2786.74048,409.4423,2.80998015,120,0,0,1,0,0), -- Marshal Magruder +(@GUID+42,30488,571,1,0x00000080,0,0,5370.428,2814.274,409.3225,3.054326,120,0,0,1,0,0), -- Travis Day +-- Horde NPC's +(@GUID+43,30870,571,1,0x00000001,0,0,5023.4043,3686.03345,363.1192,5.131268,120,0,0,1,0,0), -- Herzo Safeflight +(@GUID+44,31053,571,1,0x00000040,0,0,5379.875,3027.43359,409.206024,0,120,0,0,1,0,0), -- Primalist Mulfort +(@GUID+45,31053,571,1,0x00000080,0,0,5034.703125,3666.703125,363.273865,4.310963,120,0,0,1,0,0), +(@GUID+46,31091,571,1,0x00000040,0,0,5347.7915,2837.38574,409.3466,2.62603331,120,0,0,1,0,0), -- Commander Dardosh +(@GUID+47,31091,571,1,0x00000080,0,0,5018.662109,3672.279541,362.862885,2.209141,120,0,0,1,0,0), +(@GUID+48,31101,571,1,0x00000040,0,0,5296.564,2789.87378,409.274658,0.7330383,120,0,0,1,0,0), -- Hoodoo Master Fu'jin +(@GUID+49,31101,571,1,0x00000080,0,0,5014.065430,3678.846436,362.995575,5.096361,120,0,0,1,0,0), +(@GUID+50,31102,571,1,0x00000040,0,0,5295.455,2732.87549,409.274658,4.7211113,120,0,0,1,0,0), -- Vieron Blazefeather +(@GUID+51,31102,571,1,0x00000080,0,0,5031.676270,3655.820801,362.234558,5.131268,120,0,0,1,0,0), +(@GUID+52,31106,571,1,0x00000040,0,0,5295.56348,2926.67188,409.274658,0.87266463,120,0,0,1,0,0), -- Siegesmith Stronghoof +(@GUID+53,31106,571,1,0x00000080,0,0,5037.602051,3675.459717,363.147888,3.176499,120,0,0,1,0,0), +(@GUID+54,31107,571,1,0x00000040,0,0,5230.09033,2876.635,409.316254,-2.19854617,120,0,0,1,0,0), -- Lieutenant Murp +(@GUID+55,31107,571,1,0x00000080,0,0,5004.455078,3661.089111,361.335785,3.979351,120,0,0,1,0,0), +(@GUID+56,31151,571,1,0x00000040,0,0,5363.2876,2834.52954,409.3606,2.76273036,120,0,0,1,0,0), -- Tactical Officer Kilrath +(@GUID+57,31151,571,1,0x00000080,0,0,5034.698242,3683.268799,363.129120,4.310963,120,0,0,1,0,0), +(@GUID+58,32296,571,1,0x00000040,0,0,5374.568,2790.784,409.3225,2.60054,120,0,0,1,0,0), -- Stone Guard Mukar +-- Missing noc in fortress +(@GUID+60,39173,571,1,0x00000040,0,0,5372.672,2786.74048,409.4423,2.80998015,120,0,0,1,0,0); -- Champion Ros'slai + +-- corrects previously inserted creature +UPDATE `creature` SET `spawndist`=0 WHERE `guid`=88315; + +-- Pathing for Anchorite Tessa Entry: 31054 +SET @NPC := @GUID+33; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `MovementType`=2 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,5382.507,3028.468,409.206,0,0,0,100,0), +(@PATH,2,5392.744,3028.737,409.206,0,0,0,100,0), +(@PATH,3,5382.507,3028.468,409.206,0,0,0,100,0), +(@PATH,4,5371.491,3028.329,409.206,0,0,0,100,0), +(@PATH,5,5360.032,3028.516,409.3161,0,0,0,100,0), +(@PATH,6,5371.491,3028.329,409.206,0,0,0,100,0); + +-- Pathing for Commander Zanneth Entry: 31036 +SET @NPC := @GUID+27; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=5358.854,`position_y`=2859.232,`position_z`=409.5425 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,14337, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,5359.788,2846.359,409.3642,0,0,0,100,0), +(@PATH,2,5359.187,2839.211,409.3642,0,0,0,100,0), +(@PATH,3,5360.083,2823.116,409.5381,0,0,0,100,0), +(@PATH,4,5359.187,2839.211,409.3642,0,0,0,100,0), +(@PATH,5,5359.788,2846.359,409.3642,0,0,0,100,0), +(@PATH,6,5358.854,2859.232,409.5425,0,0,0,100,0); + +-- Pathing for Commander Dardosh Entry: 31091 +SET @NPC := @GUID+46; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `MovementType`=2,`position_x`=5359.546,`position_y`=2858.049,`position_z`=409.3642 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,257,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,5359.202,2843.208,409.3642,0,0,0,100,0), +(@PATH,2,5358.997,2827.974,409.3639,0,0,0,100,0), +(@PATH,3,5359.202,2843.208,409.3642,0,0,0,100,0), +(@PATH,4,5359.546,2858.049,409.3642,0,0,0,100,0); + +-- Pathing for Commander Dardosh Entry: 31091 +SET @NPC := @GUID+47; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `MovementType`=2,`position_x`=5018.411133,`position_y`=3672.615967,`position_z`=362.863525 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,257,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,5022.827637,3666.665771,362.205750,0,0,0,100,0), +(@PATH,2,5024.270508,3658.739258,361.705750,0,0,0,100,0), +(@PATH,3,5022.827637,3666.665771,362.205750,0,0,0,100,0), +(@PATH,4,5018.411133,3672.615967,362.863525,0,0,0,100,0); + +-- Pathing for Primalist Mulfort Entry: 31053 +SET @NPC := @GUID+44; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `MovementType`=2 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,257,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,5390.624,3027.994,409.206,0,0,0,100,0), +(@PATH,2,5379.875,3027.434,409.206,0,0,0,100,0), +(@PATH,3,5371.404,3026.511,409.206,0,0,0,100,0), +(@PATH,4,5379.875,3027.434,409.206,0,0,0,100,0); + +-- Pathing for Vieron Blazefeather Entry: 31102 +SET @NPC := @GUID+50; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `MovementType`=2,`position_x`=5296.644,`position_y`=2731.107,`position_z`=409.3163 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,5295.544,2722.631,409.3163,0,0,0,100,0), +(@PATH,2,5296.644,2731.107,409.3163,0,0,0,100,0), +(@PATH,3,5297.874,2738.155,409.3163,0,0,0,100,0), +(@PATH,4,5305.192,2746.161,409.3061,0,0,0,100,0), +(@PATH,5,5297.874,2738.155,409.3163,0,0,0,100,0), +(@PATH,6,5296.644,2731.107,409.3163,0,0,0,100,0); + +-- Guards "Alliance" (Valiance Expedition Champion) +SET @GUID := 88371; +DELETE FROM `creature` WHERE `id`=30740; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +-- Fortress +(@GUID+0,30740,571,1,0x00000080,0,0,5150.26855,2786.02173,409.5469,3.22885919,120,0,0,1,0,0), +(@GUID+1,30740,571,1,0x00000080,0,0,5150.657,2777.9502,409.4053,2.94960642,120,0,0,1,0,0), +(@GUID+2,30740,571,1,0x00000080,0,0,5193.632,2734.172,409.272552,4.694936,120,0,0,1,0,0), +(@GUID+3,30740,571,1,0x00000080,0,0,5200.497,2733.88843,409.272552,4.677482,120,0,0,1,0,0), +(@GUID+4,30740,571,1,0x00000080,0,0,5264.64648,2670.1936,409.1819,3.07177949,120,0,0,1,0,0), +(@GUID+5,30740,571,1,0x00000080,0,0,5265.30566,2663.15381,409.1819,3.12413931,120,0,0,1,0,0), +(@GUID+6,30740,571,1,0x00000080,0,0,5307.02051,2613.89771,409.172363,4.694936,120,0,0,1,0,0), +(@GUID+7,30740,571,1,0x00000080,0,0,5311.133,3061.04248,408.809937,1.50098312,120,0,0,1,0,0), +(@GUID+8,30740,571,1,0x00000080,0,0,5315.87354,2614.21924,408.972748,4.677482,120,0,0,1,0,0), +(@GUID+9,30740,571,1,0x00000080,0,0,5318.09,3060.634,408.882782,1.62315619,120,0,0,1,0,0), +(@GUID+10,30740,571,1,0x00000080,0,0,5149.395,2897.044,409.304443,3.03687286,120,0,0,1,0,0), +(@GUID+11,30740,571,1,0x00000080,0,0,5149.51953,2904.19336,409.276062,3.07177949,120,0,0,1,0,0), +(@GUID+12,30740,571,1,0x00000080,0,0,5192.79248,2948.454,409.2746,1.50098312,120,0,0,1,0,0), +(@GUID+13,30740,571,1,0x00000080,0,0,5201.645,2948.77612,409.2746,1.62315619,120,0,0,1,0,0), +(@GUID+14,30740,571,1,0x00000080,0,0,5265.28,3010.10083,408.895782,2.82743335,120,0,0,1,0,0), +(@GUID+15,30740,571,1,0x00000080,0,0,5265.47559,3017.39941,408.582977,3.07177949,120,0,0,1,0,0), +(@GUID+16,30740,571,1,0x00000080,0,0,5367.91455,2826.52026,409.3225,3.33357882,120,0,0,1,0,0), +(@GUID+17,30740,571,1,0x00000080,0,0,5368.71338,2856.36035,409.3225,2.94960642,120,0,0,1,0,0), +(@GUID+18,30740,571,1,0x00000080,0,0,5388.56,2834.76782,418.7585,3.07177949,120,0,0,1,0,0), +(@GUID+19,30740,571,1,0x00000080,0,0,5389.272,2847.36816,418.7585,3.106686,120,0,0,1,0,0), +(@GUID+20,30740,571,1,0x00000080,0,0,4684.475,2414.28979,369.9621,-2.85779858,120,0,0,1,0,0), +(@GUID+21,30740,571,1,0x00000080,0,0,4692.75635,2392.88574,369.0177,-2.82921553,120,0,0,1,0,0), +(@GUID+22,30740,571,1,0x00000080,0,0,5327.264648,2659.455322,409.178711,3.069901,120,0,0,1,0,0), -- F1307814000A2DAD path +(@GUID+23,30740,571,1,0x00000080,0,0,5154.225586,2833.824219,409.262451,3.124139,120,0,0,1,0,0), +(@GUID+24,30740,571,1,0x00000080,0,0,5154.119629,2847.892822,409.247559,3.071779,120,0,0,1,0,0), +(@GUID+25,30740,571,1,0x00000080,0,0,5179.111328,2837.129639,409.274658,3.211406,120,0,0,1,0,0), +(@GUID+26,30740,571,1,0x00000080,0,0,5179.666504,2846.597900,409.274658,3.089233,120,0,0,1,0,0), +(@GUID+27,30740,571,1,0x00000080,0,0,5270.163086,2833.479248,409.274658,3.124139,120,0,0,1,0,0), +(@GUID+28,30740,571,1,0x00000080,0,0,5270.057129,2847.547607,409.274658,3.071779,120,0,0,1,0,0), +(@GUID+29,30740,571,1,0x00000080,0,0,5307.750000,3008.872559,409.193024,4.781681,120,0,0,1,0,0), -- F1307814000A43AE path +(@GUID+30,30740,571,1,0x00000080,0,0,5335.117188,2916.802002,409.443756,1.500983,120,0,0,1,0,0), +(@GUID+31,30740,571,1,0x00000080,0,0,5350.681152,2917.011719,409.274658,1.466077,120,0,0,1,0,0), +(@GUID+32,30740,571,1,0x00000080,0,0,5335.306152,2764.110352,409.274567,4.834562,120,0,0,1,0,0), +(@GUID+33,30740,571,1,0x00000080,0,0,5349.811523,2763.634766,409.333374,4.660029,120,0,0,1,0,0), +-- Eastspark Workshop +(@GUID+34,30740,571,1,0x00000080,0,0,4349.537,2411.25781,374.743317,2.05948853,120,0,0,1,0,0), +(@GUID+35,30740,571,1,0x00000080,0,0,4388.13135,2411.97827,374.743317,1.6406095,120,0,0,1,0,0), +(@GUID+36,30740,571,1,0x00000080,0,0,4391.6665,2300.60913,374.7433,4.92182827,120,0,0,1,0,0), +(@GUID+37,30740,571,1,0x00000080,0,0,4413.42969,2393.44946,376.3599,1.06465089,120,0,0,1,0,0), +(@GUID+38,30740,571,1,0x00000080,0,0,4417.92,2331.237,370.9189,5.846853,120,0,0,1,0,0), +(@GUID+39,30740,571,1,0x00000080,0,0,4349.11768,2299.27954,374.7433,4.904375,120,0,0,1,0,0), +(@GUID+40,30740,571,1,0x00000080,0,0,4418.608,2355.28735,372.4907,6.02138567,120,0,0,1,0,0); + +-- banners +SET @OGUID := 75939; +DELETE FROM `gameobject` WHERE `id` IN (192254,192255,192269,192284,192285,192286,192287,192292,192299,192304,192305,192306,192307,192308,192309,192310,192312,192313,192314,192316,192317,192318,192319,192320,192321, + 192322,192323,192324,192325,192326,192327,192328,192329,192330,192331,192332,192333,192334,192335,192336,192338,192339,192349,192350,192351,192352,192353,192354,192355,192356, + 192357,192358,192359,192360,192361,192362,192363,192364,192366,192367,192368,192369,192370,192371,192372,192373,192374,192375,192376,192377,192378,192379,192487,192488,192501, + 192502); +DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID AND @OGUID+115; +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES +-- Fortress Banners "Alliance" +(@OGUID+0,192286,571,1,128,5371.44873,2820.79346,409.426575,3.124123,0,0,0,0,120,0,1), +(@OGUID+1,192287,571,1,128,5372.42432,2862.47925,409.3659,3.14159274,0,0,0,0,120,0,1), +(@OGUID+2,192292,571,1,128,5154.35059,2862.08423,445.0105,3.14159274,0,0,0,0,120,0,1), +(@OGUID+3,192299,571,1,128,5155.21631,2820.63013,444.9789,-3.115388,0,0,0,0,120,0,1), +(@OGUID+4,192304,571,1,128,5398.03564,2873.013,455.203552,3.132858,0,0,0,0,120,0,1), +(@OGUID+5,192305,571,1,128,5397.31348,2809.264,455.101624,3.132858,0,0,0,0,120,0,1), +(@OGUID+6,192306,571,1,128,5270.55469,2861.68237,444.917236,-3.124123,0,0,0,0,120,0,1), +(@OGUID+7,192307,571,1,128,5271.16064,2820.10864,445.109,-3.132858,0,0,0,0,120,0,1), +(@OGUID+8,192308,571,1,128,5235.12744,2942.12329,444.2792,1.58824873,0,0,0,0,120,0,1), +(@OGUID+9,192309,571,1,128,5272.549,2976.54175,444.493,3.132858,0,0,0,0,120,0,1), +(@OGUID+10,192310,571,1,128,5352.19775,3055.0166,444.5646,1.57952213,0,0,0,0,120,0,1), +(@OGUID+11,192312,571,1,128,5236.315,2739.21533,444.992828,-1.60570168,0,0,0,0,120,0,1), +(@OGUID+12,192313,571,1,128,5271.634,2704.829,445.182617,-3.124123,0,0,0,0,120,0,1), +(@OGUID+13,192314,571,1,128,5350.905,2622.48,444.649323,-1.56206989,0,0,0,0,120,0,1), +(@OGUID+14,192316,571,1,128,5322.013,2781.13281,435.6727,1.57952213,0,0,0,0,120,0,1), +(@OGUID+15,192317,571,1,128,5363.387,2781.27856,435.634125,1.58824873,0,0,0,0,120,0,1), +(@OGUID+16,192318,571,1,128,5322.24854,2898.94629,435.642975,-1.57952213,0,0,0,0,120,0,1), +(@OGUID+17,192319,571,1,128,5364.30371,2899.216,435.690826,-1.55334139,0,0,0,0,120,0,1), +(@OGUID+18,192320,571,1,128,5289.048,2820.22656,435.6738,0,0,0,0,0,120,0,1), +(@OGUID+19,192321,571,1,128,5288.847,2861.82128,435.590485,0.0261791088,0,0,0,0,120,0,1), +(@OGUID+20,192322,571,1,128,5322.89258,2917.14233,445.1543,1.56206989,0,0,0,0,120,0,1), +(@OGUID+21,192323,571,1,128,5364.283,2917.264,445.332184,1.58824611,0,0,0,0,120,0,1), +(@OGUID+22,192324,571,1,128,5290.514,2976.56177,435.087463,0.008724241,0,0,0,0,120,0,1), +(@OGUID+23,192325,571,1,128,5352.37744,3036.95483,435.111053,-1.56206989,0,0,0,0,120,0,1), +(@OGUID+24,192326,571,1,128,5392.64063,3036.967,433.648682,-1.51843357,0,0,0,0,120,0,1), +(@OGUID+25,192327,571,1,128,5172.336,2862.57544,435.65802,0,0,0,0,0,120,0,1), +(@OGUID+26,192328,571,1,128,5173.12842,2820.95654,435.657623,0.0261791088,0,0,0,0,120,0,1), +(@OGUID+27,192329,571,1,128,5235.32227,2924.31079,434.8981,-1.56206989,0,0,0,0,120,0,1), +(@OGUID+28,192330,571,1,128,5237.02344,2757.35669,435.625641,1.55334139,0,0,0,0,120,0,1), +(@OGUID+29,192331,571,1,128,5289.78125,2704.62158,435.714325,0.008724241,0,0,0,0,120,0,1), +(@OGUID+30,192332,571,1,128,5350.93945,2640.43066,435.2642,1.56206989,0,0,0,0,120,0,1), +(@OGUID+31,192333,571,1,128,5392.28027,2639.84033,435.207916,1.52716041,0,0,0,0,120,0,1), +(@OGUID+32,192334,571,1,128,5322.17041,2763.20142,444.9744,-1.56206715,0,0,0,0,120,0,1), +(@OGUID+33,192335,571,1,128,5363.71631,2763.24731,445.023132,-1.54461551,0,0,0,0,120,0,1), +(@OGUID+34,192487,571,1,128,5145.11133,2934.948,433.254852,-3.10665226,0,0,0,0,120,0,1), +(@OGUID+35,192487,571,1,128,5146.04443,2747.30249,433.527039,3.124123,0,0,0,0,120,0,1), +(@OGUID+36,192487,571,1,128,5158.71,2882.90161,431.27417,3.14159274,0,0,0,0,120,0,1), +(@OGUID+37,192487,571,1,128,5160.28369,2798.59766,430.6037,-3.124123,0,0,0,0,120,0,1), +(@OGUID+38,192487,571,1,128,5162.90674,2952.59766,433.368,1.57079577,0,0,0,0,120,0,1), +(@OGUID+39,192487,571,1,128,5163.85,2729.677,433.327545,-1.60570168,0,0,0,0,120,0,1), +(@OGUID+40,192487,571,1,128,5260.82471,2631.81763,433.181061,3.124123,0,0,0,0,120,0,1), +(@OGUID+41,192487,571,1,128,5262.544,3047.93018,431.96524,3.124123,0,0,0,0,120,0,1), +(@OGUID+42,192487,571,1,128,5278.43066,2613.83276,433.294434,-1.62315571,0,0,0,0,120,0,1), +(@OGUID+43,192487,571,1,128,5280.894,3064.95386,431.9758,1.55334139,0,0,0,0,120,0,1), +-- Fortress Banners "Horde" +(@OGUID+44,192269,571,1,64,4526.46,2810.18,391.2,-2.99322,0,0,0,1,180,0,1), +(@OGUID+45,192284,571,1,64,5372.48,2862.5,409.049,3.14159,0,0,0,1,180,0,1), +(@OGUID+46,192285,571,1,64,5371.49,2820.8,409.177,3.14159,0,0,0,1,180,0,1), +(@OGUID+47,192338,571,1,64,5397.76,2873.08,455.461,3.10665,0,0,0,1,180,0,1), +(@OGUID+48,192339,571,1,64,5397.39,2809.33,455.344,3.10665,0,0,0,1,180,0,1), +(@OGUID+49,192349,571,1,64,5155.31,2820.74,444.979,-3.13286,0,0,0,1,180,0,1), +(@OGUID+50,192350,571,1,64,5270.69,2861.78,445.058,-3.11539,0,0,0,1,180,0,1), +(@OGUID+51,192351,571,1,64,5271.28,2820.16,445.201,-3.13286,0,0,0,1,180,0,1), +(@OGUID+52,192352,571,1,64,5173.02,2820.93,435.72,0.017452,0,0,0,1,180,0,1), +(@OGUID+53,192353,571,1,64,5172.11,2862.57,435.721,0.017452,0,0,0,1,180,0,1), +(@OGUID+54,192354,571,1,64,5288.41,2861.79,435.721,0.017452,0,0,0,1,180,0,1), +(@OGUID+55,192355,571,1,64,5288.92,2820.22,435.721,0.017452,0,0,0,1,180,0,1), +(@OGUID+56,192356,571,1,64,5237.07,2757.03,435.796,1.51844,0,0,0,1,180,0,1), +(@OGUID+57,192357,571,1,64,5235.34,2924.34,435.04,-1.5708,0,0,0,1,180,0,1), +(@OGUID+58,192358,571,1,64,5322.23,2899.43,435.808,-1.58825,0,0,0,1,180,0,1), +(@OGUID+59,192359,571,1,64,5364.35,2899.4,435.839,-1.5708,0,0,0,1,180,0,1), +(@OGUID+60,192360,571,1,64,5352.37,3037.09,435.252,-1.5708,0,0,0,1,180,0,1), +(@OGUID+61,192361,571,1,64,5392.65,3037.11,433.713,-1.52716,0,0,0,1,180,0,1), +(@OGUID+62,192362,571,1,64,5322.12,2763.61,444.974,-1.55334,0,0,0,1,180,0,1), +(@OGUID+63,192363,571,1,64,5363.61,2763.39,445.024,-1.54462,0,0,0,1,180,0,1), +(@OGUID+64,192364,571,1,64,5350.88,2622.72,444.686,-1.5708,0,0,0,1,180,0,1), +(@OGUID+65,192366,571,1,64,5236.27,2739.46,444.992,-1.59698,0,0,0,1,180,0,1), +(@OGUID+66,192367,571,1,64,5271.8,2704.87,445.183,-3.13286,0,0,0,1,180,0,1), +(@OGUID+67,192368,571,1,64,5289.46,2704.68,435.875,-0.017451,0,0,0,1,180,0,1), +(@OGUID+68,192369,571,1,64,5350.95,2640.36,435.408,1.5708,0,0,0,1,180,0,1), +(@OGUID+69,192370,571,1,64,5392.27,2639.74,435.331,1.50971,0,0,0,1,180,0,1), +(@OGUID+70,192371,571,1,64,5364.29,2916.94,445.331,1.57952,0,0,0,1,180,0,1), +(@OGUID+71,192372,571,1,64,5322.86,2916.95,445.154,1.56207,0,0,0,1,180,0,1), +(@OGUID+72,192373,571,1,64,5290.35,2976.56,435.221,0.017452,0,0,0,1,180,0,1), +(@OGUID+73,192374,571,1,64,5272.94,2976.55,444.492,3.12412,0,0,0,1,180,0,1), +(@OGUID+74,192375,571,1,64,5235.19,2941.9,444.278,1.58825,0,0,0,1,180,0,1), +(@OGUID+75,192376,571,1,64,5352.19775,3055.0166,444.5646,1.57952,0,0,0,0,120,0,1), +(@OGUID+76,192377,571,1,64,5414.19,3069.8,415.187,1.64061,0,0,0,1,180,0,1), +(@OGUID+77,192378,571,1,64,5322.02,2781.13,435.811,1.5708,0,0,0,1,180,0,1), +(@OGUID+78,192379,571,1,64,5363.42,2781.03,435.763,1.5708,0,0,0,1,180,0,1), +(@OGUID+79,192254,571,1,64,5154.46,2828.94,409.189,3.14159,0,0,0,1,180,0,1), +(@OGUID+80,192255,571,1,64,5154.52,2853.31,409.183,3.14159,0,0,0,1,180,0,1), +(@OGUID+81,192336,571,1,64,5154.49,2862.15,445.012,3.14159,0,0,0,1,180,0,1), +(@OGUID+82,192488,571,1,64,5160.34,2798.61,430.769,3.14159,0,0,0,1,180,0,1), +(@OGUID+83,192488,571,1,64,5158.81,2883.13,431.618,3.14159,0,0,0,1,180,0,1), +(@OGUID+84,192488,571,1,64,5278.38,2613.83,433.409,-1.58825,0,0,0,1,180,0,1), +(@OGUID+85,192488,571,1,64,5260.82,2631.8,433.324,3.05433,0,0,0,1,180,0,1), +(@OGUID+86,192488,571,1,64,5163.13,2952.59,433.503,1.53589,0,0,0,1,180,0,1), +(@OGUID+87,192488,571,1,64,5145.11,2935,433.386,3.14159,0,0,0,1,180,0,1), +(@OGUID+88,192488,571,1,64,5262.54,3047.95,432.055,3.10665,0,0,0,1,180,0,1), +(@OGUID+89,192488,571,1,64,5146.04,2747.21,433.584,3.07177,0,0,0,1,180,0,1), +(@OGUID+90,192488,571,1,64,5163.78,2729.68,433.394,-1.58825,0,0,0,1,180,0,1), +(@OGUID+91,192488,571,1,64,5280.894,3064.95386,431.9758,1.55334139,0,0,0,0,120,0,1), +-- Tower Banners "Alliance" +(@OGUID+92,192501,571,1,64,4398.82,2804.7,429.792,-1.58825,0,0,0,1,180,0,1), +(@OGUID+93,192501,571,1,64,4416,2822.67,429.851,-0.017452,0,0,0,1,180,0,1), +(@OGUID+94,192501,571,1,64,4559.11,3606.22,419.999,-1.48353,0,0,0,1,180,0,1), +(@OGUID+95,192501,571,1,64,4539.42,3622.49,420.034,-3.07177,0,0,0,1,180,0,1), +(@OGUID+96,192501,571,1,64,4555.26,3641.65,419.974,1.67551,0,0,0,1,180,0,1), +(@OGUID+97,192501,571,1,64,4574.87,3625.91,420.079,0.087266,0,0,0,1,180,0,1), +(@OGUID+98,192501,571,1,64,4466.79,1960.42,459.144,1.15192,0,0,0,1,180,0,1), +(@OGUID+99,192501,571,1,64,4475.35,1937.03,459.07,-0.436332,0,0,0,1,180,0,1), +(@OGUID+100,192501,571,1,64,4451.76,1928.1,459.076,-2.00713,0,0,0,1,180,0,1), +(@OGUID+101,192501,571,1,64,4442.99,1951.9,459.093,2.74016,0,0,0,1,180,0,1), +(@OGUID+102,192501,571,1,64,4380.36328,2822.38013,429.8818,-3.106652,0,0,0,0,120,0,1), +(@OGUID+103,192501,571,1,64,4397.6626,2840.299,429.921661,1.58824873,0,0,0,0,120,0,1), +-- Tower Banners "Horde" +(@OGUID+104,192502,571,1,128,4398.82,2804.7,429.792,-1.58825,0,0,0,1,180,0,1), +(@OGUID+105,192502,571,1,128,4416,2822.67,429.851,-0.017452,0,0,0,1,180,0,1), +(@OGUID+106,192502,571,1,128,4559.11,3606.22,419.999,-1.48353,0,0,0,1,180,0,1), +(@OGUID+107,192502,571,1,128,4539.42,3622.49,420.034,-3.07177,0,0,0,1,180,0,1), +(@OGUID+108,192502,571,1,128,4555.26,3641.65,419.974,1.67551,0,0,0,1,180,0,1), +(@OGUID+109,192502,571,1,128,4574.87,3625.91,420.079,0.087266,0,0,0,1,180,0,1), +(@OGUID+110,192502,571,1,128,4466.79,1960.42,459.144,1.15192,0,0,0,1,180,0,1), +(@OGUID+111,192502,571,1,128,4475.35,1937.03,459.07,-0.436332,0,0,0,1,180,0,1), +(@OGUID+112,192502,571,1,128,4451.76,1928.1,459.076,-2.00713,0,0,0,1,180,0,1), +(@OGUID+113,192502,571,1,128,4442.99,1951.9,459.093,2.74016,0,0,0,1,180,0,1), +(@OGUID+114,192502,571,1,128,4380.36328,2822.38013,429.8818,-3.106652,0,0,0,0,120,0,1), +(@OGUID+115,192502,571,1,128,4397.6626,2840.299,429.921661,1.58824873,0,0,0,0,120,0,1); + +SET @OGUID := 17780; +DELETE FROM `gameobject` WHERE `id` IN (192458,192459,192460,192461,192289,192290,192434,192435,192280,192283,192425,192426,192427,192428,192288,192291,192400,192401,192281,192282); +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES +-- The Sunken Ring "Horde" +(@OGUID+0,192458,571,1,16,4811.4,2441.9,358.207,-2.0333,0,0,0,1,180,0,1), +(@OGUID+1,192459,571,1,16,4805.67,2407.48,358.191,1.78023,0,0,0,1,180,0,1), +(@OGUID+2,192460,571,1,16,5004.35,2486.36,358.449,2.17294,0,0,0,1,180,0,1), +(@OGUID+3,192461,571,1,16,4983.28,2503.09,358.177,-0.427603,0,0,0,1,180,0,1), +(@OGUID+4,192289,571,1,16,4778.19,2438.06,345.644,-2.94088,0,0,0,1,180,0,1), +(@OGUID+5,192290,571,1,16,5024.57,2532.75,344.023,-1.93732,0,0,0,1,180,0,1), +-- The Sunken Ring "Alliance" +(@OGUID+6,192425,571,1,32,4811.435,2441.84546,357.982483,-2.02457881,0,0,0,0,120,0,1), +(@OGUID+7,192426,571,1,32,4805.514,2407.84375,357.940765,1.7715075,0,0,0,0,120,0,1), +(@OGUID+8,192427,571,1,32,5004.35,2486.36,358.449,2.17294,0,0,0,1,180,0,1), +(@OGUID+9,192428,571,1,32,4983.221,2503.27271,357.959534,-0.43633157,0,0,0,0,120,0,1), +(@OGUID+10,192288,571,1,32,4778.065,2438.02441,345.7063,-2.932139,0,0,0,0,120,0,1), +(@OGUID+11,192291,571,1,32,5024.608,2532.72583,344.4308,-1.94604158,0,0,0,0,120,0,1), +-- The Broken Temple "Horde" +(@OGUID+12,192434,571,1,16,5041.61,3294.4,382.15,-1.63188,0,0,0,1,180,0,1), +(@OGUID+13,192435,571,1,16,4855.63,3297.62,376.739,-3.13286,0,0,0,1,180,0,1), +(@OGUID+14,192280,571,1,16,4857.97,3335.44,368.881,-2.94959,0,0,0,1,180,0,1), +(@OGUID+15,192283,571,1,16,5006.34,3280.4,371.163,2.22529,0,0,0,1,180,0,1), +-- The Broken Temple "Alliance" +(@OGUID+16,192400,571,1,32,5041.650879,3294.318604,381.919952,-1.605702,0,0,0,1,180,0,1), +(@OGUID+17,192401,571,1,32,4855.444336,3297.600830,376.495758,-3.115388,0,0,0,1,180,0,1), +(@OGUID+18,192281,571,1,32,4857.971191,3335.415771,369.291901,-2.888511,0,0,0,1,180,0,1), +(@OGUID+19,192282,571,1,32,5006.322754,3280.362061,371.242249,2.242746,0,0,0,1,180,0,1); diff --git a/sql/old/3.3.5a/2012_02_29_00_world_conditions_misc.sql b/sql/old/3.3.5a/2012_02_29_00_world_conditions_misc.sql new file mode 100644 index 00000000000..34eb1261ed1 --- /dev/null +++ b/sql/old/3.3.5a/2012_02_29_00_world_conditions_misc.sql @@ -0,0 +1,126 @@ +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=18 AND `SourceGroup` IN(34125,33796,33798,33799,33791,33792,33790, +33795,33793,33800,33794,33843,33842,26421,26477,28161,29856,32788,32790); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`, +`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`Comment`) VALUES +-- Stabled Campagin Warhorse Requires Any of the Dailies +(18,34125,63215,1,9,0,13847,0,0,0,'Required quest active for spellclick'), +(18,34125,63215,2,9,0,13851,0,0,0,'Required quest active for spellclick'), +(18,34125,63215,3,9,0,13852,0,0,0,'Required quest active for spellclick'), +(18,34125,63215,4,9,0,13854,0,0,0,'Required quest active for spellclick'), +(18,34125,63215,5,9,0,13855,0,0,0,'Required quest active for spellclick'), +(18,34125,63215,6,9,0,13856,0,0,0,'Required quest active for spellclick'), +(18,34125,63215,7,9,0,13857,0,0,0,'Required quest active for spellclick'), +(18,34125,63215,8,9,0,13858,0,0,0,'Required quest active for spellclick'), +(18,34125,63215,9,9,0,13859,0,0,0,'Required quest active for spellclick'), +(18,34125,63215,10,9,0,13860,0,0,0,'Required quest active for spellclick'), +(18,34125,63215,11,9,0,13861,0,0,0,'Required quest active for spellclick'), +(18,34125,63215,12,9,0,13862,0,0,0,'Required quest active for spellclick'), +(18,34125,63215,13,9,0,13863,0,0,0,'Required quest active for spellclick'), +(18,34125,63215,14,9,0,13864,0,0,0,'Required quest active for spellclick'), +-- Raptor requires (A) Valiant of Sen'Jin +(18,33796,62784,1,8,0,13693,0,0,0,'Required quest rewarded for spellclick'), +(18,33796,62784,2,8,0,13708,0,0,0,'Required quest rewarded for spellclick'), +-- Forsaken Warhorse requires (A) Valiant of Undercity +(18,33798,62787,1,8,0,13695,0,0,0,'Required quest rewarded for spellclick'), +(18,33798,62787,2,8,0,13710,0,0,0,'Required quest rewarded for spellclick'), +-- Orgrimmar Wolf requires (A) Valiant of Orgrimmar +(18,33799,62783,1,8,0,13691,0,0,0,'Required quest rewarded for spellclick'), +(18,33799,62783,2,8,0,13707,0,0,0,'Required quest rewarded for spellclick'), +-- Silvermoon Hawkstrider requires (A) Valiant of Silvermoon +(18,33791,62786,1,8,0,13696,0,0,0,'Required quest rewarded for spellclick'), +(18,33791,62786,2,8,0,13711,0,0,0,'Required quest rewarded for spellclick'), +-- Thunder Bluff Kodo requires (A) Valiant of Thunder Bluff +(18,33792,62785,1,8,0,13694,0,0,0,'Required quest rewarded for spellclick'), +(18,33792,62785,2,8,0,13709,0,0,0,'Required quest rewarded for spellclick'), +-- Exodar Elekk requires (A) Valiant of the Exodar +(18,33790,62781,1,8,0,13690,0,0,0,'Required quest rewarded for spellclick'), +(18,33790,62781,2,8,0,13705,0,0,0,'Required quest rewarded for spellclick'), +-- Ironforge Ram requires (A) Valiant of Ironforge +(18,33795,62779,1,8,0,13685,0,0,0,'Required quest rewarded for spellclick'), +(18,33795,62779,2,8,0,13703,0,0,0,'Required quest rewarded for spellclick'), +-- Gnomeregan Mechanostrider requires (A) Valiant of Gnomeregan +(18,33793,62780,1,8,0,13688,0,0,0,'Required quest rewarded for spellclick'), +(18,33793,62780,2,8,0,13704,0,0,0,'Required quest rewarded for spellclick'), +-- Stormwind Steed requires (A) Valiant of Stormwind +(18,33800,62774,1,8,0,13593,0,0,0,'Required quest rewarded for spellclick'), +(18,33800,62774,2,8,0,13684,0,0,0,'Required quest rewarded for spellclick'), +-- Darnassian Nightsaber requires (A) Valiant of Darnassus +(18,33794,62782,1,8,0,13689,0,0,0,'Required quest rewarded for spellclick'), +(18,33794,62782,2,8,0,13706,0,0,0,'Required quest rewarded for spellclick'), +-- Stabled Quel'Dorei steeds requires The Argent Tournament rewarded +(18,33843,63792,0,8,0,13667,0,0,0,'Required quest rewarded for spellclick'), +-- Stabled Quel'Dorei steed forbids Alliance Eligibility Marker rewarded +(18,33843,63792,0,8,0,13686,0,0,1,'Forbidden rewarded quest for spellclick'), +-- Sunreaver Hawkstrider requires The Argent Tournament rewarded +(18,33842,63791,0,8,0,13668,0,0,0,'Required quest rewarded for spellclick'), +-- Sunreaver Hawkstrider forbids Horde Eligibility Marker rewarded +(18,33842,63791,0,8,0,13687,0,0,1,'Forbidden rewarded quest for spellclick'), +-- Misc +(18,26421,47575,0,8,0,12092,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,26421,47575,0,8,0,12096,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,26421,47575,1,9,0,12092,0,0,0,'Required quest active for spellclick'), +(18,26421,47575,2,9,0,12096,0,0,0,'Required quest active for spellclick'), +(18,26477,47096,0,8,0,11999,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,26477,47096,0,8,0,12000,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,26477,61286,0,8,0,11999,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,26477,61286,0,8,0,12000,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,26477,61832,0,8,0,11999,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,26477,61832,0,8,0,12000,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,26477,61286,1,9,0,11999,0,0,0,'Required quest active for spellclick'), +(18,26477,61286,2,9,0,12000,0,0,0,'Required quest active for spellclick'), +(18,26477,47096,1,9,0,11999,0,0,0,'Required quest active for spellclick'), +(18,26477,47096,2,9,0,12000,0,0,0,'Required quest active for spellclick'), +(18,26477,61832,1,9,0,11999,0,0,0,'Required quest active for spellclick'), +(18,26477,61832,2,9,0,12000,0,0,0,'Required quest active for spellclick'), +(18,28161,39996,0,8,0,12532,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,28161,39996,0,8,0,12702,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,28161,39996,1,9,0,12532,0,0,0,'Required quest active for spellclick'), +(18,28161,39996,2,9,0,12702,0,0,0,'Required quest active for spellclick'), +(18,28161,51037,0,8,0,12532,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,28161,51037,0,8,0,12702,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,28161,51037,1,9,0,12532,0,0,0,'Required quest active for spellclick'), +(18,28161,51037,2,9,0,12702,0,0,0,'Required quest active for spellclick'), +(18,28161,51961,0,8,0,12532,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,28161,51961,0,8,0,12702,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,28161,51961,1,9,0,12532,0,0,0,'Required quest active for spellclick'), +(18,28161,51961,2,9,0,12702,0,0,0,'Required quest active for spellclick'), +(18,29856,55363,0,8,0,12629,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,29856,55363,0,8,0,12643,0,0,1,'Forbidden rewarded quest for spellclick'), +(18,29856,55363,1,9,0,12629,0,0,0,'Required quest active for spellclick'), +(18,29856,55363,2,9,0,12643,0,0,0,'Required quest active for spellclick'), +(18,32788,57539,1,8,0,13075,0,0,0,'Required quest rewarded for spellclick'), +(18,32788,57539,2,9,0,13075,0,0,0,'Required quest active for spellclick'), +(18,32790,57654,1,8,0,13073,0,0,0,'Required quest rewarded for spellclick'), +(18,32790,57654,2,9,0,13073,0,0,0,'Required quest active for spellclick'); + +-- Remove duplicate entries in npc_spellclick_spells (leave 1) +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry` IN(34125,26421,26477,28161, +31157,33790,33791,33792,33793,33794,33795,33796,33798,33799,33800,34944,29856,30564,29414,31269); +INSERT INTO `npc_spellclick_spells` (`npc_entry`, `spell_id`, `cast_flags`, `user_type`) VALUES +(26477,47096,2,0), +(26477,61286,2,0), +(26477,61832,0,0), +(29414,18277,1,0), +(29856,55363,2,0), +(31269,46598,1,0), +(33794,62782,1,0), +(28161,51037,2,0), +(28161,39996,1,0), +(30564,57401,1,0), +(34125,63215,1,0), +(34944,68458,1,0), +(33790,62781,1,0), +(33793,62780,1,0), +(33795,62779,1,0), +(33800,62774,1,0), +(33798,62787,1,0), +(31157,46598,1,0), +(26421,47575,1,0), +(28161,51961,1,0), +(33791,62786,1,0), +(33792,62785,1,0), +(33796,62784,1,0), +(33799,62783,1,0); + +-- If this query fails, fix your custom content +ALTER TABLE `npc_spellclick_spells` ADD PRIMARY KEY(`npc_entry`,`spell_id`); \ No newline at end of file diff --git a/sql/old/3.3.5a/2012_02_29_01_world_conditions.sql b/sql/old/3.3.5a/2012_02_29_01_world_conditions.sql new file mode 100644 index 00000000000..bae8baf51a9 --- /dev/null +++ b/sql/old/3.3.5a/2012_02_29_01_world_conditions.sql @@ -0,0 +1,5 @@ +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=18 AND `SourceGroup`=29488 AND `SourceEntry`=54568; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`, +`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`Comment`) VALUES +(18,29488,54568,15,8,0,12670,0,0,0,'Required quest rewarded for spellclick'), +(18,29488,54568,15,9,0,12670,0,0,0,'Required quest active for spellclick'); diff --git a/sql/old/3.3.5a/2012_02_29_02_world_conditions.sql b/sql/old/3.3.5a/2012_02_29_02_world_conditions.sql new file mode 100644 index 00000000000..a28e6d6424f --- /dev/null +++ b/sql/old/3.3.5a/2012_02_29_02_world_conditions.sql @@ -0,0 +1,5 @@ +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=18 AND `SourceGroup`=29488 AND `SourceEntry`=54568; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`, +`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`Comment`) VALUES +(18,29488,54568,1,8,0,12670,0,0,0,'Required quest rewarded for spellclick'), +(18,29488,54568,2,9,0,12670,0,0,0,'Required quest active for spellclick'); diff --git a/sql/old/3.3.5a/2012_02_29_03_world_creature_text.sql b/sql/old/3.3.5a/2012_02_29_03_world_creature_text.sql new file mode 100644 index 00000000000..2e1d3d77dde --- /dev/null +++ b/sql/old/3.3.5a/2012_02_29_03_world_creature_text.sql @@ -0,0 +1,18 @@ +-- NPC talk text insert from sniff +DELETE FROM `script_texts` WHERE `npc_entry`=28923; +DELETE FROM `creature_text` WHERE `entry`=28923; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(28923,0,0, 'I have witnessed the rise and fall of empires... the birth and extinction of entire species... Over countless millennia the foolishness of mortals has remained the only constant. Your presence here confirms this.',14,0,100,0,0,14160, 'Loken'), +(28923,1,0, 'My master has shown me the future, and you have no place in it. Azeroth will be reborn in darkness. Yogg-Saron shall be released! The Pantheon shall fall!',14,0,100,0,0,14161, 'Loken'), +(28923,2,0, 'What hope is there for you? None!',14,0,100,0,0,14162, 'Loken'), +(28923,3,0, 'You cannot hide from fate!',14,0,100,0,0,14163, 'Loken'), +(28923,3,1, 'Come closer. I will make it quick.',14,0,100,0,0,14164, 'Loken'), +(28923,3,2, 'Your flesh cannot hold out for long.',14,0,100,0,0,14165, 'Loken'), +(28923,4,0, 'Only mortal...',14,0,100,0,0,14166, 'Loken'), +(28923,4,1, 'I... am... FOREVER!',14,0,100,0,0,14167, 'Loken'), +(28923,4,2, 'What little time you had, you wasted!',14,0,100,0,0,14168, 'Loken'), +(28923,5,0, 'You stare blindly into the abyss!',14,0,100,0,0,14169, 'Loken'), +(28923,6,0, 'Your ignorance is profound. Can you not see where this path leads?',14,0,100,0,0,14170, 'Loken'), +(28923,7,0, 'You cross the precipice of oblivion!',14,0,100,0,0,14171, 'Loken'), +(28923,8,0, 'My death... heralds the end of this world.',14,0,100,0,0,14172, 'Loken'), +(28923,9,0, '%s begins to cast Lightning Nova!',41,0,100,0,0,0, 'Loken'); diff --git a/sql/old/3.3.5a/2012_02_29_04_world_creature_text.sql b/sql/old/3.3.5a/2012_02_29_04_world_creature_text.sql new file mode 100644 index 00000000000..d8b7c2c048a --- /dev/null +++ b/sql/old/3.3.5a/2012_02_29_04_world_creature_text.sql @@ -0,0 +1,11 @@ +-- NPC talk text insert from sniff +DELETE FROM `script_texts` WHERE `npc_entry`=28546; +DELETE FROM `creature_text` WHERE `entry`=28546; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(28546,0,0, 'You wish to confront the master? You must first weather the storm!',14,0,100,0,0,14453, 'Ionar'), +(28546,1,0, 'The slightest spark shall be your undoing.',14,0,100,0,0,14454, 'Ionar'), +(28546,1,1, 'No one is safe!',14,0,100,0,0,14455, 'Ionar'), +(28546,2,0, 'Shocking ... I know!',14,0,100,0,0,14456, 'Ionar'), +(28546,2,1, 'You atempt the unpossible.',14,0,100,0,0,14457, 'Ionar'), +(28546,2,2, 'Your spark of light is ... extinguish.',14,0,100,0,0,14458, 'Ionar'), +(28546,3,0, 'Master... you have guests.',14,0,100,0,0,14459, 'Ionar'); diff --git a/sql/old/3.3.5a/2012_02_29_05_world_creature_text.sql b/sql/old/3.3.5a/2012_02_29_05_world_creature_text.sql new file mode 100644 index 00000000000..332fecf6326 --- /dev/null +++ b/sql/old/3.3.5a/2012_02_29_05_world_creature_text.sql @@ -0,0 +1,15 @@ +-- NPC talk text insert from sniff +DELETE FROM `script_texts` WHERE `npc_entry`=28587; +DELETE FROM `creature_text` WHERE `entry`=28587; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(28587,0,0, 'It is you who have destroyed my children? You... shall... pay!',14,0,100,0,0,13960, 'Volkhan'), +(28587,1,0, 'Life from lifelessness... death for you.',14,0,100,0,0,13961, 'Volkhan'), +(28587,1,1, 'Nothing is wasted in the process. You will see....',14,0,100,0,0,13962, 'Volkhan'), +(28587,2,0, 'I will crush you beneath my boots!',14,0,100,0,0,13963, 'Volkhan'), +(28587,2,1, 'All my work... undone!',14,0,100,0,0,13964, 'Volkhan'), +(28587,3,0, 'The armies of iron will conquer all!',14,0,100,0,0,13965, 'Volkhan'), +(28587,3,1, 'Ha, pathetic!',14,0,100,0,0,13966, 'Volkhan'), +(28587,3,2, 'You have cost me too much work!',14,0,100,0,0,13967, 'Volkhan'), +(28587,4,0, 'The master was right... to be concerned.',14,0,100,0,0,13968, 'Volkhan'), +(28587,5,0, '%s runs to his anvil!',41,0,100,0,0,0, 'Volkhan'), +(28587,6,0, '%s prepares to shatter his Brittle Golems!',41,0,100,0,0,0, 'Volkhan'); diff --git a/sql/old/3.3.5a/2012_03_01_00_world_conditions.sql b/sql/old/3.3.5a/2012_03_01_00_world_conditions.sql new file mode 100644 index 00000000000..794a5ce1210 --- /dev/null +++ b/sql/old/3.3.5a/2012_03_01_00_world_conditions.sql @@ -0,0 +1,5 @@ +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=18 AND `SourceGroup`=29488 AND `SourceEntry`=54568; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`, +`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`Comment`) VALUES +(18,29488,54568,1,8,0,12670,0,0,0,'Required quest rewarded for spellclick'), +(18,29488,54568,2,28,0,12670,0,0,0,'Required quest completed for spellclick'); diff --git a/sql/old/3.3.5a/2012_03_01_01_world_creature_text.sql b/sql/old/3.3.5a/2012_03_01_01_world_creature_text.sql new file mode 100644 index 00000000000..dd4f6693654 --- /dev/null +++ b/sql/old/3.3.5a/2012_03_01_01_world_creature_text.sql @@ -0,0 +1,15 @@ +-- NPC talk text insert from sniff +DELETE FROM `script_texts` WHERE `npc_entry`=28586; +DELETE FROM `creature_text` WHERE `entry`=28586; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(28586,0,0, 'I am the greatest of my father''s sons! Your end has come!',14,0,100,0,0,14149, 'General Bjarngrim'), +(28586,1,0, 'Give me your worst!',14,0,100,0,0,14150, 'General Bjarngrim'), +(28586,2,0, 'Defend yourself, for all the good it will do!',14,0,100,0,0,14151, 'General Bjarngrim'), +(28586,3,0, 'GRAAAAAH! Behold the fury of iron and steel!',14,0,100,0,0,14152, 'General Bjarngrim'), +(28586,4,0, 'So ends your curse!',14,0,100,0,0,14153, 'General Bjarngrim'), +(28586,4,1, 'Flesh... is... weak!',14,0,100,0,0,14154, 'General Bjarngrim'), +(28586,4,2, '...',14,0,100,0,0,14155, 'General Bjarngrim'), +(28586,5,0, 'How can it be...? Flesh is not... stronger!',14,0,100,0,0,14156, 'General Bjarngrim'), +(28586,6,0, '%s switches to Defensive Stance!',41,0,100,0,0,0, 'General Bjarngrim'), +(28586,7,0, '%s switches to Battle Stance!',41,0,100,0,0,0, 'General Bjarngrim'), +(28586,8,0, '%s switches to Berserker Stance!',41,0,100,0,0,0, 'General Bjarngrim'); diff --git a/sql/old/3.3.5a/2012_03_01_02_world_locales_creature_text.sql b/sql/old/3.3.5a/2012_03_01_02_world_locales_creature_text.sql new file mode 100644 index 00000000000..c44ca191835 --- /dev/null +++ b/sql/old/3.3.5a/2012_03_01_02_world_locales_creature_text.sql @@ -0,0 +1,15 @@ +DROP TABLE IF EXISTS `locales_creature_text`; +CREATE TABLE `locales_creature_text` ( + `entry` int(10) UNSIGNED NOT NULL, + `textGroup` tinyint(3) UNSIGNED NOT NULL, + `id` int(10) UNSIGNED NOT NULL, + `text_loc1` text, + `text_loc2` text, + `text_loc3` text, + `text_loc4` text, + `text_loc5` text, + `text_loc6` text, + `text_loc7` text, + `text_loc8` text, + PRIMARY KEY (`entry`,`textGroup`,`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/sql/old/3.3.5a/2012_03_03_00_world_command.sql b/sql/old/3.3.5a/2012_03_03_00_world_command.sql new file mode 100644 index 00000000000..52938c0b76b --- /dev/null +++ b/sql/old/3.3.5a/2012_03_03_00_world_command.sql @@ -0,0 +1,9 @@ +DELETE FROM `command` WHERE `name` LIKE 'debug moveflags'; +INSERT INTO `command` (`name`,`security`,`help`) VALUES +('debug moveflags',3,'Syntax: .debug moveflags [$newMoveFlags [$newMoveFlags2]]\r\nNo params given will output the current moveflags of the target'); + +DELETE FROM `trinity_string` WHERE `entry` IN(1143,1144); +INSERT INTO `trinity_string` (`entry`,`content_default`) VALUES +(1143,'Target''s moveFlags: %u, moveFlagsExtra: %u.'), +(1144,'Target''s moveFlags set to: %u, moveFlagsExtra to: %u'); + diff --git a/sql/old/3.3.5a/2012_03_04_00_world_misc.sql b/sql/old/3.3.5a/2012_03_04_00_world_misc.sql new file mode 100644 index 00000000000..af556f648b8 --- /dev/null +++ b/sql/old/3.3.5a/2012_03_04_00_world_misc.sql @@ -0,0 +1,13 @@ +-- Spotlight aura for spotlight NPC +DELETE FROM `creature_template_addon` WHERE `entry`=19913; +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(19913,0,0,0,0,'39312'); + +-- Scriptnames for areatriggers +SET @AT_AREA_52_SOUTH := 4472; +SET @AT_AREA_52_NORTH := 4466; +SET @AT_AREA_52_WEST := 4471; +SET @AT_AREA_52_EAST := 4422; +DELETE FROM `areatrigger_scripts` WHERE `entry` IN (@AT_AREA_52_SOUTH,@AT_AREA_52_NORTH,@AT_AREA_52_WEST,@AT_AREA_52_EAST); +INSERT INTO `areatrigger_scripts` (`entry`,`ScriptName`) VALUES +(@AT_AREA_52_SOUTH,"at_area_52_entrance"),(@AT_AREA_52_NORTH,"at_area_52_entrance"),(@AT_AREA_52_WEST,"at_area_52_entrance"),(@AT_AREA_52_EAST,"at_area_52_entrance"); diff --git a/sql/old/3.3.5a/2012_03_04_01_world_areatrigger_scripts.sql b/sql/old/3.3.5a/2012_03_04_01_world_areatrigger_scripts.sql new file mode 100644 index 00000000000..ae4a0bc1f77 --- /dev/null +++ b/sql/old/3.3.5a/2012_03_04_01_world_areatrigger_scripts.sql @@ -0,0 +1,7 @@ +-- Add Area trigger scripts +DELETE FROM `areatrigger_scripts` WHERE `entry` IN (4422,4466,4471,4472); +INSERT INTO `areatrigger_scripts` (`entry`, `ScriptName`) VALUES +(4422,'at_area_52_entrance'), +(4466,'at_area_52_entrance'), +(4471,'at_area_52_entrance'), +(4472,'at_area_52_entrance'); diff --git a/sql/old/3.3.5a/2012_03_06_00_world_commands.sql b/sql/old/3.3.5a/2012_03_06_00_world_commands.sql new file mode 100644 index 00000000000..d782a76c70d --- /dev/null +++ b/sql/old/3.3.5a/2012_03_06_00_world_commands.sql @@ -0,0 +1,3 @@ +DELETE FROM `command` WHERE `name` = 'reload locales_creature_text'; +INSERT INTO `command` (`name`, `security`, `help`) VALUES +('reload locales_creature_text', 3, 'Syntax: .reload locales_creature_text\nReload locales_creature_text Table.'); \ No newline at end of file diff --git a/sql/old/3.3.5a/2012_03_06_01_world_misc.sql b/sql/old/3.3.5a/2012_03_06_01_world_misc.sql new file mode 100644 index 00000000000..7eb208a9673 --- /dev/null +++ b/sql/old/3.3.5a/2012_03_06_01_world_misc.sql @@ -0,0 +1,4 @@ +ALTER TABLE `warden_checks` ENGINE=MYISAM; +ALTER TABLE `achievement_dbc` ENGINE=MYISAM; +ALTER TABLE `creature_text` ENGINE=MYISAM; +ALTER TABLE `game_event_seasonal_questrelation` ENGINE=MYISAM; diff --git a/sql/old/3.3.5a/2012_03_06_02_world_queststatus_seasonal.sql b/sql/old/3.3.5a/2012_03_06_02_world_queststatus_seasonal.sql new file mode 100644 index 00000000000..0efbb6609cf --- /dev/null +++ b/sql/old/3.3.5a/2012_03_06_02_world_queststatus_seasonal.sql @@ -0,0 +1 @@ +DROP TABLE IF EXISTS `character_queststatus_seasonal`; diff --git a/sql/old/3.3.5a/2012_03_06_03_world_smart_scripts.sql b/sql/old/3.3.5a/2012_03_06_03_world_smart_scripts.sql new file mode 100644 index 00000000000..cb2468c4d5c --- /dev/null +++ b/sql/old/3.3.5a/2012_03_06_03_world_smart_scripts.sql @@ -0,0 +1,17 @@ +-- SAI for Elrodan +SET @ENTRY=18743; +UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE (`entryorguid`=@ENTRY AND `source_type`=0); +DELETE FROM `smart_scripts` WHERE (`entryorguid`=@ENTRY*100 AND `source_type`=9); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,1,0,100,0,5000,8000,15000,25000,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Elrodan - OOC - run script'), +(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,11,18744,20,0,0,0,0,0,'Elrodan - Script - Aurosalia say random'), +(@ENTRY*100,9,1,0,0,0,100,0,3000,3000,3000,3000,11,32826,0,0,0,0,0,1,0,0,0,0,0,0,0,'Elrodan - Script - cast Polymorph Cast Visual'); +-- Aurosalia fix model +UPDATE `creature_model_info` SET `modelid_other_gender`=0 WHERE `modelid`=18145; +-- Aurosalia text +DELETE FROM `creature_text` WHERE `entry`=18744; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(18744,0,0, 'Stop!',1,0,100,5,0,0, 'Aurosalia'), +(18744,0,1, 'Will you stop--',1,0,100,274,0,0, 'Aurosalia'), +(18744,0,2, '',1,0,100,6,0,0, 'Aurosalia'); diff --git a/sql/old/3.3.5a/2012_03_06_04_world_creature_text.sql b/sql/old/3.3.5a/2012_03_06_04_world_creature_text.sql new file mode 100644 index 00000000000..f49599e1ba0 --- /dev/null +++ b/sql/old/3.3.5a/2012_03_06_04_world_creature_text.sql @@ -0,0 +1,6 @@ +-- Aurosalia text +DELETE FROM `creature_text` WHERE `entry`=18744; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(18744,0,0, 'Stop!',12,1,100,5,0,0, 'Aurosalia'), +(18744,0,1, 'Will you stop--',12,1,100,6,0,0, 'Aurosalia'), +(18744,0,2, '',12,1,100,274,0,0, 'Aurosalia'); diff --git a/sql/old/3.3.5a/2012_03_07_00_world_trinity_string.sql b/sql/old/3.3.5a/2012_03_07_00_world_trinity_string.sql new file mode 100644 index 00000000000..df5afea5d4f --- /dev/null +++ b/sql/old/3.3.5a/2012_03_07_00_world_trinity_string.sql @@ -0,0 +1,3 @@ +DELETE FROM `trinity_string` WHERE `entry`=175; +INSERT INTO `trinity_string` (`entry`,`content_default`) VALUES +(175, 'Liquid level: %f, ground: %f, type: %u, flags %u, status: %d.'); diff --git a/sql/old/3.3.5a/2012_03_10_00_world_creature.sql b/sql/old/3.3.5a/2012_03_10_00_world_creature.sql new file mode 100644 index 00000000000..a0143af73c7 --- /dev/null +++ b/sql/old/3.3.5a/2012_03_10_00_world_creature.sql @@ -0,0 +1,21 @@ +-- Add some missing guids +SET @GUID := 42153; +DELETE FROM `creature` WHERE `guid` BETWEEN @GUID AND @GUID+4; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@GUID,32666,530,1,1,0,0,9830.201,-7389.711,13.68803,5.532694,120,0,0,1,0,0), +(@GUID+1,32667,530,1,1,0,0,9859.044,-7406.975,13.7113,1.658063,120,0,0,1,0,0), +(@GUID+2,31144,530,1,1,0,0,9869.401,-7389.657,13.69022,3.90953755,120,0,0,1,0,0), +(@GUID+3,31144,530,1,1,0,0,9871.973,-7392.763,13.6818113,3.35103226,120,0,0,1,0,0), +(@GUID+4,31146,530,1,1,0,0,9850.529,-7395.442,13.72216,4.694936,120,0,0,1,0,0); +-- Addons +DELETE FROM `creature_addon` WHERE `guid` BETWEEN @GUID AND @GUID+4; +DELETE FROM `creature_addon` WHERE `guid`=66686; +INSERT INTO `creature_addon` (`guid`,`bytes2`,`auras`) VALUES +(@GUID,1, '7056 61573'), +(@GUID+1,1, '7056 61573'), +(@GUID+2,1, '7056 61573'), +(@GUID+3,1, '7056 61573'), +(@GUID+4,1, '7056 61573'), +(66686,1, '7056'); +-- convert npc to trigger +UPDATE `creature_template` SET `flags_extra`=`flags_extra`|128 WHERE `entry`=18504; diff --git a/sql/old/3.3.5a/2012_03_10_00_world_smart_scripts.sql b/sql/old/3.3.5a/2012_03_10_00_world_smart_scripts.sql new file mode 100644 index 00000000000..aaa02c2e3df --- /dev/null +++ b/sql/old/3.3.5a/2012_03_10_00_world_smart_scripts.sql @@ -0,0 +1,129 @@ +-- SAI for Champion Vranesh +SET @ENTRY=18146; +UPDATE `creature` SET `position_x`=9834.044,`position_y`=-7480.845,`position_z`=14.93467 WHERE `id`=@ENTRY; +UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +UPDATE `creature_template_addon` SET `mount`=0 WHERE `entry`=@ENTRY; -- 19085 +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid` IN (@ENTRY*100,@ENTRY*100+1,@ENTRY*100+2,@ENTRY*100+3,@ENTRY*100+4); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +-- AI +(@ENTRY,0,0,0,11,0,100,1,0,0,0,0,53,0,@ENTRY,1,0,0,0,1,0,0,0,0,0,0,0,'Champion Vranesh - On respawn - load path'), +(@ENTRY,0,1,2,40,0,100,0,7,@ENTRY,0,0,54,6000,0,0,0,0,0,1,0,0,0,0,0,0,0,'Champion Vranesh - On waypoint reached - Pause Path'), +(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Champion Vranesh - On waypoint reached - Run Script'), +(@ENTRY,0,3,4,40,0,100,0,11,@ENTRY,0,0,54,1000,0,0,0,0,0,1,0,0,0,0,0,0,0,'Champion Vranesh - On waypoint reached - Pause Path'), +(@ENTRY,0,4,0,61,0,100,0,0,0,0,0,80,@ENTRY*100+1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Champion Vranesh - On waypoint reached - Run Script'), +(@ENTRY,0,5,6,40,0,100,0,25,@ENTRY,0,0,54,8000,0,0,0,0,0,1,0,0,0,0,0,0,0,'Champion Vranesh - On waypoint reached - Pause Path'), +(@ENTRY,0,6,0,61,0,100,0,0,0,0,0,80,@ENTRY*100+2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Champion Vranesh - On waypoint reached - Run Script'), +(@ENTRY,0,7,8,40,0,100,0,34,@ENTRY,0,0,54,8000,0,0,0,0,0,1,0,0,0,0,0,0,0,'Champion Vranesh - On waypoint reached - Pause Path'), +(@ENTRY,0,8,0,61,0,100,0,0,0,0,0,80,@ENTRY*100+3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Champion Vranesh - On waypoint reached - Run Script'), +(@ENTRY,0,9,10,40,0,100,0,50,@ENTRY,0,0,54,7000,0,0,0,0,0,1,0,0,0,0,0,0,0,'Champion Vranesh - On waypoint reached - Pause Path'), +(@ENTRY,0,10,0,61,0,100,0,0,0,0,0,80,@ENTRY*100+4,0,0,0,0,0,1,0,0,0,0,0,0,0,'Champion Vranesh - On waypoint reached - Run Script'), +(@ENTRY,0,11,0,40,0,100,0,57,@ENTRY,0,0,54,600000,0,0,0,0,0,1,0,0,0,0,0,0,0,'Champion Vranesh - On waypoint reached - Pause Path'), +-- Script 0 +(@ENTRY*100,9,0,0,0,0,100,0,3500,3500,3500,3500,5,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Champion Vranesh - Script 0 - emote bow'), +-- Script 1 +(@ENTRY*100+1,9,0,0,0,0,100,0,100,100,100,100,43,0,19085,0,0,0,0,1,0,0,0,0,0,0,0,'Champion Vranesh - Script 1 - mount horse'), +(@ENTRY*100+1,9,1,0,0,0,100,0,100,100,100,100,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Champion Vranesh - Script 1 - say 0'), +(@ENTRY*100+1,9,2,0,0,0,100,0,100,100,100,100,5,16,0,0,0,0,0,11,16222,10,0,0,0,0,0,'Champion Vranesh - Script 1 - Silvermoon City Guardian emote bow'), +(@ENTRY*100+1,9,3,0,0,0,100,0,100,100,100,100,1,0,0,0,0,0,0,19,16222,10,0,0,0,0,0,'Champion Vranesh - Script 1 - Silvermoon City Guardian say 0'), +-- Script 2 +(@ENTRY*100+2,9,0,0,0,0,100,0,3000,3000,3000,3000,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Champion Vranesh - Script 2 - say 1'), +(@ENTRY*100+2,9,1,0,0,0,100,0,100,100,100,100,5,16,0,0,0,0,0,11,16222,18,0,0,0,0,0,'Champion Vranesh - Script 2 - Silvermoon City Guardian emote bow'), +(@ENTRY*100+2,9,2,0,0,0,100,0,100,100,100,100,1,1,0,0,0,0,0,19,16222,18,0,0,0,0,0,'Champion Vranesh - Script 2 - Silvermoon City Guardian say 1'), +-- Script 3 +(@ENTRY*100+3,9,0,0,0,0,100,0,3000,3000,3000,3000,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Champion Vranesh - Script 3 - say 2'), +(@ENTRY*100+3,9,1,0,0,0,100,0,100,100,100,100,5,16,0,0,0,0,0,11,16222,30,0,0,0,0,0,'Champion Vranesh - Script 3 - Silvermoon City Guardian emote bow'), +-- Script 4 +(@ENTRY*100+4,9,0,0,0,0,100,0,1000,1000,1000,1000,43,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Champion Vranesh - Script 4 - dismount horse'), +(@ENTRY*100+4,9,1,0,0,0,100,0,1000,1000,1000,1000,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Champion Vranesh - Script 3 - say 3'); + +-- NPC talk text for Champion Vranesh and Silvermoon City Guardian +DELETE FROM `creature_text` WHERE `entry` IN (@ENTRY,16222); +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0, 'Champion Vranesh inclines his head slightly to the pair of guardians in greeting.',16,1,100,0,0,0, 'Champion Vranesh'), +(@ENTRY,1,0, 'Champion Vranesh arches a scrulpled brow at the guards. a disapproving scowl on his face',16,1,100,0,0,0, 'Champion Vranesh'), +(@ENTRY,2,0, 'Champion Vranesh glances from guard to guard.',16,1,100,0,0,0, 'Champion Vranesh'), +(@ENTRY,3,0, 'Champion Vranesh surveys the small ranger practice ground with a condescending smirk.',16,1,100,0,0,0, 'Champion Vranesh'), +(16222,0,0, 'Glory to the Sun K-- ah... Silvermoon!',12,1,100,0,0,0, 'Silvermoon City Guardian'), +(16222,1,0, 'Our lives are yours, Blood Knight.',12,1,100,0,0,0, 'Silvermoon City Guardian'); + +-- Pathing for Champion Vranesh +DELETE FROM `waypoints` WHERE `entry`=@ENTRY; +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(@ENTRY,1,9834.044,-7480.845,14.93467, 'Champion Vranesh'), +(@ENTRY,2,9829.106,-7493.609,14.93653, 'Champion Vranesh'), +(@ENTRY,3,9826.172,-7516.15,19.73714, 'Champion Vranesh'), +(@ENTRY,4,9841.332,-7518.849,19.70547, 'Champion Vranesh'), +(@ENTRY,5,9845.063,-7512.885,19.68096, 'Champion Vranesh'), +(@ENTRY,6,9850.942,-7512.470,19.71548, 'Champion Vranesh'), +(@ENTRY,7,9850.934,-7513.604,19.71813, 'Champion Vranesh'), -- pause 6000 +(@ENTRY,8,9872.733,-7517.256,19.75283, 'Champion Vranesh'), +(@ENTRY,9,9872.419,-7489.979,14.91272, 'Champion Vranesh'), +(@ENTRY,10,9851.401,-7490.209,14.93464, 'Champion Vranesh'), +(@ENTRY,11,9850.948,-7470.096,14.91403, 'Champion Vranesh'), -- pause 1000 +(@ENTRY,12,9851.16,-7469.154,14.91319, 'Champion Vranesh'), +(@ENTRY,13,9849.688,-7442.579,13.50931, 'Champion Vranesh'), +(@ENTRY,14,9848.726,-7423.561,13.31949, 'Champion Vranesh'), +(@ENTRY,15,9816.583,-7423.817,13.30332, 'Champion Vranesh'), +(@ENTRY,16,9794.673,-7424.877,13.50989, 'Champion Vranesh'), +(@ENTRY,17,9794.48,-7442.293,14.40225, 'Champion Vranesh'), +(@ENTRY,18,9767.989,-7442.611,14.39258, 'Champion Vranesh'), +(@ENTRY,19,9767.406,-7422.982,13.35852, 'Champion Vranesh'), +(@ENTRY,20,9739.563,-7422.83,13.28878, 'Champion Vranesh'), +(@ENTRY,21,9736.46,-7440.873,13.53963, 'Champion Vranesh'), +(@ENTRY,22,9740.345,-7464.682,13.57483, 'Champion Vranesh'), +(@ENTRY,23,9746.739,-7482.594,13.55744, 'Champion Vranesh'), +(@ENTRY,24,9748.767,-7486.576,13.54981, 'Champion Vranesh'), +(@ENTRY,25,9753.25,-7486.52,13.5461, 'Champion Vranesh'), -- pause 8000 +(@ENTRY,26,9720.037,-7486.478,13.52865, 'Champion Vranesh'), +(@ENTRY,27,9681.502,-7475.868,13.52783, 'Champion Vranesh'), +(@ENTRY,28,9666.59,-7479.547,13.53783, 'Champion Vranesh'), +(@ENTRY,29,9638.033,-7492.629,13.50889, 'Champion Vranesh'), +(@ENTRY,30,9620.123,-7488.486,13.53853, 'Champion Vranesh'), +(@ENTRY,31,9605.795,-7475.276,13.55774, 'Champion Vranesh'), +(@ENTRY,32,9597.921,-7460.307,13.54336, 'Champion Vranesh'), +(@ENTRY,33,9594.605,-7450.369,13.5353, 'Champion Vranesh'), +(@ENTRY,34,9592.944,-7450.381,13.53116, 'Champion Vranesh'), -- pause 8000 +(@ENTRY,35,9594.605,-7450.369,13.5353, 'Champion Vranesh'), +(@ENTRY,36,9615.793,-7419.515,13.30549, 'Champion Vranesh'), +(@ENTRY,37,9654.939,-7420.383,13.29342, 'Champion Vranesh'), +(@ENTRY,38,9673.072,-7429.818,13.2933, 'Champion Vranesh'), +(@ENTRY,39,9689.373,-7431.429,13.2933, 'Champion Vranesh'), +(@ENTRY,40,9709.577,-7422.25,13.2933, 'Champion Vranesh'), +(@ENTRY,41,9722.3,-7415.217,13.39988, 'Champion Vranesh'), +(@ENTRY,42,9748.049,-7414.597,13.32135, 'Champion Vranesh'), +(@ENTRY,43,9766.792,-7413.542,13.38617, 'Champion Vranesh'), +(@ENTRY,44,9767.26,-7396.828,14.43101, 'Champion Vranesh'), +(@ENTRY,45,9793.145,-7395.393,14.3936, 'Champion Vranesh'), +(@ENTRY,46,9794.217,-7415.122,13.48684, 'Champion Vranesh'), +(@ENTRY,47,9817.575,-7415.299,13.30596, 'Champion Vranesh'), +(@ENTRY,48,9837.021,-7414.861,13.30863, 'Champion Vranesh'), +(@ENTRY,49,9848.048,-7414.794,13.31137, 'Champion Vranesh'), +(@ENTRY,50,9848.199,-7414.07,13.31068, 'Champion Vranesh'), -- pause 7000 +(@ENTRY,51,9847.695,-7415.903,13.31243, 'Champion Vranesh'), +(@ENTRY,52,9848.259,-7428.576,13.33225, 'Champion Vranesh'), +(@ENTRY,53,9846.748,-7446.964,13.56501, 'Champion Vranesh'), +(@ENTRY,54,9850.373,-7465.03,14.9097, 'Champion Vranesh'), +(@ENTRY,55,9850.84,-7480.409,14.93768, 'Champion Vranesh'), +(@ENTRY,56,9840.165,-7480.267,14.92917, 'Champion Vranesh'), +(@ENTRY,57,9843.284,-7480.133,14.92655, 'Champion Vranesh'); -- pause 60000 + +-- SAI for Silvermoon Farstrider +SET @ENTRY=18507; +UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,25,0,100,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Silvermoon Farstrider - Reset - Set Phase 1'), +(@ENTRY,0,1,2,1,1,100,0,3000,3000,5000,5000,11,36802,0,0,0,0,0,1,0,0,0,0,0,0,0,'Silvermoon Farstrider - OOC - Cast Spell (Phase 1)'), +(@ENTRY,0,2,0,61,1,100,0,0,0,0,0,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Silvermoon Farstrider - OOC - Set Phase 2 (Phase 1)'), +(@ENTRY,0,3,4,1,2,100,0,3000,3000,5000,5000,11,36803,0,0,0,0,0,1,0,0,0,0,0,0,0,'Silvermoon Farstrider - OOC - Cast Spell (Phase 2)'), +(@ENTRY,0,4,0,61,2,100,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Silvermoon Farstrider - OOC - Set Phase 1 (Phase 2)'); +-- SAI for Silvermoon Ranger +SET @ENTRY=18147; +UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid` IN (-64950,-64951,-64952,-64953); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(-64950,0,0,0,1,0,100,0,18000,22000,18000,22000,11,29121,0,0,0,0,0,1,0,0,0,0,0,0,0,'Silvermoon Ranger - OOC - Cast Spell'), +(-64951,0,0,0,1,0,100,0,18000,22000,18000,22000,11,29121,0,0,0,0,0,1,0,0,0,0,0,0,0,'Silvermoon Ranger - OOC - Cast Spell'), +(-64952,0,0,0,1,0,100,0,18000,22000,18000,22000,11,29120,0,0,0,0,0,1,0,0,0,0,0,0,0,'Silvermoon Ranger - OOC - Cast Spell'), +(-64953,0,0,0,1,0,100,0,18000,22000,18000,22000,11,29122,0,0,0,0,0,1,0,0,0,0,0,0,0,'Silvermoon Ranger - OOC - Cast Spell'); diff --git a/sql/old/3.3.5a/2012_03_10_00_world_waypoint_data.sql b/sql/old/3.3.5a/2012_03_10_00_world_waypoint_data.sql new file mode 100644 index 00000000000..01c2bc50402 --- /dev/null +++ b/sql/old/3.3.5a/2012_03_10_00_world_waypoint_data.sql @@ -0,0 +1,25 @@ +-- Silvermoon City Guardian pathing +SET @NPC := 56902; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=9595.755,`position_y`=-7366.754,`position_z`=13.50131 WHERE `guid`=@NPC; +UPDATE `creature_addon` SET `path_id`=@PATH WHERE `guid`=@NPC; +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,9595.755,-7366.754,13.50131,0,0,0,100,0), +(@PATH,2,9594.553,-7336.536,14.15131,0,0,0,100,0), +(@PATH,3,9586.897,-7325.241,14.1312,0,0,0,100,0), +(@PATH,4,9561.705,-7326.179,14.05934,0,0,0,100,0), +(@PATH,5,9519.901,-7327.064,14.12175,0,0,0,100,0), +(@PATH,6,9508.228,-7352.014,14.33403,0,0,0,100,0), +(@PATH,7,9505.697,-7394.406,14.32095,0,0,0,100,0), +(@PATH,8,9535.751,-7396.176,16.8303,0,0,0,100,0), +(@PATH,9,9564.451,-7396.184,16.84703,0,0,0,100,0), +(@PATH,10,9563.777,-7415.961,19.47212,0,0,0,100,0), +(@PATH,11,9559.149,-7418.953,19.47643,0,0,0,100,0), +(@PATH,12,9563.34,-7432.895,15.4851,0,0,0,100,0), +(@PATH,13,9564.645,-7464.229,15.51088,0,0,0,100,0), +(@PATH,14,9588.409,-7464.643,13.52051,0,0,0,100,0), +(@PATH,15,9603.896,-7430.126,13.30448,0,0,0,100,0), +(@PATH,16,9595.137,-7387.862,13.52731,0,0,0,100,0), +(@PATH,17,9572.599,-7384.971,14.39343,0,0,0,100,0), +(@PATH,18,9573.106,-7369.531,14.40827,0,0,0,100,0); diff --git a/sql/old/3.3.5a/2012_03_11_00_world_sai.sql b/sql/old/3.3.5a/2012_03_11_00_world_sai.sql new file mode 100644 index 00000000000..a8cab265ac0 --- /dev/null +++ b/sql/old/3.3.5a/2012_03_11_00_world_sai.sql @@ -0,0 +1,60 @@ +-- Coilfang Guardian + +DELETE FROM `smart_scripts` WHERE `entryorguid`=21873 AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(21873, 0, 0, 0, 0, 0, 0, 0, 5000, 5000, 15000, 15000, 11, 28168, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Coilfang Guardian - IC - Cast Arcing Smash'), +(21873, 0, 1, 0, 0, 0, 0, 0, 2000, 2000, 10000, 10000, 11, 9080, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Coilfang Guardian - IC - Cast Harmstring'), +(21873, 0, 2, 0, 0, 0, 50, 0, 3000, 4000, 10000, 20000, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Coilfang Guardian - IC - Say 0'); -- randomly guessed timers + +DELETE FROM `creature_text` WHERE `entry`=21873; +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES +(21873, 0, 0, 'By Nazjatar''s Depths!', 12, 0, 0, 0, 0, 0, 'Coilfang Guardian'), +(21873, 0, 1, 'Die, warmblood!', 12, 0, 0, 0, 0, 0, 'Coilfang Guardian'), +(21873, 0, 2, 'For the Master!', 12, 0, 0, 0, 0, 0, 'Coilfang Guardian'), +(21873, 0, 3, 'Illidan reigns!', 12, 0, 0, 0, 0, 0, 'Coilfang Guardian'), +(21873, 0, 4, 'My blood is like venom!', 12, 0, 0, 0, 0, 0, 'Coilfang Guardian'); + +UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=21873; + +-- Coilfang Strider + +DELETE FROM `smart_scripts` WHERE `entryorguid`=22056 AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(22056, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 11, 38257, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Coilfang Strider - On Reset - Cast Panic Periodic'), +(22056, 0, 1, 0, 0, 0, 0, 0, 8000, 8000, 30000, 40000, 11, 38259, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Coilfang Strider - IC - Cast Mind Blast'); + +UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=22056; + +-- Coilfang Elite + +DELETE FROM `smart_scripts` WHERE `entryorguid`=22055 AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(22055, 0, 0, 0, 0, 0, 0, 0, 5000, 5000, 15000, 20000, 11, 38260, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 'Coilfang Elite - IC - Cast Cleave'), +(22055, 0, 1, 0, 0, 0, 0, 0, 2000, 2000, 10000, 10000, 11, 38262, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Coilfang Elite - IC - Cast Harmstring'); + +UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=22055; + +-- Core Hound + +DELETE FROM `smart_scripts` WHERE `entryorguid`=11673 AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid` BETWEEN 11673*100+0 AND 11673*100+5 AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(11673, 0, 0, 0, 0, 0, 0, 0, 10000, 10000, 7000, 7000, 11, 19272, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Core Hound - IC - Cast Lava Breath'), +(11673, 0, 1, 0, 0, 0, 0, 0, 4000, 4000, 6000, 6000, 11, 19319, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Core Hound - IC - Cast Vicious Bite'), +(11673, 0, 2, 0, 0, 0, 0, 0, 15000, 15000, 24000, 24000, 88, 11673*100+0, 11673*100+5, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Core Hound - IC - Call random script'), +(11673*100+0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 19364, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Core Hound - Random 0 - Cast Ground Stomp'), +(11673*100+1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 19366, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Core Hound - Random 1 - Cast Cauterizing Flames'), +(11673*100+2, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 19367, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Core Hound - Random 2 - Cast Withering Heat'), +(11673*100+3, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 19369, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Core Hound - Random 3 - Cast Ancient Despair'), +(11673*100+4, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 19372, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Core Hound - Random 4 - Cast Ancient Hysteria'), +(11673*100+5, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 19365, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Core Hound - Random 5 - Cast Ancient Dread'); + +UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=11673; + +-- Shadow of Aran + +DELETE FROM `smart_scripts` WHERE `entryorguid`=18254 AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(18254, 0, 0, 0, 0, 0, 0, 0, 1000, 1000, 5000, 5000, 11, 29978, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Shadow of Aran - IC - Cast Pyro Blast'); + +UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=18254; diff --git a/sql/old/3.3.5a/2012_03_12_00_world_creature_template.sql b/sql/old/3.3.5a/2012_03_12_00_world_creature_template.sql new file mode 100644 index 00000000000..cc70ff7a557 --- /dev/null +++ b/sql/old/3.3.5a/2012_03_12_00_world_creature_template.sql @@ -0,0 +1 @@ +ALTER TABLE `creature_template` ADD COLUMN `HoverHeight` FLOAT NOT NULL DEFAULT 1 AFTER `InhabitType`; diff --git a/sql/old/3.3.5a/2012_03_12_01_world_conditions.sql b/sql/old/3.3.5a/2012_03_12_01_world_conditions.sql new file mode 100644 index 00000000000..d58d8f54ddf --- /dev/null +++ b/sql/old/3.3.5a/2012_03_12_01_world_conditions.sql @@ -0,0 +1,3 @@ +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=72257; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,1,72257,0,0,32,0,144,0,0,0,0,'','Remove Marks of the Fallen Champion - target player'); diff --git a/sql/old/3.3.5a/2012_03_12_01_world_gameobject.sql b/sql/old/3.3.5a/2012_03_12_01_world_gameobject.sql new file mode 100644 index 00000000000..38c615a3b0a --- /dev/null +++ b/sql/old/3.3.5a/2012_03_12_01_world_gameobject.sql @@ -0,0 +1,4 @@ +UPDATE `gameobject_template` SET `flags`=0x32 WHERE `entry` IN (202239,202240,202238,202241,201959,202339,202338,202340); + +-- Set Deathbringer's Cache spawned by default +UPDATE `gameobject` SET `spawntimesecs`=604800 WHERE `id` IN (202239,202240,202238,202241); diff --git a/sql/old/3.3.5a/2012_03_12_01_world_spell_script_names.sql b/sql/old/3.3.5a/2012_03_12_01_world_spell_script_names.sql new file mode 100644 index 00000000000..db98aa0fbea --- /dev/null +++ b/sql/old/3.3.5a/2012_03_12_01_world_spell_script_names.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_deathbringer_remove_marks'; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(72257,'spell_deathbringer_remove_marks'); diff --git a/sql/old/3.3.5a/2012_03_14_00_world_creature_addon.sql b/sql/old/3.3.5a/2012_03_14_00_world_creature_addon.sql new file mode 100644 index 00000000000..c7e4edb97ed --- /dev/null +++ b/sql/old/3.3.5a/2012_03_14_00_world_creature_addon.sql @@ -0,0 +1,2 @@ +UPDATE `creature_addon` SET `bytes1`=0x3000000 WHERE `guid`=207210; +UPDATE `creature_addon` SET `bytes1`=0x3000000 WHERE `guid`=207211; diff --git a/sql/old/3.3.5a/2012_03_19_00_world_smart_scripts.sql b/sql/old/3.3.5a/2012_03_19_00_world_smart_scripts.sql new file mode 100644 index 00000000000..20241efa9cc --- /dev/null +++ b/sql/old/3.3.5a/2012_03_19_00_world_smart_scripts.sql @@ -0,0 +1,21 @@ +-- SAI for Unrestrained Dragonhawk +UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='' WHERE `entry`=25236; +DELETE FROM `smart_scripts` WHERE (`entryorguid`=25236 AND `source_type`=0); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(25236,0,0,1,62,0,100,0,9143,0,0,0,11,45353,0,0,0,0,0,7,0,0,0,0,0,0,0,'Unrestrained Dragonhawk - On Gossip option select - cast "Quest - Sunwell Daily - Ship Bombing Run Return" on player'), +(25236,0,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Unrestrained Dragonhawk - On Gossip option select - Close Gossip'); +-- Unrestrained Dragonhawk Gossip +UPDATE `creature_template` SET `gossip_menu_id`=9143 WHERE `entry`=25236; +-- Gossip_menu from UDB +DELETE FROM `gossip_menu` WHERE `entry`=9143; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES +(9143,12371); +-- Gossip_menu_option Update from UDB +DELETE FROM `gossip_menu_option` WHERE `menu_id`=9143; +INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`) VALUES +(9143,0,0, '',1,1,0,0,0,0, ''); +-- Gossip option Conditions +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=9143; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,9143,0,0,9,11542,0,0,0,'','Show gossip option if player has quest 11542 but not complete'), +(15,9143,0,1,9,11543,0,0,0,'','Show gossip option if player has quest 11543 but not complete'); diff --git a/sql/old/3.3.5a/2012_03_20_00_world_gossip.sql b/sql/old/3.3.5a/2012_03_20_00_world_gossip.sql new file mode 100644 index 00000000000..00214d805e7 --- /dev/null +++ b/sql/old/3.3.5a/2012_03_20_00_world_gossip.sql @@ -0,0 +1,88 @@ +-- Creature Gossip_menu_id Update from sniff +UPDATE `creature_template` SET `gossip_menu_id`=9052 WHERE `entry`=24965; -- Vindicator Xayann +UPDATE `creature_template` SET `gossip_menu_id`=9050 WHERE `entry`=24975; -- Mar'nah +UPDATE `creature_template` SET `gossip_menu_id`=9126 WHERE `entry`=25032; -- Eldara Dawnrunner +UPDATE `creature_template` SET `gossip_menu_id`=9087 WHERE `entry`=25046; -- Smith Hauthaa +UPDATE `creature_template` SET `gossip_menu_id`=9064 WHERE `entry`=25057; -- Battlemage Arynna +UPDATE `creature_template` SET `gossip_menu_id`=9062, `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=25059; -- Ayren Cloudbreaker +UPDATE `creature_template` SET `gossip_menu_id`=9063 WHERE `entry`=25061; -- Harbinger Inuuro +UPDATE `creature_template` SET `gossip_menu_id`=9127 WHERE `entry`=25069; -- Magister Ilastar +UPDATE `creature_template` SET `gossip_menu_id`=9115 WHERE `entry`=25112; -- Anchorite Ayuri +UPDATE `creature_template` SET `gossip_menu_id`=9105 WHERE `entry`=25169; -- Archmage Ne'thul +UPDATE `creature_template` SET `gossip_menu_id`=9286 WHERE `entry`=25632; -- Vindicator Moorba +UPDATE `creature_template` SET `gossip_menu_id`=9285 WHERE `entry`=25638; -- Captain Selana +UPDATE `creature_template` SET `gossip_menu_id`=9198 WHERE `entry`=25950; -- Shaani + +-- Gossip Menu insert from sniff +DELETE FROM `gossip_menu` WHERE `entry`=9050 AND `text_id`=12237; +DELETE FROM `gossip_menu` WHERE `entry`=9052 AND `text_id`=12241; +DELETE FROM `gossip_menu` WHERE `entry`=9062 AND `text_id`=12252; +DELETE FROM `gossip_menu` WHERE `entry`=9063 AND `text_id`=12256; +DELETE FROM `gossip_menu` WHERE `entry`=9064 AND `text_id`=12258; +DELETE FROM `gossip_menu` WHERE `entry`=9087 AND `text_id`=12286; +DELETE FROM `gossip_menu` WHERE `entry`=9115 AND `text_id`=12323; +DELETE FROM `gossip_menu` WHERE `entry`=9126 AND `text_id`=12338; +DELETE FROM `gossip_menu` WHERE `entry`=9127 AND `text_id`=12340; +DELETE FROM `gossip_menu` WHERE `entry`=9198 AND `text_id`=12497; +DELETE FROM `gossip_menu` WHERE `entry`=9285 AND `text_id`=12596; +DELETE FROM `gossip_menu` WHERE `entry`=9286 AND `text_id`=12597; +DELETE FROM `gossip_menu` WHERE `entry`=9287 AND `text_id`=12598; +DELETE FROM `gossip_menu` WHERE `entry`=9288 AND `text_id`=12599; +DELETE FROM `gossip_menu` WHERE `entry`=9289 AND `text_id`=12600; +DELETE FROM `gossip_menu` WHERE `entry`=9290 AND `text_id`=12601; +DELETE FROM `gossip_menu` WHERE `entry`=9293 AND `text_id`=12604; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES +(9050,12237), +(9052,12241), +(9062,12252), +(9063,12256), +(9064,12258), +(9087,12286), +(9115,12323), +(9126,12338), +(9127,12340), +(9198,12497), +(9285,12596), +(9286,12597), +(9287,12598), +(9288,12599), +(9289,12600), +(9290,12601), +(9293,12604); + +-- Creature Gossip_menu_option insert from sniff +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (9050,9087,9126,9198,9285,9287,9288,9289) AND `id`=0; +DELETE FROM `gossip_menu_option` WHERE `menu_id`=9062 AND `id` IN (0,1); +DELETE FROM `gossip_menu_option` WHERE `menu_id`=9286 AND `id`=2; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(9050,0,1,'Let me browse your goods.',3,128,0,0,0,0,''), +(9062,0,0,'Speaking of action, I''ve been ordered to undertake an air strike.',1,1,0,0,0,0,''), +(9062,1,0,'I need to intercept the Dawnblade reinforcements.',1,1,0,0,0,0,''), +(9087,0,1,'Let me browse your goods.',3,128,0,0,0,0,''), +(9126,0,1,'Let me browse your goods.',3,128,0,0,0,0,''), +(9198,0,1,'Let me browse your goods.',3,128,0,0,0,0,''), +(9285,0,0,'Give me a situation report, Captain.',1,1,9287,0,0,0,''), +(9286,2,0,'What is the current state of the Sunwell''s Gates?',1,1,9293,0,0,0,''), +(9287,0,0,'What went wrong?',1,1,9288,0,0,0,''), +(9288,0,0,'Why did they stop?',1,1,9289,0,0,0,''), +(9289,0,0,'Your insight is appreciated.',1,1,9290,0,0,0,''); + +-- Conditions +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=9062 AND `SourceEntry` IN (0,1); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,9062,0,0,0,9,11532,0,0,0,0,'','Show gossip option only if player has taken quest 11532'), +(15,9062,0,0,1,9,11533,0,0,0,0,'','Show gossip option only if player has taken quest 11533'), +(15,9062,1,0,0,9,11542,0,0,0,0,'','Show gossip option only if player has taken quest 11542'), +(15,9062,1,0,1,9,11543,0,0,0,0,'','Show gossip option only if player has taken quest 11543'); + +-- SmartAI +DELETE FROM `smart_scripts` WHERE `entryorguid`=25059 AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(25059,0,0,2,62,0,100,0,9062,0,0,0,11,45071,0,0,0,0,0,7,0,0,0,0,0,0,0,'Ayren Cloudbreaker - On Gossip option select - Cast "Quest - Sunwell Daily - Dead Scar Bombing Run" on player'), +(25059,0,1,2,62,0,100,0,9062,1,0,0,11,45113,0,0,0,0,0,7,0,0,0,0,0,0,0,'Ayren Cloudbreaker - On Gossip option select - Cast "Quest - Sunwell Daily - Ship Bombing Run" on player'), +(25059,0,2,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Ayren Cloudbreaker - On Gossip option select - Close Gossip'); + +-- Spell scripts from sniff +DELETE FROM `spell_scripts` WHERE `id`=45071; +INSERT INTO `spell_scripts` (`id`,`effIndex`,`delay`,`command`,`datalong`,`datalong2`,`dataint`,`x`,`y`,`z`,`o`) VALUES +(45071,2,0,16,12318,1,0,0,0,0,0); -- Play sound diff --git a/sql/old/3.3.5a/2012_03_21_00_world_creature.sql b/sql/old/3.3.5a/2012_03_21_00_world_creature.sql new file mode 100644 index 00000000000..def72f74cd6 --- /dev/null +++ b/sql/old/3.3.5a/2012_03_21_00_world_creature.sql @@ -0,0 +1,71 @@ +-- ToC missing trigger spawns + +SET @GUID := 88412; +SET @NPC_TRIGGER1 := 34704; -- Val'kyr Twins Bullet Stalker Dark +SET @NPC_TRIGGER2 := 34720; -- Val'kyr Twins Bullet Stalker Light + +UPDATE `creature_template` SET `flags_extra`=128 WHERE `entry` IN (@NPC_TRIGGER1,@NPC_TRIGGER2); +DELETE FROM `creature` WHERE `guid` BETWEEN @GUID+0 AND @GUID+61; +INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES +(@GUID+0,@NPC_TRIGGER1,649,15,1,0,0,619.771,143.71,395.244,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+1,@NPC_TRIGGER1,649,15,1,0,0,515.352,115.349,395.288,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+2,@NPC_TRIGGER1,649,15,1,0,0,605.514,103.863,395.29,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+3,@NPC_TRIGGER1,649,15,1,0,0,615.137,156.997,395.28,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+4,@NPC_TRIGGER1,649,15,1,0,0,539.179,184.132,395.282,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+5,@NPC_TRIGGER1,649,15,1,0,0,547.76,184.634,395.289,2.93215,7200,0,0,1,0,0,0,0,0), +(@GUID+6,@NPC_TRIGGER1,649,15,1,0,0,549.764,86.4444,395.266,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+7,@NPC_TRIGGER1,649,15,1,0,0,511.417,127.158,395.266,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+8,@NPC_TRIGGER1,649,15,1,0,0,597.38,183.672,395.28,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+9,@NPC_TRIGGER1,649,15,1,0,0,573.578,187.665,395.492,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+10,@NPC_TRIGGER1,649,15,1,0,0,620.465,134.66,395.233,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+11,@NPC_TRIGGER1,649,15,1,0,0,560.484,187.743,395.959,2.93215,7200,0,0,1,0,0,0,0,0), +(@GUID+12,@NPC_TRIGGER1,649,15,1,0,0,577.299,186.854,395.289,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+13,@NPC_TRIGGER1,649,15,1,0,0,563.467,81.9323,395.288,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+14,@NPC_TRIGGER1,649,15,1,0,0,534.748,92.6424,395.289,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+15,@NPC_TRIGGER1,649,15,1,0,0,518.503,170.649,395.289,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+16,@NPC_TRIGGER1,649,15,1,0,0,514.566,159.918,395.287,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+17,@NPC_TRIGGER1,649,15,1,0,0,568.049,187.67,395.563,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+18,@NPC_TRIGGER1,649,15,1,0,0,522.955,102.127,395.29,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+19,@NPC_TRIGGER1,649,15,1,0,0,611.656,114.281,395.288,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+20,@NPC_TRIGGER1,649,15,1,0,0,616.432,126.418,395.264,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+21,@NPC_TRIGGER1,649,15,1,0,0,526.833,181.783,395.285,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+22,@NPC_TRIGGER1,649,15,1,0,0,578.722,87.4444,395.272,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+23,@NPC_TRIGGER1,649,15,1,0,0,509.743,149.005,395.253,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+24,@NPC_TRIGGER1,649,15,1,0,0,592.736,93.6667,395.289,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+25,@NPC_TRIGGER1,649,15,1,0,0,506.038,139.517,395.288,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+26,@NPC_TRIGGER1,649,15,1,0,0,608.116,171.731,395.289,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+27,@NPC_TRIGGER1,649,15,1,0,0,586.344,184.078,395.283,4.60767,7200,0,0,1,0,0,0,0,0), +(@GUID+28,@NPC_TRIGGER1,649,15,1,0,0,554.818,187.568,395.288,2.93215,7200,0,0,1,0,0,0,0,0), +(@GUID+29,@NPC_TRIGGER2,649,15,1,0,0,557.743,187.729,395.915,0,7200,0,0,1,0,0,0,0,0), +(@GUID+30,@NPC_TRIGGER2,649,15,1,0,0,544.094,184.648,395.286,0,7200,0,0,1,0,0,0,0,0), +(@GUID+31,@NPC_TRIGGER2,649,15,1,0,0,551.328,187.646,395.596,0,7200,0,0,1,0,0,0,0,0), +(@GUID+32,@NPC_TRIGGER2,649,15,1,0,0,615.137,150.818,395.269,0,7200,0,0,1,0,0,0,0,0), +(@GUID+33,@NPC_TRIGGER2,649,15,1,0,0,571.158,187.691,395.629,0,7200,0,0,1,0,0,0,0,0), +(@GUID+34,@NPC_TRIGGER2,649,15,1,0,0,606.686,106.731,395.289,0,7200,0,0,1,0,0,0,0,0), +(@GUID+35,@NPC_TRIGGER2,649,15,1,0,0,612.118,118.844,395.287,0,7200,0,0,1,0,0,0,0,0), +(@GUID+36,@NPC_TRIGGER2,649,15,1,0,0,546.057,88.7691,395.284,0,7200,0,0,1,0,0,0,0,0), +(@GUID+37,@NPC_TRIGGER2,649,15,1,0,0,517.722,169.069,395.289,0,7200,0,0,1,0,0,0,0,0), +(@GUID+38,@NPC_TRIGGER2,649,15,1,0,0,507.181,142.285,395.255,0,7200,0,0,1,0,0,0,0,0), +(@GUID+39,@NPC_TRIGGER2,649,15,1,0,0,515.399,159.75,395.287,0,7200,0,0,1,0,0,0,0,0), +(@GUID+40,@NPC_TRIGGER2,649,15,1,0,0,592.151,183.8,395.279,0,7200,0,0,1,0,0,0,0,0), +(@GUID+41,@NPC_TRIGGER2,649,15,1,0,0,510.759,127.333,395.263,0,7200,0,0,1,0,0,0,0,0), +(@GUID+42,@NPC_TRIGGER2,649,15,1,0,0,524.257,178.134,395.29,0,7200,0,0,1,0,0,0,0,0), +(@GUID+43,@NPC_TRIGGER2,649,15,1,0,0,570.779,86.2986,395.253,0,7200,0,0,1,0,0,0,0,0), +(@GUID+44,@NPC_TRIGGER2,649,15,1,0,0,588.675,93.0938,395.289,0,7200,0,0,1,0,0,0,0,0), +(@GUID+45,@NPC_TRIGGER2,649,15,1,0,0,603.528,175.476,395.289,0,7200,0,0,1,0,0,0,0,0), +(@GUID+46,@NPC_TRIGGER2,649,15,1,0,0,509.639,133.26,395.247,0,7200,0,0,1,0,0,0,0,0), +(@GUID+47,@NPC_TRIGGER2,649,15,1,0,0,618.965,139.174,395.288,0,7200,0,0,1,0,0,0,0,0), +(@GUID+48,@NPC_TRIGGER2,649,15,1,0,0,514.785,118.731,395.287,0,7200,0,0,1,0,0,0,0,0), +(@GUID+49,@NPC_TRIGGER2,649,15,1,0,0,581.243,184.062,395.287,0,7200,0,0,1,0,0,0,0,0), +(@GUID+50,@NPC_TRIGGER2,649,15,1,0,0,577.757,184.436,395.289,0,7200,0,0,1,0,0,0,0,0), +(@GUID+51,@NPC_TRIGGER2,649,15,1,0,0,580.486,89.691,395.287,0,7200,0,0,1,0,0,0,0,0), +(@GUID+52,@NPC_TRIGGER2,649,15,1,0,0,511.132,151.156,395.264,0,7200,0,0,1,0,0,0,0,0), +(@GUID+53,@NPC_TRIGGER2,649,15,1,0,0,615.401,130.816,395.263,0,7200,0,0,1,0,0,0,0,0), +(@GUID+54,@NPC_TRIGGER2,649,15,1,0,0,599.307,98.8003,395.29,0,7200,0,0,1,0,0,0,0,0), +(@GUID+55,@NPC_TRIGGER2,649,15,1,0,0,520.212,108.429,395.289,0,7200,0,0,1,0,0,0,0,0), +(@GUID+56,@NPC_TRIGGER2,649,15,1,0,0,610.983,164.696,395.288,0,7200,0,0,1,0,0,0,0,0), +(@GUID+57,@NPC_TRIGGER2,649,15,1,0,0,526.337,99.5556,395.29,0,7200,0,0,1,0,0,0,0,0), +(@GUID+58,@NPC_TRIGGER2,649,15,1,0,0,563.997,187.644,395.489,0,7200,0,0,1,0,0,0,0,0), +(@GUID+59,@NPC_TRIGGER2,649,15,1,0,0,555.695,86.0208,395.253,0,7200,0,0,1,0,0,0,0,0), +(@GUID+60,@NPC_TRIGGER2,649,15,1,0,0,535.924,184.207,395.279,0,7200,0,0,1,0,0,0,0,0), +(@GUID+61,@NPC_TRIGGER2,649,15,1,0,0,538.024,92.441,395.289,0,7200,0,0,1,0,0,0,0,0); diff --git a/sql/old/3.3.5a/2012_03_22_00_world_creature_template.sql b/sql/old/3.3.5a/2012_03_22_00_world_creature_template.sql new file mode 100644 index 00000000000..e6c03ed589c --- /dev/null +++ b/sql/old/3.3.5a/2012_03_22_00_world_creature_template.sql @@ -0,0 +1,2 @@ +-- Flame Sphere should not be visible to players(only their visual) +UPDATE `creature_template` SET `flags_extra`=128 WHERE `entry` IN (30106,31686,31687); diff --git a/sql/old/3.3.5a/2012_03_22_01_world_conditions.sql b/sql/old/3.3.5a/2012_03_22_01_world_conditions.sql new file mode 100644 index 00000000000..074328137a5 --- /dev/null +++ b/sql/old/3.3.5a/2012_03_22_01_world_conditions.sql @@ -0,0 +1,2 @@ +-- Manual: Heavy Frostweave Bandage should be lootable if you have at least 390 skills in First Aid +UPDATE `conditions` SET `ConditionValue2`=390 WHERE `SourceTypeOrReferenceId`=1 AND `SourceEntry`=39152 AND `ConditionTypeOrReference`=7 AND `ConditionValue1`=129; diff --git a/sql/old/3.3.5a/2012_03_23_00_world_ip2nation.sql b/sql/old/3.3.5a/2012_03_23_00_world_ip2nation.sql new file mode 100644 index 00000000000..dadeaddf85a --- /dev/null +++ b/sql/old/3.3.5a/2012_03_23_00_world_ip2nation.sql @@ -0,0 +1,21 @@ +DROP TABLE IF EXISTS ip2nation; + +CREATE TABLE ip2nation ( + ip int(11) unsigned NOT NULL default '0', + country char(2) NOT NULL default '', + KEY ip (ip) +); + +DROP TABLE IF EXISTS ip2nationCountries; + +CREATE TABLE ip2nationCountries ( + code varchar(4) NOT NULL default '', + iso_code_2 varchar(2) NOT NULL default '', + iso_code_3 varchar(3) default '', + iso_country varchar(255) NOT NULL default '', + country varchar(255) NOT NULL default '', + lat float NOT NULL default '0', + lon float NOT NULL default '0', + PRIMARY KEY (code), + KEY code (code) +); diff --git a/sql/old/3.3.5a/2012_03_24_00_world_misc.sql b/sql/old/3.3.5a/2012_03_24_00_world_misc.sql new file mode 100644 index 00000000000..e6f6ce77307 --- /dev/null +++ b/sql/old/3.3.5a/2012_03_24_00_world_misc.sql @@ -0,0 +1,22 @@ +-- Beam Visual +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=60342; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,1,60342,0,0,31,0,3,29308,0,0,0,'','Beam Visual target Prince Taldaram'); + +-- script texts for Prince Taldaram +DELETE FROM `creature_text` WHERE `entry`=29308; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(29308,0,0,'The hum of magic energy in the air diminishes...',16,0,100,0,0,0,'prince taldaram SAY_1'), +(29308,1,0,'Intruders! Who trespasses in the Old Kingdom?',14,0,100,0,0,0,'prince taldaram SAY_WARNING'), +(29308,2,0,'I will feast on your remains.',14,0,100,0,0,14360,'prince taldaram SAY_AGGRO'), +(29308,3,0,'',14,10,100,0,0,14365,'prince taldaram SAY_SLAY_0'), +(29308,3,1,'I will drink no blood before it''s time.',14,0,100,0,0,14366,'prince taldaram SAY_SLAY_1'), +(29308,3,2,'One final embrace.',14,0,100,0,0,14367,'prince taldaram SAY_SLAY_2'), +(29308,4,0,'Still I hunger. Still... I... thirst.',14,0,100,0,0,14368,'prince taldaram SAY_DEATH'), +(29308,5,0,'So... appetizing.',14,0,100,0,0,14363,'prince taldaram SAY_FEED1'), +(29308,5,1,'Fresh, warm blood. It has been too long.',14,0,100,0,0,14364,'prince taldaram SAY_FEED2'), +(29308,6,0,'Your heartbeat is... music to my ears.',14,0,100,0,0,14361,'prince taldaram SAY_VANISH1'), +(29308,6,1,'I am nowhere... I am everywhere. I am the watcher, unseen.',14,0,100,0,0,14362,'prince taldaram SAY_VANISH2'); + +-- cleanup +DELETE FROM `script_texts` WHERE `npc_entry`=29308; diff --git a/sql/old/3.3.5a/2012_03_24_01_world_creature_loot_template.sql b/sql/old/3.3.5a/2012_03_24_01_world_creature_loot_template.sql new file mode 100644 index 00000000000..078c48a47b7 --- /dev/null +++ b/sql/old/3.3.5a/2012_03_24_01_world_creature_loot_template.sql @@ -0,0 +1,290 @@ +-- ----------------------------------- +-- -- Loot for The Siege of Ulduar -- +-- ----------------------------------- + +-- Old Cleanups: +DELETE FROM `reference_loot_template` WHERE `entry` IN ( 34116,34117,34118,34119,34120,34121,34157,34158,34159,34160,34161,34162); +-- ------------------- +-- -- Set Variables -- +-- ------------------- +-- 10 man mode npcids +SET @FlameLevi10 :=33113; +SET @IgnisFM10 :=33118; +SET @Razorscale10 :=33186; +SET @XT002_10 :=33293; +-- 25 man mode npcids (via procedure) +call `sp_get_npc_diffentry`(@FlameLevi10,1,@FlameLevi25); +call `sp_get_npc_diffentry`(@IgnisFM10,1,@IgnisFM25); +call `sp_get_npc_diffentry`(@Razorscale10,1,@Razorscale25); +call `sp_get_npc_diffentry`(@XT002_10,1,@XT002_25); + +SET @Emblem := 47241; +SET @Orb := 45087; +-- ------------------------------------- +-- -- Set Reference Loot Template ids -- +-- ------------------------------------- + +SET @EmblemRef := 34349; -- First Free ID +SET @OrbRef := @EmblemRef+1; +SET @Flame10Ref := @EmblemRef+2; +SET @Flame25Ref := @EmblemRef+3; +SET @Ignis10Ref := @EmblemRef+4; +SET @Ignis25Ref := @EmblemRef+5; +SET @Razor10Ref := @EmblemRef+6; +SET @Razor25Ref := @EmblemRef+7; +SET @XT002_10Ref := @EmblemRef+8; +SET @XT002_25Ref := @EmblemRef+9; +-- Flame Levithian +DELETE FROM `reference_loot_template` WHERE `entry` BETWEEN @EmblemRef AND @EmblemRef+9; +INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- Emblem Ref +(@EmblemRef,47241,0,1,1,1,1), -- Emblem of Triumph 1x +-- OrbRef +(@OrbRef,45087,0,1,1,1,1), -- Runed Orb 1x +-- Flame Levithian 10man +(@Flame10Ref,45286,0,1,1,1,1), -- Pyrite Infuser +(@Flame10Ref,45287,0,1,1,1,1), -- Firesoul +(@Flame10Ref,45288,0,1,1,1,1), -- Firestrider Chestguard +(@Flame10Ref,45289,0,1,1,1,1), -- Lifespark Visage +(@Flame10Ref,45291,0,1,1,1,1), -- Combustion Bracers +(@Flame10Ref,45284,0,1,1,1,1), -- Kinetic Ripper +(@Flame10Ref,45282,0,1,1,1,1), -- Ironsoul +(@Flame10Ref,45285,0,1,1,1,1), -- Might of the Leviathan +(@Flame10Ref,45292,0,1,1,1,1), -- Energy Siphon +(@Flame10Ref,45283,0,1,1,1,1), -- Flamewatch Armguards +-- Flame Levithian 25man +(@Flame25Ref,45117,0,1,1,1,1), -- Constructors Handwraps +(@Flame25Ref,45119,0,1,1,1,1), -- Embrace of the Leviathan +(@Flame25Ref,45113,0,1,1,1,1), -- Glowing Ring of Reclamation +(@Flame25Ref,45115,0,1,1,1,1), -- Leviathan Fueling Manual +(@Flame25Ref,45108,0,1,1,1,1), -- Mechanists Bindings +(@Flame25Ref,45106,0,1,1,1,1), -- Strenght of the Automaton +(@Flame25Ref,45109,0,1,1,1,1), -- Gloves of the Fiery Behemoth +(@Flame25Ref,45114,0,1,1,1,1), -- Steamcallers Totem +(@Flame25Ref,45118,0,1,1,1,1), -- Steamworkers Goggles +(@Flame25Ref,45116,0,1,1,1,1), -- Freya's Choker of Warding +(@Flame25Ref,45111,0,1,1,1,1), -- Mimiron's Inferno Couplings +(@Flame25Ref,45112,0,1,1,1,1), -- The Leviathan's Coil +(@Flame25Ref,45107,0,1,1,1,1), -- Iron Riveted War Helm + +-- Ignis the Furnace Master 10man +(@Ignis10Ref,45309,0,1,1,1,1), -- Rifle of the Platinum Guard +(@Ignis10Ref,45310,0,1,1,1,1), -- Gauntlets of the Iron Furnace +(@Ignis10Ref,45311,0,1,1,1,1), -- Relentless Edge +(@Ignis10Ref,45312,0,1,1,1,1), -- Gloves of Smoldering Touch +(@Ignis10Ref,45313,0,1,1,1,1), -- Furnace Stone +(@Ignis10Ref,45314,0,1,1,1,1), -- Igniter Rod +(@Ignis10Ref,45316,0,1,1,1,1), -- Armbraces of the Vibrant Flame +(@Ignis10Ref,45317,0,1,1,1,1), -- Shawl of the Caretaker +(@Ignis10Ref,45318,0,1,1,1,1), -- Drape of Fuming Anger +(@Ignis10Ref,45321,0,1,1,1,1), -- Pauldrons of Tempered Will +-- Ignis the Furnace Master 25man +(@Ignis25Ref,45157,0,1,1,1,1), -- Cindershard Ring +(@Ignis25Ref,45158,0,1,1,1,1), -- Heart of Iron +(@Ignis25Ref,45161,0,1,1,1,1), -- Girdle of Embers +(@Ignis25Ref,45162,0,1,1,1,1), -- Flamestalker Boots +(@Ignis25Ref,45164,0,1,1,1,1), -- Helm of the Furnace Master +(@Ignis25Ref,45165,0,1,1,1,1), -- Worldcarver +(@Ignis25Ref,45166,0,1,1,1,1), -- Charred Saronite Greaves +(@Ignis25Ref,45167,0,1,1,1,1), -- Lifeforge Breastplate +(@Ignis25Ref,45168,0,1,1,1,1), -- Pyrelight Circle +(@Ignis25Ref,45169,0,1,1,1,1), -- Totem of the Dancing Flame +(@Ignis25Ref,45170,0,1,1,1,1), -- Scepter of Creation +(@Ignis25Ref,45171,0,1,1,1,1), -- Intensity +(@Ignis25Ref,45185,0,1,1,1,1), -- Flamewrought Cinch +(@Ignis25Ref,45186,0,1,1,1,1), -- Soot-Covered Mantle +(@Ignis25Ref,45187,0,1,1,1,1), -- Wristguards of the Firetender + +-- Razorscale 10man +(@Razor10Ref,45298,0,1,1,1,1), -- RazoRazorcale Talon +(@Razor10Ref,45299,0,1,1,1,1), -- Dragonsteel Faceplate +(@Razor10Ref,45301,0,1,1,1,1), -- BraceRazor of the Smothering Inferno +(@Razor10Ref,45302,0,1,1,1,1), -- Treads of the Invader +(@Razor10Ref,45303,0,1,1,1,1), -- Band of Draconic Guile +(@Razor10Ref,45304,0,1,1,1,1), -- Stormtempered Girdle +(@Razor10Ref,45305,0,1,1,1,1), -- Breastplate of the Afterlife +(@Razor10Ref,45306,0,1,1,1,1), -- Binding of the Dragon Matriarch +(@Razor10Ref,45307,0,1,1,1,1), -- Ironscale Leggings +(@Razor10Ref,45308,0,1,1,1,1), -- Eye of the Broodmother +-- Razorscale 25man +(@Razor25Ref,45137,0,1,1,1,1), -- Veranus' Bane +(@Razor25Ref,45138,0,1,1,1,1), -- Drape of the Drakerider +(@Razor25Ref,45139,0,1,1,1,1), -- Dragonslayer's Brace +(@Razor25Ref,45140,0,1,1,1,1), -- RazoRazorcale Shoulderguards +(@Razor25Ref,45141,0,1,1,1,1), -- Proto-hide Leggings +(@Razor25Ref,45142,0,1,1,1,1), -- RemoRazore +(@Razor25Ref,45143,0,1,1,1,1), -- Saronite Mesh Legguards +(@Razor25Ref,45144,0,1,1,1,1), -- Sigil of Deflection +(@Razor25Ref,45146,0,1,1,1,1), -- Shackles of the Odalisque +(@Razor25Ref,45147,0,1,1,1,1), -- Guiding Star +(@Razor25Ref,45148,0,1,1,1,1), -- Living Flame +(@Razor25Ref,45149,0,1,1,1,1), -- BraceRazor of the Broodmother +(@Razor25Ref,45150,0,1,1,1,1), -- Collar of the Wyrmhunter +(@Razor25Ref,45151,0,1,1,1,1), -- Belt of the Fallen Wyrm +(@Razor25Ref,45510,0,1,1,1,1), -- Libram of Discord + +-- XT-002 Deconstructor 10man +(@XT002_10Ref,45675,0,1,1,1,1), -- Power Enchancing Loop +(@XT002_10Ref,45676,0,1,1,1,1), -- Chestplate of Vicious Potency +(@XT002_10Ref,45677,0,1,1,1,1), -- Treacherous shoulderpads +(@XT002_10Ref,45679,0,1,1,1,1), -- Gloves of Taut grip +(@XT002_10Ref,45680,0,1,1,1,1), -- Armbands of the construct +(@XT002_10Ref,45682,0,1,1,1,1), -- Pulsing spellshield +(@XT002_10Ref,45685,0,1,1,1,1), -- Plasma Foil +(@XT002_10Ref,45686,0,1,1,1,1), -- Vest of the glowing Cresent +(@XT002_10Ref,45687,0,1,1,1,1), -- Helm of Veiled Energies +(@XT002_10Ref,45694,0,1,1,1,1), -- Conductive cord +(@XT002_10Ref,45867,0,2,2,1,1), -- Breasktplate of the Stoneshaper +(@XT002_10Ref,45868,0,2,2,1,1), -- Aesir's Edge +(@XT002_10Ref,45869,0,2,2,1,1), -- Fluxing Energy Coils +(@XT002_10Ref,45870,0,2,2,1,1), -- Magnetized Projectile Emitter +(@XT002_10Ref,45871,0,2,2,1,1), -- Seal of Ulduar +-- XT-002 Deconstructor 25man +(@XT002_25Ref,45254,0,1,1,1,1), -- Sigil of the Vengeful Heart +(@XT002_25Ref,45251,0,1,1,1,1), -- Shoulderplates of the Deconstructor +(@XT002_25Ref,45247,0,1,1,1,1), -- Signet of the Earthshaker +(@XT002_25Ref,45256,0,1,1,1,1), -- Twisted Visage +(@XT002_25Ref,45250,0,1,1,1,1), -- Crazed Construct Ring +(@XT002_25Ref,45257,0,1,1,1,1), -- Quartz Crystal Wand +(@XT002_25Ref,45260,0,1,1,1,1), -- Boots of Hasty Revival +(@XT002_25Ref,45252,0,1,1,1,1), -- Horologist's Wristguards +(@XT002_25Ref,45253,0,1,1,1,1), -- Mantle of Wavering Calm +(@XT002_25Ref,45258,0,1,1,1,1), -- Sandals of Rash Temperament +(@XT002_25Ref,45249,0,1,1,1,1), -- Brass-lined Boots +(@XT002_25Ref,45246,0,1,1,1,1), -- Golem-Shard Sticker +(@XT002_25Ref,45248,0,1,1,1,1), -- Clockwork Legplates +(@XT002_25Ref,45259,0,1,1,1,1), -- Quartz-studded Harness +(@XT002_25Ref,45255,0,1,1,1,1); -- Thunderfall Totem +-- ----------------------------------------------------------------------------------------------- +-- -- END OF REFERENCES -- -- END OF REFERENCES -- -- END OF REFERENCES -- -- END OF REFERENCES -- +-- -- END OF REFERENCES -- -- END OF REFERENCES -- -- END OF REFERENCES -- -- END OF REFERENCES -- +-- -- END OF REFERENCES -- -- END OF REFERENCES -- -- END OF REFERENCES -- -- END OF REFERENCES -- +-- ----------------------------------------------------------------------------------------------- + +-- Flame Levithian 10Man: +-- NORMAL MODE : 2x [Normal Loot Item] + 1x [Emblem of Valor] +-- ONE TOWER : 2x [Normal Loot Item] + 2x [Emblem of Conquest] + CHANCE TO [Recipe] +-- TWO TOWERS : 2x [Normal Loot Item] + 2x [Emblem of Conquest] + 1x [Runed Orb] + CHANCE TO [Recipe] +-- THREE TOWERS: 2x [Normal Loot Item] + 3x [Emblem of Conquest] + 1x [Runed Orb] + CHANCE TO [Recipe] + 1x [Recipe] +-- FOUR TOWERS : 2x [Normal Loot Item] + 3x [Emblem of Conquest] + 1x [Runed Orb] + CHANCE TO [Recipe] + 1x [Recipe] + 1x [Hard Loot Item] +-- Flame Levithian 25 man +-- NORMAL MODE : 3x [Normal Loot Item] + 1x [Emblem of Conquest] + CHANCE TO [Runed Orb] + CHANCE TO [Recipe] +-- ONE TOWER : 3x [Normal Loot Item] + 2x [Emblem of Conquest] + CHANCE TO [Runed Orb] + CHANCE TO [Recipe] +-- TWO TOWERS : 3x [Normal Loot Item] + 2x [Emblem of Conquest] + CHANCE TO [Runed Orb] + CHANCE TO [Recipe] + 2x [Runed Orb] +-- THREE TOWERS: 3x [Normal Loot Item] + 3x [Emblem of Conquest] + CHANCE TO [Runed Orb] + CHANCE TO [Recipe] + 2x [Runed Orb] + [Recipe] +-- FOUR TOWERS : 3x [Normal Loot Item] + 3x [Emblem of Conquest] + CHANCE TO [Runed Orb] + CHANCE TO [Recipe] + 2x [Runed Orb] + [Recipe] + 1x [Hard Loot Item] + +DELETE FROM `creature_loot_template` WHERE `entry` IN (@FlameLevi10,@FlameLevi25,@IgnisFM10,@IgnisFM25,@Razorscale10,@Razorscale25,@XT002_10,@XT002_25); +INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- --------------------------- +-- -- Flame Levithian 10man -- +-- --------------------------- +(@FlameLevi10,1,100,1,0,-@EmblemRef,1), -- 1x emblem +(@FlameLevi10,2,100,1,0,-@Flame10Ref,2), -- 2 from 10man reference +-- Hardmode: 1 tower left +(@FlameLevi10,3,100,2,0,-@EmblemRef,2), -- 2x emblem +(@FlameLevi10,4,100,2,0,-@Flame10Ref,2), -- 2 from 10man reference +-- Hardmode: 2 towers left +(@FlameLevi10,5,100,4,0,-@EmblemRef,2), -- 2x emblem +(@FlameLevi10,6,100,4,0,-@Flame10Ref,2), -- 2 from 10man reference +-- Hardmode: 3 towers left +(@FlameLevi10,7,100,8,0,-@EmblemRef,3), -- 3x emblem +(@FlameLevi10,8,100,8,0,-@Flame10Ref,2), -- 2 from 10man reference +-- Hardmode: 4 towers left +(@FlameLevi10,9,100,16,0,-@EmblemRef,3), -- 3x emblem +(@FlameLevi10,10,100,16,0,-@Flame10Ref,2), -- 2 from 10man reference +-- one from hardmodeloot: +(@FlameLevi10,45296,0,16,1,1,1), -- Twirling Blades +(@FlameLevi10,45293,0,16,1,1,1), -- Handguards of Potent Cures +(@FlameLevi10,45295,0,16,1,1,1), -- Gilded Steel Legplates +(@FlameLevi10,45300,0,16,1,1,1), -- Mantle of Fiery Vengeance +(@FlameLevi10,45297,0,16,1,1,1), -- Shimmering Seal +-- Shared Loot over the modes (masked) +-- Non-Normal (Modes 2|4|8|16) +(@FlameLevi10,11,5,30,0,-34154,1), -- 1 from recepies (chanced) +-- More then 1 tower up (Modes 4|8|16) +(@FlameLevi10,@Orb,100,28,0,1,3), -- Runed Orb (1-3) +-- More then 2 towers up (Modes 8|16) +(@FlameLevi10,12,100,24,0,-34154,1), -- 1 from recepies +-- --------------------------- +-- -- Flame Levithian 25man -- +-- --------------------------- +(@FlameLevi25,1,100,1,0,-@EmblemRef,1), -- 1x emblem +(@FlameLevi25,2,100,1,0,-@Flame25Ref,3), -- 3 from 25man reference +-- Hardmode: 1 tower left +(@FlameLevi25,3,100,2,0,-@EmblemRef,2), -- 2x emblem +(@FlameLevi25,4,100,2,0,-@Flame25Ref,3), -- 3 from 25man reference +-- Hardmode: 2 towers left +(@FlameLevi25,5,100,4,0,-@EmblemRef,2), -- 2x emblem +(@FlameLevi25,6,100,4,0,-@Flame25Ref,3), -- 3 from 25man reference +-- Hardmode: 3 towers left +(@FlameLevi25,7,100,8,0,-@EmblemRef,3), -- 3x emblem +(@FlameLevi25,8,100,8,0,-@Flame25Ref,3), -- 3 from 25man reference +-- Hardmode: 4 towers left +(@FlameLevi25,9,100,16,0,-@EmblemRef,3), -- 3x emblem +(@FlameLevi25,10,100,16,0,-@Flame25Ref,3), -- 3 from 25man reference +-- one from hardmodeloot: +(@FlameLevi25,45132,0,16,1,1,1), -- Golden Saronite Dragon +(@FlameLevi25,45133,0,16,1,1,1), -- Pendant of Fiery Havoc +(@FlameLevi25,45134,0,16,1,1,1), -- Plated Leggings of Ruination +(@FlameLevi25,45135,0,16,1,1,1), -- Boots of Fiery Resolution +(@FlameLevi25,45136,0,16,1,1,1), -- Shoulderpads of Dormant Energies +(@FlameLevi25,45086,0,16,1,1,1), -- Rising Sun +(@FlameLevi25,45110,0,16,1,1,1), -- Titanguard +-- Shared Loot over the modes (masked) +-- All Modes (1|2|4|8|16): +(@FlameLevi25,11,5,31,0,-@OrbRef,1), -- Runed Orb (1x Chanced) +(@FlameLevi25,45038,8,1,0,1,1), -- Fragment of Val'anyr (quest only!?) +(@FlameLevi25,12,5,31,0,-34154,1), -- 1 from recepies (chanced) +-- More then 1 tower up (Modes 4|8|16) +(@FlameLevi25,13,100,28,0,-@OrbRef,2), -- Runed Orb (2x garanteed) +-- More then 2 towers up (Modes 8|16) +(@FlameLevi25,14,100,24,0,-34154,1), -- 1 from recepies +-- ------------------------------ +-- -- IGNIS THE FURNACE MASTER -- +-- ------------------------------ +-- Ignis the Furnace Master 10man +(@IgnisFM10,1,100,1,0,-@Ignis10Ref,2), -- 2 items from Ref loot +(@IgnisFM10,@Emblem,100,1,0,1,1), -- 1 Emblem +-- Ignis the Furnace Master 25man +(@IgnisFM25,1,100,1,0,-@Ignis25Ref,3), -- 3 items from Ref loot +(@IgnisFM25,@Emblem,100,1,0,2,2), -- 2 Emblem +(@IgnisFM25,3,10,1,0,-34154,1), -- 1 from recepies +(@IgnisFM25,45038,8,1,0,1,1), -- Fragment of Val'anyr (quest only!?) +(@IgnisFM25,45087,75,1,0,1,1), -- Runed Orb +-- ---------------- +-- -- RAZORSCALE -- +-- ---------------- +-- Razorscale 10man +(@Razorscale10,1,100,1,0,-@Razor10Ref ,2), -- 2 items from ref loot +(@Razorscale10,@Emblem,100,1,0,1,1), -- Emblem of Triumph +-- Razorscale 25man +(@Razorscale25,1,100,1,0,-@Razor25Ref,3), -- 3 items from Ref loot +(@Razorscale25,@Emblem,100,1,0,1,2), -- 2 Emblems +(@Razorscale25,2,10,1,0,-34154,1), -- 1 from recepies +(@Razorscale25,45038,8,1,0,1,1), -- Fragment of Val'anyr (quest only!?) +(@Razorscale25,45087,75,1,0,1,1), -- Runed Orb +-- ------------------------- +-- -- XT002 DECONSTRUCTOR -- +-- ------------------------- +-- X002 Deconstructor 10man (and hardmode) +(@XT002_10,1,100,3,0,-@XT002_10Ref,2), -- 2items from Ref loot +(@XT002_10,@Emblem,100,3,0,1,1), -- 1x Emblem +-- Hard mode 10man only: +(@XT002_10,45442,0,2,1,1,1), -- Sorthalis,Hammer of the Watchers +(@XT002_10,45443,0,2,1,1,1), -- Charm of Meticulous Timing +(@XT002_10,45444,0,2,1,1,1), -- Gloves of the Steady Hand +(@XT002_10,45445,0,2,1,1,1), -- Breastplate of the Devoted +(@XT002_10,45446,0,2,1,1,1), -- Grasps of Reason +-- X002 Deconstructor 25man (and hardmode) +(@XT002_25,1,100,3,0,-@XT002_25Ref,3), -- 3 items from Ref loot +(@XT002_25,2,10,3,0,-34154,1), -- 1 from recepies +(@XT002_25,45038,8,3,0,1,1), -- Fragment of Val'anyr (quest only!?) +(@XT002_25,45087,75,3,0,1,1), -- Runed Orb +(@XT002_25,47241,100,3,0,1,2), -- 2 Emblem of Triumph +-- Hard Mode 25man only: +(@XT002_25,45442,0,2,1,1,1), -- Sorthalis,Hammer of the Watchers +(@XT002_25,45443,0,2,1,1,1), -- Charm of Meticulous Timing +(@XT002_25,45444,0,2,1,1,1), -- Gloves of the Steady Hand +(@XT002_25,45445,0,2,1,1,1), -- Breastplate of the Devoted +(@XT002_25,45446,0,2,1,1,1); -- Grasps of Reason diff --git a/sql/old/3.3.5a/2012_03_24_02_world_creature_loot_template.sql b/sql/old/3.3.5a/2012_03_24_02_world_creature_loot_template.sql new file mode 100644 index 00000000000..cdac3335aed --- /dev/null +++ b/sql/old/3.3.5a/2012_03_24_02_world_creature_loot_template.sql @@ -0,0 +1,136 @@ +-- (re) Add reference 26042 +SET @NEC := 26042; -- Northrend Emotion Cooking Recipe Reference +DELETE FROM `reference_loot_template` WHERE `entry`=@NEC; +INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(@NEC,43507,0,1,1,1,1), -- Recipe: Tasty cupcake +(@NEC,43508,0,1,1,1,1), -- Recipe: Last Week's Mammoth +(@NEC,43509,0,1,1,1,1), -- Recipe: Bad Clams +(@NEC,43510,0,1,1,1,1); -- Recipe: Haunted Herring + +DELETE FROM `creature_loot_template` WHERE `entry` IN (2436,5928,5936,12239,12240,12241,12242,12243,14527,14529,14531,16506,16836,17307,21166,23809,23954,23963,23964,23983,24175,25234,28027,28113,28138,28494,29554,30177,30954,31779,40419); +UPDATE `creature_template`SET `lootid`=entry WHERE `entry` IN (2436,5928,5936,12239,12240,12241,12242,12243,14527,14529,14531,16506,16836,21166,23809,23963,23964,23983,25234,28027,28138,28494,29554,30954,31779,40419); +UPDATE `creature_template` SET `lootid`=0 WHERE `entry` IN (17307,23954,24175,28113,30177); +INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- Farmer Kent (friendly?) +(2436,3692,-100,1,0,1,1), -- Hilsbrad Human Skull +-- Sorrow Wing +(5928,5808,-50,1,0,1,1), -- Pridewing Venom Sac +(5928,5137,80,1,0,1,1), -- Bright Eyeball +(5928,5136,10,1,0,1,1), -- Torn Furry Ear +(5928,1,100,1,0,-@NEC,1), -- Random world green drop ilvl 25-30 +-- Orca +(5936,26000,3,1,1,-26000,1), -- Northrend World Grey Reference #1 +(5936,26001,3,1,1,-26001,1), -- Northrend World Grey Reference #2 +(5936,26003,1,1,1,-26003,1), -- Northrend World Green Reference #1 +(5936,26004,1,1,1,-26004,1), -- Northrend World Green Reference #2 +(5936,26005,1,1,1,-26005,1), -- Northrend World Green Reference #3 +(5936,26006,1,1,1,-26006,1), -- Northrend World Green Reference #4 +(5936,26017,0.5,1,1,-26017,1), -- Northrend World Blue Reference #1 +(5936,26018,0.5,1,1,-26018,1), -- Northrend World Blue Reference #2 +(5936,26019,0.5,1,1,-26019,1), -- Northrend World Blue Reference #3 +(5936,26020,0.5,1,1,-26020,1), -- Northrend World Blue Reference #4 +-- Add Theradric Crystal Carving (17684) to the following creatures +(12239,17684,-25,1,0,1,1), -- Spirit of Gelk +(12240,17684,-25,1,0,1,1), -- Spirit of Kolk +(12241,17684,-25,1,0,1,1), -- Spirit of Magra +(12242,17684,-25,1,0,1,1), -- Spirit of Maraudos +(12243,17684,-25,1,0,1,1), -- Spirit of Veng +(14527,18952,-100,1,0,1,1), -- Simone the Inconspicuous - Simone's Head +(14529,18953,-100,1,0,1,1), -- Franklin the Friendly - Klinfran's Head +(14531,18955,-100,1,0,1,1), -- Artorius the Amiable - Artorius's Head +(16506,22708,-100,1,0,1,1), -- Naxxramas Worshipper - Fate of Ramaladni +(16836,23460,-100,1,0,1,1), -- Escaped Dreghood - Broken Blood Sample +(21166,30451,-15,1,0,1,1), -- Illidari Dreadlord - Lohn'goron, Bow of the Torn-heart +-- Vengeance Landing Cannoneer +(23809,26000,3,1,1,-26000,1), -- Northrend World Grey Reference #1 +(23809,26001,3,1,1,-26001,1), -- Northrend World Grey Reference #2 +(23809,26005,1,1,1,-26005,1), -- Northrend World Green Reference #3 +-- Sergeant Lorric +(23963,26000,3,1,1,-26000,1), -- Northrend World Grey Reference #1 +(23963,26001,3,1,1,-26001,1), -- Northrend World Grey Reference #2 +(23963,26003,1,1,1,-26003,1), -- Northrend World Green Reference #1 +(23963,26004,1,1,1,-26004,1), -- Northrend World Green Reference #2 +(23963,26017,0.5,1,1,-26017,1), -- Northrend World Blue Reference #1 +(23963,26018,0.5,1,1,-26018,1), -- Northrend World Blue Reference #2 +(23963,26044,2,1,0,-@NEC,1), -- Northrend Emotion Cooking Recipes +-- Lieutenant Celeyne +(23964,26000,3,1,1,-26000,1), -- Northrend World Grey Reference #1 +(23964,26001,3,1,1,-26001,1), -- Northrend World Grey Reference #2 +(23964,26003,1,1,1,-26003,1), -- Northrend World Green Reference #1 +(23964,26004,1,1,1,-26004,1), -- Northrend World Green Reference #2 +(23964,26017,0.5,1,1,-26017,1), -- Northrend World Blue Reference #1 +(23964,26018,0.5,1,1,-26018,1), -- Northrend World Blue Reference #2 +(23964,26044,2,1,0,-@NEC,1), -- Northrend Emotion Cooking Recipes +-- North Fleet Marine +(23983,26000,3,1,1,-26000,1), -- Northrend World Grey Reference #1 +(23983,26001,3,1,1,-26001,1), -- Northrend World Grey Reference #2 +(23983,26003,1,1,1,-26003,1), -- Northrend World Green Reference #1 +(23983,26004,1,1,1,-26004,1), -- Northrend World Green Reference #2 +(23983,26017,0.5,1,1,-26017,1), -- Northrend World Blue Reference #1 +(23983,26018,0.5,1,1,-26018,1), -- Northrend World Blue Reference #2 +(23983,26044,2,1,0,-@NEC,1), -- Northrend Emotion Cooking Recipes +-- Stormfleet Deckhand +(25234,26000,3,1,1,-26000,1), -- Northrend World Grey Reference #1 +(25234,26003,1,1,1,-26003,1), -- Northrend World Green Reference #1 +-- High-Oracle Soo-say +(28027,17058,50,1,0,1,1), -- Fish Oil +(28027,17057,30,1,0,1,1), -- Shiny Fish Scales +(28027,33470,15,1,0,2,4), -- Frostweave Cloth +(28027,35951,10,1,0,1,3), -- Poached Emperor Salmon +(28027,38642,-1,1,0,1,1), -- Golden Engagement Ring +-- Elder Harkek +(28138,33470,40,1,0,2,4), -- Frostweave Cloth +(28138,33447,4,1,0,1,1), -- Runic Healing Potion +(28138,38642,-1,1,0,1,1), -- Golden Engagement Ring +-- Kutube'sa +(28494,26001,3,1,1,-26001,1), -- Northrend World Grey Reference #2 +(28494,26002,3,1,1,-26002,1), -- Northrend World Grey Reference #3 +(28494,26010,1,1,1,-26010,1), -- Northrend World Green Reference #4 +(28494,26011,1,1,1,-26011,1), -- Northrend World Green Reference #5 +(28494,26012,1,1,1,-26012,1), -- Northrend World Green Reference #6 +(28494,26023,0.5,1,1,-26023,1), -- Northrend World Blue Reference #3 +(28494,26025,0.5,1,1,-26025,1), -- Northrend World Blue Reference #4 +(28494,26026,0.5,1,1,-26026,1), -- Northrend World Blue Reference #5 +(28494,26044,2,1,0,-@NEC,1), -- Northrend Emotion Cooking Recipes +(28494,39152,35,1,0,1,1), -- Manual: Heavy Frostweave Bandage +(28494,43297,1,1,0,1,1), -- Damaged Necklace +-- Snowblind Devotee +(29554,26001,3,1,1,-26001,1), -- Northrend World Grey Reference #2 +(29554,26002,3,1,1,-26002,1), -- Northrend World Grey Reference #3 +(29554,26009,1,1,1,-26009,1), -- Northrend World Green Reference #3 +(29554,26010,1,1,1,-26010,1), -- Northrend World Green Reference #4 +(29554,26011,1,1,1,-26011,1), -- Northrend World Green Reference #5 +(29554,26012,1,1,1,-26012,1), -- Northrend World Green Reference #6 +(29554,26013,1,1,1,-26013,1), -- Northrend World Green Reference #7 +(29554,26023,0.5,1,1,-26023,1), -- Northrend World Blue Reference #3 +(29554,26024,0.5,1,1,-26024,1), -- Northrend World Blue Reference #4 +(29554,26025,0.5,1,1,-26025,1), -- Northrend World Blue Reference #5 +(29554,26026,0.5,1,1,-26026,1), -- Northrend World Blue Reference #6 +(29554,26044,2,1,0,-@NEC,1), -- Northrend Emotion Cooking Recipes +(29554,39152,35,1,0,1,1), -- Manual: Heavy Frostweave Bandage +(29554,43297,1,1,0,1,1), -- Damaged Necklace +-- Rokir +(30954,26001,6,1,1,-26001,1), -- Northrend World Grey Reference #2 +(30954,26002,6,1,1,-26002,1), -- Northrend World Grey Reference #3 +(30954,26014,2,1,1,-26014,1), -- Northrend World Green Reference #8 +(30954,26015,2,1,1,-26015,1), -- Northrend World Green Reference #9 +-- Skeletal Archmage +(31779,26001,3,1,1,-26001,1), -- Northrend World Grey Reference #2 +(31779,26002,3,1,1,-26002,1), -- Northrend World Grey Reference #3 +(31779,26013,1,1,1,-26013,1), -- Northrend World Green Reference #7 +(31779,26014,1,1,1,-26014,1), -- Northrend World Green Reference #8 +(31779,26015,1,1,1,-26015,1), -- Northrend World Green Reference #9 +(31779,26028,0.5,1,1,-26028,1), -- Northrend World Blue Reference #8 +(31779,39152,50,1,0,1,1), -- Manual: Heavy Frostweave Bandage +(31779,43297,1,1,0,1,1), -- Damaged Necklace +-- Charscale Assaulter +(40419,26001,6,1,1,-26001,1), -- Northrend World Grey Reference #2 +(40419,26002,6,1,1,-26002,1), -- Northrend World Grey Reference #3 +(40419,26015,2,1,1,-26015,1), -- Northrend World Green Reference #9 +(40419,26016,2,1,1,-26016,1); -- Northrend World Green Reference #10 +-- conditions +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 1 AND `SourceGroup` IN (28494,29554,31779); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`Comment`) VALUES +(1,28494,39152,7,129,390,'Manual: Heavy Frostweave Bandage will drop only if the player has first aid at 390'), +(1,29554,39152,7,129,390,'Manual: Heavy Frostweave Bandage will drop only if the player has first aid at 390'), +(1,31779,39152,7,129,390,'Manual: Heavy Frostweave Bandage will drop only if the player has first aid at 390'); diff --git a/sql/old/3.3.5a/2012_03_25_00_auth_misc.sql b/sql/old/3.3.5a/2012_03_25_00_auth_misc.sql new file mode 100644 index 00000000000..f34882af8f6 --- /dev/null +++ b/sql/old/3.3.5a/2012_03_25_00_auth_misc.sql @@ -0,0 +1,8 @@ +ALTER TABLE `account_banned` + CHANGE `bandate` `bandate` INT(10) UNSIGNED DEFAULT 0 NOT NULL, + CHANGE `unbandate` `unbandate` INT(10) UNSIGNED DEFAULT 0 NOT NULL; + +ALTER TABLE `ip_banned` + CHANGE `ip` `ip` VARCHAR(15) CHARSET utf8 COLLATE utf8_general_ci DEFAULT '127.0.0.1' NOT NULL, + CHANGE `bandate` `bandate` INT(10) UNSIGNED NOT NULL, + CHANGE `unbandate` `unbandate` INT(10) UNSIGNED NOT NULL; diff --git a/sql/old/3.3.5a/2012_03_25_00_world_game_event.sql b/sql/old/3.3.5a/2012_03_25_00_world_game_event.sql new file mode 100644 index 00000000000..82dfaa3f494 --- /dev/null +++ b/sql/old/3.3.5a/2012_03_25_00_world_game_event.sql @@ -0,0 +1,4 @@ +-- darkmoon faerie resync, again +UPDATE `game_event` SET `start_time`='2012-04-01 00:01:00' WHERE `eventEntry`=5; +UPDATE `game_event` SET `start_time`='2012-05-06 00:01:00' WHERE `eventEntry`=3; +UPDATE `game_event` SET `start_time`='2012-06-03 00:01:00' WHERE `eventEntry`=4; diff --git a/sql/old/3.3.5a/2012_03_26_00_auth_realmlist.sql b/sql/old/3.3.5a/2012_03_26_00_auth_realmlist.sql new file mode 100644 index 00000000000..0a570a31773 --- /dev/null +++ b/sql/old/3.3.5a/2012_03_26_00_auth_realmlist.sql @@ -0,0 +1,2 @@ +ALTER TABLE `realmlist` + CHANGE `color` `flag` tinyint(3) unsigned NOT NULL DEFAULT '2'; diff --git a/sql/old/3.3.5a/2012_03_26_00_world_creature_template.sql b/sql/old/3.3.5a/2012_03_26_00_world_creature_template.sql new file mode 100644 index 00000000000..f60849476bd --- /dev/null +++ b/sql/old/3.3.5a/2012_03_26_00_world_creature_template.sql @@ -0,0 +1,73 @@ +UPDATE `creature_template` SET `HoverHeight`=10.8, `VehicleId`=232 WHERE `entry`=30393; +UPDATE `creature_template` SET `HoverHeight`=10.8, `VehicleId`=237 WHERE `entry`=30461; +UPDATE `creature_template` SET `HoverHeight`=10 WHERE `entry`=27530; +UPDATE `creature_template` SET `HoverHeight`=10 WHERE `entry`=26277; +UPDATE `creature_template` SET `HoverHeight`=10 WHERE `entry`=26276; +UPDATE `creature_template` SET `HoverHeight`=1.2 WHERE `entry`=31070; +UPDATE `creature_template` SET `HoverHeight`=12 WHERE `entry`=37126; +UPDATE `creature_template` SET `HoverHeight`=15 WHERE `entry`=27608; +UPDATE `creature_template` SET `HoverHeight`=15 WHERE `entry`=27608; +UPDATE `creature_template` SET `HoverHeight`=1.6 WHERE `entry`=38392; +UPDATE `creature_template` SET `HoverHeight`=2.25 WHERE `entry`=30272; +UPDATE `creature_template` SET `HoverHeight`=2.58, `Scale`=1.72 WHERE `entry`=26607; +UPDATE `creature_template` SET `HoverHeight`=25 WHERE `entry`=37755; +UPDATE `creature_template` SET `HoverHeight`=26 WHERE `entry`=29790; +UPDATE `creature_template` SET `HoverHeight`=2.7 WHERE `entry`=25451; +UPDATE `creature_template` SET `HoverHeight`=2 WHERE `entry`=29048; +UPDATE `creature_template` SET `HoverHeight`=2, `VehicleId`=234 WHERE `entry`=30228; +UPDATE `creature_template` SET `HoverHeight`=2 WHERE `entry`=25445; +UPDATE `creature_template` SET `HoverHeight`=2 WHERE `entry`=26761; +UPDATE `creature_template` SET `HoverHeight`=2 WHERE `entry`=26761; +UPDATE `creature_template` SET `HoverHeight`=2 WHERE `entry`=25721; +UPDATE `creature_template` SET `HoverHeight`=35 WHERE `entry`=27789; +UPDATE `creature_template` SET `HoverHeight`=3 WHERE `entry`=34567; +UPDATE `creature_template` SET `HoverHeight`=3 WHERE `entry`=26668; +UPDATE `creature_template` SET `HoverHeight`=3, `VehicleId`=390 WHERE `entry`=34120; +UPDATE `creature_template` SET `HoverHeight`=3, `VehicleId`=108 WHERE `entry`=24083; +UPDATE `creature_template` SET `HoverHeight`=3, `VehicleId`=270 WHERE `entry`=31137; +UPDATE `creature_template` SET `HoverHeight`=4 WHERE `entry`=24272; +UPDATE `creature_template` SET `HoverHeight`=4 WHERE `entry`=37098; +UPDATE `creature_template` SET `HoverHeight`=4 WHERE `entry`=28534; +UPDATE `creature_template` SET `HoverHeight`=4 WHERE `entry`=28511; +UPDATE `creature_template` SET `HoverHeight`=5.85 WHERE `entry`=26736; +UPDATE `creature_template` SET `HoverHeight`=5.85 WHERE `entry`=26736; +UPDATE `creature_template` SET `HoverHeight`=5.85 WHERE `entry`=32534; +UPDATE `creature_template` SET `HoverHeight`=5, `VehicleId`=348 WHERE `entry`=33214; +UPDATE `creature_template` SET `HoverHeight`=5 WHERE `entry`=27693; +UPDATE `creature_template` SET `HoverHeight`=5 WHERE `entry`=34203; +UPDATE `creature_template` SET `HoverHeight`=6.25 WHERE `entry`=40083; +UPDATE `creature_template` SET `HoverHeight`=6.25 WHERE `entry`=40100; +UPDATE `creature_template` SET `HoverHeight`=6 WHERE `entry`=34496; +UPDATE `creature_template` SET `HoverHeight`=6 WHERE `entry`=34496; +UPDATE `creature_template` SET `HoverHeight`=6 WHERE `entry`=34497; +UPDATE `creature_template` SET `HoverHeight`=7.5 WHERE `entry`=26933; +UPDATE `creature_template` SET `HoverHeight`=8.4, `VehicleId`=232 WHERE `entry`=30420; +UPDATE `creature_template` SET `HoverHeight`=8 WHERE `entry`=33186; +UPDATE `creature_template` SET `HoverHeight`=9 WHERE `entry`=26933; +UPDATE `creature_template` SET `HoverHeight`=9 WHERE `entry`=37528; +UPDATE `creature_template` SET `HoverHeight`=9 WHERE `entry`=37230; +UPDATE `creature_template` SET `HoverHeight`=9, `VehicleId`=375 WHERE `entry`=33687; +UPDATE `creature_template` SET `HoverHeight`=9, `VehicleId`=535 WHERE `entry`=36661; +UPDATE `creature_template` SET `InhabitType`=0x4, `HoverHeight`=10.8, `VehicleId`=232 WHERE `entry`=30393; +UPDATE `creature_template` SET `InhabitType`=0x4, `HoverHeight`=10 WHERE `entry`=27608; +UPDATE `creature_template` SET `InhabitType`=0x4, `HoverHeight`=10 WHERE `entry`=27608; +UPDATE `creature_template` SET `InhabitType`=0x4, `HoverHeight`=15 WHERE `entry`=32630; +UPDATE `creature_template` SET `InhabitType`=0x4, `HoverHeight`=1.6 WHERE `entry`=38391; +UPDATE `creature_template` SET `InhabitType`=0x4, `HoverHeight`=2.25, `VehicleId`=247 WHERE `entry`=30564; +UPDATE `creature_template` SET `InhabitType`=0x4, `HoverHeight`=2.25 WHERE `entry`=30272; +UPDATE `creature_template` SET `InhabitType`=0x4, `HoverHeight`=2 WHERE `entry`=25721; +UPDATE `creature_template` SET `InhabitType`=0x4, `HoverHeight`=2 WHERE `entry`=29570; +UPDATE `creature_template` SET `InhabitType`=0x4, `HoverHeight`=2 WHERE `entry`=26761; +UPDATE `creature_template` SET `InhabitType`=0x4, `HoverHeight`=3.12, `Scale`=2.08 WHERE `entry`=26607; +UPDATE `creature_template` SET `InhabitType`=0x4, `HoverHeight`=3 WHERE `entry`=26668; +UPDATE `creature_template` SET `InhabitType`=0x4, `HoverHeight`=3, `VehicleId`=108 WHERE `entry`=24083; +UPDATE `creature_template` SET `InhabitType`=0x4, `HoverHeight`=4 WHERE `entry`=37098; +UPDATE `creature_template` SET `InhabitType`=0x4, `HoverHeight`=4 WHERE `entry`=30945; +UPDATE `creature_template` SET `InhabitType`=0x4, `HoverHeight`=5.85 WHERE `entry`=26736; +UPDATE `creature_template` SET `InhabitType`=0x4, `HoverHeight`=5.85 WHERE `entry`=26736; +UPDATE `creature_template` SET `InhabitType`=0x4, `HoverHeight`=5, `VehicleId`=276 WHERE `entry`=31432; +UPDATE `creature_template` SET `InhabitType`=0x4, `HoverHeight`=6 WHERE `entry`=30501; +UPDATE `creature_template` SET `InhabitType`=0x4, `HoverHeight`=7.5 WHERE `entry`=26933; +UPDATE `creature_template` SET `InhabitType`=0x4, `HoverHeight`=8.4, `VehicleId`=232 WHERE `entry`=30420; +UPDATE `creature_template` SET `InhabitType`=0x4, `HoverHeight`=9 WHERE `entry`=26933; + diff --git a/sql/old/3.3.5a/2012_03_26_01_world_spell_script_names.sql b/sql/old/3.3.5a/2012_03_26_01_world_spell_script_names.sql new file mode 100644 index 00000000000..0a5c90f798f --- /dev/null +++ b/sql/old/3.3.5a/2012_03_26_01_world_spell_script_names.sql @@ -0,0 +1,4 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` IN (34477, 35079); +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(34477,'spell_hun_misdirection'), +(35079,'spell_hun_misdirection_proc'); diff --git a/sql/old/3.3.5a/2012_03_27_00_world_misc.sql b/sql/old/3.3.5a/2012_03_27_00_world_misc.sql new file mode 100644 index 00000000000..132c91b81d7 --- /dev/null +++ b/sql/old/3.3.5a/2012_03_27_00_world_misc.sql @@ -0,0 +1,49 @@ +ALTER TABLE `battleground_template` CHANGE `Weight` `Weight` tinyint(3) unsigned NOT NULL DEFAULT '1'; +ALTER TABLE `conditions` CHANGE `SourceId` `SourceId` int(11) NOT NULL DEFAULT '0'; +ALTER TABLE `creature` CHANGE `equipment_id` `equipment_id` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `creature_addon` CHANGE `path_id` `path_id` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `creature_ai_scripts` CHANGE `id` `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Identifier'; +ALTER TABLE `creature_ai_scripts` CHANGE `creature_id` `creature_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Creature Template Identifier'; +ALTER TABLE `creature_ai_scripts` CHANGE `event_type` `event_type` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT 'Event Type'; +ALTER TABLE `creature_ai_scripts` CHANGE `event_chance` `event_chance` int(10) unsigned NOT NULL DEFAULT '100'; +ALTER TABLE `creature_ai_scripts` CHANGE `event_flags` `event_flags` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `creature_ai_scripts` CHANGE `action1_type` `action1_type` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT 'Action Type'; +ALTER TABLE `creature_ai_scripts` CHANGE `action2_type` `action2_type` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT 'Action Type'; +ALTER TABLE `creature_ai_scripts` CHANGE `action3_type` `action3_type` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT 'Action Type'; +ALTER TABLE `creature_ai_summons` CHANGE `id` `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Location Identifier'; +ALTER TABLE `creature_ai_summons` CHANGE `spawntimesecs` `spawntimesecs` int(10) unsigned NOT NULL DEFAULT '120'; +ALTER TABLE `creature_classlevelstats` CHANGE `level` `level` tinyint(4) NOT NULL; +ALTER TABLE `creature_classlevelstats` CHANGE `class` `class` tinyint(4) NOT NULL; +ALTER TABLE `creature_classlevelstats` CHANGE `basehp0` `basehp0` smallint(6) NOT NULL; +ALTER TABLE `creature_classlevelstats` CHANGE `basehp1` `basehp1` smallint(6) NOT NULL; +ALTER TABLE `creature_classlevelstats` CHANGE `basehp2` `basehp2` smallint(6) NOT NULL; +ALTER TABLE `creature_classlevelstats` CHANGE `basemana` `basemana` smallint(6) NOT NULL; +ALTER TABLE `creature_classlevelstats` CHANGE `basearmor` `basearmor` smallint(6) NOT NULL; +ALTER TABLE `creature_formations` CHANGE `leaderGUID` `leaderGUID` int(10) unsigned NOT NULL; +ALTER TABLE `creature_formations` CHANGE `memberGUID` `memberGUID` int(10) unsigned NOT NULL; +ALTER TABLE `creature_formations` CHANGE `groupAI` `groupAI` int(10) unsigned NOT NULL; +ALTER TABLE `creature_loot_template` CHANGE `mincountOrRef` `mincountOrRef` mediumint(8) NOT NULL DEFAULT '1'; +ALTER TABLE `creature_onkill_reputation` CHANGE `RewOnKillRepValue1` `RewOnKillRepValue1` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `creature_template` CHANGE `KillCredit1` `KillCredit1` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `creature_template` CHANGE `KillCredit2` `KillCredit2` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `creature_template` CHANGE `exp` `exp` smallint(6) NOT NULL DEFAULT '0'; +ALTER TABLE `creature_template` CHANGE `resistance1` `resistance1` smallint(6) NOT NULL DEFAULT '0'; +ALTER TABLE `creature_template` CHANGE `resistance2` `resistance2` smallint(6) NOT NULL DEFAULT '0'; +ALTER TABLE `creature_template` CHANGE `resistance3` `resistance3` smallint(6) NOT NULL DEFAULT '0'; +ALTER TABLE `creature_template` CHANGE `resistance4` `resistance4` smallint(6) NOT NULL DEFAULT '0'; +ALTER TABLE `creature_template` CHANGE `resistance5` `resistance5` smallint(6) NOT NULL DEFAULT '0'; +ALTER TABLE `creature_template` CHANGE `resistance6` `resistance6` smallint(6) NOT NULL DEFAULT '0'; +ALTER TABLE `creature_template` CHANGE `questItem1` `questItem1` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `creature_template` CHANGE `questItem2` `questItem2` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `creature_template` CHANGE `questItem3` `questItem3` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `creature_template` CHANGE `questItem4` `questItem4` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `creature_template` CHANGE `questItem5` `questItem5` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `creature_template` CHANGE `questItem6` `questItem6` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `creature_template` CHANGE `WDBVerified` `WDBVerified` smallint(6) NULL DEFAULT '1'; +ALTER TABLE `creature_template_addon` CHANGE `path_id` `path_id` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `creature_transport` CHANGE `guid` `guid` int(11) NOT NULL AUTO_INCREMENT COMMENT 'GUID of NPC on transport - not the same as creature.guid'; +ALTER TABLE `creature_transport` CHANGE `transport_entry` `transport_entry` int(11) NOT NULL COMMENT 'Transport entry'; +ALTER TABLE `creature_transport` CHANGE `npc_entry` `npc_entry` int(11) NOT NULL COMMENT 'NPC entry'; +ALTER TABLE `creature_transport` CHANGE `emote` `emote` int(11) NOT NULL; +ALTER TABLE `db_script_string` CHANGE `entry` `entry` int(10) unsigned NOT NULL DEFAULT '0'; + \ No newline at end of file diff --git a/sql/old/3.3.5a/2012_03_27_01_world_misc.sql b/sql/old/3.3.5a/2012_03_27_01_world_misc.sql new file mode 100644 index 00000000000..38c11c8ae65 --- /dev/null +++ b/sql/old/3.3.5a/2012_03_27_01_world_misc.sql @@ -0,0 +1,15 @@ +ALTER TABLE `exploration_basexp` CHANGE `level` `level` tinyint(3) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `exploration_basexp` CHANGE `basexp` `basexp` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `fishing_loot_template` CHANGE `mincountOrRef` `mincountOrRef` mediumint(8) NOT NULL DEFAULT '1'; +ALTER TABLE `game_event_creature` CHANGE `eventEntry` `eventEntry` tinyint(4) NOT NULL COMMENT 'Entry of the game event. Put negative entry to remove during event.'; +ALTER TABLE `game_event_gameobject` CHANGE `eventEntry` `eventEntry` tinyint(4) NOT NULL COMMENT 'Entry of the game event. Put negative entry to remove during event.'; +ALTER TABLE `game_event_model_equip` CHANGE `eventEntry` `eventEntry` tinyint(4) NOT NULL COMMENT 'Entry of the game event.'; +ALTER TABLE `game_event_npc_vendor` CHANGE `eventEntry` `eventEntry` tinyint(4) NOT NULL COMMENT 'Entry of the game event.'; +ALTER TABLE `game_event_pool` CHANGE `eventEntry` `eventEntry` tinyint(4) NOT NULL COMMENT 'Entry of the game event. Put negative entry to remove during event.'; +ALTER TABLE `gameobject_loot_template` CHANGE `mincountOrRef` `mincountOrRef` mediumint(8) NOT NULL DEFAULT '1'; +ALTER TABLE `gameobject_template` CHANGE `WDBVerified` `WDBVerified` smallint(6) NULL DEFAULT '1'; +ALTER TABLE `gossip_menu` CHANGE `entry` `entry` smallint(5) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `gossip_menu_option` CHANGE `menu_id` `menu_id` smallint(5) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `gossip_menu_option` CHANGE `id` `id` smallint(5) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `gossip_menu_option` CHANGE `box_money` `box_money` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `gossip_menu_option` CHANGE `action_menu_id` `action_menu_id` int(10) unsigned NOT NULL DEFAULT '0'; diff --git a/sql/old/3.3.5a/2012_03_27_02_world_misc.sql b/sql/old/3.3.5a/2012_03_27_02_world_misc.sql new file mode 100644 index 00000000000..f83a98b8100 --- /dev/null +++ b/sql/old/3.3.5a/2012_03_27_02_world_misc.sql @@ -0,0 +1,78 @@ +ALTER TABLE `instance_template` CHANGE `allowMount` `allowMount` tinyint(3) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `ip2nation` CHANGE `ip` `ip` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `item_loot_template` CHANGE `mincountOrRef` `mincountOrRef` mediumint(8) NOT NULL DEFAULT '1'; +ALTER TABLE `item_set_names` CHANGE `WDBVerified` `WDBVerified` smallint(6) NOT NULL DEFAULT '1'; +ALTER TABLE `item_template` CHANGE `spellcharges_1` `spellcharges_1` smallint(6) NULL DEFAULT NULL; +ALTER TABLE `item_template` CHANGE `spellcharges_2` `spellcharges_2` smallint(6) NULL DEFAULT NULL; +ALTER TABLE `item_template` CHANGE `spellcharges_3` `spellcharges_3` smallint(6) NULL DEFAULT NULL; +ALTER TABLE `item_template` CHANGE `spellcharges_4` `spellcharges_4` smallint(6) NULL DEFAULT NULL; +ALTER TABLE `item_template` CHANGE `spellcharges_5` `spellcharges_5` smallint(6) NULL DEFAULT NULL; +ALTER TABLE `item_template` CHANGE `BagFamily` `BagFamily` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `item_template` CHANGE `TotemCategory` `TotemCategory` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `item_template` CHANGE `socketContent_1` `socketContent_1` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `item_template` CHANGE `socketContent_2` `socketContent_2` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `item_template` CHANGE `socketContent_3` `socketContent_3` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `item_template` CHANGE `socketBonus` `socketBonus` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `item_template` CHANGE `GemProperties` `GemProperties` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `item_template` CHANGE `WDBVerified` `WDBVerified` smallint(6) NULL DEFAULT '1'; +ALTER TABLE `item_template` CHANGE `ScalingStatValue` `ScalingStatValue` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `mail_loot_template` CHANGE `mincountOrRef` `mincountOrRef` mediumint(8) NOT NULL DEFAULT '1'; +ALTER TABLE `milling_loot_template` CHANGE `mincountOrRef` `mincountOrRef` mediumint(8) NOT NULL DEFAULT '1'; +ALTER TABLE `npc_spellclick_spells` CHANGE `user_type` `user_type` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'relation with summoner: 0-no 1-friendly 2-raid 3-party player can click'; +ALTER TABLE `outdoorpvp_template` CHANGE `TypeId` `TypeId` tinyint(3) unsigned NOT NULL; +ALTER TABLE `page_text` CHANGE `WDBVerified` `WDBVerified` smallint(6) NULL DEFAULT '1'; +ALTER TABLE `pet_name_generation` CHANGE `half` `half` tinyint(3) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `pickpocketing_loot_template` CHANGE `mincountOrRef` `mincountOrRef` mediumint(8) NOT NULL DEFAULT '1'; +ALTER TABLE `player_factionchange_achievement` CHANGE `alliance_id` `alliance_id` int(10) unsigned NOT NULL; -- also changed to unsigned +ALTER TABLE `player_factionchange_achievement` CHANGE `horde_id` `horde_id` int(10) unsigned NOT NULL; -- also changed to unsigned +ALTER TABLE `player_factionchange_items` CHANGE `race_A` `race_A` int(10) unsigned NOT NULL; -- also changed to unsigned +ALTER TABLE `player_factionchange_items` CHANGE `alliance_id` `alliance_id` int(10) unsigned NOT NULL; -- also changed to unsigned +ALTER TABLE `player_factionchange_items` CHANGE `race_H` `race_H` int(10) unsigned NOT NULL; -- also changed to unsigned +ALTER TABLE `player_factionchange_items` CHANGE `horde_id` `horde_id` int(10) unsigned NOT NULL; -- also changed to unsigned +ALTER TABLE `player_factionchange_reputations` CHANGE `alliance_id` `alliance_id` int(10) unsigned NOT NULL; -- also changed to unsigned +ALTER TABLE `player_factionchange_reputations` CHANGE `horde_id` `horde_id` int(10) unsigned NOT NULL; -- also changed to unsigned +ALTER TABLE `player_factionchange_spells` CHANGE `alliance_id` `alliance_id` int(10) unsigned NOT NULL; -- also changed to unsigned +ALTER TABLE `player_factionchange_spells` CHANGE `horde_id` `horde_id` int(10) unsigned NOT NULL; -- also changed to unsigned +ALTER TABLE `player_xp_for_level` CHANGE `lvl` `lvl` tinyint(3) unsigned NOT NULL; -- also changed from int to tinyint +ALTER TABLE `playercreateinfo_action` CHANGE `action` `action` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `playercreateinfo_item` CHANGE `amount` `amount` tinyint(4) NOT NULL DEFAULT '1'; +ALTER TABLE `playercreateinfo_spell_custom` DROP `Active`; -- delete field, it's not used anywhere +ALTER TABLE `prospecting_loot_template` CHANGE `mincountOrRef` `mincountOrRef` mediumint(8) NOT NULL DEFAULT '1'; +ALTER TABLE `quest_poi` CHANGE `objIndex` `objIndex` int(11) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_poi_points` CHANGE `x` `x` int(11) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_poi_points` CHANGE `y` `y` int(11) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `RequiredFactionValue1` `RequiredFactionValue1` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `RequiredFactionValue2` `RequiredFactionValue2` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `RequiredMinRepValue` `RequiredMinRepValue` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `RequiredMinRepValue` `RequiredMinRepValue` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `RequiredMaxRepValue` `RequiredMaxRepValue` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `PrevQuestId` `PrevQuestId` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `NextQuestId` `NextQuestId` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `ExclusiveGroup` `ExclusiveGroup` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `RewardSpellCast` `RewardSpellCast` int(11) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `RewardHonor` `RewardHonor` int(11) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `RewardXPId` `RewardXPId` tinyint(3) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `RewardFactionValueId1` `RewardFactionValueId1` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `RewardFactionValueId2` `RewardFactionValueId2` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `RewardFactionValueId3` `RewardFactionValueId3` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `RewardFactionValueId4` `RewardFactionValueId4` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `RewardFactionValueId5` `RewardFactionValueId5` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `RewardFactionValueIdOverride1` `RewardFactionValueIdOverride1` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `RewardFactionValueIdOverride2` `RewardFactionValueIdOverride2` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `RewardFactionValueIdOverride3` `RewardFactionValueIdOverride3` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `RewardFactionValueIdOverride4` `RewardFactionValueIdOverride4` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `RewardFactionValueIdOverride5` `RewardFactionValueIdOverride5` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `RequiredNpcOrGo1` `RequiredNpcOrGo1` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `RequiredNpcOrGo2` `RequiredNpcOrGo2` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `RequiredNpcOrGo3` `RequiredNpcOrGo3` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `RequiredNpcOrGo4` `RequiredNpcOrGo4` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `Unknown0` `Unknown0` tinyint(3) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `DetailsEmoteDelay1` `DetailsEmoteDelay1` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `DetailsEmoteDelay2` `DetailsEmoteDelay2` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `DetailsEmoteDelay3` `DetailsEmoteDelay3` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `DetailsEmoteDelay4` `DetailsEmoteDelay4` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `OfferRewardEmoteDelay1` `OfferRewardEmoteDelay1` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `OfferRewardEmoteDelay2` `OfferRewardEmoteDelay2` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `OfferRewardEmoteDelay3` `OfferRewardEmoteDelay3` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `OfferRewardEmoteDelay4` `OfferRewardEmoteDelay4` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `WDBVerified` `WDBVerified` smallint(6) NOT NULL DEFAULT '1'; diff --git a/sql/old/3.3.5a/2012_03_27_03_world_misc.sql b/sql/old/3.3.5a/2012_03_27_03_world_misc.sql new file mode 100644 index 00000000000..aba847dbc3f --- /dev/null +++ b/sql/old/3.3.5a/2012_03_27_03_world_misc.sql @@ -0,0 +1,59 @@ +ALTER TABLE `reference_loot_template` CHANGE `mincountOrRef` `mincountOrRef` mediumint(8) NOT NULL DEFAULT '1'; +ALTER TABLE `reputation_spillover_template` CHANGE `faction` `faction` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'faction entry'; +ALTER TABLE `reputation_spillover_template` CHANGE `faction1` `faction1` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'faction to give spillover for'; +ALTER TABLE `reputation_spillover_template` CHANGE `faction2` `faction2` smallint(5) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `reputation_spillover_template` CHANGE `faction3` `faction3` smallint(5) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `reputation_spillover_template` CHANGE `faction4` `faction4` smallint(5) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `skinning_loot_template` CHANGE `mincountOrRef` `mincountOrRef` mediumint(8) NOT NULL DEFAULT '1'; +ALTER TABLE `spell_area` CHANGE `quest_start_active` `quest_start_active` tinyint(3) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_area` CHANGE `gender` `gender` tinyint(3) unsigned NOT NULL DEFAULT '2'; +ALTER TABLE `spell_area` CHANGE `autocast` `autocast` tinyint(3) unsigned NOT NULL DEFAULT '0'; +-- All the fields in spell_dbc where changed to full int32 since the DBC structure is used +ALTER TABLE `spell_dbc` CHANGE `Dispel` `Dispel` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `Mechanic` `Mechanic` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `CastingTimeIndex` `CastingTimeIndex` int(10) unsigned NOT NULL DEFAULT '1'; +ALTER TABLE `spell_dbc` CHANGE `DurationIndex` `DurationIndex` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `ProcChance` `ProcChance` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `ProcCharges` `ProcCharges` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `BaseLevel` `BaseLevel` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `MaxLevel` `MaxLevel` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `SpellLevel` `SpellLevel` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `RangeIndex` `RangeIndex` int(10) unsigned NOT NULL DEFAULT '1'; +ALTER TABLE `spell_dbc` CHANGE `Effect1` `Effect1` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `Effect2` `Effect2` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `Effect3` `Effect3` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `EffectMechanic1` `EffectMechanic1` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `EffectMechanic2` `EffectMechanic2` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `EffectMechanic3` `EffectMechanic3` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `EffectImplicitTargetA1` `EffectImplicitTargetA1` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `EffectImplicitTargetA2` `EffectImplicitTargetA2` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `EffectImplicitTargetA3` `EffectImplicitTargetA3` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `EffectImplicitTargetB1` `EffectImplicitTargetB1` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `EffectImplicitTargetB2` `EffectImplicitTargetB2` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `EffectImplicitTargetB3` `EffectImplicitTargetB3` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `EffectRadiusIndex1` `EffectRadiusIndex1` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `EffectRadiusIndex2` `EffectRadiusIndex2` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `EffectRadiusIndex3` `EffectRadiusIndex3` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `EffectApplyAuraName1` `EffectApplyAuraName1` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `EffectApplyAuraName2` `EffectApplyAuraName2` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `EffectApplyAuraName3` `EffectApplyAuraName3` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `MaxTargetLevel` `MaxTargetLevel` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `SpellFamilyName` `SpellFamilyName` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `MaxAffectedTargets` `MaxAffectedTargets` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `DmgClass` `DmgClass` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_dbc` CHANGE `PreventionType` `PreventionType` int(10) unsigned NOT NULL DEFAULT '0'; +-- +ALTER TABLE `spell_group` CHANGE `id` `id` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `spell_loot_template` CHANGE `mincountOrRef` `mincountOrRef` mediumint(8) NOT NULL DEFAULT '1'; +ALTER TABLE `spell_proc` CHANGE `spellPhaseMask` `spellPhaseMask` int(11) NOT NULL DEFAULT '0'; +ALTER TABLE `spell_proc` CHANGE `hitMask` `hitMask` int(11) NOT NULL DEFAULT '0'; +ALTER TABLE `spell_enchant_proc_data` CHANGE `procEx` `procEx` int(10) unsigned NOT NULL DEFAULT '0'; -- changed from float to int +ALTER TABLE `spell_required` CHANGE `spell_id` `spell_id` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `spell_required` CHANGE `req_spell` `req_spell` mediumint(8) NOT NULL DEFAULT '0'; +ALTER TABLE `spell_threat` CHANGE `flatMod` `flatMod` int(11) NULL DEFAULT NULL; +ALTER TABLE `vehicle_accessory` CHANGE `seat_id` `seat_id` tinyint(4) NOT NULL DEFAULT '0'; +ALTER TABLE `vehicle_accessory` CHANGE `minion` `minion` tinyint(3) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `vehicle_template_accessory` CHANGE `seat_id` `seat_id` tinyint(4) NOT NULL DEFAULT '0'; +ALTER TABLE `vehicle_template_accessory` CHANGE `minion` `minion` tinyint(3) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `version` CHANGE `cache_id` `cache_id` int(11) NULL DEFAULT '0'; +ALTER TABLE `waypoint_data` CHANGE `move_flag` `move_flag` tinyint(4) NOT NULL DEFAULT '0'; diff --git a/sql/old/3.3.5a/2012_03_27_04_world_misc.sql b/sql/old/3.3.5a/2012_03_27_04_world_misc.sql new file mode 100644 index 00000000000..e85350476c9 --- /dev/null +++ b/sql/old/3.3.5a/2012_03_27_04_world_misc.sql @@ -0,0 +1,3 @@ +ALTER TABLE `spell_dbc` CHANGE `StackAmount` `StackAmount` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `waypoint_data` CHANGE `action_chance` `action_chance` smallint(6) NOT NULL DEFAULT '100'; +ALTER TABLE `item_loot_template` CHANGE `maxcount` `maxcount` tinyint(3) unsigned NOT NULL DEFAULT '1'; diff --git a/sql/old/3.3.5a/2012_03_28_00_auth_account.sql b/sql/old/3.3.5a/2012_03_28_00_auth_account.sql new file mode 100644 index 00000000000..199baac5178 --- /dev/null +++ b/sql/old/3.3.5a/2012_03_28_00_auth_account.sql @@ -0,0 +1,13 @@ +ALTER TABLE `account` + CHANGE `id` `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Identifier', + CHANGE `sessionkey` `sessionkey` VARCHAR(80) NOT NULL DEFAULT '', + CHANGE `v` `v` VARCHAR(64) NOT NULL DEFAULT '', + CHANGE `s` `s` VARCHAR(64) NOT NULL DEFAULT '', + CHANGE `email` `email` VARCHAR(254) NOT NULL DEFAULT '', + CHANGE `last_ip` `last_ip` VARCHAR(15) NOT NULL DEFAULT '127.0.0.1', + CHANGE `failed_logins` `failed_logins` INT(10) UNSIGNED NOT NULL DEFAULT '0', + CHANGE `online` `online` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0', + CHANGE `mutetime` `mutetime` BIGINT(20) NOT NULL DEFAULT '0', + CHANGE `os` `os` VARCHAR(3) NOT NULL DEFAULT '', + CHANGE `recruiter` `recruiter` INT(10) UNSIGNED NOT NULL DEFAULT '0', + ROW_FORMAT=DEFAULT ENGINE=INNODB; diff --git a/sql/old/3.3.5a/2012_03_28_01_auth_account_access.sql b/sql/old/3.3.5a/2012_03_28_01_auth_account_access.sql new file mode 100644 index 00000000000..456dbf6c104 --- /dev/null +++ b/sql/old/3.3.5a/2012_03_28_01_auth_account_access.sql @@ -0,0 +1,3 @@ +ALTER TABLE `account_access` + CHANGE `id` `id` INT(10) UNSIGNED NOT NULL, + ROW_FORMAT=DEFAULT ENGINE=INNODB; diff --git a/sql/old/3.3.5a/2012_03_28_01_world_spell_bonus_data.sql b/sql/old/3.3.5a/2012_03_28_01_world_spell_bonus_data.sql new file mode 100644 index 00000000000..e150cad1c2e --- /dev/null +++ b/sql/old/3.3.5a/2012_03_28_01_world_spell_bonus_data.sql @@ -0,0 +1,2 @@ +-- Hunter Volley +UPDATE `spell_bonus_data` SET `ap_bonus`=0.0837 WHERE `entry`=42243; diff --git a/sql/old/3.3.5a/2012_03_28_02_auth_account_banned.sql b/sql/old/3.3.5a/2012_03_28_02_auth_account_banned.sql new file mode 100644 index 00000000000..917cea1a684 --- /dev/null +++ b/sql/old/3.3.5a/2012_03_28_02_auth_account_banned.sql @@ -0,0 +1,4 @@ +ALTER TABLE `account_banned` + CHANGE `id` `id` INT(10) UNSIGNED DEFAULT '0' NOT NULL COMMENT 'Account id', + CHANGE `active` `active` TINYINT(3) UNSIGNED DEFAULT '1' NOT NULL, + ROW_FORMAT=DEFAULT ENGINE=INNODB; diff --git a/sql/old/3.3.5a/2012_03_28_03_auth_ip_banned.sql b/sql/old/3.3.5a/2012_03_28_03_auth_ip_banned.sql new file mode 100644 index 00000000000..2e754effc60 --- /dev/null +++ b/sql/old/3.3.5a/2012_03_28_03_auth_ip_banned.sql @@ -0,0 +1,2 @@ +ALTER TABLE `ip_banned` + ROW_FORMAT=DEFAULT ENGINE=INNODB; diff --git a/sql/old/3.3.5a/2012_03_28_04_auth_logs.sql b/sql/old/3.3.5a/2012_03_28_04_auth_logs.sql new file mode 100644 index 00000000000..4c837a47ed1 --- /dev/null +++ b/sql/old/3.3.5a/2012_03_28_04_auth_logs.sql @@ -0,0 +1,5 @@ +ALTER TABLE `logs` + CHANGE `time` `time` INT(10) UNSIGNED NOT NULL, + CHANGE `realm` `realm` INT(10) UNSIGNED NOT NULL, + CHANGE `type` `type` TINYINT(3) UNSIGNED NOT NULL, + ROW_FORMAT=DEFAULT ENGINE=INNODB; diff --git a/sql/old/3.3.5a/2012_03_28_05_auth_realmcharacters.sql b/sql/old/3.3.5a/2012_03_28_05_auth_realmcharacters.sql new file mode 100644 index 00000000000..e50b3c3f331 --- /dev/null +++ b/sql/old/3.3.5a/2012_03_28_05_auth_realmcharacters.sql @@ -0,0 +1,4 @@ +ALTER TABLE `realmcharacters` + CHANGE `realmid` `realmid` INT(10) UNSIGNED DEFAULT 0 NOT NULL, + CHANGE `acctid` `acctid` INT(10) UNSIGNED NOT NULL, + ROW_FORMAT=DEFAULT ENGINE=INNODB; diff --git a/sql/old/3.3.5a/2012_03_28_06_auth_realmlist.sql b/sql/old/3.3.5a/2012_03_28_06_auth_realmlist.sql new file mode 100644 index 00000000000..725702a9803 --- /dev/null +++ b/sql/old/3.3.5a/2012_03_28_06_auth_realmlist.sql @@ -0,0 +1,6 @@ +ALTER TABLE `realmlist` + CHANGE `id` `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + CHANGE `address` `address` VARCHAR(15) DEFAULT '127.0.0.1' NOT NULL, + CHANGE `port` `port` SMALLINT(5) UNSIGNED DEFAULT '8085' NOT NULL, + CHANGE `gamebuild` `gamebuild` INT(10) UNSIGNED DEFAULT '12340' NOT NULL, + ROW_FORMAT=DEFAULT ENGINE=INNODB; diff --git a/sql/old/3.3.5a/2012_03_28_07_auth_uptime.sql b/sql/old/3.3.5a/2012_03_28_07_auth_uptime.sql new file mode 100644 index 00000000000..0ea4e3321df --- /dev/null +++ b/sql/old/3.3.5a/2012_03_28_07_auth_uptime.sql @@ -0,0 +1,6 @@ +ALTER TABLE `uptime` + DROP COLUMN `startstring`, + CHANGE `realmid` `realmid` INT(10) UNSIGNED NOT NULL, + CHANGE `starttime` `starttime` INT(10) UNSIGNED DEFAULT 0 NOT NULL, + CHANGE `uptime` `uptime` INT(10) UNSIGNED DEFAULT 0 NOT NULL, + ROW_FORMAT=DEFAULT ENGINE=INNODB; diff --git a/sql/old/3.3.5a/2012_03_30_00_world_smart_scripts.sql b/sql/old/3.3.5a/2012_03_30_00_world_smart_scripts.sql new file mode 100644 index 00000000000..3ec709d76c1 --- /dev/null +++ b/sql/old/3.3.5a/2012_03_30_00_world_smart_scripts.sql @@ -0,0 +1,94 @@ +-- revised from Unholys original works +-- quest 12702 chicken party! +-- quest 12532 flown the coop! +-- +SET @ENTRY := 28161; -- the chicken +SET @PARTY := 12702; -- chicken party quest +SET @COOP := 12532; -- flown the coop quest +SET @LIFE := 900000; -- minutes + +-- set up required spells for the spells to work as they should +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry`=@ENTRY; +INSERT INTO `npc_spellclick_spells` (`npc_entry`,`spell_id`,`cast_flags`,`user_type`) VALUES +(@ENTRY,39996,1,0), -- cover spell (dummy) +(@ENTRY,51037,2,0); -- creates item in players back pack + +-- set npc up to use event script +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; + +-- convert over to smart script +DELETE FROM `creature_ai_scripts` WHERE `id`=@ENTRY; -- delete old eai scripts +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,1,0,100,0,1000,1000,2000,3000,89,35,0,0,0,0,0,1,0,0,0,0,0,0,0, 'create random movement every 2-3 secs'), +(@ENTRY,0,1,0,8,0,100,0,51951,0,0,0,11,50839,0,0,0,0,0,1,0,0,0,0,0,0,0, 'when hit with net cast self stun'), +(@ENTRY,0,2,0,8,0,100,0,39996,0,0,0,41,1000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'force despawn @1 sec when hit with dummy spell'); + +-- Remove previous scripts that may interfere with this work +DELETE FROM `quest_start_scripts` WHERE `id` IN (@PARTY,@COOP); + +-- start script for quest chicken party (they do not all spawn at same time) +UPDATE `quest_template` SET `StartScript`=@PARTY WHERE `id`=@PARTY; -- 12072 +INSERT INTO `quest_start_scripts` (`id`,`delay`,`command`,`datalong`,`datalong2`,`dataint`,`x`,`y`,`z`,`o`) VALUES +(@PARTY,1,10,@ENTRY,@LIFE, 0,5251.09,4413.76,-96.086,4.8714), +(@PARTY,2,10,@ENTRY,@LIFE, 0,5251.22,4419.74,-95.8995,3.58335), +(@PARTY,23,10,@ENTRY,@LIFE, 0,5257.58,4421.77,-95.9072,2.62124), +(@PARTY,4,10,@ENTRY,@LIFE,0, 5255.97,4420.37,-95.9999,0.0451326), +(@PARTY,5,10,@ENTRY,@LIFE,0, 5256.78,4420.63,-95.9957,0.320021), +(@PARTY,6,10,@ENTRY,@LIFE,0, 5257.58,4421.77,-95.9072,0.956194), +(@PARTY,27,10,@ENTRY,@LIFE,0, 5258.54,4420.49,-96.0195,0.551714), +(@PARTY,8,10,@ENTRY,@LIFE,0, 5250.67,4417.98,-95.9787,4.39231), +(@PARTY,9,10,@ENTRY,@LIFE,0, 5273.53,4430.32,-96.0241,1.0897), +(@PARTY,40,10,@ENTRY,@LIFE,0, 5158.3,4605.25,-130.988,3.7522), +(@PARTY,21,10,@ENTRY,@LIFE,0, 5164.6,4609.43,-130.427,3.70115), +(@PARTY,22,10,@ENTRY,@LIFE,0, 5169.53,4612.44,-130.817,4.05065), +(@PARTY,23,10,@ENTRY,@LIFE,0, 5188.49,4627.85,-132.485,3.60691), +(@PARTY,44,10,@ENTRY,@LIFE,0, 5203.19,4631.63,-132.611,2.849), +(@PARTY,25,10,@ENTRY,@LIFE,0, 5219.62,4632.46,-134.232,0.378917), +(@PARTY,26,10,@ENTRY,@LIFE,0, 5219.62,4632.46,-134.232,0.66166), +(@PARTY,27,10,@ENTRY,@LIFE,0, 5203.5,4595.02,-111.327,5.51542), +(@PARTY,48,10,@ENTRY,@LIFE,0, 5179.35,4558,-100.344,0.579192), +(@PARTY,29,10,@ENTRY,@LIFE,0, 5179.35,4558,-100.344,1.09756), +(@PARTY,30,10,@ENTRY,@LIFE,0, 5172.43,4533.25,-97.3836,1.15253), +(@PARTY,41,10,@ENTRY,@LIFE,0, 5186.29,4522.69,-91.0957,3.02571), +(@PARTY,32,10,@ENTRY,@LIFE,0, 5214.67,4485.22,-91.3113,2.40524), +(@PARTY,33,10,@ENTRY,@LIFE,0, 5221.85,4475.99,-96.8801,4.89495), +(@PARTY,34,10,@ENTRY,@LIFE,0, 5222.95,4438.1,-96.8062,1.6277), +(@PARTY,35,10,@ENTRY,@LIFE,0, 5224.36,4427.83,-96.9221,2.63301), +(@PARTY,36,10,@ENTRY,@LIFE,0, 5234.72,4406.44,-95.2917,0.0647549), +(@PARTY,47,10,@ENTRY,@LIFE,0, 5227.28,4407.01,-95.3888,3.79933), +(@PARTY,38,10,@ENTRY,@LIFE,0, 5227.28,4407.01,-95.3888,4.29414), +(@PARTY,39,10,@ENTRY,@LIFE,0, 5251.09,4413.76,-96.086,3.90536), +(@PARTY,40,10,@ENTRY,@LIFE,0, 5251.09,4413.76,-96.086,4.36089); + +-- start script for quest flown the coop (they do not all spawn at same time) +UPDATE `quest_template` SET `StartScript`=@COOP WHERE `id`=@COOP; -- 12532 +INSERT INTO `quest_start_scripts` (`id`,`delay`,`command`,`datalong`,`datalong2`,`dataint`,`x`,`y`,`z`,`o`) VALUES +(@COOP,23,10,@ENTRY,@LIFE,0, 5257.58,4421.77,-95.9072,2.62124), +(@COOP,4,10,@ENTRY,@LIFE,0, 5255.97,4420.37,-95.9999,0.0451326), +(@COOP,5,10,@ENTRY,@LIFE,0, 5256.78,4420.63,-95.9957,0.320021), +(@COOP,6,10,@ENTRY,@LIFE,0, 5257.58,4421.77,-95.9072,0.956194), +(@COOP,27,10,@ENTRY,@LIFE,0, 5258.54,4420.49,-96.0195,0.551714), +(@COOP,8,10,@ENTRY,@LIFE,0, 5250.67,4417.98,-95.9787,4.39231), +(@COOP,9,10,@ENTRY,@LIFE,0, 5273.53,4430.32,-96.0241,1.0897), +(@COOP,40,10,@ENTRY,@LIFE,0, 5158.3,4605.25,-130.988,3.7522), +(@COOP,21,10,@ENTRY,@LIFE,0, 5164.6,4609.43,-130.427,3.70115), +(@COOP,22,10,@ENTRY,@LIFE,0, 5169.53,4612.44,-130.817,4.05065), +(@COOP,23,10,@ENTRY,@LIFE,0, 5188.49,4627.85,-132.485,3.60691), +(@COOP,44,10,@ENTRY,@LIFE,0, 5203.19,4631.63,-132.611,2.849), +(@COOP,25,10,@ENTRY,@LIFE,0, 5219.62,4632.46,-134.232,0.378917), +(@COOP,26,10,@ENTRY,@LIFE,0, 5219.62,4632.46,-134.232,0.66166), +(@COOP,27,10,@ENTRY,@LIFE,0, 5203.5,4595.02,-111.327,5.51542), +(@COOP,48,10,@ENTRY,@LIFE,0, 5179.35,4558,-100.344,0.579192), +(@COOP,29,10,@ENTRY,@LIFE,0, 5179.35,4558,-100.344,1.09756), +(@COOP,30,10,@ENTRY,@LIFE,0, 5172.43,4533.25,-97.3836,1.15253), +(@COOP,41,10,@ENTRY,@LIFE,0, 5186.29,4522.69,-91.0957,3.02571), +(@COOP,32,10,@ENTRY,@LIFE,0, 5214.67,4485.22,-91.3113,2.40524), +(@COOP,33,10,@ENTRY,@LIFE,0, 5221.85,4475.99,-96.8801,4.89495), +(@COOP,34,10,@ENTRY,@LIFE,0, 5222.95,4438.1,-96.8062,1.6277), +(@COOP,35,10,@ENTRY,@LIFE,0, 5224.36,4427.83,-96.9221,2.63301), +(@COOP,36,10,@ENTRY,@LIFE,0, 5234.72,4406.44,-95.2917,0.0647549), +(@COOP,47,10,@ENTRY,@LIFE,0, 5227.28,4407.01,-95.3888,3.79933), +(@COOP,38,10,@ENTRY,@LIFE,0, 5227.28,4407.01,-95.3888,4.29414), +(@COOP,39,10,@ENTRY,@LIFE,0, 5251.09,4413.76,-96.086,3.90536), +(@COOP,40,10,@ENTRY,@LIFE,0, 5251.09,4413.76,-96.086,4.36089); diff --git a/sql/old/3.3.5a/2012_03_31_00_world_creature_loot_template.sql b/sql/old/3.3.5a/2012_03_31_00_world_creature_loot_template.sql new file mode 100644 index 00000000000..a817cdccf50 --- /dev/null +++ b/sql/old/3.3.5a/2012_03_31_00_world_creature_loot_template.sql @@ -0,0 +1,191 @@ +-- ------------------------------- +-- -- The Antechamber of Ulduar -- +-- ------------------------------- +-- Creatures +SET @Brundir10 :=32857; +call `sp_get_npc_diffentry`(@Brundir10,1,@Brundir25); -- Get 25man id using procedure +SET @Molgeim10 :=32927; +call `sp_get_npc_diffentry`(@Molgeim10,1,@Molgeim25); -- Get 25man id using procedure +SET @Steelbreaker10 :=32867; +call `sp_get_npc_diffentry`(@Steelbreaker10,1,@Steelbreaker25); -- Get 25man id using procedure +SET @Auriaya10 :=33515; +call `sp_get_npc_diffentry`(@Auriaya10,1,@Auriaya25); -- Get 25man id using procedure +-- Gameobjects +SET @Kologarn10 := 195046; -- Cache of the Living Stone 10man +CALL `sp_get_go_lootid`(@Kologarn10,@CacheLivingStone10); -- Get Lootid from data1 field using procedure +SET @Kologarn25 := 195047; -- Cache of the Living Stone 25man +CALL `sp_get_go_lootid`(@Kologarn25,@CacheLivingStone25); -- Get Lootid from data1 field using procedure +-- bosses +SET @Assembly10Ref := 34359; +SET @Assembly25Ref := @Assembly10Ref+1; +SET @Kologarn10Ref := @Assembly10Ref+2; +SET @Kologarn25Ref := @Assembly10Ref+3; +SET @Auriaya10Ref := @Assembly10Ref+4; +SET @Auriaya25Ref := @Assembly10Ref+5; + +-- ------------------------------ +-- -- Reference Loot Templates -- +-- ------------------------------ +-- Delete previous templates if existing +DELETE FROM `reference_loot_template` WHERE `entry` IN (12019,34122,34123,34124,34163,34216); +-- Delete the current if existing & add +DELETE FROM `reference_loot_template` WHERE `entry` BETWEEN @Assembly10Ref AND @Assembly10Ref+5; +INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- Assembly Of Iron 10man +(@Assembly10Ref,45322,0,1,1,1,1), -- Cloak of the Iron Council +(@Assembly10Ref,45324,0,1,1,1,1), -- Leggings of Swift Reflexes +(@Assembly10Ref,45329,0,1,1,1,1), -- Circlet of True Sight +(@Assembly10Ref,45330,0,1,1,1,1), -- Greaves of Iron Intensity +(@Assembly10Ref,45331,0,1,1,1,1), -- Rune-Etched Nightblade +(@Assembly10Ref,45332,0,1,1,1,1), -- Stormtip +(@Assembly10Ref,45333,0,1,1,1,1), -- Belt of the Iron Servant +(@Assembly10Ref,45378,0,1,1,1,1), -- Boots of the Petrified Forest +(@Assembly10Ref,45418,0,1,1,1,1), -- Lady Maye's Sapphire Ring +(@Assembly10Ref,45423,0,1,1,1,1), -- Runetouch Wristwraps +-- Assembly Of Iron 25man +(@Assembly25Ref,45233,0,1,1,1,1), -- Stormrune Edge +(@Assembly25Ref,45234,0,1,1,1,1), -- Rapture +(@Assembly25Ref,45237,0,1,1,1,1), -- Phaelia's Vestments of the Sprouting Seed +(@Assembly25Ref,45193,0,1,1,1,1), -- Insurmountable Fervor +(@Assembly25Ref,45236,0,1,1,1,1), -- Unblinking Eye +(@Assembly25Ref,45225,0,1,1,1,1), -- Steelbreaker's Embrace +(@Assembly25Ref,45240,0,1,1,1,1), -- Raiments of the Iron Council +(@Assembly25Ref,45226,0,1,1,1,1), -- Ancient Iron Heaume +(@Assembly25Ref,45235,0,1,1,1,1), -- Radiant Seal +(@Assembly25Ref,45227,0,1,1,1,1), -- Iron-studded Mantle +(@Assembly25Ref,45239,0,1,1,1,1), -- Runeshaper's Gloves +(@Assembly25Ref,45224,0,1,1,1,1), -- Drape of the Lithe +(@Assembly25Ref,45232,0,1,1,1,1), -- Runed Ironhide Boots +(@Assembly25Ref,45228,0,1,1,1,1), -- Handguards of the Enclave +(@Assembly25Ref,45238,0,1,1,1,1), -- Overload Legwraps +-- Cache of Living Stone 10man +(@Kologarn10Ref,45701,0,1,1,1,1), -- Greaves of the Earthbinder +(@Kologarn10Ref,45965,0,1,1,1,1), -- Spire of Withering Dreams +(@Kologarn10Ref,45702,0,1,1,1,1), -- Emerald Signet Ring +(@Kologarn10Ref,45696,0,1,1,1,1), -- Mark of the Unyielding +(@Kologarn10Ref,45698,0,1,1,1,1), -- Sabatons of the Iron Watcher +(@Kologarn10Ref,45697,0,1,1,1,1), -- Shoulderguards of the Solemn Watch +(@Kologarn10Ref,45703,0,2,2,1,1), -- Spark of Hope +(@Kologarn10Ref,45700,0,2,2,1,1), -- Stoneguard +(@Kologarn10Ref,45699,0,2,2,1,1), -- Pendant of the Piercing Glare +(@Kologarn10Ref,45704,0,2,2,1,1), -- Shawl of the Shattered Giant +-- Cache of Living Stone 25man +(@Kologarn25Ref,45261,0,1,1,1,1), -- Giant's Bane +(@Kologarn25Ref,45266,0,1,1,1,1), -- Malice +(@Kologarn25Ref,45274,0,1,1,1,1), -- Leggings of the Stoneweaver +(@Kologarn25Ref,45269,0,1,1,1,1), -- Unfaltering Armguards +(@Kologarn25Ref,45268,0,1,1,1,1), -- Gloves of the Pythonic Guardian +(@Kologarn25Ref,45262,0,1,1,1,1), -- Necklace of Unerring Mettle +(@Kologarn25Ref,45275,0,1,1,1,1), -- Bracers of Unleashed Magic +(@Kologarn25Ref,45272,0,1,1,1,1), -- Robes of the Umbral Brute +(@Kologarn25Ref,45267,0,1,1,1,1), -- Saronite Plated Legguards +(@Kologarn25Ref,45263,0,1,1,1,1), -- Wrathstone +(@Kologarn25Ref,45271,0,1,1,1,1), -- Ironmender +(@Kologarn25Ref,45264,0,1,1,1,1), -- Decimator's Armguards +(@Kologarn25Ref,45265,0,1,1,1,1), -- Shoulderpads of the Monolith +(@Kologarn25Ref,45273,0,1,1,1,1), -- Handwraps of Plentiful Recovery +(@Kologarn25Ref,45270,0,1,1,1,1), -- Idol of the Crying Wind +-- Auriaya 10man +(@Auriaya10Ref,45707,0,1,1,1,1), -- Shieldwall of the Breaker +(@Auriaya10Ref,45708,0,1,1,1,1), -- Archaedas' Lost Legplates +(@Auriaya10Ref,45709,0,1,1,1,1), -- Nimble Climber's Belt +(@Auriaya10Ref,45711,0,1,1,1,1), -- Ironaya's Discarded Mantle +(@Auriaya10Ref,45712,0,1,1,1,1), -- Chestplate of Titanic Fury +(@Auriaya10Ref,45713,0,1,1,1,1), -- Nurturing Touch +(@Auriaya10Ref,45832,0,1,1,1,1), -- Mantle of the Preserver +(@Auriaya10Ref,45864,0,1,1,1,1), -- Cover of the Keepers +(@Auriaya10Ref,45865,0,1,1,1,1), -- Raiments of the Corrupted +(@Auriaya10Ref,45866,0,1,1,1,1), -- Elemental Focus Stone +-- Auriaya 25man +(@Auriaya25Ref,45327,0,1,1,1,1), -- Siren's Cry +(@Auriaya25Ref,45437,0,1,1,1,1), -- Runescribed Blade +(@Auriaya25Ref,45315,0,1,1,1,1), -- Stonerender +(@Auriaya25Ref,45439,0,1,1,1,1), -- Unwavering Stare +(@Auriaya25Ref,45326,0,1,1,1,1), -- Platinum Band of the Aesir +(@Auriaya25Ref,45441,0,1,1,1,1), -- Sandals of the Ancient Keeper +(@Auriaya25Ref,45435,0,1,1,1,1), -- Cowl of the Absolute +(@Auriaya25Ref,45438,0,1,1,1,1), -- Ring of the Faithful Servant +(@Auriaya25Ref,45434,0,1,1,1,1), -- Greaves of the Rockmender +(@Auriaya25Ref,45320,0,1,1,1,1), -- Shoulderplates of the Eternal +(@Auriaya25Ref,45325,0,1,1,1,1), -- Gloves of the Stonereaper +(@Auriaya25Ref,45440,0,1,1,1,1), -- Amice of the Stoic Watch +(@Auriaya25Ref,45334,0,1,1,1,1), -- Unbreakable Chestguard +(@Auriaya25Ref,45319,0,1,1,1,1), -- Cloak of the Makers +(@Auriaya25Ref,45436,0,1,1,1,1); -- Libram of the Resolute + +-- --------------------------- +-- -- ASSIGN CREATURE LOOTS -- +-- --------------------------- +UPDATE `creature_template` SET `lootid`=`entry` WHERE `entry` IN (@Brundir10,@Molgeim10,@Steelbreaker10,@Brundir25,@Molgeim25,@Steelbreaker25,@Auriaya10,@Auriaya25); +DELETE FROM `creature_loot_template` WHERE `entry` IN (@Brundir10,@Molgeim10,@Steelbreaker10,@Brundir25,@Molgeim25,@Steelbreaker25); +INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- ASSEMBLY OF IRON 10-man +-- Stormcaller Brundir killed last +(@Brundir10,1,100,1,0,-@Assembly10Ref,2), -- 2 items from reference loot +(@Brundir10,47241,100,1,0,1,1), -- 1 Emblem of Triumph +-- Runemaster Molgeim killed last +(@Molgeim10,1,100,1,0,-@Assembly10Ref,2), -- 2 items from reference loot +(@Molgeim10,47241,100,1,0,2,2), -- 2 Emblem of Triumph +(@Molgeim10,45506,100,2,0,1,1), -- Archivum Data Disc +(@Molgeim10,45087,75,1,0,1,1), -- Runed Orb +-- Steelbreaker killed last +(@Steelbreaker10,1,100,1,0,-@Assembly10Ref,2), -- 2 items from reference loot +(@Steelbreaker10,47241,100,1,0,2,2), -- 2 Emblem of Triumph +(@Steelbreaker10,45087,75,1,0,1,1), -- Runed Orb +(@Steelbreaker10,45506,100,1,0,1,1), -- Archivum Data Disc for Quest +(@Steelbreaker10,25455,0,1,1,1,1), -- Belt fo the Crystal Tree +(@Steelbreaker10,45447,0,1,1,1,1), -- Watchful Eye of Fate +(@Steelbreaker10,45456,0,1,1,1,1), -- Loop of the Agile +(@Steelbreaker10,45449,0,1,1,1,1), -- The Masticator +(@Steelbreaker10,45448,0,1,1,1,1), -- Perilous Bite +-- ASSEMBLY OF IRON 25-man +-- Stormcaller Brundir killed last +(@Brundir25,1,100,1,0,-@Assembly25Ref,3), -- 3 items from reference loot +(@Brundir25,2,10,1,0,-34154,1), -- Chance on Recipe +(@Brundir25,45038,8,1,0,1,1), -- Fragment of Val'anyr +(@Brundir25,45087,75,1,0,1,1), -- Runed Orb +(@Brundir25,47241,100,1,0,1,2), -- 2 Emblems of Triumph +-- Runemaster Molgeim killed last +(@Molgeim25,1,100,1,0,-@Assembly25Ref,3), -- 3 items from reference loot +(@Molgeim25,2,10,1,0,-34154,1), -- Chance on Recipe +(@Molgeim25,45038,8,1,0,1,1), -- Fragment of Val'anyr +(@Molgeim25,45087,75,1,0,1,1), -- Runed Orb +(@Molgeim25,47241,100,1,0,2,2), -- 2 Emblems of Triumph +(@Molgeim25,45506,100,1,0,1,1), -- Archivum Data Disc +-- Steelbreaker killed last +(@Steelbreaker25,1,100,1,0,-@Assembly25Ref,3), -- 3 items from reference loot +(@Steelbreaker25,2,10,1,0,-34154,1), -- Chance on Recipe +(@Steelbreaker25,45038,18,1,0,1,1), -- Fragment of Val'anyr +(@Steelbreaker25,45087,75,1,0,2,2), -- 2x Runed Orb +(@Steelbreaker25,47241,100,1,0,2,2), -- 2 Emblems of Triumph +(@Steelbreaker25,45506,100,1,0,1,1), -- Archivum Data Disc +(@Steelbreaker25,45241,0,1,1,1,1), -- Belt of Colossal Rage +(@Steelbreaker25,45242,0,1,1,1,1), -- Drape of Mortal Downfall +(@Steelbreaker25,45607,0,1,1,1,1), -- Fang of Oblivion +(@Steelbreaker25,45244,0,1,1,1,1), -- Greaves of Swift Vengeance +(@Steelbreaker25,45243,0,1,1,1,1), -- Sapphire Amulet of Renewal +(@Steelbreaker25,45245,0,1,1,1,1); -- Shoulderpads of the Intruder + +DELETE FROM `gameobject_loot_template` WHERE `entry` IN (@CacheLivingStone10,@CacheLivingStone25); +INSERT INTO `gameobject_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- KOLOGARN 10-man +(@CacheLivingStone10,1,100,1,0,-@Kologarn10Ref,2), -- 2 items from reference loot +(@CacheLivingStone10,47241,100,1,0,1,1), -- 1 Emblem of Triumph +-- KOLOGARN 25-Man +(@CacheLivingStone25,1,100,1,0,-@Kologarn25Ref,3), -- 3 items from reference loot +(@CacheLivingStone25,2,10,1,0,-34154,1), -- Chance on Recipe +(@CacheLivingStone25,45038,8,1,0,1,1), -- Fragment of Val'anyr +(@CacheLivingStone25,45087,50,1,0,1,1), -- Runed Orb +(@CacheLivingStone25,47241,100,1,0,1,2); -- 2 Emblems of Triumph + +DELETE FROM `creature_loot_template` WHERE `entry` IN (@Auriaya10,@Auriaya25); +INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- AURIAYA 10-man +(@Auriaya10,1,100,1,0,-@Auriaya10Ref,2), -- 2 items from reference loot +(@Auriaya10,47241,100,1,0,1,1), -- 1 Emblem of Triumph +-- AURIAYA 25-man +(@Auriaya25,1,100,1,0,-@Auriaya25Ref,3), -- 3 items from reference loot +(@Auriaya25,2,10,1,0,-34154,1), -- Chance on Recipe +(@Auriaya25,45038,8,1,0,1,1), -- Fragment of Val'anyr +(@Auriaya25,45087,75,1,0,1,1), -- Runed Orb +(@Auriaya25,47241,100,1,0,1,2); -- 2 Emblems of Triumph diff --git a/sql/old/3.3.5a/2012_04_01_00_auth_realmlist.sql b/sql/old/3.3.5a/2012_04_01_00_auth_realmlist.sql new file mode 100644 index 00000000000..e2e1efaf993 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_01_00_auth_realmlist.sql @@ -0,0 +1 @@ +ALTER TABLE `realmlist` CHANGE `address` `address` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '127.0.0.1'; diff --git a/sql/old/3.3.5a/2012_04_01_00_world_creature.sql b/sql/old/3.3.5a/2012_04_01_00_world_creature.sql new file mode 100644 index 00000000000..f6a42a6ef08 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_01_00_world_creature.sql @@ -0,0 +1,17 @@ +-- Add missing spawns to db +DELETE FROM `creature` WHERE `guid` IN (4764,28648,40266,40267,40470,40471,40510,40516,40517,40518,40601,40602,40603,41320); +INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `curhealth`) VALUES +(4764,33608,530,1,1,-2263.63,5559.49,67.0918,5.91667,180,0,9156), -- Alchemy +(28648,33609,530,1,1,-2262.64,5561.96,67.0948,5.89921,180,0,9156), -- Blacksmithing +(40266,33610,530,1,1,-2261.59,5564.54,67.095,5.93412,180,0,9156), -- Enchanting +(40267,33611,530,1,1,-2260.64,5567.08,67.092,5.93412,180,0,9156), -- Engineering +(40470,33612,530,1,1,-2264.54,5562.77,67.0939,2.79253,180,0,9156), -- Leatherworking +(40471,33613,530,1,1,-2265.57,5560.32,67.0911,2.80998,180,0,9156), -- Tailoring +(40510,33614,530,1,1,-2263.47,5565.35,67.0937,2.80998,180,0,9156), -- Jewelcrafting +(40516,33615,530,1,1,-2262.36,5567.8,67.0909,2.79253,180,0,9156), -- Inscription +(40517,33616,530,1,1,-2268.1,5563.18,67.0919,5.89921,180,0,9156), -- Herbalism +(40518,33617,530,1,1,-2266.98,5565.78,67.0927,5.89921,180,0,9156), -- Mining +(40601,33618,530,1,1,-2265.86,5568.36,67.0911,5.84685,180,0,9156), -- Skinning +(40602,33619,530,1,1,-2267.52,5569.19,67.0896,2.74017,180,0,9156), -- Cooking +(40603,33621,530,1,1,-2269.93,5564.2,67.09,2.75762,180,0,9156), -- First Aid +(41320,33623,530,1,1,-2268.81,5566.68,67.0905,2.74017,180,0,9156); -- Fishing diff --git a/sql/old/3.3.5a/2012_04_01_00_world_spell_script_names.sql b/sql/old/3.3.5a/2012_04_01_00_world_spell_script_names.sql new file mode 100644 index 00000000000..9d37f6ad4cb --- /dev/null +++ b/sql/old/3.3.5a/2012_04_01_00_world_spell_script_names.sql @@ -0,0 +1,6 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_spinning_pain_spike'; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(66316,'spell_spinning_pain_spike'), +(67100,'spell_spinning_pain_spike'), +(67101,'spell_spinning_pain_spike'), +(67102,'spell_spinning_pain_spike'); diff --git a/sql/old/3.3.5a/2012_04_01_01_world_creature.sql b/sql/old/3.3.5a/2012_04_01_01_world_creature.sql new file mode 100644 index 00000000000..f6dff34cfa9 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_01_01_world_creature.sql @@ -0,0 +1,26 @@ +-- Re-add deleted data +DELETE FROM `creature` WHERE `guid` IN (4764,28648,40266,40267,40470,40471,40510,40516,40517,40518,40601,40602,40603,41320); +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES +(4764,26796,576,2,1,0,0,424.547,185.962,-34.9367,4.72984,3600,0,0,1,0,0,0,0,0), +(28648,17148,530,1,1,0,0,-2910.22,6473.03,82.4898,2.49669,300,0,0,5914,0,0,0,0,0), +(40267,37671,1,1,1,0,0,1391.2,-4486.23,31.4544,3.3355,300,0,0,42,0,0,0,0,0), +(40470,37671,1,1,1,0,0,1392.66,-4481.87,31.3782,1.97284,300,0,0,42,0,0,0,0,0), +(40471,37671,1,1,1,0,0,1393.92,-4489.57,31.4737,4.93701,300,0,0,42,0,0,0,0,0); + +-- Add missing spawns to db (trainers) +DELETE FROM `creature` WHERE `guid` IN (40266,40510,40516,40517,40518,40601,40602,40603,41320,41674,41723,41775,41779,41780); +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`curhealth`) VALUES +(40266,33608,530,1,1,-2263.63,5559.49,67.0918,5.91667,180,0,1), -- Alchemy +(40510,33609,530,1,1,-2262.64,5561.96,67.0948,5.89921,180,0,1), -- Blacksmithing +(40516,33610,530,1,1,-2261.59,5564.54,67.095,5.93412,180,0,1), -- Enchanting +(40517,33611,530,1,1,-2260.64,5567.08,67.092,5.93412,180,0,1), -- Engineering +(40518,33612,530,1,1,-2264.54,5562.77,67.0939,2.79253,180,0,1), -- Leatherworking +(40601,33613,530,1,1,-2265.57,5560.32,67.0911,2.80998,180,0,1), -- Tailoring +(40602,33614,530,1,1,-2263.47,5565.35,67.0937,2.80998,180,0,1), -- Jewelcrafting +(40603,33615,530,1,1,-2262.36,5567.8,67.0909,2.79253,180,0,1), -- Inscription +(41320,33616,530,1,1,-2268.1,5563.18,67.0919,5.89921,180,0,1), -- Herbalism +(41674,33617,530,1,1,-2266.98,5565.78,67.0927,5.89921,180,0,1), -- Mining +(41723,33618,530,1,1,-2265.86,5568.36,67.0911,5.84685,180,0,1), -- Skinning +(41775,33619,530,1,1,-2267.52,5569.19,67.0896,2.74017,180,0,1), -- Cooking +(41779,33621,530,1,1,-2269.93,5564.2,67.09,2.75762,180,0,1), -- First Aid +(41780,33623,530,1,1,-2268.81,5566.68,67.0905,2.74017,180,0,1); -- Fishing diff --git a/sql/old/3.3.5a/2012_04_01_02_world_spell_group_stack_rules.sql b/sql/old/3.3.5a/2012_04_01_02_world_spell_group_stack_rules.sql new file mode 100644 index 00000000000..d42afd1d955 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_01_02_world_spell_group_stack_rules.sql @@ -0,0 +1,9 @@ +-- Greater Blessing of Wisdom and Mana Spring Totem should not stack (hotfix) +SET @GROUP := 1117; +DELETE FROM `spell_group` WHERE id=@GROUP; +INSERT INTO `spell_group`(`id`,`spell_id`) VALUES +(@GROUP,25894), -- Greater Blessing of Wisdom +(@GROUP,5677); -- Mana Spring (cast by Mana Spring Totem) +DELETE FROM `spell_group_stack_rules` WHERE `group_id`=@GROUP; +INSERT INTO `spell_group_stack_rules`(`group_id`,`stack_rule`) VALUES +(@GROUP,3); -- Make them SPELL_GROUP_STACK_RULE_EXCLUSIVE_SAME_EFFECT diff --git a/sql/old/3.3.5a/2012_04_01_03_world_trainers.sql b/sql/old/3.3.5a/2012_04_01_03_world_trainers.sql new file mode 100644 index 00000000000..1edc9ae09af --- /dev/null +++ b/sql/old/3.3.5a/2012_04_01_03_world_trainers.sql @@ -0,0 +1,83 @@ +-- Template updates +UPDATE `creature_template` SET `faction_A`=1744,`faction_H`=1744,`npcflag`=`npcflag`|16,`trainer_type`=2 WHERE `entry`=33608; -- Alchemy +UPDATE `creature_template` SET `faction_A`=1744,`faction_H`=1744,`npcflag`=`npcflag`|16/*80*/,`trainer_type`=2 WHERE `entry`=33609; -- Blacksmithing +UPDATE `creature_template` SET `faction_A`=1744,`faction_H`=1744,`npcflag`=`npcflag`|16,`trainer_type`=2 WHERE `entry`=33610; -- Enchanting +UPDATE `creature_template` SET `faction_A`=1744,`faction_H`=1744,`npcflag`=`npcflag`|16,`trainer_type`=2 WHERE `entry`=33611; -- Engineering +UPDATE `creature_template` SET `faction_A`=1744,`faction_H`=1744,`npcflag`=`npcflag`|16,`trainer_type`=2 WHERE `entry`=33612; -- Leatherworking +UPDATE `creature_template` SET `faction_A`=1744,`faction_H`=1744,`npcflag`=`npcflag`|16 WHERE `entry`=33613; -- Tailoring +UPDATE `creature_template` SET `faction_A`=1744,`faction_H`=1744,`npcflag`=`npcflag`|16,`trainer_type`=2 WHERE `entry`=33614; -- Jewelcrafting +UPDATE `creature_template` SET `faction_A`=1744,`faction_H`=1744,`npcflag`=`npcflag`|16,`trainer_type`=2 WHERE `entry`=33616; -- Herbalism +UPDATE `creature_template` SET `faction_A`=1744,`faction_H`=1744,`npcflag`=`npcflag`|16,`trainer_type`=2 WHERE `entry`=33618; -- Skinning (guessed) +UPDATE `creature_template` SET `faction_A`=1744,`faction_H`=1744,`npcflag`=`npcflag`|16,`trainer_type`=2 WHERE `entry`=33617; -- Mining (guessed) +UPDATE `creature_template` SET `faction_A`=1744,`faction_H`=1744,`npcflag`=`npcflag`|16 WHERE `entry`=33619; -- Cooking (guessed) +UPDATE `creature_template` SET `faction_A`=1744,`faction_H`=1744,`npcflag`=`npcflag`|16 WHERE `entry`=33621; -- First Aid (guessed) +UPDATE `creature_template` SET `faction_A`=1744,`faction_H`=1744,`npcflag`=`npcflag`|16,`trainer_type`=2 WHERE `entry`=33615; -- Inscription (guessed) +UPDATE `creature_template` SET `faction_A`=1744,`faction_H`=1744,`npcflag`=`npcflag`|16,`trainer_type`=2 WHERE `entry`=33623; -- Fishing (guessed) + +-- Model data +UPDATE `creature_model_info` SET `bounding_radius`=0.11,`combat_reach`=0,`gender`=2 WHERE `modelid`=28738; -- shared by many +UPDATE `creature_model_info` SET `bounding_radius`=0.14,`combat_reach`=0,`gender`=2 WHERE `modelid`=28758; -- shared by many + +-- Addon data +DELETE FROM `creature_template_addon` WHERE `entry` IN (33608,33609,33610,33611,33612,33613,33614,33616,33618,33617,33619,33621,33615,33623); +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(33608,0,0,1,0, NULL), -- Alchemy +(33609,0,0,1,0, NULL), -- Blacksmithing +(33610,0,0,1,0, NULL), -- Enchanting +(33611,0,0,1,0, NULL), -- Engineering +(33612,0,0,1,0, NULL), -- Leatherworking +(33613,0,0,1,0, NULL), -- Tailoring +(33614,0,0,1,0, NULL), -- Jewelcrafting +(33616,0,0,1,0, NULL), -- Herbalism +(33618,0,0,1,0, NULL), -- Skinning (guessed) +(33617,0,0,1,0, NULL), -- Mining (guessed) +(33619,0,0,1,0, NULL), -- Cooking (guessed) +(33621,0,0,1,0, NULL), -- First Aid (guessed) +(33615,0,0,1,0, NULL), -- Inscription (guessed) +(33623,0,0,1,0, NULL); -- Fishing (guessed) + +-- Trainer spells +DELETE FROM `npc_trainer` WHERE `entry` IN (33608,33609,33610,33611,33612,33613,33614,33616,33618,33617,33619,33621,33615,33623); +INSERT INTO `npc_trainer` (`entry`, `spell`, `spellcost`, `reqskill`, `reqskillvalue`, `reqlevel`) VALUES +(33608, -201001, 0, 0, 0, 0), -- Alchemy +(33608, -201002, 0, 0, 0, 0), -- Alchemy +(33608, -201003, 0, 0, 0, 0), -- Alchemy +(33609, -201004, 0, 0, 0, 0), -- Blacksmithing +(33609, -201005, 0, 0, 0, 0), -- Blacksmithing +(33609, -201006, 0, 0, 0, 0), -- Blacksmithing +(33610, -201009, 0, 0, 0, 0), -- Enchanting +(33610, -201010, 0, 0, 0, 0), -- Enchanting +(33610, -201011, 0, 0, 0, 0), -- Enchanting +(33611, -201012, 0, 0, 0, 0), -- Engineering +(33611, -201013, 0, 0, 0, 0), -- Engineering +(33611, -201014, 0, 0, 0, 0), -- Engineering +(33612, -201027, 0, 0, 0, 0), -- Leatherworking +(33612, -201028, 0, 0, 0, 0), -- Leatherworking +(33612, -201029, 0, 0, 0, 0), -- Leatherworking +(33613, -201039, 0, 0, 0, 0), -- Tailoring +(33613, -201040, 0, 0, 0, 0), -- Tailoring +(33613, -201041, 0, 0, 0, 0), -- Tailoring +(33614, -201024, 0, 0, 0, 0), -- Jewelcrafting +(33614, -201025, 0, 0, 0, 0), -- Jewelcrafting +(33614, -201026, 0, 0, 0, 0), -- Jewelcrafting +(33616, -201018, 0, 0, 0, 0), -- Herbalism +(33616, -201019, 0, 0, 0, 0), -- Herbalism +(33616, -201020, 0, 0, 0, 0), -- Herbalism +(33618, -201036, 0, 0, 0, 0), -- Skinning +(33618, -201037, 0, 0, 0, 0), -- Skinning +(33618, -201038, 0, 0, 0, 0), -- Skinning +(33617, -201033, 0, 0, 0, 0), -- Mining +(33617, -201034, 0, 0, 0, 0), -- Mining +(33617, -201035, 0, 0, 0, 0), -- Mining +(33619, -202004, 0, 0, 0, 0), -- Cooking +(33619, -202005, 0, 0, 0, 0), -- Cooking +(33619, -202006, 0, 0, 0, 0), -- Cooking +(33621, -202007, 0, 0, 0, 0), -- First Aid +(33621, -202008, 0, 0, 0, 0), -- First Aid +(33621, -202009, 0, 0, 0, 0), -- First Aid +(33615, -201021, 0, 0, 0, 0), -- Inscription +(33615, -201022, 0, 0, 0, 0), -- Inscription +(33615, -201023, 0, 0, 0, 0), -- Inscription +(33623, -202001, 0, 0, 0, 0), -- Fishing +(33623, -202002, 0, 0, 0, 0), -- Fishing +(33623, -202003, 0, 0, 0, 0); -- Fishing diff --git a/sql/old/3.3.5a/2012_04_01_04_world_conditions.sql b/sql/old/3.3.5a/2012_04_01_04_world_conditions.sql new file mode 100644 index 00000000000..e84307e0b05 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_01_04_world_conditions.sql @@ -0,0 +1,5 @@ +-- Quest: Blending In (11633) +-- Spell from Cape only Appliable in City Area +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry`=45614; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(17,0,45614,11633,23,4125,0,0,0, '', 'Shroud of the Scourge - Temple City of En''kilah'); diff --git a/sql/old/3.3.5a/2012_04_01_05_world_creature_template.sql b/sql/old/3.3.5a/2012_04_01_05_world_creature_template.sql new file mode 100644 index 00000000000..a4d13f1513a --- /dev/null +++ b/sql/old/3.3.5a/2012_04_01_05_world_creature_template.sql @@ -0,0 +1,2 @@ +-- CREATURE_FLAG_EXTRA_NO_XP_AT_KILL +UPDATE `creature_template` SET `flags_extra`=`flags_extra`|64 WHERE `entry`=21267; -- Mana Beast diff --git a/sql/old/3.3.5a/2012_04_01_06_world_sai.sql b/sql/old/3.3.5a/2012_04_01_06_world_sai.sql new file mode 100644 index 00000000000..9b8857da1e4 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_01_06_world_sai.sql @@ -0,0 +1,7 @@ +-- Fix quest 11468 - Falcon versus hawk +SET @entry := 24747; -- Fjord Hawk +UPDATE creature_template SET AIName='SmartAI' WHERE entry=@entry; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@entry AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@entry,0,0,1,8,0,100,0,44407,0,0,0,11,44408,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Fjord Hawk - On Spellhit - Cast spell on invoker'), +(@entry,0,1,0,61,0,100,0,0,0,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Fjord Hawk - On Spellhit - Despawn'); diff --git a/sql/old/3.3.5a/2012_04_01_07_world_misc.sql b/sql/old/3.3.5a/2012_04_01_07_world_misc.sql new file mode 100644 index 00000000000..346627fd88b --- /dev/null +++ b/sql/old/3.3.5a/2012_04_01_07_world_misc.sql @@ -0,0 +1,4 @@ +UPDATE `conditions` SET `ElseGroup`=0 WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry`=45614; -- typo fix for previous commit +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry`=47431; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(17,0,47431,0,23,4195,0,0,64,'','Capture Jormungar Spawn can only be used in Ice Heart Cavern'); diff --git a/sql/old/3.3.5a/2012_04_03_00_world_spell_script_names.sql b/sql/old/3.3.5a/2012_04_03_00_world_spell_script_names.sql new file mode 100644 index 00000000000..70f675daa20 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_03_00_world_spell_script_names.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` = 36444; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(36444, 'spell_gen_wg_water'); diff --git a/sql/old/3.3.5a/2012_04_04_00_auth_realmlist.sql b/sql/old/3.3.5a/2012_04_04_00_auth_realmlist.sql new file mode 100644 index 00000000000..18f2d7b3d4c --- /dev/null +++ b/sql/old/3.3.5a/2012_04_04_00_auth_realmlist.sql @@ -0,0 +1 @@ +ALTER TABLE `realmlist` CHANGE `address` `address` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '127.0.0.1'; diff --git a/sql/old/3.3.5a/2012_04_04_00_world_conditions.sql b/sql/old/3.3.5a/2012_04_04_00_world_conditions.sql new file mode 100644 index 00000000000..55cab4ca730 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_04_00_world_conditions.sql @@ -0,0 +1,7 @@ +-- Will of Sartharion should only target the drakes and Sartharion +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=61254; +INSERT INTO `conditions`(`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13, 1, 61254, 0, 0, 31, 0, 3, 30449, 0, 0, 0, '', 'Will of Sartharion'), +(13, 1, 61254, 0, 1, 31, 0, 3, 30451, 0, 0, 0, '', 'Will of Sartharion'), +(13, 1, 61254, 0, 2, 31, 0, 3, 30452, 0, 0, 0, '', 'Will of Sartharion'), +(13, 1, 61254, 0, 3, 31, 0, 3, 28860, 0, 0, 0, '', 'Will of Sartharion'); diff --git a/sql/old/3.3.5a/2012_04_04_01_world_spell_dbc.sql b/sql/old/3.3.5a/2012_04_04_01_world_spell_dbc.sql new file mode 100644 index 00000000000..7eccdf811e4 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_04_01_world_spell_dbc.sql @@ -0,0 +1 @@ +UPDATE `spell_dbc` SET `EffectApplyAuraName1`=4 WHERE `Id`=56817; diff --git a/sql/old/3.3.5a/2012_04_05_00_world_gameobject_template.sql b/sql/old/3.3.5a/2012_04_05_00_world_gameobject_template.sql new file mode 100644 index 00000000000..d50c4ad8d1c --- /dev/null +++ b/sql/old/3.3.5a/2012_04_05_00_world_gameobject_template.sql @@ -0,0 +1,32 @@ +DELETE FROM `gameobject_template` WHERE `entry`=202931; +INSERT INTO `gameobject_template` (`entry`, `type`, `displayId`, `name`, `IconName`, `castBarCaption`, `unk1`, `data0`, `data1`, `data2`, `data3`, `data4`, `data5`, `data6`, `data7`, `data8`, `data9`, `data10`, `data11`, `data12`, `data13`, `data14`, `data15`, `data16`, `data17`, `data18`, `data19`, `data20`, `data21`, `data22`, `data23`, `size`, `questItem1`, `questItem2`, `questItem3`, `questItem4`, `questItem5`, `questItem6`, `WDBVerified`) VALUES +(202931, 5, 9463, 'Serpent Offering', '', '', '', 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.17, 0, 0, 0, 0, 0, 0, 12340); -- -Unknown- + +UPDATE `gameobject_template` SET `questItem1`=30527, `questItem2`=30524, `questItem3`=30525, `questItem4`=30526 WHERE `entry`=184815; -- Sealed Coffin +-- UPDATE `gameobject_template` SET `data0`=2061, `WDBVerified`=12340 WHERE `entry`=151951; -- Idol Oven Fire +-- UPDATE `gameobject_template` SET `type`=5, `data3`=0, `data5`=0 WHERE `entry`=188187; -- Snow Pile +UPDATE `gameobject_template` SET `size`=0.45 WHERE `entry`=190169; -- Tiger Lily +UPDATE `gameobject_template` SET `unk1`='' WHERE `entry`=190549; -- The Zephyr +-- UPDATE `gameobject_template` SET `data0`=2061 WHERE `entry`=191300; -- Fire +UPDATE `gameobject_template` SET `displayId`=7836 WHERE `entry`=196485; -- Saronite Rock +-- UPDATE `gameobject_template` SET `data0`=2061 WHERE `entry`=126337; -- 126337 +-- UPDATE `gameobject_template` SET `data0`=2061 WHERE `entry`=126338; -- 126338 +-- UPDATE `gameobject_template` SET `data0`=2061 WHERE `entry`=126339; -- 126339 +-- UPDATE `gameobject_template` SET `data0`=2061 WHERE `entry`=126340; -- 126340 +-- UPDATE `gameobject_template` SET `data0`=2061 WHERE `entry`=126341; -- 126341 +-- UPDATE `gameobject_template` SET `data0`=2061 WHERE `entry`=126345; -- 126345 +UPDATE `gameobject_template` SET `data2`=23787, `data7`=3605, `data19`=0 WHERE `entry`=202443; -- Dedication of Honor +UPDATE `gameobject_template` SET `type`=10 WHERE `entry`=166872; -- Supply Crate +UPDATE `gameobject_template` SET `data6`=-1000 WHERE `entry`=178559; -- Larva Spewer + +/* +GameObject (Entry: 126337 GoType: 8) have data0=2061 but SpellFocus (Id: 2061) not exist. +GameObject (Entry: 126338 GoType: 8) have data0=2061 but SpellFocus (Id: 2061) not exist. +GameObject (Entry: 126339 GoType: 8) have data0=2061 but SpellFocus (Id: 2061) not exist. +GameObject (Entry: 126340 GoType: 8) have data0=2061 but SpellFocus (Id: 2061) not exist. +GameObject (Entry: 126341 GoType: 8) have data0=2061 but SpellFocus (Id: 2061) not exist. +GameObject (Entry: 126345 GoType: 8) have data0=2061 but SpellFocus (Id: 2061) not exist. +GameObject (Entry: 151951 GoType: 8) have data0=2061 but SpellFocus (Id: 2061) not exist. +GameObject (Entry: 191300 GoType: 8) have data0=2061 but SpellFocus (Id: 2061) not exist. +Gameobject (Entry: 188192 GoType: 3) have data7=188187 but GO (Entry 188187) have not GAMEOBJECT_TYPE_TRAP (6) type. +*/ diff --git a/sql/old/3.3.5a/2012_04_05_00_world_spell_script_names.sql b/sql/old/3.3.5a/2012_04_05_00_world_spell_script_names.sql new file mode 100644 index 00000000000..43f6760e8d6 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_05_00_world_spell_script_names.sql @@ -0,0 +1,6 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` in (7384,7887,11584,11585); +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(7384, 'spell_warr_overpower'), +(7887, 'spell_warr_overpower'), +(11584, 'spell_warr_overpower'), +(11585, 'spell_warr_overpower'); diff --git a/sql/old/3.3.5a/2012_04_05_01_world_spell_proc_event.sql b/sql/old/3.3.5a/2012_04_05_01_world_spell_proc_event.sql new file mode 100644 index 00000000000..076f97b8736 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_05_01_world_spell_proc_event.sql @@ -0,0 +1,2 @@ +UPDATE `spell_proc_event` SET `SpellFamilyMask0`=0x80000000, `SpellFamilyMask1`=0 WHERE `entry`=67363; -- Fixes Libram of Veracity proc + diff --git a/sql/old/3.3.5a/2012_04_06_00_world_spell_proc_event.sql b/sql/old/3.3.5a/2012_04_06_00_world_spell_proc_event.sql new file mode 100644 index 00000000000..0fba3bb46d6 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_06_00_world_spell_proc_event.sql @@ -0,0 +1 @@ +UPDATE `spell_proc_event` SET `SpellFamilyMask0`=0x10 WHERE `entry`=60132; -- Oblit/Scourge Strike Runic Power Up (T7 4s) diff --git a/sql/old/3.3.5a/2012_04_06_01_world_spell_dbc.sql b/sql/old/3.3.5a/2012_04_06_01_world_spell_dbc.sql new file mode 100644 index 00000000000..c0dc38ebf83 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_06_01_world_spell_dbc.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_dbc` WHERE `Id`=64748; -- Item - Death Knight T8 Tank 4P Bonus +INSERT INTO `spell_dbc` (`Id`,`Dispel`,`Mechanic`,`Attributes`,`AttributesEx`,`AttributesEx2`,`AttributesEx3`,`AttributesEx4`,`AttributesEx5`,`AttributesEx6`,`AttributesEx7`,`Stances`,`StancesNot`,`Targets`,`CastingTimeIndex`,`AuraInterruptFlags`,`ProcFlags`,`ProcChance`,`ProcCharges`,`MaxLevel`,`BaseLevel`,`SpellLevel`,`DurationIndex`,`RangeIndex`,`StackAmount`,`EquippedItemClass`,`EquippedItemSubClassMask`,`EquippedItemInventoryTypeMask`,`Effect1`,`Effect2`,`Effect3`,`EffectDieSides1`,`EffectDieSides2`,`EffectDieSides3`,`EffectRealPointsPerLevel1`,`EffectRealPointsPerLevel2`,`EffectRealPointsPerLevel3`,`EffectBasePoints1`,`EffectBasePoints2`,`EffectBasePoints3`,`EffectMechanic1`,`EffectMechanic2`,`EffectMechanic3`,`EffectImplicitTargetA1`,`EffectImplicitTargetA2`,`EffectImplicitTargetA3`,`EffectImplicitTargetB1`,`EffectImplicitTargetB2`,`EffectImplicitTargetB3`,`EffectRadiusIndex1`,`EffectRadiusIndex2`,`EffectRadiusIndex3`,`EffectApplyAuraName1`,`EffectApplyAuraName2`,`EffectApplyAuraName3`,`EffectAmplitude1`,`EffectAmplitude2`,`EffectAmplitude3`,`EffectMultipleValue1`,`EffectMultipleValue2`,`EffectMultipleValue3`,`EffectMiscValue1`,`EffectMiscValue2`,`EffectMiscValue3`,`EffectMiscValueB1`,`EffectMiscValueB2`,`EffectMiscValueB3`,`EffectTriggerSpell1`,`EffectTriggerSpell2`,`EffectTriggerSpell3`,`EffectSpellClassMaskA1`,`EffectSpellClassMaskA2`,`EffectSpellClassMaskA3`,`EffectSpellClassMaskB1`,`EffectSpellClassMaskB2`,`EffectSpellClassMaskB3`,`EffectSpellClassMaskC1`,`EffectSpellClassMaskC2`,`EffectSpellClassMaskC3`,`MaxTargetLevel`,`SpellFamilyName`,`SpellFamilyFlags1`,`SpellFamilyFlags2`,`SpellFamilyFlags3`,`MaxAffectedTargets`,`DmgClass`,`PreventionType`,`DmgMultiplier1`,`DmgMultiplier2`,`DmgMultiplier3`,`AreaGroupId`,`SchoolMask`,`Comment`) VALUES +(64748,1,0,384,0,0,0,0,131080,0,0,0,0,0,1,0,0,101,0,0,80,80,28,1,0,-1,0,0,6,0,0,1,0,1,'0','0','0',-11,0,-11,0,0,0,1,0,0,0,0,0,0,0,0,87,0,0,0,0,0,'0','0','0',1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16777829,0,0,0,15,0,0,0,0,0,0,'1','1','1',0,32,'Item - Death Knight T8 Tank 4P Bonus'); diff --git a/sql/old/3.3.5a/2012_04_06_02_world_gameobject_template.sql b/sql/old/3.3.5a/2012_04_06_02_world_gameobject_template.sql new file mode 100644 index 00000000000..5089579998d --- /dev/null +++ b/sql/old/3.3.5a/2012_04_06_02_world_gameobject_template.sql @@ -0,0 +1,4 @@ +-- GO required by spell 70477 - Cleanse Quel'Delar +DELETE FROM `gameobject_template` WHERE `entry`=300246; +INSERT INTO `gameobject_template` (`entry`, `type`, `displayId`, `name`, `IconName`, `castBarCaption`, `unk1`, `faction`, `flags`, `size`, `questItem1`, `questItem2`, `questItem3`, `questItem4`, `questItem5`, `questItem6`, `data0`, `data1`, `data2`, `data3`, `data4`, `data5`, `data6`, `data7`, `data8`, `data9`, `data10`, `data11`, `data12`, `data13`, `data14`, `data15`, `data16`, `data17`, `data18`, `data19`, `data20`, `data21`, `data22`, `data23`, `AIName`, `ScriptName`, `WDBVerified`) VALUES +(300246, 8, 0, 'TEMP Sunwell', '', '', '', 0, 0, 1, 0, 0, 0, 0, 0, 0, 1641, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', '', 1); diff --git a/sql/old/3.3.5a/2012_04_06_03_world_spell_dbc.sql b/sql/old/3.3.5a/2012_04_06_03_world_spell_dbc.sql new file mode 100644 index 00000000000..90ac4ac0f51 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_06_03_world_spell_dbc.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_dbc` WHERE `Id`=64934; -- Item - Warrior T8 Protection 4P Bonus +INSERT INTO `spell_dbc`(`Id`,`Dispel`,`Mechanic`,`Attributes`,`AttributesEx`,`AttributesEx2`,`AttributesEx3`,`AttributesEx4`,`AttributesEx5`,`AttributesEx6`,`AttributesEx7`,`Stances`,`StancesNot`,`Targets`,`CastingTimeIndex`,`AuraInterruptFlags`,`ProcFlags`,`ProcChance`,`ProcCharges`,`MaxLevel`,`BaseLevel`,`SpellLevel`,`DurationIndex`,`RangeIndex`,`StackAmount`,`EquippedItemClass`,`EquippedItemSubClassMask`,`EquippedItemInventoryTypeMask`,`Effect1`,`Effect2`,`Effect3`,`EffectDieSides1`,`EffectDieSides2`,`EffectDieSides3`,`EffectRealPointsPerLevel1`,`EffectRealPointsPerLevel2`,`EffectRealPointsPerLevel3`,`EffectBasePoints1`,`EffectBasePoints2`,`EffectBasePoints3`,`EffectMechanic1`,`EffectMechanic2`,`EffectMechanic3`,`EffectImplicitTargetA1`,`EffectImplicitTargetA2`,`EffectImplicitTargetA3`,`EffectImplicitTargetB1`,`EffectImplicitTargetB2`,`EffectImplicitTargetB3`,`EffectRadiusIndex1`,`EffectRadiusIndex2`,`EffectRadiusIndex3`,`EffectApplyAuraName1`,`EffectApplyAuraName2`,`EffectApplyAuraName3`,`EffectAmplitude1`,`EffectAmplitude2`,`EffectAmplitude3`,`EffectMultipleValue1`,`EffectMultipleValue2`,`EffectMultipleValue3`,`EffectMiscValue1`,`EffectMiscValue2`,`EffectMiscValue3`,`EffectMiscValueB1`,`EffectMiscValueB2`,`EffectMiscValueB3`,`EffectTriggerSpell1`,`EffectTriggerSpell2`,`EffectTriggerSpell3`,`EffectSpellClassMaskA1`,`EffectSpellClassMaskA2`,`EffectSpellClassMaskA3`,`EffectSpellClassMaskB1`,`EffectSpellClassMaskB2`,`EffectSpellClassMaskB3`,`EffectSpellClassMaskC1`,`EffectSpellClassMaskC2`,`EffectSpellClassMaskC3`,`MaxTargetLevel`,`SpellFamilyName`,`SpellFamilyFlags1`,`SpellFamilyFlags2`,`SpellFamilyFlags3`,`MaxAffectedTargets`,`DmgClass`,`PreventionType`,`DmgMultiplier1`,`DmgMultiplier2`,`DmgMultiplier3`,`AreaGroupId`,`SchoolMask`,`Comment`) VALUES +(64934,1,0,384,0,0,0,0,131080,0,0,0,0,0,1,0,0,101,0,0,80,80,28,1,0,-1,0,0,6,0,0,1,0,1,'0','0','0',-21,0,-11,0,0,0,1,0,0,0,0,0,0,0,0,87,0,0,0,0,0,'0','0','0',126,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16777829,0,0,0,4,0,0,0,0,0,0,'1','1','1',0,32, 'Item - Warrior T8 Protection 4P Bonus'); diff --git a/sql/old/3.3.5a/2012_04_06_04_world_page_text.sql b/sql/old/3.3.5a/2012_04_06_04_world_page_text.sql new file mode 100644 index 00000000000..97c0d9afe2d --- /dev/null +++ b/sql/old/3.3.5a/2012_04_06_04_world_page_text.sql @@ -0,0 +1,25 @@ +DELETE FROM `page_text` WHERE entry IN (2177,2295,2296,2297,2301,2302,2303,2308,2309,3036,3045,3046,3047,3049,3050,3051,3052,3053,3378,3544,3563,3564,3565); +INSERT INTO `page_text` (`entry`, `text`, `next_page`) VALUES +(2177, 'Valea Twinblades \nWarrior of the Scarlet Crusade\nCitizen of Alterac \nLast seen deep in the Eastern Plaguelands', 0), +(2295, 'Before the Age of Memory, the gentle Earthmother breathed upon the golden mists of dawn. Where the amber clouds came to rest, there were endless fields of flowing wheat and barley. This was the basin of her works - the great basket of life and hope.', 2296), +(2296, 'The Earthmother\'s eyes shone down upon the lands she had breathed into creation. Her right eye, An\'she (the sun), gave warmth and light to the land. Her left eye, Mu\'sha (the moon), gave peace and sleep to the stirring creatures of the dawning. Such was the power of her gaze that the Earthmother closed one dreaming eye for every turning of the sky. Thus, her loving gaze turned day into night for the first dawning of the world. $B', 2297), +(2297, 'While the right eye shone down upon the golden dawn, the Earthmother\'s gentle hands spread out across the golden plains. Wherever the shadow of her arms passed, a noble people arose from the rich soil. The Shu\'halo (the tauren) arose to give thanks and prayer to their loving mother. There, in the endless fields of dawn, the children of the earth swore themselves to her grace and vowed to bless her name until the final darkening of the world.', 0), +(2301, 'Into the brave hearts of her pure children, the Earthmother placed the love of the hunt. For the creatures of the first dawn were savage and fierce. They hid from the Earthmother, finding solace in the shadows and the wild places of the land. The Shu\'halo hunted these beasts wherever they could be found and tamed them with the Earthmother\'s blessing. ', 2302), +(2302, 'One great spirit eluded them, however. Apa\'ro (known as Malorne to the night elves), was a proud stag of snow white fur. His antlers scraped the roof of the heavens and his mighty hooves stamped out the deep places of the world. The Shu\'halo hunted Apa\'ro to the corners of the dawning world - and closed in to snare the proud stag.', 2303), +(2303, 'Seeking to escape, the great stag leapt into the sky. Yet, as his escape seemed assured, his mighty antlers tangled in the stars which held him fast. Though he kicked and struggled, Apa\'ro could not loose himself from the heavens. It was then that Mu\'sha found him as she chased her brother, An\'she, towards the dawn. Mu\'sha saw the mighty stag as he struggled and fell in love with him immediately. ', 2304), +(2308, 'As the mists of dawn faded and the Age of Memory advanced, the demigod, Cenarius, went his own way through the fields of the world. The Shu\'halo (tauren) were sorrowful at his passing and forgot much of the druidism he had taught them. As the generations passed, they forgot how to speak with the trees and the wild things of the land. The dark whispers from the deeps of the world drifted up to their ears once again.', 2309), +(2309, 'Though the children of the earth closed out the evil whisperings, a terrible curse befell their roaming tribes. Out of the black lands of the west came a horde of murderous creatures - the centaur. Cannibals and ravagers, the centaur fell upon the Shu\'halo like a plague. Though the braves and hunters fought with the Earthmother\'s blessing in their hearts, the centaur could not be defeated.', 2310), +(3544, 'You have found the wreckage of a mysterious object. Beyond the flames, you are able to make out an insignia marked "M:1815212085". You wonder what world this object must be from...', 0), +(3378, 'INVINCIBLE$B$BBeloved steed of Prince Arthas Menethil$B$BLoyal and great of heart in life, may you find peace in death.$B$BPure streams and green pastures, devoted friend.', 0), +(3565, 'Gritting his teeth, Marcus gestured as light flashed over him, restoring his strength.$B$BTavi stared anxiously as he rose to his full height, engulfing her in his shadow. He thrust his hand forward, sending a wave of righteous force through her. Eyes rolled back as she wavered for several seconds before regaining consciousness.$B$B"I\'ve recently taken the path of... retribution."$B$BThe mischievous smirk returned to her face, "Well then, this is going to be fun."$B$B', 0), +(3564, 'Marcus took both her hands in one of his as he reassured her, "It\'s fine. What is your specialization?"$B$BHer head snapped up, eyes burning with renewed life as shadowy energy channeled through her hands into Marcus, dropping him to his knees in agony.$B$B"Affliction, actually."$B', 3565), +(3563, '"Interested in some more company?" she purred as her hands weaved through a complex summoning ritual, stopping only when she felt the warmth of a new presence behind her.$B$BAll color drained from Marcus\'s face as he struggled to protest. "I... I don\'t think that\'s appropriate."$B$BConfused, Tavi turned to see what was wrong. A hideous fel hound stood ready, drooling onto the floor as it stared intently at the half-armored paladin.$B$B"No! No that\'s not what I meant." she stammered as she dispelled the hungry demon. "I\'m sorry, that\'s not really my specialization...."', 3564), +(3045, 'First Watch, Eight Bells$BWatches changed. All is well.', 3046), +(3046, 'Middle Watch, One Bell$BCedric found attempting to break into Captain\'s wine cabinet. Disciplined.', 3047), +(3047, 'Middle Watch, Two Bells$BCedric climbed rigging, became tangled and fell. Attended by ship\'s surgeon. Sent below to sober up.', 3049), +(3049, 'Middle Watch, Four Bells$BBottle of rum found in Cedric\'s pants. Disciplined.', 3050), +(3050, 'Middle Watch, Five Bells$BCedric\'s clothes found. Cedric found separately. Cedric disciplined.', 3051), +(3051, 'Middle Watch, Six Bells$BCedric singing loudly. Woke Captain. Cedric disciplined by Captain.', 3052), +(3052, 'Middle Watch, Eight Bells$BWatches changed. All quiet. Two men sent to locate Cedric.$B', 3053), +(3053, 'Morning Watch, One Bell$BFire in Captain\'s quarters. All hands roused. Throwing powder overboard. ', 0), +(3036, 'The mighty creature\'s maw opened wide, tossing bolts of icy water toward our vessel. Those terrible jaws clamped down upon the bow of our ship, tearing it from the hull. Sailors and cargo were thrown violently into the sea as the remnants of the ship disappeared beneath the waves.$B$BThe last thing I remember was flying from the broken hull, hitting the inky waters, and plunging beneath the waves. The world went dark and I thought for certain I\'d drawn my last breath. When I awoke in Theramore\'s infirmary, I knew someone had to tell our story.', 0); diff --git a/sql/old/3.3.5a/2012_04_07_00_characters_lag_reports.sql b/sql/old/3.3.5a/2012_04_07_00_characters_lag_reports.sql new file mode 100644 index 00000000000..151ace1c976 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_07_00_characters_lag_reports.sql @@ -0,0 +1,2 @@ +ALTER TABLE `lag_reports` ADD `latency` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `lag_reports` ADD `createTime` int(10) unsigned NOT NULL DEFAULT '0'; diff --git a/sql/old/3.3.5a/2012_04_07_00_world_gameobject.sql b/sql/old/3.3.5a/2012_04_07_00_world_gameobject.sql new file mode 100644 index 00000000000..c63fc753d32 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_07_00_world_gameobject.sql @@ -0,0 +1,5 @@ +UPDATE `gameobject_template` SET `faction`=54 WHERE `entry`=178164; +SET @GUID := 247; +DELETE FROM `gameobject` WHERE `guid`=@GUID; +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES +(@GUID,178164,409,1,1,736.6528,-1176.32,-118.0967,-0.6806787,0,0,0,1,120,255,1); -- Hot Coal, damage diff --git a/sql/old/3.3.5a/2012_04_07_01_world_game_event.sql b/sql/old/3.3.5a/2012_04_07_01_world_game_event.sql new file mode 100644 index 00000000000..7b74a90b49d --- /dev/null +++ b/sql/old/3.3.5a/2012_04_07_01_world_game_event.sql @@ -0,0 +1,2 @@ +UPDATE `game_event` SET `start_time` = '2012-04-08 00:01:00' WHERE `eventEntry` =9; -- Noblegarden +UPDATE `game_event` SET `start_time` = '2012-04-29 00:01:00' WHERE `eventEntry` =10; -- Children's Week diff --git a/sql/old/3.3.5a/2012_04_07_02_world_spell_proc_event.sql b/sql/old/3.3.5a/2012_04_07_02_world_spell_proc_event.sql new file mode 100644 index 00000000000..62ef49bc657 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_07_02_world_spell_proc_event.sql @@ -0,0 +1 @@ +UPDATE `spell_proc_event` SET `procFlags`=0 WHERE `entry`=70805; diff --git a/sql/old/3.3.5a/2012_04_08_00_world_spell_script_names.sql b/sql/old/3.3.5a/2012_04_08_00_world_spell_script_names.sql new file mode 100644 index 00000000000..ca97f419e11 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_08_00_world_spell_script_names.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_sindragosa_ice_tomb_dummy'; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(69712,'spell_sindragosa_ice_tomb_dummy'); diff --git a/sql/old/3.3.5a/2012_04_08_01_world_creature_template.sql b/sql/old/3.3.5a/2012_04_08_01_world_creature_template.sql new file mode 100644 index 00000000000..c6665729b75 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_08_01_world_creature_template.sql @@ -0,0 +1,2 @@ +-- Gymer +UPDATE `creature_template` SET `unit_class`=4,`spell1`=55426,`spell2`=55429,`spell3`=55516,`spell4`=55421,`VehicleId`=205 WHERE `entry`=29884; diff --git a/sql/old/3.3.5a/2012_04_08_02_world_spell_dbc.sql b/sql/old/3.3.5a/2012_04_08_02_world_spell_dbc.sql new file mode 100644 index 00000000000..5775428668d --- /dev/null +++ b/sql/old/3.3.5a/2012_04_08_02_world_spell_dbc.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_dbc` WHERE `Id`=31934; -- Blessed Life +INSERT INTO `spell_dbc` (`Id`,`Dispel`,`Mechanic`,`Attributes`,`AttributesEx`,`AttributesEx2`,`AttributesEx3`,`AttributesEx4`,`AttributesEx5`,`AttributesEx6`,`AttributesEx7`,`Stances`,`StancesNot`,`Targets`,`CastingTimeIndex`,`AuraInterruptFlags`,`ProcFlags`,`ProcChance`,`ProcCharges`,`MaxLevel`,`BaseLevel`,`SpellLevel`,`DurationIndex`,`RangeIndex`,`StackAmount`,`EquippedItemClass`,`EquippedItemSubClassMask`,`EquippedItemInventoryTypeMask`,`Effect1`,`Effect2`,`Effect3`,`EffectDieSides1`,`EffectDieSides2`,`EffectDieSides3`,`EffectRealPointsPerLevel1`,`EffectRealPointsPerLevel2`,`EffectRealPointsPerLevel3`,`EffectBasePoints1`,`EffectBasePoints2`,`EffectBasePoints3`,`EffectMechanic1`,`EffectMechanic2`,`EffectMechanic3`,`EffectImplicitTargetA1`,`EffectImplicitTargetA2`,`EffectImplicitTargetA3`,`EffectImplicitTargetB1`,`EffectImplicitTargetB2`,`EffectImplicitTargetB3`,`EffectRadiusIndex1`,`EffectRadiusIndex2`,`EffectRadiusIndex3`,`EffectApplyAuraName1`,`EffectApplyAuraName2`,`EffectApplyAuraName3`,`EffectAmplitude1`,`EffectAmplitude2`,`EffectAmplitude3`,`EffectMultipleValue1`,`EffectMultipleValue2`,`EffectMultipleValue3`,`EffectMiscValue1`,`EffectMiscValue2`,`EffectMiscValue3`,`EffectMiscValueB1`,`EffectMiscValueB2`,`EffectMiscValueB3`,`EffectTriggerSpell1`,`EffectTriggerSpell2`,`EffectTriggerSpell3`,`EffectSpellClassMaskA1`,`EffectSpellClassMaskA2`,`EffectSpellClassMaskA3`,`EffectSpellClassMaskB1`,`EffectSpellClassMaskB2`,`EffectSpellClassMaskB3`,`EffectSpellClassMaskC1`,`EffectSpellClassMaskC2`,`EffectSpellClassMaskC3`,`MaxTargetLevel`,`SpellFamilyName`,`SpellFamilyFlags1`,`SpellFamilyFlags2`,`SpellFamilyFlags3`,`MaxAffectedTargets`,`DmgClass`,`PreventionType`,`DmgMultiplier1`,`DmgMultiplier2`,`DmgMultiplier3`,`AreaGroupId`,`SchoolMask`,`Comment`) VALUES +(31934,0,0,384,0,0,0,0,0,0,0,131072,0,0,1,0,1048576,100,1,0,0,0,21,1,0,-1,0,0,6,0,0,1,0,0,'0','0','0',-51,0,0,0,0,0,1,0,0,0,0,0,0,0,0,87,0,0,0,0,0,'0','0','0',127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'1','0','0',0,0,'Blessed Life'); diff --git a/sql/old/3.3.5a/2012_04_08_02_world_spell_script_names.sql b/sql/old/3.3.5a/2012_04_08_02_world_spell_script_names.sql new file mode 100644 index 00000000000..dd23c9ef560 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_08_02_world_spell_script_names.sql @@ -0,0 +1,6 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_sindragosa_mystic_buffet'; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(70127,'spell_sindragosa_mystic_buffet'), +(72528,'spell_sindragosa_mystic_buffet'), +(72529,'spell_sindragosa_mystic_buffet'), +(72530,'spell_sindragosa_mystic_buffet'); diff --git a/sql/old/3.3.5a/2012_04_08_03_world_spell_script_names.sql b/sql/old/3.3.5a/2012_04_08_03_world_spell_script_names.sql new file mode 100644 index 00000000000..744a8bad10d --- /dev/null +++ b/sql/old/3.3.5a/2012_04_08_03_world_spell_script_names.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `spell_id`=-1064; +INSERT INTO `spell_script_names` VALUES +(-1064, 'spell_sha_chain_heal'); diff --git a/sql/old/3.3.5a/2012_04_12_00_world_creature_template.sql b/sql/old/3.3.5a/2012_04_12_00_world_creature_template.sql new file mode 100644 index 00000000000..ef4596939f5 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_12_00_world_creature_template.sql @@ -0,0 +1,2 @@ +-- Update proper modelid for Celestial Steed (31957 is wrong) +UPDATE `creature_template` SET `modelid1`=31958,`modelid2`=0 WHERE `entry`=40625; diff --git a/sql/old/3.3.5a/2012_04_12_01_world_creature_template.sql b/sql/old/3.3.5a/2012_04_12_01_world_creature_template.sql new file mode 100644 index 00000000000..bfe7b698ae9 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_12_01_world_creature_template.sql @@ -0,0 +1,6 @@ +UPDATE `creature_template` SET `WDBVerified`=12340 WHERE `entry`=40624; -- Verified + +-- Remove temp entry 68686 and replace with wdb verified 38686 +UPDATE `creature_template` SET `difficulty_entry_3`=38686 WHERE `entry`=36950; +UPDATE `creature_template` SET `minlevel`=82,`maxlevel`=82,`exp`=2,`faction_A`=84,`faction_H`=84,`mindmg`=488,`maxdmg`=642,`attackpower`=782,`unit_flags`=32832,`dynamicflags`=8,`minrangedmg`=363,`maxrangedmg`=521,`rangedattackpower`=121 WHERE `entry`=38686; +DELETE FROM `creature_template` WHERE `entry`=68686; diff --git a/sql/old/3.3.5a/2012_04_12_02_world_spell_bonus_data.sql b/sql/old/3.3.5a/2012_04_12_02_world_spell_bonus_data.sql new file mode 100644 index 00000000000..db35f5d97ee --- /dev/null +++ b/sql/old/3.3.5a/2012_04_12_02_world_spell_bonus_data.sql @@ -0,0 +1,29 @@ +-- Druid +UPDATE `spell_bonus_data` SET `direct_bonus`=0,`dot_bonus`=0 WHERE `entry` IN (779,1822,60089); +DELETE FROM `spell_bonus_data` WHERE `entry` IN (1079,9007,22568); +INSERT INTO `spell_bonus_data` (`entry`,`direct_bonus`,`dot_bonus`,`ap_bonus`,`ap_dot_bonus`,`comments`) VALUES +(1079,0,0,-1,-1, 'Druid - Rip'), +(9007,0,0,-1,-1, 'Druid - Pounce Bleed'), +(22568,0,0,-1,-1, 'Druid - Ferocious Bite'); + +-- Hunter +UPDATE `spell_bonus_data` SET `direct_bonus`=0,`dot_bonus`=0 WHERE `entry` IN (3044,3674,53352,13812,13797,1978,42243); +UPDATE `spell_bonus_data` SET `ap_dot_bonus`=0.1 WHERE `entry`=13812; +DELETE FROM `spell_bonus_data` WHERE `entry` IN (24131,53353); +INSERT INTO `spell_bonus_data` (`entry`,`direct_bonus`,`dot_bonus`,`ap_bonus`,`ap_dot_bonus`,`comments`) VALUES +(24131,0,0,-1,-1, 'Hunter - Wyvern Sting (triggered)'), +(53353,0,0,-1,-1, 'Hunter - Chimera Shot (Serpent)'); +DELETE FROM `spell_ranks` WHERE `first_spell_id`=24131; +INSERT INTO `spell_ranks` VALUES +(24131,24131,1), +(24131,24134,2), +(24131,24135,3), +(24131,27069,4), +(24131,49009,5), +(24131,49010,6); + +-- Rogue +UPDATE `spell_bonus_data` SET `direct_bonus`=0,`dot_bonus`=0 WHERE `entry` IN (2818,2819,11353,11354,25349,26968,27187,57969,57970); + +-- Howling blast +UPDATE `spell_bonus_data` SET `ap_bonus`=0.2 WHERE `entry`=49184; diff --git a/sql/old/3.3.5a/2012_04_12_03_world_spell_bonus_data.sql b/sql/old/3.3.5a/2012_04_12_03_world_spell_bonus_data.sql new file mode 100644 index 00000000000..d2262e52e98 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_12_03_world_spell_bonus_data.sql @@ -0,0 +1,8 @@ +-- Fixes some spell power stacking exploits +DELETE FROM `spell_bonus_data` WHERE `entry` IN (44525,18798,16614,7712,13897); +INSERT INTO `spell_bonus_data` (`entry`,`direct_bonus`,`dot_bonus`,`ap_bonus`,`ap_dot_bonus`,`comments`) VALUES +(44525,0,0,-1,-1, 'Enchant Weapon - Icebreaker'), +(18798,0,0,-1,-1, 'Item - Freezing Band'), +(16614,0,0,-1,-1, 'Item - Storm Gauntlets'), +(7712,0,0,-1,-1, 'Item - Fiery Retributer | Blazefury Medallion'), +(13897,0,0,-1,-1, 'Enchant Weapon - Fiery Weapon'); diff --git a/sql/old/3.3.5a/2012_04_12_04_world_creature_template.sql b/sql/old/3.3.5a/2012_04_12_04_world_creature_template.sql new file mode 100644 index 00000000000..35664ec5198 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_12_04_world_creature_template.sql @@ -0,0 +1,2 @@ +-- Update modelid for Invincible (with not bugged animation) +UPDATE `creature_template` SET `modelid1`=31007,`modelid2`=0,`WDBVerified`=-12340 WHERE `entry`=38545; diff --git a/sql/old/3.3.5a/2012_04_12_05_world_command.sql b/sql/old/3.3.5a/2012_04_12_05_world_command.sql new file mode 100644 index 00000000000..8eb87155cb2 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_12_05_world_command.sql @@ -0,0 +1,2 @@ +DELETE FROM `trinity_string` WHERE `entry` IN(555,556); +DELETE FROM `command` WHERE `name`='hover'; diff --git a/sql/old/3.3.5a/2012_04_13_00_world_sai.sql b/sql/old/3.3.5a/2012_04_13_00_world_sai.sql new file mode 100644 index 00000000000..0fd4bdddd9b --- /dev/null +++ b/sql/old/3.3.5a/2012_04_13_00_world_sai.sql @@ -0,0 +1,25 @@ +UPDATE `smart_scripts` SET `target_type`=`action_param6` WHERE +(`entryorguid`=369200 AND `source_type`=9 AND `id`=3) OR +(`entryorguid`=369201 AND `source_type`=9 AND `id`=3) OR +(`entryorguid`=3692 AND `source_type`=0 AND `id`=2) OR +(`entryorguid`=3692 AND `source_type`=0 AND `id`=3) OR +(`entryorguid`=3584 AND `source_type`=0 AND `id`=3) OR +(`entryorguid`=3584 AND `source_type`=0 AND `id`=4) OR +(`entryorguid`=954600 AND `source_type`=9 AND `id`=2) OR +(`entryorguid`=954600 AND `source_type`=9 AND `id`=3) OR +(`entryorguid`=7207 AND `source_type`=0 AND `id`=1) OR +(`entryorguid`=7207 AND `source_type`=0 AND `id`=2) OR +(`entryorguid`=911700 AND `source_type`=9 AND `id`=3); + +UPDATE `smart_scripts` SET `action_param6`=0 WHERE +(`entryorguid`=369200 AND `source_type`=9 AND `id`=3) OR +(`entryorguid`=369201 AND `source_type`=9 AND `id`=3) OR +(`entryorguid`=3692 AND `source_type`=0 AND `id`=2) OR +(`entryorguid`=3692 AND `source_type`=0 AND `id`=3) OR +(`entryorguid`=3584 AND `source_type`=0 AND `id`=3) OR +(`entryorguid`=3584 AND `source_type`=0 AND `id`=4) OR +(`entryorguid`=954600 AND `source_type`=9 AND `id`=2) OR +(`entryorguid`=954600 AND `source_type`=9 AND `id`=3) OR +(`entryorguid`=7207 AND `source_type`=0 AND `id`=1) OR +(`entryorguid`=7207 AND `source_type`=0 AND `id`=2) OR +(`entryorguid`=911700 AND `source_type`=9 AND `id`=3); diff --git a/sql/old/3.3.5a/2012_04_13_01_world_misc.sql b/sql/old/3.3.5a/2012_04_13_01_world_misc.sql new file mode 100644 index 00000000000..e4d04449a3f --- /dev/null +++ b/sql/old/3.3.5a/2012_04_13_01_world_misc.sql @@ -0,0 +1,219 @@ +-- Gnomish Playback Device (item 52709) Targeting condition -- by norfik closes #2169 +DELETE FROM `conditions` WHERE `SourceEntry`=74222 AND `ConditionValue2` IN (1268, 7955, 6119); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(17, 0, 74222, 1, 31, 3, 1268, 0, 63, '', 'Gnomish Playback Device on Ozzie Togglevolt'), +(17, 0, 74222, 2, 31, 3, 7955, 0, 63, '', 'Gnomish Playback Device on Milli Featherwhistle'), +(17, 0, 74222, 3, 31, 3, 6119, 0, 63, '', 'Gnomish Playback Device on Tog Rustsprocket'); + +-- fix revenge ap coeff -- by ric101 closes #3344 +UPDATE `spell_bonus_data` SET `ap_bonus` = 0.310 WHERE `entry` = 6572; + +-- fix life seed sp coeff -- by warpten closes #4162 +DELETE FROM `spell_bonus_data` WHERE `entry`=48503; +INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES +(48503,0,0,0,0, 'Druid - Living Seed Heal'); + +-- fix glyph of shadowflame proc only allow on damage. by kandera closes #3530 +UPDATE `spell_proc_event` SET `procEx` = procEx|262144 WHERE`entry` = 63310; -- Glyph of shadowflame fix + +-- Disable deprecated quests /in 2.4/ from Midsummer Festival - The Festival of Fire {A/H} by trista closes #5982 +DELETE FROM `disables` WHERE `sourceType` = 1 AND `entry` in (9367,9368); +INSERT INTO `disables` (`sourceType`,`entry`,`flags`,`params_0`,`params_1`,`comment`) VALUES +(1,9367,0,0,0,'Disable quest The Festival of Fire {A}/Deprecated after 2.4 Midsummer Festival revamp/'), +(1,9368,0,0,0,'Disable quest The Festival of Fire {H}/Deprecated after 2.4 Midsummer Festival revamp/'); + +-- fix gameobject spawn for just maces sign -- by mrsmite closes #5849 +DELETE FROM `gameobject` WHERE `guid` = 10714; +UPDATE `gameobject` SET `guid` = 10714 WHERE `guid` = 61895 AND `id` = 2157; + +-- update npc texts. by helias closes #6098 +DELETE FROM `npc_text` WHERE `ID` IN (10719,10782,10783,10787,10788,2838,9072,9110,10310,13293,13641,14089,15077,15155,15240,15412,15866,15873,15877,8663,8244,8254,8255,8282,8291,8296,8298,11093,3464,4776,4713,12130,13002,9984,12977,12978,10918,10999,10986,10991); +INSERT INTO `npc_text` (`ID`, `text0_0`, `text0_1`, `lang0`, `prob0`, `em0_0`, `em0_1`, `em0_2`, `em0_3`, `em0_4`, `em0_5`) VALUES +(10719, '$B$BWorry not, child. Look in your pack and you will find it once more.', NULL, 0, 1, 0, 0, 0, 0, 0, 0), +(10782, 'Sayoc, da ugly orc here, teach you daggers. You want teaching in other places, you talk to Ileda in da Farstrider Square of Silvermoon or Archibald in the War Quarter of Undercity, hokay?', 'Sayoc, da ugly orc here, teach you daggers. You want teaching in other places, you talk to Ileda in da Farstrider Square of Silvermoon or Archibald in the War Quarter of Undercity, hokay?', 1, 1, 0, 0, 0, 0, 0, 0), +(10783, 'You want to punch things, yah? Talk to Sayoc right here. He teach you.', 'You want to punch things, yah? Talk to Sayoc right here. He teach you.', 1, 1, 0, 0, 0, 0, 0, 0), +(10787, 'Ileda of da blood elves, in Farstrider Square of Silvermoon, train her students in both one and two-handed swords. Archibald, da Undercity"s weapon master, also train you, mon. He in da War Quarter.', 'Ileda of da blood elves, in Farstrider Square of Silvermoon, train her students in both one and two-handed swords. Archibald, da Undercity"s weapon master, also train you, mon. He in da War Quarter.', 1, 1, 0, 0, 0, 0, 0, 0), +(10788, 'Hanashi here knows staves. If you want a sturdier instructor, go to Thunder Bluff. Ansekhwa will teach you on the lower central rise there.', '', 1, 1, 0, 0, 0, 0, 0, 0), +(2838, '', 'Sure thing, $N. Here"s another for you.', 0, 1, 0, 0, 0, 0, 0, 0), +(9072, 'A search of the corpse"s clothing and equipment reveals the insignia you need, undamaged by the battle and foul environment.', '', 0, 1, 0, 0, 0, 0, 0, 0), +(9110, 'Say, you happen to see that arch in the lake to the west? I wonder where that goes? I should go divin" over there.', '', 0, 1, 0, 1, 0, 0, 0, 0), +(10310, 'You must be exalted with the blood elves before I will teach you a riding skill, $c.', '', 1, 1, 0, 1, 0, 0, 0, 0), +(13293, 'Please hurry, $N. I am in a great deal of pain and time is running out.', '', 0, 1, 0, 0, 0, 0, 0, 0), +(13641, '', '', 0, 1, 0, 0, 0, 0, 0, 0), +(14089, 'I"ve got a lead on Norgannon"s keystone, which guards access to Ulduar"s archives, but the Titans divided it into two pieces and secreted them away.$B$BOne of the pieces, the keystone"s shell, is held within the Inventor"s Library on the northern coast, south of Ulduar itself. The first thing you"ll need to do is retrieve the fragments of an access disk from the library"s guardians.', '', 0, 1, 0, 0, 0, 0, 0, 0), +(15077, 'There you are! I was beginning to think that the Sunreavers had intercepted you. Are you ready to deliver the tome to our representatives in Icecrown?', '', 0, 1, 0, 0, 0, 0, 0, 0), +(15155, 'These appear to be the remains of Thalorien Dawnseeker, the last wielder of Quel"Delar.', '', 0, 1, 0, 0, 0, 0, 0, 0), +(15240, 'I will escort you into the Sunwell when you"re ready.', 'I will escort you into the Sunwell when you"re ready.', 0, 1, 0, 0, 0, 0, 0, 0), +(15412, 'We got the final barrier blockin" entry to Frostwing Halls down, $g lad:lass;. Only Sindragosa stands between the Lich King and divine retribution! What are ye waitin" for?!', '', 0, 1, 0, 5, 0, 0, 0, 0), +(15866, 'De Darkspears have a home again! An" we couldn"t have done it wit"out ya helpin", $N. Now, we celebrate!', '', 0, 1, 0, 1, 0, 1, 0, 0), +(15873, 'Vol"jin told me ta keep hittin" da drum till he gets back. If ya be waitin" for him, he"d be back soon to take back da Isles.$B$BJust wait here and enjoy da music!', '', 0, 1, 0, 0, 0, 0, 0, 0), +(15877, 'We require da help of allies on da islands.$B$BZen"tabra has been watching over da animals of de Islands for some time now. We"d need her help and da help of da animal creatures.$B$BBwonsamdi is a powerful loa dat controls de spirits of de dead on da islands. His blessing is crucial for our attack.$B$BOnce our allies have joined us, Zalazane and his army of mind-controlled trolls will have no chance! Then, da Echo Isles will be de Darkspears!', '', 0, 1, 0, 0, 0, 0, 0, 0), +(8663, 'Thank you for delivering that list! My leg is almost recovered enough that I"ll be able to walk back to the crash site.', '', 0, 1, 0, 0, 0, 0, 0, 0), +(8244, 'We"ve been so wrapped up in this war, some of us forgot to make time for love.', '', 0, 1, 0, 0, 0, 0, 0, 0), +(8254, 'You work with machines for so long, sometimes you forget about real hearts.', '', 0, 1, 0, 0, 0, 0, 0, 0), +(8255, '', 'When you have lived as long as I, it becomes easy to forget about love for years. It is always good to be reminded.', 0, 1, 0, 0, 0, 0, 0, 0), +(8282, '', 'You look like you"ve had your heart broken. Come back when you"re not so sad.', 0, 1, 0, 25, 0, 153, 0, 0), +(8291, 'What, you don"t have a token to give me? Don"t you love me?', '', 0, 1, 0, 18, 0, 0, 0, 0), +(8296, 'It looks like you"ve already found love. You can give me a love token, but I"m not giving you anything nice. I"m waiting for someone special.', 'It looks like you"ve already found love. You can give me a love token, but I"m not giving you anything nice. I"m waiting for someone special.', 0, 1, 0, 1, 0, 0, 0, 0), +(8298, 'I"d like you better if you would apply some perfume.', 'I"d like you better if you would apply some perfume.', 0, 1, 0, 24, 0, 0, 0, 0), +(11093, 'Let"s get out of here!', '', 0, 1, 0, 5, 0, 0, 0, 0), +(3464, '', 'You do fine work, but it"s a bit rough around the edges. Don"t worry about it, it will come with practice. Speaking of which, how about we see what you"ve been working on?', 7, 1, 0, 0, 0, 0, 0, 0), +(4776, 'The battle is over, and the people of Darrowshire are saved.', '', 0, 1, 0, 0, 0, 0, 0, 0), +(4713, 'The Nightmare is finally over! Darrowshire, forgive me!', '', 0, 1, 0, 15, 0, 0, 0, 0), +(12130, '', '', 0, 1, 0, 0, 0, 0, 0, 0), +(13002, 'There ya go, mon. Try ta be more careful with this one, won"t ya?$b$bNow head down ta Drak"Zin Ruins and drink it near the pedestal!', NULL, 0, 1, 0, 0, 0, 0, 0, 0), +(9984, 'What are ye doin" here?! Get yer chatty self ta Alterac Vallery, where ye"re needed!', '', 7, 1, 1, 5, 0, 0, 0, 0), +(12977, 'Blight, Blight, Blight... that"s all I hear about around here. I miss the diversity!$b$bHere, here. You have pets, yes? Of course you do. Of course. Little pets. I have a mixture for them. It will make them ca-- ah, clever and strong creatures, yes. Yes. ', '', 1, 1, 396, 5, 0, 0, 0, 0), +(12978, 'Careful with it. It"s unstable and loses its potency quickly. Use it soon! And... preferably within eyesight, yes...', '', 1, 1, 5, 0, 0, 0, 0, 0), +(10918, 'The boy"s too stupid still to say it -- not enough crystal exposure yet -- but, he"s thankful for what you did in getting him those flasks.$B$BNow, only nine more sons to go. Gah!$B$B$B$BWant to take one of them off of our hands? We"ll sell him to you cheap.', '', 0, 1, 0, 1, 0, 5, 0, 6), +(10999, 'Friend! It"s been too long. What can we get for you?', '', 0, 1, 1, 1, 0, 0, 0, 0), +(10986, 'Our drinks should quench even the mightiest of thirsts.', '', 0, 1, 1, 396, 0, 0, 0, 0), +(10991, 'What can I say, $N? Yer the finest o" the Sha"tari Skyguard!$B$BJust don"t be lettin" that go ta yer head. I can still teach ya a thing or two, $G lad : lass;!$B$B', '', 0, 0, 0, 0, 0, 0, 0, 0); + +-- Fix Kor'kron War Rider flying by trista closes #5569 +UPDATE `creature_template` SET `inhabittype`=5,`speed_walk`=1, `speed_run`=1 WHERE `entry`=26813; + +-- Gretta the Arbiter (Storm Peaks, Brunhilldar) by mweinelt closes #5493 +-- Daily Quest Pooling +-- Source: http://www.wowwiki.com/Gretta_the_Arbiter +SET @pool_id := 354; + +DELETE FROM `pool_template` WHERE `entry` = @pool_id; +INSERT INTO `pool_template` (`entry`, `max_limit`, `description`) VALUES +(@pool_id, 1, 'Gretta the Arbiter - Daily Quests'); + +DELETE FROM `pool_quest` WHERE `entry` IN (13424, 13423, 13422, 13425); +INSERT INTO `pool_quest` (`entry`, `pool_entry`, `description`) VALUES +(13424, @pool_id, 'Back to the Pit'), +(13423, @pool_id, 'Defending Your Title'), +(13422, @pool_id, 'Maintaining Discipline'), +(13425, @pool_id, 'The Aberrations Must Die'); + +-- Pathing for Arzeth the Merciless Entry: 19354 by kiperr closes #5510 +SET @NPC := 69051; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-617.6182,`position_y`=4800.323,`position_z`=38.53064 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-546.5514,4799.893,33.83914,0,0,0,100,0), +(@PATH,2,-512.5808,4799.929,32.09928,0,0,0,100,0), +(@PATH,3,-480.9247,4799.97,28.25657,0,0,0,100,0), +(@PATH,4,-512.6269,4799.873,32.09928,0,0,0,100,0), +(@PATH,5,-542.1885,4799.724,33.71414,0,0,0,100,0), +(@PATH,6,-570.3811,4800.449,34.60215,0,0,0,100,0), +(@PATH,7,-592.3809,4800.299,35.85215,0,0,0,100,0), +(@PATH,8,-617.6182,4800.323,38.53064,0,0,0,100,0), +(@PATH,9,-659.4124,4799.819,49.09505,0,0,0,100,0), +(@PATH,10,-582.4199,4800.242,34.97715,0,0,0,100,0), +(@PATH,11,-546.5514,4799.893,33.83914,0,0,0,100,0), +(@PATH,12,-542.1885,4799.724,33.71414,0,0,0,100,0), +(@PATH,13,-570.3811,4800.449,34.60215,0,0,0,100,0), +(@PATH,14,-592.3809,4800.299,35.85215,0,0,0,100,0), +(@PATH,15,-617.6182,4800.323,38.53064,0,0,0,100,0), +(@PATH,16,-659.4124,4799.819,49.09505,0,0,0,100,0), +(@PATH,17,-512.5808,4799.929,32.09928,0,0,0,100,0), +(@PATH,18,-480.9247,4799.97,28.25657,0,0,0,100,0), +(@PATH,19,-512.6269,4799.873,32.09928,0,0,0,100,0), +(@PATH,20,-542.1885,4799.724,33.71414,0,0,0,100,0), +(@PATH,21,-570.3811,4800.449,34.60215,0,0,0,100,0), +(@PATH,22,-592.3809,4800.299,35.85215,0,0,0,100,0), +(@PATH,23,-617.6182,4800.323,38.53064,0,0,0,100,0), +(@PATH,24,-659.4124,4799.819,49.09505,0,0,0,100,0), +(@PATH,25,-582.4199,4800.242,34.97715,0,0,0,100,0), +(@PATH,26,-512.6269,4799.873,32.09928,0,0,0,100,0), +(@PATH,27,-542.1885,4799.724,33.71414,0,0,0,100,0), +(@PATH,28,-570.3811,4800.449,34.60215,0,0,0,100,0), +(@PATH,29,-592.3809,4800.299,35.85215,0,0,0,100,0), +(@PATH,30,-617.6182,4800.323,38.53064,0,0,0,100,0); + +-- Dark Portal - corrects the entry position and orientation by cdawg closes #5470 +UPDATE `areatrigger_teleport` SET `target_position_x`=-248.149292, `target_position_y`=921.874953, `target_position_z`=84.388448, `target_orientation`=1.584155 WHERE `id`=4354; + +-- Add pamphlets to mail loot by gecko32 closes #5408 +DELETE FROM `mail_loot_template` WHERE `entry` BETWEEN 224 AND 233; +INSERT INTO `mail_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES +(224, 46875, 100, 1, 0, 1, 1), -- Riding Training Pamphlet Elwynn Forest +(225, 46876, 100, 1, 0, 1, 1), -- Riding Training Pamphlet Darnassus +(226, 46877, 100, 1, 0, 1, 1), -- Riding Training Pamphlet Dun Morogh drawf +(227, 46879, 100, 1, 0, 1, 1), -- Riding Training Pamphlet Azuremyst Isle +(228, 46878, 100, 1, 0, 1, 1), -- Riding Training Pamphlet Dun Morogh gnome +(229, 46884, 100, 1, 0, 1, 1), -- Riding Training Pamphlet Mulgore +(230, 46883, 100, 1, 0, 1, 1), -- Riding Training Pamphlet Durator +(231, 46880, 100, 1, 0, 1, 1), -- Riding Training Pamphlet Orgrimmar +(232, 46882, 100, 1, 0, 1, 1), -- Riding Training Pamphlet Eversong Woods +(233, 46881, 100, 1, 0, 1, 1); -- Riding Training Pamphlet Tirisfal Glades + +-- fix coordinates for cannoneer whessan by mosoo closes #5406 +UPDATE `creature` SET `position_x`=-2093.53, `position_y`=-3496.47, `position_z`=130.084, `orientation`=3.008 WHERE `id`=3455 LIMIT 1; + +-- fix quest requirement for the last of her kind by shlomi 1515 closes #4875 +UPDATE `quest_template` SET `PrevQuestID` = 12900 WHERE `id` = 12983; + +-- Add rep reward to ICC25 Trash by gecko32 closes #5457 +DELETE FROM `creature_onkill_reputation` WHERE `creature_id` IN (37655,38031,38057,38058,38059,38061,38062,38063,38064,38072,38073,38074,38075,38076,38098,38099,38100,38101,38102,38103,38105,38108,38110,38126,38130,38131,38132,38133,38139,38151,38219,38220,38418,38445,38446,38479,38480,38481); +INSERT INTO `creature_onkill_reputation` (`creature_id`, `RewOnKillRepFaction1`, `RewOnKillRepFaction2`, `MaxStanding1`, `IsTeamAward1`, `RewOnKillRepValue1`, `MaxStanding2`, `IsTeamAward2`, `RewOnKillRepValue2`, `TeamDependent`) VALUES +(37655, 1156, 0, 7, 0, 45, 0, 0, 0, 0), -- Decaying colossus +(38031, 1156, 0, 7, 0, 45, 0, 0, 0, 0), -- Deathbound Ward +(38057, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Servant of the throne +(38058, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Nerub'ar Broodkeeper +(38059, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Ancient Skeletal Soldier +(38061, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- The Damned +(38062, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Plague Scientist +(38063, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Vengeful Fleshreaper +(38064, 1156, 0, 7, 0, 150, 0, 0, 0, 0), -- Stinky +(38072, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Deathspeacker Attedent +(38073, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Deathspeacker Disciple +(38074, 1156, 0, 7, 0, 45, 0, 0, 0, 0), -- Deathspeacker High Preist +(38075, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Deathspeacker Servant +(38076, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Deathspeacker Zealot +(38098, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Darkfallen Advisor +(38099, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Darkfallen Archmage +(38100, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Darkfallen Blood Knight +(38101, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Darkfallen Lieutenant +(38102, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Darkfallen Commander +(38103, 1156, 0, 7, 0, 150, 0, 0, 0, 0), -- Precious +(38105, 1156, 0, 7, 0, 2, 0, 0, 0, 0), -- Plagued Zombie +(38108, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Blighted Abomination +(38110, 1156, 0, 7, 0, 30, 0, 0, 0, 0), -- Pustulating Horror +(38126, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Ymirjar Frostbinder +(38130, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Ymirjar Deathbringer +(38131, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Ymirjar Huntress +(38132, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Ymirjar Battle-Maiden +(38133, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Ymirjar Warlord +(38139, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Frostwarden Handler +(38151, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Frostwing Whelp +(38219, 1156, 0, 7, 0, 150, 0, 0, 0, 0), -- Spinestalker +(38220, 1156, 0, 7, 0, 150, 0, 0, 0, 0), -- Rimefang +(38418, 1156, 0, 7, 0, 45, 0, 0, 0, 0), -- Val'kyr Herald +(38445, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Spire Minion +(38446, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Frenzied Abomination +(38479, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Darkfallen Tactician +(38480, 1156, 0, 7, 0, 15, 0, 0, 0, 0), -- Darkfallen Noble +(38481, 1156, 0, 7, 0, 15, 0, 0, 0, 0); -- Spire Gargoyle + +-- fix procs by warpten closes #4467 for +-- Needle-Encrusted Scorpion +DELETE FROM `spell_proc_event` WHERE `entry`=71404; +INSERT INTO `spell_proc_event` (`entry`,`SchoolMask`,`SpellFamilyName`,`SpellFamilyMask0`,`SpellFamilyMask1`,`SpellFamilyMask2`,`procFlags`,`procEx`,`ppmRate`,`CustomChance`,`Cooldown`) VALUES +(71404,0,0,0,0,0,0,2,0,0,50); + +-- Black Magic +DELETE FROM `spell_proc_event` WHERE `entry`=59630; +INSERT INTO `spell_proc_event` (`entry`,`SchoolMask`,`SpellFamilyName`,`SpellFamilyMask0`,`SpellFamilyMask1`,`SpellFamilyMask2`,`procFlags`,`procEx`,`ppmRate`,`CustomChance`,`Cooldown`) VALUES +(59630,0,0,0,0,0,0,0,0,0,35); + +-- Environment Creature Hight Update by shlomi1515 closes #4043 +UPDATE `creature` SET `position_z`=558.210022 WHERE `guid` IN (85141,85143,85154,85153,85142,85151,85152,85150); +UPDATE `creature` SET `position_z`=586.302 WHERE `guid` IN (85145,85144,85146); +UPDATE `creature` SET `position_z`=586.263 WHERE `guid` IN (85147,85148,85149); + +-- fix winterskorn raider not landing by nayd closes #3899 +UPDATE `creature_template` SET `InhabitType`=`InhabitType`|1 WHERE `entry`=23665; + +-- fix head of onyxia's loot closes by kandera #3851 +UPDATE `item_template` SET `flags` = flags|4096 WHERE `entry` IN (18422,18423,49644,49643); + +-- fix visual for plagued dragonsflayer tribesman by shlomi1515 closes #3518 +DELETE FROM `creature_addon` WHERE `guid` = 97540; diff --git a/sql/old/3.3.5a/2012_04_13_02_world_misc.sql b/sql/old/3.3.5a/2012_04_13_02_world_misc.sql new file mode 100644 index 00000000000..7c71af78cd7 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_13_02_world_misc.sql @@ -0,0 +1,18 @@ +UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry` IN (38308,38309,37824); -- Professor Putricide triggers +UPDATE `creature_template` SET `ScriptName`='npc_gas_cloud' WHERE `entry`=37562; -- Gas Cloud +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_putricide_ooze_summon'; +DELETE FROM `spell_target_position` WHERE `id` IN (71413,71414); +INSERT INTO `spell_target_position` (`id`,`target_map`,`target_position_x`,`target_position_y`,`target_position_z`,`target_orientation`) VALUES +(71414,631,4335.00,3206.75,389.399,0), +(71413,631,4380.43,3206.55,389.398,0); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (71615,71618,71412,71415); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`Comment`) VALUES +(13,4,71615,31,3,37690,'Putricide - Tear Gas on Slime Puddle'), +(13,1,71618,31,3,37562,'Putricide - Tear Gas on Gas Cloud'), +(13,2,71618,31,3,37697,'Putricide - Tear Gas on Volatile Ooze'), +(13,4,71618,31,3,38159,'Putricide - Tear Gas on Choking Gas Bomb'); + +UPDATE `spell_script_names` SET `ScriptName`='spell_putricide_clear_aura_effect_value' WHERE `ScriptName`='spell_putricide_clear_mutated_plague'; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(71620,'spell_putricide_clear_aura_effect_value'); diff --git a/sql/old/3.3.5a/2012_04_13_03_world_bg_template.sql b/sql/old/3.3.5a/2012_04_13_03_world_bg_template.sql new file mode 100644 index 00000000000..a426d7c6831 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_13_03_world_bg_template.sql @@ -0,0 +1,7 @@ +ALTER TABLE `battleground_template` ADD `StartMaxDist` float NOT NULL DEFAULT 0 AFTER `HordeStartO`; + +UPDATE `battleground_template` SET `StartMaxDist`=200 WHERE `id`=30; -- IC +UPDATE `battleground_template` SET `StartMaxDist`=100 WHERE `id`=1; -- AV +UPDATE `battleground_template` SET `StartMaxDist`=75 WHERE `id` IN (2,3,7); -- WSG, AB, EotS + +UPDATE `battleground_template` SET `MinLvl`=1 WHERE `id`=32; diff --git a/sql/old/3.3.5a/2012_04_13_04_world_spell_proc_event.sql b/sql/old/3.3.5a/2012_04_13_04_world_spell_proc_event.sql new file mode 100644 index 00000000000..3ea68187687 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_13_04_world_spell_proc_event.sql @@ -0,0 +1,4 @@ +-- Blackened Naaru Silver proc cooldown +DELETE FROM `spell_proc_event` WHERE `entry`=45355; +INSERT INTO `spell_proc_event`(`entry`,`schoolmask`,`spellfamilyname`,`spellfamilymask0`,`spellfamilymask1`,`spellfamilymask2`,`procflags`,`procex`,`ppmrate`,`customchance`,`cooldown`) VALUES +(45355,0,0,0,0,0,0,0,0,0,45); \ No newline at end of file diff --git a/sql/old/3.3.5a/2012_04_14_00_world_gameobject_loot_template.sql b/sql/old/3.3.5a/2012_04_14_00_world_gameobject_loot_template.sql new file mode 100644 index 00000000000..dea4b771068 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_14_00_world_gameobject_loot_template.sql @@ -0,0 +1,3 @@ +-- Add Bogblossom to this Bogblossom object for the druid quest (other one already contains it) +DELETE FROM `gameobject_loot_template` WHERE (`entry`=10961) AND (`item`=31950); +INSERT INTO `gameobject_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES (10961,31950,-100,0,0,1,1); diff --git a/sql/old/3.3.5a/2012_04_14_01_world_gameobject_loot_template.sql b/sql/old/3.3.5a/2012_04_14_01_world_gameobject_loot_template.sql new file mode 100644 index 00000000000..a3dd0c39865 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_14_01_world_gameobject_loot_template.sql @@ -0,0 +1,11 @@ +-- Add missing gameobject_loot_templates to prevent startup errors +DELETE FROM `gameobject_loot_template` WHERE `entry` IN (3458,3459,3460,3461,15920,16841,26878,27725); +INSERT INTO `gameobject_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(3458,4594,100,0,0,1,1), -- Rockscale Cod on Feast Fish +(3459,3771,100,0,0,1,1), -- Wild Hog Shank On Feast Boar +(3460,4538,100,0,0,1,1), -- Snapvine Watermelon on Feast Fruit +(3461,1708,100,0,0,1,1), -- Sweet Nectar on Feast Goblet +(15920,17822,-100,0,0,1,1), -- Weird Map on weird object +(16841,18950,-100,0,0,1,1), -- Chambermaid Pillaclenchers Pillow on Pillaclencher's Ornate Pillow +(26878,45062,100,0,0,1,1), -- Dusty Journal on Dusty Journal (different ID) +(27725,49648,100,0,0,1,1); -- Borrowed Tabard on Clean Laundry (might need condition!) diff --git a/sql/old/3.3.5a/2012_04_14_02_world_creature_template_addon.sql b/sql/old/3.3.5a/2012_04_14_02_world_creature_template_addon.sql new file mode 100644 index 00000000000..6aaa7da383e --- /dev/null +++ b/sql/old/3.3.5a/2012_04_14_02_world_creature_template_addon.sql @@ -0,0 +1,3 @@ +UPDATE `creature_template_addon` SET `auras`='50453' WHERE `entry`=28017; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=28017; +UPDATE `creature_template` SET `ainame` = '' WHERE `entry`=28017; \ No newline at end of file diff --git a/sql/old/3.3.5a/2012_04_14_03_world_spell_bonus_data.sql b/sql/old/3.3.5a/2012_04_14_03_world_spell_bonus_data.sql new file mode 100644 index 00000000000..ee081c17078 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_14_03_world_spell_bonus_data.sql @@ -0,0 +1 @@ +UPDATE `spell_bonus_data` SET `direct_bonus`=0.8930 WHERE `entry`=51505; diff --git a/sql/old/3.3.5a/2012_04_14_04_world_spell_proc_event.sql b/sql/old/3.3.5a/2012_04_14_04_world_spell_proc_event.sql new file mode 100644 index 00000000000..78a869e655a --- /dev/null +++ b/sql/old/3.3.5a/2012_04_14_04_world_spell_proc_event.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_proc_event` WHERE `entry`=53601; +INSERT INTO `spell_proc_event` (`entry`,`SchoolMask`,`SpellFamilyName`,`SpellFamilyMask0`,`SpellFamilyMask1`,`SpellFamilyMask2`,`procFlags`,`procEx`,`ppmRate`,`CustomChance`,`Cooldown`) VALUES +(53601, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0, 0, 6); diff --git a/sql/old/3.3.5a/2012_04_14_05_world_spell_proc_event.sql b/sql/old/3.3.5a/2012_04_14_05_world_spell_proc_event.sql new file mode 100644 index 00000000000..8cb2b1d3d2b --- /dev/null +++ b/sql/old/3.3.5a/2012_04_14_05_world_spell_proc_event.sql @@ -0,0 +1 @@ +DELETE FROM `spell_proc_event` WHERE `entry` IN (51486,51485,51483); diff --git a/sql/old/3.3.5a/2012_04_16_00_world_game_event.sql b/sql/old/3.3.5a/2012_04_16_00_world_game_event.sql new file mode 100644 index 00000000000..1dc3fe3ad91 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_16_00_world_game_event.sql @@ -0,0 +1,4 @@ +SET @Event = 26; -- Pilgrim's Bounty +DELETE FROM `game_event` WHERE `eventEntry`=@Event; +INSERT INTO `game_event` (`eventEntry`,`start_time`,`end_time`,`occurence`,`length`,`holiday`,`description`,`world_event`) VALUES +(@Event,'2012-11-18 01:00:00','2020-12-31 05:00:00',525600,10020,404,'Pilgrim\'s Bounty',0); diff --git a/sql/old/3.3.5a/2012_04_17_00_world_creature.sql b/sql/old/3.3.5a/2012_04_17_00_world_creature.sql new file mode 100644 index 00000000000..ebf0fb42a59 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_17_00_world_creature.sql @@ -0,0 +1,28 @@ +SET @GUID1 := 41781; +SET @GUID2 := 41783; + +DELETE FROM creature WHERE guid IN (@GUID1,@GUID2); +INSERT INTO `creature` +(`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`) +VALUES +(@GUID1 ,38453,571,1,1,3561.821,-2736.367,136.0317,0), -- Arcturis in Grizzly Hills +(@GUID2,35189,571,1,1,7101.845,-1443.734,924.2609,0.178631); -- Skoll in The Storm Peaks + +UPDATE `creature_template` SET `faction_A` = 190, `faction_H`=190 WHERE `entry` IN (38453,35189); + +SET @NPC= @GUID1*10; +-- Add pathing for Arcturis +DELETE FROM `creature_addon` WHERE `guid` = @GUID1; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(@GUID1,@NPC,0,0,0,0,''); -- Add path for Acturis +-- Add waypoint data for the path: +DELETE FROM `waypoint_data` WHERE `id`=@NPC; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`) VALUES +(@NPC,1,3563.499,-2737.698,137.1898), +(@NPC,2,3565.249,-2738.698,138.4398), +(@NPC,3,3566.749,-2739.948,139.9398), +(@NPC,4,3568.249,-2740.698,140.6898), +(@NPC,5,3567.839,-2741.380,141.9256), +(@NPC,6,3569.999,-2741.948,142.1898), +(@NPC,7,3570.749,-2742.448,143.1898), +(@NPC,8,3572.676,-2743.528,144.8479); diff --git a/sql/old/3.3.5a/2012_04_18_00_world_npc_spellclick_spells.sql b/sql/old/3.3.5a/2012_04_18_00_world_npc_spellclick_spells.sql new file mode 100644 index 00000000000..3bad860290b --- /dev/null +++ b/sql/old/3.3.5a/2012_04_18_00_world_npc_spellclick_spells.sql @@ -0,0 +1,2 @@ +UPDATE `npc_spellclick_spells` SET `spell_id`=57053 WHERE `npc_entry`=30066 AND `spell_id`=56678; +UPDATE `creature_template` SET `spell1`=55812 WHERE `entry`=30066; diff --git a/sql/old/3.3.5a/2012_04_18_01_world_creature.sql b/sql/old/3.3.5a/2012_04_18_01_world_creature.sql new file mode 100644 index 00000000000..e2d6bdac95b --- /dev/null +++ b/sql/old/3.3.5a/2012_04_18_01_world_creature.sql @@ -0,0 +1 @@ +UPDATE `creature` SET `spawntimesecs`=39600 WHERE `guid` IN (41781,41783); -- Set the spawntime to 11 hours for Arcturis & Skoll diff --git a/sql/old/3.3.5a/2012_04_18_02_world_reference_loot_template.sql b/sql/old/3.3.5a/2012_04_18_02_world_reference_loot_template.sql new file mode 100644 index 00000000000..4ed922060d9 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_18_02_world_reference_loot_template.sql @@ -0,0 +1,377 @@ +-- ---------------------- +-- -- Various Cleanups -- +-- ---------------------- +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=10 AND `SourceGroup`=34105; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=4 AND `SourceGroup` IN (27081,27085,27073,26963,26955); +DELETE FROM `reference_loot_template` WHERE `entry` IN (12020,12021,12022,34105,34125,34126,34127,34128,34129,34130); +DELETE FROM `gameobject_loot_template` WHERE `entry`=10961; -- Bad Bogblossom fix was bad +UPDATE `gameobject_template` SET `data1`=26956 WHERE `entry`=194315; +-- ------------------------------- +-- -- Variables and definitions -- +-- ------------------------------- +-- Freya 10 man +SET @Freya10k0ID := 194324; -- Freyas Gift 10man ALL elders alive +SET @Freya10k1ID := 194326; -- Freyas Gift 10man killed 1 elder +SET @Freya10k2ID := 194328; -- Freyas Gift 10man killed 2 elder +SET @Freya10k3ID := 194330; -- Freyas Gift 10man killed 3 elder +-- Freya 25 man +SET @Freya25k0ID := 194325; -- Freyas Gift 25man ALL elders alive +SET @Freya25k1ID := 194327; -- Freyas Gift 25man killed 1 elder +SET @Freya25k2ID := 194329; -- Freyas Gift 25man killed 2 elder +SET @Freya25k3ID := 194331; -- Freyas Gift 25man killed 3 elder +-- Hodir +SET @Hodir10nID := 194307; -- Cache of Winter 10man +SET @Hodir10hID := 194200; -- Rare Cache of Winter 10man +SET @Hodir25nID := 194308; -- Cache of Winter 25man +SET @Hodir25hID := 194201; -- Rare Cache of Winter 25man +-- Mimiron +SET @Mimiron10nID := 194789; -- Cache of Innovations 10man +SET @Mimiron25nID := 194956; -- Cache of Innovations 25man +SET @Mimiron10hID := 194957; -- Cache of Innovation 10 man Hardmode +SET @Mimiron25hID := 194958; -- Cache of Innovation 25 man Hardmode +-- Thorim +SET @Thorim10nID := 194312; -- Cache of Storms 10man +SET @Thorim10hID := 194313; -- Cache of Storms 10 man Hardmode +SET @Thorim25nID := 194314; -- Cache of Storms 25man +SET @Thorim25hID := 194315; -- Cache of Storms 25 man Hardmode + +-- Use procedure to get Lootid from data1 field and assign it to a variable +-- Freya 10 +CALL `sp_get_go_lootid`(@Freya10k0ID,@Freya10k0); +CALL `sp_get_go_lootid`(@Freya10k1ID,@Freya10k1); +CALL `sp_get_go_lootid`(@Freya10k2ID,@Freya10k2); +CALL `sp_get_go_lootid`(@Freya10k3ID,@Freya10k3); +-- Freya 25 +CALL `sp_get_go_lootid`(@Freya25k0ID,@Freya25k0); +CALL `sp_get_go_lootid`(@Freya25k1ID,@Freya25k1); +CALL `sp_get_go_lootid`(@Freya25k2ID,@Freya25k2); +CALL `sp_get_go_lootid`(@Freya25k3ID,@Freya25k3); +-- Hodir 10 +CALL `sp_get_go_lootid`(@Hodir10nID,@Hodir10n); +CALL `sp_get_go_lootid`(@Hodir10hID,@Hodir10h); +-- Hodir 25 +CALL `sp_get_go_lootid`(@Hodir25nID,@Hodir25n); +CALL `sp_get_go_lootid`(@Hodir25hID,@Hodir25h); +-- Mimiron +CALL `sp_get_go_lootid`(@Mimiron10nID,@Mimiron10n); +CALL `sp_get_go_lootid`(@Mimiron10hID,@Mimiron10h); +CALL `sp_get_go_lootid`(@Mimiron25nID,@Mimiron25n); +CALL `sp_get_go_lootid`(@Mimiron25hID,@Mimiron25h); +-- Thorim +CALL `sp_get_go_lootid`(@Thorim10nID,@Thorim10n); +CALL `sp_get_go_lootid`(@Thorim10hID,@Thorim10h); +CALL `sp_get_go_lootid`(@Thorim25nID,@Thorim25n); +CALL `sp_get_go_lootid`(@Thorim25hID,@Thorim25h); +-- Set References +SET @Freya10Ref := 34365; +SET @Freya25Ref := @Freya10Ref+1; +SET @Hodir10Ref := @Freya10Ref+2; +SET @Hodir25Ref := @Freya10Ref+3; +SET @Mimiron10Ref := @Freya10Ref+4; +SET @Mimiron25Ref := @Freya10Ref+5; +SET @Thorim10Ref := @Freya10Ref+6; +SET @Thorim25Ref := @Freya10Ref+7; +SET @HandToken := 12026; +SET @LegToken := @HandToken+1; +SET @LegsToken := @HandToken+2; +SET @ChestToken := @HandToken+3; +SET @HeadToken := @HandToken+4; +SET @GloveToken := @HandToken+5; +SET @ShoulderToken := @HandToken+6; +SET @HelmToken := @HandToken+7; +SET @Recipe := 34154; +-- ------------------------- +-- -- Reference Templates -- +-- ------------------------- +-- Delete previous templates if existing +DELETE FROM `reference_loot_template` WHERE `entry` BETWEEN @Freya10Ref AND @Freya10Ref+7; +DELETE FROM `reference_loot_template` WHERE `entry` BETWEEN @HandToken AND @HandToken+7; +INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- Freya 10 man +(@Freya10Ref,45934,0,1,1,1,1), -- Unraveling Reach +(@Freya10Ref,45935,0,1,1,1,1), -- Ironbark Faceguard +(@Freya10Ref,45941,0,1,1,1,1), -- Chestguard of the Lasher +(@Freya10Ref,45936,0,1,1,1,1), -- Legplates of Flourishing Resolve +(@Freya10Ref,45940,0,1,1,1,1), -- Tunic of the Limber Stalker +-- Freya 25 man +(@Freya25Ref,45483,0,1,1,1,1), -- Boots of the Servant +(@Freya25Ref,45482,0,1,1,1,1), -- Leggings of the Lifetender +(@Freya25Ref,45481,0,1,1,1,1), -- Gauntlets of Ruthless Reprisal +(@Freya25Ref,45480,0,1,1,1,1), -- Nymph Heart Charm +(@Freya25Ref,45479,0,1,1,1,1), -- The Lifebinder +-- Freya Tokens +(@HandToken,45644,0,1,1,1,1), -- Gloves of the Wayward Conqueror +(@HandToken,45645,0,1,1,1,1), -- Gloves of the Wayward Protector +(@HandToken,45646,0,1,1,1,1), -- Gloves of the Wayward Vanquisher +(@LegToken,45653,0,1,1,1,1), -- Legplates of the Wayward Conqueror +(@LegToken,45654,0,1,1,1,1), -- Legplates of the Wayward Protector +(@LegToken,45655,0,1,1,1,1), -- Legplates of the Wayward Vanquisher +-- Hodir 10 man +(@Hodir10Ref,45874,0,1,1,1,1), -- Signet of Winter +(@Hodir10Ref,45458,0,1,1,1,1), -- Stormedge +(@Hodir10Ref,45873,0,1,1,1,1), -- Winter's Frigid Embrace +(@Hodir10Ref,45872,0,1,1,1,1), -- Avalanche +(@Hodir10Ref,45454,0,1,1,1,1), -- Cowl of Icy Breaths +-- Hodir 25 man +(@Hodir25Ref,45452,0,1,1,1,1), -- Frostplate Greaves +(@Hodir25Ref,45454,0,1,1,1,1), -- Frost-Bound Chain Bracers +(@Hodir25Ref,45453,0,1,1,1,1), -- Winter's Icy Embrace +(@Hodir25Ref,45450,0,1,1,1,1), -- Northern Barrier +(@Hodir25Ref,45451,0,1,1,1,1), -- Frozen Loop +-- Hodir Tokens +(@LegsToken,45650,0,1,1,1,1), -- Leggings of the Wayward Conqueror +(@LegsToken,45651,0,1,1,1,1), -- Leggings of the Wayward Protector +(@LegsToken,45652,0,1,1,1,1), -- Leggings of the Wayward Vanquisher +(@ChestToken,45632,0,1,1,1,1), -- Breastplate of the Wayward Conqueror +(@ChestToken,45633,0,1,1,1,1), -- Breastplate of the Wayward Protector +(@ChestToken,45634,0,1,1,1,1), -- Breastplate of the Wayward Vanquisher +-- Mimiron 10 man +(@Mimiron10Ref,45974,0,1,1,1,1), -- Shoulderguards of Assimilation +(@Mimiron10Ref,45976,0,1,1,1,1), -- Static Charge Handwraps +(@Mimiron10Ref,45972,0,1,1,1,1), -- Pulse Baton +(@Mimiron10Ref,45973,0,1,1,1,1), -- Stylish Power Cape +(@Mimiron10Ref,45975,0,1,1,1,1), -- Cable of the Metrognome +-- Mimiron 25 man +(@Mimiron25Ref,45492,0,1,1,1,1), -- Malleable Steelweave Mantle +(@Mimiron25Ref,45493,0,1,1,1,1), -- Asimov's Drape +(@Mimiron25Ref,45490,0,1,1,1,1), -- Pandora's Plea +(@Mimiron25Ref,45491,0,1,1,1,1), -- Waistguard of the Creator +(@Mimiron25Ref,45489,0,1,1,1,1), -- Insanity's Grip +-- Mimiron Tokens +(@HeadToken,45647,0,1,1,1,1), -- Helm of the Wayward Conqueror +(@HeadToken,45648,0,1,1,1,1), -- Helm of the Wayward Protector +(@HeadToken,45649,0,1,1,1,1), -- Helm of the Wayward Vanquisher +(@GloveToken,45641,0,1,1,1,1), -- Gauntlets of the Wayward Conqueror +(@GloveToken,45642,0,1,1,1,1), -- Gauntlets of the Wayward Protector +(@GloveToken,45643,0,1,1,1,1), -- Gauntlets of the Wayward Vanquisher +-- Thorim 10 man +(@Thorim10Ref,45927,0,1,1,1,1), -- Handwraps of Resonance +(@Thorim10Ref,45894,0,1,1,1,1), -- Leggings of Unstable Discharge +(@Thorim10Ref,45895,0,1,1,1,1), -- Belt of the Blood Pit +(@Thorim10Ref,45893,0,1,1,1,1), -- Guise of the Midgard Serpent +(@Thorim10Ref,45892,0,1,1,1,1), -- Legacy of Thunder +-- Throim 25 man +(@Thorim25Ref,45468,0,1,1,1,1), -- Leggings of Lost Love +(@Thorim25Ref,45466,0,1,1,1,1), -- Scale of Fates +(@Thorim25Ref,45467,0,1,1,1,1), -- Belt of the Betrayed +(@Thorim25Ref,45469,0,1,1,1,1), -- Sif's Promise +(@Thorim25Ref,45463,0,1,1,1,1), -- Vulmir, the Northern Tempest +-- Thorim Tokens +(@ShoulderToken,45659,0,1,1,1,1), -- Spaulders of the Wayward Conqueror +(@ShoulderToken,45660,0,1,1,1,1), -- Spaulders of the Wayward Protector +(@ShoulderToken,45661,0,1,1,1,1), -- Spaulders of the Wayward Vanquisher +(@HelmToken,45638,0,1,1,1,1), -- Crown of the Wayward Conqueror +(@HelmToken,45639,0,1,1,1,1), -- Crown of the Wayward Protector +(@HelmToken,45640,0,1,1,1,1); -- Crown of the Wayward Vanquisher +-- ------------------------------- +-- -- Gameobject Loot Templates -- +-- ------------------------------- +-- Delete previous templates if existing +DELETE FROM `gameobject_loot_template` WHERE `entry` IN (@Freya10k3,@Freya10k2,@Freya10k1,@Freya10k0,@Freya25k3,@Freya25k2,@Freya25k1,@Freya25k0,@Hodir10n,@Hodir10h,@Hodir25n,@Hodir25h,@Mimiron10n,@Mimiron10h,@Mimiron25n,@Mimiron25h,@Thorim10n,@Thorim10h,@Thorim25n,@Thorim25h); +INSERT INTO `gameobject_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- ------------------ +-- -- Freya 10 man -- +-- ------------------ +-- Normal Mode: +(@Freya10k3,1,100,1,0,-@Freya10Ref,1), -- 1 from normal loot +(@Freya10k3,2,100,1,0,-@HandToken,1), -- 1 from tokens +(@Freya10k3,46110,100,1,0,1,1), -- Alchemist's Cache +(@Freya10k3,47241,100,1,0,1,1), -- 1x Emblem of Triumph +-- Hard Mode: 1 elder alive +(@Freya10k2,1,100,1,0,-@Freya10Ref,1), -- 1 from normal loot +(@Freya10k2,2,100,1,0,-@HandToken,1), -- 1 from tokens +(@Freya10k2,46110,100,1,0,1,1), -- Alchemist's Cache +(@Freya10k2,47241,100,1,0,2,2), -- 2x Emblem of Triumph +(@Freya10k2,45087,100,1,0,1,1), -- Runed Orb +(@Freya10k2,3,100,1,0,-34349,1), -- 1x Emblem of Triumph for Alive Elders +-- Hard Mode: 2 elders alive +(@Freya10k1,1,100,1,0,-@Freya10Ref,1), -- 1 from normal loot +(@Freya10k1,2,100,1,0,-@HandToken,1), -- 1 from tokens +(@Freya10k1,46110,100,1,0,1,1), -- Alchemist's Cache +(@Freya10k1,47241,100,1,0,3,3), -- 3x Emblem of Triumph +(@Freya10k1,45087,100,1,0,1,1), -- Runed Orb +(@Freya10k1,3,100,1,0,-@Recipe,1), -- 1 from Recipe +(@Freya10k1,4,100,1,0,-34349,2), -- 2x Emblem of Triumph for Alive Elders +-- Hard Mode: 3 elders alive +(@Freya10k0,1,100,1,0,-@Freya10Ref,1), -- 1 from normal loot +(@Freya10k0,2,100,1,0,-@HandToken,1), -- 1 from tokens +(@Freya10k0,46110,100,1,0,1,1), -- Alchemist's Cache +(@Freya10k0,47241,100,1,0,3,3), -- 3x Emblem of Triumph (self) +(@Freya10k0,45087,100,1,0,1,1), -- Runed Orb +(@Freya10k0,3,100,1,0,-@Recipe,1), -- 1 from Recipe +(@Freya10k0,45788,-100,1,0,1,1), -- Freya's Sigil 10 man QUEST ONLY +(@Freya10k0,4,100,1,0,-34349,1), -- 3x Emblem of Triumph for Alive Elders +-- 1 from Hardmode items: +(@Freya10k0,45943,0,1,1,1,1), -- Gloves of Whispering Winds +(@Freya10k0,45946,0,1,1,1,1), -- Fire Orchid Signet +(@Freya10k0,45945,0,1,1,1,1), -- Seed of Budding Carnage +(@Freya10k0,45947,0,1,1,1,1), -- Serilas, Blood Blade of Invar One-Arm +(@Freya10k0,45294,0,1,1,1,1), -- Petrified Ivy Sprig +-- ------------------ +-- -- Freya 25 man -- +-- ------------------ +-- Normal Mode: +(@Freya25k3,1,100,1,0,-@Freya25Ref,1), -- 1 from normal loot +(@Freya25k3,2,100,1,0,-@LegToken,2), -- 2 from tokens +(@Freya25k3,47241,100,1,0,1,1), -- 1x Emblem of Triumph +(@Freya25k3,46110,100,1,0,1,1), -- Alchemist's Cache +(@Freya25k3,3,10,1,0,-@Recipe,1), -- Chance on Recipe +(@Freya25k3,45087,10,1,0,1,1), -- Chance on Runed Orb +(@Freya25k3,45083,5,1,0,1,1), -- Fragment of Val'anyr +-- Hard Mode: 1 elder alive +(@Freya25k2,1,100,1,0,-@Freya25Ref,1), -- 1 from normal loot +(@Freya25k2,2,100,1,0,-@LegToken,2), -- 2 from tokens +(@Freya25k2,47241,100,1,0,2,2), -- 2x Emblem of Triumph +(@Freya25k2,46110,100,1,0,1,1), -- Alchemist's Cache +(@Freya25k2,3,10,1,0,-@Recipe,1), -- Chance on Recipe +(@Freya25k2,4,10,1,0,-34350,1), -- Chance on Runed Orb +(@Freya25k2,45087,100,1,0,2,2), -- 2x Runed Orb +(@Freya25k2,45083,7,1,0,1,1), -- Fragment of Val'anyr +(@Freya25k2,5,100,1,0,-34349,1), -- 1x Emblem of Triumph for Alive Elder +-- Hard Mode: 2 elders alive +(@Freya25k1,1,100,1,0,-@Freya25Ref,1), -- 1 from normal loot +(@Freya25k1,2,100,1,0,-@LegToken,2), -- 2 from tokens +(@Freya25k1,47241,100,1,0,3,3), -- 3x Emblem of Triumph +(@Freya25k1,46110,100,1,0,1,1), -- Alchemist's Cache +(@Freya25k1,3,10,1,0,-34350,1), -- Chance on Runed Orb +(@Freya25k1,45087,100,1,0,2,2), -- 2x Runed Orb +(@Freya25k1,4,100,1,0,-@Recipe,1), -- Recipe +(@Freya25k1,5,10,1,0,-@Recipe,1), -- Chance on Recipe +(@Freya25k1,45083,9,1,0,1,1), -- Fragment of Val'anyr +(@Freya25k1,6,100,1,0,-34349,2), -- 2x Emblem of Triumph for Alive Elder +-- Hard Mode: 3 elders alive +(@Freya25k0,1,100,1,0,-@Freya25Ref,1), -- 1 from normal loot +(@Freya25k0,2,100,1,0,-@LegToken,2), -- 2 from tokens +(@Freya25k0,47241,100,1,0,3,3), -- 3x Emblem of Triumph +(@Freya25k0,46110,100,1,0,1,1), -- Alchemist's Cache +(@Freya25k0,3,10,1,0,-34350,1), -- Chance on Runed Orb +(@Freya25k0,45087,100,1,0,2,2), -- 2x Runed Orb +(@Freya25k0,4,100,1,0,-@Recipe,1), -- Recipe +(@Freya25k0,5,10,1,0,-@Recipe,1), -- Chance on Recipe +(@Freya25k0,45814,-100,1,0,1,1), -- Freya's Sigil 25 man QUEST ONLY +(@Freya25k0,45083,20,1,0,1,1), -- Fragment of Val'anyr +(@Freya25k2,6,100,1,0,-34349,3), -- 3x Emblem of Triumph for Alive Elder +-- 1 from Hardmode items +(@Freya25k0,45484,0,1,1,1,1), -- Bladetwister +(@Freya25k0,45486,0,1,1,1,1), -- Drape of the Sullen Goddess +(@Freya25k0,45487,0,1,1,1,1), -- Handguards of Revitalization +(@Freya25k0,45488,0,1,1,1,1), -- Leggings of the Enslaved Idol +(@Freya25k0,45613,0,1,1,1,1), -- Dreambinder +(@Freya25k0,45485,0,1,1,1,1), -- Bronze Pendant of the Vanir +-- ------------------ +-- -- Hodir 10 man -- +-- ------------------ +(@Hodir10n,1,100,1,0,-@Hodir10Ref,1), -- 1x Normal Loot Item +(@Hodir10n,2,100,1,0,-@LegsToken,1), -- 1x Token +(@Hodir10n,47241,100,1,0,1,1), -- Emblem of Triumph +-- Hard mode: +(@Hodir10h,1,100,1,0,-@Hodir10Ref,1), -- 1x Normal Loot Item +(@Hodir10h,2,100,1,0,-@LegsToken,1), -- 1x Token +(@Hodir10h,47241,100,1,0,1,1), -- Emblem of Triumph +(@Hodir10h,45786,-100,1,0,1,1), -- Hodir's Sigil +-- 1 from Hardmode items +(@Hodir10h,45887,0,1,1,1,1), -- Ice Layered Barrier +(@Hodir10h,45888,0,1,1,1,1), -- Bitter Cold Armguards +(@Hodir10h,45886,0,1,1,1,1), -- Icecore Staff +(@Hodir10h,45876,0,1,1,1,1), -- Shiver +(@Hodir10h,45877,0,1,1,1,1), -- The Boreal Guard +-- ------------------ +-- -- Hodir 25 man -- +-- ------------------ +(@Hodir25n,1,100,1,0,-@Hodir25Ref,1), -- 1x Normal Loot Item +(@Hodir25n,2,100,1,0,-@ChestToken,1), -- 1x Token +(@Hodir25n,47241,100,1,0,1,1), -- Emblem of Triumph +(@Hodir25n,3,10,1,0,-@Recipe,1), -- Chance on Recipe +(@Hodir25n,45087,10,1,0,1,1), -- Chance on Runed Orb +(@Hodir25n,45083,10,1,0,1,1), -- Fragment of Val'anyr +-- Hard mode: +(@Hodir25h,1,100,1,0,-@Hodir25Ref,1), -- 1x Normal Loot Item +(@Hodir25h,2,100,1,0,-@ChestToken,2), -- 2x Token +(@Hodir25h,47241,100,1,0,1,1), -- Emblem of Triumph +(@Hodir25h,45815,-100,1,0,1,1), -- Hodir's Sigil +(@Hodir25h,3,10,1,0,-@Recipe,1), -- Chance on Recipe +(@Hodir25h,45087,10,1,0,1,1), -- Chance on Runed Orb +(@Hodir25h,45083,20,1,0,1,1), -- Fragment of Val'anyr +-- -------------------- +-- -- Mimiron 10 man -- +-- -------------------- +(@Mimiron10n,1,100,1,0,-@Mimiron10Ref,1), -- 1x Normal Loot Item +(@Mimiron10n,2,100,1,0,-@HeadToken,1), -- 1x Token +(@Mimiron10n,47241,100,1,0,1,1), -- 1x Emblem of Triumph +-- Hardmode 10 man +(@Mimiron10h,1,100,1,0,-@Mimiron10Ref,1), -- 1x Normal Loot Item +(@Mimiron10h,2,100,1,0,-@HeadToken,1), -- 1x Token +(@Mimiron10h,47241,100,1,0,1,1), -- 1x Emblem of Triumph +(@Mimiron10h,45787,-100,1,0,1,1), -- Mimiron's Sigel (QUEST ONLY, HARDMODE ONLY) +-- 1 from Hardmode items +(@Mimiron10h,45989,0,1,1,1,1), -- Tempered Mercury Greaves +(@Mimiron10h,45982,0,1,1,1,1), -- Fused Alloy Legplates +(@Mimiron10h,45993,0,1,1,1,1), -- Mimiron's Flight Goggles +(@Mimiron10h,45988,0,1,1,1,1), -- Greaves of the Iron Army +(@Mimiron10h,45990,0,1,1,1,1), -- Fusion Blade +-- -------------------- +-- -- Mimiron 25 man -- +-- -------------------- +(@Mimiron25n,1,100,1,0,-@Mimiron25Ref,1), -- 1x Normal Loot Item +(@Mimiron25n,2,100,1,0,-@GloveToken,2), -- 2x Token +(@Mimiron25n,47241,100,1,0,1,1), -- 1x Emblem of Triumph +(@Mimiron25n,3,10,1,0,-@Recipe,1), -- Chance on Recipe +(@Mimiron25n,45087,10,1,0,1,1), -- Chance on Runed Orb +(@Mimiron25n,45083,8,1,0,1,1), -- Fragment of Val'anyr Normal +-- Hard Mode 25 man +(@Mimiron25h,1,100,1,0,-@Mimiron25Ref,1), -- 1x Normal Loot Item +(@Mimiron25h,2,100,1,0,-@GloveToken,2), -- 2x Token +(@Mimiron25h,47241,100,1,0,1,1), -- 1x Emblem of Triumph +(@Mimiron25h,3,10,1,0,-@Recipe,1), -- Chance on Recipe +(@Mimiron25h,45087,10,1,0,1,1), -- Chance on Runed Orb +(@Mimiron25h,45816,-100,1,0,1,1), -- Mimiron's Sigel (QUEST ONLY, HARDMODE ONLY) +(@Mimiron25h,45083,18,1,0,1,1), -- Fragment of Val'anyr Hardmode +-- 1 from Hardmode items +(@Mimiron25h,45496,0,1,1,1,1), -- Titanskin Cloak +(@Mimiron25h,45494,0,1,1,1,1), -- Delirium's Touch +(@Mimiron25h,45663,0,1,1,1,1), -- Armbands of Bedlam +(@Mimiron25h,45620,0,1,1,1,1), -- Starshard Edge +(@Mimiron25h,45495,0,1,1,1,1), -- Conductive Seal +(@Mimiron25h,45497,0,1,1,1,1), -- Crown of Luminescence +-- ------------------- +-- -- Thorim 10 man -- +-- ------------------- +(@Thorim10n,1,100,1,0,-@Thorim10Ref,1), -- 1x Normal Loot Item +(@Thorim10n,2,100,1,0,-@ShoulderToken,1), -- 1x Token +(@Thorim10n,47241,100,1,0,1,1), -- 1x Emblem of Triumph +-- Hardmode 10 man +(@Thorim10h,1,100,1,0,-@Thorim10Ref,1), -- 1x Normal Loot Item +(@Thorim10h,2,100,1,0,-@ShoulderToken,1), -- 1x Token +(@Thorim10h,47241,100,1,0,1,1), -- 1x Emblem of Triumph +(@Thorim10h,45784,-100,2,0,1,1), -- Thorim's Sigil (QUEST ONLY, HARDMODE ONLY) +-- 1 from Hardmode items +(@Thorim10h,45933,0,2,1,1,1), -- Pendant of the Shallow Grave +(@Thorim10h,45929,0,2,1,1,1), -- Sif's Remembrance +(@Thorim10h,45928,0,2,1,1,1), -- Gauntlets of the Thunder God +(@Thorim10h,45931,0,2,1,1,1), -- Mjolnir Runestone +(@Thorim10h,45930,0,2,1,1,1), -- Combatant's Bootblade +-- ------------------- +-- -- Thorim 25 man -- +-- ------------------- +(@Thorim25n,1,100,3,0,-@Thorim25Ref,1), -- 1x Normal Loot Item +(@Thorim25n,2,100,3,0,-@HelmToken,2), -- 2x Token +(@Thorim25n,47241,100,3,0,1,1), -- 1x Emblem of Triumph +(@Thorim25n,3,10,3,0,-@Recipe,1), -- Chance on Recipe +(@Thorim25n,45087,10,3,0,1,1), -- Chance on Runed Orb +(@Thorim25n,45083,8,1,0,1,1), -- Fragment of Val'anyr Normal +-- Hardmode 25 man +(@Thorim25h,1,100,3,0,-@Thorim25Ref,1), -- 1x Normal Loot Item +(@Thorim25h,2,100,3,0,-@HelmToken,2), -- 2x Token +(@Thorim25h,47241,100,3,0,1,1), -- 1x Emblem of Triumph +(@Thorim25h,3,10,3,0,-@Recipe,1), -- Chance on Recipe +(@Thorim25h,45087,10,3,0,1,1), -- Chance on Runed Orb +(@Thorim25h,45817,-100,1,0,1,1), -- Thorim's Sigil (QUEST ONLY, HARDMODE ONLY) +(@Thorim25h,45083,18,1,0,1,1), -- Fragment of Val'anyr Hardmode +-- 1 from Hardmode items +(@Thorim25h,45471,0,1,1,1,1), -- Fate's Clutch +(@Thorim25h,45570,0,1,1,1,1), -- Skyforge Crossbow +(@Thorim25h,45472,0,1,1,1,1), -- Warhelm of the Champion +(@Thorim25h,45474,0,1,1,1,1), -- Pauldrons of the Combatant +(@Thorim25h,45470,0,1,1,1,1), -- Wisdom's Hold +(@Thorim25h,45473,0,1,1,1,1); -- Embrace of the Gladiator + diff --git a/sql/old/3.3.5a/2012_04_18_03_world_creature_loot_template.sql b/sql/old/3.3.5a/2012_04_18_03_world_creature_loot_template.sql new file mode 100644 index 00000000000..5ad26809cdf --- /dev/null +++ b/sql/old/3.3.5a/2012_04_18_03_world_creature_loot_template.sql @@ -0,0 +1,2 @@ +-- Increase dropchance for Venture Co. Explosives +UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=-10 WHERE `entry` IN(28123,28124) AND `item`=39651; diff --git a/sql/old/3.3.5a/2012_04_18_04_world_pickpocketing_loot_template.sql b/sql/old/3.3.5a/2012_04_18_04_world_pickpocketing_loot_template.sql new file mode 100644 index 00000000000..ab1c562f7dd --- /dev/null +++ b/sql/old/3.3.5a/2012_04_18_04_world_pickpocketing_loot_template.sql @@ -0,0 +1,501 @@ +-- implement missing Northrend pickpocket loot +-- reference IDs +SET @NEWREF0 := 10026; +SET @NEWREF1 := @NEWREF0+1; +SET @NEWREF2 := @NEWREF0+2; +SET @NEWREF3 := @NEWREF0+3; +SET @NEWREF4 := @NEWREF0+4; +SET @NEWREF5 := @NEWREF0+5; +SET @NEWREF6 := @NEWREF0+6; +SET @NEWREF7 := @NEWREF0+7; +SET @NEWREF8 := @NEWREF0+8; +SET @NEWREF9 := @NEWREF0+9; +-- new references +DELETE FROM `reference_loot_template` WHERE entry IN (@NEWREF0, @NEWREF1, @NEWREF2, @NEWREF3, @NEWREF4, @NEWREF5, @NEWREF6, @NEWREF7, @NEWREF8, @NEWREF9); +INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`mincountOrRef`,`maxcount`) VALUES +(@NEWREF0,33447,25,1,1),-- Runic Healing Potion +(@NEWREF0,35953,30,1,1),-- Mead Basted Caribou +(@NEWREF0,38260,50,1,1),-- Empty Tobacco Pouch +(@NEWREF0,43575,80,1,1),-- Reinforced Junkbox +(@NEWREF1,36862,4,1,1),-- Wrogn Troll Dice +(@NEWREF1,40202,20,1,1),-- Sizzling Grizzly Flank +(@NEWREF2,33452,30,1,1),-- Honey-Spiced Lichen +(@NEWREF2,38269,35,1,1),-- Soggy Handkerchief +(@NEWREF3,33454,15,1,1),-- Salted Venison +(@NEWREF3,38261,13,1,1),-- Ben House Key +(@NEWREF4,38263,19,1,1),-- Too-Small Amband +(@NEWREF4,38264,18,1,1),-- A Very Pretty Rock +(@NEWREF5,29448,9,1,1),-- Mag'har Mild Cheese +(@NEWREF5,29450,13,1,1),-- Telaari Grapes +(@NEWREF5,37467,40,1,1),-- A Steamy Romance Novel: Forbidden Love +(@NEWREF6,35947,25,1,1),-- Sparkling Frostcap +(@NEWREF6,38269,40,1,1),-- Soggy Handkerchief +(@NEWREF7,33447,25,1,1),-- Runic Healing Potion +(@NEWREF7,35947,25,1,1),-- Sparkling Frostcap +(@NEWREF7,38269,40,1,1),-- Soggy Handkerchief +(@NEWREF7,43575,80,1,1),-- Reinforced Junkbox +(@NEWREF8,35948,11,1,1),-- Savory Snowplum +(@NEWREF8,35950,9,1,1),-- Sweet Potato Bread +(@NEWREF8,35952,8,1,1),-- Briny Hardcheese +(@NEWREF9,33447,25,1,1),-- Runic Healing Potion +(@NEWREF9,38260,50,1,1),-- Empty Tobacco Pouch +(@NEWREF9,43575,80,1,1); -- Reinforced Junkbox +-- implement pickpokect loot +UPDATE `creature_template` SET `pickpocketloot`=entry WHERE `entry` IN (25800,23667,23674,23760,23796,23865,23875,23963,24069,24262,24400,24460,25351,25427,25428,25429,25430,25601,25801,26073,26202,26334,26413,26447,26480,26481,26620,26621,26624,26626,26635,26636,26637,26639,26658,26681,26696,26727,26729,26800,26802,26836,26948,27105,27210,27211,/**/27234,27235,27247,27278,27289,27334,27342,27431,27533,27580,27639,27640,27699,27800,27859,27860,27961,27964,27965,28494,28496,28565,28803,28837,28838,28848,28961,28965,29369,29407,29553,29554,29656,29793,29820,29822,29836,29874,29875,29885,29920,30283,30319,30856,30868,31396,31554,32263); +UPDATE `creature_template` SET `pickpocketloot`=25430 WHERE `entry` IN (23654,23656,23663,23665,25434,26728,26827,26926,27554,32572); +UPDATE `creature_template` SET `pickpocketloot`=26481 WHERE `entry` IN (23662,23940,24016,24161,26493,26655,27007,27009); +UPDATE `creature_template` SET `pickpocketloot`=25351 WHERE `entry` IN (23993,24540,25224,25383,26343,26492,26891,26946,27224,27226,27283,27360,27552,27799,27823,27826,28564,28750); +UPDATE `creature_template` SET `pickpocketloot`=27533 WHERE `entry` IN (26555,26669,26670,26694,26830,27871,28022,28108,28242,28268,28419,29123,29133,29722,29738,30701,30894,30922,30949,31139,31150,31779,31847,32278,32505); +UPDATE `creature_template` SET `pickpocketloot`=30319 WHERE `entry` IN (30111,30179); +DELETE FROM `pickpocketing_loot_template` WHERE entry IN (25800,23656,23662,23663,23665,23667,23674,23760,23796,23865,23875,23940,23963,23993,24016,24069,24161,24262,24400,24460,24540,25224,25351,25383,25427,25428,25429,25430,25434,25601,25801,26073,26202,26334,26343,26413,26447,26480,26481,26492,26493,26555,26620,26621,26624,26626,26635,26636,26637,26639,26655,26658,26669,26670,26681,26694,26696,26727,26728,26729,26800,26802,26827,26830,26836,26891,26926,26946,26948,27007,27009,27105,27210,27211,27224,27226,27234,27235,27247,27278,27283,27289,27334,27342,27360,27431,27533,27552,27554,27580,27639,27640,27699,27799,27800,27823,27826,27859,27860,27871,27961,27964,27965,28022,28108,28242,28268,28419,28494,28496,28564,28565,28750,28803,28837,28838,28848,28961,28965,29123,29133,29369,29407,29553,29554,29656,29722,29738,29793,29820,29822,29836,29874,29875,29885,29920,30111,30179,30283,30319,30701,30856,30868,30894,30922,30949,31139,31150,31396,31554,31779,31847,32263,32278,32505,32572); +INSERT INTO `pickpocketing_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- Plague Walker +(30283,43575,100,0,1,1),-- Reinforced Junkbox +(30283,0,100,0,-@NEWREF6,1), +-- Twilight Darkcaster +(30319,0,100,0,-@NEWREF0,1), +(30319,33449,11,0,1,1),-- Crusty Flatbread +(30319,1,100,0,-@NEWREF1,1), +(30319,2,100,0,-@NEWREF3,1), +-- High Priest Talet-Kha +(26073,43575,58,0,1,1),-- Reinforced Junkbox +(26073,0,100,0,-@NEWREF5,1), +(26073,33449,8,0,1,1),-- Crusty Flatbread +(26073,33447,8,0,1,1),-- Runic Healing Potion +-- Nedar, Lord of Rhinos +(25801,0,100,0,-@NEWREF5,1), +(25801,33447,6,0,1,1),-- Runic Healing Potion +(25801,38261,6,0,1,1),-- Bent House Key +-- Clam Master K +(25800,43575,47,0,1,1),-- Reinforced Junkbox +(25800,0,100,0,-@NEWREF5,1), +(25800,38261,15,0,1,1),-- Bent House Key +(25800,33449,5,0,1,1),-- Crusty Flatbread +(25800,33447,5,0,1,1),-- Runic Healing Potion +-- Magmothregar +(25430,0,100,0,-@NEWREF3,1), +(25430,1,100,0,-@NEWREF9,1), +(25430,33449,7,0,1,1),-- Crusty Flatbread +(25430,36862,4,0,1,1),-- Wrogn Troll Dice +-- Kaganishu +(25427,43575,43,0,1,1),-- Reinforced Junkbox +(25427,33454,35,0,1,1),-- Salted Venison +(25427,0,100,0,-@NEWREF4,1), +(25427,33447,8,0,1,1),-- Runic Healing Potion +-- Prince Valanar +(25601,43575,43,0,1,1),-- Reinforced Junkbox +(25601,37467,39,0,1,1),-- A Steamy Romance Novel: Forbidden Love +(25601,33447,9,0,1,1),-- Runic Healing Potion +(25601,38261,9,0,1,1),-- Bent House Key +(25601,33449,4,0,1,1),-- Crusty Flatbread +(25601,29450,4,0,1,1),-- Telaari Grapes +-- Ghostly Sage +(25351,43575,42,0,1,1),-- Reinforced Junkbox +(25351,0,100,0,-@NEWREF2,1), +(25351,33447,10,0,1,1),-- Runic Healing Potion +-- Luthion the Vile +(27860,43575,42,0,1,1),-- Reinforced Junkbox +(27860,0,100,0,-@NEWREF5,1), +(27860,38261,13,0,1,1),-- Bent House Key +(27860,33449,6,0,1,1),-- Crusty Flatbread +(27860,33447,6,0,1,1),-- Runic Healing Potion +-- Reckless Scavenger +(26658,0,100,0,-@NEWREF2,1), +(26658,43575,40,0,1,1),-- Reinforced Junkbox +-- Ziggurat Defender +(26202,43575,40,0,1,1),-- Reinforced Junkbox +(26202,0,100,0,-@NEWREF2,1), +(26202,33447,7,0,1,1),-- Runic Healing Potion +(26202,29569,3,0,1,1),-- Strong Junkbox +-- Magmoth Forager +(25429,43575,39,0,1,1),-- Reinforced Junkbox +(25429,33454,27,0,1,1),-- Salted Venison +(25429,0,100,0,-@NEWREF4,1), +(25429,33447,10,0,1,1),-- Runic Healing Potion +(25429,38266,0.5,0,1,1),-- Rotund Relic +-- Magmoth Shaman +(25428,43575,39,0,1,1),-- Reinforced Junkbox +(25428,33454,28,0,1,1),-- Salted Venison +(25428,0,100,0,-@NEWREF4,1), +(25428,33447,9,0,1,1),-- Runic Healing Potion +(25428,38266,0.5,0,1,1),-- Rotund Relic +-- Vanthryn the Merciless +(27859,43575,39,0,1,1),-- Reinforced Junkbox +(27859,0,100,0,-@NEWREF5,1), +(27859,33449,12,0,1,1),-- Crusty Flatbread +(27859,38261,12,0,1,1),-- Bent House Key +(27859,33447,3,0,1,1),-- Runic Healing Potion +-- Unbound Corrupter +(30868,43575,47,0,1,1),-- Reinforced Junkbox +(30868,40202,18,0,1,1),-- Sizzling Grizzly Flank +(30868,33447,16,0,1,1),-- Runic Healing Potion +(30868,0,100,0,-@NEWREF4,1), +-- Unbound Trickster +(30856,43575,38,0,1,1),-- Reinforced Junkbox +(30856,0,100,0,-@NEWREF4,1), +(30856,33447,19,0,1,1),-- Runic Healing Potion +(30856,40202,14,0,1,1),-- Sizzling Grizzly Flank +-- Kreug Oathbreaker +(27105,43575,63,0,1,1),-- Reinforced Junkbox +(27105,33447,25,0,1,1),-- Runic Healing Potion +(27105,38269,13,0,1,1),-- Soggy Handkerchief +-- Lead Cannoneer Zierhut +(27235,43575,53,0,1,1),-- Reinforced Junkbox +(27235,0,100,0,-@NEWREF5,1), +(27235,33447,8,0,1,1),-- Runic Healing Potion +(27235,38261,8,0,1,1),-- Bent House Key +-- Devout Bodyguard +(27247,43575,50,0,1,1),-- Reinforced Junkbox +(27247,37467,42,0,1,1),-- A Steamy Romance Novel: Forbidden Love +(27247,33447,8,0,1,1),-- Runic Healing Potion +(27247,29450,8,0,1,1),-- Telaari Grapes +(27247,38261,8,0,1,1),-- Bent House Key +-- Magnataur Alpha +(26481,0,100,0,-@NEWREF9,1), +(26481,1,100,0,-@NEWREF3,1), +(26481,33449,5,0,1,1),-- Crusty Flatbread +-- High General Abbendis +(27210,43575,48,0,1,1),-- Reinforced Junkbox +(27210,0,100,0,-@NEWREF5,1), +(27210,33449,10,0,1,1),-- Crusty Flatbread +(27210,33447,10,0,1,1),-- Runic Healing Potion +(27210,38261,8,0,1,1),-- Bent House Key +-- Anub'ar Dreadweaver +(26413,43575,44,0,1,1),-- Reinforced Junkbox +(26413,43576,22,0,1,1),-- Chitin Polish +(26413,33452,11,0,1,1),-- Honey-Spiced Lichen +(26413,33447,11,0,1,1),-- Runic Healing Potion +(26413,43577,11,0,1,1),-- Carapace Cleanser +-- Naxxramas Necrolord +(27289,33452,44,0,1,1),-- Honey-Spiced Lichen +(27289,43575,44,0,1,1),-- Reinforced Junkbox +(27289,33447,11,0,1,1),-- Runic Healing Potion +-- Onslaught Commander Iustus +(27334,37467,50,0,1,1),-- A Steamy Romance Novel: Forbidden Love +(27334,43575,44,0,1,1),-- Reinforced Junkbox +(27334,29448,13,0,1,1),-- Mag'har Mild Cheese +(27334,38261,6,0,1,1),-- Bent House Key +-- Blacksmith Goodman +(27234,43575,41,0,1,1),-- Reinforced Junkbox +(27234,0,100,0,-@NEWREF5,1), +(27234,38261,13,0,1,1),-- Bent House Key +(27234,33447,9,0,1,1),-- Runic Healing Potion +(27234,33449,7,0,1,1),-- Crusty Flatbread +-- Magnataur Youngling +(26480,33449,19,0,1,1),-- Crusty Flatbread +(26480,0,100,0,-@NEWREF3,1), +(26480,1,100,0,-@NEWREF9,1), +-- Bloodpaw Warrior +(27342,43575,40,0,1,1),-- Reinforced Junkbox +(27342,33454,26,0,1,1),-- Salted Venison +(27342,0,100,0,-@NEWREF4,1), +(27342,33447,11,0,1,1),-- Runic Healing Potion +(27342,38266,0.6,0,1,1),-- Rotund Relic +-- Frigid Geist +(27533,0,100,0,-@NEWREF7,1), +-- Snowplain Zealot +(27278,43575,40,0,1,1),-- Reinforced Junkbox +(27278,33454,22,0,1,1),-- Salted Venison +(27278,0,100,0,-@NEWREF4,1), +(27278,33447,12,0,1,1),-- Runic Healing Potion +(27278,38266,0.3,0,1,1),-- Rotund Relic +-- Hulking Atrocity +(26948,43575,39,0,1,1),-- Reinforced Junkbox +(26948,0,100,0,-@NEWREF2,1), +(26948,33447,9,0,1,1),-- Runic Healing Potion +(26948,29569,0.3,0,1,1),-- Strong Junkbox +(26948,38268,0.3,0,1,1),-- Spare Hand +-- Onslaught Executioner +(27211,43575,39,0,1,1),-- Reinforced Junkbox +(27211,0,100,0,-@NEWREF5,1), +(27211,33449,12,0,1,1),-- Crusty Flatbread +(27211,38261,11,0,1,1),-- Bent House Key +(27211,33447,5,0,1,1),-- Runic Healing Potion +-- Gigantaur +(26836,0,100,0,-@NEWREF9,1), +(26836,1,100,0,-@NEWREF3,1), +(26836,33449,12,0,1,1),-- Crusty Flatbread +-- Leprous Servant +(27800,43575,38,0,1,1),-- Reinforced Junkbox +(27800,0,100,0,-@NEWREF2,1), +(27800,33447,7,0,1,1),-- Runic Healing Potion +(27800,38268,2,0,1,1),-- Spare Hand +-- Wretched Belcher +(26624,43575,100,0,1,1),-- Reinforced Junkbox +(26624,0,100,0,-@NEWREF2,1), +(26624,33447,25,0,1,1),-- Runic Healing Potion +(26624,35947,25,0,1,1),-- Sparkling Frostcap +-- Drakkari Commander +(27431,43575,90,0,1,1),-- Reinforced Junkbox +(27431,0,100,0,-@NEWREF2,1), +(27431,33447,26,0,1,1),-- Runic Healing Potion +(27431,35947,10,0,1,1),-- Sparkling Frostcap +-- Drakkari Guardian +(26620,0,100,0,-@NEWREF0,1), +(26620,33454,17,0,1,1),-- Salted Venison +(26620,33449,9,0,1,1),-- Crusty Flatbread +(26620,38261,9,0,1,1),-- Bent House Key +(26620,1,100,0,-@NEWREF1,1), +-- Risen Drakkari Soulmage +(26636,43575,85,0,1,1),-- Reinforced Junkbox +(26636,0,100,0,-@NEWREF2,1), +(26636,35947,21,0,1,1),-- Sparkling Frostcap +(26636,33447,16,0,1,1),-- Runic Healing Potion +-- Ghoul Tormentor +(26621,43575,81,0,1,1),-- Reinforced Junkbox +(26621,0,100,0,-@NEWREF2,1), +(26621,35947,24,0,1,1),-- Sparkling Frostcap +(26621,33447,14,0,1,1),-- Runic Healing Potion +-- Risen Drakkari Warrior +(26635,43575,71,0,1,1),-- Reinforced Junkbox +(26635,0,100,0,-@NEWREF2,1), +(26635,33447,29,0,1,1),-- Runic Healing Potion +(26635,35947,18,0,1,1),-- Sparkling Frostcap +(26635,38268,0.8,0,1,1),-- Spare Hand +-- Risen Drakkari Handler +(26637,0,100,0,-@NEWREF2,1), +(26637,43575,67,0,1,1),-- Reinforced Junkbox +(26637,33447,30,0,1,1),-- Runic Healing Potion +(26637,35947,18,0,1,1),-- Sparkling Frostcap +-- Scourge Reanimator +(26626,0,100,0,-@NEWREF2,1), +(26626,43575,67,0,1,1),-- Reinforced Junkbox +(26626,33447,21,0,1,1),-- Runic Healing Potion +(26626,35947,21,0,1,1),-- Sparkling Frostcap +-- Drakkari Shaman +(26639,0,100,0,-@NEWREF0,1), +(26639,33449,18,0,1,1),-- Crusty Flatbread +(26639,1,100,0,-@NEWREF3,1), +(26639,40202,11,0,1,1),-- Sizzling Grizzly Flank +-- Selas +(27580,43575,50,0,1,1),-- Reinforced Junkbox +(27580,0,100,0,-@NEWREF3,1), +(27580,38260,20,0,1,1),-- Empty Tobacco Pouch +-- Forgemaster Damrath +(26334,43575,48,0,1,1),-- Reinforced Junkbox +(26334,0,100,0,-@NEWREF5,1), +(26334,33447,9,0,1,1),-- Runic Healing Potion +(26334,38261,9,0,1,1),-- Bent House Key +-- Grumbald One-Eye +(26681,43575,39,0,1,1),-- Reinforced Junkbox +(26681,33454,28,0,1,1),-- Salted Venison +(26681,0,100,0,-@NEWREF4,1), +(26681,33447,9,0,1,1),-- Runic Healing Potion +-- Drakkari Shaman +(26447,0,100,0,-@NEWREF9,1), +(26447,1,100,0,-@NEWREF3,1), +(26447,33449,10,0,1,1),-- Crusty Flatbread +(26447,35799,0.2,0,1,1),-- Frozen Mojo +(26447,36862,0.2,0,1,1),-- Wrogn Troll Dice +-- Drakkari God Hunter +(29820,0,100,0,-@NEWREF0,1), +(29820,1,100,0,-@NEWREF1,1), +-- Drakkari Battle Rider +(29836,0,100,0,-@NEWREF0,1), +(29836,40202,18,0,1,1),-- Sizzling Grizzly Flank +-- Ruins Dweller +(29920,43575,71,0,1,1),-- Reinforced Junkbox +(29920,37452,69,0,1,1),-- Fatty Bluefin +(29920,38274,58,0,1,1),-- Large Snail Shell +(29920,38273,35,0,1,1),-- Brain Coral +(29920,33447,16,0,1,1),-- Runic Healing Potion +-- Drakkari Fire Weaver +(29822,0,100,0,-@NEWREF0,1), +(29822,40202,24,0,1,1),-- Sizzling Grizzly Flank +-- Drakkari Inciter +(29874,0,100,0,-@NEWREF0,1), +(29874,36862,16,0,1,1),-- Wrogn Troll Dice +(29874,40202,12,0,1,1),-- Sizzling Grizzly Flank +-- Titanium Siegebreaker +(28961,0,100,0,-@NEWREF0,1), +(28961,40202,35,0,1,1),-- Sizzling Grizzly Flank +-- Stormforged Sentinel +(28837,0,100,0,-@NEWREF0,1), +(28837,40202,16,0,1,1),-- Sizzling Grizzly Flank +-- Titanium Thunderer +(28965,0,100,0,-@NEWREF0,1), +(28965,40202,44,0,1,1),-- Sizzling Grizzly Flank +-- Titanium Vanguard +(28838,0,100,0,-@NEWREF0,1), +(28838,40202,27,0,1,1),-- Sizzling Grizzly Flank +-- Dark Rune Scholar +(27964,0,100,0,-@NEWREF9,1), +(27964,1,100,0,-@NEWREF1,1), +-- Dark Rune Worker +(27961,0,100,0,-@NEWREF0,1), +(27961,40202,29,0,1,1),-- Sizzling Grizzly Flank +(27961,36862,4,0,1,1),-- Wrogn Troll Dice +-- Dark Rune Shaper +(27965,0,100,0,-@NEWREF0,1), +(27965,40202,28,0,1,1),-- Sizzling Grizzly Flank +-- Steel Gate Archaeologist +(24400,0,100,0,-@NEWREF0,1), +(24400,1,100,0,-@NEWREF5,1), +(24400,33449,7,0,1,1),-- Crusty Flatbread +(24400,38261,9,0,1,1),-- Bent House Key +-- Blacksouled Keeper +(23875,0,100,0,-@NEWREF0,1), +(23875,1,100,0,-@NEWREF3,1), +(23875,33449,14,0,1,1),-- Crusty Flatbread +-- Winterskorn Rune-Seer +(23667,0,100,0,-@NEWREF0,1), +(23667,33449,7,0,1,1),-- Crusty Flatbread +(23667,33454,7,0,1,1),-- Salted Venison +-- Sergeant Lorric +(23963,43575,45,0,1,1),-- Reinforced Junkbox +(23963,0,100,0,-@NEWREF5,1), +(23963,33447,13,0,1,1),-- Runic Healing Potion +(23963,38261,11,0,1,1),-- Bent House Key +(23963,33449,7,0,1,1),-- Crusty Flatbread +-- Gjalerhorn Scavenger +(27699,0,100,0,-@NEWREF4,1), +(27699,43575,43,0,1,1),-- Reinforced Junkbox +(27699,33454,22,0,1,1),-- Salted Venison +(27699,33447,7,0,1,1),-- Runic Healing Potion +(27699,29569,0.8,0,1,1),-- Strong Junkbox +-- Iron Rune Binder +(23796,0,100,0,-@NEWREF5,1), +(23796,43575,42,0,1,1),-- Reinforced Junkbox +(23796,38261,12,0,1,1),-- Bent House Key +(23796,33449,11,0,1,1),-- Crusty Flatbread +(23796,33447,9,0,1,1),-- Runic Healing Potion +(23796,29569,0.5,0,1,1),-- Strong Junkbox +-- Forsaken Plaguebringer +(23760,0,100,0,-@NEWREF2,1), +(23760,43575,41,0,1,1),-- Reinforced Junkbox +(23760,33447,10,0,1,1),-- Runic Healing Potion +(23760,38268,0.3,0,1,1),-- Spare Hand +-- Chillmere Tidehunter +(24460,43575,40,0,1,1),-- Reinforced Junkbox +(24460,38274,33,0,1,1),-- Large Snail Shell +(24460,37452,18,0,1,1),-- Fatty Bluefin +(24460,38273,15,0,1,1),-- Brain Coral +(24460,33447,7,0,1,1),-- Runic Healing Potion +-- Vrykul Soul +(24262,0,100,0,-@NEWREF2,1), +(24262,43575,40,0,1,1),-- Reinforced Junkbox +(24262,33447,3,0,1,1),-- Runic Healing Potion +-- Iron Rune Sage +(23674,0,100,0,-@NEWREF5,1), +(23674,43575,39,0,1,1),-- Reinforced Junkbox +(23674,38261,13,0,1,1),-- Bent House Key +(23674,33449,9,0,1,1),-- Crusty Flatbread +(23674,33447,6,0,1,1),-- Runic Healing Potion +-- Vengeance Bringer +(23865,43575,39,0,1,1),-- Reinforced Junkbox +(23865,0,100,0,-@NEWREF2,1), +-- Restless Lookout +(31554,43575,80,0,1,1),-- Reinforced Junkbox +(31554,35947,40,0,1,1),-- Sparkling Frostcap +-- Val'kyr Taskmistress +(31396,43575,56,0,1,1),-- Reinforced Junkbox +(31396,35947,38,0,1,1),-- Sparkling Frostcap +(31396,33447,15,0,1,1),-- Runic Healing Potion +-- Overseer Veraj +(32263,43575,42,0,1,1),-- Reinforced Junkbox +(32263,37467,28,0,1,1),-- A Steamy Romance Novel: Forbidden Love +(32263,38261,15,0,1,1),-- Bent House Key +(32263,33447,13,0,1,1),-- Runic Healing Potion +(32263,0,100,0,-@NEWREF8,1), +-- Steward +(26729,0,100,0,-@NEWREF0,1), +(26729,1,100,0,-@NEWREF3,1), +(26729,33449,31,0,1,1),-- Crusty Flatbread +(26729,29569,0.5,0,1,1),-- Strong Junkbox +-- Alliance Berserker +(26800,43575,62,0,1,1),-- Reinforced Junkbox +(26800,33449,19,0,1,1),-- Crusty Flatbread +(26800,38261,16,0,1,1),-- Bent House Key +(26800,33447,10,0,1,1),-- Runic Healing Potion +(26800,0,100,0,-@NEWREF5,1), +-- Alliance Ranger +(26802,0,100,0,-@NEWREF5,1), +(26802,43575,60,0,1,1),-- Reinforced Junkbox +(26802,38261,34,0,1,1),-- Bent House Key +(26802,33449,24,0,1,1),-- Crusty Flatbread +(26802,33447,12,0,1,1),-- Runic Healing Potion +-- Mage Hunter Ascendant +(26727,0,100,0,-@NEWREF0,1), +(26727,1,100,0,-@NEWREF3,1), +(26727,33449,29,0,1,1),-- Crusty Flatbread +-- Ring-Lord Sorceress +(27639,43575,87,0,1,1),-- Reinforced Junkbox +(27639,37467,46,0,1,1),-- A Steamy Romance Novel: Forbidden Love +(27639,38261,28,0,1,1),-- Bent House Key +(27639,33447,19,0,1,1),-- Runic Healing Potion +(27639,0,100,0,-@NEWREF8,1), +(27639,36863,1.6,0,1,1),-- Decahedral Dwarven Dice +-- Ring-Lord Conjurer +(27640,37467,67,0,1,1),-- A Steamy Romance Novel: Forbidden Love +(27640,43575,64,0,1,1),-- Reinforced Junkbox +(27640,33447,30,0,1,1),-- Runic Healing Potion +(27640,38261,26,0,1,1),-- Bent House Key +(27640,0,100,0,-@NEWREF8,1), +-- Mildred the Cruel +(29885,0,100,0,-@NEWREF0,1), +(29885,40202,13,0,1,1),-- Sizzling Grizzly Flank +-- Snowblind Devotee +(29407,43575,42,0,1,1),-- Reinforced Junkbox +(29407,40202,29,0,1,1),-- Sizzling Grizzly Flank +(29407,0,100,0,-@NEWREF4,1), +(29407,33447,12,0,1,1),-- Runic Healing Potion +-- Snowblind Devotee +(29554,43575,43,0,1,1),-- Reinforced Junkbox +(29554,40202,27,0,1,1),-- Sizzling Grizzly Flank +(29554,0,100,0,-@NEWREF4,1), +(29554,33447,12,0,1,1),-- Runic Healing Potion +(29554,38266,0.2,0,1,1),-- Rotund Relic +-- Frostfeather Witch +(29793,43575,40,0,1,1),-- Reinforced Junkbox +(29793,40202,21,0,1,1),-- Sizzling Grizzly Flank +(29793,0,100,0,-@NEWREF4,1), +(29793,33447,16,0,1,1),-- Runic Healing Potion +-- Icemane Yeti +(29875,43575,39,0,1,1),-- Reinforced Junkbox +(29875,40202,23,0,1,1),-- Sizzling Grizzly Flank +(29875,0,100,0,-@NEWREF4,1), +(29875,33447,15,0,1,1),-- Runic Healing Potion +(29875,38266,0.3,0,1,1),-- Rotund Relic +-- Garm Watcher +(29553,0,100,0,-@NEWREF0,1), +(29553,1,100,0,-@NEWREF1,1), +(29553,24231,0.3,0,2,2),-- Coarse Snuff +-- Stormforged Taskmaster +(29369,43575,38,0,1,1),-- Reinforced Junkbox +(29369,37467,34,0,1,1),-- A Steamy Romance Novel: Forbidden Love +(29369,33447,13,0,1,1),-- Runic Healing Potion +(29369,38261,6,0,1,1),-- Bent House Key +(29369,0,100,0,-@NEWREF8,1), +-- Dragonflayer Bonecrusher +(24069,0,100,0,-@NEWREF0,1), +(24069,1,100,0,-@NEWREF1,1), +(24069,29569,47,0,1,1),-- Strong Junkbox +(24069,29570,34,0,1,1),-- A Gnome Effigy +(24069,27855,22,0,1,1),-- Mag'har Grainbread +(24069,27854,19,0,1,1),-- Smoked Talbuk Venison +(24069,22829,10,0,1,1),-- Super Healing Potion +(24069,23438,1.2,0,1,1),-- Star of Elune +-- Ymirjar Berserker +(26696,0,100,0,-@NEWREF7,1), +(26696,29569,1.1,0,1,1),-- Strong Junkbox +-- Kutube'sa +(28494,0,100,0,-@NEWREF0,1), +(28494,1,100,0,-@NEWREF1,1), +-- Chulo the Mad +(28496,0,100,0,-@NEWREF0,1), +(28496,40202,6,0,1,1),-- Sizzling Grizzly Flank +-- Drakuru's Guard +(28803,43575,50,0,1,1),-- Reinforced Junkbox +(28803,33447,33,0,1,1),-- Runic Healing Potion +(28803,38269,17,0,1,1),-- Soggy Handkerchief +-- Prophet of Har'koa +(28848,0,100,0,-@NEWREF0,1), +(28848,40202,3,0,1,1),-- Sizzling Grizzly Flank +-- Decaying Ghoul +(28565,0,100,0,-@NEWREF7,1), +(28565,22829,0.9,0,1,1),-- Super Healing Potion +-- Drakuru Berserker +(29656,0,100,0,-@NEWREF0,1), +(29656,1,100,0,-@NEWREF3,1), +(29656,33449,11,0,1,1),-- Crusty Flatbread +(29656,29569,0.9,0,1,1); -- Strong Junkbox diff --git a/sql/old/3.3.5a/2012_04_18_05_world_conditions.sql b/sql/old/3.3.5a/2012_04_18_05_world_conditions.sql new file mode 100644 index 00000000000..ecf80f270a3 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_18_05_world_conditions.sql @@ -0,0 +1,4 @@ +-- Add condition to the Lovely Charm aura +DELETE FROM conditions WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry`= 69511; +INSERT INTO conditions (SourceTypeOrReferenceId, SourceGroup, SourceEntry, ElseGroup, ConditionTypeOrReference, ConditionValue1, ConditionValue2, ConditionValue3, ErrorTextId, ScriptName, COMMENT) VALUES +(17,0,69511,0,12,8,0,0,0, '', 'Lovely Charm - Only during event'); diff --git a/sql/old/3.3.5a/2012_04_18_06_world_creature_template.sql b/sql/old/3.3.5a/2012_04_18_06_world_creature_template.sql new file mode 100644 index 00000000000..8c167c2ffa1 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_18_06_world_creature_template.sql @@ -0,0 +1,2 @@ +-- Remove Skinning loot from Blackwing Spellbinder +UPDATE `creature_template` SET `skinloot`=0 WHERE `entry`=12457; diff --git a/sql/old/3.3.5a/2012_04_18_07_world_fishing_loot_template.sql b/sql/old/3.3.5a/2012_04_18_07_world_fishing_loot_template.sql new file mode 100644 index 00000000000..6c39cc95b48 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_18_07_world_fishing_loot_template.sql @@ -0,0 +1,2 @@ +-- update wrong area. +UPDATE `fishing_loot_template` SET `entry`=4560 WHERE `entry`=4395 AND `item`=11026; diff --git a/sql/old/3.3.5a/2012_04_18_08_world_creature_loot_template.sql b/sql/old/3.3.5a/2012_04_18_08_world_creature_loot_template.sql new file mode 100644 index 00000000000..4b00685ed55 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_18_08_world_creature_loot_template.sql @@ -0,0 +1,22 @@ +-- Add loot for Hrothgar's Landing +DELETE FROM `creature_loot_template` WHERE `entry` IN (34980,34838,34839,34965); +INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- AURIAYA 10-man +-- Drottinn Hrothgar - http://old.wowhead.com/npc=34980 +(34980,46859,-100,1,0,1,1), -- Stolen Tallstrider Leg +-- Kvaldir Reaver +(34838,46859,-100,1,0,1,1), -- Stolen Tallstrider Leg +(34838,49676,5,1,0,1,1), -- Kvaldir Attack Plans +(34838,33470,35,1,0,1,4), -- 1-4x Frostweave Cloth +(34838,1,10,1,0,-24727,1), -- 1 of Northrend scrolls +(34838,2,10,1,0,-26002,1), -- Northrend Grey Item Reference1 +(34838,3,2,1,0,-35080,1), -- Northrend Green Item Reference +-- Kvaldir Mist Binder +(34839,46859,-100,1,0,1,1), -- Stolen Tallstrider Leg +(34839,49676,5,1,0,1,1), -- Kvaldir Attack Plans +(34839,33470,35,1,0,1,4), -- 1-4x Frostweave Cloth +(34839,1,10,1,0,-24727,1), -- 1 of Northrend scrolls +(34839,2,10,1,0,-26002,1), -- Northrend Grey Item Reference1 +(34839,3, 2,1,0,-35080,1), -- Northrend Green Item Reference +-- Mistcaller Yngvar +(34965,46859,-100,1,0,1,1); -- Stolen Tallstrider Leg diff --git a/sql/old/3.3.5a/2012_04_19_00_world_creature_template.sql b/sql/old/3.3.5a/2012_04_19_00_world_creature_template.sql new file mode 100644 index 00000000000..e9abd40095e --- /dev/null +++ b/sql/old/3.3.5a/2012_04_19_00_world_creature_template.sql @@ -0,0 +1,7 @@ +-- update Plague Slime & Marauding Geist to naxx25 trash lootid +UPDATE `creature_template` SET `lootid`=100005 WHERE `entry` IN(29575,30424); +-- update Plague Slime & Marauding Geist to naxx10 trash lootid +UPDATE `creature_template` SET `lootid`=100003 WHERE `entry` IN(16243,30083); +DELETE FROM `creature_loot_template` WHERE `entry` IN(30424,29575,16243,30083); +-- Remove scraps for naxx10 from creature creature_loot_template +DELETE FROM `creature_loot_template` WHERE `item` IN (22373,22374,22375,22376); diff --git a/sql/old/3.3.5a/2012_04_19_01_world_pickpocketing_loot_template.sql b/sql/old/3.3.5a/2012_04_19_01_world_pickpocketing_loot_template.sql new file mode 100644 index 00000000000..997b16ff65d --- /dev/null +++ b/sql/old/3.3.5a/2012_04_19_01_world_pickpocketing_loot_template.sql @@ -0,0 +1,202 @@ +-- Fix to add pickpocketing loot for humoniods in borean tundra +SET @GORLOCREF := 25100; +SET @BERYLREF := @GORLOCREF+1; +SET @BLOODREF := @GORLOCREF+2; +SET @CHIEFREF := @GORLOCREF+3; +SET @CULTREF := @GORLOCREF+4; +SET @KVALDIRREF := @GORLOCREF+5; +SET @CLAXREF := @GORLOCREF+6; +SET @MAGMOTHREF := @GORLOCREF+7; +-- Create reference templates +DELETE FROM `reference_loot_template` WHERE `entry` BETWEEN @GORLOCREF AND @GORLOCREF+7; +INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(@GORLOCREF,29576,57,1,0,1,1), -- Shark Bait +(@GORLOCREF,29569,30,1,0,1,1), -- Strong Junkbox +(@GORLOCREF,27858,8,1,0,1,1), -- Sunspring Carp +(@GORLOCREF,22829,3,1,0,1,1), -- Super Healing Potion +(@GORLOCREF,23436,0.5,1,0,1,1), -- Living Ruby +(@GORLOCREF,23437,0.5,1,0,1,1), -- Talasite +(@GORLOCREF,23440,0.5,1,0,1,1), -- Dawnstone +(@GORLOCREF,23438,0.5,1,0,1,1), -- Star of Elune +(@GORLOCREF,23439,0.5,1,0,1,1), -- Noble Topaz +-- -------------------------------------------------- +(@BERYLREF,37467,32.5,1,0,1,1), -- A Steamy Romance Novel: Forbidden Love +(@BERYLREF,43575,31,1,0,1,1), -- Reinforced Junkbox +(@BERYLREF,38261,10,1,0,1,1), -- Bent House Key +(@BERYLREF,29448,7,1,0,1,1), -- Mag'har Mild Cheese +(@BERYLREF,29450,7,1,0,1,1), -- Telaari Grapes +(@BERYLREF,33447,6,1,0,1,1), -- Runic Healing Potion +(@BERYLREF,33449,6,1,0,1,1), -- Crusty Flatbread +(@BERYLREF,36863,0.5,1,0,1,1), -- Decahedral Dwarven Dice +-- -------------------------------------------------- +(@BLOODREF,29572,37,1,0,1,1), -- Aboriginal Carvings +(@BLOODREF,29569,33,1,0,1,1), -- Strong Junkbox +(@BLOODREF,8952,20,1,0,1,1), -- Roasted Quail +(@BLOODREF,22829,8,1,0,1,1), -- Super Healing Potion +(@BLOODREF,23438,0.5,1,0,1,1), -- Star of Elune +(@BLOODREF,23436,0.5,1,0,1,1), -- Living Ruby +(@BLOODREF,23441,0.5,1,0,1,1), -- Nightseye +(@BLOODREF,23437,0.5,1,0,1,1), -- Talasite +(@BLOODREF,23440,0.5,1,0,1,1), -- Dawnstone +-- -------------------------------------------------- +(@CHIEFREF,29569,50,1,0,1,1), -- Strong Junkbox +(@CHIEFREF,27858,20,1,0,1,1), -- Sunspring Carp +(@CHIEFREF,29576,20,1,0,1,1), -- Shark Bait +(@CHIEFREF,22829,10,1,0,1,1), -- Super Healing Potion +-- -------------------------------------------------- +(@CULTREF,29569,40,1,0,1,1), -- Strong Junkbox +(@CULTREF,29571,37,1,0,1,1), -- A Steamy Romance Novel +(@CULTREF,30458,8,1,0,1,1), -- Stromgarde Muenster +(@CULTREF,27855,7,1,0,1,1), -- Mag'har Grainbread +(@CULTREF,27856,6,1,0,1,1), -- Skethyl Berries +(@CULTREF,22829,2,1,0,1,1), -- Super Healing Potion +(@CULTREF,36863,0.5,1,0,1,1), -- Decahedral Dwarven Dice +-- -------------------------------------------------- +(@KVALDIRREF,29569,39,1,0,1,1), -- Strong Junkbox +(@KVALDIRREF,29570,28,1,0,1,1), -- A Gnome Effigy +(@KVALDIRREF,27855,12,1,0,1,1), -- Mag'har Grainbread +(@KVALDIRREF,27854,12,1,0,1,1), -- Smoked Talbuk Venison +(@KVALDIRREF,22829,7,1,0,1,1), -- Super Healing Potion +(@KVALDIRREF,23436,0.5,1,0,1,1), -- Living Ruby +(@KVALDIRREF,23441,0.5,1,0,1,1), -- Nightseye +(@KVALDIRREF,23440,0.5,1,0,1,1), -- Dawnstone +(@KVALDIRREF,23439,0.5,1,0,1,1), -- Noble Topaz +(@KVALDIRREF,23437,0.5,1,0,1,1), -- Talasite +-- -------------------------------------------------- +(@CLAXREF,43575,28,1,0,1,1), -- Reinforced Junkbox +(@CLAXREF,38273,26,1,0,1,1), -- Brain Coral +(@CLAXREF,38274,23,1,0,1,1), -- Large Snail Shell +(@CLAXREF,37452,17,1,0,1,1), -- Fatty Bluefin +(@CLAXREF,33447,6,1,0,1,1), -- Runic Healing Potion +-- -------------------------------------------------- +(@MAGMOTHREF,38260,33,1,0,1,1), -- Empty Tobacco Pouch +(@MAGMOTHREF,38261,21,1,0,1,1), -- Bent House Key +(@MAGMOTHREF,33449,16,1,0,1,1), -- Crusty Flatbread +(@MAGMOTHREF,43575,16,1,0,1,1), -- Reinforced Junkbox +(@MAGMOTHREF,33454,9,1,0,1,1), -- Salted Venison +(@MAGMOTHREF,33447,5,1,0,1,1), -- Runic Healing Potion +(@MAGMOTHREF,36862,1,1,0,1,1); -- Worn Troll Dice +-- ------------------- +-- -- NPC Variables -- +-- ------------------- +SET @NPC := 25686; +SET @NPC1 := 25700; +SET @NPC2 := 25687; +SET @NPC3 := 25685; +SET @NPC4 := 25449; +SET @NPC5 := 25316; +SET @NPC6 := 25353; +SET @NPC7 := 25719; +SET @NPC8 := 25804; +SET @NPC9 := 25392; +SET @NPC10 := 25651; +SET @NPC11 := 25836; +SET @NPC12 := 25979; +SET @NPC13 := 25806; +SET @NPC14 := 25720; +SET @NPC15 := 25803; +SET @NPC16 := 25880; +SET @NPC17 := 25618; +SET @NPC18 := 25839; +SET @NPC19 := 25470; +SET @NPC20 := 24567; +SET @NPC21 := 25467; +SET @NPC22 := 25468; +SET @NPC23 := 25501; +SET @NPC24 := 25726; +SET @NPC25 := 25701; +SET @NPC26 := 25725; +SET @NPC27 := 25699; +SET @NPC28 := 24576; +SET @NPC29 := 25605; +SET @NPC30 := 25609; +SET @NPC31 := 25378; +SET @NPC32 := 25843; +SET @NPC33 := 25496; +SET @NPC34 := 25479; +SET @NPC35 := 25760; +SET @NPC36 := 26266; +SET @NPC37 := 26451; +SET @NPC38 := 25521; +SET @NPC39 := 25613; +SET @NPC40 := 25522; +SET @NPC41 := 25520; +SET @NPC42 := 25209; +SET @NPC43 := 25210; +SET @NPC44 := 25216; +SET @NPC45 := 25215; +SET @NPC46 := 25217; +SET @NPC47 := 25789; +SET @NPC48 := 24469; +SET @NPC49 := 25432; +SET @NPC50 := 25433; +SET @NPC51 := 25615; +SET @NPC52 := 25523; +-- ---------------------- +-- -- Assign the loots -- +-- ---------------------- +UPDATE `creature_template` SET `pickpocketloot`=`entry` WHERE `entry` IN (@NPC,@NPC1,@NPC2,@NPC3,@NPC4,@NPC5,@NPC6,@NPC7,@NPC8,@NPC9,@NPC10,@NPC11,@NPC12,@NPC13,@NPC14,@NPC15,@NPC16,@NPC17,@NPC18,@NPC19,@NPC20,@NPC21,@NPC22,@NPC23,@NPC24,@NPC25,@NPC26,@NPC27,@NPC28,@NPC29,@NPC30,@NPC31,@NPC32,@NPC33,@NPC34,@NPC35,@NPC36,@NPC37,@NPC38,@NPC39,@NPC40,@NPC41,@NPC42,@NPC43,@NPC44,@NPC45,@NPC46,@NPC47,@NPC48,@NPC49,@NPC50,@NPC51,@NPC52); +DELETE FROM `pickpocketing_loot_template` WHERE `entry` IN (@NPC,@NPC1,@NPC2,@NPC3,@NPC4,@NPC5,@NPC6,@NPC7,@NPC8,@NPC9,@NPC10,@NPC11,@NPC12,@NPC13,@NPC14,@NPC15,@NPC16,@NPC17,@NPC18,@NPC19,@NPC20,@NPC21,@NPC22,@NPC23,@NPC24,@NPC25,@NPC26,@NPC27,@NPC28,@NPC29,@NPC30,@NPC31,@NPC32,@NPC33,@NPC34,@NPC35,@NPC36,@NPC37,@NPC38,@NPC39,@NPC40,@NPC41,@NPC42,@NPC43,@NPC44,@NPC45,@NPC46,@NPC47,@NPC48,@NPC49,@NPC50,@NPC51,@NPC52); +INSERT INTO `pickpocketing_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- ----------------------------------------------------------------------------------------------- +(@NPC,1,100,1,0,-@GORLOCREF,1), -- Gorloc ref loot template on Gorloc Gibberer +(@NPC1,1,100,1,0,-@GORLOCREF,1), -- Gorloc ref loot template on Gorloc Hunter +(@NPC2,1,100,1,0,-@GORLOCREF,1), -- Gorloc ref loot template on Gorloc Steam Belcher +(@NPC3,1,100,1,0,-@GORLOCREF,1), -- Gorloc ref loot template on Gorloc Waddler +-- ----------------------------------------------------------------------------------------------- +(@NPC4,1,100,1,0,-@BERYLREF,1), -- Beryl ref loot template on Beryl Reclaimer +(@NPC5,1,100,1,0,-@BERYLREF,1), -- Beryl ref loot template on Beryl Sorcerer +(@NPC6,1,100,1,0,-@BERYLREF,1), -- Beryl ref loot template on Beryl Treasure Hunter +(@NPC7,1,100,1,0,-@BERYLREF,1), -- Beryl ref loot template on Coldarra Spellbinder +(@NPC8,1,100,1,0,-@BERYLREF,1), -- Beryl ref loot template on Harold Lane +(@NPC9,1,100,1,0,-@BERYLREF,1), -- Beryl ref loot template on High Priest Andorath +(@NPC10,1,100,1,0,-@BERYLREF,1), -- Beryl ref loot template on Cultist Necrolyte +(@NPC11,1,100,1,0,-@BERYLREF,1), -- Beryl ref loot template on Loot Crazed Diver +(@NPC12,1,100,1,0,-@BERYLREF,1), -- Beryl ref loot template on Loot Crazed Hunter +(@NPC13,1,100,1,0,-@BERYLREF,1), -- Beryl ref loot template on Loot Crazed Poacher +(@NPC14,1,100,1,0,-@BERYLREF,1), -- Beryl ref loot template on Inquisitor Caleras +(@NPC15,1,100,1,0,-@BERYLREF,1), -- Beryl ref loot template on Karen "I Don't Caribou" the Culler +(@NPC16,1,100,1,0,-@BERYLREF,1), -- Beryl ref loot template on Minion of Kaw +(@NPC17,1,100,1,0,-@BERYLREF,1), -- Beryl ref loot template on Varidus the Flenser +(@NPC18,1,100,1,0,-@BERYLREF,1), -- Beryl ref loot template on Northsea Mercenary +-- ----------------------------------------------------------------------------------------------- +(@NPC19,1,100,1,0,-@BLOODREF,1), -- Bloodspore ref loot template on Bloodspore Firestarter +(@NPC20,1,100,1,0,-@BLOODREF,1), -- Bloodspore ref loot template on Den Vermin +(@NPC21,1,100,1,0,-@BLOODREF,1), -- Bloodspore ref loot template on Bloodspore Harvester +(@NPC22,1,100,1,0,-@BLOODREF,1), -- Bloodspore ref loot template on Bloodspore Roaster +(@NPC23,1,100,1,0,-@BLOODREF,1), -- Bloodspore ref loot template on Gammoth Tender +-- ----------------------------------------------------------------------------------------------- +(@NPC24,1,100,1,0,-@CHIEFREF,1), -- Chieftian ref loot template on Chieftain Burblegobble +(@NPC25,1,100,1,0,-@CHIEFREF,1), -- Chieftian ref loot template on Gorloc Dredger +(@NPC26,1,100,1,0,-@CHIEFREF,1), -- Chieftian ref loot template on Chieftain GurgleBoggle +(@NPC27,1,100,1,0,-@CHIEFREF,1), -- Chieftian ref loot template on Gorloc Mud Splasher +(@NPC28,1,100,1,0,-@CHIEFREF,1), -- Chieftian ref loot template on Riplash Myrmidon +-- ----------------------------------------------------------------------------------------------- +(@NPC29,1,100,1,0,-@CULTREF,1), -- Cultist ref loot template on Clandestine Cultist +(@NPC30,1,100,1,0,-@CULTREF,1), -- Cultist ref loot template on En'kilah Necrolord +(@NPC31,1,100,1,0,-@CULTREF,1), -- Cultist ref loot template on En'kilah Necromancer +(@NPC32,1,100,1,0,-@CULTREF,1), -- Cultist ref loot template on Northsea Thug +-- ----------------------------------------------------------------------------------------------- +(@NPC33,1,100,1,0,-@KVALDIRREF,1), -- Kvaldir ref loot template on Kvaldir Mist Lord +(@NPC34,1,100,1,0,-@KVALDIRREF,1), -- Kvaldir ref loot template on Kvaldir Mistweaver +(@NPC35,1,100,1,0,-@KVALDIRREF,1), -- Kvaldir ref loot template on Kvaldir Raider +(@NPC36,1,100,1,0,-@KVALDIRREF,1), -- Kvaldir ref loot template on Heigarr the Horrible +(@NPC37,1,100,1,0,-@KVALDIRREF,1), -- Kvaldir ref loot template on Ragnar Drakkarlund +(@NPC37,35774,-100,1,0,1,1), -- Trident of Naz'jan on Ragnar Drakkarlund +(@NPC38,1,100,1,0,-@KVALDIRREF,1), -- Kvaldir ref loot template on Skadir Longboatsman +(@NPC39,1,100,1,0,-@KVALDIRREF,1), -- Kvaldir ref loot template on Skadir Mistweaver +(@NPC40,1,100,1,0,-@KVALDIRREF,1), -- Kvaldir ref loot template on Skadir Raider +(@NPC41,1,100,1,0,-@KVALDIRREF,1), -- Kvaldir ref loot template on Skadir Runecaster +-- ----------------------------------------------------------------------------------------------- +(@NPC42,1,100,1,0,-@CLAXREF,1), -- Clax ref loot template on Claximus +(@NPC43,1,100,1,0,-@CLAXREF,1), -- Clax ref loot template on Keymaster Urmgrgl +(@NPC44,1,100,1,0,-@CLAXREF,1), -- Clax ref loot template on Winterfin Oracle +(@NPC45,1,100,1,0,-@CLAXREF,1), -- Clax ref loot template on Winterfin Shorestriker +(@NPC46,1,100,1,0,-@CLAXREF,1), -- Clax ref loot template on Winterfin Warrior +-- ----------------------------------------------------------------------------------------------- +(@NPC47,1,100,1,0,-@MAGMOTHREF,1), -- Magmoth2 ref loot template on Gammothra the Tormentor +(@NPC48,1,100,1,0,-@MAGMOTHREF,1), -- Magmoth ref loot template on Magnataur Huntress +(@NPC49,1,100,1,0,-@MAGMOTHREF,1), -- Magmoth ref loot template on Mate of Magmothregar +(@NPC50,1,100,1,0,-@MAGMOTHREF,1), -- Magmoth ref loot template on Offspring of Magmothregar +(@NPC51,1,100,1,0,-@MAGMOTHREF,1), -- Magmoth ref loot template on Plagued Magnataur +(@NPC52,1,100,1,0,-@MAGMOTHREF,1); -- Magmoth ref loot template on Skadir Mariner diff --git a/sql/old/3.3.5a/2012_04_19_02_world_creature_loot_template.sql b/sql/old/3.3.5a/2012_04_19_02_world_creature_loot_template.sql new file mode 100644 index 00000000000..336cd61c0eb --- /dev/null +++ b/sql/old/3.3.5a/2012_04_19_02_world_creature_loot_template.sql @@ -0,0 +1,2 @@ +-- fix DB-error on startup +DELETE FROM `creature_loot_template` WHERE `entry` IN (34965,34980); diff --git a/sql/old/3.3.5a/2012_04_19_03_world_instance_ulduar.sql b/sql/old/3.3.5a/2012_04_19_03_world_instance_ulduar.sql new file mode 100644 index 00000000000..a39ed9c01d5 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_19_03_world_instance_ulduar.sql @@ -0,0 +1,174 @@ +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1603019 AND -1603000; +UPDATE `creature_template` SET `ScriptName`='' WHERE `ScriptName` IN ('boss_algalon','mob_collapsing_star'); + +-- Difficulty linking +UPDATE `creature_template` SET `difficulty_entry_1`=34296 WHERE `entry`=32953; -- Black Hole + +UPDATE `creature_template` SET `minlevel`=80,`maxlevel`=80,`faction_A`=35,`faction_H`=35,`unit_flags`=0x8300,`equipment_id`=2478 WHERE `entry`=34064; -- Brann Bronzebeard +UPDATE `creature_template` SET `speed_walk`=4,`speed_run`=2.14286,`exp`=2,`minlevel`=83,`maxlevel`=83,`faction_A`=190,`faction_H`=190,`unit_flags`=0x8100,`BaseAttackTime`=1000,`equipment_id`=2479 WHERE `entry` IN (32871,33070); -- Algalon the Observer +UPDATE `creature_template` SET `faction_A`=190,`faction_H`=190,`exp`=2,`minlevel`=83,`maxlevel`=83,`unit_flags`=0x2000000,`speed_run`=1,`InhabitType`=4 WHERE `entry`=34246; -- Azeroth +UPDATE `creature_template` SET `faction_A`=14,`faction_H`=14,`exp`=2,`minlevel`=74,`maxlevel`=74,`unit_flags`=0x2000000,`flags_extra`=0x80,`InhabitType`=4 WHERE `entry`=33086; -- Algalon Stalker +UPDATE `creature_template` SET `faction_A`=14,`faction_H`=14,`unit_flags`=0x2008000,`speed_run`=1,`equipment_id`=2480,`InhabitType`=4 WHERE `entry` IN (33052,33116); -- Living Constellation +UPDATE `creature_template` SET `faction_A`=14,`faction_H`=14,`speed_run`=1,`RegenHealth`=0 WHERE `entry` IN (32955,34215); -- Collapsing Star +UPDATE `creature_template` SET `faction_A`=14,`faction_H`=14,`exp`=2,`minlevel`=80,`maxlevel`=80,`unit_flags`=0x2000000,`speed_run`=1,`InhabitType`=4 WHERE `entry` IN (32953,34296); -- Black Hole +UPDATE `creature_template` SET `faction_A`=14,`faction_H`=14,`minlevel`=81,`maxlevel`=81,`unit_flags`=0x8000,`speed_walk`=4,`speed_run`=1.42857,`InhabitType`=4 WHERE `entry` IN(33089,34097,34221,34222); -- Dark Matter +UPDATE `creature_template` SET `faction_A`=14,`faction_H`=14,`unit_flags`=0x2000000,`flags_extra`=0x80 WHERE `entry`=34100; -- Algalon Void Zone Visual Stalker +UPDATE `creature_template` SET `faction_A`=14,`faction_H`=14,`unit_flags`=0x2000000,`speed_run`=1,`InhabitType`=4 WHERE `entry`=34099; -- Worm Hole +UPDATE `creature_template` SET `faction_A`=14,`faction_H`=14,`exp`=2,`minlevel`=74,`maxlevel`=74,`unit_flags`=0x2000000,`flags_extra`=0x80,`InhabitType`=4 WHERE `entry`=33104; -- Algalon Stalker Asteroid Target 01 +UPDATE `creature_template` SET `faction_A`=14,`faction_H`=14,`exp`=2,`minlevel`=74,`maxlevel`=74,`unit_flags`=0x2000000,`flags_extra`=0x80,`InhabitType`=4 WHERE `entry`=33105; -- Algalon Stalker Asteroid Target 02 + +UPDATE `creature_model_info` SET `bounding_radius`=0.93,`combat_reach`=9,`gender`=0 WHERE `modelid`=28641; -- Algalon the Observer +UPDATE `creature_model_info` SET `bounding_radius`=0.02,`combat_reach`=0.2,`gender`=2 WHERE `modelid`=29133; -- Azeroth +UPDATE `creature_model_info` SET `bounding_radius`=0.62,`combat_reach`=0,`gender`=2 WHERE `modelid`=28741; -- Living Constellation +UPDATE `creature_model_info` SET `bounding_radius`=1,`combat_reach`=1,`gender`=2 WHERE `modelid`=28988; -- Collapsing Star +UPDATE `creature_model_info` SET `bounding_radius`=1,`combat_reach`=1,`gender`=2 WHERE `modelid`=28460; -- Black Hole + +UPDATE `gameobject_template` SET `faction`=114,`flags`=32 WHERE `entry`=194910; -- Doodad_UL_SigilDoor_03 +UPDATE `gameobject_template` SET `data0`=579 WHERE `entry`=194628; -- Celestial Planetarium Access + +UPDATE `creature_template` SET `ScriptName`='boss_algalon_the_observer' WHERE `entry`=32871; -- Algalon the Observer +UPDATE `creature_template` SET `ScriptName`='npc_living_constellation' WHERE `entry`=33052; -- Living Constellation +UPDATE `creature_template` SET `ScriptName`='npc_collapsing_star' WHERE `entry`=32955; -- Collapsing Star +UPDATE `creature_template` SET `ScriptName`='npc_brann_bronzebeard_algalon' WHERE `entry`=34064; -- Brann Bronzebeard +UPDATE `gameobject_template` SET `ScriptName`='go_celestial_planetarium_access' WHERE `entry` IN (194628,194752); -- Celestial Planetarium Access +UPDATE `creature_template` SET `AIName`='NullCreatureAI' WHERE `entry` IN (32953,34099); -- Black Hole + +DELETE FROM `creature` WHERE `guid` IN (41781,41783,41790,41811,41812,41814,41819,41820,41821,41822,41823,41875); +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`MovementType`) VALUES +(41781,33086,603,3,1,1627.400,-339.4133,417.4044,1.378810,7200,0,0), -- Algalon Stalker +(41783,33086,603,3,1,1622.681,-344.2576,417.3955,1.378810,7200,0,0), -- Algalon Stalker +(41790,33086,603,3,1,1629.984,-271.4798,417.4045,4.782202,7200,0,0), -- Algalon Stalker +(41811,33086,603,3,1,1630.005,-345.5189,417.3955,1.378810,7200,0,0), -- Algalon Stalker +(41812,33089,603,3,16,1622.451,-321.1563,417.6188,4.677482,7200,20,1), -- Dark Matter +(41814,33089,603,3,16,1649.438,-319.8127,418.3941,1.082104,7200,20,1), -- Dark Matter +(41819,33089,603,3,16,1615.060,-291.6816,417.7796,3.490659,7200,20,1), -- Dark Matter +(41820,33089,603,3,16,1647.005,-288.6790,417.3955,3.490659,7200,20,1), -- Dark Matter +(41821,33089,603,3,16,1622.451,-321.1563,417.6188,4.677482,7200,20,1), -- Dark Matter +(41822,33089,603,3,16,1649.438,-319.8127,418.3941,1.082104,7200,20,1), -- Dark Matter +(41823,33089,603,3,16,1615.060,-291.6816,417.7796,3.490659,7200,20,1), -- Dark Matter +(41875,33089,603,3,16,1647.005,-288.6790,417.3955,3.490659,7200,20,1); -- Dark Matter + +SET @OGUID := 252; +DELETE FROM `gameobject` WHERE `id` IN (194767,194910,194911,194715,194716,194148,194253,194628,194752,194821,194822); +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES +(@OGUID+00,194767,603,3,17,1632.024,-182.9211,427.6681,0.000000,0,0,8.742278E-08,1, 604800,255,1), -- Doodad_UL_SigilDoor_01 +(@OGUID+04,194911,603,3,17,1632.024,-182.9211,408.4224,3.141593,0,0,8.742278E-08,1, 604800,255,1), -- Doodad_UL_SigilDoor_02 +(@OGUID+10,194910,603,3,17,1632.053,-266.1495,438.5608,0.000000,0,0,8.742278E-08,1, 604800,255,0), -- Doodad_UL_SigilDoor_03 +(@OGUID+12,194715,603,3,17,1632.053,-307.6541,417.3211,0.000000,0,0,8.742278E-08,1, 604800,255,0), -- Doodad_UL_UniverseFloor_01 +(@OGUID+19,194716,603,3,17,1632.251,-307.5483,416.2641,0.000000,0,0,8.742278E-08,1, 604800,255,1), -- Doodad_UL_UniverseFloor_02 +(@OGUID+22,194148,603,3,17,1632.053,-307.6541,417.3211,0.000000,0,0,8.742278E-08,1, 604800,255,1), -- Doodad_UL_UniverseGlobe01 +(@OGUID+24,194253,603,3,17,1631.908,-246.4970,417.3211,0.000000,0,0,8.742278E-08,1, 604800,255,1), -- Doodad_UL_Ulduar_Trapdoor_03 +(@OGUID+29,194628,603,1, 1,1646.182,-174.6881,427.2536,1.553341,0,0,0.000000E-00,1, 604800,255,1), -- Celestial Planetarium Access +(@OGUID+33,194752,603,2, 1,1646.182,-174.6881,427.2536,1.553341,0,0,0.000000E-00,1, 604800,255,1), -- Celestial Planetarium Access +(@OGUID+37,194821,603,1, 1,1632.099,-306.5609,417.3210,4.694937,0,0,0.000000E-00,1,-604800,255,1), -- Gift of the Observer (10 man) +(@OGUID+46,194822,603,2, 1,1632.099,-306.5609,417.3210,4.694937,0,0,0.000000E-00,1,-604800,255,1); -- Gift of the Observer (25 man) + +DELETE FROM `creature_equip_template` WHERE `entry` IN (2478,2479,2480); +INSERT INTO `creature_equip_template` (`entry`,`itemEntry1`,`itemEntry2`,`itemEntry3`) VALUES +(2478,1903,25972,0), +(2479,45985,45985,0), +(2480,44952,0,0); + +DELETE FROM `creature_template_addon` WHERE `entry` IN (32871,33070,33052,33116,33089,34221,34097,34222,33105); +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`auras`) VALUES +(32871,0,0x0000000,0x0,NULL), -- Algalon the Observer +(33070,0,0x0000000,0x0,NULL), -- Algalon the Observer +(33052,0,0x3000000,0x1,NULL), -- Living Constellation +(33116,0,0x3000000,0x1,NULL), -- Living Constellation +(33089,0,0x3000000,0x1,NULL), -- Dark Matter +(34221,0,0x3000000,0x1,NULL), -- Dark Matter +(34097,0,0x3000000,0x1,NULL), -- Unleashed Dark Matter +(34222,0,0x3000000,0x1,NULL), -- Unleashed Dark Matter +(33105,0,0x3000000,0x1,NULL); -- Algalon Stalker Asteroid Target 02 + +DELETE FROM `creature_text` WHERE `entry` IN (32871,34064); +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`sound`,`emote`,`comment`) VALUES +(34064,0,0,'We did it, lads! We got here before Algalon''s arrival. Maybe we can rig the systems to interfere with his analysis--',14,15824,0,'Brann Bronzebeard - SAY_BRANN_ALGALON_INTRO_1'), +(34064,1,0,'I''ll head back to the Archivum and see if I can jam his signal. I might be able to buy us some time while you take care of him.',12,15825,0,'Brann Bronzebeard - SAY_BRANN_ALGALON_INTRO_2'), +(34064,2,0,'I know just the place. Will you be all right?',14,15823,6,'Brann Bronzebeard - SAY_BRANN_ALGALON_OUTRO'), +(32871,0,0,'Translocation complete. Commencing planetary analysis of Azeroth.',12,15405,0,'Algalon the Observer - SAY_ALGALON_INTRO_1'), +(32871,1,0,'Stand back, mortals. I''m not here to fight you.',12,15406,0,'Algalon the Observer - SAY_ALGALON_INTRO_2'), +(32871,2,0,'It is in the universe''s best interest to re-originate this planet should my analysis find systemic corruption. Do not interfere.',12,15407,0,'Algalon the Observer - SAY_ALGALON_INTRO_3'), +(32871,3,0,'Your actions are illogical. All possible results for this encounter have been calculated. The Pantheon will receive the Observer''s message regardless of outcome.',14,15386,0,'Algalon the Observer - SAY_ALGALON_START_TIMER'), +(32871,4,0,'See your world through my eyes: A universe so vast as to be immeasurable - incomprehensible even to your greatest minds.',14,15390,1,'Algalon the Observer - SAY_ALGALON_AGGRO'), +(32871,5,0,'The stars come to my aid!',14,15392,0,'Algalon the Observer - SAY_ALGALON_COLLAPSING_STAR'), +(32871,6,0,'%s begins to Summon Collapsing Stars!',41,0,0,'Algalon the Observer - EMOTE_ALGALON_COLLAPSING_STAR'), +(32871,7,0,'Witness the fury of the cosmos!',14,15396,0,'Algalon the Observer - SAY_ALGALONG_BIG_BANG'), +(32871,8,0,'%s begins to cast Big Bang!',41,0,0,'Algalon the Observer - EMOTE_ALGALON_BIG_BANG'), +(32871,9,0,'You are out of time.',14,15394,0,'Algalon the Observer - SAY_ALGALON_ASCEND'), +(32871,10,0,'%s begins to cast Cosmic Smash!',41,0,0,'Algalon the Observer - EMOTE_ALGALON_COSMIC_SMASH'), +(32871,11,0,'Behold the tools of creation!',14,15397,0,'Algalon the Observer - SAY_ALGALON_PHASE_TWO'), +(32871,12,0,'I have seen worlds bathed in the Makers'' flames, their denizens fading without as much as a whimper. Entire planetary systems born and razed in the time that it takes your mortal hearts to beat once. Yet all throughout, my own heart devoid of emotion... of empathy. I. Have. Felt. Nothing. A million-million lives wasted. Had they all held within them your tenacity? Had they all loved life as you do?',14,15393,1,'Algalon the Observer - SAY_ALGALON_OUTRO_1'), +(32871,13,0,'Perhaps it is your imperfections... that which grants you free will... that allows you to persevere against all cosmically calculated odds. You prevail where the Titan''s own perfect creations have failed.',14,15401,1,'Algalon the Observer - SAY_ALGALON_OUTRO_2'), +(32871,14,0,'I''ve rearranged the reply code - your planet will be spared. I cannot be certain of my own calculations anymore.',14,15402,1,'Algalon the Observer - SAY_ALGALON_OUTRO_3'), +(32871,15,0,'I lack the strength to transmit the signal. You must... hurry... find a place of power... close to the skies.',14,15403,1,'Algalon the Observer - SAY_ALGALON_OUTRO_4'), +(32871,16,0,'Do not worry about my fate, Bronzen. If the signal is not transmitted in time, re-origination will proceed regardless. Save... your world...',14,15404,1,'Algalon the Observer - SAY_ALGALON_OUTRO_5'), +(32871,17,0,'Analysis complete. There is partial corruption in the planet''s life-support systems as well as complete corruption in most of the planet''s defense mechanisms.',12,15398,0,'Algalon the Observer - SAY_ALGALON_DESPAWN_1'), +(32871,18,0,'Begin uplink: Reply Code: ''Omega''. Planetary re-origination requested.',12,15399,0,'Algalon the Observer - SAY_ALGALON_DESPAWN_2'), +(32871,19,0,'Farewell, mortals. Your bravery is admirable, for such flawed creatures.',12,15400,0,'Algalon the Observer - SAY_ALGALON_DESPAWN_3'), +(32871,20,0,'Loss of life unavoidable.',14,15387,0,'Algalon the Observer - SAY_ALGALON_KILL'), +(32871,20,1,'I do what I must.',14,15388,0,'Algalon the Observer - SAY_ALGALON_KILL'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (64996,62266,65509,62304,64597); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`Comment`) VALUES +(13,1,64996,31,3,34246,'Algalon the Observer - Reorigination on Azeroth'), +(13,1,62266,31,3,33052,'Algalon Stalker - target Living Constellation'), +(13,1,65509,31,3,33052,'Black Hole - target Living Constellation'), +(13,1,62304,31,3,33104,'Cosmic Smash - target trigger'), +(13,1,64597,31,3,33104,'Cosmic Smash - target trigger'); + +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_algalon_phase_punch'; +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_algalon_arcane_barrage'; +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_algalon_trigger_3_adds'; +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_algalon_collapse'; +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_algalon_big_bang'; +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_algalon_remove_phase'; +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_algalon_cosmic_smash'; +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_algalon_cosmic_smash_damage'; +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_algalon_supermassive_fail'; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(64412,'spell_algalon_phase_punch'), +(64599,'spell_algalon_arcane_barrage'), +(64607,'spell_algalon_arcane_barrage'), +(62266,'spell_algalon_trigger_3_adds'), +(62018,'spell_algalon_collapse'), +(64443,'spell_algalon_big_bang'), +(64584,'spell_algalon_big_bang'), +(64445,'spell_algalon_remove_phase'), +(62295,'spell_algalon_cosmic_smash'), +(62311,'spell_algalon_cosmic_smash_damage'), +(64596,'spell_algalon_cosmic_smash_damage'), +(65311,'spell_algalon_supermassive_fail'); + +SET @DIFF_ID := 3262; +DELETE FROM `spelldifficulty_dbc` WHERE `id` BETWEEN @DIFF_ID AND @DIFF_ID+5; +INSERT INTO `spelldifficulty_dbc` (`id`,`spellid0`,`spellid1`) VALUES +(@DIFF_ID+0,64395,64592), +(@DIFF_ID+1,64599,64607), +(@DIFF_ID+2,64443,64584), +(@DIFF_ID+3,64122,65108), +(@DIFF_ID+4,62301,64598), +(@DIFF_ID+5,62304,64597); + +UPDATE `instance_encounters` SET `creditType`=1,`creditEntry`=65184 WHERE `entry` IN (757,771); -- Algalon the Observer + +DELETE FROM `disables` WHERE `sourceType`=4 AND `entry` IN (10565,10566,10678,9990,9991,10567,10569,10698,10780,10781,10782,10783,10568,10570); +DELETE FROM `achievement_criteria_data` WHERE `criteria_id` IN (10565,10566,10678,9990,9991,10567,10569,10698,10780,10781,10782,10783,10568,10570); +INSERT INTO `achievement_criteria_data` (`criteria_id`,`type`,`value1`,`value2`,`ScriptName`) VALUES +(10565,12,0,0,''), -- Algalon the Observer kills (Ulduar 10 player) +(10566,12,1,0,''), -- Algalon the Observer kills (Ulduar 25 player) +(10678,12,0,0,''), -- Herald of the Titans +(10678,18,0,0,''), -- Herald of the Titans +(9990,12,0,0,''), -- Lich King 10-player bosses killed +(9991,12,1,0,''), -- Lich King 25-player bosses killed +(10567,12,0,0,''), -- Observed (10 player) +(10569,12,1,0,''), -- Observed (25 player) +(10698,12,1,0,''), -- Realm First! Celestial Defender +(10780,12,0,0,''), -- Supermassive (10 player) +(10781,12,0,0,''), -- Supermassive (10 player) +(10782,12,1,0,''), -- Supermassive (25 player) +(10783,12,1,0,''), -- Supermassive (25 player) +(10568,11,0,0,'achievement_he_feeds_on_your_tears'), -- He Feeds On Your Tears (10 player) +(10568,12,0,0,''), -- He Feeds On Your Tears (10 player) +(10570,11,0,0,'achievement_he_feeds_on_your_tears'), -- He Feeds On Your Tears (25 player) +(10570,12,1,0,''); -- He Feeds On Your Tears (25 player) diff --git a/sql/old/3.3.5a/2012_04_20_00_world_gameobject_loot_template.sql b/sql/old/3.3.5a/2012_04_20_00_world_gameobject_loot_template.sql new file mode 100644 index 00000000000..47a22d519d0 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_20_00_world_gameobject_loot_template.sql @@ -0,0 +1,15 @@ +SET @Ref := 12002; +DELETE FROM `reference_loot_template` WHERE `entry`=@Ref; +INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(@Ref,47242,100,1,0,1,1); +DELETE FROM `gameobject_loot_template` WHERE `entry` IN (195668,195667,195666,195665,195672,195671,195670,195669) AND `item`=47242; +DELETE FROM `gameobject_loot_template` WHERE `entry` IN (195668,195667,195666,195665,195672,195671,195670,195669) AND `mincountOrRef` = -@Ref; +INSERT INTO gameobject_loot_template (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(195665,5,100,1,0,-@Ref,4), -- 10 man,50 attempts +(195666,3,100,1,0,-@Ref,4), -- 10 man,45+ attempts +(195667,3,100,1,0,-@Ref,2), -- 10 man,25+ attempts +(195668,1,100,1,0,-@Ref,2), -- 10 man,0+ attempts +(195669,6,100,1,0,-@Ref,4), -- 25 man,50 attempts +(195670,4,100,1,0,-@Ref,4), -- 25 man,45+ attempts +(195671,4,100,1,0,-@Ref,2), -- 25 man,25+ attempts +(195672,2,100,1,0,-@Ref,2); -- 25 man,0+ attempts diff --git a/sql/old/3.3.5a/2012_04_20_01_world_item_loot_template.sql b/sql/old/3.3.5a/2012_04_20_01_world_item_loot_template.sql new file mode 100644 index 00000000000..af52ade0b25 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_20_01_world_item_loot_template.sql @@ -0,0 +1,10 @@ +SET @Bag := 52676; +DELETE FROM `item_loot_template` WHERE `entry`=@Bag; +INSERT INTO `item_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(@Bag,36933,0,1,1,1,3),-- Forest Emerald +(@Bag,36918,0,1,1,1,3),-- Scarlet Ruby +(@Bag,36921,0,1,1,1,3),-- Autumn's Glow +(@Bag,36930,0,1,1,1,3),-- Monarch Topaz +(@Bag,36924,0,1,1,1,3),-- Sky Sapphire +(@Bag,36927,0,1,1,1,3),-- Twilight Opal +(@Bag,43953,5,1,0,1,1); -- Reins of the Blue Drake diff --git a/sql/old/3.3.5a/2012_04_20_02_world_creature_loot_template.sql b/sql/old/3.3.5a/2012_04_20_02_world_creature_loot_template.sql new file mode 100644 index 00000000000..09b5beee75c --- /dev/null +++ b/sql/old/3.3.5a/2012_04_20_02_world_creature_loot_template.sql @@ -0,0 +1,4 @@ +DELETE FROM `creature_loot_template` WHERE `entry` IN (31702,32297) AND `item`=44564; +INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(31702,44564,0.5,1,0,1,1), -- Recipe: Mighty Arcane Protection Potion on Frostbrood Spawn +(32297,44564,0.5,1,0,1,1); -- Recipe: Mighty Arcane Protection Potion on Cult Researcher diff --git a/sql/old/3.3.5a/2012_04_20_03_world_creature_loot_template.sql b/sql/old/3.3.5a/2012_04_20_03_world_creature_loot_template.sql new file mode 100644 index 00000000000..a0b586ee0d9 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_20_03_world_creature_loot_template.sql @@ -0,0 +1,7 @@ +SET @ITEM := 50406; -- Formula: Enchant Gloves - Angler +UPDATE `creature_template` SET `lootid` = `entry` WHERE `entry` IN(26343,26344,26336); +DELETE FROM `creature_loot_template` WHERE `item`=@ITEM; +INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(26343, @ITEM, 1.1, 1, 0, 1, 1), -- Indu'Le Fisherman +(26336, @ITEM, 0.9, 1, 0, 1, 1), -- Indu'Le Mystic +(26344, @ITEM, 1, 1, 0, 1, 1); -- Indu'Le Warrior diff --git a/sql/old/3.3.5a/2012_04_20_04_world_creature_loot_template.sql b/sql/old/3.3.5a/2012_04_20_04_world_creature_loot_template.sql new file mode 100644 index 00000000000..73e01efa23e --- /dev/null +++ b/sql/old/3.3.5a/2012_04_20_04_world_creature_loot_template.sql @@ -0,0 +1,3 @@ +-- Make Grimscale Murlocs drop their heads faster... +UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=-66 WHERE `item`=21757; + diff --git a/sql/old/3.3.5a/2012_04_20_05_gameobject_template.sql b/sql/old/3.3.5a/2012_04_20_05_gameobject_template.sql new file mode 100644 index 00000000000..24400b16a5c --- /dev/null +++ b/sql/old/3.3.5a/2012_04_20_05_gameobject_template.sql @@ -0,0 +1,8 @@ +-- Restore horrible mistake in UP34 from myself +UPDATE `gameobject_template` SET `data1`=27512 WHERE `entry`=195669; +UPDATE `gameobject_template` SET `data1`=27517 WHERE `entry`=195670; +UPDATE `gameobject_template` SET `data1`=27518 WHERE `entry`=195671; +-- Fix loottemplates along with it +UPDATE `gameobject_loot_template` SET `entry`=27512 WHERE `entry`=195669; +UPDATE `gameobject_loot_template` SET `entry`=27517 WHERE `entry`=195670; +UPDATE `gameobject_loot_template` SET `entry`=27518 WHERE `entry`=195671; diff --git a/sql/old/3.3.5a/2012_04_21_00_world_spell_script_names.sql b/sql/old/3.3.5a/2012_04_21_00_world_spell_script_names.sql new file mode 100644 index 00000000000..e61ef4aec74 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_21_00_world_spell_script_names.sql @@ -0,0 +1,14 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` IN (20625,29142,35139,42393,49882,55269,56578,38441,66316,67100,67101,67102); +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(20625,'spell_gen_default_count_pct_from_max_hp'), -- Ritual of Doom Sacrifice +(29142,'spell_gen_default_count_pct_from_max_hp'), -- Eyesore Blaster +(35139,'spell_gen_default_count_pct_from_max_hp'), -- Throw Boom's Doom +(42393,'spell_gen_default_count_pct_from_max_hp'), -- Brewfest - Attack Keg +(49882,'spell_gen_default_count_pct_from_max_hp'), -- Leviroth Self-Impale +(55269,'spell_gen_default_count_pct_from_max_hp'), -- Deathly Stare +(56578,'spell_gen_default_count_pct_from_max_hp'), -- Rapid-Fire Harpoon +(38441,'spell_gen_50pct_count_pct_from_max_hp'), -- Cataclysmic Bolt +(66316,'spell_gen_50pct_count_pct_from_max_hp'), -- Spinning Pain Spike 10m +(67100,'spell_gen_50pct_count_pct_from_max_hp'), -- Spinning Pain Spike 25m +(67101,'spell_gen_50pct_count_pct_from_max_hp'), -- Spinning Pain Spike 10m heroic +(67102,'spell_gen_50pct_count_pct_from_max_hp'); -- Spinning Pain Spike 25m heroic diff --git a/sql/old/3.3.5a/2012_04_22_00_world_sai.sql b/sql/old/3.3.5a/2012_04_22_00_world_sai.sql new file mode 100644 index 00000000000..f223883c8a7 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_22_00_world_sai.sql @@ -0,0 +1,63 @@ +-- SAI for Tabard Vendor Elizabeth Ross +SET @ROSS := 28776; +SET @GOSSIP := 9832; + +UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=@ROSS; + +DELETE FROM `gossip_menu_option` WHERE `menu_id`=@GOSSIP AND `id`>0 AND `id`<11; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `box_coded`, `box_money`, `box_text`) VALUES +(@GOSSIP, 1, 0, 'I''ve lost my Blood Knight Tabard.', 1, 1, 0, 0, 0, 0, ''), +(@GOSSIP, 2, 0, 'I''ve lost my Tabard of the Hand.', 1, 1, 0, 0, 0, 0, ''), +(@GOSSIP, 3, 0, 'I''ve lost my Tabard of the Protector.', 1, 1, 0, 0, 0, 0, ''), +(@GOSSIP, 4, 0, 'I''ve lost my Green Trophy Tabard of the Illidari.', 1, 1, 0, 0, 0, 0, ''), +(@GOSSIP, 5, 0, 'I''ve lost my Purple Trophy Tabard of the Illidari.', 1, 1, 0, 0, 0, 0, ''), +(@GOSSIP, 6, 0, 'I''ve lost my Tabard of Summer Skies.', 1, 1, 0, 0, 0, 0, ''), +(@GOSSIP, 7, 0, 'I''ve lost my Tabard of Summer Flames.', 1, 1, 0, 0, 0, 0, ''), +(@GOSSIP, 8, 0, 'I''ve lost my Loremaster''s Colors.', 1, 1, 0, 0, 0, 0, ''), +(@GOSSIP, 9, 0, 'I''ve lost my Tabard of the Explorer.', 1, 1, 0, 0, 0, 0, ''), +(@GOSSIP, 10, 0, 'I''ve lost my Tabard of the Achiever.', 1, 1, 0, 0, 0, 0, ''); + +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ROSS AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(@ROSS, 0, 0, 10, 62, 0, 100, 0, @GOSSIP, 1, 0, 0, 11, 54974, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Cast Spell Create Blood Knight Tabard'), +(@ROSS, 0, 1, 10, 62, 0, 100, 0, @GOSSIP, 2, 0, 0, 11, 54976, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Cast Spell Create Tabard of the Hand'), +(@ROSS, 0, 2, 10, 62, 0, 100, 0, @GOSSIP, 3, 0, 0, 11, 55008, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Cast Spell Create Tabard of the Protector'), +(@ROSS, 0, 3, 10, 62, 0, 100, 0, @GOSSIP, 4, 0, 0, 11, 54977, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Cast Spell Create Green Trophy Tabard of the Illidari'), +(@ROSS, 0, 4, 10, 62, 0, 100, 0, @GOSSIP, 5, 0, 0, 11, 54982, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Cast Spell Create Purple Trophy Tabard of the Illidari'), +(@ROSS, 0, 5, 10, 62, 0, 100, 0, @GOSSIP, 6, 0, 0, 11, 62768, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Cast Spell Create Tabard of Summer Skies'), +(@ROSS, 0, 6, 10, 62, 0, 100, 0, @GOSSIP, 7, 0, 0, 11, 62769, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Cast Spell Create Tabard of Summer Flames'), +(@ROSS, 0, 7, 10, 62, 0, 100, 0, @GOSSIP, 8, 0, 0, 11, 58194, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Cast Spell Create Loremaster''s Colors'), +(@ROSS, 0, 8, 10, 62, 0, 100, 0, @GOSSIP, 9, 0, 0, 11, 58224, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Cast Spell Create Tabard of the Explorer'), +(@ROSS, 0, 9, 10, 62, 0, 100, 0, @GOSSIP, 10, 0, 0, 11, 55006, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Cast Spell Create Tabard of the Achiever'), +(@ROSS, 0, 10, 0, 61, 0, 100, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Elizabeth Ross - On Gossip Select - Close Gossip'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,@GOSSIP,1,0,2,25549,1,1,1,0,'','Only show gossip if player doesn''t have Blood Knight Tabard'), +(15,@GOSSIP,1,0,8,9737,0,0,0,0,'','Only show gossip if player already finished quest True Masters of Light'), +(15,@GOSSIP,2,0,2,24344,1,1,1,0,'','Only show gossip if player doesn''t have Tabard of the Hand'), +(15,@GOSSIP,2,0,8,9762,0,0,0,0,'','Only show gossip if player already finished quest The Unwritten Prophecy'), +(15,@GOSSIP,3,0,2,28788,1,1,1,0,'','Only show gossip if player doesn''t have Tabard of the protector'), +(15,@GOSSIP,3,0,8,10259,0,0,0,0,'','Only show gossip if player already finished quest Into the Breach'), +(15,@GOSSIP,4,0,2,31404,1,1,1,0,'','Only show gossip if player doesn''t have Green Trophy Tabard of Illidari'), +(15,@GOSSIP,4,0,2,31405,1,1,1,0,'','Only show gossip if player doesn''t have Purple Trophy Tabard of Illidari'), +(15,@GOSSIP,4,0,2,31408,1,1,1,0,'','Only show gossip if player doesn''t have Offering of the Sha''tar'), +(15,@GOSSIP,4,0,8,10781,0,0,0,0,'','Only show gossip if player already finished quest Battle of the Crimson Watch'), +(15,@GOSSIP,5,0,2,31404,1,1,1,0,'','Only show gossip if player doesn''t have Green Trophy Tabard of Illidari'), +(15,@GOSSIP,5,0,2,31405,1,1,1,0,'','Only show gossip if player doesn''t have Purple Trophy Tabard of Illidari'), +(15,@GOSSIP,5,0,2,31408,1,1,1,0,'','Only show gossip if player doesn''t have Offering of the Sha''tar'), +(15,@GOSSIP,5,0,8,10781,0,0,0,0,'','Only show gossip if player already finished quest Battle of the Crimson Watch'), +(15,@GOSSIP,6,0,2,35279,1,1,1,0,'','Only show gossip if player doesn''t have Tabard of Summer Skies'), +(15,@GOSSIP,6,0,2,35280,1,1,1,0,'','Only show gossip if player doesn''t have Tabard of Summer Flames'), +(15,@GOSSIP,6,0,8,11972,0,0,0,0,'','Only show gossip if player already finished quest Shards of Ahune'), +(15,@GOSSIP,7,0,2,35279,1,1,1,0,'','Only show gossip if player doesn''t have Tabard of Summer Skies'), +(15,@GOSSIP,7,0,2,35280,1,1,1,0,'','Only show gossip if player doesn''t have Tabard of Summer Flames'), +(15,@GOSSIP,7,0,8,11972,0,0,0,0,'','Only show gossip if player already finished quest Shards of Ahune'), +(15,@GOSSIP,8,0,2,43300,1,1,1,0,'','Only show gossip if player doesn''t have Loremaster''s Colors'), +(15,@GOSSIP,8,0,17,1681,0,0,0,0,'','Only show gossip if player have achievement Loremaster (A)'), +(15,@GOSSIP,8,1,2,43300,1,1,1,0,'','Only show gossip if player doesn''t have Loremaster''s Colors'), +(15,@GOSSIP,8,1,17,1682,0,0,0,0,'','Only show gossip if player have achievement Loremaster (H)'), +(15,@GOSSIP,9,0,2,43348,1,1,1,0,'','Only show gossip if player doesn''t have Tabard of the Explorer'), +(15,@GOSSIP,9,0,17,45,0,0,0,0,'','Only show gossip if player have achievement Explore Northrend'), +(15,@GOSSIP,10,0,2,40643,1,1,1,0,'','Only show gossip if player doesn''t have Tabard of the Explorer'), +(15,@GOSSIP,10,0,17,1021,0,0,0,0,'','Only show gossip if player have achievement Twenty-Five Tabards'); diff --git a/sql/old/3.3.5a/2012_04_23_00_world_creatures.sql b/sql/old/3.3.5a/2012_04_23_00_world_creatures.sql new file mode 100644 index 00000000000..3730fabf552 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_23_00_world_creatures.sql @@ -0,0 +1,12 @@ +UPDATE `creature_template` SET `flags_extra`=0x82,`ModelId1`=1126,`ModelId2`=16925 WHERE `entry` IN (38008,38641,38773,38774); -- Blood Orb Controller +UPDATE `creature_template` SET `flags_extra`=0x80,`ModelId1`=19725,`ModelId2`=31095,`baseattacktime`=2000,`speed_walk`=0.8,`speed_run`=0.28571 WHERE `entry` IN (38454,38775,38776,38777); -- Kinetic Bomb +UPDATE `creature_template` SET `exp`=2,`baseattacktime`=2000,`ModelId1`=19725,`ModelId2`=21342 WHERE `entry`=38458; -- Kinetic Bomb Target +UPDATE `creature_template` SET `baseattacktime`=2000,`speed_walk`=4.4,`ModelId1`=19725,`ModelId2`=26767 WHERE `entry` IN (38332,38451); -- Ball of Flame +UPDATE `creature_template` SET `flags_extra`=0x80 WHERE `entry`=37950; -- Valithria Dreamwalker +UPDATE `creature_template` SET `InhabitType`=4 WHERE `InhabitType`&4 AND `flags_extra`&0x80; -- make flying triggers fly +UPDATE `creature_template` SET `InhabitType`=4,`HoverHeight`=12 WHERE `entry`=37126; -- Sister Svalna +UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry`=37950; -- Valithria Dreamwalker +UPDATE `creature_model_info` SET `bounding_radius`=1,`combat_reach`=0,`gender`=0 WHERE `modelid`=31095; -- Kinetic Bomb +UPDATE `creature_model_info` SET `bounding_radius`=0.5,`combat_reach`=1,`gender`=0 WHERE `modelid`=21342; -- Kinetic Bomb Target +UPDATE `creature_model_info` SET `bounding_radius`=0.5,`combat_reach`=1,`gender`=0 WHERE `modelid`=26767; -- Ball of Flame +UPDATE `creature_template_addon` SET `bytes1`=50331648,`bytes2`=1,`mount`=0,`emote`=0,`auras`=NULL WHERE `entry`=38454; -- Kinetic Bomb diff --git a/sql/old/3.3.5a/2012_04_23_01_world_conditions.sql b/sql/old/3.3.5a/2012_04_23_01_world_conditions.sql new file mode 100644 index 00000000000..c731426aa3f --- /dev/null +++ b/sql/old/3.3.5a/2012_04_23_01_world_conditions.sql @@ -0,0 +1,5 @@ +-- setup alternate conditions for spell 46488 +DELETE FROM `conditions` WHERE `SourceEntry` = 46488 AND `ElseGroup` = 1; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,1,46488,0,1,31,1,3,26817,0,0,0,'',''), +(13,1,46488,0,1,36,1,0,0,0,1,0,'',''); diff --git a/sql/old/3.3.5a/2012_04_23_02_world_prospecting_loot_template.sql b/sql/old/3.3.5a/2012_04_23_02_world_prospecting_loot_template.sql new file mode 100644 index 00000000000..6ea44d92722 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_23_02_world_prospecting_loot_template.sql @@ -0,0 +1,112 @@ +SET @TinRef := 13000; +SET @TBC1 := @TinRef+1; +SET @TBC2 := @TinRef+2; +SET @WOTLK1 := @TinRef+3; +SET @WOTLK2 := @TinRef+4; +SET @WOTLK3 := @TinRef+5; + +SET @Copper := 2770; +SET @Tin := 2771; +SET @Iron := 2772; +SET @Mithril := 3858; +SET @Thorium := 10620; +SET @FelIron := 23424; +SET @Adamantite := 23425; +SET @Cobalt := 36909; +SET @Saronite := 36912; +SET @Titanium := 36910; + +-- Reference Loot Templates +DELETE FROM `reference_loot_template` WHERE `entry` BETWEEN @TinRef AND @TinRef+5; +INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- Stupid Tin +(@TinRef,1529,0,1,1,1,1), -- Jade +(@TinRef,3864,0,1,1,1,1), -- Citrine +(@TinRef,7909,0,1,1,1,1), -- Aquamarine +-- TBC Greens +(@TBC1,21929,0,1,1,1,2), -- Flame Spessarite +(@TBC1,23077,0,1,1,1,2), -- Blood Garnet +(@TBC1,23079,0,1,1,1,2), -- Deep Peridot +(@TBC1,23107,0,1,1,1,2), -- Shadow Draenite +(@TBC1,23112,0,1,1,1,2), -- Golden Draenite +(@TBC1,23117,0,1,1,1,2), -- Azure Moonstone +-- TBC Blues +(@TBC2,23436,0,1,1,1,1), -- Living Ruby +(@TBC2,23437,0,1,1,1,1), -- Talasite +(@TBC2,23438,0,1,1,1,1), -- Star of Elune +(@TBC2,23439,0,1,1,1,1), -- Noble Topaz +(@TBC2,23440,0,1,1,1,1), -- Dawnstone +(@TBC2,23441,0,1,1,1,1), -- Nightseye +-- WOTLK Greens +(@WOTLK1,36917,0,1,1,1,2), -- Bloodstone +(@WOTLK1,36920,0,1,1,1,2), -- Sun Crystal +(@WOTLK1,36923,0,1,1,1,2), -- Chalcedony +(@WOTLK1,36926,0,1,1,1,2), -- Shadow Crystal +(@WOTLK1,36929,0,1,1,1,2), -- Huge Citrine +(@WOTLK1,36932,0,1,1,1,2), -- Dark Jade +-- WOTLK Blues +(@WOTLK2,36918,0,1,1,1,2), -- Scarlet Ruby +(@WOTLK2,36921,0,1,1,1,2), -- Autumn's Glow +(@WOTLK2,36924,0,1,1,1,2), -- Sky Sapphire +(@WOTLK2,36927,0,1,1,1,2), -- Twilight Opal +(@WOTLK2,36930,0,1,1,1,2), -- Monarch Topaz +(@WOTLK2,36933,0,1,1,1,2), -- Forest Emerald +-- WOTLK Epics +(@WOTLK3,36919,0,1,1,1,1), -- Cardinal Ruby +(@WOTLK3,36922,0,1,1,1,1), -- King's Amber +(@WOTLK3,36925,0,1,1,1,1), -- Majestic Zircon +(@WOTLK3,36928,0,1,1,1,1), -- Dreadstone +(@WOTLK3,36931,0,1,1,1,1), -- Ametrine +(@WOTLK3,36934,0,1,1,1,1); -- Eye of Zul +-- -------------------------------------------------------- +-- Prospecting Loot Templates +DELETE FROM `prospecting_loot_template` WHERE `entry` IN (@Copper,@Tin,@Iron,@Mithril,@Thorium,@FelIron,@Adamantite,@Cobalt,@Saronite,@Titanium); +INSERT INTO `prospecting_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- Copper Ore +(@Copper,774,0,1,1,1,1), -- Malachite +(@Copper,818,0,1,1,1,1), -- Tigerseye +(@Copper,1210,10,1,0,1,1), -- Shadowgem +-- Tin Ore +(@Tin,1210,0,1,1,1,2), -- Shadowgem +(@Tin,1705,0,1,1,1,2), -- Lesser Moonstone +(@Tin,1206,0,1,1,1,2), -- Moss Agate +(@Tin,1,10,1,0,-@TinRef,1), -- One Rare gem chance +-- Iron Ore +(@Iron,1529,30,1,1,1,2), -- Jade +(@Iron,1705,30,1,1,1,2), -- Lesser Moonstone +(@Iron,3864,30,1,1,1,2), -- Citrine +(@Iron,7909,5,1,1,1,1), -- Aquamarine +(@Iron,7910,5,1,1,1,1), -- Star Ruby +-- Mithril Ore +(@Mithril,3864,30,1,1,1,2), -- Citrine +(@Mithril,7909,30,1,1,1,2), -- Aquamarine +(@Mithril,7910,30,1,1,1,2), -- Star Ruby +(@Mithril,12361,2.5,1,1,1,1), -- Blue Sapphire +(@Mithril,12364,2.5,1,1,1,1), -- Huge Emerald +(@Mithril,12799,2.5,1,1,1,1), -- Large Opal +(@Mithril,12800,2.5,1,1,1,1), -- Azerothian Diamond +-- Thorium Ore +(@Thorium,7910,30,1,1,1,2), -- Star Ruby +(@Thorium,12361,15,1,1,1,2), -- Blue Sapphire +(@Thorium,12364,15,1,1,1,2), -- Huge Emerald +(@Thorium,12799,15,1,1,1,2), -- Large Opal +(@Thorium,12800,15,1,1,1,2), -- Azerothian Diamond +(@Thorium,1,10,1,1,-@TBC1,1), -- one from TBC Greens +-- Fel Iron Ore +(@FelIron,1,95,1,1,-@TBC1,1), -- One from TBC Greens +(@FelIron,2,05,1,1,-@TBC2,1), -- One from TBC Blues +-- Adamantite Ore +(@Adamantite,24243,100,1,0,1,1), -- Adamantite Powder +(@Adamantite,1,100,1,1,-@TBC1,1), -- One from TBC Greens +(@Adamantite,2, 10,1,1,-@TBC2,1), -- One from TBC Blues +-- Cobalt Ore +(@Cobalt,1,95,1,1,-@WOTLK1,1), -- One from WOTLK Greens +(@Cobalt,2,05,1,1,-@WOTLK2,1), -- One from WOTLK Blues +-- Saronite Ore +(@Saronite,1,85,1,1,-@WOTLK1,2), -- One from WOTLK Greens +(@Saronite,2,15,1,1,-@WOTLK2,1), -- One from WOTLK Blues +-- Titanium Ore +(@Titanium,46849,75,1,0,1,1), -- Titanium Powder +(@Titanium,1,75,1,1,-@WOTLK1,2), -- Two from WOTLK Greens +(@Titanium,2,25,1,1,-@WOTLK2,1), -- One from WOTLK Blues +(@Titanium,3,20,1,0,-@WOTLK3,1); -- One from WOTLK Epics diff --git a/sql/old/3.3.5a/2012_04_23_03_world_skinning_loot_template.sql b/sql/old/3.3.5a/2012_04_23_03_world_skinning_loot_template.sql new file mode 100644 index 00000000000..a1aa9e070f2 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_23_03_world_skinning_loot_template.sql @@ -0,0 +1,44 @@ +UPDATE `creature_template` SET `skinloot`=entry WHERE `entry` IN (30260, 32517, 27641, 28860); +UPDATE `creature_template` SET `skinloot`=70202 WHERE `entry` IN (25774,29693); +UPDATE `creature_template` SET `skinloot`=70203 WHERE `entry`=28257; +UPDATE `creature_template` SET `skinloot`=70207 WHERE `entry`=34137; +UPDATE `creature_template` SET `skinloot`=70208 WHERE `entry` IN (32572,25448,25716,25713); +UPDATE `creature_template` SET `skinloot`=70210 WHERE `entry` IN (33528,40419,26723,31134,36891); +UPDATE `creature_template` SET `skinloot`=70211 WHERE `entry` IN (28847,30206,29875,29931,28203,30432); +UPDATE `creature_template` SET `skinloot`=70212 WHERE `entry` IN (27645,32377,29838,26628,26622,32490,38453,32485,26633,32400,32361,29768,29735,26641,27644,27642,26735,26730,26722,33776,35189,26716,26672,29664,29774); +UPDATE `creature_template` SET `skinloot`=70213 WHERE `entry` IN (27483,29312); +UPDATE `creature_template` SET `skinloot`=70214 WHERE `entry` IN (37217,34564); +UPDATE `creature_template` SET `skinloot`=27641 WHERE `entry` IN (31385,34269,34270,27641,30905,30353); + +DELETE FROM `skinning_loot_template` WHERE entry IN (30260,32517,70212,70213,70214,28860,27641); +INSERT INTO `skinning_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `groupid`, `mincountOrRef`, `maxcount`) VALUES +-- Stoic Mammoth +(30260,33568,100,0,1,3), -- Borean Leather +(30260,42542,-50,0,1,1), -- Stoic Mammoth Hide +-- Loque'nahak +(32517,33568,0,1,1,3), -- Borean Leather +(32517,44128,2,1,1,1), -- Arctic Fur +(32517,44687,100,0,1,1), -- Loque'Nahak's Pelt +-- skinloot 70212 +(70212,33568,0,1,1,3), -- Borean Leather +(70212,44128,1,1,1,1), -- Arctic Fur +-- skinloot 70213 +(70213,33568,0,1,5,12), -- Borean Leather +(70213,44128,1,1,1,1), -- Arctic Fur +-- skinloot 70214 +(70214,33568,0,1,12,16), -- Borean Leather +(70214,44128,25,1,1,1), -- Arctic Fur +-- Sartharion +(28860,33568,0,1,8,12), -- Borean Leather +(28860,38557,0,1,8,12),-- Icy Dragonscale +(28860,44128,1,1,1,1), -- Arctic Fur +-- Centrifuge Construct +(27641,41337,85,0,1,3), -- Whizzed-Out Gizmo +(27641,41338,80,0,1,3), -- Sprung Whirlygig +(27641,39690,15,0,1,3), -- Volatile Blasting Trigger +(27641,39684,8,0,1,1), -- Hair Trigger +(27641,36813,8,0,1,3), -- Sprung Sprocket +(27641,39681,8,0,2,4), -- Handful of Cobalt Bolts +(27641,49050,2,0,1,1), -- Schematic: Jeeves +(27641,39682,1,0,1,1), -- Overcharged Capacitor +(27641,39685,1,0,1,1); -- Indestructible Frame diff --git a/sql/old/3.3.5a/2012_04_23_04_world_creature_loot_template.sql b/sql/old/3.3.5a/2012_04_23_04_world_creature_loot_template.sql new file mode 100644 index 00000000000..94d2b092d12 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_23_04_world_creature_loot_template.sql @@ -0,0 +1,2 @@ +-- Correct dropchance for Mote of Life, wowhead was wrong (as usual) +UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=18.5307 WHERE `entry`=22307 AND `item`=22575; diff --git a/sql/old/3.3.5a/2012_04_23_05_world_creature_loot_template.sql b/sql/old/3.3.5a/2012_04_23_05_world_creature_loot_template.sql new file mode 100644 index 00000000000..ddf0780d362 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_23_05_world_creature_loot_template.sql @@ -0,0 +1,3 @@ +-- Update the dropchance to 100% if on quest +UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=-100 WHERE `entry`=21477 AND `item`=31372; -- Rocknail Flayer Carcass +UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=-100 WHERE `entry`=21478 AND `item`=31373; -- Rocknail Flayer Giblets diff --git a/sql/old/3.3.5a/2012_04_24_00_world_command.sql b/sql/old/3.3.5a/2012_04_24_00_world_command.sql new file mode 100644 index 00000000000..25912392347 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_24_00_world_command.sql @@ -0,0 +1,10 @@ +DELETE FROM `command` WHERE `name` IN ('modify tp','modify bwalk','modify swim','modify fly','modify arena','modify aspeed','modify morph'); +INSERT INTO `command` (`name`, `security`, `help`) VALUES ('modify speed all', 1, 'Syntax: .modify aspeed #rate\r\n\r\nModify all speeds -run,swim,run back,swim back- of the selected player to "normalbase speed for this move type"*rate. If no player is selected, modify your speed.\r\n\r\n #rate may range from 0.1 to 50.'), +('modify speed backwalk', 1, 'Syntax: .modify speed backwalk #rate\r\n\r\nModify the speed of the selected player while running backwards to "normal walk back speed"*rate. If no player is selected, modify your speed.\r\n\r\n #rate may range from 0.1 to 50.'), +('modify speed fly', 1, '.modify speed fly #rate\nModify the flying speed of the selected player to "normal flying speed"*rate. If no player is selected, modify your speed.\n #rate may range from 0.1 to 50.'), +('modify speed swim', 1, 'Syntax: .modify speed swim #rate\r\n\r\nModify the swim speed of the selected player to "normal swim speed"*rate. If no player is selected, modify your speed.\r\n\r\n #rate may range from 0.1 to 50.'), +('modify speed walk', 1, 'Syntax: .modify speed bwalk #rate\r\n\r\nModify the speed of the selected player while running to "normal walk speed"*rate. If no player is selected, modify your speed.\r\n\r\n #rate may range from 0.1 to 50.'), +('modify talentpoints', 1, 'Syntax: .modify talentpoints #amount\r\n\r\nSet free talent points for selected character or character\'s pet. It will be reset to default expected at next levelup/login/quest reward.'), +('morph', 2, 'Syntax: .morph #displayid\r\n\r\nChange your current model id to #displayid.'), +('modify arenapoints', 1, 'Syntax: .modify arenapoints #value\r\nAdd $amount arena points to the selected player.'); +UPDATE `command` SET `help`='Syntax: .modify speed $speedtype #rate\r\n\r\nModify the running speed of the selected player to "normal base run speed"= 1. If no player is selected, modify your speed.\r\n\r\n$speedtypes may be fly, all, walk, backwalk, or swim.\r\n\r\n #rate may range from 0.1 to 50.' WHERE `name`='modify speed' LIMIT 1; diff --git a/sql/old/3.3.5a/2012_04_24_01_world_spell_proc_event.sql b/sql/old/3.3.5a/2012_04_24_01_world_spell_proc_event.sql new file mode 100644 index 00000000000..6e997931bb5 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_24_01_world_spell_proc_event.sql @@ -0,0 +1,4 @@ +-- Honor Among Thieves proc chance +UPDATE `spell_proc_event` SET `CustomChance`=33 WHERE `entry`=51698; -- Rank 1 +UPDATE `spell_proc_event` SET `CustomChance`=66 WHERE `entry`=51700; -- Rank 2 +UPDATE `spell_proc_event` SET `CustomChance`=100 WHERE `entry`=51701; -- Rank 3 diff --git a/sql/old/3.3.5a/2012_04_24_02_world_warden_checks.sql b/sql/old/3.3.5a/2012_04_24_02_world_warden_checks.sql new file mode 100644 index 00000000000..74539f99fb3 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_24_02_world_warden_checks.sql @@ -0,0 +1,8 @@ +UPDATE `warden_checks` SET `comment`='Swimming_FallCalc - movement state' WHERE `id`=15; +UPDATE `warden_checks` SET `comment`='CreateMovementStatus' WHERE `id`=72; +UPDATE `warden_checks` SET `comment`='OnStartSwim OnSplineStartSwim - movement state' WHERE `id`=170; +UPDATE `warden_checks` SET `comment`='DefaultServerLogin - account name' WHERE `id`=198; +UPDATE `warden_checks` SET `comment`='Login Checksum - authentication process' WHERE `id`=320; +UPDATE `warden_checks` SET `comment`='CalcFallStartElevation - (some kind of wall climb)' WHERE `id`=329; +UPDATE `warden_checks` SET `comment`='Code injection at 0x40100A' WHERE `id`=381; +UPDATE `warden_checks` SET `comment`='Login State - (May be false positive)' WHERE `id`=437; diff --git a/sql/old/3.3.5a/2012_04_24_03_world_spell_script_names.sql b/sql/old/3.3.5a/2012_04_24_03_world_spell_script_names.sql new file mode 100644 index 00000000000..a53d8bd585c --- /dev/null +++ b/sql/old/3.3.5a/2012_04_24_03_world_spell_script_names.sql @@ -0,0 +1,4 @@ +-- Earthen Power +DELETE FROM `spell_script_names` WHERE `spell_id`=59566; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(59566,'spell_sha_earthen_power'); diff --git a/sql/old/3.3.5a/2012_04_24_04_world_spell_proc_event.sql b/sql/old/3.3.5a/2012_04_24_04_world_spell_proc_event.sql new file mode 100644 index 00000000000..5ba6f24ccf8 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_24_04_world_spell_proc_event.sql @@ -0,0 +1,4 @@ + -- Rogue T9 2P - Should proc only from Rupture ticks. +DELETE FROM `spell_proc_event` WHERE `entry` IN(67209); +INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `procFlags`) VALUES +(67209, 0x01, 8, 0x100000, 0x50000); diff --git a/sql/old/3.3.5a/2012_04_24_05_world_creature_loot_template.sql b/sql/old/3.3.5a/2012_04_24_05_world_creature_loot_template.sql new file mode 100644 index 00000000000..c524999b492 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_24_05_world_creature_loot_template.sql @@ -0,0 +1,9 @@ +-- Apply same loot template to below mentioned Bloodsail NPCs as that of Bloodsail Raider 1561 +-- (Mage 1562, Swashbuckler 1563, Warlock 1564, Sea Dog 1565) +UPDATE `creature_template` SET `lootid`=1561 WHERE `entry` IN (1562,1563,1564,1565); +-- Remove Loot from `creature_loot_template` for above mentioned NPCs because it contains only 2 items. +-- Those 2 items, along with complete loot template for these mobs is applied in query above. +DELETE FROM `creature_loot_template` WHERE `entry` IN (1562,1563,1564,1565); +-- Remove loot and gold drop from Bloodsail Warlock's Minions +UPDATE `creature_template` SET `lootid`=0, `mingold`=0 AND `maxgold`=0 WHERE `entry` IN (10928,12922); +DELETE FROM `creature_loot_template` WHERE `entry` IN (10928,12922); diff --git a/sql/old/3.3.5a/2012_04_24_06_world_misc.sql b/sql/old/3.3.5a/2012_04_24_06_world_misc.sql new file mode 100644 index 00000000000..2e095a76cd9 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_24_06_world_misc.sql @@ -0,0 +1,31 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` = 46485; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(46485,'spell_item_greatmothers_soulcatcher'); + +DELETE FROM `conditions` WHERE `SourceEntry` IN (46485,46488); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,1,46485,0,1,31,1,3,26817,0,0,0,'',''), +(13,1,46485,0,1,36,1,0,0,0,1,0,'',''), +(13,1,46488,0,1,31,1,3,26817,0,0,0,'',''), +(13,1,46488,0,1,36,1,0,0,0,1,0,'',''); + +-- Gnome Soul SAI +SET @ENTRY := 26096; +SET @SPELL_ARCANE_EXPLOSION := 35426; +UPDATE creature_template SET AIName="SmartAI" WHERE entry=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,1,54,0,100,0,0,0,0,0,33,@ENTRY,0,0,0,0,0,7,0,0,0,0,0,0,0,"Gnome Soul - On Just Summoned - Quest Credit"), +(@ENTRY,0,1,2,61,0,100,0,0,0,0,0,45,1,1,0,0,0,0,19,25814,10,1,0,0,0,0,"Gnome Soul - On Just Summoned - Set Data Fizzcrank Mechagnome"), +(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,69,1,0,0,0,0,0,7,0,0,0,0,0,0,0,"Gnome Soul - On Just Summoned - Move to Summoner"), + +(@ENTRY,0,3,4,34,0,100,0,1,0,0,0,11,@SPELL_ARCANE_EXPLOSION,0,0,0,0,0,1,0,0,0,0,0,0,0,"Gnome Soul - Reached Summoner - Cast Arcane Explosion Visual"), +(@ENTRY,0,4,0,61,0,100,0,0,0,0,0,41,1000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Gnome Soul - Reached Summoner - Forced Despawn"); + +-- Fizzcrank Mechagnome SAI +SET @ENTRY := 25814; +UPDATE creature_template SET AIName="SmartAI" WHERE entry=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,4,0,100,0,0,0,0,0,1,1,10000,0,0,0,0,0,0,0,0,0,0,0,0,"Fizzcrank Mechagnome - Chance Say on Aggro"), +(@ENTRY,1,0,0,38,0,100,0,1,1,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Fizzcrank Mechagnome - On Data Set - Forced Despawn"); diff --git a/sql/old/3.3.5a/2012_04_25_00_world_misc.sql b/sql/old/3.3.5a/2012_04_25_00_world_misc.sql new file mode 100644 index 00000000000..3d2f20fdc8c --- /dev/null +++ b/sql/old/3.3.5a/2012_04_25_00_world_misc.sql @@ -0,0 +1,3 @@ +UPDATE `smart_scripts` SET `source_type`=0,`id`=1 WHERE `entryorguid`=24814 AND `source_type`=1 AND `event_type`=38; +UPDATE `conditions` SET `SourceTypeOrReferenceId`=17 WHERE `SourceEntry` IN (46485,46488); +UPDATE `conditions` SET `ElseGroup`=0 WHERE `SourceEntry` IN (46485,46488) AND `ConditionValue1`=26817; diff --git a/sql/old/3.3.5a/2012_04_25_01_world_spell_script_names.sql b/sql/old/3.3.5a/2012_04_25_01_world_spell_script_names.sql new file mode 100644 index 00000000000..7b7135860ab --- /dev/null +++ b/sql/old/3.3.5a/2012_04_25_01_world_spell_script_names.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` = 33110; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(33110,'spell_pri_prayer_of_mending_heal'); diff --git a/sql/old/3.3.5a/2012_04_25_02_world_spell_script_names.sql b/sql/old/3.3.5a/2012_04_25_02_world_spell_script_names.sql new file mode 100644 index 00000000000..ad63bc87837 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_25_02_world_spell_script_names.sql @@ -0,0 +1,11 @@ +DELETE FROM `spell_scripts` WHERE `id` IN (15998,25952,29435,45980,51592,51910,52267,54420); +DELETE FROM `spell_script_names` WHERE `spell_id` IN (15998,25952,29435,45980,51592,51910,52267,54420); +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(15998, 'spell_gen_despawn_self'), +(25952, 'spell_gen_despawn_self'), +(29435, 'spell_gen_despawn_self'), +(45980, 'spell_gen_despawn_self'), +(51592, 'spell_gen_despawn_self'), +(51910, 'spell_gen_despawn_self'), +(52267, 'spell_gen_despawn_self'), +(54420, 'spell_gen_despawn_self'); diff --git a/sql/old/3.3.5a/2012_04_25_03_world_spell_group.sql b/sql/old/3.3.5a/2012_04_25_03_world_spell_group.sql new file mode 100644 index 00000000000..a6fa90ad41d --- /dev/null +++ b/sql/old/3.3.5a/2012_04_25_03_world_spell_group.sql @@ -0,0 +1,11 @@ +DELETE FROM `spell_group` WHERE `id` IN (1117,1118); +INSERT INTO `spell_group` (`id`,`spell_id`) VALUES +(1117,25898), +(1117,25899), +(1118,20911), +(1118,20217); + +DELETE FROM `spell_group_stack_rules` WHERE `group_id` in (1117,1118); +INSERT INTO `spell_group_stack_rules` (`group_id`,`stack_rule`) VALUES +(1117,3), +(1118,3); diff --git a/sql/old/3.3.5a/2012_04_26_00_world_conditions.sql b/sql/old/3.3.5a/2012_04_26_00_world_conditions.sql new file mode 100644 index 00000000000..8d525cad057 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_26_00_world_conditions.sql @@ -0,0 +1 @@ +UPDATE `conditions` SET `ElseGroup` = 0, `SourceGroup` = 0 WHERE `SourceEntry` IN (46485,46488); diff --git a/sql/old/3.3.5a/2012_04_26_01_world_smart_scripts.sql b/sql/old/3.3.5a/2012_04_26_01_world_smart_scripts.sql new file mode 100644 index 00000000000..e90e7b58433 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_26_01_world_smart_scripts.sql @@ -0,0 +1 @@ +UPDATE `smart_scripts` SET `source_type` = 0, `id` = 1 WHERE `entryorguid` = 25814 AND `source_type` = 1 AND `id` = 0; diff --git a/sql/old/3.3.5a/2012_04_27_00_world_instance_icc.sql b/sql/old/3.3.5a/2012_04_27_00_world_instance_icc.sql new file mode 100644 index 00000000000..6738e4904ab --- /dev/null +++ b/sql/old/3.3.5a/2012_04_27_00_world_instance_icc.sql @@ -0,0 +1,5 @@ +DELETE FROM `creature_text` WHERE `entry`=37813 AND `groupid`=14; +INSERT INTO `creature_text` (`entry`,`groupid`,`text`,`type`,`comment`) VALUES (37813,14,'%s''s Blood Beasts gain the scent of blood!',41,'Deathbringer Saurfang - EMOTE_SCENT_OF_BLOOD'); +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=72771; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`Comment`) VALUES +(13,3,72771,31,3,38508,'Deathbringer Saurfang - Scent of Blood on Blood Beast'); diff --git a/sql/old/3.3.5a/2012_04_28_00_world_reference_loot_template.sql b/sql/old/3.3.5a/2012_04_28_00_world_reference_loot_template.sql new file mode 100644 index 00000000000..07c53a8f7c9 --- /dev/null +++ b/sql/old/3.3.5a/2012_04_28_00_world_reference_loot_template.sql @@ -0,0 +1,158 @@ +-- The Descent into Madness +-- References +-- ------------------------------- +-- -- Variables and definitions -- +-- ------------------------------- +-- Set References +SET @Vezax10Ref := 34373; +SET @Vezax25Ref := @Vezax10Ref+1; +SET @Yogg10Ref := @Vezax10Ref+2; +SET @Yogg25Ref := @Vezax10Ref+3; +SET @Chest := 12034; +SET @Shoulder := 12035; +SET @EmblemRef := 34349; +SET @Recipe := 34154; +SET @Vezax10 := 33271; +SET @Vezax25 := 33449; +SET @Yogg10 := 33288; +SET @Yogg25 := 33955; + +-- ------------------------- +-- -- Reference Templates -- +-- ------------------------- +-- Delete previous templates if existing +DELETE FROM `reference_loot_template` WHERE `entry` IN (34131,34132,34133,34164,34165); +DELETE FROM `reference_loot_template` WHERE `entry` IN (@Vezax10Ref,@Vezax25Ref,@Yogg10Ref,@Yogg25Ref,@Chest,@Shoulder); +INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- Vezax 10 man +(@Vezax10Ref,46014,0,1,1,1,1), -- Saronite Animus Cloak +(@Vezax10Ref,46008,0,1,1,1,1), -- Choker of the Abyss +(@Vezax10Ref,46010,0,1,1,1,1), -- Darkstone Ring +(@Vezax10Ref,45996,0,1,1,1,1), -- Hoperender +(@Vezax10Ref,46015,0,1,1,1,1), -- Pendant of Endless Despair +(@Vezax10Ref,46013,0,1,1,1,1), -- Underworld Mantle +(@Vezax10Ref,46012,0,1,1,1,1), -- Vestments of the Piercing Light +(@Vezax10Ref,46009,0,1,1,1,1), -- Bindings of the Depths +(@Vezax10Ref,45997,0,1,1,1,1), -- Gauntlets of the Wretched +(@Vezax10Ref,46011,0,1,1,1,1), -- Shadowbite +-- Vezax 25 man +(@Vezax25Ref,45513,0,1,1,1,1), -- Boots of the Forgotten Dephts +(@Vezax25Ref,45509,0,1,1,1,1), -- Idol of the Corruptor +(@Vezax25Ref,45501,0,1,1,1,1), -- Boots of the Underdweller +(@Vezax25Ref,45512,0,1,1,1,1), -- Grips of the Unbroken +(@Vezax25Ref,45503,0,1,1,1,1), -- Metallic Loop of the Sufferer +(@Vezax25Ref,45505,0,1,1,1,1), -- Belt of Clinging Hope +(@Vezax25Ref,45502,0,1,1,1,1), -- Helm of the Faceless +(@Vezax25Ref,45145,0,1,1,1,1), -- Libram of the Sacred Shield +(@Vezax25Ref,45508,0,1,1,1,1), -- Belt of the Darkspeaker +(@Vezax25Ref,45504,0,1,1,1,1), -- Darkcore Leggings +(@Vezax25Ref,45514,0,1,1,1,1), -- Mantle of the Unknowing +(@Vezax25Ref,45515,0,1,1,1,1), -- Ring of the Vacant Eye +(@Vezax25Ref,45507,0,1,1,1,1), -- The General's Heart +-- Yogg 10 man +(@Yogg10Ref,46016,0,1,1,1,1), -- Abaddon +(@Yogg10Ref,46018,0,1,1,1,1), -- Deliverance +(@Yogg10Ref,46019,0,1,1,1,1), -- Leggings of the Insatiable +(@Yogg10Ref,46021,0,1,1,1,1), -- Royal Seal of King Llane +(@Yogg10Ref,46022,0,1,1,1,1), -- Pendant of a Thousand Maws +(@Yogg10Ref,46024,0,1,1,1,1), -- Kingsbane +(@Yogg10Ref,46025,0,1,1,1,1), -- Devotion +(@Yogg10Ref,46028,0,1,1,1,1), -- Faceguard of the Eyeless Horror +(@Yogg10Ref,46030,0,1,1,1,1), -- Threads of the Dragon Council +(@Yogg10Ref,46031,0,1,1,1,1), -- Touch of Madness +-- Yogg 25 man +(@Yogg25Ref,45521,0,1,1,1,1), -- Earthshaper +(@Yogg25Ref,45522,0,1,1,1,1), -- Blood of the Old God +(@Yogg25Ref,45523,0,1,1,1,1), -- Garona's Guise +(@Yogg25Ref,45524,0,1,1,1,1), -- Chestguard of Insidious Intent +(@Yogg25Ref,45525,0,1,1,1,1), -- Godbane Signet +(@Yogg25Ref,45527,0,1,1,1,1), -- Soulscribe +(@Yogg25Ref,45529,0,1,1,1,1), -- Shawl of Haunted Memories +(@Yogg25Ref,45530,0,1,1,1,1), -- Sanity's Bond +(@Yogg25Ref,45531,0,1,1,1,1), -- Chestguard of the Fallen God +(@Yogg25Ref,45532,0,1,1,1,1), -- Cowl of Dark Whispers +-- Chest for Yogg +(@Chest,45635,0,1,1,1,1), -- Chestguard of the Wayward Conqueror +(@Chest,45636,0,1,1,1,1), -- Chestguard of the Wayward Protector +(@Chest,45637,0,1,1,1,1), -- Chestguard of the Wayward Vanquisher +(@Shoulder,45656,0,1,1,1,1), -- Mantle of the Wayward Conqueror +(@Shoulder,45657,0,1,1,1,1), -- Mantle of the Wayward Protector +(@Shoulder,45658,0,1,1,1,1); -- Mantle of the Wayward Vanquisher + +DELETE FROM `creature_loot_template` WHERE `entry` IN(@Vezax10,@Vezax25,@Yogg10,@Yogg25); +INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- ---------------------------------------------------------- +-- General Vezax +-- ---------------------------------------------------------- +-- 10 man mode +(@Vezax10,1,100,3,0,-@Vezax10Ref,2), -- 2x Normal Loot Item +(@Vezax10,47241,100,3,0,1,1), -- 1x Emblem of Triumph +-- hardmode loot 10 +(@Vezax10,46032,0,2,1,1,1), -- Drape of the Faceless General +(@Vezax10,46034,0,2,1,1,1), -- Leggings of Profound Darkness +(@Vezax10,46033,0,2,1,1,1), -- Tortured Earth +(@Vezax10,46035,0,2,1,1,1), -- Aesuga, Hand of the Ardent Champion +(@Vezax10,46036,0,2,1,1,1), -- Void Sabre +-- 25 man mode +(@Vezax25,1,100,3,0,-@Vezax25Ref,3), -- 3x Normal Loot Item +(@Vezax25,47241,100,3,0,1,1), -- 1x Emblem of Triumph +(@Vezax25,2,10,1,0,-@Recipe,1), -- Chance on Recipe +(@Vezax25,3,10,1,0,-34350,1), -- Chance on Runed Orb +-- hardmode loot 25 +(@Vezax25,45498,0,2,1,1,1), -- Lotrafen, Spear of the Damned +(@Vezax25,45511,0,2,1,1,1), -- Scepter of Lost Souls +(@Vezax25,45516,0,2,1,1,1), -- Voldrethar, Dark Blade of Oblivion +(@Vezax25,45517,0,2,1,1,1), -- Pendulum of Infinity +(@Vezax25,45519,0,2,1,1,1), -- Vestments of the Blind Denizen +(@Vezax25,45518,0,2,1,1,1), -- Flare of the Heavens +(@Vezax25,45520,0,2,1,1,1), -- Handwraps of the Vigilant +-- ---------------------------------------------------------- +-- Yogg Saron +-- ---------------------------------------------------------- +-- 10 man +-- All modes +(@Yogg10,1,100,31,0,-@Yogg10Ref,1), -- 1x Normal Loot item for modes 0&1&2&3&4 +(@Yogg10,2,100,31,0,-@Chest,1), -- 1x Tier token for modes 0&1&2&3&4 +(@Yogg10,47241,100,31,0,1,1), -- 1x Emblem of Triumph for modes 0&1&2&3&4 +-- Extra for <3 watchers +(@Yogg10,3,100,30,0,-@EmblemRef,1), -- additional Emblem for modes2&3 +-- Extra for <2 watchers +(@Yogg10,4,100,28,0,-34350,1), -- Runed Orb for 0&1&2 +(@Yogg10,5,10,28,0,-@Recipe,1), -- Chance on Recipe for 0&1&2 +-- Extra for <1 watchers +(@Yogg10,6,100,24,0,-@EmblemRef,1), -- additional Emblem for 0&1 +(@Yogg10,7,100,24,0,-@Recipe,1), -- Garanteed Recipe for 0&1 +-- Hardmode 10 loot +(@Yogg10,46067,0,24,1,1,1), -- Hammer of Crushing Whispers +(@Yogg10,46068,0,24,1,1,1), -- Amice of Inconceivable Horror +(@Yogg10,46095,0,24,1,1,1), -- Soul-Devouring Cinch +(@Yogg10,46096,0,24,1,1,1), -- Signet of Soft Lament +(@Yogg10,46097,0,24,1,1,1), -- Caress of Insanity +-- Extra for 0 watchers +(@Yogg10,46312,100,16,0,1,1), -- Vanquished Clutches of Yogg-Saron +-- 25 man mode +-- All modes +(@Yogg25,1,100,31,0,-@Yogg25Ref,2), -- 2x Normal Loot item for modes 0&1&2&3&4 +(@Yogg25,2,100,31,0,-@Shoulder,2), -- 2x Tier token for modes 0&1&2&3&4 +(@Yogg25,47241,100,31,0,1,1), -- 1x Emblem of Triumph for modes 0&1&2&3&4 +(@Yogg25,3,10,31,0,-34350,1), -- Chance on Runed Orb for modes 0&1&2&3&4 +(@Yogg25,4,10,31,0,-@Recipe,1), -- Chance on Recipe for 0&1&2&3&4 +(@Yogg25,45897,100,31,0,1,1), -- Fragment of Val'anyr +-- Extra for <3 watchers +(@Yogg25,5,100,30,0,-@EmblemRef,1), -- additional Emblem for modes2&3 +-- Extra for <2 watchers +(@Yogg25,6,100,28,0,-34350,1), -- Runed Orb for 0&1&2 +-- Extra for <1 watchers +(@Yogg25,7,100,24,0,-@EmblemRef,1), -- additional Emblem for 0&1 +(@Yogg25,8,100,24,0,-@Recipe,1), -- Garanteed Recipe for 0&1 +-- Hardmode 25 loot +(@Yogg25,45533,0,24,1,1,1), -- Dark Edge of Depravity +(@Yogg25,45534,0,24,1,1,1), -- Seal of the Betrayed King +(@Yogg25,45535,0,24,1,1,1), -- Show of Faith +(@Yogg25,45536,0,24,1,1,1), -- Legguards of Cunning Deception +(@Yogg25,45537,0,24,1,1,1), -- Threads of the False Oracle +-- Extra for 0 watchers +(@Yogg25,45693,100,16,0,1,1); -- Mimiron's Head + +-- Cleanups +DELETE FROM `conditions` WHERE `SourceEntry`=45897 AND `SourceGroup`=33955; diff --git a/sql/old/3.3.5a/2012_04_28_01_world_reference_loot_template.sql b/sql/old/3.3.5a/2012_04_28_01_world_reference_loot_template.sql new file mode 100644 index 00000000000..e46c45e497a --- /dev/null +++ b/sql/old/3.3.5a/2012_04_28_01_world_reference_loot_template.sql @@ -0,0 +1,22 @@ +SET @Triumph :=47241; +-- Cleanup some unneeded references +DELETE FROM `reference_loot_template` WHERE `entry` IN (34167,34168,34169); +UPDATE `creature_loot_template` SET `mincountOrRef`=-34349 WHERE `mincountOrRef` IN (-34167,-34168,-34169); +-- Fix this weird defined reference for ulduar +UPDATE `reference_loot_template` SET `ChanceOrQuestChance`=100,`groupid`=0 WHERE `entry`=34349; +-- Remove Emblem of Triumph from reference_loot +DELETE FROM `reference_loot_template` WHERE `item`=@Triumph AND `entry`IN (12025,35034,35040,35049); +-- Actual Emblem on creature as it should be +DELETE FROM `creature_loot_template` WHERE `entry` IN (30397,30398,31365,31367,31656,31679) AND `item`=@Triumph; +INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(30397,@Triumph,100,1,0,1,1), -- Commander Kolurg (1) +(30398,@Triumph,100,1,0,1,1), -- Commander Stoutbeard (1) +(31365,@Triumph,100,1,0,1,1), -- Drakkari Colossus (1) +(31367,@Triumph,100,1,0,1,1), -- Drakkari Elemental (1) +(31656,@Triumph,100,1,0,1,1), -- Dalronn the Controller (1) +(31679,@Triumph,100,1,0,1,1); -- Skarvald the Constructor (1) +-- Similar action for gameobjects +DELETE FROM `gameobject_loot_template` WHERE `entry` IN (27416,27417) AND `item`=@Triumph; +INSERT INTO `gameobject_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(27417,@Triumph,100,1,0,1,1), -- Confessor's Cache +(27416,@Triumph,100,1,0,1,1); -- Eadric's Cache diff --git a/sql/old/3.3.5a/2012_05_01_00_world_creature.sql b/sql/old/3.3.5a/2012_05_01_00_world_creature.sql new file mode 100644 index 00000000000..c0509d0d132 --- /dev/null +++ b/sql/old/3.3.5a/2012_05_01_00_world_creature.sql @@ -0,0 +1,9 @@ +-- Add missing Challe & Orphan Matron Aria Spawns +SET @GUID := 41876; +DELETE FROM `creature` WHERE `guid` BETWEEN @GUID AND @GUID+1; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(@GUID,23101,530,1,1,0,0,-480.4989,7499.029,181.2889,3.560472,120,0,0,1,0,0), +(@GUID+1,34365,571,1,1,0,0,5716.604,642.8611,646.2927,5.88176,120,0,0,1,0,0); +-- Add to game event creature +DELETE FROM `game_event_creature` WHERE `guid`=@GUID+1; +INSERT INTO `game_event_creature` (`eventEntry`,`guid`) VALUES (10,@GUID+1); diff --git a/sql/old/3.3.5a/2012_05_02_00_world_creature_loot_template.sql b/sql/old/3.3.5a/2012_05_02_00_world_creature_loot_template.sql new file mode 100644 index 00000000000..f0721e63635 --- /dev/null +++ b/sql/old/3.3.5a/2012_05_02_00_world_creature_loot_template.sql @@ -0,0 +1,8 @@ +DELETE FROM `creature_loot_template` WHERE `entry` IN(38064,38103); +INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- Precious 25 man +(38103,1,100,1,0,-35069,2), -- Two From ICC Trashgenerated on Precious +(38103,52019,30,1,0,1,1), -- Precious Ribbon on Precious +(38064,1,100,1,0,-35069,2); -- Two From ICC Trashgenerated on Stinky +-- add skinning loot for Stinky & Precious +UPDATE `creature_template` SET `skinloot`=70214 WHERE `entry` IN (37025,38064,37217,38103); diff --git a/sql/old/3.3.5a/2012_05_03_00_world_creature.sql b/sql/old/3.3.5a/2012_05_03_00_world_creature.sql new file mode 100644 index 00000000000..d906dba78bc --- /dev/null +++ b/sql/old/3.3.5a/2012_05_03_00_world_creature.sql @@ -0,0 +1,29 @@ +SET @GUID1 := 42158; +SET @GUID2 := 42159; +-- add creature +DELETE FROM creature WHERE guid IN (@GUID1,@GUID2); +INSERT INTO `creature` +(`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`) +VALUES +(@GUID1 ,38453,571,1,1,3561.821,-2736.367,136.0317,0), -- Arcturis in Grizzly Hills +(@GUID2,35189,571,1,1,7101.845,-1443.734,924.2609,0.178631); -- Skoll in The Storm Peaks +-- Update template +UPDATE `creature_template` SET `faction_A` = 190, `faction_H`=190 WHERE `entry` IN (38453,35189); +SET @NPC= @GUID1*10; +-- Add pathing for Arcturis +DELETE FROM `creature_addon` WHERE `guid` = @GUID1; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(@GUID1,@NPC,0,0,0,0,''); -- Add path for Acturis +-- Add waypoint data for the path: +DELETE FROM `waypoint_data` WHERE `id`=@NPC; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`) VALUES +(@NPC,1,3563.499,-2737.698,137.1898), +(@NPC,2,3565.249,-2738.698,138.4398), +(@NPC,3,3566.749,-2739.948,139.9398), +(@NPC,4,3568.249,-2740.698,140.6898), +(@NPC,5,3567.839,-2741.380,141.9256), +(@NPC,6,3569.999,-2741.948,142.1898), +(@NPC,7,3570.749,-2742.448,143.1898), +(@NPC,8,3572.676,-2743.528,144.8479); +-- Spawntimefix +UPDATE `creature` SET `spawntimesecs`=39600 WHERE `guid` IN (@GUID1,@GUID2); -- Set the spawntime to 11 hours for Arcturis & Skoll diff --git a/sql/old/3.3.5a/2012_05_03_01_world_cos_misc.sql b/sql/old/3.3.5a/2012_05_03_01_world_cos_misc.sql new file mode 100644 index 00000000000..6c2ea6d3a95 --- /dev/null +++ b/sql/old/3.3.5a/2012_05_03_01_world_cos_misc.sql @@ -0,0 +1,153 @@ +UPDATE `script_texts` SET `emote` = 432 WHERE `entry` IN (-1595111); +UPDATE `script_texts` SET `emote` = 396 WHERE `entry` IN (-1595070,-1595075,-1595078,-1595079,-1595088,-1595103,-1595106,-1595107,-1595108,-1595109,-1595113,-1595114,-1595115,-1595116); +UPDATE `script_texts` SET `emote` = 397 WHERE `entry` IN (-1595071,-1595084,-1595093); +UPDATE `script_texts` SET `emote` = 274 WHERE `entry` IN (-1595091); +UPDATE `script_texts` SET `emote` = 5 WHERE `entry` IN (-1595073,-1595118); +UPDATE `script_texts` SET `emote` = 6 WHERE `entry` IN (-1595076); +UPDATE `script_texts` SET `emote` = 1 WHERE `entry` IN (-1595083,-1595100,-1595104,-1595120); +UPDATE `script_texts` SET `emote` = 0 WHERE `entry` IN (-1595009,-1595010,-1595081,-1595082,-1595085,-1595119); + +UPDATE `script_texts` SET `type` = 1 WHERE `entry` IN (-1595009,-1595010,-1595087,-1595094,-1595095,-1595093); +UPDATE `script_texts` SET `type` = 0 WHERE `entry` IN (-1595077,-1595078,-1595119); + +UPDATE `script_texts` SET `content_default` = "Champions, meet me at the Town Hall at once. We must take the fight to Mal'Ganis." WHERE `entry` = -1595095; +UPDATE `script_texts` SET `content_default` = "Follow me, I know the way through." WHERE `entry` = -1595096; +UPDATE `script_texts` SET `content_default` = "Take position here, and I will lead a small force inside Stratholme to begin the culling. We must contain and purge the infected for the sake of all of Lordaeron!" WHERE entry = -1595087; +UPDATE `script_texts` SET `content_default` = "Ah, you've finally arrived Prince Arthas. You're here just in the nick of time." WHERE `entry` = -1595097; +UPDATE `script_texts` SET `content_default` = "Yes, I'm glad I could get to you before the plague." WHERE `entry` = -1595098; +UPDATE `script_texts` SET `content_default` = "As if I could forget. Listen, Uther, there's something about the plague you should know..." WHERE `entry` = -1595072; +UPDATE `script_texts` SET `content_default` = "There's no need for you to understand, Arthas. All you need to do is die." WHERE `entry` = -1595100; +UPDATE `script_texts` SET `content_default` = "More vile sorcery! Be ready for anything!" WHERE `entry` = -1595102; +UPDATE `script_texts` SET `content_default` = "Watch your backs: they have us surrounded in this hall." WHERE `entry` = -1595104; +UPDATE `script_texts` SET `content_default` = "Mal'Ganis is not making this easy." WHERE `entry` = -1595106; +UPDATE `script_texts` SET `content_default` = "What else can he put in my way?" WHERE `entry` = -1595108; +UPDATE `script_texts` SET `content_default` = "I do what I must for Lordaeron, and neither your words nor your actions will stop me." WHERE `entry` = -1595109; +UPDATE `script_texts` SET `content_default` = "The quickest path to Mal'Ganis lies behind that bookshelf ahead." WHERE `entry` = -1595110; +UPDATE `script_texts` SET `content_default` = "I'm relieved this secret passage still works." WHERE `entry` = -1595112; +UPDATE `script_texts` SET `content_default` = "Let's move through here as quickly as possible. If the undead don't kill us, the fires might." WHERE `entry` = -1595113; +UPDATE `script_texts` SET `content_default` = "Rest a moment and clear your lungs, but we must move again soon." WHERE `entry` = -1595114; +UPDATE `script_texts` SET `content_default` = "That's enough; we must move again. Mal'Ganis awaits." WHERE `entry` = -1595115; +UPDATE `script_texts` SET `content_default` = "At last some good luck. Market Row has not caught fire yet. Mal'Ganis is supposed to be in Crusaders' Square, which is just ahead. Tell me when you're ready to move forward." WHERE `entry` = -1595116; +UPDATE `script_texts` SET `content_default` = "Justice will be done." WHERE `entry` = -1595117; +UPDATE `script_texts` SET `content_default` = "We're going to finish this right now, Mal'Ganis. Just you... and me." WHERE `entry` = -1595118; + +UPDATE `script_texts` SET `comment` = concat(`comment`,". NEEDS VERIFICATION") WHERE `entry` IN (-1595101,-1595105); + +SET @GUID := 88474; +INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, +`MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) +VALUES +(@GUID+00,27737,595,3,1,25543,0,2319.89,1285.78,131.407,1.72169,60,10,0,630,0,1,0,0,0), +(@GUID+01,27737,595,3,1,10979,0,2308.12,1304.21,127.601,4.39662,60,10,0,630,0,1,0,0,0), +(@GUID+02,27737,595,3,1,25542,0,2335.47,1262.04,132.921,1.42079,60,10,0,630,0,1,0,0,0), +(@GUID+03,27737,595,3,1,25543,0,2297.73,1338.75,124.622,2.5574,60,10,0,630,0,1,0,0,0), +(@GUID+04,27737,595,3,1,10979,0,2322.65,1265.39,133.033,5.6524,60,10,0,630,0,1,0,0,0), +(@GUID+05,27737,595,3,1,10973,0,2277.83,1331.92,124.19,3.48045,60,10,0,630,0,1,0,0,0), +(@GUID+06,27737,595,3,1,25543,0,2294.18,1316.93,125.672,6.05649,60,10,0,630,0,1,0,0,0), +(@GUID+07,27737,595,3,1,10973,0,2310.56,1369,128.372,5.03364,60,10,0,630,0,1,0,0,0), +(@GUID+08,27737,595,3,1,10979,0,2306.15,1322.85,125.708,4.99133,60,10,0,630,0,1,0,0,0), +(@GUID+09,27737,595,3,1,10973,0,2320.14,1297.48,129.694,1.35248,60,10,0,630,0,1,0,0,0), +(@GUID+10,27737,595,3,1,25542,0,2291.57,1327.27,124.545,5.32358,60,10,0,630,0,1,0,0,0), +(@GUID+11,27737,595,3,1,25542,0,2308.04,1352.65,126.907,5.83741,60,10,0,630,0,1,0,0,0), +(@GUID+12,27737,595,3,1,10979,0,2329.44,1281.11,132.636,2.25207,60,10,0,630,0,1,0,0,0), +(@GUID+13,27737,595,3,1,0,0,2407.32,1423.8,131.522,6.24743,60,10,0,706,0,1,0,0,0), +(@GUID+14,27737,595,3,1,0,0,2417.26,1428.41,131.652,6.20423,60,10,0,730,0,1,0,0,0), +(@GUID+15,27737,595,3,1,0,0,2420.48,1419.99,130.716,0.0977616,60,10,0,706,0,1,0,0,0), +(@GUID+16,27737,595,3,1,0,0,2426.63,1413.41,130.464,0.404064,60,10,0,730,0,1,0,0,0), +(@GUID+17,27737,595,3,1,0,0,2430.46,1417.6,130.557,0.125247,60,10,0,730,0,1,0,0,0), +(@GUID+18,27737,595,3,1,0,0,2433.94,1427.03,131.18,0.0584885,60,10,0,706,0,1,0,0,0), +(@GUID+19,27737,595,3,1,0,0,2446.5,1428.37,131.013,6.10606,60,10,0,756,0,1,0,0,0), +(@GUID+20,27737,595,3,1,0,0,2449.49,1423.35,130.588,5.77619,60,10,0,706,0,1,0,0,0), +(@GUID+21,27737,595,3,1,0,0,2441.92,1424.41,130.606,6.07857,60,10,0,706,0,1,0,0,0), +(@GUID+22,27737,595,3,1,0,0,2450.6,1438.61,132.213,4.74889,60,10,0,730,0,1,0,0,0), +(@GUID+23,27737,595,3,1,0,0,2460.17,1436.46,131.501,4.73711,60,10,0,756,0,1,0,0,0), +(@GUID+24,27737,595,3,1,0,0,2444.68,1421.68,130.324,6.01338,60,10,0,756,0,1,0,0,0), +(@GUID+25,27737,595,3,1,0,0,2456.87,1419.07,130.488,5.39763,60,10,0,706,0,1,0,0,0), +(@GUID+26,27737,595,3,1,0,0,2464.27,1422.15,130.976,5.22092,60,10,0,756,0,1,0,0,0), +(@GUID+27,27737,595,3,1,0,0,2468.21,1403.06,130.39,5.6364,60,10,0,756,0,1,0,0,0), +(@GUID+28,27737,595,3,1,0,0,2460.88,1406.8,130.508,5.96234,60,10,0,756,0,1,0,0,0), +(@GUID+29,27737,595,3,1,0,0,2485.77,1398.35,130.795,4.71591,60,10,0,756,0,1,0,0,0), +(@GUID+30,27737,595,3,1,0,0,2485.79,1380.46,130.15,5.02928,60,10,0,730,0,1,0,0,0), +(@GUID+31,27737,595,3,1,0,0,2475.77,1396.31,130.124,4.84079,60,10,0,730,0,1,0,0,0), +(@GUID+32,27737,595,3,1,0,0,2476.92,1387.21,129.401,5.05128,60,10,0,730,0,1,0,0,0), +(@GUID+33,27737,595,3,1,0,0,2483.24,1389.37,130.123,4.74104,60,10,0,730,0,1,0,0,0), +(@GUID+34,27737,595,3,1,0,0,2480.2,1370.15,129.533,5.79583,60,10,0,706,0,1,0,0,0), +(@GUID+35,27737,595,3,1,0,0,2481.54,1375.11,129.642,5.4644,60,10,0,730,0,1,0,0,0), +(@GUID+36,27737,595,3,1,0,0,2489.44,1359.42,131.233,5.378,60,10,0,730,0,1,0,0,0), +(@GUID+37,27737,595,3,1,0,0,2486.59,1356.19,131.876,5.7275,60,10,0,756,0,1,0,0,0), +(@GUID+38,27737,595,3,1,0,0,2495.53,1348.61,133.072,5.52722,60,10,0,730,0,1,0,0,0), +(@GUID+39,27737,595,3,1,0,0,2504.48,1349.65,132.856,5.11881,60,10,0,730,0,1,0,0,0), +(@GUID+40,27737,595,3,1,0,0,2493.11,1380.29,130.24,4.93189,60,10,0,706,0,1,0,0,0), +(@GUID+41,27737,595,3,1,0,0,2487.18,1392.64,130.512,4.93818,60,10,0,706,0,1,0,0,0), +(@GUID+42,27737,595,3,1,0,0,2506.49,1336.89,132.794,5.19343,60,10,0,756,0,1,0,0,0), +(@GUID+43,27737,595,3,1,0,0,2518.2,1306.39,130.623,4.81723,60,10,0,756,0,1,0,0,0), +(@GUID+44,27737,595,3,1,0,0,2513.4,1299.67,130.868,4.4206,60,10,0,756,0,1,0,0,0), +(@GUID+45,27737,595,3,1,0,0,2511.45,1291.47,130.808,5.00729,60,10,0,756,0,1,0,0,0), +(@GUID+46,27737,595,3,1,0,0,2518.56,1292.32,130.528,5.16438,60,10,0,756,0,1,0,0,0), +(@GUID+47,27737,595,3,1,0,0,2515.49,1279.85,129.214,5.28847,60,10,0,730,0,1,0,0,0), +(@GUID+48,27737,595,3,1,0,0,2514.37,1285.92,129.934,5.70473,60,10,0,706,0,1,0,0,0), +(@GUID+49,27737,595,3,1,0,0,2522.65,1274.29,128.576,5.44634,60,10,0,706,0,1,0,0,0), +(@GUID+50,27737,595,3,1,0,0,2535.38,1275.77,127.42,5.49817,60,10,0,756,0,1,0,0,0), +(@GUID+51,27737,595,3,1,0,0,2537.59,1273.1,127.05,5.02693,60,10,0,730,0,1,0,0,0), +(@GUID+52,27737,595,3,1,0,0,2547.49,1261.7,126.44,4.78425,60,10,0,730,0,1,0,0,0), +(@GUID+53,27737,595,3,1,0,0,2534.36,1261.06,127.125,4.3994,60,10,0,756,0,1,0,0,0), +(@GUID+54,27737,595,3,1,0,0,2532.69,1251.44,127.452,5.4479,60,10,0,730,0,1,0,0,0), +(@GUID+55,27737,595,3,1,0,0,2551.84,1252.35,125.455,5.04342,60,10,0,706,0,1,0,0,0), +(@GUID+56,27737,595,3,1,0,0,2536.1,1244,126.928,5.16515,60,10,0,756,0,1,0,0,0), +(@GUID+57,27737,595,3,1,0,0,2543.63,1247.23,126.131,5.19735,60,10,0,706,0,1,0,0,0), +(@GUID+58,27737,595,3,1,0,0,2554.21,1238.95,125.475,4.64836,60,10,0,730,0,1,0,0,0), +(@GUID+59,27737,595,3,1,0,0,2548.89,1227.37,126.375,5.31517,60,10,0,756,0,1,0,0,0), +(@GUID+60,27737,595,3,1,0,0,2560.46,1225.4,125.496,4.85335,60,10,0,706,0,1,0,0,0), +(@GUID+61,27737,595,3,1,0,0,2555.11,1218.55,125.944,5.11646,60,10,0,730,0,1,0,0,0), +(@GUID+62,27737,595,3,1,0,0,2561.91,1211.56,125.38,5.5877,60,10,0,730,0,1,0,0,0), +(@GUID+63,27737,595,3,1,0,0,2568.67,1202.96,125.509,4.96095,60,10,0,756,0,1,0,0,0), +(@GUID+64,27737,595,3,1,0,0,2571.93,1193.48,125.619,5.07641,60,10,0,756,0,1,0,0,0), +(@GUID+65,27737,595,3,1,0,0,2577.77,1180.88,125.562,4.64522,60,10,0,756,0,1,0,0,0), +(@GUID+66,27737,595,3,1,0,0,2574.2,1166.63,126.089,4.44966,60,10,0,706,0,1,0,0,0), +(@GUID+67,27737,595,3,1,0,0,2564.78,1166.82,127.092,4.2266,60,10,0,756,0,1,0,0,0), +(@GUID+68,27737,595,3,1,0,0,2577.56,1158.41,126.385,4.07738,60,10,0,756,0,1,0,0,0), +(@GUID+69,27737,595,3,1,0,0,2567.93,1176.56,126.2,4.7489,60,10,0,706,0,1,0,0,0), +(@GUID+70,27737,595,3,1,0,0,2559.28,1189.46,126.642,4.73319,60,10,0,756,0,1,0,0,0), +(@GUID+71,27737,595,3,1,0,0,2554.14,1213.37,126.599,5.13845,60,10,0,706,0,1,0,0,0), +(@GUID+72,27737,595,3,1,0,0,2560.58,1218.48,125.281,4.97351,60,10,0,730,0,1,0,0,0), +(@GUID+73,27737,595,3,1,0,0,2570.2,1170.58,126.311,4.64365,60,10,0,756,0,1,0,0,0), +(@GUID+74,27729,595,3,1,0,0,2496.57,1354.66,132.217,5.13691,120,5,0,63000,0,1,0,0,0), +(@GUID+75,27729,595,3,1,0,0,2494.22,1365.17,130.812,5.15654,120,5,0,63000,0,1,0,0,0), +(@GUID+76,27729,595,3,1,0,0,2440.41,1434.46,131.456,5.69372,120,5,0,63000,0,1,0,0,0), +(@GUID+77,27729,595,3,1,0,0,2433.18,1421.13,130.644,0.046706,120,5,0,63000,0,1,0,0,0), +(@GUID+78,27734,595,3,1,0,0,2546.07,1239.17,125.945,5.07801,120,5,0,63000,0,1,0,0,0), +(@GUID+79,27734,595,3,1,0,0,2458.58,1426.22,131.056,5.42984,120,5,0,63000,0,1,0,0,0), +(@GUID+80,27736,595,3,1,0,0,2488.11,1364.91,130.402,5.35524,120,5,0,130330,0,1,0,0,0), +(@GUID+81,28199,595,3,1,0,0,2527.63,1267.59,128.168,5.12906,120,5,0,63000,0,1,0,0,0), +(@GUID+82,28199,595,3,1,0,0,2528.06,1284.34,128.877,5.14869,120,5,0,63000,0,1,0,0,0), +(@GUID+83,28199,595,3,1,0,0,2466.27,1414.57,130.977,5.18637,120,5,0,63000,0,1,0,0,0), +(@GUID+84,28200,595,3,1,0,0,2570.51,1181.4,125.809,4.61855,120,5,0,50400,44070,1,0,0,0), +(@GUID+85,28200,595,3,1,0,0,2560.45,1202.05,126.031,4.85417,120,5,0,50400,44070,1,0,0,0), +(@GUID+86,28200,595,3,1,0,0,2487.85,1373.29,130.236,5.078,120,5,0,50400,44070,1,0,0,0), +(@GUID+87,28200,595,3,1,0,0,2416.7,1416.52,130.379,0.191224,120,5,0,50400,44070,1,0,0,0), +(@GUID+88,28200,595,3,1,0,0,2424.42,1422.68,130.868,0.25327,120,5,0,50400,44070,1,0,0,0), +(@GUID+89,28201,595,3,1,0,0,2540.67,1254.82,126.274,4.97198,120,5,0,130330,0,1,0,0,0), +(@GUID+90,28201,595,3,1,0,0,2410.03,1417.19,130.577,0.191229,120,5,0,130330,0,1,0,0,0), +(@GUID+91,28249,595,3,1,0,0,2562.66,1177.9,126.716,4.77171,120,5,0,63000,0,1,0,0,0), +(@GUID+92,28249,595,3,1,0,0,2566.72,1190.41,125.837,4.7992,120,5,0,63000,0,1,0,0,0), +(@GUID+93,28249,595,3,1,0,0,2472.34,1404.76,130.752,5.20601,120,5,0,63000,0,1,0,0,0), +(@GUID+94,28249,595,3,1,0,0,2460.59,1413.26,130.46,5.4377,120,5,0,63000,0,1,0,0,0), +(@GUID+95,28249,595,3,1,0,0,2415.04,1423.52,131.111,0.214785,120,5,0,63000,0,1,0,0,0); + +DELETE FROM `script_texts` WHERE entry BETWEEN -1595052 AND -1595048; +INSERT INTO `script_texts` (npc_entry,entry, content_default, comment) VALUES +(27913,-1595048, "Scourge forces have been spotted near the Elder's Square Gate!","Spawns near elder's square gate."), +(27913,-1595059, "Scourge forces have been spotted near the Town Hall!","Spawns near town hall."), +(27913,-1595050, "Scourge forces have been spotted near the King's Square fountain!","Spawns near king's square."), +(27913,-1595051, "Scourge forces have been spotted near the Market Row Gate!", "Spawns near market row gate."), +(27913,-1595052, "Scourge forces have been spotted near the Festival Lane Gate!", "Spawns near festval lane gate."); + +UPDATE `creature_template` SET `dynamicflags` = 0 WHERE `entry` IN (32273,32313); +UPDATE `areatrigger_teleport` SET id = 5181 WHERE id = 5148; +UPDATE `creature_template` SET `flags_extra` = 128 WHERE `entry` = 20562; +UPDATE `script_waypoint` SET location_x = 2449.32, location_y = 1191.09 WHERE entry = 26499 AND pointid = 26; + +UPDATE `creature_template` SET `lootid` = 32273 WHERE `entry` IN (32273, 32313); + +-- thx warpten (fix for credit spell) +UPDATE `spell_dbc` SET `Attributes` = '8388992', `AttributesEx2` = '5', `AttributesEx3` = '269484288' WHERE `Id` = 58630; diff --git a/sql/old/3.3.5a/2012_05_03_02_world_quest_template.sql b/sql/old/3.3.5a/2012_05_03_02_world_quest_template.sql new file mode 100644 index 00000000000..49953bd2166 --- /dev/null +++ b/sql/old/3.3.5a/2012_05_03_02_world_quest_template.sql @@ -0,0 +1,28 @@ +-- Wolvar Orphan quest order +UPDATE `quest_template` SET `prevquestid`=13927,`exclusivegroup`=-13930 WHERE `id` IN (13930,13934,13951); +UPDATE `quest_template` SET `prevquestid`=13930,`exclusivegroup`=-13955 WHERE `id` IN (13955,13957); +UPDATE `quest_template` SET `prevquestid`=13955,`exclusivegroup`=0 WHERE `id`=13938; +UPDATE `quest_template` SET `prevquestid`=13938,`exclusivegroup`=0 WHERE `id`=13960; +-- Oracle Orphan quest order +UPDATE `quest_template` SET `prevquestid`=13926,`exclusivegroup`=-13929 WHERE `id` IN (13929,13933,13950); +UPDATE `quest_template` SET `prevquestid`=13929,`exclusivegroup`=-13954 WHERE `id` IN (13954,13956); +UPDATE `quest_template` SET `prevquestid`=13954,`exclusivegroup`=0 WHERE `id`=13937; +UPDATE `quest_template` SET `prevquestid`=13937,`exclusivegroup`=0 WHERE `id`=13959; +-- Human Orphan quest order +UPDATE `quest_template` SET `prevquestid`=1468,`exclusivegroup`=-1479 WHERE `id` IN (1479,1558,1687); +UPDATE `quest_template` SET `prevquestid`=1479,`exclusivegroup`=-558 WHERE `id` IN (558,4822); +UPDATE `quest_template` SET `prevquestid`=558,`exclusivegroup`=0 WHERE `id`=171; +-- Orcish Orphan quest order +UPDATE `quest_template` SET `prevquestid`=172,`exclusivegroup`=-910 WHERE `id` IN (910,911,1800); +UPDATE `quest_template` SET `prevquestid`=910,`exclusivegroup`=-915 WHERE `id` IN (915,925); +UPDATE `quest_template` SET `prevquestid`=915,`exclusivegroup`=0 WHERE `id`=5502; +-- Draenei Orphan quest order +UPDATE `quest_template` SET `prevquestid`=10943,`exclusivegroup`=-10950 WHERE `id` IN (10950,10952,10954); +UPDATE `quest_template` SET `prevquestid`=10950,`exclusivegroup`=-10956 WHERE `id` IN (10956,10962); +UPDATE `quest_template` SET `NextQuestIdChain`=10968 WHERE `id`=10956; +UPDATE `quest_template` SET `prevquestid`=10968,`exclusivegroup`=0 WHERE `id`=10966; +-- Blood Elf Orphan quest order +UPDATE `quest_template` SET `prevquestid`=10942,`exclusivegroup`=-10945 WHERE `id` IN (10945,10951,10953); +UPDATE `quest_template` SET `prevquestid`=10945,`exclusivegroup`=-10960 WHERE `id` IN (10960,10963); +UPDATE `quest_template` SET `prevquestid`=10960,`exclusivegroup`=0 WHERE `id`=11975; +UPDATE `quest_template` SET `prevquestid`=11975,`exclusivegroup`=0 WHERE `id`=10967; diff --git a/sql/old/3.3.5a/2012_05_03_03_world_creature_questrelation.sql b/sql/old/3.3.5a/2012_05_03_03_world_creature_questrelation.sql new file mode 100644 index 00000000000..1da4f6d29ad --- /dev/null +++ b/sql/old/3.3.5a/2012_05_03_03_world_creature_questrelation.sql @@ -0,0 +1,2 @@ +-- Set correct NPC for A Warden of the Alliance +UPDATE `creature_questrelation` SET `id`=14305 WHERE `quest`=171; diff --git a/sql/old/3.3.5a/2012_05_03_04_world_game_event_creature_quest.sql b/sql/old/3.3.5a/2012_05_03_04_world_game_event_creature_quest.sql new file mode 100644 index 00000000000..62fd4415549 --- /dev/null +++ b/sql/old/3.3.5a/2012_05_03_04_world_game_event_creature_quest.sql @@ -0,0 +1,57 @@ +DELETE FROM `creature_questrelation` WHERE `id` IN (14305,14444,22817,22818,33532,33533,34365); +DELETE FROM `game_event_creature_quest` WHERE `eventEntry`=10; +INSERT INTO `game_event_creature_quest` (`eventEntry`,`id`,`quest`) VALUES +-- Alliance +(10,14450,1468), -- Orphan Matron Nightingale - Children's Week +(10,14305,1479), -- Human Orphan - The Bough of the Eternals +(10,14305,1558), -- Human Orphan - The Stonewrought Dam +(10,14305,1687), -- Human Orphan - Spooky Lighthouse +(10,14305,558), -- Human Orphan - Jaina's Autograph +(10,14305,4822), -- Human Orphan - You Scream, I Scream... +-- Horde +(10,14451,172), -- Orphan Matron Battlewail - Children's Week +(10,14444,910), -- Orcish Orphan - Down at the Docks +(10,14444,911), -- Orcish Orphan - Gateway to the Frontier +(10,14444,1800), -- Orcish Orphan - Lordaeron Throne Room +(10,14444,915), -- Orcish Orphan - You Scream, I Scream... +(10,14444,925), -- Orcish Orphan - Cairne's Hoofprint +(10,14444,5502), -- Orcish Orphan - A Warden of the Horde +-- Outlands: Blood Elfs +(10,22819,10942), -- Orphan Matron Mercy - Children's Week +(10,22817,10945), -- Blood Elf Orphan - Hch'uu and the Mushroom People +(10,22817,10951), -- Blood Elf Orphan - A Trip to the Dark Portal +(10,22817,10953), -- Blood Elf Orphan - Visit the Throne of the Elements +(10,22817,11975), -- Blood Elf Orphan - Now, When I Grow Up... +(10,22817,10963), -- Blood Elf Orphan - Time to Visit the Caverns +(10,22817,10967), -- Blood Elf Orphan - Back to the Orphanage +-- Outlands: Draenei +(10,22819,10943), -- Orphan Matron Mercy - Children's Week +(10,22818,10950), -- Draenei Orphan - Auchindoun and the Ring of Observance +(10,22818,10952), -- Draenei Orphan - A Trip to the Dark Portal +(10,22818,10954), -- Draenei Orphan - Jheel is at Aeris Landing! +(10,22818,10956), -- Draenei Orphan - The Seat of the Naaru +(10,22818,10962), -- Draenei Orphan - Time to Visit the Caverns +(10,22818,10966), -- Draenei Orphan - Back to the Orphanage +-- Northrend: Wolvar +(10,34365,13927), -- Orphan Matron Aria - Little Orphan Kekek Of The Wolvar +(10,33532,13930), -- Wolvar Orphan - Home Of The Bear-Men +(10,33532,13934), -- Wolvar Orphan - The Bronze Dragonshrine +(10,33532,13951), -- Wolvar Orphan - Playmates! +(10,33532,13955), -- Wolvar Orphan - The Dragon Queen +(10,33532,13957), -- Wolvar Orphan - The Mighty Hemet Nesingwary +(10,33532,13960), -- Wolvar Orphan - Back To The Orphanage +-- Northrend: Oracles +(10,34365,13926), -- Orphan Matron Aria - Little Orphan Roo Of The Oracles +(10,33533,13929), -- Oracle Orphan - The Biggest Tree Ever! +(10,33533,13933), -- Oracle Orphan - The Bronze Dragonshrine +(10,33533,13937), -- Oracle Orphan - A Trip To The Wonderworks +(10,33533,13950), -- Oracle Orphan - Playmates! +(10,33533,13954), -- Oracle Orphan - The Dragon Queen +(10,33533,13956), -- Oracle Orphan - Meeting a Great One +(10,33533,13959); -- Oracle Orphan - Back To The Orphanage + +-- Removed "When I Grow Up..." and replace it with "Now, When I Grow Up..." +UPDATE `quest_template` SET `prevquestid`=10945,`exclusivegroup`=-11975 WHERE `id` IN (11975,10963); +DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=10960; +INSERT INTO `disables` (`sourceType`,`entry`,`flags`,`params_0`,`params_1`,`comment`) VALUES +(1,10960,0,'','','Deprecated quest: When I grow up...'); diff --git a/sql/old/3.3.5a/2012_05_04_00_world_waypoints.sql b/sql/old/3.3.5a/2012_05_04_00_world_waypoints.sql new file mode 100644 index 00000000000..a07bde59d49 --- /dev/null +++ b/sql/old/3.3.5a/2012_05_04_00_world_waypoints.sql @@ -0,0 +1,137 @@ +-- Thrallmar Grunt pathing +SET @NPC := 57505; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=168.3949,`position_y`=2641.357,`position_z`=86.32077 WHERE `guid`=@NPC; +UPDATE `creature_addon` SET `path_id`=@PATH WHERE `guid`=@NPC; +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,168.3949,2641.357,86.32077,0,0,0,100,0), +(@PATH,2,186.5067,2615.882,87.28357,0,0,0,100,0), +(@PATH,3,188.9113,2601.655,87.28357,0,0,0,100,0), +(@PATH,4,198.3909,2602.661,87.28357,0,0,0,100,0), +(@PATH,5,201.5686,2609.845,87.28357,0,0,0,100,0), +(@PATH,6,187.2484,2616.44,87.28357,0,0,0,100,0), +(@PATH,7,168.7871,2641.268,86.32077,0,0,0,100,0), +(@PATH,8,155.2003,2681.998,84.82113,0,0,0,100,0), +(@PATH,9,194.6133,2692.07,90.61374,0,0,0,100,0), +(@PATH,10,215.4427,2693.589,90.69872,0,0,0,100,0), +(@PATH,11,219.0203,2692.25,90.69665,0,0,0,100,0), +(@PATH,12,225.5117,2680.063,90.68996,0,0,0,100,0), +(@PATH,13,235.309,2679.308,90.69373,0,0,0,100,0), +(@PATH,14,246.9184,2682.646,90.70419,0,0,0,100,0), +(@PATH,15,252.4411,2688.479,90.70386,0,0,0,100,0), +(@PATH,16,255.0155,2699.197,90.70283,0,0,0,100,0), +(@PATH,17,251.5234,2707.998,90.70486,0,0,0,100,0), +(@PATH,18,243.2346,2712.791,90.70392,0,0,0,100,0), +(@PATH,19,231.9871,2713.626,90.70399,0,0,0,100,0), +(@PATH,20,221.1457,2709.591,90.69753,0,0,0,100,0), +(@PATH,21,218.8803,2695.845,90.69318,0,0,0,100,0), +(@PATH,22,215.4517,2693.612,90.69869,0,0,0,100,0), +(@PATH,23,194.7944,2692.039,90.65273,0,0,0,100,0), +(@PATH,24,175.8115,2687.591,86.68189,0,0,0,100,0), +(@PATH,25,155.2143,2682.375,84.82113,0,0,0,100,0), +(@PATH,26,131.8727,2679.832,84.56969,0,0,0,100,0), +(@PATH,27,130.0859,2666.262,84.1262,0,0,0,100,0), +(@PATH,28,153.1291,2650.22,86.15128,0,0,0,100,0); + +-- Remove dup Thrallmar Grunt spawn +DELETE FROM `creature` WHERE `guid`=57532; +DELETE FROM `creature_addon` WHERE `guid`=57532; + +-- Bat Rider Guard pathing +SET @NPC := 54840; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=156.9029,`position_y`=2554.784,`position_z`=170.8949 WHERE `guid`=@NPC; +UPDATE `creature_addon` SET `path_id`=@PATH WHERE `guid`=@NPC; +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,156.9029,2554.784,170.8949,0,0,0,100,0), +(@PATH,2,52.51677,2602.816,139.7838,0,0,0,100,0), +(@PATH,3,42.10146,2627.056,139.7838,0,0,0,100,0), +(@PATH,4,37.17329,2663.729,139.7838,0,0,0,100,0), +(@PATH,5,62.91933,2687.96,139.7838,0,0,0,100,0), +(@PATH,6,96.1871,2688.141,148.4226,0,0,0,100,0), +(@PATH,7,129.818,2690.786,151.256,0,0,0,100,0), +(@PATH,8,165.6888,2715.398,170.8949,0,0,0,100,0), +(@PATH,9,199.7751,2744.93,170.8949,0,0,0,100,0), +(@PATH,10,246.0857,2761.154,170.8949,0,0,0,100,0), +(@PATH,11,295.0904,2757.991,170.8949,0,0,0,100,0), +(@PATH,12,309.3468,2726.089,170.8949,0,0,0,100,0), +(@PATH,13,303.8448,2682.588,170.8949,0,0,0,100,0), +(@PATH,14,289.3104,2650.866,170.8949,0,0,0,100,0), +(@PATH,15,261.2743,2618.831,170.8949,0,0,0,100,0), +(@PATH,16,233.6436,2578.997,170.8949,0,0,0,100,0), +(@PATH,17,199.3375,2546.226,170.8949,0,0,0,100,0); + +-- Bat Rider Guard pathing +SET @NPC := 54841; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=65.97776,`position_y`=2661.205,`position_z`=163.6752 WHERE `guid`=@NPC; +UPDATE `creature_addon` SET `path_id`=@PATH WHERE `guid`=@NPC; +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,65.97776,2661.205,163.6752,0,0,0,100,0), +(@PATH,2,85.52612,2668.312,163.6752,0,0,0,100,0), +(@PATH,3,119.9537,2689.26,163.6752,0,0,0,100,0), +(@PATH,4,121.8238,2721.88,163.6752,0,0,0,100,0), +(@PATH,5,142.6907,2750.891,163.6752,0,0,0,100,0), +(@PATH,6,149.9812,2788.504,163.6752,0,0,0,100,0), +(@PATH,7,142.9353,2830.464,163.6752,0,0,0,100,0), +(@PATH,8,115.1711,2822.444,163.6752,0,0,0,100,0), +(@PATH,9,57.16672,2791.644,163.6752,0,0,0,100,0), +(@PATH,10,38.80463,2758.823,163.6752,0,0,0,100,0), +(@PATH,11,19.69282,2714.784,163.6752,0,0,0,100,0), +(@PATH,12,23.22027,2677.714,163.6752,0,0,0,100,0); + +-- Bat Rider Guard pathing +SET @NPC := 54842; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=263.5968,`position_y`=2694.818,`position_z`=169.7312 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,4097); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,263.5968,2694.818,169.7312,0,0,0,100,0), +(@PATH,2,184.0861,2784.899,154.4534,0,0,0,100,0), +(@PATH,3,154.2815,2754.787,154.3701,0,0,0,100,0), +(@PATH,4,127.0308,2740.488,154.3701,0,0,0,100,0), +(@PATH,5,118.0444,2706.509,154.3701,0,0,0,100,0), +(@PATH,6,115.7577,2669.386,158.6756,0,0,0,100,0), +(@PATH,7,131.4314,2622.531,162.1478,0,0,0,100,0), +(@PATH,8,154.8241,2607.207,164.4812,0,0,0,100,0), +(@PATH,9,176.3283,2571.343,168.5645,0,0,0,100,0), +(@PATH,10,221.6267,2559.683,172.1201,0,0,0,100,0), +(@PATH,11,245.392,2593.423,169.8978,0,0,0,100,0), +(@PATH,12,251.0069,2617.749,169.7312,0,0,0,100,0), +(@PATH,13,263.0581,2644.614,169.7312,0,0,0,100,0); + +-- Bat Rider Guard pathing +SET @NPC := 54843; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=62.42025,`position_y`=2785.719,`position_z`=192.1124 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,4097); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,62.42025,2785.719,192.1124,0,0,0,100,0), +(@PATH,2,159.9371,2842.977,208.279,0,0,0,100,0), +(@PATH,3,183.0578,2845.035,208.279,0,0,0,100,0), +(@PATH,4,211.2432,2864.757,214.2235,0,0,0,100,0), +(@PATH,5,238.1182,2871.979,220.9457,0,0,0,100,0), +(@PATH,6,252.9173,2853.913,220.9457,0,0,0,100,0), +(@PATH,7,255.0203,2812.634,220.9457,0,0,0,100,0), +(@PATH,8,240.4993,2780.929,220.9457,0,0,0,100,0), +(@PATH,9,195.4901,2773.965,209.3901,0,0,0,100,0), +(@PATH,10,162.1341,2742.294,212.9179,0,0,0,100,0), +(@PATH,11,125.4935,2720.611,197.9457,0,0,0,100,0), +(@PATH,12,93.49241,2699.757,192.1124,0,0,0,100,0), +(@PATH,13,58.35324,2681.49,192.1124,0,0,0,100,0), +(@PATH,14,22.8833,2715.123,192.1124,0,0,0,100,0), +(@PATH,15,30.10514,2764.5,192.1124,0,0,0,100,0); + +-- Fix Bat Rider Guard InhabitType +UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry`=15242; + +-- Remove dup Bat Rider Guard spawns +DELETE FROM `creature` WHERE `guid` IN (54839,54844,54845); +DELETE FROM `creature_addon` WHERE `guid` IN (54839,54844,54845); diff --git a/sql/old/3.3.5a/2012_05_04_01_world_sai.sql b/sql/old/3.3.5a/2012_05_04_01_world_sai.sql new file mode 100644 index 00000000000..7021fc92548 --- /dev/null +++ b/sql/old/3.3.5a/2012_05_04_01_world_sai.sql @@ -0,0 +1,32 @@ +-- Speech by Martik Tor'seldoi, Thrallmar +SET @ENTRY := 16577; +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid`=@ENTRY*100; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,1,0,100,0,30000,50000,360000,360000,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Martik Tor''seldoi - OOC - Load script every 6 min ooc'), +(@ENTRY,0,1,0,25,0,100,0,0,0,0,0,11,18100,32,0,0,0,0,1,0,0,0,0,0,0,0, 'Martik Tor''seldoi - Reset - Cast Frost Armor'), +(@ENTRY*100,9,0,0,0,0,100,0,1000,1000,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Martik Tor''seldoi Say text 0'), +(@ENTRY*100,9,1,0,0,0,100,0,3000,3000,0,0,5,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Martik Tor''seldoi emote'), +(@ENTRY*100,9,2,0,0,0,100,0,3000,3000,0,0,5,6,0,0,0,0,0,1,0,0,0,0,0,0,0,'Martik Tor''seldoi emote'), +(@ENTRY*100,9,3,0,0,0,100,0,3000,3000,0,0,1,0,0,0,0,0,0,10,57487,16578,0,0,0,0,0,'Blood Elf Pilgrim Say text 0'), +(@ENTRY*100,9,4,0,0,0,100,0,3000,3000,0,0,5,6,0,0,0,0,0,10,57487,16578,0,0,0,0,0,'Blood Elf Pilgrim emote'), +(@ENTRY*100,9,5,0,0,0,100,0,3000,3000,0,0,66,0,0,0,0,0,0,10,57487,16578,0,0,0,0,0,'Martik Tor''seldoi turn to'), +(@ENTRY*100,9,6,0,0,0,100,0,1000,1000,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Martik Tor''seldoi Say text 1'), +(@ENTRY*100,9,7,0,0,0,100,0,4000,4000,0,0,1,1,0,0,0,0,0,10,57487,16578,0,0,0,0,0,'Blood Elf Pilgrim Say text 1'), +(@ENTRY*100,9,8,0,0,0,100,0,3000,3000,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Martik Tor''seldoi Say text 2'), +(@ENTRY*100,9,9,0,0,0,100,0,3000,3000,0,0,5,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Martik Tor''seldoi emote'), +(@ENTRY*100,9,10,0,0,0,100,0,3000,3000,0,0,5,273,0,0,0,0,0,1,0,0,0,0,0,0,0,'Martik Tor''seldoi emote'), +(@ENTRY*100,9,11,0,0,0,100,0,3000,3000,0,0,1,2,0,0,0,0,0,10,57487,16578,0,0,0,0,0,'Blood Elf Pilgrim Say text 2'), +(@ENTRY*100,9,12,0,0,0,100,0,1000,1000,0,0,5,15,0,0,0,0,0,9,16578,0,20,0,0,0,0,'Blood Elf Pilgrim emote'), +(@ENTRY*100,9,13,0,0,0,100,0,3000,3000,0,0,66,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Martik Tor''seldoi turn to'); +-- NPC talk text insert from sniff +DELETE FROM `creature_text` WHERE `entry` IN (16577,16578); +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(16577,0,0, 'Brothers and sisters, I have been to the promised land. I have tasted in the sublim energy. I have felt bliss - bliss so engrossing and all encompassing that I was left wondering if I had stumbled upon the dreams of gods.!',12,0,100,5,0,0, 'Martik Tor''seldoi'), +(16577,1,0, 'In paradise, you merely reach out and take from the Nether.',12,0,100,1,0,0, 'Martik Tor''seldoi'), +(16577,2,0, 'From the very air! Tendrils of arcane energy light up the obsidian sky as plumes of raw magic rise up from fissures in the land. Kneel and drink from the fissure as you do from a stream or well. Pluck a tendril from the heavens as if it were an apple hanging from a branch.',12,0,100,5,0,0, 'Martik Tor''seldoi'), +(16578,0,0, 'Tell us more, Martik. What is it? What does it feel like?',12,0,100,1,0,0, 'Blood Elf Pilgrim'), +(16578,1,0, 'But how?',12,0,100,6,0,0, 'Blood Elf Pilgrim'), +(16578,2,0, '%s smiles/gasps.',16,0,100,0,0,0, 'Blood Elf Pilgrim'); diff --git a/sql/old/3.3.5a/2012_05_05_00_world_sai.sql b/sql/old/3.3.5a/2012_05_05_00_world_sai.sql new file mode 100644 index 00000000000..e03c36337af --- /dev/null +++ b/sql/old/3.3.5a/2012_05_05_00_world_sai.sql @@ -0,0 +1,205 @@ +-- Forge of Souls Trash update + +-- Npc Updates + +-- Spiteful Apparition +UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry`=36551; +UPDATE `creature` SET `spawndist`=20,`MovementType`=1,`curhealth`=1,`curmana`=0 WHERE `id`=36551; +DELETE FROM `creature_template_addon` WHERE `entry`=36551; +INSERT INTO `creature_template_addon` (`entry`,`bytes2`,`auras`) VALUES (36551,1, '69105 69136'); +-- Spiteful Apparition (Ambient) +UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry`=36967; +UPDATE `creature` SET `spawndist`=20,`MovementType`=1,`curhealth`=1,`curmana`=0 WHERE `id`=36967; +DELETE FROM `creature_template_addon` WHERE `entry`=36967; +INSERT INTO `creature_template_addon` (`entry`,`bytes2`,`auras`) VALUES (36967,1, '69663 69658'); +-- Spectral Warden +UPDATE `creature_addon` SET `auras`='69144' WHERE `guid` IN (SELECT `guid` FROM `creature` WHERE `id`=36666); + +-- SAI Updates + +-- Spiteful Apparition SAI +SET @ENTRY := 36551; -- NPC entry +SET @SPELL1 := 41253; -- Greater Invisibility +SET @SPELL2 := 68895; -- Spite (Normal) +SET @SPELL3 := 70212; -- Spite (Heroic) +UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,25,0,100,6,0,0,0,0,11,@SPELL1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Spiteful Apparition - On Reset - Cast Greater Invisibility'), +(@ENTRY,0,1,0,10,0,100,6,0,10,3000,4000,28,@SPELL1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Spiteful Apparition - OOC range - Remove Greater Invisibility'), +(@ENTRY,0,2,0,0,0,100,2,7000,9000,7000,9000,11,@SPELL2,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Spiteful Apparition - Combat - Cast Spite "Normal"'), +(@ENTRY,0,3,0,0,0,100,4,7000,9000,7000,9000,11,@SPELL3,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Spiteful Apparition - Combat - Cast Spite "Heroic"'); + +-- Soulguard Reaper SAI +SET @ENTRY := 36499; -- NPC entry +SET @SPELL1 := 68797; -- Soulguard Channel +SET @SPELL2 := 69058; -- Shadow Lance +SET @SPELL3 := 69060; -- Frost Nova (Normal) +SET @SPELL4 := 70209; -- Frost Nova (Heroic) +UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,1,0,100,7,0,0,0,0,11,@SPELL1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Reaper - OOC - Cast Soulguard Channel'), +(@ENTRY,0,1,0,0,0,100,6,5000,6000,7000,9000,11,@SPELL2,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Soulguard Reaper - Combat - Cast Shadow Lance'), +(@ENTRY,0,2,0,0,0,100,2,7000,9000,8000,10000,11,@SPELL3,0,0,0,0,0,5,0,0,0,0,0,0,0, 'Soulguard Reaper - Combat - Cast Frost Nova "Normal"'), +(@ENTRY,0,3,0,0,0,100,4,7000,9000,8000,10000,11,@SPELL4,0,0,0,0,0,5,0,0,0,0,0,0,0, 'Soulguard Reaper - Combat - Cast Frost Nova "Heroic"'), +(@ENTRY,0,4,0,4,0,100,6,0,0,0,0,39,30,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Reaper - Aggro - Call for help'); + +-- Soulguard Beam Focus Target +SET @ENTRY := 36508; -- NPC entry +UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid` IN (-201770,-201785,-201741); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(-201770,0,0,0,1,0,100,6,1000,1000,5000,5000,45,0,1,0,0,0,0,19,36620,60,0,0,0,0,0, 'Soulguard Beam Focus Target - OOC - Set data on Soulguard Adept'), +(-201785,0,0,0,1,0,100,6,1000,1000,5000,5000,45,0,1,0,0,0,0,19,36620,60,0,0,0,0,0, 'Soulguard Beam Focus Target - OOC - Set data on Soulguard Adept'), +(-201741,0,0,0,1,0,100,6,1000,1000,5000,5000,45,0,1,0,0,0,0,19,36620,60,0,0,0,0,0, 'Soulguard Beam Focus Target - OOC - Set data on Soulguard Adept'), +(-201741,0,1,0,1,0,100,6,1000,1000,5000,5000,45,0,1,0,0,0,0,19,36564,60,0,0,0,0,0, 'Soulguard Beam Focus Target - OOC - Set data on Soulguard Bonecaster'); + +-- Spectral Warden SAI +SET @ENTRY := 36666; -- NPC entry +SET @SPELL1 := 69633; -- Veil of Shadow +SET @SPELL2 := 69148; -- Wail of Souls (Normal) +SET @SPELL3 := 70210; -- Wail of Souls (Heroic) +UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,0,0,100,6,5000,6000,9000,10000,11,@SPELL1,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Spectral Warden - Combat - Cast Veil of Shadow'), +(@ENTRY,0,1,0,0,0,100,2,9000,11000,5000,6000,11,@SPELL1,0,0,0,0,0,5,0,0,0,0,0,0,0, 'Spectral Warden - Combat - Cast Wail of Souls'), +(@ENTRY,0,2,0,0,0,100,4,9000,11000,5000,6000,11,@SPELL2,0,0,0,0,0,5,0,0,0,0,0,0,0, 'Spectral Warden - Combat - Cast Wail of Souls'); + +-- Soulguard Watchman SAI +SET @ENTRY := 36478; -- NPC entry +SET @SPELL1 := 69056; -- Shroud of Runes +SET @SPELL2 := 69053; -- Unholy Rage +UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,0,0,50,6,0,10000,16000,20000,11,@SPELL1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Watchman - Combat - Cast Shroud of Runes'), +(@ENTRY,0,1,2,0,0,100,6,8000,16000,32000,40000,11,@SPELL2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Watchman - Combat - Cast Unholy Rage'), +(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Watchman - Combat - Say 0'), +(@ENTRY,0,3,0,4,0,100,6,0,0,0,0,39,20,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Watchman - Aggro - Call for help'); +-- NPC talk text insert +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0, '%s goes into a frenzy!',16,0,100,0,0,0, 'Soulguard Watchman'); + +-- Soul Horror SAI +SET @ENTRY := 36522; -- NPC entry +SET @SPELL1 := 69088; -- Soul Strike (Normal) +SET @SPELL2 := 70211; -- Soul Strike (Heroic) +SET @SPELL3 := 69107; -- Killing Spree Invis Aura +SET @SPELL4 := 69106; -- Killing Spree Aura +UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,0,0,100,2,5000,6000,5000,6000,11,@SPELL1,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Soul Horror - Combat - Cast Soul Strike'), +(@ENTRY,0,1,0,0,0,100,4,5000,6000,5000,6000,11,@SPELL2,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Soul Horror - Combat - Cast Soul Strike'), +(@ENTRY,0,4,0,4,0,100,6,0,0,0,0,39,35,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soul Horror - Aggro - Call for help'); + +-- Soulguard Animator SAI +SET @ENTRY := 36516; -- NPC entry +SET @SPELL1 := 68834; -- Soulguard Channel Beam02 +SET @SPELL2 := 69562; -- Raise Dead +SET @SPELL3 := 69131; -- Soul Sickness +SET @SPELL4 := 69128; -- Soul Siphon +SET @SPELL5 := 69068; -- Shadow Bolt (Normal) +SET @SPELL6 := 70208; -- Shadow Bolt (Heroic) +UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,1,0,100,7,1000,1000,1000,1000,11,@SPELL1,0,0,0,0,0,9,36522,1,15,0,0,0,0, 'Soulguard Animator - OOC - Cast Soulguard Channel Beam02'), +(@ENTRY,0,1,0,0,1,100,6,20000,25000,20000,25000,11,@SPELL2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Animator - Combat - Cast Raise Dead'), +(@ENTRY,0,2,0,0,0,100,6,7000,9000,9000,11000,11,@SPELL3,0,0,0,0,0,5,0,0,0,0,0,0,0, 'Soulguard Animator - Combat - Cast Soul Sickness'), +(@ENTRY,0,3,0,0,0,100,6,9000,11000,7000,9000,11,@SPELL4,0,0,0,0,0,5,0,0,0,0,0,0,0, 'Soulguard Animator - Combat - Cast Soul Siphon'), +(@ENTRY,0,4,0,0,0,100,2,4000,5000,3500,4500,11,@SPELL5,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Soulguard Animator - Combat - Cast Shadow Bolt "Normal"'), +(@ENTRY,0,5,0,0,0,100,4,4000,5000,3500,4500,11,@SPELL6,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Soulguard Animator - Combat - Cast Shadow Bolt "Heroic"'), +(@ENTRY,0,6,7,4,0,100,6,0,0,0,0,39,35,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Animator - Aggro - Call for help'), +(@ENTRY,0,7,0,61,0,100,6,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Animator - Aggro - Set phase 1'), +(@ENTRY,0,8,9,38,0,100,7,0,2,0,0,45,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Animator - Data set 2 - Set data'), +(@ENTRY,0,9,0,61,0,100,6,0,0,0,0,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Animator - Data set 2 - Set phase 2'), +(@ENTRY,0,10,11,38,0,100,7,0,3,0,0,45,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Animator - Data set 3 - Set data'), +(@ENTRY,0,11,0,61,0,100,6,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Animator - Data set 3 - Set phase 1'); + +-- Soulguard Adept SAI +SET @ENTRY := 36620; -- NPC entry +SET @SPELL1 := 68834; -- Soulguard Channel Beam02 +SET @SPELL2 := 69562; -- Raise Dead +SET @SPELL3 := 69068; -- Shadow Bolt (Normal) +SET @SPELL4 := 70208; -- Shadow Bolt (Heroic) +SET @SPELL5 := 69066; -- Drain Life (Normal) +SET @SPELL6 := 70213; -- Drain Life (Heroic) +SET @SPELL7 := 69564; -- Shadow Mend (Normal) +SET @SPELL8 := 70205; -- Shadow Mend (Heroic) +SET @SPELL9 := 68797; -- Soulguard Channel +UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,1,0,100,7,1000,1000,1000,1000,11,@SPELL1,0,0,0,0,0,9,36522,1,15,0,0,0,0, 'Soulguard Adept - OOC - Cast Soulguard Channel Beam02'), +(@ENTRY,0,1,0,0,4,100,6,20000,25000,20000,25000,11,@SPELL2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Adept - Combat - Cast Raise Dead'), +(@ENTRY,0,2,0,0,0,100,2,7000,8000,3500,4500,11,@SPELL3,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Soulguard Adept - Combat - Cast Shadow Bolt "Normal"'), +(@ENTRY,0,3,0,0,0,100,4,7000,8000,3500,4500,11,@SPELL4,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Soulguard Adept - Combat - Cast Shadow Bolt "Heroic"'), +(@ENTRY,0,4,0,0,0,100,2,6000,7000,8000,10000,11,@SPELL5,0,0,0,0,0,5,0,0,0,0,0,0,0, 'Soulguard Adept - Combat - Cast Drain Life "Normal"'), +(@ENTRY,0,5,0,0,0,100,4,6000,7000,8000,10000,11,@SPELL6,0,0,0,0,0,5,0,0,0,0,0,0,0, 'Soulguard Adept - Combat - Cast Drain Life "Heroic"'), +(@ENTRY,0,6,0,0,0,100,2,30000,35000,18000,22000,11,@SPELL7,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Soulguard Adept - Combat - Cast Shadow Mend "Normal"'), +(@ENTRY,0,7,0,0,0,100,4,30000,35000,18000,22000,11,@SPELL8,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Soulguard Adept - Combat - Cast Shadow Mend "Heroic"'), +(@ENTRY,0,8,0,25,0,100,6,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Adept - On Reset - Set phase 1'), +(@ENTRY,0,9,0,38,1,100,6,0,1,0,0,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Adept - On dataset 0 1 - Set phase 2'), +(@ENTRY,0,10,0,1,2,100,7,0,0,0,0,11,@SPELL9,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Adept - OOC - Cast Soulguard Channel'), +(@ENTRY,0,11,12,4,0,100,6,0,0,0,0,39,35,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Adept - Aggro - Call for help'), +(@ENTRY,0,12,0,61,0,100,6,0,0,0,0,22,3,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Adept - Aggro - Set phase 3'), +(@ENTRY,0,13,14,38,0,100,7,0,2,0,0,45,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Adept - Data set 2 - Set data'), +(@ENTRY,0,14,0,61,0,100,6,0,0,0,0,22,4,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Adept - Data set 2 - Set phase 4'), +(@ENTRY,0,15,16,38,0,100,7,0,3,0,0,45,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Adept - Data set 3 - Set data'), +(@ENTRY,0,16,0,61,0,100,6,0,0,0,0,22,3,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Adept - Data set 3 - Set phase 3'); + +-- Soulguard Bonecaster SAI +SET @ENTRY := 36564; -- NPC entry +SET @SPELL1 := 68834; -- Soulguard Channel Beam02 +SET @SPELL2 := 69562; -- Raise Dead +SET @SPELL3 := 69080; -- Bone Volley (Normal) +SET @SPELL4 := 70206; -- Bone Volley (Heroic) +SET @SPELL5 := 69069; -- Shield of Bones (Normal) +SET @SPELL6 := 70207; -- Shield of Bones (Heroic) +SET @SPELL7 := 68797; -- Soulguard Channel +UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,1,0,100,7,1000,1000,1000,1000,11,@SPELL1,0,0,0,0,0,9,36522,1,15,0,0,0,0, 'Soulguard Bonecaster - OOC - Cast Soulguard Channel Beam02'), +(@ENTRY,0,1,0,0,4,100,6,20000,25000,20000,25000,11,@SPELL2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Bonecaster - Combat - Cast Raise Dead'), +(@ENTRY,0,2,0,0,0,100,2,5000,7000,6000,8000,11,@SPELL3,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Soulguard Bonecaster - Combat - Cast Bone Volley "Normal"'), +(@ENTRY,0,3,0,0,0,100,4,5000,7000,6000,8000,11,@SPELL4,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Soulguard Bonecaster - Combat - Cast Bone Volley "Heroic"'), +(@ENTRY,0,4,0,0,0,100,2,5000,7000,7000,9000,11,@SPELL5,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Soulguard Bonecaster - Combat - Cast Shield of Bones "Normal"'), +(@ENTRY,0,5,0,0,0,100,4,5000,7000,7000,9000,11,@SPELL6,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Soulguard Bonecaster - Combat - Cast Shield of Bones "Heroic"'), +(@ENTRY,0,6,0,25,0,100,6,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Bonecaster - On Reset - Set phase 1'), +(@ENTRY,0,7,0,38,1,100,6,0,1,0,0,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Bonecaster - On dataset 0 1 - Set phase 2'), +(@ENTRY,0,8,0,1,2,100,7,0,0,0,0,11,@SPELL7,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Bonecaster - OOC - Cast Soulguard Channel'), +(@ENTRY,0,9,10,4,0,100,6,0,0,0,0,39,35,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Bonecaster - Aggro - Call for help'), +(@ENTRY,0,10,0,61,0,100,6,0,0,0,0,22,3,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Bonecaster - Aggro - Set phase 3'), +(@ENTRY,0,11,12,38,0,100,7,0,2,0,0,45,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Bonecaster - Data set 2 - Set data'), +(@ENTRY,0,12,0,61,0,100,6,0,0,0,0,22,4,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Bonecaster - Data set 2 - Set phase 4'), +(@ENTRY,0,13,14,38,0,100,7,0,3,0,0,45,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Bonecaster - Data set 3 - Set data'), +(@ENTRY,0,14,0,61,0,100,6,0,0,0,0,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Soulguard Bonecaster - Data set 3 - Set phase 3'); + +-- Ghoul Minion SAI +SET @ENTRY := 36916; -- NPC entry +SET @SPELL1 := 69088; -- Soul Strike (Normal) +SET @SPELL2 := 70211; -- Soul Strike (Heroic) +UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,1,54,0,100,6,0,0,0,0,45,0,2,0,0,0,0,23,0,0,0,0,0,0,0, 'Ghoul Minion - Just Summoned - Set Data Summoner'), +(@ENTRY,0,1,0,61,0,100,6,0,0,0,0,89,5,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Ghoul Minion - Just Summoned - Set Random Movement'), +(@ENTRY,0,2,0,0,0,100,6,115000,115000,115000,115000,37,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Ghoul Minion - combat - die after 2 min'), +(@ENTRY,0,3,0,1,0,100,6,15000,15000,15000,15000,37,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Ghoul Minion - OOC - die after 15 sec'), +(@ENTRY,0,4,5,6,0,100,6,15000,15000,15000,15000,45,0,3,0,0,0,0,23,0,0,0,0,0,0,0, 'Ghoul Minion - on Death - Set data summoner'), +(@ENTRY,0,5,0,61,0,100,6,15000,15000,15000,15000,41,3000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Ghoul Minion - on Death - despawn after 3 sec'); diff --git a/sql/old/3.3.5a/2012_05_05_01_world_creature_template.sql b/sql/old/3.3.5a/2012_05_05_01_world_creature_template.sql new file mode 100644 index 00000000000..2eeaf2f40d2 --- /dev/null +++ b/sql/old/3.3.5a/2012_05_05_01_world_creature_template.sql @@ -0,0 +1,2 @@ +-- Set proper faction for Ymirjar Skycaller (Heroic) +UPDATE `creature_template` SET `faction_A`=1885,`faction_H`=1885 WHERE `entry`=37643; diff --git a/sql/old/3.3.5a/2012_05_05_02_world_gameobject.sql b/sql/old/3.3.5a/2012_05_05_02_world_gameobject.sql new file mode 100644 index 00000000000..c0b2c6b147b --- /dev/null +++ b/sql/old/3.3.5a/2012_05_05_02_world_gameobject.sql @@ -0,0 +1,10 @@ +-- Add some missing Blood of Heroes spawns +SET @GUID := 5276; +DELETE FROM `gameobject` WHERE `guid` BETWEEN @GUID AND @GUID+5; +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES +(@GUID,176213,0,1,1,1529.10242,-1427.06946,65.49049,-3.001947,0,0,-0.9975634,0.06976615,7200,100,1), +(@GUID+1,176213,0,1,1,1705.87439,-4690.138,48.9742165,-3.08918333,0,0,-0.9996567,0.02620165,7200,100,1), +(@GUID+2,176213,0,1,1,1846.79382,-3825.265,135.5159,1.83259487,0,0,0.7933531,0.6087617,7200,100,1), +(@GUID+3,176213,0,1,1,1748.16333,-4453.13525,74.26272,-2.0594883,0,0,0,0,7200,100,1), +(@GUID+4,176213,0,1,1,2159.835,-2442.754,62.0804,-0.4886912,0,0,-0.2419214,0.9702958,7200,100,1), +(@GUID+5,176213,0,1,1,1342.557,-1382.568,46.89193,2.775069,0,0,0.9832544,0.182238,7200,100,1); diff --git a/sql/old/3.3.5a/2012_05_05_03_world_sai.sql b/sql/old/3.3.5a/2012_05_05_03_world_sai.sql new file mode 100644 index 00000000000..fce3b5bc957 --- /dev/null +++ b/sql/old/3.3.5a/2012_05_05_03_world_sai.sql @@ -0,0 +1,17 @@ +-- Wrathbone Laborer SAI +SET @ENTRY := 36830; -- NPC entry +SET @SPELL1 := 70302; -- Blinding Dirt +SET @SPELL2 := 70278; -- Puncture Wound (Normal) +SET @SPELL3 := 70279; -- Puncture Wound (Heroic) +SET @SPELL4 := 69572; -- Shovelled! (Normal) +SET @SPELL5 := 70280; -- Shovelled! (Heroic) +UPDATE `creature_template` SET `unit_flags`=`unit_flags`&~256,`AIName`='SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,0,0,100,6,7000,8000,10000,11000,11,@SPELL1,0,0,0,0,0,5,0,0,0,0,0,0,0, 'Wrathbone Laborer - Combat - Cast Blinding Dirt'), +(@ENTRY,0,1,0,0,0,100,2,8000,9000,9000,10000,11,@SPELL2,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Wrathbone Laborer - Combat - Cast Puncture Wound (Normal)'), +(@ENTRY,0,2,0,0,0,100,4,8000,9000,9000,10000,11,@SPELL3,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Wrathbone Laborer - Combat - Cast Puncture Wound (Heroic)'), +(@ENTRY,0,3,0,0,0,100,2,5000,6000,7000,8000,11,@SPELL4,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Wrathbone Laborer - Combat - Cast Shovelled! (Normal)'), +(@ENTRY,0,4,0,0,0,100,4,5000,6000,7000,8000,11,@SPELL5,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Wrathbone Laborer - Combat - Cast Shovelled! (Heroic)'), +(@ENTRY,0,5,0,1,0,100,6,1000,3000,3000,3000,5,38,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Wrathbone Laborer - OOC - emote'); diff --git a/sql/old/3.3.5a/2012_05_05_04_world_creature_template.sql b/sql/old/3.3.5a/2012_05_05_04_world_creature_template.sql new file mode 100644 index 00000000000..7c4f13dd667 --- /dev/null +++ b/sql/old/3.3.5a/2012_05_05_04_world_creature_template.sql @@ -0,0 +1,27 @@ +-- Fix InhabitType for Eye of the Lich King +UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry`=36913; +-- Updates From CDawg +-- Wrathbone Laborer (heroic) - fix hostility and adds equipment +UPDATE `creature_template` SET `unit_flags`=`unit_flags`&~256,`equipment_id`=104 WHERE `entry`=37638; +-- Wrathbone Siegesmith (Heroic) add equipment +UPDATE `creature_template` SET `equipment_id`=122 WHERE `entry`=37639; +-- Fallen Warrior add equipment +UPDATE `creature_template` SET `equipment_id`=2328 WHERE `entry`=37612; +-- Forgemaster Garfrost add equipment +UPDATE `creature_template` SET `equipment_id`=2325 WHERE `entry`=37613; +-- Deathwhisper Necrolyte add equipment +UPDATE `creature_template` SET `equipment_id`=2365 WHERE `entry`=37609; +-- Deathwhisper Shadowcaster - add equipment +UPDATE `creature_template` SET `equipment_id`=2365 WHERE `entry`=38025; +-- Alliance slaves add equipments +UPDATE `creature_template` SET `equipment_id`=254 WHERE `entry`=37645; +UPDATE `creature_template` SET `equipment_id`=254 WHERE `entry`=37646; +UPDATE `creature_template` SET `equipment_id`=254 WHERE `entry`=37647; +UPDATE `creature_template` SET `equipment_id`=254 WHERE `entry`=37648; +-- horde slaves add equipments +UPDATE `creature_template` SET `equipment_id`=254 WHERE `entry`=37649; +UPDATE `creature_template` SET `equipment_id`=254 WHERE `entry`=37650; +UPDATE `creature_template` SET `equipment_id`=254 WHERE `entry`=37651; +UPDATE `creature_template` SET `equipment_id`=254 WHERE `entry`=37652; +-- Ymirjar Skycaller (heroic) - Fix unit flags and add equipment +UPDATE `creature_template` SET `unit_flags`=`unit_flags`|32832,`equipment_id`=2438 WHERE `entry`=37643; diff --git a/sql/old/3.3.5a/2012_05_05_05_world_creature_template.sql b/sql/old/3.3.5a/2012_05_05_05_world_creature_template.sql new file mode 100644 index 00000000000..a2f2a217252 --- /dev/null +++ b/sql/old/3.3.5a/2012_05_05_05_world_creature_template.sql @@ -0,0 +1,2 @@ +-- Fix skillup on some target dummys +UPDATE `creature_template` SET `flags_extra`=`flags_extra`|262144 WHERE `entry` IN (31144,2674,2673); diff --git a/sql/old/3.3.5a/2012_05_05_06_world_sai.sql b/sql/old/3.3.5a/2012_05_05_06_world_sai.sql new file mode 100644 index 00000000000..7b064af4a4e --- /dev/null +++ b/sql/old/3.3.5a/2012_05_05_06_world_sai.sql @@ -0,0 +1,13 @@ +-- Wrathbone Laborer SAI +SET @ENTRY := 36830; -- NPC entry +SET @SPELL1 := 70302; -- Blinding Dirt +SET @SPELL2 := 70278; -- Puncture Wound +SET @SPELL3 := 69572; -- Shovelled! +UPDATE `creature_template` SET `unit_flags`=`unit_flags`&~256,`AIName`='SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,0,0,100,6,7000,8000,10000,11000,11,@SPELL1,0,0,0,0,0,5,0,0,0,0,0,0,0, 'Wrathbone Laborer - Combat - Cast Blinding Dirt'), +(@ENTRY,0,1,0,0,0,100,6,8000,9000,9000,10000,11,@SPELL2,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Wrathbone Laborer - Combat - Cast Puncture Wound (Normal)'), +(@ENTRY,0,2,0,0,0,100,6,5000,6000,7000,8000,11,@SPELL3,0,0,0,0,0,5,0,0,0,0,0,0,0, 'Wrathbone Laborer - Combat - Cast Shovelled! (Normal)'), +(@ENTRY,0,3,0,1,0,100,6,1000,3000,3000,3000,5,38,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Wrathbone Laborer - OOC - emote'); diff --git a/sql/old/3.3.5a/2012_05_06_00_world_creature_template.sql b/sql/old/3.3.5a/2012_05_06_00_world_creature_template.sql new file mode 100644 index 00000000000..30dbf85c28d --- /dev/null +++ b/sql/old/3.3.5a/2012_05_06_00_world_creature_template.sql @@ -0,0 +1,5 @@ +-- Gold for Toc based on old.wowhead +UPDATE `creature_template` SET `mingold`=850000,`maxgold`=950000 WHERE `entry` IN(34797,35447,35448,35449); -- Icehowl +UPDATE `creature_template` SET `mingold`=550000,`maxgold`=650000 WHERE `entry` IN(34780,35216,35268,35269); -- Lord Jaraxxus +UPDATE `creature_template` SET `mingold`=650000,`maxgold`=700000 WHERE `entry` IN(34497,35350,35351,35352,34496,35347,35348,35359); -- Fjola Lightbane & Eydis Darkbane +UPDATE `creature_template` SET `mingold`=500000,`maxgold`=600000 WHERE `entry` IN(34564,34566,35615,35616); -- Anub'arak diff --git a/sql/old/3.3.5a/2012_05_06_01_world_creature_template.sql b/sql/old/3.3.5a/2012_05_06_01_world_creature_template.sql new file mode 100644 index 00000000000..fa0c9af5805 --- /dev/null +++ b/sql/old/3.3.5a/2012_05_06_01_world_creature_template.sql @@ -0,0 +1,11 @@ +-- Based on old.wowhead.com +UPDATE `creature_template` SET `mingold`=1600000,`maxgold`=1800000 WHERE `entry` IN (33113,34003); -- Flame Levithian +UPDATE `creature_template` SET `mingold`=1100000,`maxgold`=1300000 WHERE `entry` IN (33118,33190); -- Ignis the Furnace Master +UPDATE `creature_template` SET `mingold`=280000,`maxgold`=360000 WHERE `entry` IN (33186,33724); -- Razorscale +UPDATE `creature_template` SET `mingold`=670000,`maxgold`=750000 WHERE `entry` IN (33293,33885); -- XT-002 Deconstructor +UPDATE `creature_template` SET `mingold`=1680000,`maxgold`=1900000 WHERE `entry` IN (32857,33694); -- Stormcaller Brundir +UPDATE `creature_template` SET `mingold`=1680000,`maxgold`=1900000 WHERE `entry` IN (32927,33692); -- Runemaster Molgeim +UPDATE `creature_template` SET `mingold`=1680000,`maxgold`=1900000 WHERE `entry` IN (32867,33693); -- Steelbreaker +UPDATE `creature_template` SET `mingold`=1220000,`maxgold`=1500000 WHERE `entry` IN (33515,34175); -- Auriaya +UPDATE `creature_template` SET `mingold`=1650000,`maxgold`=1950000 WHERE `entry` IN (33271,33449); -- General Vezax +UPDATE `creature_template` SET `mingold`=2020000,`maxgold`=2220000 WHERE `entry` IN (33288,33955); -- Yogg-Saron diff --git a/sql/old/3.3.5a/2012_05_07_00_world_waypoints.sql b/sql/old/3.3.5a/2012_05_07_00_world_waypoints.sql new file mode 100644 index 00000000000..f24b7c9c254 --- /dev/null +++ b/sql/old/3.3.5a/2012_05_07_00_world_waypoints.sql @@ -0,0 +1,73 @@ +-- Wrathbone Siegesmith pathing +SET @NPC := 202159; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=646.5851,`position_y`=-191.1892,`position_z`=526.8476 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,646.5851,-191.1892,526.8476,0,0,0,100,0), +(@PATH,2,648.8837,-181.967,526.7226,0,0,0,100,0), +(@PATH,3,649.4167,-179.4531,526.7226,14000,0,0,100,0), +(@PATH,4,652.1736,-183.3594,526.7226,0,0,0,100,0), +(@PATH,5,648.5643,-188.309,526.8476,0,0,0,100,0), +(@PATH,6,642.5313,-193.4826,527.3874,0,0,0,100,0), +(@PATH,7,633.688,-200.741,528.941,12000,0,0,100,0), +(@PATH,8,641.9254,-196.5747,528.9726,0,0,0,100,0); + +-- Wrathbone Siegesmith pathing +SET @NPC := 201855; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=723.5469,`position_y`=-170.9497,`position_z`=527.5121 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,723.5469,-170.9497,527.5121,13000,0,0,100,0), +(@PATH,2,726.6484,-173.3438,527.1627,0,0,0,100,0), +(@PATH,3,726.6484,-174.3438,527.1627,0,0,0,100,0), +(@PATH,4,725.25,-175.2379,526.8134,0,0,0,100,0), +(@PATH,5,722.0521,-181.5122,526.8134,0,0,0,100,0), +(@PATH,6,721.2031,-187.8142,526.8134,0,0,0,100,0), +(@PATH,7,717.7917,-194.4358,526.8134,0,0,0,100,0), +(@PATH,8,719.3073,-202.2691,527.1509,0,0,0,100,0), +(@PATH,9,720.3403,-206.1198,527.7932,12000,0,0,100,0), +(@PATH,10,717.6111,-199.5035,526.9384,0,0,0,100,0), +(@PATH,11,717.566,-189.0642,526.8134,0,0,0,100,0), +(@PATH,12,718.5764,-182.3958,526.8134,0,0,0,100,0), +(@PATH,13,719.9531,-176.0729,526.8134,0,0,0,100,0); + +-- Forgemaster Garfrost pathing +SET @NPC := 201992; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=712.1371,`position_y`=-215.7014,`position_z`=527.066 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`auras`) VALUES (@NPC,@PATH,1,'68792'); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,712.1371,-215.7014,527.066,0,0,0,100,0), +(@PATH,2,719.507,-227.8559,527.066,3000,0,0,100,0), +(@PATH,3,712.1371,-215.7014,527.066,0,0,0,100,0), +(@PATH,4,685.1805,-207.349,526.8424,0,0,0,100,0), +(@PATH,5,664.5191,-203.3472,526.816,0,0,0,100,0), +(@PATH,6,645.033,-208.5295,528.941,0,0,0,100,0), +(@PATH,7,653.0729,-194.3681,526.7226,0,0,0,100,0), +(@PATH,8,664.8646,-195.2135,526.7226,0,0,0,100,0), +(@PATH,9,686.0816,-213.8264,526.8424,0,0,0,100,0), +(@PATH,10,697.9757,-221.6215,526.8424,0,0,0,100,0), +(@PATH,11,708.0903,-211.908,527.066,0,0,0,100,0), +(@PATH,12,717.8924,-204.6979,527.191,0,0,0,100,0), +(@PATH,13,699.0504,-201.3438,526.8424,0,0,0,100,0), +(@PATH,14,672.066,-201.1493,526.8424,0,0,0,100,0), +(@PATH,15,655.9496,-203.4931,526.816,0,0,0,100,0), +(@PATH,16,672.066,-201.1493,526.8424,0,0,0,100,0), +(@PATH,17,699.0504,-201.3438,526.8424,0,0,0,100,0), +(@PATH,18,717.8924,-204.6979,527.191,0,0,0,100,0), +(@PATH,19,708.0903,-211.908,527.066,0,0,0,100,0), +(@PATH,20,697.9757,-221.6215,526.8424,0,0,0,100,0), +(@PATH,21,686.0816,-213.8264,526.8424,0,0,0,100,0), +(@PATH,22,664.8646,-195.2135,526.7226,0,0,0,100,0), +(@PATH,23,653.0729,-194.3681,526.7226,0,0,0,100,0), +(@PATH,24,645.033,-208.5295,528.941,0,0,0,100,0), +(@PATH,25,664.5191,-203.3472,526.816,0,0,0,100,0), +(@PATH,26,685.1805,-207.349,526.8424,0,0,0,100,0); diff --git a/sql/old/3.3.5a/2012_05_07_01_world_sai.sql b/sql/old/3.3.5a/2012_05_07_01_world_sai.sql new file mode 100644 index 00000000000..83676d31df9 --- /dev/null +++ b/sql/old/3.3.5a/2012_05_07_01_world_sai.sql @@ -0,0 +1,51 @@ +-- Ymirjar Skycaller SAI addition +SET @ENTRY := 31260; -- NPC entry +UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY AND `id`=2; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,2,0,25,0,100,6,0,0,0,0,11,46598,0,0,0,0,0,19,36891,20,0,0,0,0,0, 'Ymirjar Skycaller - Reset - Cast Ride Vehicle Hardcoded'); + +-- Wrathbone Laborer SAI +SET @ENTRY := -201800; -- NPC entry +SET @SPELL1 := 70302; -- Blinding Dirt +SET @SPELL2 := 70278; -- Puncture Wound +SET @SPELL3 := 69572; -- Shovelled! +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,0,0,100,6,7000,8000,10000,11000,11,@SPELL1,0,0,0,0,0,5,0,0,0,0,0,0,0, 'Wrathbone Laborer - Combat - Cast Blinding Dirt'), +(@ENTRY,0,1,0,0,0,100,6,8000,9000,9000,10000,11,@SPELL2,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Wrathbone Laborer - Combat - Cast Puncture Wound (Normal)'), +(@ENTRY,0,2,0,0,0,100,6,5000,6000,7000,8000,11,@SPELL3,0,0,0,0,0,5,0,0,0,0,0,0,0, 'Wrathbone Laborer - Combat - Cast Shovelled! (Normal)'); + +-- Wrathbone Laborer pathing +SET @NPC := 201800; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=584.4202,`position_y`=188.9149,`position_z`=509.6726 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,584.4202,188.9149,509.6726,0,0,0,100,0), +(@PATH,2,583.6736,193.9653,509.7404,3000,0,48,100,0), +(@PATH,3,583.6736,193.9653,509.7404,3000,0,48,100,0), +(@PATH,4,583.6736,193.9653,509.7404,3000,0,48,100,0), +(@PATH,5,583.6736,193.9653,509.7404,3000,0,48,100,0), +(@PATH,6,594.0781,190.2622,508.8613,0,0,0,100,0), +(@PATH,7,604.9809,191.5451,507.6583,0,0,0,100,0), +(@PATH,8,617.8438,191.3455,507.5206,0,0,0,100,0), +(@PATH,9,633.1597,186.8281,508.6275,3000,0,48,100,0), +(@PATH,10,633.1597,186.8281,508.6275,3000,0,48,100,0), +(@PATH,11,624.3472,190.9705,507.7706,0,0,0,100,0), +(@PATH,12,613.3229,189.9236,507.3956,0,0,0,100,0), +(@PATH,13,604.5156,189.651,507.3956,0,0,0,100,0), +(@PATH,14,593.9844,187.4479,508.9778,0,0,0,100,0), +(@PATH,15,584.4202,188.9149,509.6726,0,0,0,100,0); +DELETE FROM `waypoint_scripts` WHERE `id`=48; +INSERT INTO `waypoint_scripts` (`id`,`delay`,`command`,`datalong`,`guid`) VALUES +(48,0,1,38,67); + +-- Add Overlord Drakuru riders to Stonespine Gargoyle +UPDATE creature_template SET InhabitType=4,`flags_extra`=`flags_extra`|128 WHERE entry=28717; +DELETE FROM `creature` WHERE `id`=28717 AND `map`=658; +DELETE FROM `vehicle_template_accessory` WHERE `entry`=36896; +INSERT INTO `vehicle_template_accessory` (`entry`,`accessory_entry`,`seat_id`,`minion`,`description`,`summontype`,`summontimer`) VALUES +(36896,28717,1,0, 'Overlord Drakuru on Stonespine Gargoyle',6,30000); diff --git a/sql/old/3.3.5a/2012_05_08_00_world_sai.sql b/sql/old/3.3.5a/2012_05_08_00_world_sai.sql new file mode 100644 index 00000000000..8a776b5f2d2 --- /dev/null +++ b/sql/old/3.3.5a/2012_05_08_00_world_sai.sql @@ -0,0 +1,89 @@ +-- [Q] Arelion's Mistress +-- Viera Sunwhisper SAI +-- Twinkle SAI +SET @ENTRY_VIERA := 17226; +SET @ENTRY_TWINKLE := 17230; +SET @QUEST_PLEASURES := 9483; +SET @SPELL_RETRIBUTION := 30077; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (@ENTRY_VIERA,@ENTRY_TWINKLE); +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY_VIERA,@ENTRY_TWINKLE,@ENTRY_VIERA*100,@ENTRY_VIERA*100+1); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY_VIERA,0,0,0,20,0,100,0,@QUEST_PLEASURES,0,0,0,80,@ENTRY_VIERA*100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Viera Sunwhisper - On Quest Finish - Run Script'), +(@ENTRY_VIERA*100,9,0,0,0,0,100,0,0,0,0,0,81,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Viera Sunwhisper - On Script - Remove Quest Flag"), +(@ENTRY_VIERA*100,9,1,0,0,0,100,0,2000,2000,0,0,53,0,@ENTRY_VIERA,0,0,0,0,1,0,0,0,0,0,0,0,'Viera Sunwhisper - On Script - Start WP 1'), +(@ENTRY_VIERA*100,9,2,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'Viera Sunwhisper - On Script - Say Line 0'), +(@ENTRY_VIERA*100,9,3,0,0,0,100,0,0,0,0,0,91,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Viera Sunwhisper - On Script - Stand Up'), +(@ENTRY_VIERA*100,9,4,0,0,0,100,0,6500,6500,0,0,45,0,1,0,0,0,0,10,61963,@ENTRY_TWINKLE,0,0,0,0,0,'Viera Sunwhisper - On Script - Set Data 0 1 Twinkle'), +(@ENTRY_VIERA,0,1,2,40,0,100,0,10,@ENTRY_VIERA,0,0,66,0,0,0,0,0,0,11,@ENTRY_TWINKLE,15,0,0,0,0,0,'Viera Sunwhisper - On WP 10 - Face Twinkle'), +(@ENTRY_VIERA,0,2,0,61,0,100,0,0,0,0,0,54,1000000,0,0,0,0,0,1,0,0,0,0,0,0,0,'Viera Sunwhisper - On WP 10 - Pause WP'), + +(@ENTRY_TWINKLE,0,0,0,38,0,100,0,0,1,0,0,53,1,@ENTRY_TWINKLE,0,0,0,0,1,0,0,0,0,0,0,0,'Twinkle - On Data 0 1 Set - Start WP 1 (run)'), +(@ENTRY_TWINKLE,0,1,0,40,0,100,0,13,@ENTRY_TWINKLE,0,0,54,1000000,0,0,0,0,0,1,0,0,0,0,0,0,0,'Twinkle - On WP 13 - Pause WP'), +(@ENTRY_TWINKLE,0,2,0,38,0,100,0,1,2,0,0,53,1,@ENTRY_TWINKLE*10,0,0,0,0,1,0,0,0,0,0,0,0,'Twinkle - On Data Set 1 2 - Start WP 2 (run)'), +(@ENTRY_TWINKLE,0,3,0,40,0,100,0,4,@ENTRY_TWINKLE*10,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Viera Sunwhisper - On WP 4 (2) - Force Despawn'), + +(@ENTRY_VIERA,0,3,0,8,0,100,0,@SPELL_RETRIBUTION,0,0,0,80,@ENTRY_VIERA*100+1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Viera Sunwhisper - On Spellhit - Run Second Script'), +(@ENTRY_VIERA*100+1,9,0,0,0,0,100,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Viera Sunwhisper - On Script - Say Line 1'), +(@ENTRY_VIERA*100+1,9,1,0,0,0,100,0,0,0,0,0,33,@ENTRY_VIERA,0,0,0,0,0,7,0,0,0,0,0,0,0,'Viera Sunwhisper - On Script - Quest Credit'), +(@ENTRY_VIERA*100+1,9,2,0,0,0,100,0,3000,3000,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Viera Sunwhisper - On Script - Say Line 2'), +(@ENTRY_VIERA*100+1,9,3,0,0,0,100,0,5000,5000,0,0,1,0,0,0,0,0,0,9,@ENTRY_TWINKLE,0,25,0,0,0,0,'Twinkle - On Script - Say Line 0'), +(@ENTRY_VIERA*100+1,9,4,0,0,0,100,0,2000,2000,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Viera Sunwhisper - On Script - Say Line 3'), +(@ENTRY_VIERA*100+1,9,5,0,0,0,100,0,0,0,0,0,45,1,2,0,0,0,0,10,61963,@ENTRY_TWINKLE,0,0,0,0,0,'Viera Sunwhisper - On Script - Set Data 1 2 Twinkle'), +(@ENTRY_VIERA*100+1,9,6,0,0,0,100,0,0,0,0,0,53,1,@ENTRY_VIERA*10,0,0,0,0,1,0,0,0,0,0,0,0,'Viera Sunwhisper - On Script - Start WP 2 (run)'), +(@ENTRY_VIERA,0,4,0,40,0,100,0,4,@ENTRY_VIERA*10,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Viera Sunwhisper - On WP 4 (2) - Force Despawn'); + +-- Waypoints for Viera Sunwhisper +DELETE FROM `waypoints` WHERE `entry` IN (@ENTRY_VIERA,@ENTRY_VIERA*10); +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(@ENTRY_VIERA,1,-653.739197,4145.138184,64.200729,'Viera Sunwhisper'), +(@ENTRY_VIERA,2,-658.875732,4147.715332,64.168304,'Viera Sunwhisper'), +(@ENTRY_VIERA,3,-681.465088,4147.636230,64.118073,'Viera Sunwhisper'), +(@ENTRY_VIERA,4,-686.400696,4161.865234,59.707859,'Viera Sunwhisper'), +(@ENTRY_VIERA,5,-695.956909,4179.237305,57.618931,'Viera Sunwhisper'), +(@ENTRY_VIERA,6,-699.832153,4189.959473,57.503750,'Viera Sunwhisper'), +(@ENTRY_VIERA,7,-708.518616,4184.436035,55.275894,'Viera Sunwhisper'), +(@ENTRY_VIERA,8,-716.137268,4178.130371,52.637508,'Viera Sunwhisper'), +(@ENTRY_VIERA,9,-719.865295,4174.992676,51.554867,'Viera Sunwhisper'), +(@ENTRY_VIERA,10,-720.839417,4162.232422,50.805923,'Viera Sunwhisper'), + +(@ENTRY_VIERA*10,1,-722.323486,4147.936523,50.337898,'Viera Sunwhisper'), +(@ENTRY_VIERA*10,2,-726.639343,4125.156250,48.479683,'Viera Sunwhisper'), +(@ENTRY_VIERA*10,3,-727.648315,4109.684082,47.528461,'Viera Sunwhisper'), +(@ENTRY_VIERA*10,4,-727.874329,4093.438721,46.446579,'Viera Sunwhisper'); + +-- Waypoints for Twinkle +DELETE FROM `waypoints` WHERE `entry` IN (@ENTRY_TWINKLE,@ENTRY_TWINKLE*10); +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(@ENTRY_TWINKLE,1,-605.445190,4165.205078,64.081802,'Twinkle'), +(@ENTRY_TWINKLE,2,-619.293335,4161.776855,63.217815,'Twinkle'), +(@ENTRY_TWINKLE,3,-629.536560,4153.708984,64.067123,'Twinkle'), +(@ENTRY_TWINKLE,4,-644.773438,4151.062988,64.174675,'Twinkle'), +(@ENTRY_TWINKLE,5,-658.875732,4147.715332,64.168304,'Twinkle'), +(@ENTRY_TWINKLE,6,-681.465088,4147.636230,64.118073,'Twinkle'), +(@ENTRY_TWINKLE,7,-686.400696,4161.865234,59.707859,'Twinkle'), +(@ENTRY_TWINKLE,8,-695.956909,4179.237305,57.618931,'Twinkle'), +(@ENTRY_TWINKLE,9,-699.832153,4189.959473,57.503750,'Twinkle'), +(@ENTRY_TWINKLE,10,-708.518616,4184.436035,55.275894,'Twinkle'), +(@ENTRY_TWINKLE,11,-716.137268,4178.130371,52.637508,'Twinkle'), +(@ENTRY_TWINKLE,12,-719.865295,4174.992676,51.554867,'Twinkle'), +(@ENTRY_TWINKLE,13,-720.636292,4166.637695,50.815567,'Twinkle'), + +(@ENTRY_TWINKLE*10,1,-722.323486,4147.936523,50.337898,'Twinkle'), +(@ENTRY_TWINKLE*10,2,-726.639343,4125.156250,48.479683,'Twinkle'), +(@ENTRY_TWINKLE*10,3,-727.648315,4109.684082,47.528461,'Twinkle'), +(@ENTRY_TWINKLE*10,4,-727.874329,4093.438721,46.446579,'Twinkle'); + +-- Spawn spell focus object on correct position +DELETE FROM `gameobject` WHERE `id`=300071 AND `guid`=303; +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES +(303,300071,530,1,1,-720.803,4162.77,50.7916,4.61029,0,0,0.742267,-0.670104,300,0,1); + +-- Texts +DELETE FROM `creature_text` WHERE `entry` IN (@ENTRY_VIERA,@ENTRY_TWINKLE); +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY_VIERA,0,0,"Ok, let's go. I know just the perfect spot!",12,0,100,0,0,0,'Viera Sunwhisper'), +(@ENTRY_VIERA,1,0,"I can't wait to try this wine!",12,0,100,0,0,0,'Viera Sunwhisper'), +(@ENTRY_VIERA,2,0,"What... is happening... to me? Get this cat away from me!",12,0,100,0,0,0,'Viera Sunwhisper'), +(@ENTRY_VIERA,3,0,"%s scurries away, attempting to flee from Twinkle",16,0,100,0,0,0,'Viera Sunwhisper'), + +(@ENTRY_TWINKLE,0,0,"%s looks at Viera Sunwhisper with very hungry eyes",16,0,100,0,0,0,'Twinkle'); diff --git a/sql/old/3.3.5a/2012_05_08_01_world_gameobject.sql b/sql/old/3.3.5a/2012_05_08_01_world_gameobject.sql new file mode 100644 index 00000000000..b83d02b4762 --- /dev/null +++ b/sql/old/3.3.5a/2012_05_08_01_world_gameobject.sql @@ -0,0 +1,5 @@ +-- Add Missing Ice Wall, Pit of Saron +SET @GUID := 305; +DELETE FROM `gameobject` WHERE `guid`=@GUID; +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES +(@GUID,201885,658,3,1,932.2674,-80.6684,591.6761,2.286379,0,0,0,0,300,100,1); diff --git a/sql/old/3.3.5a/2012_05_08_01_world_misc.sql b/sql/old/3.3.5a/2012_05_08_01_world_misc.sql new file mode 100644 index 00000000000..8f19132fa27 --- /dev/null +++ b/sql/old/3.3.5a/2012_05_08_01_world_misc.sql @@ -0,0 +1,9 @@ +-- Spell area spells for entering POS +DELETE FROM `spell_area` WHERE `spell` IN (70056,70057); +INSERT INTO `spell_area` (`spell`,`area`,`quest_start`,`quest_start_active`,`quest_end`,`aura_spell`,`racemask`,`gender`,`autocast`) VALUES +(70056,4904,0,0,0,0,690,2,1), -- Send Script Event (22717) +(70057,4904,0,0,0,0,1101,2,1); -- Send Script Event (22718) + +-- Fix flags and equipment for Ymirjar Deathbringer +UPDATE `creature_template` SET `unit_flags`=`unit_flags`&~256 WHERE `entry` IN (36892,37641); +UPDATE `creature_template` SET `equipment_id`=2444 WHERE `entry`=37641; diff --git a/sql/old/3.3.5a/2012_05_09_00_world_spell_target_position.sql b/sql/old/3.3.5a/2012_05_09_00_world_spell_target_position.sql new file mode 100644 index 00000000000..a6e9d7289b7 --- /dev/null +++ b/sql/old/3.3.5a/2012_05_09_00_world_spell_target_position.sql @@ -0,0 +1,7 @@ +DELETE FROM `spell_target_position` WHERE `id` IN (67834, 68081); +INSERT INTO `spell_target_position` (`id`,`target_map`,`target_position_x`,`target_position_y`,`target_position_z`,`target_orientation`) VALUES +(67834, 571, 3167.01, 5586.04, 880.067, 0), +(68081, 571, 5857.252, 516.8015, 599.82, 2.987); + +UPDATE `spell_target_position` SET `target_position_x`=6136.89,`target_position_y`=4785.55,`target_position_z`=100.673 WHERE `id`=67835; +UPDATE `spell_target_position` SET `target_position_x`=8301.39,`target_position_y`=1501.34,`target_position_z`=870.555 WHERE `id`=67836; diff --git a/sql/old/3.3.5a/2012_05_09_01_world_commands.sql b/sql/old/3.3.5a/2012_05_09_01_world_commands.sql new file mode 100644 index 00000000000..dcd4c9130eb --- /dev/null +++ b/sql/old/3.3.5a/2012_05_09_01_world_commands.sql @@ -0,0 +1,8 @@ +DELETE FROM `trinity_string` WHERE `entry` = 555; +INSERT INTO `trinity_string` (`entry`,`content_default`) VALUES +(555,"SetData performed on [GUID: %u, entry: %u, name: %s] Field: %u, Data: %u, with %s"); + +DELETE FROM `command` WHERE `name` = "npc set data"; +INSERT INTO `command` (`name`,`security`,`help`) VALUES +("npc set data", 3, "Syntax: .npc set data $field $data +Sets data for the selected creature. Used for testing Scripting"); diff --git a/sql/old/3.3.5a/2012_05_09_02_world_sai.sql b/sql/old/3.3.5a/2012_05_09_02_world_sai.sql new file mode 100644 index 00000000000..01004b23505 --- /dev/null +++ b/sql/old/3.3.5a/2012_05_09_02_world_sai.sql @@ -0,0 +1,116 @@ +-- Fixup for Quest Quest:The Path to the Citadel "Alliance and Horde" + +-- Alliance slave add missing equipments +UPDATE `creature_template` SET `equipment_id`=254 WHERE `entry`=36767; + +-- Horde Slave SAI +UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry` IN (36770,36771,36772,36773); +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid` IN (36770,36771,36772,36773); +DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid` IN (3677000); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(36770,0,0,0,11,0,100,6,0,0,0,0,17,233,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Horde Slave - On Reset - Emotestate'), +(36771,0,0,0,11,0,100,6,0,0,0,0,17,233,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Horde Slave - On Reset - Emotestate'), +(36772,0,0,0,11,0,100,6,0,0,0,0,17,233,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Horde Slave - On Reset - Emotestate'), +(36773,0,0,0,11,0,100,6,0,0,0,0,17,233,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Horde Slave - On Reset - Emotestate'), +(36770,0,1,0,8,0,100,7,71281,0,0,0,80,3677000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Horde Slave - On Spellhit - Run Script'), +(36771,0,1,0,8,0,100,7,71281,0,0,0,80,3677000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Horde Slave - On Spellhit - Run Script'), +(36772,0,1,0,8,0,100,7,71281,0,0,0,80,3677000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Horde Slave - On Spellhit - Run Script'), +(36773,0,1,0,8,0,100,7,71281,0,0,0,80,3677000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Horde Slave - On Spellhit - Run Script'), +-- Script +(3677000,9,0,0,0,0,100,0,500,500,500,500,66,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Horde Slave - Script - Turnto envoker'), +(3677000,9,1,0,0,0,100,0,500,500,500,500,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Horde Slave - Script - say text'), +(3677000,9,2,0,0,0,100,0,100,100,100,100,18,512,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Horde Slave - Script - set unitflag'), +(3677000,9,3,0,0,0,100,0,100,100,100,100,2,250,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Horde Slave - Script - set faction'), +(3677000,9,4,0,0,0,100,0,100,100,100,100,17,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Horde Slave - Script - set Emotestate'), +(3677000,9,5,0,0,0,100,0,100,100,100,100,33,36770,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Horde Slave - Script - give quest credit'), +(3677000,9,6,0,0,0,100,0,100,100,100,100,59,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Horde Slave - Script - set run on'), +(3677000,9,7,0,0,0,100,0,500,500,500,500,69,1,0,0,0,0,0,19,23837,70,0,0,0,0,0, 'Horde Slave - Script - move to closest trigger'), +(3677000,9,8,0,0,0,100,0,8000,8000,8000,8000,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Horde Slave - Script - despawn'); + +-- Alliance Slave SAI +UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry` IN (36764,36765,36766,36767); +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid` IN (36764,36765,36766,36767); +DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid` IN (3676400); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(36764,0,0,0,11,0,100,6,0,0,0,0,17,233,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Alliance Slave - On Reset - Emotestate'), +(36765,0,0,0,11,0,100,6,0,0,0,0,17,233,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Alliance Slave - On Reset - Emotestate'), +(36766,0,0,0,11,0,100,6,0,0,0,0,17,233,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Alliance Slave - On Reset - Emotestate'), +(36767,0,0,0,11,0,100,6,0,0,0,0,17,233,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Alliance Slave - On Reset - Emotestate'), +(36764,0,1,0,8,0,100,7,71281,0,0,0,80,3676400,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Alliance Slave - On Spellhit - Run Script'), +(36765,0,1,0,8,0,100,7,71281,0,0,0,80,3676400,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Alliance Slave - On Spellhit - Run Script'), +(36766,0,1,0,8,0,100,7,71281,0,0,0,80,3676400,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Alliance Slave - On Spellhit - Run Script'), +(36767,0,1,0,8,0,100,7,71281,0,0,0,80,3676400,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Alliance Slave - On Spellhit - Run Script'), +-- Script +(3676400,9,0,0,0,0,100,0,500,500,500,500,66,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Alliance Slave - Script - Turnto envoker'), +(3676400,9,1,0,0,0,100,0,500,500,500,500,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Alliance Slave - Script - say text'), +(3676400,9,2,0,0,0,100,0,100,100,100,100,18,512,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Alliance Slave - Script - set unitflag'), +(3676400,9,3,0,0,0,100,0,100,100,100,100,2,250,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Alliance Slave - Script - set faction'), +(3676400,9,4,0,0,0,100,0,100,100,100,100,17,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Alliance Slave - Script - set Emotestate'), +(3676400,9,5,0,0,0,100,0,100,100,100,100,33,36764,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Alliance Slave - Script - give quest credit'), +(3676400,9,6,0,0,0,100,0,100,100,100,100,59,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Alliance Slave - Script - set run on'), +(3676400,9,7,0,0,0,100,0,500,500,500,500,69,1,0,0,0,0,0,19,23837,70,0,0,0,0,0, 'Alliance Slave - Script - move to closest trigger'), +(3676400,9,8,0,0,0,100,0,8000,8000,8000,8000,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Alliance Slave - Script - despawn'); + +-- Ball and chain SAI +UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI' WHERE `entry` IN (201969); +DELETE FROM `smart_scripts` WHERE `source_type`=1 AND `entryorguid` IN (201969); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(201969,1,0,0,64,0,100,6,0,0,0,0,85,71281,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Ball and chain - On Gossip Hello - Envoker cast on self'); + +-- Spell Conditions +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=71281; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,1,71281,0,31,3,36770,0,0,'','Spell 71281 targets entry 36770'), +(13,1,71281,1,31,3,36771,0,0,'','Spell 71281 targets entry 36771'), +(13,1,71281,2,31,3,36772,0,0,'','Spell 71281 targets entry 36772'), +(13,1,71281,3,31,3,36773,0,0,'','Spell 71281 targets entry 36773'), +(13,1,71281,4,31,3,36764,0,0,'','Spell 71281 targets entry 36764'), +(13,1,71281,5,31,3,36765,0,0,'','Spell 71281 targets entry 36765'), +(13,1,71281,6,31,3,36766,0,0,'','Spell 71281 targets entry 36766'), +(13,1,71281,7,31,3,36767,0,0,'','Spell 71281 targets entry 36767'); + +-- Creature text from sniff +DELETE FROM `creature_text` WHERE `entry` IN (36770,36771,36772,36773,36764,36765,36766,36767); +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +-- Alliance Slaves +(36764,0,0, 'You''re a beautiful sight... you have no idea.',12,0,100,0,0,0, 'Alliance Slave'), +(36764,0,1, '%s lets his mining pick drag on the ground as she approaches, clearly exhausted.',16,0,100,0,0,0, 'Alliance Slave'), +(36764,0,2, 'Have my babies.',12,0,100,0,0,0, 'Alliance Slave'), +(36764,0,3, 'If by life or death I can repay you, I will.',12,0,100,0,0,0, 'Alliance Slave'), +(36764,0,4, 'I''m going to return to the front of the quarry. Kill a few extra for me.',12,0,100,0,0,0, 'Alliance Slave'), +(36765,0,0, 'You''re a beautiful sight... you have no idea.',12,0,100,0,0,0, 'Alliance Slave'), +(36765,0,1, '%s lets his mining pick drag on the ground as she approaches, clearly exhausted.',16,0,100,0,0,0, 'Alliance Slave'), +(36765,0,2, 'Have my babies.',12,0,100,0,0,0, 'Alliance Slave'), +(36765,0,3, 'If by life or death I can repay you, I will.',12,0,100,0,0,0, 'Alliance Slave'), +(36765,0,4, 'I''m going to return to the front of the quarry. Kill a few extra for me.',12,0,100,0,0,0, 'Alliance Slave'), +(36766,0,0, 'You''re a beautiful sight... you have no idea.',12,0,100,0,0,0, 'Alliance Slave'), +(36766,0,1, '%s lets his mining pick drag on the ground as she approaches, clearly exhausted.',16,0,100,0,0,0, 'Alliance Slave'), +(36766,0,2, 'Have my babies.',12,0,100,0,0,0, 'Alliance Slave'), +(36766,0,3, 'If by life or death I can repay you, I will.',12,0,100,0,0,0, 'Alliance Slave'), +(36766,0,4, 'I''m going to return to the front of the quarry. Kill a few extra for me.',12,0,100,0,0,0, 'Alliance Slave'), +(36767,0,0, 'You''re a beautiful sight... you have no idea.',12,0,100,0,0,0, 'Alliance Slave'), +(36767,0,1, '%s lets his mining pick drag on the ground as she approaches, clearly exhausted.',16,0,100,0,0,0, 'Alliance Slave'), +(36767,0,2, 'Have my babies.',12,0,100,0,0,0, 'Alliance Slave'), +(36767,0,3, 'If by life or death I can repay you, I will.',12,0,100,0,0,0, 'Alliance Slave'), +(36767,0,4, 'I''m going to return to the front of the quarry. Kill a few extra for me.',12,0,100,0,0,0, 'Alliance Slave'), +-- Horde Slaves +(36770,0,0, 'You''re a beautiful sight... you have no idea.',12,0,100,0,0,0, 'Horde Slave'), +(36770,0,1, '%s lets his mining pick drag on the ground as she approaches, clearly exhausted.',16,0,100,0,0,0, 'Horde Slave'), +(36770,0,2, 'Have my babies.',12,0,100,0,0,0, 'Horde Slave'), +(36770,0,3, 'If by life or death I can repay you, I will.',12,0,100,0,0,0, 'Horde Slave'), +(36770,0,4, 'I''m going to return to the front of the quarry. Kill a few extra for me.',12,0,100,0,0,0, 'Horde Slave'), +(36771,0,0, 'You''re a beautiful sight... you have no idea.',12,0,100,0,0,0, 'Horde Slave'), +(36771,0,1, '%s lets his mining pick drag on the ground as she approaches, clearly exhausted.',16,0,100,0,0,0, 'Horde Slave'), +(36771,0,2, 'Have my babies.',12,0,100,0,0,0, 'Horde Slave'), +(36771,0,3, 'If by life or death I can repay you, I will.',12,0,100,0,0,0, 'Horde Slave'), +(36771,0,4, 'I''m going to return to the front of the quarry. Kill a few extra for me.',12,0,100,0,0,0, 'Horde Slave'), +(36772,0,0, 'You''re a beautiful sight... you have no idea.',12,0,100,0,0,0, 'Horde Slave'), +(36772,0,1, '%s lets his mining pick drag on the ground as she approaches, clearly exhausted.',16,0,100,0,0,0, 'Horde Slave'), +(36772,0,2, 'Have my babies.',12,0,100,0,0,0, 'Horde Slave'), +(36772,0,3, 'If by life or death I can repay you, I will.',12,0,100,0,0,0, 'Horde Slave'), +(36772,0,4, 'I''m going to return to the front of the quarry. Kill a few extra for me.',12,0,100,0,0,0, 'Horde Slave'), +(36773,0,0, 'You''re a beautiful sight... you have no idea.',12,0,100,0,0,0, 'Horde Slave'), +(36773,0,1, '%s lets his mining pick drag on the ground as she approaches, clearly exhausted.',16,0,100,0,0,0, 'Horde Slave'), +(36773,0,2, 'Have my babies.',12,0,100,0,0,0, 'Horde Slave'), +(36773,0,3, 'If by life or death I can repay you, I will.',12,0,100,0,0,0, 'Horde Slave'), +(36773,0,4, 'I''m going to return to the front of the quarry. Kill a few extra for me.',12,0,100,0,0,0, 'Horde Slave'); diff --git a/sql/old/3.3.5a/2012_05_09_03_world_misc.sql b/sql/old/3.3.5a/2012_05_09_03_world_misc.sql new file mode 100644 index 00000000000..63e162fcfce --- /dev/null +++ b/sql/old/3.3.5a/2012_05_09_03_world_misc.sql @@ -0,0 +1,56 @@ +-- Update Scourgelord Tyrannus "Make him fly" +UPDATE `creature_template_addon` SET `bytes1`=50331648 WHERE `entry`=36794; + +-- Put Rimefang in the air and make him fly +UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry`=36661; +UPDATE `creature_template_addon` SET `bytes1`=50331648 WHERE `entry`=36661; + +-- Deathwhisper Necrolyte SAI +SET @ENTRY := 36788; -- NPC entry +SET @SPELL1 := 69577; -- Shadow Bolt +SET @SPELL2 := 69578; -- Conversion Beam +SET @SPELL3 := 45104; -- Shadow Channelling +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,0,0,100,6,100,100,3000,3000,11,@SPELL1,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Deathwhisper Necrolyte - Combat - Cast Shadow Bolt'), +(@ENTRY,0,1,0,0,0,100,6,9000,9000,24000,24000,11,@SPELL2,0,0,0,0,0,5,0,0,0,0,0,0,0, 'Deathwhisper Necrolyte - Combat - Cast Conversion Beam'); + +-- Deathwhisper Necrolyte pathing +SET @NPC := 202231; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=592.975,`position_y`=176.104,`position_z`=508.746 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,596.0208,175.5243,508.3654,0,0,0,100,0), +(@PATH,2,605.2656,157.7101,507.2126,0,0,0,100,0), +(@PATH,3,604.4063,146.283,507.3376,0,0,0,100,0), +(@PATH,4,592.2899,131.4271,507.8163,0,0,0,100,0), +(@PATH,5,577.4531,118.224,508.3163,0,0,0,100,0), +(@PATH,6,563.0695,103.7309,514.1504,0,0,0,100,0), +(@PATH,7,557.7743,89.41319,523.1727,0,0,0,100,0), +(@PATH,8,560.9583,77.65278,525.4227,0,0,0,100,0), +(@PATH,9,560.9583,77.65278,525.4227,0,0,0,100,0), +(@PATH,10,571.0139,69.43403,525.2753,0,0,0,100,0), +(@PATH,11,560.9583,77.65278,525.4227,0,0,0,100,0), +(@PATH,12,557.7743,89.41319,523.1727,0,0,0,100,0), +(@PATH,13,563.0695,103.7309,514.1504,0,0,0,100,0), +(@PATH,14,577.4531,118.224,508.3163,0,0,0,100,0), +(@PATH,15,592.2899,131.4271,507.8163,0,0,0,100,0), +(@PATH,16,604.4063,146.283,507.3376,0,0,0,100,0), +(@PATH,17,605.2656,157.7101,507.2126,0,0,0,100,0), +(@PATH,18,596.0208,175.5243,508.3654,0,0,0,100,0); + +DELETE FROM `creature_formations` WHERE `leaderGUID`=202231; +INSERT INTO `creature_formations` (`leaderGUID`,`memberGUID`,`dist`,`angle`,`groupAI`) VALUES +(202231,202231,0,0,2), +(202231,202099,7,288,2), +(202231,202282,7,324,2), +(202231,202125,7,360,2), +(202231,202203,7,36,2), +(202231,201960,7,72,2); + +-- Remove a dupe spawn +DELETE FROM `creature` WHERE `guid`=201998; +DELETE FROM `creature_addon` WHERE `guid`=201998; diff --git a/sql/old/3.3.5a/2012_05_10_00_world_sai.sql b/sql/old/3.3.5a/2012_05_10_00_world_sai.sql new file mode 100644 index 00000000000..c6d6e914345 --- /dev/null +++ b/sql/old/3.3.5a/2012_05_10_00_world_sai.sql @@ -0,0 +1,42 @@ +-- [Q] See You on the Other Side + +-- Gan'jo SAI +SET @ENTRY := 26924; +SET @QUEST := 12121; +SET @GOSSIP := 10220; +SET @SPELL_RESURRECT := 61613; +UPDATE `creature_template` SET `npcflag`=3,`AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,1,62,0,100,0,@GOSSIP,0,0,0,11,@SPELL_RESURRECT,1,0,0,0,0,7,0,0,0,0,0,0,0,"Gan'jo - On Gossip Select - Cast Ganjo Resurrection"), +(@ENTRY,0,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Gan'jo - On Gossip Select - Close Gossip"); + +-- Essence of Warlord Jin'arrak SAI +SET @ENTRY := 26902; +SET @SPELL_DIE_EFFECT := 61611; +SET @SPELL_CAMERA_SHAKE := 47533; +UPDATE `creature_template` SET `AIName`='SmartAI',`flags_extra`=128 WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY,@ENTRY*100) AND `source_type` IN (0,9); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,54,0,100,0,0,0,0,0,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0,"Essence of Warlord Jin'arrak - On Just Summoned - Run Script"), +(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,85,@SPELL_CAMERA_SHAKE,0,0,0,0,0,7,0,0,0,0,0,0,0,"Essence of Warlord Jin'arrak - On Script - Invoker Cast Camera Shake - Small"), +(@ENTRY*100,9,1,0,0,0,100,0,4000,4000,0,0,33,@ENTRY,0,0,0,0,0,7,0,0,0,0,0,0,0,"Essence of Warlord Jin'arrak - On Script - Killed Monster Credit"), +(@ENTRY*100,9,2,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Essence of Warlord Jin'arrak - On Script - Monster Whisper Line 0"), +(@ENTRY*100,9,3,0,0,0,100,0,0,0,0,0,85,@SPELL_CAMERA_SHAKE,0,0,0,0,0,7,0,0,0,0,0,0,0,"Essence of Warlord Jin'arrak - On Script - Invoker Cast Camera Shake - Small"), +(@ENTRY*100,9,4,0,0,0,100,0,3000,3000,0,0,85,@SPELL_DIE_EFFECT,0,0,0,0,0,7,0,0,0,0,0,0,0,"Essence of Warlord Jin'arrak - On Script - Invoker Cast On The Other Side"); + +-- Essence of Warlord Jin'arrak text +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0,"How dare you summon me without an offering!",42,0,0,0,0,0,"Essence of Warlord Jin'arrak"); + +-- Ganjo's Resurrection removes On The Other Side +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=@SPELL_RESURRECT; +INSERT INTO `spell_linked_spell` (`spell_trigger`,`spell_effect`,`type`,`comment`) VALUES +(@SPELL_RESURRECT,-@SPELL_DIE_EFFECT,1,"Ganjo's Resurrection removes On The Other Side"); + +-- Conditions for Gan'jo's gossip option +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ConditionTarget`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`comment`) VALUES +(15,@GOSSIP,0,0,0,1,@SPELL_DIE_EFFECT,0,"Ganjo's Gossip - requires aura See You On The Other Side"), +(15,@GOSSIP,0,0,1,9,@QUEST,0,"Ganjo's Gossip - requires quest See You On The Other Side to be rewarded"); diff --git a/sql/old/3.3.5a/2012_05_10_01_world_misc.sql b/sql/old/3.3.5a/2012_05_10_01_world_misc.sql new file mode 100644 index 00000000000..a7a30d518a2 --- /dev/null +++ b/sql/old/3.3.5a/2012_05_10_01_world_misc.sql @@ -0,0 +1,37 @@ +-- [Q] Leave Nothing to Chance + +-- Lower Wintergarde Mine Shaft and Upper Wintergarde Mine Shaft +UPDATE `creature_template` SET `MovementType`=0,`flags_extra`=`flags_extra`|128 WHERE `entry`IN (27437,27436); +UPDATE `creature` SET `MovementType`=0,`spawndist`=0 WHERE `id` IN (27437,27436); + +-- Wintergarde Mine Bomb SAI +SET @ENTRY := 27435; +SET @SPELL_EXPLOSION := 48742; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,1,1,0,100,1,14000,14000,0,0,11,@SPELL_EXPLOSION,2,0,0,0,0,1,0,0,0,0,0,0,0,"Wintergarde Mine Bomb - Out of Combat - Cast Wintergarde Mine Explosion"), +(@ENTRY,0,1,0,61,0,100,0,0,0,0,0,41,3000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Wintergarde Mine Bomb - On Wintergarde Mine Explosion Cast - Forced Despawn"); + +-- Spawn missing spell focus object for upper mine +DELETE FROM `gameobject` WHERE `id`=188711 AND `guid`=370; +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES +(370,188711,571,1,1,3898.18,-881.748,119.533,0.421023,0,0,0.20896,0.977924,300,0,1); + +-- Spawn missing Upper Wintergarde Mine Shaft +DELETE FROM `creature` WHERE `id`=27436 AND `guid`=42576; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES +(42576,27436,571,1,1,0,0,3899.86,-883.613,119.536,0.0636665,300,0,0,42,0,0,0,0,0); + +-- Spellscriptname +DELETE FROM `spell_script_names` WHERE `spell_id`=@SPELL_EXPLOSION; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(@SPELL_EXPLOSION,'spell_q12277_wintergarde_mine_explosion'); + +-- The conditions will make it works exactly like it should. Thanks a lot Josh. +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=@SPELL_EXPLOSION; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,1,@SPELL_EXPLOSION,0,31,3,27437,0,0,'',"Wintergarde Mine Explosion - Lower Wintergarde Mine Shaft"), -- Effect 0 - SPELL_EFFECT_DUMMY +(13,1,@SPELL_EXPLOSION,1,31,3,27436,0,0,'',"Wintergarde Mine Explosion - Upper Wintergarde Mine Shaft"), -- Effect 0 - SPELL_EFFECT_DUMMY +(13,2,@SPELL_EXPLOSION,0,31,4,0,0,0,'',"Wintergarde Mine Explosion - Targets Players"), -- Effect 1 - SPELL_EFFECT_KNOCK_BACK +(13,4,@SPELL_EXPLOSION,0,31,5,188712,0,0,'',"Wintergarde Mine Explosion - Wintergarde Mine Cave In (2)"); -- Effect 2 - SPELL_EFFECT_ACTIVATE_OBJECT diff --git a/sql/old/3.3.5a/2012_05_10_02_world_creature_template.sql b/sql/old/3.3.5a/2012_05_10_02_world_creature_template.sql new file mode 100644 index 00000000000..28893f24fdf --- /dev/null +++ b/sql/old/3.3.5a/2012_05_10_02_world_creature_template.sql @@ -0,0 +1,2 @@ +-- fix creauture_template loot id for infinite corruptor. could have sworn this was already in the db. +UPDATE `creature_template` SET `lootid` = 0 WHERE `entry` IN (32313,32273); diff --git a/sql/old/3.3.5a/2012_05_10_03_world_misc.sql b/sql/old/3.3.5a/2012_05_10_03_world_misc.sql new file mode 100644 index 00000000000..339f52ac0bb --- /dev/null +++ b/sql/old/3.3.5a/2012_05_10_03_world_misc.sql @@ -0,0 +1,129 @@ + -- Remove obsolete requirement 'cooking profession' from quest 'Beer Basted Boar Ribs' (thx tifkat) closes #5198 +UPDATE `quest_template` SET `RequiredSkillId`=0, `RequiredSkillPoints`=0 WHERE `Id`=384; + +-- Fix proc for Death's Verdict/Choice (author: kandera) closes #6041 +UPDATE `spell_proc_event` SET `procFlags` = 0, `procEx` = `procEx`|262144 WHERE `entry` in (67702, 67771); + +-- Disables quest "Desperate Research" for all factions author trista closes #5285 +DELETE FROM `disables` WHERE `sourceType` = 1 AND `entry` in (12782,12783,12811,12784,12752,12775,12777,12753,12808,12772); +INSERT INTO `disables` (`sourceType`,`entry`,`flags`,`params_0`,`params_1`,`comment`) VALUES +(1,12782,0,0,0,'Disable quest from Scourge Invasion for Blood Elves'), +(1,12783,0,0,0,'Disable quest from Scourge Invasion for Orcs'), +(1,12811,0,0,0,'Disable quest from Scourge Invasion for Trolls'), +(1,12784,0,0,0,'Disable quest from Scourge Invasion for Tauren'), +(1,12752,0,0,0,'Disable quest from Scourge Invasion for undead'), +(1,12775,0,0,0,'Disable quest from Scourge Invasion for Human'), +(1,12777,0,0,0,'Disable quest from Scourge Invasion for Draenei'), +(1,12753,0,0,0,'Disable quest from Scourge Invasion for Dwarves'), +(1,12808,0,0,0,'Disable quest from Scourge Invasion for Gnomes'), +(1,12772,0,0,0,'Disable quest from Scourge Invasion for Night Elves'); +-- Disables scourge invasion connected quests listed below +DELETE FROM `disables` WHERE `sourceType` = 1 AND `entry` in (12788,12812,12785,12786,12787,12774,12776,12771,12809,12773); +INSERT INTO `disables` (`sourceType`,`entry`,`flags`,`params_0`,`params_1`,`comment`) VALUES +(1,12788,0,0,0,'Disable quest from Scourge Invasion for Blood Elves'), +(1,12812,0,0,0,'Disable quest from Scourge Invasion for Orcs'), +(1,12785,0,0,0,'Disable quest from Scourge Invasion for Trolls'), +(1,12786,0,0,0,'Disable quest from Scourge Invasion for Tauren'), +(1,12787,0,0,0,'Disable quest from Scourge Invasion for undead'), +(1,12774,0,0,0,'Disable quest from Scourge Invasion for Human'), +(1,12776,0,0,0,'Disable quest from Scourge Invasion for Draenei'), +(1,12771,0,0,0,'Disable quest from Scourge Invasion for Dwarves'), +(1,12809,0,0,0,'Disable quest from Scourge Invasion for Gnomes'), +(1,12773,0,0,0,'Disable quest from Scourge Invasion for Night Elves'); + +-- Limit Bloodgem Shard use to Netherstorm Cristal Target author: nelegalno closes #4165 +DELETE FROM `conditions` WHERE (`SourceEntry`=34367 AND `SourceTypeOrReferenceId`=17 AND `ConditionTypeOrReference`=29); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(17,0,34367,0,29,19421,15,0,64,'','Limit Bloodgem Shard use to Netherstorm Cristal Target'); + +-- Path of xx and A Change of Heart (Ashen Band rings) author: studioworks closes #2544 +UPDATE `quest_template` SET `PrevQuestId`=0 WHERE `id` IN +(24827,24834,24835,24823,24828,24829,25239,25240,25242,24826,24832,24833,24825,24830,24831,24819,24820,24821,24822,24836,24837,24838,24839,24840,24841,24842,24843,24844,24845,24846,24847,25246,25247,25248,25249); +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=19 AND `SourceEntry` IN +-- Paths +(24827,24834,24835,24823,24828,24829,25239,25240,25242,24826,24832,24833,24825,24830,24831, +-- A Change of Heart +24819,24820,24821,24822,24836,24837,24838,24839,24840,24841,24842,24843,24844,24845,24846,24847,25246,25247,25248,25249); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`Comment`) VALUES +-- Path of Courage +(19,0,24827,0,2,50375,1,0,'Path of Courage 1'), +(19,0,24834,0,2,50388,1,0,'Path of Courage 2'), +(19,0,24835,0,2,50403,1,0,'Path of Courage 3'), +-- Path of Destruction +(19,0,24823,0,2,50384,1,0,'Path of Destruction 1'), +(19,0,24828,0,2,50377,1,0,'Path of Destruction 2'), +(19,0,24829,0,2,50397,1,0,'Path of Destruction 3'), +-- Path of Might +(19,0,25239,0,2,52569,1,0,'Path of Might 1'), +(19,0,25240,0,2,52570,1,0,'Path of Might 2'), +(19,0,25242,0,2,52571,1,0,'Path of Might 3'), +-- Path of Vengeance +(19,0,24826,0,2,50376,1,0,'Path of Vengeance 1'), +(19,0,24832,0,2,50387,1,0,'Path of Vengeance 2'), +(19,0,24833,0,2,50401,1,0,'Path of Vengeance 3'), +-- Path of Wisdom +(19,0,24825,0,2,50378,1,0,'Path of Wisdom 1'), +(19,0,24830,0,2,50386,1,0,'Path of Wisdom 2'), +(19,0,24831,0,2,50399,1,0,'Path of Wisdom 3'), +-- A Change of Heart +(19,0,24819,0,2,50377,1,0,'A Change of Heart'), +(19,0,24820,0,2,50376,1,0,'A Change of Heart'), +(19,0,24821,0,2,50375,1,0,'A Change of Heart'), +(19,0,24822,0,2,50378,1,0,'A Change of Heart'), +(19,0,24836,0,2,50384,1,0,'A Change of Heart'), +(19,0,24837,0,2,50386,1,0,'A Change of Heart'), +(19,0,24838,0,2,50387,1,0,'A Change of Heart'), +(19,0,24839,0,2,50388,1,0,'A Change of Heart'), +(19,0,24840,0,2,50397,1,0,'A Change of Heart'), +(19,0,24841,0,2,50399,1,0,'A Change of Heart'), +(19,0,24842,0,2,50401,1,0,'A Change of Heart'), +(19,0,24843,0,2,50403,1,0,'A Change of Heart'), +(19,0,24844,0,2,50398,1,0,'A Change of Heart'), +(19,0,24845,0,2,50400,1,0,'A Change of Heart'), +(19,0,24846,0,2,50402,1,0,'A Change of Heart'), +(19,0,24847,0,2,50404,1,0,'A Change of Heart'), +(19,0,25246,0,2,52572,1,0,'A Change of Heart'), +(19,0,25247,0,2,52569,1,0,'A Change of Heart'), +(19,0,25248,0,2,52570,1,0,'A Change of Heart'), +(19,0,25249,0,2,52571,1,0,'A Change of Heart'); + +-- spawn farmer torp author: zxbiohazardzx closes #6256 +SET @guid := 42652; +DELETE FROM `creature` WHERE `guid`=@guid; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`) +VALUES +(@guid,25607,571,1,1,2886.325,6385.55,92.96985,1.4512,120); -- Farmer Torp + +-- Disgusting Oozeling aura author: gecko32 closes #6197 +UPDATE `creature_template_addon` SET `auras`='25163' WHERE `entry`=15429; +-- Mr. Chilly +-- Add aura chilly for Periodic slide +DELETE FROM `creature_template_addon` WHERE `entry`=29726; +INSERT INTO `creature_template_addon` (`entry`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `auras`) VALUES +(29726, 0, 0, 0, 0, 0, '61811'); + +-- Update to Change to $n in page text author: gecko32 closes #5930 +UPDATE `page_text` SET `text`='This proof of deed is to verify that $n slew Margol the Rager, scourge of the searing gorge.$B$BThe Ironforge museum recognizes this achievement and thanks the bearer for their generous contribution.$B$B-Head Curator Thorius Stonetender' WHERE `entry`=1231; + +-- Update frost shock and you to only be for shamans. author: whit33r closes #4727 +UPDATE `quest_template` SET `RequiredClasses`=64 WHERE `id` = 7505; + +-- fixes ashen band of destruction proc author: kandera +DELETE FROM `spell_proc_event` WHERE `entry` = 72417; +INSERT INTO `spell_proc_event` (`entry`,`SchoolMask`,`SpellFamilyName`,`SpellFamilyMask0`,`SpellFamilyMask1`,`SpellFamilyMask2`,`procFlags`,`procEx`,`ppmRate`,`CustomChance`,`Cooldown`) VALUES +(72417,0,0,0,0,0,327680,0,0,0,60); + +-- fixes quest credit from Fel reaver no thanks! author: tREAk & shlomi1515 closes #3715 +UPDATE `spell_dbc` SET `Effect1`=16,`EffectMiscValue1`=10855 WHERE `id`=38758; +DELETE FROM `creature_ai_scripts` WHERE creature_id=22293; + +-- fix areatrigger for wickerman camp author: boomper closes #3549 +DELETE FROM `areatrigger_involvedrelation` WHERE `id` =3991; +INSERT INTO `areatrigger_involvedrelation` (`id`, `quest`) +VALUES (3991,1658); + +-- yous have da darkrune should be daily author: kaelima closes #3457 +UPDATE `quest_template` SET `SpecialFlags` = `SpecialFlags` | 1 WHERE `id` = 11027; + +-- fix infinite corruptor loot id author: vincent-michael +UPDATE `creature_template` SET `lootid` = 32313 WHERE `entry` =32313; diff --git a/sql/old/3.3.5a/2012_05_10_04_world_ceature_sai.sql b/sql/old/3.3.5a/2012_05_10_04_world_ceature_sai.sql new file mode 100644 index 00000000000..5f01e951c4b --- /dev/null +++ b/sql/old/3.3.5a/2012_05_10_04_world_ceature_sai.sql @@ -0,0 +1,14 @@ +-- Spawn Disturbed Glacial Revenant +DELETE FROM `creature` WHERE `guid`=201998; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`, `position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES +(201998,36874,658,2,1,0,0,1053.894,-93.05556,632.8575,4.223697,86400,0,0,1,0,0,0,0,0); +DELETE FROM `creature_addon` WHERE `guid`=201998; +INSERT INTO `creature_addon` (`guid`,`bytes2`) VALUES +(201998,1); + +-- Disturbed Glacial Revenant SAI +SET @ENTRY := 36874; -- NPC entry +UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,0,0,100,4,0,0,12000,15000,11,55216,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Disturbed Glacial Revenant - Combat - Cast Avalanche'); diff --git a/sql/old/3.3.5a/2012_05_10_05_world_waypoints.sql b/sql/old/3.3.5a/2012_05_10_05_world_waypoints.sql new file mode 100644 index 00000000000..1677d74c4a7 --- /dev/null +++ b/sql/old/3.3.5a/2012_05_10_05_world_waypoints.sql @@ -0,0 +1,88 @@ +-- Deathwhisper Necrolyte pathing +SET @NPC := 202103; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,555.3976,303.5347,507.6232,0,0,0,100,0), +(@PATH,2,568.4896,297.9913,506.9572,0,0,0,100,0), +(@PATH,3,586.1476,292.5486,506.3322,0,0,0,100,0), +(@PATH,4,598.5833,292.6007,506.3322,0,0,0,100,0), +(@PATH,5,602.3438,300.2135,506.9457,0,0,0,100,0), +(@PATH,6,603.0573,307.5399,507.6957,0,0,0,100,0), +(@PATH,7,611.7239,316.1129,508.4457,0,0,0,100,0), +(@PATH,8,620.0677,312.684,508.1957,0,0,0,100,0), +(@PATH,9,622.184,305.0868,508.3207,0,0,0,100,0), +(@PATH,10,616.684,295.2083,507.8819,0,0,0,100,0), +(@PATH,11,613.9236,287.4288,507.0737,0,0,0,100,0), +(@PATH,12,618.5174,272.882,507.6097,0,0,0,100,0), +(@PATH,13,621.4445,263.4861,507.9438,0,0,0,100,0), +(@PATH,14,618.5174,272.882,507.6097,0,0,0,100,0), +(@PATH,15,613.9236,287.4288,507.0737,0,0,0,100,0), +(@PATH,16,616.684,295.2083,507.8819,0,0,0,100,0), +(@PATH,17,622.184,305.0868,508.3207,0,0,0,100,0), +(@PATH,18,620.0677,312.684,508.1,0,0,0,100,0), +(@PATH,19,611.7239,316.1129,508.4457,0,0,0,100,0), +(@PATH,20,603.0573,307.5399,507.6629,0,0,0,100,0), +(@PATH,21,602.3438,300.2135,506.8405,0,0,0,100,0), +(@PATH,22,598.5833,292.6007,506.3498,0,0,0,100,0), +(@PATH,23,586.1476,292.5486,506.3322,0,0,0,100,0), +(@PATH,24,568.4896,297.9913,506.9572,0,0,0,100,0); +DELETE FROM `creature_formations` WHERE `leaderGUID`=@NPC; +INSERT INTO `creature_formations` (`leaderGUID`,`memberGUID`,`dist`,`angle`,`groupAI`) VALUES +(@NPC,@NPC,0,0,2), +(@NPC,201819,7,270,2), +(@NPC,201934,7,306,2), +(@NPC,202121,7,342,2), +(@NPC,202196,7,18,2), +(@NPC,202098,7,54,2), +(@NPC,201954,7,90,2); + +-- Deathwhisper Necrolyte pathing +SET @NPC := 202273; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC; +UPDATE `creature` SET `position_x`=611.9375,`position_y`=117.441,`position_z`=508.0308 WHERE `guid` IN (202273,202054,201845,201914,202145,202227,201988); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,611.9375,117.441,508.0308,0,0,0,100,0), +(@PATH,2,620.9531,139.3004,506.531,0,0,0,100,0), +(@PATH,3,624.3854,153.9531,507.3376,0,0,0,100,0), +(@PATH,4,625.8316,167.6233,507.4478,0,0,0,100,0), +(@PATH,5,622.8368,183.6788,507.7706,0,0,0,100,0), +(@PATH,6,625.8316,167.6233,507.4478,0,0,0,100,0), +(@PATH,7,624.3854,153.9531,507.3376,0,0,0,100,0), +(@PATH,8,620.9531,139.3004,506.531,0,0,0,100,0), +(@PATH,9,611.9375,117.441,508.0308,0,0,0,100,0), +(@PATH,10,610.8828,99.47656,510.0737,0,0,0,100,0); +DELETE FROM `creature_formations` WHERE `leaderGUID`=@NPC; +INSERT INTO `creature_formations` (`leaderGUID`,`memberGUID`,`dist`,`angle`,`groupAI`) VALUES +(@NPC,@NPC,0,0,2), +(@NPC,202054,7,270,2), +(@NPC,201845,7,306,2), +(@NPC,201914,7,342,2), +(@NPC,202145,7,18,2), +(@NPC,202227,7,54,2), +(@NPC,201988,7,90,2); + +-- Fix previous creature removal +DELETE FROM `creature` WHERE `id`=42160; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`, `position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES +(42160,36881,658,3,1,0,0,592.975,176.104,510.1582,508.746,86400,0,0,1,0,0); +UPDATE `creature` SET `position_x`=611.9375,`position_y`=117.441,`position_z`=508.0308 WHERE `guid` IN (202273,202054,201845,201914,202145,202227,201988); +DELETE FROM `creature_formations` WHERE `leaderGUID`=202231; +INSERT INTO `creature_formations` (`leaderGUID`,`memberGUID`,`dist`,`angle`,`groupAI`) VALUES +(202231,202231,0,0,2), +(202231,202099,7,270,2), +(202231,202282,7,306,2), +(202231,202125,7,342,2), +(202231,202203,7,18,2), +(202231,201960,7,54,2), +(202231,42160,7,90,2); + +-- Update Scourgelord Tyrannus "Make him fly" +UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry`=36794; diff --git a/sql/old/3.3.5a/2012_05_10_06_world_waypoints.sql b/sql/old/3.3.5a/2012_05_10_06_world_waypoints.sql new file mode 100644 index 00000000000..6fd04d0e4da --- /dev/null +++ b/sql/old/3.3.5a/2012_05_10_06_world_waypoints.sql @@ -0,0 +1,40 @@ +-- Deathwhisper Necrolyte pathing +SET @NPC := 202063; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC; +UPDATE `creature` SET `position_x`=631.8229,`position_y`=229.7292,`position_z`=508.0604 WHERE `guid` IN (202028,202000,201957,201820,202122,202199); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,631.8229,229.7292,508.0604,0,0,0,100,0), +(@PATH,2,643.8733,215.2674,508.2268,0,0,0,100,0), +(@PATH,3,659.0139,215.9635,507.8518,0,0,0,100,0), +(@PATH,4,674.184,213.5833,508.8467,0,0,0,100,0), +(@PATH,5,678.8004,201.066,508.4717,0,0,0,100,0), +(@PATH,6,662.4636,183.0694,507.9585,0,0,0,100,0), +(@PATH,7,650.8941,171.5642,507.7085,0,0,0,100,0), +(@PATH,8,637.7292,155.2569,507.9196,0,0,0,100,0), +(@PATH,9,644.6389,130.2639,510.4212,0,0,0,100,0), +(@PATH,10,654.9896,121.3038,511.9212,0,0,0,100,0), +(@PATH,11,677.7448,136.6528,512.7715,0,0,0,100,0), +(@PATH,12,678.2847,149.1233,507.8965,0,0,0,100,0), +(@PATH,13,677.7448,136.6528,512.7715,0,0,0,100,0), +(@PATH,14,654.9896,121.3038,511.9212,0,0,0,100,0), +(@PATH,15,644.6389,130.2639,510.4212,0,0,0,100,0), +(@PATH,16,637.7292,155.2569,507.9196,0,0,0,100,0), +(@PATH,17,650.8941,171.5642,507.7085,0,0,0,100,0), +(@PATH,18,662.4636,183.0694,507.9585,0,0,0,100,0), +(@PATH,19,678.8004,201.066,508.4717,0,0,0,100,0), +(@PATH,20,674.184,213.5833,508.8467,0,0,0,100,0), +(@PATH,21,659.0139,215.9635,507.8518,0,0,0,100,0), +(@PATH,22,643.8733,215.2674,508.2268,0,0,0,100,0); +DELETE FROM `creature_formations` WHERE `leaderGUID`=@NPC; +INSERT INTO `creature_formations` (`leaderGUID`,`memberGUID`,`dist`,`angle`,`groupAI`) VALUES +(@NPC,@NPC,0,0,2), +(@NPC,202028,7,270,2), +(@NPC,202000,7,306,2), +(@NPC,201957,7,342,2), +(@NPC,201820,7,18,2), +(@NPC,202122,7,54,2), +(@NPC,202199,7,90,2); diff --git a/sql/old/3.3.5a/2012_05_11_00_world_waypoints.sql b/sql/old/3.3.5a/2012_05_11_00_world_waypoints.sql new file mode 100644 index 00000000000..fa4e18f6468 --- /dev/null +++ b/sql/old/3.3.5a/2012_05_11_00_world_waypoints.sql @@ -0,0 +1,31 @@ +-- Scourgelord Tyrannus pathing +SET @NPC := 201951; +SET @PATH := @NPC*10; +UPDATE `creature` SET `position_x`=873.783,`position_y`=136.9774,`position_z`=623.6115,`spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`,`bytes2`) VALUES (@NPC,@PATH,50331648,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUE +(@PATH,1,873.783,136.9774,623.6115,0,0,0,100,0), +(@PATH,2,872.9045,139.2743,622.4446,0,0,0,100,0), +(@PATH,3,888.7917,171.3403,591.3615,0,0,0,100,0), +(@PATH,4,861.3073,209.8455,591.3615,0,0,0,100,0), +(@PATH,5,830.4913,254.5556,591.3615,0,0,0,100,0), +(@PATH,6,780.4844,277.6406,591.3615,0,0,0,100,0), +(@PATH,7,732.6771,272.4635,591.3615,0,0,0,100,0), +(@PATH,8,683.9028,265.276,591.3615,0,0,0,100,0), +(@PATH,9,612.3368,284.7934,553.4998,0,0,0,100,0), +(@PATH,10,554.816,303.1858,553.4998,0,0,0,100,0), +(@PATH,11,498.1024,309.0625,553.4998,0,0,0,100,0), +(@PATH,12,470.4167,230.0174,553.4998,0,0,0,100,0), +(@PATH,13,454.0087,175.2135,553.4998,0,0,0,100,0), +(@PATH,14,492.4288,127.1806,583.1108,0,0,0,100,0), +(@PATH,15,551.2604,121.6354,583.1108,0,0,0,100,0), +(@PATH,16,647.5573,126.3542,583.1108,0,0,0,100,0), +(@PATH,17,766.2222,130.9254,583.1108,0,0,0,100,0), +(@PATH,18,829.408,42.33854,583.1108,0,0,0,100,0), +(@PATH,19,746.7101,-53.03299,583.1108,0,0,0,100,0), +(@PATH,20,663.2379,-77.32291,583.1108,0,0,0,100,0), +(@PATH,21,618.6389,3.369792,583.1108,0,0,0,100,0), +(@PATH,22,641.8559,89.27604,583.1108,0,0,0,100,0), +(@PATH,23,794.1667,115.6858,583.1108,0,0,0,100,0); diff --git a/sql/old/3.3.5a/2012_05_11_01_world_gameobject_template.sql b/sql/old/3.3.5a/2012_05_11_01_world_gameobject_template.sql new file mode 100644 index 00000000000..630a166276b --- /dev/null +++ b/sql/old/3.3.5a/2012_05_11_01_world_gameobject_template.sql @@ -0,0 +1,4 @@ +-- Lock Ice Wall and make untargetable +UPDATE `gameobject_template` SET `flags`=18 WHERE `entry`=201885; +-- Saronite Rock Should be untargetable +UPDATE `gameobject_template` SET `flags`=18 WHERE `entry`=196485; diff --git a/sql/old/3.3.5a/2012_05_11_02_world_conditions.sql b/sql/old/3.3.5a/2012_05_11_02_world_conditions.sql new file mode 100644 index 00000000000..a10c27a0ef5 --- /dev/null +++ b/sql/old/3.3.5a/2012_05_11_02_world_conditions.sql @@ -0,0 +1,23 @@ +-- Spell Conditions for spell Necromantic Power 69347 +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=69347; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,1,69347,0,31,3,37496,0,0,'','Spell 69347 targets entry 37496'), +(13,1,69347,1,31,3,37497,0,0,'','Spell 69347 targets entry 37497'), +(13,1,69347,2,31,3,37498,0,0,'','Spell 69347 targets entry 37498'), +(13,1,69347,3,31,3,37584,0,0,'','Spell 69347 targets entry 37584'), +(13,1,69347,4,31,3,37587,0,0,'','Spell 69347 targets entry 37587'), +(13,1,69347,5,31,3,37588,0,0,'','Spell 69347 targets entry 37588'); + +-- Spell Conditions for spell Shriek of the Highborne 70512 +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=70512; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,1,70512,3,31,3,37584,0,0,'','Spell 70512 targets entry 37584'), +(13,1,70512,4,31,3,37587,0,0,'','Spell 70512 targets entry 37587'), +(13,1,70512,5,31,3,37588,0,0,'','Spell 70512 targets entry 37588'); + +-- Spell Conditions for spell Empowered Blizzard 70130 +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=70130; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,1,70130,0,31,3,37496,0,0,'','Spell 70130 targets entry 37496'), +(13,1,70130,1,31,3,37497,0,0,'','Spell 70130 targets entry 37497'), +(13,1,70130,2,31,3,37498,0,0,'','Spell 70130 targets entry 37498'); diff --git a/sql/old/3.3.5a/2012_05_12_00_world_gameobject_template.sql b/sql/old/3.3.5a/2012_05_12_00_world_gameobject_template.sql new file mode 100644 index 00000000000..ffa932c8640 --- /dev/null +++ b/sql/old/3.3.5a/2012_05_12_00_world_gameobject_template.sql @@ -0,0 +1,2 @@ +-- Lock Halls of Reflection Portcullis +UPDATE `gameobject_template` SET `flags`=18 WHERE `entry`=201848; diff --git a/sql/old/3.3.5a/2012_05_12_01_world_item_loot_template.sql b/sql/old/3.3.5a/2012_05_12_01_world_item_loot_template.sql new file mode 100644 index 00000000000..052b749c48c --- /dev/null +++ b/sql/old/3.3.5a/2012_05_12_01_world_item_loot_template.sql @@ -0,0 +1,92 @@ +DELETE FROM `item_loot_template` WHERE `entry` BETWEEN 51999 AND 52005; +INSERT INTO `item_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- Satchel of Helpfull Goods (level 0-25) +(51999,51964,0,1,1,1,1), -- Vigorous Belt +(51999,51968,0,1,1,1,1), -- Enumerated Wrap +(51999,51978,0,1,1,1,1), -- Earthbound Girdle +(51999,51994,25,1,1,1,1), -- Tumultuous Cloak +-- Satchel of Helpfull Goods (level 26-35) +(52000,51965,0,1,1,1,1), -- Vigorous Handguards +(52000,51973,0,1,1,1,1), -- Enumerated Handwraps +(52000,51980,0,1,1,1,1), -- Earthbound Handgrips +(52000,51996,25,1,1,1,1), -- Tumultuous Necklace +-- Satchel of Helpfull Goods (level 36-45) +(52001,51966,0,1,1,1,1), -- Vigorous Spaulders +(52001,51974,0,1,1,1,1), -- Enumerated Shoulderpads +(52001,51976,0,1,1,1,1), -- Earthbound Shoulderguards +(52001,51984,0,1,1,1,1), -- Stalwart Shoulderpads +(52001,51992,25,1,1,1,1), -- Tumultuous Ring +-- Satchel of Helpfull Goods (level 46-55) +(52002,51962,0,1,1,1,1), -- Vigorous Bracers +(52002,51963,0,1,1,1,1), -- Vigorous Stompers +(52002,51967,0,1,1,1,1), -- Enumerated Sandals +(52002,51972,0,1,1,1,1), -- Enumerated Bracers +(52002,51981,0,1,1,1,1), -- Earthbound Wristguards +(52002,51982,0,1,1,1,1), -- Earthbound Boots +(52002,51989,0,1,1,1,1), -- Stalwart Bands +(52002,51990,0,1,1,1,1), -- Stalwart Treads +-- Satchel of Helpfull Goods (level 56-60) +(52003,51959,0,1,1,1,1), -- Vigorous Belt +(52003,51971,0,1,1,1,1), -- Enumerated Belt +(52003,51977,0,1,1,1,1), -- Earthbound Girdle +(52003,51985,0,1,1,1,1), -- Stalwart Belt +(52003,51993,25,1,1,1,1), -- Turbulent Cloak +-- Satchel of Helpfull Goods (level 61-64) +(52004,51960,0,1,1,1,1), -- Vigorous Gloves +(52004,51970,0,1,1,1,1), -- Enumerated Gloves +(52004,51979,0,1,1,1,1), -- Earthbound Grips +(52004,51987,0,1,1,1,1), -- Stalwart Grips +(52004,51995,25,1,1,1,1), -- Turbulent Necklace +-- Satchel of Helpfull Goods (level 65-70) +(52005,51961,0,1,1,1,1), -- Vigorous Shoulderguards +(52005,51969,0,1,1,1,1), -- Enumerated Shoulders +(52005,51975,0,1,1,1,1), -- Earthbound Shoulders +(52005,51983,0,1,1,1,1), -- Stalwart Shoulderguards +(52005,51991,25,1,0,1,1); -- Turbulent Signet +-- ------------------------------------------------------------------- +-- Set some Parameters +-- ------------------------------------------------------------------- +SET @Cloth := 400; -- Class Bitmask: 16 (Priest) +128 (Mage) +256 (Warlock) +SET @Leather1 := 1100; -- Class Bitmask: 4 (Hunter) +8 (Rogue) +64 (Shaman) +1024 (Druid) +SET @Leather2 := 1032; -- Class Bitmask: 8 (Rogue) +1024 (Druid) +SET @Mail1 := 3; -- Class Bitmask: 1 (Warrior) +2 (Paladin) +SET @Mail2 := 68; -- Class Bitmask: 4 (Hunter) +8 (Shaman) +SET @Plate := 35; -- Class Bitmask: 1 (Warrior) +2 (Paladin) +32 (DeathKnight) +-- Add conditions to make sure everyone gets beneficial loot for their class +-- ------------------------------------------------------------------- +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=5 AND `SourceGroup` BETWEEN 51999 AND 52005 ; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +-- Cloth Items +(5,51999,51968,0,0,15,0,@Cloth,0,0,0,0,'','SOHG: Enumerated Wrap only for clothusers'), +(5,52000,51973,0,0,15,0,@Cloth,0,0,0,0,'','SOHG: Enumerated Handwraps only for clothusers'), +(5,52001,51974,0,0,15,0,@Cloth,0,0,0,0,'','SOHG: Enumerated Shoulderpads only for clothusers'), +(5,52002,51967,0,0,15,0,@Cloth,0,0,0,0,'','SOHG: Enumerated Sandals only for clothusers'), +(5,52002,51972,0,0,15,0,@Cloth,0,0,0,0,'','SOHG: Enumerated Bracers only for clothusers'), +(5,52003,51971,0,0,15,0,@Cloth,0,0,0,0,'','SOHG: Enumerated Belt only for clothusers'), +(5,52004,51970,0,0,15,0,@Cloth,0,0,0,0,'','SOHG: Enumerated Gloves only for clothusers'), +(5,52005,51969,0,0,15,0,@Cloth,0,0,0,0,'','SOHG: Enumerated Shoulders only for clothusers'), +-- Leather Items +(5,51999,51964,0,0,15,0,@Leather1,0,0,0,0,'','SOHG: Vigorous Belt only for leatherusers'), +(5,52000,51965,0,0,15,0,@Leather1,0,0,0,0,'','SOHG: Vigorous Handguards only for leatherusers'), +(5,52001,51966,0,0,15,0,@Leather2,0,0,0,0,'','SOHG: Vigorous Spaulders only for leatherusers'), +(5,52002,51962,0,0,15,0,@Leather2,0,0,0,0,'','SOHG: Vigorous Bracers only for leatherusers'), +(5,52002,51963,0,0,15,0,@Leather2,0,0,0,0,'','SOHG: Vigorous Stompers only for leatherusers'), +(5,52003,51959,0,0,15,0,@Leather2,0,0,0,0,'','SOHG: Vigorous Belt only for leatherusers'), +(5,52004,51960,0,0,15,0,@Leather2,0,0,0,0,'','SOHG: Vigorous Gloves only for leatherusers'), +(5,52005,51961,0,0,15,0,@Leather2,0,0,0,0,'','SOHG: Vigorous Shoulderguards only for leatherusers'), +-- Mail Items +(5,51999,51978,0,0,15,0,@Mail1,0,0,0,0,'','SOHG: Earthbound Girdle only for mail users'), +(5,52000,51980,0,0,15,0,@Mail1,0,0,0,0,'','SOHG: Earthbound Handgrips only for mail users'), +(5,52001,51976,0,0,15,0,@Mail2,0,0,0,0,'','SOHG: Earthbound Shoulderguards only for mail users'), +(5,52002,51982,0,0,15,0,@Mail2,0,0,0,0,'','SOHG: Earthbound Boots only for mail users'), +(5,52002,51981,0,0,15,0,@Mail2,0,0,0,0,'','SOHG: Earthbound Wristguards only for mail users'), +(5,52003,51977,0,0,15,0,@Mail2,0,0,0,0,'','SOHG: Earthbound Girdle only for mail users'), +(5,52004,51979,0,0,15,0,@Mail2,0,0,0,0,'','SOHG: Earthbound Grips only for mail users'), +(5,52005,51975,0,0,15,0,@Mail2,0,0,0,0,'','SOHG: Earthbound Shoulders only for mail users'), +-- Plate Items +(5,52001,51984,0,0,15,0,@Plate,0,0,0,0,'','SOHG: Stalwart Shoulderpads only for plate users'), +(5,52002,51989,0,0,15,0,@Plate,0,0,0,0,'','SOHG: Stalwart Bands only for plate users'), +(5,52002,51990,0,0,15,0,@Plate,0,0,0,0,'','SOHG: Stalwart Treads only for plate users'), +(5,52003,51985,0,0,15,0,@Plate,0,0,0,0,'','SOHG: Stalwart Belt only for plate users'), +(5,52004,51987,0,0,15,0,@Plate,0,0,0,0,'','SOHG: Stalwart Grips only for plate users'), +(5,52005,51983,0,0,15,0,@Plate,0,0,0,0,'','SOHG: Stalwart Shoulderguards only for plate users'); diff --git a/sql/old/3.3.5a/2012_05_12_02_world_gameobject_loot_template.sql b/sql/old/3.3.5a/2012_05_12_02_world_gameobject_loot_template.sql new file mode 100644 index 00000000000..b1f445faa59 --- /dev/null +++ b/sql/old/3.3.5a/2012_05_12_02_world_gameobject_loot_template.sql @@ -0,0 +1,37 @@ +-- Add Reference Loots +SET @RefNormal := 35091; +SET @RefHeroic := 35092; +DELETE FROM `reference_loot_template` WHERE `entry` IN (@RefNormal,@RefHeroic); +INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- Normal Loot +(@RefNormal,49839,0,1,1,1,1), -- Mourning Malice +(@RefNormal,49840,0,1,1,1,1), -- Hate-Forged Cleaver +(@RefNormal,49841,0,1,1,1,1), -- Blackened Geist Ribs +(@RefNormal,49842,0,1,1,1,1), -- Tapestry of the Frozen Throne +(@RefNormal,49843,0,1,1,1,1), -- Crystalline Citadel Gauntlets +(@RefNormal,49844,0,1,1,1,1), -- Crypt Fiend Slayer +(@RefNormal,49845,0,1,1,1,1), -- Bone Golem Scapula +(@RefNormal,49846,0,1,1,1,1), -- Chilled Heart of the Glacier +(@RefNormal,49847,0,1,1,1,1), -- Legguards of Untimely Demise +(@RefNormal,49848,0,1,1,1,1), -- Grim Lasher Shoulderguards +(@RefNormal,49849,0,1,1,1,1), -- Tattered Glacial-Woven Hood +(@RefNormal,49851,0,1,1,1,1), -- Greathelm of the Silver Hand +-- Heroic Loot +(@RefHeroic,50303,0,1,1,1,1), -- Black Icicle +(@RefHeroic,50302,0,1,1,1,1), -- Liar's Tongue +(@RefHeroic,50311,0,1,1,1,1), -- Second Helm of the Executioner +(@RefHeroic,50312,0,1,1,1,1), -- Chestguard of Broken Branches +(@RefHeroic,50310,0,1,1,1,1), -- Fossilized Ammonite Choker +(@RefHeroic,50313,0,1,1,1,1), -- Oath of Empress Zoe +(@RefHeroic,50309,0,1,1,1,1), -- Shriveled Heart +(@RefHeroic,50314,0,1,1,1,1), -- Strip of Remorse +(@RefHeroic,50308,0,1,1,1,1), -- Blighted Leather Footpads +(@RefHeroic,50305,0,1,1,1,1), -- Grinning Skull Boots +(@RefHeroic,50306,0,1,1,1,1), -- The Lady's Promise +(@RefHeroic,50304,0,1,1,1,1); -- Hoarfrost Gauntlets +-- Assign to the chest +DELETE FROM `gameobject_loot_template` WHERE `entry` IN (27985,27993); +INSERT INTO `gameobject_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(27985,1,100,1,0,-@RefNormal,2), -- Two from Normal Reference Loot +(27993,1,100,1,0,-@RefHeroic,2), -- Two from Heroic Reference Loot +(27993,43102,85,1,0,1,1); -- Frozen Orb diff --git a/sql/old/3.3.5a/2012_05_13_00_world_creature_text.sql b/sql/old/3.3.5a/2012_05_13_00_world_creature_text.sql new file mode 100644 index 00000000000..8d083156fb0 --- /dev/null +++ b/sql/old/3.3.5a/2012_05_13_00_world_creature_text.sql @@ -0,0 +1,13 @@ +-- NPC talk text insert from sniff +DELETE FROM `creature_text` WHERE `entry`=36494; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(36494,0,0, 'Tiny creatures under feet, you bring Garfrost something good to eat!',14,0,100,0,0,0, 'Forgemaster Garfrost'), +(36494,1,0, 'Axe too weak. Garfrost make better and CRUSH YOU.',14,0,100,0,0,0, 'Forgemaster Garfrost'), +(36494,2,0, 'Garfrost tired of puny mortals. Now your bones will freeze!',14,0,100,0,0,0, 'Forgemaster Garfrost'), +(36494,3,0, 'Garfrost hope giant underpants clean. Save boss great shame. For later.',14,0,100,0,0,0, 'Forgemaster Garfrost'), +(36494,4,0, 'Will save for snack. For later.',12,0,100,0,0,0, 'Forgemaster Garfrost'), +(36494,4,1, 'That one maybe not so good to eat now. Stupid Garfrost! BAD! BAD!',12,0,100,0,0,0, 'Forgemaster Garfrost'), +(36494,5,0, '%s hurls a massive saronite boulder at you!',16,0,100,0,0,0, 'Forgemaster Garfrost'), +(36494,6,0, '%s casts |cFF00AACCDeep Freeze|r at $n.',41,0,100,0,0,0, 'Forgemaster Garfrost'); +-- Remove old script text +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1658006 AND -1658001; diff --git a/sql/old/3.3.5a/2012_05_13_01_world_creature_text.sql b/sql/old/3.3.5a/2012_05_13_01_world_creature_text.sql new file mode 100644 index 00000000000..8e983fd9a73 --- /dev/null +++ b/sql/old/3.3.5a/2012_05_13_01_world_creature_text.sql @@ -0,0 +1,14 @@ +-- NPC talk text insert for Sara +DELETE FROM `creature_text` WHERE `entry`=33134; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(33134,0,0, 'Help me! Please get them off me!',14,0,100,0,0,15771, 'Sara YELL_PREFIGHT'), +(33134,0,1, 'What do you want from me? Leave me alone!',14,0,100,0,0,15772, 'Sara YELL_PREFIGHT'), +(33134,1,0, 'Yes! YES! Show them no mercy! Give no pause to your attacks!',14,0,100,0,0,15773, 'Sara YELL_COMBAT_PHASE_1'), +(33134,1,1, 'Let hatred and rage guide your blows!',14,0,100,0,0,15774, 'Sara YELL_COMBAT_PHASE_1'), +(33134,1,2, 'The time to strike at the head of the beast will soon be upon us! Focus your anger and hatred on his minions!',14,0,100,457,0,15775, 'Sara YELL_COMBAT_PHASE_1'), +(33134,2,0, 'Suffocate upon your own hate!',14,0,100,0,0,15776, 'Sara YELL_COMBAT_PHASE_2'), +(33134,2,1, 'Tremble, mortals, before the coming of the end!',14,0,100,0,0,15777, 'Sara YELL_COMBAT_PHASE_2'), +(33134,3,0, 'Powerless to act...',14,0,100,0,0,15778, 'Sara YELL_SLAY'), +(33134,3,1, 'Could they have been saved?',14,0,100,0,0,15779, 'YELL SAY_SLAY'); +-- remove script text +DELETE FROM script_texts WHERE entry BETWEEN -1603319 AND -1603310; diff --git a/sql/old/3.3.5a/2012_05_16_00_world_scripts.sql b/sql/old/3.3.5a/2012_05_16_00_world_scripts.sql new file mode 100644 index 00000000000..9997c09bd8d --- /dev/null +++ b/sql/old/3.3.5a/2012_05_16_00_world_scripts.sql @@ -0,0 +1,2 @@ +-- Add script to Dragonspire Hall Runes "UBRS" +UPDATE `gameobject_template` SET `ScriptName`= 'go_dragonspire_hall_rune' WHERE `entry` BETWEEN 175194 AND 175200; diff --git a/sql/old/3.3.5a/2012_05_17_00_world_creature_text.sql b/sql/old/3.3.5a/2012_05_17_00_world_creature_text.sql new file mode 100644 index 00000000000..d7df0f94c0b --- /dev/null +++ b/sql/old/3.3.5a/2012_05_17_00_world_creature_text.sql @@ -0,0 +1,7 @@ +-- NPC talk text insert from sniff +DELETE FROM `creature_text` WHERE `entry`=9816; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(9816,0,0, '%s begins to regain its strength!',16,0,100,0,0,0, 'Pyroguard Emberseer'), +(9816,1,0, '%s is nearly at full strength!',16,0,100,0,0,0, 'Pyroguard Emberseer'), +(9816,2,0, '%s regains its power and breaks free of its bonds!',16,0,100,0,0,0, 'Pyroguard Emberseer'), +(9816,3,0, 'Ha! Ha! Ha! Thank you for freeing me, fools. Now let me repay you by charring the flesh from your bones.',14,0,100,0,0,0, 'Pyroguard Emberseer'); diff --git a/sql/old/3.3.5a/2012_05_18_00_world_conditions.sql b/sql/old/3.3.5a/2012_05_18_00_world_conditions.sql new file mode 100644 index 00000000000..ad18a6c65ef --- /dev/null +++ b/sql/old/3.3.5a/2012_05_18_00_world_conditions.sql @@ -0,0 +1,3 @@ +DELETE FROM `conditions` WHERE `SourceEntry` = 52264; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,0,52264,0,0,29,0,28653,5,0,0,97,"","Creature conditions for spell 52264 (Deliver stolen horse)"); diff --git a/sql/old/3.3.5a/2012_05_18_01_world_misc.sql b/sql/old/3.3.5a/2012_05_18_01_world_misc.sql new file mode 100644 index 00000000000..bded6fae447 --- /dev/null +++ b/sql/old/3.3.5a/2012_05_18_01_world_misc.sql @@ -0,0 +1,7 @@ +DELETE FROM `spell_proc_event` WHERE `entry` = 70656; + +UPDATE `quest_template` SET `NextQuestId` = 3761 WHERE `id` IN (936,3784,3762); + +DELETE FROM `spell_proc_event` WHERE `entry` = 63611; +INSERT INTO `spell_proc_event` (`entry`,`SchoolMask`,`SpellFamilyName`,`SpellFamilyMask0`,`SpellFamilyMask1`,`SpellFamilyMask2`,`procFlags`,`procEx`,`ppmRate`,`CustomChance`,`Cooldown`) VALUES +(63611,0,0,0,0,0,51154,0,0,0,0); diff --git a/sql/old/3.3.5a/2012_05_18_01_world_spell_target_position.sql b/sql/old/3.3.5a/2012_05_18_01_world_spell_target_position.sql new file mode 100644 index 00000000000..72ebc409d9d --- /dev/null +++ b/sql/old/3.3.5a/2012_05_18_01_world_spell_target_position.sql @@ -0,0 +1,9 @@ +DELETE FROM `spell_target_position` WHERE `id` IN (30719,53140,53141,53360,54406,68328,71512); +INSERT INTO `spell_target_position` (`id`,`target_map`,`target_position_x`,`target_position_y`,`target_position_z`,`target_orientation`) VALUES +(30719,571,5807.75,588.347,661.505,1.663), +(53140,571,5807.75,588.347,661.505,1.663), +(53141,571,5807.75,588.347,661.505,1.663), +(53360,571,5807.75,588.347,661.505,1.663), +(54406,571,5807.75,588.347,661.505,1.663), +(68328,571,5807.75,588.347,661.505,1.663), +(71512,571,5807.75,588.347,661.505,1.663); diff --git a/sql/old/3.3.5a/2012_05_19_00_world_quest_template.sql b/sql/old/3.3.5a/2012_05_19_00_world_quest_template.sql new file mode 100644 index 00000000000..f18172ed836 --- /dev/null +++ b/sql/old/3.3.5a/2012_05_19_00_world_quest_template.sql @@ -0,0 +1,2 @@ +-- Change Flags for the Body and Heart Quest +UPDATE `quest_template` SET `Flags`=`Flags`&~2, `SpecialFlags`=`SpecialFlags`|2 WHERE `id` IN (6001,6002); diff --git a/sql/old/3.3.5a/2012_05_19_01_world_smart_scripts.sql b/sql/old/3.3.5a/2012_05_19_01_world_smart_scripts.sql new file mode 100644 index 00000000000..06169d8610a --- /dev/null +++ b/sql/old/3.3.5a/2012_05_19_01_world_smart_scripts.sql @@ -0,0 +1,7 @@ +-- Fix Quest 9962,9967,9970,9972,9973 +UPDATE `smart_scripts` SET `target_type`=16 WHERE `entryorguid`=18398 AND `id`=1; -- Brokentoe +UPDATE `smart_scripts` SET `target_type`=16 WHERE `entryorguid`=18399 AND `id`=4; -- Murkblood Twin +UPDATE `smart_scripts` SET `target_type`=16 WHERE `entryorguid`=18400 AND `id`=5; -- Rokdar the Sundered Lord +UPDATE `smart_scripts` SET `target_type`=16 WHERE `entryorguid`=18401 AND `id`=3; -- Skra'gath +UPDATE `smart_scripts` SET `id`=5,`link`=6,`target_type`=16 WHERE `entryorguid`=18402 AND `action_type`=15; -- Warmaul Champion +UPDATE `smart_scripts` SET `id`=6 WHERE `entryorguid`=18402 AND `action_type`=45; -- Warmaul Champion diff --git a/sql/old/3.3.5a/2012_05_19_02_world_misc.sql b/sql/old/3.3.5a/2012_05_19_02_world_misc.sql new file mode 100644 index 00000000000..97a77ac0ab3 --- /dev/null +++ b/sql/old/3.3.5a/2012_05_19_02_world_misc.sql @@ -0,0 +1,6 @@ +-- 2012-05-19 12:48:24 SourceEntry 52264 in `condition` table, has incorrect SourceGroup 0 (spell effectMask) set , ignoring. +UPDATE `conditions` SET `SourceGroup`=1 WHERE `SourceTypeOrReferenceId`=13 AND `SourceGroup`=0 AND `SourceEntry`=52264 AND `SourceId`=0 AND `ElseGroup`=0 AND `ConditionTypeOrReference`=29 AND `ConditionTarget`=0 AND `ConditionValue1`=28653 AND `ConditionValue2`=5 AND `ConditionValue3`=0; + +-- 2012-05-19 12:48:18 Quest 384 has `ZoneOrSort` = -304 but `RequiredSkillId` does not have a corresponding value (185). +-- It is not clear if cooking was required on 3.3.5, so reverting it to its original state (however we are sure it is not required in Cata) +UPDATE `quest_template` SET `RequiredSkillId`=185, `RequiredSkillPoints`=1 WHERE `Id`=384; diff --git a/sql/updates/auth/2012_02_19_00_auth_account.sql b/sql/updates/auth/2012_02_19_00_auth_account.sql deleted file mode 100644 index a5b48ede3b4..00000000000 --- a/sql/updates/auth/2012_02_19_00_auth_account.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE `account` - ADD COLUMN `os` VARCHAR(4) DEFAULT '' NOT NULL AFTER `locale`; diff --git a/sql/updates/characters/2012_02_19_00_characters_warden_action.sql b/sql/updates/characters/2012_02_19_00_characters_warden_action.sql deleted file mode 100644 index 6e317f5100d..00000000000 --- a/sql/updates/characters/2012_02_19_00_characters_warden_action.sql +++ /dev/null @@ -1,7 +0,0 @@ -DROP TABLE IF EXISTS `warden_action`; - -CREATE TABLE `warden_action` ( - `wardenId` smallint(5) unsigned NOT NULL, - `action` tinyint(3) unsigned DEFAULT NULL, - PRIMARY KEY (`wardenId`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 diff --git a/sql/updates/world/2012_02_13_00_world_version.sql b/sql/updates/world/2012_02_13_00_world_version.sql deleted file mode 100644 index 2dd7ab92ddb..00000000000 --- a/sql/updates/world/2012_02_13_00_world_version.sql +++ /dev/null @@ -1 +0,0 @@ -UPDATE `version` SET `db_version`='TDB 335.11.46' LIMIT 1; diff --git a/sql/updates/world/2012_02_14_00_world_achievement_criteria_data.sql b/sql/updates/world/2012_02_14_00_world_achievement_criteria_data.sql deleted file mode 100644 index 4361f33cf38..00000000000 --- a/sql/updates/world/2012_02_14_00_world_achievement_criteria_data.sql +++ /dev/null @@ -1,7 +0,0 @@ --- Criteria conditions for Once Bitten, Twice Shy achievement -DELETE FROM `achievement_criteria_data` WHERE `type`=12 AND `criteria_id` IN (13013, 13012, 13011, 12780); -INSERT INTO `achievement_criteria_data` (`criteria_id`,`type`,`value1`,`value2`,`scriptname`) VALUES -(13013, 12, 1, 0, ""), -- heroic -(13012, 12, 1, 0, ""), -- heroic -(13011, 12, 0, 0, ""), -- normal -(12780, 12, 0, 0, ""); -- normal \ No newline at end of file diff --git a/sql/updates/world/2012_02_15_00_world_quest_template.sql b/sql/updates/world/2012_02_15_00_world_quest_template.sql deleted file mode 100644 index e26f52fd0fe..00000000000 --- a/sql/updates/world/2012_02_15_00_world_quest_template.sql +++ /dev/null @@ -1 +0,0 @@ -UPDATE `quest_template` SET `OfferRewardText` = 'Good, $C. You have done well in serving the Dark Lady. Your continued perseverance and ambition will be of great use to the Lady''s subjects. Return to me again in the future. Perhaps I will have other tasks for you that will aid the Dark Lady in her attempts at overtaking the Lich King and completely freeing the Scourge.', `RequestItemsText` = 'There are a hundred other tasks awaiting my attention, $C. Do you have the books?' WHERE `Id` = 14356; diff --git a/sql/updates/world/2012_02_15_01_world_areatrigger_tavern.sql b/sql/updates/world/2012_02_15_01_world_areatrigger_tavern.sql deleted file mode 100644 index 1c3d45dc490..00000000000 --- a/sql/updates/world/2012_02_15_01_world_areatrigger_tavern.sql +++ /dev/null @@ -1,13 +0,0 @@ -DELETE FROM `areatrigger_tavern` WHERE `id` IN (98, 4109, 4300, 4378, 4380, 4498, 4608, 5314, 5315, 5316, 5317); -INSERT INTO `areatrigger_tavern` (`id`, `name`) VALUES -(98, 'Nesingwary''s Expedition'), -(4109, 'Tranquillen - Upper level Inn'), -(4300, 'Cenarion Refugee - Outside Inn'), -(4378, 'Stonebreaker Hold Inn'), -(4380, 'Falcon Watch Inn'), -(4498, 'Old Hillsbrad Foothills Inn'), -(4608, 'Sanctum Of The Stars - Upper level Inn'), -(5314, 'Wyrmrest Temple'), -(5315, 'Wyrmrest Temple'), -(5316, 'Wyrmrest Temple'), -(5317, 'Wyrmrest Temple'); diff --git a/sql/updates/world/2012_02_15_02_world_item_template.sql b/sql/updates/world/2012_02_15_02_world_item_template.sql deleted file mode 100644 index 463d43368cd..00000000000 --- a/sql/updates/world/2012_02_15_02_world_item_template.sql +++ /dev/null @@ -1,3 +0,0 @@ -DELETE FROM `item_template` WHERE `entry`=49867; -INSERT INTO `item_template` (`entry`, `class`, `subclass`, `unk0`, `name`, `displayid`, `Quality`, `Flags`, `FlagsExtra`, `BuyCount`, `BuyPrice`, `SellPrice`, `InventoryType`, `AllowableClass`, `AllowableRace`, `ItemLevel`, `RequiredLevel`, `RequiredSkill`, `RequiredSkillRank`, `requiredspell`, `requiredhonorrank`, `RequiredCityRank`, `RequiredReputationFaction`, `RequiredReputationRank`, `maxcount`, `stackable`, `ContainerSlots`, `StatsCount`, `stat_type1`, `stat_value1`, `stat_type2`, `stat_value2`, `stat_type3`, `stat_value3`, `stat_type4`, `stat_value4`, `stat_type5`, `stat_value5`, `stat_type6`, `stat_value6`, `stat_type7`, `stat_value7`, `stat_type8`, `stat_value8`, `stat_type9`, `stat_value9`, `stat_type10`, `stat_value10`, `ScalingStatDistribution`, `ScalingStatValue`, `dmg_min1`, `dmg_max1`, `dmg_type1`, `dmg_min2`, `dmg_max2`, `dmg_type2`, `armor`, `holy_res`, `fire_res`, `nature_res`, `frost_res`, `shadow_res`, `arcane_res`, `delay`, `ammo_type`, `RangedModRange`, `spellid_1`, `spelltrigger_1`, `spellcharges_1`, `spellppmRate_1`, `spellcooldown_1`, `spellcategory_1`, `spellcategorycooldown_1`, `spellid_2`, `spelltrigger_2`, `spellcharges_2`, `spellppmRate_2`, `spellcooldown_2`, `spellcategory_2`, `spellcategorycooldown_2`, `spellid_3`, `spelltrigger_3`, `spellcharges_3`, `spellppmRate_3`, `spellcooldown_3`, `spellcategory_3`, `spellcategorycooldown_3`, `spellid_4`, `spelltrigger_4`, `spellcharges_4`, `spellppmRate_4`, `spellcooldown_4`, `spellcategory_4`, `spellcategorycooldown_4`, `spellid_5`, `spelltrigger_5`, `spellcharges_5`, `spellppmRate_5`, `spellcooldown_5`, `spellcategory_5`, `spellcategorycooldown_5`, `bonding`, `description`, `PageText`, `LanguageID`, `PageMaterial`, `startquest`, `lockid`, `Material`, `sheath`, `RandomProperty`, `RandomSuffix`, `block`, `itemset`, `MaxDurability`, `area`, `Map`, `BagFamily`, `TotemCategory`, `socketColor_1`, `socketContent_1`, `socketColor_2`, `socketContent_2`, `socketColor_3`, `socketContent_3`, `socketBonus`, `GemProperties`, `RequiredDisenchantSkill`, `ArmorDamageModifier`, `Duration`, `ItemLimitCategory`, `HolidayId`, `ScriptName`, `DisenchantID`, `FoodType`, `minMoneyLoot`, `maxMoneyLoot`, `WDBVerified`) VALUES -(49867, 12, 0, -1, 'Crown Chemical Co. Supplies', 11448, 1, 0, 8192, 1, 0, 0, 0, -1, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1000, 0, 0, 0, 0, NULL, 0, -1, 0, -1, 0, 0, NULL, 0, -1, 0, -1, 0, 0, NULL, 0, -1, 0, -1, 0, 0, NULL, 0, -1, 0, -1, 0, 0, NULL, 0, -1, 0, -1, 4, 'You can hear the clink of glass... dont drop it!', 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 423, 0, 0, 0, 0, 14545); diff --git a/sql/updates/world/2012_02_15_03_world_quest_template.sql b/sql/updates/world/2012_02_15_03_world_quest_template.sql deleted file mode 100644 index 833d36b246c..00000000000 --- a/sql/updates/world/2012_02_15_03_world_quest_template.sql +++ /dev/null @@ -1,18 +0,0 @@ --- Love is in the Air --- Quests Missing Text ... By Albis - -UPDATE `quest_template` SET `RequestItemsText` ='The cologne isn''t going to give itself out, you know.$B$BGet spraying!' , `OfferRewardText` ='Nice work, $N! People will be buying Crown colognes by the crate-load now that they''ve had a chance to try them.$B$BHere''s a little something for helping us out.' WHERE `Id` = 24635; -UPDATE `quest_template` SET `RequestItemsText` ='That perfume''s not going to spray itself, you know.$B$BGet going!' , `OfferRewardText` ='Great work, $N! People will come running to buy Crown perfumes now that they''ve had a chance to sample their wonders.$B$BHere''s a little something for helping us out.' WHERE `Id` = 24629; -UPDATE `quest_template` SET `RequestItemsText` ='You know, those chocolates aren''t going to fling themselves at people.$B$BYou need to get to work!' , `OfferRewardText` ='Lovely work, $N! People will be tripping over one another to get Crown chocolates now that they''ve had a chance to taste those sweet, romantic treats.$B$BHere''s a little something for helping us out.' WHERE `Id` = 24636; -UPDATE `quest_template` SET `OfferRewardText` ='Hey. You got some time on your hands? I could use someone like you.' WHERE `Id` IN (24804,24805); -UPDATE `quest_template` SET `RequestItemsText` ='You analyze that reek yet, kid?' , `OfferRewardText` ='Hey, thanks, kid. Give it over, let''s take a look.$B$B$B$BOh, that ain''t good.' WHERE `Id` IN (24655,24536); -UPDATE `quest_template` SET `RequestItemsText` ='Did they toss ya a crate to deliver?' , `OfferRewardText` ='You got it, huh? Good job, kid. Top notch. Let''s see what we what we got here.$B$B$B$BThat''s not like my Snivel, but what choice is there?' WHERE `Id` = 24848; -UPDATE `quest_template` SET `OfferRewardText` ='You''re not Snivel. He was supposed to be here an hour ago! What have you done with him?$B$B$B$BThis isn''t like my Snivel. Do you think something''s happened to him?' WHERE `Id` = 24850; -UPDATE `quest_template` SET `RequestItemsText` ='Who are you?' , `OfferRewardText` ='All he talked about was leaving town with all his money? Then he really has abandoned me, hasn''t he?$B$BOh, $N. I was such a fool to fall for him, but how could I help myself? He was so irresistible!' WHERE `Id` = 24849; -UPDATE `quest_template` SET `RequestItemsText` ='Who are you?' , `OfferRewardText` ='All he talked about was leaving town with all his money? Then he really has abandoned me, hasn''t he?$B$BI can''t believe I fell for such a horrible goblin! But he was so irresistible when we first met.' WHERE `Id` = 24851; -UPDATE `quest_template` SET `RequestItemsText` ='Did you find the guy, or did he crawl under a rock?' , `OfferRewardText` ='You got his ledger? Really? That''s great, $N. There''s probably loads of good information in here.' WHERE `Id` IN (24657,24576); -UPDATE `quest_template` SET `OfferRewardText` ='Fantastic. Help is exactly what I need.' WHERE `Id` IN (24792,24793); -UPDATE `quest_template` SET `RequestItemsText` ='I don''t remember ordering a cleaing service... why yes, I am Apothecary Hummel.$B$B...wait, what is the meaning of this? You think these meaningless papers can stop me? Hah!' , `OfferRewardText` ='What we do here is none of your business...' WHERE `Id` = 11488; -UPDATE `quest_template` SET `RequestItemsText` ='Did you take care of those no-good scheming villains?' , `OfferRewardText` ='What''ve you got there?$B$BOh hey, this is big. Real big. Most of the crazy details in one little package. Thanks - you really helped us reel this all in. Good working with ya.' WHERE `Id` IN (24745,14483); -UPDATE `quest_template` SET `RequestItemsText` ='Did you teach ''em a lesson?' , `OfferRewardText` ='Good job, kid. You deserve a little somethin''. And hey, come back tomorrow if you get the time; I might have a job for ya.' WHERE `Id` IN (24658,24665,24666,24664,24663,24659,24660,24662,24647,24638,24651,24652,24650,24649,24645,24648); diff --git a/sql/updates/world/2012_02_15_04_world_quest_template.sql b/sql/updates/world/2012_02_15_04_world_quest_template.sql deleted file mode 100644 index 8b6ad1d2cf9..00000000000 --- a/sql/updates/world/2012_02_15_04_world_quest_template.sql +++ /dev/null @@ -1,17 +0,0 @@ --- Horde -UPDATE `quest_template` SET `PrevQuestId`=24805 WHERE `Id`=24536; -- Uncommon Scents completed before starting Something Stinks -UPDATE `quest_template` SET `PrevQuestId`=24536 WHERE `Id`=24541; -- Something Stinks completed before starting Pilfering Perfume -UPDATE `quest_template` SET `PrevQuestId`=24541 WHERE `Id`=24850; -- Pilfering Perfume completed before starting Snivel's Sweetheart -UPDATE `quest_template` SET `PrevQuestId`=24850 WHERE `Id`=24851; -- Snivel's Sweetheart completed before starting Hot On The Trail -UPDATE `quest_template` SET `PrevQuestId`=24851 WHERE `Id`=24576; -- Hot On The Trail completed before starting A Friendly Chat... - -UPDATE `quest_template` SET `PrevQuestId`=24576 WHERE `Id` IN (24638,24645,24647,24648,24649,24650,24651,24652); -- A Friendly Chat... completed before starting Crushing the Crown - --- Alliance -UPDATE `quest_template` SET `PrevQuestId`=24804 WHERE `Id`=24655; -- Uncommon Scents completed before starting Something Stinks -UPDATE `quest_template` SET `PrevQuestId`=24655 WHERE `Id`=24656; -- Something Stinks completed before starting Pilfering Perfume -UPDATE `quest_template` SET `PrevQuestId`=24656 WHERE `Id`=24848; -- Pilfering Perfume completed before starting Snivel's Sweetheart -UPDATE `quest_template` SET `PrevQuestId`=24848 WHERE `Id`=24849; -- Snivel's Sweetheart completed before starting Hot On The Trail -UPDATE `quest_template` SET `PrevQuestId`=24849 WHERE `Id`=24657; -- Hot On The Trail completed before starting A Friendly Chat... - -UPDATE `quest_template` SET `PrevQuestId`=24657 WHERE `Id` IN (24658,24659,24660,24662,24663,24664,24665,24666); -- A Friendly Chat... completed before starting Crushing the Crown diff --git a/sql/updates/world/2012_02_15_06_world_creature_involvedrelation.sql b/sql/updates/world/2012_02_15_06_world_creature_involvedrelation.sql deleted file mode 100644 index 431e23b53b8..00000000000 --- a/sql/updates/world/2012_02_15_06_world_creature_involvedrelation.sql +++ /dev/null @@ -1,3 +0,0 @@ -DELETE FROM `creature_involvedrelation` WHERE `quest`=24745; -INSERT INTO `creature_involvedrelation` (`id`, `quest`) VALUES -(38066, 24745); -- A - Something is in the Air (and it Ain't Love) - Inspector Snip Snagglebolt diff --git a/sql/updates/world/2012_02_15_07_00_world_creature.sql b/sql/updates/world/2012_02_15_07_00_world_creature.sql deleted file mode 100644 index 75beec97d67..00000000000 --- a/sql/updates/world/2012_02_15_07_00_world_creature.sql +++ /dev/null @@ -1,57 +0,0 @@ -SET @GUID := 40489; -SET @NPC :=3254; - -DELETE FROM `creature` WHERE `guid` BETWEEN @GUID AND @GUID+7; -INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES -(@GUID ,@NPC,1,1,1,0,0, 10.3997021, -2316.43555, 92.1945343, 2.91896486,120,0,0,1,0,0,0,0,0), -(@GUID+1,@NPC,1,1,1,0,0,346.736572 , -2606.38916, 91.7916641, 1.58010352,120,0,0,1,0,0,0,0,0), -(@GUID+2,@NPC,1,1,1,0,0, 83.07206 , -2545.2085 , 98.107666 , 1.86412442,120,0,0,1,0,0,0,0,0), -(@GUID+3,@NPC,1,1,1,0,0,-93.53362 , -2287.0835 , 92.35358 , 0.8518014 ,120,0,0,1,0,0,0,0,0), -(@GUID+4,@NPC,1,1,1,0,0,-618.9995,-2738.234,91.91664,4.303216,120,0,0,1,0,0,0,0,0), -(@GUID+5,@NPC,1,1,1,0,0,-491.2982,-2473.443,93.66666,2.670027,120,0,0,1,0,0,0,0,0), -(@GUID+6,@NPC,1,1,1,0,0,-614.9523,-2721.66 ,93.85735,1.412064,120,0,0,1,0,0,0,0,0), -(@GUID+7,@NPC,1,1,1,0,0,-617.4864,-2710.463,96.7657 ,1.582084,120,0,0,1,0,0,0,0,0); - -SET @NPC1=@GUID*10; -SET @NPC2=(@GUID+1)*10; -SET @NPC3=(@GUID+2)*10; -SET @NPC4=(@GUID+3)*10; -SET @NPC5=(@GUID+6)*10; -SET @NPC6=(@GUID+7)*10; - -DELETE FROM `waypoint_data` WHERE `id` IN (@NPC1,@NPC2,@NPC3,@NPC4,@NPC5,@NPC6); -INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES --- 1st -(@NPC1,1,6.336712,-2322.309,92.16663,0,0,0,0,100,0), --- 2nd -(@NPC2,1,346.4289,-2573.332,91.79166,0,0,0,0,100,0), --- 3rd -(@NPC3,1,81.53384,-2540.826,97.38716,0,0,0,0,100,0), -(@NPC3,2,80.28384,-2537.076,96.63716,0,0,0,0,100,0), -(@NPC3,3,79.03384,-2533.326,95.38716,0,0,0,0,100,0), -(@NPC3,4,78.28384,-2530.326,94.63716,0,0,0,0,100,0), -(@NPC3,5,77.03384,-2526.576,93.63716,0,0,0,0,100,0), -(@NPC3,6,76.49564,-2523.443,93.66665,0,0,0,0,100,0), --- 4th -(@NPC4,1,-88.46167,-2281.137,92.69763,0,0,0,0,100,0), -(@NPC4,2,-92.46167,-2285.637,91.94763,0,0,0,0,100,0), --- 5th -(@NPC5,1,-614.9318,-2720.435,94.01199,0,0,0,0,100,0), --- 6th -(@NPC6,1,-617.2921,-2722.99,93.41664,0,0,0,0,100,0), -(@NPC6,2,-617.3077,-2721.99,93.41664,0,0,0,0,100,0), -(@NPC6,3,-617.3398,-2719.99,94.16664,0,0,0,0,100,0), -(@NPC6,4,-617.3867,-2716.99,95.04164,0,0,0,0,100,0), -(@NPC6,5,-617.4336,-2713.99,95.91664,0,0,0,0,100,0), -(@NPC6,6,-617.4805,-2710.99,96.66664,0,0,0,0,100,0), -(@NPC6,7,-617.503,-2708.995,97.04164,0,0,0,0,100,0), -(@NPC6,8,-617.503,-2708.995,97.04164,0,0,0,0,100,0); - -DELETE FROM `creature_addon` WHERE `guid` IN (@GUID,@GUID+1,@GUID+2,@GUID+3,@GUID+6,@GUID+7); -INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES -(@GUID ,@NPC1,0,0,0,0,''), -(@GUID+1,@NPC2,0,0,0,0,''), -(@GUID+2,@NPC3,0,0,0,0,''), -(@GUID+3,@NPC4,0,0,0,0,''), -(@GUID+6,@NPC5,0,0,0,0,''), -(@GUID+7,@NPC6,0,0,0,0,''); diff --git a/sql/updates/world/2012_02_15_07_01_world_waypoint_data.sql b/sql/updates/world/2012_02_15_07_01_world_waypoint_data.sql deleted file mode 100644 index e47572b2074..00000000000 --- a/sql/updates/world/2012_02_15_07_01_world_waypoint_data.sql +++ /dev/null @@ -1,147 +0,0 @@ -SET @NPC := 26841; -SET @GUID := 40497; -- need 9 - -SET @SPAWN0 := (@GUID )*10; -SET @SPAWN1 := (@GUID+1)*10; -SET @SPAWN2 := (@GUID+2)*10; -SET @SPAWN3 := (@GUID+3)*10; -SET @SPAWN4 := (@GUID+4)*10; -SET @SPAWN5 := (@GUID+5)*10; -SET @SPAWN6 := (@GUID+6)*10; -SET @SPAWN7 := (@GUID+7)*10; -SET @SPAWN8 := (@GUID+8)*10; - -DELETE FROM `creature` WHERE `guid` BETWEEN @GUID AND @GUID+8; -INSERT INTO creature (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES -(@GUID ,@NPC,571,1,1,0,0,4690.292,859.291,154.1271,2.914072,120,0,0,1,0,0,0,0,0), -(@GUID+1,@NPC,571,1,1,0,0,4362.418,750.5102,123.7846,6.194367,120,0,0,1,0,0,0,0,0), -(@GUID+2,@NPC,571,1,1,0,0,4191.03,645.8215,109.6868,0.4027403,120,0,0,1,0,0,0,0,0), -(@GUID+3,@NPC,571,1,1,0,0,4098.345,657.0866,99.36436,5.185792,120,0,0,1,0,0,0,0,0), -(@GUID+4,@NPC,571,1,1,0,0,4065.753,709.2308,108.47,1.153499,120,0,0,1,0,0,0,0,0), -(@GUID+5,@NPC,571,1,1,0,0,4012.895,495.4877,82.1595,0.8684024,120,0,0,1,0,0,0,0,0), -(@GUID+6,@NPC,571,1,1,0,0,3941.605,552.9745,144.0994,0.06546114,120,0,0,1,0,0,0,0,0), -(@GUID+7,@NPC,571,1,1,0,0,3995.586,447.6094,88.55691,1.320955,120,0,0,1,0,0,0,0,0), -(@GUID+8,@NPC,571,1,1,0,0,3869.004,707.384,134.3378,4.695541,120,0,0,1,0,0,0,0,0); - -DELETE FROM `creature_addon` WHERE `guid` BETWEEN @GUID AND @GUID+8; -INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES -(@GUID ,@SPAWN0,0,0,0,0,''), -(@GUID+1,@SPAWN1,0,0,0,0,''), -(@GUID+2,@SPAWN2,0,0,0,0,''), -(@GUID+3,@SPAWN3,0,0,0,0,''), -(@GUID+4,@SPAWN4,0,0,0,0,''), -(@GUID+5,@SPAWN5,0,0,0,0,''), -(@GUID+6,@SPAWN6,0,0,0,0,''), -(@GUID+7,@SPAWN7,0,0,0,0,''), -(@GUID+8,@SPAWN8,0,0,0,0,''); - -DELETE FROM `waypoint_data` WHERE `id` IN (@SPAWN0,@SPAWN1,@SPAWN2,@SPAWN3,@SPAWN4,@SPAWN5,@SPAWN6,@SPAWN7,@SPAWN8); -INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES --- 1st -(@SPAWN0,0,4716.777,833.6211,169.0006,0,0,0,0,100,0), -(@SPAWN0,1,4643.756,855.9798,132.5562,0,0,0,0,100,0), -(@SPAWN0,2,4550.864,812.4362,133.6673,0,0,0,0,100,0), -(@SPAWN0,3,4532.678,762.772,130.1951,0,0,0,0,100,0), -(@SPAWN0,4,4566.182,662.6984,132.7506,0,0,0,0,100,0), -(@SPAWN0,5,4592.511,595.6938,130.1674,0,0,0,0,100,0), -(@SPAWN0,6,4732.632,631.5569,164.584,0,0,0,0,100,0), -(@SPAWN0,7,4716.777,833.6211,169.0006,0,0,0,0,100,0), -(@SPAWN0,8,4643.756,855.9798,132.5562,0,0,0,0,100,0), -(@SPAWN0,9,4550.864,812.4362,133.6673,0,0,0,0,100,0), --- 2nd -(@SPAWN1,0,4431.805,596.8371,157.1775,0,0,0,0,100,0), -(@SPAWN1,1,4128.16,507.4055,198.8118,0,0,0,0,100,0), -(@SPAWN1,2,4102.405,567.1112,198.8118,0,0,0,0,100,0), -(@SPAWN1,3,4112.486,636.6321,86.95068,0,0,0,0,100,0), -(@SPAWN1,4,4141.771,704.1605,67.97847,0,0,0,0,100,0), -(@SPAWN1,5,4191.388,726.6014,98.11736,0,0,0,0,100,0), -(@SPAWN1,6,4247.502,724.9836,182.4229,0,0,0,0,100,0), -(@SPAWN1,7,4295.807,746.8245,210.1174,0,0,0,0,100,0), -(@SPAWN1,8,4387.15,744.5955,93.08962,0,0,0,0,100,0), -(@SPAWN1,9,4428.509,680.8868,91.33962,0,0,0,0,100,0), -(@SPAWN1,10,4431.805,596.8371,157.1775,0,0,0,0,100,0), -(@SPAWN1,11,4128.16,507.4055,198.8118,0,0,0,0,100,0), -(@SPAWN1,12,4102.405,567.1112,198.8118,0,0,0,0,100,0), --- 3rd -(@SPAWN2,0,4170.111,627.0887,100.283,0,0,0,0,100,0), -(@SPAWN2,1,4265.816,644.1154,136.2274,0,0,0,0,100,0), -(@SPAWN2,2,4272.799,551.5093,50.92185,0,0,0,0,100,0), -(@SPAWN2,3,4378.531,451.3199,54.28299,0,0,0,0,100,0), -(@SPAWN2,4,4277.019,345.219,121.2274,0,0,0,0,100,0), -(@SPAWN2,5,4185.893,458.5754,118.5608,0,0,0,0,100,0), -(@SPAWN2,6,4170.111,627.0887,100.283,0,0,0,0,100,0), -(@SPAWN2,7,4265.816,644.1154,136.2274,0,0,0,0,100,0), -(@SPAWN2,8,4272.799,551.5093,50.92185,0,0,0,0,100,0), --- 4th -(@SPAWN3,0,4464.15,712.9612,99.36437,0,0,0,0,100,0), -(@SPAWN3,1,4466.412,769.1019,99.36437,0,0,0,0,100,0), -(@SPAWN3,2,4427.949,785.3342,99.36437,0,0,0,0,100,0), -(@SPAWN3,3,4382.415,794.0613,99.36437,0,0,0,0,100,0), -(@SPAWN3,4,4312.128,808.5213,99.36437,0,0,0,0,100,0), -(@SPAWN3,5,4206.404,817.2534,99.36437,0,0,0,0,100,0), -(@SPAWN3,6,4089.363,771.5425,99.36437,0,0,0,0,100,0), -(@SPAWN3,7,4114.452,637.4808,99.36437,0,0,0,0,100,0), -(@SPAWN3,8,4265.095,661.3358,99.36437,0,0,0,0,100,0), -(@SPAWN3,9,4366.876,678.4272,99.36437,0,0,0,0,100,0), -(@SPAWN3,10,4433.122,674.1555,99.36437,0,0,0,0,100,0), -(@SPAWN3,11,4464.15,712.9612,99.36437,0,0,0,0,100,0), -(@SPAWN3,12,4466.412,769.1019,99.36437,0,0,0,0,100,0), -(@SPAWN3,13,4427.949,785.3342,99.36437,0,0,0,0,100,0), --- 5th -(@SPAWN4,0,4331.604,778.9,114.7446,0,0,0,0,100,0), -(@SPAWN4,1,4270.823,698.3784,130.4668,0,0,0,0,100,0), -(@SPAWN4,2,4232.598,681.8058,126.7724,0,0,0,0,100,0), -(@SPAWN4,3,4156.661,638.471,129.439,0,0,0,0,100,0), -(@SPAWN4,4,4062.89,681.9251,102.9113,0,0,0,0,100,0), -(@SPAWN4,5,4096.761,758.9566,123.5501,0,0,0,0,100,0), -(@SPAWN4,6,4134.598,799.989,109.8835,0,0,0,0,100,0), -(@SPAWN4,7,4189.475,840.5444,114.6335,0,0,0,0,100,0), -(@SPAWN4,8,4274.875,812.3191,101.3001,0,0,0,0,100,0), -(@SPAWN4,9,4331.604,778.9,114.7446,0,0,0,0,100,0), -(@SPAWN4,10,4270.823,698.3784,130.4668,0,0,0,0,100,0), -(@SPAWN4,11,4232.598,681.8058,126.7724,0,0,0,0,100,0), --- 6th -(@SPAWN5,0,3769.598,454.0081,82.1595,0,0,0,0,100,0), -(@SPAWN5,1,3879.825,441.5815,82.1595,0,0,0,0,100,0), -(@SPAWN5,2,3926.388,447.295,82.1595,0,0,0,0,100,0), -(@SPAWN5,3,4017.082,501.3171,82.1595,0,0,0,0,100,0), -(@SPAWN5,4,4015.132,597.8423,82.1595,0,0,0,0,100,0), -(@SPAWN5,5,3923.788,576.8113,82.1595,0,0,0,0,100,0), -(@SPAWN5,6,3865.991,561.2335,82.1595,0,0,0,0,100,0), -(@SPAWN5,7,3795.942,538.189,82.1595,0,0,0,0,100,0), -(@SPAWN5,8,3769.598,454.0081,82.1595,0,0,0,0,100,0), -(@SPAWN5,9,3879.825,441.5815,82.1595,0,0,0,0,100,0), -(@SPAWN5,10,3926.388,447.295,82.1595,0,0,0,0,100,0), --- 7th -(@SPAWN6,0,3886.876,810.7806,134.3378,0,0,0,0,100,0), -(@SPAWN6,1,3868.72,688.4549,134.3378,0,0,0,0,100,0), -(@SPAWN6,2,3883.254,607.1956,134.3378,0,0,0,0,100,0), -(@SPAWN6,3,3904.998,559.2425,134.3378,0,0,0,0,100,0), -(@SPAWN6,4,3969.396,561.8792,148.5877,0,0,0,0,100,0), -(@SPAWN6,5,4010.678,638.0726,130.6155,0,0,0,0,100,0), -(@SPAWN6,6,3976.813,756.3585,134.3378,0,0,0,0,100,0), -(@SPAWN6,7,3886.876,810.7806,134.3378,0,0,0,0,100,0), -(@SPAWN6,8,3868.72,688.4549,134.3378,0,0,0,0,100,0), -(@SPAWN6,9,3883.254,607.1956,134.3378,0,0,0,0,100,0), --- 8th -(@SPAWN7,0,4187.318,438.9777,88.55692,0,0,0,0,100,0), -(@SPAWN7,1,4151.397,351.4095,88.55692,0,0,0,0,100,0), -(@SPAWN7,2,4106.679,347.3126,88.55692,0,0,0,0,100,0), -(@SPAWN7,3,4056.414,373.3088,88.55692,0,0,0,0,100,0), -(@SPAWN7,4,3994.193,440.1974,88.55692,0,0,0,0,100,0), -(@SPAWN7,5,4076.892,564.8895,88.55692,0,0,0,0,100,0), -(@SPAWN7,6,4178.652,558.3406,88.55692,0,0,0,0,100,0), -(@SPAWN7,7,4187.318,438.9777,88.55692,0,0,0,0,100,0), -(@SPAWN7,8,4151.397,351.4095,88.55692,0,0,0,0,100,0), -(@SPAWN7,9,4106.679,347.3126,88.55692,0,0,0,0,100,0), --- 9th -(@SPAWN8,0,3886.876,810.7806,134.3378,0,0,0,0,100,0), -(@SPAWN8,1,3868.72,688.4549,134.3378,0,0,0,0,100,0), -(@SPAWN8,2,3883.254,607.1956,134.3378,0,0,0,0,100,0), -(@SPAWN8,3,3904.998,559.2425,134.3378,0,0,0,0,100,0), -(@SPAWN8,4,3969.396,561.8792,148.5877,0,0,0,0,100,0), -(@SPAWN8,5,4010.678,638.0726,130.6155,0,0,0,0,100,0), -(@SPAWN8,6,3976.813,756.3585,134.3378,0,0,0,0,100,0), -(@SPAWN8,7,3886.876,810.7806,134.3378,0,0,0,0,100,0), -(@SPAWN8,8,3868.72,688.4549,134.3378,0,0,0,0,100,0), -(@SPAWN8,9,3883.254,607.1956,134.3378,0,0,0,0,100,0); diff --git a/sql/updates/world/2012_02_15_07_02_world_misc.sql b/sql/updates/world/2012_02_15_07_02_world_misc.sql deleted file mode 100644 index e7ffe54e922..00000000000 --- a/sql/updates/world/2012_02_15_07_02_world_misc.sql +++ /dev/null @@ -1,120 +0,0 @@ --- Love is in the Air -SET @OGUID := 24399; -SET @CGUID := 40506; -SET @OLDGUID := 40489; -- wrong guids -SET @EVENT := 8; - --- Quest chain -DELETE FROM `creature_questrelation` WHERE `quest` IN (24804,24657,24656,24848,24849); -INSERT INTO `creature_questrelation` (`id`, `quest`) VALUES -(38293, 24804), -- A - Uncommon Scents - Junior Inspector -(38325, 24657), -- A - Friendly Chat... - Marion Sutton -(38066, 24656), -- A - Pilfering Perfume - Inspector Snip Snagglebolt -(38066, 24848), -- A - Fireworks At The Gilded Rose - Inspector Snip Snagglebolt -(38325, 24849); -- A - Hot On The Trail - Marion Sutton - -DELETE FROM `creature_involvedrelation` WHERE `quest` IN (24804,24657,24656,24848,24849); -INSERT INTO `creature_involvedrelation` (`id`, `quest`) VALUES -(38066, 24804), -- A - Uncommon Scents - Inspector Snip Snagglebolt -(38066, 24657), -- A - Friendly Chat... - Inspector Snip Snagglebolt -(38066, 24656), -- A - Pilfering Perfume - Inspector Snip Snagglebolt -(38325, 24848), -- A - Fireworks At The Gilded Rose - Marion Sutton -(38325, 24849); -- A - Hot On The Trail - Marion Sutton - --- Loot: Crown Chemical Co. Supplies -DELETE FROM `gameobject_loot_template` WHERE `entry`=27766; -INSERT INTO `gameobject_loot_template` VALUES -(27766, 49867, -100, 1, 0, 1, 1); -- Crown Chemical Co. Supplies - --- GO spawns -DELETE FROM `gameobject` WHERE `id` IN (181086,201752,201778) AND `guid` BETWEEN @OGUID+0 AND @OGUID+42; -INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES --- Valentine Arch -(@OGUID+0, 181086, 1, 1, 1, 9869.12, 2493.13, 1315.88, 6.16653, 0, 0, 0.0582931, -0.9983, 300, 0, 1), -(@OGUID+1, 181086, 530, 1, 1, -4004.66, -11844.5, 0.19541, 4.93701, 0, 0, 0.623403, -0.7819, 300, 0, 1), -(@OGUID+2, 181086, 0, 1, 1, -4918.78, -983.208, 501.455, 2.30465, 0, 0, 0.913711, 0.406364, 300, 0, 1), -(@OGUID+3, 181086, 0, 1, 1, -8869.51, 636.686, 95.7873, 0.794388, 0, 0, 0.386832, 0.92215, 300, 0, 1), -(@OGUID+4, 181086, 1, 1, 1, 1653.44, -4437.37, 18.1863, 1.72627, 0, 0, 0.759883, 0.65006, 300, 0, 1), -(@OGUID+5, 181086, 1, 1, 1, -1224.34, 68.3642, 129.71, 3.17285, 0, 0, 0.999878, -0.015627, 300, 0, 1), -(@OGUID+6, 181086, 530, 1, 1, 9612.28, -7184.77, 14.285, 1.82938, 0, 0, 0.792374, 0.610036, 300, 0, 1), -(@OGUID+7, 181086, 0, 1, 1, 1629.62, 240.116, 63.8516, 0.155664, 0, 0, 0.0777534, 0.996973, 300, 0, 1), --- Large Crate -(@OGUID+8, 201752, 0, 1, 1, -9029.77, 353.325, 92.923, 0.8808, 0, 0, 0.426301, 0.904581, 300, 0, 1), -(@OGUID+9, 201752, 0, 1, 1, -9029.87, 351.542, 92.9248, 0.489671, 0, 0, 0.242397, 0.970177, 300, 0, 1), -(@OGUID+10, 201752, 0, 1, 1, -9028.41, 352.69, 92.9163, 0.721364, 0, 0, 0.352912, 0.935656, 300, 0, 1), -(@OGUID+11, 201752, 0, 1, 1, -9027.7, 351.062, 92.9193, 0.689162, 0, 0, 0.337803, 0.941217, 300, 0, 1), -(@OGUID+12, 201752, 0, 1, 1, -9029.08, 349.917, 92.932, 0.657746, 0, 0, 0.322977, 0.946407, 300, 0, 1), -(@OGUID+13, 201752, 0, 1, 1, -9028.77, 352.62, 94.1596, 6.02202, 0, 0, 0.130214, -0.991486, 300, 0, 1), -(@OGUID+14, 201752, 0, 1, 1, -9028.84, 350.443, 94.1755, 0.771628, 0, 0, 0.376314, 0.926492, 300, 0, 1), -(@OGUID+15, 201752, 0, 1, 1, -9026.5, 348.864, 93.0359, 2.17356, 0, 0, 0.885134, 0.465337, 300, 0, 1), -(@OGUID+16, 201752, 0, 1, 1, -9028.21, 348.744, 93.024, 0.889436, 0, 0, 0.430203, 0.902732, 300, 0, 1), -(@OGUID+17, 201752, 1, 1, 1, 1381.97, -4431.17, 30.6588, 5.49617, 0, 0, 0.383432, -0.923569, 300, 0, 1), -(@OGUID+18, 201752, 1, 1, 1, 1380.98, -4432.28, 30.6586, 5.55507, 0, 0, 0.356069, -0.93446, 300, 0, 1), -(@OGUID+19, 201752, 1, 1, 1, 1379.73, -4433.4, 30.6569, 5.69644, 0, 0, 0.28918, -0.957275, 300, 0, 1), -(@OGUID+20, 201752, 1, 1, 1, 1377.96, -4432.16, 30.6489, 5.58649, 0, 0, 0.341345, -0.939938, 300, 0, 1), -(@OGUID+21, 201752, 1, 1, 1, 1379.23, -4431.41, 30.6768, 5.559, 0, 0, 0.354231, -0.935158, 300, 0, 1), -(@OGUID+22, 201752, 1, 1, 1, 1379.85, -4432.91, 31.8999, 5.66896, 0, 0, 0.302309, -0.95321, 300, 0, 1), -(@OGUID+23, 201752, 1, 1, 1, 1380.81, -4431.58, 31.902, 5.64147, 0, 0, 0.315381, -0.948965, 300, 0, 1), -(@OGUID+24, 201752, 1, 1, 1, 1377.67, -4434.36, 30.6055, 5.36265, 0, 0, 0.444186, -0.895935, 300, 0, 1), --- Crown Chemical Co. Supplies -(@OGUID+25, 201778, 0, 1, 1, -9031.18, 354.399, 92.9752, 6.12019, 0, 0, 0.0814081, -0.996681, 300, 0, 1), -(@OGUID+26, 201778, 0, 1, 1, -9028.76, 352.525, 95.4034, 0.503804, 0, 0, 0.249246, 0.96844, 300, 0, 1), -(@OGUID+27, 201778, 0, 1, 1, -9030.19, 351.409, 94.1683, 0.134668, 0, 0, 0.067283, 0.997734, 300, 0, 1), -(@OGUID+28, 201778, 0, 1, 1, -9031.52, 349.739, 92.9068, 0.338872, 0, 0, 0.168626, 0.98568, 300, 0, 1), -(@OGUID+29, 201778, 0, 1, 1, -9030.55, 347.899, 92.9635, 0.751206, 0, 0, 0.366833, 0.930287, 300, 0, 1), -(@OGUID+30, 201778, 0, 1, 1, -9027.59, 348.911, 94.2683, 1.784, 0, 0, 0.77833, 0.627855, 300, 0, 1), -(@OGUID+31, 201778, 0, 1, 1, -9028.87, 349.971, 95.4191, 1.82327, 0, 0, 0.790507, 0.612452, 300, 0, 1), -(@OGUID+32, 201778, 0, 1, 1, -9031.75, 354.82, 92.9939, 6.0605, 0, 0, 0.111113, -0.993808, 300, 0, 1), -(@OGUID+33, 201778, 0, 1, 1, -9032.22, 352.779, 92.9627, 6.0605, 0, 0, 0.111113, -0.993808, 300, 0, 1), -(@OGUID+34, 201778, 1, 1, 1, 1375.84, -4432.46, 30.5735, 5.69645, 0, 0, 0.289178, -0.957275, 300, 0, 1), -(@OGUID+35, 201778, 1, 1, 1, 1377.99, -4431.81, 31.8923, 5.5001, 0, 0, 0.381614, -0.924322, 300, 0, 1), -(@OGUID+36, 201778, 1, 1, 1, 1379.21, -4430.58, 31.9198, 4.81681, 0, 0, 0.669241, -0.743045, 300, 0, 1), -(@OGUID+37, 201778, 1, 1, 1, 1379.35, -4432.78, 33.143, 5.61791, 0, 0, 0.326536, -0.945185, 300, 0, 1), -(@OGUID+38, 201778, 1, 1, 1, 1380.87, -4431.5, 33.1452, 4.66994, 0, 0, 0.721955, -0.69194, 300, 0, 1), -(@OGUID+39, 201778, 1, 1, 1, 1380.96, -4429.36, 30.6772, 4.6503, 0, 0, 0.728713, -0.68482, 300, 0, 1), -(@OGUID+40, 201778, 1, 1, 1, 1383.08, -4429.42, 30.651, 4.53642, 0, 0, 0.766505, -0.642238, 300, 0, 1), -(@OGUID+41, 201778, 1, 1, 1, 1378.64, -4428.42, 30.6846, 5.23543, 0, 0, 0.500243, -0.865885, 300, 0, 1), -(@OGUID+42, 201778, 1, 1, 1, 1377.05, -4429.39, 30.6467, 5.31397, 0, 0, 0.465863, -0.884857, 300, 0, 1); - -DELETE FROM `game_event_gameobject` WHERE `eventEntry`=@EVENT AND `guid` BETWEEN @OGUID AND @OGUID+42; -INSERT INTO `game_event_gameobject` (`guid`, `eventEntry`) VALUES -(@OGUID, @EVENT),(@OGUID+1, @EVENT),(@OGUID+2, @EVENT), -(@OGUID+3, @EVENT),(@OGUID+4, @EVENT),(@OGUID+5, @EVENT), -(@OGUID+6, @EVENT),(@OGUID+7, @EVENT),(@OGUID+8, @EVENT), -(@OGUID+9, @EVENT),(@OGUID+10, @EVENT),(@OGUID+11, @EVENT), -(@OGUID+12, @EVENT),(@OGUID+13, @EVENT),(@OGUID+14, @EVENT), -(@OGUID+15, @EVENT),(@OGUID+16, @EVENT),(@OGUID+17, @EVENT), -(@OGUID+18, @EVENT),(@OGUID+19, @EVENT),(@OGUID+20, @EVENT), -(@OGUID+21, @EVENT),(@OGUID+22, @EVENT),(@OGUID+23, @EVENT), -(@OGUID+24, @EVENT),(@OGUID+25, @EVENT),(@OGUID+26, @EVENT), -(@OGUID+27, @EVENT),(@OGUID+28, @EVENT),(@OGUID+29, @EVENT), -(@OGUID+30, @EVENT),(@OGUID+31, @EVENT),(@OGUID+32, @EVENT), -(@OGUID+33, @EVENT),(@OGUID+34, @EVENT),(@OGUID+35, @EVENT), -(@OGUID+36, @EVENT),(@OGUID+37, @EVENT),(@OGUID+38, @EVENT), -(@OGUID+39, @EVENT),(@OGUID+40, @EVENT),(@OGUID+41, @EVENT), -(@OGUID+42, @EVENT); - --- [Q]: Pilfering Perfume --- Note: this is EndText (misleading field name), NOT ObjectiveText1 -UPDATE `quest_template` SET `EndText` = 'Steal perfume package from Crown Chemical Co. outside Stormind' WHERE `Id` = 24656; -- Alliance -UPDATE `quest_template` SET `EndText` = 'Steal perfume package from Crown Chemical Co. outside Orgrimmar' WHERE `Id` = 24541; -- Horde - --- Creature templates and spawns -UPDATE `creature_template` SET `minlevel`=70, `maxlevel`=75 WHERE `entry`=37671; -- Crown Supply Guard -UPDATE `creature_template` SET `npcflag`=`npcflag`|1, `gossip_menu_id`=10991 WHERE `entry`=38293; -- Junior Inspector (gossip menu not confirmed) - -DELETE FROM `creature` WHERE `id` IN (38293,38065,37671) AND `guid` BETWEEN @CGUID+0 AND @CGUID+3; -DELETE FROM `creature` WHERE `id` IN (38293,38065,37671) AND `guid` BETWEEN @OLDGUID+0 AND @OLDGUID+3; -INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES -(@CGUID+0, 38293, 530, 1, 1, 0, 0, -4022.81, -11842.7, 0.0062171, 5.89912, 300, 0, 0, 955, 0, 0, 0, 0, 0), -- Junior Inspector -(@CGUID+1, 38065, 1, 1, 1, 0, 0, 1380.22, -4426.79, 30.6681, 2.03572, 300, 0, 0, 12600, 0, 0, 0, 0, 0), -- Crown Supply Sentry -(@CGUID+2, 37671, 0, 1, 1, 30912, 0, -9033.01, 356.408, 93.1543, 2.09345, 300, 0, 0, 42, 0, 0, 0, 0, 0), -- Crown Supply Guard -(@CGUID+3, 37671, 0, 1, 1, 30912, 0, -9028.63, 344.994, 93.2389, 3.37679, 300, 0, 0, 42, 0, 0, 0, 0, 0); -- Crown Supply Guard - -DELETE FROM `game_event_creature` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+3 AND `eventEntry`=@EVENT; -DELETE FROM `game_event_creature` WHERE `guid` BETWEEN @OLDGUID+0 AND @OLDGUID+3 AND `eventEntry`=@EVENT; -INSERT INTO `game_event_creature` (`guid`, `eventEntry`) VALUES -(@CGUID+0, @EVENT), -(@CGUID+1, @EVENT), -(@CGUID+2, @EVENT), -(@CGUID+3, @EVENT); diff --git a/sql/updates/world/2012_02_15_08_world_sai.sql b/sql/updates/world/2012_02_15_08_world_sai.sql deleted file mode 100644 index ef49ff484f3..00000000000 --- a/sql/updates/world/2012_02_15_08_world_sai.sql +++ /dev/null @@ -1,9 +0,0 @@ -SET @Pinata := 34632; - -DELETE FROM `smart_scripts` WHERE `entryorguid`=@Pinata AND `source_type`=0; -INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES -(@Pinata, 0, 0, 0, 6, 0, 100, 0, 0, 0, 0, 0, 11, 65788, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ogre Pinata - On death cast Pile of Candy'), -(@Pinata, 0, 1, 0, 25, 0, 100, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ogre Pinata - On reset set react state passive'); - --- same faction of the GO that is spawned by spell 65788 (not sniffed) -UPDATE `creature_template` SET `faction_A`=7,`faction_H`=7,`exp`=0,`AIName`='SmartAI' WHERE `entry`=@Pinata; diff --git a/sql/updates/world/2012_02_15_09_world_spell_proc_event.sql b/sql/updates/world/2012_02_15_09_world_spell_proc_event.sql deleted file mode 100644 index 4811e5d66fe..00000000000 --- a/sql/updates/world/2012_02_15_09_world_spell_proc_event.sql +++ /dev/null @@ -1,6 +0,0 @@ --- Corrected proc of Misery -DELETE FROM `spell_proc_event` WHERE `entry` IN (33191, 33192, 33193); -INSERT INTO `spell_proc_event` VALUES -(33191, 0x00, 0x06, 0x00008000, 0x00000400, 0x00000040, 0x00000000, 0x00000000, 0, 0, 0), -(33192, 0x00, 0x06, 0x00008000, 0x00000400, 0x00000040, 0x00000000, 0x00000000, 0, 0, 0), -(33193, 0x00, 0x06, 0x00008000, 0x00000400, 0x00000040, 0x00000000, 0x00000000, 0, 0, 0); diff --git a/sql/updates/world/2012_02_16_00_world_conditions.sql b/sql/updates/world/2012_02_16_00_world_conditions.sql deleted file mode 100644 index a01792ef838..00000000000 --- a/sql/updates/world/2012_02_16_00_world_conditions.sql +++ /dev/null @@ -1,12800 +0,0 @@ -CREATE TABLE `temp_convert_spells` -( - `id` INT(11), - PRIMARY KEY (`id`) -); - -# spells with EffectImplicitTarget In (6,21, 25) + spells having Targets & 1115534 -# those spells are the ones which require explicit unit target to cast -INSERT INTO `temp_convert_spells` VALUES -(5), -(11), -(12), -(14), -(15), -(17), -(25), -(49), -(50), -(53), -(56), -(58), -(59), -(60), -(61), -(67), -(68), -(72), -(75), -(78), -(89), -(91), -(96), -(100), -(101), -(113), -(116), -(118), -(131), -(132), -(133), -(134), -(139), -(142), -(143), -(145), -(172), -(184), -(205), -(228), -(246), -(260), -(271), -(284), -(285), -(339), -(348), -(355), -(370), -(403), -(408), -(421), -(453), -(457), -(467), -(475), -(512), -(514), -(526), -(527), -(528), -(529), -(530), -(546), -(548), -(550), -(552), -(585), -(589), -(591), -(592), -(594), -(596), -(598), -(600), -(603), -(605), -(606), -(633), -(635), -(639), -(647), -(676), -(686), -(689), -(692), -(694), -(695), -(699), -(700), -(701), -(702), -(703), -(705), -(707), -(709), -(710), -(720), -(731), -(744), -(745), -(746), -(770), -(772), -(774), -(782), -(785), -(812), -(835), -(837), -(845), -(851), -(853), -(879), -(915), -(921), -(930), -(932), -(943), -(970), -(974), -(976), -(980), -(984), -(988), -(992), -(996), -(1004), -(1010), -(1014), -(1026), -(1035), -(1042), -(1044), -(1058), -(1062), -(1075), -(1079), -(1082), -(1088), -(1090), -(1094), -(1098), -(1106), -(1108), -(1120), -(1121), -(1126), -(1130), -(1139), -(1152), -(1159), -(1194), -(1196), -(1210), -(1214), -(1225), -(1228), -(1234), -(1241), -(1243), -(1244), -(1245), -(1249), -(1250), -(1251), -(1266), -(1267), -(1329), -(1330), -(1350), -(1364), -(1373), -(1413), -(1430), -(1446), -(1459), -(1460), -(1461), -(1462), -(1464), -(1467), -(1472), -(1473), -(1474), -(1475), -(1481), -(1485), -(1490), -(1495), -(1513), -(1515), -(1516), -(1536), -(1579), -(1588), -(1604), -(1608), -(1609), -(1650), -(1664), -(1665), -(1666), -(1669), -(1671), -(1672), -(1714), -(1715), -(1752), -(1753), -(1754), -(1755), -(1756), -(1757), -(1758), -(1759), -(1760), -(1766), -(1767), -(1768), -(1769), -(1770), -(1776), -(1777), -(1795), -(1796), -(1797), -(1798), -(1800), -(1809), -(1810), -(1811), -(1822), -(1823), -(1824), -(1831), -(1833), -(1852), -(1906), -(1908), -(1943), -(1950), -(1966), -(1978), -(1991), -(2000), -(2020), -(2021), -(2050), -(2052), -(2053), -(2054), -(2055), -(2060), -(2061), -(2070), -(2090), -(2091), -(2094), -(2096), -(2098), -(2110), -(2118), -(2119), -(2124), -(2125), -(2136), -(2137), -(2138), -(2139), -(2141), -(2142), -(2143), -(2147), -(2148), -(2154), -(2155), -(2275), -(2280), -(2313), -(2372), -(2373), -(2400), -(2425), -(2442), -(2443), -(2444), -(2446), -(2552), -(2589), -(2590), -(2591), -(2601), -(2602), -(2606), -(2607), -(2608), -(2609), -(2610), -(2626), -(2629), -(2630), -(2633), -(2634), -(2636), -(2637), -(2643), -(2647), -(2649), -(2650), -(2653), -(2691), -(2764), -(2767), -(2782), -(2791), -(2800), -(2816), -(2817), -(2818), -(2819), -(2834), -(2850), -(2855), -(2860), -(2871), -(2880), -(2893), -(2908), -(2912), -(2941), -(2944), -(2948), -(2949), -(2969), -(2972), -(2973), -(2974), -(2995), -(3007), -(3009), -(3010), -(3011), -(3018), -(3029), -(3034), -(3043), -(3044), -(3105), -(3108), -(3110), -(3120), -(3121), -(3130), -(3131), -(3132), -(3137), -(3140), -(3145), -(3147), -(3148), -(3150), -(3205), -(3206), -(3207), -(3229), -(3233), -(3234), -(3237), -(3242), -(3243), -(3246), -(3247), -(3252), -(3261), -(3263), -(3267), -(3268), -(3279), -(3280), -(3286), -(3332), -(3355), -(3356), -(3358), -(3360), -(3387), -(3388), -(3393), -(3396), -(3405), -(3409), -(3427), -(3429), -(3436), -(3442), -(3446), -(3465), -(3466), -(3472), -(3510), -(3514), -(3539), -(3542), -(3551), -(3553), -(3571), -(3578), -(3583), -(3584), -(3586), -(3602), -(3603), -(3604), -(3606), -(3607), -(3609), -(3627), -(3635), -(3636), -(3650), -(3674), -(3715), -(3716), -(3747), -(3812), -(3911), -(3912), -(3913), -(3921), -(4011), -(4039), -(4040), -(4041), -(4058), -(4060), -(4089), -(4090), -(4091), -(4101), -(4102), -(4130), -(4131), -(4132), -(4150), -(4159), -(4164), -(4165), -(4166), -(4167), -(4168), -(4169), -(4209), -(4221), -(4240), -(4243), -(4244), -(4262), -(4280), -(4281), -(4282), -(4285), -(4286), -(4294), -(4316), -(4362), -(4423), -(4500), -(4504), -(4505), -(4506), -(4538), -(4630), -(4659), -(4805), -(4877), -(4940), -(4961), -(4962), -(4974), -(4979), -(4980), -(4984), -(4987), -(4996), -(4997), -(4998), -(4999), -(5000), -(5003), -(5019), -(5025), -(5103), -(5105), -(5116), -(5133), -(5137), -(5138), -(5143), -(5144), -(5145), -(5164), -(5165), -(5171), -(5176), -(5177), -(5178), -(5179), -(5180), -(5185), -(5186), -(5187), -(5188), -(5189), -(5195), -(5196), -(5201), -(5208), -(5211), -(5213), -(5221), -(5232), -(5234), -(5246), -(5255), -(5259), -(5260), -(5263), -(5271), -(5276), -(5306), -(5308), -(5320), -(5321), -(5322), -(5323), -(5324), -(5325), -(5337), -(5374), -(5375), -(5376), -(5401), -(5413), -(5416), -(5422), -(5424), -(5433), -(5480), -(5503), -(5507), -(5508), -(5509), -(5513), -(5514), -(5547), -(5565), -(5566), -(5567), -(5570), -(5588), -(5589), -(5595), -(5597), -(5598), -(5614), -(5615), -(5648), -(5649), -(5676), -(5679), -(5696), -(5697), -(5703), -(5726), -(5727), -(5739), -(5760), -(5781), -(5782), -(5862), -(5884), -(5917), -(5918), -(5938), -(5940), -(5951), -(5967), -(6000), -(6016), -(6027), -(6028), -(6041), -(6060), -(6061), -(6063), -(6064), -(6065), -(6066), -(6074), -(6075), -(6076), -(6077), -(6078), -(6121), -(6128), -(6130), -(6132), -(6136), -(6142), -(6144), -(6146), -(6178), -(6199), -(6203), -(6205), -(6213), -(6215), -(6217), -(6222), -(6223), -(6245), -(6252), -(6253), -(6254), -(6255), -(6257), -(6273), -(6277), -(6278), -(6304), -(6327), -(6346), -(6348), -(6349), -(6350), -(6351), -(6352), -(6353), -(6357), -(6358), -(6359), -(6360), -(6362), -(6409), -(6435), -(6460), -(6465), -(6466), -(6483), -(6484), -(6509), -(6530), -(6531), -(6533), -(6546), -(6547), -(6548), -(6552), -(6554), -(6555), -(6572), -(6574), -(6576), -(6580), -(6581), -(6595), -(6607), -(6647), -(6655), -(6660), -(6664), -(6685), -(6713), -(6716), -(6719), -(6726), -(6728), -(6730), -(6742), -(6743), -(6744), -(6745), -(6746), -(6747), -(6748), -(6751), -(6753), -(6754), -(6756), -(6760), -(6761), -(6762), -(6766), -(6767), -(6768), -(6770), -(6774), -(6778), -(6780), -(6785), -(6787), -(6788), -(6789), -(6795), -(6798), -(6800), -(6807), -(6808), -(6809), -(6814), -(6866), -(6870), -(6873), -(6894), -(6907), -(6909), -(6917), -(6922), -(6927), -(6942), -(6946), -(6949), -(6950), -(6951), -(6957), -(6958), -(6960), -(6963), -(6965), -(6979), -(6980), -(6984), -(7001), -(7033), -(7054), -(7057), -(7068), -(7079), -(7081), -(7084), -(7092), -(7093), -(7098), -(7099), -(7101), -(7102), -(7105), -(7120), -(7122), -(7124), -(7125), -(7127), -(7140), -(7145), -(7154), -(7159), -(7160), -(7162), -(7211), -(7266), -(7288), -(7289), -(7290), -(7295), -(7321), -(7322), -(7329), -(7357), -(7365), -(7367), -(7369), -(7372), -(7373), -(7379), -(7384), -(7386), -(7399), -(7400), -(7402), -(7405), -(7414), -(7415), -(7416), -(7439), -(7482), -(7485), -(7588), -(7621), -(7638), -(7641), -(7645), -(7646), -(7648), -(7651), -(7655), -(7656), -(7712), -(7714), -(7715), -(7716), -(7717), -(7718), -(7719), -(7736), -(7761), -(7763), -(7764), -(7799), -(7800), -(7801), -(7802), -(7806), -(7807), -(7808), -(7809), -(7810), -(7811), -(7813), -(7814), -(7815), -(7816), -(7821), -(7829), -(7853), -(7874), -(7875), -(7876), -(7877), -(7878), -(7879), -(7880), -(7881), -(7882), -(7883), -(7884), -(7885), -(7887), -(7891), -(7896), -(7901), -(7914), -(7922), -(7925), -(7926), -(7927), -(7932), -(7933), -(7938), -(7947), -(7951), -(7967), -(7992), -(7994), -(7997), -(8004), -(8008), -(8010), -(8012), -(8014), -(8016), -(8026), -(8028), -(8029), -(8034), -(8037), -(8040), -(8042), -(8044), -(8045), -(8046), -(8050), -(8052), -(8053), -(8056), -(8058), -(8068), -(8070), -(8091), -(8092), -(8094), -(8095), -(8096), -(8097), -(8098), -(8099), -(8100), -(8101), -(8102), -(8103), -(8104), -(8105), -(8106), -(8112), -(8113), -(8114), -(8115), -(8116), -(8117), -(8118), -(8119), -(8120), -(8121), -(8129), -(8137), -(8138), -(8139), -(8140), -(8151), -(8208), -(8211), -(8221), -(8222), -(8242), -(8246), -(8255), -(8256), -(8257), -(8272), -(8275), -(8277), -(8282), -(8288), -(8289), -(8292), -(8295), -(8312), -(8313), -(8314), -(8318), -(8319), -(8344), -(8345), -(8346), -(8347), -(8352), -(8353), -(8355), -(8362), -(8363), -(8365), -(8379), -(8380), -(8382), -(8383), -(8384), -(8385), -(8391), -(8400), -(8401), -(8402), -(8406), -(8407), -(8408), -(8412), -(8413), -(8414), -(8415), -(8416), -(8417), -(8425), -(8426), -(8428), -(8440), -(8441), -(8442), -(8444), -(8445), -(8446), -(8447), -(8448), -(8449), -(8452), -(8453), -(8456), -(8459), -(8460), -(8463), -(8464), -(8493), -(8496), -(8497), -(8552), -(8554), -(8555), -(8595), -(8598), -(8600), -(8613), -(8615), -(8616), -(8617), -(8618), -(8619), -(8620), -(8621), -(8623), -(8624), -(8627), -(8629), -(8631), -(8632), -(8633), -(8637), -(8639), -(8640), -(8643), -(8645), -(8646), -(8647), -(8649), -(8650), -(8654), -(8673), -(8676), -(8680), -(8682), -(8685), -(8689), -(8699), -(8716), -(8721), -(8724), -(8725), -(8733), -(8735), -(8788), -(8806), -(8818), -(8820), -(8903), -(8905), -(8907), -(8910), -(8914), -(8921), -(8924), -(8925), -(8926), -(8927), -(8928), -(8929), -(8936), -(8938), -(8939), -(8940), -(8941), -(8946), -(8947), -(8949), -(8950), -(8951), -(8955), -(8972), -(8983), -(8992), -(8994), -(8998), -(9000), -(9005), -(9007), -(9034), -(9053), -(9057), -(9080), -(9159), -(9176), -(9234), -(9268), -(9275), -(9347), -(9373), -(9454), -(9455), -(9456), -(9459), -(9462), -(9472), -(9473), -(9474), -(9481), -(9482), -(9483), -(9484), -(9485), -(9487), -(9488), -(9492), -(9493), -(9532), -(9552), -(9574), -(9591), -(9612), -(9613), -(9614), -(9654), -(9658), -(9672), -(9734), -(9735), -(9739), -(9745), -(9750), -(9752), -(9756), -(9758), -(9771), -(9775), -(9786), -(9789), -(9790), -(9791), -(9796), -(9806), -(9823), -(9824), -(9826), -(9827), -(9829), -(9830), -(9833), -(9834), -(9835), -(9839), -(9840), -(9841), -(9849), -(9850), -(9852), -(9853), -(9856), -(9857), -(9858), -(9866), -(9867), -(9875), -(9876), -(9880), -(9881), -(9884), -(9885), -(9888), -(9889), -(9892), -(9894), -(9896), -(9901), -(9904), -(9910), -(9912), -(9949), -(9977), -(9991), -(9999), -(10055), -(10056), -(10060), -(10073), -(10101), -(10136), -(10141), -(10142), -(10143), -(10146), -(10147), -(10148), -(10149), -(10150), -(10151), -(10156), -(10157), -(10158), -(10162), -(10163), -(10164), -(10171), -(10172), -(10175), -(10176), -(10178), -(10179), -(10180), -(10181), -(10188), -(10189), -(10190), -(10194), -(10195), -(10196), -(10197), -(10198), -(10199), -(10200), -(10203), -(10204), -(10205), -(10206), -(10207), -(10208), -(10209), -(10210), -(10211), -(10212), -(10217), -(10218), -(10221), -(10222), -(10224), -(10226), -(10227), -(10231), -(10239), -(10244), -(10245), -(10246), -(10277), -(10308), -(10310), -(10312), -(10313), -(10314), -(10321), -(10326), -(10328), -(10329), -(10346), -(10370), -(10371), -(10373), -(10391), -(10392), -(10412), -(10413), -(10414), -(10435), -(10436), -(10444), -(10445), -(10447), -(10448), -(10452), -(10458), -(10466), -(10467), -(10468), -(10472), -(10473), -(10577), -(10578), -(10605), -(10617), -(10651), -(10653), -(10657), -(10659), -(10661), -(10663), -(10689), -(10730), -(10767), -(10768), -(10769), -(10771), -(10833), -(10838), -(10839), -(10843), -(10847), -(10851), -(10855), -(10863), -(10872), -(10892), -(10893), -(10894), -(10898), -(10899), -(10900), -(10901), -(10908), -(10909), -(10915), -(10916), -(10917), -(10921), -(10927), -(10928), -(10929), -(10933), -(10934), -(10937), -(10938), -(10945), -(10946), -(10947), -(10955), -(10957), -(10958), -(10960), -(10961), -(10963), -(10964), -(10965), -(10966), -(11014), -(11016), -(11020), -(11021), -(11027), -(11084), -(11085), -(11131), -(11132), -(11196), -(11197), -(11198), -(11203), -(11204), -(11205), -(11267), -(11268), -(11269), -(11273), -(11274), -(11275), -(11279), -(11280), -(11281), -(11285), -(11286), -(11289), -(11290), -(11293), -(11294), -(11297), -(11299), -(11300), -(11303), -(11335), -(11336), -(11337), -(11353), -(11354), -(11362), -(11366), -(11374), -(11391), -(11397), -(11409), -(11428), -(11430), -(11431), -(11436), -(11442), -(11443), -(11444), -(11446), -(11469), -(11470), -(11471), -(11512), -(11519), -(11520), -(11522), -(11525), -(11528), -(11538), -(11539), -(11545), -(11564), -(11565), -(11566), -(11567), -(11572), -(11573), -(11574), -(11578), -(11584), -(11585), -(11595), -(11596), -(11597), -(11600), -(11601), -(11604), -(11605), -(11608), -(11609), -(11610), -(11612), -(11639), -(11640), -(11641), -(11642), -(11650), -(11658), -(11659), -(11660), -(11661), -(11665), -(11667), -(11668), -(11671), -(11672), -(11675), -(11699), -(11700), -(11707), -(11708), -(11711), -(11712), -(11713), -(11719), -(11721), -(11722), -(11725), -(11726), -(11762), -(11763), -(11772), -(11773), -(11774), -(11775), -(11776), -(11777), -(11778), -(11779), -(11780), -(11781), -(11782), -(11783), -(11784), -(11785), -(11786), -(11787), -(11791), -(11820), -(11821), -(11824), -(11825), -(11835), -(11836), -(11839), -(11877), -(11879), -(11885), -(11886), -(11887), -(11888), -(11889), -(11918), -(11920), -(11921), -(11922), -(11960), -(11962), -(11963), -(11971), -(11972), -(11974), -(11976), -(11977), -(11978), -(11980), -(11981), -(11985), -(11986), -(11994), -(11998), -(12021), -(12023), -(12024), -(12039), -(12054), -(12057), -(12058), -(12096), -(12097), -(12098), -(12118), -(12127), -(12128), -(12130), -(12131), -(12160), -(12161), -(12162), -(12166), -(12167), -(12170), -(12174), -(12175), -(12176), -(12177), -(12178), -(12179), -(12181), -(12242), -(12245), -(12246), -(12248), -(12251), -(12279), -(12280), -(12289), -(12294), -(12355), -(12461), -(12466), -(12471), -(12479), -(12480), -(12484), -(12485), -(12486), -(12491), -(12492), -(12493), -(12494), -(12505), -(12509), -(12510), -(12521), -(12522), -(12523), -(12524), -(12525), -(12526), -(12531), -(12538), -(12540), -(12541), -(12542), -(12545), -(12548), -(12551), -(12553), -(12555), -(12578), -(12579), -(12654), -(12657), -(12668), -(12675), -(12693), -(12699), -(12705), -(12721), -(12723), -(12738), -(12739), -(12742), -(12747), -(12798), -(12809), -(12821), -(12824), -(12825), -(12826), -(12850), -(12868), -(12885), -(12888), -(12890), -(12998), -(13003), -(13005), -(13006), -(13009), -(13013), -(13022), -(13029), -(13044), -(13099), -(13119), -(13120), -(13138), -(13140), -(13142), -(13180), -(13181), -(13218), -(13222), -(13223), -(13224), -(13278), -(13279), -(13281), -(13298), -(13318), -(13319), -(13321), -(13322), -(13323), -(13325), -(13326), -(13327), -(13338), -(13339), -(13340), -(13341), -(13342), -(13374), -(13375), -(13398), -(13424), -(13438), -(13439), -(13440), -(13441), -(13442), -(13443), -(13444), -(13445), -(13446), -(13459), -(13480), -(13482), -(13486), -(13490), -(13491), -(13496), -(13518), -(13519), -(13524), -(13526), -(13527), -(13528), -(13530), -(13534), -(13549), -(13550), -(13551), -(13552), -(13553), -(13554), -(13555), -(13566), -(13567), -(13579), -(13583), -(13584), -(13585), -(13608), -(13619), -(13692), -(13728), -(13729), -(13737), -(13738), -(13748), -(13752), -(13797), -(13860), -(13864), -(13878), -(13880), -(13884), -(13897), -(13901), -(13902), -(13907), -(13921), -(13952), -(13953), -(13977), -(14030), -(14032), -(14033), -(14034), -(14053), -(14087), -(14099), -(14102), -(14103), -(14105), -(14106), -(14109), -(14110), -(14112), -(14118), -(14119), -(14120), -(14122), -(14126), -(14129), -(14130), -(14134), -(14145), -(14156), -(14157), -(14160), -(14178), -(14180), -(14183), -(14189), -(14200), -(14247), -(14251), -(14253), -(14260), -(14261), -(14262), -(14263), -(14264), -(14265), -(14266), -(14269), -(14270), -(14271), -(14278), -(14281), -(14282), -(14283), -(14284), -(14285), -(14286), -(14287), -(14288), -(14289), -(14290), -(14298), -(14299), -(14300), -(14301), -(14308), -(14309), -(14323), -(14324), -(14325), -(14326), -(14327), -(14331), -(14443), -(14515), -(14516), -(14517), -(14518), -(14537), -(14752), -(14792), -(14795), -(14818), -(14819), -(14867), -(14868), -(14873), -(14874), -(14875), -(14890), -(14892), -(14893), -(14894), -(14895), -(14897), -(14902), -(14903), -(14914), -(14916), -(14917), -(14918), -(14919), -(14920), -(14921), -(15037), -(15039), -(15040), -(15042), -(15043), -(15057), -(15065), -(15089), -(15090), -(15095), -(15096), -(15117), -(15120), -(15122), -(15123), -(15124), -(15128), -(15187), -(15207), -(15208), -(15211), -(15228), -(15229), -(15230), -(15232), -(15234), -(15235), -(15236), -(15238), -(15241), -(15242), -(15247), -(15248), -(15249), -(15250), -(15254), -(15257), -(15261), -(15262), -(15263), -(15264), -(15265), -(15266), -(15267), -(15277), -(15279), -(15280), -(15283), -(15284), -(15288), -(15305), -(15306), -(15331), -(15332), -(15342), -(15343), -(15344), -(15346), -(15357), -(15359), -(15362), -(15363), -(15366), -(15398), -(15407), -(15451), -(15471), -(15472), -(15487), -(15493), -(15495), -(15496), -(15497), -(15498), -(15499), -(15500), -(15501), -(15505), -(15530), -(15534), -(15535), -(15536), -(15537), -(15539), -(15547), -(15549), -(15570), -(15572), -(15574), -(15575), -(15580), -(15581), -(15582), -(15583), -(15586), -(15587), -(15592), -(15598), -(15605), -(15607), -(15608), -(15610), -(15611), -(15612), -(15614), -(15615), -(15616), -(15617), -(15618), -(15619), -(15620), -(15621), -(15643), -(15651), -(15652), -(15653), -(15654), -(15655), -(15656), -(15657), -(15659), -(15661), -(15662), -(15664), -(15665), -(15667), -(15691), -(15692), -(15695), -(15698), -(15699), -(15702), -(15708), -(15712), -(15713), -(15729), -(15730), -(15732), -(15734), -(15735), -(15736), -(15749), -(15752), -(15753), -(15784), -(15785), -(15790), -(15791), -(15793), -(15795), -(15797), -(15798), -(15801), -(15802), -(15848), -(15850), -(15859), -(15860), -(15876), -(15878), -(15968), -(15969), -(15970), -(15976), -(15980), -(15981), -(15982), -(16000), -(16001), -(16006), -(16007), -(16029), -(16031), -(16033), -(16034), -(16044), -(16045), -(16050), -(16053), -(16067), -(16071), -(16075), -(16095), -(16100), -(16101), -(16128), -(16143), -(16144), -(16145), -(16168), -(16170), -(16172), -(16176), -(16177), -(16186), -(16231), -(16235), -(16236), -(16237), -(16240), -(16243), -(16247), -(16249), -(16333), -(16336), -(16343), -(16344), -(16351), -(16352), -(16353), -(16366), -(16373), -(16375), -(16391), -(16392), -(16393), -(16400), -(16401), -(16402), -(16403), -(16405), -(16406), -(16407), -(16408), -(16409), -(16410), -(16411), -(16412), -(16413), -(16414), -(16415), -(16427), -(16429), -(16430), -(16431), -(16433), -(16448), -(16449), -(16451), -(16454), -(16455), -(16456), -(16458), -(16460), -(16461), -(16472), -(16495), -(16496), -(16498), -(16508), -(16509), -(16511), -(16527), -(16528), -(16530), -(16536), -(16549), -(16552), -(16553), -(16554), -(16555), -(16561), -(16564), -(16565), -(16568), -(16569), -(16570), -(16573), -(16583), -(16587), -(16588), -(16603), -(16608), -(16610), -(16612), -(16614), -(16618), -(16627), -(16628), -(16636), -(16697), -(16707), -(16708), -(16709), -(16711), -(16712), -(16713), -(16714), -(16716), -(16722), -(16782), -(16783), -(16784), -(16788), -(16790), -(16793), -(16798), -(16799), -(16804), -(16805), -(16827), -(16828), -(16829), -(16830), -(16831), -(16832), -(16844), -(16856), -(16857), -(16868), -(16869), -(16871), -(16898), -(16908), -(16921), -(16922), -(16927), -(16928), -(16953), -(16979), -(16997), -(17008), -(17009), -(17011), -(17012), -(17013), -(17105), -(17134), -(17137), -(17138), -(17139), -(17140), -(17141), -(17142), -(17143), -(17144), -(17146), -(17147), -(17148), -(17149), -(17150), -(17151), -(17153), -(17156), -(17157), -(17158), -(17159), -(17160), -(17165), -(17168), -(17170), -(17171), -(17172), -(17173), -(17174), -(17175), -(17183), -(17194), -(17195), -(17198), -(17201), -(17213), -(17227), -(17230), -(17233), -(17234), -(17238), -(17243), -(17244), -(17246), -(17253), -(17255), -(17256), -(17257), -(17258), -(17259), -(17260), -(17261), -(17273), -(17274), -(17276), -(17281), -(17284), -(17287), -(17289), -(17290), -(17292), -(17293), -(17307), -(17308), -(17311), -(17312), -(17313), -(17314), -(17315), -(17330), -(17331), -(17333), -(17334), -(17347), -(17348), -(17353), -(17364), -(17368), -(17393), -(17405), -(17407), -(17434), -(17435), -(17439), -(17445), -(17451), -(17452), -(17470), -(17483), -(17484), -(17492), -(17494), -(17496), -(17500), -(17503), -(17504), -(17505), -(17506), -(17509), -(17510), -(17511), -(17529), -(17547), -(17607), -(17608), -(17609), -(17610), -(17611), -(17613), -(17615), -(17620), -(17630), -(17633), -(17639), -(17648), -(17649), -(17672), -(17682), -(17692), -(17734), -(17736), -(17738), -(17744), -(17745), -(17749), -(17753), -(17754), -(17755), -(17776), -(17777), -(17794), -(17797), -(17798), -(17799), -(17800), -(17843), -(17855), -(17856), -(17857), -(17859), -(17860), -(17863), -(17877), -(17883), -(17919), -(17920), -(17921), -(17922), -(17923), -(17924), -(17925), -(17926), -(17939), -(17943), -(17944), -(17946), -(17948), -(17950), -(17961), -(17962), -(17963), -(18070), -(18072), -(18075), -(18077), -(18078), -(18081), -(18082), -(18083), -(18084), -(18085), -(18086), -(18088), -(18089), -(18090), -(18091), -(18092), -(18101), -(18103), -(18104), -(18105), -(18106), -(18107), -(18108), -(18111), -(18112), -(18118), -(18138), -(18145), -(18149), -(18151), -(18152), -(18153), -(18159), -(18164), -(18165), -(18172), -(18173), -(18187), -(18197), -(18199), -(18200), -(18202), -(18203), -(18204), -(18205), -(18206), -(18208), -(18209), -(18210), -(18211), -(18214), -(18217), -(18223), -(18266), -(18267), -(18270), -(18276), -(18278), -(18289), -(18347), -(18362), -(18367), -(18368), -(18375), -(18381), -(18387), -(18389), -(18390), -(18395), -(18396), -(18398), -(18425), -(18469), -(18476), -(18498), -(18502), -(18503), -(18543), -(18545), -(18557), -(18561), -(18562), -(18608), -(18610), -(18631), -(18632), -(18633), -(18647), -(18649), -(18651), -(18652), -(18654), -(18656), -(18657), -(18658), -(18663), -(18670), -(18702), -(18761), -(18763), -(18796), -(18798), -(18802), -(18805), -(18807), -(18809), -(18812), -(18813), -(18817), -(18819), -(18833), -(18867), -(18868), -(18869), -(18870), -(18871), -(18945), -(18952), -(18958), -(18968), -(18972), -(18980), -(18988), -(18996), -(19027), -(19128), -(19130), -(19131), -(19132), -(19133), -(19134), -(19136), -(19179), -(19196), -(19213), -(19244), -(19260), -(19276), -(19277), -(19278), -(19279), -(19280), -(19306), -(19319), -(19362), -(19386), -(19391), -(19393), -(19395), -(19397), -(19411), -(19434), -(19437), -(19439), -(19444), -(19445), -(19446), -(19447), -(19448), -(19450), -(19452), -(19460), -(19463), -(19469), -(19471), -(19472), -(19476), -(19481), -(19486), -(19501), -(19503), -(19505), -(19512), -(19548), -(19595), -(19597), -(19632), -(19633), -(19637), -(19639), -(19642), -(19643), -(19644), -(19647), -(19648), -(19650), -(19652), -(19653), -(19654), -(19658), -(19661), -(19662), -(19663), -(19664), -(19674), -(19675), -(19676), -(19677), -(19678), -(19679), -(19680), -(19681), -(19682), -(19683), -(19684), -(19685), -(19686), -(19687), -(19688), -(19689), -(19692), -(19693), -(19694), -(19696), -(19697), -(19699), -(19700), -(19701), -(19725), -(19727), -(19728), -(19729), -(19730), -(19731), -(19734), -(19736), -(19737), -(19738), -(19739), -(19740), -(19742), -(19750), -(19755), -(19767), -(19770), -(19771), -(19775), -(19776), -(19777), -(19779), -(19785), -(19797), -(19801), -(19816), -(19820), -(19834), -(19835), -(19836), -(19837), -(19838), -(19850), -(19852), -(19853), -(19854), -(19869), -(19872), -(19874), -(19881), -(19901), -(19931), -(19938), -(19939), -(19940), -(19941), -(19942), -(19943), -(19970), -(19971), -(19972), -(19973), -(19974), -(19975), -(19983), -(20000), -(20004), -(20005), -(20006), -(20019), -(20066), -(20170), -(20184), -(20185), -(20186), -(20187), -(20211), -(20217), -(20220), -(20221), -(20223), -(20228), -(20233), -(20236), -(20240), -(20243), -(20252), -(20253), -(20271), -(20276), -(20279), -(20294), -(20295), -(20297), -(20298), -(20367), -(20368), -(20369), -(20370), -(20371), -(20372), -(20373), -(20374), -(20410), -(20420), -(20424), -(20425), -(20463), -(20467), -(20473), -(20474), -(20475), -(20477), -(20508), -(20511), -(20534), -(20535), -(20536), -(20537), -(20539), -(20541), -(20543), -(20547), -(20559), -(20560), -(20564), -(20565), -(20569), -(20586), -(20604), -(20605), -(20614), -(20615), -(20616), -(20617), -(20618), -(20623), -(20625), -(20627), -(20629), -(20630), -(20647), -(20655), -(20656), -(20657), -(20658), -(20660), -(20661), -(20662), -(20663), -(20664), -(20665), -(20666), -(20668), -(20677), -(20678), -(20679), -(20682), -(20684), -(20685), -(20688), -(20690), -(20691), -(20692), -(20695), -(20696), -(20698), -(20700), -(20714), -(20720), -(20726), -(20733), -(20735), -(20736), -(20740), -(20751), -(20787), -(20788), -(20790), -(20791), -(20792), -(20793), -(20795), -(20797), -(20800), -(20801), -(20802), -(20804), -(20805), -(20806), -(20807), -(20808), -(20811), -(20812), -(20815), -(20816), -(20819), -(20820), -(20821), -(20822), -(20823), -(20824), -(20825), -(20826), -(20829), -(20830), -(20831), -(20832), -(20869), -(20882), -(20883), -(20893), -(20900), -(20901), -(20902), -(20903), -(20904), -(20909), -(20910), -(20911), -(20929), -(20930), -(20989), -(21008), -(21027), -(21030), -(21047), -(21049), -(21050), -(21055), -(21056), -(21059), -(21060), -(21062), -(21063), -(21064), -(21066), -(21067), -(21068), -(21072), -(21074), -(21077), -(21081), -(21100), -(21128), -(21140), -(21141), -(21150), -(21151), -(21159), -(21162), -(21163), -(21164), -(21170), -(21179), -(21183), -(21187), -(21330), -(21332), -(21335), -(21337), -(21343), -(21356), -(21357), -(21368), -(21369), -(21372), -(21388), -(21390), -(21398), -(21401), -(21402), -(21463), -(21464), -(21465), -(21541), -(21542), -(21543), -(21546), -(21549), -(21551), -(21552), -(21553), -(21647), -(21654), -(21667), -(21668), -(21669), -(21670), -(21731), -(21732), -(21734), -(21735), -(21737), -(21745), -(21787), -(21794), -(21807), -(21829), -(21832), -(21834), -(21835), -(21840), -(21847), -(21866), -(21889), -(21892), -(21898), -(21912), -(21939), -(21949), -(21952), -(21953), -(21960), -(21961), -(21971), -(21979), -(21987), -(21990), -(21992), -(22009), -(22012), -(22048), -(22068), -(22088), -(22108), -(22109), -(22110), -(22111), -(22112), -(22113), -(22114), -(22115), -(22116), -(22117), -(22118), -(22119), -(22120), -(22121), -(22127), -(22128), -(22167), -(22168), -(22187), -(22189), -(22207), -(22227), -(22272), -(22273), -(22274), -(22284), -(22289), -(22290), -(22291), -(22312), -(22335), -(22336), -(22355), -(22357), -(22371), -(22373), -(22411), -(22412), -(22414), -(22415), -(22416), -(22418), -(22423), -(22426), -(22427), -(22428), -(22429), -(22433), -(22438), -(22482), -(22565), -(22568), -(22570), -(22572), -(22574), -(22575), -(22582), -(22591), -(22592), -(22639), -(22641), -(22646), -(22651), -(22661), -(22662), -(22666), -(22667), -(22677), -(22678), -(22682), -(22687), -(22689), -(22690), -(22691), -(22692), -(22695), -(22709), -(22713), -(22715), -(22742), -(22744), -(22745), -(22751), -(22752), -(22784), -(22785), -(22799), -(22800), -(22814), -(22816), -(22817), -(22818), -(22820), -(22822), -(22823), -(22827), -(22828), -(22829), -(22856), -(22858), -(22859), -(22864), -(22883), -(22885), -(22886), -(22887), -(22893), -(22901), -(22907), -(22909), -(22911), -(22916), -(22919), -(22920), -(22935), -(22947), -(22950), -(22951), -(22959), -(22968), -(22993), -(22994), -(22995), -(22997), -(23015), -(23038), -(23059), -(23064), -(23065), -(23073), -(23102), -(23104), -(23106), -(23114), -(23115), -(23122), -(23123), -(23124), -(23125), -(23135), -(23139), -(23153), -(23154), -(23155), -(23169), -(23170), -(23174), -(23205), -(23206), -(23224), -(23256), -(23262), -(23267), -(23268), -(23275), -(23278), -(23298), -(23301), -(23304), -(23333), -(23335), -(23337), -(23340), -(23359), -(23379), -(23380), -(23381), -(23391), -(23392), -(23402), -(23416), -(23417), -(23451), -(23452), -(23454), -(23460), -(23490), -(23491), -(23493), -(23504), -(23505), -(23546), -(23552), -(23567), -(23568), -(23569), -(23577), -(23580), -(23590), -(23592), -(23601), -(23604), -(23605), -(23620), -(23621), -(23622), -(23623), -(23625), -(23626), -(23627), -(23658), -(23661), -(23675), -(23687), -(23693), -(23694), -(23695), -(23696), -(23699), -(23702), -(23735), -(23736), -(23737), -(23738), -(23765), -(23766), -(23767), -(23768), -(23769), -(23774), -(23775), -(23786), -(23848), -(23850), -(23853), -(23859), -(23860), -(23862), -(23865), -(23881), -(23892), -(23893), -(23894), -(23895), -(23921), -(23922), -(23923), -(23924), -(23925), -(23947), -(23948), -(23952), -(23953), -(23958), -(23959), -(23960), -(23961), -(23962), -(23963), -(23964), -(23967), -(23970), -(23978), -(23979), -(24002), -(24003), -(24016), -(24017), -(24020), -(24023), -(24042), -(24049), -(24053), -(24061), -(24064), -(24097), -(24109), -(24111), -(24131), -(24132), -(24133), -(24134), -(24135), -(24178), -(24179), -(24185), -(24187), -(24193), -(24199), -(24201), -(24208), -(24210), -(24212), -(24213), -(24238), -(24239), -(24241), -(24248), -(24251), -(24253), -(24254), -(24257), -(24259), -(24261), -(24267), -(24274), -(24275), -(24300), -(24306), -(24314), -(24315), -(24316), -(24317), -(24327), -(24331), -(24332), -(24333), -(24335), -(24336), -(24337), -(24339), -(24341), -(24374), -(24378), -(24379), -(24388), -(24393), -(24394), -(24407), -(24408), -(24412), -(24413), -(24414), -(24423), -(24435), -(24458), -(24466), -(24530), -(24573), -(24577), -(24578), -(24579), -(24583), -(24585), -(24586), -(24587), -(24596), -(24600), -(24601), -(24611), -(24617), -(24618), -(24619), -(24637), -(24640), -(24648), -(24649), -(24668), -(24671), -(24672), -(24674), -(24680), -(24684), -(24685), -(24686), -(24690), -(24705), -(24708), -(24709), -(24710), -(24711), -(24712), -(24713), -(24714), -(24715), -(24723), -(24725), -(24726), -(24727), -(24730), -(24732), -(24735), -(24736), -(24740), -(24742), -(24745), -(24747), -(24750), -(24751), -(24752), -(24753), -(24755), -(24757), -(24759), -(24761), -(24762), -(24766), -(24767), -(24769), -(24771), -(24773), -(24776), -(24785), -(24787), -(24791), -(24792), -(24793), -(24802), -(24803), -(24816), -(24817), -(24819), -(24824), -(24825), -(24826), -(24829), -(24831), -(24832), -(24844), -(24857), -(24872), -(24873), -(24875), -(24923), -(24928), -(24935), -(24937), -(24942), -(24950), -(24951), -(24952), -(24953), -(24954), -(24955), -(24957), -(24960), -(24961), -(24962), -(24963), -(24964), -(24965), -(24966), -(24974), -(24975), -(24976), -(24977), -(24982), -(24993), -(25006), -(25008), -(25009), -(25010), -(25011), -(25012), -(25021), -(25022), -(25025), -(25028), -(25050), -(25051), -(25052), -(25054), -(25055), -(25058), -(25104), -(25139), -(25140), -(25143), -(25165), -(25174), -(25185), -(25187), -(25189), -(25190), -(25191), -(25208), -(25210), -(25212), -(25213), -(25217), -(25218), -(25221), -(25222), -(25225), -(25231), -(25233), -(25234), -(25235), -(25236), -(25241), -(25242), -(25245), -(25246), -(25248), -(25251), -(25258), -(25262), -(25263), -(25266), -(25269), -(25272), -(25273), -(25274), -(25275), -(25281), -(25282), -(25286), -(25288), -(25290), -(25291), -(25292), -(25294), -(25295), -(25297), -(25298), -(25299), -(25300), -(25302), -(25304), -(25306), -(25307), -(25308), -(25309), -(25311), -(25312), -(25314), -(25315), -(25316), -(25345), -(25349), -(25363), -(25364), -(25367), -(25368), -(25371), -(25372), -(25373), -(25375), -(25383), -(25384), -(25387), -(25389), -(25391), -(25396), -(25420), -(25424), -(25433), -(25439), -(25442), -(25448), -(25449), -(25454), -(25457), -(25462), -(25464), -(25465), -(25467), -(25471), -(25488), -(25497), -(25501), -(25504), -(25514), -(25515), -(25530), -(25531), -(25595), -(25602), -(25603), -(25605), -(25645), -(25646), -(25650), -(25651), -(25652), -(25668), -(25671), -(25673), -(25677), -(25678), -(25686), -(25710), -(25712), -(25721), -(25725), -(25742), -(25748), -(25755), -(25760), -(25761), -(25762), -(25771), -(25772), -(25777), -(25778), -(25779), -(25781), -(25788), -(25800), -(25802), -(25803), -(25806), -(25807), -(25808), -(25809), -(25810), -(25811), -(25816), -(25821), -(25838), -(25840), -(25843), -(25845), -(25847), -(25848), -(25852), -(25854), -(25856), -(25861), -(25902), -(25903), -(25911), -(25912), -(25913), -(25914), -(25947), -(25992), -(25995), -(25997), -(25999), -(26001), -(26004), -(26005), -(26006), -(26007), -(26008), -(26012), -(26013), -(26017), -(26035), -(26044), -(26050), -(26077), -(26078), -(26079), -(26081), -(26082), -(26090), -(26095), -(26097), -(26098), -(26100), -(26108), -(26125), -(26126), -(26134), -(26141), -(26143), -(26170), -(26181), -(26194), -(26195), -(26196), -(26197), -(26198), -(26206), -(26207), -(26211), -(26218), -(26226), -(26233), -(26258), -(26259), -(26275), -(26281), -(26282), -(26339), -(26350), -(26363), -(26364), -(26365), -(26366), -(26367), -(26368), -(26369), -(26370), -(26371), -(26372), -(26374), -(26375), -(26377), -(26406), -(26408), -(26409), -(26410), -(26412), -(26414), -(26415), -(26419), -(26446), -(26448), -(26470), -(26476), -(26548), -(26556), -(26561), -(26565), -(26572), -(26584), -(26601), -(26610), -(26613), -(26616), -(26622), -(26623), -(26624), -(26625), -(26636), -(26639), -(26641), -(26649), -(26654), -(26663), -(26679), -(26688), -(26693), -(26740), -(26742), -(26748), -(26791), -(26796), -(26799), -(26800), -(26839), -(26861), -(26862), -(26863), -(26864), -(26865), -(26866), -(26867), -(26884), -(26890), -(26899), -(26923), -(26924), -(26968), -(26978), -(26979), -(26980), -(26981), -(26982), -(26984), -(26985), -(26986), -(26987), -(26988), -(26989), -(26990), -(26992), -(26995), -(26996), -(27000), -(27001), -(27002), -(27003), -(27004), -(27005), -(27006), -(27007), -(27008), -(27010), -(27013), -(27014), -(27016), -(27019), -(27021), -(27024), -(27030), -(27031), -(27047), -(27048), -(27049), -(27050), -(27051), -(27060), -(27065), -(27067), -(27068), -(27069), -(27070), -(27071), -(27072), -(27073), -(27074), -(27075), -(27078), -(27079), -(27126), -(27132), -(27135), -(27136), -(27137), -(27138), -(27140), -(27142), -(27154), -(27174), -(27175), -(27176), -(27177), -(27180), -(27187), -(27189), -(27209), -(27210), -(27211), -(27215), -(27216), -(27217), -(27218), -(27219), -(27220), -(27223), -(27224), -(27228), -(27243), -(27254), -(27255), -(27258), -(27261), -(27263), -(27267), -(27270), -(27274), -(27275), -(27276), -(27277), -(27281), -(27286), -(27288), -(27290), -(27360), -(27375), -(27376), -(27378), -(27379), -(27380), -(27381), -(27384), -(27385), -(27386), -(27387), -(27389), -(27390), -(27391), -(27392), -(27393), -(27395), -(27396), -(27397), -(27398), -(27441), -(27448), -(27486), -(27526), -(27527), -(27532), -(27541), -(27547), -(27548), -(27549), -(27550), -(27552), -(27553), -(27554), -(27555), -(27556), -(27557), -(27559), -(27565), -(27567), -(27571), -(27572), -(27573), -(27576), -(27577), -(27580), -(27581), -(27582), -(27584), -(27605), -(27606), -(27608), -(27609), -(27611), -(27613), -(27615), -(27620), -(27624), -(27626), -(27632), -(27633), -(27634), -(27635), -(27636), -(27637), -(27638), -(27640), -(27648), -(27655), -(27662), -(27673), -(27677), -(27686), -(27752), -(27754), -(27755), -(27756), -(27760), -(27765), -(27794), -(27806), -(27814), -(27819), -(27841), -(27849), -(27852), -(27860), -(27861), -(27863), -(27864), -(27865), -(27868), -(27873), -(27874), -(27891), -(27907), -(27909), -(27910), -(27915), -(27919), -(27931), -(27937), -(27983), -(27991), -(27992), -(27994), -(27995), -(28030), -(28099), -(28133), -(28147), -(28149), -(28167), -(28169), -(28239), -(28251), -(28252), -(28253), -(28254), -(28255), -(28256), -(28257), -(28258), -(28259), -(28260), -(28261), -(28262), -(28263), -(28265), -(28271), -(28272), -(28276), -(28287), -(28293), -(28299), -(28301), -(28303), -(28306), -(28308), -(28310), -(28314), -(28318), -(28319), -(28320), -(28321), -(28329), -(28336), -(28337), -(28342), -(28350), -(28351), -(28375), -(28393), -(28394), -(28396), -(28397), -(28410), -(28412), -(28418), -(28419), -(28420), -(28428), -(28431), -(28434), -(28439), -(28444), -(28445), -(28467), -(28470), -(28478), -(28516), -(28522), -(28597), -(28601), -(28608), -(28614), -(28624), -(28674), -(28676), -(28678), -(28684), -(28685), -(28689), -(28690), -(28691), -(28692), -(28696), -(28698), -(28702), -(28715), -(28718), -(28720), -(28722), -(28723), -(28724), -(28734), -(28750), -(28772), -(28776), -(28783), -(28788), -(28790), -(28791), -(28793), -(28795), -(28810), -(28824), -(28825), -(28826), -(28827), -(28836), -(28839), -(28858), -(28859), -(28872), -(28873), -(28880), -(28882), -(28883), -(28887), -(28896), -(28899), -(28900), -(28901), -(28902), -(28913), -(28969), -(28993), -(29001), -(29002), -(29003), -(29006), -(29044), -(29054), -(29058), -(29060), -(29098), -(29117), -(29126), -(29127), -(29128), -(29129), -(29134), -(29135), -(29136), -(29137), -(29138), -(29139), -(29151), -(29155), -(29157), -(29158), -(29160), -(29164), -(29166), -(29168), -(29170), -(29175), -(29182), -(29185), -(29188), -(29194), -(29196), -(29198), -(29228), -(29290), -(29295), -(29300), -(29306), -(29314), -(29317), -(29319), -(29320), -(29341), -(29362), -(29364), -(29380), -(29386), -(29395), -(29405), -(29407), -(29408), -(29425), -(29426), -(29427), -(29428), -(29435), -(29436), -(29443), -(29473), -(29487), -(29492), -(29494), -(29495), -(29497), -(29500), -(29502), -(29515), -(29516), -(29519), -(29522), -(29528), -(29539), -(29540), -(29543), -(29544), -(29546), -(29555), -(29560), -(29561), -(29562), -(29563), -(29564), -(29567), -(29570), -(29572), -(29574), -(29575), -(29576), -(29577), -(29578), -(29580), -(29581), -(29582), -(29583), -(29585), -(29586), -(29587), -(29607), -(29609), -(29638), -(29639), -(29640), -(29641), -(29644), -(29646), -(29647), -(29652), -(29653), -(29655), -(29661), -(29665), -(29666), -(29667), -(29670), -(29673), -(29675), -(29676), -(29677), -(29679), -(29684), -(29690), -(29703), -(29704), -(29707), -(29711), -(29712), -(29716), -(29722), -(29765), -(29768), -(29815), -(29832), -(29845), -(29847), -(29848), -(29850), -(29879), -(29881), -(29896), -(29901), -(29903), -(29906), -(29907), -(29909), -(29915), -(29916), -(29917), -(29925), -(29926), -(29927), -(29928), -(29930), -(29953), -(29954), -(29955), -(29956), -(29964), -(29990), -(29991), -(30010), -(30013), -(30014), -(30016), -(30019), -(30022), -(30036), -(30039), -(30044), -(30050), -(30053), -(30055), -(30069), -(30070), -(30077), -(30081), -(30099), -(30100), -(30102), -(30103), -(30104), -(30105), -(30108), -(30112), -(30113), -(30115), -(30121), -(30127), -(30128), -(30130), -(30131), -(30151), -(30153), -(30164), -(30173), -(30175), -(30177), -(30178), -(30180), -(30194), -(30195), -(30197), -(30198), -(30202), -(30213), -(30218), -(30219), -(30223), -(30238), -(30253), -(30269), -(30270), -(30271), -(30280), -(30285), -(30324), -(30330), -(30335), -(30351), -(30353), -(30356), -(30357), -(30358), -(30383), -(30395), -(30400), -(30401), -(30402), -(30404), -(30405), -(30412), -(30421), -(30422), -(30423), -(30424), -(30430), -(30433), -(30435), -(30448), -(30449), -(30451), -(30455), -(30459), -(30463), -(30464), -(30465), -(30466), -(30467), -(30468), -(30471), -(30474), -(30478), -(30479), -(30481), -(30493), -(30495), -(30500), -(30501), -(30504), -(30505), -(30507), -(30512), -(30520), -(30528), -(30530), -(30545), -(30546), -(30601), -(30605), -(30606), -(30607), -(30608), -(30609), -(30614), -(30615), -(30619), -(30621), -(30637), -(30638), -(30639), -(30641), -(30643), -(30646), -(30647), -(30648), -(30651), -(30652), -(30653), -(30654), -(30661), -(30686), -(30687), -(30688), -(30689), -(30691), -(30695), -(30719), -(30736), -(30740), -(30751), -(30753), -(30755), -(30756), -(30768), -(30817), -(30822), -(30830), -(30832), -(30838), -(30839), -(30846), -(30849), -(30850), -(30854), -(30875), -(30876), -(30877), -(30878), -(30888), -(30889), -(30890), -(30900), -(30901), -(30909), -(30910), -(30923), -(30926), -(30932), -(30936), -(30937), -(30942), -(30943), -(30944), -(30945), -(30967), -(30971), -(30977), -(30980), -(30981), -(30984), -(30986), -(30989), -(30990), -(30992), -(31008), -(31009), -(31012), -(31015), -(31016), -(31018), -(31022), -(31041), -(31042), -(31043), -(31046), -(31069), -(31117), -(31125), -(31139), -(31249), -(31257), -(31262), -(31263), -(31270), -(31271), -(31272), -(31274), -(31275), -(31279), -(31280), -(31281), -(31282), -(31284), -(31286), -(31287), -(31288), -(31289), -(31290), -(31292), -(31295), -(31296), -(31305), -(31306), -(31312), -(31316), -(31319), -(31330), -(31334), -(31337), -(31339), -(31345), -(31366), -(31367), -(31368), -(31376), -(31378), -(31381), -(31387), -(31389), -(31390), -(31394), -(31397), -(31399), -(31400), -(31401), -(31402), -(31404), -(31405), -(31406), -(31407), -(31410), -(31415), -(31416), -(31417), -(31418), -(31419), -(31420), -(31423), -(31425), -(31426), -(31427), -(31436), -(31445), -(31446), -(31457), -(31464), -(31477), -(31481), -(31486), -(31513), -(31516), -(31535), -(31547), -(31551), -(31552), -(31553), -(31566), -(31589), -(31595), -(31596), -(31600), -(31601), -(31602), -(31604), -(31609), -(31610), -(31618), -(31620), -(31622), -(31623), -(31626), -(31627), -(31629), -(31651), -(31662), -(31664), -(31703), -(31705), -(31707), -(31709), -(31713), -(31715), -(31717), -(31718), -(31721), -(31724), -(31729), -(31733), -(31734), -(31739), -(31740), -(31741), -(31742), -(31743), -(31747), -(31751), -(31754), -(31758), -(31759), -(31764), -(31766), -(31772), -(31779), -(31782), -(31784), -(31789), -(31790), -(31803), -(31804), -(31807), -(31808), -(31810), -(31811), -(31812), -(31813), -(31814), -(31815), -(31816), -(31819), -(31827), -(31843), -(31863), -(31864), -(31865), -(31893), -(31898), -(31907), -(31911), -(31916), -(31923), -(31935), -(31939), -(31942), -(31946), -(31948), -(31955), -(31956), -(31961), -(31965), -(31966), -(31971), -(31972), -(31973), -(31975), -(31976), -(31977), -(31978), -(31984), -(31988), -(31994), -(31996), -(31999), -(32000), -(32001), -(32002), -(32004), -(32005), -(32006), -(32009), -(32010), -(32011), -(32012), -(32013), -(32015), -(32017), -(32018), -(32019), -(32020), -(32021), -(32022), -(32024), -(32025), -(32026), -(32039), -(32049), -(32055), -(32056), -(32063), -(32065), -(32071), -(32076), -(32077), -(32080), -(32082), -(32092), -(32093), -(32094), -(32095), -(32103), -(32104), -(32105), -(32110), -(32120), -(32125), -(32126), -(32129), -(32131), -(32132), -(32133), -(32139), -(32154), -(32168), -(32175), -(32176), -(32190), -(32197), -(32202), -(32211), -(32224), -(32231), -(32247), -(32248), -(32261), -(32268), -(32270), -(32300), -(32306), -(32315), -(32317), -(32319), -(32320), -(32321), -(32323), -(32325), -(32328), -(32329), -(32330), -(32337), -(32338), -(32346), -(32361), -(32363), -(32364), -(32369), -(32370), -(32376), -(32378), -(32379), -(32386), -(32388), -(32389), -(32390), -(32391), -(32405), -(32414), -(32415), -(32416), -(32417), -(32418), -(32422), -(32428), -(32430), -(32431), -(32441), -(32445), -(32474), -(32491), -(32546), -(32550), -(32578), -(32583), -(32588), -(32593), -(32594), -(32595), -(32605), -(32606), -(32639), -(32643), -(32645), -(32652), -(32654), -(32666), -(32674), -(32675), -(32677), -(32678), -(32679), -(32682), -(32683), -(32684), -(32689), -(32690), -(32691), -(32693), -(32699), -(32700), -(32707), -(32709), -(32716), -(32721), -(32733), -(32734), -(32735), -(32736), -(32738), -(32739), -(32740), -(32741), -(32742), -(32747), -(32748), -(32749), -(32751), -(32752), -(32759), -(32769), -(32770), -(32771), -(32772), -(32774), -(32778), -(32779), -(32784), -(32797), -(32829), -(32830), -(32831), -(32835), -(32846), -(32858), -(32860), -(32862), -(32863), -(32864), -(32889), -(32897), -(32901), -(32902), -(32903), -(32904), -(32905), -(32906), -(32907), -(32908), -(32909), -(32913), -(32915), -(32916), -(32917), -(32919), -(32921), -(32922), -(32924), -(32926), -(32935), -(32940), -(32950), -(32959), -(32960), -(32962), -(32967), -(32969), -(32971), -(32984), -(32996), -(33031), -(33040), -(33044), -(33045), -(33047), -(33049), -(33051), -(33055), -(33056), -(33068), -(33069), -(33072), -(33073), -(33074), -(33077), -(33078), -(33079), -(33080), -(33081), -(33082), -(33086), -(33096), -(33098), -(33126), -(33129), -(33130), -(33144), -(33173), -(33175), -(33196), -(33197), -(33198), -(33206), -(33227), -(33230), -(33246), -(33247), -(33324), -(33326), -(33331), -(33335), -(33346), -(33360), -(33382), -(33383), -(33385), -(33387), -(33389), -(33392), -(33401), -(33404), -(33417), -(33419), -(33462), -(33463), -(33480), -(33482), -(33483), -(33487), -(33493), -(33502), -(33526), -(33527), -(33528), -(33529), -(33534), -(33535), -(33542), -(33552), -(33553), -(33554), -(33619), -(33620), -(33625), -(33626), -(33628), -(33631), -(33632), -(33640), -(33641), -(33643), -(33659), -(33661), -(33665), -(33684), -(33688), -(33689), -(33698), -(33699), -(33700), -(33709), -(33723), -(33728), -(33731), -(33745), -(33750), -(33763), -(33768), -(33781), -(33786), -(33787), -(33789), -(33792), -(33793), -(33794), -(33813), -(33824), -(33825), -(33827), -(33832), -(33833), -(33837), -(33844), -(33849), -(33850), -(33865), -(33871), -(33876), -(33878), -(33899), -(33907), -(33910), -(33911), -(33912), -(33913), -(33914), -(33925), -(33938), -(33947), -(33951), -(33960), -(33964), -(33969), -(33970), -(33975), -(33982), -(33983), -(33985), -(33986), -(33987), -(33988), -(33989), -(34014), -(34020), -(34025), -(34036), -(34071), -(34073), -(34083), -(34087), -(34088), -(34089), -(34092), -(34093), -(34095), -(34097), -(34099), -(34107), -(34108), -(34110), -(34112), -(34113), -(34120), -(34130), -(34132), -(34135), -(34138), -(34139), -(34143), -(34149), -(34150), -(34163), -(34171), -(34172), -(34176), -(34177), -(34213), -(34214), -(34215), -(34216), -(34217), -(34218), -(34219), -(34232), -(34243), -(34259), -(34298), -(34344), -(34345), -(34346), -(34347), -(34348), -(34351), -(34352), -(34353), -(34354), -(34357), -(34361), -(34363), -(34366), -(34370), -(34379), -(34389), -(34390), -(34391), -(34394), -(34400), -(34411), -(34412), -(34413), -(34414), -(34415), -(34416), -(34417), -(34418), -(34419), -(34423), -(34425), -(34428), -(34432), -(34437), -(34438), -(34439), -(34445), -(34446), -(34447), -(34451), -(34463), -(34490), -(34510), -(34520), -(34578), -(34580), -(34587), -(34613), -(34614), -(34615), -(34616), -(34618), -(34620), -(34625), -(34626), -(34629), -(34637), -(34639), -(34640), -(34641), -(34643), -(34644), -(34645), -(34650), -(34653), -(34654), -(34655), -(34661), -(34665), -(34672), -(34694), -(34695), -(34696), -(34697), -(34709), -(34714), -(34715), -(34719), -(34722), -(34745), -(34752), -(34784), -(34786), -(34787), -(34788), -(34789), -(34793), -(34794), -(34797), -(34798), -(34799), -(34800), -(34802), -(34809), -(34811), -(34812), -(34820), -(34824), -(34828), -(34829), -(34841), -(34852), -(34856), -(34875), -(34879), -(34881), -(34883), -(34886), -(34889), -(34891), -(34893), -(34906), -(34907), -(34913), -(34914), -(34916), -(34917), -(34920), -(34922), -(34924), -(34925), -(34930), -(34931), -(34940), -(34941), -(34942), -(34945), -(34969), -(34974), -(34975), -(34976), -(34984), -(34996), -(35004), -(35010), -(35011), -(35012), -(35013), -(35033), -(35034), -(35039), -(35047), -(35049), -(35054), -(35055), -(35056), -(35062), -(35065), -(35066), -(35067), -(35069), -(35071), -(35072), -(35088), -(35089), -(35092), -(35096), -(35101), -(35105), -(35106), -(35107), -(35112), -(35115), -(35117), -(35120), -(35144), -(35147), -(35161), -(35178), -(35179), -(35180), -(35182), -(35183), -(35185), -(35189), -(35195), -(35201), -(35207), -(35229), -(35231), -(35234), -(35238), -(35243), -(35244), -(35263), -(35267), -(35273), -(35280), -(35290), -(35291), -(35292), -(35293), -(35294), -(35295), -(35313), -(35314), -(35316), -(35317), -(35318), -(35321), -(35323), -(35325), -(35326), -(35328), -(35329), -(35331), -(35332), -(35333), -(35334), -(35335), -(35339), -(35346), -(35353), -(35371), -(35376), -(35377), -(35382), -(35387), -(35389), -(35392), -(35395), -(35401), -(35410), -(35412), -(35424), -(35460), -(35466), -(35472), -(35473), -(35493), -(35499), -(35501), -(35506), -(35507), -(35510), -(35511), -(35514), -(35518), -(35519), -(35556), -(35570), -(35621), -(35686), -(35718), -(35727), -(35728), -(35735), -(35741), -(35742), -(35748), -(35759), -(35760), -(35771), -(35772), -(35780), -(35783), -(35839), -(35846), -(35851), -(35853), -(35857), -(35871), -(35873), -(35877), -(35913), -(35914), -(35916), -(35918), -(35919), -(35920), -(35927), -(35928), -(35932), -(35944), -(35945), -(35946), -(35949), -(35954), -(35955), -(35963), -(35964), -(35965), -(35966), -(35967), -(35968), -(35969), -(35970), -(35971), -(35972), -(35973), -(35974), -(35975), -(35976), -(35977), -(35978), -(35979), -(35980), -(35981), -(35982), -(35983), -(35984), -(35985), -(35986), -(35987), -(35988), -(35989), -(35990), -(35997), -(35998), -(35999), -(36002), -(36020), -(36021), -(36023), -(36025), -(36033), -(36052), -(36054), -(36073), -(36088), -(36093), -(36094), -(36095), -(36099), -(36100), -(36102), -(36115), -(36123), -(36138), -(36140), -(36141), -(36145), -(36152), -(36153), -(36170), -(36173), -(36176), -(36181), -(36207), -(36208), -(36224), -(36227), -(36228), -(36237), -(36238), -(36246), -(36247), -(36250), -(36276), -(36277), -(36279), -(36288), -(36295), -(36296), -(36299), -(36310), -(36312), -(36314), -(36328), -(36332), -(36333), -(36339), -(36340), -(36341), -(36342), -(36343), -(36344), -(36345), -(36348), -(36380), -(36398), -(36399), -(36401), -(36402), -(36404), -(36414), -(36415), -(36416), -(36417), -(36433), -(36434), -(36435), -(36436), -(36438), -(36439), -(36441), -(36447), -(36448), -(36457), -(36458), -(36461), -(36464), -(36469), -(36470), -(36475), -(36478), -(36482), -(36483), -(36488), -(36500), -(36507), -(36508), -(36509), -(36516), -(36517), -(36518), -(36527), -(36534), -(36536), -(36538), -(36539), -(36540), -(36541), -(36554), -(36558), -(36570), -(36571), -(36578), -(36586), -(36590), -(36594), -(36601), -(36604), -(36606), -(36608), -(36609), -(36612), -(36622), -(36623), -(36624), -(36625), -(36627), -(36628), -(36632), -(36638), -(36641), -(36642), -(36645), -(36646), -(36647), -(36650), -(36655), -(36656), -(36659), -(36664), -(36671), -(36677), -(36678), -(36679), -(36710), -(36711), -(36712), -(36713), -(36714), -(36732), -(36739), -(36778), -(36779), -(36780), -(36781), -(36787), -(36789), -(36791), -(36796), -(36801), -(36805), -(36806), -(36807), -(36810), -(36812), -(36814), -(36822), -(36825), -(36831), -(36832), -(36833), -(36836), -(36838), -(36839), -(36840), -(36841), -(36842), -(36843), -(36844), -(36863), -(36864), -(36866), -(36872), -(36876), -(36877), -(36886), -(36891), -(36894), -(36905), -(36906), -(36909), -(36913), -(36914), -(36916), -(36917), -(36919), -(36920), -(36921), -(36924), -(36927), -(36929), -(36947), -(36956), -(36957), -(36965), -(36966), -(36971), -(36972), -(36974), -(36979), -(36980), -(36983), -(36984), -(36986), -(36987), -(36988), -(36990), -(36991), -(37027), -(37028), -(37030), -(37031), -(37054), -(37057), -(37067), -(37073), -(37074), -(37082), -(37089), -(37104), -(37110), -(37111), -(37112), -(37113), -(37121), -(37122), -(37123), -(37126), -(37132), -(37133), -(37136), -(37138), -(37154), -(37156), -(37162), -(37176), -(37208), -(37216), -(37221), -(37249), -(37250), -(37251), -(37252), -(37254), -(37255), -(37257), -(37259), -(37260), -(37271), -(37272), -(37273), -(37274), -(37275), -(37276), -(37277), -(37320), -(37321), -(37322), -(37323), -(37328), -(37329), -(37330), -(37331), -(37332), -(37334), -(37335), -(37359), -(37361), -(37369), -(37372), -(37387), -(37389), -(37412), -(37417), -(37421), -(37450), -(37455), -(37456), -(37460), -(37462), -(37463), -(37470), -(37479), -(37486), -(37500), -(37506), -(37511), -(37527), -(37532), -(37537), -(37540), -(37548), -(37551), -(37552), -(37554), -(37563), -(37566), -(37572), -(37577), -(37578), -(37579), -(37580), -(37581), -(37589), -(37591), -(37592), -(37596), -(37597), -(37599), -(37602), -(37621), -(37628), -(37629), -(37630), -(37632), -(37634), -(37646), -(37647), -(37654), -(37661), -(37662), -(37664), -(37667), -(37668), -(37675), -(37681), -(37685), -(37695), -(37700), -(37711), -(37717), -(37718), -(37719), -(37727), -(37749), -(37770), -(37777), -(37778), -(37798), -(37800), -(37801), -(37802), -(37803), -(37804), -(37805), -(37806), -(37807), -(37808), -(37809), -(37810), -(37811), -(37813), -(37823), -(37834), -(37838), -(37839), -(37840), -(37841), -(37847), -(37850), -(37851), -(37856), -(37862), -(37865), -(37867), -(37871), -(37892), -(37894), -(37906), -(37908), -(37910), -(37921), -(37922), -(37930), -(37933), -(37937), -(37940), -(37945), -(37946), -(37950), -(37956), -(37958), -(37962), -(37965), -(37967), -(37968), -(37972), -(37973), -(37974), -(37975), -(37978), -(37979), -(37986), -(37988), -(37992), -(37998), -(38002), -(38007), -(38009), -(38010), -(38023), -(38024), -(38025), -(38027), -(38029), -(38030), -(38032), -(38034), -(38035), -(38047), -(38048), -(38051), -(38052), -(38053), -(38056), -(38058), -(38059), -(38063), -(38065), -(38066), -(38067), -(38074), -(38075), -(38076), -(38078), -(38083), -(38084), -(38085), -(38093), -(38094), -(38095), -(38107), -(38109), -(38113), -(38120), -(38122), -(38125), -(38127), -(38129), -(38133), -(38134), -(38135), -(38136), -(38145), -(38146), -(38147), -(38148), -(38149), -(38153), -(38154), -(38155), -(38167), -(38177), -(38178), -(38182), -(38183), -(38187), -(38193), -(38203), -(38204), -(38205), -(38208), -(38209), -(38210), -(38213), -(38223), -(38226), -(38233), -(38234), -(38238), -(38239), -(38240), -(38243), -(38245), -(38246), -(38252), -(38253), -(38254), -(38259), -(38260), -(38262), -(38263), -(38264), -(38265), -(38267), -(38274), -(38275), -(38276), -(38277), -(38279), -(38280), -(38285), -(38295), -(38310), -(38313), -(38324), -(38328), -(38329), -(38330), -(38333), -(38338), -(38340), -(38342), -(38344), -(38363), -(38366), -(38370), -(38372), -(38374), -(38377), -(38378), -(38383), -(38386), -(38387), -(38391), -(38400), -(38401), -(38441), -(38446), -(38461), -(38465), -(38470), -(38474), -(38495), -(38496), -(38505), -(38509), -(38510), -(38520), -(38523), -(38526), -(38534), -(38535), -(38538), -(38543), -(38554), -(38556), -(38557), -(38558), -(38559), -(38560), -(38561), -(38562), -(38563), -(38564), -(38565), -(38566), -(38567), -(38568), -(38569), -(38570), -(38572), -(38580), -(38582), -(38584), -(38585), -(38586), -(38588), -(38591), -(38595), -(38598), -(38606), -(38616), -(38617), -(38621), -(38625), -(38626), -(38628), -(38630), -(38631), -(38634), -(38636), -(38641), -(38643), -(38645), -(38657), -(38658), -(38661), -(38663), -(38669), -(38692), -(38697), -(38699), -(38704), -(38708), -(38721), -(38723), -(38731), -(38739), -(38742), -(38753), -(38760), -(38762), -(38764), -(38765), -(38767), -(38768), -(38770), -(38772), -(38775), -(38777), -(38791), -(38797), -(38798), -(38801), -(38804), -(38806), -(38807), -(38808), -(38815), -(38816), -(38817), -(38821), -(38822), -(38823), -(38824), -(38825), -(38826), -(38827), -(38846), -(38848), -(38849), -(38851), -(38852), -(38858), -(38859), -(38861), -(38863), -(38864), -(38875), -(38879), -(38880), -(38881), -(38882), -(38883), -(38884), -(38887), -(38894), -(38895), -(38896), -(38897), -(38899), -(38904), -(38907), -(38909), -(38913), -(38914), -(38915), -(38918), -(38919), -(38921), -(38923), -(38926), -(38930), -(38935), -(38940), -(38941), -(38942), -(38943), -(38945), -(38946), -(38950), -(38952), -(38959), -(38967), -(38971), -(38985), -(38986), -(38987), -(38988), -(38989), -(38990), -(38992), -(38995), -(39000), -(39002), -(39006), -(39009), -(39015), -(39016), -(39017), -(39019), -(39020), -(39021), -(39022), -(39023), -(39025), -(39026), -(39029), -(39032), -(39039), -(39044), -(39046), -(39047), -(39053), -(39054), -(39058), -(39060), -(39061), -(39062), -(39064), -(39065), -(39066), -(39068), -(39069), -(39070), -(39076), -(39077), -(39078), -(39079), -(39083), -(39087), -(39097), -(39098), -(39099), -(39101), -(39116), -(39119), -(39120), -(39121), -(39122), -(39123), -(39125), -(39129), -(39135), -(39136), -(39145), -(39153), -(39157), -(39159), -(39160), -(39164), -(39165), -(39171), -(39172), -(39174), -(39176), -(39182), -(39192), -(39196), -(39197), -(39198), -(39202), -(39204), -(39207), -(39210), -(39212), -(39214), -(39215), -(39226), -(39229), -(39230), -(39252), -(39258), -(39262), -(39267), -(39268), -(39270), -(39271), -(39285), -(39293), -(39297), -(39299), -(39309), -(39322), -(39328), -(39329), -(39332), -(39337), -(39339), -(39349), -(39367), -(39371), -(39378), -(39386), -(39396), -(39412), -(39413), -(39415), -(39419), -(39435), -(39436), -(39445), -(39449), -(39456), -(39457), -(39460), -(39474), -(39475), -(39476), -(39477), -(39512), -(39513), -(39528), -(39529), -(39544), -(39560), -(39566), -(39574), -(39582), -(39587), -(39590), -(39592), -(39595), -(39600), -(39609), -(39621), -(39622), -(39661), -(39665), -(39668), -(39669), -(39670), -(39674), -(39675), -(39676), -(39697), -(39703), -(39794), -(39796), -(39810), -(39812), -(39826), -(39830), -(39835), -(39837), -(39838), -(39857), -(39865), -(39883), -(39886), -(39901), -(39904), -(39908), -(39920), -(39928), -(39945), -(39948), -(39955), -(39956), -(39967), -(39972), -(39979), -(39980), -(39995), -(39996), -(40011), -(40019), -(40032), -(40041), -(40055), -(40057), -(40063), -(40066), -(40071), -(40074), -(40081), -(40084), -(40086), -(40097), -(40099), -(40102), -(40109), -(40119), -(40123), -(40124), -(40146), -(40157), -(40165), -(40166), -(40167), -(40173), -(40185), -(40191), -(40193), -(40197), -(40198), -(40199), -(40220), -(40225), -(40227), -(40228), -(40239), -(40248), -(40251), -(40254), -(40259), -(40279), -(40290), -(40293), -(40303), -(40310), -(40311), -(40312), -(40313), -(40317), -(40321), -(40322), -(40325), -(40327), -(40334), -(40337), -(40339), -(40344), -(40346), -(40347), -(40348), -(40351), -(40356), -(40357), -(40358), -(40363), -(40366), -(40367), -(40368), -(40384), -(40385), -(40392), -(40400), -(40406), -(40411), -(40412), -(40413), -(40414), -(40415), -(40416), -(40420), -(40423), -(40427), -(40429), -(40430), -(40431), -(40434), -(40449), -(40450), -(40471), -(40472), -(40481), -(40486), -(40489), -(40491), -(40493), -(40497), -(40504), -(40505), -(40507), -(40508), -(40509), -(40525), -(40536), -(40542), -(40554), -(40560), -(40563), -(40564), -(40565), -(40569), -(40571), -(40581), -(40585), -(40595), -(40597), -(40602), -(40604), -(40605), -(40608), -(40616), -(40620), -(40633), -(40635), -(40639), -(40641), -(40643), -(40645), -(40646), -(40651), -(40652), -(40671), -(40672), -(40685), -(40726), -(40728), -(40736), -(40739), -(40740), -(40742), -(40751), -(40758), -(40770), -(40772), -(40777), -(40778), -(40787), -(40796), -(40801), -(40810), -(40814), -(40822), -(40827), -(40835), -(40837), -(40838), -(40842), -(40843), -(40844), -(40846), -(40856), -(40859), -(40860), -(40861), -(40864), -(40872), -(40873), -(40876), -(40877), -(40881), -(40886), -(40888), -(40890), -(40892), -(40893), -(40894), -(40895), -(40901), -(40903), -(40906), -(40909), -(40917), -(40926), -(40928), -(40930), -(40935), -(40945), -(40951), -(40954), -(40958), -(40964), -(40965), -(40968), -(40969), -(40970), -(40972), -(40976), -(40991), -(41001), -(41003), -(41028), -(41029), -(41032), -(41035), -(41044), -(41047), -(41050), -(41052), -(41054), -(41055), -(41060), -(41063), -(41065), -(41069), -(41070), -(41072), -(41075), -(41080), -(41082), -(41083), -(41084), -(41092), -(41093), -(41103), -(41109), -(41115), -(41116), -(41121), -(41137), -(41139), -(41152), -(41169), -(41170), -(41171), -(41177), -(41178), -(41179), -(41180), -(41182), -(41183), -(41184), -(41186), -(41187), -(41188), -(41189), -(41190), -(41192), -(41197), -(41198), -(41213), -(41214), -(41225), -(41226), -(41227), -(41228), -(41229), -(41230), -(41231), -(41238), -(41241), -(41247), -(41250), -(41255), -(41256), -(41259), -(41264), -(41265), -(41270), -(41272), -(41278), -(41279), -(41280), -(41281), -(41283), -(41291), -(41299), -(41302), -(41332), -(41334), -(41335), -(41336), -(41338), -(41345), -(41346), -(41351), -(41352), -(41353), -(41355), -(41360), -(41363), -(41368), -(41370), -(41372), -(41373), -(41374), -(41375), -(41377), -(41378), -(41383), -(41384), -(41388), -(41389), -(41390), -(41392), -(41394), -(41395), -(41396), -(41407), -(41410), -(41411), -(41419), -(41421), -(41426), -(41439), -(41440), -(41442), -(41448), -(41450), -(41451), -(41456), -(41461), -(41467), -(41468), -(41470), -(41471), -(41472), -(41473), -(41483), -(41484), -(41485), -(41486), -(41487), -(41489), -(41490), -(41491), -(41492), -(41519), -(41526), -(41528), -(41533), -(41540), -(41543), -(41544), -(41546), -(41547), -(41548), -(41549), -(41558), -(41559), -(41563), -(41564), -(41565), -(41567), -(41568), -(41571), -(41578), -(41579), -(41580), -(41581), -(41586), -(41588), -(41592), -(41596), -(41597), -(41598), -(41601), -(41621), -(41622), -(41625), -(41626), -(41633), -(41637), -(41911), -(41914), -(41916), -(41917), -(41926), -(41931), -(41932), -(41933), -(41936), -(41937), -(41939), -(41940), -(41957), -(41958), -(41959), -(41960), -(41961), -(41964), -(41965), -(41978), -(41980), -(41984), -(41985), -(41990), -(42002), -(42003), -(42013), -(42018), -(42020), -(42021), -(42024), -(42025), -(42053), -(42058), -(42129), -(42131), -(42132), -(42133), -(42139), -(42142), -(42144), -(42149), -(42150), -(42152), -(42161), -(42165), -(42169), -(42185), -(42203), -(42246), -(42299), -(42313), -(42315), -(42319), -(42320), -(42322), -(42324), -(42325), -(42326), -(42328), -(42329), -(42330), -(42331), -(42332), -(42333), -(42337), -(42349), -(42360), -(42363), -(42368), -(42369), -(42370), -(42371), -(42372), -(42380), -(42382), -(42383), -(42384), -(42385), -(42389), -(42395), -(42396), -(42397), -(42399), -(42400), -(42401), -(42402), -(42411), -(42414), -(42426), -(42434), -(42435), -(42441), -(42443), -(42447), -(42455), -(42463), -(42476), -(42483), -(42485), -(42486), -(42488), -(42489), -(42502), -(42512), -(42514), -(42516), -(42518), -(42535), -(42537), -(42540), -(42560), -(42561), -(42574), -(42579), -(42580), -(42583), -(42587), -(42611), -(42628), -(42632), -(42633), -(42634), -(42635), -(42653), -(42658), -(42670), -(42671), -(42672), -(42696), -(42702), -(42710), -(42711), -(42717), -(42719), -(42721), -(42724), -(42725), -(42730), -(42733), -(42739), -(42740), -(42741), -(42746), -(42747), -(42756), -(42762), -(42767), -(42772), -(42780), -(42781), -(42782), -(42783), -(42785), -(42789), -(42790), -(42791), -(42793), -(42799), -(42802), -(42803), -(42804), -(42811), -(42826), -(42832), -(42833), -(42834), -(42841), -(42842), -(42843), -(42846), -(42853), -(42858), -(42859), -(42867), -(42869), -(42870), -(42872), -(42873), -(42878), -(42879), -(42880), -(42889), -(42890), -(42891), -(42894), -(42895), -(42896), -(42897), -(42902), -(42903), -(42904), -(42907), -(42908), -(42913), -(42914), -(42953), -(42964), -(42972), -(42978), -(42995), -(42999), -(43003), -(43004), -(43006), -(43036), -(43037), -(43043), -(43044), -(43058), -(43061), -(43063), -(43064), -(43065), -(43067), -(43075), -(43077), -(43083), -(43084), -(43086), -(43087), -(43090), -(43093), -(43094), -(43097), -(43100), -(43103), -(43104), -(43107), -(43108), -(43122), -(43123), -(43125), -(43128), -(43130), -(43131), -(43132), -(43133), -(43137), -(43138), -(43140), -(43150), -(43151), -(43153), -(43156), -(43157), -(43159), -(43178), -(43187), -(43191), -(43192), -(43193), -(43194), -(43195), -(43196), -(43197), -(43198), -(43199), -(43202), -(43205), -(43206), -(43225), -(43228), -(43235), -(43243), -(43245), -(43246), -(43256), -(43259), -(43260), -(43261), -(43262), -(43267), -(43268), -(43270), -(43273), -(43286), -(43287), -(43288), -(43292), -(43297), -(43298), -(43299), -(43300), -(43301), -(43303), -(43305), -(43309), -(43315), -(43325), -(43330), -(43334), -(43337), -(43340), -(43341), -(43345), -(43346), -(43347), -(43348), -(43352), -(43353), -(43354), -(43356), -(43357), -(43358), -(43359), -(43361), -(43362), -(43364), -(43365), -(43368), -(43370), -(43379), -(43380), -(43381), -(43384), -(43393), -(43398), -(43399), -(43409), -(43410), -(43411), -(43413), -(43415), -(43416), -(43417), -(43419), -(43427), -(43428), -(43433), -(43435), -(43439), -(43441), -(43445), -(43451), -(43456), -(43461), -(43469), -(43470), -(43471), -(43472), -(43473), -(43474), -(43475), -(43477), -(43483), -(43484), -(43488), -(43489), -(43492), -(43495), -(43496), -(43497), -(43501), -(43505), -(43507), -(43511), -(43512), -(43515), -(43516), -(43517), -(43518), -(43519), -(43520), -(43522), -(43523), -(43524), -(43525), -(43526), -(43528), -(43529), -(43532), -(43535), -(43543), -(43545), -(43553), -(43556), -(43560), -(43564), -(43565), -(43567), -(43569), -(43571), -(43572), -(43574), -(43575), -(43577), -(43578), -(43579), -(43581), -(43584), -(43585), -(43586), -(43591), -(43592), -(43593), -(43612), -(43613), -(43619), -(43621), -(43622), -(43644), -(43646), -(43648), -(43649), -(43650), -(43651), -(43660), -(43661), -(43663), -(43665), -(43666), -(43667), -(43671), -(43673), -(43680), -(43682), -(43683), -(43684), -(43690), -(43693), -(43695), -(43701), -(43709), -(43714), -(43715), -(43720), -(43726), -(43727), -(43728), -(43729), -(43732), -(43746), -(43767), -(43769), -(43785), -(43786), -(43789), -(43794), -(43795), -(43799), -(43804), -(43807), -(43809), -(43821), -(43834), -(43869), -(43895), -(43903), -(43906), -(43923), -(43928), -(43931), -(43932), -(43933), -(43937), -(43941), -(43948), -(43951), -(43952), -(43969), -(43971), -(43974), -(43976), -(43984), -(43988), -(43993), -(43996), -(43997), -(44000), -(44005), -(44008), -(44015), -(44016), -(44030), -(44031), -(44038), -(44053), -(44078), -(44079), -(44081), -(44082), -(44089), -(44093), -(44095), -(44120), -(44121), -(44126), -(44127), -(44137), -(44138), -(44139), -(44141), -(44142), -(44144), -(44148), -(44149), -(44152), -(44156), -(44159), -(44164), -(44165), -(44168), -(44169), -(44170), -(44171), -(44173), -(44174), -(44176), -(44181), -(44185), -(44188), -(44189), -(44202), -(44211), -(44212), -(44216), -(44219), -(44220), -(44221), -(44222), -(44223), -(44237), -(44241), -(44242), -(44247), -(44248), -(44256), -(44258), -(44262), -(44267), -(44268), -(44271), -(44274), -(44280), -(44285), -(44286), -(44289), -(44294), -(44304), -(44308), -(44310), -(44318), -(44319), -(44323), -(44325), -(44327), -(44328), -(44332), -(44339), -(44351), -(44357), -(44358), -(44361), -(44364), -(44368), -(44370), -(44382), -(44407), -(44408), -(44415), -(44424), -(44425), -(44429), -(44430), -(44454), -(44455), -(44457), -(44464), -(44473), -(44477), -(44478), -(44479), -(44481), -(44482), -(44503), -(44504), -(44512), -(44518), -(44519), -(44525), -(44530), -(44532), -(44533), -(44534), -(44536), -(44541), -(44542), -(44547), -(44553), -(44563), -(44564), -(44572), -(44577), -(44583), -(44586), -(44600), -(44602), -(44606), -(44614), -(44617), -(44618), -(44619), -(44620), -(44622), -(44639), -(44640), -(44641), -(44642), -(44654), -(44657), -(44658), -(44685), -(44732), -(44753), -(44755), -(44765), -(44780), -(44781), -(44787), -(44788), -(44789), -(44790), -(44791), -(44796), -(44808), -(44811), -(44812), -(44813), -(44817), -(44818), -(44823), -(44843), -(44848), -(44868), -(44871), -(44872), -(44876), -(44881), -(44934), -(44937), -(44945), -(44956), -(44957), -(44961), -(44966), -(44985), -(44997), -(45012), -(45017), -(45023), -(45026), -(45029), -(45031), -(45036), -(45055), -(45064), -(45071), -(45075), -(45088), -(45089), -(45090), -(45096), -(45101), -(45102), -(45105), -(45108), -(45110), -(45113), -(45123), -(45124), -(45129), -(45130), -(45133), -(45134), -(45141), -(45145), -(45185), -(45189), -(45192), -(45195), -(45197), -(45199), -(45200), -(45204), -(45205), -(45206), -(45209), -(45214), -(45215), -(45221), -(45228), -(45235), -(45251), -(45256), -(45269), -(45271), -(45274), -(45276), -(45280), -(45284), -(45286), -(45287), -(45288), -(45289), -(45290), -(45291), -(45292), -(45293), -(45294), -(45295), -(45296), -(45297), -(45298), -(45299), -(45300), -(45301), -(45302), -(45314), -(45321), -(45324), -(45327), -(45328), -(45334), -(45337), -(45344), -(45350), -(45352), -(45353), -(45356), -(45362), -(45409), -(45417), -(45419), -(45420), -(45421), -(45425), -(45428), -(45429), -(45430), -(45442), -(45444), -(45447), -(45456), -(45458), -(45462), -(45463), -(45468), -(45469), -(45472), -(45476), -(45477), -(45485), -(45487), -(45491), -(45493), -(45497), -(45504), -(45505), -(45507), -(45509), -(45511), -(45516), -(45524), -(45534), -(45537), -(45543), -(45544), -(45573), -(45576), -(45577), -(45578), -(45580), -(45587), -(45588), -(45589), -(45590), -(45600), -(45603), -(45604), -(45611), -(45625), -(45627), -(45628), -(45629), -(45632), -(45639), -(45645), -(45646), -(45647), -(45648), -(45649), -(45650), -(45659), -(45660), -(45661), -(45664), -(45693), -(45696), -(45716), -(45717), -(45719), -(45724), -(45725), -(45730), -(45739), -(45742), -(45744), -(45748), -(45773), -(45777), -(45778), -(45798), -(45799), -(45800), -(45803), -(45804), -(45815), -(45820), -(45833), -(45837), -(45854), -(45866), -(45873), -(45874), -(45875), -(45889), -(45897), -(45898), -(45899), -(45900), -(45902), -(45906), -(45913), -(45919), -(45924), -(45926), -(45931), -(45940), -(45943), -(45946), -(45947), -(45964), -(45967), -(45975), -(45980), -(45981), -(45983), -(45989), -(45992), -(46010), -(46012), -(46014), -(46015), -(46016), -(46023), -(46027), -(46028), -(46029), -(46031), -(46032), -(46033), -(46035), -(46042), -(46043), -(46044), -(46045), -(46047), -(46049), -(46057), -(46062), -(46065), -(46067), -(46070), -(46074), -(46080), -(46081), -(46083), -(46084), -(46092), -(46093), -(46098), -(46099), -(46101), -(46104), -(46119), -(46145), -(46152), -(46153), -(46155), -(46161), -(46164), -(46166), -(46167), -(46180), -(46181), -(46182), -(46183), -(46187), -(46188), -(46189), -(46190), -(46191), -(46192), -(46194), -(46198), -(46200), -(46202), -(46206), -(46221), -(46231), -(46232), -(46239), -(46260), -(46266), -(46276), -(46279), -(46280), -(46283), -(46285), -(46288), -(46291), -(46292), -(46305), -(46315), -(46323), -(46331), -(46333), -(46341), -(46357), -(46361), -(46362), -(46364), -(46365), -(46366), -(46368), -(46380), -(46381), -(46394), -(46406), -(46411), -(46420), -(46421), -(46422), -(46429), -(46430), -(46432), -(46433), -(46434), -(46440), -(46443), -(46444), -(46447), -(46448), -(46449), -(46459), -(46460), -(46466), -(46468), -(46469), -(46479), -(46480), -(46481), -(46483), -(46485), -(46486), -(46487), -(46543), -(46550), -(46556), -(46557), -(46558), -(46559), -(46560), -(46561), -(46562), -(46563), -(46566), -(46567), -(46568), -(46572), -(46579), -(46580), -(46582), -(46587), -(46590), -(46591), -(46595), -(46598), -(46602), -(46607), -(46611), -(46612), -(46613), -(46614), -(46615), -(46616), -(46617), -(46618), -(46620), -(46621), -(46624), -(46629), -(46630), -(46641), -(46642), -(46651), -(46654), -(46661), -(46664), -(46665), -(46667), -(46671), -(46672), -(46673), -(46674), -(46677), -(46681), -(46686), -(46691), -(46693), -(46696), -(46702), -(46704), -(46709), -(46711), -(46716), -(46717), -(46718), -(46719), -(46720), -(46721), -(46722), -(46723), -(46724), -(46725), -(46726), -(46727), -(46728), -(46729), -(46730), -(46731), -(46734), -(46745), -(46762), -(46764), -(46770), -(46772), -(46773), -(46787), -(46791), -(46801), -(46813), -(46816), -(46824), -(46825), -(46826), -(46841), -(46845), -(46846), -(46856), -(46857), -(46877), -(46879), -(46880), -(46887), -(46906), -(46956), -(46960), -(46962), -(46978), -(46982), -(46983), -(46987), -(46988), -(46990), -(47001), -(47003), -(47009), -(47011), -(47012), -(47014), -(47020), -(47021), -(47028), -(47029), -(47033), -(47034), -(47042), -(47043), -(47057), -(47059), -(47062), -(47063), -(47064), -(47066), -(47068), -(47069), -(47070), -(47071), -(47072), -(47074), -(47076), -(47077), -(47079), -(47081), -(47084), -(47093), -(47096), -(47098), -(47107), -(47117), -(47122), -(47139), -(47143), -(47144), -(47145), -(47146), -(47148), -(47149), -(47151), -(47152), -(47153), -(47155), -(47156), -(47157), -(47158), -(47160), -(47161), -(47162), -(47163), -(47164), -(47165), -(47166), -(47168), -(47171), -(47173), -(47176), -(47206), -(47208), -(47219), -(47244), -(47248), -(47249), -(47257), -(47272), -(47277), -(47282), -(47293), -(47299), -(47305), -(47307), -(47308), -(47316), -(47321), -(47322), -(47323), -(47326), -(47333), -(47334), -(47337), -(47338), -(47339), -(47340), -(47345), -(47380), -(47382), -(47390), -(47392), -(47394), -(47403), -(47405), -(47410), -(47413), -(47414), -(47422), -(47424), -(47431), -(47432), -(47442), -(47447), -(47449), -(47450), -(47451), -(47453), -(47465), -(47467), -(47468), -(47470), -(47471), -(47472), -(47474), -(47475), -(47476), -(47480), -(47481), -(47482), -(47485), -(47486), -(47487), -(47488), -(47489), -(47497), -(47498), -(47504), -(47516), -(47517), -(47519), -(47520), -(47528), -(47530), -(47534), -(47540), -(47541), -(47550), -(47575), -(47601), -(47604), -(47610), -(47611), -(47614), -(47629), -(47632), -(47633), -(47635), -(47637), -(47664), -(47665), -(47673), -(47674), -(47676), -(47679), -(47689), -(47695), -(47697), -(47698), -(47700), -(47702), -(47703), -(47718), -(47721), -(47722), -(47723), -(47724), -(47729), -(47739), -(47740), -(47741), -(47744), -(47749), -(47751), -(47753), -(47757), -(47758), -(47761), -(47767), -(47768), -(47777), -(47778), -(47780), -(47781), -(47782), -(47783), -(47785), -(47788), -(47808), -(47809), -(47810), -(47811), -(47812), -(47813), -(47814), -(47815), -(47824), -(47825), -(47826), -(47827), -(47835), -(47836), -(47837), -(47838), -(47841), -(47843), -(47848), -(47850), -(47851), -(47852), -(47853), -(47855), -(47857), -(47859), -(47860), -(47863), -(47864), -(47865), -(47867), -(47902), -(47914), -(47917), -(47920), -(47926), -(47928), -(47930), -(47938), -(47948), -(47960), -(47961), -(47962), -(47964), -(47968), -(47976), -(47984), -(47991), -(47992), -(47993), -(47994), -(47995), -(47996), -(48011), -(48013), -(48039), -(48045), -(48046), -(48047), -(48048), -(48053), -(48060), -(48062), -(48063), -(48065), -(48066), -(48067), -(48068), -(48070), -(48071), -(48072), -(48073), -(48084), -(48085), -(48098), -(48099), -(48100), -(48101), -(48102), -(48103), -(48104), -(48105), -(48119), -(48120), -(48122), -(48123), -(48124), -(48125), -(48126), -(48127), -(48130), -(48132), -(48133), -(48134), -(48135), -(48137), -(48140), -(48147), -(48155), -(48156), -(48157), -(48158), -(48159), -(48160), -(48161), -(48163), -(48164), -(48165), -(48169), -(48181), -(48184), -(48187), -(48192), -(48208), -(48210), -(48232), -(48245), -(48249), -(48250), -(48261), -(48262), -(48264), -(48267), -(48268), -(48282), -(48283), -(48285), -(48286), -(48287), -(48288), -(48290), -(48291), -(48292), -(48296), -(48298), -(48299), -(48300), -(48301), -(48307), -(48309), -(48310), -(48316), -(48330), -(48334), -(48360), -(48365), -(48374), -(48376), -(48377), -(48378), -(48400), -(48417), -(48423), -(48424), -(48440), -(48441), -(48442), -(48443), -(48450), -(48451), -(48459), -(48461), -(48462), -(48463), -(48464), -(48465), -(48468), -(48469), -(48479), -(48480), -(48489), -(48490), -(48491), -(48504), -(48532), -(48533), -(48540), -(48541), -(48542), -(48543), -(48548), -(48549), -(48563), -(48564), -(48565), -(48566), -(48567), -(48568), -(48569), -(48570), -(48571), -(48572), -(48573), -(48574), -(48575), -(48576), -(48577), -(48578), -(48579), -(48583), -(48585), -(48598), -(48599), -(48601), -(48603), -(48606), -(48617), -(48622), -(48628), -(48637), -(48638), -(48639), -(48640), -(48648), -(48652), -(48656), -(48657), -(48658), -(48659), -(48660), -(48661), -(48662), -(48663), -(48664), -(48665), -(48666), -(48667), -(48668), -(48669), -(48671), -(48672), -(48673), -(48674), -(48675), -(48676), -(48678), -(48679), -(48680), -(48689), -(48690), -(48691), -(48693), -(48696), -(48697), -(48698), -(48699), -(48700), -(48712), -(48714), -(48737), -(48738), -(48746), -(48747), -(48749), -(48750), -(48752), -(48753), -(48754), -(48755), -(48756), -(48759), -(48760), -(48765), -(48770), -(48772), -(48774), -(48775), -(48781), -(48782), -(48784), -(48785), -(48788), -(48800), -(48801), -(48802), -(48805), -(48806), -(48812), -(48813), -(48815), -(48820), -(48821), -(48822), -(48823), -(48824), -(48825), -(48826), -(48827), -(48828), -(48829), -(48830), -(48831), -(48832), -(48845), -(48850), -(48851), -(48852), -(48854), -(48862), -(48871), -(48872), -(48873), -(48876), -(48877), -(48878), -(48880), -(48881), -(48883), -(48895), -(48917), -(48920), -(48931), -(48932), -(48935), -(48936), -(48953), -(48960), -(48974), -(48981), -(48984), -(48995), -(48996), -(48998), -(48999), -(49000), -(49001), -(49005), -(49009), -(49010), -(49011), -(49012), -(49020), -(49021), -(49026), -(49028), -(49029), -(49037), -(49044), -(49045), -(49047), -(49048), -(49049), -(49050), -(49051), -(49052), -(49053), -(49054), -(49078), -(49084), -(49089), -(49090), -(49091), -(49092), -(49093), -(49099), -(49106), -(49110), -(49111), -(49113), -(49119), -(49124), -(49125), -(49127), -(49138), -(49143), -(49158), -(49161), -(49165), -(49177), -(49184), -(49204), -(49206), -(49213), -(49215), -(49230), -(49231), -(49232), -(49233), -(49235), -(49236), -(49237), -(49238), -(49239), -(49240), -(49242), -(49243), -(49256), -(49257), -(49266), -(49267), -(49268), -(49269), -(49270), -(49271), -(49272), -(49273), -(49275), -(49276), -(49278), -(49279), -(49282), -(49283), -(49284), -(49288), -(49294), -(49296), -(49298), -(49305), -(49309), -(49312), -(49317), -(49323), -(49324), -(49348), -(49349), -(49353), -(49354), -(49362), -(49363), -(49364), -(49372), -(49376), -(49381), -(49383), -(49387), -(49404), -(49406), -(49418), -(49427), -(49429), -(49433), -(49439), -(49446), -(49453), -(49454), -(49459), -(49463), -(49466), -(49481), -(49482), -(49485), -(49500), -(49501), -(49511), -(49512), -(49527), -(49537), -(49544), -(49546), -(49547), -(49549), -(49560), -(49576), -(49584), -(49587), -(49592), -(49613), -(49616), -(49617), -(49624), -(49637), -(49639), -(49641), -(49644), -(49675), -(49678), -(49680), -(49681), -(49686), -(49690), -(49696), -(49704), -(49705), -(49706), -(49708), -(49710), -(49711), -(49712), -(49715), -(49718), -(49719), -(49720), -(49723), -(49729), -(49734), -(49742), -(49747), -(49749), -(49753), -(49755), -(49758), -(49759), -(49771), -(49776), -(49797), -(49799), -(49800), -(49802), -(49803), -(49804), -(49805), -(49806), -(49830), -(49836), -(49840), -(49841), -(49843), -(49846), -(49848), -(49859), -(49861), -(49863), -(49865), -(49891), -(49892), -(49893), -(49894), -(49895), -(49896), -(49897), -(49903), -(49904), -(49906), -(49909), -(49913), -(49914), -(49915), -(49916), -(49917), -(49918), -(49919), -(49920), -(49921), -(49922), -(49923), -(49924), -(49926), -(49927), -(49928), -(49929), -(49930), -(49935), -(49942), -(49945), -(49956), -(49961), -(49965), -(49966), -(49967), -(49968), -(49969), -(49970), -(49971), -(49972), -(49973), -(49974), -(49975), -(49978), -(49980), -(49981), -(49985), -(49986), -(49987), -(49989), -(49991), -(49993), -(49994), -(49995), -(49996), -(49997), -(49998), -(49999), -(50004), -(50006), -(50015), -(50021), -(50027), -(50028), -(50035), -(50038), -(50046), -(50047), -(50050), -(50052), -(50064), -(50066), -(50073), -(50075), -(50084), -(50086), -(50089), -(50090), -(50091), -(50092), -(50094), -(50100), -(50101), -(50102), -(50104), -(50135), -(50144), -(50145), -(50146), -(50156), -(50165), -(50169), -(50183), -(50184), -(50185), -(50188), -(50196), -(50198), -(50205), -(50206), -(50207), -(50217), -(50231), -(50232), -(50234), -(50245), -(50251), -(50252), -(50255), -(50256), -(50257), -(50259), -(50265), -(50271), -(50273), -(50276), -(50282), -(50287), -(50288), -(50289), -(50290), -(50291), -(50293), -(50295), -(50299), -(50301), -(50303), -(50305), -(50306), -(50307), -(50319), -(50323), -(50328), -(50335), -(50341), -(50343), -(50344), -(50347), -(50349), -(50356), -(50361), -(50370), -(50375), -(50377), -(50378), -(50379), -(50380), -(50400), -(50401), -(50402), -(50403), -(50405), -(50406), -(50410), -(50411), -(50412), -(50424), -(50431), -(50432), -(50434), -(50435), -(50436), -(50437), -(50439), -(50445), -(50454), -(50455), -(50456), -(50459), -(50462), -(50463), -(50464), -(50477), -(50478), -(50479), -(50484), -(50498), -(50499), -(50500), -(50504), -(50508), -(50509), -(50510), -(50511), -(50512), -(50517), -(50518), -(50519), -(50521), -(50523), -(50533), -(50534), -(50536), -(50537), -(50538), -(50541), -(50545), -(50550), -(50559), -(50566), -(50572), -(50573), -(50578), -(50581), -(50582), -(50588), -(50597), -(50629), -(50631), -(50633), -(50634), -(50635), -(50638), -(50655), -(50658), -(50659), -(50660), -(50661), -(50662), -(50663), -(50666), -(50668), -(50673), -(50675), -(50679), -(50688), -(50691), -(50693), -(50701), -(50704), -(50705), -(50706), -(50721), -(50725), -(50729), -(50731), -(50732), -(50733), -(50737), -(50739), -(50740), -(50744), -(50761), -(50770), -(50773), -(50782), -(50783), -(50796), -(50797), -(50799), -(50804), -(50818), -(50820), -(50821), -(50830), -(50832), -(50834), -(50842), -(50843), -(50844), -(50845), -(50846), -(50853), -(50854), -(50859), -(50861), -(50874), -(50876), -(50894), -(50895), -(50900), -(50905), -(50907), -(50914), -(50918), -(50919), -(50923), -(50924), -(50926), -(50927), -(50978), -(50979), -(50992), -(50997), -(51011), -(51015), -(51016), -(51018), -(51020), -(51026), -(51035), -(51037), -(51046), -(51054), -(51055), -(51057), -(51059), -(51062), -(51064), -(51067), -(51069), -(51072), -(51077), -(51079), -(51081), -(51083), -(51085), -(51087), -(51089), -(51091), -(51093), -(51095), -(51097), -(51100), -(51102), -(51105), -(51107), -(51111), -(51120), -(51121), -(51131), -(51134), -(51135), -(51137), -(51154), -(51156), -(51157), -(51165), -(51187), -(51196), -(51197), -(51198), -(51199), -(51200), -(51203), -(51216), -(51220), -(51221), -(51226), -(51227), -(51228), -(51229), -(51232), -(51233), -(51235), -(51236), -(51240), -(51243), -(51258), -(51259), -(51270), -(51272), -(51275), -(51279), -(51285), -(51287), -(51290), -(51292), -(51298), -(51305), -(51308), -(51310), -(51315), -(51316), -(51325), -(51326), -(51327), -(51328), -(51330), -(51334), -(51339), -(51340), -(51354), -(51356), -(51363), -(51365), -(51372), -(51382), -(51399), -(51409), -(51410), -(51411), -(51413), -(51416), -(51417), -(51418), -(51419), -(51423), -(51424), -(51425), -(51426), -(51427), -(51428), -(51429), -(51430), -(51431), -(51432), -(51440), -(51442), -(51446), -(51447), -(51454), -(51460), -(51467), -(51484), -(51489), -(51491), -(51492), -(51495), -(51496), -(51500), -(51502), -(51503), -(51504), -(51505), -(51506), -(51509), -(51514), -(51515), -(51573), -(51580), -(51584), -(51585), -(51586), -(51587), -(51588), -(51591), -(51592), -(51593), -(51596), -(51598), -(51601), -(51608), -(51609), -(51610), -(51613), -(51614), -(51618), -(51656), -(51657), -(51658), -(51659), -(51662), -(51675), -(51676), -(51677), -(51680), -(51693), -(51695), -(51699), -(51714), -(51718), -(51722), -(51724), -(51726), -(51728), -(51732), -(51734), -(51735), -(51736), -(51740), -(51751), -(51756), -(51757), -(51772), -(51775), -(51776), -(51778), -(51779), -(51786), -(51787), -(51797), -(51798), -(51799), -(51803), -(51804), -(51808), -(51809), -(51811), -(51818), -(51827), -(51830), -(51842), -(51844), -(51853), -(51854), -(51855), -(51856), -(51857), -(51863), -(51864), -(51872), -(51875), -(51876), -(51877), -(51878), -(51879), -(51886), -(51888), -(51889), -(51893), -(51894), -(51895), -(51897), -(51898), -(51899), -(51901), -(51909), -(51912), -(51917), -(51918), -(51919), -(51920), -(51926), -(51934), -(51935), -(51936), -(51937), -(51940), -(51945), -(51949), -(51951), -(51961), -(51962), -(51963), -(51968), -(51973), -(51976), -(51979), -(51981), -(51989), -(51990), -(51997), -(51998), -(51999), -(52000), -(52004), -(52005), -(52007), -(52008), -(52014), -(52025), -(52026), -(52030), -(52032), -(52042), -(52043), -(52045), -(52053), -(52069), -(52078), -(52082), -(52083), -(52086), -(52088), -(52090), -(52108), -(52125), -(52139), -(52149), -(52157), -(52160), -(52163), -(52167), -(52169), -(52171), -(52187), -(52194), -(52196), -(52198), -(52199), -(52206), -(52207), -(52209), -(52210), -(52212), -(52217), -(52219), -(52221), -(52223), -(52224), -(52228), -(52229), -(52230), -(52251), -(52252), -(52253), -(52256), -(52261), -(52263), -(52265), -(52267), -(52270), -(52280), -(52282), -(52292), -(52307), -(52312), -(52318), -(52327), -(52328), -(52334), -(52345), -(52346), -(52352), -(52353), -(52355), -(52356), -(52359), -(52360), -(52361), -(52364), -(52372), -(52373), -(52374), -(52375), -(52383), -(52389), -(52391), -(52401), -(52402), -(52415), -(52425), -(52428), -(52430), -(52431), -(52433), -(52444), -(52445), -(52447), -(52460), -(52463), -(52465), -(52466), -(52468), -(52469), -(52471), -(52472), -(52473), -(52474), -(52475), -(52476), -(52486), -(52487), -(52496), -(52498), -(52499), -(52501), -(52502), -(52504), -(52506), -(52511), -(52515), -(52519), -(52521), -(52522), -(52527), -(52532), -(52534), -(52536), -(52537), -(52538), -(52540), -(52542), -(52544), -(52545), -(52546), -(52547), -(52548), -(52549), -(52554), -(52566), -(52577), -(52581), -(52583), -(52586), -(52587), -(52591), -(52594), -(52595), -(52596), -(52600), -(52601), -(52604), -(52608), -(52609), -(52610), -(52613), -(52620), -(52631), -(52633), -(52643), -(52644), -(52655), -(52657), -(52658), -(52660), -(52672), -(52675), -(52680), -(52684), -(52695), -(52696), -(52699), -(52700), -(52702), -(52705), -(52708), -(52709), -(52711), -(52713), -(52715), -(52718), -(52719), -(52721), -(52722), -(52737), -(52740), -(52741), -(52743), -(52751), -(52752), -(52754), -(52755), -(52758), -(52761), -(52762), -(52764), -(52771), -(52772), -(52773), -(52778), -(52781), -(52782), -(52784), -(52789), -(52794), -(52806), -(52807), -(52813), -(52814), -(52818), -(52825), -(52835), -(52839), -(52851), -(52856), -(52859), -(52862), -(52863), -(52864), -(52871), -(52872), -(52873), -(52883), -(52885), -(52889), -(52890), -(52904), -(52905), -(52909), -(52921), -(52926), -(52931), -(52932), -(52939), -(52943), -(52986), -(52987), -(52988), -(52992), -(52994), -(52996), -(53001), -(53002), -(53003), -(53005), -(53006), -(53007), -(53019), -(53023), -(53027), -(53031), -(53033), -(53043), -(53044), -(53045), -(53051), -(53058), -(53059), -(53060), -(53062), -(53068), -(53069), -(53070), -(53072), -(53073), -(53085), -(53086), -(53087), -(53088), -(53089), -(53094), -(53098), -(53099), -(53100), -(53101), -(53102), -(53108), -(53109), -(53111), -(53116), -(53141), -(53145), -(53148), -(53150), -(53153), -(53158), -(53174), -(53191), -(53193), -(53194), -(53195), -(53208), -(53209), -(53214), -(53254), -(53271), -(53288), -(53289), -(53301), -(53307), -(53308), -(53310), -(53311), -(53313), -(53314), -(53317), -(53318), -(53322), -(53326), -(53327), -(53329), -(53330), -(53332), -(53333), -(53335), -(53338), -(53339), -(53340), -(53346), -(53351), -(53352), -(53353), -(53357), -(53359), -(53364), -(53366), -(53372), -(53388), -(53394), -(53395), -(53396), -(53402), -(53404), -(53407), -(53408), -(53418), -(53422), -(53424), -(53425), -(53431), -(53435), -(53437), -(53438), -(53442), -(53449), -(53460), -(53477), -(53480), -(53492), -(53493), -(53498), -(53499), -(53508), -(53509), -(53526), -(53528), -(53529), -(53532), -(53533), -(53534), -(53536), -(53537), -(53538), -(53540), -(53542), -(53543), -(53544), -(53545), -(53546), -(53547), -(53548), -(53549), -(53550), -(53558), -(53559), -(53560), -(53561), -(53562), -(53564), -(53565), -(53566), -(53567), -(53568), -(53571), -(53572), -(53573), -(53574), -(53575), -(53578), -(53579), -(53580), -(53581), -(53582), -(53584), -(53586), -(53587), -(53588), -(53589), -(53595), -(53600), -(53601), -(53617), -(53618), -(53625), -(53629), -(53631), -(53633), -(53638), -(53639), -(53652), -(53653), -(53654), -(53659), -(53669), -(53697), -(53704), -(53719), -(53726), -(53733), -(53739), -(53742), -(53769), -(53772), -(53786), -(53788), -(53799), -(53807), -(53809), -(53810), -(53815), -(53821), -(53824), -(54016), -(54028), -(54029), -(54035), -(54039), -(54042), -(54049), -(54050), -(54051), -(54052), -(54053), -(54060), -(54063), -(54068), -(54070), -(54071), -(54074), -(54075), -(54076), -(54077), -(54078), -(54079), -(54080), -(54092), -(54094), -(54095), -(54096), -(54113), -(54121), -(54126), -(54129), -(54132), -(54135), -(54158), -(54169), -(54172), -(54175), -(54183), -(54185), -(54188), -(54190), -(54191), -(54195), -(54196), -(54198), -(54203), -(54216), -(54226), -(54235), -(54237), -(54238), -(54249), -(54260), -(54261), -(54273), -(54283), -(54284), -(54290), -(54299), -(54303), -(54309), -(54311), -(54315), -(54316), -(54319), -(54321), -(54324), -(54331), -(54334), -(54335), -(54337), -(54338), -(54339), -(54340), -(54345), -(54350), -(54361), -(54376), -(54378), -(54380), -(54387), -(54393), -(54394), -(54395), -(54396), -(54399), -(54416), -(54417), -(54429), -(54431), -(54433), -(54451), -(54453), -(54458), -(54459), -(54460), -(54468), -(54470), -(54479), -(54485), -(54487), -(54491), -(54495), -(54498), -(54499), -(54502), -(54504), -(54507), -(54511), -(54514), -(54518), -(54521), -(54525), -(54526), -(54527), -(54531), -(54532), -(54540), -(54549), -(54565), -(54573), -(54576), -(54577), -(54578), -(54587), -(54588), -(54593), -(54594), -(54602), -(54604), -(54609), -(54610), -(54611), -(54612), -(54613), -(54615), -(54616), -(54617), -(54618), -(54619), -(54620), -(54622), -(54624), -(54630), -(54631), -(54632), -(54634), -(54640), -(54644), -(54646), -(54648), -(54651), -(54660), -(54662), -(54663), -(54667), -(54668), -(54673), -(54675), -(54677), -(54679), -(54680), -(54688), -(54689), -(54694), -(54702), -(54703), -(54704), -(54706), -(54708), -(54709), -(54716), -(54719), -(54723), -(54755), -(54757), -(54761), -(54770), -(54772), -(54781), -(54785), -(54788), -(54790), -(54791), -(54794), -(54799), -(54801), -(54804), -(54805), -(54820), -(54822), -(54823), -(54843), -(54846), -(54880), -(54881), -(54882), -(54883), -(54884), -(54885), -(54886), -(54887), -(54900), -(54906), -(54908), -(54919), -(54920), -(54932), -(54933), -(54951), -(54956), -(54957), -(54958), -(54965), -(54970), -(54971), -(54973), -(54974), -(54975), -(54976), -(54977), -(54982), -(54983), -(54986), -(54987), -(54992), -(54997), -(55006), -(55007), -(55008), -(55009), -(55021), -(55029), -(55039), -(55041), -(55046), -(55050), -(55051), -(55054), -(55065), -(55066), -(55069), -(55070), -(55071), -(55074), -(55075), -(55078), -(55079), -(55090), -(55093), -(55095), -(55102), -(55104), -(55144), -(55160), -(55168), -(55196), -(55209), -(55210), -(55216), -(55217), -(55218), -(55219), -(55220), -(55224), -(55225), -(55226), -(55240), -(55241), -(55253), -(55255), -(55258), -(55259), -(55260), -(55261), -(55262), -(55263), -(55264), -(55265), -(55268), -(55269), -(55270), -(55271), -(55274), -(55276), -(55277), -(55281), -(55284), -(55313), -(55314), -(55317), -(55318), -(55319), -(55320), -(55321), -(55322), -(55324), -(55331), -(55334), -(55346), -(55348), -(55359), -(55360), -(55363), -(55364), -(55411), -(55412), -(55416), -(55424), -(55425), -(55430), -(55469), -(55470), -(55482), -(55483), -(55484), -(55485), -(55487), -(55488), -(55489), -(55490), -(55491), -(55492), -(55495), -(55496), -(55497), -(55498), -(55499), -(55504), -(55505), -(55506), -(55507), -(55508), -(55509), -(55511), -(55520), -(55521), -(55530), -(55536), -(55549), -(55550), -(55555), -(55556), -(55557), -(55567), -(55568), -(55569), -(55579), -(55581), -(55582), -(55597), -(55598), -(55599), -(55602), -(55604), -(55605), -(55613), -(55622), -(55624), -(55625), -(55643), -(55645), -(55646), -(55648), -(55652), -(55659), -(55700), -(55703), -(55704), -(55716), -(55719), -(55728), -(55736), -(55748), -(55749), -(55750), -(55751), -(55752), -(55753), -(55754), -(55756), -(55770), -(55771), -(55772), -(55778), -(55779), -(55780), -(55781), -(55790), -(55797), -(55802), -(55804), -(55809), -(55813), -(55815), -(55818), -(55823), -(55824), -(55838), -(55840), -(55841), -(55864), -(55874), -(55877), -(55880), -(55890), -(55894), -(55929), -(55931), -(55932), -(55933), -(55935), -(55936), -(55937), -(55939), -(55951), -(55958), -(55959), -(55960), -(55962), -(55963), -(55968), -(55973), -(55978), -(55981), -(55982), -(55983), -(55984), -(56033), -(56036), -(56038), -(56046), -(56061), -(56071), -(56072), -(56090), -(56091), -(56092), -(56098), -(56104), -(56106), -(56107), -(56112), -(56113), -(56115), -(56122), -(56123), -(56125), -(56127), -(56130), -(56131), -(56132), -(56138), -(56139), -(56141), -(56143), -(56144), -(56147), -(56149), -(56160), -(56161), -(56185), -(56190), -(56191), -(56198), -(56200), -(56211), -(56222), -(56223), -(56230), -(56236), -(56239), -(56252), -(56254), -(56260), -(56277), -(56287), -(56305), -(56320), -(56326), -(56329), -(56331), -(56332), -(56346), -(56351), -(56352), -(56361), -(56362), -(56379), -(56404), -(56405), -(56411), -(56425), -(56426), -(56430), -(56433), -(56434), -(56440), -(56442), -(56444), -(56447), -(56448), -(56485), -(56491), -(56506), -(56513), -(56515), -(56517), -(56520), -(56521), -(56525), -(56536), -(56537), -(56539), -(56545), -(56557), -(56559), -(56562), -(56564), -(56565), -(56581), -(56582), -(56584), -(56586), -(56603), -(56605), -(56606), -(56607), -(56609), -(56624), -(56626), -(56627), -(56628), -(56629), -(56630), -(56631), -(56640), -(56641), -(56645), -(56659), -(56662), -(56664), -(56666), -(56668), -(56670), -(56671), -(56672), -(56678), -(56685), -(56687), -(56698), -(56699), -(56701), -(56707), -(56715), -(56718), -(56719), -(56720), -(56721), -(56727), -(56728), -(56729), -(56730), -(56731), -(56734), -(56753), -(56754), -(56755), -(56760), -(56761), -(56770), -(56771), -(56772), -(56773), -(56774), -(56775), -(56776), -(56777), -(56780), -(56781), -(56785), -(56790), -(56791), -(56795), -(56796), -(56797), -(56815), -(56854), -(56860), -(56861), -(56862), -(56891), -(56893), -(56896), -(56898), -(56902), -(56903), -(56905), -(56906), -(56907), -(56909), -(56917), -(56918), -(56919), -(56920), -(56921), -(56922), -(56923), -(56925), -(56933), -(56937), -(56938), -(56939), -(56940), -(56966), -(56969), -(57049), -(57050), -(57052), -(57053), -(57058), -(57062), -(57063), -(57089), -(57090), -(57094), -(57095), -(57108), -(57118), -(57143), -(57292), -(57305), -(57323), -(57337), -(57346), -(57347), -(57369), -(57374), -(57376), -(57380), -(57384), -(57386), -(57388), -(57389), -(57390), -(57391), -(57392), -(57393), -(57395), -(57397), -(57402), -(57407), -(57411), -(57413), -(57420), -(57454), -(57456), -(57461), -(57464), -(57465), -(57466), -(57473), -(57480), -(57486), -(57487), -(57488), -(57490), -(57506), -(57507), -(57528), -(57530), -(57536), -(57537), -(57547), -(57548), -(57553), -(57554), -(57556), -(57573), -(57580), -(57582), -(57587), -(57589), -(57590), -(57593), -(57594), -(57596), -(57599), -(57601), -(57602), -(57603), -(57615), -(57616), -(57617), -(57620), -(57628), -(57635), -(57640), -(57641), -(57644), -(57645), -(57647), -(57648), -(57651), -(57657), -(57661), -(57665), -(57670), -(57671), -(57677), -(57679), -(57723), -(57724), -(57725), -(57745), -(57755), -(57759), -(57765), -(57766), -(57767), -(57770), -(57774), -(57775), -(57777), -(57778), -(57779), -(57780), -(57781), -(57783), -(57785), -(57787), -(57789), -(57790), -(57795), -(57799), -(57802), -(57807), -(57808), -(57823), -(57825), -(57833), -(57834), -(57838), -(57841), -(57842), -(57845), -(57846), -(57860), -(57863), -(57864), -(57871), -(57874), -(57888), -(57896), -(57897), -(57906), -(57908), -(57914), -(57921), -(57922), -(57941), -(57949), -(57951), -(57964), -(57965), -(57969), -(57970), -(57974), -(57975), -(57981), -(57984), -(57992), -(57993), -(57994), -(58012), -(58021), -(58025), -(58044), -(58054), -(58061), -(58062), -(58071), -(58106), -(58117), -(58118), -(58119), -(58151), -(58154), -(58179), -(58180), -(58181), -(58183), -(58184), -(58187), -(58194), -(58203), -(58204), -(58205), -(58207), -(58208), -(58209), -(58210), -(58211), -(58212), -(58213), -(58214), -(58215), -(58216), -(58217), -(58218), -(58219), -(58220), -(58221), -(58222), -(58223), -(58224), -(58230), -(58270), -(58282), -(58283), -(58349), -(58351), -(58352), -(58371), -(58373), -(58412), -(58418), -(58419), -(58420), -(58421), -(58438), -(58448), -(58449), -(58450), -(58451), -(58452), -(58453), -(58456), -(58457), -(58459), -(58460), -(58461), -(58462), -(58464), -(58466), -(58471), -(58475), -(58494), -(58504), -(58505), -(58508), -(58509), -(58510), -(58511), -(58513), -(58514), -(58516), -(58517), -(58518), -(58519), -(58520), -(58526), -(58529), -(58531), -(58534), -(58535), -(58537), -(58544), -(58548), -(58561), -(58563), -(58564), -(58566), -(58567), -(58597), -(58604), -(58605), -(58607), -(58608), -(58609), -(58610), -(58611), -(58612), -(58617), -(58619), -(58621), -(58622), -(58624), -(58628), -(58632), -(58633), -(58642), -(58644), -(58660), -(58663), -(58664), -(58665), -(58666), -(58667), -(58678), -(58681), -(58683), -(58684), -(58691), -(58700), -(58701), -(58702), -(58743), -(58747), -(58758), -(58769), -(58770), -(58772), -(58781), -(58782), -(58786), -(58787), -(58788), -(58797), -(58798), -(58799), -(58810), -(58811), -(58814), -(58815), -(58816), -(58817), -(58822), -(58823), -(58827), -(58829), -(58830), -(58839), -(58840), -(58843), -(58844), -(58845), -(58847), -(58849), -(58850), -(58855), -(58859), -(58861), -(58867), -(58879), -(58890), -(58896), -(58898), -(58902), -(58905), -(58912), -(58913), -(58915), -(58919), -(58921), -(58922), -(58935), -(58940), -(58941), -(58953), -(58955), -(58959), -(58961), -(58966), -(58967), -(58969), -(58971), -(58972), -(58973), -(58976), -(58978), -(58980), -(58981), -(58987), -(58988), -(58989), -(58991), -(58996), -(59001), -(59006), -(59007), -(59011), -(59013), -(59016), -(59017), -(59019), -(59020), -(59021), -(59023), -(59024), -(59025), -(59034), -(59035), -(59039), -(59040), -(59044), -(59047), -(59050), -(59051), -(59060), -(59064), -(59065), -(59069), -(59079), -(59080), -(59081), -(59082), -(59083), -(59085), -(59100), -(59102), -(59104), -(59105), -(59106), -(59109), -(59110), -(59111), -(59114), -(59119), -(59121), -(59124), -(59130), -(59131), -(59132), -(59133), -(59134), -(59138), -(59142), -(59144), -(59146), -(59147), -(59148), -(59150), -(59151), -(59153), -(59155), -(59160), -(59161), -(59163), -(59164), -(59165), -(59166), -(59167), -(59168), -(59169), -(59170), -(59171), -(59172), -(59178), -(59179), -(59180), -(59182), -(59185), -(59186), -(59187), -(59191), -(59192), -(59199), -(59209), -(59210), -(59211), -(59215), -(59220), -(59223), -(59225), -(59226), -(59228), -(59233), -(59235), -(59237), -(59239), -(59241), -(59242), -(59243), -(59244), -(59246), -(59247), -(59248), -(59249), -(59251), -(59252), -(59254), -(59256), -(59257), -(59259), -(59260), -(59261), -(59262), -(59263), -(59264), -(59265), -(59268), -(59269), -(59270), -(59271), -(59273), -(59280), -(59288), -(59290), -(59300), -(59304), -(59318), -(59319), -(59324), -(59325), -(59329), -(59330), -(59331), -(59342), -(59343), -(59344), -(59346), -(59347), -(59348), -(59350), -(59351), -(59352), -(59355), -(59357), -(59359), -(59361), -(59362), -(59364), -(59367), -(59371), -(59373), -(59374), -(59376), -(59381), -(59389), -(59391), -(59392), -(59395), -(59397), -(59398), -(59399), -(59400), -(59401), -(59402), -(59408), -(59409), -(59412), -(59413), -(59423), -(59432), -(59434), -(59439), -(59444), -(59448), -(59455), -(59460), -(59467), -(59468), -(59471), -(59482), -(59485), -(59513), -(59515), -(59517), -(59519), -(59520), -(59525), -(59530), -(59542), -(59543), -(59544), -(59545), -(59547), -(59548), -(59557), -(59558), -(59563), -(59575), -(59577), -(59590), -(59593), -(59594), -(59599), -(59603), -(59604), -(59605), -(59606), -(59607), -(59608), -(59610), -(59611), -(59616), -(59617), -(59633), -(59634), -(59637), -(59638), -(59651), -(59653), -(59656), -(59661), -(59663), -(59679), -(59682), -(59683), -(59684), -(59685), -(59691), -(59695), -(59696), -(59700), -(59703), -(59710), -(59712), -(59713), -(59715), -(59716), -(59717), -(59718), -(59723), -(59727), -(59735), -(59736), -(59742), -(59743), -(59746), -(59750), -(59760), -(59762), -(59763), -(59765), -(59766), -(59767), -(59769), -(59779), -(59795), -(59805), -(59812), -(59813), -(59814), -(59815), -(59817), -(59823), -(59826), -(59827), -(59832), -(59839), -(59840), -(59841), -(59844), -(59846), -(59851), -(59852), -(59855), -(59856), -(59863), -(59864), -(59877), -(59879), -(59881), -(59882), -(59883), -(59884), -(59885), -(59886), -(59894), -(59901), -(59921), -(59963), -(59965), -(59972), -(59974), -(59978), -(59982), -(59984), -(59985), -(59986), -(59987), -(59988), -(59989), -(59991), -(59992), -(59993), -(59994), -(59997), -(59999), -(60003), -(60004), -(60005), -(60006), -(60008), -(60009), -(60011), -(60012), -(60013), -(60015), -(60016), -(60017), -(60018), -(60032), -(60035), -(60039), -(60041), -(60043), -(60051), -(60052), -(60053), -(60067), -(60073), -(60076), -(60078), -(60079), -(60080), -(60085), -(60089), -(60100), -(60103), -(60106), -(60107), -(60111), -(60112), -(60115), -(60117), -(60122), -(60123), -(60127), -(60129), -(60181), -(60183), -(60186), -(60194), -(60195), -(60197), -(60203), -(60204), -(60210), -(60211), -(60212), -(60229), -(60233), -(60234), -(60235), -(60236), -(60239), -(60241), -(60300), -(60307), -(60309), -(60339), -(60351), -(60352), -(60428), -(60431), -(60432), -(60433), -(60440), -(60443), -(60446), -(60447), -(60450), -(60452), -(60453), -(60472), -(60474), -(60483), -(60488), -(60500), -(60504), -(60505), -(60506), -(60518), -(60526), -(60530), -(60540), -(60541), -(60542), -(60578), -(60580), -(60585), -(60588), -(60590), -(60626), -(60642), -(60644), -(60646), -(60654), -(60672), -(60678), -(60682), -(60683), -(60699), -(60708), -(60742), -(60753), -(60781), -(60782), -(60784), -(60785), -(60786), -(60790), -(60802), -(60803), -(60805), -(60809), -(60814), -(60817), -(60842), -(60844), -(60850), -(60856), -(60857), -(60859), -(60868), -(60869), -(60870), -(60871), -(60872), -(60873), -(60876), -(60880), -(60882), -(60890), -(60896), -(60897), -(60898), -(60899), -(60900), -(60901), -(60905), -(60906), -(60917), -(60918), -(60924), -(60926), -(60927), -(60930), -(60932), -(60935), -(60940), -(60941), -(60944), -(60945), -(60946), -(60947), -(60949), -(60950), -(60951), -(60952), -(60954), -(60959), -(60961), -(60962), -(60963), -(60965), -(60968), -(60972), -(60973), -(60979), -(60980), -(60981), -(60982), -(60983), -(60988), -(60991), -(60995), -(61001), -(61005), -(61006), -(61016), -(61018), -(61024), -(61025), -(61029), -(61034), -(61036), -(61039), -(61041), -(61042), -(61046), -(61048), -(61051), -(61064), -(61070), -(61077), -(61080), -(61083), -(61087), -(61091), -(61094), -(61100), -(61101), -(61103), -(61109), -(61110), -(61111), -(61115), -(61123), -(61124), -(61127), -(61129), -(61133), -(61140), -(61143), -(61159), -(61160), -(61162), -(61164), -(61166), -(61168), -(61171), -(61172), -(61173), -(61176), -(61178), -(61182), -(61186), -(61187), -(61191), -(61193), -(61194), -(61195), -(61196), -(61197), -(61198), -(61209), -(61211), -(61213), -(61215), -(61218), -(61223), -(61226), -(61242), -(61243), -(61244), -(61253), -(61259), -(61260), -(61263), -(61269), -(61272), -(61281), -(61282), -(61286), -(61287), -(61291), -(61295), -(61296), -(61299), -(61300), -(61301), -(61302), -(61305), -(61314), -(61319), -(61320), -(61326), -(61327), -(61343), -(61344), -(61347), -(61352), -(61358), -(61372), -(61373), -(61374), -(61375), -(61380), -(61381), -(61382), -(61385), -(61395), -(61398), -(61399), -(61409), -(61411), -(61415), -(61419), -(61420), -(61421), -(61423), -(61424), -(61443), -(61445), -(61448), -(61454), -(61457), -(61461), -(61466), -(61474), -(61479), -(61480), -(61486), -(61490), -(61491), -(61493), -(61507), -(61511), -(61512), -(61515), -(61528), -(61545), -(61549), -(61550), -(61552), -(61554), -(61556), -(61558), -(61561), -(61562), -(61563), -(61565), -(61567), -(61569), -(61572), -(61579), -(61584), -(61590), -(61592), -(61593), -(61596), -(61597), -(61599), -(61600), -(61601), -(61604), -(61606), -(61607), -(61613), -(61621), -(61623), -(61624), -(61626), -(61627), -(61628), -(61634), -(61635), -(61662), -(61663), -(61666), -(61667), -(61668), -(61676), -(61685), -(61696), -(61705), -(61712), -(61716), -(61721), -(61728), -(61729), -(61730), -(61733), -(61747), -(61767), -(61780), -(61781), -(61789), -(61791), -(61793), -(61794), -(61795), -(61796), -(61797), -(61798), -(61799), -(61800), -(61801), -(61802), -(61804), -(61805), -(61806), -(61807), -(61808), -(61815), -(61817), -(61819), -(61821), -(61822), -(61823), -(61824), -(61825), -(61832), -(61833), -(61834), -(61835), -(61836), -(61837), -(61838), -(61839), -(61840), -(61841), -(61842), -(61843), -(61844), -(61845), -(61849), -(61857), -(61859), -(61862), -(61866), -(61868), -(61870), -(61873), -(61879), -(61880), -(61881), -(61888), -(61893), -(61895), -(61896), -(61897), -(61903), -(61909), -(61911), -(61912), -(61923), -(61924), -(61925), -(61926), -(61927), -(61928), -(61929), -(61965), -(61967), -(61973), -(61998), -(62014), -(62026), -(62030), -(62036), -(62053), -(62063), -(62078), -(62089), -(62103), -(62105), -(62117), -(62118), -(62119), -(62120), -(62121), -(62122), -(62124), -(62128), -(62129), -(62130), -(62131), -(62138), -(62167), -(62169), -(62195), -(62198), -(62204), -(62225), -(62226), -(62249), -(62250), -(62261), -(62264), -(62265), -(62280), -(62292), -(62298), -(62305), -(62309), -(62310), -(62312), -(62315), -(62316), -(62317), -(62318), -(62322), -(62326), -(62327), -(62328), -(62331), -(62332), -(62333), -(62334), -(62335), -(62342), -(62347), -(62354), -(62356), -(62368), -(62372), -(62373), -(62382), -(62395), -(62401), -(62402), -(62415), -(62417), -(62418), -(62420), -(62441), -(62442), -(62443), -(62444), -(62445), -(62446), -(62455), -(62456), -(62466), -(62479), -(62482), -(62503), -(62507), -(62526), -(62531), -(62536), -(62540), -(62544), -(62554), -(62563), -(62575), -(62581), -(62583), -(62589), -(62601), -(62607), -(62608), -(62611), -(62613), -(62614), -(62626), -(62638), -(62648), -(62649), -(62653), -(62658), -(62672), -(62673), -(62707), -(62708), -(62711), -(62717), -(62722), -(62726), -(62732), -(62767), -(62768), -(62769), -(62793), -(62796), -(62806), -(62832), -(62836), -(62844), -(62845), -(62846), -(62854), -(62855), -(62863), -(62867), -(62874), -(62875), -(62881), -(62900), -(62901), -(62902), -(62903), -(62904), -(62928), -(62935), -(62938), -(62939), -(62960), -(62961), -(62989), -(62997), -(62998), -(63003), -(63010), -(63012), -(63028), -(63034), -(63035), -(63036), -(63047), -(63082), -(63094), -(63103), -(63104), -(63105), -(63111), -(63112), -(63120), -(63124), -(63125), -(63126), -(63127), -(63134), -(63136), -(63138), -(63147), -(63151), -(63169), -(63171), -(63172), -(63174), -(63175), -(63177), -(63178), -(63179), -(63180), -(63183), -(63184), -(63185), -(63216), -(63221), -(63226), -(63228), -(63233), -(63240), -(63242), -(63259), -(63276), -(63278), -(63301), -(63311), -(63313), -(63314), -(63315), -(63316), -(63336), -(63337), -(63338), -(63344), -(63345), -(63356), -(63359), -(63361), -(63362), -(63363), -(63380), -(63382), -(63413), -(63416), -(63418), -(63459), -(63462), -(63463), -(63464), -(63465), -(63466), -(63468), -(63477), -(63479), -(63487), -(63493), -(63494), -(63495), -(63511), -(63518), -(63519), -(63529), -(63535), -(63536), -(63544), -(63549), -(63550), -(63551), -(63553), -(63556), -(63559), -(63562), -(63564), -(63569), -(63571), -(63573), -(63575), -(63599), -(63605), -(63612), -(63615), -(63619), -(63652), -(63653), -(63654), -(63655), -(63661), -(63668), -(63669), -(63670), -(63671), -(63672), -(63673), -(63675), -(63678), -(63685), -(63689), -(63691), -(63699), -(63700), -(63716), -(63728), -(63736), -(63738), -(63754), -(63755), -(63759), -(63760), -(63789), -(63803), -(63804), -(63809), -(63815), -(63823), -(63825), -(63827), -(63845), -(63846), -(63852), -(63861), -(63913), -(63914), -(63915), -(63916), -(63917), -(63918), -(63919), -(63920), -(63921), -(63922), -(63923), -(63931), -(63980), -(63989), -(63993), -(63995), -(63997), -(63998), -(64003), -(64005), -(64006), -(64014), -(64024), -(64025), -(64026), -(64027), -(64028), -(64029), -(64030), -(64031), -(64032), -(64034), -(64036), -(64039), -(64044), -(64058), -(64065), -(64085), -(64090), -(64097), -(64102), -(64104), -(64107), -(64113), -(64114), -(64115), -(64119), -(64123), -(64128), -(64134), -(64136), -(64138), -(64142), -(64151), -(64152), -(64153), -(64156), -(64157), -(64159), -(64160), -(64186), -(64204), -(64211), -(64212), -(64213), -(64215), -(64230), -(64269), -(64324), -(64328), -(64330), -(64331), -(64332), -(64333), -(64334), -(64335), -(64336), -(64337), -(64338), -(64339), -(64342), -(64346), -(64363), -(64365), -(64367), -(64374), -(64375), -(64376), -(64377), -(64380), -(64382), -(64387), -(64388), -(64390), -(64391), -(64395), -(64396), -(64412), -(64413), -(64429), -(64430), -(64442), -(64467), -(64478), -(64496), -(64499), -(64501), -(64507), -(64528), -(64529), -(64535), -(64542), -(64552), -(64580), -(64583), -(64588), -(64590), -(64591), -(64592), -(64595), -(64627), -(64637), -(64638), -(64640), -(64646), -(64647), -(64648), -(64649), -(64654), -(64665), -(64666), -(64667), -(64668), -(64669), -(64674), -(64682), -(64686), -(64692), -(64696), -(64698), -(64699), -(64705), -(64719), -(64740), -(64757), -(64758), -(64759), -(64766), -(64768), -(64771), -(64773), -(64776), -(64780), -(64787), -(64795), -(64798), -(64801), -(64806), -(64807), -(64821), -(64841), -(64870), -(64874), -(64876), -(64888), -(64891), -(64903), -(64909), -(64918), -(64930), -(64953), -(64967), -(64970), -(64971), -(64974), -(64978), -(64991), -(65030), -(65031), -(65033), -(65035), -(65036), -(65038), -(65039), -(65040), -(65042), -(65054), -(65055), -(65056), -(65057), -(65058), -(65059), -(65061), -(65062), -(65071), -(65080), -(65081), -(65104), -(65111), -(65113), -(65122), -(65123), -(65131), -(65133), -(65147), -(65162), -(65201), -(65210), -(65240), -(65266), -(65280), -(65343), -(65351), -(65359), -(65360), -(65374), -(65378), -(65379), -(65386), -(65391), -(65392), -(65403), -(65431), -(65488), -(65490), -(65492), -(65502), -(65503), -(65512), -(65513), -(65516), -(65531), -(65532), -(65541), -(65542), -(65545), -(65546), -(65564), -(65565), -(65575), -(65576), -(65577), -(65634), -(65635), -(65636), -(65647), -(65648), -(65693), -(65694), -(65703), -(65720), -(65722), -(65723), -(65728), -(65729), -(65744), -(65754), -(65775), -(65778), -(65782), -(65790), -(65791), -(65799), -(65801), -(65807), -(65809), -(65810), -(65812), -(65813), -(65814), -(65815), -(65819), -(65820), -(65821), -(65825), -(65826), -(65854), -(65855), -(65856), -(65857), -(65859), -(65862), -(65863), -(65866), -(65867), -(65868), -(65877), -(65878), -(65881), -(65883), -(65918), -(65924), -(65926), -(65927), -(65929), -(65930), -(65931), -(65934), -(65935), -(65936), -(65940), -(65941), -(65954), -(65957), -(65960), -(65962), -(65970), -(65971), -(65972), -(65973), -(65974), -(65978), -(65987), -(65998), -(66003), -(66005), -(66007), -(66008), -(66009), -(66012), -(66017), -(66018), -(66019), -(66020), -(66021), -(66042), -(66043), -(66045), -(66047), -(66053), -(66054), -(66055), -(66056), -(66057), -(66063), -(66065), -(66066), -(66067), -(66068), -(66069), -(66070), -(66072), -(66075), -(66079), -(66081), -(66093), -(66095), -(66097), -(66099), -(66100), -(66104), -(66109), -(66112), -(66113), -(66114), -(66115), -(66116), -(66125), -(66126), -(66134), -(66154), -(66177), -(66188), -(66196), -(66197), -(66198), -(66206), -(66207), -(66209), -(66213), -(66215), -(66216), -(66217), -(66236), -(66237), -(66240), -(66243), -(66244), -(66245), -(66250), -(66259), -(66260), -(66261), -(66262), -(66265), -(66283), -(66285), -(66290), -(66291), -(66292), -(66293), -(66294), -(66295), -(66313), -(66326), -(66331), -(66334), -(66342), -(66359), -(66377), -(66378), -(66407), -(66408), -(66409), -(66410), -(66417), -(66420), -(66423), -(66425), -(66457), -(66460), -(66461), -(66474), -(66477), -(66479), -(66480), -(66481), -(66489), -(66493), -(66516), -(66528), -(66532), -(66533), -(66536), -(66537), -(66538), -(66548), -(66549), -(66588), -(66592), -(66593), -(66594), -(66595), -(66596), -(66613), -(66619), -(66620), -(66629), -(66638), -(66666), -(66668), -(66669), -(66686), -(66687), -(66688), -(66689), -(66716), -(66717), -(66719), -(66733), -(66735), -(66736), -(66742), -(66744), -(66765), -(66770), -(66773), -(66777), -(66784), -(66796), -(66797), -(66809), -(66813), -(66823), -(66824), -(66863), -(66867), -(66869), -(66879), -(66880), -(66887), -(66888), -(66890), -(66891), -(66892), -(66899), -(66903), -(66904), -(66922), -(66940), -(66941), -(66950), -(66951), -(66952), -(66953), -(66954), -(66955), -(66957), -(66958), -(66959), -(66960), -(66961), -(66962), -(66963), -(66964), -(66965), -(66972), -(66973), -(66974), -(66975), -(66976), -(66977), -(66978), -(66979), -(66988), -(66989), -(66990), -(66991), -(66992), -(66994), -(67029), -(67030), -(67031), -(67033), -(67035), -(67049), -(67050), -(67051), -(67073), -(67074), -(67075), -(67088), -(67089), -(67090), -(67097), -(67098), -(67099), -(67114), -(67148), -(67229), -(67235), -(67237), -(67247), -(67252), -(67253), -(67280), -(67289), -(67290), -(67309), -(67310), -(67311), -(67312), -(67313), -(67314), -(67324), -(67325), -(67330), -(67331), -(67333), -(67366), -(67372), -(67373), -(67387), -(67390), -(67477), -(67478), -(67479), -(67480), -(67481), -(67485), -(67518), -(67519), -(67528), -(67529), -(67530), -(67531), -(67532), -(67533), -(67534), -(67540), -(67542), -(67550), -(67554), -(67560), -(67573), -(67574), -(67577), -(67606), -(67607), -(67608), -(67612), -(67613), -(67614), -(67618), -(67619), -(67620), -(67624), -(67625), -(67626), -(67632), -(67633), -(67634), -(67650), -(67651), -(67652), -(67654), -(67655), -(67656), -(67674), -(67675), -(67676), -(67678), -(67679), -(67680), -(67686), -(67703), -(67708), -(67709), -(67710), -(67714), -(67718), -(67719), -(67721), -(67722), -(67724), -(67725), -(67730), -(67745), -(67749), -(67760), -(67767), -(67772), -(67773), -(67774), -(67793), -(67799), -(67810), -(67811), -(67817), -(67818), -(67819), -(67821), -(67823), -(67830), -(67834), -(67835), -(67836), -(67837), -(67838), -(67846), -(67847), -(67861), -(67862), -(67863), -(67878), -(67879), -(67880), -(67881), -(67882), -(67883), -(67884), -(67885), -(67891), -(67892), -(67905), -(67906), -(67907), -(67929), -(67930), -(67931), -(67932), -(67933), -(67934), -(67935), -(67936), -(67937), -(67938), -(67939), -(67940), -(67941), -(67942), -(67943), -(67944), -(67945), -(67946), -(67947), -(67948), -(67949), -(67951), -(67952), -(67953), -(67957), -(67958), -(67959), -(67965), -(67966), -(67967), -(67968), -(67969), -(67970), -(67971), -(67972), -(67973), -(67977), -(67978), -(67979), -(67980), -(67981), -(67982), -(67983), -(67984), -(67985), -(67988), -(67989), -(67990), -(67991), -(67992), -(67993), -(67994), -(67995), -(67996), -(67997), -(67998), -(67999), -(68003), -(68004), -(68005), -(68008), -(68009), -(68010), -(68011), -(68012), -(68013), -(68014), -(68015), -(68016), -(68017), -(68018), -(68019), -(68023), -(68024), -(68025), -(68026), -(68027), -(68028), -(68032), -(68033), -(68034), -(68035), -(68036), -(68037), -(68038), -(68039), -(68040), -(68042), -(68043), -(68044), -(68055), -(68073), -(68077), -(68078), -(68081), -(68088), -(68089), -(68090), -(68091), -(68092), -(68093), -(68094), -(68095), -(68096), -(68100), -(68101), -(68102), -(68106), -(68107), -(68108), -(68109), -(68110), -(68111), -(68112), -(68113), -(68114), -(68115), -(68116), -(68117), -(68118), -(68119), -(68120), -(68123), -(68124), -(68125), -(68130), -(68133), -(68134), -(68135), -(68136), -(68137), -(68138), -(68139), -(68140), -(68141), -(68148), -(68149), -(68150), -(68151), -(68152), -(68153), -(68154), -(68155), -(68156), -(68157), -(68158), -(68159), -(68272), -(68282), -(68284), -(68301), -(68306), -(68307), -(68310), -(68311), -(68313), -(68315), -(68317), -(68318), -(68319), -(68321), -(68328), -(68333), -(68334), -(68340), -(68341), -(68350), -(68357), -(68362), -(68363), -(68364), -(68365), -(68372), -(68391), -(68415), -(68458), -(68472), -(68478), -(68479), -(68498), -(68501), -(68502), -(68503), -(68504), -(68505), -(68550), -(68551), -(68586), -(68587), -(68588), -(68607), -(68621), -(68622), -(68623), -(68624), -(68625), -(68626), -(68627), -(68628), -(68629), -(68727), -(68753), -(68754), -(68755), -(68756), -(68757), -(68758), -(68762), -(68763), -(68764), -(68778), -(68781), -(68782), -(68783), -(68784), -(68788), -(68799), -(68812), -(68834), -(68839), -(68841), -(68843), -(68868), -(68879), -(68884), -(68900), -(68915), -(68927), -(68934), -(68948), -(68966), -(68971), -(68980), -(68982), -(68984), -(68985), -(68991), -(69000), -(69003), -(69021), -(69023), -(69028), -(69034), -(69038), -(69051), -(69058), -(69063), -(69065), -(69066), -(69067), -(69068), -(69088), -(69091), -(69124), -(69128), -(69130), -(69131), -(69133), -(69137), -(69138), -(69153), -(69155), -(69156), -(69158), -(69160), -(69172), -(69180), -(69181), -(69189), -(69190), -(69198), -(69200), -(69209), -(69210), -(69211), -(69212), -(69218), -(69222), -(69232), -(69243), -(69246), -(69274), -(69275), -(69276), -(69285), -(69308), -(69342), -(69352), -(69387), -(69389), -(69391), -(69397), -(69398), -(69403), -(69404), -(69405), -(69406), -(69409), -(69410), -(69416), -(69420), -(69427), -(69438), -(69445), -(69455), -(69483), -(69489), -(69492), -(69496), -(69497), -(69498), -(69499), -(69500), -(69501), -(69503), -(69504), -(69520), -(69528), -(69542), -(69543), -(69544), -(69548), -(69563), -(69564), -(69566), -(69567), -(69569), -(69570), -(69572), -(69573), -(69574), -(69576), -(69577), -(69578), -(69579), -(69581), -(69583), -(69603), -(69617), -(69623), -(69627), -(69633), -(69644), -(69651), -(69668), -(69672), -(69673), -(69675), -(69681), -(69692), -(69693), -(69696), -(69699), -(69710), -(69722), -(69724), -(69726), -(69729), -(69730), -(69731), -(69733), -(69734), -(69771), -(69772), -(69779), -(69828), -(69837), -(69856), -(69861), -(69866), -(69869), -(69871), -(69882), -(69889), -(69891), -(69892), -(69893), -(69896), -(69898), -(69899), -(69902), -(69903), -(69906), -(69910), -(69911), -(69912), -(69916), -(69917), -(69920), -(69923), -(69926), -(69927), -(69933), -(69956), -(69958), -(69961), -(69963), -(69967), -(69968), -(69969), -(69970), -(69972), -(69973), -(69974), -(69975), -(69984), -(69989), -(70002), -(70043), -(70070), -(70074), -(70080), -(70110), -(70119), -(70122), -(70126), -(70141), -(70144), -(70153), -(70161), -(70162), -(70182), -(70183), -(70191), -(70192), -(70196), -(70205), -(70208), -(70211), -(70213), -(70227), -(70269), -(70270), -(70271), -(70273), -(70275), -(70276), -(70277), -(70278), -(70279), -(70280), -(70281), -(70282), -(70285), -(70289), -(70292), -(70296), -(70302), -(70304), -(70308), -(70309), -(70320), -(70322), -(70327), -(70333), -(70337), -(70355), -(70361), -(70381), -(70386), -(70387), -(70388), -(70391), -(70393), -(70396), -(70400), -(70408), -(70409), -(70410), -(70423), -(70428), -(70429), -(70432), -(70435), -(70437), -(70445), -(70449), -(70451), -(70453), -(70495), -(70510), -(70516), -(70525), -(70538), -(70539), -(70540), -(70542), -(70583), -(70594), -(70599), -(70616), -(70639), -(70640), -(70645), -(70646), -(70648), -(70653), -(70656), -(70659), -(70698), -(70746), -(70751), -(70754), -(70772), -(70781), -(70802), -(70809), -(70821), -(70838), -(70856), -(70857), -(70858), -(70859), -(70860), -(70861), -(70864), -(70867), -(70886), -(70890), -(70895), -(70896), -(70897), -(70906), -(70917), -(70923), -(70928), -(70929), -(70942), -(70946), -(70964), -(70965), -(70971), -(70972), -(70973), -(70974), -(70980), -(71003), -(71004), -(71005), -(71006), -(71020), -(71021), -(71023), -(71038), -(71040), -(71041), -(71087), -(71089), -(71090), -(71103), -(71107), -(71108), -(71112), -(71116), -(71117), -(71119), -(71120), -(71121), -(71124), -(71126), -(71127), -(71129), -(71130), -(71131), -(71133), -(71135), -(71136), -(71138), -(71140), -(71141), -(71142), -(71143), -(71144), -(71145), -(71146), -(71148), -(71153), -(71154), -(71155), -(71157), -(71163), -(71164), -(71169), -(71203), -(71204), -(71237), -(71248), -(71253), -(71254), -(71257), -(71264), -(71289), -(71291), -(71296), -(71297), -(71298), -(71316), -(71317), -(71318), -(71319), -(71326), -(71327), -(71328), -(71330), -(71331), -(71335), -(71339), -(71340), -(71350), -(71361), -(71362), -(71363), -(71392), -(71405), -(71410), -(71420), -(71433), -(71434), -(71443), -(71446), -(71450), -(71459), -(71462), -(71466), -(71473), -(71475), -(71476), -(71477), -(71478), -(71479), -(71480), -(71488), -(71489), -(71490), -(71500), -(71501), -(71504), -(71510), -(71512), -(71522), -(71532), -(71533), -(71539), -(71544), -(71546), -(71547), -(71548), -(71549), -(71551), -(71552), -(71553), -(71554), -(71590), -(71591), -(71594), -(71595), -(71607), -(71623), -(71624), -(71625), -(71626), -(71646), -(71647), -(71686), -(71687), -(71688), -(71713), -(71715), -(71726), -(71727), -(71728), -(71729), -(71738), -(71745), -(71748), -(71750), -(71752), -(71757), -(71758), -(71759), -(71760), -(71778), -(71779), -(71780), -(71781), -(71782), -(71783), -(71784), -(71785), -(71786), -(71788), -(71789), -(71801), -(71806), -(71807), -(71815), -(71818), -(71819), -(71820), -(71821), -(71822), -(71823), -(71824), -(71825), -(71834), -(71838), -(71839), -(71841), -(71842), -(71847), -(71864), -(71866), -(71874), -(71879), -(71909), -(71923), -(71924), -(71925), -(71926), -(71927), -(71928), -(71930), -(71931), -(71932), -(71933), -(71934), -(71936), -(71937), -(71938), -(71951), -(71954), -(71955), -(71972), -(71988), -(72004), -(72005), -(72007), -(72008), -(72010), -(72021), -(72022), -(72023), -(72024), -(72057), -(72065), -(72066), -(72098), -(72106), -(72120), -(72121), -(72123), -(72124), -(72133), -(72163), -(72164), -(72166), -(72167), -(72171), -(72194), -(72196), -(72198), -(72208), -(72211), -(72218), -(72219), -(72222), -(72231), -(72258), -(72264), -(72265), -(72266), -(72267), -(72268), -(72269), -(72293), -(72301), -(72302), -(72303), -(72304), -(72313), -(72318), -(72319), -(72321), -(72322), -(72324), -(72326), -(72327), -(72329), -(72330), -(72333), -(72334), -(72335), -(72336), -(72360), -(72366), -(72367), -(72368), -(72369), -(72373), -(72400), -(72409), -(72410), -(72421), -(72422), -(72423), -(72424), -(72426), -(72427), -(72434), -(72437), -(72447), -(72448), -(72449), -(72451), -(72453), -(72457), -(72463), -(72465), -(72484), -(72485), -(72486), -(72487), -(72488), -(72489), -(72490), -(72491), -(72492), -(72501), -(72502), -(72503), -(72504), -(72531), -(72539), -(72540), -(72541), -(72551), -(72552), -(72553), -(72556), -(72558), -(72566), -(72567), -(72568), -(72569), -(72570), -(72571), -(72586), -(72588), -(72590), -(72597), -(72613), -(72617), -(72645), -(72671), -(72672), -(72688), -(72728), -(72756), -(72796), -(72797), -(72798), -(72804), -(72805), -(72806), -(72809), -(72810), -(72811), -(72847), -(72848), -(72865), -(72875), -(72876), -(72879), -(72883), -(72898), -(72901), -(72930), -(72960), -(72961), -(72963), -(72964), -(72965), -(72966), -(72967), -(72985), -(72995), -(73003), -(73040), -(73075), -(73076), -(73079), -(73395), -(73412), -(73488), -(73489), -(73491), -(73492), -(73499), -(73536), -(73574), -(73712), -(73771), -(73772), -(73782), -(73783), -(73784), -(73788), -(73789), -(73790), -(73797), -(73798), -(73799), -(73830), -(73832), -(73833), -(73879), -(73896), -(73906), -(73912), -(73913), -(73914), -(73943), -(73952), -(73985), -(74035), -(74046), -(74062), -(74080), -(74111), -(74162), -(74163), -(74164), -(74166), -(74184), -(74185), -(74222), -(74307), -(74325), -(74326), -(74327), -(74347), -(74367), -(74394), -(74395), -(74403), -(74404), -(74413), -(74414), -(74417), -(74421), -(74422), -(74424), -(74438), -(74445), -(74451), -(74453), -(74454), -(74470), -(74485), -(74502), -(74506), -(74507), -(74524), -(74562), -(74710), -(74749), -(74762), -(74768), -(74772), -(74774), -(74792), -(74797), -(74807), -(74812), -(74904), -(74905), -(74913), -(74978), -(74982), -(75055), -(75058), -(75082), -(75086), -(75088), -(75102), -(75159), -(75160), -(75161), -(75163), -(75168), -(75182), -(75185), -(75186), -(75188), -(75209), -(75213), -(75234), -(75314), -(75327), -(75329), -(75330), -(75331), -(75332), -(75362), -(75366), -(75367), -(75382), -(75383), -(75384), -(75412), -(75419), -(75421), -(75422), -(75423), -(75434), -(75459), -(75493), -(75494), -(75648), -(75731), -(75760), -(75780), -(75888), -(75889), -(75953), -(76096), -(76221), -(79187), -(79397); -CREATE TABLE `temp_cond_vals` -( - `spellId` INT(11), - `elseGroup` INT(11) AUTO_INCREMENT, - `entry` INT(11), - `dead` INT(11), - `errorTextId` INT(11), - `comment` VARCHAR(255), - PRIMARY KEY (`spellId`, `elseGroup`) -) ENGINE=MYISAM; - -CREATE TABLE `temp_item_spell` -( - `itemId` INT(11), - `spellId` INT(11), - PRIMARY KEY (`itemId`, `spellId`) -); - -CREATE TABLE `temp_item` -( - `itemId` INT(11), - PRIMARY KEY (`itemId`) -); - -INSERT INTO `temp_item` SELECT DISTINCT `SourceEntry` FROM `conditions` WHERE `SourceTypeOrReferenceId` = 18; -INSERT IGNORE INTO `temp_item_spell` SELECT `entry`, `spellid_1` FROM `item_template` WHERE `entry` IN (SELECT * FROM `temp_item`) AND `spellid_1` IN (SELECT * FROM `temp_convert_spells`); -INSERT IGNORE INTO `temp_item_spell` SELECT `entry`, `spellid_2` FROM `item_template` WHERE `entry` IN (SELECT * FROM `temp_item`) AND `spellid_2` IN (SELECT * FROM `temp_convert_spells`); -INSERT IGNORE INTO `temp_item_spell` SELECT `entry`, `spellid_3` FROM `item_template` WHERE `entry` IN (SELECT * FROM `temp_item`) AND `spellid_3` IN (SELECT * FROM `temp_convert_spells`); -INSERT IGNORE INTO `temp_item_spell` SELECT `entry`, `spellid_4` FROM `item_template` WHERE `entry` IN (SELECT * FROM `temp_item`) AND `spellid_4` IN (SELECT * FROM `temp_convert_spells`); -INSERT IGNORE INTO `temp_item_spell` SELECT `entry`, `spellid_5` FROM `item_template` WHERE `entry` IN (SELECT * FROM `temp_item`) AND `spellid_5` IN (SELECT * FROM `temp_convert_spells`); - -INSERT INTO `temp_cond_vals` (`spellId`, `entry`, `dead`, `errorTextId`, `comment`) SELECT DISTINCT (SELECT `spellId` FROM `temp_item_spell` WHERE `itemId` = `SourceEntry`), `ConditionValue2`, (`ConditionValue1` - 1), `ErrorTextId`, `Comment` FROM `conditions` -WHERE `SourceTypeOrReferenceId` = 18; - -#use CONDITION_OBJECT_ENTRY instead of CONDITION_ITEM_TARGET -INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `Comment`) -SELECT DISTINCT 17, 0, `spellId`, 0, `elseGroup` - 1, 31, 1, 3, `entry`, 0, 0, `errorTextId`, `comment` FROM `temp_cond_vals`; -#for CONDITION_ITEM_TARGET with ConditionValue1 = DEAD we're adding !CONDITION_ALIVE as a second requirement -INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `Comment`) -SELECT DISTINCT 17, 0, `spellId`, 0, `elseGroup` - 1, 36, 1, 0, 0, 0, 1, `errorTextId`, `comment` FROM `temp_cond_vals` WHERE `dead`; -#remove entries which could be converted by this sql -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 18 AND `SourceEntry` IN (SELECT `itemId` FROM `temp_item_spell`); -DROP TABLE `temp_convert_spells`; -DROP TABLE `temp_cond_vals`; -DROP TABLE `temp_item_spell`; -DROP TABLE `temp_item`; - -ALTER TABLE conditions DROP PRIMARY KEY; -ALTER TABLE conditions ADD PRIMARY KEY (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`); diff --git a/sql/updates/world/2012_02_16_01_world_conditions.sql b/sql/updates/world/2012_02_16_01_world_conditions.sql deleted file mode 100644 index 4bcf997b8e4..00000000000 --- a/sql/updates/world/2012_02_16_01_world_conditions.sql +++ /dev/null @@ -1,3 +0,0 @@ -UPDATE `conditions` SET ConditionValue3 = 0, ConditionTarget = 1 WHERE ConditionTypeOrReference = 1 AND ConditionValue3 = 1; -UPDATE `conditions` SET ConditionTypeOrReference = 31, ConditionValue2 = ConditionValue1, ConditionValue1 = 3, ConditionTarget = 1 WHERE ConditionTypeOrReference = 19; -UPDATE `conditions` SET ConditionTypeOrReference = 38, ConditionValue2 = 4, ConditionTarget = 1 WHERE ConditionTypeOrReference = 20; diff --git a/sql/updates/world/2012_02_17_00_world_waypoints.sql b/sql/updates/world/2012_02_17_00_world_waypoints.sql deleted file mode 100644 index 1cff86f5d51..00000000000 --- a/sql/updates/world/2012_02_17_00_world_waypoints.sql +++ /dev/null @@ -1,77 +0,0 @@ --- Pathing for Eye of Thrallmar -SET @NPC :=57585; -SET @PATH :=@NPC*10; -UPDATE `creature` SET `position_x`=203.191,`position_y`=2850.286,`position_z`=160.4257,`spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC; -DELETE FROM `creature_addon` WHERE `guid`=@NPC; -INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); -DELETE FROM `waypoint_data` WHERE `id`=@PATH; -INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES -(@PATH,1,197.9876,2842.495,160.4257,0,0,0,100,0), -(@PATH,2,212.5493,2807.971,174.2035,0,0,0,100,0), -(@PATH,3,244.0748,2812.302,156.8424,0,0,0,100,0), -(@PATH,4,262.963,2839.935,173.5923,0,0,0,100,0), -(@PATH,5,249.0294,2865.575,155.9257,0,0,0,100,0), -(@PATH,6,223.3671,2870.441,169.5924,0,0,0,100,0), -(@PATH,7,203.191,2850.286,160.4257,0,0,0,100,0); - --- Pathing for Eye of Thrallmar -SET @NPC :=57586; -SET @PATH :=@NPC*10; -UPDATE `creature` SET `position_x`=210.6249,`position_y`=2809.285,`position_z`=208.7277,`spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC; -DELETE FROM `creature_addon` WHERE `guid`=@NPC; -INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); -DELETE FROM `waypoint_data` WHERE `id`=@PATH; -INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES -(@PATH,1,213.0469,2809.036,207.1722,0,0,0,100,0), -(@PATH,2,223.5349,2797.282,213.4777,0,0,0,100,0), -(@PATH,3,238.895,2805.732,213.4777,0,0,0,100,0), -(@PATH,4,252.788,2818.183,213.4777,0,0,0,100,0), -(@PATH,5,255.2734,2839.056,213.4777,0,0,0,100,0), -(@PATH,6,245.0219,2851.84,213.4777,0,0,0,100,0), -(@PATH,7,229.2117,2860.19,213.4777,0,0,0,100,0), -(@PATH,8,213.6996,2851.376,206.5887,0,0,0,100,0), -(@PATH,9,204.457,2828.248,199.6443,0,0,0,100,0), -(@PATH,10,212.4397,2807.455,199.6443,0,0,0,100,0), -(@PATH,11,241.3802,2813.464,199.6443,0,0,0,100,0), -(@PATH,12,249.7797,2829.964,199.6443,0,0,0,100,0), -(@PATH,13,244.951,2854.129,199.6443,0,0,0,100,0), -(@PATH,14,221.8344,2856.781,199.6443,0,0,0,100,0), -(@PATH,15,210.7503,2837.578,199.6443,0,0,0,100,0), -(@PATH,16,210.6249,2809.285,208.7277,0,0,0,100,0); - --- Pathing for Eye of Thrallmar -SET @NPC :=57587; -SET @PATH :=@NPC*10; -UPDATE `creature` SET `position_x`=236.1859,`position_y`=2813.747,`position_z`=200.9708,`spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC; -DELETE FROM `creature_addon` WHERE `guid`=@NPC; -INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); -DELETE FROM `waypoint_data` WHERE `id`=@PATH; -INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES -(@PATH,1,241.7692,2815.284,200.8042,0,0,0,100,0), -(@PATH,2,255.8273,2833.317,201.443,0,0,0,100,0), -(@PATH,3,247.4309,2853.592,205.1653,0,0,0,100,0), -(@PATH,4,223.9901,2858.107,208.5819,0,0,0,100,0), -(@PATH,5,208.0596,2843.793,192.3596,0,0,0,100,0), -(@PATH,6,213.9734,2816.793,188.4153,0,0,0,100,0), -(@PATH,7,236.1859,2813.747,200.9708,0,0,0,100,0); - --- Pathing for Eye of Thrallmar -SET @NPC :=57588; -SET @PATH :=@NPC*10; -UPDATE `creature` SET `position_x`=245.9259,`position_y`=2829.09,`position_z`=177.804,`spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC; -DELETE FROM `creature_addon` WHERE `guid`=@NPC; -INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); -DELETE FROM `waypoint_data` WHERE `id`=@PATH; -INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES -(@PATH,1,251.6207,2841.322,177.804,0,0,0,100,0), -(@PATH,2,241.4914,2859.113,169.6652,0,0,0,100,0), -(@PATH,3,214.9913,2858.249,176.3595,0,0,0,100,0), -(@PATH,4,210.2245,2836.028,169.7762,0,0,0,100,0), -(@PATH,5,225.7556,2822.145,169.9707,0,0,0,100,0), -(@PATH,6,237.9712,2823.874,170.1096,0,0,0,100,0), -(@PATH,7,245.9259,2829.09,177.804,0,0,0,100,0); - -DELETE FROM `creature` WHERE `guid`=57589; -UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry`=16598; - - diff --git a/sql/updates/world/2012_02_18_00_world_spell_script_names.sql b/sql/updates/world/2012_02_18_00_world_spell_script_names.sql deleted file mode 100644 index 993fe3a2f38..00000000000 --- a/sql/updates/world/2012_02_18_00_world_spell_script_names.sql +++ /dev/null @@ -1,69 +0,0 @@ -DELETE FROM `spell_script_names` WHERE `spell_id` in (-100,-12162,13567,17251,23019,23448,23453,25860,28089,29200,29858,30458,30507,31225,35745,37674,39090,39093,39096,42784,43723,44875,47170,49357,50243,51582,51961,52759,52845,53808,54171,54577,55004,64385,-1464,-5308,12809,23881,-1454,-50286,8171,52041,52046,52047,52048,52049,52050,52059,52060,52061,52031,52033,52034,52035,52036,58778,58779,58780,60103,-49998,-66188,-47541,52375,59134,-62900,49560,62324,31890); -INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES -(-100,'spell_warr_charge'), -(-12162,'spell_warr_deep_wounds'), -(13567,'spell_gen_dummy_trigger'), -(17251,'spell_gen_spirit_healer_res'), -(23019,'spell_item_crystal_prison_dummy_dnd'), -(23448,'spell_gen_gadgetzan_transporter_backfire'), -(23453,'spell_gen_gnomish_transporter'), -(25860,'spell_item_reindeer_transformation'), -(28089,'spell_thaddius_polarity_shift'), -(29200,'spell_item_purify_helboar_meat'), -(29858,'spell_warl_soulshatter'), -(30458,'spell_item_nigh_invulnerability'), -(30507,'spell_item_poultryizer'), -(31225,'spell_item_shimmering_vessel'), -(35745,'spell_item_socrethars_stone'), -(37674,'spell_gen_chaos_blast'), -(39090,'spell_capacitus_polarity_charge'), -(39093,'spell_capacitus_polarity_charge'), -(39096,'spell_capacitus_polarity_shift'), -(42784,'spell_astromancer_wrath_of_the_astromancer'), -(43723,'spell_item_demon_broiled_surprise'), -(44875,'spell_item_complete_raptor_capture'), -(47170,'spell_item_impale_leviroth'), -(49357,'spell_item_brewfest_mount_transformation'), -(50243,'spell_item_teach_language'), -(51582,'spell_item_rocket_boots'), -(51961,'spell_item_chicken_cover'), -(52759,'spell_sha_ancestral_awakening_proc'), -(52845,'spell_item_brewfest_mount_transformation'), -(53808,'spell_item_pygmy_oil'), -(54577,'spell_item_uded'), -(54171,'spell_pal_divine_storm_dummy'), -(55004,'spell_item_nitro_boots'), -(64385,'spell_item_unusual_compass'), -(-1464,'spell_warr_slam'), -(-5308,'spell_warr_execute'), -(12809,'spell_warr_concussion_blow'), -(23881,'spell_warr_bloodthirst'), -(-1454,'spell_warl_life_tap'), -(-50286,'spell_dru_starfall_dummy'), -(8171,'spell_sha_cleansing_totem_pulse'), -(52041,'spell_sha_healing_stream_totem'), -(52046,'spell_sha_healing_stream_totem'), -(52047,'spell_sha_healing_stream_totem'), -(52048,'spell_sha_healing_stream_totem'), -(52049,'spell_sha_healing_stream_totem'), -(52050,'spell_sha_healing_stream_totem'), -(52059,'spell_sha_healing_stream_totem'), -(52060,'spell_sha_healing_stream_totem'), -(52061,'spell_sha_healing_stream_totem'), -(52031,'spell_sha_mana_spring_totem'), -(52033,'spell_sha_mana_spring_totem'), -(52034,'spell_sha_mana_spring_totem'), -(52035,'spell_sha_mana_spring_totem'), -(52036,'spell_sha_mana_spring_totem'), -(58778,'spell_sha_mana_spring_totem'), -(58779,'spell_sha_mana_spring_totem'), -(58780,'spell_sha_mana_spring_totem'), -(60103,'spell_sha_lava_lash'), -(-49998,'spell_dk_death_strike'), -(-66188,'spell_dk_death_strike'), -(-47541,'spell_dk_death_coil'), -(52375,'spell_dk_death_coil'), -(59134,'spell_dk_death_coil'), -(-62900,'spell_dk_death_coil'), -(49560,'spell_dk_death_grip'), -(62324,'spell_vehicle_throw_passenger'); diff --git a/sql/updates/world/2012_02_18_01_world_spell_dbc.sql b/sql/updates/world/2012_02_18_01_world_spell_dbc.sql deleted file mode 100644 index b343399d7f2..00000000000 --- a/sql/updates/world/2012_02_18_01_world_spell_dbc.sql +++ /dev/null @@ -1,3 +0,0 @@ -DELETE FROM `spell_dbc` WHERE `id`=31980; -INSERT INTO `spell_dbc` (`Id`,`Dispel`,`Mechanic`,`Attributes`,`AttributesEx`,`AttributesEx2`,`AttributesEx3`,`AttributesEx4`,`AttributesEx5`,`AttributesEx6`,`AttributesEx7`,`Stances`,`StancesNot`,`Targets`,`CastingTimeIndex`,`AuraInterruptFlags`,`ProcFlags`,`ProcChance`,`ProcCharges`,`MaxLevel`,`BaseLevel`,`SpellLevel`,`DurationIndex`,`RangeIndex`,`StackAmount`,`EquippedItemClass`,`EquippedItemSubClassMask`,`EquippedItemInventoryTypeMask`,`Effect1`,`Effect2`,`Effect3`,`EffectDieSides1`,`EffectDieSides2`,`EffectDieSides3`,`EffectRealPointsPerLevel1`,`EffectRealPointsPerLevel2`,`EffectRealPointsPerLevel3`,`EffectBasePoints1`,`EffectBasePoints2`,`EffectBasePoints3`,`EffectMechanic1`,`EffectMechanic2`,`EffectMechanic3`,`EffectImplicitTargetA1`,`EffectImplicitTargetA2`,`EffectImplicitTargetA3`,`EffectImplicitTargetB1`,`EffectImplicitTargetB2`,`EffectImplicitTargetB3`,`EffectRadiusIndex1`,`EffectRadiusIndex2`,`EffectRadiusIndex3`,`EffectApplyAuraName1`,`EffectApplyAuraName2`,`EffectApplyAuraName3`,`EffectAmplitude1`,`EffectAmplitude2`,`EffectAmplitude3`,`EffectMultipleValue1`,`EffectMultipleValue2`,`EffectMultipleValue3`,`EffectMiscValue1`,`EffectMiscValue2`,`EffectMiscValue3`,`EffectMiscValueB1`,`EffectMiscValueB2`,`EffectMiscValueB3`,`EffectTriggerSpell1`,`EffectTriggerSpell2`,`EffectTriggerSpell3`,`EffectSpellClassMaskA1`,`EffectSpellClassMaskA2`,`EffectSpellClassMaskA3`,`EffectSpellClassMaskB1`,`EffectSpellClassMaskB2`,`EffectSpellClassMaskB3`,`EffectSpellClassMaskC1`,`EffectSpellClassMaskC2`,`EffectSpellClassMaskC3`,`MaxTargetLevel`,`SpellFamilyName`,`SpellFamilyFlags1`,`SpellFamilyFlags2`,`SpellFamilyFlags3`,`MaxAffectedTargets`,`DmgClass`,`PreventionType`,`DmgMultiplier1`,`DmgMultiplier2`,`DmgMultiplier3`,`AreaGroupId`,`SchoolMask`,`Comment`) VALUES -(31980,0,0,328064,1024,4,268894208,0,0,0,0,0,0,0,1,0,0,101,0,0,14,14,0,13,0,-1,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22,0,0,15,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,4,0,0,0,0,1,0,0,0,1,"Righteous Defense Trigger Spell"); diff --git a/sql/updates/world/2012_02_18_02_world_gossip.sql b/sql/updates/world/2012_02_18_02_world_gossip.sql deleted file mode 100644 index c72532e3f21..00000000000 --- a/sql/updates/world/2012_02_18_02_world_gossip.sql +++ /dev/null @@ -1,52 +0,0 @@ --- Gossip for Lore Keeper of Norgannon "Uldaman" for quest 2278 "The Platinum Discs" -UPDATE `creature_template` SET `gossip_menu_id`=562 WHERE `entry`=7172; - --- SAI for Lore Keeper of Norgannon -SET @ENTRY := 7172; -UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; -INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES -(@ENTRY,0,0,1,62,0,100,0,576,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Lore Keeper of Norgannon - On gossip option select - close gossip'), -(@ENTRY,0,1,0,61,0,100,0,0,0,0,0,26,2278,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Lore Keeper of Norgannon - On gossip option select - give quest credit'); - -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=562 AND `SourceEntry`=0; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(15,562,0,0,9,2278,0,0,0,'','Show gossip option if player has quest 2278 but not complete'); - -DELETE FROM `gossip_menu` WHERE `entry` BETWEEN 561 AND 576; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES -(561,1080), -(562,1079), -(563,1081), -(564,1082), -(565,1083), -(566,1084), -(567,1085), -(568,1086), -(569,1087), -(570,1088), -(571,1089), -(572,1090), -(573,1091), -(574,1092), -(575,1093), -(576,1094); - -DELETE FROM `gossip_menu_option` WHERE `menu_id` BETWEEN 561 AND 576; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(561,0,0,'What is a "subterranean being matrix"?',1,1,563,0,0,0,''), -(562,0,0,'Who are the Earthen?',1,1,561,0,0,0,''), -(563,0,0,'What are the anomalies you speak of?',1,1,564,0,0,0,''), -(564,0,0,'What is a "resilient foundation of construction"?',1,1,565,0,0,0,''), -(565,0,0,'So... the Earthen were made out of stone?',1,1,566,0,0,0,''), -(566,0,0,'Anything else I should know about the Earthen?',1,1,567,0,0,0,''), -(567,0,0,'I think I understand the Creators'' design intent for the Earthen now. What are the Earthen''s anomalies that you spoke of earlier?',1,1,568,0,0,0,''), -(568,0,0,'What high-stress environments would cause the Earthen to destabilize?',1,1,569,0,0,0,''), -(569,0,0,'What happens when the Earthen destabilize?',1,1,570,0,0,0,''), -(570,0,0,'Troggs?! Are the troggs you mention the same as the ones in the world today?',1,1,571,0,0,0,''), -(571,0,0,'You mentioned two results when the Earthen destabilize. What is the second?',1,1,572,0,0,0,''), -(572,0,0,'Dwarves!!! Now you''re telling me that dwarves originally came from the Earthen?!',1,1,573,0,0,0,''), -(573,0,0,'These dwarves are the same ones today, yes? Do dwarves maintain any other links to the Earthen?',1,1,574,0,0,0,''), -(574,0,0,'Who are the Creators?',1,1,575,0,0,0,''), -(575,0,0,'This is a lot to think about.',1,1,576,0,0,0,''), -(576,0,0,'I will access the discs now.',1,1,0,0,0,0,''); \ No newline at end of file diff --git a/sql/updates/world/2012_02_18_03_world_gossip.sql b/sql/updates/world/2012_02_18_03_world_gossip.sql deleted file mode 100644 index 990006f5098..00000000000 --- a/sql/updates/world/2012_02_18_03_world_gossip.sql +++ /dev/null @@ -1,1068 +0,0 @@ --- XXXXXXXXXXXXXXXXXXXX --- X Rogue Trainers X --- XXXXXXXXXXXXXXXXXXXX - -UPDATE `creature_template` SET `gossip_menu_id`=410 WHERE `entry`=1234; -UPDATE `creature_template` SET `gossip_menu_id`=85 WHERE `entry`=2122; -UPDATE `creature_template` SET `gossip_menu_id`=3984 WHERE `entry`=6707; -UPDATE `creature_template` SET `gossip_menu_id`=4512 WHERE `entry`=3328; -UPDATE `creature_template` SET `gossip_menu_id`=4575 WHERE `entry`=4215; -UPDATE `creature_template` SET `gossip_menu_id`=4577 WHERE `entry`=4214; -UPDATE `creature_template` SET `gossip_menu_id`=4658 WHERE `entry`=1411; - --- Gossip Condition for Rogue Trainers -SET @GOSSIP := 85; -SET @TEXTYES := 581; -SET @TEXTNO := 4796; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), -(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"I would like to train.",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), -(@GOSSIP,4,0,"",1,1,0,0,0,0,''); - --- Gossip Condition for Rogue Trainers -SET @GOSSIP := 141; -SET @TEXTYES := 638; -SET @TEXTNO := 4793; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), -(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"I would like training.",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), -(@GOSSIP,4,0,"",1,1,0,0,0,0,''); - --- Gossip Condition for Rogue Trainers -SET @GOSSIP := 381; -SET @TEXTYES := 878; -SET @TEXTNO := 4799; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), -(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"I am in need of training, Keryn.",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), -(@GOSSIP,4,0,"",1,1,0,0,0,0,''); - --- Gossip Condition for Rogue Trainers -SET @GOSSIP := 410; -SET @TEXTYES := 4795; -SET @TEXTNO := 4797; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), -(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"I would like to train.",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), -(@GOSSIP,4,0,"",1,1,0,0,0,0,''); - --- Gossip Condition for Rogue Trainers -SET @GOSSIP := 411; -SET @TEXTYES := 908; -SET @TEXTNO := 4798; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), -(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"Good day, Hulfdan, I am looking for training.",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), -(@GOSSIP,4,0,"",1,1,0,0,0,0,''); - --- Gossip Condition for Rogue Trainers -SET @GOSSIP := 436; -SET @TEXTYES := 934; -SET @TEXTNO := 4793; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), -(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"Hello! I am a Rogue in need of training.",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), -(@GOSSIP,4,0,"",1,1,0,0,0,0,''); - --- Gossip Condition for Rogue Trainers -SET @GOSSIP := 3984; -SET @TEXTYES := 4838; -SET @TEXTNO := 4839; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), -(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"Yes, I have. Teach me.",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), -(@GOSSIP,4,0,"",1,1,0,0,0,0,''); - --- Gossip Condition for Rogue Trainers -SET @GOSSIP := 4502; -SET @TEXTYES := 4835; -SET @TEXTNO := 4837; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), -(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"Can you train me how to use rogue skills?",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), -(@GOSSIP,4,0,"",1,1,0,0,0,0,''); - --- Gossip Condition for Rogue Trainers -SET @GOSSIP := 4512; -SET @TEXTYES := 638; -SET @TEXTNO := 4793; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), -(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"I would like training.",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), -(@GOSSIP,4,0,"",1,1,0,0,0,0,''); - --- Gossip Condition for Rogue Trainers -SET @GOSSIP := 4513; -SET @TEXTYES := 638; -SET @TEXTNO := 4793; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), -(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"I would like training.",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), -(@GOSSIP,4,0,"",1,1,0,0,0,0,''); - --- Gossip Condition for Rogue Trainers -SET @GOSSIP := 4540; -SET @TEXTYES := 581; -SET @TEXTNO := 4796; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), -(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"I would like to train.",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), -(@GOSSIP,4,0,"",1,1,0,0,0,0,''); - --- Gossip Condition for Rogue Trainers -SET @GOSSIP := 4541; -SET @TEXTYES := 581; -SET @TEXTNO := 4796; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), -(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"I would like to train.",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), -(@GOSSIP,4,0,"",1,1,0,0,0,0,''); - --- Gossip Condition for Rogue Trainers -SET @GOSSIP := 4542; -SET @TEXTYES := 581; -SET @TEXTNO := 4796; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), -(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"I would like to train.",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), -(@GOSSIP,4,0,"",1,1,0,0,0,0,''); - --- Gossip Condition for Rogue Trainers -SET @GOSSIP := 4561; -SET @TEXTYES := 5695; -SET @TEXTNO := 4833; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), -(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"I'm lookin' for rogue trainin'.",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), -(@GOSSIP,4,0,"",1,1,0,0,0,0,''); - --- Gossip Condition for Rogue Trainers -SET @GOSSIP := 4562; -SET @TEXTYES := 4834; -SET @TEXTNO := 4833; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), -(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"I'm lookin' for rogue trainin'.",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), -(@GOSSIP,4,0,"",1,1,0,0,0,0,''); - --- Gossip Condition for Rogue Trainers -SET @GOSSIP := 4575; -SET @TEXTYES := 4795; -SET @TEXTNO := 4793; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), -(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"I seek training.",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), -(@GOSSIP,4,0,"",1,1,0,0,0,0,''); - --- Gossip Condition for Rogue Trainers -SET @GOSSIP := 4576; -SET @TEXTYES := 4795; -SET @TEXTNO := 4793; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), -(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"I seek training.",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), -(@GOSSIP,4,0,"",1,1,0,0,0,0,''); - --- Gossip Condition for Rogue Trainers -SET @GOSSIP := 4577; -SET @TEXTYES := 4795; -SET @TEXTNO := 4793; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), -(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"I seek training.",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), -(@GOSSIP,4,0,"",1,1,0,0,0,0,''); - --- Gossip Condition for Rogue Trainers -SET @GOSSIP := 4658; -SET @TEXTYES := 6165; -SET @TEXTNO := 6164; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), -(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"Can you train me how to use rogue skills?",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), -(@GOSSIP,4,0,"",1,1,0,0,0,0,''); - --- Gossip Condition for Rogue Trainers -SET @GOSSIP := 4659; -SET @TEXTYES := 4835; -SET @TEXTNO := 4837; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), -(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"Can you train me how to use rogue skills?",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), -(@GOSSIP,4,0,"",1,1,0,0,0,0,''); - --- Gossip Condition for Rogue Trainers -SET @GOSSIP := 4676; -SET @TEXTYES := 4835; -SET @TEXTNO := 4833; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), -(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"Can you train me how to use rogue skills?",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), -(@GOSSIP,4,0,"",1,1,0,0,0,0,''); - --- Gossip Condition for Rogue Trainers -SET @GOSSIP := 4690; -SET @TEXTYES := 4795; -SET @TEXTNO := 4793; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), -(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"I seek training.",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), -(@GOSSIP,4,0,"",1,1,0,0,0,0,''); - --- Gossip Condition for Rogue Trainers -SET @GOSSIP := 5061; -SET @TEXTYES := 4835; -SET @TEXTNO := 4837; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), -(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"Can you train me how to use rogue skills?",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), -(@GOSSIP,4,0,"",1,1,0,0,0,0,''); - --- Gossip Condition for Rogue Trainers -SET @GOSSIP := 6650; -SET @TEXTYES := 9188; -SET @TEXTNO := 9187; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,8,0,0,0,'','Show gossip text if player is a Rogue'), -(14,@GOSSIP,@TEXTNO,0,15,1527,0,0,0,'','Show gossip text if player is not a Rogue'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"I require rogue training.",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''), -(@GOSSIP,4,0,"",1,1,0,0,0,0,''); - --- XXXXXXXXXXXXXXXXXXXXX --- X Hunter Trainers X --- XXXXXXXXXXXXXXXXXXXXX - -UPDATE `creature_template` SET `gossip_menu_id`=4657 WHERE `entry`=1404; -UPDATE `creature_template` SET `gossip_menu_id`=4695 WHERE `entry`=3596; -UPDATE `creature_template` SET `gossip_menu_id`=4009 WHERE `entry`=3601; -UPDATE `creature_template` SET `gossip_menu_id`=6652 WHERE `entry`=16672; -UPDATE `creature_template` SET `gossip_menu_id`=4101 WHERE `entry`=987; - --- Gossip Condition for Hunter Trainers -SET @GOSSIP := 4008; -SET @TEXTYES := 4863; -SET @TEXTNO := 4993; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), -(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"I'd like to train.",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); - --- Gossip Condition for Hunter Trainers -SET @GOSSIP := 4009; -SET @TEXTYES := 4316; -SET @TEXTNO := 4993; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), -(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"I am in need of training.",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); - --- Gossip Condition for Hunter Trainers -SET @GOSSIP := 4010; -SET @TEXTYES := 4866; -SET @TEXTNO := 5003; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), -(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"I have come for training.",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); - --- Gossip Condition for Hunter Trainers -SET @GOSSIP := 4011; -SET @TEXTYES := 4867; -SET @TEXTNO := 4998; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), -(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"I am in need of training.",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); - --- Gossip Condition for Hunter Trainers -SET @GOSSIP := 4012; -SET @TEXTYES := 4868; -SET @TEXTNO := 4998; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), -(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"I am a hunter and wish to train.",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); - --- Gossip Condition for Hunter Trainers -SET @GOSSIP := 4017; -SET @TEXTYES := 4888; -SET @TEXTNO := 4888; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), -(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"Please train me.",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); - --- Gossip Condition for Hunter Trainers -SET @GOSSIP := 4023; -SET @TEXTYES := 4889; -SET @TEXTNO := 4996; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), -(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"I wish to train.",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); - --- Gossip Condition for Hunter Trainers -SET @GOSSIP := 4101; -SET @TEXTYES := 5001; -SET @TEXTNO := 5002; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), -(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"I seek training in the ways of the Hunter.",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); - --- Gossip Condition for Hunter Trainers -SET @GOSSIP := 4472; -SET @TEXTYES := 4893; -SET @TEXTNO := 5000; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), -(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"I seek training in the ways of the Hunter.",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); - --- Gossip Condition for Hunter Trainers -SET @GOSSIP := 4473; -SET @TEXTYES := 4893; -SET @TEXTNO := 5000; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), -(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"I seek training in the ways of the Hunter.",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); - --- Gossip Condition for Hunter Trainers -SET @GOSSIP := 4474; -SET @TEXTYES := 4893; -SET @TEXTNO := 5000; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), -(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"I seek training in the ways of the Hunter.",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); - --- Gossip Condition for Hunter Trainers -SET @GOSSIP := 4506; -SET @TEXTYES := 4987; -SET @TEXTNO := 5004; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), -(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"I wish to train.",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); - --- Gossip Condition for Hunter Trainers -SET @GOSSIP := 4524; -SET @TEXTYES := 4997; -SET @TEXTNO := 4998; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), -(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"I seek training in the ways of the Hunter.",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); - --- Gossip Condition for Hunter Trainers -SET @GOSSIP := 4549; -SET @TEXTYES := 4999; -SET @TEXTNO := 5000; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), -(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"I seek training in the ways of the Hunter.",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); - --- Gossip Condition for Hunter Trainers -SET @GOSSIP := 4550; -SET @TEXTYES := 4890; -SET @TEXTNO := 5000; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), -(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"I am here for training.",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); - --- Gossip Condition for Hunter Trainers -SET @GOSSIP := 4551; -SET @TEXTYES := 4999; -SET @TEXTNO := 5000; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), -(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"I seek training in the ways of the Hunter.",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); - --- Gossip Condition for Hunter Trainers -SET @GOSSIP := 4647; -SET @TEXTYES := 4997; -SET @TEXTNO := 4998; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), -(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"I seek training in the ways of the Hunter.",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); - --- Gossip Condition for Hunter Trainers -SET @GOSSIP := 4648; -SET @TEXTYES := 4987; -SET @TEXTNO := 5004; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), -(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"I wish to train.",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); - --- Gossip Condition for Hunter Trainers -SET @GOSSIP := 4657; -SET @TEXTYES := 5001; -SET @TEXTNO := 5002; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), -(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"I seek training in the ways of the Hunter.",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); - --- Gossip Condition for Hunter Trainers -SET @GOSSIP := 4675; -SET @TEXTYES := 4999; -SET @TEXTNO := 5000; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), -(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"I seek training in the ways of the Hunter.",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); - --- Gossip Condition for Hunter Trainers -SET @GOSSIP := 4693; -SET @TEXTYES := 6160; -SET @TEXTNO := 4993; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), -(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"I'd like to train.",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); - --- Gossip Condition for Hunter Trainers -SET @GOSSIP := 4695; -SET @TEXTYES := 4863; -SET @TEXTNO := 4993; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), -(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"I'd like to train.",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); - --- Gossip Condition for Hunter Trainers -SET @GOSSIP := 6652; -SET @TEXTYES := 9190; -SET @TEXTNO := 9189; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), -(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"I seek training in the ways of the Hunter.",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); - --- Gossip Condition for Hunter Trainers -SET @GOSSIP := 7262; -SET @TEXTYES := 8585; -SET @TEXTNO := 8586; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), -(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"I seek training in the ways of the Hunter.",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); - --- Gossip Condition for Hunter Trainers -SET @GOSSIP := 7368; -SET @TEXTYES := 8804; -SET @TEXTNO := 8823; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=@GOSSIP; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,@GOSSIP,@TEXTYES,0,15,4,0,0,0,'','Show gossip text if player is a Hunter'), -(14,@GOSSIP,@TEXTNO,0,15,1531,0,0,0,'','Show gossip text if player is not a Hunter'); --- Add Any Missing Gossip Menu item -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTYES; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTYES); -DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=@TEXTNO; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (@GOSSIP,@TEXTNO); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE menu_id=@GOSSIP; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(@GOSSIP,0,3,"I am a hunter in need of training, Acteon.",5,16,0,0,0,0,''), -(@GOSSIP,1,0,"I wish to unlearn my talents.",16,16,4461,0,0,0,''), -(@GOSSIP,2,0,"I wish to know about Dual Talent Specialization.",1,1,10371,0,0,0,''); - --- Add some missing gossip from sniff for Zabra'jin in Zangermarsh -UPDATE `creature_template` SET `gossip_menu_id`=7601 WHERE `entry`=18013; -UPDATE `creature_template` SET `gossip_menu_id`=7602 WHERE `entry`=18014; -UPDATE `creature_template` SET `gossip_menu_id`=7608 WHERE `entry`=18015; -UPDATE `creature_template` SET `gossip_menu_id`=7603 WHERE `entry`=18017; -UPDATE `creature_template` SET `gossip_menu_id`=7609 WHERE `entry`=18018; -UPDATE `creature_template` SET `gossip_menu_id`=9821 WHERE `entry`=18244; -UPDATE `creature_template` SET `gossip_menu_id`=7722 WHERE `entry`=18564; - -DELETE FROM `gossip_menu` WHERE `entry` IN (7601,7602,7603,7608,7609,7722,7946,9821); -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES -(7601,9248),(7602,9249),(7603,9250),(7608,9259), -(7609,9260),(7722,9431),(7946,9752),(9821,13584); - -DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (7603,7608,7609) AND `id` IN (0); -DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (7609,7722,9821) AND `id` IN (1); -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(7603,0,1,'I would like to buy from you.',3,128,0,0,0,0,''), -(7608,0,1,'I wish to purchase tradeskill supplies.',3,128,0,0,0,0,''), -(7609,0,1,'I wish to purchase fishing supplies.',3,128,0,0,0,0,''), -(7609,1,3,'Give me some pointers on my fishing technique.',5,16,0,0,0,0,''), -(7722,1,1,'I have marks to redeem!',3,128,0,0,0,0,''), -(9821,1,1,'I''m looking for a lost companion.',14,4194304,0,0,0,0,''); - --- Add some missing gossip from sniff for Thunderlord Stronghold in Blade's Edge Mountains -UPDATE `creature_template` SET `gossip_menu_id`=9856 WHERE `entry`=19471; -UPDATE `creature_template` SET `gossip_menu_id`=9821 WHERE `entry`=19476; -UPDATE `creature_template` SET `gossip_menu_id`=5856 WHERE `entry`=19478; -UPDATE `creature_template` SET `gossip_menu_id`=8283 WHERE `entry`=21311; -UPDATE `creature_template` SET `gossip_menu_id`=8406 WHERE `entry`=21950; -UPDATE `creature_template` SET `gossip_menu_id`=8244 WHERE `entry`=21147; -UPDATE `creature_template` SET `gossip_menu_id`=8525 WHERE `entry`=21984; -UPDATE `creature_template` SET `gossip_menu_id`=8239 WHERE `entry`=21117; - -DELETE FROM `gossip_menu` WHERE `entry` IN (8283,8406,8244,8525,8239); -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES -(8283,10322),(8406,10508),(8244,10259),(8525,10661),(8239,10251); - -DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (9856) AND `id` IN (0); -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(9856,0,1,'Show me what you have for sale.',3,128,0,0,0,0,''); - diff --git a/sql/updates/world/2012_02_18_04_world_spell_script_names.sql b/sql/updates/world/2012_02_18_04_world_spell_script_names.sql deleted file mode 100644 index 8fa5bc55197..00000000000 --- a/sql/updates/world/2012_02_18_04_world_spell_script_names.sql +++ /dev/null @@ -1,6 +0,0 @@ -DELETE FROM `spell_script_names` WHERE `spell_id` IN (52059,52060,52061); -DELETE FROM `spell_script_names` WHERE `spell_id` IN (58759,58760,58761); -INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES -(58759,'spell_sha_healing_stream_totem'), -(58760,'spell_sha_healing_stream_totem'), -(58761,'spell_sha_healing_stream_totem'); diff --git a/sql/updates/world/2012_02_18_05_world_creatures.sql b/sql/updates/world/2012_02_18_05_world_creatures.sql deleted file mode 100644 index 3fdac99c854..00000000000 --- a/sql/updates/world/2012_02_18_05_world_creatures.sql +++ /dev/null @@ -1,3 +0,0 @@ -UPDATE `creature` SET `MovementType`=1 WHERE `spawndist`!=0 AND `MovementType`=2 AND `guid` IN (49123,49124,49125,49127,49128,49129,49143,49144,49145,49146,49150,49151,49154,49156,49157,49158,49167,49186,49187,49188,49318,49319,49664,49665,49751,49762,51398,51402,51422,51423,123148,127753,137490,137491,202314); -UPDATE `creature` SET `MovementType`=0 WHERE `spawndist`=0 AND `MovementType`=2 AND `guid` IN (49123,49124,49125,49127,49128,49129,49143,49144,49145,49146,49150,49151,49154,49156,49157,49158,49167,49186,49187,49188,49318,49319,49664,49665,49751,49762,51398,51402,51422,51423,123148,127753,137490,137491,202314); -UPDATE `creature_template` SET `MovementType`=0 WHERE `MovementType`=2 AND `entry` NOT IN (21657,30007); diff --git a/sql/updates/world/2012_02_18_06_world_gossip.sql b/sql/updates/world/2012_02_18_06_world_gossip.sql deleted file mode 100644 index e3385ceb5b0..00000000000 --- a/sql/updates/world/2012_02_18_06_world_gossip.sql +++ /dev/null @@ -1,166 +0,0 @@ --- Add some missing gossip to Nagrand From UDB -UPDATE `creature_template` SET `gossip_menu_id`=7675 WHERE `entry`=18261; -UPDATE `creature_template` SET `gossip_menu_id`=7723 WHERE `entry`=18333; -UPDATE `creature_template` SET `gossip_menu_id`=7719 WHERE `entry`=18417; -UPDATE `creature_template` SET `gossip_menu_id`=7724 WHERE `entry`=18581; -UPDATE `creature_template` SET `gossip_menu_id`=7625 WHERE `entry`=18265; -UPDATE `creature_template` SET `gossip_menu_id`=7626 WHERE `entry`=18276; -UPDATE `creature_template` SET `gossip_menu_id`=7631 WHERE `entry`=18335; -UPDATE `creature_template` SET `gossip_menu_id`=7699 WHERE `entry`=18471; -UPDATE `creature_template` SET `gossip_menu_id`=7563 WHERE `entry`=18074; -UPDATE `creature_template` SET `gossip_menu_id`=7592 WHERE `entry`=18200; -UPDATE `creature_template` SET `gossip_menu_id`=7579 WHERE `entry`=18180; -UPDATE `creature_template` SET `gossip_menu_id`=7607 WHERE `entry`=18218; -UPDATE `creature_template` SET `gossip_menu_id`=7704 WHERE `entry`=18482; -UPDATE `creature_template` SET `gossip_menu_id`=8493, `npcflag`=`npcflag`|1 WHERE `entry`=22113; - -DELETE FROM `gossip_menu` WHERE `entry`=7563 AND `text_id`=9181; -DELETE FROM `gossip_menu` WHERE `entry`=7578 AND `text_id`=9220; -DELETE FROM `gossip_menu` WHERE `entry`=7579 AND `text_id` IN (9219,9221,9256,9257); -DELETE FROM `gossip_menu` WHERE `entry`=7592 AND `text_id` IN (9240,9283,9284); -DELETE FROM `gossip_menu` WHERE `entry`=7607 AND `text_id` IN (9258,9286); -DELETE FROM `gossip_menu` WHERE `entry`=7625 AND `text_id`=9287; -DELETE FROM `gossip_menu` WHERE `entry`=7626 AND `text_id`=9288; -DELETE FROM `gossip_menu` WHERE `entry`=7631 AND `text_id`=9312; -DELETE FROM `gossip_menu` WHERE `entry`=7675 AND `text_id` IN (9361,9369); -DELETE FROM `gossip_menu` WHERE `entry`=7676 AND `text_id`=9368; -DELETE FROM `gossip_menu` WHERE `entry`=7677 AND `text_id`=9367; -DELETE FROM `gossip_menu` WHERE `entry`=7678 AND `text_id`=9366; -DELETE FROM `gossip_menu` WHERE `entry`=7679 AND `text_id`=9365; -DELETE FROM `gossip_menu` WHERE `entry`=7680 AND `text_id`=9364; -DELETE FROM `gossip_menu` WHERE `entry`=7681 AND `text_id`=9363; -DELETE FROM `gossip_menu` WHERE `entry`=7682 AND `text_id`=9362; -DELETE FROM `gossip_menu` WHERE `entry`=7699 AND `text_id`=9394; -DELETE FROM `gossip_menu` WHERE `entry`=7704 AND `text_id`=9405; -DELETE FROM `gossip_menu` WHERE `entry`=7705 AND `text_id`=9406; -DELETE FROM `gossip_menu` WHERE `entry`=7714 AND `text_id`=9424; -DELETE FROM `gossip_menu` WHERE `entry`=7715 AND `text_id`=9423; -DELETE FROM `gossip_menu` WHERE `entry`=7716 AND `text_id`=9422; -DELETE FROM `gossip_menu` WHERE `entry`=7717 AND `text_id`=9421; -DELETE FROM `gossip_menu` WHERE `entry`=7718 AND `text_id`=9420; -DELETE FROM `gossip_menu` WHERE `entry`=7719 AND `text_id` IN (9419,9427); -DELETE FROM `gossip_menu` WHERE `entry`=7723 AND `text_id`=9429; -DELETE FROM `gossip_menu` WHERE `entry`=7724 AND `text_id`=9433; -DELETE FROM `gossip_menu` WHERE `entry`=8393 AND `text_id`=10493; -DELETE FROM `gossip_menu` WHERE `entry`=8394 AND `text_id`=10492; -DELETE FROM `gossip_menu` WHERE `entry`=8394 AND `text_id`=10614; -- was incorrect in the db -DELETE FROM `gossip_menu` WHERE `entry`=8395 AND `text_id`=10494; -DELETE FROM `gossip_menu` WHERE `entry`=8395 AND `text_id`=10615; -- was incorrect in the db -DELETE FROM `gossip_menu` WHERE `entry`=8396 AND `text_id`=10495; -DELETE FROM `gossip_menu` WHERE `entry`=8396 AND `text_id`=10616; -- was incorrect in the db -DELETE FROM `gossip_menu` WHERE `entry`=8398 AND `text_id`=10497; -DELETE FROM `gossip_menu` WHERE `entry`=8493 AND `text_id` IN (10606,10655,10854); -DELETE FROM `gossip_menu` WHERE `entry`=8497 AND `text_id`=10616; -DELETE FROM `gossip_menu` WHERE `entry`=8498 AND `text_id`=10615; -DELETE FROM `gossip_menu` WHERE `entry`=8499 AND `text_id`=10614; -DELETE FROM `gossip_menu` WHERE `entry` BETWEEN 21296 AND 21303; -- the old menus assigned to Lantresor which were not sniffed -DELETE FROM `gossip_menu` WHERE `entry` BETWEEN 21304 AND 21309; -- the old menus assigned to Altruis which were not sniffed -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES -(7563,9181), -(7578,9220), -(7579,9219),(7579,9221),(7579,9256),(7579,9257), -(7592,9240),(7592,9283),(7592,9284), -(7625,9287), -(7626,9288), -(7631,9312), -(7699,9394), -(7607,9258),(7607,9286), -(7675,9361),(7675,9369), -(7676,9368), -(7677,9367), -(7678,9366), -(7679,9365), -(7680,9364), -(7681,9363), -(7682,9362), -(7704,9405), -(7705,9406), -(7714,9424), -(7715,9423), -(7716,9422), -(7717,9421), -(7718,9420), -(7719,9419),(7719,9427), -(7723,9429), -(7724,9433), -(8394,10492), -(8393,10493), -(8395,10494), -(8396,10495), -(8398,10497), -(8493,10606),(8493,10655),(8493,10854), -(8497,10616), -(8498,10615), -(8499,10614); - -DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (7579,7704,7715,7716,7717,7718,7719,8393,8394,8395,8396,8398,8497,8498,8499) AND `id`=0; -DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (7719,7724) AND `id`=1; -DELETE FROM `gossip_menu_option` WHERE `menu_id` BETWEEN 7675 AND 7682 AND `id`=0; -UPDATE `gossip_menu_option` SET `action_menu_id`=8499 WHERE `menu_id`=8397; -- was incorrect -DELETE FROM `gossip_menu_option` WHERE `menu_id` BETWEEN 21296 AND 21303; -- the old options assigned to Lantresor which were not sniffed -DELETE FROM `gossip_menu_option` WHERE `menu_id` BETWEEN 21304 AND 21309; -- the old options assigned to Altruis which was not sniffed -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(7579,0,0,'Hemet Nesingwary, what are you doing here in the Outland?',1,1,7578,0,0,0,''), -(7704,0,0,'Empoor, you''re going to tell me what I want to know, or else!',1,1,0,0,0,0,''), -(7715,0,0,'Forge camps?',1,1,7714,0,0,0,''), -(7716,0,0,'How do you see them now?',1,1,7715,0,0,0,''), -(7717,0,0,'And now?',1,1,7716,0,0,0,''), -(7718,0,0,'Legion?',1,1,7717,0,0,0,''), -(7719,0,0,'I see twisted steel and smell sundered earth.',1,1,7718,0,0,0,''), -(7719,1,0,'Tell me about the demon hunter training grounds at the Ruins of Karabor.',1,1,8394,0,0,0,''), -(7724,1,1,'I have marks to redeem!',3,128,0,0,0,0,''), -(7675,0,0,'I have killed many of your ogres, Lantresor. I have no fear.',1,1,7682,0,0,0,''), -(7682,0,0,'Should I know? You look like an orc to me.',1,1,7681,0,0,0,''), -(7681,0,0,'And the other half?',1,1,7680,0,0,0,''), -(7680,0,0,'I have heard of your kind, but I never thought to see the day when I would meet a half-breed.',1,1,7679,0,0,0,''), -(7679,0,0,'My apologies. I did not mean to offend. I am here on behalf of my people.',1,1,7678,0,0,0,''), -(7678,0,0,'My people ask that you pull back your Boulderfist ogres and cease all attacks on our territories. In return, we will also pull back our forces.',1,1,7677,0,0,0,''), -(7677,0,0,'We will fight you until the end, then, Lantresor. We will not stand idly by as you pillage our towns and kill our people.',1,1,7676,0,0,0,''), -(7676,0,0,'What do I need to do?',1,1,0,0,0,0,''), -(8394,0,0,'I''m listening.',1,1,8393,0,0,0,''), -(8393,0,0,'Go on, please.',1,1,8395,0,0,0,''), -(8395,0,0,'Interesting.',1,1,8396,0,0,0,''), -(8396,0,0,'That''s quite a story.',1,1,8398,0,0,0,''), -(8398,0,0,'There was something else I wanted to ask you, Altruis.',1,1,7719,0,0,0,''), -(8499,0,0,'But you are dragons! How could orcs do this to you?',1,1,8498,0,0,0,''), -(8498,0,0,'Your mate?',1,1,8497,0,0,0,''), -(8497,0,0,'I have battled many beasts, dragon. I will help you.',1,1,0,0,0,0,''); - -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=7579 AND `SourceEntry` IN (9221,9256,9257); -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=7592 AND `SourceEntry` IN (9283,9284); -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=7607 AND `SourceEntry`=9286; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=7675 AND `SourceEntry`=9369; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=7719 AND `SourceEntry`=9427; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=8493 AND `SourceEntry` IN (10655,10854); -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=7675 AND `SourceEntry`=0; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup` IN (7704,7719) AND `SourceEntry`=0; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup` IN (7719) AND `SourceEntry`=1; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=21304; -- condition for Altruis' gossip that wasn't sniffed -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=21295; -- condition for Lantresor's gossip that wasn't sniffed -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,7579,9221,0,0,8,208,0,0,0,0,'','Show different gossip if player has rewarded quest 208'), -(14,7579,9256,0,0,8,9851,0,0,0,0,'','Show different gossip if player has rewarded quest 9851'), -(14,7579,9257,0,0,8,9852,0,0,0,0,'','Show different gossip if player has rewarded quest 9852'), -(14,7592,9283,0,0,8,9854,0,0,0,0,'','Show different gossip if player has rewarded quest 9854'), -(14,7592,9284,0,0,8,9856,0,0,0,0,'','Show different gossip if player has rewarded quest 9856'), -(14,7607,9286,0,0,8,9859,0,0,0,0,'','Show different gossip if player has rewarded quest 9859'), -(14,7675,9369,0,0,8,10107,0,0,0,0,'','Show different gossip if player has rewarded quest 10107'), -(14,7675,9369,0,1,8,10108,0,0,0,0,'','Show different gossip if player has rewarded quest 10108'), -(14,7719,9427,0,0,8,9991,0,0,0,0,'','Show different gossip if player has rewarded quest 9991'), -(14,8493,10655,0,0,8,10870,0,0,0,0,'','Show different gossip if player has rewarded quest 10870'), -(14,8493,10854,0,0,8,11012,0,0,0,0,'','Show different gossip if player has rewarded quest 11012'), -(15,7675,0,0,0,9,10107,0,0,0,0,'','Show gossip option if player has quest 10107 but not complete'), -(15,7675,0,0,1,9,10108,0,0,0,0,'','Show gossip option if player has quest 10108 but not complete'), -(15,7704,0,0,0,9,9978,0,0,0,0,'','Show gossip option if player has quest 9978 but not complete'), -(15,7719,0,0,0,8,9991,0,0,1,0,'','Show gossip option if player has not rewarded quest 9991'), -(15,7719,1,0,0,9,10646,0,0,0,0,'','Show gossip option if player has quest 10646 but not complete'); - -UPDATE `smart_scripts` SET `event_param1`=7715 WHERE `entryorguid`=18417 AND `id` IN (0,1); -- correct Altruis' script -UPDATE `smart_scripts` SET `event_param1`=8396 WHERE `entryorguid`=18417 AND `id`=2; - -UPDATE `smart_scripts` SET `event_param1`=8497 WHERE `entryorguid`=21657 AND `id`=0; -- correct Neltharaku's script - -UPDATE `smart_scripts` SET `link`=3, `event_param1`=7676 WHERE `entryorguid`=18261 AND `id` IN (1,2); -- correct Lantresor's script -DELETE FROM `smart_scripts` WHERE `entryorguid`=18261 AND `id`=3; -INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES -(18261,0,3,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Lantresor - On gossip select - Close gossip'); diff --git a/sql/updates/world/2012_02_18_07_world_gossip.sql b/sql/updates/world/2012_02_18_07_world_gossip.sql deleted file mode 100644 index 6246f12cefc..00000000000 --- a/sql/updates/world/2012_02_18_07_world_gossip.sql +++ /dev/null @@ -1,44 +0,0 @@ --- Fallen Hero of the Horde http://old.wowhead.com/npc=7572 -DELETE FROM `gossip_menu` WHERE `entry`=840 AND `text_id`=1451; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (840,1451); -DELETE FROM `gossip_menu` WHERE `entry`=880 AND `text_id`=1452; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (880,1452); -DELETE FROM `gossip_menu` WHERE `entry`=881 AND `text_id`=1456; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (881,1456); -DELETE FROM `gossip_menu` WHERE `entry`=882 AND `text_id`=1455; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (882,1455); -DELETE FROM `gossip_menu` WHERE `entry`=883 AND `text_id`=1454; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (883,1454); -DELETE FROM `gossip_menu` WHERE `entry`=884 AND `text_id`=1453; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (884,1453); --- Text Conditions -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=840 AND `SourceEntry` IN (1391); -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,840,1391,0,8,2784,0,0,0,'','Show gossip text if player has quest 2801 or 2784 completed'), -- It's hard to imagine that so much death and despair could be confined to such a small area; yet beyond the swamp is a land plagued by chaos and destruction.$B$BWatch your step, adventurer. The Blasted Lands are the final resting place to far greater beings than you. -(14,840,1391,1,8,2801,0,0,0,'','Show gossip text if player has quest 2801 or 2784 completed'); -- It's hard to imagine that so much death and despair could be confined to such a small area; yet beyond the swamp is a land plagued by chaos and destruction.$B$BWatch your step, adventurer. The Blasted Lands are the final resting place to far greater beings than you. --- Gossip option conditions -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=840; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(15,840,0,0,9,2784,0,0,0,'','Show gossip option if player has quest 2784 but not complete'), -(15,840,1,0,9,2801,0,0,0,'','Show gossip option if player has quest 2801 but not complete'), -(15,840,2,0,9,2702,0,0,0,'','Show gossip option if player has quest 2702 but not complete'); --- Add Any Missing Gossip Option -DELETE FROM `gossip_menu_option` WHERE `menu_id`=840 AND `id` IN (0,1); -DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (880,881,882,883,884) AND `id` IN (0); -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(840,0,0,"Please continue, Hero...",1,1,880,0,0,0,''), -(840,1,0,"Please continue, Hero...",1,1,880,0,0,0,''), -(880,0,0,"What could be worse than death?",1,1,884,0,0,0,''), -(881,0,0,"I shall.",1,1,0,0,0,0,''), -(882,0,0,"You can count on me, Hero.",1,1,881,0,0,0,''), -(883,0,0,"What are the stones of binding?",1,1,882,0,0,0,''), -(884,0,0,"Subordinates?",1,1,883,0,0,0,''); --- Fallen Hero of the Horde SAI -UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='' WHERE `entry`=7572; -DELETE FROM `smart_scripts` WHERE (`entryorguid`=7572 AND `source_type`=0); -INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES -(7572,0,0,1,62,0,100,0,881,0,0,0,26,2784,0,0,0,0,0,7,0,0,0,0,0,0,0,'Fallen Hero of the Horde - On Gossip option select - complete quest 2784'), -(7572,0,1,2,61,0,100,0,0,0,0,0,26,2801,0,0,0,0,0,7,0,0,0,0,0,0,0,'Fallen Hero of the Horde - On Gossip option select - complete quest 2801'), -(7572,0,2,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Fallen Hero of the Horde - On Gossip option select - Close Gossip'), -(7572,0,3,4,62,0,100,0,840,2,0,0,12,7750,1,180000,0,0,0,8,0,0,0,-10630.3,-2987.05,28.96,4.54,'Fallen Hero of the Horde - On Gossip option select - Spawn Corporal Thund Splithoof'), -(7572,0,4,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Fallen Hero of the Horde - On Gossip option select - Close Gossip'); diff --git a/sql/updates/world/2012_02_18_08_world_gossip.sql b/sql/updates/world/2012_02_18_08_world_gossip.sql deleted file mode 100644 index a9fef9bcd76..00000000000 --- a/sql/updates/world/2012_02_18_08_world_gossip.sql +++ /dev/null @@ -1,5 +0,0 @@ --- Fix mistake in Fallen Hero of the Horde gossip update -UPDATE `conditions` SET `ConditionValue1`=2784,`Comment`='Show gossip text if player has quest 2801 or 2784 completed' WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=840 AND `ConditionValue1`=2704; -UPDATE `conditions` SET `Comment`='Show gossip text if player has quest 2801 or 2784 completed' WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=840 AND `ConditionValue1`=2801; -UPDATE `conditions` SET `ConditionValue1`=2784,`Comment`='Show gossip option if player has quest 2784 but not complete' WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=840 AND `ConditionValue1`=2704; -UPDATE `smart_scripts` SET `action_param1`=2784 WHERE `entryorguid`=7572 AND `id`=0; diff --git a/sql/updates/world/2012_02_19_00_world_quest_template.sql b/sql/updates/world/2012_02_19_00_world_quest_template.sql deleted file mode 100644 index 76ab51f803b..00000000000 --- a/sql/updates/world/2012_02_19_00_world_quest_template.sql +++ /dev/null @@ -1,14 +0,0 @@ --- Shadowmourne quest chain fix by nelegalno - --- Limit quests to Warrior, Paladin and Death Knight classes -UPDATE `quest_template` SET `RequiredClasses` = 35 WHERE `Id` IN (24545, 24743, 24547, 24749, 24756, 24757, 24548, 24748); - --- Quest relations -UPDATE `quest_template` SET `NextQuestId` = 24743 WHERE `Id` = 24545; -- The Sacred and the Corrupt -UPDATE `quest_template` SET `NextQuestId` = 24547 WHERE `Id` = 24743; -- Shadow's Edge -UPDATE `quest_template` SET `NextQuestId` = 24749 WHERE `Id` = 24547; -- A Feast of Souls -UPDATE `quest_template` SET `NextQuestId` = 24756 WHERE `Id` = 24749; -- Unholy Infusion -UPDATE `quest_template` SET `NextQuestId` = 24757 WHERE `Id` = 24756; -- Blood Infusion -UPDATE `quest_template` SET `NextQuestId` = 24548 WHERE `Id` = 24757; -- Frost Infusion -UPDATE `quest_template` SET `NextQuestId` = 24549 WHERE `Id` = 24548; -- The Splintered Throne -UPDATE `quest_template` SET `NextQuestId` = 24748 WHERE `Id` = 24549; -- Shadowmourne... to The Lich King's Last Stand diff --git a/sql/updates/world/2012_02_19_01_world_quest_template.sql b/sql/updates/world/2012_02_19_01_world_quest_template.sql deleted file mode 100644 index 2f888f08cdd..00000000000 --- a/sql/updates/world/2012_02_19_01_world_quest_template.sql +++ /dev/null @@ -1,11 +0,0 @@ --- Dire Maul Book Quests - -UPDATE `quest_template` SET `RequiredClasses` = 1 WHERE `Id` = 7499; -- Codex of Defense (18357/7499) -UPDATE `quest_template` SET `RequiredClasses` = 2 WHERE `Id` = 7501; -- The Light and How to Swing It (18359/7501) -UPDATE `quest_template` SET `RequiredClasses` = 4 WHERE `Id` = 7503; -- The Greatest Race of Hunters (18361/7503) -UPDATE `quest_template` SET `RequiredClasses` = 8 WHERE `Id` = 7498; -- Garona: A Study on Stealth and Treachery (18356/7498) -UPDATE `quest_template` SET `RequiredClasses` = 16 WHERE `Id` = 7504; -- Holy Bologna: What the Light Won't Tell You (18362/7504) -UPDATE `quest_template` SET `RequiredClasses` = 64 WHERE `Id` = 7505; -- Frost Shock and You (18363/7505) Closes #4727 -UPDATE `quest_template` SET `RequiredClasses` = 128 WHERE `Id` = 7500; -- The Arcanist's Cookbook (18358/7500) -UPDATE `quest_template` SET `RequiredClasses` = 256 WHERE `Id` = 7502; -- Harnessing Shadows (18360/7502) -UPDATE `quest_template` SET `RequiredClasses` = 1024 WHERE `Id` = 7506; -- The Emerald Dream... (18364/7506) diff --git a/sql/updates/world/2012_02_19_02_world_gameobject.sql b/sql/updates/world/2012_02_19_02_world_gameobject.sql deleted file mode 100644 index 88a1f2e3a4c..00000000000 --- a/sql/updates/world/2012_02_19_02_world_gameobject.sql +++ /dev/null @@ -1,4 +0,0 @@ --- meeting stone for UK -DELETE FROM `gameobject` WHERE `id`=188488; -INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES -(245, 188488, 571, 1, 1, 1237.301, -4948.268, 36.02063, 2.495818, 0, 0, 0.9483232, 0.3173059, 300, 0, 1); diff --git a/sql/updates/world/2012_02_19_03_world_warden_checks.sql b/sql/updates/world/2012_02_19_03_world_warden_checks.sql deleted file mode 100644 index 3698c461358..00000000000 --- a/sql/updates/world/2012_02_19_03_world_warden_checks.sql +++ /dev/null @@ -1,802 +0,0 @@ -DROP TABLE IF EXISTS `warden_checks`; - -CREATE TABLE `warden_checks` ( - `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, - `type` tinyint(3) unsigned DEFAULT NULL, - `data` varchar(48) DEFAULT NULL, - `str` varchar(20) DEFAULT NULL, - `address` int(10) unsigned DEFAULT NULL, - `length` tinyint(3) unsigned DEFAULT NULL, - `result` varchar(24) DEFAULT NULL, - `comment` varchar(50) DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - -INSERT INTO `warden_checks`(`id`,`type`,`data`,`str`,`address`,`length`,`result`,`comment`) VALUES -(1,178,'07F223143C69271AA2A851FECF6DC883A9D3A7DBA6FE26CC','',710730,23,'',NULL), -(2,191,'C7D18F99DBC446A4B36E78B9130B6FA2E365B3D2D4199DF5','',28940,17,'',NULL), -(3,191,'AA1A8559776F873F26954F15E49E6041EDC2C3766AD87A59','',21826,11,'',NULL), -(4,178,'5F342A4D0EA9DB35F93FAE6E32670D810F017309817AA7C0','',676970,23,'',NULL), -(5,178,'C57BD89DD447131EA2083784AB4DA8BD58CF3E182F1D8AF6','',690106,23,'',NULL), -(6,191,'69AA85EFE8A1A990DA5ECFED4FAFD5B14F1D52EF2548FD15','',12905,36,'',NULL), -(7,191,'083ECAD073DE2D61E3564B4BF767C9D1F8F15AA0495F5A76','',41096,24,'',NULL), -(8,178,'C774D64EF60AD5A141FC56F3D02AE78AC147770FAE25D8FE','',3037164,22,'',NULL), -(9,191,'502C59CAFEA11E9584C13BFE75F85EB79936AEEE31B44165','',12194860,37,'',NULL), -(10,178,'4FBE8978A662428C616AABD71DA5562E4AC21F54BEB8ADBF','',3037164,22,'',NULL), -(11,178,'83D3F7FD7DCA144AD8219A6A4E20F0CFC6E7EA208C4144FF','',3033068,22,'',NULL), -(12,243,'','',4623652,7,'578B7D08578BF1','Pointer to realmlist address'), -(13,178,'00523153EE2298A8D80D7B26B7067CA7B26AC06FF374FE7B','',673210,23,'',NULL), -(14,191,'91BC368FA14A3FE3E13D0B1056F485F846925E613D8E8903','',12194860,37,'',NULL), -(15,243,'','',10010636,12,'8166443FFF1FFFD9565CD95E',NULL), -(16,178,'8FEFDBC58301AB0E0D0F6EBC5FBDA5ED9A7126873A9AB337','',682394,23,'',NULL), -(17,191,'B40FF92D4F092599EA9014C88B474DE4352C3F1635109882','',448492,48,'',NULL), -(18,191,'42B596FF923054531E4918DC39E08F8564FED16D559B494A','',29852,20,'',NULL), -(19,178,'24291D6733A7CEFA3D54C3BCCAE95D56D8365BAB42AEE1CE','',3037164,22,'',NULL), -(20,178,'6C4E321E2D5A153F2BB664EB6EEDF8D67FDE7ECC8076D087','',3990720,23,'',NULL), -(21,178,'FB649706C8F1AFF5990B5F3118DFE54FF6F9609C6991C161','',3045776,31,'',NULL), -(22,191,'D1B451C906B81261B048FD4025217245950C11660815367F','',28920,23,'',NULL), -(23,191,'40079A1083A6B57E3B713992BD395FB6650B631E4C4B8D4E','',29852,20,'',NULL), -(24,178,'3F8FEFE08CB358D6613656AFDB498AB8C599BA18B5574FB6','',682378,23,'',NULL), -(25,191,'EECA71B5536EE1992FD7825A5CCC4B7F9F3B413C0DA498B6','',29884,20,'',NULL), -(26,191,'B8786BFF2421ED1F1FB30F3F0BAF671FC1DAD5B3B33124C8','',28956,17,'',NULL), -(27,191,'BF0C842D635D9D8B3F6FF84EF6DF7C963C485EBAF02D17B0','',28920,23,'',NULL), -(28,191,'9672ED2A27C4972E04DF4471C95492C721024E241995170C','',36924,24,'',NULL), -(29,191,'63532B056020A261251BD24AB026BBC5D4468AF863136044','',17906,11,'',NULL), -(30,178,'7D38C80FEAB10B857A4A7BEF15D27A58FB43FD875E29C73C','',3990720,23,'',NULL), -(31,178,'B158752316672A90BF29846E7AD64BA4FD1699C638BFD3B6','',2299116,33,'',NULL), -(32,178,'4549AE7CA28700562D996CBC78FA7341DC05F644C01474E4','',3000288,31,'',NULL), -(33,178,'EE77806A4F5723FD9C6FC6F43308C8AB448E0A139CB43700','',690106,23,'',NULL), -(34,191,'046D6EA3E99E275F51CAA591BD8C478B6F964A3072018F43','',21660,15,'',NULL), -(35,178,'B1682CE919907AD7D8990F3D8272CFF24A996162565D52B4','',676970,23,'',NULL), -(36,178,'22E057649A8BF1D9672841EF47A4DA175AAC082FFEF059DA','',710730,23,'',NULL), -(37,178,'7BA62D5F5CFEB545D1AE646962F4EB9A91B93EF8FFD5D1B0','',710554,23,'',NULL), -(38,178,'702802D919D9E5C3FD42CA9188936C73E47F87CFA419025A','',3033068,22,'',NULL), -(39,178,'FDA6D997BFB8A991B57755633D1AB3C7E567A74C1EC09937','',3070052,22,'',NULL), -(40,191,'84F6BDD28490937867774E7BF8D5B78F68BF9EB43DE90F10','',477912,60,'',NULL), -(41,191,'5A5B4BA32BD937FF253016AE836DD44B794F8D05982860A6','',447736,48,'',NULL), -(42,178,'A243986665C7FCA1E60A9F209DE9431C3098D082DF1C4528','',682378,23,'',NULL), -(43,178,'7CC89374CE3A9C07DCD685006690B828931D60085EE5FEE8','',710554,23,'',NULL), -(44,191,'01F10590E6DFED79523D26C043D5424174BEF1011F3F4974','',477928,60,'',NULL), -(45,178,'C9728BDC4B77BAA7B3515AFD3628EDB0986DFA20B46917B4','',672746,23,'',NULL), -(46,191,'179B80E5E054521E44BA8F5978D5FC489CC9E514B350A3FF','',28956,17,'',NULL), -(47,243,'','',5417948,5,'7734FF2485','FrameXML Signature Check'), -(48,191,'7769A67D6E2460450873133B0CFF99B67A58CE6C404A17F8','',17282,15,'',NULL), -(49,178,'CF3896074EEBC0F93B539FD44E4D825227D4C1556B8F2279','',3990720,23,'',NULL), -(50,178,'88F2833B5267A71A0CA72509C40819B99283A6E556FD9038','',198,10,'',NULL), -(51,243,'','',8491566,5,'8B4D10890D','Lua DoString'), -(52,178,'F7229DF2D879A9E8D5BCEDCDC7046D75BAEE1C9D4DA41E55','',3638348,23,'',NULL), -(53,191,'AE78585CD862134059B13669FC416B8124752EC6471DDCE6','',28940,17,'',NULL), -(54,191,'B408E9F9B475E4B6A81F9B7F2E060824F618FFDABBFFE805','',13634,11,'',NULL), -(55,178,'A9DA016B83961F95097E08F2DEBE69517C7573FFF06D8C4B','',668874,23,'',NULL), -(56,191,'0E74160C242EF826D09BCE4ED535E9A9D251B1CD20E31891','',24812,14,'',NULL), -(57,178,'A58E4D44D952C1F9DB7B5E423167EE4C28AD02668C5B86AF','',710730,23,'',NULL), -(58,191,'35A9FC42ACBF3A147B0C8CF67BA04EC979C6534B20249B45','',28956,12,'',NULL), -(59,243,'','',5345746,7,'746583F9177760','Lua Protection Patch'), -(60,191,'1430DC4A627EA5FA2CFF9C010CE16022F259F81DB6047879','',13634,11,'',NULL), -(61,191,'85A005398AF851382267C01BB6FB04AEF2093213C20EC200','',360508,13,'',NULL), -(62,191,'96916CD89649027A9A8BBFBD28AE190CD5D590E24BBAD451','',13033,36,'',NULL), -(63,191,'056D57A5C1A46883400E1F69405750B23DE18C3032C3D91C','',27270,13,'',NULL), -(64,191,'87C641E1EDBD96D9F170C7BE0FA13F45611DCDF41AC02526','',41127,24,'',NULL), -(65,191,'1F378DF1E7BD99164DDC7401A98CA5E9551BD50B4A35D5AA','',34176,25,'',NULL), -(66,178,'B5ED443D6CA2F6095BAC8DAFDC8F3413F7B473916357C17E','',209352,75,'',NULL), -(67,191,'A2BC3FF01787A38CB88B3EF45C1CD97DA113157FC395D38C','',30012,16,'',NULL), -(68,191,'190862E5018F1428E5B12BFDAD08283ECD057B34AD722846','',41228,24,'',NULL), -(69,191,'6E0E55BE8690F64442E275559E6C9F8A3FDCAA00937D1C13','',49347,24,'',NULL), -(70,191,'B6FC4C07BB2CBE7C5C854CD99DAFEC0D1AE4101FC51460F9','',477912,60,'',NULL), -(71,178,'3B5955C3B498489869990F08A4CAE566A7D689C23990518B','',156,8,'',NULL), -(72,243,'','',7246064,6,'8950108B450C','Movement State related'), -(73,178,'F24317DAA28AA477996EEBB9538A89569ABF9B185A3EA4E4','',718842,23,'',NULL), -(74,178,'DA25A4134671325719833878E2556455EC4321A2207B6728','',198,10,'',NULL), -(75,191,'DC9490A7BEB43C64585E013B5260BE843D126EB3BCEBAC11','',50040,26,'',NULL), -(76,178,'4BB92BBD5CA8C192C9D0E1EDB6C21FF3F4A61ED1B151365F','',673210,23,'',NULL), -(77,178,'13E8DD1C9F5501A270A59CC4B61311F6D5D18DC3F2AA351A','',3037164,22,'',NULL), -(78,191,'346CFA39FF98198BDE1C23673FBF51A50CFF5ADED784F077','',17522,15,'',NULL), -(79,113,'0590FC57AB448975FA46C314A8AB75AF96DF0FD0A3D9FB23','Afd32uu',0,0,'',NULL), -(80,178,'E37D413DC96A92D3CEAB8A482B8F5397587A0E654C9A0166','',672954,23,'',NULL), -(81,178,'E7D5551799C2C7F0072BC3149A22F37D09EA1EB83F64C655','',3045912,31,'',NULL), -(82,191,'7CC5260578671130CA5B3392BA5CFD0F3DE0BE1085E556B6','',9977,32,'',NULL), -(83,191,'F44A40945F24385D089E040A733553EEFF92EFAAB0636323','',134968,32,'',NULL), -(84,178,'D3122CF30EE55310CF4A710E61B190D2B108227B746B41AD','',679578,23,'',NULL), -(85,191,'7E3CC1BC53477D84F05F623BBC94B9DE8D01A2607CA935DB','',41188,24,'',NULL), -(86,191,'DC06565CC1512B5A91A848E08BC4FBC6DA705F6503667852','',41127,24,'',NULL), -(87,191,'03DC47CDFBB14C5CF0D0010FA5424556F951585588A2180A','',29916,16,'',NULL), -(88,191,'29EC91C4D87891FECDED381CE65A86A259F00DD788833E4D','',174688,37,'',NULL), -(89,191,'31F024003681765368F6EFB667E83CE1D12799723AA99BF9','',685304,44,'',NULL), -(90,191,'6A82AC1D0BFEF5DA7385510CBC57189FACD42E45E0D2A65E','',30012,16,'',NULL), -(91,191,'3901FBD52655E12ADA4EEDED3B365B1DDFAAA925A140097F','',448492,48,'',NULL), -(92,191,'6E9991A25EC347BEA5813EDE0A842D746779C97606565B5A','',17906,11,'',NULL), -(93,191,'0AC9F2B104AC5AA9131FB14E669B98D30D056936625B0245','',27270,13,'',NULL), -(94,178,'A338B3DA78A6683CBEE08A63C5EEFBE1AF33BF54983D583D','',684876,29,'',NULL), -(95,178,'38759C29F2ACF42DA9D16EF35837A470DC7C42C3284B2A3C','',3049492,22,'',NULL), -(96,191,'F35817564FC39F4DB7994021352FEEB86E2FEE86C11B8DBB','',360508,13,'',NULL), -(97,191,'09FAC087283873DAEE0AD074ABF7DDB1B395F5CF6BC2141E','',28956,17,'',NULL), -(98,178,'87FE57916743AF3C97CC3B583B29E89B6E503D31D1747B64','',676970,23,'',NULL), -(99,178,'97D854645011BAD1F6625679511D78D1B7367A51EB0FCC6E','',668874,23,'',NULL), -(100,178,'12369F6F1B875FB5CC5E67445ADEAE2B295D196596679317','',0,9,'',NULL), -(101,191,'5034278808E93A3DFC9BEFFD8E180FEFA24DFC5056ED3BE1','',433168,48,'',NULL), -(102,178,'55EF16220A7EF3F74A9D895821610DFBD2A757FB05C792D5','',209352,75,'',NULL), -(103,191,'67445533AA0BB737D2F74C9258148C6C667794F0E3D07498','',45324,24,'',NULL), -(104,178,'AA8649100B17A9C5BE227F47F867FADE51AD242BAAD39821','',3045632,31,'',NULL), -(105,191,'85545FE9242B2474574EEBABBF452FBD11497073CB1E46A5','',41080,24,'',NULL), -(106,191,'9DACD6981681F53650B681EAE68065D26F4803682058709D','',448456,48,'',NULL), -(107,191,'96B74F1436A05E658E3282164BC3CBDF4DBBB2CF6A5B866F','',9977,32,'',NULL), -(108,191,'033BD6861DF7878DC9470EC2F699772BB2F3D5000490866F','',90202,13,'',NULL), -(109,113,'B797D0AF3164EE83167D5C054A511A5B209A70C6655C408B','IPSect',0,0,'',NULL), -(110,178,'D91A2764435C5091D3F9471AB8B5F397E609330294694488','',710730,23,'',NULL), -(111,191,'94EED02DCDB71789E50917DA401A03F4B91BDBEA050D8BCA','',3766400,37,'',NULL), -(112,178,'2DF33CBB544E2D5238FB591F2547AC507B4D8A652D789F2B','',2303444,33,'',NULL), -(113,243,'','',7860712,5,'742DF6407C',NULL), -(114,178,'81A74F35F0F887144D59F93647C18C70C5FEEF542A7F3782','',709322,22,'',NULL), -(115,178,'2E1F8A68FDDF084A950B786A1EE7E0CE43E62449A56F92A3','',3045632,31,'',NULL), -(116,191,'B1F8988B6664A90E79503FA5D843C3CB97BFDC23EB8C7690','',433168,48,'',NULL), -(117,178,'0277E26DE31814DFD675A59E526669E39080E033BAE88859','',0,9,'',NULL), -(118,243,'','',10714892,8,'BB8D243FD4D0313E','Wall Climb'), -(119,178,'09BBFC19FCADC69D6B5BF655A5BB6350B4A8120C3EB557D2','',3990720,23,'',NULL), -(120,178,'BF4ABDEB726B0060E74701C03180C3CB02170ADCB7DCB61C','',3049872,31,'',NULL), -(121,243,'','',9990741,9,'8B878000000089463C','No Fall Damage Patch'), -(122,178,'D259A46A6D1855C436BFC96FB9376BDCDF5E9FFAE8B4147C','',3045616,31,'',NULL), -(123,178,'F425A62A44097742D72A05669B6BE93AD9CEFE9E40D71E48','',3045976,31,'',NULL), -(124,191,'B134291F515D136B6576FFBC0133C7859755974611170D07','',20512,16,'',NULL), -(125,191,'125BE691985D8DB37068DC14D74EA2DA1260E4A63D3F74BF','',45324,24,'',NULL), -(126,178,'E06E3C5B356B34BA92F6765108556AD53ABB74B986D5810E','',3070052,22,'',NULL), -(127,178,'8CC87DFF61F2EC82DE033865C9879010D94E1614369FE286','',710554,23,'',NULL), -(128,191,'E1F5233450FEFFB6F0E8F2B17683047A485828FEDD3E5B80','',448456,48,'',NULL), -(129,191,'31BA6EA4DF2362676AB71F4CB60B0D40FA51A3AABD25D5CB','',36924,24,'',NULL), -(130,191,'C14630E1D519EB85C254C536FE81DC490977E869BD5CD884','',12985,36,'',NULL), -(131,191,'B337F892EEDD52A5B978C116A19D927134273626EFC4DAA3','',17890,11,'',NULL), -(132,191,'D97560108AA21A487EC9278759F7615BFA304A933776A201','',18680,35,'',NULL), -(133,178,'DA59505BA61459508532CBEAD246DCD2C8E7BF5C6D3CE676','',3037164,22,'',NULL), -(134,191,'5803CA69E5B7F1DF08D95219894D75F52EDB1AD429E562D9','',174688,37,'',NULL), -(135,178,'8A1099E19139D91573286DBB3DED2CC093A99FD178F7FEC8','',3033068,22,'',NULL), -(136,178,'0331B438B085F55C06F7F697160845BE953D9CE789AA62A4','',3000288,31,'',NULL), -(137,191,'E844078A5671FF7DB0621E7F1C7EDDF9C92F5A9FA0477FCB','',41023,24,'',NULL), -(138,178,'AAD7F47B231861913F353341FD26E5AA89AFB586FB6A5366','',672746,23,'',NULL), -(139,178,'136DFB3FE66D2830DF46EE155FCAEADC9624FFE1410088DA','',3041472,31,'',NULL), -(140,191,'C6015A0D5C9109768BA4233639A51F163CC7ED58749E5026','',25724,20,'',NULL), -(141,178,'9C668CE4D328EEA9B6AB7AD5FF54169289B35B230275A43C','',3049872,31,'',NULL), -(142,178,'FC3C95E71F968C46BD5DB5C9EF9B0A5BDCC5619B805046F5','',2299060,33,'',NULL), -(143,178,'FBE3808C0E36BFBC1D1F5A0E508CA89E81E550CD2FDEEC48','',149,5,'',NULL), -(144,178,'35A8252DBC65514E858256C497141153812EE61C724BF5A9','',710730,23,'',NULL), -(145,178,'CC79AA9AE29A52A998181D183D38974221B8BAC0AB534E7D','',0,9,'',NULL), -(146,178,'B89F25A249D295580E649F5ABE0C65EC24401F4889A4FB16','',668874,23,'',NULL), -(147,178,'742A0A9997B9E857C355AA75797466506BAE73D44D26399D','',3037164,22,'',NULL), -(148,178,'E7975701601B2FDF8262098521B7BB4FF5CCC484F8E919E7','',3045776,31,'',NULL), -(149,178,'43E81BE830F169F4EDD23B84ABFA9D15EF12C978FE134346','',60648,56,'',NULL), -(150,178,'66CA9E464A2122E301A72FAEF13A4853D8CB1A45C177E854','',178504,96,'',NULL), -(151,113,'0A3C294B0799FD2C9EC17C1CCBCD174A51B6A2ECC62FEF17','IPSect',0,0,'',NULL), -(152,178,'6E9CE81BFCAF0C250705FCC599981D2D9E4D474A7E857B37','',2299108,33,'',NULL), -(153,178,'8734D6E081D5C993DCE8161CFDFC6197F39A487E4083A3E1','',149,5,'',NULL), -(154,178,'A33355AF7B5FF3CECB3A6059F6621F30AEE695D69421EA2B','',3049492,22,'',NULL), -(155,191,'BF8CEA63013511BDE0B551DAAC492DFBB9608645140B88F7','',29916,16,'',NULL), -(156,178,'8D5D5E99EAB2ED21A104913B05D6BD7A8E63ADA56B66CDED','',3022016,31,'',NULL), -(157,191,'778256BFEF82EA60C4E0F25083655FB2BB75B83FD60A9C06','',18680,35,'',NULL), -(158,178,'43FB8007D7DD7B01FFBEEA3EF9D0242778565544281EC761','',0,9,'',NULL), -(159,191,'94DCF5D21FE2106F5303216C14AD55EEDC1B19FDC91D5F76','',28704,16,'',NULL), -(160,191,'7EBBF90F7D8462D1453479DF9AC5943AF483FE2828C74FDD','',477928,60,'',NULL), -(161,191,'A171148491E099B12CCD1708B784D8C3B09737772C7780C0','',401992,14,'',NULL), -(162,191,'5350ACB75F9FA498FE0D2A371649C9FD9716BDDE2C32F5FB','',13634,11,'',NULL), -(163,191,'85E53280630956C58D4CA7FD8DC5FE73C9A2A03314DFF294','',45223,24,'',NULL), -(164,191,'391BC8A81D4EB6D526BAF0DC3468CAA36C9207B82E194B7A','',130380,14,'',NULL), -(165,191,'0F88FA5CD9B9950F850C18FE76C948FF43CDDE3E75638FF1','',17938,11,'',NULL), -(166,178,'EB63FC60164AFF92726DA658882BF1CE47CF0BF6C80B1B97','',690106,23,'',NULL), -(167,178,'E30B2494142B416BBE95DA3DAE4A82CBDF3A020715F10E8B','',4011280,23,'',NULL), -(168,191,'6CA1C19D0E9191CBC9CA3D5BC3CF1D19764D8F17C6B54AE4','',59620,13,'',NULL), -(169,178,'4730B7A7EC70544A688211A5C754C357A090116092D3EC4D','',682378,23,'',NULL), -(170,243,'','',10000022,6,'894644894E54',NULL), -(171,191,'713A7B79619AEF3C47E44102F86EDCE0D6AFBC5ABE87F861','',13538,11,'',NULL), -(172,191,'575F1C6AF7C71085C7D9CB2291844D9F2DA3B71391C0B941','',36907,24,'',NULL), -(173,178,'296F233E4FAC4CF419D5FBF2701AC4D5AA0866CB4D0DAEC6','',3045976,31,'',NULL), -(174,178,'933C1A228C99E35DF309838B25B7D5EA3A8E961E81D81D32','',673194,23,'',NULL), -(175,191,'9EC125252C3738478CA942DCB59030097194B284A9162B32','',59620,13,'',NULL), -(176,178,'6665F3FB8DC6BE71C152C3674B5783D6E57FE8BF796D190C','',3634252,23,'',NULL), -(177,191,'E120DD63042FEFF9E7FCEC0CA44D2544F03C5D4CDBA1C008','',12985,36,'',NULL), -(178,113,'09BDABA6CB17BE561B4104124A3D0266C858D194A8765198','drvsys_mon',0,0,'',NULL), -(179,178,'3AAE69E7088E4060EA32EF95E9B6D9532460F5B84EE4EC80','',684876,29,'',NULL), -(180,191,'990D4E1C2D63C8E447F034642686D57B727064E3EDE13B00','',448500,48,'',NULL), -(181,191,'E88F31BDC5513216CF3701CAF8BE954CCC7EAE0E7AC7D942','',594348,26,'',NULL), -(182,178,'81229C1E56FA72E01B52E8CBB8BB5F55ED48A11B72E7729B','',710554,23,'',NULL), -(183,191,'B4D0CDE7D53493A1549328F711013F07DBD3A9BE88DB2EF9','',685304,44,'',NULL), -(184,178,'D6CA6F94FF248F722F97037C1AE7C8DE0191D5F4D1E3A5B8','',156,8,'',NULL), -(185,178,'9C9DF1E868BB33D43676F21096C4F75759C0807096EEB886','',60648,56,'',NULL), -(186,178,'1C79B3B5A74A4F09A1FAE19BB15CDCF26B5F917861071F1C','',198,10,'',NULL), -(187,178,'AC1AD3E831A4C758858350A8A197A24FE82583F4B0E39A85','',3049888,31,'',NULL), -(188,178,'56E4980485E3129E94F370E7066E80B07141C4A669B9FC0F','',672746,23,'',NULL), -(189,178,'C21574305E0377A3D2B72D1E1546B9D62DCFA8B1A4405F16','',3638348,23,'',NULL), -(190,178,'AA74121AF835978BC1C1BB402A8B7388CB7C075C1227C253','',3049888,31,'',NULL), -(191,178,'D6457A86DFADF9825D6093090AED2A807FE7DA6ECF5922AF','',3065956,22,'',NULL), -(192,191,'1BAB7E6B5ACBEED8F54B667EDF13A385B9E146C0C50D9FB7','',448456,48,'',NULL), -(193,243,'','',7517484,7,'7518683B010000','Follow Unit Check'), -(194,178,'01000FEAC61ED76FE04ED1169C40289D96C71A1564E38FCB','',690106,23,'',NULL), -(195,191,'F095338ED87C658C916CC604A427F4ED95309C4A07B7898C','',34176,25,'',NULL), -(196,191,'800E120187DF74A231722FB887B3944AD16A703FB8CB9D39','',28920,23,'',NULL), -(197,191,'2CFCE981C322A54724E1418B6A6D1896B95D584630EEEA43','',38300,21,'',NULL), -(198,243,'','',5081862,8,'6840AAB600C60200',NULL), -(199,178,'481751066D6C97AD5EE90173E8ED107BB1C9FD873B0CE55A','',3037164,22,'',NULL), -(200,178,'7FC57D49535798CDA7E4DC5DCEA2E085AAB9A68BF7F9469D','',149,5,'',NULL), -(201,191,'33357C112DE0195F013FAAC4D57AB1BE77417934CE03A2B9','',3766400,37,'',NULL), -(202,191,'BF8AC678DC3CD354BADBFE46C9173D34CC84D13302190EBB','',21826,11,'',NULL), -(203,178,'4E2F9721D52A7552AE2728B9695F1523DD62DC0569237C3F','',2299108,33,'',NULL), -(204,191,'9F015E7D8A11F30AA1954D9FEA7142D0247E3C09FF2BFF72','',12194860,37,'',NULL), -(205,178,'1EB5AD39B94DB5CDC3294DF49FA589DFBE2C674D07E4B211','',710730,23,'',NULL), -(206,178,'E9D67F07E035A64B89C9E91614DC1930FEF61DC3A5C1BBA6','',690106,23,'',NULL), -(207,191,'36411C2FF2C3AC51B7F6A6B8DF61DBD4E5895C27438847BE','',59620,13,'',NULL), -(208,178,'A77F30CBB8057E0DB37782367C8462FA98D4DB21DE936ECD','',3049492,22,'',NULL), -(209,243,'','',7452688,10,'8B81CC07000025000000','WoWEmuHacker Injection'), -(210,178,'A8C806E1FB7CA3625E6BB6F5E4D9E2BF0EBDBE70BA7226F7','',3049872,31,'',NULL), -(211,191,'B3DD04807DEA2679045F4F197BDDAED5C7CCEEFE19622B43','',360508,13,'',NULL), -(212,178,'B075C8B4D8C5D83FE703677319491DC816EA5103901B44A8','',682394,23,'',NULL), -(213,191,'53DB506C0341B50BEA3897E2E3C0DD74C2CA2D8F5F34A2E4','',59620,13,'',NULL), -(214,191,'E112F38956124FE0F48BF569F5E81B40E293DC6E16B544D6','',17282,15,'',NULL), -(215,191,'0363EF2B1AAE09E6C2B1FA555E706F4EE094BE678DA27598','',3766400,37,'',NULL), -(216,191,'EA256F01B6340C99E27611B39C5ED28CF2FA202436F0972F','',49564,24,'',NULL), -(217,178,'A86C95C4E58495A10F5F1C9B5B62D3365132E8DC62863E8B','',198,12,'',NULL), -(218,191,'56DD8D99991F83AFA2E169315B395BD388B248340E9C64D3','',30044,16,'',NULL), -(219,191,'684B23E010C3D6B88CC12BD9F0B6B0CE00D692C71BFB84A8','',28940,17,'',NULL), -(220,178,'83AEEFCDF4C2E80B18DDF93D99120A89F916C19206D257AB','',668874,23,'',NULL), -(221,178,'D68651921F5CD387C7E860FB7C3B143409735748E3B2FB7F','',682394,23,'',NULL), -(222,113,'A4D501A9DB9D84BD8695A8BF61FC853BF434D2D4B352C7A0','HideEx',0,0,'',NULL), -(223,191,'5E77F12C032D4FEF559F9B837B85BDB9D95ADB10C9F56649','',448504,48,'',NULL), -(224,178,'F08406AEDFA8F19B6FB7C9ADDE0BFEE82CB0D2E275593150','',2303444,33,'',NULL), -(225,178,'AC0EC72522ADA5B2BFFAFAC92D6D0A0225E1D5C727CDFFA7','',672602,23,'',NULL), -(226,178,'4D1A7D1C88AB04438510E3255184E51EAE2036BB09DB553A','',700714,23,'',NULL), -(227,178,'68BBC36F75DC763B573DACAB1D6D8F70E667638AA894BEE9','',717898,23,'',NULL), -(228,178,'2AC3C23FBDE2C1EC46C9ECFF71BD7F603F17C9DFC1328D1C','',3638348,23,'',NULL), -(229,191,'C365E9FE00580EBB14EE863A5CE3C8139B1A59A610520AE7','',3766400,37,'',NULL), -(230,178,'DB2A0451B9753100085C9D149B61CE47A195D77C8B709143','',178504,96,'',NULL), -(231,178,'0871F69205FA62C74C2DDE200A3911FC3E41A4FB8BAB9817','',682378,23,'',NULL), -(232,191,'0017307F2FF889462B0FA06018D99EB1F847F189B6CC9B99','',21826,11,'',NULL), -(233,178,'0FEFCD6B0BF8C2816A9259AB5FD7B89231AEB8D92DE53D26','',3045356,22,'',NULL), -(234,178,'87EAD79656133B3183C2E452886D8F00C5EC6C9D741673A2','',3037164,22,'',NULL), -(235,178,'C2B6C5E19FA98D121B2CDE51789BD2883A324015E7D131E0','',710554,23,'',NULL), -(236,178,'B6F3A7D557A3E3BC4833C3D9B6B0B0609255591CC8AB3B65','',3022016,31,'',NULL), -(237,243,'','',5283280,12,'558BECB8084E0000E8731DF0','AddChatMessage'), -(238,191,'AEA87B23CD9463E9693B6C053C1D9030F8E229DA308DBF29','',90202,13,'',NULL), -(239,178,'8C16C7E8EEAD49AE67E4E91E229FFBCE2F6590A48348914E','',3049888,31,'',NULL), -(240,178,'7B2DCA97CD348E45490C288EADE9303CE270CF57F28EB1E4','',690106,23,'',NULL), -(241,191,'BC10B10BE398F2397FA6962C4E59C8CF11FDD7158EC222A5','',29916,16,'',NULL), -(242,178,'8E53EC1B8ABE90C9A5C087671DE0A3007BEA4488EE5415D0','',3037164,22,'',NULL), -(243,191,'65B5CE07A794164101F7E379D21A7A544EF1EC2A3A39A2D8','',27270,13,'',NULL), -(244,191,'C6C8597824F249180A53196699421ADF7857A5C4E4F80D6F','',13033,36,'',NULL), -(245,178,'FE677759E719178BC5CB49DA252D9B635F76030FC4C9876C','',673194,23,'',NULL), -(246,243,'','',5265823,5,'72118B5518','Language Patch'), -(247,178,'BA2D161EF412084B0229A08E64D5A445C4E9F9F2645535E5','',706314,23,'',NULL), -(248,191,'0174B647A535F206711D3EEEF08D3F421BCABD7016A2F103','',17282,15,'',NULL), -(249,178,'5F5F754FD6E7BAC9650B715387646CF992813730A2BA37DA','',2303444,33,'',NULL), -(250,178,'D2CC7F98209E9A9BBA483BD1E9A916E40EB971EE2129AFF8','',3990720,23,'',NULL), -(251,178,'E8C741CC79005898FFD0026821F61A2E4E67C695C6E1CE1C','',198,10,'',NULL), -(252,191,'23B364A9012EF40A39EC4D04A91F9B60FC7EF7D85E3F240A','',18680,35,'',NULL), -(253,191,'C9363F808D37F13FC09EBB7F700AD09EEB27DA046E41FD52','',36907,24,'',NULL), -(254,191,'2D92FC5B8603E18F50D9CAA0922F5C7BB89E42A4656ED2D5','',3766400,37,'',NULL), -(255,178,'EDEDBC5B1A3D92D2A91192118898FDBF840C967C82968D70','',3045912,31,'',NULL), -(256,113,'BFEF06E80472106B57B15D711F94A25243F6ABA7FE354C95','ndis_x86',0,0,'',NULL), -(257,178,'FB20B0EB9ACF571FE37C6B69CBE86F7906F96B996D7E5EFA','',2303444,33,'',NULL), -(258,191,'917AC1C48C1FF354FD594A3705C70A2C356FE981275E7FB5','',22792,25,'',NULL), -(259,178,'48CD29D8B39DC07B0FD071FD8C643E07A8FC2C9AFC2A3083','',3045356,22,'',NULL), -(260,243,'','',11154396,8,'D893FEC0488C11C1','Jump Momentum'), -(261,191,'FB13A8360C8E23B83ED7309625A7EFBAEE7DCF737068C5A6','',174688,37,'',NULL), -(262,191,'3C8D85F85ED5DD0354561F84EACA575123DE05EE941C28D2','',56063,25,'',NULL), -(263,191,'FBC20EEA52B5882209BC016EC14818376CA7BAF28780BCED','',22792,25,'',NULL), -(264,191,'210D85A84F7BE48F3EB427E0CBCCD9C146320ABAAB5E28D8','',41096,24,'',NULL), -(265,178,'953107F9F718795B6DF9E5E5BEE0EA949800CAD0EB71F891','',3037164,22,'',NULL), -(266,113,'FBBA36D0FC5434D12EE1509E148FF908D51F18719CCBEABC','IPSect',0,0,'',NULL), -(267,178,'82CB32BA2A05B228F2F8D0313C185EB6FDC50A94340F40C8','',209352,75,'',NULL), -(268,191,'079172B91B1768A2650A87BAB06AF700BB4C9A0B5E5B983B','',17522,15,'',NULL), -(269,191,'881751DF112F817E799953E00E94543DA4610968437DB7C6','',12194860,37,'',NULL), -(270,191,'9A47B274EAAC888FA2007B4EC0623580365458E3621CC416','',28956,17,'',NULL), -(271,191,'77344CE014111FAAA66DEF35B670B2E76AE878B054F85285','',61874,42,'',NULL), -(272,191,'0A74CBD8DFF245DA5E8691C1174F037D7ABE823E265226AB','',685656,44,'',NULL), -(273,178,'0E13ADDD413B679E2984060D929440064FAC308FC2B90742','',3049872,31,'',NULL), -(274,178,'D0D8CE5001596C6F4A766FE94726FE7E337F42469CB96CA1','',3065956,22,'',NULL), -(275,191,'313C58F8401B47F716B220B88411CAD0E85966D95B301591','',13033,36,'',NULL), -(276,178,'ACBDC68A4D748C48ED1180DD3DA52632EA6FC275BFC35D5B','',0,9,'',NULL), -(277,191,'BACA83A742B9E09CD07787BC6B50389707EA94C41886BAD0','',448504,48,'',NULL), -(278,178,'549B42D266E7F17B7F30B72E301A9CB3C5E3865DE9B7E90B','',60648,56,'',NULL), -(279,178,'86DB854557D75BEEE7DA820FCA15669B08C760E8B165B06F','',3037164,22,'',NULL), -(280,178,'02D5FBD9E30D43ACED0EFD00CF16DAA69EDD262C292136AB','',178504,96,'',NULL), -(281,191,'B9D920131EFC38767012340CF0FFBFE154DBA28E6EF3B859','',61874,42,'',NULL), -(282,191,'96E6CAE70AF690F5D552E0948C29CA9AA527DEBF9731B16B','',20512,16,'',NULL), -(283,191,'375B22B4990997348A8AEDD53319897BE196398B4F1DBAC3','',30012,16,'',NULL), -(284,178,'932F4622AE9F1B3990900F1F88375FA1DD7C238F7C6133C6','',684876,29,'',NULL), -(285,178,'43583C7BCCD9DF14C64CC84710BEE44DD30E199F579890AE','',3049872,31,'',NULL), -(286,191,'97CF98F0BCABA04BC2BAD40FBD4EBFB3C1FD8A7139D5C9B9','',433168,48,'',NULL), -(287,178,'97A0E0F8F8ACE7F1E6492DAFADE8F45B366446E79C1B0419','',3049452,22,'',NULL), -(288,243,'','',5284488,9,'7507C7451400000000','Language Patch'), -(289,191,'C3546D16052E0DC1838E7A6E18936B88CC8A40C2AEC0BE3B','',21826,11,'',NULL), -(290,178,'4179D6BD8C2F11AD5D5C103A7877504074009AB53AE4D8A6','',3045356,22,'',NULL), -(291,191,'2C360CEAB996C8D6E5DE3FFAC30E412DED48E7814D1CE110','',20512,16,'',NULL), -(292,191,'6F1486BE58078BD453F1B249947BB99CB8E17E9A355CE024','',41228,24,'',NULL), -(293,178,'924F4631DC3167BCFAB02F92DDB49A871DA0C55122EF9EB8','',0,9,'',NULL), -(294,178,'411029C5B28D942ED3C7BC1F4299162D874838A661410894','',700714,23,'',NULL), -(295,191,'B9093BAED730E86AF004119B3B7258938C56902915C2E8BA','',501956,48,'',NULL), -(296,178,'63BD2D7FF6C5442795361031E5768C396A37AE38AF98DB11','',668874,23,'',NULL), -(297,191,'754A2FE56037B971E128FFAA669032C511BDA3A62524CE03','',28956,12,'',NULL), -(298,178,'9AEFDCDB62EBC2DABD6CEBF8C411C1145274FCA7CED890CB','',3037164,22,'',NULL), -(299,178,'3AC57BAC3B782AE5ADBB899CCC060D4E8F66E5217F7DF654','',676970,23,'',NULL), -(300,191,'2F0D9702A58D6D5A8599529A0A816AA101AFE581D98416B2','',56063,25,'',NULL), -(301,178,'77804219E627B4D38C9F95194301A895180B598AEFA9963F','',3022016,31,'',NULL), -(302,178,'0D1B99EDC8E458705A88E72F7FDEEE9233DB21290A0098E6','',149,5,'',NULL), -(303,191,'BB795B4069F985BF44C7418DE264C3B0E9BA6D61A116FF81','',90202,13,'',NULL), -(304,191,'5A6EEBA1E6B9EE71BD4A5F63014E9928302C36FC806DC796','',3766400,37,'',NULL), -(305,191,'BA5777AF7FFF3895935669878D662B585912A759A2DFCE68','',24812,14,'',NULL), -(306,178,'5E690DB1AD8910886334158C6D4452FA2CE896634BCDDF40','',580768,52,'',NULL), -(307,191,'42A8F651F55F697E783ADA1959A2833276F970F1EE0410C7','',41280,16,'',NULL), -(308,243,'','',5296496,12,'558BEC81ECE80D00006A0AE8','SendChatMessage'), -(309,191,'445A6894B8C1838462D7D0D29FBE6BF815B5E6C344971349','',31924,23,'',NULL), -(310,178,'C010786A38F396503B7411FBADA0C1A68795F54A7AAE228E','',679578,23,'',NULL), -(311,113,'E3185EE4428291F9D2E4080C2EB1B19ADB005AD26EF0A993','IPSect',0,0,'',NULL), -(312,243,'','',7739760,11,'01BE80000000E805B6FFFF','Jump related?'), -(313,191,'1995FA3235ADA4B25232DC6403E7463A8D1864528BF9FDD4','',12905,36,'',NULL), -(314,243,'','',5124558,5,'8BF08D4608','GetCharacterInfo'), -(315,191,'30A26827798B7F1646003A9E846E8A9A8FF10A9DF926825A','',49564,24,'',NULL), -(316,178,'A567BBE4CA9D8E976083024E8D68903CF15CEA88C47C9961','',2299060,33,'',NULL), -(317,191,'BEA7165D7DD8E24E31B1C3D791A47A28731E1BACD1189A17','',24812,14,'',NULL), -(318,191,'0971A7CEB84D392670C7B8CBB61776762C25259D8E772CA5','',13538,11,'',NULL), -(319,178,'13200A59A28561A413FADAADFFFE4521A209CB691EA199A5','',690106,23,'',NULL), -(320,243,'','',5090917,8,'E886EE1D0083C40C',NULL), -(321,191,'56CABE081991356465BDE1DA3B8DED099DF9B6E746D1B531','',25724,20,'',NULL), -(322,191,'F98469C704F8B8ABC1A251EF8FC1E4CB5CEF1E007BAB5EA5','',57602,42,'',NULL), -(323,178,'6A64BF5AC652747B47E0B8E6593B7EEAC1EF38E0A84F4F5D','',3049452,22,'',NULL), -(324,191,'978BCD17BC9C81B05A2F0A50EC2CC206EC5F6AB1FE40D38D','',28956,12,'',NULL), -(325,178,'A28EDC898CEB14FB52591754DEF981C7168DD2421D0742FA','',3037164,22,'',NULL), -(326,191,'35E88DF07F0D48A0B7ABD53F4865DB762E6935529DC826DF','',360508,13,'',NULL), -(327,178,'BF1FB7E4C3CDD5D5A93AA1B24FC822AA5537DBB59F696818','',3037164,22,'',NULL), -(328,178,'343F1AFF6DA7A967D2DB958C608A6E2A19F83E862F8E3954','',149,5,'',NULL), -(329,243,'','',10694516,8,'2F549A416F12033B','Wall Climb'), -(330,178,'0B008034F97BD411A9F900D87578258AA1B79873850BC12B','',3049888,31,'',NULL), -(331,178,'C5A35B72E6BC604BAC9AA218908B3747D6850769CEA79C0F','',2299092,33,'',NULL), -(332,191,'FDDB2AA7F8884C8E3A7ED646B3E9E4AF5A8C0704130C39A7','',29852,20,'',NULL), -(333,178,'F57343CEA7133DE6469B1CFD1A749845D553B8D806B2BAA4','',3037164,22,'',NULL), -(334,178,'565A63583AC736E3CAFB95EE5AF9A64D3A7D3C3A8B234121','',3045912,31,'',NULL), -(335,191,'E26CF0E2ED92F608A80733CE703D7EA2C3DB83FE46182519','',3766400,37,'',NULL), -(336,191,'2F44EE3A34EFF98303B3724005EF3A8AC89CB25F9CA1B8BC','',12985,36,'',NULL), -(337,191,'C32F7CDB33BEF7B3093262F89263884DBB44E57D74D646B7','',12985,36,'',NULL), -(338,113,'2357AD2012CEBA72283F93460AC5FF55E4E5719A5AB9F5B9','drvsys_mon',0,0,'',NULL), -(339,178,'1C1595A1A64016D8725619CBC2FC7ABD41835320958A97FD','',676970,23,'',NULL), -(340,191,'DB5765A8B8D5F636D619E44669E9D3EF968BD8011C5D6999','',36907,24,'',NULL), -(341,191,'70B78734AC394D83D45427E0B7C88351E9BB108ED59C7E71','',37136,40,'',NULL), -(342,191,'85F2A5072D2D7557155CBF5157CAA460B19470DEE8AF96BB','',22792,25,'',NULL), -(343,243,'','',4609669,5,'8986100F00','Login Password Pointer'), -(344,191,'6C33FD80565B2860A76C87BB772E794E2FF444D813079A2F','',685656,44,'',NULL), -(345,178,'F09BEAD15FDEBD09240316D9E2E736028B54972B13F14E5E','',673194,23,'',NULL), -(346,191,'302E114D921D40EE54585BD9D63B9BDDFF7A2BD4D678DA97','',30044,16,'',NULL), -(347,178,'24807D7810C58A4B9A070A21B8AE50A0385DD4B4C6BD8B6F','',3049872,31,'',NULL), -(348,178,'B6BDECA858773B6F995AC6496923F5D0CBFDB1F76DB29C58','',198,12,'',NULL), -(349,243,'','',5296823,7,'75166824020000','Language patch (speak all)'), -(350,191,'C125EB3FD1B222ACE1B518959D96C5AC83EEAF109E9C6D20','',12194860,37,'',NULL), -(351,178,'8AFF28C3E6367B10340FB963B093AB52E61B267C541D5659','',2299108,33,'',NULL), -(352,191,'734D3EDDA69D9DD307032245FA0806456E2F02E90C2291E2','',36907,24,'',NULL), -(353,191,'9CB5A848D90B7FA4F58801ABD8A68EF8FDF8C602063C2CD6','',13033,36,'',NULL), -(354,178,'C8BCF785F8B7118D0270016E620E2C3DF6802E034471E5E4','',3033068,22,'',NULL), -(355,178,'8FB282098C8BB4EC10C8398E44C630677C6E2785227E31D3','',0,9,'',NULL), -(356,191,'2381BB2B613C58C364E962738335EBC2F3EFF81009DE49E4','',37180,24,'',NULL), -(357,191,'AA2A24A7C90D149C7817640B0D2D46C8A4B4D52146837605','',501956,48,'',NULL), -(358,191,'6815D749CCA8C1738A5F3236A737F0B70AE037E82D46033A','',448500,48,'',NULL), -(359,178,'F9F131F27BCC37FEF638FB8EDDAC29400652020C290D4F75','',676970,23,'',NULL), -(360,191,'319CBACC4CD2E1F54F8C8FC41EF44A3A9C492A652B00C622','',18700,32,'',NULL), -(361,178,'A4A7DB31BF51180F1ACFEA6C0E59AC84B43D022CB4BB817D','',2299116,33,'',NULL), -(362,191,'0DF639ED45B0C578DD616DD191014727A3C22C346E9FF73C','',50040,26,'',NULL), -(363,191,'72944B7FED63C1D2FC9D2CF6A07B5788731BE2B02215CEE4','',447736,48,'',NULL), -(364,191,'9148E18CF9213B25197C247F08CCA4C0DC60FEA73E3A247C','',13250,15,'',NULL), -(365,191,'ADA39A6A805BDF59271BBCE21734E8F28182164563CA15AA','',29916,16,'',NULL), -(366,191,'D5C852D85FA4393D027615506B7DEE07A1074AA4633019D8','',41023,24,'',NULL), -(367,191,'D06EE8DDC2115E5895E96D26A2A2F11FC566297D1D21BD26','',56063,25,'',NULL), -(368,191,'3AFE3B981D50B26FCAAC9DBE5A4BCB24F5BC3E9348AAA04B','',25724,20,'',NULL), -(369,191,'058E826BD75C26BACE712DF9D67B0A751896515802E9DDAE','',501956,48,'',NULL), -(370,178,'6E4C9CA0F7140E32D9284AF2E0EEB76419696771D4DDE887','',3634252,23,'',NULL), -(371,178,'29E43B1309ACB344AC777636BE838F0BFE6A04570B7FB09C','',700714,23,'',NULL), -(372,191,'5B7AC53977D57C5756A2F61582DD386EC93F5FE180FAB5DC','',27270,13,'',NULL), -(373,191,'22BF8D63A306178F368016E4657CCFCA5B2B21EBC90B8DB2','',50040,26,'',NULL), -(374,178,'1E8729EE000CD5BD8BABC49C368E0FF5AC08BC2B30921BC4','',709322,22,'',NULL), -(375,178,'8A1304B9AB2579F392F92D8A592308728EF76B26AE258A41','',4011280,23,'',NULL), -(376,178,'8A90AA547378BD5930D24FC415AEC08EF52E29B22073335F','',710730,23,'',NULL), -(377,113,'4BBF42A918109CC23F231B8E657076A213601AD681C032D1','HideEx',0,0,'',NULL), -(378,191,'06D9E92AE3953D13A0AC5FA31EC24B16C6A2260E2D32BF8E','',41096,24,'',NULL), -(379,178,'D4D3A9950FA07FAEDAD0658F9128007ADE282C043210A201','',683146,23,'',NULL), -(380,191,'94530FBCCC455105E8BB67E5B19BE0A4534A6F39A1201B52','',13291422,37,'',NULL), -(381,243,'','',4198410,6,'CCCCCCCCCCCC',NULL), -(382,178,'2313AF1E20F446936533F9440B220BEA966D9EB3A0502DCF','',178504,96,'',NULL), -(383,191,'F982BFDF01EB3BC6FFB70E897BFE21376232B2EEEFB25E58','',20512,16,'',NULL), -(384,178,'26308A71C6F483CC7795A01A2F2CF7E7EE97787C12CACC52','',2299108,33,'',NULL), -(385,113,'368334F9A3A549DFD3ABC9793E4EB83E837AA43F010354D1','ndis_x86',0,0,'',NULL), -(386,113,'5DA702DF95570780875ADB4C64259E887CE0A867D9B67711','Afd32uu',0,0,'',NULL), -(387,191,'B51E8DA25AAE556552404F5172642D0808A89E2AFE870B23','',694376,44,'',NULL), -(388,191,'4748EAC0350B1B56D8549157AAAAF4FF35438078A7E37AB5','',34176,25,'',NULL), -(389,191,'FBE20B03C75572D992273F192CE72CE78A65E6764BF8E6F6','',36907,24,'',NULL), -(390,191,'D8C1B9DEF3CA9CA59C5B827F055729B636FD55BA6242F9F0','',694376,44,'',NULL), -(391,191,'448475EBCA685E5A4ECC5F810740C9181825B49613CDDDA8','',477928,60,'',NULL), -(392,191,'2AF2DEE0CA5F307895E5773A083AEB862EA3D5210E037F06','',41080,24,'',NULL), -(393,178,'1708C050FF0C98DE59FE8F070273D80F9C1A612D336AB9FC','',3049452,22,'',NULL), -(394,178,'ED6BB184C9DD307229A023C1905E6EE73981D3E088D69FE6','',676970,23,'',NULL), -(395,191,'EB63A86D51668323A18AE2F8CE2BDD1ADAE57375B5F76C6B','',45223,24,'',NULL), -(396,178,'5837373EE8D4CCB5687045C04A4297450ACDE774FE973917','',673194,23,'',NULL), -(397,191,'65CCA5E079D38DCF32053D8DEE6C5ECF88E6AD8E1CF5379B','',31924,23,'',NULL), -(398,178,'FB895125A69DE5DB112B4731F6216668EB09C4F57943D85A','',706314,23,'',NULL), -(399,191,'A388E8CE523DB7C3C501AC5DB2C8AAE58FD1831E75665C48','',401992,14,'',NULL), -(400,178,'77C74B5E4CBCA9150FB64261E497AC4E7642A316C89B291A','',3045356,22,'',NULL), -(401,178,'8A2C4F7F3367A4648744D8964BB9A6833182ECABFE015B00','',3022016,31,'',NULL), -(402,243,'','',4609675,5,'5E5DC20800','Loggin Result'), -(403,191,'E8A24A78E6A716734CC666B48263B424804A42155C0BDB51','',18700,32,'',NULL), -(404,191,'3C881D2F0634D9223A36DF5266A7CF36B503DCF424441FA5','',28928,17,'',NULL), -(405,191,'7B3D92577810CAB5DA0134FDDA91CE6F36003C5373526774','',41023,24,'',NULL), -(406,178,'7F794E0811DA99DABA76CD9925B3E78045425E32880F05D3','',672746,23,'',NULL), -(407,178,'08235E08E4F83DDEA588D9FE32BD084FB26BDA6DEBB1E416','',668874,23,'',NULL), -(408,191,'5EF7C22867612F48FE5B41E219A1CA389AE8D32D8F0FC46B','',21660,15,'',NULL), -(409,178,'C7C78789911D6B30FA6E67198EF03B73CEE37576AEBFF5EA','',3045356,22,'',NULL), -(410,178,'62BF4E6440FE3F28138094B46FB469CDEB35008DEB652B8B','',3045776,31,'',NULL), -(411,191,'E24027620A1723C203E8084AD6269A852CD50D6F79D50530','',36544,55,'',NULL), -(412,113,'49CA50FCF2699AE5F4A867156A5D8053C4239B36DACE170C','HideEx',0,0,'',NULL), -(413,191,'073F4A76F248FE7C38F799437D475B9A2E9E81FA08B0C6BB','',17666,11,'',NULL), -(414,178,'6ECA7966F2845B9B61C6D9356E4FE4C913FE917808C8AFFE','',684876,29,'',NULL), -(415,178,'30BA488B3964465B142E75F6D1E1BA42DC9F489C3AC70BDA','',2299092,33,'',NULL), -(416,178,'55492051D368975D444428D6218A7D731555ABF7C3391E7D','',3049888,31,'',NULL), -(417,191,'94E0CEC4F7BDE7844C4D4ACF62E5C96ECF1D11FC2169CF8E','',433168,48,'',NULL), -(418,191,'5003A599A1162170A30F1906C0AD5B16DC7041E72D28A4B4','',28956,17,'',NULL), -(419,178,'686F700B2223502053CAFDF9977D8774E905E76B8C960E7C','',3049492,22,'',NULL), -(420,191,'F5A776E794B34ABBF93CA93E9230B7224CA088AB741DCB57','',13291422,37,'',NULL), -(421,191,'4A67D56DDA6B0E7D9117CFDB17EC6572E68B9300609FFE3C','',28956,17,'',NULL), -(422,178,'1B695DF78AA0708221E0EC2F5A69AB7078ED8143B2EAD174','',668874,23,'',NULL), -(423,191,'7C8CD40E29AE999923CD8EAFC233E619C73885A0258A6E3D','',21826,11,'',NULL), -(424,191,'73407824E9064DF5F1161A204A272A9CD69026EB4DF1004A','',29916,16,'',NULL), -(425,191,'B21609972E46C9BC8C6A77A18161A77D0C1D4001DC892DF1','',41080,24,'',NULL), -(426,191,'BB66A6AC45D02568067987834ECD8BF0A2BD0DAD06D12753','',17762,11,'',NULL), -(427,191,'2550EB7C358B7FB86FAF0EACDDC3111118769F448D93BF7A','',49347,24,'',NULL), -(428,178,'B6E4EF9350CA859576DB74D02C115D5A19C79AA58B0F6681','',684876,29,'',NULL), -(429,191,'451D2C8FF751743B52109FF5D95ED633DDBD8BCDB80EB7A9','',17906,11,'',NULL), -(430,191,'4A0161A4E5D50F11F58E1B23B281ABDA106625E3DC5A179C','',685304,44,'',NULL), -(431,178,'E4F21910D4B5D3E7B5461ED384889F6D0969645AE83F7601','',3037164,22,'',NULL), -(432,113,'B9756E3E1093B54511AC5A7B85711E53CEBEA373EF4866EE','Afde32uu',0,0,'',NULL), -(433,178,'A5AD6C8506004101E42165CD95051A7B5F13FBADD027461B','',710730,23,'',NULL), -(434,178,'B8AE30A02C59219D144EE95228C6CC9F99916F6FE423C940','',700714,23,'',NULL), -(435,178,'DAFD84BA8F977F5CFEEC9310C0EEF8F949F8EB6B827EBE71','',3990720,23,'',NULL), -(436,191,'B42986974893A82D73CC497B3252E9B844A11A99ACF46BEA','',41188,24,'',NULL), -(437,243,'','',11287980,8,'04000000903C9F00','Parental Controls related'), -(438,191,'0DC0953AE42E913121092DF17BC2BEE8BE133D1C53C8BFFD','',17762,11,'',NULL), -(439,178,'72C81E9BA425C54DE57BF4B7745D9C8D6B44D56E8FE933BA','',3049888,31,'',NULL), -(440,191,'100426CD22E80090502AA7A087B094B49ACFF4E7A09773ED','',30044,16,'',NULL), -(441,178,'46C797D1E60CC458E6C9D874650B996D10FC52641C2E7AA7','',676970,23,'',NULL), -(442,178,'DEA2C8A5775AA8CA86B8241BD418979D10DF4587E8E95C87','',250,11,'',NULL), -(443,113,'8807783067F9FF2697A61DEE925760682EB894C6F0A798AE','Afd32uu',0,0,'',NULL), -(444,178,'F63823A1F60619FDE6B4D6F3915EFB03EC03DEBEC82AFB9E','',673210,23,'',NULL), -(445,191,'E4DFD66163F2A65ECDD2EE9CA8062D707CC51882336F6483','',130380,14,'',NULL), -(446,178,'88182C96807A6025E628C90CE436C9EC54EC5FEC858A12B2','',690106,23,'',NULL), -(447,178,'EC322863C90B861E66A0008554BB8702EA92E1406F6F1711','',3070052,22,'',NULL), -(448,178,'9C851C7C05E54E5514E7BE038ABC5C669A3F5747EC573333','',3022016,31,'',NULL), -(449,178,'46D70E5C13F6D16BDD01A7481D9AFA51B73202070CA5D712','',673210,23,'',NULL), -(450,178,'CBEBB5F6F4EFB1324D17AB6CB48C573B639A37EAFD6299B4','',683146,23,'',NULL), -(451,191,'684575AAC0D8BC30D5325D56D3D522380E85ABFF380FA80F','',17938,11,'',NULL), -(452,178,'952BC8983C2CAEB6239BB2774F176A7F87A9F2DC10261205','',3045356,22,'',NULL), -(453,191,'4EAE0459E341062DB99658136D494BD79511B883F00BCE6A','',57602,42,'',NULL), -(454,178,'67E6E0A4006561DC5A67026886D1FF37AD14C5AA1AEA3CAD','',149,5,'',NULL), -(455,191,'222FE6B0A70CE2CEE633597E018706B3F78C338D96F6D9DC','',38300,21,'',NULL), -(456,113,'79747D68A5D6CD203671EF43029F17591E42BBCDB60B8B93','IPSect',0,0,'',NULL), -(457,178,'77ECC7613D44E56210F7CCDD6046226B41C8F087E901C94D','',682394,23,'',NULL), -(458,191,'77A59932BC8D497D992A213256ABD52C4D5F4FFB8A06002E','',49564,24,'',NULL), -(459,113,'2D14DD3BC859535580D8D9DC3BE7D59865A4E3FD112598A5','drvsys_mon',0,0,'',NULL), -(460,178,'9B487CD5032D00424A24FF3185AC4C17246729ECCE431951','',3049872,31,'',NULL), -(461,191,'978D8D1F3E1EF11CEBC4B65B13F1C5CE6E9E220E71B255B9','',13033,36,'',NULL), -(462,191,'1F5AD2397EB3CA814C5D156C6777C040F5D73085F3751C35','',433168,48,'',NULL), -(463,178,'912807952F9397C8F2B718C9164424D720E4EFC681DA3099','',3045356,22,'',NULL), -(464,191,'095F1A232F56B3DDA3338B5DE2CA310E5CF0EC0B6F72E87F','',17890,11,'',NULL), -(465,178,'2A5E27A3EE36254F61795E168A98C055772F88CEA5CCD6F1','',3033068,22,'',NULL), -(466,178,'4319BA4F2139568E87BAAC5F7C95121DD98D710B1C901E2B','',718842,23,'',NULL), -(467,191,'74E55BA8CDEFB5BD54BF1C0B0D326721D756440BA33C3ECE','',27270,13,'',NULL), -(468,191,'ED9FED6EE63B6C5E35C9E4615AC444603F6BF1FBC669D8B5','',13033,36,'',NULL), -(469,191,'DF967A96C67C8D6CB1955D1CA06556F37EEFC88D26F1D684','',90202,13,'',NULL), -(470,191,'2BDB1F4509561B2F846AAE7A5354008215C1EF4BDD0EA1D1','',49347,24,'',NULL), -(471,178,'0F3B3F0934C1B1E32DC9F83F67308BF9CFCCEB0EFE10B2FA','',672602,23,'',NULL), -(472,178,'E89980FFE6987D22DF5379283F53DA8DC3B5CD4862BA22C4','',335122,23,'',NULL), -(473,191,'156B3F2929664A16C3DA2D47CE3050B3A1BC32F9C30E4776','',27270,13,'',NULL), -(474,191,'65B03F581DEAA68B6A07C679C6B620A2623FD83EB4C4978B','',28940,17,'',NULL), -(475,178,'044C63CB9F480E28E02D68426C1F3D69BD146B39A7F081B5','',0,9,'',NULL), -(476,178,'B3BC7201BF77B362B943C8C13F9E70A751906F304F9AE133','',673210,23,'',NULL), -(477,191,'4783BF04A6BD423D63CD955407780BE0E15A70BC2643F853','',28928,17,'',NULL), -(478,178,'A71B471FFB4C58A2C99FC6818DD0269C4AE4C5686D5FDA87','',690106,23,'',NULL), -(479,191,'3EA0347F1F7D9BC9CAE387816DFBE4F492F53533400315B4','',17762,11,'',NULL), -(480,178,'AA5ADEE929B0B2FB655080B35D19607695F611672E6AD364','',3045616,31,'',NULL), -(481,191,'2DAAB5C524CA576967A7B0B713C1C34DA8EBF3990A86730C','',28704,16,'',NULL), -(482,191,'D0042CAE82A7121F7783A1382F542074B34ABFDF50A1B13A','',22792,25,'',NULL), -(483,191,'4D30286AD524AB2EB05C1A361A81036F787B1C0ACA36DD74','',30012,16,'',NULL), -(484,191,'03F9E0F9328E7C7025C0D5C59585700F19E29E8C8F9BF5B4','',49564,24,'',NULL), -(485,191,'430C4F44FD7CDF1A51F7A8FA5852ECCDA6CFA92C2A6ACB3A','',28920,23,'',NULL), -(486,178,'A2886E2080C54F25867AEDACDADD8F5175545F44512A3B58','',672746,23,'',NULL), -(487,178,'8438939BFCD0C550664ADE2DD75DD15FA23DC435EB5FC011','',3638348,23,'',NULL), -(488,191,'66480AAA84C5C00B64EEABE96DD21EB3773228B144E25D0E','',20512,16,'',NULL), -(489,191,'76C1B0FAC29E4E41FC6DAC31A0592CB0087BCE0D052904FE','',61874,42,'',NULL), -(490,191,'DA219765DA22ABBDBE5486CF7DB01C283FBF9986732C9A91','',37180,24,'',NULL), -(491,178,'F58BFE40291DD85F45C47E0E255594382DE0180AAE1F1FC9','',149,5,'',NULL), -(492,178,'8D8A305C43A3DD47DE550F256BD5F4B1753EDCC079AF279E','',3070052,22,'',NULL), -(493,191,'69CA60928A9A85D79ED39596C018DF899BD14C6219EFE088','',41080,24,'',NULL), -(494,191,'8D9AA947B904C003D06ACDF4EA0C84104612B274696999C4','',17890,11,'',NULL), -(495,178,'289CBF469FC750449980BFC2CA6AD7E42A69E14595D140A3','',209352,75,'',NULL), -(496,178,'49961CDE71B612E5432EAB389E7AD193476E05BB2778B751','',700714,23,'',NULL), -(497,178,'43818F9575A04BF426F4BE167052859015CC63622F7D4F3A','',672746,23,'',NULL), -(498,191,'7828B55FDE24719EC377E29FAE55BA6324020D00CD42A99D','',360508,13,'',NULL), -(499,178,'5432916108AFDFA313B6D88C886D87B5722E43EEBCAFC627','',0,8,'',NULL), -(500,191,'106F24060B7A4FC87A7971A4B0EFC1021F7181A09598C336','',17906,11,'',NULL), -(501,191,'13AA99805639421566A2652F0A7104939EA52EF0F77CFB03','',24812,14,'',NULL), -(502,178,'D0938B578EC70162A30A25571CD5DC7E765780F6191EAE1B','',710730,23,'',NULL), -(503,178,'70FA2C3749960F1B0D881FDB186DB9992D6EFD30C6674104','',580768,52,'',NULL), -(504,191,'BCA2CC6F5740DEF5D01D314146879036A5B6965C01424B0C','',45223,24,'',NULL), -(505,178,'47DD279576A64BCB3A4AF23D55895600C73BB5C214B70AEF','',3049452,22,'',NULL), -(506,178,'09C9B53C215456866BF764553A7B7E4F1F20F33A8D2CB613','',3638348,23,'',NULL), -(507,178,'3EC2D3876D82F424718D3B8E0B87562244C3F5A11A29F0E8','',682394,23,'',NULL), -(508,191,'7B4E9BBDC89694CCAE5BA6996D4240EB2E0C9C7F03CC5D40','',59620,13,'',NULL), -(509,178,'E2333772B05ABC620076EB66CFBB4AFE2313CCB6D719399F','',3065956,22,'',NULL), -(510,178,'2EB4C04C0946264F5BC8EFBAA832CA97381A8A6523BAB093','',178504,96,'',NULL), -(511,178,'0E3DE8374276C08D5DD241ABA2AC0AC1D2319F5CD22AAB52','',2303444,33,'',NULL), -(512,178,'FDB8DF478DADD2E36619D63D04D106EDB86EBF8FB9EC8CB4','',3000288,31,'',NULL), -(513,191,'BA76761FA5F569497047C3484FBC6FDDD8AFA71B96FE93C8','',24812,14,'',NULL), -(514,191,'2496E15413F7008A01FA53AC109C01E45B80BF2C3BC2F205','',56063,25,'',NULL), -(515,191,'CACB6383E8613E41489D93D7FE7235BE61214F9AE0825F44','',13291422,37,'',NULL), -(516,178,'931C403D2562AEE58EEB2586D73D51323A3A739860290AA6','',690106,23,'',NULL), -(517,191,'1A95AFB270B9C0D170E7280816891492C21E87D92E9EA6E5','',433168,48,'',NULL), -(518,191,'7483929857AE7A16C2D9EB0857EB1D5E9477479C2EEF0B5C','',37180,24,'',NULL), -(519,113,'379E1F6905F203E1026DB54A58AF588EF5726D9F50FCF369','Afde32uu',0,0,'',NULL), -(520,113,'08394625CCD77F36897EF283FAA0C019EE9F36775182584F','Afd32uu',0,0,'',NULL), -(521,191,'D9ADFC0283E75A86A3E1672BF50F5D1AD8E8466AE7086437','',27270,13,'',NULL), -(522,178,'D37F6219417C0E5196D3A4473D57ED767E6D9B49BB2B9555','',0,9,'',NULL), -(523,191,'93AAFBD4B8B50D6AE72F3BA7002D76791942D0EC0E61253A','',41127,24,'',NULL), -(524,191,'F9B132A5E1FFF379EC7175C12A58683C85272CC96E03E161','',41023,24,'',NULL), -(525,178,'1867D3CEC9379D1E6B8A1B9B667BDB1B6084B02ED9A60864','',3037164,22,'',NULL), -(526,178,'86548378A25632100F7E6E872ECF4D591B7542D977B623AE','',3049452,22,'',NULL), -(527,191,'9E00F6F9AF1D63FA2628E60B7BF2B1D63EFDD42D69929A73','',41080,24,'',NULL), -(528,178,'7DDD4CF1352822A1F9D19775498EE865FABB26C69F8FDEFE','',209352,75,'',NULL), -(529,191,'3D793384AD147BDDE98743EBE1E943263EFD6CAD542E2757','',17522,15,'',NULL), -(530,191,'9014AFDE93FDAC6C20971BEE76898FBB300A744CCBC24DA1','',28956,12,'',NULL), -(531,178,'D1212D7155D2C3114DA596070139C0B3610597CA0CE1CB17','',149,5,'',NULL), -(532,178,'BE18517661568A9D7F3CC9548592867F3A987A705866F60F','',3049888,31,'',NULL), -(533,191,'5D833D8DF05A7AF50DF945F5AF6880D325AC52B3ABC815AF','',41188,24,'',NULL), -(534,178,'1AA3B0D9AD368562F181E4E5D498652B3859210C126824D8','',672602,23,'',NULL), -(535,191,'331E027A700CAFDBEAC9E80B68B8304D0895D52947447448','',501956,48,'',NULL), -(536,191,'8E704337CE9F823A8A93947130ED1EE14A99F2EDB5458B94','',12194860,37,'',NULL), -(537,178,'BB1C818F79DB2F1FF71B7CB181021EB4F425311D09DAAE81','',0,9,'',NULL), -(538,178,'F1AD484D3F189A08EBF420C235D16ECAF1B485092FB063D6','',3045776,31,'',NULL), -(539,191,'1CF7028BE4D68B7AC6BB8061BECBFF402860541D04C90C0C','',17906,11,'',NULL), -(540,191,'2550D8249054E57086D4F4CF80396C686A71673C070711DA','',17890,11,'',NULL), -(541,191,'E864BD00AEB4F3D18CFFA7AADEAC7926A9A1E3EA7588F17A','',29884,20,'',NULL), -(542,191,'9E70338B4C8C845F8514925463DB624FC4423F9C467F5E62','',685304,44,'',NULL), -(543,178,'FC5EF49EDEE7A5268395298071BBA270822547A7416AEFB1','',3634252,23,'',NULL), -(544,191,'8282F57B7C3CD9B449B6363D5C9E792C2044EA2C3F381F9F','',17282,15,'',NULL), -(545,191,'B793EEE20E44B2942C6522F79343C58738A1A8489A381FB0','',24812,14,'',NULL), -(546,191,'6178EE9E575927A3505835AC88DA31BE15F0622DA55B31EB','',28956,12,'',NULL), -(547,178,'7BFD2D88793D6AB1A2351A3E8873B1E20CF44BF6563A0930','',3049888,31,'',NULL), -(548,191,'4102F13984A4E146C134D3F607AE7CA1B3263A22B52308C6','',447736,48,'',NULL), -(549,178,'EA1C4CA2A64548757BC2ED1C5BB6D2B5094AAD5B5C331F7D','',683146,23,'',NULL), -(550,178,'BEB42A9DB2B656B2DFF3DD7D1B8D87033F1D99A019CD4BB5','',3045632,31,'',NULL), -(551,191,'4E209437251EBB0CF31CF8A7CCF2C873A4D759B9563D573E','',34176,25,'',NULL), -(552,191,'85EB9C8A36B32287F096CF73F7FAE8B57405321342E9B779','',17666,11,'',NULL), -(553,191,'2EDE42629DD4A72669FFC9BBFBE15F357BF241853DBF7B2E','',27270,13,'',NULL), -(554,191,'FF47A1D9514F4DD81BDA23FC9018F03D894F9096E26EF809','',18680,35,'',NULL), -(555,191,'65185BBCA1D9995EA4B796E908B9F78923FDAE2D0C2500BC','',594348,26,'',NULL), -(556,191,'BD55E51B55A8FAB82CBF45012D761B1BEEE9BC0DAD8A83CD','',28920,17,'',NULL), -(557,178,'AACC3E694ACD478B1F99714734B5A43BD7D7A2A3565ED9B2','',3049492,22,'',NULL), -(558,191,'F3C07663325C5358F58A547725FBDF8DEF591021CD94513D','',685304,44,'',NULL), -(559,191,'503B5AB938616DE7672103919957B421FA8B6C98F72375F6','',20512,16,'',NULL), -(560,191,'3B6EFA3FF9443BEF4CBD2E7CAE08DA1753C79E5EDFA8510F','',37136,40,'',NULL), -(561,191,'3E5D1B5BBAD191442388FBD5236F5406CB2CA68EDF986328','',17666,11,'',NULL), -(562,178,'D8AB51DCC7840369846821B2A6B229CBA2E42C0CA566792D','',0,9,'',NULL), -(563,178,'F8004FA24C4925FAA3ED4993B0D457C5E4C5371915BB93D0','',3037164,22,'',NULL), -(564,178,'EAF4A696D564F6BC800BF0F6D732E4E92B50133DE02EE8C4','',0,9,'',NULL), -(565,191,'30BDC2BC3E4A2055426FA0EC67DBDEB7705C58047EFFA4D6','',61874,42,'',NULL), -(566,191,'3C8BCED97B2F9E5A52587E725004E136DED2B53AB2DB9D4F','',20512,16,'',NULL), -(567,178,'0B586F15A8CFD6B7A96632FF2B48D0F71E9D06BFAC174002','',3049888,31,'',NULL), -(568,191,'B2B3043BF9CDF3DB535D52ABC45BE586E6B8097B58D82C45','',17890,11,'',NULL), -(569,191,'9ED22064CDACF86DAC8C365C325EE428A87B628D137E038E','',28920,17,'',NULL), -(570,178,'2254B046D6D8D1A47E5F9275474B5EEE7A96CD99E8D952E9','',682378,23,'',NULL), -(571,113,'0A268B6DB28320A1956B54C36C61C625B02A48A4768A0823','Afd32uu',0,0,'',NULL), -(572,191,'41B3450DB8D10C506A561C7B95354A7792286D837C08B437','',12194860,37,'',NULL), -(573,191,'5CEDF5982800D9C6D16F9D357AEA17BBBAABADC8F3A12EC6','',45223,24,'',NULL), -(574,178,'3399D1DE6156FDE8614333B6C4AB0F5B2354381AAB7AF818','',3049872,31,'',NULL), -(575,178,'31DA5322A7B1F1715CA35F0976C201122A76D46A719F0C28','',335122,23,'',NULL), -(576,178,'36172791F3ACC5EFD406A7AD6F5D218279B94D458BDD60C3','',700714,23,'',NULL), -(577,178,'C64DDA3E5D94BD0DEFEDDB867DD304177B554C5771CF4DEF','',682378,23,'',NULL), -(578,178,'701D57AFE1315795AFE1340C35E923FE69C36EFC670C0BA5','',0,9,'',NULL), -(579,191,'D55BBE3C196C2FE07829CC54717C0A2A27C13A38ED4CF582','',30012,16,'',NULL), -(580,178,'DAD3C22D23FAB30C9AA6796E19EAB23CB7DCCD639854C14F','',3045976,31,'',NULL), -(581,178,'B3EC9710B55079104420F126BA7257F8FD7DC39D46880E5B','',2299060,33,'',NULL), -(582,191,'7762CCDD012D51167BF42F775CC307238C35EA5DA55B999E','',41096,24,'',NULL), -(583,191,'CEB7B2C893B8410CA8716C77DB679AB860F7F0E86BCF2D8E','',12194860,37,'',NULL), -(584,113,'C584FF543FABE32DBA3206AB324CAFAD92497C4926BBF8B2','HideEx',0,0,'',NULL), -(585,178,'122B96C9AD3D43FA5EE82ADFA464904F304EB7FD4CB5622D','',2299108,33,'',NULL), -(586,178,'3EFBC5B273BFF42D9F704C74DC2381B8A0D50D61C2F1512E','',717898,23,'',NULL), -(587,178,'8C5824E4A6D16714A2BFB5FC9D0CBF4706B8A2170DA87D7B','',0,9,'',NULL), -(588,191,'402282B90E06579656CF454305C0B5A925C95FBF6A7CF265','',477928,60,'',NULL), -(589,191,'71B36C6D650EF0D049328643E5B12E73DF95B58B2F30D0DC','',17938,11,'',NULL), -(590,178,'7C49C303394E1493D897E802528CA8E558B6A7BFE8320F08','',3037164,22,'',NULL), -(591,178,'2C190F9E920AF2EF67DA4D06905C2A6A0A2BC63D0192BAC5','',3045632,31,'',NULL), -(592,191,'E59168C40E1A0C9F8896EA9E2D684988D81A522FFCDC51D5','',3766400,37,'',NULL), -(593,191,'3C825803D3ABF20A11495E54718A2D83A0B35FD7D741B5E1','',12905,36,'',NULL), -(594,191,'DCF32E3E1C5DF813DFB137A2D9B21D95B0AF66CC2AD0F245','',41023,24,'',NULL), -(595,178,'7B66BDB4A0A713A7B315888708B88F90CCF7313832CCE35E','',3045356,22,'',NULL), -(596,178,'FFAF20DD14D7018A4156F000D1455DF36966513EB76F93E7','',2299116,33,'',NULL), -(597,178,'0C59AA1F05D2D9D3C0C5ECF6A38D9FF57187A7A461DEE908','',717898,23,'',NULL), -(598,191,'913AA6D16EBE73143FA4B4EF89C786668C6E7DD0B936DD18','',90202,13,'',NULL), -(599,191,'A9F5CA81A547D8F8051928A287DD280F7FE835B2858CEED5','',20512,16,'',NULL), -(600,178,'16B4D8897AEED4732A47239CDC99603D2F505D0AD602847F','',673210,23,'',NULL), -(601,191,'23F29E10D55E8701A1A699A1C05CED4553676E9FBA5B51F5','',13634,11,'',NULL), -(602,178,'9A65A024256C0D7D677C9F24A9C16A48BEA9B03CCA016098','',3000288,31,'',NULL), -(603,191,'AA0004288ED58DE4324FA521F849807DB1EF33634C7FE8C3','',61874,42,'',NULL), -(604,191,'E400A401BD0376A0475F1216731F5EE0DDF42C9A4FA805D2','',59620,13,'',NULL), -(605,178,'FD434987A57E848192562B61CA0D67BDCEA2392514CDD0AF','',3000288,31,'',NULL), -(606,191,'88C140A6580061C775D9141887FABD3F20E574DC4C0C4BBB','',9977,32,'',NULL), -(607,178,'3623B441A5D414AFD6650C8B8623ECF3C3A9129E1F5A81C1','',672954,23,'',NULL), -(608,178,'393A06D430D287FEC1C02F9945C34BA2A7954241C6357909','',335122,23,'',NULL), -(609,191,'0955A3267A3E576B9BD823BB210E8200F37CCB0421BF208C','',685656,44,'',NULL), -(610,191,'1A00ED18B456ADC1A1F39A5DEF572250FB0CCAC8BECA9DD8','',477928,60,'',NULL), -(611,178,'370B9B6E3AA987595F986C5716BF9FFCF0369438D5DC5D11','',156,8,'',NULL), -(612,191,'E8E85DFE24D8D20852A37D702CDF029C3B1FA30B99CAA4BE','',447736,48,'',NULL), -(613,178,'FA24C5FEEAF4538DD4913F10C99F3F64380B7354EB318386','',3041472,31,'',NULL), -(614,191,'C6AD92AC13B340575AB5D0769A1A7EED47BC42A5968E67D6','',37136,40,'',NULL), -(615,191,'990EFFE367D44A29E82F62C57B6041A66F66C1D100B05639','',28956,12,'',NULL), -(616,191,'631E42C3B6ED8A22F5AFA903176A7EB011754F5ABF2081EF','',3766400,37,'',NULL), -(617,191,'D8AB4091C51177D7BBA7384EE12E0384A7EDB73E38D15920','',13291422,37,'',NULL), -(618,178,'54AAA1926869D259C427870A620AE0C24AFC9B472F424633','',3049888,31,'',NULL), -(619,191,'CC0E40919988E53DA0B447F0984A30D51CC42E9DB54A8F1F','',49564,24,'',NULL), -(620,191,'396E7EC540DC2C74CD6709753CC627517E3A2DB8A1EF3633','',29916,16,'',NULL), -(621,191,'84A5A077180DFB9841E8DF4A4EC49EADE886D905768EE032','',57602,42,'',NULL), -(622,178,'072300C283F8DF72B3ED5F3CD8B7DF47574AECF7B21FBB59','',668874,23,'',NULL), -(623,191,'D4FC9A6022B7CFA81904503E43B813631D4735D80BC61868','',9977,32,'',NULL), -(624,178,'47B5A19B87234257CB6C1485AB2C0CB25513260F60094BEE','',3037164,22,'',NULL), -(625,191,'B8B6F4BA5FD45F0ABDCB060F72987987B6EF62B80C9E378F','',12194860,37,'',NULL), -(626,178,'261F2915266F20B7289A1560176F24198930C61540BEFA01','',3638348,23,'',NULL), -(627,191,'019A378006B0677C0B2F42C6CA882EC571D504E7D8F5B05B','',17282,15,'',NULL), -(628,178,'4E82DD9F04571D6DAB2FFCFCD638699D1D4C84917F720F32','',717898,23,'',NULL), -(629,178,'EAA75F6AE049552C55AFFDABB7268682428B1A9BF028C4D4','',673194,23,'',NULL), -(630,178,'F1431C669453FE0BD95430ECD8328EA0D3CD37BA658F094E','',198,12,'',NULL), -(631,178,'8AD8C581E8BAF7A2140211C4298A93E229493F272F4EFF4A','',3045912,31,'',NULL), -(632,191,'C154E3B6CE0B979BA98FEDAA1829DCCF2A7172642DEF9EFC','',37180,24,'',NULL), -(633,191,'295A29C81B1B9CC9B6758440BED913ED4D8B5E05A90D7CE7','',41023,24,'',NULL), -(634,178,'3ED9105E3D1F31AD1D4376C54B07D18348C56E7453D161B2','',690106,23,'',NULL), -(635,178,'74C75B8F0147ADA8610F6C9BB80C4BDA543C1D95943ADCEB','',0,8,'',NULL), -(636,191,'7BE7A7D3F4AD8B30A0A144D5D4AC5E569BB9A0D18AB590FC','',37180,24,'',NULL), -(637,191,'0B5C54A4850924038D95A3F1C44F300921CEA1E13644842E','',57602,42,'',NULL), -(638,191,'876743AA30D61C83444427F4F18203B2FF443C337E5DD190','',22792,25,'',NULL), -(639,191,'C83A14C21D1E66345574E3E0E3613E924F702883A30A1809','',31924,23,'',NULL), -(640,191,'2545F02B4FC2F5425960A2E5C0299936C99FF2EC68A5ECDB','',501956,48,'',NULL), -(641,191,'85EF9C6353712A8D0E2E27B1702B510A95B1305473F86345','',41023,24,'',NULL), -(642,191,'35282392AA86692A153FC159D6E13C74F9DF01661E4867D6','',13538,11,'',NULL), -(643,191,'0D6CC3008615CD5BFB96A90620805B78D5BFBC6100B1AF0D','',13538,15,'',NULL), -(644,191,'D573179188521C485CFD24A9EE9CDA77C540A31EE68E3E78','',41228,24,'',NULL), -(645,191,'8FA80694C3766FC1B041103EB35EBA3B7C77081A5DA8FFD8','',28940,17,'',NULL), -(646,113,'CD6B8F9D23612C807F7653D29F1F1C54BC8F917C5C5BD8F1','Afd32uu',0,0,'',NULL), -(647,178,'FCB5CF830DB536208D4C58E5838D1C8798F0738247EF0867','',672602,23,'',NULL), -(648,178,'4451680A3F41926C1545701887F93A0A49CC29C3E114AADB','',4011280,23,'',NULL), -(649,191,'6BE2C4F29ADF49AE5BF0485A27A854087E775FA28047168C','',27270,13,'',NULL), -(650,191,'016FF5D8685E37969B1B7C310756DCD93D4AB34256837031','',38300,21,'',NULL), -(651,191,'6726DA4A8F112CC25DD78500CA9BF792DB688F7D8D1FBC4B','',57602,42,'',NULL), -(652,191,'9F8B3A3C70027496420A619969CF1EB7AF447D245DA766A0','',29884,20,'',NULL), -(653,178,'E74FFC8ADF5FE8A0FE0F10BCABCFCEDB3B2B9C2307340D7C','',3041472,31,'',NULL), -(654,178,'B31302D6A47971059B2643B57D2D50EBEBEAA89BE483F1F4','',3037164,22,'',NULL), -(655,191,'2F761DEA3CD3394A0091D745FD2976B52F3B16BB0A48BC80','',29884,20,'',NULL), -(656,178,'8E44EC966A93870696359D3E2474D12C071A381B9403B1B9','',673210,23,'',NULL), -(657,191,'2424AFA7FEC48FF09E5E3BDAF93FAA74743A7551B6FB1495','',56063,25,'',NULL), -(658,178,'ACCF5804D419F30643F87A650C4DC6E0E10266922692AECE','',682378,23,'',NULL), -(659,191,'6EC19D6D1244E3FE787AE448EC905C509DBA3C01FBE34F24','',41280,16,'',NULL), -(660,178,'5B2D2EE40383C33D381998995210918AC6B1AD67C5880F6D','',710554,23,'',NULL), -(661,178,'83FFE0F8F224D5E56C38D731EFE8AD5AD1285B1AD4FA019B','',683146,23,'',NULL), -(662,191,'9D67A809FD8FDA1E1504F0C038E21E1D5FC4C6D11F426228','',28940,17,'',NULL), -(663,191,'2965EC092EC0A4B3D4A3C781F0A0A542824C77B7300BF50C','',45324,24,'',NULL), -(664,191,'FE31901F5558E6555DA6BC5B1BC3415E82CB97DECBB486BB','',41096,24,'',NULL), -(665,191,'B35406A77D6501A50F41981C7C137AD5272EB612F4A74109','',29884,20,'',NULL), -(666,178,'7275397E511B45264BCFA30E3A3F8101894AA3923D91BE6E','',3037164,22,'',NULL), -(667,178,'CA7D8D0E1F20385DCF6FC209799750CE9D0160B0C67196E7','',700714,23,'',NULL), -(668,191,'F5CCDA244D826B3180E7C49193B3B0B5DBF651EC67DCB47A','',594348,26,'',NULL), -(669,191,'7977F1E72B30179072EE1784396AB0406D06162051CA1EDB','',37136,40,'',NULL), -(670,178,'603F8A015D8436CCBCD68B26FF6006E7A81BA9A8D9524B1F','',3045356,22,'',NULL), -(671,178,'9631E9EBC78E0333010E522045852C7BEA44655080D418F3','',3049888,31,'',NULL), -(672,191,'43BE7C00605D9FECAEFAE38D8FFEAED78B8382563A245F10','',9977,32,'',NULL), -(673,191,'E493F1BAED1DBE7A0D429BF1A5D665636D29069060310BF0','',13291422,37,'',NULL), -(674,191,'6C53203FA95EBE4DBB0A7F3E85994058DECA069A5244C29E','',130380,14,'',NULL), -(675,178,'5A07E5A0525DBD5005CBDE16F7393EC8B795ADB2327C2F96','',3045356,22,'',NULL), -(676,178,'D7665366F333BD580C5F8E2FF8971294F69E99EC7E3623F3','',717898,23,'',NULL), -(677,191,'FB87EB8F178C69D9F7576AC7FF75D0479467057A2B6C956D','',9977,32,'',NULL), -(678,178,'292911AC98E7ED34DF021B562D5DEBE8DAA15570B552978B','',3000288,31,'',NULL), -(679,178,'6618F45C49D47C4105070C085FD5C384254A62E4AB614DB9','',3634252,23,'',NULL), -(680,191,'316E531545999AFC533814888434999501FEA8ABFBAF8655','',134968,32,'',NULL), -(681,191,'9945ED64886F68664A4BDF50731F4B4DC680273AB2E0DBCB','',20512,16,'',NULL), -(682,191,'1D4D6EC7B6B26553FC914D28BF9B62FD81D0B865DE606D97','',29884,20,'',NULL), -(683,178,'63B2D2ACF6E912CDC68282B080A2D610BE6AFE8EBB95FD31','',3070052,22,'',NULL), -(684,191,'B0955BAC042D5441496103E7C45E38609A9AE3799D534BD9','',18680,35,'',NULL), -(685,178,'6488E44D4E965581650F73F6E68DD8F863795162D99104F8','',682378,23,'',NULL), -(686,191,'CC0D3F7D8FCF928A55F92F6414F4AEF7AD75DED5819BF870','',13538,15,'',NULL), -(687,191,'CD3835965AF27EC338F828666CD06089B847B04A2DD56AE0','',17938,11,'',NULL), -(688,178,'D04E9CF6A03D4767AFF1E4EE0EFBC333AEBA5B0552F15957','',0,9,'',NULL), -(689,178,'120904F033D78A13DB0971F095C809852B7EB876D1A8AA01','',3045632,31,'',NULL), -(690,191,'7DDD19DCF77E27DF0A31BC21C7F716FF85076AF065F102DC','',36924,24,'',NULL), -(691,178,'5486E2CDD98AC3F25C223FD515CE7EF3FB09AC12ED338C86','',198,10,'',NULL), -(692,178,'F8D6423F01E5369D16F6F70180083B936F0DDE3737B23308','',2299092,33,'',NULL), -(693,191,'EC10CC349A8E654240B27B03EE1232B9CCED28F7104CCB71','',49347,24,'',NULL), -(694,178,'29E064ACC509206873A1D548F4816DB60D29D6EE9FF63A56','',682378,23,'',NULL), -(695,178,'E1A8A2A81920A7BA9F419A6D19CAC3DD9E292EF39F963234','',676970,23,'',NULL), -(696,191,'32393EB09F7C829F58612E5E47018F7203C43218C3506C79','',20512,16,'',NULL), -(697,178,'AFC4D19CACEDE8E9A2FDE3CC3D29CF8556AF4980872DFE1A','',3033068,22,'',NULL), -(698,178,'09A2B97FD351B1D339030233AC51C741E0ECDC21AA7A152B','',3049452,22,'',NULL), -(699,191,'2B2AF2171B8A9FC0D44EFE0ECDCB9DE1A55ACC8D83661E16','',41023,24,'',NULL), -(700,178,'D111B236DC42EB338870E72FF6EE3141714D0437864B02AE','',3045356,22,'',NULL), -(701,178,'E6DC6898929D1DA9F5768A9BFCBE848F8C1F31E8B6910FB8','',335122,23,'',NULL), -(702,113,'85A32F8B5F8430A086D27E62EB17D878E49CE815F6AC91CA','IPSect',0,0,'',NULL), -(703,191,'B6CB7B905A6BDD64BC032BE71927C1FE31153D14D6CF87E1','',447736,48,'',NULL), -(704,178,'40EE7F4EEE1D707ECB770CDBBB54730CB863CC8E268D4208','',3634252,23,'',NULL), -(705,178,'D74E308262D8C52ACE81B66F1D90C160AC86B2E0508176C1','',0,8,'',NULL), -(706,178,'E15287D29EE155299619F8E93E66B55B564FD921FA41CF50','',3049452,22,'',NULL), -(707,191,'58DFAEE44A52F0D5A58B0C94F0E5E63C1C7F76206D7FA7CA','',22792,25,'',NULL), -(708,191,'83705EAE8AAD9709494E52EB05AC0481C998C15730E61099','',30012,16,'',NULL), -(709,178,'0271F4D624304A48CB7CDFA016E3A735DCA3170FAD557468','',3070052,22,'',NULL), -(710,178,'217DFFE3C12F984992E1E0AE7B5864061572BA301B21D869','',178504,96,'',NULL), -(711,178,'C5C7AC33D1E4CF33E661033006BFEDE08523B643CCF51261','',3045356,22,'',NULL), -(712,243,'','',4618113,10,'FF1554F79D003B470C89','WS2_32.Send'), -(713,191,'D45144FC835266270E67CFB1F2900FD227B63204698A3EA7','',50040,26,'',NULL), -(714,191,'B5BB832AEEC591196864E08A392592C5789D76D3DDDD4DBF','',27270,13,'',NULL), -(715,191,'93582814E00150E2DD750ACAD7BD1719C4EBCD4C06F482AB','',28940,17,'',NULL), -(716,191,'FD6B6AC7FA5F2E7828CB1B429A9442383BD93E762A5D7D00','',31924,23,'',NULL), -(717,191,'51DF4EDECBBE42CC7C5D6723318F98E43E14A45F41CBD124','',41080,24,'',NULL), -(718,191,'F2B2260FDD23E5F268FAAE4D1A48E74C452F2AC5D114765D','',57602,42,'',NULL), -(719,191,'69FBDB69EC2E113EF691E47EDD46E40F03D1EBE226A1F7CE','',29884,20,'',NULL), -(720,178,'E3E431D8F8FB38F0F2586D0F50D809BCCEB13651C5EF2619','',682394,23,'',NULL), -(721,178,'2294015927F07D884FE2923FA17B3A8BCABC0A378930CF84','',679578,23,'',NULL), -(722,191,'0A022AB25C52F94404A01F96687B2D6E6BE774237254BD05','',20512,16,'',NULL), -(723,191,'65EEE243504EDC3319C3528B1A1E8061A3E75F4C25B61F95','',41228,24,'',NULL), -(724,178,'877C654036A29FC108FE8D69D416361732D7A0270E51189D','',3022016,31,'',NULL), -(725,178,'1A223564DF9E7BADD3CF858FB8250FE59F892232AC3B412D','',4011280,23,'',NULL), -(726,191,'4FEDF58FB4DE45289C97ACCF16EB2DEA6FBC85C74A52D3C9','',37180,24,'',NULL), -(727,191,'D4BE47EA1D68B92E2AD8307D139877705BE2B6A98B6A916E','',13033,36,'',NULL), -(728,191,'9658AC7EF426A52C327BBC1ED71C6FA6DC5940E35DCC18C7','',18680,35,'',NULL), -(729,113,'1B17998CD8E0CDA4D84B0A0F9DB05E536DACE0348A883D24','ndis_x86',0,0,'',NULL), -(730,178,'BB9B86ED12359A465B02387A1D727F11F78D35C8B7FCC2FC','',2299092,33,'',NULL), -(731,191,'842BC1A8C53902D26018B1C5E05ADCD70D973A968E298331','',50040,26,'',NULL), -(732,178,'3E894F9682573CC0AD54C7E9873C9026AC050929392D0B93','',3049452,22,'',NULL), -(733,191,'4A31E3D24FD6D576D84EF1BFB813D0F066870DEB38C32E47','',21826,11,'',NULL), -(734,191,'EEA122B4C066EC0B196F67511E633EBACB37C4EA6AE4BFF7','',41096,24,'',NULL), -(735,191,'66211671BEF80FB973B1C9595A70B462AD79EC83530DFE89','',12905,36,'',NULL), -(736,178,'3760BBD6FE99A0BBEE0AB61A8BD52A6ABCAC48FF3CB265B8','',3070052,22,'',NULL), -(737,191,'70F425426612D0D8495386C2375F7A4183548C0D4E7DFA46','',594348,26,'',NULL), -(738,178,'BB310E9DDE9259027123500E65F9FA1E8D9D0F5FE8381CD2','',3638348,23,'',NULL), -(739,191,'6FFB5E4982D306680E0C59087DA961CD4F6B068E323C3BB4','',401992,14,'',NULL), -(740,191,'6DDCA79B7460A1F3671532A28FDCEB331DE6CA550E3178D0','',3766400,37,'',NULL), -(741,191,'A8F7B2FB37CF3BEF43D6CE5C0BF85E85077E681490BA1C4C','',37136,40,'',NULL), -(742,191,'052F425E7528B3A7155C45EEE530F915DBB154E5C8876E25','',50040,26,'',NULL), -(743,178,'D6DE200B631AF71BFBC76202D82649942FD6ED9BC4A9EF75','',198,12,'',NULL), -(744,178,'61077261C66B2CF9B199F115A3A656EA6A00068F151E3656','',706314,23,'',NULL), -(745,191,'513FC0F0673A9DF86FA1FA05371040C14634CE08311ED619','',401992,14,'',NULL), -(746,191,'5E0970A6EB246A79DDF427CB76D0D921F971E13921DD5D2C','',134968,32,'',NULL), -(747,178,'53CAC3EF654610AC7E043C6AAD62709EF0B5400DBDE755EB','',149,5,'',NULL), -(748,178,'566637D06BAEA9190B7CE510C697F72CD20FE3D958A95A25','',3049888,31,'',NULL), -(749,113,'3C9B0CC7FE020EEBD43E6B1D88EDDF0EC46AC35974765068','drvsys_mon',0,0,'',NULL), -(750,191,'BDFEE5DCDD37FC5B2A1B3E42FBE5F7997CFED35E86062EB6','',28920,23,'',NULL), -(751,191,'7794AE60131E4D07860DB48047206784B885B30457EAB83E','',12194860,37,'',NULL), -(752,178,'653A308BB00D914AE1ECD773BA4B0BA7724874BC62647D10','',3037164,22,'',NULL), -(753,178,'06B696C35F905E75B451A02E121BDA0330CD44E0D9B872BF','',60648,56,'',NULL), -(754,191,'35E8CD9E8CBD879B1E53278926C634AA8B72B8D9A20009F9','',17522,15,'',NULL), -(755,191,'9B13F2E744904ADAAA062F9113A576D11C2C450D1CD6A4AB','',13033,36,'',NULL), -(756,191,'60851B4A6F7338632A84795FBBB20320E49AD2CC2034BA80','',28940,17,'',NULL), -(757,191,'3BC0BE02AE0B6975974D3B13B811EC6BDACBF9EE122BE633','',90202,13,'',NULL), -(758,191,'E47F7DD8D5B5C29B70AFFD4F25AA286167D411937F9BD247','',36907,24,'',NULL), -(759,178,'35D1CDEE86A410DF087DE6D5F5AC6289C4888B9753293E73','',3037164,22,'',NULL), -(760,191,'2ED2EEB29EE0D48477779E5CA875F1F5F15CCE74CA85BDAA','',28956,17,'',NULL), -(761,191,'A373FDB6A789CC46072A4CC51A429C817C40862DC6C0190F','',30012,16,'',NULL), -(762,178,'3D02551F548DFB58832626FE90A7AAA12824D93A54A0DC14','',709322,22,'',NULL), -(763,191,'09D04CF8ABC51D06D874784442987E5F2631041550607255','',36544,55,'',NULL), -(764,191,'F3CD473F8C85977895CA5BA9DC22185BCCBBF6B977205193','',448492,48,'',NULL), -(765,191,'30E2F23DB1038D16D2DEEAB1D0F1790D961E468368DC5108','',30012,16,'',NULL), -(766,191,'540D465F760320A63981289D30CD40CCC770EE126523C71D','',477912,60,'',NULL), -(767,191,'C461E1BE054FE29A1FD58B33D33890BC4A1279DE4F572B47','',37180,24,'',NULL), -(768,191,'1AC3D903CFCA11321E76A257BDA0608E5060030BE745CCF3','',130380,14,'',NULL), -(769,178,'96281A2887E61232007D7015E4A35DA118794841A8EC84BC','',3037164,22,'',NULL), -(770,178,'8A1AC926B46A9E3D60D3BD87A59FF77D7B80A1510BC327A7','',710730,23,'',NULL), -(771,191,'3620B6BDF3993B87FD35E906FE8376A04FF34684E2023D8E','',41280,16,'',NULL), -(772,191,'025C373F05EC6E809EF5A86A903570FDA14D219286BCED5E','',448492,48,'',NULL), -(773,178,'5C0E4EE98C4E34CBE44F6BD595C13DD675555164A8D491DA','',710554,23,'',NULL), -(774,191,'BECE667BF9443EF6515E8E154F74FC2C5817455C8636DB72','',501956,48,'',NULL), -(775,191,'94F1DA3E0D955761826D6BC932E26F44D321B4838C7567D8','',13538,15,'',NULL), -(776,191,'EA3A3AD71FD14B038C98F256E80C1EFA1F45562A3DF92E7D','',22792,25,'',NULL), -(777,191,'AD5A8CBF55EC436DA968EE0B9744C93F65D9E0D6E3C1B136','',174688,37,'',NULL), -(778,191,'9B6B3B311BA9007C06CF0D146BB979B11CF295C58768DD4F','',31924,23,'',NULL), -(779,217,'','RPE.DLL',0,0,'','rEdoX Packet Editor - injected dll'), -(780,243,'','',5345728,2,'558B','Lua Protection Remover'), -(781,243,'','',7726137,2,'7414','Walk on Water Patch'), -(782,243,'','',8016620,2,'7417','Collision M2 Special'), -(783,243,'','',8016079,6,'0F8462010000','Collision M2 Regular'), -(784,243,'','',8054762,2,'7506','Collision WMD'), -(785,243,'','',9995315,2,'7544','Multi-Jump Patch'), -(786,217,'','WPESPY.DLL',0,0,'','WPE PRO - injected dll'); diff --git a/sql/updates/world/2012_02_19_04_world_misc_db_updates.sql b/sql/updates/world/2012_02_19_04_world_misc_db_updates.sql deleted file mode 100644 index 32fada1e895..00000000000 --- a/sql/updates/world/2012_02_19_04_world_misc_db_updates.sql +++ /dev/null @@ -1,21 +0,0 @@ --- Horde Orphan should not have weapons -UPDATE `creature_template` SET `equipment_id`=0 WHERE `entry`=14499; --- Tog'thar Gossip -UPDATE `creature_template` SET `gossip_menu_id`=264 WHERE `entry`=2238; -DELETE FROM `gossip_menu` WHERE `entry`=264 AND `text_id`=761; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (264,761); --- Cosmetic Silkwing should have InhabitType 4 -UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry`=21840; --- Leoroxx -UPDATE `creature_template` SET `gossip_menu_id`=8511 WHERE `entry`=22004; -DELETE FROM `gossip_menu` WHERE `entry`=8511 AND `text_id`=10645; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (8511,10645); --- Spiritcaller Dohgar -UPDATE `creature_template` SET `gossip_menu_id`=8513 WHERE `entry`=22312; -DELETE FROM `gossip_menu` WHERE `entry`=8513 AND `text_id`=10647; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (8513,10647); --- Ogrin -UPDATE `creature_template` SET `gossip_menu_id`=9821 WHERE `entry`=22468; --- Wanted Poster "Blade's Edge Mountains" -DELETE FROM `gossip_menu` WHERE `entry`=8242 AND `text_id`=10257; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (8242,10257); diff --git a/sql/updates/world/2012_02_19_05_world_say_text.sql b/sql/updates/world/2012_02_19_05_world_say_text.sql deleted file mode 100644 index b70385660a1..00000000000 --- a/sql/updates/world/2012_02_19_05_world_say_text.sql +++ /dev/null @@ -1,7 +0,0 @@ --- NPC talk text from sniff -DELETE FROM `creature_text` WHERE `entry`=7604; -INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES -(7604,0,0, 'What? How dare you say that to me?!?',12,0,100,6,0,0, 'Sergeant Bly'), -(7604,1,0, 'After all we''ve been through? Well, I didn''t like you anyway!!',12,0,100,5,0,0, 'Sergeant Bly'); --- Remove old text -DELETE FROM `script_texts` WHERE `entry` IN (-1209002,-1209003); diff --git a/sql/updates/world/2012_02_19_06_world_say_text.sql b/sql/updates/world/2012_02_19_06_world_say_text.sql deleted file mode 100644 index f69c4cb86a9..00000000000 --- a/sql/updates/world/2012_02_19_06_world_say_text.sql +++ /dev/null @@ -1,20 +0,0 @@ --- SAI for Erich Lohan -SET @ENTRY=3627; -UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE (`entryorguid`=@ENTRY AND `source_type`=0); -INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES -(@ENTRY,0,0,0,1,0,100,0,10000,15000,10000,15000,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Erich Lohan - OOC - Say random text'); --- Talk text from sniff -DELETE FROM `creature_text` WHERE `entry`=3627; -INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES -(3627,0,0, 'Magical studies stressing your brain? Relax at the Blue Recluse!',12,7,100,0,0,0, 'Erich Lohan'), -(3627,0,1, 'Best drinks in Stormwind!',12,7,100,0,0,0, 'Erich Lohan'), -(3627,0,2, 'Come for the beer, stay for the atmosphere!',12,7,100,0,0,0, 'Erich Lohan'), -(3627,0,3, 'The only place in Stormwind where magic and spirits mix, come to the Blue Recluse!',12,7,100,0,0,0, 'Erich Lohan'), -(3627,0,4, 'Free drinks at the Blue Recluse!',12,7,100,0,0,0, 'Erich Lohan'), -(3627,0,5, 'Feeling blue? Come on down to the Blue Recluse for a good time!',12,7,100,0,0,0, 'Erich Lohan'), -(3627,0,6, 'Head on over to the Blue Recluse. Where everybody knows your name!',12,7,100,0,0,0, 'Erich Lohan'); --- Remove old waypoint text -UPDATE `waypoint_data` SET `action`=0 WHERE `id`=904450; -DELETE FROM `waypoint_scripts` WHERE `id` BETWEEN 432 AND 446; -DELETE FROM `db_script_string` WHERE `entry` BETWEEN 2000005185 AND 2000005199; diff --git a/sql/updates/world/2012_02_20_00_world_sai.sql b/sql/updates/world/2012_02_20_00_world_sai.sql deleted file mode 100644 index 44f8ab68d70..00000000000 --- a/sql/updates/world/2012_02_20_00_world_sai.sql +++ /dev/null @@ -1,4 +0,0 @@ -UPDATE `smart_scripts` SET `event_param3`=2*60*60*1000, `event_param4`=2*60*60*1000 WHERE `entryorguid`=18481 AND `source_type`=0 AND `id`=0; -UPDATE `smart_scripts` SET `event_flags`=`event_flags`|1 WHERE `entryorguid` IN (-85175,-85176) AND `source_type`=0 AND `id`=5 AND `link`=6; -UPDATE `smart_scripts` SET `event_flags`=`event_flags`|1 WHERE `entryorguid`=30146 AND `source_type`=0 AND `id`=0; -UPDATE `smart_scripts` SET `event_flags`=`event_flags`|0x20 WHERE `entryorguid` IN (-85175,-85176) AND `source_type`=0 AND `id`=2 AND `link`=3; diff --git a/sql/updates/world/2012_02_20_01_world_misc_db.sql b/sql/updates/world/2012_02_20_01_world_misc_db.sql deleted file mode 100644 index f3943ded29a..00000000000 --- a/sql/updates/world/2012_02_20_01_world_misc_db.sql +++ /dev/null @@ -1,8 +0,0 @@ --- Fix error in Scourge Deathspeaker SAI -UPDATE `smart_scripts` SET `link`=0 WHERE `entryorguid`=27615 AND `id`=14; --- Fix up Keeper Remulos SAI -UPDATE `smart_scripts` SET `id`=3 WHERE `entryorguid`=11832 AND `id`=4; --- Spiritcaller Dohgar -UPDATE `creature_template` SET `gossip_menu_id`=8513 WHERE `entry`=22312; -DELETE FROM `gossip_menu` WHERE `entry`=8513 AND `text_id`=10647; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (8513,10647); diff --git a/sql/updates/world/2012_02_20_02_world_conditons.sql b/sql/updates/world/2012_02_20_02_world_conditons.sql deleted file mode 100644 index 832d8dbdae5..00000000000 --- a/sql/updates/world/2012_02_20_02_world_conditons.sql +++ /dev/null @@ -1,275 +0,0 @@ -# Update a typo in original data entry -UPDATE `npc_spellclick_spells` SET `quest_end`=11999 WHERE `npc_entry`=26477 AND `spell_id`=61832 AND `quest_start`=11999; -# Delete redundant data with invalid condition type -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=18; - -# Static Data -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`, -`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`Comment`) VALUES -(18,24752,44363,0,8,0,11460,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,24752,44363,0,9,0,11460,0,0,0,'Required quest active for spellclick'), -(18,25596,45875,0,8,0,11690,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,25596,45875,0,9,0,11690,0,0,0,'Required quest active for spellclick'), -(18,25841,46166,0,8,0,11795,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,25841,46166,0,9,0,11795,0,0,0,'Required quest active for spellclick'), -(18,26200,39996,0,8,0,11960,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,26200,39996,0,9,0,11960,0,0,0,'Required quest active for spellclick'), -(18,26200,61286,0,8,0,11960,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,26200,61286,0,9,0,11960,0,0,0,'Required quest active for spellclick'), -(18,26421,47575,0,8,0,12092,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,26421,47575,0,8,0,12096,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,26421,47575,0,9,0,12092,0,0,0,'Required quest active for spellclick'), -(18,26421,47575,0,9,0,12096,0,0,0,'Required quest active for spellclick'), -(18,26477,47096,0,8,0,11999,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,26477,47096,0,8,0,12000,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,26477,47096,0,9,0,11999,0,0,0,'Required quest active for spellclick'), -(18,26477,47096,0,9,0,12000,0,0,0,'Required quest active for spellclick'), -(18,26477,61286,0,8,0,11999,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,26477,61286,0,8,0,12000,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,26477,61286,0,9,0,11999,0,0,0,'Required quest active for spellclick'), -(18,26477,61286,0,9,0,12000,0,0,0,'Required quest active for spellclick'), -(18,26477,61832,0,8,0,11999,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,26477,61832,0,8,0,12000,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,26477,61832,0,9,0,11999,0,0,0,'Required quest active for spellclick'), -(18,26477,61832,0,9,0,12000,0,0,0,'Required quest active for spellclick'), -(18,27061,47920,0,8,0,12050,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,27061,47920,0,9,0,12050,0,0,0,'Required quest active for spellclick'), -(18,27354,60944,18,8,0,12244,0,0,0,'Required quest rewarded for spellclick'), -(18,27354,60944,18,9,0,12244,0,0,0,'Required quest active for spellclick'), -(18,28161,39996,0,8,0,12532,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,28161,39996,0,8,0,12702,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,28161,39996,0,9,0,12532,0,0,0,'Required quest active for spellclick'), -(18,28161,39996,0,9,0,12702,0,0,0,'Required quest active for spellclick'), -(18,28161,51037,0,8,0,12532,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,28161,51037,0,8,0,12702,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,28161,51037,0,9,0,12532,0,0,0,'Required quest active for spellclick'), -(18,28161,51037,0,9,0,12702,0,0,0,'Required quest active for spellclick'), -(18,28161,51961,0,8,0,12532,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,28161,51961,0,8,0,12702,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,28161,51961,0,9,0,12532,0,0,0,'Required quest active for spellclick'), -(18,28161,51961,0,9,0,12702,0,0,0,'Required quest active for spellclick'), -(18,28162,39996,0,8,0,12519,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,28162,39996,0,9,0,12519,0,0,0,'Required quest active for spellclick'), -(18,28162,50737,0,8,0,12519,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,28162,50737,0,9,0,12519,0,0,0,'Required quest active for spellclick'), -(18,28162,51026,0,8,0,12519,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,28162,51026,0,9,0,12519,0,0,0,'Required quest active for spellclick'), -(18,28162,61286,0,8,0,12519,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,28162,61286,0,9,0,12519,0,0,0,'Required quest active for spellclick'), -(18,28202,50926,0,8,0,12527,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,28202,50926,0,9,0,12527,0,0,0,'Required quest active for spellclick'), -(18,28202,50927,0,8,0,12527,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,28202,50927,0,9,0,12527,0,0,0,'Required quest active for spellclick'), -(18,28203,50918,0,8,0,12527,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,28203,50918,0,9,0,12527,0,0,0,'Required quest active for spellclick'), -(18,28203,50919,0,8,0,12527,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,28203,50919,0,9,0,12527,0,0,0,'Required quest active for spellclick'), -(18,28222,52082,0,8,0,12546,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,28222,52082,0,9,0,12546,0,0,0,'Required quest active for spellclick'), -(18,28379,51658,0,8,0,12607,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,28379,51658,0,9,0,12607,0,0,0,'Required quest active for spellclick'), -(18,28389,51592,0,8,0,12605,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,28389,51592,0,9,0,12605,0,0,0,'Required quest active for spellclick'), -(18,28389,51593,0,8,0,12605,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,28389,51593,0,9,0,12605,0,0,0,'Required quest active for spellclick'), -(18,28782,52280,0,8,0,12687,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,28782,52280,0,9,0,12687,0,0,0,'Required quest active for spellclick'), -(18,29488,54568,15,8,0,12670,0,0,0,'Required quest rewarded for spellclick'), -(18,29488,54568,15,9,0,12670,0,0,0,'Required quest active for spellclick'), -(18,29563,56795,0,8,0,1,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,29598,54768,0,8,0,12856,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,29708,55028,0,8,0,12856,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,29708,55028,0,9,0,12856,0,0,0,'Required quest active for spellclick'), -(18,29856,55363,0,8,0,12629,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,29856,55363,0,8,0,12643,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,29856,55363,0,9,0,12629,0,0,0,'Required quest active for spellclick'), -(18,29856,55363,0,9,0,12643,0,0,0,'Required quest active for spellclick'), -(18,29857,55457,0,8,0,12910,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,29857,55457,0,9,0,12910,0,0,0,'Required quest active for spellclick'), -(18,30066,43977,0,8,0,12953,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,30337,43671,0,8,0,13069,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,30337,43671,0,9,0,13069,0,0,0,'Required quest active for spellclick'), -(18,30500,56679,0,8,0,13045,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,30500,56679,0,9,0,13045,0,0,0,'Required quest active for spellclick'), -(18,30560,57347,0,1,0,57348,0,0,1,'Forbidden aura for spellclick'), -(18,31736,59592,0,8,0,13280,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,31736,59592,0,9,0,13280,0,0,0,'Required quest active for spellclick'), -(18,31785,59656,0,8,0,13283,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,31785,59656,0,9,0,13283,0,0,0,'Required quest active for spellclick'), -(18,31883,60123,0,1,0,48085,0,0,1,'Forbidden aura for spellclick'), -(18,31893,60123,0,1,0,48084,0,0,1,'Forbidden aura for spellclick'), -(18,31894,60123,0,1,0,28276,0,0,1,'Forbidden aura for spellclick'), -(18,31895,60123,0,1,0,27874,0,0,1,'Forbidden aura for spellclick'), -(18,31896,60123,0,1,0,27873,0,0,1,'Forbidden aura for spellclick'), -(18,31897,60123,0,1,0,7001,0,0,1,'Forbidden aura for spellclick'), -(18,32788,57539,17,8,0,13075,0,0,0,'Required quest rewarded for spellclick'), -(18,32788,57539,17,9,0,13075,0,0,0,'Required quest active for spellclick'), -(18,32790,57654,16,8,0,13073,0,0,0,'Required quest rewarded for spellclick'), -(18,32790,57654,16,9,0,13073,0,0,0,'Required quest active for spellclick'), -(18,33498,63126,0,8,0,13654,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,33498,63126,0,9,0,13654,0,0,0,'Required quest active for spellclick'), -(18,33790,62781,0,8,0,13690,0,0,0,'Required quest rewarded for spellclick'), -(18,33790,62781,0,8,0,13705,0,0,0,'Required quest rewarded for spellclick'), -(18,33791,62786,0,8,0,13696,0,0,0,'Required quest rewarded for spellclick'), -(18,33791,62786,0,8,0,13711,0,0,0,'Required quest rewarded for spellclick'), -(18,33792,62785,0,8,0,13694,0,0,0,'Required quest rewarded for spellclick'), -(18,33792,62785,0,8,0,13709,0,0,0,'Required quest rewarded for spellclick'), -(18,33793,62780,0,8,0,13688,0,0,0,'Required quest rewarded for spellclick'), -(18,33793,62780,0,8,0,13704,0,0,0,'Required quest rewarded for spellclick'), -(18,33794,62782,0,8,0,13689,0,0,0,'Required quest rewarded for spellclick'), -(18,33794,62782,0,8,0,13706,0,0,0,'Required quest rewarded for spellclick'), -(18,33795,62779,0,8,0,13685,0,0,0,'Required quest rewarded for spellclick'), -(18,33795,62779,0,8,0,13703,0,0,0,'Required quest rewarded for spellclick'), -(18,33796,62784,0,8,0,13693,0,0,0,'Required quest rewarded for spellclick'), -(18,33796,62784,0,8,0,13708,0,0,0,'Required quest rewarded for spellclick'), -(18,33798,62787,0,8,0,13695,0,0,0,'Required quest rewarded for spellclick'), -(18,33798,62787,0,8,0,13710,0,0,0,'Required quest rewarded for spellclick'), -(18,33799,62783,0,8,0,13691,0,0,0,'Required quest rewarded for spellclick'), -(18,33799,62783,0,8,0,13707,0,0,0,'Required quest rewarded for spellclick'), -(18,33800,62774,0,8,0,13593,0,0,0,'Required quest rewarded for spellclick'), -(18,33800,62774,0,8,0,13684,0,0,0,'Required quest rewarded for spellclick'), -(18,33842,63791,0,8,0,13668,0,0,0,'Required quest rewarded for spellclick'), -(18,33842,63791,0,8,0,13687,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,33843,63792,0,8,0,13667,0,0,0,'Required quest rewarded for spellclick'), -(18,33843,63792,0,8,0,13686,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,33870,63663,0,8,0,1,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,34125,63215,0,8,0,13847,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,34125,63215,0,8,0,13851,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,34125,63215,0,8,0,13852,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,34125,63215,0,8,0,13854,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,34125,63215,0,8,0,13855,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,34125,63215,0,8,0,13856,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,34125,63215,0,8,0,13857,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,34125,63215,0,8,0,13858,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,34125,63215,0,8,0,13859,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,34125,63215,0,8,0,13860,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,34125,63215,0,8,0,13861,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,34125,63215,0,8,0,13862,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,34125,63215,0,8,0,13863,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,34125,63215,0,8,0,13864,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,34125,63215,0,9,0,13847,0,0,0,'Required quest active for spellclick'), -(18,34125,63215,0,9,0,13851,0,0,0,'Required quest active for spellclick'), -(18,34125,63215,0,9,0,13852,0,0,0,'Required quest active for spellclick'), -(18,34125,63215,0,9,0,13854,0,0,0,'Required quest active for spellclick'), -(18,34125,63215,0,9,0,13855,0,0,0,'Required quest active for spellclick'), -(18,34125,63215,0,9,0,13856,0,0,0,'Required quest active for spellclick'), -(18,34125,63215,0,9,0,13857,0,0,0,'Required quest active for spellclick'), -(18,34125,63215,0,9,0,13858,0,0,0,'Required quest active for spellclick'), -(18,34125,63215,0,9,0,13859,0,0,0,'Required quest active for spellclick'), -(18,34125,63215,0,9,0,13860,0,0,0,'Required quest active for spellclick'), -(18,34125,63215,0,9,0,13861,0,0,0,'Required quest active for spellclick'), -(18,34125,63215,0,9,0,13862,0,0,0,'Required quest active for spellclick'), -(18,34125,63215,0,9,0,13863,0,0,0,'Required quest active for spellclick'), -(18,34125,63215,0,9,0,13864,0,0,0,'Required quest active for spellclick'), -(18,38248,71462,0,1,0,71443,0,0,1,'Forbidden aura for spellclick'), -(18,40176,74904,0,8,0,25444,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,40176,74904,0,9,0,25444,0,0,0,'Required quest active for spellclick'), -(18,40176,74905,0,8,0,25444,0,0,1,'Forbidden rewarded quest for spellclick'), -(18,40176,74905,0,9,0,25444,0,0,0,'Required quest active for spellclick'); - -# Below is a procedure to dynamically convert custom content to conditions table. -# However this procedure only works for MySQL server versions >= 5.6 due to -# a bug / missing feature in older MySQL versions. -/* - -DROP PROCEDURE IF EXISTS ConvertSpellClickConditions; -DELIMITER // -CREATE PROCEDURE ConvertSpellClickConditions() -BEGIN - DECLARE counter INT DEFAULT 0; - DECLARE recordCount INT DEFAULT 0; - DECLARE counterPlusOne INT DEFAULT 0; - DECLARE npcEntry INT DEFAULT 0; - DECLARE spellId INT DEFAULT 0; - DECLARE aura INT DEFAULT 0; - DECLARE quest INT DEFAULT 0; - DECLARE quest2 INT DEFAULT 0; - DECLARE questStartCanActive INT DEFAULT 0; - DECLARE maxElseGroupId INT DEFAULT 14; # Change this for custom content - SELECT COUNT(*) INTO recordCount FROM `npc_spellclick_spells` WHERE `aura_required` !=0; - WHILE counter < recordCount DO - SELECT `npc_entry`, `spell_id`, `aura_required` - INTO npcEntry, spellId, aura - FROM `npc_spellclick_spells` WHERE `aura_required` !=0 - LIMIT counter,1; - INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ConditionTypeOrReference`, - `ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`NegativeCondition`,`Comment`) - VALUES (18,npcEntry,spellId,1,0,aura,0,0,'Required aura for spellclick'); - SET counter = counter+1; - END WHILE; - - SET counter = 0; - SET recordCount = 0; - SELECT COUNT(*) INTO recordCount FROM `npc_spellclick_spells` WHERE `aura_forbidden` !=0; - WHILE counter < recordCount DO - SELECT `npc_entry`, `spell_id`, `aura_forbidden` - INTO npcEntry, spellId, aura - FROM `npc_spellclick_spells` WHERE `aura_forbidden` !=0 - LIMIT counter,1; - INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ConditionTypeOrReference`, - `ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`NegativeCondition`,`Comment`) - VALUES (18,npcEntry,spellId,1,0,aura,0,1,'Forbidden aura for spellclick'); - SET counter = counter+1; - END WHILE; - - SET counter = 0; - SET recordCount = 0; - SELECT COUNT(*) INTO recordCount FROM `npc_spellclick_spells` WHERE `quest_start` !=0; - WHILE counter < recordCount DO - SELECT `npc_entry`, `spell_id`, `quest_start`, `quest_start_active`, `quest_end` - INTO npcEntry, spellId, quest, questStartCanActive, quest2 - FROM `npc_spellclick_spells` WHERE `quest_start` !=0 - LIMIT counter,1; - IF questStartCanActive = 1 AND quest2 = 0 THEN - INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`, `ConditionTypeOrReference`, - `ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`NegativeCondition`,`Comment`) - VALUES (18,npcEntry,spellId,maxElseGroupId+1,9,0,quest,0,0,'Required quest active for spellclick'); - INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`, `ConditionTypeOrReference`, - `ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`NegativeCondition`,`Comment`) - VALUES (18,npcEntry,spellId,maxElseGroupId+1,8,0,quest,0,0,'Required quest rewarded for spellclick'); - SET maxElseGroupId = maxElseGroupId+1; - # ELSE IF quest2 != 0 is handled in next loop (forbidden rewarded quest) - ELSEIF questStartCanActive = 1 && quest2 = quest THEN - INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ConditionTypeOrReference`, - `ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`NegativeCondition`,`Comment`) - VALUES (18,npcEntry,spellId,9,0,quest,0,0,'Required quest active for spellclick'); - # ^Adds the required active quest condition. Prohibit quest reward is done in next loop - ELSEIF questStartCanActive = 0 THEN - INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ConditionTypeOrReference`, - `ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`NegativeCondition`,`Comment`) - VALUES (18,npcEntry,spellId,8,0,quest,0,0,'Required quest rewarded for spellclick'); - END IF; - - SET counter = counter+1; - END WHILE; - - SET counter = 0; - SET recordCount = 0; - SELECT COUNT(*) INTO recordCount FROM `npc_spellclick_spells` WHERE `quest_end` !=0; - WHILE counter < recordCount DO - SELECT `npc_entry`, `spell_id`, `quest_end` - INTO npcEntry, spellId, quest - FROM `npc_spellclick_spells` WHERE `quest_end` !=0 - LIMIT counter,1; - INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ConditionTypeOrReference`, - `ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`NegativeCondition`,`Comment`) - VALUES (18,npcEntry,spellId,8,0,quest,0,1,'Forbidden rewarded quest for spellclick'); - SET counter = counter+1; - END WHILE; - -END// - -DELIMITER ; - -CALL ConvertSpellClickConditions(); -DROP PROCEDURE ConvertSpellClickConditions; - -*/ - -ALTER TABLE `npc_spellclick_spells` - DROP COLUMN `quest_start`, - DROP COLUMN `quest_start_active`, - DROP COLUMN `quest_end`, - DROP COLUMN `aura_required`, - DROP COLUMN `aura_forbidden` -; diff --git a/sql/updates/world/2012_02_21_00_world_creature_loot_template.sql b/sql/updates/world/2012_02_21_00_world_creature_loot_template.sql deleted file mode 100644 index 1d05c031868..00000000000 --- a/sql/updates/world/2012_02_21_00_world_creature_loot_template.sql +++ /dev/null @@ -1,78 +0,0 @@ --- Loot for Hellfire 5-man dungeons Trash (heroic and normal) -- --- ------------------------------------------------------------- - --- Hellfire Citadel: Ramparts -SET @Lootid := 17259; --- set all lootids to same entry (normal and heroic) -UPDATE `creature_template` SET `lootid`=@Lootid WHERE `entry` IN -(17259,17264,17269,17270,17271,17280,17281,17309,17455,17478,17517,18048,18049,18050,18051,18052,18053,18054,18055,18057,18058,18059); --- populate trashloot table -DELETE FROM `creature_loot_template` WHERE `entry` IN -(17259,17264,17269,17270,17271,17280,17281,17309,17455,17478,17517,18048,18049,18050,18051,18052,18053,18054,18055,18057,18058,18059); -DELETE FROM `creature_loot_template` WHERE `entry`=@Lootid; -INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES --- rough indication based on wowhead data of ALL mobs in the dungeon -(@Lootid,14047,40,1,0,1,4), -- Runecloth -(@Lootid,21877,20,1,0,1,4), -- Netherweave Cloth -(@Lootid, 8952,10,1,0,1,4), -- Roasted Quail -(@Lootid, 8766, 5,1,0,1,3), -- Morning Glory Dew --- references for worldgreys -(@Lootid,1,5,1,0,-24000,1), -- Outland Grey Item Reference1 -(@Lootid,2,5,1,0,-24002,1), -- Outland Grey Item Reference2 -(@Lootid,3,5,1,0,-24003,1), -- Outland Grey Item Reference3 -(@Lootid,4,5,1,0,-24011,1), -- Outland Grey Item Reference4 -(@Lootid,5,5,1,0,-24022,1), -- Outland Grey Item Reference5 -(@Lootid,6,5,1,0,-24023,1), -- Outland Grey Item Reference6 --- specifics -(@Lootid,5759,0.25,1,0,1,1), -- Thorium Lockbox -(@Lootid,5760,0.30,1,0,1,1), -- Eternium Lockbox --- Scrolls -(@Lootid,7,5,1,0,-24724,1); -- Scroll of IV - --- ----------------------------------------- --- -- Hellfire Citadel: The Blood Furnace -- --- ----------------------------------------- -SET @Lootid := 17370; -UPDATE `creature_template` SET `lootid`=@Lootid WHERE `entry` IN (17256,17370,17371,17395,17397,17398,17399,17414,17429,17477,17491,17624,17626,17653,18894,19016,18608,18619,18617,18615,18612,18614,18618,18603,18606,18610,18611,18609,18620,21645,21646); - -DELETE FROM `creature_loot_template` WHERE `entry` IN (17370,17371,17395,17397,17398,17414,17429,17491,17624,17626,18894); -INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES -(@Lootid,23894,-100,1,0,1,1), -- Fel Orc Blood (quest) --- most common items -(@Lootid,14047,40,1,0,1,4), -- Runecloth -(@Lootid,21877,20,1,0,1,4), -- Netherweave Cloth -(@Lootid, 8952,10,1,0,1,4), -- Roasted Quail -(@Lootid, 8766, 5,1,0,1,3), -- Morning Glory Dew --- references for worldgreys -(@Lootid,1,5,1,0,-24000,1), -- Outland Grey Item Reference1 -(@Lootid,2,5,1,0,-24002,1), -- Outland Grey Item Reference2 -(@Lootid,3,5,1,0,-24003,1), -- Outland Grey Item Reference3 -(@Lootid,4,5,1,0,-24011,1), -- Outland Grey Item Reference4 -(@Lootid,5,5,1,0,-24022,1), -- Outland Grey Item Reference5 -(@Lootid,6,5,1,0,-24023,1), -- Outland Grey Item Reference6 --- specifics -(@Lootid,5759,0.25,1,0,1,1), -- Thorium Lockbox -(@Lootid,5760,0.30,1,0,1,1), -- Eternium Lockbox --- Scrolls -(@Lootid,7,5,1,0,-24724,1); -- Scroll of IV - --- ------------------------------------------- --- -- Hellfire Citadel: The Shattered Halls -- --- ------------------------------------------- -SET @Lootid := 16507; -UPDATE `creature_template` SET `lootid`=@Lootid WHERE `entry` IN (17669,16507,17622,17462,17427,17420,17083,16699,16704,17695,17670,16700,16593,16594,17464,17694,17465,17461,17671,20593,20582,20576,20590,20589,20594,20567,20587,20579,20581,20595,20586,20583,20578,20574,20588,20584,20577,20580); - -DELETE FROM `creature_loot_template` WHERE `entry` IN (16507,16593,16594,16699,16700,16704,17083,17420,17427,17461,17462,17464,17465,17669,17670,17671,17694,17695,17669,16594,17694,17427,17695,17461,16593,17465,17671,17464,17420,17670,16700,16699,16507,16704,17462); -INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES -(@Lootid,21877,40,1,0,2,3), -- Netherweave Cloth -(@Lootid,27854,20,1,0,1,1), -- Smoked Talbuk Venison -(@Lootid,27860,20,1,0,1,1), -- Purified Draenic Water -(@Lootid,31952,2.5,1,0,1,1), -- Khorium Lockbox --- references -(@Lootid,1,5,1,1,-24002,1), -- Outland Grey Item Reference1 -(@Lootid,2,2,1,1,-24009,1), -- Outland Green Reference1 -(@Lootid,3,5,1,1,-24011,1), -- Outland Grey Item Reference2 -(@Lootid,4,1,1,1,-24012,1), -- Outland Blue Reference1 -(@Lootid,5,5,1,1,-24093,1), -- Outland Plans & patterns --- Scrolls -(@Lootid,6,5,1,0,-24724,1); -- Scroll of IV diff --git a/sql/updates/world/2012_02_21_01_world_conditions.sql b/sql/updates/world/2012_02_21_01_world_conditions.sql deleted file mode 100644 index 54685868186..00000000000 --- a/sql/updates/world/2012_02_21_01_world_conditions.sql +++ /dev/null @@ -1,3592 +0,0 @@ -CREATE TABLE `temp_convert_spells` -( - `id` INT(11), - `effMask` INT(11), - `onlyPlayers` TINYINT(3), - PRIMARY KEY (`id`) -); - -INSERT INTO `temp_convert_spells` VALUES -(46174,1,0), -(78002,1,1), -(78001,1,1), -(78000,1,1), -(77999,1,1), -(77984,1,1), -(76379,1,0), -(76098,1,0), -(76092,1,0), -(75920,1,1), -(75767,1,1), -(75765,1,1), -(75396,1,0), -(75389,1,1), -(75364,1,0), -(75319,1,0), -(75313,1,0), -(75244,1,0), -(75197,1,0), -(75195,1,0), -(75181,1,0), -(75107,1,0), -(75100,1,0), -(75078,1,0), -(75053,1,0), -(75018,1,0), -(74977,1,0), -(74903,1,0), -(74801,1,1), -(74758,1,0), -(74735,1,0), -(74549,1,0), -(74548,1,0), -(74486,1,0), -(74455,1,0), -(74444,1,0), -(74313,1,0), -(74285,1,0), -(74219,1,0), -(74182,1,0), -(74148,1,0), -(74098,1,0), -(74090,1,1), -(74086,1,1), -(74074,1,0), -(74033,1,0), -(73980,1,0), -(73955,1,0), -(73953,1,0), -(73886,1,0), -(73846,1,1), -(73845,1,1), -(73844,1,1), -(73843,1,1), -(73837,1,0), -(73836,1,0), -(73835,1,0), -(73787,1,0), -(73786,1,0), -(73785,1,0), -(73725,1,0), -(73659,1,0), -(73650,1,1), -(73582,1,0), -(73556,1,0), -(73555,1,0), -(73548,1,0), -(73331,1,1), -(73288,1,0), -(73165,1,0), -(73164,1,1), -(73159,1,1), -(73129,1,0), -(73128,1,0), -(73082,1,0), -(73071,1,0), -(73035,1,0), -(72959,1,1), -(72934,1,1), -(72928,1,1), -(72900,1,1), -(72830,1,1), -(72748,1,0), -(72747,1,0), -(72746,1,0), -(72745,1,0), -(72728,1,0), -(72706,1,1), -(72618,1,0), -(72595,1,1), -(72527,1,0), -(72479,1,1), -(72431,1,1), -(72429,1,1), -(72401,1,0), -(72347,1,0), -(72346,1,1), -(72280,1,0), -(72279,1,0), -(72278,1,0), -(72262,1,0), -(72260,1,0), -(72257,1,1), -(72209,1,0), -(72202,1,0), -(72099,1,0), -(72033,1,0), -(72032,1,0), -(72031,1,0), -(71952,1,0), -(71949,1,1), -(71948,1,0), -(71946,1,0), -(71848,1,0), -(71811,1,0), -(71809,1,0), -(71753,1,1), -(71693,1,0), -(71620,1,0), -(71617,1,0), -(71599,1,0), -(71538,1,1), -(71536,1,1), -(71520,1,0), -(71440,1,0), -(71415,1,0), -(71412,1,0), -(71365,1,0), -(71352,1,1), -(71322,1,0), -(71310,1,0), -(71308,1,0), -(71306,1,0), -(71281,1,0), -(71272,1,0), -(71189,1,0), -(71082,1,0), -(71081,1,0), -(71080,1,0), -(71079,1,0), -(71078,1,0), -(71075,1,0), -(71070,1,0), -(71032,1,0), -(71024,1,0), -(70995,1,0), -(70983,1,0), -(70966,1,1), -(70939,1,0), -(70936,1,0), -(70933,1,0), -(70931,1,0), -(70921,1,0), -(70881,1,0), -(70861,1,0), -(70860,1,0), -(70859,1,0), -(70858,1,0), -(70857,1,0), -(70856,1,0), -(70792,1,0), -(70790,1,0), -(70784,1,0), -(70781,1,0), -(70743,1,0), -(70713,1,1), -(70643,1,0), -(70639,1,0), -(70638,1,1), -(70636,1,1), -(70635,1,0), -(70623,1,1), -(70614,1,0), -(70611,1,0), -(70602,1,0), -(70595,1,0), -(70588,1,0), -(70586,1,0), -(70572,1,0), -(70569,1,0), -(70527,1,1), -(70525,1,0), -(70488,1,0), -(70485,1,0), -(70471,1,0), -(70466,1,0), -(70464,1,0), -(70444,1,0), -(70443,1,1), -(70403,1,0), -(70397,1,0), -(70383,1,0), -(70374,1,0), -(70366,1,0), -(70360,1,0), -(70338,1,0), -(70331,1,1), -(70299,1,0), -(70293,1,0), -(70290,1,0), -(70267,1,0), -(70266,1,0), -(70265,1,0), -(70246,1,0), -(70225,1,0), -(70224,1,0), -(70143,1,0), -(70130,1,0), -(70104,1,0), -(70100,1,0), -(70098,1,0), -(70079,1,0), -(70078,1,0), -(70053,1,0), -(70041,1,0), -(70040,1,0), -(70021,1,0), -(69960,1,0), -(69959,1,0), -(69922,1,0), -(69907,1,0), -(69886,1,0), -(69857,1,0), -(69843,1,0), -(69801,1,0), -(69798,1,0), -(69796,1,0), -(69784,1,0), -(69782,1,0), -(69768,1,0), -(69753,1,0), -(69705,1,0), -(69682,1,0), -(69614,1,0), -(69610,1,0), -(69601,1,0), -(69600,1,0), -(69593,1,0), -(69553,1,0), -(69538,1,0), -(69508,1,0), -(69431,1,0), -(69372,1,0), -(69347,1,0), -(69298,1,1), -(69171,1,0), -(69125,1,0), -(69101,1,0), -(69098,1,0), -(69097,1,0), -(69048,1,1), -(69039,1,0), -(69016,1,0), -(68957,1,0), -(68922,1,0), -(68919,1,0), -(68901,1,0), -(68881,1,0), -(68880,1,0), -(68861,1,0), -(68847,1,0), -(68842,1,0), -(68798,1,0), -(68663,1,0), -(68644,1,0), -(68617,1,0), -(68616,1,0), -(68614,1,0), -(68515,1,1), -(68471,1,1), -(68470,1,1), -(68401,1,0), -(68400,1,0), -(68360,1,0), -(68359,1,0), -(68358,1,0), -(68206,1,1), -(68198,1,1), -(68197,1,1), -(68193,1,1), -(68186,1,1), -(67888,1,0), -(67864,1,0), -(67857,1,0), -(67856,1,0), -(67855,1,0), -(67804,1,0), -(67757,1,0), -(67756,1,0), -(67755,1,0), -(67748,1,0), -(67732,1,0), -(67715,1,0), -(67705,1,0), -(67551,1,1), -(67547,1,0), -(67482,1,0), -(67400,1,0), -(67397,1,0), -(67369,1,0), -(67335,1,0), -(67328,1,0), -(67163,1,0), -(67162,1,0), -(67161,1,0), -(67160,1,0), -(67159,1,0), -(67158,1,0), -(66986,1,1), -(66810,1,1), -(66798,1,0), -(66785,1,0), -(66774,1,0), -(66718,1,1), -(66665,1,0), -(66637,1,0), -(66636,1,0), -(66630,1,0), -(66551,1,0), -(66550,1,0), -(66513,1,0), -(66512,1,0), -(66508,1,0), -(66401,1,0), -(66391,1,0), -(66390,1,0), -(66387,1,0), -(66386,1,0), -(66385,1,0), -(66384,1,0), -(66383,1,0), -(66382,1,0), -(66379,1,0), -(66357,1,0), -(66356,1,0), -(66355,1,0), -(66354,1,0), -(66353,1,0), -(66352,1,0), -(66350,1,0), -(66349,1,0), -(66348,1,0), -(66345,1,0), -(66339,1,0), -(66332,1,0), -(66314,1,1), -(66312,1,1), -(66287,1,0), -(66256,1,0), -(66193,1,0), -(66181,1,0), -(66153,1,0), -(66152,1,0), -(66141,1,0), -(66140,1,0), -(66135,1,1), -(66133,1,0), -(66132,1,0), -(65872,1,0), -(65861,1,0), -(65719,1,0), -(65718,1,0), -(65699,1,0), -(65685,1,0), -(65652,1,0), -(65614,1,0), -(65613,1,0), -(65611,1,0), -(65594,1,1), -(65589,1,0), -(65588,1,0), -(65587,1,0), -(65509,1,0), -(65357,1,0), -(65354,1,0), -(65350,1,0), -(65349,1,0), -(65346,1,1), -(65312,1,1), -(65311,1,1), -(65265,1,0), -(65258,1,0), -(65238,1,0), -(65224,1,0), -(65206,1,0), -(65200,1,0), -(65192,1,0), -(65184,1,1), -(65140,1,0), -(65109,1,0), -(65061,1,0), -(65042,1,0), -(65040,1,1), -(65034,1,0), -(65016,1,0), -(65015,1,0), -(64996,1,0), -(64995,1,0), -(64898,1,0), -(64887,1,0), -(64886,1,0), -(64880,1,0), -(64828,1,0), -(64799,1,0), -(64767,1,0), -(64623,1,0), -(64620,1,0), -(64619,1,0), -(64618,1,0), -(64597,1,0), -(64543,1,0), -(64539,1,0), -(64503,1,0), -(64499,1,0), -(64480,1,0), -(64475,1,0), -(64474,1,0), -(64466,1,0), -(64465,1,0), -(64463,1,0), -(64449,1,0), -(64444,1,0), -(64425,1,0), -(64414,1,0), -(64402,1,0), -(64397,1,0), -(64320,1,0), -(64229,1,0), -(64225,1,0), -(64224,1,0), -(64201,1,0), -(64185,1,0), -(64184,1,0), -(64183,1,0), -(64173,1,0), -(64172,1,0), -(64098,1,0), -(64069,1,0), -(64063,1,0), -(64061,1,0), -(64059,1,1), -(64032,1,0), -(64031,1,0), -(64030,1,0), -(64029,1,0), -(64028,1,0), -(64027,1,0), -(64026,1,0), -(64025,1,0), -(64024,1,0), -(64014,1,0), -(63984,1,0), -(63979,1,0), -(63947,1,0), -(63886,1,0), -(63882,1,0), -(63820,1,0), -(63813,1,0), -(63812,1,0), -(63764,1,0), -(63763,1,0), -(63762,1,0), -(63761,1,0), -(63749,1,0), -(63747,1,1), -(63745,1,1), -(63744,1,0), -(63702,1,0), -(63676,1,0), -(63659,1,0), -(63658,1,0), -(63657,1,0), -(63629,1,0), -(63628,1,0), -(63576,1,0), -(63524,1,0), -(63499,1,0), -(63446,1,0), -(63445,1,0), -(63444,1,0), -(63443,1,0), -(63442,1,0), -(63441,1,0), -(63440,1,0), -(63439,1,0), -(63438,1,0), -(63352,1,0), -(63348,1,0), -(63322,1,1), -(63274,1,0), -(63255,1,0), -(63238,1,0), -(63109,1,0), -(63037,1,0), -(63013,1,0), -(63001,1,0), -(62990,1,0), -(62978,1,0), -(62976,1,0), -(62943,1,0), -(62911,1,0), -(62909,1,0), -(62906,1,0), -(62888,1,0), -(62883,1,0), -(62882,1,0), -(62834,1,0), -(62809,1,0), -(62797,1,1), -(62778,1,0), -(62731,1,0), -(62727,1,0), -(62711,1,0), -(62708,1,0), -(62706,1,0), -(62701,1,0), -(62669,1,0), -(62646,1,0), -(62603,1,0), -(62584,1,0), -(62577,1,0), -(62567,1,0), -(62533,1,0), -(62525,1,0), -(62524,1,0), -(62521,1,0), -(62509,1,0), -(62505,1,0), -(62496,1,0), -(62488,1,0), -(62485,1,0), -(62484,1,0), -(62483,1,0), -(62480,1,0), -(62464,1,0), -(62378,1,0), -(124,1,0), -(2222,1,0), -(3730,1,0), -(4020,1,0), -(4338,1,0), -(5249,1,0), -(5251,1,0), -(5432,1,0), -(5555,1,0), -(6636,1,0), -(6672,1,0), -(6755,1,0), -(6955,1,0), -(6967,1,0), -(7022,1,0), -(7035,1,0), -(7036,1,0), -(7277,1,0), -(7393,1,0), -(7670,1,0), -(7769,1,0), -(8283,1,0), -(8593,1,0), -(8596,1,0), -(9002,1,0), -(9003,1,0), -(9004,1,0), -(9012,1,0), -(9082,1,0), -(9095,1,0), -(9455,1,0), -(9457,1,0), -(9712,1,0), -(9976,1,0), -(10113,1,0), -(10137,1,0), -(10252,1,0), -(10258,1,0), -(10259,1,0), -(10260,1,0), -(10345,1,0), -(10604,1,0), -(10727,1,0), -(10747,1,0), -(11195,1,0), -(11402,1,0), -(11440,1,0), -(11513,1,0), -(11637,1,0), -(11757,1,0), -(11893,1,0), -(12134,1,0), -(12158,1,0), -(12159,1,0), -(12347,1,0), -(12512,1,0), -(12564,1,0), -(12613,1,0), -(12623,1,0), -(12699,1,0), -(12709,1,0), -(12774,1,0), -(12938,1,0), -(13461,1,0), -(13727,1,0), -(13821,1,0), -(13951,1,0), -(13982,1,0), -(14250,1,0), -(14292,1,0), -(14806,1,0), -(14813,1,0), -(14928,1,0), -(15252,1,0), -(15281,1,0), -(15591,1,0), -(15658,1,0), -(15746,1,0), -(15958,1,0), -(16007,1,0), -(16032,1,0), -(16037,1,0), -(16053,1,0), -(16068,1,0), -(16069,1,0), -(16070,1,0), -(16074,1,0), -(16378,1,0), -(16381,1,0), -(16404,1,0), -(16556,1,0), -(16558,1,0), -(16637,1,0), -(16786,1,0), -(16807,1,0), -(17048,1,0), -(17166,1,0), -(17190,1,0), -(17202,1,0), -(17272,1,0), -(17278,1,0), -(17279,1,0), -(17471,1,0), -(17536,1,0), -(17616,1,0), -(17618,1,0), -(17652,1,0), -(17671,1,0), -(17675,1,0), -(17676,1,0), -(17677,1,0), -(17678,1,0), -(17698,1,0), -(17748,1,0), -(18110,1,0), -(18655,1,0), -(18666,1,0), -(18811,1,0), -(18969,1,0), -(19032,1,0), -(19096,1,0), -(19571,1,0), -(19593,1,0), -(19721,1,0), -(19749,1,0), -(19770,1,0), -(19773,1,0), -(19952,1,0), -(20358,1,0), -(20465,1,0), -(20619,1,0), -(21052,1,0), -(21075,1,0), -(21076,1,0), -(21391,1,0), -(21556,1,0), -(21566,1,0), -(21885,1,0), -(21950,1,0), -(22096,1,0), -(22203,1,0), -(22205,1,0), -(22393,1,0), -(22458,1,0), -(22860,1,0), -(22906,1,0), -(22966,1,0), -(23014,1,0), -(23016,1,0), -(23018,1,0), -(23019,1,0), -(23168,1,0), -(23328,1,0), -(23360,1,0), -(23389,1,0), -(23394,1,0), -(23415,1,0), -(23642,1,0), -(23951,1,0), -(23974,1,0), -(24062,1,0), -(24083,1,0), -(24172,1,0), -(24207,1,0), -(24217,1,0), -(24311,1,0), -(24322,1,0), -(24323,1,0), -(24391,1,0), -(24734,1,0), -(24744,1,0), -(24756,1,0), -(24758,1,0), -(24760,1,0), -(24763,1,0), -(24765,1,0), -(24768,1,0), -(24770,1,0), -(24772,1,0), -(24784,1,0), -(24786,1,0), -(24788,1,0), -(24789,1,0), -(24790,1,0), -(24804,1,0), -(24933,1,0), -(25030,1,0), -(25031,1,0), -(25032,1,0), -(25099,1,0), -(25145,1,0), -(25149,1,0), -(25150,1,0), -(25158,1,0), -(25201,1,0), -(25715,1,0), -(25727,1,0), -(25745,1,0), -(25822,1,0), -(25823,1,0), -(25896,1,0), -(26235,1,0), -(26344,1,0), -(26345,1,0), -(26346,1,0), -(26347,1,0), -(26348,1,0), -(26349,1,0), -(26351,1,0), -(26352,1,0), -(26353,1,0), -(26354,1,0), -(26355,1,0), -(26356,1,0), -(26462,1,0), -(26522,1,1), -(26608,1,0), -(26687,1,1), -(26879,1,0), -(27583,1,0), -(27651,1,0), -(27663,1,0), -(27745,1,0), -(27885,1,0), -(27886,1,0), -(27892,1,0), -(27893,1,0), -(27894,1,0), -(27928,1,0), -(27929,1,0), -(27935,1,0), -(27936,1,0), -(28018,1,0), -(28032,1,0), -(28056,1,0), -(28078,1,0), -(28087,1,0), -(28096,1,0), -(28111,1,0), -(28159,1,0), -(28278,1,0), -(28281,1,0), -(28309,1,0), -(28326,1,0), -(28338,1,0), -(28339,1,0), -(28365,1,0), -(28366,1,0), -(28367,1,0), -(28374,1,0), -(28392,1,0), -(28404,1,0), -(28441,1,0), -(28605,1,0), -(28697,1,0), -(28731,1,0), -(28732,1,0), -(28861,1,0), -(29070,1,0), -(29072,1,0), -(29120,1,0), -(29121,1,0), -(29122,1,0), -(29172,1,0), -(29173,1,0), -(29176,1,0), -(29328,1,1), -(29339,1,0), -(29340,1,0), -(29428,1,0), -(29437,1,0), -(29456,1,0), -(29457,1,0), -(29458,1,0), -(29459,1,0), -(29461,1,0), -(29531,1,0), -(29534,1,0), -(29612,1,0), -(29705,1,0), -(29726,1,0), -(29727,1,0), -(29769,1,0), -(29770,1,0), -(29846,1,1), -(29962,1,0), -(29966,1,0), -(29967,1,0), -(29969,1,0), -(29970,1,0), -(29972,1,0), -(29989,1,0), -(30012,1,0), -(30065,1,0), -(30107,1,0), -(30166,1,0), -(30207,1,0), -(30221,1,0), -(30232,1,0), -(30273,1,0), -(30410,1,0), -(30417,1,0), -(30418,1,0), -(30425,1,0), -(30427,1,0), -(30460,1,0), -(30462,1,0), -(30469,1,0), -(30477,1,0), -(30541,1,0), -(30544,1,0), -(30571,1,1), -(30572,1,0), -(30625,1,0), -(30631,1,1), -(30656,1,0), -(30662,1,0), -(30676,1,0), -(30690,1,0), -(30735,1,0), -(30738,1,0), -(30745,1,0), -(30751,1,0), -(30762,1,0), -(30763,1,0), -(30764,1,0), -(30765,1,0), -(30766,1,0), -(30834,1,0), -(30835,1,0), -(30875,1,0), -(30876,1,0), -(30951,1,0), -(30952,1,0), -(30964,1,0), -(30968,1,0), -(30970,1,0), -(30974,1,0), -(30985,1,0), -(30988,1,0), -(31115,1,0), -(31225,1,0), -(31315,1,0), -(31324,1,0), -(31326,1,0), -(31329,1,0), -(31336,1,0), -(31346,1,0), -(31411,1,0), -(31412,1,0), -(31413,1,0), -(31414,1,0), -(31474,1,0), -(31515,1,0), -(31532,1,0), -(31537,1,0), -(31550,1,0), -(31611,1,0), -(31628,1,0), -(31630,1,0), -(31631,1,0), -(31702,1,0), -(31727,1,0), -(31736,1,0), -(31749,1,0), -(31781,1,0), -(31793,1,0), -(31799,1,0), -(31806,1,0), -(31889,1,0), -(31902,1,0), -(31936,1,0), -(31979,1,0), -(31993,1,0), -(32040,1,0), -(32042,1,0), -(32045,1,0), -(32051,1,0), -(32052,1,0), -(32087,1,0), -(32111,1,0), -(32127,1,0), -(32146,1,0), -(32163,1,0), -(32164,1,0), -(32227,1,0), -(32228,1,0), -(32251,1,0), -(32260,1,0), -(32286,1,0), -(32301,1,0), -(32303,1,0), -(32312,1,0), -(32373,1,0), -(32396,1,0), -(32560,1,0), -(32573,1,0), -(32589,1,0), -(32622,1,0), -(32623,1,0), -(32638,1,0), -(32668,1,0), -(32708,1,1), -(32760,1,0), -(32838,1,0), -(32890,1,0), -(32928,1,0), -(32929,1,0), -(32930,1,0), -(32953,1,0), -(32958,1,0), -(32974,1,0), -(32976,1,0), -(32979,1,0), -(33067,1,0), -(33270,1,1), -(33329,1,0), -(33332,1,0), -(33336,1,0), -(33337,1,0), -(33423,1,0), -(33424,1,0), -(33425,1,0), -(33531,1,0), -(33532,1,0), -(33618,1,0), -(33644,1,0), -(33655,1,0), -(33669,1,0), -(33710,1,0), -(33716,1,1), -(33742,1,0), -(33744,1,0), -(33796,1,0), -(33805,1,0), -(33806,1,0), -(33809,1,0), -(33822,1,0), -(33831,1,0), -(33838,1,0), -(33861,1,0), -(33862,1,0), -(33918,1,0), -(33924,1,0), -(33937,1,0), -(33981,1,0), -(34011,1,0), -(34013,1,0), -(34016,1,0), -(34019,1,0), -(34023,1,0), -(34024,1,0), -(34062,1,0), -(34063,1,0), -(34076,1,0), -(34119,1,0), -(34154,1,0), -(34156,1,0), -(34209,1,0), -(34211,1,0), -(34212,1,0), -(34221,1,0), -(34239,1,0), -(34254,1,0), -(34330,1,0), -(34332,1,0), -(34367,1,0), -(34378,1,0), -(34393,1,0), -(34397,1,0), -(34430,1,0), -(34516,1,0), -(34526,1,0), -(34536,1,0), -(34581,1,0), -(34583,1,0), -(34613,1,0), -(34627,1,0), -(34646,1,0), -(34662,1,0), -(34742,1,0), -(34806,1,0), -(34874,1,0), -(34893,1,0), -(34946,1,0), -(35016,1,0), -(35040,1,0), -(35063,1,0), -(35097,1,0), -(35113,1,0), -(35137,1,0), -(35140,1,0), -(35141,1,0), -(35155,1,0), -(35160,1,0), -(35162,1,0), -(35170,1,0), -(35176,1,0), -(35190,1,0), -(35245,1,0), -(35262,1,0), -(35282,1,0), -(35301,1,0), -(35372,1,0), -(35413,1,0), -(35427,1,0), -(35515,1,0), -(35516,1,0), -(35598,1,0), -(35600,1,0), -(35673,1,0), -(35682,1,0), -(35724,1,0), -(35746,1,0), -(35756,1,0), -(35770,1,0), -(35771,1,0), -(35772,1,0), -(35782,1,0), -(35930,1,0), -(35941,1,1), -(35956,1,1), -(35960,1,0), -(35961,1,0), -(35962,1,0), -(36000,1,0), -(36035,1,0), -(36089,1,0), -(36090,1,0), -(36103,1,0), -(36167,1,0), -(36174,1,0), -(36196,1,0), -(36197,1,0), -(36198,1,0), -(36201,1,0), -(36220,1,0), -(36239,1,0), -(36241,1,0), -(36243,1,0), -(36290,1,0), -(36291,1,0), -(36293,1,0), -(36327,1,0), -(36330,1,0), -(36378,1,0), -(36384,1,0), -(36431,1,0), -(36452,1,0), -(36455,1,1), -(36456,1,0), -(36514,1,0), -(36544,1,0), -(36639,1,0), -(36651,1,0), -(36652,1,0), -(36692,1,0), -(36709,1,0), -(36717,1,1), -(36779,1,0), -(36795,1,0), -(36802,1,0), -(36803,1,0), -(36804,1,0), -(36823,1,0), -(36852,1,0), -(36854,1,0), -(36856,1,0), -(36857,1,0), -(36858,1,0), -(36859,1,0), -(36871,1,0), -(36878,1,0), -(36884,1,0), -(36896,1,0), -(36951,1,0), -(36953,1,0), -(36969,1,0), -(36995,1,0), -(37013,1,0), -(37017,1,0), -(37032,1,0), -(37033,1,0), -(37034,1,0), -(37035,1,0), -(37051,1,0), -(37052,1,0), -(37053,1,0), -(37055,1,0), -(37056,1,0), -(37071,1,0), -(37072,1,0), -(37103,1,0), -(37142,1,0), -(37143,1,0), -(37144,1,0), -(37146,1,0), -(37147,1,0), -(37148,1,0), -(37149,1,0), -(37150,1,0), -(37151,1,0), -(37152,1,0), -(37153,1,0), -(37199,1,0), -(37220,1,0), -(37226,1,0), -(37229,1,0), -(37235,1,0), -(37281,1,0), -(37285,1,0), -(37337,1,0), -(37339,1,0), -(37345,1,0), -(37348,1,0), -(37388,1,0), -(37406,1,0), -(37408,1,1), -(37413,1,0), -(37422,1,0), -(37427,1,0), -(37428,1,0), -(37448,1,1), -(37449,1,1), -(37453,1,0), -(37454,1,0), -(37459,1,0), -(37461,1,0), -(37465,1,0), -(37469,1,0), -(37471,1,0), -(37472,1,0), -(37474,1,0), -(37476,1,0), -(37498,1,0), -(37502,1,0), -(37573,1,0), -(37626,1,0), -(37645,1,0), -(37689,1,0), -(37697,1,0), -(37712,1,0), -(37720,1,0), -(37748,1,0), -(37755,1,0), -(37775,1,0), -(37784,1,0), -(37824,1,0), -(37842,1,0), -(37843,1,0), -(37848,1,0), -(37849,1,1), -(37853,1,0), -(37868,1,0), -(37893,1,0), -(37895,1,0), -(37918,1,0), -(37934,1,0), -(37936,1,0), -(37964,1,0), -(37984,1,0), -(38003,1,0), -(38014,1,0), -(38015,1,0), -(38017,1,0), -(38020,1,0), -(38053,1,0), -(38054,1,0), -(38072,1,0), -(38073,1,0), -(38112,1,0), -(38121,1,0), -(38123,1,0), -(38126,1,0), -(38128,1,0), -(38130,1,0), -(38202,1,0), -(38250,1,0), -(38269,1,0), -(38360,1,0), -(38444,1,0), -(38451,1,0), -(38452,1,0), -(38455,1,0), -(38469,1,0), -(38482,1,0), -(38508,1,0), -(38530,1,0), -(38629,1,0), -(38632,1,0), -(38691,1,0), -(38711,1,0), -(38722,1,0), -(38736,1,0), -(38738,1,0), -(38762,1,0), -(38802,1,0), -(38829,1,1), -(38966,1,0), -(38968,1,0), -(39010,1,0), -(39011,1,0), -(39043,1,0), -(39073,1,0), -(39094,1,0), -(39124,1,0), -(39126,1,0), -(39140,1,0), -(39141,1,0), -(39184,1,0), -(39185,1,0), -(39189,1,0), -(39190,1,0), -(39206,1,0), -(39211,1,0), -(39216,1,0), -(39219,1,0), -(39221,1,0), -(39248,1,0), -(39334,1,0), -(39335,1,0), -(39338,1,0), -(39341,1,0), -(39342,1,0), -(39344,1,0), -(39350,1,0), -(39352,1,0), -(39353,1,0), -(39354,1,0), -(39355,1,0), -(39356,1,0), -(39357,1,0), -(39358,1,0), -(39359,1,0), -(39360,1,0), -(39361,1,0), -(39362,1,0), -(39395,1,0), -(39495,1,0), -(39497,1,1), -(39552,1,0), -(39559,1,0), -(39583,1,0), -(39601,1,0), -(39635,1,0), -(39678,1,0), -(39687,1,0), -(39690,1,0), -(39691,1,0), -(39692,1,0), -(39696,1,0), -(39758,1,0), -(39834,1,1), -(39849,1,0), -(39851,1,1), -(39852,1,1), -(39853,1,1), -(39854,1,1), -(39873,1,0), -(39899,1,0), -(39914,1,0), -(39915,1,0), -(39919,1,0), -(39921,1,0), -(39923,1,1), -(39930,1,0), -(39938,1,0), -(39939,1,0), -(39940,1,0), -(39974,1,0), -(39977,1,0), -(39978,1,0), -(39985,1,0), -(39989,1,0), -(39993,1,0), -(39999,1,0), -(40085,1,0), -(40094,1,0), -(40106,1,0), -(40110,1,0), -(40112,1,1), -(40136,1,0), -(40147,1,0), -(40153,1,0), -(40156,1,0), -(40160,1,0), -(40187,1,0), -(40189,1,0), -(40190,1,0), -(40224,1,0), -(40281,1,0), -(40287,1,0), -(40288,1,0), -(40289,1,0), -(40309,1,0), -(40350,1,0), -(40359,1,0), -(40382,1,0), -(40383,1,0), -(40397,1,0), -(40437,1,0), -(40439,1,0), -(40454,1,0), -(40490,1,0), -(40494,1,0), -(40498,1,0), -(40499,1,0), -(40512,1,0), -(40520,1,0), -(40521,1,0), -(40523,1,0), -(40532,1,0), -(40547,1,0), -(40607,1,0), -(40638,1,0), -(40693,1,0), -(40704,1,0), -(40707,1,0), -(40708,1,0), -(40709,1,0), -(40710,1,0), -(40711,1,0), -(40712,1,0), -(40713,1,0), -(40715,1,0), -(40730,1,1), -(40738,1,0), -(40750,1,0), -(40761,1,0), -(40788,1,0), -(40821,1,0), -(40824,1,0), -(40825,1,0), -(40828,1,0), -(40830,1,0), -(40848,1,1), -(40874,1,0), -(40887,1,0), -(40978,1,0), -(40985,1,1), -(40989,1,0), -(40993,1,1), -(41007,1,1), -(41015,1,1), -(41022,1,1), -(41073,1,0), -(41077,1,0), -(41122,1,0), -(41124,1,0), -(41125,1,0), -(41128,1,0), -(41129,1,0), -(41154,1,0), -(41257,1,0), -(41268,1,0), -(41269,1,0), -(41271,1,0), -(41285,1,1), -(41295,1,0), -(41333,1,0), -(41342,1,0), -(41343,1,0), -(41344,1,0), -(41362,1,0), -(41455,1,0), -(41457,1,0), -(41477,1,0), -(41499,1,0), -(41522,1,0), -(41525,1,0), -(41537,1,0), -(41557,1,0), -(41560,1,0), -(41575,1,0), -(41602,1,0), -(41614,1,0), -(41624,1,1), -(41975,1,0), -(41976,1,0), -(41993,1,0), -(42008,1,0), -(42014,1,0), -(42138,1,1), -(42143,1,0), -(42151,1,0), -(42166,1,0), -(42167,1,0), -(42168,1,0), -(42178,1,0), -(42219,1,0), -(42222,1,0), -(42247,1,0), -(42269,1,0), -(42271,1,0), -(42272,1,0), -(42289,1,0), -(42317,1,0), -(42318,1,0), -(42321,1,0), -(42339,1,0), -(42341,1,0), -(42352,1,0), -(42356,1,0), -(42391,1,0), -(42393,1,0), -(42405,1,0), -(42410,1,0), -(42415,1,0), -(42428,1,0), -(42442,1,0), -(42447,1,0), -(42454,1,0), -(42471,1,0), -(42473,1,0), -(42482,1,0), -(42484,1,0), -(42515,1,0), -(42517,1,0), -(42530,1,0), -(42534,1,0), -(42536,1,0), -(42542,1,0), -(42550,1,0), -(42564,1,0), -(42567,1,0), -(42570,1,0), -(42577,1,0), -(42585,1,0), -(42604,1,0), -(42605,1,0), -(42616,1,0), -(42631,1,0), -(42638,1,1), -(42647,1,0), -(42654,1,0), -(42655,1,0), -(42659,1,0), -(42661,1,0), -(42664,1,0), -(42674,1,1), -(42685,1,0), -(42695,1,0), -(42697,1,0), -(42703,1,0), -(42707,1,0), -(42713,1,0), -(42720,1,0), -(42734,1,0), -(42757,1,1), -(42768,1,0), -(42793,1,0), -(42797,1,0), -(42808,1,0), -(42809,1,0), -(42813,1,0), -(42815,1,0), -(42816,1,0), -(42818,1,0), -(42821,1,0), -(42839,1,0), -(42857,1,0), -(42881,1,0), -(42882,1,0), -(42883,1,0), -(42884,1,0), -(42888,1,0), -(42905,1,0), -(42968,1,0), -(42982,1,0), -(43033,1,0), -(43035,1,0), -(43057,1,0), -(43066,1,0), -(43068,1,0), -(43069,1,0), -(43072,1,0), -(43076,1,0), -(43078,1,0), -(43079,1,0), -(43092,1,0), -(43101,1,0), -(43106,1,0), -(43109,1,0), -(43144,1,0), -(43171,1,0), -(43209,1,0), -(43210,1,0), -(43234,1,0), -(43239,1,0), -(43244,1,0), -(43255,1,0), -(43291,1,0), -(43306,1,0), -(43307,1,0), -(43333,1,0), -(43371,1,0), -(43385,1,0), -(43386,1,0), -(43403,1,0), -(43404,1,0), -(43407,1,0), -(43450,1,0), -(43458,1,0), -(43468,1,0), -(43486,1,0), -(43487,1,0), -(43515,1,0), -(43520,1,0), -(43525,1,0), -(43546,1,0), -(43559,1,0), -(43563,1,0), -(43568,1,0), -(43615,1,0), -(43647,1,0), -(43662,1,0), -(43685,1,0), -(43691,1,0), -(43711,1,0), -(43734,1,0), -(43754,1,0), -(43770,1,0), -(43791,1,0), -(43805,1,0), -(43863,1,0), -(43865,1,0), -(43867,1,0), -(43871,1,0), -(43872,1,0), -(43878,1,0), -(43882,1,0), -(43892,1,0), -(43942,1,0), -(43943,1,0), -(43949,1,0), -(43962,1,0), -(43990,1,0), -(43994,1,0), -(44014,1,0), -(44022,1,0), -(44023,1,0), -(44024,1,0), -(44026,1,0), -(44027,1,0), -(44028,1,0), -(44037,1,0), -(44145,1,0), -(44161,1,0), -(44193,1,0), -(44214,1,0), -(44224,1,1), -(44229,1,0), -(44232,1,1), -(44250,1,0), -(44255,1,0), -(44260,1,0), -(44266,1,0), -(44270,1,0), -(44283,1,0), -(44284,1,0), -(44309,1,0), -(44313,1,0), -(44329,1,0), -(44330,1,0), -(44355,1,0), -(44362,1,0), -(44365,1,0), -(44367,1,0), -(44374,1,0), -(44392,1,0), -(44411,1,0), -(44420,1,0), -(44422,1,0), -(44458,1,0), -(44550,1,0), -(44562,1,0), -(44574,1,0), -(44609,1,0), -(44610,1,0), -(44653,1,0), -(44681,1,0), -(44682,1,1), -(44749,1,0), -(44804,1,0), -(44807,1,0), -(44826,1,0), -(44837,1,0), -(44838,1,0), -(44839,1,0), -(44840,1,0), -(44841,1,0), -(44842,1,0), -(44845,1,0), -(44846,1,0), -(44849,1,1), -(44864,1,0), -(44865,1,0), -(44872,1,0), -(44877,1,0), -(44883,1,0), -(44886,1,0), -(44938,1,0), -(44939,1,0), -(44941,1,0), -(44946,1,0), -(44948,1,0), -(44963,1,0), -(44965,1,0), -(44981,1,0), -(45005,1,0), -(45008,1,0), -(45012,1,0), -(45013,1,0), -(45076,1,0), -(45086,1,0), -(45103,1,0), -(45109,1,0), -(45114,1,0), -(45115,1,0), -(45119,1,0), -(45172,1,0), -(45188,1,0), -(45191,1,0), -(45219,1,0), -(45223,1,0), -(45224,1,0), -(45229,1,0), -(45233,1,0), -(45259,1,0), -(45260,1,1), -(45264,1,0), -(45267,1,0), -(45277,1,0), -(45279,1,0), -(45307,1,0), -(45323,1,0), -(45339,1,0), -(45340,1,0), -(45351,1,0), -(45368,1,0), -(45371,1,0), -(45388,1,0), -(45389,1,0), -(45405,1,0), -(45407,1,0), -(45414,1,0), -(45437,1,0), -(45446,1,0), -(45448,1,0), -(45449,1,0), -(45465,1,0), -(45474,1,0), -(45536,1,0), -(45581,1,0), -(45583,1,0), -(45586,1,0), -(45594,1,0), -(45595,1,0), -(45596,1,0), -(45597,1,0), -(45602,1,0), -(45605,1,0), -(45606,1,0), -(45607,1,0), -(45608,1,0), -(45609,1,0), -(45622,1,0), -(45623,1,0), -(45630,1,0), -(45634,1,0), -(45644,1,1), -(45651,1,0), -(45655,1,0), -(45656,1,0), -(45666,1,0), -(45667,1,0), -(45671,1,1), -(45680,1,1), -(45692,1,0), -(45700,1,0), -(45714,1,0), -(45732,1,0), -(45735,1,0), -(45761,1,0), -(45774,1,0), -(45780,1,0), -(45788,1,0), -(45805,1,0), -(45808,1,0), -(45834,1,0), -(45835,1,0), -(45841,1,0), -(45853,1,0), -(45859,1,0), -(45863,1,0), -(45864,1,0), -(45867,1,0), -(45872,1,0), -(45888,1,0), -(45907,1,0), -(45911,1,0), -(45912,1,0), -(45914,1,0), -(45918,1,1), -(45923,1,0), -(45929,1,0), -(45930,1,0), -(45941,1,0), -(45949,1,0), -(45961,1,0), -(45968,1,0), -(45969,1,0), -(45970,1,0), -(45976,1,0), -(45979,1,0), -(45990,1,0), -(45993,1,0), -(46013,1,0), -(46018,1,1), -(46022,1,0), -(46034,1,0), -(46054,1,0), -(46058,1,0), -(46063,1,0), -(46066,1,0), -(46068,1,0), -(46085,1,0), -(46143,1,0), -(46171,1,0), -(46173,1,0), -(62377,1,0), -(46175,1,0), -(46176,1,0), -(46177,1,0), -(46178,1,0), -(46201,1,0), -(46208,1,0), -(46219,1,0), -(46222,1,0), -(46236,1,0), -(46237,1,0), -(46245,1,0), -(46246,1,0), -(46281,1,0), -(46307,1,1), -(46318,1,0), -(46319,1,0), -(46320,1,1), -(46330,1,0), -(46363,1,0), -(46372,1,1), -(46374,1,0), -(46376,1,0), -(46382,1,0), -(46385,1,0), -(46396,1,1), -(46398,1,0), -(46399,1,0), -(46400,1,0), -(46474,1,0), -(46475,1,0), -(46477,1,0), -(46482,1,0), -(46488,1,0), -(46521,1,0), -(46588,1,1), -(46592,1,0), -(46593,1,0), -(46603,1,0), -(46609,1,0), -(46610,1,0), -(46623,1,0), -(46631,1,0), -(46637,1,0), -(46650,1,0), -(46652,1,0), -(46656,1,0), -(46685,1,0), -(46692,1,0), -(46694,1,0), -(46704,1,0), -(46707,1,0), -(46732,1,1), -(46733,1,0), -(46735,1,0), -(46747,1,0), -(46793,1,0), -(46797,1,0), -(46809,1,0), -(46815,1,0), -(46818,1,0), -(46820,1,0), -(46843,1,0), -(46886,1,0), -(46895,1,0), -(46900,1,0), -(46902,1,0), -(46903,1,0), -(46904,1,0), -(46936,1,0), -(46937,1,0), -(46963,1,0), -(46964,1,0), -(46965,1,1), -(46974,1,0), -(47016,1,0), -(47026,1,0), -(47035,1,0), -(47060,1,0), -(47065,1,0), -(47104,1,0), -(47110,1,0), -(47137,1,0), -(47170,1,0), -(47176,1,0), -(47184,1,0), -(47214,1,0), -(47253,1,0), -(47254,1,0), -(47336,1,0), -(47344,1,0), -(47370,1,1), -(47374,1,0), -(47378,1,0), -(47421,1,0), -(47452,1,0), -(47460,1,0), -(47463,1,0), -(47469,1,0), -(47542,1,0), -(47547,1,0), -(47563,1,0), -(47574,1,0), -(47593,1,0), -(47594,1,0), -(47596,1,0), -(47597,1,0), -(47598,1,0), -(47599,1,0), -(47616,1,0), -(47617,1,0), -(47618,1,0), -(47619,1,0), -(47634,1,0), -(47669,1,0), -(47670,1,0), -(47681,1,0), -(47682,1,0), -(47683,1,0), -(47684,1,0), -(47685,1,0), -(47691,1,1), -(47711,1,0), -(47712,1,0), -(47713,1,0), -(47747,1,0), -(47771,1,0), -(47787,1,0), -(47799,1,0), -(47911,1,0), -(47913,1,0), -(47916,1,0), -(47933,1,0), -(47935,1,0), -(47939,1,0), -(47959,1,0), -(48009,1,0), -(48021,1,0), -(48028,1,1), -(48035,1,0), -(48115,1,0), -(48117,1,0), -(48183,1,0), -(48185,1,0), -(48188,1,0), -(48194,1,1), -(48199,1,0), -(48201,1,0), -(48202,1,0), -(48213,1,0), -(48218,1,0), -(48222,1,0), -(48223,1,0), -(48227,1,0), -(48246,1,1), -(48252,1,0), -(48293,1,0), -(48306,1,0), -(48315,1,0), -(48329,1,0), -(48344,1,0), -(48345,1,0), -(48362,1,0), -(48363,1,0), -(48375,1,0), -(48385,1,0), -(48398,1,0), -(48399,1,0), -(48425,1,0), -(48426,1,0), -(48455,1,0), -(48490,1,0), -(48497,1,0), -(48508,1,0), -(48530,1,0), -(48551,1,0), -(48597,1,0), -(48600,1,0), -(48605,1,0), -(48620,1,0), -(48623,1,0), -(48627,1,0), -(48641,1,0), -(48642,1,0), -(48646,1,0), -(48649,1,0), -(48685,1,0), -(48724,1,0), -(48726,1,0), -(48728,1,0), -(48730,1,0), -(48732,1,0), -(48748,1,0), -(48764,1,0), -(48771,1,0), -(48773,1,0), -(48790,1,0), -(48793,1,0), -(48799,1,0), -(48808,1,0), -(48811,1,0), -(48896,1,0), -(48901,1,0), -(48904,1,0), -(48929,1,0), -(48974,1,0), -(48975,1,0), -(49022,1,0), -(49030,1,0), -(49058,1,0), -(49062,1,0), -(49075,1,0), -(49080,1,0), -(49083,1,0), -(49118,1,0), -(49125,1,0), -(49128,1,0), -(49129,1,0), -(49131,1,0), -(49134,1,0), -(49135,1,0), -(49159,1,0), -(49166,1,0), -(49210,1,0), -(49211,1,0), -(49262,1,0), -(49291,1,0), -(49292,1,0), -(49313,1,0), -(49319,1,0), -(49325,1,0), -(49330,1,0), -(49332,1,0), -(49333,1,0), -(49334,1,0), -(49367,1,0), -(49370,1,0), -(49404,1,0), -(49405,1,0), -(49428,1,0), -(49434,1,0), -(49515,1,0), -(49517,1,0), -(49519,1,0), -(49524,1,0), -(49525,1,0), -(49552,1,0), -(49554,1,0), -(49555,1,0), -(49557,1,0), -(49590,1,0), -(49625,1,0), -(49634,1,0), -(49679,1,0), -(49682,1,0), -(49683,1,0), -(49684,1,0), -(49731,1,0), -(49751,1,0), -(49762,1,0), -(49825,1,0), -(49826,1,0), -(49829,1,0), -(49858,1,0), -(49862,1,0), -(49870,1,0), -(49899,1,0), -(49947,1,0), -(50036,1,0), -(50087,1,0), -(50133,1,0), -(50173,1,0), -(50174,1,0), -(50176,1,0), -(50177,1,0), -(50178,1,0), -(50179,1,0), -(50312,1,0), -(50315,1,1), -(50331,1,0), -(50350,1,0), -(50382,1,0), -(50383,1,0), -(50398,1,1), -(50430,1,0), -(50440,1,0), -(50492,1,0), -(50515,1,0), -(50524,1,0), -(50546,1,0), -(50547,1,0), -(50548,1,0), -(50554,1,0), -(50556,1,0), -(50562,1,0), -(50563,1,0), -(50568,1,0), -(50569,1,0), -(50592,1,0), -(50628,1,0), -(50669,1,0), -(50674,1,0), -(50682,1,1), -(50742,1,0), -(50775,1,0), -(50793,1,0), -(50794,1,0), -(50817,1,0), -(50835,1,0), -(50878,1,0), -(50883,1,1), -(50892,1,0), -(51001,1,0), -(51022,1,0), -(51023,1,0), -(51024,1,0), -(51025,1,0), -(51039,1,0), -(51049,1,0), -(51122,1,0), -(51136,1,0), -(51139,1,0), -(51152,1,0), -(51171,1,0), -(51172,1,0), -(51202,1,0), -(51213,1,0), -(51215,1,0), -(51234,1,0), -(51239,1,0), -(51247,1,0), -(51256,1,0), -(51276,1,0), -(51288,1,0), -(51318,1,0), -(51331,1,0), -(51332,1,0), -(51333,1,0), -(51343,1,0), -(51366,1,0), -(51368,1,0), -(51381,1,0), -(51384,1,0), -(51393,1,0), -(51396,1,0), -(51403,1,0), -(51420,1,0), -(51448,1,1), -(51516,1,0), -(51518,1,0), -(51577,1,0), -(51579,1,0), -(51590,1,0), -(51603,1,0), -(51606,1,0), -(51607,1,0), -(51616,1,0), -(51639,1,0), -(51641,1,0), -(51642,1,0), -(51643,1,0), -(51644,1,0), -(51645,1,0), -(51649,1,0), -(51650,1,0), -(51651,1,0), -(51652,1,0), -(51670,1,0), -(51694,1,0), -(51697,1,0), -(51727,1,0), -(51737,1,0), -(51739,1,0), -(51743,1,0), -(51754,1,0), -(51767,1,0), -(51769,1,0), -(51773,1,0), -(51774,1,0), -(51791,1,0), -(51794,1,0), -(51825,1,0), -(51840,1,0), -(51843,1,0), -(51858,1,0), -(51859,1,0), -(51861,1,0), -(51866,1,0), -(51870,1,0), -(51902,1,0), -(51904,1,0), -(51907,1,0), -(51910,1,0), -(51925,1,0), -(51927,1,0), -(51931,1,0), -(51932,1,0), -(51933,1,0), -(51942,1,0), -(51959,1,0), -(51964,1,0), -(51965,1,0), -(52011,1,0), -(52037,1,0), -(52059,1,0), -(52064,1,0), -(52089,1,0), -(52106,1,0), -(52122,1,0), -(52124,1,0), -(52140,1,0), -(52151,1,0), -(52164,1,0), -(52170,1,0), -(52173,1,0), -(52185,1,0), -(52227,1,0), -(52229,1,0), -(52238,1,0), -(52239,1,0), -(52242,1,0), -(52247,1,0), -(52254,1,0), -(52257,1,0), -(52259,1,0), -(52264,1,0), -(52294,1,0), -(52313,1,0), -(52322,1,0), -(52335,1,0), -(52336,1,0), -(52337,1,1), -(52340,1,0), -(52343,1,0), -(52349,1,0), -(52365,1,1), -(52369,1,0), -(52371,1,0), -(52381,1,0), -(52387,1,0), -(52388,1,0), -(52407,1,0), -(52412,1,0), -(52414,1,0), -(52427,1,0), -(52438,1,0), -(52446,1,0), -(52449,1,0), -(52452,1,0), -(52453,1,0), -(52454,1,0), -(52457,1,0), -(52458,1,0), -(52512,1,0), -(52514,1,0), -(52528,1,0), -(52576,1,0), -(52577,1,0), -(52585,1,0), -(52607,1,0), -(52632,1,0), -(52638,1,0), -(52654,1,0), -(52661,1,0), -(52676,1,0), -(52681,1,0), -(52686,1,0), -(52687,1,0), -(52688,1,0), -(52725,1,0), -(52726,1,0), -(52727,1,0), -(52728,1,0), -(52729,1,0), -(52730,1,0), -(52731,1,0), -(52732,1,0), -(52774,1,0), -(52791,1,0), -(52793,1,0), -(52805,1,0), -(52811,1,0), -(52816,1,0), -(52833,1,0), -(52834,1,0), -(52837,1,0), -(52838,1,0), -(52844,1,0), -(52850,1,0), -(52884,1,0), -(52908,1,0), -(52920,1,0), -(52930,1,0), -(52934,1,0), -(52935,1,0), -(52936,1,0), -(52937,1,0), -(52953,1,0), -(52955,1,0), -(52956,1,0), -(52981,1,0), -(52989,1,0), -(52990,1,0), -(53010,1,0), -(53020,1,0), -(53024,1,0), -(53029,1,0), -(53038,1,0), -(53083,1,0), -(53093,1,0), -(53096,1,0), -(53106,1,0), -(53110,1,0), -(53163,1,0), -(53170,1,0), -(53177,1,0), -(53185,1,0), -(53206,1,0), -(53210,1,0), -(53242,1,1), -(53272,1,0), -(53441,1,0), -(53464,1,0), -(53465,1,0), -(53466,1,0), -(53570,1,0), -(53609,1,0), -(53613,1,0), -(53626,1,0), -(53644,1,0), -(53680,1,0), -(53683,1,0), -(53684,1,0), -(53685,1,0), -(53701,1,0), -(53714,1,1), -(53717,1,0), -(53730,1,0), -(53745,1,0), -(53757,1,1), -(53778,1,0), -(53798,1,0), -(53826,1,0), -(53827,1,0), -(53828,1,0), -(53829,1,0), -(54040,1,0), -(54047,1,0), -(54089,1,0), -(54090,1,0), -(54097,1,0), -(54108,1,0), -(54112,1,0), -(54128,1,0), -(54142,1,0), -(54209,1,0), -(54236,1,0), -(54245,1,0), -(54250,1,0), -(54258,1,0), -(54264,1,0), -(54265,1,0), -(54266,1,0), -(54267,1,0), -(54269,1,0), -(54323,1,0), -(54325,1,0), -(54327,1,0), -(54328,1,0), -(54377,1,0), -(54423,1,0), -(54426,1,0), -(54430,1,0), -(54464,1,0), -(54510,1,0), -(54522,1,0), -(54539,1,0), -(54548,1,0), -(54643,1,0), -(54656,1,0), -(54664,1,0), -(54685,1,0), -(54699,1,1), -(54725,1,1), -(54728,1,0), -(54744,1,1), -(54746,1,1), -(54773,1,0), -(54796,1,0), -(54798,1,0), -(54806,1,0), -(54878,1,0), -(54899,1,0), -(54984,1,0), -(54985,1,0), -(54988,1,0), -(54991,1,0), -(55063,1,0), -(55089,1,0), -(55127,1,0), -(55134,1,0), -(55137,1,0), -(55138,1,0), -(55141,1,0), -(55145,1,0), -(55161,1,0), -(55223,1,0), -(55227,1,0), -(55229,1,0), -(55231,1,0), -(55244,1,0), -(55257,1,0), -(55287,1,0), -(55288,1,0), -(55290,1,0), -(55406,1,0), -(55418,1,0), -(55419,1,0), -(55423,1,1), -(55432,1,0), -(55465,1,0), -(55468,1,0), -(55510,1,0), -(55516,1,0), -(55519,1,0), -(55524,1,0), -(55526,1,0), -(55527,1,0), -(55571,1,0), -(55578,1,0), -(55616,1,1), -(55647,1,0), -(55660,1,0), -(55661,1,0), -(55662,1,0), -(55693,1,0), -(55720,1,0), -(55721,1,0), -(55722,1,0), -(55723,1,0), -(55724,1,0), -(55725,1,0), -(55726,1,0), -(55727,1,0), -(55785,1,0), -(55796,1,0), -(55801,1,0), -(55803,1,0), -(55805,1,0), -(55811,1,0), -(55844,1,0), -(55853,1,0), -(55868,1,0), -(55872,1,0), -(55875,1,0), -(55878,1,1), -(55881,1,1), -(55882,1,0), -(55885,1,1), -(55886,1,0), -(55887,1,1), -(55888,1,0), -(55954,1,0), -(56047,1,0), -(56066,1,0), -(56099,1,0), -(56103,1,0), -(56114,1,0), -(56117,1,0), -(56150,1,0), -(56152,1,0), -(56189,1,0), -(56227,1,0), -(56253,1,0), -(56263,1,0), -(56264,1,0), -(56265,1,0), -(56266,1,0), -(56275,1,0), -(56312,1,0), -(56387,1,0), -(56388,1,0), -(56393,1,0), -(56429,1,0), -(56458,1,0), -(56505,1,0), -(56523,1,0), -(56560,1,0), -(56563,1,0), -(56567,1,0), -(56575,1,0), -(56621,1,0), -(56622,1,0), -(56652,1,0), -(56661,1,0), -(56663,1,0), -(56665,1,0), -(56667,1,0), -(56669,1,0), -(56673,1,0), -(56677,1,0), -(56680,1,0), -(56683,1,0), -(56688,1,0), -(56691,1,0), -(56693,1,0), -(56695,1,0), -(56696,1,0), -(56711,1,0), -(56713,1,0), -(56722,1,0), -(56723,1,0), -(56724,1,0), -(56725,1,0), -(56738,1,0), -(56763,1,0), -(56764,1,0), -(56865,1,0), -(56905,1,0), -(56917,1,0), -(56941,1,1), -(57042,1,0), -(57068,1,0), -(57071,1,0), -(57072,1,0), -(57410,1,0), -(57417,1,0), -(57420,1,0), -(57422,1,0), -(57469,1,0), -(57471,1,0), -(57495,1,0), -(57523,1,0), -(57534,1,0), -(57632,1,0), -(57637,1,0), -(57638,1,0), -(57639,1,0), -(57642,1,0), -(57650,1,0), -(57659,1,0), -(57666,1,0), -(57667,1,0), -(57682,1,0), -(57732,1,0), -(57734,1,0), -(57735,1,0), -(57736,1,0), -(57737,1,0), -(57738,1,0), -(57797,1,0), -(57806,1,0), -(57809,1,0), -(57828,1,0), -(57852,1,0), -(57853,1,0), -(57885,1,0), -(57891,1,0), -(57912,1,0), -(57930,1,0), -(57962,1,0), -(57963,1,0), -(57980,1,0), -(57983,1,0), -(58036,1,0), -(58040,1,0), -(58064,1,0), -(58084,1,0), -(58103,1,0), -(58108,1,0), -(58109,1,0), -(58112,1,0), -(58114,1,0), -(58121,1,0), -(58123,1,0), -(58124,1,0), -(58131,1,0), -(58152,1,0), -(58178,1,0), -(58195,1,1), -(58196,1,1), -(58197,1,1), -(58198,1,1), -(58225,1,0), -(58350,1,0), -(58416,1,0), -(58493,1,1), -(58515,1,0), -(58533,1,0), -(58542,1,0), -(58552,1,0), -(58593,1,0), -(58641,1,0), -(58658,1,0), -(58672,1,0), -(58685,1,0), -(58793,1,0), -(58836,1,0), -(58838,1,0), -(58846,1,1), -(58858,1,0), -(58873,1,0), -(58916,1,0), -(58917,1,0), -(58945,1,0), -(58949,1,0), -(59078,1,0), -(59091,1,0), -(59098,1,0), -(59115,1,0), -(59125,1,0), -(59189,1,0), -(59190,1,0), -(59284,1,0), -(59335,1,0), -(59363,1,0), -(59375,1,0), -(59383,1,0), -(59386,1,0), -(59396,1,0), -(59449,1,0), -(59456,1,0), -(59461,1,1), -(59528,1,0), -(59534,1,0), -(59552,1,0), -(59554,1,0), -(59556,1,1), -(59579,1,0), -(59595,1,0), -(59643,1,0), -(59655,1,0), -(59668,1,0), -(59677,1,0), -(59678,1,0), -(59704,1,0), -(59729,1,0), -(59730,1,0), -(59764,1,0), -(59780,1,0), -(59781,1,0), -(59807,1,0), -(59847,1,0), -(59867,1,0), -(59871,1,0), -(59897,1,0), -(59925,1,0), -(59930,1,0), -(59951,1,0), -(59952,1,0), -(59977,1,0), -(60038,1,0), -(60045,1,0), -(60046,1,0), -(60088,1,0), -(60104,1,0), -(60178,1,1), -(60207,1,0), -(60208,1,0), -(60224,1,0), -(60243,1,0), -(60256,1,0), -(60285,1,0), -(60288,1,0), -(60291,1,1), -(60292,1,1), -(60293,1,1), -(60294,1,1), -(60295,1,1), -(60296,1,1), -(60297,1,1), -(60298,1,0), -(60310,1,0), -(60315,1,0), -(60316,1,0), -(60342,1,0), -(60422,1,0), -(60456,1,0), -(60476,1,1), -(60496,1,0), -(60499,1,1), -(60507,1,1), -(60508,1,1), -(60511,1,0), -(60516,1,0), -(60522,1,1), -(60528,1,0), -(60535,1,0), -(60536,1,0), -(60561,1,0), -(60612,1,0), -(60614,1,0), -(60713,1,0), -(60810,1,0), -(60829,1,0), -(60831,1,0), -(60834,1,0), -(60836,1,0), -(60863,1,0), -(60909,1,0), -(60912,1,1), -(60967,1,0), -(61007,1,0), -(61026,1,0), -(61028,1,0), -(61071,1,0), -(61072,1,0), -(61073,1,0), -(61074,1,0), -(61075,1,0), -(61114,1,0), -(61121,1,0), -(61151,1,0), -(61152,1,0), -(61180,1,0), -(61210,1,0), -(61219,1,0), -(61245,1,0), -(61254,1,0), -(61353,1,0), -(61355,1,0), -(61397,1,0), -(61408,1,0), -(61416,1,0), -(61487,1,0), -(61488,1,0), -(61492,1,0), -(61524,1,0), -(61537,1,0), -(61588,1,0), -(61602,1,0), -(61647,1,0), -(61652,1,0), -(61665,1,0), -(61710,1,0), -(61738,1,0), -(61764,1,0), -(61765,1,0), -(61766,1,0), -(61771,1,0), -(61816,1,1), -(61863,1,1), -(61901,1,0), -(61934,1,0), -(61942,1,0), -(61964,1,0), -(61975,1,0), -(62002,1,0), -(62016,1,0), -(62034,1,0), -(62037,1,1), -(62072,1,0), -(62082,1,0), -(62083,1,0), -(62084,1,0), -(62091,1,0), -(62102,1,0), -(62195,1,0), -(62223,1,0), -(62266,1,0), -(62272,1,0), -(62278,1,0), -(62284,1,0), -(62304,1,0), -(62323,1,0), -(62343,1,0), -(47129,2,0), -(34395,2,0), -(34387,2,0), -(32440,2,0), -(32439,2,0), -(32205,2,0), -(31538,2,0), -(30740,2,0), -(29831,2,0), -(28806,2,0), -(28353,2,0), -(27517,2,0), -(27203,2,0), -(27202,2,0), -(27201,2,0), -(27191,2,0), -(27190,2,0), -(27184,2,0), -(26560,2,0), -(26063,2,0), -(25005,2,0), -(24934,2,0), -(24871,2,0), -(24721,2,0), -(24390,2,0), -(23208,2,0), -(21127,2,0), -(18431,2,0), -(17731,2,0), -(17016,2,0), -(16613,2,0), -(16447,2,0), -(13489,2,0), -(12139,2,0), -(11792,2,0), -(9224,2,0), -(9223,2,0), -(9222,2,0), -(9221,2,0), -(8674,2,0), -(7729,2,0), -(7728,2,0), -(3921,2,0), -(35683,2,0), -(36066,2,0), -(36546,2,0), -(36851,2,0), -(37754,2,0), -(38439,2,0), -(38782,2,0), -(39050,2,0), -(40055,2,0), -(40165,2,0), -(40166,2,0), -(40167,2,0), -(40328,2,0), -(40447,2,0), -(40468,2,0), -(40632,2,0), -(40640,2,0), -(40642,2,0), -(40644,2,0), -(40675,2,0), -(40774,2,0), -(40785,2,0), -(40964,2,0), -(40965,2,0), -(40968,2,0), -(40970,2,0), -(41004,2,0), -(41145,2,0), -(41146,2,0), -(42020,2,0), -(42022,2,0), -(42323,2,0), -(42788,2,0), -(43418,2,0), -(43552,2,0), -(43723,2,0), -(43753,2,0), -(43768,2,0), -(43950,2,0), -(44307,2,0), -(44498,2,0), -(44499,2,0), -(44611,2,0), -(44686,2,0), -(44874,2,0), -(44885,2,0), -(45149,2,0), -(45222,2,0), -(45226,2,0), -(45795,2,0), -(45877,2,0), -(45971,2,0), -(46072,2,0), -(46350,2,0), -(46360,2,1), -(46584,2,0), -(76006,2,0), -(74179,2,0), -(72869,2,0), -(72868,2,0), -(72608,2,0), -(72456,2,0), -(72405,2,0), -(72340,2,1), -(71284,2,1), -(70598,2,1), -(70446,2,1), -(70346,2,0), -(70227,2,0), -(70199,2,0), -(70175,2,0), -(70173,2,0), -(69402,2,0), -(69400,2,0), -(69294,2,0), -(69157,2,0), -(67815,2,0), -(67814,2,0), -(67813,2,0), -(67812,2,0), -(67798,2,0), -(67459,2,0), -(67458,2,0), -(67448,2,0), -(67439,2,0), -(67436,2,0), -(66676,2,0), -(66672,2,0), -(66655,2,0), -(66531,2,0), -(66289,2,0), -(65209,2,0), -(64871,2,0), -(64570,2,0), -(64436,2,0), -(63618,2,0), -(63381,2,0), -(62776,2,0), -(62714,2,0), -(62635,2,0), -(62397,2,0), -(62363,2,0), -(62357,2,0), -(62355,2,0), -(62307,2,0), -(62086,2,0), -(61999,2,1), -(60289,2,0), -(60101,2,0), -(59790,2,0), -(59732,2,0), -(59576,2,0), -(58596,2,0), -(58231,2,0), -(57945,2,0), -(57619,2,0), -(57610,2,0), -(57607,2,0), -(57583,2,0), -(57575,2,0), -(57544,2,0), -(57517,2,0), -(57415,2,0), -(56790,2,0), -(56570,2,0), -(56385,2,0), -(56350,2,0), -(55934,2,0), -(55820,2,0), -(55367,2,0), -(55197,2,0), -(54712,2,0), -(54666,2,0), -(54530,2,0), -(52510,2,0), -(52408,2,0), -(52339,2,0), -(52277,2,0), -(52274,2,0), -(52115,2,0), -(51383,2,0), -(51328,2,0), -(51327,2,0), -(51326,2,0), -(51325,2,0), -(51241,2,0), -(50999,2,0), -(50319,2,0), -(50026,2,0), -(50003,2,0), -(49867,2,0), -(49860,2,0), -(49765,2,0), -(49728,2,0), -(49693,2,0), -(49689,2,0), -(49158,2,0), -(49123,2,0), -(49109,2,0), -(48794,2,0), -(48738,2,0), -(48347,2,0), -(47978,2,0), -(35246,2,0), -(42576,3,0), -(42492,3,0), -(42475,3,0), -(42433,3,0), -(42350,3,0), -(42348,3,0), -(42242,3,1), -(42228,3,0), -(42220,3,0), -(42114,3,0), -(41221,3,0), -(40961,3,0), -(40960,3,0), -(40959,3,0), -(40957,3,0), -(40885,3,0), -(40603,3,0), -(40495,3,0), -(40401,3,0), -(40380,3,0), -(40341,3,0), -(40307,3,0), -(40286,3,0), -(40285,3,0), -(40284,3,0), -(40283,3,0), -(40268,3,0), -(40247,3,0), -(40246,3,0), -(40245,3,0), -(40244,3,0), -(40240,3,0), -(40222,3,0), -(40179,3,0), -(40178,3,0), -(40177,3,0), -(40176,3,0), -(40105,3,0), -(40076,3,0), -(39932,3,0), -(39887,3,0), -(39844,3,0), -(39832,3,1), -(39831,3,0), -(39558,3,0), -(39401,3,0), -(39399,3,0), -(39398,3,0), -(39393,3,0), -(39384,3,0), -(39364,3,0), -(38866,3,0), -(38680,3,0), -(38173,3,0), -(38046,3,0), -(38044,3,0), -(37970,3,0), -(37954,3,0), -(37942,3,0), -(37919,3,0), -(37913,3,0), -(37793,3,1), -(37789,3,0), -(37750,3,1), -(37504,3,0), -(37489,3,0), -(37473,3,1), -(37366,3,0), -(37134,3,0), -(36821,3,0), -(36811,3,0), -(36450,3,0), -(36449,3,1), -(36325,3,0), -(35958,3,0), -(35776,3,0), -(35734,3,0), -(35599,3,0), -(35596,3,0), -(34303,3,0), -(34200,3,0), -(34186,3,0), -(42578,3,0), -(33814,3,0), -(33783,3,0), -(33670,3,0), -(33664,3,0), -(33365,3,0), -(33240,3,0), -(33111,3,0), -(32785,3,0), -(32314,3,0), -(32307,3,0), -(32241,3,0), -(32148,3,0), -(32067,3,0), -(31927,3,0), -(31543,3,0), -(31364,3,0), -(31363,3,0), -(31333,3,0), -(30758,3,0), -(30741,3,0), -(30284,3,0), -(29945,3,0), -(29866,3,0), -(29820,3,1), -(29460,3,0), -(28373,3,0), -(28250,3,0), -(28054,3,0), -(26521,3,0), -(26519,3,0), -(26518,3,0), -(26517,3,0), -(26516,3,0), -(26490,3,0), -(26488,3,0), -(26393,3,1), -(26373,3,0), -(26338,3,0), -(26337,3,0), -(26336,3,0), -(26335,3,0), -(26334,3,0), -(26333,3,0), -(26329,3,0), -(26328,3,0), -(26327,3,0), -(26326,3,0), -(26325,3,0), -(26304,3,0), -(26295,3,0), -(26294,3,0), -(26293,3,0), -(26292,3,0), -(26291,3,0), -(26286,3,0), -(25687,3,0), -(25183,3,0), -(25181,3,0), -(25180,3,0), -(25178,3,0), -(25177,3,0), -(24973,3,0), -(24731,3,0), -(23024,3,0), -(21086,3,0), -(21014,3,0), -(20038,3,0), -(20037,3,0), -(19873,3,0), -(17179,3,0), -(16629,3,0), -(16452,3,0), -(16337,3,0), -(15998,3,0), -(13488,3,0), -(12151,3,0), -(10860,3,0), -(10836,3,0), -(10835,3,0), -(10834,3,0), -(10805,3,0), -(9257,3,0), -(9232,3,0), -(42868,3,0), -(43233,3,0), -(43539,3,0), -(43664,3,0), -(43898,3,0), -(43954,3,0), -(43963,3,0), -(43986,3,0), -(44013,3,0), -(44132,3,0), -(44213,3,0), -(44249,3,0), -(44320,3,0), -(44321,3,0), -(44375,3,0), -(44465,3,0), -(44554,3,0), -(44565,3,0), -(44603,3,0), -(44678,3,0), -(44844,3,0), -(44884,3,0), -(45030,3,0), -(45050,3,1), -(45201,3,0), -(45203,3,0), -(45404,3,0), -(45502,3,0), -(45585,3,0), -(45633,3,0), -(45635,3,0), -(45653,3,0), -(45839,3,0), -(45885,3,1), -(46417,3,0), -(46574,3,0), -(46638,3,1), -(46852,3,0), -(46896,3,0), -(47030,3,1), -(47328,3,0), -(47510,3,0), -(47628,3,0), -(47745,3,0), -(47775,3,1), -(47800,3,0), -(48198,3,0), -(48212,3,0), -(48331,3,0), -(48431,3,0), -(48882,3,0), -(48972,3,0), -(49197,3,0), -(49300,3,0), -(49308,3,0), -(49453,3,0), -(49735,3,0), -(50313,3,1), -(50348,3,0), -(50443,3,0), -(50501,3,0), -(50626,3,0), -(50639,3,0), -(50640,3,0), -(50716,3,0), -(50790,3,0), -(50791,3,0), -(50802,3,0), -(50803,3,0), -(50825,3,0), -(50826,3,0), -(51212,3,0), -(51246,3,0), -(51395,3,0), -(51511,3,0), -(51742,3,0), -(51748,3,0), -(51805,3,0), -(51846,3,0), -(52067,3,1), -(52271,3,0), -(52305,3,0), -(52479,3,0), -(52480,3,0), -(52497,3,0), -(52603,3,0), -(52683,3,0), -(52685,3,0), -(52812,3,0), -(53677,3,0), -(53679,3,0), -(53694,3,0), -(53705,3,0), -(53706,3,0), -(54272,3,0), -(54517,3,0), -(54914,3,0), -(54961,3,0), -(54990,3,0), -(55037,3,0), -(55083,3,0), -(55365,3,0), -(55479,3,0), -(55715,3,0), -(55800,3,0), -(55889,3,1), -(56095,3,0), -(56140,3,0), -(56386,3,0), -(56389,3,0), -(56578,3,0), -(56747,3,0), -(56765,3,0), -(57586,3,0), -(57800,3,0), -(57824,3,0), -(57835,3,0), -(58766,3,0), -(58825,3,0), -(59008,3,0), -(59462,3,0), -(59464,3,0), -(59564,3,0), -(59629,3,0), -(59694,3,0), -(60639,3,0), -(61126,3,0), -(61224,3,0), -(61699,3,0), -(62000,3,0), -(62056,3,0), -(62385,3,0), -(62387,3,0), -(62399,3,0), -(62565,3,0), -(62709,3,0), -(62973,3,0), -(62991,3,0), -(63019,3,0), -(63122,3,1), -(63292,3,0), -(63294,3,0), -(63295,3,0), -(63317,3,0), -(63414,3,0), -(63528,3,0), -(63766,3,0), -(63983,3,0), -(63985,3,0), -(64021,3,0), -(65044,3,0), -(65045,3,0), -(65101,3,0), -(65585,3,0), -(65586,3,0), -(65690,3,0), -(66129,3,0), -(66170,3,0), -(66598,3,0), -(67398,3,0), -(68378,3,0), -(68902,3,0), -(69007,3,0), -(69095,3,0), -(69096,3,0), -(69708,3,0), -(69783,3,0), -(69797,3,0), -(69799,3,0), -(69802,3,0), -(69985,3,0), -(70028,3,0), -(70037,3,0), -(70194,3,0), -(70521,3,0), -(70564,3,0), -(70590,3,0), -(70997,3,0), -(70998,3,0), -(70999,3,0), -(71278,3,1), -(71621,3,0), -(71704,3,0), -(72155,3,1), -(72162,3,1), -(72274,3,1), -(72297,3,1), -(72460,3,1), -(72548,3,1), -(72549,3,1), -(72550,3,1), -(72619,3,1), -(72620,3,1), -(72679,3,0), -(72771,3,0), -(72850,3,0), -(72851,3,0), -(72852,3,0), -(74318,3,0), -(74319,3,0), -(74320,3,0), -(74472,3,0), -(75509,3,0), -(75553,3,1), -(75766,3,1), -(34012,3,0), -(74271,4,0), -(74270,4,0), -(72096,4,1), -(72034,4,1), -(71615,4,0), -(70827,4,0), -(69425,4,0), -(69164,4,0), -(69162,4,0), -(68981,4,0), -(68788,4,1), -(67816,4,0), -(67796,4,0), -(65370,4,0), -(65333,4,0), -(64626,4,0), -(62826,4,0), -(62489,4,0), -(62466,4,0), -(62457,4,0), -(62345,4,0), -(62308,4,0), -(60206,4,0), -(58185,4,0), -(55896,4,0), -(55349,4,0), -(54109,4,0), -(54107,4,0), -(51678,4,0), -(50652,4,0), -(49556,4,0), -(48610,4,0), -(48277,4,0), -(48224,4,0), -(47674,4,0), -(47109,4,0), -(45922,4,0), -(44969,4,0), -(44737,4,0), -(44687,4,0), -(44626,4,0), -(44233,4,0), -(40647,4,0), -(40259,4,0), -(39246,4,0), -(36904,4,0), -(36460,4,0), -(36374,4,0), -(30532,4,0), -(28995,4,0), -(10451,4,0), -(9735,4,0), -(8900,4,0), -(8899,4,0), -(8898,4,0), -(8202,4,0), -(74272,4,0), -(69767,5,0), -(65590,5,0), -(62386,5,0), -(55588,5,0), -(54713,5,0), -(49464,5,0), -(49460,5,0), -(49346,5,0), -(47310,5,1), -(45676,5,0), -(44217,5,0), -(43977,5,0), -(41962,5,0), -(40789,5,0), -(40503,5,0), -(38729,5,0), -(38312,5,0), -(38106,5,0), -(38105,5,0), -(38104,5,0), -(38103,5,0), -(38102,5,0), -(38101,5,0), -(38100,5,0), -(38099,5,0), -(37206,5,0), -(37205,5,0), -(37204,5,0), -(36817,5,0), -(34630,5,0), -(21866,5,0), -(21794,5,0), -(19832,5,0), -(19250,5,0), -(8913,5,0), -(67308,6,0), -(67307,6,0), -(67306,6,0), -(67305,6,0), -(67304,6,0), -(67303,6,0), -(65876,6,0), -(65875,6,0), -(63041,6,0), -(62560,6,0), -(59099,6,1), -(44608,6,0), -(43702,6,0), -(43080,6,0), -(43056,6,0), -(40902,6,0), -(40657,6,0), -(28803,6,1), -(16054,6,0), -(8712,6,0), -(75863,7,1), -(75448,7,1), -(74412,7,1), -(74323,7,0), -(74322,7,0), -(74321,7,0), -(73028,7,0), -(72622,7,1), -(72621,7,1), -(72459,7,1), -(72273,7,0), -(72272,7,0), -(71618,7,0), -(71614,7,0), -(71279,7,1), -(70982,7,0), -(70981,7,0), -(70952,7,0), -(69540,7,0), -(67751,7,0), -(66905,7,0), -(66667,7,0), -(65126,7,0), -(64218,7,0), -(63059,7,0), -(62942,7,0), -(62705,7,0), -(61920,7,0), -(61715,7,0), -(61714,7,0), -(61632,7,0), -(60532,7,0), -(60430,7,0), -(59474,7,0), -(59465,7,0), -(57409,7,0), -(57405,7,0), -(57056,7,1), -(56694,7,0), -(56454,7,0), -(54160,7,0), -(53605,7,0), -(52319,7,0), -(51719,7,0), -(50747,7,0), -(50646,7,0), -(50645,7,0), -(50627,7,0), -(50218,7,0), -(49889,7,0), -(48742,7,0), -(48552,7,0), -(46158,7,0), -(42287,7,0), -(42265,7,1), -(42079,7,0), -(42004,7,1), -(41284,7,0), -(41113,7,0), -(41112,7,0), -(41111,7,0), -(41110,7,0), -(41071,7,0), -(41064,7,1), -(40931,7,0), -(40929,7,0), -(40905,7,0), -(40900,7,0), -(40851,7,0), -(40370,7,0), -(40172,7,0), -(40171,7,0), -(40170,7,0), -(40169,7,0), -(40075,7,1), -(39698,7,0), -(39686,7,0), -(39218,7,0), -(38920,7,0), -(38774,7,0), -(38484,7,0), -(38449,7,0), -(38371,7,0), -(37076,7,0), -(35957,7,1), -(35754,7,0), -(35289,7,0), -(34350,7,0), -(34187,7,0), -(31625,7,0), -(31624,7,0), -(31617,7,0), -(30939,7,1), -(30659,7,0), -(30657,7,0), -(30531,7,0), -(30098,7,0), -(28681,7,1), -(25790,7,0), -(25029,7,0), -(23015,7,0), -(22710,7,0), -(20553,7,0), -(10732,7,0), -(10348,7,0), -(7082,7,0), -(5628,7,0), -(804,7,0), -(802,7,0), -(54069,1,0), -(56251,1,0), -(58630,1,0); - --- remove redundant entries -DELETE FROM `conditions` WHERE `ConditionTypeOrReference` = 18 AND `ConditionValue1` = 1 AND `ConditionValue2` = 0 AND `SourceEntry` IN (SELECT `id` FROM `temp_convert_spells` WHERE onlyPlayers); - --- set source group if available in db -UPDATE `conditions` SET `SourceGroup` = `ConditionValue3`, `ConditionValue3` = 0 WHERE `ConditionTypeOrReference` = 18; - --- set source group in case of old default (not set) source group -UPDATE `conditions` SET `SourceGroup` = (SELECT `effMask` FROM `temp_convert_spells` WHERE `id` = `SourceEntry`) WHERE `SourceGroup` = 0 AND `ConditionTypeOrReference` = 18; - -CREATE TABLE `temp_cond_vals` -( - `sourceGroup` INT(11), - `sourceEntry` INT(11), - `conditionValue1` INT(11), - `conditionValue2` INT(11), - `elseGroup` INT(11) AUTO_INCREMENT, - PRIMARY KEY (`sourceGroup`, `sourceEntry`, `elseGroup`) -) ENGINE=MYISAM; - -INSERT INTO `temp_cond_vals` (`sourceGroup`, `sourceEntry`, `conditionValue1`, `conditionValue2`) SELECT `SourceGroup`, `SourceEntry`, `ConditionValue1`, `ConditionValue2` FROM `conditions` WHERE `ConditionTypeOrReference` = 18; - --- set correct else group -UPDATE `conditions` SET `ElseGroup` = (SELECT `elseGroup` FROM `temp_cond_vals` WHERE `sourceGroup` = `conditions`.`SourceGroup` AND `sourceEntry` = `conditions`.`SourceEntry` AND `conditionValue1` = `conditions`.`ConditionValue1` AND `conditionValue2` = `conditions`.`ConditionValue2`)-1 WHERE `ConditionTypeOrReference` = 18; - --- old condition type 3 (caster's minion) -INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`) -SELECT `SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `ElseGroup`, 33, 0, 1, 3 FROM `conditions` WHERE `ConditionTypeOrReference` = 18 AND `ConditionValue1` = 3; - -UPDATE `conditions` SET `ConditionTypeOrReference` = 31 WHERE `ConditionTypeOrReference` = 18 AND `ConditionValue1` = 3; - --- old condition type 2 (dead creature) -INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `NegativeCondition`) -SELECT `SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `ElseGroup`, 36, 0, 0, 0, 1 FROM `conditions` WHERE `ConditionTypeOrReference` = 18 AND `ConditionValue1` = 2; - -UPDATE `conditions` SET `ConditionTypeOrReference` = 31, `ConditionValue1` = 3 WHERE `ConditionTypeOrReference` = 18 AND `ConditionValue1` = 2; - --- old condition type 1 (creature) -UPDATE `conditions` SET `ConditionTypeOrReference` = 31, `ConditionValue1` = 3 WHERE `ConditionTypeOrReference` = 18 AND `ConditionValue1` = 1 AND `ConditionValue2`; - --- old condition type 1 (player) -UPDATE `conditions` SET `ConditionTypeOrReference` = 32, `ConditionValue1` = 0x90 WHERE `ConditionTypeOrReference` = 18 AND `ConditionValue1` = 1 AND NOT `ConditionValue2`; - --- old condition type 0 (gameobject) -UPDATE `conditions` SET `ConditionTypeOrReference` = 31, `ConditionValue1` = 5 WHERE `ConditionTypeOrReference` = 18 AND `ConditionValue1` = 0; - -DROP TABLE `temp_convert_spells`; -DROP TABLE `temp_cond_vals`; \ No newline at end of file diff --git a/sql/updates/world/2012_02_21_02_world_creature_loot_template.sql b/sql/updates/world/2012_02_21_02_world_creature_loot_template.sql deleted file mode 100644 index 6c6af7ed2a3..00000000000 --- a/sql/updates/world/2012_02_21_02_world_creature_loot_template.sql +++ /dev/null @@ -1,11 +0,0 @@ -UPDATE `creature_template` SET `lootid`=`entry` WHERE `entry` IN (38032,37917,38016,38023,37214,38030,38006,37984); -DELETE FROM `creature_loot_template` WHERE `entry`IN (38032,37917,38016,38023,37214,38030,38006,37984); -INSERT INTO `creature_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES -(38032,1,100,1,0,-45009,1), -- Crown Sprayer -(37917,1,100,1,0,-45009,1), -- Crown Thug -(38016,1,100,1,0,-45009,1), -- Crown Agent -(38023,1,100,1,0,-45009,1), -- Crown Sprinkler -(37214,1,100,1,0,-45009,1), -- Crown Lackey -(38030,1,100,1,0,-45009,1), -- Crown Underling -(38006,1,100,1,0,-45009,1), -- Crown Hoodlum (level 1??) -(37984,1,100,1,0,-45009,1); -- Crown Duster (level 1??) diff --git a/sql/updates/world/2012_02_21_03_world_creature_loot_template.sql b/sql/updates/world/2012_02_21_03_world_creature_loot_template.sql deleted file mode 100644 index d7d043cbda9..00000000000 --- a/sql/updates/world/2012_02_21_03_world_creature_loot_template.sql +++ /dev/null @@ -1,26 +0,0 @@ --- Razormane Hunter Warrior's Boots 32% to 3.2% -UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=3.2996 WHERE `entry`=3265 AND `item`=2967; --- Razormane Hunter Hunting Cloak 11% to 1.1% -UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=1.1855 WHERE `entry`=3265 AND `item`=4689; --- Razormane Defender Pioneer Buckler 87% to 0.8% -UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=0.8789 WHERE `entry`=3266 AND `item`=7109; --- Razormane Defender Spellbinder Belt 77% to 0.7% -UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=0.7717 WHERE `entry`=3266 AND `item`=4684; --- Razormane Geomancer Simple Shoes 77% to 0.7% -UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=0.7791 WHERE `entry`=3269 AND `item`=9743; --- Razormane Geomancer Veteran Bracers 73% to 0.7% -UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=0.7364 WHERE `entry`=3269 AND `item`=3213; --- Venture Co. Supervisor Burnt Leather Belt 85% to 0.8% -UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=0.8511 WHERE `entry`=2979 AND `item`=4666; --- Venture Co. Supervisor Warrior's Gloves 74% to 0.7% -UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=0.7433 WHERE `entry`=2979 AND `item`=2968; --- Venture Co. Supervisor Pioneer Bracers 55% to 0.5% -UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=0.5593 WHERE `entry`=2979 AND `item`=6519; --- Venture Co. Supervisor Journeyman's Gloves 43% to 0.4% -UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=0.4348 WHERE `entry`=2979 AND `item`=2960; --- Venture Co. Worker Warrior's Bracers 72% to 0.7% -UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=0.7226 WHERE `entry`=2978 AND `item`=3214; --- Venture Co. Worker Fine Scimitar 64% to 0.6% -UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=0.6492 WHERE `entry`=2978 AND `item`=4560; --- Venture Co. Worker Warrior's Girdle 24% to 0.2% -UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=0.2458 WHERE `entry`=2978 AND `item`=4659; diff --git a/sql/updates/world/2012_02_21_04_world_creature_loot_template.sql b/sql/updates/world/2012_02_21_04_world_creature_loot_template.sql deleted file mode 100644 index 3deedbf0b0d..00000000000 --- a/sql/updates/world/2012_02_21_04_world_creature_loot_template.sql +++ /dev/null @@ -1,16 +0,0 @@ -SET @ENTRY := 30409; -- Apprentice Osterkilgr -DELETE FROM `creature_loot_template` WHERE entry=@ENTRY; -INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES --- Quest related Items -(@ENTRY,43089,-100,1,0,1,1), -- Vrykul Bones -(@ENTRY,42772,-100,1,0,1,1), -- Dr Terrible's "Building a Better Flesh Giant" -(@ENTRY,42422,-50,1,0,1,1), -- Jotunheim Cage Key --- Other random stuff -(@ENTRY,33470,20,1,0,1,4), -- Frostweave Cloth -(@ENTRY,43851,20,1,0,1,1), -- Fur Clothing Scraps -(@ENTRY,43852,20,1,0,1,1), -- Thick Fur Clothing Scraps --- References for world drops -(@ENTRY,1,10,1,0,-35063,1), -- Northrend Grey Items -(@ENTRY,2,5,1,0,-35066,1), -- Northrend Green Items --- hatebook -(@ENTRY,45912,0.1,1,0,1,1); -- Book Glyph of Mastery (honestly screw that thing) diff --git a/sql/updates/world/2012_02_21_05_world_Gossip_SAI.sql b/sql/updates/world/2012_02_21_05_world_Gossip_SAI.sql deleted file mode 100644 index 1bdccae5c39..00000000000 --- a/sql/updates/world/2012_02_21_05_world_Gossip_SAI.sql +++ /dev/null @@ -1,39 +0,0 @@ --- SAI for Lothos Riftwaker -SET @ENTRY=14387; -UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE (`entryorguid`=@ENTRY AND `source_type`=0); -INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES -(@ENTRY,0,0,1,62,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Lothos Riftwaker - On Gossip Option select - close gossip'), -(@ENTRY,0,1,0,61,0,100,0,5750,0,0,0,62,409,0,0,0,0,0,7,0,0,0,1096,-467,-104.6,3.64,'Lothos Riftwaker - On Gossip Option select - teleport player'); - -DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (5750); -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(5750,0,0,'Teleport me to the Molten Core, Lothos.',1,1,0,0,0,0,''); -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup` IN (5750); -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(15,5750,0,0,0,8,7848,0,0,0,0,'','Show gossip option if player has quest 7848 completed'); - --- SAI for Zamael Lunthistle -SET @ENTRY=8436; -UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE (`entryorguid`=@ENTRY AND `source_type`=0); -INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES -(@ENTRY,0,0,1,62,0,100,0,1285,0,0,0,26,3377,0,0,0,0,0,7,0,0,0,0,0,0,0,'Zamael Lunthistle - On Gossip Option select - quest credit'), -(@ENTRY,0,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Zamael Lunthistle - On Gossip Option select - close gossip'); - -DELETE FROM `gossip_menu` WHERE `entry`=1285 AND `text_id`=1920; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (1285,1920); -DELETE FROM `gossip_menu` WHERE `entry`=1286 AND `text_id`=1922; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (1286,1922); -DELETE FROM `gossip_menu` WHERE `entry`=1287 AND `text_id`=1921; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (1287,1921); - -DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (1285,1286,1287); -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(1285,0,0,'I wish to hear your tale.',1,1,1287,0,0,0,''), -(1286,0,0,'Let me think about it, Zamael.',1,1,1285,0,0,0,''), -(1287,0,0,'Please continue, Zamael.',1,1,1286,0,0,0,''); - -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup` IN (1285); -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(15,1285,0,0,0,9,3377,0,0,0,0,'','Show gossip option if player has quest 3377 but not complete'); diff --git a/sql/updates/world/2012_02_21_06_world_Gossip.sql b/sql/updates/world/2012_02_21_06_world_Gossip.sql deleted file mode 100644 index a59d330c6a3..00000000000 --- a/sql/updates/world/2012_02_21_06_world_Gossip.sql +++ /dev/null @@ -1,184 +0,0 @@ --- Gossip Update from Pitcrawler --- Creature Gossip_menu_id Update from sniff -UPDATE `creature_template` SET `gossip_menu_id`=7692 WHERE `entry`=18424; -UPDATE `creature_template` SET `gossip_menu_id`=9033 WHERE `entry`=24838; -UPDATE `creature_template` SET `gossip_menu_id`=9038 WHERE `entry`=24833; -UPDATE `creature_template` SET `gossip_menu_id`=9066 WHERE `entry`=25011; -UPDATE `creature_template` SET `gossip_menu_id`=9067 WHERE `entry`=25015; -UPDATE `creature_template` SET `gossip_menu_id`=9068 WHERE `entry`=25009; -UPDATE `creature_template` SET `gossip_menu_id`=9069 WHERE `entry`=25017; -UPDATE `creature_template` SET `gossip_menu_id`=9070 WHERE `entry`=25018; -UPDATE `creature_template` SET `gossip_menu_id`=9071 WHERE `entry`=25016; -UPDATE `creature_template` SET `gossip_menu_id`=9072 WHERE `entry` IN (25013,25014); -UPDATE `creature_template` SET `gossip_menu_id`=9091 WHERE `entry`=25076; -UPDATE `creature_template` SET `gossip_menu_id`=9107 WHERE `entry`=24929; -UPDATE `creature_template` SET `gossip_menu_id`=9109 WHERE `entry`=24927; -UPDATE `creature_template` SET `gossip_menu_id`=9110 WHERE `entry`=24924; -UPDATE `creature_template` SET `gossip_menu_id`=9116 WHERE `entry`=25105; -UPDATE `creature_template` SET `gossip_menu_id`=9117 WHERE `entry`=25100; -UPDATE `creature_template` SET `gossip_menu_id`=9118 WHERE `entry`=25104; -UPDATE `creature_template` SET `gossip_menu_id`=9120 WHERE `entry`=25107; -UPDATE `creature_template` SET `gossip_menu_id`=9121 WHERE `entry` IN (25101,25102,25103); -UPDATE `creature_template` SET `gossip_menu_id`=9122 WHERE `entry`=25106; -UPDATE `creature_template` SET `gossip_menu_id`=9349 WHERE `entry`=26539; -UPDATE `creature_template` SET `gossip_menu_id`=10120 WHERE `entry` IN (31704,31705,31706,31720,31723,31724); -UPDATE `creature_template` SET `gossip_menu_id`=10259 WHERE `entry`=31716; - --- Gossip Menu insert from sniff -DELETE FROM `gossip_menu` WHERE `entry`=7692 AND `text_id`=9383; -DELETE FROM `gossip_menu` WHERE `entry`=7696 AND `text_id`=9444; -DELETE FROM `gossip_menu` WHERE `entry`=7704 AND `text_id`=9425; -DELETE FROM `gossip_menu` WHERE `entry`=7726 AND `text_id`=9437; -DELETE FROM `gossip_menu` WHERE `entry`=7727 AND `text_id`=9438; -DELETE FROM `gossip_menu` WHERE `entry`=7728 AND `text_id`=9439; -DELETE FROM `gossip_menu` WHERE `entry`=9033 AND `text_id`=12211; -DELETE FROM `gossip_menu` WHERE `entry`=9038 AND `text_id`=12216; -DELETE FROM `gossip_menu` WHERE `entry`=9040 AND `text_id`=12217; -DELETE FROM `gossip_menu` WHERE `entry`=9041 AND `text_id`=12218; -DELETE FROM `gossip_menu` WHERE `entry`=9042 AND `text_id`=12219; -DELETE FROM `gossip_menu` WHERE `entry`=9043 AND `text_id`=12220; -DELETE FROM `gossip_menu` WHERE `entry`=9066 AND `text_id`=12262; -DELETE FROM `gossip_menu` WHERE `entry`=9067 AND `text_id`=12263; -DELETE FROM `gossip_menu` WHERE `entry`=9068 AND `text_id`=12264; -DELETE FROM `gossip_menu` WHERE `entry`=9069 AND `text_id`=12266; -DELETE FROM `gossip_menu` WHERE `entry`=9070 AND `text_id`=12267; -DELETE FROM `gossip_menu` WHERE `entry`=9091 AND `text_id`=12292; -DELETE FROM `gossip_menu` WHERE `entry`=9109 AND `text_id`=12317; -DELETE FROM `gossip_menu` WHERE `entry`=9110 AND `text_id`=12318; -DELETE FROM `gossip_menu` WHERE `entry`=9116 AND `text_id`=12327; -DELETE FROM `gossip_menu` WHERE `entry`=9117 AND `text_id`=12328; -DELETE FROM `gossip_menu` WHERE `entry`=9118 AND `text_id`=12329; -DELETE FROM `gossip_menu` WHERE `entry`=9120 AND `text_id`=12331; -DELETE FROM `gossip_menu` WHERE `entry`=9121 AND `text_id`=12332; -DELETE FROM `gossip_menu` WHERE `entry`=9122 AND `text_id`=12333; -DELETE FROM `gossip_menu` WHERE `entry`=9349 AND `text_id`=12649; -DELETE FROM `gossip_menu` WHERE `entry`=10120 AND `text_id`=14047; -DELETE FROM `gossip_menu` WHERE `entry`=10259 AND `text_id`=14248; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES -(7692,9383), -(7696,9444), -(7704,9425), -(7726,9437), -(7727,9438), -(7728,9439), -(9033,12211), -(9038,12216), -(9040,12217), -(9041,12218), -(9042,12219), -(9043,12220), -(9066,12262), -(9067,12263), -(9068,12264), -(9069,12266), -(9070,12267), -(9091,12292), -(9109,12317), -(9110,12318), -(9116,12327), -(9117,12328), -(9118,12329), -(9120,12331), -(9121,12332), -(9122,12333), -(9349,12649), -(10120,14047), -(10259,14248); - --- Insert npc_text from sniff -DELETE FROM `npc_text` WHERE `ID` IN (9437,9438,9439,12211,12266); -INSERT INTO `npc_text` (`ID`,`text0_0`,`text0_1`,`lang0`,`prob0`,`em0_0`,`em0_1`,`em0_2`,`em0_3`,`em0_4`,`em0_5`,`text1_0`,`text1_1`,`lang1`,`prob1`,`em1_0`,`em1_1`,`em1_2`,`em1_3`,`em1_4`,`em1_5`,`text2_0`,`text2_1`,`lang2`,`prob2`,`em2_0`,`em2_1`,`em2_2`,`em2_3`,`em2_4`,`em2_5`,`text3_0`,`text3_1`,`lang3`,`prob3`,`em3_0`,`em3_1`,`em3_2`,`em3_3`,`em3_4`,`em3_5`,`text4_0`,`text4_1`,`lang4`,`prob4`,`em4_0`,`em4_1`,`em4_2`,`em4_3`,`em4_4`,`em4_5`,`text5_0`,`text5_1`,`lang5`,`prob5`,`em5_0`,`em5_1`,`em5_2`,`em5_3`,`em5_4`,`em5_5`,`text6_0`,`text6_1`,`lang6`,`prob6`,`em6_0`,`em6_1`,`em6_2`,`em6_3`,`em6_4`,`em6_5`,`text7_0`,`text7_1`,`lang7`,`prob7`,`em7_0`,`em7_1`,`em7_2`,`em7_3`,`em7_4`,`em7_5`,`WDBVerified`) VALUES -(9437,'$B$BZangarmarsh... too close to truth.$B$B$B$BIs he still watching!?','',0,1,1000,1,1000,6,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,12340), -(9438,'What''s that? Zangarmarsh? Why would I want to go there?$B$B$B$BYes, Zangarmarsh... we... the druids there are getting close to figuring out why the water level is dropping. It''s destroying everything!$B$B$B$BDestroyed us all! Bright light! BOOM!!','',0,1,0,6,1000,1,1000,5,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,12340), -(9439,'The Firewing blood elves... for some reason they want to stop us.$B$B$B$BThey... they sent one of the Broken as ... as an emissary.... But he had a bomb!$B$BThey died, they all died! They tried to run away! The lucky ones didn''t even know.$B$BI must have been at the edge of the blast. It was horr...IT''S WATCHING US AGAIN!$B$B','',0,1,0,18,1000,18,1000,5,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,12340), -(12211,'Fine day fer sailin'', innit?','',7,1,0,1,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,12340), -(12266,'','I''m almost jealous of our Mr. Wavesinger. Why, he may well be prettier than me!',7,1,0,1,3,11,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,12340); - --- Creature Gossip_menu_option insert from sniff -DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (7692,7726,7727) AND `id`=0; -DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (9038,9040,9041,9042,9043) AND `id` IN (0,1,2); -DELETE FROM `gossip_menu_option` WHERE `menu_id`=9038 AND `id`=3; -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(7692,0,0,'Treelos, I know that the truth is somewhere inside you. Tell me what it is.',1,1,7726,0,0,0,''), -(7726,0,0,'Keep it together man! What about Zangarmarsh?',1,1,7727,0,0,0,''), -(7727,0,0,'I don''t have time for this! Warden, what happened?!',1,1,7728,0,0,0,''), -(9038,0,0,'The Lady Mehley',1,1,9040,0,0,0,''), -(9038,1,0,'Food & Drink',1,1,9041,0,0,0,''), -(9038,2,0,'Goods & Gear',1,1,9042,0,0,0,''), -(9038,3,0,'"Stash?"',1,1,9043,0,0,0,''), -(9040,0,0,'Food & Drink',1,1,9041,0,0,0,''), -(9040,1,0,'Goods & Gear',1,1,9042,0,0,0,''), -(9040,2,0,'"Stash?',1,1,9043,0,0,0,''), -(9041,0,0,'The Lady Mehley',1,1,9040,0,0,0,''), -(9041,1,0,'Goods & Gear',1,1,9042,0,0,0,''), -(9041,2,0,'"Stash?',1,1,9043,0,0,0,''), -(9042,0,0,'The Lady Mehley',1,1,9040,0,0,0,''), -(9042,1,0,'Food & Drink',1,1,9041,0,0,0,''), -(9042,2,0,'"Stash?',1,1,9043,0,0,0,''), -(9043,0,0,'The Lady Mehley',1,1,9040,0,0,0,''), -(9043,1,0,'Food & Drink',1,1,9041,0,0,0,''), -(9043,2,0,'Goods & Gear',1,1,9042,0,0,0,''); - --- Conditions -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=7704 AND `SourceEntry`=9425; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=7696 AND `SourceEntry`=9444; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup` IN (7704,7692); -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(14,7696,9444,0,0,8,10005,0,0,0,0,'','Show different gossip if player has rewarded quest 10005'), -(14,7696,9444,0,1,8,10006,0,0,0,0,'','Show different gossip if player has rewarded quest 10006'), -(14,7704,9425,0,0,8,9978,0,0,0,0,'','Show different gossip if player has rewarded quest 9978'), -(15,7704,0,0,0,9,9978,0,0,0,0,'','Show gossip option if player has quest 9978 but not complete'), -(15,7692,0,0,0,8,10006,0,0,0,0,'','Show gossip option if player has rewarded quest 10006'), -(15,7692,0,0,1,8,10005,0,0,0,0,'','Show gossip option if player has rewarded quest 10005'); - --- Gossip Update from Malcrom -DELETE FROM `gossip_menu` WHERE `entry` IN (1042,1043,1044,1045,1046,1047,1048,1049,1050,1052,1053); -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES -(1042,1635),(1043,1640),(1044,1644),(1045,1643),(1045,1753), -(1046,1648),(1047,1754),(1048,1650),(1049,1755), -(1050,1651),(1050,1756),(1052,1652),(1053,1653); -DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (1045,1047,1049,1050); -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(1045,0,0,'Acquire Higher Level Access Card',1,1,0,0,0,0,''), -(1047,0,0,'Acquire Higher Level Access Card',1,1,0,0,0,0,''), -(1049,0,0,'Acquire Higher Level Access Card',1,1,0,0,0,0,''), -(1050,0,0,'Acquire high level data card.',1,1,0,0,0,0,''); - -DELETE FROM `gossip_menu` WHERE `entry`=1080 AND `text_id`=1693; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (1080,1693); -DELETE FROM `gossip_menu` WHERE `entry`=1100 AND `text_id`=1713; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (1100,1713); -DELETE FROM `gossip_menu` WHERE `entry`=1143 AND `text_id`=1759; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (1143,1759); -DELETE FROM `gossip_menu` WHERE `entry`=1161 AND `text_id`=1793; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (1161,1793); -DELETE FROM `gossip_menu` WHERE `entry`=1162 AND `text_id`=1794; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (1162,1794); -DELETE FROM `gossip_menu` WHERE `entry`=1201 AND `text_id`=1833; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (1201,1833); -DELETE FROM `gossip_menu` WHERE `entry`=1281 AND `text_id`=1916; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (1281,1916); -DELETE FROM `gossip_menu` WHERE `entry`=1282 AND `text_id`=1918; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (1282,1918); - -DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (1282); -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(1282,0,0,'Touch the Suntara stone and call forth Lathoric the Black and his guardian, Obsidion.',1,1,0,0,0,0,''); - -DELETE FROM `gossip_menu` WHERE `entry`=1301 AND `text_id`=1933; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (1301,1933); -DELETE FROM `gossip_menu` WHERE `entry`=1301 AND `text_id`=1934; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (1301,1934); - -DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (1301); -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(1301,0,0,'I wish to browse your wares.',3,128,0,0,0,0,''); - -DELETE FROM `gossip_menu` WHERE `entry`=1302 AND `text_id`=1935; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (1302,1935); -DELETE FROM `gossip_menu` WHERE `entry`=1321 AND `text_id`=1955; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (1321,1955); -DELETE FROM `gossip_menu` WHERE `entry`=1322 AND `text_id`=1954; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (1322,1954); -DELETE FROM `gossip_menu` WHERE `entry`=1362 AND `text_id`=1994; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (1362,1994); diff --git a/sql/updates/world/2012_02_22_00_world_SAI.sql b/sql/updates/world/2012_02_22_00_world_SAI.sql deleted file mode 100644 index 2e392f3a45f..00000000000 --- a/sql/updates/world/2012_02_22_00_world_SAI.sql +++ /dev/null @@ -1,39 +0,0 @@ --- SAI for Kalaran Windblade -SET @ENTRY=8479; -UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY; -DELETE FROM `smart_scripts` WHERE (`entryorguid`=@ENTRY AND `source_type`=0); -DELETE FROM `smart_scripts` WHERE (`entryorguid`=@ENTRY*100 AND `source_type`=9); -INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES --- AI -(@ENTRY,0,0,1,62,0,100,0,1321,0,0,0,26,3441,0,0,0,0,0,7,0,0,0,0,0,0,0,'Kalaran Windblade - On Gossip Option select - quest credit'), -(@ENTRY,0,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Kalaran Windblade - On Gossip Option select - close gossip'), -(@ENTRY,0,2,3,62,0,100,0,1323,2,0,0,11,19797,0,0,0,0,0,7,0,0,0,0,0,0,0,'Kalaran Windblade - On Gossip Option select - cast 19797'), -(@ENTRY,0,3,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Kalaran Windblade - On Gossip Option select - close gossip'), -(@ENTRY,0,4,0,62,0,100,0,1323,3,0,0,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Kalaran Windblade - On Gossip Option select - run script'), --- Script -(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Kalaran Windblade - script - close gossip'), -(@ENTRY*100,9,1,0,0,0,100,0,0,0,0,0,83,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Kalaran Windblade - script - remove npc flags'), -(@ENTRY*100,9,2,0,0,0,100,0,1000,1000,1000,1000,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Kalaran Windblade - script - say 0'), -(@ENTRY*100,9,3,0,0,0,100,0,1000,1000,1000,1000,17,69,0,0,0,0,0,1,0,0,0,0,0,0,0,'Kalaran Windblade - script - emotestate usestanding'), -(@ENTRY*100,9,4,0,0,0,100,0,60000,60000,60000,60000,17,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Kalaran Windblade - script - emotestate none'), -(@ENTRY*100,9,5,0,0,0,100,0,1000,1000,1000,1000,26,3453,0,0,0,0,0,7,0,0,0,0,0,0,0,'Kalaran Windblade - script - give quest credit'), -(@ENTRY*100,9,6,0,0,0,100,0,1000,1000,1000,1000,82,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Kalaran Windblade - script - add npc flags'); --- npc text -DELETE FROM `creature_text` WHERE `entry`=@ENTRY; -INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES -(@ENTRY,0,0,'Please be patient, $N',12,0,100,0,0,0,'Kalaran Windblade'); --- Gossip options -DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (1321,1322,1323); -INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES -(1321,0,0,'Let me confer with my colleagues.',1,1,0,0,0,0,''), -(1322,0,0,'Continue please.',1,1,1321,0,0,0,''), -(1323,0,0,'Tell me what drives this vengeance?',1,1,1322,0,0,0,''), -(1323,2,0,'Kalaran, I have misplaced my torch. I require another.',1,1,0,0,0,0,''), -(1323,3,0,'Kalaran, please enchant the torch.',1,1,0,0,0,0,''); --- Gossip option conditions -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup` IN (1323); -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES -(15,1323,0,0,0,9,3441,0,0,0,0,'','Show gossip option if player has quest 3441 but not complete'), -(15,1323,2,0,0,8,3454,0,0,0,0,'','Show gossip option if player has quest 3441 complete'), -(15,1323,2,0,0,2,10515,0,1,0,0,'','Show gossip option if player does not have item 10515'), -(15,1323,3,0,0,9,3453,0,0,0,0,'','Show gossip option if player has quest 3453 but not complete'); diff --git a/sql/updates/world/2012_02_22_01_world_say_text.sql b/sql/updates/world/2012_02_22_01_world_say_text.sql deleted file mode 100644 index 035962e11c3..00000000000 --- a/sql/updates/world/2012_02_22_01_world_say_text.sql +++ /dev/null @@ -1,34 +0,0 @@ --- Invisible Stalker text for Wintergrasp from sniff -DELETE FROM `creature_text` WHERE `entry`=15214; -INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES -(15214,0,0, 'Let the battle begin!',41,0,100,0,0,0, 'Invisible Stalker'), -(15214,1,0, 'The Broken Temple siege workshop has been attacked by the Horde!',41,0,100,0,0,0, 'Invisible Stalker'), -(15214,2,0, 'The Broken Temple siege workshop has been captured by the Horde!',41,0,100,0,0,0, 'Invisible Stalker'), -(15214,3,0, 'The Broken Temple siege workshop has been attacked by the Alliance!',41,0,100,0,0,0, 'Invisible Stalker'), -(15214,4,0, 'The Broken Temple siege workshop has been captured by the Alliance!',41,0,100,0,0,0, 'Invisible Stalker'), -(15214,5,0, 'The Sunken Ring siege workshop has been attacked by the Horde!',41,0,100,0,0,0, 'Invisible Stalker'), -(15214,6,0, 'The Sunken Ring siege workshop has been captured by the Horde!',41,0,100,0,0,0, 'Invisible Stalker'), -(15214,7,0, 'The Sunken Ring siege workshop has been attacked by the Alliance!',41,0,100,0,0,0, 'Invisible Stalker'), -(15214,8,0, 'The Sunken Ring siege workshop has been captured by the Alliance!',41,0,100,0,0,0, 'Invisible Stalker'), -(15214,9,0, 'The Eastspark siege workshop has been attacked by the Horde!',41,0,100,0,0,0, 'Invisible Stalker'), -(15214,10,0, 'The Eastspark siege workshop has been captured by the Horde!',41,0,100,0,0,0, 'Invisible Stalker'), -(15214,11,0, 'The Eastspark siege workshop has been attacked by the Alliance!',41,0,100,0,0,0, 'Invisible Stalker'), -(15214,12,0, 'The Eastspark siege workshop has been captured by the Alliance!',41,0,100,0,0,0, 'Invisible Stalker'), -(15214,13,0, 'The Westspark siege workshop has been attacked by the Horde!',41,0,100,0,0,0, 'Invisible Stalker'), -(15214,14,0, 'The Westspark siege workshop has been captured by the Horde!',41,0,100,0,0,0, 'Invisible Stalker'), -(15214,15,0, 'The Westspark siege workshop has been attacked by the Alliance!',41,0,100,0,0,0, 'Invisible Stalker'), -(15214,16,0, 'The Westspark siege workshop has been captured by the Alliance!',41,0,100,0,0,0, 'Invisible Stalker'), -(15214,17,0, 'The north-western keep tower has been damaged!',41,0,100,0,0,0, 'Invisible Stalker'), -(15214,18,0, 'The north-western keep tower has been destroyed!',41,0,100,0,0,0, 'Invisible Stalker'), -(15214,19,0, 'The south-eastern keep tower has been damaged!',41,0,100,0,0,0, 'Invisible Stalker'), -(15214,20,0, 'The south-eastern keep tower has been destroyed!',41,0,100,0,0,0, 'Invisible Stalker'), -(15214,21,0, 'The western tower has been damaged!',41,0,100,0,0,0, 'Invisible Stalker'), -(15214,22,0, 'The western tower has been destroyed!',41,0,100,0,0,0, 'Invisible Stalker'), -(15214,23,0, 'The southern tower has been damaged!',41,0,100,0,0,0, 'Invisible Stalker'), -(15214,24,0, 'The southern tower has been destroyed!',41,0,100,0,0,0, 'Invisible Stalker'), -(15214,25,0, 'The eastern tower has been damaged!',41,0,100,0,0,0, 'Invisible Stalker'), -(15214,26,0, 'The eastern tower has been destroyed!',41,0,100,0,0,0, 'Invisible Stalker'), -(15214,27,0, 'The Horde has defended Wintergrasp Fortress!',41,0,100,0,0,0, 'Invisible Stalker'), -(15214,28,0, 'The Horde has captured Wintergrasp Fortress!',41,0,100,0,0,0, 'Invisible Stalker'), -(15214,29,0, 'The Alliance has defended Wintergrasp Fortress!',41,0,100,0,0,0, 'Invisible Stalker'), -(15214,30,0, 'The Alliance has captured Wintergrasp Fortress!',41,0,100,0,0,0, 'Invisible Stalker'); \ No newline at end of file diff --git a/sql/updates/world/2012_02_22_02_world_misc.sql b/sql/updates/world/2012_02_22_02_world_misc.sql deleted file mode 100644 index 33bec2a9b78..00000000000 --- a/sql/updates/world/2012_02_22_02_world_misc.sql +++ /dev/null @@ -1,57 +0,0 @@ --- Mounting Hodir's Helm (12987) - --- cleanup after Discovered --- clean all related to npc Hodir's Helm KC Bunny -DELETE FROM `smart_scripts` WHERE `entryorguid`=30210 AND `source_type`=0; -DELETE FROM `creature` WHERE `id`=30210; -DELETE FROM `creature_text` WHERE `entry`=30210; - -SET @HELM := 192080; -- Hodir's Helm -SET @TEMP := 300230; -- TEMP Northern Ice Spike -SET @BUNNY_TARGET := 30215; -- Ice Spike Target Bunny -SET @GUID_GO := 270; -- set by TDB -SET @GUID_NPC := 40514; -- set by TDB -SET @SPELL_READ_PRONOUNCEMENT := 56278; -SET @QUEST := 12987; -SET @AREA := 4438; -- Dun Niffelem -SET @SPELL_AREA := 56305; -- See Quest Invisibility 1 (Ice Spike Bunny) -SET @QUEST := 13006; -- Polishing the Helm - -UPDATE `creature_template` SET `unit_flags`=`unit_flags`|33554432|256,`InhabitType`=7,`flags_extra`=`flags_extra`|128 WHERE `entry`=@BUNNY_TARGET; - -UPDATE `gameobject_template` SET `flags`=`flags`|32 WHERE `entry`=@HELM; -UPDATE `gameobject` SET `phaseMask`=4 WHERE `id`=@TEMP; - -DELETE FROM `gameobject` WHERE `guid`=@GUID_GO; -INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES -(@GUID_GO,@HELM,571,1,4,7390.143,-2725.382,874.2561,-3.089183,0,0,-0.9996567,0.02620165,600,255,1); - -DELETE FROM `creature` WHERE `guid` BETWEEN @GUID_NPC+0 AND @GUID_NPC+1; -INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES -(@GUID_NPC+0,@BUNNY_TARGET,571,1,4,0,0,7386.51,-2726.489,872.5089,5.88176,300,0,0,4979,0,0,0,0,0), -(@GUID_NPC+1,@BUNNY_TARGET,571,1,4,0,0,7388.424,-2724.909,869.8643,0.5934119,300,0,0,4979,0,0,0,0,0); - -DELETE FROM `creature_template_addon` WHERE `entry`=@BUNNY_TARGET; -INSERT INTO `creature_template_addon` (`entry`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES -(@BUNNY_TARGET,0,0,65536,1,0, '61333 56304 61334'); -- Gigantic Helm Sparkle / Hodir's Helm Bunny: Invisibility / Extra Large Helm Sparkle - -DELETE FROM `spell_script_names` WHERE `spell_id`=@SPELL_READ_PRONOUNCEMENT; -INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES -(@SPELL_READ_PRONOUNCEMENT, 'spell_q12987_read_pronouncement'); - -DELETE FROM `spell_area` WHERE `spell`=@SPELL_AREA; -INSERT INTO `spell_area` (`spell`,`area`,`quest_start`,`quest_start_active`,`quest_end`,`aura_spell`,`racemask`,`gender`,`autocast`) VALUES -(@SPELL_AREA,@AREA,@QUEST,1,@QUEST,0,0,2,1); - --- relation for the daily quest that should be available after finishing Mounting Hodir's Helm - --- removing flag 4 or else player can't interract with Q giver -UPDATE `gameobject_template` SET `flags`=`flags`&~4 WHERE `entry`=@HELM; - -DELETE FROM `gameobject_questrelation` WHERE `id`=@HELM; -INSERT INTO `gameobject_questrelation` (`id`,`quest`) VALUES -(@HELM,@QUEST); - -DELETE FROM `gameobject_involvedrelation` WHERE `id`=@HELM; -INSERT INTO `gameobject_involvedrelation` (`id`,`quest`) VALUES -(@HELM,@QUEST); diff --git a/sql/updates/world/2012_02_22_03_world_conditions.sql b/sql/updates/world/2012_02_22_03_world_conditions.sql deleted file mode 100644 index 9c4d0cdec95..00000000000 --- a/sql/updates/world/2012_02_22_03_world_conditions.sql +++ /dev/null @@ -1,3 +0,0 @@ -UPDATE `conditions` SET `SourceTypeOrReferenceId`=13 WHERE `SourceTypeOrReferenceId`=17 AND `SourceGroup`=1; -UPDATE `conditions` SET `ConditionValue2`=1 WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=1323 AND `SourceEntry`=2 AND `ConditionTypeOrReference`=2; -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=1 AND `SourceGroup`=17465 AND `SourceEntry`=22554 AND `ConditionTypeOrReference`=7; diff --git a/sql/updates/world/2012_05_19_03_world_version.sql b/sql/updates/world/2012_05_19_03_world_version.sql new file mode 100644 index 00000000000..53c6821be69 --- /dev/null +++ b/sql/updates/world/2012_05_19_03_world_version.sql @@ -0,0 +1 @@ +UPDATE `version` SET `db_version`='TDB 335.11.47' LIMIT 1; diff --git a/sql/updates/world/2012_05_19_04_creature_loot_template.sql b/sql/updates/world/2012_05_19_04_creature_loot_template.sql new file mode 100644 index 00000000000..ae996e01956 --- /dev/null +++ b/sql/updates/world/2012_05_19_04_creature_loot_template.sql @@ -0,0 +1 @@ +DELETE FROM `creature_loot_template` WHERE `entry`=31813 AND `item`=36912; -- Saronite Ore diff --git a/sql/updates/world/2012_05_19_05_gameobject_loot_template.sql b/sql/updates/world/2012_05_19_05_gameobject_loot_template.sql new file mode 100644 index 00000000000..f95cb45efe4 --- /dev/null +++ b/sql/updates/world/2012_05_19_05_gameobject_loot_template.sql @@ -0,0 +1,93 @@ +-- Set Variables +SET @Gunship10N := 28057; -- Data1 for 201872 & 202177 +SET @Gunship10H := 28045; -- Data1 for 201873 & 202178 +SET @Gunship25N := 28072; -- Data1 for 201874 & 202179 +SET @Gunship25H := 28090; -- Data1 for 201875 & 202180 +SET @emblem := 49426; -- Emblem of Frost +SET @SfShard := 50274; -- Shadowfrost Shard +SET @PriSar := 49908; -- Primordial Saronite +-- Dug up the old references i created for UP34: +SET @Ref10J := 34329; +SET @Ref25J := 34251; +SET @RefJ10H := 34263; +SET @RefJ25H := 34275; +-- Gunship_Armory10N_reference +DELETE FROM `reference_loot_template` WHERE `entry` IN (@Ref10J,@Ref25J,@RefJ10H,@RefJ25H); +INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(@Ref10J,50791,0,1,1,1,1), -- Saronite Gargoyle Cloak +(@Ref10J,50795,0,1,1,1,1), -- Cord of Dark Suffering +(@Ref10J,50794,0,1,1,1,1), -- Neverending Winter +(@Ref10J,50787,0,1,1,1,1), -- Frost Giant's Cleaver +(@Ref10J,50793,0,1,1,1,1), -- Midnight Sun +(@Ref10J,50788,0,1,1,1,1), -- Bone Drake's Enameled Boots +(@Ref10J,50792,0,1,1,1,1), -- Pauldrons of Lost Hope +(@Ref10J,50340,0,1,1,1,1), -- Muradin's Spyglass +(@Ref10J,50797,0,1,1,1,1), -- Ice-Reinforced Vrykul Helm +(@Ref10J,50790,0,1,1,1,1), -- Abomination's Bloody Ring +(@Ref10J,50789,0,1,1,1,1), -- Icecrown Rampart Bracers +(@Ref10J,50796,0,1,1,1,1), -- Bracers of Pale Illumination +-- Gunship_Armory25N_reference +(@Ref25J,50011,0,1,1,1,1), -- Gunship Captain's Mittens +(@Ref25J,50002,0,1,1,1,1), -- Polar Bear Claw Bracers +(@Ref25J,50006,0,1,1,1,1), -- Corp'rethar Ceremonial Crown +(@Ref25J,50010,0,1,1,1,1), -- Waistband of Righteous Fury +(@Ref25J,50003,0,1,1,1,1), -- Boneguard Commander's Pauldrons +(@Ref25J,50000,0,1,1,1,1), -- Scourge Hunter's Vambraces +(@Ref25J,50359,0,1,1,1,1), -- Althor's Abacus +(@Ref25J,50352,0,1,1,1,1), -- Corpse Tongue Coin +(@Ref25J,49999,0,1,1,1,1), -- Skeleton Lord's Circle +(@Ref25J,50009,0,1,1,1,1), -- Boots of Unnatural Growth +(@Ref25J,50008,0,1,1,1,1), -- Ring of Rapid Ascent +(@Ref25J,49998,0,1,1,1,1), -- Shadowvault Slayer's Cloak +(@Ref25J,50005,0,1,1,1,1), -- Amulet of the Silent Eulogy +(@Ref25J,50411,0,1,1,1,1), -- Scourgeborne Waraxe +(@Ref25J,50001,0,1,1,1,1), -- Ikfirus's Sack of Wonder +-- Gunship_Armory10H_reference +(@RefJ10H,51912,0,1,1,1,1), -- Saronite Gargoyle Cloak (heroic) +(@RefJ10H,51908,0,1,1,1,1), -- Cord of Dark Suffering (heroic) +(@RefJ10H,51909,0,1,1,1,1), -- Neverending Winter (heroic) +(@RefJ10H,51916,0,1,1,1,1), -- Frost Giant's Cleaver (heroic) +(@RefJ10H,51910,0,1,1,1,1), -- Midnight Sun (heroic) +(@RefJ10H,51915,0,1,1,1,1), -- Bone Drake's Enameled Boots (heroic) +(@RefJ10H,51911,0,1,1,1,1), -- Pauldrons of Lost Hope (heroic) +(@RefJ10H,50345,0,1,1,1,1), -- Muradin's Spyglass (heroic) +(@RefJ10H,51906,0,1,1,1,1), -- Ice-Reinforced Vrykul Helm (heroic) +(@RefJ10H,51913,0,1,1,1,1), -- Abomination's Bloody Ring (heroic) +(@RefJ10H,51914,0,1,1,1,1), -- Icecrown Rampart Bracers (heroic) +(@RefJ10H,51907,0,1,1,1,1), -- Bracers of Pale Illumination (heroic) +-- Gunship_Armory25H_reference +(@RefJ25H,50663,0,1,1,1,1), -- Gunship Captain's Mittens (heroic) +(@RefJ25H,50659,0,1,1,1,1), -- Polar Bear Claw Bracers (heroic) +(@RefJ25H,50661,0,1,1,1,1), -- Corp'rethar Ceremonial Crown (heroic) +(@RefJ25H,50667,0,1,1,1,1), -- Waistband of Righteous Fury (heroic) +(@RefJ25H,50660,0,1,1,1,1), -- Boneguard Commander's Pauldrons (heroic) +(@RefJ25H,50655,0,1,1,1,1), -- Scourge Hunter's Vambraces (heroic) +(@RefJ25H,50366,0,1,1,1,1), -- Althor's Abacus (heroic) +(@RefJ25H,50349,0,1,1,1,1), -- Corpse Tongue Coin (heroic) +(@RefJ25H,50657,0,1,1,1,1), -- Skeleton Lord's Circle (heroic) +(@RefJ25H,50665,0,1,1,1,1), -- Boots of Unnatural Growth (heroic) +(@RefJ25H,50664,0,1,1,1,1), -- Ring of Rapid Ascent (heroic) +(@RefJ25H,50653,0,1,1,1,1), -- Shadowvault Slayer's Cloak (heroic) +(@RefJ25H,50658,0,1,1,1,1), -- Amulet of the Silent Eulogy (heroic) +(@RefJ25H,50654,0,1,1,1,1), -- Scourgeborne Waraxe (heroic) +(@RefJ25H,50656,0,1,1,1,1); -- Ikfirus's Sack of Wonder (heroic) +-- Bind the refs to the objects +DELETE FROM `gameobject_loot_template` WHERE `entry` IN (@Gunship10N,@Gunship10H,@Gunship25N,@Gunship25H); +INSERT INTO `gameobject_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- Gunship10N +(@Gunship10N,@emblem,100,1,0,2,2), -- Gunship Armory 2xemblems 10N +(@Gunship10N,1,100,1,0,-@Ref10J,2), -- 2 from reference 10Normal +-- Gunship25N +(@Gunship25N,@emblem,100,1,0,2,2), -- Gunship Armory 2xemblems 25N +(@Gunship25N,1,100,1,0,-@Ref25J,2), -- 3 from reference 25Normal +(@Gunship25N,@SfShard,-35,1,0,1,1), -- Shadowfrost Shard @ 38% chance +(@Gunship25N,@PriSar,38,1,0,1,1), -- Primordial Saronite @ 10% chance +-- Gunship10H +(@Gunship10H,@emblem,100,1,0,2,2), -- Gunship Armory 2xemblems 10H +(@Gunship10H,1,100,1,0,-@RefJ10H,2), -- 2 from reference 10Heroic +(@Gunship10H,@PriSar,38,1,0,1,1), -- Primordial Saronite @ 38% chance +-- Gunship25H +(@Gunship25H,@emblem,100,1,0,2,2), -- Gunship Armory 2xemblems 25H +(@Gunship25H,1,100,1,0,-@RefJ25H,2), -- 3 from reference 25Heroic +(@Gunship25H,@SfShard,-75,1,0,1,1), -- Shadowfrost Shard @ 75% chance +(@Gunship25H,@PriSar,50,1,0,1,1); -- Primordial Saronite @ 50% chance diff --git a/sql/updates/world/2012_05_19_06_gameobject_loot_template.sql b/sql/updates/world/2012_05_19_06_gameobject_loot_template.sql new file mode 100644 index 00000000000..9b2dcbb9363 --- /dev/null +++ b/sql/updates/world/2012_05_19_06_gameobject_loot_template.sql @@ -0,0 +1,13 @@ +DELETE FROM `reference_loot_template` WHERE `entry`=34172; +DELETE FROM `creature_loot_template` WHERE `entry`=38013; +DELETE FROM `gameobject_loot_template` WHERE `entry`=28683; +INSERT INTO `gameobject_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(28683,35498,3,1,0,1,1), -- Formula: Enchant Weapon - Deathfrost +(28683,35557,28,1,0,1,2), -- Huge Snowball +(28683,35720,3,1,0,5,6), -- Lord of Frost's Private Label +(28683,35723,12,1,0,1,1), -- Shards of Ahune +(28683,54801,0,1,1,1,1), -- Icebound Cloak +(28683,54802,0,1,1,1,1), -- The Frost Lord's War Cloak +(28683,54803,0,1,1,1,1), -- The Frost Lord's Battle Shroud +(28683,54804,0,1,1,1,1), -- Shroud of Winter's Chill +(28683,54805,0,1,1,1,1); -- Cloak of the Frigid Winds diff --git a/sql/updates/world/2012_05_20_00_world_misc.sql b/sql/updates/world/2012_05_20_00_world_misc.sql new file mode 100644 index 00000000000..5b96f9881d6 --- /dev/null +++ b/sql/updates/world/2012_05_20_00_world_misc.sql @@ -0,0 +1,16 @@ +-- Update mod rep command name +UPDATE `command` SET + `name` = 'modify reputation', + `help` = 'Syntax: .modify reputation #repId (#repvalue | $rankname [#delta])\nSets the selected players reputation with faction #repId to #repvalue or to $reprank.\nIf the reputation rank name is provided, the resulting reputation will be the lowest reputation for that rank plus the delta amount, if specified.\nYou can use \'.pinfo rep\' to list all known reputation ids, or use \'.lookup faction $name\' to locate a specific faction id.' +WHERE `name` = 'modify rep'; + +-- Fix "2012-05-20 06:46:00 ERROR: SourceEntry 52264 in `condition` table, has incorrect SourceGroup 0 (spell effectMask) set , ignoring." +UPDATE `conditions` SET + `SourceGroup` = 1, + `SourceId` = 0 +WHERE + `SourceTypeOrReferenceId` = 13 AND + `SourceEntry` = 52264 AND + `ConditionTypeOrReference` = 29 AND + `ConditionValue1` = 28653 AND + `ConditionValue2` = 5; diff --git a/sql/updates/world/2012_05_20_01_world_spell_bonus_data.sql b/sql/updates/world/2012_05_20_01_world_spell_bonus_data.sql new file mode 100644 index 00000000000..7603f7dd938 --- /dev/null +++ b/sql/updates/world/2012_05_20_01_world_spell_bonus_data.sql @@ -0,0 +1,2 @@ +DELETE FROM `spell_bonus_data` WHERE `entry`=633; +INSERT INTO `spell_bonus_data` (`entry`,`comments`) VALUES (633,'Paladin - Lay on Hands'); diff --git a/sql/updates/world/2012_05_22_00_world_spell_proc_event.sql b/sql/updates/world/2012_05_22_00_world_spell_proc_event.sql new file mode 100644 index 00000000000..ba2ea83f643 --- /dev/null +++ b/sql/updates/world/2012_05_22_00_world_spell_proc_event.sql @@ -0,0 +1 @@ +UPDATE `spell_proc_event` SET `procFlags` = 332116 WHERE `entry` = 63611; diff --git a/sql/updates/world/2012_05_22_01_world_creature_loot_template.sql b/sql/updates/world/2012_05_22_01_world_creature_loot_template.sql new file mode 100644 index 00000000000..bcae5be9ae1 --- /dev/null +++ b/sql/updates/world/2012_05_22_01_world_creature_loot_template.sql @@ -0,0 +1,2 @@ +-- As of patch 3.1.0, the drop rate of Formula: Enchant Boots - Surefooted has been increased to Guaranteed (100%). +UPDATE `creature_loot_template` SET `ChanceOrQuestChance`=100 WHERE `entry`=16472 and `item`=22545; diff --git a/sql/updates/world/2012_05_23_00_world_creature.sql b/sql/updates/world/2012_05_23_00_world_creature.sql new file mode 100644 index 00000000000..8a965b7fdfe --- /dev/null +++ b/sql/updates/world/2012_05_23_00_world_creature.sql @@ -0,0 +1,55 @@ +-- Chicken Spawns from sniff: +SET @Chicken := 28161; +SET @CGUID := 88570; +DELETE FROM `creature` WHERE `id`=@Chicken; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`MovementType`) VALUES +(@CGUID,@Chicken,571,1,1,5199.809,4704.83,-128.2989,1.70125,120,0,0), -- Chicken Escapee +(@CGUID+1,@Chicken,571,1,1,5201.715,4702.484,-127.8371,1.53589,120,0,0), -- Chicken Escapee +(@CGUID+2,@Chicken,571,1,1,5198.132,4702.78,-127.5534,1.797689,120,0,0), -- Chicken Escapee +(@CGUID+3,@Chicken,571,1,1,5198.32,4704.375,-127.9992,1.064651,120,0,0), -- Chicken Escapee +(@CGUID+4,@Chicken,571,1,1,5201.744,4704.674,-128.4752,4.555309,120,0,0), -- Chicken Escapee +(@CGUID+5,@Chicken,571,1,1,5251.442,4508.976,-85.30431,4.304774,120,0,0), -- Chicken Escapee +(@CGUID+6,@Chicken,571,1,1,5251.708,4511.778,-85.32935,1.64061,120,0,0), -- Chicken Escapee +(@CGUID+7,@Chicken,571,1,1,5251.118,4509.744,-85.32935,4.886922,120,0,0), -- Chicken Escapee +(@CGUID+8,@Chicken,571,1,1,5252.795,4509.772,-85.32524,0.7853982,120,0,0), -- Chicken Escapee +(@CGUID+9,@Chicken,571,1,1,5253.682,4511.424,-85.32755,2.356194,120,0,0), -- Chicken Escapee +(@CGUID+10,@Chicken,571,1,1,5254.174,4514.632,-84.96572,0.4096795,120,0,0), -- Chicken Escapee +(@CGUID+11,@Chicken,571,1,1,5252.096,4514.868,-85.32635,4.363323,120,0,0), -- Chicken Escapee +(@CGUID+12,@Chicken,571,1,1,5251.637,4513.41,-85.32935,3.490659,120,0,0), -- Chicken Escapee +(@CGUID+13,@Chicken,571,1,1,5253.287,4513.109,-85.32935,3.036873,120,0,0), -- Chicken Escapee +(@CGUID+14,@Chicken,571,1,1,5253.494,4514.764,-85.31329,3.717551,120,0,0), -- Chicken Escapee +(@CGUID+15,@Chicken,571,1,1,5251.158,4518.321,-85.3019,1.592369,120,0,0), -- Chicken Escapee +(@CGUID+16,@Chicken,571,1,1,5250.385,4516.643,-85.3257,5.044002,120,0,0), -- Chicken Escapee +(@CGUID+17,@Chicken,571,1,1,5251.159,4515.294,-85.32935,4.694936,120,0,0), -- Chicken Escapee +(@CGUID+18,@Chicken,571,1,1,5252.267,4516.414,-85.30904,0.5235988,120,0,0), -- Chicken Escapee +(@CGUID+19,@Chicken,571,1,1,5251.693,4517.859,-85.3243,4.590216,120,0,0), -- Chicken Escapee +(@CGUID+20,@Chicken,571,1,1,5262.68,4528.738,-84.4747,4.718389,120,0,0), -- Chicken Escapee +(@CGUID+21,@Chicken,571,1,1,5256.907,4480.617,-84.26879,4.927223,120,0,0), -- Chicken Escapee +(@CGUID+22,@Chicken,571,1,1,5298.603,4489.708,-93.65161,6.16371,120,0,0), -- Chicken Escapee +(@CGUID+23,@Chicken,571,1,1,5192.673,4513.661,-89.12463,1.299241,120,0,0), -- Chicken Escapee +(@CGUID+24,@Chicken,571,1,1,5228.781,4579.799,-96.98647,0.05766594,120,0,0), -- Chicken Escapee +(@CGUID+25,@Chicken,571,1,1,5230.247,4433.143,-96.82567,5.135688,120,0,0), -- Chicken Escapee +(@CGUID+26,@Chicken,571,1,1,5180.035,4541.38,-97.84879,0.2208638,120,0,0), -- Chicken Escapee +(@CGUID+27,@Chicken,571,1,1,5178.563,4538.964,-97.54511,0.9771074,120,0,0), -- Chicken Escapee +(@CGUID+28,@Chicken,571,1,1,5272.981,4417.033,-96.50356,0.9044432,120,0,0), -- Chicken Escapee +(@CGUID+29,@Chicken,571,1,1,5214.513,4416.202,-96.53072,2.862281,120,0,0), -- Chicken Escapee +(@CGUID+30,@Chicken,571,1,1,5160.117,4474.996,-96.96887,4.499754,120,0,0), -- Chicken Escapee +(@CGUID+31,@Chicken,571,1,1,5263.541,4409.121,-95.87889,1.570796,120,0,0), -- Chicken Escapee +(@CGUID+32,@Chicken,571,1,1,5234.166,4404.604,-95.12725,1.031549,120,0,0), -- Chicken Escapee +(@CGUID+33,@Chicken,571,1,1,5297.803,4493.681,-93.65161,5.525303,120,0,0), -- Chicken Escapee +(@CGUID+34,@Chicken,571,1,1,5260.112,4340.577,-97.61092,1.942801,120,0,0), -- Chicken Escapee +(@CGUID+35,@Chicken,571,1,1,5208.492,4379.111,-95.49483,0.6675518,120,0,0), -- Chicken Escapee +(@CGUID+36,@Chicken,571,1,1,5172.742,4368.674,-96.27965,0.8766832,120,0,0), -- Chicken Escapee +(@CGUID+37,@Chicken,571,1,1,5223.491,4467.19,-96.75621,4.723376,120,0,0), -- Chicken Escapee +(@CGUID+38,@Chicken,571,1,1,5220.966,4469.76,-96.75582,5.183968,120,0,0), -- Chicken Escapee +(@CGUID+39,@Chicken,571,1,1,5221.419,4473.14,-96.75536,4.98181,120,0,0), -- Chicken Escapee +(@CGUID+40,@Chicken,571,1,1,5221.419,4473.14,-96.75536,5.49084,120,0,0), -- Chicken Escapee +(@CGUID+41,@Chicken,571,1,1,5221.828,4470.711,-96.57594,5.315169,120,0,0), -- Chicken Escapee +(@CGUID+42,@Chicken,571,1,1,5151.083,4416.434,-96.38642,2.066685,120,0,0), -- Chicken Escapee +(@CGUID+43,@Chicken,571,1,1,5281.582,4425.185,-96.79945,4.45059,120,0,0), -- Chicken Escapee +(@CGUID+44,@Chicken,571,1,1,5257.173,4424.231,-95.62836,3.996804,120,0,0); -- Chicken Escapee + +-- Aura for Chicken Escapee (thx Discovered) +DELETE FROM `creature_template_addon` WHERE `entry`=28161; +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(28161,0,0,0,0,'50734'); -- Chicken Escapee - Frenzyheart Chicken: Invisibility diff --git a/sql/updates/world/2012_05_23_01_world_sai.sql b/sql/updates/world/2012_05_23_01_world_sai.sql new file mode 100644 index 00000000000..af2fd5409d1 --- /dev/null +++ b/sql/updates/world/2012_05_23_01_world_sai.sql @@ -0,0 +1,14 @@ +-- Delete all spawnings of Chicken Escapee via quest_start_scripts +DELETE FROM `quest_start_scripts` WHERE `command`=10 AND `datalong`=28161; + +-- Elder Harkek SAI +SET @ENTRY := 28138; +SET @SPELL_SEE_INVIS_CHICKEN := 50735; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,19,0,100,0,12532,0,0,0,85,@SPELL_SEE_INVIS_CHICKEN,2,0,0,0,0,7,0,0,0,0,0,0,0,"Elder Harkek - On Quest Accept - Invoker Cast Frenzyheart Chicken: See Invisibility"), +(@ENTRY,0,1,0,19,0,100,0,12702,0,0,0,85,@SPELL_SEE_INVIS_CHICKEN,2,0,0,0,0,7,0,0,0,0,0,0,0,"Elder Harkek - On Quest Accept - Invoker Cast Frenzyheart Chicken: See Invisibility"), +(@ENTRY,0,2,0,20,0,100,0,12532,0,0,0,28,@SPELL_SEE_INVIS_CHICKEN,0,0,0,0,0,7,0,0,0,0,0,0,0,"Elder Harkek - On Quest Complete - Remove Aura Frenzyheart Chicken: See Invisibility"), +(@ENTRY,0,3,0,20,0,100,0,12702,0,0,0,28,@SPELL_SEE_INVIS_CHICKEN,0,0,0,0,0,7,0,0,0,0,0,0,0,"Elder Harkek - On Quest Complete - Remove Aura Frenzyheart Chicken: See Invisibility"); diff --git a/sql/updates/world/2012_05_23_02_world_sai.sql b/sql/updates/world/2012_05_23_02_world_sai.sql new file mode 100644 index 00000000000..588f25f1568 --- /dev/null +++ b/sql/updates/world/2012_05_23_02_world_sai.sql @@ -0,0 +1,21 @@ +-- Chicken Escapee SAI +SET @ENTRY := 28161; +SET @SPELL_NET_CHICKEN := 51959; +SET @SPELL_INVIS_CHICKEN := 50734; +SET @SPELL_SCARED_CHICKEN := 51846; +SET @SPELL_CREATE_QUESTITEM := 51037; +UPDATE `creature` SET `MovementType`=0,`spawndist`=0,`spawntimesecs`=5 WHERE `id`=@ENTRY; +UPDATE `creature_template` SET `AIName`='SmartAI',`npcflag`=1 WHERE `entry`=@ENTRY; +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,1,8,0,100,0,@SPELL_NET_CHICKEN,0,0,0,28,@SPELL_SCARED_CHICKEN,0,0,0,0,0,1,0,0,0,0,0,0,0,"Chicken Escapee - On Spellhit - Remove Aura Scared Chicken"), +(@ENTRY,0,1,0,61,0,100,0,0,0,0,0,41,4000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Chicken Escapee - On Spellhit - Forced Despawn"), +(@ENTRY,0,2,3,64,0,100,0,0,0,0,0,85,@SPELL_CREATE_QUESTITEM,2,0,0,0,0,7,0,0,0,0,0,0,0,"Chicken Escapee - On Gossip Hello - Invoker Cast Capture Chicken Escapee"), -- Triggered because of cast-time +(@ENTRY,0,3,4,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,"Chicken Escapee - On Gossip Hello - Close Gossip"), +(@ENTRY,0,4,5,61,0,100,0,0,0,0,0,81,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Chicken Escapee - On Gossip Hello - Set Npcflag None"), +(@ENTRY,0,5,6,61,0,100,0,0,0,0,0,28,@SPELL_SCARED_CHICKEN,0,0,0,0,0,1,0,0,0,0,0,0,0,"Chicken Escapee - On Gossip Hello - Remove Aura Scared Chicken"), +(@ENTRY,0,6,0,61,0,100,0,0,0,0,0,41,500,0,0,0,0,0,1,0,0,0,0,0,0,0,"Chicken Escapee - On Gossip Hello - Forced Despawn"), +(@ENTRY,0,7,8,25,0,100,0,0,0,0,0,11,@SPELL_INVIS_CHICKEN,1,0,0,0,0,1,0,0,0,0,0,0,0,"Chicken Escapee - On Reset - Cast Frenzyheart Chicken: Invisibility"), -- Just in case +(@ENTRY,0,8,0,61,0,100,0,0,0,0,0,11,@SPELL_SCARED_CHICKEN,0,0,0,0,0,1,0,0,0,0,0,0,0,"Chicken Escapee - On Reset - Cast Scared Chicken"); diff --git a/sql/updates/world/2012_05_23_03_world_gameobject_loot_template.sql b/sql/updates/world/2012_05_23_03_world_gameobject_loot_template.sql new file mode 100644 index 00000000000..22ecebcae31 --- /dev/null +++ b/sql/updates/world/2012_05_23_03_world_gameobject_loot_template.sql @@ -0,0 +1,32 @@ +SET @entry := 35093; +SET @epic := 25009; +SET @gem := @entry+1; +-- Create references +DELETE FROM `reference_loot_template` WHERE `entry` IN(@entry,@epic,@gem); +INSERT INTO `reference_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES +(@entry,27452,0,1,1,1,1), -- Light Scribe Bands +(@entry,27453,0,1,1,1,1), -- Averinn's RIng of Slaying +(@entry,27454,0,1,1,1,1), -- Volcanic Pauldrons +(@entry,27455,0,1,1,1,1), -- Irondrake faceguard +(@entry,27456,0,1,1,1,1), -- Raiments of Nature's Breath +(@entry,27457,0,1,1,1,1), -- Life Bearer's Gauntlets +(@entry,27458,0,1,1,1,1), -- Oceansong Kilt +(@entry,27459,0,1,1,1,1), -- Vambraces of Daring +(@entry,27460,0,1,1,1,1), -- Reavers' Ring +(@entry,27461,0,1,1,1,1), -- Chestguard of the Prowler +-- Epics +(@epic,29238,0,1,1,1,1), -- Lion's Heart Girdle +(@epic,29264,0,1,1,1,1), -- Tree-Mender's Belt +(@epic,29346,0,1,1,1,1), -- Feltooth Eviscerator +(@epic,32077,0,1,1,1,1), -- Wrath Infused Gauntlets +-- Gems +(@gem,30592,0,1,1,1,1), -- Steady Chrysoprase +(@gem,30593,0,1,1,1,1), -- Potent Fire Opal +(@gem,30594,0,1,1,1,1); -- Regal Chrysoprase +-- Assign loot to the chest +SET @GOloot := 21764; -- lootid of Reinforced Fel Iron Chest Heroic +DELETE FROM `gameobject_loot_template` WHERE `entry`=@GOloot; +INSERT INTO `gameobject_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES +(@GOloot,1,100,1,0,-@entry, 2), -- one from gear +(@GOloot,2,30,1,0,-@gem,1), -- one gem (30%) +(@GOloot,3,100,1,0,-@epic,1); -- one from epics diff --git a/sql/updates/world/2012_05_23_04_world_gameobject.sql b/sql/updates/world/2012_05_23_04_world_gameobject.sql new file mode 100644 index 00000000000..afcb1e89317 --- /dev/null +++ b/sql/updates/world/2012_05_23_04_world_gameobject.sql @@ -0,0 +1,3 @@ +DELETE FROM `gameobject` WHERE `id`=188677; +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES +(318,188677,571,1,1,2567.449,-388.7118,3.573463,-2.879789,0,0,0.639778,0.76856,1200,100,1); diff --git a/sql/updates/world/2012_05_23_05_world_creature.sql b/sql/updates/world/2012_05_23_05_world_creature.sql new file mode 100644 index 00000000000..bb162f927bd --- /dev/null +++ b/sql/updates/world/2012_05_23_05_world_creature.sql @@ -0,0 +1,12 @@ +-- Spawn from Sniff +DELETE FROM `creature` WHERE `id`=34526; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES +(42161,34526,1,1,1,0,0,-1050.052,-286.7274,159.1137,5.951573,120,0,0,1,0,0,0,0,0); +-- Template updates +UPDATE `creature_template` SET `faction_A`=104,`faction_H`=104,`baseattacktime`=2000,`npcflag`=`npcflag`|3,`unit_flags`=`unit_flags`|512 WHERE `entry`=34526; -- Aponi Brightmane +-- Model data +UPDATE `creature_model_info` SET `bounding_radius`=1.003375,`combat_reach`=4.3125,`gender`=1 WHERE `modelid`=29249; -- Aponi Brightmane +-- Addon data +DELETE FROM `creature_template_addon` WHERE `entry`=34526; +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(34526,0,1,256,0,NULL); -- Aponi Brightmane diff --git a/sql/updates/world/2012_05_24_00_world_creature_misc.sql b/sql/updates/world/2012_05_24_00_world_creature_misc.sql new file mode 100644 index 00000000000..ae35b3fba5d --- /dev/null +++ b/sql/updates/world/2012_05_24_00_world_creature_misc.sql @@ -0,0 +1,5 @@ +UPDATE `creature_template` SET `faction_A`=1914,`faction_H`=1914,`unit_flags`=33024 WHERE `entry`=26452; + +DELETE FROM `creature_template_addon` WHERE `entry`=26452; +INSERT INTO `creature_template_addon` (`entry`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(26452,0,0,0,1,383,''); diff --git a/sql/updates/world/2012_05_24_01_world_gameobject.sql b/sql/updates/world/2012_05_24_01_world_gameobject.sql new file mode 100644 index 00000000000..32bbc15494f --- /dev/null +++ b/sql/updates/world/2012_05_24_01_world_gameobject.sql @@ -0,0 +1,3 @@ +DELETE FROM `gameobject` WHERE `id`=175759 AND `guid`=219; +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES +(219,175759,530,1,1,9636.439,-7231.265,16.73347,-2.82743,0,0,-0.9876881,0.1564362,900,100,1); diff --git a/sql/updates/world/2012_05_25_00_world_sai.sql b/sql/updates/world/2012_05_25_00_world_sai.sql new file mode 100644 index 00000000000..fa5682db02f --- /dev/null +++ b/sql/updates/world/2012_05_25_00_world_sai.sql @@ -0,0 +1,6 @@ +-- Eye of the Lich King SAI +SET @ENTRY := 36913; -- NPC entry +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,1,0,100,6,0,0,1000,1000,66,0,0,0,0,0,0,21,150,0,0,0,0,0,0, 'Eye of the Lich King - OOC - face closest player'); diff --git a/sql/updates/world/2012_05_25_01_world_waypoints.sql b/sql/updates/world/2012_05_25_01_world_waypoints.sql new file mode 100644 index 00000000000..0d2c04bc6bc --- /dev/null +++ b/sql/updates/world/2012_05_25_01_world_waypoints.sql @@ -0,0 +1,149 @@ +-- Bladewing Bloodletter InhabitType fix +UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry`=21033; + +-- Bladewing Bloodletter +SET @NPC := 73849; +SET @PATH := @NPC*10; +UPDATE `creature` SET `position_x`=1987.838,`position_y`=6153.995,`position_z`=146.4068,`spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUE +(@PATH,1,1987.838,6153.995,146.4068,0,0,0,100,0), +(@PATH,2,1981.592,6150.557,146.4068,0,0,0,100,0), +(@PATH,3,1966.573,6153.941,146.4068,0,0,0,100,0), +(@PATH,4,1953.747,6155.154,146.4068,0,0,0,100,0), +(@PATH,5,1941.287,6159.015,146.4068,0,0,0,100,0), +(@PATH,6,1937.986,6166.096,146.4068,0,0,0,100,0), +(@PATH,7,1948.558,6175.274,145.1566,0,0,0,100,0), +(@PATH,8,1959.44,6173.246,145.6567,0,0,0,100,0), +(@PATH,9,1971.408,6169.729,145.7679,0,0,0,100,0), +(@PATH,10,1986.747,6168.348,144.8511,0,0,0,100,0), +(@PATH,11,1998.881,6168.547,144.4066,0,0,0,100,0), +(@PATH,12,2008.877,6170.33,143.7955,0,0,0,100,0), +(@PATH,13,2021.965,6166.769,143.657,0,0,0,100,0), +(@PATH,14,2027.152,6158.083,145.4344,0,0,0,100,0), +(@PATH,15,2025.352,6149.427,146.4068,0,0,0,100,0), +(@PATH,16,2011.869,6150.37,146.4068,0,0,0,100,0), +(@PATH,17,1999.44,6155.886,146.4068,0,0,0,100,0); + +-- Bladewing Bloodletter +SET @NPC := 73850; +SET @PATH := @NPC*10; +UPDATE `creature` SET `position_x`=2099.588,`position_y`=6126.344,`position_z`=148.8029,`spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUE +(@PATH,1,2099.588,6126.344,148.8029,0,0,0,100,0), +(@PATH,2,2094.131,6133.031,148.303,0,0,0,100,0), +(@PATH,3,2085.703,6143.32,148.303,0,0,0,100,0), +(@PATH,4,2077.25,6154.094,148.5252,0,0,0,100,0), +(@PATH,5,2062.893,6175.25,146.414,0,0,0,100,0), +(@PATH,6,2056.135,6184.647,144.8307,0,0,0,100,0), +(@PATH,7,2050.784,6189.019,141.9417,0,0,0,100,0), +(@PATH,8,2044,6181.015,142.6362,0,0,0,100,0), +(@PATH,9,2044.303,6175.524,143.3028,0,0,0,100,0), +(@PATH,10,2053.432,6161.702,145.8306,0,0,0,100,0), +(@PATH,11,2064.378,6145.299,146.7471,0,0,0,100,0), +(@PATH,12,2064.748,6135.614,147.7195,0,0,0,100,0), +(@PATH,13,2067.337,6117.838,149.0529,0,0,0,100,0), +(@PATH,14,2073.338,6100.975,149.664,0,0,0,100,0), +(@PATH,15,2089.383,6099.217,149.3585,0,0,0,100,0), +(@PATH,16,2099.147,6111.964,149.1641,0,0,0,100,0); + +-- Bladewing Bloodletter +SET @NPC := 73852; +SET @PATH := @NPC*10; +UPDATE `creature` SET `position_x`=2180.795,`position_y`=6149.398,`position_z`=145.9554,`spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUE +(@PATH,1,2180.795,6149.398,145.9554,0,0,0,100,0), +(@PATH,2,2185.298,6157.3,146.8721,0,0,0,100,0), +(@PATH,3,2191.635,6164.935,146.6221,0,0,0,100,0), +(@PATH,4,2203.45,6168.873,146.2055,0,0,0,100,0), +(@PATH,5,2217.238,6165.062,145.6221,0,0,0,100,0), +(@PATH,6,2225.425,6159.092,145.1501,0,0,0,100,0), +(@PATH,7,2228.766,6146.569,145.3166,0,0,0,100,0), +(@PATH,8,2225.81,6129.76,143.9,0,0,0,100,0), +(@PATH,9,2203.906,6114.964,145.0111,0,0,0,100,0), +(@PATH,10,2184.713,6115.808,145.7333,0,0,0,100,0), +(@PATH,11,2173.165,6123,146.8721,0,0,0,100,0), +(@PATH,12,2175.542,6139.301,146.8721,0,0,0,100,0); + +-- Bladewing Bloodletter +SET @NPC := 73853; +SET @PATH := @NPC*10; +UPDATE `creature` SET `position_x`=2153.506,`position_y`=6119.981,`position_z`=148.0267,`spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUE +(@PATH,1,2153.506,6119.981,148.0267,0,0,0,100,0), +(@PATH,2,2144.238,6124.169,148.0267,0,0,0,100,0), +(@PATH,3,2133.341,6127.807,148.0267,0,0,0,100,0), +(@PATH,4,2120.865,6126.57,148.0267,0,0,0,100,0), +(@PATH,5,2110.276,6122.198,148.0267,0,0,0,100,0), +(@PATH,6,2108.702,6111.856,148.0267,0,0,0,100,0), +(@PATH,7,2113.887,6104.159,148.0267,0,0,0,100,0), +(@PATH,8,2123.298,6095.088,148.0267,0,0,0,100,0), +(@PATH,9,2136.37,6099.125,148.0267,0,0,0,100,0), +(@PATH,10,2146.343,6107.208,148.0267,0,0,0,100,0), +(@PATH,11,2150.752,6118.491,148.0267,0,0,0,100,0), +(@PATH,12,2158.115,6126.979,148.0267,0,0,0,100,0), +(@PATH,13,2168.949,6133.578,148.0267,0,0,0,100,0), +(@PATH,14,2180.009,6134.229,148.0267,0,0,0,100,0), +(@PATH,15,2189.201,6129.583,148.0267,0,0,0,100,0), +(@PATH,16,2192.429,6119.862,148.0267,0,0,0,100,0), +(@PATH,17,2187.044,6112.755,148.0267,0,0,0,100,0), +(@PATH,18,2176.445,6111.443,148.0267,0,0,0,100,0), +(@PATH,19,2166.243,6114.129,148.0267,0,0,0,100,0); + +-- Bladewing Bloodletter +SET @NPC := 73858; +SET @PATH := @NPC*10; +UPDATE `creature` SET `position_x`=2128.704,`position_y`=6018.743,`position_z`=141.9579,`spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUE +(@PATH,1,2128.704,6018.743,141.9579,0,0,0,100,0), +(@PATH,2,2118.804,6016.506,141.9433,0,0,0,100,0), +(@PATH,3,2100.692,6019.814,141.9433,0,0,0,100,0), +(@PATH,4,2080.599,6017.728,144.3877,0,0,0,100,0), +(@PATH,5,2070.564,6003.17,144.1802,0,0,0,100,0), +(@PATH,6,2079.148,5988.599,143.5968,0,0,0,100,0), +(@PATH,7,2088.214,5974.081,142.9579,0,0,0,100,0), +(@PATH,8,2102.427,5966.812,142.208,0,0,0,100,0), +(@PATH,9,2117.762,5969.647,141.9579,0,0,0,100,0), +(@PATH,10,2130.632,5977.25,141.9579,0,0,0,100,0), +(@PATH,11,2135.56,5993.264,141.9579,0,0,0,100,0), +(@PATH,12,2148.631,6003.11,141.1247,0,0,0,100,0), +(@PATH,13,2144.206,6017.48,141.9579,0,0,0,100,0); + +-- Bladewing Bloodletter +SET @NPC := 73860; +SET @PATH := @NPC*10; +UPDATE `creature` SET `position_x`=1951.455,`position_y`=5919.516,`position_z`=140.4673,`spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUE +(@PATH,1,1951.455,5919.516,140.4673,0,0,0,100,0), +(@PATH,2,1953.539,5912.287,140.4179,0,0,0,100,0), +(@PATH,3,1955.967,5902.248,140.4179,0,0,0,100,0), +(@PATH,4,1947.568,5889.415,140.4179,0,0,0,100,0), +(@PATH,5,1938.332,5877.63,140.4179,0,0,0,100,0), +(@PATH,6,1946.422,5859.488,140.4179,0,0,0,100,0), +(@PATH,7,1958.004,5850.275,140.4179,0,0,0,100,0), +(@PATH,8,1967.889,5861.601,140.4673,0,0,0,100,0), +(@PATH,9,1967.766,5874.843,140.4673,0,0,0,100,0), +(@PATH,10,1962.739,5881.181,140.4673,0,0,0,100,0), +(@PATH,11,1965.367,5889.64,140.4673,0,0,0,100,0), +(@PATH,12,1977.617,5904.389,140.4673,0,0,0,100,0), +(@PATH,13,1979.003,5918.971,140.4673,0,0,0,100,0), +(@PATH,14,1969.612,5933.128,140.4673,0,0,0,100,0), +(@PATH,15,1958.879,5940.208,140.4673,0,0,0,100,0), +(@PATH,16,1952.594,5927.489,140.4673,0,0,0,100,0); diff --git a/sql/updates/world/2012_05_25_02_world_creature_template.sql b/sql/updates/world/2012_05_25_02_world_creature_template.sql new file mode 100644 index 00000000000..fd4c1743f07 --- /dev/null +++ b/sql/updates/world/2012_05_25_02_world_creature_template.sql @@ -0,0 +1,2 @@ +-- Floating Flavor Eye InhabitType fix +UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry`=21659; diff --git a/sql/updates/world/2012_05_25_03_world_template.sql b/sql/updates/world/2012_05_25_03_world_template.sql new file mode 100644 index 00000000000..6ef112f342f --- /dev/null +++ b/sql/updates/world/2012_05_25_03_world_template.sql @@ -0,0 +1,8 @@ +-- Fix unit flags for Blackhand Incarcerator +UPDATE `creature_template` SET `unit_flags`=`unit_flags`|768 WHERE `entry`=10316; +-- Fix unit flags for Pyroguard Emberseer +UPDATE `creature_template` SET `unit_flags`=`unit_flags`|33554688 WHERE `entry`=9816; +-- Remove hack event script +DELETE FROM `event_scripts` WHERE `id`=4884; +-- Remove script to Dragonspire Hall Runes "UBRS" +UPDATE `gameobject_template` SET `ScriptName`= '' WHERE `entry` BETWEEN 175194 AND 175200; diff --git a/sql/updates/world/2012_05_26_00_world_scripts.sql b/sql/updates/world/2012_05_26_00_world_scripts.sql new file mode 100644 index 00000000000..18b0fa2f6b2 --- /dev/null +++ b/sql/updates/world/2012_05_26_00_world_scripts.sql @@ -0,0 +1,20 @@ +-- Correction for Obsidian Nullifier EAI +UPDATE `creature_ai_scripts` SET + `action1_param1` = 23 +WHERE `id` = 1531201; + +-- Correction for Wildspawn Felsworn and Wildspawn Hellcaller SAI +UPDATE `smart_scripts` SET + `event_phase_mask` = 2, + `action_type` = 22, + `action_param1` = 1, + `target_type` = 1 +WHERE + (`entryorguid` = 11457 AND + `source_type` = 0 AND + `id` = 10 AND + `link` = 0) OR + (`entryorguid` = 11455 AND + `source_type` = 0 AND + `id` = 11 AND + `link` = 0); diff --git a/sql/updates/world/2012_05_26_01_world_spell_dbc.sql b/sql/updates/world/2012_05_26_01_world_spell_dbc.sql new file mode 100644 index 00000000000..7efebc37489 --- /dev/null +++ b/sql/updates/world/2012_05_26_01_world_spell_dbc.sql @@ -0,0 +1,4 @@ +-- Fire Shield from 2.0.12 dbc +DELETE FROM `spell_dbc` WHERE `Id`=13377; +INSERT INTO `spell_dbc` (`Id`, `Dispel`, `Mechanic`, `Attributes`, `AttributesEx`, `AttributesEx2`, `AttributesEx3`, `AttributesEx4`, `AttributesEx5`, `AttributesEx6`, `AttributesEx7`, `Stances`, `StancesNot`, `Targets`, `CastingTimeIndex`, `AuraInterruptFlags`, `ProcFlags`, `ProcChance`, `ProcCharges`, `MaxLevel`, `BaseLevel`, `SpellLevel`, `DurationIndex`, `RangeIndex`, `StackAmount`, `EquippedItemClass`, `EquippedItemSubClassMask`, `EquippedItemInventoryTypeMask`, `Effect1`, `Effect2`, `Effect3`, `EffectDieSides1`, `EffectDieSides2`, `EffectDieSides3`, `EffectRealPointsPerLevel1`, `EffectRealPointsPerLevel2`, `EffectRealPointsPerLevel3`, `EffectBasePoints1`, `EffectBasePoints2`, `EffectBasePoints3`, `EffectMechanic1`, `EffectMechanic2`, `EffectMechanic3`, `EffectImplicitTargetA1`, `EffectImplicitTargetA2`, `EffectImplicitTargetA3`, `EffectImplicitTargetB1`, `EffectImplicitTargetB2`, `EffectImplicitTargetB3`, `EffectRadiusIndex1`, `EffectRadiusIndex2`, `EffectRadiusIndex3`, `EffectApplyAuraName1`, `EffectApplyAuraName2`, `EffectApplyAuraName3`, `EffectAmplitude1`, `EffectAmplitude2`, `EffectAmplitude3`, `EffectMultipleValue1`, `EffectMultipleValue2`, `EffectMultipleValue3`, `EffectMiscValue1`, `EffectMiscValue2`, `EffectMiscValue3`, `EffectMiscValueB1`, `EffectMiscValueB2`, `EffectMiscValueB3`, `EffectTriggerSpell1`, `EffectTriggerSpell2`, `EffectTriggerSpell3`, `EffectSpellClassMaskA1`, `EffectSpellClassMaskA2`, `EffectSpellClassMaskA3`, `EffectSpellClassMaskB1`, `EffectSpellClassMaskB2`, `EffectSpellClassMaskB3`, `EffectSpellClassMaskC1`, `EffectSpellClassMaskC2`, `EffectSpellClassMaskC3`, `MaxTargetLevel`, `SpellFamilyName`, `SpellFamilyFlags1`, `SpellFamilyFlags2`, `SpellFamilyFlags3`, `MaxAffectedTargets`, `DmgClass`, `PreventionType`, `DmgMultiplier1`, `DmgMultiplier2`, `DmgMultiplier3`, `AreaGroupId`, `SchoolMask`, `Comment`) VALUES +(13377, 1, 0, 2512, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 101, 0, 0, 40, 40, 21, 1, 0, -1, -1, 0, 6, 0, 0, 1, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, 3000, 0, 0, '0', '0', '0', 0, 0, 0, 0, 0, 0, 13376, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 2, 'Fire Shield'); diff --git a/sql/updates/world/2012_05_26_02_world_creature_template.sql b/sql/updates/world/2012_05_26_02_world_creature_template.sql new file mode 100644 index 00000000000..e51567390b7 --- /dev/null +++ b/sql/updates/world/2012_05_26_02_world_creature_template.sql @@ -0,0 +1,5 @@ +-- Training dummies +UPDATE `creature_template` SET + `flags_extra`=0x40000, /* NO_SKILLGAIN */ + `mechanic_immune_mask`=0x20|0x4000 /* GRIP|BLEED */ /* two of the templates already had bleed immunity, is that correct? */ +WHERE `ScriptName`='npc_training_dummy'; diff --git a/sql/updates/world/2012_05_26_03_world_page_text.sql b/sql/updates/world/2012_05_26_03_world_page_text.sql new file mode 100644 index 00000000000..9dc285cd99d --- /dev/null +++ b/sql/updates/world/2012_05_26_03_world_page_text.sql @@ -0,0 +1,4 @@ +-- First page of A Steamy Romance Novel: Northern Exposure +DELETE FROM `page_text` WHERE `entry`=3562; +INSERT INTO `page_text` (`entry`, `text`, `next_page`) VALUES +(3562, 'The tiny gnome peered over the railing into the secluded Dalaran courtyard.$B$B"The view from the balcony is amazing. You have to come see!"$B$BArmor legplates creaked as Marcus walked over, taking in a deep breath as he absently scratched his scruffy chin.$B$B"The Hero''s Welcome is no slouch. And there''s something in the room that might interest you."$B$BTavi bounded into the room, pausing only a moment before jumping onto the massive bed. She turned to gaze at Marcus with her huge saucer-like eyes, narrowing them playfully and replacing her glowing smile with a diabolical grin.', 3563); diff --git a/sql/updates/world/2012_05_26_04_world_creature_template.sql b/sql/updates/world/2012_05_26_04_world_creature_template.sql new file mode 100644 index 00000000000..911cd45ef8c --- /dev/null +++ b/sql/updates/world/2012_05_26_04_world_creature_template.sql @@ -0,0 +1,4 @@ +-- Training dummies +UPDATE `creature_template` SET + `mechanic_immune_mask` = `mechanic_immune_mask` &~ 0x4000 /* BLEED */ +WHERE `ScriptName`='npc_training_dummy'; diff --git a/sql/updates/world/2012_05_26_05_world_creature_template.sql b/sql/updates/world/2012_05_26_05_world_creature_template.sql new file mode 100644 index 00000000000..59d69b3fbe1 --- /dev/null +++ b/sql/updates/world/2012_05_26_05_world_creature_template.sql @@ -0,0 +1,8 @@ +-- Blade's Edge - Legion - Invis Bunny +UPDATE `creature_template` SET `flags_extra`=`flags_extra`|128 WHERE `entry`=20736; +-- Death's Door Warp-Gate Explosion Bunny +UPDATE `creature_template` SET `flags_extra`=`flags_extra`|128 WHERE `entry`=22502; +-- Death's Door North Warp-Gate +UPDATE `creature_template` SET `flags_extra`=`flags_extra`|128 WHERE `entry`=22471; +-- Death's Door South Warp-Gate +UPDATE `creature_template` SET `flags_extra`=`flags_extra`|128 WHERE `entry`=22472; diff --git a/sql/updates/world/2012_05_26_06_world_smart_scripts.sql b/sql/updates/world/2012_05_26_06_world_smart_scripts.sql new file mode 100644 index 00000000000..397a5ad517a --- /dev/null +++ b/sql/updates/world/2012_05_26_06_world_smart_scripts.sql @@ -0,0 +1,143 @@ +-- Blackhand Dreadweaver SAI +SET @ENTRY := 9817; -- NPC entry +SET @SPELL1 := 12739; -- Shadow Bolt +SET @SPELL2 := 7068; -- Veil of Shadow +SET @SPELL3 := 12380; -- Shadow Channeling +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM creature_ai_scripts WHERE creature_id=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,11,0,100,2,0,0,0,0,58,1,@SPELL1,3600,6300,25,30,1,0,0,0,0,0,0,0, 'Blackhand Dreadweaver - On Reset - Load caster template Cast Shadow Bolt'), +(@ENTRY,0,1,0,25,0,100,0,0,0,0,0,11,@SPELL3,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Dreadweaver - On Reset - Aura Shadow Channeling'), +(@ENTRY,0,2,3,4,0,100,2,0,0,0,0,11,@SPELL1,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Blackhand Dreadweaver - On Aggro - Cast Shadow Bolt'), +(@ENTRY,0,3,0,61,0,100,2,0,0,0,0,39,10,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Dreadweaver - On Aggro - Call for help'), +(@ENTRY,0,4,0,0,0,100,2,9400,21400,22000,28800,11,@SPELL2,3,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Dreadweaver - Combat - Cast Veil of Shadow'), +(@ENTRY,0,5,0,2,0,100,3,0,15,0,0,25,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Dreadweaver - HP@15% - Flee for help'), +(@ENTRY,0,6,7,1,0,100,2,0,8000,12000,14000,92,0,0,1,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Dreadweaver - OOC - interupt channeling'), +(@ENTRY,0,7,0,61,0,100,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Dreadweaver - OOC - set phase 1'), +(@ENTRY,0,8,0,1,1,100,2,0,0,0,0,5,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Dreadweaver - OOC - emote (phase 1)'), +(@ENTRY,0,9,10,1,1,100,2,4000,4000,4000,4000,11,@SPELL3,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Dreadweaver - OOC - Aura Shadow Channeling (phase 1)'), +(@ENTRY,0,10,0,61,1,100,0,0,0,0,0,22,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Dreadweaver - OOC - set phase 0 (phase 1)'); + +-- Blackhand Summoner SAI +SET @ENTRY := 9818; -- NPC entry +SET @SPELL1 := 12466; -- Fireball +SET @SPELL2 := 15532; -- Frost Nova +SET @SPELL3 := 15792; -- Summon Blackhand Veteran +SET @SPELL4 := 15794; -- Summon Blackhand Dreadweaver +SET @SPELL5 := 12380; -- Shadow Channeling +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM creature_ai_scripts WHERE creature_id=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,11,0,100,2,0,0,0,0,58,1,@SPELL1,3600,6300,25,30,1,0,0,0,0,0,0,0, 'Blackhand Summoner - On Reset - Load caster template Cast Fireball'), +(@ENTRY,0,1,0,25,0,100,0,0,0,0,0,11,@SPELL5,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Summoner - On Reset - Aura Shadow Channeling'), +(@ENTRY,0,2,3,4,0,100,2,0,0,0,0,11,@SPELL1,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Blackhand Summoner - On Aggro - Cast Shadow Bolt'), +(@ENTRY,0,3,0,61,0,100,2,0,0,0,0,39,10,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Summoner - On Aggro - Call for help'), +(@ENTRY,0,4,0,0,0,100,2,11400,11400,12700,16700,11,@SPELL2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Summoner - Combat - Cast Frost Nova'), +(@ENTRY,0,5,6,0,0,100,3,30000,35000,0,0,11,@SPELL3,1,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Summoner - Combat - Cast Summon Blackhand Veteran'), +(@ENTRY,0,6,0,61,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Summoner - Combat - say 0'), +(@ENTRY,0,7,8,0,0,100,3,40000,45000,0,0,11,@SPELL4,1,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Summoner - Combat - Cast Summon Blackhand Dreadweaver'), +(@ENTRY,0,8,0,61,0,100,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Summoner - Combat - say 1'), +(@ENTRY,0,9,0,2,0,100,3,0,15,0,0,25,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Summoner - HP@15% - Flee for help'), +(@ENTRY,0,10,0,1,0,100,2,0,8000,12000,14000,5,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Summoner - OOC - emote'); +-- NPC talk text insert +DELETE FROM `creature_text` WHERE `entry`=9818; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(9818,0,0,'%s begins to summon in a Blackhand Veteran!',16,0,100,0,0,0,'Blackhand Summoner'), +(9818,1,0,'%s begins to summon in a Blackhand Dreadweaver!',16,0,100,0,0,0,'Blackhand Summoner'); + +-- Blackhand Veteran SAI +SET @ENTRY := 9819; -- NPC entry +SET @SPELL1 := 15749; -- Shield Charge +SET @SPELL2 := 14516; -- Strike +SET @SPELL3 := 11972; -- Shield Bash +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM creature_ai_scripts WHERE creature_id=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,1,4,0,100,2,0,0,0,0,11,@SPELL1,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Blackhand Veteran - On Aggro - Cast Shield Charge'), +(@ENTRY,0,1,0,61,0,100,2,0,0,0,0,39,10,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Veteran - On Aggro - Call for help'), +(@ENTRY,0,2,0,0,0,100,2,7800,15800,13800,22900,11,@SPELL2,0,0,0,0,0,5,0,0,0,0,0,0,0, 'Blackhand Veteran - Combat - Cast Veil of Shadow'), +(@ENTRY,0,3,0,0,0,100,2,10000,20000,6000,12000,11,@SPELL3,0,0,0,0,0,5,0,0,0,0,0,0,0, 'Blackhand Veteran - Combat - Cast Veil of Shadow'), +(@ENTRY,0,4,0,2,0,100,3,0,15,0,0,25,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Veteran - HP@15% - Flee for help'), +(@ENTRY,0,5,0,1,0,100,2,0,8000,12000,14000,5,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Veteran - OOC - emote'); + +-- Rage Talon Dragonspawn SAI +SET @ENTRY := 9096; -- NPC entry +SET @SPELL1 := 15580; -- Strike +SET @SPELL2 := 12021; -- Fixate +SET @SPELL3 := 15572; -- Sunder Armor +SET @SPELL4 := 3391; -- Thrash +SET @SPELL5 := 8269; -- Frenzy +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM creature_ai_scripts WHERE creature_id=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,0,0,100,2,4000,13200,6600,14400,11,@SPELL1,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Rage Talon Dragonspawn - Combat - Cast Strike'), +(@ENTRY,0,1,0,0,0,100,2,7700,17100,20300,34200,11,@SPELL2,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Rage Talon Dragonspawn - Combat - Cast Fixate'), +(@ENTRY,0,2,0,0,0,100,2,1400,12300,7100,11700,11,@SPELL3,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Rage Talon Dragonspawn - Combat - Cast Sunder Armor'), +(@ENTRY,0,3,0,0,0,100,2,8200,17100,5600,18100,11,@SPELL4,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Rage Talon Dragonspawn - Combat - Cast Thrash'), +(@ENTRY,0,4,5,2,0,100,2,0,30,120000,120000,11,@SPELL5,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Rage Talon Dragonspawn - HP@30% - Cast Frenzy'), +(@ENTRY,0,5,0,61,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Summoner - HP@30% - say 0'); +-- NPC talk text insert +DELETE FROM `creature_text` WHERE `entry`=9096; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(9096,0,0,'%s goes into a frenzy!',16,0,100,0,0,0,'Rage Talon Dragonspawn'); + + -- Scarshield Legionnaire SAI +SET @ENTRY := 9097; -- NPC entry +SET @SPELL1 := 15496; -- Cleave +SET @SPELL2 := 11972; -- Shield Bash +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM creature_ai_scripts WHERE creature_id=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,4,0,100,2,0,0,0,0,39,10,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Scarshield Legionnaire - On Aggro - Call for help'), +(@ENTRY,0,1,0,0,0,100,2,7800,11500,8000,22100,11,@SPELL1,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Scarshield Legionnaire - Combat - Cast Cleave'), +(@ENTRY,0,2,0,0,0,100,2,4000,10000,14000,20000,11,@SPELL2,0,0,0,0,0,5,0,0,0,0,0,0,0, 'Scarshield Legionnaire - Combat - Cast Shield Bash'); + +-- Scarshield Acolyte SAI +SET @ENTRY := 9045; -- NPC entry +SET @SPELL1 := 14032; -- Shadow Word: Pain +SET @SPELL2 := 12039; -- Heal +SET @SPELL3 := 8362; -- Renew +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM creature_ai_scripts WHERE creature_id=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,4,0,100,2,0,0,0,0,39,10,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Scarshield Acolyte - On Aggro - Call for help'), +(@ENTRY,0,1,0,0,0,100,2,7700,15700,21900,33500,11,@SPELL1,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Scarshield Acolyte - Combat - Cast Shadow Word: Pain'), +(@ENTRY,0,2,0,2,0,100,3,0,75,0,0,11,@SPELL2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Scarshield Acolyte - HP@75% - Cast Heal'), +(@ENTRY,0,3,0,14,0,100,2,35,8,5000,6000,11,@SPELL3,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Scarshield Acolyte - Friendly hp@35 - Cast Renew on friendly unit'); + +-- Scarshield Spellbinder SAI +SET @ENTRY := 9098; -- NPC entry +SET @SPELL1 := 13748; -- Arcane Bolt +SET @SPELL2 := 15123; -- Resist Fire +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM creature_ai_scripts WHERE creature_id=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,11,0,100,2,0,0,0,0,58,1,@SPELL1,1100,3000,30,30,1,0,0,0,0,0,0,0, 'Scarshield Spellbinder - On Reset - Load caster template Cast Arcane Bolt'), +(@ENTRY,0,1,0,4,0,100,2,0,0,0,0,39,10,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Scarshield Spellbinder - On Aggro - Call for help'), +(@ENTRY,0,2,0,16,0,100,2,@SPELL2,30,3000,6000,11,@SPELL2,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Blackhand Summoner - Combat - Cast Resist Fire'); + +-- Blackhand Incarcerator SAI +SET @ENTRY := 10316; -- NPC entry +SET @SPELL1 := 15281; -- Encage Emberseer +SET @SPELL2 := 12039; -- Heal +SET @SPELL3 := 8362; -- Renew +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM creature_ai_scripts WHERE creature_id=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,1,0,100,3,1000,1000,1000,1000,11,@SPELL1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Incarcerator - OOC - Cast Encage Emberseer'), +(@ENTRY,0,1,2,38,0,100,2,0,1,0,0,92,0,@SPELL1,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Incarcerator - On data set - Stop Casting Encage Emberseer'), +(@ENTRY,0,2,4,61,0,100,0,0,0,0,0,19,768,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Incarcerator - On data set - Remove unit flags'), +(@ENTRY,0,3,4,4,0,100,2,0,0,0,0,9,0,0,0,0,0,0,15,175244,100,0,0,0,0,0, 'Blackhand Incarcerator - On aggro - close emberseer in door'), +(@ENTRY,0,4,0,61,0,100,0,0,0,0,0,9,0,0,0,0,0,0,15,175705,100,0,0,0,0,0, 'Blackhand Incarcerator - On aggro - close doors'), +(@ENTRY,0,5,0,0,0,100,2,7800,15800,13800,22900,11,@SPELL2,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Blackhand Incarcerator - Combat - Cast Strike'), +(@ENTRY,0,6,0,0,0,100,2,10000,20000,6000,12000,11,@SPELL3,0,0,0,0,0,5,0,0,0,0,0,0,0, 'Blackhand Incarcerator - Combat - Cast Encage'), +(@ENTRY,0,7,0,2,0,100,3,0,15,0,0,25,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Incarcerator - HP@15% - Flee for help'), +(@ENTRY,0,8,0,6,0,100,0,0,0,0,0,41,10000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Blackhand Incarcerator - On death - Despawn after 10 sec'); diff --git a/sql/updates/world/2012_05_27_00_world_gameobject_template.sql b/sql/updates/world/2012_05_27_00_world_gameobject_template.sql new file mode 100644 index 00000000000..5fa3c15a505 --- /dev/null +++ b/sql/updates/world/2012_05_27_00_world_gameobject_template.sql @@ -0,0 +1,7 @@ +-- Gameobject updates based on sniffs +UPDATE `gameobject_template` SET `size` =2.5,`questItem1`=30876,`data0`=57,`data1`=21583 WHERE `entry`=185032; +UPDATE `gameobject` SET `position_x`=-3420.991,`position_y`=1373.175,`position_z`=257.5233,`orientation`=3.141593 WHERE `id`=185032; +-- Gameobject loot template +DELETE FROM `gameobject_loot_template` WHERE `entry`=21583; +INSERT INTO `gameobject_loot_template` VALUES +(21583,30876,100,1,0,1,1); -- Quenched Illidari-Bane Blade diff --git a/sql/updates/world/2012_05_27_01_world_waypoints.sql b/sql/updates/world/2012_05_27_01_world_waypoints.sql new file mode 100644 index 00000000000..3685b58a629 --- /dev/null +++ b/sql/updates/world/2012_05_27_01_world_waypoints.sql @@ -0,0 +1,7 @@ +-- RE FIX Reanimated Frost Wyrm +DELETE FROM `creature` WHERE `guid` IN (116670,116671,116672,116681,116683,116684,116685,116686,116687,116696,116697,116699,116700,116701); +UPDATE `creature` SET `MovementType`=2 WHERE `guid` BETWEEN 40497 AND 40505; +UPDATE `creature_addon` SET `bytes1`=50331648,`bytes2`=1 WHERE `guid` BETWEEN 40497 AND 40505; +-- Fix Wildhammer Scout +UPDATE `creature` SET `MovementType`=0 WHERE guid IN (69122,69123,69124,69125,69126,69127); +UPDATE `creature_addon` SET `path_id`=0 WHERE guid IN (69122,69123,69124,69125,69126,69127); diff --git a/sql/updates/world/2012_05_27_02_world_creature.sql b/sql/updates/world/2012_05_27_02_world_creature.sql new file mode 100644 index 00000000000..8ca3ee75c94 --- /dev/null +++ b/sql/updates/world/2012_05_27_02_world_creature.sql @@ -0,0 +1,4 @@ +-- Add Missing spawn for Queen Angerboda +DELETE FROM `creature` WHERE `id`=24023; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES +(42162,24023,571,1,1,0,0,2855.372,-3869.662,248.6132,2.181662,150,0,0,9291,3231,0,0,0,0); diff --git a/sql/updates/world/2012_05_27_03_world_creature.sql b/sql/updates/world/2012_05_27_03_world_creature.sql new file mode 100644 index 00000000000..097f40581a7 --- /dev/null +++ b/sql/updates/world/2012_05_27_03_world_creature.sql @@ -0,0 +1,2 @@ +-- Remove Spawns for Compact Harvest Reaper, it should be spawned via script +DELETE FROM `creature` WHERE `id`=2676; diff --git a/sql/updates/world/2012_05_27_04_world_smart_scripts.sql b/sql/updates/world/2012_05_27_04_world_smart_scripts.sql new file mode 100644 index 00000000000..1f7cfa3d19c --- /dev/null +++ b/sql/updates/world/2012_05_27_04_world_smart_scripts.sql @@ -0,0 +1,24 @@ +-- Reconstructed Wyrm SAI +SET @ENTRY := 27693; +SET @SPELL1 := 49386; -- Not in dbc +SET @SPELL2 := 49343; -- Frost Breath Strafe +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,1,11,0,100,0,0,0,0,0,11,@SPELL2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Reconstructed Wyrm - On spawn - cast aura'), +(@ENTRY,0,1,0,61,0,100,0,0,0,0,0,53,0,@ENTRY,0,0,0,0,1,0,0,0,0,0,0,0,'Reconstructed Wyrm - On spawn - Load Path'); +-- waypoints for Reconstructed Wyrm +DELETE FROM `waypoints` WHERE `entry` IN (@ENTRY); +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(@ENTRY,1,4685.845,1130.759,150.1177, 'Reconstructed Wyrm'), +(@ENTRY,2,4686.284,1131.658,150.1177, 'Reconstructed Wyrm'), +(@ENTRY,3,4688.699,1166.089,161.2737, 'Reconstructed Wyrm'), +(@ENTRY,4,4702.308,1212.668,161.2737, 'Reconstructed Wyrm'), +(@ENTRY,5,4733.535,1260.209,169.6348, 'Reconstructed Wyrm'), +(@ENTRY,6,4751.818,1293.699,175.9404, 'Reconstructed Wyrm'), +(@ENTRY,7,4794.479,1345.154,199.5372, 'Reconstructed Wyrm'), +(@ENTRY,8,4812.264,1373.523,219.8613, 'Reconstructed Wyrm'); +-- Fix spawns +UPDATE `creature` SET `position_x`=4685.845,`position_y`=1130.759,`position_z`=150.1177,`spawntimesecs`=120,`spawndist`=0,`MovementType`=0 WHERE `guid`=100211; +DELETE FROM `creature` WHERE `guid` IN (100256,133240,133241); +DELETE FROM `creature_addon` WHERE `guid` IN (100256,133240,133241); diff --git a/sql/updates/world/2012_05_27_05_world_gameobject.sql b/sql/updates/world/2012_05_27_05_world_gameobject.sql new file mode 100644 index 00000000000..66fbfd0afca --- /dev/null +++ b/sql/updates/world/2012_05_27_05_world_gameobject.sql @@ -0,0 +1,13 @@ +-- [QUEST] Attunement to Dalaran +SET @GUID := 320; +-- Adds the gameobject to recognize the zone +DELETE FROM `gameobject` WHERE `id`=300193; +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) +VALUES +(@GUID,300193,571,1,1,3343.8,2502.85,-15.1381,5.74342,0,0,0.266617,-0.963802,300,0,1); +-- [SAI] NPC Attunement To Dalaran Kill Credit Bunny 27135 +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=27135; +DELETE FROM `smart_scripts` WHERE `entryorguid`=27135 AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) +VALUES +(27135,0,0,0,8,0,100,1,48021,1,0,0,33,27135,0,0,0,0,0,7,0,0,0,0,0,0,0, 'On spellhit - give kill credit - Attunement to Dalaran Kill Credit Bunny'); diff --git a/sql/updates/world/2012_05_27_06_world_creature.sql b/sql/updates/world/2012_05_27_06_world_creature.sql new file mode 100644 index 00000000000..1074465a0be --- /dev/null +++ b/sql/updates/world/2012_05_27_06_world_creature.sql @@ -0,0 +1,113 @@ +-- Tukemuth +DELETE FROM `smart_scripts` WHERE `entryorguid`=32400; +INSERT INTO `smart_scripts` VALUES +(32400,0,0,0,9,0,100,0,0,5,9000,13000,11,50410,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Tukemuth - Cast Tusk Strike'), +(32400,0,1,0,0,0,100,0,9000,17000,15000,22000,11,57066,0,0,0,0,0,0,0,0,0,0,0,0,0, 'Tukemuth - Cast Trample'); +UPDATE `creature_template` SET faction_A=7,faction_H=7,mindmg=2926.0,maxdmg=3542.0,skinloot=70209,spell1=50410,spell2=57066,attackpower=3384,dmg_multiplier=1.0,AIName= 'SmartAI',mechanic_immune_mask=2147483647 where entry=32400; + +-- Fumblub Gearwind +DELETE FROM `smart_scripts` WHERE `entryorguid`=32358; +INSERT INTO `smart_scripts` VALUES +(32358,0,0,0,0,0,100,0,4000,6000,12000,15000,11,60906,1,0,0,0,0,2,0,0,0,0,0,0,0, 'Fumblub Gearwind - Cast Machine Gun'); +UPDATE `creature_template` SET faction_A=14,faction_H=14,mindmg=2792,maxdmg=3376,spell1=60906,attackpower=3384,dmg_multiplier=1.0,AIName= 'SmartAI',mechanic_immune_mask=2147483647,type_flags=2048,InhabitType=4 where entry=32358; +UPDATE `creature_addon` SET mount=22719,bytes1=33554432 where guid=151938; + +-- Old Crystalbark +DELETE FROM `smart_scripts` WHERE `entryorguid`=32357; +INSERT INTO `smart_scripts` VALUES +(32357,0,0,0,0,0,100,0,3700,16200,19200,28000,11,50506,0,0,0,0,0,0,0,0,0,0,0,0,0, 'Old Crystalbark - Cast Mark of Detonation'), +(32357,0,1,0,0,0,100,0,1625,8100,9600,14000,11,60903,0,0,0,0,0,0,0,0,0,0,0,0,0, 'Old Crystalbark - Cast Arcane Breath'); +UPDATE `creature_template` SET faction_A=14,faction_H=14,mindmg=3231.0,maxdmg=3309.0,spell1=60903,spell2=50506,attackpower=3214,dmg_multiplier=1.0,AIName= 'SmartAI',mechanic_immune_mask=2147483647 where entry=32357; + +-- Terror Spinner - Tameable +DELETE FROM `smart_scripts` WHERE `entryorguid`=32475; +INSERT INTO `smart_scripts` VALUES +(32475,0,0,0,0,0,100,0,4000,6000,12000,15000,11,36839,1,0,0,0,0,2,0,0,0,0,0,0,0, 'Terror Spinner - Cast Impairing Poison'), +(32475,0,1,0,0,0,100,0,1625,8100,9600,14000,11,28428,1,0,0,0,0,2,0,0,0,0,0,0,0, 'Terror Spinner - Cast Instant Poison'); +UPDATE `creature_template` SET faction_A=14,faction_H=14,mindmg=3625.0,maxdmg=4301.0,spell1=32475,spell2=28428,attackpower=3963,dmg_multiplier=1.0,AIName= 'SmartAI',mechanic_immune_mask=66624,name= 'Terror Spinner' where entry=32475; + +-- Hildana Deathstealer +DELETE FROM `smart_scripts` WHERE `entryorguid`=32495; +INSERT INTO `smart_scripts` VALUES +(32495,0,0,0,0,0,100,1,0,0,0,0,22,1,0,0,0,0,0,0,0,0,0,0,0,0,0, 'Hildana Deathstealer - Enter phase 1'), +(32495,0,1,2,0,1,100,0,3000,6000,4000,6000,11,60991,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Hildana Deathstealer - Cast Lash'), +(32495,0,2,0,61,1,100,0,0,0,0,0,22,2,0,0,0,0,0,0,0,0,0,0,0,0,0, 'Hildana Deathstealer - Enter phase 2'), +(32495,0,3,0,0,2,100,0,3000,5000,9000,11000,11,57547,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Hildana Deathstealer - Cast Touch of the Valkyr'), +(32495,0,4,0,0,2,100,0,12000,13000,13000,15000,22,1,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Hildana Deathstealer - timer back to phase 1'); +UPDATE `creature_template` SET faction_A=14,faction_H=14,mindmg=4715,maxdmg=5474,attackpower=5094,dmg_multiplier=1.0,AIName= 'SmartAI',mechanic_immune_mask=2147483647 where entry=32495; + +-- Syreian the Bonecarver +UPDATE `creature_template` SET faction_A=14,faction_H=14,mindmg=2926,maxdmg=3542,spell1=38952,spell2=47168,spell3=50092,attackpower=3234,dmg_multiplier=1.0,mechanic_immune_mask=2147483647 where entry=32438; + +-- Icehorn - Tameable +DELETE FROM `smart_scripts` WHERE `entryorguid`=32361; +INSERT INTO `smart_scripts` VALUES +(32361,0,0,0,0,0,100,0,4500,6750,6750,9750,11,57468,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Icehorn - Cast Romp'); +UPDATE `creature_template` SET type_flags= '1',faction_A=14,faction_H=14,mindmg=2792,maxdmg=3376,spell1=57468,attackpower=3084,dmg_multiplier=1.0,AIName= 'SmartAI',mechanic_immune_mask=66624,skinloot=70211 where entry=32361; + +-- King Ping +DELETE FROM `smart_scripts` WHERE `entryorguid`=32398; +INSERT INTO `smart_scripts` VALUES +(32398,0,0,0,0,0,100,0,1600,8000,12400,13000,11,61115,0,0,0,0,0,2,0,0,0,0,0,0,0, 'King Ping - Cast Belly Flop'), +(32398,0,1,0,0,0,100,0,800,2600,4200,6800,11,50169,0,0,0,0,0,2,0,0,0,0,0,0,0, 'King Ping - Cast Flipper Thwack'); +UPDATE `creature_template` SET faction_A=14,faction_H=14,mindmg=2792,maxdmg=3376,spell1=61115,spell2=50169,attackpower=3234,dmg_multiplier=1.0,AIName= 'SmartAI',mechanic_immune_mask=2147483647 WHERE entry=32398; + +-- High Thane Jorfus +DELETE FROM `smart_scripts` WHERE `entryorguid`=32501; +INSERT INTO `smart_scripts` VALUES +(32501,0,0,0,0,0,100,0,1600,3200,6400,12800,11,60950,0,0,0,0,0,2,0,0,0,0,0,0,0, 'High Thane Jorfus - Cast Blood Plague'), +(32501,0,1,0,0,0,100,2,10000,20000,10000,20000,11,60945,0,0,0,0,0,2,0,0,0,0,0,0,0, 'High Thane Jorfus - Cast Blood Strike'), +(32501,0,2,0,0,0,100,0,8000,13000,16000,21000,11,60953,1,0,0,0,0,5,0,0,0,0,0,0,0, 'High Thane Jorfus - Cast Death and Decaye'), +(32501,0,3,0,0,0,100,4,1000,1400,8500,20500,11,60949,0,0,0,0,0,5,0,0,0,0,0,0,0, 'High Thane Jorfus - Cast Death Coil'), +(32501,0,4,0,0,0,100,2,5000,9000,15000,22000,11,60951,0,0,0,0,0,2,0,0,0,0,0,0,0, 'High Thane Jorfus - Cast Frost Strike'); +UPDATE `creature_template` set faction_A=14,faction_H=14,mindmg=4894,maxdmg=5649,spell1=60950,spell2=60945,spell3=60953,spell4=60949,spell5=60951,attackpower=5271,dmg_multiplier=1.0,AIName= 'SmartAI',mechanic_immune_mask=2147483647 WHERE entry=32501; + +-- Perobas the Bloodthirster +DELETE FROM `smart_scripts` WHERE `entryorguid`=32377; +INSERT INTO `smart_scripts` VALUES +(32377,0,0,0,0,0,100,0,5000,8000,12000,15000,11,50046,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Perobas the Bloodthirster - Cast Gnaw Bone'), +(32377,0,1,0,2,0,100,0,0,50,10000,13000,11,50271,1,0,0,0,0,1,0,0,0,0,0,0,0, 'Perobas the Bloodthirster - Cast Killing Rage'); +UPDATE `creature_template` set faction_A=14,faction_H=14,mindmg=2792,maxdmg=3376,spell1=50046,spell2=52071,attackpower=3084,dmg_multiplier=1.0,AIName= 'SmartAI',mechanic_immune_mask=66624,skinloot=70209 where entry=32377; + +-- Aotona - Tameable +UPDATE `creature` SET curhealth=15952 where id=32481; +UPDATE `creature_template` SET exp=2,armor_mod=1.0,minlevel=75,maxlevel=75,faction_A=14,faction_H=14,mindmg=3376,maxdmg=4034,spell1=49865,spell2=51144,attackpower=3705,dmg_multiplier=1.0,mechanic_immune_mask=66624 where entry=32481; + +-- Griegen +DELETE FROM `smart_scripts` WHERE `entryorguid`=32471; +INSERT INTO `smart_scripts` VALUES +(32471,0,0,0,0,0,100,0,5000,8000,9000,12000,11,51334,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Griegen - Cast Smash'); +UPDATE `creature` set curhealth=15952 where id=32471; +UPDATE `creature_template` set exp=2,armor_mod=1.0,minlevel=75,maxlevel=75,faction_A=14,faction_H=14,mindmg=3376,maxdmg=4034,spell1=51334,attackpower=3705,dmg_multiplier=1.0,AIName= 'SmartAI',mechanic_immune_mask=2147483647 where entry=32471; + +-- Seething Hate +UPDATE `creature_template` SET mindmg=2926,maxdmg=3542,attackpower=3234,dmg_multiplier=1.0,mechanic_immune_mask=66624 WHERE entry=32429; + +-- Vigdis the War Maiden +DELETE FROM `creature_template_addon` WHERE entry=32386; +INSERT INTO `creature_template_addon` VALUES +(32386,0,28040,0,0,0,NULL); +UPDATE `creature` SET spawndist=20.0,MovementType=1 WHERE id=32386; +UPDATE `creature_template` SET faction_A=14,faction_H=14,mindmg=2792,maxdmg=3376,attackpower=3084,dmg_multiplier=1.0,mechanic_immune_mask=2147483647,InhabitType=1 where entry=32386; + +-- King Krush - Tameable +UPDATE `creature_template` SET faction_A=14,faction_H=14,mechanic_immune_mask=66624 WHERE entry=32485; + +-- Scarlet Highlord Daion +UPDATE `creature_template` SET faction_A=14,faction_H=14,mindmg=2926,maxdmg=3542,attackpower=3234,dmg_multiplier=1.0,mechanic_immune_mask=66624 WHERE entry=32417; + +-- Crazed Indu'le Survivor +UPDATE `creature_template` SET mindmg=2926,maxdmg=3542,attackpower=3234,dmg_multiplier=1.0,mechanic_immune_mask=66624 WHERE entry=32409; + +-- Grocklar +UPDATE `creature_template` SET mindmg=3137,maxdmg=3777,attackpower=3457,dmg_multiplier=1.0,mechanic_immune_mask=66624 WHERE entry=32422; + +-- Loque'nahak - Tameable +UPDATE `creature_template` SET type_flags= '1',mechanic_immune_mask=66624 WHERE entry=32422; + +-- Zuldrak Sentinel +DELETE FROM `smart_scripts` WHERE `entryorguid`=32447; +INSERT INTO `smart_scripts` VALUES +(32447,0,0,0,0,0,100,0,0,5,9000,13000,11,55196,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Zuldrak Sentinel - Cast Stomp'), +(32447,0,1,0,0,0,100,0,15000,20000,21000,35000,11,54565,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Zuldrak Sentinel - Cast Whammy'); +UPDATE `creature_template` SET mindmg= '3905',maxdmg= '4600',attackpower= '4252',dmg_multiplier= '1.0',mechanic_immune_mask= '66624',spell1= '54565',spell2= '55196',AIName= 'SmartAI' WHERE entry= '32447'; diff --git a/sql/updates/world/2012_05_27_07_world_game_event.sql b/sql/updates/world/2012_05_27_07_world_game_event.sql new file mode 100644 index 00000000000..eff4a9e7652 --- /dev/null +++ b/sql/updates/world/2012_05_27_07_world_game_event.sql @@ -0,0 +1,8 @@ +UPDATE `game_event` SET `start_time` ='2012-06-21 00:01:00' WHERE `eventEntry`=1; -- Midsummer Fire Festival +UPDATE `game_event` SET `start_time` ='2012-09-19 00:01:00' WHERE `eventEntry`=50; -- Pirates' Day +UPDATE `game_event` SET `start_time` ='2012-09-20 00:01:00' WHERE `eventEntry`=24; -- Brewfest +UPDATE `game_event` SET `start_time` ='2012-09-24 00:01:00' WHERE `eventEntry`=11; -- Harvest Festival +UPDATE `game_event` SET `start_time` ='2012-09-18 01:00:00' WHERE `eventEntry`=11; -- Hallow's End +UPDATE `game_event` SET `start_time` ='2012-11-01 01:00:00' WHERE `eventEntry`=51; -- Day of the Dead +UPDATE `game_event` SET `start_time` ='2012-11-18 01:00:00' WHERE `eventEntry`=26; -- Pilgrim's Bounty +UPDATE `game_event` SET `start_time` ='2012-12-15 06:00:00' WHERE `eventEntry`=2; -- Winter Veil diff --git a/sql/updates/world/2012_05_27_07_world_waypoints.sql b/sql/updates/world/2012_05_27_07_world_waypoints.sql new file mode 100644 index 00000000000..bd6aa2d0fc1 --- /dev/null +++ b/sql/updates/world/2012_05_27_07_world_waypoints.sql @@ -0,0 +1,8 @@ +-- Fix pathing for Thiassi the Lightning Bringer +DELETE FROM `creature_addon` WHERE `guid`=106554; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (106554,1065540,1); + +-- bio's screwed up movement for rares. Fix for some +UPDATE `creature` SET `spawndist`=10,`MovementType`=1 WHERE `id` IN (32400,32417,32422,32429); +UPDATE `creature_addon` SET `path_id`=2026020 WHERE `guid`=202602; +UPDATE `waypoint_data` SET `id`=2026020 WHERE `id`=2500060; diff --git a/sql/updates/world/2012_05_28_00_world_creature_ai_scripts.sql b/sql/updates/world/2012_05_28_00_world_creature_ai_scripts.sql new file mode 100644 index 00000000000..aef4e4c6f67 --- /dev/null +++ b/sql/updates/world/2012_05_28_00_world_creature_ai_scripts.sql @@ -0,0 +1,9 @@ +-- Fix recent DB errors +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=27135; -- Attunement To Dalaran Kill Credit +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=32400; -- Tukemuth + +-- Fix recent DB errors (credits to Vincent-Michael) +DELETE FROM `creature_addon` WHERE `guid` = 2593; +DELETE FROM `creature_template_addon` WHERE `entry` = 2676; +INSERT INTO `creature_template_addon` (`entry`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(2676,0,0,0,4097,0,NULL); diff --git a/sql/updates/world/2012_05_28_01_world_creature.sql b/sql/updates/world/2012_05_28_01_world_creature.sql new file mode 100644 index 00000000000..d39aa7230b5 --- /dev/null +++ b/sql/updates/world/2012_05_28_01_world_creature.sql @@ -0,0 +1,18 @@ +-- Spawn Deadmire +SET @GUID := 33909; +SET @NPC := @GUID*10; +DELETE FROM `creature` WHERE `id`=4841; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES +(@GUID,4841,1,1,1,0,0,-3949.688,-3471.041,29.15445,4.288023,360,0,0,1902,0,0,0,0,0); -- respawn Deadmire on old guid +-- Set movement info +UPDATE `creature_addon` SET `path_id`=@NPC WHERE `guid`=@GUID; +UPDATE `creature_template` SET `MovementType`=2 WHERE `entry`=4841; +-- Add Waypoint Data +DELETE FROM `waypoint_data` WHERE `id`=@NPC; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@NPC,1,-3942.966,-3455.51,28.89743,0,0,0,0,0,0), +(@NPC,2,-3943.117,-3456.498,28.89743,0,0,0,0,0,0), +(@NPC,3,-3948.063,-3467.443,29.64743,0,0,0,0,0,0), +(@NPC,4,-3950.123,-3472.004,29.02243,0,0,0,0,0,0), +(@NPC,5,-3953.303,-3479.054,28.64743,0,0,0,0,0,0), +(@NPC,6,-3953.303,-3479.054,28.64743,0,0,0,0,0,0); diff --git a/sql/updates/world/2012_05_28_02_world_creature.sql b/sql/updates/world/2012_05_28_02_world_creature.sql new file mode 100644 index 00000000000..77da626d89e --- /dev/null +++ b/sql/updates/world/2012_05_28_02_world_creature.sql @@ -0,0 +1,26 @@ +-- Spawn Deadmire +SET @GUID := 202606; +SET @NPC := @GUID*10; +-- Set movement info +UPDATE `creature_addon` SET `path_id`=@NPC WHERE `guid`=@GUID; +UPDATE `creature_template` SET `MovementType`=2 WHERE `entry`=32630; +-- Add Waypoint Data +DELETE FROM `waypoint_data` WHERE `id`=@NPC; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@NPC,1,7024.75,-1625.538,957.3694,0,0,0,0,0,0), +(@NPC,2,7025.494,-1624.87,957.3694,0,0,0,0,0,0), +(@NPC,3,7167.578,-1501.694,962.5693,0,0,0,0,0,0), +(@NPC,4,7440.402,-1295.861,997.2911,0,0,0,0,0,0), +(@NPC,5,7210.958,-1046.892,1006.18,0,0,0,0,0,0), +(@NPC,6,6998.465,-1076.847,1024.819,0,0,0,0,0,0), +(@NPC,7,6874.249,-1097.382,927.736,0,0,0,0,0,0), +(@NPC,8,6614.792,-875.7547,812.7645,0,0,0,0,0,0), +(@NPC,9,6563.275,-811.7673,749.8757,0,0,0,0,0,0), +(@NPC,10,6299.502,-797.577,529.1257,0,0,0,0,0,0), +(@NPC,11,6194.549,-1013.144,501.5424,0,0,0,0,0,0), +(@NPC,12,6319.254,-1251.661,468.6258,0,0,0,0,0,0), +(@NPC,13,6309.161,-1537.857,615.0423,0,0,0,0,0,0), +(@NPC,14,6748.211,-1664.307,919.3118,0,0,0,0,0,0), +(@NPC,15,6913.308,-1725.261,954.7917,0,0,0,0,0,0), +(@NPC,16,7167.578,-1501.694,962.5693,0,0,0,0,0,0), +(@NPC,17,7440.402,-1295.861,997.2911,0,0,0,0,0,0); diff --git a/sql/updates/world/2012_05_28_03_waypoint_data.sql b/sql/updates/world/2012_05_28_03_waypoint_data.sql new file mode 100644 index 00000000000..aa0e0ddd5ef --- /dev/null +++ b/sql/updates/world/2012_05_28_03_waypoint_data.sql @@ -0,0 +1,3 @@ +-- correct waypointid to guid*10 +UPDATE `waypoint_data` SET `id`=2026020 WHERE `id`=2026060; +UPDATE `creature_addon` SET `path_id`=2026020 WHERE `guid`=202602; diff --git a/sql/updates/world/2012_05_28_04_world_creature_template.sql b/sql/updates/world/2012_05_28_04_world_creature_template.sql new file mode 100644 index 00000000000..d8c9a15e412 --- /dev/null +++ b/sql/updates/world/2012_05_28_04_world_creature_template.sql @@ -0,0 +1,3 @@ +-- malcroms request +UPDATE `creature_template` SET `MovementType`=0 WHERE `entry`=32630; +UPDATE `creature` SET `MovementType`=2 WHERE `id`=32630; diff --git a/sql/updates/world/2012_05_28_05_world_creature.sql b/sql/updates/world/2012_05_28_05_world_creature.sql new file mode 100644 index 00000000000..c7d4af5b494 --- /dev/null +++ b/sql/updates/world/2012_05_28_05_world_creature.sql @@ -0,0 +1,216 @@ +-- Guid for inserts +SET @NEXT := 134704; -- need 129 +-- Correct Phasing/Quest relation for the Argent Vanguard,Crusader's Pinnacle,Scourgeholme,The Breach,Valley of Echoes and Pit of Fiends (I didn't use Phase IV spell id: 57675 since it sets phase to one,I don't see the point since that's the default phase) +-- The spells are Argent Vanguard Chapter I (id: 57673),Argent Vanguard Chapter II (id: 57569) and Argent Vanguard Chapter III (id: 57674) +DELETE FROM `spell_area` WHERE `spell` IN (57673,57569,57674); +INSERT INTO `spell_area` (`spell`,`area`,`quest_start`,`quest_start_active`,`quest_end`,`aura_spell`,`racemask`,`gender`,`autocast`) VALUES +(57673,4501,0,0,13070,0,0,2,1), +(57673,4504,0,0,13070,0,0,2,1), +(57673,4505,0,0,13086,0,0,2,1), +(57673,4506,0,0,13086,0,0,2,1), +(57673,4580,0,0,13086,0,0,2,1), +(57673,4593,0,0,13086,0,0,2,1), +(57569,4501,13070,0,13086,0,0,2,1), +(57569,4504,13070,0,13086,0,0,2,1), +(57674,4501,13086,0,13141,0,0,2,1), +(57674,4504,13086,0,13141,0,0,2,1), +(57674,4505,13086,0,13141,0,0,2,1), +(57674,4506,13086,0,13141,0,0,2,1), +(57674,4593,13086,0,13141,0,0,2,1), +(57674,4580,13086,0,13141,0,0,2,1); +-- Phase for objects in Crusader's Pinnacle (Scourge controlled) +UPDATE `gameobject` SET `phaseMask`=194 WHERE `id` IN (192936,192938,192953,192954,192955,192956,192957,192982,192995,193003,192958,192959,192960,192961,192962,192963,192964,192965,192966,192967,192968,192969,192970,192971,192972,192973,192974,192975,192976,192977,192978,192979,192980,192981,192983,192985,192986,192987,192988,192989,192990,192991,192994,192934,192935,192992,192993,193002,192997,192996,192999,193000,193001,192936,192937); +-- Phase for a few objects in Scourgeholme +UPDATE `gameobject` SET `phaseMask`=195 WHERE `id` IN (192576,192577,192575,192579,192578); +-- Misc Objects in Argent Vanguard to be visible in all phases +UPDATE `gameobject` SET `phaseMask`=195 WHERE `guid` IN (62021,62027,62356,62359,62353,62071,62061); +-- Duplicates of the objects in Argent Vanguard,no need to have 2 of each if they have no special interaction with a particular phase +DELETE FROM `gameobject` WHERE `guid` IN (100101,100484,100097,100433,100098,100432,100104,100485); +-- Phase for the walls and towers for all phases except during "The last line of defense" +UPDATE `gameobject` SET `phaseMask`=131 WHERE `guid` IN (61089,61066,61027,61056,61004,60999,60996,60976); +-- Phase for walls during "The last line of defense",they need a separate object here because they interact directly with the phase +UPDATE `gameobject` SET `phaseMask`=64 WHERE `guid` IN (100441,100440,100438,100439,100437,100436,100435,100434); +-- Phase for objects in The Breach after "The last line of defense" +UPDATE `gameobject` SET `phaseMask`=129 WHERE `id` IN (192797,192798,192799,192800,192801,192802,192803,192804,192805); +-- Phase for objects in The Breach before "The last line of defense" +UPDATE `gameobject` SET `phaseMask`=66 WHERE `id` IN (192161,192162,192166,192806,192807,192808,192809,192810,192811,192812,192813,192814,192815,192816,192817); +-- Phase for NPCs in Argent Vanguard that should be in all phases (except during "The last line of defense) +UPDATE `creature` SET `phaseMask`=131 WHERE `guid` IN (121664,124618,124483,121684,121671,121696,121668,121693,121669,121677,121697,121666,121662,121678,121670,121680,121685,121683,121665,121682,121686,121663,121695,124527,124491,124661,123618,124497,124323,124340,124332,207301,207298,207296,207297,207299,207300,124442); +-- Same as with the objects,delete duplicate creatures that have no direct interaction with a particular phase,a single creature can fulfill that role. +DELETE FROM `creature` WHERE `guid` IN (207239,207264,207260,207251,207245,207256,207242,207254,207243,207246,207257,207241,207237,207247,207244,207248,207252,207250,207240,207249,207253,207238,207255,207263,207261,207265,207258,207262,207259); +-- Phase for NPCs only present until "The last line of defense" +UPDATE `creature` SET `phaseMask`=2 WHERE `guid` IN (207229,207228,207234,207233,207232,207235,207236,207227,207222,207230,207231,207223,202409,207225,207226); +-- Phase for Siegemaster Fezzik (He is the only one present up until and during "the last line of defense") +UPDATE `creature` SET `phaseMask`=66 WHERE `guid`=207224; +-- Phase for NPCs in the Valley of Echoes before "The last line of defense" +UPDATE `creature` SET `phaseMask`=2 WHERE `guid` IN (207290,207289,207288,207294,207293,207295,207284,207282,207286,207285,207287,207291,207283,207281,207292,207280); +-- Phase for Creatures on the Valley of Echoes before "The last line of defense" +UPDATE `creature` SET `phaseMask`=2 WHERE `id` IN (30206,30273); +-- Phase for mobs and NPCs in the Valley of Echoes and The breach after "The last line of defense" +UPDATE `creature` SET `phaseMask`=129 WHERE `guid` IN (124320,124302,124297,124317,124338,124333,124329,124341,124301,124307,124319,124339,124337,124324,124298,124308,124303,124302,124320,124330,124326,124309,124335,124318,124299,124311,124310,124325,124327,124300,124315,124314,124313,124312,124321,124336,124334,124331,124328,121679,121667,121681,121694,121700,121692,203393,121698,121672); +-- Set correct faction for Crusade Architect Silas +UPDATE `creature_template` SET `faction_H`=2070,`faction_A`=2070 WHERE `entry`=30686; +-- Mount for Highlord Tirion Fordring in Argent Vanguard after "the last line of defense" +DELETE FROM `creature_template_addon` WHERE `entry`=30677; +INSERT INTO `creature_template_addon` (`entry`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(30677,0,2325,0,0,0,NULL); +-- Phase for Father Gustav in Valley of Echoes after "the last line of defense" +UPDATE `creature` SET `phaseMask`=128 WHERE `id`=30683; +-- Lich King flag,non attackable unless he engages first +UPDATE `creature_template` SET `unit_flags`=256 WHERE `entry`=30443; +-- Set right exp value and level for Underking Talonox +UPDATE `creature_template` SET `exp`=2,`minlevel`=79,`maxlevel`=79 WHERE `entry`=30830; +-- Set the right phase for the already existing creatures (Including Captured crusaders) +UPDATE `creature` SET `phaseMask`=1 WHERE `id` IN (31037,31039,31043,31040); +UPDATE `creature` SET `phaseMask`=2 WHERE `id` IN (30544,30407); +-- Set flag extra to 64 for creatures in Scourgeholme during the first phase,they should not give XP. +UPDATE `creature_template` SET `flags_extra`=64 WHERE `entry` IN (30544,30407); +-- Set right inhabit type for the second phase version of Wrathstrike Gargoyle (They should be able to fly) +UPDATE `creature_template` SET `InhabitType`=7 WHERE `entry`=30482; +-- Set right faction for previously not spawned creatures +UPDATE `creature_template` SET `faction_H`=2068,`faction_A`=2068 WHERE `entry` IN (30541,30203,30543,30202,30482,30830,30831,30829,30443); +-- ---------------- +-- -- Spawnfixes -- +-- ---------------- +-- Add the right mobs for each phase,they have a different id for each phase. Some mobs are only on 2 phases,not all 3 (Reanimated crusader and Gargoyles). They have the exact same points as their already spawned counterparts which belong to the final phase. +-- NOTE: The ones with a currentwaypoint set have it simply because that's the waypoint the of their already spawned counterpart. I use it simply as a guideline for me to create the paths for all these new ones and its changed back to 0 after I set the new paths with creature_addon later in this SQL. +DELETE FROM `creature` WHERE `id` IN (30596,30686,30714,30677,30443,30829,30830,30831,30203,30543,30202,30541,30482,30333,30205); +DELETE FROM `creature` WHERE `guid` BETWEEN @NEXT+83 and @NEXT+89 AND `id`=30544; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`MovementType`) VALUES +-- Add missing creatures (Highlord Tirion Fordring in Argent Vanguard after "the last line of defense",The Ebon Watcher,Crusade Architect Silas and Crusade Engineer Spitzpatrick in Valley of Echoes after "the last line of defense") +(@NEXT,30596,571,1,128,6376.657227,239.053055,396.047028,4.8044,300,0,0,0), +(@NEXT+1,30686,571,1,128,6370.632324,232.238022,396.046051,1.352186,300,0,0,0), +(@NEXT+2,30714,571,1,128,6371.689941,239.699265,396.899902,4.792617,300,0,0,0), +(@NEXT+3,30677,571,1,128,6259.583496,50.420799,388.508667,0.846391,300,0,0,0), +-- Add missing unique creatures in Scorugeholme (The Lich king,Salranax the Flesh Render,High Priest Yath'amon and Underking Talonox -- One for each phase they are in,since they are hostile mobs) +(@NEXT+4,30443,571,1,2,6697.528809,583.609131,428.332916,4.108414,300,0,0,0), +(@NEXT+5,30829,571,1,2,6838.717285,594.347046,426.230652,4.020655,300,0,0,0), +(@NEXT+6,30831,571,1,2,6869.587891,422.763397,470.783386,1.087875,300,0,0,0), +(@NEXT+7,30830,571,1,2,7211.243652,667.650146,488.187103,2.689305,300,0,0,0), +(@NEXT+8,30829,571,1,128,6838.717285,594.347046,426.230652,4.020655,300,0,0,0), +(@NEXT+9,30831,571,1,128,6869.587891,422.763397,470.783386,1.087875,300,0,0,0), +(@NEXT+10,30830,571,1,128,7211.243652,667.650146,488.187103,2.689305,300,0,0,0), +-- Forgotten Depths High Priest +(@NEXT+11,30203,571,1,2,6879.92,493.899,467.957,1.67552,300,0,0,0), +(@NEXT+12,30203,571,1,2,6916.07,467.629,468.799,0.977384,300,0,0,0), +(@NEXT+13,30203,571,1,2,6858.02,453.902,471.767,4.7822,300,0,0,0), +(@NEXT+14,30203,571,1,2,6835.59,414.643,471.77,0.802851,300,0,0,0), +(@NEXT+15,30203,571,1,2,6903.22,430.778,471.764,3.56047,300,0,0,0), +(@NEXT+16,30203,571,1,2,6881.51,391.672,471.771,1.93731,300,0,0,0), +(@NEXT+17,30203,571,1,2,6877.89,665.768,425.523,1.29154,300,0,0,0), +(@NEXT+18,30203,571,1,2,6553.27,579.069,419.185,3.90954,300,0,0,0), +(@NEXT+19,30203,571,1,2,6560.22,584.094,419.185,0.645772,300,0,0,0), +(@NEXT+20,30203,571,1,2,6747.13,456.848,419.284,1.39626,300,0,0,0), +(@NEXT+21,30203,571,1,2,7062.78,521.156,526.362,5.75959,300,0,0,0), +(@NEXT+22,30203,571,1,2,7068.11,477.927,530.313,0.558505,300,0,0,0), +(@NEXT+23,30203,571,1,2,6689.02,570.998,424.525,3.9968,300,0,0,0), +(@NEXT+24,30203,571,1,2,6745.99,449.016,419.284,4.4855,300,0,0,0), +(@NEXT+25,30203,571,1,2,6809.11,843.341,381.335,3.23154,300,0,1217160,2), +(@NEXT+26,30203,571,1,2,6901.58,727.055,420.546,3.24233,300,0,1217170,2), +(@NEXT+27,30203,571,1,2,7002.27,602.799,476.138,5.93303,300,0,1217200,2), +(@NEXT+28,30543,571,1,128,6879.92,493.899,467.957,1.67552,300,0,0,0), +(@NEXT+29,30543,571,1,128,6916.07,467.629,468.799,0.977384,300,0,0,0), +(@NEXT+30,30543,571,1,128,6858.02,453.902,471.767,4.7822,300,0,0,0), +(@NEXT+31,30543,571,1,128,6835.59,414.643,471.77,0.802851,300,0,0,0), +(@NEXT+32,30543,571,1,128,6903.22,430.778,471.764,3.56047,300,0,0,0), +(@NEXT+33,30543,571,1,128,6881.51,391.672,471.771,1.93731,300,0,0,0), +(@NEXT+34,30543,571,1,128,6877.89,665.768,425.523,1.29154,300,0,0,0), +(@NEXT+35,30543,571,1,128,6553.27,579.069,419.185,3.90954,300,0,0,0), +(@NEXT+36,30543,571,1,128,6560.22,584.094,419.185,0.645772,300,0,0,0), +(@NEXT+37,30543,571,1,128,6747.13,456.848,419.284,1.39626,300,0,0,0), +(@NEXT+38,30543,571,1,128,7062.78,521.156,526.362,5.75959,300,0,0,0), +(@NEXT+39,30543,571,1,128,7068.11,477.927,530.313,0.558505,300,0,0,0), +(@NEXT+40,30543,571,1,128,6689.02,570.998,424.525,3.9968,300,0,0,0), +(@NEXT+41,30543,571,1,128,6745.99,449.016,419.284,4.4855,300,0,0,0), +(@NEXT+42,30543,571,1,128,6809.11,843.341,381.335,3.23154,300,0,1217160,2), +(@NEXT+43,30543,571,1,128,6901.58,727.055,420.546,3.24233,300,0,1217170,2), +(@NEXT+44,30543,571,1,128,7002.27,602.799,476.138,5.93303,300,0,1217200,2), +-- Reanimated Crusader +(@NEXT+45,30202,571,1,128,6770.55,386.311,421.153,2.7317,300,5,0,1), +(@NEXT+46,30202,571,1,128,6655.04,328.894,442.276,0.929563,300,5,0,1), +(@NEXT+47,30202,571,1,128,6448.62,618.154,432.265,2.1122,300,5,0,1), +(@NEXT+48,30202,571,1,128,6471.01,562.99,438.4,3.5549,300,5,0,1), +(@NEXT+49,30202,571,1,128,6448.03,608.829,433.982,1.32629,300,5,0,1), +(@NEXT+50,30202,571,1,128,6526.88,512.588,412.274,2.77181,300,5,0,1), +(@NEXT+51,30202,571,1,128,6513.35,523.34,415.136,0.501217,300,5,0,1), +(@NEXT+52,30202,571,1,128,6556.12,636.946,408.191,1.22528,300,5,0,1), +(@NEXT+53,30202,571,1,128,6697.52,476.907,401.588,2.99677,300,5,0,1), +(@NEXT+54,30202,571,1,128,6704.82,441.489,406.499,3.35221,300,5,0,1), +(@NEXT+55,30202,571,1,128,6723.74,417.997,412.953,4.18409,300,5,0,1), +(@NEXT+56,30202,571,1,128,6644.93,422.78,401.853,3.19711,300,5,0,1), +(@NEXT+57,30202,571,1,128,6654.72,492.468,398.206,2.81552,300,5,0,1), +(@NEXT+58,30202,571,1,128,6630.65,458.047,398.995,5.84132,300,5,0,1), +(@NEXT+59,30202,571,1,128,6661.41,584.323,408.676,0.785398,300,5,0,1), +(@NEXT+60,30202,571,1,128,6518.07,616.422,410.051,2.1325,300,5,0,1), +(@NEXT+61,30202,571,1,128,6514.78,664.2,399.383,0.291176,300,5,0,1), +(@NEXT+62,30202,571,1,128,6563.32,539.29,404.559,0.919091,300,5,0,1), +(@NEXT+63,30202,571,1,128,6617.92,519.797,396.795,1.55615,300,5,0,1), +(@NEXT+64,30202,571,1,128,6643.92,633.926,404.904,1.84373,300,5,0,1), +(@NEXT+65,30202,571,1,128,6592.97,620.213,408.135,1.80125,300,5,0,1), +(@NEXT+66,30202,571,1,128,6707.83,535.834,405.493,5.84095,300,5,0,1), +(@NEXT+67,30202,571,1,128,6758.07,512.831,410.903,2.78648,300,5,0,1), +(@NEXT+68,30202,571,1,128,6764.6,535.115,415.201,3.48219,300,5,0,1), +(@NEXT+69,30202,571,1,128,6669.68,527.603,401.525,5.13205,300,5,0,1), +(@NEXT+70,30202,571,1,128,6613,590.876,403.789,2.88047,300,5,0,1), +(@NEXT+71,30202,571,1,128,6545.45,535.57,407.359,1.50529,300,5,0,1), +(@NEXT+72,30202,571,1,128,6623.12,684.658,405.968,4.4761,300,5,0,1), +(@NEXT+73,30202,571,1,128,6584.43,679.969,406.644,2.11574,300,5,0,1), +(@NEXT+74,30202,571,1,128,6576.55,460.06,408.104,0.763302,300,5,0,1), +(@NEXT+75,30202,571,1,128,6606.58,489.339,398.158,5.60417,300,5,0,1), +(@NEXT+76,30202,571,1,128,6563.66,505.381,403.489,0.430917,300,5,0,1), +(@NEXT+77,30202,571,1,128,6579.71,401.572,416.112,6.10437,300,5,0,1), +(@NEXT+78,30202,571,1,128,6632.51,382.456,412.855,5.91518,300,5,0,1), +(@NEXT+79,30202,571,1,128,6721.48,346.299,424.582,5.91108,300,5,0,1), +(@NEXT+80,30202,571,1,128,6657.63,385.761,411.832,2.05191,300,5,0,1), +(@NEXT+81,30202,571,1,128,6709.57,384.33,414.698,3.57468,300,5,0,1), +(@NEXT+82,30202,571,1,128,6722.58,492.852,405.603,5.6035,300,5,0,1), +-- Forgotten Depths Underking +(@NEXT+83,30544,571,1,2,6962.62,734.955,445.296,4.4855,300,0,0,0), +(@NEXT+84,30544,571,1,2,7056.29,572.491,497.073,2.23402,300,0,0,0), +(@NEXT+85,30544,571,1,2,7005.75,714.752,468.614,3.07178,300,0,0,0), +(@NEXT+86,30544,571,1,2,6809.11,843.341,381.335,5.7554,300,0,1217280,0), +(@NEXT+87,30544,571,1,2,6437.59,604.262,439.155,0.369627,300,0,1217310,2), +(@NEXT+89,30544,571,1,2,7002.27,602.799,476.138,5.7192,300,0,1217350,0), +(@NEXT+90,30541,571,1,128,6962.62,734.955,445.296,4.4855,300,0,0,0), +(@NEXT+91,30541,571,1,128,7056.29,572.491,497.073,2.23402,300,0,0,0), +(@NEXT+92,30541,571,1,128,7005.75,714.752,468.614,3.07178,300,0,0,0), +(@NEXT+93,30541,571,1,128,6760.42,515.039,411.837,3.66099,300,0,1217270,2), +(@NEXT+94,30541,571,1,128,6809.11,843.341,381.335,5.7554,300,0,1217280,0), +(@NEXT+95,30541,571,1,128,7002.27,602.799,476.138,5.7192,300,0,1217350,0), +(@NEXT+96,30541,571,1,128,6769.89,628.623,425.97,-1.65443,300,0,1217290,2), +(@NEXT+97,30541,571,1,128,6697.87,429.598,406.569,1.77104,300,0,1217300,2), +(@NEXT+98,30541,571,1,128,6437.59,604.262,439.155,0.369627,300,0,1217310,2), +(@NEXT+99,30541,571,1,128,6622.62,585.661,402.875,5.61246,300,0,1217320,2), +(@NEXT+100,30541,571,1,128,6710.23,685.938,408.296,3.24837,300,0,1217330,2), +(@NEXT+101,30541,571,1,128,6575.6,465.094,407.446,2.69257,300,0,1217360,2), +(@NEXT+102,30541,571,1,128,6641.92,396.595,408.673,2.55359,300,0,1217370,2), +-- Wrathstrike Gargoyle +(@NEXT+103,30482,571,1,128,7059.52,455.611,581.574,3.35148,300,0,1217550,2), +(@NEXT+104,30482,571,1,128,7009.05,544.408,610.468,3.23607,300,0,1217540,2), +(@NEXT+105,30482,571,1,128,6804.5,702.568,436.191,0.0303077,300,0,1217530,2), +(@NEXT+106,30482,571,1,128,6799.31,642.302,459.819,3.88908,300,0,1217520,2), +(@NEXT+107,30482,571,1,128,6753.66,410.408,446.625,3.19529,300,0,1217510,2), +(@NEXT+108,30482,571,1,128,6597.14,566.743,445.037,1.40898,300,0,1217500,2), +(@NEXT+109,30482,571,1,128,6596.2,564.031,445.111,4.27718,300,0,1217490,2), +(@NEXT+110,30482,571,1,128,6559.29,413.281,462.263,6.13325,300,0,1217480,2), +-- Add missing mobs in the Valley of Echoes during the first phase. The DB has no spawn info on these ones so I added them in a logical number and places,feel free to skip this part if its not "correct" enough. (If anyone has actual sniffs for the location of these mobs feel free to share) +-- Forgotten Depths Slayer for first phase (id:30333,not the same one that should appear during "The last line of defense) +(@NEXT+111,30333,571,1,2,6150.518066,147.111313,372.771057,0.197990,300,7,0,1), +(@NEXT+112,30333,571,1,2,6212.446777,130.204849,377.827118,0.657450,300,7,0,1), +(@NEXT+113,30333,571,1,2,6110.951660,83.364746,371.154419,1.230786,300,7,0,1), +(@NEXT+114,30333,571,1,2,6047.241699,178.537430,353.744293,5.322711,300,7,0,1), +(@NEXT+115,30333,571,1,2,6182.750000,199.942261,380.134705,4.996765,300,7,0,1), +(@NEXT+116,30333,571,1,2,6219.042480,236.113785,388.062317,5.134206,300,7,0,1), +(@NEXT+117,30333,571,1,2,6421.106445,188.232880,395.621826,2.247868,300,7,0,1), +(@NEXT+118,30333,571,1,2,6351.036621,91.049683,392.077698,1.969049,300,7,0,1), +(@NEXT+119,30333,571,1,2,6264.502930,147.837006,383.335876,2.346035,300,7,0,1), +-- Forgotten Depths Acolyte +(@NEXT+120,30205,571,1,2,6278.386230,199.642899,385.989258,5.377527,300,0,0,0), +(@NEXT+121,30205,571,1,2,6229.345703,133.398743,379.961639,3.759608,300,0,0,0), +(@NEXT+122,30205,571,1,2,6087.062012,136.313293,367.117310,4.827752,300,0,0,0), +(@NEXT+123,30205,571,1,2,6127.606445,172.50610,370.652832,6.190416,300,0,0,0), +(@NEXT+124,30205,571,1,2,6149.881836,220.209808,379.919403,5.361032,300,0,0,0), +(@NEXT+125,30205,571,1,2,6422.211426,148.303436,395.890137,1.964183,300,0,0,0), +(@NEXT+126,30205,571,1,2,6375.815918,81.636124,394.968140,2.337249,300,0,0,0), +(@NEXT+127,30205,571,1,2,6333.330566,29.062647,389.581329,1.508653,300,0,0,0), +(@NEXT+128,30205,571,1,2,6130.472656,172.082047,370.962646,5.695776,300,0,0,0); diff --git a/sql/updates/world/2012_05_28_06_world_creature_addon.sql b/sql/updates/world/2012_05_28_06_world_creature_addon.sql new file mode 100644 index 00000000000..a2b573da10a --- /dev/null +++ b/sql/updates/world/2012_05_28_06_world_creature_addon.sql @@ -0,0 +1,2 @@ +-- Delete forgotten data from creature_addon +DELETE FROM `creature_addon` WHERE `guid` IN (207262,207257,207254,207251,207246,207243,207241,207237); diff --git a/sql/updates/world/2012_05_28_06_world_waypoint_data.sql b/sql/updates/world/2012_05_28_06_world_waypoint_data.sql new file mode 100644 index 00000000000..1c738cacdc9 --- /dev/null +++ b/sql/updates/world/2012_05_28_06_world_waypoint_data.sql @@ -0,0 +1,524 @@ +-- The following are the paths for the newly added mobs that have the same spawn spot as a mob (different phase and id) that already had a path. The paths are exactly the same as their already spawned counterparts. +-- Pathing for newly added Wrathstrike Gargoyles +-- ----------------------------------------------------------------------------------------------------------- +SET @NEXT := 134704; +-- Wrathstrike Gargoyle 1 +SET @NPC = @NEXT+103; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@NPC,@PATH); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,7060.05,455.727,581.492,0,0,0,100,0), +(@PATH,2,6982.99,465.858,581.492,0,0,0,100,0), +(@PATH,3,6963.94,516.342,581.492,0,0,0,100,0), +(@PATH,4,7012.51,555.944,581.492,0,0,0,100,0), +(@PATH,5,7062.92,517.784,566.464,0,0,0,100,0), +(@PATH,6,7074.5,487.171,566.464,0,0,0,100,0); +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30482 AND `currentwaypoint`=1217550; +-- ----------------------------------------------------------------------------------------------------------- +-- Wrathstrike Gargoyle 2 +SET @NPC = @NEXT+104; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@NPC,@PATH); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6975.12,457.238,608.122,0,0,0,100,0), +(@PATH,2,6994.13,442.679,608.122,0,0,0,100,0), +(@PATH,3,7024.58,437.239,608.122,0,0,0,100,0), +(@PATH,4,7055.78,456.622,580.705,0,0,0,100,0), +(@PATH,5,7069.78,488.277,580.705,0,0,0,100,0), +(@PATH,6,7057.18,540.235,608.205,0,0,0,100,0), +(@PATH,7,6978.62,537.405,608.205,0,0,0,100,0), +(@PATH,8,6960.95,489.864,595.233,0,0,0,100,0); +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30482 AND `currentwaypoint`=1217540; +-- ----------------------------------------------------------------------------------------------------------- +-- Wrathstrike Gargoyle 3 +SET @NPC = @NEXT+105; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@NPC,@PATH); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6817.71,701.731,436.81,0,0,0,100,0), +(@PATH,2,6839.81,671.33,438.476,0,0,0,100,0), +(@PATH,3,6771.48,625.298,444.032,0,0,0,100,0), +(@PATH,4,6729.31,607.063,451.504,0,0,0,100,0), +(@PATH,5,6689.26,569.483,444.032,0,0,0,100,0), +(@PATH,6,6664.17,580.683,449.976,0,0,0,100,0), +(@PATH,7,6657.52,638.465,440.893,0,0,0,100,0), +(@PATH,8,6664.19,665.048,444.032,0,0,0,100,0), +(@PATH,9,6735.33,692.836,433.938,0,0,0,100,0), +(@PATH,10,6741.25,694.33,433.56,0,0,0,100,0); +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30482 AND `currentwaypoint`=1217530; +-- ----------------------------------------------------------------------------------------------------------- +-- Wrathstrike Gargoyle 4 +SET @NPC = @NEXT+106; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@NPC,@PATH); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6808.92,649.929,459.327,0,0,0,100,0), +(@PATH,2,6779.63,606.717,465.077,0,0,0,100,0), +(@PATH,3,6799.14,541.206,474.66,0,0,0,100,0), +(@PATH,4,6863.37,520.467,465.077,0,0,0,100,0), +(@PATH,5,6900.8,554.799,459.216,0,0,0,100,0), +(@PATH,6,6904.96,624.433,471.549,0,0,0,100,0), +(@PATH,7,6860.9,661.477,465.077,0,0,0,100,0); +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30482 AND `currentwaypoint`=1217520; +-- ----------------------------------------------------------------------------------------------------------- +-- Wrathstrike Gargoyle 5 +SET @NPC = @NEXT+107; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@NPC,@PATH); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6764.29,413.94,446.625,0,0,0,100,0), +(@PATH,2,6727.13,417.659,446.625,0,0,0,100,0), +(@PATH,3,6709.2,445.43,446.625,0,0,0,100,0), +(@PATH,4,6714.21,476.942,446.625,0,0,0,100,0), +(@PATH,5,6760.44,491.312,446.625,0,0,0,100,0), +(@PATH,6,6786.47,463.163,446.625,0,0,0,100,0); +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30482 AND `currentwaypoint`=1217510; +-- ----------------------------------------------------------------------------------------------------------- +-- Wrathstrike Gargoyle 6 +SET @NPC = @NEXT+108; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@NPC,@PATH); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6589.56,608.719,445.037,0,0,0,100,0), +(@PATH,2,6536.49,613.397,445.037,0,0,0,100,0), +(@PATH,3,6515.31,571.263,445.037,0,0,0,100,0), +(@PATH,4,6540.83,538.391,445.037,0,0,0,100,0), +(@PATH,5,6561.1,543.055,445.037,0,0,0,100,0), +(@PATH,6,6595.09,559.099,445.037,0,0,0,100,0); +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30482 AND `currentwaypoint`=1217500; +-- ----------------------------------------------------------------------------------------------------------- +-- Wrathstrike Gargoyle 7 +SET @NPC = @NEXT+109; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@NPC,@PATH); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6661.58,545.496,432.795,0,0,0,100,0), +(@PATH,2,6659.48,589.326,447.184,0,0,0,100,0), +(@PATH,3,6628.78,594.459,446.434,0,0,0,100,0), +(@PATH,4,6613.69,584.967,446.434,0,0,0,100,0), +(@PATH,5,6595.45,562.222,444.795,0,0,0,100,0), +(@PATH,6,6595.77,535.16,436.934,0,0,0,100,0), +(@PATH,7,6631,528.616,450.823,0,0,0,100,0); +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30482 AND `currentwaypoint`=1217490; +-- ----------------------------------------------------------------------------------------------------------- +-- Wrathstrike Gargoyle 8 +SET @NPC = @NEXT+110; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@NPC,@PATH); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6585.6,408.848,446.514,0,0,0,100,0), +(@PATH,2,6607.57,400.701,444.745,0,0,0,100,0), +(@PATH,3,6647.89,401.573,444.745,0,0,0,100,0), +(@PATH,4,6667.63,414.847,433.912,0,0,0,100,0), +(@PATH,5,6648.87,462.506,444.745,0,0,0,100,0), +(@PATH,6,6592.11,478.371,444.745,0,0,0,100,0), +(@PATH,7,6501.26,474.703,444.745,0,0,0,100,0), +(@PATH,8,6484.09,430.145,485.097,0,0,0,100,0), +(@PATH,9,6519.88,419.711,485.097,0,0,0,100,0); +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30482 AND `currentwaypoint`=1217480; +-- ----------------------------------------------------------------------------------------------------------- +-- Pathing for newly added Forgotten Depths Underkings +-- ----------------------------------------------------------------------------------------------------------- +-- Forgotten Depths Underking 1 +SET @NPC = @NEXT+96; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@NPC,@PATH); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6788.09,633.101,426.095,0,0,0,100,0), +(@PATH,2,6789.98,619.743,423.47,0,0,0,100,0), +(@PATH,3,6766.65,606.497,423.42,0,0,0,100,0), +(@PATH,4,6740.19,597.458,425.39,0,0,0,100,0), +(@PATH,5,6725.25,595.632,423.432,0,0,0,100,0), +(@PATH,6,6713.96,602.526,423.595,0,0,0,100,0), +(@PATH,7,6720.27,613.862,423.47,0,0,0,100,0), +(@PATH,8,6736.25,614.921,423.545,0,0,0,100,0), +(@PATH,9,6769.89,628.623,425.97,0,0,0,100,0); +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30541 AND `currentwaypoint`=1217290; +-- ----------------------------------------------------------------------------------------------------------- +-- Forgotten Depths Underking 2 +SET @NPC = @NEXT+97; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@NPC,@PATH); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6698.5,458.598,404.586,0,0,0,100,0), +(@PATH,2,6695.69,473.044,401.838,0,0,0,100,0), +(@PATH,3,6665,494.007,397.863,0,0,0,100,0), +(@PATH,4,6621.27,520.385,397.423,0,0,0,100,0), +(@PATH,5,6601.79,552.183,399.092,0,0,0,100,0), +(@PATH,6,6579.75,536.627,401.438,0,0,0,100,0), +(@PATH,7,6599.6,508.629,398.578,0,0,0,100,0), +(@PATH,8,6627.41,480.195,397.408,0,0,0,100,0), +(@PATH,9,6643.31,442.918,399.225,0,0,0,100,0), +(@PATH,10,6674.23,416.566,405.944,0,0,0,100,0), +(@PATH,11,6697.87,429.598,406.569,0,0,0,100,0); +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30541 AND `currentwaypoint`=1217300; +-- ----------------------------------------------------------------------------------------------------------- +-- Forgotten Depths Underking 3-A +SET @NPC = @NEXT+98; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@NPC,@PATH); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6395.82,618.184,452.633,0,0,0,100,0), +(@PATH,2,6358.26,637.18,462.167,0,0,0,100,0), +(@PATH,3,6370.71,666.535,453.289,0,0,0,100,0), +(@PATH,4,6375.45,676.189,445.42,0,0,0,100,0), +(@PATH,5,6407.42,688.589,434.416,0,0,0,100,0), +(@PATH,6,6429.66,650.562,435.434,0,0,0,100,0), +(@PATH,7,6461.86,627.093,426.405,0,0,0,100,0), +(@PATH,8,6482.61,623.854,419.051,0,0,0,100,0), +(@PATH,9,6486.97,594.615,420.488,0,0,0,100,0), +(@PATH,10,6457.97,595.352,432.948,0,0,0,100,0), +(@PATH,11,6437.59,604.262,439.155,0,0,0,100,0); +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30541 AND `currentwaypoint`=1217310; +-- ----------------------------------------------------------------------------------------------------------- +-- Forgotten Depths Underking 3-B +SET @NPC = @Next+87; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@NPC,@PATH); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6395.82,618.184,452.633,0,0,0,100,0), +(@PATH,2,6358.26,637.18,462.167,0,0,0,100,0), +(@PATH,3,6370.71,666.535,453.289,0,0,0,100,0), +(@PATH,4,6375.45,676.189,445.42,0,0,0,100,0), +(@PATH,5,6407.42,688.589,434.416,0,0,0,100,0), +(@PATH,6,6429.66,650.562,435.434,0,0,0,100,0), +(@PATH,7,6461.86,627.093,426.405,0,0,0,100,0), +(@PATH,8,6482.61,623.854,419.051,0,0,0,100,0), +(@PATH,9,6486.97,594.615,420.488,0,0,0,100,0), +(@PATH,10,6457.97,595.352,432.948,0,0,0,100,0), +(@PATH,11,6437.59,604.262,439.155,0,0,0,100,0); +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30544 AND `currentwaypoint`=1217310; +-- ----------------------------------------------------------------------------------------------------------- +-- Forgotten Depths Underking 4 +SET @NPC = @NEXT+99; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@NPC,@PATH); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6618.91,606.085,403.839,0,0,0,100,0), +(@PATH,2,6608.22,599.539,403.875,0,0,0,100,0), +(@PATH,3,6613.37,574.047,401.125,0,0,0,100,0), +(@PATH,4,6638.76,543.87,399.563,0,0,0,100,0), +(@PATH,5,6667.59,521.002,401.025,0,0,0,100,0), +(@PATH,6,6697.97,501.482,400.775,0,0,0,100,0), +(@PATH,7,6711.98,522.746,404.353,0,0,0,100,0), +(@PATH,8,6702.31,534.57,405.75,0,0,0,100,0), +(@PATH,9,6679.62,541.533,402.209,0,0,0,100,0), +(@PATH,10,6660.61,557.771,404.938,0,0,0,100,0), +(@PATH,11,6639.28,577.426,402.927,0,0,0,100,0), +(@PATH,12,6622.62,585.661,402.875,0,0,0,100,0); +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30541 AND `currentwaypoint`=1217320; +-- ----------------------------------------------------------------------------------------------------------- +-- Forgotten Depths Underking 5 +SET @NPC = @NEXT+100; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@NPC,@PATH); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6746.43,700.445,407.534,0,0,0,100,0), +(@PATH,2,6767.77,702.447,407.514,0,0,0,100,0), +(@PATH,3,6780.88,716.948,410.264,0,0,0,100,0), +(@PATH,4,6761.32,729.055,407.659,0,0,0,100,0), +(@PATH,5,6723.36,725.67,406.194,0,0,0,100,0), +(@PATH,6,6706.1,712.006,411.069,0,0,0,100,0), +(@PATH,7,6687.8,701.721,412.302,0,0,0,100,0), +(@PATH,8,6668.08,685.327,409.231,0,0,0,100,0), +(@PATH,9,6660.25,674.05,407.891,0,0,0,100,0), +(@PATH,10,6667.72,662.234,407.017,0,0,0,100,0), +(@PATH,11,6710.23,685.938,408.296,0,0,0,100,0); +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30541 AND `currentwaypoint`=1217330; +-- ----------------------------------------------------------------------------------------------------------- +-- Forgotten Depths Underking 6 +SET @NPC = @NEXT+101; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@NPC,@PATH); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6552.96,457.401,412.93,0,0,0,100,0), +(@PATH,2,6551.69,432.508,416.436,0,0,0,100,0), +(@PATH,3,6568.85,415.311,415.444,0,0,0,100,0), +(@PATH,4,6572.9,410.44,415.694,0,0,0,100,0), +(@PATH,5,6577.95,406.559,415.694,0,0,0,100,0), +(@PATH,6,6591.15,393.959,416.312,0,0,0,100,0), +(@PATH,7,6624.85,389.377,412.855,0,0,0,100,0), +(@PATH,8,6642.71,398.137,408.048,0,0,0,100,0), +(@PATH,9,6642.51,414.137,403.978,0,0,0,100,0), +(@PATH,10,6613.73,435.694,403.495,0,0,0,100,0), +(@PATH,11,6598.72,453.969,403.196,0,0,0,100,0), +(@PATH,12,6575.6,465.094,407.446,0,0,0,100,0); +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30541 AND `currentwaypoint`=1217360; +-- ----------------------------------------------------------------------------------------------------------- +-- Forgotten Depths Underking 7 +SET @NPC = @NEXT+102; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@NPC,@PATH); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6665.69,385.118,411.923,0,0,0,100,0), +(@PATH,2,6688.12,372.121,414.309,0,0,0,100,0), +(@PATH,3,6681.71,337.864,421.782,0,0,0,100,0), +(@PATH,4,6711.15,330.663,422.912,0,0,0,100,0), +(@PATH,5,6729,353.407,426.957,0,0,0,100,0), +(@PATH,6,6759.39,371.963,426.169,0,0,0,100,0), +(@PATH,7,6742.83,378.436,419.544,0,0,0,100,0), +(@PATH,8,6710.78,380.507,415.679,0,0,0,100,0), +(@PATH,9,6685.82,397.148,408.809,0,0,0,100,0), +(@PATH,10,6655.42,406.866,405.478,0,0,0,100,0), +(@PATH,11,6641.92,396.595,408.673,0,0,0,100,0); +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30541 AND `currentwaypoint`=1217370; +-- ----------------------------------------------------------------------------------------------------------- +-- Forgotten Depths Underking 8 +SET @NPC = @NEXT+93; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@NPC,@PATH); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6751.58,521.709,409.087,0,0,0,100,0), +(@PATH,2,6775.59,535.639,418.22,0,0,0,100,0), +(@PATH,3,6790.69,546.924,424.095,0,0,0,100,0), +(@PATH,4,6797.82,545.099,424.47,0,0,0,100,0), +(@PATH,5,6787.22,530.424,421.059,0,0,0,100,0), +(@PATH,6,6760.42,515.039,411.837,0,0,0,100,0); +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30541 AND `currentwaypoint`=1217270; +-- ----------------------------------------------------------------------------------------------------------- +-- Pathing for newly added Forgotten Depths High Priests. There are A and B versions because only the ones from the last phase were already spawned in DB and had their pathing. This didn't occur with the Forgotten Depths Underkings because their first phase counterpats were already spawned (at least the ones with paths,the rest weren't). 2 of them don't get the current waypoint removed yet because its used for a guideline for creature_formations later. +-- ----------------------------------------------------------------------------------------------------------- +-- Forgotten Depths High Priest 1-A +SET @NPC = @NEXT+25; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@NPC,@PATH); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6845.23,827.966,390.654,0,0,0,100,0), +(@PATH,2,6869.87,814.437,394.231,0,0,0,100,0), +(@PATH,3,6885.91,795.247,398.76,0,0,0,100,0), +(@PATH,4,6889.42,776.747,410.135,0,0,0,100,0), +(@PATH,5,6887.17,765.483,417.106,0,0,0,100,0), +(@PATH,6,6916.54,751.385,415.552,0,0,0,100,0), +(@PATH,7,6922.71,770.234,412.379,0,0,0,100,0), +(@PATH,8,6936.68,795.657,409.292,0,0,0,100,0), +(@PATH,9,6946.95,821.291,405.551,0,0,0,100,0), +(@PATH,10,6940.67,819.911,406.551,0,0,0,100,0), +(@PATH,11,6918.09,776.126,411.879,0,0,0,100,0), +(@PATH,12,6903.68,745.868,416.802,0,0,0,100,0), +(@PATH,13,6892.57,727.713,418.396,0,0,0,100,0), +(@PATH,14,6855.19,723.309,414.328,0,0,0,100,0), +(@PATH,15,6810.95,714.736,409.567,0,0,0,100,0), +(@PATH,16,6778.23,711.31,408.139,0,0,0,100,0), +(@PATH,17,6749.77,708.742,407.159,0,0,0,100,0), +(@PATH,18,6724.11,709.65,409.563,0,0,0,100,0), +(@PATH,19,6720.02,695.631,407.296,0,0,0,100,0), +(@PATH,20,6730.44,731.649,404.319,0,0,0,100,0), +(@PATH,21,6727.1,774.371,385.328,0,0,0,100,0), +(@PATH,22,6722.82,816.964,376.654,0,0,0,100,0), +(@PATH,23,6733.84,849.984,376.012,0,0,0,100,0), +(@PATH,24,6753.25,867.14,376.46,0,0,0,100,0), +(@PATH,25,6786.71,850.127,379.337,0,0,0,100,0), +(@PATH,26,6817.16,840.912,382.21,0,0,0,100,0); +-- ----------------------------------------------------------------------------------------------------------- +-- Forgotten Depths High Priest 1-B +SET @NPC = @NEXT+42; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@NPC,@PATH); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6845.23,827.966,390.654,0,0,0,100,0), +(@PATH,2,6869.87,814.437,394.231,0,0,0,100,0), +(@PATH,3,6885.91,795.247,398.76,0,0,0,100,0), +(@PATH,4,6889.42,776.747,410.135,0,0,0,100,0), +(@PATH,5,6887.17,765.483,417.106,0,0,0,100,0), +(@PATH,6,6916.54,751.385,415.552,0,0,0,100,0), +(@PATH,7,6922.71,770.234,412.379,0,0,0,100,0), +(@PATH,8,6936.68,795.657,409.292,0,0,0,100,0), +(@PATH,9,6946.95,821.291,405.551,0,0,0,100,0), +(@PATH,10,6940.67,819.911,406.551,0,0,0,100,0), +(@PATH,11,6918.09,776.126,411.879,0,0,0,100,0), +(@PATH,12,6903.68,745.868,416.802,0,0,0,100,0), +(@PATH,13,6892.57,727.713,418.396,0,0,0,100,0), +(@PATH,14,6855.19,723.309,414.328,0,0,0,100,0), +(@PATH,15,6810.95,714.736,409.567,0,0,0,100,0), +(@PATH,16,6778.23,711.31,408.139,0,0,0,100,0), +(@PATH,17,6749.77,708.742,407.159,0,0,0,100,0), +(@PATH,18,6724.11,709.65,409.563,0,0,0,100,0), +(@PATH,19,6720.02,695.631,407.296,0,0,0,100,0), +(@PATH,20,6730.44,731.649,404.319,0,0,0,100,0), +(@PATH,21,6727.1,774.371,385.328,0,0,0,100,0), +(@PATH,22,6722.82,816.964,376.654,0,0,0,100,0), +(@PATH,23,6733.84,849.984,376.012,0,0,0,100,0), +(@PATH,24,6753.25,867.14,376.46,0,0,0,100,0), +(@PATH,25,6786.71,850.127,379.337,0,0,0,100,0), +(@PATH,26,6817.16,840.912,382.21,0,0,0,100,0); +-- ----------------------------------------------------------------------------------------------------------- +-- Forgotten Depths High Priest 2-A +SET @NPC = @NEXT+26; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@NPC,@PATH); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6877.06,727.294,415.646,0,0,0,100,0), +(@PATH,2,6840.86,720.367,413.578,0,0,0,100,0), +(@PATH,3,6804.06,715.519,409.067,0,0,0,100,0), +(@PATH,4,6775.7,711.378,408.139,0,0,0,100,0), +(@PATH,5,6775.7,706.114,408.014,0,0,0,100,0), +(@PATH,6,6806.69,710.446,409.317,0,0,0,100,0), +(@PATH,7,6840.86,715.128,414.078,0,0,0,100,0), +(@PATH,8,6885.64,719.654,417.771,0,0,0,100,0), +(@PATH,9,6901.58,727.055,420.546,0,0,0,100,0); +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30203 AND `currentwaypoint`=1217170; +-- ----------------------------------------------------------------------------------------------------------- +-- Forgotten Depths High Priest 2-B +SET @NPC = @NEXT+43; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@NPC,@PATH); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6877.06,727.294,415.646,0,0,0,100,0), +(@PATH,2,6840.86,720.367,413.578,0,0,0,100,0), +(@PATH,3,6804.06,715.519,409.067,0,0,0,100,0), +(@PATH,4,6775.7,711.378,408.139,0,0,0,100,0), +(@PATH,5,6775.7,706.114,408.014,0,0,0,100,0), +(@PATH,6,6806.69,710.446,409.317,0,0,0,100,0), +(@PATH,7,6840.86,715.128,414.078,0,0,0,100,0), +(@PATH,8,6885.64,719.654,417.771,0,0,0,100,0), +(@PATH,9,6901.58,727.055,420.546,0,0,0,100,0); +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30543 AND `currentwaypoint`=1217170; +-- ----------------------------------------------------------------------------------------------------------- +-- Forgotten Depths High Priest 3-A +SET @NPC = @NEXT+27; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@NPC,@PATH); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,7028.06,593.528,484.848,0,0,0,100,0), +(@PATH,2,7050.86,587.232,490.487,0,0,0,100,0), +(@PATH,3,7088.02,583.536,496.767,0,0,0,100,0), +(@PATH,4,7135.53,587.626,498.11,0,0,0,100,0), +(@PATH,5,7174.15,581.088,498.373,0,0,0,100,0), +(@PATH,6,7200,579.166,498.248,0,0,0,100,0), +(@PATH,7,7217.31,586.021,496.983,0,0,0,100,0), +(@PATH,8,7203.83,615.728,490.388,0,0,0,100,0), +(@PATH,9,7164.62,625.286,496.707,0,0,0,100,0), +(@PATH,10,7126.29,619.13,497.944,0,0,0,100,0), +(@PATH,11,7094.89,587.951,498.017,0,0,0,100,0), +(@PATH,12,7050.28,590.763,490.362,0,0,0,100,0), +(@PATH,13,7013.81,602.295,479.513,0,0,0,100,0), +(@PATH,14,6987.71,624.076,465.805,0,0,0,100,0), +(@PATH,15,6964.91,625.148,460.924,0,0,0,100,0), +(@PATH,16,6944.73,587.153,467.576,0,0,0,100,0), +(@PATH,17,6927.86,556.953,466.828,0,0,0,100,0), +(@PATH,18,6919.79,527.804,467.056,0,0,0,100,0), +(@PATH,19,6907.68,497.326,466.719,0,0,0,100,0), +(@PATH,20,6914.34,512.11,466.681,0,0,0,100,0), +(@PATH,21,6926.01,537.956,466.578,0,0,0,100,0), +(@PATH,22,6938.29,577.003,466.951,0,0,0,100,0), +(@PATH,23,6952.16,594.699,466.951,0,0,0,100,0), +(@PATH,24,6969.78,616.559,463.68,0,0,0,100,0), +(@PATH,25,6985.14,615.594,467.305,0,0,0,100,0), +(@PATH,26,7002.27,602.799,476.138,0,0,0,100,0); +-- ----------------------------------------------------------------------------------------------------------- +-- Forgotten Depths High Priest 3-B +SET @NPC = @NEXT+44; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@NPC,@PATH); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,7028.06,593.528,484.848,0,0,0,100,0), +(@PATH,2,7050.86,587.232,490.487,0,0,0,100,0), +(@PATH,3,7088.02,583.536,496.767,0,0,0,100,0), +(@PATH,4,7135.53,587.626,498.11,0,0,0,100,0), +(@PATH,5,7174.15,581.088,498.373,0,0,0,100,0), +(@PATH,6,7200,579.166,498.248,0,0,0,100,0), +(@PATH,7,7217.31,586.021,496.983,0,0,0,100,0), +(@PATH,8,7203.83,615.728,490.388,0,0,0,100,0), +(@PATH,9,7164.62,625.286,496.707,0,0,0,100,0), +(@PATH,10,7126.29,619.13,497.944,0,0,0,100,0), +(@PATH,11,7094.89,587.951,498.017,0,0,0,100,0), +(@PATH,12,7050.28,590.763,490.362,0,0,0,100,0), +(@PATH,13,7013.81,602.295,479.513,0,0,0,100,0), +(@PATH,14,6987.71,624.076,465.805,0,0,0,100,0), +(@PATH,15,6964.91,625.148,460.924,0,0,0,100,0), +(@PATH,16,6944.73,587.153,467.576,0,0,0,100,0), +(@PATH,17,6927.86,556.953,466.828,0,0,0,100,0), +(@PATH,18,6919.79,527.804,467.056,0,0,0,100,0), +(@PATH,19,6907.68,497.326,466.719,0,0,0,100,0), +(@PATH,20,6914.34,512.11,466.681,0,0,0,100,0), +(@PATH,21,6926.01,537.956,466.578,0,0,0,100,0), +(@PATH,22,6938.29,577.003,466.951,0,0,0,100,0), +(@PATH,23,6952.16,594.699,466.951,0,0,0,100,0), +(@PATH,24,6969.78,616.559,463.68,0,0,0,100,0), +(@PATH,25,6985.14,615.594,467.305,0,0,0,100,0), +(@PATH,26,7002.27,602.799,476.138,0,0,0,100,0); +-- -------------------------------------------------------------------------------------------------- +-- Create creature formations based on already existing ones. Also remove the final current waypoints. +-- Creature Formation 1-A +-- -------------------------------------------------------------------------------------------------- +SET @LEADER = @NEXT+27; +SET @NPC = @NEXT+89; +DELETE FROM `creature_formations` WHERE `leaderGUID`=@LEADER; +INSERT INTO `creature_formations` (`leaderGUID`,`memberGUID`,`dist`,`angle`,`groupAI`) VALUES +(@LEADER,@LEADER,0,0,2), +(@LEADER,@NPC,3,0,2); +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30203 AND `currentwaypoint`=1217200; +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30544 AND `currentwaypoint`=1217350; +-- Creature Formation 1-B +SET @LEADER = @NEXT+44; +SET @NPC = @NEXT+95; +DELETE FROM `creature_formations` WHERE `leaderGUID`=@LEADER; +INSERT INTO `creature_formations` (`leaderGUID`,`memberGUID`,`dist`,`angle`,`groupAI`) VALUES +(@LEADER,@LEADER,0,0,2), +(@LEADER,@NPC,3,0,2); +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30543 AND `currentwaypoint`=1217200; +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30541 AND `currentwaypoint`=1217350; +-- Creature Formation 2-A +SET @LEADER = @NEXT+25; +SET @NPC = @NEXT+86; +DELETE FROM `creature_formations` WHERE `leaderGUID`=@LEADER; +INSERT INTO `creature_formations` (`leaderGUID`,`memberGUID`,`dist`,`angle`,`groupAI`) VALUES +(@LEADER,@LEADER,0,0,2), +(@LEADER,@NPC,3,0,2); +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30203 AND `currentwaypoint`=1217160; +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30544 AND `currentwaypoint`=1217280; +-- Creature Formation 2-B +SET @LEADER = @NEXT+42; +SET @NPC = @NEXT+94; +DELETE FROM `creature_formations` WHERE `leaderGUID`=@LEADER; +INSERT INTO `creature_formations` (`leaderGUID`,`memberGUID`,`dist`,`angle`,`groupAI`) VALUES +(@LEADER,@LEADER,0,0,2), +(@LEADER,@NPC,3,0,2); +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30543 AND `currentwaypoint`=1217160; +UPDATE `creature` SET `currentwaypoint`=0 WHERE `id`=30541 AND `currentwaypoint`=1217280; diff --git a/sql/updates/world/2012_05_28_07_world_quest_template.sql b/sql/updates/world/2012_05_28_07_world_quest_template.sql new file mode 100644 index 00000000000..3cdf1895a9d --- /dev/null +++ b/sql/updates/world/2012_05_28_07_world_quest_template.sql @@ -0,0 +1,20 @@ +-- Correct Quest chaining and requirements up until the quest "Crusader's Pinnacle", when the Argent Base in the pinnacle phases in +UPDATE `quest_template` SET `PrevQuestId`=13036, `NextQuestId`=13044, `ExclusiveGroup`=-13008 WHERE `id`=13008; -- Scourge Tactics +UPDATE `quest_template` SET `PrevQuestId`=13036, `NextQuestId`=13044, `ExclusiveGroup`=-13008 WHERE `id`=13039; -- Defending The Vanguard +UPDATE `quest_template` SET `PrevQuestId`=13036, `NextQuestId`=13044, `ExclusiveGroup`=-13008 WHERE `id`=13040; -- Curing The Incurable +UPDATE `quest_template` SET `PrevQuestId`=0, `NextQuestId`=13045, `ExclusiveGroup`=0, `NextQuestIdChain`=13045 WHERE `id`=13044; -- If There Are Survivors +UPDATE `quest_template` SET `PrevQuestId`=13044, `NextQuestId`=13070, `ExclusiveGroup`=0, `NextQuestIdChain`=13070 WHERE `id`=13045; -- Into The Wild Green Yonder +UPDATE `quest_template` SET `Method`=0, `PrevQuestId`=13045, `NextQuestId`=13086, `ExclusiveGroup`=0, `NextQuestIdChain`=13086 WHERE `id`=13070; -- A Cold Front Approaches +UPDATE `quest_template` SET `PrevQuestId`=13070, `NextQuestId`=0, `ExclusiveGroup`=0, `NextQuestidChain`=0 WHERE `id`=13086; -- The Last Line Of Defense +-- Fix restrictions for DK and all rest classes without DK +UPDATE `quest_template` SET `PrevQuestId`=13086, `RequiredClasses`=32,`NextQuestId`=0, `ExclusiveGroup`=0, `NextQuestIdChain`=0 WHERE `id`=13104; -- Once More Unto The Breach, Hero /Death Knight's Special/ +UPDATE `quest_template` SET `PrevQuestId`=13086, `RequiredClasses`=1502,`NextQuestId`=0, `ExclusiveGroup`=0, `NextQuestIdChain`=0 WHERE `id`=13105; -- Once More Unto The Breach, Hero +UPDATE `quest_template` SET `PrevQuestId`=13104, `NextQuestId`=13139, `ExclusiveGroup`=-13122, `NextQuestIdChain`=0 WHERE `id`=13122; -- The Scourgestone +UPDATE `quest_template` SET `PrevQuestId`=13104, `NextQuestId`=13139, `ExclusiveGroup`=-13122, `NextQuestIdChain`=0 WHERE `id`=13118; -- The Purging of Scourgeholme +UPDATE `quest_template` SET `PrevQuestId`=13104, `NextQuestId`=13139, `ExclusiveGroup`=-13122, `NextQuestIdChain`=0 WHERE `id`=13110; -- The Restless Dead +UPDATE `quest_template` SET `PrevQuestId`=13104, `NextQuestId`=13139, `ExclusiveGroup`=-13122, `NextQuestIdChain`=0 WHERE `id`=13125; -- The Air Stands Still +UPDATE `quest_template` SET `PrevQuestId`=13104, `NextQuestId`=13139, `ExclusiveGroup`=-13122, `NextQuestIdChain`=0 WHERE `id`=13130; -- The Stone That Started a Revolution +UPDATE `quest_template` SET `PrevQuestId`=13104, `NextQuestId`=13139, `ExclusiveGroup`=-13122, `NextQuestIdChain`=0 WHERE `id`=13135; -- It Could Kill Us All +UPDATE `quest_template` SET `PrevQuestId`=0, `NextQuestId`=13141, `ExclusiveGroup`=0, `NextQuestIdChain`=13141 WHERE `id`=13139; -- Into The Cold Heart Of Northrend +UPDATE `quest_template` SET `PrevQuestId`=13139, `NextQuestId`=13157, `ExclusiveGroup`=0, `NextQuestIdChain`=13157 WHERE `id`=13141; -- The Battle For Crusader`s Pinnacle +UPDATE `quest_template` SET `PrevQuestId`=13141, `NextQuestId`=0, `ExclusiveGroup`=0, `NextQuestIdChain`=0 WHERE `id`=13135; -- The Crusader's Pinnacle diff --git a/src/server/authserver/Realms/RealmList.cpp b/src/server/authserver/Realms/RealmList.cpp index 245b9c7cc8c..d988b940809 100755 --- a/src/server/authserver/Realms/RealmList.cpp +++ b/src/server/authserver/Realms/RealmList.cpp @@ -31,7 +31,7 @@ void RealmList::Initialize(uint32 updateInterval) UpdateRealms(true); } -void RealmList::UpdateRealm(uint32 ID, const std::string& name, const std::string& address, uint32 port, uint8 icon, uint8 color, uint8 timezone, AccountTypes allowedSecurityLevel, float popu, uint32 build) +void RealmList::UpdateRealm(uint32 ID, const std::string& name, const std::string& address, uint16 port, uint8 icon, RealmFlags flag, uint8 timezone, AccountTypes allowedSecurityLevel, float popu, uint32 build) { // Create new if not exist or update existed Realm& realm = m_realms[name]; @@ -39,7 +39,7 @@ void RealmList::UpdateRealm(uint32 ID, const std::string& name, const std::strin realm.m_ID = ID; realm.name = name; realm.icon = icon; - realm.color = color; + realm.flag = flag; realm.timezone = timezone; realm.allowedSecurityLevel = allowedSecurityLevel; realm.populationLevel = popu; @@ -70,7 +70,7 @@ void RealmList::UpdateRealms(bool init) { sLog->outDetail("Updating Realm List..."); - PreparedStatement *stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_REALMLIST); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_REALMLIST); PreparedQueryResult result = LoginDatabase.Query(stmt); // Circle through results and add them to the realm map @@ -79,18 +79,18 @@ void RealmList::UpdateRealms(bool init) do { Field* fields = result->Fetch(); - uint32 realmId = fields[0].GetUInt32(); - const std::string& name = fields[1].GetString(); + uint32 realmId = fields[0].GetUInt32(); + const std::string& name = fields[1].GetString(); const std::string& address = fields[2].GetString(); - uint32 port = fields[3].GetUInt32(); - uint8 icon = fields[4].GetUInt8(); - uint8 color = fields[5].GetUInt8(); - uint8 timezone = fields[6].GetUInt8(); + uint16 port = fields[3].GetUInt16(); + uint8 icon = fields[4].GetUInt8(); + RealmFlags flag = RealmFlags(fields[5].GetUInt8()); + uint8 timezone = fields[6].GetUInt8(); uint8 allowedSecurityLevel = fields[7].GetUInt8(); - float pop = fields[8].GetFloat(); - uint32 build = fields[9].GetUInt32(); + float pop = fields[8].GetFloat(); + uint32 build = fields[9].GetUInt32(); - UpdateRealm(realmId, name, address, port, icon, color, timezone, (allowedSecurityLevel <= SEC_ADMINISTRATOR ? AccountTypes(allowedSecurityLevel) : SEC_ADMINISTRATOR), pop, build); + UpdateRealm(realmId, name, address, port, icon, flag, timezone, (allowedSecurityLevel <= SEC_ADMINISTRATOR ? AccountTypes(allowedSecurityLevel) : SEC_ADMINISTRATOR), pop, build); if (init) sLog->outString("Added realm \"%s\".", fields[1].GetCString()); diff --git a/src/server/authserver/Realms/RealmList.h b/src/server/authserver/Realms/RealmList.h index 698026876fb..c8407b0fea1 100755 --- a/src/server/authserver/Realms/RealmList.h +++ b/src/server/authserver/Realms/RealmList.h @@ -23,13 +23,26 @@ #include #include "Common.h" +enum RealmFlags +{ + REALM_FLAG_NONE = 0x00, + REALM_FLAG_INVALID = 0x01, + REALM_FLAG_OFFLINE = 0x02, + REALM_FLAG_SPECIFYBUILD = 0x04, + REALM_FLAG_UNK1 = 0x08, + REALM_FLAG_UNK2 = 0x10, + REALM_FLAG_RECOMMENDED = 0x20, + REALM_FLAG_NEW = 0x40, + REALM_FLAG_FULL = 0x80 +}; + // Storage object for a realm struct Realm { std::string address; std::string name; uint8 icon; - uint8 color; + RealmFlags flag; uint8 timezone; uint32 m_ID; AccountTypes allowedSecurityLevel; @@ -58,7 +71,7 @@ public: private: void UpdateRealms(bool init=false); - void UpdateRealm(uint32 ID, const std::string& name, const std::string& address, uint32 port, uint8 icon, uint8 color, uint8 timezone, AccountTypes allowedSecurityLevel, float popu, uint32 build); + void UpdateRealm(uint32 ID, const std::string& name, const std::string& address, uint16 port, uint8 icon, RealmFlags flag, uint8 timezone, AccountTypes allowedSecurityLevel, float popu, uint32 build); RealmMap m_realms; uint32 m_UpdateInterval; diff --git a/src/server/authserver/Server/AuthSocket.cpp b/src/server/authserver/Server/AuthSocket.cpp index 2698c3e30e1..2537a93fe43 100755 --- a/src/server/authserver/Server/AuthSocket.cpp +++ b/src/server/authserver/Server/AuthSocket.cpp @@ -849,7 +849,7 @@ bool AuthSocket::_HandleRealmList() pkt << i->second.icon; // realm type pkt << lock; // if 1, then realm locked - pkt << i->second.color; // if 2, then realm is offline + pkt << uint8(i->second.flag); // RealmFlags pkt << i->first; pkt << i->second.address; pkt << i->second.populationLevel; @@ -857,6 +857,15 @@ bool AuthSocket::_HandleRealmList() pkt << i->second.timezone; // realm category pkt << uint8(0x2C); // unk, may be realm number/id? + if (i->second.flag & REALM_FLAG_SPECIFYBUILD) + { + // TODO: Make this customizable + pkt << uint8(3); + pkt << uint8(3); + pkt << uint8(5); + pkt << uint16(12340); + } + ++RealmListSize; } diff --git a/src/server/authserver/Server/AuthSocket.h b/src/server/authserver/Server/AuthSocket.h index 0b04c8d015d..edd2b345183 100755 --- a/src/server/authserver/Server/AuthSocket.h +++ b/src/server/authserver/Server/AuthSocket.h @@ -23,19 +23,6 @@ #include "BigNumber.h" #include "RealmSocket.h" -enum RealmFlags -{ - REALM_FLAG_NONE = 0x00, - REALM_FLAG_INVALID = 0x01, - REALM_FLAG_OFFLINE = 0x02, - REALM_FLAG_SPECIFYBUILD = 0x04, - REALM_FLAG_UNK1 = 0x08, - REALM_FLAG_UNK2 = 0x10, - REALM_FLAG_RECOMMENDED = 0x20, - REALM_FLAG_NEW = 0x40, - REALM_FLAG_FULL = 0x80 -}; - // Handle login commands class AuthSocket: public RealmSocket::Session { diff --git a/src/server/authserver/authserver.conf.dist b/src/server/authserver/authserver.conf.dist index 86423d53e18..e9ed4bd752d 100644 --- a/src/server/authserver/authserver.conf.dist +++ b/src/server/authserver/authserver.conf.dist @@ -110,6 +110,14 @@ DebugLogMask = 64 SQLDriverLogFile = "" +# +# SQLDriverQueryLogging +# Description: Log SQL queries to the SQLDriverLogFile and console. +# Default: 0 - (Disabled, Query errors only) +# 1 - (Enabled, Full query logging - may have performance impact) + +SQLDriverQueryLogging = 0 + # # LogTimestamp # Description: Append timestamp to the server log file name. diff --git a/src/server/collision/Management/VMapManager2.cpp b/src/server/collision/Management/VMapManager2.cpp index 81b97f5f352..b9f0f25c2f9 100644 --- a/src/server/collision/Management/VMapManager2.cpp +++ b/src/server/collision/Management/VMapManager2.cpp @@ -30,6 +30,7 @@ #include #include #include "DisableMgr.h" +#include "DBCStores.h" using G3D::Vector3; @@ -233,8 +234,8 @@ namespace VMAP { floor = info.ground_Z; ASSERT(floor < std::numeric_limits::max()); - type = info.hitModel->GetLiquidType(); - if (reqLiquidType && !(type & reqLiquidType)) + type = info.hitModel->GetLiquidType(); // entry from LiquidType.dbc + if (reqLiquidType && !(GetLiquidFlags(type) & reqLiquidType)) return false; if (info.hitInstance->GetLiquidLevel(pos, info, level)) return true; @@ -245,7 +246,7 @@ namespace VMAP return false; } - WorldModel* VMapManager2::acquireModelInstance(const std::string& basepath, const std::string& filename, uint32 flags/* Only used when creating the model */) + WorldModel* VMapManager2::acquireModelInstance(const std::string& basepath, const std::string& filename) { //! Critical section, thread safe access to iLoadedModelFiles TRINITY_GUARD(ACE_Thread_Mutex, LoadedModelFilesLock); @@ -261,7 +262,6 @@ namespace VMAP return NULL; } sLog->outDebug(LOG_FILTER_MAPS, "VMapManager2: loading file '%s%s'", basepath.c_str(), filename.c_str()); - worldmodel->Flags = flags; model = iLoadedModelFiles.insert(std::pair(filename, ManagedModel())).first; model->second.setModel(worldmodel); } diff --git a/src/server/collision/Management/VMapManager2.h b/src/server/collision/Management/VMapManager2.h index 4b66a2e9fc7..1fba108388a 100755 --- a/src/server/collision/Management/VMapManager2.h +++ b/src/server/collision/Management/VMapManager2.h @@ -103,7 +103,7 @@ namespace VMAP bool getAreaInfo(unsigned int pMapId, float x, float y, float& z, uint32& flags, int32& adtId, int32& rootId, int32& groupId) const; bool GetLiquidLevel(uint32 pMapId, float x, float y, float z, uint8 reqLiquidType, float& level, float& floor, uint32& type) const; - WorldModel* acquireModelInstance(const std::string& basepath, const std::string& filename, uint32 flags = 0); + WorldModel* acquireModelInstance(const std::string& basepath, const std::string& filename); void releaseModelInstance(const std::string& filename); // what's the use of this? o.O diff --git a/src/server/collision/Maps/MapTree.cpp b/src/server/collision/Maps/MapTree.cpp index f94f9bbf52b..f4a3f1c7b30 100644 --- a/src/server/collision/Maps/MapTree.cpp +++ b/src/server/collision/Maps/MapTree.cpp @@ -309,7 +309,7 @@ namespace VMAP #endif if (!iIsTiled && ModelSpawn::readFromFile(rf, spawn)) { - WorldModel* model = vm->acquireModelInstance(iBasePath, spawn.name, spawn.flags); + WorldModel* model = vm->acquireModelInstance(iBasePath, spawn.name); sLog->outDebug(LOG_FILTER_MAPS, "StaticMapTree::InitMap() : loading %s", spawn.name.c_str()); if (model) { @@ -380,7 +380,7 @@ namespace VMAP if (result) { // acquire model instance - WorldModel* model = vm->acquireModelInstance(iBasePath, spawn.name, spawn.flags); + WorldModel* model = vm->acquireModelInstance(iBasePath, spawn.name); if (!model) sLog->outError("StaticMapTree::LoadMapTile() : could not acquire WorldModel pointer [%u, %u]", tileX, tileY); diff --git a/src/server/collision/Maps/TileAssembler.cpp b/src/server/collision/Maps/TileAssembler.cpp index 68ea3ec80cd..e7693a70de4 100644 --- a/src/server/collision/Maps/TileAssembler.cpp +++ b/src/server/collision/Maps/TileAssembler.cpp @@ -335,7 +335,7 @@ namespace VMAP void TileAssembler::exportGameobjectModels() { - FILE* model_list = fopen((iSrcDir + "/" + GAMEOBJECT_MODELS).c_str(), "rb"); + FILE* model_list = fopen((iSrcDir + "/" + "temp_gameobject_models").c_str(), "rb"); FILE* model_list_copy = fopen((iDestDir + "/" + GAMEOBJECT_MODELS).c_str(), "wb"); if (!model_list || !model_list_copy) return; diff --git a/src/server/collision/Models/GameObjectModel.cpp b/src/server/collision/Models/GameObjectModel.cpp index 1abbc59a5b0..84c736c22e8 100644 --- a/src/server/collision/Models/GameObjectModel.cpp +++ b/src/server/collision/Models/GameObjectModel.cpp @@ -33,6 +33,8 @@ using G3D::Vector3; using G3D::Ray; using G3D::AABox; +#ifndef NO_CORE_FUNCS + struct GameobjectModelData { GameobjectModelData(const std::string& name_, const AABox& box) : @@ -47,23 +49,30 @@ ModelList model_list; void LoadGameObjectModelList() { + uint32 oldMSTime = getMSTime(); FILE* model_list_file = fopen((sWorld->GetDataPath() + "vmaps/" + VMAP::GAMEOBJECT_MODELS).c_str(), "rb"); if (!model_list_file) + { + sLog->outError("Unable to open '%s' file.", VMAP::GAMEOBJECT_MODELS); return; + } uint32 name_length, displayId; char buff[500]; - while (!feof(model_list_file)) + while (true) { Vector3 v1, v2; - if (fread(&displayId, sizeof(uint32), 1, model_list_file) != 1 - || fread(&name_length, sizeof(uint32), 1, model_list_file) != 1 + if (fread(&displayId, sizeof(uint32), 1, model_list_file) != 1) + if (feof(model_list_file)) // EOF flag is only set after failed reading attempt + break; + + if (fread(&name_length, sizeof(uint32), 1, model_list_file) != 1 || name_length >= sizeof(buff) || fread(&buff, sizeof(char), name_length, model_list_file) != name_length || fread(&v1, sizeof(Vector3), 1, model_list_file) != 1 || fread(&v2, sizeof(Vector3), 1, model_list_file) != 1) { - printf("\nFile '%s' seems to be corrupted", VMAP::GAMEOBJECT_MODELS); + sLog->outError("File '%s' seems to be corrupted!", VMAP::GAMEOBJECT_MODELS); break; } @@ -72,7 +81,10 @@ void LoadGameObjectModelList() ModelList::value_type( displayId, GameobjectModelData(std::string(buff,name_length),AABox(v1,v2)) ) ); } + fclose(model_list_file); + sLog->outString(">> Loaded %u GameObject models in %u ms", uint32(model_list.size()), GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } GameObjectModel::~GameObjectModel() @@ -91,7 +103,7 @@ bool GameObjectModel::initialize(const GameObject& go, const GameObjectDisplayIn // ignore models with no bounds if (mdl_box == G3D::AABox::zero()) { - std::cout << "Model " << it->second.name << " has zero bounds, loading skipped" << std::endl; + sLog->outError("GameObject model %s has zero bounds, loading skipped", it->second.name.c_str()); return false; } @@ -171,3 +183,5 @@ bool GameObjectModel::intersectRay(const G3D::Ray& ray, float& MaxDist, bool Sto } return hit; } + +#endif diff --git a/src/server/collision/Models/WorldModel.cpp b/src/server/collision/Models/WorldModel.cpp index cda34510058..b818232fb32 100644 --- a/src/server/collision/Models/WorldModel.cpp +++ b/src/server/collision/Models/WorldModel.cpp @@ -392,9 +392,8 @@ namespace VMAP uint32 GroupModel::GetLiquidType() const { - // convert to type mask, matching MAP_LIQUID_TYPE_* defines in Map.h if (iLiquid) - return (1 << iLiquid->GetType()); + return iLiquid->GetType(); return 0; } @@ -421,9 +420,6 @@ namespace VMAP bool WorldModel::IntersectRay(const G3D::Ray &ray, float &distance, bool stopAtFirstHit) const { - // M2 models are not taken into account for LoS calculation - if (Flags & MOD_M2) - return false; // small M2 workaround, maybe better make separate class with virtual intersection funcs // in any case, there's no need to use a bound tree if we only have one submodel if (groupModels.size() == 1) diff --git a/src/server/collision/Models/WorldModel.h b/src/server/collision/Models/WorldModel.h index dbaccb58573..ebf828e4935 100755 --- a/src/server/collision/Models/WorldModel.h +++ b/src/server/collision/Models/WorldModel.h @@ -113,7 +113,6 @@ namespace VMAP bool GetLocationInfo(const G3D::Vector3 &p, const G3D::Vector3 &down, float &dist, LocationInfo &info) const; bool writeFile(const std::string &filename); bool readFile(const std::string &filename); - uint32 Flags; protected: uint32 RootWMOID; std::vector groupModels; diff --git a/src/server/collision/VMapDefinitions.h b/src/server/collision/VMapDefinitions.h index 72a62807b4c..cc796d96dd5 100644 --- a/src/server/collision/VMapDefinitions.h +++ b/src/server/collision/VMapDefinitions.h @@ -24,9 +24,9 @@ namespace VMAP { - const char VMAP_MAGIC[] = "VMAP_4.0"; - const char RAW_VMAP_MAGIC[] = "VMAP004"; // used in extracted vmap files with raw data - const char GAMEOBJECT_MODELS[] = "temp_gameobject_models"; + const char VMAP_MAGIC[] = "VMAP_4.1"; + const char RAW_VMAP_MAGIC[] = "VMAP041"; // used in extracted vmap files with raw data + const char GAMEOBJECT_MODELS[] = "GameObjectModels.dtree"; // defined in TileAssembler.cpp currently... bool readChunk(FILE* rf, char *dest, const char *compare, uint32 len); diff --git a/src/server/game/AI/CoreAI/GameObjectAI.h b/src/server/game/AI/CoreAI/GameObjectAI.h index b9d385ba675..f4555649210 100644 --- a/src/server/game/AI/CoreAI/GameObjectAI.h +++ b/src/server/game/AI/CoreAI/GameObjectAI.h @@ -33,21 +33,24 @@ class GameObjectAI explicit GameObjectAI(GameObject* g) : go(g) {} virtual ~GameObjectAI() {} - virtual void UpdateAI(const uint32 /*diff*/) {} + virtual void UpdateAI(uint32 /*diff*/) {} virtual void InitializeAI() { Reset(); } virtual void Reset() {}; - static int Permissible(const GameObject* go); + static int Permissible(GameObject const* go); - virtual bool GossipHello(Player* /*player*/) {return false;} - virtual bool GossipSelect(Player* /*player*/, uint32 /*sender*/, uint32 /*action*/) {return false;} - virtual bool GossipSelectCode(Player* /*player*/, uint32 /*sender*/, uint32 /*action*/, const char* /*code*/) {return false;} - virtual bool QuestAccept(Player* /*player*/, Quest const* /*quest*/) {return false;} - virtual bool QuestReward(Player* /*player*/, Quest const* /*quest*/, uint32 /*opt*/) {return false;} - virtual uint32 GetDialogStatus(Player* /*player*/) {return 100;} + virtual bool GossipHello(Player* /*player*/) { return false; } + virtual bool GossipSelect(Player* /*player*/, uint32 /*sender*/, uint32 /*action*/) { return false; } + virtual bool GossipSelectCode(Player* /*player*/, uint32 /*sender*/, uint32 /*action*/, char const* /*code*/) { return false; } + virtual bool QuestAccept(Player* /*player*/, Quest const* /*quest*/) { return false; } + virtual bool QuestReward(Player* /*player*/, Quest const* /*quest*/, uint32 /*opt*/) { return false; } + virtual uint32 GetDialogStatus(Player* /*player*/) { return 100; } virtual void Destroyed(Player* /*player*/, uint32 /*eventId*/) {} + virtual uint32 GetData(uint32 /*id*/) { return 0; } + virtual void SetData64(uint32 /*id*/, uint64 /*value*/) {} + virtual uint64 GetData64(uint32 /*id*/) { return 0; } virtual void SetData(uint32 /*id*/, uint32 /*value*/) {} virtual void OnGameEvent(bool /*start*/, uint16 /*eventId*/) {} virtual void OnStateChanged(uint32 /*state*/, Unit* /*unit*/) { } @@ -58,8 +61,8 @@ class NullGameObjectAI : public GameObjectAI public: explicit NullGameObjectAI(GameObject* g); - void UpdateAI(const uint32 /*diff*/) {} + void UpdateAI(uint32 /*diff*/) {} - static int Permissible(const GameObject* /*go*/) { return PERMIT_BASE_IDLE; } + static int Permissible(GameObject const* /*go*/) { return PERMIT_BASE_IDLE; } }; #endif diff --git a/src/server/game/AI/CoreAI/GuardAI.cpp b/src/server/game/AI/CoreAI/GuardAI.cpp index b78fec7c142..6e2326ca9d5 100755 --- a/src/server/game/AI/CoreAI/GuardAI.cpp +++ b/src/server/game/AI/CoreAI/GuardAI.cpp @@ -23,7 +23,7 @@ #include "World.h" #include "CreatureAIImpl.h" -int GuardAI::Permissible(const Creature* creature) +int GuardAI::Permissible(Creature const* creature) { if (creature->isGuard()) return PERMIT_BASE_SPECIAL; @@ -31,7 +31,7 @@ int GuardAI::Permissible(const Creature* creature) return PERMIT_BASE_NO; } -GuardAI::GuardAI(Creature* creature) : ScriptedAI(creature), i_victimGuid(0), i_state(STATE_NORMAL), i_tracker(TIME_INTERVAL_LOOK) +GuardAI::GuardAI(Creature* creature) : ScriptedAI(creature) { } @@ -40,108 +40,35 @@ bool GuardAI::CanSeeAlways(WorldObject const* obj) if (!obj->isType(TYPEMASK_UNIT)) return false; - std::list t_list = me->getThreatManager().getThreatList(); - for (std::list::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) - { - if (Unit* unit = Unit::GetUnit(*me, (*itr)->getUnitGuid())) - if (unit == obj) - return true; - } + std::list threatList = me->getThreatManager().getThreatList(); + for (std::list::const_iterator itr = threatList.begin(); itr != threatList.end(); ++itr) + if ((*itr)->getUnitGuid() == obj->GetGUID()) + return true; return false; } -void GuardAI::MoveInLineOfSight(Unit* unit) -{ - // Ignore Z for flying creatures - if (!me->canFly() && me->GetDistanceZ(unit) > CREATURE_Z_ATTACK_RANGE) - return; - - if (!me->getVictim() && me->IsValidAttackTarget(unit) && - (unit->IsHostileToPlayers() || me->IsHostileTo(unit)) && - unit->isInAccessiblePlaceFor(me)) - { - float attackRadius = me->GetAttackDistance(unit); - if (me->IsWithinDistInMap(unit, attackRadius)) - { - //Need add code to let guard support player - AttackStart(unit); - //u->RemoveAurasByType(SPELL_AURA_MOD_STEALTH); - } - } -} - void GuardAI::EnterEvadeMode() { if (!me->isAlive()) { - sLog->outStaticDebug("Creature stopped attacking because he is dead [guid=%u]", me->GetGUIDLow()); me->GetMotionMaster()->MoveIdle(); - - i_state = STATE_NORMAL; - - i_victimGuid = 0; me->CombatStop(true); me->DeleteThreatList(); return; } - Unit* victim = ObjectAccessor::GetUnit(*me, i_victimGuid); - - if (!victim) - { - sLog->outStaticDebug("Creature stopped attacking because victim does not exist [guid=%u]", me->GetGUIDLow()); - } - else if (!victim ->isAlive()) - { - sLog->outStaticDebug("Creature stopped attacking because victim is dead [guid=%u]", me->GetGUIDLow()); - } - else if (victim ->HasStealthAura()) - { - sLog->outStaticDebug("Creature stopped attacking because victim is using stealth [guid=%u]", me->GetGUIDLow()); - } - else if (victim ->isInFlight()) - { - sLog->outStaticDebug("Creature stopped attacking because victim is flying away [guid=%u]", me->GetGUIDLow()); - } - else - { - sLog->outStaticDebug("Creature stopped attacking because victim outran him [guid=%u]", me->GetGUIDLow()); - } + sLog->outDebug(LOG_FILTER_UNITS, "Guard entry: %u enters evade mode.", me->GetEntry()); me->RemoveAllAuras(); me->DeleteThreatList(); - i_victimGuid = 0; me->CombatStop(true); - i_state = STATE_NORMAL; // Remove ChaseMovementGenerator from MotionMaster stack list, and add HomeMovementGenerator instead if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE) me->GetMotionMaster()->MoveTargetedHome(); } -void GuardAI::UpdateAI(const uint32 /*diff*/) -{ - // update i_victimGuid if me->getVictim() !=0 and changed - if (!UpdateVictim()) - return; - - Unit* const victim = me->getVictim(); - if (!victim) - return; - - i_victimGuid = victim->GetGUID(); - - if (me->isAttackReady()) - { - if (me->IsWithinMeleeRange(victim)) - { - me->AttackerStateUpdate(victim); - me->resetAttackTimer(); - } - } -} - void GuardAI::JustDied(Unit* killer) { if (Player* player = killer->GetCharmerOrOwnerPlayerOrPlayerItself()) diff --git a/src/server/game/AI/CoreAI/GuardAI.h b/src/server/game/AI/CoreAI/GuardAI.h index c80c5a6c343..c8dd9d54921 100755 --- a/src/server/game/AI/CoreAI/GuardAI.h +++ b/src/server/game/AI/CoreAI/GuardAI.h @@ -20,34 +20,19 @@ #define TRINITY_GUARDAI_H #include "ScriptedCreature.h" -#include "Timer.h" class Creature; class GuardAI : public ScriptedAI { - enum GuardState - { - STATE_NORMAL = 1, - STATE_LOOK_AT_VICTIM = 2 - }; - public: + explicit GuardAI(Creature* creature); - explicit GuardAI(Creature* c); - - void MoveInLineOfSight(Unit*); - void EnterEvadeMode(); - void JustDied(Unit*); + static int Permissible(Creature const* creature); bool CanSeeAlways(WorldObject const* obj); - void UpdateAI(const uint32); - static int Permissible(const Creature*); - - private: - uint64 i_victimGuid; - GuardState i_state; - TimeTracker i_tracker; + void EnterEvadeMode(); + void JustDied(Unit* killer); }; #endif diff --git a/src/server/game/AI/CoreAI/PetAI.cpp b/src/server/game/AI/CoreAI/PetAI.cpp index 30ebd06745f..160b406a6ea 100755 --- a/src/server/game/AI/CoreAI/PetAI.cpp +++ b/src/server/game/AI/CoreAI/PetAI.cpp @@ -109,17 +109,25 @@ void PetAI::UpdateAI(const uint32 diff) } else if (owner && me->GetCharmInfo()) //no victim { - Unit* nextTarget = SelectNextTarget(); + // Only aggressive pets do target search every update. + // Defensive pets do target search only in these cases: + // * Owner attacks something - handled by OwnerAttacked() + // * Owner receives damage - handled by OwnerDamagedBy() + // * Pet is in combat and current target dies - handled by KilledUnit() + if (me->HasReactState(REACT_AGGRESSIVE)) + { + Unit* nextTarget = SelectNextTarget(); - if (me->HasReactState(REACT_PASSIVE)) - _stopAttack(); - else if (nextTarget) - AttackStart(nextTarget); + if (nextTarget) + AttackStart(nextTarget); + else + HandleReturnMovement(); + } else HandleReturnMovement(); } else if (owner && !me->HasUnitState(UNIT_STATE_FOLLOW)) // no charm info and no victim - me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle()); + HandleReturnMovement(); if (!me->GetCharmInfo()) return; @@ -145,40 +153,56 @@ void PetAI::UpdateAI(const uint32 diff) if (spellInfo->IsPositive()) { - // non combat spells allowed - // only pet spells have IsNonCombatSpell and not fit this reqs: - // Consume Shadows, Lesser Invisibility, so ignore checks for its if (spellInfo->CanBeUsedInCombat()) { - // allow only spell without spell cost or with spell cost but not duration limit - int32 duration = spellInfo->GetDuration(); - if ((spellInfo->ManaCost || spellInfo->ManaCostPercentage || spellInfo->ManaPerSecond) && duration > 0) + // check spell cooldown + if (me->HasSpellCooldown(spellInfo->Id)) continue; - // allow only spell without cooldown > duration - int32 cooldown = spellInfo->GetRecoveryTime(); - if (cooldown >= 0 && duration >= 0 && cooldown > duration) + // Check if we're in combat or commanded to attack + if (!me->isInCombat() && !me->GetCharmInfo()->IsCommandAttack()) continue; } Spell* spell = new Spell(me, spellInfo, TRIGGERED_NONE, 0); - bool spellUsed = false; - for (std::set::const_iterator tar = m_AllySet.begin(); tar != m_AllySet.end(); ++tar) - { - Unit* target = ObjectAccessor::GetUnit(*me, *tar); - //only buff targets that are in combat, unless the spell can only be cast while out of combat - if (!target) - continue; + // Some spells can target enemy or friendly (DK Ghoul's Leap) + // Check for enemy first (pet then owner) + Unit* target = me->getAttackerForHelper(); + if (!target && owner) + target = owner->getAttackerForHelper(); - if (spell->CanAutoCast(target)) + if (target) + { + if (CanAttack(target) && spell->CanAutoCast(target)) { - targetSpellStore.push_back(std::make_pair(target, spell)); + targetSpellStore.push_back(std::make_pair(target, spell)); spellUsed = true; - break; } } + + // No enemy, check friendly + if (!spellUsed) + { + for (std::set::const_iterator tar = m_AllySet.begin(); tar != m_AllySet.end(); ++tar) + { + Unit* ally = ObjectAccessor::GetUnit(*me, *tar); + + //only buff targets that are in combat, unless the spell can only be cast while out of combat + if (!ally) + continue; + + if (spell->CanAutoCast(ally)) + { + targetSpellStore.push_back(std::make_pair(ally, spell)); + spellUsed = true; + break; + } + } + } + + // No valid targets at all if (!spellUsed) delete spell; } @@ -186,7 +210,7 @@ void PetAI::UpdateAI(const uint32 diff) { Spell* spell = new Spell(me, spellInfo, TRIGGERED_NONE, 0); if (spell->CanAutoCast(me->getVictim())) - targetSpellStore.push_back(std::make_pair(me->getVictim(), spell)); + targetSpellStore.push_back(std::make_pair(me->getVictim(), spell)); else delete spell; } @@ -278,6 +302,7 @@ void PetAI::KilledUnit(Unit* victim) // next target selection me->AttackStop(); me->GetCharmInfo()->SetIsCommandAttack(false); + me->SendMeleeAttackStop(); // Stops the pet's 'Attack' button from flashing Unit* nextTarget = SelectNextTarget(); @@ -301,6 +326,47 @@ void PetAI::AttackStart(Unit* target) DoAttack(target, true); } +void PetAI::OwnerDamagedBy(Unit* attacker) +{ + // Called when owner takes damage. Allows defensive pets to know + // that their owner might need help + + if (!attacker) + return; + + // Passive pets don't do anything + if (me->HasReactState(REACT_PASSIVE)) + return; + + // Prevent pet from disengaging from current target + if (me->getVictim() && me->getVictim()->isAlive()) + return; + + // Continue to evaluate and attack if necessary + AttackStart(attacker); +} + +void PetAI::OwnerAttacked(Unit* target) +{ + // Called when owner attacks something. Allows defensive pets to know + // that they need to assist + + // Target might be NULL if called from spell with invalid cast targets + if (!target) + return; + + // Passive pets don't do anything + if (me->HasReactState(REACT_PASSIVE)) + return; + + // Prevent pet from disengaging from current target + if (me->getVictim() && me->getVictim()->isAlive()) + return; + + // Continue to evaluate and attack if necessary + AttackStart(target); +} + Unit* PetAI::SelectNextTarget() { // Provides next target selection after current target death @@ -457,7 +523,7 @@ bool PetAI::CanAttack(Unit* target) // Stay - can attack if target is within range or commanded to if (me->GetCharmInfo()->HasCommandState(COMMAND_STAY)) - return (me->IsWithinMeleeRange(target, MIN_MELEE_REACH) || me->GetCharmInfo()->IsCommandAttack()); + return (me->IsWithinMeleeRange(target, MELEE_RANGE) || me->GetCharmInfo()->IsCommandAttack()); // Follow if (me->GetCharmInfo()->HasCommandState(COMMAND_FOLLOW)) diff --git a/src/server/game/AI/CoreAI/PetAI.h b/src/server/game/AI/CoreAI/PetAI.h index 730ab12a3ca..ed3e2305556 100755 --- a/src/server/game/AI/CoreAI/PetAI.h +++ b/src/server/game/AI/CoreAI/PetAI.h @@ -40,6 +40,8 @@ class PetAI : public CreatureAI void KilledUnit(Unit* /*victim*/); void AttackStart(Unit* target); void MovementInform(uint32 moveType, uint32 data); + void OwnerDamagedBy(Unit* attacker); + void OwnerAttacked(Unit* target); private: bool _isVisible(Unit*) const; diff --git a/src/server/game/AI/CoreAI/TotemAI.cpp b/src/server/game/AI/CoreAI/TotemAI.cpp index 0739b62b605..d12d3c098e8 100755 --- a/src/server/game/AI/CoreAI/TotemAI.cpp +++ b/src/server/game/AI/CoreAI/TotemAI.cpp @@ -27,8 +27,7 @@ #include "GridNotifiersImpl.h" #include "CellImpl.h" -int -TotemAI::Permissible(const Creature* creature) +int TotemAI::Permissible(Creature const* creature) { if (creature->isTotem()) return PERMIT_BASE_PROACTIVE; @@ -41,8 +40,7 @@ TotemAI::TotemAI(Creature* c) : CreatureAI(c), i_victimGuid(0) ASSERT(c->isTotem()); } -void -TotemAI::MoveInLineOfSight(Unit*) +void TotemAI::MoveInLineOfSight(Unit* /*who*/) { } @@ -51,10 +49,9 @@ void TotemAI::EnterEvadeMode() me->CombatStop(true); } -void -TotemAI::UpdateAI(const uint32 /*diff*/) +void TotemAI::UpdateAI(uint32 const /*diff*/) { - if (me->ToTotem()->GetTotemType() != TOTEM_ACTIVE) + if (me->ToTotem()->GetTotemType() != TOTEM_ACTIVE) return; if (!me->isAlive() || me->IsNonMeleeSpellCasted(false)) @@ -98,8 +95,7 @@ TotemAI::UpdateAI(const uint32 /*diff*/) i_victimGuid = 0; } -void -TotemAI::AttackStart(Unit*) +void TotemAI::AttackStart(Unit* /*victim*/) { // Sentry totem sends ping on attack if (me->GetEntry() == SENTRY_TOTEM_ENTRY && me->GetOwner()->GetTypeId() == TYPEID_PLAYER) diff --git a/src/server/game/AI/CoreAI/TotemAI.h b/src/server/game/AI/CoreAI/TotemAI.h index 0fa2920888f..f0d705345ef 100755 --- a/src/server/game/AI/CoreAI/TotemAI.h +++ b/src/server/game/AI/CoreAI/TotemAI.h @@ -31,12 +31,12 @@ class TotemAI : public CreatureAI explicit TotemAI(Creature* c); - void MoveInLineOfSight(Unit*); - void AttackStart(Unit*); + void MoveInLineOfSight(Unit* who); + void AttackStart(Unit* victim); void EnterEvadeMode(); - void UpdateAI(const uint32); - static int Permissible(const Creature*); + void UpdateAI(uint32 const diff); + static int Permissible(Creature const* creature); private: uint64 i_victimGuid; diff --git a/src/server/game/AI/CoreAI/UnitAI.h b/src/server/game/AI/CoreAI/UnitAI.h index b871a25835b..593f0d15e18 100755 --- a/src/server/game/AI/CoreAI/UnitAI.h +++ b/src/server/game/AI/CoreAI/UnitAI.h @@ -223,7 +223,7 @@ class UnitAI targetList.reverse(); if (targetType == SELECT_TARGET_RANDOM) - Trinity::RandomResizeList(targetList, maxTargets); + Trinity::Containers::RandomResizeList(targetList, maxTargets); else targetList.resize(maxTargets); } diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp index c8818f84e5b..9c236cbd039 100755 --- a/src/server/game/AI/CreatureAI.cpp +++ b/src/server/game/AI/CreatureAI.cpp @@ -25,6 +25,7 @@ #include "Log.h" #include "MapReference.h" #include "Player.h" +#include "CreatureTextMgr.h" //Disable CreatureAI when charmed void CreatureAI::OnCharmed(bool /*apply*/) diff --git a/src/server/game/AI/CreatureAI.h b/src/server/game/AI/CreatureAI.h index dafd3e4e137..94ac452b9f3 100755 --- a/src/server/game/AI/CreatureAI.h +++ b/src/server/game/AI/CreatureAI.h @@ -19,9 +19,9 @@ #ifndef TRINITY_CREATUREAI_H #define TRINITY_CREATUREAI_H +#include "Creature.h" #include "UnitAI.h" #include "Common.h" -#include "CreatureTextMgr.h" class WorldObject; class Unit; @@ -138,6 +138,12 @@ class CreatureAI : public UnitAI // Called at text emote receive from player virtual void ReceiveEmote(Player* /*player*/, uint32 /*emoteId*/) {} + // Called when owner takes damage + virtual void OwnerDamagedBy(Unit* /*attacker*/) {} + + // Called when owner attacks something + virtual void OwnerAttacked(Unit* /*target*/) {} + /// == Triggered Actions Requested ================== // Called when creature attack expected (if creature can and no have current victim) diff --git a/src/server/game/AI/CreatureAIImpl.h b/src/server/game/AI/CreatureAIImpl.h index f568da80b49..d097adf38ec 100755 --- a/src/server/game/AI/CreatureAIImpl.h +++ b/src/server/game/AI/CreatureAIImpl.h @@ -326,11 +326,15 @@ class EventMap : private std::map uint32 GetPhaseMask() const { return (_phase >> 24) & 0xFF; } + bool Empty() const { return empty(); } + // Sets event phase, must be in range 1 - 8 void SetPhase(uint32 phase) { if (phase && phase < 8) _phase = (1 << (phase + 24)); + else if (!phase) + _phase = 0; } // Creates new event entry in map with given id, time, group if given (1 - 8) and phase if given (1 - 8) @@ -604,6 +608,7 @@ inline void UnitAI::DoCast(Unit* victim, uint32 spellId, bool triggered) inline void UnitAI::DoCastVictim(uint32 spellId, bool triggered) { + // Why don't we check for casting unit_state and existing target as we do in DoCast(.. ? me->CastSpell(me->getVictim(), spellId, triggered); } diff --git a/src/server/game/AI/CreatureAISelector.cpp b/src/server/game/AI/CreatureAISelector.cpp index ab616d78a8c..1a0c6652e74 100755 --- a/src/server/game/AI/CreatureAISelector.cpp +++ b/src/server/game/AI/CreatureAISelector.cpp @@ -82,7 +82,7 @@ namespace FactorySelector { const CreatureAICreator* factory = iter->second; const SelectableAI* p = dynamic_cast(factory); - ASSERT(p != NULL); + ASSERT(p); int val = p->Permit(creature); if (val > best_val) { @@ -102,7 +102,7 @@ namespace FactorySelector MovementGenerator* selectMovementGenerator(Creature* creature) { MovementGeneratorRegistry& mv_registry(*MovementGeneratorRepository::instance()); - ASSERT(creature->GetCreatureInfo() != NULL); + ASSERT(creature->GetCreatureTemplate()); const MovementGeneratorCreator* mv_factory = mv_registry.GetRegistryItem(creature->GetDefaultMovementType()); /* if (mv_factory == NULL) @@ -133,6 +133,9 @@ namespace FactorySelector const GameObjectAICreator* ai_factory = NULL; GameObjectAIRegistry& ai_registry(*GameObjectAIRepository::instance()); + if (GameObjectAI* scriptedAI = sScriptMgr->GetGameObjectAI(go)) + return scriptedAI; + ai_factory = ai_registry.GetRegistryItem(go->GetAIName()); //future goAI types go here diff --git a/src/server/game/AI/EventAI/CreatureEventAI.cpp b/src/server/game/AI/EventAI/CreatureEventAI.cpp index bc1903257b7..9745b7185d9 100755 --- a/src/server/game/AI/EventAI/CreatureEventAI.cpp +++ b/src/server/game/AI/EventAI/CreatureEventAI.cpp @@ -95,7 +95,7 @@ CreatureEventAI::CreatureEventAI(Creature* c) : CreatureAI(c) m_AttackDistance = 0.0f; m_AttackAngle = 0.0f; - m_InvinceabilityHpLevel = 0; + m_InvincibilityHpLevel = 0; //Handle Spawned Events if (!m_bEmptyList) @@ -816,9 +816,9 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 case ACTION_T_SET_INVINCIBILITY_HP_LEVEL: { if (action.invincibility_hp_level.is_percent) - m_InvinceabilityHpLevel = me->CountPctFromMaxHealth(action.invincibility_hp_level.hp_level); + m_InvincibilityHpLevel = me->CountPctFromMaxHealth(action.invincibility_hp_level.hp_level); else - m_InvinceabilityHpLevel = action.invincibility_hp_level.hp_level; + m_InvincibilityHpLevel = action.invincibility_hp_level.hp_level; break; } case ACTION_T_MOUNT_TO_ENTRY_OR_MODEL: @@ -1107,7 +1107,7 @@ void CreatureEventAI::UpdateAI(const uint32 diff) break; case EVENT_T_RANGE: if (me->getVictim()) - if (me->IsInMap(me->getVictim())) + if (me->IsInMap(me->getVictim()) && me->InSamePhase(me->getVictim())) if (me->IsInRange(me->getVictim(), (float)(*i).Event.range.minDist, (float)(*i).Event.range.maxDist)) ProcessEvent(*i); break; @@ -1252,7 +1252,7 @@ void CreatureEventAI::DoScriptText(int32 textEntry, WorldObject* source, Unit* t if ((*i).second.SoundId) { - if (GetSoundEntriesStore()->LookupEntry((*i).second.SoundId)) + if (sSoundEntriesStore.LookupEntry((*i).second.SoundId)) source->PlayDirectSound((*i).second.SoundId); else sLog->outErrorDb("CreatureEventAI: DoScriptText entry %i tried to process invalid sound id %u.", textEntry, (*i).second.SoundId); @@ -1350,12 +1350,12 @@ void CreatureEventAI::ReceiveEmote(Player* player, uint32 textEmote) void CreatureEventAI::DamageTaken(Unit* /*done_by*/, uint32& damage) { - if (m_InvinceabilityHpLevel > 0 && me->GetHealth() < m_InvinceabilityHpLevel+damage) + if (m_InvincibilityHpLevel > 0 && me->GetHealth() < m_InvincibilityHpLevel+damage) { - if (me->GetHealth() <= m_InvinceabilityHpLevel) + if (me->GetHealth() <= m_InvincibilityHpLevel) damage = 0; else - damage = me->GetHealth() - m_InvinceabilityHpLevel; + damage = me->GetHealth() - m_InvincibilityHpLevel; } } diff --git a/src/server/game/AI/EventAI/CreatureEventAI.h b/src/server/game/AI/EventAI/CreatureEventAI.h index c4daf2563e0..3d2bcf888c8 100755 --- a/src/server/game/AI/EventAI/CreatureEventAI.h +++ b/src/server/game/AI/EventAI/CreatureEventAI.h @@ -641,6 +641,6 @@ class CreatureEventAI : public CreatureAI bool m_MeleeEnabled; // If we allow melee auto attack float m_AttackDistance; // Distance to attack from float m_AttackAngle; // Angle of attack - uint32 m_InvinceabilityHpLevel; // Minimal health level allowed at damage apply + uint32 m_InvincibilityHpLevel; // Minimal health level allowed at damage apply }; #endif diff --git a/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp b/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp index add7b4db174..517e55af457 100755 --- a/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp +++ b/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp @@ -38,7 +38,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Texts() // Load EventAI Text sObjectMgr->LoadTrinityStrings("creature_ai_texts", MIN_CREATURE_AI_TEXT_STRING_ID, MAX_CREATURE_AI_TEXT_STRING_ID); - // Gather Additional data from EventAI Texts + // Gather Additional data from EventAI Texts 0 1 2 3 4 QueryResult result = WorldDatabase.Query("SELECT entry, sound, type, language, emote FROM creature_ai_texts"); if (!result) @@ -56,10 +56,10 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Texts() StringTextData temp; int32 i = fields[0].GetInt32(); - temp.SoundId = fields[1].GetInt32(); - temp.Type = fields[2].GetInt32(); - temp.Language = fields[3].GetInt32(); - temp.Emote = fields[4].GetInt32(); + temp.SoundId = fields[1].GetUInt32(); + temp.Type = fields[2].GetUInt8(); + temp.Language = fields[3].GetUInt8(); + temp.Emote = fields[4].GetUInt16(); // range negative if (i > MIN_CREATURE_AI_TEXT_STRING_ID || i <= MAX_CREATURE_AI_TEXT_STRING_ID) @@ -187,7 +187,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() temp.creature_id = fields[1].GetUInt32(); uint32 creature_id = temp.creature_id; - uint32 e_type = fields[2].GetUInt32(); + uint32 e_type = fields[2].GetUInt8(); //Report any errors in event if (e_type >= EVENT_T_END) { @@ -196,13 +196,13 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() } temp.event_type = EventAI_Type(e_type); - temp.event_inverse_phase_mask = fields[3].GetUInt32(); - temp.event_chance = fields[4].GetUInt8(); - temp.event_flags = fields[5].GetUInt8(); - temp.raw.param1 = fields[6].GetUInt32(); - temp.raw.param2 = fields[7].GetUInt32(); - temp.raw.param3 = fields[8].GetUInt32(); - temp.raw.param4 = fields[9].GetUInt32(); + temp.event_inverse_phase_mask = fields[3].GetInt32(); + temp.event_chance = fields[4].GetUInt32(); + temp.event_flags = fields[5].GetUInt32(); + temp.raw.param1 = fields[6].GetInt32(); + temp.raw.param2 = fields[7].GetInt32(); + temp.raw.param3 = fields[8].GetInt32(); + temp.raw.param4 = fields[9].GetInt32(); //Creature does not exist in database if (!sObjectMgr->GetCreatureTemplate(temp.creature_id)) @@ -399,7 +399,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() for (uint32 j = 0; j < MAX_ACTIONS; j++) { - uint16 action_type = fields[10+(j*4)].GetUInt16(); + uint16 action_type = fields[10+(j*4)].GetUInt8(); if (action_type >= ACTION_T_END) { sLog->outErrorDb("CreatureEventAI: Event %u Action %u has incorrect action type (%u), replace by ACTION_T_NONE.", i, j+1, action_type); @@ -410,9 +410,9 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() CreatureEventAI_Action& action = temp.action[j]; action.type = EventAI_ActionType(action_type); - action.raw.param1 = fields[11+(j*4)].GetUInt32(); - action.raw.param2 = fields[12+(j*4)].GetUInt32(); - action.raw.param3 = fields[13+(j*4)].GetUInt32(); + action.raw.param1 = fields[11+(j*4)].GetInt32(); + action.raw.param2 = fields[12+(j*4)].GetInt32(); + action.raw.param3 = fields[13+(j*4)].GetInt32(); //Report any errors in actions switch (action.type) diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp index 78adc38a67d..55ce2451709 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp @@ -30,18 +30,6 @@ void SummonList::DoZoneInCombat(uint32 entry) } } -void SummonList::DoAction(uint32 entry, int32 info) -{ - for (iterator i = begin(); i != end();) - { - Creature* summon = Unit::GetCreature(*me, *i); - ++i; - if (summon && summon->IsAIEnabled - && (!entry || summon->GetEntry() == entry)) - summon->AI()->DoAction(info); - } -} - void SummonList::DespawnEntry(uint32 entry) { for (iterator i = begin(); i != end();) @@ -126,15 +114,7 @@ void ScriptedAI::UpdateAI(uint32 const /*diff*/) if (!UpdateVictim()) return; - if (me->isAttackReady()) - { - //If we are within range melee the target - if (me->IsWithinMeleeRange(me->getVictim())) - { - me->AttackerStateUpdate(me->getVictim()); - me->resetAttackTimer(); - } - } + DoMeleeAttackIfReady(); } void ScriptedAI::DoStartMovement(Unit* victim, float distance, float angle) @@ -171,7 +151,7 @@ void ScriptedAI::DoPlaySoundToSet(WorldObject* source, uint32 soundId) if (!source) return; - if (!GetSoundEntriesStore()->LookupEntry(soundId)) + if (!sSoundEntriesStore.LookupEntry(soundId)) { sLog->outError("TSCR: Invalid soundId %u used in DoPlaySoundToSet (Source: TypeId %u, GUID %u)", soundId, source->GetTypeId(), source->GetGUIDLow()); return; @@ -189,11 +169,11 @@ SpellInfo const* ScriptedAI::SelectSpell(Unit* target, uint32 school, uint32 mec { //No target so we can't cast if (!target) - return false; + return NULL; //Silenced so we can't cast if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED)) - return false; + return NULL; //Using the extended script system we first create a list of viable spells SpellInfo const* apSpell[CREATURE_MAX_SPELLS]; @@ -274,7 +254,7 @@ void ScriptedAI::DoResetThreat() for (std::list::iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr) { - Unit* unit = Unit::GetUnit((*me), (*itr)->getUnitGuid()); + Unit* unit = Unit::GetUnit(*me, (*itr)->getUnitGuid()); if (unit && DoGetThreat(unit)) DoModifyThreatPercent(unit, -100); @@ -309,14 +289,13 @@ void ScriptedAI::DoTeleportTo(const float position[4]) void ScriptedAI::DoTeleportPlayer(Unit* unit, float x, float y, float z, float o) { - if (!unit || unit->GetTypeId() != TYPEID_PLAYER) - { - if (unit) - sLog->outError("TSCR: Creature " UI64FMTD " (Entry: %u) Tried to teleport non-player unit (Type: %u GUID: " UI64FMTD ") to x: %f y:%f z: %f o: %f. Aborted.", me->GetGUID(), me->GetEntry(), unit->GetTypeId(), unit->GetGUID(), x, y, z, o); + if (!unit) return; - } - CAST_PLR(unit)->TeleportTo(unit->GetMapId(), x, y, z, o, TELE_TO_NOT_LEAVE_COMBAT); + if (Player* player = unit->ToPlayer()) + player->TeleportTo(unit->GetMapId(), x, y, z, o, TELE_TO_NOT_LEAVE_COMBAT); + else + sLog->outError("TSCR: Creature " UI64FMTD " (Entry: %u) Tried to teleport non-player unit (Type: %u GUID: " UI64FMTD ") to x: %f y:%f z: %f o: %f. Aborted.", me->GetGUID(), me->GetEntry(), unit->GetTypeId(), unit->GetGUID(), x, y, z, o); } void ScriptedAI::DoTeleportAll(float x, float y, float z, float o) diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.h b/src/server/game/AI/ScriptedAI/ScriptedCreature.h index a01c993cab6..4fac8b3cba5 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.h +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.h @@ -38,7 +38,18 @@ class SummonList : public std::list void Despawn(Creature* summon) { remove(summon->GetGUID()); } void DespawnEntry(uint32 entry); void DespawnAll(); - void DoAction(uint32 entry, int32 info); + + template void DoAction(int32 info, Predicate& predicate, uint16 max = 0) + { + Trinity::Containers::RandomResizeList(*this, predicate, max); + for (iterator i = begin(); i != end(); ) + { + Creature* summon = Unit::GetCreature(*me, *i++); + if (summon && summon->IsAIEnabled) + summon->AI()->DoAction(info); + } + } + void DoZoneInCombat(uint32 entry = 0); void RemoveNotExisting(); bool HasEntry(uint32 entry); @@ -46,6 +57,22 @@ class SummonList : public std::list Creature* me; }; +class EntryCheckPredicate +{ + public: + EntryCheckPredicate(uint32 entry) : _entry(entry) {} + bool operator()(uint64 guid) { return GUID_ENPART(guid) == _entry; } + + private: + uint32 _entry; +}; + +class DummyEntryCheckPredicate +{ + public: + bool operator()(uint64) { return true; } +}; + struct ScriptedAI : public CreatureAI { explicit ScriptedAI(Creature* creature); diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp index 048cc8b3d68..2243734f642 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp @@ -57,7 +57,7 @@ bool npc_escortAI::AssistPlayerInCombat(Unit* who) return false; //experimental (unknown) flag not present - if (!(me->GetCreatureInfo()->type_flags & CREATURE_TYPEFLAGS_AID_PLAYERS)) + if (!(me->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_AID_PLAYERS)) return false; //not a player @@ -95,7 +95,7 @@ void npc_escortAI::MoveInLineOfSight(Unit* who) if (HasEscortState(STATE_ESCORT_ESCORTING) && AssistPlayerInCombat(who)) return; - if (!me->canFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) + if (!me->CanFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) return; if (me->IsHostileTo(who)) @@ -150,7 +150,7 @@ void npc_escortAI::JustRespawned() //add a small delay before going to first waypoint, normal in near all cases m_uiWPWaitTimer = 2500; - if (me->getFaction() != me->GetCreatureInfo()->faction_A) + if (me->getFaction() != me->GetCreatureTemplate()->faction_A) me->RestoreFaction(); Reset(); @@ -307,11 +307,7 @@ void npc_escortAI::MovementInform(uint32 moveType, uint32 pointId) { sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI has returned to original position before combat"); - if (m_bIsRunning && me->HasUnitMovementFlag(MOVEMENTFLAG_WALKING)) - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); - else if (!m_bIsRunning && !me->HasUnitMovementFlag(MOVEMENTFLAG_WALKING)) - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); - + me->SetWalk(!m_bIsRunning); RemoveEscortState(STATE_ESCORT_RETURNING); if (!m_uiWPWaitTimer) @@ -387,7 +383,7 @@ void npc_escortAI::FillPointMovementListForCreature() if (movePoints.empty()) return; - ScriptPointVector::const_iterator itrEnd = movePoints.end();; + ScriptPointVector::const_iterator itrEnd = movePoints.end(); for (ScriptPointVector::const_iterator itr = movePoints.begin(); itr != itrEnd; ++itr) { Escort_Waypoint point(itr->uiPointId, itr->fX, itr->fY, itr->fZ, itr->uiWaitTime); @@ -400,14 +396,14 @@ void npc_escortAI::SetRun(bool on) if (on) { if (!m_bIsRunning) - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); else sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI attempt to set run mode, but is already running."); } else { if (m_bIsRunning) - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); else sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI attempt to set walk mode, but is already walking."); } @@ -473,9 +469,9 @@ void npc_escortAI::Start(bool isActiveAttacker /* = true*/, bool run /* = false //Set initial speed if (m_bIsRunning) - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); else - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); AddEscortState(STATE_ESCORT_ESCORTING); } diff --git a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp index d83ad9b756c..13bbbe2c338 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp @@ -55,7 +55,7 @@ bool FollowerAI::AssistPlayerInCombat(Unit* who) return false; //experimental (unknown) flag not present - if (!(me->GetCreatureInfo()->type_flags & CREATURE_TYPEFLAGS_AID_PLAYERS)) + if (!(me->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_AID_PLAYERS)) return false; //not a player @@ -93,7 +93,7 @@ void FollowerAI::MoveInLineOfSight(Unit* who) if (HasFollowState(STATE_FOLLOW_INPROGRESS) && AssistPlayerInCombat(who)) return; - if (!me->canFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) + if (!me->CanFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) return; if (me->IsHostileTo(who)) @@ -150,8 +150,8 @@ void FollowerAI::JustRespawned() if (!IsCombatMovementAllowed()) SetCombatMovement(true); - if (me->getFaction() != me->GetCreatureInfo()->faction_A) - me->setFaction(me->GetCreatureInfo()->faction_A); + if (me->getFaction() != me->GetCreatureTemplate()->faction_A) + me->setFaction(me->GetCreatureTemplate()->faction_A); Reset(); } diff --git a/src/server/game/AI/ScriptedAI/ScriptedSimpleAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedSimpleAI.cpp deleted file mode 100755 index 25c7f6f44b7..00000000000 --- a/src/server/game/AI/ScriptedAI/ScriptedSimpleAI.cpp +++ /dev/null @@ -1,280 +0,0 @@ -/* - * Copyright (C) 2008-2012 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 - * - * 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; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; 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, see . - */ - -/* ScriptData -SDName: SimpleAI -SD%Complete: 100 -SDComment: Base Class for SimpleAI creatures -SDCategory: Creatures -EndScriptData */ - -#include "ScriptPCH.h" -#include "ScriptedSimpleAI.h" - -SimpleAI::SimpleAI(Creature* c) : ScriptedAI(c) -{ - //Clear all data - Aggro_TextId[0] = 0; - Aggro_TextId[1] = 0; - Aggro_TextId[2] = 0; - Aggro_Sound[0] = 0; - Aggro_Sound[1] = 0; - Aggro_Sound[2] = 0; - - Death_TextId[0] = 0; - Death_TextId[1] = 0; - Death_TextId[2] = 0; - Death_Sound[0] = 0; - Death_Sound[1] = 0; - Death_Sound[2] = 0; - Death_Spell = 0; - Death_Target_Type = 0; - - Kill_TextId[0] = 0; - Kill_TextId[1] = 0; - Kill_TextId[2] = 0; - Kill_Sound[0] = 0; - Kill_Sound[1] = 0; - Kill_Sound[2] = 0; - Kill_Spell = 0; - Kill_Target_Type = 0; - - memset(Spell, 0, sizeof(Spell)); - - EnterEvadeMode(); -} - -void SimpleAI::Reset() -{ -} - -void SimpleAI::EnterCombat(Unit* who) -{ - //Reset cast timers - if (Spell[0].First_Cast >= 0) - Spell_Timer[0] = Spell[0].First_Cast; - else Spell_Timer[0] = 1000; - if (Spell[1].First_Cast >= 0) - Spell_Timer[1] = Spell[1].First_Cast; - else Spell_Timer[1] = 1000; - if (Spell[2].First_Cast >= 0) - Spell_Timer[2] = Spell[2].First_Cast; - else Spell_Timer[2] = 1000; - if (Spell[3].First_Cast >= 0) - Spell_Timer[3] = Spell[3].First_Cast; - else Spell_Timer[3] = 1000; - if (Spell[4].First_Cast >= 0) - Spell_Timer[4] = Spell[4].First_Cast; - else Spell_Timer[4] = 1000; - if (Spell[5].First_Cast >= 0) - Spell_Timer[5] = Spell[5].First_Cast; - else Spell_Timer[5] = 1000; - if (Spell[6].First_Cast >= 0) - Spell_Timer[6] = Spell[6].First_Cast; - else Spell_Timer[6] = 1000; - if (Spell[7].First_Cast >= 0) - Spell_Timer[7] = Spell[7].First_Cast; - else Spell_Timer[7] = 1000; - if (Spell[8].First_Cast >= 0) - Spell_Timer[8] = Spell[8].First_Cast; - else Spell_Timer[8] = 1000; - if (Spell[9].First_Cast >= 0) - Spell_Timer[9] = Spell[9].First_Cast; - else Spell_Timer[9] = 1000; - - uint8 random_text = urand(0, 2); - - //Random text - if (Aggro_TextId[random_text]) - DoScriptText(Aggro_TextId[random_text], me, who); - - //Random sound - if (Aggro_Sound[random_text]) - DoPlaySoundToSet(me, Aggro_Sound[random_text]); -} - -void SimpleAI::KilledUnit(Unit* victim) -{ - uint8 random_text = urand(0, 2); - - //Random yell - if (Kill_TextId[random_text]) - DoScriptText(Kill_TextId[random_text], me, victim); - - //Random sound - if (Kill_Sound[random_text]) - DoPlaySoundToSet(me, Kill_Sound[random_text]); - - if (!Kill_Spell) - return; - - Unit* target = NULL; - - switch (Kill_Target_Type) - { - case CAST_SELF: - target = me; - break; - case CAST_HOSTILE_TARGET: - target = me->getVictim(); - break; - case CAST_HOSTILE_SECOND_AGGRO: - target = SelectTarget(SELECT_TARGET_TOPAGGRO, 1); - break; - case CAST_HOSTILE_LAST_AGGRO: - target = SelectTarget(SELECT_TARGET_BOTTOMAGGRO, 0); - break; - case CAST_HOSTILE_RANDOM: - target = SelectTarget(SELECT_TARGET_RANDOM, 0); - break; - case CAST_KILLEDUNIT_VICTIM: - target = victim; - break; - } - - //Target is ok, cast a spell on it - if (target) - DoCast(target, Kill_Spell); -} - -void SimpleAI::DamageTaken(Unit* killer, uint32& damage) -{ - //Return if damage taken won't kill us - if (me->GetHealth() > damage) - return; - - uint8 random_text = urand(0, 2); - - //Random yell - if (Death_TextId[random_text]) - DoScriptText(Death_TextId[random_text], me, killer); - - //Random sound - if (Death_Sound[random_text]) - DoPlaySoundToSet(me, Death_Sound[random_text]); - - if (!Death_Spell) - return; - - Unit* target = NULL; - - switch (Death_Target_Type) - { - case CAST_SELF: - target = me; - break; - case CAST_HOSTILE_TARGET: - target = me->getVictim(); - break; - case CAST_HOSTILE_SECOND_AGGRO: - target = SelectTarget(SELECT_TARGET_TOPAGGRO, 1); - break; - case CAST_HOSTILE_LAST_AGGRO: - target = SelectTarget(SELECT_TARGET_BOTTOMAGGRO, 0); - break; - case CAST_HOSTILE_RANDOM: - target = SelectTarget(SELECT_TARGET_RANDOM, 0); - break; - case CAST_JUSTDIED_KILLER: - target = killer; - break; - } - - //Target is ok, cast a spell on it - if (target) - DoCast(target, Death_Spell); -} - -void SimpleAI::UpdateAI(const uint32 diff) -{ - //Return since we have no target - if (!UpdateVictim()) - return; - - //Spells - for (uint32 i = 0; i < MAX_SIMPLEAI_SPELLS; ++i) - { - //Spell not valid - if (!Spell[i].Enabled || !Spell[i].Spell_Id) - continue; - - if (Spell_Timer[i] <= diff) - { - //Check if this is a percentage based - if (Spell[i].First_Cast < 0 && Spell[i].First_Cast > -100 && HealthAbovePct(uint32(-Spell[i].First_Cast))) - continue; - - //Check Current spell - if (!(Spell[i].InterruptPreviousCast && me->IsNonMeleeSpellCasted(false))) - { - Unit* target = NULL; - - switch (Spell[i].Cast_Target_Type) - { - case CAST_SELF: - target = me; - break; - case CAST_HOSTILE_TARGET: - target = me->getVictim(); - break; - case CAST_HOSTILE_SECOND_AGGRO: - target = SelectTarget(SELECT_TARGET_TOPAGGRO, 1); - break; - case CAST_HOSTILE_LAST_AGGRO: - target = SelectTarget(SELECT_TARGET_BOTTOMAGGRO, 0); - break; - case CAST_HOSTILE_RANDOM: - target = SelectTarget(SELECT_TARGET_RANDOM, 0); - break; - } - - //Target is ok, cast a spell on it and then do our random yell - if (target) - { - if (me->IsNonMeleeSpellCasted(false)) - me->InterruptNonMeleeSpells(false); - - DoCast(target, Spell[i].Spell_Id); - - //Yell and sound use the same number so that you can make - //the Creature yell with the correct sound effect attached - uint8 random_text = urand(0, 2); - - //Random yell - if (Spell[i].TextId[random_text]) - DoScriptText(Spell[i].TextId[random_text], me, target); - - //Random sound - if (Spell[i].Text_Sound[random_text]) - DoPlaySoundToSet(me, Spell[i].Text_Sound[random_text]); - } - - } - - //Spell will cast agian when the cooldown is up - if (Spell[i].CooldownRandomAddition) - Spell_Timer[i] = Spell[i].Cooldown + (rand() % Spell[i].CooldownRandomAddition); - else Spell_Timer[i] = Spell[i].Cooldown; - - } else Spell_Timer[i] -= diff; - - } - - DoMeleeAttackIfReady(); -} - diff --git a/src/server/game/AI/ScriptedAI/ScriptedSimpleAI.h b/src/server/game/AI/ScriptedAI/ScriptedSimpleAI.h deleted file mode 100644 index a38bdf85e14..00000000000 --- a/src/server/game/AI/ScriptedAI/ScriptedSimpleAI.h +++ /dev/null @@ -1,73 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* This program is free software licensed under GPL version 2 -* Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef SC_SIMPLEAI_H -#define SC_SIMPLEAI_H - -enum CastTarget -{ - CAST_SELF = 0, //Self cast - CAST_HOSTILE_TARGET, //Our current target (ie: highest aggro) - CAST_HOSTILE_SECOND_AGGRO, //Second highest aggro (generaly used for cleaves and some special attacks) - CAST_HOSTILE_LAST_AGGRO, //Dead last on aggro (no idea what this could be used for) - CAST_HOSTILE_RANDOM, //Just any random target on our threat list - CAST_FRIENDLY_RANDOM, //NOT YET IMPLEMENTED - - //Special cases - CAST_KILLEDUNIT_VICTIM, //Only works within KilledUnit function - CAST_JUSTDIED_KILLER, //Only works within JustDied function -}; - -#define MAX_SIMPLEAI_SPELLS 10 - -struct SimpleAI : public ScriptedAI -{ - SimpleAI(Creature* c);// : ScriptedAI(c); - - void Reset(); - - void EnterCombat(Unit* /*who*/); - - void KilledUnit(Unit* /*victim*/); - - void DamageTaken(Unit* killer, uint32& damage); - - void UpdateAI(const uint32 diff); - -public: - - int32 Aggro_TextId[3]; - uint32 Aggro_Sound[3]; - - int32 Death_TextId[3]; - uint32 Death_Sound[3]; - uint32 Death_Spell; - uint32 Death_Target_Type; - - int32 Kill_TextId[3]; - uint32 Kill_Sound[3]; - uint32 Kill_Spell; - uint32 Kill_Target_Type; - - struct SimpleAI_Spell - { - uint32 Spell_Id; //Spell ID to cast - int32 First_Cast; //Delay for first cast - uint32 Cooldown; //Cooldown between casts - uint32 CooldownRandomAddition; //Random addition to cooldown (in range from 0 - CooldownRandomAddition) - uint32 Cast_Target_Type; //Target type (note that certain spells may ignore this) - bool InterruptPreviousCast; //Interrupt a previous cast if this spell needs to be cast - bool Enabled; //Spell enabled or disabled (default: false) - - //3 texts to many? - int32 TextId[3]; - uint32 Text_Sound[3]; - }Spell[MAX_SIMPLEAI_SPELLS]; - -protected: - uint32 Spell_Timer[MAX_SIMPLEAI_SPELLS]; -}; - -#endif - diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index 7838e6891fe..08f1b18ffad 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -45,7 +45,7 @@ SmartAI::SmartAI(Creature* c) : CreatureAI(c) mCanRepeatPath = false; // spawn in run mode - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); mRun = false; me->GetPosition(&mLastOOCPos); @@ -68,12 +68,14 @@ SmartAI::SmartAI(Creature* c) : CreatureAI(c) mFollowCredit = 0; mFollowArrivedEntry = 0; mFollowCreditType = 0; - mInvinceabilityHpLevel = 0; + mInvincibilityHpLevel = 0; } void SmartAI::UpdateDespawn(const uint32 diff) { - if (mDespawnState <= 1 || mDespawnState > 3) return; + if (mDespawnState <= 1 || mDespawnState > 3) + return; + if (mDespawnTime < diff) { if (mDespawnState == 2) @@ -524,7 +526,7 @@ bool SmartAI::AssistPlayerInCombat(Unit* who) return false; //experimental (unknown) flag not present - if (!(me->GetCreatureInfo()->type_flags & CREATURE_TYPEFLAGS_AID_PLAYERS)) + if (!(me->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_AID_PLAYERS)) return false; //not a player @@ -561,7 +563,7 @@ void SmartAI::JustRespawned() mDespawnState = 0; mEscortState = SMART_ESCORT_NONE; me->SetVisible(true); - if (me->getFaction() != me->GetCreatureInfo()->faction_A) + if (me->getFaction() != me->GetCreatureTemplate()->faction_A) me->RestoreFaction(); GetScript()->ProcessEventsFor(SMART_EVENT_RESPAWN); Reset(); @@ -638,8 +640,8 @@ void SmartAI::SpellHitTarget(Unit* target, const SpellInfo* spellInfo) void SmartAI::DamageTaken(Unit* doneBy, uint32& damage) { GetScript()->ProcessEventsFor(SMART_EVENT_DAMAGED, doneBy, damage); - if ((me->GetHealth() - damage) <= mInvinceabilityHpLevel) - damage -= mInvinceabilityHpLevel; + if ((me->GetHealth() - damage) <= mInvincibilityHpLevel) + damage = me->GetHealth() - mInvincibilityHpLevel; } void SmartAI::HealReceived(Unit* doneBy, uint32& addhealth) @@ -720,26 +722,16 @@ uint64 SmartAI::GetGUID(int32 /*id*/) void SmartAI::SetRun(bool run) { if (run) - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); else - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); mRun = run; } void SmartAI::SetFly(bool fly) { - if (fly) - { - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, 0x01); - } - else - { - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, 0x01); - } - me->SetFlying(fly); + me->SetDisableGravity(fly); me->SendMovementFlagUpdate(); } @@ -812,12 +804,12 @@ void SmartAI::SetFollow(Unit* target, float dist, float angle, uint32 credit, ui return; SetRun(mRun); mFollowGuid = target->GetGUID(); - mFollowDist = dist ? dist : PET_FOLLOW_DIST; - mFollowAngle = angle ? angle : me->GetFollowAngle(); + mFollowDist = dist >= 0.0f ? dist : PET_FOLLOW_DIST; + mFollowAngle = angle >= 0.0f ? angle : me->GetFollowAngle(); mFollowArrivedTimer = 1000; mFollowCredit = credit; mFollowArrivedEntry = end; - me->GetMotionMaster()->MoveFollow(target, dist, angle); + me->GetMotionMaster()->MoveFollow(target, mFollowDist, mFollowAngle); mFollowCreditType = creditType; } @@ -862,7 +854,7 @@ int SmartGameObjectAI::Permissible(const GameObject* g) return PERMIT_BASE_NO; } -void SmartGameObjectAI::UpdateAI(const uint32 diff) +void SmartGameObjectAI::UpdateAI(uint32 diff) { GetScript()->OnUpdate(diff); } diff --git a/src/server/game/AI/SmartScripts/SmartAI.h b/src/server/game/AI/SmartScripts/SmartAI.h index e82b35ec87a..435aa176d4d 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.h +++ b/src/server/game/AI/SmartScripts/SmartAI.h @@ -23,7 +23,6 @@ #include "CreatureAI.h" #include "Unit.h" #include "ConditionMgr.h" -#include "CreatureTextMgr.h" #include "Spell.h" #include "SmartScript.h" @@ -63,6 +62,7 @@ class SmartAI : public CreatureAI void RemoveEscortState(uint32 uiEscortState) { mEscortState &= ~uiEscortState; } void SetAutoAttack(bool on) { mCanAutoAttack = on; } void SetCombatMove(bool on); + bool CanCombatMove() { return mCanCombatMove; } void SetFollow(Unit* target, float dist = 0.0f, float angle = 0.0f, uint32 credit = 0, uint32 end = 0, uint32 creditType = 0); void SetScript9(SmartScriptHolder& e, uint32 entry, Unit* invoker); @@ -175,7 +175,7 @@ class SmartAI : public CreatureAI void SetSwim(bool swim = true); - void SetInvinceabilityHpLevel(uint32 level) { mInvinceabilityHpLevel = level; } + void SetInvincibilityHpLevel(uint32 level) { mInvincibilityHpLevel = level; } void sGossipHello(Player* player); void sGossipSelect(Player* player, uint32 sender, uint32 action); @@ -224,8 +224,7 @@ class SmartAI : public CreatureAI bool mCanAutoAttack; bool mCanCombatMove; bool mForcedPaused; - uint32 mInvinceabilityHpLevel; - + uint32 mInvincibilityHpLevel; bool AssistPlayerInCombat(Unit* who); uint32 mDespawnTime; @@ -240,13 +239,13 @@ public: SmartGameObjectAI(GameObject* g) : GameObjectAI(g), go(g) {} ~SmartGameObjectAI() {} - void UpdateAI(const uint32 diff); + void UpdateAI(uint32 diff); void InitializeAI(); void Reset(); SmartScript* GetScript() { return &mScript; } static int Permissible(const GameObject* g); - bool GossipHello(Player* player) ; + bool GossipHello(Player* player); bool GossipSelect(Player* player, uint32 sender, uint32 action); bool GossipSelectCode(Player* /*player*/, uint32 /*sender*/, uint32 /*action*/, const char* /*code*/); bool QuestAccept(Player* player, Quest const* quest); diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 67d26ea06dd..01a9b777358 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -33,6 +33,47 @@ #include "Group.h" #include "Vehicle.h" #include "ScriptedGossip.h" +#include "CreatureTextMgr.h" + +class TrinityStringTextBuilder +{ + public: + TrinityStringTextBuilder(WorldObject* obj, ChatMsg msgtype, int32 id, uint32 language, uint64 targetGUID) + : _source(obj), _msgType(msgtype), _textId(id), _language(language), _targetGUID(targetGUID) + { + } + + size_t operator()(WorldPacket* data, LocaleConstant locale) const + { + std::string text = sObjectMgr->GetTrinityString(_textId, locale); + char const* localizedName = _source->GetNameForLocaleIdx(locale); + + *data << uint8(_msgType); + *data << uint32(_language); + *data << uint64(_source->GetGUID()); + *data << uint32(1); // 2.1.0 + *data << uint32(strlen(localizedName)+1); + *data << localizedName; + size_t whisperGUIDpos = data->wpos(); + *data << uint64(_targetGUID); // Unit Target + if (_targetGUID && !IS_PLAYER_GUID(_targetGUID)) + { + *data << uint32(1); // target name length + *data << uint8(0); // target name + } + *data << uint32(text.length() + 1); + *data << text; + *data << uint8(0); // ChatTag + + return whisperGUIDpos; + } + + WorldObject* _source; + ChatMsg _msgType; + int32 _textId; + uint32 _language; + uint64 _targetGUID; +}; SmartScript::SmartScript() { @@ -67,8 +108,11 @@ void SmartScript::OnReset() ResetBaseObject(); for (SmartAIEventList::iterator i = mEvents.begin(); i != mEvents.end(); ++i) { - InitTimer((*i)); - (*i).runOnce = false; + if (!((*i).event.event_flags & SMART_EVENT_FLAG_DONT_RESET)) + { + InitTimer((*i)); + (*i).runOnce = false; + } } ProcessEventsFor(SMART_EVENT_RESET); mLastInvoker = 0; @@ -695,7 +739,10 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u me->DoFleeToGetAssistance(); if (e.action.flee.withEmote) - sCreatureTextMgr->SendChatString(me, sObjectMgr->GetTrinityStringForDBCLocale(LANG_FLEE), CHAT_MSG_MONSTER_EMOTE); + { + TrinityStringTextBuilder builder(me, CHAT_MSG_MONSTER_EMOTE, LANG_FLEE, LANG_UNIVERSAL, 0); + sCreatureTextMgr->SendChatPacket(me, builder, CHAT_MSG_MONSTER_EMOTE); + } sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_FLEE_FOR_ASSIST: Creature %u DoFleeToGetAssistance", me->GetGUIDLow()); break; } @@ -999,9 +1046,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u break; if (e.action.invincHP.percent) - ai->SetInvinceabilityHpLevel(me->CountPctFromMaxHealth(e.action.invincHP.percent)); + ai->SetInvincibilityHpLevel(me->CountPctFromMaxHealth(e.action.invincHP.percent)); else - ai->SetInvinceabilityHpLevel(e.action.invincHP.minHP); + ai->SetInvincibilityHpLevel(e.action.invincHP.minHP); break; } case SMART_ACTION_SET_DATA: @@ -1072,12 +1119,13 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { - if (!IsUnit(*itr)) - continue; - (*itr)->GetPosition(x, y, z, o); + x += e.target.x; + y += e.target.y; + z += e.target.z; + o += e.target.o; if (Creature* summon = GetBaseObject()->SummonCreature(e.action.summonCreature.creature, x, y, z, o, (TempSummonType)e.action.summonCreature.type, e.action.summonCreature.duration)) - if (unit && e.action.summonCreature.attackInvoker) + if (e.action.summonCreature.attackInvoker) summon->AI()->AttackStart((*itr)->ToUnit()); } @@ -1107,6 +1155,10 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u continue; (*itr)->GetPosition(x, y, z, o); + x += e.target.x; + y += e.target.y; + z += e.target.z; + o += e.target.o; GetBaseObject()->SummonGameObject(e.action.summonGO.entry, x, y, z, o, 0, 0, 0, 0, e.action.summonGO.despawnTime); } @@ -1320,19 +1372,20 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u e.GetTargetType() == SMART_TARGET_CREATURE_DISTANCE || e.GetTargetType() == SMART_TARGET_GAMEOBJECT_RANGE || e.GetTargetType() == SMART_TARGET_GAMEOBJECT_GUID || e.GetTargetType() == SMART_TARGET_GAMEOBJECT_DISTANCE || e.GetTargetType() == SMART_TARGET_CLOSEST_CREATURE || e.GetTargetType() == SMART_TARGET_CLOSEST_GAMEOBJECT || - e.GetTargetType() == SMART_TARGET_OWNER_OR_SUMMONER) + e.GetTargetType() == SMART_TARGET_OWNER_OR_SUMMONER || e.GetTargetType() == SMART_TARGET_ACTION_INVOKER) { ObjectList* targets = GetTargets(e, unit); if (!targets) break; target = targets->front(); + delete targets; } - if(!target) - me->GetMotionMaster()->MovePoint(0, e.target.x, e.target.y, e.target.z); + if (!target) + me->GetMotionMaster()->MovePoint(e.action.MoveToPos.pointId, e.target.x, e.target.y, e.target.z); else - me->GetMotionMaster()->MovePoint(0, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ()); + me->GetMotionMaster()->MovePoint(e.action.MoveToPos.pointId, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ()); break; } case SMART_ACTION_RESPAWN_TARGET: @@ -1481,6 +1534,27 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u case SMART_ACTION_CALL_SCRIPT_RESET: OnReset(); break; + case SMART_ACTION_SET_RANGED_MOVEMENT: + { + if (!IsSmart()) + break; + + float attackDistance = (float)e.action.setRangedMovement.distance; + float attackAngle = e.action.setRangedMovement.angle / 180.0f * M_PI; + + ObjectList* targets = GetTargets(e, unit); + if (targets) + { + for (ObjectList::iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (Creature* target = (*itr)->ToCreature()) + if (IsSmart(target) && target->getVictim()) + if (CAST_AI(SmartAI, target->AI())->CanCombatMove()) + target->GetMotionMaster()->MoveChase(target->getVictim(), attackDistance, attackAngle); + + delete targets; + } + break; + } case SMART_ACTION_CALL_TIMED_ACTIONLIST: { if (e.GetTargetType() == SMART_TARGET_NONE) @@ -1817,19 +1891,26 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (!targets) break; + ObjectList* storedTargets = GetTargetList(e.action.sendTargetToTarget.id); + if (!storedTargets) + { + delete targets; + return; + } + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { if (IsCreature(*itr)) { if (SmartAI* ai = CAST_AI(SmartAI, (*itr)->ToCreature()->AI())) - ai->GetScript()->StoreTargetList(GetTargetList(e.action.sendTargetToTarget.id), e.action.sendTargetToTarget.id); + ai->GetScript()->StoreTargetList(new ObjectList(*storedTargets), e.action.sendTargetToTarget.id); // store a copy of target list else sLog->outErrorDb("SmartScript: Action target for SMART_ACTION_SEND_TARGET_TO_TARGET is not using SmartAI, skipping"); } else if (IsGameObject(*itr)) { if (SmartGameObjectAI* ai = CAST_AI(SmartGameObjectAI, (*itr)->ToGameObject()->AI())) - ai->GetScript()->StoreTargetList(GetTargetList(e.action.sendTargetToTarget.id), e.action.sendTargetToTarget.id); + ai->GetScript()->StoreTargetList(new ObjectList(*storedTargets), e.action.sendTargetToTarget.id); // store a copy of target list else sLog->outErrorDb("SmartScript: Action target for SMART_ACTION_SEND_TARGET_TO_TARGET is not using SmartGameObjectAI, skipping"); } @@ -1865,7 +1946,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u break; } default: - sLog->outErrorDb("SmartScript::ProcessAction: Unhandled Action type %u", e.GetActionType()); + sLog->outErrorDb("SmartScript::ProcessAction: Entry %d SourceType %u, Event %u, Unhandled Action type %u", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType()); break; } @@ -1909,7 +1990,8 @@ void SmartScript::InstallTemplate(SmartScriptHolder const& e) } case SMARTAI_TEMPLATE_CAGED_NPC_PART: { - if (!me) return; + if (!me) + return; //store cage as id1 AddEvent(SMART_EVENT_DATA_SET, 0, 0, 0, 0, 0, SMART_ACTION_STORE_TARGET_LIST, 1, 0, 0, 0, 0, 0, SMART_TARGET_CLOSEST_GAMEOBJECT, e.action.installTtemplate.param1, 10, 0, 0); @@ -1931,7 +2013,8 @@ void SmartScript::InstallTemplate(SmartScriptHolder const& e) } case SMARTAI_TEMPLATE_CAGED_GO_PART: { - if (!go) return; + if (!go) + return; //store hostage as id1 AddEvent(SMART_EVENT_GOSSIP_HELLO, 0, 0, 0, 0, 0, SMART_ACTION_STORE_TARGET_LIST, 1, 0, 0, 0, 0, 0, SMART_TARGET_CLOSEST_CREATURE, e.action.installTtemplate.param1, 10, 0, 0); //store invoker as id2 @@ -2794,8 +2877,12 @@ void SmartScript::InstallEvents() bool SmartScript::ConditionValid(Unit* u, int32 c, int32 v1, int32 v2, int32 v3) { - if (c == 0) return true; - if (!u || !u->ToPlayer()) return false; + if (c == 0) + return true; + + if (!u || !u->ToPlayer()) + return false; + Condition cond; cond.ConditionType = ConditionTypes(uint32(c)); cond.ConditionValue1 = uint32(v1); @@ -2962,7 +3049,9 @@ void SmartScript::OnMoveInLineOfSight(Unit* who) { ProcessEventsFor(SMART_EVENT_OOC_LOS, who); - if (!me) return; + if (!me) + return; + if (me->getVictim()) return; diff --git a/src/server/game/AI/SmartScripts/SmartScript.h b/src/server/game/AI/SmartScripts/SmartScript.h index f7524582ab7..5fb691c87f2 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.h +++ b/src/server/game/AI/SmartScripts/SmartScript.h @@ -23,7 +23,6 @@ #include "CreatureAI.h" #include "Unit.h" #include "ConditionMgr.h" -#include "CreatureTextMgr.h" #include "Spell.h" #include "GridNotifiers.h" @@ -99,7 +98,13 @@ class SmartScript return; if (mTargetStorage->find(id) != mTargetStorage->end()) + { + // check if already stored + if ((*mTargetStorage)[id] == targets) + return; + delete (*mTargetStorage)[id]; + } (*mTargetStorage)[id] = targets; } diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index f99e317454c..a7149f37480 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -27,6 +27,7 @@ #include "InstanceScript.h" #include "ScriptedCreature.h" #include "GameEventMgr.h" +#include "CreatureTextMgr.h" #include "SmartScriptMgr.h" @@ -34,6 +35,14 @@ void SmartWaypointMgr::LoadFromDB() { uint32 oldMSTime = getMSTime(); + for (UNORDERED_MAP::iterator itr = waypoint_map.begin(); itr != waypoint_map.end(); ++itr) + { + for (WPPath::iterator pathItr = itr->second->begin(); pathItr != itr->second->end(); ++pathItr) + delete pathItr->second; + + delete itr->second; + } + waypoint_map.clear(); PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_SMARTAI_WP); @@ -48,7 +57,6 @@ void SmartWaypointMgr::LoadFromDB() uint32 count = 0; uint32 total = 0; - WPPath* path = NULL; uint32 last_entry = 0; uint32 last_id = 1; @@ -62,27 +70,19 @@ void SmartWaypointMgr::LoadFromDB() y = fields[3].GetFloat(); z = fields[4].GetFloat(); - WayPoint* wp = new WayPoint(id, x, y, z); - if (last_entry != entry) { - path = new WPPath; + waypoint_map[entry] = new WPPath(); last_id = 1; + count++; } if (last_id != id) - { sLog->outErrorDb("SmartWaypointMgr::LoadFromDB: Path entry %u, unexpected point id %u, expected %u.", entry, id, last_id); - } last_id++; - (*path)[id] = wp; + (*waypoint_map[entry])[id] = new WayPoint(id, x, y, z); - if (last_entry != entry) - { - count++; - waypoint_map[entry] = path; - } last_entry = entry; total++; } @@ -92,6 +92,19 @@ void SmartWaypointMgr::LoadFromDB() sLog->outString(); } +SmartWaypointMgr::~SmartWaypointMgr() +{ + for (UNORDERED_MAP::iterator itr = waypoint_map.begin(); itr != waypoint_map.end(); ++itr) + { + for (WPPath::iterator pathItr = itr->second->begin(); pathItr != itr->second->end(); ++pathItr) + delete pathItr->second; + + delete itr->second; + } + + waypoint_map.clear(); +} + void SmartAIMgr::LoadSmartAIFromDB() { uint32 oldMSTime = getMSTime(); @@ -185,7 +198,6 @@ void SmartAIMgr::LoadSmartAIFromDB() temp.event.raw.param4 = fields[11].GetUInt32(); temp.action.type = (SMART_ACTION)fields[12].GetUInt8(); - temp.action.raw.param1 = fields[13].GetUInt32(); temp.action.raw.param2 = fields[14].GetUInt32(); temp.action.raw.param3 = fields[15].GetUInt32(); @@ -312,7 +324,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) sLog->outErrorDb("SmartAIMgr: EntryOrGuid %d, event type %u can not be used for Script type %u", e.entryOrGuid, e.GetEventType(), e.GetScriptType()); return false; } - if (e.action.type >= SMART_ACTION_END) + if (e.action.type <= 0 || e.action.type >= SMART_ACTION_END) { sLog->outErrorDb("SmartAIMgr: EntryOrGuid %d using event(%u) has invalid action type (%u), skipped.", e.entryOrGuid, e.event_id, e.GetActionType()); return false; @@ -322,11 +334,19 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) sLog->outErrorDb("SmartAIMgr: EntryOrGuid %d using event(%u) has invalid phase mask (%u), skipped.", e.entryOrGuid, e.event_id, e.event.event_phase_mask); return false; } + if (e.event.event_flags > SMART_EVENT_FLAGS_ALL) + { + sLog->outErrorDb("SmartAIMgr: EntryOrGuid %d using event(%u) has invalid event flags (%u), skipped.", e.entryOrGuid, e.event_id, e.event.event_flags); + return false; + } if (e.GetScriptType() == SMART_SCRIPT_TYPE_TIMED_ACTIONLIST) { e.event.type = SMART_EVENT_UPDATE_OOC;//force default OOC, can change when calling the script! - if (!IsMinMaxValid(e, e.event.minMaxRepeat.min, e.event.minMaxRepeat.max)) return false; - if (!IsMinMaxValid(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax)) return false; + if (!IsMinMaxValid(e, e.event.minMaxRepeat.min, e.event.minMaxRepeat.max)) + return false; + + if (!IsMinMaxValid(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax)) + return false; } else { @@ -344,8 +364,11 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) case SMART_EVENT_DAMAGED: case SMART_EVENT_DAMAGED_TARGET: case SMART_EVENT_RECEIVE_HEAL: - if (!IsMinMaxValid(e, e.event.minMaxRepeat.min, e.event.minMaxRepeat.max)) return false; - if (!IsMinMaxValid(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax)) return false; + if (!IsMinMaxValid(e, e.event.minMaxRepeat.min, e.event.minMaxRepeat.max)) + return false; + + if (!IsMinMaxValid(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax)) + return false; break; case SMART_EVENT_SPELLHIT: case SMART_EVENT_SPELLHIT_TARGET: @@ -363,11 +386,13 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) return false; } } - if (!IsMinMaxValid(e, e.event.spellHit.cooldownMin, e.event.spellHit.cooldownMax)) return false; + if (!IsMinMaxValid(e, e.event.spellHit.cooldownMin, e.event.spellHit.cooldownMax)) + return false; break; case SMART_EVENT_OOC_LOS: case SMART_EVENT_IC_LOS: - if (!IsMinMaxValid(e, e.event.los.cooldownMin, e.event.los.cooldownMax)) return false; + if (!IsMinMaxValid(e, e.event.los.cooldownMin, e.event.los.cooldownMax)) + return false; break; case SMART_EVENT_RESPAWN: if (e.event.respawn.type == SMART_SCRIPT_RESPAWN_CONDITION_MAP && !sMapStore.LookupEntry(e.event.respawn.map)) @@ -382,32 +407,48 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) } break; case SMART_EVENT_FRIENDLY_HEALTH: - if (!NotNULL(e, e.event.friendlyHealt.radius)) return false; - if (!IsMinMaxValid(e, e.event.friendlyHealt.repeatMin, e.event.friendlyHealt.repeatMax)) return false; + if (!NotNULL(e, e.event.friendlyHealt.radius)) + return false; + + if (!IsMinMaxValid(e, e.event.friendlyHealt.repeatMin, e.event.friendlyHealt.repeatMax)) + return false; break; case SMART_EVENT_FRIENDLY_IS_CC: - if (!IsMinMaxValid(e, e.event.friendlyCC.repeatMin, e.event.friendlyCC.repeatMax)) return false; + if (!IsMinMaxValid(e, e.event.friendlyCC.repeatMin, e.event.friendlyCC.repeatMax)) + return false; break; case SMART_EVENT_FRIENDLY_MISSING_BUFF: { - if (!IsSpellValid(e, e.event.missingBuff.spell)) return false; - if (!NotNULL(e, e.event.missingBuff.radius)) return false; - if (!IsMinMaxValid(e, e.event.missingBuff.repeatMin, e.event.missingBuff.repeatMax)) return false; + if (!IsSpellValid(e, e.event.missingBuff.spell)) + return false; + + if (!NotNULL(e, e.event.missingBuff.radius)) + return false; + + if (!IsMinMaxValid(e, e.event.missingBuff.repeatMin, e.event.missingBuff.repeatMax)) + return false; break; } case SMART_EVENT_KILL: - if (!IsMinMaxValid(e, e.event.kill.cooldownMin, e.event.kill.cooldownMax)) return false; - if (e.event.kill.creature && !IsCreatureValid(e, e.event.kill.creature)) return false; + if (!IsMinMaxValid(e, e.event.kill.cooldownMin, e.event.kill.cooldownMax)) + return false; + + if (e.event.kill.creature && !IsCreatureValid(e, e.event.kill.creature)) + return false; break; case SMART_EVENT_TARGET_CASTING: case SMART_EVENT_PASSENGER_BOARDED: case SMART_EVENT_PASSENGER_REMOVED: - if (!IsMinMaxValid(e, e.event.minMax.repeatMin, e.event.minMax.repeatMax)) return false; + if (!IsMinMaxValid(e, e.event.minMax.repeatMin, e.event.minMax.repeatMax)) + return false; break; case SMART_EVENT_SUMMON_DESPAWNED: case SMART_EVENT_SUMMONED_UNIT: - if (e.event.summoned.creature && !IsCreatureValid(e, e.event.summoned.creature)) return false; - if (!IsMinMaxValid(e, e.event.summoned.cooldownMin, e.event.summoned.cooldownMax)) return false; + if (e.event.summoned.creature && !IsCreatureValid(e, e.event.summoned.creature)) + return false; + + if (!IsMinMaxValid(e, e.event.summoned.cooldownMin, e.event.summoned.cooldownMax)) + return false; break; case SMART_EVENT_ACCEPTED_QUEST: case SMART_EVENT_REWARD_QUEST: @@ -416,20 +457,27 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) break; case SMART_EVENT_RECEIVE_EMOTE: { - if (e.event.emote.emote && !IsTextEmoteValid(e, e.event.emote.emote)) return false; - if (!IsMinMaxValid(e, e.event.emote.cooldownMin, e.event.emote.cooldownMax)) return false; + if (e.event.emote.emote && !IsTextEmoteValid(e, e.event.emote.emote)) + return false; + + if (!IsMinMaxValid(e, e.event.emote.cooldownMin, e.event.emote.cooldownMax)) + return false; break; } case SMART_EVENT_HAS_AURA: case SMART_EVENT_TARGET_BUFFED: { - if (!IsSpellValid(e, e.event.aura.spell)) return false; - if (!IsMinMaxValid(e, e.event.aura.repeatMin, e.event.aura.repeatMax)) return false; + if (!IsSpellValid(e, e.event.aura.spell)) + return false; + + if (!IsMinMaxValid(e, e.event.aura.repeatMin, e.event.aura.repeatMax)) + return false; break; } case SMART_EVENT_TRANSPORT_ADDCREATURE: { - if (e.event.transportAddCreature.creature && !IsCreatureValid(e, e.event.transportAddCreature.creature)) return false; + if (e.event.transportAddCreature.creature && !IsCreatureValid(e, e.event.transportAddCreature.creature)) + return false; break; } case SMART_EVENT_MOVEMENTINFORM: @@ -443,12 +491,14 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) } case SMART_EVENT_DATA_SET: { - if (!IsMinMaxValid(e, e.event.dataSet.cooldownMin, e.event.dataSet.cooldownMax)) return false; + if (!IsMinMaxValid(e, e.event.dataSet.cooldownMin, e.event.dataSet.cooldownMax)) + return false; break; } case SMART_EVENT_AREATRIGGER_ONTRIGGER: { - if (e.event.areatrigger.id && !IsAreaTriggerValid(e, e.event.areatrigger.id)) return false; + if (e.event.areatrigger.id && !IsAreaTriggerValid(e, e.event.areatrigger.id)) + return false; break; } case SMART_EVENT_TEXT_OVER: @@ -464,8 +514,11 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) break; } case SMART_EVENT_DUMMY_EFFECT: - if (!IsSpellValid(e, e.event.dummy.spell)) return false; - if (e.event.dummy.effIndex > EFFECT_2) return false; + if (!IsSpellValid(e, e.event.dummy.spell)) + return false; + + if (e.event.dummy.effIndex > EFFECT_2) + return false; break; case SMART_EVENT_IS_BEHIND_TARGET: if (!IsMinMaxValid(e, e.event.behindTarget.cooldownMin, e.event.behindTarget.cooldownMax)) @@ -562,11 +615,13 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) break; case SMART_ACTION_SET_EMOTE_STATE: case SMART_ACTION_PLAY_EMOTE: - if (!IsEmoteValid(e, e.action.emote.emote)) return false; + if (!IsEmoteValid(e, e.action.emote.emote)) + return false; break; case SMART_ACTION_FAIL_QUEST: case SMART_ACTION_ADD_QUEST: - if (!e.action.quest.quest || !IsQuestValid(e, e.action.quest.quest)) return false; + if (!e.action.quest.quest || !IsQuestValid(e, e.action.quest.quest)) + return false; break; case SMART_ACTION_ACTIVATE_TAXI: { @@ -578,17 +633,29 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) break; } case SMART_ACTION_RANDOM_EMOTE: - if (e.action.randomEmote.emote1 && !IsEmoteValid(e, e.action.randomEmote.emote1)) return false; - if (e.action.randomEmote.emote2 && !IsEmoteValid(e, e.action.randomEmote.emote2)) return false; - if (e.action.randomEmote.emote3 && !IsEmoteValid(e, e.action.randomEmote.emote3)) return false; - if (e.action.randomEmote.emote4 && !IsEmoteValid(e, e.action.randomEmote.emote4)) return false; - if (e.action.randomEmote.emote5 && !IsEmoteValid(e, e.action.randomEmote.emote5)) return false; - if (e.action.randomEmote.emote6 && !IsEmoteValid(e, e.action.randomEmote.emote6)) return false; + if (e.action.randomEmote.emote1 && !IsEmoteValid(e, e.action.randomEmote.emote1)) + return false; + + if (e.action.randomEmote.emote2 && !IsEmoteValid(e, e.action.randomEmote.emote2)) + return false; + + if (e.action.randomEmote.emote3 && !IsEmoteValid(e, e.action.randomEmote.emote3)) + return false; + + if (e.action.randomEmote.emote4 && !IsEmoteValid(e, e.action.randomEmote.emote4)) + return false; + + if (e.action.randomEmote.emote5 && !IsEmoteValid(e, e.action.randomEmote.emote5)) + return false; + + if (e.action.randomEmote.emote6 && !IsEmoteValid(e, e.action.randomEmote.emote6)) + return false; break; case SMART_ACTION_ADD_AURA: case SMART_ACTION_CAST: case SMART_ACTION_INVOKER_CAST: - if (!IsSpellValid(e, e.action.cast.spell)) return false; + if (!IsSpellValid(e, e.action.cast.spell)) + return false; break; case SMART_ACTION_CALL_AREAEXPLOREDOREVENTHAPPENS: case SMART_ACTION_CALL_GROUPEVENTHAPPENS: @@ -607,8 +674,11 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) } break; case SMART_ACTION_SEND_CASTCREATUREORGO: - if (!IsQuestValid(e, e.action.castCreatureOrGO.quest)) return false; - if (!IsSpellValid(e, e.action.castCreatureOrGO.spell)) return false; + if (!IsQuestValid(e, e.action.castCreatureOrGO.quest)) + return false; + + if (!IsSpellValid(e, e.action.castCreatureOrGO.spell)) + return false; break; @@ -632,11 +702,15 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) } break; case SMART_ACTION_CALL_CASTEDCREATUREORGO: - if (!IsCreatureValid(e, e.action.castedCreatureOrGO.creature)) return false; - if (!IsSpellValid(e, e.action.castedCreatureOrGO.spell)) return false; + if (!IsCreatureValid(e, e.action.castedCreatureOrGO.creature)) + return false; + + if (!IsSpellValid(e, e.action.castedCreatureOrGO.spell)) + return false; break; case SMART_ACTION_REMOVEAURASFROMSPELL: - if (!IsSpellValid(e, e.action.removeAura.spell)) return false; + if (!IsSpellValid(e, e.action.removeAura.spell)) + return false; break; case SMART_ACTION_RANDOM_PHASE: { @@ -660,11 +734,13 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u attempts to set invalid phase, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType()); return false; } - if (!IsMinMaxValid(e, e.action.randomPhaseRange.phaseMin, e.action.randomPhaseRange.phaseMax)) return false; + if (!IsMinMaxValid(e, e.action.randomPhaseRange.phaseMin, e.action.randomPhaseRange.phaseMax)) + return false; break; } case SMART_ACTION_SUMMON_CREATURE: - if (!IsCreatureValid(e, e.action.summonCreature.creature)) return false; + if (!IsCreatureValid(e, e.action.summonCreature.creature)) + return false; if (e.action.summonCreature.type < TEMPSUMMON_TIMED_OR_DEAD_DESPAWN || e.action.summonCreature.type > TEMPSUMMON_MANUAL_DESPAWN) { sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses incorrect TempSummonType %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.summonCreature.type); @@ -672,10 +748,12 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) } break; case SMART_ACTION_CALL_KILLEDMONSTER: - if (!IsCreatureValid(e, e.action.killedMonster.creature)) return false; + if (!IsCreatureValid(e, e.action.killedMonster.creature)) + return false; break; case SMART_ACTION_UPDATE_TEMPLATE: - if (e.action.updateTemplate.creature && !IsCreatureValid(e, e.action.updateTemplate.creature)) return false; + if (e.action.updateTemplate.creature && !IsCreatureValid(e, e.action.updateTemplate.creature)) + return false; break; case SMART_ACTION_SET_SHEATH: if (e.action.setSheath.sheath && e.action.setSheath.sheath >= MAX_SHEATH_STATE) @@ -694,12 +772,16 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) break; } case SMART_ACTION_SUMMON_GO: - if (!IsGameObjectValid(e, e.action.summonGO.entry)) return false; + if (!IsGameObjectValid(e, e.action.summonGO.entry)) + return false; break; case SMART_ACTION_ADD_ITEM: case SMART_ACTION_REMOVE_ITEM: - if (!IsItemValid(e, e.action.item.entry)) return false; - if (!NotNULL(e, e.action.item.count)) return false; + if (!IsItemValid(e, e.action.item.entry)) + return false; + + if (!NotNULL(e, e.action.item.count)) + return false; break; case SMART_ACTION_TELEPORT: if (!sMapStore.LookupEntry(e.action.teleport.mapID)) @@ -716,7 +798,8 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) } break; case SMART_ACTION_WP_STOP: - if (e.action.wpStop.quest && !IsQuestValid(e, e.action.wpStop.quest)) return false; + if (e.action.wpStop.quest && !IsQuestValid(e, e.action.wpStop.quest)) + return false; break; case SMART_ACTION_WP_START: { @@ -725,7 +808,8 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) sLog->outErrorDb("SmartAIMgr: Creature %d Event %u Action %u uses non-existent WaypointPath id %u, skipped.", e.entryOrGuid, e.event_id, e.GetActionType(), e.action.wpStart.pathID); return false; } - if (e.action.wpStart.quest && !IsQuestValid(e, e.action.wpStart.quest)) return false; + if (e.action.wpStart.quest && !IsQuestValid(e, e.action.wpStart.quest)) + return false; if (e.action.wpStart.reactState > REACT_AGGRESSIVE) { sLog->outErrorDb("SmartAIMgr: Creature %d Event %u Action %u uses invalid React State %u, skipped.", e.entryOrGuid, e.event_id, e.GetActionType(), e.action.wpStart.reactState); @@ -735,8 +819,11 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) } case SMART_ACTION_CREATE_TIMED_EVENT: { - if (!IsMinMaxValid(e, e.action.timeEvent.min, e.action.timeEvent.max)) return false; - if (!IsMinMaxValid(e, e.action.timeEvent.repeatMin, e.action.timeEvent.repeatMax)) return false; + if (!IsMinMaxValid(e, e.action.timeEvent.min, e.action.timeEvent.max)) + return false; + + if (!IsMinMaxValid(e, e.action.timeEvent.repeatMin, e.action.timeEvent.repeatMax)) + return false; break; } case SMART_ACTION_FOLLOW: diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index 7869a2e665f..e6c5eb727d7 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -23,7 +23,6 @@ #include "CreatureAI.h" #include "Unit.h" #include "ConditionMgr.h" -#include "CreatureTextMgr.h" #include "Spell.h" #include "DB2Stores.h" @@ -443,7 +442,7 @@ enum SMART_ACTION SMART_ACTION_CREATE_TIMED_EVENT = 67, // id, InitialMin, InitialMax, RepeatMin(only if it repeats), RepeatMax(only if it repeats), chance SMART_ACTION_PLAYMOVIE = 68, // entry - SMART_ACTION_MOVE_TO_POS = 69, // xyz + SMART_ACTION_MOVE_TO_POS = 69, // PointId, xyz SMART_ACTION_RESPAWN_TARGET = 70, // SMART_ACTION_EQUIP = 71, // entry, slotmask slot1, slot2, slot3 , only slots with mask set will be sent to client, bits are 1, 2, 4, leaving mask 0 is defaulted to mask 7 (send all), slots1-3 are only used if no entry is set SMART_ACTION_CLOSE_GOSSIP = 72, // none @@ -453,7 +452,7 @@ enum SMART_ACTION SMART_ACTION_OVERRIDE_SCRIPT_BASE_OBJECT = 76, // WARNING: CAN CRASH CORE, do not use if you dont know what you are doing SMART_ACTION_RESET_SCRIPT_BASE_OBJECT = 77, // none SMART_ACTION_CALL_SCRIPT_RESET = 78, // none - // Unused = 79, + SMART_ACTION_SET_RANGED_MOVEMENT = 79, // Distance, angle SMART_ACTION_CALL_TIMED_ACTIONLIST = 80, // ID (overwrites already running actionlist), stop after combat?(0/1), timer update type(0-OOC, 1-IC, 2-ALWAYS) SMART_ACTION_SET_NPC_FLAG = 81, // Flags SMART_ACTION_ADD_NPC_FLAG = 82, // Flags @@ -874,6 +873,11 @@ struct SmartAction uint32 goRespawnTime; } RespawnTarget; + struct + { + uint8 pointId; + } MoveToPos; + struct { uint32 gossipMenuId; @@ -890,6 +894,12 @@ struct SmartAction uint32 id; } sendTargetToTarget; + struct + { + float distance; + float angle; + } setRangedMovement; + struct { uint32 param1; @@ -1162,16 +1172,18 @@ const uint32 SmartAIEventMask[SMART_EVENT_END][2] = enum SmartEventFlags { - SMART_EVENT_FLAG_NOT_REPEATABLE = 0x01, //Event can not repeat - SMART_EVENT_FLAG_DIFFICULTY_0 = 0x02, //Event only occurs in instance difficulty 0 - SMART_EVENT_FLAG_DIFFICULTY_1 = 0x04, //Event only occurs in instance difficulty 1 - SMART_EVENT_FLAG_DIFFICULTY_2 = 0x08, //Event only occurs in instance difficulty 2 - SMART_EVENT_FLAG_DIFFICULTY_3 = 0x10, //Event only occurs in instance difficulty 3 - SMART_EVENT_FLAG_RESERVED_5 = 0x20, - SMART_EVENT_FLAG_RESERVED_6 = 0x40, - SMART_EVENT_FLAG_DEBUG_ONLY = 0x80, //Event only occurs in debug build - - SMART_EVENT_FLAG_DIFFICULTY_ALL = (SMART_EVENT_FLAG_DIFFICULTY_0|SMART_EVENT_FLAG_DIFFICULTY_1|SMART_EVENT_FLAG_DIFFICULTY_2|SMART_EVENT_FLAG_DIFFICULTY_3) + SMART_EVENT_FLAG_NOT_REPEATABLE = 0x001, //Event can not repeat + SMART_EVENT_FLAG_DIFFICULTY_0 = 0x002, //Event only occurs in instance difficulty 0 + SMART_EVENT_FLAG_DIFFICULTY_1 = 0x004, //Event only occurs in instance difficulty 1 + SMART_EVENT_FLAG_DIFFICULTY_2 = 0x008, //Event only occurs in instance difficulty 2 + SMART_EVENT_FLAG_DIFFICULTY_3 = 0x010, //Event only occurs in instance difficulty 3 + SMART_EVENT_FLAG_RESERVED_5 = 0x020, + SMART_EVENT_FLAG_RESERVED_6 = 0x040, + SMART_EVENT_FLAG_DEBUG_ONLY = 0x080, //Event only occurs in debug build + SMART_EVENT_FLAG_DONT_RESET = 0x100, //Event will not reset in SmartScript::OnReset() + + SMART_EVENT_FLAG_DIFFICULTY_ALL = (SMART_EVENT_FLAG_DIFFICULTY_0|SMART_EVENT_FLAG_DIFFICULTY_1|SMART_EVENT_FLAG_DIFFICULTY_2|SMART_EVENT_FLAG_DIFFICULTY_3), + SMART_EVENT_FLAGS_ALL = (SMART_EVENT_FLAG_NOT_REPEATABLE|SMART_EVENT_FLAG_DIFFICULTY_ALL|SMART_EVENT_FLAG_RESERVED_5|SMART_EVENT_FLAG_RESERVED_6|SMART_EVENT_FLAG_DEBUG_ONLY|SMART_EVENT_FLAG_DONT_RESET) }; enum SmartCastFlags @@ -1227,9 +1239,9 @@ typedef UNORDERED_MAP ObjectListMap; class SmartWaypointMgr { friend class ACE_Singleton; - SmartWaypointMgr(){}; + SmartWaypointMgr() {} public: - ~SmartWaypointMgr(){}; + ~SmartWaypointMgr(); void LoadFromDB(); diff --git a/src/server/game/Accounts/AccountMgr.cpp b/src/server/game/Accounts/AccountMgr.cpp index a6ae300e25d..8076f800356 100755 --- a/src/server/game/Accounts/AccountMgr.cpp +++ b/src/server/game/Accounts/AccountMgr.cpp @@ -53,12 +53,21 @@ AccountOpResult CreateAccount(std::string username, std::string password) AccountOpResult DeleteAccount(uint32 accountId) { - QueryResult result = LoginDatabase.PQuery("SELECT 1 FROM account WHERE id='%d'", accountId); + // Check if accounts exists + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_BY_ID); + stmt->setUInt32(0, accountId); + PreparedQueryResult result = LoginDatabase.Query(stmt); + if (!result) - return AOR_NAME_NOT_EXIST; // account doesn't exist + return AOR_NAME_NOT_EXIST; + + // Obtain accounts characters + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARS_BY_ACCOUNT_ID); + + stmt->setUInt32(0, accountId); + + result = CharacterDatabase.Query(stmt); - // existed characters list - result = CharacterDatabase.PQuery("SELECT guid FROM characters WHERE account='%d'", accountId); if (result) { do @@ -66,7 +75,7 @@ AccountOpResult DeleteAccount(uint32 accountId) uint32 guidLow = (*result)[0].GetUInt32(); uint64 guid = MAKE_NEW_GUID(guidLow, 0, HIGHGUID_PLAYER); - // kick if player is online + // Kick if player is online if (Player* p = ObjectAccessor::FindPlayer(guid)) { WorldSession* s = p->GetSession(); @@ -79,18 +88,35 @@ AccountOpResult DeleteAccount(uint32 accountId) } // table realm specific but common for all characters of account for realm - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_TUTORIALS); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_TUTORIALS); stmt->setUInt32(0, accountId); CharacterDatabase.Execute(stmt); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ACCOUNT_DATA); stmt->setUInt32(0, accountId); CharacterDatabase.Execute(stmt); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHARACTER_BAN); + stmt->setUInt32(0, accountId); + CharacterDatabase.Execute(stmt); + SQLTransaction trans = LoginDatabase.BeginTransaction(); - trans->PAppend("DELETE FROM account WHERE id='%d'", accountId); - trans->PAppend("DELETE FROM account_access WHERE id ='%d'", accountId); - trans->PAppend("DELETE FROM realmcharacters WHERE acctid='%d'", accountId); + stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_ACCOUNT); + stmt->setUInt32(0, accountId); + trans->Append(stmt); + + stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_ACCOUNT_ACCESS); + stmt->setUInt32(0, accountId); + trans->Append(stmt); + + stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_REALM_CHARACTERS); + stmt->setUInt32(0, accountId); + trans->Append(stmt); + + stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_ACCOUNT_BANNED); + stmt->setUInt32(0, accountId); + trans->Append(stmt); LoginDatabase.CommitTransaction(trans); @@ -99,9 +125,13 @@ AccountOpResult DeleteAccount(uint32 accountId) AccountOpResult ChangeUsername(uint32 accountId, std::string newUsername, std::string newPassword) { - QueryResult result = LoginDatabase.PQuery("SELECT 1 FROM account WHERE id='%d'", accountId); + // Check if accounts exists + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_BY_ID); + stmt->setUInt32(0, accountId); + PreparedQueryResult result = LoginDatabase.Query(stmt); + if (!result) - return AOR_NAME_NOT_EXIST; // account doesn't exist + return AOR_NAME_NOT_EXIST; if (utf8length(newUsername) > MAX_ACCOUNT_STR) return AOR_NAME_TOO_LONG; @@ -112,7 +142,7 @@ AccountOpResult ChangeUsername(uint32 accountId, std::string newUsername, std::s normalizeString(newUsername); normalizeString(newPassword); - PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_USERNAME); + stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_USERNAME); stmt->setString(0, newUsername); stmt->setString(1, CalculateShaPassHash(newUsername, newPassword)); @@ -148,28 +178,38 @@ AccountOpResult ChangePassword(uint32 accountId, std::string newPassword) uint32 GetId(std::string username) { - LoginDatabase.EscapeString(username); - QueryResult result = LoginDatabase.PQuery("SELECT id FROM account WHERE username = '%s'", username.c_str()); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_GET_ACCOUNT_ID_BY_USERNAME); + stmt->setString(0, username); + PreparedQueryResult result = LoginDatabase.Query(stmt); + return (result) ? (*result)[0].GetUInt32() : 0; } uint32 GetSecurity(uint32 accountId) { - QueryResult result = LoginDatabase.PQuery("SELECT gmlevel FROM account_access WHERE id = '%u'", accountId); - return (result) ? (*result)[0].GetUInt32() : 0; + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_GET_ACCOUNT_ACCESS_GMLEVEL); + stmt->setUInt32(0, accountId); + PreparedQueryResult result = LoginDatabase.Query(stmt); + + return (result) ? (*result)[0].GetUInt8() : uint32(SEC_PLAYER); } -uint32 GetSecurity(uint64 accountId, int32 realmId) +uint32 GetSecurity(uint32 accountId, int32 realmId) { - QueryResult result = (realmId == -1) - ? LoginDatabase.PQuery("SELECT gmlevel FROM account_access WHERE id = '%u' AND RealmID = '%d'", accountId, realmId) - : LoginDatabase.PQuery("SELECT gmlevel FROM account_access WHERE id = '%u' AND (RealmID = '%d' OR RealmID = '-1')", accountId, realmId); - return (result) ? (*result)[0].GetUInt32() : 0; + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_GET_GMLEVEL_BY_REALMID); + stmt->setUInt32(0, accountId); + stmt->setInt32(1, realmId); + PreparedQueryResult result = LoginDatabase.Query(stmt); + + return (result) ? (*result)[0].GetUInt8() : uint32(SEC_PLAYER); } bool GetName(uint32 accountId, std::string& name) { - QueryResult result = LoginDatabase.PQuery("SELECT username FROM account WHERE id = '%u'", accountId); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_GET_USERNAME_BY_ID); + stmt->setUInt32(0, accountId); + PreparedQueryResult result = LoginDatabase.Query(stmt); + if (result) { name = (*result)[0].GetString(); @@ -189,15 +229,22 @@ bool CheckPassword(uint32 accountId, std::string password) normalizeString(username); normalizeString(password); - QueryResult result = LoginDatabase.PQuery("SELECT 1 FROM account WHERE id='%d' AND sha_pass_hash='%s'", accountId, CalculateShaPassHash(username, password).c_str()); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_CHECK_PASSWORD); + stmt->setUInt32(0, accountId); + stmt->setString(1, CalculateShaPassHash(username, password)); + PreparedQueryResult result = LoginDatabase.Query(stmt); + return (result) ? true : false; } uint32 GetCharactersCount(uint32 accountId) { // check character count - QueryResult result = CharacterDatabase.PQuery("SELECT COUNT(guid) FROM characters WHERE account = '%d'", accountId); - return (result) ? (*result)[0].GetUInt32() : 0; + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_SUM_CHARS); + stmt->setUInt32(0, accountId); + PreparedQueryResult result = CharacterDatabase.Query(stmt); + + return (result) ? (*result)[0].GetUInt64() : 0; } bool normalizeString(std::string& utf8String) diff --git a/src/server/game/Accounts/AccountMgr.h b/src/server/game/Accounts/AccountMgr.h index 1b1ecfa994a..c69f3c0a6f3 100755 --- a/src/server/game/Accounts/AccountMgr.h +++ b/src/server/game/Accounts/AccountMgr.h @@ -36,25 +36,25 @@ enum AccountOpResult namespace AccountMgr { - AccountOpResult CreateAccount(std::string username, std::string password); - AccountOpResult DeleteAccount(uint32 accountId); - AccountOpResult ChangeUsername(uint32 accountId, std::string newUsername, std::string newPassword); - AccountOpResult ChangePassword(uint32 accountId, std::string newPassword); - bool CheckPassword(uint32 accountId, std::string password); - - uint32 GetId(std::string username); - uint32 GetSecurity(uint32 accountId); - uint32 GetSecurity(uint64 accountId, int32 realmId); - bool GetName(uint32 accountId, std::string& name); - uint32 GetCharactersCount(uint32 accountId); - std::string CalculateShaPassHash(std::string& name, std::string& password); - - bool normalizeString(std::string& utf8String); - bool IsPlayerAccount(uint32 gmlevel); - bool IsModeratorAccount(uint32 gmlevel); - bool IsGMAccount(uint32 gmlevel); - bool IsAdminAccount(uint32 gmlevel); - bool IsConsoleAccount(uint32 gmlevel); + AccountOpResult CreateAccount(std::string username, std::string password); + AccountOpResult DeleteAccount(uint32 accountId); + AccountOpResult ChangeUsername(uint32 accountId, std::string newUsername, std::string newPassword); + AccountOpResult ChangePassword(uint32 accountId, std::string newPassword); + bool CheckPassword(uint32 accountId, std::string password); + + uint32 GetId(std::string username); + uint32 GetSecurity(uint32 accountId); + uint32 GetSecurity(uint32 accountId, int32 realmId); + bool GetName(uint32 accountId, std::string& name); + uint32 GetCharactersCount(uint32 accountId); + std::string CalculateShaPassHash(std::string& name, std::string& password); + + bool normalizeString(std::string& utf8String); + bool IsPlayerAccount(uint32 gmlevel); + bool IsModeratorAccount(uint32 gmlevel); + bool IsGMAccount(uint32 gmlevel); + bool IsAdminAccount(uint32 gmlevel); + bool IsConsoleAccount(uint32 gmlevel); }; #endif diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index aa6c39f351d..21a2a75b470 100755 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -445,8 +445,15 @@ void AchievementMgr::ResetAchievementCriteria(AchievementCriteriaTypes type, uin void AchievementMgr::DeleteFromDB(uint32 lowguid) { SQLTransaction trans = CharacterDatabase.BeginTransaction(); - trans->PAppend("DELETE FROM character_achievement WHERE guid = %u", lowguid); - trans->PAppend("DELETE FROM character_achievement_progress WHERE guid = %u", lowguid); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACHIEVEMENT); + stmt->setUInt32(0, lowguid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACHIEVEMENT_PROGRESS); + stmt->setUInt32(0, lowguid); + trans->Append(stmt); + CharacterDatabase.CommitTransaction(trans); } @@ -574,7 +581,7 @@ void AchievementMgr::LoadFromDB(PreparedQueryResult achievementResult, PreparedQ // title achievement rewards are retroactive if (AchievementReward const* reward = sAchievementMgr->GetAchievementReward(achievement)) - if (uint32 titleId = reward->titleId[GetPlayer()->GetTeam() == ALLIANCE ? 0 : 1]) + if (uint32 titleId = reward->titleId[Player::TeamForRace(GetPlayer()->getRace()) == ALLIANCE ? 0 : 1]) if (CharTitlesEntry const* titleEntry = sCharTitlesStore.LookupEntry(titleId)) if (!GetPlayer()->HasTitle(titleEntry)) GetPlayer()->SetTitle(titleEntry); @@ -1340,7 +1347,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (!miscValue1) { uint32 points = 0; - for (CompletedAchievementMap::iterator itr = m_completedAchievements.begin(); itr != m_completedAchievements.end(); ++itr) + for (CompletedAchievementMap::iterator itr = m_completedAchievements.begin(); itr != m_completedAchievements.end(); ++itr) if (AchievementEntry const* pAchievement = sAchievementStore.LookupEntry(itr->first)) points += pAchievement->points; SetCriteriaProgress(achievementCriteria, points, PROGRESS_SET); @@ -1889,7 +1896,7 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement) return; SendAchievementEarned(achievement); - CompletedAchievementData& ca = m_completedAchievements[achievement->ID]; + CompletedAchievementData& ca = m_completedAchievements[achievement->ID]; ca.date = time(NULL); ca.changed = true; @@ -1920,7 +1927,7 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement) // mail if (reward->sender) { - Item* item = reward->itemId ? Item::CreateItem(reward->itemId, 1, GetPlayer ()) : NULL; + Item* item = reward->itemId ? Item::CreateItem(reward->itemId, 1, GetPlayer()) : NULL; int loc_idx = GetPlayer()->GetSession()->GetSessionDbLocaleIndex(); @@ -2274,7 +2281,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaData() continue; } - uint32 dataType = fields[1].GetUInt32(); + uint32 dataType = fields[1].GetUInt8(); const char* scriptName = fields[4].GetCString(); uint32 scriptId = 0; if (strcmp(scriptName, "")) // not empty @@ -2407,7 +2414,7 @@ void AchievementGlobalMgr::LoadCompletedAchievements() { Field* fields = result->Fetch(); - uint32 achievementId = fields[0].GetUInt32(); + uint16 achievementId = fields[0].GetUInt16(); const AchievementEntry* achievement = sAchievementStore.LookupEntry(achievementId); if (!achievement) { diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp index 5b42ebe45b7..a156583a006 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp @@ -482,7 +482,9 @@ void AuctionHouseObject::Update() if (AuctionsMap.empty()) return; - QueryResult result = CharacterDatabase.PQuery("SELECT id FROM auctionhouse WHERE time <= %u ORDER BY TIME ASC", (uint32)curTime+60); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_AUCTION_BY_TIME); + stmt->setUInt32(0, (uint32)curTime+60); + PreparedQueryResult result = CharacterDatabase.Query(stmt); if (!result) return; @@ -793,7 +795,7 @@ void AuctionHouseMgr::DeleteExpiredAuctionsAtStartup() AuctionEntry* auction = new AuctionEntry(); - // Can't use LoadFromDB() because it assumes the auction map is loaded + // Can't use LoadFromDB() because it assumes the auction map is loaded if (!auction->LoadFromFieldList(fields)) { // For some reason the record in the DB is broken (possibly corrupt diff --git a/src/server/game/Battlegrounds/ArenaTeam.cpp b/src/server/game/Battlegrounds/ArenaTeam.cpp index 02707261d13..89151b6395c 100755 --- a/src/server/game/Battlegrounds/ArenaTeam.cpp +++ b/src/server/game/Battlegrounds/ArenaTeam.cpp @@ -145,7 +145,7 @@ bool ArenaTeam::AddMember(uint64 playerGuid) uint32 matchMakerRating; if (result) - matchMakerRating = (*result)[0].GetUInt32(); + matchMakerRating = (*result)[0].GetUInt16(); else matchMakerRating = sWorld->getIntConfig(CONFIG_ARENA_START_MATCHMAKER_RATING); @@ -154,18 +154,18 @@ bool ArenaTeam::AddMember(uint64 playerGuid) Player::RemovePetitionsAndSigns(playerGuid, GetType()); // Feed data to the struct - ArenaTeamMember newmember; - newmember.Name = playerName; - newmember.Guid = playerGuid; - newmember.Class = playerClass; - newmember.SeasonGames = 0; - newmember.WeekGames = 0; - newmember.SeasonWins = 0; - newmember.WeekWins = 0; - newmember.PersonalRating = personalRating; - newmember.MatchMakerRating = matchMakerRating; - - Members.push_back(newmember); + ArenaTeamMember newMember; + newMember.Name = playerName; + newMember.Guid = playerGuid; + newMember.Class = playerClass; + newMember.SeasonGames = 0; + newMember.WeekGames = 0; + newMember.SeasonWins = 0; + newMember.WeekWins = 0; + newMember.PersonalRating = personalRating; + newMember.MatchMakerRating = matchMakerRating; + + Members.push_back(newMember); // Save player's arena team membership to db stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_ARENA_TEAM_MEMBER); @@ -267,7 +267,7 @@ bool ArenaTeam::LoadMembersFromDB(QueryResult result) if (Empty() || !captainPresentInTeam) { // Arena team is empty or captain is not in team, delete from db - sLog->outErrorDb("ArenaTeam %u does not have any members or its captain is not in team, disbanding it...", TeamId); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "ArenaTeam %u does not have any members or its captain is not in team, disbanding it...", TeamId); return false; } @@ -295,8 +295,10 @@ void ArenaTeam::SetCaptain(uint64 guid) if (newCaptain) { newCaptain->SetArenaTeamInfoField(GetSlot(), ARENA_TEAM_MEMBER, 0); + char const* oldCaptainName = oldCaptain ? oldCaptain->GetName() : ""; + uint32 oldCaptainLowGuid = oldCaptain ? oldCaptain->GetGUIDLow() : 0; sLog->outArena("Player: %s [GUID: %u] promoted player: %s [GUID: %u] to leader of arena team [Id: %u] [Type: %u].", - oldCaptain->GetName(), oldCaptain->GetGUIDLow(), newCaptain->GetName(), newCaptain->GetGUIDLow(), GetId(), GetType()); + oldCaptainName, oldCaptainLowGuid, newCaptain->GetName(), newCaptain->GetGUIDLow(), GetId(), GetType()); } } @@ -304,11 +306,13 @@ void ArenaTeam::DelMember(uint64 guid, bool cleanDb) { // Remove member from team for (MemberList::iterator itr = Members.begin(); itr != Members.end(); ++itr) + { if (itr->Guid == guid) { Members.erase(itr); break; } + } // Inform player and remove arena team info from player data if (Player* player = ObjectAccessor::FindPlayer(guid)) @@ -719,7 +723,7 @@ int32 ArenaTeam::LostAgainst(uint32 Own_MMRating, uint32 Opponent_MMRating, int3 void ArenaTeam::MemberLost(Player* player, uint32 againstMatchmakerRating, int32 MatchmakerRatingChange) { // Called for each participant of a match after losing - for (MemberList::iterator itr = Members.begin(); itr != Members.end(); ++itr) + for (MemberList::iterator itr = Members.begin(); itr != Members.end(); ++itr) { if (itr->Guid == player->GetGUID()) { @@ -745,7 +749,7 @@ void ArenaTeam::MemberLost(Player* player, uint32 againstMatchmakerRating, int32 void ArenaTeam::OfflineMemberLost(uint64 guid, uint32 againstMatchmakerRating, int32 MatchmakerRatingChange) { // Called for offline player after ending rated arena match! - for (MemberList::iterator itr = Members.begin(); itr != Members.end(); ++itr) + for (MemberList::iterator itr = Members.begin(); itr != Members.end(); ++itr) { if (itr->Guid == guid) { @@ -767,7 +771,7 @@ void ArenaTeam::OfflineMemberLost(uint64 guid, uint32 againstMatchmakerRating, i void ArenaTeam::MemberWon(Player* player, uint32 againstMatchmakerRating, int32 MatchmakerRatingChange) { // called for each participant after winning a match - for (MemberList::iterator itr = Members.begin(); itr != Members.end(); ++itr) + for (MemberList::iterator itr = Members.begin(); itr != Members.end(); ++itr) { if (itr->Guid == player->GetGUID()) { @@ -802,7 +806,7 @@ void ArenaTeam::UpdateArenaPointsHelper(std::map& playerPoints) // To get points, a player has to participate in at least 30% of the matches uint32 requiredGames = (uint32)ceil(Stats.WeekGames * 0.3f); - for (MemberList::const_iterator itr = Members.begin(); itr != Members.end(); ++itr) + for (MemberList::const_iterator itr = Members.begin(); itr != Members.end(); ++itr) { // The player participated in enough games, update his points uint32 pointsToAdd = 0; @@ -838,7 +842,7 @@ void ArenaTeam::SaveToDB() stmt->setUInt32(6, GetId()); trans->Append(stmt); - for (MemberList::const_iterator itr = Members.begin(); itr != Members.end(); ++itr) + for (MemberList::const_iterator itr = Members.begin(); itr != Members.end(); ++itr) { stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ARENA_TEAM_MEMBER); stmt->setUInt16(0, itr->PersonalRating); @@ -867,7 +871,7 @@ void ArenaTeam::FinishWeek() Stats.WeekWins = 0; // Reset member stats - for (MemberList::iterator itr = Members.begin(); itr != Members.end(); ++itr) + for (MemberList::iterator itr = Members.begin(); itr != Members.end(); ++itr) { itr->WeekGames = 0; itr->WeekWins = 0; diff --git a/src/server/game/Battlegrounds/ArenaTeamMgr.cpp b/src/server/game/Battlegrounds/ArenaTeamMgr.cpp index 7afa488a879..47282be3a8e 100644 --- a/src/server/game/Battlegrounds/ArenaTeamMgr.cpp +++ b/src/server/game/Battlegrounds/ArenaTeamMgr.cpp @@ -92,12 +92,12 @@ void ArenaTeamMgr::LoadArenaTeams() uint32 oldMSTime = getMSTime(); // Clean out the trash before loading anything - CharacterDatabase.Execute("DELETE FROM arena_team_member WHERE arenaTeamId NOT IN (SELECT arenaTeamId FROM arena_team)"); + CharacterDatabase.Execute("DELETE FROM arena_team_member WHERE arenaTeamId NOT IN (SELECT arenaTeamId FROM arena_team)"); // One-time query - // 0 1 2 3 4 5 6 7 8 - QueryResult result = CharacterDatabase.Query("SELECT arena_team.arenaTeamId, name, captainGuid, type, backgroundColor, emblemStyle, emblemColor, borderStyle, borderColor, " - // 9 10 11 12 13 14 - "rating, weekGames, weekWins, seasonGames, seasonWins, rank FROM arena_team ORDER BY arena_team.arenaTeamId ASC"); + // 0 1 2 3 4 5 6 7 8 + QueryResult result = CharacterDatabase.Query("SELECT arenaTeamId, name, captainGuid, type, backgroundColor, emblemStyle, emblemColor, borderStyle, borderColor, " + // 9 10 11 12 13 14 + "rating, weekGames, weekWins, seasonGames, seasonWins, rank FROM arena_team ORDER BY arenaTeamId ASC"); if (!result) { @@ -153,6 +153,8 @@ void ArenaTeamMgr::DistributeArenaPoints() SQLTransaction trans = CharacterDatabase.BeginTransaction(); + PreparedStatement* stmt; + // Cycle that gives points to all players /* for (std::map::iterator playerItr = PlayerPoints.begin(); playerItr != PlayerPoints.end(); ++playerItr) @@ -161,7 +163,12 @@ void ArenaTeamMgr::DistributeArenaPoints() if (Player* player = HashMapHolder::Find(playerItr->first)) player->ModifyConquestPoints(playerItr->second, &trans); else // Update database - trans->PAppend("UPDATE characters SET arenaPoints=arenaPoints+%u WHERE guid=%u", playerItr->second, playerItr->first); + { + stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_ARENA_POINTS); + stmt->setUInt32(0, playerItr->second); + stmt->setUInt32(1, playerItr->first); + trans->Append(stmt); + } } */ diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index 191d2eaaeb6..54c84f2e6d4 100755 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -21,7 +21,6 @@ #include "ArenaTeamMgr.h" #include "World.h" #include "WorldPacket.h" - #include "ArenaTeam.h" #include "Battleground.h" #include "BattlegroundMgr.h" @@ -66,7 +65,7 @@ namespace Trinity private: void do_helper(WorldPacket& data, char const* text) { - uint64 target_guid = _source ? _source ->GetGUID() : 0; + uint64 target_guid = _source ? _source->GetGUID() : 0; data << uint8 (_msgtype); data << uint32(LANG_UNIVERSAL); @@ -145,6 +144,7 @@ Battleground::Battleground() m_Winner = 2; m_StartTime = 0; m_ResetStatTimer = 0; + m_ValidStartPositionTimer = 0; m_Events = 0; m_IsRated = false; m_BuffChange = false; @@ -178,6 +178,8 @@ Battleground::Battleground() m_ArenaTeamIds[BG_TEAM_ALLIANCE] = 0; m_ArenaTeamIds[BG_TEAM_HORDE] = 0; + m_StartMaxDist = 0.0f; + m_ArenaTeamRatingChanges[BG_TEAM_ALLIANCE] = 0; m_ArenaTeamRatingChanges[BG_TEAM_HORDE] = 0; @@ -259,9 +261,7 @@ void Battleground::Update(uint32 diff) { case STATUS_WAIT_JOIN: if (GetPlayersSize()) - { _ProcessJoin(diff); - } break; case STATUS_IN_PROGRESS: _ProcessOfflineQueue(); @@ -294,6 +294,7 @@ void Battleground::Update(uint32 diff) // Update start time and reset stats timer m_StartTime += diff; m_ResetStatTimer += diff; + m_ValidStartPositionTimer += diff; PostUpdateImpl(diff); } @@ -425,7 +426,7 @@ inline void Battleground::_ProcessJoin(uint32 diff) // ********************************************************* ModifyStartDelayTime(diff); - if (m_ResetStatTimer <= 5000) + if (m_ResetStatTimer > 5000) { m_ResetStatTimer = 0; for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr) @@ -456,19 +457,19 @@ inline void Battleground::_ProcessJoin(uint32 diff) // First start warning - 2 or 1 minute SendMessageToAll(StartMessageIds[BG_STARTING_EVENT_FIRST], CHAT_MSG_BG_SYSTEM_NEUTRAL); } - // After 1 minute or 30 seconds, warning is signalled + // After 1 minute or 30 seconds, warning is signaled else if (GetStartDelayTime() <= StartDelayTimes[BG_STARTING_EVENT_SECOND] && !(m_Events & BG_STARTING_EVENT_2)) { m_Events |= BG_STARTING_EVENT_2; SendMessageToAll(StartMessageIds[BG_STARTING_EVENT_SECOND], CHAT_MSG_BG_SYSTEM_NEUTRAL); } - // After 30 or 15 seconds, warning is signalled + // After 30 or 15 seconds, warning is signaled else if (GetStartDelayTime() <= StartDelayTimes[BG_STARTING_EVENT_THIRD] && !(m_Events & BG_STARTING_EVENT_3)) { m_Events |= BG_STARTING_EVENT_3; SendMessageToAll(StartMessageIds[BG_STARTING_EVENT_THIRD], CHAT_MSG_BG_SYSTEM_NEUTRAL); } - // Delay expired (atfer 2 or 1 minute) + // Delay expired (after 2 or 1 minute) else if (GetStartDelayTime() <= 0 && !(m_Events & BG_STARTING_EVENT_4)) { m_Events |= BG_STARTING_EVENT_4; @@ -529,6 +530,33 @@ inline void Battleground::_ProcessJoin(uint32 diff) sWorld->SendWorldText(LANG_BG_STARTED_ANNOUNCE_WORLD, GetName(), GetMinLevel(), GetMaxLevel()); } } + + // Find if the player left our start zone; if so, teleport it back + if (m_ValidStartPositionTimer > 1000) + { + m_ValidStartPositionTimer = 0; + float maxDist = GetStartMaxDist(); + if (maxDist > 0.0f) + { + for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr) + { + if (Player *plr = ObjectAccessor::FindPlayer(itr->first)) + { + float x, y, z, o; + uint32 team = plr->GetBGTeam(); + GetTeamStartLoc(team, x, y, z, o); + + float dist = plr->GetDistance(x, y, z); + + if (dist >= maxDist) + { + sLog->outError("BATTLEGROUND: Sending %s back to start location (map: %u) (possible exploit)", plr->GetName(), GetMapId()); + plr->TeleportTo(GetMapId(), x, y, z, o); + } + } + } + } + } } inline void Battleground::_ProcessLeave(uint32 diff) @@ -743,7 +771,7 @@ void Battleground::EndBattleground(uint32 winner) winner_matchmaker_rating = GetArenaMatchmakerRating(winner); winner_matchmaker_change = winner_arena_team->WonAgainst(winner_matchmaker_rating, loser_matchmaker_rating, winner_change); loser_matchmaker_change = loser_arena_team->LostAgainst(loser_matchmaker_rating, winner_matchmaker_rating, loser_change); - sLog->outArena("--- Winner: old rating: %u, rating gain: %d, old MMR: %u, MMR gain: %d --- Loser: old rating: %u, rating loss: %d, old MMR: %u, MMR loss: %d ---", winner_team_rating, winner_change, winner_matchmaker_rating, + sLog->outArena("match Type: %u --- Winner: old rating: %u, rating gain: %d, old MMR: %u, MMR gain: %d --- Loser: old rating: %u, rating loss: %d, old MMR: %u, MMR loss: %d ---", m_ArenaType, winner_team_rating, winner_change, winner_matchmaker_rating, winner_matchmaker_change, loser_team_rating, loser_change, loser_matchmaker_rating, loser_matchmaker_change); SetArenaMatchmakerRating(winner, winner_matchmaker_rating + winner_matchmaker_change); SetArenaMatchmakerRating(GetOtherTeam(winner), loser_matchmaker_rating + loser_matchmaker_change); @@ -753,7 +781,7 @@ void Battleground::EndBattleground(uint32 winner) if (sWorld->getBoolConfig(CONFIG_ARENA_LOG_EXTENDED_INFO)) for (Battleground::BattlegroundScoreMap::const_iterator itr = GetPlayerScoresBegin(); itr != GetPlayerScoresEnd(); ++itr) if (Player* player = ObjectAccessor::FindPlayer(itr->first)) - sLog->outArena("Statistics for %s (GUID: " UI64FMTD ", Team: %d, IP: %s): %u damage, %u healing, %u killing blows", player->GetName(), itr->first, player->GetArenaTeamId(m_ArenaType == 5 ? 2 : m_ArenaType == 3), player->GetSession()->GetRemoteAddress().c_str(), itr->second->DamageDone, itr->second->HealingDone, itr->second->KillingBlows); + sLog->outArena("Statistics match Type: %u for %s (GUID: " UI64FMTD ", Team: %d, IP: %s): %u damage, %u healing, %u killing blows", m_ArenaType, player->GetName(), itr->first, player->GetArenaTeamId(m_ArenaType == 5 ? 2 : m_ArenaType == 3), player->GetSession()->GetRemoteAddress().c_str(), itr->second->DamageDone, itr->second->HealingDone, itr->second->KillingBlows); } // Deduct 16 points from each teams arena-rating if there are no winners after 45+2 minutes else @@ -822,9 +850,12 @@ void Battleground::EndBattleground(uint32 winner) if (team == winner) { // update achievement BEFORE personal rating update - ArenaTeamMember* member = winner_arena_team->GetMember(player->GetGUID()); - if (member) - player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA, 1); + if (ArenaTeamMember* member = winner_arena_team->GetMember(player->GetGUID())) + { + uint32 rating = player->GetArenaPersonalRating(winner_arena_team->GetSlot()); + player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA, + rating ? rating : 1); + } winner_arena_team->MemberWon(player, loser_matchmaker_rating, winner_matchmaker_change); } @@ -1465,9 +1496,8 @@ void Battleground::DoorClose(uint32 type) // If doors are open, close it if (obj->getLootState() == GO_ACTIVATED && obj->GetGoState() != GO_STATE_READY) { - // Change state to allow door to be closed obj->SetLootState(GO_READY); - obj->UseDoorOrButton(RESPAWN_ONE_DAY); + obj->SetGoState(GO_STATE_READY); } } else @@ -1479,9 +1509,8 @@ void Battleground::DoorOpen(uint32 type) { if (GameObject* obj = GetBgMap()->GetGameObject(BgObjects[type])) { - // Change state to be sure they will be opened - obj->SetLootState(GO_READY); - obj->UseDoorOrButton(RESPAWN_ONE_DAY); + obj->SetLootState(GO_ACTIVATED); + obj->SetGoState(GO_STATE_ACTIVE); } else sLog->outError("Battleground::DoorOpen: door gameobject (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!", diff --git a/src/server/game/Battlegrounds/Battleground.h b/src/server/game/Battlegrounds/Battleground.h index 32f6ebc92de..01dfbb23033 100755 --- a/src/server/game/Battlegrounds/Battleground.h +++ b/src/server/game/Battlegrounds/Battleground.h @@ -443,6 +443,8 @@ class Battleground Z = m_TeamStartLocZ[idx]; O = m_TeamStartLocO[idx]; } + void SetStartMaxDist(float startMaxDist) { m_StartMaxDist = startMaxDist; } + float GetStartMaxDist() const { return m_StartMaxDist; } // Packet Transfer // method that should fill worldpacket with actual world states (not yet implemented for all battlegrounds!) @@ -617,6 +619,7 @@ class Battleground uint32 m_ClientInstanceID; // the instance-id which is sent to the client and without any other internal use uint32 m_StartTime; uint32 m_ResetStatTimer; + uint32 m_ValidStartPositionTimer; int32 m_EndTime; // it is set to 120000 when bg is ending and it decreases itself uint32 m_LastResurrectTime; BattlegroundBracketId m_BracketId; @@ -698,6 +701,7 @@ class Battleground float m_TeamStartLocY[BG_TEAMS_COUNT]; float m_TeamStartLocZ[BG_TEAMS_COUNT]; float m_TeamStartLocO[BG_TEAMS_COUNT]; + float m_StartMaxDist; uint32 ScriptId; }; #endif diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index eac876a71d5..167933b9c0c 100755 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -660,6 +660,7 @@ uint32 BattlegroundMgr::CreateBattleground(CreateBattlegroundData& data) bg->SetName(data.BattlegroundName); bg->SetTeamStartLoc(ALLIANCE, data.Team1StartLocX, data.Team1StartLocY, data.Team1StartLocZ, data.Team1StartLocO); bg->SetTeamStartLoc(HORDE, data.Team2StartLocX, data.Team2StartLocY, data.Team2StartLocZ, data.Team2StartLocO); + bg->SetStartMaxDist(data.StartMaxDist); bg->SetLevelRange(data.LevelMin, data.LevelMax); bg->SetScriptId(data.scriptId); @@ -677,8 +678,8 @@ void BattlegroundMgr::CreateInitialBattlegrounds() uint8 selectionWeight; BattlemasterListEntry const* bl; - // 0 1 2 3 4 5 6 7 8 9 10 - QueryResult result = WorldDatabase.Query("SELECT id, MinPlayersPerTeam, MaxPlayersPerTeam, MinLvl, MaxLvl, AllianceStartLoc, AllianceStartO, HordeStartLoc, HordeStartO, Weight, ScriptName FROM battleground_template"); + // 0 1 2 3 4 5 6 7 8 9 10 11 + QueryResult result = WorldDatabase.Query("SELECT id, MinPlayersPerTeam, MaxPlayersPerTeam, MinLvl, MaxLvl, AllianceStartLoc, AllianceStartO, HordeStartLoc, HordeStartO, StartMaxDist, Weight, ScriptName FROM battleground_template"); if (!result) { @@ -708,21 +709,24 @@ void BattlegroundMgr::CreateInitialBattlegrounds() CreateBattlegroundData data; data.bgTypeId = BattlegroundTypeId(bgTypeID_); data.IsArena = (bl->type == TYPE_ARENA); - data.MinPlayersPerTeam = fields[1].GetUInt32(); - data.MaxPlayersPerTeam = fields[2].GetUInt32(); - data.LevelMin = fields[3].GetUInt32(); - data.LevelMax = fields[4].GetUInt32(); - //check values from DB - if (data.MaxPlayersPerTeam == 0 || data.MinPlayersPerTeam == 0 || data.MinPlayersPerTeam > data.MaxPlayersPerTeam) + data.MinPlayersPerTeam = fields[1].GetUInt16(); + data.MaxPlayersPerTeam = fields[2].GetUInt16(); + data.LevelMin = fields[3].GetUInt8(); + data.LevelMax = fields[4].GetUInt8(); + + // check values from DB + if (data.MaxPlayersPerTeam == 0 || data.MinPlayersPerTeam > data.MaxPlayersPerTeam) { - data.MinPlayersPerTeam = 0; // by default now expected strong full bg requirement - data.MaxPlayersPerTeam = 40; + sLog->outErrorDb("Table `battleground_template` for id %u has bad values for MinPlayersPerTeam (%u) and MaxPlayersPerTeam(%u)", + data.bgTypeId, data.MinPlayersPerTeam, data.MaxPlayersPerTeam); + continue; } + if (data.LevelMin == 0 || data.LevelMax == 0 || data.LevelMin > data.LevelMax) { - //TO-DO: FIX ME - data.LevelMin = 0;//bl->minlvl; - data.LevelMax = 80;//bl->maxlvl; + sLog->outErrorDb("Table `battleground_template` for id %u has bad values for LevelMin (%u) and LevelMax(%u)", + data.bgTypeId, data.LevelMin, data.LevelMax); + continue; } startId = fields[5].GetUInt32(); @@ -767,9 +771,10 @@ void BattlegroundMgr::CreateInitialBattlegrounds() continue; } - selectionWeight = fields[9].GetUInt8(); - data.scriptId = sObjectMgr->GetScriptId(fields[10].GetCString()); + data.StartMaxDist = fields[9].GetFloat(); + //data.BattlegroundName = bl->name[sWorld->GetDefaultDbcLocale()]; + data.scriptId = sObjectMgr->GetScriptId(fields[10].GetCString()); data.MapID = bl->mapid[0]; if (!CreateBattleground(data)) diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.h b/src/server/game/Battlegrounds/BattlegroundMgr.h index b40f7bcbe91..dd502409178 100755 --- a/src/server/game/Battlegrounds/BattlegroundMgr.h +++ b/src/server/game/Battlegrounds/BattlegroundMgr.h @@ -50,6 +50,7 @@ struct CreateBattlegroundData float Team2StartLocY; float Team2StartLocZ; float Team2StartLocO; + float StartMaxDist; uint32 scriptId; }; diff --git a/src/server/game/Battlegrounds/BattlegroundQueue.cpp b/src/server/game/Battlegrounds/BattlegroundQueue.cpp index a5b00ed9db1..6f4264c0faf 100755 --- a/src/server/game/Battlegrounds/BattlegroundQueue.cpp +++ b/src/server/game/Battlegrounds/BattlegroundQueue.cpp @@ -129,7 +129,7 @@ bool BattlegroundQueue::SelectionPool::AddGroup(GroupQueueInfo* ginfo, uint32 de // add group or player (grp == NULL) to bg queue with the given leader and bg specifications GroupQueueInfo* BattlegroundQueue::AddGroup(Player* leader, Group* grp, BattlegroundTypeId BgTypeId, PvPDifficultyEntry const* bracketEntry, uint8 ArenaType, bool isRated, bool isPremade, uint32 ArenaRating, uint32 MatchmakerRating, uint32 arenateamid) { - BattlegroundBracketId bracketId = bracketEntry->GetBracketId(); + BattlegroundBracketId bracketId = bracketEntry->GetBracketId(); // create new ginfo GroupQueueInfo* ginfo = new GroupQueueInfo; diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp index 71f0ce29aec..d28f5ddfe6a 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp @@ -290,7 +290,7 @@ int32 BattlegroundAB::_GetNodeNameId(uint8 node) case BG_AB_NODE_LUMBER_MILL:return LANG_BG_AB_NODE_LUMBER_MILL; case BG_AB_NODE_GOLD_MINE: return LANG_BG_AB_NODE_GOLD_MINE; default: - ASSERT(0); + ASSERT(false); } return 0; } @@ -549,7 +549,7 @@ void BattlegroundAB::EventPlayerClickedOnFlag(Player* source, GameObject* /*targ bool BattlegroundAB::SetupBattleground() { - for (int i = 0 ; i < BG_AB_DYNAMIC_NODES_COUNT; ++i) + for (int i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i) { if (!AddObject(BG_AB_OBJECT_BANNER_NEUTRAL + 8*i, BG_AB_OBJECTID_NODE_BANNER_0 + i, BG_AB_NodePositions[i][0], BG_AB_NodePositions[i][1], BG_AB_NodePositions[i][2], BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3]/2), cos(BG_AB_NodePositions[i][3]/2), RESPAWN_ONE_DAY) || !AddObject(BG_AB_OBJECT_BANNER_CONT_A + 8*i, BG_AB_OBJECTID_BANNER_CONT_A, BG_AB_NodePositions[i][0], BG_AB_NodePositions[i][1], BG_AB_NodePositions[i][2], BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3]/2), cos(BG_AB_NodePositions[i][3]/2), RESPAWN_ONE_DAY) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAB.h b/src/server/game/Battlegrounds/Zones/BattlegroundAB.h index 50020a580b1..2cac5df73a9 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAB.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAB.h @@ -184,7 +184,8 @@ enum BG_AB_Objectives #define AB_EVENT_START_BATTLE 9158 // Achievement: Let's Get This Done // x, y, z, o -const float BG_AB_NodePositions[BG_AB_DYNAMIC_NODES_COUNT][4] = { +const float BG_AB_NodePositions[BG_AB_DYNAMIC_NODES_COUNT][4] = +{ {1166.785f, 1200.132f, -56.70859f, 0.9075713f}, // stables {977.0156f, 1046.616f, -44.80923f, -2.600541f}, // blacksmith {806.1821f, 874.2723f, -55.99371f, -2.303835f}, // farm @@ -193,7 +194,8 @@ const float BG_AB_NodePositions[BG_AB_DYNAMIC_NODES_COUNT][4] = { }; // x, y, z, o, rot0, rot1, rot2, rot3 -const float BG_AB_DoorPositions[2][8] = { +const float BG_AB_DoorPositions[2][8] = +{ {1284.597f, 1281.167f, -15.97792f, 0.7068594f, 0.012957f, -0.060288f, 0.344959f, 0.93659f}, {708.0903f, 708.4479f, -17.8342f, -2.391099f, 0.050291f, 0.015127f, 0.929217f, -0.365784f} }; @@ -206,7 +208,8 @@ const uint32 BG_AB_TickPoints[6] = {0, 10, 10, 10, 10, 30}; const uint32 BG_AB_GraveyardIds[BG_AB_ALL_NODES_COUNT] = {895, 894, 893, 897, 896, 898, 899}; // x, y, z, o -const float BG_AB_BuffPositions[BG_AB_DYNAMIC_NODES_COUNT][4] = { +const float BG_AB_BuffPositions[BG_AB_DYNAMIC_NODES_COUNT][4] = +{ {1185.71f, 1185.24f, -56.36f, 2.56f}, // stables {990.75f, 1008.18f, -42.60f, 2.43f}, // blacksmith {817.66f, 843.34f, -56.54f, 3.01f}, // farm @@ -215,7 +218,8 @@ const float BG_AB_BuffPositions[BG_AB_DYNAMIC_NODES_COUNT][4] = { }; // x, y, z, o -const float BG_AB_SpiritGuidePos[BG_AB_ALL_NODES_COUNT][4] = { +const float BG_AB_SpiritGuidePos[BG_AB_ALL_NODES_COUNT][4] = +{ {1200.03f, 1171.09f, -56.47f, 5.15f}, // stables {1017.43f, 960.61f, -42.95f, 4.88f}, // blacksmith {833.00f, 793.00f, -57.25f, 5.27f}, // farm diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp index 801b522feab..d2cbab2be54 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp @@ -1032,17 +1032,18 @@ void BattlegroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object) std::vector ghost_list = m_ReviveQueue[BgCreatures[node]]; if (!ghost_list.empty()) { - Player* player; - WorldSafeLocsEntry const* ClosestGrave = NULL; + Player* waitingPlayer; // player waiting at graveyard for resurrection + WorldSafeLocsEntry const* closestGrave = NULL; for (std::vector::iterator itr = ghost_list.begin(); itr != ghost_list.end(); ++itr) { - player = ObjectAccessor::FindPlayer(*ghost_list.begin()); - if (!player) + waitingPlayer = ObjectAccessor::FindPlayer(*ghost_list.begin()); + if (!waitingPlayer) continue; - if (!ClosestGrave) - ClosestGrave = GetClosestGraveYard(player); + + if (!closestGrave) + closestGrave = GetClosestGraveYard(waitingPlayer); else - player->TeleportTo(GetMapId(), ClosestGrave->x, ClosestGrave->y, ClosestGrave->z, player->GetOrientation()); + waitingPlayer->TeleportTo(GetMapId(), closestGrave->x, closestGrave->y, closestGrave->z, player->GetOrientation()); } m_ReviveQueue[BgCreatures[node]].clear(); } @@ -1207,7 +1208,7 @@ bool BattlegroundAV::SetupBattleground() } //spawn node-objects - for (uint8 i = BG_AV_NODES_FIRSTAID_STATION ; i < BG_AV_NODES_MAX; ++i) + for (uint8 i = BG_AV_NODES_FIRSTAID_STATION; i < BG_AV_NODES_MAX; ++i) { if (i <= BG_AV_NODES_FROSTWOLF_HUT) { @@ -1292,7 +1293,7 @@ bool BattlegroundAV::SetupBattleground() return false; } } - for (uint16 i= 0 ; i <= (BG_AV_OBJECT_MINE_SUPPLY_S_MAX-BG_AV_OBJECT_MINE_SUPPLY_S_MIN); i++) + for (uint16 i= 0; i <= (BG_AV_OBJECT_MINE_SUPPLY_S_MAX-BG_AV_OBJECT_MINE_SUPPLY_S_MIN); i++) { if (!AddObject(BG_AV_OBJECT_MINE_SUPPLY_S_MIN+i, BG_AV_OBJECTID_MINE_S, BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][0], BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][1], BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][2], BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][3]/2), RESPAWN_ONE_DAY)) { @@ -1323,30 +1324,39 @@ bool BattlegroundAV::SetupBattleground() // Initial Nodes for (i = 0; i < BG_AV_OBJECT_MAX; i++) SpawnBGObject(i, RESPAWN_ONE_DAY); - for (i = BG_AV_OBJECT_FLAG_A_FIRSTAID_STATION; i <= BG_AV_OBJECT_FLAG_A_STONEHEART_GRAVE ; i++){ + + for (i = BG_AV_OBJECT_FLAG_A_FIRSTAID_STATION; i <= BG_AV_OBJECT_FLAG_A_STONEHEART_GRAVE; i++) + { SpawnBGObject(BG_AV_OBJECT_AURA_A_FIRSTAID_STATION+3*i, RESPAWN_IMMEDIATELY); SpawnBGObject(i, RESPAWN_IMMEDIATELY); } - for (i = BG_AV_OBJECT_FLAG_A_DUNBALDAR_SOUTH; i <= BG_AV_OBJECT_FLAG_A_STONEHEART_BUNKER ; i++) + + for (i = BG_AV_OBJECT_FLAG_A_DUNBALDAR_SOUTH; i <= BG_AV_OBJECT_FLAG_A_STONEHEART_BUNKER; i++) SpawnBGObject(i, RESPAWN_IMMEDIATELY); - for (i = BG_AV_OBJECT_FLAG_H_ICEBLOOD_GRAVE; i <= BG_AV_OBJECT_FLAG_H_FROSTWOLF_WTOWER ; i++){ + + for (i = BG_AV_OBJECT_FLAG_H_ICEBLOOD_GRAVE; i <= BG_AV_OBJECT_FLAG_H_FROSTWOLF_WTOWER; i++) + { SpawnBGObject(i, RESPAWN_IMMEDIATELY); if (i <= BG_AV_OBJECT_FLAG_H_FROSTWOLF_HUT) SpawnBGObject(BG_AV_OBJECT_AURA_H_FIRSTAID_STATION+3*GetNodeThroughObject(i), RESPAWN_IMMEDIATELY); } + for (i = BG_AV_OBJECT_TFLAG_A_DUNBALDAR_SOUTH; i <= BG_AV_OBJECT_TFLAG_A_STONEHEART_BUNKER; i+=2) { SpawnBGObject(i, RESPAWN_IMMEDIATELY); //flag SpawnBGObject(i+16, RESPAWN_IMMEDIATELY); //aura } + for (i = BG_AV_OBJECT_TFLAG_H_ICEBLOOD_TOWER; i <= BG_AV_OBJECT_TFLAG_H_FROSTWOLF_WTOWER; i+=2) { SpawnBGObject(i, RESPAWN_IMMEDIATELY); //flag SpawnBGObject(i+16, RESPAWN_IMMEDIATELY); //aura } + //snowfall and the doors for (i = BG_AV_OBJECT_FLAG_N_SNOWFALL_GRAVE; i <= BG_AV_OBJECT_DOOR_A; i++) SpawnBGObject(i, RESPAWN_IMMEDIATELY); + SpawnBGObject(BG_AV_OBJECT_AURA_N_SNOWFALL_GRAVE, RESPAWN_IMMEDIATELY); //creatures @@ -1471,7 +1481,7 @@ void BattlegroundAV::ResetBGSubclass() { for (uint8 j=0; j<9; j++) m_Team_QuestStatus[i][j]=0; - m_Team_Scores[i]=BG_AV_SCORE_INITIAL_POINTS; + m_Team_Scores[i]=BG_AV_SCORE_INITIAL_POINTS; m_IsInformedNearVictory[i]=false; m_CaptainAlive[i] = true; m_CaptainBuffTimer[i] = 120000 + urand(0, 4)* 60; //as far as i could see, the buff is randomly so i make 2minutes (thats the duration of the buff itself) + 0-4minutes TODO get the right times @@ -1492,7 +1502,6 @@ void BattlegroundAV::ResetBGSubclass() for (uint16 i = 0; i < AV_CPLACE_MAX+AV_STATICCPLACE_MAX; i++) if (BgCreatures[i]) DelCreature(i); - } bool BattlegroundAV::IsBothMinesControlledByTeam(uint32 team) const @@ -1552,4 +1561,4 @@ bool BattlegroundAV::IsAllTowersControlledAndCaptainAlive(uint32 team) const } return false; -} \ No newline at end of file +} diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.h b/src/server/game/Battlegrounds/Zones/BattlegroundAV.h index 82e231c63fa..f073b69a779 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.h @@ -356,7 +356,9 @@ enum BG_AV_OBJECTS AV_OPLACE_MAX = 149 }; -const float BG_AV_ObjectPos[AV_OPLACE_MAX][4] = { + +const float BG_AV_ObjectPos[AV_OPLACE_MAX][4] = +{ {638.592f, -32.422f, 46.0608f, -1.62316f }, //firstaid station {669.007f, -294.078f, 30.2909f, 2.77507f }, //stormpike {77.8013f, -404.7f, 46.7549f, -0.872665f }, //stone grave @@ -527,7 +529,8 @@ const float BG_AV_ObjectPos[AV_OPLACE_MAX][4] = { {-951.394f, -193.695f, 67.634f, 0.802851f} }; -const float BG_AV_DoorPositons[2][4] = { +const float BG_AV_DoorPositons[2][4] = +{ {780.487f, -493.024f, 99.9553f, 3.0976f}, //alliance {-1375.193f, -538.981f, 55.2824f, 0.72178f} //horde }; @@ -623,7 +626,8 @@ enum BG_AV_CreaturePlace }; //x, y, z, o -const float BG_AV_CreaturePos[AV_CPLACE_MAX][4] = { +const float BG_AV_CreaturePos[AV_CPLACE_MAX][4] = +{ //spiritguides {643.000000f, 44.000000f, 69.740196f, -0.001854f}, {676.000000f, -374.000000f, 30.000000f, -0.001854f}, @@ -1039,7 +1043,8 @@ enum BG_AV_CreatureIds //entry, team, minlevel, maxlevel //TODO this array should be removed, the only needed things are the entrys (for spawning(?) and handlekillunit) -const uint32 BG_AV_CreatureInfo[AV_NPC_INFO_MAX][4] = { +const uint32 BG_AV_CreatureInfo[AV_NPC_INFO_MAX][4] = +{ { 12050, 1216, 58, 58 }, //Stormpike Defender { 13326, 1216, 59, 59 }, //Seasoned Defender { 13331, 1216, 60, 60 }, //Veteran Defender @@ -1099,7 +1104,9 @@ const uint32 BG_AV_CreatureInfo[AV_NPC_INFO_MAX][4] = { }; //x, y, z, o, static_creature_info-id -const float BG_AV_StaticCreaturePos[AV_STATICCPLACE_MAX][5] = { //static creatures +const float BG_AV_StaticCreaturePos[AV_STATICCPLACE_MAX][5] = +{ + //static creatures {-1235.31f, -340.777f, 60.5088f, 3.31613f, 0 }, //2225 - Zora Guthrek {-1244.02f, -323.795f, 61.0485f, 5.21853f, 1 }, //3343 - Grelkor {-1235.16f, -332.302f, 60.2985f, 2.96706f, 2 }, //3625 - Rarck @@ -1226,7 +1233,8 @@ const float BG_AV_StaticCreaturePos[AV_STATICCPLACE_MAX][5] = { //static creatur }; -const uint32 BG_AV_StaticCreatureInfo[51][4] = { +const uint32 BG_AV_StaticCreatureInfo[51][4] = +{ { 2225, 1215, 55, 55 }, //Zora Guthrek { 3343, 1215, 55, 55 }, //Grelkor { 3625, 1215, 55, 55 }, //Rarck @@ -1293,16 +1301,17 @@ enum BG_AV_Graveyards AV_GRAVE_MAIN_HORDE = 610 }; -const uint32 BG_AV_GraveyardIds[9]= { - AV_GRAVE_STORM_AID, - AV_GRAVE_STORM_GRAVE, - AV_GRAVE_STONE_GRAVE, - AV_GRAVE_SNOWFALL, - AV_GRAVE_ICE_GRAVE, - AV_GRAVE_FROSTWOLF, - AV_GRAVE_FROST_HUT, - AV_GRAVE_MAIN_ALLIANCE, - AV_GRAVE_MAIN_HORDE +const uint32 BG_AV_GraveyardIds[9]= +{ + AV_GRAVE_STORM_AID, + AV_GRAVE_STORM_GRAVE, + AV_GRAVE_STONE_GRAVE, + AV_GRAVE_SNOWFALL, + AV_GRAVE_ICE_GRAVE, + AV_GRAVE_FROSTWOLF, + AV_GRAVE_FROST_HUT, + AV_GRAVE_MAIN_ALLIANCE, + AV_GRAVE_MAIN_HORDE }; enum BG_AV_BUFF @@ -1434,13 +1443,15 @@ enum BG_AV_WorldStates }; //alliance_control neutral_control horde_control -const uint32 BG_AV_MineWorldStates[2][3] = { +const uint32 BG_AV_MineWorldStates[2][3] = +{ {1358, 1360, 1359}, {1355, 1357, 1356} }; //alliance_control alliance_assault h_control h_assault -const uint32 BG_AV_NodeWorldStates[16][4] = { +const uint32 BG_AV_NodeWorldStates[16][4] = +{ //Stormpike first aid station {1325, 1326, 1327, 1328}, //Stormpike Graveyard diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp index d24058cdd8a..ccc6a2305b4 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp @@ -27,6 +27,7 @@ BattlegroundDS::BattlegroundDS() { BgObjects.resize(BG_DS_OBJECT_MAX); + BgCreatures.resize(BG_DS_NPC_MAX); StartDelayTimes[BG_STARTING_EVENT_FIRST] = BG_START_DELAY_1M; StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_30S; @@ -49,6 +50,34 @@ void BattlegroundDS::PostUpdateImpl(uint32 diff) if (GetStatus() != STATUS_IN_PROGRESS) return; + if (getPipeKnockBackCount() < BG_DS_PIPE_KNOCKBACK_TOTAL_COUNT) + { + if (getPipeKnockBackTimer() < diff) + { + for (uint32 i = BG_DS_NPC_PIPE_KNOCKBACK_1; i <= BG_DS_NPC_PIPE_KNOCKBACK_2; ++i) + if (Creature* waterSpout = GetBgMap()->GetCreature(BgCreatures[i])) + waterSpout->CastSpell(waterSpout, BG_DS_SPELL_FLUSH, true); + + setPipeKnockBackCount(getPipeKnockBackCount() + 1); + setPipeKnockBackTimer(BG_DS_PIPE_KNOCKBACK_DELAY); + } + else + setPipeKnockBackTimer(getPipeKnockBackTimer() - diff); + } + + if (getWaterFallStatus() == BG_DS_WATERFALL_STATUS_ON) // Repeat knockback while the waterfall still active + { + if (getWaterFallKnockbackTimer() < diff) + { + if (Creature* waterSpout = GetBgMap()->GetCreature(BgCreatures[BG_DS_NPC_WATERFALL_KNOCKBACK])) + waterSpout->CastSpell(waterSpout, BG_DS_SPELL_WATER_SPOUT, true); + + setWaterFallKnockbackTimer(BG_DS_WATERFALL_KNOCKBACK_TIMER); + } + else + setWaterFallKnockbackTimer(getWaterFallKnockbackTimer() - diff); + } + if (getWaterFallTimer() < diff) { if (getWaterFallStatus() == BG_DS_WATERFALL_STATUS_OFF) // Add the water @@ -57,13 +86,14 @@ void BattlegroundDS::PostUpdateImpl(uint32 diff) setWaterFallTimer(BG_DS_WATERFALL_WARNING_DURATION); setWaterFallStatus(BG_DS_WATERFALL_STATUS_WARNING); } - else if (getWaterFallStatus() == BG_DS_WATERFALL_STATUS_WARNING) // Active collision + else if (getWaterFallStatus() == BG_DS_WATERFALL_STATUS_WARNING) // Active collision and start knockback timer { if (GameObject* gob = GetBgMap()->GetGameObject(BgObjects[BG_DS_OBJECT_WATER_1])) gob->SetGoState(GO_STATE_READY); setWaterFallTimer(BG_DS_WATERFALL_DURATION); setWaterFallStatus(BG_DS_WATERFALL_STATUS_ON); + setWaterFallKnockbackTimer(BG_DS_WATERFALL_KNOCKBACK_TIMER); } else //if (getWaterFallStatus() == BG_DS_WATERFALL_STATUS_ON) // Remove collision and water { @@ -97,12 +127,21 @@ void BattlegroundDS::StartingEventOpenDoors() setWaterFallTimer(urand(BG_DS_WATERFALL_TIMER_MIN, BG_DS_WATERFALL_TIMER_MAX)); setWaterFallStatus(BG_DS_WATERFALL_STATUS_OFF); + setPipeKnockBackTimer(BG_DS_PIPE_KNOCKBACK_FIRST_DELAY); + setPipeKnockBackCount(0); + SpawnBGObject(BG_DS_OBJECT_WATER_2, RESPAWN_IMMEDIATELY); DoorOpen(BG_DS_OBJECT_WATER_2); // Turn off collision if (GameObject* gob = GetBgMap()->GetGameObject(BgObjects[BG_DS_OBJECT_WATER_1])) gob->SetGoState(GO_STATE_ACTIVE); + + // Remove effects of Demonic Circle Summon + for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr) + if (Player* player = ObjectAccessor::FindPlayer(itr->first)) + if (player->HasAura(48018)) + player->RemoveAurasDueToSpell(48018); } void BattlegroundDS::AddPlayer(Player* player) @@ -151,6 +190,14 @@ void BattlegroundDS::HandleAreaTrigger(Player* Source, uint32 Trigger) { case 5347: case 5348: + // Remove effects of Demonic Circle Summon + if (Source->HasAura(48018)) + Source->RemoveAurasDueToSpell(48018); + + // Someone has get back into the pipes and the knockback has already been performed, + // so we reset the knockback count for kicking the player again into the arena. + if (getPipeKnockBackCount() >= BG_DS_PIPE_KNOCKBACK_TOTAL_COUNT) + setPipeKnockBackCount(0); break; default: sLog->outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger); @@ -187,7 +234,11 @@ bool BattlegroundDS::SetupBattleground() || !AddObject(BG_DS_OBJECT_WATER_2, BG_DS_OBJECT_TYPE_WATER_2, 1291.56f, 790.837f, 7.1f, 3.14238f, 0, 0, 0.694215f, -0.719768f, 120) // buffs || !AddObject(BG_DS_OBJECT_BUFF_1, BG_DS_OBJECT_TYPE_BUFF_1, 1291.7f, 813.424f, 7.11472f, 4.64562f, 0, 0, 0.730314f, -0.683111f, 120) - || !AddObject(BG_DS_OBJECT_BUFF_2, BG_DS_OBJECT_TYPE_BUFF_2, 1291.7f, 768.911f, 7.11472f, 1.55194f, 0, 0, 0.700409f, 0.713742f, 120)) + || !AddObject(BG_DS_OBJECT_BUFF_2, BG_DS_OBJECT_TYPE_BUFF_2, 1291.7f, 768.911f, 7.11472f, 1.55194f, 0, 0, 0.700409f, 0.713742f, 120) + // knockback creatures + || !AddCreature(BG_DS_NPC_TYPE_WATER_SPOUT, BG_DS_NPC_WATERFALL_KNOCKBACK, 0, 1292.587f, 790.2205f, 7.19796f, 3.054326f, RESPAWN_IMMEDIATELY) + || !AddCreature(BG_DS_NPC_TYPE_WATER_SPOUT, BG_DS_NPC_PIPE_KNOCKBACK_1, 0, 1369.977f, 817.2882f, 16.08718f, 3.106686f, RESPAWN_IMMEDIATELY) + || !AddCreature(BG_DS_NPC_TYPE_WATER_SPOUT, BG_DS_NPC_PIPE_KNOCKBACK_2, 0, 1212.833f, 765.3871f, 16.09484f, 0.0f, RESPAWN_IMMEDIATELY)) { sLog->outErrorDb("BatteGroundDS: Failed to spawn some object!"); return false; diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundDS.h b/src/server/game/Battlegrounds/Zones/BattlegroundDS.h index 7efc6e1caa7..aaf08ba1313 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundDS.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundDS.h @@ -42,12 +42,37 @@ enum BattlegroundDSObjects BG_DS_OBJECT_TYPE_BUFF_2 = 184664 }; +enum BattlegroundDSCreatureTypes +{ + BG_DS_NPC_WATERFALL_KNOCKBACK = 0, + BG_DS_NPC_PIPE_KNOCKBACK_1 = 1, + BG_DS_NPC_PIPE_KNOCKBACK_2 = 2, + BG_DS_NPC_MAX = 3 +}; + +enum BattlegroundDSCreatures +{ + BG_DS_NPC_TYPE_WATER_SPOUT = 28567, +}; + +enum BattlegroundDSSpells +{ + BG_DS_SPELL_FLUSH = 57405, // Visual and target selector for the starting knockback from the pipe + BG_DS_SPELL_FLUSH_KNOCKBACK = 61698, // Knockback effect for previous spell (triggered, not need to be casted) + BG_DS_SPELL_WATER_SPOUT = 58873, // Knockback effect of the central waterfall +}; + enum BattlegroundDSData { // These values are NOT blizzlike... need the correct data! BG_DS_WATERFALL_TIMER_MIN = 30000, BG_DS_WATERFALL_TIMER_MAX = 60000, - BG_DS_WATERFALL_WARNING_DURATION = 7000, - BG_DS_WATERFALL_DURATION = 10000, + BG_DS_WATERFALL_WARNING_DURATION = 5000, + BG_DS_WATERFALL_DURATION = 30000, + BG_DS_WATERFALL_KNOCKBACK_TIMER = 1500, + + BG_DS_PIPE_KNOCKBACK_FIRST_DELAY = 5000, + BG_DS_PIPE_KNOCKBACK_DELAY = 3000, + BG_DS_PIPE_KNOCKBACK_TOTAL_COUNT = 2, BG_DS_WATERFALL_STATUS_WARNING = 1, // Water starting to fall, but no LoS Blocking nor movement blocking BG_DS_WATERFALL_STATUS_ON = 2, // LoS and Movement blocking active @@ -83,12 +108,21 @@ class BattlegroundDS : public Battleground private: uint32 _waterfallTimer; uint8 _waterfallStatus; + uint32 _waterfallKnockbackTimer; + uint32 _pipeKnockBackTimer; + uint8 _pipeKnockBackCount; virtual void PostUpdateImpl(uint32 diff); protected: uint32 getWaterFallStatus() { return _waterfallStatus; }; - void setWaterFallStatus(uint32 status) { _waterfallStatus = status; }; - void setWaterFallTimer(uint32 timer) { _waterfallTimer = timer; }; + void setWaterFallStatus(uint8 status) { _waterfallStatus = status; }; uint32 getWaterFallTimer() { return _waterfallTimer; }; + void setWaterFallTimer(uint32 timer) { _waterfallTimer = timer; }; + uint32 getWaterFallKnockbackTimer() { return _waterfallKnockbackTimer; }; + void setWaterFallKnockbackTimer(uint32 timer) { _waterfallKnockbackTimer = timer; }; + uint8 getPipeKnockBackCount() { return _pipeKnockBackCount; }; + void setPipeKnockBackCount(uint8 count) { _pipeKnockBackCount = count; }; + uint32 getPipeKnockBackTimer() { return _pipeKnockBackTimer; }; + void setPipeKnockBackTimer(uint32 timer) { _pipeKnockBackTimer = timer; }; }; #endif diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp index 344dc79fe79..8269a04a383 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp @@ -29,7 +29,8 @@ #include "Util.h" // these variables aren't used outside of this file, so declare them only here -uint32 BG_EY_HonorScoreTicks[BG_HONOR_MODE_NUM] = { +uint32 BG_EY_HonorScoreTicks[BG_HONOR_MODE_NUM] = +{ 260, // normal honor 160 // holiday }; diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundEY.h b/src/server/game/Battlegrounds/Zones/BattlegroundEY.h index 026fbccc320..534a40484ce 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.h @@ -258,7 +258,8 @@ struct BattlegroundEYPointIconsStruct }; // x, y, z, o -const float BG_EY_TriggerPositions[EY_POINTS_MAX][4] = { +const float BG_EY_TriggerPositions[EY_POINTS_MAX][4] = +{ {2044.28f, 1729.68f, 1189.96f, 0.017453f}, // FEL_REAVER center {2048.83f, 1393.65f, 1194.49f, 0.20944f}, // BLOOD_ELF center {2286.56f, 1402.36f, 1197.11f, 3.72381f}, // DRAENEI_RUINS center @@ -326,7 +327,7 @@ const BattlegroundEYCapturingPointStruct m_CapturingPointTypes[EY_POINTS_MAX] = class BattlegroundEYScore : public BattlegroundScore { public: - BattlegroundEYScore () : FlagCaptures(0) {}; + BattlegroundEYScore() : FlagCaptures(0) {}; virtual ~BattlegroundEYScore() {}; uint32 FlagCaptures; }; diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp index c72fcfdb3a7..47ea9915ac7 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp @@ -47,7 +47,7 @@ BattlegroundIC::BattlegroundIC() resourceTimer = IC_RESOURCE_TIME; for (uint8 i = NODE_TYPE_REFINERY; i < MAX_NODE_TYPES; i++) - nodePoint[i] = nodePointInitial[i]; + nodePoint[i] = nodePointInitial[i]; siegeEngineWorkshopTimer = WORKSHOP_UPDATE_TIME; @@ -359,7 +359,7 @@ void BattlegroundIC::FillInitialWorldStates(WorldPacket& data) data << uint32(uws) << uint32(1); } - for (uint8 i = 0 ; i < MAX_NODE_TYPES ; i++) + for (uint8 i = 0; i < MAX_NODE_TYPES; i++) data << uint32(nodePoint[i].worldStates[nodePoint[i].nodeState]) << uint32(1); } @@ -837,6 +837,7 @@ void BattlegroundIC::DestroyGate(Player* player, GameObject* go) { case GO_HORDE_GATE_1: lang_entry = LANG_BG_IC_NORTH_GATE_DESTROYED; + break; case GO_HORDE_GATE_2: case GO_ALLIANCE_GATE_1: lang_entry = LANG_BG_IC_WEST_GATE_DESTROYED; @@ -926,11 +927,11 @@ Transport* BattlegroundIC::CreateTransport(uint32 goEntry, uint32 period) float x = t->m_WayPoints[0].x; float y = t->m_WayPoints[0].y; - float z = t->m_WayPoints[0].z; + float z = t->m_WayPoints[0].z; float o = 1; // creates the Gameobject - if (!t->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_MO_TRANSPORT), goEntry, mapid, x, y, z, o, 100, 0)) + if (!t->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_MO_TRANSPORT), goEntry, mapid, x, y, z, o, 255, 0)) { delete t; return NULL; diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp index 98bb704661e..6869a899305 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp @@ -32,7 +32,7 @@ BattlegroundRV::BattlegroundRV() StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_30S; StartDelayTimes[BG_STARTING_EVENT_THIRD] = BG_START_DELAY_15S; StartDelayTimes[BG_STARTING_EVENT_FOURTH] = BG_START_DELAY_NONE; - //we must set messageIds + // we must set messageIds StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_ARENA_ONE_MINUTE; StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_ARENA_THIRTY_SECONDS; StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_ARENA_FIFTEEN_SECONDS; @@ -46,40 +46,32 @@ BattlegroundRV::~BattlegroundRV() void BattlegroundRV::PostUpdateImpl(uint32 diff) { + if (GetStatus() != STATUS_IN_PROGRESS) + return; + if (getTimer() < diff) { switch (getState()) { case BG_RV_STATE_OPEN_FENCES: - setTimer(BG_RV_PILAR_TO_FIRE_TIMER); + // Open fire (only at game start) + for (uint8 i = BG_RV_OBJECT_FIRE_1; i <= BG_RV_OBJECT_FIREDOOR_2; ++i) + DoorOpen(i); + setTimer(BG_RV_CLOSE_FIRE_TIMER); setState(BG_RV_STATE_CLOSE_FIRE); break; case BG_RV_STATE_CLOSE_FIRE: for (uint8 i = BG_RV_OBJECT_FIRE_1; i <= BG_RV_OBJECT_FIREDOOR_2; ++i) DoorClose(i); - setTimer(BG_RV_FIRE_TO_PILAR_TIMER); - setState(BG_RV_STATE_OPEN_PILARS); + // Fire got closed after five seconds, leaves twenty seconds before toggling pillars + setTimer(BG_RV_FIRE_TO_PILLAR_TIMER); + setState(BG_RV_STATE_SWITCH_PILLARS); break; - case BG_RV_STATE_OPEN_PILARS: + case BG_RV_STATE_SWITCH_PILLARS: for (uint8 i = BG_RV_OBJECT_PILAR_1; i <= BG_RV_OBJECT_PULLEY_2; ++i) DoorOpen(i); - TogglePillarCollision(false); - setTimer(BG_RV_PILAR_TO_FIRE_TIMER); - setState(BG_RV_STATE_OPEN_FIRE); - break; - case BG_RV_STATE_OPEN_FIRE: - // FIXME: after 3.2.0 it's only decorative and should be opened only one time at battle start - for (uint8 i = BG_RV_OBJECT_FIRE_1; i <= BG_RV_OBJECT_FIREDOOR_2; ++i) - DoorOpen(i); - setTimer(BG_RV_FIRE_TO_PILAR_TIMER); - setState(BG_RV_STATE_CLOSE_PILARS); - break; - case BG_RV_STATE_CLOSE_PILARS: - for (uint8 i = BG_RV_OBJECT_PILAR_1; i <= BG_RV_OBJECT_PULLEY_2; ++i) - DoorOpen(i); - TogglePillarCollision(true); - setTimer(BG_RV_PILAR_TO_FIRE_TIMER); - setState(BG_RV_STATE_CLOSE_FIRE); + TogglePillarCollision(); + setTimer(BG_RV_PILLAR_SWITCH_TIMER); break; } } @@ -103,7 +95,9 @@ void BattlegroundRV::StartingEventOpenDoors() setState(BG_RV_STATE_OPEN_FENCES); setTimer(BG_RV_FIRST_TIMER); - TogglePillarCollision(true); + // Should be false at first, TogglePillarCollision will do it. + SetPillarCollision(true); + TogglePillarCollision(); } void BattlegroundRV::AddPlayer(Player* player) @@ -227,8 +221,10 @@ bool BattlegroundRV::SetupBattleground() } -void BattlegroundRV::TogglePillarCollision(bool apply) +void BattlegroundRV::TogglePillarCollision() { + bool apply = GetPillarCollision(); + for (uint8 i = BG_RV_OBJECT_PILAR_1; i <= BG_RV_OBJECT_PILAR_COLLISION_4; ++i) { if (GameObject* gob = GetBgMap()->GetGameObject(BgObjects[i])) @@ -249,4 +245,6 @@ void BattlegroundRV::TogglePillarCollision(bool apply) gob->SendUpdateToPlayer(player); } } + + SetPillarCollision(!apply); } \ No newline at end of file diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundRV.h b/src/server/game/Battlegrounds/Zones/BattlegroundRV.h index 1dfd4825c8f..8c5746931e3 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundRV.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundRV.h @@ -79,12 +79,12 @@ enum BattlegroundRVObjects enum BattlegroundRVData { BG_RV_STATE_OPEN_FENCES, - BG_RV_STATE_OPEN_PILARS, - BG_RV_STATE_CLOSE_PILARS, - BG_RV_STATE_OPEN_FIRE, + BG_RV_STATE_SWITCH_PILLARS, BG_RV_STATE_CLOSE_FIRE, - BG_RV_FIRE_TO_PILAR_TIMER = 20000, - BG_RV_PILAR_TO_FIRE_TIMER = 5000, + + BG_RV_PILLAR_SWITCH_TIMER = 25000, + BG_RV_FIRE_TO_PILLAR_TIMER = 20000, + BG_RV_CLOSE_FIRE_TIMER = 5000, BG_RV_FIRST_TIMER = 20133, BG_RV_WORLD_STATE_A = 0xe10, BG_RV_WORLD_STATE_H = 0xe11, @@ -120,6 +120,7 @@ class BattlegroundRV : public Battleground private: uint32 Timer; uint32 State; + bool PillarCollision; virtual void PostUpdateImpl(uint32 diff); @@ -129,6 +130,8 @@ class BattlegroundRV : public Battleground uint32 getState() { return State; }; void setState(uint32 state) { State = state; }; - void TogglePillarCollision(bool apply); + void TogglePillarCollision(); + bool GetPillarCollision() { return PillarCollision; } + void SetPillarCollision(bool apply) { PillarCollision = apply; } }; #endif diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp index b7792e10ae3..39c6e00946a 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp @@ -37,6 +37,11 @@ BattlegroundSA::BattlegroundSA() SignaledRoundTwo = false; SignaledRoundTwoHalfMin = false; InitSecondRound = false; + + //! This is here to prevent an uninitialised variable warning + //! The warning only occurs when SetUpBattleGround fails though. + //! In the future this function should be called BEFORE sending initial worldstates. + memset(&GraveyardStatus, 0, sizeof(GraveyardStatus)); } BattlegroundSA::~BattlegroundSA() @@ -529,16 +534,16 @@ void BattlegroundSA::EventPlayerDamagedGO(Player* /*player*/, GameObject* go, ui if (eventType == go->GetGOInfo()->building.damagedEvent) { - uint32 i = GetGateIDFromDestroyEventID(eventType); + uint32 i = getGateIdFromDamagedOrDestroyEventId(eventType); GateStatus[i] = BG_SA_GATE_DAMAGED; - uint32 uws = GetWorldStateFromGateID(i); + uint32 uws = getWorldStateFromGateId(i); if (uws) UpdateWorldState(uws, GateStatus[i]); } if (eventType == go->GetGOInfo()->building.destroyedEvent) { - if (go->GetGOInfo()->building.destroyedEvent == 19837) + if (go->GetGOInfo()->building.destroyedEvent == BG_SA_EVENT_ANCIENT_GATE_DESTROYED) SendWarningToAll(LANG_BG_SA_CHAMBER_BREACHED); else SendWarningToAll(LANG_BG_SA_WAS_DESTROYED, go->GetGOInfo()->name.c_str()); @@ -598,7 +603,7 @@ void BattlegroundSA::DemolisherStartState(bool start) void BattlegroundSA::DestroyGate(Player* player, GameObject* go) { - uint32 i = GetGateIDFromDestroyEventID(go->GetGOInfo()->building.destroyedEvent); + uint32 i = getGateIdFromDamagedOrDestroyEventId(go->GetGOInfo()->building.destroyedEvent); if (!GateStatus[i]) return; @@ -607,7 +612,7 @@ void BattlegroundSA::DestroyGate(Player* player, GameObject* go) if (g->GetGOValue()->Building.Health == 0) { GateStatus[i] = BG_SA_GATE_DESTROYED; - uint32 uws = GetWorldStateFromGateID(i); + uint32 uws = getWorldStateFromGateId(i); if (uws) UpdateWorldState(uws, GateStatus[i]); bool rewardHonor = true; @@ -715,8 +720,13 @@ void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player* Source) DelCreature(BG_SA_MAXNPC + i); GraveyardStatus[i] = Source->GetTeamId(); - WorldSafeLocsEntry const* sg = NULL; - sg = sWorldSafeLocsStore.LookupEntry(BG_SA_GYEntries[i]); + WorldSafeLocsEntry const* sg = sWorldSafeLocsStore.LookupEntry(BG_SA_GYEntries[i]); + if (!sg) + { + sLog->outError("BattlegroundSA::CaptureGraveyard: non-existant GY entry: %u", BG_SA_GYEntries[i]); + return; + } + AddSpiritGuide(i + BG_SA_MAXNPC, sg->x, sg->y, sg->z, BG_SA_GYOrientation[i], (GraveyardStatus[i] == TEAM_ALLIANCE? ALLIANCE : HORDE)); uint32 npc = 0; uint32 flag = 0; @@ -776,7 +786,7 @@ void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player* Source) SendWarningToAll(LANG_BG_SA_H_GY_SOUTH); break; default: - ASSERT(0); + ASSERT(false); break; }; } diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.h b/src/server/game/Battlegrounds/Zones/BattlegroundSA.h index 76a772ff978..c18806490f2 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.h @@ -30,8 +30,8 @@ class BattlegroundSAScore : public BattlegroundScore uint8 gates_destroyed; }; -#define BG_SA_FLAG_AMOUNT 3 -#define BG_SA_DEMOLISHER_AMOUNT 4 +#define BG_SA_FLAG_AMOUNT 3 +#define BG_SA_DEMOLISHER_AMOUNT 4 enum BG_SA_Status { @@ -45,45 +45,66 @@ enum BG_SA_Status enum BG_SA_GateState { - BG_SA_GATE_OK = 1, - BG_SA_GATE_DAMAGED = 2, - BG_SA_GATE_DESTROYED = 3 + BG_SA_GATE_OK = 1, + BG_SA_GATE_DAMAGED = 2, + BG_SA_GATE_DESTROYED = 3 +}; + +enum BG_SA_EventIdGate +{ + BG_SA_EVENT_BLUE_GATE_DAMAGED = 19040, + BG_SA_EVENT_BLUE_GATE_DESTROYED = 19045, + + BG_SA_EVENT_GREEN_GATE_DAMAGED = 19041, + BG_SA_EVENT_GREEN_GATE_DESTROYED = 19046, + + BG_SA_EVENT_RED_GATE_DAMAGED = 19042, + BG_SA_EVENT_RED_GATE_DESTROYED = 19047, + + BG_SA_EVENT_PURPLE_GATE_DAMAGED = 19043, + BG_SA_EVENT_PURPLE_GATE_DESTROYED = 19048, + + BG_SA_EVENT_YELLOW_GATE_DAMAGED = 19044, + BG_SA_EVENT_YELLOW_GATE_DESTROYED = 19049, + + BG_SA_EVENT_ANCIENT_GATE_DAMAGED = 19836, + BG_SA_EVENT_ANCIENT_GATE_DESTROYED = 19837 }; enum BG_SA_Timers { - BG_SA_BOAT_START = 60*IN_MILLISECONDS, - BG_SA_WARMUPLENGTH = 120*IN_MILLISECONDS, - BG_SA_ROUNDLENGTH = 600*IN_MILLISECONDS + BG_SA_BOAT_START = 60 * IN_MILLISECONDS, + BG_SA_WARMUPLENGTH = 120 * IN_MILLISECONDS, + BG_SA_ROUNDLENGTH = 600 * IN_MILLISECONDS }; enum BG_SA_WorldStates { - BG_SA_TIMER_MINS = 3559, - BG_SA_TIMER_SEC_TENS = 3560, - BG_SA_TIMER_SEC_DECS = 3561, - BG_SA_ALLY_ATTACKS = 4352, - BG_SA_HORDE_ATTACKS = 4353, - BG_SA_PURPLE_GATEWS = 3614, - BG_SA_RED_GATEWS = 3617, - BG_SA_BLUE_GATEWS = 3620, - BG_SA_GREEN_GATEWS = 3623, - BG_SA_YELLOW_GATEWS = 3638, - BG_SA_ANCIENT_GATEWS = 3849, - BG_SA_LEFT_GY_ALLIANCE = 3635, - BG_SA_RIGHT_GY_ALLIANCE = 3636, - BG_SA_CENTER_GY_ALLIANCE = 3637, - BG_SA_RIGHT_ATT_TOKEN_ALL = 3627, - BG_SA_LEFT_ATT_TOKEN_ALL = 3626, - BG_SA_LEFT_ATT_TOKEN_HRD = 3629, - BG_SA_RIGHT_ATT_TOKEN_HRD = 3628, - BG_SA_HORDE_DEFENCE_TOKEN = 3631, - BG_SA_ALLIANCE_DEFENCE_TOKEN = 3630, - BG_SA_RIGHT_GY_HORDE = 3632, - BG_SA_LEFT_GY_HORDE = 3633, - BG_SA_CENTER_GY_HORDE = 3634, - BG_SA_BONUS_TIMER = 0xdf3, - BG_SA_ENABLE_TIMER = 3564, + BG_SA_TIMER_MINS = 3559, + BG_SA_TIMER_SEC_TENS = 3560, + BG_SA_TIMER_SEC_DECS = 3561, + BG_SA_ALLY_ATTACKS = 4352, + BG_SA_HORDE_ATTACKS = 4353, + BG_SA_PURPLE_GATEWS = 3614, + BG_SA_RED_GATEWS = 3617, + BG_SA_BLUE_GATEWS = 3620, + BG_SA_GREEN_GATEWS = 3623, + BG_SA_YELLOW_GATEWS = 3638, + BG_SA_ANCIENT_GATEWS = 3849, + BG_SA_LEFT_GY_ALLIANCE = 3635, + BG_SA_RIGHT_GY_ALLIANCE = 3636, + BG_SA_CENTER_GY_ALLIANCE = 3637, + BG_SA_RIGHT_ATT_TOKEN_ALL = 3627, + BG_SA_LEFT_ATT_TOKEN_ALL = 3626, + BG_SA_LEFT_ATT_TOKEN_HRD = 3629, + BG_SA_RIGHT_ATT_TOKEN_HRD = 3628, + BG_SA_HORDE_DEFENCE_TOKEN = 3631, + BG_SA_ALLIANCE_DEFENCE_TOKEN = 3630, + BG_SA_RIGHT_GY_HORDE = 3632, + BG_SA_LEFT_GY_HORDE = 3633, + BG_SA_CENTER_GY_HORDE = 3634, + BG_SA_BONUS_TIMER = 0xdf3, + BG_SA_ENABLE_TIMER = 3564, }; enum npc @@ -122,14 +143,14 @@ enum BG_SA_NPCs enum BG_SA_Boat { - BG_SA_BOAT_ONE_A =193182, - BG_SA_BOAT_TWO_H =193183, - BG_SA_BOAT_ONE_H =193184, - BG_SA_BOAT_TWO_A =193185, + BG_SA_BOAT_ONE_A = 193182, + BG_SA_BOAT_TWO_H = 193183, + BG_SA_BOAT_ONE_H = 193184, + BG_SA_BOAT_TWO_A = 193185, }; -const uint32 BG_SA_NpcEntries[BG_SA_MAXNPC] = - { +uint32 const BG_SA_NpcEntries[BG_SA_MAXNPC] = +{ NPC_ANTI_PERSONNAL_CANNON, NPC_ANTI_PERSONNAL_CANNON, NPC_ANTI_PERSONNAL_CANNON, @@ -140,25 +161,25 @@ const uint32 BG_SA_NpcEntries[BG_SA_MAXNPC] = NPC_ANTI_PERSONNAL_CANNON, NPC_ANTI_PERSONNAL_CANNON, NPC_ANTI_PERSONNAL_CANNON, - //4 beach demolishers + // 4 beach demolishers NPC_DEMOLISHER_SA, NPC_DEMOLISHER_SA, NPC_DEMOLISHER_SA, NPC_DEMOLISHER_SA, - //Triggers + // Triggers 23472, 23472, 23472, 23472, 23472, - //Used Demolisher Salesman + // Used Demolisher Salesman NPC_RIGGER_SPARKLIGHT, NPC_GORGRIL_RIGSPARK - }; +}; -const float BG_SA_NpcSpawnlocs[BG_SA_MAXNPC + BG_SA_DEMOLISHER_AMOUNT][4] = +float const BG_SA_NpcSpawnlocs[BG_SA_MAXNPC + BG_SA_DEMOLISHER_AMOUNT][4] = { - //Cannons + // Cannons { 1436.429f, 110.05f, 41.407f, 5.4f }, { 1404.9023f, 84.758f, 41.183f, 5.46f }, { 1068.693f, -86.951f, 93.81f, 0.02f }, @@ -169,21 +190,21 @@ const float BG_SA_NpcSpawnlocs[BG_SA_MAXNPC + BG_SA_DEMOLISHER_AMOUNT][4] = { 1249.634f, -224.189f, 66.72f, 0.635f }, { 1236.213f, 92.287f, 64.965f, 5.751f }, { 1215.11f, 57.772f, 64.739f, 5.78f }, - //Demolishers + // Demolishers { 1611.597656f, -117.270073f, 8.719355f, 2.513274f}, { 1575.562500f, -158.421875f, 5.024450f, 2.129302f}, { 1618.047729f, 61.424641f, 7.248210f, 3.979351f}, { 1575.103149f, 98.873344f, 2.830360f, 3.752458f}, - //trigger + // Triggers { 1453.49f, -250.453f, 30.896f, 4.2883f}, { 1377.05f, 97.036f, 30.8605f, 2.46539f}, { 1186.05f, 58.8048f, 56.5491f, 2.75992f}, { 1042.83f, -72.839f, 84.8145f, 3.58615f}, { 1233.62f, -250.49f, 55.4036f, 3.7016f}, - //Npcs + // Npcs { 1348.644165f, -298.786469f, 31.080130f, 1.710423f}, { 1358.191040f, 195.527786f, 31.018187f, 4.171337f}, - //Demolishers2 + // Demolishers 2 { 1371.055786f, -317.071136f, 35.007359f, 1.947460f}, { 1424.034912f, -260.195190f, 31.084425f, 2.820013f}, { 1353.139893f, 223.745438f, 35.265411f, 4.343684f}, @@ -221,7 +242,7 @@ enum BG_SA_Objects BG_SA_MAXOBJ = BG_SA_BOMB+68 }; -const float BG_SA_ObjSpawnlocs[BG_SA_MAXOBJ][4] = +float const BG_SA_ObjSpawnlocs[BG_SA_MAXOBJ][4] = { { 1411.57f, 108.163f, 28.692f, 5.441f }, { 1055.452f, -108.1f, 82.134f, 0.034f }, @@ -230,30 +251,30 @@ const float BG_SA_ObjSpawnlocs[BG_SA_MAXOBJ][4] = { 1214.681f, 81.21f, 53.413f, 5.745f }, { 878.555f, -108.2f, 117.845f, 0.0f }, { 836.5f, -108.8f, 120.219f, 0.0f }, - //Ships + // Ships { 2679.696777f, -826.891235f, 3.712860f, 5.78367f}, //rot2 1 rot3 0.0002f { 2574.003662f, 981.261475f, 2.603424f, 0.807696f}, - //Sigils + // Sigils { 1414.054f, 106.72f, 41.442f, 5.441f }, { 1060.63f, -107.8f, 94.7f, 0.034f }, { 1433.383f, -216.4f, 43.642f, 0.9736f }, { 1230.75f, -210.724f, 67.611f, 0.5023f }, { 1217.8f, 79.532f, 66.58f, 5.745f }, - //Flagpoles + // Flagpoles { 1215.114258f, -65.711861f, 70.084267f, -3.124123f}, {1338.863892f, -153.336533f, 30.895121f, -2.530723f}, {1309.124268f, 9.410645f, 30.893402f, -1.623156f}, - //Flags + // Flags { 1215.108032f, -65.715767f, 70.084267f, -3.124123f}, { 1338.859253f, -153.327316f, 30.895077f, -2.530723f}, { 1309.192017f, 9.416233f, 30.893402f, 1.518436f}, - //Portal + // Portal {1468.380005f, -225.798996f, 30.896200f, 0.0f}, //blue {1394.270020f, 72.551399f, 31.054300f, 0.0f}, //green {1065.260010f, -89.79501f, 81.073402f, 0.0f}, //yellow {1216.069946f, 47.904301f, 54.278198f, 0.0f}, //purple {1255.569946f, -233.548996f, 56.43699f, 0.0f}, //red - //Bombs + // Bombs {1333.45f, 211.354f, 31.0538f, 5.03666f}, {1334.29f, 209.582f, 31.0532f, 1.28088f}, {1332.72f, 210.049f, 31.0532f, 1.28088f}, @@ -337,7 +358,7 @@ const float BG_SA_ObjSpawnlocs[BG_SA_MAXOBJ][4] = * to get horde ones. */ -const uint32 BG_SA_ObjEntries[BG_SA_MAXOBJ + BG_SA_FLAG_AMOUNT] = +uint32 const BG_SA_ObjEntries[BG_SA_MAXOBJ + BG_SA_FLAG_AMOUNT] = { 190722, 190727, @@ -367,7 +388,7 @@ const uint32 BG_SA_ObjEntries[BG_SA_MAXOBJ + BG_SA_FLAG_AMOUNT] = 190753 }; -const uint32 BG_SA_Factions[2] = +uint32 const BG_SA_Factions[2] = { 1732, 1735, @@ -392,13 +413,13 @@ const uint32 BG_SA_GYEntries[BG_SA_MAX_GY] = 1348, }; -const float BG_SA_GYOrientation[BG_SA_MAX_GY] = +float const BG_SA_GYOrientation[BG_SA_MAX_GY] = { 6.202f, - 1.926f, //right capturable GY - 3.917f, //left capturable GY - 3.104f, //center, capturable - 6.148f, //defender last GY + 1.926f, // right capturable GY + 3.917f, // left capturable GY + 3.104f, // center, capturable + 6.148f, // defender last GY }; struct BG_SA_RoundScore @@ -443,34 +464,60 @@ class BattlegroundSA : public Battleground /// Called when a player use a gamobject (relic) virtual void EventPlayerUsedGO(Player* Source, GameObject* object); /// Return gate id, relative to bg data, according to gameobject id - uint32 GetGateIDFromDestroyEventID(uint32 id) + uint32 getGateIdFromDamagedOrDestroyEventId(uint32 id) { - uint32 i = 0; switch (id) { - case 19046: i = BG_SA_GREEN_GATE; break; //Green gate destroyed - case 19045: i = BG_SA_BLUE_GATE; break; //blue gate - case 19047: i = BG_SA_RED_GATE; break; //red gate - case 19048: i = BG_SA_PURPLE_GATE; break; //purple gate - case 19049: i = BG_SA_YELLOW_GATE; break; //yellow gate - case 19837: i = BG_SA_ANCIENT_GATE; break; //ancient gate + // Green gate + case BG_SA_EVENT_GREEN_GATE_DAMAGED: + case BG_SA_EVENT_GREEN_GATE_DESTROYED: + return BG_SA_GREEN_GATE; + // Blue gate + case BG_SA_EVENT_BLUE_GATE_DAMAGED: + case BG_SA_EVENT_BLUE_GATE_DESTROYED: + return BG_SA_BLUE_GATE; + // Red gate + case BG_SA_EVENT_RED_GATE_DAMAGED: + case BG_SA_EVENT_RED_GATE_DESTROYED: + return BG_SA_RED_GATE; + // Purple gate + case BG_SA_EVENT_PURPLE_GATE_DAMAGED: + case BG_SA_EVENT_PURPLE_GATE_DESTROYED: + return BG_SA_PURPLE_GATE; + // Yellow gate + case BG_SA_EVENT_YELLOW_GATE_DAMAGED: + case BG_SA_EVENT_YELLOW_GATE_DESTROYED: + return BG_SA_YELLOW_GATE; + // Ancient gate + case BG_SA_EVENT_ANCIENT_GATE_DAMAGED: + case BG_SA_EVENT_ANCIENT_GATE_DESTROYED: + return BG_SA_ANCIENT_GATE; + default: + break; } - return i; + return 0; } /// Return worldstate id, according to door id - uint32 GetWorldStateFromGateID(uint32 id) + uint32 getWorldStateFromGateId(uint32 id) { - uint32 uws = 0; switch (id) { - case BG_SA_GREEN_GATE: uws = BG_SA_GREEN_GATEWS; break; - case BG_SA_YELLOW_GATE: uws = BG_SA_YELLOW_GATEWS; break; - case BG_SA_BLUE_GATE: uws = BG_SA_BLUE_GATEWS; break; - case BG_SA_RED_GATE: uws = BG_SA_RED_GATEWS; break; - case BG_SA_PURPLE_GATE: uws = BG_SA_PURPLE_GATEWS; break; - case BG_SA_ANCIENT_GATE: uws = BG_SA_ANCIENT_GATEWS; break; + case BG_SA_GREEN_GATE: + return BG_SA_GREEN_GATEWS; + case BG_SA_YELLOW_GATE: + return BG_SA_YELLOW_GATEWS; + case BG_SA_BLUE_GATE: + return BG_SA_BLUE_GATEWS; + case BG_SA_RED_GATE: + return BG_SA_RED_GATEWS; + case BG_SA_PURPLE_GATE: + return BG_SA_PURPLE_GATEWS; + case BG_SA_ANCIENT_GATE: + return BG_SA_ANCIENT_GATEWS; + default: + break; } - return uws; + return 0; } /// Called on battleground ending diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp index 9650cf11a8c..d100dc645a2 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp @@ -37,7 +37,8 @@ enum BG_WSG_Rewards BG_WSG_REWARD_NUM }; -uint32 BG_WSG_Honor[BG_HONOR_MODE_NUM][BG_WSG_REWARD_NUM] = { +uint32 BG_WSG_Honor[BG_HONOR_MODE_NUM][BG_WSG_REWARD_NUM] = +{ {20, 40, 40}, // normal honor {60, 40, 80} // holiday }; @@ -51,6 +52,7 @@ BattlegroundWS::BattlegroundWS() StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_BG_WS_START_ONE_MINUTE; StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_BG_WS_START_HALF_MINUTE; StartMessageIds[BG_STARTING_EVENT_FOURTH] = LANG_BG_WS_HAS_BEGUN; + _flagDebuffState = 0; } BattlegroundWS::~BattlegroundWS() @@ -177,20 +179,20 @@ void BattlegroundWS::StartingEventCloseDoors() void BattlegroundWS::StartingEventOpenDoors() { - for (uint32 i = BG_WS_OBJECT_DOOR_A_1; i <= BG_WS_OBJECT_DOOR_A_4; ++i) + for (uint32 i = BG_WS_OBJECT_DOOR_A_1; i <= BG_WS_OBJECT_DOOR_A_6; ++i) DoorOpen(i); - for (uint32 i = BG_WS_OBJECT_DOOR_H_1; i <= BG_WS_OBJECT_DOOR_H_2; ++i) + for (uint32 i = BG_WS_OBJECT_DOOR_H_1; i <= BG_WS_OBJECT_DOOR_H_4; ++i) DoorOpen(i); + for (uint32 i = BG_WS_OBJECT_A_FLAG; i <= BG_WS_OBJECT_BERSERKBUFF_2; ++i) + SpawnBGObject(i, RESPAWN_IMMEDIATELY); + SpawnBGObject(BG_WS_OBJECT_DOOR_A_5, RESPAWN_ONE_DAY); SpawnBGObject(BG_WS_OBJECT_DOOR_A_6, RESPAWN_ONE_DAY); SpawnBGObject(BG_WS_OBJECT_DOOR_H_3, RESPAWN_ONE_DAY); SpawnBGObject(BG_WS_OBJECT_DOOR_H_4, RESPAWN_ONE_DAY); - for (uint32 i = BG_WS_OBJECT_A_FLAG; i <= BG_WS_OBJECT_BERSERKBUFF_2; ++i) - SpawnBGObject(i, RESPAWN_IMMEDIATELY); - - // players joining later are not egible + // players joining later are not eligibles StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, WS_EVENT_START_BATTLE); } @@ -436,8 +438,8 @@ void BattlegroundWS::EventPlayerClickedOnFlag(Player* Source, GameObject* target ChatMsg type = CHAT_MSG_BG_SYSTEM_NEUTRAL; //alliance flag picked up from base - if (Source->GetTeam() == HORDE && this->GetFlagState(ALLIANCE) == BG_WS_FLAG_STATE_ON_BASE - && this->BgObjects[BG_WS_OBJECT_A_FLAG] == target_obj->GetGUID()) + if (Source->GetTeam() == HORDE && GetFlagState(ALLIANCE) == BG_WS_FLAG_STATE_ON_BASE + && BgObjects[BG_WS_OBJECT_A_FLAG] == target_obj->GetGUID()) { message_id = LANG_BG_WS_PICKEDUP_AF; type = CHAT_MSG_BG_SYSTEM_HORDE; @@ -455,8 +457,8 @@ void BattlegroundWS::EventPlayerClickedOnFlag(Player* Source, GameObject* target } //horde flag picked up from base - if (Source->GetTeam() == ALLIANCE && this->GetFlagState(HORDE) == BG_WS_FLAG_STATE_ON_BASE - && this->BgObjects[BG_WS_OBJECT_H_FLAG] == target_obj->GetGUID()) + if (Source->GetTeam() == ALLIANCE && GetFlagState(HORDE) == BG_WS_FLAG_STATE_ON_BASE + && BgObjects[BG_WS_OBJECT_H_FLAG] == target_obj->GetGUID()) { message_id = LANG_BG_WS_PICKEDUP_HF; type = CHAT_MSG_BG_SYSTEM_ALLIANCE; @@ -474,7 +476,7 @@ void BattlegroundWS::EventPlayerClickedOnFlag(Player* Source, GameObject* target } //Alliance flag on ground(not in base) (returned or picked up again from ground!) - if (GetFlagState(ALLIANCE) == BG_WS_FLAG_STATE_ON_GROUND && Source->IsWithinDistInMap(target_obj, 10)) + if (GetFlagState(ALLIANCE) == BG_WS_FLAG_STATE_ON_GROUND && Source->IsWithinDistInMap(target_obj, 10) && target_obj->GetGOInfo()->entry == BG_OBJECT_A_FLAG_GROUND_WS_ENTRY) { if (Source->GetTeam() == ALLIANCE) { @@ -508,7 +510,7 @@ void BattlegroundWS::EventPlayerClickedOnFlag(Player* Source, GameObject* target } //Horde flag on ground(not in base) (returned or picked up again) - if (GetFlagState(HORDE) == BG_WS_FLAG_STATE_ON_GROUND && Source->IsWithinDistInMap(target_obj, 10)) + if (GetFlagState(HORDE) == BG_WS_FLAG_STATE_ON_GROUND && Source->IsWithinDistInMap(target_obj, 10) && target_obj->GetGOInfo()->entry == BG_OBJECT_H_FLAG_GROUND_WS_ENTRY) { if (Source->GetTeam() == HORDE) { diff --git a/src/server/game/CMakeLists.txt b/src/server/game/CMakeLists.txt index 1f680f6e9b0..8b81a48c33b 100644 --- a/src/server/game/CMakeLists.txt +++ b/src/server/game/CMakeLists.txt @@ -107,7 +107,6 @@ set(game_STAT_SRCS include_directories( ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/dep/g3dlite/include - ${CMAKE_SOURCE_DIR}/dep/mersennetwister ${CMAKE_SOURCE_DIR}/dep/SFMT ${CMAKE_SOURCE_DIR}/dep/zlib ${CMAKE_SOURCE_DIR}/src/server/collision diff --git a/src/server/game/Calendar/Calendar.cpp b/src/server/game/Calendar/Calendar.cpp index 2c4ad943dd6..139e63614cc 100755 --- a/src/server/game/Calendar/Calendar.cpp +++ b/src/server/game/Calendar/Calendar.cpp @@ -15,3 +15,85 @@ * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ + +#include "Player.h" +#include "Calendar.h" + +std::string CalendarInvite::GetDebugString() const +{ + std::ostringstream data; + + data << "CalendarInvite::" + << " inviteId: " << _inviteId + << " EventId: " << _eventId + << " Status: " << uint32(_status) + << " Invitee: " << _invitee + << " Sender: " << _senderGUID + << " Rank: " << uint32(_rank) + << " Text: " << _text; + + return data.str(); +} + +void CalendarInvite::Init() +{ + _eventId = 0; + _invitee = 0; + _senderGUID = 0; + _statusTime = 0; + _status = CALENDAR_STATUS_INVITED; // default (0)? + _rank = CALENDAR_RANK_PLAYER; + _text = ""; +} + +std::string CalendarEvent::GetDebugString() const +{ + std::ostringstream data; + + data << "CalendarEvent::" + << " EventId: " << _eventId + << " Title: " << _title + << " Description" << _description + << " Type: " << uint32(_type) + << " Max Invites: " << _maxInvites + << " Creator: " << _creatorGUID + << " Flags: " << _flags + << " Guild: " << _guildId + << " Time: " << _eventTime + << " Time2: " << _timezoneTime + << " Repeatable: " << uint32(_repeatable) + << " DungeonId: " << _dungeonId; + + return data.str(); +} + +void CalendarEvent::Init() +{ + _creatorGUID = 0; + _guildId = 0; + _type = CALENDAR_TYPE_OTHER; + _dungeonId = -1; + _maxInvites = 0; + _eventTime = 0; + _flags = 0; + _repeatable = false; + _timezoneTime = 0; + _title = ""; + _description = ""; + +} + +std::string CalendarAction::GetDebugString() const +{ + std::ostringstream data; + + data << "CalendarAction::" + << " Action: " << GetAction() + << " Guid: " << GetPlayer()->GetGUID() + << " Invite Id: " << GetInviteId() + << " Extra data: " << GetExtraData() + << " Event: " << Event.GetDebugString() + << " Invite: " << Invite.GetDebugString(); + + return data.str(); +} diff --git a/src/server/game/Calendar/Calendar.h b/src/server/game/Calendar/Calendar.h index dfc88e477f9..a2d2dc2ffb7 100755 --- a/src/server/game/Calendar/Calendar.h +++ b/src/server/game/Calendar/Calendar.h @@ -19,8 +19,171 @@ #ifndef TRINITY_CALENDAR_H #define TRINITY_CALENDAR_H -class Calendar +#include "Errors.h" +#include "SharedDefines.h" +#include + +class CalendarInvite { + public: + CalendarInvite() : _inviteId(0) { Init(); } + explicit CalendarInvite(uint64 inviteId) : _inviteId(inviteId) { Init(); } + + ~CalendarInvite() { } + + void SetInviteId(uint64 inviteId) { _inviteId = inviteId; } + uint64 GetInviteId() const { return _inviteId; } + + void SetEventId(uint64 eventId) { _eventId = eventId; } + uint64 GetEventId() const { return _eventId; } + + void SetSenderGUID(uint64 guid) { _senderGUID = guid; } + uint64 GetSenderGUID() const { return _senderGUID; } + + void SetInvitee(uint64 guid) { _invitee = guid; } + uint64 GetInvitee() const { return _invitee; } + + void SetStatusTime(uint32 statusTime) { _statusTime = statusTime; } + uint32 GetStatusTime() const { return _statusTime; } + + void SetText(std::string text) { _text = text; } + std::string GetText() const { return _text; } + + void SetStatus(CalendarInviteStatus status) { _status = status; } + CalendarInviteStatus GetStatus() const { return _status; } + + void SetRank(CalendarModerationRank rank) { _rank = rank; } + CalendarModerationRank GetRank() const { return _rank; } + + std::string GetDebugString() const; + + private: + void Init(); + uint64 _inviteId; + uint64 _eventId; + uint64 _invitee; + uint64 _senderGUID; + uint32 _statusTime; + CalendarInviteStatus _status; + CalendarModerationRank _rank; + std::string _text; }; + +typedef std::set CalendarInviteIdList; + +class CalendarEvent +{ + public: + CalendarEvent() : _eventId(0) { Init(); } + explicit CalendarEvent(uint64 eventId) : _eventId(eventId) { Init(); } + + ~CalendarEvent() { } + + void SetEventId(uint64 eventId) { _eventId = eventId; } + uint64 GetEventId() const { return _eventId; } + + void SetCreatorGUID(uint64 guid) { _creatorGUID = guid; } + uint64 GetCreatorGUID() const { return _creatorGUID; } + + void SetGuildId(uint32 guildId) { _guildId = guildId; } + uint32 GetGuildId() const { return _guildId; } + + void SetTitle(std::string title) { _title = title; } + std::string GetTitle() const { return _title; } + + void SetDescription(std::string description) { _description = description; } + std::string GetDescription() const { return _description; } + + void SetType(CalendarEventType type) { _type = type; } + CalendarEventType GetType() const { return _type; } + + void SetMaxInvites(uint32 limit) { _maxInvites = limit; } + uint32 GetMaxInvites() const { return _maxInvites; } + + void SetDungeonId(int32 dungeonId) { _dungeonId = dungeonId; } + int32 GetDungeonId() const { return _dungeonId; } + + void SetTime(uint32 eventTime) { _eventTime = eventTime; } + uint32 GetTime() const { return _eventTime; } + + void SetFlags(uint32 flags) { _flags = flags; } + uint32 GetFlags() const { return _flags; } + + void SetRepeatable(bool repeatable) { _repeatable = repeatable; } + bool GetRepeatable() const { return _repeatable; } + + void SetTimeZoneTime(uint32 timezoneTime) { _timezoneTime = timezoneTime; } + uint32 GetTimeZoneTime() const { return _timezoneTime; } + + void AddInvite(uint64 inviteId) + { + if (inviteId) + _invites.insert(inviteId); + } + + void RemoveInvite(uint64 inviteId) { _invites.erase(inviteId); } + bool HasInvite(uint64 inviteId) const { return _invites.find(inviteId) != _invites.end(); } + CalendarInviteIdList const& GetInviteIdList() const { return _invites; } + void SetInviteIdList(CalendarInviteIdList const& list) { _invites = list; } + void ClearInviteIdList() { _invites.clear(); } + + std::string GetDebugString() const; + + private: + void Init(); + + uint64 _eventId; + uint64 _creatorGUID; + uint32 _guildId; + CalendarEventType _type; + int32 _dungeonId; + uint32 _maxInvites; + uint32 _eventTime; + uint32 _flags; + bool _repeatable; + uint32 _timezoneTime; + std::string _title; + std::string _description; + CalendarInviteIdList _invites; +}; + +typedef std::set CalendarEventIdList; +typedef std::map CalendarPlayerInviteIdMap; +typedef std::map CalendarPlayerEventIdMap; +typedef std::map CalendarInviteMap; +typedef std::map CalendarEventMap; + +class Player; + +struct CalendarAction +{ + CalendarAction(): _action(CALENDAR_ACTION_NONE), _player(NULL), _inviteId(0), _data(0) + { + } + + void SetAction(CalendarActionData data) { _action = data; } + CalendarActionData GetAction() const { return _action; } + + void SetPlayer(Player* player) { ASSERT(player); _player = player; } + Player* GetPlayer() const { return _player; } + + void SetInviteId(uint64 id) { _inviteId = id; } + uint64 GetInviteId() const { return _inviteId; } + + void SetExtraData(uint32 data) { _data = data; } + uint32 GetExtraData() const { return _data; } + + CalendarEvent Event; + CalendarInvite Invite; + + std::string GetDebugString() const; + + private: + CalendarActionData _action; + Player* _player; + uint64 _inviteId; + uint32 _data; +}; + #endif diff --git a/src/server/game/Calendar/CalendarMgr.cpp b/src/server/game/Calendar/CalendarMgr.cpp new file mode 100644 index 00000000000..62bc0ab3205 --- /dev/null +++ b/src/server/game/Calendar/CalendarMgr.cpp @@ -0,0 +1,593 @@ +/* + * Copyright (C) 2008-2012 TrinityCore + * + * 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; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; 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, see . + */ + +/* + +DROP TABLE IF EXISTS `calendar_events`; +CREATE TABLE IF NOT EXISTS `calendar_events` ( + `id` int(11) unsigned NOT NULL DEFAULT '0', + `creator` int(11) unsigned NOT NULL DEFAULT '0', + `title` varchar(255) NOT NULL DEFAULT '', + `description` varchar(255) NOT NULL DEFAULT '', + `type` tinyint(1) unsigned NOT NULL DEFAULT '4', + `dungeon` tinyint(3) NOT NULL DEFAULT '-1', + `eventtime` int(10) unsigned NOT NULL DEFAULT '0', + `flags` int(10) unsigned NOT NULL DEFAULT '0', + `repeatable` tinyint(1) unsigned NOT NULL DEFAULT '0', + `time2` int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +); + +DROP TABLE IF EXISTS `calendar_invites`; +CREATE TABLE IF NOT EXISTS `calendar_invites` ( + `id` int(11) unsigned NOT NULL DEFAULT '0', + `event` int(11) unsigned NOT NULL DEFAULT '0', + `invitee` int(11) unsigned NOT NULL DEFAULT '0', + `sender` int(11) unsigned NOT NULL DEFAULT '0', + `status` tinyint(1) unsigned NOT NULL DEFAULT '0', + `statustime` int(10) unsigned NOT NULL DEFAULT '0', + `rank` tinyint(1) unsigned NOT NULL DEFAULT '0', + `text` varchar(255) NOT NULL DEFAULT '', + PRIMARY KEY (`id`) +); +*/ + +#include "CalendarMgr.h" +#include "QueryResult.h" +#include "DatabaseEnv.h" +#include "Log.h" +#include "Player.h" +#include "ObjectAccessor.h" + +CalendarMgr::CalendarMgr() : + _eventNum(0), _inviteNum(0) +{ +} + +CalendarMgr::~CalendarMgr() +{ +} + +uint32 CalendarMgr::GetPlayerNumPending(uint64 guid) +{ + if (!guid) + return 0; + + CalendarPlayerInviteIdMap::const_iterator itr = _playerInvites.find(guid); + if (itr == _playerInvites.end()) + return 0; + + uint32 pendingNum = 0; + for (CalendarInviteIdList::const_iterator it = itr->second.begin(); it != itr->second.end(); ++it) + if (CalendarInvite* invite = GetInvite(*it)) + if (invite->GetRank() != CALENDAR_RANK_OWNER + && invite->GetStatus() != CALENDAR_STATUS_CONFIRMED + && invite->GetStatus() != CALENDAR_STATUS_8 + && invite->GetStatus() != CALENDAR_STATUS_9) // FIXME Check the proper value + ++pendingNum; + + return pendingNum; +} + +CalendarInviteIdList const& CalendarMgr::GetPlayerInvites(uint64 guid) +{ + return _playerInvites[guid]; +} + +CalendarEventIdList const& CalendarMgr::GetPlayerEvents(uint64 guid) +{ + return _playerEvents[guid]; +} + +CalendarInvite* CalendarMgr::GetInvite(uint64 inviteId) +{ + CalendarInviteMap::iterator itr = _invites.find(inviteId); + if (itr != _invites.end()) + return &(itr->second); + + sLog->outError("CalendarMgr::GetInvite: [" UI64FMTD "] not found!", inviteId); + return NULL; +} + +CalendarEvent* CalendarMgr::GetEvent(uint64 eventId) +{ + CalendarEventMap::iterator itr = _events.find(eventId); + if (itr != _events.end()) + return &(itr->second); + + sLog->outError("CalendarMgr::GetEvent: [" UI64FMTD "] not found!", eventId); + return NULL; +} + +uint64 CalendarMgr::GetFreeEventId() +{ + return ++_eventNum; +} +uint64 CalendarMgr::GetFreeInviteId() +{ + return ++_inviteNum; +} + +void CalendarMgr::LoadFromDB() +{ + /* + uint32 count = 0; + // 0 1 2 3 4 5 6 7 8 9 + if (QueryResult result = CharacterDatabase.Query("SELECT id, creator, title, description, type, dungeon, eventtime, flags, repeatable, time2 FROM calendar_events")) + do + { + Field * fields = result->Fetch(); + + uint64 eventId = fields[0].GetUInt64(); + CalendarEvent& calendarEvent = _events[eventId]; + + calendarEvent.SetEventId(eventId); + calendarEvent.SetCreatorGUID(fields[1].GetUInt64()); + calendarEvent.SetTitle(fields[2].GetString()); + calendarEvent.SetDescription(fields[3].GetString()); + calendarEvent.SetType(fields[4].GetUInt8()); + calendarEvent.SetDungeonId(fields[5].GetInt32()); + calendarEvent.SetTime(fields[6].GetUInt32()); + calendarEvent.SetFlags(fields[7].GetUInt32()); + calendarEvent.SetRepeatable(fields[8].GetBool()); + calendarEvent.SetTimeZoneTime(fields[9].GetUInt32()); + ++count; + } + while (result->NextRow()); + + sLog->outString(">> Loaded %u calendar events", count); + count = 0; + + // 0 1 2 3 4 5 6 7 + if (QueryResult result = CharacterDatabase.Query("SELECT id, event, invitee, sender, status, statustime, rank, text FROM calendar_invites")) + do + { + Field * fields = result->Fetch(); + + uint64 inviteId = fields[0].GetUInt64(); + uint64 eventId = fields[1].GetUInt64(); + + CalendarInvite& invite = _invites[inviteId]; + + invite.SetEventId(eventId); + invite.SetInvitee(fields[2].GetUInt64()); + invite.SetSenderGUID(fields[3].GetUInt64()); + invite.SetStatus(fields[4].GetUInt8()); + invite.SetStatusTime(fields[5].GetUInt32()); + invite.SetRank(fields[6].GetUInt8()); + invite.SetText(fields[7].GetString()); + + CalendarEvent& calendarEvent = _events[eventId]; + calendarEvent.AddInvite(inviteId); + } + while (result->NextRow()); + + sLog->outString(">> Loaded %u calendar Invites", count); + */ +} + +CalendarEvent* CalendarMgr::CheckPermisions(uint64 eventId, Player* player, uint64 inviteId, CalendarModerationRank minRank) +{ + if (!player) + return NULL; // CALENDAR_ERROR_INTERNAL + + CalendarEvent* calendarEvent = GetEvent(eventId); + if (!calendarEvent) + { + player->GetSession()->SendCalendarCommandResult(CALENDAR_ERROR_EVENT_INVALID); + return NULL; + } + + CalendarInvite* invite = GetInvite(inviteId); + if (!invite) + { + player->GetSession()->SendCalendarCommandResult(CALENDAR_ERROR_NO_INVITE); + return NULL; + } + + if (!calendarEvent->HasInvite(inviteId)) + { + player->GetSession()->SendCalendarCommandResult(CALENDAR_ERROR_NOT_INVITED); + return NULL; + } + + if (invite->GetEventId() != calendarEvent->GetEventId() || invite->GetInvitee() != player->GetGUID()) + { + player->GetSession()->SendCalendarCommandResult(CALENDAR_ERROR_INTERNAL); + return NULL; + } + + if (invite->GetRank() < minRank) + { + player->GetSession()->SendCalendarCommandResult(CALENDAR_ERROR_PERMISSIONS); + return NULL; + } + + return calendarEvent; +} + +void CalendarMgr::AddAction(CalendarAction const& action) +{ + switch (action.GetAction()) + { + case CALENDAR_ACTION_ADD_EVENT: + { + if (AddEvent(action.Event) && AddInvite(action.Invite)) + { + SendCalendarEventInviteAlert(action.Event, action.Invite); + SendCalendarEvent(action.Event, CALENDAR_SENDTYPE_ADD); + } + break; + } + case CALENDAR_ACTION_MODIFY_EVENT: + { + uint64 eventId = action.Event.GetEventId(); + CalendarEvent* calendarEvent = CheckPermisions(eventId, action.GetPlayer(), action.GetInviteId(), CALENDAR_RANK_MODERATOR); + if (!calendarEvent) + return; + + calendarEvent->SetEventId(action.Event.GetEventId()); + calendarEvent->SetType(action.Event.GetType()); + calendarEvent->SetFlags(action.Event.GetFlags()); + calendarEvent->SetTime(action.Event.GetTime()); + calendarEvent->SetTimeZoneTime(action.Event.GetTimeZoneTime()); + calendarEvent->SetRepeatable(action.Event.GetRepeatable()); + calendarEvent->SetDungeonId(action.Event.GetDungeonId()); + calendarEvent->SetTitle(action.Event.GetTitle()); + calendarEvent->SetDescription(action.Event.GetDescription()); + calendarEvent->SetMaxInvites(action.Event.GetMaxInvites()); + + CalendarInviteIdList const& invites = calendarEvent->GetInviteIdList(); + for (CalendarInviteIdList::const_iterator itr = invites.begin(); itr != invites.end(); ++itr) + if (CalendarInvite* invite = GetInvite(*itr)) + SendCalendarEventUpdateAlert(invite->GetInvitee(), *calendarEvent, CALENDAR_SENDTYPE_ADD); + + break; + } + case CALENDAR_ACTION_COPY_EVENT: + { + CalendarEvent* calendarEvent = CheckPermisions(action.Event.GetEventId(), action.GetPlayer(), action.GetInviteId(), CALENDAR_RANK_OWNER); + + if (!calendarEvent) + return; + + uint64 eventId = GetFreeEventId(); + CalendarEvent newEvent(eventId); + newEvent.SetType(calendarEvent->GetType()); + newEvent.SetFlags(calendarEvent->GetFlags()); + newEvent.SetTime(action.Event.GetTime()); + newEvent.SetTimeZoneTime(calendarEvent->GetTimeZoneTime()); + newEvent.SetRepeatable(calendarEvent->GetRepeatable()); + newEvent.SetDungeonId(calendarEvent->GetDungeonId()); + newEvent.SetTitle(calendarEvent->GetTitle()); + newEvent.SetDescription(calendarEvent->GetDescription()); + newEvent.SetMaxInvites(calendarEvent->GetMaxInvites()); + newEvent.SetCreatorGUID(calendarEvent->GetCreatorGUID()); + newEvent.SetGuildId(calendarEvent->GetGuildId()); + + CalendarInviteIdList const invites = calendarEvent->GetInviteIdList(); + for (CalendarInviteIdList::const_iterator itr = invites.begin(); itr != invites.end(); ++itr) + { + if (CalendarInvite* invite = GetInvite(*itr)) + { + uint64 inviteId = GetFreeInviteId(); + CalendarInvite newInvite(inviteId); + newInvite.SetEventId(eventId); + newInvite.SetSenderGUID(action.GetPlayer()->GetGUID()); + newInvite.SetInvitee(invite->GetInvitee()); + newInvite.SetStatus(invite->GetStatus()); + newInvite.SetStatusTime(invite->GetStatusTime()); + newInvite.SetText(invite->GetText()); + newInvite.SetRank(invite->GetRank()); + if (AddInvite(newInvite)) + { + SendCalendarEventInviteAlert(newEvent, newInvite); + newEvent.AddInvite(inviteId); + } + } + } + + if (AddEvent(newEvent)) + SendCalendarEvent(newEvent, CALENDAR_SENDTYPE_COPY); + + break; + } + case CALENDAR_ACTION_REMOVE_EVENT: + { + uint64 eventId = action.Event.GetEventId(); + //uint32 flags = action.Event.GetFlags(); + // FIXME - Use of Flags here! + + CalendarEvent* calendarEvent = CheckPermisions(eventId, action.GetPlayer(), action.GetInviteId(), CALENDAR_RANK_OWNER); + if (!calendarEvent) + return; + + RemoveEvent(eventId); + break; + } + case CALENDAR_ACTION_ADD_EVENT_INVITE: + { + uint64 eventId = action.Invite.GetEventId(); + CalendarEvent* calendarEvent = CheckPermisions(eventId, action.GetPlayer(), action.GetInviteId(), CALENDAR_RANK_MODERATOR); + if (!calendarEvent) + return; + + if (AddInvite(action.Invite)) + { + calendarEvent->AddInvite(action.Invite.GetInviteId()); + SendCalendarEventInvite(action.Invite, (!(calendarEvent->GetFlags() & CALENDAR_FLAG_INVITES_LOCKED) && + !action.Invite.GetStatusTime())); + SendCalendarEventInviteAlert(*calendarEvent, action.Invite); + } + + break; + } + case CALENDAR_ACTION_SIGNUP_TO_EVENT: + { + uint64 eventId = action.Event.GetEventId(); + CalendarEvent* calendarEvent = GetEvent(eventId); + CheckPermisions(eventId, action.GetPlayer(), action.GetInviteId(), CALENDAR_RANK_MODERATOR); + + if (!calendarEvent || !(calendarEvent->GetFlags() & CALENDAR_FLAG_GUILD_ONLY) + || !calendarEvent->GetGuildId() || calendarEvent->GetGuildId() != action.GetExtraData()) + return; + + CalendarInviteStatus status = action.Invite.GetStatus(); + + if (status == CALENDAR_STATUS_INVITED) + status = CALENDAR_STATUS_CONFIRMED; + else if (status == CALENDAR_STATUS_ACCEPTED) + status = CALENDAR_STATUS_8; + + CalendarInvite newInvite(GetFreeInviteId()); + newInvite.SetStatus(status); + newInvite.SetStatusTime(uint32(time(NULL))); + newInvite.SetEventId(eventId); + newInvite.SetInvitee(action.GetPlayer()->GetGUID()); + newInvite.SetSenderGUID(action.GetPlayer()->GetGUID()); + + if (AddInvite(newInvite)) + SendCalendarEventInvite(newInvite, false); + + break; + } + case CALENDAR_ACTION_MODIFY_EVENT_INVITE: + { + uint64 eventId = action.Invite.GetEventId(); + uint64 inviteId = action.Invite.GetInviteId(); + + CalendarEvent* calendarEvent = NULL; + if (action.GetInviteId() != action.Invite.GetInviteId()) + calendarEvent = CheckPermisions(eventId, action.GetPlayer(), action.GetInviteId(), CALENDAR_RANK_MODERATOR); + else + calendarEvent = GetEvent(eventId); + + CalendarInvite* invite = GetInvite(inviteId); + + if (!calendarEvent || !invite || !calendarEvent->HasInvite(inviteId)) + return; + + invite->SetStatus(action.Invite.GetStatus()); + SendCalendarEventStatus(invite->GetSenderGUID(), *calendarEvent, *invite); + break; + } + case CALENDAR_ACTION_MODIFY_MODERATOR_EVENT_INVITE: + { + uint64 eventId = action.Invite.GetEventId(); + uint64 inviteId = action.Invite.GetInviteId(); + + CalendarEvent* calendarEvent = NULL; + if (action.GetInviteId() != action.Invite.GetInviteId()) + calendarEvent = CheckPermisions(eventId, action.GetPlayer(), action.GetInviteId(), CALENDAR_RANK_OWNER); + else + calendarEvent = GetEvent(eventId); + + CalendarInvite* invite = GetInvite(inviteId); + + if (!calendarEvent || !invite || !calendarEvent->HasInvite(inviteId)) + return; + + invite->SetStatus(action.Invite.GetStatus()); + SendCalendarEventModeratorStatusAlert(*invite); + break; + } + case CALENDAR_ACTION_REMOVE_EVENT_INVITE: + { + uint64 eventId = action.Invite.GetEventId(); + uint64 inviteId = action.Invite.GetInviteId(); + CalendarEvent* calendarEvent = CheckPermisions(eventId, action.GetPlayer(), action.GetInviteId(), CALENDAR_RANK_MODERATOR); + if (!calendarEvent) + return; + + // already checked in CheckPermisions + CalendarInvite* invite = GetInvite(inviteId); + if (!invite) + return; + + if (calendarEvent->GetCreatorGUID() == invite->GetInvitee()) + { + action.GetPlayer()->GetSession()->SendCalendarCommandResult(CALENDAR_ERROR_DELETE_CREATOR_FAILED); + return; + } + + if (uint64 invitee = RemoveInvite(inviteId)) + { + SendCalendarEventInviteRemoveAlert(invitee, *calendarEvent, CALENDAR_STATUS_9); + SendCalendarEventInviteRemove(action.GetPlayer()->GetGUID(), action.Invite, calendarEvent->GetFlags()); + } + break; + } + default: + break; + } + +} + +bool CalendarMgr::AddEvent(CalendarEvent const& newEvent) +{ + uint64 eventId = newEvent.GetEventId(); + if (_events.find(eventId) != _events.end()) + { + sLog->outError("CalendarMgr::AddEvent: Event [" UI64FMTD "] exists", eventId); + return false; + } + + _events[eventId] = newEvent; + return true; +} + +bool CalendarMgr::RemoveEvent(uint64 eventId) +{ + CalendarEventMap::iterator itr = _events.find(eventId); + if (itr == _events.end()) + { + sLog->outError("CalendarMgr::RemoveEvent: Event [" UI64FMTD "] does not exist", eventId); + return false; + } + + bool val = true; + + CalendarInviteIdList const& invites = itr->second.GetInviteIdList(); + for (CalendarInviteIdList::const_iterator itrInvites = invites.begin(); itrInvites != invites.end(); ++itrInvites) + { + CalendarInvite* invite = GetInvite(*itrInvites); + if (!invite || !RemovePlayerEvent(invite->GetInvitee(), eventId)) + val = false; + + if (uint64 invitee = RemoveInvite(*itrInvites)) + SendCalendarEventRemovedAlert(invitee, itr->second); + } + + _events.erase(itr); + + return val; +} + +bool CalendarMgr::AddPlayerEvent(uint64 guid, uint64 eventId) +{ + _playerEvents[guid].insert(eventId); + return true; +} + +bool CalendarMgr::RemovePlayerEvent(uint64 guid, uint64 eventId) +{ + _playerEvents[guid].erase(eventId); + return true; +} + +bool CalendarMgr::AddInvite(CalendarInvite const& newInvite) +{ + uint64 inviteId = newInvite.GetInviteId(); + if (!inviteId) + { + sLog->outError("CalendarMgr::AddInvite: Cant add Invite 0"); + return false; + } + + if (_invites.find(inviteId) != _invites.end()) + { + sLog->outError("CalendarMgr::AddInvite: Invite [" UI64FMTD "] exists", inviteId); + return false; + } + + _invites[inviteId] = newInvite; + uint64 guid = newInvite.GetInvitee(); + bool inviteAdded = AddPlayerInvite(guid, inviteId); + bool eventAdded = AddPlayerEvent(guid, newInvite.GetEventId()); + return eventAdded && inviteAdded; +} + +uint64 CalendarMgr::RemoveInvite(uint64 inviteId) +{ + CalendarInviteMap::iterator itr = _invites.find(inviteId); + if (itr == _invites.end()) + { + sLog->outError("CalendarMgr::RemoveInvite: Invite [" UI64FMTD "] does not exist", inviteId); + return 0; + } + + uint64 invitee = itr->second.GetInvitee(); + _invites.erase(itr); + + return RemovePlayerInvite(invitee, inviteId) ? invitee : 0; +} + +bool CalendarMgr::AddPlayerInvite(uint64 guid, uint64 inviteId) +{ + _playerInvites[guid].insert(inviteId); + return true; +} + +bool CalendarMgr::RemovePlayerInvite(uint64 guid, uint64 inviteId) +{ + _playerInvites[guid].erase(inviteId); + return true; +} + +void CalendarMgr::SendCalendarEvent(CalendarEvent const& calendarEvent, CalendarSendEventType type) +{ + if (Player* player = ObjectAccessor::FindPlayer(calendarEvent.GetCreatorGUID())) + player->GetSession()->SendCalendarEvent(calendarEvent, type); +} + +void CalendarMgr::SendCalendarEventInvite(CalendarInvite const& invite, bool pending) +{ + if (Player* player = ObjectAccessor::FindPlayer(invite.GetSenderGUID())) + player->GetSession()->SendCalendarEventInvite(invite, pending); +} + +void CalendarMgr::SendCalendarEventInviteAlert(CalendarEvent const& calendarEvent, CalendarInvite const& invite) +{ + if (Player* player = ObjectAccessor::FindPlayer(invite.GetInvitee())) + player->GetSession()->SendCalendarEventInviteAlert(calendarEvent, invite); +} + +void CalendarMgr::SendCalendarEventUpdateAlert(uint64 guid, CalendarEvent const& calendarEvent, CalendarSendEventType type) +{ + if (Player* player = ObjectAccessor::FindPlayer(guid)) + player->GetSession()->SendCalendarEventUpdateAlert(calendarEvent, type); +} + +void CalendarMgr::SendCalendarEventStatus(uint64 guid, CalendarEvent const& calendarEvent, CalendarInvite const& invite) +{ + if (Player* player = ObjectAccessor::FindPlayer(guid)) + player->GetSession()->SendCalendarEventStatus(calendarEvent, invite); +} + +void CalendarMgr::SendCalendarEventRemovedAlert(uint64 guid, CalendarEvent const& calendarEvent) +{ + if (Player* player = ObjectAccessor::FindPlayer(guid)) + player->GetSession()->SendCalendarEventRemovedAlert(calendarEvent); +} + +void CalendarMgr::SendCalendarEventInviteRemoveAlert(uint64 guid, CalendarEvent const& calendarEvent, CalendarInviteStatus status) +{ + if (Player* player = ObjectAccessor::FindPlayer(guid)) + player->GetSession()->SendCalendarEventInviteRemoveAlert(calendarEvent, status); +} + +void CalendarMgr::SendCalendarEventInviteRemove(uint64 guid, CalendarInvite const& invite, uint32 flags) +{ + if (Player* player = ObjectAccessor::FindPlayer(guid)) + player->GetSession()->SendCalendarEventInviteRemove(invite, flags); +} + +void CalendarMgr::SendCalendarEventModeratorStatusAlert(CalendarInvite const& invite) +{ + if (Player* player = ObjectAccessor::FindPlayer(invite.GetInvitee())) + player->GetSession()->SendCalendarEventModeratorStatusAlert(invite); +} diff --git a/src/server/game/Calendar/CalendarMgr.h b/src/server/game/Calendar/CalendarMgr.h new file mode 100644 index 00000000000..a8749778cb3 --- /dev/null +++ b/src/server/game/Calendar/CalendarMgr.h @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2008-2012 TrinityCore + * + * 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; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; 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, see . + */ + +#ifndef TRINITY_CALENDARMGR_H +#define TRINITY_CALENDARMGR_H + +#include +#include "Calendar.h" + +class CalendarMgr +{ + friend class ACE_Singleton; + + CalendarMgr(); + ~CalendarMgr(); + + public: + void LoadFromDB(); + + CalendarInvite* GetInvite(uint64 inviteId); + CalendarEvent* GetEvent(uint64 eventId); + + CalendarInviteIdList const& GetPlayerInvites(uint64 guid); + CalendarEventIdList const& GetPlayerEvents(uint64 guid); + + uint32 GetPlayerNumPending(uint64 guid); + uint64 GetFreeEventId(); + uint64 GetFreeInviteId(); + + void AddAction(CalendarAction const& action); + + void SendCalendarEvent(CalendarEvent const& calendarEvent, CalendarSendEventType type); + void SendCalendarEventInvite(CalendarInvite const& invite, bool pending); + void SendCalendarEventInviteAlert(CalendarEvent const& calendarEvent, CalendarInvite const& invite); + void SendCalendarEventInviteRemove(uint64 guid, CalendarInvite const& invite, uint32 flags); + void SendCalendarEventInviteRemoveAlert(uint64 guid, CalendarEvent const& calendarEvent, CalendarInviteStatus status); + void SendCalendarEventUpdateAlert(uint64 guid, CalendarEvent const& calendarEvent, CalendarSendEventType type); + void SendCalendarEventStatus(uint64 guid, CalendarEvent const& calendarEvent, CalendarInvite const& invite); + void SendCalendarEventRemovedAlert(uint64 guid, CalendarEvent const& calendarEvent); + void SendCalendarEventModeratorStatusAlert(CalendarInvite const& invite); + + private: + CalendarEvent* CheckPermisions(uint64 eventId, Player* player, uint64 inviteId, CalendarModerationRank minRank); + + bool AddEvent(CalendarEvent const& calendarEvent); + bool RemoveEvent(uint64 eventId); + bool AddPlayerEvent(uint64 guid, uint64 eventId); + bool RemovePlayerEvent(uint64 guid, uint64 eventId); + + bool AddInvite(CalendarInvite const& invite); + uint64 RemoveInvite(uint64 inviteId); + bool AddPlayerInvite(uint64 guid, uint64 inviteId); + bool RemovePlayerInvite(uint64 guid, uint64 inviteId); + + CalendarEventMap _events; + CalendarInviteMap _invites; + CalendarPlayerInviteIdMap _playerInvites; + CalendarPlayerEventIdMap _playerEvents; + + uint64 _eventNum; + uint64 _inviteNum; +}; + +#define sCalendarMgr ACE_Singleton::instance() + +#endif diff --git a/src/server/game/Chat/Channels/Channel.cpp b/src/server/game/Chat/Channels/Channel.cpp index b6e9dd30d28..0e89601e987 100755 --- a/src/server/game/Chat/Channels/Channel.cpp +++ b/src/server/game/Chat/Channels/Channel.cpp @@ -49,7 +49,6 @@ Channel::Channel(const std::string& name, uint32 channel_id, uint32 Team) } else // it's custom channel { - channel_id = 0; m_flags |= CHANNEL_FLAG_CUSTOM; // If storing custom channels in the db is enabled either load or save the channel @@ -671,7 +670,7 @@ void Channel::Invite(uint64 p, const char *newname) } Player* newp = sObjectAccessor->FindPlayerByName(newname); - if (!newp) + if (!newp || !newp->isGMVisible()) { WorldPacket data; MakePlayerNotFound(&data, newname); diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index 035fbaf5b78..cc64a8e22dd 100755 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -140,10 +140,10 @@ ChatCommand* ChatHandler::getCommandTable() static ChatCommand groupCommandTable[] = { - { "leader", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleGroupLeaderCommand>, "", NULL }, - { "disband", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleGroupDisbandCommand>, "", NULL }, - { "remove", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleGroupRemoveCommand>, "", NULL }, - { NULL, 0, false, NULL, "", NULL } + { "leader", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleGroupLeaderCommand>, "", NULL }, + { "disband", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleGroupDisbandCommand>, "", NULL }, + { "remove", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleGroupRemoveCommand>, "", NULL }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand guildCommandTable[] = @@ -281,7 +281,7 @@ ChatCommand* ChatHandler::getCommandTable() { "corpses", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleServerCorpsesCommand>, "", NULL }, { "exit", SEC_CONSOLE, true, OldHandler<&ChatHandler::HandleServerExitCommand>, "", NULL }, { "idlerestart", SEC_ADMINISTRATOR, true, NULL, "", serverIdleRestartCommandTable }, - { "idleshutdown", SEC_ADMINISTRATOR, true, NULL, "", serverShutdownCommandTable }, + { "idleshutdown", SEC_ADMINISTRATOR, true, NULL, "", serverIdleShutdownCommandTable }, { "info", SEC_PLAYER, true, OldHandler<&ChatHandler::HandleServerInfoCommand>, "", NULL }, { "motd", SEC_PLAYER, true, OldHandler<&ChatHandler::HandleServerMotdCommand>, "", NULL }, { "plimit", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerPLimitCommand>, "", NULL }, @@ -336,6 +336,7 @@ ChatCommand* ChatHandler::getCommandTable() { "lookup", SEC_ADMINISTRATOR, true, NULL, "", lookupCommandTable }, { "pdump", SEC_ADMINISTRATOR, true, NULL, "", pdumpCommandTable }, { "guild", SEC_ADMINISTRATOR, true, NULL, "", guildCommandTable }, + { "group", SEC_ADMINISTRATOR, false, NULL, "", groupCommandTable }, { "cast", SEC_ADMINISTRATOR, false, NULL, "", castCommandTable }, { "reset", SEC_ADMINISTRATOR, true, NULL, "", resetCommandTable }, { "instance", SEC_ADMINISTRATOR, true, NULL, "", instanceCommandTable }, @@ -358,7 +359,6 @@ ChatCommand* ChatHandler::getCommandTable() { "summon", SEC_MODERATOR, false, OldHandler<&ChatHandler::HandleSummonCommand>, "", NULL }, { "groupsummon", SEC_MODERATOR, false, OldHandler<&ChatHandler::HandleGroupSummonCommand>, "", NULL }, { "commands", SEC_PLAYER, true, OldHandler<&ChatHandler::HandleCommandsCommand>, "", NULL }, - { "demorph", SEC_GAMEMASTER, false, OldHandler<&ChatHandler::HandleDeMorphCommand>, "", NULL }, { "die", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleDieCommand>, "", NULL }, { "revive", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleReviveCommand>, "", NULL }, { "dismount", SEC_PLAYER, false, OldHandler<&ChatHandler::HandleDismountCommand>, "", NULL }, @@ -381,7 +381,6 @@ ChatCommand* ChatHandler::getCommandTable() { "linkgrave", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleLinkGraveCommand>, "", NULL }, { "neargrave", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleNearGraveCommand>, "", NULL }, { "explorecheat", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleExploreCheatCommand>, "", NULL }, - { "hover", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleHoverCommand>, "", NULL }, { "levelup", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleLevelUpCommand>, "", NULL }, { "showarea", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleShowAreaCommand>, "", NULL }, { "hidearea", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleHideAreaCommand>, "", NULL }, @@ -400,7 +399,7 @@ ChatCommand* ChatHandler::getCommandTable() { "movegens", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleMovegensCommand>, "", NULL }, { "cometome", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleComeToMeCommand>, "", NULL }, { "damage", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleDamageCommand>, "", NULL }, - { "combatstop", SEC_GAMEMASTER, false, OldHandler<&ChatHandler::HandleCombatStopCommand>, "", NULL }, + { "combatstop", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleCombatStopCommand>, "", NULL }, { "flusharenapoints", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleFlushArenaPointsCommand>, "", NULL }, { "repairitems", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleRepairitemsCommand>, "", NULL }, { "waterwalk", SEC_GAMEMASTER, false, OldHandler<&ChatHandler::HandleWaterwalkCommand>, "", NULL }, @@ -443,7 +442,10 @@ ChatCommand* ChatHandler::getCommandTable() added += appendCommandTable(commandTableCache + added, *it); } - QueryResult result = WorldDatabase.Query("SELECT name, security, help FROM command"); + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_COMMANDS); + + PreparedQueryResult result = WorldDatabase.Query(stmt); + if (result) { do @@ -451,7 +453,7 @@ ChatCommand* ChatHandler::getCommandTable() Field* fields = result->Fetch(); std::string name = fields[0].GetString(); - SetDataForCommandInTable(commandTableCache, name.c_str(), fields[1].GetUInt16(), fields[2].GetString(), name); + SetDataForCommandInTable(commandTableCache, name.c_str(), fields[1].GetUInt8(), fields[2].GetString(), name); } while (result->NextRow()); } @@ -1331,7 +1333,7 @@ GameTele const* ChatHandler::extractGameTeleFromLink(char* text) // id, or string, or [name] Shift-click form |color|Htele:id|h[name]|h|r char* cId = extractKeyFromLink(text, "Htele"); if (!cId) - return false; + return NULL; // id case (explicit or from shift link) if (cId[0] >= '0' || cId[0] >= '9') @@ -1503,7 +1505,7 @@ char* ChatHandler::extractQuotedArg(char* args) { char* space = strtok(args, "\""); if (!space) - return false; + return NULL; return strtok(NULL, "\""); } } diff --git a/src/server/game/Chat/Chat.h b/src/server/game/Chat/Chat.h index 2311f4b8e5e..e88914a2daf 100755 --- a/src/server/game/Chat/Chat.h +++ b/src/server/game/Chat/Chat.h @@ -286,7 +286,6 @@ class ChatHandler bool HandleActivateObjectCommand(const char* args); bool HandleSpawnTransportCommand(const char* args); bool HandleExploreCheatCommand(const char* args); - bool HandleHoverCommand(const char* args); bool HandleWaterwalkCommand(const char* args); bool HandleLevelUpCommand(const char* args); bool HandleShowAreaCommand(const char* args); @@ -350,8 +349,8 @@ class ChatHandler bool HandleSaveAllCommand(const char* args); // Utility methods for commands - bool LookupPlayerSearchCommand(QueryResult result, int32 limit); - bool HandleBanListHelper(QueryResult result); + bool LookupPlayerSearchCommand(PreparedQueryResult result, int32 limit); + bool HandleBanListHelper(PreparedQueryResult result); bool HandleBanHelper(BanMode mode, char const* args); bool HandleBanInfoHelper(uint32 accountid, char const* accountname); bool HandleUnBanHelper(BanMode mode, char const* args); diff --git a/src/server/game/Chat/Commands/Level0.cpp b/src/server/game/Chat/Commands/Level0.cpp index 6d33a5761f4..b2ac090c313 100755 --- a/src/server/game/Chat/Commands/Level0.cpp +++ b/src/server/game/Chat/Commands/Level0.cpp @@ -17,10 +17,8 @@ */ #include "Common.h" -#include "DatabaseEnv.h" #include "World.h" #include "Player.h" -#include "Opcodes.h" #include "Chat.h" #include "ObjectAccessor.h" #include "Language.h" @@ -54,31 +52,31 @@ bool ChatHandler::HandleCommandsCommand(const char* /*args*/) bool ChatHandler::HandleStartCommand(const char* /*args*/) { - Player* chr = m_session->GetPlayer(); + Player* player = m_session->GetPlayer(); - if (chr->isInFlight()) + if (player->isInFlight()) { SendSysMessage(LANG_YOU_IN_FLIGHT); SetSentErrorMessage(true); return false; } - if (chr->isInCombat()) + if (player->isInCombat()) { SendSysMessage(LANG_YOU_IN_COMBAT); SetSentErrorMessage(true); return false; } - if ((chr->isDead()) || (chr->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))) + if (player->isDead() || player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST)) { - // if player is dead and stuck, send ghost to graveyard - chr->RepopAtGraveyard(); - return true; + // if player is dead and stuck, send ghost to graveyard + player->RepopAtGraveyard(); + return true; } // cast spell Stuck - chr->CastSpell(chr, 7355, false); + player->CastSpell(player, 7355, false); return true; } @@ -107,23 +105,25 @@ bool ChatHandler::HandleServerInfoCommand(const char* /*args*/) bool ChatHandler::HandleDismountCommand(const char* /*args*/) { + Player* player = m_session->GetPlayer(); + //If player is not mounted, so go out :) - if (!m_session->GetPlayer()->IsMounted()) + if (!player->IsMounted()) { SendSysMessage(LANG_CHAR_NON_MOUNTED); SetSentErrorMessage(true); return false; } - if (m_session->GetPlayer()->isInFlight()) + if (player->isInFlight()) { SendSysMessage(LANG_YOU_IN_FLIGHT); SetSentErrorMessage(true); return false; } - m_session->GetPlayer()->Dismount(); - m_session->GetPlayer()->RemoveAurasByType(SPELL_AURA_MOUNTED); + player->Dismount(); + player->RemoveAurasByType(SPELL_AURA_MOUNTED); return true; } @@ -144,7 +144,7 @@ bool ChatHandler::HandleSaveCommand(const char* /*args*/) // save if the player has last been saved over 20 seconds ago uint32 save_interval = sWorld->getIntConfig(CONFIG_INTERVAL_SAVE); - if (save_interval == 0 || (save_interval > 20*IN_MILLISECONDS && player->GetSaveTimer() <= save_interval - 20*IN_MILLISECONDS)) + if (save_interval == 0 || (save_interval > 20 * IN_MILLISECONDS && player->GetSaveTimer() <= save_interval - 20 * IN_MILLISECONDS)) player->SaveToDB(); return true; diff --git a/src/server/game/Chat/Commands/Level1.cpp b/src/server/game/Chat/Commands/Level1.cpp index 2a57dce77a4..abbc59d0114 100755 --- a/src/server/game/Chat/Commands/Level1.cpp +++ b/src/server/game/Chat/Commands/Level1.cpp @@ -42,7 +42,6 @@ bool ChatHandler::HandleNameAnnounceCommand(const char* args) { - WorldPacket data; if (!*args) return false; @@ -56,7 +55,6 @@ bool ChatHandler::HandleNameAnnounceCommand(const char* args) bool ChatHandler::HandleGMNameAnnounceCommand(const char* args) { - WorldPacket data; if (!*args) return false; @@ -422,13 +420,10 @@ bool ChatHandler::HandleTaxiCheatCommand(const char* args) std::string argstr = (char*)args; Player* chr = getSelectedPlayer(); - if (!chr) - { - chr=m_session->GetPlayer(); - } - // check online security - else if (HasLowerSecurity(chr, 0)) + if (!chr) + chr = m_session->GetPlayer(); + else if (HasLowerSecurity(chr, 0)) // check online security return false; if (argstr == "on") @@ -474,12 +469,12 @@ bool ChatHandler::HandleLookupAreaCommand(const char* args) wstrToLower (wnamepart); // Search in AreaTable.dbc - for (uint32 areaflag = 0; areaflag < sAreaStore.GetNumRows (); ++areaflag) + for (uint32 areaflag = 0; areaflag < sAreaStore.GetNumRows(); ++areaflag) { - AreaTableEntry const* areaEntry = sAreaStore.LookupEntry (areaflag); + AreaTableEntry const* areaEntry = sAreaStore.LookupEntry(areaflag); if (areaEntry) { - int loc = GetSessionDbcLocale (); + int loc = GetSessionDbcLocale(); std::string name = areaEntry->area_name; if (name.empty()) continue; @@ -489,11 +484,11 @@ bool ChatHandler::HandleLookupAreaCommand(const char* args) loc = 0; for (; loc < TOTAL_LOCALES; ++loc) { - if (loc == GetSessionDbcLocale ()) + if (loc == GetSessionDbcLocale()) continue; name = areaEntry->area_name; - if (name.empty ()) + if (name.empty()) continue; if (Utf8FitTo (name, wnamepart)) @@ -516,7 +511,7 @@ bool ChatHandler::HandleLookupAreaCommand(const char* args) else ss << areaEntry->ID << " - " << name << ' ' << localeNames[loc]; - SendSysMessage (ss.str ().c_str()); + SendSysMessage(ss.str().c_str()); if (!found) found = true; @@ -525,7 +520,7 @@ bool ChatHandler::HandleLookupAreaCommand(const char* args) } if (!found) - SendSysMessage (LANG_COMMAND_NOAREAFOUND); + SendSysMessage(LANG_COMMAND_NOAREAFOUND); return true; } @@ -698,7 +693,7 @@ bool ChatHandler::HandleGroupSummonCommand(const char* args) } Map* gmMap = m_session->GetPlayer()->GetMap(); - bool to_instance = gmMap->Instanceable(); + bool to_instance = gmMap->Instanceable(); // we are in instance, and can summon only player in our group with us as lead if (to_instance && ( diff --git a/src/server/game/Chat/Commands/Level2.cpp b/src/server/game/Chat/Commands/Level2.cpp index b0c0bbf6890..4359c5ff20c 100755 --- a/src/server/game/Chat/Commands/Level2.cpp +++ b/src/server/game/Chat/Commands/Level2.cpp @@ -42,6 +42,7 @@ #include "Transport.h" #include "TargetedMovementGenerator.h" // for HandleNpcUnFollowCommand #include "CreatureGroups.h" +#include "ace/INET_Addr.h" //mute player for some times bool ChatHandler::HandleMuteCommand(const char* args) @@ -175,7 +176,6 @@ bool ChatHandler::HandleItemMoveCommand(const char* args) { if (!*args) return false; - uint8 srcslot, dstslot; char* pParam1 = strtok((char*)args, " "); if (!pParam1) @@ -185,8 +185,8 @@ bool ChatHandler::HandleItemMoveCommand(const char* args) if (!pParam2) return false; - srcslot = (uint8)atoi(pParam1); - dstslot = (uint8)atoi(pParam2); + uint8 srcslot = (uint8)atoi(pParam1); + uint8 dstslot = (uint8)atoi(pParam2); if (srcslot == dstslot) return true; @@ -205,22 +205,6 @@ bool ChatHandler::HandleItemMoveCommand(const char* args) return true; } -//demorph player or unit -bool ChatHandler::HandleDeMorphCommand(const char* /*args*/) -{ - Unit* target = getSelectedUnit(); - if (!target) - target = m_session->GetPlayer(); - - // check online security - else if (target->GetTypeId() == TYPEID_PLAYER && HasLowerSecurity((Player*)target, 0)) - return false; - - target->DeMorph(); - - return true; -} - //kick player bool ChatHandler::HandleKickPlayerCommand(const char *args) { @@ -266,19 +250,18 @@ bool ChatHandler::HandlePInfoCommand(const char* args) else if (!extractPlayerTarget((char*)args, &target, &target_guid, &target_name)) return false; - uint32 accId = 0; - uint32 money = 0; + uint32 accId = 0; + uint32 money = 0; uint32 total_player_time = 0; - uint8 level = 0; - uint32 latency = 0; + uint8 level = 0; + uint32 latency = 0; uint8 race; uint8 Class; - int64 muteTime = 0; - int64 banTime = -1; + int64 muteTime = 0; + int64 banTime = -1; uint32 mapId; uint32 areaId; - uint32 phase = 0; - + uint32 phase = 0; // get additional information from Player object if (target) @@ -287,17 +270,17 @@ bool ChatHandler::HandlePInfoCommand(const char* args) if (HasLowerSecurity(target, 0)) return false; - accId = target->GetSession()->GetAccountId(); - money = target->GetMoney(); + accId = target->GetSession()->GetAccountId(); + money = target->GetMoney(); total_player_time = target->GetTotalPlayedTime(); - level = target->getLevel(); - latency = target->GetSession()->GetLatency(); - race = target->getRace(); - Class = target->getClass(); - muteTime = target->GetSession()->m_muteTime; - mapId = target->GetMapId(); - areaId = target->GetAreaId(); - phase = target->GetPhaseMask(); + level = target->getLevel(); + latency = target->GetSession()->GetLatency(); + race = target->getRace(); + Class = target->getClass(); + muteTime = target->GetSession()->m_muteTime; + mapId = target->GetMapId(); + areaId = target->GetAreaId(); + phase = target->GetPhaseMask(); } // get additional information from DB else @@ -306,41 +289,42 @@ bool ChatHandler::HandlePInfoCommand(const char* args) if (HasLowerSecurity(NULL, target_guid)) return false; - // 0 1 2 3 4 5 6 7 - QueryResult result = CharacterDatabase.PQuery("SELECT totaltime, level, money, account, race, class, map, zone FROM characters " - "WHERE guid = '%u'", GUID_LOPART(target_guid)); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_PINFO); + stmt->setUInt32(0, GUID_LOPART(target_guid)); + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (!result) return false; - Field* fields = result->Fetch(); + Field* fields = result->Fetch(); total_player_time = fields[0].GetUInt32(); - level = fields[1].GetUInt32(); - money = fields[2].GetUInt32(); - accId = fields[3].GetUInt32(); - race = fields[4].GetUInt8(); - Class = fields[5].GetUInt8(); - mapId = fields[6].GetUInt16(); - areaId = fields[7].GetUInt16(); + level = fields[1].GetUInt8(); + money = fields[2].GetUInt32(); + accId = fields[3].GetUInt32(); + race = fields[4].GetUInt8(); + Class = fields[5].GetUInt8(); + mapId = fields[6].GetUInt16(); + areaId = fields[7].GetUInt16(); } - std::string username = GetTrinityString(LANG_ERROR); - std::string email = GetTrinityString(LANG_ERROR); - std::string last_ip = GetTrinityString(LANG_ERROR); - uint32 security = 0; + std::string username = GetTrinityString(LANG_ERROR); + std::string email = GetTrinityString(LANG_ERROR); + std::string last_ip = GetTrinityString(LANG_ERROR); + uint32 security = 0; std::string last_login = GetTrinityString(LANG_ERROR); - QueryResult result = LoginDatabase.PQuery("SELECT a.username, aa.gmlevel, a.email, a.last_ip, a.last_login, a.mutetime " - "FROM account a " - "LEFT JOIN account_access aa " - "ON (a.id = aa.id AND (aa.RealmID = -1 OR aa.RealmID = %u)) " - "WHERE a.id = '%u'", realmID, accId); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_PINFO); + stmt->setInt32(0, int32(realmID)); + stmt->setUInt32(1, accId); + PreparedQueryResult result = LoginDatabase.Query(stmt); + if (result) { Field* fields = result->Fetch(); - username = fields[0].GetString(); - security = fields[1].GetUInt32(); - email = fields[2].GetString(); - muteTime = fields[5].GetUInt64(); + username = fields[0].GetString(); + security = fields[1].GetUInt8(); + email = fields[2].GetString(); + muteTime = fields[5].GetUInt64(); if (email.empty()) email = "-"; @@ -349,6 +333,25 @@ bool ChatHandler::HandlePInfoCommand(const char* args) { last_ip = fields[3].GetString(); last_login = fields[4].GetString(); + + uint32 ip = inet_addr(last_ip.c_str()); +#if TRINITY_ENDIAN == BIGENDIAN + EndianConvertReverse(ip); +#endif + + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_IP2NATION_COUNTRY); + + stmt->setUInt32(0, ip); + + PreparedQueryResult result2 = WorldDatabase.Query(stmt); + + if (result2) + { + Field* fields2 = result2->Fetch(); + last_ip.append(" ("); + last_ip.append(fields2[0].GetString()); + last_ip.append(")"); + } } else { @@ -363,21 +366,23 @@ bool ChatHandler::HandlePInfoCommand(const char* args) std::string bannedby = "unknown"; std::string banreason = ""; - if (QueryResult result2 = LoginDatabase.PQuery("SELECT unbandate, bandate = unbandate, bannedby, banreason FROM account_banned " - "WHERE id = '%u' AND active ORDER BY bandate ASC LIMIT 1", accId)) + + stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_PINFO_BANS); + stmt->setUInt32(0, accId); + PreparedQueryResult result2 = LoginDatabase.Query(stmt); + if (!result2) { - Field* fields = result2->Fetch(); - banTime = fields[1].GetBool() ? 0 : fields[0].GetUInt64(); - bannedby = fields[2].GetString(); - banreason = fields[3].GetString(); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PINFO_BANS); + stmt->setUInt32(0, GUID_LOPART(target_guid)); + result2 = CharacterDatabase.Query(stmt); } - else if (QueryResult result3 = CharacterDatabase.PQuery("SELECT unbandate, bandate = unbandate, bannedby, banreason FROM character_banned " - "WHERE guid = '%u' AND active ORDER BY bandate ASC LIMIT 1", GUID_LOPART(target_guid))) + + if (result2) { - Field* fields = result3->Fetch(); - banTime = fields[1].GetBool() ? 0 : fields[0].GetUInt64(); - bannedby = fields[2].GetString(); - banreason = fields[3].GetString(); + Field* fields = result2->Fetch(); + banTime = int64(fields[1].GetBool() ? 0 : fields[0].GetUInt32()); + bannedby = fields[2].GetString(); + banreason = fields[3].GetString(); } if (muteTime > 0) @@ -694,9 +699,22 @@ bool ChatHandler::HandleLookupEventCommand(const char* args) bool ChatHandler::HandleCombatStopCommand(const char* args) { - Player* target; - if (!extractPlayerTarget((char*)args, &target)) - return false; + Player* target = NULL; + + if (args && strlen(args) > 0) + { + target = sObjectAccessor->FindPlayerByName(args); + if (!target) + { + SendSysMessage(LANG_PLAYER_NOT_FOUND); + SetSentErrorMessage(true); + return false; + } + } + + if (!target) + if (!extractPlayerTarget((char*)args, &target)) + return false; // check online security if (HasLowerSecurity(target, 0)) @@ -730,9 +748,9 @@ bool ChatHandler::HandleLookupPlayerIpCommand(const char* args) limit = limit_str ? atoi (limit_str) : -1; } - LoginDatabase.EscapeString(ip); - - QueryResult result = LoginDatabase.PQuery("SELECT id, username FROM account WHERE last_ip = '%s'", ip.c_str()); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_BY_IP); + stmt->setString(0, ip); + PreparedQueryResult result = LoginDatabase.Query(stmt); return LookupPlayerSearchCommand(result, limit); } @@ -749,16 +767,15 @@ bool ChatHandler::HandleLookupPlayerAccountCommand(const char* args) if (!AccountMgr::normalizeString (account)) return false; - LoginDatabase.EscapeString (account); - - QueryResult result = LoginDatabase.PQuery ("SELECT id, username FROM account WHERE username = '%s'", account.c_str ()); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_LIST_BY_NAME); + stmt->setString(0, account); + PreparedQueryResult result = LoginDatabase.Query(stmt); return LookupPlayerSearchCommand (result, limit); } bool ChatHandler::HandleLookupPlayerEmailCommand(const char* args) { - if (!*args) return false; @@ -766,14 +783,14 @@ bool ChatHandler::HandleLookupPlayerEmailCommand(const char* args) char* limit_str = strtok (NULL, " "); int32 limit = limit_str ? atoi (limit_str) : -1; - LoginDatabase.EscapeString (email); - - QueryResult result = LoginDatabase.PQuery ("SELECT id, username FROM account WHERE email = '%s'", email.c_str ()); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_LIST_BY_EMAIL); + stmt->setString(0, email); + PreparedQueryResult result = LoginDatabase.Query(stmt); - return LookupPlayerSearchCommand (result, limit); + return LookupPlayerSearchCommand(result, limit); } -bool ChatHandler::LookupPlayerSearchCommand(QueryResult result, int32 limit) +bool ChatHandler::LookupPlayerSearchCommand(PreparedQueryResult result, int32 limit) { if (!result) { @@ -797,8 +814,11 @@ bool ChatHandler::LookupPlayerSearchCommand(QueryResult result, int32 limit) uint32 acc_id = fields[0].GetUInt32(); std::string acc_name = fields[1].GetString(); - QueryResult chars = CharacterDatabase.PQuery("SELECT guid, name FROM characters WHERE account = '%u'", acc_id); - if (chars) + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_GUID_NAME_BY_ACC); + stmt->setUInt32(0, acc_id); + PreparedQueryResult result2 = CharacterDatabase.Query(stmt); + + if (result2) { PSendSysMessage(LANG_LOOKUP_PLAYER_ACCOUNT, acc_name.c_str(), acc_id); @@ -807,14 +827,14 @@ bool ChatHandler::LookupPlayerSearchCommand(QueryResult result, int32 limit) do { - Field* charfields = chars->Fetch(); + Field* charfields = result2->Fetch(); guid = charfields[0].GetUInt64(); name = charfields[1].GetString(); PSendSysMessage(LANG_LOOKUP_PLAYER_CHARACTER, name.c_str(), guid); ++i; - } while (chars->NextRow() && (limit == -1 || i < limit)); + } while (result2->NextRow() && (limit == -1 || i < limit)); } } while (result->NextRow()); diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp index 1cb07fca4a8..2ae7e73b828 100755 --- a/src/server/game/Chat/Commands/Level3.cpp +++ b/src/server/game/Chat/Commands/Level3.cpp @@ -87,11 +87,10 @@ bool ChatHandler::HandleSetSkillCommand(const char *args) return false; char *level_p = strtok (NULL, " "); - if (!level_p) return false; - char *max_p = strtok (NULL, " "); + char *max_p = strtok (NULL, " "); int32 skill = atoi(skill_p); if (skill <= 0) @@ -101,7 +100,7 @@ bool ChatHandler::HandleSetSkillCommand(const char *args) return false; } - int32 level = atol (level_p); + int32 level = atol(level_p); Player* target = getSelectedPlayer(); if (!target) @@ -128,7 +127,7 @@ bool ChatHandler::HandleSetSkillCommand(const char *args) return false; } - int32 max = max_p ? atol (max_p) : target->GetPureMaxSkillValue(skill); + int32 max = max_p ? atol (max_p) : target->GetPureMaxSkillValue(skill); if (level <= 0 || level > max || max <= 0) return false; @@ -226,7 +225,11 @@ bool ChatHandler::HandleAddItemCommand(const char *args) { std::string itemName = citemName+1; WorldDatabase.EscapeString(itemName); - QueryResult result = WorldDatabase.PQuery("SELECT entry FROM item_template WHERE name = '%s'", itemName.c_str()); + + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_ITEM_TEMPLATE_BY_NAME); + stmt->setString(0, itemName); + PreparedQueryResult result = WorldDatabase.Query(stmt); + if (!result) { PSendSysMessage(LANG_COMMAND_COULDNOTFIND, citemName+1); @@ -414,22 +417,22 @@ bool ChatHandler::HandleListItemCommand(const char *args) return false; uint32 count = uint32(_count); - QueryResult result; + PreparedQueryResult result; // inventory case uint32 inv_count = 0; - result = CharacterDatabase.PQuery("SELECT COUNT(itemEntry) FROM character_inventory ci INNER JOIN item_instance ii ON ii.guid = ci.item WHERE itemEntry = '%u'", item_id); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_INVENTORY_COUNT_ITEM); + stmt->setUInt32(0, item_id); + result = CharacterDatabase.Query(stmt); + if (result) - inv_count = (*result)[0].GetUInt32(); + inv_count = (*result)[0].GetUInt64(); - result=CharacterDatabase.PQuery( - // 0 1 2 3 4 5 - "SELECT ci.item, cb.slot AS bag, ci.slot, ci.guid, c.account, c.name FROM characters c " - "INNER JOIN character_inventory ci ON ci.guid = c.guid " - "INNER JOIN item_instance ii ON ii.guid = ci.item " - "LEFT JOIN character_inventory cb ON cb.item = ci.bag " - "WHERE ii.itemEntry = '%u' LIMIT %u ", - item_id, count); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_INVENTORY_ITEM_BY_ENTRY); + stmt->setUInt32(0, item_id); + stmt->setUInt32(1, count); + result = CharacterDatabase.Query(stmt); if (result) { @@ -438,7 +441,7 @@ bool ChatHandler::HandleListItemCommand(const char *args) Field* fields = result->Fetch(); uint32 item_guid = fields[0].GetUInt32(); uint32 item_bag = fields[1].GetUInt32(); - uint32 item_slot = fields[2].GetUInt32(); + uint8 item_slot = fields[2].GetUInt8(); uint32 owner_guid = fields[3].GetUInt32(); uint32 owner_acc = fields[4].GetUInt32(); std::string owner_name = fields[5].GetString(); @@ -467,24 +470,23 @@ bool ChatHandler::HandleListItemCommand(const char *args) // mail case uint32 mail_count = 0; - result = CharacterDatabase.PQuery("SELECT COUNT(itemEntry) FROM mail_items mi INNER JOIN item_instance ii ON ii.guid = mi.item_guid WHERE itemEntry = '%u'", item_id); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAIL_COUNT_ITEM); + stmt->setUInt32(0, item_id); + result = CharacterDatabase.Query(stmt); + if (result) - mail_count = (*result)[0].GetUInt32(); + mail_count = (*result)[0].GetUInt64(); if (count > 0) { - result = CharacterDatabase.PQuery( - // 0 1 2 3 4 5 6 - "SELECT mi.item_guid, m.sender, m.receiver, cs.account, cs.name, cr.account, cr.name FROM mail m " - "INNER JOIN mail_items mi ON mi.mail_id = m.id " - "INNER JOIN item_instance ii ON ii.guid = mi.item_guid " - "INNER JOIN characters cs ON cs.guid = m.sender " - "INNER JOIN characters cr ON cr.guid = m.receiver " - "WHERE ii.itemEntry = '%u' LIMIT %u", - item_id, count); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAIL_ITEMS_BY_ENTRY); + stmt->setUInt32(0, item_id); + stmt->setUInt32(1, count); + result = CharacterDatabase.Query(stmt); } else - result = QueryResult(NULL); + result = PreparedQueryResult(NULL); if (result) { @@ -515,21 +517,23 @@ bool ChatHandler::HandleListItemCommand(const char *args) // auction case uint32 auc_count = 0; - result=CharacterDatabase.PQuery("SELECT COUNT(itemEntry) FROM auctionhouse ah INNER JOIN item_instance ii ON ii.guid = ah.itemguid WHERE itemEntry = '%u'", item_id); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_AUCTIONHOUSE_COUNT_ITEM); + stmt->setUInt32(0, item_id); + result = CharacterDatabase.Query(stmt); + if (result) - auc_count = (*result)[0].GetUInt32(); + auc_count = (*result)[0].GetUInt64(); if (count > 0) { - result = CharacterDatabase.PQuery( - // 0 1 2 3 - "SELECT ah.itemguid, ah.itemowner, c.account, c.name FROM auctionhouse ah " - "INNER JOIN characters c ON c.guid = ah.itemowner " - "INNER JOIN item_instance ii ON ii.guid = ah.itemguid " - "WHERE ii.itemEntry = '%u' LIMIT %u", item_id, count); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_AUCTIONHOUSE_ITEM_BY_ENTRY); + stmt->setUInt32(0, item_id); + stmt->setUInt32(1, count); + result = CharacterDatabase.Query(stmt); } else - result = QueryResult(NULL); + result = PreparedQueryResult(NULL); if (result) { @@ -550,17 +554,18 @@ bool ChatHandler::HandleListItemCommand(const char *args) // guild bank case uint32 guild_count = 0; - result = CharacterDatabase.PQuery("SELECT COUNT(itemEntry) FROM guild_bank_item gbi INNER JOIN item_instance ii ON ii.guid = gbi.item_guid WHERE itemEntry = '%u'", item_id); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_BANK_COUNT_ITEM); + stmt->setUInt32(0, item_id); + result = CharacterDatabase.Query(stmt); + if (result) - guild_count = (*result)[0].GetUInt32(); + guild_count = (*result)[0].GetUInt64(); - result = CharacterDatabase.PQuery( - // 0 1 2 - "SELECT gi.item_guid, gi.guildid, g.name FROM guild_bank_item gi " - "INNER JOIN guild g ON g.guildid = gi.guildid " - "INNER JOIN item_instance ii ON ii.guid = gi.item_guid " - "WHERE ii.itemEntry = '%u' LIMIT %u ", - item_id, count); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_BANK_ITEM_BY_ENTRY); + stmt->setUInt32(0, item_id); + stmt->setUInt32(1, count); + result = CharacterDatabase.Query(stmt); if (result) { @@ -631,9 +636,9 @@ bool ChatHandler::HandleListObjectCommand(const char *args) QueryResult result; uint32 obj_count = 0; - result=WorldDatabase.PQuery("SELECT COUNT(guid) FROM gameobject WHERE id='%u'", go_id); + result = WorldDatabase.PQuery("SELECT COUNT(guid) FROM gameobject WHERE id='%u'", go_id); if (result) - obj_count = (*result)[0].GetUInt32(); + obj_count = (*result)[0].GetUInt64(); if (m_session) { @@ -703,9 +708,9 @@ bool ChatHandler::HandleListCreatureCommand(const char *args) QueryResult result; uint32 cr_count = 0; - result=WorldDatabase.PQuery("SELECT COUNT(guid) FROM creature WHERE id='%u'", cr_id); + result = WorldDatabase.PQuery("SELECT COUNT(guid) FROM creature WHERE id='%u'", cr_id); if (result) - cr_count = (*result)[0].GetUInt32(); + cr_count = (*result)[0].GetUInt64(); if (m_session) { @@ -1234,7 +1239,7 @@ bool ChatHandler::HandleLookupCreatureCommand(const char *args) uint8 localeIndex = GetSessionDbLocaleIndex(); if (CreatureLocale const* cl = sObjectMgr->GetCreatureLocale(id)) { - if (cl->Name.size() > localeIndex && !cl->Name[localeIndex].empty ()) + if (cl->Name.size() > localeIndex && !cl->Name[localeIndex].empty()) { std::string name = cl->Name[localeIndex]; @@ -1247,9 +1252,9 @@ bool ChatHandler::HandleLookupCreatureCommand(const char *args) } if (m_session) - PSendSysMessage (LANG_CREATURE_ENTRY_LIST_CHAT, id, id, name.c_str ()); + PSendSysMessage(LANG_CREATURE_ENTRY_LIST_CHAT, id, id, name.c_str()); else - PSendSysMessage (LANG_CREATURE_ENTRY_LIST_CONSOLE, id, name.c_str ()); + PSendSysMessage(LANG_CREATURE_ENTRY_LIST_CONSOLE, id, name.c_str()); if (!found) found = true; @@ -1260,7 +1265,7 @@ bool ChatHandler::HandleLookupCreatureCommand(const char *args) } std::string name = itr->second.Name; - if (name.empty ()) + if (name.empty()) continue; if (Utf8FitTo(name, wnamepart)) @@ -1272,9 +1277,9 @@ bool ChatHandler::HandleLookupCreatureCommand(const char *args) } if (m_session) - PSendSysMessage (LANG_CREATURE_ENTRY_LIST_CHAT, id, id, name.c_str ()); + PSendSysMessage(LANG_CREATURE_ENTRY_LIST_CHAT, id, id, name.c_str()); else - PSendSysMessage (LANG_CREATURE_ENTRY_LIST_CONSOLE, id, name.c_str ()); + PSendSysMessage(LANG_CREATURE_ENTRY_LIST_CONSOLE, id, name.c_str()); if (!found) found = true; @@ -1282,7 +1287,7 @@ bool ChatHandler::HandleLookupCreatureCommand(const char *args) } if (!found) - SendSysMessage (LANG_COMMAND_NOCREATUREFOUND); + SendSysMessage(LANG_COMMAND_NOCREATUREFOUND); return true; } @@ -1370,7 +1375,7 @@ bool ChatHandler::HandleLookupFactionCommand(const char *args) return false; // Can be NULL at console call - Player* target = getSelectedPlayer (); + Player* target = getSelectedPlayer(); std::string namepart = args; std::wstring wnamepart; @@ -1522,10 +1527,10 @@ bool ChatHandler::HandleLookupTaxiNodeCommand(const char * args) // send taxinode in "id - [name] (Map:m X:x Y:y Z:z)" format if (m_session) - PSendSysMessage (LANG_TAXINODE_ENTRY_LIST_CHAT, id, id, name.c_str(), localeNames[loc], + PSendSysMessage(LANG_TAXINODE_ENTRY_LIST_CHAT, id, id, name.c_str(), localeNames[loc], nodeEntry->map_id, nodeEntry->x, nodeEntry->y, nodeEntry->z); else - PSendSysMessage (LANG_TAXINODE_ENTRY_LIST_CONSOLE, id, name.c_str(), localeNames[loc], + PSendSysMessage(LANG_TAXINODE_ENTRY_LIST_CONSOLE, id, name.c_str(), localeNames[loc], nodeEntry->map_id, nodeEntry->x, nodeEntry->y, nodeEntry->z); if (!found) @@ -1674,16 +1679,16 @@ bool ChatHandler::HandleGuildCreateCommand(const char *args) if (target->GetGuildId()) { - SendSysMessage (LANG_PLAYER_IN_GUILD); + SendSysMessage(LANG_PLAYER_IN_GUILD); return true; } Guild* guild = new Guild; - if (!guild->Create (target, guildname)) + if (!guild->Create(target, guildname)) { delete guild; - SendSysMessage (LANG_GUILD_NOT_CREATED); - SetSentErrorMessage (true); + SendSysMessage(LANG_GUILD_NOT_CREATED); + SetSentErrorMessage(true); return false; } @@ -1710,7 +1715,7 @@ bool ChatHandler::HandleGuildInviteCommand(const char *args) return false; std::string glName = guildStr; - Guild* targetGuild = sGuildMgr->GetGuildByName (glName); + Guild* targetGuild = sGuildMgr->GetGuildByName(glName); if (!targetGuild) return false; @@ -1726,11 +1731,10 @@ bool ChatHandler::HandleGuildUninviteCommand(const char *args) return false; uint32 glId = target ? target->GetGuildId() : Player::GetGuildIdFromGuid(target_guid); - if (!glId) return false; - Guild* targetGuild = sGuildMgr->GetGuildById (glId); + Guild* targetGuild = sGuildMgr->GetGuildById(glId); if (!targetGuild) return false; @@ -1775,11 +1779,11 @@ bool ChatHandler::HandleGuildDeleteCommand(const char *args) std::string gld = guildStr; - Guild* targetGuild = sGuildMgr->GetGuildByName (gld); + Guild* targetGuild = sGuildMgr->GetGuildByName(gld); if (!targetGuild) return false; - targetGuild->Disband (); + targetGuild->Disband(); return true; } @@ -1885,7 +1889,7 @@ bool ChatHandler::HandleDamageCommand(const char * args) { m_session->GetPlayer()->DealDamage(target, damage, NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); if (target != m_session->GetPlayer()) - m_session->GetPlayer()->SendAttackStateUpdate (HITINFO_NORMALSWING2, target, 1, SPELL_SCHOOL_MASK_NORMAL, damage, 0, 0, VICTIMSTATE_HIT, 0); + m_session->GetPlayer()->SendAttackStateUpdate (HITINFO_AFFECTS_VICTIM, target, 1, SPELL_SCHOOL_MASK_NORMAL, damage, 0, 0, VICTIMSTATE_HIT, 0); return true; } @@ -1915,7 +1919,7 @@ bool ChatHandler::HandleDamageCommand(const char * args) m_session->GetPlayer()->DealDamageMods(target, damage, &absorb); m_session->GetPlayer()->DealDamage(target, damage, NULL, DIRECT_DAMAGE, schoolmask, NULL, false); - m_session->GetPlayer()->SendAttackStateUpdate (HITINFO_NORMALSWING2, target, 1, schoolmask, damage, absorb, resist, VICTIMSTATE_HIT, 0); + m_session->GetPlayer()->SendAttackStateUpdate (HITINFO_AFFECTS_VICTIM, target, 1, schoolmask, damage, absorb, resist, VICTIMSTATE_HIT, 0); return true; } @@ -2020,7 +2024,7 @@ bool ChatHandler::HandleLinkGraveCommand(const char *args) else return false; - WorldSafeLocsEntry const* graveyard = sWorldSafeLocsStore.LookupEntry(g_id); + WorldSafeLocsEntry const* graveyard = sWorldSafeLocsStore.LookupEntry(g_id); if (!graveyard) { @@ -2143,40 +2147,17 @@ bool ChatHandler::HandleExploreCheatCommand(const char *args) ChatHandler(chr).PSendSysMessage(LANG_YOURS_EXPLORE_SET_NOTHING, GetNameLink().c_str()); } - for (uint8 i=0; iGetPlayer()->SetFlag(PLAYER_EXPLORED_ZONES_1+i, 0xFFFFFFFF); - } else - { m_session->GetPlayer()->SetFlag(PLAYER_EXPLORED_ZONES_1+i, 0); - } } return true; } -bool ChatHandler::HandleHoverCommand(const char *args) -{ - char* px = strtok((char*)args, " "); - uint32 flag; - if (!px) - flag = 1; - else - flag = atoi(px); - - m_session->GetPlayer()->SetHover(flag); - - if (flag) - SendSysMessage(LANG_HOVER_ENABLED); - else - SendSysMessage(LANG_HOVER_DISABLED); - - return true; -} - void ChatHandler::HandleCharacterLevel(Player* player, uint64 playerGuid, uint32 oldLevel, uint32 newLevel) { if (player) @@ -2434,7 +2415,9 @@ bool ChatHandler::HandleListAurasCommand (const char * /*args*/) for (uint16 i = 0; i < TOTAL_AURAS; ++i) { Unit::AuraEffectList const& uAuraList = unit->GetAuraEffectsByType(AuraType(i)); - if (uAuraList.empty()) continue; + if (uAuraList.empty()) + continue; + PSendSysMessage(LANG_COMMAND_TARGET_LISTAURATYPE, uAuraList.size(), i); for (Unit::AuraEffectList::const_iterator itr = uAuraList.begin(); itr != uAuraList.end(); ++itr) { @@ -2737,7 +2720,7 @@ bool ChatHandler::HandleServerShutDownCommand(const char *args) if (exitcode < 0 || exitcode > 125) return false; - sWorld->ShutdownServ (time, 0, exitcode); + sWorld->ShutdownServ(time, 0, exitcode); } else sWorld->ShutdownServ(time, 0, SHUTDOWN_EXIT_CODE); @@ -2772,7 +2755,7 @@ bool ChatHandler::HandleServerRestartCommand(const char *args) if (exitcode < 0 || exitcode > 125) return false; - sWorld->ShutdownServ (time, SHUTDOWN_MASK_RESTART, exitcode); + sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART, exitcode); } else sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART, RESTART_EXIT_CODE); @@ -2807,7 +2790,7 @@ bool ChatHandler::HandleServerIdleRestartCommand(const char *args) if (exitcode < 0 || exitcode > 125) return false; - sWorld->ShutdownServ (time, SHUTDOWN_MASK_RESTART|SHUTDOWN_MASK_IDLE, exitcode); + sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART|SHUTDOWN_MASK_IDLE, exitcode); } else sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART|SHUTDOWN_MASK_IDLE, RESTART_EXIT_CODE); @@ -2842,7 +2825,7 @@ bool ChatHandler::HandleServerIdleShutDownCommand(const char *args) if (exitcode < 0 || exitcode > 125) return false; - sWorld->ShutdownServ (time, SHUTDOWN_MASK_IDLE, exitcode); + sWorld->ShutdownServ(time, SHUTDOWN_MASK_IDLE, exitcode); } else sWorld->ShutdownServ(time, SHUTDOWN_MASK_IDLE, SHUTDOWN_EXIT_CODE); @@ -3221,7 +3204,7 @@ bool ChatHandler::HandleBanListCharacterCommand(const char *args) std::string filter(cFilter); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUID_BY_NAME_FILTER); - stmt->setString(0, filter.c_str()); + stmt->setString(0, filter); PreparedQueryResult result = CharacterDatabase.Query(stmt); if (!result) { @@ -3298,25 +3281,27 @@ bool ChatHandler::HandleBanListCharacterCommand(const char *args) bool ChatHandler::HandleBanListAccountCommand(const char *args) { - PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_OLD_BANS); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_EXPIRED_IP_BANS); LoginDatabase.Execute(stmt); char* cFilter = strtok((char*)args, " "); std::string filter = cFilter ? cFilter : ""; - LoginDatabase.EscapeString(filter); - QueryResult result; + PreparedQueryResult result; if (filter.empty()) { - result = LoginDatabase.Query("SELECT account.id, username FROM account, account_banned" - " WHERE account.id = account_banned.id AND active = 1 GROUP BY account.id"); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_BANNED_ALL); + + result = LoginDatabase.Query(stmt); } else { - result = LoginDatabase.PQuery("SELECT account.id, username FROM account, account_banned" - " WHERE account.id = account_banned.id AND active = 1 AND username "_LIKE_" "_CONCAT3_("'%%'", "'%s'", "'%%'")" GROUP BY account.id", - filter.c_str()); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_BANNED_BY_USERNAME); + + stmt->setString(0, filter); + + result = LoginDatabase.Query(stmt); } if (!result) @@ -3328,7 +3313,7 @@ bool ChatHandler::HandleBanListAccountCommand(const char *args) return HandleBanListHelper(result); } -bool ChatHandler::HandleBanListHelper(QueryResult result) +bool ChatHandler::HandleBanListHelper(PreparedQueryResult result) { PSendSysMessage(LANG_BANLIST_MATCHINGACCOUNT); @@ -3358,7 +3343,7 @@ bool ChatHandler::HandleBanListHelper(QueryResult result) { SendSysMessage("-------------------------------------------------------------------------------"); Field* fields = result->Fetch(); - uint32 account_id = fields[0].GetUInt32 (); + uint32 account_id = fields[0].GetUInt32(); std::string account_name; @@ -3404,26 +3389,28 @@ bool ChatHandler::HandleBanListHelper(QueryResult result) bool ChatHandler::HandleBanListIPCommand(const char *args) { - PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_OLD_IP_BANS); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_EXPIRED_IP_BANS); LoginDatabase.Execute(stmt); char* cFilter = strtok((char*)args, " "); std::string filter = cFilter ? cFilter : ""; LoginDatabase.EscapeString(filter); - QueryResult result; + PreparedQueryResult result; if (filter.empty()) { - result = LoginDatabase.Query ("SELECT ip, bandate, unbandate, bannedby, banreason FROM ip_banned" - " WHERE (bandate=unbandate OR unbandate>UNIX_TIMESTAMP())" - " ORDER BY unbandate"); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_IP_BANNED_ALL); + + result = LoginDatabase.Query(stmt); } else { - result = LoginDatabase.PQuery("SELECT ip, bandate, unbandate, bannedby, banreason FROM ip_banned" - " WHERE (bandate=unbandate OR unbandate>UNIX_TIMESTAMP()) AND ip "_LIKE_" "_CONCAT3_("'%%'", "'%s'", "'%%'") - " ORDER BY unbandate", filter.c_str()); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_IP_BANNED_BY_IP); + + stmt->setString(0, filter); + + result = LoginDatabase.Query(stmt); } if (!result) @@ -4455,7 +4442,7 @@ bool ChatHandler::HandleChannelSetOwnership(const char *args) if (!*args) return false; char *channel = strtok((char*)args, " "); - char *argstr = strtok(NULL, ""); + char *argstr = strtok(NULL, ""); if (!channel || !argstr) return false; @@ -4492,10 +4479,6 @@ bool ChatHandler::HandleChannelSetOwnership(const char *args) return true; } -/*------------------------------------------ - *-------------TRINITY---------------------- - *-------------------------------------*/ - bool ChatHandler::HandlePlayAllCommand(const char *args) { if (!*args) @@ -4589,53 +4572,58 @@ bool ChatHandler::HandleUnFreezeCommand(const char *args) { std::string name; Player* player; - char *TargetName = strtok((char*)args, " "); //get entered name - if (!TargetName) //if no name entered use target - { - player = getSelectedPlayer(); - if (player) //prevent crash with creature as target - name = player->GetName(); - } + char* targetName = strtok((char*)args, " "); // Get entered name - else // if name entered + if (targetName) { - name = TargetName; + name = targetName; normalizePlayerName(name); player = sObjectAccessor->FindPlayerByName(name.c_str()); } + else // If no name was entered - use target + { + player = getSelectedPlayer(); + if (player) + name = player->GetName(); + } - //effect if (player) { PSendSysMessage(LANG_COMMAND_UNFREEZE, name.c_str()); - //Reset player faction + allow combat + allow duels + // Reset player faction + allow combat + allow duels player->setFactionForRace(player->getRace()); player->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - //allow movement and spells + // Remove Freeze spell (allowing movement and spells) player->RemoveAurasDueToSpell(9454); - //save player + // Save player player->SaveToDB(); } - - if (!player) + else { - if (TargetName) + if (targetName) { - //check for offline players - QueryResult result = CharacterDatabase.PQuery("SELECT characters.guid FROM characters WHERE characters.name = '%s'", name.c_str()); + // Check for offline players + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_GUID_BY_NAME); + stmt->setString(0, name); + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (!result) { SendSysMessage(LANG_COMMAND_FREEZE_WRONG); return true; } - //if player found: delete his freeze aura - Field* fields=result->Fetch(); - uint64 pguid = fields[0].GetUInt64(); - CharacterDatabase.PQuery("DELETE FROM character_aura WHERE character_aura.spell = 9454 AND character_aura.guid = '%u'", pguid); + // If player found: delete his freeze aura + Field* fields = result->Fetch(); + uint32 lowGuid = fields[0].GetUInt32(); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_AURA_FROZEN); + stmt->setUInt32(0, lowGuid); + CharacterDatabase.Execute(stmt); + PSendSysMessage(LANG_COMMAND_UNFREEZE, name.c_str()); return true; } @@ -4651,8 +4639,11 @@ bool ChatHandler::HandleUnFreezeCommand(const char *args) bool ChatHandler::HandleListFreezeCommand(const char * /*args*/) { - //Get names from DB - QueryResult result = CharacterDatabase.Query("SELECT characters.name FROM characters LEFT JOIN character_aura ON (characters.guid = character_aura.guid) WHERE character_aura.spell = 9454"); + // Get names from DB + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_AURA_FROZEN); + + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (!result) { SendSysMessage(LANG_COMMAND_NO_FROZEN_PLAYERS); @@ -4750,9 +4741,11 @@ bool ChatHandler::HandleBindSightCommand(const char * /*args*/) bool ChatHandler::HandleUnbindSightCommand(const char * /*args*/) { - if (m_session->GetPlayer()->isPossessing()) + Player* player = m_session->GetPlayer(); + + if (player->isPossessing()) return false; - m_session->GetPlayer()->StopCastingBindSight(); + player->StopCastingBindSight(); return true; } diff --git a/src/server/game/Combat/ThreatManager.cpp b/src/server/game/Combat/ThreatManager.cpp index d82e43ba83b..9737d4584ea 100755 --- a/src/server/game/Combat/ThreatManager.cpp +++ b/src/server/game/Combat/ThreatManager.cpp @@ -75,7 +75,7 @@ bool ThreatCalcHelper::isValidProcess(Unit* hatedUnit, Unit* hatingUnit, SpellIn return false; // not in same map or phase - if (!hatedUnit->IsInMap(hatingUnit)) + if (!hatedUnit->IsInMap(hatingUnit) || !hatedUnit->InSamePhase(hatingUnit)) return false; // spell not causing threat @@ -182,6 +182,7 @@ void HostileReference::updateOnlineStatus() && (getTarget()->GetTypeId() != TYPEID_PLAYER || !getTarget()->ToPlayer()->isGameMaster()) && !getTarget()->HasUnitState(UNIT_STATE_IN_FLIGHT) && getTarget()->IsInMap(getSourceUnit()) + && getTarget()->InSamePhase(getSourceUnit()) ) { Creature* creature = getSourceUnit()->ToCreature(); @@ -534,6 +535,7 @@ void ThreatManager::processThreatEvent(ThreatRefStatusChangeEvent* threatRefStat setCurrentVictim(NULL); setDirty(true); } + iOwner->SendRemoveFromThreatListOpcode(hostilRef); iThreatContainer.remove(hostilRef); iThreatOfflineContainer.addReference(hostilRef); } diff --git a/src/server/game/Combat/ThreatManager.h b/src/server/game/Combat/ThreatManager.h index ce1f6de2ab0..e5badcd24ce 100755 --- a/src/server/game/Combat/ThreatManager.h +++ b/src/server/game/Combat/ThreatManager.h @@ -242,7 +242,7 @@ class ThreatManager // methods to access the lists from the outside to do some dirty manipulation (scriping and such) // I hope they are used as little as possible. std::list& getThreatList() { return iThreatContainer.getThreatList(); } - std::list& getOfflieThreatList() { return iThreatOfflineContainer.getThreatList(); } + std::list& getOfflineThreatList() { return iThreatOfflineContainer.getThreatList(); } ThreatContainer& getOnlineContainer() { return iThreatContainer; } ThreatContainer& getOfflineContainer() { return iThreatOfflineContainer; } private: diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 7d21f94f372..4176d9f605b 100755 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -114,7 +114,7 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) case CONDITION_QUESTREWARDED: { if (Player* player = object->ToPlayer()) - condMeets = (player->GetQuestRewardStatus(ConditionValue1) == !ConditionValue2); + condMeets = player->GetQuestRewardStatus(ConditionValue1); break; } case CONDITION_QUESTTAKEN: @@ -122,7 +122,7 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) if (Player* player = object->ToPlayer()) { QuestStatus status = player->GetQuestStatus(ConditionValue1); - condMeets = ((status == QUEST_STATUS_INCOMPLETE) == !ConditionValue2); + condMeets = (status == QUEST_STATUS_INCOMPLETE); } break; } @@ -131,7 +131,7 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) if (Player* player = object->ToPlayer()) { QuestStatus status = player->GetQuestStatus(ConditionValue1); - condMeets = ((status == QUEST_STATUS_COMPLETE && !player->GetQuestRewardStatus(ConditionValue1)) == !ConditionValue2); + condMeets = (status == QUEST_STATUS_COMPLETE && !player->GetQuestRewardStatus(ConditionValue1)); } break; } @@ -140,7 +140,7 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) if (Player* player = object->ToPlayer()) { QuestStatus status = player->GetQuestStatus(ConditionValue1); - condMeets = ((status == QUEST_STATUS_NONE) == !ConditionValue2); + condMeets = (status == QUEST_STATUS_NONE); } break; } @@ -190,7 +190,7 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) } case CONDITION_OBJECT_ENTRY: { - if (object->GetTypeId() == ConditionValue1) + if (uint32(object->GetTypeId()) == ConditionValue1) condMeets = (!ConditionValue2) || (object->GetEntry() == ConditionValue2); break; } @@ -274,6 +274,12 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) condMeets = object->GetPhaseMask() & ConditionValue1; break; } + case CONDITION_TITLE: + { + if (Player* player = object->ToPlayer()) + condMeets = player->HasTitle(ConditionValue1); + break; + } default: condMeets = false; break; @@ -422,6 +428,9 @@ uint32 Condition::GetSearcherTypeMaskForCondition() case CONDITION_PHASEMASK: mask |= GRID_MAP_TYPE_MASK_ALL; break; + case CONDITION_TITLE: + mask |= GRID_MAP_TYPE_MASK_PLAYER; + break; default: ASSERT(false && "Condition::GetSearcherTypeMaskForCondition - missing condition handling!"); break; @@ -515,7 +524,9 @@ bool ConditionMgr::IsObjectMeetToConditionList(ConditionSourceInfo& sourceInfo, sLog->outDebug(LOG_FILTER_CONDITIONSYS, "ConditionMgr::IsPlayerMeetToConditionList condType: %u val1: %u", (*i)->ConditionType, (*i)->ConditionValue1); if ((*i)->isLoaded()) { + //! Find ElseGroup in ElseGroupStore std::map::const_iterator itr = ElseGroupStore.find((*i)->ElseGroup); + //! If not found, add an entry in the store and set to true (placeholder) if (itr == ElseGroupStore.end()) ElseGroupStore[(*i)->ElseGroup] = true; else if (!(*itr).second) @@ -717,8 +728,8 @@ void ConditionMgr::LoadConditions(bool isReload) Condition* cond = new Condition(); int32 iSourceTypeOrReferenceId = fields[0].GetInt32(); cond->SourceGroup = fields[1].GetUInt32(); - cond->SourceEntry = fields[2].GetInt32(); - cond->SourceId = fields[3].GetUInt32(); + cond->SourceEntry = fields[2].GetUInt32(); + cond->SourceId = fields[3].GetInt32(); cond->ElseGroup = fields[4].GetUInt32(); int32 iConditionTypeOrReference = fields[5].GetInt32(); cond->ConditionTarget = fields[6].GetUInt8(); @@ -854,18 +865,6 @@ void ConditionMgr::LoadConditions(bool isReload) break; case CONDITION_SOURCE_TYPE_SPELL_CLICK_EVENT: { - //if no list for npc create one - if (SpellClickEventConditionStore.find(cond->SourceGroup) == SpellClickEventConditionStore.end()) - { - ConditionTypeContainer cmap; - SpellClickEventConditionStore[cond->SourceGroup] = cmap; - } - //if no list for spellclick spell create one - if (SpellClickEventConditionStore[cond->SourceGroup].find(cond->SourceEntry) == SpellClickEventConditionStore[cond->SourceGroup].end()) - { - ConditionList clist; - SpellClickEventConditionStore[cond->SourceGroup][cond->SourceEntry] = clist; - } SpellClickEventConditionStore[cond->SourceGroup][cond->SourceEntry].push_back(cond); valid = true; ++count; @@ -877,18 +876,6 @@ void ConditionMgr::LoadConditions(bool isReload) break; case CONDITION_SOURCE_TYPE_VEHICLE_SPELL: { - //if no list for vehicle create one - if (VehicleSpellConditionStore.find(cond->SourceGroup) == VehicleSpellConditionStore.end()) - { - ConditionTypeContainer cmap; - VehicleSpellConditionStore[cond->SourceGroup] = cmap; - } - //if no list for vehicle's spell create one - if (VehicleSpellConditionStore[cond->SourceGroup].find(cond->SourceEntry) == VehicleSpellConditionStore[cond->SourceGroup].end()) - { - ConditionList clist; - VehicleSpellConditionStore[cond->SourceGroup][cond->SourceEntry] = clist; - } VehicleSpellConditionStore[cond->SourceGroup][cond->SourceEntry].push_back(cond); valid = true; ++count; @@ -896,18 +883,8 @@ void ConditionMgr::LoadConditions(bool isReload) } case CONDITION_SOURCE_TYPE_SMART_EVENT: { - // If the entry does not exist, create a new list + //! TODO: PAIR_32 ? std::pair key = std::make_pair(cond->SourceEntry, cond->SourceId); - if (SmartEventConditionStore.find(key) == SmartEventConditionStore.end()) - { - ConditionTypeContainer cmap; - SmartEventConditionStore[key] = cmap; - } - if (SmartEventConditionStore[key].find(cond->SourceGroup) == SmartEventConditionStore[key].end()) - { - ConditionList clist; - SmartEventConditionStore[key][cond->SourceGroup] = clist; - } SmartEventConditionStore[key][cond->SourceGroup].push_back(cond); valid = true; ++count; @@ -1326,7 +1303,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) default: break; } - + switch (spellInfo->Effects[i].TargetB.GetSelectionCategory()) { case TARGET_SELECT_CATEGORY_NEARBY: @@ -1577,7 +1554,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) } case CONDITION_ACHIEVEMENT: { - AchievementEntry const* achievement = GetAchievementStore()->LookupEntry(cond->ConditionValue1); + AchievementEntry const* achievement = sAchievementStore.LookupEntry(cond->ConditionValue1); if (!achievement) { sLog->outErrorDb("Achivement condition has non existing achivement id (%u), skipped", cond->ConditionValue1); @@ -1858,9 +1835,16 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) sLog->outErrorDb("Phasemask condition has useless data in value3 (%u)!", cond->ConditionValue3); break; } - case CONDITION_UNUSED_18: - sLog->outErrorDb("Found ConditionTypeOrReference = CONDITION_UNUSED_18 in `conditions` table - ignoring"); - return false; + case CONDITION_TITLE: + { + CharTitlesEntry const* titleEntry = sCharTitlesStore.LookupEntry(cond->ConditionValue1); + if (!titleEntry) + { + sLog->outErrorDb("Title condition has non existing title in value1 (%u), skipped", cond->ConditionValue1); + return false; + } + break; + } case CONDITION_UNUSED_19: sLog->outErrorDb("Found ConditionTypeOrReference = CONDITION_UNUSED_19 in `conditions` table - ignoring"); return false; @@ -1929,6 +1913,19 @@ void ConditionMgr::Clean() SmartEventConditionStore.clear(); + for (CreatureSpellConditionContainer::iterator itr = SpellClickEventConditionStore.begin(); itr != SpellClickEventConditionStore.end(); ++itr) + { + for (ConditionTypeContainer::iterator it = itr->second.begin(); it != itr->second.end(); ++it) + { + for (ConditionList::const_iterator i = it->second.begin(); i != it->second.end(); ++i) + delete *i; + it->second.clear(); + } + itr->second.clear(); + } + + SpellClickEventConditionStore.clear(); + // this is a BIG hack, feel free to fix it if you can figure out the ConditionMgr ;) for (std::list::const_iterator itr = AllocatedMemoryStore.begin(); itr != AllocatedMemoryStore.end(); ++itr) delete *itr; diff --git a/src/server/game/Conditions/ConditionMgr.h b/src/server/game/Conditions/ConditionMgr.h index 5a5e2dd1c2e..130a23a0cb0 100755 --- a/src/server/game/Conditions/ConditionMgr.h +++ b/src/server/game/Conditions/ConditionMgr.h @@ -48,7 +48,7 @@ enum ConditionTypes CONDITION_CLASS = 15, // class 0 0 true if player's class is equal to class CONDITION_RACE = 16, // race 0 0 true if player's race is equal to race CONDITION_ACHIEVEMENT = 17, // achievement_id 0 0 true if achievement is complete - CONDITION_UNUSED_18 = 18, // + CONDITION_TITLE = 18, // title id 0 0 true if player has title CONDITION_UNUSED_19 = 19, // CONDITION_UNUSED_20 = 20, // CONDITION_UNUSED_21 = 21, // @@ -72,6 +72,33 @@ enum ConditionTypes CONDITION_MAX = 39 // MAX }; +/*! Documentation on implementing a new ConditionSourceType: + Step 1: Check for the lowest free ID. Look for CONDITION_SOURCE_TYPE_UNUSED_XX in the enum. + Then define the new source type. + + Step 2: Determine and map the parameters for the new condition type. + + Step 3: Add a case block to ConditionMgr::isSourceTypeValid with the new condition type + and validate the parameters. + + Step 4: If your condition can be grouped (determined in step 2), add a rule for it in + ConditionMgr::CanHaveSourceGroupSet, following the example of the existing types. + + Step 5: Define the maximum available condition targets in ConditionMgr::GetMaxAvailableConditionTargets. + + The following steps only apply if your condition can be grouped: + + Step 6: Determine how you are going to store your conditions. You need to add a new storage container + for it in ConditionMgr class, along with a function like: + ConditionList GetConditionsForXXXYourNewSourceTypeXXX(parameters...) + + The above function should be placed in upper level (practical) code that actually + checks the conditions. + + Step 7: Implement loading for your source type in ConditionMgr::LoadConditions. + + Step 8: Implement memory cleaning for your source type in ConditionMgr::Clean. +*/ enum ConditionSourceType { CONDITION_SOURCE_TYPE_NONE = 0, diff --git a/src/server/game/DataStores/DBCEnums.h b/src/server/game/DataStores/DBCEnums.h index 8055641f3a4..dcd189a05cb 100755 --- a/src/server/game/DataStores/DBCEnums.h +++ b/src/server/game/DataStores/DBCEnums.h @@ -343,7 +343,7 @@ enum AreaFlags AREA_FLAG_CITY = 0x00000200, // only for one zone named "City" (where it located?) AREA_FLAG_OUTLAND = 0x00000400, // expansion zones? (only Eye of the Storm not have this flag, but have 0x00004000 flag) AREA_FLAG_SANCTUARY = 0x00000800, // sanctuary area (PvP disabled) - AREA_FLAG_NEED_FLY = 0x00001000, // Unknown + AREA_FLAG_NEED_FLY = 0x00001000, // Respawn alive at the graveyard without corpse AREA_FLAG_UNUSED1 = 0x00002000, // Unused in 3.3.5a AREA_FLAG_OUTLAND2 = 0x00004000, // expansion zones? (only Circle of Blood Arena not have this flag, but have 0x00000400 flag) AREA_FLAG_OUTDOOR_PVP = 0x00008000, // pvp objective area? (Death's Door also has this flag although it's no pvp object area) @@ -358,7 +358,7 @@ enum AreaFlags AREA_FLAG_WINTERGRASP = 0x01000000, // Wintergrasp and it's subzones AREA_FLAG_INSIDE = 0x02000000, // used for determinating spell related inside/outside questions in Map::IsOutdoors AREA_FLAG_OUTSIDE = 0x04000000, // used for determinating spell related inside/outside questions in Map::IsOutdoors - AREA_FLAG_WINTERGRASP_2 = 0x08000000, // Same as AREA_FLAG_WINTERGRASP except for The Sunken Ring and Western Bridge. + AREA_FLAG_WINTERGRASP_2 = 0x08000000, // Can Hearth And Resurrect From Area AREA_FLAG_NO_FLY_ZONE = 0x20000000, // Marks zones where you cannot fly AREA_FLAG_UNK9 = 0x40000000, }; diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 6dbd1d847db..e8087753efd 100755 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -129,7 +129,7 @@ DBCStorage sItemRandomSuffixStore(ItemRandomSuffixfmt); DBCStorage sItemSetStore(ItemSetEntryfmt); DBCStorage sLFGDungeonStore(LFGDungeonEntryfmt); -//DBCStorage sLiquidTypeStore(LiquidTypeEntryfmt); +DBCStorage sLiquidTypeStore(LiquidTypefmt); DBCStorage sLockStore(LockEntryfmt); DBCStorage sMailTemplateStore(MailTemplateEntryfmt); @@ -411,6 +411,7 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sItemDisenchantLootStore, dbcPath, "ItemDisenchantLoot.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sLFGDungeonStore, dbcPath, "LFGDungeons.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sLiquidTypeStore, dbcPath, "LiquidType.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sLockStore, dbcPath, "Lock.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sPhaseStores, dbcPath, "Phase.dbc");//14545 @@ -567,7 +568,9 @@ void LoadDBCStores(const std::string& dataPath) for (unsigned int i = 0; i < sTalentStore.GetNumRows(); ++i) { TalentEntry const* talentInfo = sTalentStore.LookupEntry(i); - if (!talentInfo) continue; + if (!talentInfo) + continue; + for (int j = 0; j < MAX_TALENT_RANK; j++) if (talentInfo->RankID[j]) sTalentSpellPosMap[talentInfo->RankID[j]] = TalentSpellPos(i, j); @@ -632,7 +635,7 @@ void LoadDBCStores(const std::string& dataPath) // include existed nodes that have at least single not spell base (scripted) path { std::set spellPaths; - for (uint32 i = 1; i < sSpellStore.GetNumRows (); ++i) + for (uint32 i = 1; i < sSpellStore.GetNumRows(); ++i) if (SpellEffectEntry const* sInfo = sSpellEffectStore.LookupEntry (i)) if (sInfo->Effect == SPELL_EFFECT_SEND_TAXI) spellPaths.insert(sInfo->EffectMiscValue); @@ -1156,10 +1159,10 @@ uint32 ScalingStatValuesEntry::GetDPSAndDamageMultiplier(uint32 subClass, bool i } // script support functions - DBCStorage const* GetSoundEntriesStore() { return &sSoundEntriesStore; } - DBCStorage const* GetSpellRangeStore() { return &sSpellRangeStore; } - DBCStorage const* GetFactionStore() { return &sFactionStore; } - DBCStorage const* GetCreatureDisplayStore() { return &sCreatureDisplayInfoStore; } - DBCStorage const* GetEmotesStore() { return &sEmotesStore; } - DBCStorage const* GetEmotesTextStore() { return &sEmotesTextStore; } - DBCStorage const* GetAchievementStore() { return &sAchievementStore; } +DBCStorage const* GetSoundEntriesStore() { return &sSoundEntriesStore; } +DBCStorage const* GetSpellRangeStore() { return &sSpellRangeStore; } +DBCStorage const* GetFactionStore() { return &sFactionStore; } +DBCStorage const* GetCreatureDisplayStore() { return &sCreatureDisplayInfoStore; } +DBCStorage const* GetEmotesStore() { return &sEmotesStore; } +DBCStorage const* GetEmotesTextStore() { return &sEmotesTextStore; } +DBCStorage const* GetAchievementStore() { return &sAchievementStore; } diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h index f77f6195aea..d04dc4ff131 100755 --- a/src/server/game/DataStores/DBCStores.h +++ b/src/server/game/DataStores/DBCStores.h @@ -138,6 +138,7 @@ extern DBCStorage sItemRandomPropertiesStore; extern DBCStorage sItemRandomSuffixStore; extern DBCStorage sItemSetStore; extern DBCStorage sLFGDungeonStore; +extern DBCStorage sLiquidTypeStore; extern DBCStorage sLockStore; extern DBCStorage sMailTemplateStore; extern DBCStorage sMapStore; diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index cc25a8f5495..f0b462e827c 100755 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -543,9 +543,7 @@ struct AreaTableEntry //uint32 unk8; // 8, //uint32 unk9; // 9, int32 area_level; // 10 - char* area_name; // 11 uint32 team; // 12 - //uint32 unk13; // 13, //uint32 unk14; // 14, All zeros (4.2.2) //uint32 unk15; // 15, //uint32 unk16; // 16, Only Naxxramas has value (21) @@ -1288,27 +1286,29 @@ struct LFGDungeonEntry uint32 Entry() const { return ID + (type << 24); } }; -/* + struct LiquidTypeEntry { - uint32 ID; // 0 - char* name; // 1 - uint32 flags; // 2 Water: 1|2|4|8, Magma: 8|16|32|64, Slime: 2|64|256, WMO Ocean: 1|2|4|8|512 - uint32 type; // 3 0: Water, 1: Ocean, 2: Magma, 3: Slime - uint32 soundid; // 4 Reference to SoundEntries.dbc - uint32 spellID; // 5 Reference to Spell.dbc - float unk0[4]; // 6-9 - uint32 unk1; // 10 Light? - float particleScale // 11 0: Slime, 1: Water/Ocean, 4: Magma - uint32 particleMovement; // 12 - uint32 unk2 // 13 - uint32 LiquidMaterialID // 14 Reference to LiquidMaterial.dbc - char* texture[6]; // 15-20 - uint32 unk3[2] // 21-22 - float unk4[18]; // 23-40 - uint32 unk5[4] // 41-44 + uint32 Id; + //char* Name; + //uint32 Flags; + uint32 Type; + //uint32 SoundId; + uint32 SpellId; + //float MaxDarkenDepth; + //float FogDarkenIntensity; + //float AmbDarkenIntensity; + //float DirDarkenIntensity; + //uint32 LightID; + //float ParticleScale; + //uint32 ParticleMovement; + //uint32 ParticleTexSlots; + //uint32 LiquidMaterialID; + //char* Texture[6]; + //uint32 Color[2]; + //float Unk1[18]; + //uint32 Unk2[4]; }; -*/ #define MAX_LOCK_CASE 8 @@ -1368,6 +1368,7 @@ struct MapEntry bool IsBattleground() const { return map_type == MAP_BATTLEGROUND; } bool IsBattleArena() const { return map_type == MAP_ARENA; } bool IsBattlegroundOrArena() const { return map_type == MAP_BATTLEGROUND || map_type == MAP_ARENA; } + bool IsWorldMap() const { return map_type == MAP_COMMON; } bool GetEntrancePos(int32 &mapid, float &x, float &y) const { @@ -2212,7 +2213,7 @@ struct WorldMapAreaEntry float x2; // 7 int32 virtual_map_id; // 8 -1 (map_id have correct map) other: virtual map where zone show (map_id - where zone in fact internally) // int32 dungeonMap_id; // 9 pointer to DungeonMap.dbc (owerride x1, x2, y1, y2 coordinates) - // uint32 someMapID; // 10 + // uint32 parentMapID; // 10 }; #define MAX_WORLD_MAP_OVERLAY_AREA_IDX 4 diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index c0923b45400..df5e1ce5035 100755 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -88,7 +88,7 @@ const char ItemRandomPropertiesfmt[]="nxiiixxs"; const char ItemRandomSuffixfmt[]="nsxiiiiiiiiii"; const char ItemSetEntryfmt[]="dsiiiiiiiiiixxxxxxxiiiiiiiiiiiiiiiiii"; const char LFGDungeonEntryfmt[]="nxiiiiiiixixxixixx"; -//const char LiquidTypeEntryfmt[]="nsiiiiffffifiiisssssiiffffffffffffffffffiiii"; +const char LiquidTypefmt[]="nxxixixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; const char LockEntryfmt[]="niiiiiiiiiiiiiiiiiiiiiiiixxxxxxxx"; const char PhaseEntryfmt[]="nsi"; const char MailTemplateEntryfmt[]="nxs"; diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index e6039880b63..47c298d7467 100755 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -38,7 +38,8 @@ m_NumWaitTimeAvg(0), m_NumWaitTimeTank(0), m_NumWaitTimeHealer(0), m_NumWaitTime m_update = sWorld->getBoolConfig(CONFIG_DUNGEON_FINDER_ENABLE); if (m_update) { - new LFGScripts(); + new LFGPlayerScript(); + new LFGGroupScript(); // Initialize dungeon cache for (uint32 i = 0; i < sLFGDungeonStore.GetNumRows(); ++i) @@ -1022,7 +1023,7 @@ bool LFGMgr::CheckCompatibility(LfgGuidList check, LfgProposal*& pProposal) // Select a random dungeon from the compatible list // TODO - Select the dungeon based on group item Level, not just random // Create a new proposal - pProposal = new LfgProposal(SelectRandomContainerElement(compatibleDungeons)); + pProposal = new LfgProposal(Trinity::Containers::SelectRandomContainerElement(compatibleDungeons)); pProposal->cancelTime = time_t(time(NULL)) + LFG_TIME_PROPOSAL; pProposal->state = LFG_PROPOSAL_INITIATING; pProposal->queues = check; @@ -1166,7 +1167,7 @@ void LFGMgr::UpdateRoleCheck(uint64 gguid, uint64 guid /* = 0 */, uint8 roles /* } m_QueueInfoMap[gguid] = pqInfo; - if(GetState(gguid) != LFG_STATE_NONE) + if (GetState(gguid) != LFG_STATE_NONE) { LfgGuidList& currentQueue = m_currentQueue[team]; currentQueue.push_front(gguid); diff --git a/src/server/game/DungeonFinding/LFGScripts.cpp b/src/server/game/DungeonFinding/LFGScripts.cpp index 2966e799c58..6175addfae2 100644 --- a/src/server/game/DungeonFinding/LFGScripts.cpp +++ b/src/server/game/DungeonFinding/LFGScripts.cpp @@ -27,9 +27,45 @@ #include "LFGScripts.h" #include "LFGMgr.h" -LFGScripts::LFGScripts(): GroupScript("LFGScripts"), PlayerScript("LFGScripts") {} +LFGPlayerScript::LFGPlayerScript() : PlayerScript("LFGPlayerScript") +{ +} + +void LFGPlayerScript::OnLevelChanged(Player* player, uint8 /*oldLevel*/) +{ + sLFGMgr->InitializeLockedDungeons(player); +} -void LFGScripts::OnAddMember(Group* group, uint64 guid) +void LFGPlayerScript::OnLogout(Player* player) +{ + sLFGMgr->Leave(player); + LfgUpdateData updateData = LfgUpdateData(LFG_UPDATETYPE_REMOVED_FROM_QUEUE); + player->GetSession()->SendLfgUpdateParty(updateData); + player->GetSession()->SendLfgUpdatePlayer(updateData); + player->GetSession()->SendLfgUpdateSearch(false); + uint64 guid = player->GetGUID(); + // TODO - Do not remove, add timer before deleting + sLFGMgr->RemovePlayerData(guid); +} + +void LFGPlayerScript::OnLogin(Player* player) +{ + sLFGMgr->InitializeLockedDungeons(player); + // TODO - Restore LfgPlayerData and send proper status to player if it was in a group +} + +void LFGPlayerScript::OnBindToInstance(Player* player, Difficulty difficulty, uint32 mapId, bool /*permanent*/) +{ + MapEntry const* mapEntry = sMapStore.LookupEntry(mapId); + if (mapEntry->IsDungeon() && difficulty > DUNGEON_DIFFICULTY_NORMAL) + sLFGMgr->InitializeLockedDungeons(player); +} + +LFGGroupScript::LFGGroupScript() : GroupScript("LFGGroupScript") +{ +} + +void LFGGroupScript::OnAddMember(Group* group, uint64 guid) { uint64 gguid = group->GetGUID(); if (!gguid) @@ -55,7 +91,7 @@ void LFGScripts::OnAddMember(Group* group, uint64 guid) sLFGMgr->Leave(player); } -void LFGScripts::OnRemoveMember(Group* group, uint64 guid, RemoveMethod method, uint64 kicker, const char* reason) +void LFGGroupScript::OnRemoveMember(Group* group, uint64 guid, RemoveMethod method, uint64 kicker, char const* reason) { uint64 gguid = group->GetGUID(); if (!gguid || method == GROUP_REMOVEMETHOD_DEFAULT) @@ -102,7 +138,7 @@ void LFGScripts::OnRemoveMember(Group* group, uint64 guid, RemoveMethod method, sLFGMgr->OfferContinue(group); } -void LFGScripts::OnDisband(Group* group) +void LFGGroupScript::OnDisband(Group* group) { uint64 gguid = group->GetGUID(); sLog->outDebug(LOG_FILTER_LFG, "LFGScripts::OnDisband [" UI64FMTD "]", gguid); @@ -110,7 +146,7 @@ void LFGScripts::OnDisband(Group* group) sLFGMgr->RemoveGroupData(gguid); } -void LFGScripts::OnChangeLeader(Group* group, uint64 newLeaderGuid, uint64 oldLeaderGuid) +void LFGGroupScript::OnChangeLeader(Group* group, uint64 newLeaderGuid, uint64 oldLeaderGuid) { uint64 gguid = group->GetGUID(); if (!gguid) @@ -131,7 +167,7 @@ void LFGScripts::OnChangeLeader(Group* group, uint64 newLeaderGuid, uint64 oldLe } } -void LFGScripts::OnInviteMember(Group* group, uint64 guid) +void LFGGroupScript::OnInviteMember(Group* group, uint64 guid) { uint64 gguid = group->GetGUID(); if (!gguid) @@ -140,33 +176,3 @@ void LFGScripts::OnInviteMember(Group* group, uint64 guid) sLog->outDebug(LOG_FILTER_LFG, "LFGScripts::OnInviteMember [" UI64FMTD "]: invite [" UI64FMTD "] leader [" UI64FMTD "]", gguid, guid, group->GetLeaderGUID()); sLFGMgr->Leave(NULL, group); } - -void LFGScripts::OnLevelChanged(Player* player, uint8 /*oldLevel*/) -{ - sLFGMgr->InitializeLockedDungeons(player); -} - -void LFGScripts::OnLogout(Player* player) -{ - sLFGMgr->Leave(player); - LfgUpdateData updateData = LfgUpdateData(LFG_UPDATETYPE_REMOVED_FROM_QUEUE); - player->GetSession()->SendLfgUpdateParty(updateData); - player->GetSession()->SendLfgUpdatePlayer(updateData); - player->GetSession()->SendLfgUpdateSearch(false); - uint64 guid = player->GetGUID(); - // TODO - Do not remove, add timer before deleting - sLFGMgr->RemovePlayerData(guid); -} - -void LFGScripts::OnLogin(Player* player) -{ - sLFGMgr->InitializeLockedDungeons(player); - // TODO - Restore LfgPlayerData and send proper status to player if it was in a group -} - -void LFGScripts::OnBindToInstance(Player* player, Difficulty difficulty, uint32 mapId, bool /*permanent*/) -{ - MapEntry const* mapEntry = sMapStore.LookupEntry(mapId); - if (mapEntry->IsDungeon() && difficulty > DUNGEON_DIFFICULTY_NORMAL) - sLFGMgr->InitializeLockedDungeons(player); -} diff --git a/src/server/game/DungeonFinding/LFGScripts.h b/src/server/game/DungeonFinding/LFGScripts.h index f17f7b16af1..4b332c7d731 100644 --- a/src/server/game/DungeonFinding/LFGScripts.h +++ b/src/server/game/DungeonFinding/LFGScripts.h @@ -26,17 +26,10 @@ class Player; class Group; -class LFGScripts: public GroupScript, public PlayerScript +class LFGPlayerScript : public PlayerScript { public: - LFGScripts(); - - // Group Hooks - void OnAddMember(Group* group, uint64 guid); - void OnRemoveMember(Group* group, uint64 guid, RemoveMethod method, uint64 kicker, const char* reason); - void OnDisband(Group* group); - void OnChangeLeader(Group* group, uint64 newLeaderGuid, uint64 oldLeaderGuid); - void OnInviteMember(Group* group, uint64 guid); + LFGPlayerScript(); // Player Hooks void OnLevelChanged(Player* player, uint8 oldLevel); @@ -44,3 +37,16 @@ class LFGScripts: public GroupScript, public PlayerScript void OnLogin(Player* player); void OnBindToInstance(Player* player, Difficulty difficulty, uint32 mapId, bool permanent); }; + +class LFGGroupScript : public GroupScript +{ + public: + LFGGroupScript(); + + // Group Hooks + void OnAddMember(Group* group, uint64 guid); + void OnRemoveMember(Group* group, uint64 guid, RemoveMethod method, uint64 kicker, char const* reason); + void OnDisband(Group* group); + void OnChangeLeader(Group* group, uint64 newLeaderGuid, uint64 oldLeaderGuid); + void OnInviteMember(Group* group, uint64 guid); +}; diff --git a/src/server/game/Entities/Corpse/Corpse.cpp b/src/server/game/Entities/Corpse/Corpse.cpp index 858a218774c..714be7d7c9e 100755 --- a/src/server/game/Entities/Corpse/Corpse.cpp +++ b/src/server/game/Entities/Corpse/Corpse.cpp @@ -32,7 +32,7 @@ Corpse::Corpse(CorpseType type) : WorldObject(type != CORPSE_BONES) m_objectType |= TYPEMASK_CORPSE; m_objectTypeId = TYPEID_CORPSE; - m_updateFlag = (UPDATEFLAG_HAS_POSITION | UPDATEFLAG_POSITION); + m_updateFlag = (UPDATEFLAG_STATIONARY_POSITION | UPDATEFLAG_POSITION); m_valuesCount = CORPSE_END; @@ -89,7 +89,7 @@ bool Corpse::Create(uint32 guidlow, Player* owner) WorldObject::_Create(guidlow, HIGHGUID_CORPSE, owner->GetPhaseMask()); - SetFloatValue(OBJECT_FIELD_SCALE_X, 1); + SetObjectScale(1); SetUInt64Value(CORPSE_FIELD_OWNER, owner->GetGUID()); _gridCoord = Trinity::ComputeGridCoord(GetPositionX(), GetPositionY()); diff --git a/src/server/game/Entities/Corpse/Corpse.h b/src/server/game/Entities/Corpse/Corpse.h index 1aaf56eaf27..afac900df32 100755 --- a/src/server/game/Entities/Corpse/Corpse.h +++ b/src/server/game/Entities/Corpse/Corpse.h @@ -91,4 +91,3 @@ class Corpse : public WorldObject, public GridObject GridCoord _gridCoord; // gride for corpse position for fast search }; #endif - diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index fc403ef1ff7..ca075703277 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -135,7 +135,7 @@ CreatureBaseStats const* CreatureBaseStats::GetBaseStats(uint8 level, uint8 unit bool ForcedDespawnDelayEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/) { - m_owner.ForcedDespawn(); + m_owner.DespawnOrUnsummon(); // since we are here, we are not TempSummon as object type cannot change during runtime return true; } @@ -199,7 +199,7 @@ void Creature::RemoveFromWorld() if (m_zoneScript) m_zoneScript->OnCreatureRemove(this); if (m_formation) - FormationMgr::RemoveCreatureFromGroup(m_formation, this); + sFormationMgr->RemoveCreatureFromGroup(m_formation, this); Unit::RemoveFromWorld(); sObjectAccessor->RemoveObject(this); } @@ -224,9 +224,9 @@ void Creature::SearchFormation() if (!lowguid) return; - CreatureGroupInfoType::iterator frmdata = CreatureGroupMap.find(lowguid); - if (frmdata != CreatureGroupMap.end()) - FormationMgr::AddCreatureToGroup(frmdata->second->leaderGUID, this); + CreatureGroupInfoType::iterator frmdata = sFormationMgr->CreatureGroupMap.find(lowguid); + if (frmdata != sFormationMgr->CreatureGroupMap.end()) + sFormationMgr->AddCreatureToGroup(frmdata->second->leaderGUID, this); } void Creature::RemoveCorpse(bool setSpawnTime) @@ -303,7 +303,7 @@ bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData* data return false; } - uint32 displayID = sObjectMgr->ChooseDisplayId(0, GetCreatureInfo(), data); + uint32 displayID = sObjectMgr->ChooseDisplayId(0, GetCreatureTemplate(), data); CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelRandomGender(&displayID); if (!minfo) // Cancel load if no model defined { @@ -333,8 +333,9 @@ bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData* data SetSpeed(MOVE_SWIM, 1.0f); // using 1.0 rate SetSpeed(MOVE_FLIGHT, 1.0f); // using 1.0 rate - SetFloatValue(OBJECT_FIELD_SCALE_X, cinfo->scale); - SetLevitate(canFly()); + SetObjectScale(cinfo->scale); + + SetFloatValue(UNIT_FIELD_HOVERHEIGHT, cinfo->HoverHeight); // checked at loading m_defaultMovementType = MovementGeneratorType(cinfo->MovementType); @@ -342,7 +343,7 @@ bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData* data m_defaultMovementType = IDLE_MOTION_TYPE; for (uint8 i=0; i < CREATURE_MAX_SPELLS; ++i) - m_spells[i] = GetCreatureInfo()->spells[i]; + m_spells[i] = GetCreatureTemplate()->spells[i]; return true; } @@ -352,14 +353,15 @@ bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData* data) if (!InitEntry(Entry, team, data)) return false; - CreatureTemplate const* cInfo = GetCreatureInfo(); + CreatureTemplate const* cInfo = GetCreatureTemplate(); m_regenHealth = cInfo->RegenHealth; - // creatures always have melee weapon ready if any - SetSheath(SHEATH_STATE_MELEE); + // creatures always have melee weapon ready if any unless specified otherwise + if (!GetCreatureAddon()) + SetSheath(SHEATH_STATE_MELEE); - SelectLevel(GetCreatureInfo()); + SelectLevel(GetCreatureTemplate()); if (team == HORDE) setFaction(cInfo->faction_H); else @@ -418,10 +420,25 @@ bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData* data) ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, true); } - // TODO: In fact monster move flags should be set - not movement flags. - if (cInfo->InhabitType & INHABIT_AIR) - AddUnitMovementFlag(MOVEMENTFLAG_CAN_FLY | MOVEMENTFLAG_FLYING); + //! Suspect it works this way: + //! If creature can walk and fly (usually with pathing) + //! Set MOVEMENTFLAG_CAN_FLY. Otherwise if it can only fly + //! Set MOVEMENTFLAG_DISABLE_GRAVITY + //! The only time I saw Movement Flags: DisableGravity, CanFly, Flying (50332672) on the same unit + //! it was a vehicle + if (cInfo->InhabitType & INHABIT_AIR && cInfo->InhabitType & INHABIT_GROUND) + SetCanFly(true); + else if (cInfo->InhabitType & INHABIT_AIR) + SetDisableGravity(true); + /*! Implemented in LoadCreatureAddon. Suspect there's a rule for UNIT_BYTE_1_FLAG_HOVER + in relation to DisableGravity also. + + else if (GetByteValue(UNIT_FIELD_BYTES_1, 3) & UNIT_BYTE_1_FLAG_HOVER) + SetHover(true); + */ + + // TODO: Shouldn't we check whether or not the creature is in water first? if (cInfo->InhabitType & INHABIT_WATER) AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING); @@ -451,9 +468,9 @@ void Creature::Update(uint32 diff) switch (m_deathState) { - case JUST_ALIVED: - // Must not be called, see Creature::setDeathState JUST_ALIVED -> ALIVE promoting. - sLog->outError("Creature (GUID: %u Entry: %u) in wrong state: JUST_ALIVED (4)", GetGUIDLow(), GetEntry()); + case JUST_RESPAWNED: + // Must not be called, see Creature::setDeathState JUST_RESPAWNED -> ALIVE promoting. + sLog->outError("Creature (GUID: %u Entry: %u) in wrong state: JUST_RESPAWNED (4)", GetGUIDLow(), GetEntry()); break; case JUST_DIED: // Must not be called, see Creature::setDeathState JUST_DIED -> CORPSE promoting. @@ -742,19 +759,21 @@ bool Creature::Create(uint32 guidlow, Map* map, uint32 phaseMask, uint32 Entry, return false; } + //! Relocate before CreateFromProto, to initialize coords and allow + //! returning correct zone id for selecting OutdoorPvP/Battlefield script Relocate(x, y, z, ang); + //oX = x; oY = y; dX = x; dY = y; m_moveTime = 0; m_startMove = 0; + if (!CreateFromProto(guidlow, Entry, vehId, team, data)) + return false; + if (!IsPositionValid()) { sLog->outError("Creature::Create(): given coordinates for creature (guidlow %d, entry %d) are not valid (X: %f, Y: %f, Z: %f, O: %f)", guidlow, Entry, x, y, z, ang); return false; } - //oX = x; oY = y; dX = x; dY = y; m_moveTime = 0; m_startMove = 0; - if (!CreateFromProto(guidlow, Entry, vehId, team, data)) - return false; - - switch (GetCreatureInfo()->rank) + switch (GetCreatureTemplate()->rank) { case CREATURE_ELITE_RARE: m_corpseDelay = sWorld->getIntConfig(CONFIG_CORPSE_DECAY_RARE); @@ -774,6 +793,16 @@ bool Creature::Create(uint32 guidlow, Map* map, uint32 phaseMask, uint32 Entry, } LoadCreaturesAddon(); + + //! Need to be called after LoadCreaturesAddon - MOVEMENTFLAG_HOVER is set there + if (HasUnitMovementFlag(MOVEMENTFLAG_HOVER)) + { + z += GetFloatValue(UNIT_FIELD_HOVERHEIGHT); + + //! Relocate again with updated Z coord + Relocate(x, y, z, ang); + } + uint32 displayID = GetNativeDisplayId(); CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelRandomGender(&displayID); if (minfo && !isTotem()) // Cancel load if no model defined or if totem @@ -783,18 +812,7 @@ bool Creature::Create(uint32 guidlow, Map* map, uint32 phaseMask, uint32 Entry, SetByteValue(UNIT_FIELD_BYTES_0, 2, minfo->gender); } - if (GetCreatureInfo()->InhabitType & INHABIT_AIR) - { - if (GetDefaultMovementType() == IDLE_MOTION_TYPE) - AddUnitMovementFlag(MOVEMENTFLAG_CAN_FLY); - else - SetFlying(true); - } - - if (GetCreatureInfo()->InhabitType & INHABIT_WATER) - AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING); - - LastUsedScriptID = GetCreatureInfo()->ScriptID; + LastUsedScriptID = GetCreatureTemplate()->ScriptID; // TODO: Replace with spell, handle from DB if (isSpiritHealer() || isSpiritGuide()) @@ -816,22 +834,22 @@ bool Creature::isCanTrainingOf(Player* player, bool msg) const TrainerSpellData const* trainer_spells = GetTrainerSpells(); - if ((!trainer_spells || trainer_spells->spellList.empty()) && GetCreatureInfo()->trainer_type != TRAINER_TYPE_PETS) + if ((!trainer_spells || trainer_spells->spellList.empty()) && GetCreatureTemplate()->trainer_type != TRAINER_TYPE_PETS) { sLog->outErrorDb("Creature %u (Entry: %u) have UNIT_NPC_FLAG_TRAINER but have empty trainer spell list.", GetGUIDLow(), GetEntry()); return false; } - switch (GetCreatureInfo()->trainer_type) + switch (GetCreatureTemplate()->trainer_type) { case TRAINER_TYPE_CLASS: - if (player->getClass() != GetCreatureInfo()->trainer_class) + if (player->getClass() != GetCreatureTemplate()->trainer_class) { if (msg) { player->PlayerTalkClass->ClearMenus(); - switch (GetCreatureInfo()->trainer_class) + switch (GetCreatureTemplate()->trainer_class) { case CLASS_DRUID: player->PlayerTalkClass->SendGossipMenu(4913, GetGUID()); break; case CLASS_HUNTER: player->PlayerTalkClass->SendGossipMenu(10090, GetGUID()); break; @@ -856,12 +874,12 @@ bool Creature::isCanTrainingOf(Player* player, bool msg) const } break; case TRAINER_TYPE_MOUNTS: - if (GetCreatureInfo()->trainer_race && player->getRace() != GetCreatureInfo()->trainer_race) + if (GetCreatureTemplate()->trainer_race && player->getRace() != GetCreatureTemplate()->trainer_race) { if (msg) { player->PlayerTalkClass->ClearMenus(); - switch (GetCreatureInfo()->trainer_class) + switch (GetCreatureTemplate()->trainer_class) { case RACE_DWARF: player->PlayerTalkClass->SendGossipMenu(5865, GetGUID()); break; case RACE_GNOME: player->PlayerTalkClass->SendGossipMenu(4881, GetGUID()); break; @@ -879,7 +897,7 @@ bool Creature::isCanTrainingOf(Player* player, bool msg) const } break; case TRAINER_TYPE_TRADESKILLS: - if (GetCreatureInfo()->trainer_spell && !player->HasSpell(GetCreatureInfo()->trainer_spell)) + if (GetCreatureTemplate()->trainer_spell && !player->HasSpell(GetCreatureTemplate()->trainer_spell)) { if (msg) { @@ -930,8 +948,8 @@ bool Creature::isCanInteractWithBattleMaster(Player* player, bool msg) const bool Creature::isCanTrainingAndResetTalentsOf(Player* player) const { return player->getLevel() >= 10 - && GetCreatureInfo()->trainer_type == TRAINER_TYPE_CLASS - && player->getClass() == GetCreatureInfo()->trainer_class; + && GetCreatureTemplate()->trainer_type == TRAINER_TYPE_CLASS + && player->getClass() == GetCreatureTemplate()->trainer_class; } void Creature::AI_SendMoveToPacket(float x, float y, float z, uint32 time, uint32 /*MovementFlags*/, uint8 /*type*/) @@ -1040,7 +1058,7 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask) uint32 dynamicflags = GetUInt32Value(UNIT_DYNAMIC_FLAGS); // check if it's a custom model and if not, use 0 for displayId - CreatureTemplate const* cinfo = GetCreatureInfo(); + CreatureTemplate const* cinfo = GetCreatureTemplate(); if (cinfo) { if (displayId == cinfo->Modelid1 || displayId == cinfo->Modelid2 || @@ -1065,11 +1083,11 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask) data.equipmentId = GetEquipmentId(); data.posX = GetPositionX(); data.posY = GetPositionY(); - data.posZ = GetPositionZ(); + data.posZ = GetPositionZMinusOffset(); data.orientation = GetOrientation(); data.spawntimesecs = m_respawnDelay; // prevent add data integrity problems - data.spawndist = GetDefaultMovementType() == IDLE_MOTION_TYPE ? 0 : m_respawnradius; + data.spawndist = GetDefaultMovementType() == IDLE_MOTION_TYPE ? 0.0f : m_respawnradius; data.currentwaypoint = 0; data.curhealth = GetHealth(); data.curmana = GetPower(POWER_MANA); @@ -1084,32 +1102,34 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask) // update in DB SQLTransaction trans = WorldDatabase.BeginTransaction(); - trans->PAppend("DELETE FROM creature WHERE guid = '%u'", m_DBTableGuid); - - std::ostringstream ss; - ss << "INSERT INTO creature VALUES (" - << m_DBTableGuid << ',' - << GetEntry() << ',' - << mapid << ',' - << uint32(spawnMask) << ',' // cast to prevent save as symbol - << uint16(GetPhaseMask()) << ',' // prevent out of range error - << displayId << ',' - << GetEquipmentId() << ',' - << GetPositionX() << ',' - << GetPositionY() << ',' - << GetPositionZ() << ',' - << GetOrientation() << ',' - << m_respawnDelay << ',' //respawn time - << (float) m_respawnradius << ',' //spawn distance (float) - << (uint32) (0) << ',' //currentwaypoint - << GetHealth() << ',' //curhealth - << GetPower(POWER_MANA) << ',' //curmana - << GetDefaultMovementType() << ',' //default movement generator type - << npcflag << ',' - << unit_flags << ',' - << dynamicflags << ')'; - - trans->Append(ss.str().c_str()); + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_CREATURE); + stmt->setUInt32(0, m_DBTableGuid); + trans->Append(stmt); + + uint8 index = 0; + + stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_CREATURE); + stmt->setUInt32(index++, m_DBTableGuid); + stmt->setUInt32(index++, GetEntry()); + stmt->setUInt16(index++, uint16(mapid)); + stmt->setUInt8(index++, spawnMask); + stmt->setUInt16(index++, uint16(GetPhaseMask())); + stmt->setUInt32(index++, displayId); + stmt->setInt32(index++, int32(GetEquipmentId())); + stmt->setFloat(index++, GetPositionX()); + stmt->setFloat(index++, GetPositionY()); + stmt->setFloat(index++, GetPositionZ()); + stmt->setFloat(index++, GetOrientation()); + stmt->setUInt32(index++, m_respawnDelay); + stmt->setFloat(index++, m_respawnradius); + stmt->setUInt32(index++, 0); + stmt->setUInt32(index++, GetHealth()); + stmt->setUInt32(index++, GetPower(POWER_MANA)); + stmt->setUInt8(index++, uint8(GetDefaultMovementType())); + stmt->setUInt32(index++, npcflag); + stmt->setUInt32(index++, unit_flags); + stmt->setUInt32(index++, dynamicflags); + trans->Append(stmt); WorldDatabase.CommitTransaction(trans); } @@ -1287,7 +1307,7 @@ bool Creature::LoadCreatureFromDB(uint32 guid, Map* map, bool addToMap) if (m_respawnTime) // respawn on Update { m_deathState = DEAD; - if (canFly()) + if (CanFly()) { float tz = map->GetHeight(GetPhaseMask(), data->posX, data->posY, data->posZ, false); if (data->posZ - tz > 0.1f) @@ -1302,7 +1322,7 @@ bool Creature::LoadCreatureFromDB(uint32 guid, Map* map, bool addToMap) curhealth = data->curhealth; if (curhealth) { - curhealth = uint32(curhealth*_GetHealthMod(GetCreatureInfo()->rank)); + curhealth = uint32(curhealth*_GetHealthMod(GetCreatureTemplate()->rank)); if (curhealth < 1) curhealth = 1; } @@ -1382,10 +1402,23 @@ void Creature::DeleteFromDB() sObjectMgr->DeleteCreatureData(m_DBTableGuid); SQLTransaction trans = WorldDatabase.BeginTransaction(); - trans->PAppend("DELETE FROM creature WHERE guid = '%u'", m_DBTableGuid); - trans->PAppend("DELETE FROM creature_addon WHERE guid = '%u'", m_DBTableGuid); - trans->PAppend("DELETE FROM game_event_creature WHERE guid = '%u'", m_DBTableGuid); - trans->PAppend("DELETE FROM game_event_model_equip WHERE guid = '%u'", m_DBTableGuid); + + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_CREATURE); + stmt->setUInt32(0, m_DBTableGuid); + trans->Append(stmt); + + stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_CREATURE_ADDON); + stmt->setUInt32(0, m_DBTableGuid); + trans->Append(stmt); + + stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_GAME_EVENT_CREATURE); + stmt->setUInt32(0, m_DBTableGuid); + trans->Append(stmt); + + stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_GAME_EVENT_MODEL_EQUIP); + stmt->setUInt32(0, m_DBTableGuid); + trans->Append(stmt); + WorldDatabase.CommitTransaction(trans); } @@ -1420,7 +1453,7 @@ bool Creature::canStartAttack(Unit const* who, bool force) const if (who->GetTypeId() == TYPEID_UNIT && who->GetCreatureType() == CREATURE_TYPE_NON_COMBAT_PET) return false; - if (!canFly() && (GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE + m_CombatDistance)) + if (!CanFly() && (GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE + m_CombatDistance)) //|| who->IsControlledByPlayer() && who->IsFlying())) // we cannot check flying for other creatures, too much map/vmap calculation // TODO: should switch to range attack @@ -1502,8 +1535,8 @@ void Creature::setDeathState(DeathState s) setActive(false); - if (!isPet() && GetCreatureInfo()->SkinLootId) - if (LootTemplates_Skinning.HaveLootFor(GetCreatureInfo()->SkinLootId)) + if (!isPet() && GetCreatureTemplate()->SkinLootId) + if (LootTemplates_Skinning.HaveLootFor(GetCreatureTemplate()->SkinLootId)) if (hasLootRecipient()) SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); @@ -1517,23 +1550,25 @@ void Creature::setDeathState(DeathState s) if (m_formation && m_formation->getLeader() == this) m_formation->FormationReset(true); - if ((canFly() || IsFlying())) + if ((CanFly() || IsFlying())) i_motionMaster.MoveFall(); Unit::setDeathState(CORPSE); } - else if (s == JUST_ALIVED) + else if (s == JUST_RESPAWNED) { //if (isPet()) // setActive(true); SetFullHealth(); SetLootRecipient(NULL); ResetPlayerDamageReq(); - CreatureTemplate const* cinfo = GetCreatureInfo(); + CreatureTemplate const* cinfo = GetCreatureTemplate(); SetWalk(true); - if (GetCreatureInfo()->InhabitType & INHABIT_AIR) - AddUnitMovementFlag(MOVEMENTFLAG_CAN_FLY | MOVEMENTFLAG_FLYING); - if (GetCreatureInfo()->InhabitType & INHABIT_WATER) + if (cinfo->InhabitType & INHABIT_AIR && cinfo->InhabitType & INHABIT_GROUND) + SetCanFly(true); + else if (cinfo->InhabitType & INHABIT_AIR) + SetDisableGravity(true); + if (cinfo->InhabitType & INHABIT_WATER) AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING); SetUInt32Value(UNIT_NPC_FLAGS, cinfo->npcflag); ClearUnitState(uint32(UNIT_STATE_ALL_STATE)); @@ -1573,10 +1608,10 @@ void Creature::Respawn(bool force) if (m_originalEntry != GetEntry()) UpdateEntry(m_originalEntry); - CreatureTemplate const* cinfo = GetCreatureInfo(); + CreatureTemplate const* cinfo = GetCreatureTemplate(); SelectLevel(cinfo); - setDeathState(JUST_ALIVED); + setDeathState(JUST_RESPAWNED); uint32 displayID = GetNativeDisplayId(); CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelRandomGender(&displayID); @@ -1633,12 +1668,12 @@ bool Creature::IsImmunedToSpell(SpellInfo const* spellInfo) if (!spellInfo) return false; - // Spells that don't have effectMechanics. - if (!spellInfo->HasAnyEffectMechanic() && GetCreatureInfo()->MechanicImmuneMask & (1 << (spellInfo->Mechanic - 1))) + // Creature is immune to main mechanic of the spell + if (GetCreatureTemplate()->MechanicImmuneMask & (1 << (spellInfo->Mechanic - 1))) return true; - // This check must be done instead of 'if (GetCreatureInfo()->MechanicImmuneMask & (1 << (spellInfo->Mechanic - 1)))' for not break - // the check of mechanic immunity on DB (tested) because GetCreatureInfo()->MechanicImmuneMask and m_spellImmune[IMMUNITY_MECHANIC] don't have same data. + // This check must be done instead of 'if (GetCreatureTemplate()->MechanicImmuneMask & (1 << (spellInfo->Mechanic - 1)))' for not break + // the check of mechanic immunity on DB (tested) because GetCreatureTemplate()->MechanicImmuneMask and m_spellImmune[IMMUNITY_MECHANIC] don't have same data. bool immunedToAllEffects = true; for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) if (!IsImmunedToSpellEffect(spellInfo, i)) @@ -1654,18 +1689,18 @@ bool Creature::IsImmunedToSpell(SpellInfo const* spellInfo) bool Creature::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) const { - if (GetCreatureInfo()->MechanicImmuneMask & (1 << (spellInfo->Effects[index].Mechanic - 1))) + if (GetCreatureTemplate()->MechanicImmuneMask & (1 << (spellInfo->Effects[index].Mechanic - 1))) return true; - if (GetCreatureInfo()->type == CREATURE_TYPE_MECHANICAL && spellInfo->Effects[index].Effect == SPELL_EFFECT_HEAL) + if (GetCreatureTemplate()->type == CREATURE_TYPE_MECHANICAL && spellInfo->Effects[index].Effect == SPELL_EFFECT_HEAL) return true; return Unit::IsImmunedToSpellEffect(spellInfo, index); } -SpellInfo const* Creature::reachWithSpellAttack(Unit* pVictim) +SpellInfo const* Creature::reachWithSpellAttack(Unit* victim) { - if (!pVictim) + if (!victim) return NULL; for (uint32 i=0; i < CREATURE_MAX_SPELLS; ++i) @@ -1686,7 +1721,7 @@ SpellInfo const* Creature::reachWithSpellAttack(Unit* pVictim) (spellInfo->Effects[j].Effect == SPELL_EFFECT_INSTAKILL) || (spellInfo->Effects[j].Effect == SPELL_EFFECT_ENVIRONMENTAL_DAMAGE) || (spellInfo->Effects[j].Effect == SPELL_EFFECT_HEALTH_LEECH) -) + ) { bcontinue = false; break; @@ -1700,7 +1735,7 @@ SpellInfo const* Creature::reachWithSpellAttack(Unit* pVictim) continue; float range = spellInfo->GetMaxRange(false); float minrange = spellInfo->GetMinRange(false); - float dist = GetDistance(pVictim); + float dist = GetDistance(victim); if (dist > range || dist < minrange) continue; if (spellInfo->PreventionType == SPELL_PREVENTION_TYPE_SILENCE && HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED)) @@ -1712,9 +1747,9 @@ SpellInfo const* Creature::reachWithSpellAttack(Unit* pVictim) return NULL; } -SpellInfo const* Creature::reachWithSpellCure(Unit* pVictim) +SpellInfo const* Creature::reachWithSpellCure(Unit* victim) { - if (!pVictim) + if (!victim) return NULL; for (uint32 i=0; i < CREATURE_MAX_SPELLS; ++i) @@ -1737,15 +1772,16 @@ SpellInfo const* Creature::reachWithSpellCure(Unit* pVictim) break; } } - if (bcontinue) continue; + if (bcontinue) + continue; if (spellInfo->ManaCost > (uint32)GetPower(POWER_MANA)) continue; float range = spellInfo->GetMaxRange(true); float minrange = spellInfo->GetMinRange(true); - float dist = GetDistance(pVictim); - //if (!isInFront(pVictim, range) && spellInfo->AttributesEx) + float dist = GetDistance(victim); + //if (!isInFront(victim, range) && spellInfo->AttributesEx) // continue; if (dist > range || dist < minrange) continue; @@ -1982,30 +2018,30 @@ void Creature::SaveRespawnTime() } // this should not be called by petAI or -bool Creature::canCreatureAttack(Unit const* pVictim, bool /*force*/) const +bool Creature::canCreatureAttack(Unit const* victim, bool /*force*/) const { - if (!pVictim->IsInMap(this)) + if (!victim->IsInMap(this)) return false; - if (!IsValidAttackTarget(pVictim)) + if (!IsValidAttackTarget(victim)) return false; - if (!pVictim->isInAccessiblePlaceFor(this)) + if (!victim->isInAccessiblePlaceFor(this)) return false; - if (IsAIEnabled && !AI()->CanAIAttack(pVictim)) + if (IsAIEnabled && !AI()->CanAIAttack(victim)) return false; if (sMapStore.LookupEntry(GetMapId())->IsDungeon()) return true; //Use AttackDistance in distance check if threat radius is lower. This prevents creature bounce in and out of combat every update tick. - float dist = std::max(GetAttackDistance(pVictim), sWorld->getFloatConfig(CONFIG_THREAT_RADIUS)) + m_CombatDistance; + float dist = std::max(GetAttackDistance(victim), sWorld->getFloatConfig(CONFIG_THREAT_RADIUS)) + m_CombatDistance; if (Unit* unit = GetCharmerOrOwner()) - return pVictim->IsWithinDist(unit, dist); + return victim->IsWithinDist(unit, dist); else - return pVictim->IsInDist(&m_homePosition, dist); + return victim->IsInDist(&m_homePosition, dist); } CreatureAddon const* Creature::GetCreatureAddon() const @@ -2017,7 +2053,7 @@ CreatureAddon const* Creature::GetCreatureAddon() const } // dependent from difficulty mode entry - return sObjectMgr->GetCreatureTemplateAddon(GetCreatureInfo()->Entry); + return sObjectMgr->GetCreatureTemplateAddon(GetCreatureTemplate()->Entry); } //creature_addon table @@ -2042,6 +2078,12 @@ bool Creature::LoadCreaturesAddon(bool reload) SetByteValue(UNIT_FIELD_BYTES_1, 1, 0); SetByteValue(UNIT_FIELD_BYTES_1, 2, uint8((cainfo->bytes1 >> 16) & 0xFF)); SetByteValue(UNIT_FIELD_BYTES_1, 3, uint8((cainfo->bytes1 >> 24) & 0xFF)); + + //! Suspected correlation between UNIT_FIELD_BYTES_1, offset 3, value 0x2: + //! If no inhabittype_fly (if no MovementFlag_DisableGravity flag found in sniffs) + //! Set MovementFlag_Hover. Otherwise do nothing. + if (GetByteValue(UNIT_FIELD_BYTES_1, 3) & UNIT_BYTE1_FLAG_HOVER && !IsLevitating()) + AddUnitMovementFlag(MOVEMENTFLAG_HOVER); } if (cainfo->bytes2 != 0) @@ -2090,6 +2132,7 @@ bool Creature::LoadCreaturesAddon(bool reload) sLog->outDebug(LOG_FILTER_UNITS, "Spell: %u added to creature (GUID: %u Entry: %u)", *itr, GetGUIDLow(), GetEntry()); } } + return true; } @@ -2238,7 +2281,7 @@ void Creature::AllLootRemovedFromCorpse() return; float decayRate; - CreatureTemplate const* cinfo = GetCreatureInfo(); + CreatureTemplate const* cinfo = GetCreatureTemplate(); decayRate = sWorld->getRate(RATE_CORPSE_DECAY_LOOTED); uint32 diff = uint32((m_corpseRemoveTime - now) * decayRate); @@ -2410,24 +2453,50 @@ bool Creature::IsDungeonBoss() const return cinfo && (cinfo->flags_extra & CREATURE_FLAG_EXTRA_DUNGEON_BOSS); } -void Creature::SetWalk(bool enable) +bool Creature::SetWalk(bool enable) { - if (enable) - AddUnitMovementFlag(MOVEMENTFLAG_WALKING); - else - RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + if (!Unit::SetWalk(enable)) + return false; + WorldPacket data(enable ? SMSG_MOVE_SPLINE_SET_WALK_MODE : SMSG_MOVE_SPLINE_SET_RUN_MODE, 9); data.append(GetPackGUID()); - SendMessageToSet(&data, true); + SendMessageToSet(&data, false); + return true; } -void Creature::SetLevitate(bool enable) +bool Creature::SetDisableGravity(bool disable, bool packetOnly/*=false*/) { + //! It's possible only a packet is sent but moveflags are not updated + //! Need more research on this + if (!packetOnly && !Unit::SetDisableGravity(disable)) + return false; + + if (!movespline->Initialized()) + return true; + + WorldPacket data(disable ? SMSG_SPLINE_MOVE_GRAVITY_DISABLE : SMSG_SPLINE_MOVE_GRAVITY_ENABLE, 9); + data.append(GetPackGUID()); + SendMessageToSet(&data, false); + return true; +} + +bool Creature::SetHover(bool enable) +{ + if (!Unit::SetHover(enable)) + return false; + + //! Unconfirmed for players: if (enable) - AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + SetByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_HOVER); else - RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - WorldPacket data(enable ? SMSG_MOVE_SPLINE_DISABLE_GRAVITY : SMSG_MOVE_SPLINE_ENABLE_GRAVITY, 9); + RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_HOVER); + + if (!movespline->Initialized()) + return true; + + //! Not always a packet is sent + WorldPacket data(enable ? SMSG_SPLINE_MOVE_SET_HOVER : SMSG_SPLINE_MOVE_UNSET_HOVER, 9); data.append(GetPackGUID()); - SendMessageToSet(&data, true); + SendMessageToSet(&data, false); + return true; } diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index 847f2aa6fd1..906dc827d3f 100755 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -136,6 +136,7 @@ struct CreatureTemplate std::string AIName; uint32 MovementType; uint32 InhabitType; + float HoverHeight; float ModHealth; float ModMana; float ModArmor; @@ -267,7 +268,6 @@ struct CreatureData // `creature_addon` table struct CreatureAddon { - uint32 guidOrEntry; uint32 path_id; uint32 mount; uint32 bytes1; @@ -339,7 +339,9 @@ struct VendorItemData VendorItem* GetItem(uint32 slot) const { - if (slot >= m_items.size()) return NULL; + if (slot >= m_items.size()) + return NULL; + return m_items[slot]; } bool Empty() const { return m_items.empty(); } @@ -374,7 +376,7 @@ struct TrainerSpell { TrainerSpell() : spell(0), spellCost(0), reqSkill(0), reqSkillValue(0), reqLevel(0) { - for (uint8 i = 0; i < MAX_SPELL_EFFECTS ; ++i) + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) learnedSpell[i] = 0; } @@ -459,17 +461,17 @@ class Creature : public Unit, public GridObject, public MapCreature void Update(uint32 time); // overwrited Unit::Update void GetRespawnPosition(float &x, float &y, float &z, float* ori = NULL, float* dist =NULL) const; - uint32 GetEquipmentId() const { return GetCreatureInfo()->equipmentId; } + uint32 GetEquipmentId() const { return GetCreatureTemplate()->equipmentId; } void SetCorpseDelay(uint32 delay) { m_corpseDelay = delay; } uint32 GetCorpseDelay() const { return m_corpseDelay; } - bool isRacialLeader() const { return GetCreatureInfo()->RacialLeader; } - bool isCivilian() const { return GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_CIVILIAN; } - bool isTrigger() const { return GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_TRIGGER; } - bool isGuard() const { return GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_GUARD; } - bool canWalk() const { return GetCreatureInfo()->InhabitType & INHABIT_GROUND; } - bool canSwim() const { return GetCreatureInfo()->InhabitType & INHABIT_WATER; } - //bool canFly() const { return GetCreatureInfo()->InhabitType & INHABIT_AIR; } + bool isRacialLeader() const { return GetCreatureTemplate()->RacialLeader; } + bool isCivilian() const { return GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_CIVILIAN; } + bool isTrigger() const { return GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_TRIGGER; } + bool isGuard() const { return GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_GUARD; } + bool canWalk() const { return GetCreatureTemplate()->InhabitType & INHABIT_GROUND; } + bool canSwim() const { return GetCreatureTemplate()->InhabitType & INHABIT_WATER; } + bool CanFly() const { return GetCreatureTemplate()->InhabitType & INHABIT_AIR; } void SetReactState(ReactStates st) { m_reactState = st; } ReactStates GetReactState() { return m_reactState; } @@ -488,7 +490,7 @@ class Creature : public Unit, public GridObject, public MapCreature bool isCanTrainingOf(Player* player, bool msg) const; bool isCanInteractWithBattleMaster(Player* player, bool msg) const; bool isCanTrainingAndResetTalentsOf(Player* player) const; - bool canCreatureAttack(Unit const* pVictim, bool force = true) const; + bool canCreatureAttack(Unit const* victim, bool force = true) const; bool IsImmunedToSpell(SpellInfo const* spellInfo); // redefine Unit::IsImmunedToSpell bool IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) const; @@ -498,7 +500,7 @@ class Creature : public Unit, public GridObject, public MapCreature if (isPet()) return false; - uint32 rank = GetCreatureInfo()->rank; + uint32 rank = GetCreatureTemplate()->rank; return rank != CREATURE_ELITE_NORMAL && rank != CREATURE_ELITE_RARE; } @@ -507,7 +509,7 @@ class Creature : public Unit, public GridObject, public MapCreature if (isPet()) return false; - return GetCreatureInfo()->rank == CREATURE_ELITE_WORLDBOSS; + return GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_BOSS; } bool IsDungeonBoss() const; @@ -522,8 +524,9 @@ class Creature : public Unit, public GridObject, public MapCreature void AI_SendMoveToPacket(float x, float y, float z, uint32 time, uint32 MovementFlags, uint8 type); CreatureAI* AI() const { return (CreatureAI*)i_AI; } - void SetWalk(bool enable); - void SetLevitate(bool enable); + bool SetWalk(bool enable); + bool SetDisableGravity(bool disable, bool packetOnly = false); + bool SetHover(bool enable); uint32 GetShieldBlockValue() const //dunno mob block value { @@ -560,7 +563,7 @@ class Creature : public Unit, public GridObject, public MapCreature TrainerSpellData const* GetTrainerSpells() const; - CreatureTemplate const* GetCreatureInfo() const { return m_creatureInfo; } + CreatureTemplate const* GetCreatureTemplate() const { return m_creatureInfo; } CreatureData const* GetCreatureData() const { return m_creatureData; } CreatureAddon const* GetCreatureAddon() const; @@ -604,8 +607,8 @@ class Creature : public Unit, public GridObject, public MapCreature void RemoveLootMode(uint16 lootMode) { m_LootMode &= ~lootMode; } void ResetLootMode() { m_LootMode = LOOT_MODE_DEFAULT; } - SpellInfo const* reachWithSpellAttack(Unit* pVictim); - SpellInfo const* reachWithSpellCure(Unit* pVictim); + SpellInfo const* reachWithSpellAttack(Unit* victim); + SpellInfo const* reachWithSpellCure(Unit* victim); uint32 m_spells[CREATURE_MAX_SPELLS]; CreatureSpellCooldowns m_CreatureSpellCooldowns; @@ -634,7 +637,6 @@ class Creature : public Unit, public GridObject, public MapCreature void RemoveCorpse(bool setSpawnTime = true); - void ForcedDespawn(uint32 timeMSToDespawn = 0); void DespawnOrUnsummon(uint32 msTimeToDespawn = 0); time_t const& GetRespawnTime() const { return m_respawnTime; } @@ -762,6 +764,8 @@ class Creature : public Unit, public GridObject, public MapCreature bool IsInvisibleDueToDespawn() const; bool CanAlwaysSee(WorldObject const* obj) const; private: + void ForcedDespawn(uint32 timeMSToDespawn = 0); + //WaypointMovementGenerator vars uint32 m_waypointID; uint32 m_path_id; diff --git a/src/server/game/Entities/Creature/CreatureGroups.cpp b/src/server/game/Entities/Creature/CreatureGroups.cpp index f440fd497fc..54953ef5420 100755 --- a/src/server/game/Entities/Creature/CreatureGroups.cpp +++ b/src/server/game/Entities/Creature/CreatureGroups.cpp @@ -24,12 +24,13 @@ #define MAX_DESYNC 5.0f -CreatureGroupInfoType CreatureGroupMap; - -namespace FormationMgr +FormationMgr::~FormationMgr() { + for (CreatureGroupInfoType::iterator itr = CreatureGroupMap.begin(); itr != CreatureGroupMap.end(); ++itr) + delete itr->second; +} -void AddCreatureToGroup(uint32 groupId, Creature* member) +void FormationMgr::AddCreatureToGroup(uint32 groupId, Creature* member) { Map* map = member->FindMap(); if (!map) @@ -53,7 +54,7 @@ void AddCreatureToGroup(uint32 groupId, Creature* member) } } -void RemoveCreatureFromGroup(CreatureGroup* group, Creature* member) +void FormationMgr::RemoveCreatureFromGroup(CreatureGroup* group, Creature* member) { sLog->outDebug(LOG_FILTER_UNITS, "Deleting member pointer to GUID: %u from group %u", group->GetId(), member->GetDBTableGUIDLow()); group->RemoveMember(member); @@ -70,7 +71,7 @@ void RemoveCreatureFromGroup(CreatureGroup* group, Creature* member) } } -void LoadCreatureFormations() +void FormationMgr::LoadCreatureFormations() { uint32 oldMSTime = getMSTime(); @@ -97,10 +98,10 @@ void LoadCreatureFormations() fields = result->Fetch(); //Load group member data - group_member = new FormationInfo; + group_member = new FormationInfo(); group_member->leaderGUID = fields[0].GetUInt32(); uint32 memberGUID = fields[1].GetUInt32(); - group_member->groupAI = fields[4].GetUInt8(); + group_member->groupAI = fields[4].GetUInt32(); //If creature is group leader we may skip loading of dist/angle if (group_member->leaderGUID != memberGUID) { @@ -133,14 +134,12 @@ void LoadCreatureFormations() CreatureGroupMap[memberGUID] = group_member; ++count; } - while (result->NextRow()) ; + while (result->NextRow()); sLog->outString(">> Loaded %u creatures in formations in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); sLog->outString(); } -} // Namespace - void CreatureGroup::AddMember(Creature* member) { sLog->outDebug(LOG_FILTER_UNITS, "CreatureGroup::AddMember: Adding unit GUID: %u.", member->GetGUIDLow()); @@ -152,7 +151,7 @@ void CreatureGroup::AddMember(Creature* member) m_leader = member; } - m_members[member] = CreatureGroupMap.find(member->GetDBTableGUIDLow())->second; + m_members[member] = sFormationMgr->CreatureGroupMap.find(member->GetDBTableGUIDLow())->second; member->SetFormation(this); } @@ -167,7 +166,7 @@ void CreatureGroup::RemoveMember(Creature* member) void CreatureGroup::MemberAttackStart(Creature* member, Unit* target) { - uint8 groupAI = CreatureGroupMap[member->GetDBTableGUIDLow()]->groupAI; + uint8 groupAI = sFormationMgr->CreatureGroupMap[member->GetDBTableGUIDLow()]->groupAI; if (!groupAI) return; @@ -240,7 +239,7 @@ void CreatureGroup::LeaderMoveTo(float x, float y, float z) if (member->IsWithinDist(m_leader, dist + MAX_DESYNC)) member->SetUnitMovementFlags(m_leader->GetUnitMovementFlags()); else - member->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + member->SetWalk(false); member->GetMotionMaster()->MovePoint(0, dx, dy, dz); member->SetHomePosition(dx, dy, dz, pathangle); diff --git a/src/server/game/Entities/Creature/CreatureGroups.h b/src/server/game/Entities/Creature/CreatureGroups.h index 80e552f7e93..e5b8771ee40 100755 --- a/src/server/game/Entities/Creature/CreatureGroups.h +++ b/src/server/game/Entities/Creature/CreatureGroups.h @@ -34,16 +34,19 @@ struct FormationInfo uint8 groupAI; }; -namespace FormationMgr -{ - void AddCreatureToGroup(uint32 group_id, Creature* creature); - void RemoveCreatureFromGroup(CreatureGroup* group, Creature* creature); - void LoadCreatureFormations(); -}; - typedef UNORDERED_MAP CreatureGroupInfoType; -extern CreatureGroupInfoType CreatureGroupMap; +class FormationMgr +{ + friend class ACE_Singleton; + public: + FormationMgr() { } + ~FormationMgr(); + void AddCreatureToGroup(uint32 group_id, Creature* creature); + void RemoveCreatureFromGroup(CreatureGroup* group, Creature* creature); + void LoadCreatureFormations(); + CreatureGroupInfoType CreatureGroupMap; +}; class CreatureGroup { @@ -73,4 +76,6 @@ class CreatureGroup void MemberAttackStart(Creature* member, Unit* target); }; +#define sFormationMgr ACE_Singleton::instance() + #endif diff --git a/src/server/game/Entities/Creature/GossipDef.cpp b/src/server/game/Entities/Creature/GossipDef.cpp index 99150434c44..21c5aa38a19 100755 --- a/src/server/game/Entities/Creature/GossipDef.cpp +++ b/src/server/game/Entities/Creature/GossipDef.cpp @@ -47,10 +47,7 @@ void GossipMenu::AddMenuItem(int32 menuItemId, uint8 icon, std::string const& me for (GossipMenuItemContainer::const_iterator itr = _menuItems.begin(); itr != _menuItems.end(); ++itr) { if (int32(itr->first) > menuItemId) - { - menuItemId = menuItemId; break; - } menuItemId = itr->first + 1; } diff --git a/src/server/game/Entities/Creature/TemporarySummon.h b/src/server/game/Entities/Creature/TemporarySummon.h index fa1e134b1ac..829eb73bf80 100755 --- a/src/server/game/Entities/Creature/TemporarySummon.h +++ b/src/server/game/Entities/Creature/TemporarySummon.h @@ -107,4 +107,3 @@ private: TempSummon& m_owner; }; #endif - diff --git a/src/server/game/Entities/DynamicObject/DynamicObject.cpp b/src/server/game/Entities/DynamicObject/DynamicObject.cpp index 754caa5c774..8dcafa3b2ae 100755 --- a/src/server/game/Entities/DynamicObject/DynamicObject.cpp +++ b/src/server/game/Entities/DynamicObject/DynamicObject.cpp @@ -33,7 +33,7 @@ DynamicObject::DynamicObject(bool isWorldObject) : WorldObject(isWorldObject), m_objectType |= TYPEMASK_DYNAMICOBJECT; m_objectTypeId = TYPEID_DYNAMICOBJECT; - m_updateFlag = (UPDATEFLAG_HAS_POSITION | UPDATEFLAG_POSITION); + m_updateFlag = (UPDATEFLAG_STATIONARY_POSITION | UPDATEFLAG_POSITION); m_valuesCount = DYNAMICOBJECT_END; } @@ -92,7 +92,7 @@ bool DynamicObject::CreateDynamicObject(uint32 guidlow, Unit* caster, uint32 spe WorldObject::_Create(guidlow, HIGHGUID_DYNAMICOBJECT, caster->GetPhaseMask()); SetEntry(spellId); - SetFloatValue(OBJECT_FIELD_SCALE_X, 1); + SetObjectScale(1); SetUInt64Value(DYNAMICOBJECT_CASTER, caster->GetGUID()); // The lower word of DYNAMICOBJECT_BYTES must be 0x0001. This value means that the visual radius will be overriden @@ -116,7 +116,7 @@ bool DynamicObject::CreateDynamicObject(uint32 guidlow, Unit* caster, uint32 spe void DynamicObject::Update(uint32 p_time) { - // caster has to be always avalible and in the same map + // caster has to be always available and in the same map ASSERT(_caster); ASSERT(_caster->GetMap() == GetMap()); @@ -127,7 +127,7 @@ void DynamicObject::Update(uint32 p_time) if (!_aura->IsRemoved()) _aura->UpdateOwner(p_time, this); - // m_aura may be set to null in Aura::UpdateOwner call + // _aura may be set to null in Aura::UpdateOwner call if (_aura && (_aura->IsRemoved() || _aura->IsExpired())) expired = true; } diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index c04dd0b1941..7591359230a 100755 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -38,7 +38,7 @@ GameObject::GameObject() : WorldObject(false), m_model(NULL), m_goValue(new Game m_objectType |= TYPEMASK_GAMEOBJECT; m_objectTypeId = TYPEID_GAMEOBJECT; - m_updateFlag = (UPDATEFLAG_HAS_POSITION | UPDATEFLAG_POSITION | UPDATEFLAG_ROTATION); + m_updateFlag = (UPDATEFLAG_STATIONARY_POSITION | UPDATEFLAG_POSITION | UPDATEFLAG_ROTATION); m_valuesCount = GAMEOBJECT_END; m_respawnTime = 0; @@ -55,6 +55,8 @@ GameObject::GameObject() : WorldObject(false), m_model(NULL), m_goValue(new Game m_DBTableGuid = 0; m_rotation = 0; + m_lootRecipient = 0; + m_lootRecipientGroup = 0; m_groupLootTimer = 0; lootingGroupLowGUID = 0; @@ -132,10 +134,11 @@ void GameObject::AddToWorld() sObjectAccessor->AddObject(this); bool startOpen = (GetGoType() == GAMEOBJECT_TYPE_DOOR || GetGoType() == GAMEOBJECT_TYPE_BUTTON ? GetGOInfo()->door.startOpen : false); - bool toggledState = (GetGOData() ? GetGOData()->go_state == GO_STATE_ACTIVE : false); + // The state can be changed after GameObject::Create but before GameObject::AddToWorld + bool toggledState = GetGOData() ? GetGOData()->go_state == GO_STATE_READY : false; if (m_model) GetMap()->Insert(*m_model); - if ((startOpen && !toggledState) || (!startOpen && toggledState)) + if (startOpen ^ toggledState) EnableCollision(false); WorldObject::AddToWorld(); @@ -203,7 +206,7 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map* map, uint32 phaseMa UpdateRotationFields(rotation2, rotation3); // GAMEOBJECT_FACING, GAMEOBJECT_ROTATION, GAMEOBJECT_PARENTROTATION+2/3 - SetFloatValue(OBJECT_FIELD_SCALE_X, goinfo->size); + SetObjectScale(goinfo->size); SetUInt32Value(GAMEOBJECT_FACTION, goinfo->faction); SetUInt32Value(GAMEOBJECT_FLAGS, goinfo->flags); @@ -219,10 +222,7 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map* map, uint32 phaseMa // GAMEOBJECT_BYTES_1, index at 0, 1, 2 and 3 SetGoType(GameobjectTypes(goinfo->type)); SetGoState(go_state); - - SetGoArtKit(0); // unknown what this is - SetByteValue(GAMEOBJECT_BYTES_1, 2, artKit); - + SetGoArtKit(artKit); switch (goinfo->type) { @@ -252,7 +252,6 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map* map, uint32 phaseMa m_invisibility.AddFlag(INVISIBILITY_TRAP); m_invisibility.AddValue(INVISIBILITY_TRAP, 300); } - break; default: SetGoAnimProgress(animprogress); @@ -685,29 +684,34 @@ void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask) data.spawnMask = spawnMask; data.artKit = GetGoArtKit(); - // update in DB - std::ostringstream ss; - ss << "INSERT INTO gameobject VALUES (" - << m_DBTableGuid << ',' - << GetEntry() << ',' - << mapid << ',' - << uint32(spawnMask) << ',' // cast to prevent save as symbol - << uint16(GetPhaseMask()) << ',' // prevent out of range error - << GetPositionX() << ',' - << GetPositionY() << ',' - << GetPositionZ() << ',' - << GetOrientation() << ',' - << GetFloatValue(GAMEOBJECT_PARENTROTATION) << ',' - << GetFloatValue(GAMEOBJECT_PARENTROTATION+1) << ',' - << GetFloatValue(GAMEOBJECT_PARENTROTATION+2) << ',' - << GetFloatValue(GAMEOBJECT_PARENTROTATION+3) << ',' - << m_respawnDelayTime << ',' - << uint32(GetGoAnimProgress()) << ',' - << uint32(GetGoState()) << ')'; - + // Update in DB SQLTransaction trans = WorldDatabase.BeginTransaction(); - trans->PAppend("DELETE FROM gameobject WHERE guid = '%u'", m_DBTableGuid); - trans->Append(ss.str().c_str()); + + uint8 index = 0; + + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_GAMEOBJECT); + stmt->setUInt32(0, m_DBTableGuid); + trans->Append(stmt); + + stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_GAMEOBJECT); + stmt->setUInt32(index++, m_DBTableGuid); + stmt->setUInt32(index++, GetEntry()); + stmt->setUInt16(index++, uint16(mapid)); + stmt->setUInt8(index++, spawnMask); + stmt->setUInt16(index++, uint16(GetPhaseMask())); + stmt->setFloat(index++, GetPositionX()); + stmt->setFloat(index++, GetPositionY()); + stmt->setFloat(index++, GetPositionZ()); + stmt->setFloat(index++, GetOrientation()); + stmt->setFloat(index++, GetFloatValue(GAMEOBJECT_PARENTROTATION)); + stmt->setFloat(index++, GetFloatValue(GAMEOBJECT_PARENTROTATION+1)); + stmt->setFloat(index++, GetFloatValue(GAMEOBJECT_PARENTROTATION+2)); + stmt->setFloat(index++, GetFloatValue(GAMEOBJECT_PARENTROTATION+3)); + stmt->setInt32(index++, int32(m_respawnDelayTime)); + stmt->setUInt8(index++, GetGoAnimProgress()); + stmt->setUInt8(index++, uint8(GetGoState())); + trans->Append(stmt); + WorldDatabase.CommitTransaction(trans); } @@ -834,7 +838,9 @@ bool GameObject::IsTransport() const { // If something is marked as a transport, don't transmit an out of range packet for it. GameObjectTemplate const* gInfo = GetGOInfo(); - if (!gInfo) return false; + if (!gInfo) + return false; + return gInfo->type == GAMEOBJECT_TYPE_TRANSPORT || gInfo->type == GAMEOBJECT_TYPE_MO_TRANSPORT; } @@ -843,7 +849,9 @@ bool GameObject::IsDynTransport() const { // If something is marked as a transport, don't transmit an out of range packet for it. GameObjectTemplate const* gInfo = GetGOInfo(); - if (!gInfo) return false; + if (!gInfo) + return false; + return gInfo->type == GAMEOBJECT_TYPE_MO_TRANSPORT || (gInfo->type == GAMEOBJECT_TYPE_TRANSPORT && !gInfo->transport.pause); } @@ -1422,7 +1430,7 @@ void GameObject::Use(Unit* user) if (info->summoningRitual.casterTargetSpell && info->summoningRitual.casterTargetSpell != 1) // No idea why this field is a bool in some cases for (uint32 i = 0; i < info->summoningRitual.casterTargetSpellTargets; i++) // m_unique_users can contain only player GUIDs - if (Player* target = ObjectAccessor::GetPlayer(*this, SelectRandomContainerElement(m_unique_users))) + if (Player* target = ObjectAccessor::GetPlayer(*this, Trinity::Containers::SelectRandomContainerElement(m_unique_users))) spellCaster->CastSpell(target, info->summoningRitual.casterTargetSpell, true); // finish owners spell @@ -1666,7 +1674,7 @@ void GameObject::CastSpell(Unit* target, uint32 spellId) else { trigger->setFaction(14); - // Set owner guid for target if no owner avalible - needed by trigger auras + // Set owner guid for target if no owner available - needed by trigger auras // - trigger gets despawned and there's no caster avalible (see AuraEffect::TriggerSpell()) trigger->CastSpell(target ? target : trigger, spellInfo, true, 0, 0, target ? target->GetGUID() : 0); } @@ -1815,6 +1823,7 @@ void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player* m_goValue->Building.Health = m_goValue->Building.MaxHealth; SetGoAnimProgress(255); } + EnableCollision(true); break; case GO_DESTRUCTIBLE_DAMAGED: { @@ -1871,6 +1880,7 @@ void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player* m_goValue->Building.Health = 0; SetGoAnimProgress(0); } + EnableCollision(false); break; } case GO_DESTRUCTIBLE_REBUILDING: @@ -1890,6 +1900,7 @@ void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player* m_goValue->Building.Health = m_goValue->Building.MaxHealth; SetGoAnimProgress(255); } + EnableCollision(true); break; } } @@ -1899,12 +1910,14 @@ void GameObject::SetLootState(LootState state, Unit* unit) { m_lootState = state; AI()->OnStateChanged(state, unit); + sScriptMgr->OnGameObjectLootStateChanged(this, state, unit); if (m_model) { // startOpen determines whether we are going to add or remove the LoS on activation bool startOpen = (GetGoType() == GAMEOBJECT_TYPE_DOOR || GetGoType() == GAMEOBJECT_TYPE_BUTTON ? GetGOInfo()->door.startOpen : false); - if (GetGOData() && GetGOData()->go_state == GO_NOT_READY) + // Use the current go state + if (GetGoState() == GO_STATE_ACTIVE) startOpen = !startOpen; if (state == GO_ACTIVATED || state == GO_JUST_DEACTIVATED) @@ -1917,6 +1930,7 @@ void GameObject::SetLootState(LootState state, Unit* unit) void GameObject::SetGoState(GOState state) { SetByteValue(GAMEOBJECT_BYTES_1, 0, state); + sScriptMgr->OnGameObjectStateChanged(this, state); if (m_model) { if (!IsInWorld()) @@ -1925,7 +1939,7 @@ void GameObject::SetGoState(GOState state) // startOpen determines whether we are going to add or remove the LoS on activation bool startOpen = (GetGoType() == GAMEOBJECT_TYPE_DOOR || GetGoType() == GAMEOBJECT_TYPE_BUTTON ? GetGOInfo()->door.startOpen : false); - if (GetGOData() && GetGOData()->go_state == GO_NOT_READY) + if (GetGOData() && GetGOData()->go_state == GO_STATE_READY) startOpen = !startOpen; if (state == GO_STATE_ACTIVE || state == GO_STATE_ACTIVE_ALTERNATIVE) @@ -1970,3 +1984,57 @@ void GameObject::UpdateModel() if (m_model) GetMap()->Insert(*m_model); } + +Player* GameObject::GetLootRecipient() const +{ + if (!m_lootRecipient) + return NULL; + return ObjectAccessor::FindPlayer(m_lootRecipient); +} + +Group* GameObject::GetLootRecipientGroup() const +{ + if (!m_lootRecipientGroup) + return NULL; + return sGroupMgr->GetGroupByGUID(m_lootRecipientGroup); +} + +void GameObject::SetLootRecipient(Unit* unit) +{ + // set the player whose group should receive the right + // to loot the creature after it dies + // should be set to NULL after the loot disappears + + if (!unit) + { + m_lootRecipient = 0; + m_lootRecipientGroup = 0; + return; + } + + if (unit->GetTypeId() != TYPEID_PLAYER && !unit->IsVehicle()) + return; + + Player* player = unit->GetCharmerOrOwnerPlayerOrPlayerItself(); + if (!player) // normal creature, no player involved + return; + + m_lootRecipient = player->GetGUID(); + if (Group* group = player->GetGroup()) + m_lootRecipientGroup = group->GetLowGUID(); +} + +bool GameObject::IsLootAllowedFor(Player const* player) const +{ + if (!m_lootRecipient && !m_lootRecipientGroup) + return true; + + if (player->GetGUID() == m_lootRecipient) + return true; + + Group const* playerGroup = player->GetGroup(); + if (!playerGroup || playerGroup != GetLootRecipientGroup()) // if we dont have a group we arent the recipient + return false; // if go doesnt have group bound it means it was solo killed by someone else + + return true; +} diff --git a/src/server/game/Entities/GameObject/GameObject.h b/src/server/game/Entities/GameObject/GameObject.h index 2e40d45541c..80aaf1c933f 100755 --- a/src/server/game/Entities/GameObject/GameObject.h +++ b/src/server/game/Entities/GameObject/GameObject.h @@ -403,7 +403,6 @@ struct GameObjectTemplate } raw; }; - std::string AIName; uint32 ScriptId; @@ -732,7 +731,9 @@ class GameObject : public WorldObject, public GridObject bool IsInSkillupList(uint32 PlayerGuidLow) const { for (std::list::const_iterator i = m_SkillupList.begin(); i != m_SkillupList.end(); ++i) - if (*i == PlayerGuidLow) return true; + if (*i == PlayerGuidLow) + return true; + return false; } void ClearSkillupList() { m_SkillupList.clear(); } @@ -747,6 +748,11 @@ class GameObject : public WorldObject, public GridObject Loot loot; + Player* GetLootRecipient() const; + Group* GetLootRecipientGroup() const; + void SetLootRecipient(Unit* unit); + bool IsLootAllowedFor(Player const* player) const; + bool HasLootRecipient() const { return m_lootRecipient || m_lootRecipientGroup; } uint32 m_groupLootTimer; // (msecs)timer used for group loot uint32 lootingGroupLowGUID; // used to find group which is looting @@ -823,6 +829,8 @@ class GameObject : public WorldObject, public GridObject uint64 m_rotation; + uint64 m_lootRecipient; + uint32 m_lootRecipientGroup; uint16 m_LootMode; // bitmask, default LOOT_MODE_DEFAULT, determines what loot will be lootable private: void RemoveFromOwner(); diff --git a/src/server/game/Entities/Item/Container/Bag.cpp b/src/server/game/Entities/Item/Container/Bag.cpp index 4eede93bd37..c4d4adeb6f2 100755 --- a/src/server/game/Entities/Item/Container/Bag.cpp +++ b/src/server/game/Entities/Item/Container/Bag.cpp @@ -78,7 +78,7 @@ bool Bag::Create(uint32 guidlow, uint32 itemid, Player const* owner) Object::_Create(guidlow, 0, HIGHGUID_CONTAINER); SetEntry(itemid); - SetFloatValue(OBJECT_FIELD_SCALE_X, 1.0f); + SetObjectScale(1.0f); SetUInt64Value(ITEM_FIELD_OWNER, owner ? owner->GetGUID() : 0); SetUInt64Value(ITEM_FIELD_CONTAINED, owner ? owner->GetGUID() : 0); diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index b5e39fe19af..d973c3ba4f8 100755 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -56,8 +56,7 @@ void AddItemsSetItem(Player* player, Item* item) if (!eff) { - eff = new ItemSetEffect; - memset(eff, 0, sizeof(ItemSetEffect)); + eff = new ItemSetEffect(); eff->setid = setid; size_t x = 0; @@ -259,7 +258,7 @@ bool Item::Create(uint32 guidlow, uint32 itemid, Player const* owner) Object::_Create(guidlow, 0, HIGHGUID_ITEM); SetEntry(itemid); - SetFloatValue(OBJECT_FIELD_SCALE_X, 1.0f); + SetObjectScale(1.0f); SetUInt64Value(ITEM_FIELD_OWNER, owner ? owner->GetGUID() : 0); SetUInt64Value(ITEM_FIELD_CONTAINED, owner ? owner->GetGUID() : 0); @@ -344,8 +343,8 @@ void Item::SaveToDB(SQLTransaction& trans) } stmt->setString(++index, ssEnchants.str()); - stmt->setInt32 (++index, GetItemRandomPropertyId()); - stmt->setUInt32(++index, GetUInt32Value(ITEM_FIELD_DURABILITY)); + stmt->setInt16 (++index, GetItemRandomPropertyId()); + stmt->setUInt16(++index, GetUInt32Value(ITEM_FIELD_DURABILITY)); stmt->setUInt32(++index, GetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME)); stmt->setString(++index, m_text); stmt->setUInt32(++index, guid); @@ -401,7 +400,7 @@ bool Item::LoadFromDB(uint32 guid, uint64 owner_guid, Field* fields, uint32 entr // Set entry, MUST be before proto check SetEntry(entry); - SetFloatValue(OBJECT_FIELD_SCALE_X, 1.0f); + SetObjectScale(1.0f); ItemTemplate const* proto = GetTemplate(); if (!proto) @@ -487,7 +486,7 @@ void Item::DeleteFromDB(SQLTransaction& trans) /*static*/ void Item::DeleteFromInventoryDB(SQLTransaction& trans, uint32 itemGuid) { - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVENTORY_ITEM); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INVENTORY_BY_ITEM); stmt->setUInt32(0, itemGuid); trans->Append(stmt); } @@ -766,7 +765,7 @@ bool Item::CanBeTraded(bool mail, bool trade) const if (Player* owner = GetOwner()) { - if (owner->CanUnequipItem(GetPos(), false) != EQUIP_ERR_OK) + if (owner->CanUnequipItem(GetPos(), false) != EQUIP_ERR_OK) return false; if (owner->GetLootGUID() == GetGUID()) return false; @@ -780,30 +779,28 @@ bool Item::CanBeTraded(bool mail, bool trade) const bool Item::HasEnchantRequiredSkill(const Player* player) const { - - // Check all enchants for required skill - for (uint32 enchant_slot = PERM_ENCHANTMENT_SLOT; enchant_slot < MAX_ENCHANTMENT_SLOT; ++enchant_slot) - if (uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot))) - if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id)) - if (enchantEntry->requiredSkill && player->GetSkillValue(enchantEntry->requiredSkill) < enchantEntry->requiredSkillValue) - return false; + // Check all enchants for required skill + for (uint32 enchant_slot = PERM_ENCHANTMENT_SLOT; enchant_slot < MAX_ENCHANTMENT_SLOT; ++enchant_slot) + if (uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot))) + if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id)) + if (enchantEntry->requiredSkill && player->GetSkillValue(enchantEntry->requiredSkill) < enchantEntry->requiredSkillValue) + return false; return true; } uint32 Item::GetEnchantRequiredLevel() const { + uint32 level = 0; - uint32 level = 0; - - // Check all enchants for required level - for (uint32 enchant_slot = PERM_ENCHANTMENT_SLOT; enchant_slot < MAX_ENCHANTMENT_SLOT; ++enchant_slot) - if (uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot))) - if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id)) - if (enchantEntry->requiredLevel > level) - level = enchantEntry->requiredLevel; + // Check all enchants for required level + for (uint32 enchant_slot = PERM_ENCHANTMENT_SLOT; enchant_slot < MAX_ENCHANTMENT_SLOT; ++enchant_slot) + if (uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot))) + if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id)) + if (enchantEntry->requiredLevel > level) + level = enchantEntry->requiredLevel; - return level; + return level; } bool Item::IsBoundByEnchant() const @@ -861,7 +858,7 @@ bool Item::IsFitToSpellRequirements(SpellInfo const* spellInfo) const // Special case - accept weapon type for main and offhand requirements if (proto->InventoryType == INVTYPE_WEAPON && (spellInfo->EquippedItemInventoryTypeMask & (1 << INVTYPE_WEAPONMAINHAND) || - spellInfo->EquippedItemInventoryTypeMask & (1 << INVTYPE_WEAPONOFFHAND))) + spellInfo->EquippedItemInventoryTypeMask & (1 << INVTYPE_WEAPONOFFHAND))) return true; else if ((spellInfo->EquippedItemInventoryTypeMask & (1 << proto->InventoryType)) == 0) return false; // inventory type not present in mask @@ -1001,12 +998,13 @@ bool Item::IsLimitedToAnotherMapOrZone(uint32 cur_mapId, uint32 cur_zoneId) cons // time. void Item::SendTimeUpdate(Player* owner) { - if (!GetUInt32Value(ITEM_FIELD_DURATION)) + uint32 duration = GetUInt32Value(ITEM_FIELD_DURATION); + if (!duration) return; WorldPacket data(SMSG_ITEM_TIME_UPDATE, (8+4)); - data << (uint64)GetGUID(); - data << (uint32)GetUInt32Value(ITEM_FIELD_DURATION); + data << uint64(GetGUID()); + data << uint32(duration); owner->GetSession()->SendPacket(&data); } @@ -1084,16 +1082,30 @@ void Item::BuildUpdate(UpdateDataMapType& data_map) void Item::SaveRefundDataToDB() { SQLTransaction trans = CharacterDatabase.BeginTransaction(); - trans->PAppend("DELETE FROM item_refund_instance WHERE item_guid = '%u'", GetGUIDLow()); - trans->PAppend("INSERT INTO item_refund_instance (`item_guid`, `player_guid`, `paidMoney`, `paidExtendedCost`)" - " VALUES('%u', '%u', '%u', '%u')", GetGUIDLow(), GetRefundRecipient(), GetPaidMoney(), GetPaidExtendedCost()); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_REFUND_INSTANCE); + stmt->setUInt32(0, GetGUIDLow()); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_ITEM_REFUND_INSTANCE); + stmt->setUInt32(0, GetGUIDLow()); + stmt->setUInt32(1, GetRefundRecipient()); + stmt->setUInt32(2, GetPaidMoney()); + stmt->setUInt16(3, uint16(GetPaidExtendedCost())); + trans->Append(stmt); + CharacterDatabase.CommitTransaction(trans); } void Item::DeleteRefundDataFromDB(SQLTransaction* trans) { if (trans && !trans->null()) - (*trans)->PAppend("DELETE FROM item_refund_instance WHERE item_guid = '%u'", GetGUIDLow()); + { + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_REFUND_INSTANCE); + stmt->setUInt32(0, GetGUIDLow()); + (*trans)->Append(stmt); + + } } void Item::SetNotRefundable(Player* owner, bool changestate /*=true*/, SQLTransaction* trans /*=NULL*/) diff --git a/src/server/game/Entities/Item/Item.h b/src/server/game/Entities/Item/Item.h index 4887afc2b8a..54570e9b708 100755 --- a/src/server/game/Entities/Item/Item.h +++ b/src/server/game/Entities/Item/Item.h @@ -213,7 +213,7 @@ class Item : public Object static Item* CreateItem(uint32 item, uint32 count, Player const* player = NULL); Item* CloneItem(uint32 count, Player const* player = NULL) const; - Item (); + Item(); virtual bool Create(uint32 guidlow, uint32 itemid, Player const* owner); diff --git a/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp b/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp index b8eaf043b1f..f3d7d7fd56c 100755 --- a/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp +++ b/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp @@ -49,6 +49,7 @@ void LoadRandomEnchantmentsTable() RandomItemEnch.clear(); // for reload case + // 0 1 2 QueryResult result = WorldDatabase.Query("SELECT entry, ench, chance FROM item_enchantment_template"); if (result) @@ -101,18 +102,20 @@ uint32 GetItemEnchantMod(int32 entry) { fCount += ench_iter->chance; - if (fCount > dRoll) return ench_iter->ench; + if (fCount > dRoll) + return ench_iter->ench; } //we could get here only if sum of all enchantment chances is lower than 100% - dRoll = (irand(0, (int)floor(fCount * 100) + 1)) / 100; + dRoll = (irand(0, (int)floor(fCount * 100) + 1)) / 100; fCount = 0; for (EnchStoreList::const_iterator ench_iter = tab->second.begin(); ench_iter != tab->second.end(); ++ench_iter) { fCount += ench_iter->chance; - if (fCount > dRoll) return ench_iter->ench; + if (fCount > dRoll) + return ench_iter->ench; } return 0; diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index f1d0dd5a506..d21ae63be45 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -197,7 +197,7 @@ void Object::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) c if (target == this) // building packet for yourself flags |= UPDATEFLAG_SELF; - if (flags & UPDATEFLAG_HAS_POSITION) + if (flags & UPDATEFLAG_STATIONARY_POSITION) { // UPDATETYPE_CREATE_OBJECT2 dynamic objects, corpses... if (isType(TYPEMASK_DYNAMICOBJECT) || isType(TYPEMASK_CORPSE) || isType(TYPEMASK_PLAYER)) @@ -281,19 +281,21 @@ void Object::BuildOutOfRangeUpdateBlock(UpdateData* data) const data->AddOutOfRangeGUID(GetGUID()); } -void Object::DestroyForPlayer(Player* target, bool anim) const +void Object::DestroyForPlayer(Player* target, bool onDeath) const { ASSERT(target); WorldPacket data(SMSG_DESTROY_OBJECT, 8 + 1); data << uint64(GetGUID()); - data << uint8(anim ? 1 : 0); // WotLK (bool), may be despawn animation + //! If the following bool is true, the client will call "void CGUnit_C::OnDeath()" for this object. + //! OnDeath() does for eg trigger death animation and interrupts certain spells/missiles/auras/sounds... + data << uint8(onDeath ? 1 : 0); target->GetSession()->SendPacket(&data); } -void Object::_BuildMovementUpdate(ByteBuffer * data, uint16 flags) const +void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const { - *data << (uint16)flags; // update flags + *data << uint16(flags); // update flags // 0x20 if (flags & UPDATEFLAG_LIVING) @@ -320,13 +322,37 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint16 flags) const WorldObject* worldObj = ((WorldObject*)this); if (flags & UPDATEFLAG_POSITION) { - *data << uint8(0); // unk PGUID! - *data << worldObj->GetPositionX(); - *data << worldObj->GetPositionY(); - *data << worldObj->GetPositionZ(); + Transport* transport = worldObj->GetTransport(); + if (transport) + data->append(transport->GetPackGUID()); + else + *data << uint8(0); + *data << worldObj->GetPositionX(); *data << worldObj->GetPositionY(); *data << worldObj->GetPositionZ(); + *data << worldObj->GetOrientation(); + if (isType(TYPEMASK_UNIT)) + *data << ((Unit*)this)->GetPositionZMinusOffset(); + else + *data << worldObj->GetPositionZ(); + + if (transport) + { + *data << worldObj->GetTransOffsetX(); + *data << worldObj->GetTransOffsetY(); + *data << worldObj->GetTransOffsetZ(); + } + else + { + *data << worldObj->GetPositionX(); + *data << worldObj->GetPositionY(); + if (isType(TYPEMASK_UNIT)) + *data << ((Unit*)this)->GetPositionZMinusOffset(); + else + *data << worldObj->GetPositionZ(); + } + *data << worldObj->GetOrientation(); if (GetTypeId() == TYPEID_CORPSE) @@ -337,31 +363,23 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint16 flags) const else { // 0x40 - if (flags & UPDATEFLAG_HAS_POSITION) + if (flags & UPDATEFLAG_STATIONARY_POSITION) { - // 0x02 - if (flags & UPDATEFLAG_TRANSPORT && ((GameObject*)this)->GetGoType() == GAMEOBJECT_TYPE_MO_TRANSPORT) - { - *data << (float)0; - *data << (float)0; - *data << (float)0; - *data << worldObj->GetOrientation(); - } + *data << worldObj->GetPositionX(); + *data << worldObj->GetPositionY(); + if (isType(TYPEMASK_UNIT)) + *data << ((Unit*)this)->GetPositionZMinusOffset(); else - { - *data << worldObj->GetPositionX(); - *data << worldObj->GetPositionY(); *data << worldObj->GetPositionZ(); - *data << worldObj->GetOrientation(); - } + *data << worldObj->GetOrientation(); } } } // 0x4 - if (flags & UPDATEFLAG_HAS_TARGET) // packed guid (current target guid) + if (flags & UPDATEFLAG_HAS_TARGET) { - if (Unit *victim = this->ToUnit()->getVictim()) + if (Unit* victim = this->ToUnit()->getVictim()) data->append(victim->GetPackGUID()); else *data << uint8(0); @@ -369,13 +387,14 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint16 flags) const // 0x2 if (flags & UPDATEFLAG_TRANSPORT) - *data << uint32(getMSTime()); // ms time + *data << uint32(getMSTime()); // Unknown - getMSTime is wrong. // 0x80 - if (flags & UPDATEFLAG_VEHICLE) // unused for now + if (flags & UPDATEFLAG_VEHICLE) { - *data << uint32(((Unit*)this)->GetVehicleKit()->GetVehicleInfo()->m_ID); // vehicle id - *data << float(((Creature*)this)->GetOrientation()); // facing adjustment + // TODO: Allow players to aquire this updateflag. + *data << uint32(((Unit*)this)->GetVehicleKit()->GetVehicleInfo()->m_ID); + *data << float(((Creature*)this)->GetOrientation()); } // 0x800 - AnimKits @@ -427,6 +446,10 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask* } updateMask->SetBit(GAMEOBJECT_DYNAMIC); updateMask->SetBit(GAMEOBJECT_BYTES_1); + + if (ToGameObject()->GetGoType() == GAMEOBJECT_TYPE_CHEST && ToGameObject()->GetGOInfo()->chest.groupLootRules && + ToGameObject()->HasLootRecipient()) + updateMask->SetBit(GAMEOBJECT_FLAGS); } else if (isType(TYPEMASK_UNIT)) { @@ -500,7 +523,7 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask* { if (GetTypeId() == TYPEID_UNIT) { - CreatureTemplate const* cinfo = ToCreature()->GetCreatureInfo(); + CreatureTemplate const* cinfo = ToCreature()->GetCreatureTemplate(); // this also applies for transform auras if (SpellInfo const* transform = sSpellMgr->GetSpellInfo(ToUnit()->getTransForm())) @@ -540,7 +563,7 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask* { uint32 dynamicFlags = m_uint32Values[index]; - if (const Creature* creature = ToCreature()) + if (Creature const* creature = ToCreature()) { if (creature->hasLootRecipient()) { @@ -564,6 +587,11 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask* dynamicFlags &= ~UNIT_DYNFLAG_LOOTABLE; } + // unit UNIT_DYNFLAG_TRACK_UNIT should only be sent to caster of SPELL_AURA_MOD_STALKED auras + if (Unit const* unit = ToUnit()) + if (dynamicFlags & UNIT_DYNFLAG_TRACK_UNIT) + if (!unit->HasAuraTypeWithCaster(SPELL_AURA_MOD_STALKED, target->GetGUID())) + dynamicFlags &= ~UNIT_DYNFLAG_TRACK_UNIT; *data << dynamicFlags; } // FG: pretend that OTHER players in own group are friendly ("blue") @@ -650,6 +678,15 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask* *data << uint16(-1); } } + else if (index == GAMEOBJECT_FLAGS) + { + uint32 flags = m_uint32Values[index]; + if (ToGameObject()->GetGoType() == GAMEOBJECT_TYPE_CHEST) + if (ToGameObject()->GetGOInfo()->chest.groupLootRules && !ToGameObject()->IsLootAllowedFor(target)) + flags |= GO_FLAG_LOCKED | GO_FLAG_NOT_SELECTABLE; + + *data << flags; + } else *data << m_uint32Values[index]; // other cases } @@ -1114,7 +1151,7 @@ void MovementInfo::OutDebug() sLog->outString("pitch: %f", pitch); sLog->outString("fallTime: %u", fallTime); - if (flags & MOVEMENTFLAG_JUMPING) + if (flags & MOVEMENTFLAG_FALLING) sLog->outString("j_zspeed: %f j_sinAngle: %f j_cosAngle: %f j_xyspeed: %f", j_zspeed, j_sinAngle, j_cosAngle, j_xyspeed); if (flags & MOVEMENTFLAG_SPLINE_ELEVATION) @@ -1385,7 +1422,9 @@ void Position::GetPositionOffsetTo(const Position & endPos, Position & retOffset float Position::GetAngle(const Position* obj) const { - if (!obj) return 0; + if (!obj) + return 0; + return GetAngle(obj->GetPositionX(), obj->GetPositionY()); } @@ -1436,7 +1475,7 @@ bool Position::HasInArc(float arc, const Position* obj) const if (angle > M_PI) angle -= 2.0f*M_PI; - float lborder = -1 * (arc/2.0f); // in range -pi..0 + float lborder = -1 * (arc/2.0f); // in range -pi..0 float rborder = (arc/2.0f); // in range 0..pi return ((angle >= lborder) && (angle <= rborder)); } @@ -1507,7 +1546,7 @@ void WorldObject::UpdateAllowedPositionZ(float x, float y, float &z) const { // non fly unit don't must be in air // non swim unit must be at ground (mostly speedup, because it don't must be in water and water level check less fast - if (!ToCreature()->canFly()) + if (!ToCreature()->CanFly()) { bool canSwim = ToCreature()->canSwim(); float ground_z = z; @@ -1533,7 +1572,7 @@ void WorldObject::UpdateAllowedPositionZ(float x, float y, float &z) const case TYPEID_PLAYER: { // for server controlled moves playr work same as creature (but it can always swim) - if (!ToPlayer()->canFly()) + if (!ToPlayer()->CanFly()) { float ground_z = z; float max_z = GetBaseMap()->GetWaterOrGroundLevel(x, y, z, &ground_z, !ToUnit()->HasAuraType(SPELL_AURA_WATER_WALK)); @@ -1556,7 +1595,7 @@ void WorldObject::UpdateAllowedPositionZ(float x, float y, float &z) const default: { float ground_z = GetBaseMap()->GetHeight(GetPhaseMask(), x, y, z, true); - if(ground_z > INVALID_HEIGHT) + if (ground_z > INVALID_HEIGHT) z = ground_z; break; } @@ -2618,8 +2657,42 @@ void WorldObject::GetNearPoint(WorldObject const* /*searcher*/, float &x, float void WorldObject::MovePosition(Position &pos, float dist, float angle) { angle += m_orientation; - pos.m_positionX += dist * cos(angle); - pos.m_positionY += dist * sin(angle); + float destx, desty, destz, ground, floor; + destx = pos.m_positionX + dist * cos(angle); + desty = pos.m_positionY + dist * sin(angle); + + // Prevent invalid coordinates here, position is unchanged + if (!Trinity::IsValidMapCoord(destx, desty)) + { + sLog->outCrash("WorldObject::MovePosition invalid coordinates X: %f and Y: %f were passed!", destx, desty); + return; + } + + ground = GetMap()->GetHeight(GetPhaseMask(), destx, desty, MAX_HEIGHT, true); + floor = GetMap()->GetHeight(GetPhaseMask(), destx, desty, pos.m_positionZ, true); + destz = fabs(ground - pos.m_positionZ) <= fabs(floor - pos.m_positionZ) ? ground : floor; + + float step = dist/10.0f; + + for (uint8 j = 0; j < 10; ++j) + { + // do not allow too big z changes + if (fabs(pos.m_positionZ - destz) > 6) + { + destx -= step * cos(angle); + desty -= step * sin(angle); + ground = GetMap()->GetHeight(GetPhaseMask(), destx, desty, MAX_HEIGHT, true); + floor = GetMap()->GetHeight(GetPhaseMask(), destx, desty, pos.m_positionZ, true); + destz = fabs(ground - pos.m_positionZ) <= fabs(floor - pos.m_positionZ) ? ground : floor; + } + // we have correct destz now + else + { + pos.Relocate(destx, desty, destz); + break; + } + } + Trinity::NormalizeMapCoord(pos.m_positionX); Trinity::NormalizeMapCoord(pos.m_positionY); UpdateGroundPositionZ(pos.m_positionX, pos.m_positionY, pos.m_positionZ); @@ -2633,6 +2706,14 @@ void WorldObject::MovePositionToFirstCollision(Position &pos, float dist, float pos.m_positionZ += 2.0f; destx = pos.m_positionX + dist * cos(angle); desty = pos.m_positionY + dist * sin(angle); + + // Prevent invalid coordinates here, position is unchanged + if (!Trinity::IsValidMapCoord(destx, desty)) + { + sLog->outCrash("WorldObject::MovePositionToFirstCollision invalid coordinates X: %f and Y: %f were passed!", destx, desty); + return; + } + ground = GetMap()->GetHeight(GetPhaseMask(), destx, desty, MAX_HEIGHT, true); floor = GetMap()->GetHeight(GetPhaseMask(), destx, desty, pos.m_positionZ, true); destz = fabs(ground - pos.m_positionZ) <= fabs(floor - pos.m_positionZ) ? ground : floor; diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index 54f64f8da38..0d18a47885f 100755 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -122,7 +122,7 @@ typedef UNORDERED_MAP UpdateDataMapType; class Object { public: - virtual ~Object (); + virtual ~Object(); bool IsInWorld() const { return m_inWorld; } @@ -137,6 +137,8 @@ class Object uint32 GetEntry() const { return GetUInt32Value(OBJECT_FIELD_ENTRY); } void SetEntry(uint32 entry) { SetUInt32Value(OBJECT_FIELD_ENTRY, entry); } + void SetObjectScale(float scale) { SetFloatValue(OBJECT_FIELD_SCALE_X, scale); } + TypeID GetTypeId() const { return m_objectTypeId; } bool isType(uint16 mask) const { return (mask & m_objectType); } @@ -146,7 +148,7 @@ class Object void BuildValuesUpdateBlockForPlayer(UpdateData* data, Player* target) const; void BuildOutOfRangeUpdateBlock(UpdateData* data) const; - virtual void DestroyForPlayer(Player* target, bool anim = false) const; + virtual void DestroyForPlayer(Player* target, bool onDeath = false) const; int32 GetInt32Value(uint16 index) const { @@ -226,7 +228,9 @@ class Object bool HasFlag(uint16 index, uint32 flag) const { - if (index >= m_valuesCount && !PrintIndexError(index, false)) return false; + if (index >= m_valuesCount && !PrintIndexError(index, false)) + return false; + return (m_uint32Values[index] & flag) != 0; } @@ -298,21 +302,21 @@ class Object // FG: some hacky helpers void ForceValuesUpdateAtIndex(uint32); - Player* ToPlayer(){ if (GetTypeId() == TYPEID_PLAYER) return reinterpret_cast(this); else return NULL; } - const Player* ToPlayer() const { if (GetTypeId() == TYPEID_PLAYER) return (const Player*)((Player*)this); else return NULL; } - Creature* ToCreature(){ if (GetTypeId() == TYPEID_UNIT) return reinterpret_cast(this); else return NULL; } - const Creature* ToCreature() const {if (GetTypeId() == TYPEID_UNIT) return (const Creature*)((Creature*)this); else return NULL; } + Player* ToPlayer() { if (GetTypeId() == TYPEID_PLAYER) return reinterpret_cast(this); else return NULL; } + Player const* ToPlayer() const { if (GetTypeId() == TYPEID_PLAYER) return (Player const*)((Player*)this); else return NULL; } + Creature* ToCreature() { if (GetTypeId() == TYPEID_UNIT) return reinterpret_cast(this); else return NULL; } + Creature const* ToCreature() const { if (GetTypeId() == TYPEID_UNIT) return (Creature const*)((Creature*)this); else return NULL; } - Unit* ToUnit(){ if (GetTypeId() == TYPEID_UNIT || GetTypeId() == TYPEID_PLAYER) return reinterpret_cast(this); else return NULL; } - const Unit* ToUnit() const {if (GetTypeId() == TYPEID_UNIT || GetTypeId() == TYPEID_PLAYER) return (const Unit*)((Unit*)this); else return NULL; } - GameObject* ToGameObject(){ if (GetTypeId() == TYPEID_GAMEOBJECT) return reinterpret_cast(this); else return NULL; } - const GameObject* ToGameObject() const {if (GetTypeId() == TYPEID_GAMEOBJECT) return (const GameObject*)((GameObject*)this); else return NULL; } + Unit* ToUnit() { if (GetTypeId() == TYPEID_UNIT || GetTypeId() == TYPEID_PLAYER) return reinterpret_cast(this); else return NULL; } + Unit const* ToUnit() const { if (GetTypeId() == TYPEID_UNIT || GetTypeId() == TYPEID_PLAYER) return (const Unit*)((Unit*)this); else return NULL; } + GameObject* ToGameObject() { if (GetTypeId() == TYPEID_GAMEOBJECT) return reinterpret_cast(this); else return NULL; } + GameObject const* ToGameObject() const { if (GetTypeId() == TYPEID_GAMEOBJECT) return (const GameObject*)((GameObject*)this); else return NULL; } - Corpse* ToCorpse(){ if (GetTypeId() == TYPEID_CORPSE) return reinterpret_cast(this); else return NULL; } - const Corpse* ToCorpse() const {if (GetTypeId() == TYPEID_CORPSE) return (const Corpse*)((Corpse*)this); else return NULL; } + Corpse* ToCorpse() { if (GetTypeId() == TYPEID_CORPSE) return reinterpret_cast(this); else return NULL; } + Corpse const* ToCorpse() const { if (GetTypeId() == TYPEID_CORPSE) return (const Corpse*)((Corpse*)this); else return NULL; } protected: - Object (); + Object(); void _InitValues(); void _Create (uint32 guidlow, uint32 entry, HighGuid guidhigh); @@ -506,6 +510,8 @@ struct MovementInfo void AddExtraMovementFlag(uint16 flag) { flags2 |= flag; } bool HasExtraMovementFlag(uint16 flag) const { return flags2 & flag; } + void SetFallTime(uint32 time) { fallTime = time; } + void OutDebug(); }; @@ -681,7 +687,7 @@ class WorldObject : public Object, public WorldLocation bool IsInMap(const WorldObject* obj) const { if (obj) - return IsInWorld() && obj->IsInWorld() && (GetMap() == obj->GetMap()) && InSamePhase(obj); + return IsInWorld() && obj->IsInWorld() && (GetMap() == obj->GetMap()); return false; } bool IsWithinDist3d(float x, float y, float z, float dist) const @@ -699,7 +705,7 @@ class WorldObject : public Object, public WorldLocation } bool IsWithinDistInMap(WorldObject const* obj, float dist2compare, bool is3D = true) const { - return obj && IsInMap(obj) && _IsWithinDist(obj, dist2compare, is3D); + return obj && IsInMap(obj) && InSamePhase(obj) && _IsWithinDist(obj, dist2compare, is3D); } bool IsWithinLOS(float x, float y, float z) const; bool IsWithinLOSInMap(const WorldObject* obj) const; @@ -776,7 +782,8 @@ class WorldObject : public Object, public WorldLocation GetClosePoint(x, y, z, GetObjectSize()); ang = GetOrientation(); } - Position pos = {x, y, z, ang}; + Position pos; + pos.Relocate(x, y, z, ang); return SummonCreature(id, pos, spwtype, despwtime, 0); } GameObject* SummonGameObject(uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime); @@ -873,20 +880,6 @@ class WorldObject : public Object, public WorldLocation namespace Trinity { - template - void RandomResizeList(std::list &_list, uint32 _size) - { - size_t list_size = _list.size(); - - while (list_size > _size) - { - typename std::list::iterator itr = _list.begin(); - std::advance(itr, urand(0, list_size - 1)); - _list.erase(itr); - --list_size; - } - } - // Binary predicate to sort WorldObjects based on the distance to a reference WorldObject class ObjectDistanceOrderPred { diff --git a/src/server/game/Entities/Object/ObjectPosSelector.cpp b/src/server/game/Entities/Object/ObjectPosSelector.cpp index ec654954b80..f5c36f5a3c9 100755 --- a/src/server/game/Entities/Object/ObjectPosSelector.cpp +++ b/src/server/game/Entities/Object/ObjectPosSelector.cpp @@ -75,9 +75,9 @@ void ObjectPosSelector::InitializeAngle() bool ObjectPosSelector::FirstAngle(float& angle) { - if (m_UsedPosLists[USED_POS_PLUS].empty() && !m_UsedPosLists[USED_POS_MINUS].empty() ) + if (m_UsedPosLists[USED_POS_PLUS].empty() && !m_UsedPosLists[USED_POS_MINUS].empty()) return NextAngleFor(*m_UsedPosLists[USED_POS_MINUS].begin(), 1.0f, USED_POS_PLUS, angle); - else if (m_UsedPosLists[USED_POS_MINUS].empty() && !m_UsedPosLists[USED_POS_PLUS].empty() ) + else if (m_UsedPosLists[USED_POS_MINUS].empty() && !m_UsedPosLists[USED_POS_PLUS].empty()) return NextAngleFor(*m_UsedPosLists[USED_POS_PLUS].begin(), -1.0f, USED_POS_MINUS, angle); return false; @@ -100,7 +100,7 @@ bool ObjectPosSelector::NextAngle(float& angle) bool ObjectPosSelector::NextUsedAngle(float& angle) { while (m_nextUsedPos[USED_POS_PLUS]!=m_UsedPosLists[USED_POS_PLUS].end() || - m_nextUsedPos[USED_POS_MINUS]!=m_UsedPosLists[USED_POS_MINUS].end() ) + m_nextUsedPos[USED_POS_MINUS]!=m_UsedPosLists[USED_POS_MINUS].end()) { // calculate next possible angle if (!NextPosibleAngle(angle)) @@ -114,7 +114,7 @@ bool ObjectPosSelector::NextPosibleAngle(float& angle) { // ++ direction less updated if (m_nextUsedPos[USED_POS_PLUS]!=m_UsedPosLists[USED_POS_PLUS].end() && - (m_nextUsedPos[USED_POS_MINUS]==m_UsedPosLists[USED_POS_MINUS].end() || m_nextUsedPos[USED_POS_PLUS]->first <= m_nextUsedPos[USED_POS_MINUS]->first) ) + (m_nextUsedPos[USED_POS_MINUS]==m_UsedPosLists[USED_POS_MINUS].end() || m_nextUsedPos[USED_POS_PLUS]->first <= m_nextUsedPos[USED_POS_MINUS]->first)) { bool ok; if (m_smallStepOk[USED_POS_PLUS]) @@ -133,7 +133,7 @@ bool ObjectPosSelector::NextPosibleAngle(float& angle) if (m_smallStepOk[USED_POS_MINUS]) ok = NextSmallStepAngle(-1.0f, USED_POS_MINUS, angle); else - ok = NextAngleFor(*m_nextUsedPos[USED_POS_MINUS], -1.0f, USED_POS_MINUS, angle); + ok = NextAngleFor(*m_nextUsedPos[USED_POS_MINUS], -1.0f, USED_POS_MINUS, angle); if (!ok) ++m_nextUsedPos[USED_POS_MINUS]; diff --git a/src/server/game/Entities/Object/Updates/UpdateData.h b/src/server/game/Entities/Object/Updates/UpdateData.h index d1bdad13a19..11d54ac488e 100755 --- a/src/server/game/Entities/Object/Updates/UpdateData.h +++ b/src/server/game/Entities/Object/Updates/UpdateData.h @@ -32,21 +32,21 @@ enum OBJECT_UPDATE_TYPE enum OBJECT_UPDATE_FLAGS { - UPDATEFLAG_NONE = 0x0000, - UPDATEFLAG_SELF = 0x0001, - UPDATEFLAG_TRANSPORT = 0x0002, - UPDATEFLAG_HAS_TARGET = 0x0004, - UPDATEFLAG_UNK1 = 0x0008, - UPDATEFLAG_UNK2 = 0x0010, - UPDATEFLAG_LIVING = 0x0020, - UPDATEFLAG_HAS_POSITION = 0x0040, - UPDATEFLAG_VEHICLE = 0x0080, - UPDATEFLAG_POSITION = 0x0100, - UPDATEFLAG_ROTATION = 0x0200, - UPDATEFLAG_UNK3 = 0x0400, - UPDATEFLAG_ANIMKITS = 0x0800, - UPDATEFLAG_UNK5 = 0x1000, - UPDATEFLAG_UNK6 = 0x2000 + UPDATEFLAG_NONE = 0x0000, + UPDATEFLAG_SELF = 0x0001, + UPDATEFLAG_TRANSPORT = 0x0002, + UPDATEFLAG_HAS_TARGET = 0x0004, + UPDATEFLAG_UNKNOWN = 0x0008, + UPDATEFLAG_LOWGUID = 0x0010, + UPDATEFLAG_LIVING = 0x0020, + UPDATEFLAG_STATIONARY_POSITION = 0x0040, + UPDATEFLAG_VEHICLE = 0x0080, + UPDATEFLAG_POSITION = 0x0100, + UPDATEFLAG_ROTATION = 0x0200, + UPDATEFLAG_UNK3 = 0x0400, + UPDATEFLAG_ANIMKITS = 0x0800, + UPDATEFLAG_UNK5 = 0x1000, + UPDATEFLAG_UNK6 = 0x2000 }; class UpdateData diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index 088957ab0b3..414792c8d5c 100755 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -97,30 +97,42 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c uint32 ownerid = owner->GetGUIDLow(); - QueryResult result; + PreparedStatement* stmt; + PreparedQueryResult result; if (petnumber) - // known petnumber entry 0 1 2(?) 3 4 5 6 7 8 9 10 11 12 13 14 15 - result = CharacterDatabase.PQuery("SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, abdata, savetime, CreatedBySpell, PetType " - "FROM character_pet WHERE owner = '%u' AND id = '%u'", - ownerid, petnumber); + { + // Known petnumber entry + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_PET_BY_ENTRY); + stmt->setUInt32(0, ownerid); + stmt->setUInt32(1, petnumber); + } else if (current) - // current pet (slot 0) 0 1 2(?) 3 4 5 6 7 8 9 10 11 12 13 14 15 - result = CharacterDatabase.PQuery("SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, abdata, savetime, CreatedBySpell, PetType " - "FROM character_pet WHERE owner = '%u' AND slot = '%u'", - ownerid, PET_SAVE_AS_CURRENT); + { + // Current pet (slot 0) + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_PET_BY_ENTRY_AND_SLOT); + stmt->setUInt32(0, ownerid); + stmt->setUInt8(1, uint8(PET_SAVE_AS_CURRENT)); + } else if (petentry) + { // known petentry entry (unique for summoned pet, but non unique for hunter pet (only from current or not stabled pets) - // 0 1 2(?) 3 4 5 6 7 8 9 10 11 12 13 14 15 - result = CharacterDatabase.PQuery("SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, abdata, savetime, CreatedBySpell, PetType " - "FROM character_pet WHERE owner = '%u' AND entry = '%u' AND (slot = '%u' OR slot > '%u') ", - ownerid, petentry, PET_SAVE_AS_CURRENT, PET_SAVE_LAST_STABLE_SLOT); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_PET_BY_ENTRY_AND_SLOT_2); + stmt->setUInt32(0, ownerid); + stmt->setUInt32(1, petentry); + stmt->setUInt8(2, uint8(PET_SAVE_AS_CURRENT)); + stmt->setUInt8(3, uint8(PET_SAVE_LAST_STABLE_SLOT)); + } else - // any current or other non-stabled pet (for hunter "call pet") - // 0 1 2(?) 3 4 5 6 7 8 9 10 11 12 13 14 15 - result = CharacterDatabase.PQuery("SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, abdata, savetime, CreatedBySpell, PetType " - "FROM character_pet WHERE owner = '%u' AND (slot = '%u' OR slot > '%u') ", - ownerid, PET_SAVE_AS_CURRENT, PET_SAVE_LAST_STABLE_SLOT); + { + // Any current or other non-stabled pet (for hunter "call pet") + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_PET_BY_SLOT); + stmt->setUInt32(0, ownerid); + stmt->setUInt8(1, uint8(PET_SAVE_AS_CURRENT)); + stmt->setUInt8(2, uint8(PET_SAVE_LAST_STABLE_SLOT)); + } + + result = CharacterDatabase.Query(stmt); if (!result) { @@ -180,7 +192,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c setFaction(owner->getFaction()); SetUInt32Value(UNIT_CREATED_BY_SPELL, summon_spell_id); - CreatureTemplate const* cinfo = GetCreatureInfo(); + CreatureTemplate const* cinfo = GetCreatureTemplate(); if (cinfo->type == CREATURE_TYPE_CRITTER) { map->AddToMap(this->ToCreature()); @@ -252,10 +264,20 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c if (fields[7].GetUInt8()) { SQLTransaction trans = CharacterDatabase.BeginTransaction(); - trans->PAppend("UPDATE character_pet SET slot = '%u' WHERE owner = '%u' AND slot = '%u' AND id <> '%u'", - PET_SAVE_NOT_IN_SLOT, ownerid, PET_SAVE_AS_CURRENT, m_charmInfo->GetPetNumber()); - trans->PAppend("UPDATE character_pet SET slot = '%u' WHERE owner = '%u' AND id = '%u'", - PET_SAVE_AS_CURRENT, ownerid, m_charmInfo->GetPetNumber()); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UDP_CHAR_PET_SLOT_BY_SLOT_EXCLUDE_ID); + stmt->setUInt8(0, uint8(PET_SAVE_NOT_IN_SLOT)); + stmt->setUInt32(1, ownerid); + stmt->setUInt8(2, uint8(PET_SAVE_AS_CURRENT)); + stmt->setUInt32(3, m_charmInfo->GetPetNumber()); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_PET_SLOT_BY_ID); + stmt->setUInt8(0, uint8(PET_SAVE_AS_CURRENT)); + stmt->setUInt32(1, ownerid); + stmt->setUInt32(2, m_charmInfo->GetPetNumber()); + trans->Append(stmt); + CharacterDatabase.CommitTransaction(trans); } @@ -308,7 +330,10 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c if (getPetType() == HUNTER_PET) { - result = CharacterDatabase.PQuery("SELECT genitive, dative, accusative, instrumental, prepositional FROM character_pet_declinedname WHERE owner = '%u' AND id = '%u'", owner->GetGUIDLow(), GetCharmInfo()->GetPetNumber()); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PET_DECLINED_NAME); + stmt->setUInt32(0, owner->GetGUIDLow()); + stmt->setUInt32(1, GetCharmInfo()->GetPetNumber()); + PreparedQueryResult result = CharacterDatabase.Query(stmt); if (result) { @@ -383,17 +408,31 @@ void Pet::SavePetToDB(PetSaveMode mode) CharacterDatabase.EscapeString(name); trans = CharacterDatabase.BeginTransaction(); // remove current data - trans->PAppend("DELETE FROM character_pet WHERE owner = '%u' AND id = '%u'", ownerLowGUID, m_charmInfo->GetPetNumber()); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_PET_BY_ID); + stmt->setUInt32(0, m_charmInfo->GetPetNumber()); + trans->Append(stmt); // prevent duplicate using slot (except PET_SAVE_NOT_IN_SLOT) if (mode <= PET_SAVE_LAST_STABLE_SLOT) - trans->PAppend("UPDATE character_pet SET slot = '%u' WHERE owner = '%u' AND slot = '%u'", - PET_SAVE_NOT_IN_SLOT, ownerLowGUID, uint32(mode)); + { + stmt = CharacterDatabase.GetPreparedStatement(CHAR_UDP_CHAR_PET_SLOT_BY_SLOT); + stmt->setUInt8(0, uint8(PET_SAVE_NOT_IN_SLOT)); + stmt->setUInt32(1, ownerLowGUID); + stmt->setUInt8(2, uint8(mode)); + trans->Append(stmt); + } // prevent existence another hunter pet in PET_SAVE_AS_CURRENT and PET_SAVE_NOT_IN_SLOT if (getPetType() == HUNTER_PET && (mode == PET_SAVE_AS_CURRENT || mode > PET_SAVE_LAST_STABLE_SLOT)) - trans->PAppend("DELETE FROM character_pet WHERE owner = '%u' AND (slot = '%u' OR slot > '%u')", - ownerLowGUID, PET_SAVE_AS_CURRENT, PET_SAVE_LAST_STABLE_SLOT); + { + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_PET_BY_SLOT); + stmt->setUInt32(0, ownerLowGUID); + stmt->setUInt8(1, uint8(PET_SAVE_AS_CURRENT)); + stmt->setUInt8(2, uint8(PET_SAVE_LAST_STABLE_SLOT)); + trans->Append(stmt); + } + // save pet std::ostringstream ss; ss << "INSERT INTO character_pet (id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, abdata, savetime, CreatedBySpell, PetType) " @@ -414,7 +453,7 @@ void Pet::SavePetToDB(PetSaveMode mode) for (uint32 i = ACTION_BAR_INDEX_START; i < ACTION_BAR_INDEX_END; ++i) { ss << uint32(m_charmInfo->GetActionBarEntry(i)->GetType()) << ' ' - << uint32(m_charmInfo->GetActionBarEntry(i)->GetAction()) << ' '; + << uint32(m_charmInfo->GetActionBarEntry(i)->GetAction()) << ' '; }; ss << "', " @@ -436,11 +475,27 @@ void Pet::SavePetToDB(PetSaveMode mode) void Pet::DeleteFromDB(uint32 guidlow) { SQLTransaction trans = CharacterDatabase.BeginTransaction(); - trans->PAppend("DELETE FROM character_pet WHERE id = '%u'", guidlow); - trans->PAppend("DELETE FROM character_pet_declinedname WHERE id = '%u'", guidlow); - trans->PAppend("DELETE FROM pet_aura WHERE guid = '%u'", guidlow); - trans->PAppend("DELETE FROM pet_spell WHERE guid = '%u'", guidlow); - trans->PAppend("DELETE FROM pet_spell_cooldown WHERE guid = '%u'", guidlow); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_PET_BY_ID); + stmt->setUInt32(0, guidlow); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_PET_DECLINEDNAME); + stmt->setUInt32(0, guidlow); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PET_AURAS); + stmt->setUInt32(0, guidlow); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PET_SPELLS); + stmt->setUInt32(0, guidlow); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PET_SPELL_COOLDOWNS); + stmt->setUInt32(0, guidlow); + trans->Append(stmt); + CharacterDatabase.CommitTransaction(trans); } @@ -528,7 +583,13 @@ void Pet::Update(uint32 diff) Regenerate(POWER_FOCUS); m_regenTimer += PET_FOCUS_REGEN_INTERVAL - diff; if (!m_regenTimer) ++m_regenTimer; + + // Reset if large diff (lag) causes focus to get 'stuck' + if (m_regenTimer > PET_FOCUS_REGEN_INTERVAL) + m_regenTimer = PET_FOCUS_REGEN_INTERVAL; + break; + // in creature::update //case POWER_ENERGY: // Regenerate(POWER_ENERGY); @@ -650,7 +711,7 @@ bool Pet::CreateBaseAtCreature(Creature* creature) { ASSERT(creature); - if (!CreateBaseAtTamed(creature->GetCreatureInfo(), creature->GetMap(), creature->GetPhaseMask())) + if (!CreateBaseAtTamed(creature->GetCreatureTemplate(), creature->GetMap(), creature->GetPhaseMask())) return false; Relocate(creature->GetPositionX(), creature->GetPositionY(), creature->GetPositionZ(), creature->GetOrientation()); @@ -662,7 +723,7 @@ bool Pet::CreateBaseAtCreature(Creature* creature) return false; } - CreatureTemplate const* cinfo = GetCreatureInfo(); + CreatureTemplate const* cinfo = GetCreatureTemplate(); if (!cinfo) { sLog->outError("CreateBaseAtCreature() failed, creatureInfo is missing!"); @@ -719,7 +780,7 @@ bool Pet::CreateBaseAtTamed(CreatureTemplate const* cinfo, Map* map, uint32 phas // TODO: Move stat mods code to pet passive auras bool Guardian::InitStatsForLevel(uint8 petlevel) { - CreatureTemplate const* cinfo = GetCreatureInfo(); + CreatureTemplate const* cinfo = GetCreatureTemplate(); ASSERT(cinfo); SetLevel(petlevel); @@ -765,7 +826,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel) else scale = cFamily->minScale + float(getLevel() - cFamily->minScaleLevel) / cFamily->maxScaleLevel * (cFamily->maxScale - cFamily->minScale); - SetFloatValue(OBJECT_FIELD_SCALE_X, scale); + SetObjectScale(scale); } // Resistance @@ -835,14 +896,14 @@ bool Guardian::InitStatsForLevel(uint8 petlevel) { case 510: // mage Water Elemental { - SetBonusDamage(int32(m_owner->SpellBaseDamageBonus(SPELL_SCHOOL_MASK_FROST) * 0.33f)); + SetBonusDamage(int32(m_owner->SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_FROST) * 0.33f)); break; } case 1964: //force of nature { if (!pInfo) SetCreateHealth(30 + 30*petlevel); - float bonusDmg = m_owner->SpellBaseDamageBonus(SPELL_SCHOOL_MASK_NATURE) * 0.15f; + float bonusDmg = m_owner->SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_NATURE) * 0.15f; SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel * 2.5f - (petlevel / 2) + bonusDmg)); SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel * 2.5f + (petlevel / 2) + bonusDmg)); break; @@ -862,7 +923,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel) SetCreateHealth(40*petlevel); SetCreateMana(28 + 10*petlevel); } - SetBonusDamage(m_owner->SpellBaseDamageBonus(SPELL_SCHOOL_MASK_FIRE) * 0.5f); + SetBonusDamage(int32(m_owner->SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_FIRE) * 0.5f)); SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel * 4 - petlevel)); SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel * 4 + petlevel)); break; @@ -874,7 +935,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel) SetCreateMana(28 + 10*petlevel); SetCreateHealth(28 + 30*petlevel); } - int32 bonus_dmg = (int32(m_owner->SpellBaseDamageBonus(SPELL_SCHOOL_MASK_SHADOW)* 0.3f)); + int32 bonus_dmg = (int32(m_owner->SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_SHADOW)* 0.3f)); SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float((petlevel * 4 - petlevel) + bonus_dmg)); SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float((petlevel * 4 + petlevel) + bonus_dmg)); @@ -915,7 +976,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel) } case 31216: // Mirror Image { - SetBonusDamage(int32(m_owner->SpellBaseDamageBonus(SPELL_SCHOOL_MASK_FROST) * 0.33f)); + SetBonusDamage(int32(m_owner->SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_FROST) * 0.33f)); SetDisplayId(m_owner->GetDisplayId()); if (!pInfo) { @@ -936,6 +997,13 @@ bool Guardian::InitStatsForLevel(uint8 petlevel) SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel + (petlevel / 4))); break; } + case 28017: // Bloodworms + { + SetCreateHealth(4 * petlevel); + SetBonusDamage(int32(m_owner->GetTotalAttackPowerValue(BASE_ATTACK) * 0.006f)); + SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel - 30 - (petlevel / 4))); + SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel - 30 + (petlevel / 4))); + } } break; } @@ -953,7 +1021,7 @@ bool Pet::HaveInDiet(ItemTemplate const* item) const if (!item->FoodType) return false; - CreatureTemplate const* cInfo = GetCreatureInfo(); + CreatureTemplate const* cInfo = GetCreatureTemplate(); if (!cInfo) return false; @@ -987,7 +1055,9 @@ void Pet::_LoadSpellCooldowns() m_CreatureSpellCooldowns.clear(); m_CreatureCategoryCooldowns.clear(); - QueryResult result = CharacterDatabase.PQuery("SELECT spell, time FROM pet_spell_cooldown WHERE guid = '%u'", m_charmInfo->GetPetNumber()); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PET_SPELL_COOLDOWN); + stmt->setUInt32(0, m_charmInfo->GetPetNumber()); + PreparedQueryResult result = CharacterDatabase.Query(stmt); if (result) { @@ -1030,7 +1100,9 @@ void Pet::_LoadSpellCooldowns() void Pet::_SaveSpellCooldowns(SQLTransaction& trans) { - trans->PAppend("DELETE FROM pet_spell_cooldown WHERE guid = '%u'", m_charmInfo->GetPetNumber()); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PET_SPELL_COOLDOWNS); + stmt->setUInt32(0, m_charmInfo->GetPetNumber()); + trans->Append(stmt); time_t curTime = time(NULL); @@ -1041,7 +1113,12 @@ void Pet::_SaveSpellCooldowns(SQLTransaction& trans) m_CreatureSpellCooldowns.erase(itr++); else { - trans->PAppend("INSERT INTO pet_spell_cooldown (guid, spell, time) VALUES ('%u', '%u', '%u')", m_charmInfo->GetPetNumber(), itr->first, uint32(itr->second)); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_PET_SPELL_COOLDOWN); + stmt->setUInt32(0, m_charmInfo->GetPetNumber()); + stmt->setUInt32(1, itr->first); + stmt->setUInt32(2, uint32(itr->second)); + trans->Append(stmt); + ++itr; } } @@ -1049,7 +1126,9 @@ void Pet::_SaveSpellCooldowns(SQLTransaction& trans) void Pet::_LoadSpells() { - QueryResult result = CharacterDatabase.PQuery("SELECT spell, active FROM pet_spell WHERE guid = '%u'", m_charmInfo->GetPetNumber()); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PET_SPELL); + stmt->setUInt32(0, m_charmInfo->GetPetNumber()); + PreparedQueryResult result = CharacterDatabase.Query(stmt); if (result) { @@ -1073,18 +1152,37 @@ void Pet::_SaveSpells(SQLTransaction& trans) if (itr->second.type == PETSPELL_FAMILY) continue; + PreparedStatement* stmt; + switch (itr->second.state) { case PETSPELL_REMOVED: - trans->PAppend("DELETE FROM pet_spell WHERE guid = '%u' and spell = '%u'", m_charmInfo->GetPetNumber(), itr->first); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PET_SPELL_BY_SPELL); + stmt->setUInt32(0, m_charmInfo->GetPetNumber()); + stmt->setUInt32(1, itr->first); + trans->Append(stmt); + m_spells.erase(itr); continue; case PETSPELL_CHANGED: - trans->PAppend("DELETE FROM pet_spell WHERE guid = '%u' and spell = '%u'", m_charmInfo->GetPetNumber(), itr->first); - trans->PAppend("INSERT INTO pet_spell (guid, spell, active) VALUES ('%u', '%u', '%u')", m_charmInfo->GetPetNumber(), itr->first, itr->second.active); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PET_SPELL_BY_SPELL); + stmt->setUInt32(0, m_charmInfo->GetPetNumber()); + stmt->setUInt32(1, itr->first); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_PET_SPELL); + stmt->setUInt32(0, m_charmInfo->GetPetNumber()); + stmt->setUInt32(1, itr->first); + stmt->setUInt8(2, itr->second.active); + trans->Append(stmt); + break; case PETSPELL_NEW: - trans->PAppend("INSERT INTO pet_spell (guid, spell, active) VALUES ('%u', '%u', '%u')", m_charmInfo->GetPetNumber(), itr->first, itr->second.active); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_PET_SPELL); + stmt->setUInt32(0, m_charmInfo->GetPetNumber()); + stmt->setUInt32(1, itr->first); + stmt->setUInt8(2, itr->second.active); + trans->Append(stmt); break; case PETSPELL_UNCHANGED: continue; @@ -1097,7 +1195,9 @@ void Pet::_LoadAuras(uint32 timediff) { sLog->outDebug(LOG_FILTER_PETS, "Loading auras for pet %u", GetGUIDLow()); - QueryResult result = CharacterDatabase.PQuery("SELECT caster_guid, spell, effect_mask, recalculate_mask, stackcount, amount0, amount1, amount2, base_amount0, base_amount1, base_amount2, maxduration, remaintime, remaincharges FROM pet_aura WHERE guid = '%u'", m_charmInfo->GetPetNumber()); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PET_AURA); + stmt->setUInt32(0, m_charmInfo->GetPetNumber()); + PreparedQueryResult result = CharacterDatabase.Query(stmt); if (result) { @@ -1167,9 +1267,11 @@ void Pet::_LoadAuras(uint32 timediff) void Pet::_SaveAuras(SQLTransaction& trans) { - trans->PAppend("DELETE FROM pet_aura WHERE guid = '%u'", m_charmInfo->GetPetNumber()); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PET_AURAS); + stmt->setUInt32(0, m_charmInfo->GetPetNumber()); + trans->Append(stmt); - for (AuraMap::const_iterator itr = m_ownedAuras.begin(); itr != m_ownedAuras.end() ; ++itr) + for (AuraMap::const_iterator itr = m_ownedAuras.begin(); itr != m_ownedAuras.end(); ++itr) { // check if the aura has to be saved if (!itr->second->CanBeSaved() || IsPetAura(itr->second)) @@ -1201,11 +1303,26 @@ void Pet::_SaveAuras(SQLTransaction& trans) // don't save guid of caster in case we are caster of the spell - guid for pet is generated every pet load, so it won't match saved guid anyways uint64 casterGUID = (itr->second->GetCasterGUID() == GetGUID()) ? 0 : itr->second->GetCasterGUID(); - trans->PAppend("INSERT INTO pet_aura (guid, caster_guid, spell, effect_mask, recalculate_mask, stackcount, amount0, amount1, amount2, base_amount0, base_amount1, base_amount2, maxduration, remaintime, remaincharges) " - "VALUES ('%u', '" UI64FMTD "', '%u', '%u', '%u', '%u', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%u')", - m_charmInfo->GetPetNumber(), casterGUID, itr->second->GetId(), effMask, recalculateMask, - itr->second->GetStackAmount(), damage[0], damage[1], damage[2], baseDamage[0], baseDamage[1], baseDamage[2], - itr->second->GetMaxDuration(), itr->second->GetDuration(), itr->second->GetCharges()); + uint8 index = 0; + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_PET_AURA); + stmt->setUInt32(index++, m_charmInfo->GetPetNumber()); + stmt->setUInt64(index++, casterGUID); + stmt->setUInt32(index++, itr->second->GetId()); + stmt->setUInt8(index++, effMask); + stmt->setUInt8(index++, recalculateMask); + stmt->setUInt8(index++, itr->second->GetStackAmount()); + stmt->setInt32(index++, damage[0]); + stmt->setInt32(index++, damage[1]); + stmt->setInt32(index++, damage[2]); + stmt->setInt32(index++, baseDamage[0]); + stmt->setInt32(index++, baseDamage[1]); + stmt->setInt32(index++, baseDamage[2]); + stmt->setInt32(index++, itr->second->GetMaxDuration()); + stmt->setInt32(index++, itr->second->GetDuration()); + stmt->setUInt8(index++, itr->second->GetCharges()); + + trans->Append(stmt); } } @@ -1292,7 +1409,8 @@ bool Pet::addSpell(uint32 spellId, ActiveStates active /*= ACT_DECIDE*/, PetSpel { for (PetSpellMap::const_iterator itr2 = m_spells.begin(); itr2 != m_spells.end(); ++itr2) { - if (itr2->second.state == PETSPELL_REMOVED) continue; + if (itr2->second.state == PETSPELL_REMOVED) + continue; SpellInfo const* oldRankSpellInfo = sSpellMgr->GetSpellInfo(itr2->first); @@ -1361,7 +1479,7 @@ void Pet::InitLevelupSpellsForLevel() { uint8 level = getLevel(); - if (PetLevelupSpellSet const* levelupSpells = GetCreatureInfo()->family ? sSpellMgr->GetPetLevelupSpellList(GetCreatureInfo()->family) : NULL) + if (PetLevelupSpellSet const* levelupSpells = GetCreatureTemplate()->family ? sSpellMgr->GetPetLevelupSpellList(GetCreatureTemplate()->family) : NULL) { // PetLevelupSpellSet ordered by levels, process in reversed order for (PetLevelupSpellSet::const_reverse_iterator itr = levelupSpells->rbegin(); itr != levelupSpells->rend(); ++itr) @@ -1375,7 +1493,7 @@ void Pet::InitLevelupSpellsForLevel() } } - int32 petSpellsId = GetCreatureInfo()->PetSpellDataId ? -(int32)GetCreatureInfo()->PetSpellDataId : GetEntry(); + int32 petSpellsId = GetCreatureTemplate()->PetSpellDataId ? -(int32)GetCreatureTemplate()->PetSpellDataId : GetEntry(); // default spells (can be not learned if pet level (as owner level decrease result for example) less first possible in normal game) if (PetDefaultSpellsEntry const* defSpells = sSpellMgr->GetPetDefaultSpellsEntry(petSpellsId)) @@ -1499,7 +1617,7 @@ bool Pet::resetTalents() if (owner->ToPlayer()->HasAtLoginFlag(AT_LOGIN_RESET_PET_TALENTS)) owner->ToPlayer()->RemoveAtLoginFlag(AT_LOGIN_RESET_PET_TALENTS, true); - CreatureTemplate const* ci = GetCreatureInfo(); + CreatureTemplate const* ci = GetCreatureTemplate(); if (!ci) return false; // Check pet talent type @@ -1579,18 +1697,19 @@ void Pet::resetTalentsForAllPetsOf(Player* owner, Pet* online_pet /*= NULL*/) // now need only reset for offline pets (all pets except online case) uint32 except_petnumber = online_pet ? online_pet->GetCharmInfo()->GetPetNumber() : 0; - QueryResult resultPets = CharacterDatabase.PQuery( - "SELECT id FROM character_pet WHERE owner = '%u' AND id <> '%u'", - owner->GetGUIDLow(), except_petnumber); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_PET); + stmt->setUInt32(0, owner->GetGUIDLow()); + stmt->setUInt32(1, except_petnumber); + PreparedQueryResult resultPets = CharacterDatabase.Query(stmt); // no offline pets if (!resultPets) return; - QueryResult result = CharacterDatabase.PQuery( - "SELECT DISTINCT pet_spell.spell FROM pet_spell, character_pet " - "WHERE character_pet.owner = '%u' AND character_pet.id = pet_spell.guid AND character_pet.id <> %u", - owner->GetGUIDLow(), except_petnumber); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PET_SPELL_LIST); + stmt->setUInt32(0, owner->GetGUIDLow()); + stmt->setUInt32(1, except_petnumber); + PreparedQueryResult result = CharacterDatabase.Query(stmt); if (!result) return; @@ -1727,9 +1846,9 @@ bool Pet::IsPermanentPetFor(Player* owner) switch (owner->getClass()) { case CLASS_WARLOCK: - return GetCreatureInfo()->type == CREATURE_TYPE_DEMON; + return GetCreatureTemplate()->type == CREATURE_TYPE_DEMON; case CLASS_DEATH_KNIGHT: - return GetCreatureInfo()->type == CREATURE_TYPE_UNDEAD; + return GetCreatureTemplate()->type == CREATURE_TYPE_UNDEAD; case CLASS_MAGE: return GetCreatureInfo()->type == CREATURE_TYPE_ELEMENTAL; default: @@ -1770,7 +1889,7 @@ bool Pet::HasSpell(uint32 spell) const // Get all passive spells in our skill line void Pet::LearnPetPassives() { - CreatureTemplate const* cInfo = GetCreatureInfo(); + CreatureTemplate const* cInfo = GetCreatureTemplate(); if (!cInfo) return; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 2c9747312af..d62e0ccfd53 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -145,7 +145,6 @@ static uint32 copseReclaimDelay[MAX_DEATH_COUNT] = { 30, 60, 120 }; PlayerTaxi::PlayerTaxi() { - // Taxi nodes memset(m_taximask, 0, sizeof(m_taximask)); } @@ -541,7 +540,7 @@ inline void KillRewarder::_RewardKillCredit(Player* player) // 4.4. Give kill credit (player must not be in group, or he must be alive or without corpse). if (!_group || player->isAlive() || !player->GetCorpse()) if (_victim->GetTypeId() == TYPEID_UNIT) - player->KilledMonster(_victim->ToCreature()->GetCreatureInfo(), _victim->GetGUID()); + player->KilledMonster(_victim->ToCreature()->GetCreatureTemplate(), _victim->GetGUID()); } void KillRewarder::_RewardPlayer(Player* player, bool isDungeon) @@ -844,6 +843,10 @@ Player::Player(WorldSession* session): Unit(true), m_achievementMgr(this), m_rep isDebugAreaTriggers = false; + m_WeeklyQuestChanged = false; + + m_SeasonalQuestChanged = false; + SetPendingBind(0, 0); } @@ -862,7 +865,7 @@ Player::~Player() delete _talentMgr; //all mailed items should be deleted, also all mail should be deallocated - for (PlayerMails::iterator itr = m_mail.begin(); itr != m_mail.end(); ++itr) + for (PlayerMails::iterator itr = m_mail.begin(); itr != m_mail.end(); ++itr) delete *itr; for (ItemMap::iterator iter = mMitems.begin(); iter != mMitems.end(); ++iter) @@ -909,7 +912,8 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo) PlayerInfo const* info = sObjectMgr->GetPlayerInfo(createInfo->Race, createInfo->Class); if (!info) { - sLog->outError("Player (Name %s) has incorrect race/class pair. Can't be loaded.", m_name.c_str()); + sLog->outError("Player::Create: Possible hacking-attempt: Account %u tried creating a character named '%s' with an invalid race/class pair (%u/%u) - refusing to do so.", + GetSession()->GetAccountId(), m_name.c_str(), createInfo->Race, createInfo->Class); return false; } @@ -921,7 +925,8 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo) ChrClassesEntry const* cEntry = sChrClassesStore.LookupEntry(createInfo->Class); if (!cEntry) { - sLog->outError("Class %u not found in DBC (Wrong DBC files?)", createInfo->Class); + sLog->outError("Player::Create: Possible hacking-attempt: Account %u tried creating a character named '%s' with an invalid character class (%u) - refusing to do so (wrong DBC-files?)", + GetSession()->GetAccountId(), m_name.c_str(), createInfo->Class); return false; } @@ -936,7 +941,8 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo) if (!IsValidGender(createInfo->Gender)) { - sLog->outError("Player has invalid gender (%hu), can't be loaded.", createInfo->Gender); + sLog->outError("Player::Create: Possible hacking-attempt: Account %u tried creating a character named '%s' with an invalid gender (%hu) - refusing to do so", + GetSession()->GetAccountId(), m_name.c_str(), createInfo->Gender); return false; } @@ -1101,10 +1107,10 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo) if (oEntry->ItemId[j] <= 0) continue; - uint32 item_id = oEntry->ItemId[j]; + uint32 itemId = oEntry->ItemId[j]; // just skip, reported in ObjectMgr::LoadItemTemplates - ItemTemplate const* iProto = sObjectMgr->GetItemTemplate(item_id); + ItemTemplate const* iProto = sObjectMgr->GetItemTemplate(itemId); if (!iProto) continue; @@ -1126,7 +1132,7 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo) if (iProto->GetMaxStackSize() < count) count = iProto->GetMaxStackSize(); } - StoreNewItemInBestSlots(item_id, count); + StoreNewItemInBestSlots(itemId, count); } } @@ -1390,14 +1396,14 @@ void Player::HandleDrowning(uint32 time_diff) SendMirrorTimer(FATIGUE_TIMER, DarkWaterTime, m_MirrorTimer[FATIGUE_TIMER], 10); } - if (m_MirrorTimerFlags & (UNDERWATER_INLAVA|UNDERWATER_INSLIME)) + if (m_MirrorTimerFlags & (UNDERWATER_INLAVA /*| UNDERWATER_INSLIME*/) && !(_lastLiquid && _lastLiquid->SpellId)) { // Breath timer not activated - activate it if (m_MirrorTimer[FIRE_TIMER] == DISABLED_MIRROR_TIMER) m_MirrorTimer[FIRE_TIMER] = getMaxTimer(FIRE_TIMER); else { - m_MirrorTimer[FIRE_TIMER]-=time_diff; + m_MirrorTimer[FIRE_TIMER] -= time_diff; if (m_MirrorTimer[FIRE_TIMER] < 0) { m_MirrorTimer[FIRE_TIMER]+= 1*IN_MILLISECONDS; @@ -1408,8 +1414,8 @@ void Player::HandleDrowning(uint32 time_diff) EnvironmentalDamage(DAMAGE_LAVA, damage); // need to skip Slime damage in Undercity, // maybe someone can find better way to handle environmental damage - else if (m_zoneUpdateId != 1497) - EnvironmentalDamage(DAMAGE_SLIME, damage); + //else if (m_zoneUpdateId != 1497) + // EnvironmentalDamage(DAMAGE_SLIME, damage); } } } @@ -1562,14 +1568,14 @@ void Player::Update(uint32 p_time) if (HasUnitState(UNIT_STATE_MELEE_ATTACKING) && !HasUnitState(UNIT_STATE_CASTING)) { - if (Unit* pVictim = getVictim()) + if (Unit* victim = getVictim()) { // default combat reach 10 // TODO add weapon, skill check if (isAttackReady(BASE_ATTACK)) { - if (!IsWithinMeleeRange(pVictim)) + if (!IsWithinMeleeRange(victim)) { setAttackTimer(BASE_ATTACK, 100); if (m_swingErrorMsg != 1) // send single time (client auto repeat) @@ -1579,7 +1585,7 @@ void Player::Update(uint32 p_time) } } //120 degrees of radiant range - else if (!HasInArc(2*M_PI/3, pVictim)) + else if (!HasInArc(2*M_PI/3, victim)) { setAttackTimer(BASE_ATTACK, 100); if (m_swingErrorMsg != 2) // send single time (client auto repeat) @@ -1598,16 +1604,16 @@ void Player::Update(uint32 p_time) setAttackTimer(OFF_ATTACK, ATTACK_DISPLAY_DELAY); // do attack - AttackerStateUpdate(pVictim, BASE_ATTACK); + AttackerStateUpdate(victim, BASE_ATTACK); resetAttackTimer(BASE_ATTACK); } } if (haveOffhandWeapon() && isAttackReady(OFF_ATTACK)) { - if (!IsWithinMeleeRange(pVictim)) + if (!IsWithinMeleeRange(victim)) setAttackTimer(OFF_ATTACK, 100); - else if (!HasInArc(2*M_PI/3, pVictim)) + else if (!HasInArc(2*M_PI/3, victim)) setAttackTimer(OFF_ATTACK, 100); else { @@ -1616,13 +1622,13 @@ void Player::Update(uint32 p_time) setAttackTimer(BASE_ATTACK, ATTACK_DISPLAY_DELAY); // do attack - AttackerStateUpdate(pVictim, OFF_ATTACK); + AttackerStateUpdate(victim, OFF_ATTACK); resetAttackTimer(OFF_ATTACK); } } - /*Unit* owner = pVictim->GetOwner(); - Unit* u = owner ? owner : pVictim; + /*Unit* owner = victim->GetOwner(); + Unit* u = owner ? owner : victim; if (u->IsPvP() && (!duel || duel->opponent != u)) { UpdatePvP(true); @@ -2208,7 +2214,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati if (duel && GetMapId() != mapid && GetMap()->GetGameObject(GetUInt64Value(PLAYER_DUEL_ARBITER))) DuelComplete(DUEL_FLED); - if ((GetMapId() == mapid && !m_transport) || (GetTransport() && GetMapId() == 628)) + if (GetMapId() == mapid) { //lets reset far teleport flag if it wasn't reset during chained teleports SetSemaphoreTeleportFar(false); @@ -2774,11 +2780,11 @@ Creature* Player::GetNPCIfCanInteractWith(uint64 guid, uint32 npcflagmask) return NULL; // Deathstate checks - if (!isAlive() && !(creature->GetCreatureInfo()->type_flags & CREATURE_TYPEFLAGS_GHOST)) + if (!isAlive() && !(creature->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_GHOST)) return NULL; // alive or spirit healer - if (!creature->isAlive() && !(creature->GetCreatureInfo()->type_flags & CREATURE_TYPEFLAGS_DEAD_INTERACT)) + if (!creature->isAlive() && !(creature->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_DEAD_INTERACT)) return NULL; // appropriate npc type @@ -3019,7 +3025,7 @@ void Player::GiveXP(uint32 xp, Unit* victim, float group_rate) if (xp < 1) return; - if (!isAlive()) + if (!isAlive() && !GetBattlegroundId()) return; if (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN)) @@ -3231,7 +3237,7 @@ void Player::InitStatsForLevel(bool reapplyMods) SetFloatValue(UNIT_MOD_CAST_SPEED, 1.0f); // reset size before reapply auras - SetFloatValue(OBJECT_FIELD_SCALE_X, 1.0f); + SetObjectScale(1.0f); // save base values (bonuses already included in stored stats for (uint8 i = STAT_STRENGTH; i < MAX_STATS; ++i) @@ -3501,7 +3507,7 @@ void Player::AddNewMailDeliverTime(time_t deliver_time) else // not ready and no have ready mails { if (!m_nextMailDelivereTime || m_nextMailDelivereTime > deliver_time) - m_nextMailDelivereTime = deliver_time; + m_nextMailDelivereTime = deliver_time; } } @@ -3773,9 +3779,12 @@ bool Player::addSpell(uint32 spellId, bool active, bool learning, bool dependent { for (PlayerSpellMap::iterator itr2 = m_spells.begin(); itr2 != m_spells.end(); ++itr2) { - if (itr2->second->state == PLAYERSPELL_REMOVED) continue; + if (itr2->second->state == PLAYERSPELL_REMOVED) + continue; + SpellInfo const* i_spellInfo = sSpellMgr->GetSpellInfo(itr2->first); - if (!i_spellInfo) continue; + if (!i_spellInfo) + continue; if (spellInfo->IsDifferentRankOf(i_spellInfo)) { @@ -3873,7 +3882,7 @@ bool Player::addSpell(uint32 spellId, bool active, bool learning, bool dependent uint32 new_skill_max_value = spellLearnSkill->maxvalue == 0 ? maxskill : spellLearnSkill->maxvalue; if (skill_max_value < new_skill_max_value) - skill_max_value = new_skill_max_value; + skill_max_value = new_skill_max_value; SetSkill(spellLearnSkill->skill, spellLearnSkill->step, skill_value, skill_max_value); } @@ -4160,11 +4169,11 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank) // most likely will never be used, haven't heard of cases where players unlearn a mount if (Has310Flyer(false) && _spell_idx->second->skillId == SKILL_MOUNTS) { - SpellInfo const* pSpellInfo = sSpellMgr->GetSpellInfo(spell_id); - for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) - if (pSpellInfo->Effects[i].ApplyAuraName == SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED && - pSpellInfo->Effects[i].CalcValue() == 310) - Has310Flyer(true, spell_id); // with true as first argument its also used to set/remove the flag + if (spellInfo) + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) + if (spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED && + spellInfo->Effects[i].CalcValue() == 310) + Has310Flyer(true, spell_id); // with true as first argument its also used to set/remove the flag } } } @@ -4253,7 +4262,7 @@ bool Player::Has310Flyer(bool checkAllSpells, uint32 excludeSpellId) else { SetHas310Flyer(false); - SpellInfo const* pSpellInfo; + SpellInfo const* spellInfo; for (PlayerSpellMap::iterator itr = m_spells.begin(); itr != m_spells.end(); ++itr) { if (itr->first == excludeSpellId) @@ -4265,10 +4274,10 @@ bool Player::Has310Flyer(bool checkAllSpells, uint32 excludeSpellId) if (_spell_idx->second->skillId != SKILL_MOUNTS) break; // We can break because mount spells belong only to one skillline (at least 310 flyers do) - pSpellInfo = sSpellMgr->GetSpellInfo(itr->first); + spellInfo = sSpellMgr->GetSpellInfo(itr->first); for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) - if (pSpellInfo->Effects[i].ApplyAuraName == SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED && - pSpellInfo->Effects[i].CalcValue() == 310) + if (spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED && + spellInfo->Effects[i].CalcValue() == 310) { SetHas310Flyer(true); return true; @@ -4394,7 +4403,9 @@ void Player::_LoadSpellCooldowns(PreparedQueryResult result) void Player::_SaveSpellCooldowns(SQLTransaction& trans) { - trans->PAppend("DELETE FROM character_spell_cooldown WHERE guid = '%u'", GetGUIDLow()); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SPELL_COOLDOWN); + stmt->setUInt32(0, GetGUIDLow()); + trans->Append(stmt); time_t curTime = time(NULL); time_t infTime = curTime + infinityCooldownDelayCheck; @@ -4560,7 +4571,7 @@ bool Player::ResetTalents(bool no_cost) /* when prev line will dropped use next line if (Pet* pet = GetPet()) { - if (pet->getPetType() == HUNTER_PET && !pet->GetCreatureInfo()->isTameable(CanTameExoticPets())) + if (pet->getPetType() == HUNTER_PET && !pet->GetCreatureTemplate()->isTameable(CanTameExoticPets())) RemovePet(NULL, PET_SAVE_NOT_IN_SLOT, true); } */ @@ -4716,9 +4727,9 @@ void Player::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) c Unit::BuildCreateUpdateBlockForPlayer(data, target); } -void Player::DestroyForPlayer(Player* target, bool anim) const +void Player::DestroyForPlayer(Player* target, bool onDeath) const { - Unit::DestroyForPlayer(target, anim); + Unit::DestroyForPlayer(target, onDeath); for (uint8 i = 0; i < INVENTORY_SLOT_BAG_END; ++i) { @@ -4773,7 +4784,7 @@ TrainerSpellState Player::GetTrainerSpellState(TrainerSpell const* trainer_spell return TRAINER_SPELL_RED; bool hasSpell = true; - for (uint8 i = 0; i < MAX_SPELL_EFFECTS ; ++i) + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { if (!trainer_spell->learnedSpell[i]) continue; @@ -4796,7 +4807,7 @@ TrainerSpellState Player::GetTrainerSpellState(TrainerSpell const* trainer_spell if (getLevel() < trainer_spell->reqLevel) return TRAINER_SPELL_RED; - for (uint8 i = 0; i < MAX_SPELL_EFFECTS ; ++i) + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { if (!trainer_spell->learnedSpell[i]) continue; @@ -4823,7 +4834,7 @@ TrainerSpellState Player::GetTrainerSpellState(TrainerSpell const* trainer_spell // check primary prof. limit // first rank of primary profession spell when there are no proffesions avalible is disabled - for (uint8 i = 0; i < MAX_SPELL_EFFECTS ; ++i) + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { if (!trainer_spell->learnedSpell[i]) continue; @@ -4875,7 +4886,10 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC LeaveAllArenaTeams(playerguid); // the player was uninvited already on logout so just remove from group - QueryResult resultGroup = CharacterDatabase.PQuery("SELECT guid FROM group_member WHERE memberGuid=%u", guid); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GROUP_MEMBER); + stmt->setUInt32(0, guid); + PreparedQueryResult resultGroup = CharacterDatabase.Query(stmt); + if (resultGroup) if (Group* group = sGroupMgr->GetGroupByDbStoreId((*resultGroup)[0].GetUInt32())) RemoveFromGroup(group, playerguid); @@ -4889,32 +4903,41 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC case CHAR_DELETE_REMOVE: { SQLTransaction trans = CharacterDatabase.BeginTransaction(); - // Return back all mails with COD and Item 0 1 2 3 4 5 6 7 - QueryResult resultMail = CharacterDatabase.PQuery("SELECT id, messageType, mailTemplateId, sender, subject, body, money, has_items FROM mail WHERE receiver='%u' AND has_items<>0 AND cod<>0", guid); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_COD_ITEM_MAIL); + stmt->setUInt32(0, guid); + PreparedQueryResult resultMail = CharacterDatabase.Query(stmt); + if (resultMail) { do { - Field* fields = resultMail->Fetch(); + Field* mailFields = resultMail->Fetch(); - uint32 mail_id = fields[0].GetUInt32(); - uint16 mailType = fields[1].GetUInt16(); - uint16 mailTemplateId= fields[2].GetUInt16(); - uint32 sender = fields[3].GetUInt32(); - std::string subject = fields[4].GetString(); - std::string body = fields[5].GetString(); - uint32 money = fields[6].GetUInt32(); - bool has_items = fields[7].GetBool(); + uint32 mail_id = mailFields[0].GetUInt32(); + uint8 mailType = mailFields[1].GetUInt8(); + uint16 mailTemplateId= mailFields[2].GetUInt16(); + uint32 sender = mailFields[3].GetUInt32(); + std::string subject = mailFields[4].GetString(); + std::string body = mailFields[5].GetString(); + uint32 money = mailFields[6].GetUInt32(); + bool has_items = mailFields[7].GetBool(); // We can return mail now // So firstly delete the old one - trans->PAppend("DELETE FROM mail WHERE id = '%u'", mail_id); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_MAIL_BY_ID); + stmt->setUInt32(0, mail_id); + trans->Append(stmt); // Mail is not from player if (mailType != MAIL_NORMAL) { if (has_items) - trans->PAppend("DELETE FROM mail_items WHERE mail_id = '%u'", mail_id); + { + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_MAIL_ITEM_BY_ID); + stmt->setUInt32(0, mail_id); + trans->Append(stmt); + } continue; } @@ -4932,9 +4955,9 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC { do { - Field* fields2 = resultItems->Fetch(); - uint32 item_guidlow = fields2[11].GetUInt32(); - uint32 item_template = fields2[12].GetUInt32(); + Field* itemFields = resultItems->Fetch(); + uint32 item_guidlow = itemFields[11].GetUInt32(); + uint32 item_template = itemFields[12].GetUInt32(); ItemTemplate const* itemProto = sObjectMgr->GetItemTemplate(item_template); if (!itemProto) @@ -4946,7 +4969,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC } Item* pItem = NewItemOrBag(itemProto); - if (!pItem->LoadFromDB(item_guidlow, MAKE_NEW_GUID(guid, 0, HIGHGUID_PLAYER), fields, item_template)) + if (!pItem->LoadFromDB(item_guidlow, MAKE_NEW_GUID(guid, 0, HIGHGUID_PLAYER), itemFields, item_template)) { pItem->FSetState(ITEM_REMOVED); pItem->SaveToDB(trans); // it also deletes item object! @@ -4959,7 +4982,9 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC } } - trans->PAppend("DELETE FROM mail_items WHERE mail_id = '%u'", mail_id); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_MAIL_ITEM_BY_ID); + stmt->setUInt32(0, mail_id); + trans->Append(stmt); uint32 pl_account = sObjectMgr->GetPlayerAccountIdByGUID(MAKE_NEW_GUID(guid, 0, HIGHGUID_PLAYER)); @@ -4970,7 +4995,11 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC // Unsummon and delete for pets in world is not required: player deleted from CLI or character list with not loaded pet. // NOW we can finally clear other DB data related to character - if (QueryResult resultPets = CharacterDatabase.PQuery("SELECT id FROM character_pet WHERE owner = '%u'", guid)) + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_PETS); + stmt->setUInt32(0, guid); + PreparedQueryResult resultPets = CharacterDatabase.Query(stmt); + + if (resultPets) { do { @@ -4980,7 +5009,11 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC } // Delete char from social list of online chars - if (QueryResult resultFriends = CharacterDatabase.PQuery("SELECT DISTINCT guid FROM character_social WHERE friend = '%u'", guid)) + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_SOCIAL); + stmt->setUInt32(0, guid); + PreparedQueryResult resultFriends = CharacterDatabase.Query(stmt); + + if (resultFriends) { do { @@ -4995,48 +5028,134 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC } while (resultFriends->NextRow()); } - trans->PAppend("DELETE FROM characters WHERE guid = '%u'", guid); - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PLAYER_ACCOUNT_DATA); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHARACTER); stmt->setUInt32(0, guid); trans->Append(stmt); - trans->PAppend("DELETE FROM character_declinedname WHERE guid = '%u'", guid); - trans->PAppend("DELETE FROM character_action WHERE guid = '%u'", guid); - trans->PAppend("DELETE FROM character_aura WHERE guid = '%u'", guid); - trans->PAppend("DELETE FROM character_gifts WHERE guid = '%u'", guid); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PLAYER_ACCOUNT_DATA); + stmt->setUInt32(0, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_DECLINED_NAME); + stmt->setUInt32(0, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACTION); + stmt->setUInt32(0, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_AURA); + stmt->setUInt32(0, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_GIFT); + stmt->setUInt32(0, guid); + trans->Append(stmt); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PLAYER_HOMEBIND); stmt->setUInt32(0, guid); trans->Append(stmt); - trans->PAppend("DELETE FROM character_instance WHERE guid = '%u'", guid); - trans->PAppend("DELETE FROM character_inventory WHERE guid = '%u'", guid); - trans->PAppend("DELETE FROM character_queststatus WHERE guid = '%u'", guid); - trans->PAppend("DELETE FROM character_queststatus_rewarded WHERE guid = '%u'", guid); - trans->PAppend("DELETE FROM character_reputation WHERE guid = '%u'", guid); - trans->PAppend("DELETE FROM character_spell WHERE guid = '%u'", guid); - trans->PAppend("DELETE FROM character_spell_cooldown WHERE guid = '%u'", guid); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INSTANCE); + stmt->setUInt32(0, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INVENTORY); + stmt->setUInt32(0, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_QUESTSTATUS); + stmt->setUInt32(0, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_QUESTSTATUS_REWARDED); + stmt->setUInt32(0, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_REPUTATION); + stmt->setUInt32(0, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SPELL); + stmt->setUInt32(0, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SPELL_COOLDOWN); + stmt->setUInt32(0, guid); + trans->Append(stmt); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PLAYER_GM_TICKETS); stmt->setUInt32(0, guid); trans->Append(stmt); - trans->PAppend("DELETE FROM item_instance WHERE owner_guid = '%u'", guid); - trans->PAppend("DELETE FROM character_social WHERE guid = '%u' OR friend='%u'", guid, guid); - trans->PAppend("DELETE FROM mail WHERE receiver = '%u'", guid); - trans->PAppend("DELETE FROM mail_items WHERE receiver = '%u'", guid); - trans->PAppend("DELETE FROM character_pet WHERE owner = '%u'", guid); - trans->PAppend("DELETE FROM character_pet_declinedname WHERE owner = '%u'", guid); - trans->PAppend("DELETE FROM character_achievement WHERE guid = '%u' " // NOTE: These achievements have flags & 256 in DBC. - "AND achievement NOT BETWEEN '456' AND '467' " // Realm First Level 80 - "AND achievement NOT BETWEEN '1400' AND '1427' " // Realm First Raid Achievements - "AND achievement NOT IN(1463, 3117, 3259) ", guid); // Realm First Northen Vanguard + Raid Achievements - trans->PAppend("DELETE FROM character_achievement_progress WHERE guid = '%u'", guid); - trans->PAppend("DELETE FROM character_equipmentsets WHERE guid = '%u'", guid); - trans->PAppend("DELETE FROM guild_eventlog WHERE PlayerGuid1 = '%u' OR PlayerGuid2 = '%u'", guid, guid); - trans->PAppend("DELETE FROM guild_bank_eventlog WHERE PlayerGuid = '%u'", guid); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_INSTANCE); + stmt->setUInt32(0, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SOCIAL_BY_FRIEND); + stmt->setUInt32(0, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SOCIAL_BY_GUID); + stmt->setUInt32(0, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_MAIL); + stmt->setUInt32(0, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_MAIL_ITEMS); + stmt->setUInt32(0, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_PET_BY_OWNER); + stmt->setUInt32(0, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_PET_DECLINEDNAME_BY_OWNER); + stmt->setUInt32(0, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACHIEVEMENTS); + stmt->setUInt32(0, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACHIEVEMENT_PROGRESS); + stmt->setUInt32(0, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_EQUIPMENTSETS); + stmt->setUInt32(0, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_EVENTLOG_BY_PLAYER); + stmt->setUInt32(0, guid); + stmt->setUInt32(1, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_BANK_EVENTLOG_BY_PLAYER); + stmt->setUInt32(0, guid); + trans->Append(stmt); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PLAYER_BGDATA); stmt->setUInt32(0, guid); trans->Append(stmt); - trans->PAppend("DELETE FROM character_glyphs WHERE guid = '%u'", guid); - trans->PAppend("DELETE FROM character_queststatus_daily WHERE guid = '%u'", guid); - trans->PAppend("DELETE FROM character_talent WHERE guid = '%u'", guid); - trans->PAppend("DELETE FROM character_skills WHERE guid = '%u'", guid); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_GLYPHS); + stmt->setUInt32(0, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_QUESTSTATUS_DAILY); + stmt->setUInt32(0, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_TALENT); + stmt->setUInt32(0, guid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SKILLS); + stmt->setUInt32(0, guid); + trans->Append(stmt); CharacterDatabase.CommitTransaction(trans); break; @@ -5084,15 +5203,19 @@ void Player::DeleteOldCharacters(uint32 keepDays) { sLog->outString("Player::DeleteOldChars: Deleting all characters which have been deleted %u days before...", keepDays); - QueryResult resultChars = CharacterDatabase.PQuery("SELECT guid, deleteInfos_Account FROM characters WHERE deleteDate IS NOT NULL AND deleteDate < '%u'", uint32(time(NULL) - time_t(keepDays * DAY))); - if (resultChars) + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_OLD_CHARS); + stmt->setUInt32(0, uint32(time(NULL) - time_t(keepDays * DAY))); + PreparedQueryResult result = CharacterDatabase.Query(stmt); + + if (result) { - sLog->outString("Player::DeleteOldChars: Found " UI64FMTD " character(s) to delete", resultChars->GetRowCount()); + sLog->outString("Player::DeleteOldChars: Found " UI64FMTD " character(s) to delete", result->GetRowCount()); do { - Field* charFields = resultChars->Fetch(); - Player::DeleteFromDB(charFields[0].GetUInt64(), charFields[1].GetUInt32(), true, true); - } while (resultChars->NextRow()); + Field* fields = result->Fetch(); + Player::DeleteFromDB(fields[0].GetUInt32(), fields[1].GetUInt32(), true, true); + } + while (result->NextRow()); } } @@ -5332,7 +5455,7 @@ void Player::CreateCorpse() iDisplayID = m_items[i]->GetTemplate()->DisplayInfoID; iIventoryType = m_items[i]->GetTemplate()->InventoryType; - _cfi = iDisplayID | (iIventoryType << 24); + _cfi = iDisplayID | (iIventoryType << 24); corpse->SetUInt32Value(CORPSE_FIELD_ITEM + i, _cfi); } } @@ -5388,7 +5511,7 @@ void Player::DurabilityLoss(Item* item, double percent) if (!item) return; - uint32 pMaxDurability = item ->GetUInt32Value(ITEM_FIELD_MAXDURABILITY); + uint32 pMaxDurability = item ->GetUInt32Value(ITEM_FIELD_MAXDURABILITY); if (!pMaxDurability) return; @@ -6311,7 +6434,7 @@ void Player::UpdateWeaponSkill(WeaponAttackType attType) if (GetShapeshiftForm() == FORM_TREE) return; // use weapon but not skill up - if (victim && victim->GetTypeId() == TYPEID_UNIT && (victim->ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_SKILLGAIN)) + if (victim && victim->GetTypeId() == TYPEID_UNIT && (victim->ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_SKILLGAIN)) return; uint32 weapon_skill_gain = sWorld->getIntConfig(CONFIG_SKILL_GAIN_WEAPON); @@ -6631,7 +6754,7 @@ uint16 Player::GetBaseSkillValue(uint32 skill) const return 0; int32 result = int32(SKILL_VALUE(GetUInt32Value(PLAYER_SKILL_VALUE_INDEX(itr->second.pos)))); - result += SKILL_PERM_BONUS(GetUInt32Value(PLAYER_SKILL_BONUS_INDEX(itr->second.pos))); + result += SKILL_PERM_BONUS(GetUInt32Value(PLAYER_SKILL_BONUS_INDEX(itr->second.pos))); return result < 0 ? 0 : result; } @@ -6795,11 +6918,6 @@ bool Player::UpdatePosition(float x, float y, float z, float orientation, bool t if (GetGroup()) SetGroupUpdateFlag(GROUP_UPDATE_FLAG_POSITION); - // code block for underwater state update - // Unit::UpdatePosition() checks for validity and updates our coordinates - // so we re-fetch them instead of using "raw" coordinates from function params - UpdateUnderwaterState(GetMap(), GetPositionX(), GetPositionY(), GetPositionZ()); - if (GetTrader() && !IsWithinDistInMap(GetTrader(), INTERACTION_DISTANCE)) GetSession()->SendCancelTrade(); @@ -6879,7 +6997,7 @@ void Player::CheckAreaExploreAndOutdoor() if (sWorld->getBoolConfig(CONFIG_VMAP_INDOOR_CHECK) && !isOutdoor) RemoveAurasWithAttribute(SPELL_ATTR0_OUTDOORS_ONLY); - if (areaFlag==0xffff) + if (areaFlag == 0xffff) return; int offset = areaFlag / 32; @@ -6898,21 +7016,23 @@ void Player::CheckAreaExploreAndOutdoor() GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EXPLORE_AREA); - AreaTableEntry const* p = GetAreaEntryByAreaFlagAndMap(areaFlag, GetMapId()); - if (!p) + AreaTableEntry const* areaEntry = GetAreaEntryByAreaFlagAndMap(areaFlag, GetMapId()); + if (!areaEntry) { - sLog->outError("PLAYER: Player %u discovered unknown area (x: %f y: %f map: %u", GetGUIDLow(), GetPositionX(), GetPositionY(), GetMapId()); + sLog->outError("Player %u discovered unknown area (x: %f y: %f z: %f map: %u", GetGUIDLow(), GetPositionX(), GetPositionY(), GetPositionZ(), GetMapId()); + return; } - else if (p->area_level > 0) + + if (areaEntry->area_level > 0) { - uint32 area = p->ID; + uint32 area = areaEntry->ID; if (getLevel() >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) { SendExplorationExperience(area, 0); } else { - int32 diff = int32(getLevel()) - p->area_level; + int32 diff = int32(getLevel()) - areaEntry->area_level; uint32 XP = 0; if (diff < -5) { @@ -6926,17 +7046,17 @@ void Player::CheckAreaExploreAndOutdoor() else if (exploration_percent < 0) exploration_percent = 0; - XP = uint32(sObjectMgr->GetBaseXP(p->area_level)*exploration_percent/100*sWorld->getRate(RATE_XP_EXPLORE)); + XP = uint32(sObjectMgr->GetBaseXP(areaEntry->area_level)*exploration_percent/100*sWorld->getRate(RATE_XP_EXPLORE)); } else { - XP = uint32(sObjectMgr->GetBaseXP(p->area_level)*sWorld->getRate(RATE_XP_EXPLORE)); + XP = uint32(sObjectMgr->GetBaseXP(areaEntry->area_level)*sWorld->getRate(RATE_XP_EXPLORE)); } GiveXP(XP, NULL); SendExplorationExperience(area, XP); } - sLog->outDetail("PLAYER: Player %u discovered a new area: %u", GetGUIDLow(), area); + sLog->outDetail("Player %u discovered a new area: %u", GetGUIDLow(), area); } } } @@ -7003,15 +7123,15 @@ int32 Player::CalculateReputationGain(uint32 creatureOrQuestLevel, int32 rep, in } //Calculates how many reputation points player gains in victim's enemy factions -void Player::RewardReputation(Unit* pVictim, float rate) +void Player::RewardReputation(Unit* victim, float rate) { - if (!pVictim || pVictim->GetTypeId() == TYPEID_PLAYER) + if (!victim || victim->GetTypeId() == TYPEID_PLAYER) return; - if (pVictim->ToCreature()->IsReputationGainDisabled()) + if (victim->ToCreature()->IsReputationGainDisabled()) return; - ReputationOnKillEntry const* Rep = sObjectMgr->GetReputationOnKilEntry(pVictim->ToCreature()->GetCreatureInfo()->Entry); + ReputationOnKillEntry const* Rep = sObjectMgr->GetReputationOnKilEntry(victim->ToCreature()->GetCreatureTemplate()->Entry); if (!Rep) return; @@ -7053,7 +7173,7 @@ void Player::RewardReputation(Unit* pVictim, float rate) if (Rep->RepFaction1 && (!Rep->TeamDependent || team == ALLIANCE)) { - int32 donerep1 = CalculateReputationGain(pVictim->getLevel(), Rep->RepValue1, ChampioningFaction ? ChampioningFaction : Rep->RepFaction1, false); + int32 donerep1 = CalculateReputationGain(victim->getLevel(), Rep->RepValue1, ChampioningFaction ? ChampioningFaction : Rep->RepFaction1, false); donerep1 = int32(donerep1*(rate + favored_rep_mult)); if (recruitAFriend) @@ -7067,7 +7187,7 @@ void Player::RewardReputation(Unit* pVictim, float rate) if (Rep->RepFaction2 && (!Rep->TeamDependent || team == HORDE)) { - int32 donerep2 = CalculateReputationGain(pVictim->getLevel(), Rep->RepValue2, ChampioningFaction ? ChampioningFaction : Rep->RepFaction2, false); + int32 donerep2 = CalculateReputationGain(victim->getLevel(), Rep->RepValue2, ChampioningFaction ? ChampioningFaction : Rep->RepFaction2, false); donerep2 = int32(donerep2*(rate + favored_rep_mult)); if (recruitAFriend) @@ -7490,10 +7610,13 @@ uint32 Player::GetGuildIdFromGuid(uint64 guid) uint8 Player::GetRankFromDB(uint64 guid) { - QueryResult result = CharacterDatabase.PQuery("SELECT rank FROM guild_member WHERE guid='%u'", GUID_LOPART(guid)); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_MEMBER); + stmt->setUInt32(0, GUID_LOPART(guid)); + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (result) { - uint32 v = result->Fetch()[0].GetUInt8(); + uint32 v = result->Fetch()[1].GetUInt8(); return v; } else @@ -7502,7 +7625,11 @@ uint8 Player::GetRankFromDB(uint64 guid) uint32 Player::GetArenaTeamIdFromDB(uint64 guid, uint8 type) { - QueryResult result = CharacterDatabase.PQuery("SELECT arena_team_member.arenateamid FROM arena_team_member JOIN arena_team ON arena_team_member.arenateamid = arena_team.arenateamid WHERE guid='%u' AND type='%u' LIMIT 1", GUID_LOPART(guid), type); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ARENA_TEAM_ID_BY_PLAYER_GUID); + stmt->setUInt32(0, GUID_LOPART(guid)); + stmt->setUInt8(1, type); + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (!result) return 0; @@ -7513,7 +7640,10 @@ uint32 Player::GetArenaTeamIdFromDB(uint64 guid, uint8 type) uint32 Player::GetZoneIdFromDB(uint64 guid) { uint32 guidLow = GUID_LOPART(guid); - QueryResult result = CharacterDatabase.PQuery("SELECT zone FROM characters WHERE guid='%u'", guidLow); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_ZONE); + stmt->setUInt32(0, guidLow); + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (!result) return 0; Field* fields = result->Fetch(); @@ -7522,7 +7652,10 @@ uint32 Player::GetZoneIdFromDB(uint64 guid) if (!zone) { // stored zone is zero, use generic and slow zone detection - result = CharacterDatabase.PQuery("SELECT map, position_x, position_y, position_z FROM characters WHERE guid='%u'", guidLow); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_POSITION_XYZ); + stmt->setUInt32(0, guidLow); + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (!result) return 0; fields = result->Fetch(); @@ -7549,7 +7682,10 @@ uint32 Player::GetZoneIdFromDB(uint64 guid) uint32 Player::GetLevelFromDB(uint64 guid) { - QueryResult result = CharacterDatabase.PQuery("SELECT level FROM characters WHERE guid='%u'", GUID_LOPART(guid)); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_LEVEL); + stmt->setUInt32(0, GUID_LOPART(guid)); + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (!result) return 0; @@ -7593,17 +7729,15 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea) } // group update - if (GetGroup()) + if (Group* group = GetGroup()) { SetGroupUpdateFlag(GROUP_UPDATE_FULL); - Group* grp = GetGroup(); - if (GetSession() && grp->isLFGGroup() && sLFGMgr->IsTeleported(GetGUID())) + if (GetSession() && group->isLFGGroup() && sLFGMgr->IsTeleported(GetGUID())) { - for (GroupReference* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next()) + for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) { - Player* tempplr = itr->getSource(); - if (tempplr) - GetSession()->SendNameQueryOpcode(tempplr->GetGUID()); + if (Player* member = itr->getSource()) + GetSession()->SendNameQueryOpcode(member->GetGUID()); } } } @@ -7620,9 +7754,8 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea) if (sWorld->getBoolConfig(CONFIG_WEATHER)) { - Weather* wth = WeatherMgr::FindWeather(zone->ID); - if (wth) - wth->SendWeatherUpdateToPlayer(this); + if (Weather* weather = WeatherMgr::FindWeather(zone->ID)) + weather->SendWeatherUpdateToPlayer(this); else { if (!WeatherMgr::AddWeather(zone->ID)) @@ -7633,6 +7766,8 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea) } } + sScriptMgr->OnPlayerUpdateZone(this, newZone, newArea); + // in PvP, any not controlled zone (except zone->team == 6, default case) // in PvE, only opposition team capital switch (zone->team) @@ -7652,7 +7787,7 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea) break; } - if (zone->flags & AREA_FLAG_CAPITAL) // in capital city + if (zone->flags & AREA_FLAG_CAPITAL) // Is in a capital city { if (!pvpInfo.inHostileArea || zone->IsSanctuary()) { @@ -7662,19 +7797,21 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea) } pvpInfo.inNoPvPArea = true; } - else // anywhere else + else { - if (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING)) // but resting (walk from city or maybe in tavern or leave tavern recently) + if (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING)) { - if (GetRestType() == REST_TYPE_IN_TAVERN) // has been in tavern. Is still in? + if (GetRestType() == REST_TYPE_IN_TAVERN) // Still inside a tavern or has recently left { - if (GetMapId() != GetInnPosMapId() || sqrt((GetPositionX()-GetInnPosX())*(GetPositionX()-GetInnPosX())+(GetPositionY()-GetInnPosY())*(GetPositionY()-GetInnPosY())+(GetPositionZ()-GetInnPosZ())*(GetPositionZ()-GetInnPosZ()))>40) + // Remove rest state if we have recently left a tavern. + // Why is 40 yd hardcoded? + if (GetMapId() != GetInnPosMapId() || GetExactDist(GetInnPosX(), GetInnPosY(), GetInnPosZ()) > 40.0f) { RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING); SetRestType(REST_TYPE_NO); } } - else // not in tavern (leave city then) + else // Recently left a capital city { RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING); SetRestType(REST_TYPE_NO); @@ -8223,6 +8360,10 @@ void Player::_ApplyWeaponDependentAuraMods(Item* item, WeaponAttackType attackTy void Player::_ApplyWeaponDependentAuraCritMod(Item* item, WeaponAttackType attackType, AuraEffect const* aura, bool apply) { + // don't apply mod if item is broken or cannot be used + if (item->IsBroken() || !CanUseAttackType(attackType)) + return; + // generic not weapon specific case processes in aura code if (aura->GetSpellInfo()->EquippedItemClass == -1) return; @@ -8236,13 +8377,13 @@ void Player::_ApplyWeaponDependentAuraCritMod(Item* item, WeaponAttackType attac default: return; } - if (!item->IsBroken()&&item->IsFitToSpellRequirements(aura->GetSpellInfo())) + if (item->IsFitToSpellRequirements(aura->GetSpellInfo())) HandleBaseModValue(mod, FLAT_MOD, float (aura->GetAmount()), apply); } void Player::_ApplyWeaponDependentAuraDamageMod(Item* item, WeaponAttackType attackType, AuraEffect const* aura, bool apply) { - //don't apply mod if item is broken + // don't apply mod if item is broken or cannot be used if (item->IsBroken() || !CanUseAttackType(attackType)) return; @@ -8473,13 +8614,15 @@ void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32 { uint32 enchant_id = item->GetEnchantmentId(EnchantmentSlot(e_slot)); SpellItemEnchantmentEntry const* pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id); - if (!pEnchant) continue; + if (!pEnchant) + continue; + for (uint8 s = 0; s < MAX_ITEM_ENCHANTMENT_EFFECTS; ++s) { if (pEnchant->type[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL) continue; - SpellEnchantProcEntry const* entry = sSpellMgr->GetSpellEnchantProcEvent(enchant_id); + SpellEnchantProcEntry const* entry = sSpellMgr->GetSpellEnchantProcEvent(enchant_id); if (entry && entry->procEx) { @@ -8791,7 +8934,7 @@ void Player::SendLoot(uint64 guid, LootType loot_type) if (go->getLootState() == GO_READY) { - uint32 lootid = go->GetGOInfo()->GetLootId(); + uint32 lootid = go->GetGOInfo()->GetLootId(); //TODO: fix this big hack if ((go->GetEntry() == BG_AV_OBJECTID_MINE_N || go->GetEntry() == BG_AV_OBJECTID_MINE_S)) @@ -8966,7 +9109,7 @@ void Player::SendLoot(uint64 guid, LootType loot_type) creature->lootForPickPocketed = true; loot->clear(); - if (uint32 lootid = creature->GetCreatureInfo()->pickpocketLootId) + if (uint32 lootid = creature->GetCreatureTemplate()->pickpocketLootId) loot->FillLoot(lootid, LootTemplates_Pickpocketing, this, true); // Generate extra money for pick pocket loot @@ -9013,7 +9156,7 @@ void Player::SendLoot(uint64 guid, LootType loot_type) if (loot_type == LOOT_SKINNING) { loot->clear(); - loot->FillLoot(creature->GetCreatureInfo()->SkinLootId, LootTemplates_Skinning, this, true); + loot->FillLoot(creature->GetCreatureTemplate()->SkinLootId, LootTemplates_Skinning, this, true); permission = OWNER_PERMISSION; } // set group rights only for loot_type != LOOT_SKINNING @@ -9179,6 +9322,9 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid) case 4100: // The Culling of Stratholme NumberOfFields = 13; break; + case 4273: // Ulduar + NumberOfFields = 10; + break; default: NumberOfFields = 12; break; @@ -9723,6 +9869,16 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid) data << uint32(3932) << uint32(0); // 13 WORLDSTATE_TIME_GUARDIAN_SHOW } break; + // Ulduar + case 4273: + if (instance && mapid == 603) + instance->FillInitialWorldStates(data); + else + { + data << uint32(4132) << uint32(0); // 9 WORLDSTATE_SHOW_CRATES + data << uint32(4131) << uint32(0); // 10 WORLDSTATE_CRATES_REVEALED + } + break; default: data << uint32(0x914) << uint32(0x0); // 7 data << uint32(0x913) << uint32(0x0); // 8 @@ -10106,7 +10262,8 @@ uint32 Player::GetItemCount(uint32 item, bool inBankAlso, Item* skipItem) const if (inBankAlso) { - for (uint8 i = BANK_SLOT_ITEM_START; i < BANK_SLOT_ITEM_END; ++i) + // checking every item from 39 to 74 (including bank bags) + for (uint8 i = BANK_SLOT_ITEM_START; i < BANK_SLOT_BAG_END; ++i) if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) if (pItem != skipItem && pItem->GetEntry() == item) count += pItem->GetCount(); @@ -10146,7 +10303,7 @@ uint32 Player::GetItemCountWithLimitCategory(uint32 limitCategory, Item* skipIte if (Bag* pBag = GetBagByPos(i)) count += pBag->GetItemCountWithLimitCategory(limitCategory, skipItem); - for (int i = BANK_SLOT_ITEM_START; i < BANK_SLOT_ITEM_END; ++i) + for (int i = BANK_SLOT_ITEM_START; i < BANK_SLOT_BAG_END; ++i) if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) if (pItem != skipItem) if (ItemTemplate const* pProto = pItem->GetTemplate()) @@ -10172,7 +10329,7 @@ Item* Player::GetItemByGuid(uint64 guid) const if (pItem->GetGUID() == guid) return pItem; - for (int i = BANK_SLOT_ITEM_START; i < BANK_SLOT_ITEM_END; ++i) + for (int i = BANK_SLOT_ITEM_START; i < BANK_SLOT_BAG_END; ++i) if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) if (pItem->GetGUID() == guid) return pItem; @@ -11283,7 +11440,8 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const Item* pItem = pItems[k]; // no item - if (!pItem) continue; + if (!pItem) + continue; sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanStoreItems %i. item = %u, count = %u", k + 1, pItem->GetEntry(), pItem->GetCount()); ItemTemplate const* pProto = pItem->GetTemplate(); @@ -11322,7 +11480,8 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const break; } } - if (b_found) continue; + if (b_found) + continue; for (int t = CURRENCYTOKEN_SLOT_START; t < CURRENCYTOKEN_SLOT_END; ++t) { @@ -11334,7 +11493,8 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const break; } } - if (b_found) continue; + if (b_found) + continue; for (int t = INVENTORY_SLOT_ITEM_START; t < INVENTORY_SLOT_ITEM_END; ++t) { @@ -11346,7 +11506,8 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const break; } } - if (b_found) continue; + if (b_found) + continue; for (int t = INVENTORY_SLOT_BAG_START; !b_found && t < INVENTORY_SLOT_BAG_END; ++t) { @@ -11367,7 +11528,8 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const } } } - if (b_found) continue; + if (b_found) + continue; } // special bag case @@ -11388,7 +11550,8 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const } } - if (b_found) continue; + if (b_found) + continue; if (pProto->BagFamily & BAG_FAMILY_MASK_CURRENCY_TOKENS) { @@ -11403,7 +11566,8 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const } } - if (b_found) continue; + if (b_found) + continue; for (int t = INVENTORY_SLOT_BAG_START; !b_found && t < INVENTORY_SLOT_BAG_END; ++t) { @@ -11427,7 +11591,8 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const } } } - if (b_found) continue; + if (b_found) + continue; } // search free slot @@ -11441,7 +11606,8 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const break; } } - if (b_found) continue; + if (b_found) + continue; // search free slot in bags for (int t = INVENTORY_SLOT_BAG_START; !b_found && t < INVENTORY_SLOT_BAG_END; ++t) @@ -11606,8 +11772,8 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool Item* offItem = GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND); ItemPosCountVec off_dest; if (offItem && (!not_loading || - CanUnequipItem(uint16(INVENTORY_SLOT_BAG_0) << 8 | EQUIPMENT_SLOT_OFFHAND, false) != EQUIP_ERR_OK || - CanStoreItem(NULL_BAG, NULL_SLOT, off_dest, offItem, false) != EQUIP_ERR_OK)) + CanUnequipItem(uint16(INVENTORY_SLOT_BAG_0) << 8 | EQUIPMENT_SLOT_OFFHAND, false) != EQUIP_ERR_OK || + CanStoreItem(NULL_BAG, NULL_SLOT, off_dest, offItem, false) != EQUIP_ERR_OK)) return swap ? EQUIP_ERR_ITEMS_CANT_BE_SWAPPED : EQUIP_ERR_INVENTORY_FULL; } } @@ -11667,7 +11833,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest uint32 count = pItem->GetCount(); - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanBankItem bag = %u, slot = %u, item = %u, count = %u", bag, slot, pItem->GetEntry(), pItem->GetCount()); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanBankItem bag = %u, slot = %u, item = %u, count = %u", bag, slot, pItem->GetEntry(), pItem->GetCount()); ItemTemplate const* pProto = pItem->GetTemplate(); if (!pProto) return swap ? EQUIP_ERR_ITEMS_CANT_BE_SWAPPED : EQUIP_ERR_ITEM_NOT_FOUND; @@ -11851,7 +12017,7 @@ InventoryResult Player::CanUseItem(Item* pItem, bool not_loading) const { if (pItem) { - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanUseItem item = %u", pItem->GetEntry()); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanUseItem item = %u", pItem->GetEntry()); if (!isAlive() && not_loading) return EQUIP_ERR_YOU_ARE_DEAD; @@ -11959,7 +12125,7 @@ InventoryResult Player::CanRollForItemInLFG(ItemTemplate const* proto, WorldObje Map const* map = lootedObject->GetMap(); if (uint32 dungeonId = sLFGMgr->GetDungeon(GetGroup()->GetGUID(), true)) if (LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(dungeonId)) - if (uint32(dungeon->map) == map->GetId() && dungeon->difficulty == map->GetDifficulty()) + if (uint32(dungeon->map) == map->GetId() && dungeon->difficulty == uint32(map->GetDifficulty())) lootedObjectInDungeon = true; if (!lootedObjectInDungeon) @@ -12055,16 +12221,11 @@ Item* Player::StoreNewItem(ItemPosCountVec const& dest, uint32 item, bool update pItem->SetItemRandomProperties(randomPropertyId); pItem = StoreItem(dest, pItem, update); - const ItemTemplate* proto = pItem->GetTemplate(); - for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i) - if (proto->Spells[i].SpellTrigger == ITEM_SPELLTRIGGER_ON_NO_DELAY_USE && proto->Spells[i].SpellId > 0) // On obtain trigger - CastSpell(this, proto->Spells[i].SpellId, true, pItem); - if (allowedLooters.size() > 1 && pItem->GetTemplate()->GetMaxStackSize() == 1 && pItem->IsSoulBound()) { pItem->SetSoulboundTradeable(allowedLooters); pItem->SetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME, GetTotalPlayedTime()); - m_itemSoulboundTradeable.push_back(pItem); + AddTradeableItem(pItem); // save data std::ostringstream ss; @@ -12115,7 +12276,7 @@ Item* Player::_StoreItem(uint16 pos, Item* pItem, uint32 count, bool clone, bool uint8 bag = pos >> 8; uint8 slot = pos & 255; - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: StoreItem bag = %u, slot = %u, item = %u, count = %u, guid = %u", bag, slot, pItem->GetEntry(), count, pItem->GetGUIDLow()); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: StoreItem bag = %u, slot = %u, item = %u, count = %u, guid = %u", bag, slot, pItem->GetEntry(), count, pItem->GetGUIDLow()); Item* pItem2 = GetItemByPos(bag, slot); @@ -12165,6 +12326,14 @@ Item* Player::_StoreItem(uint16 pos, Item* pItem, uint32 count, bool clone, bool AddEnchantmentDurations(pItem); AddItemDurations(pItem); + + const ItemTemplate* proto = pItem->GetTemplate(); + for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i) + if (proto->Spells[i].SpellTrigger == ITEM_SPELLTRIGGER_ON_NO_DELAY_USE && proto->Spells[i].SpellId > 0) // On obtain trigger + if (bag == INVENTORY_SLOT_BAG_0 || (bag >= INVENTORY_SLOT_BAG_START && bag < INVENTORY_SLOT_BAG_END)) + if (!HasAura(proto->Spells[i].SpellId)) + CastSpell(this, proto->Spells[i].SpellId, true, pItem); + return pItem; } else @@ -12201,6 +12370,13 @@ Item* Player::_StoreItem(uint16 pos, Item* pItem, uint32 count, bool clone, bool pItem2->SetState(ITEM_CHANGED, this); + const ItemTemplate* proto = pItem2->GetTemplate(); + for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i) + if (proto->Spells[i].SpellTrigger == ITEM_SPELLTRIGGER_ON_NO_DELAY_USE && proto->Spells[i].SpellId > 0) // On obtain trigger + if (bag == INVENTORY_SLOT_BAG_0 || (bag >= INVENTORY_SLOT_BAG_START && bag < INVENTORY_SLOT_BAG_END)) + if (!HasAura(proto->Spells[i].SpellId)) + CastSpell(this, proto->Spells[i].SpellId, true, pItem2); + return pItem2; } } @@ -12371,7 +12547,7 @@ void Player::VisualizeItem(uint8 slot, Item* pItem) if (pItem->GetTemplate()->Bonding == BIND_WHEN_EQUIPED || pItem->GetTemplate()->Bonding == BIND_WHEN_PICKED_UP || pItem->GetTemplate()->Bonding == BIND_QUEST_ITEM) pItem->SetBinding(true); - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: EquipItem slot = %u, item = %u", slot, pItem->GetEntry()); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: EquipItem slot = %u, item = %u", slot, pItem->GetEntry()); m_items[slot] = pItem; SetUInt64Value(PLAYER_FIELD_INV_SLOT_HEAD + (slot * 2), pItem->GetGUID()); @@ -12396,7 +12572,7 @@ void Player::RemoveItem(uint8 bag, uint8 slot, bool update) Item* pItem = GetItemByPos(bag, slot); if (pItem) { - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: RemoveItem bag = %u, slot = %u, item = %u", bag, slot, pItem->GetEntry()); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: RemoveItem bag = %u, slot = %u, item = %u", bag, slot, pItem->GetEntry()); RemoveEnchantmentDurations(pItem); RemoveItemDurations(pItem); @@ -12507,7 +12683,7 @@ void Player::MoveItemToInventory(ItemPosCountVec const& dest, Item* pItem, bool } if (pLastItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE)) - m_itemSoulboundTradeable.push_back(pLastItem); + AddTradeableItem(pLastItem); } void Player::DestroyItem(uint8 bag, uint8 slot, bool update) @@ -12515,7 +12691,7 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update) Item* pItem = GetItemByPos(bag, slot); if (pItem) { - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyItem bag = %u, slot = %u, item = %u", bag, slot, pItem->GetEntry()); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyItem bag = %u, slot = %u, item = %u", bag, slot, pItem->GetEntry()); // Also remove all contained items if the item is a bag. // This if () prevents item saving crashes if the condition for a bag to be empty before being destroyed was bypassed somehow. if (pItem->IsNotEmptyBag()) @@ -12606,7 +12782,7 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update) void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequip_check) { - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyItemCount item = %u, count = %u", item, count); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyItemCount item = %u, count = %u", item, count); uint32 remcount = 0; // in inventory @@ -12735,7 +12911,7 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ void Player::DestroyZoneLimitedItem(bool update, uint32 new_zone) { - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyZoneLimitedItem in map %u and area %u", GetMapId(), new_zone); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyZoneLimitedItem in map %u and area %u", GetMapId(), new_zone); // in inventory for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++) @@ -12767,7 +12943,7 @@ void Player::DestroyConjuredItems(bool update) { // used when entering arena // destroys all conjured items - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyConjuredItems"); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyConjuredItems"); // in inventory for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++) @@ -12818,7 +12994,7 @@ void Player::DestroyItemCount(Item* pItem, uint32 &count, bool update) if (!pItem) return; - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyItemCount item (GUID: %u, Entry: %u) count = %u", pItem->GetGUIDLow(), pItem->GetEntry(), count); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyItemCount item (GUID: %u, Entry: %u) count = %u", pItem->GetGUIDLow(), pItem->GetEntry(), count); if (pItem->GetCount() <= count) { @@ -12881,7 +13057,7 @@ void Player::SplitItem(uint16 src, uint16 dst, uint32 count) return; } - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: SplitItem bag = %u, slot = %u, item = %u, count = %u", dstbag, dstslot, pSrcItem->GetEntry(), count); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: SplitItem bag = %u, slot = %u, item = %u, count = %u", dstbag, dstslot, pSrcItem->GetEntry(), count); Item* pNewItem = pSrcItem->CloneItem(count, this); if (!pNewItem) { @@ -12966,7 +13142,7 @@ void Player::SwapItem(uint16 src, uint16 dst) if (!pSrcItem) return; - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: SwapItem bag = %u, slot = %u, item = %u", dstbag, dstslot, pSrcItem->GetEntry()); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: SwapItem bag = %u, slot = %u, item = %u", dstbag, dstslot, pSrcItem->GetEntry()); if (!isAlive()) { @@ -12996,7 +13172,7 @@ void Player::SwapItem(uint16 src, uint16 dst) } // prevent put equipped/bank bag in self - if (IsBagPos (src) && srcslot == dstbag) + if (IsBagPos(src) && srcslot == dstbag) { SendEquipError(EQUIP_ERR_NONEMPTY_BAG_OVER_OTHER_BAG, pSrcItem, pDstItem); return; @@ -13054,7 +13230,7 @@ void Player::SwapItem(uint16 src, uint16 dst) if (IsBankPos(src)) ItemAddedQuestCheck(pSrcItem->GetEntry(), pSrcItem->GetCount()); } - else if (IsBankPos (dst)) + else if (IsBankPos(dst)) { ItemPosCountVec dest; InventoryResult msg = CanBankItem(dstbag, dstslot, dest, pSrcItem, false); @@ -13068,7 +13244,7 @@ void Player::SwapItem(uint16 src, uint16 dst) BankItem(dest, pSrcItem, true); ItemRemovedQuestCheck(pSrcItem->GetEntry(), pSrcItem->GetCount()); } - else if (IsEquipmentPos (dst)) + else if (IsEquipmentPos(dst)) { uint16 dest; InventoryResult msg = CanEquipItem(dstslot, dest, pSrcItem, false); @@ -13094,9 +13270,9 @@ void Player::SwapItem(uint16 src, uint16 dst) uint16 eDest = 0; if (IsInventoryPos(dst)) msg = CanStoreItem(dstbag, dstslot, sDest, pSrcItem, false); - else if (IsBankPos (dst)) + else if (IsBankPos(dst)) msg = CanBankItem(dstbag, dstslot, sDest, pSrcItem, false); - else if (IsEquipmentPos (dst)) + else if (IsEquipmentPos(dst)) msg = CanEquipItem(dstslot, eDest, pSrcItem, false); else return; @@ -13110,9 +13286,9 @@ void Player::SwapItem(uint16 src, uint16 dst) if (IsInventoryPos(dst)) StoreItem(sDest, pSrcItem, true); - else if (IsBankPos (dst)) + else if (IsBankPos(dst)) BankItem(sDest, pSrcItem, true); - else if (IsEquipmentPos (dst)) + else if (IsEquipmentPos(dst)) { EquipItem(eDest, pSrcItem, true); AutoUnequipOffhandIfNeed(); @@ -13342,7 +13518,7 @@ void Player::AddItemToBuyBackSlot(Item* pItem) } RemoveItemFromBuyBackSlot(slot, true); - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: AddItemToBuyBackSlot item = %u, slot = %u", pItem->GetEntry(), slot); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: AddItemToBuyBackSlot item = %u, slot = %u", pItem->GetEntry(), slot); m_items[slot] = pItem; time_t base = time(NULL); @@ -13350,8 +13526,8 @@ void Player::AddItemToBuyBackSlot(Item* pItem) uint32 eslot = slot - BUYBACK_SLOT_START; SetUInt64Value(PLAYER_FIELD_VENDORBUYBACK_SLOT_1 + (eslot * 2), pItem->GetGUID()); - if (ItemTemplate const* pProto = pItem->GetTemplate()) - SetUInt32Value(PLAYER_FIELD_BUYBACK_PRICE_1 + eslot, pProto->SellPrice * pItem->GetCount()); + if (ItemTemplate const* proto = pItem->GetTemplate()) + SetUInt32Value(PLAYER_FIELD_BUYBACK_PRICE_1 + eslot, proto->SellPrice * pItem->GetCount()); else SetUInt32Value(PLAYER_FIELD_BUYBACK_PRICE_1 + eslot, 0); SetUInt32Value(PLAYER_FIELD_BUYBACK_TIMESTAMP_1 + eslot, (uint32)etime); @@ -13364,7 +13540,7 @@ void Player::AddItemToBuyBackSlot(Item* pItem) Item* Player::GetItemFromBuyBackSlot(uint32 slot) { - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: GetItemFromBuyBackSlot slot = %u", slot); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: GetItemFromBuyBackSlot slot = %u", slot); if (slot >= BUYBACK_SLOT_START && slot < BUYBACK_SLOT_END) return m_items[slot]; return NULL; @@ -13372,7 +13548,7 @@ Item* Player::GetItemFromBuyBackSlot(uint32 slot) void Player::RemoveItemFromBuyBackSlot(uint32 slot, bool del) { - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: RemoveItemFromBuyBackSlot slot = %u", slot); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: RemoveItemFromBuyBackSlot slot = %u", slot); if (slot >= BUYBACK_SLOT_START && slot < BUYBACK_SLOT_END) { Item* pItem = m_items[slot]; @@ -13504,6 +13680,11 @@ void Player::UpdateSoulboundTradeItems() } } +void Player::AddTradeableItem(Item* item) +{ + m_itemSoulboundTradeable.push_back(item); +} + //TODO: should never allow an item to be added to m_itemSoulboundTradeable twice void Player::RemoveTradeableItem(Item* item) { @@ -14129,12 +14310,10 @@ void Player::PrepareGossipMenu(WorldObject* source, uint32 menuId /*= 0*/, bool menuItemBounds = sObjectMgr->GetGossipMenuItemsMapBounds(0); uint32 npcflags = 0; - Creature* creature = NULL; if (source->GetTypeId() == TYPEID_UNIT) { - creature = source->ToCreature(); - npcflags = creature->GetUInt32Value(UNIT_NPC_FLAGS); + npcflags = source->GetUInt32Value(UNIT_NPC_FLAGS); if (npcflags & UNIT_NPC_FLAG_QUESTGIVER && showQuests) PrepareQuestMenu(source->GetGUID()); } @@ -14149,7 +14328,7 @@ void Player::PrepareGossipMenu(WorldObject* source, uint32 menuId /*= 0*/, bool if (!sConditionMgr->IsObjectMeetToConditions(this, source, itr->second.Conditions)) continue; - if (source->GetTypeId() == TYPEID_UNIT) + if (Creature* creature = source->ToCreature()) { if (!(itr->second.OptionNpcflag & npcflags)) continue; @@ -14186,7 +14365,7 @@ void Player::PrepareGossipMenu(WorldObject* source, uint32 menuId /*= 0*/, bool canTalk = false; break; case GOSSIP_OPTION_UNLEARNPETTALENTS: - if (!GetPet() || GetPet()->getPetType() != HUNTER_PET || GetPet()->m_spells.size() <= 1 || creature->GetCreatureInfo()->trainer_type != TRAINER_TYPE_PETS || creature->GetCreatureInfo()->trainer_class != CLASS_HUNTER) + if (!GetPet() || GetPet()->getPetType() != HUNTER_PET || GetPet()->m_spells.size() <= 1 || creature->GetCreatureTemplate()->trainer_type != TRAINER_TYPE_PETS || creature->GetCreatureTemplate()->trainer_class != CLASS_HUNTER) canTalk = false; break; case GOSSIP_OPTION_TAXIVENDOR: @@ -14222,10 +14401,8 @@ void Player::PrepareGossipMenu(WorldObject* source, uint32 menuId /*= 0*/, bool break; } } - else if (source->GetTypeId() == TYPEID_GAMEOBJECT) + else if (GameObject* go = source->ToGameObject()) { - GameObject* go = source->ToGameObject(); - switch (itr->second.OptionType) { case GOSSIP_OPTION_GOSSIP: @@ -14335,15 +14512,15 @@ void Player::OnGossipSelect(WorldObject* source, uint32 gossipListId, uint32 men { case GOSSIP_OPTION_GOSSIP: { + if (menuItemData->GossipActionPoi) + PlayerTalkClass->SendPointOfInterest(menuItemData->GossipActionPoi); + if (menuItemData->GossipActionMenuId) { PrepareGossipMenu(source, menuItemData->GossipActionMenuId); SendPreparedGossip(source); } - if (menuItemData->GossipActionPoi) - PlayerTalkClass->SendPointOfInterest(menuItemData->GossipActionPoi); - break; } case GOSSIP_OPTION_OUTDOORPVP: @@ -14422,7 +14599,7 @@ void Player::OnGossipSelect(WorldObject* source, uint32 gossipListId, uint32 men return; } - GetSession()->SendBattlegGroundList(guid, bgTypeId); + GetSession()->SendBattleGroundList(guid, bgTypeId); break; } } @@ -14461,7 +14638,7 @@ uint32 Player::GetDefaultGossipMenuForSource(WorldObject* source) switch (source->GetTypeId()) { case TYPEID_UNIT: - return source->ToCreature()->GetCreatureInfo()->GossipMenuId; + return source->ToCreature()->GetCreatureTemplate()->GossipMenuId; case TYPEID_GAMEOBJECT: return source->ToGameObject()->GetGOInfo()->GetGossipMenuId(); default: @@ -14477,15 +14654,15 @@ uint32 Player::GetDefaultGossipMenuForSource(WorldObject* source) void Player::PrepareQuestMenu(uint64 guid) { - QuestRelationBounds pObjectQR; - QuestRelationBounds pObjectQIR; + QuestRelationBounds objectQR; + QuestRelationBounds objectQIR; // pets also can have quests Creature* creature = ObjectAccessor::GetCreatureOrPetOrVehicle(*this, guid); if (creature) { - pObjectQR = sObjectMgr->GetCreatureQuestRelationBounds(creature->GetEntry()); - pObjectQIR = sObjectMgr->GetCreatureQuestInvolvedRelationBounds(creature->GetEntry()); + objectQR = sObjectMgr->GetCreatureQuestRelationBounds(creature->GetEntry()); + objectQIR = sObjectMgr->GetCreatureQuestInvolvedRelationBounds(creature->GetEntry()); } else { @@ -14496,8 +14673,8 @@ void Player::PrepareQuestMenu(uint64 guid) GameObject* pGameObject = _map->GetGameObject(guid); if (pGameObject) { - pObjectQR = sObjectMgr->GetGOQuestRelationBounds(pGameObject->GetEntry()); - pObjectQIR = sObjectMgr->GetGOQuestInvolvedRelationBounds(pGameObject->GetEntry()); + objectQR = sObjectMgr->GetGOQuestRelationBounds(pGameObject->GetEntry()); + objectQIR = sObjectMgr->GetGOQuestInvolvedRelationBounds(pGameObject->GetEntry()); } else return; @@ -14506,7 +14683,7 @@ void Player::PrepareQuestMenu(uint64 guid) QuestMenu &qm = PlayerTalkClass->GetQuestMenu(); qm.ClearMenu(); - for (QuestRelations::const_iterator i = pObjectQIR.first; i != pObjectQIR.second; ++i) + for (QuestRelations::const_iterator i = objectQIR.first; i != objectQIR.second; ++i) { uint32 quest_id = i->second; QuestStatus status = GetQuestStatus(quest_id); @@ -14518,7 +14695,7 @@ void Player::PrepareQuestMenu(uint64 guid) // qm.AddMenuItem(quest_id, 2); } - for (QuestRelations::const_iterator i = pObjectQR.first; i != pObjectQR.second; ++i) + for (QuestRelations::const_iterator i = objectQR.first; i != objectQR.second; ++i) { uint32 quest_id = i->second; Quest const* quest = sObjectMgr->GetQuestTemplate(quest_id); @@ -14638,11 +14815,11 @@ bool Player::IsActiveQuest(uint32 quest_id) const Quest const* Player::GetNextQuest(uint64 guid, Quest const* quest) { - QuestRelationBounds pObjectQR; + QuestRelationBounds objectQR; Creature* creature = ObjectAccessor::GetCreatureOrPetOrVehicle(*this, guid); if (creature) - pObjectQR = sObjectMgr->GetCreatureQuestRelationBounds(creature->GetEntry()); + objectQR = sObjectMgr->GetCreatureQuestRelationBounds(creature->GetEntry()); else { //we should obtain map pointer from GetMap() in 99% of cases. Special case @@ -14651,13 +14828,13 @@ Quest const* Player::GetNextQuest(uint64 guid, Quest const* quest) ASSERT(_map); GameObject* pGameObject = _map->GetGameObject(guid); if (pGameObject) - pObjectQR = sObjectMgr->GetGOQuestRelationBounds(pGameObject->GetEntry()); + objectQR = sObjectMgr->GetGOQuestRelationBounds(pGameObject->GetEntry()); else return NULL; } uint32 nextQuestID = quest->GetNextQuestInChain(); - for (QuestRelations::const_iterator itr = pObjectQR.first; itr != pObjectQR.second; ++itr) + for (QuestRelations::const_iterator itr = objectQR.first; itr != objectQR.second; ++itr) { if (itr->second == nextQuestID) return sObjectMgr->GetQuestTemplate(nextQuestID); @@ -16057,9 +16234,9 @@ void Player::CastedCreatureOrGO(uint32 entry, uint64 guid, uint32 spell_id) if (reqTarget != entry) // if entry doesn't match, check for killcredits referenced in template { CreatureTemplate const* cinfo = sObjectMgr->GetCreatureTemplate(entry); - for (uint8 j = 0; j < MAX_KILL_CREDIT; ++j) - if (cinfo->KillCredit[j] == reqTarget) - entry = cinfo->KillCredit[j]; + for (uint8 k = 0; k < MAX_KILL_CREDIT; ++k) + if (cinfo->KillCredit[k] == reqTarget) + entry = cinfo->KillCredit[k]; } } } @@ -16568,7 +16745,7 @@ void Player::_LoadEquipmentSets(PreparedQueryResult result) EquipmentSet eqSet; eqSet.Guid = fields[0].GetUInt64(); - uint32 index = fields[1].GetUInt32(); + uint8 index = fields[1].GetUInt8(); eqSet.Name = fields[2].GetString(); eqSet.IconName = fields[3].GetString(); eqSet.state = EQUIPMENT_SET_UNCHANGED; @@ -16610,7 +16787,10 @@ void Player::_LoadBGData(PreparedQueryResult result) bool Player::LoadPositionFromDB(uint32& mapid, float& x, float& y, float& z, float& o, bool& in_flight, uint64 guid) { - QueryResult result = CharacterDatabase.PQuery("SELECT position_x, position_y, position_z, orientation, map, taxi_path FROM characters WHERE guid = '%u'", GUID_LOPART(guid)); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_POSITION); + stmt->setUInt32(0, GUID_LOPART(guid)); + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (!result) return false; @@ -16790,12 +16970,12 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) InitPrimaryProfessions(); // to max set before any spell loaded // init saved position, and fix it later if problematic - uint32 transGUID = uint32(fields[31].GetUInt64()); // field type is uint64 but lowguid is saved + uint32 transGUID = uint32(fields[31].GetUInt32()); Relocate(fields[12].GetFloat(), fields[13].GetFloat(), fields[14].GetFloat(), fields[16].GetFloat()); uint32 mapId = fields[15].GetUInt16(); - uint32 instanceId = fields[54].GetUInt8(); + uint32 instanceId = fields[54].GetUInt32(); - uint32 dungeonDiff = fields[39].GetUInt32() & 0x0F; + uint32 dungeonDiff = fields[39].GetUInt8() & 0x0F; if (dungeonDiff >= MAX_DUNGEON_DIFFICULTY) dungeonDiff = DUNGEON_DIFFICULTY_NORMAL; uint32 raidDiff = (fields[39].GetUInt8() >> 4) & 0x0F; @@ -17137,7 +17317,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) float bubble0 = 0.031f; //speed collect rest bonus in offline, in logout, in tavern, city (section/in hour) float bubble1 = 0.125f; - float bubble = fields[23].GetUInt32() > 0 + float bubble = fields[23].GetUInt8() > 0 ? bubble1*sWorld->getRate(RATE_REST_OFFLINE_IN_TAVERN_OR_CITY) : bubble0*sWorld->getRate(RATE_REST_OFFLINE_IN_WILDERNESS); @@ -17299,7 +17479,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) } // RaF stuff. - m_grantableLevels = fields[61].GetUInt32(); + m_grantableLevels = fields[61].GetUInt8(); if (GetSession()->IsARecruiter() || (GetSession()->GetRecruiterId() != 0)) SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_REFER_A_FRIEND); @@ -17523,6 +17703,7 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timeDiff) uint32 zoneId = GetZoneId(); std::map bagMap; // fast guid lookup for bags + std::map invalidBagMap; // fast guid lookup for bags std::list problematicItems; SQLTransaction trans = CharacterDatabase.BeginTransaction(); @@ -17567,9 +17748,15 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timeDiff) // Remember bags that may contain items in them if (err == EQUIP_ERR_OK) + { if (IsBagPos(item->GetPos())) if (Bag* pBag = item->ToBag()) bagMap[item->GetGUIDLow()] = pBag; + } + else + if (IsBagPos(item->GetPos())) + if (item->IsBag()) + invalidBagMap[item->GetGUIDLow()] = item; } else { @@ -17581,8 +17768,23 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timeDiff) ItemPosCountVec dest; err = CanStoreItem(itr->second->GetSlot(), slot, dest, item); if (err == EQUIP_ERR_OK) - itr->second->StoreItem(slot, item, true); + item = StoreItem(dest, item, true); + } + else if (invalidBagMap.find(bagGuid) != invalidBagMap.end()) + { + std::map::iterator itr = invalidBagMap.find(bagGuid); + if (std::find(problematicItems.begin(),problematicItems.end(),itr->second) != problematicItems.end()) + err = EQUIP_ERR_INT_BAG_ERROR; + } + else + { + sLog->outError("Player::_LoadInventory: player (GUID: %u, name: '%s') has item (GUID: %u, entry: %u) which doesnt have a valid bag (Bag GUID: %u, slot: %u). Possible cheat?", + GetGUIDLow(), GetName(), item->GetGUIDLow(), item->GetEntry(), bagGuid, slot); + item->DeleteFromInventoryDB(trans); + delete item; + continue; } + } // Item's state may have changed after storing @@ -17621,6 +17823,7 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timeDiff) Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, Field* fields) { + PreparedStatement* stmt = NULL; Item* item = NULL; uint32 itemGuid = fields[13].GetUInt32(); uint32 itemEntry = fields[14].GetUInt32(); @@ -17650,7 +17853,11 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F { sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Player::_LoadInventory: player (GUID: %u, name: '%s') has item (GUID: %u, entry: %u) with expired refund time (%u). Deleting refund data and removing refundable flag.", GetGUIDLow(), GetName(), item->GetGUIDLow(), item->GetEntry(), item->GetPlayedTime()); - trans->PAppend("DELETE FROM item_refund_instance WHERE item_guid = '%u'", item->GetGUIDLow()); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_REFUND_INSTANCE); + stmt->setUInt32(0, item->GetGUIDLow()); + trans->Append(stmt); + item->RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE); } else @@ -17685,7 +17892,7 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F for (Tokens::iterator itr = GUIDlist.begin(); itr != GUIDlist.end(); ++itr) looters.insert(atol(*itr)); item->SetSoulboundTradeable(looters); - m_itemSoulboundTradeable.push_back(item); + AddTradeableItem(item); } else { @@ -17701,7 +17908,7 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F GameEventMgr::ActiveEvents const& activeEventsList = sGameEventMgr->GetActiveEventList(); for (GameEventMgr::ActiveEvents::const_iterator itr = activeEventsList.begin(); itr != activeEventsList.end(); ++itr) { - if (events[*itr].holiday_id == proto->HolidayId) + if (uint32(events[*itr].holiday_id) == proto->HolidayId) { remove = false; break; @@ -17759,7 +17966,7 @@ void Player::_LoadMailedItems(Mail* mail) { sLog->outError("Player %u has unknown item_template (ProtoType) in mailed items(GUID: %u template: %u) in mail (%u), deleted.", GetGUIDLow(), itemGuid, itemTemplate, mail->messageID); - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVALID_MAIL_ITEM); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVALID_MAIL_ITEM); stmt->setUInt32(0, itemGuid); CharacterDatabase.Execute(stmt); @@ -17775,10 +17982,8 @@ void Player::_LoadMailedItems(Mail* mail) { sLog->outError("Player::_LoadMailedItems - Item in mail (%u) doesn't exist !!!! - item guid: %u, deleted from mail", mail->messageID, itemGuid); - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_MAIL_ITEM); - + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_MAIL_ITEM); stmt->setUInt32(0, itemGuid); - CharacterDatabase.Execute(stmt); item->FSetState(ITEM_REMOVED); @@ -17798,38 +18003,42 @@ void Player::_LoadMailInit(PreparedQueryResult resultUnread, PreparedQueryResult //set a count of unread mails //QueryResult* resultMails = CharacterDatabase.PQuery("SELECT COUNT(id) FROM mail WHERE receiver = '%u' AND (checked & 1)=0 AND deliver_time <= '" UI64FMTD "'", GUID_LOPART(playerGuid), (uint64)cTime); if (resultUnread) - unReadMails = (*resultUnread)[0].GetUInt8(); + unReadMails = uint8((*resultUnread)[0].GetUInt64()); // store nearest delivery time (it > 0 and if it < current then at next player update SendNewMaill will be called) //resultMails = CharacterDatabase.PQuery("SELECT MIN(deliver_time) FROM mail WHERE receiver = '%u' AND (checked & 1)=0", GUID_LOPART(playerGuid)); if (resultDelivery) - m_nextMailDelivereTime = (time_t)(*resultDelivery)[0].GetUInt64(); + m_nextMailDelivereTime = time_t((*resultDelivery)[0].GetUInt32()); } void Player::_LoadMail() { m_mail.clear(); - //mails are in right order 0 1 2 3 4 5 6 7 8 9 10 11 12 13 - QueryResult result = CharacterDatabase.PQuery("SELECT id, messageType, sender, receiver, subject, body, has_items, expire_time, deliver_time, money, cod, checked, stationery, mailTemplateId FROM mail WHERE receiver = '%u' ORDER BY id DESC", GetGUIDLow()); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAIL); + stmt->setUInt32(0, GetGUIDLow()); + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (result) { do { Field* fields = result->Fetch(); Mail* m = new Mail; - m->messageID = fields[0].GetUInt32(); - m->messageType = fields[1].GetUInt8(); - m->sender = fields[2].GetUInt32(); - m->receiver = fields[3].GetUInt32(); - m->subject = fields[4].GetString(); - m->body = fields[5].GetString(); - bool has_items = fields[6].GetBool(); - m->expire_time = time_t(fields[7].GetUInt32()); - m->deliver_time = time_t(fields[8].GetUInt32()); - m->money = fields[9].GetUInt32(); - m->COD = fields[10].GetUInt32(); - m->checked = fields[11].GetUInt32(); - m->stationery = fields[12].GetUInt8(); + + m->messageID = fields[0].GetUInt32(); + m->messageType = fields[1].GetUInt8(); + m->sender = fields[2].GetUInt32(); + m->receiver = fields[3].GetUInt32(); + m->subject = fields[4].GetString(); + m->body = fields[5].GetString(); + bool has_items = fields[6].GetBool(); + m->expire_time = time_t(fields[7].GetUInt32()); + m->deliver_time = time_t(fields[8].GetUInt32()); + m->money = fields[9].GetUInt32(); + m->COD = fields[10].GetUInt32(); + m->checked = fields[11].GetUInt8(); + m->stationery = fields[12].GetUInt8(); m->mailTemplateId = fields[13].GetInt16(); if (m->mailTemplateId && !sMailTemplateStore.LookupEntry(m->mailTemplateId)) @@ -17891,7 +18100,8 @@ void Player::_LoadQuestStatus(PreparedQueryResult result) else { questStatusData.Status = QUEST_STATUS_INCOMPLETE; - sLog->outError("Player %s have invalid quest %d status (%u), replaced by QUEST_STATUS_INCOMPLETE(3).", GetName(), quest_id, qstatus); + sLog->outError("Player %s (GUID: %u) has invalid quest %d status (%u), replaced by QUEST_STATUS_INCOMPLETE(3).", + GetName(), GetGUIDLow(), quest_id, qstatus); } questStatusData.Explored = (fields[2].GetUInt8() > 0); @@ -18021,7 +18231,7 @@ void Player::_LoadDailyQuestStatus(PreparedQueryResult result) uint32 quest_id = fields[0].GetUInt32(); // save _any_ from daily quest times (it must be after last reset anyway) - m_lastDailyQuestTime = (time_t)fields[1].GetUInt64(); + m_lastDailyQuestTime = time_t(fields[1].GetUInt32()); Quest const* quest = sObjectMgr->GetQuestTemplate(quest_id); if (!quest) @@ -18170,7 +18380,7 @@ void Player::_LoadBoundInstances(PreparedQueryResult result) if (deleteInstance) { - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INSTANCE); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INSTANCE_BY_INSTANCE_GUID); stmt->setUInt32(0, GetGUIDLow()); stmt->setUInt32(1, instanceId); @@ -18226,7 +18436,7 @@ void Player::UnbindInstance(BoundInstancesMap::iterator &itr, Difficulty difficu { if (!unload) { - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INSTANCE); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INSTANCE_BY_INSTANCE_GUID); stmt->setUInt32(0, GetGUIDLow()); stmt->setUInt32(1, itr->second.save->GetInstanceId()); @@ -18234,6 +18444,9 @@ void Player::UnbindInstance(BoundInstancesMap::iterator &itr, Difficulty difficu CharacterDatabase.Execute(stmt); } + if (itr->second.perm) + GetSession()->SendCalendarRaidLockout(itr->second.save, false); + itr->second.save->RemovePlayer(this); // save can become invalid m_boundInstances[difficulty].erase(itr++); } @@ -18303,6 +18516,8 @@ void Player::BindToInstance() data << uint32(0); GetSession()->SendPacket(&data); BindToInstance(mapSave, true); + + GetSession()->SendCalendarRaidLockout(mapSave, true); } void Player::SendRaidInfo() @@ -18583,7 +18798,7 @@ void Player::SaveToDB(bool create /*=false*/) outDebugValues(); PreparedStatement* stmt = NULL; - uint16 index = 0; + uint8 index = 0; if (create) { @@ -18632,7 +18847,7 @@ void Player::SaveToDB(bool create /*=false*/) stmt->setUInt8(index++, m_stableSlots); stmt->setUInt16(index++, (uint16)m_atLoginFlags); stmt->setUInt16(index++, GetZoneId()); - stmt->setUInt32(index++, m_deathExpireTime); + stmt->setUInt32(index++, uint32(m_deathExpireTime)); ss.str(""); ss << m_taxi.SaveTaxiDestinationsToString(); @@ -18743,7 +18958,7 @@ void Player::SaveToDB(bool create /*=false*/) stmt->setUInt8(index++, m_stableSlots); stmt->setUInt16(index++, (uint16)m_atLoginFlags); stmt->setUInt16(index++, GetZoneId()); - stmt->setUInt32(index++, m_deathExpireTime); + stmt->setUInt32(index++, uint32(m_deathExpireTime)); ss.str(""); ss << m_taxi.SaveTaxiDestinationsToString(); @@ -18849,29 +19064,51 @@ void Player::SaveInventoryAndGoldToDB(SQLTransaction& trans) void Player::SaveGoldToDB(SQLTransaction& trans) { - trans->PAppend("UPDATE characters SET money = '%u' WHERE guid = '%u'", GetMoney(), GetGUIDLow()); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UDP_CHAR_MONEY); + stmt->setUInt32(0, GetMoney()); + stmt->setUInt32(1, GetGUIDLow()); + trans->Append(stmt); } void Player::_SaveActions(SQLTransaction& trans) { + PreparedStatement* stmt = NULL; + for (ActionButtonList::iterator itr = m_actionButtons.begin(); itr != m_actionButtons.end();) { switch (itr->second.uState) { case ACTIONBUTTON_NEW: - trans->PAppend("INSERT INTO character_action (guid, spec, button, action, type) VALUES ('%u', '%u', '%u', '%u', '%u')", - GetGUIDLow(), GetActiveSpec(), (uint32)itr->first, (uint32)itr->second.GetAction(), (uint32)itr->second.GetType()); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_ACTION); + stmt->setUInt32(0, GetGUIDLow()); + stmt->setUInt8(1, m_activeSpec); + stmt->setUInt8(2, itr->first); + stmt->setUInt32(3, itr->second.GetAction()); + stmt->setUInt8(4, uint8(itr->second.GetType())); + trans->Append(stmt); + itr->second.uState = ACTIONBUTTON_UNCHANGED; ++itr; break; case ACTIONBUTTON_CHANGED: - trans->PAppend("UPDATE character_action SET action = '%u', type = '%u' WHERE guid = '%u' AND button = '%u' AND spec = '%u'", - (uint32)itr->second.GetAction(), (uint32)itr->second.GetType(), GetGUIDLow(), (uint32)itr->first, GetActiveSpec()); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_ACTION); + stmt->setUInt32(0, itr->second.GetAction()); + stmt->setUInt8(1, uint8(itr->second.GetType())); + stmt->setUInt32(2, GetGUIDLow()); + stmt->setUInt8(3, itr->first); + stmt->setUInt8(4, m_activeSpec); + trans->Append(stmt); + itr->second.uState = ACTIONBUTTON_UNCHANGED; ++itr; break; case ACTIONBUTTON_DELETED: - trans->PAppend("DELETE FROM character_action WHERE guid = '%u' and button = '%u' and spec = '%u'", GetGUIDLow(), (uint32)itr->first, GetActiveSpec()); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACTION_BY_BUTTON_SPEC); + stmt->setUInt32(0, GetGUIDLow()); + stmt->setUInt8(1, itr->first); + stmt->setUInt8(2, m_activeSpec); + trans->Append(stmt); + m_actionButtons.erase(itr++); break; default: @@ -18883,11 +19120,11 @@ void Player::_SaveActions(SQLTransaction& trans) void Player::_SaveAuras(SQLTransaction& trans) { - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_AURA); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_AURA); stmt->setUInt32(0, GetGUIDLow()); trans->Append(stmt); - for (AuraMap::const_iterator itr = m_ownedAuras.begin(); itr != m_ownedAuras.end() ; ++itr) + for (AuraMap::const_iterator itr = m_ownedAuras.begin(); itr != m_ownedAuras.end(); ++itr) { if (!itr->second->CanBeSaved()) continue; @@ -18939,6 +19176,7 @@ void Player::_SaveAuras(SQLTransaction& trans) void Player::_SaveInventory(SQLTransaction& trans) { + PreparedStatement* stmt = NULL; // force items in buyback slots to new state // and remove those that aren't already for (uint8 i = BUYBACK_SLOT_START; i < BUYBACK_SLOT_END; ++i) @@ -18946,8 +19184,12 @@ void Player::_SaveInventory(SQLTransaction& trans) Item* item = m_items[i]; if (!item || item->GetState() == ITEM_NEW) continue; - trans->PAppend("DELETE FROM character_inventory WHERE item = '%u'", item->GetGUIDLow()); - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_INSTANCE); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INVENTORY_BY_ITEM); + stmt->setUInt32(0, item->GetGUIDLow()); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_INSTANCE); stmt->setUInt32(0, item->GetGUIDLow()); trans->Append(stmt); m_items[i]->FSetState(ITEM_NEW); @@ -19005,7 +19247,12 @@ void Player::_SaveInventory(SQLTransaction& trans) bagTestGUID = test2->GetGUIDLow(); sLog->outError("Player(GUID: %u Name: %s)::_SaveInventory - the bag(%u) and slot(%u) values for the item with guid %u (state %d) are incorrect, the player doesn't have an item at that position!", lowGuid, GetName(), item->GetBagSlot(), item->GetSlot(), item->GetGUIDLow(), (int32)item->GetState()); // according to the test that was just performed nothing should be in this slot, delete - trans->PAppend("DELETE FROM character_inventory WHERE bag=%u AND slot=%u AND guid=%u", bagTestGUID, item->GetSlot(), lowGuid); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INVENTORY_BY_BAG_SLOT); + stmt->setUInt32(0, bagTestGUID); + stmt->setUInt8(1, item->GetSlot()); + stmt->setUInt32(2, lowGuid); + trans->Append(stmt); + // also THIS item should be somewhere else, cheat attempt item->FSetState(ITEM_REMOVED); // we are IN updateQueue right now, can't use SetState which modifies the queue DeleteRefundReference(item->GetGUIDLow()); @@ -19036,7 +19283,7 @@ void Player::_SaveInventory(SQLTransaction& trans) trans->Append(stmt); break; case ITEM_REMOVED: - stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVENTORY_ITEM); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INVENTORY_BY_ITEM); stmt->setUInt32(0, item->GetGUIDLow()); trans->Append(stmt); case ITEM_UNCHANGED: @@ -19053,17 +19300,32 @@ void Player::_SaveMail(SQLTransaction& trans) if (!m_mailsLoaded) return; + PreparedStatement* stmt = NULL; + for (PlayerMails::iterator itr = m_mail.begin(); itr != m_mail.end(); ++itr) { Mail* m = (*itr); if (m->state == MAIL_STATE_CHANGED) { - trans->PAppend("UPDATE mail SET has_items = '%u', expire_time = '" UI64FMTD "', deliver_time = '" UI64FMTD "', money = '%u', cod = '%u', checked = '%u' WHERE id = '%u'", - m->HasItems() ? 1 : 0, (uint64)m->expire_time, (uint64)m->deliver_time, m->money, m->COD, m->checked, m->messageID); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_MAIL); + stmt->setUInt8(0, uint8(m->HasItems() ? 1 : 0)); + stmt->setUInt32(1, uint32(m->expire_time)); + stmt->setUInt32(2, uint32(m->deliver_time)); + stmt->setUInt32(3, m->money); + stmt->setUInt32(4, m->COD); + stmt->setUInt8(5, uint8(m->checked)); + stmt->setUInt32(6, m->messageID); + + trans->Append(stmt); + if (!m->removedItems.empty()) { for (std::vector::iterator itr2 = m->removedItems.begin(); itr2 != m->removedItems.end(); ++itr2) - trans->PAppend("DELETE FROM mail_items WHERE item_guid = '%u'", *itr2); + { + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_MAIL_ITEM); + stmt->setUInt32(0, *itr2); + trans->Append(stmt); + } m->removedItems.clear(); } m->state = MAIL_STATE_UNCHANGED; @@ -19080,8 +19342,13 @@ void Player::_SaveMail(SQLTransaction& trans) trans->Append(stmt); } } - trans->PAppend("DELETE FROM mail WHERE id = '%u'", m->messageID); - trans->PAppend("DELETE FROM mail_items WHERE mail_id = '%u'", m->messageID); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_MAIL_BY_ID); + stmt->setUInt32(0, m->messageID); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_MAIL_ITEM_BY_ID); + stmt->setUInt32(0, m->messageID); + trans->Append(stmt); } } @@ -19110,6 +19377,7 @@ void Player::_SaveQuestStatus(SQLTransaction& trans) QuestStatusSaveMap::iterator saveItr; QuestStatusMap::iterator statusItr; + PreparedStatement* stmt = NULL; bool keepAbandoned = !(sWorld->GetCleaningFlags() & CharacterDatabaseCleaner::CLEANING_FLAG_QUESTSTATUS); @@ -19119,12 +19387,33 @@ void Player::_SaveQuestStatus(SQLTransaction& trans) { statusItr = m_QuestStatus.find(saveItr->first); if (statusItr != m_QuestStatus.end() && (keepAbandoned || statusItr->second.Status != QUEST_STATUS_NONE)) - trans->PAppend("REPLACE INTO character_queststatus (guid, quest, status, explored, timer, mobcount1, mobcount2, mobcount3, mobcount4, itemcount1, itemcount2, itemcount3, itemcount4, playercount) " - "VALUES ('%u', '%u', '%u', '%u', '" UI64FMTD "', '%u', '%u', '%u', '%u', '%u', '%u', '%u', '%u', '%u')", - GetGUIDLow(), statusItr->first, statusItr->second.Status, statusItr->second.Explored, uint64(statusItr->second.Timer / IN_MILLISECONDS+ sWorld->GetGameTime()), statusItr->second.CreatureOrGOCount[0], statusItr->second.CreatureOrGOCount[1], statusItr->second.CreatureOrGOCount[2], statusItr->second.CreatureOrGOCount[3], statusItr->second.ItemCount[0], statusItr->second.ItemCount[1], statusItr->second.ItemCount[2], statusItr->second.ItemCount[3], statusItr->second.PlayerCount); + { + uint8 index = 0; + stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_CHAR_QUESTSTATUS); + + stmt->setUInt32(index++, GetGUIDLow()); + stmt->setUInt32(index++, statusItr->first); + stmt->setUInt8(index++, uint8(statusItr->second.Status)); + stmt->setBool(index++, statusItr->second.Explored); + stmt->setUInt32(index++, uint32(statusItr->second.Timer / IN_MILLISECONDS+ sWorld->GetGameTime())); + + for (uint8 i = 0; i < 4; i++) + stmt->setUInt16(index++, statusItr->second.CreatureOrGOCount[i]); + + for (uint8 i = 0; i < 4; i++) + stmt->setUInt16(index++, statusItr->second.ItemCount[i]); + + stmt->setUInt16(index, statusItr->second.PlayerCount); + trans->Append(stmt); + } } else - trans->PAppend("DELETE FROM character_queststatus WHERE guid = %u AND quest = %u", GetGUIDLow(), saveItr->first); + { + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_QUESTSTATUS_BY_QUEST); + stmt->setUInt32(0, GetGUIDLow()); + stmt->setUInt32(1, saveItr->first); + trans->Append(stmt); + } } m_QuestStatusSave.clear(); @@ -19132,9 +19421,20 @@ void Player::_SaveQuestStatus(SQLTransaction& trans) for (saveItr = m_RewardedQuestsSave.begin(); saveItr != m_RewardedQuestsSave.end(); ++saveItr) { if (saveItr->second) - trans->PAppend("INSERT IGNORE INTO character_queststatus_rewarded (guid, quest) VALUES (%u, %u)", GetGUIDLow(), saveItr->first); + { + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_QUESTSTATUS); + stmt->setUInt32(0, GetGUIDLow()); + stmt->setUInt32(1, saveItr->first); + trans->Append(stmt); + + } else if (!keepAbandoned) - trans->PAppend("DELETE FROM character_queststatus_rewarded WHERE guid = %u AND quest = %u", GetGUIDLow(), saveItr->first); + { + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_QUESTSTATUS_REWARDED_BY_QUEST); + stmt->setUInt32(0, GetGUIDLow()); + stmt->setUInt32(1, saveItr->first); + trans->Append(stmt); + } } m_RewardedQuestsSave.clear(); @@ -19157,20 +19457,22 @@ void Player::_SaveDailyQuestStatus(SQLTransaction& trans) stmt->setUInt32(0, GetGUIDLow()); trans->Append(stmt); for (uint32 quest_daily_idx = 0; quest_daily_idx < PLAYER_MAX_DAILY_QUESTS; ++quest_daily_idx) + { if (GetUInt32Value(PLAYER_FIELD_DAILY_QUESTS_1+quest_daily_idx)) { - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHARACTER_DAILYQUESTSTATUS); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHARACTER_DAILYQUESTSTATUS); stmt->setUInt32(0, GetGUIDLow()); stmt->setUInt32(1, GetUInt32Value(PLAYER_FIELD_DAILY_QUESTS_1+quest_daily_idx)); stmt->setUInt64(2, uint64(m_lastDailyQuestTime)); trans->Append(stmt); } + } if (!m_DFQuests.empty()) { for (DFQuestsDoneList::iterator itr = m_DFQuests.begin(); itr != m_DFQuests.end(); ++itr) { - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHARACTER_DAILYQUESTSTATUS); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHARACTER_DAILYQUESTSTATUS); stmt->setUInt32(0, GetGUIDLow()); stmt->setUInt32(1, (*itr)); stmt->setUInt64(2, uint64(m_lastDailyQuestTime)); @@ -19193,7 +19495,7 @@ void Player::_SaveWeeklyQuestStatus(SQLTransaction& trans) { uint32 quest_id = *iter; - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHARACTER_WEEKLYQUESTSTATUS); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHARACTER_WEEKLYQUESTSTATUS); stmt->setUInt32(0, GetGUIDLow()); stmt->setUInt32(1, quest_id); trans->Append(stmt); @@ -19219,7 +19521,7 @@ void Player::_SaveSeasonalQuestStatus(SQLTransaction& trans) { uint32 quest_id = (*itr); - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHARACTER_SEASONALQUESTSTATUS); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHARACTER_SEASONALQUESTSTATUS); stmt->setUInt32(0, GetGUIDLow()); stmt->setUInt32(1, quest_id); stmt->setUInt32(2, event_id); @@ -19232,6 +19534,7 @@ void Player::_SaveSeasonalQuestStatus(SQLTransaction& trans) void Player::_SaveSkills(SQLTransaction& trans) { + PreparedStatement* stmt = NULL; // we don't need transactions here. for (SkillStatusMap::iterator itr = mSkillStatus.begin(); itr != mSkillStatus.end();) { @@ -19243,7 +19546,11 @@ void Player::_SaveSkills(SQLTransaction& trans) if (itr->second.uState == SKILL_DELETED) { - trans->PAppend("DELETE FROM character_skills WHERE guid = '%u' AND skill = '%u' ", GetGUIDLow(), itr->first); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SKILL_BY_SKILL); + stmt->setUInt32(0, GetGUIDLow()); + stmt->setUInt32(1, itr->first); + trans->Append(stmt); + mSkillStatus.erase(itr++); continue; } @@ -19255,12 +19562,22 @@ void Player::_SaveSkills(SQLTransaction& trans) switch (itr->second.uState) { case SKILL_NEW: - trans->PAppend("INSERT INTO character_skills (guid, skill, value, max) VALUES ('%u', '%u', '%u', '%u')", - GetGUIDLow(), itr->first, value, max); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_SKILLS); + stmt->setUInt32(0, GetGUIDLow()); + stmt->setUInt16(1, uint16(itr->first)); + stmt->setUInt16(2, value); + stmt->setUInt16(3, max); + trans->Append(stmt); + break; case SKILL_CHANGED: - trans->PAppend("UPDATE character_skills SET value = '%u', max = '%u'WHERE guid = '%u' AND skill = '%u' ", - value, max, GetGUIDLow(), itr->first); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_UDP_CHAR_SKILLS); + stmt->setUInt16(0, value); + stmt->setUInt16(1, max); + stmt->setUInt32(2, GetGUIDLow()); + stmt->setUInt16(3, uint16(itr->first)); + trans->Append(stmt); + break; default: break; @@ -19273,14 +19590,28 @@ void Player::_SaveSkills(SQLTransaction& trans) void Player::_SaveSpells(SQLTransaction& trans) { + PreparedStatement* stmt = NULL; + for (PlayerSpellMap::iterator itr = m_spells.begin(); itr != m_spells.end();) { if (itr->second->state == PLAYERSPELL_REMOVED || itr->second->state == PLAYERSPELL_CHANGED) - trans->PAppend("DELETE FROM character_spell WHERE guid = '%u' and spell = '%u'", GetGUIDLow(), itr->first); + { + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SPELL_BY_SPELL); + stmt->setUInt32(0, itr->first); + stmt->setUInt32(1, GetGUIDLow()); + trans->Append(stmt); + } // add only changed/new not dependent spells if (!itr->second->dependent && (itr->second->state == PLAYERSPELL_NEW || itr->second->state == PLAYERSPELL_CHANGED)) - trans->PAppend("INSERT INTO character_spell (guid, spell, active, disabled) VALUES ('%u', '%u', '%u', '%u')", GetGUIDLow(), itr->first, itr->second->active ? 1 : 0, itr->second->disabled ? 1 : 0); + { + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_SPELL); + stmt->setUInt32(0, GetGUIDLow()); + stmt->setUInt32(1, itr->first); + stmt->setBool(2, itr->second->active); + stmt->setBool(3, itr->second->disabled); + trans->Append(stmt); + } if (itr->second->state == PLAYERSPELL_REMOVED) { @@ -19303,31 +19634,38 @@ void Player::_SaveStats(SQLTransaction& trans) if (!sWorld->getIntConfig(CONFIG_MIN_LEVEL_STAT_SAVE) || getLevel() < sWorld->getIntConfig(CONFIG_MIN_LEVEL_STAT_SAVE)) return; - trans->PAppend("DELETE FROM character_stats WHERE guid = '%u'", GetGUIDLow()); - std::ostringstream ss; - ss << "INSERT INTO character_stats (guid, maxhealth, maxpower1, maxpower2, maxpower3, maxpower4, maxpower5, " - "strength, agility, stamina, intellect, spirit, armor, resHoly, resFire, resNature, resFrost, resShadow, resArcane, " - "blockPct, dodgePct, parryPct, critPct, rangedCritPct, spellCritPct, attackPower, rangedAttackPower, spellPower, resilience) VALUES (" - << GetGUIDLow() << ',' - << GetMaxHealth() << ','; - for (uint8 i = 0; i < MAX_STORED_POWERS; ++i) - ss << GetMaxPower(Powers(i)) << ','; + PreparedStatement* stmt = NULL; + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_STATS); + stmt->setUInt32(0, GetGUIDLow()); + trans->Append(stmt); + + uint8 index = 0; + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_STATS); + stmt->setUInt32(index++, GetGUIDLow()); + stmt->setUInt32(index++, GetMaxHealth()); + + stmt->setUInt32(index++, GetMaxPower(Powers(i))); + for (uint8 i = 0; i < MAX_STATS; ++i) - ss << GetStat(Stats(i)) << ','; - // armor + school resistances + stmt->setUInt32(index++, GetStat(Stats(i))); + for (int i = 0; i < MAX_SPELL_SCHOOL; ++i) - ss << GetResistance(SpellSchools(i)) << ','; - ss << GetFloatValue(PLAYER_BLOCK_PERCENTAGE) << ',' - << GetFloatValue(PLAYER_DODGE_PERCENTAGE) << ',' - << GetFloatValue(PLAYER_PARRY_PERCENTAGE) << ',' - << GetFloatValue(PLAYER_CRIT_PERCENTAGE) << ',' - << GetFloatValue(PLAYER_RANGED_CRIT_PERCENTAGE) << ',' - << GetFloatValue(PLAYER_SPELL_CRIT_PERCENTAGE1) << ',' - << GetUInt32Value(UNIT_FIELD_ATTACK_POWER) << ',' - << GetUInt32Value(UNIT_FIELD_RANGED_ATTACK_POWER) << ',' - << GetBaseSpellPowerBonus() << ',' - << GetUInt32Value(PLAYER_FIELD_COMBAT_RATING_1 + CR_CRIT_TAKEN_SPELL) << ')'; - trans->Append(ss.str().c_str()); + stmt->setUInt32(index++, GetResistance(SpellSchools(i))); + + stmt->setFloat(index++, GetFloatValue(PLAYER_BLOCK_PERCENTAGE)); + stmt->setFloat(index++, GetFloatValue(PLAYER_DODGE_PERCENTAGE)); + stmt->setFloat(index++, GetFloatValue(PLAYER_PARRY_PERCENTAGE)); + stmt->setFloat(index++, GetFloatValue(PLAYER_CRIT_PERCENTAGE)); + stmt->setFloat(index++, GetFloatValue(PLAYER_RANGED_CRIT_PERCENTAGE)); + stmt->setFloat(index++, GetFloatValue(PLAYER_SPELL_CRIT_PERCENTAGE1)); + stmt->setUInt32(index++, GetUInt32Value(UNIT_FIELD_ATTACK_POWER)); + stmt->setUInt32(index++, GetUInt32Value(UNIT_FIELD_RANGED_ATTACK_POWER)); + stmt->setUInt32(index++, GetBaseSpellPowerBonus()); + stmt->setUInt32(index++, GetUInt32Value(PLAYER_FIELD_COMBAT_RATING_1 + CR_CRIT_TAKEN_SPELL)); + + trans->Append(stmt); } void Player::outDebugValues() const @@ -19426,8 +19764,10 @@ void Player::SetUInt32ValueInArray(Tokens& tokens, uint16 index, uint32 value) void Player::Customize(uint64 guid, uint8 gender, uint8 skin, uint8 face, uint8 hairStyle, uint8 hairColor, uint8 facialHair) { - // 0 - QueryResult result = CharacterDatabase.PQuery("SELECT playerBytes2 FROM characters WHERE guid = '%u'", GUID_LOPART(guid)); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_PLAYERBYTES2); + stmt->setUInt32(0, GUID_LOPART(guid)); + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (!result) return; @@ -19437,7 +19777,7 @@ void Player::Customize(uint64 guid, uint8 gender, uint8 skin, uint8 face, uint8 playerBytes2 &= ~0xFF; playerBytes2 |= facialHair; - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GENDER_PLAYERBYTES); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GENDER_PLAYERBYTES); stmt->setUInt8(0, gender); stmt->setUInt32(1, skin | (face << 8) | (hairStyle << 16) | (hairColor << 24)); @@ -19571,7 +19911,11 @@ void Player::SendResetInstanceSuccess(uint32 MapId) void Player::SendResetInstanceFailed(uint32 reason, uint32 MapId) { - // TODO: find what other fail reasons there are besides players in the instance + /*reasons for instance reset failure: + // 0: There are players inside the instance. + // 1: There are players offline in your party. + // 2>: There are players in your party attempting to zone into an instance. + */ WorldPacket data(SMSG_INSTANCE_RESET_FAILED, 4); data << uint32(reason); data << uint32(MapId); @@ -19864,7 +20208,7 @@ void Player::PetSpellInitialize() WorldPacket data(SMSG_PET_SPELLS, 8+2+4+4+4*MAX_UNIT_ACTION_BAR_INDEX+1+1); data << uint64(pet->GetGUID()); - data << uint16(pet->GetCreatureInfo()->family); // creature family (required for pet talents) + data << uint16(pet->GetCreatureTemplate()->family); // creature family (required for pet talents) data << uint32(0); data << uint8(pet->GetReactState()) << uint8(charmInfo->GetCommandState()) << uint16(0); @@ -19958,7 +20302,7 @@ void Player::VehicleSpellInitialize() WorldPacket data(SMSG_PET_SPELLS, 8 + 2 + 4 + 4 + 4 * 10 + 1 + 1 + cooldownCount * (4 + 2 + 4 + 4)); data << uint64(veh->GetGUID()); - data << uint16(veh->GetCreatureInfo()->family); + data << uint16(veh->GetCreatureTemplate()->family); data << uint32(0); // The following three segments are read as one uint32 data << uint8(veh->GetReactState()); @@ -20044,7 +20388,7 @@ void Player::CharmSpellInitialize() uint8 addlist = 0; if (charm->GetTypeId() != TYPEID_PLAYER) { - //CreatureInfo const* cinfo = charm->ToCreature()->GetCreatureInfo(); + //CreatureInfo const* cinfo = charm->ToCreature()->GetCreatureTemplate(); //if (cinfo && cinfo->type == CREATURE_TYPE_DEMON && getClass() == CLASS_WARLOCK) { for (uint32 i = 0; i < MAX_SPELL_CHARM; ++i) @@ -20174,9 +20518,13 @@ void Player::RestoreSpellMods(Spell* spell, uint32 ownerAuraId, Aura* aura) continue; // check if mod affected this spell + // first, check if the mod aura applied at least one spellmod to this spell Spell::UsedSpellMods::iterator iterMod = spell->m_appliedMods.find(mod->ownerAura); if (iterMod == spell->m_appliedMods.end()) continue; + // secondly, check if the current mod is one of the spellmods applied by the mod aura + if (!(mod->mask & spell->m_spellInfo->SpellFamilyFlags)) + continue; // remove from list spell->m_appliedMods.erase(iterMod); @@ -20270,16 +20618,24 @@ void Player::SendProficiency(ItemClass itemClass, uint32 itemSubclassMask) { WorldPacket data(SMSG_SET_PROFICIENCY, 1 + 4); data << uint8(itemClass) << uint32(itemSubclassMask); - GetSession()->SendPacket (&data); + GetSession()->SendPacket(&data); } void Player::RemovePetitionsAndSigns(uint64 guid, uint32 type) { - QueryResult result = QueryResult(NULL); + PreparedStatement* stmt; + if (type == 10) - result = CharacterDatabase.PQuery("SELECT ownerguid, petitionguid FROM petition_sign WHERE playerguid = '%u'", GUID_LOPART(guid)); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_SIG_BY_GUID); else - result = CharacterDatabase.PQuery("SELECT ownerguid, petitionguid FROM petition_sign WHERE playerguid = '%u' AND type = '%u'", GUID_LOPART(guid), type); + { + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_SIG_BY_GUID_TYPE); + stmt->setUInt8(0, uint8(type)); + } + + stmt->setUInt32(0, GUID_LOPART(guid)); + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (result) { do // this part effectively does nothing, since the deletion / modification only takes place _after_ the PetitionQuery. Though I don't know if the result remains intact if I execute the delete query beforehand. @@ -20316,13 +20672,25 @@ void Player::RemovePetitionsAndSigns(uint64 guid, uint32 type) SQLTransaction trans = CharacterDatabase.BeginTransaction(); if (type == 10) { - trans->PAppend("DELETE FROM petition WHERE ownerguid = '%u'", GUID_LOPART(guid)); - trans->PAppend("DELETE FROM petition_sign WHERE ownerguid = '%u'", GUID_LOPART(guid)); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PETITION_BY_OWNER); + stmt->setUInt32(0, GUID_LOPART(guid)); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PETITION_SIGNATURE_BY_OWNER); + stmt->setUInt32(0, GUID_LOPART(guid)); + trans->Append(stmt); } else { - trans->PAppend("DELETE FROM petition WHERE ownerguid = '%u' AND type = '%u'", GUID_LOPART(guid), type); - trans->PAppend("DELETE FROM petition_sign WHERE ownerguid = '%u' AND type = '%u'", GUID_LOPART(guid), type); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PETITION_BY_OWNER_AND_TYPE); + stmt->setUInt32(0, GUID_LOPART(guid)); + stmt->setUInt8(1, uint8(type)); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PETITION_SIGNATURE_BY_OWNER_AND_TYPE); + stmt->setUInt32(0, GUID_LOPART(guid)); + stmt->setUInt8(1, uint8(type)); + trans->Append(stmt); } CharacterDatabase.CommitTransaction(trans); } @@ -20905,10 +21273,10 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32 } uint32 price = 0; - if(crItem->IsGoldRequired(pProto) && pProto->BuyPrice > 0) //Assume price cannot be negative (do not know why it is int32) + if (crItem->IsGoldRequired(pProto) && pProto->BuyPrice > 0) //Assume price cannot be negative (do not know why it is int32) { uint32 maxCount = MAX_MONEY_AMOUNT / pProto->BuyPrice; - if((uint32)count > maxCount) + if ((uint32)count > maxCount) { sLog->outError("Player %s tried to buy %u item id %u, causing overflow", GetName(), (uint32)count, pProto->ItemId); count = (uint8)maxCount; @@ -21541,13 +21909,6 @@ inline void UpdateVisibilityOf_helper(std::set& s64, T* target, std::set s64.insert(target->GetGUID()); } -template<> -inline void UpdateVisibilityOf_helper(std::set& s64, GameObject* target, std::set& /*v*/) -{ - if (!target->IsTransport()) - s64.insert(target->GetGUID()); -} - template<> inline void UpdateVisibilityOf_helper(std::set& s64, Creature* target, std::set& v) { @@ -22238,6 +22599,18 @@ void Player::SendAurasForTarget(Unit* target) if (!target || target->GetVisibleAuras()->empty()) // speedup things return; + /*! Blizz sends certain movement packets sometimes even before CreateObject + These movement packets are usually found in SMSG_COMPRESSED_MOVES + */ + if (target->HasAuraType(SPELL_AURA_FEATHER_FALL)) + target->SendMovementFeatherFall(); + + if (target->HasAuraType(SPELL_AURA_WATER_WALK)) + target->SendMovementWaterWalking(); + + if (target->HasAuraType(SPELL_AURA_HOVER)) + target->SendMovementHover(); + WorldPacket data(SMSG_AURA_UPDATE_ALL); data.append(target->GetPackGUID()); @@ -22711,20 +23084,20 @@ uint32 Player::GetResurrectionSpellId() } // Used in triggers for check "Only to targets that grant experience or honor" req -bool Player::isHonorOrXPTarget(Unit* pVictim) +bool Player::isHonorOrXPTarget(Unit* victim) { - uint8 v_level = pVictim->getLevel(); + uint8 v_level = victim->getLevel(); uint8 k_grey = Trinity::XP::GetGrayLevel(getLevel()); // Victim level less gray level if (v_level <= k_grey) return false; - if (pVictim->GetTypeId() == TYPEID_UNIT) + if (victim->GetTypeId() == TYPEID_UNIT) { - if (pVictim->ToCreature()->isTotem() || - pVictim->ToCreature()->isPet() || - pVictim->ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_XP_AT_KILL) + if (victim->ToCreature()->isTotem() || + victim->ToCreature()->isPet() || + victim->ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_XP_AT_KILL) return false; } return true; @@ -22771,9 +23144,9 @@ bool Player::GetsRecruitAFriendBonus(bool forXP) return recruitAFriend; } -void Player::RewardPlayerAndGroupAtKill(Unit* pVictim, bool isBattleGround) +void Player::RewardPlayerAndGroupAtKill(Unit* victim, bool isBattleGround) { - KillRewarder(this, pVictim, isBattleGround).Reward(); + KillRewarder(this, victim, isBattleGround).Reward(); } void Player::RewardPlayerAndGroupAtEvent(uint32 creature_id, WorldObject* pRewardSource) @@ -23005,7 +23378,8 @@ void Player::SendCorpseReclaimDelay(bool load) else delay = GetCorpseReclaimDelay(pvp); - if (!delay) return; + if (!delay) + return; //! corpse reclaim delay 30 * 1000ms or longer at often deaths WorldPacket data(SMSG_CORPSE_RECLAIM_DELAY, 4); @@ -23129,15 +23503,39 @@ void Player::UpdateUnderwaterState(Map* m, float x, float y, float z) ZLiquidStatus res = m->getLiquidStatus(x, y, z, MAP_ALL_LIQUIDS, &liquid_status); if (!res) { - m_MirrorTimerFlags &= ~(UNDERWATER_INWATER|UNDERWATER_INLAVA|UNDERWATER_INSLIME|UNDERWARER_INDARKWATER); - // Small hack for enable breath in WMO - /* if (IsInWater()) - m_MirrorTimerFlags|=UNDERWATER_INWATER; */ + m_MirrorTimerFlags &= ~(UNDERWATER_INWATER | UNDERWATER_INLAVA | UNDERWATER_INSLIME | UNDERWARER_INDARKWATER); + if (_lastLiquid && _lastLiquid->SpellId) + RemoveAurasDueToSpell(_lastLiquid->SpellId); + + _lastLiquid = NULL; return; } + if (uint32 liqEntry = liquid_status.entry) + { + LiquidTypeEntry const* liquid = sLiquidTypeStore.LookupEntry(liqEntry); + if (_lastLiquid && _lastLiquid->SpellId && _lastLiquid->Id != liqEntry) + RemoveAurasDueToSpell(_lastLiquid->SpellId); + + if (liquid && liquid->SpellId) + { + if (res & (LIQUID_MAP_UNDER_WATER | LIQUID_MAP_IN_WATER)) + CastSpell(this, liquid->SpellId, true); + else + RemoveAurasDueToSpell(liquid->SpellId); + } + + _lastLiquid = liquid; + } + else if (_lastLiquid && _lastLiquid->SpellId) + { + RemoveAurasDueToSpell(_lastLiquid->SpellId); + _lastLiquid = NULL; + } + + // All liquids type - check under water position - if (liquid_status.type&(MAP_LIQUID_TYPE_WATER|MAP_LIQUID_TYPE_OCEAN|MAP_LIQUID_TYPE_MAGMA|MAP_LIQUID_TYPE_SLIME)) + if (liquid_status.type_flags & (MAP_LIQUID_TYPE_WATER | MAP_LIQUID_TYPE_OCEAN | MAP_LIQUID_TYPE_MAGMA | MAP_LIQUID_TYPE_SLIME)) { if (res & LIQUID_MAP_UNDER_WATER) m_MirrorTimerFlags |= UNDERWATER_INWATER; @@ -23146,23 +23544,23 @@ void Player::UpdateUnderwaterState(Map* m, float x, float y, float z) } // Allow travel in dark water on taxi or transport - if ((liquid_status.type & MAP_LIQUID_TYPE_DARK_WATER) && !isInFlight() && !GetTransport()) + if ((liquid_status.type_flags & MAP_LIQUID_TYPE_DARK_WATER) && !isInFlight() && !GetTransport()) m_MirrorTimerFlags |= UNDERWARER_INDARKWATER; else m_MirrorTimerFlags &= ~UNDERWARER_INDARKWATER; // in lava check, anywhere in lava level - if (liquid_status.type&MAP_LIQUID_TYPE_MAGMA) + if (liquid_status.type_flags & MAP_LIQUID_TYPE_MAGMA) { - if (res & (LIQUID_MAP_UNDER_WATER|LIQUID_MAP_IN_WATER|LIQUID_MAP_WATER_WALK)) + if (res & (LIQUID_MAP_UNDER_WATER | LIQUID_MAP_IN_WATER | LIQUID_MAP_WATER_WALK)) m_MirrorTimerFlags |= UNDERWATER_INLAVA; else m_MirrorTimerFlags &= ~UNDERWATER_INLAVA; } // in slime check, anywhere in slime level - if (liquid_status.type&MAP_LIQUID_TYPE_SLIME) + if (liquid_status.type_flags & MAP_LIQUID_TYPE_SLIME) { - if (res & (LIQUID_MAP_UNDER_WATER|LIQUID_MAP_IN_WATER|LIQUID_MAP_WATER_WALK)) + if (res & (LIQUID_MAP_UNDER_WATER | LIQUID_MAP_IN_WATER | LIQUID_MAP_WATER_WALK)) m_MirrorTimerFlags |= UNDERWATER_INSLIME; else m_MirrorTimerFlags &= ~UNDERWATER_INSLIME; @@ -23386,7 +23784,6 @@ void Player::SetTitle(CharTitlesEntry const* title, bool lost) GetSession()->SendPacket(&data); } -/*-----------------------TRINITY--------------------------*/ bool Player::isTotalImmunity() { AuraEffectList const& immune = GetAuraEffectsByType(SPELL_AURA_SCHOOL_IMMUNITY); @@ -23518,7 +23915,8 @@ void Player::AddRunePower(uint8 index) GetSession()->SendPacket(&data); } -static RuneType runeSlotTypes[MAX_RUNES] = { +static RuneType runeSlotTypes[MAX_RUNES] = +{ /*0*/ RUNE_BLOOD, /*1*/ RUNE_BLOOD, /*2*/ RUNE_UNHOLY, @@ -24107,7 +24505,7 @@ void Player::LearnPetTalent(uint64 petGuid, uint32 talentId, uint32 talentRank) if (!talentTabInfo) return; - CreatureTemplate const* ci = pet->GetCreatureInfo(); + CreatureTemplate const* ci = pet->GetCreatureTemplate(); if (!ci) return; @@ -24370,7 +24768,7 @@ void Player::BuildPetTalentsInfoData(WorldPacket* data) data->put(pointsPos, unspentTalentPoints); // put real points - CreatureTemplate const* ci = pet->GetCreatureInfo(); + CreatureTemplate const* ci = pet->GetCreatureTemplate(); if (!ci) return; @@ -24690,11 +25088,24 @@ void Player::_LoadGlyphs(PreparedQueryResult result) void Player::_SaveGlyphs(SQLTransaction& trans) { - trans->PAppend("DELETE FROM character_glyphs WHERE guid='%u'", GetGUIDLow()); - for (uint8 spec = 0; spec < GetSpecsCount(); ++spec) + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_GLYPHS); + stmt->setUInt32(0, GetGUIDLow()); + trans->Append(stmt); + + + for (uint8 spec = 0; spec < m_specsCount; ++spec) { - trans->PAppend("INSERT INTO character_glyphs VALUES('%u', '%u', '%u', '%u', '%u', '%u', '%u', '%u')", - GetGUIDLow(), spec, GetGlyph(spec, 0), GetGlyph(spec, 1), GetGlyph(spec, 2), GetGlyph(spec, 3), GetGlyph(spec, 4), GetGlyph(spec, 5)); + uint8 index = 0; + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_GLYPHS); + stmt->setUInt32(index++, GetGUIDLow()); + + stmt->setUInt8(index++, spec); + + for (uint8 i = 0; i < MAX_GLYPH_SLOT_INDEX; ++i) + stmt->setUInt16(index++, uint16(m_Glyphs[spec][i])); + + trans->Append(stmt); } } @@ -24704,22 +25115,36 @@ void Player::_LoadTalents(PreparedQueryResult result) if (result) { do - AddTalent((*result)[0].GetUInt32(), (*result)[1].GetUInt32(), false); + AddTalent((*result)[0].GetUInt32(), (*result)[1].GetUInt8(), false); while (result->NextRow()); } } void Player::_SaveTalents(SQLTransaction& trans) { + PreparedStatement* stmt = NULL; + for (uint8 i = 0; i < MAX_TALENT_SPECS; ++i) { for (PlayerTalentMap::iterator itr = GetTalentMap(i)->begin(); itr != GetTalentMap(i)->end();) { if (itr->second->state == PLAYERSPELL_REMOVED || itr->second->state == PLAYERSPELL_CHANGED) - trans->PAppend("DELETE FROM character_talent WHERE guid = '%u' and spell = '%u' and spec = '%u'", GetGUIDLow(), itr->first, itr->second->spec); + { + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_TALENT_BY_SPELL_SPEC); + stmt->setUInt32(0, GetGUIDLow()); + stmt->setUInt32(1, itr->first); + stmt->setUInt8(2, itr->second->spec); + trans->Append(stmt); + } if (itr->second->state == PLAYERSPELL_NEW || itr->second->state == PLAYERSPELL_CHANGED) - trans->PAppend("INSERT INTO character_talent (guid, spell, spec) VALUES ('%u', '%u', '%u')", GetGUIDLow(), itr->first, itr->second->spec); + { + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_TALENT); + stmt->setUInt32(0, GetGUIDLow()); + stmt->setUInt32(1, itr->first); + stmt->setUInt8(2, itr->second->spec); + trans->Append(stmt); + } if (itr->second->state == PLAYERSPELL_REMOVED) { @@ -24745,21 +25170,33 @@ void Player::UpdateSpecCount(uint8 count) ActivateSpec(0); SQLTransaction trans = CharacterDatabase.BeginTransaction(); + PreparedStatement* stmt = NULL; // Copy spec data if (count > curCount) { _SaveActions(trans); // make sure the button list is cleaned up for (ActionButtonList::iterator itr = m_actionButtons.begin(); itr != m_actionButtons.end(); ++itr) - trans->PAppend("INSERT INTO character_action (guid, button, action, type, spec) VALUES ('%u', '%u', '%u', '%u', '%u')", - GetGUIDLow(), uint32(itr->first), uint32(itr->second.GetAction()), uint32(itr->second.GetType()), 1); + { + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_ACTION); + stmt->setUInt32(0, GetGUIDLow()); + stmt->setUInt8(1, 1); + stmt->setUInt8(2, itr->first); + stmt->setUInt32(3, itr->second.GetAction()); + stmt->setUInt8(4, uint8(itr->second.GetType())); + trans->Append(stmt); + } } // Delete spec data for removed spec. else if (count < curCount) { _SaveActions(trans); - trans->PAppend("DELETE FROM character_action WHERE spec<>'%u' AND guid='%u'", GetActiveSpec(), GetGUIDLow()); - SetActiveSpec(0); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACTION_EXCEPT_SPEC); + stmt->setUInt8(0, m_activeSpec); + stmt->setUInt32(1, GetGUIDLow()); + trans->Append(stmt); + } CharacterDatabase.CommitTransaction(trans); @@ -25231,3 +25668,53 @@ bool Player::IsInWhisperWhiteList(uint64 guid) } return false; } + +bool Player::SetHover(bool enable) +{ + if (!Unit::SetHover(enable)) + return false; + + return true; +} + +void Player::SendMovementSetCanFly(bool apply) +{ + WorldPacket data(apply ? SMSG_MOVE_SET_CAN_FLY : SMSG_MOVE_UNSET_CAN_FLY, 12); + data.append(GetPackGUID()); + data << uint32(0); //! movement counter + SendDirectMessage(&data); +} + +void Player::SendMovementSetCanTransitionBetweenSwimAndFly(bool apply) +{ + WorldPacket data(apply ? + SMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY : + SMSG_MOVE_UNSET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, 12); + data.append(GetPackGUID()); + data << uint32(0); //! movement counter + SendDirectMessage(&data); +} + +void Player::SendMovementSetHover(bool apply) +{ + WorldPacket data(apply ? SMSG_MOVE_SET_HOVER : SMSG_MOVE_UNSET_HOVER, 12); + data.append(GetPackGUID()); + data << uint32(0); //! movement counter + SendDirectMessage(&data); +} + +void Player::SendMovementSetWaterWalking(bool apply) +{ + WorldPacket data(apply ? SMSG_MOVE_WATER_WALK : SMSG_MOVE_LAND_WALK, 12); + data.append(GetPackGUID()); + data << uint32(0); //! movement counter + SendDirectMessage(&data); +} + +void Player::SendMovementSetFeatherFall(bool apply) +{ + WorldPacket data(apply ? SMSG_MOVE_FEATHER_FALL : SMSG_MOVE_NORMAL_FALL, 12); + data.append(GetPackGUID()); + data << uint32(0); //! movement counter + SendDirectMessage(&data); +} diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index b3315ceec9f..dc6fd7eab26 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -703,9 +703,9 @@ enum TransferAbortReason TRANSFER_ABORT_UNIQUE_MESSAGE = 0x09, // Until you've escaped TLK's grasp, you cannot leave this place! TRANSFER_ABORT_TOO_MANY_REALM_INSTANCES = 0x0A, // Additional instances cannot be launched, please try again later. TRANSFER_ABORT_NEED_GROUP = 0x0B, // 3.1 - TRANSFER_ABORT_NOT_FOUND2 = 0x0C, // 3.1 - TRANSFER_ABORT_NOT_FOUND3 = 0x0D, // 3.1 - TRANSFER_ABORT_NOT_FOUND4 = 0x0E, // 3.2 + TRANSFER_ABORT_NOT_FOUND1 = 0x0C, // 3.1 + TRANSFER_ABORT_NOT_FOUND2 = 0x0D, // 3.1 + TRANSFER_ABORT_NOT_FOUND3 = 0x0E, // 3.2 TRANSFER_ABORT_REALM_ONLY = 0x0F, // All players on party must be from the same realm. TRANSFER_ABORT_MAP_NOT_ALLOWED = 0x10, // Map can't be entered at this time. TRANSFER_ABORT_LOCKED_TO_DIFFERENT_INSTANCE = 0x12, // 4.2.2 @@ -1120,7 +1120,7 @@ class Player : public Unit, public GridObject friend void Item::RemoveFromUpdateQueueOf(Player* player); public: explicit Player (WorldSession* session); - ~Player (); + ~Player(); void CleanupsBeforeDelete(bool finalCleanup = true); @@ -1395,6 +1395,7 @@ class Player : public Unit, public GridObject void UpdateEnchantTime(uint32 time); void UpdateSoulboundTradeItems(); + void AddTradeableItem(Item* item); void RemoveTradeableItem(Item* item); void UpdateItemDuration(uint32 time, bool realtimeonly = false); void AddEnchantmentDurations(Item* item); @@ -1568,7 +1569,7 @@ class Player : public Unit, public GridObject static uint32 GetLevelFromDB(uint64 guid); static bool LoadPositionFromDB(uint32& mapid, float& x, float& y, float& z, float& o, bool& in_flight, uint64 guid); - static bool IsValidGender(uint8 Gender) { return Gender <= GENDER_FEMALE ; } + static bool IsValidGender(uint8 Gender) { return Gender <= GENDER_FEMALE; } static bool IsValidClass(uint8 Class) { return (1 << (Class - 1)) & CLASSMASK_ALL_PLAYABLE; } static bool IsValidRace(uint8 Race) { return (1 << (Race - 1)) & RACEMASK_ALL_PLAYABLE; } @@ -1602,7 +1603,7 @@ class Player : public Unit, public GridObject void setRegenTimerCount(uint32 time) {m_regenTimerCount = time;} void setWeaponChangeTimer(uint32 time) {m_weaponChangeTimer = time;} - uint32 GetMoney() const { return GetUInt32Value (PLAYER_FIELD_COINAGE); } + uint32 GetMoney() const { return GetUInt32Value(PLAYER_FIELD_COINAGE); } void ModifyMoney(int32 d); bool HasEnoughMoney(uint32 amount) const { return (GetMoney() >= amount); } bool HasEnoughMoney(int32 amount) const @@ -1614,13 +1615,13 @@ class Player : public Unit, public GridObject void SetMoney(uint32 value) { - SetUInt32Value (PLAYER_FIELD_COINAGE, value); + SetUInt32Value(PLAYER_FIELD_COINAGE, value); MoneyChanged(value); UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_GOLD_VALUE_OWNED); } RewardedQuestSet const& getRewardedQuests() const { return m_RewardedQuests; } - QuestStatusMap& getQuestStatusMap() { return m_QuestStatus; }; + QuestStatusMap& getQuestStatusMap() { return m_QuestStatus; } size_t GetRewardedQuestCount() const { return m_RewardedQuests.size(); } bool IsQuestRewarded(uint32 quest_id) const @@ -1633,7 +1634,7 @@ class Player : public Unit, public GridObject Player* GetSelectedPlayer() const; void SetSelection(uint64 guid) { m_curSelection = guid; SetUInt64Value(UNIT_FIELD_TARGET, guid); } - uint8 GetComboPoints() { return m_comboPoints; } + uint8 GetComboPoints() const { return m_comboPoints; } uint64 GetComboTarget() const { return m_comboTarget; } void AddComboPoints(Unit* target, int8 count, Spell* spell = NULL); @@ -1996,7 +1997,7 @@ class Player : public Unit, public GridObject WorldSession* GetSession() const { return m_session; } void BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) const; - void DestroyForPlayer(Player* target, bool anim = false) const; + void DestroyForPlayer(Player* target, bool onDeath = false) const; void SendLogXPGain(uint32 GivenXP, Unit* victim, uint32 BonusXP, bool recruitAFriend = false, float group_rate=1.0f); // notifiers @@ -2064,7 +2065,7 @@ class Player : public Unit, public GridObject void UpdateDefense(); void UpdateWeaponSkill (WeaponAttackType attType); - void UpdateCombatSkills(Unit* pVictim, WeaponAttackType attType, bool defence); + void UpdateCombatSkills(Unit* victim, WeaponAttackType attType, bool defence); void SetSkill(uint16 id, uint16 step, uint16 currVal, uint16 maxVal); uint16 GetMaxSkillValue(uint32 skill) const; // max + perm. bonus + temp bonus @@ -2097,9 +2098,9 @@ class Player : public Unit, public GridObject bool IsAtGroupRewardDistance(WorldObject const* pRewardSource) const; bool IsAtRecruitAFriendDistance(WorldObject const* pOther) const; - void RewardPlayerAndGroupAtKill(Unit* pVictim, bool isBattleGround); + void RewardPlayerAndGroupAtKill(Unit* victim, bool isBattleGround); void RewardPlayerAndGroupAtEvent(uint32 creature_id, WorldObject* pRewardSource); - bool isHonorOrXPTarget(Unit* pVictim); + bool isHonorOrXPTarget(Unit* victim); bool GetsRecruitAFriendBonus(bool forXP); uint8 GetGrantableLevels() { return m_grantableLevels; } @@ -2108,7 +2109,7 @@ class Player : public Unit, public GridObject ReputationMgr& GetReputationMgr() { return m_reputationMgr; } ReputationMgr const& GetReputationMgr() const { return m_reputationMgr; } ReputationRank GetReputationRank(uint32 faction_id) const; - void RewardReputation(Unit* pVictim, float rate); + void RewardReputation(Unit* victim, float rate); void RewardReputation(Quest const* quest); void UpdateSkillsForLevel(); @@ -2362,6 +2363,8 @@ class Player : public Unit, public GridObject m_mover->m_movedPlayer = this; } + bool SetHover(bool enable); + void SetSeer(WorldObject* target) { m_seer = target; } void SetViewpoint(WorldObject* target, bool apply); WorldObject* GetViewpoint() const; @@ -2407,7 +2410,7 @@ class Player : public Unit, public GridObject void UpdateTriggerVisibility(); template - void UpdateVisibilityOf(T* target, UpdateData& data, std::set& visibleNow); + void UpdateVisibilityOf(T* target, UpdateData& data, std::set& visibleNow); uint8 m_forced_speed_changes[MAX_MOVE_TYPE]; @@ -2490,6 +2493,7 @@ class Player : public Unit, public GridObject void SetAuraUpdateMaskForRaid(uint8 slot) { m_auraRaidUpdateMask |= (uint64(1) << slot); } Player* GetNextRandomRaidMember(float radius); PartyResult CanUninviteFromGroup() const; + // Battleground Group System void SetBattlegroundRaid(Group* group, int8 subgroup = -1); void RemoveFromBattlegroundRaid(); @@ -2553,6 +2557,17 @@ class Player : public Unit, public GridObject void AddWhisperWhiteList(uint64 guid) { WhisperList.push_back(guid); } bool IsInWhisperWhiteList(uint64 guid); + /*! These methods send different packets to the client in apply and unapply case. + These methods are only sent to the current unit. + */ + void SendMovementSetCanFly(bool apply); + void SendMovementSetCanTransitionBetweenSwimAndFly(bool apply); + void SendMovementSetHover(bool apply); + void SendMovementSetWaterWalking(bool apply); + void SendMovementSetFeatherFall(bool apply); + + bool CanFly() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_CAN_FLY); } + //! Return collision height sent to client float GetCollisionHeight(bool mounted) { @@ -2585,7 +2600,6 @@ class Player : public Unit, public GridObject return modelData->CollisionHeight; } - //! TODO: Need a proper calculation for collision height when mounted } protected: diff --git a/src/server/game/Entities/Player/SocialMgr.cpp b/src/server/game/Entities/Player/SocialMgr.cpp index cb327b83d17..1ded8cda81b 100755 --- a/src/server/game/Entities/Player/SocialMgr.cpp +++ b/src/server/game/Entities/Player/SocialMgr.cpp @@ -61,7 +61,7 @@ bool PlayerSocial::AddToSocialList(uint32 friendGuid, bool ignore) return false; } - uint32 flag = SOCIAL_FLAG_FRIEND; + uint8 flag = SOCIAL_FLAG_FRIEND; if (ignore) flag = SOCIAL_FLAG_IGNORED; @@ -70,7 +70,7 @@ bool PlayerSocial::AddToSocialList(uint32 friendGuid, bool ignore) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_CHARACTER_SOCIAL_FLAGS); - stmt->setUInt8(0, uint8(flag)); + stmt->setUInt8(0, flag); stmt->setUInt32(1, GetPlayerGUID()); stmt->setUInt32(2, friendGuid); @@ -84,7 +84,7 @@ bool PlayerSocial::AddToSocialList(uint32 friendGuid, bool ignore) stmt->setUInt32(0, GetPlayerGUID()); stmt->setUInt32(1, friendGuid); - stmt->setUInt8(2, uint8(flag)); + stmt->setUInt8(2, flag); CharacterDatabase.Execute(stmt); @@ -101,7 +101,7 @@ void PlayerSocial::RemoveFromSocialList(uint32 friendGuid, bool ignore) if (itr == m_playerSocialMap.end()) // not exist return; - uint32 flag = SOCIAL_FLAG_FRIEND; + uint8 flag = SOCIAL_FLAG_FRIEND; if (ignore) flag = SOCIAL_FLAG_IGNORED; @@ -121,7 +121,7 @@ void PlayerSocial::RemoveFromSocialList(uint32 friendGuid, bool ignore) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_REM_CHARACTER_SOCIAL_FLAGS); - stmt->setUInt8(0, uint8(flag)); + stmt->setUInt8(0, flag); stmt->setUInt32(1, GetPlayerGUID()); stmt->setUInt32(2, friendGuid); @@ -321,7 +321,7 @@ void SocialMgr::BroadcastToFriendListers(Player* player, WorldPacket* packet) } } -PlayerSocial *SocialMgr::LoadFromDB(PreparedQueryResult result, uint32 guid) +PlayerSocial* SocialMgr::LoadFromDB(PreparedQueryResult result, uint32 guid) { PlayerSocial *social = &m_socialMap[guid]; social->SetPlayerGUID(guid); @@ -330,7 +330,7 @@ PlayerSocial *SocialMgr::LoadFromDB(PreparedQueryResult result, uint32 guid) return social; uint32 friend_guid = 0; - uint32 flags = 0; + uint8 flags = 0; std::string note = ""; do @@ -338,7 +338,7 @@ PlayerSocial *SocialMgr::LoadFromDB(PreparedQueryResult result, uint32 guid) Field* fields = result->Fetch(); friend_guid = fields[0].GetUInt32(); - flags = fields[1].GetUInt32(); + flags = fields[1].GetUInt8(); note = fields[2].GetString(); social->m_playerSocialMap[friend_guid] = FriendInfo(flags, note); diff --git a/src/server/game/Entities/Player/SocialMgr.h b/src/server/game/Entities/Player/SocialMgr.h index 540b425588e..3c7d13070fa 100755 --- a/src/server/game/Entities/Player/SocialMgr.h +++ b/src/server/game/Entities/Player/SocialMgr.h @@ -48,7 +48,7 @@ enum SocialFlag struct FriendInfo { FriendStatus Status; - uint32 Flags; + uint8 Flags; uint32 Area; uint8 Level; uint8 Class; @@ -64,7 +64,7 @@ struct FriendInfo Note = ""; } - FriendInfo(uint32 flags, const std::string& note) + FriendInfo(uint8 flags, const std::string& note) { Status = FRIEND_STATUS_OFFLINE; Flags = flags; diff --git a/src/server/game/Entities/Totem/Totem.h b/src/server/game/Entities/Totem/Totem.h index 8b00da34d73..c33b8776660 100755 --- a/src/server/game/Entities/Totem/Totem.h +++ b/src/server/game/Entities/Totem/Totem.h @@ -60,4 +60,3 @@ class Totem : public Minion uint32 m_duration; }; #endif - diff --git a/src/server/game/Entities/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp index f18b041ba88..a00fcae1e09 100755 --- a/src/server/game/Entities/Transport/Transport.cpp +++ b/src/server/game/Entities/Transport/Transport.cpp @@ -52,7 +52,7 @@ void MapManager::LoadTransports() uint32 period = fields[3].GetUInt32(); uint32 scriptId = sObjectMgr->GetScriptId(fields[4].GetCString()); - const GameObjectTemplate* goinfo = sObjectMgr->GetGameObjectTemplate(entry); + GameObjectTemplate const* goinfo = sObjectMgr->GetGameObjectTemplate(entry); if (!goinfo) { @@ -86,7 +86,7 @@ void MapManager::LoadTransports() float o = 1.0f; // creates the Gameobject - if (!t->Create(lowguid, entry, mapid, x, y, z, o, 100, 0)) + if (!t->Create(lowguid, entry, mapid, x, y, z, o, 255, 0)) { delete t; continue; @@ -129,8 +129,8 @@ void MapManager::LoadTransportNPCs() { uint32 oldMSTime = getMSTime(); - // 0 1 2 3 4 5 6 7 - QueryResult result = WorldDatabase.PQuery("SELECT guid, npc_entry, transport_entry, TransOffsetX, TransOffsetY, TransOffsetZ, TransOffsetO, emote FROM creature_transport"); + // 0 1 2 3 4 5 6 7 + QueryResult result = WorldDatabase.Query("SELECT guid, npc_entry, transport_entry, TransOffsetX, TransOffsetY, TransOffsetZ, TransOffsetO, emote FROM creature_transport"); if (!result) { @@ -144,14 +144,14 @@ void MapManager::LoadTransportNPCs() do { Field* fields = result->Fetch(); - uint32 guid = fields[0].GetUInt32(); - uint32 entry = fields[1].GetUInt32(); - uint32 transportEntry = fields[2].GetUInt32(); + uint32 guid = fields[0].GetInt32(); + uint32 entry = fields[1].GetInt32(); + uint32 transportEntry = fields[2].GetInt32(); float tX = fields[3].GetFloat(); float tY = fields[4].GetFloat(); float tZ = fields[5].GetFloat(); float tO = fields[6].GetFloat(); - uint32 anim = fields[7].GetUInt32(); + uint32 anim = fields[7].GetInt32(); for (MapManager::TransportSet::iterator itr = m_Transports.begin(); itr != m_Transports.end(); ++itr) { @@ -173,7 +173,7 @@ void MapManager::LoadTransportNPCs() Transport::Transport(uint32 period, uint32 script) : GameObject(), m_pathTime(0), m_timer(0), currenttguid(0), m_period(period), ScriptId(script), m_nextNodeTime(0) { - m_updateFlag = (UPDATEFLAG_TRANSPORT | UPDATEFLAG_HAS_POSITION | UPDATEFLAG_ROTATION); + m_updateFlag = (UPDATEFLAG_TRANSPORT | UPDATEFLAG_STATIONARY_POSITION | UPDATEFLAG_ROTATION); } Transport::~Transport() @@ -214,11 +214,10 @@ bool Transport::Create(uint32 guidlow, uint32 entry, uint32 mapid, float x, floa m_goInfo = goinfo; - SetFloatValue(OBJECT_FIELD_SCALE_X, goinfo->size); + SetObjectScale(goinfo->size); SetUInt32Value(GAMEOBJECT_FACTION, goinfo->faction); - //SetUInt32Value(GAMEOBJECT_FLAGS, goinfo->flags); - SetUInt32Value(GAMEOBJECT_FLAGS, MAKE_PAIR32(0x28, 0x64)); + SetUInt32Value(GAMEOBJECT_FLAGS, goinfo->flags); SetUInt32Value(GAMEOBJECT_LEVEL, m_period); SetEntry(goinfo->entry); diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index c25c4d3d79d..c307324bead 100755 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -142,13 +142,13 @@ void Player::ApplySpellPowerBonus(int32 amount, bool apply) void Player::UpdateSpellDamageAndHealingBonus() { - // Magic damage modifiers implemented in Unit::SpellDamageBonus + // Magic damage modifiers implemented in Unit::SpellDamageBonusDone // This information for client side use only // Get healing bonus for all schools - SetStatInt32Value(PLAYER_FIELD_MOD_HEALING_DONE_POS, SpellBaseHealingBonus(SPELL_SCHOOL_MASK_ALL)); + SetStatInt32Value(PLAYER_FIELD_MOD_HEALING_DONE_POS, SpellBaseHealingBonusDone(SPELL_SCHOOL_MASK_ALL)); // Get damage bonus for all schools for (int i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i) - SetStatInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS+i, SpellBaseDamageBonus(SpellSchoolMask(1 << i))); + SetStatInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS+i, SpellBaseDamageBonusDone(SpellSchoolMask(1 << i))); } bool Player::UpdateAllStats() @@ -352,7 +352,7 @@ void Player::UpdateAttackPowerAndDamage(bool ranged) break; } case CLASS_MAGE: - val2 = GetStat(STAT_STRENGTH) - 10.0f; + val2 = GetStat(STAT_STRENGTH) - 10.0f; break; case CLASS_PRIEST: val2 = GetStat(STAT_STRENGTH) - 10.0f; @@ -967,12 +967,12 @@ void Creature::UpdateDamagePhysical(WeaponAttackType attType) float weapon_maxdamage = GetWeaponDamageRange(attType, MAXDAMAGE); /* difference in AP between current attack power and base value from DB */ - float att_pwr_change = GetTotalAttackPowerValue(attType) - GetCreatureInfo()->attackpower; + float att_pwr_change = GetTotalAttackPowerValue(attType) - GetCreatureTemplate()->attackpower; float base_value = GetModifierValue(unitMod, BASE_VALUE) + (att_pwr_change * GetAPMultiplier(attType, false) / 14.0f); float base_pct = GetModifierValue(unitMod, BASE_PCT); float total_value = GetModifierValue(unitMod, TOTAL_VALUE); float total_pct = GetModifierValue(unitMod, TOTAL_PCT); - float dmg_multiplier = GetCreatureInfo()->dmg_multiplier; + float dmg_multiplier = GetCreatureTemplate()->dmg_multiplier; if (!CanUseAttackType(attType)) { @@ -1016,6 +1016,7 @@ void Creature::UpdateDamagePhysical(WeaponAttackType attType) #define ENTRY_TREANT 1964 #define ENTRY_FIRE_ELEMENTAL 15438 #define ENTRY_GHOUL 26125 +#define ENTRY_BLOODWORM 28017 bool Guardian::UpdateStats(Stats stat) { @@ -1165,6 +1166,7 @@ void Guardian::UpdateMaxHealth() case ENTRY_SUCCUBUS: multiplicator = 9.1f; break; case ENTRY_FELHUNTER: multiplicator = 9.5f; break; case ENTRY_FELGUARD: multiplicator = 11.0f; break; + case ENTRY_BLOODWORM: multiplicator = 1.0f; break; default: multiplicator = 10.0f; break; } diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 01c1175f074..6ae8e0b7caf 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -71,7 +71,9 @@ float baseMoveSpeed[MAX_MOVE_TYPE] = 4.5f, // MOVE_FLIGHT_BACK 3.14f // MOVE_PITCH_RATE }; -float playerBaseMoveSpeed[MAX_MOVE_TYPE] = { + +float playerBaseMoveSpeed[MAX_MOVE_TYPE] = +{ 2.5f, // MOVE_WALK 7.0f, // MOVE_RUN 4.5f, // MOVE_RUN_BACK @@ -110,23 +112,27 @@ m_damageType(DIRECT_DAMAGE), m_attackType(dmgInfo.attackType) m_resist = 0; m_block = 0; } + void DamageInfo::ModifyDamage(int32 amount) { amount = std::min(amount, int32(GetDamage())); m_damage += amount; } + void DamageInfo::AbsorbDamage(uint32 amount) { amount = std::min(amount, GetDamage()); m_absorb += amount; m_damage -= amount; } + void DamageInfo::ResistDamage(uint32 amount) { amount = std::min(amount, GetDamage()); m_resist += amount; m_damage -= amount; } + void DamageInfo::BlockDamage(uint32 amount) { amount = std::min(amount, GetDamage()); @@ -158,7 +164,7 @@ m_HostileRefManager(this) m_objectType |= TYPEMASK_UNIT; m_objectTypeId = TYPEID_UNIT; - m_updateFlag = (UPDATEFLAG_LIVING | UPDATEFLAG_HAS_POSITION); + m_updateFlag = (UPDATEFLAG_LIVING | UPDATEFLAG_STATIONARY_POSITION); m_attackTimer[BASE_ATTACK] = 0; m_attackTimer[OFF_ATTACK] = 0; @@ -246,6 +252,7 @@ m_HostileRefManager(this) _focusSpell = NULL; _targetLocked = false; + _lastLiquid = NULL; } //////////////////////////////////////////////////////////// @@ -430,7 +437,7 @@ void Unit::SendMonsterMoveTransport(Unit* vehicleOwner) data.append(GetPackGUID()); data.append(vehicleOwner->GetPackGUID()); data << int8(GetTransSeat()); - data << uint8(GetTypeId() == TYPEID_PLAYER ? 1 : 0); // boolean + data << uint8(0); data << GetPositionX() - vehicleOwner->GetPositionX(); data << GetPositionY() - vehicleOwner->GetPositionY(); data << GetPositionZ() - vehicleOwner->GetPositionZ(); @@ -453,7 +460,8 @@ void Unit::resetAttackTimer(WeaponAttackType type) bool Unit::IsWithinCombatRange(const Unit* obj, float dist2compare) const { - if (!obj || !IsInMap(obj)) return false; + if (!obj || !IsInMap(obj) || !InSamePhase(obj)) + return false; float dx = GetPositionX() - obj->GetPositionX(); float dy = GetPositionY() - obj->GetPositionY(); @@ -468,7 +476,8 @@ bool Unit::IsWithinCombatRange(const Unit* obj, float dist2compare) const bool Unit::IsWithinMeleeRange(const Unit* obj, float dist) const { - if (!obj || !IsInMap(obj)) return false; + if (!obj || !IsInMap(obj) || !InSamePhase(obj)) + return false; float dx = GetPositionX() - obj->GetPositionX(); float dy = GetPositionY() - obj->GetPositionY(); @@ -564,6 +573,15 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam if (IsAIEnabled) GetAI()->DamageDealt(victim, damage, damagetype); + // Signal to pets that their owner was attacked + if (victim->GetTypeId() == TYPEID_PLAYER) + { + Pet* pet = victim->ToPlayer()->GetPet(); + + if (pet && pet->isAlive()) + pet->AI()->OwnerDamagedBy(this); + } + if (damagetype != NODAMAGE) { // interrupting auras with AURA_INTERRUPT_FLAG_DAMAGE before checking !damage (absorbed damage breaks that type of auras) @@ -661,7 +679,7 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam duel_hasEnded = true; } - else if (victim->IsVehicle() && damage >= (health-1) && victim->GetCharmer() && victim->GetCharmer()->GetTypeId() == TYPEID_PLAYER) + else if (victim->IsVehicle() && damage >= (health-1) && victim->GetCharmer() && victim->GetCharmer()->GetTypeId() == TYPEID_PLAYER) { Player* victimRider = victim->GetCharmer()->ToPlayer(); @@ -784,20 +802,9 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam // last damage from duel opponent if (duel_hasEnded) { - Player* he; - - if (duel_wasMounted) - { - ASSERT(victim->GetCharmer()->GetTypeId() == TYPEID_PLAYER); - he = victim->GetCharmer()->ToPlayer(); - } - else - { - ASSERT(victim->GetTypeId() == TYPEID_PLAYER); - he = victim->ToPlayer(); - } + Player* he = duel_wasMounted ? victim->GetCharmer()->ToPlayer() : victim->ToPlayer(); - ASSERT(he->duel); + ASSERT(he && he->duel); if (duel_wasMounted) // In this case victim==mount victim->SetHealth(1); @@ -946,7 +953,9 @@ uint32 Unit::SpellNonMeleeDamageLog(Unit* victim, uint32 spellID, uint32 damage) { SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellID); SpellNonMeleeDamage damageInfo(this, victim, spellInfo->Id, spellInfo->SchoolMask); - damage = SpellDamageBonus(victim, spellInfo, damage, SPELL_DIRECT_DAMAGE); + damage = SpellDamageBonusDone(victim, spellInfo, damage, SPELL_DIRECT_DAMAGE); + damage = victim->SpellDamageBonusTaken(this, spellInfo, damage, SPELL_DIRECT_DAMAGE); + CalculateSpellDamageTaken(&damageInfo, damage, spellInfo); DealDamageMods(damageInfo.target, damageInfo.damage, &damageInfo.absorb); SendSpellNonMeleeDamageLog(&damageInfo); @@ -1107,6 +1116,7 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam if (!victim) return; + if (!isAlive() || !victim->isAlive()) return; @@ -1116,12 +1126,11 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam case BASE_ATTACK: damageInfo->procAttacker = PROC_FLAG_DONE_MELEE_AUTO_ATTACK | PROC_FLAG_DONE_MAINHAND_ATTACK; damageInfo->procVictim = PROC_FLAG_TAKEN_MELEE_AUTO_ATTACK; - damageInfo->HitInfo = HITINFO_NORMALSWING2; break; case OFF_ATTACK: damageInfo->procAttacker = PROC_FLAG_DONE_MELEE_AUTO_ATTACK | PROC_FLAG_DONE_OFFHAND_ATTACK; damageInfo->procVictim = PROC_FLAG_TAKEN_MELEE_AUTO_ATTACK; - damageInfo->HitInfo = HITINFO_LEFTSWING; + damageInfo->HitInfo = HITINFO_OFFHAND; break; default: return; @@ -1141,7 +1150,8 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam damage += CalculateDamage(damageInfo->attackType, false, true); // Add melee damage bonus - MeleeDamageBonus(damageInfo->target, &damage, damageInfo->attackType); + damage = MeleeDamageBonusDone(damageInfo->target, damage, damageInfo->attackType); + damage = damageInfo->target->MeleeDamageBonusTaken(this, damage, damageInfo->attackType); // Calculate armor reduction if (IsDamageReducedByArmor((SpellSchoolMask)(damageInfo->damageSchoolMask))) @@ -1157,29 +1167,29 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam switch (damageInfo->hitOutCome) { case MELEE_HIT_EVADE: - damageInfo->HitInfo |= HITINFO_MISS|HITINFO_SWINGNOHITSOUND; - damageInfo->TargetState = VICTIMSTATE_EVADES; - damageInfo->procEx|=PROC_EX_EVADE; + damageInfo->HitInfo |= HITINFO_MISS | HITINFO_SWINGNOHITSOUND; + damageInfo->TargetState = VICTIMSTATE_EVADES; + damageInfo->procEx |= PROC_EX_EVADE; damageInfo->damage = 0; damageInfo->cleanDamage = 0; return; case MELEE_HIT_MISS: - damageInfo->HitInfo |= HITINFO_MISS; - damageInfo->TargetState = VICTIMSTATE_INTACT; - damageInfo->procEx |= PROC_EX_MISS; - damageInfo->damage = 0; - damageInfo->cleanDamage = 0; + damageInfo->HitInfo |= HITINFO_MISS; + damageInfo->TargetState = VICTIMSTATE_INTACT; + damageInfo->procEx |= PROC_EX_MISS; + damageInfo->damage = 0; + damageInfo->cleanDamage = 0; break; case MELEE_HIT_NORMAL: - damageInfo->TargetState = VICTIMSTATE_HIT; - damageInfo->procEx|=PROC_EX_NORMAL_HIT; + damageInfo->TargetState = VICTIMSTATE_HIT; + damageInfo->procEx |= PROC_EX_NORMAL_HIT; break; case MELEE_HIT_CRIT: { - damageInfo->HitInfo |= HITINFO_CRITICALHIT; - damageInfo->TargetState = VICTIMSTATE_HIT; + damageInfo->HitInfo |= HITINFO_CRITICALHIT; + damageInfo->TargetState = VICTIMSTATE_HIT; - damageInfo->procEx |= PROC_EX_CRITICAL_HIT; + damageInfo->procEx |= PROC_EX_CRITICAL_HIT; // Crit bonus calc damageInfo->damage += damageInfo->damage; float mod = 0.0f; @@ -1240,8 +1250,8 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam if (leveldif > 3) leveldif = 3; float reducePercent = 1 - leveldif * 0.1f; - damageInfo->cleanDamage += damageInfo->damage-uint32(reducePercent * damageInfo->damage); - damageInfo->damage = uint32(reducePercent * damageInfo->damage); + damageInfo->cleanDamage += damageInfo->damage - uint32(reducePercent * damageInfo->damage); + damageInfo->damage = uint32(reducePercent * damageInfo->damage); break; } case MELEE_HIT_CRUSHING: @@ -1255,6 +1265,10 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam break; } + // Always apply HITINFO_AFFECTS_VICTIM in case its not a miss + if (!(damageInfo->HitInfo & HITINFO_MISS)) + damageInfo->HitInfo |= HITINFO_AFFECTS_VICTIM; + int32 resilienceReduction = damageInfo->damage; if (attackType != RANGED_ATTACK) ApplyResilience(victim, NULL, &resilienceReduction, (damageInfo->hitOutCome == MELEE_HIT_CRIT), CR_CRIT_TAKEN_MELEE); @@ -1270,14 +1284,17 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam damageInfo->procVictim |= PROC_FLAG_TAKEN_DAMAGE; // Calculate absorb & resists CalcAbsorbResist(damageInfo->target, SpellSchoolMask(damageInfo->damageSchoolMask), DIRECT_DAMAGE, damageInfo->damage, &damageInfo->absorb, &damageInfo->resist); - damageInfo->damage -= damageInfo->absorb + damageInfo->resist; + if (damageInfo->absorb) { - damageInfo->HitInfo |= HITINFO_ABSORB; + damageInfo->HitInfo |= (damageInfo->damage - damageInfo->absorb == 0 ? HITINFO_FULL_ABSORB : HITINFO_PARTIAL_ABSORB); damageInfo->procEx |= PROC_EX_ABSORB; } + if (damageInfo->resist) - damageInfo->HitInfo |= HITINFO_RESIST; + damageInfo->HitInfo |= (damageInfo->damage - damageInfo->resist == 0 ? HITINFO_FULL_RESIST : HITINFO_PARTIAL_RESIST); + + damageInfo->damage -= damageInfo->absorb + damageInfo->resist; } else // Impossible get negative result but.... damageInfo->damage = 0; @@ -1386,7 +1403,10 @@ void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss) uint32 damage = (*dmgShieldItr)->GetAmount(); if (Unit* caster = (*dmgShieldItr)->GetCaster()) - damage = caster->SpellDamageBonus(this, i_spellProto, damage, SPELL_DIRECT_DAMAGE); + { + damage = caster->SpellDamageBonusDone(this, i_spellProto, damage, SPELL_DIRECT_DAMAGE); + damage = this->SpellDamageBonusTaken(caster, i_spellProto, damage, SPELL_DIRECT_DAMAGE); + } // No Unit::CalcAbsorbResist here - opcode doesn't send that data - this damage is probably not affected by that victim->DealDamageMods(this, damage, NULL); @@ -1478,8 +1498,8 @@ uint32 Unit::CalcArmorReducedDamage(Unit* victim, const uint32 damage, SpellInfo if (GetTypeId() == TYPEID_PLAYER) { float bonusPct = 0; - AuraEffectList const& ResIgnoreAuras = GetAuraEffectsByType(SPELL_AURA_MOD_ARMOR_PENETRATION_PCT); - for (AuraEffectList::const_iterator itr = ResIgnoreAuras.begin(); itr != ResIgnoreAuras.end(); ++itr) + AuraEffectList const& armorPenAuras = GetAuraEffectsByType(SPELL_AURA_MOD_ARMOR_PENETRATION_PCT); + for (AuraEffectList::const_iterator itr = armorPenAuras.begin(); itr != armorPenAuras.end(); ++itr) { if ((*itr)->GetSpellInfo()->EquippedItemClass == -1) { @@ -1490,7 +1510,7 @@ uint32 Unit::CalcArmorReducedDamage(Unit* victim, const uint32 damage, SpellInfo } else { - if (ToPlayer() && ToPlayer()->HasItemFitToSpellRequirements((*itr)->GetSpellInfo())) + if (ToPlayer()->HasItemFitToSpellRequirements((*itr)->GetSpellInfo())) bonusPct += (*itr)->GetAmount(); } } @@ -1500,6 +1520,7 @@ uint32 Unit::CalcArmorReducedDamage(Unit* victim, const uint32 damage, SpellInfo maxArmorPen = float(400 + 85 * victim->getLevel()); else maxArmorPen = 400 + 85 * victim->getLevel() + 4.5f * 85 * (victim->getLevel() - 59); + // Cap armor penetration to this number maxArmorPen = std::min((armor + maxArmorPen) / 3, armor); // Figure out how much armor do we ignore @@ -1536,7 +1557,8 @@ void Unit::CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffe DamageInfo dmgInfo = DamageInfo(this, victim, damage, spellInfo, schoolMask, damagetype); // Magic damage, check for resists - if ((schoolMask & SPELL_SCHOOL_MASK_NORMAL) == 0) + // Ignore spells that cant be resisted + if ((schoolMask & SPELL_SCHOOL_MASK_NORMAL) == 0 && (!spellInfo || (spellInfo->AttributesEx4 & SPELL_ATTR4_IGNORE_RESISTANCES) == 0)) { float victimResistance = float(victim->GetResistance(schoolMask)); victimResistance += float(GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_TARGET_RESISTANCE, schoolMask)); @@ -2023,7 +2045,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit* victim, WeaponAttackT else parry_chance -= GetTotalAuraModifier(SPELL_AURA_MOD_EXPERTISE) * 25; - if (victim->GetTypeId() == TYPEID_PLAYER || !(victim->ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_PARRY)) + if (victim->GetTypeId() == TYPEID_PLAYER || !(victim->ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_PARRY)) { int32 tmp2 = int32(parry_chance); if (tmp2 > 0 // check if unit _can_ parry @@ -2035,7 +2057,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit* victim, WeaponAttackT } } - if (victim->GetTypeId() == TYPEID_PLAYER || !(victim->ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_BLOCK)) + if (victim->GetTypeId() == TYPEID_PLAYER || !(victim->ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_BLOCK)) { tmp = block_chance; if (tmp > 0 // check if unit _can_ block @@ -2054,7 +2076,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit* victim, WeaponAttackT if (tmp > 0 && roll < (sum += tmp)) { sLog->outStaticDebug ("RollMeleeOutcomeAgainst: CRIT <%d, %d)", sum-tmp, sum); - if (GetTypeId() == TYPEID_UNIT && (ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_CRIT)) + if (GetTypeId() == TYPEID_UNIT && (ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_CRIT)) sLog->outStaticDebug ("RollMeleeOutcomeAgainst: CRIT DISABLED)"); else return MELEE_HIT_CRIT; @@ -2084,7 +2106,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit* victim, WeaponAttackT if (getLevelForTarget(victim) >= victim->getLevelForTarget(this) + 4 && // can be from by creature (if can) or from controlled player that considered as creature !IsControlledByPlayer() && - !(GetTypeId() == TYPEID_UNIT && ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_CRUSH)) + !(GetTypeId() == TYPEID_UNIT && ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_CRUSH)) { // when their weapon skill is 15 or more above victim's defense skill tmp = victimDefenseSkill; @@ -2177,8 +2199,8 @@ void Unit::SendMeleeAttackStop(Unit* victim) { WorldPacket data(SMSG_ATTACKSTOP, (8+8+4)); data.append(GetPackGUID()); - data.append(victim ? victim->GetPackGUID() : 0); // can be 0x00... - data << uint32(0); // can be 0x1 + data.append(victim ? victim->GetPackGUID() : 0); + data << uint32(0); //! Can also take the value 0x01, which seems related to updating rotation SendMessageToSet(&data, true); sLog->outStaticDebug("WORLD: Sent SMSG_ATTACKSTOP"); @@ -2198,7 +2220,7 @@ bool Unit::isSpellBlocked(Unit* victim, SpellInfo const* spellProto, WeaponAttac { // Check creatures flags_extra for disable block if (victim->GetTypeId() == TYPEID_UNIT && - victim->ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_BLOCK) + victim->ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_BLOCK) return false; float blockChance = victim->GetUnitBlockChance(); @@ -2336,7 +2358,7 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit* victim, SpellInfo const* spell) // Check creatures flags_extra for disable parry if (victim->GetTypeId() == TYPEID_UNIT) { - uint32 flagEx = victim->ToCreature()->GetCreatureInfo()->flags_extra; + uint32 flagEx = victim->ToCreature()->GetCreatureTemplate()->flags_extra; if (flagEx & CREATURE_FLAG_EXTRA_NO_PARRY) canParry = false; // Check creatures flags_extra for disable block @@ -2887,7 +2909,8 @@ void Unit::SetCurrentCastedSpell(Spell* pSpell) CurrentSpellTypes CSpellType = pSpell->GetCurrentContainer(); - if (pSpell == m_currentSpells[CSpellType]) return; // avoid breaking self + if (pSpell == m_currentSpells[CSpellType]) // avoid breaking self + return; // break same type spell if it is not delayed InterruptSpell(CSpellType, false); @@ -3008,20 +3031,20 @@ bool Unit::IsNonMeleeSpellCasted(bool withDelayed, bool skipChanneled, bool skip (withDelayed || m_currentSpells[CURRENT_GENERIC_SPELL]->getState() != SPELL_STATE_DELAYED)) { if (!isAutoshoot || !(m_currentSpells[CURRENT_GENERIC_SPELL]->m_spellInfo->AttributesEx2 & SPELL_ATTR2_NOT_RESET_AUTO_ACTIONS)) - return(true); + return true; } // channeled spells may be delayed, but they are still considered casted else if (!skipChanneled && m_currentSpells[CURRENT_CHANNELED_SPELL] && (m_currentSpells[CURRENT_CHANNELED_SPELL]->getState() != SPELL_STATE_FINISHED)) { if (!isAutoshoot || !(m_currentSpells[CURRENT_CHANNELED_SPELL]->m_spellInfo->AttributesEx2 & SPELL_ATTR2_NOT_RESET_AUTO_ACTIONS)) - return(true); + return true; } // autorepeat spells may be finished or delayed, but they are still considered casted else if (!skipAutorepeat && m_currentSpells[CURRENT_AUTOREPEAT_SPELL]) - return(true); + return true; - return(false); + return false; } void Unit::InterruptNonMeleeSpells(bool withDelayed, uint32 spell_id, bool withInstant) @@ -3069,7 +3092,7 @@ bool Unit::isInAccessiblePlaceFor(Creature const* c) const if (IsInWater()) return c->canSwim(); else - return c->canWalk() || c->canFly(); + return c->canWalk() || c->CanFly(); } bool Unit::IsInWater() const @@ -3082,6 +3105,48 @@ bool Unit::IsUnderWater() const return GetBaseMap()->IsUnderWater(GetPositionX(), GetPositionY(), GetPositionZ()); } +void Unit::UpdateUnderwaterState(Map* m, float x, float y, float z) +{ + if (!isPet() && !IsVehicle()) + return; + + LiquidData liquid_status; + ZLiquidStatus res = m->getLiquidStatus(x, y, z, MAP_ALL_LIQUIDS, &liquid_status); + if (!res) + { + if (_lastLiquid && _lastLiquid->SpellId) + RemoveAurasDueToSpell(_lastLiquid->SpellId); + + RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_NOT_UNDERWATER); + _lastLiquid = NULL; + return; + } + + if (uint32 liqEntry = liquid_status.entry) + { + LiquidTypeEntry const* liquid = sLiquidTypeStore.LookupEntry(liqEntry); + if (_lastLiquid && _lastLiquid->SpellId && _lastLiquid->Id != liqEntry) + RemoveAurasDueToSpell(_lastLiquid->SpellId); + + if (liquid && liquid->SpellId) + { + if (res & (LIQUID_MAP_UNDER_WATER | LIQUID_MAP_IN_WATER)) + CastSpell(this, liquid->SpellId, true); + else + RemoveAurasDueToSpell(liquid->SpellId); + } + + RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_NOT_ABOVEWATER); + _lastLiquid = liquid; + } + else if (_lastLiquid && _lastLiquid->SpellId) + { + RemoveAurasDueToSpell(_lastLiquid->SpellId); + RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_NOT_UNDERWATER); + _lastLiquid = NULL; + } +} + void Unit::DeMorph() { SetDisplayId(GetNativeDisplayId()); @@ -3254,7 +3319,7 @@ void Unit::_ApplyAura(AuraApplication * aurApp, uint8 effMask) aura->HandleAuraSpecificMods(aurApp, caster, true, false); // apply effects of the aura - for (uint8 i = 0 ; i < MAX_SPELL_EFFECTS; ++i) + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { if (effMask & 1<GetRemoveMode())) aurApp->_HandleEffect(i, true); @@ -3313,7 +3378,7 @@ void Unit::_UnapplyAura(AuraApplicationMap::iterator &i, AuraRemoveMode removeMo aura->_UnapplyForTarget(this, caster, aurApp); // remove effects of the spell - needs to be done after removing aura from lists - for (uint8 itr = 0 ; itr < MAX_SPELL_EFFECTS; ++itr) + for (uint8 itr = 0; itr < MAX_SPELL_EFFECTS; ++itr) { if (aurApp->HasEffect(itr)) aurApp->_HandleEffect(itr, false); @@ -3490,7 +3555,7 @@ void Unit::RemoveAura(AuraApplication * aurApp, AuraRemoveMode mode) if (aurApp->GetRemoveMode()) { // remove remaining effects of an aura - for (uint8 itr = 0 ; itr < MAX_SPELL_EFFECTS; ++itr) + for (uint8 itr = 0; itr < MAX_SPELL_EFFECTS; ++itr) { if (aurApp->HasEffect(itr)) aurApp->_HandleEffect(itr, false); @@ -3601,8 +3666,12 @@ void Unit::RemoveAurasDueToSpellByDispel(uint32 spellId, uint32 dispellerSpellId { // final heal int32 healAmount = aurEff->GetAmount(); - int32 stack = dispelInfo.GetRemovedCharges(); - CastCustomSpell(this, 33778, &healAmount, &stack, NULL, true, NULL, NULL, aura->GetCasterGUID()); + if (Unit* caster = aura->GetCaster()) + { + healAmount = caster->SpellHealingBonusDone(this, aura->GetSpellInfo(), healAmount, HEAL, dispelInfo.GetRemovedCharges()); + healAmount = this->SpellHealingBonusTaken(caster, aura->GetSpellInfo(), healAmount, HEAL, dispelInfo.GetRemovedCharges()); + } + CastCustomSpell(this, 33778, &healAmount, NULL, NULL, true, NULL, NULL, aura->GetCasterGUID()); // mana if (Unit* caster = aura->GetCaster()) @@ -4133,6 +4202,45 @@ Aura* Unit::GetAuraOfRankedSpell(uint32 spellId, uint64 casterGUID, uint64 itemC return aurApp ? aurApp->GetBase() : NULL; } +void Unit::GetDispellableAuraList(Unit* caster, uint32 dispelMask, DispelChargesList& dispelList) +{ + // we should not be able to dispel diseases if the target is affected by unholy blight + if (dispelMask & (1 << DISPEL_DISEASE) && HasAura(50536)) + dispelMask &= ~(1 << DISPEL_DISEASE); + + AuraMap const& auras = GetOwnedAuras(); + for (AuraMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr) + { + Aura* aura = itr->second; + AuraApplication * aurApp = aura->GetApplicationOfTarget(GetGUID()); + if (!aurApp) + continue; + + // don't try to remove passive auras + if (aura->IsPassive()) + continue; + + if (aura->GetSpellInfo()->GetDispelMask() & dispelMask) + { + if (aura->GetSpellInfo()->Dispel == DISPEL_MAGIC) + { + // do not remove positive auras if friendly target + // negative auras if non-friendly target + if (aurApp->IsPositive() == IsFriendlyTo(caster)) + continue; + } + + // The charges / stack amounts don't count towards the total number of auras that can be dispelled. + // Ie: A dispel on a target with 5 stacks of Winters Chill and a Polymorph has 1 / (1 + 1) -> 50% chance to dispell + // Polymorph instead of 1 / (5 + 1) -> 16%. + bool dispel_charges = aura->GetSpellInfo()->AttributesEx7 & SPELL_ATTR7_DISPEL_CHARGES; + uint8 charges = dispel_charges ? aura->GetCharges() : aura->GetStackAmount(); + if (charges > 0) + dispelList.push_back(std::make_pair(aura, charges)); + } + } +} + bool Unit::HasAuraEffect(uint32 spellId, uint8 effIndex, uint64 caster) const { for (AuraApplicationMap::const_iterator itr = m_appliedAuras.lower_bound(spellId); itr != m_appliedAuras.upper_bound(spellId); ++itr) @@ -4389,9 +4497,7 @@ float Unit::GetTotalAuraMultiplierByMiscMask(AuraType auratype, uint32 misc_mask } // Add the highest of the Same Effect Stack Rule SpellGroups to the multiplier for (std::map::const_iterator itr = SameEffectSpellGroup.begin(); itr != SameEffectSpellGroup.end(); ++itr) - { AddPctN(multiplier, itr->second); - } return multiplier; } @@ -4426,27 +4532,39 @@ int32 Unit::GetMaxNegativeAuraModifierByMiscMask(AuraType auratype, uint32 misc_ int32 Unit::GetTotalAuraModifierByMiscValue(AuraType auratype, int32 misc_value) const { + std::map SameEffectSpellGroup; int32 modifier = 0; AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype); for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i) { if ((*i)->GetMiscValue() == misc_value) - modifier += (*i)->GetAmount(); + if (!sSpellMgr->AddSameEffectStackRuleSpellGroups((*i)->GetSpellInfo(), (*i)->GetAmount(), SameEffectSpellGroup)) + modifier += (*i)->GetAmount(); } + + for (std::map::const_iterator itr = SameEffectSpellGroup.begin(); itr != SameEffectSpellGroup.end(); ++itr) + modifier += itr->second; + return modifier; } float Unit::GetTotalAuraMultiplierByMiscValue(AuraType auratype, int32 misc_value) const { + std::map SameEffectSpellGroup; float multiplier = 1.0f; AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype); for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i) { if ((*i)->GetMiscValue() == misc_value) - AddPctN(multiplier, (*i)->GetAmount()); + if (!sSpellMgr->AddSameEffectStackRuleSpellGroups((*i)->GetSpellInfo(), (*i)->GetAmount(), SameEffectSpellGroup)) + AddPctN(multiplier, (*i)->GetAmount()); } + + for (std::map::const_iterator itr = SameEffectSpellGroup.begin(); itr != SameEffectSpellGroup.end(); ++itr) + AddPctN(multiplier, itr->second); + return multiplier; } @@ -4480,27 +4598,39 @@ int32 Unit::GetMaxNegativeAuraModifierByMiscValue(AuraType auratype, int32 misc_ int32 Unit::GetTotalAuraModifierByAffectMask(AuraType auratype, SpellInfo const* affectedSpell) const { + std::map SameEffectSpellGroup; int32 modifier = 0; AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype); for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i) { if ((*i)->IsAffectingSpell(affectedSpell)) - modifier += (*i)->GetAmount(); + if (!sSpellMgr->AddSameEffectStackRuleSpellGroups((*i)->GetSpellInfo(), (*i)->GetAmount(), SameEffectSpellGroup)) + modifier += (*i)->GetAmount(); } + + for (std::map::const_iterator itr = SameEffectSpellGroup.begin(); itr != SameEffectSpellGroup.end(); ++itr) + modifier += itr->second; + return modifier; } float Unit::GetTotalAuraMultiplierByAffectMask(AuraType auratype, SpellInfo const* affectedSpell) const { + std::map SameEffectSpellGroup; float multiplier = 1.0f; AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype); for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i) { if ((*i)->IsAffectingSpell(affectedSpell)) - AddPctN(multiplier, (*i)->GetAmount()); + if (!sSpellMgr->AddSameEffectStackRuleSpellGroups((*i)->GetSpellInfo(), (*i)->GetAmount(), SameEffectSpellGroup)) + AddPctN(multiplier, (*i)->GetAmount()); } + + for (std::map::const_iterator itr = SameEffectSpellGroup.begin(); itr != SameEffectSpellGroup.end(); ++itr) + AddPctN(multiplier, itr->second); + return multiplier; } @@ -4589,7 +4719,9 @@ GameObject* Unit::GetGameObject(uint32 spellId) const void Unit::AddGameObject(GameObject* gameObj) { - if (!gameObj || !gameObj->GetOwnerGUID() == 0) return; + if (!gameObj || !gameObj->GetOwnerGUID() == 0) + return; + m_gameObj.push_back(gameObj); gameObj->SetOwnerGUID(GetGUID()); @@ -4605,7 +4737,8 @@ void Unit::AddGameObject(GameObject* gameObj) void Unit::RemoveGameObject(GameObject* gameObj, bool del) { - if (!gameObj || !gameObj->GetOwnerGUID() == GetGUID()) return; + if (!gameObj || gameObj->GetOwnerGUID() != GetGUID()) + return; gameObj->SetOwnerGUID(0); @@ -4826,28 +4959,29 @@ void Unit::SendAttackStateUpdate(CalcDamageInfo* damageInfo) data << uint32(damageInfo->damage); // Sub Damage } - if (damageInfo->HitInfo & (HITINFO_ABSORB | HITINFO_ABSORB2)) + if (damageInfo->HitInfo & (HITINFO_FULL_ABSORB | HITINFO_PARTIAL_ABSORB)) { for (uint32 i = 0; i < count; ++i) data << uint32(damageInfo->absorb); // Absorb } - if (damageInfo->HitInfo & (HITINFO_RESIST | HITINFO_RESIST2)) + if (damageInfo->HitInfo & (HITINFO_FULL_RESIST | HITINFO_PARTIAL_RESIST)) { for (uint32 i = 0; i < count; ++i) data << uint32(damageInfo->resist); // Resist } data << uint8(damageInfo->TargetState); - data << uint32(0); - data << uint32(0); + data << uint32(0); // Unknown attackerstate + data << uint32(0); // Melee spellid if (damageInfo->HitInfo & HITINFO_BLOCK) data << uint32(damageInfo->blocked_amount); - if (damageInfo->HitInfo & HITINFO_UNK3) + if (damageInfo->HitInfo & HITINFO_RAGE_GAIN) data << uint32(0); + //! Probably used for debugging purposes, as it is not known to appear on retail servers if (damageInfo->HitInfo & HITINFO_UNK1) { data << uint32(0); @@ -5492,6 +5626,13 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere } break; } + case 71875: // Item - Black Bruise: Necrotic Touch Proc + case 71877: + { + basepoints0 = CalculatePctN(int32(damage), triggerAmount); + triggered_spell_id = 71879; + break; + } // Item - Shadowmourne Legendary case 71903: { @@ -5673,7 +5814,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere // Glyph of Polymorph case 56375: { - if(!target) + if (!target) return false; target->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE, 0, target->GetAura(32409)); // SW:D shall not be removed. target->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE_PERCENT); @@ -5732,13 +5873,13 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere // Blessing of Ancient Kings (Val'anyr, Hammer of Ancient Kings) case 64411: { - if(!victim) + if (!victim) return false; basepoints0 = int32(CalculatePctN(damage, 15)); if (AuraEffect* aurEff = victim->GetAuraEffect(64413, 0, GetGUID())) { // The shield can grow to a maximum size of 20, 000 damage absorbtion - aurEff->SetAmount(std::max(aurEff->GetAmount() + basepoints0, 20000)); + aurEff->SetAmount(std::min(aurEff->GetAmount() + basepoints0, 20000)); // Refresh and return to prevent replacing the aura aurEff->GetBase()->RefreshDuration(); @@ -5920,6 +6061,8 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere // Siphon Life case 63108: { + if (!damage) + break; // Glyph of Siphon Life if (HasAura(56216)) triggerAmount += triggerAmount / 4; @@ -6043,7 +6186,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere // Divine Aegis if (dummySpell->SpellIconID == 2820) { - if(!target) + if (!target) return false; // Multiple effects stack, so let's try to find this aura. @@ -6213,7 +6356,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere // Glyph of Shred case 54815: { - if(!target) + if (!target) return false; // try to find spell Rip on the target @@ -6519,7 +6662,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere // Explosive Shot if (procSpell->SpellFamilyFlags[2] & 0x200) { - if(!victim) + if (!victim) return false; if (AuraEffect const* pEff = victim->GetAuraEffect(SPELL_AURA_PERIODIC_DUMMY, SPELLFAMILY_HUNTER, 0x0, 0x80000000, 0x0, GetGUID())) basepoints0 = pEff->GetSpellInfo()->CalcPowerCost(this, SpellSchoolMask(pEff->GetSpellInfo()->SchoolMask)) * 4/10/3; @@ -6576,9 +6719,11 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere { case 34477: // Misdirection { + if (!GetMisdirectionTarget()) + return false; triggered_spell_id = 35079; // 4 sec buff on self target = this; - return true; + break; } case 57870: // Glyph of Mend Pet { @@ -6597,8 +6742,8 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere return false; triggered_spell_id = 25742; float ap = GetTotalAttackPowerValue(BASE_ATTACK); - int32 holy = SpellBaseDamageBonus(SPELL_SCHOOL_MASK_HOLY) + - SpellBaseDamageBonusForVictim(SPELL_SCHOOL_MASK_HOLY, victim); + int32 holy = SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_HOLY) + + victim->SpellBaseDamageBonusTaken(SPELL_SCHOOL_MASK_HOLY); basepoints0 = (int32)GetAttackTime(BASE_ATTACK) * int32(ap * 0.022f + 0.044f * holy) / 1000; break; } @@ -7230,30 +7375,16 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere if (procSpell->SpellIconID != 2019) return false; - AuraEffect* aurEffA = NULL; - AuraEffectList const& auras = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_DONE); - for (AuraEffectList::const_iterator i = auras.begin(); i != auras.end(); ++i) + if (Creature* totem = GetMap()->GetCreature(m_SummonSlot[1])) // Fire totem summon slot { - SpellInfo const* spell = (*i)->GetSpellInfo(); - if (spell->SpellFamilyName == uint32(SPELLFAMILY_SHAMAN) && spell->SpellFamilyFlags.HasFlag(0, 0x02000000, 0)) + if (SpellInfo const* totemSpell = sSpellMgr->GetSpellInfo(totem->m_spells[0])) { - if ((*i)->GetCasterGUID() != GetGUID()) - continue; - if (spell->Id == 63283) - continue; - aurEffA = (*i); - break; + int32 bp0 = CalculatePctN(totemSpell->Effects[EFFECT_0].CalcValue(), triggerAmount); + int32 bp1 = CalculatePctN(totemSpell->Effects[EFFECT_1].CalcValue(), triggerAmount); + CastCustomSpell(this, 63283, &bp0, &bp1, NULL, true); + return true; } } - if (aurEffA) - { - int32 bp0 = 0, bp1 = 0; - bp0 = CalculatePctN(triggerAmount, aurEffA->GetAmount()); - if (AuraEffect* aurEffB = aurEffA->GetBase()->GetEffect(EFFECT_1)) - bp1 = CalculatePctN(triggerAmount, aurEffB->GetAmount()); - CastCustomSpell(this, 63283, &bp0, &bp1, NULL, true, NULL, triggeredByAura); - return true; - } return false; } break; @@ -7272,20 +7403,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere triggered_spell_id = 63685; break; } - // Storm, Earth and Fire - if (dummySpell->SpellIconID == 3063) - { - // Earthbind Totem summon only - if (procSpell->Id != 2484) - return false; - - float chance = (float)triggerAmount; - if (!roll_chance_f(chance)) - return false; - - triggered_spell_id = 64695; - break; - } // Ancestral Awakening if (dummySpell->SpellIconID == 3065) { @@ -7314,8 +7431,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere if (GetTypeId() != TYPEID_PLAYER || !victim || !victim->isAlive() || !castItem || !castItem->IsEquipped()) return false; - Player* player = ToPlayer(); - WeaponAttackType attType = WeaponAttackType(player->GetAttackBySlot(castItem->GetSlot())); + WeaponAttackType attType = WeaponAttackType(Player::GetAttackBySlot(castItem->GetSlot())); if ((attType != BASE_ATTACK && attType != OFF_ATTACK) || (attType == BASE_ATTACK && procFlag & PROC_FLAG_DONE_OFFHAND_ATTACK) || (attType == OFF_ATTACK && procFlag & PROC_FLAG_DONE_MAINHAND_ATTACK)) @@ -7323,8 +7439,8 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere float fire_onhit = float(CalculatePctF(dummySpell->Effects[EFFECT_0]. CalcValue(), 1.0f)); - float add_spellpower = (float)(SpellBaseDamageBonus(SPELL_SCHOOL_MASK_FIRE) - + SpellBaseDamageBonusForVictim(SPELL_SCHOOL_MASK_FIRE, victim)); + float add_spellpower = (float)(SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_FIRE) + + victim->SpellBaseDamageBonusTaken(SPELL_SCHOOL_MASK_FIRE)); // 1.3speed = 5%, 2.6speed = 10%, 4.0 speed = 15%, so, 1.0speed = 3.84% ApplyPctF(add_spellpower, 3.84f); @@ -7665,17 +7781,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere } } } - // Item - Death Knight T10 Melee 4P Bonus - if (dummySpell->Id == 70656) - { - Player* player = ToPlayer(); - if (!player) - return false; - - for (uint32 i = 0; i < MAX_RUNES; ++i) - if (player->GetRuneCooldown(i) == 0) - return false; - } break; } case SPELLFAMILY_POTION: @@ -7903,11 +8008,7 @@ bool Unit::HandleAuraProc(Unit* victim, uint32 damage, Aura* triggeredByAura, Sp for (uint8 i = 1; i < stack; ++i) dmg += mod * stack; if (Unit* caster = triggeredByAura->GetCaster()) - { caster->CastCustomSpell(70701, SPELLVALUE_BASE_POINT0, dmg); - if (Creature* creature = caster->ToCreature()) - creature->DespawnOrUnsummon(1); - } break; } // Ball of Flames Proc @@ -7947,7 +8048,7 @@ bool Unit::HandleAuraProc(Unit* victim, uint32 damage, Aura* triggeredByAura, Sp *handled = true; if (victim && victim->HasAura(53601)) { - int32 bp0 = CalculatePctN(int32(damage / 12), dummySpell->Effects[EFFECT_2]. CalcValue()); + int32 bp0 = CalculatePctN(int32(damage / 12), dummySpell->Effects[EFFECT_2].CalcValue()); // Item - Paladin T9 Holy 4P Bonus if (AuraEffect const* aurEff = GetAuraEffect(67191, 0)) AddPctN(bp0, aurEff->GetAmount()); @@ -7972,10 +8073,10 @@ bool Unit::HandleAuraProc(Unit* victim, uint32 damage, Aura* triggeredByAura, Sp { *handled = true; // Check if we are the target and prevent mana gain - if (triggeredByAura->GetCasterGUID() == victim->GetGUID()) + if (victim && triggeredByAura->GetCasterGUID() == victim->GetGUID()) return false; // Lookup base amount mana restore - for (uint8 i = 0; iEffects[i].Effect == SPELL_EFFECT_ENERGIZE) { @@ -8118,6 +8219,16 @@ bool Unit::HandleAuraProc(Unit* victim, uint32 damage, Aura* triggeredByAura, Sp CastCustomSpell(this, 70845, &basepoints0, NULL, NULL, true); break; } + // Recklessness + case 1719: + { + //! Possible hack alert + //! Don't drop charges on proc, they will be dropped on SpellMod removal + //! Before this change, it was dropping two charges per attack, one in ProcDamageAndSpellFor, and one in RemoveSpellMods. + //! The reason of this behaviour is Recklessness having three auras, 2 of them can not proc (isTriggeredAura array) but the other one can, making the whole spell proc. + *handled = true; + break; + } default: break; } @@ -8241,6 +8352,12 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg RemoveAuraFromStack(auraSpellInfo->Id); return false; } + if (auraSpellInfo->Id == 50720) + { + target = triggeredByAura->GetCaster(); + if (!target) + return false; + } break; case SPELLFAMILY_WARLOCK: { @@ -8591,6 +8708,36 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg trigger_spell_id = 50475; basepoints0 = CalculatePctN(int32(damage), triggerAmount); } + // Item - Death Knight T10 Melee 4P Bonus + else if (auraSpellInfo->Id == 70656) + { + if (GetTypeId() != TYPEID_PLAYER || getClass() != CLASS_DEATH_KNIGHT) + return false; + + for (uint8 i = 0; i < MAX_RUNES; ++i) + if (ToPlayer()->GetRuneCooldown(i) == 0) + return false; + } + break; + } + case SPELLFAMILY_ROGUE: + { + switch (auraSpellInfo->Id) + { + // Rogue T10 2P bonus, should only proc on caster + case 70805: + { + if (victim != this) + return false; + break; + } + // Rogue T10 4P bonus, should proc on victim + case 70803: + { + target = victim; + break; + } + } break; } default: @@ -8757,7 +8904,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg } // Blade Barrier - if (auraSpellInfo->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT && auraSpellInfo->SpellIconID == 85) + if (auraSpellInfo->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT && auraSpellInfo->SpellIconID == 85 && procSpell) { Player* player = ToPlayer(); if (!player || player->getClass() != CLASS_DEATH_KNIGHT) @@ -8863,7 +9010,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg { if (AuraEffect* aurEff = owner->GetDummyAuraEffect(SPELLFAMILY_WARLOCK, 3220, 0)) { - basepoints0 = int32((aurEff->GetAmount() * owner->SpellBaseDamageBonus(SpellSchoolMask(SPELL_SCHOOL_MASK_MAGIC)) + 100.0f) / 100.0f); // TODO: Is it right? + basepoints0 = int32((aurEff->GetAmount() * owner->SpellBaseDamageBonusDone(SpellSchoolMask(SPELL_SCHOOL_MASK_MAGIC)) + 100.0f) / 100.0f); // TODO: Is it right? CastCustomSpell(this, trigger_spell_id, &basepoints0, &basepoints0, NULL, true, castItem, triggeredByAura); return true; } @@ -8972,10 +9119,10 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg case 70893: { // check if we're doing a critical hit - if (!(procSpell->SpellFamilyFlags[1] & 0x10000000) && (procEx != PROC_EX_CRITICAL_HIT) ) + if (!(procSpell->SpellFamilyFlags[1] & 0x10000000) && (procEx != PROC_EX_CRITICAL_HIT)) return false; // check if we're procced by Claw, Bite or Smack (need to use the spell icon ID to detect it) - if (!(procSpell->SpellIconID == 262 || procSpell->SpellIconID == 1680 || procSpell->SpellIconID == 473 )) + if (!(procSpell->SpellIconID == 262 || procSpell->SpellIconID == 1680 || procSpell->SpellIconID == 473)) return false; break; } @@ -9183,7 +9330,7 @@ FactionTemplateEntry const* Unit::getFactionTemplateEntry() const if (Player const* player = ToPlayer()) sLog->outError("Player %s has invalid faction (faction template id) #%u", player->GetName(), getFaction()); else if (Creature const* creature = ToCreature()) - sLog->outError("Creature (template id: %u) has invalid faction (faction template id) #%u", creature->GetCreatureInfo()->Entry, getFaction()); + sLog->outError("Creature (template id: %u) has invalid faction (faction template id) #%u", creature->GetCreatureTemplate()->Entry, getFaction()); else sLog->outError("Unit (name=%s, type=%u) has invalid faction (faction template id) #%u", GetName(), uint32(GetTypeId()), getFaction()); @@ -9441,6 +9588,16 @@ bool Unit::Attack(Unit* victim, bool meleeAttack) if (meleeAttack) SendMeleeAttackStart(victim); + // Let the pet know we've started attacking someting. Handles melee attacks only + // Spells such as auto-shot and others handled in WorldSession::HandleCastSpellOpcode + if (this->GetTypeId() == TYPEID_PLAYER) + { + Pet* playerPet = this->ToPlayer()->GetPet(); + + if (playerPet && playerPet->isAlive()) + playerPet->AI()->OwnerAttacked(victim); + } + return true; } @@ -9911,7 +10068,7 @@ void Unit::SetCharm(Unit* charm, bool apply) if (charm->HasUnitMovementFlag(MOVEMENTFLAG_WALKING)) { - charm->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + charm->SetWalk(false); charm->SendMovementFlagUpdate(); } @@ -10039,7 +10196,7 @@ Unit* Unit::GetFirstControlled() const // Sequence: charmed, pet, other guardians Unit* unit = GetCharm(); if (!unit) - if (uint64 guid = GetUInt64Value(UNIT_FIELD_SUMMON)) + if (uint64 guid = GetMinionGUID()) unit = ObjectAccessor::GetUnit(*this, guid); return unit; @@ -10216,7 +10373,7 @@ void Unit::EnergizeBySpell(Unit* victim, uint32 spellID, uint32 damage, Powers p victim->getHostileRefManager().threatAssist(this, float(damage) * 0.5f, spellInfo); } -uint32 Unit::SpellDamageBonus(Unit* victim, SpellInfo const* spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack) +uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack) { if (!spellProto || !victim || damagetype == DIRECT_DAMAGE) return pdamage; @@ -10229,33 +10386,35 @@ uint32 Unit::SpellDamageBonus(Unit* victim, SpellInfo const* spellProto, uint32 // For totems get damage bonus from owner if (GetTypeId() == TYPEID_UNIT && ToCreature()->isTotem()) if (Unit* owner = GetOwner()) - return owner->SpellDamageBonus(victim, spellProto, pdamage, damagetype); + return owner->SpellDamageBonusDone(victim, spellProto, pdamage, damagetype); - // Taken/Done total percent damage auras + // Done total percent damage auras float DoneTotalMod = 1.0f; float ApCoeffMod = 1.0f; int32 DoneTotal = 0; - int32 TakenTotal = 0; - // ..done // Pet damage? if (GetTypeId() == TYPEID_UNIT && !ToCreature()->isPet()) - DoneTotalMod *= ToCreature()->GetSpellDamageMod(ToCreature()->GetCreatureInfo()->rank); + DoneTotalMod *= ToCreature()->GetSpellDamageMod(ToCreature()->GetCreatureTemplate()->rank); - AuraEffectList const& mModDamagePercentDone = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE); - for (AuraEffectList::const_iterator i = mModDamagePercentDone.begin(); i != mModDamagePercentDone.end(); ++i) + // Some spells don't benefit from pct done mods + if (!(spellProto->AttributesEx6 & SPELL_ATTR6_NO_DONE_PCT_DAMAGE_MODS) && !spellProto->IsRankOf(sSpellMgr->GetSpellInfo(12162))) { - if (spellProto->EquippedItemClass == -1 && (*i)->GetSpellInfo()->EquippedItemClass != -1) //prevent apply mods from weapon specific case to non weapon specific spells (Example: thunder clap and two-handed weapon specialization) - continue; - - if ((*i)->GetMiscValue() & spellProto->GetSchoolMask()) + AuraEffectList const& mModDamagePercentDone = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE); + for (AuraEffectList::const_iterator i = mModDamagePercentDone.begin(); i != mModDamagePercentDone.end(); ++i) { - if ((*i)->GetSpellInfo()->EquippedItemClass == -1) - AddPctN(DoneTotalMod, (*i)->GetAmount()); - else if (!((*i)->GetSpellInfo()->AttributesEx5 & SPELL_ATTR5_SPECIAL_ITEM_CLASS_CHECK) && ((*i)->GetSpellInfo()->EquippedItemSubClassMask == 0)) - AddPctN(DoneTotalMod, (*i)->GetAmount()); - else if (ToPlayer() && ToPlayer()->HasItemFitToSpellRequirements((*i)->GetSpellInfo())) - AddPctN(DoneTotalMod, (*i)->GetAmount()); + if (spellProto->EquippedItemClass == -1 && (*i)->GetSpellInfo()->EquippedItemClass != -1) //prevent apply mods from weapon specific case to non weapon specific spells (Example: thunder clap and two-handed weapon specialization) + continue; + + if ((*i)->GetMiscValue() & spellProto->GetSchoolMask()) + { + if ((*i)->GetSpellInfo()->EquippedItemClass == -1) + AddPctN(DoneTotalMod, (*i)->GetAmount()); + else if (!((*i)->GetSpellInfo()->AttributesEx5 & SPELL_ATTR5_SPECIAL_ITEM_CLASS_CHECK) && ((*i)->GetSpellInfo()->EquippedItemSubClassMask == 0)) + AddPctN(DoneTotalMod, (*i)->GetAmount()); + else if (ToPlayer() && ToPlayer()->HasItemFitToSpellRequirements((*i)->GetSpellInfo())) + AddPctN(DoneTotalMod, (*i)->GetAmount()); + } } } @@ -10435,7 +10594,7 @@ uint32 Unit::SpellDamageBonus(Unit* victim, SpellInfo const* spellProto, uint32 break; } } - break; + break; case SPELLFAMILY_PRIEST: // Mind Flay if (spellProto->SpellFamilyFlags[0] & 0x800000) @@ -10468,7 +10627,7 @@ uint32 Unit::SpellDamageBonus(Unit* victim, SpellInfo const* spellProto, uint32 if (victim->HasAuraState(AURA_STATE_HEALTHLESS_35_PERCENT)) AddPctN(DoneTotalMod, aurEff->GetAmount()); } - break; + break; case SPELLFAMILY_PALADIN: // Judgement of Vengeance/Judgement of Corruption if ((spellProto->SpellFamilyFlags[1] & 0x400000) && spellProto->SpellIconID == 2292) @@ -10486,7 +10645,7 @@ uint32 Unit::SpellDamageBonus(Unit* victim, SpellInfo const* spellProto, uint32 if (stacks) AddPctU(DoneTotalMod, 10 * stacks); } - break; + break; case SPELLFAMILY_DRUID: // Thorns if (spellProto->SpellFamilyFlags[0] & 0x100) @@ -10495,7 +10654,7 @@ uint32 Unit::SpellDamageBonus(Unit* victim, SpellInfo const* spellProto, uint32 if (AuraEffect* aurEff = GetAuraEffectOfRankedSpell(16836, 0)) AddPctN(DoneTotalMod, aurEff->GetAmount()); } - break; + break; case SPELLFAMILY_WARLOCK: // Fire and Brimstone if (spellProto->SpellFamilyFlags[1] & 0x00020040) @@ -10517,14 +10676,14 @@ uint32 Unit::SpellDamageBonus(Unit* victim, SpellInfo const* spellProto, uint32 if (spellProto->SpellFamilyFlags[1] & 0x00400000 && isPet()) if (uint8 count = victim->GetDoTsByCaster(GetOwnerGUID())) AddPctN(DoneTotalMod, 15 * count); - break; + break; case SPELLFAMILY_HUNTER: // Steady Shot if (spellProto->SpellFamilyFlags[1] & 0x1) if (AuraEffect* aurEff = GetAuraEffect(56826, 0)) // Glyph of Steady Shot if (victim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_HUNTER, 0x00004000, 0, 0, GetGUID())) AddPctN(DoneTotalMod, aurEff->GetAmount()); - break; + break; case SPELLFAMILY_DEATHKNIGHT: // Improved Icy Touch if (spellProto->SpellFamilyFlags[0] & 0x2) @@ -10565,53 +10724,11 @@ uint32 Unit::SpellDamageBonus(Unit* victim, SpellInfo const* spellProto, uint32 } } } - break; - } - - // ..taken - float TakenTotalMod = 1.0f; - - // from positive and negative SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN - // multiplicative bonus, for example Dispersion + Shadowform (0.10*0.85=0.085) - TakenTotalMod *= victim->GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, spellProto->GetSchoolMask()); - - // .. taken pct: dummy auras - AuraEffectList const& mDummyAuras = victim->GetAuraEffectsByType(SPELL_AURA_DUMMY); - for (AuraEffectList::const_iterator i = mDummyAuras.begin(); i != mDummyAuras.end(); ++i) - { - switch ((*i)->GetSpellInfo()->SpellIconID) - { - // Cheat Death - case 2109: - if ((*i)->GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL) - { - if (victim->GetTypeId() != TYPEID_PLAYER) - continue; - float mod = victim->ToPlayer()->GetRatingBonusValue(CR_CRIT_TAKEN_MELEE) * (-8.0f); - AddPctF(TakenTotalMod, std::max(mod, float((*i)->GetAmount()))); - } - break; - } - } - - // From caster spells - AuraEffectList const& mOwnerTaken = victim->GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_FROM_CASTER); - for (AuraEffectList::const_iterator i = mOwnerTaken.begin(); i != mOwnerTaken.end(); ++i) - if ((*i)->GetCasterGUID() == GetGUID() && (*i)->IsAffectingSpell(spellProto)) - AddPctN(TakenTotalMod, (*i)->GetAmount()); - - // Mod damage from spell mechanic - if (uint32 mechanicMask = spellProto->GetAllEffectsMechanicMask()) - { - AuraEffectList const& mDamageDoneMechanic = victim->GetAuraEffectsByType(SPELL_AURA_MOD_MECHANIC_DAMAGE_TAKEN_PERCENT); - for (AuraEffectList::const_iterator i = mDamageDoneMechanic.begin(); i != mDamageDoneMechanic.end(); ++i) - if (mechanicMask & uint32(1<<((*i)->GetMiscValue()))) - AddPctN(TakenTotalMod, (*i)->GetAmount()); + break; } - // Taken/Done fixed damage bonus auras - int32 DoneAdvertisedBenefit = SpellBaseDamageBonus(spellProto->GetSchoolMask()); - int32 TakenAdvertisedBenefit = SpellBaseDamageBonusForVictim(spellProto->GetSchoolMask(), victim); + // Done fixed damage bonus auras + int32 DoneAdvertisedBenefit = SpellBaseDamageBonusDone(spellProto->GetSchoolMask()); // Pets just add their bonus damage to their spell damage // note that their spell damage is just gain of their own auras if (HasUnitTypeMask(UNIT_MASK_GUARDIAN)) @@ -10628,7 +10745,7 @@ uint32 Unit::SpellDamageBonus(Unit* victim, SpellInfo const* spellProto, uint32 if (bonus->ap_dot_bonus > 0) { WeaponAttackType attType = (spellProto->IsRangedWeaponSpell() && spellProto->DmgClass != SPELL_DAMAGE_CLASS_MELEE) ? RANGED_ATTACK : BASE_ATTACK; - float APbonus = (float) victim->GetTotalAuraModifier(attType == BASE_ATTACK ? SPELL_AURA_MELEE_ATTACK_POWER_ATTACKER_BONUS : SPELL_AURA_RANGED_ATTACK_POWER_ATTACKER_BONUS); + float APbonus = float(victim->GetTotalAuraModifier(attType == BASE_ATTACK ? SPELL_AURA_MELEE_ATTACK_POWER_ATTACKER_BONUS : SPELL_AURA_RANGED_ATTACK_POWER_ATTACKER_BONUS)); APbonus += GetTotalAttackPowerValue(attType); DoneTotal += int32(bonus->ap_dot_bonus * stack * ApCoeffMod * APbonus); } @@ -10639,74 +10756,20 @@ uint32 Unit::SpellDamageBonus(Unit* victim, SpellInfo const* spellProto, uint32 if (bonus->ap_bonus > 0) { WeaponAttackType attType = (spellProto->IsRangedWeaponSpell() && spellProto->DmgClass != SPELL_DAMAGE_CLASS_MELEE) ? RANGED_ATTACK : BASE_ATTACK; - float APbonus = (float) victim->GetTotalAuraModifier(attType == BASE_ATTACK ? SPELL_AURA_MELEE_ATTACK_POWER_ATTACKER_BONUS : SPELL_AURA_RANGED_ATTACK_POWER_ATTACKER_BONUS); + float APbonus = float(victim->GetTotalAuraModifier(attType == BASE_ATTACK ? SPELL_AURA_MELEE_ATTACK_POWER_ATTACKER_BONUS : SPELL_AURA_RANGED_ATTACK_POWER_ATTACKER_BONUS)); APbonus += GetTotalAttackPowerValue(attType); DoneTotal += int32(bonus->ap_bonus * stack * ApCoeffMod * APbonus); } } } // Default calculation - if (DoneAdvertisedBenefit || TakenAdvertisedBenefit) + if (DoneAdvertisedBenefit) { if (!bonus || coeff < 0) - { - // Damage Done from spell damage bonus - int32 CastingTime = spellProto->IsChanneled() ? spellProto->GetDuration() : spellProto->CalcCastTime(); - // Damage over Time spells bonus calculation - float DotFactor = 1.0f; - if (damagetype == DOT) - { - int32 DotDuration = spellProto->GetDuration(); - // 200% limit - if (DotDuration > 0) - { - if (DotDuration > 30000) - DotDuration = 30000; - if (!spellProto->IsChanneled()) - DotFactor = DotDuration / 15000.0f; - uint8 x = 0; - for (uint8 j = 0; j < MAX_SPELL_EFFECTS; ++j) - { - if (spellProto->Effects[j].Effect == SPELL_EFFECT_APPLY_AURA && ( - spellProto->Effects[j].ApplyAuraName == SPELL_AURA_PERIODIC_DAMAGE || - spellProto->Effects[j].ApplyAuraName == SPELL_AURA_PERIODIC_LEECH)) - { - x = j; - break; - } - } - int32 DotTicks = 6; - if (spellProto->Effects[x].Amplitude != 0) - DotTicks = DotDuration / spellProto->Effects[x].Amplitude; - if (DotTicks) - { - DoneAdvertisedBenefit /= DotTicks; - TakenAdvertisedBenefit /= DotTicks; - } - } - } - // Distribute Damage over multiple effects, reduce by AoE - CastingTime = GetCastingTimeForBonus(spellProto, damagetype, CastingTime); - - // 50% for damage and healing spells for leech spells from damage bonus and 0% from healing - for (uint8 j = 0; j < MAX_SPELL_EFFECTS; ++j) - { - if (spellProto->Effects[j].Effect == SPELL_EFFECT_HEALTH_LEECH || - (spellProto->Effects[j].Effect == SPELL_EFFECT_APPLY_AURA && spellProto->Effects[j].ApplyAuraName == SPELL_AURA_PERIODIC_LEECH)) - { - CastingTime /= 2; - break; - } - } - if (spellProto->SchoolMask != SPELL_SCHOOL_MASK_NORMAL) - coeff = (CastingTime / 3500.0f) * DotFactor; - else - coeff = DotFactor; - } + coeff = CalculateDefaultCoefficient(spellProto, damagetype) * int32(stack); float factorMod = CalculateLevelPenalty(spellProto) * stack; - // level penalty still applied on Taken bonus - is it blizzlike? - TakenTotal+= int32(TakenAdvertisedBenefit * factorMod); + if (Player* modOwner = GetSpellModOwner()) { coeff *= 100.0f; @@ -10723,27 +10786,94 @@ uint32 Unit::SpellDamageBonus(Unit* victim, SpellInfo const* spellProto, uint32 DoneTotalMod = 1.0f; } - // Some spells don't benefit from pct done mods - // maybe should be implemented like SPELL_ATTR3_NO_DONE_BONUS, - // but then it may break spell power coeffs work on spell 31117 - if (spellProto->AttributesEx6 & SPELL_ATTR6_NO_DONE_PCT_DAMAGE_MODS) - DoneTotalMod = 1.0f; - float tmpDamage = (int32(pdamage) + DoneTotal) * DoneTotalMod; // apply spellmod to Done damage (flat and pct) if (Player* modOwner = GetSpellModOwner()) modOwner->ApplySpellMod(spellProto->Id, damagetype == DOT ? SPELLMOD_DOT : SPELLMOD_DAMAGE, tmpDamage); - tmpDamage = (tmpDamage + TakenTotal) * TakenTotalMod; + return uint32(std::max(tmpDamage, 0.0f)); +} + +uint32 Unit::SpellDamageBonusTaken(Unit* caster, SpellInfo const* spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack) +{ + if (!spellProto || damagetype == DIRECT_DAMAGE) + return pdamage; + + int32 TakenTotal = 0; + float TakenTotalMod = 1.0f; + + // from positive and negative SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN + // multiplicative bonus, for example Dispersion + Shadowform (0.10*0.85=0.085) + TakenTotalMod *= GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, spellProto->GetSchoolMask()); + + //.. taken pct: dummy auras + AuraEffectList const& mDummyAuras = GetAuraEffectsByType(SPELL_AURA_DUMMY); + for (AuraEffectList::const_iterator i = mDummyAuras.begin(); i != mDummyAuras.end(); ++i) + { + switch ((*i)->GetSpellInfo()->SpellIconID) + { + // Cheat Death + case 2109: + if ((*i)->GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL) + { + if (GetTypeId() != TYPEID_PLAYER) + continue; + float mod = ToPlayer()->GetRatingBonusValue(CR_CRIT_TAKEN_MELEE) * (-8.0f); + AddPctF(TakenTotalMod, std::max(mod, float((*i)->GetAmount()))); + } + break; + } + } + + // From caster spells + AuraEffectList const& mOwnerTaken = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_FROM_CASTER); + for (AuraEffectList::const_iterator i = mOwnerTaken.begin(); i != mOwnerTaken.end(); ++i) + if ((*i)->GetCasterGUID() == caster->GetGUID() && (*i)->IsAffectedOnSpell(spellProto)) + AddPctN(TakenTotalMod, (*i)->GetAmount()); + + // Mod damage from spell mechanic + if (uint32 mechanicMask = spellProto->GetAllEffectsMechanicMask()) + { + AuraEffectList const& mDamageDoneMechanic = GetAuraEffectsByType(SPELL_AURA_MOD_MECHANIC_DAMAGE_TAKEN_PERCENT); + for (AuraEffectList::const_iterator i = mDamageDoneMechanic.begin(); i != mDamageDoneMechanic.end(); ++i) + if (mechanicMask & uint32(1<<((*i)->GetMiscValue()))) + AddPctN(TakenTotalMod, (*i)->GetAmount()); + } + + int32 TakenAdvertisedBenefit = SpellBaseDamageBonusTaken(spellProto->GetSchoolMask()); + + // Check for table values + float coeff = 0; + SpellBonusEntry const* bonus = sSpellMgr->GetSpellBonusData(spellProto->Id); + if (bonus) + coeff = (damagetype == DOT) ? bonus->dot_damage : bonus->direct_damage; + + // Default calculation + if (TakenAdvertisedBenefit) + { + if (!bonus || coeff < 0) + coeff = CalculateDefaultCoefficient(spellProto, damagetype) * int32(stack); + + float factorMod = CalculateLevelPenalty(spellProto) * stack; + // level penalty still applied on Taken bonus - is it blizzlike? + if (Player* modOwner = GetSpellModOwner()) + { + coeff *= 100.0f; + modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_BONUS_MULTIPLIER, coeff); + coeff /= 100.0f; + } + TakenTotal+= int32(TakenAdvertisedBenefit * coeff * factorMod); + } + + float tmpDamage = (float(pdamage) + TakenTotal) * TakenTotalMod; return uint32(std::max(tmpDamage, 0.0f)); } -int32 Unit::SpellBaseDamageBonus(SpellSchoolMask schoolMask) +int32 Unit::SpellBaseDamageBonusDone(SpellSchoolMask schoolMask) { int32 DoneAdvertisedBenefit = 0; - // ..done AuraEffectList const& mDamageDone = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_DONE); for (AuraEffectList::const_iterator i = mDamageDone.begin(); i != mDamageDone.end(); ++i) if (((*i)->GetMiscValue() & schoolMask) != 0 && @@ -10776,27 +10906,19 @@ int32 Unit::SpellBaseDamageBonus(SpellSchoolMask schoolMask) DoneAdvertisedBenefit += int32(CalculatePctN(GetTotalAttackPowerValue(BASE_ATTACK), (*i)->GetAmount())); } - return DoneAdvertisedBenefit > 0 ? DoneAdvertisedBenefit : 0; + return DoneAdvertisedBenefit; } -int32 Unit::SpellBaseDamageBonusForVictim(SpellSchoolMask schoolMask, Unit* victim) +int32 Unit::SpellBaseDamageBonusTaken(SpellSchoolMask schoolMask) { - uint32 creatureTypeMask = victim->GetCreatureTypeMask(); - int32 TakenAdvertisedBenefit = 0; - // ..done (for creature type by mask) in taken - AuraEffectList const& mDamageDoneCreature = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_DONE_CREATURE); - for (AuraEffectList::const_iterator i = mDamageDoneCreature.begin(); i != mDamageDoneCreature.end(); ++i) - if (creatureTypeMask & uint32((*i)->GetMiscValue())) - TakenAdvertisedBenefit += (*i)->GetAmount(); - // ..taken - AuraEffectList const& mDamageTaken = victim->GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_TAKEN); + AuraEffectList const& mDamageTaken = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_TAKEN); for (AuraEffectList::const_iterator i = mDamageTaken.begin(); i != mDamageTaken.end(); ++i) if (((*i)->GetMiscValue() & schoolMask) != 0) TakenAdvertisedBenefit += (*i)->GetAmount(); - return TakenAdvertisedBenefit > 0 ? TakenAdvertisedBenefit : 0; + return TakenAdvertisedBenefit; } bool Unit::isSpellCrit(Unit* victim, SpellInfo const* spellProto, SpellSchoolMask schoolMask, WeaponAttackType attackType) const @@ -11065,23 +11187,19 @@ uint32 Unit::SpellCriticalHealingBonus(SpellInfo const* spellProto, uint32 damag return damage; } -uint32 Unit::SpellHealingBonus(Unit* victim, SpellInfo const* spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack) +uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack) { // For totems get healing bonus from owner (statue isn't totem in fact) - if (GetTypeId() == TYPEID_UNIT && ToCreature()->isTotem()) + if (GetTypeId() == TYPEID_UNIT && isTotem()) if (Unit* owner = GetOwner()) - return owner->SpellHealingBonus(victim, spellProto, healamount, damagetype, stack); + return owner->SpellHealingBonusDone(victim, spellProto, healamount, damagetype, stack); - // no bonus for heal potions/bandages + // No bonus healing for potion spells if (spellProto->SpellFamilyName == SPELLFAMILY_POTION) return healamount; - // Healing Done - // Taken/Done total percent damage auras - float DoneTotalMod = 1.0f; - float TakenTotalMod = 1.0f; - int32 DoneTotal = 0; - int32 TakenTotal = 0; + float DoneTotalMod = 1.0f; + int32 DoneTotal = 0; // Healing done percent AuraEffectList const& mHealingDonePct = GetAuraEffectsByType(SPELL_AURA_MOD_HEALING_DONE_PERCENT); @@ -11144,28 +11262,11 @@ uint32 Unit::SpellHealingBonus(Unit* victim, SpellInfo const* spellProto, uint32 } } - // Taken/Done fixed damage bonus auras - int32 DoneAdvertisedBenefit = SpellBaseHealingBonus(spellProto->GetSchoolMask()); - int32 TakenAdvertisedBenefit = SpellBaseHealingBonusForVictim(spellProto->GetSchoolMask(), victim); - - bool scripted = false; - - for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) - { - switch (spellProto->Effects[i].ApplyAuraName) - { - // These auras do not use healing coeff - case SPELL_AURA_PERIODIC_LEECH: - case SPELL_AURA_PERIODIC_HEALTH_FUNNEL: - scripted = true; - break; - } - if (spellProto->Effects[i].Effect == SPELL_EFFECT_HEALTH_LEECH) - scripted = true; - } + // Done fixed damage bonus auras + int32 DoneAdvertisedBenefit = SpellBaseHealingBonusDone(spellProto->GetSchoolMask()); // Check for table values - SpellBonusEntry const* bonus = !scripted ? sSpellMgr->GetSpellBonusData(spellProto->Id) : NULL; + SpellBonusEntry const* bonus = sSpellMgr->GetSpellBonusData(spellProto->Id); float coeff = 0; float factorMod = 1.0f; if (bonus) @@ -11175,159 +11276,184 @@ uint32 Unit::SpellHealingBonus(Unit* victim, SpellInfo const* spellProto, uint32 coeff = bonus->dot_damage; if (bonus->ap_dot_bonus > 0) DoneTotal += int32(bonus->ap_dot_bonus * stack * GetTotalAttackPowerValue( - (spellProto->IsRangedWeaponSpell() && spellProto->DmgClass !=SPELL_DAMAGE_CLASS_MELEE)? RANGED_ATTACK : BASE_ATTACK)); + (spellProto->IsRangedWeaponSpell() && spellProto->DmgClass !=SPELL_DAMAGE_CLASS_MELEE) ? RANGED_ATTACK : BASE_ATTACK)); } else { coeff = bonus->direct_damage; if (bonus->ap_bonus > 0) DoneTotal += int32(bonus->ap_bonus * stack * GetTotalAttackPowerValue( - (spellProto->IsRangedWeaponSpell() && spellProto->DmgClass !=SPELL_DAMAGE_CLASS_MELEE)? RANGED_ATTACK : BASE_ATTACK)); + (spellProto->IsRangedWeaponSpell() && spellProto->DmgClass !=SPELL_DAMAGE_CLASS_MELEE) ? RANGED_ATTACK : BASE_ATTACK)); } } - else // scripted bonus + else { - // Gift of the Naaru - if (spellProto->SpellFamilyFlags[2] & 0x80000000 && spellProto->SpellIconID == 329) - { - scripted = true; - int32 apBonus = int32(std::max(GetTotalAttackPowerValue(BASE_ATTACK), GetTotalAttackPowerValue(RANGED_ATTACK))); - if (apBonus > DoneAdvertisedBenefit) - DoneTotal += int32(apBonus * 0.22f); // 22% of AP per tick - else - DoneTotal += int32(DoneAdvertisedBenefit * 0.377f); // 37.7% of BH per tick - } - // Earthliving - 0.45% of normal hot coeff - else if (spellProto->SpellFamilyName == SPELLFAMILY_SHAMAN && spellProto->SpellFamilyFlags[1] & 0x80000) - factorMod *= 0.45f; - // Already set to scripted? so not uses healing bonus coefficient - // No heal coeff for SPELL_DAMAGE_CLASS_NONE class spells by default - else if (scripted || spellProto->DmgClass == SPELL_DAMAGE_CLASS_NONE) - { - scripted = true; - coeff = 0.0f; - } + // No bonus healing for SPELL_DAMAGE_CLASS_NONE class spells by default + if (spellProto->DmgClass == SPELL_DAMAGE_CLASS_NONE) + return healamount; } // Default calculation - if (DoneAdvertisedBenefit || TakenAdvertisedBenefit) + if (DoneAdvertisedBenefit) { - if ((!bonus && !scripted) || coeff < 0) - { - // Damage Done from spell damage bonus - int32 CastingTime = !spellProto->IsChanneled() ? spellProto->CalcCastTime() : spellProto->GetDuration(); - // Damage over Time spells bonus calculation - float DotFactor = 1.0f; - if (damagetype == DOT) - { - int32 DotDuration = spellProto->GetDuration(); - // 200% limit - if (DotDuration > 0) - { - if (DotDuration > 30000) DotDuration = 30000; - if (!spellProto->IsChanneled()) DotFactor = DotDuration / 15000.0f; - uint32 x = 0; - for (uint8 j = 0; j < MAX_SPELL_EFFECTS; j++) - { - if (spellProto->Effects[j].Effect == SPELL_EFFECT_APPLY_AURA && ( - spellProto->Effects[j].ApplyAuraName == SPELL_AURA_PERIODIC_DAMAGE || - spellProto->Effects[j].ApplyAuraName == SPELL_AURA_PERIODIC_LEECH)) - { - x = j; - break; - } - } - int32 DotTicks = 6; - if (spellProto->Effects[x].Amplitude != 0) - DotTicks = DotDuration / spellProto->Effects[x].Amplitude; - if (DotTicks) - { - DoneAdvertisedBenefit = DoneAdvertisedBenefit * int32(stack) / DotTicks; - TakenAdvertisedBenefit = TakenAdvertisedBenefit * int32(stack) / DotTicks; - } - } - } - // Distribute Damage over multiple effects, reduce by AoE - CastingTime = GetCastingTimeForBonus(spellProto, damagetype, CastingTime); - // 50% for damage and healing spells for leech spells from damage bonus and 0% from healing - for (uint8 j = 0; j < MAX_SPELL_EFFECTS; ++j) - { - if (spellProto->Effects[j].Effect == SPELL_EFFECT_HEALTH_LEECH || - (spellProto->Effects[j].Effect == SPELL_EFFECT_APPLY_AURA && spellProto->Effects[j].ApplyAuraName == SPELL_AURA_PERIODIC_LEECH)) - { - CastingTime /= 2; - break; - } - } - // As wowwiki says: C = (Cast Time / 3.5) * 1.88 (for healing spells) - coeff = (CastingTime / 3500.0f) * DotFactor * 1.88f; - } + if (!bonus || coeff < 0) + coeff = CalculateDefaultCoefficient(spellProto, damagetype) * int32(stack) * 1.88f; // As wowwiki says: C = (Cast Time / 3.5) * 1.88 (for healing spells) factorMod *= CalculateLevelPenalty(spellProto) * stack; - // level penalty still applied on Taken bonus - is it blizzlike? - TakenTotal += int32(TakenAdvertisedBenefit * factorMod); + if (Player* modOwner = GetSpellModOwner()) { coeff *= 100.0f; modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_BONUS_MULTIPLIER, coeff); coeff /= 100.0f; } + + // Earthliving - 0.45% of normal hot coeff + if (spellProto->SpellFamilyName == SPELLFAMILY_SHAMAN && spellProto->SpellFamilyFlags[1] & 0x80000) + factorMod *= 0.45f; + DoneTotal += int32(DoneAdvertisedBenefit * coeff * factorMod); } + // Gift of the Naaru + if (spellProto->SpellFamilyFlags[2] & 0x80000000 && spellProto->SpellIconID == 329) + { + int32 apBonus = int32(std::max(GetTotalAttackPowerValue(BASE_ATTACK), GetTotalAttackPowerValue(RANGED_ATTACK))); + if (apBonus > DoneAdvertisedBenefit) + DoneTotal += int32(apBonus * 0.22f); // 22% of AP per tick + else + DoneTotal += int32(DoneAdvertisedBenefit * 0.377f); // 37.7% of BH per tick + } + + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) + { + switch (spellProto->Effects[i].ApplyAuraName) + { + // Bonus healing does not apply to these spells + case SPELL_AURA_PERIODIC_LEECH: + case SPELL_AURA_PERIODIC_HEALTH_FUNNEL: + DoneTotal = 0; + break; + } + if (spellProto->Effects[i].Effect == SPELL_EFFECT_HEALTH_LEECH) + DoneTotal = 0; + } + // use float as more appropriate for negative values and percent applying - float heal = (int32(healamount) + DoneTotal) * DoneTotalMod; + float heal = float(int32(healamount) + DoneTotal) * DoneTotalMod; // apply spellmod to Done amount if (Player* modOwner = GetSpellModOwner()) modOwner->ApplySpellMod(spellProto->Id, damagetype == DOT ? SPELLMOD_DOT : SPELLMOD_DAMAGE, heal); - // Nourish cast - if (spellProto->SpellFamilyName == SPELLFAMILY_DRUID && spellProto->SpellFamilyFlags[1] & 0x2000000) - { - // Rejuvenation, Regrowth, Lifebloom, or Wild Growth - if (victim->GetAuraEffect(SPELL_AURA_PERIODIC_HEAL, SPELLFAMILY_DRUID, 0x50, 0x4000010, 0)) - // increase healing by 20% - TakenTotalMod *= 1.2f; - } - - // Taken mods + return uint32(std::max(heal, 0.0f)); +} - // Tenacity increase healing % taken - if (AuraEffect const* Tenacity = victim->GetAuraEffect(58549, 0)) - AddPctN(TakenTotalMod, Tenacity->GetAmount()); +uint32 Unit::SpellHealingBonusTaken(Unit* caster, SpellInfo const* spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack) +{ + float TakenTotalMod = 1.0f; // Healing taken percent - float minval = (float)victim->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HEALING_PCT); + float minval = float(GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HEALING_PCT)); if (minval) AddPctF(TakenTotalMod, minval); - float maxval = (float)victim->GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HEALING_PCT); + float maxval = float(GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HEALING_PCT)); if (maxval) AddPctF(TakenTotalMod, maxval); + // Tenacity increase healing % taken + if (AuraEffect const* Tenacity = GetAuraEffect(58549, 0)) + AddPctN(TakenTotalMod, Tenacity->GetAmount()); + + // Healing Done + int32 TakenTotal = 0; + + // Taken fixed damage bonus auras + int32 TakenAdvertisedBenefit = SpellBaseHealingBonusTaken(spellProto->GetSchoolMask()); + + // Nourish cast + if (spellProto->SpellFamilyName == SPELLFAMILY_DRUID && spellProto->SpellFamilyFlags[1] & 0x2000000) + { + // Rejuvenation, Regrowth, Lifebloom, or Wild Growth + if (GetAuraEffect(SPELL_AURA_PERIODIC_HEAL, SPELLFAMILY_DRUID, 0x50, 0x4000010, 0)) + // increase healing by 20% + TakenTotalMod *= 1.2f; + } + if (damagetype == DOT) { // Healing over time taken percent - float minval_hot = (float)victim->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HOT_PCT); + float minval_hot = float(GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HOT_PCT)); if (minval_hot) AddPctF(TakenTotalMod, minval_hot); - float maxval_hot = (float)victim->GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HOT_PCT); + float maxval_hot = float(GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HOT_PCT)); if (maxval_hot) AddPctF(TakenTotalMod, maxval_hot); } - AuraEffectList const& mHealingGet= victim->GetAuraEffectsByType(SPELL_AURA_MOD_HEALING_RECEIVED); + // Check for table values + SpellBonusEntry const* bonus = sSpellMgr->GetSpellBonusData(spellProto->Id); + float coeff = 0; + float factorMod = 1.0f; + if (bonus) + coeff = (damagetype == DOT) ? bonus->dot_damage : bonus->direct_damage; + else + { + // No bonus healing for SPELL_DAMAGE_CLASS_NONE class spells by default + if (spellProto->DmgClass == SPELL_DAMAGE_CLASS_NONE) + { + healamount = uint32(std::max((float(healamount) * TakenTotalMod), 0.0f)); + return healamount; + } + } + + // Default calculation + if (TakenAdvertisedBenefit) + { + if (!bonus || coeff < 0) + coeff = CalculateDefaultCoefficient(spellProto, damagetype) * int32(stack) * 1.88f; // As wowwiki says: C = (Cast Time / 3.5) * 1.88 (for healing spells) + + factorMod *= CalculateLevelPenalty(spellProto) * int32(stack); + if (Player* modOwner = GetSpellModOwner()) + { + coeff *= 100.0f; + modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_BONUS_MULTIPLIER, coeff); + coeff /= 100.0f; + } + + // Earthliving - 0.45% of normal hot coeff + if (spellProto->SpellFamilyName == SPELLFAMILY_SHAMAN && spellProto->SpellFamilyFlags[1] & 0x80000) + factorMod *= 0.45f; + + TakenTotal += int32(TakenAdvertisedBenefit * coeff * factorMod); + } + + AuraEffectList const& mHealingGet= GetAuraEffectsByType(SPELL_AURA_MOD_HEALING_RECEIVED); for (AuraEffectList::const_iterator i = mHealingGet.begin(); i != mHealingGet.end(); ++i) - if (GetGUID() == (*i)->GetCasterGUID() && (*i)->IsAffectingSpell(spellProto)) + if (caster->GetGUID() == (*i)->GetCasterGUID() && (*i)->IsAffectedOnSpell(spellProto)) AddPctN(TakenTotalMod, (*i)->GetAmount()); - heal = (int32(heal) + TakenTotal) * TakenTotalMod; + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) + { + switch (spellProto->Effects[i].ApplyAuraName) + { + // Bonus healing does not apply to these spells + case SPELL_AURA_PERIODIC_LEECH: + case SPELL_AURA_PERIODIC_HEALTH_FUNNEL: + TakenTotal = 0; + break; + } + if (spellProto->Effects[i].Effect == SPELL_EFFECT_HEALTH_LEECH) + TakenTotal = 0; + } + + float heal = float(int32(healamount) + TakenTotal) * TakenTotalMod; return uint32(std::max(heal, 0.0f)); } -int32 Unit::SpellBaseHealingBonus(SpellSchoolMask schoolMask) +int32 Unit::SpellBaseHealingBonusDone(SpellSchoolMask schoolMask) { int32 AdvertisedBenefit = 0; @@ -11360,13 +11486,15 @@ int32 Unit::SpellBaseHealingBonus(SpellSchoolMask schoolMask) return AdvertisedBenefit; } -int32 Unit::SpellBaseHealingBonusForVictim(SpellSchoolMask schoolMask, Unit* victim) +int32 Unit::SpellBaseHealingBonusTaken(SpellSchoolMask schoolMask) { int32 AdvertisedBenefit = 0; - AuraEffectList const& mDamageTaken = victim->GetAuraEffectsByType(SPELL_AURA_MOD_HEALING); + + AuraEffectList const& mDamageTaken = GetAuraEffectsByType(SPELL_AURA_MOD_HEALING); for (AuraEffectList::const_iterator i = mDamageTaken.begin(); i != mDamageTaken.end(); ++i) if (((*i)->GetMiscValue() & schoolMask) != 0) AdvertisedBenefit += (*i)->GetAmount(); + return AdvertisedBenefit; } @@ -11393,7 +11521,7 @@ bool Unit::IsImmunedToDamage(SpellInfo const* spellInfo) return false; uint32 shoolMask = spellInfo->GetSchoolMask(); - if (spellInfo->Id != 42292 && spellInfo->Id !=59752) + if (spellInfo->Id != 42292 && spellInfo->Id != 59752) { // If m_immuneToSchool type contain this school type, IMMUNE damage. SpellImmuneList const& schoolList = m_spellImmune[IMMUNITY_SCHOOL]; @@ -11434,7 +11562,7 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo) } // Spells that don't have effectMechanics. - if (!spellInfo->HasAnyEffectMechanic() && spellInfo->Mechanic) + if (spellInfo->Mechanic) { SpellImmuneList const& mechanicList = m_spellImmune[IMMUNITY_MECHANIC]; for (SpellImmuneList::const_iterator itr = mechanicList.begin(); itr != mechanicList.end(); ++itr) @@ -11447,16 +11575,17 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo) { // State/effect immunities applied by aura expect full spell immunity // Ignore effects with mechanic, they are supposed to be checked separately - if (spellInfo->Effects[i].Mechanic || !IsImmunedToSpellEffect(spellInfo, i)) + if (!IsImmunedToSpellEffect(spellInfo, i)) { immuneToAllEffects = false; break; } } + if (immuneToAllEffects) //Return immune only if the target is immune to all spell effects. return true; - if (spellInfo->Id != 42292 && spellInfo->Id !=59752) + if (spellInfo->Id != 42292 && spellInfo->Id != 59752) { SpellImmuneList const& schoolList = m_spellImmune[IMMUNITY_SCHOOL]; for (SpellImmuneList::const_iterator itr = schoolList.begin(); itr != schoolList.end(); ++itr) @@ -11474,8 +11603,9 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo) bool Unit::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) const { - if (!spellInfo) + if (!spellInfo || !spellInfo->Effects[index].IsEffect()) return false; + // If m_immuneToEffect type contain this effect type, IMMUNE effect. uint32 effect = spellInfo->Effects[index].Effect; SpellImmuneList const& effectList = m_spellImmune[IMMUNITY_EFFECT]; @@ -11509,21 +11639,17 @@ bool Unit::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) cons return false; } -void Unit::MeleeDamageBonus(Unit* victim, uint32 *pdamage, WeaponAttackType attType, SpellInfo const* spellProto) +uint32 Unit::MeleeDamageBonusDone(Unit* victim, uint32 pdamage, WeaponAttackType attType, SpellInfo const* spellProto) { - if (!victim) - return; - - if (*pdamage == 0) - return; + if (!victim || pdamage == 0) + return 0; uint32 creatureTypeMask = victim->GetCreatureTypeMask(); - // Taken/Done fixed damage bonus auras + // Done fixed damage bonus auras int32 DoneFlatBenefit = 0; - int32 TakenFlatBenefit = 0; - // ..done (for creature type by mask) in taken + // ..done AuraEffectList const& mDamageDoneCreature = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_DONE_CREATURE); for (AuraEffectList::const_iterator i = mDamageDoneCreature.begin(); i != mDamageDoneCreature.end(); ++i) if (creatureTypeMask & uint32((*i)->GetMiscValue())) @@ -11569,54 +11695,27 @@ void Unit::MeleeDamageBonus(Unit* victim, uint32 *pdamage, WeaponAttackType attT DoneFlatBenefit += int32(APbonus/14.0f * GetAPMultiplier(attType, normalized)); } - // ..taken - AuraEffectList const& mDamageTaken = victim->GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_TAKEN); - for (AuraEffectList::const_iterator i = mDamageTaken.begin(); i != mDamageTaken.end(); ++i) - if ((*i)->GetMiscValue() & GetMeleeDamageSchoolMask()) - TakenFlatBenefit += (*i)->GetAmount(); - - if (attType != RANGED_ATTACK) - TakenFlatBenefit += victim->GetTotalAuraModifier(SPELL_AURA_MOD_MELEE_DAMAGE_TAKEN); - else - TakenFlatBenefit += victim->GetTotalAuraModifier(SPELL_AURA_MOD_RANGED_DAMAGE_TAKEN); - - // Done/Taken total percent damage auras + // Done total percent damage auras float DoneTotalMod = 1.0f; - float TakenTotalMod = 1.0f; - // ..done - // SPELL_AURA_MOD_AUTOATTACK_DAMAGE - if (!spellProto) - { - AuraEffectList const & autoattackDamage = GetAuraEffectsByType(SPELL_AURA_MOD_AUTOATTACK_DAMAGE); - for (AuraEffectList::const_iterator i = autoattackDamage.begin(); i != autoattackDamage.end(); ++i) - { - int32 amount = (*i)->GetAmount(); - if ((*i)->GetSpellInfo()->EquippedItemClass == -1) - AddPctN(DoneTotalMod, amount); - else if (!((*i)->GetSpellInfo()->AttributesEx5 & SPELL_ATTR5_SPECIAL_ITEM_CLASS_CHECK) && ((*i)->GetSpellInfo()->EquippedItemSubClassMask == 0)) - AddPctN(DoneTotalMod, amount); - else if (ToPlayer() && ToPlayer()->HasItemFitToSpellRequirements((*i)->GetSpellInfo())) - AddPctN(DoneTotalMod, amount); - } - } - - AuraEffectList const& mModDamagePercentDone = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE); - for (AuraEffectList::const_iterator i = mModDamagePercentDone.begin(); i != mModDamagePercentDone.end(); ++i) - { - if (spellProto) + // Some spells don't benefit from pct done mods + if (spellProto) + if (!(spellProto->AttributesEx6 & SPELL_ATTR6_NO_DONE_PCT_DAMAGE_MODS) && !spellProto->IsRankOf(sSpellMgr->GetSpellInfo(12162))) { - if ((*i)->GetMiscValue() & spellProto->GetSchoolMask() && !(spellProto->GetSchoolMask() & SPELL_SCHOOL_MASK_NORMAL)) + AuraEffectList const& mModDamagePercentDone = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE); + for (AuraEffectList::const_iterator i = mModDamagePercentDone.begin(); i != mModDamagePercentDone.end(); ++i) { - if ((*i)->GetSpellInfo()->EquippedItemClass == -1) - AddPctN(DoneTotalMod, (*i)->GetAmount()); - else if (!((*i)->GetSpellInfo()->AttributesEx5 & SPELL_ATTR5_SPECIAL_ITEM_CLASS_CHECK) && ((*i)->GetSpellInfo()->EquippedItemSubClassMask == 0)) - AddPctN(DoneTotalMod, (*i)->GetAmount()); - else if (ToPlayer() && ToPlayer()->HasItemFitToSpellRequirements((*i)->GetSpellInfo())) - AddPctN(DoneTotalMod, (*i)->GetAmount()); + if ((*i)->GetMiscValue() & spellProto->GetSchoolMask() && !(spellProto->GetSchoolMask() & SPELL_SCHOOL_MASK_NORMAL)) + { + if ((*i)->GetSpellInfo()->EquippedItemClass == -1) + AddPctN(DoneTotalMod, (*i)->GetAmount()); + else if (!((*i)->GetSpellInfo()->AttributesEx5 & SPELL_ATTR5_SPECIAL_ITEM_CLASS_CHECK) && ((*i)->GetSpellInfo()->EquippedItemSubClassMask == 0)) + AddPctN(DoneTotalMod, (*i)->GetAmount()); + else if (ToPlayer() && ToPlayer()->HasItemFitToSpellRequirements((*i)->GetSpellInfo())) + AddPctN(DoneTotalMod, (*i)->GetAmount()); + } } } - } AuraEffectList const& mDamageDoneVersus = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_DONE_VERSUS); for (AuraEffectList::const_iterator i = mDamageDoneVersus.begin(); i != mDamageDoneVersus.end(); ++i) @@ -11704,18 +11803,50 @@ void Unit::MeleeDamageBonus(Unit* victim, uint32 *pdamage, WeaponAttackType attT break; } + float tmpDamage = float(int32(pdamage) + DoneFlatBenefit) * DoneTotalMod; + + // apply spellmod to Done damage + if (spellProto) + if (Player* modOwner = GetSpellModOwner()) + modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_DAMAGE, tmpDamage); + + // bonus result can be negative + return uint32(std::max(tmpDamage, 0.0f)); +} + +uint32 Unit::MeleeDamageBonusTaken(Unit* attacker, uint32 pdamage, WeaponAttackType attType, SpellInfo const* spellProto) +{ + if (pdamage == 0) + return 0; + + int32 TakenFlatBenefit = 0; + // ..taken - TakenTotalMod *= victim->GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, GetMeleeDamageSchoolMask()); + AuraEffectList const& mDamageTaken = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_TAKEN); + for (AuraEffectList::const_iterator i = mDamageTaken.begin(); i != mDamageTaken.end(); ++i) + if ((*i)->GetMiscValue() & GetMeleeDamageSchoolMask()) + TakenFlatBenefit += (*i)->GetAmount(); - // From caster spells - AuraEffectList const& mOwnerTaken = victim->GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_FROM_CASTER); - for (AuraEffectList::const_iterator i = mOwnerTaken.begin(); i != mOwnerTaken.end(); ++i) - if ((*i)->GetCasterGUID() == GetGUID() && (*i)->IsAffectingSpell(spellProto)) - AddPctN(TakenTotalMod, (*i)->GetAmount()); + if (attType != RANGED_ATTACK) + TakenFlatBenefit += GetTotalAuraModifier(SPELL_AURA_MOD_MELEE_DAMAGE_TAKEN); + else + TakenFlatBenefit += GetTotalAuraModifier(SPELL_AURA_MOD_RANGED_DAMAGE_TAKEN); + + // Taken total percent damage auras + float TakenTotalMod = 1.0f; + + // ..taken + TakenTotalMod *= GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, GetMeleeDamageSchoolMask()); // .. taken pct (special attacks) if (spellProto) { + // From caster spells + AuraEffectList const& mOwnerTaken = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_FROM_CASTER); + for (AuraEffectList::const_iterator i = mOwnerTaken.begin(); i != mOwnerTaken.end(); ++i) + if ((*i)->GetCasterGUID() == attacker->GetGUID() && (*i)->IsAffectedOnSpell(spellProto)) + AddPctN(TakenTotalMod, (*i)->GetAmount()); + // Mod damage from spell mechanic uint32 mechanicMask = spellProto->GetAllEffectsMechanicMask(); @@ -11725,7 +11856,7 @@ void Unit::MeleeDamageBonus(Unit* victim, uint32 *pdamage, WeaponAttackType attT if (mechanicMask) { - AuraEffectList const& mDamageDoneMechanic = victim->GetAuraEffectsByType(SPELL_AURA_MOD_MECHANIC_DAMAGE_TAKEN_PERCENT); + AuraEffectList const& mDamageDoneMechanic = GetAuraEffectsByType(SPELL_AURA_MOD_MECHANIC_DAMAGE_TAKEN_PERCENT); for (AuraEffectList::const_iterator i = mDamageDoneMechanic.begin(); i != mDamageDoneMechanic.end(); ++i) if (mechanicMask & uint32(1<<((*i)->GetMiscValue()))) AddPctN(TakenTotalMod, (*i)->GetAmount()); @@ -11733,7 +11864,7 @@ void Unit::MeleeDamageBonus(Unit* victim, uint32 *pdamage, WeaponAttackType attT } // .. taken pct: dummy auras - AuraEffectList const& mDummyAuras = victim->GetAuraEffectsByType(SPELL_AURA_DUMMY); + AuraEffectList const& mDummyAuras = GetAuraEffectsByType(SPELL_AURA_DUMMY); for (AuraEffectList::const_iterator i = mDummyAuras.begin(); i != mDummyAuras.end(); ++i) { switch ((*i)->GetSpellInfo()->SpellIconID) @@ -11742,9 +11873,9 @@ void Unit::MeleeDamageBonus(Unit* victim, uint32 *pdamage, WeaponAttackType attT case 2109: if ((*i)->GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL) { - if (victim->GetTypeId() != TYPEID_PLAYER) + if (GetTypeId() != TYPEID_PLAYER) continue; - float mod = victim->ToPlayer()->GetRatingBonusValue(CR_CRIT_TAKEN_MELEE) * (-8.0f); + float mod = ToPlayer()->GetRatingBonusValue(CR_CRIT_TAKEN_MELEE) * (-8.0f); AddPctF(TakenTotalMod, std::max(mod, float((*i)->GetAmount()))); } break; @@ -11752,38 +11883,31 @@ void Unit::MeleeDamageBonus(Unit* victim, uint32 *pdamage, WeaponAttackType attT } // .. taken pct: class scripts - /*AuraEffectList const& mclassScritAuras = GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS); - for (AuraEffectList::const_iterator i = mclassScritAuras.begin(); i != mclassScritAuras.end(); ++i) - { - switch ((*i)->GetMiscValue()) - { - } - }*/ + //*AuraEffectList const& mclassScritAuras = GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS); + //for (AuraEffectList::const_iterator i = mclassScritAuras.begin(); i != mclassScritAuras.end(); ++i) + //{ + // switch ((*i)->GetMiscValue()) + // { + // } + //}*/ if (attType != RANGED_ATTACK) { - AuraEffectList const& mModMeleeDamageTakenPercent = victim->GetAuraEffectsByType(SPELL_AURA_MOD_MELEE_DAMAGE_TAKEN_PCT); + AuraEffectList const& mModMeleeDamageTakenPercent = GetAuraEffectsByType(SPELL_AURA_MOD_MELEE_DAMAGE_TAKEN_PCT); for (AuraEffectList::const_iterator i = mModMeleeDamageTakenPercent.begin(); i != mModMeleeDamageTakenPercent.end(); ++i) AddPctN(TakenTotalMod, (*i)->GetAmount()); } else { - AuraEffectList const& mModRangedDamageTakenPercent = victim->GetAuraEffectsByType(SPELL_AURA_MOD_RANGED_DAMAGE_TAKEN_PCT); + AuraEffectList const& mModRangedDamageTakenPercent = GetAuraEffectsByType(SPELL_AURA_MOD_RANGED_DAMAGE_TAKEN_PCT); for (AuraEffectList::const_iterator i = mModRangedDamageTakenPercent.begin(); i != mModRangedDamageTakenPercent.end(); ++i) AddPctN(TakenTotalMod, (*i)->GetAmount()); } - float tmpDamage = float(int32(*pdamage) + DoneFlatBenefit) * DoneTotalMod; - - // apply spellmod to Done damage - if (spellProto) - if (Player* modOwner = GetSpellModOwner()) - modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_DAMAGE, tmpDamage); - - tmpDamage = (tmpDamage + TakenFlatBenefit) * TakenTotalMod; + float tmpDamage = (float(pdamage) + TakenFlatBenefit) * TakenTotalMod; // bonus result can be negative - *pdamage = uint32(std::max(tmpDamage, 0.0f)); + return uint32(std::max(tmpDamage, 0.0f)); } void Unit::ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply) @@ -11855,7 +11979,9 @@ float Unit::GetWeaponProcChance() const float Unit::GetPPMProcChance(uint32 WeaponSpeed, float PPM, const SpellInfo* spellProto) const { // proc per minute chance calculation - if (PPM <= 0) return 0.0f; + if (PPM <= 0) + return 0.0f; + // Apply chance modifer aura if (spellProto) if (Player* modOwner = GetSpellModOwner()) @@ -12116,7 +12242,7 @@ void Unit::SetInCombatState(bool PvP, Unit* enemy) UpdateSpeed(MOVE_FLIGHT, true); } - if (!(creature->GetCreatureInfo()->type_flags & CREATURE_TYPEFLAGS_MOUNTED_COMBAT)) + if (!(creature->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_MOUNTED_COMBAT)) Dismount(); } @@ -12135,12 +12261,12 @@ void Unit::ClearInCombat() // Player's state will be cleared in Player::UpdateContestedPvP if (Creature* creature = ToCreature()) { - if (creature->GetCreatureInfo() && creature->GetCreatureInfo()->unit_flags & UNIT_FLAG_IMMUNE_TO_PC) + if (creature->GetCreatureTemplate() && creature->GetCreatureTemplate()->unit_flags & UNIT_FLAG_IMMUNE_TO_PC) SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); // set immunity state to the one from db on evade ClearUnitState(UNIT_STATE_ATTACK_PLAYER); if (HasFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_TAPPED)) - SetUInt32Value(UNIT_DYNAMIC_FLAGS, creature->GetCreatureInfo()->dynamicflags); + SetUInt32Value(UNIT_DYNAMIC_FLAGS, creature->GetCreatureTemplate()->dynamicflags); if (creature->isPet()) { @@ -12179,7 +12305,7 @@ bool Unit::IsValidAttackTarget(Unit const* target) const } // function based on function Unit::CanAttack from 13850 client -bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell) const +bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell, WorldObject const* obj) const { ASSERT(target); @@ -12197,8 +12323,8 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell) co if (IsOnVehicle(target) || m_vehicle->GetBase()->IsOnVehicle(target)) return false; - // can't attack invisible (ignore stealth for aoe spells) - if ((!bySpell || !(bySpell->AttributesEx6 & SPELL_ATTR6_CAN_TARGET_INVISIBLE)) && !canSeeOrDetect(target, bySpell && bySpell->IsAffectingArea())) + // can't attack invisible (ignore stealth for aoe spells) also if the area being looked at is from a spell use the dynamic object created instead of the casting unit. + if ((!bySpell || !(bySpell->AttributesEx6 & SPELL_ATTR6_CAN_TARGET_INVISIBLE)) && (obj ? !obj->canSeeOrDetect(target, bySpell && bySpell->IsAffectingArea()) : !canSeeOrDetect(target, bySpell && bySpell->IsAffectingArea()))) return false; // can't attack dead @@ -12255,7 +12381,7 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell) co } Creature const* creatureAttacker = ToCreature(); - if (creatureAttacker && creatureAttacker->GetCreatureInfo()->type_flags & CREATURE_TYPEFLAGS_UNK26) + if (creatureAttacker && creatureAttacker->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_PARTY_MEMBER) return false; Player const* playerAffectingAttacker = HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE) ? GetAffectingPlayer() : NULL; @@ -12342,7 +12468,7 @@ bool Unit::_IsValidAssistTarget(Unit const* target, SpellInfo const* bySpell) co // can't assist non-friendly targets if (GetReactionTo(target) <= REP_NEUTRAL && target->GetReactionTo(this) <= REP_NEUTRAL - && (!ToCreature() || !(ToCreature()->GetCreatureInfo()->type_flags & CREATURE_TYPEFLAGS_UNK26))) + && (!ToCreature() || !(ToCreature()->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_PARTY_MEMBER))) return false; // PvP case @@ -12376,7 +12502,7 @@ bool Unit::_IsValidAssistTarget(Unit const* target, SpellInfo const* bySpell) co && !((target->GetByteValue(UNIT_FIELD_BYTES_2, 1) & UNIT_BYTE2_FLAG_PVP))) { if (Creature const* creatureTarget = target->ToCreature()) - return creatureTarget->GetCreatureInfo()->type_flags & CREATURE_TYPEFLAGS_UNK26 || creatureTarget->GetCreatureInfo()->type_flags & CREATURE_TYPEFLAGS_AID_PLAYERS; + return creatureTarget->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_PARTY_MEMBER || creatureTarget->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_AID_PLAYERS; } return true; } @@ -12490,6 +12616,12 @@ bool Unit::IsAlwaysVisibleFor(WorldObject const* seer) const if (seer->GetGUID() == guid) return true; + if (Player const* seerPlayer = seer->ToPlayer()) + if (Unit* owner = GetOwner()) + if (Player* ownerPlayer = owner->ToPlayer()) + if (ownerPlayer->IsGroupVisibleFor(seerPlayer)) + return true; + return false; } @@ -12598,7 +12730,7 @@ void Unit::UpdateSpeed(UnitMoveType mtype, bool forced) { // Set creature speed rate from CreatureInfo if (GetTypeId() == TYPEID_UNIT) - speed *= ToCreature()->GetCreatureInfo()->speed_walk; + speed *= ToCreature()->GetCreatureTemplate()->speed_walk; // Normalize speed by 191 aura SPELL_AURA_USE_NORMAL_MOVEMENT_SPEED if need // TODO: possible affect only on MOVE_RUN @@ -13080,21 +13212,9 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) } } -void Unit::SetHover(bool on) -{ - if (on) - CastSpell(this, 11010, true); - else - RemoveAurasDueToSpell(11010); -} - void Unit::setDeathState(DeathState s) { - // death state needs to be updated before RemoveAllAurasOnDeath() calls HandleChannelDeathItem(..) so that - // it can be used to check creation of death items (such as soul shards). - m_deathState = s; - - if (s != ALIVE && s != JUST_ALIVED) + if (s != ALIVE && s != JUST_RESPAWNED) { CombatStop(); DeleteThreatList(); @@ -13116,9 +13236,18 @@ void Unit::setDeathState(DeathState s) // remove aurastates allowing special moves ClearAllReactives(); ClearDiminishings(); - GetMotionMaster()->Clear(false); - GetMotionMaster()->MoveIdle(); + if (IsInWorld()) + { + // Only clear MotionMaster for entities that exists in world + // Avoids crashes in the following conditions : + // * Using 'call pet' on dead pets + // * Using 'call stabled pet' + // * Logging in with dead pets + GetMotionMaster()->Clear(false); + GetMotionMaster()->MoveIdle(); + } StopMoving(); + DisableSpline(); // without this when removing IncreaseMaxHealth aura player may stuck with 1 hp // do not why since in IncreaseMaxHealth currenthealth is checked SetHealth(0); @@ -13128,8 +13257,10 @@ void Unit::setDeathState(DeathState s) if (ZoneScript* zoneScript = GetZoneScript() ? GetZoneScript() : (ZoneScript*)GetInstanceScript()) zoneScript->OnUnitDeath(this); } - else if (s == JUST_ALIVED) - RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); // clear skinnable for creature and player (at battleground) + else if (s == JUST_RESPAWNED) + RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); // clear skinnable for creature and player (at battleground) + + m_deathState = s; } /*######################################## @@ -13605,7 +13736,7 @@ float Unit::ApplyDiminishingToDuration(DiminishingGroup group, int32 &duration, Unit const* source = casterOwner ? casterOwner : caster; if ((target->GetTypeId() == TYPEID_PLAYER - || ((Creature*)target)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_ALL_DIMINISH) + || ((Creature*)target)->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_ALL_DIMINISH) && source->GetTypeId() == TYPEID_PLAYER) duration = limitduration; } @@ -13614,7 +13745,7 @@ float Unit::ApplyDiminishingToDuration(DiminishingGroup group, int32 &duration, if (group == DIMINISHING_TAUNT) { - if (GetTypeId() == TYPEID_UNIT && (ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_TAUNT_DIMINISH)) + if (GetTypeId() == TYPEID_UNIT && (ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_TAUNT_DIMINISH)) { DiminishingLevels diminish = Level; switch (diminish) @@ -13631,7 +13762,7 @@ float Unit::ApplyDiminishingToDuration(DiminishingGroup group, int32 &duration, // Some diminishings applies to mobs too (for example, Stun) else if ((GetDiminishingReturnsGroupType(group) == DRTYPE_PLAYER && ((targetOwner ? (targetOwner->GetTypeId() == TYPEID_PLAYER) : (GetTypeId() == TYPEID_PLAYER)) - || (GetTypeId() == TYPEID_UNIT && ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_ALL_DIMINISH))) + || (GetTypeId() == TYPEID_UNIT && ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_ALL_DIMINISH))) || GetDiminishingReturnsGroupType(group) == DRTYPE_ALL) { DiminishingLevels diminish = Level; @@ -13715,7 +13846,7 @@ uint32 Unit::GetCreatureType() const return CREATURE_TYPE_HUMANOID; } else - return ToCreature()->GetCreatureInfo()->type; + return ToCreature()->GetCreatureTemplate()->type; } /*####################################### @@ -14365,12 +14496,7 @@ void CharmInfo::InitCharmCreateSpells() newstate = ACT_PASSIVE; else { - bool autocast = false; - for (uint32 i = 0; i < MAX_SPELL_EFFECTS && !autocast; ++i) - if (spellInfo->Effects[i].TargetA.GetType() == TARGET_TYPE_UNIT_TARGET) - autocast = true; - - if (autocast) + if (spellInfo->NeedsExplicitUnitTarget()) { newstate = ACT_ENABLED; ToggleCreatureAutocast(spellInfo, true); @@ -14804,7 +14930,8 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: doing %u damage from spell id %u (triggered by %s aura of spell %u)", triggeredByAura->GetAmount(), spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); SpellNonMeleeDamage damageInfo(this, target, spellInfo->Id, spellInfo->SchoolMask); - uint32 newDamage = SpellDamageBonus(target, spellInfo, triggeredByAura->GetAmount(), SPELL_DIRECT_DAMAGE); + uint32 newDamage = SpellDamageBonusDone(target, spellInfo, triggeredByAura->GetAmount(), SPELL_DIRECT_DAMAGE); + newDamage = target->SpellDamageBonusTaken(this, spellInfo, newDamage, SPELL_DIRECT_DAMAGE); CalculateSpellDamageTaken(&damageInfo, newDamage, spellInfo); DealDamageMods(damageInfo.target, damageInfo.damage, &damageInfo.absorb); SendSpellNonMeleeDamageLog(&damageInfo); @@ -15046,9 +15173,9 @@ Player* Unit::GetSpellModOwner() const } ///----------Pet responses methods----------------- -void Unit::SendPetCastFail(uint32 spellid, SpellCastResult msg) +void Unit::SendPetCastFail(uint32 spellid, SpellCastResult result) { - if (msg == SPELL_CAST_OK) + if (result == SPELL_CAST_OK) return; Unit* owner = GetCharmerOrOwner(); @@ -15056,15 +15183,13 @@ void Unit::SendPetCastFail(uint32 spellid, SpellCastResult msg) return; WorldPacket data(SMSG_PET_CAST_FAILED, 1 + 4 + 1); - data << uint8(0); // cast count? + data << uint8(0); // cast count data << uint32(spellid); - data << uint8(msg); - // uint32 for some reason - // uint32 for some reason + data << uint8(result); owner->ToPlayer()->GetSession()->SendPacket(&data); } -void Unit::SendPetActionFeedback (uint8 msg) +void Unit::SendPetActionFeedback(uint8 msg) { Unit* owner = GetOwner(); if (!owner || owner->GetTypeId() != TYPEID_PLAYER) @@ -15075,7 +15200,7 @@ void Unit::SendPetActionFeedback (uint8 msg) owner->ToPlayer()->GetSession()->SendPacket(&data); } -void Unit::SendPetTalk (uint32 pettalk) +void Unit::SendPetTalk(uint32 pettalk) { Unit* owner = GetOwner(); if (!owner || owner->GetTypeId() != TYPEID_PLAYER) @@ -15306,7 +15431,7 @@ Unit* Unit::SelectNearbyTarget(Unit* exclude, float dist) const return NULL; // select random - return SelectRandomContainerElement(targets); + return Trinity::Containers::SelectRandomContainerElement(targets); } void Unit::ApplyAttackTimePercentMod(WeaponAttackType att, float val, bool apply) @@ -15333,7 +15458,7 @@ void Unit::ApplyCastTimePercentMod(float val, bool apply) ApplyPercentModFloatValue(UNIT_MOD_CAST_SPEED, -val, apply); } -uint32 Unit::GetCastingTimeForBonus(SpellInfo const* spellProto, DamageEffectType damagetype, uint32 CastingTime) +uint32 Unit::GetCastingTimeForBonus(SpellInfo const* spellProto, DamageEffectType damagetype, uint32 CastingTime) const { // Not apply this to creature casted spells with casttime == 0 if (CastingTime == 0 && GetTypeId() == TYPEID_UNIT && !ToCreature()->isPet()) @@ -15406,20 +15531,21 @@ uint32 Unit::GetCastingTimeForBonus(SpellInfo const* spellProto, DamageEffectTyp if (AreaEffect) CastingTime /= 2; - // -5% of total per any additional effect - for (uint8 i = 0; i < effects; ++i) + // 50% for damage and healing spells for leech spells from damage bonus and 0% from healing + for (uint8 j = 0; j < MAX_SPELL_EFFECTS; ++j) { - if (CastingTime > 175) - { - CastingTime -= 175; - } - else + if (spellProto->Effects[j].Effect == SPELL_EFFECT_HEALTH_LEECH || + (spellProto->Effects[j].Effect == SPELL_EFFECT_APPLY_AURA && spellProto->Effects[j].ApplyAuraName == SPELL_AURA_PERIODIC_LEECH)) { - CastingTime = 0; + CastingTime /= 2; break; } } + // -5% of total per any additional effect + for (uint8 i = 0; i < effects; ++i) + CastingTime *= 0.95f; + return CastingTime; } @@ -15450,6 +15576,29 @@ void Unit::UpdateAuraForGroup(uint8 slot) } } +float Unit::CalculateDefaultCoefficient(SpellInfo const *spellInfo, DamageEffectType damagetype) const +{ + // Damage over Time spells bonus calculation + float DotFactor = 1.0f; + if (damagetype == DOT) + { + + int32 DotDuration = spellInfo->GetDuration(); + if (!spellInfo->IsChanneled() && DotDuration > 0) + DotFactor = DotDuration / 15000.0f; + + if (uint32 DotTicks = spellInfo->GetMaxTicks()) + DotFactor /= DotTicks; + } + + int32 CastingTime = spellInfo->IsChanneled() ? spellInfo->GetDuration() : spellInfo->CalcCastTime(); + // Distribute Damage over multiple effects, reduce by AoE + CastingTime = GetCastingTimeForBonus(spellInfo, damagetype, CastingTime); + + // As wowwiki says: C = (Cast Time / 3.5) + return (CastingTime / 3500.0f) * DotFactor; +} + float Unit::GetAPMultiplier(WeaponAttackType attType, bool normalized) { if (!normalized || GetTypeId() != TYPEID_PLAYER) @@ -15860,10 +16009,10 @@ void Unit::Kill(Unit* victim, bool durabilityLoss) creature->lootForPickPocketed = false; loot->clear(); - if (uint32 lootid = creature->GetCreatureInfo()->lootid) + if (uint32 lootid = creature->GetCreatureTemplate()->lootid) loot->FillLoot(lootid, LootTemplates_Creature, looter, false, false, creature->GetLootMode()); - loot->generateMoneyLoot(creature->GetCreatureInfo()->mingold, creature->GetCreatureInfo()->maxgold); + loot->generateMoneyLoot(creature->GetCreatureTemplate()->mingold, creature->GetCreatureTemplate()->maxgold); } player->RewardPlayerAndGroupAtKill(victim, false); @@ -15921,7 +16070,7 @@ void Unit::Kill(Unit* victim, bool durabilityLoss) // Inform pets (if any) when player kills target) // MUST come after victim->setDeathState(JUST_DIED); or pet next target // selection will get stuck on same target and break pet react state - if (Player* player = ToPlayer()) + if (player) { Pet* pet = player->GetPet(); if (pet && pet->isAlive() && pet->isControlled()) @@ -15964,7 +16113,7 @@ void Unit::Kill(Unit* victim, bool durabilityLoss) if (!creature->isPet()) { creature->DeleteThreatList(); - CreatureTemplate const* cInfo = creature->GetCreatureInfo(); + CreatureTemplate const* cInfo = creature->GetCreatureTemplate(); if (cInfo && (cInfo->lootid || cInfo->maxgold > 0)) creature->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); } @@ -15993,7 +16142,7 @@ void Unit::Kill(Unit* victim, bool durabilityLoss) { if (instanceMap->IsRaidOrHeroicDungeon()) { - if (creature->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_INSTANCE_BIND) + if (creature->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_INSTANCE_BIND) ((InstanceMap*)instanceMap)->PermBindAllPlayers(creditedPlayer); } else @@ -16402,7 +16551,7 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au case CHARM_TYPE_CHARM: if (GetTypeId() == TYPEID_UNIT && charmer->getClass() == CLASS_WARLOCK) { - CreatureTemplate const* cinfo = ToCreature()->GetCreatureInfo(); + CreatureTemplate const* cinfo = ToCreature()->GetCreatureTemplate(); if (cinfo && cinfo->type == CREATURE_TYPE_DEMON) { // to prevent client crash @@ -16506,7 +16655,7 @@ void Unit::RemoveCharmedBy(Unit* charmer) case CHARM_TYPE_CHARM: if (GetTypeId() == TYPEID_UNIT && charmer->getClass() == CLASS_WARLOCK) { - CreatureTemplate const* cinfo = ToCreature()->GetCreatureInfo(); + CreatureTemplate const* cinfo = ToCreature()->GetCreatureTemplate(); if (cinfo && cinfo->type == CREATURE_TYPE_DEMON) { SetByteValue(UNIT_FIELD_BYTES_0, 1, uint8(cinfo->unit_class)); @@ -16545,7 +16694,7 @@ void Unit::RestoreFaction() } } - if (CreatureTemplate const* cinfo = ToCreature()->GetCreatureInfo()) // normal creature + if (CreatureTemplate const* cinfo = ToCreature()->GetCreatureTemplate()) // normal creature { FactionTemplateEntry const* faction = getFactionTemplateEntry(); setFaction((faction && faction->friendlyMask & 0x004) ? cinfo->faction_H : cinfo->faction_A); @@ -16616,7 +16765,10 @@ bool Unit::IsInPartyWith(Unit const* unit) const return true; if (u1->GetTypeId() == TYPEID_PLAYER && u2->GetTypeId() == TYPEID_PLAYER) - return u1->ToPlayer()->IsInSameGroupWith(u2->ToPlayer()); + return u1->ToPlayer()->IsInSameGroupWith(u2->ToPlayer()); + else if ((u2->GetTypeId() == TYPEID_PLAYER && u1->GetTypeId() == TYPEID_UNIT && u1->ToCreature()->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_PARTY_MEMBER) || + (u1->GetTypeId() == TYPEID_PLAYER && u2->GetTypeId() == TYPEID_UNIT && u2->ToCreature()->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_PARTY_MEMBER)) + return true; else return false; } @@ -16632,82 +16784,14 @@ bool Unit::IsInRaidWith(Unit const* unit) const return true; if (u1->GetTypeId() == TYPEID_PLAYER && u2->GetTypeId() == TYPEID_PLAYER) - return u1->ToPlayer()->IsInSameRaidWith(u2->ToPlayer()); + return u1->ToPlayer()->IsInSameRaidWith(u2->ToPlayer()); + else if ((u2->GetTypeId() == TYPEID_PLAYER && u1->GetTypeId() == TYPEID_UNIT && u1->ToCreature()->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_PARTY_MEMBER) || + (u1->GetTypeId() == TYPEID_PLAYER && u2->GetTypeId() == TYPEID_UNIT && u2->ToCreature()->GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_PARTY_MEMBER)) + return true; else return false; } -void Unit::GetRaidMember(std::list &nearMembers, float radius) -{ - Player* owner = GetCharmerOrOwnerPlayerOrPlayerItself(); - if (!owner) - return; - - Group* group = owner->GetGroup(); - if (group) - { - for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) - { - Player* Target = itr->getSource(); - - if (Target && !IsHostileTo(Target)) - { - if (Target->isAlive() && IsWithinDistInMap(Target, radius)) - nearMembers.push_back(Target); - - if (Guardian* pet = Target->GetGuardianPet()) - if (pet->isAlive() && IsWithinDistInMap(pet, radius)) - nearMembers.push_back(pet); - } - } - } - else - { - if (owner->isAlive() && (owner == this || IsWithinDistInMap(owner, radius))) - nearMembers.push_back(owner); - if (Guardian* pet = owner->GetGuardianPet()) - if (pet->isAlive() && (pet == this || IsWithinDistInMap(pet, radius))) - nearMembers.push_back(pet); - } -} - -void Unit::GetPartyMemberInDist(std::list &TagUnitMap, float radius) -{ - Unit* owner = GetCharmerOrOwnerOrSelf(); - Group* group = NULL; - if (owner->GetTypeId() == TYPEID_PLAYER) - group = owner->ToPlayer()->GetGroup(); - - if (group) - { - uint8 subgroup = owner->ToPlayer()->GetSubGroup(); - - for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) - { - Player* Target = itr->getSource(); - - // IsHostileTo check duel and controlled by enemy - if (Target && Target->GetSubGroup() == subgroup && !IsHostileTo(Target)) - { - if (Target->isAlive() && IsWithinDistInMap(Target, radius)) - TagUnitMap.push_back(Target); - - if (Guardian* pet = Target->GetGuardianPet()) - if (pet->isAlive() && IsWithinDistInMap(pet, radius)) - TagUnitMap.push_back(pet); - } - } - } - else - { - if (owner->isAlive() && (owner == this || IsWithinDistInMap(owner, radius))) - TagUnitMap.push_back(owner); - if (Guardian* pet = owner->GetGuardianPet()) - if (pet->isAlive() && (pet == this || IsWithinDistInMap(pet, radius))) - TagUnitMap.push_back(pet); - } -} - void Unit::GetPartyMembers(std::list &TagUnitMap) { Unit* owner = GetCharmerOrOwnerOrSelf(); @@ -16919,7 +17003,41 @@ void Unit::SetPhaseMask(uint32 newPhaseMask, bool update) return; if (IsInWorld()) - RemoveNotOwnSingleTargetAuras(newPhaseMask); // we can lost access to caster or target + { + RemoveNotOwnSingleTargetAuras(newPhaseMask); // we can lost access to caster or target + + // modify hostile references for new phasemask, some special cases deal with hostile references themselves + if (GetTypeId() == TYPEID_UNIT || (!ToPlayer()->isGameMaster() && !ToPlayer()->GetSession()->PlayerLogout())) + { + HostileRefManager& refManager = getHostileRefManager(); + HostileReference* ref = refManager.getFirst(); + + while (ref) + { + if (Unit* unit = ref->getSource()->getOwner()) + if (Creature* creature = unit->ToCreature()) + refManager.setOnlineOfflineState(creature, creature->InSamePhase(newPhaseMask)); + + ref = ref->next(); + } + + // modify threat lists for new phasemask + if (GetTypeId() != TYPEID_PLAYER) + { + std::list threatList = getThreatManager().getThreatList(); + std::list offlineThreatList = getThreatManager().getOfflineThreatList(); + + // merge expects sorted lists + threatList.sort(); + offlineThreatList.sort(); + threatList.merge(offlineThreatList); + + for (std::list::const_iterator itr = threatList.begin(); itr != threatList.end(); ++itr) + if (Unit* unit = (*itr)->getTarget()) + unit->getHostileRefManager().setOnlineOfflineState(ToCreature(), unit->InSamePhase(newPhaseMask)); + } + } + } WorldObject::SetPhaseMask(newPhaseMask, update); @@ -17393,7 +17511,7 @@ bool Unit::HandleSpellClick(Unit* clicker, int8 seatId) } if (IsInMap(caster)) - caster->CastCustomSpell(itr->second.spellId, SpellValueMod(SPELLVALUE_BASE_POINT0+i), seatId+1, target, true, NULL, NULL, origCasterGUID); + caster->CastCustomSpell(itr->second.spellId, SpellValueMod(SPELLVALUE_BASE_POINT0+i), seatId+1, target, false, NULL, NULL, origCasterGUID); else // This can happen during Player::_LoadAuras { int32 bp0 = seatId; @@ -17403,7 +17521,7 @@ bool Unit::HandleSpellClick(Unit* clicker, int8 seatId) else { if (IsInMap(caster)) - caster->CastSpell(target, spellEntry, true, NULL, NULL, origCasterGUID); + caster->CastSpell(target, spellEntry, false, NULL, NULL, origCasterGUID); else Aura::TryRefreshStackOrCreate(spellEntry, MAX_EFFECT_MASK, this, clicker, NULL, NULL, origCasterGUID); } @@ -17497,14 +17615,14 @@ void Unit::ChangeSeat(int8 seatId, bool next) ASSERT(false); } -void Unit::ExitVehicle(Position const* exitPosition) +void Unit::ExitVehicle(Position const* /*exitPosition*/) { //! This function can be called at upper level code to initialize an exit from the passenger's side. if (!m_vehicle) return; GetVehicleBase()->RemoveAurasByType(SPELL_AURA_CONTROL_VEHICLE, GetGUID()); - //! The following call would not even be executed successfully as the + //! The following call would not even be executed successfully as the //! SPELL_AURA_CONTROL_VEHICLE unapply handler already calls _ExitVehicle without //! specifying an exitposition. The subsequent call below would return on if (!m_vehicle). /*_ExitVehicle(exitPosition);*/ @@ -17513,7 +17631,7 @@ void Unit::ExitVehicle(Position const* exitPosition) //! to specify exit coordinates and either store those per passenger, or we need to //! init spline movement based on those coordinates in unapply handlers, and //! relocate exiting passengers based on Unit::moveSpline data. Either way, - //! Coming Soon™ + //! Coming Soon(TM) } void Unit::_ExitVehicle(Position const* exitPosition) @@ -17670,18 +17788,12 @@ void Unit::BuildMovementPacket(ByteBuffer *data) const *data << (float)m_movementInfo.splineElevation; } -void Unit::SetFlying(bool apply) +void Unit::SetCanFly(bool apply) { if (apply) - { - SetByteFlag(UNIT_FIELD_BYTES_1, 3, 0x02); - AddUnitMovementFlag(MOVEMENTFLAG_CAN_FLY | MOVEMENTFLAG_FLYING); - } + AddUnitMovementFlag(MOVEMENTFLAG_CAN_FLY); else - { - RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, 0x02); - RemoveUnitMovementFlag(MOVEMENTFLAG_CAN_FLY | MOVEMENTFLAG_FLYING); - } + RemoveUnitMovementFlag(MOVEMENTFLAG_CAN_FLY); } void Unit::NearTeleportTo(float x, float y, float z, float orientation, bool casting /*= false*/) @@ -17722,14 +17834,30 @@ bool Unit::UpdatePosition(float x, float y, float z, float orientation, bool tel GetMap()->CreatureRelocation(ToCreature(), x, y, z, orientation); } else if (turn) - SetOrientation(orientation); + UpdateOrientation(orientation); - if ((relocated || turn) && IsVehicle()) - GetVehicleKit()->RelocatePassengers(x, y, z, orientation); + // code block for underwater state update + UpdateUnderwaterState(GetMap(), x, y, z); return (relocated || turn); } +//! Only server-side orientation update, does not broadcast to client +void Unit::UpdateOrientation(float orientation) +{ + SetOrientation(orientation); + if (IsVehicle()) + GetVehicleKit()->RelocatePassengers(GetPositionX(), GetPositionY(), GetPositionZ(), orientation); +} + +//! Only server-side height update, does not broadcast to client +void Unit::UpdateHeight(float newZ) +{ + Relocate(GetPositionX(), GetPositionY(), newZ); + if (IsVehicle()) + GetVehicleKit()->RelocatePassengers(GetPositionX(), GetPositionY(), newZ, GetOrientation()); +} + void Unit::SendThreatListUpdate() { if (!getThreatManager().isThreatListEmpty()) @@ -17992,12 +18120,130 @@ void Unit::SetFacingTo(float ori) init.Launch(); } -void Unit::SetFacingToObject(WorldObject* pObject) +void Unit::SetFacingToObject(WorldObject* object) { // never face when already moving if (!IsStopped()) return; // TODO: figure out under what conditions creature will move towards object instead of facing it where it currently is. - SetFacingTo(GetAngle(pObject)); + SetFacingTo(GetAngle(object)); +} + +bool Unit::SetWalk(bool enable) +{ + if (enable == IsWalking()) + return false; + + if (enable) + AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + else + RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + + return true; +} + +bool Unit::SetDisableGravity(bool disable, bool /*packetOnly = false*/) +{ + if (disable == IsLevitating()) + return false; + + if (disable) + AddUnitMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY); + else + RemoveUnitMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY); + + return true; +} + +bool Unit::SetHover(bool enable) +{ + if (enable == HasUnitMovementFlag(MOVEMENTFLAG_HOVER)) + return false; + + if (enable) + { + //! No need to check height on ascent + AddUnitMovementFlag(MOVEMENTFLAG_HOVER); + if (float hh = GetFloatValue(UNIT_FIELD_HOVERHEIGHT)) + UpdateHeight(GetPositionZ() + hh); + } + else + { + RemoveUnitMovementFlag(MOVEMENTFLAG_HOVER); + if (float hh = GetFloatValue(UNIT_FIELD_HOVERHEIGHT)) + { + float newZ = GetPositionZ() - hh; + UpdateAllowedPositionZ(GetPositionX(), GetPositionY(), newZ); + UpdateHeight(newZ); + } + } + + return true; +} + +void Unit::SendMovementHover() +{ + if (GetTypeId() == TYPEID_PLAYER) + ToPlayer()->SendMovementSetHover(HasUnitMovementFlag(MOVEMENTFLAG_HOVER)); + + WorldPacket data(MSG_MOVE_HOVER, 64); + data.append(GetPackGUID()); + BuildMovementPacket(&data); + SendMessageToSet(&data, false); +} + +void Unit::SendMovementWaterWalking() +{ + if (GetTypeId() == TYPEID_PLAYER) + ToPlayer()->SendMovementSetWaterWalking(HasUnitMovementFlag(MOVEMENTFLAG_WATERWALKING)); + + WorldPacket data(MSG_MOVE_WATER_WALK, 64); + data.append(GetPackGUID()); + BuildMovementPacket(&data); + SendMessageToSet(&data, false); +} + +void Unit::SendMovementFeatherFall() +{ + if (GetTypeId() == TYPEID_PLAYER) + ToPlayer()->SendMovementSetFeatherFall(HasUnitMovementFlag(MOVEMENTFLAG_FALLING_SLOW)); + + WorldPacket data(MSG_MOVE_FEATHER_FALL, 64); + data.append(GetPackGUID()); + BuildMovementPacket(&data); + SendMessageToSet(&data, false); +} + +void Unit::SendMovementGravityChange() +{ + WorldPacket data(MSG_MOVE_GRAVITY_CHNG, 64); + data.append(GetPackGUID()); + BuildMovementPacket(&data); + SendMessageToSet(&data, false); +} + +void Unit::SendMovementCanFlyChange() +{ + /*! + if ( a3->MoveFlags & MOVEMENTFLAG_CAN_FLY ) + { + v4->MoveFlags |= 0x1000000u; + result = 1; + } + else + { + if ( v4->MoveFlags & MOVEMENTFLAG_FLYING ) + CMovement::DisableFlying(v4); + v4->MoveFlags &= 0xFEFFFFFFu; + result = 1; + } + */ + if (GetTypeId() == TYPEID_PLAYER) + ToPlayer()->SendMovementSetCanFly(CanFly()); + + WorldPacket data(MSG_MOVE_UPDATE_CAN_FLY, 64); + data.append(GetPackGUID()); + BuildMovementPacket(&data); + SendMessageToSet(&data, false); } diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index e82c755ae41..9d6c22ab8b5 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -185,10 +185,10 @@ enum UnitStandFlags // byte flags value (UNIT_FIELD_BYTES_1, 3) enum UnitBytes1_Flags { - UNIT_BYTE1_FLAG_ALWAYS_STAND = 0x01, - UNIT_BYTE1_FLAG_UNK_2 = 0x02, - UNIT_BYTE1_FLAG_UNK_3 = 0x04, - UNIT_BYTE1_FLAG_ALL = 0xFF + UNIT_BYTE1_FLAG_ALWAYS_STAND = 0x01, + UNIT_BYTE1_FLAG_HOVER = 0x02, + UNIT_BYTE1_FLAG_UNK_3 = 0x04, + UNIT_BYTE1_FLAG_ALL = 0xFF }; // high byte (3 from 0..3) of UNIT_FIELD_BYTES_2 @@ -287,29 +287,29 @@ enum HitInfo { HITINFO_NORMALSWING = 0x00000000, HITINFO_UNK1 = 0x00000001, // req correct packet structure - HITINFO_NORMALSWING2 = 0x00000002, - HITINFO_LEFTSWING = 0x00000004, + HITINFO_AFFECTS_VICTIM = 0x00000002, + HITINFO_OFFHAND = 0x00000004, HITINFO_UNK2 = 0x00000008, HITINFO_MISS = 0x00000010, - HITINFO_ABSORB = 0x00000020, // absorbed damage - HITINFO_ABSORB2 = 0x00000040, // absorbed damage - HITINFO_RESIST = 0x00000080, // resisted atleast some damage - HITINFO_RESIST2 = 0x00000100, // resisted atleast some damage + HITINFO_FULL_ABSORB = 0x00000020, + HITINFO_PARTIAL_ABSORB = 0x00000040, + HITINFO_FULL_RESIST = 0x00000080, + HITINFO_PARTIAL_RESIST = 0x00000100, HITINFO_CRITICALHIT = 0x00000200, // critical hit // 0x00000400 // 0x00000800 // 0x00001000 HITINFO_BLOCK = 0x00002000, // blocked damage - // 0x00004000 - // 0x00008000 + // 0x00004000 // Hides worldtext for 0 damage + // 0x00008000 // Related to blood visual HITINFO_GLANCING = 0x00010000, HITINFO_CRUSHING = 0x00020000, - HITINFO_NOACTION = 0x00040000, // guessed + HITINFO_NO_ANIMATION = 0x00040000, // 0x00080000 // 0x00100000 - HITINFO_SWINGNOHITSOUND = 0x00200000, // guessed + HITINFO_SWINGNOHITSOUND = 0x00200000, // unused? // 0x00400000 - HITINFO_UNK3 = 0x00800000 + HITINFO_RAGE_GAIN = 0x00800000 }; //i would like to remove this: (it is defined in item.h @@ -342,6 +342,7 @@ class Transport; class Vehicle; typedef std::list UnitList; +typedef std::list< std::pair > DispelChargesList; struct SpellImmune { @@ -464,7 +465,7 @@ enum DeathState JUST_DIED = 1, CORPSE = 2, DEAD = 3, - JUST_ALIVED = 4, + JUST_RESPAWNED = 4, }; enum UnitState @@ -498,9 +499,8 @@ enum UnitState UNIT_STATE_CHASE_MOVE = 0x04000000, UNIT_STATE_FOLLOW_MOVE = 0x08000000, UNIT_STATE_UNATTACKABLE = (UNIT_STATE_IN_FLIGHT | UNIT_STATE_ONVEHICLE), - //UNIT_STATE_MOVING = (UNIT_STATE_ROAMING | UNIT_STATE_CHASE), // for real move using movegen check and stop (except unstoppable flight) - UNIT_STATE_MOVING = UNIT_STATE_ROAMING_MOVE | UNIT_STATE_CONFUSED_MOVE | UNIT_STATE_FLEEING_MOVE| UNIT_STATE_CHASE_MOVE | UNIT_STATE_FOLLOW_MOVE , + UNIT_STATE_MOVING = UNIT_STATE_ROAMING_MOVE | UNIT_STATE_CONFUSED_MOVE | UNIT_STATE_FLEEING_MOVE | UNIT_STATE_CHASE_MOVE | UNIT_STATE_FOLLOW_MOVE , UNIT_STATE_CONTROLLED = (UNIT_STATE_CONFUSED | UNIT_STATE_STUNNED | UNIT_STATE_FLEEING), UNIT_STATE_LOST_CONTROL = (UNIT_STATE_CONTROLLED | UNIT_STATE_JUMPING | UNIT_STATE_CHARGING), UNIT_STATE_SIGHTLESS = (UNIT_STATE_LOST_CONTROL | UNIT_STATE_EVADE), @@ -676,10 +676,10 @@ enum MovementFlags MOVEMENTFLAG_PITCH_DOWN = 0x00000080, MOVEMENTFLAG_WALKING = 0x00000100, // Walking MOVEMENTFLAG_ONTRANSPORT = 0x00000200, // Used for flying on some creatures - MOVEMENTFLAG_LEVITATING = 0x00000400, + MOVEMENTFLAG_DISABLE_GRAVITY = 0x00000400, // Former MOVEMENTFLAG_LEVITATING. This is used when walking is not possible. MOVEMENTFLAG_ROOT = 0x00000800, // Must not be set along with MOVEMENTFLAG_MASK_MOVING - MOVEMENTFLAG_JUMPING = 0x00001000, - MOVEMENTFLAG_FALLING = 0x00002000, // damage dealt on that type of falling + MOVEMENTFLAG_FALLING = 0x00001000, // damage dealt on that type of falling + MOVEMENTFLAG_FALLING_FAR = 0x00002000, MOVEMENTFLAG_PENDING_STOP = 0x00004000, MOVEMENTFLAG_PENDING_STRAFE_STOP = 0x00008000, MOVEMENTFLAG_PENDING_FORWARD = 0x00010000, @@ -690,8 +690,8 @@ enum MovementFlags MOVEMENTFLAG_SWIMMING = 0x00200000, // appears with fly flag also MOVEMENTFLAG_ASCENDING = 0x00400000, // press "space" when flying MOVEMENTFLAG_DESCENDING = 0x00800000, - MOVEMENTFLAG_CAN_FLY = 0x01000000, // can fly - MOVEMENTFLAG_FLYING = 0x02000000, // hover + MOVEMENTFLAG_CAN_FLY = 0x01000000, // Appears when unit can fly AND also walk + MOVEMENTFLAG_FLYING = 0x02000000, // unit is actually flying. pretty sure this is only used for players. creatures use disable_gravity MOVEMENTFLAG_SPLINE_ELEVATION = 0x04000000, // used for flight paths MOVEMENTFLAG_SPLINE_ENABLED = 0x08000000, // used for flight paths MOVEMENTFLAG_WATERWALKING = 0x10000000, // prevent unit from falling through water @@ -701,11 +701,18 @@ enum MovementFlags // TODO: Check if PITCH_UP and PITCH_DOWN really belong here.. MOVEMENTFLAG_MASK_MOVING = MOVEMENTFLAG_FORWARD | MOVEMENTFLAG_BACKWARD | MOVEMENTFLAG_STRAFE_LEFT | MOVEMENTFLAG_STRAFE_RIGHT | - MOVEMENTFLAG_PITCH_UP | MOVEMENTFLAG_PITCH_DOWN | MOVEMENTFLAG_JUMPING | MOVEMENTFLAG_FALLING | MOVEMENTFLAG_ASCENDING | MOVEMENTFLAG_DESCENDING | + MOVEMENTFLAG_PITCH_UP | MOVEMENTFLAG_PITCH_DOWN | MOVEMENTFLAG_FALLING | MOVEMENTFLAG_FALLING_FAR | MOVEMENTFLAG_ASCENDING | MOVEMENTFLAG_DESCENDING | MOVEMENTFLAG_SPLINE_ELEVATION, MOVEMENTFLAG_MASK_TURNING = MOVEMENTFLAG_LEFT | MOVEMENTFLAG_RIGHT, + + MOVEMENTFLAG_MASK_MOVING_FLY = + MOVEMENTFLAG_FLYING | MOVEMENTFLAG_ASCENDING | MOVEMENTFLAG_DESCENDING, + + //! TODO if needed: add more flags to this masks that are exclusive to players + MOVEMENTFLAG_MASK_PLAYER_ONLY = + MOVEMENTFLAG_FLYING, }; enum MovementFlags2 { @@ -1232,7 +1239,7 @@ class Unit : public WorldObject typedef std::map VisibleAuraMap; - virtual ~Unit (); + virtual ~Unit(); UnitAI* GetAI() { return i_AI; } void SetAI(UnitAI* newAI) { i_AI = newAI; } @@ -1301,7 +1308,7 @@ class Unit : public WorldObject void StopAttackFaction(uint32 faction_id); Unit* SelectNearbyTarget(Unit* exclude = NULL, float dist = NOMINAL_MELEE_RANGE) const; void SendMeleeAttackStop(Unit* victim = NULL); - void SendMeleeAttackStart(Unit* pVictim); + void SendMeleeAttackStart(Unit* victim); void AddUnitState(uint32 f) { m_state |= f; } bool HasUnitState(const uint32 f) const { return (m_state & f); } @@ -1332,7 +1339,7 @@ class Unit : public WorldObject float GetStat(Stats stat) const { return float(GetUInt32Value(UNIT_FIELD_STAT0+stat)); } void SetStat(Stats stat, int32 val) { SetStatInt32Value(UNIT_FIELD_STAT0+stat, val); } - uint32 GetArmor() const { return GetResistance(SPELL_SCHOOL_NORMAL) ; } + uint32 GetArmor() const { return GetResistance(SPELL_SCHOOL_NORMAL); } void SetArmor(int32 val) { SetResistance(SPELL_SCHOOL_NORMAL, val); } uint32 GetResistance(SpellSchools school) const { return GetUInt32Value(UNIT_FIELD_RESISTANCES+school); } @@ -1396,9 +1403,7 @@ class Unit : public WorldObject bool IsNeutralToAll() const; bool IsInPartyWith(Unit const* unit) const; bool IsInRaidWith(Unit const* unit) const; - void GetPartyMemberInDist(std::list &units, float dist); void GetPartyMembers(std::list &units); - void GetRaidMember(std::list &units, float dist); bool IsContestedGuard() const { if (FactionTemplateEntry const* entry = getFactionTemplateEntry()) @@ -1436,12 +1441,12 @@ class Unit : public WorldObject MountCapabilityEntry const* GetMountCapability(uint32 mountType) const; uint16 GetMaxSkillValueForLevel(Unit const* target = NULL) const { return (target ? getLevelForTarget(target) : getLevel()) * 5; } - void DealDamageMods(Unit* pVictim, uint32 &damage, uint32* absorb); - uint32 DealDamage(Unit* pVictim, uint32 damage, CleanDamage const* cleanDamage = NULL, DamageEffectType damagetype = DIRECT_DAMAGE, SpellSchoolMask damageSchoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellInfo const* spellProto = NULL, bool durabilityLoss = true); - void Kill(Unit* pVictim, bool durabilityLoss = true); - int32 DealHeal(Unit* pVictim, uint32 addhealth); + void DealDamageMods(Unit* victim, uint32 &damage, uint32* absorb); + uint32 DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDamage = NULL, DamageEffectType damagetype = DIRECT_DAMAGE, SpellSchoolMask damageSchoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellInfo const* spellProto = NULL, bool durabilityLoss = true); + void Kill(Unit* victim, bool durabilityLoss = true); + int32 DealHeal(Unit* victim, uint32 addhealth); - void ProcDamageAndSpell(Unit* pVictim, uint32 procAttacker, uint32 procVictim, uint32 procEx, uint32 amount, WeaponAttackType attType = BASE_ATTACK, SpellInfo const* procSpell = NULL, SpellInfo const* procAura = NULL); + void ProcDamageAndSpell(Unit* victim, uint32 procAttacker, uint32 procVictim, uint32 procEx, uint32 amount, WeaponAttackType attType = BASE_ATTACK, SpellInfo const* procSpell = NULL, SpellInfo const* procAura = NULL); void ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, SpellInfo const* procSpell, uint32 damage, SpellInfo const* procAura = NULL); void GetProcAurasTriggeredOnEvent(std::list& aurasTriggeringProc, std::list* procAuras, ProcEventInfo eventInfo); @@ -1450,9 +1455,9 @@ class Unit : public WorldObject void TriggerAurasProcOnEvent(ProcEventInfo& eventInfo, std::list& procAuras); void HandleEmoteCommand(uint32 anim_id); - void AttackerStateUpdate (Unit* pVictim, WeaponAttackType attType = BASE_ATTACK, bool extra = false); + void AttackerStateUpdate (Unit* victim, WeaponAttackType attType = BASE_ATTACK, bool extra = false); - void CalculateMeleeDamage(Unit* pVictim, uint32 damage, CalcDamageInfo* damageInfo, WeaponAttackType attackType = BASE_ATTACK); + void CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* damageInfo, WeaponAttackType attackType = BASE_ATTACK); void DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss); void HandleProcExtraAttackFor(Unit* victim); @@ -1474,18 +1479,18 @@ class Unit : public WorldObject uint32 GetRangedDamageReduction(uint32 damage) const { return GetCombatRatingDamageReduction(CR_CRIT_TAKEN_RANGED, 2.0f, 100.0f, damage); } uint32 GetSpellDamageReduction(uint32 damage) const { return GetCombatRatingDamageReduction(CR_CRIT_TAKEN_SPELL, 2.0f, 100.0f, damage); } - void ApplyResilience(const Unit* pVictim, float * crit, int32 * damage, bool isCrit, CombatRating type) const; + void ApplyResilience(const Unit* victim, float * crit, int32 * damage, bool isCrit, CombatRating type) const; - float MeleeSpellMissChance(const Unit* pVictim, WeaponAttackType attType, int32 skillDiff, uint32 spellId) const; - SpellMissInfo MeleeSpellHitResult(Unit* pVictim, SpellInfo const* spell); - SpellMissInfo MagicSpellHitResult(Unit* pVictim, SpellInfo const* spell); - SpellMissInfo SpellHitResult(Unit* pVictim, SpellInfo const* spell, bool canReflect = false); + float MeleeSpellMissChance(const Unit* victim, WeaponAttackType attType, int32 skillDiff, uint32 spellId) const; + SpellMissInfo MeleeSpellHitResult(Unit* victim, SpellInfo const* spell); + SpellMissInfo MagicSpellHitResult(Unit* victim, SpellInfo const* spell); + SpellMissInfo SpellHitResult(Unit* victim, SpellInfo const* spell, bool canReflect = false); float GetUnitDodgeChance() const; float GetUnitParryChance() const; float GetUnitBlockChance() const; float GetUnitMissChance(WeaponAttackType attType) const; - float GetUnitCriticalChance(WeaponAttackType attackType, const Unit* pVictim) const; + float GetUnitCriticalChance(WeaponAttackType attackType, const Unit* victim) const; int32 GetMechanicResistChance(const SpellInfo* spell); bool CanUseAttackType(uint8 attacktype) const { @@ -1519,8 +1524,8 @@ class Unit : public WorldObject float GetWeaponProcChance() const; float GetPPMProcChance(uint32 WeaponSpeed, float PPM, const SpellInfo* spellProto) const; - MeleeHitOutcome RollMeleeOutcomeAgainst (const Unit* pVictim, WeaponAttackType attType) const; - MeleeHitOutcome RollMeleeOutcomeAgainst (const Unit* pVictim, WeaponAttackType attType, int32 crit_chance, int32 miss_chance, int32 dodge_chance, int32 parry_chance, int32 block_chance) const; + MeleeHitOutcome RollMeleeOutcomeAgainst (const Unit* victim, WeaponAttackType attType) const; + MeleeHitOutcome RollMeleeOutcomeAgainst (const Unit* victim, WeaponAttackType attType, int32 crit_chance, int32 miss_chance, int32 dodge_chance, int32 parry_chance, int32 block_chance) const; bool isVendor() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_VENDOR); } bool isTrainer() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_TRAINER); } @@ -1571,20 +1576,21 @@ class Unit : public WorldObject bool isTargetableForAttack(bool checkFakeDeath = true) const; bool IsValidAttackTarget(Unit const* target) const; - bool _IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell) const; + bool _IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell, WorldObject const* obj = NULL) const; bool IsValidAssistTarget(Unit const* target) const; bool _IsValidAssistTarget(Unit const* target, SpellInfo const* bySpell) const; virtual bool IsInWater() const; virtual bool IsUnderWater() const; + virtual void UpdateUnderwaterState(Map* m, float x, float y, float z); bool isInAccessiblePlaceFor(Creature const* c) const; - void SendHealSpellLog(Unit* pVictim, uint32 SpellID, uint32 Damage, uint32 OverHeal, uint32 Absorb, bool critical = false); - int32 HealBySpell(Unit* pVictim, SpellInfo const* spellInfo, uint32 addHealth, bool critical = false); - void SendEnergizeSpellLog(Unit* pVictim, uint32 SpellID, uint32 Damage, Powers powertype); - void EnergizeBySpell(Unit* pVictim, uint32 SpellID, uint32 Damage, Powers powertype); - uint32 SpellNonMeleeDamageLog(Unit* pVictim, uint32 spellID, uint32 damage); + void SendHealSpellLog(Unit* victim, uint32 SpellID, uint32 Damage, uint32 OverHeal, uint32 Absorb, bool critical = false); + int32 HealBySpell(Unit* victim, SpellInfo const* spellInfo, uint32 addHealth, bool critical = false); + void SendEnergizeSpellLog(Unit* victim, uint32 SpellID, uint32 Damage, Powers powertype); + void EnergizeBySpell(Unit* victim, uint32 SpellID, uint32 Damage, Powers powertype); + uint32 SpellNonMeleeDamageLog(Unit* victim, uint32 spellID, uint32 damage); void CastSpell(SpellCastTargets const& targets, SpellInfo const* spellInfo, CustomSpellValues const* value, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0); void CastSpell(Unit* victim, uint32 spellId, bool triggered, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0); @@ -1617,6 +1623,8 @@ class Unit : public WorldObject virtual bool UpdatePosition(float x, float y, float z, float ang, bool teleport = false); // returns true if unit's position really changed bool UpdatePosition(const Position &pos, bool teleport = false) { return UpdatePosition(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), teleport); } + void UpdateOrientation(float orientation); + void UpdateHeight(float newZ); void KnockbackFrom(float x, float y, float speedXY, float speedZ); void JumpTo(float speedXY, float speedZ, bool forward = true); @@ -1628,12 +1636,27 @@ class Unit : public WorldObject //void SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint8 type, uint32 MovementFlags, uint32 Time, Player* player = NULL); void SendMonsterMoveTransport(Unit* vehicleOwner); void SendMovementFlagUpdate(); - bool IsLevitating() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_LEVITATING);} + + /*! These methods send the same packet to the client in apply and unapply case. + The client-side interpretation of this packet depends on the presence of relevant movementflags + which are sent with movementinfo. Furthermore, these packets are broadcast to nearby players as well + as the current unit. + */ + void SendMovementHover(); + void SendMovementFeatherFall(); + void SendMovementWaterWalking(); + void SendMovementGravityChange(); + void SendMovementCanFlyChange(); + + bool IsLevitating() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY);} bool IsWalking() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_WALKING);} + virtual bool SetWalk(bool enable); + virtual bool SetDisableGravity(bool disable, bool packetOnly = false); + bool SetHover(bool enable); void SetInFront(Unit const* target); void SetFacingTo(float ori); - void SetFacingToObject(WorldObject* pObject); + void SetFacingToObject(WorldObject* object); void SendChangeCurrentVictimOpcode(HostileReference* pHostileReference); void SendClearThreatListOpcode(); @@ -1805,6 +1828,8 @@ class Unit : public WorldObject AuraApplication * GetAuraApplicationOfRankedSpell(uint32 spellId, uint64 casterGUID = 0, uint64 itemCasterGUID = 0, uint8 reqEffMask = 0, AuraApplication * except = NULL) const; Aura* GetAuraOfRankedSpell(uint32 spellId, uint64 casterGUID = 0, uint64 itemCasterGUID = 0, uint8 reqEffMask = 0) const; + void GetDispellableAuraList(Unit* caster, uint32 dispelMask, DispelChargesList& dispelList); + bool HasAuraEffect(uint32 spellId, uint8 effIndex, uint64 caster = 0) const; uint32 GetAuraCount(uint32 spellId) const; bool HasAura(uint32 spellId, uint64 casterGUID = 0, uint64 itemCasterGUID = 0, uint8 reqEffMask = 0) const; @@ -1958,10 +1983,10 @@ class Unit : public WorldObject // Threat related methods bool CanHaveThreatList() const; - void AddThreat(Unit* pVictim, float fThreat, SpellSchoolMask schoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellInfo const* threatSpell = NULL); + void AddThreat(Unit* victim, float fThreat, SpellSchoolMask schoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellInfo const* threatSpell = NULL); float ApplyTotalThreatModifier(float fThreat, SpellSchoolMask schoolMask = SPELL_SCHOOL_MASK_NORMAL); void DeleteThreatList(); - void TauntApply(Unit* pVictim); + void TauntApply(Unit* victim); void TauntFadeOut(Unit* taunter); ThreatManager& getThreatManager() { return m_ThreatManager; } void addHatedBy(HostileReference* pHostileReference) { m_HostileRefManager.insertFirst(pHostileReference); }; @@ -2008,29 +2033,37 @@ class Unit : public WorldObject float GetAPMultiplier(WeaponAttackType attType, bool normalized); void ModifyAuraState(AuraStateType flag, bool apply); uint32 BuildAuraStateUpdateForTarget(Unit* target) const; - bool HasAuraState(AuraStateType flag, SpellInfo const* spellProto = NULL, Unit const* Caster = NULL) const ; + bool HasAuraState(AuraStateType flag, SpellInfo const* spellProto = NULL, Unit const* Caster = NULL) const; void UnsummonAllTotems(); Unit* GetMagicHitRedirectTarget(Unit* victim, SpellInfo const* spellInfo); Unit* GetMeleeHitRedirectTarget(Unit* victim, SpellInfo const* spellInfo = NULL); - int32 SpellBaseDamageBonus(SpellSchoolMask schoolMask); - int32 SpellBaseHealingBonus(SpellSchoolMask schoolMask); - int32 SpellBaseDamageBonusForVictim(SpellSchoolMask schoolMask, Unit* pVictim); - int32 SpellBaseHealingBonusForVictim(SpellSchoolMask schoolMask, Unit* pVictim); - uint32 SpellDamageBonus(Unit* pVictim, SpellInfo const* spellProto, uint32 damage, DamageEffectType damagetype, uint32 stack = 1); - uint32 SpellHealingBonus(Unit* pVictim, SpellInfo const* spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack = 1); - bool isSpellBlocked(Unit* pVictim, SpellInfo const* spellProto, WeaponAttackType attackType = BASE_ATTACK); + + int32 SpellBaseDamageBonusDone(SpellSchoolMask schoolMask); + int32 SpellBaseDamageBonusTaken(SpellSchoolMask schoolMask); + uint32 SpellDamageBonusDone(Unit* victim, SpellInfo const *spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack = 1); + uint32 SpellDamageBonusTaken(Unit* caster, SpellInfo const *spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack = 1); + int32 SpellBaseHealingBonusDone(SpellSchoolMask schoolMask); + int32 SpellBaseHealingBonusTaken(SpellSchoolMask schoolMask); + uint32 SpellHealingBonusDone(Unit* victim, SpellInfo const *spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack = 1); + uint32 SpellHealingBonusTaken(Unit* caster, SpellInfo const *spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack = 1); + + uint32 MeleeDamageBonusDone(Unit *pVictim, uint32 damage, WeaponAttackType attType, SpellInfo const *spellProto = NULL); + uint32 MeleeDamageBonusTaken(Unit* attacker, uint32 pdamage,WeaponAttackType attType, SpellInfo const *spellProto = NULL); + + + bool isSpellBlocked(Unit* victim, SpellInfo const* spellProto, WeaponAttackType attackType = BASE_ATTACK); bool isBlockCritical(); - bool isSpellCrit(Unit* pVictim, SpellInfo const* spellProto, SpellSchoolMask schoolMask, WeaponAttackType attackType = BASE_ATTACK) const; - uint32 SpellCriticalDamageBonus(SpellInfo const* spellProto, uint32 damage, Unit* pVictim); - uint32 SpellCriticalHealingBonus(SpellInfo const* spellProto, uint32 damage, Unit* pVictim); + bool isSpellCrit(Unit* victim, SpellInfo const* spellProto, SpellSchoolMask schoolMask, WeaponAttackType attackType = BASE_ATTACK) const; + uint32 SpellCriticalDamageBonus(SpellInfo const* spellProto, uint32 damage, Unit* victim); + uint32 SpellCriticalHealingBonus(SpellInfo const* spellProto, uint32 damage, Unit* victim); void SetLastManaUse(uint32 spellCastTime) { m_lastManaUse = spellCastTime; } bool IsUnderLastManaUseEffect() const; void SetContestedPvP(Player* attackedPlayer = NULL); - void MeleeDamageBonus(Unit* pVictim, uint32 *damage, WeaponAttackType attType, SpellInfo const* spellProto = NULL); - uint32 GetCastingTimeForBonus(SpellInfo const* spellProto, DamageEffectType damagetype, uint32 CastingTime); + uint32 GetCastingTimeForBonus(SpellInfo const* spellProto, DamageEffectType damagetype, uint32 CastingTime) const; + float CalculateDefaultCoefficient(SpellInfo const *spellInfo, DamageEffectType damagetype) const; uint32 GetRemainingPeriodicAmount(uint64 caster, uint32 spellId, AuraType auraType, uint8 effectIndex = 0) const; @@ -2043,9 +2076,9 @@ class Unit : public WorldObject virtual bool IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) const; // redefined in Creature static bool IsDamageReducedByArmor(SpellSchoolMask damageSchoolMask, SpellInfo const* spellInfo = NULL, uint8 effIndex = MAX_SPELL_EFFECTS); - uint32 CalcArmorReducedDamage(Unit* pVictim, const uint32 damage, SpellInfo const* spellInfo, WeaponAttackType attackType=MAX_ATTACK); - void CalcAbsorbResist(Unit* pVictim, SpellSchoolMask schoolMask, DamageEffectType damagetype, const uint32 damage, uint32 *absorb, uint32 *resist, SpellInfo const* spellInfo = NULL); - void CalcHealAbsorb(Unit* pVictim, const SpellInfo* spellProto, uint32 &healAmount, uint32 &absorb); + uint32 CalcArmorReducedDamage(Unit* victim, const uint32 damage, SpellInfo const* spellInfo, WeaponAttackType attackType=MAX_ATTACK); + void CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffectType damagetype, const uint32 damage, uint32 *absorb, uint32 *resist, SpellInfo const* spellInfo = NULL); + void CalcHealAbsorb(Unit* victim, const SpellInfo* spellProto, uint32 &healAmount, uint32 &absorb); void UpdateSpeed(UnitMoveType mtype, bool forced); float GetSpeed(UnitMoveType mtype) const; @@ -2053,7 +2086,6 @@ class Unit : public WorldObject void SetSpeed(UnitMoveType mtype, float rate, bool forced = false); float m_TempSpeed; - void SetHover(bool on); bool isHover() const { return HasAuraType(SPELL_AURA_HOVER); } float ApplyEffectModifiers(SpellInfo const* spellProto, uint8 effect_index, float value) const; @@ -2077,7 +2109,7 @@ class Unit : public WorldObject void AddUnitMovementFlag(uint32 f) { m_movementInfo.flags |= f; } void RemoveUnitMovementFlag(uint32 f) { m_movementInfo.flags &= ~f; } - uint32 HasUnitMovementFlag(uint32 f) const { return m_movementInfo.flags & f; } + bool HasUnitMovementFlag(uint32 f) const { return (m_movementInfo.flags & f) == f; } uint32 GetUnitMovementFlags() const { return m_movementInfo.flags; } void SetUnitMovementFlags(uint32 f) { m_movementInfo.flags = f; } @@ -2087,6 +2119,15 @@ class Unit : public WorldObject uint16 GetExtraUnitMovementFlags() const { return m_movementInfo.flags2; } void SetExtraUnitMovementFlags(uint16 f) { m_movementInfo.flags2 = f; } + float GetPositionZMinusOffset() const + { + float offset = 0.0f; + if (HasUnitMovementFlag(MOVEMENTFLAG_HOVER)) + offset = GetFloatValue(UNIT_FIELD_HOVERHEIGHT); + + return GetPositionZ() - offset; + } + void SetControlled(bool apply, UnitState state); void AddComboPointHolder(uint32 lowguid) { m_ComboPointHolders.insert(lowguid); } @@ -2171,9 +2212,9 @@ class Unit : public WorldObject bool isMoving() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_MASK_MOVING); } bool isTurning() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_MASK_TURNING); } - bool canFly() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_CAN_FLY); } - bool IsFlying() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_FLYING); } - void SetFlying(bool apply); + virtual bool CanFly() const = 0; + bool IsFlying() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_FLYING | MOVEMENTFLAG_DISABLE_GRAVITY); } + void SetCanFly(bool apply); void RewardRage(uint32 damage, uint32 weaponSpeedHitFactor, bool attacker); @@ -2290,21 +2331,22 @@ class Unit : public WorldObject Vehicle* m_vehicleKit; uint32 m_unitTypeMask; + LiquidTypeEntry const* _lastLiquid; bool IsAlwaysVisibleFor(WorldObject const* seer) const; bool IsAlwaysDetectableFor(WorldObject const* seer) const; void DisableSpline(); private: - bool IsTriggeredAtSpellProcEvent(Unit* pVictim, Aura* aura, SpellInfo const* procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const* & spellProcEvent); - bool HandleDummyAuraProc(Unit* pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); - bool HandleHasteAuraProc(Unit* pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); - bool HandleSpellCritChanceAuraProc(Unit* pVictim, uint32 damage, AuraEffect* triggredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); - bool HandleObsModEnergyAuraProc(Unit* pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); - bool HandleModDamagePctTakenAuraProc(Unit* pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); - bool HandleAuraProc(Unit* pVictim, uint32 damage, Aura* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown, bool * handled); - bool HandleProcTriggerSpell(Unit* pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); - bool HandleOverrideClassScriptAuraProc(Unit* pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 cooldown); + bool IsTriggeredAtSpellProcEvent(Unit* victim, Aura* aura, SpellInfo const* procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const* & spellProcEvent); + bool HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); + bool HandleHasteAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); + bool HandleSpellCritChanceAuraProc(Unit* victim, uint32 damage, AuraEffect* triggredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); + bool HandleObsModEnergyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); + bool HandleModDamagePctTakenAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); + bool HandleAuraProc(Unit* victim, uint32 damage, Aura* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown, bool * handled); + bool HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); + bool HandleOverrideClassScriptAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 cooldown); bool HandleAuraRaidProcFromChargeWithValue(AuraEffect* triggeredByAura); bool HandleAuraRaidProcFromCharge(AuraEffect* triggeredByAura); diff --git a/src/server/game/Entities/Vehicle/Vehicle.cpp b/src/server/game/Entities/Vehicle/Vehicle.cpp index e0d67e9ceef..090a1db382a 100755 --- a/src/server/game/Entities/Vehicle/Vehicle.cpp +++ b/src/server/game/Entities/Vehicle/Vehicle.cpp @@ -146,7 +146,7 @@ void Vehicle::ApplyAllImmunities() _me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK_DEST, true); // Mechanical units & vehicles ( which are not Bosses, they have own immunities in DB ) should be also immune on healing ( exceptions in switch below ) - if (_me->ToCreature() && _me->ToCreature()->GetCreatureInfo()->type == CREATURE_TYPE_MECHANICAL && !_me->ToCreature()->isWorldBoss()) + if (_me->ToCreature() && _me->ToCreature()->GetCreatureTemplate()->type == CREATURE_TYPE_MECHANICAL && !_me->ToCreature()->isWorldBoss()) { // Heal & dispel ... _me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_HEAL, true); @@ -285,9 +285,6 @@ void Vehicle::InstallAccessory(uint32 entry, int8 seatId, bool minion, uint8 typ // return; // Something went wrong in the spellsystem //} - // This is not good, we have to send update twice - accessory->SendMovementFlagUpdate(); - if (GetBase()->GetTypeId() == TYPEID_UNIT) sScriptMgr->OnInstallAccessory(this, accessory); } @@ -352,6 +349,7 @@ bool Vehicle::AddPassenger(Unit* unit, int8 seatId) unit->m_movementInfo.t_pos.m_orientation = 0; unit->m_movementInfo.t_time = 0; // 1 for player unit->m_movementInfo.t_seat = seat->first; + unit->m_movementInfo.t_guid = _me->GetGUID(); if (_me->GetTypeId() == TYPEID_UNIT && unit->GetTypeId() == TYPEID_PLAYER @@ -424,13 +422,14 @@ void Vehicle::RemovePassenger(Unit* unit) _me->ToCreature()->AI()->PassengerBoarded(unit, seat->first, false); // only for flyable vehicles - if (unit->HasUnitMovementFlag(MOVEMENTFLAG_FLYING)) + if (unit->IsFlying()) _me->CastSpell(unit, VEHICLE_SPELL_PARACHUTE, true); if (GetBase()->GetTypeId() == TYPEID_UNIT) sScriptMgr->OnRemovePassenger(this, unit); } +//! Must be called after m_base::Relocate void Vehicle::RelocatePassengers(float x, float y, float z, float ang) { ASSERT(_me->GetMap()); @@ -440,8 +439,6 @@ void Vehicle::RelocatePassengers(float x, float y, float z, float ang) if (Unit* passenger = ObjectAccessor::GetUnit(*GetBase(), itr->second.Passenger)) { ASSERT(passenger->IsInWorld()); - ASSERT(passenger->IsOnVehicle(GetBase())); - ASSERT(GetSeatForPassenger(passenger)); float px = x + passenger->m_movementInfo.t_pos.m_positionX; float py = y + passenger->m_movementInfo.t_pos.m_positionY; @@ -454,11 +451,12 @@ void Vehicle::RelocatePassengers(float x, float y, float z, float ang) void Vehicle::Dismiss() { + if (GetBase()->GetTypeId() != TYPEID_UNIT) + return; + sLog->outDebug(LOG_FILTER_VEHICLES, "Vehicle::Dismiss Entry: %u, GuidLow %u", _creatureEntry, _me->GetGUIDLow()); Uninstall(); - _me->DestroyForNearbyPlayers(); - _me->CombatStop(); - _me->AddObjectToRemoveList(); + GetBase()->ToCreature()->DespawnOrUnsummon(); } void Vehicle::InitMovementInfoForBase() diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp index 6f5dc0e511e..d5e85d2cf2f 100755 --- a/src/server/game/Events/GameEventMgr.cpp +++ b/src/server/game/Events/GameEventMgr.cpp @@ -80,7 +80,7 @@ uint32 GameEventMgr::NextCheck(uint16 entry) const if (mGameEvent[entry].state == GAMEEVENT_WORLD_CONDITIONS) { if (mGameEvent[entry].length) - return mGameEvent[entry].length * 60 ; + return mGameEvent[entry].length * 60; else return max_ge_check_delay; } @@ -205,7 +205,7 @@ void GameEventMgr::LoadFromDB() { { uint32 oldMSTime = getMSTime(); - + // 1 2 3 4 5 6 7 8 QueryResult result = WorldDatabase.Query("SELECT eventEntry, UNIX_TIMESTAMP(start_time), UNIX_TIMESTAMP(end_time), occurence, length, holiday, description, world_event FROM game_event"); if (!result) { @@ -220,7 +220,7 @@ void GameEventMgr::LoadFromDB() { Field* fields = result->Fetch(); - uint16 event_id = fields[0].GetUInt16(); + uint8 event_id = fields[0].GetUInt8(); if (event_id == 0) { sLog->outErrorDb("`game_event` game event entry 0 is reserved and can't be used."); @@ -232,8 +232,8 @@ void GameEventMgr::LoadFromDB() pGameEvent.start = time_t(starttime); uint64 endtime = fields[2].GetUInt64(); pGameEvent.end = time_t(endtime); - pGameEvent.occurence = fields[3].GetUInt32(); - pGameEvent.length = fields[4].GetUInt32(); + pGameEvent.occurence = fields[3].GetUInt64(); + pGameEvent.length = fields[4].GetUInt64(); pGameEvent.holiday_id = HolidayIds(fields[5].GetUInt32()); pGameEvent.state = (GameEventState)(fields[7].GetUInt8()); @@ -283,7 +283,7 @@ void GameEventMgr::LoadFromDB() { Field* fields = result->Fetch(); - uint16 event_id = fields[0].GetUInt16(); + uint8 event_id = fields[0].GetUInt8(); if (event_id >= mGameEvent.size()) { @@ -315,6 +315,7 @@ void GameEventMgr::LoadFromDB() { uint32 oldMSTime = getMSTime(); + // 0 1 QueryResult result = WorldDatabase.Query("SELECT eventEntry, prerequisite_event FROM game_event_prerequisite"); if (!result) { @@ -328,7 +329,7 @@ void GameEventMgr::LoadFromDB() { Field* fields = result->Fetch(); - uint16 event_id = fields[0].GetUInt16(); + uint16 event_id = fields[0].GetUInt8(); if (event_id >= mGameEvent.size()) { @@ -338,7 +339,7 @@ void GameEventMgr::LoadFromDB() if (mGameEvent[event_id].state != GAMEEVENT_NORMAL && mGameEvent[event_id].state != GAMEEVENT_INTERNAL) { - uint16 prerequisite_event = fields[1].GetUInt16(); + uint16 prerequisite_event = fields[1].GetUInt32(); if (prerequisite_event >= mGameEvent.size()) { sLog->outErrorDb("`game_event_prerequisite` game event prerequisite id (%i) is out of range compared to max event id in `game_event`", prerequisite_event); @@ -382,7 +383,7 @@ void GameEventMgr::LoadFromDB() Field* fields = result->Fetch(); uint32 guid = fields[0].GetUInt32(); - int16 event_id = fields[1].GetInt16(); + int16 event_id = fields[1].GetInt8(); int32 internal_event_id = mGameEvent.size() + event_id - 1; @@ -408,7 +409,7 @@ void GameEventMgr::LoadFromDB() { uint32 oldMSTime = getMSTime(); - // 1 2 + // 0 1 QueryResult result = WorldDatabase.Query("SELECT gameobject.guid, game_event_gameobject.eventEntry FROM gameobject" " JOIN game_event_gameobject ON gameobject.guid=game_event_gameobject.guid"); @@ -425,7 +426,7 @@ void GameEventMgr::LoadFromDB() Field* fields = result->Fetch(); uint32 guid = fields[0].GetUInt32(); - int16 event_id = fields[1].GetInt16(); + int16 event_id = fields[1].GetInt8(); int32 internal_event_id = mGameEvent.size() + event_id - 1; @@ -468,7 +469,7 @@ void GameEventMgr::LoadFromDB() Field* fields = result->Fetch(); uint32 guid = fields[0].GetUInt32(); - uint16 event_id = fields[1].GetUInt16(); + uint16 event_id = fields[1].GetUInt8(); if (event_id >= mGameEventModelEquip.size()) { @@ -525,7 +526,7 @@ void GameEventMgr::LoadFromDB() uint32 id = fields[0].GetUInt32(); uint32 quest = fields[1].GetUInt32(); - uint16 event_id = fields[2].GetUInt16(); + uint16 event_id = fields[2].GetUInt8(); if (event_id >= mGameEventCreatureQuests.size()) { @@ -566,7 +567,7 @@ void GameEventMgr::LoadFromDB() uint32 id = fields[0].GetUInt32(); uint32 quest = fields[1].GetUInt32(); - uint16 event_id = fields[2].GetUInt16(); + uint16 event_id = fields[2].GetUInt8(); if (event_id >= mGameEventGameObjectQuests.size()) { @@ -590,7 +591,7 @@ void GameEventMgr::LoadFromDB() { uint32 oldMSTime = getMSTime(); - // 0 1 2 3 + // 0 1 2 3 QueryResult result = WorldDatabase.Query("SELECT quest, eventEntry, condition_id, num FROM game_event_quest_condition"); if (!result) @@ -606,7 +607,7 @@ void GameEventMgr::LoadFromDB() Field* fields = result->Fetch(); uint32 quest = fields[0].GetUInt32(); - uint16 event_id = fields[1].GetUInt16(); + uint16 event_id = fields[1].GetUInt8(); uint32 condition = fields[2].GetUInt32(); float num = fields[3].GetFloat(); @@ -648,7 +649,7 @@ void GameEventMgr::LoadFromDB() { Field* fields = result->Fetch(); - uint16 event_id = fields[0].GetUInt16(); + uint16 event_id = fields[0].GetUInt8(); uint32 condition = fields[1].GetUInt32(); if (event_id >= mGameEvent.size()) @@ -659,8 +660,8 @@ void GameEventMgr::LoadFromDB() mGameEvent[event_id].conditions[condition].reqNum = fields[2].GetFloat(); mGameEvent[event_id].conditions[condition].done = 0; - mGameEvent[event_id].conditions[condition].max_world_state = fields[3].GetUInt32(); - mGameEvent[event_id].conditions[condition].done_world_state = fields[4].GetUInt32(); + mGameEvent[event_id].conditions[condition].max_world_state = fields[3].GetUInt16(); + mGameEvent[event_id].conditions[condition].done_world_state = fields[4].GetUInt16(); ++count; } @@ -690,7 +691,7 @@ void GameEventMgr::LoadFromDB() { Field* fields = result->Fetch(); - uint16 event_id = fields[0].GetUInt16(); + uint16 event_id = fields[0].GetUInt8(); uint32 condition = fields[1].GetUInt32(); if (event_id >= mGameEvent.size()) @@ -739,7 +740,7 @@ void GameEventMgr::LoadFromDB() Field* fields = result->Fetch(); uint32 guid = fields[0].GetUInt32(); - uint16 event_id = fields[1].GetUInt16(); + uint16 event_id = fields[1].GetUInt8(); uint32 npcflag = fields[2].GetUInt32(); if (event_id >= mGameEvent.size()) @@ -763,7 +764,7 @@ void GameEventMgr::LoadFromDB() { uint32 oldMSTime = getMSTime(); - // 0 1 + // 0 1 QueryResult result = WorldDatabase.Query("SELECT questId, eventEntry FROM game_event_seasonal_questrelation"); if (!result) @@ -779,7 +780,7 @@ void GameEventMgr::LoadFromDB() Field* fields = result->Fetch(); uint32 questId = fields[0].GetUInt32(); - uint16 eventEntry = fields[1].GetUInt16(); + uint32 eventEntry = fields[1].GetUInt32(); // TODO: Change to uint8 if (!sObjectMgr->GetQuestTemplate(questId)) { @@ -822,7 +823,7 @@ void GameEventMgr::LoadFromDB() { Field* fields = result->Fetch(); - uint16 event_id = fields[0].GetUInt16(); + uint8 event_id = fields[0].GetUInt8(); if (event_id >= mGameEventVendors.size()) { @@ -834,7 +835,7 @@ void GameEventMgr::LoadFromDB() NPCVendorEntry newEntry; uint32 guid = fields[1].GetUInt32(); newEntry.item = fields[2].GetUInt32(); - newEntry.maxcount = fields[3].GetInt32(); + newEntry.maxcount = fields[3].GetUInt32(); newEntry.incrtime = fields[4].GetUInt32(); newEntry.ExtendedCost = fields[5].GetUInt32(); // get the event npc flag for checking if the npc will be vendor during the event or not @@ -888,7 +889,7 @@ void GameEventMgr::LoadFromDB() { Field* fields = result->Fetch(); - uint16 event_id = fields[0].GetUInt16(); + uint16 event_id = fields[0].GetUInt8(); if (event_id >= mGameEvent.size()) { @@ -911,7 +912,7 @@ void GameEventMgr::LoadFromDB() { uint32 oldMSTime = getMSTime(); - // 1 2 + // 0 1 QueryResult result = WorldDatabase.Query("SELECT pool_template.entry, game_event_pool.eventEntry FROM pool_template" " JOIN game_event_pool ON pool_template.entry = game_event_pool.pool_entry"); @@ -928,7 +929,7 @@ void GameEventMgr::LoadFromDB() Field* fields = result->Fetch(); uint32 entry = fields[0].GetUInt32(); - int16 event_id = fields[1].GetInt16(); + int16 event_id = fields[1].GetInt8(); int32 internal_event_id = mGameEvent.size() + event_id - 1; @@ -981,7 +982,7 @@ void GameEventMgr::Initialize() { Field* fields = result->Fetch(); - uint32 maxEventId = fields[0].GetUInt16(); + uint32 maxEventId = fields[0].GetUInt8(); // Id starts with 1 and vector with 0, thus increment maxEventId++; @@ -1019,7 +1020,7 @@ void GameEventMgr::StartArenaSeason() } Field* fields = result->Fetch(); - uint16 eventId = fields[0].GetUInt16(); + uint16 eventId = fields[0].GetUInt8(); if (eventId >= mGameEvent.size()) { @@ -1123,8 +1124,6 @@ void GameEventMgr::UnApplyEvent(uint16 event_id) UpdateEventNPCVendor(event_id, false); // update bg holiday UpdateBattlegroundSettings(); - // check for seasonal quest reset. - sWorld->ResetEventSeasonalQuests(event_id); } void GameEventMgr::ApplyNewEvent(uint16 event_id) @@ -1159,6 +1158,8 @@ void GameEventMgr::ApplyNewEvent(uint16 event_id) UpdateEventNPCVendor(event_id, true); // update bg holiday UpdateBattlegroundSettings(); + // check for seasonal quest reset. + sWorld->ResetEventSeasonalQuests(event_id); } void GameEventMgr::UpdateEventNPCFlags(uint16 event_id) @@ -1174,7 +1175,7 @@ void GameEventMgr::UpdateEventNPCFlags(uint16 event_id) if (cr) { uint32 npcflag = GetNPCFlag(cr); - if (const CreatureTemplate* ci = cr->GetCreatureInfo()) + if (const CreatureTemplate* ci = cr->GetCreatureTemplate()) npcflag |= ci->npcflag; cr->SetUInt32Value(UNIT_NPC_FLAGS, npcflag); // reset gossip options, since the flag change might have added / removed some diff --git a/src/server/game/Globals/ObjectAccessor.cpp b/src/server/game/Globals/ObjectAccessor.cpp index 1a069a27825..9a99a28c7aa 100755 --- a/src/server/game/Globals/ObjectAccessor.cpp +++ b/src/server/game/Globals/ObjectAccessor.cpp @@ -166,10 +166,18 @@ Unit* ObjectAccessor::FindUnit(uint64 guid) Player* ObjectAccessor::FindPlayerByName(const char* name) { TRINITY_READ_GUARD(HashMapHolder::LockType, *HashMapHolder::GetLock()); + std::string nameStr = name; + std::transform(nameStr.begin(), nameStr.end(), nameStr.begin(), ::tolower); HashMapHolder::MapType const& m = GetPlayers(); for (HashMapHolder::MapType::const_iterator iter = m.begin(); iter != m.end(); ++iter) - if (iter->second->IsInWorld() && strcmp(name, iter->second->GetName()) == 0) + { + if (!iter->second->IsInWorld()) + continue; + std::string currentName = iter->second->GetName(); + std::transform(currentName.begin(), currentName.end(), currentName.begin(), ::tolower); + if (nameStr.compare(currentName) == 0) return iter->second; + } return NULL; } @@ -400,4 +408,4 @@ template Pet* ObjectAccessor::GetObjectInWorld(uint32 mapid, float x, float template Creature* ObjectAccessor::GetObjectInWorld(uint32 mapid, float x, float y, uint64 guid, Creature* /*fake*/); template Corpse* ObjectAccessor::GetObjectInWorld(uint32 mapid, float x, float y, uint64 guid, Corpse* /*fake*/); template GameObject* ObjectAccessor::GetObjectInWorld(uint32 mapid, float x, float y, uint64 guid, GameObject* /*fake*/); -template DynamicObject* ObjectAccessor::GetObjectInWorld(uint32 mapid, float x, float y, uint64 guid, DynamicObject* /*fake*/); \ No newline at end of file +template DynamicObject* ObjectAccessor::GetObjectInWorld(uint32 mapid, float x, float y, uint64 guid, DynamicObject* /*fake*/); diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index b30b36dbdc1..a14a49d2069 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -256,6 +256,10 @@ ObjectMgr::~ObjectMgr() itr->second.Clear(); _cacheTrainerSpellStore.clear(); + + for (DungeonEncounterContainer::iterator itr =_dungeonEncounterStore.begin(); itr != _dungeonEncounterStore.end(); ++itr) + for (DungeonEncounterList::iterator encounterItr = itr->second.begin(); encounterItr != itr->second.end(); ++encounterItr) + delete *encounterItr; } void ObjectMgr::AddLocaleString(std::string const& s, LocaleConstant locale, StringVector& data) @@ -380,10 +384,10 @@ void ObjectMgr::LoadCreatureTemplates() "type_flags, type_flags2, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, " // 55 56 57 58 59 60 61 62 63 64 65 66 67 68 "spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, PetSpellDataId, VehicleId, mingold, maxgold, AIName, MovementType, " - // 68 69 70 71 72 73 74 75 76 77 78 - "InhabitType, Health_mod, Mana_mod, Armor_mod, RacialLeader, questItem1, questItem2, questItem3, questItem4, questItem5, questItem6, " - // 79 80 81 82 83 84 - "movementId, RegenHealth, equipment_id, mechanic_immune_mask, flags_extra, ScriptName " + // 69 70 71 72 73 74 75 76 77 78 79 + "InhabitType, HoverHeight, Health_mod, Mana_mod, Armor_mod, RacialLeader, questItem1, questItem2, questItem3, questItem4, questItem5, " + // 80 81 82 83 84 85 86 + " questItem6, movementId, RegenHealth, equipment_id, mechanic_immune_mask, flags_extra, ScriptName " "FROM creature_template;"); if (!result) @@ -393,6 +397,7 @@ void ObjectMgr::LoadCreatureTemplates() return; } + _creatureTemplateStore.rehash(result->GetRowCount()); uint32 count = 0; do { @@ -421,7 +426,7 @@ void ObjectMgr::LoadCreatureTemplates() creatureTemplate.GossipMenuId = fields[13].GetUInt32(); creatureTemplate.minlevel = fields[14].GetUInt8(); creatureTemplate.maxlevel = fields[15].GetUInt8(); - creatureTemplate.expansion = uint32(fields[16].GetUInt16()); + creatureTemplate.expansion = uint32(fields[16].GetInt16()); creatureTemplate.expansionUnknown = uint32(fields[17].GetUInt16()); creatureTemplate.faction_A = uint32(fields[18].GetUInt16()); creatureTemplate.faction_H = uint32(fields[19].GetUInt16()); @@ -456,7 +461,7 @@ void ObjectMgr::LoadCreatureTemplates() creatureTemplate.SkinLootId = fields[48].GetUInt32(); for (uint8 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i) - creatureTemplate.resistance[i] = fields[50 + i -1].GetInt32(); + creatureTemplate.resistance[i] = fields[50 + i -1].GetInt16(); for (uint8 i = 0; i < CREATURE_MAX_SPELLS; ++i) creatureTemplate.spells[i] = fields[55 + i].GetUInt32(); @@ -468,20 +473,21 @@ void ObjectMgr::LoadCreatureTemplates() creatureTemplate.AIName = fields[67].GetString(); creatureTemplate.MovementType = uint32(fields[68].GetUInt8()); creatureTemplate.InhabitType = uint32(fields[69].GetUInt8()); - creatureTemplate.ModHealth = fields[70].GetFloat(); - creatureTemplate.ModMana = fields[71].GetFloat(); - creatureTemplate.ModArmor = fields[72].GetFloat(); - creatureTemplate.RacialLeader = fields[73].GetBool(); + creatureTemplate.HoverHeight = fields[70].GetFloat(); + creatureTemplate.ModHealth = fields[71].GetFloat(); + creatureTemplate.ModMana = fields[72].GetFloat(); + creatureTemplate.ModArmor = fields[73].GetFloat(); + creatureTemplate.RacialLeader = fields[74].GetBool(); for (uint8 i = 0; i < MAX_CREATURE_QUEST_ITEMS; ++i) - creatureTemplate.questItems[i] = fields[74 + i].GetUInt32(); + creatureTemplate.questItems[i] = fields[75 + i].GetUInt32(); - creatureTemplate.movementId = fields[80].GetUInt32(); - creatureTemplate.RegenHealth = fields[81].GetBool(); - creatureTemplate.equipmentId = fields[82].GetUInt32(); - creatureTemplate.MechanicImmuneMask = fields[83].GetUInt32(); - creatureTemplate.flags_extra = fields[84].GetUInt32(); - creatureTemplate.ScriptID = GetScriptId(fields[85].GetCString()); + creatureTemplate.movementId = fields[81].GetUInt32(); + creatureTemplate.RegenHealth = fields[82].GetBool(); + creatureTemplate.equipmentId = fields[83].GetUInt32(); + creatureTemplate.MechanicImmuneMask = fields[84].GetUInt32(); + creatureTemplate.flags_extra = fields[85].GetUInt32(); + creatureTemplate.ScriptID = GetScriptId(fields[86].GetCString()); ++count; } @@ -554,7 +560,10 @@ void ObjectMgr::LoadCreatureTemplateAddons() } if (!sEmotesStore.LookupEntry(creatureAddon.emote)) - sLog->outErrorDb("Creature (Entry: %u) has invalid emote (%u) defined in `creature_template_addon`.", entry, creatureAddon.emote); + { + sLog->outErrorDb("Creature (Entry: %u) has invalid emote (%u) defined in `creature_addon`.", entry, creatureAddon.emote); + creatureAddon.emote = 0; + } ++count; } @@ -706,7 +715,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo) else if (!displayScaleEntry) displayScaleEntry = displayEntry; - CreatureModelInfo const* modelInfo = GetCreatureModelInfo(cInfo->Modelid2);; + CreatureModelInfo const* modelInfo = GetCreatureModelInfo(cInfo->Modelid2); if (!modelInfo) sLog->outErrorDb("No model data exist for `Modelid2` = %u listed by creature (Entry: %u).", cInfo->Modelid2, cInfo->Entry); } @@ -738,7 +747,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo) else if (!displayScaleEntry) displayScaleEntry = displayEntry; - CreatureModelInfo const* modelInfo = GetCreatureModelInfo(cInfo->Modelid4);; + CreatureModelInfo const* modelInfo = GetCreatureModelInfo(cInfo->Modelid4); if (!modelInfo) sLog->outErrorDb("No model data exist for `Modelid4` = %u listed by creature (Entry: %u).", cInfo->Modelid4, cInfo->Entry); } @@ -798,6 +807,12 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo) const_cast(cInfo)->InhabitType = INHABIT_ANYWHERE; } + if (cInfo->HoverHeight < 0.0f) + { + sLog->outErrorDb("Creature (Entry: %u) has wrong value (%f) in `HoverHeight`", cInfo->Entry, cInfo->HoverHeight); + const_cast(cInfo)->HoverHeight = 1.0f; + } + if (cInfo->VehicleId) { VehicleEntry const* vehId = sVehicleStore.LookupEntry(cInfo->VehicleId); @@ -925,7 +940,7 @@ void ObjectMgr::LoadCreatureAddons() creatureAddon.auras[i++] = uint32(atol(*itr)); } - if (creatureAddon.mount) + if (creatureAddon.mount) { if (!sCreatureDisplayInfoStore.LookupEntry(creatureAddon.mount)) { @@ -935,7 +950,10 @@ void ObjectMgr::LoadCreatureAddons() } if (!sEmotesStore.LookupEntry(creatureAddon.emote)) + { sLog->outErrorDb("Creature (GUID: %u) has invalid emote (%u) defined in `creature_addon`.", guid, creatureAddon.emote); + creatureAddon.emote = 0; + } ++count; } @@ -1003,7 +1021,7 @@ void ObjectMgr::LoadEquipmentTemplates() if (!equipmentInfo.ItemEntry[i]) continue; - ItemEntry const* dbcItem = sItemStore.LookupEntry(equipmentInfo.ItemEntry[i]); + ItemEntry const* dbcItem = sItemStore.LookupEntry(equipmentInfo.ItemEntry[i]); if (!dbcItem) { @@ -1082,25 +1100,25 @@ void ObjectMgr::ChooseCreatureFlags(const CreatureTemplate* cinfo, uint32& npcfl CreatureModelInfo const* ObjectMgr::GetCreatureModelRandomGender(uint32* displayID) { - CreatureModelInfo const* minfo = GetCreatureModelInfo(*displayID); - if (!minfo) + CreatureModelInfo const* modelInfo = GetCreatureModelInfo(*displayID); + if (!modelInfo) return NULL; // If a model for another gender exists, 50% chance to use it - if (minfo->modelid_other_gender != 0 && urand(0, 1) == 0) + if (modelInfo->modelid_other_gender != 0 && urand(0, 1) == 0) { - CreatureModelInfo const* minfo_tmp = GetCreatureModelInfo(minfo->modelid_other_gender); + CreatureModelInfo const* minfo_tmp = GetCreatureModelInfo(modelInfo->modelid_other_gender); if (!minfo_tmp) - sLog->outErrorDb("Model (Entry: %u) has modelid_other_gender %u not found in table `creature_model_info`. ", *displayID, minfo->modelid_other_gender); + sLog->outErrorDb("Model (Entry: %u) has modelid_other_gender %u not found in table `creature_model_info`. ", *displayID, modelInfo->modelid_other_gender); else { // Model ID changed - *displayID = minfo->modelid_other_gender; + *displayID = modelInfo->modelid_other_gender; return minfo_tmp; } } - return minfo; + return modelInfo; } void ObjectMgr::LoadCreatureModelInfo() @@ -1116,6 +1134,7 @@ void ObjectMgr::LoadCreatureModelInfo() return; } + _creatureModelStore.rehash(result->GetRowCount()); uint32 count = 0; do @@ -1124,7 +1143,7 @@ void ObjectMgr::LoadCreatureModelInfo() uint32 modelId = fields[0].GetUInt32(); - CreatureModelInfo& modelInfo = _creatureModelStore[modelId]; + CreatureModelInfo& modelInfo = _creatureModelStore[modelId]; modelInfo.bounding_radius = fields[1].GetFloat(); modelInfo.combat_reach = fields[2].GetFloat(); @@ -1149,9 +1168,7 @@ void ObjectMgr::LoadCreatureModelInfo() } if (modelInfo.combat_reach < 0.1f) - { modelInfo.combat_reach = DEFAULT_COMBAT_REACH; - } ++count; } @@ -1166,6 +1183,7 @@ void ObjectMgr::LoadLinkedRespawn() uint32 oldMSTime = getMSTime(); _linkedRespawnStore.clear(); + // 0 1 2 QueryResult result = WorldDatabase.Query("SELECT guid, linkedGuid, linkType FROM linked_respawn ORDER BY guid ASC"); if (!result) @@ -1339,7 +1357,6 @@ void ObjectMgr::LoadLinkedRespawn() if (!error) _linkedRespawnStore[guid] = linkedGuid; - } while (result->NextRow()); @@ -1393,9 +1410,9 @@ void ObjectMgr::LoadCreatures() { uint32 oldMSTime = getMSTime(); - // 0 1 2 3 4 5 6 7 8 9 10 + // 0 1 2 3 4 5 6 7 8 9 10 QueryResult result = WorldDatabase.Query("SELECT creature.guid, id, map, modelid, equipment_id, position_x, position_y, position_z, orientation, spawntimesecs, spawndist, " - // 11 12 13 14 15 16 17 18 19 20 21 + // 11 12 13 14 15 16 17 18 19 20 21 "currentwaypoint, curhealth, curmana, MovementType, spawnMask, phaseMask, eventEntry, pool_entry, creature.npcflag, creature.unit_flags, creature.dynamicflags " "FROM creature " "LEFT OUTER JOIN game_event_creature ON creature.guid = game_event_creature.guid " @@ -1416,13 +1433,14 @@ void ObjectMgr::LoadCreatures() if (GetMapDifficultyData(i, Difficulty(k))) spawnMasks[i] |= (1 << k); + _creatureDataStore.rehash(result->GetRowCount()); uint32 count = 0; do { Field* fields = result->Fetch(); - uint32 guid = fields[ 0].GetUInt32(); - uint32 entry = fields[ 1].GetUInt32(); + uint32 guid = fields[0].GetUInt32(); + uint32 entry = fields[1].GetUInt32(); CreatureTemplate const* cInfo = GetCreatureTemplate(entry); if (!cInfo) @@ -1432,16 +1450,15 @@ void ObjectMgr::LoadCreatures() } CreatureData& data = _creatureDataStore[guid]; - data.id = entry; - data.mapid = fields[ 2].GetUInt32(); - data.displayid = fields[ 3].GetUInt32(); - data.equipmentId = fields[ 4].GetUInt32(); - data.posX = fields[ 5].GetFloat(); - data.posY = fields[ 6].GetFloat(); - data.posZ = fields[ 7].GetFloat(); - data.orientation = fields[ 8].GetFloat(); - data.spawntimesecs = fields[ 9].GetUInt32(); + data.mapid = fields[2].GetUInt16(); + data.displayid = fields[3].GetUInt32(); + data.equipmentId = fields[4].GetInt32(); + data.posX = fields[5].GetFloat(); + data.posY = fields[6].GetFloat(); + data.posZ = fields[7].GetFloat(); + data.orientation = fields[8].GetFloat(); + data.spawntimesecs = fields[9].GetUInt32(); data.spawndist = fields[10].GetFloat(); data.currentwaypoint= fields[11].GetUInt32(); data.curhealth = fields[12].GetUInt32(); @@ -1449,7 +1466,7 @@ void ObjectMgr::LoadCreatures() data.movementType = fields[14].GetUInt8(); data.spawnMask = fields[15].GetUInt8(); data.phaseMask = fields[16].GetUInt16(); - int16 gameEvent = fields[17].GetInt16(); + int16 gameEvent = fields[17].GetInt8(); uint32 PoolId = fields[18].GetUInt32(); data.npcflag = fields[19].GetUInt32(); data.unit_flags = fields[20].GetUInt32(); @@ -1706,7 +1723,7 @@ void ObjectMgr::LoadGameobjects() // 0 1 2 3 4 5 6 QueryResult result = WorldDatabase.Query("SELECT gameobject.guid, id, map, position_x, position_y, position_z, orientation, " - // 7 8 9 10 11 12 13 14 15 16 17 + // 7 8 9 10 11 12 13 14 15 16 17 "rotation0, rotation1, rotation2, rotation3, spawntimesecs, animprogress, state, spawnMask, phaseMask, eventEntry, pool_entry " "FROM gameobject LEFT OUTER JOIN game_event_gameobject ON gameobject.guid = game_event_gameobject.guid " "LEFT OUTER JOIN pool_gameobject ON gameobject.guid = pool_gameobject.guid"); @@ -1726,12 +1743,13 @@ void ObjectMgr::LoadGameobjects() if (GetMapDifficultyData(i, Difficulty(k))) spawnMasks[i] |= (1 << k); + _gameObjectDataStore.rehash(result->GetRowCount()); do { Field* fields = result->Fetch(); - uint32 guid = fields[ 0].GetUInt32(); - uint32 entry = fields[ 1].GetUInt32(); + uint32 guid = fields[0].GetUInt32(); + uint32 entry = fields[1].GetUInt32(); GameObjectTemplate const* gInfo = GetGameObjectTemplate(entry); if (!gInfo) @@ -1762,14 +1780,14 @@ void ObjectMgr::LoadGameobjects() GameObjectData& data = _gameObjectDataStore[guid]; data.id = entry; - data.mapid = fields[ 2].GetUInt32(); - data.posX = fields[ 3].GetFloat(); - data.posY = fields[ 4].GetFloat(); - data.posZ = fields[ 5].GetFloat(); - data.orientation = fields[ 6].GetFloat(); - data.rotation0 = fields[ 7].GetFloat(); - data.rotation1 = fields[ 8].GetFloat(); - data.rotation2 = fields[ 9].GetFloat(); + data.mapid = fields[2].GetUInt16(); + data.posX = fields[3].GetFloat(); + data.posY = fields[4].GetFloat(); + data.posZ = fields[5].GetFloat(); + data.orientation = fields[6].GetFloat(); + data.rotation0 = fields[7].GetFloat(); + data.rotation1 = fields[8].GetFloat(); + data.rotation2 = fields[9].GetFloat(); data.rotation3 = fields[10].GetFloat(); data.spawntimesecs = fields[11].GetInt32(); @@ -1785,10 +1803,10 @@ void ObjectMgr::LoadGameobjects() sLog->outErrorDb("Table `gameobject` has gameobject (GUID: %u Entry: %u) with `spawntimesecs` (0) value, but the gameobejct is marked as despawnable at action.", guid, data.id); } - data.animprogress = fields[12].GetUInt32(); + data.animprogress = fields[12].GetUInt8(); data.artKit = 0; - uint32 go_state = fields[13].GetUInt32(); + uint32 go_state = fields[13].GetUInt8(); if (go_state >= MAX_GO_STATE) { sLog->outErrorDb("Table `gameobject` has gameobject (GUID: %u Entry: %u) with invalid `state` (%u) value, skip", guid, data.id, go_state); @@ -1802,7 +1820,7 @@ void ObjectMgr::LoadGameobjects() sLog->outErrorDb("Table `gameobject` has gameobject (GUID: %u Entry: %u) that has wrong spawn mask %u including not supported difficulty modes for map (Id: %u), skip", guid, data.id, data.spawnMask, data.mapid); data.phaseMask = fields[15].GetUInt16(); - int16 gameEvent = fields[16].GetInt16(); + int16 gameEvent = fields[16].GetInt8(); uint32 PoolId = fields[17].GetUInt32(); if (data.rotation2 < -1.0f || data.rotation2 > 1.0f) @@ -1832,7 +1850,6 @@ void ObjectMgr::LoadGameobjects() if (gameEvent == 0 && PoolId == 0) // if not this is to be managed by GameEvent System or Pool system AddGameobjectToGrid(guid, &data); ++count; - } while (result->NextRow()); sLog->outString(">> Loaded %lu gameobjects in %u ms", (unsigned long)_gameObjectDataStore.size(), GetMSTimeDiffToNow(oldMSTime)); @@ -1903,7 +1920,7 @@ void ObjectMgr::LoadGameobjectRespawnTimes() uint32 oldMSTime = getMSTime(); // Remove outdated data - CharacterDatabase.DirectExecute(CharacterDatabase.GetPreparedStatement(CHAR_DEL_EXPIRED_GO_RESPAWNS)); + CharacterDatabase.DirectExecute("DELETE FROM gameobject_respawn WHERE respawnTime <= UNIX_TIMESTAMP(NOW())"); uint32 count = 0; @@ -1943,10 +1960,12 @@ uint64 ObjectMgr::GetPlayerGUIDByName(std::string name) const { uint64 guid = 0; - CharacterDatabase.EscapeString(name); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUID_BY_NAME); + + stmt->setString(0, name); + + PreparedQueryResult result = CharacterDatabase.Query(stmt); - // Player name safe to sending to DB (checked at login) and this function using - QueryResult result = CharacterDatabase.PQuery("SELECT guid FROM characters WHERE name = '%s'", name.c_str()); if (result) guid = MAKE_NEW_GUID((*result)[0].GetUInt32(), 0, HIGHGUID_PLAYER); @@ -1962,7 +1981,11 @@ bool ObjectMgr::GetPlayerNameByGUID(uint64 guid, std::string &name) const return true; } - QueryResult result = CharacterDatabase.PQuery("SELECT name FROM characters WHERE guid = '%u'", GUID_LOPART(guid)); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_NAME); + + stmt->setUInt32(0, GUID_LOPART(guid)); + + PreparedQueryResult result = CharacterDatabase.Query(stmt); if (result) { @@ -1981,7 +2004,11 @@ uint32 ObjectMgr::GetPlayerTeamByGUID(uint64 guid) const return Player::TeamForRace(player->getRace()); } - QueryResult result = CharacterDatabase.PQuery("SELECT race FROM characters WHERE guid = '%u'", GUID_LOPART(guid)); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_RACE); + + stmt->setUInt32(0, GUID_LOPART(guid)); + + PreparedQueryResult result = CharacterDatabase.Query(stmt); if (result) { @@ -2000,7 +2027,12 @@ uint32 ObjectMgr::GetPlayerAccountIdByGUID(uint64 guid) const return player->GetSession()->GetAccountId(); } - QueryResult result = CharacterDatabase.PQuery("SELECT account FROM characters WHERE guid = '%u'", GUID_LOPART(guid)); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ACCOUNT_BY_GUID); + + stmt->setUInt32(0, GUID_LOPART(guid)); + + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (result) { uint32 acc = (*result)[0].GetUInt32(); @@ -2012,7 +2044,12 @@ uint32 ObjectMgr::GetPlayerAccountIdByGUID(uint64 guid) const uint32 ObjectMgr::GetPlayerAccountIdByPlayerName(const std::string& name) const { - QueryResult result = CharacterDatabase.PQuery("SELECT account FROM characters WHERE name = '%s'", name.c_str()); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ACCOUNT_BY_NAME); + + stmt->setString(0, name); + + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (result) { uint32 acc = (*result)[0].GetUInt32(); @@ -2613,7 +2650,8 @@ void ObjectMgr::LoadItemSetNames() if (setEntry->itemId[i]) itemSetItems.insert(setEntry->itemId[i]); } - + + // 0 1 2 QueryResult result = WorldDatabase.Query("SELECT `entry`, `name`, `InventoryType` FROM `item_set_names`"); if (!result) @@ -2623,6 +2661,7 @@ void ObjectMgr::LoadItemSetNames() return; } + _itemSetNameStore.rehash(result->GetRowCount()); uint32 count = 0; do @@ -2639,7 +2678,7 @@ void ObjectMgr::LoadItemSetNames() ItemSetNameEntry &data = _itemSetNameStore[entry]; data.name = fields[1].GetString(); - uint32 invType = fields[2].GetUInt32(); + uint32 invType = fields[2].GetUInt8(); if (invType >= MAX_INVTYPE) { sLog->outErrorDb("Item set name (Entry: %u) has wrong InventoryType value (%u)", entry, invType); @@ -2684,6 +2723,7 @@ void ObjectMgr::LoadVehicleTemplateAccessories() uint32 count = 0; + // 0 1 2 3 4 5 QueryResult result = WorldDatabase.Query("SELECT `entry`, `accessory_entry`, `seat_id`, `minion`, `summontype`, `summontimer` FROM `vehicle_template_accessory`"); if (!result) @@ -2699,7 +2739,7 @@ void ObjectMgr::LoadVehicleTemplateAccessories() uint32 uiEntry = fields[0].GetUInt32(); uint32 uiAccessory = fields[1].GetUInt32(); - int8 uiSeat = int8(fields[2].GetInt16()); + int8 uiSeat = int8(fields[2].GetInt8()); bool bMinion = fields[3].GetBool(); uint8 uiSummonType = fields[4].GetUInt8(); uint32 uiSummonTimer= fields[5].GetUInt32(); @@ -2740,6 +2780,7 @@ void ObjectMgr::LoadVehicleAccessories() uint32 count = 0; + // 0 1 2 3 4 5 QueryResult result = WorldDatabase.Query("SELECT `guid`, `accessory_entry`, `seat_id`, `minion`, `summontype`, `summontimer` FROM `vehicle_accessory`"); if (!result) @@ -2781,7 +2822,7 @@ void ObjectMgr::LoadPetLevelInfo() uint32 oldMSTime = getMSTime(); // 0 1 2 3 4 5 6 7 8 9 - QueryResult result = WorldDatabase.Query("SELECT creature_entry, level, hp, mana, str, agi, sta, inte, spi, armor FROM pet_levelstats"); + QueryResult result = WorldDatabase.Query("SELECT creature_entry, level, hp, mana, str, agi, sta, inte, spi, armor FROM pet_levelstats"); if (!result) { @@ -2803,7 +2844,7 @@ void ObjectMgr::LoadPetLevelInfo() continue; } - uint32 current_level = fields[1].GetUInt32(); + uint32 current_level = fields[1].GetUInt8(); if (current_level > sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) { if (current_level > STRONG_MAX_LEVEL) // hardcoded level maximum @@ -2824,14 +2865,14 @@ void ObjectMgr::LoadPetLevelInfo() PetLevelInfo*& pInfoMapEntry = _petInfoStore[creature_id]; if (pInfoMapEntry == NULL) - pInfoMapEntry = new PetLevelInfo[sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)]; + pInfoMapEntry = new PetLevelInfo[sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)]; // data for level 1 stored in [0] array element, ... PetLevelInfo* pLevelInfo = &pInfoMapEntry[current_level-1]; pLevelInfo->health = fields[2].GetUInt16(); pLevelInfo->mana = fields[3].GetUInt16(); - pLevelInfo->armor = fields[9].GetUInt16(); + pLevelInfo->armor = fields[9].GetUInt32(); for (int i = 0; i < MAX_STATS; i++) { @@ -2927,7 +2968,7 @@ void ObjectMgr::LoadPlayerInfo() // Load playercreate { uint32 oldMSTime = getMSTime(); - // 0 1 2 3 4 5 6 + // 0 1 2 3 4 5 6 QueryResult result = WorldDatabase.Query("SELECT race, class, map, zone, position_x, position_y, position_z, orientation FROM playercreateinfo"); if (!result) @@ -2944,10 +2985,10 @@ void ObjectMgr::LoadPlayerInfo() { Field* fields = result->Fetch(); - uint32 current_race = fields[0].GetUInt32(); - uint32 current_class = fields[1].GetUInt32(); - uint32 mapId = fields[2].GetUInt32(); - uint32 areaId = fields[3].GetUInt32(); + uint32 current_race = fields[0].GetUInt8(); + uint32 current_class = fields[1].GetUInt8(); + uint32 mapId = fields[2].GetUInt16(); + uint32 areaId = fields[3].GetUInt32(); // zone float positionX = fields[4].GetFloat(); float positionY = fields[5].GetFloat(); float positionZ = fields[6].GetFloat(); @@ -3032,14 +3073,14 @@ void ObjectMgr::LoadPlayerInfo() { Field* fields = result->Fetch(); - uint32 current_race = fields[0].GetUInt32(); + uint32 current_race = fields[0].GetUInt8(); if (current_race >= MAX_RACES) { sLog->outErrorDb("Wrong race %u in `playercreateinfo_item` table, ignoring.", current_race); continue; } - uint32 current_class = fields[1].GetUInt32(); + uint32 current_class = fields[1].GetUInt8(); if (current_class >= MAX_CLASSES) { sLog->outErrorDb("Wrong class %u in `playercreateinfo_item` table, ignoring.", current_class); @@ -3048,13 +3089,13 @@ void ObjectMgr::LoadPlayerInfo() uint32 item_id = fields[2].GetUInt32(); - if (!sObjectMgr->GetItemTemplate(item_id)) + if (!GetItemTemplate(item_id)) { sLog->outErrorDb("Item id %u (race %u class %u) in `playercreateinfo_item` table but not listed in `item_template`, ignoring.", item_id, current_race, current_class); continue; } - int32 amount = fields[3].GetInt32(); + int32 amount = fields[3].GetInt8(); if (!amount) { @@ -3089,11 +3130,8 @@ void ObjectMgr::LoadPlayerInfo() { uint32 oldMSTime = getMSTime(); - QueryResult result = QueryResult(NULL); - if (sWorld->getBoolConfig(CONFIG_START_ALL_SPELLS)) - result = WorldDatabase.Query("SELECT race, class, Spell, Active FROM playercreateinfo_spell_custom"); - else - result = WorldDatabase.Query("SELECT race, class, Spell FROM playercreateinfo_spell"); + std::string tableName = sWorld->getBoolConfig(CONFIG_START_ALL_SPELLS) ? "playercreateinfo_spell_custom" : "playercreateinfo_spell"; + QueryResult result = WorldDatabase.PQuery("SELECT race, class, Spell FROM %s", tableName.c_str()); if (!result) { @@ -3108,14 +3146,14 @@ void ObjectMgr::LoadPlayerInfo() { Field* fields = result->Fetch(); - uint32 current_race = fields[0].GetUInt32(); + uint32 current_race = fields[0].GetUInt8(); if (current_race >= MAX_RACES) { sLog->outErrorDb("Wrong race %u in `playercreateinfo_spell` table, ignoring.", current_race); continue; } - uint32 current_class = fields[1].GetUInt32(); + uint32 current_class = fields[1].GetUInt8(); if (current_class >= MAX_CLASSES) { sLog->outErrorDb("Wrong class %u in `playercreateinfo_spell` table, ignoring.", current_class); @@ -3165,14 +3203,14 @@ void ObjectMgr::LoadPlayerInfo() { Field* fields = result->Fetch(); - uint32 current_race = fields[0].GetUInt32(); + uint32 current_race = fields[0].GetUInt8(); if (current_race >= MAX_RACES) { sLog->outErrorDb("Wrong race %u in `playercreateinfo_action` table, ignoring.", current_race); continue; } - uint32 current_class = fields[1].GetUInt32(); + uint32 current_class = fields[1].GetUInt8(); if (current_class >= MAX_CLASSES) { sLog->outErrorDb("Wrong class %u in `playercreateinfo_action` table, ignoring.", current_class); @@ -3180,7 +3218,7 @@ void ObjectMgr::LoadPlayerInfo() } PlayerInfo* pInfo = &_playerInfo[current_race][current_class]; - pInfo->action.push_back(PlayerCreateInfoAction(fields[2].GetUInt8(), fields[3].GetUInt32(), fields[4].GetUInt8())); + pInfo->action.push_back(PlayerCreateInfoAction(fields[2].GetUInt16(), fields[3].GetUInt32(), fields[4].GetUInt16())); ++count; } @@ -3212,7 +3250,7 @@ void ObjectMgr::LoadPlayerInfo() { Field* fields = result->Fetch(); - uint32 current_class = fields[0].GetUInt32(); + uint32 current_class = fields[0].GetUInt8(); if (current_class >= MAX_CLASSES) { sLog->outErrorDb("Wrong class %u in `player_classlevelstats` table, ignoring.", current_class); @@ -3293,21 +3331,21 @@ void ObjectMgr::LoadPlayerInfo() { Field* fields = result->Fetch(); - uint32 current_race = fields[0].GetUInt32(); + uint32 current_race = fields[0].GetUInt8(); if (current_race >= MAX_RACES) { sLog->outErrorDb("Wrong race %u in `player_levelstats` table, ignoring.", current_race); continue; } - uint32 current_class = fields[1].GetUInt32(); + uint32 current_class = fields[1].GetUInt8(); if (current_class >= MAX_CLASSES) { sLog->outErrorDb("Wrong class %u in `player_levelstats` table, ignoring.", current_class); continue; } - uint32 current_level = fields[2].GetUInt32(); + uint32 current_level = fields[2].GetUInt8(); if (current_level > sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) { if (current_level > STRONG_MAX_LEVEL) // hardcoded level maximum @@ -3411,7 +3449,7 @@ void ObjectMgr::LoadPlayerInfo() { Field* fields = result->Fetch(); - uint32 current_level = fields[0].GetUInt32(); + uint32 current_level = fields[0].GetUInt8(); uint32 current_xp = fields[1].GetUInt32(); if (current_level >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) @@ -3615,7 +3653,7 @@ void ObjectMgr::LoadQuests() { Field* fields = result->Fetch(); - Quest * newQuest = new Quest(fields); + Quest* newQuest = new Quest(fields); _questTemplates[newQuest->GetQuestId()] = newQuest; } while (result->NextRow()); @@ -3633,9 +3671,7 @@ void ObjectMgr::LoadQuests() // additional quest integrity checks (GO, creature_template and item_template must be loaded already) if (qinfo->GetQuestMethod() >= 3) - { sLog->outErrorDb("Quest %u has `Method` = %u, expected values are 0, 1 or 2.", qinfo->GetQuestId(), qinfo->GetQuestMethod()); - } if (qinfo->Flags & ~QUEST_TRINITY_FLAGS_DB_ALLOWED) { @@ -4466,9 +4502,8 @@ void ObjectMgr::LoadScripts(ScriptsType type) scripts->clear(); // need for reload support bool isSpellScriptTable = (type == SCRIPTS_SPELL); - char buff[125]; - sprintf(buff, "SELECT id, delay, command, datalong, datalong2, dataint, x, y, z, o%s FROM %s", isSpellScriptTable ? ", effIndex" : "", tableName.c_str()); - QueryResult result = WorldDatabase.Query(buff); + // 0 1 2 3 4 5 6 7 8 9 + QueryResult result = WorldDatabase.PQuery("SELECT id, delay, command, datalong, datalong2, dataint, x, y, z, o%s FROM %s", isSpellScriptTable ? ", effIndex" : "", tableName.c_str()); if (!result) { @@ -4481,7 +4516,6 @@ void ObjectMgr::LoadScripts(ScriptsType type) do { - Field* fields = result->Fetch(); ScriptInfo tmp; tmp.type = type; @@ -4881,7 +4915,9 @@ void ObjectMgr::LoadWaypointScripts() for (ScriptMapMap::const_iterator itr = sWaypointScripts.begin(); itr != sWaypointScripts.end(); ++itr) actionSet.insert(itr->first); - QueryResult result = WorldDatabase.PQuery("SELECT DISTINCT(`action`) FROM waypoint_data"); + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WOLRD_SEL_WAYPOINT_DATA_ACTION); + PreparedQueryResult result = WorldDatabase.Query(stmt); + if (result) { do @@ -4890,8 +4926,8 @@ void ObjectMgr::LoadWaypointScripts() uint32 action = fields[0].GetUInt32(); actionSet.erase(action); - - } while (result->NextRow()); + } + while (result->NextRow()); } for (std::set::iterator itr = actionSet.begin(); itr != actionSet.end(); ++itr) @@ -5022,6 +5058,7 @@ void ObjectMgr::LoadPageTexts() { uint32 oldMSTime = getMSTime(); + // 0 1 2 QueryResult result = WorldDatabase.Query("SELECT entry, text, next_page FROM page_text"); if (!result) @@ -5036,10 +5073,10 @@ void ObjectMgr::LoadPageTexts() { Field* fields = result->Fetch(); - PageText& pageText = _pageTextStore[fields[0].GetUInt32()]; + PageText& pageText = _pageTextStore[fields[0].GetUInt32()]; pageText.Text = fields[1].GetString(); - pageText.NextPage = fields[2].GetInt16(); + pageText.NextPage = fields[2].GetUInt32(); ++count; } @@ -5100,6 +5137,7 @@ void ObjectMgr::LoadInstanceTemplate() { uint32 oldMSTime = getMSTime(); + // 0 1 2 4 QueryResult result = WorldDatabase.Query("SELECT map, parent, script, allowMount FROM instance_template"); if (!result) @@ -5151,6 +5189,7 @@ void ObjectMgr::LoadInstanceEncounters() { uint32 oldMSTime = getMSTime(); + // 0 1 2 3 QueryResult result = WorldDatabase.Query("SELECT entry, creditType, creditEntry, lastEncounterDungeon FROM instance_encounters"); if (!result) { @@ -5167,7 +5206,7 @@ void ObjectMgr::LoadInstanceEncounters() uint32 entry = fields[0].GetUInt32(); uint8 creditType = fields[1].GetUInt8(); uint32 creditEntry = fields[2].GetUInt32(); - uint32 lastEncounterDungeon = fields[3].GetUInt32(); + uint32 lastEncounterDungeon = fields[3].GetUInt16(); DungeonEncounterEntry const* dungeonEncounter = sDungeonEncounterStore.LookupEntry(entry); if (!dungeonEncounter) { @@ -5244,11 +5283,11 @@ void ObjectMgr::LoadGossipText() int count = 0; if (!result) { - sLog->outString(">> Loaded %u npc texts", count); sLog->outString(); return; } + _gossipTextStore.rehash(result->GetRowCount()); int cic; @@ -5273,13 +5312,13 @@ void ObjectMgr::LoadGossipText() gText.Options[i].Text_0 = fields[cic++].GetString(); gText.Options[i].Text_1 = fields[cic++].GetString(); - gText.Options[i].Language = fields[cic++].GetUInt32(); + gText.Options[i].Language = fields[cic++].GetUInt8(); gText.Options[i].Probability = fields[cic++].GetFloat(); for (uint8 j=0; j < MAX_GOSSIP_TEXT_EMOTES; ++j) { - gText.Options[i].Emotes[j]._Delay = fields[cic++].GetUInt32(); - gText.Options[i].Emotes[j]._Emote = fields[cic++].GetUInt32(); + gText.Options[i].Emotes[j]._Delay = fields[cic++].GetUInt16(); + gText.Options[i].Emotes[j]._Emote = fields[cic++].GetUInt16(); } } } while (result->NextRow()); @@ -5360,7 +5399,7 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp) std::map itemsCache; stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_EXPIRED_MAIL_ITEMS); - stmt->setUInt64(0, basetime); + stmt->setUInt32(0, (uint32)basetime); if (PreparedQueryResult items = CharacterDatabase.Query(stmt)) { MailItemInfo item; @@ -5378,18 +5417,17 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp) uint32 returnedCount = 0; do { - Field* fields = result->Fetch(); Mail* m = new Mail; - m->messageID = fields[0].GetUInt32(); - m->messageType = fields[1].GetUInt8(); - m->sender = fields[2].GetUInt32(); - m->receiver = fields[3].GetUInt32(); - bool has_items = fields[4].GetBool(); - m->expire_time = time_t(fields[5].GetUInt32()); - m->deliver_time = 0; - m->COD = fields[6].GetUInt32(); - m->checked = fields[7].GetUInt32(); + m->messageID = fields[0].GetUInt32(); + m->messageType = fields[1].GetUInt8(); + m->sender = fields[2].GetUInt32(); + m->receiver = fields[3].GetUInt32(); + bool has_items = fields[4].GetBool(); + m->expire_time = time_t(fields[5].GetUInt32()); + m->deliver_time = 0; + m->COD = fields[6].GetUInt32(); + m->checked = fields[7].GetUInt8(); m->mailTemplateId = fields[8].GetInt16(); Player* player = NULL; @@ -5426,8 +5464,8 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp) stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_MAIL_RETURNED); stmt->setUInt32(0, m->receiver); stmt->setUInt32(1, m->sender); - stmt->setUInt64(2, basetime + 30 * DAY); - stmt->setUInt64(3, basetime); + stmt->setUInt32(2, basetime + 30 * DAY); + stmt->setUInt32(3, basetime); stmt->setUInt8 (4, uint8(MAIL_CHECK_MASK_RETURNED)); stmt->setUInt32(5, m->messageID); CharacterDatabase.Execute(stmt); @@ -5450,7 +5488,7 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp) } } - stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_MAIL); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_MAIL_BY_ID); stmt->setUInt32(0, m->messageID); CharacterDatabase.Execute(stmt); delete m; @@ -5697,7 +5735,7 @@ uint32 ObjectMgr::GetTaxiMountDisplayId(uint32 id, uint32 team, bool allowed_alt } // minfo is not actually used but the mount_id was updated - sObjectMgr->GetCreatureModelRandomGender(&mount_id); + GetCreatureModelRandomGender(&mount_id); return mount_id; } @@ -5708,6 +5746,7 @@ void ObjectMgr::LoadGraveyardZones() GraveYardStore.clear(); // need for reload case + // 0 1 2 QueryResult result = WorldDatabase.Query("SELECT id, ghost_zone, faction FROM game_graveyard_zone"); if (!result) @@ -5727,7 +5766,7 @@ void ObjectMgr::LoadGraveyardZones() uint32 safeLocId = fields[0].GetUInt32(); uint32 zoneId = fields[1].GetUInt32(); - uint32 team = fields[2].GetUInt32(); + uint32 team = fields[2].GetUInt16(); WorldSafeLocsEntry const* entry = sWorldSafeLocsStore.LookupEntry(safeLocId); if (!entry) @@ -5845,10 +5884,10 @@ WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveYard(float x, float y, float if (MapId != entry->map_id) { // if find graveyard at different map from where entrance placed (or no entrance data), use any first - if (!mapEntry || - mapEntry->entrance_map < 0 || - uint32(mapEntry->entrance_map) != entry->map_id || - (mapEntry->entrance_x == 0 && mapEntry->entrance_y == 0)) + if (!mapEntry + || mapEntry->entrance_map < 0 + || uint32(mapEntry->entrance_map) != entry->map_id + || (mapEntry->entrance_x == 0 && mapEntry->entrance_y == 0)) { // not have any corrdinates for check distance anyway entryFar = entry; @@ -5993,8 +6032,6 @@ void ObjectMgr::RemoveGraveYardLink(uint32 id, uint32 zoneId, uint32 team, bool WorldDatabase.Execute(stmt); } - - return; } void ObjectMgr::LoadAreaTriggerTeleports() @@ -6024,7 +6061,7 @@ void ObjectMgr::LoadAreaTriggerTeleports() AreaTrigger at; - at.target_mapId = fields[1].GetUInt32(); + at.target_mapId = fields[1].GetUInt16(); at.target_X = fields[2].GetFloat(); at.target_Y = fields[3].GetFloat(); at.target_Z = fields[4].GetFloat(); @@ -6064,7 +6101,7 @@ void ObjectMgr::LoadAccessRequirements() _accessRequirementStore.clear(); // need for reload case - // 0 1 2 3 4 5 6 7 8 9 + // 0 1 2 3 4 5 6 7 8 9 QueryResult result = WorldDatabase.Query("SELECT mapid, difficulty, level_min, level_max, item, item2, quest_done_A, quest_done_H, completed_achievement, quest_failed_text FROM access_requirement"); if (!result) { @@ -6098,7 +6135,7 @@ void ObjectMgr::LoadAccessRequirements() if (ar.item) { - ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(ar.item); + ItemTemplate const* pProto = GetItemTemplate(ar.item); if (!pProto) { sLog->outError("Key item %u does not exist for map %u difficulty %u, removing key requirement.", ar.item, mapid, difficulty); @@ -6108,7 +6145,7 @@ void ObjectMgr::LoadAccessRequirements() if (ar.item2) { - ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(ar.item2); + ItemTemplate const* pProto = GetItemTemplate(ar.item2); if (!pProto) { sLog->outError("Second item %u does not exist for map %u difficulty %u, removing key requirement.", ar.item2, mapid, difficulty); @@ -6215,10 +6252,10 @@ void ObjectMgr::SetHighestGuids() _hiItemGuid = (*result)[0].GetUInt32()+1; // Cleanup other tables from not existed guids ( >= _hiItemGuid) - CharacterDatabase.PExecute("DELETE FROM character_inventory WHERE item >= '%u'", _hiItemGuid); // One-time query - CharacterDatabase.PExecute("DELETE FROM mail_items WHERE item_guid >= '%u'", _hiItemGuid); // One-time query - CharacterDatabase.PExecute("DELETE FROM auctionhouse WHERE itemguid >= '%u'", _hiItemGuid); // One-time query - CharacterDatabase.PExecute("DELETE FROM guild_bank_item WHERE item_guid >= '%u'", _hiItemGuid); // One-time query + CharacterDatabase.PExecute("DELETE FROM character_inventory WHERE item >= '%u'", _hiItemGuid); // One-time query + CharacterDatabase.PExecute("DELETE FROM mail_items WHERE item_guid >= '%u'", _hiItemGuid); // One-time query + CharacterDatabase.PExecute("DELETE FROM auctionhouse WHERE itemguid >= '%u'", _hiItemGuid); // One-time query + CharacterDatabase.PExecute("DELETE FROM guild_bank_item WHERE item_guid >= '%u'", _hiItemGuid); // One-time query result = WorldDatabase.Query("SELECT MAX(guid) FROM gameobject"); if (result) @@ -6292,74 +6329,54 @@ uint32 ObjectMgr::GenerateLowGuid(HighGuid guidhigh) switch (guidhigh) { case HIGHGUID_ITEM: - if (_hiItemGuid >= 0xFFFFFFFE) - { - sLog->outError("Item guid overflow!! Can't continue, shutting down server. "); - World::StopNow(ERROR_EXIT_CODE); - } + { + ASSERT(_hiItemGuid < 0xFFFFFFFE && "Item guid overflow!"); return _hiItemGuid++; + } case HIGHGUID_UNIT: - if (_hiCreatureGuid >= 0x00FFFFFE) - { - sLog->outError("Creature guid overflow!! Can't continue, shutting down server. "); - World::StopNow(ERROR_EXIT_CODE); - } + { + ASSERT(_hiCreatureGuid < 0x00FFFFFE && "Creature guid overflow!"); return _hiCreatureGuid++; + } case HIGHGUID_PET: - if (_hiPetGuid >= 0x00FFFFFE) - { - sLog->outError("Pet guid overflow!! Can't continue, shutting down server. "); - World::StopNow(ERROR_EXIT_CODE); - } + { + ASSERT(_hiPetGuid < 0x00FFFFFE && "Pet guid overflow!"); return _hiPetGuid++; + } case HIGHGUID_VEHICLE: - if (_hiVehicleGuid >= 0x00FFFFFF) - { - sLog->outError("Vehicle guid overflow!! Can't continue, shutting down server. "); - World::StopNow(ERROR_EXIT_CODE); - } + { + ASSERT(_hiVehicleGuid < 0x00FFFFFF && "Vehicle guid overflow!"); return _hiVehicleGuid++; + } case HIGHGUID_PLAYER: - if (_hiCharGuid >= 0xFFFFFFFE) - { - sLog->outError("Players guid overflow!! Can't continue, shutting down server. "); - World::StopNow(ERROR_EXIT_CODE); - } + { + ASSERT(_hiCharGuid < 0xFFFFFFFE && "Player guid overflow!"); return _hiCharGuid++; + } case HIGHGUID_GAMEOBJECT: - if (_hiGoGuid >= 0x00FFFFFE) - { - sLog->outError("Gameobject guid overflow!! Can't continue, shutting down server. "); - World::StopNow(ERROR_EXIT_CODE); - } + { + ASSERT(_hiGoGuid < 0x00FFFFFE && "Gameobject guid overflow!"); return _hiGoGuid++; + } case HIGHGUID_CORPSE: - if (_hiCorpseGuid >= 0xFFFFFFFE) - { - sLog->outError("Corpse guid overflow!! Can't continue, shutting down server. "); - World::StopNow(ERROR_EXIT_CODE); - } + { + ASSERT(_hiCorpseGuid < 0xFFFFFFFE && "Corpse guid overflow!"); return _hiCorpseGuid++; + } case HIGHGUID_DYNAMICOBJECT: - if (_hiDoGuid >= 0xFFFFFFFE) - { - sLog->outError("DynamicObject guid overflow!! Can't continue, shutting down server. "); - World::StopNow(ERROR_EXIT_CODE); - } + { + ASSERT(_hiDoGuid < 0xFFFFFFFE && "DynamicObject guid overflow!"); return _hiDoGuid++; + } case HIGHGUID_MO_TRANSPORT: - if (_hiMoTransGuid >= 0xFFFFFFFE) - { - sLog->outError("MO Transport guid overflow!! Can't continue, shutting down server. "); - World::StopNow(ERROR_EXIT_CODE); - } + { + ASSERT(_hiMoTransGuid < 0xFFFFFFFE && "MO Transport guid overflow!"); return _hiMoTransGuid++; + } default: - ASSERT(0); + ASSERT(false && "ObjectMgr::GenerateLowGuid - Unknown HIGHGUID type"); + return 0; } - - ASSERT(0); - return 0; } void ObjectMgr::LoadGameObjectLocales() @@ -6475,6 +6492,7 @@ void ObjectMgr::LoadGameObjectTemplate() return; } + _gameObjectTemplateStore.rehash(result->GetRowCount()); uint32 count = 0; do { @@ -6513,13 +6531,13 @@ void ObjectMgr::LoadGameObjectTemplate() { if (got.door.lockId) CheckGOLockId(&got, got.door.lockId, 1); - CheckGONoDamageImmuneId(&got, got.door.noDamageImmune, 3); + CheckGONoDamageImmuneId(&got, got.door.noDamageImmune, 3); break; } case GAMEOBJECT_TYPE_BUTTON: //1 { if (got.button.lockId) - CheckGOLockId(&got, got.button.lockId, 1); + CheckGOLockId(&got, got.button.lockId, 1); CheckGONoDamageImmuneId(&got, got.button.noDamageImmune, 4); break; } @@ -6661,10 +6679,9 @@ void ObjectMgr::LoadExplorationBaseXP() do { - Field* fields = result->Fetch(); uint8 level = fields[0].GetUInt8(); - uint32 basexp = fields[1].GetUInt32(); + uint32 basexp = fields[1].GetInt32(); _baseXPTable[level] = basexp; ++count; } @@ -6689,7 +6706,7 @@ uint32 ObjectMgr::GetXPForLevel(uint8 level) void ObjectMgr::LoadPetNames() { uint32 oldMSTime = getMSTime(); - + // 0 1 2 QueryResult result = WorldDatabase.Query("SELECT word, entry, half FROM pet_name_generation"); if (!result) @@ -6703,7 +6720,6 @@ void ObjectMgr::LoadPetNames() do { - Field* fields = result->Fetch(); std::string word = fields[0].GetString(); uint32 entry = fields[1].GetUInt32(); @@ -6807,7 +6823,7 @@ void ObjectMgr::LoadReputationRewardRate() _repRewardRateStore.clear(); // for reload case - uint32 count = 0; + uint32 count = 0; // 0 1 2 3 QueryResult result = WorldDatabase.Query("SELECT faction, quest_rate, creature_rate, spell_rate FROM reputation_reward_rate"); if (!result) @@ -6819,7 +6835,6 @@ void ObjectMgr::LoadReputationRewardRate() do { - Field* fields = result->Fetch(); uint32 factionId = fields[0].GetUInt32(); @@ -6894,13 +6909,13 @@ void ObjectMgr::LoadReputationOnKill() uint32 creature_id = fields[0].GetUInt32(); ReputationOnKillEntry repOnKill; - repOnKill.RepFaction1 = fields[1].GetUInt32(); - repOnKill.RepFaction2 = fields[2].GetUInt32(); + repOnKill.RepFaction1 = fields[1].GetInt16(); + repOnKill.RepFaction2 = fields[2].GetInt16(); repOnKill.IsTeamAward1 = fields[3].GetBool(); - repOnKill.ReputationMaxCap1 = fields[4].GetUInt32(); + repOnKill.ReputationMaxCap1 = fields[4].GetUInt8(); repOnKill.RepValue1 = fields[5].GetInt32(); repOnKill.IsTeamAward2 = fields[6].GetBool(); - repOnKill.ReputationMaxCap2 = fields[7].GetUInt32(); + repOnKill.ReputationMaxCap2 = fields[7].GetUInt8(); repOnKill.RepValue2 = fields[8].GetInt32(); repOnKill.TeamDependent = fields[9].GetUInt8(); @@ -6945,7 +6960,7 @@ void ObjectMgr::LoadReputationSpilloverTemplate() _repSpilloverTemplateStore.clear(); // for reload case - uint32 count = 0; + uint32 count = 0; // 0 1 2 3 4 5 6 7 8 9 10 11 12 QueryResult result = WorldDatabase.Query("SELECT faction, faction1, rate_1, rank_1, faction2, rate_2, rank_2, faction3, rate_3, rank_3, faction4, rate_4, rank_4 FROM reputation_spillover_template"); if (!result) @@ -6957,25 +6972,24 @@ void ObjectMgr::LoadReputationSpilloverTemplate() do { - Field* fields = result->Fetch(); - uint32 factionId = fields[0].GetUInt32(); + uint32 factionId = fields[0].GetUInt16(); RepSpilloverTemplate repTemplate; - repTemplate.faction[0] = fields[1].GetUInt32(); + repTemplate.faction[0] = fields[1].GetUInt16(); repTemplate.faction_rate[0] = fields[2].GetFloat(); - repTemplate.faction_rank[0] = fields[3].GetUInt32(); - repTemplate.faction[1] = fields[4].GetUInt32(); + repTemplate.faction_rank[0] = fields[3].GetUInt8(); + repTemplate.faction[1] = fields[4].GetUInt16(); repTemplate.faction_rate[1] = fields[5].GetFloat(); - repTemplate.faction_rank[1] = fields[6].GetUInt32(); - repTemplate.faction[2] = fields[7].GetUInt32(); + repTemplate.faction_rank[1] = fields[6].GetUInt8(); + repTemplate.faction[2] = fields[7].GetUInt16(); repTemplate.faction_rate[2] = fields[8].GetFloat(); - repTemplate.faction_rank[2] = fields[9].GetUInt32(); - repTemplate.faction[3] = fields[10].GetUInt32(); + repTemplate.faction_rank[2] = fields[9].GetUInt8(); + repTemplate.faction[3] = fields[10].GetUInt16(); repTemplate.faction_rate[3] = fields[11].GetFloat(); - repTemplate.faction_rank[3] = fields[12].GetUInt32(); + repTemplate.faction_rank[3] = fields[12].GetUInt8(); FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionId); @@ -7060,7 +7074,7 @@ void ObjectMgr::LoadPointsOfInterest() uint32 count = 0; - // 0 1 2 3 4 5 6 + // 0 1 2 3 4 5 6 QueryResult result = WorldDatabase.Query("SELECT entry, x, y, icon, flags, data, icon_name FROM points_of_interest"); if (!result) @@ -7077,12 +7091,12 @@ void ObjectMgr::LoadPointsOfInterest() uint32 point_id = fields[0].GetUInt32(); PointOfInterest POI; - POI.x = fields[1].GetFloat(); - POI.y = fields[2].GetFloat(); - POI.icon = fields[3].GetUInt32(); - POI.flags = fields[4].GetUInt32(); - POI.data = fields[5].GetUInt32(); - POI.icon_name = fields[6].GetString(); + POI.x = fields[1].GetFloat(); + POI.y = fields[2].GetFloat(); + POI.icon = fields[3].GetUInt32(); + POI.flags = fields[4].GetUInt32(); + POI.data = fields[5].GetUInt32(); + POI.icon_name = fields[6].GetString(); if (!Trinity::IsValidMapCoord(POI.x, POI.y)) { @@ -7117,8 +7131,8 @@ void ObjectMgr::LoadQuestPOI() return; } - // 0 1 2 3 - QueryResult points = WorldDatabase.PQuery("SELECT questId, id, x, y FROM quest_poi_points ORDER BY questId DESC, idx"); + // 0 1 2 3 + QueryResult points = WorldDatabase.Query("SELECT questId, id, x, y FROM quest_poi_points ORDER BY questId DESC, idx"); std::vector > > POIs; @@ -7131,7 +7145,6 @@ void ObjectMgr::LoadQuestPOI() do { - fields = points->Fetch(); uint32 questId = fields[0].GetUInt32(); @@ -7177,7 +7190,7 @@ void ObjectMgr::LoadNPCSpellClickSpells() uint32 oldMSTime = getMSTime(); _spellClickInfoStore.clear(); - // 0 1 2 3 + // 0 1 2 3 QueryResult result = WorldDatabase.Query("SELECT npc_entry, spell_id, cast_flags, user_type FROM npc_spellclick_spells"); if (!result) @@ -7209,7 +7222,7 @@ void ObjectMgr::LoadNPCSpellClickSpells() continue; } - uint8 userType = fields[3].GetUInt8(); + uint8 userType = fields[3].GetUInt16(); if (userType >= SPELL_CLICK_USER_MAX) sLog->outErrorDb("Table npc_spellclick_spells references unknown user type %u. Skipping entry.", uint32(userType)); @@ -7256,9 +7269,9 @@ void ObjectMgr::SaveCreatureRespawnTime(uint32 loguid, uint32 instance, time_t t _creatureRespawnTimesMutex.release(); } - PreparedStatement *stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_CREATURE_RESPAWN); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_CREATURE_RESPAWN); stmt->setUInt32(0, loguid); - stmt->setUInt64(1, uint64(t)); + stmt->setUInt32(1, uint32(t)); stmt->setUInt32(2, instance); CharacterDatabase.Execute(stmt); } @@ -7272,7 +7285,7 @@ void ObjectMgr::RemoveCreatureRespawnTime(uint32 loguid, uint32 instance) _creatureRespawnTimesMutex.release(); } - PreparedStatement *stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CREATURE_RESPAWN); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CREATURE_RESPAWN); stmt->setUInt32(0, loguid); stmt->setUInt32(1, instance); CharacterDatabase.Execute(stmt); @@ -7410,7 +7423,6 @@ void ObjectMgr::LoadQuestRelationsHelper(QuestRelations& map, std::string table, do { - uint32 id = result->Fetch()[0].GetUInt32(); uint32 quest = result->Fetch()[1].GetUInt32(); uint32 poolId = result->Fetch()[2].GetUInt32(); @@ -7733,7 +7745,7 @@ void ObjectMgr::LoadGameObjectForQuests() sLog->outString(); } -bool ObjectMgr::LoadTrinityStrings(char const* table, int32 min_value, int32 max_value) +bool ObjectMgr::LoadTrinityStrings(const char* table, int32 min_value, int32 max_value) { uint32 oldMSTime = getMSTime(); @@ -7775,7 +7787,6 @@ bool ObjectMgr::LoadTrinityStrings(char const* table, int32 min_value, int32 max if (!result) { - if (min_value == MIN_TRINITY_STRING_ID) // error only in case internal strings sLog->outErrorDb(">> Loaded 0 trinity strings. DB table `%s` is empty. Cannot continue.", table); else @@ -7863,10 +7874,9 @@ void ObjectMgr::LoadFishingBaseSkillLevel() do { - Field* fields = result->Fetch(); uint32 entry = fields[0].GetUInt32(); - int32 skill = fields[1].GetInt32(); + int32 skill = fields[1].GetInt16(); AreaTableEntry const* fArea = GetAreaEntryByAreaID(entry); if (!fArea) @@ -7893,7 +7903,7 @@ bool ObjectMgr::CheckDeclinedNames(std::wstring w_ownname, DeclinedName const& n bool y = true; // check declined names - for (uint8 i =0; i < MAX_DECLINED_NAME_CASES; ++i) + for (uint8 i = 0; i < MAX_DECLINED_NAME_CASES; ++i) { std::wstring wname; if (!Utf8toWStr(names.name[i], wname)) @@ -7959,6 +7969,7 @@ void ObjectMgr::LoadGameTele() _gameTeleStore.clear(); // for reload case + // 0 1 2 3 4 5 6 QueryResult result = WorldDatabase.Query("SELECT id, position_x, position_y, position_z, orientation, map, name FROM game_tele"); if (!result) @@ -7972,7 +7983,6 @@ void ObjectMgr::LoadGameTele() do { - Field* fields = result->Fetch(); uint32 id = fields[0].GetUInt32(); @@ -7983,7 +7993,7 @@ void ObjectMgr::LoadGameTele() gt.position_y = fields[2].GetFloat(); gt.position_z = fields[3].GetFloat(); gt.orientation = fields[4].GetFloat(); - gt.mapId = fields[5].GetUInt32(); + gt.mapId = fields[5].GetUInt16(); gt.name = fields[6].GetString(); if (!MapManager::IsValidMapCoord(gt.mapId, gt.position_x, gt.position_y, gt.position_z, gt.orientation)) @@ -8015,7 +8025,7 @@ GameTele const* ObjectMgr::GetGameTele(const std::string& name) const // explicit name case std::wstring wname; if (!Utf8toWStr(name, wname)) - return false; + return NULL; // converting string that we try to find to lower case wstrToLower(wname); @@ -8100,6 +8110,7 @@ void ObjectMgr::LoadMailLevelRewards() _mailLevelRewardStore.clear(); // for reload case + // 0 1 2 3 QueryResult result = WorldDatabase.Query("SELECT level, raceMask, mailTemplateId, senderEntry FROM mail_level_reward"); if (!result) @@ -8113,7 +8124,6 @@ void ObjectMgr::LoadMailLevelRewards() do { - Field* fields = result->Fetch(); uint8 level = fields[0].GetUInt8(); @@ -8257,20 +8267,18 @@ void ObjectMgr::LoadTrainerSpell() do { - Field* fields = result->Fetch(); uint32 entry = fields[0].GetUInt32(); uint32 spell = fields[1].GetUInt32(); uint32 spellCost = fields[2].GetUInt32(); - uint32 reqSkill = fields[3].GetUInt32(); - uint32 reqSkillValue = fields[4].GetUInt32(); - uint32 reqLevel = fields[5].GetUInt32(); + uint32 reqSkill = fields[3].GetUInt16(); + uint32 reqSkillValue = fields[4].GetUInt16(); + uint32 reqLevel = fields[5].GetUInt8(); AddSpellToTrainer(entry, spell, spellCost, reqSkill, reqSkillValue, reqLevel); - count++; - + ++count; } while (result->NextRow()); @@ -8281,7 +8289,10 @@ void ObjectMgr::LoadTrainerSpell() int ObjectMgr::LoadReferenceVendor(int32 vendor, int32 item, std::set *skip_vendors) { // find all items from the reference vendor - QueryResult result = WorldDatabase.PQuery("SELECT item, maxcount, incrtime, ExtendedCost FROM npc_vendor WHERE entry='%d' ORDER BY slot ASC", item); + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_NPC_VENDOR_REF); + stmt->setUInt32(0, uint32(item)); + PreparedQueryResult result = WorldDatabase.Query(stmt); + if (!result) return 0; @@ -8297,7 +8308,7 @@ int ObjectMgr::LoadReferenceVendor(int32 vendor, int32 item, std::set *s count += LoadReferenceVendor(vendor, -item_id, skip_vendors); else { - int32 maxcount = fields[1].GetInt32(); + int32 maxcount = fields[1].GetUInt8(); uint32 incrtime = fields[2].GetUInt32(); uint32 ExtendedCost = fields[3].GetUInt32(); @@ -8309,7 +8320,6 @@ int ObjectMgr::LoadReferenceVendor(int32 vendor, int32 item, std::set *s vList.AddItem(item_id, maxcount, incrtime, ExtendedCost); ++count; } - } while (result->NextRow()); return count; @@ -8348,7 +8358,7 @@ void ObjectMgr::LoadVendors() count += LoadReferenceVendor(entry, -item_id, &skip_vendors); else { - int32 maxcount = fields[2].GetInt32(); + uint32 maxcount = fields[2].GetUInt8(); uint32 incrtime = fields[3].GetUInt32(); uint32 ExtendedCost = fields[4].GetUInt32(); @@ -8360,7 +8370,6 @@ void ObjectMgr::LoadVendors() vList.AddItem(item_id, maxcount, incrtime, ExtendedCost); ++count; } - } while (result->NextRow()); @@ -8387,12 +8396,11 @@ void ObjectMgr::LoadGossipMenu() do { - Field* fields = result->Fetch(); GossipMenus gMenu; - gMenu.entry = fields[0].GetUInt32(); + gMenu.entry = fields[0].GetUInt16(); gMenu.text_id = fields[1].GetUInt32(); if (!GetGossipText(gMenu.text_id)) @@ -8418,7 +8426,9 @@ void ObjectMgr::LoadGossipMenuItems() _gossipMenuItemsStore.clear(); QueryResult result = WorldDatabase.Query( + // 0 1 2 3 4 "SELECT menu_id, id, option_icon, option_text, option_id, npc_option_npcflag, " + // 5 6 7 8 9 "action_menu_id, action_poi_id, box_coded, box_money, box_text " "FROM gossip_menu_option ORDER BY menu_id, id"); @@ -8437,11 +8447,11 @@ void ObjectMgr::LoadGossipMenuItems() GossipMenuItems gMenuItem; - gMenuItem.MenuId = fields[0].GetUInt32(); - gMenuItem.OptionIndex = fields[1].GetUInt32(); - gMenuItem.OptionIcon = fields[2].GetUInt8(); + gMenuItem.MenuId = fields[0].GetUInt16(); + gMenuItem.OptionIndex = fields[1].GetUInt16(); + gMenuItem.OptionIcon = fields[2].GetUInt32(); gMenuItem.OptionText = fields[3].GetString(); - gMenuItem.OptionType = fields[4].GetUInt32(); + gMenuItem.OptionType = fields[4].GetUInt8(); gMenuItem.OptionNpcflag = fields[5].GetUInt32(); gMenuItem.ActionMenuId = fields[6].GetUInt32(); gMenuItem.ActionPoiId = fields[7].GetUInt32(); @@ -8656,10 +8666,13 @@ uint32 ObjectMgr::GetScriptId(const char *name) { // use binary search to find the script name in the sorted vector // assume "" is the first element - if (!name) return 0; - ScriptNameContainer::const_iterator itr = - std::lower_bound(_scriptNamesStore.begin(), _scriptNamesStore.end(), name); - if (itr == _scriptNamesStore.end() || *itr != name) return 0; + if (!name) + return 0; + + ScriptNameContainer::const_iterator itr = std::lower_bound(_scriptNamesStore.begin(), _scriptNamesStore.end(), name); + if (itr == _scriptNamesStore.end() || *itr != name) + return 0; + return uint32(itr - _scriptNamesStore.begin()); } @@ -8668,6 +8681,7 @@ void ObjectMgr::CheckScripts(ScriptsType type, std::set& ids) ScriptMapMap* scripts = GetScriptsMapByType(type); if (!scripts) return; + for (ScriptMapMap::const_iterator itrMM = scripts->begin(); itrMM != scripts->end(); ++itrMM) { for (ScriptMap::const_iterator itrM = itrMM->second.begin(); itrM != itrMM->second.end(); ++itrM) @@ -8706,7 +8720,7 @@ void ObjectMgr::LoadDbScriptStrings() sLog->outErrorDb("Table `db_script_string` has unused string id %u", *itr); } -bool LoadTrinityStrings(char const* table, int32 start_value, int32 end_value) +bool LoadTrinityStrings(const char* table, int32 start_value, int32 end_value) { // MAX_DB_SCRIPT_STRING_ID is max allowed negative value for scripts (scrpts can use only more deep negative values // start/end reversed for negative values @@ -8758,16 +8772,16 @@ void ObjectMgr::LoadCreatureClassLevelStats() { Field* fields = result->Fetch(); - uint8 Level = fields[0].GetUInt8(); - uint8 Class = fields[1].GetUInt8(); + uint8 Level = fields[0].GetInt8(); + uint8 Class = fields[1].GetInt8(); CreatureBaseStats stats; for (uint8 i = 0; i < MAX_CREATURE_BASE_HP; ++i) - stats.BaseHealth[i] = fields[i + 2].GetUInt32(); + stats.BaseHealth[i] = fields[i + 2].GetInt16(); - stats.BaseMana = fields[5].GetUInt32(); - stats.BaseArmor = fields[6].GetUInt32(); + stats.BaseMana = fields[5].GetInt16(); + stats.BaseArmor = fields[6].GetInt16(); if (!Class || ((1 << (Class - 1)) & CLASSMASK_ALL_CREATURES) == 0) sLog->outErrorDb("Creature base stats for level %u has invalid class %u", Level, Class); diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index ae699a01da7..9ab7898573f 100755 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -526,6 +526,7 @@ struct GraveYardData uint32 safeLocId; uint32 team; }; + typedef std::multimap GraveYardContainer; typedef UNORDERED_MAP CacheVendorItemContainer; @@ -649,7 +650,7 @@ class ObjectMgr return NULL; } - InstanceTemplate const* GetInstanceTemplate(uint32 mapID); + InstanceTemplate const* GetInstanceTemplate(uint32 mapId); PetLevelInfo const* GetPetLevelInfo(uint32 creature_id, uint8 level) const; @@ -1035,15 +1036,6 @@ class ObjectMgr return &itr->second; } - bool IsGoOfSpecificEntrySpawned(uint32 entry) const - { - for (GameObjectDataContainer::const_iterator it = _gameObjectDataStore.begin(); it != _gameObjectDataStore.end(); ++it) - if (it->second.id == entry) - return true; - - return false; - } - GameObjectData const* GetGOData(uint32 guid) const { GameObjectDataContainer::const_iterator itr = _gameObjectDataStore.find(guid); @@ -1349,7 +1341,6 @@ class ObjectMgr }; HotfixData _hotfixData; - }; #define sObjectMgr ACE_Singleton::instance() diff --git a/src/server/game/Grids/Cells/CellImpl.h b/src/server/game/Grids/Cells/CellImpl.h index 77830bc59d5..b224b3865e0 100644 --- a/src/server/game/Grids/Cells/CellImpl.h +++ b/src/server/game/Grids/Cells/CellImpl.h @@ -91,7 +91,7 @@ inline void Cell::Visit(CellCoord const& standing_cell, TypeContainerVisitor 4) && ((area.high_bound.y_coord - area.low_bound.y_coord) > 4)) + if ((area.high_bound.x_coord > (area.low_bound.x_coord + 4)) && (area.high_bound.y_coord > (area.low_bound.y_coord + 4))) { VisitCircle(visitor, map, area.low_bound, area.high_bound); return; diff --git a/src/server/game/Grids/GridDefines.h b/src/server/game/Grids/GridDefines.h index d096bb7ab63..7bd0da34a46 100644 --- a/src/server/game/Grids/GridDefines.h +++ b/src/server/game/Grids/GridDefines.h @@ -67,12 +67,12 @@ typedef GridRefManager PlayerMapType; enum GridMapTypeMask { - GRID_MAP_TYPE_MASK_CORPSE = 0x01, - GRID_MAP_TYPE_MASK_CREATURE = 0x02, - GRID_MAP_TYPE_MASK_DYNAMICOBJECT = 0x04, - GRID_MAP_TYPE_MASK_GAMEOBJECT = 0x08, - GRID_MAP_TYPE_MASK_PLAYER = 0x10, - GRID_MAP_TYPE_MASK_ALL = 0x1F + GRID_MAP_TYPE_MASK_CORPSE = 0x01, + GRID_MAP_TYPE_MASK_CREATURE = 0x02, + GRID_MAP_TYPE_MASK_DYNAMICOBJECT = 0x04, + GRID_MAP_TYPE_MASK_GAMEOBJECT = 0x08, + GRID_MAP_TYPE_MASK_PLAYER = 0x10, + GRID_MAP_TYPE_MASK_ALL = 0x1F }; typedef Grid GridType; @@ -172,14 +172,14 @@ typedef CoordPair CellCoord; namespace Trinity { template - inline RET_TYPE Compute(float x, float y, float center_offset, float size) + inline RET_TYPE Compute(float x, float y, float center_offset, float size) { // calculate and store temporary values in double format for having same result as same mySQL calculations double x_offset = (double(x) - center_offset)/size; double y_offset = (double(y) - center_offset)/size; - int x_val = int(x_offset+CENTER_VAL + 0.5f); - int y_val = int(y_offset+CENTER_VAL + 0.5f); + int x_val = int(x_offset + CENTER_VAL + 0.5f); + int y_val = int(y_offset + CENTER_VAL + 0.5f); return RET_TYPE(x_val, y_val); } diff --git a/src/server/game/Grids/GridStates.h b/src/server/game/Grids/GridStates.h index 08b66f6bb35..cf649f8d896 100755 --- a/src/server/game/Grids/GridStates.h +++ b/src/server/game/Grids/GridStates.h @@ -40,6 +40,7 @@ class GridState void setMagic() { i_Magic = MAGIC_TESTVAL; } unsigned int i_Magic; #endif + virtual ~GridState() {}; virtual void Update(Map &, NGridType&, GridInfo &, const uint32 t_diff) const = 0; }; diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.cpp b/src/server/game/Grids/Notifiers/GridNotifiers.cpp index 17d3066e64d..a02c18ca008 100755 --- a/src/server/game/Grids/Notifiers/GridNotifiers.cpp +++ b/src/server/game/Grids/Notifiers/GridNotifiers.cpp @@ -120,7 +120,7 @@ inline void CreatureUnitRelocationWorker(Creature* c, Unit* u) void PlayerRelocationNotifier::Visit(PlayerMapType &m) { - for (PlayerMapType::iterator iter=m.begin(); iter != m.end(); ++iter) + for (PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter) { Player* player = iter->getSource(); diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h index 48b9860eb0b..54bc1206e18 100755 --- a/src/server/game/Grids/Notifiers/GridNotifiers.h +++ b/src/server/game/Grids/Notifiers/GridNotifiers.h @@ -797,7 +797,7 @@ namespace Trinity if (u->GetTypeId() == TYPEID_UNIT && ((Creature*)u)->isTotem()) return false; - if(!u->isTargetableForAttack(false)) + if (!u->isTargetableForAttack(false)) return false; return i_obj->IsWithinDistInMap(u, i_range) && !i_funit->IsFriendlyTo(u); @@ -858,6 +858,30 @@ namespace Trinity float i_range; }; + class AnyGroupedUnitInObjectRangeCheck + { + public: + AnyGroupedUnitInObjectRangeCheck(WorldObject const* obj, Unit const* funit, float range, bool raid) : _source(obj), _refUnit(funit), _range(range), _raid(raid) {} + bool operator()(Unit* u) + { + if (_raid) + { + if (!_refUnit->IsInRaidWith(u)) + return false; + } + else if (!_refUnit->IsInPartyWith(u)) + return false; + + return !_refUnit->IsHostileTo(u) && u->isAlive() && _source->IsWithinDistInMap(u, _range); + } + + private: + WorldObject const* _source; + Unit const* _refUnit; + float _range; + bool _raid; + }; + class AnyUnitInObjectRangeCheck { public: @@ -903,13 +927,15 @@ namespace Trinity { public: AnyAoETargetUnitInObjectRangeCheck(WorldObject const* obj, Unit const* funit, float range) - : i_obj(obj), i_funit(funit), i_range(range) + : i_obj(obj), i_funit(funit), _spellInfo(NULL), i_range(range) { Unit const* check = i_funit; Unit const* owner = i_funit->GetOwner(); if (owner) check = owner; i_targetForPlayer = (check->GetTypeId() == TYPEID_PLAYER); + if (i_obj->GetTypeId() == TYPEID_DYNAMICOBJECT) + _spellInfo = sSpellMgr->GetSpellInfo(((DynamicObject*)i_obj)->GetSpellId()); } bool operator()(Unit* u) { @@ -917,7 +943,7 @@ namespace Trinity if (u->GetTypeId() == TYPEID_UNIT && ((Creature*)u)->isTotem()) return false; - if (i_funit->IsValidAttackTarget(u) && i_obj->IsWithinDistInMap(u, i_range)) + if (i_funit->_IsValidAttackTarget(u, _spellInfo,i_obj->GetTypeId() == TYPEID_DYNAMICOBJECT ? i_obj : NULL) && i_obj->IsWithinDistInMap(u, i_range)) return true; return false; @@ -926,6 +952,7 @@ namespace Trinity bool i_targetForPlayer; WorldObject const* i_obj; Unit const* i_funit; + SpellInfo const* _spellInfo; float i_range; }; @@ -945,7 +972,7 @@ namespace Trinity return; // too far - if (!u->IsWithinDistInMap(i_enemy, i_range)) + if (!u->IsWithinDistInMap(i_funit, i_range)) return; // only if see assisted creature's enemy @@ -1188,7 +1215,7 @@ namespace Trinity class AllGameObjectsWithEntryInRange { public: - AllGameObjectsWithEntryInRange(const WorldObject* pObject, uint32 uiEntry, float fMaxRange) : m_pObject(pObject), m_uiEntry(uiEntry), m_fRange(fMaxRange) {} + AllGameObjectsWithEntryInRange(const WorldObject* object, uint32 entry, float maxRange) : m_pObject(object), m_uiEntry(entry), m_fRange(maxRange) {} bool operator() (GameObject* go) { if (go->GetEntry() == m_uiEntry && m_pObject->IsWithinDist(go, m_fRange, false)) @@ -1205,7 +1232,7 @@ namespace Trinity class AllCreaturesOfEntryInRange { public: - AllCreaturesOfEntryInRange(const WorldObject* pObject, uint32 uiEntry, float fMaxRange) : m_pObject(pObject), m_uiEntry(uiEntry), m_fRange(fMaxRange) {} + AllCreaturesOfEntryInRange(const WorldObject* object, uint32 entry, float maxRange) : m_pObject(object), m_uiEntry(entry), m_fRange(maxRange) {} bool operator() (Unit* unit) { if (unit->GetEntry() == m_uiEntry && m_pObject->IsWithinDist(unit, m_fRange, false)) @@ -1257,10 +1284,10 @@ namespace Trinity class AllWorldObjectsInRange { public: - AllWorldObjectsInRange(const WorldObject* pObject, float fMaxRange) : m_pObject(pObject), m_fRange(fMaxRange) {} + AllWorldObjectsInRange(const WorldObject* object, float maxRange) : m_pObject(object), m_fRange(maxRange) {} bool operator() (WorldObject* go) { - return m_pObject->IsWithinDist(go, m_fRange, false); + return m_pObject->IsWithinDist(go, m_fRange, false) && m_pObject->InSamePhase(go); } private: const WorldObject* m_pObject; diff --git a/src/server/game/Grids/Notifiers/GridNotifiersImpl.h b/src/server/game/Grids/Notifiers/GridNotifiersImpl.h index 40b3863679b..e3cda4dd76d 100755 --- a/src/server/game/Grids/Notifiers/GridNotifiersImpl.h +++ b/src/server/game/Grids/Notifiers/GridNotifiersImpl.h @@ -251,9 +251,8 @@ void Trinity::WorldObjectListSearcher::Visit(PlayerMapType &m) return; for (PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr) - if (itr->getSource()->InSamePhase(i_phaseMask)) - if (i_check(itr->getSource())) - i_objects.push_back(itr->getSource()); + if (i_check(itr->getSource())) + i_objects.push_back(itr->getSource()); } template @@ -263,9 +262,8 @@ void Trinity::WorldObjectListSearcher::Visit(CreatureMapType &m) return; for (CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr) - if (itr->getSource()->InSamePhase(i_phaseMask)) - if (i_check(itr->getSource())) - i_objects.push_back(itr->getSource()); + if (i_check(itr->getSource())) + i_objects.push_back(itr->getSource()); } template @@ -275,9 +273,8 @@ void Trinity::WorldObjectListSearcher::Visit(CorpseMapType &m) return; for (CorpseMapType::iterator itr=m.begin(); itr != m.end(); ++itr) - if (itr->getSource()->InSamePhase(i_phaseMask)) - if (i_check(itr->getSource())) - i_objects.push_back(itr->getSource()); + if (i_check(itr->getSource())) + i_objects.push_back(itr->getSource()); } template @@ -287,9 +284,8 @@ void Trinity::WorldObjectListSearcher::Visit(GameObjectMapType &m) return; for (GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr) - if (itr->getSource()->InSamePhase(i_phaseMask)) - if (i_check(itr->getSource())) - i_objects.push_back(itr->getSource()); + if (i_check(itr->getSource())) + i_objects.push_back(itr->getSource()); } template @@ -299,9 +295,8 @@ void Trinity::WorldObjectListSearcher::Visit(DynamicObjectMapType &m) return; for (DynamicObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr) - if (itr->getSource()->InSamePhase(i_phaseMask)) - if (i_check(itr->getSource())) - i_objects.push_back(itr->getSource()); + if (i_check(itr->getSource())) + i_objects.push_back(itr->getSource()); } // Gameobject searchers diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index 1af656d7664..4c6b6249887 100755 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -41,6 +41,7 @@ totalPlayersRolling(0), totalNeed(0), totalGreed(0), totalPass(0), itemSlot(0), rollVoteMask(ROLL_ALL_TYPE_NO_DISENCHANT) { } + Roll::~Roll() { } @@ -170,7 +171,7 @@ void Group::LoadGroupFromDB(Field* fields) m_lootMethod = LootMethod(fields[1].GetUInt8()); m_looterGuid = MAKE_NEW_GUID(fields[2].GetUInt32(), 0, HIGHGUID_PLAYER); - m_lootThreshold = ItemQualities(fields[3].GetUInt16()); + m_lootThreshold = ItemQualities(fields[3].GetUInt8()); for (uint8 i = 0; i < TARGETICONCOUNT; ++i) m_targetIcons[i] = fields[4+i].GetUInt32(); @@ -728,13 +729,21 @@ void Group::Disband(bool hideDestroy /* = false */) if (!isBGGroup()) { SQLTransaction trans = CharacterDatabase.BeginTransaction(); - trans->PAppend("DELETE FROM groups WHERE guid = %u", m_dbStoreId); - trans->PAppend("DELETE FROM group_member WHERE guid = %u", m_dbStoreId); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GROUP); + stmt->setUInt32(0, m_dbStoreId); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GROUP_MEMBER_ALL); + stmt->setUInt32(0, m_dbStoreId); + trans->Append(stmt); + CharacterDatabase.CommitTransaction(trans); + ResetInstances(INSTANCE_RESET_GROUP_DISBAND, false, NULL); ResetInstances(INSTANCE_RESET_GROUP_DISBAND, true, NULL); - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_LFG_DATA); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_LFG_DATA); stmt->setUInt32(0, m_dbStoreId); CharacterDatabase.Execute(stmt); @@ -779,7 +788,7 @@ void Group::SendLootStartRollToPlayer(uint32 countDown, uint32 mapId, Player* p, if (!p || !p->GetSession()) return; - WorldPacket data(SMSG_LOOT_START_ROLL, (8 + 4 + 4 + 4 + 4 + 4 + 4 + 1 )); + WorldPacket data(SMSG_LOOT_START_ROLL, (8 + 4 + 4 + 4 + 4 + 4 + 4 + 1)); data << uint64(r.itemGUID); // guid of rolled item data << uint32(mapId); // 3.3.3 mapid data << uint32(r.totalPlayersRolling); // maybe the number of players rolling for it??? @@ -843,28 +852,28 @@ void Group::SendLootRollWon(uint64 SourceGuid, uint64 TargetGuid, uint8 RollNumb } } -void Group::SendLootAllPassed(uint32 NumberOfPlayers, const Roll &r) +void Group::SendLootAllPassed(uint32 numberOfPlayers, Roll const& roll) { WorldPacket data(SMSG_LOOT_ALL_PASSED, (8+4+4+4+4)); - data << uint64(r.itemGUID); // Guid of the item rolled - data << uint32(NumberOfPlayers); // The number of players rolling for it??? - data << uint32(r.itemid); // The itemEntryId for the item that shall be rolled for - data << uint32(r.itemRandomPropId); // Item random property ID - data << uint32(r.itemRandomSuffix); // Item random suffix ID + data << uint64(roll.itemGUID); // Guid of the item rolled + data << uint32(numberOfPlayers); // The number of players rolling for it + data << uint32(roll.itemid); // The itemEntryId for the item that shall be rolled for + data << uint32(roll.itemRandomPropId); // Item random property ID + data << uint32(roll.itemRandomSuffix); // Item random suffix ID - for (Roll::PlayerVote::const_iterator itr=r.playerVote.begin(); itr != r.playerVote.end(); ++itr) + for (Roll::PlayerVote::const_iterator itr = roll.playerVote.begin(); itr != roll.playerVote.end(); ++itr) { - Player* p = ObjectAccessor::FindPlayer(itr->first); - if (!p || !p->GetSession()) + Player* player = ObjectAccessor::FindPlayer(itr->first); + if (!player || !player->GetSession()) continue; if (itr->second != NOT_VALID) - p->GetSession()->SendPacket(&data); + player->GetSession()->SendPacket(&data); } } // notify group members which player is the allowed looter for the given creature -void Group::SendLooter(Creature* creature, Player* pLooter) +void Group::SendLooter(Creature* creature, Player* groupLooter) { ASSERT(creature); @@ -872,8 +881,8 @@ void Group::SendLooter(Creature* creature, Player* pLooter) data << uint64(creature->GetGUID()); data << uint8(0); // unk1 - if (pLooter) - data.append(pLooter->GetPackGUID()); + if (groupLooter) + data.append(groupLooter->GetPackGUID()); else data << uint8(0); @@ -1758,7 +1767,7 @@ bool Group::InCombatToInstance(uint32 instanceId) Player* player = itr->getSource(); if (player && !player->getAttackers().empty() && player->GetInstanceId() == instanceId && (player->GetMap()->IsRaidOrHeroicDungeon())) for (std::set::const_iterator i = player->getAttackers().begin(); i != player->getAttackers().end(); ++i) - if ((*i) && (*i)->GetTypeId() == TYPEID_UNIT && (*i)->ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_INSTANCE_BIND) + if ((*i) && (*i)->GetTypeId() == TYPEID_UNIT && (*i)->ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_INSTANCE_BIND) return true; } return false; @@ -2158,7 +2167,7 @@ void Group::SetGroupMemberFlag(uint64 guid, bool apply, GroupMemberFlags flag) PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_MEMBER_FLAG); stmt->setUInt8(0, slot->flags); - stmt->setUInt32(0, GUID_LOPART(guid)); + stmt->setUInt32(1, GUID_LOPART(guid)); CharacterDatabase.Execute(stmt); diff --git a/src/server/game/Groups/GroupMgr.cpp b/src/server/game/Groups/GroupMgr.cpp index ae400852c73..f372f08c941 100644 --- a/src/server/game/Groups/GroupMgr.cpp +++ b/src/server/game/Groups/GroupMgr.cpp @@ -120,7 +120,7 @@ void GroupMgr::LoadGroups() CharacterDatabase.DirectExecute("DELETE FROM groups WHERE guid NOT IN (SELECT guid FROM group_member GROUP BY guid HAVING COUNT(guid) > 1)"); // 0 1 2 3 4 5 6 7 8 9 - QueryResult result = CharacterDatabase.PQuery("SELECT g.leaderGuid, g.lootMethod, g.looterGuid, g.lootThreshold, g.icon1, g.icon2, g.icon3, g.icon4, g.icon5, g.icon6" + QueryResult result = CharacterDatabase.Query("SELECT g.leaderGuid, g.lootMethod, g.looterGuid, g.lootThreshold, g.icon1, g.icon2, g.icon3, g.icon4, g.icon5, g.icon6" // 10 11 12 13 14 15 16 17 ", g.icon7, g.icon8, g.groupType, g.difficulty, g.raiddifficulty, g.guid, lfg.dungeon, lfg.state FROM groups g LEFT JOIN lfg_data lfg ON lfg.guid = g.guid ORDER BY g.guid ASC"); if (!result) @@ -215,10 +215,10 @@ void GroupMgr::LoadGroups() Group* group = GetGroupByDbStoreId(fields[0].GetUInt32()); // group will never be NULL (we have run consistency sql's before loading) - MapEntry const* mapEntry = sMapStore.LookupEntry(fields[1].GetUInt32()); + MapEntry const* mapEntry = sMapStore.LookupEntry(fields[1].GetUInt16()); if (!mapEntry || !mapEntry->IsDungeon()) { - sLog->outErrorDb("Incorrect entry in group_instance table : no dungeon map %d", fields[1].GetUInt32()); + sLog->outErrorDb("Incorrect entry in group_instance table : no dungeon map %d", fields[1].GetUInt16()); continue; } @@ -229,7 +229,7 @@ void GroupMgr::LoadGroups() diff = 0; // default for both difficaly types } - InstanceSave* save = sInstanceSaveMgr->AddInstanceSave(mapEntry->MapID, fields[2].GetUInt32(), Difficulty(diff), time_t(fields[5].GetUInt64()), fields[6].GetBool(), true); + InstanceSave* save = sInstanceSaveMgr->AddInstanceSave(mapEntry->MapID, fields[2].GetUInt32(), Difficulty(diff), time_t(fields[5].GetUInt32()), (bool)fields[6].GetUInt64(), true); group->BindToInstance(save, fields[3].GetBool(), true); ++count; } diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index a7c5b04bcba..dfeb3f7cad9 100755 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -588,11 +588,11 @@ bool Guild::Member::LoadFromDB(Field* fields) } SetStats(fields[19].GetString(), - fields[20].GetUInt8(), - fields[21].GetUInt8(), - fields[22].GetUInt32(), - fields[23].GetUInt32()); - m_logoutTime = fields[24].GetUInt32(); + fields[20].GetUInt8(), // characters.level + fields[21].GetUInt8(), // characters.class + fields[22].GetUInt16(), // characters.zone + fields[23].GetUInt32()); // characters.account + m_logoutTime = fields[24].GetUInt32(); // characters.logout_time if (!CheckStats()) return false; @@ -1376,12 +1376,12 @@ void Guild::HandleSetMemberNote(WorldSession* session, const std::string& name, if (!_HasRankRight(session->GetPlayer(), officer ? GR_RIGHT_EOFFNOTE : GR_RIGHT_EPNOTE)) SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_PERMISSIONS); // Noted player must be a member of guild - else if (Member* pMember = GetMember(session, name)) + else if (Member* member = GetMember(session, name)) { if (officer) - pMember->SetOfficerNote(note); + member->SetOfficerNote(note); else - pMember->SetPublicNote(note); + member->SetPublicNote(note); HandleRoster(session); } } @@ -1526,17 +1526,17 @@ void Guild::HandleRemoveMember(WorldSession* session, const std::string& name) if (!_HasRankRight(player, GR_RIGHT_REMOVE)) SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_PERMISSIONS); // Removed player must be a member of guild - else if (Member* pMember = GetMember(session, name)) + else if (Member* member = GetMember(session, name)) { // Leader cannot be removed - if (pMember->IsRank(GR_GUILDMASTER)) + if (member->IsRank(GR_GUILDMASTER)) SendCommandResult(session, GUILD_QUIT_S, ERR_GUILD_LEADER_LEAVE); // Do not allow to remove player with the same rank or higher - else if (pMember->IsRankNotLower(player->GetRank())) + else if (member->IsRankNotLower(player->GetRank())) SendCommandResult(session, GUILD_QUIT_S, ERR_GUILD_RANK_TOO_HIGH_S, name); else { - uint64 guid = pMember->GetGUID(); + uint64 guid = member->GetGUID(); // After call to DeleteMember pointer to member becomes invalid DeleteMember(guid, false, true); _LogEvent(GUILD_EVENT_LOG_UNINVITE_PLAYER, player->GetGUIDLow(), GUID_LOPART(guid)); @@ -1552,10 +1552,10 @@ void Guild::HandleUpdateMemberRank(WorldSession* session, const std::string& nam if (!_HasRankRight(player, demote ? GR_RIGHT_DEMOTE : GR_RIGHT_PROMOTE)) SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_PERMISSIONS); // Promoted player must be a member of guild - else if (Member* pMember = GetMember(session, name)) + else if (Member* member = GetMember(session, name)) { // Player cannot promote himself - if (pMember->IsSamePlayer(player->GetGUID())) + if (member->IsSamePlayer(player->GetGUID())) { SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_NAME_INVALID); return; @@ -1564,13 +1564,13 @@ void Guild::HandleUpdateMemberRank(WorldSession* session, const std::string& nam if (demote) { // Player can demote only lower rank members - if (pMember->IsRankNotLower(player->GetRank())) + if (member->IsRankNotLower(player->GetRank())) { SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_RANK_TOO_HIGH_S, name); return; } // Lowest rank cannot be demoted - if (pMember->GetRankId() >= _GetLowestRankId()) + if (member->GetRankId() >= _GetLowestRankId()) { SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_RANK_TOO_LOW_S, name); return; @@ -1579,8 +1579,8 @@ void Guild::HandleUpdateMemberRank(WorldSession* session, const std::string& nam else { // Allow to promote only to lower rank than member's rank - // pMember->GetRank() + 1 is the highest rank that current player can promote to - if (pMember->IsRankNotLower(player->GetRank() + 1)) + // member->GetRank() + 1 is the highest rank that current player can promote to + if (member->IsRankNotLower(player->GetRank() + 1)) { SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_RANK_TOO_HIGH_S, name); return; @@ -1588,9 +1588,9 @@ void Guild::HandleUpdateMemberRank(WorldSession* session, const std::string& nam } // When promoting player, rank is decreased, when demoting - increased - uint32 newRankId = pMember->GetRankId() + (demote ? 1 : -1); - pMember->ChangeRank(newRankId); - _LogEvent(demote ? GUILD_EVENT_LOG_DEMOTE_PLAYER : GUILD_EVENT_LOG_PROMOTE_PLAYER, player->GetGUIDLow(), GUID_LOPART(pMember->GetGUID()), newRankId); + uint32 newRankId = member->GetRankId() + (demote ? 1 : -1); + member->ChangeRank(newRankId); + _LogEvent(demote ? GUILD_EVENT_LOG_DEMOTE_PLAYER : GUILD_EVENT_LOG_PROMOTE_PLAYER, player->GetGUIDLow(), GUID_LOPART(member->GetGUID()), newRankId); _BroadcastEvent(demote ? GE_DEMOTION : GE_PROMOTION, 0, player->GetName(), name.c_str(), _GetRankName(newRankId).c_str()); } } @@ -1643,9 +1643,6 @@ void Guild::HandleRemoveLowestRank(WorldSession* session) void Guild::HandleMemberDepositMoney(WorldSession* session, uint32 amount) { - if (!_GetPurchasedTabsSize()) - return; // No guild bank tabs - no money in bank - Player* player = session->GetPlayer(); // Call script after validation and before money transfer. @@ -1676,9 +1673,6 @@ void Guild::HandleMemberDepositMoney(WorldSession* session, uint32 amount) bool Guild::HandleMemberWithdrawMoney(WorldSession* session, uint32 amount, bool repair) { - if (!_GetPurchasedTabsSize()) - return false; // No guild bank tabs - no money - if (m_bankMoney < amount) // Not enough money in bank return false; @@ -1699,8 +1693,8 @@ bool Guild::HandleMemberWithdrawMoney(WorldSession* session, uint32 amount, bool SQLTransaction trans = CharacterDatabase.BeginTransaction(); // Update remaining money amount if (remainingMoney < uint32(GUILD_WITHDRAW_MONEY_UNLIMITED)) - if (Member* pMember = GetMember(player->GetGUID())) - pMember->DecreaseBankRemainingValue(trans, GUILD_BANK_MAX_TABS, amount); + if (Member* member = GetMember(player->GetGUID())) + member->DecreaseBankRemainingValue(trans, GUILD_BANK_MAX_TABS, amount); // Remove money from bank _ModifyBankMoney(trans, amount, false); // Add money to player (if required) @@ -1726,10 +1720,10 @@ bool Guild::HandleMemberWithdrawMoney(WorldSession* session, uint32 amount, bool void Guild::HandleMemberLogout(WorldSession* session) { Player* player = session->GetPlayer(); - if (Member* pMember = GetMember(player->GetGUID())) + if (Member* member = GetMember(player->GetGUID())) { - pMember->SetStats(player); - pMember->UpdateLogoutTime(); + member->SetStats(player); + member->UpdateLogoutTime(); } _BroadcastEvent(GE_SIGNED_OFF, player->GetGUID(), player->GetName()); } @@ -1869,7 +1863,7 @@ bool Guild::LoadFromDB(Field* fields) m_createdDate = time_t(fields[10].GetUInt32()); m_bankMoney = fields[11].GetUInt64(); - uint8 purchasedTabs = uint8(fields[12].GetUInt32()); + uint8 purchasedTabs = uint8(fields[12].GetUInt64()); if (purchasedTabs > GUILD_BANK_MAX_TABS) purchasedTabs = GUILD_BANK_MAX_TABS; @@ -1893,14 +1887,14 @@ void Guild::LoadRankFromDB(Field* fields) bool Guild::LoadMemberFromDB(Field* fields) { uint32 lowguid = fields[1].GetUInt32(); - Member *pMember = new Member(m_id, MAKE_NEW_GUID(lowguid, 0, HIGHGUID_PLAYER), fields[2].GetUInt8()); - if (!pMember->LoadFromDB(fields)) + Member *member = new Member(m_id, MAKE_NEW_GUID(lowguid, 0, HIGHGUID_PLAYER), fields[2].GetUInt8()); + if (!member->LoadFromDB(fields)) { _DeleteMemberFromDB(lowguid); - delete pMember; + delete member; return false; } - m_members[lowguid] = pMember; + m_members[lowguid] = member; return true; } @@ -1971,7 +1965,7 @@ bool Guild::LoadBankEventLogFromDB(Field* fields) bool Guild::LoadBankTabFromDB(Field* fields) { - uint32 tabId = fields[1].GetUInt8(); + uint8 tabId = fields[1].GetUInt8(); if (tabId >= _GetPurchasedTabsSize()) { sLog->outError("Invalid tab (tabId: %u) in guild bank, skipped.", tabId); @@ -2112,9 +2106,9 @@ bool Guild::AddMember(uint64 guid, uint8 rankId) if (rankId == GUILD_RANK_NONE) rankId = _GetLowestRankId(); - Member* pMember = new Member(m_id, guid, rankId); + Member* member = new Member(m_id, guid, rankId); if (player) - pMember->SetStats(player); + member->SetStats(player); else { bool ok = false; @@ -2124,25 +2118,25 @@ bool Guild::AddMember(uint64 guid, uint8 rankId) if (PreparedQueryResult result = CharacterDatabase.Query(stmt)) { Field* fields = result->Fetch(); - pMember->SetStats( + member->SetStats( fields[0].GetString(), fields[1].GetUInt8(), fields[2].GetUInt8(), fields[3].GetUInt16(), fields[4].GetUInt32()); - ok = pMember->CheckStats(); + ok = member->CheckStats(); } if (!ok) { - delete pMember; + delete member; return false; } } - m_members[lowguid] = pMember; + m_members[lowguid] = member; SQLTransaction trans(NULL); - pMember->SaveToDB(trans); + member->SaveToDB(trans); // If player not in game data in will be loaded from guild tables, so no need to update it! if (player) { @@ -2199,8 +2193,8 @@ void Guild::DeleteMember(uint64 guid, bool isDisbanding, bool isKicked) // Call script on remove before member is acutally removed from guild (and database) sScriptMgr->OnGuildRemoveMember(this, player, isDisbanding, isKicked); - if (Member* pMember = GetMember(guid)) - delete pMember; + if (Member* member = GetMember(guid)) + delete member; m_members.erase(lowguid); // If player not online data in data field will be loaded from guild tabs no need to update it !! @@ -2218,9 +2212,9 @@ void Guild::DeleteMember(uint64 guid, bool isDisbanding, bool isKicked) bool Guild::ChangeMemberRank(uint64 guid, uint8 newRank) { if (newRank <= _GetLowestRankId()) // Validate rank (allow only existing ranks) - if (Member* pMember = GetMember(guid)) + if (Member* member = GetMember(guid)) { - pMember->ChangeRank(newRank); + member->ChangeRank(newRank); return true; } return false; @@ -2369,8 +2363,8 @@ bool Guild::_IsLeader(Player* player) const { if (player->GetGUID() == m_leaderGuid) return true; - if (const Member* pMember = GetMember(player->GetGUID())) - return pMember->IsRank(GR_GUILDMASTER); + if (const Member* member = GetMember(player->GetGUID())) + return member->IsRank(GR_GUILDMASTER); return false; } @@ -2483,15 +2477,15 @@ inline uint8 Guild::_GetRankBankTabRights(uint8 rankId, uint8 tabId) const inline uint32 Guild::_GetMemberRemainingSlots(uint64 guid, uint8 tabId) const { - if (const Member* pMember = GetMember(guid)) - return pMember->GetBankRemainingValue(tabId, this); + if (const Member* member = GetMember(guid)) + return member->GetBankRemainingValue(tabId, this); return 0; } inline uint32 Guild::_GetMemberRemainingMoney(uint64 guid) const { - if (const Member* pMember = GetMember(guid)) - return pMember->GetBankRemainingValue(GUILD_BANK_MAX_TABS, this); + if (const Member* member = GetMember(guid)) + return member->GetBankRemainingValue(GUILD_BANK_MAX_TABS, this); return 0; } @@ -2501,18 +2495,18 @@ inline void Guild::_DecreaseMemberRemainingSlots(SQLTransaction& trans, uint64 g if (uint32 remainingSlots = _GetMemberRemainingSlots(guid, tabId)) // Ignore guild master if (remainingSlots < uint32(GUILD_WITHDRAW_SLOT_UNLIMITED)) - if (Member* pMember = GetMember(guid)) - pMember->DecreaseBankRemainingValue(trans, tabId, 1); + if (Member* member = GetMember(guid)) + member->DecreaseBankRemainingValue(trans, tabId, 1); } inline bool Guild::_MemberHasTabRights(uint64 guid, uint8 tabId, uint32 rights) const { - if (const Member* pMember = GetMember(guid)) + if (const Member* member = GetMember(guid)) { // Leader always has full rights - if (pMember->IsRank(GR_GUILDMASTER) || m_leaderGuid == guid) + if (member->IsRank(GR_GUILDMASTER) || m_leaderGuid == guid) return true; - return (_GetRankBankTabRights(pMember->GetRankId(), tabId) & rights) == rights; + return (_GetRankBankTabRights(member->GetRankId(), tabId) & rights) == rights; } return false; } diff --git a/src/server/game/Guilds/GuildMgr.cpp b/src/server/game/Guilds/GuildMgr.cpp index 2a7a7f2ca8b..450a49e345c 100644 --- a/src/server/game/Guilds/GuildMgr.cpp +++ b/src/server/game/Guilds/GuildMgr.cpp @@ -232,7 +232,6 @@ void GuildMgr::LoadGuilds() // Delete orphaned guild bank right entries before loading the valid ones CharacterDatabase.DirectExecute("DELETE gbr FROM guild_bank_right gbr LEFT JOIN guild g ON gbr.guildId = g.guildId WHERE g.guildId IS NULL"); - // 0 1 2 3 4 QueryResult result = CharacterDatabase.Query("SELECT guildid, TabId, rid, gbright, SlotPerDay FROM guild_bank_right ORDER BY guildid ASC, TabId ASC"); diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp index 929532b6362..27eb559fb68 100755 --- a/src/server/game/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Handlers/AuctionHouseHandler.cpp @@ -241,6 +241,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data) else AH->auctioneer = GUID_LOPART(auctioneer); + // Required stack size of auction matches to current item stack size, just move item to auctionhouse if (itemsCount == 1 && item->GetCount() == count[i]) { if (GetSecurity() > SEC_PLAYER && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE)) @@ -278,7 +279,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data) GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CREATE_AUCTION, 1); return; } - else + else // Required stack size of auction does not match to current item stack size, clone item and set correct stack size { Item* newItem = item->CloneItem(finalCount, _player); if (!newItem) @@ -309,33 +310,35 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data) sAuctionMgr->AddAItem(newItem); auctionHouse->AddAuction(AH); - for (uint32 i = 0; i < itemsCount; ++i) + for (uint32 j = 0; j < itemsCount; ++j) { - Item* item = items[i]; + Item* item2 = items[j]; - if (item->GetCount() == count[i]) + // Item stack count equals required count, ready to delete item - cloned item will be used for auction + if (item2->GetCount() == count[j]) { - _player->MoveItemFromInventory(item->GetBagSlot(), item->GetSlot(), true); + _player->MoveItemFromInventory(item2->GetBagSlot(), item2->GetSlot(), true); SQLTransaction trans = CharacterDatabase.BeginTransaction(); - item->DeleteFromInventoryDB(trans); - item->SaveToDB(trans); + item2->DeleteFromInventoryDB(trans); + item2->DeleteFromDB(trans); CharacterDatabase.CommitTransaction(trans); } - else + else // Item stack count is bigger than required count, update item stack count and save to database - cloned item will be used for auction { - item->SetCount(item->GetCount() - count[i]); - item->SetState(ITEM_CHANGED, _player); - _player->ItemRemovedQuestCheck(item->GetEntry(), count[i]); - item->SendUpdateToPlayer(_player); + item2->SetCount(item2->GetCount() - count[j]); + item2->SetState(ITEM_CHANGED, _player); + _player->ItemRemovedQuestCheck(item2->GetEntry(), count[j]); + item2->SendUpdateToPlayer(_player); SQLTransaction trans = CharacterDatabase.BeginTransaction(); - item->SaveToDB(trans); + item2->SaveToDB(trans); CharacterDatabase.CommitTransaction(trans); } } SQLTransaction trans = CharacterDatabase.BeginTransaction(); + newItem->SaveToDB(trans); AH->SaveToDB(trans); _player->SaveInventoryAndGoldToDB(trans); CharacterDatabase.CommitTransaction(trans); @@ -436,7 +439,11 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket& recv_data) auction->bid = price; GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_BID, price); - trans->PAppend("UPDATE auctionhouse SET buyguid = '%u', lastbid = '%u' WHERE id = '%u'", auction->bidder, auction->bid, auction->Id); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_AUCTION_BID); + stmt->setUInt32(0, auction->bidder); + stmt->setUInt32(1, auction->bid); + stmt->setUInt32(2, auction->Id); + trans->Append(stmt); SendAuctionCommandResult(auction->Id, AUCTION_PLACE_BID, AUCTION_OK, 0); } diff --git a/src/server/game/Handlers/BattleGroundHandler.cpp b/src/server/game/Handlers/BattleGroundHandler.cpp index 00f18217eed..41188e1134e 100755 --- a/src/server/game/Handlers/BattleGroundHandler.cpp +++ b/src/server/game/Handlers/BattleGroundHandler.cpp @@ -60,10 +60,10 @@ void WorldSession::HandleBattlemasterHelloOpcode(WorldPacket & recv_data) return; } - SendBattlegGroundList(guid, bgTypeId); + SendBattleGroundList(guid, bgTypeId); } -void WorldSession::SendBattlegGroundList(uint64 guid, BattlegroundTypeId bgTypeId) +void WorldSession::SendBattleGroundList(uint64 guid, BattlegroundTypeId bgTypeId) { WorldPacket data; sBattlegroundMgr->BuildBattlegroundListPacket(&data, guid, _player, bgTypeId); @@ -216,7 +216,8 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data) for (GroupReference* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next()) { Player* member = itr->getSource(); - if (!member) continue; // this should never happen + if (!member) + continue; // this should never happen WorldPacket data; diff --git a/src/server/game/Handlers/CalendarHandler.cpp b/src/server/game/Handlers/CalendarHandler.cpp index 820079a90e1..298c742fc3a 100755 --- a/src/server/game/Handlers/CalendarHandler.cpp +++ b/src/server/game/Handlers/CalendarHandler.cpp @@ -16,6 +16,22 @@ * with this program. If not, see . */ +/* +----- Opcodes Not Used yet ----- + +SMSG_CALENDAR_CLEAR_PENDING_ACTION SendCalendarClearPendingAction() +SMSG_CALENDAR_RAID_LOCKOUT_UPDATED SendCalendarRaidLockoutUpdated(InstanceSave const* save) + +----- Opcodes without Sniffs ----- +SMSG_CALENDAR_FILTER_GUILD [ for (... uint32(count) { packguid(???), uint8(???) } ] +SMSG_CALENDAR_ARENA_TEAM [ for (... uint32(count) { packguid(???), uint8(???) } ] +CMSG_CALENDAR_EVENT_INVITE_NOTES [ packguid(Invitee), uint64(inviteId), string(Text), Boolean(Unk) ] +SMSG_CALENDAR_EVENT_INVITE_NOTES [ uint32(unk1), uint32(unk2), uint32(unk3), uint32(unk4), uint32(unk5) ] +SMSG_CALENDAR_EVENT_INVITE_NOTES_ALERT [ uint64(inviteId), string(Text) ] +SMSG_CALENDAR_EVENT_INVITE_STATUS_ALERT [ Structure unkown ] + +*/ + #include "Common.h" #include "WorldPacket.h" #include "WorldSession.h" @@ -24,8 +40,12 @@ #include "Log.h" #include "Opcodes.h" #include "Player.h" +#include "CalendarMgr.h" +#include "ObjectMgr.h" +#include "ObjectAccessor.h" +#include "DatabaseEnv.h" -void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recv_data*/) +void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recvData*/) { uint64 guid = _player->GetGUID(); sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_GET_CALENDAR [" UI64FMTD "]", guid); @@ -33,32 +53,62 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recv_data*/) time_t cur_time = time_t(time(NULL)); sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_SEND_CALENDAR [" UI64FMTD "]", guid); - WorldPacket data(SMSG_CALENDAR_SEND_CALENDAR, 4+4*0+4+4*0+4+4); + WorldPacket data(SMSG_CALENDAR_SEND_CALENDAR, 1000); // Impossible to get the correct size without doing a double iteration of some elements - data << uint32(0); // invite count - /* - for (;;) + CalendarInviteIdList const& invites = sCalendarMgr->GetPlayerInvites(guid); + data << uint32(invites.size()); + for (CalendarInviteIdList::const_iterator it = invites.begin(); it != invites.end(); ++it) { - uint64 inviteId; - uint64 unkGuid0; - uint8 unk1, unk2, unk3; - uint64 creatorGuid; + CalendarInvite* invite = sCalendarMgr->GetInvite(*it); + CalendarEvent* calendarEvent = invite ? sCalendarMgr->GetEvent(invite->GetEventId()) : NULL; + + if (calendarEvent) + { + data << uint64(invite->GetEventId()); + data << uint64(invite->GetInviteId()); + data << uint8(invite->GetStatus()); + data << uint8(invite->GetRank()); + data << uint8(calendarEvent->GetGuildId() != 0); + data.appendPackGUID(calendarEvent->GetCreatorGUID()); + } + else + { + sLog->outError("SMSG_CALENDAR_SEND_CALENDAR: No Invite found with id [" UI64FMTD "]", *it); + data << uint64(0); + data << uint64(0); + data << uint8(0); + data << uint8(0); + data << uint8(0); + data.appendPackGUID(0); + } } - */ - data << uint32(0); // event count - /* - for (;;) + CalendarEventIdList const& events = sCalendarMgr->GetPlayerEvents(guid); + data << uint32(events.size()); + for (CalendarEventIdList::const_iterator it = events.begin(); it != events.end(); ++it) { - uint64 eventId; - std::string title; // 128 chars - uint32 type; - uint32 occurrenceTime; - uint32 flags; - uint32 unk4; -- possibly mapid for dungeon/raid - uint64 creatorGuid; + if (CalendarEvent* calendarEvent = sCalendarMgr->GetEvent(*it)) + { + data << uint64(*it); + data << calendarEvent->GetTitle().c_str(); + data << uint32(calendarEvent->GetType()); + data << uint32(calendarEvent->GetTime()); + data << uint32(calendarEvent->GetFlags()); + data << uint32(calendarEvent->GetDungeonId()); + data.appendPackGUID(calendarEvent->GetCreatorGUID()); + } + else + { + sLog->outError("SMSG_CALENDAR_SEND_CALENDAR: No Event found with id [" UI64FMTD "]", *it); + data << uint64(0); + data << uint8(0); + data << uint32(0); + data << uint32(0); + data << uint32(0); + data << uint32(0); + data.appendPackGUID(0); + } } - */ data << uint32(cur_time); // server time data << uint32(secsToTimeBitFields(cur_time)); // server time @@ -108,202 +158,751 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recv_data*/) data << uint32(mapEntry->unk_time); ++counter; } - data.put(p_counter, counter); - data << uint32(0); // holiday count? - /* - for (;;) + // TODO: Fix this, how we do know how many and what holidays to send? + uint32 holidayCount = 0; + data << uint32(holidayCount); + for (uint32 i = 0; i < holidayCount; ++i) { - uint32 unk5, unk6, unk7, unk8, unk9; - for (uint32 j = 0; j < 26; ++j) - { - uint32 unk10; - } - for (uint32 j = 0; j < 10; ++j) + HolidaysEntry const* holiday = sHolidaysStore.LookupEntry(666); + + data << uint32(holiday->Id); // m_ID + data << uint32(holiday->Region); // m_region, might be looping + data << uint32(holiday->Looping); // m_looping, might be region + data << uint32(holiday->Priority); // m_priority + data << uint32(holiday->CalendarFilterType); // m_calendarFilterType + + for (uint8 j = 0; j < MAX_HOLIDAY_DATES; ++j) + data << uint32(holiday->Date[j]); // 26 * m_date + + for (uint8 j = 0; j < MAX_HOLIDAY_DURATIONS; ++j) + data << uint32(holiday->Duration[j]); // 10 * m_duration + + for (uint8 j = 0; j < MAX_HOLIDAY_FLAGS; ++j) + data << uint32(holiday->CalendarFlags[j]); // 10 * m_calendarFlags + + data << holiday->TextureFilename; // m_textureFilename (holiday name) + } + + SendPacket(&data); +} + +void WorldSession::HandleCalendarGetEvent(WorldPacket& recvData) +{ + uint64 eventId; + recvData >> eventId; + + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_GET_EVENT. Event: [" + UI64FMTD "] Event [" UI64FMTD "]", _player->GetGUID(), eventId); + + if (CalendarEvent* calendarEvent = sCalendarMgr->GetEvent(eventId)) + SendCalendarEvent(*calendarEvent, CALENDAR_SENDTYPE_GET); +} + +void WorldSession::HandleCalendarGuildFilter(WorldPacket& recvData) +{ + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_GUILD_FILTER [" UI64FMTD "]", _player->GetGUID()); + + int32 unk1, unk2, unk3; + recvData >> unk1; + recvData >> unk2; + recvData >> unk3; + + sLog->outDebug(LOG_FILTER_NETWORKIO, "Calendar: CMSG_CALENDAR_GUILD_FILTER - unk1: %d unk2: %d unk3: %d", unk1, unk2, unk3); +} + +void WorldSession::HandleCalendarArenaTeam(WorldPacket& recvData) +{ + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_ARENA_TEAM [" UI64FMTD "]", _player->GetGUID()); + + int32 unk1; + recvData >> unk1; + + sLog->outDebug(LOG_FILTER_NETWORKIO, "Calendar: CMSG_CALENDAR_ARENA_TEAM - unk1: %d", unk1); +} + +void WorldSession::HandleCalendarAddEvent(WorldPacket& recvData) +{ + uint64 guid = _player->GetGUID(); + std::string title; + std::string description; + uint8 type; + bool repeatable; + uint32 maxInvites; + int32 dungeonId; + uint32 eventPackedTime; + uint32 unkPackedTime; + uint32 flags; + uint64 inviteId = 0; + uint64 invitee = 0; + uint8 status; + uint8 rank; + + recvData >> title >> description >> type >> repeatable >> maxInvites; + recvData >> dungeonId >> eventPackedTime >> unkPackedTime >> flags; + + if (!(flags & CALENDAR_FLAG_WITHOUT_INVITES)) + { + uint32 inviteCount; + recvData >> inviteCount; + recvData.readPackGUID(invitee); + recvData >> status >> rank; + + if (inviteCount != 1 || invitee != guid) { - uint32 unk11; + sLog->outError("HandleCalendarAddEvent: [" UI64FMTD + "]: More than one invite (%d) or Invitee [" UI64FMTD + "] differs", guid, inviteCount, invitee); + return; } - for (uint32 j = 0; j < 10; ++j) + + inviteId = sCalendarMgr->GetFreeInviteId(); + } + else + { + inviteId = 0; + status = CALENDAR_STATUS_NO_OWNER; + rank = CALENDAR_RANK_PLAYER; + } + + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_ADD_EVENT: [" UI64FMTD "] " + "Title %s, Description %s, type %u, Repeatable %u, MaxInvites %u, " + "Dungeon ID %d, Time %u, Time2 %u, Flags %u, Invitee [" UI64FMTD "] " + "Status %d, Rank %d", guid, title.c_str(), description.c_str(), + type, repeatable, maxInvites, dungeonId, eventPackedTime, + unkPackedTime, flags, invitee, status, rank); + + CalendarAction action; + + action.SetAction(CALENDAR_ACTION_ADD_EVENT); + action.SetPlayer(_player); + action.Event.SetEventId(sCalendarMgr->GetFreeEventId()); + action.Event.SetCreatorGUID(guid); + action.Event.SetType((CalendarEventType) type); + action.Event.SetFlags(flags); + action.Event.SetTime(eventPackedTime); + action.Event.SetTimeZoneTime(unkPackedTime); + action.Event.SetRepeatable(repeatable); + action.Event.SetMaxInvites(maxInvites); + action.Event.SetDungeonId(dungeonId); + action.Event.SetGuildId((flags & CALENDAR_FLAG_GUILD_ONLY) ? GetPlayer()->GetGuildId() : 0); + action.Event.SetTitle(title); + action.Event.SetDescription(description); + action.Event.AddInvite(inviteId); + action.Invite.SetEventId(action.Event.GetEventId()); + action.Invite.SetInviteId(inviteId); + action.Invite.SetInvitee(invitee); + action.Invite.SetStatus((CalendarInviteStatus) status); + action.Invite.SetRank((CalendarModerationRank) rank); + action.Invite.SetSenderGUID(guid); + + sCalendarMgr->AddAction(action); +} + +void WorldSession::HandleCalendarUpdateEvent(WorldPacket& recvData) +{ + uint64 guid = _player->GetGUID(); + uint64 eventId; + uint64 inviteId; + std::string title; + std::string description; + uint8 type; + bool repeatable; + uint32 maxInvites; + int32 dungeonId; + uint32 eventPackedTime; + uint32 timeZoneTime; + uint32 flags; + + recvData >> eventId >> inviteId >> title >> description >> type; + recvData >> repeatable >> maxInvites >> dungeonId; + recvData >> eventPackedTime >> timeZoneTime >> flags; + + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_UPDATE_EVENT [" UI64FMTD "] EventId [" UI64FMTD + "], InviteId [" UI64FMTD "] Title %s, Description %s, type %u " + "Repeatable %u, MaxInvites %u, Dungeon ID %d, Time %u " + "Time2 %u, Flags %u", guid, eventId, inviteId, title.c_str(), + description.c_str(), type, repeatable, maxInvites, dungeonId, + eventPackedTime, timeZoneTime, flags); + + CalendarAction action; + action.SetAction(CALENDAR_ACTION_MODIFY_EVENT); + action.SetPlayer(_player); + action.SetInviteId(inviteId); + action.Event.SetEventId(eventId); + action.Event.SetType((CalendarEventType) type); + action.Event.SetFlags((CalendarFlags) flags); + action.Event.SetTime(eventPackedTime); + action.Event.SetTimeZoneTime(timeZoneTime); + action.Event.SetRepeatable(repeatable); + action.Event.SetDungeonId(dungeonId); + action.Event.SetTitle(title); + action.Event.SetDescription(description); + action.Event.SetMaxInvites(maxInvites); + + sCalendarMgr->AddAction(action); +} + +void WorldSession::HandleCalendarRemoveEvent(WorldPacket& recvData) +{ + uint64 guid = _player->GetGUID(); + uint64 eventId; + uint64 inviteId; + uint32 flags; + + recvData >> eventId >> inviteId >> flags; + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_REMOVE_EVENT [" UI64FMTD "], EventId [" UI64FMTD + "] inviteId [" UI64FMTD "] Flags?: %u", guid, eventId, inviteId, flags); + + CalendarAction action; + action.SetAction(CALENDAR_ACTION_REMOVE_EVENT); + action.SetPlayer(_player); + action.SetInviteId(inviteId); + action.Event.SetEventId(eventId); + action.Event.SetFlags((CalendarFlags) flags); + + sCalendarMgr->AddAction(action); +} + +void WorldSession::HandleCalendarCopyEvent(WorldPacket& recvData) +{ + uint64 guid = _player->GetGUID(); + uint64 eventId; + uint64 inviteId; + uint32 time; + + recvData >> eventId >> inviteId >> time; + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_COPY_EVENT [" UI64FMTD "], EventId [" UI64FMTD + "] inviteId [" UI64FMTD "] Time: %u", guid, eventId, inviteId, time); + + CalendarAction action; + action.SetAction(CALENDAR_ACTION_COPY_EVENT); + action.SetPlayer(_player); + action.SetInviteId(inviteId); + action.Event.SetEventId(eventId); + action.Event.SetTime(time); + + sCalendarMgr->AddAction(action); +} + +void WorldSession::HandleCalendarEventInvite(WorldPacket& recvData) +{ + uint64 guid = _player->GetGUID(); + uint64 eventId; + uint64 inviteId; + std::string name; + uint8 status; + uint8 rank; + uint64 invitee = 0; + uint32 team = 0; + + recvData >> eventId >> inviteId >> name >> status >> rank; + if (Player* player = sObjectAccessor->FindPlayerByName(name.c_str())) + { + invitee = player->GetGUID(); + team = player->GetTeam(); + } + else + { + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUID_RACE_ACC_BY_NAME); + stmt->setString(0, name); + if (PreparedQueryResult result = CharacterDatabase.Query(stmt)) { - uint32 unk12; + Field* fields = result->Fetch(); + invitee = MAKE_NEW_GUID(fields[0].GetUInt32(), 0, HIGHGUID_PLAYER); + team = Player::TeamForRace(fields[1].GetUInt8()); } - std::string holidayName; // 64 chars } - */ - SendPacket(&data); + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_EVENT_INVITE [" UI64FMTD "], EventId [" + UI64FMTD "] InviteId [" UI64FMTD "] Name %s ([" UI64FMTD "]), status %u, " + "Rank %u", guid, eventId, inviteId, name.c_str(), invitee, status, rank); + + if (!invitee) + { + SendCalendarCommandResult(CALENDAR_ERROR_PLAYER_NOT_FOUND); + return; + } + + if (_player->GetTeam() != team) + { + SendCalendarCommandResult(CALENDAR_ERROR_NOT_ALLIED); + return; + } + + // TODO: Check ignore, even if offline (db query) + + CalendarAction action; + action.SetAction(CALENDAR_ACTION_ADD_EVENT_INVITE); + action.SetPlayer(_player); + action.SetInviteId(inviteId); + action.Invite.SetEventId(eventId); + action.Invite.SetInviteId(sCalendarMgr->GetFreeInviteId()); + action.Invite.SetSenderGUID(_player->GetGUID()); + action.Invite.SetInvitee(invitee); + action.Invite.SetRank((CalendarModerationRank) rank); + action.Invite.SetStatus((CalendarInviteStatus) status); + + sCalendarMgr->AddAction(action); } -void WorldSession::HandleCalendarGetEvent(WorldPacket& recv_data) +void WorldSession::HandleCalendarEventSignup(WorldPacket& recvData) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_GET_EVENT"); - recv_data.read_skip(); // unk + uint64 guid = _player->GetGUID(); + uint64 eventId; + uint8 status; + + recvData >> eventId >> status; + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_EVENT_SIGNUP [" UI64FMTD "] EventId [" + UI64FMTD "] Status %u", guid, eventId, status); + + CalendarAction action; + action.SetAction(CALENDAR_ACTION_SIGNUP_TO_EVENT); + action.SetPlayer(_player); + action.SetExtraData(GetPlayer()->GetGuildId()); + action.Event.SetEventId(eventId); + action.Invite.SetStatus((CalendarInviteStatus) status); + sCalendarMgr->AddAction(action); } -void WorldSession::HandleCalendarGuildFilter(WorldPacket& recv_data) +void WorldSession::HandleCalendarEventRsvp(WorldPacket& recvData) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_GUILD_FILTER"); - recv_data.read_skip(); // unk1 - recv_data.read_skip(); // unk2 - recv_data.read_skip(); // unk3 + uint64 guid = _player->GetGUID(); + uint64 eventId; + uint64 inviteId; + uint8 status; + + recvData >> eventId >> inviteId >> status; + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_EVENT_RSVP [" UI64FMTD"] EventId [" + UI64FMTD "], InviteId [" UI64FMTD "], status %u", guid, eventId, + inviteId, status); + + CalendarAction action; + action.SetAction(CALENDAR_ACTION_MODIFY_EVENT_INVITE); + action.SetPlayer(_player); + action.SetInviteId(inviteId); + action.Invite.SetInviteId(inviteId); + action.Invite.SetEventId(eventId); + action.Invite.SetStatus((CalendarInviteStatus) status); + + sCalendarMgr->AddAction(action); } -void WorldSession::HandleCalendarArenaTeam(WorldPacket& recv_data) +void WorldSession::HandleCalendarEventRemoveInvite(WorldPacket& recvData) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_ARENA_TEAM"); - recv_data.read_skip(); // unk + uint64 guid = _player->GetGUID(); + uint64 invitee; + uint64 eventId; + uint64 owninviteId; + uint64 inviteId; + + recvData.readPackGUID(invitee); + recvData >> inviteId >> owninviteId >> eventId; + + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_EVENT_REMOVE_INVITE [" + UI64FMTD "] EventId [" UI64FMTD "], OwnInviteId [" + UI64FMTD "], Invitee ([" UI64FMTD "] id: [" UI64FMTD "])", + guid, eventId, owninviteId, invitee, inviteId); + + CalendarAction action; + action.SetAction(CALENDAR_ACTION_REMOVE_EVENT_INVITE); + action.SetPlayer(_player); + action.SetInviteId(owninviteId); + action.Invite.SetInviteId(inviteId); + action.Invite.SetEventId(eventId); + action.Invite.SetInvitee(invitee); + + sCalendarMgr->AddAction(action); } -void WorldSession::HandleCalendarAddEvent(WorldPacket& recv_data) +void WorldSession::HandleCalendarEventStatus(WorldPacket& recvData) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_ADD_EVENT"); - recv_data.rfinish(); // set to end to avoid warnings spam - - //std::string unk1, unk2; - //recv_data >> (std::string)unk1; - //recv_data >> (std::string)unk2; - - //uint8 unk3, unk4; - //uint32 unk5, unk6, unk7, unk8, unk9, count = 0; - //recv_data >> (uint8)unk3; - //recv_data >> (uint8)unk4; - //recv_data >> (uint32)unk5; - //recv_data >> (uint32)unk6; - //recv_data >> (uint32)unk7; - //recv_data >> (uint32)unk8; - //recv_data >> (uint32)unk9; - //if (!((unk9 >> 6) & 1)) - //{ - // recv_data >> (uint32)count; - // if (count) - // { - // uint8 unk12, unk13; - // uint64 guid; - // for (int i=0; i> (uint8)unk12; - // recv_data >> (uint8)unk13; - // } - // } - //} + uint64 guid = _player->GetGUID(); + uint64 invitee; + uint64 eventId; + uint64 inviteId; + uint64 owninviteId; + uint8 status; + + recvData.readPackGUID(invitee); + recvData >> eventId >> inviteId >> owninviteId >> status; + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_EVENT_STATUS [" UI64FMTD"] EventId [" + UI64FMTD "] OwnInviteId [" UI64FMTD "], Invitee ([" UI64FMTD "] id: [" + UI64FMTD "], status %u", guid, eventId, owninviteId, invitee, inviteId, status); + + CalendarAction action; + action.SetAction(CALENDAR_ACTION_MODIFY_EVENT_INVITE); + action.SetPlayer(_player); + action.SetInviteId(owninviteId); + action.Invite.SetInviteId(inviteId); + action.Invite.SetEventId(eventId); + action.Invite.SetInvitee(invitee); + action.Invite.SetStatus((CalendarInviteStatus) status); + + sCalendarMgr->AddAction(action); } -void WorldSession::HandleCalendarUpdateEvent(WorldPacket& recv_data) +void WorldSession::HandleCalendarEventModeratorStatus(WorldPacket& recvData) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_UPDATE_EVENT"); - recv_data.rfinish(); // set to end to avoid warnings spam - - //recv_data >> uint64 - //recv_data >> uint64 - //recv_data >> std::string - //recv_data >> std::string - //recv_data >> uint8 - //recv_data >> uint8 - //recv_data >> uint32 - //recv_data >> uint32 - //recv_data >> uint32 - //recv_data >> uint32 - //recv_data >> uint32 + uint64 guid = _player->GetGUID(); + uint64 invitee; + uint64 eventId; + uint64 inviteId; + uint64 owninviteId; + uint8 status; + + recvData.readPackGUID(invitee); + recvData >> eventId >> inviteId >> owninviteId >> status; + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_EVENT_MODERATOR_STATUS [" UI64FMTD "] EventId [" + UI64FMTD "] OwnInviteId [" UI64FMTD "], Invitee ([" UI64FMTD "] id: [" + UI64FMTD "], status %u", guid, eventId, owninviteId, invitee, inviteId, status); + + CalendarAction action; + action.SetAction(CALENDAR_ACTION_MODIFY_MODERATOR_EVENT_INVITE); + action.SetPlayer(_player); + action.SetInviteId(owninviteId); + action.Invite.SetInviteId(inviteId); + action.Invite.SetEventId(eventId); + action.Invite.SetInvitee(invitee); + action.Invite.SetStatus((CalendarInviteStatus) status); + + sCalendarMgr->AddAction(action); } -void WorldSession::HandleCalendarRemoveEvent(WorldPacket& recv_data) +void WorldSession::HandleCalendarComplain(WorldPacket& recvData) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_REMOVE_EVENT"); - recv_data.rfinish(); // set to end to avoid warnings spam + uint64 guid = _player->GetGUID(); + uint64 eventId; + uint64 complainGUID; + + recvData >> eventId >> complainGUID; + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_COMPLAIN [" UI64FMTD "] EventId [" + UI64FMTD "] guid [" UI64FMTD "]", guid, eventId, complainGUID); +} + +void WorldSession::HandleCalendarGetNumPending(WorldPacket& /*recvData*/) +{ + uint64 guid = _player->GetGUID(); + uint32 pending = sCalendarMgr->GetPlayerNumPending(guid); + + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_GET_NUM_PENDING: [" UI64FMTD + "] Pending: %u", guid, pending); + + WorldPacket data(SMSG_CALENDAR_SEND_NUM_PENDING, 4); + data << uint32(pending); + SendPacket(&data); +} + +// ----------------------------------- SEND ------------------------------------ - //recv_data >> uint64 - //recv_data >> uint64 - //recv_data >> uint32 +void WorldSession::SendCalendarEvent(CalendarEvent const& calendarEvent, CalendarSendEventType sendEventType) +{ + uint64 eventId = calendarEvent.GetEventId(); + + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_SEND_EVENT [" UI64FMTD "] EventId [" + UI64FMTD "] SendType %u", _player->GetGUID(), eventId, sendEventType); + + WorldPacket data(SMSG_CALENDAR_SEND_EVENT); + data << uint8(sendEventType); + data.appendPackGUID(calendarEvent.GetCreatorGUID()); + data << uint64(eventId); + data << calendarEvent.GetTitle().c_str(); + data << calendarEvent.GetDescription().c_str(); + data << uint8(calendarEvent.GetType()); + data << uint8(calendarEvent.GetRepeatable()); + data << uint32(calendarEvent.GetMaxInvites()); + data << int32(calendarEvent.GetDungeonId()); + data << uint32(calendarEvent.GetFlags()); + data << uint32(calendarEvent.GetTime()); + data << uint32(calendarEvent.GetTimeZoneTime()); + data << uint32(calendarEvent.GetGuildId()); + + CalendarInviteIdList const& invites = calendarEvent.GetInviteIdList(); + data << uint32(invites.size()); + for (CalendarInviteIdList::const_iterator it = invites.begin(); it != invites.end(); ++it) + { + if (CalendarInvite* invite = sCalendarMgr->GetInvite(*it)) + { + uint64 guid = invite->GetInvitee(); + Player* player = ObjectAccessor::FindPlayer(guid); + uint8 level = player ? player->getLevel() : Player::GetLevelFromDB(guid); + + data.appendPackGUID(guid); + data << uint8(level); + data << uint8(invite->GetStatus()); + data << uint8(invite->GetRank()); + data << uint8(calendarEvent.GetGuildId() != 0); + data << uint64(invite->GetInviteId()); + data << uint32(invite->GetStatusTime()); + data << invite->GetText().c_str(); + } + else + { + data.appendPackGUID(_player->GetGUID()); + data << uint8(0) << uint8(0) << uint8(0) << uint8(0) + << uint64(0) << uint32(0) << uint8(0); + sLog->outError("SendCalendarEvent: No Invite found with id [" UI64FMTD "]", *it); + } + } + SendPacket(&data); } -void WorldSession::HandleCalendarCopyEvent(WorldPacket& recv_data) +void WorldSession::SendCalendarEventInvite(CalendarInvite const& invite, bool pending) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_COPY_EVENT"); - recv_data.rfinish(); // set to end to avoid warnings spam + uint64 guid = _player->GetGUID(); + uint64 eventId = invite.GetEventId(); + uint64 inviteId = invite.GetInviteId(); + uint64 invitee = invite.GetInvitee(); + uint8 status = invite.GetStatus(); + uint32 statusTime = invite.GetStatusTime(); + Player* player = ObjectAccessor::FindPlayer(invitee); + uint8 level = player ? player->getLevel() : Player::GetLevelFromDB(invitee); + + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_EVENT_INVITE [" UI64FMTD "] EventId [" + UI64FMTD "] InviteId [" UI64FMTD "] Invitee [" UI64FMTD "] " + " Level %u, Status %u, StatusTime %u" , guid, eventId, inviteId, + invitee, level, status, statusTime); + + WorldPacket data(SMSG_CALENDAR_EVENT_INVITE, 8 + 8 + 8 + 1 + 1 + 1 + (statusTime ? 4 : 0) + 1); + data.appendPackGUID(invitee); + data << uint64(eventId); + data << uint64(inviteId); + data << uint8(level); + data << uint8(status); + if (statusTime) + data << uint8(1) << uint32(statusTime); + else + data << uint8(0); + data << uint8(pending); - //recv_data >> uint64 - //recv_data >> uint64 - //recv_data >> uint32 + SendPacket(&data); +} +void WorldSession::SendCalendarEventInviteAlert(CalendarEvent const& calendarEvent, CalendarInvite const& invite) +{ + uint64 guid = _player->GetGUID(); + uint64 eventId = calendarEvent.GetEventId(); + uint64 inviteId = invite.GetInviteId(); + + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_EVENT_INVITE_ALERT [" UI64FMTD "] EventId [" + UI64FMTD "] InviteId [" UI64FMTD "]", guid, eventId, inviteId); + + WorldPacket data(SMSG_CALENDAR_EVENT_INVITE_ALERT); + data << uint64(eventId); + data << calendarEvent.GetTitle().c_str(); + data << uint32(calendarEvent.GetTime()); + data << uint32(calendarEvent.GetFlags()); + data << uint32(calendarEvent.GetType()); + data << uint32(calendarEvent.GetDungeonId()); + data << uint64(inviteId); + data << uint8(invite.GetStatus()); + data << uint8(invite.GetRank()); + data.appendPackGUID(calendarEvent.GetCreatorGUID()); + data.appendPackGUID(invite.GetSenderGUID()); + SendPacket(&data); +} + +void WorldSession::SendCalendarEventUpdateAlert(CalendarEvent const& calendarEvent, CalendarSendEventType sendEventType) +{ + uint64 guid = _player->GetGUID(); + uint64 eventId = calendarEvent.GetEventId(); + + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_EVENT_UPDATED_ALERT [" + UI64FMTD "] EventId [" UI64FMTD "]", guid, eventId); + + + WorldPacket data(SMSG_CALENDAR_EVENT_UPDATED_ALERT, 1 + 8 + 4 + 4 + 4 + 1 + 4 + + calendarEvent.GetTitle().size() + calendarEvent.GetDescription().size() + 1 + 4 + 4); + data << uint8(sendEventType); + data << uint64(eventId); + data << uint32(calendarEvent.GetTime()); + data << uint32(calendarEvent.GetFlags()); + data << uint32(calendarEvent.GetTime()); + data << uint8(calendarEvent.GetType()); + data << uint32(calendarEvent.GetDungeonId()); + data << calendarEvent.GetTitle().c_str(); + data << calendarEvent.GetDescription().c_str(); + data << uint8(calendarEvent.GetRepeatable()); + data << uint32(calendarEvent.GetMaxInvites()); + data << uint32(0); // FIXME + SendPacket(&data); } -void WorldSession::HandleCalendarEventInvite(WorldPacket& recv_data) +void WorldSession::SendCalendarEventRemovedAlert(CalendarEvent const& calendarEvent) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_EVENT_INVITE"); - recv_data.rfinish(); // set to end to avoid warnings spam + uint64 guid = _player->GetGUID(); + uint64 eventId = calendarEvent.GetEventId(); + uint32 eventTime = (calendarEvent.GetTime()); - //recv_data >> uint64 - //recv_data >> uint64 - //recv_data >> std::string - //recv_data >> uint8 - //recv_data >> uint8 + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_EVENT_REMOVED_ALERT [" UI64FMTD "] EventId [" + UI64FMTD "] Time %u", guid, eventId, eventTime); + + WorldPacket data(SMSG_CALENDAR_EVENT_REMOVED_ALERT, 1 + 8 + 1); + data << uint8(1); // FIXME: If true does not SignalEvent(EVENT_CALENDAR_ACTION_PENDING) + data << uint64(eventId); + data << uint32(eventTime); + SendPacket(&data); +} +void WorldSession::SendCalendarEventStatus(CalendarEvent const& calendarEvent, CalendarInvite const& invite) +{ + uint64 guid = _player->GetGUID(); + uint64 eventId = calendarEvent.GetEventId(); + uint64 inviteId = invite.GetInviteId(); + uint64 invitee = invite.GetInvitee(); + uint32 eventTime = (calendarEvent.GetTime()); + uint32 flags = calendarEvent.GetFlags(); + uint8 status = invite.GetStatus(); + uint8 rank = invite.GetRank(); + uint32 statusTime = secsToTimeBitFields(invite.GetStatusTime()); + + + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_EVENT_STATUS [" UI64FMTD "] EventId [" + UI64FMTD "] InviteId [" UI64FMTD "] Invitee [" UI64FMTD "] Time %u " + "Flags %u, Status %u, Rank %u, StatusTime %u", + guid, eventId, inviteId, invitee, eventTime, flags, status, rank, + statusTime); + + WorldPacket data(SMSG_CALENDAR_EVENT_STATUS, 8 + 8 + 4 + 4 + 1 + 1 + 4); + data.appendPackGUID(invitee); + data << uint64(eventId); + data << uint32(eventTime); + data << uint32(flags); + data << uint8(status); + data << uint8(rank); + data << uint32(statusTime); + SendPacket(&data); } -void WorldSession::HandleCalendarEventRsvp(WorldPacket& recv_data) +void WorldSession::SendCalendarEventModeratorStatusAlert(CalendarInvite const& invite) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_EVENT_RSVP"); - recv_data.rfinish(); // set to end to avoid warnings spam + uint64 guid = _player->GetGUID(); + uint64 eventId = invite.GetEventId(); + uint64 invitee = invite.GetInvitee(); + uint8 status = invite.GetStatus(); - //recv_data >> uint64 - //recv_data >> uint64 - //recv_data >> uint32 + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_EVENT_MODERATOR_STATUS_ALERT [" UI64FMTD + "] Invitee [" UI64FMTD "] EventId [" UI64FMTD "] Status %u ", guid, + invitee, eventId, status); + + + WorldPacket data(SMSG_CALENDAR_EVENT_MODERATOR_STATUS_ALERT, 8 + 8 + 1 + 1); + data.appendPackGUID(invitee); + data << uint64(eventId); + data << uint8(status); + data << uint8(1); // FIXME + SendPacket(&data); } -void WorldSession::HandleCalendarEventRemoveInvite(WorldPacket& recv_data) +void WorldSession::SendCalendarEventInviteRemoveAlert(CalendarEvent const& calendarEvent, CalendarInviteStatus status) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_EVENT_REMOVE_INVITE"); - recv_data.rfinish(); // set to end to avoid warnings spam + uint64 guid = _player->GetGUID(); + uint64 eventId = calendarEvent.GetEventId(); + uint32 eventTime = (calendarEvent.GetTime()); + uint32 flags = calendarEvent.GetFlags(); + + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_EVENT_INVITE_REMOVED_ALERT [" + UI64FMTD "] EventId [" UI64FMTD "] Time %u, Flags %u, Status %u", + guid, eventId, eventTime, flags, status); + + WorldPacket data(SMSG_CALENDAR_EVENT_INVITE_REMOVED_ALERT, 8 + 4 + 4 + 1); + data << uint64(eventId); + data << uint32(eventTime); + data << uint32(flags); + data << uint8(status); + SendPacket(&data); +} - //recv_data.readPackGUID(guid) - //recv_data >> uint64 - //recv_data >> uint64 - //recv_data >> uint64 +void WorldSession::SendCalendarEventInviteRemove(CalendarInvite const& invite, uint32 flags) +{ + uint64 guid = _player->GetGUID(); + uint64 eventId = invite.GetEventId(); + uint64 invitee = invite.GetInvitee(); + + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_EVENT_INVITE_REMOVED [" + UI64FMTD "] Invitee [" UI64FMTD "] EventId [" UI64FMTD + "] Flags %u", guid, invitee, eventId, flags); + + WorldPacket data(SMSG_CALENDAR_EVENT_INVITE_REMOVED, 8 + 4 + 4 + 1); + data.appendPackGUID(invitee); + data << uint32(eventId); + data << uint32(flags); + data << uint8(1); // FIXME + SendPacket(&data); } -void WorldSession::HandleCalendarEventStatus(WorldPacket& recv_data) +void WorldSession::SendCalendarClearPendingAction() { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_EVENT_STATUS"); - recv_data.rfinish(); // set to end to avoid warnings spam - - //recv_data.readPackGUID(guid) - //recv_data >> uint64 - //recv_data >> uint64 - //recv_data >> uint64 - //recv_data >> uint32 + uint64 guid = _player->GetGUID(); + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_CLEAR_PENDING_ACTION [" UI64FMTD "]", guid); + + WorldPacket data(SMSG_CALENDAR_CLEAR_PENDING_ACTION, 0); + SendPacket(&data); } -void WorldSession::HandleCalendarEventModeratorStatus(WorldPacket& recv_data) +void WorldSession::SendCalendarCommandResult(CalendarError err, char const* param /*= NULL*/) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_EVENT_MODERATOR_STATUS"); - recv_data.rfinish(); // set to end to avoid warnings spam - - //recv_data.readPackGUID(guid) - //recv_data >> uint64 - //recv_data >> uint64 - //recv_data >> uint64 - //recv_data >> uint32 + uint64 guid = _player->GetGUID(); + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_COMMAND_RESULT [" UI64FMTD "] Value: %u", guid, err); + + WorldPacket data(SMSG_CALENDAR_COMMAND_RESULT, 0); + data << uint32(0); + data << uint8(0); + switch (err) + { + case CALENDAR_ERROR_OTHER_INVITES_EXCEEDED: + case CALENDAR_ERROR_ALREADY_INVITED_TO_EVENT_S: + case CALENDAR_ERROR_IGNORING_YOU_S: + data << param; + break; + default: + data << uint8(0); + break; + } + + data << uint32(err); + + SendPacket(&data); } -void WorldSession::HandleCalendarComplain(WorldPacket& recv_data) +void WorldSession::SendCalendarRaidLockout(InstanceSave const* save, bool add) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_COMPLAIN"); - recv_data.rfinish(); // set to end to avoid warnings spam + sLog->outDebug(LOG_FILTER_NETWORKIO, "%s", add ? "SMSG_CALENDAR_RAID_LOCKOUT_ADDED" : "SMSG_CALENDAR_RAID_LOCKOUT_REMOVED"); + time_t currTime = time(NULL); - //recv_data >> uint64 - //recv_data >> uint64 - //recv_data >> uint64 + WorldPacket data(SMSG_CALENDAR_RAID_LOCKOUT_REMOVED, (add ? 4 : 0) + 4 + 4 + 4 + 8); + if (add) + { + data.SetOpcode(SMSG_CALENDAR_RAID_LOCKOUT_ADDED); + data << uint32(secsToTimeBitFields(currTime)); + } + + data << uint32(save->GetMapId()); + data << uint32(save->GetDifficulty()); + data << uint32(save->GetResetTime() - currTime); + data << uint64(save->GetInstanceId()); + SendPacket(&data); } -void WorldSession::HandleCalendarGetNumPending(WorldPacket& /*recv_data*/) +void WorldSession::SendCalendarRaidLockoutUpdated(InstanceSave const* save) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_GET_NUM_PENDING"); // empty + if (!save) + return; - WorldPacket data(SMSG_CALENDAR_SEND_NUM_PENDING, 4); - data << uint32(0); // 0 - no pending invites, 1 - some pending invites + uint64 guid = _player->GetGUID(); + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_CALENDAR_RAID_LOCKOUT_UPDATED [" UI64FMTD + "] Map: %u, Difficulty %u", guid, save->GetMapId(), save->GetDifficulty()); + + time_t cur_time = time_t(time(NULL)); + + WorldPacket data(SMSG_CALENDAR_RAID_LOCKOUT_UPDATED, 4 + 4 + 4 + 4 + 8); + data << secsToTimeBitFields(cur_time); + data << uint32(save->GetMapId()); + data << uint32(save->GetDifficulty()); + data << uint32(0); // Amount of seconds that has changed to the reset time + data << uint32(save->GetResetTime() - cur_time); SendPacket(&data); } diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 16129985d0f..887bebe5656 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -532,7 +532,7 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte if (result) { Field* fields = result->Fetch(); - createInfo->CharCount = fields[0].GetUInt8(); + createInfo->CharCount = uint8(fields[0].GetUInt64()); // SQL's COUNT() returns uint64 but it will always be less than uint8.Max if (createInfo->CharCount >= sWorld->getIntConfig(CONFIG_CHARACTERS_PER_REALM)) { @@ -711,7 +711,7 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte SQLTransaction trans = LoginDatabase.BeginTransaction(); - PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_REALM_CHARACTERS); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_REALM_CHARACTERS_BY_REALM); stmt->setUInt32(0, GetAccountId()); stmt->setUInt32(1, realmID); trans->Append(stmt); @@ -724,8 +724,6 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte LoginDatabase.CommitTransaction(trans); - newChar.CleanupsBeforeDelete(); - WorldPacket data(SMSG_CHAR_CREATE, 1); data << uint8(CHAR_CREATE_SUCCESS); SendPacket(&data); @@ -736,6 +734,7 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte sScriptMgr->OnPlayerCreate(&newChar); sWorld->AddCharacterNameData(newChar.GetGUIDLow(), std::string(newChar.GetName()), newChar.getGender(), newChar.getRace(), newChar.getClass()); + newChar.CleanupsBeforeDelete(); delete createInfo; _charCreateCallback.Reset(); } @@ -773,12 +772,17 @@ void WorldSession::HandleCharDeleteOpcode(WorldPacket & recv_data) return; } - QueryResult result = CharacterDatabase.PQuery("SELECT account, name FROM characters WHERE guid='%u'", GUID_LOPART(guid)); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ACCOUNT_NAME_BY_GUID); + + stmt->setUInt32(0, GUID_LOPART(guid)); + + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (result) { Field* fields = result->Fetch(); - accountId = fields[0].GetUInt32(); - name = fields[1].GetString(); + accountId = fields[0].GetUInt32(); + name = fields[1].GetString(); } // prevent deleting other players' characters using cheating tools @@ -1110,8 +1114,8 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder) SendNotification(LANG_GM_ON); std::string IP_str = GetRemoteAddress(); - sLog->outChar("Account: %d (IP: %s) Login Character:[%s] (GUID: %u)", - GetAccountId(), IP_str.c_str(), pCurrChar->GetName(), pCurrChar->GetGUIDLow()); + sLog->outChar("Account: %d (IP: %s) Login Character:[%s] (GUID: %u) Level: %d", + GetAccountId(), IP_str.c_str(), pCurrChar->GetName(), pCurrChar->GetGUIDLow(), pCurrChar->getLevel()); if (!pCurrChar->IsStandState() && !pCurrChar->HasUnitState(UNIT_STATE_STUNNED)) pCurrChar->SetStandState(UNIT_STAND_STATE_STAND); @@ -1222,8 +1226,10 @@ void WorldSession::HandleCharRenameOpcode(WorldPacket& recv_data) uint8 res = ObjectMgr::CheckPlayerName(newName, true); if (res != CHAR_NAME_SUCCESS) { - WorldPacket data(SMSG_CHAR_RENAME, 1); + WorldPacket data(SMSG_CHAR_RENAME, 1+8+(newName.size()+1)); data << uint8(res); + data << uint64(guid); + data << newName; SendPacket(&data); return; } @@ -1372,9 +1378,19 @@ void WorldSession::HandleSetPlayerDeclinedNames(WorldPacket& recv_data) CharacterDatabase.EscapeString(declinedname.name[i]); SQLTransaction trans = CharacterDatabase.BeginTransaction(); - trans->PAppend("DELETE FROM character_declinedname WHERE guid = '%u'", GUID_LOPART(guid)); - trans->PAppend("INSERT INTO character_declinedname (guid, genitive, dative, accusative, instrumental, prepositional) VALUES ('%u', '%s', '%s', '%s', '%s', '%s')", - GUID_LOPART(guid), declinedname.name[0].c_str(), declinedname.name[1].c_str(), declinedname.name[2].c_str(), declinedname.name[3].c_str(), declinedname.name[4].c_str()); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_DECLINED_NAME); + stmt->setUInt32(0, GUID_LOPART(guid)); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_DECLINED_NAME); + stmt->setUInt32(0, GUID_LOPART(guid)); + + for (uint8 i = 0; i < 5; i++) + stmt->setString(i+1, declinedname.name[i]); + + trans->Append(stmt); + CharacterDatabase.CommitTransaction(trans); WorldPacket data(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, 4+8); @@ -1471,7 +1487,12 @@ void WorldSession::HandleCharCustomize(WorldPacket& recv_data) uint8 gender, skin, face, hairStyle, hairColor, facialHair; recv_data >> gender >> skin >> hairColor >> hairStyle >> facialHair >> face; - QueryResult result = CharacterDatabase.PQuery("SELECT at_login FROM characters WHERE guid ='%u'", GUID_LOPART(guid)); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_AT_LOGIN); + + stmt->setUInt32(0, GUID_LOPART(guid)); + + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (!result) { WorldPacket data(SMSG_CHAR_CUSTOMIZE, 1); @@ -1530,15 +1551,19 @@ void WorldSession::HandleCharCustomize(WorldPacket& recv_data) } } - if (QueryResult oldNameResult = CharacterDatabase.PQuery("SELECT name FROM characters WHERE guid ='%u'", GUID_LOPART(guid))) + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_NAME); + stmt->setUInt32(0, GUID_LOPART(guid)); + result = CharacterDatabase.Query(stmt); + + if (result) { - std::string oldname = oldNameResult->Fetch()[0].GetString(); - std::string IP_str = GetRemoteAddress(); - sLog->outChar("Account: %d (IP: %s), Character[%s] (guid:%u) Customized to: %s", GetAccountId(), IP_str.c_str(), oldname.c_str(), GUID_LOPART(guid), newName.c_str()); + std::string oldname = result->Fetch()[0].GetString(); + sLog->outChar("Account: %d (IP: %s), Character[%s] (guid:%u) Customized to: %s", GetAccountId(), GetRemoteAddress().c_str(), oldname.c_str(), GUID_LOPART(guid), newName.c_str()); } + Player::Customize(guid, gender, skin, face, hairStyle, hairColor, facialHair); - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_NAME_AT_LOGIN); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_NAME_AT_LOGIN); stmt->setString(0, newName); stmt->setUInt16(1, uint16(AT_LOGIN_CUSTOMIZE)); @@ -1683,7 +1708,13 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) recv_data >> gender >> skin >> hairColor >> hairStyle >> facialHair >> face >> race; uint32 lowGuid = GUID_LOPART(guid); - QueryResult result = CharacterDatabase.PQuery("SELECT class, level, at_login FROM characters WHERE guid ='%u'", lowGuid); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_CLASS_LVL_AT_LOGIN); + + stmt->setUInt32(0, lowGuid); + + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (!result) { WorldPacket data(SMSG_CHAR_FACTION_CHANGE, 1); @@ -1693,8 +1724,8 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) } Field* fields = result->Fetch(); - uint32 playerClass = fields[0].GetUInt32(); - uint32 level = fields[1].GetUInt32(); + uint32 playerClass = uint32(fields[0].GetUInt8()); + uint32 level = uint32(fields[1].GetUInt8()); uint32 at_loginFlags = fields[2].GetUInt16(); uint32 used_loginFlag = ((recv_data.GetOpcode() == CMSG_CHAR_RACE_CHANGE) ? AT_LOGIN_CHANGE_RACE : AT_LOGIN_CHANGE_FACTION); @@ -1749,7 +1780,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) { WorldPacket data(SMSG_CHAR_FACTION_CHANGE, 1); data << uint8(CHAR_NAME_RESERVED); - SendPacket (&data); + SendPacket(&data); return; } @@ -1768,8 +1799,18 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) CharacterDatabase.EscapeString(newname); Player::Customize(guid, gender, skin, face, hairStyle, hairColor, facialHair); SQLTransaction trans = CharacterDatabase.BeginTransaction(); - trans->PAppend("UPDATE `characters` SET name='%s', race='%u', at_login=at_login & ~ %u WHERE guid='%u'", newname.c_str(), race, used_loginFlag, lowGuid); - trans->PAppend("DELETE FROM character_declinedname WHERE guid ='%u'", lowGuid); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_FACTION_OR_RACE); + stmt->setString(0, newname); + stmt->setUInt8(1, race); + stmt->setUInt16(2, used_loginFlag); + stmt->setUInt32(3, lowGuid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_DECLINED_NAME); + stmt->setUInt32(0, lowGuid); + trans->Append(stmt); + sWorld->UpdateCharacterNameData(GUID_LOPART(guid), newname, gender, race); BattlegroundTeamId team = BG_TEAM_ALLIANCE; @@ -1791,58 +1832,71 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) // Switch Languages // delete all languages first - trans->PAppend("DELETE FROM `character_skills` WHERE `skill` IN (98, 113, 759, 111, 313, 109, 115, 315, 673, 137, 791, 792) AND `guid`='%u'", lowGuid); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SKILL_LANGUAGES); + stmt->setUInt32(0, lowGuid); + trans->Append(stmt); + + // Now add them back + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_SKILL_LANGUAGE); + stmt->setUInt32(0, lowGuid); + + // Faction specific languages + if (team == BG_TEAM_HORDE) + stmt->setUInt16(1, 109); + else + stmt->setUInt16(1, 98); - // now add them back - if (team == BG_TEAM_ALLIANCE) + trans->Append(stmt); + + // Race specific languages + if (race != RACE_ORC && race != RACE_HUMAN) { - trans->PAppend("INSERT INTO `character_skills` (guid, skill, value, max) VALUES (%u, 98, 300, 300)", lowGuid); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_SKILL_LANGUAGE); + stmt->setUInt32(0, lowGuid); + switch (race) { - case RACE_DWARF: - trans->PAppend("INSERT INTO `character_skills` (guid, skill, value, max) VALUES (%u, 111, 300, 300)", lowGuid); - break; - case RACE_DRAENEI: - trans->PAppend("INSERT INTO `character_skills` (guid, skill, value, max) VALUES (%u, 759, 300, 300)", lowGuid); - break; - case RACE_GNOME: - trans->PAppend("INSERT INTO `character_skills` (guid, skill, value, max) VALUES (%u, 313, 300, 300)", lowGuid); - break; - case RACE_NIGHTELF: - trans->PAppend("INSERT INTO `character_skills` (guid, skill, value, max) VALUES (%u, 113, 300, 300)", lowGuid); - break; + case RACE_DWARF: + stmt->setUInt16(1, 111); + break; + case RACE_DRAENEI: + stmt->setUInt16(1, 759); + break; + case RACE_GNOME: + stmt->setUInt16(1, 313); + break; + case RACE_NIGHTELF: + stmt->setUInt16(1, 113); + break; case RACE_WORGEN: trans->PAppend("INSERT INTO `character_skills` (guid, skill, value, max) VALUES (%u, 791, 300, 300)", lowGuid); break; - } - } - else if (team == BG_TEAM_HORDE) - { - trans->PAppend("INSERT INTO `character_skills` (guid, skill, value, max) VALUES (%u, 109, 300, 300)", lowGuid); - switch (race) - { - case RACE_UNDEAD_PLAYER: - trans->PAppend("INSERT INTO `character_skills` (guid, skill, value, max) VALUES (%u, 673, 300, 300)", lowGuid); - break; - case RACE_TAUREN: - trans->PAppend("INSERT INTO `character_skills` (guid, skill, value, max) VALUES (%u, 115, 300, 300)", lowGuid); - break; - case RACE_TROLL: - trans->PAppend("INSERT INTO `character_skills` (guid, skill, value, max) VALUES (%u, 315, 300, 300)", lowGuid); - break; - case RACE_BLOODELF: - trans->PAppend("INSERT INTO `character_skills` (guid, skill, value, max) VALUES (%u, 137, 300, 300)", lowGuid); - break; + case RACE_UNDEAD_PLAYER: + stmt->setUInt16(1, 673); + break; + case RACE_TAUREN: + stmt->setUInt16(1, 115); + break; + case RACE_TROLL: + stmt->setUInt16(1, 315); + break; + case RACE_BLOODELF: + stmt->setUInt16(1, 137); + break; case RACE_GOBLIN: trans->PAppend("INSERT INTO `character_skills` (guid, skill, value, max) VALUES (%u, 792, 300, 300)", lowGuid); break; } + + trans->Append(stmt); } if (recv_data.GetOpcode() == CMSG_CHAR_FACTION_CHANGE) { // Delete all Flypaths - trans->PAppend("UPDATE `characters` SET taxi_path = '' WHERE guid ='%u'", lowGuid); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_TAXI_PATH); + stmt->setUInt32(0, lowGuid); + trans->Append(stmt); if (level > 7) { @@ -1884,11 +1938,17 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) taximaskstream << "0 "; taximaskstream << '0'; std::string taximask = taximaskstream.str(); - trans->PAppend("UPDATE `characters` SET `taximask`= '%s' WHERE `guid` = '%u'", taximask.c_str(), lowGuid); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_TAXIMASK); + stmt->setString(0, taximask); + stmt->setUInt32(1, lowGuid); + trans->Append(stmt); } // Delete all current quests - trans->PAppend("DELETE FROM `character_queststatus` WHERE guid ='%u'", GUID_LOPART(guid)); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_QUESTSTATUS); + stmt->setUInt32(0, GUID_LOPART(guid)); + trans->Append(stmt); // Delete record of the faction old completed quests { @@ -1926,7 +1986,12 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) if (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD)) { // Reset guild - if (QueryResult result = CharacterDatabase.PQuery("SELECT guildid FROM `guild_member` WHERE guid ='%u'", lowGuid)) + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_MEMBER); + + stmt->setUInt32(0, lowGuid); + + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (result) if (Guild* guild = sGuildMgr->GetGuildById((result->Fetch()[0]).GetUInt32())) guild->DeleteMember(MAKE_NEW_GUID(lowGuid, 0, HIGHGUID_PLAYER)); } @@ -1934,15 +1999,21 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) if (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_ADD_FRIEND)) { // Delete Friend List - trans->PAppend("DELETE FROM `character_social` WHERE `guid`= '%u'", lowGuid); - trans->PAppend("DELETE FROM `character_social` WHERE `friend`= '%u'", lowGuid); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SOCIAL_BY_GUID); + stmt->setUInt32(0, lowGuid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SOCIAL_BY_FRIEND); + stmt->setUInt32(0, lowGuid); + trans->Append(stmt); + } // Leave Arena Teams Player::LeaveAllArenaTeams(guid); // Reset homebind and position - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PLAYER_HOMEBIND); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PLAYER_HOMEBIND); stmt->setUInt32(0, lowGuid); trans->Append(stmt); @@ -1973,10 +2044,17 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) { uint32 achiev_alliance = it->first; uint32 achiev_horde = it->second; - trans->PAppend("DELETE FROM `character_achievement` WHERE `achievement`=%u AND `guid`=%u", - team == BG_TEAM_ALLIANCE ? achiev_alliance : achiev_horde, lowGuid); - trans->PAppend("UPDATE `character_achievement` SET achievement = '%u' where achievement = '%u' AND guid = '%u'", - team == BG_TEAM_ALLIANCE ? achiev_alliance : achiev_horde, team == BG_TEAM_ALLIANCE ? achiev_horde : achiev_alliance, lowGuid); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACHIEVEMENT_BY_ACHIEVEMENT); + stmt->setUInt16(0, uint16(team == BG_TEAM_ALLIANCE ? achiev_alliance : achiev_horde)); + stmt->setUInt32(1, lowGuid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_ACHIEVEMENT); + stmt->setUInt16(0, uint16(team == BG_TEAM_ALLIANCE ? achiev_alliance : achiev_horde)); + stmt->setUInt16(1, uint16(team == BG_TEAM_ALLIANCE ? achiev_horde : achiev_alliance)); + stmt->setUInt32(2, lowGuid); + trans->Append(stmt); } // Item conversion @@ -1984,8 +2062,12 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) { uint32 item_alliance = it->first; uint32 item_horde = it->second; - trans->PAppend("UPDATE `item_instance` ii, `character_inventory` ci SET ii.itemEntry = '%u' WHERE ii.itemEntry = '%u' AND ci.guid = '%u' AND ci.item = ii.guid", - team == BG_TEAM_ALLIANCE ? item_alliance : item_horde, team == BG_TEAM_ALLIANCE ? item_horde : item_alliance, guid); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_INVENTORY_FACTION_CHANGE); + stmt->setUInt32(0, (team == BG_TEAM_ALLIANCE ? item_alliance : item_horde)); + stmt->setUInt32(1, (team == BG_TEAM_ALLIANCE ? item_horde : item_alliance)); + stmt->setUInt32(2, guid); + trans->Append(stmt); } // Spell conversion @@ -1993,10 +2075,17 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) { uint32 spell_alliance = it->first; uint32 spell_horde = it->second; - trans->PAppend("DELETE FROM `character_spell` WHERE `spell`=%u AND `guid`=%u", - team == BG_TEAM_ALLIANCE ? spell_alliance : spell_horde, lowGuid); - trans->PAppend("UPDATE `character_spell` SET spell = '%u' where spell = '%u' AND guid = '%u'", - team == BG_TEAM_ALLIANCE ? spell_alliance : spell_horde, team == BG_TEAM_ALLIANCE ? spell_horde : spell_alliance, lowGuid); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SPELL_BY_SPELL); + stmt->setUInt32(0, (team == BG_TEAM_ALLIANCE ? spell_alliance : spell_horde)); + stmt->setUInt32(1, lowGuid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_SPELL_FACTION_CHANGE); + stmt->setUInt32(0, (team == BG_TEAM_ALLIANCE ? spell_alliance : spell_horde)); + stmt->setUInt32(1, (team == BG_TEAM_ALLIANCE ? spell_horde : spell_alliance)); + stmt->setUInt32(2, lowGuid); + trans->Append(stmt); } // Reputation conversion @@ -2004,10 +2093,17 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) { uint32 reputation_alliance = it->first; uint32 reputation_horde = it->second; - trans->PAppend("DELETE FROM character_reputation WHERE faction = '%u' AND guid = '%u'", - team == BG_TEAM_ALLIANCE ? reputation_alliance : reputation_horde, lowGuid); - trans->PAppend("UPDATE `character_reputation` SET faction = '%u' where faction = '%u' AND guid = '%u'", - team == BG_TEAM_ALLIANCE ? reputation_alliance : reputation_horde, team == BG_TEAM_ALLIANCE ? reputation_horde : reputation_alliance, lowGuid); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_REP_BY_FACTION); + stmt->setUInt32(0, uint16(team == BG_TEAM_ALLIANCE ? reputation_alliance : reputation_horde)); + stmt->setUInt32(1, lowGuid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_REP_FACTION_CHANGE); + stmt->setUInt16(0, uint16(team == BG_TEAM_ALLIANCE ? reputation_alliance : reputation_horde)); + stmt->setUInt16(1, uint16(team == BG_TEAM_ALLIANCE ? reputation_horde : reputation_alliance)); + stmt->setUInt32(2, lowGuid); + trans->Append(stmt); } } diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp index 3d919335e1a..d725419ac84 100755 --- a/src/server/game/Handlers/GroupHandler.cpp +++ b/src/server/game/Handlers/GroupHandler.cpp @@ -277,8 +277,9 @@ void WorldSession::HandleGroupDeclineOpcode(WorldPacket & /*recv_data*/) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_DECLINE"); - Group *group = GetPlayer()->GetGroupInvite(); - if (!group) return; + Group* group = GetPlayer()->GetGroupInvite(); + if (!group) + return; // Remember leader if online (group pointer will be invalid if group gets disbanded) Player* leader = ObjectAccessor::FindPlayer(group->GetLeaderGUID()); @@ -459,7 +460,8 @@ void WorldSession::HandleLootMethodOpcode(WorldPacket & recv_data) void WorldSession::HandleLootRoll(WorldPacket &recv_data) { - if (!GetPlayer()->GetGroup()) + Group* group = GetPlayer()->GetGroup(); + if (!group) { recv_data.rfinish(); return; @@ -472,12 +474,6 @@ void WorldSession::HandleLootRoll(WorldPacket &recv_data) recv_data >> NumberOfPlayers; recv_data >> rollType; //0: pass, 1: need, 2: greed - //sLog->outDebug("WORLD RECIEVE CMSG_LOOT_ROLL, From:%u, Numberofplayers:%u, Choise:%u", (uint32)Guid, NumberOfPlayers, Choise); - - Group* group = GetPlayer()->GetGroup(); - if (!group) - return; - // everything's fine, do it group->CountRollVote(GetPlayer()->GetGUID(), Guid, NumberOfPlayers, rollType); diff --git a/src/server/game/Handlers/GuildHandler.cpp b/src/server/game/Handlers/GuildHandler.cpp index fd3f0c07fb4..c2ff61bb912 100755 --- a/src/server/game/Handlers/GuildHandler.cpp +++ b/src/server/game/Handlers/GuildHandler.cpp @@ -373,8 +373,8 @@ void WorldSession::HandleGuildBankerActivate(WorldPacket & recv_data) uint64 GoGuid; recv_data >> GoGuid; - uint8 unk; - recv_data >> unk; + uint8 fullSlotList; + recv_data >> fullSlotList; // 0 = only slots updated in last operation are shown. 1 = all slots updated if (GetPlayer()->GetGameObjectIfCanInteractWith(GoGuid, GAMEOBJECT_TYPE_GUILD_BANK)) { @@ -396,8 +396,8 @@ void WorldSession::HandleGuildBankQueryTab(WorldPacket & recv_data) uint8 tabId; recv_data >> tabId; - uint8 unk1; - recv_data >> unk1; + uint8 fullSlotList; + recv_data >> fullSlotList; // 0 = only slots updated in last operation are shown. 1 = all slots updated if (GetPlayer()->GetGameObjectIfCanInteractWith(GoGuid, GAMEOBJECT_TYPE_GUILD_BANK)) if (Guild* guild = _GetPlayerGuild(this)) diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 00ff1f8ffa4..2d85a4cb689 100755 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -115,7 +115,7 @@ void WorldSession::HandleSwapItem(WorldPacket & recv_data) //sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_SWAP_ITEM"); uint8 dstbag, dstslot, srcbag, srcslot; - recv_data >> dstbag >> dstslot >> srcbag >> srcslot ; + recv_data >> dstbag >> dstslot >> srcbag >> srcslot; //sLog->outDebug("STORAGE: receive srcbag = %u, srcslot = %u, dstbag = %u, dstslot = %u", srcbag, srcslot, dstbag, dstslot); uint16 src = ((srcbag << 8) | srcslot); @@ -1144,7 +1144,14 @@ void WorldSession::HandleWrapItemOpcode(WorldPacket& recv_data) } SQLTransaction trans = CharacterDatabase.BeginTransaction(); - trans->PAppend("INSERT INTO character_gifts VALUES ('%u', '%u', '%u', '%u')", GUID_LOPART(item->GetOwnerGUID()), item->GetGUIDLow(), item->GetEntry(), item->GetUInt32Value(ITEM_FIELD_FLAGS)); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_GIFT); + stmt->setUInt32(0, GUID_LOPART(item->GetOwnerGUID())); + stmt->setUInt32(1, item->GetGUIDLow()); + stmt->setUInt32(2, item->GetEntry()); + stmt->setUInt32(3, item->GetUInt32Value(ITEM_FIELD_FLAGS)); + trans->Append(stmt); + item->SetEntry(gift->GetEntry()); switch (item->GetEntry()) @@ -1282,7 +1289,6 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data) } } } - } } diff --git a/src/server/game/Handlers/LFGHandler.cpp b/src/server/game/Handlers/LFGHandler.cpp index 842e19cf510..9c66ca44383 100755 --- a/src/server/game/Handlers/LFGHandler.cpp +++ b/src/server/game/Handlers/LFGHandler.cpp @@ -72,7 +72,7 @@ void WorldSession::HandleLfgJoinOpcode(WorldPacket& recv_data) } LfgDungeonSet newDungeons; - for (int8 i = 0 ; i < numDungeons; ++i) + for (int8 i = 0; i < numDungeons; ++i) { recv_data >> dungeon; newDungeons.insert((dungeon & 0x00FFFFFF)); // remove the type from the dungeon entry @@ -527,9 +527,9 @@ void WorldSession::SendLfgBootPlayer(const LfgPlayerBoot* pBoot) ++agreeNum; } } - sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_BOOT_PLAYER [" UI64FMTD "] inProgress: %u - didVote: %u - agree: %u - victim: [" UI64FMTD "] votes: %u - agrees: %u - left: %u - needed: %u - reason %s", + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_BOOT_PROPOSAL_UPDATE [" UI64FMTD "] inProgress: %u - didVote: %u - agree: %u - victim: [" UI64FMTD "] votes: %u - agrees: %u - left: %u - needed: %u - reason %s", guid, uint8(pBoot->inProgress), uint8(playerVote != LFG_ANSWER_PENDING), uint8(playerVote == LFG_ANSWER_AGREE), pBoot->victim, votesNum, agreeNum, secsleft, pBoot->votedNeeded, pBoot->reason.c_str()); - WorldPacket data(SMSG_LFG_BOOT_PLAYER, 1 + 1 + 1 + 8 + 4 + 4 + 4 + 4 + pBoot->reason.length()); + WorldPacket data(SMSG_LFG_BOOT_PROPOSAL_UPDATE, 1 + 1 + 1 + 8 + 4 + 4 + 4 + 4 + pBoot->reason.length()); data << uint8(pBoot->inProgress); // Vote in progress data << uint8(playerVote != LFG_ANSWER_PENDING); // Did Vote data << uint8(playerVote == LFG_ANSWER_AGREE); // Agree diff --git a/src/server/game/Handlers/LootHandler.cpp b/src/server/game/Handlers/LootHandler.cpp index 6508f08dc22..8e4b41a9be4 100755 --- a/src/server/game/Handlers/LootHandler.cpp +++ b/src/server/game/Handlers/LootHandler.cpp @@ -80,9 +80,9 @@ void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket & recv_data) { Creature* creature = GetPlayer()->GetMap()->GetCreature(lguid); - bool ok_loot = creature && creature->isAlive() == (player->getClass() == CLASS_ROGUE && creature->lootForPickPocketed); + bool lootAllowed = creature && creature->isAlive() == (player->getClass() == CLASS_ROGUE && creature->lootForPickPocketed); - if (!ok_loot || !creature->IsWithinDistInMap(_player, INTERACTION_DISTANCE)) + if (!lootAllowed || !creature->IsWithinDistInMap(_player, INTERACTION_DISTANCE)) { player->SendLootRelease(lguid); return; @@ -386,8 +386,8 @@ void WorldSession::DoLootRelease(uint64 lguid) { Creature* creature = GetPlayer()->GetMap()->GetCreature(lguid); - bool ok_loot = creature && creature->isAlive() == (player->getClass() == CLASS_ROGUE && creature->lootForPickPocketed); - if (!ok_loot || !creature->IsWithinDistInMap(_player, INTERACTION_DISTANCE)) + bool lootAllowed = creature && creature->isAlive() == (player->getClass() == CLASS_ROGUE && creature->lootForPickPocketed); + if (!lootAllowed || !creature->IsWithinDistInMap(_player, INTERACTION_DISTANCE)) return; loot = &creature->loot; @@ -448,7 +448,7 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPacket & recv_data) if (_player->GetLootGUID() != lootguid) return; - Loot* pLoot = NULL; + Loot* loot = NULL; if (IS_CRE_OR_VEH_GUID(GetPlayer()->GetLootGUID())) { @@ -456,7 +456,7 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPacket & recv_data) if (!creature) return; - pLoot = &creature->loot; + loot = &creature->loot; } else if (IS_GAMEOBJECT_GUID(GetPlayer()->GetLootGUID())) { @@ -464,19 +464,19 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPacket & recv_data) if (!pGO) return; - pLoot = &pGO->loot; + loot = &pGO->loot; } - if (!pLoot) + if (!loot) return; - if (slotid > pLoot->items.size()) + if (slotid > loot->items.size()) { - sLog->outDebug(LOG_FILTER_LOOT, "MasterLootItem: Player %s might be using a hack! (slot %d, size %lu)", GetPlayer()->GetName(), slotid, (unsigned long)pLoot->items.size()); + sLog->outDebug(LOG_FILTER_LOOT, "MasterLootItem: Player %s might be using a hack! (slot %d, size %lu)", GetPlayer()->GetName(), slotid, (unsigned long)loot->items.size()); return; } - LootItem& item = pLoot->items[slotid]; + LootItem& item = loot->items[slotid]; ItemPosCountVec dest; InventoryResult msg = target->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, item.itemid, item.count); @@ -495,14 +495,13 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPacket & recv_data) Item* newitem = target->StoreNewItem(dest, item.itemid, true, item.randomPropertyId, looters); target->SendNewItem(newitem, uint32(item.count), false, false, true); target->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM, item.itemid, item.count); - target->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE, pLoot->loot_type, item.count); + target->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE, loot->loot_type, item.count); target->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_EPIC_ITEM, item.itemid, item.count); // mark as looted item.count=0; item.is_looted=true; - pLoot->NotifyItemRemoved(slotid); - --pLoot->unlootedCount; + loot->NotifyItemRemoved(slotid); + --loot->unlootedCount; } - diff --git a/src/server/game/Handlers/MailHandler.cpp b/src/server/game/Handlers/MailHandler.cpp index 95459bae0fa..988857558c9 100755 --- a/src/server/game/Handlers/MailHandler.cpp +++ b/src/server/game/Handlers/MailHandler.cpp @@ -128,12 +128,26 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data) else { rc_team = sObjectMgr->GetPlayerTeamByGUID(rc); - if (QueryResult result = CharacterDatabase.PQuery("SELECT COUNT(*) FROM mail WHERE receiver = '%u'", GUID_LOPART(rc))) + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAIL_COUNT); + + stmt->setUInt32(0, GUID_LOPART(rc)); + + PreparedQueryResult result = CharacterDatabase.Query(stmt); + + if (result) { Field* fields = result->Fetch(); - mails_count = fields[0].GetUInt32(); + mails_count = fields[0].GetUInt64(); } - if (QueryResult result = CharacterDatabase.PQuery("SELECT level FROM characters WHERE guid = '%u'", GUID_LOPART(rc))) + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_LEVEL); + + stmt->setUInt32(0, GUID_LOPART(rc)); + + result = CharacterDatabase.Query(stmt); + + if (result) { Field* fields = result->Fetch(); receiveLevel = fields[0].GetUInt8(); @@ -360,8 +374,15 @@ void WorldSession::HandleMailReturnToSender(WorldPacket & recv_data) //we can return mail now //so firstly delete the old one SQLTransaction trans = CharacterDatabase.BeginTransaction(); - trans->PAppend("DELETE FROM mail WHERE id = '%u'", mailId); // needed? - trans->PAppend("DELETE FROM mail_items WHERE mail_id = '%u'", mailId); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_MAIL_BY_ID); + stmt->setUInt32(0, mailId); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_MAIL_ITEM_BY_ID); + stmt->setUInt32(0, mailId); + trans->Append(stmt); + player->RemoveMail(mailId); // only return mail if the player exists (and delete if not existing) @@ -541,7 +562,7 @@ void WorldSession::HandleGetMailList(WorldPacket & recv_data) //load players mails, and mailed items if (!player->m_mailsLoaded) - player ->_LoadMail(); + player->_LoadMail(); // client can't work with packets > max int16 value const uint32 maxPacketSize = 32767; diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index e04704785e0..7cea7b2ea8e 100755 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -51,6 +51,7 @@ #include "GameObjectAI.h" #include "Group.h" #include "AccountMgr.h" +#include "Spell.h" void WorldSession::HandleRepopRequestOpcode(WorldPacket & recv_data) { @@ -125,11 +126,11 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data) if (GetPlayer()->HasUnitState(UNIT_STATE_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); - if ((unit && unit->GetCreatureInfo()->ScriptID != unit->LastUsedScriptID) || (go && go->GetGOInfo()->ScriptId != go->LastUsedScriptID)) + if ((unit && unit->GetCreatureTemplate()->ScriptID != unit->LastUsedScriptID) || (go && go->GetGOInfo()->ScriptId != go->LastUsedScriptID)) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleGossipSelectOptionOpcode - Script reloaded while in use, ignoring and set new scipt id"); if (unit) - unit->LastUsedScriptID = unit->GetCreatureInfo()->ScriptID; + unit->LastUsedScriptID = unit->GetCreatureTemplate()->ScriptID; if (go) go->LastUsedScriptID = go->GetGOInfo()->ScriptId; _player->PlayerTalkClass->SendCloseGossip(); @@ -374,7 +375,7 @@ void WorldSession::HandleLogoutRequestOpcode(WorldPacket & /*recv_data*/) if (GetPlayer()->isInCombat()) reason = 1; - else if (GetPlayer()->m_movementInfo.HasMovementFlag(MOVEMENTFLAG_JUMPING | MOVEMENTFLAG_FALLING)) + else if (GetPlayer()->m_movementInfo.HasMovementFlag(MOVEMENTFLAG_FALLING | MOVEMENTFLAG_FALLING_FAR)) reason = 3; // is jumping or falling else if (GetPlayer()->duel || GetPlayer()->HasAura(9454)) // is dueling or frozen by GM via freeze command reason = 2; // FIXME - Need the correct value @@ -429,6 +430,10 @@ void WorldSession::HandleLogoutCancelOpcode(WorldPacket & /*recv_data*/) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_LOGOUT_CANCEL Message"); + // Player have already logged out serverside, too late to cancel + if (!GetPlayer()) + return; + LogoutRequest(0); WorldPacket data(SMSG_LOGOUT_CANCEL_ACK, 0); @@ -818,7 +823,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recv_data) Player* player = GetPlayer(); if (player->isInFlight()) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "Player '%s' (GUID: %u) in flight, ignore Area Trigger ID:%u", + sLog->outDebug(LOG_FILTER_NETWORKIO, "HandleAreaTriggerOpcode: Player '%s' (GUID: %u) in flight, ignore Area Trigger ID:%u", player->GetName(), player->GetGUIDLow(), triggerId); return; } @@ -826,14 +831,14 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recv_data) AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(triggerId); if (!atEntry) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "Player '%s' (GUID: %u) send unknown (by DBC) Area Trigger ID:%u", + sLog->outDebug(LOG_FILTER_NETWORKIO, "HandleAreaTriggerOpcode: Player '%s' (GUID: %u) send unknown (by DBC) Area Trigger ID:%u", player->GetName(), player->GetGUIDLow(), triggerId); return; } if (player->GetMapId() != atEntry->mapid) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "Player '%s' (GUID: %u) too far (trigger map: %u player map: %u), ignore Area Trigger ID: %u", + sLog->outDebug(LOG_FILTER_NETWORKIO, "HandleAreaTriggerOpcode: Player '%s' (GUID: %u) too far (trigger map: %u player map: %u), ignore Area Trigger ID: %u", player->GetName(), atEntry->mapid, player->GetMapId(), player->GetGUIDLow(), triggerId); return; } @@ -847,7 +852,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recv_data) float dist = player->GetDistance(atEntry->x, atEntry->y, atEntry->z); if (dist > atEntry->radius + delta) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "Player '%s' (GUID: %u) too far (radius: %f distance: %f), ignore Area Trigger ID: %u", + sLog->outDebug(LOG_FILTER_NETWORKIO, "HandleAreaTriggerOpcode: Player '%s' (GUID: %u) too far (radius: %f distance: %f), ignore Area Trigger ID: %u", player->GetName(), player->GetGUIDLow(), atEntry->radius, dist, triggerId); return; } @@ -878,7 +883,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recv_data) (fabs(dy) > atEntry->box_y / 2 + delta) || (fabs(dz) > atEntry->box_z / 2 + delta)) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "Player '%s' (GUID: %u) too far (1/2 box X: %f 1/2 box Y: %f 1/2 box Z: %f rotatedPlayerX: %f rotatedPlayerY: %f dZ:%f), ignore Area Trigger ID: %u", + sLog->outDebug(LOG_FILTER_NETWORKIO, "HandleAreaTriggerOpcode: Player '%s' (GUID: %u) too far (1/2 box X: %f 1/2 box Y: %f 1/2 box Z: %f rotatedPlayerX: %f rotatedPlayerY: %f dZ:%f), ignore Area Trigger ID: %u", player->GetName(), player->GetGUIDLow(), atEntry->box_x/2, atEntry->box_y/2, atEntry->box_z/2, rotPlayerX, rotPlayerY, dz, triggerId); return; } @@ -1065,7 +1070,7 @@ void WorldSession::HandleSetActionButtonOpcode(WorldPacket& recv_data) sLog->outDetail("MISC: Added Item %u into button %u", action, button); break; default: - sLog->outError("MISC: Unknown action button type %u for action %u into button %u", type, action, button); + sLog->outError("MISC: Unknown action button type %u for action %u into button %u for player %s (GUID: %u)", type, action, button, _player->GetName(), _player->GetGUIDLow()); return; } GetPlayer()->addActionButton(button, action, type); @@ -1327,7 +1332,12 @@ void WorldSession::HandleWhoisOpcode(WorldPacket& recv_data) uint32 accid = player->GetSession()->GetAccountId(); - QueryResult result = LoginDatabase.PQuery("SELECT username, email, last_ip FROM account WHERE id=%u", accid); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_WHOIS); + + stmt->setUInt32(0, accid); + + PreparedQueryResult result = LoginDatabase.Query(stmt); + if (!result) { SendNotification(LANG_ACCOUNT_FOR_PLAYER_NOT_FOUND, charname.c_str()); @@ -1349,7 +1359,7 @@ void WorldSession::HandleWhoisOpcode(WorldPacket& recv_data) WorldPacket data(SMSG_WHOIS, msg.size()+1); data << msg; - _player->GetSession()->SendPacket(&data); + SendPacket(&data); sLog->outDebug(LOG_FILTER_NETWORKIO, "Received whois command from player %s for character %s", GetPlayer()->GetName(), charname.c_str()); } @@ -1526,16 +1536,16 @@ void WorldSession::HandleSetDungeonDifficultyOpcode(WorldPacket & recv_data) { for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) { - Player* pGroupGuy = itr->getSource(); - if (!pGroupGuy) + Player* groupGuy = itr->getSource(); + if (!groupGuy) continue; - if (!pGroupGuy->IsInMap(pGroupGuy)) + if (!groupGuy->IsInMap(groupGuy)) return; - if (pGroupGuy->GetMap()->IsNonRaidDungeon()) + if (groupGuy->GetMap()->IsNonRaidDungeon()) { - sLog->outError("WorldSession::HandleSetDungeonDifficultyOpcode: player %d tried to reset the instance while group member (Name: %s, GUID: %u) is inside!", _player->GetGUIDLow(), pGroupGuy->GetName(), pGroupGuy->GetGUIDLow()); + sLog->outError("WorldSession::HandleSetDungeonDifficultyOpcode: player %d tried to reset the instance while group member (Name: %s, GUID: %u) is inside!", _player->GetGUIDLow(), groupGuy->GetName(), groupGuy->GetGUIDLow()); return; } } @@ -1583,14 +1593,14 @@ void WorldSession::HandleSetRaidDifficultyOpcode(WorldPacket & recv_data) { for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) { - Player* pGroupGuy = itr->getSource(); - if (!pGroupGuy) + Player* groupGuy = itr->getSource(); + if (!groupGuy) continue; - if (!pGroupGuy->IsInMap(pGroupGuy)) + if (!groupGuy->IsInMap(groupGuy)) return; - if (pGroupGuy->GetMap()->IsRaid()) + if (groupGuy->GetMap()->IsRaid()) { sLog->outError("WorldSession::HandleSetRaidDifficultyOpcode: player %d tried to reset the instance while inside!", _player->GetGUIDLow()); return; @@ -1779,3 +1789,47 @@ void WorldSession::HandleRequestHotfix(WorldPacket& recvPacket) delete[] guidBytes; delete[] mask; } + +void WorldSession::HandleUpdateMissileTrajectory(WorldPacket& recvPacket) +{ + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_UPDATE_MISSILE_TRAJECTORY"); + + uint64 guid; + uint32 spellId; + float elevation, speed; + float curX, curY, curZ; + float targetX, targetY, targetZ; + uint8 moveStop; + + recvPacket >> guid >> spellId >> elevation >> speed; + recvPacket >> curX >> curY >> curZ; + recvPacket >> targetX >> targetY >> targetZ; + recvPacket >> moveStop; + + Unit* caster = ObjectAccessor::GetUnit(*_player, guid); + Spell* spell = caster ? caster->GetCurrentSpell(CURRENT_GENERIC_SPELL) : NULL; + if (!spell || spell->m_spellInfo->Id != spellId || !spell->m_targets.HasDst() || !spell->m_targets.HasSrc()) + { + recvPacket.rfinish(); + return; + } + + Position pos = *spell->m_targets.GetSrcPos(); + pos.Relocate(curX, curY, curZ); + spell->m_targets.ModSrc(pos); + + pos = *spell->m_targets.GetDstPos(); + pos.Relocate(targetX, targetY, targetZ); + spell->m_targets.ModDst(pos); + + spell->m_targets.SetElevation(elevation); + spell->m_targets.SetSpeed(speed); + + if (moveStop) + { + uint32 opcode; + recvPacket >> opcode; + recvPacket.SetOpcode(opcode); + HandleMovementOpcodes(recvPacket); + } +} diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp index 5cac0b99c77..3d9968d9a9d 100755 --- a/src/server/game/Handlers/MovementHandler.cpp +++ b/src/server/game/Handlers/MovementHandler.cpp @@ -47,7 +47,7 @@ void WorldSession::HandleMoveWorldportAckOpcode() GetPlayer()->SetSemaphoreTeleportFar(false); // get the teleport destination - WorldLocation &loc = GetPlayer()->GetTeleportDest(); + WorldLocation const loc = GetPlayer()->GetTeleportDest(); // possible errors in the coordinate validity check if (!MapManager::IsValidMapCoord(loc)) @@ -65,10 +65,9 @@ void WorldSession::HandleMoveWorldportAckOpcode() GetPlayer()->m_InstanceValid = true; Map* oldMap = GetPlayer()->GetMap(); - ASSERT(oldMap); if (GetPlayer()->IsInWorld()) { - sLog->outCrash("Player (Name %s) is still in world when teleported from map %u to new map %u", GetPlayer()->GetName(), oldMap->GetId(), loc.GetMapId()); + sLog->outError("Player (Name %s) is still in world when teleported from map %u to new map %u", GetPlayer()->GetName(), oldMap->GetId(), loc.GetMapId()); oldMap->RemovePlayerFromMap(GetPlayer(), false); } @@ -213,8 +212,7 @@ void WorldSession::HandleMoveTeleportAck(WorldPacket& recv_data) sLog->outStaticDebug("Guid " UI64FMTD, guid); sLog->outStaticDebug("Flags %u, time %u", flags, time/IN_MILLISECONDS); - Unit* mover = _player->m_mover; - Player* plMover = mover->GetTypeId() == TYPEID_PLAYER ? (Player*)mover : NULL; + Player* plMover = _player->m_mover->ToPlayer(); if (!plMover || !plMover->IsBeingTeleportedNear()) return; @@ -253,25 +251,25 @@ void WorldSession::HandleMoveTeleportAck(WorldPacket& recv_data) GetPlayer()->ProcessDelayedOperations(); } -void WorldSession::HandleMovementOpcodes(WorldPacket & recv_data) +void WorldSession::HandleMovementOpcodes(WorldPacket & recvData) { - uint16 opcode = recv_data.GetOpcode(); + uint16 opcode = recvData.GetOpcode(); Unit* mover = _player->m_mover; - ASSERT(mover != NULL); // there must always be a mover + ASSERT(mover != NULL); // there must always be a mover - Player* plMover = mover->GetTypeId() == TYPEID_PLAYER ? (Player*)mover : NULL; + Player* plrMover = mover->ToPlayer(); // ignore, waiting processing in WorldSession::HandleMoveWorldportAckOpcode and WorldSession::HandleMoveTeleportAck - if (plMover && plMover->IsBeingTeleported()) + if (plrMover && plrMover->IsBeingTeleported()) { return; } /* extract packet */ MovementInfo movementInfo; - ReadMovementInfo(recv_data, &movementInfo); + ReadMovementInfo(recvData, &movementInfo); // prevent tampered movement data if (movementInfo.guid != mover->GetGUID()) @@ -292,27 +290,27 @@ void WorldSession::HandleMovementOpcodes(WorldPacket & recv_data) // (also received at zeppelin leave by some reason with t_* as absolute in continent coordinates, can be safely skipped) if (movementInfo.t_pos.GetPositionX() > 50 || movementInfo.t_pos.GetPositionY() > 50 || movementInfo.t_pos.GetPositionZ() > 50) { - recv_data.rfinish(); // prevent warnings spam + recvData.rfinish(); // prevent warnings spam return; } if (!Trinity::IsValidMapCoord(movementInfo.pos.GetPositionX() + movementInfo.t_pos.GetPositionX(), movementInfo.pos.GetPositionY() + movementInfo.t_pos.GetPositionY(), movementInfo.pos.GetPositionZ() + movementInfo.t_pos.GetPositionZ(), movementInfo.pos.GetOrientation() + movementInfo.t_pos.GetOrientation())) { - recv_data.rfinish(); // prevent warnings spam + recvData.rfinish(); // prevent warnings spam return; } // if we boarded a transport, add us to it - if (plMover && !plMover->GetTransport()) + if (plrMover && !plrMover->GetTransport()) { // elevators also cause the client to send MOVEMENTFLAG_ONTRANSPORT - just dismount if the guid can be found in the transport list for (MapManager::TransportSet::const_iterator iter = sMapMgr->m_Transports.begin(); iter != sMapMgr->m_Transports.end(); ++iter) { if ((*iter)->GetGUID() == movementInfo.t_guid) { - plMover->m_transport = (*iter); - (*iter)->AddPassenger(plMover); + plrMover->m_transport = (*iter); + (*iter)->AddPassenger(plrMover); break; } } @@ -325,23 +323,23 @@ void WorldSession::HandleMovementOpcodes(WorldPacket & recv_data) movementInfo.flags &= ~MOVEMENTFLAG_ONTRANSPORT; } } - else if (plMover && plMover->GetTransport()) // if we were on a transport, leave + else if (plrMover && plrMover->GetTransport()) // if we were on a transport, leave { - plMover->m_transport->RemovePassenger(plMover); - plMover->m_transport = NULL; + plrMover->m_transport->RemovePassenger(plrMover); + plrMover->m_transport = NULL; movementInfo.t_pos.Relocate(0.0f, 0.0f, 0.0f, 0.0f); movementInfo.t_time = 0; movementInfo.t_seat = -1; } // fall damage generation (ignore in flight case that can be triggered also at lags in moment teleportation to another map). - if (opcode == MSG_MOVE_FALL_LAND && plMover && !plMover->isInFlight()) - plMover->HandleFall(movementInfo); + if (opcode == MSG_MOVE_FALL_LAND && plrMover && !plrMover->isInFlight()) + plrMover->HandleFall(movementInfo); - if (plMover && ((movementInfo.flags & MOVEMENTFLAG_SWIMMING) != 0) != plMover->IsInWater()) + if (plrMover && ((movementInfo.flags & MOVEMENTFLAG_SWIMMING) != 0) != plrMover->IsInWater()) { // now client not include swimming flag in case jumping under water - plMover->SetInWater(!plMover->IsInWater() || plMover->GetBaseMap()->IsUnderWater(movementInfo.pos.GetPositionX(), movementInfo.pos.GetPositionY(), movementInfo.pos.GetPositionZ())); + plrMover->SetInWater(!plrMover->IsInWater() || plrMover->GetBaseMap()->IsUnderWater(movementInfo.pos.GetPositionX(), movementInfo.pos.GetPositionY(), movementInfo.pos.GetPositionZ())); } /*----------------------*/ @@ -364,27 +362,25 @@ void WorldSession::HandleMovementOpcodes(WorldPacket & recv_data) mover->UpdatePosition(movementInfo.pos); - if (plMover) // nothing is charmed, or player charmed + if (plrMover) // nothing is charmed, or player charmed { - plMover->UpdateFallInformationIfNeed(movementInfo, opcode); + plrMover->UpdateFallInformationIfNeed(movementInfo, opcode); if (movementInfo.pos.GetPositionZ() < -500.0f) { - if (!(plMover->InBattleground() - && plMover->GetBattleground() - && plMover->GetBattleground()->HandlePlayerUnderMap(_player))) + if (!(plrMover->GetBattleground() && plrMover->GetBattleground()->HandlePlayerUnderMap(_player))) { // NOTE: this is actually called many times while falling // even after the player has been teleported away // TODO: discard movement packets after the player is rooted - if (plMover->isAlive()) + if (plrMover->isAlive()) { - plMover->EnvironmentalDamage(DAMAGE_FALL_TO_VOID, GetPlayer()->GetMaxHealth()); + plrMover->EnvironmentalDamage(DAMAGE_FALL_TO_VOID, GetPlayer()->GetMaxHealth()); // player can be alive if GM/etc // change the death state to CORPSE to prevent the death timer from // starting in the next player update - if (!plMover->isAlive()) - plMover->KillPlayer(); + if (!plrMover->isAlive()) + plrMover->KillPlayer(); } } } @@ -492,9 +488,10 @@ void WorldSession::HandleMoveNotActiveMover(WorldPacket &recv_data) recv_data.readPackGUID(old_mover_guid); MovementInfo mi; - mi.guid = old_mover_guid; ReadMovementInfo(recv_data, &mi); + mi.guid = old_mover_guid; + _player->m_movementInfo = mi; } @@ -520,6 +517,7 @@ void WorldSession::HandleMoveKnockBackAck(WorldPacket & recv_data) MovementInfo movementInfo; ReadMovementInfo(recv_data, &movementInfo); + _player->m_movementInfo = movementInfo; WorldPacket data(SMSG_MOVE_UPDATE_KNOCK_BACK, 66); @@ -744,6 +742,78 @@ void WorldSession::ReadMovementInfo(WorldPacket &data, MovementInfo* mi) if (HaveTransportData && mi->pos.m_positionX != mi->t_pos.m_positionX) if (GetPlayer()->GetTransport()) GetPlayer()->GetTransport()->UpdatePosition(mi); + + //! Anti-cheat checks. Please keep them in seperate if() blocks to maintain a clear overview. + //! Might be subject to latency, so just remove improper flags. + #ifdef TRINITY_DEBUG + #define REMOVE_VIOLATING_FLAGS(check, maskToRemove) \ + { \ + if (check) \ + { \ + sLog->outDebug(LOG_FILTER_UNITS, "WorldSession::ReadMovementInfo: Violation of MovementFlags found (%s). " \ + "MovementFlags: %u, MovementFlags2: %u for player GUID: %u. Mask %u will be removed.", \ + STRINGIZE(check), mi->GetMovementFlags(), mi->GetExtraMovementFlags(), GetPlayer()->GetGUIDLow(), maskToRemove); \ + mi->RemoveMovementFlag((maskToRemove)); \ + } \ + } + #else + #define REMOVE_VIOLATING_FLAGS(check, maskToRemove) \ + if (check) \ + mi->RemoveMovementFlag((maskToRemove)); + #endif + + + /*! This must be a packet spoofing attempt. MOVEMENTFLAG_ROOT sent from the client is not valid + in conjunction with any of the moving movement flags such as MOVEMENTFLAG_FORWARD. + It will freeze clients that receive this player's movement info. + */ + REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_ROOT), + MOVEMENTFLAG_ROOT); + + //! Cannot hover without SPELL_AURA_HOVER + REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_HOVER) && !GetPlayer()->HasAuraType(SPELL_AURA_HOVER), + MOVEMENTFLAG_HOVER); + + //! Cannot ascend and descend at the same time + REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_ASCENDING) && mi->HasMovementFlag(MOVEMENTFLAG_DESCENDING), + MOVEMENTFLAG_ASCENDING | MOVEMENTFLAG_DESCENDING); + + //! Cannot move left and right at the same time + REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_LEFT) && mi->HasMovementFlag(MOVEMENTFLAG_RIGHT), + MOVEMENTFLAG_LEFT | MOVEMENTFLAG_RIGHT); + + //! Cannot strafe left and right at the same time + REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_STRAFE_LEFT) && mi->HasMovementFlag(MOVEMENTFLAG_STRAFE_RIGHT), + MOVEMENTFLAG_STRAFE_LEFT | MOVEMENTFLAG_STRAFE_RIGHT); + + //! Cannot pitch up and down at the same time + REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_PITCH_UP) && mi->HasMovementFlag(MOVEMENTFLAG_PITCH_DOWN), + MOVEMENTFLAG_PITCH_UP | MOVEMENTFLAG_PITCH_DOWN); + + //! Cannot move forwards and backwards at the same time + REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_FORWARD) && mi->HasMovementFlag(MOVEMENTFLAG_BACKWARD), + MOVEMENTFLAG_FORWARD | MOVEMENTFLAG_BACKWARD); + + //! Cannot walk on water without SPELL_AURA_WATER_WALK + REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_WATERWALKING) && !GetPlayer()->HasAuraType(SPELL_AURA_WATER_WALK), + MOVEMENTFLAG_WATERWALKING); + + //! Cannot feather fall without SPELL_AURA_FEATHER_FALL + REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_FALLING_SLOW) && !GetPlayer()->HasAuraType(SPELL_AURA_FEATHER_FALL), + MOVEMENTFLAG_FALLING_SLOW); + + /*! Cannot fly if no fly auras present. Exception is being a GM. + Note that we check for account level instead of Player::IsGameMaster() because in some + situations it may be feasable to use .gm fly on as a GM without having .gm on, + e.g. aerial combat. + */ + + REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_FLYING | MOVEMENTFLAG_CAN_FLY) && GetSecurity() == SEC_PLAYER && + !GetPlayer()->m_mover->HasAuraType(SPELL_AURA_FLY) && + !GetPlayer()->m_mover->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED), + MOVEMENTFLAG_FLYING | MOVEMENTFLAG_CAN_FLY); + + #undef REMOVE_VIOLATING_FLAGS } void WorldSession::WriteMovementInfo(WorldPacket &data, MovementInfo* mi) @@ -901,4 +971,4 @@ void WorldSession::WriteMovementInfo(WorldPacket &data, MovementInfo* mi) WPError(false, "Incorrect sequence element detected at ReadMovementInfo"); } } -} +} \ No newline at end of file diff --git a/src/server/game/Handlers/NPCHandler.cpp b/src/server/game/Handlers/NPCHandler.cpp index 385b91c9f7d..4da8805614b 100755 --- a/src/server/game/Handlers/NPCHandler.cpp +++ b/src/server/game/Handlers/NPCHandler.cpp @@ -135,7 +135,7 @@ void WorldSession::SendTrainerList(uint64 guid, const std::string& strTitle) if (!unit->isCanTrainingOf(_player, true)) return; - CreatureTemplate const* ci = unit->GetCreatureInfo(); + CreatureTemplate const* ci = unit->GetCreatureTemplate(); if (!ci) { @@ -170,7 +170,7 @@ void WorldSession::SendTrainerList(uint64 guid, const std::string& strTitle) bool valid = true; bool primary_prof_first_rank = false; - for (uint8 i = 0; i < MAX_SPELL_EFFECTS ; ++i) + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { if (!tSpell->learnedSpell[i]) continue; @@ -197,7 +197,7 @@ void WorldSession::SendTrainerList(uint64 guid, const std::string& strTitle) data << uint32(tSpell->reqSkillValue); //prev + req or req + 0 uint8 maxReq = 0; - for (uint8 i = 0; i < MAX_SPELL_EFFECTS ; ++i) + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { if (!tSpell->learnedSpell[i]) continue; @@ -341,7 +341,7 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket & recv_data) if (!sScriptMgr->OnGossipHello(_player, unit)) { // _player->TalkedToCreature(unit->GetEntry(), unit->GetGUID()); - _player->PrepareGossipMenu(unit, unit->GetCreatureInfo()->GossipMenuId, true); + _player->PrepareGossipMenu(unit, unit->GetCreatureTemplate()->GossipMenuId, true); _player->SendPreparedGossip(unit); } unit->AI()->sGossipHello(_player); diff --git a/src/server/game/Handlers/PetHandler.cpp b/src/server/game/Handlers/PetHandler.cpp index f278e6b017e..5f7e4ce04a8 100755 --- a/src/server/game/Handlers/PetHandler.cpp +++ b/src/server/game/Handlers/PetHandler.cpp @@ -158,8 +158,6 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint16 spellid switch (spellid) { case COMMAND_STAY: //flat=1792 //STAY - pet->AttackStop(); - pet->InterruptNonMeleeSpells(false); pet->StopMoving(); pet->GetMotionMaster()->Clear(false); pet->GetMotionMaster()->MoveIdle(); @@ -652,15 +650,25 @@ void WorldSession::HandlePetRename(WorldPacket & recv_data) SQLTransaction trans = CharacterDatabase.BeginTransaction(); if (isdeclined) { - for (uint8 i = 0; i < MAX_DECLINED_NAME_CASES; ++i) - CharacterDatabase.EscapeString(declinedname.name[i]); - trans->PAppend("DELETE FROM character_pet_declinedname WHERE owner = '%u' AND id = '%u'", _player->GetGUIDLow(), pet->GetCharmInfo()->GetPetNumber()); - trans->PAppend("INSERT INTO character_pet_declinedname (id, owner, genitive, dative, accusative, instrumental, prepositional) VALUES ('%u', '%u', '%s', '%s', '%s', '%s', '%s')", - pet->GetCharmInfo()->GetPetNumber(), _player->GetGUIDLow(), declinedname.name[0].c_str(), declinedname.name[1].c_str(), declinedname.name[2].c_str(), declinedname.name[3].c_str(), declinedname.name[4].c_str()); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_PET_DECLINEDNAME); + stmt->setUInt32(0, pet->GetCharmInfo()->GetPetNumber()); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_CHAR_PET_DECLINEDNAME); + stmt->setUInt32(0, _player->GetGUIDLow()); + + for (uint8 i = 0; i < 5; i++) + stmt->setString(i+1, declinedname.name[i]); + + trans->Append(stmt); } - CharacterDatabase.EscapeString(name); - trans->PAppend("UPDATE character_pet SET name = '%s', renamed = '1' WHERE owner = '%u' AND id = '%u'", name.c_str(), _player->GetGUIDLow(), pet->GetCharmInfo()->GetPetNumber()); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_PET_NAME); + stmt->setString(0, name); + stmt->setUInt32(1, _player->GetGUIDLow()); + stmt->setUInt32(2, pet->GetCharmInfo()->GetPetNumber()); + trans->Append(stmt); + CharacterDatabase.CommitTransaction(trans); pet->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, uint32(time(NULL))); // cast can't be helped diff --git a/src/server/game/Handlers/PetitionsHandler.cpp b/src/server/game/Handlers/PetitionsHandler.cpp index 7faabb730e4..0c2f8741b15 100755 --- a/src/server/game/Handlers/PetitionsHandler.cpp +++ b/src/server/game/Handlers/PetitionsHandler.cpp @@ -215,7 +215,10 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data) // a petition is invalid, if both the owner and the type matches // we checked above, if this player is in an arenateam, so this must be // datacorruption - QueryResult result = CharacterDatabase.PQuery("SELECT petitionguid FROM petition WHERE ownerguid = '%u' AND type = '%u'", _player->GetGUIDLow(), type); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_BY_OWNER); + stmt->setUInt32(0, _player->GetGUIDLow()); + stmt->setUInt8(1, type); + PreparedQueryResult result = CharacterDatabase.Query(stmt); std::ostringstream ssInvalidPetitionGUIDs; @@ -236,8 +239,14 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data) SQLTransaction trans = CharacterDatabase.BeginTransaction(); trans->PAppend("DELETE FROM petition WHERE petitionguid IN (%s)", ssInvalidPetitionGUIDs.str().c_str()); trans->PAppend("DELETE FROM petition_sign WHERE petitionguid IN (%s)", ssInvalidPetitionGUIDs.str().c_str()); - trans->PAppend("INSERT INTO petition (ownerguid, petitionguid, name, type) VALUES ('%u', '%u', '%s', '%u')", - _player->GetGUIDLow(), charter->GetGUIDLow(), name.c_str(), type); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_PETITION); + stmt->setUInt32(0, _player->GetGUIDLow()); + stmt->setUInt32(1, charter->GetGUIDLow()); + stmt->setString(2, name); + stmt->setUInt8(3, uint8(type)); + trans->Append(stmt); + CharacterDatabase.CommitTransaction(trans); } @@ -250,9 +259,14 @@ void WorldSession::HandlePetitionShowSignOpcode(WorldPacket& recv_data) recv_data >> petitionguid; // petition guid // solve (possible) some strange compile problems with explicit use GUID_LOPART(petitionguid) at some GCC versions (wrong code optimization in compiler?) - uint32 petitionguid_low = GUID_LOPART(petitionguid); + uint32 petitionGuidLow = GUID_LOPART(petitionguid); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_TYPE); + + stmt->setUInt32(0, petitionGuidLow); + + PreparedQueryResult result = CharacterDatabase.Query(stmt); - QueryResult result = CharacterDatabase.PQuery("SELECT type FROM petition WHERE petitionguid = '%u'", petitionguid_low); if (!result) { sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Petition %u is not found for player %u %s", GUID_LOPART(petitionguid), GetPlayer()->GetGUIDLow(), GetPlayer()->GetName()); @@ -265,26 +279,30 @@ void WorldSession::HandlePetitionShowSignOpcode(WorldPacket& recv_data) if (type == GUILD_CHARTER_TYPE && _player->GetGuildId()) return; - result = CharacterDatabase.PQuery("SELECT playerguid FROM petition_sign WHERE petitionguid = '%u'", petitionguid_low); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_SIGNATURE); + + stmt->setUInt32(0, petitionGuidLow); + + result = CharacterDatabase.Query(stmt); // result == NULL also correct in case no sign yet if (result) signs = uint8(result->GetRowCount()); - sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_PETITION_SHOW_SIGNATURES petition entry: '%u'", petitionguid_low); + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_PETITION_SHOW_SIGNATURES petition entry: '%u'", petitionGuidLow); WorldPacket data(SMSG_PETITION_SHOW_SIGNATURES, (8+8+4+1+signs*12)); data << uint64(petitionguid); // petition guid data << uint64(_player->GetGUID()); // owner guid - data << uint32(petitionguid_low); // guild guid + data << uint32(petitionGuidLow); // guild guid data << uint8(signs); // sign's count for (uint8 i = 1; i <= signs; ++i) { Field* fields2 = result->Fetch(); - uint64 plguid = fields2[0].GetUInt64(); + uint32 lowGuid = fields2[0].GetUInt32(); - data << uint64(plguid); // Player GUID + data << uint64(MAKE_NEW_GUID(lowGuid, 0, HIGHGUID_PLAYER)); // Player GUID data << uint32(0); // there 0 ... result->NextRow(); @@ -311,16 +329,18 @@ void WorldSession::SendPetitionQueryOpcode(uint64 petitionguid) uint32 type; std::string name = "NO_NAME_FOR_GUID"; - // TODO: Use CHAR_LOAD_PETITION PS - QueryResult result = CharacterDatabase.PQuery("SELECT ownerguid, name, type " - "FROM petition WHERE petitionguid = '%u'", GUID_LOPART(petitionguid)); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION); + + stmt->setUInt32(0, GUID_LOPART(petitionguid)); + + PreparedQueryResult result = CharacterDatabase.Query(stmt); if (result) { Field* fields = result->Fetch(); ownerguid = MAKE_NEW_GUID(fields[0].GetUInt32(), 0, HIGHGUID_PLAYER); name = fields[1].GetString(); - type = fields[2].GetUInt32(); + type = fields[2].GetUInt8(); } else { @@ -382,7 +402,11 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket & recv_data) if (!item) return; - QueryResult result = CharacterDatabase.PQuery("SELECT type FROM petition WHERE petitionguid = '%u'", GUID_LOPART(petitionGuid)); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_TYPE); + + stmt->setUInt32(0, GUID_LOPART(petitionGuid)); + + PreparedQueryResult result = CharacterDatabase.Query(stmt); if (result) { @@ -422,7 +446,7 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket & recv_data) } } - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_PETITION_NAME); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_PETITION_NAME); stmt->setString(0, newName); stmt->setUInt32(1, GUID_LOPART(petitionGuid)); @@ -446,11 +470,12 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data) recv_data >> petitionGuid; // petition guid recv_data >> unk; - QueryResult result = CharacterDatabase.PQuery( - "SELECT ownerguid, " - " (SELECT COUNT(playerguid) FROM petition_sign WHERE petition_sign.petitionguid = '%u') AS signs, " - " type " - "FROM petition WHERE petitionguid = '%u'", GUID_LOPART(petitionGuid), GUID_LOPART(petitionGuid)); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_SIGNATURES); + + stmt->setUInt32(0, GUID_LOPART(petitionGuid)); + stmt->setUInt32(1, GUID_LOPART(petitionGuid)); + + PreparedQueryResult result = CharacterDatabase.Query(stmt); if (!result) { @@ -460,8 +485,8 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data) fields = result->Fetch(); uint64 ownerGuid = MAKE_NEW_GUID(fields[0].GetUInt32(), 0, HIGHGUID_PLAYER); - uint8 signs = fields[1].GetUInt8(); - uint32 type = fields[2].GetUInt32(); + uint64 signs = fields[1].GetUInt64(); + uint8 type = fields[2].GetUInt8(); uint32 playerGuid = _player->GetGUIDLow(); if (GUID_LOPART(ownerGuid) == playerGuid) @@ -518,9 +543,14 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data) if (++signs > type) // client signs maximum return; - //client doesn't allow to sign petition two times by one character, but not check sign by another character from same account - //not allow sign another player from already sign player account - result = CharacterDatabase.PQuery("SELECT playerguid FROM petition_sign WHERE player_account = '%u' AND petitionguid = '%u'", GetAccountId(), GUID_LOPART(petitionGuid)); + // Client doesn't allow to sign petition two times by one character, but not check sign by another character from same account + // not allow sign another player from already sign player account + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_SIG_BY_ACCOUNT); + + stmt->setUInt32(0, GetAccountId()); + stmt->setUInt32(1, GUID_LOPART(petitionGuid)); + + result = CharacterDatabase.Query(stmt); if (result) { @@ -538,7 +568,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data) return; } - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_PETITION_SIGNATURE); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_PETITION_SIGNATURE); stmt->setUInt32(0, GUID_LOPART(ownerGuid)); stmt->setUInt32(1, GUID_LOPART(petitionGuid)); @@ -576,7 +606,12 @@ void WorldSession::HandlePetitionDeclineOpcode(WorldPacket & recv_data) recv_data >> petitionguid; // petition guid sLog->outDebug(LOG_FILTER_NETWORKIO, "Petition %u declined by %u", GUID_LOPART(petitionguid), _player->GetGUIDLow()); - QueryResult result = CharacterDatabase.PQuery("SELECT ownerguid FROM petition WHERE petitionguid = '%u'", GUID_LOPART(petitionguid)); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_OWNER_BY_GUID); + + stmt->setUInt32(0, GUID_LOPART(petitionguid)); + + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (!result) return; @@ -608,7 +643,12 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recv_data) if (!player) return; - QueryResult result = CharacterDatabase.PQuery("SELECT type FROM petition WHERE petitionguid = '%u'", GUID_LOPART(petitionguid)); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_TYPE); + + stmt->setUInt32(0, GUID_LOPART(petitionguid)); + + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (!result) return; @@ -667,7 +707,13 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recv_data) } } - result = CharacterDatabase.PQuery("SELECT playerguid FROM petition_sign WHERE petitionguid = '%u'", GUID_LOPART(petitionguid)); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_SIGNATURE); + + stmt->setUInt32(0, GUID_LOPART(petitionguid)); + + result = CharacterDatabase.Query(stmt); + // result == NULL also correct charter without signs if (result) signs = uint8(result->GetRowCount()); @@ -681,9 +727,7 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recv_data) for (uint8 i = 1; i <= signs; ++i) { Field* fields2 = result->Fetch(); - plguid = fields2[0].GetUInt64(); - - data << uint64(plguid); // Player GUID + data << uint64(MAKE_NEW_GUID(fields2[0].GetUInt32(), 0, HIGHGUID_PLAYER)); // Player GUID data << uint32(0); // there 0 ... result->NextRow(); @@ -861,8 +905,15 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data) } SQLTransaction trans = CharacterDatabase.BeginTransaction(); - trans->PAppend("DELETE FROM petition WHERE petitionguid = '%u'", GUID_LOPART(petitionGuid)); - trans->PAppend("DELETE FROM petition_sign WHERE petitionguid = '%u'", GUID_LOPART(petitionGuid)); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PETITION_BY_GUID); + stmt->setUInt32(0, GUID_LOPART(petitionGuid)); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PETITION_SIGNATURE_BY_GUID); + stmt->setUInt32(0, GUID_LOPART(petitionGuid)); + trans->Append(stmt); + CharacterDatabase.CommitTransaction(trans); // created diff --git a/src/server/game/Handlers/QueryHandler.cpp b/src/server/game/Handlers/QueryHandler.cpp index a18fbcddfca..f0e681b535c 100755 --- a/src/server/game/Handlers/QueryHandler.cpp +++ b/src/server/game/Handlers/QueryHandler.cpp @@ -33,42 +33,33 @@ void WorldSession::SendNameQueryOpcode(uint64 guid) { - Player* player = NULL; - const CharacterNameData* nameData = sWorld->GetCharacterNameData(GUID_LOPART(guid)); - if (nameData) - player = ObjectAccessor::FindPlayer(guid); + Player* player = ObjectAccessor::FindPlayer(guid); + CharacterNameData const* nameData = sWorld->GetCharacterNameData(GUID_LOPART(guid)); - // guess size WorldPacket data(SMSG_NAME_QUERY_RESPONSE, (8+1+1+1+1+1+10)); data.appendPackGUID(guid); - data << uint8(0); // added in 3.1 - if (nameData) - { - data << nameData->m_name; // played name - data << uint8(0); // realm name for cross realm BG usage - data << uint8(nameData->m_race); - data << uint8(nameData->m_gender); - data << uint8(nameData->m_class); - } - else + if (!nameData) { - data << std::string(GetTrinityString(LANG_NON_EXIST_CHARACTER)); - data << uint32(0); + data << uint8(1); // name unknown + SendPacket(&data); + return; } - if (player) + data << uint8(0); // name known + data << nameData->m_name; // played name + data << uint8(0); // realm name - only set for cross realm interaction (such as Battlegrounds) + data << uint8(nameData->m_race); + data << uint8(nameData->m_gender); + data << uint8(nameData->m_class); + + if (DeclinedName const* names = (player ? player->GetDeclinedNames() : NULL)) { - if (DeclinedName const* names = player->GetDeclinedNames()) - { - data << uint8(1); // is declined - for (int i = 0; i < MAX_DECLINED_NAME_CASES; ++i) - data << names->name[i]; - } - else - data << uint8(0); // is not declined + data << uint8(1); // Name is declined + for (uint8 i = 0; i < MAX_DECLINED_NAME_CASES; ++i) + data << names->name[i]; } - else //TODO: decline names may also need to be stored in char name data - data << uint8(0); + else + data << uint8(0); // Name is not declined SendPacket(&data); } @@ -76,7 +67,6 @@ void WorldSession::SendNameQueryOpcode(uint64 guid) void WorldSession::HandleNameQueryOpcode(WorldPacket& recv_data) { uint64 guid; - recv_data >> guid; // This is disable by default to prevent lots of console spam diff --git a/src/server/game/Handlers/QuestHandler.cpp b/src/server/game/Handlers/QuestHandler.cpp index 761fb9657c9..62372004f03 100755 --- a/src/server/game/Handlers/QuestHandler.cpp +++ b/src/server/game/Handlers/QuestHandler.cpp @@ -53,7 +53,7 @@ void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket & recv_data) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_STATUS_QUERY for npc, guid = %u", uint32(GUID_LOPART(guid))); Creature* cr_questgiver=questgiver->ToCreature(); - if (!cr_questgiver->IsHostileTo(_player)) // not show quest status to enemies + if (!cr_questgiver->IsHostileTo(_player)) // do not show quest status to enemies { questStatus = sScriptMgr->GetDialogStatus(_player, cr_questgiver); if (questStatus > 6) @@ -103,7 +103,7 @@ void WorldSession::HandleQuestgiverHelloOpcode(WorldPacket & recv_data) if (sScriptMgr->OnGossipHello(_player, creature)) return; - _player->PrepareGossipMenu(creature, creature->GetCreatureInfo()->GossipMenuId, true); + _player->PrepareGossipMenu(creature, creature->GetCreatureTemplate()->GossipMenuId, true); _player->SendPreparedGossip(creature); creature->AI()->sGossipHello(_player); @@ -112,17 +112,17 @@ void WorldSession::HandleQuestgiverHelloOpcode(WorldPacket & recv_data) void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket & recv_data) { uint64 guid; - uint32 quest; + uint32 questId; uint32 unk1; - recv_data >> guid >> quest >> unk1; + recv_data >> guid >> questId >> unk1; - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_ACCEPT_QUEST npc = %u, quest = %u, unk1 = %u", uint32(GUID_LOPART(guid)), quest, unk1); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_ACCEPT_QUEST npc = %u, quest = %u, unk1 = %u", uint32(GUID_LOPART(guid)), questId, unk1); - Object* pObject = ObjectAccessor::GetObjectByTypeMask(*_player, guid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT|TYPEMASK_ITEM|TYPEMASK_PLAYER); + Object* object = ObjectAccessor::GetObjectByTypeMask(*_player, guid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT|TYPEMASK_ITEM|TYPEMASK_PLAYER); // no or incorrect quest giver - if (!pObject || (pObject->GetTypeId() != TYPEID_PLAYER && !pObject->hasQuest(quest)) || - (pObject->GetTypeId() == TYPEID_PLAYER && !pObject->ToPlayer()->CanShareQuest(quest))) + if (!object || (object->GetTypeId() != TYPEID_PLAYER && !object->hasQuest(questId)) || + (object->GetTypeId() == TYPEID_PLAYER && !object->ToPlayer()->CanShareQuest(questId))) { _player->PlayerTalkClass->SendCloseGossip(); _player->SetDivider(0); @@ -130,14 +130,13 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket & recv_data) } // some kind of WPE protection - if (!_player->CanInteractWithQuestGiver(pObject)) + if (!_player->CanInteractWithQuestGiver(object)) return; - Quest const* qInfo = sObjectMgr->GetQuestTemplate(quest); - if (qInfo) + if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId)) { // prevent cheating - if (!GetPlayer()->CanTakeQuest(qInfo, true)) + if (!GetPlayer()->CanTakeQuest(quest, true)) { _player->PlayerTalkClass->SendCloseGossip(); _player->SetDivider(0); @@ -154,11 +153,11 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket & recv_data) } } - if (_player->CanAddQuest(qInfo, true)) + if (_player->CanAddQuest(quest, true)) { - _player->AddQuest(qInfo, pObject); + _player->AddQuest(quest, object); - if (qInfo->HasFlag(QUEST_FLAGS_PARTY_ACCEPT)) + if (quest->HasFlag(QUEST_FLAGS_PARTY_ACCEPT)) { if (Group* group = _player->GetGroup()) { @@ -169,38 +168,38 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket & recv_data) if (!player || player == _player) // not self continue; - if (player->CanTakeQuest(qInfo, true)) + if (player->CanTakeQuest(quest, true)) { player->SetDivider(_player->GetGUID()); //need confirmation that any gossip window will close player->PlayerTalkClass->SendCloseGossip(); - _player->SendQuestConfirmAccept(qInfo, player); + _player->SendQuestConfirmAccept(quest, player); } } } } - if (_player->CanCompleteQuest(quest)) - _player->CompleteQuest(quest); + if (_player->CanCompleteQuest(questId)) + _player->CompleteQuest(questId); - switch (pObject->GetTypeId()) + switch (object->GetTypeId()) { case TYPEID_UNIT: - sScriptMgr->OnQuestAccept(_player, (pObject->ToCreature()), qInfo); - (pObject->ToCreature())->AI()->sQuestAccept(_player, qInfo); + sScriptMgr->OnQuestAccept(_player, (object->ToCreature()), quest); + (object->ToCreature())->AI()->sQuestAccept(_player, quest); break; case TYPEID_ITEM: case TYPEID_CONTAINER: { - sScriptMgr->OnQuestAccept(_player, ((Item*)pObject), qInfo); + sScriptMgr->OnQuestAccept(_player, ((Item*)object), quest); // destroy not required for quest finish quest starting item bool destroyItem = true; for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) { - if ((qInfo->RequiredItemId[i] == ((Item*)pObject)->GetEntry()) && (((Item*)pObject)->GetTemplate()->MaxCount > 0)) + if ((quest->RequiredItemId[i] == ((Item*)object)->GetEntry()) && (((Item*)object)->GetTemplate()->MaxCount > 0)) { destroyItem = false; break; @@ -208,21 +207,21 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket & recv_data) } if (destroyItem) - _player->DestroyItem(((Item*)pObject)->GetBagSlot(), ((Item*)pObject)->GetSlot(), true); + _player->DestroyItem(((Item*)object)->GetBagSlot(), ((Item*)object)->GetSlot(), true); break; } case TYPEID_GAMEOBJECT: - sScriptMgr->OnQuestAccept(_player, ((GameObject*)pObject), qInfo); - (pObject->ToGameObject())->AI()->QuestAccept(_player, qInfo); + sScriptMgr->OnQuestAccept(_player, ((GameObject*)object), quest); + (object->ToGameObject())->AI()->QuestAccept(_player, quest); break; default: break; } _player->PlayerTalkClass->SendCloseGossip(); - if (qInfo->GetSrcSpell() > 0) - _player->CastSpell(_player, qInfo->GetSrcSpell(), true); + if (quest->GetSrcSpell() > 0) + _player->CastSpell(_player, quest->GetSrcSpell(), true); return; } @@ -247,8 +246,7 @@ void WorldSession::HandleQuestgiverQueryQuestOpcode(WorldPacket & recv_data) return; } - Quest const* quest = sObjectMgr->GetQuestTemplate(questId); - if (quest) + if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId)) { // not sure here what should happen to quests with QUEST_FLAGS_AUTOCOMPLETE // if this breaks them, add && object->GetTypeId() == TYPEID_ITEM to this check @@ -275,15 +273,12 @@ void WorldSession::HandleQuestQueryOpcode(WorldPacket & recv_data) if (!_player) return; - uint32 quest; - recv_data >> quest; - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUEST_QUERY quest = %u", quest); + uint32 questId; + recv_data >> questId; + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUEST_QUERY quest = %u", questId); - Quest const* pQuest = sObjectMgr->GetQuestTemplate(quest); - if (pQuest) - { - _player->PlayerTalkClass->SendQuestQueryResponse(pQuest); - } + if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId)) + _player->PlayerTalkClass->SendQuestQueryResponse(quest); } void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket & recv_data) @@ -372,28 +367,28 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket & recv_data) void WorldSession::HandleQuestgiverRequestRewardOpcode(WorldPacket & recv_data) { - uint32 quest; + uint32 questId; uint64 guid; - recv_data >> guid >> quest; + recv_data >> guid >> questId; - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_REQUEST_REWARD npc = %u, quest = %u", uint32(GUID_LOPART(guid)), quest); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_REQUEST_REWARD npc = %u, quest = %u", uint32(GUID_LOPART(guid)), questId); - Object* pObject = ObjectAccessor::GetObjectByTypeMask(*_player, guid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT); - if (!pObject || !pObject->hasInvolvedQuest(quest)) + Object* object = ObjectAccessor::GetObjectByTypeMask(*_player, guid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT); + if (!object || !object->hasInvolvedQuest(questId)) return; // some kind of WPE protection - if (!_player->CanInteractWithQuestGiver(pObject)) + if (!_player->CanInteractWithQuestGiver(object)) return; - if (_player->CanCompleteQuest(quest)) - _player->CompleteQuest(quest); + if (_player->CanCompleteQuest(questId)) + _player->CompleteQuest(questId); - if (_player->GetQuestStatus(quest) != QUEST_STATUS_COMPLETE) + if (_player->GetQuestStatus(questId) != QUEST_STATUS_COMPLETE) return; - if (Quest const* pQuest = sObjectMgr->GetQuestTemplate(quest)) - _player->PlayerTalkClass->SendQuestGiverOfferReward(pQuest, guid, true); + if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId)) + _player->PlayerTalkClass->SendQuestGiverOfferReward(quest, guid, true); } void WorldSession::HandleQuestgiverCancel(WorldPacket& /*recv_data*/) @@ -425,22 +420,22 @@ void WorldSession::HandleQuestLogRemoveQuest(WorldPacket& recv_data) if (slot < MAX_QUEST_LOG_SIZE) { - if (uint32 quest = _player->GetQuestSlotQuestId(slot)) + if (uint32 questId = _player->GetQuestSlotQuestId(slot)) { - if (!_player->TakeQuestSourceItem(quest, true)) + if (!_player->TakeQuestSourceItem(questId, true)) return; // can't un-equip some items, reject quest cancel - if (const Quest *pQuest = sObjectMgr->GetQuestTemplate(quest)) + if (const Quest *quest = sObjectMgr->GetQuestTemplate(questId)) { - if (pQuest->HasFlag(QUEST_TRINITY_FLAGS_TIMED)) - _player->RemoveTimedQuest(quest); + if (quest->HasFlag(QUEST_TRINITY_FLAGS_TIMED)) + _player->RemoveTimedQuest(questId); } - _player->TakeQuestSourceItem(quest, true); // remove quest src item from player - _player->RemoveActiveQuest(quest); - _player->GetAchievementMgr().RemoveTimedAchievement(ACHIEVEMENT_TIMED_TYPE_QUEST, quest); + _player->TakeQuestSourceItem(questId, true); // remove quest src item from player + _player->RemoveActiveQuest(questId); + _player->GetAchievementMgr().RemoveTimedAchievement(ACHIEVEMENT_TIMED_TYPE_QUEST, questId); - sLog->outDetail("Player %u abandoned quest %u", _player->GetGUIDLow(), quest); + sLog->outDetail("Player %u abandoned quest %u", _player->GetGUIDLow(), questId); } _player->SetQuestSlot(slot, 0); @@ -494,6 +489,8 @@ void WorldSession::HandleQuestgiverCompleteQuest(WorldPacket& recv_data) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_COMPLETE_QUEST npc = %u, questId = %u", uint32(GUID_LOPART(playerGuid)), questId); Object* object = ObjectAccessor::GetObjectByTypeMask(*_player, playerGuid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT); + if (!object || !object->hasInvolvedQuest(questId)) + Object* object = ObjectAccessor::GetObjectByTypeMask(*_player, guid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT); if (!object || !object->hasInvolvedQuest(questId)) return; @@ -545,7 +542,7 @@ void WorldSession::HandlePushQuestToParty(WorldPacket& recvPacket) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_PUSHQUESTTOPARTY questId = %u", questId); - if (Quest const* pQuest = sObjectMgr->GetQuestTemplate(questId)) + if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId)) { if (Group* group = _player->GetGroup()) { @@ -558,7 +555,7 @@ void WorldSession::HandlePushQuestToParty(WorldPacket& recvPacket) _player->SendPushToPartyResponse(player, QUEST_PARTY_MSG_SHARING_QUEST); - if (!player->SatisfyQuestStatus(pQuest, false)) + if (!player->SatisfyQuestStatus(quest, false)) { _player->SendPushToPartyResponse(player, QUEST_PARTY_MSG_HAVE_QUEST); continue; @@ -570,7 +567,7 @@ void WorldSession::HandlePushQuestToParty(WorldPacket& recvPacket) continue; } - if (!player->CanTakeQuest(pQuest, false)) + if (!player->CanTakeQuest(quest, false)) { _player->SendPushToPartyResponse(player, QUEST_PARTY_MSG_CANT_TAKE_QUEST); continue; @@ -588,7 +585,7 @@ void WorldSession::HandlePushQuestToParty(WorldPacket& recvPacket) continue; } - player->PlayerTalkClass->SendQuestGiverQuestDetails(pQuest, _player->GetGUID(), true); + player->PlayerTalkClass->SendQuestGiverQuestDetails(quest, _player->GetGUID(), true); player->SetDivider(_player->GetGUID()); } } @@ -648,18 +645,19 @@ uint32 WorldSession::getDialogStatus(Player* player, Object* questgiver, uint32 { uint32 result2 = 0; uint32 quest_id = i->second; - Quest const* pQuest = sObjectMgr->GetQuestTemplate(quest_id); - if (!pQuest) continue; + Quest const* quest = sObjectMgr->GetQuestTemplate(quest_id); + if (!quest) + continue; - ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK, pQuest->GetQuestId()); + ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK, quest->GetQuestId()); if (!sConditionMgr->IsObjectMeetToConditions(player, conditions)) continue; QuestStatus status = player->GetQuestStatus(quest_id); if ((status == QUEST_STATUS_COMPLETE && !player->GetQuestRewardStatus(quest_id)) || - (pQuest->IsAutoComplete() && player->CanTakeQuest(pQuest, false))) + (quest->IsAutoComplete() && player->CanTakeQuest(quest, false))) { - if (pQuest->IsAutoComplete() && pQuest->IsRepeatable()) + if (quest->IsAutoComplete() && quest->IsRepeatable()) result2 = DIALOG_STATUS_REWARD_REP; else result2 = DIALOG_STATUS_REWARD; @@ -675,26 +673,26 @@ uint32 WorldSession::getDialogStatus(Player* player, Object* questgiver, uint32 { uint32 result2 = 0; uint32 quest_id = i->second; - Quest const* pQuest = sObjectMgr->GetQuestTemplate(quest_id); - if (!pQuest) + Quest const* quest = sObjectMgr->GetQuestTemplate(quest_id); + if (!quest) continue; - ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK, pQuest->GetQuestId()); + ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK, quest->GetQuestId()); if (!sConditionMgr->IsObjectMeetToConditions(player, conditions)) continue; QuestStatus status = player->GetQuestStatus(quest_id); if (status == QUEST_STATUS_NONE) { - if (player->CanSeeStartQuest(pQuest)) + if (player->CanSeeStartQuest(quest)) { - if (player->SatisfyQuestLevel(pQuest, false)) + if (player->SatisfyQuestLevel(quest, false)) { - if (pQuest->IsAutoComplete() || (pQuest->IsRepeatable() && player->IsQuestRewarded(quest_id))) + if (quest->IsAutoComplete() || (quest->IsRepeatable() && player->IsQuestRewarded(quest_id))) result2 = DIALOG_STATUS_REWARD_REP; - else if (player->getLevel() <= ((player->GetQuestLevel(pQuest) == -1) ? player->getLevel() : player->GetQuestLevel(pQuest) + sWorld->getIntConfig(CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF))) + else if (player->getLevel() <= ((player->GetQuestLevel(quest) == -1) ? player->getLevel() : player->GetQuestLevel(quest) + sWorld->getIntConfig(CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF))) { - if (pQuest->HasFlag(QUEST_FLAGS_DAILY) || pQuest->HasFlag(QUEST_FLAGS_WEEKLY)) + if (quest->HasFlag(QUEST_FLAGS_DAILY) || quest->HasFlag(QUEST_FLAGS_WEEKLY)) result2 = DIALOG_STATUS_AVAILABLE_REP; else result2 = DIALOG_STATUS_AVAILABLE; diff --git a/src/server/game/Handlers/SkillHandler.cpp b/src/server/game/Handlers/SkillHandler.cpp index 886368821f5..cec5ea2bbda 100755 --- a/src/server/game/Handlers/SkillHandler.cpp +++ b/src/server/game/Handlers/SkillHandler.cpp @@ -110,4 +110,3 @@ void WorldSession::HandleUnlearnSkillOpcode(WorldPacket& recv_data) recv_data >> skillId; GetPlayer()->SetSkill(skillId, 0, 0, 0); } - diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp index 4e3a5a91db7..c56d86d11db 100755 --- a/src/server/game/Handlers/SpellHandler.cpp +++ b/src/server/game/Handlers/SpellHandler.cpp @@ -236,7 +236,12 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket) if (item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED))// wrapped? { - QueryResult result = CharacterDatabase.PQuery("SELECT entry, flags FROM character_gifts WHERE item_guid = '%u'", item->GetGUIDLow()); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_GIFT_BY_ITEM); + + stmt->setUInt32(0, item->GetGUIDLow()); + + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (result) { Field* fields = result->Fetch(); @@ -255,7 +260,7 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket) return; } - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GIFT); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GIFT); stmt->setUInt32(0, item->GetGUIDLow()); @@ -656,13 +661,22 @@ void WorldSession::HandleUpdateProjectilePosition(WorldPacket& recvPacket) uint8 castCount; float x, y, z; // Position of missile hit - recvPacket.readPackGUID(casterGuid); + recvPacket >> casterGuid; recvPacket >> spellId; recvPacket >> castCount; recvPacket >> x; recvPacket >> y; recvPacket >> z; + Unit* caster = ObjectAccessor::GetUnit(*_player, casterGuid); + Spell* spell = caster ? caster->FindCurrentSpellBySpellId(spellId) : NULL; + if (spell && spell->m_targets.HasDst()) + { + Position pos = *spell->m_targets.GetDstPos(); + pos.Relocate(x, y, z); + spell->m_targets.ModDst(pos); + } + WorldPacket data(SMSG_SET_PROJECTILE_POSITION, 21); data << uint64(casterGuid); data << uint8(castCount); diff --git a/src/server/game/Handlers/TaxiHandler.cpp b/src/server/game/Handlers/TaxiHandler.cpp index 44889e6dda8..b774fbcba70 100755 --- a/src/server/game/Handlers/TaxiHandler.cpp +++ b/src/server/game/Handlers/TaxiHandler.cpp @@ -103,7 +103,7 @@ void WorldSession::SendTaxiMenu(Creature* unit) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_TAXINODE_STATUS_QUERY %u ", curloc); - WorldPacket data(SMSG_SHOWTAXINODES, (4+8+4+8*4)); + WorldPacket data(SMSG_SHOWTAXINODES, (4 + 8 + 4 + 8 * 4)); data << uint32(1); data << uint64(unit->GetGUID()); data << uint32(curloc); diff --git a/src/server/game/Handlers/TicketHandler.cpp b/src/server/game/Handlers/TicketHandler.cpp index a270d42b000..d6675188f6e 100755 --- a/src/server/game/Handlers/TicketHandler.cpp +++ b/src/server/game/Handlers/TicketHandler.cpp @@ -38,7 +38,7 @@ void WorldSession::HandleGMTicketCreateOpcode(WorldPacket & recv_data) return; } - GMTicketResponse response = GMTICKET_RESPONSE_FAILURE; + GMTicketResponse response = GMTICKET_RESPONSE_CREATE_ERROR; // Player must not have ticket if (!sTicketMgr->GetTicketByPlayer(GetPlayer()->GetGUID())) { @@ -48,7 +48,7 @@ void WorldSession::HandleGMTicketCreateOpcode(WorldPacket & recv_data) sWorld->SendGMText(LANG_COMMAND_TICKETNEW, GetPlayer()->GetName(), ticket->GetId()); - response = GMTICKET_RESPONSE_SUCCESS; + response = GMTICKET_RESPONSE_CREATE_SUCCESS; } WorldPacket data(SMSG_GMTICKET_CREATE, 4); @@ -61,8 +61,8 @@ void WorldSession::HandleGMTicketUpdateOpcode(WorldPacket & recv_data) std::string message; recv_data >> message; - GMTicketResponse response = GMTICKET_RESPONSE_FAILURE; - if (GmTicket *ticket = sTicketMgr->GetTicketByPlayer(GetPlayer()->GetGUID())) + GMTicketResponse response = GMTICKET_RESPONSE_UPDATE_ERROR; + if (GmTicket* ticket = sTicketMgr->GetTicketByPlayer(GetPlayer()->GetGUID())) { SQLTransaction trans = SQLTransaction(NULL); ticket->SetMessage(message); @@ -70,7 +70,7 @@ void WorldSession::HandleGMTicketUpdateOpcode(WorldPacket & recv_data) sWorld->SendGMText(LANG_COMMAND_TICKETUPDATED, GetPlayer()->GetName(), ticket->GetId()); - response = GMTICKET_RESPONSE_SUCCESS; + response = GMTICKET_RESPONSE_UPDATE_SUCCESS; } WorldPacket data(SMSG_GMTICKET_UPDATETEXT, 4); @@ -176,6 +176,8 @@ void WorldSession::HandleReportLag(WorldPacket& recv_data) stmt->setFloat (3, x); stmt->setFloat (4, y); stmt->setFloat (5, z); + stmt->setUInt32(6, GetLatency()); + stmt->setUInt32(7, time(NULL)); CharacterDatabase.Execute(stmt); } diff --git a/src/server/game/Handlers/TradeHandler.cpp b/src/server/game/Handlers/TradeHandler.cpp index b51f13a5063..b2a89ed3021 100755 --- a/src/server/game/Handlers/TradeHandler.cpp +++ b/src/server/game/Handlers/TradeHandler.cpp @@ -412,7 +412,7 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/) trader->GetSession()->SendTradeStatus(TRADE_STATUS_TRADE_ACCEPT); // test if item will fit in each inventory - hisCanCompleteTrade = (trader->CanStoreItems(myItems, TRADE_SLOT_TRADED_COUNT) == EQUIP_ERR_OK); + hisCanCompleteTrade = (trader->CanStoreItems(myItems, TRADE_SLOT_TRADED_COUNT) == EQUIP_ERR_OK); myCanCompleteTrade = (_player->CanStoreItems(hisItems, TRADE_SLOT_TRADED_COUNT) == EQUIP_ERR_OK); clearAcceptTradeMode(myItems, hisItems); @@ -551,7 +551,7 @@ void WorldSession::HandleBeginTradeOpcode(WorldPacket& recvPacket) void WorldSession::SendCancelTrade() { - if (m_playerRecentlyLogout) + if (PlayerRecentlyLoggedOut() || PlayerLogout()) return; SendTradeStatus(TRADE_STATUS_TRADE_CANCELED); @@ -566,15 +566,12 @@ void WorldSession::HandleCancelTradeOpcode(WorldPacket& /*recvPacket*/) void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket) { - if (GetPlayer()->m_trade) - { - recvPacket.rfinish(); - return; - } - uint64 ID; recvPacket >> ID; + if (GetPlayer()->m_trade) + return; + if (!GetPlayer()->isAlive()) { SendTradeStatus(TRADE_STATUS_YOU_DEAD); @@ -748,4 +745,3 @@ void WorldSession::HandleClearTradeItemOpcode(WorldPacket& recvPacket) my_trade->SetItem(TradeSlots(tradeSlot), NULL); } - diff --git a/src/server/game/Handlers/VehicleHandler.cpp b/src/server/game/Handlers/VehicleHandler.cpp index ce4f6ccb8fe..cfd73c2c987 100644 --- a/src/server/game/Handlers/VehicleHandler.cpp +++ b/src/server/game/Handlers/VehicleHandler.cpp @@ -81,7 +81,9 @@ void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket &recv_data) uint64 guid; // current vehicle guid recv_data.readPackGUID(guid); - ReadMovementInfo(recv_data, &vehicle_base->m_movementInfo); + MovementInfo movementInfo; + ReadMovementInfo(recv_data, &movementInfo); + vehicle_base->m_movementInfo = movementInfo; uint64 accessory; // accessory guid recv_data.readPackGUID(accessory); diff --git a/src/server/game/Instances/InstanceSaveMgr.cpp b/src/server/game/Instances/InstanceSaveMgr.cpp index 722b7089a17..8078a91d082 100755 --- a/src/server/game/Instances/InstanceSaveMgr.cpp +++ b/src/server/game/Instances/InstanceSaveMgr.cpp @@ -124,11 +124,21 @@ InstanceSave* InstanceSaveManager::GetInstanceSave(uint32 InstanceId) void InstanceSaveManager::DeleteInstanceFromDB(uint32 instanceid) { SQLTransaction trans = CharacterDatabase.BeginTransaction(); - trans->PAppend("DELETE FROM instance WHERE id = '%u'", instanceid); - trans->PAppend("DELETE FROM character_instance WHERE instance = '%u'", instanceid); - trans->PAppend("DELETE FROM group_instance WHERE instance = '%u'", instanceid); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INSTANCE_BY_INSTANCE); + stmt->setUInt32(0, instanceid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INSTANCE_BY_INSTANCE); + stmt->setUInt32(0, instanceid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GROUP_INSTANCE_BY_INSTANCE); + stmt->setUInt32(0, instanceid); + trans->Append(stmt); + CharacterDatabase.CommitTransaction(trans); - // respawn times should be deleted only when the map gets unloaded + // Respawn times should be deleted only when the map gets unloaded } void InstanceSaveManager::RemoveInstanceSave(uint32 InstanceId) @@ -250,13 +260,13 @@ void InstanceSaveManager::LoadInstances() CharacterDatabase.DirectExecute("DELETE i.* FROM instance AS i LEFT JOIN character_instance AS ci ON i.id = ci.instance LEFT JOIN group_instance AS gi ON i.id = gi.instance WHERE ci.guid IS NULL AND gi.guid IS NULL"); // Delete invalid references to instance - CharacterDatabase.DirectExecute(CharacterDatabase.GetPreparedStatement(CHAR_DEL_NONEXISTENT_INSTANCE_CREATURE_RESPAWNS)); - CharacterDatabase.DirectExecute(CharacterDatabase.GetPreparedStatement(CHAR_DEL_NONEXISTENT_INSTANCE_GO_RESPAWNS)); + CharacterDatabase.DirectExecute("DELETE FROM creature_respawn WHERE instanceId > 0 AND instanceId NOT IN (SELECT id FROM instance)"); + CharacterDatabase.DirectExecute("DELETE FROM gameobject_respawn WHERE instanceId > 0 AND instanceId NOT IN (SELECT id FROM instance)"); CharacterDatabase.DirectExecute("DELETE tmp.* FROM character_instance AS tmp LEFT JOIN instance ON tmp.instance = instance.id WHERE tmp.instance > 0 AND instance.id IS NULL"); CharacterDatabase.DirectExecute("DELETE tmp.* FROM group_instance AS tmp LEFT JOIN instance ON tmp.instance = instance.id WHERE tmp.instance > 0 AND instance.id IS NULL"); // Clean invalid references to instance - CharacterDatabase.DirectExecute(CharacterDatabase.GetPreparedStatement(CHAR_UPD_NONEXISTENT_INSTANCE_FOR_CORPSES)); + CharacterDatabase.DirectExecute("UPDATE corpse SET instanceId = 0 WHERE instanceId > 0 AND instanceId NOT IN (SELECT id FROM instance)"); CharacterDatabase.DirectExecute("UPDATE characters AS tmp LEFT JOIN instance ON tmp.instance_id = instance.id SET tmp.instance_id = 0 WHERE tmp.instance_id > 0 AND instance.id IS NULL"); // Initialize instance id storage (Needs to be done after the trash has been clean out) @@ -348,7 +358,7 @@ void InstanceSaveManager::LoadResetTimes() { Field* fields = result->Fetch(); uint32 mapid = fields[0].GetUInt16(); - Difficulty difficulty = Difficulty(fields[1].GetUInt32()); + Difficulty difficulty = Difficulty(fields[1].GetUInt8()); uint64 oldresettime = fields[2].GetUInt32(); MapDifficulty const* mapDiff = GetMapDifficultyData(mapid, difficulty); @@ -568,9 +578,22 @@ void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, Difficulty difficulty, b // delete them from the DB, even if not loaded SQLTransaction trans = CharacterDatabase.BeginTransaction(); - trans->PAppend("DELETE FROM character_instance USING character_instance LEFT JOIN instance ON character_instance.instance = id WHERE map = '%u' and difficulty='%u'", mapid, difficulty); - trans->PAppend("DELETE FROM group_instance USING group_instance LEFT JOIN instance ON group_instance.instance = id WHERE map = '%u' and difficulty='%u'", mapid, difficulty); - trans->PAppend("DELETE FROM instance WHERE map = '%u' and difficulty='%u'", mapid, difficulty); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_INSTANCE_BY_MAP_DIFF); + stmt->setUInt16(0, uint16(mapid)); + stmt->setUInt8(1, uint8(difficulty)); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GROUP_INSTANCE_BY_MAP_DIFF); + stmt->setUInt16(0, uint16(mapid)); + stmt->setUInt8(1, uint8(difficulty)); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INSTANCE_BY_MAP_DIFF); + stmt->setUInt16(0, uint16(mapid)); + stmt->setUInt8(1, uint8(difficulty)); + trans->Append(stmt); + CharacterDatabase.CommitTransaction(trans); // calculate the next reset time @@ -580,13 +603,13 @@ void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, Difficulty difficulty, b if (period < DAY) period = DAY; - uint32 next_reset = ((resetTime + MINUTE) / DAY * DAY) + period + diff; + uint32 next_reset = uint32(((resetTime + MINUTE) / DAY * DAY) + period + diff); SetResetTimeFor(mapid, difficulty, next_reset); ScheduleReset(true, time_t(next_reset-3600), InstResetEvent(1, mapid, difficulty, 0)); // Update it in the DB - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GLOBAL_INSTANCE_RESETTIME); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GLOBAL_INSTANCE_RESETTIME); stmt->setUInt32(0, next_reset); stmt->setUInt16(1, uint16(mapid)); @@ -639,4 +662,4 @@ uint32 InstanceSaveManager::GetNumBoundGroupsTotal() ret += itr->second->GetGroupCount(); return ret; -} \ No newline at end of file +} diff --git a/src/server/game/Instances/InstanceScript.cpp b/src/server/game/Instances/InstanceScript.cpp index d0a96e3b62e..66621dc43ee 100755 --- a/src/server/game/Instances/InstanceScript.cpp +++ b/src/server/game/Instances/InstanceScript.cpp @@ -397,22 +397,22 @@ void InstanceScript::SendEncounterUnit(uint32 type, Unit* unit /*= NULL*/, uint8 switch (type) { - case ENCOUNTER_FRAME_ADD: - case ENCOUNTER_FRAME_REMOVE: - case 2: + case ENCOUNTER_FRAME_ENGAGE: + case ENCOUNTER_FRAME_DISENGAGE: + case ENCOUNTER_FRAME_UPDATE_PRIORITY: data.append(unit->GetPackGUID()); data << uint8(param1); break; - case 3: - case 4: - case 6: + case ENCOUNTER_FRAME_ADD_TIMER: + case ENCOUNTER_FRAME_ENABLE_OBJECTIVE: + case ENCOUNTER_FRAME_DISABLE_OBJECTIVE: data << uint8(param1); - data << uint8(param2); break; - case 5: + case ENCOUNTER_FRAME_UPDATE_OBJECTIVE: data << uint8(param1); + data << uint8(param2); break; - case 7: + case ENCOUNTER_FRAME_UNK7: default: break; } diff --git a/src/server/game/Instances/InstanceScript.h b/src/server/game/Instances/InstanceScript.h index 69f11c203c1..71f1572624b 100755 --- a/src/server/game/Instances/InstanceScript.h +++ b/src/server/game/Instances/InstanceScript.h @@ -42,8 +42,14 @@ typedef std::set MinionSet; enum EncounterFrameType { - ENCOUNTER_FRAME_ADD = 0, - ENCOUNTER_FRAME_REMOVE = 1, + ENCOUNTER_FRAME_ENGAGE = 0, + ENCOUNTER_FRAME_DISENGAGE = 1, + ENCOUNTER_FRAME_UPDATE_PRIORITY = 2, + ENCOUNTER_FRAME_ADD_TIMER = 3, + ENCOUNTER_FRAME_ENABLE_OBJECTIVE = 4, + ENCOUNTER_FRAME_UPDATE_OBJECTIVE = 5, + ENCOUNTER_FRAME_DISABLE_OBJECTIVE = 6, + ENCOUNTER_FRAME_UNK7 = 7, // Seems to have something to do with sorting the encounter units }; enum EncounterState diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index edc8d24c635..2100eb26346 100755 --- a/src/server/game/Loot/LootMgr.cpp +++ b/src/server/game/Loot/LootMgr.cpp @@ -26,7 +26,8 @@ #include "SpellInfo.h" #include "Group.h" -static Rates const qualityToRate[MAX_ITEM_QUALITY] = { +static Rates const qualityToRate[MAX_ITEM_QUALITY] = +{ RATE_DROP_ITEM_POOR, // ITEM_QUALITY_POOR RATE_DROP_ITEM_NORMAL, // ITEM_QUALITY_NORMAL RATE_DROP_ITEM_UNCOMMON, // ITEM_QUALITY_UNCOMMON @@ -116,7 +117,7 @@ uint32 LootStore::LoadLootTable() uint16 lootmode = fields[3].GetUInt16(); uint8 group = fields[4].GetUInt8(); int32 mincountOrRef = fields[5].GetInt32(); - int32 maxcount = fields[6].GetInt32(); + int32 maxcount = fields[6].GetUInt8(); if (maxcount > std::numeric_limits::max()) { @@ -147,7 +148,6 @@ uint32 LootStore::LoadLootTable() // Adds current row to the template tab->second->AddEntry(storeitem); ++count; - } while (result->NextRow()); @@ -205,12 +205,12 @@ LootTemplate* LootStore::GetLootForConditionFill(uint32 loot_id) return tab->second; } -uint32 LootStore::LoadAndCollectLootIds(LootIdSet& ids_set) +uint32 LootStore::LoadAndCollectLootIds(LootIdSet& lootIdSet) { uint32 count = LoadLootTable(); for (LootTemplateMap::const_iterator tab = m_LootTemplates.begin(); tab != m_LootTemplates.end(); ++tab) - ids_set.insert(tab->first); + lootIdSet.insert(tab->first); return count; } @@ -221,10 +221,10 @@ void LootStore::CheckLootRefs(LootIdSet* ref_set) const ltItr->second->CheckLootRefs(m_LootTemplates, ref_set); } -void LootStore::ReportUnusedIds(LootIdSet const& ids_set) const +void LootStore::ReportUnusedIds(LootIdSet const& lootIdSet) const { // all still listed ids isn't referenced - for (LootIdSet::const_iterator itr = ids_set.begin(); itr != ids_set.end(); ++itr) + for (LootIdSet::const_iterator itr = lootIdSet.begin(); itr != lootIdSet.end(); ++itr) sLog->outErrorDb("Table '%s' entry %d isn't %s and not referenced from loot, and then useless.", GetName(), *itr, GetEntryName()); } @@ -296,7 +296,6 @@ bool LootStoreItem::IsValid(LootStore const& store, uint32 entry) const sLog->outErrorDb("Table '%s' entry %d item %d: max count (%u) less that min count (%i) - skipped", store.GetName(), entry, itemid, int32(maxcount), mincountOrRef); return false; } - } else // mincountOrRef < 0 { @@ -514,7 +513,9 @@ QuestItemList* Loot::FillFFALoot(Player* player) QuestItemList* Loot::FillQuestLoot(Player* player) { - if (items.size() == MAX_NR_LOOT_ITEMS) return NULL; + if (items.size() == MAX_NR_LOOT_ITEMS) + return NULL; + QuestItemList* ql = new QuestItemList(); for (uint8 i = 0; i < quest_items.size(); ++i) @@ -736,7 +737,7 @@ bool Loot::hasItemFor(Player* player) const if (q_itr != lootPlayerQuestItems.end()) { QuestItemList* q_list = q_itr->second; - for (QuestItemList::const_iterator qi = q_list->begin() ; qi != q_list->end(); ++qi) + for (QuestItemList::const_iterator qi = q_list->begin(); qi != q_list->end(); ++qi) { const LootItem &item = quest_items[qi->index]; if (!qi->is_looted && !item.is_looted) @@ -749,7 +750,7 @@ bool Loot::hasItemFor(Player* player) const if (ffa_itr != lootPlayerFFAItems.end()) { QuestItemList* ffa_list = ffa_itr->second; - for (QuestItemList::const_iterator fi = ffa_list->begin() ; fi != ffa_list->end(); ++fi) + for (QuestItemList::const_iterator fi = ffa_list->begin(); fi != ffa_list->end(); ++fi) { const LootItem &item = items[fi->index]; if (!fi->is_looted && !item.is_looted) @@ -761,8 +762,8 @@ bool Loot::hasItemFor(Player* player) const QuestItemMap::const_iterator nn_itr = lootPlayerNonQuestNonFFAConditionalItems.find(player->GetGUIDLow()); if (nn_itr != lootPlayerNonQuestNonFFAConditionalItems.end()) { - QuestItemList* conditional_list = nn_itr->second; - for (QuestItemList::const_iterator ci = conditional_list->begin() ; ci != conditional_list->end(); ++ci) + QuestItemList* conditional_list = nn_itr->second; + for (QuestItemList::const_iterator ci = conditional_list->begin(); ci != conditional_list->end(); ++ci) { const LootItem &item = items[ci->index]; if (!ci->is_looted && !item.is_looted) @@ -903,7 +904,7 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv) if (q_itr != lootPlayerQuestItems.end()) { QuestItemList* q_list = q_itr->second; - for (QuestItemList::const_iterator qi = q_list->begin() ; qi != q_list->end(); ++qi) + for (QuestItemList::const_iterator qi = q_list->begin(); qi != q_list->end(); ++qi) { LootItem &item = l.quest_items[qi->index]; if (!qi->is_looted && !item.is_looted) @@ -921,7 +922,7 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv) if (ffa_itr != lootPlayerFFAItems.end()) { QuestItemList* ffa_list = ffa_itr->second; - for (QuestItemList::const_iterator fi = ffa_list->begin() ; fi != ffa_list->end(); ++fi) + for (QuestItemList::const_iterator fi = ffa_list->begin(); fi != ffa_list->end(); ++fi) { LootItem &item = l.items[fi->index]; if (!fi->is_looted && !item.is_looted) @@ -938,8 +939,8 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv) QuestItemMap::const_iterator nn_itr = lootPlayerNonQuestNonFFAConditionalItems.find(lv.viewer->GetGUIDLow()); if (nn_itr != lootPlayerNonQuestNonFFAConditionalItems.end()) { - QuestItemList* conditional_list = nn_itr->second; - for (QuestItemList::const_iterator ci = conditional_list->begin() ; ci != conditional_list->end(); ++ci) + QuestItemList* conditional_list = nn_itr->second; + for (QuestItemList::const_iterator ci = conditional_list->begin(); ci != conditional_list->end(); ++ci) { LootItem &item = l.items[ci->index]; if (!ci->is_looted && !item.is_looted) @@ -1288,7 +1289,7 @@ bool LootTemplate::HasQuestDrop(LootTemplateMap const& store, uint8 groupId) con } // Now processing groups - for (LootGroups::const_iterator i = Groups.begin() ; i != Groups.end(); ++i) + for (LootGroups::const_iterator i = Groups.begin(); i != Groups.end(); ++i) if (i->HasQuestDrop()) return true; @@ -1306,7 +1307,7 @@ bool LootTemplate::HasQuestDropForPlayer(LootTemplateMap const& store, Player co } // Checking non-grouped entries - for (LootStoreItemList::const_iterator i = Entries.begin() ; i != Entries.end(); ++i) + for (LootStoreItemList::const_iterator i = Entries.begin(); i != Entries.end(); ++i) { if (i->mincountOrRef < 0) // References processing { @@ -1421,8 +1422,8 @@ void LoadLootTemplates_Creature() uint32 oldMSTime = getMSTime(); - LootIdSet ids_set, ids_setUsed; - uint32 count = LootTemplates_Creature.LoadAndCollectLootIds(ids_set); + LootIdSet lootIdSet, lootIdSetUsed; + uint32 count = LootTemplates_Creature.LoadAndCollectLootIds(lootIdSet); // Remove real entries and check loot existence CreatureTemplateContainer const* ctc = sObjectMgr->GetCreatureTemplates(); @@ -1430,18 +1431,18 @@ void LoadLootTemplates_Creature() { if (uint32 lootid = itr->second.lootid) { - if (ids_set.find(lootid) == ids_set.end()) + if (lootIdSet.find(lootid) == lootIdSet.end()) LootTemplates_Creature.ReportNotExistedId(lootid); else - ids_setUsed.insert(lootid); + lootIdSetUsed.insert(lootid); } } - for (LootIdSet::const_iterator itr = ids_setUsed.begin(); itr != ids_setUsed.end(); ++itr) - ids_set.erase(*itr); + for (LootIdSet::const_iterator itr = lootIdSetUsed.begin(); itr != lootIdSetUsed.end(); ++itr) + lootIdSet.erase(*itr); // output error for any still listed (not referenced from appropriate table) ids - LootTemplates_Creature.ReportUnusedIds(ids_set); + LootTemplates_Creature.ReportUnusedIds(lootIdSet); if (count) sLog->outString(">> Loaded %u creature loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); @@ -1457,7 +1458,7 @@ void LoadLootTemplates_Disenchant() uint32 oldMSTime = getMSTime(); - LootIdSet lootIdSet, loodIdSetUsed; + LootIdSet lootIdSet, lootIdSetUsed; uint32 count = LootTemplates_Disenchant.LoadAndCollectLootIds(lootIdSet); for (uint32 i = 0; i < sItemDisenchantLootStore.GetNumRows(); ++i) @@ -1470,10 +1471,10 @@ void LoadLootTemplates_Disenchant() if (lootIdSet.find(lootid) == lootIdSet.end()) LootTemplates_Disenchant.ReportNotExistedId(lootid); else - loodIdSetUsed.insert(lootid); + lootIdSetUsed.insert(lootid); } - for (LootIdSet::const_iterator itr = loodIdSetUsed.begin(); itr != loodIdSetUsed.end(); ++itr) + for (LootIdSet::const_iterator itr = lootIdSetUsed.begin(); itr != lootIdSetUsed.end(); ++itr) lootIdSet.erase(*itr); // output error for any still listed (not referenced from appropriate table) ids @@ -1492,17 +1493,17 @@ void LoadLootTemplates_Fishing() uint32 oldMSTime = getMSTime(); - LootIdSet ids_set; - uint32 count = LootTemplates_Fishing.LoadAndCollectLootIds(ids_set); + LootIdSet lootIdSet; + uint32 count = LootTemplates_Fishing.LoadAndCollectLootIds(lootIdSet); // remove real entries and check existence loot for (uint32 i = 1; i < sAreaStore.GetNumRows(); ++i) if (AreaTableEntry const* areaEntry = sAreaStore.LookupEntry(i)) - if (ids_set.find(areaEntry->ID) != ids_set.end()) - ids_set.erase(areaEntry->ID); + if (lootIdSet.find(areaEntry->ID) != lootIdSet.end()) + lootIdSet.erase(areaEntry->ID); // output error for any still listed (not referenced from appropriate table) ids - LootTemplates_Fishing.ReportUnusedIds(ids_set); + LootTemplates_Fishing.ReportUnusedIds(lootIdSet); if (count) sLog->outString(">> Loaded %u fishing loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); @@ -1518,8 +1519,8 @@ void LoadLootTemplates_Gameobject() uint32 oldMSTime = getMSTime(); - LootIdSet ids_set, ids_setUsed; - uint32 count = LootTemplates_Gameobject.LoadAndCollectLootIds(ids_set); + LootIdSet lootIdSet, lootIdSetUsed; + uint32 count = LootTemplates_Gameobject.LoadAndCollectLootIds(lootIdSet); // remove real entries and check existence loot GameObjectTemplateContainer const* gotc = sObjectMgr->GetGameObjectTemplates(); @@ -1527,18 +1528,18 @@ void LoadLootTemplates_Gameobject() { if (uint32 lootid = itr->second.GetLootId()) { - if (sObjectMgr->IsGoOfSpecificEntrySpawned(itr->second.entry) && ids_set.find(lootid) == ids_set.end()) + if (lootIdSet.find(lootid) == lootIdSet.end()) LootTemplates_Gameobject.ReportNotExistedId(lootid); else - ids_setUsed.insert(lootid); + lootIdSetUsed.insert(lootid); } } - for (LootIdSet::const_iterator itr = ids_setUsed.begin(); itr != ids_setUsed.end(); ++itr) - ids_set.erase(*itr); + for (LootIdSet::const_iterator itr = lootIdSetUsed.begin(); itr != lootIdSetUsed.end(); ++itr) + lootIdSet.erase(*itr); // output error for any still listed (not referenced from appropriate table) ids - LootTemplates_Gameobject.ReportUnusedIds(ids_set); + LootTemplates_Gameobject.ReportUnusedIds(lootIdSet); if (count) sLog->outString(">> Loaded %u gameobject loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); @@ -1554,17 +1555,17 @@ void LoadLootTemplates_Item() uint32 oldMSTime = getMSTime(); - LootIdSet ids_set; - uint32 count = LootTemplates_Item.LoadAndCollectLootIds(ids_set); + LootIdSet lootIdSet; + uint32 count = LootTemplates_Item.LoadAndCollectLootIds(lootIdSet); // remove real entries and check existence loot ItemTemplateContainer const* its = sObjectMgr->GetItemTemplateStore(); for (ItemTemplateContainer::const_iterator itr = its->begin(); itr != its->end(); ++itr) - if (ids_set.find(itr->second.ItemId) != ids_set.end() && itr->second.Flags & ITEM_PROTO_FLAG_OPENABLE) - ids_set.erase(itr->second.ItemId); + if (lootIdSet.find(itr->second.ItemId) != lootIdSet.end() && itr->second.Flags & ITEM_PROTO_FLAG_OPENABLE) + lootIdSet.erase(itr->second.ItemId); // output error for any still listed (not referenced from appropriate table) ids - LootTemplates_Item.ReportUnusedIds(ids_set); + LootTemplates_Item.ReportUnusedIds(lootIdSet); if (count) sLog->outString(">> Loaded %u prospecting loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); @@ -1580,8 +1581,8 @@ void LoadLootTemplates_Milling() uint32 oldMSTime = getMSTime(); - LootIdSet ids_set; - uint32 count = LootTemplates_Milling.LoadAndCollectLootIds(ids_set); + LootIdSet lootIdSet; + uint32 count = LootTemplates_Milling.LoadAndCollectLootIds(lootIdSet); // remove real entries and check existence loot ItemTemplateContainer const* its = sObjectMgr->GetItemTemplateStore(); @@ -1590,12 +1591,12 @@ void LoadLootTemplates_Milling() if (!(itr->second.Flags & ITEM_PROTO_FLAG_MILLABLE)) continue; - if (ids_set.find(itr->second.ItemId) != ids_set.end()) - ids_set.erase(itr->second.ItemId); + if (lootIdSet.find(itr->second.ItemId) != lootIdSet.end()) + lootIdSet.erase(itr->second.ItemId); } // output error for any still listed (not referenced from appropriate table) ids - LootTemplates_Milling.ReportUnusedIds(ids_set); + LootTemplates_Milling.ReportUnusedIds(lootIdSet); if (count) sLog->outString(">> Loaded %u milling loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); @@ -1611,8 +1612,8 @@ void LoadLootTemplates_Pickpocketing() uint32 oldMSTime = getMSTime(); - LootIdSet ids_set, ids_setUsed; - uint32 count = LootTemplates_Pickpocketing.LoadAndCollectLootIds(ids_set); + LootIdSet lootIdSet, lootIdSetUsed; + uint32 count = LootTemplates_Pickpocketing.LoadAndCollectLootIds(lootIdSet); // Remove real entries and check loot existence CreatureTemplateContainer const* ctc = sObjectMgr->GetCreatureTemplates(); @@ -1620,18 +1621,18 @@ void LoadLootTemplates_Pickpocketing() { if (uint32 lootid = itr->second.pickpocketLootId) { - if (ids_set.find(lootid) == ids_set.end()) + if (lootIdSet.find(lootid) == lootIdSet.end()) LootTemplates_Pickpocketing.ReportNotExistedId(lootid); else - ids_setUsed.insert(lootid); + lootIdSetUsed.insert(lootid); } } - for (LootIdSet::const_iterator itr = ids_setUsed.begin(); itr != ids_setUsed.end(); ++itr) - ids_set.erase(*itr); + for (LootIdSet::const_iterator itr = lootIdSetUsed.begin(); itr != lootIdSetUsed.end(); ++itr) + lootIdSet.erase(*itr); // output error for any still listed (not referenced from appropriate table) ids - LootTemplates_Pickpocketing.ReportUnusedIds(ids_set); + LootTemplates_Pickpocketing.ReportUnusedIds(lootIdSet); if (count) sLog->outString(">> Loaded %u pickpocketing loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); @@ -1647,8 +1648,8 @@ void LoadLootTemplates_Prospecting() uint32 oldMSTime = getMSTime(); - LootIdSet ids_set; - uint32 count = LootTemplates_Prospecting.LoadAndCollectLootIds(ids_set); + LootIdSet lootIdSet; + uint32 count = LootTemplates_Prospecting.LoadAndCollectLootIds(lootIdSet); // remove real entries and check existence loot ItemTemplateContainer const* its = sObjectMgr->GetItemTemplateStore(); @@ -1657,12 +1658,12 @@ void LoadLootTemplates_Prospecting() if (!(itr->second.Flags & ITEM_PROTO_FLAG_PROSPECTABLE)) continue; - if (ids_set.find(itr->second.ItemId) != ids_set.end()) - ids_set.erase(itr->second.ItemId); + if (lootIdSet.find(itr->second.ItemId) != lootIdSet.end()) + lootIdSet.erase(itr->second.ItemId); } // output error for any still listed (not referenced from appropriate table) ids - LootTemplates_Prospecting.ReportUnusedIds(ids_set); + LootTemplates_Prospecting.ReportUnusedIds(lootIdSet); if (count) sLog->outString(">> Loaded %u prospecting loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); @@ -1678,17 +1679,17 @@ void LoadLootTemplates_Mail() uint32 oldMSTime = getMSTime(); - LootIdSet ids_set; - uint32 count = LootTemplates_Mail.LoadAndCollectLootIds(ids_set); + LootIdSet lootIdSet; + uint32 count = LootTemplates_Mail.LoadAndCollectLootIds(lootIdSet); // remove real entries and check existence loot for (uint32 i = 1; i < sMailTemplateStore.GetNumRows(); ++i) if (sMailTemplateStore.LookupEntry(i)) - if (ids_set.find(i) != ids_set.end()) - ids_set.erase(i); + if (lootIdSet.find(i) != lootIdSet.end()) + lootIdSet.erase(i); // output error for any still listed (not referenced from appropriate table) ids - LootTemplates_Mail.ReportUnusedIds(ids_set); + LootTemplates_Mail.ReportUnusedIds(lootIdSet); if (count) sLog->outString(">> Loaded %u mail loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); @@ -1704,8 +1705,8 @@ void LoadLootTemplates_Skinning() uint32 oldMSTime = getMSTime(); - LootIdSet ids_set, ids_setUsed; - uint32 count = LootTemplates_Skinning.LoadAndCollectLootIds(ids_set); + LootIdSet lootIdSet, lootIdSetUsed; + uint32 count = LootTemplates_Skinning.LoadAndCollectLootIds(lootIdSet); // remove real entries and check existence loot CreatureTemplateContainer const* ctc = sObjectMgr->GetCreatureTemplates(); @@ -1713,18 +1714,18 @@ void LoadLootTemplates_Skinning() { if (uint32 lootid = itr->second.SkinLootId) { - if (ids_set.find(lootid) == ids_set.end()) + if (lootIdSet.find(lootid) == lootIdSet.end()) LootTemplates_Skinning.ReportNotExistedId(lootid); else - ids_setUsed.insert(lootid); + lootIdSetUsed.insert(lootid); } } - for (LootIdSet::const_iterator itr = ids_setUsed.begin(); itr != ids_setUsed.end(); ++itr) - ids_set.erase(*itr); + for (LootIdSet::const_iterator itr = lootIdSetUsed.begin(); itr != lootIdSetUsed.end(); ++itr) + lootIdSet.erase(*itr); // output error for any still listed (not referenced from appropriate table) ids - LootTemplates_Skinning.ReportUnusedIds(ids_set); + LootTemplates_Skinning.ReportUnusedIds(lootIdSet); if (count) sLog->outString(">> Loaded %u skinning loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); @@ -1740,8 +1741,8 @@ void LoadLootTemplates_Spell() uint32 oldMSTime = getMSTime(); - LootIdSet ids_set; - uint32 count = LootTemplates_Spell.LoadAndCollectLootIds(ids_set); + LootIdSet lootIdSet; + uint32 count = LootTemplates_Spell.LoadAndCollectLootIds(lootIdSet); // remove real entries and check existence loot for (uint32 spell_id = 1; spell_id < sSpellMgr->GetSpellInfoStoreSize(); ++spell_id) @@ -1754,7 +1755,7 @@ void LoadLootTemplates_Spell() if (!spellInfo->IsLootCrafting()) continue; - if (ids_set.find(spell_id) == ids_set.end()) + if (lootIdSet.find(spell_id) == lootIdSet.end()) { // not report about not trainable spells (optionally supported by DB) // ignore 61756 (Northrend Inscription Research (FAST QA VERSION) for example @@ -1764,11 +1765,11 @@ void LoadLootTemplates_Spell() } } else - ids_set.erase(spell_id); + lootIdSet.erase(spell_id); } // output error for any still listed (not referenced from appropriate table) ids - LootTemplates_Spell.ReportUnusedIds(ids_set); + LootTemplates_Spell.ReportUnusedIds(lootIdSet); if (count) sLog->outString(">> Loaded %u spell loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); @@ -1783,24 +1784,24 @@ void LoadLootTemplates_Reference() uint32 oldMSTime = getMSTime(); - LootIdSet ids_set; - LootTemplates_Reference.LoadAndCollectLootIds(ids_set); + LootIdSet lootIdSet; + LootTemplates_Reference.LoadAndCollectLootIds(lootIdSet); // check references and remove used - LootTemplates_Creature.CheckLootRefs(&ids_set); - LootTemplates_Fishing.CheckLootRefs(&ids_set); - LootTemplates_Gameobject.CheckLootRefs(&ids_set); - LootTemplates_Item.CheckLootRefs(&ids_set); - LootTemplates_Milling.CheckLootRefs(&ids_set); - LootTemplates_Pickpocketing.CheckLootRefs(&ids_set); - LootTemplates_Skinning.CheckLootRefs(&ids_set); - LootTemplates_Disenchant.CheckLootRefs(&ids_set); - LootTemplates_Prospecting.CheckLootRefs(&ids_set); - LootTemplates_Mail.CheckLootRefs(&ids_set); - LootTemplates_Reference.CheckLootRefs(&ids_set); + LootTemplates_Creature.CheckLootRefs(&lootIdSet); + LootTemplates_Fishing.CheckLootRefs(&lootIdSet); + LootTemplates_Gameobject.CheckLootRefs(&lootIdSet); + LootTemplates_Item.CheckLootRefs(&lootIdSet); + LootTemplates_Milling.CheckLootRefs(&lootIdSet); + LootTemplates_Pickpocketing.CheckLootRefs(&lootIdSet); + LootTemplates_Skinning.CheckLootRefs(&lootIdSet); + LootTemplates_Disenchant.CheckLootRefs(&lootIdSet); + LootTemplates_Prospecting.CheckLootRefs(&lootIdSet); + LootTemplates_Mail.CheckLootRefs(&lootIdSet); + LootTemplates_Reference.CheckLootRefs(&lootIdSet); // output error for any still listed ids (not referenced from any loot table) - LootTemplates_Reference.ReportUnusedIds(ids_set); + LootTemplates_Reference.ReportUnusedIds(lootIdSet); sLog->outString(">> Loaded refence loot templates in %u ms", GetMSTimeDiffToNow(oldMSTime)); sLog->outString(); diff --git a/src/server/game/Mails/Mail.h b/src/server/game/Mails/Mail.h index 6615d59160a..dbd03bd96ee 100755 --- a/src/server/game/Mails/Mail.h +++ b/src/server/game/Mails/Mail.h @@ -15,6 +15,7 @@ * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ + #ifndef TRINITY_MAIL_H #define TRINITY_MAIL_H diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 81b4f958e5d..073ceae5b62 100755 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -32,6 +32,7 @@ #include "Group.h" #include "LFGMgr.h" #include "DynamicTree.h" +#include "Vehicle.h" union u_map_magic { @@ -40,7 +41,7 @@ union u_map_magic }; u_map_magic MapMagic = { {'M','A','P','S'} }; -u_map_magic MapVersionMagic = { {'v','1','.','1'} }; +u_map_magic MapVersionMagic = { {'v','1','.','2'} }; u_map_magic MapAreaMagic = { {'A','R','E','A'} }; u_map_magic MapHeightMagic = { {'M','H','G','T'} }; u_map_magic MapLiquidMagic = { {'M','L','I','Q'} }; @@ -492,6 +493,7 @@ void Map::VisitNearbyCellsOf(WorldObject* obj, TypeContainerVisitorIsInWorld()) { //player->Update(t_diff); - WorldSession* pSession = player->GetSession(); - MapSessionFilter updater(pSession); - pSession->Update(t_diff, updater); + WorldSession* session = player->GetSession(); + MapSessionFilter updater(session); + session->Update(t_diff, updater); } } /// update active cells around players and active objects @@ -701,7 +703,15 @@ void Map::PlayerRelocation(Player* player, float x, float y, float z, float orie Cell old_cell(player->GetPositionX(), player->GetPositionY()); Cell new_cell(x, y); + //! If hovering, always increase our server-side Z position + //! Client automatically projects correct position based on Z coord sent in monster move + //! and UNIT_FIELD_HOVERHEIGHT sent in object updates + if (player->HasUnitMovementFlag(MOVEMENTFLAG_HOVER)) + z += player->GetFloatValue(UNIT_FIELD_HOVERHEIGHT); + player->Relocate(x, y, z, orientation); + if (player->IsVehicle()) + player->GetVehicleKit()->RelocatePassengers(x, y, z, orientation); if (old_cell.DiffGrid(new_cell) || old_cell.DiffCell(new_cell)) { @@ -728,6 +738,12 @@ void Map::CreatureRelocation(Creature* creature, float x, float y, float z, floa if (!respawnRelocationOnFail && !getNGrid(new_cell.GridX(), new_cell.GridY())) return; + //! If hovering, always increase our server-side Z position + //! Client automatically projects correct position based on Z coord sent in monster move + //! and UNIT_FIELD_HOVERHEIGHT sent in object updates + if (creature->HasUnitMovementFlag(MOVEMENTFLAG_HOVER)) + z += creature->GetFloatValue(UNIT_FIELD_HOVERHEIGHT); + // delay creature move for grid/cell to grid/cell moves if (old_cell.DiffCell(new_cell) || old_cell.DiffGrid(new_cell)) { @@ -740,6 +756,8 @@ void Map::CreatureRelocation(Creature* creature, float x, float y, float z, floa else { creature->Relocate(x, y, z, ang); + if (creature->IsVehicle()) + creature->GetVehicleKit()->RelocatePassengers(x, y, z, ang); creature->UpdateObjectVisibility(false); RemoveCreatureFromMoveList(creature); } @@ -769,20 +787,20 @@ void Map::RemoveCreatureFromMoveList(Creature* c) void Map::MoveAllCreaturesInMoveList() { _creatureToMoveLock = true; - for(std::vector::iterator itr = _creaturesToMove.begin(); itr != _creaturesToMove.end(); ++itr) + for (std::vector::iterator itr = _creaturesToMove.begin(); itr != _creaturesToMove.end(); ++itr) { Creature* c = *itr; - if(c->FindMap() != this) //pet is teleported to another map + if (c->FindMap() != this) //pet is teleported to another map continue; - if(c->_moveState != CREATURE_CELL_MOVE_ACTIVE) + if (c->_moveState != CREATURE_CELL_MOVE_ACTIVE) { c->_moveState = CREATURE_CELL_MOVE_NONE; continue; } c->_moveState = CREATURE_CELL_MOVE_NONE; - if(!c->IsInWorld()) + if (!c->IsInWorld()) continue; // do move or do move to respawn or remove creature if previous all fail @@ -1039,7 +1057,8 @@ GridMap::GridMap() _liquidWidth = 0; _liquidHeight = 0; _liquidLevel = INVALID_HEIGHT; - _liquidData = NULL; + _liquidEntry = NULL; + _liquidFlags = NULL; _liquidMap = NULL; } @@ -1101,12 +1120,14 @@ void GridMap::unloadData() delete[] _areaMap; delete[] m_V9; delete[] m_V8; - delete[] _liquidData; + delete[] _liquidEntry; + delete[] _liquidFlags; delete[] _liquidMap; _areaMap = NULL; m_V9 = NULL; m_V8 = NULL; - _liquidData = NULL; + _liquidEntry = NULL; + _liquidFlags = NULL; _liquidMap = NULL; _gridGetHeight = &GridMap::getHeightFromFlat; } @@ -1187,18 +1208,22 @@ bool GridMap::loadLiquidData(FILE* in, uint32 offset, uint32 /*size*/) _liquidOffX = header.offsetX; _liquidOffY = header.offsetY; _liquidWidth = header.width; - _liquidHeight= header.height; + _liquidHeight = header.height; _liquidLevel = header.liquidLevel; if (!(header.flags & MAP_LIQUID_NO_TYPE)) { - _liquidData = new uint8 [16*16]; - if (fread(_liquidData, sizeof(uint8), 16*16, in) != 16*16) + _liquidEntry = new uint16[16*16]; + if (fread(_liquidEntry, sizeof(uint16), 16*16, in) != 16*16) + return false; + + _liquidFlags = new uint8[16*16]; + if (fread(_liquidFlags, sizeof(uint8), 16*16, in) != 16*16) return false; } if (!(header.flags & MAP_LIQUID_NO_HEIGHT)) { - _liquidMap = new float [_liquidWidth*_liquidHeight]; + _liquidMap = new float[_liquidWidth*_liquidHeight]; if (fread(_liquidMap, sizeof(float), _liquidWidth*_liquidHeight, in) != _liquidWidth*_liquidHeight) return false; } @@ -1457,23 +1482,24 @@ float GridMap::getLiquidLevel(float x, float y) return _liquidMap[cx_int*_liquidWidth + cy_int]; } +// Why does this return LIQUID data? uint8 GridMap::getTerrainType(float x, float y) { - if (!_liquidData) + if (!_liquidFlags) return 0; x = 16 * (32 - x/SIZE_OF_GRIDS); y = 16 * (32 - y/SIZE_OF_GRIDS); int lx = (int)x & 15; int ly = (int)y & 15; - return _liquidData[lx*16 + ly]; + return _liquidFlags[lx*16 + ly]; } // Get water state on map inline ZLiquidStatus GridMap::getLiquidStatus(float x, float y, float z, uint8 ReqLiquidType, LiquidData* data) { // Check water type (if no water return) - if (!_liquidType && !_liquidData) + if (!_liquidType && !_liquidFlags) return LIQUID_MAP_NO_WATER; // Get cell @@ -1484,7 +1510,40 @@ inline ZLiquidStatus GridMap::getLiquidStatus(float x, float y, float z, uint8 R int y_int = (int)cy & (MAP_RESOLUTION-1); // Check water type in cell - uint8 type = _liquidData ? _liquidData[(x_int>>3)*16 + (y_int>>3)] : _liquidType; + int idx=(x_int>>3)*16 + (y_int>>3); + uint8 type = _liquidFlags ? _liquidFlags[idx] : _liquidType; + uint32 entry = 0; + if (_liquidEntry) + { + if (LiquidTypeEntry const* liquidEntry = sLiquidTypeStore.LookupEntry(_liquidEntry[idx])) + { + entry = liquidEntry->Id; + type &= MAP_LIQUID_TYPE_DARK_WATER; + uint32 liqTypeIdx = liquidEntry->Type; + if (entry < 21) + { + if (AreaTableEntry const* area = GetAreaEntryByAreaFlagAndMap(getArea(x, y), MAPID_INVALID)) + { + uint32 overrideLiquid = area->LiquidTypeOverride[liquidEntry->Type]; + if (!overrideLiquid && area->zone) + { + area = GetAreaEntryByAreaID(area->zone); + if (area) + overrideLiquid = area->LiquidTypeOverride[liquidEntry->Type]; + } + + if (LiquidTypeEntry const* liq = sLiquidTypeStore.LookupEntry(overrideLiquid)) + { + entry = overrideLiquid; + liqTypeIdx = liq->Type; + } + } + } + + type |= 1 << liqTypeIdx; + } + } + if (type == 0) return LIQUID_MAP_NO_WATER; @@ -1513,20 +1572,20 @@ inline ZLiquidStatus GridMap::getLiquidStatus(float x, float y, float z, uint8 R // All ok in water -> store data if (data) { - data->type = type; + data->entry = entry; + data->type_flags = type; data->level = liquid_level; data->depth_level = ground_level; } // For speed check as int values - int delta = int((liquid_level - z) * 10); + float delta = liquid_level - z; - // Get position delta - if (delta > 20) // Under water + if (delta > 2.0f) // Under water return LIQUID_MAP_UNDER_WATER; - if (delta > 0) // In water + if (delta > 0.0f) // In water return LIQUID_MAP_IN_WATER; - if (delta > -1) // Walk on water + if (delta > -0.1f) // Walk on water return LIQUID_MAP_WATER_WALK; // Above water return LIQUID_MAP_ABOVE_WATER; @@ -1717,8 +1776,9 @@ ZLiquidStatus Map::getLiquidStatus(float x, float y, float z, uint8 ReqLiquidTyp { ZLiquidStatus result = LIQUID_MAP_NO_WATER; VMAP::IVMapManager* vmgr = VMAP::VMapFactory::createOrGetVMapManager(); - float liquid_level, ground_level = INVALID_HEIGHT; - uint32 liquid_type; + float liquid_level = INVALID_HEIGHT; + float ground_level = INVALID_HEIGHT; + uint32 liquid_type = 0; if (vmgr->GetLiquidLevel(GetId(), x, y, z, ReqLiquidType, liquid_level, ground_level, liquid_type)) { sLog->outDebug(LOG_FILTER_MAPS, "getLiquidStatus(): vmap liquid level: %f ground: %f type: %u", liquid_level, ground_level, liquid_type); @@ -1728,20 +1788,49 @@ ZLiquidStatus Map::getLiquidStatus(float x, float y, float z, uint8 ReqLiquidTyp // All ok in water -> store data if (data) { - data->type = liquid_type; + // hardcoded in client like this + if (GetId() == 530 && liquid_type == 2) + liquid_type = 15; + + uint32 liquidFlagType = 0; + if (LiquidTypeEntry const* liq = sLiquidTypeStore.LookupEntry(liquid_type)) + liquidFlagType = liq->Type; + + if (liquid_type && liquid_type < 21) + { + if (AreaTableEntry const* area = GetAreaEntryByAreaFlagAndMap(GetAreaFlag(x, y, z), GetId())) + { + uint32 overrideLiquid = area->LiquidTypeOverride[liquidFlagType]; + if (!overrideLiquid && area->zone) + { + area = GetAreaEntryByAreaID(area->zone); + if (area) + overrideLiquid = area->LiquidTypeOverride[liquidFlagType]; + } + + if (LiquidTypeEntry const* liq = sLiquidTypeStore.LookupEntry(overrideLiquid)) + { + liquid_type = overrideLiquid; + liquidFlagType = liq->Type; + } + } + } + data->level = liquid_level; data->depth_level = ground_level; + + data->entry = liquid_type; + data->type_flags = 1 << liquidFlagType; } - // For speed check as int values - int delta = int((liquid_level - z) * 10); + float delta = liquid_level - z; // Get position delta - if (delta > 20) // Under water + if (delta > 2.0f) // Under water return LIQUID_MAP_UNDER_WATER; - if (delta > 0 ) // In water + if (delta > 0.0f) // In water return LIQUID_MAP_IN_WATER; - if (delta > -1) // Walk on water + if (delta > -0.1f) // Walk on water return LIQUID_MAP_WATER_WALK; result = LIQUID_MAP_ABOVE_WATER; } @@ -1755,7 +1844,13 @@ ZLiquidStatus Map::getLiquidStatus(float x, float y, float z, uint8 ReqLiquidTyp if (map_result != LIQUID_MAP_NO_WATER && (map_data.level > ground_level)) { if (data) + { + // hardcoded in client like this + if (GetId() == 530 && map_data.entry == 2) + map_data.entry = 15; + *data = map_data; + } return map_result; } } @@ -2260,7 +2355,7 @@ bool InstanceMap::CanEnter(Player* player) return false; } // player inside instance has no group or his groups is different to entering player's one, deny entry - if (!iPlayer->GetGroup() || iPlayer->GetGroup() != player->GetGroup() ) + if (!iPlayer->GetGroup() || iPlayer->GetGroup() != player->GetGroup()) { player->SendTransferAborted(GetId(), TRANSFER_ABORT_MAX_PLAYERS); return false; @@ -2376,7 +2471,7 @@ bool InstanceMap::AddPlayerToMap(Player* player) if (uint32 dungeonId = sLFGMgr->GetDungeon(group->GetGUID(), true)) if (LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(dungeonId)) if (LFGDungeonEntry const* randomDungeon = sLFGDungeonStore.LookupEntry(*(sLFGMgr->GetSelectedDungeons(player->GetGUID()).begin()))) - if (uint32(dungeon->map) == GetId() && dungeon->difficulty == GetDifficulty() && randomDungeon->type == LFG_TYPE_RANDOM) + if (uint32(dungeon->map) == GetId() && dungeon->difficulty == uint32(GetDifficulty()) && randomDungeon->type == uint32(LFG_TYPE_RANDOM)) player->CastSpell(player, LFG_SPELL_LUCK_OF_THE_DRAW, true); } @@ -2439,7 +2534,11 @@ void InstanceMap::CreateInstanceData(bool load) if (load) { // TODO: make a global storage for this - QueryResult result = CharacterDatabase.PQuery("SELECT data, completedEncounters FROM instance WHERE map = '%u' AND id = '%u'", GetId(), i_InstanceId); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_INSTANCE); + stmt->setUInt16(0, uint16(GetId())); + stmt->setUInt32(1, i_InstanceId); + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (result) { Field* fields = result->Fetch(); @@ -2519,6 +2618,8 @@ void InstanceMap::PermBindAllPlayers(Player* source) WorldPacket data(SMSG_INSTANCE_SAVE_CREATED, 4); data << uint32(0); player->GetSession()->SendPacket(&data); + + player->GetSession()->SendCalendarRaidLockout(save, true); } // if the leader is not in the instance the group will not get a perm bind diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h index d8db4c947a3..6ba08646f25 100755 --- a/src/server/game/Maps/Map.h +++ b/src/server/game/Maps/Map.h @@ -136,7 +136,8 @@ enum ZLiquidStatus struct LiquidData { - uint32 type; + uint32 type_flags; + uint32 entry; float level; float depth_level; }; @@ -163,7 +164,8 @@ class GridMap // Liquid data float _liquidLevel; - uint8* _liquidData; + uint16* _liquidEntry; + uint8* _liquidFlags; float* _liquidMap; uint16 _gridArea; uint16 _liquidType; @@ -226,7 +228,7 @@ enum LevelRequirementVsMode #define MAX_HEIGHT 100000.0f // can be use for find ground height at surface #define INVALID_HEIGHT -100000.0f // for check, must be equal to VMAP_INVALID_HEIGHT, real value for unknown height is VMAP_INVALID_HEIGHT_VALUE #define MAX_FALL_DISTANCE 250000.0f // "unlimited fall" to find VMap ground if it is available, just larger than MAX_HEIGHT - INVALID_HEIGHT -#define DEFAULT_HEIGHT_SEARCH 10.0f // default search distance to find height at nearby locations +#define DEFAULT_HEIGHT_SEARCH 50.0f // default search distance to find height at nearby locations #define MIN_UNLOAD_DELAY 1 // immediate unload typedef std::map CreatureGroupHolderType; @@ -243,8 +245,12 @@ class Map : public GridRefManager // currently unused for normal maps bool CanUnload(uint32 diff) { - if (!m_unloadTimer) return false; - if (m_unloadTimer <= diff) return true; + if (!m_unloadTimer) + return false; + + if (m_unloadTimer <= diff) + return true; + m_unloadTimer -= diff; return false; } diff --git a/src/server/game/Maps/MapInstanced.cpp b/src/server/game/Maps/MapInstanced.cpp index fbe609bee23..5543251e115 100755 --- a/src/server/game/Maps/MapInstanced.cpp +++ b/src/server/game/Maps/MapInstanced.cpp @@ -116,19 +116,21 @@ Map* MapInstanced::CreateInstanceForPlayer(const uint32 mapId, Player* player) return NULL; Map* map = NULL; - uint32 NewInstanceId = 0; // instanceId of the resulting map + uint32 newInstanceId = 0; // instanceId of the resulting map if (IsBattlegroundOrArena()) { // instantiate or find existing bg map for player // the instance id is set in battlegroundid - NewInstanceId = player->GetBattlegroundId(); - if (!NewInstanceId) return NULL; - map = sMapMgr->FindMap(mapId, NewInstanceId); + newInstanceId = player->GetBattlegroundId(); + if (!newInstanceId) + return NULL; + + map = sMapMgr->FindMap(mapId, newInstanceId); if (!map) { if (Battleground* bg = player->GetBattleground()) - map = CreateBattleground(NewInstanceId, bg); + map = CreateBattleground(newInstanceId, bg); else { player->TeleportToBGEntryPoint(); @@ -158,24 +160,24 @@ Map* MapInstanced::CreateInstanceForPlayer(const uint32 mapId, Player* player) if (pSave) { // solo/perm/group - NewInstanceId = pSave->GetInstanceId(); - map = FindInstanceMap(NewInstanceId); + newInstanceId = pSave->GetInstanceId(); + map = FindInstanceMap(newInstanceId); // it is possible that the save exists but the map doesn't if (!map) - map = CreateInstance(NewInstanceId, pSave, pSave->GetDifficulty()); + map = CreateInstance(newInstanceId, pSave, pSave->GetDifficulty()); } else { // if no instanceId via group members or instance saves is found // the instance will be created for the first time - NewInstanceId = sMapMgr->GenerateInstanceId(); + newInstanceId = sMapMgr->GenerateInstanceId(); Difficulty diff = player->GetGroup() ? player->GetGroup()->GetDifficulty(IsRaid()) : player->GetDifficulty(IsRaid()); //Seems it is now possible, but I do not know if it should be allowed //ASSERT(!FindInstanceMap(NewInstanceId)); - map = FindInstanceMap(NewInstanceId); + map = FindInstanceMap(newInstanceId); if (!map) - map = CreateInstance(NewInstanceId, NULL, diff); + map = CreateInstance(newInstanceId, NULL, diff); } } diff --git a/src/server/game/Maps/MapManager.cpp b/src/server/game/Maps/MapManager.cpp index 6890ec8ac2e..ce93fe5af1a 100755 --- a/src/server/game/Maps/MapManager.cpp +++ b/src/server/game/Maps/MapManager.cpp @@ -96,32 +96,32 @@ void MapManager::checkAndCorrectGridStatesArray() Map* MapManager::CreateBaseMap(uint32 id) { - Map* m = FindBaseMap(id); + Map* map = FindBaseMap(id); - if (m == NULL) + if (map == NULL) { TRINITY_GUARD(ACE_Thread_Mutex, Lock); const MapEntry* entry = sMapStore.LookupEntry(id); if (entry && entry->Instanceable()) { - m = new MapInstanced(id, i_gridCleanUpDelay); + map = new MapInstanced(id, i_gridCleanUpDelay); } else { - m = new Map(id, i_gridCleanUpDelay, 0, REGULAR_DIFFICULTY); + map = new Map(id, i_gridCleanUpDelay, 0, REGULAR_DIFFICULTY); } - i_maps[id] = m; + i_maps[id] = map; } - ASSERT(m != NULL); - return m; + ASSERT(map); + return map; } Map* MapManager::FindBaseNonInstanceMap(uint32 mapId) const { Map* map = FindBaseMap(mapId); - if(map && map->Instanceable()) + if (map && map->Instanceable()) return NULL; return map; } diff --git a/src/server/game/Maps/MapUpdater.cpp b/src/server/game/Maps/MapUpdater.cpp index 80025680753..b747d065a14 100644 --- a/src/server/game/Maps/MapUpdater.cpp +++ b/src/server/game/Maps/MapUpdater.cpp @@ -52,7 +52,7 @@ class MapUpdateRequest : public ACE_Method_Request virtual int call() { m_map.Update (m_diff); - m_updater.update_finished (); + m_updater.update_finished(); return 0; } }; diff --git a/src/server/game/Miscellaneous/Formulas.h b/src/server/game/Miscellaneous/Formulas.h index 27397837265..dacd9962251 100755 --- a/src/server/game/Miscellaneous/Formulas.h +++ b/src/server/game/Miscellaneous/Formulas.h @@ -165,8 +165,8 @@ namespace Trinity if (u->GetTypeId() == TYPEID_UNIT && (((Creature*)u)->isTotem() || ((Creature*)u)->isPet() || - (((Creature*)u)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_XP_AT_KILL) || - ((Creature*)u)->GetCreatureInfo()->type == CREATURE_TYPE_CRITTER)) + (((Creature*)u)->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_XP_AT_KILL) || + ((Creature*)u)->GetCreatureTemplate()->type == CREATURE_TYPE_CRITTER)) gain = 0; else { diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h index e751dbf92fe..aec72835d86 100755 --- a/src/server/game/Miscellaneous/Language.h +++ b/src/server/game/Miscellaneous/Language.h @@ -522,8 +522,11 @@ enum TrinityStrings LANG_YOURS_EXPLORE_SET_ALL = 553, LANG_YOURS_EXPLORE_SET_NOTHING = 554, - LANG_HOVER_ENABLED = 555, - LANG_HOVER_DISABLED = 556, + LANG_NPC_SETDATA = 555, + + //! Old ones now free: + // LANG_HOVER_DISABLED = 556, + LANG_YOURS_LEVEL_UP = 557, LANG_YOURS_LEVEL_DOWN = 558, LANG_YOURS_LEVEL_PROGRESS_RESET = 559, @@ -811,7 +814,9 @@ enum TrinityStrings LANG_MOVEGENS_FOLLOW_CREATURE = 1140, LANG_MOVEGENS_FOLLOW_NULL = 1141, LANG_MOVEGENS_EFFECT = 1142, - // Room for more level 3 1143-1199 not used + LANG_MOVEFLAGS_GET = 1143, + LANG_MOVEFLAGS_SET = 1144, + // Room for more level 3 1144-1199 not used // Debug commands LANG_CINEMATIC_NOT_EXIST = 1200, diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index f1ebfb6ec96..7b77ecaa17e 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -258,7 +258,8 @@ enum SpellCategory SPELL_CATEGORY_DRINK = 59, }; -const uint32 ItemQualityColors[MAX_ITEM_QUALITY] = { +const uint32 ItemQualityColors[MAX_ITEM_QUALITY] = +{ 0xff9d9d9d, //GREY 0xffffffff, //WHITE 0xff1eff00, //GREEN @@ -278,7 +279,7 @@ enum SpellAttr0 SPELL_ATTR0_UNK0 = 0x00000001, // 0 SPELL_ATTR0_REQ_AMMO = 0x00000002, // 1 on next ranged SPELL_ATTR0_ON_NEXT_SWING = 0x00000004, // 2 - SPELL_ATTR0_UNK3 = 0x00000008, // 3 not set in 3.0.3 + SPELL_ATTR0_IS_REPLENISHMENT = 0x00000008, // 3 not set in 3.0.3 SPELL_ATTR0_ABILITY = 0x00000010, // 4 client puts 'ability' instead of 'spell' in game strings for these spells SPELL_ATTR0_TRADESPELL = 0x00000020, // 5 trade spells (recipes), will be added by client to a sublist of profession spell SPELL_ATTR0_PASSIVE = 0x00000040, // 6 Passive spell @@ -323,7 +324,7 @@ enum SpellAttr1 SPELL_ATTR1_MELEE_COMBAT_START = 0x00000200, // 9 player starts melee combat after this spell is cast SPELL_ATTR1_NO_THREAT = 0x00000400, // 10 no generates threat on cast 100% (old NO_INITIAL_AGGRO) SPELL_ATTR1_UNK11 = 0x00000800, // 11 aura - SPELL_ATTR1_UNK12 = 0x00001000, // 12 pickpoket + SPELL_ATTR1_IS_PICKPOCKET = 0x00001000, // 12 Pickpocket SPELL_ATTR1_FARSIGHT = 0x00002000, // 13 Client removes farsight on aura loss SPELL_ATTR1_CHANNEL_TRACK_TARGET = 0x00004000, // 14 Client automatically forces player to face target when channeling SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY = 0x00008000, // 15 remove auras on immunity @@ -335,7 +336,7 @@ enum SpellAttr1 SPELL_ATTR1_UNK21 = 0x00200000, // 21 SPELL_ATTR1_REQ_COMBO_POINTS2 = 0x00400000, // 22 Req combo points on target SPELL_ATTR1_UNK23 = 0x00800000, // 23 - SPELL_ATTR1_UNK24 = 0x01000000, // 24 only fishing spells + SPELL_ATTR1_IS_FISHING = 0x01000000, // 24 only fishing spells SPELL_ATTR1_UNK25 = 0x02000000, // 25 SPELL_ATTR1_UNK26 = 0x04000000, // 26 works correctly with [target=focus] and [target=mouseover] macros? SPELL_ATTR1_UNK27 = 0x08000000, // 27 melee spell? @@ -360,17 +361,17 @@ enum SpellAttr2 SPELL_ATTR2_UNK10 = 0x00000400, // 10 related to tame SPELL_ATTR2_HEALTH_FUNNEL = 0x00000800, // 11 SPELL_ATTR2_UNK12 = 0x00001000, // 12 Cleave, Heart Strike, Maul, Sunder Armor, Swipe - SPELL_ATTR2_UNK13 = 0x00002000, // 13 Items enchanted by spells with this flag preserve the enchant to arenas + SPELL_ATTR2_PRESERVE_ENCHANT_IN_ARENA = 0x00002000, // 13 Items enchanted by spells with this flag preserve the enchant to arenas SPELL_ATTR2_UNK14 = 0x00004000, // 14 SPELL_ATTR2_UNK15 = 0x00008000, // 15 not set in 3.0.3 SPELL_ATTR2_TAME_BEAST = 0x00010000, // 16 SPELL_ATTR2_NOT_RESET_AUTO_ACTIONS = 0x00020000, // 17 don't reset timers for melee autoattacks (swings) or ranged autoattacks (autoshoots) - SPELL_ATTR2_UNK18 = 0x00040000, // 18 Only Revive pet - possible req dead pet + SPELL_ATTR2_REQ_DEAD_PET = 0x00040000, // 18 Only Revive pet and Heart of the Pheonix SPELL_ATTR2_NOT_NEED_SHAPESHIFT = 0x00080000, // 19 does not necessarly need shapeshift SPELL_ATTR2_UNK20 = 0x00100000, // 20 SPELL_ATTR2_DAMAGE_REDUCED_SHIELD = 0x00200000, // 21 for ice blocks, pala immunity buffs, priest absorb shields, but used also for other spells -> not sure! SPELL_ATTR2_UNK22 = 0x00400000, // 22 Ambush, Backstab, Cheap Shot, Death Grip, Garrote, Judgements, Mutilate, Pounce, Ravage, Shiv, Shred - SPELL_ATTR2_UNK23 = 0x00800000, // 23 Only mage Arcane Concentration have this flag + SPELL_ATTR2_IS_ARCANE_CONCENTRATION = 0x00800000, // 23 Only mage Arcane Concentration have this flag SPELL_ATTR2_UNK24 = 0x01000000, // 24 SPELL_ATTR2_UNK25 = 0x02000000, // 25 SPELL_ATTR2_UNK26 = 0x04000000, // 26 unaffected by school immunity @@ -397,7 +398,7 @@ enum SpellAttr3 SPELL_ATTR3_BATTLEGROUND = 0x00000800, // 11 Can casted only on battleground SPELL_ATTR3_ONLY_TARGET_GHOSTS = 0x00001000, // 12 SPELL_ATTR3_UNK13 = 0x00002000, // 13 - SPELL_ATTR3_UNK14 = 0x00004000, // 14 "Honorless Target" only this spells have this flag + SPELL_ATTR3_IS_HONORLESS_TARGET = 0x00004000, // 14 "Honorless Target" only this spells have this flag SPELL_ATTR3_UNK15 = 0x00008000, // 15 Auto Shoot, Shoot, Throw, - this is autoshot flag SPELL_ATTR3_CANT_TRIGGER_PROC = 0x00010000, // 16 confirmed with many patchnotes SPELL_ATTR3_NO_INITIAL_AGGRO = 0x00020000, // 17 Soothe Animal, 39758, Mind Soothe @@ -419,8 +420,8 @@ enum SpellAttr3 enum SpellAttr4 { - SPELL_ATTR4_UNK0 = 0x00000001, // 0 - SPELL_ATTR4_PROC_ONLY_ON_DUMMY = 0x00000002, // 1 proc only on SPELL_EFFECT_DUMMY? + SPELL_ATTR4_IGNORE_RESISTANCES = 0x00000001, // 0 spells with this attribute will completely ignore the target's resistance (these spells can't be resisted) + SPELL_ATTR4_PROC_ONLY_ON_CASTER = 0x00000002, // 1 proc only on effects with TARGET_UNIT_CASTER? SPELL_ATTR4_UNK2 = 0x00000004, // 2 SPELL_ATTR4_UNK3 = 0x00000008, // 3 SPELL_ATTR4_UNK4 = 0x00000010, // 4 This will no longer cause guards to attack on use?? @@ -441,16 +442,16 @@ enum SpellAttr4 SPELL_ATTR4_UNK19 = 0x00080000, // 19 proc dalayed, after damage or don't proc on absorb? SPELL_ATTR4_NOT_CHECK_SELFCAST_POWER = 0x00100000, // 20 supersedes message "More powerful spell applied" for self casts. SPELL_ATTR4_UNK21 = 0x00200000, // 21 Pally aura, dk presence, dudu form, warrior stance, shadowform, hunter track - SPELL_ATTR4_UNK22 = 0x00400000, // 22 + SPELL_ATTR4_UNK22 = 0x00400000, // 22 Seal of Command (42058,57770) and Gymer's Smash 55426 SPELL_ATTR4_UNK23 = 0x00800000, // 23 SPELL_ATTR4_UNK24 = 0x01000000, // 24 some shoot spell - SPELL_ATTR4_UNK25 = 0x02000000, // 25 pet scaling auras + SPELL_ATTR4_IS_PET_SCALING = 0x02000000, // 25 pet scaling auras SPELL_ATTR4_CAST_ONLY_IN_OUTLAND = 0x04000000, // 26 Can only be used in Outland. SPELL_ATTR4_UNK27 = 0x08000000, // 27 SPELL_ATTR4_UNK28 = 0x10000000, // 28 Aimed Shot SPELL_ATTR4_UNK29 = 0x20000000, // 29 SPELL_ATTR4_UNK30 = 0x40000000, // 30 - SPELL_ATTR4_UNK31 = 0x80000000 // 31 + SPELL_ATTR4_UNK31 = 0x80000000 // 31 Polymorph (chicken) 228 and Sonic Boom (38052,38488) }; enum SpellAttr5 @@ -470,7 +471,7 @@ enum SpellAttr5 SPELL_ATTR5_UNK12 = 0x00001000, // 12 Cleave related? SPELL_ATTR5_HASTE_AFFECT_DURATION = 0x00002000, // 13 haste effects decrease duration of this SPELL_ATTR5_UNK14 = 0x00004000, // 14 - SPELL_ATTR5_UNK15 = 0x00008000, // 15 + SPELL_ATTR5_UNK15 = 0x00008000, // 15 Inflits on multiple targets? SPELL_ATTR5_SPECIAL_ITEM_CLASS_CHECK = 0x00010000, // 16 this allows spells with EquippedItemClass to affect spells from other items if the required item is equipped SPELL_ATTR5_USABLE_WHILE_FEARED = 0x00020000, // 17 usable while feared SPELL_ATTR5_USABLE_WHILE_CONFUSED = 0x00040000, // 18 usable while confused @@ -2640,7 +2641,7 @@ enum CreatureTypeFlags { CREATURE_TYPEFLAGS_TAMEABLE = 0x00000001, // Tameable by any hunter CREATURE_TYPEFLAGS_GHOST = 0x00000002, // Creature are also visible for not alive player. Allow gossip interaction if npcflag allow? - CREATURE_TYPEFLAGS_UNK2 = 0x00000004, + CREATURE_TYPEFLAGS_BOSS = 0x00000004, CREATURE_TYPEFLAGS_UNK3 = 0x00000008, CREATURE_TYPEFLAGS_UNK4 = 0x00000010, CREATURE_TYPEFLAGS_UNK5 = 0x00000020, @@ -2664,7 +2665,7 @@ enum CreatureTypeFlags CREATURE_TYPEFLAGS_UNK23 = 0x00800000, // ? First seen in 3.2.2. Related to banner/backpack of creature/companion? CREATURE_TYPEFLAGS_UNK24 = 0x01000000, CREATURE_TYPEFLAGS_UNK25 = 0x02000000, - CREATURE_TYPEFLAGS_UNK26 = 0x04000000, + CREATURE_TYPEFLAGS_PARTY_MEMBER = 0x04000000, //! Creature can be targeted by spells that require target to be in caster's party/raid CREATURE_TYPEFLAGS_UNK27 = 0x08000000, CREATURE_TYPEFLAGS_UNK28 = 0x10000000, CREATURE_TYPEFLAGS_UNK29 = 0x20000000, @@ -3421,25 +3422,25 @@ enum BanReturn // indexes of BattlemasterList.dbc enum BattlegroundTypeId { - BATTLEGROUND_TYPE_NONE = 0, - BATTLEGROUND_AV = 1, - BATTLEGROUND_WS = 2, - BATTLEGROUND_AB = 3, - BATTLEGROUND_NA = 4, - BATTLEGROUND_BE = 5, - BATTLEGROUND_AA = 6, - BATTLEGROUND_EY = 7, - BATTLEGROUND_RL = 8, - BATTLEGROUND_SA = 9, - BATTLEGROUND_DS = 10, - BATTLEGROUND_RV = 11, - BATTLEGROUND_IC = 30, - BATTLEGROUND_RB = 32, - BATTLEGROUND_RATED_10_VS_10 = 100, - BATTLEGROUND_RATED_15_VS_15 = 101, - BATTLEGROUND_RATED_25_VS_25 = 102, - BATTLEGROUND_TP = 108, - BATTLEGROUND_BFG = 120, + BATTLEGROUND_TYPE_NONE = 0, // None + BATTLEGROUND_AV = 1, // Alterac Valley + BATTLEGROUND_WS = 2, // Warsong Gulch + BATTLEGROUND_AB = 3, // Arathi Basin + BATTLEGROUND_NA = 4, // Nagrand Arena + BATTLEGROUND_BE = 5, // Blade's Edge Arena + BATTLEGROUND_AA = 6, // All Arenas + BATTLEGROUND_EY = 7, // Eye of the Storm + BATTLEGROUND_RL = 8, // Ruins of Lordaernon + BATTLEGROUND_SA = 9, // Strand of the Ancients + BATTLEGROUND_DS = 10, // Dalaran Sewers + BATTLEGROUND_RV = 11, // Ring of Valor + BATTLEGROUND_IC = 30, // Isle of Conquest + BATTLEGROUND_RB = 32, // Random Battleground + BATTLEGROUND_RATED_10_VS_10 = 100, // Rated BG 10 vs 10 + BATTLEGROUND_RATED_15_VS_15 = 101, // Rated BG 15 vs 15 + BATTLEGROUND_RATED_25_VS_25 = 102, // Rated BG 25 vs 25 + BATTLEGROUND_TP = 108, // Twin Peaks + BATTLEGROUND_BFG = 120, // Battle For Gilneas // 441 = "Icecrown Citadel" // 443 = "The Ruby Sanctum" // 656 = "Rated Eye of the Storm" @@ -3559,4 +3560,105 @@ enum ActivateTaxiReply ERR_TAXINOTSTANDING = 12 }; +// Calendar - start + +enum CalendarFlags +{ + CALENDAR_FLAG_ALL_ALLOWED = 0x001, + CALENDAR_FLAG_INVITES_LOCKED = 0x010, + CALENDAR_FLAG_WITHOUT_INVITES = 0x040, + CALENDAR_FLAG_GUILD_ONLY = 0x400, +}; + +enum CalendarActionData +{ + CALENDAR_ACTION_NONE, + CALENDAR_ACTION_ADD_EVENT, + CALENDAR_ACTION_MODIFY_EVENT, + CALENDAR_ACTION_REMOVE_EVENT, + CALENDAR_ACTION_COPY_EVENT, + CALENDAR_ACTION_ADD_EVENT_INVITE, + CALENDAR_ACTION_MODIFY_EVENT_INVITE, + CALENDAR_ACTION_MODIFY_MODERATOR_EVENT_INVITE, + CALENDAR_ACTION_REMOVE_EVENT_INVITE, + CALENDAR_ACTION_SIGNUP_TO_EVENT, +}; + +enum CalendarModerationRank +{ + CALENDAR_RANK_PLAYER, + CALENDAR_RANK_MODERATOR, + CALENDAR_RANK_OWNER, +}; + +enum CalendarSendEventType +{ + CALENDAR_SENDTYPE_GET, + CALENDAR_SENDTYPE_ADD, + CALENDAR_SENDTYPE_COPY, +}; + +enum CalendarEventType +{ + CALENDAR_TYPE_RAID, + CALENDAR_TYPE_DUNGEON, + CALENDAR_TYPE_PVP, + CALENDAR_TYPE_MEETING, + CALENDAR_TYPE_OTHER, +}; + +enum CalendarInviteStatus +{ + CALENDAR_STATUS_INVITED, + CALENDAR_STATUS_ACCEPTED, + CALENDAR_STATUS_DECLINED, + CALENDAR_STATUS_TENTATIVE, + CALENDAR_STATUS_OUT, + CALENDAR_STATUS_STANDBY, + CALENDAR_STATUS_CONFIRMED, + CALENDAR_STATUS_NO_OWNER, + CALENDAR_STATUS_8, + CALENDAR_STATUS_9, +}; + +enum CalendarError +{ + CALENDAR_OK = 0, + CALENDAR_ERROR_GUILD_EVENTS_EXCEEDED = 1, + CALENDAR_ERROR_EVENTS_EXCEEDED = 2, + CALENDAR_ERROR_SELF_INVITES_EXCEEDED = 3, + CALENDAR_ERROR_OTHER_INVITES_EXCEEDED = 4, + CALENDAR_ERROR_PERMISSIONS = 5, + CALENDAR_ERROR_EVENT_INVALID = 6, + CALENDAR_ERROR_NOT_INVITED = 7, + CALENDAR_ERROR_INTERNAL = 8, + CALENDAR_ERROR_GUILD_PLAYER_NOT_IN_GUILD = 9, + CALENDAR_ERROR_ALREADY_INVITED_TO_EVENT_S = 10, + CALENDAR_ERROR_PLAYER_NOT_FOUND = 11, + CALENDAR_ERROR_NOT_ALLIED = 12, + CALENDAR_ERROR_IGNORING_YOU_S = 13, + CALENDAR_ERROR_INVITES_EXCEEDED = 14, + CALENDAR_ERROR_INVALID_DATE = 16, + CALENDAR_ERROR_INVALID_TIME = 17, + + CALENDAR_ERROR_NEEDS_TITLE = 19, + CALENDAR_ERROR_EVENT_PASSED = 20, + CALENDAR_ERROR_EVENT_LOCKED = 21, + CALENDAR_ERROR_DELETE_CREATOR_FAILED = 22, + CALENDAR_ERROR_SYSTEM_DISABLED = 24, + CALENDAR_ERROR_RESTRICTED_ACCOUNT = 25, + CALENDAR_ERROR_ARENA_EVENTS_EXCEEDED = 26, + CALENDAR_ERROR_RESTRICTED_LEVEL = 27, + CALENDAR_ERROR_USER_SQUELCHED = 28, + CALENDAR_ERROR_NO_INVITE = 29, + + CALENDAR_ERROR_EVENT_WRONG_SERVER = 36, + CALENDAR_ERROR_INVITE_WRONG_SERVER = 37, + CALENDAR_ERROR_NO_GUILD_INVITES = 38, + CALENDAR_ERROR_INVALID_SIGNUP = 39, + CALENDAR_ERROR_NO_MODERATOR = 40 +}; + +// Calendar - end + #endif diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp index 27816753ca7..c0e1eb842ae 100755 --- a/src/server/game/Movement/MotionMaster.cpp +++ b/src/server/game/Movement/MotionMaster.cpp @@ -114,6 +114,9 @@ void MotionMaster::UpdateMotion(uint32 diff) _cleanFlag &= ~MMCF_RESET; } + + // probably not the best place to pu this but im not really sure where else to put it. + _owner->UpdateUnderwaterState(_owner->GetMap(), _owner->GetPositionX(), _owner->GetPositionY(), _owner->GetPositionZ()); } void MotionMaster::DirectClean(bool reset) @@ -202,11 +205,11 @@ void MotionMaster::MoveTargetedHome() } else if (_owner->GetTypeId()==TYPEID_UNIT && ((Creature*)_owner)->GetCharmerOrOwnerGUID()) { - sLog->outStaticDebug("Pet or controlled creature (Entry: %u GUID: %u) targeting home", _owner->GetEntry(), _owner->GetGUIDLow() ); + sLog->outStaticDebug("Pet or controlled creature (Entry: %u GUID: %u) targeting home", _owner->GetEntry(), _owner->GetGUIDLow()); Unit *target = ((Creature*)_owner)->GetCharmerOrOwner(); if (target) { - sLog->outStaticDebug("Following %s (GUID: %u)", target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : ((Creature*)target)->GetDBTableGUIDLow() ); + sLog->outStaticDebug("Following %s (GUID: %u)", target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : ((Creature*)target)->GetDBTableGUIDLow()); Mutate(new FollowMovementGenerator(*target,PET_FOLLOW_DIST,PET_FOLLOW_ANGLE), MOTION_SLOT_ACTIVE); } } @@ -383,6 +386,12 @@ void MotionMaster::MoveFall(uint32 id/*=0*/) if (fabs(_owner->GetPositionZ() - tz) < 0.1f) return; + if (_owner->GetTypeId() == TYPEID_PLAYER) + { + _owner->AddUnitMovementFlag(MOVEMENTFLAG_FALLING); + _owner->m_movementInfo.SetFallTime(0); + } + Movement::MoveSplineInit init(*_owner); init.MoveTo(_owner->GetPositionX(), _owner->GetPositionY(), tz); init.SetFall(); diff --git a/src/server/game/Movement/MovementGenerator.h b/src/server/game/Movement/MovementGenerator.h index dd9ba32f337..0a2ebcfaeee 100755 --- a/src/server/game/Movement/MovementGenerator.h +++ b/src/server/game/Movement/MovementGenerator.h @@ -38,7 +38,7 @@ class MovementGenerator virtual void Reset(Unit &) = 0; - virtual bool Update(Unit &, const uint32 time_diff) = 0; + virtual bool Update(Unit &, const uint32& time_diff) = 0; virtual MovementGeneratorType GetMovementGeneratorType() = 0; @@ -64,7 +64,7 @@ class MovementGeneratorMedium : public MovementGenerator //u->AssertIsType(); (static_cast(this))->Reset(*((T*)&u)); } - bool Update(Unit &u, const uint32 time_diff) + bool Update(Unit &u, const uint32& time_diff) { //u->AssertIsType(); return (static_cast(this))->Update(*((T*)&u), time_diff); @@ -74,7 +74,7 @@ class MovementGeneratorMedium : public MovementGenerator void Initialize(T &u); void Finalize(T &u); void Reset(T &u); - bool Update(T &u, const uint32 time_diff); + bool Update(T &u, const uint32& time_diff); }; struct SelectableMovement : public FactoryHolder diff --git a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp index 32b960028c2..54a68f92c66 100755 --- a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp @@ -32,11 +32,10 @@ template void ConfusedMovementGenerator::Initialize(T &unit) { - const float wander_distance=4; - float x,y,z; - x = unit.GetPositionX(); - y = unit.GetPositionY(); - z = unit.GetPositionZ(); + float const wander_distance = 4; + float x = unit.GetPositionX(); + float y = unit.GetPositionY(); + float z = unit.GetPositionZ(); Map const* map = unit.GetBaseMap(); @@ -47,31 +46,42 @@ void ConfusedMovementGenerator::Initialize(T &unit) for (uint8 idx = 0; idx < MAX_CONF_WAYPOINTS + 1; ++idx) { - const float wanderX=wander_distance*(float)rand_norm() - wander_distance/2; - const float wanderY=wander_distance*(float)rand_norm() - wander_distance/2; - - i_waypoints[idx][0] = x + wanderX; - i_waypoints[idx][1] = y + wanderY; + float wanderX = x + (wander_distance * (float)rand_norm() - wander_distance/2); + float wanderY = y + (wander_distance * (float)rand_norm() - wander_distance/2); // prevent invalid coordinates generation - Trinity::NormalizeMapCoord(i_waypoints[idx][0]); - Trinity::NormalizeMapCoord(i_waypoints[idx][1]); + Trinity::NormalizeMapCoord(wanderX); + Trinity::NormalizeMapCoord(wanderY); - bool is_water = map->IsInWater(i_waypoints[idx][0],i_waypoints[idx][1],z); - // if generated wrong path just ignore - if ((is_water && !is_water_ok) || (!is_water && !is_land_ok)) + if (unit.IsWithinLOS(wanderX, wanderY, z)) + { + bool is_water = map->IsInWater(wanderX, wanderY, z); + + if ((is_water && !is_water_ok) || (!is_water && !is_land_ok)) + { + //! Cannot use coordinates outside our InhabitType. Use the current or previous position. + wanderX = idx > 0 ? i_waypoints[idx-1][0] : x; + wanderY = idx > 0 ? i_waypoints[idx-1][1] : y; + } + } + else { - i_waypoints[idx][0] = idx > 0 ? i_waypoints[idx-1][0] : x; - i_waypoints[idx][1] = idx > 0 ? i_waypoints[idx-1][1] : y; + //! Trying to access path outside line of sight. Skip this by using the current or previous position. + wanderX = idx > 0 ? i_waypoints[idx-1][0] : x; + wanderY = idx > 0 ? i_waypoints[idx-1][1] : y; } - unit.UpdateAllowedPositionZ(i_waypoints[idx][0], i_waypoints[idx][1], z); - i_waypoints[idx][2] = z; + unit.UpdateAllowedPositionZ(wanderX, wanderY, z); + + //! Positions are fine - apply them to this waypoint + i_waypoints[idx][0] = wanderX; + i_waypoints[idx][1] = wanderY; + i_waypoints[idx][2] = z; } unit.StopMoving(); unit.SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED); - unit.AddUnitState(UNIT_STATE_CONFUSED|UNIT_STATE_CONFUSED_MOVE); + unit.AddUnitState(UNIT_STATE_CONFUSED | UNIT_STATE_CONFUSED_MOVE); } template<> @@ -94,7 +104,7 @@ void ConfusedMovementGenerator::Reset(T &unit) i_nextMove = 1; i_nextMoveTime.Reset(0); unit.StopMoving(); - unit.AddUnitState(UNIT_STATE_CONFUSED|UNIT_STATE_CONFUSED_MOVE); + unit.AddUnitState(UNIT_STATE_CONFUSED | UNIT_STATE_CONFUSED_MOVE); } template @@ -110,20 +120,20 @@ bool ConfusedMovementGenerator::Update(T &unit, const uint32 &diff) if (unit.movespline->Finalized()) { - i_nextMove = urand(1,MAX_CONF_WAYPOINTS); - i_nextMoveTime.Reset(urand(0, 1500-1)); // TODO: check the minimum reset time, should be probably higher + i_nextMove = urand(1, MAX_CONF_WAYPOINTS); + i_nextMoveTime.Reset(urand(500, 1200)); // Guessed } } else { // waiting for next move i_nextMoveTime.Update(diff); - if(i_nextMoveTime.Passed() ) + if (i_nextMoveTime.Passed()) { // start moving unit.AddUnitState(UNIT_STATE_CONFUSED_MOVE); - ASSERT( i_nextMove <= MAX_CONF_WAYPOINTS ); + ASSERT(i_nextMove <= MAX_CONF_WAYPOINTS); float x = i_waypoints[i_nextMove][0]; float y = i_waypoints[i_nextMove][1]; float z = i_waypoints[i_nextMove][2]; @@ -141,14 +151,14 @@ template<> void ConfusedMovementGenerator::Finalize(Player &unit) { unit.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED); - unit.ClearUnitState(UNIT_STATE_CONFUSED|UNIT_STATE_CONFUSED_MOVE); + unit.ClearUnitState(UNIT_STATE_CONFUSED | UNIT_STATE_CONFUSED_MOVE); } template<> void ConfusedMovementGenerator::Finalize(Creature &unit) { unit.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED); - unit.ClearUnitState(UNIT_STATE_CONFUSED|UNIT_STATE_CONFUSED_MOVE); + unit.ClearUnitState(UNIT_STATE_CONFUSED | UNIT_STATE_CONFUSED_MOVE); if (unit.getVictim()) unit.SetTarget(unit.getVictim()->GetGUID()); } diff --git a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.h b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.h index b9f96bb785d..7f2226ea069 100755 --- a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.h @@ -22,11 +22,10 @@ #include "MovementGenerator.h" #include "Timer.h" -#define MAX_CONF_WAYPOINTS 24 +#define MAX_CONF_WAYPOINTS 24 //! Allows a twelve second confusion if i_nextMove always is the absolute minimum timer. template -class ConfusedMovementGenerator -: public MovementGeneratorMedium< T, ConfusedMovementGenerator > +class ConfusedMovementGenerator : public MovementGeneratorMedium< T, ConfusedMovementGenerator > { public: explicit ConfusedMovementGenerator() : i_nextMoveTime(0) {} diff --git a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp index 216afbb2b20..08e27abf050 100755 --- a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp @@ -28,8 +28,7 @@ #define MAX_QUIET_DISTANCE 43.0f template -void -FleeingMovementGenerator::_setTargetLocation(T &owner) +void FleeingMovementGenerator::_setTargetLocation(T &owner) { if (!&owner) return; @@ -53,8 +52,7 @@ FleeingMovementGenerator::_setTargetLocation(T &owner) } template -bool -FleeingMovementGenerator::_getPoint(T &owner, float &x, float &y, float &z) +bool FleeingMovementGenerator::_getPoint(T &owner, float &x, float &y, float &z) { if (!&owner) return false; @@ -65,8 +63,8 @@ FleeingMovementGenerator::_getPoint(T &owner, float &x, float &y, float &z) float temp_x, temp_y, angle; const Map* _map = owner.GetBaseMap(); - //primitive path-finding - for(uint8 i = 0; i < 18; ++i) + // primitive path-finding + for (uint8 i = 0; i < 18; ++i) { if (i_only_forward && i > 2) break; @@ -182,13 +180,12 @@ FleeingMovementGenerator::_getPoint(T &owner, float &x, float &y, float &z) } } i_to_distance_from_caster = 0.0f; - i_nextCheckTime.Reset( urand(500,1000) ); + i_nextCheckTime.Reset(urand(500,1000)); return false; } template -bool -FleeingMovementGenerator::_setMoveData(T &owner) +bool FleeingMovementGenerator::_setMoveData(T &owner) { float cur_dist_xyz = owner.GetDistance(i_caster_x, i_caster_y, i_caster_z); @@ -201,12 +198,12 @@ FleeingMovementGenerator::_setMoveData(T &owner) (i_last_distance_from_caster < i_to_distance_from_caster && cur_dist_xyz > i_to_distance_from_caster) || // if we reach bigger distance (cur_dist_xyz > MAX_QUIET_DISTANCE) || // if we are too far - (i_last_distance_from_caster > MIN_QUIET_DISTANCE && cur_dist_xyz < MIN_QUIET_DISTANCE) ) + (i_last_distance_from_caster > MIN_QUIET_DISTANCE && cur_dist_xyz < MIN_QUIET_DISTANCE)) // if we leave 'quiet zone' { // we are very far or too close, stopping i_to_distance_from_caster = 0.0f; - i_nextCheckTime.Reset( urand(500,1000) ); + i_nextCheckTime.Reset(urand(500,1000)); return false; } else @@ -280,8 +277,7 @@ FleeingMovementGenerator::_setMoveData(T &owner) } template -void -FleeingMovementGenerator::Initialize(T &owner) +void FleeingMovementGenerator::Initialize(T &owner) { if (!&owner) return; @@ -312,8 +308,7 @@ FleeingMovementGenerator::Initialize(T &owner) } template<> -void -FleeingMovementGenerator::_Init(Creature &owner) +void FleeingMovementGenerator::_Init(Creature &owner) { if (!&owner) return; @@ -324,8 +319,7 @@ FleeingMovementGenerator::_Init(Creature &owner) } template<> -void -FleeingMovementGenerator::_Init(Player &) +void FleeingMovementGenerator::_Init(Player &) { is_water_ok = true; is_land_ok = true; @@ -354,8 +348,7 @@ void FleeingMovementGenerator::Reset(T &owner) } template -bool -FleeingMovementGenerator::Update(T &owner, const uint32 &time_diff) +bool FleeingMovementGenerator::Update(T &owner, const uint32 &time_diff) { if (!&owner || !owner.isAlive()) return false; @@ -399,7 +392,7 @@ void TimedFleeingMovementGenerator::Finalize(Unit &owner) } } -bool TimedFleeingMovementGenerator::Update(Unit & owner, const uint32 time_diff) +bool TimedFleeingMovementGenerator::Update(Unit & owner, const uint32& time_diff) { if (!owner.isAlive()) return false; diff --git a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.h b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.h index 750db52bb5a..aec93ad3375 100755 --- a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.h @@ -22,8 +22,7 @@ #include "MovementGenerator.h" template -class FleeingMovementGenerator -: public MovementGeneratorMedium< T, FleeingMovementGenerator > +class FleeingMovementGenerator : public MovementGeneratorMedium< T, FleeingMovementGenerator > { public: FleeingMovementGenerator(uint64 fright) : i_frightGUID(fright), i_nextCheckTime(0) {} @@ -55,8 +54,7 @@ class FleeingMovementGenerator TimeTracker i_nextCheckTime; }; -class TimedFleeingMovementGenerator -: public FleeingMovementGenerator +class TimedFleeingMovementGenerator : public FleeingMovementGenerator { public: TimedFleeingMovementGenerator(uint64 fright, uint32 time) : @@ -64,7 +62,7 @@ class TimedFleeingMovementGenerator i_totalFleeTime(time) {} MovementGeneratorType GetMovementGeneratorType() { return TIMED_FLEEING_MOTION_TYPE; } - bool Update(Unit &, const uint32); + bool Update(Unit &, const uint32&); void Finalize(Unit &); private: diff --git a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp index 5725aec54f6..a8bdb698432 100755 --- a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp @@ -25,7 +25,6 @@ void HomeMovementGenerator::Initialize(Creature & owner) { - owner.AddUnitState(UNIT_STATE_EVADE); _setTargetLocation(owner); } @@ -35,9 +34,6 @@ void HomeMovementGenerator::Reset(Creature &) void HomeMovementGenerator::_setTargetLocation(Creature & owner) { - if (!&owner) - return; - if (owner.HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED | UNIT_STATE_DISTRACTED)) return; diff --git a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.h b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.h index c724edc91ff..95eb05f281c 100755 --- a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.h @@ -27,8 +27,7 @@ template < class T > class HomeMovementGenerator; template <> -class HomeMovementGenerator -: public MovementGeneratorMedium< Creature, HomeMovementGenerator > +class HomeMovementGenerator : public MovementGeneratorMedium< Creature, HomeMovementGenerator > { public: diff --git a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp index 36561e00b93..5a2090cfe28 100755 --- a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp @@ -29,16 +29,15 @@ void IdleMovementGenerator::Initialize(Unit &owner) Reset(owner); } -void -IdleMovementGenerator::Reset(Unit& owner) +void IdleMovementGenerator::Reset(Unit& owner) { - if (owner.HasUnitState(UNIT_STATE_MOVE)) + if (!owner.IsStopped()) owner.StopMoving(); } void RotateMovementGenerator::Initialize(Unit& owner) { - if (owner.HasUnitState(UNIT_STATE_MOVE)) + if (!owner.IsStopped()) owner.StopMoving(); if (owner.getVictim()) @@ -49,7 +48,7 @@ void RotateMovementGenerator::Initialize(Unit& owner) owner.AttackStop(); } -bool RotateMovementGenerator::Update(Unit& owner, const uint32 diff) +bool RotateMovementGenerator::Update(Unit& owner, const uint32& diff) { float angle = owner.GetOrientation(); if (m_direction == ROTATE_DIRECTION_LEFT) @@ -80,20 +79,17 @@ void RotateMovementGenerator::Finalize(Unit &unit) unit.ToCreature()->AI()->MovementInform(ROTATE_MOTION_TYPE, 0); } -void -DistractMovementGenerator::Initialize(Unit& owner) +void DistractMovementGenerator::Initialize(Unit& owner) { owner.AddUnitState(UNIT_STATE_DISTRACTED); } -void -DistractMovementGenerator::Finalize(Unit& owner) +void DistractMovementGenerator::Finalize(Unit& owner) { owner.ClearUnitState(UNIT_STATE_DISTRACTED); } -bool -DistractMovementGenerator::Update(Unit& /*owner*/, const uint32 time_diff) +bool DistractMovementGenerator::Update(Unit& /*owner*/, const uint32& time_diff) { if (time_diff > m_timer) return false; @@ -102,8 +98,7 @@ DistractMovementGenerator::Update(Unit& /*owner*/, const uint32 time_diff) return true; } -void -AssistanceDistractMovementGenerator::Finalize(Unit &unit) +void AssistanceDistractMovementGenerator::Finalize(Unit &unit) { unit.ClearUnitState(UNIT_STATE_DISTRACTED); unit.ToCreature()->SetReactState(REACT_AGGRESSIVE); diff --git a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.h b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.h index 8180a86c49b..7acec82af98 100755 --- a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.h @@ -28,7 +28,7 @@ class IdleMovementGenerator : public MovementGenerator void Initialize(Unit &); void Finalize(Unit &) { } void Reset(Unit &); - bool Update(Unit &, const uint32) { return true; } + bool Update(Unit &, const uint32&) { return true; } MovementGeneratorType GetMovementGeneratorType() { return IDLE_MOTION_TYPE; } }; @@ -42,7 +42,7 @@ class RotateMovementGenerator : public MovementGenerator void Initialize(Unit& owner); void Finalize(Unit& owner); void Reset(Unit& owner) { Initialize(owner); } - bool Update(Unit& owner, const uint32 time_diff); + bool Update(Unit& owner, const uint32& time_diff); MovementGeneratorType GetMovementGeneratorType() { return ROTATE_MOTION_TYPE; } private: @@ -58,7 +58,7 @@ class DistractMovementGenerator : public MovementGenerator void Initialize(Unit& owner); void Finalize(Unit& owner); void Reset(Unit& owner) { Initialize(owner); } - bool Update(Unit& owner, const uint32 time_diff); + bool Update(Unit& owner, const uint32& time_diff); MovementGeneratorType GetMovementGeneratorType() { return DISTRACT_MOTION_TYPE; } private: diff --git a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp index c565e150740..a922c937b5f 100755 --- a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp @@ -46,7 +46,7 @@ bool PointMovementGenerator::Update(T &unit, const uint32 & /*diff*/) if (!&unit) return false; - if(unit.HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED)) + if (unit.HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED)) { unit.ClearUnitState(UNIT_STATE_ROAMING_MOVE); return true; @@ -57,7 +57,7 @@ bool PointMovementGenerator::Update(T &unit, const uint32 & /*diff*/) } template -void PointMovementGenerator:: Finalize(T &unit) +void PointMovementGenerator::Finalize(T &unit) { unit.ClearUnitState(UNIT_STATE_ROAMING|UNIT_STATE_ROAMING_MOVE); @@ -107,7 +107,7 @@ void AssistanceMovementGenerator::Finalize(Unit &unit) unit.GetMotionMaster()->MoveSeekAssistanceDistract(sWorld->getIntConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_DELAY)); } -bool EffectMovementGenerator::Update(Unit &unit, const uint32) +bool EffectMovementGenerator::Update(Unit &unit, const uint32&) { return !unit.movespline->Finalized(); } @@ -117,7 +117,7 @@ void EffectMovementGenerator::Finalize(Unit &unit) if (unit.GetTypeId() != TYPEID_UNIT) return; - if (((Creature&)unit).AI() && unit.movespline->Finalized()) + if (((Creature&)unit).AI()) ((Creature&)unit).AI()->MovementInform(EFFECT_MOTION_TYPE, m_Id); // Need restore previous movement since we have no proper states system //if (unit.isAlive() && !unit.HasUnitState(UNIT_STATE_CONFUSED|UNIT_STATE_FLEEING)) diff --git a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h index e47f3d93450..13be9fee77b 100755 --- a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h @@ -23,8 +23,7 @@ #include "FollowerReference.h" template -class PointMovementGenerator -: public MovementGeneratorMedium< T, PointMovementGenerator > +class PointMovementGenerator : public MovementGeneratorMedium< T, PointMovementGenerator > { public: PointMovementGenerator(uint32 _id, float _x, float _y, float _z, float _speed = 0.0f) : id(_id), @@ -46,8 +45,7 @@ class PointMovementGenerator float speed; }; -class AssistanceMovementGenerator -: public PointMovementGenerator +class AssistanceMovementGenerator : public PointMovementGenerator { public: AssistanceMovementGenerator(float _x, float _y, float _z) : @@ -65,7 +63,7 @@ class EffectMovementGenerator : public MovementGenerator void Initialize(Unit &) {} void Finalize(Unit &unit); void Reset(Unit &) {} - bool Update(Unit &u, const uint32); + bool Update(Unit &u, const uint32&); MovementGeneratorType GetMovementGeneratorType() { return EFFECT_MOTION_TYPE; } private: uint32 m_Id; diff --git a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp index b65fa210723..84cd9e88295 100755 --- a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp @@ -42,7 +42,7 @@ void RandomMovementGenerator::_setRandomLocation(Creature& creature) // For 2D/3D system selection //bool is_land_ok = creature.CanWalk(); // not used? //bool is_water_ok = creature.CanSwim(); // not used? - bool is_air_ok = creature.canFly(); + bool is_air_ok = creature.CanFly(); const float angle = float(rand_norm()) * static_cast(M_PI*2.0f); const float range = float(rand_norm()) * wander_distance; @@ -127,8 +127,7 @@ void RandomMovementGenerator::Initialize(Creature &creature) } template<> -void -RandomMovementGenerator::Reset(Creature &creature) +void RandomMovementGenerator::Reset(Creature &creature) { Initialize(creature); } @@ -141,8 +140,7 @@ void RandomMovementGenerator::Finalize(Creature &creature) } template<> -bool -RandomMovementGenerator::Update(Creature &creature, const uint32 diff) +bool RandomMovementGenerator::Update(Creature &creature, const uint32 diff) { if (creature.HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED | UNIT_STATE_DISTRACTED)) { diff --git a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h index 67161b6fc29..07ec3647052 100755 --- a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h @@ -22,8 +22,7 @@ #include "MovementGenerator.h" template -class RandomMovementGenerator -: public MovementGeneratorMedium< T, RandomMovementGenerator > +class RandomMovementGenerator : public MovementGeneratorMedium< T, RandomMovementGenerator > { public: RandomMovementGenerator(float spawn_dist = 0.0f) : i_nextMoveTime(0), wander_distance(spawn_dist) {} diff --git a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp index 064a8fc8297..fdff5a92564 100755 --- a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp @@ -40,12 +40,12 @@ void TargetedMovementGeneratorMedium::_setTargetLocation(T &owner) float x, y, z; //! Following block of code deleted by MrSmite in issue 4891 //! Code kept for learning and diagnostical purposes -// +// // if (i_offset && i_target->IsWithinDistInMap(&owner,2*i_offset)) // { // if (!owner.movespline->Finalized()) // return; -// +// // owner.GetPosition(x, y, z); // } // else @@ -78,7 +78,7 @@ void TargetedMovementGeneratorMedium::_setTargetLocation(T &owner) //We don't update Mob Movement, if the difference between New destination and last destination is < BothObjectSize float bothObjectSize = i_target->GetObjectBoundingRadius() + owner.GetObjectBoundingRadius() + CONTACT_DISTANCE; - if( i_destinationHolder.HasDestination() && i_destinationHolder.GetDestinationDiff(x,y,z) < bothObjectSize ) + if ( i_destinationHolder.HasDestination() && i_destinationHolder.GetDestinationDiff(x,y,z) < bothObjectSize ) return; */ @@ -135,7 +135,7 @@ bool TargetedMovementGeneratorMedium::Update(T &owner, const uint32 & time_ } // prevent movement while casting spells with cast time or channel time - if (owner.IsNonMeleeSpellCasted(false, false, true)) + if (owner.HasUnitState(UNIT_STATE_CASTING)) { if (!owner.IsStopped()) owner.StopMoving(); diff --git a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h index b851dbc0e05..29fd73624e1 100755 --- a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h @@ -34,8 +34,7 @@ class TargetedMovementGeneratorBase }; template -class TargetedMovementGeneratorMedium -: public MovementGeneratorMedium< T, D >, public TargetedMovementGeneratorBase +class TargetedMovementGeneratorMedium : public MovementGeneratorMedium< T, D >, public TargetedMovementGeneratorBase { protected: TargetedMovementGeneratorMedium(Unit &target, float offset, float angle) : diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp index fb2249c508e..25730f92161 100755 --- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp @@ -79,7 +79,7 @@ void WaypointMovementGenerator::OnArrived(Creature& creature) if (i_path->at(i_currentNode)->event_id && urand(0, 99) < i_path->at(i_currentNode)->event_chance) { sLog->outDebug(LOG_FILTER_MAPSCRIPTS, "Creature movement start script %u at point %u for "UI64FMTD".", i_path->at(i_currentNode)->event_id, i_currentNode, creature.GetGUID()); - creature.GetMap()->ScriptsStart(sWaypointScripts, i_path->at(i_currentNode)->event_id, &creature, NULL/*, false*/); + creature.GetMap()->ScriptsStart(sWaypointScripts, i_path->at(i_currentNode)->event_id, &creature, NULL); } // Inform script @@ -107,7 +107,7 @@ bool WaypointMovementGenerator::StartMove(Creature &creature) i_currentNode = (i_currentNode+1) % i_path->size(); } - const WaypointData *node = i_path->at(i_currentNode); + WaypointData const* node = i_path->at(i_currentNode); m_isArrivalDone = false; @@ -116,7 +116,8 @@ bool WaypointMovementGenerator::StartMove(Creature &creature) Movement::MoveSplineInit init(creature); init.MoveTo(node->x, node->y, node->z); - if (node->orientation != 100 && node->delay != 0) + //! Accepts angles such as 0.00001 and -0.00001, 0 must be ignored, default value in waypoint table + if (node->orientation && node->delay) init.SetFacing(node->orientation); init.SetWalk(!node->run); @@ -231,7 +232,7 @@ void FlightPathMovementGenerator::Reset(Player & player) uint32 end = GetPathAtMapEnd(); for (uint32 i = GetCurrentNode(); i != end; ++i) { - G3D::Vector3 vertice((*i_path)[i].x,(*i_path)[i].y,(*i_path)[i].z); + G3D::Vector3 vertice((*i_path)[i].x, (*i_path)[i].y, (*i_path)[i].z); init.Path().push_back(vertice); } init.SetFirstPointId(GetCurrentNode()); @@ -240,7 +241,7 @@ void FlightPathMovementGenerator::Reset(Player & player) init.Launch(); } -bool FlightPathMovementGenerator::Update(Player &player, const uint32 /*diff*/) +bool FlightPathMovementGenerator::Update(Player &player, const uint32& /*diff*/) { uint32 pointId = (uint32)player.movespline->currentPathIdx(); if (pointId > i_currentNode) diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h index 9c2475267f6..0d8f047c83a 100755 --- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h @@ -58,9 +58,8 @@ template class WaypointMovementGenerator; template<> -class WaypointMovementGenerator -: public MovementGeneratorMedium< Creature, WaypointMovementGenerator >, -public PathMovementBase +class WaypointMovementGenerator : public MovementGeneratorMedium< Creature, WaypointMovementGenerator >, + public PathMovementBase { public: WaypointMovementGenerator(uint32 _path_id = 0, bool _repeating = true) @@ -110,9 +109,8 @@ public PathMovementBase /** FlightPathMovementGenerator generates movement of the player for the paths * and hence generates ground and activities for the player. */ -class FlightPathMovementGenerator -: public MovementGeneratorMedium< Player, FlightPathMovementGenerator >, -public PathMovementBase +class FlightPathMovementGenerator : public MovementGeneratorMedium< Player, FlightPathMovementGenerator >, + public PathMovementBase { public: explicit FlightPathMovementGenerator(TaxiPathNodeList const& pathnodes, uint32 startNode = 0) @@ -123,7 +121,7 @@ public PathMovementBase void Initialize(Player &); void Reset(Player &); void Finalize(Player &); - bool Update(Player &, const uint32); + bool Update(Player &, const uint32&); MovementGeneratorType GetMovementGeneratorType() { return FLIGHT_MOTION_TYPE; } TaxiPathNodeList const& GetPath() { return *i_path; } diff --git a/src/server/game/Movement/Spline/MoveSpline.cpp b/src/server/game/Movement/Spline/MoveSpline.cpp index 5d0344f9769..91b4ff08250 100644 --- a/src/server/game/Movement/Spline/MoveSpline.cpp +++ b/src/server/game/Movement/Spline/MoveSpline.cpp @@ -288,7 +288,7 @@ std::string MoveSpline::ToString() const str << "facing angle: " << facing.angle; else if (splineflags.final_target) str << "facing target: " << facing.target; - else if(splineflags.final_point) + else if (splineflags.final_point) str << "facing point: " << facing.f.x << " " << facing.f.y << " " << facing.f.z; str << std::endl; str << "time passed: " << time_passed << std::endl; diff --git a/src/server/game/Movement/Spline/MoveSplineInit.cpp b/src/server/game/Movement/Spline/MoveSplineInit.cpp index b5ae923dc32..e586cb4f4f9 100644 --- a/src/server/game/Movement/Spline/MoveSplineInit.cpp +++ b/src/server/game/Movement/Spline/MoveSplineInit.cpp @@ -25,9 +25,13 @@ namespace Movement { UnitMoveType SelectSpeedType(uint32 moveFlags) { - if (moveFlags & MOVEMENTFLAG_FLYING) + /*! Not sure about MOVEMENTFLAG_CAN_FLY here - do creatures that can fly + but are on ground right now also have it? If yes, this needs a more + dynamic check, such as is flying now + */ + if (moveFlags & (MOVEMENTFLAG_FLYING | MOVEMENTFLAG_CAN_FLY | MOVEMENTFLAG_DISABLE_GRAVITY)) { - if ( moveFlags & MOVEMENTFLAG_BACKWARD /*&& speed_obj.flight >= speed_obj.flight_back*/ ) + if (moveFlags & MOVEMENTFLAG_BACKWARD /*&& speed_obj.flight >= speed_obj.flight_back*/) return MOVE_FLIGHT_BACK; else return MOVE_FLIGHT; @@ -41,7 +45,7 @@ namespace Movement } else if (moveFlags & MOVEMENTFLAG_WALKING) { - //if ( speed_obj.run > speed_obj.walk ) + //if (speed_obj.run > speed_obj.walk) return MOVE_WALK; } else if (moveFlags & MOVEMENTFLAG_BACKWARD /*&& speed_obj.run >= speed_obj.run_back*/) @@ -54,7 +58,7 @@ namespace Movement { MoveSpline& move_spline = *unit.movespline; - Location real_position(unit.GetPositionX(),unit.GetPositionY(),unit.GetPositionZ(),unit.GetOrientation()); + Location real_position(unit.GetPositionX(),unit.GetPositionY(),unit.GetPositionZMinusOffset(),unit.GetOrientation()); // there is a big chane that current position is unknown if current state is not finalized, need compute it // this also allows calculate spline position and update map position in much greater intervals if (!move_spline.Finalized()) @@ -100,7 +104,7 @@ namespace Movement { // mix existing state into new args.flags.walkmode = unit.m_movementInfo.HasMovementFlag(MOVEMENTFLAG_WALKING); - args.flags.flying = unit.m_movementInfo.HasMovementFlag((MovementFlags)(MOVEMENTFLAG_FLYING|MOVEMENTFLAG_LEVITATING)); + args.flags.flying = unit.m_movementInfo.HasMovementFlag((MovementFlags)(MOVEMENTFLAG_CAN_FLY|MOVEMENTFLAG_DISABLE_GRAVITY)); } void MoveSplineInit::SetFacing(const Unit * target) diff --git a/src/server/game/Movement/Spline/MovementPacketBuilder.cpp b/src/server/game/Movement/Spline/MovementPacketBuilder.cpp index 73fdbf4c2f6..0260767dbe2 100644 --- a/src/server/game/Movement/Spline/MovementPacketBuilder.cpp +++ b/src/server/game/Movement/Spline/MovementPacketBuilder.cpp @@ -44,11 +44,17 @@ namespace Movement void PacketBuilder::WriteCommonMonsterMovePart(const MoveSpline& move_spline, WorldPacket& data) { MoveSplineFlag splineflags = move_spline.splineflags; - /*if (mov.IsBoarded()) + /*if (unit->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT)) { data.SetOpcode(SMSG_MONSTER_MOVE_TRANSPORT); - data << mov.GetTransport()->Owner.GetPackGUID(); - data << int8(mov.m_unused.transport_seat); + if (unit->GetVehicle()) + data << unit->GetVehicle()->GetBase()->GetPackGUID(); + else if (unit->GetTransport()) + data << unit->GetTransport()->GetPackGUID(); + else + data << uint64(0); + + data << int8(unit->GetTransSeat()); }*/ data << uint8(0); @@ -57,21 +63,21 @@ namespace Movement switch(splineflags & MoveSplineFlag::Mask_Final_Facing) { - default: - data << uint8(MonsterMoveNormal); - break; - case MoveSplineFlag::Final_Target: - data << uint8(MonsterMoveFacingTarget); - data << move_spline.facing.target; - break; - case MoveSplineFlag::Final_Angle: - data << uint8(MonsterMoveFacingAngle); - data << move_spline.facing.angle; - break; - case MoveSplineFlag::Final_Point: - data << uint8(MonsterMoveFacingSpot); - data << move_spline.facing.f.x << move_spline.facing.f.y << move_spline.facing.f.z; - break; + case MoveSplineFlag::Final_Target: + data << uint8(MonsterMoveFacingTarget); + data << move_spline.facing.target; + break; + case MoveSplineFlag::Final_Angle: + data << uint8(MonsterMoveFacingAngle); + data << move_spline.facing.angle; + break; + case MoveSplineFlag::Final_Point: + data << uint8(MonsterMoveFacingSpot); + data << move_spline.facing.f.x << move_spline.facing.f.y << move_spline.facing.f.z; + break; + default: + data << uint8(MonsterMoveNormal); + break; } // add fake Enter_Cycle flag - needed for client-side cyclic movement (client will erase first spline vertex after first cycle done) @@ -105,7 +111,7 @@ namespace Movement Vector3 middle = (real_path[0] + real_path[last_idx]) / 2.f; Vector3 offset; // first and last points already appended - for(uint32 i = 1; i < last_idx; ++i) + for (uint32 i = 1; i < last_idx; ++i) { offset = middle - real_path[i]; data.appendPackXYZ(offset.x, offset.y, offset.z); @@ -163,7 +169,7 @@ namespace Movement { data << move_spline.facing.target; } - else if(splineFlags.final_point) + else if (splineFlags.final_point) { data << move_spline.facing.f.x << move_spline.facing.f.y << move_spline.facing.f.z; } diff --git a/src/server/game/Movement/Waypoints/WaypointManager.cpp b/src/server/game/Movement/Waypoints/WaypointManager.cpp index b957674151b..296c9eee50f 100755 --- a/src/server/game/Movement/Waypoints/WaypointManager.cpp +++ b/src/server/game/Movement/Waypoints/WaypointManager.cpp @@ -43,6 +43,7 @@ void WaypointMgr::Load() { uint32 oldMSTime = getMSTime(); + // 0 1 2 3 4 5 6 7 8 9 QueryResult result = WorldDatabase.Query("SELECT id, point, position_x, position_y, position_z, orientation, move_flag, delay, action, action_chance FROM waypoint_data ORDER BY id, point"); if (!result) @@ -78,7 +79,7 @@ void WaypointMgr::Load() wp->run = fields[6].GetBool(); wp->delay = fields[7].GetUInt32(); wp->event_id = fields[8].GetUInt32(); - wp->event_chance = fields[9].GetUInt8(); + wp->event_chance = fields[9].GetInt16(); path.push_back(wp); ++count; @@ -100,7 +101,12 @@ void WaypointMgr::ReloadPath(uint32 id) _waypointStore.erase(itr); } - QueryResult result = WorldDatabase.PQuery("SELECT point, position_x, position_y, position_z, orientation, move_flag, delay, action, action_chance FROM waypoint_data WHERE id = %u ORDER BY point", id); + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_DATA_BY_ID); + + stmt->setUInt32(0, id); + + PreparedQueryResult result = WorldDatabase.Query(stmt); + if (!result) return; diff --git a/src/server/game/OutdoorPvP/OutdoorPvP.cpp b/src/server/game/OutdoorPvP/OutdoorPvP.cpp index 9f6ec547342..465fca75030 100755 --- a/src/server/game/OutdoorPvP/OutdoorPvP.cpp +++ b/src/server/game/OutdoorPvP/OutdoorPvP.cpp @@ -436,20 +436,20 @@ void OutdoorPvP::HandleKill(Player* killer, Unit* killed) { for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) { - Player* pGroupGuy = itr->getSource(); + Player* groupGuy = itr->getSource(); - if (!pGroupGuy) + if (!groupGuy) continue; // skip if too far away - if (!pGroupGuy->IsAtGroupRewardDistance(killed)) + if (!groupGuy->IsAtGroupRewardDistance(killed)) continue; // creature kills must be notified, even if not inside objective / not outdoor pvp active // player kills only count if active and inside objective - if ((pGroupGuy->IsOutdoorPvPActive() && IsInsideObjective(pGroupGuy)) || killed->GetTypeId() == TYPEID_UNIT) + if ((groupGuy->IsOutdoorPvPActive() && IsInsideObjective(groupGuy)) || killed->GetTypeId() == TYPEID_UNIT) { - HandleKillImpl(pGroupGuy, killed); + HandleKillImpl(groupGuy, killed); } } } diff --git a/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp b/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp index 88e6db971f0..a079d2f643b 100755 --- a/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp +++ b/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp @@ -27,7 +27,7 @@ OutdoorPvPMgr::OutdoorPvPMgr() //sLog->outDebug(LOG_FILTER_OUTDOORPVP, "Instantiating OutdoorPvPMgr"); } -OutdoorPvPMgr::~OutdoorPvPMgr() +void OutdoorPvPMgr::Die() { //sLog->outDebug(LOG_FILTER_OUTDOORPVP, "Deleting OutdoorPvPMgr"); for (OutdoorPvPSet::iterator itr = m_OutdoorPvPSet.begin(); itr != m_OutdoorPvPSet.end(); ++itr) @@ -41,7 +41,7 @@ void OutdoorPvPMgr::InitOutdoorPvP() { uint32 oldMSTime = getMSTime(); - // 0 1 + // 0 1 QueryResult result = WorldDatabase.Query("SELECT TypeId, ScriptName FROM outdoorpvp_template"); if (!result) @@ -58,7 +58,7 @@ void OutdoorPvPMgr::InitOutdoorPvP() { Field* fields = result->Fetch(); - typeId = fields[0].GetUInt32(); + typeId = fields[0].GetUInt8(); if (DisableMgr::IsDisabledFor(DISABLE_TYPE_OUTDOORPVP, typeId, NULL)) continue; diff --git a/src/server/game/OutdoorPvP/OutdoorPvPMgr.h b/src/server/game/OutdoorPvP/OutdoorPvPMgr.h index 3a66a87ecba..1313e29bfb4 100755 --- a/src/server/game/OutdoorPvP/OutdoorPvPMgr.h +++ b/src/server/game/OutdoorPvP/OutdoorPvPMgr.h @@ -42,12 +42,15 @@ class OutdoorPvPMgr private: OutdoorPvPMgr(); - ~OutdoorPvPMgr(); + ~OutdoorPvPMgr() {}; public: // create outdoor pvp events void InitOutdoorPvP(); + // cleanup + void Die(); + // called when a player enters an outdoor pvp area void HandlePlayerEnterZone(Player* player, uint32 areaflag); diff --git a/src/server/game/Pools/PoolMgr.cpp b/src/server/game/Pools/PoolMgr.cpp index 05ce7a0a50d..d8548b552d3 100755 --- a/src/server/game/Pools/PoolMgr.cpp +++ b/src/server/game/Pools/PoolMgr.cpp @@ -440,7 +440,12 @@ void PoolGroup::SpawnObject(ActivePoolData& spawns, uint32 limit, uint32 // load state from db if (!triggerFrom) { - QueryResult result = CharacterDatabase.PQuery("SELECT quest_id FROM pool_quest_save WHERE pool_id = %u", poolId); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_POOL_QUEST_SAVE); + + stmt->setUInt32(0, poolId); + + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (result) { do @@ -474,7 +479,7 @@ void PoolGroup::SpawnObject(ActivePoolData& spawns, uint32 limit, uint32 { do { - uint32 questId = SelectRandomContainerElement(currentQuests); + uint32 questId = Trinity::Containers::SelectRandomContainerElement(currentQuests); newQuests.insert(questId); currentQuests.erase(questId); } while (newQuests.size() < limit && !currentQuests.empty()); // failsafe @@ -486,7 +491,7 @@ void PoolGroup::SpawnObject(ActivePoolData& spawns, uint32 limit, uint32 // activate random quests do { - uint32 questId = SelectRandomContainerElement(newQuests); + uint32 questId = Trinity::Containers::SelectRandomContainerElement(newQuests); spawns.ActivateObject(questId, poolId); PoolObject tempObj(questId, 0.0f); Spawn1Object(&tempObj); @@ -595,7 +600,7 @@ void PoolMgr::LoadFromDB() { uint32 oldMSTime = getMSTime(); - // 1 2 3 + // 1 2 3 QueryResult result = WorldDatabase.Query("SELECT guid, pool_entry, chance FROM pool_creature"); if (!result) diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index abd8ebbb302..31c05c2723e 100755 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -23,31 +23,31 @@ Quest::Quest(Field* questRecord) { Id = questRecord[0].GetUInt32(); - Method = questRecord[1].GetUInt32(); - Level = questRecord[2].GetInt32(); - MinLevel = questRecord[3].GetUInt32(); - MaxLevel = questRecord[4].GetUInt32(); - ZoneOrSort = questRecord[5].GetInt32(); - Type = questRecord[6].GetUInt32(); - SuggestedPlayers = questRecord[7].GetUInt32(); + Method = questRecord[1].GetUInt8(); + Level = questRecord[2].GetInt16(); + MinLevel = questRecord[3].GetUInt8(); + MaxLevel = questRecord[4].GetUInt8(); + ZoneOrSort = questRecord[5].GetInt16(); + Type = questRecord[6].GetUInt16(); + SuggestedPlayers = questRecord[7].GetUInt8(); LimitTime = questRecord[8].GetUInt32(); - RequiredClasses = questRecord[9].GetUInt32(); - RequiredRaces = questRecord[10].GetUInt32(); - RequiredSkillId = questRecord[11].GetUInt32(); - RequiredSkillPoints = questRecord[12].GetUInt32(); - RequiredFactionId1 = questRecord[13].GetUInt32(); - RequiredFactionId2 = questRecord[14].GetUInt32(); + RequiredClasses = questRecord[9].GetUInt16(); + RequiredRaces = questRecord[10].GetUInt16(); + RequiredSkillId = questRecord[11].GetUInt16(); + RequiredSkillPoints = questRecord[12].GetUInt16(); + RequiredFactionId1 = questRecord[13].GetUInt16(); + RequiredFactionId2 = questRecord[14].GetUInt16(); RequiredFactionValue1 = questRecord[15].GetInt32(); RequiredFactionValue2 = questRecord[16].GetInt32(); - RequiredMinRepFaction = questRecord[17].GetUInt32(); - RequiredMaxRepFaction = questRecord[18].GetUInt32(); + RequiredMinRepFaction = questRecord[17].GetUInt16(); + RequiredMaxRepFaction = questRecord[18].GetUInt16(); RequiredMinRepValue = questRecord[19].GetInt32(); RequiredMaxRepValue = questRecord[20].GetInt32(); PrevQuestId = questRecord[21].GetInt32(); NextQuestId = questRecord[22].GetInt32(); ExclusiveGroup = questRecord[23].GetInt32(); NextQuestIdChain = questRecord[24].GetUInt32(); - RewardXPId = questRecord[25].GetUInt32(); + RewardXPId = questRecord[25].GetUInt8(); RewardOrRequiredMoney = questRecord[26].GetInt32(); RewardMoneyMaxLevel = questRecord[27].GetUInt32(); RewardSpell = questRecord[28].GetUInt32(); @@ -57,15 +57,15 @@ Quest::Quest(Field* questRecord) RewardMailTemplateId = questRecord[32].GetUInt32(); RewardMailDelay = questRecord[33].GetUInt32(); SourceItemId = questRecord[34].GetUInt32(); - SourceItemIdCount = questRecord[35].GetUInt32(); + SourceItemIdCount = questRecord[35].GetUInt8(); SourceSpellid = questRecord[36].GetUInt32(); Flags = questRecord[37].GetUInt32(); - uint32 SpecialFlags = questRecord[38].GetUInt16(); + uint32 SpecialFlags = questRecord[38].GetUInt8(); MinimapTargetMark = questRecord[39].GetUInt32(); - RewardTitleId = questRecord[40].GetUInt32(); - RequiredPlayerKills = questRecord[41].GetUInt32(); - RewardTalents = questRecord[42].GetUInt32(); - RewardArenaPoints = questRecord[43].GetInt32(); + RewardTitleId = questRecord[40].GetUInt8(); + RequiredPlayerKills = questRecord[41].GetUInt8(); + RewardTalents = questRecord[42].GetUInt8(); + RewardArenaPoints = questRecord[43].GetUInt16(); RewardSkillId = questRecord[44].GetUInt32(); RewardSkillPoints = questRecord[45].GetUInt32(); RewardReputationMask = questRecord[46].GetUInt32(); @@ -76,16 +76,16 @@ Quest::Quest(Field* questRecord) RewardItemId[i] = questRecord[49+i].GetUInt32(); for (int i = 0; i < QUEST_REWARDS_COUNT; ++i) - RewardItemIdCount[i] = questRecord[53+i].GetUInt32(); + RewardItemIdCount[i] = questRecord[53+i].GetUInt16(); for (int i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) RewardChoiceItemId[i] = questRecord[57+i].GetUInt32(); for (int i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) - RewardChoiceItemCount[i] = questRecord[63+i].GetUInt32(); + RewardChoiceItemCount[i] = questRecord[63+i].GetUInt16(); for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) - RewardFactionId[i] = questRecord[69+i].GetUInt32(); + RewardFactionId[i] = questRecord[69+i].GetUInt16(); for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) RewardFactionValueId[i] = questRecord[74+i].GetInt32(); @@ -93,7 +93,7 @@ Quest::Quest(Field* questRecord) for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) RewardFactionValueIdOverride[i] = questRecord[79+i].GetInt32(); - PointMapId = questRecord[84].GetUInt32(); + PointMapId = questRecord[84].GetUInt16(); PointX = questRecord[85].GetFloat(); PointY = questRecord[86].GetFloat(); PointOption = questRecord[87].GetUInt32(); @@ -109,19 +109,19 @@ Quest::Quest(Field* questRecord) RequiredNpcOrGo[i] = questRecord[95+i].GetInt32(); for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) - RequiredNpcOrGoCount[i] = questRecord[99+i].GetUInt32(); + RequiredNpcOrGoCount[i] = questRecord[99+i].GetUInt16(); for (int i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i) RequiredSourceItemId[i] = questRecord[103+i].GetUInt32(); for (int i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i) - RequiredSourceItemCount[i] = questRecord[107+i].GetUInt32(); + RequiredSourceItemCount[i] = questRecord[107+i].GetUInt16(); for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) RequiredItemId[i] = questRecord[111+i].GetUInt32(); for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) - RequiredItemCount[i] = questRecord[117+i].GetUInt32(); + RequiredItemCount[i] = questRecord[117+i].GetUInt16(); RequiredSpell = questRecord[123].GetUInt32(); @@ -151,16 +151,16 @@ Quest::Quest(Field* questRecord) SoundTurnIn = questRecord[153].GetUInt32(); for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) - DetailsEmote[i] = questRecord[154+i].GetUInt32(); + DetailsEmote[i] = questRecord[154+i].GetUInt16(); for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) DetailsEmoteDelay[i] = questRecord[158+i].GetUInt32(); - EmoteOnIncomplete = questRecord[162].GetUInt32(); - EmoteOnComplete = questRecord[163].GetUInt32(); + EmoteOnIncomplete = questRecord[162].GetUInt16(); + EmoteOnComplete = questRecord[163].GetUInt16(); for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) - OfferRewardEmote[i] = questRecord[164+i].GetInt32(); + OfferRewardEmote[i] = questRecord[164+i].GetInt16(); for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) OfferRewardEmoteDelay[i] = questRecord[168+i].GetInt32(); diff --git a/src/server/game/Reputation/ReputationMgr.cpp b/src/server/game/Reputation/ReputationMgr.cpp index b1f38dfb86d..94a6590cc4a 100755 --- a/src/server/game/Reputation/ReputationMgr.cpp +++ b/src/server/game/Reputation/ReputationMgr.cpp @@ -166,15 +166,16 @@ void ReputationMgr::SendState(FactionState const* faction) { uint32 count = 1; - WorldPacket data(SMSG_SET_FACTION_STANDING, (16)); // last check 2.4.0 - data << (float) 0; // unk 2.4.0 - data << (uint8) 0; // wotlk 8634 + WorldPacket data(SMSG_SET_FACTION_STANDING, 17); + data << float(0); + data << uint8(_sendFactionIncreased); + _sendFactionIncreased = false; // Reset size_t p_count = data.wpos(); - data << (uint32) count; // placeholder + data << uint32(count); - data << (uint32) faction->ReputationListID; - data << (uint32) faction->Standing; + data << uint32(faction->ReputationListID); + data << uint32(faction->Standing); for (FactionStateList::iterator itr = _factions.begin(); itr != _factions.end(); ++itr) { @@ -183,8 +184,8 @@ void ReputationMgr::SendState(FactionState const* faction) itr->second.needSend = false; if (itr->second.ReputationListID != faction->ReputationListID) { - data << (uint32) itr->second.ReputationListID; - data << (uint32) itr->second.Standing; + data << uint32(itr->second.ReputationListID); + data << uint32(itr->second.Standing); ++count; } } @@ -253,6 +254,7 @@ void ReputationMgr::Initialize() _honoredFactionCount = 0; _reveredFactionCount = 0; _exaltedFactionCount = 0; + _sendFactionIncreased = false; for (unsigned int i = 1; i < sFactionStore.GetNumRows(); i++) { @@ -337,6 +339,7 @@ bool ReputationMgr::SetReputation(FactionEntry const* factionEntry, int32 standi } } } + // spillover done, update faction itself FactionStateList::iterator faction = _factions.find(factionEntry->reputationListID); if (faction != _factions.end()) @@ -379,11 +382,14 @@ bool ReputationMgr::SetOneFactionReputation(FactionEntry const* factionEntry, in if (new_rank <= REP_HOSTILE) SetAtWar(&itr->second, true); + if (new_rank > old_rank) + _sendFactionIncreased = true; + UpdateRankCounters(old_rank, new_rank); _player->ReputationChanged(factionEntry); - _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KNOWN_FACTIONS, factionEntry->ID); - _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION, factionEntry->ID); + _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KNOWN_FACTIONS, factionEntry->ID); + _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION, factionEntry->ID); _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_EXALTED_REPUTATION, factionEntry->ID); _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_REVERED_REPUTATION, factionEntry->ID); _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_HONORED_REPUTATION, factionEntry->ID); @@ -515,7 +521,7 @@ void ReputationMgr::LoadFromDB(PreparedQueryResult result) FactionState* faction = &_factions[factionEntry->reputationListID]; // update standing to current - faction->Standing = int32(fields[1].GetUInt32()); + faction->Standing = fields[1].GetInt32(); // update counters int32 BaseRep = GetBaseReputation(factionEntry); @@ -562,8 +568,18 @@ void ReputationMgr::SaveToDB(SQLTransaction& trans) { if (itr->second.needSave) { - trans->PAppend("DELETE FROM character_reputation WHERE guid = '%u' AND faction='%u'", _player->GetGUIDLow(), itr->second.ID); - trans->PAppend("INSERT INTO character_reputation (guid, faction, standing, flags) VALUES ('%u', '%u', '%i', '%u')", _player->GetGUIDLow(), itr->second.ID, itr->second.Standing, itr->second.Flags); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_REPUTATION_BY_FACTION); + stmt->setUInt32(0, _player->GetGUIDLow()); + stmt->setUInt16(1, uint16(itr->second.ID)); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_REPUTATION_BY_FACTION); + stmt->setUInt32(0, _player->GetGUIDLow()); + stmt->setUInt16(1, uint16(itr->second.ID)); + stmt->setInt32(2, itr->second.Standing); + stmt->setUInt16(3, uint16(itr->second.Flags)); + trans->Append(stmt); + itr->second.needSave = false; } } diff --git a/src/server/game/Reputation/ReputationMgr.h b/src/server/game/Reputation/ReputationMgr.h index 84013f7ec20..a073845ea73 100755 --- a/src/server/game/Reputation/ReputationMgr.h +++ b/src/server/game/Reputation/ReputationMgr.h @@ -132,6 +132,9 @@ class ReputationMgr void ApplyForceReaction(uint32 faction_id, ReputationRank rank, bool apply); + //! Public for chat command needs + bool SetOneFactionReputation(FactionEntry const* factionEntry, int32 standing, bool incremental); + public: // senders void SendInitialReputations(); void SendForceReactions(); @@ -142,7 +145,6 @@ class ReputationMgr void Initialize(); uint32 GetDefaultStateFlags(FactionEntry const* factionEntry) const; bool SetReputation(FactionEntry const* factionEntry, int32 standing, bool incremental); - bool SetOneFactionReputation(FactionEntry const* factionEntry, int32 standing, bool incremental); void SetVisible(FactionState* faction); void SetAtWar(FactionState* faction, bool atWar) const; void SetInactive(FactionState* faction, bool inactive) const; @@ -156,6 +158,7 @@ class ReputationMgr uint8 _honoredFactionCount :8; uint8 _reveredFactionCount :8; uint8 _exaltedFactionCount :8; + bool _sendFactionIncreased; //! Play visual effect on next SMSG_SET_FACTION_STANDING sent }; #endif diff --git a/src/server/game/Scripting/MapScripts.cpp b/src/server/game/Scripting/MapScripts.cpp index 7757e1a1a35..5387a3132c6 100755 --- a/src/server/game/Scripting/MapScripts.cpp +++ b/src/server/game/Scripting/MapScripts.cpp @@ -39,9 +39,9 @@ void Map::ScriptsStart(ScriptMapMap const& scripts, uint32 id, Object* source, O return; // prepare static data - uint64 sourceGUID = source ? source->GetGUID() : (uint64)0; //some script commands doesn't have source - uint64 targetGUID = target ? target->GetGUID() : (uint64)0; - uint64 ownerGUID = (source->GetTypeId() == TYPEID_ITEM) ? ((Item*)source)->GetOwnerGUID() : (uint64)0; + uint64 sourceGUID = source ? source->GetGUID() : uint64(0); //some script commands doesn't have source + uint64 targetGUID = target ? target->GetGUID() : uint64(0); + uint64 ownerGUID = (source && source->GetTypeId() == TYPEID_ITEM) ? ((Item*)source)->GetOwnerGUID() : uint64(0); ///- Schedule script execution for all scripts in the script map ScriptMap const* s2 = &(s->second); @@ -74,9 +74,9 @@ void Map::ScriptCommandStart(ScriptInfo const& script, uint32 delay, Object* sou // NOTE: script record _must_ exist until command executed // prepare static data - uint64 sourceGUID = source ? source->GetGUID() : (uint64)0; - uint64 targetGUID = target ? target->GetGUID() : (uint64)0; - uint64 ownerGUID = (source->GetTypeId() == TYPEID_ITEM) ? ((Item*)source)->GetOwnerGUID() : (uint64)0; + uint64 sourceGUID = source ? source->GetGUID() : uint64(0); + uint64 targetGUID = target ? target->GetGUID() : uint64(0); + uint64 ownerGUID = (source && source->GetTypeId() == TYPEID_ITEM) ? ((Item*)source)->GetOwnerGUID() : uint64(0); ScriptAction sa; sa.sourceGUID = sourceGUID; @@ -375,22 +375,22 @@ void Map::ScriptsProcess() } if (step.script->Talk.Flags & SF_TALK_USE_PLAYER) { - if (Player* pSource = _GetScriptPlayerSourceOrTarget(source, target, step.script)) + if (Player* player = _GetScriptPlayerSourceOrTarget(source, target, step.script)) { - LocaleConstant loc_idx = pSource->GetSession()->GetSessionDbLocaleIndex(); + LocaleConstant loc_idx = player->GetSession()->GetSessionDbLocaleIndex(); std::string text(sObjectMgr->GetTrinityString(step.script->Talk.TextID, loc_idx)); switch (step.script->Talk.ChatType) { case CHAT_TYPE_SAY: - pSource->Say(text, LANG_UNIVERSAL); + player->Say(text, LANG_UNIVERSAL); break; case CHAT_TYPE_YELL: - pSource->Yell(text, LANG_UNIVERSAL); + player->Yell(text, LANG_UNIVERSAL); break; case CHAT_TYPE_TEXT_EMOTE: case CHAT_TYPE_BOSS_EMOTE: - pSource->TextEmote(text); + player->TextEmote(text); break; case CHAT_TYPE_WHISPER: case CHAT_MSG_RAID_BOSS_WHISPER: @@ -399,7 +399,7 @@ void Map::ScriptsProcess() if (!targetGUID || !IS_PLAYER_GUID(targetGUID)) sLog->outError("%s attempt to whisper to non-player unit, skipping.", step.script->GetDebugInfo().c_str()); else - pSource->Whisper(text, LANG_UNIVERSAL, targetGUID); + player->Whisper(text, LANG_UNIVERSAL, targetGUID); break; } default: @@ -524,8 +524,8 @@ void Map::ScriptsProcess() else { // Source or target must be Player. - if (Player* pSource = _GetScriptPlayerSourceOrTarget(source, target, step.script)) - pSource->TeleportTo(step.script->TeleportTo.MapID, step.script->TeleportTo.DestX, step.script->TeleportTo.DestY, step.script->TeleportTo.DestZ, step.script->TeleportTo.Orientation); + if (Player* player = _GetScriptPlayerSourceOrTarget(source, target, step.script)) + player->TeleportTo(step.script->TeleportTo.MapID, step.script->TeleportTo.DestX, step.script->TeleportTo.DestY, step.script->TeleportTo.DestZ, step.script->TeleportTo.Orientation); } break; @@ -544,8 +544,8 @@ void Map::ScriptsProcess() // when script called for item spell casting then target == (unit or GO) and source is player WorldObject* worldObject; - Player* plrTarget = target->ToPlayer(); - if (plrTarget) + Player* player = target->ToPlayer(); + if (player) { if (source->GetTypeId() != TYPEID_UNIT && source->GetTypeId() != TYPEID_GAMEOBJECT && source->GetTypeId() != TYPEID_PLAYER) { @@ -557,8 +557,8 @@ void Map::ScriptsProcess() } else { - plrTarget = source->ToPlayer(); - if (plrTarget) + player = source->ToPlayer(); + if (player) { if (target->GetTypeId() != TYPEID_UNIT && target->GetTypeId() != TYPEID_GAMEOBJECT && target->GetTypeId() != TYPEID_PLAYER) { @@ -566,7 +566,7 @@ void Map::ScriptsProcess() step.script->GetDebugInfo().c_str(), target->GetTypeId(), target->GetEntry(), target->GetGUIDLow()); break; } - worldObject = dynamic_cast(target); + worldObject = dynamic_cast(target); } else { @@ -579,22 +579,22 @@ void Map::ScriptsProcess() // quest id and flags checked at script loading if ((worldObject->GetTypeId() != TYPEID_UNIT || ((Unit*)worldObject)->isAlive()) && - (step.script->QuestExplored.Distance == 0 || worldObject->IsWithinDistInMap(plrTarget, float(step.script->QuestExplored.Distance)))) - plrTarget->AreaExploredOrEventHappens(step.script->QuestExplored.QuestID); + (step.script->QuestExplored.Distance == 0 || worldObject->IsWithinDistInMap(player, float(step.script->QuestExplored.Distance)))) + player->AreaExploredOrEventHappens(step.script->QuestExplored.QuestID); else - plrTarget->FailQuest(step.script->QuestExplored.QuestID); + player->FailQuest(step.script->QuestExplored.QuestID); break; } case SCRIPT_COMMAND_KILL_CREDIT: // Source or target must be Player. - if (Player* pSource = _GetScriptPlayerSourceOrTarget(source, target, step.script)) + if (Player* player = _GetScriptPlayerSourceOrTarget(source, target, step.script)) { if (step.script->KillCredit.Flags & SF_KILLCREDIT_REWARD_GROUP) - pSource->RewardPlayerAndGroupAtEvent(step.script->KillCredit.CreatureEntry, pSource); + player->RewardPlayerAndGroupAtEvent(step.script->KillCredit.CreatureEntry, player); else - pSource->KilledMonsterCredit(step.script->KillCredit.CreatureEntry, 0); + player->KilledMonsterCredit(step.script->KillCredit.CreatureEntry, 0); } break; @@ -665,7 +665,7 @@ void Map::ScriptsProcess() case SCRIPT_COMMAND_ACTIVATE_OBJECT: // Source must be Unit. - if (Unit* pSource = _GetScriptUnit(source, true, step.script)) + if (Unit* unit = _GetScriptUnit(source, true, step.script)) { // Target must be GameObject. if (!target) @@ -682,7 +682,7 @@ void Map::ScriptsProcess() } if (GameObject* pGO = target->ToGameObject()) - pGO->Use(pSource); + pGO->Use(unit); } break; @@ -690,8 +690,8 @@ void Map::ScriptsProcess() { // Source (datalong2 != 0) or target (datalong2 == 0) must be Unit. bool bReverse = step.script->RemoveAura.Flags & SF_REMOVEAURA_REVERSE; - if (Unit* pTarget = _GetScriptUnit(bReverse ? source : target, bReverse, step.script)) - pTarget->RemoveAurasDueToSpell(step.script->RemoveAura.SpellID); + if (Unit* unit = _GetScriptUnit(bReverse ? source : target, bReverse, step.script)) + unit->RemoveAurasDueToSpell(step.script->RemoveAura.SpellID); break; } @@ -752,23 +752,23 @@ void Map::ScriptsProcess() case SCRIPT_COMMAND_PLAY_SOUND: // Source must be WorldObject. - if (WorldObject* pSource = _GetScriptWorldObject(source, true, step.script)) + if (WorldObject* object = _GetScriptWorldObject(source, true, step.script)) { // PlaySound.Flags bitmask: 0/1=anyone/target - Player* pTarget = NULL; + Player* player = NULL; if (step.script->PlaySound.Flags & SF_PLAYSOUND_TARGET_PLAYER) { // Target must be Player. - pTarget = _GetScriptPlayer(target, false, step.script); - if (!pTarget) + player = _GetScriptPlayer(target, false, step.script); + if (!target) break; } // PlaySound.Flags bitmask: 0/2=without/with distance dependent if (step.script->PlaySound.Flags & SF_PLAYSOUND_DISTANCE_SOUND) - pSource->PlayDistanceSound(step.script->PlaySound.SoundID, pTarget); + object->PlayDistanceSound(step.script->PlaySound.SoundID, player); else - pSource->PlayDirectSound(step.script->PlaySound.SoundID, pTarget); + object->PlayDirectSound(step.script->PlaySound.SoundID, player); } break; @@ -796,12 +796,12 @@ void Map::ScriptsProcess() case SCRIPT_COMMAND_LOAD_PATH: // Source must be Unit. - if (Unit* pSource = _GetScriptUnit(source, true, step.script)) + if (Unit* unit = _GetScriptUnit(source, true, step.script)) { if (!sWaypointMgr->GetPath(step.script->LoadPath.PathID)) sLog->outError("%s source object has an invalid path (%u), skipping.", step.script->GetDebugInfo().c_str(), step.script->LoadPath.PathID); else - pSource->GetMotionMaster()->MovePath(step.script->LoadPath.PathID, step.script->LoadPath.IsRepeatable); + unit->GetMotionMaster()->MovePath(step.script->LoadPath.PathID, step.script->LoadPath.IsRepeatable); } break; @@ -876,21 +876,21 @@ void Map::ScriptsProcess() case SCRIPT_COMMAND_ORIENTATION: // Source must be Unit. - if (Unit* pSource = _GetScriptUnit(source, true, step.script)) + if (Unit* sourceUnit = _GetScriptUnit(source, true, step.script)) { - if (step.script->Orientation.Flags& SF_ORIENTATION_FACE_TARGET) + if (step.script->Orientation.Flags & SF_ORIENTATION_FACE_TARGET) { // Target must be Unit. - Unit* pTarget = _GetScriptUnit(target, false, step.script); - if (!pTarget) + Unit* targetUnit = _GetScriptUnit(target, false, step.script); + if (!targetUnit) break; - pSource->SetInFront(pTarget); + sourceUnit->SetInFront(targetUnit); } else - pSource->SetOrientation(step.script->Orientation.Orientation); + sourceUnit->SetOrientation(step.script->Orientation.Orientation); - pSource->SendMovementFlagUpdate(); + sourceUnit->SendMovementFlagUpdate(); } break; @@ -908,14 +908,14 @@ void Map::ScriptsProcess() case SCRIPT_COMMAND_CLOSE_GOSSIP: // Source must be Player. - if (Player* pSource = _GetScriptPlayer(source, true, step.script)) - pSource->PlayerTalkClass->SendCloseGossip(); + if (Player* player = _GetScriptPlayer(source, true, step.script)) + player->PlayerTalkClass->SendCloseGossip(); break; case SCRIPT_COMMAND_PLAYMOVIE: // Source must be Player. - if (Player* pSource = _GetScriptPlayer(source, true, step.script)) - pSource->SendMovieStart(step.script->PlayMovie.MovieID); + if (Player* player = _GetScriptPlayer(source, true, step.script)) + player->SendMovieStart(step.script->PlayMovie.MovieID); break; default: diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index 1207b654817..f64d0953e86 100755 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -61,7 +61,6 @@ void AddSC_reload_commandscript(); void AddSC_tele_commandscript(); void AddSC_titles_commandscript(); void AddSC_wp_commandscript(); -void AddSC_gps_commandscript(); #ifdef SCRIPTS //world @@ -151,7 +150,6 @@ void AddSC_boss_sulfuron(); void AddSC_boss_majordomo(); void AddSC_boss_ragnaros(); void AddSC_instance_molten_core(); -void AddSC_molten_core(); void AddSC_the_scarlet_enclave(); //Scarlet Enclave void AddSC_the_scarlet_enclave_c1(); void AddSC_the_scarlet_enclave_c2(); @@ -426,6 +424,7 @@ void AddSC_ulduar_teleporter(); void AddSC_boss_mimiron(); void AddSC_boss_hodir(); void AddSC_boss_freya(); +void AddSC_boss_algalon_the_observer(); void AddSC_instance_ulduar(); void AddSC_boss_keleseth(); //Utgarde Keep void AddSC_boss_skarvald_dalronn(); @@ -664,7 +663,6 @@ void AddCommandScripts() AddSC_tele_commandscript(); AddSC_titles_commandscript(); AddSC_wp_commandscript(); - AddSC_gps_commandscript(); } void AddWorldScripts() @@ -761,7 +759,6 @@ void AddEasternKingdomsScripts() AddSC_boss_majordomo(); AddSC_boss_ragnaros(); AddSC_instance_molten_core(); - AddSC_molten_core(); AddSC_the_scarlet_enclave(); //Scarlet Enclave AddSC_the_scarlet_enclave_c1(); AddSC_the_scarlet_enclave_c2(); @@ -1131,6 +1128,7 @@ void AddNorthrendScripts() AddSC_boss_mimiron(); AddSC_boss_hodir(); AddSC_boss_freya(); + AddSC_boss_algalon_the_observer(); AddSC_instance_ulduar(); AddSC_boss_keleseth(); //Utgarde Keep AddSC_boss_skarvald_dalronn(); diff --git a/src/server/game/Scripting/ScriptLoader.h b/src/server/game/Scripting/ScriptLoader.h index 409b3db4b7f..0db6917a0d4 100644 --- a/src/server/game/Scripting/ScriptLoader.h +++ b/src/server/game/Scripting/ScriptLoader.h @@ -1,6 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* This program is free software licensed under GPL version 2 -* Please see the included DOCS/LICENSE.TXT for more information */ +/* + * Copyright (C) 2008-2012 TrinityCore + * + * 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; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; 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, see . + */ #ifndef SC_SCRIPTLOADER_H #define SC_SCRIPTLOADER_H diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index 47751338d66..23d18e12097 100755 --- a/src/server/game/Scripting/ScriptMgr.cpp +++ b/src/server/game/Scripting/ScriptMgr.cpp @@ -181,7 +181,7 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* target) if (pData->uiSoundId) { - if (GetSoundEntriesStore()->LookupEntry(pData->uiSoundId)) + if (sSoundEntriesStore.LookupEntry(pData->uiSoundId)) pSource->SendPlaySound(pData->uiSoundId, false); else sLog->outError("TSCR: DoScriptText entry %i tried to process invalid sound id %u.", iTextEntry, pData->uiSoundId); @@ -260,7 +260,7 @@ void ScriptMgr::Initialize() void ScriptMgr::Unload() { #define SCR_CLEAR(T) \ - FOR_SCRIPTS(T, itr, end) \ + for (SCR_REG_ITR(T) itr = SCR_REG_LST(T).begin(); itr != SCR_REG_LST(T).end(); ++itr) \ delete itr->second; \ SCR_REG_LST(T).clear(); @@ -582,7 +582,7 @@ void ScriptMgr::OnCreateMap(Map* map) { ASSERT(map); - SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsContinent); + SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsWorldMap); itr->second->OnCreate(map); SCR_MAP_END; @@ -599,7 +599,7 @@ void ScriptMgr::OnDestroyMap(Map* map) { ASSERT(map); - SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsContinent); + SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsWorldMap); itr->second->OnDestroy(map); SCR_MAP_END; @@ -617,7 +617,7 @@ void ScriptMgr::OnLoadGridMap(Map* map, GridMap* gmap, uint32 gx, uint32 gy) ASSERT(map); ASSERT(gmap); - SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsContinent); + SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsWorldMap); itr->second->OnLoadGridMap(map, gmap, gx, gy); SCR_MAP_END; @@ -635,7 +635,7 @@ void ScriptMgr::OnUnloadGridMap(Map* map, GridMap* gmap, uint32 gx, uint32 gy) ASSERT(map); ASSERT(gmap); - SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsContinent); + SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsWorldMap); itr->second->OnUnloadGridMap(map, gmap, gx, gy); SCR_MAP_END; @@ -653,7 +653,7 @@ void ScriptMgr::OnPlayerEnterMap(Map* map, Player* player) ASSERT(map); ASSERT(player); - SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsContinent); + SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsWorldMap); itr->second->OnPlayerEnter(map, player); SCR_MAP_END; @@ -671,7 +671,7 @@ void ScriptMgr::OnPlayerLeaveMap(Map* map, Player* player) ASSERT(map); ASSERT(player); - SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsContinent); + SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsWorldMap); itr->second->OnPlayerLeave(map, player); SCR_MAP_END; @@ -688,7 +688,7 @@ void ScriptMgr::OnMapUpdate(Map* map, uint32 diff) { ASSERT(map); - SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsContinent); + SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsWorldMap); itr->second->OnUpdate(map, diff); SCR_MAP_END; @@ -937,6 +937,22 @@ void ScriptMgr::OnGameObjectDamaged(GameObject* go, Player* player) tmpscript->OnDamaged(go, player); } +void ScriptMgr::OnGameObjectLootStateChanged(GameObject* go, uint32 state, Unit* unit) +{ + ASSERT(go); + + GET_SCRIPT(GameObjectScript, go->GetScriptId(), tmpscript); + tmpscript->OnLootStateChanged(go, state, unit); +} + +void ScriptMgr::OnGameObjectStateChanged(GameObject* go, uint32 state) +{ + ASSERT(go); + + GET_SCRIPT(GameObjectScript, go->GetScriptId(), tmpscript); + tmpscript->OnGameObjectStateChanged(go, state); +} + void ScriptMgr::OnGameObjectUpdate(GameObject* go, uint32 diff) { ASSERT(go); @@ -954,6 +970,14 @@ bool ScriptMgr::OnDummyEffect(Unit* caster, uint32 spellId, SpellEffIndex effInd return tmpscript->OnDummyEffect(caster, spellId, effIndex, target); } +GameObjectAI* ScriptMgr::GetGameObjectAI(GameObject* go) +{ + ASSERT(go); + + GET_SCRIPT_RET(GameObjectScript, go->GetScriptId(), tmpscript, NULL); + return tmpscript->GetAI(go); +} + bool ScriptMgr::OnAreaTrigger(Player* player, AreaTriggerEntry const* trigger) { ASSERT(player); @@ -1295,6 +1319,11 @@ void ScriptMgr::OnPlayerBindToInstance(Player* player, Difficulty difficulty, ui FOREACH_SCRIPT(PlayerScript)->OnBindToInstance(player, difficulty, mapid, permanent); } +void ScriptMgr::OnPlayerUpdateZone(Player* player, uint32 newZone, uint32 newArea) +{ + FOREACH_SCRIPT(PlayerScript)->OnUpdateZone(player, newZone, newArea); +} + // Guild void ScriptMgr::OnGuildAddMember(Guild* guild, Player* player, uint8& plRank) { @@ -1410,7 +1439,7 @@ FormulaScript::FormulaScript(const char* name) WorldMapScript::WorldMapScript(const char* name, uint32 mapId) : ScriptObject(name), MapScript(mapId) { - if (GetEntry() && !GetEntry()->IsContinent()) + if (GetEntry() && !GetEntry()->IsWorldMap()) sLog->outError("WorldMapScript for map %u is invalid.", mapId); ScriptRegistry::AddScript(this); diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h index 048a7581215..b3d445af0c6 100755 --- a/src/server/game/Scripting/ScriptMgr.h +++ b/src/server/game/Scripting/ScriptMgr.h @@ -39,6 +39,7 @@ class Creature; class CreatureAI; class DynamicObject; class GameObject; +class GameObjectAI; class Guild; class GridMap; class Group; @@ -471,6 +472,15 @@ class GameObjectScript : public ScriptObject, public UpdatableScript // Called when the game object is damaged (destructible buildings only). virtual void OnDamaged(GameObject* /*go*/, Player* /*player*/) { } + + // Called when the game object loot state is changed. + virtual void OnLootStateChanged(GameObject* /*go*/, uint32 /*state*/, Unit* /*unit*/) { } + + // Called when the game object state is changed. + virtual void OnGameObjectStateChanged(GameObject* /*go*/, uint32 /*state*/) { } + + // Called when a GameObjectAI object is needed for the gameobject. + virtual GameObjectAI* GetAI(GameObject* /*go*/) const { return NULL; } }; class AreaTriggerScript : public ScriptObject @@ -724,6 +734,9 @@ class PlayerScript : public ScriptObject // Called when a player is bound to an instance virtual void OnBindToInstance(Player* /*player*/, Difficulty /*difficulty*/, uint32 /*mapId*/, bool /*permanent*/) { } + + // Called when a player switches to a new zone + virtual void OnUpdateZone(Player* /*player*/, uint32 /*newZone*/, uint32 /*newArea*/) { } }; class GuildScript : public ScriptObject @@ -907,7 +920,10 @@ class ScriptMgr uint32 GetDialogStatus(Player* player, GameObject* go); void OnGameObjectDestroyed(GameObject* go, Player* player); void OnGameObjectDamaged(GameObject* go, Player* player); + void OnGameObjectLootStateChanged(GameObject* go, uint32 state, Unit* unit); + void OnGameObjectStateChanged(GameObject* go, uint32 state); void OnGameObjectUpdate(GameObject* go, uint32 diff); + GameObjectAI* GetGameObjectAI(GameObject* go); public: /* AreaTriggerScript */ @@ -993,6 +1009,7 @@ class ScriptMgr void OnPlayerCreate(Player* player); void OnPlayerDelete(uint64 guid); void OnPlayerBindToInstance(Player* player, Difficulty difficulty, uint32 mapid, bool permanent); + void OnPlayerUpdateZone(Player* player, uint32 newZone, uint32 newArea); public: /* GuildScript */ diff --git a/src/server/game/Scripting/ScriptSystem.cpp b/src/server/game/Scripting/ScriptSystem.cpp index 56d3109a6a0..c38d559372f 100755 --- a/src/server/game/Scripting/ScriptSystem.cpp +++ b/src/server/game/Scripting/ScriptSystem.cpp @@ -30,7 +30,8 @@ void SystemMgr::LoadScriptTexts() sLog->outString("TSCR: Loading Script Texts additional data..."); uint32 oldMSTime = getMSTime(); - + + // 0 1 2 3 QueryResult result = WorldDatabase.Query("SELECT entry, sound, type, language, emote FROM script_texts"); if (!result) @@ -49,9 +50,9 @@ void SystemMgr::LoadScriptTexts() int32 iId = pFields[0].GetInt32(); temp.uiSoundId = pFields[1].GetUInt32(); - temp.uiType = pFields[2].GetUInt32(); - temp.uiLanguage = pFields[3].GetUInt32(); - temp.uiEmote = pFields[4].GetUInt32(); + temp.uiType = pFields[2].GetUInt8(); + temp.uiLanguage = pFields[3].GetUInt8(); + temp.uiEmote = pFields[4].GetUInt16(); if (iId >= 0) { @@ -67,7 +68,7 @@ void SystemMgr::LoadScriptTexts() if (temp.uiSoundId) { - if (!GetSoundEntriesStore()->LookupEntry(temp.uiSoundId)) + if (!sSoundEntriesStore.LookupEntry(temp.uiSoundId)) sLog->outErrorDb("TSCR: Entry %i in table `script_texts` has soundId %u but sound does not exist.", iId, temp.uiSoundId); } @@ -79,7 +80,8 @@ void SystemMgr::LoadScriptTexts() m_mTextDataMap[iId] = temp; ++uiCount; - } while (result->NextRow()); + } + while (result->NextRow()); sLog->outString(">> Loaded %u additional Script Texts data in %u ms", uiCount, GetMSTimeDiffToNow(oldMSTime)); sLog->outString(); @@ -108,11 +110,11 @@ void SystemMgr::LoadScriptTextsCustom() Field* pFields = result->Fetch(); StringTextData temp; - int32 iId = pFields[0].GetInt32(); + int32 iId = pFields[0].GetInt32(); temp.uiSoundId = pFields[1].GetUInt32(); - temp.uiType = pFields[2].GetUInt32(); - temp.uiLanguage = pFields[3].GetUInt32(); - temp.uiEmote = pFields[4].GetUInt32(); + temp.uiType = pFields[2].GetUInt8(); + temp.uiLanguage = pFields[3].GetUInt8(); + temp.uiEmote = pFields[4].GetUInt16(); if (iId >= 0) { @@ -128,7 +130,7 @@ void SystemMgr::LoadScriptTextsCustom() if (temp.uiSoundId) { - if (!GetSoundEntriesStore()->LookupEntry(temp.uiSoundId)) + if (!sSoundEntriesStore.LookupEntry(temp.uiSoundId)) sLog->outErrorDb("TSCR: Entry %i in table `custom_texts` has soundId %u but sound does not exist.", iId, temp.uiSoundId); } @@ -140,7 +142,8 @@ void SystemMgr::LoadScriptTextsCustom() m_mTextDataMap[iId] = temp; ++uiCount; - } while (result->NextRow()); + } + while (result->NextRow()); sLog->outString(">> Loaded %u additional Custom Texts data.", uiCount); sLog->outString(); @@ -162,6 +165,7 @@ void SystemMgr::LoadScriptWaypoints() sLog->outString("TSCR: Loading Script Waypoints for " UI64FMTD " creature(s)...", uiCreatureCount); + // 0 1 2 3 4 5 result = WorldDatabase.Query("SELECT entry, pointid, location_x, location_y, location_z, waittime FROM script_waypoint ORDER BY pointid"); if (!result) @@ -199,7 +203,8 @@ void SystemMgr::LoadScriptWaypoints() m_mPointMoveMap[uiEntry].push_back(temp); ++count; - } while (result->NextRow()); + } + while (result->NextRow()); sLog->outString(">> Loaded %u Script Waypoint nodes in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); sLog->outString(); diff --git a/src/server/game/Scripting/ScriptSystem.h b/src/server/game/Scripting/ScriptSystem.h index daa7fe0d596..cf6332b22f2 100644 --- a/src/server/game/Scripting/ScriptSystem.h +++ b/src/server/game/Scripting/ScriptSystem.h @@ -4,6 +4,7 @@ #ifndef SC_SYSTEM_H #define SC_SYSTEM_H + #include #define TEXT_SOURCE_RANGE -1000000 //the amount of entries each text source has available diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 8e53d6230c4..a3fd1f523d9 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -1183,7 +1183,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_INVITE_NOTES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_NOTES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_NOTES_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_UPDATE_MISSILE_TRAJECTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_UPDATE_MISSILE_TRAJECTORY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateMissileTrajectory ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ACCOUNT_DATA_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TRIGGER_MOVIE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_COMPLETE_MOVIE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 65fa2a5a950..66fd54cd960 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -454,7 +454,8 @@ enum Opcodes CMSG_UNLEARN_SKILL = 0xAC3, CMSG_UNREGISTER_ALL_ADDON_PREFIXES = 0x00, CMSG_UPDATE_ACCOUNT_DATA = 0x4AFE, - CMSG_UPDATE_PROJECTILE_POSITION = 0xEDB, + CMSG_UPDATE_MISSILE_TRAJECTORY = 0x9525, + CMSG_UPDATE_PROJECTILE_POSITION = 0x00, // sub_677360 CMSG_USE_ITEM = 0xD8EA, CMSG_VIOLENCE_LEVEL = 0x00, CMSG_VOICE_SESSION_ENABLE = 0x00, diff --git a/src/server/game/Server/Protocol/WorldLog.cpp b/src/server/game/Server/Protocol/WorldLog.cpp index 5b1a3af996f..38b13dff095 100755 --- a/src/server/game/Server/Protocol/WorldLog.cpp +++ b/src/server/game/Server/Protocol/WorldLog.cpp @@ -34,6 +34,7 @@ WorldLog::~WorldLog() { if (i_file != NULL) fclose(i_file); + i_file = NULL; } diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index e93c0eb8102..a9e4ffbf362 100755 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -48,7 +48,7 @@ bool MapSessionFilter::Process(WorldPacket* packet) { Opcodes opcode = DropHighBytes(packet->GetOpcode()); - const OpcodeHandler* opHandle = opcodeTable[opcode]; + OpcodeHandler const* opHandle = opcodeTable[opcode]; //let's check if our opcode can be really processed in Map::Update() if (opHandle->packetProcessing == PROCESS_INPLACE) @@ -71,7 +71,7 @@ bool MapSessionFilter::Process(WorldPacket* packet) bool WorldSessionFilter::Process(WorldPacket* packet) { Opcodes opcode = DropHighBytes(packet->GetOpcode()); - const OpcodeHandler* opHandle = opcodeTable[opcode]; + OpcodeHandler const* opHandle = opcodeTable[opcode]; //check if packet handler is supposed to be safe if (opHandle->packetProcessing == PROCESS_INPLACE) return true; @@ -123,8 +123,8 @@ WorldSession::~WorldSession() /// - If have unclosed socket, close it if (m_Socket) { - m_Socket->CloseSocket (); - m_Socket->RemoveReference (); + m_Socket->CloseSocket(); + m_Socket->RemoveReference(); m_Socket = NULL; } @@ -139,7 +139,7 @@ WorldSession::~WorldSession() LoginDatabase.PExecute("UPDATE account SET online = 0 WHERE id = %u;", GetAccountId()); // One-time query } -void WorldSession::SizeError(WorldPacket const &packet, uint32 size) const +void WorldSession::SizeError(WorldPacket const& packet, uint32 size) const { sLog->outError("Client (account %u) send packet %s (%u) with size " SIZEFMTD " but expected %u (attempt to crash server?), skipped", GetAccountId(), LookupOpcodeName(packet.GetOpcode()), packet.GetOpcode(), packet.size(), size); @@ -205,8 +205,8 @@ void WorldSession::SendPacket(WorldPacket const* packet) } #endif // !TRINITY_DEBUG - if (m_Socket->SendPacket (*packet) == -1) - m_Socket->CloseSocket (); + if (m_Socket->SendPacket(*packet) == -1) + m_Socket->CloseSocket(); } /// Add an incoming packet to the queue @@ -292,7 +292,7 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) // lag can cause STATUS_LOGGEDIN opcodes to arrive after the player started a transfer break; case STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT: - if (!_player && !m_playerRecentlyLogout) + if (!_player && !m_playerRecentlyLogout && !m_playerLogout) // There's a short delay between _player = null and m_playerRecentlyLogout = true during logout LogUnexpectedOpcode(packet, "STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT", "the player has not logged in yet and not recently logout"); else @@ -325,9 +325,9 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) break; } - // single from authed time opcodes send in to after logout time - // and before other STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT opcodes. - if (packet->GetOpcode() != CMSG_SET_ACTIVE_VOICE_CHANNEL) + // some auth opcodes can be recieved before STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT opcodes + // however when we recieve CMSG_CHAR_ENUM we are surely no longer during the logout process. + if (packet->GetOpcode() == CMSG_CHAR_ENUM) m_playerRecentlyLogout = false; sScriptMgr->OnPacketReceive(m_Socket, WorldPacket(*packet)); @@ -405,7 +405,7 @@ void WorldSession::LogoutPlayer(bool Save) if (_player) { - if (uint64 lguid = GetPlayer()->GetLootGUID()) + if (uint64 lguid = _player->GetLootGUID()) DoLootRelease(lguid); ///- If the player just died before logging out, make him appear as a ghost @@ -519,44 +519,41 @@ void WorldSession::LogoutPlayer(bool Save) if (_player->GetGroup() && !_player->GetGroup()->isRaidGroup() && m_Socket) _player->RemoveFromGroup(); - ///- Send update to group and reset stored max enchanting level + //! Send update to group and reset stored max enchanting level if (_player->GetGroup()) { _player->GetGroup()->SendUpdate(); _player->GetGroup()->ResetMaxEnchantingLevel(); } - ///- Broadcast a logout message to the player's friends + //! Broadcast a logout message to the player's friends sSocialMgr->SendFriendStatus(_player, FRIEND_OFFLINE, _player->GetGUIDLow(), true); - sSocialMgr->RemovePlayerSocial (_player->GetGUIDLow ()); + sSocialMgr->RemovePlayerSocial(_player->GetGUIDLow()); - // Call script hook before deletion - sScriptMgr->OnPlayerLogout(GetPlayer()); + //! Call script hook before deletion + sScriptMgr->OnPlayerLogout(_player); - ///- Remove the player from the world + //! Remove the player from the world // the player may not be in the world when logging out // e.g if he got disconnected during a transfer to another map // calls to GetMap in this case may cause crashes _player->CleanupsBeforeDelete(); - sLog->outChar("Account: %d (IP: %s) Logout Character:[%s] (GUID: %u)", GetAccountId(), GetRemoteAddress().c_str(), _player->GetName(), _player->GetGUIDLow()); + sLog->outChar("Account: %d (IP: %s) Logout Character:[%s] (GUID: %u) Level: %d", GetAccountId(), GetRemoteAddress().c_str(), _player->GetName(), _player->GetGUIDLow(), _player->getLevel()); if (Map* _map = _player->FindMap()) _map->RemovePlayerFromMap(_player, true); - SetPlayer(NULL); // deleted in Remove call - ///- Send the 'logout complete' packet to the client + SetPlayer(NULL); //! Pointer already deleted during RemovePlayerFromMap + + //! Send the 'logout complete' packet to the client + //! Client will respond by sending 3x CMSG_CANCEL_TRADE, which we currently dont handle WorldPacket data(SMSG_LOGOUT_COMPLETE, 0); SendPacket(&data); + sLog->outDebug(LOG_FILTER_NETWORKIO, "SESSION: Sent SMSG_LOGOUT_COMPLETE Message"); - ///- Since each account can only have one online character at any given time, ensure all characters for active account are marked as offline - //No SQL injection as AccountId is uint32 - + //! Since each account can only have one online character at any given time, ensure all characters for active account are marked as offline PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ACCOUNT_ONLINE); - stmt->setUInt32(0, GetAccountId()); - CharacterDatabase.Execute(stmt); - - sLog->outDebug(LOG_FILTER_NETWORKIO, "SESSION: Sent SMSG_LOGOUT_COMPLETE Message"); } m_playerLogout = false; @@ -773,6 +770,7 @@ void WorldSession::ReadAddonsInfo(WorldPacket &data) { if (data.rpos() + 4 > data.size()) return; + uint32 size; data >> size; @@ -792,7 +790,7 @@ void WorldSession::ReadAddonsInfo(WorldPacket &data) ByteBuffer addonInfo; addonInfo.resize(size); - if (uncompress(const_cast(addonInfo.contents()), &uSize, const_cast(data.contents() + pos), data.size() - pos) == Z_OK) + if (uncompress(const_cast(addonInfo.contents()), &uSize, const_cast(data.contents() + pos), data.size() - pos) == Z_OK) { uint32 addonsCount; addonInfo >> addonsCount; // addons count diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 21cc3991b9f..83677aada88 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -31,24 +31,25 @@ #include "WorldPacket.h" #include "Cryptography/BigNumber.h" -struct ItemTemplate; -struct AuctionEntry; -struct DeclinedName; -struct MovementInfo; - +class CalendarEvent; +class CalendarInvite; class Creature; +class GameObject; +class InstanceSave; class Item; +class LoginQueryHolder; class Object; class Player; -class Unit; -class GameObject; class Quest; -class WorldPacket; -class WorldSocket; -class LoginQueryHolder; class SpellCastTargets; +class Unit; class Warden; +class WorldPacket; +class WorldSocket; struct AreaTableEntry; +struct AuctionEntry; +struct DeclinedName; +struct ItemTemplate; struct LfgJoinResultData; struct LfgLockStatus; struct LfgPlayerBoot; @@ -56,6 +57,7 @@ struct LfgProposal; struct LfgReward; struct LfgRoleCheck; struct LfgUpdateData; +struct MovementInfo; enum AccountDataType { @@ -229,6 +231,7 @@ class WorldSession bool PlayerLoading() const { return m_playerLoading; } bool PlayerLogout() const { return m_playerLogout; } bool PlayerLogoutWithSave() const { return m_playerLogout && m_playerSave; } + bool PlayerRecentlyLoggedOut() const { return m_playerRecentlyLogout; } void SizeError(WorldPacket const& packet, uint32 size) const; @@ -302,7 +305,7 @@ class WorldSession void SendAttackStop(Unit const* enemy); - void SendBattlegGroundList(uint64 guid, BattlegroundTypeId bgTypeId); + void SendBattleGroundList(uint64 guid, BattlegroundTypeId bgTypeId); void SendTradeStatus(TradeStatus status); void SendUpdateTrade(bool trader_data = true); @@ -403,7 +406,7 @@ class WorldSession public: // opcodes handlers void Handle_NULL(WorldPacket& recvPacket); // not used - void Handle_EarlyProccess(WorldPacket& recvPacket);// just mark packets processed in WorldSocket::OnRead + void Handle_EarlyProccess(WorldPacket& recvPacket); // just mark packets processed in WorldSocket::OnRead void Handle_ServerSide(WorldPacket& recvPacket); // sever side only, can't be accepted from client void Handle_Deprecated(WorldPacket& recvPacket); // never used anymore by client @@ -799,6 +802,7 @@ class WorldSession void HandleResetInstancesOpcode(WorldPacket& recv_data); void HandleHearthAndResurrect(WorldPacket& recv_data); void HandleInstanceLockResponse(WorldPacket& recvPacket); + void HandleUpdateMissileTrajectory(WorldPacket& recvPacket); // Looking for Dungeon/Raid void HandleLfgSetCommentOpcode(WorldPacket& recv_data); @@ -879,21 +883,36 @@ class WorldSession void HandleAcceptGrantLevel(WorldPacket& recv_data); // Calendar - void HandleCalendarGetCalendar(WorldPacket& recv_data); - void HandleCalendarGetEvent(WorldPacket& recv_data); - void HandleCalendarGuildFilter(WorldPacket& recv_data); - void HandleCalendarArenaTeam(WorldPacket& recv_data); - void HandleCalendarAddEvent(WorldPacket& recv_data); - void HandleCalendarUpdateEvent(WorldPacket& recv_data); - void HandleCalendarRemoveEvent(WorldPacket& recv_data); - void HandleCalendarCopyEvent(WorldPacket& recv_data); - void HandleCalendarEventInvite(WorldPacket& recv_data); - void HandleCalendarEventRsvp(WorldPacket& recv_data); - void HandleCalendarEventRemoveInvite(WorldPacket& recv_data); - void HandleCalendarEventStatus(WorldPacket& recv_data); - void HandleCalendarEventModeratorStatus(WorldPacket& recv_data); - void HandleCalendarComplain(WorldPacket& recv_data); - void HandleCalendarGetNumPending(WorldPacket& recv_data); + void HandleCalendarGetCalendar(WorldPacket& recvData); + void HandleCalendarGetEvent(WorldPacket& recvData); + void HandleCalendarGuildFilter(WorldPacket& recvData); + void HandleCalendarArenaTeam(WorldPacket& recvData); + void HandleCalendarAddEvent(WorldPacket& recvData); + void HandleCalendarUpdateEvent(WorldPacket& recvData); + void HandleCalendarRemoveEvent(WorldPacket& recvData); + void HandleCalendarCopyEvent(WorldPacket& recvData); + void HandleCalendarEventInvite(WorldPacket& recvData); + void HandleCalendarEventRsvp(WorldPacket& recvData); + void HandleCalendarEventRemoveInvite(WorldPacket& recvData); + void HandleCalendarEventStatus(WorldPacket& recvData); + void HandleCalendarEventModeratorStatus(WorldPacket& recvData); + void HandleCalendarComplain(WorldPacket& recvData); + void HandleCalendarGetNumPending(WorldPacket& recvData); + void HandleCalendarEventSignup(WorldPacket& recvData); + + void SendCalendarEvent(CalendarEvent const& calendarEvent, CalendarSendEventType sendEventType); + void SendCalendarEventInvite(CalendarInvite const& invite, bool pending); + void SendCalendarEventInviteAlert(CalendarEvent const& calendarEvent, CalendarInvite const& calendarInvite); + void SendCalendarEventInviteRemove(CalendarInvite const& invite, uint32 flags); + void SendCalendarEventInviteRemoveAlert(CalendarEvent const& calendarEvent, CalendarInviteStatus status); + void SendCalendarEventRemovedAlert(CalendarEvent const& calendarEvent); + void SendCalendarEventUpdateAlert(CalendarEvent const& calendarEvent, CalendarSendEventType sendEventType); + void SendCalendarEventStatus(CalendarEvent const& calendarEvent, CalendarInvite const& invite); + void SendCalendarEventModeratorStatusAlert(CalendarInvite const& invite); + void SendCalendarClearPendingAction(); + void SendCalendarRaidLockout(InstanceSave const* save, bool add); + void SendCalendarRaidLockoutUpdated(InstanceSave const* save); + void SendCalendarCommandResult(CalendarError err, char const* param = NULL); void HandleSpellClick(WorldPacket& recv_data); void HandleMirrorImageDataRequest(WorldPacket& recv_data); diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index 761d64b200c..3e4a38ba6b1 100755 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -152,7 +152,7 @@ const std::string& WorldSocket::GetRemoteAddress (void) const return m_Address; } -int WorldSocket::SendPacket (const WorldPacket& pct) +int WorldSocket::SendPacket(const WorldPacket& pct) { ACE_GUARD_RETURN (LockType, Guard, m_OutBufferLock, -1); @@ -254,7 +254,7 @@ int WorldSocket::open (void *a) if (peer().get_remote_addr(remote_addr) == -1) { - sLog->outError ("WorldSocket::open: peer().get_remote_addr errno = %s", ACE_OS::strerror (errno)); + sLog->outError("WorldSocket::open: peer().get_remote_addr errno = %s", ACE_OS::strerror (errno)); return -1; } @@ -271,7 +271,7 @@ int WorldSocket::open (void *a) // Register with ACE Reactor if (reactor()->register_handler(this, ACE_Event_Handler::READ_MASK | ACE_Event_Handler::WRITE_MASK) == -1) { - sLog->outError ("WorldSocket::open: unable to register client handler errno = %s", ACE_OS::strerror (errno)); + sLog->outError("WorldSocket::open: unable to register client handler errno = %s", ACE_OS::strerror (errno)); return -1; } @@ -490,7 +490,7 @@ int WorldSocket::handle_input_header (void) if ((header.size < 4) || (header.size > 10240)) { Player* _player = m_Session ? m_Session->GetPlayer() : NULL; - sLog->outError ("WorldSocket::handle_input_header(): client (account: %u, char [GUID: %u, name: %s]) sent malformed packet (size: %d, cmd: %d)", + sLog->outError("WorldSocket::handle_input_header(): client (account: %u, char [GUID: %u, name: %s]) sent malformed packet (size: %d, cmd: %d)", m_Session ? m_Session->GetAccountId() : 0, _player ? _player->GetGUIDLow() : 0, _player ? _player->GetName() : "", @@ -596,7 +596,7 @@ int WorldSocket::handle_input_missing_data (void) // hope this is not hack, as proper m_RecvWPct is asserted around if (!m_RecvWPct) { - sLog->outError ("Forcing close on input m_RecvWPct = NULL"); + sLog->outError("Forcing close on input m_RecvWPct = NULL"); errno = EINVAL; return -1; } @@ -642,7 +642,7 @@ int WorldSocket::cancel_wakeup_output (GuardType& g) (this, ACE_Event_Handler::WRITE_MASK) == -1) { // would be good to store errno from reactor with errno guard - sLog->outError ("WorldSocket::cancel_wakeup_output"); + sLog->outError("WorldSocket::cancel_wakeup_output"); return -1; } @@ -661,7 +661,7 @@ int WorldSocket::schedule_wakeup_output (GuardType& g) if (reactor()->schedule_wakeup (this, ACE_Event_Handler::WRITE_MASK) == -1) { - sLog->outError ("WorldSocket::schedule_wakeup_output"); + sLog->outError("WorldSocket::schedule_wakeup_output"); return -1; } @@ -711,7 +711,7 @@ int WorldSocket::ProcessIncoming (WorldPacket* new_pct) case CMSG_AUTH_SESSION: if (m_Session) { - sLog->outError ("WorldSocket::ProcessIncoming: Player send CMSG_AUTH_SESSION again"); + sLog->outError("WorldSocket::ProcessIncoming: Player send CMSG_AUTH_SESSION again"); return -1; } @@ -760,7 +760,7 @@ int WorldSocket::ProcessIncoming (WorldPacket* new_pct) } else { - sLog->outError ("WorldSocket::ProcessIncoming: Client not authed opcode = %u", uint32(opcode)); + sLog->outError("WorldSocket::ProcessIncoming: Client not authed opcode = %u", uint32(opcode)); return -1; } } @@ -846,20 +846,18 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) { packet.Initialize(SMSG_AUTH_RESPONSE, 1); packet << uint8(AUTH_REJECT); - SendPacket (packet); + SendPacket(packet); sLog->outError("WorldSocket::HandleAuthSession: World closed, denying client (%s).", GetRemoteAddress().c_str()); return -1; } // Get the account information from the realmd database - std::string safe_account = account; // Duplicate, else will screw the SHA hash verification below - LoginDatabase.EscapeString (safe_account); - // No SQL injection, username escaped. + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_INFO_BY_NAME); - QueryResult result = - LoginDatabase.PQuery ("SELECT " - "id, " //0 + stmt->setString(0, account); + + PreparedQueryResult result = LoginDatabase.Query(stmt); "sessionkey, " //1 "last_ip, " //2 "locked, " //3 @@ -880,9 +878,9 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) packet.Initialize (SMSG_AUTH_RESPONSE, 1); packet << uint8 (AUTH_UNKNOWN_ACCOUNT); - SendPacket (packet); + SendPacket(packet); - sLog->outError ("WorldSocket::HandleAuthSession: Sent Auth Response (unknown account)."); + sLog->outError("WorldSocket::HandleAuthSession: Sent Auth Response (unknown account)."); return -1; } @@ -916,7 +914,7 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) { packet.Initialize (SMSG_AUTH_RESPONSE, 1); packet << uint8 (AUTH_FAILED); - SendPacket (packet); + SendPacket(packet); sLog->outBasic ("WorldSocket::HandleAuthSession: Sent Auth Response (Account IP differs)."); return -1; @@ -953,36 +951,36 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) std::string os = fields[10].GetString(); // Checks gmlevel per Realm - result = LoginDatabase.PQuery ("SELECT " - "RealmID, " //0 - "gmlevel " //1 - "FROM account_access " - "WHERE id = '%d'" - " AND (RealmID = '%d'" - " OR RealmID = '-1')", - id, realmID); + stmt = LoginDatabase.GetPreparedStatement(LOGIN_GET_GMLEVEL_BY_REALMID); + + stmt->setUInt32(0, id); + stmt->setInt32(1, int32(realmID)); + + result = LoginDatabase.Query(stmt); + if (!result) security = 0; else { fields = result->Fetch(); - security = fields[1].GetInt32(); + security = fields[0].GetUInt8(); } // Re-check account ban (same check as in realmd) - QueryResult banresult = - LoginDatabase.PQuery ("SELECT 1 FROM account_banned WHERE id = %u AND active = 1 " - "UNION " - "SELECT 1 FROM ip_banned WHERE ip = '%s'", - id, GetRemoteAddress().c_str()); + stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_BANS); + + stmt->setUInt32(0, id); + stmt->setString(1, GetRemoteAddress()); + + PreparedQueryResult banresult = LoginDatabase.Query(stmt); if (banresult) // if account banned { packet.Initialize (SMSG_AUTH_RESPONSE, 1); packet << uint8 (AUTH_BANNED); - SendPacket (packet); + SendPacket(packet); - sLog->outError ("WorldSocket::HandleAuthSession: Sent Auth Response (Account banned)."); + sLog->outError("WorldSocket::HandleAuthSession: Sent Auth Response (Account banned)."); return -1; } @@ -994,9 +992,9 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) WorldPacket Packet (SMSG_AUTH_RESPONSE, 1); Packet << uint8 (AUTH_UNAVAILABLE); - SendPacket (packet); + SendPacket(packet); - sLog->outDetail ("WorldSocket::HandleAuthSession: User tries to login but his security level is not enough"); + sLog->outDetail("WorldSocket::HandleAuthSession: User tries to login but his security level is not enough"); return -1; } @@ -1018,7 +1016,11 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) address.c_str()); // Check if this user is by any chance a recruiter - result = LoginDatabase.PQuery ("SELECT 1 FROM account WHERE recruiter = %u", id); + stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_RECRUITER); + + stmt->setUInt32(0, id); + + result = LoginDatabase.Query(stmt); bool isRecruiter = false; if (result) @@ -1026,7 +1028,7 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) // Update the last_ip in the database - PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_LAST_IP); + stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_LAST_IP); stmt->setString(0, address); stmt->setString(1, account); @@ -1109,7 +1111,7 @@ int WorldSocket::HandlePing (WorldPacket& recvPacket) m_Session->SetLatency (latency); else { - sLog->outError ("WorldSocket::HandlePing: peer sent CMSG_PING, " + sLog->outError("WorldSocket::HandlePing: peer sent CMSG_PING, " "but is not authenticated or got recently kicked, " " address = %s", GetRemoteAddress().c_str()); @@ -1119,5 +1121,5 @@ int WorldSocket::HandlePing (WorldPacket& recvPacket) WorldPacket packet (SMSG_PONG, 4); packet << ping; - return SendPacket (packet); + return SendPacket(packet); } diff --git a/src/server/game/Server/WorldSocket.h b/src/server/game/Server/WorldSocket.h index 375808db569..3a256c07095 100755 --- a/src/server/game/Server/WorldSocket.h +++ b/src/server/game/Server/WorldSocket.h @@ -108,7 +108,7 @@ class WorldSocket : public WorldHandler /// Send A packet on the socket, this function is reentrant. /// @param pct packet to send /// @return -1 of failure - int SendPacket (const WorldPacket& pct); + int SendPacket(const WorldPacket& pct); /// Add reference to this object. long AddReference (void); diff --git a/src/server/game/Server/WorldSocketMgr.cpp b/src/server/game/Server/WorldSocketMgr.cpp index 00a8b263847..d357651a5bf 100755 --- a/src/server/game/Server/WorldSocketMgr.cpp +++ b/src/server/game/Server/WorldSocketMgr.cpp @@ -236,7 +236,7 @@ WorldSocketMgr::StartReactiveIO (ACE_UINT16 port, const char* address) if (num_threads <= 0) { - sLog->outError ("Network.Threads is wrong in your config file"); + sLog->outError("Network.Threads is wrong in your config file"); return -1; } @@ -253,7 +253,7 @@ WorldSocketMgr::StartReactiveIO (ACE_UINT16 port, const char* address) if (m_SockOutUBuff <= 0) { - sLog->outError ("Network.OutUBuff is wrong in your config file"); + sLog->outError("Network.OutUBuff is wrong in your config file"); return -1; } @@ -263,7 +263,7 @@ WorldSocketMgr::StartReactiveIO (ACE_UINT16 port, const char* address) if (m_Acceptor->open(listen_addr, m_NetThreads[0].GetReactor(), ACE_NONBLOCK) == -1) { - sLog->outError ("Failed to open acceptor, check if the port is free"); + sLog->outError("Failed to open acceptor, check if the port is free"); return -1; } @@ -327,7 +327,7 @@ WorldSocketMgr::OnSocketOpen (WorldSocket* sock) (void*) & m_SockOutKBuff, sizeof (int)) == -1 && errno != ENOTSUP) { - sLog->outError ("WorldSocketMgr::OnSocketOpen set_option SO_SNDBUF"); + sLog->outError("WorldSocketMgr::OnSocketOpen set_option SO_SNDBUF"); return -1; } } @@ -342,7 +342,7 @@ WorldSocketMgr::OnSocketOpen (WorldSocket* sock) (void*)&ndoption, sizeof (int)) == -1) { - sLog->outError ("WorldSocketMgr::OnSocketOpen: peer().set_option TCP_NODELAY errno = %s", ACE_OS::strerror (errno)); + sLog->outError("WorldSocketMgr::OnSocketOpen: peer().set_option TCP_NODELAY errno = %s", ACE_OS::strerror (errno)); return -1; } } diff --git a/src/server/game/Skills/SkillDiscovery.cpp b/src/server/game/Skills/SkillDiscovery.cpp index 466d3ac83a2..e314fab07be 100755 --- a/src/server/game/Skills/SkillDiscovery.cpp +++ b/src/server/game/Skills/SkillDiscovery.cpp @@ -71,7 +71,7 @@ void LoadSkillDiscoveryTable() uint32 spellId = fields[0].GetUInt32(); int32 reqSkillOrSpell = fields[1].GetInt32(); - uint32 reqSkillValue = fields[2].GetUInt32(); + uint32 reqSkillValue = fields[2].GetUInt16(); float chance = fields[3].GetFloat(); if (chance <= 0) // chance @@ -132,7 +132,8 @@ void LoadSkillDiscoveryTable() } ++count; - } while (result->NextRow()); + } + while (result->NextRow()); if (!ssNonDiscoverableEntries.str().empty()) sLog->outErrorDb("Some items can't be successfully discovered: have in chance field value < 0.000001 in `skill_discovery_template` DB table . List:\n%s", ssNonDiscoverableEntries.str().c_str()); @@ -246,4 +247,3 @@ uint32 GetSkillDiscoverySpell(uint32 skillId, uint32 spellId, Player* player) return 0; } - diff --git a/src/server/game/Skills/SkillDiscovery.h b/src/server/game/Skills/SkillDiscovery.h index 110adb91cf2..ba5542e0189 100755 --- a/src/server/game/Skills/SkillDiscovery.h +++ b/src/server/game/Skills/SkillDiscovery.h @@ -28,4 +28,3 @@ uint32 GetSkillDiscoverySpell(uint32 skillId, uint32 spellId, Player* player); bool HasDiscoveredAllSpells(uint32 spellId, Player* player); uint32 GetExplicitDiscoverySpell(uint32 spellId, Player* player); #endif - diff --git a/src/server/game/Skills/SkillExtraItems.cpp b/src/server/game/Skills/SkillExtraItems.cpp index b5b6b5d7b96..3bb435145f1 100755 --- a/src/server/game/Skills/SkillExtraItems.cpp +++ b/src/server/game/Skills/SkillExtraItems.cpp @@ -55,7 +55,7 @@ void LoadSkillExtraItemTable() SkillExtraItemStore.clear(); // need for reload - // 0 1 2 3 + // 0 1 2 3 QueryResult result = WorldDatabase.Query("SELECT spellId, requiredSpecialization, additionalCreateChance, additionalMaxNum FROM skill_extra_item_template"); if (!result) @@ -138,4 +138,3 @@ bool canCreateExtraItems(Player* player, uint32 spellId, float &additionalChance // enable extra item creation return true; } - diff --git a/src/server/game/Skills/SkillExtraItems.h b/src/server/game/Skills/SkillExtraItems.h index c4e20b9fbef..0cf49021e1c 100755 --- a/src/server/game/Skills/SkillExtraItems.h +++ b/src/server/game/Skills/SkillExtraItems.h @@ -28,4 +28,3 @@ bool canCreateExtraItems(Player* player, uint32 spellId, float &additionalChance // function to load the extra item creation info from DB void LoadSkillExtraItemTable(); #endif - diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 273fcb4f049..200007c3190 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -536,7 +536,7 @@ int32 AuraEffect::CalculateAmount(Unit* caster) if (GetSpellInfo()->SpellFamilyFlags[1] & 0x1 && GetSpellInfo()->SpellFamilyFlags[2] & 0x8) { // +80.68% from sp bonus - DoneActualBenefit += caster->SpellBaseDamageBonus(m_spellInfo->GetSchoolMask()) * 0.8068f; + DoneActualBenefit += caster->SpellBaseDamageBonusDone(m_spellInfo->GetSchoolMask()) * 0.8068f; // Glyph of Ice Barrier: its weird having a SPELLMOD_ALL_EFFECTS here but its blizzards doing :) // Glyph of Ice Barrier is only applied at the spell damage bonus because it was already applied to the base value in CalculateSpellDamage DoneActualBenefit = caster->ApplyEffectModifiers(GetSpellInfo(), m_effIndex, DoneActualBenefit); @@ -545,13 +545,13 @@ int32 AuraEffect::CalculateAmount(Unit* caster) else if (GetSpellInfo()->SpellFamilyFlags[0] & 0x8 && GetSpellInfo()->SpellFamilyFlags[2] & 0x8) { // +80.68% from sp bonus - DoneActualBenefit += caster->SpellBaseDamageBonus(m_spellInfo->GetSchoolMask()) * 0.8068f; + DoneActualBenefit += caster->SpellBaseDamageBonusDone(m_spellInfo->GetSchoolMask()) * 0.8068f; } // Frost Ward else if (GetSpellInfo()->SpellFamilyFlags[0] & 0x100 && GetSpellInfo()->SpellFamilyFlags[2] & 0x8) { // +80.68% from sp bonus - DoneActualBenefit += caster->SpellBaseDamageBonus(m_spellInfo->GetSchoolMask()) * 0.8068f; + DoneActualBenefit += caster->SpellBaseDamageBonusDone(m_spellInfo->GetSchoolMask()) * 0.8068f; } break; case SPELLFAMILY_WARLOCK: @@ -559,7 +559,7 @@ int32 AuraEffect::CalculateAmount(Unit* caster) if (m_spellInfo->SpellFamilyFlags[2] & 0x40) { // +80.68% from sp bonus - DoneActualBenefit += caster->SpellBaseDamageBonus(m_spellInfo->GetSchoolMask()) * 0.8068f; + DoneActualBenefit += caster->SpellBaseDamageBonusDone(m_spellInfo->GetSchoolMask()) * 0.8068f; } break; case SPELLFAMILY_PRIEST: @@ -573,7 +573,7 @@ int32 AuraEffect::CalculateAmount(Unit* caster) if (AuraEffect const* pAurEff = caster->GetDummyAuraEffect(SPELLFAMILY_PRIEST, 2899, 1)) bonus += CalculatePctN(1.0f, pAurEff->GetAmount()); - DoneActualBenefit += caster->SpellBaseHealingBonus(m_spellInfo->GetSchoolMask()) * bonus; + DoneActualBenefit += caster->SpellBaseHealingBonusDone(m_spellInfo->GetSchoolMask()) * bonus; // Improved PW: Shield: its weird having a SPELLMOD_ALL_EFFECTS here but its blizzards doing :) // Improved PW: Shield is only applied at the spell healing bonus because it was already applied to the base value in CalculateSpellDamage DoneActualBenefit = caster->ApplyEffectModifiers(GetSpellInfo(), m_effIndex, DoneActualBenefit); @@ -601,7 +601,7 @@ int32 AuraEffect::CalculateAmount(Unit* caster) //+75.00% from sp bonus float bonus = 0.75f; - DoneActualBenefit += caster->SpellBaseHealingBonus(m_spellInfo->GetSchoolMask()) * bonus; + DoneActualBenefit += caster->SpellBaseHealingBonusDone(m_spellInfo->GetSchoolMask()) * bonus; // Divine Guardian is only applied at the spell healing bonus because it was already applied to the base value in CalculateSpellDamage DoneActualBenefit = caster->ApplyEffectModifiers(GetSpellInfo(), m_effIndex, DoneActualBenefit); DoneActualBenefit *= caster->CalculateLevelPenalty(GetSpellInfo()); @@ -630,7 +630,7 @@ int32 AuraEffect::CalculateAmount(Unit* caster) if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_MAGE && GetSpellInfo()->SpellFamilyFlags[0] & 0x8000 && m_spellInfo->SpellFamilyFlags[2] & 0x8) { // +80.53% from +spd bonus - DoneActualBenefit += caster->SpellBaseDamageBonus(m_spellInfo->GetSchoolMask()) * 0.8053f;; + DoneActualBenefit += caster->SpellBaseDamageBonusDone(m_spellInfo->GetSchoolMask()) * 0.8053f; } break; case SPELL_AURA_DUMMY: @@ -638,7 +638,10 @@ int32 AuraEffect::CalculateAmount(Unit* caster) break; // Earth Shield if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_SHAMAN && m_spellInfo->SpellFamilyFlags[1] & 0x400) - amount = caster->SpellHealingBonus(GetBase()->GetUnitOwner(), GetSpellInfo(), amount, SPELL_DIRECT_DAMAGE); + { + amount = caster->SpellHealingBonusDone(GetBase()->GetUnitOwner(), GetSpellInfo(), amount, SPELL_DIRECT_DAMAGE); + amount = GetBase()->GetUnitOwner()->SpellHealingBonusTaken(caster, GetSpellInfo(), amount, SPELL_DIRECT_DAMAGE); + } break; case SPELL_AURA_PERIODIC_DAMAGE: if (!caster) @@ -703,19 +706,23 @@ int32 AuraEffect::CalculateAmount(Unit* caster) } break; case SPELL_AURA_PERIODIC_ENERGIZE: - if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_GENERIC) + switch (m_spellInfo->Id) { - // Replenishment (0.25% from max) - // Infinite Replenishment - if (m_spellInfo->SpellIconID == 3184 && m_spellInfo->SpellVisual[0] == 12495) - amount = GetBase()->GetUnitOwner()->GetMaxPower(POWER_MANA) * 25 / 10000; - } - // Innervate - else if (m_spellInfo->Id == 29166) + case 57669: // Replenishment (0.2% from max) + amount = GetBase()->GetUnitOwner()->GetMaxPower(POWER_MANA) * 0.002f; + break; + case 61782: // Infinite Replenishment + amount = GetBase()->GetUnitOwner()->GetMaxPower(POWER_MANA) * 0.0025f; + break; + case 29166: // Innervate ApplyPctF(amount, float(GetBase()->GetUnitOwner()->GetCreatePowers(POWER_MANA)) / GetTotalTicks()); - // Owlkin Frenzy - else if (m_spellInfo->Id == 48391) + break; + case 48391: // Owlkin Frenzy ApplyPctU(amount, GetBase()->GetUnitOwner()->GetCreatePowers(POWER_MANA)); + break; + default: + break; + } break; case SPELL_AURA_PERIODIC_HEAL: if (!caster) @@ -983,6 +990,7 @@ void AuraEffect::ChangeAmount(int32 newAmount, bool mark, bool onStackOrReapply) handleMask |= AURA_EFFECT_HANDLE_CHANGE_AMOUNT; if (onStackOrReapply) handleMask |= AURA_EFFECT_HANDLE_REAPPLY; + if (!handleMask) return; @@ -1281,12 +1289,11 @@ bool AuraEffect::IsPeriodicTickCrit(Unit* target, Unit const* caster) const if ((*itr)->IsAffectingSpell(m_spellInfo) && caster->isSpellCrit(target, m_spellInfo, m_spellInfo->GetSchoolMask())) return true; } + // Rupture - since 3.3.3 can crit - if (target->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_ROGUE, 0x100000, 0x0, 0x0, caster->GetGUID())) - { - if (caster->isSpellCrit(target, m_spellInfo, m_spellInfo->GetSchoolMask())) - return true; - } + if (m_spellInfo->SpellIconID == 500 && m_spellInfo->SpellFamilyName == SPELLFAMILY_ROGUE) + return caster->isSpellCrit(target, m_spellInfo, m_spellInfo->GetSchoolMask()); + return false; } @@ -1512,13 +1519,36 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const const PlayerSpellMap& sp_list = target->ToPlayer()->GetSpellMap(); for (PlayerSpellMap::const_iterator itr = sp_list.begin(); itr != sp_list.end(); ++itr) { - if (itr->second->state == PLAYERSPELL_REMOVED || itr->second->disabled) continue; - if (itr->first == spellId || itr->first == spellId2) continue; + if (itr->second->state == PLAYERSPELL_REMOVED || itr->second->disabled) + continue; + + if (itr->first == spellId || itr->first == spellId2) + continue; + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first); - if (!spellInfo || !(spellInfo->Attributes & (SPELL_ATTR0_PASSIVE | SPELL_ATTR0_HIDDEN_CLIENTSIDE))) continue; + if (!spellInfo || !(spellInfo->Attributes & (SPELL_ATTR0_PASSIVE | SPELL_ATTR0_HIDDEN_CLIENTSIDE))) + continue; + if (spellInfo->Stances & (1<<(GetMiscValue()-1))) target->CastSpell(target, itr->first, true, NULL, this); } + + // Also do it for Glyphs + for (uint32 i = 0; i < MAX_GLYPH_SLOT_INDEX; ++i) + { + if (uint32 glyphId = target->ToPlayer()->GetGlyph(i)) + { + if (GlyphPropertiesEntry const* glyph = sGlyphPropertiesStore.LookupEntry(glyphId)) + { + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(glyph->SpellId); + if (!spellInfo || !(spellInfo->Attributes & (SPELL_ATTR0_PASSIVE | SPELL_ATTR0_HIDDEN_CLIENTSIDE))) + continue; + if (spellInfo->Stances & (1<<(GetMiscValue()-1))) + target->CastSpell(target, glyph->SpellId, true, NULL, this); + } + } + } + // Leader of the Pack if (target->ToPlayer()->HasSpell(17007)) { @@ -1628,10 +1658,25 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const } } + const Unit::AuraEffectList& shapeshifts = target->GetAuraEffectsByType(SPELL_AURA_MOD_SHAPESHIFT); + AuraEffect* newAura = NULL; + // Iterate through all the shapeshift auras that the target has, if there is another aura with SPELL_AURA_MOD_SHAPESHIFT, then this aura is being removed due to that one being applied + for (Unit::AuraEffectList::const_iterator itr = shapeshifts.begin(); itr != shapeshifts.end(); ++itr) + { + if ((*itr) != this) + { + newAura = *itr; + break; + } + } Unit::AuraApplicationMap& tAuras = target->GetAppliedAuras(); for (Unit::AuraApplicationMap::iterator itr = tAuras.begin(); itr != tAuras.end();) { - if (itr->second->GetBase()->IsRemovedOnShapeLost(target)) + // Use the new aura to see on what stance the target will be + uint32 newStance = (1<<((newAura ? newAura->GetMiscValue() : 0)-1)); + + // If the stances are not compatible with the spell, remove it + if (itr->second->GetBase()->IsRemovedOnShapeLost(target) && !(itr->second->GetBase()->GetSpellInfo()->Stances & newStance)) target->RemoveAura(itr); else ++itr; @@ -2119,7 +2164,9 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mo PlayerSpellMap const& sp_list = target->ToPlayer()->GetSpellMap(); for (PlayerSpellMap::const_iterator itr = sp_list.begin(); itr != sp_list.end(); ++itr) { - if (itr->second->state == PLAYERSPELL_REMOVED || itr->second->disabled) continue; + if (itr->second->state == PLAYERSPELL_REMOVED || itr->second->disabled) + continue; + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first); if (spellInfo && spellInfo->SpellFamilyName == SPELLFAMILY_WARRIOR && spellInfo->SpellIconID == 139) Rage_val += target->CalculateSpellDamage(target, spellInfo, 0) * 10; @@ -2428,7 +2475,7 @@ void AuraEffect::HandleAuraCloneCaster(AuraApplication const* aurApp, uint8 mode // What must be cloned? at least display and scale target->SetDisplayId(caster->GetDisplayId()); - //target->SetFloatValue(OBJECT_FIELD_SCALE_X, caster->GetFloatValue(OBJECT_FIELD_SCALE_X)); // we need retail info about how scaling is handled (aura maybe?) + //target->SetObjectScale(caster->GetFloatValue(OBJECT_FIELD_SCALE_X)); // we need retail info about how scaling is handled (aura maybe?) target->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_MIRROR_IMAGE); } else @@ -2904,14 +2951,23 @@ void AuraEffect::HandleAuraAllowFlight(AuraApplication const* aurApp, uint8 mode return; } - if (target->GetTypeId() == TYPEID_UNIT) - target->SetFlying(apply); - - if (Player* player = target->m_movedPlayer) + //! Not entirely sure if this should be sent for creatures as well, but I don't think so. + target->SetCanFly(apply); + if (!apply) { - // allow flying - player->SendSetFlyPacket(apply); + target->RemoveUnitMovementFlag(MOVEMENTFLAG_MASK_MOVING_FLY); + target->GetMotionMaster()->MoveFall(); } + + Player* player = target->ToPlayer(); + if (!player) + player = target->m_movedPlayer; + + if (player) + player->SendMovementCanFlyChange(); + + //! We still need to initiate a server-side MoveFall here, + //! which requires MSG_MOVE_FALL_LAND on landing. } void AuraEffect::HandleAuraWaterWalk(AuraApplication const* aurApp, uint8 mode, bool apply) const @@ -2928,14 +2984,12 @@ void AuraEffect::HandleAuraWaterWalk(AuraApplication const* aurApp, uint8 mode, return; } - WorldPacket data; if (apply) - data.Initialize(SMSG_MOVE_SPLINE_SET_WATER_WALK, 8+4); + target->AddUnitMovementFlag(MOVEMENTFLAG_WATERWALKING); else - data.Initialize(SMSG_MOVE_SPLINE_SET_LAND_WALK, 8+4); - data.append(target->GetPackGUID()); - data << uint32(0); - target->SendMessageToSet(&data, true); + target->RemoveUnitMovementFlag(MOVEMENTFLAG_WATERWALKING); + + target->SendMovementWaterWalking(); } void AuraEffect::HandleAuraFeatherFall(AuraApplication const* aurApp, uint8 mode, bool apply) const @@ -2952,14 +3006,12 @@ void AuraEffect::HandleAuraFeatherFall(AuraApplication const* aurApp, uint8 mode return; } - WorldPacket data; if (apply) - data.Initialize(SMSG_MOVE_SPLINE_SET_FEATHER_FALL, 8+4); + target->AddUnitMovementFlag(MOVEMENTFLAG_FALLING_SLOW); else - data.Initialize(SMSG_MOVE_SPLINE_SET_NORMAL_FALL, 8+4); - data.append(target->GetPackGUID()); - data << uint32(0); - target->SendMessageToSet(&data, true); + target->RemoveUnitMovementFlag(MOVEMENTFLAG_FALLING_SLOW); + + target->SendMovementFeatherFall(); // start fall from current height if (!apply && target->GetTypeId() == TYPEID_PLAYER) @@ -2980,14 +3032,8 @@ void AuraEffect::HandleAuraHover(AuraApplication const* aurApp, uint8 mode, bool return; } - WorldPacket data; - if (apply) - data.Initialize(SMSG_MOVE_SPLINE_SET_HOVER, 8+4); - else - data.Initialize(SMSG_MOVE_SPLINE_UNSET_HOVER, 8+4); - data.append(target->GetPackGUID()); - data << uint32(0); - target->SendMessageToSet(&data, true); + target->SetHover(apply); //! Sets movementflags + target->SendMovementHover(); } void AuraEffect::HandleWaterBreathing(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const @@ -3293,16 +3339,30 @@ void AuraEffect::HandleAuraModIncreaseFlightSpeed(AuraApplication const* aurApp, Unit* target = aurApp->GetTarget(); - // Enable Fly mode for flying mounts + //! Update ability to fly if (GetAuraType() == SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) { // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit if (mode & AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK && (apply || (!target->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) && !target->HasAuraType(SPELL_AURA_FLY)))) { - if (Player* player = target->m_movedPlayer) - player->SendSetFlyPacket(apply); + target->SetCanFly(apply); + if (!apply) + target->RemoveUnitMovementFlag(MOVEMENTFLAG_FLYING); + target->AddUnitMovementFlag(MOVEMENTFLAG_FALLING); + target->m_movementInfo.SetFallTime(0); + + Player* player = target->ToPlayer(); + if (!player) + player = target->m_movedPlayer; + + if (player) + player->SendMovementCanFlyChange(); + + //! We still need to initiate a server-side MoveFall here, + //! which requires MSG_MOVE_FALL_LAND on landing. } + //! Someone should clean up these hacks and remove it from this function. It doesn't even belong here. if (mode & AURA_EFFECT_HANDLE_REAL) { //Players on flying mounts must be immune to polymorph @@ -3514,7 +3574,7 @@ void AuraEffect::HandleAuraModSchoolImmunity(AuraApplication const* aurApp, uint { bool banishFound = false; Unit::AuraEffectList const& banishAuras = target->GetAuraEffectsByType(GetAuraType()); - for (Unit::AuraEffectList::const_iterator i = banishAuras.begin(); i != banishAuras.end(); ++i) + for (Unit::AuraEffectList::const_iterator i = banishAuras.begin(); i != banishAuras.end(); ++i) if ((*i)->GetSpellInfo()->Mechanic == MECHANIC_BANISH) { banishFound = true; @@ -4621,7 +4681,7 @@ void AuraEffect::HandleNoReagentUseAura(AuraApplication const* aurApp, uint8 mod flag96 mask; Unit::AuraEffectList const& noReagent = target->GetAuraEffectsByType(SPELL_AURA_NO_REAGENT_USE); - for (Unit::AuraEffectList::const_iterator i = noReagent.begin(); i != noReagent.end(); ++i) + for (Unit::AuraEffectList::const_iterator i = noReagent.begin(); i != noReagent.end(); ++i) mask |= (*i)->m_spellInfo->Effects[(*i)->m_effIndex].SpellClassMask; target->SetUInt32Value(PLAYER_NO_REAGENT_COST_1 , mask[0]); @@ -4724,11 +4784,11 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool if (owner_aura) { owner_aura->SetStackAmount(owner_aura->GetSpellInfo()->StackAmount); - } - if (pet_aura) - { - pet_aura->SetCharges(0); - pet_aura->SetStackAmount(owner_aura->GetSpellInfo()->StackAmount); + if (pet_aura) + { + pet_aura->SetCharges(0); + pet_aura->SetStackAmount(owner_aura->GetSpellInfo()->StackAmount); + } } break; } @@ -4791,11 +4851,6 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool if (caster) target->GetMotionMaster()->MoveFall(); break; - case 49028: - if (caster) - if (AuraEffect* aurEff = caster->GetAuraEffect(63330, 0)) // glyph of Dancing Rune Weapon - GetBase()->SetDuration(GetBase()->GetDuration() + aurEff->GetAmount()); - break; case 52916: // Honor Among Thieves if (target->GetTypeId() == TYPEID_PLAYER) if (Unit* spellTarget = ObjectAccessor::GetUnit(*target, target->ToPlayer()->GetComboTarget())) @@ -4961,7 +5016,13 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool // final heal int32 stack = GetBase()->GetStackAmount(); - target->CastCustomSpell(target, 33778, &m_amount, &stack, NULL, true, NULL, this, GetCasterGUID()); + int32 heal = m_amount; + if (caster) + { + heal = caster->SpellHealingBonusDone(target, GetSpellInfo(), heal, HEAL, stack); + heal = target->SpellHealingBonusTaken(caster, GetSpellInfo(), heal, HEAL, stack); + } + target->CastCustomSpell(target, 33778, &heal, &stack, NULL, true, NULL, this, GetCasterGUID()); // restore mana if (caster) @@ -4971,18 +5032,6 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool } } break; - case SPELLFAMILY_HUNTER: - switch (GetId()) - { - case 34477: // Misdirection - if (aurApp->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE) - target->SetReducedThreatPercent(0, 0); - break; - case 35079: // Misdirection proc - target->SetReducedThreatPercent(0, 0); - break; - } - break; case SPELLFAMILY_DEATHKNIGHT: // Summon Gargoyle (Dismiss Gargoyle at remove) if (GetId() == 61777) @@ -5224,7 +5273,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool target->CastCustomSpell(target, 50322, &bp0, NULL, NULL, true); } else - target-> RemoveAurasDueToSpell(50322); + target->RemoveAurasDueToSpell(50322); break; } } @@ -5275,66 +5324,63 @@ void AuraEffect::HandleChannelDeathItem(AuraApplication const* aurApp, uint8 mod if (!(mode & AURA_EFFECT_HANDLE_REAL)) return; - if (!apply) - { - Unit* caster = GetCaster(); + if (apply || aurApp->GetRemoveMode() != AURA_REMOVE_BY_DEATH) + return; - if (!caster || caster->GetTypeId() != TYPEID_PLAYER) - return; + Unit* caster = GetCaster(); - Player* plCaster = caster->ToPlayer(); - Unit* target = aurApp->GetTarget(); + if (!caster || caster->GetTypeId() != TYPEID_PLAYER) + return; - if (target->getDeathState() != JUST_DIED) - return; + Player* plCaster = caster->ToPlayer(); + Unit* target = aurApp->GetTarget(); - // Item amount - if (GetAmount() <= 0) - return; + // Item amount + if (GetAmount() <= 0) + return; + + if (GetSpellInfo()->Effects[m_effIndex].ItemType == 0) + return; - if (GetSpellInfo()->Effects[m_effIndex].ItemType == 0) + // Soul Shard + if (GetSpellInfo()->Effects[m_effIndex].ItemType == 6265) + { + // Soul Shard only from units that grant XP or honor + if (!plCaster->isHonorOrXPTarget(target) || + (target->GetTypeId() == TYPEID_UNIT && !target->ToCreature()->isTappedBy(plCaster))) return; - // Soul Shard - if (GetSpellInfo()->Effects[m_effIndex].ItemType == 6265) + // If this is Drain Soul, check for Glyph of Drain Soul + if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_WARLOCK && (GetSpellInfo()->SpellFamilyFlags[0] & 0x00004000)) { - // Soul Shard only from units that grant XP or honor - if (!plCaster->isHonorOrXPTarget(target) || - (target->GetTypeId() == TYPEID_UNIT && !target->ToCreature()->isTappedBy(plCaster))) - return; - - // If this is Drain Soul, check for Glyph of Drain Soul - if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_WARLOCK && (GetSpellInfo()->SpellFamilyFlags[0] & 0x00004000)) - { - // Glyph of Drain Soul - chance to create an additional Soul Shard - if (AuraEffect* aur = caster->GetAuraEffect(58070, 0)) - if (roll_chance_i(aur->GetMiscValue())) - caster->CastSpell(caster, 58068, true, 0, aur); // We _could_ simply do ++count here, but Blizz does it this way :) - } + // Glyph of Drain Soul - chance to create an additional Soul Shard + if (AuraEffect* aur = caster->GetAuraEffect(58070, 0)) + if (roll_chance_i(aur->GetMiscValue())) + caster->CastSpell(caster, 58068, true, 0, aur); // We _could_ simply do ++count here, but Blizz does it this way :) } + } - //Adding items - uint32 noSpaceForCount = 0; - uint32 count = m_amount; + //Adding items + uint32 noSpaceForCount = 0; + uint32 count = m_amount; - ItemPosCountVec dest; - InventoryResult msg = plCaster->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, GetSpellInfo()->Effects[m_effIndex].ItemType, count, &noSpaceForCount); - if (msg != EQUIP_ERR_OK) - { - count-=noSpaceForCount; - plCaster->SendEquipError(msg, NULL, NULL, GetSpellInfo()->Effects[m_effIndex].ItemType); - if (count == 0) - return; - } - - Item* newitem = plCaster->StoreNewItem(dest, GetSpellInfo()->Effects[m_effIndex].ItemType, true); - if (!newitem) - { - plCaster->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL); + ItemPosCountVec dest; + InventoryResult msg = plCaster->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, GetSpellInfo()->Effects[m_effIndex].ItemType, count, &noSpaceForCount); + if (msg != EQUIP_ERR_OK) + { + count-=noSpaceForCount; + plCaster->SendEquipError(msg, NULL, NULL, GetSpellInfo()->Effects[m_effIndex].ItemType); + if (count == 0) return; - } - plCaster->SendNewItem(newitem, count, true, true); } + + Item* newitem = plCaster->StoreNewItem(dest, GetSpellInfo()->Effects[m_effIndex].ItemType, true); + if (!newitem) + { + plCaster->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL); + return; + } + plCaster->SendNewItem(newitem, count, true, true); } void AuraEffect::HandleBindSight(AuraApplication const* aurApp, uint8 mode, bool apply) const @@ -5661,21 +5707,6 @@ void AuraEffect::HandlePeriodicDummyAuraTick(Unit* target, Unit* caster) const caster->CastCustomSpell(66153, SPELLVALUE_MAX_TARGETS, urand(1, 6), target, true); break; } - case 54798: // FLAMING Arrow Triggered Effect - { - if (!caster || !target || !target->ToCreature() || !caster->GetVehicle() || target->HasAura(54683)) - break; - - target->CastSpell(target, 54683, true); - - // Credit Frostworgs - if (target->GetEntry() == 29358) - caster->CastSpell(caster, 54896, true); - // Credit Frost Giants - else if (target->GetEntry() == 29351) - caster->CastSpell(caster, 54893, true); - break; - } case 62292: // Blaze (Pool of Tar) // should we use custom damage? target->CastSpell((Unit*)NULL, m_spellInfo->Effects[m_effIndex].TriggerSpell, true); @@ -5705,27 +5736,6 @@ void AuraEffect::HandlePeriodicDummyAuraTick(Unit* target, Unit* caster) const target->CastSpell((Unit*)NULL, m_spellInfo->Effects[m_effIndex].TriggerSpell, true); break; } - case SPELLFAMILY_WARLOCK: - { - switch (GetSpellInfo()->Id) - { - // Demonic Circle - case 48018: - if (GameObject* obj = target->GetGameObject(GetSpellInfo()->Id)) - { - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(48020); - if (target->IsWithinDist(obj, spellInfo->GetMaxRange(true))) - { - if (!target->HasAura(62388)) - target->CastSpell(target, 62388, true); - } - else - target->RemoveAura(62388); - } - break; - } - break; - } case SPELLFAMILY_DRUID: { switch (GetSpellInfo()->Id) @@ -5785,7 +5795,7 @@ void AuraEffect::HandlePeriodicDummyAuraTick(Unit* target, Unit* caster) const if (targets.empty()) return; - Unit* spellTarget = SelectRandomContainerElement(targets); + Unit* spellTarget = Trinity::Containers::SelectRandomContainerElement(targets); target->CastSpell(spellTarget, 57840, true); target->CastSpell(spellTarget, 57841, true); @@ -5949,15 +5959,15 @@ void AuraEffect::HandlePeriodicTriggerSpellAuraTick(Unit* target, Unit* caster) // move loot to player inventory and despawn target if (caster && caster->GetTypeId() == TYPEID_PLAYER && target->GetTypeId() == TYPEID_UNIT && - target->ToCreature()->GetCreatureInfo()->type == CREATURE_TYPE_GAS_CLOUD) + target->ToCreature()->GetCreatureTemplate()->type == CREATURE_TYPE_GAS_CLOUD) { Player* player = caster->ToPlayer(); Creature* creature = target->ToCreature(); // missing lootid has been reported on startup - just return - if (!creature->GetCreatureInfo()->SkinLootId) + if (!creature->GetCreatureTemplate()->SkinLootId) return; - player->AutoStoreLoot(creature->GetCreatureInfo()->SkinLootId, LootTemplates_Skinning, true); + player->AutoStoreLoot(creature->GetCreatureTemplate()->SkinLootId, LootTemplates_Skinning, true); creature->DespawnOrUnsummon(); } @@ -6232,14 +6242,15 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const uint32 absorb = 0; uint32 resist = 0; - CleanDamage cleanDamage = CleanDamage(0, 0, BASE_ATTACK, MELEE_HIT_NORMAL); + CleanDamage cleanDamage = CleanDamage(0, 0, BASE_ATTACK, MELEE_HIT_NORMAL); // ignore non positive values (can be result apply spellmods to aura damage uint32 damage = std::max(GetAmount(), 0); if (GetAuraType() == SPELL_AURA_PERIODIC_DAMAGE) { - damage = caster->SpellDamageBonus(target, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount()); + damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount()); + damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount()); // Calculate armor mitigation if (Unit::IsDamageReducedByArmor(GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), GetEffIndex())) @@ -6331,7 +6342,7 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) const { - if (!caster || !caster->isAlive() || !target->isAlive()) + if (!caster || !target->isAlive()) return; if (target->HasUnitState(UNIT_STATE_ISOLATED) || target->IsImmunedToDamage(GetSpellInfo())) @@ -6349,7 +6360,9 @@ void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) c CleanDamage cleanDamage = CleanDamage(0, 0, BASE_ATTACK, MELEE_HIT_NORMAL); uint32 damage = std::max(GetAmount(), 0); - damage = caster->SpellDamageBonus(target, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount()); + + damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount()); + damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount()); bool crit = IsPeriodicTickCrit(target, caster); if (crit) @@ -6384,15 +6397,19 @@ void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) c damage = (damage <= absorb+resist) ? 0 : (damage-absorb-resist); if (damage) procVictim |= PROC_FLAG_TAKEN_DAMAGE; - caster->ProcDamageAndSpell(target, procAttacker, procVictim, procEx, damage, BASE_ATTACK, GetSpellInfo()); + if (caster->isAlive()) + caster->ProcDamageAndSpell(target, procAttacker, procVictim, procEx, damage, BASE_ATTACK, GetSpellInfo()); int32 new_damage = caster->DealDamage(target, damage, &cleanDamage, DOT, GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), false); + if (caster->isAlive()) + { + float gainMultiplier = GetSpellInfo()->Effects[GetEffIndex()].CalcValueMultiplier(caster); - float gainMultiplier = GetSpellInfo()->Effects[GetEffIndex()].CalcValueMultiplier(caster); - - uint32 heal = uint32(caster->SpellHealingBonus(caster, GetSpellInfo(), uint32(new_damage * gainMultiplier), DOT, GetBase()->GetStackAmount())); + uint32 heal = uint32(caster->SpellHealingBonusDone(caster, GetSpellInfo(), uint32(new_damage * gainMultiplier), DOT, GetBase()->GetStackAmount())); + heal = uint32(caster->SpellHealingBonusTaken(caster, GetSpellInfo(), heal, DOT, GetBase()->GetStackAmount())); - int32 gain = caster->HealBySpell(caster, GetSpellInfo(), heal); - caster->getHostileRefManager().threatAssist(caster, gain * 0.5f, GetSpellInfo()); + int32 gain = caster->HealBySpell(caster, GetSpellInfo(), heal); + caster->getHostileRefManager().threatAssist(caster, gain * 0.5f, GetSpellInfo()); + } } void AuraEffect::HandlePeriodicHealthFunnelAuraTick(Unit* target, Unit* caster) const @@ -6492,7 +6509,8 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const damage += addition; } - damage = caster->SpellHealingBonus(target, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount()); + damage = caster->SpellHealingBonusDone(target, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount()); + damage = target->SpellHealingBonusTaken(caster, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount()); } bool crit = IsPeriodicTickCrit(target, caster); @@ -6507,7 +6525,7 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const caster->CalcHealAbsorb(target, GetSpellInfo(), heal, absorb); int32 gain = caster->DealHeal(target, heal); - SpellPeriodicAuraLogInfo pInfo(this, damage, damage - gain, absorb, 0, 0.0f, crit); + SpellPeriodicAuraLogInfo pInfo(this, heal, heal - gain, absorb, 0, 0.0f, crit); target->SendPeriodicAuraLog(&pInfo); target->getHostileRefManager().threatAssist(caster, float(gain) * 0.5f, GetSpellInfo()); @@ -6518,14 +6536,14 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const // damage caster for heal amount if (target != caster && GetSpellInfo()->AttributesEx2 & SPELL_ATTR2_HEALTH_FUNNEL) { - uint32 funnelDamage = GetSpellInfo()->Effects[EFFECT_0].CalcValue(); // damage is not affected by spell power + uint32 funnelDamage = GetSpellInfo()->ManaPerSecond; // damage is not affected by spell power if ((int32)funnelDamage > gain) funnelDamage = gain; uint32 funnelAbsorb = 0; caster->DealDamageMods(caster, funnelDamage, &funnelAbsorb); caster->SendSpellNonMeleeDamageLog(caster, GetId(), funnelDamage, GetSpellInfo()->GetSchoolMask(), funnelAbsorb, 0, false, 0, false); - CleanDamage cleanDamage = CleanDamage(0, 0, BASE_ATTACK, MELEE_HIT_NORMAL); + CleanDamage cleanDamage = CleanDamage(0, 0, BASE_ATTACK, MELEE_HIT_NORMAL); caster->DealDamage(caster, funnelDamage, &cleanDamage, NODAMAGE, GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), true); } @@ -6782,7 +6800,8 @@ void AuraEffect::HandleProcTriggerDamageAuraProc(AuraApplication* aurApp, ProcEv Unit* target = aurApp->GetTarget(); Unit* triggerTarget = eventInfo.GetProcTarget(); SpellNonMeleeDamage damageInfo(target, triggerTarget, GetId(), GetSpellInfo()->SchoolMask); - uint32 damage = target->SpellDamageBonus(triggerTarget, GetSpellInfo(), GetAmount(), SPELL_DIRECT_DAMAGE); + uint32 damage = target->SpellDamageBonusDone(triggerTarget, GetSpellInfo(), GetAmount(), SPELL_DIRECT_DAMAGE); + damage = triggerTarget->SpellDamageBonusTaken(target, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE); target->CalculateSpellDamageTaken(&damageInfo, damage, GetSpellInfo()); target->DealDamageMods(damageInfo.target, damageInfo.damage, &damageInfo.absorb); target->SendSpellNonMeleeDamageLog(&damageInfo); diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index add50042aa5..ea25c0b76b5 100755 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -365,7 +365,7 @@ m_isRemoved(false), m_isSingleTarget(false), m_isUsingCharges(false) void Aura::_InitEffects(uint8 effMask, Unit* caster, int32 *baseAmount) { // shouldn't be in constructor - functions in AuraEffect::AuraEffect use polymorphism - for (uint8 i=0 ; isecond; + AuraApplication * aurApp = appItr->second; Unit* target = aurApp->GetTarget(); target->_UnapplyAura(aurApp, removeMode); appItr = m_applications.begin(); @@ -734,7 +734,8 @@ int32 Aura::CalcMaxDuration(Unit* caster) const if (IsPassive() && !m_spellInfo->DurationEntry) maxDuration = -1; - if (!IsPermanent() && modOwner) + // IsPermanent() checks max duration (which we are supposed to calculate here) + if (maxDuration != -1 && modOwner) modOwner->ApplySpellMod(GetId(), SPELLMOD_DURATION, maxDuration); return maxDuration; } @@ -1217,19 +1218,6 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b break; } break; - case SPELLFAMILY_WARLOCK: - switch (GetId()) - { - case 48020: // Demonic Circle - if (target->GetTypeId() == TYPEID_PLAYER) - if (GameObject* obj = target->GetGameObject(48018)) - { - target->NearTeleportTo(obj->GetPositionX(), obj->GetPositionY(), obj->GetPositionZ(), obj->GetOrientation()); - target->RemoveMovementImpairingAuras(); - } - break; - } - break; case SPELLFAMILY_PRIEST: if (!caster) break; @@ -1239,8 +1227,11 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b // Improved Devouring Plague if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_PRIEST, 3790, 1)) { - int32 basepoints0 = aurEff->GetAmount() * GetEffect(0)->GetTotalTicks() * caster->SpellDamageBonus(target, GetSpellInfo(), GetEffect(0)->GetAmount(), DOT) / 100; + uint32 damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), GetEffect(0)->GetAmount(), DOT); + damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, DOT); + int32 basepoints0 = aurEff->GetAmount() * GetEffect(0)->GetTotalTicks() * int32(damage) / 100; int32 heal = int32(CalculatePctN(basepoints0, 15)); + caster->CastCustomSpell(target, 63675, &basepoints0, NULL, NULL, true, NULL, GetEffect(0)); caster->CastCustomSpell(caster, 75999, &heal, NULL, NULL, true, NULL, GetEffect(0)); } @@ -1251,7 +1242,10 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b // Empowered Renew if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_PRIEST, 3021, 1)) { - int32 basepoints0 = aurEff->GetAmount() * GetEffect(0)->GetTotalTicks() * caster->SpellHealingBonus(target, GetSpellInfo(), GetEffect(0)->GetAmount(), HEAL) / 100; + uint32 damage = caster->SpellHealingBonusDone(target, GetSpellInfo(), GetEffect(0)->GetAmount(), HEAL); + damage = target->SpellHealingBonusTaken(caster, GetSpellInfo(), damage, HEAL); + + int32 basepoints0 = aurEff->GetAmount() * GetEffect(0)->GetTotalTicks() * int32(damage) / 100; caster->CastCustomSpell(target, 63544, &basepoints0, NULL, NULL, true, NULL, GetEffect(0)); } } @@ -1433,17 +1427,6 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b caster->CastSpell(target, spellId, true); } } - switch (GetId()) - { - case 48018: // Demonic Circle - // Do not remove GO when aura is removed by stack - // to prevent remove GO added by new spell - // old one is already removed - if (!onReapply) - target->RemoveGameObject(GetId(), true); - target->RemoveAura(62388); - break; - } break; case SPELLFAMILY_PRIEST: if (!caster) @@ -2081,7 +2064,7 @@ void Aura::_DeleteRemovedApplications() void Aura::LoadScripts() { sScriptMgr->CreateAuraScripts(m_spellInfo->Id, m_loadedScripts); - for (std::list::iterator itr = m_loadedScripts.begin(); itr != m_loadedScripts.end() ;) + for (std::list::iterator itr = m_loadedScripts.begin(); itr != m_loadedScripts.end();) { if (!(*itr)->_Load(this)) { @@ -2098,11 +2081,11 @@ void Aura::LoadScripts() bool Aura::CallScriptCheckAreaTargetHandlers(Unit* target) { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_CHECK_AREA_TARGET); std::list::iterator hookItrEnd = (*scritr)->DoCheckAreaTarget.end(), hookItr = (*scritr)->DoCheckAreaTarget.begin(); - for (; hookItr != hookItrEnd ; ++hookItr) + for (; hookItr != hookItrEnd; ++hookItr) if (!(*hookItr).Call(*scritr, target)) return false; (*scritr)->_FinishScriptCall(); @@ -2112,11 +2095,11 @@ bool Aura::CallScriptCheckAreaTargetHandlers(Unit* target) void Aura::CallScriptDispel(DispelInfo* dispelInfo) { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_DISPEL); std::list::iterator hookItrEnd = (*scritr)->OnDispel.end(), hookItr = (*scritr)->OnDispel.begin(); - for (; hookItr != hookItrEnd ; ++hookItr) + for (; hookItr != hookItrEnd; ++hookItr) (*hookItr).Call(*scritr, dispelInfo); (*scritr)->_FinishScriptCall(); } @@ -2124,11 +2107,11 @@ void Aura::CallScriptDispel(DispelInfo* dispelInfo) void Aura::CallScriptAfterDispel(DispelInfo* dispelInfo) { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_AFTER_DISPEL); std::list::iterator hookItrEnd = (*scritr)->AfterDispel.end(), hookItr = (*scritr)->AfterDispel.begin(); - for (; hookItr != hookItrEnd ; ++hookItr) + for (; hookItr != hookItrEnd; ++hookItr) (*hookItr).Call(*scritr, dispelInfo); (*scritr)->_FinishScriptCall(); } @@ -2137,11 +2120,11 @@ void Aura::CallScriptAfterDispel(DispelInfo* dispelInfo) bool Aura::CallScriptEffectApplyHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, AuraEffectHandleModes mode) { bool preventDefault = false; - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_APPLY, aurApp); std::list::iterator effEndItr = (*scritr)->OnEffectApply.end(), effItr = (*scritr)->OnEffectApply.begin(); - for (; effItr != effEndItr ; ++effItr) + for (; effItr != effEndItr; ++effItr) { if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex())) (*effItr).Call(*scritr, aurEff, mode); @@ -2156,11 +2139,11 @@ bool Aura::CallScriptEffectApplyHandlers(AuraEffect const* aurEff, AuraApplicati bool Aura::CallScriptEffectRemoveHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, AuraEffectHandleModes mode) { bool preventDefault = false; - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_REMOVE, aurApp); std::list::iterator effEndItr = (*scritr)->OnEffectRemove.end(), effItr = (*scritr)->OnEffectRemove.begin(); - for (; effItr != effEndItr ; ++effItr) + for (; effItr != effEndItr; ++effItr) { if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex())) (*effItr).Call(*scritr, aurEff, mode); @@ -2174,11 +2157,11 @@ bool Aura::CallScriptEffectRemoveHandlers(AuraEffect const* aurEff, AuraApplicat void Aura::CallScriptAfterEffectApplyHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, AuraEffectHandleModes mode) { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_AFTER_APPLY, aurApp); std::list::iterator effEndItr = (*scritr)->AfterEffectApply.end(), effItr = (*scritr)->AfterEffectApply.begin(); - for (; effItr != effEndItr ; ++effItr) + for (; effItr != effEndItr; ++effItr) { if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex())) (*effItr).Call(*scritr, aurEff, mode); @@ -2189,11 +2172,11 @@ void Aura::CallScriptAfterEffectApplyHandlers(AuraEffect const* aurEff, AuraAppl void Aura::CallScriptAfterEffectRemoveHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, AuraEffectHandleModes mode) { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_AFTER_REMOVE, aurApp); std::list::iterator effEndItr = (*scritr)->AfterEffectRemove.end(), effItr = (*scritr)->AfterEffectRemove.begin(); - for (; effItr != effEndItr ; ++effItr) + for (; effItr != effEndItr; ++effItr) { if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex())) (*effItr).Call(*scritr, aurEff, mode); @@ -2205,11 +2188,11 @@ void Aura::CallScriptAfterEffectRemoveHandlers(AuraEffect const* aurEff, AuraApp bool Aura::CallScriptEffectPeriodicHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp) { bool preventDefault = false; - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_PERIODIC, aurApp); std::list::iterator effEndItr = (*scritr)->OnEffectPeriodic.end(), effItr = (*scritr)->OnEffectPeriodic.begin(); - for (; effItr != effEndItr ; ++effItr) + for (; effItr != effEndItr; ++effItr) { if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex())) (*effItr).Call(*scritr, aurEff); @@ -2223,11 +2206,11 @@ bool Aura::CallScriptEffectPeriodicHandlers(AuraEffect const* aurEff, AuraApplic void Aura::CallScriptEffectUpdatePeriodicHandlers(AuraEffect* aurEff) { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_UPDATE_PERIODIC); std::list::iterator effEndItr = (*scritr)->OnEffectUpdatePeriodic.end(), effItr = (*scritr)->OnEffectUpdatePeriodic.begin(); - for (; effItr != effEndItr ; ++effItr) + for (; effItr != effEndItr; ++effItr) { if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex())) (*effItr).Call(*scritr, aurEff); @@ -2238,11 +2221,11 @@ void Aura::CallScriptEffectUpdatePeriodicHandlers(AuraEffect* aurEff) void Aura::CallScriptEffectCalcAmountHandlers(AuraEffect const* aurEff, int32 & amount, bool & canBeRecalculated) { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_CALC_AMOUNT); std::list::iterator effEndItr = (*scritr)->DoEffectCalcAmount.end(), effItr = (*scritr)->DoEffectCalcAmount.begin(); - for (; effItr != effEndItr ; ++effItr) + for (; effItr != effEndItr; ++effItr) { if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex())) (*effItr).Call(*scritr, aurEff, amount, canBeRecalculated); @@ -2253,11 +2236,11 @@ void Aura::CallScriptEffectCalcAmountHandlers(AuraEffect const* aurEff, int32 & void Aura::CallScriptEffectCalcPeriodicHandlers(AuraEffect const* aurEff, bool & isPeriodic, int32 & amplitude) { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_CALC_PERIODIC); std::list::iterator effEndItr = (*scritr)->DoEffectCalcPeriodic.end(), effItr = (*scritr)->DoEffectCalcPeriodic.begin(); - for (; effItr != effEndItr ; ++effItr) + for (; effItr != effEndItr; ++effItr) { if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex())) (*effItr).Call(*scritr, aurEff, isPeriodic, amplitude); @@ -2268,11 +2251,11 @@ void Aura::CallScriptEffectCalcPeriodicHandlers(AuraEffect const* aurEff, bool & void Aura::CallScriptEffectCalcSpellModHandlers(AuraEffect const* aurEff, SpellModifier* & spellMod) { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_CALC_SPELLMOD); std::list::iterator effEndItr = (*scritr)->DoEffectCalcSpellMod.end(), effItr = (*scritr)->DoEffectCalcSpellMod.begin(); - for (; effItr != effEndItr ; ++effItr) + for (; effItr != effEndItr; ++effItr) { if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex())) (*effItr).Call(*scritr, aurEff, spellMod); @@ -2281,28 +2264,29 @@ void Aura::CallScriptEffectCalcSpellModHandlers(AuraEffect const* aurEff, SpellM } } -void Aura::CallScriptEffectAbsorbHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount, bool & /*defaultPrevented*/) +void Aura::CallScriptEffectAbsorbHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount, bool& defaultPrevented) { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_ABSORB, aurApp); std::list::iterator effEndItr = (*scritr)->OnEffectAbsorb.end(), effItr = (*scritr)->OnEffectAbsorb.begin(); - for (; effItr != effEndItr ; ++effItr) + for (; effItr != effEndItr; ++effItr) { if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex())) (*effItr).Call(*scritr, aurEff, dmgInfo, absorbAmount); } + defaultPrevented = (*scritr)->_IsDefaultActionPrevented(); (*scritr)->_FinishScriptCall(); } } void Aura::CallScriptEffectAfterAbsorbHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount) { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_AFTER_ABSORB, aurApp); std::list::iterator effEndItr = (*scritr)->AfterEffectAbsorb.end(), effItr = (*scritr)->AfterEffectAbsorb.begin(); - for (; effItr != effEndItr ; ++effItr) + for (; effItr != effEndItr; ++effItr) { if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex())) (*effItr).Call(*scritr, aurEff, dmgInfo, absorbAmount); @@ -2313,11 +2297,11 @@ void Aura::CallScriptEffectAfterAbsorbHandlers(AuraEffect* aurEff, AuraApplicati void Aura::CallScriptEffectManaShieldHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount, bool & /*defaultPrevented*/) { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_MANASHIELD, aurApp); std::list::iterator effEndItr = (*scritr)->OnEffectManaShield.end(), effItr = (*scritr)->OnEffectManaShield.begin(); - for (; effItr != effEndItr ; ++effItr) + for (; effItr != effEndItr; ++effItr) { if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex())) (*effItr).Call(*scritr, aurEff, dmgInfo, absorbAmount); @@ -2328,11 +2312,11 @@ void Aura::CallScriptEffectManaShieldHandlers(AuraEffect* aurEff, AuraApplicatio void Aura::CallScriptEffectAfterManaShieldHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount) { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_AFTER_MANASHIELD, aurApp); std::list::iterator effEndItr = (*scritr)->AfterEffectManaShield.end(), effItr = (*scritr)->AfterEffectManaShield.begin(); - for (; effItr != effEndItr ; ++effItr) + for (; effItr != effEndItr; ++effItr) { if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex())) (*effItr).Call(*scritr, aurEff, dmgInfo, absorbAmount); @@ -2377,7 +2361,7 @@ void UnitAura::Remove(AuraRemoveMode removeMode) void UnitAura::FillTargetMap(std::map & targets, Unit* caster) { - for (uint8 effIndex = 0; effIndex < MAX_SPELL_EFFECTS ; ++effIndex) + for (uint8 effIndex = 0; effIndex < MAX_SPELL_EFFECTS; ++effIndex) { if (!HasEffect(effIndex)) continue; @@ -2396,13 +2380,14 @@ void UnitAura::FillTargetMap(std::map & targets, Unit* caster) switch (GetSpellInfo()->Effects[effIndex].Effect) { case SPELL_EFFECT_APPLY_AREA_AURA_PARTY: - targetList.push_back(GetUnitOwner()); - GetUnitOwner()->GetPartyMemberInDist(targetList, radius); - break; case SPELL_EFFECT_APPLY_AREA_AURA_RAID: + { targetList.push_back(GetUnitOwner()); - GetUnitOwner()->GetRaidMember(targetList, radius); + Trinity::AnyGroupedUnitInObjectRangeCheck u_check(GetUnitOwner(), GetUnitOwner(), radius, GetSpellInfo()->Effects[effIndex].Effect == SPELL_EFFECT_APPLY_AREA_AURA_RAID); + Trinity::UnitListSearcher searcher(GetUnitOwner(), targetList, u_check); + GetUnitOwner()->VisitNearbyObject(radius, searcher); break; + } case SPELL_EFFECT_APPLY_AREA_AURA_FRIEND: { targetList.push_back(GetUnitOwner()); diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 8d98e4c2777..aad66a45d17 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -57,6 +57,35 @@ extern pEffect SpellEffects[TOTAL_SPELL_EFFECTS]; +SpellDestination::SpellDestination() +{ + _position.Relocate(0, 0, 0, 0); + _transportGUID = 0; + _transportOffset.Relocate(0, 0, 0, 0); +} + +SpellDestination::SpellDestination(float x, float y, float z, float orientation, uint32 mapId) +{ + _position.Relocate(x, y, z, orientation); + _transportGUID = 0; + _position.m_mapId = mapId; +} + +SpellDestination::SpellDestination(Position const& pos) +{ + _position.Relocate(pos); + _transportGUID = 0; +} + +SpellDestination::SpellDestination(WorldObject const& wObj) +{ + _transportGUID = wObj.GetTransGUID(); + _transportOffset.Relocate(wObj.GetTransOffsetX(), wObj.GetTransOffsetY(), wObj.GetTransOffsetZ(), wObj.GetTransOffsetO()); + _position.Relocate(wObj); + _position.SetOrientation(wObj.GetOrientation()); +} + + SpellCastTargets::SpellCastTargets() : m_elevation(0), m_speed(0) { m_objectTarget = NULL; @@ -66,12 +95,6 @@ SpellCastTargets::SpellCastTargets() : m_elevation(0), m_speed(0) m_itemTargetGUID = 0; m_itemTargetEntry = 0; - m_srcTransGUID = 0; - m_srcTransOffset.Relocate(0, 0, 0, 0); - m_srcPos.Relocate(0, 0, 0, 0); - m_dstTransGUID = 0; - m_dstTransOffset.Relocate(0, 0, 0, 0); - m_dstPos.Relocate(0, 0, 0, 0); m_strTarget = ""; m_targetMask = 0; } @@ -95,36 +118,36 @@ void SpellCastTargets::Read(ByteBuffer& data, Unit* caster) if (m_targetMask & TARGET_FLAG_SOURCE_LOCATION) { - data.readPackGUID(m_srcTransGUID); - if (m_srcTransGUID) - data >> m_srcTransOffset.PositionXYZStream(); + data.readPackGUID(m_src._transportGUID); + if (m_src._transportGUID) + data >> m_src._transportOffset.PositionXYZStream(); else - data >> m_srcPos.PositionXYZStream(); + data >> m_src._position.PositionXYZStream(); } else { - m_srcTransGUID = caster->GetTransGUID(); - if (m_srcTransGUID) - m_srcTransOffset.Relocate(caster->GetTransOffsetX(), caster->GetTransOffsetY(), caster->GetTransOffsetZ(), caster->GetTransOffsetO()); + m_src._transportGUID = caster->GetTransGUID(); + if (m_src._transportGUID) + m_src._transportOffset.Relocate(caster->GetTransOffsetX(), caster->GetTransOffsetY(), caster->GetTransOffsetZ(), caster->GetTransOffsetO()); else - m_srcPos.Relocate(caster); + m_src._position.Relocate(caster); } if (m_targetMask & TARGET_FLAG_DEST_LOCATION) { - data.readPackGUID(m_dstTransGUID); - if (m_dstTransGUID) - data >> m_dstTransOffset.PositionXYZStream(); + data.readPackGUID(m_dst._transportGUID); + if (m_dst._transportGUID) + data >> m_dst._transportOffset.PositionXYZStream(); else - data >> m_dstPos.PositionXYZStream(); + data >> m_dst._position.PositionXYZStream(); } else { - m_dstTransGUID = caster->GetTransGUID(); - if (m_dstTransGUID) - m_dstTransOffset.Relocate(caster->GetTransOffsetX(), caster->GetTransOffsetY(), caster->GetTransOffsetZ(), caster->GetTransOffsetO()); + m_dst._transportGUID = caster->GetTransGUID(); + if (m_dst._transportGUID) + m_dst._transportOffset.Relocate(caster->GetTransOffsetX(), caster->GetTransOffsetY(), caster->GetTransOffsetZ(), caster->GetTransOffsetO()); else - m_dstPos.Relocate(caster); + m_dst._position.Relocate(caster); } if (m_targetMask & TARGET_FLAG_STRING) @@ -150,20 +173,20 @@ void SpellCastTargets::Write(ByteBuffer& data) if (m_targetMask & TARGET_FLAG_SOURCE_LOCATION) { - data.appendPackGUID(m_srcTransGUID); // relative position guid here - transport for example - if (m_srcTransGUID) - data << m_srcTransOffset.PositionXYZStream(); + data.appendPackGUID(m_src._transportGUID); // relative position guid here - transport for example + if (m_src._transportGUID) + data << m_src._transportOffset.PositionXYZStream(); else - data << m_srcPos.PositionXYZStream(); + data << m_src._position.PositionXYZStream(); } if (m_targetMask & TARGET_FLAG_DEST_LOCATION) { - data.appendPackGUID(m_dstTransGUID); // relative position guid here - transport for example - if (m_dstTransGUID) - data << m_dstTransOffset.PositionXYZStream(); + data.appendPackGUID(m_dst._transportGUID); // relative position guid here - transport for example + if (m_dst._transportGUID) + data << m_dst._transportOffset.PositionXYZStream(); else - data << m_dstPos.PositionXYZStream(); + data << m_dst._position.PositionXYZStream(); } if (m_targetMask & TARGET_FLAG_STRING) @@ -296,31 +319,31 @@ void SpellCastTargets::UpdateTradeSlotItem() } } -Position const* SpellCastTargets::GetSrc() const +SpellDestination const* SpellCastTargets::GetSrc() const { - return &m_srcPos; + return &m_src; +} + +Position const* SpellCastTargets::GetSrcPos() const +{ + return &m_src._position; } void SpellCastTargets::SetSrc(float x, float y, float z) { - m_srcPos.Relocate(x, y, z); - m_srcTransGUID = 0; + m_src = SpellDestination(x, y, z); m_targetMask |= TARGET_FLAG_SOURCE_LOCATION; } void SpellCastTargets::SetSrc(Position const& pos) { - m_srcPos.Relocate(pos); - m_srcTransGUID = 0; + m_src = SpellDestination(pos); m_targetMask |= TARGET_FLAG_SOURCE_LOCATION; } void SpellCastTargets::SetSrc(WorldObject const& wObj) { - uint64 guid = wObj.GetTransGUID(); - m_srcTransGUID = guid; - m_srcTransOffset.Relocate(wObj.GetTransOffsetX(), wObj.GetTransOffsetY(), wObj.GetTransOffsetZ(), wObj.GetTransOffsetO()); - m_srcPos.Relocate(wObj); + m_src = SpellDestination(wObj); m_targetMask |= TARGET_FLAG_SOURCE_LOCATION; } @@ -328,13 +351,13 @@ void SpellCastTargets::ModSrc(Position const& pos) { ASSERT(m_targetMask & TARGET_FLAG_SOURCE_LOCATION); - if (m_srcTransGUID) + if (m_src._transportGUID) { Position offset; - m_srcPos.GetPositionOffsetTo(pos, offset); - m_srcTransOffset.RelocateOffset(offset); + m_src._position.GetPositionOffsetTo(pos, offset); + m_src._transportOffset.RelocateOffset(offset); } - m_srcPos.Relocate(pos); + m_src._position.Relocate(pos); } void SpellCastTargets::RemoveSrc() @@ -342,41 +365,37 @@ void SpellCastTargets::RemoveSrc() m_targetMask &= ~(TARGET_FLAG_SOURCE_LOCATION); } -WorldLocation const* SpellCastTargets::GetDst() const +SpellDestination const* SpellCastTargets::GetDst() const +{ + return &m_dst; +} + +WorldLocation const* SpellCastTargets::GetDstPos() const { - return &m_dstPos; + return &m_dst._position; } void SpellCastTargets::SetDst(float x, float y, float z, float orientation, uint32 mapId) { - m_dstPos.Relocate(x, y, z, orientation); - m_dstTransGUID = 0; + m_dst = SpellDestination(x, y, z, orientation, mapId); m_targetMask |= TARGET_FLAG_DEST_LOCATION; - if (mapId != MAPID_INVALID) - m_dstPos.m_mapId = mapId; } void SpellCastTargets::SetDst(Position const& pos) { - m_dstPos.Relocate(pos); - m_dstTransGUID = 0; + m_dst = SpellDestination(pos); m_targetMask |= TARGET_FLAG_DEST_LOCATION; } void SpellCastTargets::SetDst(WorldObject const& wObj) { - uint64 guid = wObj.GetTransGUID(); - m_dstTransGUID = guid; - m_dstTransOffset.Relocate(wObj.GetTransOffsetX(), wObj.GetTransOffsetY(), wObj.GetTransOffsetZ(), wObj.GetTransOffsetO()); - m_dstPos.Relocate(wObj); + m_dst = SpellDestination(wObj); m_targetMask |= TARGET_FLAG_DEST_LOCATION; } void SpellCastTargets::SetDst(SpellCastTargets const& spellTargets) { - m_dstTransGUID = spellTargets.m_dstTransGUID; - m_dstTransOffset.Relocate(spellTargets.m_dstTransOffset); - m_dstPos.Relocate(spellTargets.m_dstPos); + m_dst = spellTargets.m_dst; m_targetMask |= TARGET_FLAG_DEST_LOCATION; } @@ -384,13 +403,13 @@ void SpellCastTargets::ModDst(Position const& pos) { ASSERT(m_targetMask & TARGET_FLAG_DEST_LOCATION); - if (m_dstTransGUID) + if (m_dst._transportGUID) { Position offset; - m_dstPos.GetPositionOffsetTo(pos, offset); - m_dstTransOffset.RelocateOffset(offset); + m_dst._position.GetPositionOffsetTo(pos, offset); + m_dst._transportOffset.RelocateOffset(offset); } - m_dstPos.Relocate(pos); + m_dst._position.Relocate(pos); } void SpellCastTargets::RemoveDst() @@ -418,21 +437,21 @@ void SpellCastTargets::Update(Unit* caster) } // update positions by transport move - if (HasSrc() && m_srcTransGUID) + if (HasSrc() && m_src._transportGUID) { - if (WorldObject* transport = ObjectAccessor::GetWorldObject(*caster, m_srcTransGUID)) + if (WorldObject* transport = ObjectAccessor::GetWorldObject(*caster, m_src._transportGUID)) { - m_srcPos.Relocate(transport); - m_srcPos.RelocateOffset(m_srcTransOffset); + m_src._position.Relocate(transport); + m_src._position.RelocateOffset(m_src._transportOffset); } } - if (HasDst() && m_dstTransGUID) + if (HasDst() && m_dst._transportGUID) { - if (WorldObject* transport = ObjectAccessor::GetWorldObject(*caster, m_dstTransGUID)) + if (WorldObject* transport = ObjectAccessor::GetWorldObject(*caster, m_dst._transportGUID)) { - m_dstPos.Relocate(transport); - m_dstPos.RelocateOffset(m_dstTransOffset); + m_dst._position.Relocate(transport); + m_dst._position.RelocateOffset(m_dst._transportOffset); } } } @@ -450,9 +469,9 @@ void SpellCastTargets::OutDebug() const if (m_targetMask & TARGET_FLAG_TRADE_ITEM) sLog->outString("Trade item target: " UI64FMTD, m_itemTargetGUID); if (m_targetMask & TARGET_FLAG_SOURCE_LOCATION) - sLog->outString("Source location: transport guid:" UI64FMTD " trans offset: %s position: %s", m_srcTransGUID, m_srcTransOffset.ToString().c_str(), m_srcPos.ToString().c_str()); + sLog->outString("Source location: transport guid:" UI64FMTD " trans offset: %s position: %s", m_src._transportGUID, m_src._transportOffset.ToString().c_str(), m_src._position.ToString().c_str()); if (m_targetMask & TARGET_FLAG_DEST_LOCATION) - sLog->outString("Destination location: transport guid:" UI64FMTD " trans offset: %s position: %s", m_dstTransGUID, m_dstTransOffset.ToString().c_str(), m_dstPos.ToString().c_str()); + sLog->outString("Destination location: transport guid:" UI64FMTD " trans offset: %s position: %s", m_dst._transportGUID, m_dst._transportOffset.ToString().c_str(), m_dst._position.ToString().c_str()); if (m_targetMask & TARGET_FLAG_STRING) sLog->outString("String: %s", m_strTarget.c_str()); sLog->outString("speed: %f", m_speed); @@ -565,6 +584,9 @@ m_caster((info->AttributesEx6 & SPELL_ATTR6_CAST_BY_CHARMER && caster->GetCharme CleanupTargetList(); CleanupEffectExecuteData(); + + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) + m_destTargets[i] = SpellDestination(*m_caster); } Spell::~Spell() @@ -721,6 +743,9 @@ void Spell::SelectSpellTargets() // some spell effects don't add anything to target map (confirmed with sniffs) (like SPELL_EFFECT_DESTROY_ALL_TOTEMS) SelectEffectTypeImplicitTargets(i); + if (m_targets.HasDst()) + AddDestTarget(*m_targets.GetDst(), i); + if (m_spellInfo->IsChanneled()) { uint8 mask = (1 << i); @@ -768,7 +793,7 @@ void Spell::SelectSpellTargets() } else if (m_spellInfo->Speed > 0.0f) { - float dist = m_caster->GetDistance(*m_targets.GetDst()); + float dist = m_caster->GetDistance(*m_targets.GetDstPos()); m_delayMoment = (uint64) floor(dist / m_spellInfo->Speed * 1000.0f); } } @@ -827,7 +852,7 @@ void Spell::SelectEffectImplicitTargets(SpellEffIndex effIndex, SpellImplicitTar m_targets.SetSrc(*m_caster); break; default: - ASSERT("Spell::SelectEffectImplicitTargets: received not implemented select target reference type for TARGET_TYPE_OBJECT_SRC"); + ASSERT(false && "Spell::SelectEffectImplicitTargets: received not implemented select target reference type for TARGET_TYPE_OBJECT_SRC"); break; } break; @@ -844,7 +869,7 @@ void Spell::SelectEffectImplicitTargets(SpellEffIndex effIndex, SpellImplicitTar SelectImplicitDestDestTargets(effIndex, targetType); break; default: - ASSERT("Spell::SelectEffectImplicitTargets: received not implemented select target reference type for TARGET_TYPE_OBJECT_DEST"); + ASSERT(false && "Spell::SelectEffectImplicitTargets: received not implemented select target reference type for TARGET_TYPE_OBJECT_DEST"); break; } break; @@ -858,7 +883,7 @@ void Spell::SelectEffectImplicitTargets(SpellEffIndex effIndex, SpellImplicitTar SelectImplicitTargetObjectTargets(effIndex, targetType); break; default: - ASSERT("Spell::SelectEffectImplicitTargets: received not implemented select target reference type for TARGET_TYPE_OBJECT"); + ASSERT(false && "Spell::SelectEffectImplicitTargets: received not implemented select target reference type for TARGET_TYPE_OBJECT"); break; } break; @@ -982,7 +1007,7 @@ void Spell::SelectImplicitNearbyTargets(SpellEffIndex effIndex, SpellImplicitTar { case TARGET_OBJECT_TYPE_UNIT: if (Unit* unitTarget = target->ToUnit()) - AddUnitTarget(unitTarget, effMask, false); + AddUnitTarget(unitTarget, effMask, true, false); break; case TARGET_OBJECT_TYPE_GOBJ: if (GameObject* gobjTarget = target->ToGameObject()) @@ -1029,7 +1054,7 @@ void Spell::SelectImplicitConeTargets(SpellEffIndex effIndex, SpellImplicitTarge if ((*j)->IsAffectingSpell(m_spellInfo)) maxTargets += (*j)->GetAmount(); - Trinity::RandomResizeList(targets, maxTargets); + Trinity::Containers::RandomResizeList(targets, maxTargets); } // for compability with older code - add only unit and go targets @@ -1093,10 +1118,10 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge switch (targetType.GetReferenceType()) { case TARGET_REFERENCE_TYPE_SRC: - center = m_targets.GetSrc(); + center = m_targets.GetSrcPos(); break; case TARGET_REFERENCE_TYPE_DEST: - center = m_targets.GetDst(); + center = m_targets.GetDstPos(); break; case TARGET_REFERENCE_TYPE_CASTER: case TARGET_REFERENCE_TYPE_TARGET: @@ -1127,7 +1152,7 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge case TYPEID_PLAYER: { Unit* unitTarget = (*itr)->ToUnit(); - if (unitTarget->isAlive() || !playerCaster->isHonorOrXPTarget(unitTarget) + if (unitTarget->isAlive() || !playerCaster->isHonorOrXPTarget(unitTarget) || ((unitTarget->GetCreatureTypeMask() & (1 << (CREATURE_TYPE_HUMANOID-1))) == 0) || (unitTarget->GetDisplayId() != unitTarget->GetNativeDisplayId())) break; @@ -1152,7 +1177,7 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge case 51328: // check if our target is not valid (spell can target ghoul or dead unit) if (!(m_targets.GetUnitTarget() && m_targets.GetUnitTarget()->GetDisplayId() == m_targets.GetUnitTarget()->GetNativeDisplayId() && - ((m_targets.GetUnitTarget()->GetEntry() == 26125 && m_targets.GetUnitTarget()->GetOwnerGUID() == m_caster->GetGUID()) + ((m_targets.GetUnitTarget()->GetEntry() == 26125 && m_targets.GetUnitTarget()->GetOwnerGUID() == m_caster->GetGUID()) || m_targets.GetUnitTarget()->isDead()))) { // remove existing targets @@ -1248,7 +1273,7 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge break; // Remove targets outside caster's raid - for (std::list::iterator itr = unitTargets.begin() ; itr != unitTargets.end();) + for (std::list::iterator itr = unitTargets.begin(); itr != unitTargets.end();) { if (!(*itr)->IsInRaidWith(m_caster)) itr = unitTargets.erase(itr); @@ -1265,7 +1290,7 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge else if (m_spellInfo->SpellFamilyFlags[2] == 0x0100) // Starfall { // Remove targets not in LoS or in stealth - for (std::list::iterator itr = unitTargets.begin() ; itr != unitTargets.end();) + for (std::list::iterator itr = unitTargets.begin(); itr != unitTargets.end();) { if ((*itr)->HasStealthAura() || (*itr)->HasInvisibilityAura() || !(*itr)->IsWithinLOSInMap(m_caster)) itr = unitTargets.erase(itr); @@ -1278,7 +1303,7 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge break; // Remove targets outside caster's raid - for (std::list::iterator itr = unitTargets.begin() ; itr != unitTargets.end();) + for (std::list::iterator itr = unitTargets.begin(); itr != unitTargets.end();) if (!(*itr)->IsInRaidWith(m_caster)) itr = unitTargets.erase(itr); else @@ -1300,7 +1325,7 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge } else { - for (std::list::iterator itr = unitTargets.begin() ; itr != unitTargets.end();) + for (std::list::iterator itr = unitTargets.begin(); itr != unitTargets.end();) if ((*itr)->getPowerType() != (Powers)power) itr = unitTargets.erase(itr); else @@ -1324,7 +1349,7 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge if (m_spellInfo->Id == 5246) //Intimidating Shout unitTargets.remove(m_targets.GetUnitTarget()); - Trinity::RandomResizeList(unitTargets, maxTargets); + Trinity::Containers::RandomResizeList(unitTargets, maxTargets); } CallScriptAfterUnitTargetSelectHandlers(unitTargets, effIndex); @@ -1342,7 +1367,7 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge if ((*j)->IsAffectingSpell(m_spellInfo)) maxTargets += (*j)->GetAmount(); - Trinity::RandomResizeList(gObjTargets, maxTargets); + Trinity::Containers::RandomResizeList(gObjTargets, maxTargets); } for (std::list::iterator itr = gObjTargets.begin(); itr != gObjTargets.end(); ++itr) AddGOTarget(*itr, effMask); @@ -1468,7 +1493,7 @@ void Spell::SelectImplicitDestDestTargets(SpellEffIndex effIndex, SpellImplicitT if (targetType.GetTarget() == TARGET_DEST_DEST_RANDOM) dist *= (float)rand_norm(); - Position pos = *m_targets.GetDst(); + Position pos = *m_targets.GetDstPos(); m_caster->MovePosition(pos, dist, angle); m_targets.ModDst(pos); } @@ -1518,11 +1543,11 @@ void Spell::SelectImplicitTargetObjectTargets(SpellEffIndex effIndex, SpellImpli { ASSERT((m_targets.GetObjectTarget() || m_targets.GetItemTarget()) && "Spell::SelectImplicitTargetObjectTargets - no explicit object or item target available!"); if (Unit* unit = m_targets.GetUnitTarget()) - AddUnitTarget(unit, 1 << effIndex); + AddUnitTarget(unit, 1 << effIndex, true, false); else if (GameObject* gobj = m_targets.GetGOTarget()) AddGOTarget(gobj, 1 << effIndex); else - AddItemTarget(m_targets.GetItemTarget(), effIndex); + AddItemTarget(m_targets.GetItemTarget(), 1 << effIndex); if (WorldObject* target = m_targets.GetObjectTarget()) SelectImplicitChainTargets(effIndex, targetType, target, 1 << effIndex); @@ -1582,12 +1607,12 @@ void Spell::SelectImplicitTrajTargets() if (!dist2d) return; - float srcToDestDelta = m_targets.GetDst()->m_positionZ - m_targets.GetSrc()->m_positionZ; + float srcToDestDelta = m_targets.GetDstPos()->m_positionZ - m_targets.GetSrcPos()->m_positionZ; std::list targets; - Trinity::WorldObjectSpellTrajTargetCheck check(dist2d, m_targets.GetSrc(), m_caster, m_spellInfo); + Trinity::WorldObjectSpellTrajTargetCheck check(dist2d, m_targets.GetSrcPos(), m_caster, m_spellInfo); Trinity::WorldObjectListSearcher searcher(m_caster, targets, check, GRID_MAP_TYPE_MASK_ALL); - SearchTargets > (searcher, GRID_MAP_TYPE_MASK_ALL, m_caster, m_targets.GetSrc(), dist2d); + SearchTargets > (searcher, GRID_MAP_TYPE_MASK_ALL, m_caster, m_targets.GetSrcPos(), dist2d); if (targets.empty()) return; @@ -1610,8 +1635,8 @@ void Spell::SelectImplicitTrajTargets() const float size = std::max((*itr)->GetObjectSize() * 0.7f, 1.0f); // 1/sqrt(3) // TODO: all calculation should be based on src instead of m_caster - const float objDist2d = m_targets.GetSrc()->GetExactDist2d(*itr) * cos(m_targets.GetSrc()->GetRelativeAngle(*itr)); - const float dz = (*itr)->GetPositionZ() - m_targets.GetSrc()->m_positionZ; + const float objDist2d = m_targets.GetSrcPos()->GetExactDist2d(*itr) * cos(m_targets.GetSrcPos()->GetRelativeAngle(*itr)); + const float dz = (*itr)->GetPositionZ() - m_targets.GetSrcPos()->m_positionZ; DEBUG_TRAJ(sLog->outError("Spell::SelectTrajTargets: check %u, dist between %f %f, height between %f %f.", (*itr)->GetEntry(), objDist2d - size, objDist2d + size, dz - size, dz + size);) @@ -1676,11 +1701,11 @@ void Spell::SelectImplicitTrajTargets() } } - if (m_targets.GetSrc()->GetExactDist2d(m_targets.GetDst()) > bestDist) + if (m_targets.GetSrcPos()->GetExactDist2d(m_targets.GetDstPos()) > bestDist) { - float x = m_targets.GetSrc()->m_positionX + cos(m_caster->GetOrientation()) * bestDist; - float y = m_targets.GetSrc()->m_positionY + sin(m_caster->GetOrientation()) * bestDist; - float z = m_targets.GetSrc()->m_positionZ + bestDist * (a * bestDist + b); + float x = m_targets.GetSrcPos()->m_positionX + cos(m_caster->GetOrientation()) * bestDist; + float y = m_targets.GetSrcPos()->m_positionY + sin(m_caster->GetOrientation()) * bestDist; + float z = m_targets.GetSrcPos()->m_positionZ + bestDist * (a * bestDist + b); if (itr != targets.end()) { @@ -1865,7 +1890,7 @@ void Spell::SearchAreaTargets(std::list& targets, float range, Pos return; Trinity::WorldObjectSpellAreaTargetCheck check(range, position, m_caster, referer, m_spellInfo, selectionType, condList); Trinity::WorldObjectListSearcher searcher(m_caster, targets, check, containerTypeMask); - SearchTargets > (searcher, containerTypeMask, m_caster, m_caster, range); + SearchTargets > (searcher, containerTypeMask, m_caster, position, range); } void Spell::SearchChainTargets(std::list& targets, uint32 chainTargets, WorldObject* target, SpellTargetObjectTypes objectType, SpellTargetCheckTypes selectType, ConditionList* condList, bool isChainHeal) @@ -1894,7 +1919,7 @@ void Spell::SearchChainTargets(std::list& targets, uint32 chainTar } // chain lightning/heal spells and similar - allow to jump at larger distance and go out of los - bool isBouncingFar = (m_spellInfo->AttributesEx4 & SPELL_ATTR4_AREA_TARGET_CHAIN + bool isBouncingFar = (m_spellInfo->AttributesEx4 & SPELL_ATTR4_AREA_TARGET_CHAIN || m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_NONE || m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MAGIC); @@ -2051,7 +2076,7 @@ void Spell::CleanupTargetList() m_delayMoment = 0; } -void Spell::AddUnitTarget(Unit* target, uint32 effectMask, bool checkIfValid /*= true*/) +void Spell::AddUnitTarget(Unit* target, uint32 effectMask, bool checkIfValid /*= true*/, bool implicit /*= true*/) { for (uint32 effIndex = 0; effIndex < MAX_SPELL_EFFECTS; ++effIndex) if (!m_spellInfo->Effects[effIndex].IsEffect() || !CheckEffectTarget(target, effIndex)) @@ -2062,7 +2087,7 @@ void Spell::AddUnitTarget(Unit* target, uint32 effectMask, bool checkIfValid /*= return; if (checkIfValid) - if (m_spellInfo->CheckTarget(m_caster, target, true) != SPELL_CAST_OK) + if (m_spellInfo->CheckTarget(m_caster, target, implicit) != SPELL_CAST_OK) return; // Check for effect immune skip if immuned @@ -2140,7 +2165,7 @@ void Spell::AddUnitTarget(Unit* target, uint32 effectMask, bool checkIfValid /*= if (targetInfo.missCondition == SPELL_MISS_REFLECT) { // Calculate reflected spell result on caster - targetInfo.reflectResult = m_caster->SpellHitResult(m_caster, m_spellInfo, m_canReflect); + targetInfo.reflectResult = m_caster->SpellHitResult(m_caster, m_spellInfo, m_canReflect); if (targetInfo.reflectResult == SPELL_MISS_REFLECT) // Impossible reflect again, so simply deflect spell targetInfo.reflectResult = SPELL_MISS_PARRY; @@ -2217,12 +2242,6 @@ void Spell::AddGOTarget(GameObject* go, uint32 effectMask) m_UniqueGOTargetInfo.push_back(target); } -void Spell::AddGOTarget(uint64 goGUID, uint32 effectMask) -{ - if (GameObject* go = m_caster->GetMap()->GetGameObject(goGUID)) - AddGOTarget(go, effectMask); -} - void Spell::AddItemTarget(Item* item, uint32 effectMask) { for (uint32 effIndex = 0; effIndex < MAX_SPELL_EFFECTS; ++effIndex) @@ -2252,6 +2271,11 @@ void Spell::AddItemTarget(Item* item, uint32 effectMask) m_UniqueItemInfo.push_back(target); } +void Spell::AddDestTarget(SpellDestination const& dest, uint32 effIndex) +{ + m_destTargets[effIndex] = dest; +} + void Spell::DoAllEffectOnTarget(TargetInfo* target) { if (!target || target->processed) @@ -2417,13 +2441,13 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target) else procEx |= PROC_EX_NORMAL_HIT; - // Do triggers for unit (reflect triggers passed on hit phase for correct drop charge) - if (canEffectTrigger && missInfo != SPELL_MISS_REFLECT) - caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, addhealth, m_attackType, m_spellInfo, m_triggeredByAuraSpell); - int32 gain = caster->HealBySpell(unitTarget, m_spellInfo, addhealth, crit); unitTarget->getHostileRefManager().threatAssist(caster, float(gain) * 0.5f, m_spellInfo); m_healing = gain; + + // Do triggers for unit (reflect triggers passed on hit phase for correct drop charge) + if (canEffectTrigger && missInfo != SPELL_MISS_REFLECT) + caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, addhealth, m_attackType, m_spellInfo, m_triggeredByAuraSpell); } // Do damage and triggers else if (m_damage > 0) @@ -2450,15 +2474,16 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target) caster->ToPlayer()->CastItemCombatSpell(unitTarget, m_attackType, procVictim, procEx); } - caster->DealSpellDamage(&damageInfo, true); - // Haunt if (m_spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK && m_spellInfo->SpellFamilyFlags[1] & 0x40000 && m_spellAura && m_spellAura->GetEffect(1)) { AuraEffect* aurEff = m_spellAura->GetEffect(1); aurEff->SetAmount(CalculatePctU(aurEff->GetAmount(), damageInfo.damage)); } + m_damage = damageInfo.damage; + + caster->DealSpellDamage(&damageInfo, true); } // Passive spell hits/misses or active spells only misses (only triggers) else @@ -2479,7 +2504,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target) } } - if (missInfo != SPELL_MISS_EVADE && m_caster && !m_caster->IsFriendlyTo(unit) && !m_spellInfo->IsPositive()) + if (missInfo != SPELL_MISS_EVADE && m_caster && !m_caster->IsFriendlyTo(unit) && (!m_spellInfo->IsPositive() || m_spellInfo->HasEffect(SPELL_EFFECT_DISPEL))) { m_caster->CombatStart(unit, !(m_spellInfo->AttributesEx3 & SPELL_ATTR3_NO_INITIAL_AGGRO)); @@ -2720,18 +2745,18 @@ void Spell::DoTriggersOnSpellHit(Unit* unit, uint8 effMask) if (!m_hitTriggerSpells.empty()) { int _duration = 0; - for (HitTriggerSpells::const_iterator i = m_hitTriggerSpells.begin(); i != m_hitTriggerSpells.end(); ++i) + for (HitTriggerSpellList::const_iterator i = m_hitTriggerSpells.begin(); i != m_hitTriggerSpells.end(); ++i) { - if (CanExecuteTriggersOnHit(effMask, i->first) && roll_chance_i(i->second)) + if (CanExecuteTriggersOnHit(effMask, i->triggeredByAura) && roll_chance_i(i->chance)) { - m_caster->CastSpell(unit, i->first, true); - sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell %d triggered spell %d by SPELL_AURA_ADD_TARGET_TRIGGER aura", m_spellInfo->Id, i->first->Id); + m_caster->CastSpell(unit, i->triggeredSpell, true); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell %d triggered spell %d by SPELL_AURA_ADD_TARGET_TRIGGER aura", m_spellInfo->Id, i->triggeredSpell->Id); // SPELL_AURA_ADD_TARGET_TRIGGER auras shouldn't trigger auras without duration // set duration of current aura to the triggered spell - if (i->first->GetDuration() == -1) + if (i->triggeredSpell->GetDuration() == -1) { - if (Aura* triggeredAur = unit->GetAura(i->first->Id, m_caster->GetGUID())) + if (Aura* triggeredAur = unit->GetAura(i->triggeredSpell->Id, m_caster->GetGUID())) { // get duration from aura-only once if (!_duration) @@ -2862,34 +2887,6 @@ bool Spell::UpdateChanneledTargetList() return channelTargetEffectMask == 0; } -// Helper for Chain Healing -// Spell target first -// Raidmates then descending by injury suffered (MaxHealth - Health) -// Other players/mobs then descending by injury suffered (MaxHealth - Health) -struct ChainHealingOrder : public std::binary_function -{ - const Unit* MainTarget; - ChainHealingOrder(Unit const* Target) : MainTarget(Target) {}; - // functor for operator ">" - bool operator()(Unit const* _Left, Unit const* _Right) const - { - return (ChainHealingHash(_Left) < ChainHealingHash(_Right)); - } - - int32 ChainHealingHash(Unit const* Target) const - { - if (Target->GetTypeId() == TYPEID_PLAYER && MainTarget->GetTypeId() == TYPEID_PLAYER && Target->ToPlayer()->IsInSameRaidWith(MainTarget->ToPlayer())) - { - if (Target->IsFullHealth()) - return 40000; - else - return 20000 - Target->GetMaxHealth() + Target->GetHealth(); - } - else - return 40000 - Target->GetMaxHealth() + Target->GetHealth(); - } -}; - void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggeredByAura) { if (m_CastItem) @@ -3083,7 +3080,8 @@ void Spell::cancel() *m_selfContainer = NULL; m_caster->RemoveDynObject(m_spellInfo->Id); - m_caster->RemoveGameObject(m_spellInfo->Id, true); + if (m_spellInfo->IsChanneled()) // if not channeled then the object for the current cast wasn't summoned yet + m_caster->RemoveGameObject(m_spellInfo->Id, true); //set state back so finish will be processed m_spellState = oldState; @@ -3103,11 +3101,20 @@ void Spell::cast(bool skipCheck) return; } - // now that we've done the basic check, now run the scripts - // should be done before the spell is actually executed if (Player* playerCaster = m_caster->ToPlayer()) + { + // now that we've done the basic check, now run the scripts + // should be done before the spell is actually executed sScriptMgr->OnPlayerSpellCast(playerCaster, this, skipCheck); + // As of 3.0.2 pets begin attacking their owner's target immediately + // Let any pets know we've attacked something. Check DmgClass for harmful spells only + // This prevents spells such as Hunter's Mark from triggering pet attack + if (this->GetSpellInfo()->DmgClass != SPELL_DAMAGE_CLASS_NONE) + if (Pet* playerPet = playerCaster->GetPet()) + if (playerPet->isAlive() && playerPet->isControlled() && (m_targets.GetTargetMask() & TARGET_FLAG_UNIT)) + playerPet->AI()->OwnerAttacked(m_targets.GetObjectTarget()->ToUnit()); + } SetExecutedCurrently(true); if (m_caster->GetTypeId() != TYPEID_PLAYER && m_targets.GetUnitTarget() && m_targets.GetUnitTarget() != m_caster) @@ -3425,29 +3432,13 @@ void Spell::_handle_immediate_phase() return; // Handle procs on cast // TODO: finish new proc system:P - if (m_UniqueTargetInfo.empty()) + if (m_UniqueTargetInfo.empty() && m_targets.HasDst()) { uint32 procAttacker = m_procAttacker; if (!procAttacker) - { - bool positive = m_spellInfo->IsPositive(); - switch (m_spellInfo->DmgClass) - { - case SPELL_DAMAGE_CLASS_MAGIC: - if (positive) - procAttacker |= PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS; - else - procAttacker |= PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG; - break; - case SPELL_DAMAGE_CLASS_NONE: - if (positive) - procAttacker |= PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_POS; - else - procAttacker |= PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_NEG; - break; - } - } - // Proc damage for spells which have only dest targets (2484 should proc 51486 for example) + procAttacker |= PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS; + + // Proc the spells that have DEST target m_originalCaster->ProcDamageAndSpell(NULL, procAttacker, 0, m_procEx | PROC_EX_NORMAL_HIT, 0, BASE_ATTACK, m_spellInfo, m_triggeredByAuraSpell); } } @@ -3508,7 +3499,7 @@ void Spell::update(uint32 difftime) // check if the player caster has moved before the spell finished if ((m_caster->GetTypeId() == TYPEID_PLAYER && m_timer != 0) && m_caster->isMoving() && (m_spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_MOVEMENT) && - (m_spellInfo->Effects[0].Effect != SPELL_EFFECT_STUCK || !m_caster->HasUnitMovementFlag(MOVEMENTFLAG_FALLING))) + (m_spellInfo->Effects[0].Effect != SPELL_EFFECT_STUCK || !m_caster->HasUnitMovementFlag(MOVEMENTFLAG_FALLING_FAR))) { // don't cancel for melee, autorepeat, triggered and instant spells if (!IsNextMeleeSwingSpell() && !IsAutoRepeat() && !IsTriggered()) @@ -3757,12 +3748,12 @@ void Spell::SendCastResult(Player* caster, SpellInfo const* spellInfo, uint8 cas case SPELL_FAILED_TOO_MANY_OF_ITEM: { uint32 item = 0; - for (int8 x = 0; x < 3; x++) - if (spellInfo->Effects[x].ItemType) - item = spellInfo->Effects[x].ItemType; - ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(item); - if (pProto && pProto->ItemLimitCategory) - data << uint32(pProto->ItemLimitCategory); + for (int8 eff = 0; eff < MAX_SPELL_EFFECTS; eff++) + if (spellInfo->Effects[eff].ItemType) + item = spellInfo->Effects[eff].ItemType; + ItemTemplate const* proto = sObjectMgr->GetItemTemplate(item); + if (proto && proto->ItemLimitCategory) + data << uint32(proto->ItemLimitCategory); break; } case SPELL_FAILED_PREVENTED_BY_MECHANIC: @@ -3809,6 +3800,23 @@ void Spell::SendCastResult(Player* caster, SpellInfo const* spellInfo, uint8 cas data << uint32(missingItem); // first missing item break; } + case SPELL_FAILED_PREVENTED_BY_MECHANIC: + data << uint32(spellInfo->Mechanic); + break; + case SPELL_FAILED_NEED_EXOTIC_AMMO: + data << uint32(spellInfo->EquippedItemSubClassMask); + break; + case SPELL_FAILED_NEED_MORE_ITEMS: + data << uint32(0); // Item entry + data << uint32(0); // Count + break; + case SPELL_FAILED_MIN_SKILL: + data << uint32(0); // SkillLine.dbc Id + data << uint32(0); // Amount + break; + case SPELL_FAILED_FISHING_TOO_LOW: + data << uint32(0); // Skill level + break; default: break; } @@ -3884,6 +3892,7 @@ void Spell::SendSpellGo() if ((IsTriggered() && !m_spellInfo->IsAutoRepeatRangedSpell()) || m_triggeredByAuraSpell) castFlags |= CAST_FLAG_PENDING; + if ((m_caster->GetTypeId() == TYPEID_PLAYER || (m_caster->GetTypeId() == TYPEID_UNIT && m_caster->ToCreature()->isPet())) && m_spellInfo->PowerType != POWER_HEALTH) @@ -3896,7 +3905,6 @@ void Spell::SendSpellGo() { castFlags |= CAST_FLAG_UNKNOWN_19; // same as in SMSG_SPELL_START castFlags |= CAST_FLAG_RUNE_LIST; // rune cooldowns list - castFlags |= CAST_FLAG_UNKNOWN_9; // ?? } if (m_spellInfo->HasEffect(SPELL_EFFECT_ACTIVATE_RUNE)) @@ -4281,10 +4289,9 @@ void Spell::TakePower() for (std::list::iterator ihit= m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit) if (ihit->targetGUID == targetGUID) { - if (ihit->missCondition != SPELL_MISS_NONE && ihit->missCondition != SPELL_MISS_MISS/* && ihit->targetGUID != m_caster->GetGUID()*/) - hit = false; if (ihit->missCondition != SPELL_MISS_NONE) { + hit = false; //lower spell cost on fail (by talent aura) if (Player* modOwner = m_caster->ToPlayer()->GetSpellModOwner()) modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_SPELL_COST_REFUND_ON_FAIL, m_powerCost); @@ -4469,9 +4476,7 @@ void Spell::TakeReagents() if (m_caster->GetTypeId() != TYPEID_PLAYER) return; - ItemTemplate const* castItemTemplate = m_CastItem - ? m_CastItem->GetTemplate() - : NULL; + ItemTemplate const* castItemTemplate = m_CastItem ? m_CastItem->GetTemplate() : NULL; // do not take reagents for these item casts if (castItemTemplate && castItemTemplate->Flags & ITEM_PROTO_FLAG_TRIGGERED_CAST) @@ -4571,6 +4576,7 @@ void Spell::HandleEffects(Unit* pUnitTarget, Item* pItemTarget, GameObject* pGOT unitTarget = pUnitTarget; itemTarget = pItemTarget; gameObjTarget = pGOTarget; + destTarget = &m_destTargets[i]._position; uint8 eff = m_spellInfo->Effects[i].Effect; @@ -4706,7 +4712,7 @@ SpellCastResult Spell::CheckCast(bool strict) if (m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->ToPlayer()->isMoving()) { // skip stuck spell to allow use it in falling case and apply spell limitations at movement - if ((!m_caster->HasUnitMovementFlag(MOVEMENTFLAG_FALLING) || m_spellInfo->Effects[0].Effect != SPELL_EFFECT_STUCK) && + if ((!m_caster->HasUnitMovementFlag(MOVEMENTFLAG_FALLING_FAR) || m_spellInfo->Effects[0].Effect != SPELL_EFFECT_STUCK) && (IsAutoRepeat() || (m_spellInfo->AuraInterruptFlags & AURA_INTERRUPT_FLAG_NOT_SEATED) != 0)) return SPELL_FAILED_MOVING; } @@ -4751,11 +4757,17 @@ SpellCastResult Spell::CheckCast(bool strict) // TODO: using WorldSession::SendNotification is not blizzlike if (Player* playerCaster = m_caster->ToPlayer()) { + // mLastFailedCondition can be NULL if there was an error processing the condition in Condition::Meets (i.e. wrong data for ConditionTarget or others) if (playerCaster->GetSession() && condInfo.mLastFailedCondition && condInfo.mLastFailedCondition->ErrorTextId) + { playerCaster->GetSession()->SendNotification(condInfo.mLastFailedCondition->ErrorTextId); + return SPELL_FAILED_DONT_REPORT; + } } - return SPELL_FAILED_DONT_REPORT; + if (!condInfo.mLastFailedCondition || !condInfo.mLastFailedCondition->ConditionTarget) + return SPELL_FAILED_CASTER_AURASTATE; + return SPELL_FAILED_BAD_TARGETS; } } @@ -4787,8 +4799,9 @@ SpellCastResult Spell::CheckCast(bool strict) if ((m_spellInfo->AttributesCu & SPELL_ATTR0_CU_REQ_TARGET_FACING_CASTER) && !target->HasInArc(static_cast(M_PI), m_caster)) return SPELL_FAILED_NOT_INFRONT; - if (!(m_spellInfo->AttributesEx2 & SPELL_ATTR2_CAN_TARGET_NOT_IN_LOS) && VMAP::VMapFactory::checkSpellForLoS(m_spellInfo->Id) && !m_caster->IsWithinLOSInMap(target)) - return SPELL_FAILED_LINE_OF_SIGHT; + if (m_caster->GetEntry() != WORLD_TRIGGER) // Ignore LOS for gameobjects casts (wrongly casted by a trigger) + if (!(m_spellInfo->AttributesEx2 & SPELL_ATTR2_CAN_TARGET_NOT_IN_LOS) && VMAP::VMapFactory::checkSpellForLoS(m_spellInfo->Id) && !m_caster->IsWithinLOSInMap(target)) + return SPELL_FAILED_LINE_OF_SIGHT; } else { @@ -4806,7 +4819,7 @@ SpellCastResult Spell::CheckCast(bool strict) if (m_targets.HasDst()) { float x, y, z; - m_targets.GetDst()->GetPosition(x, y, z); + m_targets.GetDstPos()->GetPosition(x, y, z); if (!(m_spellInfo->AttributesEx2 & SPELL_ATTR2_CAN_TARGET_NOT_IN_LOS) && VMAP::VMapFactory::checkSpellForLoS(m_spellInfo->Id) && !m_caster->IsWithinLOS(x, y, z)) return SPELL_FAILED_LINE_OF_SIGHT; @@ -4899,6 +4912,37 @@ SpellCastResult Spell::CheckCast(bool strict) if (castResult != SPELL_CAST_OK) return castResult; + bool hasDispellableAura = false; + bool hasNonDispelEffect = false; + for (int i = 0; i < MAX_SPELL_EFFECTS; i++) + if (m_spellInfo->Effects[i].Effect == SPELL_EFFECT_DISPEL) + { + if (m_spellInfo->Effects[i].IsTargetingArea() || m_spellInfo->AttributesEx & SPELL_ATTR1_MELEE_COMBAT_START) + { + hasDispellableAura = true; + break; + } + if (Unit* target = m_targets.GetUnitTarget()) + { + DispelChargesList dispelList; + uint32 dispelMask = SpellInfo::GetDispelMask(DispelType(m_spellInfo->Effects[i].MiscValue)); + target->GetDispellableAuraList(m_caster, dispelMask, dispelList); + if (!dispelList.empty()) + { + hasDispellableAura = true; + break; + } + } + } + else if (m_spellInfo->Effects[i].IsEffect()) + { + hasNonDispelEffect = true; + break; + } + + if (!hasNonDispelEffect && !hasDispellableAura && m_spellInfo->HasEffect(SPELL_EFFECT_DISPEL) && !IsTriggered()) + return SPELL_FAILED_NOTHING_TO_DISPEL; + for (int i = 0; i < MAX_SPELL_EFFECTS; i++) { // for effects of spells that have only one target @@ -4906,35 +4950,12 @@ SpellCastResult Spell::CheckCast(bool strict) { case SPELL_EFFECT_DUMMY: { - if (m_spellInfo->Id == 51582) // Rocket Boots Engaged - { - if (m_caster->IsInWater()) - return SPELL_FAILED_ONLY_ABOVEWATER; - } - else if (m_spellInfo->SpellIconID == 156) // Holy Shock - { - // spell different for friends and enemies - // hurt version required facing - if (m_targets.GetUnitTarget() && !m_caster->IsFriendlyTo(m_targets.GetUnitTarget()) && !m_caster->HasInArc(static_cast(M_PI), m_targets.GetUnitTarget())) - return SPELL_FAILED_UNIT_NOT_INFRONT; - } - else if (m_spellInfo->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT && m_spellInfo->SpellFamilyFlags[0] == 0x2000) // Death Coil (DeathKnight) - { - Unit* target = m_targets.GetUnitTarget(); - if (!target || (target->IsFriendlyTo(m_caster) && target->GetCreatureType() != CREATURE_TYPE_UNDEAD)) - return SPELL_FAILED_BAD_TARGETS; - } - else if (m_spellInfo->Id == 19938) // Awaken Peon + if (m_spellInfo->Id == 19938) // Awaken Peon { Unit* unit = m_targets.GetUnitTarget(); if (!unit || !unit->HasAura(17743)) return SPELL_FAILED_BAD_TARGETS; } - else if (m_spellInfo->Id == 52264) // Deliver Stolen Horse - { - if (!m_caster->FindNearestCreature(28653, 5)) - return SPELL_FAILED_OUT_OF_RANGE; - } else if (m_spellInfo->Id == 31789) // Righteous Defense { if (m_caster->GetTypeId() != TYPEID_PLAYER) @@ -5059,7 +5080,7 @@ SpellCastResult Spell::CheckCast(bool strict) if (creature->GetCreatureType() != CREATURE_TYPE_CRITTER && !creature->loot.isLooted()) return SPELL_FAILED_TARGET_NOT_LOOTED; - uint32 skill = creature->GetCreatureInfo()->GetRequiredLootSkill(); + uint32 skill = creature->GetCreatureTemplate()->GetRequiredLootSkill(); int32 skillValue = m_caster->ToPlayer()->GetSkillValue(skill); int32 TargetLevel = m_targets.GetUnitTarget()->getLevel(); @@ -5142,10 +5163,8 @@ SpellCastResult Spell::CheckCast(bool strict) case SPELL_EFFECT_SUMMON_DEAD_PET: { Creature* pet = m_caster->GetGuardianPet(); - if (!pet) - return SPELL_FAILED_NO_PET; - if (pet->isAlive()) + if (pet && pet->isAlive()) return SPELL_FAILED_ALREADY_HAVE_SUMMON; break; @@ -5195,7 +5214,6 @@ SpellCastResult Spell::CheckCast(bool strict) if (m_caster->GetCharmGUID()) return SPELL_FAILED_ALREADY_HAVE_CHARM; - break; } case SPELL_EFFECT_SUMMON_PLAYER: @@ -5270,8 +5288,7 @@ SpellCastResult Spell::CheckCast(bool strict) if (m_caster->GetTypeId() == TYPEID_PLAYER && m_spellInfo->Id == 781 && !m_caster->isInCombat()) return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; - Unit* target = m_targets.GetUnitTarget(); - if (m_caster == target && m_caster->HasUnitState(UNIT_STATE_ROOT)) + if (m_caster->HasUnitState(UNIT_STATE_ROOT)) { if (m_caster->GetTypeId() == TYPEID_PLAYER) return SPELL_FAILED_ROOTED; @@ -5327,7 +5344,7 @@ SpellCastResult Spell::CheckCast(bool strict) return SPELL_FAILED_HIGHLEVEL; // use SMSG_PET_TAME_FAILURE? - if (!target->GetCreatureInfo()->isTameable (m_caster->ToPlayer()->CanTameExoticPets())) + if (!target->GetCreatureTemplate()->isTameable (m_caster->ToPlayer()->CanTameExoticPets())) return SPELL_FAILED_BAD_TARGETS; if (m_caster->GetPetGUID()) @@ -5509,16 +5526,11 @@ SpellCastResult Spell::CheckPetCast(Unit* target) if (!target && m_targets.GetUnitTarget()) target = m_targets.GetUnitTarget(); - for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i) + if (m_spellInfo->NeedsExplicitUnitTarget()) { - if (m_spellInfo->Effects[i].TargetA.GetType() == TARGET_TYPE_UNIT_TARGET - || m_spellInfo->Effects[i].TargetA.GetType() == TARGET_TYPE_DEST_TARGET) - { - if (!target) - return SPELL_FAILED_BAD_IMPLICIT_TARGETS; - m_targets.SetUnitTarget(target); - break; - } + if (!target) + return SPELL_FAILED_BAD_IMPLICIT_TARGETS; + m_targets.SetUnitTarget(target); } // cooldown @@ -5748,9 +5760,9 @@ SpellCastResult Spell::CheckRange(bool strict) if (m_targets.HasDst() && !m_targets.HasTraj()) { - if (!m_caster->IsWithinDist3d(m_targets.GetDst(), max_range)) + if (!m_caster->IsWithinDist3d(m_targets.GetDstPos(), max_range)) return SPELL_FAILED_OUT_OF_RANGE; - if (min_range && m_caster->IsWithinDist3d(m_targets.GetDst(), min_range)) + if (min_range && m_caster->IsWithinDist3d(m_targets.GetDstPos(), min_range)) return SPELL_FAILED_TOO_CLOSE; } @@ -5956,7 +5968,7 @@ SpellCastResult Spell::CheckItems() // check totem-item requirements (items presence in inventory) uint32 totems = 2; - for (int i = 0; i < 2 ; ++i) + for (int i = 0; i < 2; ++i) { if (m_spellInfo->Totem[i] != 0) { @@ -6179,9 +6191,12 @@ SpellCastResult Spell::CheckItems() case SPELL_EFFECT_WEAPON_DAMAGE: case SPELL_EFFECT_WEAPON_DAMAGE_NOSCHOOL: { - if (m_caster->GetTypeId() != TYPEID_PLAYER) return SPELL_FAILED_TARGET_NOT_PLAYER; + if (m_caster->GetTypeId() != TYPEID_PLAYER) + return SPELL_FAILED_TARGET_NOT_PLAYER; + if (m_attackType != RANGED_ATTACK) break; + Item* pItem = m_caster->ToPlayer()->GetWeaponForAttack(m_attackType); if (!pItem || pItem->IsBroken()) return SPELL_FAILED_EQUIPPED_ITEM; @@ -6193,7 +6208,8 @@ SpellCastResult Spell::CheckItems() uint32 ammo = pItem->GetEntry(); if (!m_caster->ToPlayer()->HasItemCount(ammo, 1)) return SPELL_FAILED_NO_AMMO; - }; break; + }; + break; case ITEM_SUBCLASS_WEAPON_GUN: case ITEM_SUBCLASS_WEAPON_BOW: case ITEM_SUBCLASS_WEAPON_CROSSBOW: @@ -6357,6 +6373,30 @@ void Spell::UpdatePointers() m_CastItem = m_caster->ToPlayer()->GetItemByGuid(m_castItemGUID); m_targets.Update(m_caster); + + // further actions done only for dest targets + if (!m_targets.HasDst()) + return; + + // cache last transport + WorldObject* transport = NULL; + + // update effect destinations (in case of moved transport dest target) + for (uint8 effIndex = 0; effIndex < MAX_SPELL_EFFECTS; ++effIndex) + { + SpellDestination& dest = m_destTargets[effIndex]; + if (!dest._transportGUID) + continue; + + if (!transport || transport->GetGUID() != dest._transportGUID) + transport = ObjectAccessor::GetWorldObject(*m_caster, dest._transportGUID); + + if (transport) + { + dest._position.Relocate(transport); + dest._position.RelocateOffset(dest._transportOffset); + } + } } CurrentSpellTypes Spell::GetCurrentContainer() const @@ -6519,7 +6559,7 @@ bool SpellEvent::Execute(uint64 e_time, uint32 p_time) // no, we aren't, do the typical update // check, if we have channeled spell on our hands /* - if (IsChanneledSpell(m_Spell->m_spellInfo)) + if (m_Spell->m_spellInfo->IsChanneled()) { // evented channeled spell is processed separately, casted once after delay, and not destroyed till finish // check, if we have casting anything else except this channeled spell and autorepeat @@ -6840,7 +6880,7 @@ void Spell::CheckEffectExecuteData() void Spell::LoadScripts() { sScriptMgr->CreateSpellScripts(m_spellInfo->Id, m_loadedScripts); - for (std::list::iterator itr = m_loadedScripts.begin(); itr != m_loadedScripts.end() ;) + for (std::list::iterator itr = m_loadedScripts.begin(); itr != m_loadedScripts.end();) { if (!(*itr)->_Load(this)) { @@ -6857,11 +6897,11 @@ void Spell::LoadScripts() void Spell::CallScriptBeforeCastHandlers() { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_BEFORE_CAST); std::list::iterator hookItrEnd = (*scritr)->BeforeCast.end(), hookItr = (*scritr)->BeforeCast.begin(); - for (; hookItr != hookItrEnd ; ++hookItr) + for (; hookItr != hookItrEnd; ++hookItr) (*hookItr).Call(*scritr); (*scritr)->_FinishScriptCall(); @@ -6870,11 +6910,11 @@ void Spell::CallScriptBeforeCastHandlers() void Spell::CallScriptOnCastHandlers() { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_ON_CAST); std::list::iterator hookItrEnd = (*scritr)->OnCast.end(), hookItr = (*scritr)->OnCast.begin(); - for (; hookItr != hookItrEnd ; ++hookItr) + for (; hookItr != hookItrEnd; ++hookItr) (*hookItr).Call(*scritr); (*scritr)->_FinishScriptCall(); @@ -6883,11 +6923,11 @@ void Spell::CallScriptOnCastHandlers() void Spell::CallScriptAfterCastHandlers() { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_AFTER_CAST); std::list::iterator hookItrEnd = (*scritr)->AfterCast.end(), hookItr = (*scritr)->AfterCast.begin(); - for (; hookItr != hookItrEnd ; ++hookItr) + for (; hookItr != hookItrEnd; ++hookItr) (*hookItr).Call(*scritr); (*scritr)->_FinishScriptCall(); @@ -6897,7 +6937,7 @@ void Spell::CallScriptAfterCastHandlers() SpellCastResult Spell::CallScriptCheckCastHandlers() { SpellCastResult retVal = SPELL_CAST_OK; - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_CHECK_CAST); std::list::iterator hookItrEnd = (*scritr)->OnCheckCast.end(), hookItr = (*scritr)->OnCheckCast.begin(); @@ -6915,7 +6955,7 @@ SpellCastResult Spell::CallScriptCheckCastHandlers() void Spell::PrepareScriptHitHandlers() { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) (*scritr)->_InitHit(); } @@ -6923,7 +6963,7 @@ bool Spell::CallScriptEffectHandlers(SpellEffIndex effIndex, SpellEffectHandleMo { // execute script effect handler hooks and check if effects was prevented bool preventDefault = false; - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { std::list::iterator effItr, effEndItr; SpellScriptHookType hookType; @@ -6954,7 +6994,7 @@ bool Spell::CallScriptEffectHandlers(SpellEffIndex effIndex, SpellEffectHandleMo return false; } (*scritr)->_PrepareScriptCall(hookType); - for (; effItr != effEndItr ; ++effItr) + for (; effItr != effEndItr; ++effItr) // effect execution can be prevented if (!(*scritr)->_IsEffectPrevented(effIndex) && (*effItr).IsEffectAffected(m_spellInfo, effIndex)) (*effItr).Call(*scritr, effIndex); @@ -6969,11 +7009,11 @@ bool Spell::CallScriptEffectHandlers(SpellEffIndex effIndex, SpellEffectHandleMo void Spell::CallScriptBeforeHitHandlers() { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_BEFORE_HIT); std::list::iterator hookItrEnd = (*scritr)->BeforeHit.end(), hookItr = (*scritr)->BeforeHit.begin(); - for (; hookItr != hookItrEnd ; ++hookItr) + for (; hookItr != hookItrEnd; ++hookItr) (*hookItr).Call(*scritr); (*scritr)->_FinishScriptCall(); @@ -6982,11 +7022,11 @@ void Spell::CallScriptBeforeHitHandlers() void Spell::CallScriptOnHitHandlers() { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_HIT); std::list::iterator hookItrEnd = (*scritr)->OnHit.end(), hookItr = (*scritr)->OnHit.begin(); - for (; hookItr != hookItrEnd ; ++hookItr) + for (; hookItr != hookItrEnd; ++hookItr) (*hookItr).Call(*scritr); (*scritr)->_FinishScriptCall(); @@ -6995,11 +7035,11 @@ void Spell::CallScriptOnHitHandlers() void Spell::CallScriptAfterHitHandlers() { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_AFTER_HIT); std::list::iterator hookItrEnd = (*scritr)->AfterHit.end(), hookItr = (*scritr)->AfterHit.begin(); - for (; hookItr != hookItrEnd ; ++hookItr) + for (; hookItr != hookItrEnd; ++hookItr) (*hookItr).Call(*scritr); (*scritr)->_FinishScriptCall(); @@ -7008,11 +7048,11 @@ void Spell::CallScriptAfterHitHandlers() void Spell::CallScriptAfterUnitTargetSelectHandlers(std::list& unitTargets, SpellEffIndex effIndex) { - for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr) { (*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_UNIT_TARGET_SELECT); std::list::iterator hookItrEnd = (*scritr)->OnUnitTargetSelect.end(), hookItr = (*scritr)->OnUnitTargetSelect.begin(); - for (; hookItr != hookItrEnd ; ++hookItr) + for (; hookItr != hookItrEnd; ++hookItr) if ((*hookItr).IsEffectAffected(m_spellInfo, effIndex)) (*hookItr).Call(*scritr, unitTargets); @@ -7020,14 +7060,13 @@ void Spell::CallScriptAfterUnitTargetSelectHandlers(std::list& unitTarget } } -bool Spell::CanExecuteTriggersOnHit(uint8 effMask, SpellInfo const* spellInfo) const +bool Spell::CanExecuteTriggersOnHit(uint8 effMask, SpellInfo const* triggeredByAura) const { - bool only_on_dummy = (spellInfo && (spellInfo->AttributesEx4 & SPELL_ATTR4_PROC_ONLY_ON_DUMMY)); - // If triggered spell has SPELL_ATTR4_PROC_ONLY_ON_DUMMY then it can only proc on a casted spell with SPELL_EFFECT_DUMMY - // If triggered spell doesn't have SPELL_ATTR4_PROC_ONLY_ON_DUMMY then it can NOT proc on SPELL_EFFECT_DUMMY (needs confirmation) + bool only_on_caster = (triggeredByAura && (triggeredByAura->AttributesEx4 & SPELL_ATTR4_PROC_ONLY_ON_CASTER)); + // If triggeredByAura has SPELL_ATTR4_PROC_ONLY_ON_CASTER then it can only proc on a casted spell with TARGET_UNIT_CASTER for (uint8 i = 0;i < MAX_SPELL_EFFECTS; ++i) { - if ((effMask & (1 << i)) && (only_on_dummy == (m_spellInfo->Effects[i].Effect == SPELL_EFFECT_DUMMY))) + if ((effMask & (1 << i)) && (!only_on_caster || (m_spellInfo->Effects[i].TargetA.GetTarget() == TARGET_UNIT_CASTER))) return true; } return false; @@ -7079,9 +7118,14 @@ void Spell::PrepareTriggersExecutedOnHit() // calculate the chance using spell base amount, because aura amount is not updated on combo-points change // this possibly needs fixing int32 auraBaseAmount = (*i)->GetBaseAmount(); - int32 chance = m_caster->CalculateSpellDamage(NULL, auraSpellInfo, auraSpellIdx, &auraBaseAmount); // proc chance is stored in effect amount - m_hitTriggerSpells.push_back(std::make_pair(spellInfo, chance * (*i)->GetBase()->GetStackAmount())); + int32 chance = m_caster->CalculateSpellDamage(NULL, auraSpellInfo, auraSpellIdx, &auraBaseAmount); + // build trigger and add to the list + HitTriggerSpell spellTriggerInfo; + spellTriggerInfo.triggeredSpell = spellInfo; + spellTriggerInfo.triggeredByAura = auraSpellInfo; + spellTriggerInfo.chance = chance * (*i)->GetBase()->GetStackAmount(); + m_hitTriggerSpells.push_back(spellTriggerInfo); } } } @@ -7154,7 +7198,7 @@ namespace Trinity { WorldObjectSpellTargetCheck::WorldObjectSpellTargetCheck(Unit* caster, Unit* referer, SpellInfo const* spellInfo, - SpellTargetCheckTypes selectionType, ConditionList* condList) : _caster(caster), _referer(referer), _spellInfo(spellInfo), + SpellTargetCheckTypes selectionType, ConditionList* condList) : _caster(caster), _referer(referer), _spellInfo(spellInfo), _targetSelectionType(selectionType), _condList(condList) { if (condList) @@ -7228,7 +7272,7 @@ bool WorldObjectSpellTargetCheck::operator()(WorldObject* target) return sConditionMgr->IsObjectMeetToConditions(*_condSrcInfo, *_condList); } -WorldObjectSpellNearbyTargetCheck::WorldObjectSpellNearbyTargetCheck(float range, Unit* caster, SpellInfo const* spellInfo, +WorldObjectSpellNearbyTargetCheck::WorldObjectSpellNearbyTargetCheck(float range, Unit* caster, SpellInfo const* spellInfo, SpellTargetCheckTypes selectionType, ConditionList* condList) : WorldObjectSpellTargetCheck(caster, caster, spellInfo, selectionType, condList), _range(range), _position(caster) { diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h index dd377d66feb..ff29269e281 100755 --- a/src/server/game/Spells/Spell.h +++ b/src/server/game/Spells/Spell.h @@ -57,7 +57,7 @@ enum SpellCastFlags CAST_FLAG_UNKNOWN_17 = 0x00010000, CAST_FLAG_ADJUST_MISSILE = 0x00020000, CAST_FLAG_UNKNOWN_19 = 0x00040000, - CAST_FLAG_VISUAL_CHAIN = 0x00080000, + CAST_FLAG_VISUAL_CHAIN = 0x00080000, CAST_FLAG_UNKNOWN_21 = 0x00100000, CAST_FLAG_RUNE_LIST = 0x00200000, CAST_FLAG_UNKNOWN_23 = 0x00400000, @@ -79,6 +79,18 @@ enum SpellRangeFlag SPELL_RANGE_RANGED = 2, //hunter range and ranged weapon }; +struct SpellDestination +{ + SpellDestination(); + SpellDestination(float x, float y, float z, float orientation = 0.0f, uint32 mapId = MAPID_INVALID); + SpellDestination(Position const& pos); + SpellDestination(WorldObject const& wObj); + + WorldLocation _position; + uint64 _transportGUID; + Position _transportOffset; +}; + class SpellCastTargets { public: @@ -115,14 +127,16 @@ class SpellCastTargets void SetTradeItemTarget(Player* caster); void UpdateTradeSlotItem(); - Position const* GetSrc() const; + SpellDestination const* GetSrc() const; + Position const* GetSrcPos() const; void SetSrc(float x, float y, float z); void SetSrc(Position const& pos); void SetSrc(WorldObject const& wObj); void ModSrc(Position const& pos); void RemoveSrc(); - WorldLocation const* GetDst() const; + SpellDestination const* GetDst() const; + WorldLocation const* GetDstPos() const; void SetDst(float x, float y, float z, float orientation, uint32 mapId = MAPID_INVALID); void SetDst(Position const& pos); void SetDst(WorldObject const& wObj); @@ -139,7 +153,7 @@ class SpellCastTargets float GetSpeed() const { return m_speed; } void SetSpeed(float speed) { m_speed = speed; } - float GetDist2d() const { return m_srcPos.GetExactDist2d(&m_dstPos); } + float GetDist2d() const { return m_src._position.GetExactDist2d(&m_dst._position); } float GetSpeedXY() const { return m_speed * cos(m_elevation); } float GetSpeedZ() const { return m_speed * sin(m_elevation); } @@ -158,13 +172,8 @@ class SpellCastTargets uint64 m_itemTargetGUID; uint32 m_itemTargetEntry; - uint64 m_srcTransGUID; - Position m_srcTransOffset; - Position m_srcPos; - - uint64 m_dstTransGUID; - Position m_dstTransOffset; - WorldLocation m_dstPos; + SpellDestination m_src; + SpellDestination m_dst; float m_elevation, m_speed; std::string m_strTarget; @@ -197,11 +206,6 @@ enum SpellEffectHandleMode SPELL_EFFECT_HANDLE_HIT_TARGET, }; -namespace Trinity -{ - struct SpellNotifierCreatureAndPlayer; -} - class Spell { friend void Unit::SetCurrentCastedSpell(Spell* pSpell); @@ -450,7 +454,7 @@ class Spell void SetAutoRepeat(bool rep) { m_autoRepeat = rep; } void ReSetTimer() { m_timer = m_casttime > 0 ? m_casttime : 0; } bool IsNextMeleeSwingSpell() const; - bool IsTriggered() const {return _triggeredCastFlags & TRIGGERED_FULL_MASK;}; + bool IsTriggered() const { return _triggeredCastFlags & TRIGGERED_FULL_MASK; }; bool IsChannelActive() const { return m_caster->GetUInt32Value(UNIT_CHANNEL_SPELL) != 0; } bool IsAutoActionResetSpell() const; @@ -528,6 +532,7 @@ class Spell Unit* unitTarget; Item* itemTarget; GameObject* gameObjTarget; + WorldLocation* destTarget; int32 damage; SpellEffectHandleMode effectHandleMode; // used in effects handlers @@ -588,10 +593,13 @@ class Spell }; std::list m_UniqueItemInfo; - void AddUnitTarget(Unit* target, uint32 effectMask, bool checkIfValid = true); + SpellDestination m_destTargets[MAX_SPELL_EFFECTS]; + + void AddUnitTarget(Unit* target, uint32 effectMask, bool checkIfValid = true, bool implicit = true); void AddGOTarget(GameObject* target, uint32 effectMask); - void AddGOTarget(uint64 goGUID, uint32 effectMask); void AddItemTarget(Item* item, uint32 effectMask); + void AddDestTarget(SpellDestination const& dest, uint32 effIndex); + void DoAllEffectOnTarget(TargetInfo* target); SpellMissInfo DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleAura); void DoTriggersOnSpellHit(Unit* unit, uint8 effMask); @@ -624,13 +632,20 @@ class Spell void CallScriptAfterUnitTargetSelectHandlers(std::list& unitTargets, SpellEffIndex effIndex); std::list m_loadedScripts; - bool CanExecuteTriggersOnHit(uint8 effMask, SpellInfo const* spellInfo = NULL) const; + struct HitTriggerSpell + { + SpellInfo const* triggeredSpell; + SpellInfo const* triggeredByAura; + // uint8 triggeredByEffIdx This might be needed at a later stage - No need known for now + int32 chance; + }; + + bool CanExecuteTriggersOnHit(uint8 effMask, SpellInfo const* triggeredByAura = NULL) const; void PrepareTriggersExecutedOnHit(); - typedef std::list< std::pair > HitTriggerSpells; - HitTriggerSpells m_hitTriggerSpells; + typedef std::list HitTriggerSpellList; + HitTriggerSpellList m_hitTriggerSpells; // effect helpers - void GetSummonPosition(uint32 i, Position &pos, float radius = 0.0f, uint32 count = 0); void SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const* properties, uint32 numSummons); void CalculateJumpSpeeds(uint8 i, float dist, float & speedxy, float & speedz); diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 271d4859c4c..4069cd5271a 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -403,23 +403,6 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex) if (!unitTarget->HasAura(27825)) return; break; - // Cataclysmic Bolt - case 38441: - { - damage = unitTarget->CountPctFromMaxHealth(50); - break; - } - case 20625: // Ritual of Doom Sacrifice - case 29142: // Eyesore Blaster - case 35139: // Throw Boom's Doom - case 42393: // Brewfest - Attack Keg - case 55269: // Deathly Stare - case 56578: // Rapid-Fire Harpoon - case 62775: // Tympanic Tantrum - { - damage = unitTarget->CountPctFromMaxHealth(damage); - break; - } // Gargoyle Strike case 51963: { @@ -497,7 +480,8 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex) if (aura) { uint32 pdamage = uint32(std::max(aura->GetAmount(), 0)); - pdamage = m_caster->SpellDamageBonus(unitTarget, aura->GetSpellInfo(), pdamage, DOT, aura->GetBase()->GetStackAmount()); + pdamage = m_caster->SpellDamageBonusDone(unitTarget, aura->GetSpellInfo(), pdamage, DOT, aura->GetBase()->GetStackAmount()); + pdamage = unitTarget->SpellDamageBonusTaken(m_caster, aura->GetSpellInfo(), pdamage, DOT, aura->GetBase()->GetStackAmount()); uint32 pct_dir = m_caster->CalculateSpellDamage(unitTarget, m_spellInfo, (effIndex + 1)); uint8 baseTotalTicks = uint8(m_caster->CalcSpellDuration(aura->GetSpellInfo()) / aura->GetSpellInfo()->Effects[EFFECT_0].Amplitude); damage += int32(CalculatePctU(pdamage * baseTotalTicks, pct_dir)); @@ -535,7 +519,8 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex) // Shadow Word: Death - deals damage equal to damage done to caster if (m_spellInfo->SpellFamilyFlags[1] & 0x2) { - int32 back_damage = m_caster->SpellDamageBonus(unitTarget, m_spellInfo, (uint32)damage, SPELL_DIRECT_DAMAGE); + int32 back_damage = m_caster->SpellDamageBonusDone(unitTarget, m_spellInfo, (uint32)damage, SPELL_DIRECT_DAMAGE); + back_damage = unitTarget->SpellDamageBonusTaken(m_caster, m_spellInfo, (uint32)back_damage, SPELL_DIRECT_DAMAGE); // Pain and Suffering reduces damage if (AuraEffect* aurEff = m_caster->GetDummyAuraEffect(SPELLFAMILY_PRIEST, 2874, 0)) AddPctN(back_damage, -aurEff->GetAmount()); @@ -679,19 +664,19 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex) if (found) damage += m_spellInfo->Effects[EFFECT_1].CalcValue(); - if (m_caster->GetTypeId() == TYPEID_PLAYER) + if (Player* caster = m_caster->ToPlayer()) { // Add Ammo and Weapon damage plus RAP * 0.1 - Item* item = m_caster->ToPlayer()->GetWeaponForAttack(RANGED_ATTACK); - if (item) + if (Item* item = caster->GetWeaponForAttack(RANGED_ATTACK)) { - float dmg_min = item->GetTemplate()->DamageMin; - float dmg_max = item->GetTemplate()->DamageMax; + ItemTemplate const* weaponTemplate = item->GetTemplate(); + float dmg_min = weaponTemplate->Damage[0].DamageMin; + float dmg_max = weaponTemplate->Damage[0].DamageMax; if (dmg_max == 0.0f && dmg_min > dmg_max) damage += int32(dmg_min); else damage += irand(int32(dmg_min), int32(dmg_max)); - damage += int32(item->GetTemplate()->Delay*0.001f); + damage += int32(weaponTemplate->Delay * 0.001f); } } } @@ -742,7 +727,10 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex) } if (m_originalCaster && damage > 0 && apply_direct_bonus) - damage = m_originalCaster->SpellDamageBonus(unitTarget, m_spellInfo, (uint32)damage, SPELL_DIRECT_DAMAGE); + { + damage = m_originalCaster->SpellDamageBonusDone(unitTarget, m_spellInfo, (uint32)damage, SPELL_DIRECT_DAMAGE); + damage = unitTarget->SpellDamageBonusTaken(m_originalCaster, m_spellInfo, (uint32)damage, SPELL_DIRECT_DAMAGE); + } m_damage += damage; } @@ -787,7 +775,7 @@ void Spell::EffectDummy(SpellEffIndex effIndex) uint32 maxTargets = std::min(3, attackers.size()); for (uint32 i = 0; i < maxTargets; ++i) { - Unit* attacker = SelectRandomContainerElement(attackers); + Unit* attacker = Trinity::Containers::SelectRandomContainerElement(attackers); AddUnitTarget(attacker, 1 << 1); attackers.erase(attacker); } @@ -813,7 +801,7 @@ void Spell::EffectDummy(SpellEffIndex effIndex) bp = 46585; if (m_targets.HasDst()) - targets.SetDst(*m_targets.GetDst()); + targets.SetDst(*m_targets.GetDstPos()); else { targets.SetDst(*m_caster); @@ -827,8 +815,7 @@ void Spell::EffectDummy(SpellEffIndex effIndex) // Raise dead - take reagents and trigger summon spells case 48289: if (m_targets.HasDst()) - targets.SetDst(*m_targets.GetDst()); - + targets.SetDst(*m_targets.GetDstPos()); spell_id = CalculateDamage(0, NULL); break; } @@ -1044,7 +1031,7 @@ void Spell::EffectTriggerMissileSpell(SpellEffIndex effIndex) SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(triggered_spell_id); if (!spellInfo) { - sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell::EffectTriggerSpell spell %u tried to trigger unknown spell %u", m_spellInfo->Id, triggered_spell_id); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell::EffectTriggerMissileSpell spell %u tried to trigger unknown spell %u", m_spellInfo->Id, triggered_spell_id); return; } @@ -1116,10 +1103,6 @@ void Spell::EffectForceCast(SpellEffIndex effIndex) case 52349: // Overtake unitTarget->CastCustomSpell(unitTarget, spellInfo->Id, &damage, NULL, NULL, true, NULL, NULL, m_originalCasterGUID); return; - case 72378: // Blood Nova - case 73058: // Blood Nova - m_caster->CastSpell(unitTarget, damage, true); // additional spell cast - break; } } @@ -1190,7 +1173,7 @@ void Spell::EffectJumpDest(SpellEffIndex effIndex) // Init dest coordinates float x, y, z; - m_targets.GetDst()->GetPosition(x, y, z); + destTarget->GetPosition(x, y, z); float speedXY, speedZ; CalculateJumpSpeeds(effIndex, m_caster->GetExactDist2d(x, y), speedXY, speedZ); @@ -1263,11 +1246,11 @@ void Spell::EffectTeleportUnits(SpellEffIndex /*effIndex*/) } // Init dest coordinates - uint32 mapid = m_targets.GetDst()->GetMapId(); + uint32 mapid = destTarget->GetMapId(); if (mapid == MAPID_INVALID) mapid = unitTarget->GetMapId(); float x, y, z, orientation; - m_targets.GetDst()->GetPosition(x, y, z, orientation); + destTarget->GetPosition(x, y, z, orientation); if (!orientation && m_targets.GetUnitTarget()) orientation = m_targets.GetUnitTarget()->GetOrientation(); sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell::EffectTeleportUnits - teleport unit to %u %f %f %f %f\n", mapid, x, y, z, orientation); @@ -1426,7 +1409,8 @@ void Spell::EffectPowerDrain(SpellEffIndex effIndex) return; // add spell damage bonus - damage = m_caster->SpellDamageBonus(unitTarget, m_spellInfo, uint32(damage), SPELL_DIRECT_DAMAGE); + damage = m_caster->SpellDamageBonusDone(unitTarget, m_spellInfo, uint32(damage), SPELL_DIRECT_DAMAGE); + damage = unitTarget->SpellDamageBonusTaken(m_caster, m_spellInfo, uint32(damage), SPELL_DIRECT_DAMAGE); // resilience reduce mana draining effect at spell crit damage reduction (added in 2.4) int32 power = damage; @@ -1589,7 +1573,7 @@ void Spell::EffectHeal(SpellEffIndex /*effIndex*/) int32 tickheal = targetAura->GetAmount(); if (Unit* auraCaster = targetAura->GetCaster()) - tickheal = auraCaster->SpellHealingBonus(unitTarget, targetAura->GetSpellInfo(), tickheal, DOT); + tickheal = auraCaster->SpellHealingBonusDone(unitTarget, targetAura->GetSpellInfo(), tickheal, DOT); //int32 tickheal = targetAura->GetSpellInfo()->EffectBasePoints[idx] + 1; //It is said that talent bonus should not be included @@ -1610,11 +1594,12 @@ void Spell::EffectHeal(SpellEffIndex /*effIndex*/) //addhealth += tickheal * tickcount; //addhealth = caster->SpellHealingBonus(m_spellInfo, addhealth, HEAL, unitTarget); } - // Glyph of Nourish + // Nourish else if (m_spellInfo->SpellFamilyName == SPELLFAMILY_DRUID && m_spellInfo->SpellFamilyFlags[1] & 0x2000000) { - addhealth = caster->SpellHealingBonus(unitTarget, m_spellInfo, addhealth, HEAL); + addhealth = caster->SpellHealingBonusDone(unitTarget, m_spellInfo, addhealth, HEAL); + // Glyph of Nourish if (AuraEffect const* aurEff = m_caster->GetAuraEffect(62971, 0)) { Unit::AuraEffectList const& Periodic = unitTarget->GetAuraEffectsByType(SPELL_AURA_PERIODIC_HEAL); @@ -1625,25 +1610,13 @@ void Spell::EffectHeal(SpellEffIndex /*effIndex*/) } } } - // Lifebloom - final heal coef multiplied by original DoT stack - else if (m_spellInfo->Id == 33778) - addhealth = caster->SpellHealingBonus(unitTarget, m_spellInfo, addhealth, HEAL, m_spellValue->EffectBasePoints[1]); - // Riptide - increase healing done by Chain Heal - else if (m_spellInfo->SpellFamilyName == SPELLFAMILY_SHAMAN && m_spellInfo->SpellFamilyFlags[0] & 0x100) - { - addhealth = caster->SpellHealingBonus(unitTarget, m_spellInfo, addhealth, HEAL); - if (AuraEffect* aurEff = unitTarget->GetAuraEffect(SPELL_AURA_PERIODIC_HEAL, SPELLFAMILY_SHAMAN, 0, 0, 0x10, m_originalCasterGUID)) - { - addhealth = int32(addhealth * 1.25f); - // consume aura - unitTarget->RemoveAura(aurEff->GetBase()); - } - } // Death Pact - return pct of max health to caster else if (m_spellInfo->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT && m_spellInfo->SpellFamilyFlags[0] & 0x00080000) - addhealth = caster->SpellHealingBonus(unitTarget, m_spellInfo, int32(caster->CountPctFromMaxHealth(damage)), HEAL); + addhealth = caster->SpellHealingBonusDone(unitTarget, m_spellInfo, int32(caster->CountPctFromMaxHealth(damage)), HEAL); else - addhealth = caster->SpellHealingBonus(unitTarget, m_spellInfo, addhealth, HEAL); + addhealth = caster->SpellHealingBonusDone(unitTarget, m_spellInfo, addhealth, HEAL); + + addhealth = unitTarget->SpellHealingBonusTaken(caster, m_spellInfo, addhealth, HEAL); // Remove Grievious bite if fully healed if (unitTarget->HasAura(48920) && (unitTarget->GetHealth() + addhealth >= unitTarget->GetMaxHealth())) @@ -1669,7 +1642,10 @@ void Spell::EffectHealPct(SpellEffIndex /*effIndex*/) if (m_spellInfo->Id == 59754 && unitTarget == m_caster) return; - m_healing += m_originalCaster->SpellHealingBonus(unitTarget, m_spellInfo, unitTarget->CountPctFromMaxHealth(damage), HEAL); + uint32 heal = m_originalCaster->SpellHealingBonusDone(unitTarget, m_spellInfo, unitTarget->CountPctFromMaxHealth(damage), HEAL); + heal = unitTarget->SpellHealingBonusTaken(m_originalCaster, m_spellInfo, heal, HEAL); + + m_healing += heal; } void Spell::EffectHealMechanical(SpellEffIndex /*effIndex*/) @@ -1684,7 +1660,9 @@ void Spell::EffectHealMechanical(SpellEffIndex /*effIndex*/) if (!m_originalCaster) return; - m_healing += m_originalCaster->SpellHealingBonus(unitTarget, m_spellInfo, uint32(damage), HEAL); + uint32 heal = m_originalCaster->SpellHealingBonusDone(unitTarget, m_spellInfo, uint32(damage), HEAL); + + m_healing += unitTarget->SpellHealingBonusTaken(m_originalCaster, m_spellInfo, heal, HEAL); } void Spell::EffectHealthLeech(SpellEffIndex effIndex) @@ -1695,7 +1673,8 @@ void Spell::EffectHealthLeech(SpellEffIndex effIndex) if (!unitTarget || !unitTarget->isAlive() || damage < 0) return; - damage = m_caster->SpellDamageBonus(unitTarget, m_spellInfo, uint32(damage), SPELL_DIRECT_DAMAGE); + damage = m_caster->SpellDamageBonusDone(unitTarget, m_spellInfo, uint32(damage), SPELL_DIRECT_DAMAGE); + damage = unitTarget->SpellDamageBonusTaken(m_caster, m_spellInfo, uint32(damage), SPELL_DIRECT_DAMAGE); sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "HealthLeech :%i", damage); @@ -1707,7 +1686,9 @@ void Spell::EffectHealthLeech(SpellEffIndex effIndex) if (m_caster->isAlive()) { - healthGain = m_caster->SpellHealingBonus(m_caster, m_spellInfo, healthGain, HEAL); + healthGain = m_caster->SpellHealingBonusDone(m_caster, m_spellInfo, healthGain, HEAL); + healthGain = m_caster->SpellHealingBonusTaken(m_caster, m_spellInfo, healthGain, HEAL); + m_caster->HealBySpell(m_caster, m_spellInfo, uint32(healthGain)); } } @@ -1896,7 +1877,7 @@ void Spell::EffectPersistentAA(SpellEffIndex effIndex) if (!caster->IsInWorld()) return; DynamicObject* dynObj = new DynamicObject(false); - if (!dynObj->CreateDynamicObject(sObjectMgr->GenerateLowGuid(HIGHGUID_DYNAMICOBJECT), caster, m_spellInfo->Id, *m_targets.GetDst(), radius, DYNAMIC_OBJECT_AREA_SPELL)) + if (!dynObj->CreateDynamicObject(sObjectMgr->GenerateLowGuid(HIGHGUID_DYNAMICOBJECT), caster, m_spellInfo->Id, *destTarget, radius, DYNAMIC_OBJECT_AREA_SPELL)) { delete dynObj; return; @@ -2006,7 +1987,7 @@ void Spell::EffectEnergize(SpellEffIndex effIndex) sSpellMgr->GetSetOfSpellsInSpellGroup(SPELL_GROUP_ELIXIR_GUARDIAN, avalibleElixirs); if (!battleFound) sSpellMgr->GetSetOfSpellsInSpellGroup(SPELL_GROUP_ELIXIR_BATTLE, avalibleElixirs); - for (std::set::iterator itr = avalibleElixirs.begin(); itr != avalibleElixirs.end() ;) + for (std::set::iterator itr = avalibleElixirs.begin(); itr != avalibleElixirs.end();) { SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(*itr); if (spellInfo->SpellLevel < m_spellInfo->SpellLevel || spellInfo->SpellLevel > unitTarget->getLevel()) @@ -2022,7 +2003,7 @@ void Spell::EffectEnergize(SpellEffIndex effIndex) if (!avalibleElixirs.empty()) { // cast random elixir on target - m_caster->CastSpell(unitTarget, SelectRandomContainerElement(avalibleElixirs), true, m_CastItem); + m_caster->CastSpell(unitTarget, Trinity::Containers::SelectRandomContainerElement(avalibleElixirs), true, m_CastItem); } } } @@ -2370,9 +2351,6 @@ void Spell::EffectSummonType(SpellEffIndex effIndex) if (Player* modOwner = m_originalCaster->GetSpellModOwner()) modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_DURATION, duration); - Position pos; - GetSummonPosition(effIndex, pos); - TempSummon* summon = NULL; // determine how many units should be summoned @@ -2426,11 +2404,11 @@ void Spell::EffectSummonType(SpellEffIndex effIndex) // Summons a vehicle, but doesn't force anyone to enter it (see SUMMON_CATEGORY_VEHICLE) case SUMMON_TYPE_VEHICLE: case SUMMON_TYPE_VEHICLE2: - summon = m_caster->GetMap()->SummonCreature(entry, pos, properties, duration, m_originalCaster, m_spellInfo->Id); + summon = m_caster->GetMap()->SummonCreature(entry, *destTarget, properties, duration, m_originalCaster, m_spellInfo->Id); break; case SUMMON_TYPE_TOTEM: { - summon = m_caster->GetMap()->SummonCreature(entry, pos, properties, duration, m_originalCaster, m_spellInfo->Id); + summon = m_caster->GetMap()->SummonCreature(entry, *destTarget, properties, duration, m_originalCaster, m_spellInfo->Id); if (!summon || !summon->isTotem()) return; @@ -2447,12 +2425,12 @@ void Spell::EffectSummonType(SpellEffIndex effIndex) } case SUMMON_TYPE_MINIPET: { - summon = m_caster->GetMap()->SummonCreature(entry, pos, properties, duration, m_originalCaster, m_spellInfo->Id); + summon = m_caster->GetMap()->SummonCreature(entry, *destTarget, properties, duration, m_originalCaster, m_spellInfo->Id); if (!summon || !summon->HasUnitTypeMask(UNIT_MASK_MINION)) return; - summon->SelectLevel(summon->GetCreatureInfo()); // some summoned creaters have different from 1 DB data for level/hp - summon->SetUInt32Value(UNIT_NPC_FLAGS, summon->GetCreatureInfo()->npcflag); + summon->SelectLevel(summon->GetCreatureTemplate()); // some summoned creaters have different from 1 DB data for level/hp + summon->SetUInt32Value(UNIT_NPC_FLAGS, summon->GetCreatureTemplate()->npcflag); summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); @@ -2467,9 +2445,14 @@ void Spell::EffectSummonType(SpellEffIndex effIndex) for (uint32 count = 0; count < numSummons; ++count) { - GetSummonPosition(effIndex, pos, radius, count); + Position pos; + if (count == 0) + pos = *destTarget; + else + // randomize position for multiple summons + m_caster->GetRandomPoint(*destTarget, radius, pos); - summon = m_originalCaster->SummonCreature(entry, pos, summonType, duration); + summon = m_originalCaster->SummonCreature(entry, *destTarget, summonType, duration); if (!summon) continue; @@ -2490,14 +2473,14 @@ void Spell::EffectSummonType(SpellEffIndex effIndex) SummonGuardian(effIndex, entry, properties, numSummons); break; case SUMMON_CATEGORY_PUPPET: - summon = m_caster->GetMap()->SummonCreature(entry, pos, properties, duration, m_originalCaster, m_spellInfo->Id); + summon = m_caster->GetMap()->SummonCreature(entry, *destTarget, properties, duration, m_originalCaster, m_spellInfo->Id); break; case SUMMON_CATEGORY_VEHICLE: // Summoning spells (usually triggered by npc_spellclick) that spawn a vehicle and that cause the clicker // to cast a ride vehicle spell on the summoned unit. float x, y, z; m_caster->GetClosePoint(x, y, z, DEFAULT_WORLD_OBJECT_SIZE); - summon = m_originalCaster->GetMap()->SummonCreature(entry, pos, properties, duration, m_caster, m_spellInfo->Id); + summon = m_originalCaster->GetMap()->SummonCreature(entry, *destTarget, properties, duration, m_caster, m_spellInfo->Id); if (!summon || !summon->IsVehicle()) return; @@ -2548,7 +2531,6 @@ void Spell::EffectLearnSpell(SpellEffIndex effIndex) } typedef std::list< std::pair > DispelList; -typedef std::list< std::pair > DispelChargesList; void Spell::EffectDispel(SpellEffIndex effIndex) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) @@ -2557,48 +2539,12 @@ void Spell::EffectDispel(SpellEffIndex effIndex) if (!unitTarget) return; - DispelChargesList dispel_list; - // Create dispel mask by dispel type uint32 dispel_type = m_spellInfo->Effects[effIndex].MiscValue; uint32 dispelMask = SpellInfo::GetDispelMask(DispelType(dispel_type)); - // we should not be able to dispel diseases if the target is affected by unholy blight - if (dispelMask & (1 << DISPEL_DISEASE) && unitTarget->HasAura(50536)) - dispelMask &= ~(1 << DISPEL_DISEASE); - - Unit::AuraMap const& auras = unitTarget->GetOwnedAuras(); - for (Unit::AuraMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr) - { - Aura* aura = itr->second; - AuraApplication * aurApp = aura->GetApplicationOfTarget(unitTarget->GetGUID()); - if (!aurApp) - continue; - - // don't try to remove passive auras - if (aura->IsPassive()) - continue; - - if (aura->GetSpellInfo()->GetDispelMask() & dispelMask) - { - if (aura->GetSpellInfo()->Dispel == DISPEL_MAGIC) - { - // do not remove positive auras if friendly target - // negative auras if non-friendly target - if (aurApp->IsPositive() == unitTarget->IsFriendlyTo(m_caster)) - continue; - } - - // The charges / stack amounts don't count towards the total number of auras that can be dispelled. - // Ie: A dispel on a target with 5 stacks of Winters Chill and a Polymorph has 1 / (1 + 1) -> 50% chance to dispell - // Polymorph instead of 1 / (5 + 1) -> 16%. - bool dispel_charges = aura->GetSpellInfo()->AttributesEx7 & SPELL_ATTR7_DISPEL_CHARGES; - uint8 charges = dispel_charges ? aura->GetCharges() : aura->GetStackAmount(); - if (charges > 0) - dispel_list.push_back(std::make_pair(aura, charges)); - } - } - + DispelChargesList dispel_list; + unitTarget->GetDispellableAuraList(m_caster, dispelMask, dispel_list); if (dispel_list.empty()) return; @@ -2719,7 +2665,7 @@ void Spell::EffectDistract(SpellEffIndex /*effIndex*/) if (unitTarget->HasUnitState(UNIT_STATE_CONFUSED | UNIT_STATE_STUNNED | UNIT_STATE_FLEEING)) return; - unitTarget->SetFacingTo(unitTarget->GetAngle(m_targets.GetDst())); + unitTarget->SetFacingTo(unitTarget->GetAngle(destTarget)); unitTarget->ClearUnitState(UNIT_STATE_MOVING); if (unitTarget->GetTypeId() == TYPEID_UNIT) @@ -2758,7 +2704,7 @@ void Spell::EffectAddFarsight(SpellEffIndex effIndex) return; DynamicObject* dynObj = new DynamicObject(true); - if (!dynObj->CreateDynamicObject(sObjectMgr->GenerateLowGuid(HIGHGUID_DYNAMICOBJECT), m_caster, m_spellInfo->Id, *m_targets.GetDst(), radius, DYNAMIC_OBJECT_FARSIGHT_FOCUS)) + if (!dynObj->CreateDynamicObject(sObjectMgr->GenerateLowGuid(HIGHGUID_DYNAMICOBJECT), m_caster, m_spellInfo->Id, *destTarget, radius, DYNAMIC_OBJECT_FARSIGHT_FOCUS)) { delete dynObj; return; @@ -2810,7 +2756,7 @@ void Spell::EffectLearnSkill(SpellEffIndex effIndex) if (damage < 0) return; - uint32 skillid = m_spellInfo->Effects[effIndex].MiscValue; + uint32 skillid = m_spellInfo->Effects[effIndex].MiscValue; uint16 skillval = unitTarget->ToPlayer()->GetPureSkillValue(skillid); unitTarget->ToPlayer()->SetSkill(skillid, m_spellInfo->Effects[effIndex].CalcValue(), skillval?skillval:1, damage*75); } @@ -3381,7 +3327,7 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex) if (m_spellInfo->Id == 20467) { spell_bonus += int32(0.08f * m_caster->GetTotalAttackPowerValue(BASE_ATTACK)); - spell_bonus += int32(0.13f * m_caster->SpellBaseDamageBonus(m_spellInfo->GetSchoolMask())); + spell_bonus += int32(0.13f * m_caster->SpellBaseDamageBonusDone(m_spellInfo->GetSchoolMask())); } break; } @@ -3550,8 +3496,9 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex) uint32 eff_damage(std::max(weaponDamage, 0)); // Add melee damage bonuses (also check for negative) - m_caster->MeleeDamageBonus(unitTarget, &eff_damage, m_attackType, m_spellInfo); - m_damage += eff_damage; + uint32 damage = m_caster->MeleeDamageBonusDone(unitTarget, eff_damage, m_attackType, m_spellInfo); + + m_damage += unitTarget->MeleeDamageBonusTaken(m_caster, damage, m_attackType, m_spellInfo); } void Spell::EffectThreat(SpellEffIndex /*effIndex*/) @@ -3576,7 +3523,7 @@ void Spell::EffectHealMaxHealth(SpellEffIndex /*effIndex*/) if (!unitTarget || !unitTarget->isAlive()) return; - int32 addhealth; + int32 addhealth = 0; if (m_spellInfo->SpellFamilyName == SPELLFAMILY_PALADIN) // Lay on Hands { if (m_caster->GetGUID() == unitTarget->GetGUID()) @@ -3593,8 +3540,7 @@ void Spell::EffectHealMaxHealth(SpellEffIndex /*effIndex*/) else addhealth = unitTarget->GetMaxHealth() - unitTarget->GetHealth(); - if (m_originalCaster) - m_healing += m_originalCaster->SpellHealingBonus(unitTarget, m_spellInfo, addhealth, HEAL); + m_healing += addhealth; } void Spell::EffectInterruptCast(SpellEffIndex effIndex) @@ -3647,7 +3593,7 @@ void Spell::EffectSummonObjectWild(SpellEffIndex effIndex) float x, y, z; if (m_targets.HasDst()) - m_targets.GetDst()->GetPosition(x, y, z); + destTarget->GetPosition(x, y, z); else m_caster->GetClosePoint(x, y, z, DEFAULT_WORLD_OBJECT_SIZE); @@ -4032,7 +3978,9 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) while (bag) // 256 = 0 due to var type { item = m_caster->ToPlayer()->GetItemByPos(bag, slot); - if (item && item->GetEntry() == 38587) break; + if (item && item->GetEntry() == 38587) + break; + ++slot; if (slot == 39) { @@ -4190,7 +4138,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) float radius = m_spellInfo->Effects[effIndex].CalcRadius(); for (uint8 i = 0; i < 15; ++i) { - m_caster->GetRandomPoint(*m_targets.GetDst(), radius, x, y, z); + m_caster->GetRandomPoint(*destTarget, radius, x, y, z); m_caster->CastSpell(x, y, z, 54522, true); } break; @@ -4622,7 +4570,8 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) 45684 // Polymorph }; - static uint32 const spellTarget[5] = { + static uint32 const spellTarget[5] = + { 45673, // Bigger! 45672, // Shrunk 45677, // Yellow @@ -5075,7 +5024,7 @@ void Spell::EffectEnchantHeldItem(SpellEffIndex effIndex) return; // must be equipped - if (!item ->IsEquipped()) + if (!item->IsEquipped()) return; if (m_spellInfo->Effects[effIndex].MiscValue) @@ -5230,7 +5179,7 @@ void Spell::EffectSummonObject(SpellEffIndex effIndex) float x, y, z; // If dest location if present if (m_targets.HasDst()) - m_targets.GetDst()->GetPosition(x, y, z); + destTarget->GetPosition(x, y, z); // Summon in random point all other units if location present else m_caster->GetClosePoint(x, y, z, DEFAULT_WORLD_OBJECT_SIZE); @@ -5360,7 +5309,7 @@ void Spell::EffectLeap(SpellEffIndex /*effIndex*/) return; Position pos; - m_targets.GetDst()->GetPosition(&pos); + destTarget->GetPosition(&pos); unitTarget->GetFirstCollisionPosition(pos, unitTarget->GetDistance(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ() + 2.0f), 0.0f); unitTarget->NearTeleportTo(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), unitTarget == m_caster); } @@ -5484,7 +5433,7 @@ void Spell::EffectSkinning(SpellEffIndex /*effIndex*/) Creature* creature = unitTarget->ToCreature(); int32 targetLevel = creature->getLevel(); - uint32 skill = creature->GetCreatureInfo()->GetRequiredLootSkill(); + uint32 skill = creature->GetCreatureTemplate()->GetRequiredLootSkill(); m_caster->ToPlayer()->SendLoot(creature->GetGUID(), LOOT_SKINNING); creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); @@ -5532,7 +5481,7 @@ void Spell::EffectChargeDest(SpellEffIndex /*effIndex*/) if (m_targets.HasDst()) { Position pos; - m_targets.GetDst()->GetPosition(&pos); + destTarget->GetPosition(&pos); float angle = m_caster->GetRelativeAngle(pos.GetPositionX(), pos.GetPositionY()); float dist = m_caster->GetDistance(pos); m_caster->GetFirstCollisionPosition(pos, dist, angle); @@ -5583,7 +5532,7 @@ void Spell::EffectKnockBack(SpellEffIndex effIndex) if (m_spellInfo->Effects[effIndex].Effect == SPELL_EFFECT_KNOCK_BACK_DEST) { if (m_targets.HasDst()) - m_targets.GetDst()->GetPosition(x, y); + destTarget->GetPosition(x, y); else return; } @@ -5671,7 +5620,7 @@ void Spell::EffectPullTowards(SpellEffIndex effIndex) if (m_spellInfo->Effects[effIndex].Effect == SPELL_EFFECT_PULL_TOWARDS_DEST) { if (m_targets.HasDst()) - pos.Relocate(*m_targets.GetDst()); + pos.Relocate(*destTarget); else return; } @@ -5722,7 +5671,7 @@ void Spell::EffectSummonDeadPet(SpellEffIndex /*effIndex*/) return; Pet* pet = player->GetPet(); - if (!pet || pet->isAlive()) + if (pet && pet->isAlive()) return; if (damage < 0) @@ -5730,6 +5679,14 @@ void Spell::EffectSummonDeadPet(SpellEffIndex /*effIndex*/) float x, y, z; player->GetPosition(x, y, z); + if (!pet) + { + player->SummonPet(0, x, y, z, player->GetOrientation(), SUMMON_PET, 0); + pet = player->GetPet(); + } + if (!pet) + return; + player->GetMap()->CreatureRelocation(pet, x, y, z, player->GetOrientation()); pet->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_NONE); @@ -5858,7 +5815,7 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex) float fx, fy, fz; if (m_targets.HasDst()) - m_targets.GetDst()->GetPosition(fx, fy, fz); + destTarget->GetPosition(fx, fy, fz); //FIXME: this can be better check for most objects but still hack else if (m_spellInfo->Effects[effIndex].HasRadius() && m_spellInfo->Speed == 0) { @@ -6439,7 +6396,11 @@ void Spell::SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const* for (uint32 count = 0; count < numGuardians; ++count) { Position pos; - GetSummonPosition(i, pos, radius, count); + if (count == 0) + pos = *destTarget; + else + // randomize position for multiple summons + m_caster->GetRandomPoint(*destTarget, radius, pos); TempSummon* summon = map->SummonCreature(entry, pos, properties, duration, caster, m_spellInfo->Id); if (!summon) @@ -6470,44 +6431,6 @@ void Spell::SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const* } } -void Spell::GetSummonPosition(uint32 i, Position &pos, float radius, uint32 count) -{ - pos.SetOrientation(m_caster->GetOrientation()); - - if (m_targets.HasDst()) - { - // Summon 1 unit in dest location - if (count == 0) - pos.Relocate(*m_targets.GetDst()); - // Summon in random point all other units if location present - else - { - //This is a workaround. Do not have time to write much about it - switch (m_spellInfo->Effects[i].TargetA.GetTarget()) - { - case TARGET_DEST_CASTER_SUMMON: - case TARGET_DEST_CASTER_RANDOM: - m_caster->GetNearPosition(pos, radius * (float)rand_norm(), (float)rand_norm()*static_cast(2*M_PI)); - break; - case TARGET_DEST_DEST_RANDOM: - case TARGET_DEST_TARGET_RANDOM: - m_caster->GetRandomPoint(*m_targets.GetDst(), radius, pos); - break; - default: - pos.Relocate(*m_targets.GetDst()); - break; - } - } - } - // Summon if dest location not present near caster - else - { - float x, y, z; - m_caster->GetClosePoint(x, y, z, 3.0f); - pos.Relocate(x, y, z); - } -} - void Spell::EffectRenamePet(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 8b8f1fb5afc..183ca747b37 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -61,11 +61,6 @@ bool SpellImplicitTargetInfo::IsArea() const return GetSelectionCategory() == TARGET_SELECT_CATEGORY_AREA || GetSelectionCategory() == TARGET_SELECT_CATEGORY_CONE; } -SpellSelectTargetTypes SpellImplicitTargetInfo::GetType() const -{ - return Type[_target]; -} - SpellTargetSelectionCategories SpellImplicitTargetInfo::GetSelectionCategory() const { return _data[_target].SelectionCategory; @@ -104,7 +99,7 @@ float SpellImplicitTargetInfo::CalcDirectionAngle() const case TARGET_DIR_LEFT: return static_cast(M_PI/2); case TARGET_DIR_FRONT_RIGHT: - return static_cast(M_PI/4); + return static_cast(-M_PI/4); case TARGET_DIR_BACK_RIGHT: return static_cast(-3*M_PI/4); case TARGET_DIR_BACK_LEFT: @@ -207,144 +202,6 @@ uint32 SpellImplicitTargetInfo::GetExplicitTargetMask(bool& srcSet, bool& dstSet return targetMask; } -bool SpellImplicitTargetInfo::InitStaticData() -{ - InitTypeData(); - return true; -} - -void SpellImplicitTargetInfo::InitTypeData() -{ - for (uint8 i = 0; i < TOTAL_SPELL_TARGETS; ++i) - { - switch (i) - { - case TARGET_UNIT_CASTER: - case TARGET_DEST_CASTER_FISHING: - case TARGET_UNIT_MASTER: - case TARGET_UNIT_PET: - case TARGET_UNIT_CASTER_AREA_PARTY: - case TARGET_UNIT_CASTER_AREA_RAID: - case TARGET_UNIT_VEHICLE: - case TARGET_UNIT_PASSENGER_0: - case TARGET_UNIT_PASSENGER_1: - case TARGET_UNIT_PASSENGER_2: - case TARGET_UNIT_PASSENGER_3: - case TARGET_UNIT_PASSENGER_4: - case TARGET_UNIT_PASSENGER_5: - case TARGET_UNIT_PASSENGER_6: - case TARGET_UNIT_PASSENGER_7: - case TARGET_UNIT_SUMMONER: - Type[i] = TARGET_TYPE_UNIT_CASTER; - break; - case TARGET_UNIT_TARGET_MINIPET: - case TARGET_UNIT_TARGET_ALLY: - case TARGET_UNIT_TARGET_RAID: - case TARGET_UNIT_TARGET_ANY: - case TARGET_UNIT_TARGET_ENEMY: - case TARGET_UNIT_TARGET_PARTY: - case TARGET_UNIT_TARGET_PASSENGER: - case TARGET_UNIT_LASTTARGET_AREA_PARTY: - case TARGET_UNIT_TARGET_AREA_RAID_CLASS: - case TARGET_UNIT_TARGET_CHAINHEAL_ALLY: - Type[i] = TARGET_TYPE_UNIT_TARGET; - break; - case TARGET_UNIT_NEARBY_ENEMY: - case TARGET_UNIT_NEARBY_ALLY: - case TARGET_UNIT_NEARBY_ENTRY: - case TARGET_UNIT_NEARBY_PARTY: - case TARGET_UNIT_NEARBY_RAID: - case TARGET_GAMEOBJECT_NEARBY_ENTRY: - Type[i] = TARGET_TYPE_UNIT_NEARBY; - break; - case TARGET_UNIT_SRC_AREA_ENEMY: - case TARGET_UNIT_SRC_AREA_ALLY: - case TARGET_UNIT_SRC_AREA_ENTRY: - case TARGET_UNIT_SRC_AREA_PARTY: - case TARGET_GAMEOBJECT_SRC_AREA: - Type[i] = TARGET_TYPE_AREA_SRC; - break; - case TARGET_UNIT_DEST_AREA_ENEMY: - case TARGET_UNIT_DEST_AREA_ALLY: - case TARGET_UNIT_DEST_AREA_ENTRY: - case TARGET_UNIT_DEST_AREA_PARTY: - case TARGET_GAMEOBJECT_DEST_AREA: - Type[i] = TARGET_TYPE_AREA_DST; - break; - case TARGET_UNIT_CONE_ENEMY_24: - case TARGET_UNIT_CONE_ALLY: - case TARGET_UNIT_CONE_ENTRY: - case TARGET_UNIT_CONE_ENEMY_54: - case TARGET_UNIT_CONE_ENEMY_104: - case TARGET_GAMEOBJECT_CONE: - Type[i] = TARGET_TYPE_AREA_CONE; - break; - case TARGET_DEST_CASTER: - case TARGET_SRC_CASTER: - case TARGET_DEST_CASTER_SUMMON: - case TARGET_DEST_CASTER_FRONT_LEAP: - case TARGET_DEST_CASTER_FRONT: - case TARGET_DEST_CASTER_BACK: - case TARGET_DEST_CASTER_RIGHT: - case TARGET_DEST_CASTER_LEFT: - case TARGET_DEST_CASTER_FRONT_LEFT: - case TARGET_DEST_CASTER_BACK_LEFT: - case TARGET_DEST_CASTER_BACK_RIGHT: - case TARGET_DEST_CASTER_FRONT_RIGHT: - case TARGET_DEST_CASTER_RANDOM: - case TARGET_DEST_CASTER_RADIUS: - Type[i] = TARGET_TYPE_DEST_CASTER; - break; - case TARGET_DEST_TARGET_ENEMY: - case TARGET_DEST_TARGET_ANY: - case TARGET_DEST_TARGET_FRONT: - case TARGET_DEST_TARGET_BACK: - case TARGET_DEST_TARGET_RIGHT: - case TARGET_DEST_TARGET_LEFT: - case TARGET_DEST_TARGET_FRONT_LEFT: - case TARGET_DEST_TARGET_BACK_LEFT: - case TARGET_DEST_TARGET_BACK_RIGHT: - case TARGET_DEST_TARGET_FRONT_RIGHT: - case TARGET_DEST_TARGET_RANDOM: - case TARGET_DEST_TARGET_RADIUS: - Type[i] = TARGET_TYPE_DEST_TARGET; - break; - case TARGET_DEST_DYNOBJ_ENEMY: - case TARGET_DEST_DYNOBJ_ALLY: - case TARGET_DEST_DYNOBJ_NONE: - case TARGET_DEST_DEST: - case TARGET_DEST_TRAJ: - case TARGET_DEST_DEST_FRONT_LEFT: - case TARGET_DEST_DEST_BACK_LEFT: - case TARGET_DEST_DEST_BACK_RIGHT: - case TARGET_DEST_DEST_FRONT_RIGHT: - case TARGET_DEST_DEST_FRONT: - case TARGET_DEST_DEST_BACK: - case TARGET_DEST_DEST_RIGHT: - case TARGET_DEST_DEST_LEFT: - case TARGET_DEST_DEST_RANDOM: - case TARGET_DEST_DEST_RADIUS: - Type[i] = TARGET_TYPE_DEST_DEST; - break; - case TARGET_DEST_DB: - case TARGET_DEST_HOME: - case TARGET_DEST_NEARBY_ENTRY: - Type[i] = TARGET_TYPE_DEST_SPECIAL; - break; - case TARGET_UNIT_CHANNEL_TARGET: - case TARGET_DEST_CHANNEL_TARGET: - case TARGET_DEST_CHANNEL_CASTER: - Type[i] = TARGET_TYPE_CHANNEL; - break; - default: - Type[i] = TARGET_TYPE_DEFAULT; - } - } -} - -bool SpellImplicitTargetInfo::Init = SpellImplicitTargetInfo::InitStaticData(); -SpellSelectTargetTypes SpellImplicitTargetInfo::Type[TOTAL_SPELL_TARGETS]; - SpellImplicitTargetInfo::StaticData SpellImplicitTargetInfo::_data[TOTAL_SPELL_TARGETS] = { {TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // @@ -496,7 +353,7 @@ bool SpellEffectInfo::IsEffect() const bool SpellEffectInfo::IsEffect(SpellEffects effectName) const { - return Effect == effectName; + return Effect == uint32(effectName); } bool SpellEffectInfo::IsAura() const @@ -759,7 +616,7 @@ SpellEffectInfo::StaticData SpellEffectInfo::_data[TOTAL_SPELL_EFFECTS] = {EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT}, // 66 SPELL_EFFECT_CREATE_MANA_GEM {EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT}, // 67 SPELL_EFFECT_HEAL_MAX_HEALTH {EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT}, // 68 SPELL_EFFECT_INTERRUPT_CAST - {EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT}, // 69 SPELL_EFFECT_DISTRACT + {EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT_AND_DEST}, // 69 SPELL_EFFECT_DISTRACT {EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT}, // 70 SPELL_EFFECT_PULL {EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT}, // 71 SPELL_EFFECT_PICKPOCKET {EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_DEST}, // 72 SPELL_EFFECT_ADD_FARSIGHT @@ -1410,7 +1267,6 @@ bool SpellInfo::IsAuraExclusiveBySpecificWith(SpellInfo const* spellInfo) const SpellSpecificType spellSpec2 = spellInfo->GetSpellSpecific(); switch (spellSpec1) { - case SPELL_SPECIFIC_PHASE: case SPELL_SPECIFIC_TRACKER: case SPELL_SPECIFIC_WARLOCK_ARMOR: case SPELL_SPECIFIC_MAGE_ARMOR: @@ -2129,8 +1985,6 @@ SpellSpecificType SpellInfo::GetSpellSpecific() const case SPELL_AURA_TRACK_RESOURCES: case SPELL_AURA_TRACK_STEALTHED: return SPELL_SPECIFIC_TRACKER; - case SPELL_AURA_PHASE: - return SPELL_SPECIFIC_PHASE; } } } @@ -2193,6 +2047,33 @@ uint32 SpellInfo::CalcCastTime(Unit* caster, Spell* spell) const return (castTime > 0) ? uint32(castTime) : 0; } +uint32 SpellInfo::GetMaxTicks() const +{ + int32 DotDuration = GetDuration(); + if (DotDuration == 0) + return 1; + + // 200% limit + if (DotDuration > 30000) + DotDuration = 30000; + + for (uint8 x = 0; x < MAX_SPELL_EFFECTS; x++) + { + if (Effects[x].Effect == SPELL_EFFECT_APPLY_AURA) + switch (Effects[x].ApplyAuraName) + { + case SPELL_AURA_PERIODIC_DAMAGE: + case SPELL_AURA_PERIODIC_HEAL: + case SPELL_AURA_PERIODIC_LEECH: + if (Effects[x].Amplitude != 0) + return DotDuration / Effects[x].Amplitude; + break; + } + } + + return 6; +} + uint32 SpellInfo::GetRecoveryTime() const { return RecoveryTime > CategoryRecoveryTime ? RecoveryTime : CategoryRecoveryTime; @@ -2397,12 +2278,12 @@ bool SpellInfo::_IsPositiveEffect(uint8 effIndex, bool deep) const switch (Id) { case 34700: // Allergic Reaction - case 61716: // Rabbit Costume - case 61734: // Noblegarden Bunny case 61987: // Avenging Wrath Marker case 61988: // Divine Shield exclude aura case 62532: // Conservator's Grip return false; + case 61716: // Rabbit Costume + case 61734: // Noblegarden Bunny case 30877: // Tag Murloc case 62344: // Fists of Stone return true; diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h index baf03589794..a338b8d627f 100644 --- a/src/server/game/Spells/SpellInfo.h +++ b/src/server/game/Spells/SpellInfo.h @@ -133,22 +133,6 @@ enum SpellTargetDirectionTypes TARGET_DIR_ENTRY, }; -enum SpellSelectTargetTypes -{ - TARGET_TYPE_DEFAULT, - TARGET_TYPE_UNIT_CASTER, - TARGET_TYPE_UNIT_TARGET, - TARGET_TYPE_UNIT_NEARBY, - TARGET_TYPE_AREA_SRC, - TARGET_TYPE_AREA_DST, - TARGET_TYPE_AREA_CONE, - TARGET_TYPE_DEST_CASTER, - TARGET_TYPE_DEST_TARGET, - TARGET_TYPE_DEST_DEST, - TARGET_TYPE_DEST_SPECIAL, - TARGET_TYPE_CHANNEL, -}; - enum SpellEffectImplicitTargetTypes { EFFECT_IMPLICIT_TARGET_NONE = 0, @@ -182,7 +166,6 @@ enum SpellSpecificType SPELL_SPECIFIC_WARRIOR_ENRAGE = 26, SPELL_SPECIFIC_PRIEST_DIVINE_SPIRIT = 27, SPELL_SPECIFIC_HAND = 28, - SPELL_SPECIFIC_PHASE = 29, }; enum SpellCustomAttributes @@ -218,7 +201,6 @@ public: SpellImplicitTargetInfo(uint32 target); bool IsArea() const; - SpellSelectTargetTypes GetType() const; SpellTargetSelectionCategories GetSelectionCategory() const; SpellTargetReferenceTypes GetReferenceType() const; SpellTargetObjectTypes GetObjectType() const; @@ -229,14 +211,7 @@ public: Targets GetTarget() const; uint32 GetExplicitTargetMask(bool& srcSet, bool& dstSet) const; - // temporarily avalible to public - static SpellSelectTargetTypes Type[TOTAL_SPELL_TARGETS]; private: - static bool InitStaticData(); - static void InitTypeData(); - - static bool Init; - struct StaticData { SpellTargetObjectTypes ObjectType; // type of object returned by target type @@ -508,6 +483,8 @@ public: int32 GetDuration() const; int32 GetMaxDuration() const; + uint32 GetMaxTicks() const; + uint32 CalcCastTime(Unit* caster = NULL, Spell* spell = NULL) const; uint32 GetRecoveryTime() const; diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 67bd7939d70..117953f2bc0 100755 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -111,24 +111,14 @@ DiminishingGroup GetDiminishingReturnsGroupForSpell(SpellInfo const* spellproto, } case SPELLFAMILY_WARLOCK: { - // Death Coil - if (spellproto->SpellFamilyFlags[0] & 0x80000) - return DIMINISHING_HORROR; // Curses/etc - else if ((spellproto->SpellFamilyFlags[0] & 0x80000000) || (spellproto->SpellFamilyFlags[1] & 0x200)) + if ((spellproto->SpellFamilyFlags[0] & 0x80000000) || (spellproto->SpellFamilyFlags[1] & 0x200)) return DIMINISHING_LIMITONLY; // Seduction else if (spellproto->SpellFamilyFlags[1] & 0x10000000) return DIMINISHING_FEAR; break; } - case SPELLFAMILY_PRIEST: - { - // Psychic Horror - if (spellproto->SpellFamilyFlags[2] & 0x2000) - return DIMINISHING_HORROR; - break; - } case SPELLFAMILY_DRUID: { // Pounce @@ -228,6 +218,8 @@ DiminishingGroup GetDiminishingReturnsGroupForSpell(SpellInfo const* spellproto, return DIMINISHING_BANISH; if (mechanic & (1 << MECHANIC_ROOT)) return triggered ? DIMINISHING_ROOT : DIMINISHING_CONTROLLED_ROOT; + if (mechanic & (1 << MECHANIC_HORROR)) + return DIMINISHING_HORROR; return DIMINISHING_NONE; } @@ -651,7 +643,7 @@ SpellSpellGroupMapBounds SpellMgr::GetSpellSpellGroupMapBounds(uint32 spell_id) uint32 SpellMgr::IsSpellMemberOfSpellGroup(uint32 spellid, SpellGroup groupid) const { SpellSpellGroupMapBounds spellGroup = GetSpellSpellGroupMapBounds(spellid); - for (SpellSpellGroupMap::const_iterator itr = spellGroup.first; itr != spellGroup.second ; ++itr) + for (SpellSpellGroupMap::const_iterator itr = spellGroup.first; itr != spellGroup.second; ++itr) { if (itr->second == groupid) return true; @@ -677,7 +669,7 @@ void SpellMgr::GetSetOfSpellsInSpellGroup(SpellGroup group_id, std::set& usedGroups.insert(group_id); SpellGroupSpellMapBounds groupSpell = GetSpellGroupSpellMapBounds(group_id); - for (SpellGroupSpellMap::const_iterator itr = groupSpell.first; itr != groupSpell.second ; ++itr) + for (SpellGroupSpellMap::const_iterator itr = groupSpell.first; itr != groupSpell.second; ++itr) { if (itr->second < 0) { @@ -696,7 +688,7 @@ bool SpellMgr::AddSameEffectStackRuleSpellGroups(SpellInfo const* spellInfo, int uint32 spellId = spellInfo->GetFirstRankSpell()->Id; SpellSpellGroupMapBounds spellGroup = GetSpellSpellGroupMapBounds(spellId); // Find group with SPELL_GROUP_STACK_RULE_EXCLUSIVE_SAME_EFFECT if it belongs to one - for (SpellSpellGroupMap::const_iterator itr = spellGroup.first; itr != spellGroup.second ; ++itr) + for (SpellSpellGroupMap::const_iterator itr = spellGroup.first; itr != spellGroup.second; ++itr) { SpellGroup group = itr->second; SpellGroupStackMap::const_iterator found = mSpellGroupStack.find(group); @@ -732,13 +724,13 @@ SpellGroupStackRule SpellMgr::CheckSpellGroupStackRules(SpellInfo const* spellIn // find SpellGroups which are common for both spells SpellSpellGroupMapBounds spellGroup1 = GetSpellSpellGroupMapBounds(spellid_1); std::set groups; - for (SpellSpellGroupMap::const_iterator itr = spellGroup1.first; itr != spellGroup1.second ; ++itr) + for (SpellSpellGroupMap::const_iterator itr = spellGroup1.first; itr != spellGroup1.second; ++itr) { if (IsSpellMemberOfSpellGroup(spellid_2, itr->second)) { bool add = true; SpellGroupSpellMapBounds groupSpell = GetSpellGroupSpellMapBounds(itr->second); - for (SpellGroupSpellMap::const_iterator itr2 = groupSpell.first; itr2 != groupSpell.second ; ++itr2) + for (SpellGroupSpellMap::const_iterator itr2 = groupSpell.first; itr2 != groupSpell.second; ++itr2) { if (itr2->second < 0) { @@ -757,7 +749,7 @@ SpellGroupStackRule SpellMgr::CheckSpellGroupStackRules(SpellInfo const* spellIn SpellGroupStackRule rule = SPELL_GROUP_STACK_RULE_DEFAULT; - for (std::set::iterator itr = groups.begin() ; itr!= groups.end() ; ++itr) + for (std::set::iterator itr = groups.begin(); itr!= groups.end(); ++itr) { SpellGroupStackMap::const_iterator found = mSpellGroupStack.find(*itr); if (found != mSpellGroupStack.end()) @@ -1148,11 +1140,6 @@ bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32 return true; } -void SpellMgr::LoadSpellInfos() -{ - -} - void SpellMgr::LoadSpellRanks() { uint32 oldMSTime = getMSTime(); @@ -1163,18 +1150,17 @@ void SpellMgr::LoadSpellRanks() mSpellInfoMap[itr->first]->ChainEntry = NULL; } mSpellChains.clear(); - + // 0 1 2 QueryResult result = WorldDatabase.Query("SELECT first_spell_id, spell_id, rank from spell_ranks ORDER BY first_spell_id, rank"); if (!result) { - sLog->outString(">> Loaded 0 spell rank records"); + sLog->outString(">> Loaded 0 spell rank records. DB table `spell_ranks` is empty."); sLog->outString(); - sLog->outErrorDb("`spell_ranks` table is empty!"); return; } - uint32 rows = 0; + uint32 count = 0; bool finished = false; do @@ -1193,7 +1179,7 @@ void SpellMgr::LoadSpellRanks() if (lastSpell == -1) lastSpell = currentSpell; uint32 spell_id = fields[1].GetUInt32(); - uint32 rank = fields[2].GetUInt32(); + uint32 rank = fields[2].GetUInt8(); // don't drop the row if we're moving to the next rank if (currentSpell == lastSpell) @@ -1221,7 +1207,7 @@ void SpellMgr::LoadSpellRanks() int32 curRank = 0; bool valid = true; // check spells in chain - for (std::list >::iterator itr = rankChain.begin() ; itr!= rankChain.end(); ++itr) + for (std::list >::iterator itr = rankChain.begin(); itr!= rankChain.end(); ++itr) { SpellInfo const* spell = GetSpellInfo(itr->first); if (!spell) @@ -1245,7 +1231,7 @@ void SpellMgr::LoadSpellRanks() std::list >::iterator itr = rankChain.begin(); do { - ++rows; + ++count; int32 addedSpell = itr->first; mSpellChains[addedSpell].first = GetSpellInfo(lastSpell); mSpellChains[addedSpell].last = GetSpellInfo(rankChain.back().first); @@ -1265,7 +1251,7 @@ void SpellMgr::LoadSpellRanks() while (true); } while (!finished); - sLog->outString(">> Loaded %u spell rank records in %u ms", rows, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(">> Loaded %u spell rank records in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); sLog->outString(); } @@ -1276,23 +1262,24 @@ void SpellMgr::LoadSpellRequired() mSpellsReqSpell.clear(); // need for reload case mSpellReq.clear(); // need for reload case + // 0 1 QueryResult result = WorldDatabase.Query("SELECT spell_id, req_spell from spell_required"); if (!result) { - sLog->outString(">> Loaded 0 spell required records"); + sLog->outString(">> Loaded 0 spell required records. DB table `spell_required` is empty."); sLog->outString(); - sLog->outErrorDb("`spell_required` table is empty!"); return; } - uint32 rows = 0; + uint32 count = 0; do { Field* fields = result->Fetch(); - uint32 spell_id = fields[0].GetUInt32(); + uint32 spell_id = fields[0].GetUInt32(); uint32 spell_req = fields[1].GetUInt32(); + // check if chain is made with valid first spell SpellInfo const* spell = GetSpellInfo(spell_id); if (!spell) @@ -1300,17 +1287,20 @@ void SpellMgr::LoadSpellRequired() sLog->outErrorDb("spell_id %u in `spell_required` table is not found in dbcs, skipped", spell_id); continue; } + SpellInfo const* req_spell = GetSpellInfo(spell_req); if (!req_spell) { sLog->outErrorDb("req_spell %u in `spell_required` table is not found in dbcs, skipped", spell_req); continue; } + if (GetFirstSpellInChain(spell_id) == GetFirstSpellInChain(spell_req)) { sLog->outErrorDb("req_spell %u and spell_id %u in `spell_required` table are ranks of the same spell, entry not needed, skipped", spell_req, spell_id); continue; } + if (IsSpellRequiringSpell(spell_id, spell_req)) { sLog->outErrorDb("duplicated entry of req_spell %u and spell_id %u in `spell_required`, skipped", spell_req, spell_id); @@ -1319,10 +1309,10 @@ void SpellMgr::LoadSpellRequired() mSpellReq.insert (std::pair(spell_id, spell_req)); mSpellsReqSpell.insert (std::pair(spell_req, spell_id)); - ++rows; + ++count; } while (result->NextRow()); - sLog->outString(">> Loaded %u spell required records in %u ms", rows, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(">> Loaded %u spell required records in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); sLog->outString(); } @@ -1374,24 +1364,22 @@ void SpellMgr::LoadSpellLearnSpells() QueryResult result = WorldDatabase.Query("SELECT entry, SpellID, Active FROM spell_learn_spell"); if (!result) { - sLog->outString(">> Loaded 0 spell learn spells"); + sLog->outString(">> Loaded 0 spell learn spells. DB table `spell_learn_spell` is empty."); sLog->outString(); - sLog->outErrorDb("`spell_learn_spell` table is empty!"); return; } uint32 count = 0; - do { Field* fields = result->Fetch(); - uint32 spell_id = fields[0].GetUInt32(); + uint32 spell_id = fields[0].GetUInt16(); SpellLearnSpellNode node; - node.spell = fields[1].GetUInt32(); - node.active = fields[2].GetBool(); - node.autoLearned= false; + node.spell = fields[1].GetUInt16(); + node.active = fields[2].GetBool(); + node.autoLearned = false; if (!GetSpellInfo(spell_id)) { @@ -1475,7 +1463,7 @@ void SpellMgr::LoadSpellTargetPositions() mSpellTargetPositions.clear(); // need for reload case - // 0 1 2 3 4 5 + // 0 1 2 3 4 5 QueryResult result = WorldDatabase.Query("SELECT id, target_map, target_position_x, target_position_y, target_position_z, target_orientation FROM spell_target_position"); if (!result) { @@ -1485,7 +1473,6 @@ void SpellMgr::LoadSpellTargetPositions() } uint32 count = 0; - do { Field* fields = result->Fetch(); @@ -1494,7 +1481,7 @@ void SpellMgr::LoadSpellTargetPositions() SpellTargetPosition st; - st.target_mapId = fields[1].GetUInt32(); + st.target_mapId = fields[1].GetUInt16(); st.target_X = fields[2].GetFloat(); st.target_Y = fields[3].GetFloat(); st.target_Z = fields[4].GetFloat(); @@ -1597,19 +1584,17 @@ void SpellMgr::LoadSpellGroups() mSpellSpellGroup.clear(); // need for reload case mSpellGroupSpell.clear(); - uint32 count = 0; - - // 0 1 + // 0 1 QueryResult result = WorldDatabase.Query("SELECT id, spell_id FROM spell_group"); if (!result) { + sLog->outString(">> Loaded 0 spell group definitions. DB table `spell_group` is empty."); sLog->outString(); - sLog->outString(">> Loaded %u spell group definitions", count); return; } std::set groups; - + uint32 count = 0; do { Field* fields = result->Fetch(); @@ -1617,7 +1602,7 @@ void SpellMgr::LoadSpellGroups() uint32 group_id = fields[0].GetUInt32(); if (group_id <= SPELL_GROUP_DB_RANGE_MIN && group_id >= SPELL_GROUP_CORE_RANGE_MAX) { - sLog->outErrorDb("SpellGroup id %u listed in `spell_groups` is in core range, but is not defined in core!", group_id); + sLog->outErrorDb("SpellGroup id %u listed in `spell_group` is in core range, but is not defined in core!", group_id); continue; } int32 spell_id = fields[1].GetInt32(); @@ -1627,13 +1612,13 @@ void SpellMgr::LoadSpellGroups() } while (result->NextRow()); - for (SpellGroupSpellMap::iterator itr = mSpellGroupSpell.begin(); itr!= mSpellGroupSpell.end() ;) + for (SpellGroupSpellMap::iterator itr = mSpellGroupSpell.begin(); itr!= mSpellGroupSpell.end();) { if (itr->second < 0) { if (groups.find(abs(itr->second)) == groups.end()) { - sLog->outErrorDb("SpellGroup id %u listed in `spell_groups` does not exist", abs(itr->second)); + sLog->outErrorDb("SpellGroup id %u listed in `spell_group` does not exist", abs(itr->second)); mSpellGroupSpell.erase(itr++); } else @@ -1658,12 +1643,12 @@ void SpellMgr::LoadSpellGroups() } } - for (std::set::iterator groupItr = groups.begin() ; groupItr != groups.end() ; ++groupItr) + for (std::set::iterator groupItr = groups.begin(); groupItr != groups.end(); ++groupItr) { std::set spells; GetSetOfSpellsInSpellGroup(SpellGroup(*groupItr), spells); - for (std::set::iterator spellItr = spells.begin() ; spellItr != spells.end() ; ++spellItr) + for (std::set::iterator spellItr = spells.begin(); spellItr != spells.end(); ++spellItr) { ++count; mSpellSpellGroup.insert(SpellSpellGroupMap::value_type(*spellItr, SpellGroup(*groupItr))); @@ -1680,23 +1665,22 @@ void SpellMgr::LoadSpellGroupStackRules() mSpellGroupStack.clear(); // need for reload case - uint32 count = 0; - // 0 1 QueryResult result = WorldDatabase.Query("SELECT group_id, stack_rule FROM spell_group_stack_rules"); if (!result) { - sLog->outString(">> Loaded 0 spell group stack rules"); + sLog->outString(">> Loaded 0 spell group stack rules. DB table `spell_group_stack_rules` is empty."); sLog->outString(); return; } + uint32 count = 0; do { Field* fields = result->Fetch(); uint32 group_id = fields[0].GetUInt32(); - uint8 stack_rule = fields[1].GetUInt32(); + uint8 stack_rule = fields[1].GetInt8(); if (stack_rule >= SPELL_GROUP_STACK_RULE_MAX) { sLog->outErrorDb("SpellGroupStackRule %u listed in `spell_group_stack_rules` does not exist", stack_rule); @@ -1726,17 +1710,16 @@ void SpellMgr::LoadSpellProcEvents() mSpellProcEventMap.clear(); // need for reload case - uint32 count = 0; - // 0 1 2 3 4 5 6 7 8 9 10 QueryResult result = WorldDatabase.Query("SELECT entry, SchoolMask, SpellFamilyName, SpellFamilyMask0, SpellFamilyMask1, SpellFamilyMask2, procFlags, procEx, ppmRate, CustomChance, Cooldown FROM spell_proc_event"); if (!result) { - sLog->outString(">> Loaded %u spell proc event conditions", count); + sLog->outString(">> Loaded 0 spell proc event conditions. DB table `spell_proc_event` is empty."); sLog->outString(); return; } + uint32 count = 0; uint32 customProc = 0; do { @@ -1753,8 +1736,8 @@ void SpellMgr::LoadSpellProcEvents() SpellProcEventEntry spe; - spe.schoolMask = fields[1].GetUInt32(); - spe.spellFamilyName = fields[2].GetUInt32(); + spe.schoolMask = fields[1].GetInt8(); + spe.spellFamilyName = fields[2].GetUInt16(); spe.spellFamilyMask[0] = fields[3].GetUInt32(); spe.spellFamilyMask[1] = fields[4].GetUInt32(); spe.spellFamilyMask[2] = fields[5].GetUInt32(); @@ -1791,17 +1774,16 @@ void SpellMgr::LoadSpellProcs() mSpellProcMap.clear(); // need for reload case - uint32 count = 0; - - // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 + // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 QueryResult result = WorldDatabase.Query("SELECT spellId, schoolMask, spellFamilyName, spellFamilyMask0, spellFamilyMask1, spellFamilyMask2, typeMask, spellTypeMask, spellPhaseMask, hitMask, attributesMask, ratePerMinute, chance, cooldown, charges FROM spell_proc"); if (!result) { - sLog->outString(">> Loaded %u spell proc conditions and data", count); + sLog->outString(">> Loaded 0 spell proc conditions and data. DB table `spell_proc` is empty."); sLog->outString(); return; } + uint32 count = 0; do { Field* fields = result->Fetch(); @@ -1833,8 +1815,8 @@ void SpellMgr::LoadSpellProcs() SpellProcEntry baseProcEntry; - baseProcEntry.schoolMask = fields[1].GetUInt32(); - baseProcEntry.spellFamilyName = fields[2].GetUInt32(); + baseProcEntry.schoolMask = fields[1].GetInt8(); + baseProcEntry.spellFamilyName = fields[2].GetUInt16(); baseProcEntry.spellFamilyMask[0] = fields[3].GetUInt32(); baseProcEntry.spellFamilyMask[1] = fields[4].GetUInt32(); baseProcEntry.spellFamilyMask[2] = fields[5].GetUInt32(); @@ -1932,16 +1914,17 @@ void SpellMgr::LoadSpellBonusess() uint32 oldMSTime = getMSTime(); mSpellBonusMap.clear(); // need for reload case - uint32 count = 0; + // 0 1 2 3 4 QueryResult result = WorldDatabase.Query("SELECT entry, direct_bonus, dot_bonus, ap_bonus, ap_dot_bonus FROM spell_bonus_data"); if (!result) { - sLog->outString(">> Loaded %u spell bonus data", count); + sLog->outString(">> Loaded 0 spell bonus data. DB table `spell_bonus_data` is empty."); sLog->outString(); return; } + uint32 count = 0; do { Field* fields = result->Fetch(); @@ -1973,17 +1956,16 @@ void SpellMgr::LoadSpellThreats() mSpellThreatMap.clear(); // need for reload case - uint32 count = 0; - // 0 1 2 3 QueryResult result = WorldDatabase.Query("SELECT entry, flatMod, pctMod, apPctMod FROM spell_threat"); if (!result) { - sLog->outString(">> Loaded 0 aggro generating spells"); + sLog->outString(">> Loaded 0 aggro generating spells. DB table `spell_threat` is empty."); sLog->outString(); return; } + uint32 count = 0; do { Field* fields = result->Fetch(); @@ -1997,7 +1979,7 @@ void SpellMgr::LoadSpellThreats() } SpellThreatEntry ste; - ste.flatMod = fields[1].GetInt16(); + ste.flatMod = fields[1].GetInt32(); ste.pctMod = fields[2].GetFloat(); ste.apPctMod = fields[3].GetFloat(); @@ -2047,7 +2029,6 @@ void SpellMgr::LoadSpellPetAuras() } uint32 count = 0; - do { Field* fields = result->Fetch(); @@ -2102,11 +2083,10 @@ void SpellMgr::LoadEnchantCustomAttr() uint32 size = sSpellItemEnchantmentStore.GetNumRows(); mEnchantCustomAttr.resize(size); - uint32 count = 0; - for (uint32 i = 0; i < size; ++i) mEnchantCustomAttr[i] = 0; + uint32 count = 0; for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i) { SpellInfo const* spellInfo = GetSpellInfo(i); @@ -2114,7 +2094,7 @@ void SpellMgr::LoadEnchantCustomAttr() continue; // TODO: find a better check - if (!(spellInfo->AttributesEx2 & SPELL_ATTR2_UNK13) || !(spellInfo->Attributes & SPELL_ATTR0_NOT_SHAPESHIFT)) + if (!(spellInfo->AttributesEx2 & SPELL_ATTR2_PRESERVE_ENCHANT_IN_ARENA) || !(spellInfo->Attributes & SPELL_ATTR0_NOT_SHAPESHIFT)) continue; for (uint32 j = 0; j < MAX_SPELL_EFFECTS; ++j) @@ -2142,17 +2122,16 @@ void SpellMgr::LoadSpellEnchantProcData() mSpellEnchantProcEventMap.clear(); // need for reload case - uint32 count = 0; - // 0 1 2 3 QueryResult result = WorldDatabase.Query("SELECT entry, customChance, PPMChance, procEx FROM spell_enchant_proc_data"); if (!result) { - sLog->outString(">> Loaded %u spell enchant proc event conditions", count); + sLog->outString(">> Loaded 0 spell enchant proc event conditions. DB table `spell_enchant_proc_data` is empty."); sLog->outString(); return; } + uint32 count = 0; do { Field* fields = result->Fetch(); @@ -2197,14 +2176,13 @@ void SpellMgr::LoadSpellLinked() } uint32 count = 0; - do { Field* fields = result->Fetch(); int32 trigger = fields[0].GetInt32(); - int32 effect = fields[1].GetInt32(); - int32 type = fields[2].GetInt32(); + int32 effect = fields[1].GetInt32(); + int32 type = fields[2].GetUInt8(); SpellInfo const* spellInfo = GetSpellInfo(abs(trigger)); if (!spellInfo) @@ -2442,7 +2420,6 @@ void SpellMgr::LoadSpellAreas() } uint32 count = 0; - do { Field* fields = result->Fetch(); @@ -3261,6 +3238,10 @@ void SpellMgr::LoadDbcDataCorrections() spellInfo->EffectDieSides[0] = 0; // was 1, that should probably mean seat 0, but instead it's treated as spell 1 spellInfo->EffectBasePoints[0] = 52391; // Ride Vehicle (forces seat 0) break; + case 64745: // Item - Death Knight T8 Tank 4P Bonus + case 64936: // Item - Warrior T8 Protection 4P Bonus + spellInfo->EffectBasePoints[0] = 100; // 100% chance of procc'ing, not -10% (chance calculated in PrepareTriggersExecutedOnHit) + break; case 19970: // Entangling Roots (Rank 6) -- Nature's Grasp Proc case 19971: // Entangling Roots (Rank 5) -- Nature's Grasp Proc case 19972: // Entangling Roots (Rank 4) -- Nature's Grasp Proc @@ -3317,6 +3298,19 @@ void SpellMgr::LoadDbcDataCorrections() spellInfo->EffectImplicitTargetB[1] = TARGET_UNIT_NEARBY_ENTRY; spellInfo->EffectImplicitTargetB[2] = TARGET_UNIT_NEARBY_ENTRY; break; + case 62301: // Cosmic Smash (Algalon the Observer) + spellInfo->MaxAffectedTargets = 1; + break; + case 64598: // Cosmic Smash (Algalon the Observer) + spellInfo->MaxAffectedTargets = 3; + break; + case 62293: // Cosmic Smash (Algalon the Observer) + spellInfo->EffectImplicitTargetB[0] = TARGET_DEST_CASTER; + break; + case 62311: // Cosmic Smash (Algalon the Observer) + case 64596: // Cosmic Smash (Algalon the Observer) + spellInfo->rangeIndex = 6; // 100yd + break; // ENDOF ULDUAR SPELLS // // TRIAL OF THE CRUSADER SPELLS @@ -3352,13 +3346,22 @@ void SpellMgr::LoadDbcDataCorrections() case 70835: // Bone Storm (Lord Marrowgar) case 70836: // Bone Storm (Lord Marrowgar) case 72864: // Death Plague (Rotting Frost Giant) - case 72378: // Blood Nova (Deathbringer Saurfang) - case 73058: // Blood Nova (Deathbringer Saurfang) case 71160: // Plague Stench (Stinky) case 71161: // Plague Stench (Stinky) case 71123: // Decimate (Stinky & Precious) spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_100_YARDS; // 100yd break; + case 72378: // Blood Nova (Deathbringer Saurfang) + case 73058: // Blood Nova (Deathbringer Saurfang) + spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_200_YARDS; + spellInfo->EffectRadiusIndex[1] = EFFECT_RADIUS_200_YARDS; + break; + case 72769: // Scent of Blood (Deathbringer Saurfang) + spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_200_YARDS; + // no break + case 72771: // Scent of Blood (Deathbringer Saurfang) + spellInfo->EffectRadiusIndex[1] = EFFECT_RADIUS_200_YARDS; + break; case 72723: // Resistant Skin (Deathbringer Saurfang adds) // this spell initially granted Shadow damage immunity, however it was removed but the data was left in client spellInfo->Effect[2] = 0; @@ -3366,9 +3369,9 @@ void SpellMgr::LoadDbcDataCorrections() case 70460: // Coldflame Jets (Traps after Saurfang) spellInfo->DurationIndex = 1; // 10 seconds break; - case 71413: // Green Ooze Summon (Professor Putricide) - case 71414: // Orange Ooze Summon (Professor Putricide) - spellInfo->EffectImplicitTargetA[0] = TARGET_DEST_DEST; + case 71412: // Green Ooze Summon (Professor Putricide) + case 71415: // Orange Ooze Summon (Professor Putricide) + spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_TARGET_ANY; break; case 71159: // Awaken Plagued Zombies spellInfo->DurationIndex = 21; @@ -3429,10 +3432,7 @@ void SpellMgr::LoadDbcDataCorrections() spellInfo->EffectImplicitTargetA[0] = TARGET_DEST_CASTER; break; case 69846: // Frost Bomb - spellInfo->speed = 10; - spellInfo->EffectImplicitTargetA[0] = TARGET_DEST_TARGET_ANY; - spellInfo->EffectImplicitTargetB[0] = TARGET_UNIT_TARGET_ANY; - spellInfo->Effect[1] = 0; + spellInfo->speed = 0.0f; // This spell's summon happens instantly break; case 71614: // Ice Lock spellInfo->Mechanic = MECHANIC_STUN; @@ -3528,6 +3528,11 @@ void SpellMgr::LoadDbcDataCorrections() case 40166: // Introspection case 40167: // Introspection spellInfo->Attributes |= SPELL_ATTR0_NEGATIVE_1; + break; + case 2378: // Minor Fortitude + spellInfo->manaCost = 0; + spellInfo->manaPerSecond = 0; + break; default: break; } diff --git a/src/server/game/Spells/SpellMgr.h b/src/server/game/Spells/SpellMgr.h index 9fffd474651..dcf3c38fe4f 100755 --- a/src/server/game/Spells/SpellMgr.h +++ b/src/server/game/Spells/SpellMgr.h @@ -605,7 +605,7 @@ class SpellMgr // Accessors (const or static functions) public: - // Spell correctess for client using + // Spell correctness for client using static bool IsSpellValid(SpellInfo const* spellInfo, Player* player = NULL, bool msg = true); // Spell difficulty @@ -693,7 +693,6 @@ class SpellMgr public: // Loading data at server startup - void LoadSpellInfos(); void LoadSpellRanks(); void LoadSpellRequired(); void LoadSpellLearnSkills(); diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp index 03fea614c0d..e6ce80c20f0 100755 --- a/src/server/game/Spells/SpellScript.cpp +++ b/src/server/game/Spells/SpellScript.cpp @@ -320,29 +320,34 @@ SpellInfo const* SpellScript::GetSpellInfo() return m_spell->GetSpellInfo(); } -WorldLocation const* SpellScript::GetTargetDest() +WorldLocation const* SpellScript::GetExplTargetDest() { if (m_spell->m_targets.HasDst()) - return m_spell->m_targets.GetDst(); + return m_spell->m_targets.GetDstPos(); return NULL; } -void SpellScript::SetTargetDest(WorldLocation& loc) +void SpellScript::SetExplTargetDest(WorldLocation& loc) { m_spell->m_targets.SetDst(loc); } -Unit* SpellScript::GetTargetUnit() +WorldObject* SpellScript::GetExplTargetWorldObject() +{ + return m_spell->m_targets.GetObjectTarget(); +} + +Unit* SpellScript::GetExplTargetUnit() { return m_spell->m_targets.GetUnitTarget(); } -GameObject* SpellScript::GetTargetGObj() +GameObject* SpellScript::GetExplTargetGObj() { return m_spell->m_targets.GetGOTarget(); } -Item* SpellScript::GetTargetItem() +Item* SpellScript::GetExplTargetItem() { return m_spell->m_targets.GetItemTarget(); } @@ -403,6 +408,16 @@ GameObject* SpellScript::GetHitGObj() return m_spell->gameObjTarget; } +WorldLocation* SpellScript::GetHitDest() +{ + if (!IsInEffectHook()) + { + sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::GetHitGObj was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId); + return NULL; + } + return m_spell->destTarget; +} + int32 SpellScript::GetHitDamage() { if (!IsInTargetHook()) @@ -468,11 +483,6 @@ void SpellScript::PreventHitAura() m_spell->m_spellAura->Remove(); } -void SpellScript::GetSummonPosition(uint32 i, Position &pos, float radius = 0.0f, uint32 count = 0) -{ - m_spell->GetSummonPosition(i, pos, radius, count); -} - void SpellScript::PreventHitEffect(SpellEffIndex effIndex) { if (!IsInHitPhase() && !IsInEffectHook()) @@ -768,6 +778,7 @@ bool AuraScript::_IsDefaultActionPrevented() case AURA_SCRIPT_HOOK_EFFECT_APPLY: case AURA_SCRIPT_HOOK_EFFECT_REMOVE: case AURA_SCRIPT_HOOK_EFFECT_PERIODIC: + case AURA_SCRIPT_HOOK_EFFECT_ABSORB: return m_defaultActionPrevented; default: ASSERT(false && "AuraScript::_IsDefaultActionPrevented is called in a wrong place"); @@ -782,6 +793,7 @@ void AuraScript::PreventDefaultAction() case AURA_SCRIPT_HOOK_EFFECT_APPLY: case AURA_SCRIPT_HOOK_EFFECT_REMOVE: case AURA_SCRIPT_HOOK_EFFECT_PERIODIC: + case AURA_SCRIPT_HOOK_EFFECT_ABSORB: m_defaultActionPrevented = true; break; default: diff --git a/src/server/game/Spells/SpellScript.h b/src/server/game/Spells/SpellScript.h index 1bf8d25adef..7b194b7827f 100755 --- a/src/server/game/Spells/SpellScript.h +++ b/src/server/game/Spells/SpellScript.h @@ -295,25 +295,35 @@ class SpellScript : public _SpellScript SpellInfo const* GetSpellInfo(); SpellValue const* GetSpellValue(); - // methods useable after spell targets are set - // accessors to the "focus" targets of the spell - // note: do not confuse these with spell hit targets + // methods useable after spell is prepared + // accessors to the explicit targets of the spell + // explicit target - target selected by caster (player, game client, or script - DoCast(explicitTarget, ...), required for spell to be cast + // examples: + // -shadowstep - explicit target is the unit you want to go behind of + // -chain heal - explicit target is the unit to be healed first + // -holy nova/arcane explosion - explicit target = NULL because target you are selecting doesn't affect how spell targets are selected + // you can determine if spell requires explicit targets by dbc columns: + // - Targets - mask of explicit target types + // - ImplicitTargetXX set to TARGET_XXX_TARGET_YYY, _TARGET_ here means that explicit target is used by the effect, so spell needs one too + // returns: WorldLocation which was selected as a spell destination or NULL - WorldLocation const* GetTargetDest(); + WorldLocation const* GetExplTargetDest(); - void SetTargetDest(WorldLocation& loc); + void SetExplTargetDest(WorldLocation& loc); - // returns: Unit which was selected as a spell target or NULL - Unit* GetTargetUnit(); + // returns: WorldObject which was selected as an explicit spell target or NULL if there's no target + WorldObject* GetExplTargetWorldObject(); - // returns: GameObject which was selected as a spell target or NULL - GameObject* GetTargetGObj(); + // returns: Unit which was selected as an explicit spell target or NULL if there's no target + Unit* GetExplTargetUnit(); - // returns: Item which was selected as a spell target or NULL - Item* GetTargetItem(); + // returns: GameObject which was selected as an explicit spell target or NULL if there's no target + GameObject* GetExplTargetGObj(); - // methods useable only during spell hit on target, or during spell launch on target: + // returns: Item which was selected as an explicit spell target or NULL if there's no target + Item* GetExplTargetItem(); + // methods useable only during spell hit on target, or during spell launch on target: // returns: target of current effect if it was Unit otherwise NULL Unit* GetHitUnit(); // returns: target of current effect if it was Creature otherwise NULL @@ -324,6 +334,8 @@ class SpellScript : public _SpellScript Item* GetHitItem(); // returns: target of current effect if it was GameObject otherwise NULL GameObject* GetHitGObj(); + // returns: destination of current effect + WorldLocation* GetHitDest(); // setter/getter for for damage done by spell to target of spell hit // returns damage calculated before hit, and real dmg done after hit int32 GetHitDamage(); @@ -335,7 +347,6 @@ class SpellScript : public _SpellScript void SetHitHeal(int32 heal); void PreventHitHeal() { SetHitHeal(0); } Spell* GetSpell() { return m_spell; } - void GetSummonPosition(uint32 i, Position &pos, float radius, uint32 count); // returns current spell hit target aura Aura* GetHitAura(); // prevents applying aura on current spell hit target diff --git a/src/server/game/Texts/CreatureTextMgr.cpp b/src/server/game/Texts/CreatureTextMgr.cpp index e5a12693aa7..2f79eaff06a 100755 --- a/src/server/game/Texts/CreatureTextMgr.cpp +++ b/src/server/game/Texts/CreatureTextMgr.cpp @@ -17,8 +17,53 @@ #include "Common.h" #include "DatabaseEnv.h" -#include "CreatureTextMgr.h" #include "ObjectMgr.h" +#include "Cell.h" +#include "CellImpl.h" +#include "GridNotifiers.h" +#include "GridNotifiersImpl.h" +#include "CreatureTextMgr.h" + +class CreatureTextBuilder +{ + public: + CreatureTextBuilder(WorldObject* obj, ChatMsg msgtype, uint8 textGroup, uint32 id, uint32 language, uint64 targetGUID) + : _source(obj), _msgType(msgtype), _textGroup(textGroup), _textId(id), _language(language), _targetGUID(targetGUID) + { + } + + size_t operator()(WorldPacket* data, LocaleConstant locale) const + { + std::string text = sCreatureTextMgr->GetLocalizedChatString(_source->GetEntry(), _textGroup, _textId, locale); + char const* localizedName = _source->GetNameForLocaleIdx(locale); + + *data << uint8(_msgType); + *data << uint32(_language); + *data << uint64(_source->GetGUID()); + *data << uint32(1); // 2.1.0 + *data << uint32(strlen(localizedName)+1); + *data << localizedName; + size_t whisperGUIDpos = data->wpos(); + *data << uint64(_targetGUID); // Unit Target + if (_targetGUID && !IS_PLAYER_GUID(_targetGUID)) + { + *data << uint32(1); // target name length + *data << uint8(0); // target name + } + *data << uint32(text.length() + 1); + *data << text; + *data << uint8(0); // ChatTag + + return whisperGUIDpos; + } + + WorldObject* _source; + ChatMsg _msgType; + uint8 _textGroup; + uint32 _textId; + uint32 _language; + uint64 _targetGUID; +}; void CreatureTextMgr::LoadCreatureTexts() { @@ -83,17 +128,8 @@ void CreatureTextMgr::LoadCreatureTexts() } //entry not yet added, add empty TextHolder (list of groups) if (mTextMap.find(temp.entry) == mTextMap.end()) - { ++creatureCount; - CreatureTextHolder TextHolder; - mTextMap[temp.entry] = TextHolder; - } - //group not yet added, add empty TextGroup (list of texts) - if (mTextMap[temp.entry].find(temp.group) == mTextMap[temp.entry].end()) - { - CreatureTextGroup TextGroup; - mTextMap[temp.entry][temp.group] = TextGroup; - } + //add the text into our entry's group mTextMap[temp.entry][temp.group].push_back(temp); @@ -104,42 +140,76 @@ void CreatureTextMgr::LoadCreatureTexts() sLog->outString(); } +void CreatureTextMgr::LoadCreatureTextLocales() +{ + uint32 oldMSTime = getMSTime(); + + mLocaleTextMap.clear(); // for reload case + + QueryResult result = WorldDatabase.Query("SELECT entry, textGroup, id, text_loc1, text_loc2, text_loc3, text_loc4, text_loc5, text_loc6, text_loc7, text_loc8 FROM locales_creature_text"); + + if (!result) + return; + + uint32 textCount = 0; + + do + { + Field* fields = result->Fetch(); + CreatureTextLocale& loc = mLocaleTextMap[CreatureTextId(fields[0].GetUInt32(), uint32(fields[1].GetUInt8()), fields[2].GetUInt32())]; + for (uint8 i = 1; i < TOTAL_LOCALES; ++i) + { + LocaleConstant locale = LocaleConstant(i); + ObjectMgr::AddLocaleString(fields[3 + i - 1].GetString(), locale, loc.Text); + } + + ++textCount; + } while (result->NextRow()); + + sLog->outString(">> Loaded %u creature localized texts in %u ms", textCount, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); +} + uint32 CreatureTextMgr::SendChat(Creature* source, uint8 textGroup, uint64 whisperGuid /*= 0*/, ChatMsg msgType /*= CHAT_MSG_ADDON*/, Language language /*= LANG_ADDON*/, TextRange range /*= TEXT_RANGE_NORMAL*/, uint32 sound /*= 0*/, Team team /*= TEAM_OTHER*/, bool gmOnly /*= false*/, Player* srcPlr /*= NULL*/) { if (!source) return 0; + CreatureTextMap::const_iterator sList = mTextMap.find(source->GetEntry()); if (sList == mTextMap.end()) { sLog->outErrorDb("CreatureTextMgr: Could not find Text for Creature(%s) Entry %u in 'creature_text' table. Ignoring.", source->GetName(), source->GetEntry()); return 0; } - CreatureTextHolder TextHolder = (*sList).second; - CreatureTextHolder::const_iterator itr = TextHolder.find(textGroup); - if (itr == TextHolder.end()) + + CreatureTextHolder const& textHolder = sList->second; + CreatureTextHolder::const_iterator itr = textHolder.find(textGroup); + if (itr == textHolder.end()) { sLog->outErrorDb("CreatureTextMgr: Could not find TextGroup %u for Creature(%s) GuidLow %u Entry %u. Ignoring.", uint32(textGroup), source->GetName(), source->GetGUIDLow(), source->GetEntry()); return 0; } - CreatureTextGroup TextGroup = (*itr).second;//has all texts in the group + + CreatureTextGroup const& textGroupContainer = itr->second; //has all texts in the group CreatureTextRepeatIds repeatGroup = GetRepeatGroup(source, textGroup);//has all textIDs from the group that were already said CreatureTextGroup tempGroup;//will use this to talk after sorting repeatGroup - for (CreatureTextGroup::const_iterator giter = TextGroup.begin(); giter != TextGroup.end(); ++giter) - { - if (std::find(repeatGroup.begin(), repeatGroup.end(), (*giter).id) == repeatGroup.end()) - tempGroup.push_back((*giter)); - } + for (CreatureTextGroup::const_iterator giter = textGroupContainer.begin(); giter != textGroupContainer.end(); ++giter) + if (std::find(repeatGroup.begin(), repeatGroup.end(), giter->id) == repeatGroup.end()) + tempGroup.push_back(*giter); + if (tempGroup.empty()) { CreatureTextRepeatMap::iterator mapItr = mTextRepeatMap.find(source->GetGUID()); if (mapItr != mTextRepeatMap.end()) { - CreatureTextRepeatGroup::iterator groupItr = (*mapItr).second.find(textGroup); - (*groupItr).second.clear(); + CreatureTextRepeatGroup::iterator groupItr = mapItr->second.find(textGroup); + groupItr->second.clear(); } - tempGroup = TextGroup; + + tempGroup = textGroupContainer; } + uint8 count = 0; float lastChance = -1; bool isEqualChanced = true; @@ -148,173 +218,92 @@ uint32 CreatureTextMgr::SendChat(Creature* source, uint8 textGroup, uint64 whisp for (CreatureTextGroup::const_iterator iter = tempGroup.begin(); iter != tempGroup.end(); ++iter) { - if (lastChance >= 0 && lastChance != (*iter).probability) + if (lastChance >= 0 && lastChance != iter->probability) isEqualChanced = false; - lastChance = (*iter).probability; - totalChance += (*iter).probability; - count++; + lastChance = iter->probability; + totalChance += iter->probability; + ++count; } + int32 offset = -1; if (!isEqualChanced) { for (CreatureTextGroup::const_iterator iter = tempGroup.begin(); iter != tempGroup.end(); ++iter) { - uint32 chance = uint32((*iter).probability); + uint32 chance = uint32(iter->probability); uint32 r = urand(0, 100); - offset++; + ++offset; if (r <= chance) break; } } + uint32 pos = 0; if (isEqualChanced || offset < 0) pos = urand(0, count - 1); else if (offset >= 0) pos = offset; + CreatureTextGroup::const_iterator iter = tempGroup.begin() + pos; - ChatMsg finalType = (msgType == CHAT_MSG_ADDON) ? (*iter).type : msgType; - Language finalLang = (language == LANG_ADDON) ? (*iter).lang : language; - uint32 finalSound = sound ? sound : (*iter).sound; + ChatMsg finalType = (msgType == CHAT_MSG_ADDON) ? iter->type : msgType; + Language finalLang = (language == LANG_ADDON) ? iter->lang : language; + uint32 finalSound = sound ? sound : iter->sound; if (finalSound) SendSound(source, finalSound, finalType, whisperGuid, range, team, gmOnly); - if ((*iter).emote) - SendEmote(srcPlr ? srcPlr->ToUnit() : source, (*iter).emote); - - SendChatString(srcPlr ? srcPlr->ToUnit() : source, (*iter).text.c_str(), finalType, finalLang, whisperGuid, range, team, gmOnly); - if (isEqualChanced || (!isEqualChanced && totalChance == 100.0f)) - SetRepeatId(source, textGroup, (*iter).id); - - return (*iter).duration; -} - -void CreatureTextMgr::SendSound(Creature* source, uint32 sound, ChatMsg msgType, uint64 whisperGuid, TextRange range, Team team, bool gmOnly) -{ - if (!sound || !source) - return; - WorldPacket data(SMSG_PLAY_SOUND, 4); - data << uint32(sound); - SendChatPacket(&data, source, msgType, whisperGuid, range, team, gmOnly); -} - -void CreatureTextMgr::SendEmote(Unit* source, uint32 emote) -{ - if (!source) return; - source->HandleEmoteCommand(emote); -} - -void CreatureTextMgr::SetRepeatId(Creature* source, uint8 textGroup, uint8 id) -{ - if (!source) - return; - - if (mTextRepeatMap.find(source->GetGUID()) == mTextRepeatMap.end()) - { - CreatureTextRepeatGroup TextGroup; - mTextRepeatMap[source->GetGUID()] = TextGroup; - } - if (mTextRepeatMap[source->GetGUID()].find(textGroup) == mTextRepeatMap[source->GetGUID()].end()) - { - CreatureTextRepeatIds ids; - mTextRepeatMap[source->GetGUID()][textGroup] = ids; - } - if (std::find(mTextRepeatMap[source->GetGUID()][textGroup].begin(), mTextRepeatMap[source->GetGUID()][textGroup].end(), id) == mTextRepeatMap[source->GetGUID()][textGroup].end()) - { - mTextRepeatMap[source->GetGUID()][textGroup].push_back(id); - } - else - sLog->outErrorDb("CreatureTextMgr: TextGroup %u for Creature(%s) GuidLow %u Entry %u, id %u already added", uint32(textGroup), source->GetName(), source->GetGUIDLow(), source->GetEntry(), uint32(id)); -} - -CreatureTextRepeatIds CreatureTextMgr::GetRepeatGroup(Creature* source, uint8 textGroup) -{ - ASSERT(source);//should never happen - CreatureTextRepeatIds ids; + Unit* finalSource = source; + if (srcPlr) + finalSource = srcPlr; - CreatureTextRepeatMap::const_iterator mapItr = mTextRepeatMap.find(source->GetGUID()); - if (mapItr != mTextRepeatMap.end()) - { - CreatureTextRepeatGroup::const_iterator groupItr = (*mapItr).second.find(textGroup); - if (groupItr != (*mapItr).second.end()) - { - ids = (*groupItr).second; - } - } - return ids; -} + if (iter->emote) + SendEmote(finalSource, iter->emote); -void CreatureTextMgr::SendChatString(WorldObject* source, char const* text, ChatMsg msgtype /*= CHAT_MSG_MONSTER_SAY*/, Language language /*= LANG_UNIVERSAL*/, uint64 whisperGuid /*= 0*/, TextRange range /*= TEXT_RANGE_NORMAL*/, Team team /*= TEAM_OTHER*/, bool gmOnly /*= false*/) const -{ - if (!source) - return; + CreatureTextBuilder builder(finalSource, finalType, iter->group, iter->id, finalLang, whisperGuid); + SendChatPacket(finalSource, builder, finalType, whisperGuid, range, team, gmOnly); + if (isEqualChanced || (!isEqualChanced && totalChance == 100.0f)) + SetRepeatId(source, textGroup, iter->id); - WorldPacket data(SMSG_MESSAGECHAT, 200); - BuildMonsterChat(&data, source, msgtype, text, language, whisperGuid);//build our packet - SendChatPacket(&data, source, msgtype, whisperGuid, range, team, gmOnly);//send our packet + return iter->duration; } -void CreatureTextMgr::BuildMonsterChat(WorldPacket* data, WorldObject* source, ChatMsg msgType, char const* text, Language language, uint64 whisperGuid) const +float CreatureTextMgr::GetRangeForChatType(ChatMsg msgType) const { - if (!source) - return; - + float dist = sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY); switch (msgType) { - case CHAT_MSG_MONSTER_WHISPER: - if (!whisperGuid) - { - sLog->outError("CreatureTextMgr: WorldObject(%s) TypeId %u GuidLow %u sent CHAT_TYPE_WHISPER with targetGuid 0. Ignoring.", source->GetName(), uint32(source->GetTypeId()), source->GetGUIDLow()); - return; - } + case CHAT_MSG_MONSTER_YELL: + dist = sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL); break; - case CHAT_MSG_RAID_BOSS_WHISPER: - if (!whisperGuid) - { - sLog->outError("CreatureTextMgr: WorldObject(%s) TypeId %u GuidLow %u sent CHAT_TYPE_BOSS_WHISPER with targetGuid 0. Ignoring.", source->GetName(), uint32(source->GetTypeId()), source->GetGUIDLow()); - return; - } + case CHAT_MSG_MONSTER_EMOTE: + case CHAT_MSG_RAID_BOSS_EMOTE: + dist = sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE); break; default: break; } - *data << uint8(msgType); - *data << uint32(language); - *data << uint64(source->GetGUID()); - *data << uint32(0); // 2.1.0 - *data << uint32(strlen(source->GetName()) + 1); - *data << source->GetName(); - *data << uint64(whisperGuid); // Unit Target - if (whisperGuid && !IS_PLAYER_GUID(whisperGuid)) //can only whisper players - { - sLog->outError("CreatureTextMgr: WorldObject(%s) TypeId %u GuidLow %u sent WHISPER msg to Non-Player target. Ignoring.", source->GetName(), uint32(source->GetTypeId()), source->GetGUIDLow()); - return; - // *data << (uint32)1; // target name length - // *data << (uint8)0; // target name - } - *data << uint32(strlen(text) + 1); - *data << text; - *data << uint8(0); // ChatTag + + return dist; } -void CreatureTextMgr::SendChatPacket(WorldPacket* data, WorldObject* source, ChatMsg msgType, uint64 whisperGuid, TextRange range, Team team, bool gmOnly) const +void CreatureTextMgr::SendSound(Creature* source, uint32 sound, ChatMsg msgType, uint64 whisperGuid, TextRange range, Team team, bool gmOnly) { - if (!source) + if (!sound || !source) return; - float dist = sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY); + WorldPacket data(SMSG_PLAY_SOUND, 4); + data << uint32(sound); + SendNonChatPacket(source, &data, msgType, whisperGuid, range, team, gmOnly); +} + +void CreatureTextMgr::SendNonChatPacket(WorldObject* source, WorldPacket* data, ChatMsg msgType, uint64 whisperGuid, TextRange range, Team team, bool gmOnly) const +{ + float dist = GetRangeForChatType(msgType); switch (msgType) { - case CHAT_MSG_MONSTER_YELL: - dist = sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL); - break; - case CHAT_MSG_MONSTER_EMOTE: - case CHAT_MSG_RAID_BOSS_EMOTE: - dist = sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE); - break; case CHAT_MSG_MONSTER_WHISPER: case CHAT_MSG_RAID_BOSS_WHISPER: { @@ -337,83 +326,134 @@ void CreatureTextMgr::SendChatPacket(WorldPacket* data, WorldObject* source, Cha case TEXT_RANGE_AREA: { uint32 areaId = source->GetAreaId(); - Map::PlayerList const& pList = source->GetMap()->GetPlayers(); - for (Map::PlayerList::const_iterator itr = pList.begin(); itr != pList.end(); ++itr) - { + Map::PlayerList const& players = source->GetMap()->GetPlayers(); + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) if (itr->getSource()->GetAreaId() == areaId && (!team || Team(itr->getSource()->GetTeam()) == team) && (!gmOnly || itr->getSource()->isGameMaster())) - { - if (data->GetOpcode() == SMSG_MESSAGECHAT)//override whisperguid with actual player's guid - data->put(1+4+8+4+4+(int32)(strlen(source->GetName())+1), uint64(itr->getSource()->GetGUID())); - (itr->getSource())->GetSession()->SendPacket(data); - } - } + itr->getSource()->GetSession()->SendPacket(data); return; } case TEXT_RANGE_ZONE: { uint32 zoneId = source->GetZoneId(); - Map::PlayerList const& pList = source->GetMap()->GetPlayers(); - for (Map::PlayerList::const_iterator itr = pList.begin(); itr != pList.end(); ++itr) - { + Map::PlayerList const& players = source->GetMap()->GetPlayers(); + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) if (itr->getSource()->GetZoneId() == zoneId && (!team || Team(itr->getSource()->GetTeam()) == team) && (!gmOnly || itr->getSource()->isGameMaster())) - { - if (data->GetOpcode() == SMSG_MESSAGECHAT)//override whisperguid with actual player's guid - data->put(1+4+8+4+4+(int32)(strlen(source->GetName())+1), uint64(itr->getSource()->GetGUID())); - (itr->getSource())->GetSession()->SendPacket(data); - } - } + itr->getSource()->GetSession()->SendPacket(data); return; } case TEXT_RANGE_MAP: { - Map::PlayerList const& pList = source->GetMap()->GetPlayers(); - for (Map::PlayerList::const_iterator itr = pList.begin(); itr != pList.end(); ++itr) - { - if (data->GetOpcode() == SMSG_MESSAGECHAT)//override whisperguid with actual player's guid - data->put(1+4+8+4+4+(int32)(strlen(source->GetName())+1), uint64(itr->getSource()->GetGUID())); + Map::PlayerList const& players = source->GetMap()->GetPlayers(); + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) if ((!team || Team(itr->getSource()->GetTeam()) == team) && (!gmOnly || itr->getSource()->isGameMaster())) - (itr->getSource())->GetSession()->SendPacket(data); - } + itr->getSource()->GetSession()->SendPacket(data); return; } case TEXT_RANGE_WORLD: { - const SessionMap smap = sWorld->GetAllSessions(); + SessionMap const& smap = sWorld->GetAllSessions(); for (SessionMap::const_iterator iter = smap.begin(); iter != smap.end(); ++iter) - { - if (Player* player = (*iter).second->GetPlayer()) - { - if (data->GetOpcode() == SMSG_MESSAGECHAT)//override whisperguid with actual player's guid - data->put(1+4+8+4+4+(int32)(strlen(source->GetName())+1), uint64(player->GetGUID())); + if (Player* player = iter->second->GetPlayer()) if (player->GetSession() && (!team || Team(player->GetTeam()) == team) && (!gmOnly || player->isGameMaster())) player->GetSession()->SendPacket(data); - } - } return; } case TEXT_RANGE_NORMAL: default: break; } + source->SendMessageToSetInRange(data, dist, true); } +void CreatureTextMgr::SendEmote(Unit* source, uint32 emote) +{ + if (!source) + return; + + source->HandleEmoteCommand(emote); +} + +void CreatureTextMgr::SetRepeatId(Creature* source, uint8 textGroup, uint8 id) +{ + if (!source) + return; + + CreatureTextRepeatIds& repeats = mTextRepeatMap[source->GetGUID()][textGroup]; + if (std::find(repeats.begin(), repeats.end(), id) == repeats.end()) + repeats.push_back(id); + else + sLog->outErrorDb("CreatureTextMgr: TextGroup %u for Creature(%s) GuidLow %u Entry %u, id %u already added", uint32(textGroup), source->GetName(), source->GetGUIDLow(), source->GetEntry(), uint32(id)); +} + +CreatureTextRepeatIds CreatureTextMgr::GetRepeatGroup(Creature* source, uint8 textGroup) +{ + ASSERT(source);//should never happen + CreatureTextRepeatIds ids; + + CreatureTextRepeatMap::const_iterator mapItr = mTextRepeatMap.find(source->GetGUID()); + if (mapItr != mTextRepeatMap.end()) + { + CreatureTextRepeatGroup::const_iterator groupItr = (*mapItr).second.find(textGroup); + if (groupItr != mapItr->second.end()) + ids = groupItr->second; + } + return ids; +} + bool CreatureTextMgr::TextExist(uint32 sourceEntry, uint8 textGroup) { if (!sourceEntry) return false; + CreatureTextMap::const_iterator sList = mTextMap.find(sourceEntry); if (sList == mTextMap.end()) { sLog->outDebug(LOG_FILTER_UNITS, "CreatureTextMgr::TextExist: Could not find Text for Creature (entry %u) in 'creature_text' table.", sourceEntry); return false; } - CreatureTextHolder TextHolder = (*sList).second; - CreatureTextHolder::const_iterator itr = TextHolder.find(textGroup); - if (itr == TextHolder.end()) + + CreatureTextHolder const& textHolder = sList->second; + CreatureTextHolder::const_iterator itr = textHolder.find(textGroup); + if (itr == textHolder.end()) { sLog->outDebug(LOG_FILTER_UNITS, "CreatureTextMgr::TextExist: Could not find TextGroup %u for Creature (entry %u).", uint32(textGroup), sourceEntry); return false; } + return true; } + +std::string CreatureTextMgr::GetLocalizedChatString(uint32 entry, uint8 textGroup, uint32 id, LocaleConstant locale) const +{ + CreatureTextMap::const_iterator mapitr = mTextMap.find(entry); + if (mapitr == mTextMap.end()) + return ""; + + CreatureTextHolder::const_iterator holderItr = mapitr->second.find(textGroup); + if (holderItr == mapitr->second.end()) + return ""; + + CreatureTextGroup::const_iterator groupItr = holderItr->second.begin(); + for (; groupItr != holderItr->second.end(); ++groupItr) + if (groupItr->id == id) + break; + + if (groupItr == holderItr->second.end()) + return ""; + + std::string baseText = groupItr->text; + if (locale == DEFAULT_LOCALE) + return baseText; + + if (locale > MAX_LOCALES) + return baseText; + + LocaleCreatureTextMap::const_iterator locItr = mLocaleTextMap.find(CreatureTextId(entry, uint32(textGroup), id)); + if (locItr == mLocaleTextMap.end()) + return baseText; + + ObjectMgr::GetLocaleString(locItr->second.Text, locale, baseText); + + return baseText; +} diff --git a/src/server/game/Texts/CreatureTextMgr.h b/src/server/game/Texts/CreatureTextMgr.h index 0c80e2d568f..8ed0b01fcd5 100755 --- a/src/server/game/Texts/CreatureTextMgr.h +++ b/src/server/game/Texts/CreatureTextMgr.h @@ -19,6 +19,8 @@ #define TRINITY_CREATURE_TEXT_MGR_H #include "Creature.h" +#include "GridNotifiers.h" +#include "ObjectAccessor.h" #include "SharedDefines.h" struct CreatureTextEntry @@ -44,10 +46,33 @@ enum TextRange TEXT_RANGE_WORLD = 4 }; +struct CreatureTextLocale +{ + StringVector Text; +}; + +struct CreatureTextId +{ + CreatureTextId(uint32 e, uint32 g, uint32 i) : entry(e), textGroup(g), textId(i) + { + } + + bool operator<(CreatureTextId const& right) const + { + return memcmp(this, &right, sizeof(CreatureTextId)) < 0; + } + + uint32 entry; + uint32 textGroup; + uint32 textId; +}; + typedef std::vector CreatureTextGroup; //texts in a group typedef UNORDERED_MAP CreatureTextHolder; //groups for a creature by groupid typedef UNORDERED_MAP CreatureTextMap; //all creatures by entry +typedef std::map LocaleCreatureTextMap; + //used for handling non-repeatable random texts typedef std::vector CreatureTextRepeatIds; typedef UNORDERED_MAP CreatureTextRepeatGroup; @@ -57,9 +82,11 @@ class CreatureTextMgr { friend class ACE_Singleton; CreatureTextMgr() {}; + public: ~CreatureTextMgr() {}; void LoadCreatureTexts(); + void LoadCreatureTextLocales(); CreatureTextMap const& GetTextMap() const { return mTextMap; } void SendSound(Creature* source, uint32 sound, ChatMsg msgType, uint64 whisperGuid, TextRange range, Team team, bool gmOnly); @@ -67,17 +94,156 @@ class CreatureTextMgr //if sent, returns the 'duration' of the text else 0 if error uint32 SendChat(Creature* source, uint8 textGroup, uint64 whisperGuid = 0, ChatMsg msgType = CHAT_MSG_ADDON, Language language = LANG_ADDON, TextRange range = TEXT_RANGE_NORMAL, uint32 sound = 0, Team team = TEAM_OTHER, bool gmOnly = false, Player* srcPlr = NULL); - void SendChatString(WorldObject* source, char const* text, ChatMsg msgtype = CHAT_MSG_MONSTER_SAY, Language language = LANG_UNIVERSAL, uint64 whisperGuid = 0, TextRange range = TEXT_RANGE_NORMAL, Team team = TEAM_OTHER, bool gmOnly = false) const; bool TextExist(uint32 sourceEntry, uint8 textGroup); + std::string GetLocalizedChatString(uint32 entry, uint8 textGroup, uint32 id, LocaleConstant locale) const; + + template + void SendChatPacket(WorldObject* source, Builder const& builder, ChatMsg msgType, uint64 whisperGuid = 0, TextRange range = TEXT_RANGE_NORMAL, Team team = TEAM_OTHER, bool gmOnly = false) const; private: CreatureTextRepeatIds GetRepeatGroup(Creature* source, uint8 textGroup); void SetRepeatId(Creature* source, uint8 textGroup, uint8 id); - void BuildMonsterChat(WorldPacket* data, WorldObject* source, ChatMsg msgType, char const* text, Language language, uint64 whisperGuid) const; - void SendChatPacket(WorldPacket* data, WorldObject* source, ChatMsg msgType, uint64 whisperGuid, TextRange range, Team team, bool gmOnly) const; + + void SendNonChatPacket(WorldObject* source, WorldPacket* data, ChatMsg msgType, uint64 whisperGuid, TextRange range, Team team, bool gmOnly) const; + float GetRangeForChatType(ChatMsg msgType) const; CreatureTextMap mTextMap; CreatureTextRepeatMap mTextRepeatMap; + LocaleCreatureTextMap mLocaleTextMap; }; #define sCreatureTextMgr ACE_Singleton::instance() + +template +class CreatureTextLocalizer +{ + public: + CreatureTextLocalizer(Builder const& builder, ChatMsg msgType) : _builder(builder), _msgType(msgType) + { + _packetCache.resize(TOTAL_LOCALES, NULL); + } + + ~CreatureTextLocalizer() + { + for (size_t i = 0; i < _packetCache.size(); ++i) + { + if (_packetCache[i]) + delete _packetCache[i]->first; + delete _packetCache[i]; + } + } + + void operator()(Player* player) + { + LocaleConstant loc_idx = player->GetSession()->GetSessionDbLocaleIndex(); + WorldPacket* messageTemplate; + size_t whisperGUIDpos; + + // create if not cached yet + if (!_packetCache[loc_idx]) + { + messageTemplate = new WorldPacket(SMSG_MESSAGECHAT, 200); + whisperGUIDpos = _builder(messageTemplate, loc_idx); + _packetCache[loc_idx] = new std::pair(messageTemplate, whisperGUIDpos); + } + else + { + messageTemplate = _packetCache[loc_idx]->first; + whisperGUIDpos = _packetCache[loc_idx]->second; + } + + WorldPacket data(*messageTemplate); + switch (_msgType) + { + case CHAT_MSG_MONSTER_WHISPER: + case CHAT_MSG_RAID_BOSS_WHISPER: + data.put(whisperGUIDpos, player->GetGUID()); + break; + default: + break; + } + + player->SendDirectMessage(&data); + } + + private: + std::vector* > _packetCache; + Builder const& _builder; + ChatMsg _msgType; +}; + +template +void CreatureTextMgr::SendChatPacket(WorldObject* source, Builder const& builder, ChatMsg msgType, uint64 whisperGuid, TextRange range, Team team, bool gmOnly) const +{ + if (!source) + return; + + CreatureTextLocalizer localizer(builder, msgType); + + switch (msgType) + { + case CHAT_MSG_MONSTER_WHISPER: + case CHAT_MSG_RAID_BOSS_WHISPER: + { + if (range == TEXT_RANGE_NORMAL) //ignores team and gmOnly + { + Player* player = ObjectAccessor::FindPlayer(whisperGuid); + if (!player || !player->GetSession()) + return; + + localizer(player); + return; + } + break; + } + default: + break; + } + + switch (range) + { + case TEXT_RANGE_AREA: + { + uint32 areaId = source->GetAreaId(); + Map::PlayerList const& players = source->GetMap()->GetPlayers(); + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + if (itr->getSource()->GetAreaId() == areaId && (!team || Team(itr->getSource()->GetTeam()) == team) && (!gmOnly || itr->getSource()->isGameMaster())) + localizer(itr->getSource()); + return; + } + case TEXT_RANGE_ZONE: + { + uint32 zoneId = source->GetZoneId(); + Map::PlayerList const& players = source->GetMap()->GetPlayers(); + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + if (itr->getSource()->GetZoneId() == zoneId && (!team || Team(itr->getSource()->GetTeam()) == team) && (!gmOnly || itr->getSource()->isGameMaster())) + localizer(itr->getSource()); + return; + } + case TEXT_RANGE_MAP: + { + Map::PlayerList const& players = source->GetMap()->GetPlayers(); + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + if ((!team || Team(itr->getSource()->GetTeam()) == team) && (!gmOnly || itr->getSource()->isGameMaster())) + localizer(itr->getSource()); + return; + } + case TEXT_RANGE_WORLD: + { + SessionMap const& smap = sWorld->GetAllSessions(); + for (SessionMap::const_iterator iter = smap.begin(); iter != smap.end(); ++iter) + if (Player* player = iter->second->GetPlayer()) + if (player->GetSession() && (!team || Team(player->GetTeam()) == team) && (!gmOnly || player->isGameMaster())) + localizer(player); + return; + } + case TEXT_RANGE_NORMAL: + default: + break; + } + + float dist = GetRangeForChatType(msgType); + Trinity::PlayerDistWorker > worker(source, dist, localizer); + source->VisitNearbyWorldObject(dist, worker); +} + #endif diff --git a/src/server/game/Tickets/TicketMgr.cpp b/src/server/game/Tickets/TicketMgr.cpp index fe8a8c64607..0ed437461d5 100755 --- a/src/server/game/Tickets/TicketMgr.cpp +++ b/src/server/game/Tickets/TicketMgr.cpp @@ -38,24 +38,38 @@ GmTicket::GmTicket(Player* player, WorldPacket& recv_data) : _createTime(time(NU _playerGuid = player->GetGUID(); uint32 mapId; - recv_data >> mapId; + recv_data >> mapId; // Map is sent as UInt32! _mapId = mapId; recv_data >> _posX; recv_data >> _posY; recv_data >> _posZ; recv_data >> _message; - - uint32 unk1; - recv_data >> unk1; // not sure what this is... replyTo? - uint8 needResponse; - recv_data >> needResponse; // always 1/0 -- not sure what retail does with this + uint32 needResponse; + recv_data >> needResponse; + _needResponse = (needResponse == 17); // Requires GM response. 17 = true, 1 = false (17 is default) + uint8 unk1; + recv_data >> unk1; // Requests further GM interaction on a ticket to which a GM has already responded + + recv_data.rfinish(); + /* + recv_data >> uint32(count); // text lines + for (int i = 0; i < count; i++) + recv_data >> uint32(); + + if (something) + recv_data >> uint32(); + else + compressed uint32 + string; + */ } GmTicket::~GmTicket() { } bool GmTicket::LoadFromDB(Field* fields) { + // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 + // ticketId, guid, name, message, createTime, mapId, posX, posY, posZ, lastModifiedTime, closedBy, assignedTo, comment, completed, escalated, viewed uint8 index = 0; _id = fields[ index].GetUInt32(); _playerGuid = MAKE_NEW_GUID(fields[++index].GetUInt32(), 0, HIGHGUID_PLAYER); @@ -78,6 +92,8 @@ bool GmTicket::LoadFromDB(Field* fields) void GmTicket::SaveToDB(SQLTransaction& trans) const { + // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 + // ticketId, guid, name, message, createTime, mapId, posX, posY, posZ, lastModifiedTime, closedBy, assignedTo, comment, completed, escalated, viewed uint8 index = 0; PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_GM_TICKET); stmt->setUInt32( index, _id); @@ -125,8 +141,8 @@ void GmTicket::WritePacket(WorldPacket& data) const void GmTicket::SendResponse(WorldSession* session) const { WorldPacket data(SMSG_GMRESPONSE_RECEIVED); - data << uint32(1); // unk? Zor says "hasActiveTicket" - data << uint32(0); // can-edit - always 1 or 0, not flags + data << uint32(1); // responseID + data << uint32(_id); // ticketID data << _message.c_str(); data << _response.c_str(); session->SendPacket(&data); @@ -187,13 +203,19 @@ void GmTicket::SetUnassigned() void GmTicket::TeleportTo(Player* player) const { - player->TeleportTo(_mapId, _posX, _posY, _posZ, 1, 0); + player->TeleportTo(_mapId, _posX, _posY, _posZ, 0.0f, 0); } /////////////////////////////////////////////////////////////////////////////////////////////////// // Ticket manager TicketMgr::TicketMgr() : _status(true), _lastTicketId(0), _lastSurveyId(0), _openTicketCount(0), _lastChange(time(NULL)) { } +TicketMgr::~TicketMgr() +{ + for (GmTicketList::const_iterator itr = _ticketList.begin(); itr != _ticketList.end(); ++itr) + delete itr->second; +} + void TicketMgr::Initialize() { SetStatus(sWorld->getBoolConfig(CONFIG_ALLOW_TICKETS)); } void TicketMgr::ResetTickets() @@ -213,10 +235,8 @@ void TicketMgr::LoadTickets() { uint32 oldMSTime = getMSTime(); - if (!_ticketList.empty()) - for (GmTicketList::const_iterator itr = _ticketList.begin(); itr != _ticketList.end(); ++itr) - if (itr->second) - delete itr->second; + for (GmTicketList::const_iterator itr = _ticketList.begin(); itr != _ticketList.end(); ++itr) + delete itr->second; _ticketList.clear(); _lastTicketId = 0; @@ -297,6 +317,7 @@ void TicketMgr::RemoveTicket(uint32 ticketId) { ticket->DeleteFromDB(); _ticketList.erase(ticketId); + delete ticket; } } @@ -336,13 +357,13 @@ void TicketMgr::SendTicket(WorldSession* session, GmTicket* ticket) const } WorldPacket data(SMSG_GMTICKET_GETTICKET, (4 + 4 + (ticket ? message.length() + 1 + 4 + 4 + 4 + 1 + 1 : 0))); - data << uint32(status); // standard 0x0A, 0x06 if text present - data << uint32(1); // g_HasActiveGMTicket -- not a flag + data << uint32(status); // standard 0x0A, 0x06 if text present + data << uint32(ticket ? ticket->GetId() : 0); // ticketID if (ticket) { - data << message.c_str(); // ticket text - data << uint8(0x7); // ticket category; why is this hardcoded? does it make a diff re: client? + data << message.c_str(); // ticket text + data << uint8(0x7); // ticket category; why is this hardcoded? does it make a diff re: client? // we've got the easy stuff done by now. // Now we need to go through the client logic for displaying various levels of ticket load diff --git a/src/server/game/Tickets/TicketMgr.h b/src/server/game/Tickets/TicketMgr.h index cb0a1bab22b..be8b4063d84 100755 --- a/src/server/game/Tickets/TicketMgr.h +++ b/src/server/game/Tickets/TicketMgr.h @@ -40,8 +40,11 @@ enum GMTicketStatus enum GMTicketResponse { - GMTICKET_RESPONSE_FAILURE = 1, - GMTICKET_RESPONSE_SUCCESS = 2, + GMTICKET_RESPONSE_ALREADY_EXIST = 1, + GMTICKET_RESPONSE_CREATE_SUCCESS = 2, + GMTICKET_RESPONSE_CREATE_ERROR = 3, + GMTICKET_RESPONSE_UPDATE_SUCCESS = 4, + GMTICKET_RESPONSE_UPDATE_ERROR = 5, GMTICKET_RESPONSE_TICKET_DELETED = 9, }; @@ -156,6 +159,7 @@ private: bool _completed; GMTicketEscalationStatus _escalatedStatus; bool _viewed; + bool _needResponse; // TODO: find out the use of this, and then store it in DB std::string _response; }; typedef std::map GmTicketList; @@ -166,6 +170,7 @@ class TicketMgr private: TicketMgr(); + ~TicketMgr(); public: void LoadTickets(); diff --git a/src/server/game/Tools/PlayerDump.cpp b/src/server/game/Tools/PlayerDump.cpp index 4d9c5a93875..476a19b6885 100644 --- a/src/server/game/Tools/PlayerDump.cpp +++ b/src/server/game/Tools/PlayerDump.cpp @@ -306,22 +306,28 @@ bool PlayerDumpWriter::DumpTable(std::string& dump, uint32 guid, char const*tabl switch (type) { case DTT_INVENTORY: - StoreGUID(result, 3, items); break; // item guid collection (character_inventory.item) + StoreGUID(result, 3, items); // item guid collection (character_inventory.item) + break; case DTT_PET: - StoreGUID(result, 0, pets); break; // pet petnumber collection (character_pet.id) + StoreGUID(result, 0, pets); // pet petnumber collection (character_pet.id) + break; case DTT_MAIL: - StoreGUID(result, 0, mails); // mail id collection (mail.id) + StoreGUID(result, 0, mails); // mail id collection (mail.id) + break; case DTT_MAIL_ITEM: - StoreGUID(result, 1, items); break; // item guid collection (mail_items.item_guid) + StoreGUID(result, 1, items); // item guid collection (mail_items.item_guid) + break; case DTT_CHARACTER: { - if (result->GetFieldCount() <= 67) // avoid crashes on next check - return true; - if (result->Fetch()[67].GetUInt32()) // characters.deleteInfos_Account - if filled error + if (result->GetFieldCount() <= 68) // avoid crashes on next check + sLog->outCrash("PlayerDumpWriter::DumpTable - Trying to access non-existing or wrong positioned field (`deleteInfos_Account`) in `characters` table."); + + if (result->Fetch()[68].GetUInt32()) // characters.deleteInfos_Account - if filled error return false; break; } - default: break; + default: + break; } dump += CreateDumpString(tableTo, result); @@ -406,7 +412,10 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s bool incHighest = true; if (guid != 0 && guid < sObjectMgr->_hiCharGuid) { - result = CharacterDatabase.PQuery("SELECT 1 FROM characters WHERE guid = '%d'", guid); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHECK_GUID); + stmt->setUInt32(0, guid); + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (result) guid = sObjectMgr->_hiCharGuid; // use first free if exists else incHighest = false; @@ -420,8 +429,10 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s if (ObjectMgr::CheckPlayerName(name, true) == CHAR_NAME_SUCCESS) { - CharacterDatabase.EscapeString(name); // for safe, we use name only for sql quearies anyway - result = CharacterDatabase.PQuery("SELECT 1 FROM characters WHERE name = '%s'", name.c_str()); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHECK_NAME); + stmt->setString(0, name); + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (result) name = ""; // use the one from the dump } @@ -452,7 +463,8 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s { if (!fgets(buf, 32000, fin)) { - if (feof(fin)) break; + if (feof(fin)) + break; ROLLBACK(DUMP_FILE_BROKEN); } @@ -523,9 +535,11 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s { // check if the original name already exists name = getnth(line, 3); - CharacterDatabase.EscapeString(name); - result = CharacterDatabase.PQuery("SELECT 1 FROM characters WHERE name = '%s'", name.c_str()); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHECK_NAME); + stmt->setString(0, name); + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (result) if (!changenth(line, 37, "1")) // characters.at_login set to "rename on login" ROLLBACK(DUMP_FILE_BROKEN); diff --git a/src/server/game/Warden/Modules/WardenModuleWin.h b/src/server/game/Warden/Modules/WardenModuleWin.h index ca61a270a81..bf40cde546b 100644 --- a/src/server/game/Warden/Modules/WardenModuleWin.h +++ b/src/server/game/Warden/Modules/WardenModuleWin.h @@ -19,1186 +19,1219 @@ #ifndef _WARDEN_MODULE_WIN_H #define _WARDEN_MODULE_WIN_H -uint8 Module_79C0768D657977D697E10BAD956CCED1_Data[18756] = -{ - 0x21, 0x6C, 0xBB, 0x6A, 0xB9, 0xAF, 0xE8, 0xA1, 0x9A, 0x79, 0x18, 0xF1, 0x27, 0x9A, 0x14, 0xF5, - 0x42, 0x5D, 0x00, 0xBA, 0x74, 0x57, 0x0E, 0xAF, 0xD2, 0xAE, 0x8E, 0x51, 0xA5, 0xC1, 0x17, 0x4E, - 0xEC, 0x7F, 0xAC, 0xBC, 0xDD, 0x42, 0x87, 0xA6, 0xF9, 0xC1, 0x4A, 0xCE, 0xB5, 0xDD, 0xB3, 0xF8, - 0x06, 0x52, 0x9D, 0xF2, 0xAE, 0x2A, 0x49, 0x2B, 0x7B, 0x72, 0x5F, 0x40, 0x01, 0x16, 0xDB, 0x98, - 0x77, 0x1F, 0xE3, 0x61, 0x5A, 0x99, 0x39, 0x66, 0x2F, 0x2F, 0x35, 0xBF, 0x00, 0x20, 0xE4, 0xE0, - 0x8F, 0x98, 0xAD, 0xFC, 0xDB, 0x7D, 0xDD, 0xE8, 0x7A, 0xE9, 0x21, 0x6C, 0x86, 0x80, 0x3A, 0xE7, - 0x75, 0x66, 0x0E, 0xD9, 0xC6, 0xC5, 0xD8, 0xD8, 0xA9, 0x9B, 0x84, 0x09, 0xF0, 0xB3, 0x7C, 0x72, - 0x53, 0xE2, 0x29, 0xF9, 0x64, 0x8C, 0x17, 0xFD, 0x90, 0xAE, 0x48, 0x5A, 0x30, 0xFA, 0x30, 0xB7, - 0x54, 0x58, 0x59, 0x61, 0xA0, 0x24, 0x57, 0xE4, 0xF0, 0x05, 0xA2, 0x3F, 0x7A, 0xA6, 0x51, 0x7E, - 0x4F, 0x35, 0xF4, 0xE5, 0xFF, 0x98, 0xE9, 0x3E, 0x1F, 0xF1, 0x66, 0x48, 0x5B, 0xF8, 0xCF, 0x3B, - 0x37, 0x3B, 0x60, 0x47, 0x1C, 0xF7, 0xBE, 0x59, 0x70, 0x3A, 0x03, 0x4C, 0xE6, 0xBD, 0xB6, 0xED, - 0x46, 0xAF, 0x04, 0x5A, 0xAA, 0xC4, 0x30, 0xCF, 0x0B, 0x05, 0x86, 0xA9, 0x56, 0x5B, 0x09, 0xF0, - 0x92, 0x59, 0xC8, 0x48, 0x58, 0x33, 0xBF, 0x81, 0x70, 0x51, 0x92, 0x98, 0xE9, 0x4F, 0x2B, 0xDD, - 0x5B, 0x0A, 0x42, 0x51, 0x73, 0x97, 0xF6, 0x66, 0x00, 0xF2, 0x04, 0x50, 0x4A, 0x54, 0x62, 0x7A, - 0x00, 0x10, 0x5B, 0xAD, 0x0E, 0xFC, 0xE1, 0x44, 0x55, 0x4E, 0x21, 0x76, 0xC6, 0x4B, 0xD5, 0x2E, - 0xF5, 0xF4, 0x0E, 0xFC, 0x55, 0xE1, 0xDE, 0x32, 0x20, 0x22, 0x03, 0x98, 0xF0, 0xD3, 0x4A, 0xE5, - 0x45, 0x49, 0x0C, 0xE8, 0x76, 0xE1, 0xBF, 0x4A, 0x53, 0xD3, 0xCE, 0x64, 0xCF, 0x82, 0xCF, 0x67, - 0xA9, 0x3F, 0xF1, 0x06, 0x24, 0x33, 0x0A, 0x98, 0x6A, 0x5C, 0xAB, 0xEE, 0x7F, 0x64, 0xE3, 0x65, - 0x1F, 0xF6, 0xBE, 0xAF, 0x9C, 0x63, 0x53, 0x54, 0x06, 0x84, 0x4F, 0xF2, 0x7D, 0xC5, 0xBD, 0x70, - 0xC7, 0x6F, 0x59, 0x93, 0x7C, 0xEE, 0xC0, 0xCA, 0xF5, 0x56, 0x21, 0x58, 0x5B, 0xD8, 0x1D, 0xB4, - 0xB7, 0x60, 0x72, 0x46, 0xA2, 0x60, 0x3F, 0xC3, 0x30, 0xAB, 0xE0, 0x3B, 0xAC, 0x9E, 0xB9, 0x64, - 0xA8, 0xEF, 0xD0, 0xE1, 0xE5, 0xE1, 0x83, 0x48, 0xB8, 0x35, 0xA7, 0x12, 0x11, 0x00, 0xC9, 0x29, - 0x1A, 0x41, 0x1D, 0x3B, 0xFB, 0x33, 0x0B, 0x66, 0x45, 0x86, 0x61, 0x70, 0x35, 0x4C, 0x5F, 0x64, - 0x8E, 0xF5, 0x57, 0xBE, 0xA6, 0xFA, 0x49, 0xC9, 0x89, 0xA4, 0x74, 0x02, 0x9E, 0xE7, 0x67, 0x14, - 0x8B, 0xB9, 0xE7, 0xA8, 0xB0, 0x75, 0x65, 0x22, 0xB7, 0xCD, 0xFA, 0x55, 0x18, 0x00, 0x55, 0xB5, - 0x09, 0x70, 0x7E, 0x05, 0x0B, 0x11, 0x42, 0xF0, 0x80, 0x58, 0x2F, 0xFE, 0x3B, 0x2C, 0x4A, 0xCA, - 0x50, 0x34, 0xD0, 0x6F, 0xF1, 0xCC, 0x7F, 0x35, 0xD7, 0x9B, 0xF2, 0x97, 0x16, 0xFE, 0x5F, 0x6C, - 0x94, 0xDC, 0xAC, 0x63, 0xC8, 0x85, 0x2E, 0x60, 0x41, 0x34, 0x89, 0xD3, 0xDD, 0xBF, 0x2D, 0x69, - 0xC2, 0xF7, 0x74, 0xB2, 0x56, 0xD9, 0x76, 0xA2, 0x35, 0x30, 0x60, 0x35, 0xAB, 0x50, 0x21, 0xAE, - 0xFC, 0xFA, 0x19, 0x06, 0xDE, 0x89, 0x46, 0xFF, 0x34, 0x2F, 0x19, 0x84, 0x85, 0xF5, 0x1E, 0x60, - 0x91, 0x0D, 0x8C, 0x94, 0xDB, 0x2E, 0xEE, 0x4D, 0x0A, 0x29, 0x64, 0x81, 0xAD, 0x4C, 0xBF, 0x41, - 0x51, 0x04, 0xCD, 0x1C, 0x5C, 0x89, 0xD3, 0x3A, 0x91, 0xD9, 0x5C, 0x7E, 0xF3, 0xE9, 0x5B, 0x9E, - 0xC2, 0xD2, 0xE4, 0xD5, 0xEF, 0x47, 0x63, 0xD2, 0xD4, 0x19, 0x3E, 0xDF, 0xCF, 0xA4, 0x10, 0x47, - 0x16, 0x93, 0xC2, 0xF2, 0x22, 0xED, 0x1D, 0x9E, 0x21, 0x63, 0xC4, 0xCB, 0x89, 0xBB, 0x3E, 0xF7, - 0x89, 0x68, 0x6D, 0x2C, 0xDF, 0x2C, 0x6F, 0xB2, 0x8D, 0x75, 0xF8, 0xC6, 0x57, 0x98, 0x47, 0x86, - 0x40, 0x72, 0xBB, 0xD7, 0x32, 0xCD, 0x7A, 0x15, 0x64, 0x83, 0xD9, 0x50, 0x2E, 0xDE, 0x0C, 0x8C, - 0x30, 0xCD, 0xB0, 0x64, 0xD6, 0x7F, 0xE7, 0xAD, 0x6E, 0x01, 0x3E, 0x14, 0x8A, 0x24, 0x86, 0x1F, - 0x92, 0xAB, 0x1A, 0xE5, 0xD6, 0xBF, 0x64, 0xE5, 0xF6, 0x34, 0x62, 0xD5, 0x92, 0x5B, 0x64, 0xC4, - 0xFC, 0x1B, 0x7F, 0xA0, 0x13, 0xC1, 0xD4, 0xEB, 0x92, 0x90, 0xEF, 0x8C, 0x5E, 0x75, 0x4B, 0x78, - 0x56, 0x5F, 0xA2, 0x55, 0x4B, 0x1B, 0xE3, 0xDD, 0x80, 0x7E, 0xCF, 0x69, 0x97, 0x5A, 0x76, 0xD5, - 0xAA, 0x7D, 0x85, 0x73, 0x10, 0x4E, 0x79, 0x9A, 0x10, 0x10, 0x01, 0xD8, 0xD7, 0x85, 0x41, 0x8D, - 0x3D, 0xEA, 0xE3, 0x59, 0xD9, 0x31, 0x4B, 0x23, 0xC6, 0x53, 0x11, 0xA6, 0x35, 0x29, 0x64, 0x7E, - 0x28, 0xD7, 0x8D, 0x03, 0x70, 0x5C, 0x53, 0xA7, 0x6D, 0x81, 0x30, 0x7B, 0xDF, 0x2B, 0xAE, 0xAB, - 0x6F, 0x52, 0x93, 0xCF, 0xDD, 0x00, 0x35, 0xE9, 0x65, 0x4A, 0x04, 0x79, 0x11, 0x30, 0xCA, 0xC7, - 0xD2, 0xF3, 0x34, 0xAC, 0x32, 0x1F, 0xE4, 0xE5, 0x83, 0x12, 0x66, 0xD6, 0xA6, 0xE4, 0xEB, 0x67, - 0x7E, 0xDD, 0x64, 0x3E, 0xF1, 0x0C, 0xE6, 0x1C, 0xB6, 0xE1, 0xB0, 0x2B, 0xE7, 0x83, 0xB4, 0x4A, - 0x82, 0xDD, 0xC1, 0x22, 0x3F, 0x03, 0x38, 0x90, 0xB2, 0xA9, 0x7B, 0x60, 0x57, 0xF9, 0xDD, 0x04, - 0x60, 0x5D, 0x7C, 0x2C, 0xD3, 0xE6, 0xFE, 0x02, 0x5A, 0x7D, 0x2A, 0x48, 0x81, 0x42, 0x20, 0x84, - 0xFF, 0x1D, 0xCC, 0x64, 0x11, 0x70, 0xE5, 0x4F, 0x9F, 0xE0, 0x11, 0xFB, 0xF0, 0xE2, 0xC4, 0x9B, - 0x11, 0x30, 0x7F, 0x2F, 0x7F, 0xA1, 0xB1, 0xBC, 0x5F, 0x29, 0x21, 0xDF, 0xB4, 0xEB, 0xB2, 0x4F, - 0xAA, 0x2D, 0x95, 0x60, 0x47, 0x78, 0x37, 0x67, 0xCD, 0xFA, 0x36, 0x17, 0x8F, 0x64, 0x15, 0xAF, - 0x04, 0xAA, 0x5C, 0x76, 0x23, 0x07, 0x64, 0x96, 0xB2, 0x5A, 0xCF, 0x03, 0xDC, 0xC3, 0x2D, 0xFB, - 0x0D, 0x2D, 0xA8, 0xBD, 0xCE, 0x58, 0xF8, 0x44, 0x75, 0xA1, 0x07, 0xAA, 0xDF, 0x25, 0xDC, 0x25, - 0x32, 0xCF, 0xA8, 0x92, 0xC5, 0xC0, 0xD5, 0x70, 0x21, 0x19, 0x6F, 0x32, 0xCA, 0x16, 0xFA, 0x8C, - 0xB2, 0x86, 0xF6, 0xD5, 0x2E, 0xD9, 0x0A, 0x9C, 0x96, 0xDB, 0x4D, 0xA4, 0x11, 0x02, 0x4C, 0x33, - 0x99, 0xB3, 0x5E, 0x45, 0x5C, 0xF1, 0x99, 0x61, 0x04, 0x20, 0xC9, 0xC8, 0xB3, 0xB4, 0xD3, 0x8B, - 0x24, 0x78, 0x55, 0x2E, 0xB7, 0x48, 0x43, 0x17, 0xBF, 0xB9, 0x2A, 0xCC, 0xD5, 0x4A, 0x49, 0xB2, - 0x4E, 0x1E, 0xC7, 0x45, 0x4E, 0x55, 0xC4, 0xBC, 0xB1, 0xD2, 0xA6, 0x62, 0xE9, 0x95, 0xBB, 0xCD, - 0x87, 0xD2, 0x7C, 0xE5, 0xC6, 0x77, 0x5B, 0xFF, 0xAF, 0xDD, 0x44, 0x9D, 0x3D, 0x10, 0x05, 0x3C, - 0x77, 0x7A, 0xF8, 0x84, 0x0D, 0x04, 0x55, 0xB5, 0x20, 0xEA, 0xD2, 0x3F, 0x04, 0x33, 0xFF, 0xE2, - 0x01, 0x3B, 0x51, 0x46, 0x3E, 0x34, 0xAA, 0x40, 0xCA, 0x7C, 0x85, 0x46, 0x57, 0xD9, 0xB7, 0xE1, - 0xDC, 0x65, 0xEF, 0x11, 0x66, 0x0B, 0xBA, 0xD8, 0x37, 0x66, 0x96, 0x64, 0x54, 0x8B, 0x05, 0x81, - 0x47, 0x87, 0x70, 0xA8, 0x54, 0xC6, 0x02, 0x08, 0xB4, 0xAD, 0x69, 0x3C, 0xC0, 0x03, 0x69, 0x19, - 0xE6, 0xAC, 0x13, 0xD5, 0x3F, 0x2C, 0x9D, 0x61, 0xCC, 0xA8, 0x60, 0xB5, 0x60, 0x85, 0x19, 0x5B, - 0x3E, 0x82, 0xCA, 0x34, 0x70, 0x06, 0xCD, 0x37, 0x3E, 0x91, 0x2F, 0x49, 0x82, 0x0A, 0x87, 0xE8, - 0x09, 0x18, 0xB3, 0xF4, 0x16, 0xA4, 0xA5, 0x46, 0xC5, 0x76, 0x6D, 0x73, 0xB1, 0x93, 0xDC, 0x69, - 0xF4, 0x49, 0xF8, 0x2F, 0x97, 0xB4, 0xAA, 0x19, 0x4A, 0x60, 0xD2, 0xF9, 0x7B, 0x5A, 0xF0, 0x57, - 0x45, 0xC6, 0xA2, 0x64, 0x37, 0x56, 0xED, 0x6B, 0x5E, 0x1D, 0x9E, 0x35, 0x5E, 0xFE, 0xDE, 0x04, - 0x08, 0x3B, 0x62, 0x40, 0x82, 0xD4, 0xF9, 0xF3, 0x54, 0x95, 0x3E, 0x57, 0x49, 0x3A, 0x41, 0x41, - 0xDA, 0xD4, 0x78, 0x80, 0xC7, 0xF1, 0xDE, 0xA7, 0xFF, 0xDC, 0x53, 0xC9, 0x3A, 0x37, 0xA5, 0x83, - 0xDE, 0xE8, 0x51, 0x33, 0x7B, 0xE6, 0xAC, 0xA5, 0xC4, 0x7D, 0x34, 0xB0, 0x99, 0x0D, 0x03, 0x34, - 0x0F, 0x8D, 0xB8, 0x10, 0x4E, 0x30, 0x38, 0x10, 0xFC, 0x62, 0xC3, 0xC0, 0xF5, 0x67, 0x69, 0xF5, - 0x23, 0xB4, 0xF2, 0x6B, 0x79, 0xA8, 0xEE, 0xF0, 0xDD, 0x06, 0xA1, 0x50, 0x41, 0x3E, 0x1D, 0x04, - 0xB0, 0xB7, 0xC8, 0x58, 0x20, 0x72, 0xF6, 0x41, 0x53, 0x58, 0xAA, 0xAB, 0xA1, 0x19, 0xB0, 0x99, - 0xE4, 0x35, 0x44, 0x32, 0xF0, 0x34, 0x52, 0x4E, 0xD0, 0xBC, 0x1D, 0xD2, 0x14, 0x6A, 0x22, 0x46, - 0x93, 0x52, 0xFF, 0xD5, 0xD9, 0xEF, 0x19, 0xAF, 0xFB, 0x9A, 0x0D, 0x4A, 0x14, 0x49, 0xAE, 0xC0, - 0x09, 0x5E, 0x40, 0x36, 0x63, 0xE7, 0xC3, 0xFA, 0x84, 0x1C, 0xBF, 0x65, 0x17, 0xED, 0xED, 0x49, - 0x93, 0xB9, 0xCD, 0x85, 0x3F, 0x95, 0x57, 0xF9, 0xE7, 0x59, 0x55, 0x59, 0xED, 0x3A, 0xA1, 0x90, - 0x24, 0x36, 0xB8, 0x38, 0x91, 0x57, 0x59, 0xDB, 0xDE, 0x8E, 0x8B, 0x3A, 0xBB, 0x31, 0x76, 0x39, - 0x0D, 0x20, 0x84, 0x8A, 0x05, 0x5A, 0xC1, 0x93, 0x04, 0x5E, 0x9E, 0x2E, 0x41, 0x13, 0xC9, 0x7F, - 0xAB, 0x45, 0x86, 0x99, 0xB2, 0x5C, 0x7E, 0x1A, 0x1C, 0x9C, 0x7C, 0xCF, 0x60, 0x38, 0xF7, 0x02, - 0x8A, 0xE6, 0x74, 0x4F, 0x31, 0x67, 0x99, 0x96, 0xC3, 0x79, 0xEB, 0x19, 0x07, 0xAD, 0xBB, 0xD2, - 0xD7, 0x51, 0x75, 0xDD, 0xD5, 0x44, 0xC2, 0x9A, 0xDE, 0x01, 0x68, 0x8C, 0xBF, 0x11, 0xFE, 0x5F, - 0xB9, 0xCF, 0x25, 0x35, 0xD2, 0xF7, 0x29, 0xE0, 0x63, 0x0F, 0x0A, 0xCA, 0xB9, 0x38, 0xB6, 0xDA, - 0xDD, 0x66, 0xD9, 0x5F, 0x67, 0x42, 0x15, 0xD8, 0x1C, 0xD1, 0x1C, 0xCC, 0xD6, 0xB9, 0x29, 0x85, - 0x99, 0xD6, 0xDD, 0xCE, 0x8E, 0x3D, 0x63, 0x1C, 0x31, 0x32, 0x37, 0xCD, 0xE1, 0xF8, 0xEA, 0x4E, - 0x31, 0x25, 0xF7, 0x2D, 0xE1, 0xCA, 0x36, 0x5B, 0xEC, 0xAC, 0x2B, 0xB0, 0xA5, 0x69, 0x3B, 0x4C, - 0xAE, 0xD7, 0x15, 0xF7, 0x7F, 0x5C, 0x5F, 0x82, 0xF0, 0x1D, 0x44, 0x62, 0xA0, 0x72, 0x57, 0xAD, - 0xB3, 0xD7, 0x1B, 0xA9, 0xE2, 0x76, 0xFF, 0x18, 0xA6, 0x3E, 0xF9, 0xF5, 0x6F, 0xB5, 0x13, 0x26, - 0x72, 0x0F, 0xF4, 0xE1, 0x7D, 0x43, 0x86, 0x48, 0x42, 0x0B, 0x94, 0x96, 0xBF, 0x0E, 0x32, 0x1C, - 0xE0, 0x18, 0x69, 0xA9, 0xAE, 0x83, 0x6F, 0x36, 0xE7, 0x04, 0x20, 0xEE, 0x34, 0xFF, 0x21, 0xE9, - 0xBA, 0x3B, 0x38, 0x48, 0x2D, 0x81, 0x38, 0x48, 0x25, 0xE5, 0x4A, 0xAD, 0x81, 0xA9, 0xE8, 0x33, - 0x0A, 0x4C, 0x60, 0xAE, 0xBB, 0xCC, 0x24, 0x96, 0x44, 0xF3, 0x1A, 0x2A, 0x89, 0xCB, 0xD9, 0x5E, - 0x89, 0x4C, 0xFD, 0x62, 0xA8, 0x38, 0x1E, 0x73, 0x63, 0xB3, 0xF1, 0x3E, 0xAC, 0xB1, 0x0B, 0x5D, - 0x10, 0xE5, 0xCC, 0x88, 0x2F, 0x9D, 0x57, 0xF1, 0x33, 0xA6, 0x50, 0x13, 0x2C, 0x54, 0x81, 0x1B, - 0x90, 0xD8, 0x6F, 0x7C, 0x02, 0x86, 0xA8, 0x02, 0x5F, 0xCE, 0x24, 0x22, 0x76, 0x73, 0xE8, 0x66, - 0xDC, 0x7F, 0x8F, 0x69, 0x4E, 0xBB, 0x63, 0xEB, 0xCD, 0x38, 0xE6, 0xEE, 0x84, 0x70, 0x97, 0x2F, - 0xD1, 0x77, 0xEE, 0x63, 0xE4, 0x2D, 0x42, 0xDE, 0x17, 0x95, 0x18, 0xB5, 0xA9, 0x4D, 0xFD, 0x2A, - 0xA8, 0x07, 0x1F, 0xCC, 0x3F, 0x22, 0x3B, 0x03, 0x49, 0xCF, 0x83, 0x83, 0x85, 0xAA, 0x87, 0xA0, - 0xC6, 0x30, 0x8C, 0x8F, 0x91, 0x88, 0x67, 0xA7, 0x1F, 0xE0, 0xE2, 0x40, 0x1E, 0xE9, 0x12, 0x2E, - 0x5C, 0x33, 0x44, 0x29, 0x0D, 0xEA, 0x34, 0x8B, 0x1A, 0x48, 0x80, 0x67, 0x45, 0x2A, 0xF2, 0x82, - 0xD8, 0x78, 0x7E, 0x36, 0x59, 0x6C, 0x32, 0x58, 0x3B, 0x0F, 0x2C, 0x0B, 0xD1, 0xFA, 0x67, 0x2B, - 0x0C, 0xFF, 0x16, 0x57, 0x04, 0x38, 0x51, 0x4F, 0x34, 0xEE, 0x94, 0x8B, 0xBB, 0x7B, 0xBE, 0xEA, - 0x37, 0xB5, 0x9F, 0xBA, 0xDE, 0xC1, 0xC6, 0x34, 0x2D, 0x36, 0xE6, 0xC8, 0x67, 0x6A, 0x74, 0x56, - 0xB5, 0x05, 0x53, 0xAE, 0x5C, 0x94, 0x83, 0xF9, 0xE0, 0xD7, 0x21, 0xC2, 0x71, 0x4B, 0x0F, 0x9C, - 0x64, 0x1C, 0xF4, 0x6A, 0xF8, 0xE3, 0x3C, 0x8F, 0xD2, 0x20, 0xCF, 0x14, 0xAC, 0x21, 0xF5, 0x2A, - 0xE7, 0xEC, 0x5C, 0x49, 0xAB, 0x21, 0xF2, 0x41, 0x2C, 0x3B, 0xA0, 0x49, 0x43, 0xF3, 0x14, 0xFE, - 0x68, 0x7C, 0x83, 0x05, 0xF3, 0x71, 0x77, 0x02, 0x2B, 0xD4, 0x94, 0x2B, 0x28, 0x5E, 0x4A, 0x5E, - 0x6E, 0x81, 0x1A, 0xD3, 0xDA, 0x58, 0x9F, 0xD6, 0x7B, 0x6D, 0xAD, 0x14, 0xBC, 0x60, 0xFC, 0xC4, - 0x83, 0x0A, 0x8E, 0x9B, 0x8D, 0x5B, 0x24, 0x77, 0x10, 0x34, 0x78, 0xC9, 0x8F, 0xA5, 0x2D, 0x0F, - 0x6A, 0x88, 0x7F, 0x24, 0x40, 0x46, 0x25, 0x3A, 0xDE, 0xB9, 0x9E, 0xA2, 0xE7, 0x8D, 0x52, 0xA2, - 0xFF, 0xDE, 0xB4, 0x95, 0xDB, 0x05, 0x2E, 0xDF, 0x29, 0x28, 0xB5, 0x76, 0xD6, 0x1D, 0x09, 0x45, - 0x69, 0x29, 0xF9, 0x95, 0xAA, 0x36, 0x71, 0xD9, 0x3F, 0xFF, 0x6B, 0x04, 0xFE, 0xED, 0x63, 0xC8, - 0x3C, 0x4B, 0x6B, 0x0B, 0xF3, 0xD8, 0x71, 0x15, 0xDA, 0xC0, 0xC9, 0xE2, 0x0D, 0x87, 0x94, 0x61, - 0xBE, 0xEF, 0x79, 0x92, 0x4C, 0x14, 0x92, 0xBF, 0x0C, 0x4E, 0xA0, 0x1B, 0x58, 0x00, 0x30, 0xF6, - 0xD0, 0x09, 0xD6, 0x1E, 0x81, 0xA0, 0xE7, 0xFD, 0xFD, 0xFF, 0x21, 0x47, 0xAB, 0xDE, 0x67, 0xC6, - 0xF4, 0x19, 0x60, 0x0C, 0x49, 0xE5, 0xC4, 0xBD, 0x64, 0x05, 0xED, 0x89, 0xD7, 0xBD, 0x74, 0xF7, - 0xD4, 0xCC, 0x4B, 0x9E, 0xEB, 0x6E, 0xB7, 0x87, 0xB6, 0x31, 0x07, 0xCB, 0x6E, 0x0D, 0xDF, 0x3A, - 0xD8, 0x64, 0x1F, 0xF9, 0x2C, 0xEE, 0xC0, 0x61, 0x22, 0x0E, 0x5A, 0x20, 0x0C, 0xD4, 0x4F, 0xC5, - 0x2D, 0x82, 0x63, 0x39, 0x36, 0x34, 0x07, 0xC6, 0x23, 0xBC, 0xF1, 0x56, 0xC6, 0x8C, 0x39, 0x23, - 0x43, 0xFF, 0xEC, 0xBE, 0x95, 0x7B, 0xC7, 0xFD, 0xA9, 0x99, 0x3D, 0xDF, 0x50, 0x28, 0x39, 0xCA, - 0x80, 0xCF, 0x1C, 0xE7, 0x81, 0x06, 0xB4, 0x43, 0x55, 0xFB, 0xB0, 0xA4, 0x5D, 0x78, 0x39, 0x71, - 0x88, 0xEC, 0xBB, 0x01, 0x69, 0x5E, 0x85, 0x97, 0x1F, 0xEB, 0x6C, 0x82, 0x07, 0xF4, 0x00, 0x1B, - 0x90, 0x03, 0x1B, 0x92, 0x9A, 0x4A, 0x95, 0x9D, 0x45, 0x45, 0x65, 0x6F, 0x8B, 0x70, 0x4C, 0xFE, - 0x48, 0x94, 0x5B, 0x71, 0x86, 0x70, 0x45, 0xB7, 0x85, 0xD9, 0x59, 0x29, 0x94, 0x47, 0x5A, 0x17, - 0x96, 0xA1, 0x0E, 0xFD, 0x72, 0x71, 0xE1, 0x3F, 0x7B, 0xE6, 0x59, 0x2A, 0x91, 0x5A, 0x6B, 0x82, - 0xB1, 0xA1, 0x31, 0xC2, 0xE4, 0xE3, 0xB9, 0x8E, 0x5A, 0x68, 0xC1, 0x18, 0xD4, 0x4B, 0x02, 0x2E, - 0x50, 0x3D, 0x73, 0x53, 0x2B, 0x13, 0x77, 0x19, 0xC7, 0x03, 0x0B, 0xB5, 0xAD, 0x5C, 0x0B, 0x6B, - 0x66, 0x12, 0xF0, 0xE8, 0x67, 0xB7, 0xF7, 0x88, 0x64, 0xA8, 0x2C, 0x51, 0xA7, 0xF8, 0x5E, 0xB3, - 0x39, 0xEC, 0x1B, 0xDF, 0x6C, 0x89, 0x16, 0xFD, 0x51, 0x26, 0x29, 0x8D, 0x0E, 0xBE, 0x1B, 0xCE, - 0x61, 0xE5, 0x22, 0x09, 0xC1, 0x0F, 0xAD, 0x0C, 0xA1, 0x61, 0xF8, 0x49, 0x29, 0x11, 0x7C, 0x93, - 0x0C, 0xBE, 0xD0, 0x11, 0x6F, 0x24, 0x4E, 0x4B, 0xF5, 0xEF, 0x41, 0x3D, 0x0C, 0x69, 0xC6, 0xA6, - 0xBF, 0x87, 0x68, 0xFF, 0x2F, 0x76, 0xD9, 0xFD, 0x1D, 0x8E, 0x9F, 0x80, 0x19, 0x3B, 0x35, 0x8B, - 0x2D, 0xDB, 0x5C, 0x3E, 0x86, 0xE8, 0xBF, 0xF1, 0x30, 0x88, 0xE4, 0x80, 0xD0, 0x49, 0xC3, 0x50, - 0xF8, 0x1E, 0xCE, 0xDA, 0xAC, 0x2E, 0x3F, 0x97, 0x51, 0x12, 0x89, 0x47, 0x5D, 0xF4, 0xD4, 0x77, - 0x93, 0x66, 0x74, 0xE3, 0x4C, 0xCD, 0xB4, 0xC8, 0x00, 0x85, 0x64, 0x8C, 0x04, 0x72, 0x1C, 0x14, - 0xDA, 0x77, 0xD7, 0x1D, 0x39, 0xC3, 0x65, 0xD0, 0x28, 0x51, 0xCA, 0x91, 0xAE, 0x2D, 0xCD, 0x50, - 0x0D, 0x1B, 0xA4, 0xF1, 0x5D, 0x4C, 0x28, 0x1C, 0x57, 0xE5, 0x00, 0xEC, 0xA4, 0x02, 0x3B, 0xCA, - 0x70, 0xF3, 0x8B, 0x3C, 0x4F, 0xEE, 0x9D, 0x08, 0xFF, 0x66, 0x31, 0xCE, 0x37, 0x93, 0x90, 0x3D, - 0x6E, 0xDE, 0xB9, 0xCF, 0x35, 0xAA, 0xF0, 0x43, 0x3E, 0x6B, 0x19, 0xEC, 0x69, 0x7A, 0xF0, 0xC6, - 0xC3, 0x7D, 0x49, 0x89, 0x43, 0xCC, 0x2C, 0x20, 0x2E, 0xB8, 0x5D, 0xCC, 0xDB, 0x39, 0xCB, 0x0B, - 0x76, 0xD8, 0xAC, 0xD6, 0x2A, 0x76, 0x59, 0x7F, 0x6A, 0x1B, 0xCD, 0x4A, 0x93, 0xCA, 0x42, 0x5F, - 0xC7, 0x98, 0xFA, 0xC9, 0x30, 0x2E, 0x9F, 0x8F, 0xE5, 0xB5, 0x37, 0x41, 0x19, 0xF4, 0xA0, 0xE5, - 0xDA, 0x7D, 0x3C, 0xF5, 0x61, 0xCC, 0x98, 0x27, 0xED, 0xE4, 0x5C, 0x0E, 0x7C, 0x1B, 0x33, 0x38, - 0x77, 0x20, 0x92, 0xC9, 0xD3, 0x38, 0xC3, 0x03, 0x2C, 0xAF, 0xE2, 0x77, 0x34, 0x4B, 0xE2, 0x1C, - 0x9F, 0xE4, 0x4D, 0xAB, 0x12, 0xFE, 0xCD, 0xB3, 0x2C, 0xD3, 0xE2, 0x42, 0xB8, 0xE7, 0xE0, 0x14, - 0x88, 0x31, 0xB1, 0xDC, 0x35, 0xDE, 0xCD, 0x3D, 0x3B, 0xDF, 0x6C, 0x00, 0xA3, 0x48, 0xA6, 0x71, - 0x7E, 0xC6, 0x3A, 0xE8, 0x07, 0xCE, 0xC8, 0xE7, 0xDC, 0xB1, 0x98, 0x17, 0xDB, 0x75, 0x20, 0xFE, - 0x38, 0xC7, 0x1F, 0x02, 0x8E, 0xE4, 0x91, 0x79, 0x3D, 0xC0, 0x50, 0x2D, 0xC7, 0x49, 0x33, 0x6C, - 0xDF, 0x3C, 0xE9, 0x42, 0xE9, 0x27, 0xBC, 0x39, 0x38, 0xAA, 0x98, 0x16, 0x6E, 0x1F, 0x71, 0xDF, - 0x3B, 0xBA, 0x15, 0x2F, 0x69, 0xEB, 0x06, 0x5C, 0xFB, 0xF8, 0x4C, 0x83, 0x2C, 0x28, 0xC2, 0x19, - 0xAD, 0x04, 0xA1, 0xB0, 0x7F, 0xF1, 0x9C, 0x84, 0x38, 0x42, 0x45, 0x3E, 0x1E, 0xC7, 0x95, 0xD5, - 0xAF, 0x35, 0x7E, 0x2A, 0xCC, 0x06, 0x9D, 0x9A, 0xCF, 0xC2, 0x56, 0xE6, 0x73, 0x7F, 0x7E, 0x9D, - 0x9B, 0x01, 0x27, 0x76, 0x14, 0x8C, 0x3E, 0x3A, 0xBD, 0x2E, 0x6C, 0x7C, 0xB7, 0xF2, 0x9A, 0x92, - 0x41, 0xBC, 0xD0, 0x48, 0xF6, 0xE6, 0x16, 0x62, 0x01, 0x4D, 0x3D, 0x8E, 0xD2, 0x98, 0x8F, 0x61, - 0x70, 0x7C, 0x41, 0xCC, 0xCA, 0x3D, 0x3E, 0x0B, 0x70, 0xC3, 0x9F, 0x9D, 0x3E, 0x33, 0x50, 0x2B, - 0xB0, 0x47, 0xC8, 0xA3, 0xAA, 0x55, 0xBA, 0x16, 0x3B, 0xF4, 0x07, 0x98, 0x1B, 0x6C, 0x49, 0x6A, - 0xA5, 0xB4, 0x7A, 0xBE, 0x28, 0x37, 0xF2, 0x55, 0x69, 0x09, 0x7A, 0xEC, 0x94, 0x1C, 0x60, 0xE3, - 0xB5, 0x89, 0x07, 0x58, 0x43, 0xA3, 0x3F, 0x1D, 0x94, 0x20, 0x49, 0x5E, 0xC1, 0xB7, 0x4E, 0x2C, - 0x75, 0x95, 0x54, 0x91, 0x4A, 0x01, 0x90, 0xF8, 0xF1, 0x81, 0xC6, 0x4C, 0x9A, 0x63, 0x20, 0x55, - 0x65, 0x8D, 0x30, 0xA2, 0xD4, 0xC7, 0xAF, 0x18, 0xA5, 0x83, 0xB6, 0x68, 0x1B, 0x35, 0x13, 0x6D, - 0xC6, 0x77, 0x5A, 0x04, 0xFB, 0xD5, 0xBD, 0x2B, 0x0D, 0x55, 0x5E, 0xEC, 0x7A, 0x80, 0x17, 0x01, - 0x9C, 0x4F, 0x55, 0x39, 0x57, 0x9F, 0x31, 0x9E, 0xB9, 0xB1, 0x35, 0xD5, 0x2F, 0xB9, 0xF3, 0x6A, - 0x9C, 0x30, 0xEA, 0x1B, 0xE9, 0x34, 0x4A, 0x2F, 0xB1, 0x36, 0x9C, 0xF0, 0x8A, 0xE9, 0x62, 0xDB, - 0x06, 0x32, 0x64, 0x39, 0x58, 0x29, 0xBD, 0xB1, 0x2C, 0x06, 0x56, 0x54, 0xAF, 0x6B, 0x97, 0x5A, - 0x7D, 0x49, 0xB6, 0xDF, 0x06, 0xFC, 0x9F, 0x06, 0x64, 0x89, 0xF5, 0xF4, 0xC4, 0x55, 0x02, 0x19, - 0xAA, 0xC9, 0x1D, 0x8A, 0x5E, 0x3D, 0xA7, 0x13, 0xEC, 0x52, 0x29, 0x8B, 0x6E, 0xC5, 0xA0, 0x62, - 0x9E, 0x89, 0x96, 0xDF, 0x5E, 0x74, 0x69, 0x53, 0x75, 0xCA, 0xF0, 0x95, 0x0E, 0xF8, 0x42, 0xB6, - 0x06, 0x62, 0xDA, 0x92, 0x48, 0xC3, 0x37, 0x50, 0x59, 0xDF, 0x59, 0xAF, 0xAF, 0x0E, 0x2E, 0x84, - 0xE5, 0x2F, 0x3C, 0xC9, 0x7E, 0x2A, 0xE5, 0xA9, 0x41, 0xB1, 0x51, 0x82, 0xC6, 0x42, 0xEC, 0x65, - 0xFD, 0xCB, 0x54, 0x29, 0x33, 0xC2, 0xE5, 0x5E, 0x10, 0xFB, 0x9E, 0x19, 0xE2, 0x75, 0x53, 0x43, - 0x50, 0xD5, 0x10, 0x8E, 0xBC, 0xC6, 0x2A, 0x0A, 0x8D, 0x7F, 0x4A, 0xF6, 0x07, 0x28, 0xA1, 0xEB, - 0x14, 0x1C, 0xD3, 0xE9, 0x63, 0x55, 0xC7, 0xD2, 0xE8, 0xB2, 0x3D, 0x17, 0x84, 0x63, 0xF9, 0x11, - 0xA4, 0x11, 0xE0, 0xA1, 0x83, 0x11, 0x11, 0xD2, 0xA0, 0x8C, 0x61, 0x74, 0x36, 0x63, 0xE9, 0xE8, - 0x98, 0x4C, 0x20, 0x38, 0x1F, 0xA5, 0x15, 0x60, 0x3E, 0x5C, 0x1B, 0xE6, 0xDE, 0xC1, 0x70, 0x7F, - 0xCB, 0x92, 0x76, 0x05, 0xD8, 0x63, 0xDF, 0x01, 0x7E, 0xF2, 0xF1, 0x01, 0xBD, 0xCE, 0x9A, 0x1E, - 0x50, 0x7F, 0xB4, 0xF4, 0x49, 0x5D, 0x7F, 0xCA, 0x86, 0x83, 0x2F, 0x63, 0x33, 0xEF, 0x4F, 0x35, - 0xA1, 0xBF, 0xB6, 0xCD, 0x25, 0xBA, 0x0E, 0xB9, 0xA3, 0x96, 0x41, 0xD4, 0x90, 0xFF, 0xEB, 0xF7, - 0x4F, 0x93, 0xC8, 0xD7, 0x04, 0x62, 0x6E, 0x88, 0xD7, 0x71, 0x0E, 0x0E, 0x37, 0x50, 0xCE, 0xFA, - 0x9B, 0xBD, 0x5B, 0xB0, 0xB7, 0x0F, 0x70, 0x75, 0x0A, 0x5D, 0xFC, 0x69, 0xB3, 0x07, 0x11, 0x9B, - 0xE8, 0x13, 0x0D, 0xBF, 0x08, 0x33, 0x59, 0x20, 0x4A, 0xBD, 0x27, 0x76, 0xED, 0xF2, 0x36, 0x0B, - 0xEA, 0xBC, 0x78, 0x17, 0xBD, 0x6E, 0x4F, 0x37, 0xD3, 0x26, 0x86, 0x85, 0xB1, 0x71, 0xEA, 0x55, - 0x73, 0xAA, 0x7C, 0xA2, 0x36, 0x75, 0xD2, 0xCD, 0xE4, 0xFC, 0xE7, 0xCE, 0x5E, 0xB1, 0xE5, 0xF4, - 0x65, 0xD7, 0x8F, 0x34, 0x07, 0x66, 0xA7, 0x4B, 0xCE, 0x55, 0xB0, 0x71, 0xFD, 0x20, 0x03, 0x5C, - 0xBA, 0x28, 0x0B, 0x71, 0x4D, 0x93, 0xB9, 0x77, 0x5E, 0x46, 0x6A, 0xCB, 0xD7, 0x0A, 0x59, 0x2E, - 0x26, 0x49, 0x0A, 0x36, 0x0F, 0x03, 0x6F, 0x32, 0xD7, 0xF0, 0xEC, 0x53, 0xF6, 0x0B, 0x1E, 0x08, - 0x27, 0x37, 0x69, 0xC5, 0x9F, 0x6C, 0x76, 0x27, 0x4C, 0x7A, 0x7C, 0xB7, 0xC8, 0x1B, 0xC4, 0x79, - 0xA1, 0xE3, 0xE0, 0xF3, 0x3B, 0x20, 0x07, 0x0C, 0xE4, 0xAB, 0x10, 0x6F, 0xA4, 0xFA, 0x7F, 0x08, - 0x6F, 0x5C, 0xAE, 0x06, 0xC5, 0x6D, 0x09, 0x1E, 0x2D, 0xDD, 0x80, 0xA7, 0x7B, 0x9E, 0xE6, 0x44, - 0x79, 0x3D, 0x55, 0x12, 0x51, 0x87, 0x4D, 0x4A, 0x66, 0x32, 0x2D, 0x4E, 0x17, 0x30, 0xAF, 0x77, - 0x7A, 0x8B, 0x44, 0x8D, 0xA4, 0xF8, 0x70, 0xC1, 0x99, 0x55, 0x3D, 0x4B, 0x08, 0x40, 0x2F, 0xA2, - 0xEA, 0xAA, 0x94, 0x24, 0xC3, 0xBD, 0x5C, 0x68, 0x35, 0x8D, 0x71, 0xA8, 0x3E, 0xBA, 0x00, 0x70, - 0x28, 0xB8, 0x10, 0x20, 0x8F, 0x5C, 0xE4, 0xC4, 0xBB, 0x22, 0x59, 0xA2, 0x35, 0x5F, 0x7A, 0x3D, - 0xF1, 0x24, 0x70, 0x1C, 0xE3, 0x3E, 0xED, 0x26, 0x07, 0xD7, 0x82, 0x4B, 0x80, 0x3B, 0x0C, 0xE4, - 0xAB, 0xCF, 0x71, 0x97, 0x87, 0x22, 0x2B, 0x53, 0x27, 0x99, 0x29, 0x10, 0x41, 0x30, 0xE8, 0x28, - 0xD2, 0x48, 0xAC, 0x25, 0x40, 0xBF, 0xDB, 0xED, 0x3A, 0xF4, 0x5D, 0x6E, 0x66, 0x1A, 0x08, 0xFF, - 0xEE, 0x49, 0x36, 0xD7, 0x68, 0x1E, 0xD7, 0xAB, 0xEC, 0xD6, 0x84, 0x1C, 0x8D, 0x35, 0x2D, 0x10, - 0x3C, 0x9C, 0x77, 0x12, 0xB3, 0x09, 0x5F, 0x0B, 0x2A, 0xB3, 0xCF, 0x8E, 0xE0, 0xF1, 0xAA, 0x71, - 0xB1, 0xE3, 0x58, 0x5C, 0xFF, 0xD1, 0x34, 0xE0, 0xBF, 0x20, 0x6D, 0x42, 0x86, 0xCA, 0x97, 0x1B, - 0x76, 0x2F, 0x08, 0x29, 0xEC, 0xD5, 0xDD, 0x04, 0x36, 0xFC, 0xCA, 0x39, 0xBE, 0x28, 0x8C, 0x1F, - 0x0D, 0x56, 0x77, 0xB7, 0xE0, 0x23, 0x41, 0x1E, 0xB4, 0x29, 0x17, 0x7A, 0xAF, 0xF9, 0x30, 0xCF, - 0xF1, 0xFE, 0xF4, 0x62, 0x32, 0xD9, 0xDB, 0x56, 0x9A, 0x2B, 0x31, 0xBF, 0xA5, 0x15, 0x19, 0x1E, - 0xEA, 0xCB, 0x5D, 0x6B, 0x65, 0x9A, 0x06, 0x1F, 0x9C, 0x0E, 0xC0, 0x5D, 0x8C, 0xFB, 0xD5, 0xCF, - 0xA4, 0x18, 0xA1, 0x0C, 0xAD, 0xD3, 0x98, 0x09, 0x3A, 0x86, 0x7F, 0x1C, 0x60, 0xC9, 0xFB, 0x42, - 0xF2, 0x37, 0x4E, 0xF0, 0x91, 0x02, 0x33, 0x41, 0xDE, 0xDB, 0xF8, 0x8E, 0x44, 0x00, 0xC5, 0x94, - 0x21, 0x39, 0x91, 0x0A, 0xB5, 0xC4, 0x44, 0xAC, 0x04, 0xF8, 0xB7, 0xA1, 0x13, 0x70, 0xA7, 0xEF, - 0x23, 0xBD, 0xF6, 0x12, 0x34, 0x30, 0x3A, 0x70, 0x81, 0x21, 0xE7, 0x66, 0xB8, 0x55, 0x00, 0xAF, - 0xC1, 0xC3, 0x56, 0x3D, 0xAB, 0x3D, 0xCA, 0x16, 0x4F, 0x6B, 0x3E, 0x69, 0xEF, 0xF8, 0xCA, 0x7B, - 0x65, 0x1C, 0xF3, 0xD9, 0xE8, 0xB0, 0xF6, 0xF3, 0x18, 0x9E, 0xDF, 0x45, 0xC7, 0xAF, 0xCE, 0xC8, - 0x5E, 0x51, 0x94, 0x76, 0x23, 0x80, 0xF8, 0x49, 0x9B, 0xB9, 0x7C, 0x2F, 0x3C, 0xE6, 0xB5, 0x2F, - 0xAD, 0xCC, 0xE7, 0xE7, 0x1E, 0x08, 0xBF, 0xFA, 0x70, 0x2C, 0xB3, 0xED, 0x0C, 0x29, 0x7D, 0xB0, - 0xBE, 0xE7, 0x91, 0x39, 0x73, 0xC2, 0x80, 0x77, 0x2F, 0x91, 0x1D, 0x2F, 0x45, 0x1E, 0x41, 0xE4, - 0x45, 0x2A, 0x7E, 0x93, 0xCE, 0x6D, 0x65, 0x18, 0x76, 0x61, 0x15, 0x05, 0x24, 0x0E, 0x65, 0xD6, - 0x19, 0x7A, 0xFF, 0x02, 0x94, 0xFB, 0x2D, 0x14, 0xE4, 0xA3, 0x9C, 0xFC, 0x48, 0x29, 0x3A, 0x7F, - 0x36, 0x4F, 0x18, 0xD5, 0x5B, 0x99, 0x4C, 0x97, 0x20, 0x36, 0x77, 0xA6, 0x75, 0xE3, 0x44, 0x92, - 0x47, 0x72, 0xEA, 0x1D, 0x00, 0x5A, 0x1D, 0xAF, 0x12, 0xAC, 0x26, 0xE9, 0x1E, 0x4C, 0x89, 0xCC, - 0x56, 0x01, 0x22, 0x4D, 0x45, 0x44, 0xAC, 0xB6, 0x75, 0xEF, 0x3F, 0x2B, 0x35, 0xC6, 0x06, 0x12, - 0xF6, 0xDB, 0xF1, 0x55, 0xF7, 0x05, 0xB0, 0xC0, 0x16, 0x13, 0x60, 0xAA, 0x01, 0x68, 0x1A, 0xCF, - 0xA3, 0xDE, 0xC2, 0xED, 0x60, 0xB9, 0x38, 0x0A, 0x78, 0x7C, 0x5A, 0x96, 0x70, 0x3E, 0x1E, 0xDC, - 0xCD, 0x80, 0xDE, 0x5B, 0x63, 0x94, 0x01, 0x9D, 0x68, 0x02, 0xB9, 0x64, 0xBC, 0x89, 0xCA, 0xB4, - 0x12, 0xD7, 0x5E, 0x20, 0xC7, 0xBD, 0x39, 0x21, 0xAD, 0x74, 0x3A, 0x04, 0x8F, 0x5F, 0xE2, 0x55, - 0xE2, 0xA4, 0x8F, 0xE0, 0xFB, 0x9D, 0xBD, 0x67, 0xCF, 0xD8, 0x93, 0x6C, 0x84, 0xE7, 0xB6, 0xCE, - 0xBD, 0x7B, 0xDA, 0x93, 0x18, 0x70, 0x6B, 0x48, 0xBA, 0x0E, 0x66, 0x09, 0x2E, 0x91, 0x55, 0x38, - 0x84, 0x02, 0x18, 0x1D, 0x49, 0xDE, 0x25, 0xB3, 0x7E, 0xE8, 0xD0, 0x6E, 0xDD, 0x13, 0x8F, 0xA4, - 0x95, 0x17, 0x01, 0x0D, 0x93, 0xB0, 0xD8, 0xBD, 0x0C, 0xCA, 0x48, 0x62, 0xFA, 0xF5, 0xEA, 0xC5, - 0x71, 0x21, 0x00, 0xEC, 0x3A, 0x88, 0x26, 0xA1, 0x52, 0xBA, 0xBF, 0x2A, 0x70, 0xEB, 0xF7, 0x2B, - 0x43, 0xF4, 0xF6, 0xE3, 0xD0, 0x63, 0x1A, 0xA1, 0x0C, 0x00, 0xFE, 0xF9, 0x12, 0xE1, 0xED, 0x2A, - 0xFD, 0x19, 0x4E, 0x51, 0x22, 0xA0, 0x4C, 0x09, 0x2F, 0x0B, 0x8A, 0x57, 0xFA, 0x3E, 0xF3, 0x02, - 0xE3, 0xF0, 0x8F, 0x17, 0x6E, 0xC1, 0x45, 0x34, 0x95, 0x61, 0x22, 0x9E, 0x72, 0xA9, 0x50, 0x77, - 0x07, 0x64, 0xEE, 0x52, 0x03, 0x10, 0xBA, 0x09, 0xF9, 0x45, 0x29, 0x58, 0x46, 0x24, 0xE7, 0x0F, - 0x21, 0xE0, 0xC8, 0xC8, 0x69, 0xCB, 0x4C, 0xD8, 0x39, 0x0E, 0x0C, 0x24, 0x68, 0x46, 0x1E, 0xD9, - 0x7A, 0x8C, 0xB2, 0x91, 0xF4, 0x1B, 0x96, 0xDE, 0x63, 0xFF, 0xE7, 0xCB, 0x86, 0x9F, 0xCD, 0xFB, - 0xBF, 0x67, 0xBE, 0x46, 0xF7, 0x0E, 0x1F, 0x1D, 0x77, 0x4F, 0x66, 0x4F, 0x4F, 0x09, 0x4E, 0x79, - 0x33, 0x80, 0x66, 0xA5, 0xD0, 0x47, 0xAD, 0x50, 0x3D, 0x45, 0xE5, 0x15, 0xCB, 0x05, 0xA9, 0xC8, - 0xFB, 0x0F, 0x00, 0xB6, 0x9F, 0xF7, 0xC2, 0x1B, 0x15, 0x2B, 0xD1, 0x01, 0xA2, 0x5A, 0xFB, 0x26, - 0x3D, 0x9E, 0xAC, 0x37, 0x2C, 0x0B, 0x3A, 0xD3, 0xE8, 0x99, 0xAF, 0xB0, 0x12, 0x17, 0x06, 0x0C, - 0x7B, 0xF1, 0x6D, 0xB5, 0x8D, 0x18, 0xE4, 0x32, 0x3F, 0x51, 0xC2, 0x20, 0x20, 0xC6, 0x47, 0x22, - 0x08, 0x94, 0x32, 0x99, 0x17, 0x4A, 0x50, 0x36, 0x1E, 0xA2, 0x88, 0xCE, 0x01, 0xAF, 0x78, 0xF5, - 0x6B, 0xF2, 0xA2, 0x0C, 0x8E, 0xC5, 0xE4, 0x31, 0x9C, 0x28, 0xA4, 0x7F, 0x4E, 0x64, 0x1D, 0xF5, - 0xC1, 0x1A, 0x68, 0xE2, 0xF4, 0x3A, 0x99, 0xBC, 0xD3, 0x31, 0xF9, 0xD8, 0x58, 0x7B, 0xB1, 0xB7, - 0x7D, 0x57, 0x2B, 0x7D, 0xAC, 0x4A, 0x43, 0x9E, 0xB2, 0x50, 0x96, 0x06, 0x99, 0x17, 0x89, 0x6A, - 0xA7, 0x2E, 0xC2, 0xB9, 0xA2, 0xBB, 0x96, 0xD4, 0x03, 0xD5, 0xF2, 0xB4, 0xA7, 0x78, 0xE6, 0x65, - 0x31, 0xD2, 0x43, 0x75, 0x4A, 0xD1, 0xB5, 0xE6, 0x07, 0x98, 0x27, 0xAA, 0xBD, 0xCD, 0x32, 0xF1, - 0x80, 0xCE, 0x9E, 0xCD, 0xF2, 0xA1, 0x50, 0xD0, 0x88, 0x02, 0xF0, 0x1C, 0x10, 0x70, 0xAA, 0xA5, - 0xDF, 0x70, 0x32, 0x7E, 0x89, 0xAE, 0x51, 0x37, 0x84, 0x13, 0x18, 0xCE, 0x7D, 0x4C, 0x8A, 0x16, - 0x99, 0xA2, 0x42, 0x9D, 0x5D, 0x9C, 0x81, 0x86, 0x4D, 0x15, 0x96, 0xF0, 0xE6, 0xE1, 0x38, 0x11, - 0xA6, 0x8A, 0x15, 0x14, 0xF7, 0x13, 0xAD, 0x33, 0x81, 0xB5, 0xF4, 0x65, 0x87, 0x87, 0x6F, 0x97, - 0x2F, 0x5D, 0xED, 0xEC, 0xA7, 0xB6, 0x91, 0xE2, 0xF3, 0x7B, 0xE5, 0xC8, 0x7E, 0x3A, 0x26, 0x54, - 0x9C, 0xC3, 0xD3, 0x6C, 0x4B, 0x6A, 0x78, 0x48, 0xF3, 0x0E, 0xCF, 0xBF, 0x9A, 0xC8, 0x60, 0x46, - 0x0B, 0x6C, 0x92, 0x6B, 0x88, 0x6F, 0x42, 0x39, 0xB0, 0xC2, 0x43, 0x8D, 0xA6, 0x4A, 0xF8, 0xF5, - 0x1E, 0x23, 0x74, 0xF7, 0x15, 0xB2, 0x15, 0xEB, 0x5A, 0x2A, 0xCA, 0xA5, 0x2C, 0xCC, 0x3C, 0x7D, - 0x63, 0x65, 0x7F, 0x3A, 0xA8, 0x35, 0xB0, 0x77, 0x54, 0x1A, 0xCB, 0xA5, 0x07, 0x1E, 0x2C, 0x60, - 0x3C, 0x66, 0x32, 0x55, 0x75, 0xEB, 0x57, 0x35, 0xE2, 0xD3, 0xC2, 0x73, 0x5D, 0xF7, 0xC2, 0xB6, - 0xEE, 0x45, 0x1C, 0x19, 0xE6, 0xF9, 0x23, 0x24, 0x23, 0xBA, 0x77, 0x6B, 0x93, 0x73, 0xA0, 0x9C, - 0xF9, 0xF0, 0x59, 0xE7, 0xB4, 0x60, 0xC3, 0xA6, 0x01, 0xEA, 0xC7, 0x52, 0x2B, 0xDC, 0xDC, 0x96, - 0x0F, 0x3C, 0xB0, 0x19, 0x19, 0xE1, 0x52, 0xB6, 0x17, 0x91, 0x2A, 0x4D, 0xC3, 0xFC, 0x44, 0x33, - 0x5F, 0x9D, 0x36, 0x51, 0x3C, 0x02, 0x6D, 0x68, 0x23, 0x64, 0x1B, 0xA0, 0xA3, 0xD7, 0xEA, 0x64, - 0x60, 0xB9, 0xEB, 0xC5, 0x3F, 0xB5, 0x52, 0xC8, 0xC4, 0xC8, 0x73, 0x36, 0x73, 0x28, 0x67, 0xF1, - 0x2A, 0x3C, 0xA6, 0x8A, 0xDB, 0x99, 0x81, 0x90, 0xDF, 0xD7, 0x4C, 0x1F, 0xD1, 0xD9, 0x0D, 0xCE, - 0x6C, 0xD8, 0x8A, 0x03, 0xB4, 0x70, 0x3A, 0x07, 0x2E, 0x2E, 0x5E, 0xA5, 0x5C, 0xBF, 0x51, 0x36, - 0x97, 0x42, 0xA5, 0x76, 0x2A, 0xCA, 0x0A, 0x51, 0x5D, 0x06, 0x78, 0x0E, 0xCF, 0x9E, 0x93, 0x59, - 0x5C, 0x17, 0x05, 0xB6, 0xF2, 0x0D, 0x02, 0xD6, 0x2D, 0x2E, 0x20, 0x62, 0x8D, 0xF7, 0x38, 0xE0, - 0xC1, 0x5E, 0x17, 0x72, 0x4D, 0xA4, 0x2F, 0x5B, 0xDC, 0xC6, 0x40, 0x82, 0x34, 0x04, 0x39, 0x69, - 0xF8, 0xBC, 0xB1, 0x79, 0x54, 0xD5, 0x1E, 0x2D, 0xD8, 0x8C, 0x90, 0x8D, 0xB4, 0xE3, 0x61, 0xB7, - 0x1D, 0xA2, 0x3C, 0xFB, 0x6A, 0x38, 0x98, 0x06, 0xDA, 0x56, 0x2C, 0xBF, 0x9B, 0x14, 0x76, 0xE6, - 0x3C, 0x01, 0x57, 0xCC, 0xC2, 0x08, 0x0C, 0xBC, 0x10, 0x09, 0x67, 0xAB, 0x01, 0x2A, 0x32, 0x6C, - 0x81, 0x2C, 0xAB, 0xD3, 0xEC, 0x7D, 0x87, 0x48, 0x16, 0x28, 0xAC, 0x1D, 0x61, 0x11, 0x31, 0x87, - 0xD6, 0x2B, 0xB0, 0x36, 0xB1, 0x18, 0xDD, 0xE7, 0xD0, 0x46, 0x57, 0x93, 0xFC, 0xDF, 0xD2, 0x3A, - 0x37, 0x49, 0x42, 0xDB, 0xE6, 0x45, 0x46, 0x22, 0xB0, 0xF2, 0x92, 0xEE, 0x52, 0x94, 0x9F, 0xFE, - 0xB1, 0xD2, 0x33, 0x45, 0xAD, 0xC9, 0x6D, 0x11, 0x79, 0x57, 0xF1, 0x80, 0xF4, 0x07, 0xAE, 0xDF, - 0x11, 0x6C, 0x85, 0x58, 0x49, 0x2F, 0x13, 0x81, 0xB9, 0x66, 0x73, 0xAB, 0x84, 0x94, 0x36, 0xC4, - 0xC6, 0x23, 0x5F, 0xC5, 0x36, 0xC6, 0xBE, 0x8E, 0x6B, 0xE9, 0x97, 0xF0, 0xAC, 0xB4, 0xF1, 0x11, - 0x43, 0xB4, 0xD2, 0xC0, 0x79, 0x5E, 0x88, 0x72, 0xC7, 0x46, 0x6B, 0x22, 0xC7, 0xF2, 0x7B, 0x61, - 0xC8, 0xFA, 0x39, 0x65, 0x45, 0x97, 0xF0, 0xC7, 0xCE, 0x74, 0x09, 0x9F, 0x5D, 0xB7, 0x68, 0xF2, - 0x2E, 0x6E, 0x2D, 0x42, 0x56, 0x9C, 0xED, 0xC5, 0x5A, 0x57, 0xD9, 0x53, 0x5A, 0xB4, 0xE8, 0x15, - 0x07, 0x1B, 0xFB, 0x31, 0x40, 0x14, 0x95, 0x77, 0x33, 0x74, 0x71, 0x73, 0x7B, 0xFA, 0xA7, 0xBF, - 0x51, 0xF8, 0x3D, 0xE6, 0xB1, 0xD0, 0x42, 0x25, 0x52, 0xFC, 0x4F, 0x1A, 0xA6, 0x4D, 0xAF, 0xCD, - 0x13, 0x62, 0x7A, 0xBF, 0x22, 0x98, 0xD6, 0x07, 0x9C, 0xAE, 0x5E, 0xFC, 0x96, 0xEC, 0x0E, 0x79, - 0x84, 0x1F, 0x73, 0x60, 0x6C, 0x02, 0x6C, 0xE5, 0xB7, 0xFD, 0x7A, 0x4B, 0x8D, 0x0D, 0xC0, 0xD7, - 0x0A, 0x70, 0x6E, 0xE1, 0x51, 0x0E, 0x8C, 0xAA, 0x02, 0x6A, 0xCF, 0x61, 0x04, 0xBD, 0x53, 0x9D, - 0xE0, 0xB5, 0x28, 0x1E, 0x24, 0xBA, 0x97, 0x13, 0x0C, 0x6E, 0x93, 0x71, 0xE2, 0x68, 0xEC, 0x73, - 0x2C, 0xEC, 0x80, 0xB2, 0x16, 0xD5, 0x38, 0xC6, 0x3B, 0xCE, 0xEB, 0xB9, 0x42, 0xBE, 0x37, 0xB5, - 0x39, 0x31, 0x00, 0x5F, 0xB6, 0xD1, 0xB6, 0xD9, 0x57, 0x34, 0x82, 0x12, 0x07, 0x05, 0x04, 0x4B, - 0x5E, 0xB8, 0xC7, 0x6F, 0xA3, 0x01, 0xB9, 0x1D, 0xFF, 0x5F, 0x52, 0xBF, 0x6E, 0x7B, 0xA8, 0xC3, - 0x6E, 0xAC, 0x00, 0xCD, 0x0A, 0xAB, 0x7D, 0x4E, 0x63, 0x43, 0xCE, 0x10, 0x21, 0x38, 0x42, 0x88, - 0x8D, 0xA7, 0x46, 0x7F, 0x74, 0x1F, 0x1D, 0x5F, 0x25, 0xD2, 0xC0, 0x18, 0x7D, 0x40, 0x61, 0x36, - 0x06, 0xB5, 0x09, 0xCA, 0xC6, 0xAD, 0xD6, 0x9E, 0xED, 0x45, 0xF6, 0x95, 0x32, 0x07, 0x84, 0x71, - 0xC8, 0x35, 0xB0, 0x81, 0x97, 0xC9, 0x60, 0xDE, 0xFD, 0x8E, 0x90, 0x67, 0xD7, 0x23, 0x51, 0x28, - 0x90, 0xA5, 0x6E, 0xB6, 0x59, 0x88, 0xD1, 0x8D, 0xCD, 0x17, 0xA3, 0x48, 0xE3, 0x3F, 0x00, 0x4E, - 0x9B, 0x21, 0xD5, 0xA4, 0x5A, 0xF0, 0xA0, 0xBA, 0x40, 0xB7, 0xBB, 0xE1, 0x3D, 0x16, 0x9E, 0xEE, - 0xBB, 0x9E, 0xB2, 0x91, 0xBD, 0x39, 0x77, 0xD6, 0xB5, 0x9C, 0xB5, 0xE8, 0xCF, 0x7D, 0x8C, 0x83, - 0x82, 0x1A, 0xBA, 0x11, 0xDA, 0xF3, 0x96, 0xDD, 0x09, 0x20, 0x9F, 0xEB, 0xAE, 0x39, 0xAC, 0x7C, - 0xF2, 0x41, 0x98, 0x21, 0x6B, 0x8D, 0x19, 0xFF, 0x36, 0x5E, 0x82, 0xAC, 0xEE, 0x1E, 0x0E, 0x77, - 0x63, 0x14, 0x4E, 0x87, 0xE8, 0x22, 0x01, 0xD4, 0xC4, 0xF3, 0xE6, 0x49, 0xE6, 0x25, 0x64, 0x5C, - 0x54, 0x4B, 0x10, 0xE7, 0xCD, 0x17, 0x8F, 0xFA, 0xA3, 0x4D, 0xCA, 0x49, 0xCA, 0x4D, 0x33, 0xBC, - 0x29, 0x71, 0x4D, 0xF9, 0x0D, 0x74, 0x01, 0xAC, 0x79, 0xA7, 0xD7, 0x75, 0xD3, 0x9B, 0x04, 0xEE, - 0xCB, 0xCD, 0x51, 0xCC, 0xAA, 0x68, 0xFB, 0x41, 0xD3, 0x2D, 0xC1, 0xC8, 0x72, 0xDC, 0x69, 0xBE, - 0x0A, 0x74, 0xFF, 0xA8, 0x0C, 0xB4, 0xE1, 0x1A, 0xD3, 0x30, 0x21, 0xA9, 0x34, 0xCC, 0xB5, 0xE9, - 0xCF, 0x38, 0x48, 0x3B, 0xFC, 0xD6, 0x88, 0xD8, 0xB7, 0x3D, 0x71, 0xE4, 0x36, 0xA2, 0xE6, 0x03, - 0x02, 0xE3, 0xFB, 0x68, 0x0F, 0x07, 0x3B, 0x80, 0x30, 0x1C, 0xF4, 0x88, 0x0D, 0x86, 0x1F, 0x83, - 0x4D, 0x93, 0xD4, 0x10, 0xB1, 0xFF, 0x2C, 0xCB, 0xBE, 0x8E, 0xA8, 0xDB, 0x09, 0xE5, 0xF7, 0x9C, - 0x82, 0x48, 0xE0, 0xC8, 0x2C, 0x7B, 0xA1, 0x46, 0x89, 0xE9, 0x0D, 0x82, 0x6F, 0xC1, 0xEA, 0xA5, - 0x84, 0x82, 0x33, 0x26, 0x4A, 0xB6, 0x84, 0x60, 0x21, 0x00, 0x89, 0x20, 0x84, 0x14, 0x7A, 0xDF, - 0x7B, 0xEB, 0x45, 0x6B, 0x76, 0xE6, 0xDB, 0x53, 0xBE, 0x6A, 0x95, 0xE1, 0xFE, 0x6A, 0x79, 0x07, - 0xBC, 0x9D, 0xB3, 0x37, 0x67, 0xAF, 0xC2, 0x1E, 0x2B, 0xFF, 0x9F, 0xC5, 0xF5, 0x54, 0xE0, 0x29, - 0x44, 0xA4, 0x2A, 0x6F, 0xB7, 0x52, 0x17, 0x2C, 0xB1, 0x72, 0x6E, 0x9F, 0x30, 0x9D, 0x42, 0x41, - 0xF6, 0xD5, 0x14, 0x3E, 0x32, 0x59, 0x42, 0xAD, 0x7A, 0x68, 0x53, 0xF9, 0x99, 0xFD, 0x30, 0xC0, - 0x68, 0xB6, 0x97, 0xD9, 0x1B, 0x9A, 0xF6, 0xB9, 0x06, 0xE2, 0x2E, 0x27, 0x60, 0xE9, 0x1A, 0xBD, - 0x88, 0xCD, 0xAD, 0xE0, 0xCB, 0xED, 0x76, 0x2B, 0x46, 0x24, 0xB0, 0x48, 0xBA, 0x55, 0x9B, 0xBD, - 0x6D, 0xF2, 0xF7, 0x8C, 0x59, 0x4E, 0xB6, 0xE4, 0x89, 0xE1, 0xD4, 0x97, 0x85, 0x15, 0x27, 0xAE, - 0xD0, 0x9A, 0x72, 0x98, 0xB0, 0x6F, 0x06, 0xB9, 0xFC, 0xFD, 0x0D, 0x51, 0x11, 0x7E, 0x02, 0x66, - 0xD2, 0xE7, 0x25, 0xD4, 0x4D, 0xAE, 0x78, 0x9F, 0x8E, 0x69, 0xDD, 0x43, 0x80, 0x2F, 0xE6, 0x6E, - 0x46, 0xD7, 0x1A, 0x05, 0x8F, 0x4B, 0x5E, 0xF7, 0x4E, 0x09, 0x9B, 0xAF, 0x4E, 0x2B, 0x14, 0x91, - 0x59, 0x67, 0xFF, 0xFF, 0xAA, 0x08, 0xE7, 0x25, 0x42, 0x4E, 0x17, 0xD6, 0xDF, 0xD8, 0x23, 0x45, - 0xB4, 0xE2, 0x15, 0xE8, 0xDB, 0xA8, 0x55, 0x81, 0x9B, 0xE3, 0x3F, 0x09, 0x0C, 0x16, 0x19, 0xE6, - 0xE3, 0x7F, 0x1D, 0xB6, 0xBB, 0x14, 0x3C, 0x58, 0xBB, 0x69, 0x5F, 0x7A, 0x1A, 0x51, 0x45, 0xEE, - 0xDB, 0xA5, 0x7F, 0x53, 0x27, 0x04, 0xA0, 0x60, 0x76, 0x7A, 0xAD, 0x29, 0x7A, 0x8B, 0x49, 0x4C, - 0x6D, 0x26, 0x01, 0x45, 0x9B, 0x2F, 0xC8, 0x6B, 0xE0, 0x11, 0x1E, 0xCE, 0x35, 0x18, 0xDA, 0x6A, - 0x7E, 0x14, 0x56, 0xFB, 0x19, 0xE2, 0xBC, 0xAF, 0xE9, 0x62, 0xF9, 0xD4, 0xB7, 0x21, 0x1D, 0x45, - 0x10, 0xB7, 0xF3, 0x10, 0x80, 0xD0, 0xA9, 0x20, 0x12, 0xFB, 0xFA, 0xB9, 0xF6, 0x9B, 0x32, 0xA9, - 0x68, 0x58, 0xD9, 0x97, 0xDD, 0x4D, 0xDB, 0x67, 0x95, 0x35, 0xFE, 0xFA, 0x9A, 0xB2, 0x8D, 0x39, - 0x32, 0xD0, 0x5F, 0x6E, 0x74, 0x62, 0x3F, 0xC0, 0xC9, 0x24, 0x49, 0xC9, 0x65, 0x27, 0x88, 0x52, - 0x60, 0xBB, 0x6B, 0x52, 0xAC, 0x35, 0x90, 0x47, 0xF8, 0x34, 0xF4, 0x8E, 0x9E, 0x43, 0xE6, 0x28, - 0xA5, 0x04, 0xA9, 0x10, 0x09, 0x4F, 0xE0, 0x2E, 0x3E, 0x12, 0xD9, 0xC3, 0xC3, 0xF0, 0xAB, 0x30, - 0x18, 0x13, 0x6C, 0x17, 0x06, 0x2C, 0x03, 0x60, 0x04, 0x5D, 0x0E, 0xC8, 0x7F, 0x80, 0x4B, 0xAD, - 0xAF, 0x34, 0x2B, 0xDC, 0x94, 0x1F, 0x68, 0x0A, 0xAB, 0xA3, 0xD7, 0x19, 0x23, 0x02, 0x8F, 0xBD, - 0xB9, 0x33, 0xD3, 0x93, 0x66, 0xC9, 0x19, 0x18, 0xEF, 0x08, 0x0C, 0xEE, 0xDB, 0xB3, 0x5E, 0x55, - 0xB2, 0xDC, 0xBB, 0x90, 0x02, 0x2B, 0x90, 0x67, 0x41, 0x3E, 0x65, 0xA0, 0x9B, 0xC4, 0x5D, 0x81, - 0xDC, 0x64, 0x82, 0xA9, 0x86, 0xA7, 0xB1, 0x1C, 0x6C, 0x7B, 0xA2, 0x07, 0xF1, 0xE0, 0x8E, 0x4F, - 0xBF, 0x07, 0x20, 0x48, 0x05, 0xE5, 0x1D, 0xB6, 0xD8, 0x83, 0x45, 0x7C, 0xAD, 0x84, 0x32, 0x94, - 0xCA, 0x88, 0x96, 0xAA, 0x07, 0xE8, 0x7B, 0x0A, 0x89, 0x46, 0x98, 0x2F, 0x93, 0x65, 0xEB, 0x7B, - 0x79, 0x50, 0x8C, 0x8D, 0x01, 0x6D, 0xCE, 0xB4, 0x5E, 0x1E, 0x74, 0x6D, 0xC3, 0x29, 0x0B, 0x34, - 0xB6, 0xB8, 0xE7, 0x9C, 0x2D, 0x71, 0x49, 0x65, 0x07, 0x1A, 0x7D, 0x04, 0x74, 0x42, 0xD7, 0x0D, - 0x96, 0x80, 0x85, 0xFC, 0x5D, 0x29, 0x79, 0x54, 0x8F, 0x08, 0x2A, 0x7F, 0xF2, 0xB8, 0x87, 0x13, - 0x29, 0x6E, 0xC4, 0xB7, 0x99, 0xBB, 0xC5, 0x6C, 0x4D, 0x01, 0x38, 0xB5, 0xFF, 0x93, 0xEC, 0x0F, - 0x96, 0xA5, 0x47, 0x78, 0xD1, 0xC0, 0x63, 0x61, 0xE0, 0x2D, 0xE4, 0x56, 0x7C, 0xAC, 0x77, 0x30, - 0x21, 0x55, 0x32, 0xFD, 0x4E, 0xC0, 0x31, 0x9B, 0x7C, 0x37, 0x04, 0x8B, 0xAB, 0x95, 0x03, 0xAC, - 0x22, 0x9E, 0x1F, 0x86, 0x2A, 0xB5, 0xD9, 0x32, 0x56, 0xCC, 0x4E, 0xE5, 0x1A, 0x70, 0x65, 0x5B, - 0x32, 0xC7, 0x1D, 0x96, 0x73, 0x62, 0x49, 0xB3, 0xC5, 0xA1, 0x83, 0xEB, 0x32, 0x6B, 0x6E, 0x17, - 0xC2, 0xD2, 0xBA, 0x90, 0x3B, 0xB5, 0x99, 0x18, 0x34, 0x4D, 0x15, 0x57, 0x19, 0xCD, 0x3C, 0xE1, - 0xCF, 0x55, 0x4A, 0x44, 0xD0, 0xFD, 0xD1, 0x29, 0xB5, 0x86, 0xA1, 0xAA, 0xB0, 0x6C, 0x30, 0xEE, - 0x14, 0xC2, 0x9E, 0x02, 0x31, 0xDF, 0x13, 0x0D, 0xC6, 0xFA, 0x9F, 0xC1, 0x17, 0xF1, 0x52, 0x08, - 0x8B, 0xBB, 0x81, 0xB8, 0x92, 0x7B, 0x19, 0x0F, 0x5E, 0x7A, 0xDF, 0xEB, 0x86, 0x8C, 0x5F, 0x6C, - 0x7A, 0xE9, 0xF1, 0x26, 0x55, 0x80, 0xFF, 0xBC, 0x6A, 0x0A, 0xBC, 0x23, 0xAB, 0xE8, 0x8E, 0xC3, - 0xA5, 0xD7, 0xFD, 0x52, 0x73, 0x68, 0x4B, 0x56, 0x7F, 0x60, 0x4A, 0x68, 0x84, 0x30, 0xE1, 0x1F, - 0x0C, 0x10, 0x41, 0x71, 0xFC, 0x10, 0xDF, 0x62, 0xCC, 0x4D, 0xD6, 0x2A, 0x7F, 0xB9, 0xAF, 0x46, - 0x94, 0x3A, 0xD7, 0x0F, 0x12, 0x2C, 0xB8, 0x17, 0x1F, 0x56, 0xF3, 0xCD, 0xA0, 0xE7, 0xBF, 0xA4, - 0xFB, 0xC5, 0xE8, 0x17, 0x4B, 0x8A, 0xE5, 0x3E, 0x96, 0x22, 0x17, 0x07, 0xA3, 0x17, 0x0A, 0x77, - 0x98, 0xF8, 0x9B, 0x59, 0x5C, 0x2F, 0xC9, 0x73, 0xA4, 0x5A, 0x17, 0x1F, 0xBD, 0x56, 0x3E, 0xA2, - 0xE6, 0x8F, 0x34, 0xF2, 0xE0, 0x20, 0x37, 0xE4, 0x98, 0xE1, 0xEC, 0xC4, 0x1E, 0x81, 0x13, 0x17, - 0x21, 0x95, 0x88, 0x60, 0x04, 0xDA, 0x91, 0xB9, 0x22, 0xF8, 0x64, 0x87, 0x8D, 0x32, 0x60, 0x37, - 0x33, 0x2E, 0x2B, 0x95, 0x43, 0x0C, 0x10, 0xDF, 0xFC, 0x64, 0x56, 0x89, 0x32, 0x47, 0xA3, 0x8F, - 0xF1, 0x3E, 0x34, 0x63, 0x35, 0xD9, 0x41, 0xD8, 0x1A, 0x23, 0x88, 0x39, 0x6D, 0x23, 0x2A, 0x20, - 0xCE, 0xFB, 0x80, 0x0F, 0x59, 0xB7, 0xFB, 0x1E, 0x24, 0xF5, 0x8A, 0x78, 0x2B, 0xE8, 0x13, 0x52, - 0x34, 0x5B, 0x65, 0x64, 0xAB, 0x78, 0x4D, 0x5C, 0x79, 0x3B, 0xF2, 0x7D, 0x1F, 0x5B, 0xA9, 0x37, - 0xAE, 0x4C, 0x9E, 0x30, 0x6B, 0x39, 0x3D, 0x75, 0x06, 0xCE, 0xFE, 0x87, 0xB7, 0x1B, 0x9C, 0x9F, - 0x44, 0x7E, 0x98, 0xFF, 0x3B, 0xA6, 0x71, 0x48, 0xE3, 0x07, 0x8C, 0x5E, 0x95, 0x96, 0x04, 0xC1, - 0xBF, 0x7A, 0x18, 0x06, 0xC2, 0xD2, 0x24, 0xD6, 0xC9, 0x4D, 0x65, 0xCE, 0x18, 0x8F, 0x8B, 0x0D, - 0xFC, 0x66, 0x40, 0xB1, 0xE6, 0xE5, 0xC5, 0xDE, 0xAE, 0x2E, 0x84, 0x3F, 0xBA, 0x16, 0x5A, 0x63, - 0x72, 0x0F, 0x3C, 0x82, 0x4A, 0xD7, 0x54, 0x54, 0x60, 0x1B, 0x6A, 0x16, 0x2D, 0xDA, 0x0F, 0xF9, - 0x61, 0xD2, 0x53, 0x2B, 0xE4, 0x22, 0x0E, 0x1D, 0x08, 0x69, 0x5D, 0x4D, 0x4D, 0x3E, 0x99, 0xBE, - 0x8A, 0x83, 0xA2, 0x5A, 0x68, 0x8B, 0xBB, 0x6A, 0xA5, 0x31, 0xB9, 0x65, 0xA6, 0x55, 0xD1, 0x09, - 0x8D, 0x6B, 0xAB, 0xD8, 0xF1, 0x06, 0x62, 0xA8, 0x1A, 0xDA, 0xA4, 0x4B, 0x68, 0xA9, 0xB8, 0xA5, - 0x9D, 0xD1, 0xAA, 0x42, 0x8E, 0x67, 0xA8, 0xC6, 0x29, 0x94, 0x69, 0x38, 0xA0, 0x66, 0x84, 0xBB, - 0x73, 0x3B, 0xFC, 0x7D, 0x6B, 0xCD, 0x39, 0x8F, 0x1C, 0x6C, 0xE0, 0x58, 0x97, 0x75, 0xB7, 0x09, - 0x40, 0x68, 0x45, 0xCD, 0x97, 0x78, 0x1A, 0x81, 0xA9, 0x6D, 0x6C, 0x59, 0xB8, 0x0C, 0x7D, 0x94, - 0x46, 0x23, 0xCC, 0xD4, 0x2D, 0x71, 0x95, 0x7F, 0x9F, 0x08, 0xE0, 0xE5, 0xF9, 0xC0, 0x2C, 0xC4, - 0x09, 0x27, 0x7C, 0x62, 0x5E, 0xF4, 0xB6, 0xAA, 0x9D, 0x18, 0x10, 0xCE, 0xCB, 0xCA, 0xFC, 0xC2, - 0x12, 0x5A, 0xC2, 0xC7, 0xFA, 0x47, 0x3B, 0x4A, 0x5C, 0xC7, 0x52, 0xCA, 0x97, 0xD4, 0xC3, 0x90, - 0x1D, 0x04, 0x50, 0x92, 0xFF, 0xCC, 0xA9, 0x85, 0x4D, 0x1F, 0x73, 0xE3, 0x5B, 0x4D, 0x20, 0xCA, - 0x46, 0x89, 0xD5, 0x26, 0x2B, 0xF5, 0x6B, 0x2A, 0x0B, 0x9C, 0x36, 0x15, 0x9A, 0xB2, 0x15, 0xC1, - 0xAF, 0x38, 0x3D, 0xA5, 0x4B, 0x47, 0x56, 0x32, 0x90, 0x60, 0x93, 0x5D, 0x8C, 0xE4, 0x3D, 0x3A, - 0x00, 0xB2, 0x84, 0x92, 0xE7, 0x9C, 0x09, 0xD4, 0x55, 0x01, 0xFC, 0xFC, 0x3C, 0x0B, 0x6B, 0x0B, - 0xD4, 0x39, 0x7B, 0x88, 0x40, 0x08, 0xDE, 0x2D, 0xFC, 0x9E, 0xEF, 0xFE, 0xCA, 0x45, 0xB6, 0x8F, - 0xDD, 0x59, 0x49, 0x16, 0x9B, 0x26, 0x88, 0x7F, 0x83, 0xA0, 0x29, 0x14, 0xA6, 0x96, 0x51, 0x1D, - 0x36, 0xCF, 0x7D, 0x01, 0x2E, 0xC3, 0xC5, 0xC2, 0x49, 0xAB, 0x70, 0xAC, 0x66, 0x08, 0xA4, 0xB7, - 0xB5, 0x37, 0x34, 0xEB, 0xD1, 0xA1, 0x52, 0xB1, 0xF8, 0x1C, 0x88, 0x36, 0x32, 0x00, 0xA4, 0x5B, - 0x3B, 0x93, 0x34, 0x20, 0x5F, 0xA9, 0x9B, 0x1E, 0xA6, 0xF9, 0xFC, 0xC5, 0x34, 0x2E, 0x64, 0xCE, - 0x97, 0x44, 0x71, 0x0D, 0x09, 0x89, 0xF2, 0x68, 0x41, 0xF9, 0x64, 0xA0, 0xFC, 0xE2, 0x43, 0x14, - 0x77, 0xB1, 0x68, 0x2C, 0xE6, 0xCB, 0xD4, 0x82, 0xE0, 0xF1, 0x93, 0x00, 0x50, 0x9F, 0x14, 0x6F, - 0x78, 0xDC, 0x7B, 0xC2, 0xD6, 0x31, 0x29, 0x85, 0xA6, 0xEB, 0x50, 0xEC, 0xA6, 0xDD, 0xAA, 0x50, - 0x65, 0x94, 0xEE, 0x68, 0xC3, 0x11, 0xAA, 0xB7, 0xA7, 0xEE, 0xBB, 0x39, 0x08, 0xA6, 0xE8, 0xC5, - 0x4E, 0x52, 0x84, 0xDD, 0xE6, 0x16, 0xF5, 0xC3, 0xAC, 0xB0, 0xBE, 0x3F, 0xA0, 0xC9, 0x1F, 0x17, - 0xC0, 0x8D, 0x7C, 0x80, 0x27, 0xAE, 0xBB, 0x47, 0x32, 0x94, 0x01, 0xCB, 0x72, 0x12, 0xCB, 0x74, - 0x56, 0x58, 0x17, 0x30, 0x57, 0x6C, 0x94, 0x08, 0xD4, 0x60, 0x50, 0x41, 0x35, 0xAB, 0xBD, 0x0B, - 0xA7, 0x43, 0x1B, 0x53, 0x19, 0xBA, 0x05, 0x67, 0xAF, 0x4C, 0xAD, 0x76, 0xBA, 0x7D, 0x75, 0x8E, - 0x64, 0x0C, 0xDD, 0xFB, 0xD9, 0x84, 0x3F, 0xB0, 0x57, 0x4D, 0x8C, 0xA0, 0x0F, 0xD9, 0xE0, 0x53, - 0xB9, 0x1D, 0xAE, 0xE1, 0xCC, 0x9E, 0xD5, 0x79, 0xDA, 0xB4, 0x0C, 0x0B, 0xDD, 0x95, 0x28, 0xDD, - 0x7F, 0x73, 0x43, 0x83, 0xC5, 0x45, 0x14, 0x00, 0xBA, 0x00, 0x9C, 0xC0, 0xC8, 0x62, 0x34, 0x66, - 0xF9, 0x78, 0x57, 0x0B, 0x9F, 0x85, 0xEE, 0x49, 0xF6, 0xA9, 0x86, 0x05, 0x6B, 0x0E, 0x1F, 0x26, - 0xD0, 0xD9, 0xEB, 0xA8, 0x5B, 0x9B, 0xCD, 0x4E, 0x25, 0x07, 0xE1, 0xE0, 0x60, 0xA0, 0xFB, 0x17, - 0x7C, 0x41, 0xAA, 0x20, 0xFE, 0x83, 0x25, 0x3A, 0x9A, 0x02, 0x87, 0x0A, 0x71, 0x87, 0xE5, 0xD3, - 0xC1, 0xDC, 0x85, 0xC8, 0xFA, 0x71, 0x2A, 0xCF, 0xA1, 0xF7, 0x44, 0x13, 0x9C, 0x03, 0x56, 0xC3, - 0x7A, 0xEE, 0x51, 0x35, 0x3C, 0x27, 0x30, 0xF3, 0x3E, 0x31, 0x5F, 0x00, 0x51, 0xA7, 0x1C, 0x92, - 0xA4, 0xE1, 0xC3, 0x43, 0x12, 0x03, 0x3C, 0xEE, 0xD3, 0xFA, 0x1C, 0x6A, 0x0F, 0xE0, 0x45, 0xBB, - 0x3B, 0x81, 0xF1, 0x37, 0x46, 0x9C, 0x6E, 0x21, 0x74, 0xFA, 0x93, 0x52, 0xF4, 0x57, 0x95, 0x81, - 0xD3, 0x57, 0x44, 0x5E, 0xF0, 0x54, 0x18, 0x3C, 0xFB, 0x3A, 0xE7, 0x10, 0x67, 0xF2, 0x20, 0x24, - 0x09, 0xD2, 0x6D, 0xAB, 0xC2, 0xBA, 0x3C, 0x30, 0xE9, 0x65, 0xF1, 0x50, 0xFB, 0x11, 0xB6, 0xCF, - 0x85, 0x7B, 0x6A, 0x4A, 0x56, 0x59, 0x59, 0xB7, 0xDE, 0xFB, 0xC8, 0x39, 0x6A, 0x52, 0x6D, 0xE6, - 0xB7, 0xC7, 0x7A, 0x62, 0x01, 0x25, 0x3D, 0x54, 0x54, 0xB4, 0xF2, 0xBA, 0xF9, 0xEE, 0xE3, 0x59, - 0xD0, 0x74, 0xB5, 0xBF, 0xDF, 0x3E, 0x3F, 0x87, 0x64, 0x82, 0xD9, 0xD5, 0xF9, 0xE8, 0xBB, 0xC5, - 0xA5, 0x61, 0x91, 0x9C, 0x2C, 0x99, 0xC0, 0x39, 0xB3, 0xEF, 0x33, 0x5E, 0x3E, 0x1E, 0x00, 0xC6, - 0x5A, 0x90, 0x1C, 0x50, 0x43, 0x3D, 0x4B, 0xA1, 0x3F, 0x46, 0xEB, 0xBA, 0x86, 0xA4, 0xEA, 0xE1, - 0xA9, 0x40, 0x97, 0x5A, 0x80, 0x97, 0x36, 0x1C, 0xA8, 0x19, 0x4E, 0x0D, 0xF8, 0xCB, 0x1C, 0xC7, - 0xD4, 0x1C, 0xB1, 0x4C, 0x2E, 0xDB, 0x2D, 0x96, 0x1E, 0xBA, 0xEB, 0x3D, 0xDE, 0x7D, 0xC7, 0x2E, - 0xF8, 0x36, 0x54, 0x5C, 0x94, 0xD0, 0x5A, 0x0E, 0x5D, 0xF6, 0x4D, 0x35, 0xD2, 0xC1, 0x52, 0xC7, - 0x3B, 0x58, 0x43, 0xEB, 0xB6, 0x54, 0xBA, 0xA5, 0xF1, 0x86, 0xDB, 0x23, 0xAB, 0x6A, 0x42, 0x00, - 0x90, 0xD2, 0x0C, 0x76, 0x32, 0xA0, 0xC2, 0xE3, 0x10, 0x0E, 0x0C, 0x8A, 0x7C, 0xA5, 0x5F, 0xC9, - 0x4E, 0x79, 0x6E, 0x38, 0x0D, 0xA1, 0xD8, 0x7E, 0x90, 0xDD, 0xA4, 0x35, 0x33, 0xBF, 0xCE, 0x69, - 0x8F, 0x93, 0xBC, 0xB4, 0xC8, 0xD2, 0xD1, 0xD8, 0x2F, 0x31, 0xF8, 0x0B, 0x12, 0x8B, 0xA2, 0xAA, - 0x7B, 0x36, 0x5F, 0x66, 0x0D, 0xF6, 0x34, 0x0F, 0xA7, 0x6A, 0xF3, 0x52, 0x4A, 0xB3, 0xCE, 0x83, - 0xB5, 0x57, 0x11, 0x74, 0xBF, 0x1D, 0x5E, 0xA4, 0x18, 0x84, 0xC6, 0xE4, 0xAC, 0x42, 0x93, 0x82, - 0x99, 0xF1, 0x4B, 0xE2, 0x07, 0x0E, 0x0C, 0xAD, 0xC4, 0x7E, 0x24, 0xC7, 0xF9, 0x22, 0x34, 0x31, - 0x0B, 0xC9, 0xBF, 0xA8, 0x74, 0xE9, 0xDE, 0xE8, 0x61, 0xDC, 0xC2, 0x49, 0x95, 0x78, 0x6F, 0x2D, - 0x46, 0x76, 0xD8, 0x2F, 0xA9, 0x56, 0x00, 0x38, 0x74, 0x54, 0xBB, 0x66, 0xE5, 0x9B, 0xA1, 0xAB, - 0xE4, 0x1E, 0x46, 0x71, 0x90, 0xC1, 0xF8, 0x16, 0x8A, 0x8F, 0x76, 0xE6, 0x4F, 0x06, 0xE8, 0xE8, - 0xAA, 0x25, 0xF2, 0x75, 0x3A, 0x0D, 0xBD, 0xF6, 0x40, 0xEE, 0x64, 0xE0, 0xF4, 0xD5, 0xBB, 0x76, - 0x7A, 0x8B, 0x43, 0xD8, 0x75, 0xD3, 0xAF, 0x1A, 0xE7, 0x59, 0x5E, 0x8E, 0xC8, 0xE4, 0xD9, 0x7C, - 0x3E, 0x02, 0x4D, 0xBE, 0x00, 0xD9, 0x6F, 0x46, 0xF1, 0x4A, 0x5B, 0x33, 0x97, 0x6E, 0x54, 0x5A, - 0x3A, 0x41, 0x6F, 0xC0, 0xB7, 0x3E, 0x78, 0xE5, 0xCF, 0x75, 0x1C, 0xEE, 0xD8, 0xA1, 0xEE, 0xD0, - 0x37, 0x94, 0xFE, 0x63, 0x1B, 0x2F, 0x63, 0x7A, 0xFE, 0x22, 0xCD, 0x32, 0xE1, 0xB6, 0xF8, 0x21, - 0x33, 0xDA, 0xCE, 0xB4, 0x91, 0x25, 0x21, 0x67, 0xA2, 0x6D, 0x5D, 0x49, 0xBD, 0x77, 0x92, 0x60, - 0xA3, 0x56, 0xBF, 0x1E, 0x1B, 0xF8, 0xE9, 0x40, 0xC5, 0xBF, 0x06, 0xFC, 0x14, 0xBC, 0xBC, 0x62, - 0xC0, 0xCB, 0x8D, 0x67, 0x7E, 0xDD, 0xB9, 0xCE, 0x66, 0xE2, 0x52, 0xC1, 0x21, 0x68, 0x93, 0xB4, - 0x6F, 0xFC, 0x81, 0x1F, 0x41, 0xD7, 0x7F, 0x10, 0xCF, 0x35, 0x9B, 0x72, 0xC6, 0xBC, 0x05, 0x5D, - 0x7D, 0x63, 0x09, 0xB4, 0xA8, 0x62, 0xAA, 0x42, 0x51, 0xC1, 0xC0, 0xF0, 0x2D, 0xE2, 0xBE, 0x6D, - 0x54, 0x53, 0x55, 0x7B, 0x39, 0x0A, 0xB0, 0x2A, 0xE0, 0x45, 0x0A, 0xEF, 0xD7, 0x7E, 0xB9, 0xAF, - 0xB9, 0xDA, 0x22, 0x5D, 0x65, 0xD5, 0x39, 0x0F, 0xE4, 0x2B, 0x8E, 0xAA, 0x79, 0xC9, 0xFB, 0xF0, - 0x00, 0x51, 0xE6, 0x59, 0x3F, 0x12, 0x54, 0x4A, 0x29, 0x23, 0xD3, 0x6A, 0x9F, 0xB9, 0x0D, 0x99, - 0x1E, 0x8A, 0xF6, 0x55, 0xD3, 0xDC, 0x8A, 0x48, 0xC3, 0xE5, 0x16, 0xDA, 0xFF, 0xB0, 0x3B, 0x92, - 0x49, 0xD6, 0x00, 0xB1, 0x13, 0x8E, 0xC2, 0x3F, 0x7C, 0xF9, 0x48, 0x55, 0xD5, 0xAC, 0xEA, 0x8A, - 0xC1, 0x5C, 0xA9, 0x48, 0xEA, 0x71, 0xDA, 0x99, 0xE9, 0x49, 0xBA, 0xD8, 0x1F, 0xF2, 0xB2, 0x51, - 0x5D, 0x13, 0xC7, 0x6A, 0x82, 0x8E, 0x64, 0x3A, 0x11, 0x56, 0x66, 0x24, 0x2D, 0xC1, 0x7D, 0x3A, - 0xB2, 0x45, 0xB6, 0xAE, 0x10, 0x8F, 0xBD, 0xD6, 0x9F, 0xAB, 0x44, 0xA7, 0x4A, 0x5D, 0x92, 0x7D, - 0x8F, 0xE5, 0x59, 0x4A, 0x10, 0x85, 0xFD, 0x3C, 0x40, 0x3B, 0xBF, 0xDF, 0xA7, 0x3A, 0x1D, 0xB5, - 0x67, 0x23, 0xF9, 0xAC, 0x59, 0x31, 0x2F, 0xD9, 0xD6, 0xF5, 0xEA, 0xD1, 0xDE, 0xAE, 0xFA, 0x44, - 0xFD, 0xE0, 0xBE, 0xE3, 0xF7, 0xEA, 0xD5, 0xF0, 0x26, 0x41, 0xE5, 0x3D, 0xBE, 0xAA, 0xFC, 0x57, - 0x49, 0xAE, 0x3E, 0x70, 0x8F, 0x9D, 0xF1, 0xB6, 0x32, 0x7D, 0xE7, 0x21, 0x4A, 0x7E, 0x99, 0xD7, - 0x90, 0xFE, 0xC5, 0xB2, 0xE8, 0xAC, 0x6D, 0xF7, 0x3C, 0xD3, 0x1E, 0x61, 0xF4, 0xFF, 0x8C, 0x13, - 0x5A, 0x7F, 0x87, 0x66, 0x47, 0x84, 0xF8, 0x3B, 0x0B, 0x70, 0xCF, 0xBA, 0x0C, 0x87, 0x93, 0x62, - 0x65, 0x1E, 0x47, 0xFC, 0x96, 0x25, 0x46, 0x01, 0xE0, 0xCE, 0xE2, 0x41, 0xC6, 0x38, 0x90, 0x0D, - 0xE3, 0xC7, 0x60, 0x4E, 0x08, 0x0F, 0x02, 0xF5, 0xB8, 0x70, 0x27, 0x89, 0x29, 0x6E, 0x79, 0x85, - 0x12, 0xA4, 0xCA, 0x6C, 0x69, 0xBE, 0x52, 0xFF, 0xBD, 0xCF, 0x3E, 0x07, 0xA8, 0x7B, 0x00, 0x44, - 0xE0, 0x3B, 0xA6, 0x50, 0xFF, 0xF9, 0xDA, 0x0D, 0xEB, 0xCC, 0x70, 0x21, 0x20, 0x5F, 0xF4, 0xAF, - 0x1B, 0x2C, 0xF8, 0x63, 0x9C, 0xB9, 0x8F, 0x0B, 0xBF, 0x1C, 0xA5, 0x85, 0xA6, 0x9A, 0x0A, 0x93, - 0x1E, 0x8B, 0xA3, 0x80, 0x63, 0x30, 0x24, 0xE1, 0xF0, 0xB6, 0x7B, 0x93, 0xC5, 0x72, 0xE9, 0x49, - 0x91, 0x1D, 0xB0, 0x77, 0xC0, 0xA2, 0x1D, 0xC9, 0x66, 0x90, 0xF7, 0x58, 0x92, 0x87, 0x4F, 0xB0, - 0x0D, 0x0A, 0x48, 0x16, 0x5F, 0x7D, 0xF4, 0xA6, 0xC9, 0x80, 0xD2, 0x38, 0xD6, 0xC7, 0xEE, 0x73, - 0xA6, 0xA8, 0x57, 0xC9, 0xAA, 0x32, 0x6A, 0x3C, 0xA7, 0x9F, 0x89, 0x79, 0x8B, 0xD9, 0x6B, 0x8C, - 0xB1, 0x26, 0x5D, 0x4B, 0xE9, 0xF0, 0x9D, 0xFA, 0xC0, 0xD3, 0xEA, 0x82, 0xDA, 0x7C, 0xCB, 0x43, - 0x90, 0x74, 0x24, 0xC6, 0xBD, 0x5B, 0x87, 0x29, 0xCA, 0xEC, 0x6E, 0xBA, 0x7C, 0x41, 0xF9, 0x99, - 0x0A, 0x92, 0xFA, 0x43, 0xAE, 0xE7, 0xF9, 0xFB, 0x55, 0x5B, 0x3A, 0xCC, 0x1C, 0xC5, 0x20, 0x37, - 0x53, 0x4A, 0x83, 0xC6, 0x79, 0x5A, 0x42, 0xF9, 0x23, 0x62, 0xA1, 0x3A, 0x42, 0xCE, 0x51, 0xC5, - 0x5D, 0xC9, 0x99, 0x1F, 0x82, 0xE7, 0x43, 0x72, 0x46, 0x70, 0x80, 0x25, 0x65, 0x98, 0x78, 0xC2, - 0xF9, 0xD4, 0x07, 0x2D, 0xAB, 0x79, 0x7D, 0x45, 0xC3, 0x0B, 0xEE, 0x18, 0xBB, 0x3C, 0x33, 0xE5, - 0x8B, 0xE5, 0x2A, 0x04, 0x53, 0x7C, 0x92, 0x92, 0x3E, 0x77, 0xE6, 0xB5, 0x8A, 0x7C, 0xAC, 0x3F, - 0xEA, 0xFC, 0x19, 0x64, 0xFD, 0xB4, 0xA3, 0x33, 0xCC, 0xBB, 0xE3, 0x5F, 0xBA, 0xAB, 0x9F, 0x2A, - 0x4E, 0x71, 0x96, 0x4D, 0x8D, 0x33, 0x39, 0x02, 0x0F, 0x6B, 0xFB, 0xC7, 0x76, 0x0D, 0xC4, 0x9D, - 0xB0, 0x6C, 0xA3, 0x91, 0x32, 0x23, 0x60, 0xF9, 0x53, 0x3C, 0x48, 0xCF, 0x54, 0x4A, 0x34, 0x6A, - 0x90, 0xB8, 0xDB, 0xB6, 0xFD, 0xD8, 0xB9, 0x79, 0xF1, 0x5D, 0x64, 0xFC, 0x2C, 0x6E, 0xA2, 0xD2, - 0x4D, 0x37, 0x56, 0xCB, 0x8D, 0xE9, 0xC9, 0x02, 0x3A, 0x7F, 0x53, 0x75, 0x98, 0x46, 0xF9, 0x8E, - 0xE2, 0x00, 0x05, 0x20, 0x8E, 0xAD, 0xAA, 0x38, 0x5F, 0x6A, 0x34, 0x16, 0x2E, 0x25, 0xFF, 0x7F, - 0xE2, 0x10, 0x2D, 0x49, 0x2C, 0xEF, 0xB5, 0xE5, 0x8A, 0x2A, 0x1F, 0x6F, 0x6C, 0x49, 0xF7, 0x78, - 0x80, 0xCA, 0xFA, 0x14, 0x5D, 0xAE, 0xA9, 0xCD, 0xC5, 0xB8, 0xA8, 0xDC, 0xFF, 0x84, 0xC5, 0x80, - 0x8E, 0x98, 0x5F, 0x7E, 0xF6, 0x26, 0xBB, 0x35, 0xF7, 0xA7, 0x40, 0x46, 0x83, 0x26, 0xDF, 0x3B, - 0x64, 0xE0, 0x67, 0x7A, 0xBE, 0x08, 0xF4, 0xE6, 0x1A, 0xF8, 0xFD, 0xBA, 0x0E, 0xBE, 0xB2, 0x28, - 0x6C, 0x45, 0xEA, 0xB1, 0x6C, 0xA8, 0x8E, 0x4F, 0xB8, 0xBC, 0x82, 0x0A, 0xD1, 0x84, 0xAB, 0x03, - 0x6C, 0x30, 0x85, 0xA1, 0x2C, 0x72, 0xA3, 0x08, 0x25, 0x4C, 0x97, 0x32, 0xEB, 0xAD, 0x0E, 0x3E, - 0xE8, 0x8E, 0x2B, 0xF0, 0xCF, 0x13, 0xCA, 0xD1, 0x53, 0xC6, 0xCD, 0x58, 0x98, 0xDE, 0xB0, 0x7E, - 0x0D, 0xBF, 0x94, 0x3E, 0xA7, 0x1C, 0x84, 0xBC, 0xB3, 0x9B, 0x6D, 0x54, 0x32, 0x39, 0x89, 0xF8, - 0x02, 0xAF, 0xBC, 0xB2, 0x53, 0x3B, 0x43, 0xF2, 0xCC, 0xC9, 0x05, 0xF2, 0xC4, 0x88, 0x37, 0x6E, - 0xE1, 0xA1, 0x55, 0x82, 0x7E, 0xBE, 0x83, 0xE0, 0x0B, 0xF8, 0x96, 0x45, 0x61, 0xC1, 0x96, 0x28, - 0x6D, 0x64, 0xCF, 0xF9, 0xC1, 0xC7, 0x3A, 0x18, 0xF3, 0x9A, 0x69, 0x2B, 0x07, 0x57, 0x55, 0xE8, - 0x09, 0xCB, 0x33, 0xC5, 0x4F, 0xBF, 0x0F, 0x9A, 0x22, 0xB1, 0xB3, 0x50, 0x15, 0xA3, 0xCB, 0x8D, - 0x6E, 0x29, 0x56, 0x89, 0x64, 0xAF, 0x5B, 0x0D, 0xD4, 0xE2, 0x6F, 0x6A, 0x38, 0xBD, 0xD8, 0xA1, - 0x7D, 0x0A, 0x6F, 0x7B, 0x07, 0x89, 0x5B, 0xD2, 0xFB, 0x34, 0x5F, 0xA9, 0x0F, 0x41, 0x18, 0xD3, - 0x99, 0xFD, 0xA8, 0x88, 0xFD, 0x4B, 0x9B, 0xCA, 0xAE, 0x5A, 0xB0, 0xEE, 0x23, 0x0F, 0x4B, 0x5C, - 0x99, 0xEA, 0x29, 0xF3, 0xF6, 0x97, 0x5F, 0xF9, 0xAF, 0x28, 0x4F, 0xEC, 0xD6, 0x01, 0x69, 0x8B, - 0x65, 0x08, 0x55, 0xCA, 0x05, 0xC0, 0xB4, 0xB2, 0x64, 0x2A, 0xF5, 0x3E, 0xDA, 0xA2, 0xD2, 0xBB, - 0xDF, 0x17, 0xFF, 0xCF, 0x9E, 0xDE, 0x8A, 0x1E, 0x5F, 0xFD, 0xEA, 0x12, 0x0F, 0xFF, 0x96, 0x20, - 0x0A, 0x15, 0xE6, 0x9B, 0x4F, 0x12, 0x0B, 0xCC, 0x39, 0x4D, 0xFD, 0xD4, 0x7A, 0xDA, 0x24, 0x11, - 0x2D, 0x93, 0x92, 0x9F, 0x3E, 0x3F, 0xA2, 0x9B, 0xAD, 0x98, 0x13, 0xE2, 0x5F, 0xF2, 0x7E, 0x84, - 0xA1, 0x43, 0xAB, 0x76, 0xB8, 0xFC, 0xA0, 0x01, 0x17, 0x38, 0xB3, 0x33, 0x13, 0x4A, 0xF5, 0x15, - 0xA5, 0x56, 0x66, 0xC5, 0x44, 0x0C, 0x88, 0x75, 0x76, 0xA5, 0x7E, 0x57, 0xD4, 0x22, 0xE5, 0x32, - 0x99, 0x60, 0x99, 0x7C, 0x65, 0x29, 0xBA, 0xB0, 0x5B, 0x1F, 0x84, 0x98, 0x0C, 0x06, 0x8A, 0xAE, - 0x96, 0x63, 0x91, 0xB1, 0x75, 0xE6, 0xE6, 0x7A, 0xBF, 0x1E, 0xB5, 0xB6, 0x76, 0x1B, 0xE2, 0xBF, - 0xB4, 0x1F, 0x4D, 0x33, 0xF9, 0x9D, 0x9C, 0x79, 0xE6, 0xF5, 0xA3, 0x8C, 0x72, 0xFE, 0xAE, 0xB1, - 0x13, 0x09, 0x20, 0x91, 0x7C, 0x11, 0x99, 0x68, 0x1A, 0xA7, 0x6B, 0x3F, 0x88, 0xC7, 0xF5, 0x94, - 0x0D, 0xBC, 0x3B, 0xA5, 0x14, 0xD7, 0x8B, 0xA0, 0xA0, 0x70, 0xB4, 0xC2, 0x4E, 0x2F, 0xA8, 0xB1, - 0x0D, 0x7B, 0x8C, 0xD4, 0x96, 0xC1, 0xD1, 0xC5, 0x13, 0x67, 0x24, 0x16, 0x3C, 0xC0, 0xFD, 0x79, - 0x3C, 0x11, 0x69, 0x03, 0xF6, 0x55, 0xF7, 0xF2, 0x09, 0x8B, 0x49, 0x5B, 0xDA, 0x05, 0x3C, 0xDB, - 0x1C, 0x01, 0x1F, 0xDC, 0x4D, 0xE2, 0x09, 0xB6, 0x1F, 0x5F, 0xE2, 0xB0, 0xDF, 0x77, 0xF8, 0x83, - 0x59, 0xCF, 0xEE, 0x8B, 0x14, 0x12, 0xEB, 0xBC, 0x9B, 0xB4, 0x38, 0xFD, 0x38, 0x53, 0xC9, 0xA1, - 0x4E, 0xF6, 0x80, 0xA8, 0xE5, 0x25, 0x89, 0x97, 0xCF, 0x94, 0x06, 0xE4, 0x25, 0xDF, 0x86, 0x46, - 0xA2, 0x54, 0xA7, 0x04, 0xB5, 0xCA, 0x67, 0xF1, 0x95, 0x65, 0x57, 0xE1, 0x38, 0x61, 0xCB, 0x20, - 0xE5, 0x98, 0xF4, 0x07, 0x95, 0x25, 0xBD, 0xBE, 0x9F, 0x87, 0x76, 0x4D, 0x52, 0x96, 0xAE, 0x82, - 0xAE, 0x2C, 0x3C, 0xB6, 0x7C, 0x1A, 0x36, 0xE5, 0x34, 0x13, 0x1B, 0x72, 0x52, 0x8F, 0xFF, 0xE7, - 0x6B, 0x83, 0xDB, 0x88, 0x4A, 0xDB, 0x95, 0x37, 0xFA, 0x9D, 0xA2, 0x49, 0xDB, 0x5A, 0xE3, 0x5C, - 0x95, 0xC7, 0xF8, 0xE0, 0x14, 0x38, 0xB2, 0xCD, 0x09, 0xF4, 0x2A, 0x2A, 0xF7, 0x1A, 0xA1, 0x8E, - 0xB8, 0xBC, 0x3B, 0x51, 0x9A, 0xE4, 0xD1, 0xCF, 0xA7, 0xD1, 0xF9, 0x63, 0x0F, 0x98, 0x3D, 0x61, - 0x51, 0xEC, 0x1B, 0x67, 0x68, 0x88, 0x25, 0x65, 0x0B, 0xA6, 0x32, 0xA2, 0xCD, 0x93, 0xE1, 0x16, - 0x01, 0x12, 0xB2, 0xDA, 0x35, 0xBA, 0x52, 0x66, 0x46, 0x44, 0x8D, 0xB3, 0x19, 0x33, 0xC1, 0x1F, - 0x47, 0x6C, 0x48, 0x7B, 0x5C, 0x8C, 0xA8, 0x68, 0x74, 0xDE, 0x7C, 0xB4, 0xDF, 0x05, 0x54, 0x35, - 0x8A, 0xFE, 0x78, 0xB5, 0x05, 0x78, 0xC3, 0xB4, 0x85, 0x12, 0x88, 0xBB, 0x49, 0x17, 0x46, 0x5D, - 0x7D, 0x1F, 0xF4, 0xB5, 0xD9, 0xEF, 0x62, 0xBA, 0xC4, 0x86, 0x61, 0x0B, 0xE0, 0xC5, 0xEE, 0x69, - 0xEC, 0xF9, 0x52, 0x93, 0x3F, 0xC7, 0x69, 0xE4, 0xD2, 0x9C, 0xE0, 0xEB, 0xB5, 0x5A, 0x55, 0xCE, - 0x87, 0xA3, 0x1C, 0x52, 0x2E, 0xC5, 0x99, 0x92, 0x7F, 0x10, 0x06, 0xC4, 0xA2, 0x5B, 0x77, 0x3D, - 0x53, 0xE8, 0xCA, 0xB5, 0x3B, 0x18, 0x58, 0x54, 0xC6, 0x63, 0xDB, 0x1D, 0xB6, 0x75, 0xD2, 0x69, - 0x64, 0x8A, 0x69, 0x0E, 0xF9, 0x57, 0x41, 0x4C, 0xC2, 0xF3, 0x59, 0x0A, 0x60, 0x76, 0x67, 0x4A, - 0xE6, 0xE8, 0x63, 0xB5, 0x0A, 0x39, 0xDE, 0x95, 0xD6, 0xFB, 0xD4, 0xEC, 0xA3, 0xBD, 0x1A, 0xB1, - 0x8F, 0x54, 0x1C, 0xD7, 0x39, 0x50, 0x8F, 0x92, 0x0D, 0x33, 0x9F, 0x49, 0x10, 0xB2, 0x73, 0x87, - 0x83, 0xF0, 0x72, 0x9D, 0xE7, 0xEA, 0x14, 0xC7, 0x5A, 0x23, 0x6F, 0x54, 0x3E, 0xB5, 0x86, 0x6D, - 0xD6, 0xE2, 0x3E, 0x97, 0x96, 0x5F, 0xF4, 0x1A, 0xFD, 0x8B, 0x96, 0x9B, 0x14, 0xD7, 0x25, 0x3A, - 0x96, 0x25, 0x7B, 0xBE, 0x32, 0x46, 0xC3, 0x20, 0x4E, 0x01, 0x98, 0x0A, 0x27, 0x53, 0x58, 0xFA, - 0xAF, 0x14, 0xE6, 0x6B, 0x99, 0x32, 0x85, 0x87, 0x8F, 0xDA, 0x09, 0x7C, 0x92, 0x9D, 0x4C, 0x87, - 0xF6, 0xB3, 0x67, 0x61, 0xA2, 0x7C, 0x25, 0x5D, 0x4E, 0xA7, 0x6F, 0xF0, 0xCB, 0x6C, 0x6A, 0xC3, - 0xE2, 0x19, 0x33, 0xBE, 0x73, 0x95, 0xE1, 0xBA, 0x39, 0x09, 0x7F, 0xAE, 0x72, 0x8A, 0x4E, 0x74, - 0xA1, 0xBF, 0x5B, 0x1D, 0x34, 0x89, 0xF0, 0x94, 0xE6, 0x84, 0x3C, 0x64, 0x29, 0x04, 0x07, 0x34, - 0xC3, 0x32, 0xEF, 0xF6, 0xE5, 0x24, 0x54, 0x09, 0xFA, 0x81, 0xDB, 0xF1, 0xCF, 0xE5, 0xDB, 0x98, - 0x27, 0xC0, 0xEB, 0xDA, 0x10, 0x73, 0x74, 0x76, 0xCA, 0xD7, 0xFE, 0xDF, 0x82, 0x63, 0x0F, 0x31, - 0x03, 0xBE, 0x10, 0xF4, 0xF6, 0x76, 0xDD, 0x27, 0xAD, 0xE4, 0xC1, 0xFA, 0xC5, 0x5A, 0x71, 0x8D, - 0x59, 0x39, 0x41, 0x6C, 0xDD, 0xFB, 0x4C, 0x5C, 0xB0, 0xB8, 0xF9, 0x67, 0x9C, 0xD7, 0x90, 0x44, - 0xE2, 0xF3, 0x39, 0x4C, 0x84, 0x1A, 0x13, 0x3F, 0xF2, 0xDF, 0x77, 0xA5, 0xF6, 0xAB, 0x69, 0x37, - 0x18, 0x56, 0x03, 0x86, 0xE9, 0xB7, 0xC8, 0xD8, 0x5A, 0xA1, 0x87, 0x00, 0xBC, 0x14, 0x44, 0xFF, - 0x21, 0xDD, 0xAC, 0x99, 0xD2, 0x78, 0xDF, 0x0C, 0xF3, 0xAC, 0x5F, 0xF4, 0x56, 0xE4, 0xAB, 0xCF, - 0x5F, 0x1C, 0x60, 0x7E, 0xFA, 0xDA, 0x36, 0x8A, 0xF2, 0xD4, 0x80, 0x64, 0xC5, 0x54, 0x53, 0xCA, - 0xF3, 0x80, 0x9A, 0x3C, 0x7C, 0x7B, 0x32, 0x30, 0x14, 0xB7, 0x17, 0x9B, 0x42, 0x7C, 0x94, 0x0D, - 0xC4, 0x43, 0x5B, 0xB0, 0x86, 0xE9, 0x1F, 0x80, 0xCD, 0x45, 0x97, 0x3D, 0x8A, 0xD0, 0x22, 0x91, - 0xA0, 0x14, 0xA5, 0xD7, 0x71, 0x07, 0x8D, 0xAB, 0x69, 0xE8, 0x38, 0x98, 0xEE, 0x70, 0x3D, 0x7B, - 0x86, 0x13, 0xDE, 0xAF, 0xE5, 0x89, 0x5A, 0x5F, 0x1F, 0xF9, 0xA5, 0x3F, 0xED, 0x62, 0xE6, 0x65, - 0x3B, 0x86, 0xF9, 0x76, 0xD6, 0x5A, 0x57, 0x54, 0x8B, 0x0D, 0x39, 0xEC, 0x9F, 0x00, 0xBF, 0x4E, - 0xF8, 0x62, 0x51, 0x83, 0x74, 0x16, 0x00, 0x3A, 0x4F, 0x71, 0x18, 0x73, 0xF0, 0x41, 0x71, 0xB4, - 0xDC, 0x79, 0xFC, 0x32, 0xDB, 0x38, 0x0C, 0x3F, 0x1B, 0x66, 0xA4, 0x27, 0xED, 0xA7, 0xE2, 0xE6, - 0xB0, 0x51, 0xF6, 0xBD, 0xEF, 0x2E, 0x0E, 0x10, 0x8F, 0x1D, 0x40, 0xDF, 0x85, 0x67, 0xC7, 0x25, - 0x11, 0x7F, 0x50, 0x99, 0xC8, 0xAE, 0xDF, 0x6A, 0xAF, 0x70, 0x8C, 0xD4, 0xB5, 0x6A, 0xA5, 0x21, - 0x1C, 0xBF, 0x0C, 0x75, 0xA2, 0x40, 0x03, 0x17, 0x58, 0x8C, 0x84, 0x4D, 0x82, 0x29, 0xE5, 0x7C, - 0x05, 0xA1, 0xAF, 0x48, 0x07, 0xD1, 0xF7, 0x53, 0xBC, 0x02, 0xF7, 0xCD, 0x60, 0x35, 0xEE, 0x04, - 0x03, 0xE1, 0x3A, 0xAA, 0x71, 0x54, 0x5B, 0xDD, 0x86, 0x68, 0xFB, 0xC6, 0xBC, 0xCF, 0xCD, 0x55, - 0xBC, 0x0E, 0x0D, 0x8D, 0x7B, 0x70, 0x1F, 0xE4, 0xEC, 0x2C, 0x91, 0x22, 0xF6, 0x55, 0xC9, 0x07, - 0x0F, 0x26, 0x60, 0x4F, 0xB0, 0x27, 0xFA, 0xAB, 0xBF, 0x3B, 0xF1, 0x3F, 0x52, 0xB8, 0xC7, 0x7B, - 0x52, 0xBF, 0x6E, 0xA4, 0x87, 0xCD, 0x40, 0x62, 0x4D, 0xDA, 0xD1, 0x37, 0x77, 0x44, 0xB3, 0x1D, - 0xD6, 0x2F, 0x9A, 0xA8, 0x61, 0x54, 0x6A, 0x1E, 0x2E, 0xE2, 0xC0, 0xBF, 0x7D, 0xAD, 0xB9, 0xDB, - 0x52, 0x5C, 0x0F, 0x15, 0x7F, 0x40, 0x8B, 0xC3, 0x4E, 0xC5, 0xC3, 0x59, 0x5A, 0x19, 0x3F, 0xA1, - 0xB3, 0x58, 0x3A, 0xC2, 0x06, 0x5B, 0x16, 0xF8, 0xEA, 0xFA, 0xB6, 0x8D, 0x93, 0xFF, 0xC4, 0x96, - 0x2C, 0x9F, 0xD0, 0xAB, 0x5A, 0x2B, 0x81, 0x17, 0xA9, 0x71, 0x38, 0x0F, 0x01, 0xEF, 0x5A, 0xC0, - 0xE9, 0x9F, 0x8B, 0x63, 0x47, 0x89, 0x50, 0xC2, 0xFB, 0x8A, 0x8B, 0x9F, 0xEE, 0xC4, 0xC4, 0x7A, - 0xDC, 0xAD, 0xC3, 0x6A, 0x70, 0xA4, 0x71, 0x53, 0xFD, 0xA9, 0x0D, 0xC0, 0x62, 0x23, 0xB8, 0x9D, - 0xAE, 0xA2, 0x12, 0x0B, 0x18, 0x42, 0xB6, 0x93, 0x2A, 0x85, 0x60, 0x09, 0x59, 0x69, 0x52, 0x1F, - 0x1E, 0xBA, 0xBF, 0x0F, 0xA6, 0x8E, 0xB0, 0x8A, 0x03, 0xCA, 0xC5, 0x1C, 0x8E, 0x89, 0xF2, 0x50, - 0xD7, 0x1A, 0xA9, 0x63, 0x83, 0x0F, 0x6D, 0x06, 0x27, 0x1F, 0x40, 0xDA, 0x0B, 0x9E, 0xEB, 0x1F, - 0x7E, 0x4F, 0x8A, 0xF0, 0x38, 0x86, 0x08, 0xC6, 0x3A, 0xFF, 0x29, 0xCC, 0xA7, 0x10, 0x27, 0xF3, - 0x99, 0x3E, 0x52, 0xF3, 0x0F, 0x83, 0x93, 0x9F, 0x63, 0xE8, 0x23, 0x41, 0x71, 0x98, 0x25, 0x1B, - 0xC9, 0x89, 0x15, 0x8F, 0xC8, 0x72, 0x35, 0x72, 0x7D, 0xF2, 0x36, 0x31, 0x64, 0xF5, 0x3A, 0x4C, - 0x15, 0x9B, 0x30, 0x77, 0x36, 0x03, 0xB9, 0xEE, 0xCA, 0x61, 0x22, 0x7C, 0xCF, 0xEE, 0x6C, 0xE4, - 0xEC, 0x83, 0x67, 0x10, 0x07, 0x7A, 0x21, 0x97, 0xDF, 0xC3, 0x2A, 0x27, 0x47, 0xDB, 0x1A, 0x76, - 0x2D, 0xA5, 0x9D, 0xD7, 0x39, 0x54, 0x4F, 0x62, 0x9C, 0xFD, 0x77, 0x0E, 0xB0, 0x4A, 0x0A, 0xD9, - 0x46, 0xC2, 0x28, 0x49, 0xB0, 0x53, 0x99, 0x2A, 0xC2, 0x81, 0xF9, 0x8A, 0xE1, 0x01, 0xDA, 0xCC, - 0x31, 0x60, 0x9B, 0x32, 0x4B, 0x69, 0x2B, 0x89, 0x00, 0xDA, 0xCD, 0x41, 0x0B, 0x13, 0xC0, 0x3C, - 0x4A, 0xD0, 0x32, 0x0A, 0x45, 0x31, 0x54, 0x38, 0x9E, 0x74, 0x56, 0x60, 0x8A, 0xFA, 0x0C, 0x0C, - 0xC8, 0xDC, 0x4E, 0x12, 0x9A, 0xD0, 0x2B, 0xAC, 0xF3, 0x16, 0xD3, 0xE4, 0x5C, 0xA8, 0x3B, 0x8A, - 0x8E, 0x04, 0x4B, 0x09, 0xDE, 0x91, 0x1C, 0xF2, 0x3D, 0xB5, 0x27, 0x23, 0x9A, 0x5F, 0xCA, 0xCE, - 0x1D, 0x81, 0x25, 0xD3, 0x0B, 0x07, 0x3B, 0xA2, 0xED, 0xC1, 0x68, 0xA3, 0x10, 0x1E, 0x49, 0xED, - 0x2B, 0x02, 0xD4, 0x65, 0x6B, 0xDE, 0xF7, 0xE8, 0x3D, 0xC3, 0x41, 0x1E, 0x75, 0xDB, 0xD0, 0xE4, - 0xA7, 0xFF, 0xFC, 0xB3, 0x0D, 0xAE, 0x72, 0x6D, 0xF2, 0x16, 0xF9, 0x4C, 0x9B, 0x2C, 0x83, 0x55, - 0x53, 0x32, 0xB1, 0x4E, 0xE7, 0x7E, 0x7F, 0xF6, 0xBE, 0xE4, 0x7A, 0xF3, 0xDB, 0x73, 0xA5, 0xDC, - 0xB3, 0x1F, 0x1B, 0x9E, 0x93, 0x58, 0x58, 0x4C, 0xDB, 0xED, 0x8C, 0x02, 0xB7, 0x43, 0x10, 0x7F, - 0x32, 0xF0, 0xFC, 0xD2, 0xDA, 0x18, 0xA6, 0x74, 0x80, 0x12, 0x9C, 0xBB, 0xB9, 0xA9, 0x03, 0x76, - 0xC9, 0x4E, 0xE0, 0xE3, 0x63, 0x96, 0xC8, 0x32, 0x04, 0x06, 0x15, 0x52, 0xD1, 0xB6, 0x03, 0x1B, - 0x5D, 0xF2, 0x40, 0x43, 0x37, 0xCF, 0x7C, 0xF5, 0xC4, 0xAB, 0x8B, 0x83, 0x63, 0x5D, 0xE3, 0x3B, - 0x3B, 0x66, 0xE6, 0x19, 0xEF, 0x51, 0x6B, 0x60, 0x6F, 0x3E, 0x71, 0x3D, 0x8E, 0x5A, 0x77, 0xD2, - 0x57, 0x9A, 0x06, 0xE9, 0xBB, 0x8A, 0x50, 0x58, 0x90, 0xF1, 0x17, 0xD7, 0x18, 0x9C, 0x24, 0x65, - 0x3D, 0x40, 0xA5, 0xA1, 0xD8, 0x24, 0x4B, 0xAA, 0x8A, 0x47, 0x3F, 0x0D, 0xB6, 0x60, 0xE6, 0x75, - 0xCD, 0x45, 0x6D, 0x54, 0xD9, 0x67, 0x65, 0xE0, 0x04, 0xCC, 0xBE, 0xCC, 0xAA, 0x8E, 0x3D, 0xB9, - 0x1E, 0x03, 0x25, 0x25, 0x31, 0x88, 0x36, 0xF6, 0x52, 0xD7, 0x4E, 0x75, 0xB5, 0xEA, 0x05, 0x83, - 0x59, 0xAD, 0xAF, 0xF4, 0x13, 0xCE, 0x5D, 0xF4, 0x52, 0x98, 0xBC, 0x63, 0xFE, 0xB0, 0xC5, 0x55, - 0xBD, 0x5A, 0x65, 0x3E, 0xAF, 0x24, 0x4C, 0x5E, 0xEA, 0x9A, 0x44, 0x32, 0x0E, 0x39, 0xCA, 0x60, - 0xB2, 0xBF, 0x62, 0x40, 0x19, 0x57, 0xDE, 0x7C, 0x70, 0xD7, 0xC3, 0x0E, 0x9A, 0x98, 0x6F, 0x26, - 0x22, 0x45, 0xC4, 0xD1, 0x8E, 0x6B, 0xC9, 0x3F, 0x1E, 0x71, 0x4F, 0x2E, 0x86, 0x42, 0x73, 0x00, - 0xEB, 0x98, 0x22, 0x03, 0x1F, 0x6F, 0xC3, 0xAF, 0xD0, 0x55, 0x8F, 0x95, 0x6F, 0x8E, 0x4B, 0xF0, - 0x21, 0x1D, 0xA7, 0xB1, 0xE8, 0x6B, 0xC7, 0x8A, 0xAD, 0x69, 0xD7, 0x6A, 0x7F, 0x09, 0x3A, 0x9F, - 0xBF, 0x30, 0x27, 0x18, 0x00, 0x11, 0xF2, 0x96, 0xAB, 0x57, 0xD3, 0x67, 0x5D, 0x2A, 0x36, 0xCF, - 0xE2, 0x05, 0xBB, 0x01, 0x83, 0x0B, 0xC7, 0x6D, 0xE9, 0xFD, 0x5A, 0xC8, 0x0D, 0x9C, 0xC0, 0xA2, - 0x41, 0x8D, 0x0E, 0x53, 0xB2, 0xD2, 0x2B, 0xD8, 0xE5, 0x4C, 0xEE, 0x81, 0x52, 0xED, 0xE8, 0xEA, - 0xF1, 0xF3, 0x2A, 0x5D, 0xEC, 0x2D, 0x0E, 0xFD, 0x76, 0x26, 0x4C, 0x25, 0x78, 0x26, 0x6F, 0x2F, - 0xF7, 0x31, 0xAB, 0xC0, 0x6C, 0x80, 0x1F, 0x2B, 0x8B, 0x1E, 0xC1, 0x09, 0x46, 0x5E, 0x94, 0x19, - 0xED, 0x07, 0x94, 0xEC, 0xCF, 0x3B, 0xC6, 0x51, 0x29, 0xC2, 0x87, 0xD4, 0x55, 0xD0, 0xAD, 0x82, - 0x66, 0x27, 0x61, 0x18, 0xDD, 0xB8, 0xBD, 0xF9, 0xE1, 0xCA, 0xAA, 0xBA, 0x49, 0x39, 0xD6, 0x43, - 0xA9, 0x10, 0x12, 0x7C, 0xA6, 0x82, 0xD8, 0xDB, 0x11, 0x76, 0x9D, 0xF0, 0x92, 0xFB, 0x31, 0xC1, - 0x9C, 0x31, 0x78, 0x1C, 0x11, 0xD6, 0xF3, 0x1F, 0x14, 0x39, 0xC6, 0x33, 0x46, 0x58, 0x8C, 0xE9, - 0x2B, 0x87, 0x94, 0xA6, 0xFA, 0x55, 0x5A, 0x3C, 0x39, 0x60, 0xD0, 0x26, 0x0F, 0xB3, 0x56, 0x18, - 0x77, 0x9C, 0x1B, 0x01, 0xBA, 0xE6, 0xB2, 0x1E, 0x8B, 0xA0, 0x63, 0x2D, 0x7E, 0xA2, 0x30, 0xFC, - 0xDF, 0x31, 0x99, 0xB2, 0xD6, 0x1E, 0xD3, 0xAB, 0xB7, 0xFA, 0x72, 0xB0, 0x6F, 0xE5, 0x6B, 0x9F, - 0xAF, 0xB4, 0xF0, 0x53, 0x06, 0x9C, 0xB0, 0x98, 0x6B, 0xF4, 0x5A, 0x52, 0xDB, 0xD0, 0x13, 0xED, - 0x73, 0x70, 0x11, 0xBB, 0xD0, 0x98, 0x58, 0xCA, 0x29, 0x44, 0xCB, 0x7C, 0x2D, 0x43, 0xDE, 0x4F, - 0xBF, 0x13, 0x06, 0xDD, 0x3C, 0x69, 0x49, 0xD2, 0xD7, 0xA7, 0x24, 0x9E, 0x0D, 0x3C, 0x8C, 0x73, - 0x0F, 0xB2, 0x4F, 0x16, 0x83, 0x7E, 0x7B, 0x3A, 0xD4, 0x49, 0x42, 0x26, 0x9C, 0x6F, 0xAF, 0xD6, - 0x73, 0xEF, 0x29, 0x3D, 0x1A, 0x21, 0x58, 0x48, 0xF7, 0xEE, 0xD2, 0xC8, 0x06, 0x4D, 0xB2, 0x3D, - 0x1E, 0xD6, 0xF6, 0xF3, 0x25, 0xC8, 0xD5, 0xF4, 0xB6, 0x07, 0x2C, 0xB0, 0x03, 0xDE, 0x83, 0xE0, - 0x1C, 0x68, 0x2E, 0x78, 0xB6, 0xDA, 0x99, 0xA6, 0xBD, 0xE8, 0x1D, 0x47, 0x6E, 0x7A, 0x4C, 0xC5, - 0xE4, 0x54, 0xEA, 0xDB, 0xB1, 0x6F, 0x9F, 0x53, 0xA6, 0x41, 0xE2, 0x24, 0x6C, 0x9C, 0x88, 0xF7, - 0x88, 0xA8, 0x90, 0x0D, 0x34, 0x61, 0xAA, 0x7D, 0x52, 0x5F, 0x8D, 0x81, 0xBE, 0xC9, 0x3E, 0x36, - 0x8D, 0x69, 0x81, 0x0D, 0x24, 0x7D, 0xCE, 0x03, 0xB8, 0x4E, 0x9C, 0xFD, 0x5A, 0x4A, 0x45, 0xAF, - 0x45, 0xB5, 0xFF, 0x49, 0xEA, 0x6C, 0xF7, 0xB9, 0xE5, 0xC1, 0xA6, 0x57, 0xF3, 0xCA, 0xCC, 0x46, - 0xD2, 0x20, 0xB3, 0xB1, 0xC0, 0x18, 0xEE, 0x82, 0xE4, 0x00, 0x3C, 0xA7, 0x8B, 0xA6, 0x3A, 0xDA, - 0x82, 0x53, 0x3C, 0x42, 0x4C, 0x3B, 0x16, 0xD0, 0x3E, 0x0E, 0xBA, 0x36, 0xA6, 0xEA, 0x36, 0x16, - 0x80, 0xA3, 0x51, 0xFD, 0xF8, 0xFA, 0xE5, 0x75, 0x64, 0x17, 0x0C, 0xE5, 0xAE, 0xB2, 0xE5, 0x14, - 0xC1, 0xA9, 0xAE, 0x3A, 0x7E, 0x4D, 0x0E, 0x5C, 0x67, 0x31, 0x02, 0xD2, 0x4D, 0xB3, 0xD6, 0xC6, - 0xE6, 0x86, 0xC2, 0x62, 0xE6, 0xB6, 0x53, 0x2C, 0x29, 0x72, 0x90, 0x55, 0xAC, 0x1C, 0xE7, 0x7F, - 0x7F, 0xA3, 0xE8, 0x21, 0xF0, 0x2D, 0x3E, 0x8A, 0xA3, 0xA2, 0xA2, 0x29, 0xEC, 0x36, 0x4B, 0x89, - 0x1C, 0xB6, 0xC1, 0xB9, 0x4A, 0x8F, 0x65, 0xDF, 0x97, 0x29, 0x0F, 0x0B, 0xB1, 0x61, 0x24, 0xA2, - 0xD2, 0x57, 0x7A, 0x99, 0xF7, 0x1D, 0xC8, 0xB4, 0xDD, 0xEE, 0x7A, 0xBE, 0x2E, 0x46, 0x9A, 0xF6, - 0x92, 0x13, 0xAC, 0x98, 0x64, 0x4C, 0xDD, 0x6B, 0x03, 0xD3, 0xF4, 0x14, 0xC9, 0x7D, 0xCE, 0x9B, - 0xF7, 0xD4, 0x80, 0xB1, 0x2A, 0x66, 0x33, 0xA4, 0xE2, 0x45, 0x99, 0x95, 0x77, 0xE1, 0x3E, 0x8A, - 0x43, 0x85, 0xD9, 0x79, 0x69, 0x0D, 0x55, 0xCF, 0x09, 0xF4, 0xFC, 0x07, 0x39, 0x20, 0x26, 0xB4, - 0x8B, 0xD0, 0x60, 0xFB, 0x42, 0x41, 0xEF, 0x02, 0x5F, 0x0D, 0xC7, 0x7F, 0x09, 0xFA, 0x26, 0x94, - 0x7A, 0xCD, 0xDE, 0x43, 0x86, 0x44, 0xD6, 0xC6, 0xB1, 0x77, 0x13, 0xB1, 0x08, 0xC9, 0xDD, 0x99, - 0xF0, 0xED, 0x7B, 0xB0, 0xAB, 0x31, 0x6D, 0x5B, 0x66, 0xA3, 0x53, 0xE2, 0x3B, 0x0F, 0x31, 0xA2, - 0x63, 0x6E, 0x05, 0xAD, 0xC6, 0x74, 0xC5, 0x2D, 0xB3, 0x79, 0xEB, 0x66, 0xF3, 0x6B, 0x79, 0x02, - 0x7A, 0x7D, 0x49, 0x59, 0x30, 0x04, 0x29, 0xD8, 0x5E, 0xF7, 0xF3, 0x6C, 0x5E, 0xC2, 0xA6, 0xFF, - 0x1B, 0x5A, 0xFE, 0x01, 0x54, 0x40, 0xEF, 0xA0, 0xD5, 0xDB, 0x47, 0xED, 0x2A, 0x9B, 0x85, 0x12, - 0x9F, 0x74, 0x5D, 0xB7, 0xA6, 0x80, 0x22, 0x34, 0x87, 0x81, 0x7E, 0x15, 0x87, 0x62, 0x03, 0x87, - 0x62, 0x6B, 0x85, 0xF1, 0x37, 0x55, 0x55, 0x31, 0x18, 0xBD, 0xEF, 0x57, 0x1D, 0x21, 0x5E, 0x87, - 0x37, 0x53, 0x61, 0x7B, 0xA5, 0x80, 0x71, 0x2C, 0x72, 0x83, 0x64, 0x73, 0xF2, 0x4C, 0xA0, 0x3F, - 0x4C, 0x3E, 0x21, 0xF3, 0x96, 0xBB, 0x9C, 0x05, 0xE1, 0x12, 0x47, 0xA2, 0x6E, 0xF6, 0x67, 0xFE, - 0x1B, 0x3F, 0x74, 0xA5, 0x6B, 0x2E, 0xB3, 0x77, 0x02, 0x64, 0x30, 0xAF, 0x6C, 0x64, 0x2E, 0x69, - 0x92, 0xA5, 0xD3, 0xA8, 0xEE, 0xEF, 0xB7, 0x89, 0xD9, 0x31, 0x1B, 0x61, 0xC8, 0x91, 0xF1, 0xC5, - 0x59, 0x7D, 0xCE, 0xDF, 0xFB, 0xF2, 0x10, 0xF7, 0x42, 0x02, 0xEC, 0x70, 0x2F, 0xE4, 0x02, 0xB4, - 0xFB, 0xA0, 0xFC, 0x83, 0x58, 0x68, 0xA2, 0x8E, 0x01, 0x8B, 0x10, 0xF6, 0x30, 0x86, 0xAA, 0x5A, - 0xC4, 0x95, 0x61, 0x02, 0x8E, 0xF2, 0xB7, 0x6B, 0x6C, 0x80, 0x5C, 0xCB, 0x11, 0x66, 0x97, 0x60, - 0x70, 0xD4, 0x06, 0xA9, 0xC7, 0x80, 0xE3, 0x2C, 0xA4, 0xE1, 0xAA, 0x34, 0x92, 0x13, 0x57, 0x05, - 0xF9, 0x70, 0xF3, 0xF4, 0x80, 0x73, 0xF2, 0x16, 0xDA, 0xBD, 0x39, 0x51, 0xD1, 0x40, 0xC1, 0x59, - 0x04, 0xCD, 0xE4, 0x79, 0x63, 0x24, 0x69, 0xC6, 0x99, 0x2F, 0x4D, 0x0D, 0x1C, 0x9C, 0x15, 0xED, - 0x41, 0x47, 0x12, 0x78, 0x6F, 0x8E, 0xFF, 0xA7, 0x34, 0xB8, 0x8B, 0x0C, 0x70, 0x96, 0x07, 0x0B, - 0x49, 0x42, 0x59, 0xFE, 0x5A, 0x08, 0x76, 0x36, 0x3D, 0x7D, 0xBA, 0x10, 0x1B, 0x11, 0xB4, 0x6B, - 0x1C, 0x59, 0x60, 0x02, 0x36, 0x30, 0xD9, 0xEC, 0xBA, 0xEE, 0x22, 0xFD, 0x0F, 0x2E, 0xA2, 0xE2, - 0x70, 0x9C, 0x0D, 0x18, 0x58, 0x88, 0x4A, 0x0D, 0xE7, 0x0E, 0xEF, 0xD8, 0x6F, 0xA7, 0x70, 0x12, - 0x9D, 0x06, 0x4C, 0x8C, 0xAD, 0x1A, 0x28, 0x01, 0xB6, 0x23, 0x53, 0x76, 0xDD, 0x3F, 0x17, 0x87, - 0x0B, 0xC1, 0xEB, 0x9C, 0x44, 0x67, 0x1B, 0x79, 0xE0, 0x67, 0xB2, 0x2A, 0x99, 0x72, 0xEB, 0x4C, - 0xB4, 0x17, 0x2E, 0xB5, 0xE8, 0x52, 0x1E, 0xCB, 0x3A, 0x3D, 0xF7, 0xF2, 0x21, 0xC7, 0xF1, 0x29, - 0x97, 0x22, 0x31, 0x2C, 0x39, 0x8A, 0xAF, 0x47, 0xF9, 0x3B, 0xA9, 0x8B, 0x2B, 0xEF, 0xE2, 0xF0, - 0x11, 0x59, 0xFC, 0xE4, 0x56, 0xFF, 0x4E, 0xA7, 0x92, 0xE5, 0xE5, 0x26, 0x16, 0xC8, 0x2C, 0x35, - 0xD2, 0x70, 0x9F, 0xAE, 0xA7, 0x08, 0x16, 0x2B, 0x64, 0xA1, 0xF6, 0xF3, 0xC1, 0x43, 0x27, 0x92, - 0x46, 0x4E, 0xA2, 0x01, 0x72, 0x18, 0x08, 0xAB, 0x22, 0x42, 0x1B, 0x9E, 0x35, 0xAE, 0xB3, 0xE6, - 0x42, 0x1B, 0x49, 0x31, 0xBB, 0xA4, 0xD0, 0xD6, 0x7A, 0xEB, 0xFE, 0x32, 0x37, 0x7F, 0xE6, 0x2F, - 0x75, 0x54, 0x1D, 0x88, 0x9F, 0x81, 0xEE, 0xF0, 0x97, 0xC9, 0x12, 0x80, 0x47, 0x5C, 0xCA, 0x3B, - 0x45, 0xF4, 0x63, 0xC3, 0x16, 0x2D, 0x7E, 0xCD, 0x80, 0xC2, 0xBA, 0x50, 0x1D, 0xC2, 0x31, 0x72, - 0xF0, 0x27, 0x97, 0xB0, 0xF4, 0x69, 0x43, 0x2B, 0x26, 0x89, 0x28, 0xFC, 0xBD, 0x03, 0x6A, 0x4A, - 0x22, 0x5D, 0xD3, 0x7D, 0xEC, 0xC8, 0xEC, 0x7B, 0x15, 0xFA, 0x05, 0x5D, 0x73, 0x6B, 0x5B, 0x1B, - 0xC9, 0x83, 0xD0, 0xFA, 0x24, 0xBA, 0x97, 0x11, 0x30, 0x04, 0xD3, 0x11, 0xCE, 0x24, 0xBD, 0x71, - 0xB7, 0xAA, 0xB2, 0xC2, 0x43, 0xC2, 0x67, 0x3B, 0x9C, 0x28, 0x62, 0x52, 0xF0, 0xFA, 0xCB, 0xFA, - 0xDF, 0x4F, 0xC9, 0x23, 0xD1, 0x94, 0xE1, 0x5F, 0x2A, 0xF2, 0xC7, 0x5F, 0x76, 0x6B, 0x86, 0x28, - 0x29, 0xF1, 0x54, 0x4F, 0x7A, 0x4D, 0xFD, 0xD0, 0x51, 0xFA, 0xBC, 0x6F, 0x7B, 0x44, 0xE5, 0xB0, - 0xF3, 0xC0, 0x34, 0x80, 0x6D, 0xE6, 0xDD, 0xCD, 0x7F, 0x67, 0x7B, 0x15, 0xC5, 0xE5, 0x14, 0x64, - 0x80, 0x81, 0xD9, 0x47, 0xCE, 0x71, 0x62, 0x94, 0xCE, 0x41, 0x61, 0xFA, 0xDD, 0x5A, 0x6D, 0xC1, - 0x28, 0x87, 0x39, 0xC4, 0xBC, 0x89, 0x3A, 0x99, 0x18, 0x80, 0xDC, 0x50, 0x72, 0xCF, 0x67, 0x4D, - 0x77, 0x6D, 0x6A, 0xB4, 0x17, 0x85, 0xD6, 0x2B, 0xC3, 0x4A, 0x7C, 0xD1, 0xF3, 0x0E, 0xA4, 0x8F, - 0x3B, 0xDA, 0x8A, 0x7B, 0x0A, 0x37, 0x7D, 0x36, 0xEC, 0x89, 0x87, 0xD9, 0x88, 0xB7, 0xC9, 0x1F, - 0xEB, 0xEE, 0x25, 0x46, 0xA9, 0x3B, 0x19, 0x16, 0x17, 0x2D, 0x0F, 0x8C, 0xEB, 0x19, 0xF3, 0x47, - 0xC7, 0x21, 0xA8, 0x1E, 0x7F, 0xC4, 0xE3, 0x6B, 0x96, 0x1D, 0x63, 0xDD, 0xC2, 0xEF, 0xB2, 0x65, - 0x60, 0x07, 0xE5, 0xD3, 0x48, 0x49, 0x9A, 0xF2, 0xB0, 0x76, 0x2D, 0xFB, 0x68, 0xF8, 0xAD, 0xE9, - 0x3C, 0x52, 0x37, 0x9A, 0xD1, 0xAE, 0x16, 0x37, 0x2E, 0xB3, 0x63, 0xE0, 0x66, 0xB1, 0x4D, 0x49, - 0x83, 0xD2, 0xEA, 0x20, 0xFD, 0x43, 0x84, 0x5B, 0x22, 0xBC, 0x0C, 0xA1, 0x85, 0x28, 0xF7, 0x45, - 0xF1, 0x2A, 0xC2, 0xFE, 0x87, 0x4C, 0xFC, 0x0A, 0x5B, 0xD9, 0x84, 0x7A, 0xAC, 0x8C, 0xBD, 0xDF, - 0xDC, 0xA5, 0xFC, 0xD0, 0x85, 0x65, 0xA2, 0x73, 0x1C, 0x7C, 0xFD, 0xF9, 0xBA, 0x1E, 0xBD, 0x5F, - 0x06, 0xE8, 0xFC, 0x62, 0xD1, 0xF7, 0x13, 0x52, 0xE3, 0xC2, 0xEB, 0xEE, 0x0E, 0x7E, 0x9D, 0x8A, - 0x19, 0x3E, 0xA2, 0x62, 0x06, 0xC5, 0xA1, 0xDC, 0x6B, 0x4A, 0x59, 0xA6, 0x57, 0x73, 0xCB, 0x57, - 0x16, 0x99, 0xFB, 0x93, 0x36, 0xDF, 0x0E, 0x1A, 0x38, 0xD4, 0x89, 0x02, 0x79, 0xB6, 0xA8, 0x52, - 0xCB, 0x2E, 0x96, 0xD4, 0xD8, 0x52, 0xA9, 0x7C, 0xE3, 0x97, 0x47, 0x6F, 0x6E, 0x82, 0x6D, 0x3A, - 0x01, 0x8F, 0x2F, 0x59, 0xDF, 0x93, 0xBA, 0x52, 0xC4, 0x46, 0xDA, 0xC5, 0x0C, 0x2E, 0x40, 0xB8, - 0x37, 0x55, 0x40, 0xB8, 0x13, 0xCD, 0x51, 0x96, 0xCE, 0x4A, 0x6C, 0x0D, 0xF9, 0x5A, 0xE6, 0x34, - 0x95, 0xF0, 0xFF, 0x54, 0x93, 0x05, 0x9D, 0x56, 0x94, 0xF7, 0x23, 0x90, 0x00, 0x44, 0xA7, 0xD9, - 0x86, 0x71, 0xB2, 0xFD, 0x58, 0x19, 0xBB, 0xEC, 0x6B, 0x90, 0x07, 0x2B, 0x7A, 0x20, 0x4B, 0xFD, - 0x0E, 0xB8, 0xF8, 0x00, 0x13, 0xC2, 0xF2, 0x32, 0x39, 0xED, 0x71, 0x59, 0x71, 0xC4, 0xDC, 0xE5, - 0xC2, 0xA9, 0x2B, 0x7B, 0x52, 0x00, 0xCB, 0x49, 0xB4, 0x00, 0xE6, 0x98, 0x13, 0xC1, 0x2F, 0x3A, - 0x19, 0x86, 0xD5, 0x74, 0xCD, 0xBC, 0xBA, 0x4C, 0x48, 0x00, 0x8E, 0x22, 0xD5, 0xAC, 0x11, 0xEF, - 0xC8, 0xCD, 0x99, 0xBA, 0xBC, 0x0F, 0xD4, 0xC0, 0xAE, 0x15, 0x2F, 0x82, 0x6D, 0x4D, 0x44, 0x10, - 0xF1, 0xF5, 0x55, 0xF0, 0x00, 0xAF, 0xEA, 0x96, 0x1F, 0xE6, 0xA6, 0x9A, 0x78, 0xDD, 0x6D, 0xD5, - 0xDF, 0xA4, 0x4D, 0xAE, 0x05, 0xEE, 0x12, 0x9F, 0x9B, 0x99, 0xAC, 0xE4, 0xBE, 0x9E, 0x56, 0xCC, - 0x4B, 0x6D, 0x26, 0xB9, 0x56, 0x9B, 0x9B, 0x52, 0x6D, 0x14, 0x28, 0x7D, 0xE8, 0x75, 0xCB, 0x59, - 0xC0, 0x50, 0x69, 0x6B, 0xD7, 0x68, 0x06, 0xA8, 0x38, 0xD1, 0xBB, 0xD9, 0xA3, 0x3D, 0xA1, 0xBD, - 0x7D, 0x9E, 0xD2, 0xB9, 0x5D, 0x35, 0x02, 0xE0, 0xD4, 0xAF, 0x66, 0x56, 0x7D, 0xF4, 0x88, 0x74, - 0x3C, 0x28, 0x2C, 0xBA, 0x20, 0xC1, 0x2A, 0x93, 0xA9, 0xBA, 0x90, 0xE8, 0xC2, 0xE9, 0x15, 0xC8, - 0x8F, 0xBD, 0x27, 0xDE, 0x21, 0xBF, 0x56, 0x69, 0x93, 0x72, 0x7E, 0xE4, 0xE7, 0x7D, 0xE8, 0x4D, - 0xBF, 0x24, 0xA2, 0x77, 0xC0, 0xE0, 0x30, 0xD9, 0xEE, 0x82, 0xCD, 0x21, 0x60, 0xFC, 0xD1, 0x6F, - 0xB4, 0x40, 0x01, 0xFE, 0xF4, 0x73, 0xAF, 0xBB, 0xF6, 0x2B, 0x41, 0xFC, 0xDE, 0x74, 0x78, 0xE5, - 0x7E, 0xAB, 0xC9, 0xED, 0x63, 0x4B, 0x3E, 0x1A, 0x27, 0xCD, 0xBF, 0x85, 0xA4, 0x70, 0x92, 0x36, - 0x56, 0x70, 0x4A, 0xEE, 0x45, 0xAB, 0x33, 0x0A, 0x76, 0xB8, 0x0B, 0xEA, 0x55, 0xC7, 0x4E, 0xD7, - 0xD9, 0xC7, 0x10, 0x8D, 0x09, 0xFA, 0x10, 0x30, 0x62, 0x20, 0xE5, 0xBC, 0xFB, 0x74, 0x72, 0xA6, - 0x77, 0xB5, 0xBB, 0xD7, 0xD6, 0x60, 0x3A, 0x6B, 0x5D, 0xF5, 0x35, 0xF4, 0x84, 0xA0, 0x19, 0x49, - 0x36, 0x00, 0xC9, 0x35, 0xCC, 0xF7, 0xFE, 0x92, 0xF9, 0x4B, 0x8B, 0xB3, 0xBE, 0x98, 0xBF, 0xF4, - 0x25, 0xB1, 0x62, 0x4D, 0x41, 0xA0, 0xF7, 0x36, 0x6C, 0x86, 0x3C, 0x4F, 0xC4, 0xF8, 0xF2, 0xFC, - 0xE6, 0x34, 0x30, 0x95, 0x32, 0x9D, 0xE5, 0x85, 0x70, 0xD8, 0xB8, 0xD6, 0xD9, 0x42, 0xB9, 0x05, - 0x6E, 0x4B, 0x6F, 0x29, 0x33, 0x8E, 0xE4, 0x31, 0x3C, 0x21, 0x7B, 0x19, 0x31, 0x97, 0xD5, 0x62, - 0x6B, 0xF6, 0x98, 0x3C, 0xA5, 0x54, 0x18, 0x16, 0x03, 0x49, 0x51, 0x1F, 0x13, 0x37, 0xFB, 0x18, - 0x9D, 0xCF, 0x16, 0x43, 0x34, 0x7D, 0xB6, 0x5C, 0x9E, 0x74, 0x4D, 0x66, 0x23, 0x99, 0xDE, 0x6E, - 0x57, 0xFE, 0x47, 0x0D, 0x3B, 0x59, 0x3F, 0x01, 0x79, 0x75, 0x0D, 0x78, 0x62, 0x4A, 0xA5, 0xF2, - 0xF8, 0xD6, 0xAE, 0x11, 0x85, 0x88, 0x13, 0x98, 0x07, 0x0B, 0x92, 0x99, 0xC6, 0x9F, 0x85, 0x24, - 0xB1, 0x48, 0xEF, 0x59, 0x11, 0xCB, 0xAB, 0x92, 0xE4, 0x58, 0x50, 0xAA, 0xE8, 0x97, 0xD5, 0xCD, - 0x63, 0x57, 0x61, 0x62, 0x06, 0xBD, 0x26, 0x08, 0x0E, 0xC6, 0x42, 0x98, 0x8E, 0x82, 0x13, 0xD7, - 0xB8, 0x18, 0x7B, 0xAA, 0xFD, 0x42, 0x51, 0x07, 0xDE, 0x6F, 0xCF, 0xE7, 0x87, 0xF6, 0xBF, 0x15, - 0x8D, 0x8E, 0xFD, 0xA9, 0x4A, 0x45, 0x81, 0x57, 0x8F, 0x22, 0x4D, 0x63, 0x21, 0x4E, 0x41, 0x3C, - 0xCD, 0x77, 0xF5, 0xEC, 0xB8, 0x15, 0x8A, 0xBC, 0x69, 0x22, 0x98, 0xE5, 0xA4, 0x66, 0x47, 0xC5, - 0x9F, 0xE9, 0x9D, 0x06, 0xD8, 0xD2, 0x37, 0xA0, 0x4C, 0xDC, 0x33, 0xD4, 0xE7, 0xED, 0x77, 0x7D, - 0xA2, 0x20, 0x81, 0xB2, 0x46, 0xC5, 0xF6, 0xF5, 0x2A, 0x76, 0x50, 0xAF, 0xC2, 0x5A, 0xC7, 0x8F, - 0xD8, 0x3C, 0x4F, 0x2F, 0xE3, 0x56, 0x04, 0xB2, 0x6C, 0x8C, 0x0D, 0x84, 0xD7, 0xE0, 0xB5, 0x45, - 0xB2, 0x93, 0x34, 0xA0, 0xC2, 0xF4, 0x3A, 0x28, 0xDC, 0x50, 0xE8, 0xF3, 0xF0, 0x7C, 0x67, 0x1A, - 0x11, 0xD7, 0x8D, 0xB2, 0x71, 0x3D, 0xB3, 0x68, 0x49, 0x19, 0x29, 0x54, 0xDF, 0x44, 0xB9, 0x48, - 0xDD, 0x9E, 0xCE, 0xCD, 0x2D, 0x69, 0xB6, 0x18, 0xAD, 0xBC, 0xDC, 0xDF, 0x1F, 0x48, 0x04, 0x16, - 0xD6, 0x3A, 0x39, 0x7E, 0x30, 0xDB, 0x9D, 0xE1, 0x14, 0xF2, 0x5F, 0xDB, 0x1D, 0xBB, 0x7F, 0x4F, - 0x49, 0xBF, 0x4D, 0x2B, 0x9B, 0x5C, 0x7E, 0xA8, 0x1B, 0x79, 0x4F, 0x29, 0xA2, 0xF8, 0xBA, 0x36, - 0x86, 0x10, 0xFA, 0x7C, 0x45, 0x99, 0xE9, 0xD1, 0xDB, 0x93, 0xDB, 0x2A, 0xD5, 0xA8, 0x61, 0x48, - 0xBA, 0xD9, 0x40, 0xD7, 0xAE, 0xE5, 0x35, 0xAA, 0xF0, 0xA5, 0xFD, 0xC5, 0x64, 0x0B, 0x31, 0xA5, - 0x9D, 0x83, 0x31, 0xF6, 0xB8, 0xB5, 0x18, 0x3E, 0xB4, 0x2A, 0x8E, 0x70, 0x7A, 0xB8, 0xAC, 0xB5, - 0x92, 0xDD, 0x12, 0xA7, 0x9D, 0x41, 0xB1, 0x16, 0xE8, 0x45, 0x63, 0x1B, 0xB9, 0x73, 0xF1, 0x19, - 0xF6, 0xAE, 0x0F, 0xF3, 0xF7, 0x60, 0xED, 0x27, 0x70, 0x12, 0x8C, 0x12, 0x3A, 0xCF, 0xA6, 0xDC, - 0xBD, 0x17, 0x82, 0x05, 0x6E, 0x10, 0x04, 0xD4, 0xE7, 0x10, 0x9B, 0x83, 0x55, 0xB0, 0xED, 0x1B, - 0xF9, 0x7D, 0x75, 0x8E, 0xB2, 0x26, 0xA7, 0xBD, 0xE2, 0x0F, 0x29, 0x25, 0x6C, 0xFD, 0xC9, 0xC4, - 0x72, 0xE1, 0x1C, 0xDC, 0x9E, 0xBE, 0x69, 0xB5, 0xE8, 0x31, 0x83, 0x03, 0x5A, 0xEA, 0xA3, 0x52, - 0xD7, 0x51, 0x8A, 0x76, 0xB8, 0x83, 0xF0, 0x5E, 0xDC, 0xFC, 0xED, 0x80, 0x36, 0x7A, 0x39, 0xC6, - 0xFC, 0xF3, 0xC3, 0xE1, 0x5D, 0x15, 0x05, 0x30, 0xF6, 0x74, 0x93, 0x45, 0xB5, 0x2B, 0x0B, 0x63, - 0x2E, 0xF1, 0x24, 0x4B, 0x16, 0xD9, 0x61, 0xDB, 0x97, 0x9A, 0xC8, 0xFF, 0xCE, 0x74, 0xE9, 0x39, - 0x93, 0x00, 0xF8, 0xE0, 0x50, 0x62, 0x07, 0x0A, 0x6B, 0xB4, 0xBA, 0x2B, 0x61, 0x09, 0x25, 0x58, - 0x18, 0x0A, 0xB8, 0xDA, 0x8D, 0xFA, 0x8C, 0x4A, 0x41, 0xBE, 0xA4, 0x51, 0x9B, 0x83, 0x14, 0xC4, - 0xB5, 0x81, 0xB0, 0xA1, 0x35, 0x48, 0x34, 0xEB, 0xAF, 0x74, 0xF4, 0x61, 0xC5, 0x00, 0x39, 0x7D, - 0xAD, 0xF1, 0x07, 0x9C, 0x43, 0x20, 0x8F, 0x4B, 0x3D, 0xD3, 0x7C, 0x91, 0x1D, 0xC3, 0x3B, 0x06, - 0x50, 0x59, 0xA9, 0xC9, 0xA3, 0x23, 0xC9, 0xA6, 0x8A, 0x29, 0x84, 0x0D, 0x7D, 0xEE, 0x56, 0x5D, - 0xA1, 0xB6, 0xA3, 0xE7, 0x1F, 0x2A, 0xFB, 0x95, 0x7B, 0xFC, 0x9F, 0x9A, 0x18, 0xEA, 0xFF, 0xFD, - 0x61, 0x75, 0x3A, 0xF2, 0x22, 0xFF, 0xEB, 0xA2, 0x7C, 0x5A, 0x16, 0xB1, 0xE9, 0x93, 0xB0, 0x4D, - 0xA7, 0xA4, 0xB0, 0xAF, 0x70, 0x8C, 0x7E, 0x7D, 0xE8, 0x4F, 0xAA, 0x9D, 0x81, 0xD6, 0xF8, 0xB5, - 0xB6, 0x32, 0xA5, 0x31, 0xA1, 0x55, 0x11, 0x3A, 0x01, 0x13, 0x38, 0x3A, 0x41, 0x7A, 0x79, 0x31, - 0x3C, 0x13, 0xF5, 0x2C, 0x97, 0x28, 0xBD, 0x1F, 0x2E, 0x68, 0xAB, 0xA1, 0x52, 0x5F, 0xBB, 0x2A, - 0xCB, 0x11, 0xFE, 0x4A, 0x34, 0x30, 0xCD, 0xDD, 0x38, 0xAC, 0xED, 0xD0, 0x53, 0xC6, 0xC4, 0x33, - 0xE5, 0x17, 0x41, 0xC8, 0x7D, 0x14, 0x9C, 0x8C, 0x2D, 0x59, 0x61, 0xB1, 0xEC, 0x6A, 0x48, 0xAD, - 0xC7, 0x42, 0x79, 0x9B, 0x63, 0xDB, 0xB0, 0xAD, 0xAF, 0x44, 0x85, 0x2E, 0x24, 0x11, 0xE6, 0x1E, - 0x56, 0xB2, 0x1B, 0x2E, 0x98, 0x7E, 0x64, 0x3D, 0x98, 0x69, 0x51, 0x05, 0x3D, 0x5C, 0x0A, 0x85, - 0xCA, 0x58, 0x0E, 0x11, 0x86, 0xA7, 0xD6, 0xAC, 0xFF, 0x21, 0x12, 0x9F, 0xA1, 0x52, 0xE4, 0xD9, - 0xD5, 0xAC, 0x9B, 0xE2, 0x4B, 0xF0, 0x57, 0xFA, 0xFC, 0x05, 0x84, 0xB6, 0xD9, 0xB0, 0xCE, 0x5E, - 0xA0, 0x73, 0x32, 0xCE, 0x15, 0x29, 0xE8, 0x8F, 0xC4, 0xD9, 0x22, 0x3A, 0x9D, 0x71, 0xC5, 0x37, - 0x2B, 0x33, 0x76, 0x63, 0x49, 0x52, 0x8A, 0x2E, 0x89, 0x6D, 0x5A, 0x04, 0x83, 0xC1, 0xD9, 0x46, - 0xC3, 0x5C, 0x93, 0x6C, 0x3B, 0xDB, 0xFC, 0x1C, 0xC1, 0x65, 0x3B, 0x2C, 0xAD, 0xD5, 0x78, 0x9A, - 0x3A, 0xE4, 0xC3, 0x04, 0x11, 0xD8, 0xBD, 0x63, 0xA9, 0x93, 0x01, 0xF1, 0x42, 0x89, 0x5E, 0x66, - 0x95, 0xF2, 0x75, 0x38, 0x30, 0x4B, 0x39, 0x41, 0x49, 0x54, 0x8E, 0x12, 0x36, 0xFB, 0x9A, 0xA0, - 0x61, 0x13, 0x1C, 0xC2, 0xB2, 0x30, 0x7E, 0xD5, 0x22, 0xEB, 0xA3, 0xB6, 0x69, 0x2E, 0x0F, 0x0B, - 0xB0, 0x29, 0xF3, 0x24, 0x5A, 0x29, 0xA6, 0x3F, 0xC9, 0xC1, 0x56, 0xC5, 0x8E, 0xAA, 0x0B, 0x17, - 0x44, 0xBC, 0xFF, 0xE3, 0x12, 0xB8, 0x3E, 0xA9, 0x16, 0xF9, 0x7F, 0x57, 0x92, 0x7C, 0x0C, 0xFD, - 0x87, 0x9D, 0x70, 0xED, 0x81, 0xD0, 0x77, 0x01, 0x77, 0x71, 0xF5, 0x6C, 0x7F, 0xCC, 0xE4, 0xF0, - 0xAD, 0x27, 0x66, 0x2D, 0x16, 0x7B, 0x4E, 0x95, 0xF9, 0x59, 0xAA, 0x8A, 0x83, 0xE3, 0x1E, 0xD9, - 0x6E, 0x9C, 0x84, 0xEB, 0xBD, 0x5B, 0x33, 0x68, 0xA9, 0x3F, 0xDA, 0x69, 0xCB, 0xF1, 0xC7, 0x64, - 0x99, 0x27, 0xEF, 0xFF, 0xE2, 0x37, 0x34, 0x2D, 0x3C, 0x92, 0xAF, 0x7B, 0xE6, 0x6D, 0x7E, 0xF9, - 0xD2, 0x95, 0x14, 0xF1, 0x01, 0x93, 0xF2, 0xBD, 0xDF, 0x59, 0x67, 0xF6, 0x2D, 0x36, 0xBB, 0x8E, - 0x16, 0xCA, 0x07, 0xEC, 0x34, 0xA0, 0xE2, 0x16, 0x6C, 0xEC, 0x23, 0x41, 0x87, 0x7A, 0x66, 0x82, - 0x09, 0x6A, 0xFE, 0x21, 0xB3, 0x9A, 0xC7, 0x12, 0x0D, 0x07, 0xEB, 0xCF, 0xCB, 0x44, 0x9B, 0xA3, - 0xA1, 0xD9, 0x07, 0x76, 0x1D, 0x93, 0x96, 0x1B, 0x6D, 0xA1, 0x65, 0x6D, 0xB2, 0x62, 0x81, 0x55, - 0xFD, 0xE1, 0x76, 0xF2, 0x6F, 0x9A, 0x71, 0x9F, 0xFC, 0x48, 0x8D, 0x58, 0x1D, 0x3E, 0xFE, 0xBC, - 0x02, 0xB5, 0x36, 0xEE, 0x58, 0x35, 0x82, 0xF3, 0x51, 0x93, 0x35, 0x7E, 0xFA, 0xAF, 0x7E, 0x56, - 0x7E, 0xE8, 0x59, 0x7E, 0x90, 0x73, 0x9B, 0x0E, 0x4D, 0x0D, 0x84, 0x75, 0x30, 0x29, 0xCA, 0xE7, - 0x2C, 0xB3, 0xAC, 0x53, 0x3C, 0xC3, 0x7D, 0x55, 0xCD, 0xE0, 0xB9, 0xF8, 0x44, 0x02, 0xF2, 0x2B, - 0xB7, 0xD1, 0x83, 0x75, 0xDC, 0x96, 0xE7, 0x62, 0x5A, 0x58, 0x63, 0x2D, 0xC1, 0x33, 0xD2, 0x74, - 0x27, 0x05, 0xFD, 0xB7, 0x69, 0x63, 0x34, 0x81, 0xDB, 0xC1, 0x24, 0x10, 0x3A, 0xC2, 0xE2, 0xE9, - 0x75, 0xF8, 0x90, 0x50, 0x3A, 0x3C, 0xAF, 0xCD, 0x4E, 0x78, 0xB0, 0xFA, 0x5F, 0x2C, 0x09, 0x90, - 0xFE, 0xDA, 0xE4, 0x99, 0x8E, 0x3E, 0x63, 0x74, 0x3C, 0x6C, 0xD6, 0xC5, 0x2A, 0x1A, 0xBD, 0x95, - 0xA3, 0xAB, 0xF3, 0xEF, 0x1E, 0x95, 0x02, 0x8E, 0xCB, 0x23, 0xED, 0x11, 0xDB, 0x42, 0x45, 0xD5, - 0x5D, 0xDF, 0xF6, 0xE5, 0x98, 0xB4, 0x46, 0x49, 0x1A, 0xC6, 0x87, 0xFC, 0xA1, 0x79, 0x15, 0xD8, - 0x84, 0x99, 0xFE, 0x0B, 0x33, 0x30, 0x21, 0xA7, 0x59, 0x0A, 0x35, 0xE6, 0x68, 0x62, 0x55, 0x58, - 0xB4, 0x74, 0xDC, 0x80, 0xA4, 0xAD, 0x97, 0x57, 0x08, 0x9D, 0xC9, 0x9C, 0x1C, 0x0E, 0xD6, 0xE5, - 0xE3, 0xC8, 0x13, 0x02, 0xA8, 0xB9, 0x06, 0x27, 0x55, 0x89, 0xE7, 0xA3, 0xBF, 0xB0, 0xA6, 0xD0, - 0x92, 0xAD, 0xDA, 0xFE, 0x9E, 0x38, 0x2B, 0x88, 0x18, 0x7E, 0x3E, 0x90, 0xC3, 0xC0, 0x90, 0xAB, - 0x10, 0x21, 0x49, 0x47, 0xD1, 0x9D, 0x0A, 0xE9, 0x9F, 0xF9, 0xBB, 0x44, 0x83, 0x43, 0xBE, 0xBB, - 0x72, 0xD3, 0x06, 0xB4, 0x1B, 0x11, 0x03, 0xB8, 0xF5, 0xE5, 0x85, 0x1C, 0x4D, 0x7B, 0x0E, 0x65, - 0x33, 0xB0, 0x06, 0xD4, 0x58, 0x1F, 0xC9, 0x52, 0x27, 0xAD, 0xC9, 0xDE, 0x33, 0x4D, 0xC5, 0x45, - 0x6F, 0x11, 0xE1, 0x1D, 0xB9, 0x26, 0xED, 0x5B, 0x9B, 0xF6, 0xFC, 0x87, 0xF7, 0x96, 0x58, 0x5D, - 0xD7, 0x10, 0x15, 0x59, 0x1E, 0x3C, 0xFC, 0xF2, 0x8C, 0x7B, 0xB8, 0x70, 0x35, 0xD2, 0xB3, 0xA2, - 0xF1, 0xE7, 0x9D, 0xC6, 0xAE, 0x37, 0x71, 0xDA, 0x04, 0x32, 0x09, 0x33, 0xF7, 0x7D, 0x45, 0x33, - 0x9F, 0x5C, 0xD6, 0x66, 0xEC, 0x68, 0xCA, 0xEC, 0xBF, 0x4C, 0xF8, 0xA1, 0x4D, 0x5C, 0x41, 0x0E, - 0x69, 0x1F, 0x96, 0xE8, 0xD9, 0x76, 0xB9, 0xEA, 0x04, 0xEF, 0x91, 0xD4, 0xD7, 0x36, 0xEF, 0xE9, - 0xE6, 0x7B, 0x81, 0x31, 0xFD, 0x4E, 0x15, 0x17, 0xF1, 0x25, 0x86, 0x4C, 0x94, 0x2A, 0xAA, 0x50, - 0xB0, 0x98, 0x19, 0xB4, 0x34, 0x81, 0xE2, 0x61, 0xE6, 0xEE, 0x9C, 0x70, 0x72, 0x38, 0xB8, 0xE8, - 0xA6, 0xE1, 0x9F, 0x24, 0xDC, 0xD2, 0x9D, 0xC3, 0x94, 0x43, 0x65, 0x5B, 0x22, 0x45, 0xF2, 0x75, - 0x33, 0x6D, 0xB9, 0x60, 0xC6, 0x9F, 0x0A, 0xC1, 0x1F, 0xFC, 0x8B, 0x7B, 0xAB, 0x71, 0x61, 0xAE, - 0xD2, 0x1B, 0xF6, 0x79, 0x3D, 0x63, 0x1F, 0x4F, 0x1C, 0xDD, 0x4B, 0x50, 0x02, 0x97, 0xCD, 0xF4, - 0xC7, 0x0B, 0xFC, 0xB3, 0xD1, 0x21, 0xD3, 0x73, 0x1B, 0x4B, 0xE8, 0x9F, 0x3D, 0x16, 0x88, 0x0E, - 0x7F, 0xCC, 0x26, 0xA6, 0xF5, 0x8F, 0x69, 0x7F, 0xAC, 0xE8, 0x3F, 0x7B, 0x29, 0x81, 0xDA, 0x14, - 0x8F, 0x98, 0x78, 0x11, 0x34, 0x46, 0x60, 0xAD, 0x9E, 0xB3, 0x69, 0xFD, 0x74, 0x95, 0x3A, 0x14, - 0x30, 0xBE, 0x34, 0xE2, 0xAC, 0x54, 0x81, 0x70, 0x1F, 0x47, 0xD7, 0x5A, 0xDE, 0x81, 0x29, 0x17, - 0x9B, 0x3F, 0xC7, 0x57, 0x56, 0x26, 0xCD, 0xF8, 0x3B, 0x4E, 0x94, 0x4E, 0xA4, 0x09, 0x46, 0x1A, - 0x6D, 0xA3, 0x44, 0x51, 0xA9, 0x9F, 0x97, 0x88, 0x5E, 0x5E, 0x70, 0xCA, 0xDE, 0xA4, 0xAF, 0x6D, - 0xBC, 0xCE, 0xF6, 0x67, 0x81, 0x10, 0xD3, 0xF5, 0xB8, 0xC9, 0x49, 0xF3, 0x98, 0x71, 0x2D, 0x29, - 0xBD, 0x34, 0x08, 0x25, 0x1B, 0x9A, 0x6F, 0xC3, 0x4D, 0xC3, 0x9F, 0x5E, 0xE2, 0xA2, 0xF3, 0x82, - 0x52, 0xA9, 0xF6, 0x79, 0x14, 0x6F, 0xD0, 0x12, 0xB6, 0x0D, 0x4C, 0xAC, 0x3E, 0x2A, 0x8C, 0x86, - 0xE1, 0xFF, 0x1C, 0x49, 0x43, 0xF2, 0x1D, 0x34, 0xA3, 0x0F, 0xA3, 0x9B, 0x2C, 0xF3, 0x9C, 0xFC, - 0x23, 0x4B, 0xE0, 0xCB, 0xE6, 0xBE, 0x7E, 0x8B, 0x51, 0x2D, 0x32, 0x92, 0xCC, 0xC6, 0xDB, 0x36, - 0x1B, 0x83, 0x80, 0x64, 0xD2, 0x23, 0x1C, 0x60, 0x90, 0x1C, 0x71, 0x06, 0x0F, 0x30, 0xC0, 0xDF, - 0xFE, 0xF7, 0x50, 0x5A, 0xF8, 0x9C, 0x97, 0x29, 0xFB, 0x7B, 0xEB, 0x91, 0x6A, 0x42, 0xE4, 0xAB, - 0x62, 0xB4, 0x1F, 0x14, 0xEC, 0x1A, 0x9F, 0xC4, 0x98, 0x77, 0x85, 0x8B, 0xF1, 0x15, 0x2B, 0x2C, - 0x3F, 0xAB, 0x3A, 0x5E, 0xD3, 0x50, 0x32, 0xDD, 0x23, 0x81, 0x89, 0x3B, 0xB8, 0xFD, 0x49, 0x78, - 0xA9, 0x35, 0x20, 0x2D, 0xBC, 0xFC, 0x10, 0x8A, 0x08, 0xA0, 0x57, 0x24, 0xFA, 0x29, 0xD3, 0x9C, - 0xC0, 0xC5, 0x06, 0xF2, 0x7D, 0xC4, 0x45, 0x38, 0x1F, 0xC6, 0xE4, 0xC8, 0x23, 0x65, 0xD2, 0x5A, - 0xE5, 0xCD, 0x63, 0x14, 0x56, 0x03, 0xAA, 0x29, 0x82, 0xAB, 0x67, 0x92, 0x2C, 0x71, 0x67, 0x6A, - 0x36, 0xF9, 0xE1, 0x89, 0xD2, 0x98, 0x88, 0x97, 0x65, 0x72, 0xE4, 0x3C, 0x5A, 0x1D, 0xB7, 0x34, - 0x4D, 0x01, 0x91, 0x5D, 0xC4, 0xAF, 0x88, 0x2F, 0xD1, 0x27, 0x26, 0x36, 0x16, 0x98, 0x39, 0x9A, - 0xEA, 0xFA, 0xDF, 0x3B, 0x7F, 0xD8, 0x76, 0x95, 0xDB, 0x03, 0x82, 0x86, 0xD0, 0x6D, 0x15, 0xD0, - 0xF0, 0xB9, 0xCC, 0xB9, 0xD6, 0xE1, 0x9C, 0xC7, 0xAE, 0x3C, 0xA8, 0xB9, 0x49, 0xA3, 0xC4, 0xB3, - 0x24, 0x3A, 0xA3, 0x50, 0x7E, 0xDF, 0xBE, 0x5F, 0xAF, 0xC3, 0x7C, 0x3C, 0xC7, 0x39, 0xD9, 0x29, - 0x06, 0xD5, 0x0B, 0xE8, 0xFA, 0x80, 0xC2, 0xCE, 0xA8, 0xD9, 0x20, 0xCE, 0x28, 0x0A, 0xDE, 0x15, - 0xB5, 0x0D, 0x9A, 0xB8, 0xB0, 0x7B, 0x33, 0xB8, 0x35, 0xEB, 0x4E, 0xDE, 0xF5, 0x9F, 0x66, 0x79, - 0x52, 0x44, 0xD2, 0x49, 0x3A, 0x94, 0xE2, 0xCB, 0x83, 0x22, 0x7D, 0xC6, 0x1C, 0xEB, 0x44, 0x28, - 0xE9, 0x38, 0x8F, 0xB7, 0xF6, 0x3D, 0x39, 0x8F, 0x64, 0x9F, 0x86, 0x85, 0x27, 0x7E, 0xBF, 0xD8, - 0xC3, 0x8B, 0x70, 0xF9, 0x7A, 0xE6, 0x19, 0xAF, 0xA8, 0x8F, 0x6C, 0x38, 0xE2, 0xB4, 0x1E, 0xF3, - 0xDD, 0xFD, 0x6C, 0xB4, 0x04, 0xB4, 0xD1, 0x37, 0xF4, 0x59, 0xFF, 0x5A, 0x8B, 0x73, 0x6B, 0x62, - 0x6C, 0x91, 0x23, 0x96, 0x61, 0xEC, 0x9F, 0xF6, 0x83, 0x18, 0xD9, 0xEE, 0xEF, 0x00, 0xB0, 0xEB, - 0x8D, 0xC6, 0x35, 0xCE, 0xB4, 0xE0, 0xBB, 0x84, 0xD3, 0xD7, 0xDB, 0x77, 0x4A, 0x07, 0xE7, 0x3B, - 0xF7, 0x12, 0xF8, 0x9D, 0xF5, 0x0A, 0xDF, 0xF4, 0x1B, 0x00, 0x1A, 0x77, 0xD9, 0x03, 0x21, 0xC2, - 0x46, 0xF7, 0x7E, 0x4B, 0xE2, 0xC1, 0xF1, 0x8D, 0xFE, 0x61, 0xB9, 0xD4, 0x0B, 0xC9, 0x65, 0x82, - 0xCF, 0x7F, 0x3D, 0x24, 0x9E, 0xC9, 0x97, 0x30, 0xE9, 0x81, 0xB4, 0x6B, 0xA5, 0x6A, 0xA7, 0xED, - 0xE3, 0x8F, 0x88, 0x09, 0x78, 0x36, 0x6A, 0x14, 0xB9, 0xBB, 0x93, 0xE6, 0xA2, 0x07, 0x72, 0x81, - 0xD2, 0x41, 0x75, 0x28, 0x50, 0x57, 0xDE, 0x68, 0x04, 0xB1, 0x0F, 0x1F, 0xCF, 0x0F, 0x3E, 0xCB, - 0x44, 0x3D, 0x2A, 0x01, 0xC1, 0x38, 0x61, 0x8E, 0xA1, 0x13, 0xB8, 0x82, 0x3F, 0xAC, 0xA7, 0x31, - 0x7B, 0xF7, 0xA7, 0xCD, 0xBF, 0x15, 0xD3, 0xC2, 0xCC, 0xDC, 0xD0, 0xB2, 0xC1, 0x44, 0xBA, 0x82, - 0x85, 0x2D, 0x59, 0x53, 0xE4, 0xBE, 0x6B, 0x69, 0x8F, 0x5C, 0x20, 0x38, 0x76, 0xE0, 0x49, 0x59, - 0x32, 0x0A, 0x90, 0x42, 0x13, 0x35, 0x24, 0x71, 0xD9, 0x98, 0x9A, 0x0F, 0x0A, 0x83, 0x90, 0x47, - 0xD0, 0x57, 0x29, 0xC8, 0xF5, 0x5B, 0xA8, 0x5D, 0x41, 0xCD, 0x61, 0x98, 0x5C, 0x28, 0x1B, 0xF2, - 0x9B, 0x31, 0x3F, 0x14, 0x79, 0x37, 0xEA, 0xDD, 0x42, 0xD3, 0x59, 0x20, 0x0D, 0x5A, 0x3D, 0x59, - 0x84, 0x1A, 0x48, 0x28, 0x6D, 0x48, 0x3B, 0x0C, 0x87, 0xB0, 0xBB, 0xEF, 0x72, 0x91, 0x85, 0xE0, - 0x9A, 0x2C, 0x78, 0xAF, 0xFE, 0x0D, 0x6D, 0x9A, 0x99, 0x10, 0x16, 0x7D, 0x42, 0x76, 0xA0, 0xAA, - 0xC7, 0xF9, 0x11, 0x5C, 0x04, 0x83, 0x0A, 0xA9, 0x48, 0x65, 0x28, 0x81, 0x65, 0x2E, 0xA7, 0x5A, - 0xFE, 0xDB, 0x10, 0x56, 0xEA, 0x19, 0x67, 0xC2, 0x61, 0xBB, 0x9B, 0x6B, 0x48, 0x4F, 0x22, 0x4C, - 0xB7, 0xEC, 0x15, 0x84, 0x08, 0x1A, 0xFE, 0x08, 0x46, 0xCA, 0x72, 0x10, 0x30, 0x81, 0xAE, 0xE7, - 0x1B, 0xAA, 0x2F, 0x1B, 0x22, 0x6A, 0x89, 0x95, 0x34, 0x9F, 0x53, 0xE4, 0xDA, 0x0B, 0x1B, 0x56, - 0xB4, 0xB7, 0x71, 0x99, 0xB8, 0x77, 0x91, 0xEB, 0x59, 0x61, 0x71, 0x84, 0xAF, 0x55, 0xBD, 0x33, - 0x1C, 0xD9, 0x7A, 0x40, 0xD3, 0x7B, 0x6C, 0xB0, 0xA4, 0x96, 0x07, 0x57, 0x49, 0x9C, 0xC1, 0x0B, - 0x23, 0xF3, 0xE5, 0x36, 0xA4, 0xE8, 0xE1, 0xEC, 0x51, 0xF1, 0xBB, 0x7B, 0x40, 0x4B, 0x05, 0xD1, - 0x3D, 0xD6, 0x6D, 0x22, 0x7C, 0x9D, 0x51, 0x28, 0x70, 0xF6, 0xB3, 0x0C, 0x6F, 0xB2, 0xE1, 0xBC, - 0xFF, 0xB8, 0xA3, 0x92, 0x7C, 0x0A, 0xA3, 0x36, 0x6D, 0xF8, 0xFC, 0x27, 0x45, 0x58, 0x94, 0xE0, - 0x0A, 0x90, 0xF8, 0x2A, 0xF3, 0x02, 0xA4, 0x98, 0xD8, 0xEF, 0x1C, 0x53, 0xE2, 0x47, 0xC7, 0x20, - 0xB2, 0x6F, 0xB7, 0x39, 0x5A, 0xA9, 0x49, 0xC2, 0x65, 0x18, 0x50, 0xBD, 0x7F, 0xB0, 0xDE, 0xBB, - 0x2F, 0x56, 0xDD, 0x62, 0x85, 0xAC, 0x3B, 0x7E, 0xCD, 0x00, 0x88, 0x7A, 0x22, 0xC5, 0x03, 0x03, - 0x26, 0xC4, 0x27, 0x09, 0xE8, 0x16, 0x36, 0xB7, 0x0B, 0xDF, 0xDA, 0x21, 0xEB, 0x59, 0xE8, 0x6D, - 0x96, 0x2D, 0x18, 0x89, 0xD4, 0x4E, 0x5A, 0x66, 0x63, 0x31, 0x15, 0xF0, 0x48, 0x50, 0x7A, 0xF3, - 0xA7, 0x82, 0xE0, 0x91, 0x04, 0xB2, 0x16, 0xAC, 0xA1, 0xD4, 0xC1, 0xE4, 0xBD, 0xC9, 0x43, 0x83, - 0xD9, 0x18, 0x11, 0x50, 0xC0, 0x93, 0x9D, 0x6B, 0x17, 0x63, 0xC8, 0xA3, 0xAF, 0xAC, 0xBF, 0x29, - 0x65, 0xA6, 0x4A, 0xE4, 0xCD, 0xE2, 0x89, 0x59, 0xF8, 0x96, 0xF8, 0x3B, 0x80, 0xCA, 0x68, 0xF2, - 0xBF, 0xBE, 0xFD, 0xD0, 0x84, 0x88, 0xE3, 0x3D, 0x08, 0x8A, 0x08, 0x39, 0xDC, 0x88, 0x71, 0x61, - 0x76, 0xAD, 0xB6, 0xBE, 0xC0, 0xA4, 0x28, 0xEE, 0x38, 0x8F, 0x2E, 0x8D, 0x3A, 0x28, 0xAE, 0xEB, - 0x93, 0x7E, 0xF4, 0x2E, 0x5F, 0x3B, 0xEA, 0x37, 0x9A, 0x53, 0x6C, 0xC5, 0x3A, 0x2F, 0x7F, 0xA9, - 0x80, 0x85, 0x18, 0xFE, 0x14, 0x0C, 0x37, 0xA7, 0xE2, 0x78, 0x90, 0x20, 0x1F, 0x41, 0x1C, 0x03, - 0xD1, 0xD0, 0x8C, 0xB2, 0x2D, 0x4C, 0x32, 0x81, 0x63, 0xF6, 0x6F, 0xD3, 0x7F, 0xB4, 0x6D, 0xA8, - 0xD6, 0xE0, 0x56, 0x84, 0xAD, 0x37, 0x96, 0x44, 0xB4, 0xAE, 0x6F, 0x49, 0x3E, 0x30, 0x0C, 0x79, - 0xE3, 0x93, 0xBA, 0xD2, 0x10, 0x71, 0xAC, 0x7C, 0x06, 0x89, 0x26, 0xCB, 0x72, 0x9E, 0xC4, 0xCC, - 0xBB, 0xA1, 0xDE, 0x9B, 0x66, 0x75, 0x6F, 0xAC, 0x51, 0x93, 0xE8, 0xF4, 0x43, 0xE4, 0x79, 0xF2, - 0x50, 0x67, 0x3D, 0x1B, 0x33, 0xB5, 0xEC, 0x93, 0x10, 0xCE, 0x78, 0x3C, 0x0C, 0x25, 0x44, 0x30, - 0x3C, 0xAB, 0x40, 0x6F, 0x4B, 0x54, 0x0C, 0x38, 0xD4, 0xEF, 0x18, 0xED, 0xA5, 0x75, 0x1E, 0x9C, - 0x06, 0x42, 0x11, 0x9D, 0xEC, 0xE8, 0x81, 0x38, 0xBE, 0xEF, 0x21, 0xB5, 0x0A, 0xC3, 0x38, 0x94, - 0x0C, 0x5A, 0xE2, 0x47, 0xDC, 0x2E, 0x82, 0xC3, 0xA6, 0x9D, 0xA6, 0x54, 0x5E, 0xE6, 0x7C, 0xFE, - 0x7E, 0x7B, 0x86, 0x9A, 0x54, 0xEC, 0xCD, 0xE5, 0x9F, 0xF7, 0x23, 0xDE, 0x06, 0x90, 0x93, 0xB6, - 0xCC, 0xC8, 0x3D, 0x75, 0xA6, 0x43, 0xEA, 0x1F, 0x44, 0xAB, 0xBB, 0x15, 0xC4, 0xAB, 0xB1, 0xDF, - 0xE9, 0x30, 0xB4, 0xB2, 0x3B, 0x5B, 0xA6, 0x57, 0xEE, 0x25, 0x4B, 0x83, 0x26, 0xE4, 0x6B, 0xE3, - 0x35, 0x62, 0xA5, 0xD2, 0xB6, 0xDE, 0xFD, 0x5F, 0x8C, 0x21, 0xF8, 0x15, 0x41, 0x1C, 0x61, 0xCD, - 0x78, 0x0F, 0x61, 0x9E, 0x0C, 0x7E, 0x88, 0xE3, 0x34, 0x7F, 0x0B, 0x00, 0x5D, 0x8A, 0x37, 0x5F, - 0xFB, 0x65, 0xB8, 0xEC, 0x6C, 0x6A, 0x7E, 0x8F, 0x70, 0x6A, 0x17, 0xFB, 0x6B, 0x9D, 0xD8, 0xC3, - 0xD5, 0x13, 0x49, 0xEC, 0xD0, 0xEC, 0x1B, 0xC7, 0x79, 0xBB, 0xD2, 0x89, 0x96, 0x39, 0x1C, 0xF3, - 0x70, 0xEA, 0xF0, 0xEA, 0x6B, 0x45, 0x51, 0xDB, 0x1A, 0x61, 0x60, 0x98, 0x1C, 0x7A, 0xA6, 0x48, - 0x65, 0xDA, 0x85, 0xBE, 0x6B, 0xC4, 0x27, 0x2F, 0x76, 0x6D, 0x5F, 0x4C, 0xDE, 0x92, 0xA1, 0xB3, - 0xD4, 0x11, 0xB4, 0x0B, 0x3A, 0x4C, 0x73, 0xC3, 0xAA, 0x9C, 0x0F, 0x95, 0x9B, 0x2C, 0x67, 0x02, - 0x47, 0xCD, 0xE3, 0x75, 0x84, 0x60, 0x5E, 0x17, 0xAB, 0xF0, 0xBC, 0xBE, 0xB4, 0xAA, 0x4C, 0xEA, - 0x11, 0x52, 0x87, 0xAC, 0x16, 0x56, 0x06, 0x1F, 0xC1, 0x97, 0xF9, 0xAB, 0x26, 0xD9, 0xCC, 0x58, - 0x01, 0xFF, 0x44, 0x21, 0xFE, 0x5D, 0x53, 0x0B, 0xA2, 0xAF, 0xBC, 0x9D, 0x63, 0x25, 0x87, 0x66, - 0xB3, 0x79, 0xB4, 0x9F, 0x49, 0xE6, 0x6E, 0xCB, 0x8B, 0x39, 0x8C, 0x46, 0x60, 0x3D, 0x5B, 0xEC, - 0x08, 0x1B, 0xB2, 0xEC, 0xA2, 0xAA, 0x9A, 0xDA, 0xAA, 0xAD, 0x25, 0xAB, 0x45, 0x99, 0x63, 0x23, - 0x6C, 0x53, 0x87, 0xA0, 0x5A, 0x6C, 0xD6, 0xE3, 0x6C, 0x34, 0x42, 0x0F, 0xF3, 0xA0, 0x23, 0xD3, - 0x16, 0x05, 0xAB, 0x05, 0x14, 0xA8, 0xA9, 0x02, 0x23, 0xFC, 0xC0, 0xED, 0x75, 0xC5, 0x43, 0x7C, - 0x1E, 0xB1, 0x69, 0xB6, 0x01, 0x96, 0x7B, 0x9E, 0x12, 0x1C, 0x72, 0x42, 0x0D, 0xAB, 0x0B, 0x79, - 0x22, 0xF3, 0xF0, 0xEB, 0x71, 0x83, 0x42, 0x3C, 0x11, 0xC7, 0x4F, 0x87, 0xFF, 0x5D, 0x19, 0x0B, - 0xE4, 0x1E, 0xC3, 0xA2, 0xD7, 0x0E, 0x9C, 0x3C, 0x7D, 0xFB, 0x4F, 0xDA, 0x99, 0x9F, 0xF8, 0x3E, - 0xD4, 0xA0, 0xA2, 0xF8, 0x83, 0x33, 0x1E, 0xE2, 0x1C, 0x52, 0x9D, 0xB8, 0x63, 0x8F, 0xA1, 0x4D, - 0x68, 0xAE, 0xCE, 0xD4, 0x12, 0x8E, 0x96, 0xA1, 0x78, 0x27, 0x6A, 0x29, 0x11, 0x19, 0x4C, 0x94, - 0x89, 0x0F, 0xFB, 0x7C, 0xA8, 0xAC, 0x7E, 0x84, 0x44, 0xC8, 0x7A, 0x18, 0xAE, 0x34, 0x0F, 0x6E, - 0x90, 0xDB, 0x1E, 0x79, 0xFA, 0xE8, 0xAF, 0x71, 0xE4, 0x80, 0x24, 0x53, 0x2F, 0xB6, 0xC2, 0x12, - 0x1F, 0xA0, 0x44, 0x98, 0x40, 0xAE, 0x01, 0xD6, 0xFB, 0x86, 0xBB, 0xC6, 0xF7, 0x2F, 0x38, 0x41, - 0xE3, 0x2E, 0x1F, 0x2E, 0x7C, 0x90, 0x1F, 0xD9, 0xD3, 0x34, 0x86, 0xC8, 0xA3, 0x8E, 0xAB, 0x5E, - 0x05, 0x55, 0x71, 0x5B, 0x21, 0xB7, 0x2F, 0x9E, 0x56, 0x32, 0x56, 0xD1, 0xDC, 0xC9, 0xDA, 0xDE, - 0xAC, 0x1D, 0x91, 0x0E, 0x4D, 0x1F, 0x4F, 0xE7, 0x31, 0xFE, 0x9A, 0x3F, 0x18, 0xAD, 0x85, 0x4E, - 0x66, 0x95, 0x76, 0x67, 0x6A, 0xC8, 0x90, 0x6A, 0xB5, 0xB0, 0x7D, 0xB2, 0xB3, 0xD7, 0xD6, 0x42, - 0xF1, 0x63, 0x52, 0xBD, 0x72, 0xE1, 0xD2, 0x63, 0x9A, 0x00, 0x45, 0x8E, 0x77, 0xCF, 0x93, 0xCF, - 0x1A, 0x31, 0xAA, 0x16, 0xA9, 0xCF, 0x45, 0xE3, 0x99, 0x3E, 0x6C, 0x70, 0xE9, 0x93, 0x83, 0x78, - 0x11, 0xB8, 0x80, 0xEA, 0x75, 0x5A, 0x87, 0xCE, 0x1D, 0xCD, 0x12, 0x5F, 0x1F, 0x6F, 0x86, 0x25, - 0x5E, 0x95, 0x22, 0x07, 0xFE, 0x29, 0xDA, 0x93, 0x52, 0x41, 0x62, 0x79, 0x06, 0x06, 0x83, 0xAE, - 0x42, 0x35, 0x5C, 0x9E, 0x01, 0xF8, 0xFA, 0x3F, 0x07, 0x15, 0xCA, 0x02, 0x69, 0x8E, 0xEA, 0x9E, - 0xEF, 0xF4, 0x99, 0x26, 0x73, 0x42, 0xC2, 0xEC, 0x0F, 0xEC, 0x03, 0x8F, 0x66, 0xC1, 0x88, 0x76, - 0xC5, 0xC2, 0x55, 0x46, 0x59, 0xC4, 0x28, 0x55, 0x93, 0xBF, 0x7C, 0x1C, 0x5C, 0xA0, 0xBA, 0x8A, - 0xCA, 0x8A, 0x81, 0x6C, 0xA3, 0xDE, 0x2D, 0x63, 0xC5, 0xCA, 0x0B, 0x8E, 0x99, 0xC9, 0xE4, 0x7E, - 0x32, 0x36, 0xD8, 0xFA, 0x80, 0xA5, 0x93, 0x4F, 0x5C, 0x97, 0x33, 0x74, 0xD2, 0x03, 0xFF, 0xFD, - 0x57, 0x84, 0x26, 0x62, 0x6A, 0x4C, 0x15, 0x45, 0xB9, 0x7C, 0xCD, 0xD8, 0x7B, 0xC5, 0x70, 0xA1, - 0xCB, 0xB4, 0xDE, 0xA6, 0xBD, 0xE0, 0xE9, 0x49, 0xB7, 0xEA, 0x21, 0x17, 0xCD, 0x0C, 0xA7, 0xF2, - 0x9B, 0xB6, 0x26, 0x06, 0xB1, 0x63, 0x3D, 0x0D, 0x1A, 0xAE, 0x57, 0xF1, 0x53, 0xDA, 0x61, 0x47, - 0x7E, 0x66, 0xC0, 0x2A, 0xAC, 0x7E, 0xE8, 0xE9, 0x4F, 0xC2, 0x21, 0x01, 0x0B, 0x9C, 0xA7, 0x98, - 0x05, 0x3A, 0x34, 0x68, 0x19, 0x26, 0x35, 0x57, 0xF7, 0xF8, 0xE0, 0x77, 0x7B, 0x42, 0x8D, 0xE0, - 0xD3, 0x08, 0x49, 0x62, 0x1D, 0x86, 0xBE, 0xC8, 0xDC, 0x2F, 0xE0, 0xFF, 0xC4, 0x6E, 0xBD, 0xEC, - 0x8B, 0x33, 0xF1, 0x61, 0x6E, 0x96, 0xEB, 0xEA, 0x87, 0x4C, 0xA3, 0x5F, 0x97, 0x92, 0x22, 0x0C, - 0x36, 0x05, 0xA5, 0xC1, 0xF6, 0xB8, 0xF5, 0xE0, 0xE4, 0x91, 0x73, 0x73, 0xD0, 0x38, 0x81, 0x24, - 0x13, 0xB4, 0x4B, 0xAB, 0x4C, 0xBB, 0x15, 0x56, 0xC2, 0x66, 0xF9, 0x27, 0xEF, 0xE0, 0x3D, 0x4E, - 0xDB, 0x12, 0xCB, 0xC1, 0xDE, 0x57, 0x1B, 0x7F, 0x69, 0x10, 0xE4, 0x6E, 0xF7, 0xCC, 0x0F, 0x64, - 0x31, 0x6A, 0xBF, 0x49, 0x6C, 0xF8, 0x9E, 0xC9, 0x37, 0xF9, 0x26, 0x32, 0x4A, 0x26, 0x97, 0x99, - 0x30, 0xA6, 0x86, 0x82, 0xCE, 0x04, 0x8B, 0xFB, 0x39, 0x3B, 0xEF, 0x05, 0xAE, 0x3F, 0xFD, 0xEA, - 0x21, 0xA7, 0xF9, 0xD8, 0x2D, 0x34, 0x42, 0xE4, 0xDC, 0x40, 0x1C, 0x82, 0x94, 0x89, 0xC4, 0x74, - 0x0C, 0xF6, 0x76, 0x65, 0x13, 0x29, 0x85, 0xE7, 0xF6, 0x8C, 0x19, 0x3D, 0xC2, 0x69, 0x79, 0x07, - 0x8C, 0x47, 0x24, 0x24, 0x4C, 0xD6, 0x41, 0x93, 0x70, 0x40, 0x08, 0x6D, 0x49, 0x4D, 0x92, 0xAA, - 0x9D, 0x02, 0xAB, 0x53, 0x8D, 0x8C, 0x96, 0x75, 0x54, 0xD0, 0xA2, 0x45, 0xBA, 0x19, 0x81, 0xFE, - 0x20, 0xCC, 0x93, 0x78, 0x4D, 0xBB, 0xA2, 0x21, 0xAB, 0xB5, 0x1B, 0x47, 0x0C, 0xA2, 0x34, 0x24, - 0x1E, 0xF3, 0x40, 0xF3, 0xC8, 0x79, 0xAE, 0x00, 0x40, 0xC3, 0xC4, 0x1B, 0x41, 0x5E, 0xF4, 0x08, - 0x7D, 0x15, 0xF1, 0xDF, 0xE2, 0x34, 0x78, 0xC3, 0x2A, 0x91, 0x8D, 0xC1, 0xA7, 0xF4, 0xD0, 0xF9, - 0xE7, 0x4E, 0x9F, 0xDC, 0x56, 0x16, 0x6C, 0x5B, 0x48, 0x10, 0x7E, 0xE9, 0xA6, 0x3F, 0x3B, 0xD0, - 0xFD, 0x12, 0x46, 0x1B, 0xFF, 0x61, 0x76, 0x61, 0xCC, 0x24, 0x1C, 0x94, 0xDF, 0x77, 0x6F, 0xAE, - 0x8E, 0xEE, 0x96, 0xF6, 0x9B, 0xB4, 0xE9, 0xA5, 0x1E, 0x6D, 0x7C, 0x2C, 0x43, 0xFB, 0x74, 0xF3, - 0x23, 0x86, 0xE6, 0x07, 0xC7, 0x36, 0xE3, 0xED, 0xAF, 0xDD, 0x75, 0x61, 0xCD, 0xFE, 0xEE, 0x4B, - 0x82, 0xF7, 0xC7, 0x66, 0x2B, 0x4C, 0xFF, 0x97, 0x77, 0x1A, 0xF5, 0xA5, 0x55, 0xF2, 0xBD, 0xC0, - 0xD4, 0xD8, 0x07, 0x2A, 0x92, 0xB0, 0x04, 0x56, 0x55, 0x3F, 0x1B, 0xCA, 0x21, 0x25, 0x3F, 0xB9, - 0x81, 0x01, 0x94, 0x43, 0xEE, 0x83, 0xD5, 0x10, 0xB4, 0x13, 0x19, 0xC0, 0x06, 0xBA, 0xEF, 0xA3, - 0xE4, 0xEC, 0xD8, 0x66, 0x30, 0x58, 0xA2, 0xE7, 0x81, 0x65, 0xDA, 0xA1, 0x35, 0x28, 0x4B, 0x47, - 0x17, 0x95, 0xA3, 0x8C, 0x67, 0x44, 0xC8, 0x8B, 0x1B, 0x5F, 0xE9, 0x0E, 0x99, 0xA3, 0x39, 0xAF, - 0x5C, 0xCA, 0x0D, 0x68, 0xAD, 0xE0, 0x91, 0xF3, 0x95, 0x54, 0x02, 0xFF, 0xC4, 0x23, 0xA1, 0x2E, - 0xCE, 0xD2, 0xFC, 0x34, 0x5A, 0xF0, 0x83, 0x82, 0x54, 0x07, 0xDE, 0x21, 0x0D, 0xE3, 0xDF, 0x86, - 0xC1, 0x6E, 0xAB, 0x95, 0x28, 0x90, 0xED, 0x3B, 0x93, 0x95, 0x9E, 0xDE, 0xBA, 0x3E, 0x32, 0x85, - 0x0F, 0xB9, 0x62, 0x68, 0x00, 0x93, 0x38, 0xF9, 0x6B, 0x36, 0x5E, 0xAB, 0x9F, 0xDD, 0x84, 0x97, - 0xB8, 0xAB, 0xDA, 0x29, 0x88, 0xEC, 0x9D, 0xFA, 0xAA, 0x34, 0x2B, 0x1E, 0xC0, 0x6C, 0x53, 0xD4, - 0x55, 0x40, 0x45, 0x9F, 0xEC, 0x0A, 0x90, 0x51, 0xC5, 0x7A, 0x8A, 0xF6, 0xEE, 0x62, 0xC2, 0xE9, - 0x57, 0x2A, 0x1D, 0x8F, 0xB6, 0x83, 0xF9, 0x44, 0x42, 0x33, 0x2A, 0x3D, 0xC7, 0x46, 0xDA, 0xCA, - 0xBC, 0x6B, 0x49, 0x7F, 0x94, 0xB0, 0x6C, 0x80, 0xEC, 0x76, 0x96, 0x12, 0xB9, 0x05, 0x47, 0x96, - 0x84, 0x98, 0xCF, 0x8F, 0x21, 0xF5, 0x6B, 0x86, 0xB8, 0xD4, 0x80, 0xBA, 0xEA, 0x3C, 0xF6, 0x7A, - 0x98, 0xE9, 0x1A, 0x5E, 0x2C, 0x69, 0x1A, 0x2A, 0x31, 0xB9, 0xE6, 0x28, 0xA3, 0xCA, 0xC2, 0x70, - 0xDB, 0xF0, 0x30, 0x28, 0xD3, 0xD6, 0x17, 0xAD, 0x73, 0x8D, 0xB3, 0xF5, 0xFD, 0xA3, 0x6D, 0x8A, - 0xAE, 0x7A, 0x69, 0xD7, 0x6E, 0x4C, 0x29, 0x44, 0xBD, 0x57, 0xBA, 0xC9, 0xFD, 0xA1, 0xEF, 0xA9, - 0xA0, 0x98, 0x39, 0x7A, 0x05, 0x61, 0x46, 0x55, 0x77, 0x5C, 0x1A, 0x39, 0x38, 0x98, 0xFA, 0x79, - 0x9A, 0xBC, 0x68, 0xDB, 0x29, 0x51, 0xDD, 0x2C, 0xEC, 0xFA, 0x61, 0x93, 0x93, 0x44, 0xF2, 0x7E, - 0xD7, 0xA2, 0x79, 0xF1, 0xBD, 0x19, 0x81, 0x36, 0x04, 0x3A, 0x26, 0x20, 0x07, 0x3E, 0x01, 0x8E, - 0x16, 0xE0, 0x6F, 0xF6, 0x29, 0xB8, 0x0B, 0xAC, 0x37, 0x19, 0x39, 0x91, 0x09, 0x23, 0xA6, 0x9C, - 0xAD, 0x08, 0x70, 0xA8, 0x66, 0x0A, 0x22, 0xA2, 0x2E, 0xC5, 0xB9, 0x7F, 0x58, 0xC0, 0x2F, 0x07, - 0x61, 0xB9, 0x2D, 0x3F, 0xA9, 0xB1, 0x67, 0x52, 0xC1, 0x1C, 0x2C, 0xB4, 0xFC, 0x02, 0xA8, 0x4F, - 0x71, 0x87, 0x7F, 0x42, 0x35, 0x93, 0x25, 0xF5, 0x81, 0x07, 0xF9, 0x75, 0x01, 0xBE, 0x08, 0x15, - 0xC5, 0xD1, 0xED, 0x91, 0xB6, 0x0B, 0xC8, 0x8B, 0x4D, 0x62, 0x54, 0xD7, 0x14, 0x9C, 0x3E, 0xEA, - 0x15, 0x3E, 0x91, 0x4F, 0x2F, 0xB5, 0x5C, 0x5A, 0x13, 0x6D, 0x24, 0xE5, 0xB1, 0xA2, 0xFC, 0xAF, - 0x5F, 0x85, 0x13, 0x52, 0x9F, 0x80, 0x19, 0xBB, 0xB7, 0x9A, 0xC6, 0x92, 0x49, 0x2D, 0x28, 0xA7, - 0xA2, 0x28, 0xFA, 0x4A, 0x7B, 0xBA, 0x99, 0x15, 0xA9, 0xF3, 0x51, 0xED, 0xA5, 0xD7, 0x9A, 0xC1, - 0x7A, 0x1E, 0x77, 0x57, 0xBB, 0xA7, 0x25, 0x10, 0xE9, 0x69, 0xAC, 0x50, 0xEF, 0xEC, 0x85, 0x02, - 0x52, 0xC9, 0x29, 0xE9, 0xCB, 0xC8, 0xD0, 0x2D, 0x43, 0xAD, 0x26, 0x93, 0xA8, 0x12, 0xE3, 0xEB, - 0xB1, 0x1E, 0xA2, 0x8D, 0xE4, 0xF7, 0x8F, 0x4B, 0x55, 0xE7, 0xD7, 0x98, 0x3B, 0x7B, 0x85, 0x16, - 0xEE, 0x5A, 0xD8, 0x61, 0x65, 0x57, 0xBC, 0x74, 0x62, 0xD3, 0xDC, 0x7C, 0x6D, 0xCC, 0x56, 0xB0, - 0x3B, 0xA7, 0xE9, 0x10, 0xDE, 0x6A, 0xF4, 0x3A, 0xEC, 0x7E, 0x2E, 0xD0, 0x1E, 0x81, 0x48, 0xD3, - 0xEC, 0xD7, 0xC5, 0xDB, 0x16, 0xBD, 0xD5, 0x5B, 0xAD, 0x8E, 0x13, 0x5A, 0x2A, 0x9E, 0x1A, 0x96, - 0xC3, 0x7E, 0x23, 0xAD, 0xA7, 0x45, 0xE0, 0xCE, 0xA4, 0x52, 0x0C, 0x2A, 0x2E, 0x84, 0x9D, 0xB3, - 0xB4, 0x21, 0x18, 0xA7, 0xCF, 0x57, 0xA3, 0xFE, 0xA1, 0x27, 0x99, 0xCE, 0x48, 0x1E, 0xA7, 0xDB, - 0x62, 0x13, 0x9B, 0x19, 0xE3, 0xBF, 0xAA, 0xA2, 0x9D, 0x29, 0xC9, 0x92, 0xD1, 0x5A, 0x43, 0x4E, - 0xC4, 0xF8, 0xB4, 0xD9, 0xFC, 0xBD, 0x1A, 0xBB, 0x4D, 0x23, 0x99, 0xF3, 0x86, 0xE6, 0xBC, 0xB7, - 0x03, 0xE1, 0xA9, 0xD7, 0xDF, 0x5C, 0x15, 0x56, 0xB4, 0x63, 0xC2, 0x71, 0x6D, 0x15, 0xF1, 0x85, - 0xB6, 0xFF, 0x85, 0x4B, 0x6C, 0x36, 0xDB, 0xA8, 0x07, 0x22, 0x92, 0x4F, 0xD5, 0xA3, 0x2B, 0x40, - 0x8F, 0x6D, 0x89, 0xE3, 0x3E, 0xA2, 0x40, 0xAE, 0x80, 0xA5, 0x3A, 0xD2, 0x5D, 0x7E, 0x74, 0x6A, - 0x94, 0xED, 0xA3, 0xF2, 0x4C, 0x2E, 0x57, 0xF2, 0xBE, 0x8B, 0x25, 0xEF, 0x87, 0x0C, 0x05, 0x99, - 0x27, 0x5E, 0xA5, 0xDE, 0xAE, 0x94, 0x49, 0xFD, 0x7A, 0x62, 0xA7, 0x74, 0x58, 0x8A, 0x1A, 0xED, - 0x15, 0x23, 0x1D, 0x83, 0xD7, 0xA4, 0x6B, 0x4F, 0x3F, 0x9C, 0xBB, 0x5B, 0x27, 0xAD, 0x5C, 0x7E, - 0xA2, 0xE0, 0xBF, 0x39, 0x0C, 0x73, 0xB1, 0x48, 0x07, 0xC1, 0x3B, 0xD5, 0xA6, 0x2D, 0x94, 0x20, - 0x6D, 0xE6, 0x91, 0xAD, 0xCC, 0xDE, 0x4A, 0x3C, 0x4C, 0x02, 0x92, 0xCD, 0x41, 0x46, 0x3C, 0x88, - 0x5A, 0xB6, 0xF6, 0x8F, 0x85, 0x05, 0x7E, 0x75, 0xAC, 0x92, 0x92, 0x99, 0xF4, 0x36, 0x21, 0xE9, - 0x0D, 0x19, 0x02, 0xA1, 0xF0, 0xF1, 0xDB, 0xD8, 0x8F, 0x48, 0x11, 0x5D, 0x84, 0x80, 0x24, 0xD8, - 0xEE, 0x57, 0xB2, 0x3A, 0xE6, 0x0E, 0xC5, 0xA1, 0x26, 0xF9, 0x0C, 0x2E, 0x6C, 0x3A, 0x7A, 0x8B, - 0x0B, 0x9B, 0x3D, 0x2E, 0xAF, 0x26, 0x7D, 0x02, 0x63, 0xC8, 0x0D, 0x24, 0x7D, 0x36, 0x19, 0xAB, - 0xAC, 0xA9, 0x10, 0xA0, 0x53, 0x25, 0x4C, 0xC7, 0x4C, 0x28, 0x4A, 0xC3, 0x38, 0x92, 0xE2, 0x3D, - 0xF3, 0xE1, 0x93, 0xDE, 0x3E, 0x77, 0xAC, 0xEF, 0x6A, 0x08, 0x44, 0xE8, 0x20, 0x18, 0xA3, 0xA0, - 0x90, 0x56, 0xDD, 0xAB, 0x77, 0x7D, 0x36, 0xC2, 0x91, 0xB5, 0x44, 0x8C, 0xD4, 0x57, 0x2C, 0x81, - 0xA1, 0xB9, 0xD9, 0x59, 0x50, 0x8A, 0x76, 0x88, 0x5A, 0x5E, 0x45, 0x99, 0xAC, 0x8C, 0x40, 0x14, - 0x46, 0x28, 0x77, 0xED, 0x1C, 0x7C, 0x59, 0x36, 0x83, 0x4A, 0xA7, 0x0A, 0x71, 0x9C, 0x3B, 0x02, - 0x43, 0x50, 0x74, 0x85, 0xE3, 0xD4, 0x0A, 0x3B, 0x1B, 0xE2, 0xD7, 0x1F, 0x79, 0x78, 0x4B, 0x00, - 0x8E, 0x0A, 0x99, 0xDF, 0x14, 0x17, 0xCD, 0xB8, 0xCF, 0x21, 0xB3, 0x85, 0x38, 0xDE, 0x01, 0xBA, - 0x1B, 0x95, 0x4B, 0x97, 0x2B, 0xB0, 0xC9, 0xED, 0x45, 0xCE, 0x22, 0x5B, 0x8E, 0x04, 0x91, 0x07, - 0x58, 0xC8, 0xB5, 0xA7, 0x06, 0x62, 0x9D, 0xC4, 0xAC, 0x1E, 0x08, 0xFD, 0xEA, 0xB7, 0x4D, 0x0B, - 0xD2, 0x79, 0xA8, 0xEF, 0x4F, 0xBE, 0x80, 0xE6, 0x55, 0x44, 0x7B, 0x59, 0x5E, 0x9C, 0x92, 0x6A, - 0x92, 0xF7, 0xE7, 0x78, 0xFB, 0x46, 0xA1, 0xF4, 0x1E, 0x36, 0x8B, 0xE2, 0x86, 0xA2, 0xE1, 0x19, - 0xB5, 0x29, 0xEA, 0xD2, 0x1D, 0x0B, 0x68, 0xC5, 0x2F, 0x4F, 0x48, 0x6A, 0xC8, 0x92, 0xCE, 0x64, - 0x9D, 0xA5, 0x86, 0xA5, 0x05, 0x40, 0xCE, 0xD7, 0x6C, 0x69, 0x9F, 0x6C, 0xB2, 0xA3, 0x11, 0x08, - 0xEF, 0x9B, 0xCD, 0x10, 0x07, 0x7B, 0x9E, 0x25, 0xF4, 0x1A, 0x2B, 0x21, 0x7E, 0xA5, 0xB9, 0xE1, - 0x33, 0x52, 0xFA, 0x04, 0x09, 0xD4, 0x78, 0xCB, 0x56, 0xE6, 0x55, 0x2C, 0xB4, 0x5D, 0xBB, 0x40, - 0x34, 0xE5, 0x23, 0x30, 0xB8, 0x65, 0x19, 0xF1, 0x5A, 0x08, 0xF2, 0xF4, 0x86, 0x45, 0xB7, 0x87, - 0x17, 0xFA, 0x68, 0x6A, 0x1F, 0x7E, 0x69, 0xDA, 0x89, 0x8E, 0xCA, 0xB6, 0xFF, 0x9F, 0x4E, 0x6F, - 0x25, 0x46, 0x46, 0xF6, 0x7B, 0x1E, 0xB3, 0x3D, 0x2C, 0x8C, 0x01, 0xA9, 0x7B, 0xDA, 0xE9, 0x4D, - 0x6E, 0x89, 0x9D, 0x0F, 0x3F, 0x9F, 0x15, 0x3C, 0xFE, 0x35, 0x61, 0x2A, 0x45, 0xC2, 0xA9, 0xC5, - 0x5C, 0x51, 0xCC, 0x6B, 0xCC, 0x2F, 0xA7, 0x60, 0x03, 0x71, 0xF0, 0xB3, 0xBF, 0x7B, 0x76, 0xCC, - 0x89, 0x2C, 0x31, 0x79, 0xE6, 0xDC, 0x7C, 0x39, 0x24, 0xD8, 0x1A, 0x98, 0x1F, 0x98, 0xCD, 0xD4, - 0x7E, 0x04, 0xF2, 0x92, 0x8D, 0x23, 0x03, 0x5F, 0xF3, 0x05, 0x3B, 0xB0, 0x0A, 0xF0, 0x7A, 0xCA, - 0x76, 0xCB, 0xD0, 0xBA, 0xA0, 0x7F, 0xBA, 0x0D, 0x68, 0x60, 0xC3, 0xEF, 0xDC, 0x44, 0x2E, 0x40, - 0x24, 0x9D, 0xCB, 0x1D, 0x5A, 0x0C, 0x51, 0x66, 0x1A, 0x2A, 0x68, 0xA6, 0x83, 0x20, 0x79, 0x9B, - 0x24, 0xEA, 0x10, 0x5A, 0xB4, 0x39, 0x58, 0xAC, 0xA0, 0x45, 0x3B, 0x16, 0xBE, 0x24, 0x59, 0x1D, - 0x18, 0x5C, 0xD8, 0xCD, 0xFE, 0x16, 0x5C, 0x84, 0x5C, 0x2D, 0x7D, 0x28, 0xC9, 0xCE, 0x9D, 0x38, - 0xF6, 0x2F, 0x9A, 0x8A, 0x93, 0x95, 0xDC, 0x73, 0x48, 0xFD, 0xF5, 0xAB, 0xF4, 0x06, 0xB4, 0x11, - 0x79, 0x7B, 0xF7, 0x75, 0x73, 0xC2, 0x2D, 0x9C, 0x91, 0x7E, 0x51, 0x12, 0x54, 0xAC, 0x55, 0x29, - 0x48, 0x7F, 0x50, 0x15, 0xC2, 0x79, 0x05, 0x3C, 0x8F, 0xB4, 0xAE, 0xDD, 0x28, 0x09, 0xCC, 0x1D, - 0xDE, 0xEF, 0x82, 0xFD, 0x64, 0xD1, 0x5A, 0xFE, 0x06, 0x18, 0x7C, 0xF6, 0x32, 0x67, 0xDB, 0xF1, - 0x55, 0xF4, 0x09, 0x33, 0xB4, 0x91, 0xA7, 0x68, 0xE7, 0xA3, 0x60, 0x93, 0xE6, 0x36, 0xDE, 0x28, - 0xB3, 0xBD, 0x90, 0x46, 0x7F, 0xE5, 0xAF, 0x3C, 0xB6, 0x5E, 0xF2, 0x98, 0xE6, 0x28, 0x07, 0xA9, - 0x21, 0x4C, 0xAA, 0xF7, 0x95, 0xD9, 0x25, 0x51, 0x7F, 0x26, 0x8F, 0xC9, 0xD6, 0x65, 0xCA, 0x07, - 0x82, 0x1F, 0x8E, 0xBF, 0xBA, 0x65, 0xF7, 0xB1, 0x51, 0x85, 0x99, 0x23, 0x4E, 0x48, 0x2E, 0x7B, - 0xC8, 0x09, 0xC4, 0x93, 0xB9, 0xDB, 0x6B, 0xAF, 0xCA, 0xC7, 0x0A, 0xC5, 0x6D, 0xD0, 0xC2, 0xD4, - 0xF5, 0xA1, 0x5E, 0x45, 0x28, 0x54, 0x1D, 0x87, 0xC8, 0x83, 0xAF, 0x9E, 0xB7, 0xC7, 0x4D, 0x48, - 0x3B, 0x49, 0x23, 0x8B, 0x23, 0x6A, 0x2D, 0xD6, 0x30, 0xAD, 0xD3, 0xFA, 0x35, 0x67, 0xF0, 0x0D, - 0x3A, 0xDC, 0x42, 0x57, 0xBE, 0xE6, 0x5B, 0x26, 0x0B, 0x30, 0x45, 0x7E, 0x71, 0x5D, 0x82, 0xE7, - 0x40, 0x45, 0x58, 0xBB, 0xF5, 0x07, 0xEC, 0x36, 0x47, 0xF7, 0x98, 0x05, 0x70, 0x83, 0x17, 0x9D, - 0xDD, 0x4A, 0x4A, 0xB7, 0xB5, 0xBC, 0x8B, 0xF5, 0x08, 0x47, 0x74, 0xF3, 0x0F, 0x3C, 0xB0, 0xC7, - 0x30, 0x88, 0xCF, 0xA2, 0xE1, 0xC3, 0x13, 0x52, 0x20, 0x2D, 0xAD, 0xB3, 0x99, 0x37, 0x71, 0x91, - 0xBB, 0x3F, 0x31, 0xAC, 0xEC, 0xB8, 0x2A, 0x84, 0x12, 0x34, 0x84, 0xE5, 0xBF, 0x47, 0x94, 0xD6, - 0x9A, 0x1F, 0xEB, 0x34, 0xAF, 0xDA, 0x93, 0x5D, 0x22, 0x88, 0x27, 0x1A, 0x04, 0x13, 0xAA, 0x06, - 0x52, 0x8C, 0x44, 0xCB, 0xCC, 0x70, 0x7A, 0xBF, 0xC3, 0x3D, 0x21, 0x71, 0x99, 0x4F, 0x06, 0x42, - 0x8B, 0x7F, 0xDA, 0xBC, 0xAF, 0x7C, 0x24, 0x94, 0x3F, 0xC9, 0xB9, 0xF0, 0xFB, 0x9C, 0xFB, 0x94, - 0xFC, 0x7F, 0xA0, 0x2F, 0x20, 0x4D, 0x57, 0x06, 0xDB, 0xA8, 0xC4, 0xBD, 0x02, 0x6C, 0xDD, 0x00, - 0x8C, 0x84, 0xEF, 0x63, 0xDB, 0x45, 0x34, 0x21, 0x69, 0x73, 0x53, 0x22, 0xD3, 0x61, 0xA6, 0x7A, - 0xDE, 0xC1, 0x66, 0xFD, 0x3B, 0x95, 0x13, 0x76, 0x06, 0xE4, 0x76, 0x0E, 0x63, 0xF2, 0x66, 0x56, - 0xE3, 0x80, 0x55, 0x57, 0xF3, 0x88, 0xA2, 0x5E, 0x84, 0x29, 0xFD, 0x44, 0x78, 0xA9, 0xF0, 0x3A, - 0xF9, 0xE7, 0xDD, 0x66, 0xE1, 0x48, 0xA4, 0xD7, 0x15, 0x06, 0x47, 0xBA, 0x1E, 0x70, 0xA0, 0xA2, - 0xBC, 0x79, 0xCF, 0x9B, 0xA6, 0x61, 0x95, 0x4F, 0xF8, 0x46, 0xA7, 0xD5, 0xB5, 0x5F, 0x66, 0xDD, - 0xE2, 0x5A, 0x8B, 0x29, 0xBA, 0x02, 0xC8, 0x1A, 0x17, 0xFD, 0x72, 0x45, 0xED, 0x63, 0x46, 0x64, - 0x5E, 0xC9, 0x24, 0x8D, 0x91, 0x38, 0xD1, 0xEF, 0xDF, 0x82, 0x09, 0xB0, 0x5B, 0x8C, 0x43, 0x5F, - 0xF9, 0x05, 0x34, 0x1E, 0x2B, 0x4D, 0xA8, 0xC3, 0xE5, 0x9A, 0xD5, 0x95, 0x1B, 0xC0, 0xB9, 0x30, - 0x55, 0xB1, 0xEF, 0x53, 0xD2, 0x86, 0x65, 0x96, 0xD1, 0x3C, 0x75, 0x9E, 0x43, 0xED, 0x72, 0x92, - 0x5F, 0xC3, 0xF8, 0x4C, 0x14, 0xA7, 0x77, 0x22, 0x48, 0x5E, 0xD0, 0x02, 0x32, 0xB4, 0x5F, 0xA9, - 0xCD, 0x9C, 0xF6, 0x46, 0x60, 0xEF, 0x4D, 0x14, 0x84, 0x6E, 0xC5, 0x2C, 0xA6, 0xB2, 0xFB, 0x38, - 0xD1, 0x0C, 0xB2, 0x87, 0xE8, 0x64, 0x1E, 0xFD, 0xC4, 0x28, 0x08, 0x37, 0x61, 0x85, 0x11, 0x44, - 0x76, 0xC9, 0x9F, 0xAD, 0x6D, 0xBC, 0xC0, 0xC8, 0x02, 0xC8, 0xDA, 0x22, 0x1D, 0xB3, 0x54, 0x5F, - 0x38, 0x0D, 0x1D, 0xC0, 0x78, 0x46, 0x7C, 0x46, 0x05, 0xC1, 0x51, 0x9A, 0xF7, 0x7E, 0x51, 0x75, - 0x32, 0xD6, 0xB1, 0x7E, 0x8B, 0x3A, 0xB9, 0xA8, 0x12, 0xAF, 0xF8, 0x20, 0x69, 0xED, 0x37, 0xB4, - 0xD2, 0x7D, 0x7C, 0x08, 0xE4, 0x74, 0xD8, 0x18, 0x2B, 0x6E, 0x65, 0x21, 0xC4, 0x8C, 0xF0, 0xB2, - 0x1A, 0x7D, 0xDD, 0xA5, 0xE9, 0xC3, 0x88, 0xEE, 0x7E, 0x80, 0xE3, 0x4B, 0x3A, 0x56, 0x3D, 0x4B, - 0x75, 0x62, 0xE1, 0xCE, 0xB6, 0xD5, 0xF1, 0xFC, 0x0C, 0x0A, 0x66, 0x10, 0xD2, 0xC0, 0xF3, 0xD3, - 0xCA, 0xFE, 0xD6, 0x73, 0xE4, 0x21, 0xDA, 0xED, 0xE4, 0xE4, 0x5A, 0xAC, 0x31, 0x6D, 0x84, 0x8E, - 0x24, 0x56, 0x6B, 0x09, 0x14, 0x09, 0x81, 0xD6, 0xC6, 0x92, 0x2B, 0xE5, 0x2F, 0x61, 0xCE, 0xD3, - 0xBD, 0x31, 0x10, 0x56, 0x4C, 0x68, 0x18, 0xA2, 0x4E, 0xBF, 0x22, 0x71, 0x77, 0x4A, 0xEC, 0x3F, - 0x8A, 0x10, 0xF9, 0x62, 0x7B, 0x4F, 0x7E, 0xE3, 0x16, 0x23, 0x3C, 0x4A, 0x7B, 0xD9, 0xCC, 0xA1, - 0x13, 0x09, 0x31, 0xD8, 0xD1, 0x23, 0xC4, 0xAD, 0x48, 0xD6, 0xC7, 0xCF, 0xB6, 0xE2, 0x5E, 0x53, - 0xAF, 0x45, 0xF4, 0xE4, 0x82, 0xDC, 0xB3, 0x5D, 0x19, 0x4A, 0x71, 0xBE, 0x75, 0x1D, 0x82, 0x9C, - 0xCD, 0x1F, 0x1E, 0xCE, 0xE1, 0xB6, 0x94, 0xED, 0x9A, 0x3A, 0x1A, 0x66, 0xFF, 0x5C, 0x43, 0x7D, - 0x51, 0x46, 0x09, 0xBB, 0xD0, 0x5D, 0x1A, 0x81, 0x98, 0x9A, 0xAC, 0x74, 0x94, 0xD3, 0x05, 0x55, - 0xE1, 0xE4, 0x2A, 0x43, 0xCC, 0xC8, 0x2C, 0x10, 0xA7, 0xE8, 0xAD, 0x5F, 0x02, 0xDF, 0x3B, 0x10, - 0x33, 0x43, 0x8A, 0x92, 0xF9, 0xCF, 0x12, 0x04, 0x60, 0xCD, 0xA0, 0x30, 0xA9, 0xE8, 0x32, 0x30, - 0x80, 0x8B, 0xF2, 0x09, 0xA4, 0x91, 0xFA, 0x3B, 0xBD, 0x1D, 0x54, 0xFD, 0xF8, 0xCF, 0x74, 0x70, - 0x50, 0x9B, 0x8D, 0x40, 0xBD, 0xC7, 0x3D, 0x4F, 0x03, 0x7B, 0x63, 0x32, 0xCE, 0x8B, 0x5B, 0x7C, - 0x9A, 0xE0, 0x3A, 0x37, 0x38, 0xCA, 0x31, 0x21, 0xDB, 0x4F, 0xF6, 0xF0, 0xDB, 0x4E, 0xE5, 0xDC, - 0x69, 0x4B, 0xAE, 0x28, 0x01, 0xF2, 0x46, 0x38, 0x6A, 0x9A, 0x50, 0x2D, 0xF4, 0x36, 0x5D, 0xEF, - 0x25, 0xB1, 0x31, 0xCA, 0x58, 0x5E, 0x4B, 0xE6, 0xAC, 0xCF, 0x0C, 0x20, 0x84, 0x7F, 0xF5, 0xC1, - 0x1A, 0xE5, 0x94, 0xC3, 0x3D, 0x77, 0x8E, 0xA3, 0x9B, 0xAF, 0x96, 0xBF, 0xD1, 0xEC, 0x35, 0x17, - 0x15, 0xDF, 0x2B, 0x00, 0xCD, 0x2C, 0xDB, 0xD3, 0x31, 0x8A, 0x6D, 0xE0, 0xB3, 0x1F, 0x71, 0xB4, - 0xA4, 0xCA, 0xFA, 0x40, 0xEB, 0x99, 0x4C, 0xFB, 0xFE, 0x9D, 0xBA, 0x26, 0x0F, 0x1B, 0x6D, 0xE6, - 0xB6, 0x2C, 0xAD, 0xF4, 0xD8, 0x12, 0xC0, 0xA3, 0xA4, 0x65, 0x10, 0x1B, 0xCD, 0xFD, 0x0A, 0xB0, - 0x52, 0x71, 0x56, 0xD4, 0x01, 0x49, 0xC9, 0x68, 0x06, 0xA1, 0xD3, 0x61, 0x8A, 0xC1, 0x07, 0x1B, - 0x06, 0x48, 0x78, 0x1B, 0x96, 0xCB, 0x7B, 0xC5, 0xF4, 0x8B, 0x27, 0x93, 0xF1, 0x10, 0x40, 0xB3, - 0x36, 0xA3, 0xA8, 0x19, 0xF3, 0x1B, 0x1B, 0xA4, 0xCD, 0x19, 0x18, 0x25, 0x7C, 0x24, 0xAC, 0x05, - 0xD1, 0xB2, 0xA1, 0x1E, 0x0B, 0xB3, 0xDA, 0x82, 0x3E, 0x78, 0x87, 0x12, 0x8F, 0xE6, 0xB9, 0x59, - 0x02, 0xDC, 0x15, 0x31, 0xA3, 0xAE, 0x22, 0x2F, 0xB7, 0x60, 0x08, 0x42, 0xA0, 0x4B, 0x94, 0xA1, - 0x1A, 0xD9, 0x32, 0x40, 0x2C, 0x33, 0x5A, 0x62, 0xB3, 0xDB, 0x9C, 0x04, 0x3B, 0xCE, 0x40, 0xCD, - 0x3C, 0x29, 0xDB, 0x1C, 0x98, 0xC7, 0x7B, 0x09, 0x65, 0x91, 0xCD, 0xB9, 0x71, 0x80, 0xF2, 0x14, - 0x90, 0x27, 0xA5, 0xC7, 0x16, 0xBB, 0xC8, 0x6D, 0x79, 0x0F, 0xC7, 0x06, 0x4F, 0xFD, 0xEF, 0x3D, - 0x7E, 0xA9, 0x1A, 0x20, 0x4A, 0x94, 0x3F, 0x84, 0xA1, 0x97, 0xE1, 0x99, 0xF5, 0x9E, 0xB2, 0x46, - 0x23, 0xC3, 0x48, 0x46, 0xC0, 0x2C, 0x7D, 0x64, 0x45, 0x7B, 0xA0, 0xBF, 0x5F, 0x14, 0xBC, 0xB2, - 0x17, 0x87, 0x68, 0x5C, 0x17, 0xCE, 0xCA, 0xEA, 0x73, 0x3C, 0xAE, 0x6C, 0x8C, 0x4A, 0x2C, 0xFB, - 0x77, 0x52, 0xE7, 0xA1, 0xFF, 0x6C, 0x23, 0x05, 0x1E, 0x69, 0x22, 0xF1, 0xDA, 0x6B, 0xB6, 0x01, - 0x44, 0xDE, 0xEB, 0x80, 0xB7, 0x84, 0x5B, 0xC7, 0xEA, 0x59, 0x5B, 0x3F, 0x23, 0x7E, 0x10, 0x00, - 0x27, 0x5C, 0x6A, 0x7B, 0xEB, 0xFF, 0xDF, 0x82, 0xEE, 0x85, 0x6C, 0xA5, 0x1A, 0xBF, 0xEB, 0x64, - 0xBB, 0x10, 0x46, 0x40, 0x51, 0x29, 0x2C, 0x6A, 0xD2, 0xF5, 0x58, 0x61, 0x5F, 0x77, 0x31, 0xBD, - 0x59, 0x0A, 0x1B, 0xF5, 0xC2, 0xFA, 0x9A, 0xB4, 0x59, 0xF4, 0x0A, 0xD1, 0x68, 0xCC, 0x21, 0x44, - 0xDC, 0x70, 0x80, 0xD1, 0x67, 0xCC, 0x24, 0x22, 0xC0, 0x77, 0x04, 0xED, 0xA3, 0xB4, 0x23, 0xC8, - 0xAD, 0x5E, 0x18, 0x64, 0x57, 0x89, 0x52, 0xDD, 0x25, 0x6C, 0x38, 0xCE, 0x5D, 0x45, 0x42, 0x18, - 0xA3, 0xE2, 0xD8, 0x6E, 0x21, 0x5F, 0xBB, 0x9D, 0xCA, 0x90, 0x57, 0x85, 0x0C, 0xD5, 0x56, 0xC8, - 0x12, 0x39, 0x27, 0x44, 0x77, 0xE6, 0x59, 0xE7, 0x08, 0xB0, 0x4E, 0x80, 0xBD, 0xE3, 0xE6, 0x8B, - 0xE1, 0x4B, 0x6E, 0xCE, 0xA9, 0x5C, 0x8E, 0xF2, 0xE2, 0xFE, 0x18, 0xFB, 0x74, 0xD6, 0x3C, 0x76, - 0xB8, 0xB0, 0x90, 0x00, 0x3A, 0xF4, 0xE4, 0xB7, 0xFD, 0x05, 0xA3, 0x7A, 0xD9, 0xF7, 0x0E, 0x18, - 0x66, 0xBC, 0x9A, 0x47, 0x18, 0x80, 0x4F, 0x4A, 0x6B, 0x9C, 0xF8, 0x48, 0x16, 0x49, 0x3F, 0x21, - 0xB4, 0x20, 0x59, 0x51, 0xDA, 0xD1, 0x4B, 0xE8, 0x5E, 0x48, 0x95, 0x77, 0x0A, 0x82, 0xA1, 0x8F, - 0xD2, 0x77, 0xC9, 0xC5, 0xE2, 0x79, 0x24, 0x87, 0x34, 0x0C, 0x9E, 0x17, 0x6F, 0x7B, 0xEA, 0x14, - 0x79, 0xF6, 0x0C, 0x95, 0x5F, 0x1C, 0x61, 0x01, 0x61, 0x6D, 0xD1, 0xF2, 0x6A, 0xA8, 0x09, 0xAA, - 0x0A, 0x6E, 0xF9, 0x28, 0x69, 0x49, 0x14, 0x60, 0x6D, 0xA3, 0xCF, 0x5E, 0x4C, 0x34, 0x8E, 0xFC, - 0x7E, 0x3E, 0x72, 0x3E, 0x02, 0x78, 0x3D, 0x1B, 0xA4, 0x93, 0x46, 0x39, 0x46, 0x0E, 0xF0, 0xE3, - 0x46, 0xF0, 0x4C, 0x2F, 0xE2, 0x14, 0x93, 0xF0, 0x2A, 0x5B, 0xE8, 0x05, 0xF7, 0x10, 0x3A, 0x6D, - 0x03, 0xA0, 0x5D, 0xF8, 0x5D, 0xD1, 0x4C, 0x58, 0x7B, 0xBF, 0xAB, 0x52, 0xC1, 0x6E, 0x72, 0x1E, - 0x60, 0x8C, 0x33, 0x4E, 0x22, 0xE7, 0x12, 0x51, 0x0B, 0xFE, 0x22, 0xDA, 0x8A, 0x53, 0xA7, 0xC6, - 0x9A, 0x66, 0x92, 0x76, 0x46, 0x3C, 0xC5, 0x72, 0x55, 0x6C, 0xD2, 0x8D, 0xF1, 0xD5, 0x6C, 0x09, - 0xEA, 0x2D, 0x1A, 0xF9, 0x99, 0x5E, 0x65, 0xCC, 0x6D, 0x55, 0x5F, 0x46, 0x66, 0xC3, 0xBB, 0xBE, - 0x1C, 0x53, 0x40, 0x3B, 0xE9, 0x15, 0x6C, 0xD6, 0x94, 0x8C, 0x5D, 0xB4, 0x4A, 0xDC, 0x2F, 0x2F, - 0xC1, 0xA8, 0xE1, 0xDF, 0x7A, 0xB5, 0x6D, 0xE2, 0xF8, 0xDB, 0xAA, 0x5D, 0x3D, 0x80, 0x5D, 0x33, - 0x6F, 0xCD, 0x5A, 0x84, 0xBC, 0x2D, 0x6E, 0x28, 0x97, 0x07, 0xA6, 0xF1, 0x0B, 0x22, 0x23, 0x58, - 0xDF, 0x50, 0x15, 0x73, 0xD6, 0x75, 0x63, 0xB6, 0x0F, 0xD8, 0x75, 0x9B, 0xF9, 0x9D, 0xBF, 0xE6, - 0xAF, 0xF8, 0xBF, 0xB4, 0x3A, 0xD4, 0x02, 0x3B, 0x8A, 0x4D, 0xF6, 0x44, 0x0E, 0x7F, 0x2B, 0xDB, - 0x9C, 0xAC, 0xD6, 0xB8, 0xC5, 0xB5, 0xEF, 0x1B, 0x67, 0xB0, 0x10, 0xCC, 0x1E, 0x24, 0xD4, 0x05, - 0x06, 0x6D, 0x3A, 0xFE, 0x95, 0x4C, 0x00, 0x8A, 0xD2, 0x53, 0x1B, 0x7A, 0xDE, 0xA0, 0x9F, 0x2D, - 0x10, 0x43, 0x2D, 0xA3, 0x8E, 0x66, 0x36, 0x27, 0x77, 0x05, 0x26, 0x78, 0x21, 0x09, 0x18, 0xD0, - 0x2E, 0x86, 0x1E, 0x56, 0x3B, 0x71, 0x3A, 0x46, 0x24, 0x7C, 0x90, 0x1E, 0x42, 0x36, 0x11, 0xA1, - 0x7C, 0x04, 0x80, 0x42, 0x0F, 0xA8, 0x4E, 0x07, 0xA1, 0x7B, 0x55, 0x5F, 0xA8, 0x8A, 0x1D, 0x36, - 0x9C, 0x16, 0xBD, 0xE0, 0x63, 0x0A, 0xE3, 0xC5, 0xF9, 0x55, 0xA4, 0xE9, 0x75, 0x7D, 0xD5, 0x82, - 0x32, 0x1E, 0x6B, 0x05, 0xE4, 0xF9, 0x8A, 0x8C, 0x18, 0x0E, 0xA0, 0xDF, 0x23, 0x4D, 0xA8, 0x4E, - 0xF0, 0x85, 0xFF, 0x04, 0xC5, 0xFE, 0x1E, 0x8A, 0x3F, 0xBF, 0x54, 0x05, 0x82, 0x8A, 0x0C, 0xDF, - 0xCA, 0x0A, 0xD0, 0x43, 0x76, 0xE5, 0x49, 0x55, 0x36, 0x24, 0x6F, 0x2F, 0x20, 0x58, 0x3A, 0xFE, - 0x62, 0x3A, 0x11, 0xAA, 0x2F, 0xB2, 0x25, 0x6F, 0x0B, 0x9D, 0xD8, 0xCC, 0xC5, 0x26, 0x16, 0x2E, - 0x74, 0x56, 0xBE, 0x99, 0xF4, 0xE7, 0x90, 0x88, 0x65, 0x1E, 0x6C, 0xAA, 0xB4, 0x2C, 0xCF, 0x12, - 0x63, 0x86, 0x8E, 0x9C, 0xF5, 0x75, 0x5A, 0x71, 0xBF, 0xFB, 0x54, 0xF3, 0x86, 0x61, 0xC5, 0x59, - 0xB4, 0xD5, 0x8E, 0x5D, 0x91, 0xA0, 0xB0, 0x9B, 0xB1, 0x95, 0xCE, 0x45, 0x0C, 0x4A, 0xFC, 0xE0, - 0x56, 0x73, 0x96, 0xC1, 0xAA, 0x0A, 0x65, 0x42, 0x42, 0xC1, 0xC7, 0x2D, 0x6E, 0xC8, 0x4A, 0x7F, - 0x40, 0x53, 0x0C, 0x7A, 0x99, 0x96, 0x59, 0xFA, 0xEC, 0xAD, 0xA1, 0xF0, 0xAB, 0xFE, 0xB6, 0x58, - 0x49, 0x65, 0xF4, 0x29, 0x2A, 0x21, 0x42, 0x93, 0x0A, 0xED, 0x38, 0xC0, 0x33, 0xFD, 0xCF, 0x8E, - 0xC1, 0xEC, 0x3A, 0xF9, 0x1F, 0xEA, 0x8F, 0xA2, 0xEA, 0xAE, 0xC4, 0xE7, 0x43, 0xCB, 0x53, 0xF1, - 0x77, 0xC9, 0x6C, 0x61, 0x35, 0xE2, 0xED, 0x25, 0x68, 0xF6, 0x8E, 0x06, 0xD6, 0x41, 0x87, 0x58, - 0x8A, 0xE4, 0x5F, 0x80, 0x59, 0xC7, 0x21, 0xAC, 0xC1, 0x95, 0xC8, 0xBA, 0xF9, 0x84, 0x1F, 0x70, - 0x15, 0x1C, 0xB1, 0xF1, 0x2B, 0xB4, 0xB7, 0xA0, 0x4B, 0xE3, 0xB3, 0xD4, 0x3C, 0x9C, 0x01, 0xB2, - 0x4A, 0xE5, 0x47, 0x39, 0x10, 0x32, 0xE0, 0x0E, 0x1C, 0xE9, 0x3E, 0x2E, 0xDD, 0x12, 0x2C, 0xDF, - 0xB7, 0x47, 0xE8, 0x88, 0x53, 0x28, 0xF2, 0xC6, 0x11, 0x12, 0x15, 0x4A, 0x60, 0x14, 0xA4, 0x78, - 0x54, 0x8E, 0x6A, 0x77, 0xD6, 0x74, 0xC2, 0xCD, 0x4B, 0xF9, 0xC2, 0x84, 0xE8, 0xD6, 0xED, 0x4D, - 0xB3, 0x0C, 0x32, 0x39, 0xCF, 0xB9, 0xF9, 0x0B, 0xC3, 0x52, 0xF5, 0x6E, 0x9A, 0x38, 0x84, 0xED, - 0x0D, 0x83, 0xFA, 0x83, 0x2D, 0xF4, 0xB3, 0xEE, 0x71, 0xE0, 0x47, 0x48, 0xE6, 0x1A, 0x0B, 0xD9, - 0x54, 0x74, 0xB8, 0x39, 0xA1, 0x4C, 0xC7, 0x3C, 0x52, 0x02, 0x07, 0x61, 0x12, 0x1B, 0x49, 0x0B, - 0x7D, 0x08, 0xAA, 0xEA, 0xB0, 0x3A, 0x05, 0x65, 0x9A, 0xEA, 0x68, 0x0C, 0x5B, 0xA6, 0x37, 0xC6, - 0x5F, 0x10, 0x7D, 0xC8, 0xAE, 0xCA, 0x65, 0x1F, 0x16, 0x80, 0x38, 0xF1, 0xB7, 0xB5, 0xDB, 0x1D, - 0x37, 0x5A, 0x1D, 0xEB, 0x7B, 0x2C, 0xA1, 0x7B, 0x72, 0xCE, 0x0D, 0x34, 0xB4, 0x17, 0x23, 0x52, - 0x8B, 0x3A, 0xD6, 0xEC, 0xE5, 0x8D, 0x23, 0x6A, 0xCF, 0x34, 0xDE, 0x02, 0x5A, 0xA4, 0x54, 0xFF, - 0x85, 0x85, 0x3E, 0x33, 0x87, 0xF9, 0x27, 0x59, 0xE2, 0x32, 0xAB, 0x8D, 0xBA, 0x8A, 0x92, 0xEB, - 0x5D, 0xA7, 0xF6, 0x6A, 0xDF, 0x32, 0xAD, 0xAC, 0x70, 0xCF, 0x91, 0xA9, 0x8E, 0x4C, 0x39, 0x71, - 0x4C, 0x1B, 0xBF, 0xD1, 0xD0, 0x68, 0x19, 0x9C, 0x8A, 0x7B, 0x57, 0x52, 0x40, 0xCE, 0xCC, 0x86, - 0xB7, 0x0E, 0x3D, 0x5E, 0xAD, 0xD0, 0x2B, 0xD4, 0x58, 0x5C, 0x5B, 0xD8, 0x00, 0x7F, 0x42, 0x99, - 0x84, 0x5D, 0x2D, 0x86, 0x40, 0x10, 0x35, 0x15, 0x05, 0x67, 0xDE, 0x22, 0x6C, 0xB4, 0x5C, 0x7B, - 0xCA, 0xDF, 0xF4, 0x1D, 0xD2, 0xCB, 0x34, 0x02, 0x6C, 0x22, 0x10, 0x4F, 0x7F, 0xDF, 0x18, 0xFF, - 0x5A, 0x81, 0x4C, 0xAC, 0xF7, 0xF3, 0xF1, 0x5D, 0xBA, 0x72, 0x36, 0x26, 0x88, 0xAE, 0xCA, 0xE0, - 0x79, 0x84, 0x68, 0x86, 0xCE, 0x35, 0xAF, 0x27, 0xB4, 0x21, 0xFD, 0x05, 0xB1, 0x38, 0x17, 0x7D, - 0x9B, 0x5A, 0x12, 0x29, 0x76, 0xE5, 0xA0, 0x39, 0x0B, 0xAD, 0x4C, 0x33, 0xCB, 0x45, 0x59, 0x82, - 0xB7, 0x03, 0xD2, 0x1A, 0xF7, 0x2F, 0x54, 0x43, 0x92, 0xC9, 0x8B, 0x6F, 0x6C, 0x6C, 0x1B, 0x10, - 0xEE, 0x97, 0x38, 0xA5, 0x8B, 0x16, 0xDE, 0xFC, 0xDA, 0x83, 0x4B, 0x39, 0x79, 0x17, 0xB7, 0x5A, - 0x59, 0x01, 0x11, 0xC0, 0xC6, 0x36, 0xD5, 0xBA, 0xB1, 0x46, 0x9E, 0x6B, 0xA1, 0xCB, 0x96, 0x7E, - 0x56, 0x91, 0x87, 0x68, 0x59, 0x8E, 0xCF, 0xB5, 0x58, 0x24, 0x2C, 0xD9, 0x0A, 0x06, 0x25, 0xCB, - 0x8C, 0xE6, 0x02, 0xE3, 0x5A, 0x19, 0x4D, 0x8F, 0x43, 0x5B, 0x40, 0x3F, 0x7D, 0x50, 0x24, 0x90, - 0x71, 0x3E, 0x88, 0x96, 0x3C, 0xCE, 0x2C, 0x80, 0x35, 0x68, 0x3E, 0x21, 0x67, 0x8A, 0x03, 0x68, - 0x49, 0x6B, 0xFA, 0xE2, 0x5A, 0xC7, 0xFF, 0x9C, 0xDF, 0x0D, 0xD9, 0xB5, 0x12, 0x07, 0x35, 0x7B, - 0x35, 0xDC, 0xF7, 0x12, 0x55, 0x71, 0x8A, 0x9F, 0x68, 0x66, 0x2A, 0x72, 0x55, 0x14, 0x82, 0xE2, - 0xBC, 0x3A, 0x39, 0xA7, 0x91, 0xA9, 0x91, 0xC8, 0x2B, 0x5F, 0x0A, 0x09, 0xFD, 0xE0, 0x6B, 0x58, - 0x85, 0x58, 0x1D, 0xCD, 0xEA, 0xAE, 0xBA, 0xA5, 0x49, 0xFF, 0x69, 0x4A, 0x10, 0xDD, 0x5A, 0xE0, - 0x0E, 0xD3, 0x9C, 0x0B, 0xD8, 0x28, 0x2E, 0xCA, 0x8E, 0x9F, 0x29, 0x84, 0xC8, 0xCA, 0x47, 0x79, - 0xB9, 0xCC, 0x71, 0xC6, 0xE1, 0xC1, 0x4D, 0x15, 0xB6, 0x1F, 0x92, 0x13, 0x2C, 0x83, 0xBE, 0x0D, - 0x03, 0x0A, 0x7C, 0x02, 0x7C, 0x2C, 0xFA, 0x8E, 0xC8, 0x23, 0xE1, 0xFD, 0x83, 0xDC, 0x61, 0xDB, - 0x1C, 0xE4, 0x3F, 0xE8, 0xA9, 0x1C, 0x55, 0x1E, 0xB2, 0xF1, 0x47, 0x6C, 0x5A, 0xD8, 0xD9, 0xD4, - 0xA8, 0xBF, 0x4B, 0xF9, 0x0A, 0xD5, 0xBF, 0x1D, 0x88, 0x30, 0x12, 0x80, 0x72, 0x49, 0x6C, 0x91, - 0x70, 0x6A, 0xB7, 0x4D, 0x86, 0x34, 0x8F, 0x57, 0x1A, 0x6A, 0x16, 0x7B, 0xA5, 0x5D, 0x3C, 0x74, - 0x8E, 0x03, 0x1D, 0x53, 0xD6, 0x1C, 0x75, 0x83, 0x2C, 0xF7, 0x5E, 0xF6, 0xE0, 0xC9, 0x25, 0x11, - 0x9F, 0x98, 0x73, 0xD2, 0xBE, 0x50, 0x56, 0xD6, 0x73, 0x38, 0xC8, 0x30, 0x5A, 0xB5, 0xF6, 0x67, - 0x37, 0x75, 0x7E, 0x99, 0x71, 0xC7, 0x30, 0x26, 0x0D, 0x43, 0xA2, 0x0B, 0xF0, 0xC2, 0xCC, 0x38, - 0xDF, 0x0F, 0x37, 0x25, 0xA0, 0x4F, 0x18, 0x5A, 0x40, 0x75, 0x2D, 0xFC, 0x52, 0xFF, 0x37, 0xD5, - 0x38, 0x06, 0xC6, 0x62, 0x13, 0xA0, 0x8E, 0x7A, 0xFA, 0xDD, 0xB9, 0x25, 0xBE, 0xBC, 0x1F, 0x02, - 0x4C, 0x56, 0xA1, 0xBA, 0x08, 0xBB, 0x65, 0xAE, 0xAC, 0x14, 0x4E, 0x65, 0xD7, 0xD1, 0x99, 0xFF, - 0x14, 0x33, 0x9F, 0x18, 0x1D, 0x54, 0x70, 0x6F, 0xBC, 0x85, 0xB4, 0x49, 0x82, 0x4C, 0x0A, 0xA6, - 0xE8, 0x10, 0x61, 0x8F, 0xED, 0xFD, 0x7F, 0x10, 0xAA, 0xAC, 0x13, 0xB5, 0xE2, 0x5D, 0xF3, 0x69, - 0x2B, 0xC3, 0xE1, 0xC2, 0x89, 0x9A, 0x46, 0xF0, 0x97, 0x34, 0xFC, 0x93, 0x31, 0x45, 0xE9, 0x7A, - 0xD4, 0x46, 0x1A, 0x31, 0xFF, 0x65, 0x39, 0xAE, 0xCE, 0xC5, 0x40, 0x2F, 0xD0, 0xCB, 0x1E, 0xC6, - 0x86, 0xDC, 0x2F, 0x72, 0x34, 0x35, 0x28, 0xAD, 0x96, 0xC3, 0xBE, 0xE4, 0xC8, 0xA5, 0xB6, 0x6B, - 0xBD, 0xFB, 0x9B, 0xE5, 0x16, 0x01, 0x4A, 0x55, 0xA2, 0xB0, 0xE8, 0x66, 0x4A, 0xC1, 0xE3, 0xC0, - 0xB9, 0x87, 0xF4, 0xD6, 0x8C, 0xF4, 0x61, 0x42, 0xA4, 0xBF, 0x73, 0x03, 0x67, 0xBD, 0x2F, 0x30, - 0x6E, 0x97, 0x45, 0x0F, 0xC6, 0xBD, 0xCA, 0x2E, 0x69, 0x72, 0x41, 0x07, 0x38, 0x74, 0x18, 0xB1, - 0xCB, 0x5C, 0xD3, 0xC2, 0x1D, 0xB7, 0xF2, 0xAF, 0xEC, 0x00, 0xCD, 0x4F, 0x6F, 0xDE, 0xB2, 0xAC, - 0x44, 0x4C, 0x1A, 0x56, 0xC3, 0x93, 0x21, 0x57, 0x8C, 0x6B, 0x1C, 0xD7, 0xF9, 0xC7, 0xC0, 0xA9, - 0xF7, 0xE4, 0xA3, 0xD8, 0x58, 0x9B, 0x35, 0xE6, 0x00, 0x7C, 0xE2, 0x12, 0xD0, 0x53, 0x61, 0x1F, - 0xC6, 0xA5, 0x81, 0x7A, 0x52, 0xEF, 0x09, 0x36, 0x1A, 0x62, 0x3C, 0x92, 0xD2, 0x65, 0x43, 0xF6, - 0xDF, 0x0B, 0x89, 0x7E, 0xC6, 0xB9, 0x47, 0xF4, 0x52, 0x14, 0x0C, 0x44, 0x4D, 0x23, 0x55, 0x6F, - 0x80, 0xC2, 0xBE, 0xC5, 0x59, 0xF8, 0xB5, 0x27, 0xE6, 0xE8, 0xF0, 0x32, 0x91, 0x3A, 0x59, 0x2B, - 0x1D, 0xF9, 0xAC, 0xF9, 0x2E, 0xF3, 0xB9, 0x36, 0x8C, 0x1A, 0x5D, 0x92, 0x33, 0xEA, 0xA6, 0xAF, - 0x71, 0x24, 0xE2, 0x7F, 0x18, 0xB1, 0x23, 0x3C, 0x53, 0xF3, 0xCC, 0x5D, 0xD4, 0x2D, 0x2B, 0x7A, - 0xF8, 0x94, 0x04, 0xC0, 0x8C, 0x65, 0x4D, 0x3A, 0xFA, 0xCF, 0xF9, 0x07, 0xC2, 0xD7, 0x75, 0x87, - 0x47, 0x9E, 0x6E, 0xA0, 0x79, 0x81, 0x6E, 0x03, 0xC7, 0xD2, 0x75, 0xF6, 0xC3, 0x85, 0x22, 0x28, - 0x1B, 0x39, 0x63, 0xCC, 0x12, 0x7E, 0x4A, 0xC3, 0x2A, 0x45, 0x85, 0xA9, 0x54, 0xDF, 0xB2, 0x33, - 0xEF, 0x76, 0x25, 0x31, 0xC9, 0xCD, 0xDA, 0x14, 0xE7, 0xD8, 0x4D, 0x18, 0xCE, 0xAB, 0xE7, 0x85, - 0xDD, 0x95, 0x8D, 0x36, 0xA1, 0x18, 0x87, 0x5E, 0xB6, 0x75, 0x2F, 0x3B, 0x97, 0x09, 0x18, 0x47, - 0xC8, 0x90, 0x37, 0xA3, 0xB2, 0xD2, 0x09, 0x3C, 0x5E, 0x6C, 0x2E, 0x72, 0x38, 0x08, 0x24, 0x99, - 0x90, 0xD0, 0x86, 0xC7, 0xD3, 0xFB, 0x4E, 0xA2, 0xDF, 0xC7, 0x26, 0x4D, 0x8E, 0x81, 0x98, 0x19, - 0x15, 0xD0, 0x4C, 0xB8, 0x44, 0xF7, 0x53, 0x1C, 0x0F, 0xAF, 0x78, 0x4C, 0x20, 0xB8, 0xCC, 0xBB, - 0x20, 0x60, 0xEC, 0x55, 0x70, 0xBD, 0xE9, 0x02, 0x63, 0x9F, 0x1F, 0xA7, 0xD5, 0x27, 0x18, 0x33, - 0x29, 0xA8, 0x33, 0x6E, 0xCB, 0x80, 0x40, 0x2D, 0x52, 0xDF, 0x6C, 0x78, 0x8F, 0xA6, 0x1D, 0xCF, - 0xE8, 0xB9, 0x54, 0x6B -}; +/* +Seed: 4D808D2C77D905C41A6380EC08586AFE (0x05 packet) +Hash: 568C054C781A972A6037A2290C22B52571A06F4E (0x04 packet) +Module MD5: 79C0768D657977D697E10BAD956CCED1 +New Client Key: 7F 96 EE FD A5 B6 3D 20 A4 DF 8E 00 CB F4 83 04 +New Cerver Key: C2 B7 AD ED FC CC A9 C2 BF B3 F8 56 02 BA 80 9B +*/ -uint8 Module_79C0768D657977D697E10BAD956CCED1_Key[16] = +struct Module_79C0768D657977D697E10BAD956CCED1 +{ + uint8 Module[18756]; + uint8 ModuleKey[16]; + uint8 Seed[16]; + uint8 ServerKeySeed[16]; + uint8 ClientKeySeed[16]; + uint8 ClientKeySeedHash[20]; +} Module = { - 0xAE, 0x25, 0xBC, 0x51, 0x06, 0x3B, 0x77, 0xBD, 0x36, 0x3C, 0x3E, 0xFE, 0x0F, 0xC1, 0x73, 0xF9 + { + 0x21, 0x6C, 0xBB, 0x6A, 0xB9, 0xAF, 0xE8, 0xA1, 0x9A, 0x79, 0x18, 0xF1, 0x27, 0x9A, 0x14, 0xF5, + 0x42, 0x5D, 0x00, 0xBA, 0x74, 0x57, 0x0E, 0xAF, 0xD2, 0xAE, 0x8E, 0x51, 0xA5, 0xC1, 0x17, 0x4E, + 0xEC, 0x7F, 0xAC, 0xBC, 0xDD, 0x42, 0x87, 0xA6, 0xF9, 0xC1, 0x4A, 0xCE, 0xB5, 0xDD, 0xB3, 0xF8, + 0x06, 0x52, 0x9D, 0xF2, 0xAE, 0x2A, 0x49, 0x2B, 0x7B, 0x72, 0x5F, 0x40, 0x01, 0x16, 0xDB, 0x98, + 0x77, 0x1F, 0xE3, 0x61, 0x5A, 0x99, 0x39, 0x66, 0x2F, 0x2F, 0x35, 0xBF, 0x00, 0x20, 0xE4, 0xE0, + 0x8F, 0x98, 0xAD, 0xFC, 0xDB, 0x7D, 0xDD, 0xE8, 0x7A, 0xE9, 0x21, 0x6C, 0x86, 0x80, 0x3A, 0xE7, + 0x75, 0x66, 0x0E, 0xD9, 0xC6, 0xC5, 0xD8, 0xD8, 0xA9, 0x9B, 0x84, 0x09, 0xF0, 0xB3, 0x7C, 0x72, + 0x53, 0xE2, 0x29, 0xF9, 0x64, 0x8C, 0x17, 0xFD, 0x90, 0xAE, 0x48, 0x5A, 0x30, 0xFA, 0x30, 0xB7, + 0x54, 0x58, 0x59, 0x61, 0xA0, 0x24, 0x57, 0xE4, 0xF0, 0x05, 0xA2, 0x3F, 0x7A, 0xA6, 0x51, 0x7E, + 0x4F, 0x35, 0xF4, 0xE5, 0xFF, 0x98, 0xE9, 0x3E, 0x1F, 0xF1, 0x66, 0x48, 0x5B, 0xF8, 0xCF, 0x3B, + 0x37, 0x3B, 0x60, 0x47, 0x1C, 0xF7, 0xBE, 0x59, 0x70, 0x3A, 0x03, 0x4C, 0xE6, 0xBD, 0xB6, 0xED, + 0x46, 0xAF, 0x04, 0x5A, 0xAA, 0xC4, 0x30, 0xCF, 0x0B, 0x05, 0x86, 0xA9, 0x56, 0x5B, 0x09, 0xF0, + 0x92, 0x59, 0xC8, 0x48, 0x58, 0x33, 0xBF, 0x81, 0x70, 0x51, 0x92, 0x98, 0xE9, 0x4F, 0x2B, 0xDD, + 0x5B, 0x0A, 0x42, 0x51, 0x73, 0x97, 0xF6, 0x66, 0x00, 0xF2, 0x04, 0x50, 0x4A, 0x54, 0x62, 0x7A, + 0x00, 0x10, 0x5B, 0xAD, 0x0E, 0xFC, 0xE1, 0x44, 0x55, 0x4E, 0x21, 0x76, 0xC6, 0x4B, 0xD5, 0x2E, + 0xF5, 0xF4, 0x0E, 0xFC, 0x55, 0xE1, 0xDE, 0x32, 0x20, 0x22, 0x03, 0x98, 0xF0, 0xD3, 0x4A, 0xE5, + 0x45, 0x49, 0x0C, 0xE8, 0x76, 0xE1, 0xBF, 0x4A, 0x53, 0xD3, 0xCE, 0x64, 0xCF, 0x82, 0xCF, 0x67, + 0xA9, 0x3F, 0xF1, 0x06, 0x24, 0x33, 0x0A, 0x98, 0x6A, 0x5C, 0xAB, 0xEE, 0x7F, 0x64, 0xE3, 0x65, + 0x1F, 0xF6, 0xBE, 0xAF, 0x9C, 0x63, 0x53, 0x54, 0x06, 0x84, 0x4F, 0xF2, 0x7D, 0xC5, 0xBD, 0x70, + 0xC7, 0x6F, 0x59, 0x93, 0x7C, 0xEE, 0xC0, 0xCA, 0xF5, 0x56, 0x21, 0x58, 0x5B, 0xD8, 0x1D, 0xB4, + 0xB7, 0x60, 0x72, 0x46, 0xA2, 0x60, 0x3F, 0xC3, 0x30, 0xAB, 0xE0, 0x3B, 0xAC, 0x9E, 0xB9, 0x64, + 0xA8, 0xEF, 0xD0, 0xE1, 0xE5, 0xE1, 0x83, 0x48, 0xB8, 0x35, 0xA7, 0x12, 0x11, 0x00, 0xC9, 0x29, + 0x1A, 0x41, 0x1D, 0x3B, 0xFB, 0x33, 0x0B, 0x66, 0x45, 0x86, 0x61, 0x70, 0x35, 0x4C, 0x5F, 0x64, + 0x8E, 0xF5, 0x57, 0xBE, 0xA6, 0xFA, 0x49, 0xC9, 0x89, 0xA4, 0x74, 0x02, 0x9E, 0xE7, 0x67, 0x14, + 0x8B, 0xB9, 0xE7, 0xA8, 0xB0, 0x75, 0x65, 0x22, 0xB7, 0xCD, 0xFA, 0x55, 0x18, 0x00, 0x55, 0xB5, + 0x09, 0x70, 0x7E, 0x05, 0x0B, 0x11, 0x42, 0xF0, 0x80, 0x58, 0x2F, 0xFE, 0x3B, 0x2C, 0x4A, 0xCA, + 0x50, 0x34, 0xD0, 0x6F, 0xF1, 0xCC, 0x7F, 0x35, 0xD7, 0x9B, 0xF2, 0x97, 0x16, 0xFE, 0x5F, 0x6C, + 0x94, 0xDC, 0xAC, 0x63, 0xC8, 0x85, 0x2E, 0x60, 0x41, 0x34, 0x89, 0xD3, 0xDD, 0xBF, 0x2D, 0x69, + 0xC2, 0xF7, 0x74, 0xB2, 0x56, 0xD9, 0x76, 0xA2, 0x35, 0x30, 0x60, 0x35, 0xAB, 0x50, 0x21, 0xAE, + 0xFC, 0xFA, 0x19, 0x06, 0xDE, 0x89, 0x46, 0xFF, 0x34, 0x2F, 0x19, 0x84, 0x85, 0xF5, 0x1E, 0x60, + 0x91, 0x0D, 0x8C, 0x94, 0xDB, 0x2E, 0xEE, 0x4D, 0x0A, 0x29, 0x64, 0x81, 0xAD, 0x4C, 0xBF, 0x41, + 0x51, 0x04, 0xCD, 0x1C, 0x5C, 0x89, 0xD3, 0x3A, 0x91, 0xD9, 0x5C, 0x7E, 0xF3, 0xE9, 0x5B, 0x9E, + 0xC2, 0xD2, 0xE4, 0xD5, 0xEF, 0x47, 0x63, 0xD2, 0xD4, 0x19, 0x3E, 0xDF, 0xCF, 0xA4, 0x10, 0x47, + 0x16, 0x93, 0xC2, 0xF2, 0x22, 0xED, 0x1D, 0x9E, 0x21, 0x63, 0xC4, 0xCB, 0x89, 0xBB, 0x3E, 0xF7, + 0x89, 0x68, 0x6D, 0x2C, 0xDF, 0x2C, 0x6F, 0xB2, 0x8D, 0x75, 0xF8, 0xC6, 0x57, 0x98, 0x47, 0x86, + 0x40, 0x72, 0xBB, 0xD7, 0x32, 0xCD, 0x7A, 0x15, 0x64, 0x83, 0xD9, 0x50, 0x2E, 0xDE, 0x0C, 0x8C, + 0x30, 0xCD, 0xB0, 0x64, 0xD6, 0x7F, 0xE7, 0xAD, 0x6E, 0x01, 0x3E, 0x14, 0x8A, 0x24, 0x86, 0x1F, + 0x92, 0xAB, 0x1A, 0xE5, 0xD6, 0xBF, 0x64, 0xE5, 0xF6, 0x34, 0x62, 0xD5, 0x92, 0x5B, 0x64, 0xC4, + 0xFC, 0x1B, 0x7F, 0xA0, 0x13, 0xC1, 0xD4, 0xEB, 0x92, 0x90, 0xEF, 0x8C, 0x5E, 0x75, 0x4B, 0x78, + 0x56, 0x5F, 0xA2, 0x55, 0x4B, 0x1B, 0xE3, 0xDD, 0x80, 0x7E, 0xCF, 0x69, 0x97, 0x5A, 0x76, 0xD5, + 0xAA, 0x7D, 0x85, 0x73, 0x10, 0x4E, 0x79, 0x9A, 0x10, 0x10, 0x01, 0xD8, 0xD7, 0x85, 0x41, 0x8D, + 0x3D, 0xEA, 0xE3, 0x59, 0xD9, 0x31, 0x4B, 0x23, 0xC6, 0x53, 0x11, 0xA6, 0x35, 0x29, 0x64, 0x7E, + 0x28, 0xD7, 0x8D, 0x03, 0x70, 0x5C, 0x53, 0xA7, 0x6D, 0x81, 0x30, 0x7B, 0xDF, 0x2B, 0xAE, 0xAB, + 0x6F, 0x52, 0x93, 0xCF, 0xDD, 0x00, 0x35, 0xE9, 0x65, 0x4A, 0x04, 0x79, 0x11, 0x30, 0xCA, 0xC7, + 0xD2, 0xF3, 0x34, 0xAC, 0x32, 0x1F, 0xE4, 0xE5, 0x83, 0x12, 0x66, 0xD6, 0xA6, 0xE4, 0xEB, 0x67, + 0x7E, 0xDD, 0x64, 0x3E, 0xF1, 0x0C, 0xE6, 0x1C, 0xB6, 0xE1, 0xB0, 0x2B, 0xE7, 0x83, 0xB4, 0x4A, + 0x82, 0xDD, 0xC1, 0x22, 0x3F, 0x03, 0x38, 0x90, 0xB2, 0xA9, 0x7B, 0x60, 0x57, 0xF9, 0xDD, 0x04, + 0x60, 0x5D, 0x7C, 0x2C, 0xD3, 0xE6, 0xFE, 0x02, 0x5A, 0x7D, 0x2A, 0x48, 0x81, 0x42, 0x20, 0x84, + 0xFF, 0x1D, 0xCC, 0x64, 0x11, 0x70, 0xE5, 0x4F, 0x9F, 0xE0, 0x11, 0xFB, 0xF0, 0xE2, 0xC4, 0x9B, + 0x11, 0x30, 0x7F, 0x2F, 0x7F, 0xA1, 0xB1, 0xBC, 0x5F, 0x29, 0x21, 0xDF, 0xB4, 0xEB, 0xB2, 0x4F, + 0xAA, 0x2D, 0x95, 0x60, 0x47, 0x78, 0x37, 0x67, 0xCD, 0xFA, 0x36, 0x17, 0x8F, 0x64, 0x15, 0xAF, + 0x04, 0xAA, 0x5C, 0x76, 0x23, 0x07, 0x64, 0x96, 0xB2, 0x5A, 0xCF, 0x03, 0xDC, 0xC3, 0x2D, 0xFB, + 0x0D, 0x2D, 0xA8, 0xBD, 0xCE, 0x58, 0xF8, 0x44, 0x75, 0xA1, 0x07, 0xAA, 0xDF, 0x25, 0xDC, 0x25, + 0x32, 0xCF, 0xA8, 0x92, 0xC5, 0xC0, 0xD5, 0x70, 0x21, 0x19, 0x6F, 0x32, 0xCA, 0x16, 0xFA, 0x8C, + 0xB2, 0x86, 0xF6, 0xD5, 0x2E, 0xD9, 0x0A, 0x9C, 0x96, 0xDB, 0x4D, 0xA4, 0x11, 0x02, 0x4C, 0x33, + 0x99, 0xB3, 0x5E, 0x45, 0x5C, 0xF1, 0x99, 0x61, 0x04, 0x20, 0xC9, 0xC8, 0xB3, 0xB4, 0xD3, 0x8B, + 0x24, 0x78, 0x55, 0x2E, 0xB7, 0x48, 0x43, 0x17, 0xBF, 0xB9, 0x2A, 0xCC, 0xD5, 0x4A, 0x49, 0xB2, + 0x4E, 0x1E, 0xC7, 0x45, 0x4E, 0x55, 0xC4, 0xBC, 0xB1, 0xD2, 0xA6, 0x62, 0xE9, 0x95, 0xBB, 0xCD, + 0x87, 0xD2, 0x7C, 0xE5, 0xC6, 0x77, 0x5B, 0xFF, 0xAF, 0xDD, 0x44, 0x9D, 0x3D, 0x10, 0x05, 0x3C, + 0x77, 0x7A, 0xF8, 0x84, 0x0D, 0x04, 0x55, 0xB5, 0x20, 0xEA, 0xD2, 0x3F, 0x04, 0x33, 0xFF, 0xE2, + 0x01, 0x3B, 0x51, 0x46, 0x3E, 0x34, 0xAA, 0x40, 0xCA, 0x7C, 0x85, 0x46, 0x57, 0xD9, 0xB7, 0xE1, + 0xDC, 0x65, 0xEF, 0x11, 0x66, 0x0B, 0xBA, 0xD8, 0x37, 0x66, 0x96, 0x64, 0x54, 0x8B, 0x05, 0x81, + 0x47, 0x87, 0x70, 0xA8, 0x54, 0xC6, 0x02, 0x08, 0xB4, 0xAD, 0x69, 0x3C, 0xC0, 0x03, 0x69, 0x19, + 0xE6, 0xAC, 0x13, 0xD5, 0x3F, 0x2C, 0x9D, 0x61, 0xCC, 0xA8, 0x60, 0xB5, 0x60, 0x85, 0x19, 0x5B, + 0x3E, 0x82, 0xCA, 0x34, 0x70, 0x06, 0xCD, 0x37, 0x3E, 0x91, 0x2F, 0x49, 0x82, 0x0A, 0x87, 0xE8, + 0x09, 0x18, 0xB3, 0xF4, 0x16, 0xA4, 0xA5, 0x46, 0xC5, 0x76, 0x6D, 0x73, 0xB1, 0x93, 0xDC, 0x69, + 0xF4, 0x49, 0xF8, 0x2F, 0x97, 0xB4, 0xAA, 0x19, 0x4A, 0x60, 0xD2, 0xF9, 0x7B, 0x5A, 0xF0, 0x57, + 0x45, 0xC6, 0xA2, 0x64, 0x37, 0x56, 0xED, 0x6B, 0x5E, 0x1D, 0x9E, 0x35, 0x5E, 0xFE, 0xDE, 0x04, + 0x08, 0x3B, 0x62, 0x40, 0x82, 0xD4, 0xF9, 0xF3, 0x54, 0x95, 0x3E, 0x57, 0x49, 0x3A, 0x41, 0x41, + 0xDA, 0xD4, 0x78, 0x80, 0xC7, 0xF1, 0xDE, 0xA7, 0xFF, 0xDC, 0x53, 0xC9, 0x3A, 0x37, 0xA5, 0x83, + 0xDE, 0xE8, 0x51, 0x33, 0x7B, 0xE6, 0xAC, 0xA5, 0xC4, 0x7D, 0x34, 0xB0, 0x99, 0x0D, 0x03, 0x34, + 0x0F, 0x8D, 0xB8, 0x10, 0x4E, 0x30, 0x38, 0x10, 0xFC, 0x62, 0xC3, 0xC0, 0xF5, 0x67, 0x69, 0xF5, + 0x23, 0xB4, 0xF2, 0x6B, 0x79, 0xA8, 0xEE, 0xF0, 0xDD, 0x06, 0xA1, 0x50, 0x41, 0x3E, 0x1D, 0x04, + 0xB0, 0xB7, 0xC8, 0x58, 0x20, 0x72, 0xF6, 0x41, 0x53, 0x58, 0xAA, 0xAB, 0xA1, 0x19, 0xB0, 0x99, + 0xE4, 0x35, 0x44, 0x32, 0xF0, 0x34, 0x52, 0x4E, 0xD0, 0xBC, 0x1D, 0xD2, 0x14, 0x6A, 0x22, 0x46, + 0x93, 0x52, 0xFF, 0xD5, 0xD9, 0xEF, 0x19, 0xAF, 0xFB, 0x9A, 0x0D, 0x4A, 0x14, 0x49, 0xAE, 0xC0, + 0x09, 0x5E, 0x40, 0x36, 0x63, 0xE7, 0xC3, 0xFA, 0x84, 0x1C, 0xBF, 0x65, 0x17, 0xED, 0xED, 0x49, + 0x93, 0xB9, 0xCD, 0x85, 0x3F, 0x95, 0x57, 0xF9, 0xE7, 0x59, 0x55, 0x59, 0xED, 0x3A, 0xA1, 0x90, + 0x24, 0x36, 0xB8, 0x38, 0x91, 0x57, 0x59, 0xDB, 0xDE, 0x8E, 0x8B, 0x3A, 0xBB, 0x31, 0x76, 0x39, + 0x0D, 0x20, 0x84, 0x8A, 0x05, 0x5A, 0xC1, 0x93, 0x04, 0x5E, 0x9E, 0x2E, 0x41, 0x13, 0xC9, 0x7F, + 0xAB, 0x45, 0x86, 0x99, 0xB2, 0x5C, 0x7E, 0x1A, 0x1C, 0x9C, 0x7C, 0xCF, 0x60, 0x38, 0xF7, 0x02, + 0x8A, 0xE6, 0x74, 0x4F, 0x31, 0x67, 0x99, 0x96, 0xC3, 0x79, 0xEB, 0x19, 0x07, 0xAD, 0xBB, 0xD2, + 0xD7, 0x51, 0x75, 0xDD, 0xD5, 0x44, 0xC2, 0x9A, 0xDE, 0x01, 0x68, 0x8C, 0xBF, 0x11, 0xFE, 0x5F, + 0xB9, 0xCF, 0x25, 0x35, 0xD2, 0xF7, 0x29, 0xE0, 0x63, 0x0F, 0x0A, 0xCA, 0xB9, 0x38, 0xB6, 0xDA, + 0xDD, 0x66, 0xD9, 0x5F, 0x67, 0x42, 0x15, 0xD8, 0x1C, 0xD1, 0x1C, 0xCC, 0xD6, 0xB9, 0x29, 0x85, + 0x99, 0xD6, 0xDD, 0xCE, 0x8E, 0x3D, 0x63, 0x1C, 0x31, 0x32, 0x37, 0xCD, 0xE1, 0xF8, 0xEA, 0x4E, + 0x31, 0x25, 0xF7, 0x2D, 0xE1, 0xCA, 0x36, 0x5B, 0xEC, 0xAC, 0x2B, 0xB0, 0xA5, 0x69, 0x3B, 0x4C, + 0xAE, 0xD7, 0x15, 0xF7, 0x7F, 0x5C, 0x5F, 0x82, 0xF0, 0x1D, 0x44, 0x62, 0xA0, 0x72, 0x57, 0xAD, + 0xB3, 0xD7, 0x1B, 0xA9, 0xE2, 0x76, 0xFF, 0x18, 0xA6, 0x3E, 0xF9, 0xF5, 0x6F, 0xB5, 0x13, 0x26, + 0x72, 0x0F, 0xF4, 0xE1, 0x7D, 0x43, 0x86, 0x48, 0x42, 0x0B, 0x94, 0x96, 0xBF, 0x0E, 0x32, 0x1C, + 0xE0, 0x18, 0x69, 0xA9, 0xAE, 0x83, 0x6F, 0x36, 0xE7, 0x04, 0x20, 0xEE, 0x34, 0xFF, 0x21, 0xE9, + 0xBA, 0x3B, 0x38, 0x48, 0x2D, 0x81, 0x38, 0x48, 0x25, 0xE5, 0x4A, 0xAD, 0x81, 0xA9, 0xE8, 0x33, + 0x0A, 0x4C, 0x60, 0xAE, 0xBB, 0xCC, 0x24, 0x96, 0x44, 0xF3, 0x1A, 0x2A, 0x89, 0xCB, 0xD9, 0x5E, + 0x89, 0x4C, 0xFD, 0x62, 0xA8, 0x38, 0x1E, 0x73, 0x63, 0xB3, 0xF1, 0x3E, 0xAC, 0xB1, 0x0B, 0x5D, + 0x10, 0xE5, 0xCC, 0x88, 0x2F, 0x9D, 0x57, 0xF1, 0x33, 0xA6, 0x50, 0x13, 0x2C, 0x54, 0x81, 0x1B, + 0x90, 0xD8, 0x6F, 0x7C, 0x02, 0x86, 0xA8, 0x02, 0x5F, 0xCE, 0x24, 0x22, 0x76, 0x73, 0xE8, 0x66, + 0xDC, 0x7F, 0x8F, 0x69, 0x4E, 0xBB, 0x63, 0xEB, 0xCD, 0x38, 0xE6, 0xEE, 0x84, 0x70, 0x97, 0x2F, + 0xD1, 0x77, 0xEE, 0x63, 0xE4, 0x2D, 0x42, 0xDE, 0x17, 0x95, 0x18, 0xB5, 0xA9, 0x4D, 0xFD, 0x2A, + 0xA8, 0x07, 0x1F, 0xCC, 0x3F, 0x22, 0x3B, 0x03, 0x49, 0xCF, 0x83, 0x83, 0x85, 0xAA, 0x87, 0xA0, + 0xC6, 0x30, 0x8C, 0x8F, 0x91, 0x88, 0x67, 0xA7, 0x1F, 0xE0, 0xE2, 0x40, 0x1E, 0xE9, 0x12, 0x2E, + 0x5C, 0x33, 0x44, 0x29, 0x0D, 0xEA, 0x34, 0x8B, 0x1A, 0x48, 0x80, 0x67, 0x45, 0x2A, 0xF2, 0x82, + 0xD8, 0x78, 0x7E, 0x36, 0x59, 0x6C, 0x32, 0x58, 0x3B, 0x0F, 0x2C, 0x0B, 0xD1, 0xFA, 0x67, 0x2B, + 0x0C, 0xFF, 0x16, 0x57, 0x04, 0x38, 0x51, 0x4F, 0x34, 0xEE, 0x94, 0x8B, 0xBB, 0x7B, 0xBE, 0xEA, + 0x37, 0xB5, 0x9F, 0xBA, 0xDE, 0xC1, 0xC6, 0x34, 0x2D, 0x36, 0xE6, 0xC8, 0x67, 0x6A, 0x74, 0x56, + 0xB5, 0x05, 0x53, 0xAE, 0x5C, 0x94, 0x83, 0xF9, 0xE0, 0xD7, 0x21, 0xC2, 0x71, 0x4B, 0x0F, 0x9C, + 0x64, 0x1C, 0xF4, 0x6A, 0xF8, 0xE3, 0x3C, 0x8F, 0xD2, 0x20, 0xCF, 0x14, 0xAC, 0x21, 0xF5, 0x2A, + 0xE7, 0xEC, 0x5C, 0x49, 0xAB, 0x21, 0xF2, 0x41, 0x2C, 0x3B, 0xA0, 0x49, 0x43, 0xF3, 0x14, 0xFE, + 0x68, 0x7C, 0x83, 0x05, 0xF3, 0x71, 0x77, 0x02, 0x2B, 0xD4, 0x94, 0x2B, 0x28, 0x5E, 0x4A, 0x5E, + 0x6E, 0x81, 0x1A, 0xD3, 0xDA, 0x58, 0x9F, 0xD6, 0x7B, 0x6D, 0xAD, 0x14, 0xBC, 0x60, 0xFC, 0xC4, + 0x83, 0x0A, 0x8E, 0x9B, 0x8D, 0x5B, 0x24, 0x77, 0x10, 0x34, 0x78, 0xC9, 0x8F, 0xA5, 0x2D, 0x0F, + 0x6A, 0x88, 0x7F, 0x24, 0x40, 0x46, 0x25, 0x3A, 0xDE, 0xB9, 0x9E, 0xA2, 0xE7, 0x8D, 0x52, 0xA2, + 0xFF, 0xDE, 0xB4, 0x95, 0xDB, 0x05, 0x2E, 0xDF, 0x29, 0x28, 0xB5, 0x76, 0xD6, 0x1D, 0x09, 0x45, + 0x69, 0x29, 0xF9, 0x95, 0xAA, 0x36, 0x71, 0xD9, 0x3F, 0xFF, 0x6B, 0x04, 0xFE, 0xED, 0x63, 0xC8, + 0x3C, 0x4B, 0x6B, 0x0B, 0xF3, 0xD8, 0x71, 0x15, 0xDA, 0xC0, 0xC9, 0xE2, 0x0D, 0x87, 0x94, 0x61, + 0xBE, 0xEF, 0x79, 0x92, 0x4C, 0x14, 0x92, 0xBF, 0x0C, 0x4E, 0xA0, 0x1B, 0x58, 0x00, 0x30, 0xF6, + 0xD0, 0x09, 0xD6, 0x1E, 0x81, 0xA0, 0xE7, 0xFD, 0xFD, 0xFF, 0x21, 0x47, 0xAB, 0xDE, 0x67, 0xC6, + 0xF4, 0x19, 0x60, 0x0C, 0x49, 0xE5, 0xC4, 0xBD, 0x64, 0x05, 0xED, 0x89, 0xD7, 0xBD, 0x74, 0xF7, + 0xD4, 0xCC, 0x4B, 0x9E, 0xEB, 0x6E, 0xB7, 0x87, 0xB6, 0x31, 0x07, 0xCB, 0x6E, 0x0D, 0xDF, 0x3A, + 0xD8, 0x64, 0x1F, 0xF9, 0x2C, 0xEE, 0xC0, 0x61, 0x22, 0x0E, 0x5A, 0x20, 0x0C, 0xD4, 0x4F, 0xC5, + 0x2D, 0x82, 0x63, 0x39, 0x36, 0x34, 0x07, 0xC6, 0x23, 0xBC, 0xF1, 0x56, 0xC6, 0x8C, 0x39, 0x23, + 0x43, 0xFF, 0xEC, 0xBE, 0x95, 0x7B, 0xC7, 0xFD, 0xA9, 0x99, 0x3D, 0xDF, 0x50, 0x28, 0x39, 0xCA, + 0x80, 0xCF, 0x1C, 0xE7, 0x81, 0x06, 0xB4, 0x43, 0x55, 0xFB, 0xB0, 0xA4, 0x5D, 0x78, 0x39, 0x71, + 0x88, 0xEC, 0xBB, 0x01, 0x69, 0x5E, 0x85, 0x97, 0x1F, 0xEB, 0x6C, 0x82, 0x07, 0xF4, 0x00, 0x1B, + 0x90, 0x03, 0x1B, 0x92, 0x9A, 0x4A, 0x95, 0x9D, 0x45, 0x45, 0x65, 0x6F, 0x8B, 0x70, 0x4C, 0xFE, + 0x48, 0x94, 0x5B, 0x71, 0x86, 0x70, 0x45, 0xB7, 0x85, 0xD9, 0x59, 0x29, 0x94, 0x47, 0x5A, 0x17, + 0x96, 0xA1, 0x0E, 0xFD, 0x72, 0x71, 0xE1, 0x3F, 0x7B, 0xE6, 0x59, 0x2A, 0x91, 0x5A, 0x6B, 0x82, + 0xB1, 0xA1, 0x31, 0xC2, 0xE4, 0xE3, 0xB9, 0x8E, 0x5A, 0x68, 0xC1, 0x18, 0xD4, 0x4B, 0x02, 0x2E, + 0x50, 0x3D, 0x73, 0x53, 0x2B, 0x13, 0x77, 0x19, 0xC7, 0x03, 0x0B, 0xB5, 0xAD, 0x5C, 0x0B, 0x6B, + 0x66, 0x12, 0xF0, 0xE8, 0x67, 0xB7, 0xF7, 0x88, 0x64, 0xA8, 0x2C, 0x51, 0xA7, 0xF8, 0x5E, 0xB3, + 0x39, 0xEC, 0x1B, 0xDF, 0x6C, 0x89, 0x16, 0xFD, 0x51, 0x26, 0x29, 0x8D, 0x0E, 0xBE, 0x1B, 0xCE, + 0x61, 0xE5, 0x22, 0x09, 0xC1, 0x0F, 0xAD, 0x0C, 0xA1, 0x61, 0xF8, 0x49, 0x29, 0x11, 0x7C, 0x93, + 0x0C, 0xBE, 0xD0, 0x11, 0x6F, 0x24, 0x4E, 0x4B, 0xF5, 0xEF, 0x41, 0x3D, 0x0C, 0x69, 0xC6, 0xA6, + 0xBF, 0x87, 0x68, 0xFF, 0x2F, 0x76, 0xD9, 0xFD, 0x1D, 0x8E, 0x9F, 0x80, 0x19, 0x3B, 0x35, 0x8B, + 0x2D, 0xDB, 0x5C, 0x3E, 0x86, 0xE8, 0xBF, 0xF1, 0x30, 0x88, 0xE4, 0x80, 0xD0, 0x49, 0xC3, 0x50, + 0xF8, 0x1E, 0xCE, 0xDA, 0xAC, 0x2E, 0x3F, 0x97, 0x51, 0x12, 0x89, 0x47, 0x5D, 0xF4, 0xD4, 0x77, + 0x93, 0x66, 0x74, 0xE3, 0x4C, 0xCD, 0xB4, 0xC8, 0x00, 0x85, 0x64, 0x8C, 0x04, 0x72, 0x1C, 0x14, + 0xDA, 0x77, 0xD7, 0x1D, 0x39, 0xC3, 0x65, 0xD0, 0x28, 0x51, 0xCA, 0x91, 0xAE, 0x2D, 0xCD, 0x50, + 0x0D, 0x1B, 0xA4, 0xF1, 0x5D, 0x4C, 0x28, 0x1C, 0x57, 0xE5, 0x00, 0xEC, 0xA4, 0x02, 0x3B, 0xCA, + 0x70, 0xF3, 0x8B, 0x3C, 0x4F, 0xEE, 0x9D, 0x08, 0xFF, 0x66, 0x31, 0xCE, 0x37, 0x93, 0x90, 0x3D, + 0x6E, 0xDE, 0xB9, 0xCF, 0x35, 0xAA, 0xF0, 0x43, 0x3E, 0x6B, 0x19, 0xEC, 0x69, 0x7A, 0xF0, 0xC6, + 0xC3, 0x7D, 0x49, 0x89, 0x43, 0xCC, 0x2C, 0x20, 0x2E, 0xB8, 0x5D, 0xCC, 0xDB, 0x39, 0xCB, 0x0B, + 0x76, 0xD8, 0xAC, 0xD6, 0x2A, 0x76, 0x59, 0x7F, 0x6A, 0x1B, 0xCD, 0x4A, 0x93, 0xCA, 0x42, 0x5F, + 0xC7, 0x98, 0xFA, 0xC9, 0x30, 0x2E, 0x9F, 0x8F, 0xE5, 0xB5, 0x37, 0x41, 0x19, 0xF4, 0xA0, 0xE5, + 0xDA, 0x7D, 0x3C, 0xF5, 0x61, 0xCC, 0x98, 0x27, 0xED, 0xE4, 0x5C, 0x0E, 0x7C, 0x1B, 0x33, 0x38, + 0x77, 0x20, 0x92, 0xC9, 0xD3, 0x38, 0xC3, 0x03, 0x2C, 0xAF, 0xE2, 0x77, 0x34, 0x4B, 0xE2, 0x1C, + 0x9F, 0xE4, 0x4D, 0xAB, 0x12, 0xFE, 0xCD, 0xB3, 0x2C, 0xD3, 0xE2, 0x42, 0xB8, 0xE7, 0xE0, 0x14, + 0x88, 0x31, 0xB1, 0xDC, 0x35, 0xDE, 0xCD, 0x3D, 0x3B, 0xDF, 0x6C, 0x00, 0xA3, 0x48, 0xA6, 0x71, + 0x7E, 0xC6, 0x3A, 0xE8, 0x07, 0xCE, 0xC8, 0xE7, 0xDC, 0xB1, 0x98, 0x17, 0xDB, 0x75, 0x20, 0xFE, + 0x38, 0xC7, 0x1F, 0x02, 0x8E, 0xE4, 0x91, 0x79, 0x3D, 0xC0, 0x50, 0x2D, 0xC7, 0x49, 0x33, 0x6C, + 0xDF, 0x3C, 0xE9, 0x42, 0xE9, 0x27, 0xBC, 0x39, 0x38, 0xAA, 0x98, 0x16, 0x6E, 0x1F, 0x71, 0xDF, + 0x3B, 0xBA, 0x15, 0x2F, 0x69, 0xEB, 0x06, 0x5C, 0xFB, 0xF8, 0x4C, 0x83, 0x2C, 0x28, 0xC2, 0x19, + 0xAD, 0x04, 0xA1, 0xB0, 0x7F, 0xF1, 0x9C, 0x84, 0x38, 0x42, 0x45, 0x3E, 0x1E, 0xC7, 0x95, 0xD5, + 0xAF, 0x35, 0x7E, 0x2A, 0xCC, 0x06, 0x9D, 0x9A, 0xCF, 0xC2, 0x56, 0xE6, 0x73, 0x7F, 0x7E, 0x9D, + 0x9B, 0x01, 0x27, 0x76, 0x14, 0x8C, 0x3E, 0x3A, 0xBD, 0x2E, 0x6C, 0x7C, 0xB7, 0xF2, 0x9A, 0x92, + 0x41, 0xBC, 0xD0, 0x48, 0xF6, 0xE6, 0x16, 0x62, 0x01, 0x4D, 0x3D, 0x8E, 0xD2, 0x98, 0x8F, 0x61, + 0x70, 0x7C, 0x41, 0xCC, 0xCA, 0x3D, 0x3E, 0x0B, 0x70, 0xC3, 0x9F, 0x9D, 0x3E, 0x33, 0x50, 0x2B, + 0xB0, 0x47, 0xC8, 0xA3, 0xAA, 0x55, 0xBA, 0x16, 0x3B, 0xF4, 0x07, 0x98, 0x1B, 0x6C, 0x49, 0x6A, + 0xA5, 0xB4, 0x7A, 0xBE, 0x28, 0x37, 0xF2, 0x55, 0x69, 0x09, 0x7A, 0xEC, 0x94, 0x1C, 0x60, 0xE3, + 0xB5, 0x89, 0x07, 0x58, 0x43, 0xA3, 0x3F, 0x1D, 0x94, 0x20, 0x49, 0x5E, 0xC1, 0xB7, 0x4E, 0x2C, + 0x75, 0x95, 0x54, 0x91, 0x4A, 0x01, 0x90, 0xF8, 0xF1, 0x81, 0xC6, 0x4C, 0x9A, 0x63, 0x20, 0x55, + 0x65, 0x8D, 0x30, 0xA2, 0xD4, 0xC7, 0xAF, 0x18, 0xA5, 0x83, 0xB6, 0x68, 0x1B, 0x35, 0x13, 0x6D, + 0xC6, 0x77, 0x5A, 0x04, 0xFB, 0xD5, 0xBD, 0x2B, 0x0D, 0x55, 0x5E, 0xEC, 0x7A, 0x80, 0x17, 0x01, + 0x9C, 0x4F, 0x55, 0x39, 0x57, 0x9F, 0x31, 0x9E, 0xB9, 0xB1, 0x35, 0xD5, 0x2F, 0xB9, 0xF3, 0x6A, + 0x9C, 0x30, 0xEA, 0x1B, 0xE9, 0x34, 0x4A, 0x2F, 0xB1, 0x36, 0x9C, 0xF0, 0x8A, 0xE9, 0x62, 0xDB, + 0x06, 0x32, 0x64, 0x39, 0x58, 0x29, 0xBD, 0xB1, 0x2C, 0x06, 0x56, 0x54, 0xAF, 0x6B, 0x97, 0x5A, + 0x7D, 0x49, 0xB6, 0xDF, 0x06, 0xFC, 0x9F, 0x06, 0x64, 0x89, 0xF5, 0xF4, 0xC4, 0x55, 0x02, 0x19, + 0xAA, 0xC9, 0x1D, 0x8A, 0x5E, 0x3D, 0xA7, 0x13, 0xEC, 0x52, 0x29, 0x8B, 0x6E, 0xC5, 0xA0, 0x62, + 0x9E, 0x89, 0x96, 0xDF, 0x5E, 0x74, 0x69, 0x53, 0x75, 0xCA, 0xF0, 0x95, 0x0E, 0xF8, 0x42, 0xB6, + 0x06, 0x62, 0xDA, 0x92, 0x48, 0xC3, 0x37, 0x50, 0x59, 0xDF, 0x59, 0xAF, 0xAF, 0x0E, 0x2E, 0x84, + 0xE5, 0x2F, 0x3C, 0xC9, 0x7E, 0x2A, 0xE5, 0xA9, 0x41, 0xB1, 0x51, 0x82, 0xC6, 0x42, 0xEC, 0x65, + 0xFD, 0xCB, 0x54, 0x29, 0x33, 0xC2, 0xE5, 0x5E, 0x10, 0xFB, 0x9E, 0x19, 0xE2, 0x75, 0x53, 0x43, + 0x50, 0xD5, 0x10, 0x8E, 0xBC, 0xC6, 0x2A, 0x0A, 0x8D, 0x7F, 0x4A, 0xF6, 0x07, 0x28, 0xA1, 0xEB, + 0x14, 0x1C, 0xD3, 0xE9, 0x63, 0x55, 0xC7, 0xD2, 0xE8, 0xB2, 0x3D, 0x17, 0x84, 0x63, 0xF9, 0x11, + 0xA4, 0x11, 0xE0, 0xA1, 0x83, 0x11, 0x11, 0xD2, 0xA0, 0x8C, 0x61, 0x74, 0x36, 0x63, 0xE9, 0xE8, + 0x98, 0x4C, 0x20, 0x38, 0x1F, 0xA5, 0x15, 0x60, 0x3E, 0x5C, 0x1B, 0xE6, 0xDE, 0xC1, 0x70, 0x7F, + 0xCB, 0x92, 0x76, 0x05, 0xD8, 0x63, 0xDF, 0x01, 0x7E, 0xF2, 0xF1, 0x01, 0xBD, 0xCE, 0x9A, 0x1E, + 0x50, 0x7F, 0xB4, 0xF4, 0x49, 0x5D, 0x7F, 0xCA, 0x86, 0x83, 0x2F, 0x63, 0x33, 0xEF, 0x4F, 0x35, + 0xA1, 0xBF, 0xB6, 0xCD, 0x25, 0xBA, 0x0E, 0xB9, 0xA3, 0x96, 0x41, 0xD4, 0x90, 0xFF, 0xEB, 0xF7, + 0x4F, 0x93, 0xC8, 0xD7, 0x04, 0x62, 0x6E, 0x88, 0xD7, 0x71, 0x0E, 0x0E, 0x37, 0x50, 0xCE, 0xFA, + 0x9B, 0xBD, 0x5B, 0xB0, 0xB7, 0x0F, 0x70, 0x75, 0x0A, 0x5D, 0xFC, 0x69, 0xB3, 0x07, 0x11, 0x9B, + 0xE8, 0x13, 0x0D, 0xBF, 0x08, 0x33, 0x59, 0x20, 0x4A, 0xBD, 0x27, 0x76, 0xED, 0xF2, 0x36, 0x0B, + 0xEA, 0xBC, 0x78, 0x17, 0xBD, 0x6E, 0x4F, 0x37, 0xD3, 0x26, 0x86, 0x85, 0xB1, 0x71, 0xEA, 0x55, + 0x73, 0xAA, 0x7C, 0xA2, 0x36, 0x75, 0xD2, 0xCD, 0xE4, 0xFC, 0xE7, 0xCE, 0x5E, 0xB1, 0xE5, 0xF4, + 0x65, 0xD7, 0x8F, 0x34, 0x07, 0x66, 0xA7, 0x4B, 0xCE, 0x55, 0xB0, 0x71, 0xFD, 0x20, 0x03, 0x5C, + 0xBA, 0x28, 0x0B, 0x71, 0x4D, 0x93, 0xB9, 0x77, 0x5E, 0x46, 0x6A, 0xCB, 0xD7, 0x0A, 0x59, 0x2E, + 0x26, 0x49, 0x0A, 0x36, 0x0F, 0x03, 0x6F, 0x32, 0xD7, 0xF0, 0xEC, 0x53, 0xF6, 0x0B, 0x1E, 0x08, + 0x27, 0x37, 0x69, 0xC5, 0x9F, 0x6C, 0x76, 0x27, 0x4C, 0x7A, 0x7C, 0xB7, 0xC8, 0x1B, 0xC4, 0x79, + 0xA1, 0xE3, 0xE0, 0xF3, 0x3B, 0x20, 0x07, 0x0C, 0xE4, 0xAB, 0x10, 0x6F, 0xA4, 0xFA, 0x7F, 0x08, + 0x6F, 0x5C, 0xAE, 0x06, 0xC5, 0x6D, 0x09, 0x1E, 0x2D, 0xDD, 0x80, 0xA7, 0x7B, 0x9E, 0xE6, 0x44, + 0x79, 0x3D, 0x55, 0x12, 0x51, 0x87, 0x4D, 0x4A, 0x66, 0x32, 0x2D, 0x4E, 0x17, 0x30, 0xAF, 0x77, + 0x7A, 0x8B, 0x44, 0x8D, 0xA4, 0xF8, 0x70, 0xC1, 0x99, 0x55, 0x3D, 0x4B, 0x08, 0x40, 0x2F, 0xA2, + 0xEA, 0xAA, 0x94, 0x24, 0xC3, 0xBD, 0x5C, 0x68, 0x35, 0x8D, 0x71, 0xA8, 0x3E, 0xBA, 0x00, 0x70, + 0x28, 0xB8, 0x10, 0x20, 0x8F, 0x5C, 0xE4, 0xC4, 0xBB, 0x22, 0x59, 0xA2, 0x35, 0x5F, 0x7A, 0x3D, + 0xF1, 0x24, 0x70, 0x1C, 0xE3, 0x3E, 0xED, 0x26, 0x07, 0xD7, 0x82, 0x4B, 0x80, 0x3B, 0x0C, 0xE4, + 0xAB, 0xCF, 0x71, 0x97, 0x87, 0x22, 0x2B, 0x53, 0x27, 0x99, 0x29, 0x10, 0x41, 0x30, 0xE8, 0x28, + 0xD2, 0x48, 0xAC, 0x25, 0x40, 0xBF, 0xDB, 0xED, 0x3A, 0xF4, 0x5D, 0x6E, 0x66, 0x1A, 0x08, 0xFF, + 0xEE, 0x49, 0x36, 0xD7, 0x68, 0x1E, 0xD7, 0xAB, 0xEC, 0xD6, 0x84, 0x1C, 0x8D, 0x35, 0x2D, 0x10, + 0x3C, 0x9C, 0x77, 0x12, 0xB3, 0x09, 0x5F, 0x0B, 0x2A, 0xB3, 0xCF, 0x8E, 0xE0, 0xF1, 0xAA, 0x71, + 0xB1, 0xE3, 0x58, 0x5C, 0xFF, 0xD1, 0x34, 0xE0, 0xBF, 0x20, 0x6D, 0x42, 0x86, 0xCA, 0x97, 0x1B, + 0x76, 0x2F, 0x08, 0x29, 0xEC, 0xD5, 0xDD, 0x04, 0x36, 0xFC, 0xCA, 0x39, 0xBE, 0x28, 0x8C, 0x1F, + 0x0D, 0x56, 0x77, 0xB7, 0xE0, 0x23, 0x41, 0x1E, 0xB4, 0x29, 0x17, 0x7A, 0xAF, 0xF9, 0x30, 0xCF, + 0xF1, 0xFE, 0xF4, 0x62, 0x32, 0xD9, 0xDB, 0x56, 0x9A, 0x2B, 0x31, 0xBF, 0xA5, 0x15, 0x19, 0x1E, + 0xEA, 0xCB, 0x5D, 0x6B, 0x65, 0x9A, 0x06, 0x1F, 0x9C, 0x0E, 0xC0, 0x5D, 0x8C, 0xFB, 0xD5, 0xCF, + 0xA4, 0x18, 0xA1, 0x0C, 0xAD, 0xD3, 0x98, 0x09, 0x3A, 0x86, 0x7F, 0x1C, 0x60, 0xC9, 0xFB, 0x42, + 0xF2, 0x37, 0x4E, 0xF0, 0x91, 0x02, 0x33, 0x41, 0xDE, 0xDB, 0xF8, 0x8E, 0x44, 0x00, 0xC5, 0x94, + 0x21, 0x39, 0x91, 0x0A, 0xB5, 0xC4, 0x44, 0xAC, 0x04, 0xF8, 0xB7, 0xA1, 0x13, 0x70, 0xA7, 0xEF, + 0x23, 0xBD, 0xF6, 0x12, 0x34, 0x30, 0x3A, 0x70, 0x81, 0x21, 0xE7, 0x66, 0xB8, 0x55, 0x00, 0xAF, + 0xC1, 0xC3, 0x56, 0x3D, 0xAB, 0x3D, 0xCA, 0x16, 0x4F, 0x6B, 0x3E, 0x69, 0xEF, 0xF8, 0xCA, 0x7B, + 0x65, 0x1C, 0xF3, 0xD9, 0xE8, 0xB0, 0xF6, 0xF3, 0x18, 0x9E, 0xDF, 0x45, 0xC7, 0xAF, 0xCE, 0xC8, + 0x5E, 0x51, 0x94, 0x76, 0x23, 0x80, 0xF8, 0x49, 0x9B, 0xB9, 0x7C, 0x2F, 0x3C, 0xE6, 0xB5, 0x2F, + 0xAD, 0xCC, 0xE7, 0xE7, 0x1E, 0x08, 0xBF, 0xFA, 0x70, 0x2C, 0xB3, 0xED, 0x0C, 0x29, 0x7D, 0xB0, + 0xBE, 0xE7, 0x91, 0x39, 0x73, 0xC2, 0x80, 0x77, 0x2F, 0x91, 0x1D, 0x2F, 0x45, 0x1E, 0x41, 0xE4, + 0x45, 0x2A, 0x7E, 0x93, 0xCE, 0x6D, 0x65, 0x18, 0x76, 0x61, 0x15, 0x05, 0x24, 0x0E, 0x65, 0xD6, + 0x19, 0x7A, 0xFF, 0x02, 0x94, 0xFB, 0x2D, 0x14, 0xE4, 0xA3, 0x9C, 0xFC, 0x48, 0x29, 0x3A, 0x7F, + 0x36, 0x4F, 0x18, 0xD5, 0x5B, 0x99, 0x4C, 0x97, 0x20, 0x36, 0x77, 0xA6, 0x75, 0xE3, 0x44, 0x92, + 0x47, 0x72, 0xEA, 0x1D, 0x00, 0x5A, 0x1D, 0xAF, 0x12, 0xAC, 0x26, 0xE9, 0x1E, 0x4C, 0x89, 0xCC, + 0x56, 0x01, 0x22, 0x4D, 0x45, 0x44, 0xAC, 0xB6, 0x75, 0xEF, 0x3F, 0x2B, 0x35, 0xC6, 0x06, 0x12, + 0xF6, 0xDB, 0xF1, 0x55, 0xF7, 0x05, 0xB0, 0xC0, 0x16, 0x13, 0x60, 0xAA, 0x01, 0x68, 0x1A, 0xCF, + 0xA3, 0xDE, 0xC2, 0xED, 0x60, 0xB9, 0x38, 0x0A, 0x78, 0x7C, 0x5A, 0x96, 0x70, 0x3E, 0x1E, 0xDC, + 0xCD, 0x80, 0xDE, 0x5B, 0x63, 0x94, 0x01, 0x9D, 0x68, 0x02, 0xB9, 0x64, 0xBC, 0x89, 0xCA, 0xB4, + 0x12, 0xD7, 0x5E, 0x20, 0xC7, 0xBD, 0x39, 0x21, 0xAD, 0x74, 0x3A, 0x04, 0x8F, 0x5F, 0xE2, 0x55, + 0xE2, 0xA4, 0x8F, 0xE0, 0xFB, 0x9D, 0xBD, 0x67, 0xCF, 0xD8, 0x93, 0x6C, 0x84, 0xE7, 0xB6, 0xCE, + 0xBD, 0x7B, 0xDA, 0x93, 0x18, 0x70, 0x6B, 0x48, 0xBA, 0x0E, 0x66, 0x09, 0x2E, 0x91, 0x55, 0x38, + 0x84, 0x02, 0x18, 0x1D, 0x49, 0xDE, 0x25, 0xB3, 0x7E, 0xE8, 0xD0, 0x6E, 0xDD, 0x13, 0x8F, 0xA4, + 0x95, 0x17, 0x01, 0x0D, 0x93, 0xB0, 0xD8, 0xBD, 0x0C, 0xCA, 0x48, 0x62, 0xFA, 0xF5, 0xEA, 0xC5, + 0x71, 0x21, 0x00, 0xEC, 0x3A, 0x88, 0x26, 0xA1, 0x52, 0xBA, 0xBF, 0x2A, 0x70, 0xEB, 0xF7, 0x2B, + 0x43, 0xF4, 0xF6, 0xE3, 0xD0, 0x63, 0x1A, 0xA1, 0x0C, 0x00, 0xFE, 0xF9, 0x12, 0xE1, 0xED, 0x2A, + 0xFD, 0x19, 0x4E, 0x51, 0x22, 0xA0, 0x4C, 0x09, 0x2F, 0x0B, 0x8A, 0x57, 0xFA, 0x3E, 0xF3, 0x02, + 0xE3, 0xF0, 0x8F, 0x17, 0x6E, 0xC1, 0x45, 0x34, 0x95, 0x61, 0x22, 0x9E, 0x72, 0xA9, 0x50, 0x77, + 0x07, 0x64, 0xEE, 0x52, 0x03, 0x10, 0xBA, 0x09, 0xF9, 0x45, 0x29, 0x58, 0x46, 0x24, 0xE7, 0x0F, + 0x21, 0xE0, 0xC8, 0xC8, 0x69, 0xCB, 0x4C, 0xD8, 0x39, 0x0E, 0x0C, 0x24, 0x68, 0x46, 0x1E, 0xD9, + 0x7A, 0x8C, 0xB2, 0x91, 0xF4, 0x1B, 0x96, 0xDE, 0x63, 0xFF, 0xE7, 0xCB, 0x86, 0x9F, 0xCD, 0xFB, + 0xBF, 0x67, 0xBE, 0x46, 0xF7, 0x0E, 0x1F, 0x1D, 0x77, 0x4F, 0x66, 0x4F, 0x4F, 0x09, 0x4E, 0x79, + 0x33, 0x80, 0x66, 0xA5, 0xD0, 0x47, 0xAD, 0x50, 0x3D, 0x45, 0xE5, 0x15, 0xCB, 0x05, 0xA9, 0xC8, + 0xFB, 0x0F, 0x00, 0xB6, 0x9F, 0xF7, 0xC2, 0x1B, 0x15, 0x2B, 0xD1, 0x01, 0xA2, 0x5A, 0xFB, 0x26, + 0x3D, 0x9E, 0xAC, 0x37, 0x2C, 0x0B, 0x3A, 0xD3, 0xE8, 0x99, 0xAF, 0xB0, 0x12, 0x17, 0x06, 0x0C, + 0x7B, 0xF1, 0x6D, 0xB5, 0x8D, 0x18, 0xE4, 0x32, 0x3F, 0x51, 0xC2, 0x20, 0x20, 0xC6, 0x47, 0x22, + 0x08, 0x94, 0x32, 0x99, 0x17, 0x4A, 0x50, 0x36, 0x1E, 0xA2, 0x88, 0xCE, 0x01, 0xAF, 0x78, 0xF5, + 0x6B, 0xF2, 0xA2, 0x0C, 0x8E, 0xC5, 0xE4, 0x31, 0x9C, 0x28, 0xA4, 0x7F, 0x4E, 0x64, 0x1D, 0xF5, + 0xC1, 0x1A, 0x68, 0xE2, 0xF4, 0x3A, 0x99, 0xBC, 0xD3, 0x31, 0xF9, 0xD8, 0x58, 0x7B, 0xB1, 0xB7, + 0x7D, 0x57, 0x2B, 0x7D, 0xAC, 0x4A, 0x43, 0x9E, 0xB2, 0x50, 0x96, 0x06, 0x99, 0x17, 0x89, 0x6A, + 0xA7, 0x2E, 0xC2, 0xB9, 0xA2, 0xBB, 0x96, 0xD4, 0x03, 0xD5, 0xF2, 0xB4, 0xA7, 0x78, 0xE6, 0x65, + 0x31, 0xD2, 0x43, 0x75, 0x4A, 0xD1, 0xB5, 0xE6, 0x07, 0x98, 0x27, 0xAA, 0xBD, 0xCD, 0x32, 0xF1, + 0x80, 0xCE, 0x9E, 0xCD, 0xF2, 0xA1, 0x50, 0xD0, 0x88, 0x02, 0xF0, 0x1C, 0x10, 0x70, 0xAA, 0xA5, + 0xDF, 0x70, 0x32, 0x7E, 0x89, 0xAE, 0x51, 0x37, 0x84, 0x13, 0x18, 0xCE, 0x7D, 0x4C, 0x8A, 0x16, + 0x99, 0xA2, 0x42, 0x9D, 0x5D, 0x9C, 0x81, 0x86, 0x4D, 0x15, 0x96, 0xF0, 0xE6, 0xE1, 0x38, 0x11, + 0xA6, 0x8A, 0x15, 0x14, 0xF7, 0x13, 0xAD, 0x33, 0x81, 0xB5, 0xF4, 0x65, 0x87, 0x87, 0x6F, 0x97, + 0x2F, 0x5D, 0xED, 0xEC, 0xA7, 0xB6, 0x91, 0xE2, 0xF3, 0x7B, 0xE5, 0xC8, 0x7E, 0x3A, 0x26, 0x54, + 0x9C, 0xC3, 0xD3, 0x6C, 0x4B, 0x6A, 0x78, 0x48, 0xF3, 0x0E, 0xCF, 0xBF, 0x9A, 0xC8, 0x60, 0x46, + 0x0B, 0x6C, 0x92, 0x6B, 0x88, 0x6F, 0x42, 0x39, 0xB0, 0xC2, 0x43, 0x8D, 0xA6, 0x4A, 0xF8, 0xF5, + 0x1E, 0x23, 0x74, 0xF7, 0x15, 0xB2, 0x15, 0xEB, 0x5A, 0x2A, 0xCA, 0xA5, 0x2C, 0xCC, 0x3C, 0x7D, + 0x63, 0x65, 0x7F, 0x3A, 0xA8, 0x35, 0xB0, 0x77, 0x54, 0x1A, 0xCB, 0xA5, 0x07, 0x1E, 0x2C, 0x60, + 0x3C, 0x66, 0x32, 0x55, 0x75, 0xEB, 0x57, 0x35, 0xE2, 0xD3, 0xC2, 0x73, 0x5D, 0xF7, 0xC2, 0xB6, + 0xEE, 0x45, 0x1C, 0x19, 0xE6, 0xF9, 0x23, 0x24, 0x23, 0xBA, 0x77, 0x6B, 0x93, 0x73, 0xA0, 0x9C, + 0xF9, 0xF0, 0x59, 0xE7, 0xB4, 0x60, 0xC3, 0xA6, 0x01, 0xEA, 0xC7, 0x52, 0x2B, 0xDC, 0xDC, 0x96, + 0x0F, 0x3C, 0xB0, 0x19, 0x19, 0xE1, 0x52, 0xB6, 0x17, 0x91, 0x2A, 0x4D, 0xC3, 0xFC, 0x44, 0x33, + 0x5F, 0x9D, 0x36, 0x51, 0x3C, 0x02, 0x6D, 0x68, 0x23, 0x64, 0x1B, 0xA0, 0xA3, 0xD7, 0xEA, 0x64, + 0x60, 0xB9, 0xEB, 0xC5, 0x3F, 0xB5, 0x52, 0xC8, 0xC4, 0xC8, 0x73, 0x36, 0x73, 0x28, 0x67, 0xF1, + 0x2A, 0x3C, 0xA6, 0x8A, 0xDB, 0x99, 0x81, 0x90, 0xDF, 0xD7, 0x4C, 0x1F, 0xD1, 0xD9, 0x0D, 0xCE, + 0x6C, 0xD8, 0x8A, 0x03, 0xB4, 0x70, 0x3A, 0x07, 0x2E, 0x2E, 0x5E, 0xA5, 0x5C, 0xBF, 0x51, 0x36, + 0x97, 0x42, 0xA5, 0x76, 0x2A, 0xCA, 0x0A, 0x51, 0x5D, 0x06, 0x78, 0x0E, 0xCF, 0x9E, 0x93, 0x59, + 0x5C, 0x17, 0x05, 0xB6, 0xF2, 0x0D, 0x02, 0xD6, 0x2D, 0x2E, 0x20, 0x62, 0x8D, 0xF7, 0x38, 0xE0, + 0xC1, 0x5E, 0x17, 0x72, 0x4D, 0xA4, 0x2F, 0x5B, 0xDC, 0xC6, 0x40, 0x82, 0x34, 0x04, 0x39, 0x69, + 0xF8, 0xBC, 0xB1, 0x79, 0x54, 0xD5, 0x1E, 0x2D, 0xD8, 0x8C, 0x90, 0x8D, 0xB4, 0xE3, 0x61, 0xB7, + 0x1D, 0xA2, 0x3C, 0xFB, 0x6A, 0x38, 0x98, 0x06, 0xDA, 0x56, 0x2C, 0xBF, 0x9B, 0x14, 0x76, 0xE6, + 0x3C, 0x01, 0x57, 0xCC, 0xC2, 0x08, 0x0C, 0xBC, 0x10, 0x09, 0x67, 0xAB, 0x01, 0x2A, 0x32, 0x6C, + 0x81, 0x2C, 0xAB, 0xD3, 0xEC, 0x7D, 0x87, 0x48, 0x16, 0x28, 0xAC, 0x1D, 0x61, 0x11, 0x31, 0x87, + 0xD6, 0x2B, 0xB0, 0x36, 0xB1, 0x18, 0xDD, 0xE7, 0xD0, 0x46, 0x57, 0x93, 0xFC, 0xDF, 0xD2, 0x3A, + 0x37, 0x49, 0x42, 0xDB, 0xE6, 0x45, 0x46, 0x22, 0xB0, 0xF2, 0x92, 0xEE, 0x52, 0x94, 0x9F, 0xFE, + 0xB1, 0xD2, 0x33, 0x45, 0xAD, 0xC9, 0x6D, 0x11, 0x79, 0x57, 0xF1, 0x80, 0xF4, 0x07, 0xAE, 0xDF, + 0x11, 0x6C, 0x85, 0x58, 0x49, 0x2F, 0x13, 0x81, 0xB9, 0x66, 0x73, 0xAB, 0x84, 0x94, 0x36, 0xC4, + 0xC6, 0x23, 0x5F, 0xC5, 0x36, 0xC6, 0xBE, 0x8E, 0x6B, 0xE9, 0x97, 0xF0, 0xAC, 0xB4, 0xF1, 0x11, + 0x43, 0xB4, 0xD2, 0xC0, 0x79, 0x5E, 0x88, 0x72, 0xC7, 0x46, 0x6B, 0x22, 0xC7, 0xF2, 0x7B, 0x61, + 0xC8, 0xFA, 0x39, 0x65, 0x45, 0x97, 0xF0, 0xC7, 0xCE, 0x74, 0x09, 0x9F, 0x5D, 0xB7, 0x68, 0xF2, + 0x2E, 0x6E, 0x2D, 0x42, 0x56, 0x9C, 0xED, 0xC5, 0x5A, 0x57, 0xD9, 0x53, 0x5A, 0xB4, 0xE8, 0x15, + 0x07, 0x1B, 0xFB, 0x31, 0x40, 0x14, 0x95, 0x77, 0x33, 0x74, 0x71, 0x73, 0x7B, 0xFA, 0xA7, 0xBF, + 0x51, 0xF8, 0x3D, 0xE6, 0xB1, 0xD0, 0x42, 0x25, 0x52, 0xFC, 0x4F, 0x1A, 0xA6, 0x4D, 0xAF, 0xCD, + 0x13, 0x62, 0x7A, 0xBF, 0x22, 0x98, 0xD6, 0x07, 0x9C, 0xAE, 0x5E, 0xFC, 0x96, 0xEC, 0x0E, 0x79, + 0x84, 0x1F, 0x73, 0x60, 0x6C, 0x02, 0x6C, 0xE5, 0xB7, 0xFD, 0x7A, 0x4B, 0x8D, 0x0D, 0xC0, 0xD7, + 0x0A, 0x70, 0x6E, 0xE1, 0x51, 0x0E, 0x8C, 0xAA, 0x02, 0x6A, 0xCF, 0x61, 0x04, 0xBD, 0x53, 0x9D, + 0xE0, 0xB5, 0x28, 0x1E, 0x24, 0xBA, 0x97, 0x13, 0x0C, 0x6E, 0x93, 0x71, 0xE2, 0x68, 0xEC, 0x73, + 0x2C, 0xEC, 0x80, 0xB2, 0x16, 0xD5, 0x38, 0xC6, 0x3B, 0xCE, 0xEB, 0xB9, 0x42, 0xBE, 0x37, 0xB5, + 0x39, 0x31, 0x00, 0x5F, 0xB6, 0xD1, 0xB6, 0xD9, 0x57, 0x34, 0x82, 0x12, 0x07, 0x05, 0x04, 0x4B, + 0x5E, 0xB8, 0xC7, 0x6F, 0xA3, 0x01, 0xB9, 0x1D, 0xFF, 0x5F, 0x52, 0xBF, 0x6E, 0x7B, 0xA8, 0xC3, + 0x6E, 0xAC, 0x00, 0xCD, 0x0A, 0xAB, 0x7D, 0x4E, 0x63, 0x43, 0xCE, 0x10, 0x21, 0x38, 0x42, 0x88, + 0x8D, 0xA7, 0x46, 0x7F, 0x74, 0x1F, 0x1D, 0x5F, 0x25, 0xD2, 0xC0, 0x18, 0x7D, 0x40, 0x61, 0x36, + 0x06, 0xB5, 0x09, 0xCA, 0xC6, 0xAD, 0xD6, 0x9E, 0xED, 0x45, 0xF6, 0x95, 0x32, 0x07, 0x84, 0x71, + 0xC8, 0x35, 0xB0, 0x81, 0x97, 0xC9, 0x60, 0xDE, 0xFD, 0x8E, 0x90, 0x67, 0xD7, 0x23, 0x51, 0x28, + 0x90, 0xA5, 0x6E, 0xB6, 0x59, 0x88, 0xD1, 0x8D, 0xCD, 0x17, 0xA3, 0x48, 0xE3, 0x3F, 0x00, 0x4E, + 0x9B, 0x21, 0xD5, 0xA4, 0x5A, 0xF0, 0xA0, 0xBA, 0x40, 0xB7, 0xBB, 0xE1, 0x3D, 0x16, 0x9E, 0xEE, + 0xBB, 0x9E, 0xB2, 0x91, 0xBD, 0x39, 0x77, 0xD6, 0xB5, 0x9C, 0xB5, 0xE8, 0xCF, 0x7D, 0x8C, 0x83, + 0x82, 0x1A, 0xBA, 0x11, 0xDA, 0xF3, 0x96, 0xDD, 0x09, 0x20, 0x9F, 0xEB, 0xAE, 0x39, 0xAC, 0x7C, + 0xF2, 0x41, 0x98, 0x21, 0x6B, 0x8D, 0x19, 0xFF, 0x36, 0x5E, 0x82, 0xAC, 0xEE, 0x1E, 0x0E, 0x77, + 0x63, 0x14, 0x4E, 0x87, 0xE8, 0x22, 0x01, 0xD4, 0xC4, 0xF3, 0xE6, 0x49, 0xE6, 0x25, 0x64, 0x5C, + 0x54, 0x4B, 0x10, 0xE7, 0xCD, 0x17, 0x8F, 0xFA, 0xA3, 0x4D, 0xCA, 0x49, 0xCA, 0x4D, 0x33, 0xBC, + 0x29, 0x71, 0x4D, 0xF9, 0x0D, 0x74, 0x01, 0xAC, 0x79, 0xA7, 0xD7, 0x75, 0xD3, 0x9B, 0x04, 0xEE, + 0xCB, 0xCD, 0x51, 0xCC, 0xAA, 0x68, 0xFB, 0x41, 0xD3, 0x2D, 0xC1, 0xC8, 0x72, 0xDC, 0x69, 0xBE, + 0x0A, 0x74, 0xFF, 0xA8, 0x0C, 0xB4, 0xE1, 0x1A, 0xD3, 0x30, 0x21, 0xA9, 0x34, 0xCC, 0xB5, 0xE9, + 0xCF, 0x38, 0x48, 0x3B, 0xFC, 0xD6, 0x88, 0xD8, 0xB7, 0x3D, 0x71, 0xE4, 0x36, 0xA2, 0xE6, 0x03, + 0x02, 0xE3, 0xFB, 0x68, 0x0F, 0x07, 0x3B, 0x80, 0x30, 0x1C, 0xF4, 0x88, 0x0D, 0x86, 0x1F, 0x83, + 0x4D, 0x93, 0xD4, 0x10, 0xB1, 0xFF, 0x2C, 0xCB, 0xBE, 0x8E, 0xA8, 0xDB, 0x09, 0xE5, 0xF7, 0x9C, + 0x82, 0x48, 0xE0, 0xC8, 0x2C, 0x7B, 0xA1, 0x46, 0x89, 0xE9, 0x0D, 0x82, 0x6F, 0xC1, 0xEA, 0xA5, + 0x84, 0x82, 0x33, 0x26, 0x4A, 0xB6, 0x84, 0x60, 0x21, 0x00, 0x89, 0x20, 0x84, 0x14, 0x7A, 0xDF, + 0x7B, 0xEB, 0x45, 0x6B, 0x76, 0xE6, 0xDB, 0x53, 0xBE, 0x6A, 0x95, 0xE1, 0xFE, 0x6A, 0x79, 0x07, + 0xBC, 0x9D, 0xB3, 0x37, 0x67, 0xAF, 0xC2, 0x1E, 0x2B, 0xFF, 0x9F, 0xC5, 0xF5, 0x54, 0xE0, 0x29, + 0x44, 0xA4, 0x2A, 0x6F, 0xB7, 0x52, 0x17, 0x2C, 0xB1, 0x72, 0x6E, 0x9F, 0x30, 0x9D, 0x42, 0x41, + 0xF6, 0xD5, 0x14, 0x3E, 0x32, 0x59, 0x42, 0xAD, 0x7A, 0x68, 0x53, 0xF9, 0x99, 0xFD, 0x30, 0xC0, + 0x68, 0xB6, 0x97, 0xD9, 0x1B, 0x9A, 0xF6, 0xB9, 0x06, 0xE2, 0x2E, 0x27, 0x60, 0xE9, 0x1A, 0xBD, + 0x88, 0xCD, 0xAD, 0xE0, 0xCB, 0xED, 0x76, 0x2B, 0x46, 0x24, 0xB0, 0x48, 0xBA, 0x55, 0x9B, 0xBD, + 0x6D, 0xF2, 0xF7, 0x8C, 0x59, 0x4E, 0xB6, 0xE4, 0x89, 0xE1, 0xD4, 0x97, 0x85, 0x15, 0x27, 0xAE, + 0xD0, 0x9A, 0x72, 0x98, 0xB0, 0x6F, 0x06, 0xB9, 0xFC, 0xFD, 0x0D, 0x51, 0x11, 0x7E, 0x02, 0x66, + 0xD2, 0xE7, 0x25, 0xD4, 0x4D, 0xAE, 0x78, 0x9F, 0x8E, 0x69, 0xDD, 0x43, 0x80, 0x2F, 0xE6, 0x6E, + 0x46, 0xD7, 0x1A, 0x05, 0x8F, 0x4B, 0x5E, 0xF7, 0x4E, 0x09, 0x9B, 0xAF, 0x4E, 0x2B, 0x14, 0x91, + 0x59, 0x67, 0xFF, 0xFF, 0xAA, 0x08, 0xE7, 0x25, 0x42, 0x4E, 0x17, 0xD6, 0xDF, 0xD8, 0x23, 0x45, + 0xB4, 0xE2, 0x15, 0xE8, 0xDB, 0xA8, 0x55, 0x81, 0x9B, 0xE3, 0x3F, 0x09, 0x0C, 0x16, 0x19, 0xE6, + 0xE3, 0x7F, 0x1D, 0xB6, 0xBB, 0x14, 0x3C, 0x58, 0xBB, 0x69, 0x5F, 0x7A, 0x1A, 0x51, 0x45, 0xEE, + 0xDB, 0xA5, 0x7F, 0x53, 0x27, 0x04, 0xA0, 0x60, 0x76, 0x7A, 0xAD, 0x29, 0x7A, 0x8B, 0x49, 0x4C, + 0x6D, 0x26, 0x01, 0x45, 0x9B, 0x2F, 0xC8, 0x6B, 0xE0, 0x11, 0x1E, 0xCE, 0x35, 0x18, 0xDA, 0x6A, + 0x7E, 0x14, 0x56, 0xFB, 0x19, 0xE2, 0xBC, 0xAF, 0xE9, 0x62, 0xF9, 0xD4, 0xB7, 0x21, 0x1D, 0x45, + 0x10, 0xB7, 0xF3, 0x10, 0x80, 0xD0, 0xA9, 0x20, 0x12, 0xFB, 0xFA, 0xB9, 0xF6, 0x9B, 0x32, 0xA9, + 0x68, 0x58, 0xD9, 0x97, 0xDD, 0x4D, 0xDB, 0x67, 0x95, 0x35, 0xFE, 0xFA, 0x9A, 0xB2, 0x8D, 0x39, + 0x32, 0xD0, 0x5F, 0x6E, 0x74, 0x62, 0x3F, 0xC0, 0xC9, 0x24, 0x49, 0xC9, 0x65, 0x27, 0x88, 0x52, + 0x60, 0xBB, 0x6B, 0x52, 0xAC, 0x35, 0x90, 0x47, 0xF8, 0x34, 0xF4, 0x8E, 0x9E, 0x43, 0xE6, 0x28, + 0xA5, 0x04, 0xA9, 0x10, 0x09, 0x4F, 0xE0, 0x2E, 0x3E, 0x12, 0xD9, 0xC3, 0xC3, 0xF0, 0xAB, 0x30, + 0x18, 0x13, 0x6C, 0x17, 0x06, 0x2C, 0x03, 0x60, 0x04, 0x5D, 0x0E, 0xC8, 0x7F, 0x80, 0x4B, 0xAD, + 0xAF, 0x34, 0x2B, 0xDC, 0x94, 0x1F, 0x68, 0x0A, 0xAB, 0xA3, 0xD7, 0x19, 0x23, 0x02, 0x8F, 0xBD, + 0xB9, 0x33, 0xD3, 0x93, 0x66, 0xC9, 0x19, 0x18, 0xEF, 0x08, 0x0C, 0xEE, 0xDB, 0xB3, 0x5E, 0x55, + 0xB2, 0xDC, 0xBB, 0x90, 0x02, 0x2B, 0x90, 0x67, 0x41, 0x3E, 0x65, 0xA0, 0x9B, 0xC4, 0x5D, 0x81, + 0xDC, 0x64, 0x82, 0xA9, 0x86, 0xA7, 0xB1, 0x1C, 0x6C, 0x7B, 0xA2, 0x07, 0xF1, 0xE0, 0x8E, 0x4F, + 0xBF, 0x07, 0x20, 0x48, 0x05, 0xE5, 0x1D, 0xB6, 0xD8, 0x83, 0x45, 0x7C, 0xAD, 0x84, 0x32, 0x94, + 0xCA, 0x88, 0x96, 0xAA, 0x07, 0xE8, 0x7B, 0x0A, 0x89, 0x46, 0x98, 0x2F, 0x93, 0x65, 0xEB, 0x7B, + 0x79, 0x50, 0x8C, 0x8D, 0x01, 0x6D, 0xCE, 0xB4, 0x5E, 0x1E, 0x74, 0x6D, 0xC3, 0x29, 0x0B, 0x34, + 0xB6, 0xB8, 0xE7, 0x9C, 0x2D, 0x71, 0x49, 0x65, 0x07, 0x1A, 0x7D, 0x04, 0x74, 0x42, 0xD7, 0x0D, + 0x96, 0x80, 0x85, 0xFC, 0x5D, 0x29, 0x79, 0x54, 0x8F, 0x08, 0x2A, 0x7F, 0xF2, 0xB8, 0x87, 0x13, + 0x29, 0x6E, 0xC4, 0xB7, 0x99, 0xBB, 0xC5, 0x6C, 0x4D, 0x01, 0x38, 0xB5, 0xFF, 0x93, 0xEC, 0x0F, + 0x96, 0xA5, 0x47, 0x78, 0xD1, 0xC0, 0x63, 0x61, 0xE0, 0x2D, 0xE4, 0x56, 0x7C, 0xAC, 0x77, 0x30, + 0x21, 0x55, 0x32, 0xFD, 0x4E, 0xC0, 0x31, 0x9B, 0x7C, 0x37, 0x04, 0x8B, 0xAB, 0x95, 0x03, 0xAC, + 0x22, 0x9E, 0x1F, 0x86, 0x2A, 0xB5, 0xD9, 0x32, 0x56, 0xCC, 0x4E, 0xE5, 0x1A, 0x70, 0x65, 0x5B, + 0x32, 0xC7, 0x1D, 0x96, 0x73, 0x62, 0x49, 0xB3, 0xC5, 0xA1, 0x83, 0xEB, 0x32, 0x6B, 0x6E, 0x17, + 0xC2, 0xD2, 0xBA, 0x90, 0x3B, 0xB5, 0x99, 0x18, 0x34, 0x4D, 0x15, 0x57, 0x19, 0xCD, 0x3C, 0xE1, + 0xCF, 0x55, 0x4A, 0x44, 0xD0, 0xFD, 0xD1, 0x29, 0xB5, 0x86, 0xA1, 0xAA, 0xB0, 0x6C, 0x30, 0xEE, + 0x14, 0xC2, 0x9E, 0x02, 0x31, 0xDF, 0x13, 0x0D, 0xC6, 0xFA, 0x9F, 0xC1, 0x17, 0xF1, 0x52, 0x08, + 0x8B, 0xBB, 0x81, 0xB8, 0x92, 0x7B, 0x19, 0x0F, 0x5E, 0x7A, 0xDF, 0xEB, 0x86, 0x8C, 0x5F, 0x6C, + 0x7A, 0xE9, 0xF1, 0x26, 0x55, 0x80, 0xFF, 0xBC, 0x6A, 0x0A, 0xBC, 0x23, 0xAB, 0xE8, 0x8E, 0xC3, + 0xA5, 0xD7, 0xFD, 0x52, 0x73, 0x68, 0x4B, 0x56, 0x7F, 0x60, 0x4A, 0x68, 0x84, 0x30, 0xE1, 0x1F, + 0x0C, 0x10, 0x41, 0x71, 0xFC, 0x10, 0xDF, 0x62, 0xCC, 0x4D, 0xD6, 0x2A, 0x7F, 0xB9, 0xAF, 0x46, + 0x94, 0x3A, 0xD7, 0x0F, 0x12, 0x2C, 0xB8, 0x17, 0x1F, 0x56, 0xF3, 0xCD, 0xA0, 0xE7, 0xBF, 0xA4, + 0xFB, 0xC5, 0xE8, 0x17, 0x4B, 0x8A, 0xE5, 0x3E, 0x96, 0x22, 0x17, 0x07, 0xA3, 0x17, 0x0A, 0x77, + 0x98, 0xF8, 0x9B, 0x59, 0x5C, 0x2F, 0xC9, 0x73, 0xA4, 0x5A, 0x17, 0x1F, 0xBD, 0x56, 0x3E, 0xA2, + 0xE6, 0x8F, 0x34, 0xF2, 0xE0, 0x20, 0x37, 0xE4, 0x98, 0xE1, 0xEC, 0xC4, 0x1E, 0x81, 0x13, 0x17, + 0x21, 0x95, 0x88, 0x60, 0x04, 0xDA, 0x91, 0xB9, 0x22, 0xF8, 0x64, 0x87, 0x8D, 0x32, 0x60, 0x37, + 0x33, 0x2E, 0x2B, 0x95, 0x43, 0x0C, 0x10, 0xDF, 0xFC, 0x64, 0x56, 0x89, 0x32, 0x47, 0xA3, 0x8F, + 0xF1, 0x3E, 0x34, 0x63, 0x35, 0xD9, 0x41, 0xD8, 0x1A, 0x23, 0x88, 0x39, 0x6D, 0x23, 0x2A, 0x20, + 0xCE, 0xFB, 0x80, 0x0F, 0x59, 0xB7, 0xFB, 0x1E, 0x24, 0xF5, 0x8A, 0x78, 0x2B, 0xE8, 0x13, 0x52, + 0x34, 0x5B, 0x65, 0x64, 0xAB, 0x78, 0x4D, 0x5C, 0x79, 0x3B, 0xF2, 0x7D, 0x1F, 0x5B, 0xA9, 0x37, + 0xAE, 0x4C, 0x9E, 0x30, 0x6B, 0x39, 0x3D, 0x75, 0x06, 0xCE, 0xFE, 0x87, 0xB7, 0x1B, 0x9C, 0x9F, + 0x44, 0x7E, 0x98, 0xFF, 0x3B, 0xA6, 0x71, 0x48, 0xE3, 0x07, 0x8C, 0x5E, 0x95, 0x96, 0x04, 0xC1, + 0xBF, 0x7A, 0x18, 0x06, 0xC2, 0xD2, 0x24, 0xD6, 0xC9, 0x4D, 0x65, 0xCE, 0x18, 0x8F, 0x8B, 0x0D, + 0xFC, 0x66, 0x40, 0xB1, 0xE6, 0xE5, 0xC5, 0xDE, 0xAE, 0x2E, 0x84, 0x3F, 0xBA, 0x16, 0x5A, 0x63, + 0x72, 0x0F, 0x3C, 0x82, 0x4A, 0xD7, 0x54, 0x54, 0x60, 0x1B, 0x6A, 0x16, 0x2D, 0xDA, 0x0F, 0xF9, + 0x61, 0xD2, 0x53, 0x2B, 0xE4, 0x22, 0x0E, 0x1D, 0x08, 0x69, 0x5D, 0x4D, 0x4D, 0x3E, 0x99, 0xBE, + 0x8A, 0x83, 0xA2, 0x5A, 0x68, 0x8B, 0xBB, 0x6A, 0xA5, 0x31, 0xB9, 0x65, 0xA6, 0x55, 0xD1, 0x09, + 0x8D, 0x6B, 0xAB, 0xD8, 0xF1, 0x06, 0x62, 0xA8, 0x1A, 0xDA, 0xA4, 0x4B, 0x68, 0xA9, 0xB8, 0xA5, + 0x9D, 0xD1, 0xAA, 0x42, 0x8E, 0x67, 0xA8, 0xC6, 0x29, 0x94, 0x69, 0x38, 0xA0, 0x66, 0x84, 0xBB, + 0x73, 0x3B, 0xFC, 0x7D, 0x6B, 0xCD, 0x39, 0x8F, 0x1C, 0x6C, 0xE0, 0x58, 0x97, 0x75, 0xB7, 0x09, + 0x40, 0x68, 0x45, 0xCD, 0x97, 0x78, 0x1A, 0x81, 0xA9, 0x6D, 0x6C, 0x59, 0xB8, 0x0C, 0x7D, 0x94, + 0x46, 0x23, 0xCC, 0xD4, 0x2D, 0x71, 0x95, 0x7F, 0x9F, 0x08, 0xE0, 0xE5, 0xF9, 0xC0, 0x2C, 0xC4, + 0x09, 0x27, 0x7C, 0x62, 0x5E, 0xF4, 0xB6, 0xAA, 0x9D, 0x18, 0x10, 0xCE, 0xCB, 0xCA, 0xFC, 0xC2, + 0x12, 0x5A, 0xC2, 0xC7, 0xFA, 0x47, 0x3B, 0x4A, 0x5C, 0xC7, 0x52, 0xCA, 0x97, 0xD4, 0xC3, 0x90, + 0x1D, 0x04, 0x50, 0x92, 0xFF, 0xCC, 0xA9, 0x85, 0x4D, 0x1F, 0x73, 0xE3, 0x5B, 0x4D, 0x20, 0xCA, + 0x46, 0x89, 0xD5, 0x26, 0x2B, 0xF5, 0x6B, 0x2A, 0x0B, 0x9C, 0x36, 0x15, 0x9A, 0xB2, 0x15, 0xC1, + 0xAF, 0x38, 0x3D, 0xA5, 0x4B, 0x47, 0x56, 0x32, 0x90, 0x60, 0x93, 0x5D, 0x8C, 0xE4, 0x3D, 0x3A, + 0x00, 0xB2, 0x84, 0x92, 0xE7, 0x9C, 0x09, 0xD4, 0x55, 0x01, 0xFC, 0xFC, 0x3C, 0x0B, 0x6B, 0x0B, + 0xD4, 0x39, 0x7B, 0x88, 0x40, 0x08, 0xDE, 0x2D, 0xFC, 0x9E, 0xEF, 0xFE, 0xCA, 0x45, 0xB6, 0x8F, + 0xDD, 0x59, 0x49, 0x16, 0x9B, 0x26, 0x88, 0x7F, 0x83, 0xA0, 0x29, 0x14, 0xA6, 0x96, 0x51, 0x1D, + 0x36, 0xCF, 0x7D, 0x01, 0x2E, 0xC3, 0xC5, 0xC2, 0x49, 0xAB, 0x70, 0xAC, 0x66, 0x08, 0xA4, 0xB7, + 0xB5, 0x37, 0x34, 0xEB, 0xD1, 0xA1, 0x52, 0xB1, 0xF8, 0x1C, 0x88, 0x36, 0x32, 0x00, 0xA4, 0x5B, + 0x3B, 0x93, 0x34, 0x20, 0x5F, 0xA9, 0x9B, 0x1E, 0xA6, 0xF9, 0xFC, 0xC5, 0x34, 0x2E, 0x64, 0xCE, + 0x97, 0x44, 0x71, 0x0D, 0x09, 0x89, 0xF2, 0x68, 0x41, 0xF9, 0x64, 0xA0, 0xFC, 0xE2, 0x43, 0x14, + 0x77, 0xB1, 0x68, 0x2C, 0xE6, 0xCB, 0xD4, 0x82, 0xE0, 0xF1, 0x93, 0x00, 0x50, 0x9F, 0x14, 0x6F, + 0x78, 0xDC, 0x7B, 0xC2, 0xD6, 0x31, 0x29, 0x85, 0xA6, 0xEB, 0x50, 0xEC, 0xA6, 0xDD, 0xAA, 0x50, + 0x65, 0x94, 0xEE, 0x68, 0xC3, 0x11, 0xAA, 0xB7, 0xA7, 0xEE, 0xBB, 0x39, 0x08, 0xA6, 0xE8, 0xC5, + 0x4E, 0x52, 0x84, 0xDD, 0xE6, 0x16, 0xF5, 0xC3, 0xAC, 0xB0, 0xBE, 0x3F, 0xA0, 0xC9, 0x1F, 0x17, + 0xC0, 0x8D, 0x7C, 0x80, 0x27, 0xAE, 0xBB, 0x47, 0x32, 0x94, 0x01, 0xCB, 0x72, 0x12, 0xCB, 0x74, + 0x56, 0x58, 0x17, 0x30, 0x57, 0x6C, 0x94, 0x08, 0xD4, 0x60, 0x50, 0x41, 0x35, 0xAB, 0xBD, 0x0B, + 0xA7, 0x43, 0x1B, 0x53, 0x19, 0xBA, 0x05, 0x67, 0xAF, 0x4C, 0xAD, 0x76, 0xBA, 0x7D, 0x75, 0x8E, + 0x64, 0x0C, 0xDD, 0xFB, 0xD9, 0x84, 0x3F, 0xB0, 0x57, 0x4D, 0x8C, 0xA0, 0x0F, 0xD9, 0xE0, 0x53, + 0xB9, 0x1D, 0xAE, 0xE1, 0xCC, 0x9E, 0xD5, 0x79, 0xDA, 0xB4, 0x0C, 0x0B, 0xDD, 0x95, 0x28, 0xDD, + 0x7F, 0x73, 0x43, 0x83, 0xC5, 0x45, 0x14, 0x00, 0xBA, 0x00, 0x9C, 0xC0, 0xC8, 0x62, 0x34, 0x66, + 0xF9, 0x78, 0x57, 0x0B, 0x9F, 0x85, 0xEE, 0x49, 0xF6, 0xA9, 0x86, 0x05, 0x6B, 0x0E, 0x1F, 0x26, + 0xD0, 0xD9, 0xEB, 0xA8, 0x5B, 0x9B, 0xCD, 0x4E, 0x25, 0x07, 0xE1, 0xE0, 0x60, 0xA0, 0xFB, 0x17, + 0x7C, 0x41, 0xAA, 0x20, 0xFE, 0x83, 0x25, 0x3A, 0x9A, 0x02, 0x87, 0x0A, 0x71, 0x87, 0xE5, 0xD3, + 0xC1, 0xDC, 0x85, 0xC8, 0xFA, 0x71, 0x2A, 0xCF, 0xA1, 0xF7, 0x44, 0x13, 0x9C, 0x03, 0x56, 0xC3, + 0x7A, 0xEE, 0x51, 0x35, 0x3C, 0x27, 0x30, 0xF3, 0x3E, 0x31, 0x5F, 0x00, 0x51, 0xA7, 0x1C, 0x92, + 0xA4, 0xE1, 0xC3, 0x43, 0x12, 0x03, 0x3C, 0xEE, 0xD3, 0xFA, 0x1C, 0x6A, 0x0F, 0xE0, 0x45, 0xBB, + 0x3B, 0x81, 0xF1, 0x37, 0x46, 0x9C, 0x6E, 0x21, 0x74, 0xFA, 0x93, 0x52, 0xF4, 0x57, 0x95, 0x81, + 0xD3, 0x57, 0x44, 0x5E, 0xF0, 0x54, 0x18, 0x3C, 0xFB, 0x3A, 0xE7, 0x10, 0x67, 0xF2, 0x20, 0x24, + 0x09, 0xD2, 0x6D, 0xAB, 0xC2, 0xBA, 0x3C, 0x30, 0xE9, 0x65, 0xF1, 0x50, 0xFB, 0x11, 0xB6, 0xCF, + 0x85, 0x7B, 0x6A, 0x4A, 0x56, 0x59, 0x59, 0xB7, 0xDE, 0xFB, 0xC8, 0x39, 0x6A, 0x52, 0x6D, 0xE6, + 0xB7, 0xC7, 0x7A, 0x62, 0x01, 0x25, 0x3D, 0x54, 0x54, 0xB4, 0xF2, 0xBA, 0xF9, 0xEE, 0xE3, 0x59, + 0xD0, 0x74, 0xB5, 0xBF, 0xDF, 0x3E, 0x3F, 0x87, 0x64, 0x82, 0xD9, 0xD5, 0xF9, 0xE8, 0xBB, 0xC5, + 0xA5, 0x61, 0x91, 0x9C, 0x2C, 0x99, 0xC0, 0x39, 0xB3, 0xEF, 0x33, 0x5E, 0x3E, 0x1E, 0x00, 0xC6, + 0x5A, 0x90, 0x1C, 0x50, 0x43, 0x3D, 0x4B, 0xA1, 0x3F, 0x46, 0xEB, 0xBA, 0x86, 0xA4, 0xEA, 0xE1, + 0xA9, 0x40, 0x97, 0x5A, 0x80, 0x97, 0x36, 0x1C, 0xA8, 0x19, 0x4E, 0x0D, 0xF8, 0xCB, 0x1C, 0xC7, + 0xD4, 0x1C, 0xB1, 0x4C, 0x2E, 0xDB, 0x2D, 0x96, 0x1E, 0xBA, 0xEB, 0x3D, 0xDE, 0x7D, 0xC7, 0x2E, + 0xF8, 0x36, 0x54, 0x5C, 0x94, 0xD0, 0x5A, 0x0E, 0x5D, 0xF6, 0x4D, 0x35, 0xD2, 0xC1, 0x52, 0xC7, + 0x3B, 0x58, 0x43, 0xEB, 0xB6, 0x54, 0xBA, 0xA5, 0xF1, 0x86, 0xDB, 0x23, 0xAB, 0x6A, 0x42, 0x00, + 0x90, 0xD2, 0x0C, 0x76, 0x32, 0xA0, 0xC2, 0xE3, 0x10, 0x0E, 0x0C, 0x8A, 0x7C, 0xA5, 0x5F, 0xC9, + 0x4E, 0x79, 0x6E, 0x38, 0x0D, 0xA1, 0xD8, 0x7E, 0x90, 0xDD, 0xA4, 0x35, 0x33, 0xBF, 0xCE, 0x69, + 0x8F, 0x93, 0xBC, 0xB4, 0xC8, 0xD2, 0xD1, 0xD8, 0x2F, 0x31, 0xF8, 0x0B, 0x12, 0x8B, 0xA2, 0xAA, + 0x7B, 0x36, 0x5F, 0x66, 0x0D, 0xF6, 0x34, 0x0F, 0xA7, 0x6A, 0xF3, 0x52, 0x4A, 0xB3, 0xCE, 0x83, + 0xB5, 0x57, 0x11, 0x74, 0xBF, 0x1D, 0x5E, 0xA4, 0x18, 0x84, 0xC6, 0xE4, 0xAC, 0x42, 0x93, 0x82, + 0x99, 0xF1, 0x4B, 0xE2, 0x07, 0x0E, 0x0C, 0xAD, 0xC4, 0x7E, 0x24, 0xC7, 0xF9, 0x22, 0x34, 0x31, + 0x0B, 0xC9, 0xBF, 0xA8, 0x74, 0xE9, 0xDE, 0xE8, 0x61, 0xDC, 0xC2, 0x49, 0x95, 0x78, 0x6F, 0x2D, + 0x46, 0x76, 0xD8, 0x2F, 0xA9, 0x56, 0x00, 0x38, 0x74, 0x54, 0xBB, 0x66, 0xE5, 0x9B, 0xA1, 0xAB, + 0xE4, 0x1E, 0x46, 0x71, 0x90, 0xC1, 0xF8, 0x16, 0x8A, 0x8F, 0x76, 0xE6, 0x4F, 0x06, 0xE8, 0xE8, + 0xAA, 0x25, 0xF2, 0x75, 0x3A, 0x0D, 0xBD, 0xF6, 0x40, 0xEE, 0x64, 0xE0, 0xF4, 0xD5, 0xBB, 0x76, + 0x7A, 0x8B, 0x43, 0xD8, 0x75, 0xD3, 0xAF, 0x1A, 0xE7, 0x59, 0x5E, 0x8E, 0xC8, 0xE4, 0xD9, 0x7C, + 0x3E, 0x02, 0x4D, 0xBE, 0x00, 0xD9, 0x6F, 0x46, 0xF1, 0x4A, 0x5B, 0x33, 0x97, 0x6E, 0x54, 0x5A, + 0x3A, 0x41, 0x6F, 0xC0, 0xB7, 0x3E, 0x78, 0xE5, 0xCF, 0x75, 0x1C, 0xEE, 0xD8, 0xA1, 0xEE, 0xD0, + 0x37, 0x94, 0xFE, 0x63, 0x1B, 0x2F, 0x63, 0x7A, 0xFE, 0x22, 0xCD, 0x32, 0xE1, 0xB6, 0xF8, 0x21, + 0x33, 0xDA, 0xCE, 0xB4, 0x91, 0x25, 0x21, 0x67, 0xA2, 0x6D, 0x5D, 0x49, 0xBD, 0x77, 0x92, 0x60, + 0xA3, 0x56, 0xBF, 0x1E, 0x1B, 0xF8, 0xE9, 0x40, 0xC5, 0xBF, 0x06, 0xFC, 0x14, 0xBC, 0xBC, 0x62, + 0xC0, 0xCB, 0x8D, 0x67, 0x7E, 0xDD, 0xB9, 0xCE, 0x66, 0xE2, 0x52, 0xC1, 0x21, 0x68, 0x93, 0xB4, + 0x6F, 0xFC, 0x81, 0x1F, 0x41, 0xD7, 0x7F, 0x10, 0xCF, 0x35, 0x9B, 0x72, 0xC6, 0xBC, 0x05, 0x5D, + 0x7D, 0x63, 0x09, 0xB4, 0xA8, 0x62, 0xAA, 0x42, 0x51, 0xC1, 0xC0, 0xF0, 0x2D, 0xE2, 0xBE, 0x6D, + 0x54, 0x53, 0x55, 0x7B, 0x39, 0x0A, 0xB0, 0x2A, 0xE0, 0x45, 0x0A, 0xEF, 0xD7, 0x7E, 0xB9, 0xAF, + 0xB9, 0xDA, 0x22, 0x5D, 0x65, 0xD5, 0x39, 0x0F, 0xE4, 0x2B, 0x8E, 0xAA, 0x79, 0xC9, 0xFB, 0xF0, + 0x00, 0x51, 0xE6, 0x59, 0x3F, 0x12, 0x54, 0x4A, 0x29, 0x23, 0xD3, 0x6A, 0x9F, 0xB9, 0x0D, 0x99, + 0x1E, 0x8A, 0xF6, 0x55, 0xD3, 0xDC, 0x8A, 0x48, 0xC3, 0xE5, 0x16, 0xDA, 0xFF, 0xB0, 0x3B, 0x92, + 0x49, 0xD6, 0x00, 0xB1, 0x13, 0x8E, 0xC2, 0x3F, 0x7C, 0xF9, 0x48, 0x55, 0xD5, 0xAC, 0xEA, 0x8A, + 0xC1, 0x5C, 0xA9, 0x48, 0xEA, 0x71, 0xDA, 0x99, 0xE9, 0x49, 0xBA, 0xD8, 0x1F, 0xF2, 0xB2, 0x51, + 0x5D, 0x13, 0xC7, 0x6A, 0x82, 0x8E, 0x64, 0x3A, 0x11, 0x56, 0x66, 0x24, 0x2D, 0xC1, 0x7D, 0x3A, + 0xB2, 0x45, 0xB6, 0xAE, 0x10, 0x8F, 0xBD, 0xD6, 0x9F, 0xAB, 0x44, 0xA7, 0x4A, 0x5D, 0x92, 0x7D, + 0x8F, 0xE5, 0x59, 0x4A, 0x10, 0x85, 0xFD, 0x3C, 0x40, 0x3B, 0xBF, 0xDF, 0xA7, 0x3A, 0x1D, 0xB5, + 0x67, 0x23, 0xF9, 0xAC, 0x59, 0x31, 0x2F, 0xD9, 0xD6, 0xF5, 0xEA, 0xD1, 0xDE, 0xAE, 0xFA, 0x44, + 0xFD, 0xE0, 0xBE, 0xE3, 0xF7, 0xEA, 0xD5, 0xF0, 0x26, 0x41, 0xE5, 0x3D, 0xBE, 0xAA, 0xFC, 0x57, + 0x49, 0xAE, 0x3E, 0x70, 0x8F, 0x9D, 0xF1, 0xB6, 0x32, 0x7D, 0xE7, 0x21, 0x4A, 0x7E, 0x99, 0xD7, + 0x90, 0xFE, 0xC5, 0xB2, 0xE8, 0xAC, 0x6D, 0xF7, 0x3C, 0xD3, 0x1E, 0x61, 0xF4, 0xFF, 0x8C, 0x13, + 0x5A, 0x7F, 0x87, 0x66, 0x47, 0x84, 0xF8, 0x3B, 0x0B, 0x70, 0xCF, 0xBA, 0x0C, 0x87, 0x93, 0x62, + 0x65, 0x1E, 0x47, 0xFC, 0x96, 0x25, 0x46, 0x01, 0xE0, 0xCE, 0xE2, 0x41, 0xC6, 0x38, 0x90, 0x0D, + 0xE3, 0xC7, 0x60, 0x4E, 0x08, 0x0F, 0x02, 0xF5, 0xB8, 0x70, 0x27, 0x89, 0x29, 0x6E, 0x79, 0x85, + 0x12, 0xA4, 0xCA, 0x6C, 0x69, 0xBE, 0x52, 0xFF, 0xBD, 0xCF, 0x3E, 0x07, 0xA8, 0x7B, 0x00, 0x44, + 0xE0, 0x3B, 0xA6, 0x50, 0xFF, 0xF9, 0xDA, 0x0D, 0xEB, 0xCC, 0x70, 0x21, 0x20, 0x5F, 0xF4, 0xAF, + 0x1B, 0x2C, 0xF8, 0x63, 0x9C, 0xB9, 0x8F, 0x0B, 0xBF, 0x1C, 0xA5, 0x85, 0xA6, 0x9A, 0x0A, 0x93, + 0x1E, 0x8B, 0xA3, 0x80, 0x63, 0x30, 0x24, 0xE1, 0xF0, 0xB6, 0x7B, 0x93, 0xC5, 0x72, 0xE9, 0x49, + 0x91, 0x1D, 0xB0, 0x77, 0xC0, 0xA2, 0x1D, 0xC9, 0x66, 0x90, 0xF7, 0x58, 0x92, 0x87, 0x4F, 0xB0, + 0x0D, 0x0A, 0x48, 0x16, 0x5F, 0x7D, 0xF4, 0xA6, 0xC9, 0x80, 0xD2, 0x38, 0xD6, 0xC7, 0xEE, 0x73, + 0xA6, 0xA8, 0x57, 0xC9, 0xAA, 0x32, 0x6A, 0x3C, 0xA7, 0x9F, 0x89, 0x79, 0x8B, 0xD9, 0x6B, 0x8C, + 0xB1, 0x26, 0x5D, 0x4B, 0xE9, 0xF0, 0x9D, 0xFA, 0xC0, 0xD3, 0xEA, 0x82, 0xDA, 0x7C, 0xCB, 0x43, + 0x90, 0x74, 0x24, 0xC6, 0xBD, 0x5B, 0x87, 0x29, 0xCA, 0xEC, 0x6E, 0xBA, 0x7C, 0x41, 0xF9, 0x99, + 0x0A, 0x92, 0xFA, 0x43, 0xAE, 0xE7, 0xF9, 0xFB, 0x55, 0x5B, 0x3A, 0xCC, 0x1C, 0xC5, 0x20, 0x37, + 0x53, 0x4A, 0x83, 0xC6, 0x79, 0x5A, 0x42, 0xF9, 0x23, 0x62, 0xA1, 0x3A, 0x42, 0xCE, 0x51, 0xC5, + 0x5D, 0xC9, 0x99, 0x1F, 0x82, 0xE7, 0x43, 0x72, 0x46, 0x70, 0x80, 0x25, 0x65, 0x98, 0x78, 0xC2, + 0xF9, 0xD4, 0x07, 0x2D, 0xAB, 0x79, 0x7D, 0x45, 0xC3, 0x0B, 0xEE, 0x18, 0xBB, 0x3C, 0x33, 0xE5, + 0x8B, 0xE5, 0x2A, 0x04, 0x53, 0x7C, 0x92, 0x92, 0x3E, 0x77, 0xE6, 0xB5, 0x8A, 0x7C, 0xAC, 0x3F, + 0xEA, 0xFC, 0x19, 0x64, 0xFD, 0xB4, 0xA3, 0x33, 0xCC, 0xBB, 0xE3, 0x5F, 0xBA, 0xAB, 0x9F, 0x2A, + 0x4E, 0x71, 0x96, 0x4D, 0x8D, 0x33, 0x39, 0x02, 0x0F, 0x6B, 0xFB, 0xC7, 0x76, 0x0D, 0xC4, 0x9D, + 0xB0, 0x6C, 0xA3, 0x91, 0x32, 0x23, 0x60, 0xF9, 0x53, 0x3C, 0x48, 0xCF, 0x54, 0x4A, 0x34, 0x6A, + 0x90, 0xB8, 0xDB, 0xB6, 0xFD, 0xD8, 0xB9, 0x79, 0xF1, 0x5D, 0x64, 0xFC, 0x2C, 0x6E, 0xA2, 0xD2, + 0x4D, 0x37, 0x56, 0xCB, 0x8D, 0xE9, 0xC9, 0x02, 0x3A, 0x7F, 0x53, 0x75, 0x98, 0x46, 0xF9, 0x8E, + 0xE2, 0x00, 0x05, 0x20, 0x8E, 0xAD, 0xAA, 0x38, 0x5F, 0x6A, 0x34, 0x16, 0x2E, 0x25, 0xFF, 0x7F, + 0xE2, 0x10, 0x2D, 0x49, 0x2C, 0xEF, 0xB5, 0xE5, 0x8A, 0x2A, 0x1F, 0x6F, 0x6C, 0x49, 0xF7, 0x78, + 0x80, 0xCA, 0xFA, 0x14, 0x5D, 0xAE, 0xA9, 0xCD, 0xC5, 0xB8, 0xA8, 0xDC, 0xFF, 0x84, 0xC5, 0x80, + 0x8E, 0x98, 0x5F, 0x7E, 0xF6, 0x26, 0xBB, 0x35, 0xF7, 0xA7, 0x40, 0x46, 0x83, 0x26, 0xDF, 0x3B, + 0x64, 0xE0, 0x67, 0x7A, 0xBE, 0x08, 0xF4, 0xE6, 0x1A, 0xF8, 0xFD, 0xBA, 0x0E, 0xBE, 0xB2, 0x28, + 0x6C, 0x45, 0xEA, 0xB1, 0x6C, 0xA8, 0x8E, 0x4F, 0xB8, 0xBC, 0x82, 0x0A, 0xD1, 0x84, 0xAB, 0x03, + 0x6C, 0x30, 0x85, 0xA1, 0x2C, 0x72, 0xA3, 0x08, 0x25, 0x4C, 0x97, 0x32, 0xEB, 0xAD, 0x0E, 0x3E, + 0xE8, 0x8E, 0x2B, 0xF0, 0xCF, 0x13, 0xCA, 0xD1, 0x53, 0xC6, 0xCD, 0x58, 0x98, 0xDE, 0xB0, 0x7E, + 0x0D, 0xBF, 0x94, 0x3E, 0xA7, 0x1C, 0x84, 0xBC, 0xB3, 0x9B, 0x6D, 0x54, 0x32, 0x39, 0x89, 0xF8, + 0x02, 0xAF, 0xBC, 0xB2, 0x53, 0x3B, 0x43, 0xF2, 0xCC, 0xC9, 0x05, 0xF2, 0xC4, 0x88, 0x37, 0x6E, + 0xE1, 0xA1, 0x55, 0x82, 0x7E, 0xBE, 0x83, 0xE0, 0x0B, 0xF8, 0x96, 0x45, 0x61, 0xC1, 0x96, 0x28, + 0x6D, 0x64, 0xCF, 0xF9, 0xC1, 0xC7, 0x3A, 0x18, 0xF3, 0x9A, 0x69, 0x2B, 0x07, 0x57, 0x55, 0xE8, + 0x09, 0xCB, 0x33, 0xC5, 0x4F, 0xBF, 0x0F, 0x9A, 0x22, 0xB1, 0xB3, 0x50, 0x15, 0xA3, 0xCB, 0x8D, + 0x6E, 0x29, 0x56, 0x89, 0x64, 0xAF, 0x5B, 0x0D, 0xD4, 0xE2, 0x6F, 0x6A, 0x38, 0xBD, 0xD8, 0xA1, + 0x7D, 0x0A, 0x6F, 0x7B, 0x07, 0x89, 0x5B, 0xD2, 0xFB, 0x34, 0x5F, 0xA9, 0x0F, 0x41, 0x18, 0xD3, + 0x99, 0xFD, 0xA8, 0x88, 0xFD, 0x4B, 0x9B, 0xCA, 0xAE, 0x5A, 0xB0, 0xEE, 0x23, 0x0F, 0x4B, 0x5C, + 0x99, 0xEA, 0x29, 0xF3, 0xF6, 0x97, 0x5F, 0xF9, 0xAF, 0x28, 0x4F, 0xEC, 0xD6, 0x01, 0x69, 0x8B, + 0x65, 0x08, 0x55, 0xCA, 0x05, 0xC0, 0xB4, 0xB2, 0x64, 0x2A, 0xF5, 0x3E, 0xDA, 0xA2, 0xD2, 0xBB, + 0xDF, 0x17, 0xFF, 0xCF, 0x9E, 0xDE, 0x8A, 0x1E, 0x5F, 0xFD, 0xEA, 0x12, 0x0F, 0xFF, 0x96, 0x20, + 0x0A, 0x15, 0xE6, 0x9B, 0x4F, 0x12, 0x0B, 0xCC, 0x39, 0x4D, 0xFD, 0xD4, 0x7A, 0xDA, 0x24, 0x11, + 0x2D, 0x93, 0x92, 0x9F, 0x3E, 0x3F, 0xA2, 0x9B, 0xAD, 0x98, 0x13, 0xE2, 0x5F, 0xF2, 0x7E, 0x84, + 0xA1, 0x43, 0xAB, 0x76, 0xB8, 0xFC, 0xA0, 0x01, 0x17, 0x38, 0xB3, 0x33, 0x13, 0x4A, 0xF5, 0x15, + 0xA5, 0x56, 0x66, 0xC5, 0x44, 0x0C, 0x88, 0x75, 0x76, 0xA5, 0x7E, 0x57, 0xD4, 0x22, 0xE5, 0x32, + 0x99, 0x60, 0x99, 0x7C, 0x65, 0x29, 0xBA, 0xB0, 0x5B, 0x1F, 0x84, 0x98, 0x0C, 0x06, 0x8A, 0xAE, + 0x96, 0x63, 0x91, 0xB1, 0x75, 0xE6, 0xE6, 0x7A, 0xBF, 0x1E, 0xB5, 0xB6, 0x76, 0x1B, 0xE2, 0xBF, + 0xB4, 0x1F, 0x4D, 0x33, 0xF9, 0x9D, 0x9C, 0x79, 0xE6, 0xF5, 0xA3, 0x8C, 0x72, 0xFE, 0xAE, 0xB1, + 0x13, 0x09, 0x20, 0x91, 0x7C, 0x11, 0x99, 0x68, 0x1A, 0xA7, 0x6B, 0x3F, 0x88, 0xC7, 0xF5, 0x94, + 0x0D, 0xBC, 0x3B, 0xA5, 0x14, 0xD7, 0x8B, 0xA0, 0xA0, 0x70, 0xB4, 0xC2, 0x4E, 0x2F, 0xA8, 0xB1, + 0x0D, 0x7B, 0x8C, 0xD4, 0x96, 0xC1, 0xD1, 0xC5, 0x13, 0x67, 0x24, 0x16, 0x3C, 0xC0, 0xFD, 0x79, + 0x3C, 0x11, 0x69, 0x03, 0xF6, 0x55, 0xF7, 0xF2, 0x09, 0x8B, 0x49, 0x5B, 0xDA, 0x05, 0x3C, 0xDB, + 0x1C, 0x01, 0x1F, 0xDC, 0x4D, 0xE2, 0x09, 0xB6, 0x1F, 0x5F, 0xE2, 0xB0, 0xDF, 0x77, 0xF8, 0x83, + 0x59, 0xCF, 0xEE, 0x8B, 0x14, 0x12, 0xEB, 0xBC, 0x9B, 0xB4, 0x38, 0xFD, 0x38, 0x53, 0xC9, 0xA1, + 0x4E, 0xF6, 0x80, 0xA8, 0xE5, 0x25, 0x89, 0x97, 0xCF, 0x94, 0x06, 0xE4, 0x25, 0xDF, 0x86, 0x46, + 0xA2, 0x54, 0xA7, 0x04, 0xB5, 0xCA, 0x67, 0xF1, 0x95, 0x65, 0x57, 0xE1, 0x38, 0x61, 0xCB, 0x20, + 0xE5, 0x98, 0xF4, 0x07, 0x95, 0x25, 0xBD, 0xBE, 0x9F, 0x87, 0x76, 0x4D, 0x52, 0x96, 0xAE, 0x82, + 0xAE, 0x2C, 0x3C, 0xB6, 0x7C, 0x1A, 0x36, 0xE5, 0x34, 0x13, 0x1B, 0x72, 0x52, 0x8F, 0xFF, 0xE7, + 0x6B, 0x83, 0xDB, 0x88, 0x4A, 0xDB, 0x95, 0x37, 0xFA, 0x9D, 0xA2, 0x49, 0xDB, 0x5A, 0xE3, 0x5C, + 0x95, 0xC7, 0xF8, 0xE0, 0x14, 0x38, 0xB2, 0xCD, 0x09, 0xF4, 0x2A, 0x2A, 0xF7, 0x1A, 0xA1, 0x8E, + 0xB8, 0xBC, 0x3B, 0x51, 0x9A, 0xE4, 0xD1, 0xCF, 0xA7, 0xD1, 0xF9, 0x63, 0x0F, 0x98, 0x3D, 0x61, + 0x51, 0xEC, 0x1B, 0x67, 0x68, 0x88, 0x25, 0x65, 0x0B, 0xA6, 0x32, 0xA2, 0xCD, 0x93, 0xE1, 0x16, + 0x01, 0x12, 0xB2, 0xDA, 0x35, 0xBA, 0x52, 0x66, 0x46, 0x44, 0x8D, 0xB3, 0x19, 0x33, 0xC1, 0x1F, + 0x47, 0x6C, 0x48, 0x7B, 0x5C, 0x8C, 0xA8, 0x68, 0x74, 0xDE, 0x7C, 0xB4, 0xDF, 0x05, 0x54, 0x35, + 0x8A, 0xFE, 0x78, 0xB5, 0x05, 0x78, 0xC3, 0xB4, 0x85, 0x12, 0x88, 0xBB, 0x49, 0x17, 0x46, 0x5D, + 0x7D, 0x1F, 0xF4, 0xB5, 0xD9, 0xEF, 0x62, 0xBA, 0xC4, 0x86, 0x61, 0x0B, 0xE0, 0xC5, 0xEE, 0x69, + 0xEC, 0xF9, 0x52, 0x93, 0x3F, 0xC7, 0x69, 0xE4, 0xD2, 0x9C, 0xE0, 0xEB, 0xB5, 0x5A, 0x55, 0xCE, + 0x87, 0xA3, 0x1C, 0x52, 0x2E, 0xC5, 0x99, 0x92, 0x7F, 0x10, 0x06, 0xC4, 0xA2, 0x5B, 0x77, 0x3D, + 0x53, 0xE8, 0xCA, 0xB5, 0x3B, 0x18, 0x58, 0x54, 0xC6, 0x63, 0xDB, 0x1D, 0xB6, 0x75, 0xD2, 0x69, + 0x64, 0x8A, 0x69, 0x0E, 0xF9, 0x57, 0x41, 0x4C, 0xC2, 0xF3, 0x59, 0x0A, 0x60, 0x76, 0x67, 0x4A, + 0xE6, 0xE8, 0x63, 0xB5, 0x0A, 0x39, 0xDE, 0x95, 0xD6, 0xFB, 0xD4, 0xEC, 0xA3, 0xBD, 0x1A, 0xB1, + 0x8F, 0x54, 0x1C, 0xD7, 0x39, 0x50, 0x8F, 0x92, 0x0D, 0x33, 0x9F, 0x49, 0x10, 0xB2, 0x73, 0x87, + 0x83, 0xF0, 0x72, 0x9D, 0xE7, 0xEA, 0x14, 0xC7, 0x5A, 0x23, 0x6F, 0x54, 0x3E, 0xB5, 0x86, 0x6D, + 0xD6, 0xE2, 0x3E, 0x97, 0x96, 0x5F, 0xF4, 0x1A, 0xFD, 0x8B, 0x96, 0x9B, 0x14, 0xD7, 0x25, 0x3A, + 0x96, 0x25, 0x7B, 0xBE, 0x32, 0x46, 0xC3, 0x20, 0x4E, 0x01, 0x98, 0x0A, 0x27, 0x53, 0x58, 0xFA, + 0xAF, 0x14, 0xE6, 0x6B, 0x99, 0x32, 0x85, 0x87, 0x8F, 0xDA, 0x09, 0x7C, 0x92, 0x9D, 0x4C, 0x87, + 0xF6, 0xB3, 0x67, 0x61, 0xA2, 0x7C, 0x25, 0x5D, 0x4E, 0xA7, 0x6F, 0xF0, 0xCB, 0x6C, 0x6A, 0xC3, + 0xE2, 0x19, 0x33, 0xBE, 0x73, 0x95, 0xE1, 0xBA, 0x39, 0x09, 0x7F, 0xAE, 0x72, 0x8A, 0x4E, 0x74, + 0xA1, 0xBF, 0x5B, 0x1D, 0x34, 0x89, 0xF0, 0x94, 0xE6, 0x84, 0x3C, 0x64, 0x29, 0x04, 0x07, 0x34, + 0xC3, 0x32, 0xEF, 0xF6, 0xE5, 0x24, 0x54, 0x09, 0xFA, 0x81, 0xDB, 0xF1, 0xCF, 0xE5, 0xDB, 0x98, + 0x27, 0xC0, 0xEB, 0xDA, 0x10, 0x73, 0x74, 0x76, 0xCA, 0xD7, 0xFE, 0xDF, 0x82, 0x63, 0x0F, 0x31, + 0x03, 0xBE, 0x10, 0xF4, 0xF6, 0x76, 0xDD, 0x27, 0xAD, 0xE4, 0xC1, 0xFA, 0xC5, 0x5A, 0x71, 0x8D, + 0x59, 0x39, 0x41, 0x6C, 0xDD, 0xFB, 0x4C, 0x5C, 0xB0, 0xB8, 0xF9, 0x67, 0x9C, 0xD7, 0x90, 0x44, + 0xE2, 0xF3, 0x39, 0x4C, 0x84, 0x1A, 0x13, 0x3F, 0xF2, 0xDF, 0x77, 0xA5, 0xF6, 0xAB, 0x69, 0x37, + 0x18, 0x56, 0x03, 0x86, 0xE9, 0xB7, 0xC8, 0xD8, 0x5A, 0xA1, 0x87, 0x00, 0xBC, 0x14, 0x44, 0xFF, + 0x21, 0xDD, 0xAC, 0x99, 0xD2, 0x78, 0xDF, 0x0C, 0xF3, 0xAC, 0x5F, 0xF4, 0x56, 0xE4, 0xAB, 0xCF, + 0x5F, 0x1C, 0x60, 0x7E, 0xFA, 0xDA, 0x36, 0x8A, 0xF2, 0xD4, 0x80, 0x64, 0xC5, 0x54, 0x53, 0xCA, + 0xF3, 0x80, 0x9A, 0x3C, 0x7C, 0x7B, 0x32, 0x30, 0x14, 0xB7, 0x17, 0x9B, 0x42, 0x7C, 0x94, 0x0D, + 0xC4, 0x43, 0x5B, 0xB0, 0x86, 0xE9, 0x1F, 0x80, 0xCD, 0x45, 0x97, 0x3D, 0x8A, 0xD0, 0x22, 0x91, + 0xA0, 0x14, 0xA5, 0xD7, 0x71, 0x07, 0x8D, 0xAB, 0x69, 0xE8, 0x38, 0x98, 0xEE, 0x70, 0x3D, 0x7B, + 0x86, 0x13, 0xDE, 0xAF, 0xE5, 0x89, 0x5A, 0x5F, 0x1F, 0xF9, 0xA5, 0x3F, 0xED, 0x62, 0xE6, 0x65, + 0x3B, 0x86, 0xF9, 0x76, 0xD6, 0x5A, 0x57, 0x54, 0x8B, 0x0D, 0x39, 0xEC, 0x9F, 0x00, 0xBF, 0x4E, + 0xF8, 0x62, 0x51, 0x83, 0x74, 0x16, 0x00, 0x3A, 0x4F, 0x71, 0x18, 0x73, 0xF0, 0x41, 0x71, 0xB4, + 0xDC, 0x79, 0xFC, 0x32, 0xDB, 0x38, 0x0C, 0x3F, 0x1B, 0x66, 0xA4, 0x27, 0xED, 0xA7, 0xE2, 0xE6, + 0xB0, 0x51, 0xF6, 0xBD, 0xEF, 0x2E, 0x0E, 0x10, 0x8F, 0x1D, 0x40, 0xDF, 0x85, 0x67, 0xC7, 0x25, + 0x11, 0x7F, 0x50, 0x99, 0xC8, 0xAE, 0xDF, 0x6A, 0xAF, 0x70, 0x8C, 0xD4, 0xB5, 0x6A, 0xA5, 0x21, + 0x1C, 0xBF, 0x0C, 0x75, 0xA2, 0x40, 0x03, 0x17, 0x58, 0x8C, 0x84, 0x4D, 0x82, 0x29, 0xE5, 0x7C, + 0x05, 0xA1, 0xAF, 0x48, 0x07, 0xD1, 0xF7, 0x53, 0xBC, 0x02, 0xF7, 0xCD, 0x60, 0x35, 0xEE, 0x04, + 0x03, 0xE1, 0x3A, 0xAA, 0x71, 0x54, 0x5B, 0xDD, 0x86, 0x68, 0xFB, 0xC6, 0xBC, 0xCF, 0xCD, 0x55, + 0xBC, 0x0E, 0x0D, 0x8D, 0x7B, 0x70, 0x1F, 0xE4, 0xEC, 0x2C, 0x91, 0x22, 0xF6, 0x55, 0xC9, 0x07, + 0x0F, 0x26, 0x60, 0x4F, 0xB0, 0x27, 0xFA, 0xAB, 0xBF, 0x3B, 0xF1, 0x3F, 0x52, 0xB8, 0xC7, 0x7B, + 0x52, 0xBF, 0x6E, 0xA4, 0x87, 0xCD, 0x40, 0x62, 0x4D, 0xDA, 0xD1, 0x37, 0x77, 0x44, 0xB3, 0x1D, + 0xD6, 0x2F, 0x9A, 0xA8, 0x61, 0x54, 0x6A, 0x1E, 0x2E, 0xE2, 0xC0, 0xBF, 0x7D, 0xAD, 0xB9, 0xDB, + 0x52, 0x5C, 0x0F, 0x15, 0x7F, 0x40, 0x8B, 0xC3, 0x4E, 0xC5, 0xC3, 0x59, 0x5A, 0x19, 0x3F, 0xA1, + 0xB3, 0x58, 0x3A, 0xC2, 0x06, 0x5B, 0x16, 0xF8, 0xEA, 0xFA, 0xB6, 0x8D, 0x93, 0xFF, 0xC4, 0x96, + 0x2C, 0x9F, 0xD0, 0xAB, 0x5A, 0x2B, 0x81, 0x17, 0xA9, 0x71, 0x38, 0x0F, 0x01, 0xEF, 0x5A, 0xC0, + 0xE9, 0x9F, 0x8B, 0x63, 0x47, 0x89, 0x50, 0xC2, 0xFB, 0x8A, 0x8B, 0x9F, 0xEE, 0xC4, 0xC4, 0x7A, + 0xDC, 0xAD, 0xC3, 0x6A, 0x70, 0xA4, 0x71, 0x53, 0xFD, 0xA9, 0x0D, 0xC0, 0x62, 0x23, 0xB8, 0x9D, + 0xAE, 0xA2, 0x12, 0x0B, 0x18, 0x42, 0xB6, 0x93, 0x2A, 0x85, 0x60, 0x09, 0x59, 0x69, 0x52, 0x1F, + 0x1E, 0xBA, 0xBF, 0x0F, 0xA6, 0x8E, 0xB0, 0x8A, 0x03, 0xCA, 0xC5, 0x1C, 0x8E, 0x89, 0xF2, 0x50, + 0xD7, 0x1A, 0xA9, 0x63, 0x83, 0x0F, 0x6D, 0x06, 0x27, 0x1F, 0x40, 0xDA, 0x0B, 0x9E, 0xEB, 0x1F, + 0x7E, 0x4F, 0x8A, 0xF0, 0x38, 0x86, 0x08, 0xC6, 0x3A, 0xFF, 0x29, 0xCC, 0xA7, 0x10, 0x27, 0xF3, + 0x99, 0x3E, 0x52, 0xF3, 0x0F, 0x83, 0x93, 0x9F, 0x63, 0xE8, 0x23, 0x41, 0x71, 0x98, 0x25, 0x1B, + 0xC9, 0x89, 0x15, 0x8F, 0xC8, 0x72, 0x35, 0x72, 0x7D, 0xF2, 0x36, 0x31, 0x64, 0xF5, 0x3A, 0x4C, + 0x15, 0x9B, 0x30, 0x77, 0x36, 0x03, 0xB9, 0xEE, 0xCA, 0x61, 0x22, 0x7C, 0xCF, 0xEE, 0x6C, 0xE4, + 0xEC, 0x83, 0x67, 0x10, 0x07, 0x7A, 0x21, 0x97, 0xDF, 0xC3, 0x2A, 0x27, 0x47, 0xDB, 0x1A, 0x76, + 0x2D, 0xA5, 0x9D, 0xD7, 0x39, 0x54, 0x4F, 0x62, 0x9C, 0xFD, 0x77, 0x0E, 0xB0, 0x4A, 0x0A, 0xD9, + 0x46, 0xC2, 0x28, 0x49, 0xB0, 0x53, 0x99, 0x2A, 0xC2, 0x81, 0xF9, 0x8A, 0xE1, 0x01, 0xDA, 0xCC, + 0x31, 0x60, 0x9B, 0x32, 0x4B, 0x69, 0x2B, 0x89, 0x00, 0xDA, 0xCD, 0x41, 0x0B, 0x13, 0xC0, 0x3C, + 0x4A, 0xD0, 0x32, 0x0A, 0x45, 0x31, 0x54, 0x38, 0x9E, 0x74, 0x56, 0x60, 0x8A, 0xFA, 0x0C, 0x0C, + 0xC8, 0xDC, 0x4E, 0x12, 0x9A, 0xD0, 0x2B, 0xAC, 0xF3, 0x16, 0xD3, 0xE4, 0x5C, 0xA8, 0x3B, 0x8A, + 0x8E, 0x04, 0x4B, 0x09, 0xDE, 0x91, 0x1C, 0xF2, 0x3D, 0xB5, 0x27, 0x23, 0x9A, 0x5F, 0xCA, 0xCE, + 0x1D, 0x81, 0x25, 0xD3, 0x0B, 0x07, 0x3B, 0xA2, 0xED, 0xC1, 0x68, 0xA3, 0x10, 0x1E, 0x49, 0xED, + 0x2B, 0x02, 0xD4, 0x65, 0x6B, 0xDE, 0xF7, 0xE8, 0x3D, 0xC3, 0x41, 0x1E, 0x75, 0xDB, 0xD0, 0xE4, + 0xA7, 0xFF, 0xFC, 0xB3, 0x0D, 0xAE, 0x72, 0x6D, 0xF2, 0x16, 0xF9, 0x4C, 0x9B, 0x2C, 0x83, 0x55, + 0x53, 0x32, 0xB1, 0x4E, 0xE7, 0x7E, 0x7F, 0xF6, 0xBE, 0xE4, 0x7A, 0xF3, 0xDB, 0x73, 0xA5, 0xDC, + 0xB3, 0x1F, 0x1B, 0x9E, 0x93, 0x58, 0x58, 0x4C, 0xDB, 0xED, 0x8C, 0x02, 0xB7, 0x43, 0x10, 0x7F, + 0x32, 0xF0, 0xFC, 0xD2, 0xDA, 0x18, 0xA6, 0x74, 0x80, 0x12, 0x9C, 0xBB, 0xB9, 0xA9, 0x03, 0x76, + 0xC9, 0x4E, 0xE0, 0xE3, 0x63, 0x96, 0xC8, 0x32, 0x04, 0x06, 0x15, 0x52, 0xD1, 0xB6, 0x03, 0x1B, + 0x5D, 0xF2, 0x40, 0x43, 0x37, 0xCF, 0x7C, 0xF5, 0xC4, 0xAB, 0x8B, 0x83, 0x63, 0x5D, 0xE3, 0x3B, + 0x3B, 0x66, 0xE6, 0x19, 0xEF, 0x51, 0x6B, 0x60, 0x6F, 0x3E, 0x71, 0x3D, 0x8E, 0x5A, 0x77, 0xD2, + 0x57, 0x9A, 0x06, 0xE9, 0xBB, 0x8A, 0x50, 0x58, 0x90, 0xF1, 0x17, 0xD7, 0x18, 0x9C, 0x24, 0x65, + 0x3D, 0x40, 0xA5, 0xA1, 0xD8, 0x24, 0x4B, 0xAA, 0x8A, 0x47, 0x3F, 0x0D, 0xB6, 0x60, 0xE6, 0x75, + 0xCD, 0x45, 0x6D, 0x54, 0xD9, 0x67, 0x65, 0xE0, 0x04, 0xCC, 0xBE, 0xCC, 0xAA, 0x8E, 0x3D, 0xB9, + 0x1E, 0x03, 0x25, 0x25, 0x31, 0x88, 0x36, 0xF6, 0x52, 0xD7, 0x4E, 0x75, 0xB5, 0xEA, 0x05, 0x83, + 0x59, 0xAD, 0xAF, 0xF4, 0x13, 0xCE, 0x5D, 0xF4, 0x52, 0x98, 0xBC, 0x63, 0xFE, 0xB0, 0xC5, 0x55, + 0xBD, 0x5A, 0x65, 0x3E, 0xAF, 0x24, 0x4C, 0x5E, 0xEA, 0x9A, 0x44, 0x32, 0x0E, 0x39, 0xCA, 0x60, + 0xB2, 0xBF, 0x62, 0x40, 0x19, 0x57, 0xDE, 0x7C, 0x70, 0xD7, 0xC3, 0x0E, 0x9A, 0x98, 0x6F, 0x26, + 0x22, 0x45, 0xC4, 0xD1, 0x8E, 0x6B, 0xC9, 0x3F, 0x1E, 0x71, 0x4F, 0x2E, 0x86, 0x42, 0x73, 0x00, + 0xEB, 0x98, 0x22, 0x03, 0x1F, 0x6F, 0xC3, 0xAF, 0xD0, 0x55, 0x8F, 0x95, 0x6F, 0x8E, 0x4B, 0xF0, + 0x21, 0x1D, 0xA7, 0xB1, 0xE8, 0x6B, 0xC7, 0x8A, 0xAD, 0x69, 0xD7, 0x6A, 0x7F, 0x09, 0x3A, 0x9F, + 0xBF, 0x30, 0x27, 0x18, 0x00, 0x11, 0xF2, 0x96, 0xAB, 0x57, 0xD3, 0x67, 0x5D, 0x2A, 0x36, 0xCF, + 0xE2, 0x05, 0xBB, 0x01, 0x83, 0x0B, 0xC7, 0x6D, 0xE9, 0xFD, 0x5A, 0xC8, 0x0D, 0x9C, 0xC0, 0xA2, + 0x41, 0x8D, 0x0E, 0x53, 0xB2, 0xD2, 0x2B, 0xD8, 0xE5, 0x4C, 0xEE, 0x81, 0x52, 0xED, 0xE8, 0xEA, + 0xF1, 0xF3, 0x2A, 0x5D, 0xEC, 0x2D, 0x0E, 0xFD, 0x76, 0x26, 0x4C, 0x25, 0x78, 0x26, 0x6F, 0x2F, + 0xF7, 0x31, 0xAB, 0xC0, 0x6C, 0x80, 0x1F, 0x2B, 0x8B, 0x1E, 0xC1, 0x09, 0x46, 0x5E, 0x94, 0x19, + 0xED, 0x07, 0x94, 0xEC, 0xCF, 0x3B, 0xC6, 0x51, 0x29, 0xC2, 0x87, 0xD4, 0x55, 0xD0, 0xAD, 0x82, + 0x66, 0x27, 0x61, 0x18, 0xDD, 0xB8, 0xBD, 0xF9, 0xE1, 0xCA, 0xAA, 0xBA, 0x49, 0x39, 0xD6, 0x43, + 0xA9, 0x10, 0x12, 0x7C, 0xA6, 0x82, 0xD8, 0xDB, 0x11, 0x76, 0x9D, 0xF0, 0x92, 0xFB, 0x31, 0xC1, + 0x9C, 0x31, 0x78, 0x1C, 0x11, 0xD6, 0xF3, 0x1F, 0x14, 0x39, 0xC6, 0x33, 0x46, 0x58, 0x8C, 0xE9, + 0x2B, 0x87, 0x94, 0xA6, 0xFA, 0x55, 0x5A, 0x3C, 0x39, 0x60, 0xD0, 0x26, 0x0F, 0xB3, 0x56, 0x18, + 0x77, 0x9C, 0x1B, 0x01, 0xBA, 0xE6, 0xB2, 0x1E, 0x8B, 0xA0, 0x63, 0x2D, 0x7E, 0xA2, 0x30, 0xFC, + 0xDF, 0x31, 0x99, 0xB2, 0xD6, 0x1E, 0xD3, 0xAB, 0xB7, 0xFA, 0x72, 0xB0, 0x6F, 0xE5, 0x6B, 0x9F, + 0xAF, 0xB4, 0xF0, 0x53, 0x06, 0x9C, 0xB0, 0x98, 0x6B, 0xF4, 0x5A, 0x52, 0xDB, 0xD0, 0x13, 0xED, + 0x73, 0x70, 0x11, 0xBB, 0xD0, 0x98, 0x58, 0xCA, 0x29, 0x44, 0xCB, 0x7C, 0x2D, 0x43, 0xDE, 0x4F, + 0xBF, 0x13, 0x06, 0xDD, 0x3C, 0x69, 0x49, 0xD2, 0xD7, 0xA7, 0x24, 0x9E, 0x0D, 0x3C, 0x8C, 0x73, + 0x0F, 0xB2, 0x4F, 0x16, 0x83, 0x7E, 0x7B, 0x3A, 0xD4, 0x49, 0x42, 0x26, 0x9C, 0x6F, 0xAF, 0xD6, + 0x73, 0xEF, 0x29, 0x3D, 0x1A, 0x21, 0x58, 0x48, 0xF7, 0xEE, 0xD2, 0xC8, 0x06, 0x4D, 0xB2, 0x3D, + 0x1E, 0xD6, 0xF6, 0xF3, 0x25, 0xC8, 0xD5, 0xF4, 0xB6, 0x07, 0x2C, 0xB0, 0x03, 0xDE, 0x83, 0xE0, + 0x1C, 0x68, 0x2E, 0x78, 0xB6, 0xDA, 0x99, 0xA6, 0xBD, 0xE8, 0x1D, 0x47, 0x6E, 0x7A, 0x4C, 0xC5, + 0xE4, 0x54, 0xEA, 0xDB, 0xB1, 0x6F, 0x9F, 0x53, 0xA6, 0x41, 0xE2, 0x24, 0x6C, 0x9C, 0x88, 0xF7, + 0x88, 0xA8, 0x90, 0x0D, 0x34, 0x61, 0xAA, 0x7D, 0x52, 0x5F, 0x8D, 0x81, 0xBE, 0xC9, 0x3E, 0x36, + 0x8D, 0x69, 0x81, 0x0D, 0x24, 0x7D, 0xCE, 0x03, 0xB8, 0x4E, 0x9C, 0xFD, 0x5A, 0x4A, 0x45, 0xAF, + 0x45, 0xB5, 0xFF, 0x49, 0xEA, 0x6C, 0xF7, 0xB9, 0xE5, 0xC1, 0xA6, 0x57, 0xF3, 0xCA, 0xCC, 0x46, + 0xD2, 0x20, 0xB3, 0xB1, 0xC0, 0x18, 0xEE, 0x82, 0xE4, 0x00, 0x3C, 0xA7, 0x8B, 0xA6, 0x3A, 0xDA, + 0x82, 0x53, 0x3C, 0x42, 0x4C, 0x3B, 0x16, 0xD0, 0x3E, 0x0E, 0xBA, 0x36, 0xA6, 0xEA, 0x36, 0x16, + 0x80, 0xA3, 0x51, 0xFD, 0xF8, 0xFA, 0xE5, 0x75, 0x64, 0x17, 0x0C, 0xE5, 0xAE, 0xB2, 0xE5, 0x14, + 0xC1, 0xA9, 0xAE, 0x3A, 0x7E, 0x4D, 0x0E, 0x5C, 0x67, 0x31, 0x02, 0xD2, 0x4D, 0xB3, 0xD6, 0xC6, + 0xE6, 0x86, 0xC2, 0x62, 0xE6, 0xB6, 0x53, 0x2C, 0x29, 0x72, 0x90, 0x55, 0xAC, 0x1C, 0xE7, 0x7F, + 0x7F, 0xA3, 0xE8, 0x21, 0xF0, 0x2D, 0x3E, 0x8A, 0xA3, 0xA2, 0xA2, 0x29, 0xEC, 0x36, 0x4B, 0x89, + 0x1C, 0xB6, 0xC1, 0xB9, 0x4A, 0x8F, 0x65, 0xDF, 0x97, 0x29, 0x0F, 0x0B, 0xB1, 0x61, 0x24, 0xA2, + 0xD2, 0x57, 0x7A, 0x99, 0xF7, 0x1D, 0xC8, 0xB4, 0xDD, 0xEE, 0x7A, 0xBE, 0x2E, 0x46, 0x9A, 0xF6, + 0x92, 0x13, 0xAC, 0x98, 0x64, 0x4C, 0xDD, 0x6B, 0x03, 0xD3, 0xF4, 0x14, 0xC9, 0x7D, 0xCE, 0x9B, + 0xF7, 0xD4, 0x80, 0xB1, 0x2A, 0x66, 0x33, 0xA4, 0xE2, 0x45, 0x99, 0x95, 0x77, 0xE1, 0x3E, 0x8A, + 0x43, 0x85, 0xD9, 0x79, 0x69, 0x0D, 0x55, 0xCF, 0x09, 0xF4, 0xFC, 0x07, 0x39, 0x20, 0x26, 0xB4, + 0x8B, 0xD0, 0x60, 0xFB, 0x42, 0x41, 0xEF, 0x02, 0x5F, 0x0D, 0xC7, 0x7F, 0x09, 0xFA, 0x26, 0x94, + 0x7A, 0xCD, 0xDE, 0x43, 0x86, 0x44, 0xD6, 0xC6, 0xB1, 0x77, 0x13, 0xB1, 0x08, 0xC9, 0xDD, 0x99, + 0xF0, 0xED, 0x7B, 0xB0, 0xAB, 0x31, 0x6D, 0x5B, 0x66, 0xA3, 0x53, 0xE2, 0x3B, 0x0F, 0x31, 0xA2, + 0x63, 0x6E, 0x05, 0xAD, 0xC6, 0x74, 0xC5, 0x2D, 0xB3, 0x79, 0xEB, 0x66, 0xF3, 0x6B, 0x79, 0x02, + 0x7A, 0x7D, 0x49, 0x59, 0x30, 0x04, 0x29, 0xD8, 0x5E, 0xF7, 0xF3, 0x6C, 0x5E, 0xC2, 0xA6, 0xFF, + 0x1B, 0x5A, 0xFE, 0x01, 0x54, 0x40, 0xEF, 0xA0, 0xD5, 0xDB, 0x47, 0xED, 0x2A, 0x9B, 0x85, 0x12, + 0x9F, 0x74, 0x5D, 0xB7, 0xA6, 0x80, 0x22, 0x34, 0x87, 0x81, 0x7E, 0x15, 0x87, 0x62, 0x03, 0x87, + 0x62, 0x6B, 0x85, 0xF1, 0x37, 0x55, 0x55, 0x31, 0x18, 0xBD, 0xEF, 0x57, 0x1D, 0x21, 0x5E, 0x87, + 0x37, 0x53, 0x61, 0x7B, 0xA5, 0x80, 0x71, 0x2C, 0x72, 0x83, 0x64, 0x73, 0xF2, 0x4C, 0xA0, 0x3F, + 0x4C, 0x3E, 0x21, 0xF3, 0x96, 0xBB, 0x9C, 0x05, 0xE1, 0x12, 0x47, 0xA2, 0x6E, 0xF6, 0x67, 0xFE, + 0x1B, 0x3F, 0x74, 0xA5, 0x6B, 0x2E, 0xB3, 0x77, 0x02, 0x64, 0x30, 0xAF, 0x6C, 0x64, 0x2E, 0x69, + 0x92, 0xA5, 0xD3, 0xA8, 0xEE, 0xEF, 0xB7, 0x89, 0xD9, 0x31, 0x1B, 0x61, 0xC8, 0x91, 0xF1, 0xC5, + 0x59, 0x7D, 0xCE, 0xDF, 0xFB, 0xF2, 0x10, 0xF7, 0x42, 0x02, 0xEC, 0x70, 0x2F, 0xE4, 0x02, 0xB4, + 0xFB, 0xA0, 0xFC, 0x83, 0x58, 0x68, 0xA2, 0x8E, 0x01, 0x8B, 0x10, 0xF6, 0x30, 0x86, 0xAA, 0x5A, + 0xC4, 0x95, 0x61, 0x02, 0x8E, 0xF2, 0xB7, 0x6B, 0x6C, 0x80, 0x5C, 0xCB, 0x11, 0x66, 0x97, 0x60, + 0x70, 0xD4, 0x06, 0xA9, 0xC7, 0x80, 0xE3, 0x2C, 0xA4, 0xE1, 0xAA, 0x34, 0x92, 0x13, 0x57, 0x05, + 0xF9, 0x70, 0xF3, 0xF4, 0x80, 0x73, 0xF2, 0x16, 0xDA, 0xBD, 0x39, 0x51, 0xD1, 0x40, 0xC1, 0x59, + 0x04, 0xCD, 0xE4, 0x79, 0x63, 0x24, 0x69, 0xC6, 0x99, 0x2F, 0x4D, 0x0D, 0x1C, 0x9C, 0x15, 0xED, + 0x41, 0x47, 0x12, 0x78, 0x6F, 0x8E, 0xFF, 0xA7, 0x34, 0xB8, 0x8B, 0x0C, 0x70, 0x96, 0x07, 0x0B, + 0x49, 0x42, 0x59, 0xFE, 0x5A, 0x08, 0x76, 0x36, 0x3D, 0x7D, 0xBA, 0x10, 0x1B, 0x11, 0xB4, 0x6B, + 0x1C, 0x59, 0x60, 0x02, 0x36, 0x30, 0xD9, 0xEC, 0xBA, 0xEE, 0x22, 0xFD, 0x0F, 0x2E, 0xA2, 0xE2, + 0x70, 0x9C, 0x0D, 0x18, 0x58, 0x88, 0x4A, 0x0D, 0xE7, 0x0E, 0xEF, 0xD8, 0x6F, 0xA7, 0x70, 0x12, + 0x9D, 0x06, 0x4C, 0x8C, 0xAD, 0x1A, 0x28, 0x01, 0xB6, 0x23, 0x53, 0x76, 0xDD, 0x3F, 0x17, 0x87, + 0x0B, 0xC1, 0xEB, 0x9C, 0x44, 0x67, 0x1B, 0x79, 0xE0, 0x67, 0xB2, 0x2A, 0x99, 0x72, 0xEB, 0x4C, + 0xB4, 0x17, 0x2E, 0xB5, 0xE8, 0x52, 0x1E, 0xCB, 0x3A, 0x3D, 0xF7, 0xF2, 0x21, 0xC7, 0xF1, 0x29, + 0x97, 0x22, 0x31, 0x2C, 0x39, 0x8A, 0xAF, 0x47, 0xF9, 0x3B, 0xA9, 0x8B, 0x2B, 0xEF, 0xE2, 0xF0, + 0x11, 0x59, 0xFC, 0xE4, 0x56, 0xFF, 0x4E, 0xA7, 0x92, 0xE5, 0xE5, 0x26, 0x16, 0xC8, 0x2C, 0x35, + 0xD2, 0x70, 0x9F, 0xAE, 0xA7, 0x08, 0x16, 0x2B, 0x64, 0xA1, 0xF6, 0xF3, 0xC1, 0x43, 0x27, 0x92, + 0x46, 0x4E, 0xA2, 0x01, 0x72, 0x18, 0x08, 0xAB, 0x22, 0x42, 0x1B, 0x9E, 0x35, 0xAE, 0xB3, 0xE6, + 0x42, 0x1B, 0x49, 0x31, 0xBB, 0xA4, 0xD0, 0xD6, 0x7A, 0xEB, 0xFE, 0x32, 0x37, 0x7F, 0xE6, 0x2F, + 0x75, 0x54, 0x1D, 0x88, 0x9F, 0x81, 0xEE, 0xF0, 0x97, 0xC9, 0x12, 0x80, 0x47, 0x5C, 0xCA, 0x3B, + 0x45, 0xF4, 0x63, 0xC3, 0x16, 0x2D, 0x7E, 0xCD, 0x80, 0xC2, 0xBA, 0x50, 0x1D, 0xC2, 0x31, 0x72, + 0xF0, 0x27, 0x97, 0xB0, 0xF4, 0x69, 0x43, 0x2B, 0x26, 0x89, 0x28, 0xFC, 0xBD, 0x03, 0x6A, 0x4A, + 0x22, 0x5D, 0xD3, 0x7D, 0xEC, 0xC8, 0xEC, 0x7B, 0x15, 0xFA, 0x05, 0x5D, 0x73, 0x6B, 0x5B, 0x1B, + 0xC9, 0x83, 0xD0, 0xFA, 0x24, 0xBA, 0x97, 0x11, 0x30, 0x04, 0xD3, 0x11, 0xCE, 0x24, 0xBD, 0x71, + 0xB7, 0xAA, 0xB2, 0xC2, 0x43, 0xC2, 0x67, 0x3B, 0x9C, 0x28, 0x62, 0x52, 0xF0, 0xFA, 0xCB, 0xFA, + 0xDF, 0x4F, 0xC9, 0x23, 0xD1, 0x94, 0xE1, 0x5F, 0x2A, 0xF2, 0xC7, 0x5F, 0x76, 0x6B, 0x86, 0x28, + 0x29, 0xF1, 0x54, 0x4F, 0x7A, 0x4D, 0xFD, 0xD0, 0x51, 0xFA, 0xBC, 0x6F, 0x7B, 0x44, 0xE5, 0xB0, + 0xF3, 0xC0, 0x34, 0x80, 0x6D, 0xE6, 0xDD, 0xCD, 0x7F, 0x67, 0x7B, 0x15, 0xC5, 0xE5, 0x14, 0x64, + 0x80, 0x81, 0xD9, 0x47, 0xCE, 0x71, 0x62, 0x94, 0xCE, 0x41, 0x61, 0xFA, 0xDD, 0x5A, 0x6D, 0xC1, + 0x28, 0x87, 0x39, 0xC4, 0xBC, 0x89, 0x3A, 0x99, 0x18, 0x80, 0xDC, 0x50, 0x72, 0xCF, 0x67, 0x4D, + 0x77, 0x6D, 0x6A, 0xB4, 0x17, 0x85, 0xD6, 0x2B, 0xC3, 0x4A, 0x7C, 0xD1, 0xF3, 0x0E, 0xA4, 0x8F, + 0x3B, 0xDA, 0x8A, 0x7B, 0x0A, 0x37, 0x7D, 0x36, 0xEC, 0x89, 0x87, 0xD9, 0x88, 0xB7, 0xC9, 0x1F, + 0xEB, 0xEE, 0x25, 0x46, 0xA9, 0x3B, 0x19, 0x16, 0x17, 0x2D, 0x0F, 0x8C, 0xEB, 0x19, 0xF3, 0x47, + 0xC7, 0x21, 0xA8, 0x1E, 0x7F, 0xC4, 0xE3, 0x6B, 0x96, 0x1D, 0x63, 0xDD, 0xC2, 0xEF, 0xB2, 0x65, + 0x60, 0x07, 0xE5, 0xD3, 0x48, 0x49, 0x9A, 0xF2, 0xB0, 0x76, 0x2D, 0xFB, 0x68, 0xF8, 0xAD, 0xE9, + 0x3C, 0x52, 0x37, 0x9A, 0xD1, 0xAE, 0x16, 0x37, 0x2E, 0xB3, 0x63, 0xE0, 0x66, 0xB1, 0x4D, 0x49, + 0x83, 0xD2, 0xEA, 0x20, 0xFD, 0x43, 0x84, 0x5B, 0x22, 0xBC, 0x0C, 0xA1, 0x85, 0x28, 0xF7, 0x45, + 0xF1, 0x2A, 0xC2, 0xFE, 0x87, 0x4C, 0xFC, 0x0A, 0x5B, 0xD9, 0x84, 0x7A, 0xAC, 0x8C, 0xBD, 0xDF, + 0xDC, 0xA5, 0xFC, 0xD0, 0x85, 0x65, 0xA2, 0x73, 0x1C, 0x7C, 0xFD, 0xF9, 0xBA, 0x1E, 0xBD, 0x5F, + 0x06, 0xE8, 0xFC, 0x62, 0xD1, 0xF7, 0x13, 0x52, 0xE3, 0xC2, 0xEB, 0xEE, 0x0E, 0x7E, 0x9D, 0x8A, + 0x19, 0x3E, 0xA2, 0x62, 0x06, 0xC5, 0xA1, 0xDC, 0x6B, 0x4A, 0x59, 0xA6, 0x57, 0x73, 0xCB, 0x57, + 0x16, 0x99, 0xFB, 0x93, 0x36, 0xDF, 0x0E, 0x1A, 0x38, 0xD4, 0x89, 0x02, 0x79, 0xB6, 0xA8, 0x52, + 0xCB, 0x2E, 0x96, 0xD4, 0xD8, 0x52, 0xA9, 0x7C, 0xE3, 0x97, 0x47, 0x6F, 0x6E, 0x82, 0x6D, 0x3A, + 0x01, 0x8F, 0x2F, 0x59, 0xDF, 0x93, 0xBA, 0x52, 0xC4, 0x46, 0xDA, 0xC5, 0x0C, 0x2E, 0x40, 0xB8, + 0x37, 0x55, 0x40, 0xB8, 0x13, 0xCD, 0x51, 0x96, 0xCE, 0x4A, 0x6C, 0x0D, 0xF9, 0x5A, 0xE6, 0x34, + 0x95, 0xF0, 0xFF, 0x54, 0x93, 0x05, 0x9D, 0x56, 0x94, 0xF7, 0x23, 0x90, 0x00, 0x44, 0xA7, 0xD9, + 0x86, 0x71, 0xB2, 0xFD, 0x58, 0x19, 0xBB, 0xEC, 0x6B, 0x90, 0x07, 0x2B, 0x7A, 0x20, 0x4B, 0xFD, + 0x0E, 0xB8, 0xF8, 0x00, 0x13, 0xC2, 0xF2, 0x32, 0x39, 0xED, 0x71, 0x59, 0x71, 0xC4, 0xDC, 0xE5, + 0xC2, 0xA9, 0x2B, 0x7B, 0x52, 0x00, 0xCB, 0x49, 0xB4, 0x00, 0xE6, 0x98, 0x13, 0xC1, 0x2F, 0x3A, + 0x19, 0x86, 0xD5, 0x74, 0xCD, 0xBC, 0xBA, 0x4C, 0x48, 0x00, 0x8E, 0x22, 0xD5, 0xAC, 0x11, 0xEF, + 0xC8, 0xCD, 0x99, 0xBA, 0xBC, 0x0F, 0xD4, 0xC0, 0xAE, 0x15, 0x2F, 0x82, 0x6D, 0x4D, 0x44, 0x10, + 0xF1, 0xF5, 0x55, 0xF0, 0x00, 0xAF, 0xEA, 0x96, 0x1F, 0xE6, 0xA6, 0x9A, 0x78, 0xDD, 0x6D, 0xD5, + 0xDF, 0xA4, 0x4D, 0xAE, 0x05, 0xEE, 0x12, 0x9F, 0x9B, 0x99, 0xAC, 0xE4, 0xBE, 0x9E, 0x56, 0xCC, + 0x4B, 0x6D, 0x26, 0xB9, 0x56, 0x9B, 0x9B, 0x52, 0x6D, 0x14, 0x28, 0x7D, 0xE8, 0x75, 0xCB, 0x59, + 0xC0, 0x50, 0x69, 0x6B, 0xD7, 0x68, 0x06, 0xA8, 0x38, 0xD1, 0xBB, 0xD9, 0xA3, 0x3D, 0xA1, 0xBD, + 0x7D, 0x9E, 0xD2, 0xB9, 0x5D, 0x35, 0x02, 0xE0, 0xD4, 0xAF, 0x66, 0x56, 0x7D, 0xF4, 0x88, 0x74, + 0x3C, 0x28, 0x2C, 0xBA, 0x20, 0xC1, 0x2A, 0x93, 0xA9, 0xBA, 0x90, 0xE8, 0xC2, 0xE9, 0x15, 0xC8, + 0x8F, 0xBD, 0x27, 0xDE, 0x21, 0xBF, 0x56, 0x69, 0x93, 0x72, 0x7E, 0xE4, 0xE7, 0x7D, 0xE8, 0x4D, + 0xBF, 0x24, 0xA2, 0x77, 0xC0, 0xE0, 0x30, 0xD9, 0xEE, 0x82, 0xCD, 0x21, 0x60, 0xFC, 0xD1, 0x6F, + 0xB4, 0x40, 0x01, 0xFE, 0xF4, 0x73, 0xAF, 0xBB, 0xF6, 0x2B, 0x41, 0xFC, 0xDE, 0x74, 0x78, 0xE5, + 0x7E, 0xAB, 0xC9, 0xED, 0x63, 0x4B, 0x3E, 0x1A, 0x27, 0xCD, 0xBF, 0x85, 0xA4, 0x70, 0x92, 0x36, + 0x56, 0x70, 0x4A, 0xEE, 0x45, 0xAB, 0x33, 0x0A, 0x76, 0xB8, 0x0B, 0xEA, 0x55, 0xC7, 0x4E, 0xD7, + 0xD9, 0xC7, 0x10, 0x8D, 0x09, 0xFA, 0x10, 0x30, 0x62, 0x20, 0xE5, 0xBC, 0xFB, 0x74, 0x72, 0xA6, + 0x77, 0xB5, 0xBB, 0xD7, 0xD6, 0x60, 0x3A, 0x6B, 0x5D, 0xF5, 0x35, 0xF4, 0x84, 0xA0, 0x19, 0x49, + 0x36, 0x00, 0xC9, 0x35, 0xCC, 0xF7, 0xFE, 0x92, 0xF9, 0x4B, 0x8B, 0xB3, 0xBE, 0x98, 0xBF, 0xF4, + 0x25, 0xB1, 0x62, 0x4D, 0x41, 0xA0, 0xF7, 0x36, 0x6C, 0x86, 0x3C, 0x4F, 0xC4, 0xF8, 0xF2, 0xFC, + 0xE6, 0x34, 0x30, 0x95, 0x32, 0x9D, 0xE5, 0x85, 0x70, 0xD8, 0xB8, 0xD6, 0xD9, 0x42, 0xB9, 0x05, + 0x6E, 0x4B, 0x6F, 0x29, 0x33, 0x8E, 0xE4, 0x31, 0x3C, 0x21, 0x7B, 0x19, 0x31, 0x97, 0xD5, 0x62, + 0x6B, 0xF6, 0x98, 0x3C, 0xA5, 0x54, 0x18, 0x16, 0x03, 0x49, 0x51, 0x1F, 0x13, 0x37, 0xFB, 0x18, + 0x9D, 0xCF, 0x16, 0x43, 0x34, 0x7D, 0xB6, 0x5C, 0x9E, 0x74, 0x4D, 0x66, 0x23, 0x99, 0xDE, 0x6E, + 0x57, 0xFE, 0x47, 0x0D, 0x3B, 0x59, 0x3F, 0x01, 0x79, 0x75, 0x0D, 0x78, 0x62, 0x4A, 0xA5, 0xF2, + 0xF8, 0xD6, 0xAE, 0x11, 0x85, 0x88, 0x13, 0x98, 0x07, 0x0B, 0x92, 0x99, 0xC6, 0x9F, 0x85, 0x24, + 0xB1, 0x48, 0xEF, 0x59, 0x11, 0xCB, 0xAB, 0x92, 0xE4, 0x58, 0x50, 0xAA, 0xE8, 0x97, 0xD5, 0xCD, + 0x63, 0x57, 0x61, 0x62, 0x06, 0xBD, 0x26, 0x08, 0x0E, 0xC6, 0x42, 0x98, 0x8E, 0x82, 0x13, 0xD7, + 0xB8, 0x18, 0x7B, 0xAA, 0xFD, 0x42, 0x51, 0x07, 0xDE, 0x6F, 0xCF, 0xE7, 0x87, 0xF6, 0xBF, 0x15, + 0x8D, 0x8E, 0xFD, 0xA9, 0x4A, 0x45, 0x81, 0x57, 0x8F, 0x22, 0x4D, 0x63, 0x21, 0x4E, 0x41, 0x3C, + 0xCD, 0x77, 0xF5, 0xEC, 0xB8, 0x15, 0x8A, 0xBC, 0x69, 0x22, 0x98, 0xE5, 0xA4, 0x66, 0x47, 0xC5, + 0x9F, 0xE9, 0x9D, 0x06, 0xD8, 0xD2, 0x37, 0xA0, 0x4C, 0xDC, 0x33, 0xD4, 0xE7, 0xED, 0x77, 0x7D, + 0xA2, 0x20, 0x81, 0xB2, 0x46, 0xC5, 0xF6, 0xF5, 0x2A, 0x76, 0x50, 0xAF, 0xC2, 0x5A, 0xC7, 0x8F, + 0xD8, 0x3C, 0x4F, 0x2F, 0xE3, 0x56, 0x04, 0xB2, 0x6C, 0x8C, 0x0D, 0x84, 0xD7, 0xE0, 0xB5, 0x45, + 0xB2, 0x93, 0x34, 0xA0, 0xC2, 0xF4, 0x3A, 0x28, 0xDC, 0x50, 0xE8, 0xF3, 0xF0, 0x7C, 0x67, 0x1A, + 0x11, 0xD7, 0x8D, 0xB2, 0x71, 0x3D, 0xB3, 0x68, 0x49, 0x19, 0x29, 0x54, 0xDF, 0x44, 0xB9, 0x48, + 0xDD, 0x9E, 0xCE, 0xCD, 0x2D, 0x69, 0xB6, 0x18, 0xAD, 0xBC, 0xDC, 0xDF, 0x1F, 0x48, 0x04, 0x16, + 0xD6, 0x3A, 0x39, 0x7E, 0x30, 0xDB, 0x9D, 0xE1, 0x14, 0xF2, 0x5F, 0xDB, 0x1D, 0xBB, 0x7F, 0x4F, + 0x49, 0xBF, 0x4D, 0x2B, 0x9B, 0x5C, 0x7E, 0xA8, 0x1B, 0x79, 0x4F, 0x29, 0xA2, 0xF8, 0xBA, 0x36, + 0x86, 0x10, 0xFA, 0x7C, 0x45, 0x99, 0xE9, 0xD1, 0xDB, 0x93, 0xDB, 0x2A, 0xD5, 0xA8, 0x61, 0x48, + 0xBA, 0xD9, 0x40, 0xD7, 0xAE, 0xE5, 0x35, 0xAA, 0xF0, 0xA5, 0xFD, 0xC5, 0x64, 0x0B, 0x31, 0xA5, + 0x9D, 0x83, 0x31, 0xF6, 0xB8, 0xB5, 0x18, 0x3E, 0xB4, 0x2A, 0x8E, 0x70, 0x7A, 0xB8, 0xAC, 0xB5, + 0x92, 0xDD, 0x12, 0xA7, 0x9D, 0x41, 0xB1, 0x16, 0xE8, 0x45, 0x63, 0x1B, 0xB9, 0x73, 0xF1, 0x19, + 0xF6, 0xAE, 0x0F, 0xF3, 0xF7, 0x60, 0xED, 0x27, 0x70, 0x12, 0x8C, 0x12, 0x3A, 0xCF, 0xA6, 0xDC, + 0xBD, 0x17, 0x82, 0x05, 0x6E, 0x10, 0x04, 0xD4, 0xE7, 0x10, 0x9B, 0x83, 0x55, 0xB0, 0xED, 0x1B, + 0xF9, 0x7D, 0x75, 0x8E, 0xB2, 0x26, 0xA7, 0xBD, 0xE2, 0x0F, 0x29, 0x25, 0x6C, 0xFD, 0xC9, 0xC4, + 0x72, 0xE1, 0x1C, 0xDC, 0x9E, 0xBE, 0x69, 0xB5, 0xE8, 0x31, 0x83, 0x03, 0x5A, 0xEA, 0xA3, 0x52, + 0xD7, 0x51, 0x8A, 0x76, 0xB8, 0x83, 0xF0, 0x5E, 0xDC, 0xFC, 0xED, 0x80, 0x36, 0x7A, 0x39, 0xC6, + 0xFC, 0xF3, 0xC3, 0xE1, 0x5D, 0x15, 0x05, 0x30, 0xF6, 0x74, 0x93, 0x45, 0xB5, 0x2B, 0x0B, 0x63, + 0x2E, 0xF1, 0x24, 0x4B, 0x16, 0xD9, 0x61, 0xDB, 0x97, 0x9A, 0xC8, 0xFF, 0xCE, 0x74, 0xE9, 0x39, + 0x93, 0x00, 0xF8, 0xE0, 0x50, 0x62, 0x07, 0x0A, 0x6B, 0xB4, 0xBA, 0x2B, 0x61, 0x09, 0x25, 0x58, + 0x18, 0x0A, 0xB8, 0xDA, 0x8D, 0xFA, 0x8C, 0x4A, 0x41, 0xBE, 0xA4, 0x51, 0x9B, 0x83, 0x14, 0xC4, + 0xB5, 0x81, 0xB0, 0xA1, 0x35, 0x48, 0x34, 0xEB, 0xAF, 0x74, 0xF4, 0x61, 0xC5, 0x00, 0x39, 0x7D, + 0xAD, 0xF1, 0x07, 0x9C, 0x43, 0x20, 0x8F, 0x4B, 0x3D, 0xD3, 0x7C, 0x91, 0x1D, 0xC3, 0x3B, 0x06, + 0x50, 0x59, 0xA9, 0xC9, 0xA3, 0x23, 0xC9, 0xA6, 0x8A, 0x29, 0x84, 0x0D, 0x7D, 0xEE, 0x56, 0x5D, + 0xA1, 0xB6, 0xA3, 0xE7, 0x1F, 0x2A, 0xFB, 0x95, 0x7B, 0xFC, 0x9F, 0x9A, 0x18, 0xEA, 0xFF, 0xFD, + 0x61, 0x75, 0x3A, 0xF2, 0x22, 0xFF, 0xEB, 0xA2, 0x7C, 0x5A, 0x16, 0xB1, 0xE9, 0x93, 0xB0, 0x4D, + 0xA7, 0xA4, 0xB0, 0xAF, 0x70, 0x8C, 0x7E, 0x7D, 0xE8, 0x4F, 0xAA, 0x9D, 0x81, 0xD6, 0xF8, 0xB5, + 0xB6, 0x32, 0xA5, 0x31, 0xA1, 0x55, 0x11, 0x3A, 0x01, 0x13, 0x38, 0x3A, 0x41, 0x7A, 0x79, 0x31, + 0x3C, 0x13, 0xF5, 0x2C, 0x97, 0x28, 0xBD, 0x1F, 0x2E, 0x68, 0xAB, 0xA1, 0x52, 0x5F, 0xBB, 0x2A, + 0xCB, 0x11, 0xFE, 0x4A, 0x34, 0x30, 0xCD, 0xDD, 0x38, 0xAC, 0xED, 0xD0, 0x53, 0xC6, 0xC4, 0x33, + 0xE5, 0x17, 0x41, 0xC8, 0x7D, 0x14, 0x9C, 0x8C, 0x2D, 0x59, 0x61, 0xB1, 0xEC, 0x6A, 0x48, 0xAD, + 0xC7, 0x42, 0x79, 0x9B, 0x63, 0xDB, 0xB0, 0xAD, 0xAF, 0x44, 0x85, 0x2E, 0x24, 0x11, 0xE6, 0x1E, + 0x56, 0xB2, 0x1B, 0x2E, 0x98, 0x7E, 0x64, 0x3D, 0x98, 0x69, 0x51, 0x05, 0x3D, 0x5C, 0x0A, 0x85, + 0xCA, 0x58, 0x0E, 0x11, 0x86, 0xA7, 0xD6, 0xAC, 0xFF, 0x21, 0x12, 0x9F, 0xA1, 0x52, 0xE4, 0xD9, + 0xD5, 0xAC, 0x9B, 0xE2, 0x4B, 0xF0, 0x57, 0xFA, 0xFC, 0x05, 0x84, 0xB6, 0xD9, 0xB0, 0xCE, 0x5E, + 0xA0, 0x73, 0x32, 0xCE, 0x15, 0x29, 0xE8, 0x8F, 0xC4, 0xD9, 0x22, 0x3A, 0x9D, 0x71, 0xC5, 0x37, + 0x2B, 0x33, 0x76, 0x63, 0x49, 0x52, 0x8A, 0x2E, 0x89, 0x6D, 0x5A, 0x04, 0x83, 0xC1, 0xD9, 0x46, + 0xC3, 0x5C, 0x93, 0x6C, 0x3B, 0xDB, 0xFC, 0x1C, 0xC1, 0x65, 0x3B, 0x2C, 0xAD, 0xD5, 0x78, 0x9A, + 0x3A, 0xE4, 0xC3, 0x04, 0x11, 0xD8, 0xBD, 0x63, 0xA9, 0x93, 0x01, 0xF1, 0x42, 0x89, 0x5E, 0x66, + 0x95, 0xF2, 0x75, 0x38, 0x30, 0x4B, 0x39, 0x41, 0x49, 0x54, 0x8E, 0x12, 0x36, 0xFB, 0x9A, 0xA0, + 0x61, 0x13, 0x1C, 0xC2, 0xB2, 0x30, 0x7E, 0xD5, 0x22, 0xEB, 0xA3, 0xB6, 0x69, 0x2E, 0x0F, 0x0B, + 0xB0, 0x29, 0xF3, 0x24, 0x5A, 0x29, 0xA6, 0x3F, 0xC9, 0xC1, 0x56, 0xC5, 0x8E, 0xAA, 0x0B, 0x17, + 0x44, 0xBC, 0xFF, 0xE3, 0x12, 0xB8, 0x3E, 0xA9, 0x16, 0xF9, 0x7F, 0x57, 0x92, 0x7C, 0x0C, 0xFD, + 0x87, 0x9D, 0x70, 0xED, 0x81, 0xD0, 0x77, 0x01, 0x77, 0x71, 0xF5, 0x6C, 0x7F, 0xCC, 0xE4, 0xF0, + 0xAD, 0x27, 0x66, 0x2D, 0x16, 0x7B, 0x4E, 0x95, 0xF9, 0x59, 0xAA, 0x8A, 0x83, 0xE3, 0x1E, 0xD9, + 0x6E, 0x9C, 0x84, 0xEB, 0xBD, 0x5B, 0x33, 0x68, 0xA9, 0x3F, 0xDA, 0x69, 0xCB, 0xF1, 0xC7, 0x64, + 0x99, 0x27, 0xEF, 0xFF, 0xE2, 0x37, 0x34, 0x2D, 0x3C, 0x92, 0xAF, 0x7B, 0xE6, 0x6D, 0x7E, 0xF9, + 0xD2, 0x95, 0x14, 0xF1, 0x01, 0x93, 0xF2, 0xBD, 0xDF, 0x59, 0x67, 0xF6, 0x2D, 0x36, 0xBB, 0x8E, + 0x16, 0xCA, 0x07, 0xEC, 0x34, 0xA0, 0xE2, 0x16, 0x6C, 0xEC, 0x23, 0x41, 0x87, 0x7A, 0x66, 0x82, + 0x09, 0x6A, 0xFE, 0x21, 0xB3, 0x9A, 0xC7, 0x12, 0x0D, 0x07, 0xEB, 0xCF, 0xCB, 0x44, 0x9B, 0xA3, + 0xA1, 0xD9, 0x07, 0x76, 0x1D, 0x93, 0x96, 0x1B, 0x6D, 0xA1, 0x65, 0x6D, 0xB2, 0x62, 0x81, 0x55, + 0xFD, 0xE1, 0x76, 0xF2, 0x6F, 0x9A, 0x71, 0x9F, 0xFC, 0x48, 0x8D, 0x58, 0x1D, 0x3E, 0xFE, 0xBC, + 0x02, 0xB5, 0x36, 0xEE, 0x58, 0x35, 0x82, 0xF3, 0x51, 0x93, 0x35, 0x7E, 0xFA, 0xAF, 0x7E, 0x56, + 0x7E, 0xE8, 0x59, 0x7E, 0x90, 0x73, 0x9B, 0x0E, 0x4D, 0x0D, 0x84, 0x75, 0x30, 0x29, 0xCA, 0xE7, + 0x2C, 0xB3, 0xAC, 0x53, 0x3C, 0xC3, 0x7D, 0x55, 0xCD, 0xE0, 0xB9, 0xF8, 0x44, 0x02, 0xF2, 0x2B, + 0xB7, 0xD1, 0x83, 0x75, 0xDC, 0x96, 0xE7, 0x62, 0x5A, 0x58, 0x63, 0x2D, 0xC1, 0x33, 0xD2, 0x74, + 0x27, 0x05, 0xFD, 0xB7, 0x69, 0x63, 0x34, 0x81, 0xDB, 0xC1, 0x24, 0x10, 0x3A, 0xC2, 0xE2, 0xE9, + 0x75, 0xF8, 0x90, 0x50, 0x3A, 0x3C, 0xAF, 0xCD, 0x4E, 0x78, 0xB0, 0xFA, 0x5F, 0x2C, 0x09, 0x90, + 0xFE, 0xDA, 0xE4, 0x99, 0x8E, 0x3E, 0x63, 0x74, 0x3C, 0x6C, 0xD6, 0xC5, 0x2A, 0x1A, 0xBD, 0x95, + 0xA3, 0xAB, 0xF3, 0xEF, 0x1E, 0x95, 0x02, 0x8E, 0xCB, 0x23, 0xED, 0x11, 0xDB, 0x42, 0x45, 0xD5, + 0x5D, 0xDF, 0xF6, 0xE5, 0x98, 0xB4, 0x46, 0x49, 0x1A, 0xC6, 0x87, 0xFC, 0xA1, 0x79, 0x15, 0xD8, + 0x84, 0x99, 0xFE, 0x0B, 0x33, 0x30, 0x21, 0xA7, 0x59, 0x0A, 0x35, 0xE6, 0x68, 0x62, 0x55, 0x58, + 0xB4, 0x74, 0xDC, 0x80, 0xA4, 0xAD, 0x97, 0x57, 0x08, 0x9D, 0xC9, 0x9C, 0x1C, 0x0E, 0xD6, 0xE5, + 0xE3, 0xC8, 0x13, 0x02, 0xA8, 0xB9, 0x06, 0x27, 0x55, 0x89, 0xE7, 0xA3, 0xBF, 0xB0, 0xA6, 0xD0, + 0x92, 0xAD, 0xDA, 0xFE, 0x9E, 0x38, 0x2B, 0x88, 0x18, 0x7E, 0x3E, 0x90, 0xC3, 0xC0, 0x90, 0xAB, + 0x10, 0x21, 0x49, 0x47, 0xD1, 0x9D, 0x0A, 0xE9, 0x9F, 0xF9, 0xBB, 0x44, 0x83, 0x43, 0xBE, 0xBB, + 0x72, 0xD3, 0x06, 0xB4, 0x1B, 0x11, 0x03, 0xB8, 0xF5, 0xE5, 0x85, 0x1C, 0x4D, 0x7B, 0x0E, 0x65, + 0x33, 0xB0, 0x06, 0xD4, 0x58, 0x1F, 0xC9, 0x52, 0x27, 0xAD, 0xC9, 0xDE, 0x33, 0x4D, 0xC5, 0x45, + 0x6F, 0x11, 0xE1, 0x1D, 0xB9, 0x26, 0xED, 0x5B, 0x9B, 0xF6, 0xFC, 0x87, 0xF7, 0x96, 0x58, 0x5D, + 0xD7, 0x10, 0x15, 0x59, 0x1E, 0x3C, 0xFC, 0xF2, 0x8C, 0x7B, 0xB8, 0x70, 0x35, 0xD2, 0xB3, 0xA2, + 0xF1, 0xE7, 0x9D, 0xC6, 0xAE, 0x37, 0x71, 0xDA, 0x04, 0x32, 0x09, 0x33, 0xF7, 0x7D, 0x45, 0x33, + 0x9F, 0x5C, 0xD6, 0x66, 0xEC, 0x68, 0xCA, 0xEC, 0xBF, 0x4C, 0xF8, 0xA1, 0x4D, 0x5C, 0x41, 0x0E, + 0x69, 0x1F, 0x96, 0xE8, 0xD9, 0x76, 0xB9, 0xEA, 0x04, 0xEF, 0x91, 0xD4, 0xD7, 0x36, 0xEF, 0xE9, + 0xE6, 0x7B, 0x81, 0x31, 0xFD, 0x4E, 0x15, 0x17, 0xF1, 0x25, 0x86, 0x4C, 0x94, 0x2A, 0xAA, 0x50, + 0xB0, 0x98, 0x19, 0xB4, 0x34, 0x81, 0xE2, 0x61, 0xE6, 0xEE, 0x9C, 0x70, 0x72, 0x38, 0xB8, 0xE8, + 0xA6, 0xE1, 0x9F, 0x24, 0xDC, 0xD2, 0x9D, 0xC3, 0x94, 0x43, 0x65, 0x5B, 0x22, 0x45, 0xF2, 0x75, + 0x33, 0x6D, 0xB9, 0x60, 0xC6, 0x9F, 0x0A, 0xC1, 0x1F, 0xFC, 0x8B, 0x7B, 0xAB, 0x71, 0x61, 0xAE, + 0xD2, 0x1B, 0xF6, 0x79, 0x3D, 0x63, 0x1F, 0x4F, 0x1C, 0xDD, 0x4B, 0x50, 0x02, 0x97, 0xCD, 0xF4, + 0xC7, 0x0B, 0xFC, 0xB3, 0xD1, 0x21, 0xD3, 0x73, 0x1B, 0x4B, 0xE8, 0x9F, 0x3D, 0x16, 0x88, 0x0E, + 0x7F, 0xCC, 0x26, 0xA6, 0xF5, 0x8F, 0x69, 0x7F, 0xAC, 0xE8, 0x3F, 0x7B, 0x29, 0x81, 0xDA, 0x14, + 0x8F, 0x98, 0x78, 0x11, 0x34, 0x46, 0x60, 0xAD, 0x9E, 0xB3, 0x69, 0xFD, 0x74, 0x95, 0x3A, 0x14, + 0x30, 0xBE, 0x34, 0xE2, 0xAC, 0x54, 0x81, 0x70, 0x1F, 0x47, 0xD7, 0x5A, 0xDE, 0x81, 0x29, 0x17, + 0x9B, 0x3F, 0xC7, 0x57, 0x56, 0x26, 0xCD, 0xF8, 0x3B, 0x4E, 0x94, 0x4E, 0xA4, 0x09, 0x46, 0x1A, + 0x6D, 0xA3, 0x44, 0x51, 0xA9, 0x9F, 0x97, 0x88, 0x5E, 0x5E, 0x70, 0xCA, 0xDE, 0xA4, 0xAF, 0x6D, + 0xBC, 0xCE, 0xF6, 0x67, 0x81, 0x10, 0xD3, 0xF5, 0xB8, 0xC9, 0x49, 0xF3, 0x98, 0x71, 0x2D, 0x29, + 0xBD, 0x34, 0x08, 0x25, 0x1B, 0x9A, 0x6F, 0xC3, 0x4D, 0xC3, 0x9F, 0x5E, 0xE2, 0xA2, 0xF3, 0x82, + 0x52, 0xA9, 0xF6, 0x79, 0x14, 0x6F, 0xD0, 0x12, 0xB6, 0x0D, 0x4C, 0xAC, 0x3E, 0x2A, 0x8C, 0x86, + 0xE1, 0xFF, 0x1C, 0x49, 0x43, 0xF2, 0x1D, 0x34, 0xA3, 0x0F, 0xA3, 0x9B, 0x2C, 0xF3, 0x9C, 0xFC, + 0x23, 0x4B, 0xE0, 0xCB, 0xE6, 0xBE, 0x7E, 0x8B, 0x51, 0x2D, 0x32, 0x92, 0xCC, 0xC6, 0xDB, 0x36, + 0x1B, 0x83, 0x80, 0x64, 0xD2, 0x23, 0x1C, 0x60, 0x90, 0x1C, 0x71, 0x06, 0x0F, 0x30, 0xC0, 0xDF, + 0xFE, 0xF7, 0x50, 0x5A, 0xF8, 0x9C, 0x97, 0x29, 0xFB, 0x7B, 0xEB, 0x91, 0x6A, 0x42, 0xE4, 0xAB, + 0x62, 0xB4, 0x1F, 0x14, 0xEC, 0x1A, 0x9F, 0xC4, 0x98, 0x77, 0x85, 0x8B, 0xF1, 0x15, 0x2B, 0x2C, + 0x3F, 0xAB, 0x3A, 0x5E, 0xD3, 0x50, 0x32, 0xDD, 0x23, 0x81, 0x89, 0x3B, 0xB8, 0xFD, 0x49, 0x78, + 0xA9, 0x35, 0x20, 0x2D, 0xBC, 0xFC, 0x10, 0x8A, 0x08, 0xA0, 0x57, 0x24, 0xFA, 0x29, 0xD3, 0x9C, + 0xC0, 0xC5, 0x06, 0xF2, 0x7D, 0xC4, 0x45, 0x38, 0x1F, 0xC6, 0xE4, 0xC8, 0x23, 0x65, 0xD2, 0x5A, + 0xE5, 0xCD, 0x63, 0x14, 0x56, 0x03, 0xAA, 0x29, 0x82, 0xAB, 0x67, 0x92, 0x2C, 0x71, 0x67, 0x6A, + 0x36, 0xF9, 0xE1, 0x89, 0xD2, 0x98, 0x88, 0x97, 0x65, 0x72, 0xE4, 0x3C, 0x5A, 0x1D, 0xB7, 0x34, + 0x4D, 0x01, 0x91, 0x5D, 0xC4, 0xAF, 0x88, 0x2F, 0xD1, 0x27, 0x26, 0x36, 0x16, 0x98, 0x39, 0x9A, + 0xEA, 0xFA, 0xDF, 0x3B, 0x7F, 0xD8, 0x76, 0x95, 0xDB, 0x03, 0x82, 0x86, 0xD0, 0x6D, 0x15, 0xD0, + 0xF0, 0xB9, 0xCC, 0xB9, 0xD6, 0xE1, 0x9C, 0xC7, 0xAE, 0x3C, 0xA8, 0xB9, 0x49, 0xA3, 0xC4, 0xB3, + 0x24, 0x3A, 0xA3, 0x50, 0x7E, 0xDF, 0xBE, 0x5F, 0xAF, 0xC3, 0x7C, 0x3C, 0xC7, 0x39, 0xD9, 0x29, + 0x06, 0xD5, 0x0B, 0xE8, 0xFA, 0x80, 0xC2, 0xCE, 0xA8, 0xD9, 0x20, 0xCE, 0x28, 0x0A, 0xDE, 0x15, + 0xB5, 0x0D, 0x9A, 0xB8, 0xB0, 0x7B, 0x33, 0xB8, 0x35, 0xEB, 0x4E, 0xDE, 0xF5, 0x9F, 0x66, 0x79, + 0x52, 0x44, 0xD2, 0x49, 0x3A, 0x94, 0xE2, 0xCB, 0x83, 0x22, 0x7D, 0xC6, 0x1C, 0xEB, 0x44, 0x28, + 0xE9, 0x38, 0x8F, 0xB7, 0xF6, 0x3D, 0x39, 0x8F, 0x64, 0x9F, 0x86, 0x85, 0x27, 0x7E, 0xBF, 0xD8, + 0xC3, 0x8B, 0x70, 0xF9, 0x7A, 0xE6, 0x19, 0xAF, 0xA8, 0x8F, 0x6C, 0x38, 0xE2, 0xB4, 0x1E, 0xF3, + 0xDD, 0xFD, 0x6C, 0xB4, 0x04, 0xB4, 0xD1, 0x37, 0xF4, 0x59, 0xFF, 0x5A, 0x8B, 0x73, 0x6B, 0x62, + 0x6C, 0x91, 0x23, 0x96, 0x61, 0xEC, 0x9F, 0xF6, 0x83, 0x18, 0xD9, 0xEE, 0xEF, 0x00, 0xB0, 0xEB, + 0x8D, 0xC6, 0x35, 0xCE, 0xB4, 0xE0, 0xBB, 0x84, 0xD3, 0xD7, 0xDB, 0x77, 0x4A, 0x07, 0xE7, 0x3B, + 0xF7, 0x12, 0xF8, 0x9D, 0xF5, 0x0A, 0xDF, 0xF4, 0x1B, 0x00, 0x1A, 0x77, 0xD9, 0x03, 0x21, 0xC2, + 0x46, 0xF7, 0x7E, 0x4B, 0xE2, 0xC1, 0xF1, 0x8D, 0xFE, 0x61, 0xB9, 0xD4, 0x0B, 0xC9, 0x65, 0x82, + 0xCF, 0x7F, 0x3D, 0x24, 0x9E, 0xC9, 0x97, 0x30, 0xE9, 0x81, 0xB4, 0x6B, 0xA5, 0x6A, 0xA7, 0xED, + 0xE3, 0x8F, 0x88, 0x09, 0x78, 0x36, 0x6A, 0x14, 0xB9, 0xBB, 0x93, 0xE6, 0xA2, 0x07, 0x72, 0x81, + 0xD2, 0x41, 0x75, 0x28, 0x50, 0x57, 0xDE, 0x68, 0x04, 0xB1, 0x0F, 0x1F, 0xCF, 0x0F, 0x3E, 0xCB, + 0x44, 0x3D, 0x2A, 0x01, 0xC1, 0x38, 0x61, 0x8E, 0xA1, 0x13, 0xB8, 0x82, 0x3F, 0xAC, 0xA7, 0x31, + 0x7B, 0xF7, 0xA7, 0xCD, 0xBF, 0x15, 0xD3, 0xC2, 0xCC, 0xDC, 0xD0, 0xB2, 0xC1, 0x44, 0xBA, 0x82, + 0x85, 0x2D, 0x59, 0x53, 0xE4, 0xBE, 0x6B, 0x69, 0x8F, 0x5C, 0x20, 0x38, 0x76, 0xE0, 0x49, 0x59, + 0x32, 0x0A, 0x90, 0x42, 0x13, 0x35, 0x24, 0x71, 0xD9, 0x98, 0x9A, 0x0F, 0x0A, 0x83, 0x90, 0x47, + 0xD0, 0x57, 0x29, 0xC8, 0xF5, 0x5B, 0xA8, 0x5D, 0x41, 0xCD, 0x61, 0x98, 0x5C, 0x28, 0x1B, 0xF2, + 0x9B, 0x31, 0x3F, 0x14, 0x79, 0x37, 0xEA, 0xDD, 0x42, 0xD3, 0x59, 0x20, 0x0D, 0x5A, 0x3D, 0x59, + 0x84, 0x1A, 0x48, 0x28, 0x6D, 0x48, 0x3B, 0x0C, 0x87, 0xB0, 0xBB, 0xEF, 0x72, 0x91, 0x85, 0xE0, + 0x9A, 0x2C, 0x78, 0xAF, 0xFE, 0x0D, 0x6D, 0x9A, 0x99, 0x10, 0x16, 0x7D, 0x42, 0x76, 0xA0, 0xAA, + 0xC7, 0xF9, 0x11, 0x5C, 0x04, 0x83, 0x0A, 0xA9, 0x48, 0x65, 0x28, 0x81, 0x65, 0x2E, 0xA7, 0x5A, + 0xFE, 0xDB, 0x10, 0x56, 0xEA, 0x19, 0x67, 0xC2, 0x61, 0xBB, 0x9B, 0x6B, 0x48, 0x4F, 0x22, 0x4C, + 0xB7, 0xEC, 0x15, 0x84, 0x08, 0x1A, 0xFE, 0x08, 0x46, 0xCA, 0x72, 0x10, 0x30, 0x81, 0xAE, 0xE7, + 0x1B, 0xAA, 0x2F, 0x1B, 0x22, 0x6A, 0x89, 0x95, 0x34, 0x9F, 0x53, 0xE4, 0xDA, 0x0B, 0x1B, 0x56, + 0xB4, 0xB7, 0x71, 0x99, 0xB8, 0x77, 0x91, 0xEB, 0x59, 0x61, 0x71, 0x84, 0xAF, 0x55, 0xBD, 0x33, + 0x1C, 0xD9, 0x7A, 0x40, 0xD3, 0x7B, 0x6C, 0xB0, 0xA4, 0x96, 0x07, 0x57, 0x49, 0x9C, 0xC1, 0x0B, + 0x23, 0xF3, 0xE5, 0x36, 0xA4, 0xE8, 0xE1, 0xEC, 0x51, 0xF1, 0xBB, 0x7B, 0x40, 0x4B, 0x05, 0xD1, + 0x3D, 0xD6, 0x6D, 0x22, 0x7C, 0x9D, 0x51, 0x28, 0x70, 0xF6, 0xB3, 0x0C, 0x6F, 0xB2, 0xE1, 0xBC, + 0xFF, 0xB8, 0xA3, 0x92, 0x7C, 0x0A, 0xA3, 0x36, 0x6D, 0xF8, 0xFC, 0x27, 0x45, 0x58, 0x94, 0xE0, + 0x0A, 0x90, 0xF8, 0x2A, 0xF3, 0x02, 0xA4, 0x98, 0xD8, 0xEF, 0x1C, 0x53, 0xE2, 0x47, 0xC7, 0x20, + 0xB2, 0x6F, 0xB7, 0x39, 0x5A, 0xA9, 0x49, 0xC2, 0x65, 0x18, 0x50, 0xBD, 0x7F, 0xB0, 0xDE, 0xBB, + 0x2F, 0x56, 0xDD, 0x62, 0x85, 0xAC, 0x3B, 0x7E, 0xCD, 0x00, 0x88, 0x7A, 0x22, 0xC5, 0x03, 0x03, + 0x26, 0xC4, 0x27, 0x09, 0xE8, 0x16, 0x36, 0xB7, 0x0B, 0xDF, 0xDA, 0x21, 0xEB, 0x59, 0xE8, 0x6D, + 0x96, 0x2D, 0x18, 0x89, 0xD4, 0x4E, 0x5A, 0x66, 0x63, 0x31, 0x15, 0xF0, 0x48, 0x50, 0x7A, 0xF3, + 0xA7, 0x82, 0xE0, 0x91, 0x04, 0xB2, 0x16, 0xAC, 0xA1, 0xD4, 0xC1, 0xE4, 0xBD, 0xC9, 0x43, 0x83, + 0xD9, 0x18, 0x11, 0x50, 0xC0, 0x93, 0x9D, 0x6B, 0x17, 0x63, 0xC8, 0xA3, 0xAF, 0xAC, 0xBF, 0x29, + 0x65, 0xA6, 0x4A, 0xE4, 0xCD, 0xE2, 0x89, 0x59, 0xF8, 0x96, 0xF8, 0x3B, 0x80, 0xCA, 0x68, 0xF2, + 0xBF, 0xBE, 0xFD, 0xD0, 0x84, 0x88, 0xE3, 0x3D, 0x08, 0x8A, 0x08, 0x39, 0xDC, 0x88, 0x71, 0x61, + 0x76, 0xAD, 0xB6, 0xBE, 0xC0, 0xA4, 0x28, 0xEE, 0x38, 0x8F, 0x2E, 0x8D, 0x3A, 0x28, 0xAE, 0xEB, + 0x93, 0x7E, 0xF4, 0x2E, 0x5F, 0x3B, 0xEA, 0x37, 0x9A, 0x53, 0x6C, 0xC5, 0x3A, 0x2F, 0x7F, 0xA9, + 0x80, 0x85, 0x18, 0xFE, 0x14, 0x0C, 0x37, 0xA7, 0xE2, 0x78, 0x90, 0x20, 0x1F, 0x41, 0x1C, 0x03, + 0xD1, 0xD0, 0x8C, 0xB2, 0x2D, 0x4C, 0x32, 0x81, 0x63, 0xF6, 0x6F, 0xD3, 0x7F, 0xB4, 0x6D, 0xA8, + 0xD6, 0xE0, 0x56, 0x84, 0xAD, 0x37, 0x96, 0x44, 0xB4, 0xAE, 0x6F, 0x49, 0x3E, 0x30, 0x0C, 0x79, + 0xE3, 0x93, 0xBA, 0xD2, 0x10, 0x71, 0xAC, 0x7C, 0x06, 0x89, 0x26, 0xCB, 0x72, 0x9E, 0xC4, 0xCC, + 0xBB, 0xA1, 0xDE, 0x9B, 0x66, 0x75, 0x6F, 0xAC, 0x51, 0x93, 0xE8, 0xF4, 0x43, 0xE4, 0x79, 0xF2, + 0x50, 0x67, 0x3D, 0x1B, 0x33, 0xB5, 0xEC, 0x93, 0x10, 0xCE, 0x78, 0x3C, 0x0C, 0x25, 0x44, 0x30, + 0x3C, 0xAB, 0x40, 0x6F, 0x4B, 0x54, 0x0C, 0x38, 0xD4, 0xEF, 0x18, 0xED, 0xA5, 0x75, 0x1E, 0x9C, + 0x06, 0x42, 0x11, 0x9D, 0xEC, 0xE8, 0x81, 0x38, 0xBE, 0xEF, 0x21, 0xB5, 0x0A, 0xC3, 0x38, 0x94, + 0x0C, 0x5A, 0xE2, 0x47, 0xDC, 0x2E, 0x82, 0xC3, 0xA6, 0x9D, 0xA6, 0x54, 0x5E, 0xE6, 0x7C, 0xFE, + 0x7E, 0x7B, 0x86, 0x9A, 0x54, 0xEC, 0xCD, 0xE5, 0x9F, 0xF7, 0x23, 0xDE, 0x06, 0x90, 0x93, 0xB6, + 0xCC, 0xC8, 0x3D, 0x75, 0xA6, 0x43, 0xEA, 0x1F, 0x44, 0xAB, 0xBB, 0x15, 0xC4, 0xAB, 0xB1, 0xDF, + 0xE9, 0x30, 0xB4, 0xB2, 0x3B, 0x5B, 0xA6, 0x57, 0xEE, 0x25, 0x4B, 0x83, 0x26, 0xE4, 0x6B, 0xE3, + 0x35, 0x62, 0xA5, 0xD2, 0xB6, 0xDE, 0xFD, 0x5F, 0x8C, 0x21, 0xF8, 0x15, 0x41, 0x1C, 0x61, 0xCD, + 0x78, 0x0F, 0x61, 0x9E, 0x0C, 0x7E, 0x88, 0xE3, 0x34, 0x7F, 0x0B, 0x00, 0x5D, 0x8A, 0x37, 0x5F, + 0xFB, 0x65, 0xB8, 0xEC, 0x6C, 0x6A, 0x7E, 0x8F, 0x70, 0x6A, 0x17, 0xFB, 0x6B, 0x9D, 0xD8, 0xC3, + 0xD5, 0x13, 0x49, 0xEC, 0xD0, 0xEC, 0x1B, 0xC7, 0x79, 0xBB, 0xD2, 0x89, 0x96, 0x39, 0x1C, 0xF3, + 0x70, 0xEA, 0xF0, 0xEA, 0x6B, 0x45, 0x51, 0xDB, 0x1A, 0x61, 0x60, 0x98, 0x1C, 0x7A, 0xA6, 0x48, + 0x65, 0xDA, 0x85, 0xBE, 0x6B, 0xC4, 0x27, 0x2F, 0x76, 0x6D, 0x5F, 0x4C, 0xDE, 0x92, 0xA1, 0xB3, + 0xD4, 0x11, 0xB4, 0x0B, 0x3A, 0x4C, 0x73, 0xC3, 0xAA, 0x9C, 0x0F, 0x95, 0x9B, 0x2C, 0x67, 0x02, + 0x47, 0xCD, 0xE3, 0x75, 0x84, 0x60, 0x5E, 0x17, 0xAB, 0xF0, 0xBC, 0xBE, 0xB4, 0xAA, 0x4C, 0xEA, + 0x11, 0x52, 0x87, 0xAC, 0x16, 0x56, 0x06, 0x1F, 0xC1, 0x97, 0xF9, 0xAB, 0x26, 0xD9, 0xCC, 0x58, + 0x01, 0xFF, 0x44, 0x21, 0xFE, 0x5D, 0x53, 0x0B, 0xA2, 0xAF, 0xBC, 0x9D, 0x63, 0x25, 0x87, 0x66, + 0xB3, 0x79, 0xB4, 0x9F, 0x49, 0xE6, 0x6E, 0xCB, 0x8B, 0x39, 0x8C, 0x46, 0x60, 0x3D, 0x5B, 0xEC, + 0x08, 0x1B, 0xB2, 0xEC, 0xA2, 0xAA, 0x9A, 0xDA, 0xAA, 0xAD, 0x25, 0xAB, 0x45, 0x99, 0x63, 0x23, + 0x6C, 0x53, 0x87, 0xA0, 0x5A, 0x6C, 0xD6, 0xE3, 0x6C, 0x34, 0x42, 0x0F, 0xF3, 0xA0, 0x23, 0xD3, + 0x16, 0x05, 0xAB, 0x05, 0x14, 0xA8, 0xA9, 0x02, 0x23, 0xFC, 0xC0, 0xED, 0x75, 0xC5, 0x43, 0x7C, + 0x1E, 0xB1, 0x69, 0xB6, 0x01, 0x96, 0x7B, 0x9E, 0x12, 0x1C, 0x72, 0x42, 0x0D, 0xAB, 0x0B, 0x79, + 0x22, 0xF3, 0xF0, 0xEB, 0x71, 0x83, 0x42, 0x3C, 0x11, 0xC7, 0x4F, 0x87, 0xFF, 0x5D, 0x19, 0x0B, + 0xE4, 0x1E, 0xC3, 0xA2, 0xD7, 0x0E, 0x9C, 0x3C, 0x7D, 0xFB, 0x4F, 0xDA, 0x99, 0x9F, 0xF8, 0x3E, + 0xD4, 0xA0, 0xA2, 0xF8, 0x83, 0x33, 0x1E, 0xE2, 0x1C, 0x52, 0x9D, 0xB8, 0x63, 0x8F, 0xA1, 0x4D, + 0x68, 0xAE, 0xCE, 0xD4, 0x12, 0x8E, 0x96, 0xA1, 0x78, 0x27, 0x6A, 0x29, 0x11, 0x19, 0x4C, 0x94, + 0x89, 0x0F, 0xFB, 0x7C, 0xA8, 0xAC, 0x7E, 0x84, 0x44, 0xC8, 0x7A, 0x18, 0xAE, 0x34, 0x0F, 0x6E, + 0x90, 0xDB, 0x1E, 0x79, 0xFA, 0xE8, 0xAF, 0x71, 0xE4, 0x80, 0x24, 0x53, 0x2F, 0xB6, 0xC2, 0x12, + 0x1F, 0xA0, 0x44, 0x98, 0x40, 0xAE, 0x01, 0xD6, 0xFB, 0x86, 0xBB, 0xC6, 0xF7, 0x2F, 0x38, 0x41, + 0xE3, 0x2E, 0x1F, 0x2E, 0x7C, 0x90, 0x1F, 0xD9, 0xD3, 0x34, 0x86, 0xC8, 0xA3, 0x8E, 0xAB, 0x5E, + 0x05, 0x55, 0x71, 0x5B, 0x21, 0xB7, 0x2F, 0x9E, 0x56, 0x32, 0x56, 0xD1, 0xDC, 0xC9, 0xDA, 0xDE, + 0xAC, 0x1D, 0x91, 0x0E, 0x4D, 0x1F, 0x4F, 0xE7, 0x31, 0xFE, 0x9A, 0x3F, 0x18, 0xAD, 0x85, 0x4E, + 0x66, 0x95, 0x76, 0x67, 0x6A, 0xC8, 0x90, 0x6A, 0xB5, 0xB0, 0x7D, 0xB2, 0xB3, 0xD7, 0xD6, 0x42, + 0xF1, 0x63, 0x52, 0xBD, 0x72, 0xE1, 0xD2, 0x63, 0x9A, 0x00, 0x45, 0x8E, 0x77, 0xCF, 0x93, 0xCF, + 0x1A, 0x31, 0xAA, 0x16, 0xA9, 0xCF, 0x45, 0xE3, 0x99, 0x3E, 0x6C, 0x70, 0xE9, 0x93, 0x83, 0x78, + 0x11, 0xB8, 0x80, 0xEA, 0x75, 0x5A, 0x87, 0xCE, 0x1D, 0xCD, 0x12, 0x5F, 0x1F, 0x6F, 0x86, 0x25, + 0x5E, 0x95, 0x22, 0x07, 0xFE, 0x29, 0xDA, 0x93, 0x52, 0x41, 0x62, 0x79, 0x06, 0x06, 0x83, 0xAE, + 0x42, 0x35, 0x5C, 0x9E, 0x01, 0xF8, 0xFA, 0x3F, 0x07, 0x15, 0xCA, 0x02, 0x69, 0x8E, 0xEA, 0x9E, + 0xEF, 0xF4, 0x99, 0x26, 0x73, 0x42, 0xC2, 0xEC, 0x0F, 0xEC, 0x03, 0x8F, 0x66, 0xC1, 0x88, 0x76, + 0xC5, 0xC2, 0x55, 0x46, 0x59, 0xC4, 0x28, 0x55, 0x93, 0xBF, 0x7C, 0x1C, 0x5C, 0xA0, 0xBA, 0x8A, + 0xCA, 0x8A, 0x81, 0x6C, 0xA3, 0xDE, 0x2D, 0x63, 0xC5, 0xCA, 0x0B, 0x8E, 0x99, 0xC9, 0xE4, 0x7E, + 0x32, 0x36, 0xD8, 0xFA, 0x80, 0xA5, 0x93, 0x4F, 0x5C, 0x97, 0x33, 0x74, 0xD2, 0x03, 0xFF, 0xFD, + 0x57, 0x84, 0x26, 0x62, 0x6A, 0x4C, 0x15, 0x45, 0xB9, 0x7C, 0xCD, 0xD8, 0x7B, 0xC5, 0x70, 0xA1, + 0xCB, 0xB4, 0xDE, 0xA6, 0xBD, 0xE0, 0xE9, 0x49, 0xB7, 0xEA, 0x21, 0x17, 0xCD, 0x0C, 0xA7, 0xF2, + 0x9B, 0xB6, 0x26, 0x06, 0xB1, 0x63, 0x3D, 0x0D, 0x1A, 0xAE, 0x57, 0xF1, 0x53, 0xDA, 0x61, 0x47, + 0x7E, 0x66, 0xC0, 0x2A, 0xAC, 0x7E, 0xE8, 0xE9, 0x4F, 0xC2, 0x21, 0x01, 0x0B, 0x9C, 0xA7, 0x98, + 0x05, 0x3A, 0x34, 0x68, 0x19, 0x26, 0x35, 0x57, 0xF7, 0xF8, 0xE0, 0x77, 0x7B, 0x42, 0x8D, 0xE0, + 0xD3, 0x08, 0x49, 0x62, 0x1D, 0x86, 0xBE, 0xC8, 0xDC, 0x2F, 0xE0, 0xFF, 0xC4, 0x6E, 0xBD, 0xEC, + 0x8B, 0x33, 0xF1, 0x61, 0x6E, 0x96, 0xEB, 0xEA, 0x87, 0x4C, 0xA3, 0x5F, 0x97, 0x92, 0x22, 0x0C, + 0x36, 0x05, 0xA5, 0xC1, 0xF6, 0xB8, 0xF5, 0xE0, 0xE4, 0x91, 0x73, 0x73, 0xD0, 0x38, 0x81, 0x24, + 0x13, 0xB4, 0x4B, 0xAB, 0x4C, 0xBB, 0x15, 0x56, 0xC2, 0x66, 0xF9, 0x27, 0xEF, 0xE0, 0x3D, 0x4E, + 0xDB, 0x12, 0xCB, 0xC1, 0xDE, 0x57, 0x1B, 0x7F, 0x69, 0x10, 0xE4, 0x6E, 0xF7, 0xCC, 0x0F, 0x64, + 0x31, 0x6A, 0xBF, 0x49, 0x6C, 0xF8, 0x9E, 0xC9, 0x37, 0xF9, 0x26, 0x32, 0x4A, 0x26, 0x97, 0x99, + 0x30, 0xA6, 0x86, 0x82, 0xCE, 0x04, 0x8B, 0xFB, 0x39, 0x3B, 0xEF, 0x05, 0xAE, 0x3F, 0xFD, 0xEA, + 0x21, 0xA7, 0xF9, 0xD8, 0x2D, 0x34, 0x42, 0xE4, 0xDC, 0x40, 0x1C, 0x82, 0x94, 0x89, 0xC4, 0x74, + 0x0C, 0xF6, 0x76, 0x65, 0x13, 0x29, 0x85, 0xE7, 0xF6, 0x8C, 0x19, 0x3D, 0xC2, 0x69, 0x79, 0x07, + 0x8C, 0x47, 0x24, 0x24, 0x4C, 0xD6, 0x41, 0x93, 0x70, 0x40, 0x08, 0x6D, 0x49, 0x4D, 0x92, 0xAA, + 0x9D, 0x02, 0xAB, 0x53, 0x8D, 0x8C, 0x96, 0x75, 0x54, 0xD0, 0xA2, 0x45, 0xBA, 0x19, 0x81, 0xFE, + 0x20, 0xCC, 0x93, 0x78, 0x4D, 0xBB, 0xA2, 0x21, 0xAB, 0xB5, 0x1B, 0x47, 0x0C, 0xA2, 0x34, 0x24, + 0x1E, 0xF3, 0x40, 0xF3, 0xC8, 0x79, 0xAE, 0x00, 0x40, 0xC3, 0xC4, 0x1B, 0x41, 0x5E, 0xF4, 0x08, + 0x7D, 0x15, 0xF1, 0xDF, 0xE2, 0x34, 0x78, 0xC3, 0x2A, 0x91, 0x8D, 0xC1, 0xA7, 0xF4, 0xD0, 0xF9, + 0xE7, 0x4E, 0x9F, 0xDC, 0x56, 0x16, 0x6C, 0x5B, 0x48, 0x10, 0x7E, 0xE9, 0xA6, 0x3F, 0x3B, 0xD0, + 0xFD, 0x12, 0x46, 0x1B, 0xFF, 0x61, 0x76, 0x61, 0xCC, 0x24, 0x1C, 0x94, 0xDF, 0x77, 0x6F, 0xAE, + 0x8E, 0xEE, 0x96, 0xF6, 0x9B, 0xB4, 0xE9, 0xA5, 0x1E, 0x6D, 0x7C, 0x2C, 0x43, 0xFB, 0x74, 0xF3, + 0x23, 0x86, 0xE6, 0x07, 0xC7, 0x36, 0xE3, 0xED, 0xAF, 0xDD, 0x75, 0x61, 0xCD, 0xFE, 0xEE, 0x4B, + 0x82, 0xF7, 0xC7, 0x66, 0x2B, 0x4C, 0xFF, 0x97, 0x77, 0x1A, 0xF5, 0xA5, 0x55, 0xF2, 0xBD, 0xC0, + 0xD4, 0xD8, 0x07, 0x2A, 0x92, 0xB0, 0x04, 0x56, 0x55, 0x3F, 0x1B, 0xCA, 0x21, 0x25, 0x3F, 0xB9, + 0x81, 0x01, 0x94, 0x43, 0xEE, 0x83, 0xD5, 0x10, 0xB4, 0x13, 0x19, 0xC0, 0x06, 0xBA, 0xEF, 0xA3, + 0xE4, 0xEC, 0xD8, 0x66, 0x30, 0x58, 0xA2, 0xE7, 0x81, 0x65, 0xDA, 0xA1, 0x35, 0x28, 0x4B, 0x47, + 0x17, 0x95, 0xA3, 0x8C, 0x67, 0x44, 0xC8, 0x8B, 0x1B, 0x5F, 0xE9, 0x0E, 0x99, 0xA3, 0x39, 0xAF, + 0x5C, 0xCA, 0x0D, 0x68, 0xAD, 0xE0, 0x91, 0xF3, 0x95, 0x54, 0x02, 0xFF, 0xC4, 0x23, 0xA1, 0x2E, + 0xCE, 0xD2, 0xFC, 0x34, 0x5A, 0xF0, 0x83, 0x82, 0x54, 0x07, 0xDE, 0x21, 0x0D, 0xE3, 0xDF, 0x86, + 0xC1, 0x6E, 0xAB, 0x95, 0x28, 0x90, 0xED, 0x3B, 0x93, 0x95, 0x9E, 0xDE, 0xBA, 0x3E, 0x32, 0x85, + 0x0F, 0xB9, 0x62, 0x68, 0x00, 0x93, 0x38, 0xF9, 0x6B, 0x36, 0x5E, 0xAB, 0x9F, 0xDD, 0x84, 0x97, + 0xB8, 0xAB, 0xDA, 0x29, 0x88, 0xEC, 0x9D, 0xFA, 0xAA, 0x34, 0x2B, 0x1E, 0xC0, 0x6C, 0x53, 0xD4, + 0x55, 0x40, 0x45, 0x9F, 0xEC, 0x0A, 0x90, 0x51, 0xC5, 0x7A, 0x8A, 0xF6, 0xEE, 0x62, 0xC2, 0xE9, + 0x57, 0x2A, 0x1D, 0x8F, 0xB6, 0x83, 0xF9, 0x44, 0x42, 0x33, 0x2A, 0x3D, 0xC7, 0x46, 0xDA, 0xCA, + 0xBC, 0x6B, 0x49, 0x7F, 0x94, 0xB0, 0x6C, 0x80, 0xEC, 0x76, 0x96, 0x12, 0xB9, 0x05, 0x47, 0x96, + 0x84, 0x98, 0xCF, 0x8F, 0x21, 0xF5, 0x6B, 0x86, 0xB8, 0xD4, 0x80, 0xBA, 0xEA, 0x3C, 0xF6, 0x7A, + 0x98, 0xE9, 0x1A, 0x5E, 0x2C, 0x69, 0x1A, 0x2A, 0x31, 0xB9, 0xE6, 0x28, 0xA3, 0xCA, 0xC2, 0x70, + 0xDB, 0xF0, 0x30, 0x28, 0xD3, 0xD6, 0x17, 0xAD, 0x73, 0x8D, 0xB3, 0xF5, 0xFD, 0xA3, 0x6D, 0x8A, + 0xAE, 0x7A, 0x69, 0xD7, 0x6E, 0x4C, 0x29, 0x44, 0xBD, 0x57, 0xBA, 0xC9, 0xFD, 0xA1, 0xEF, 0xA9, + 0xA0, 0x98, 0x39, 0x7A, 0x05, 0x61, 0x46, 0x55, 0x77, 0x5C, 0x1A, 0x39, 0x38, 0x98, 0xFA, 0x79, + 0x9A, 0xBC, 0x68, 0xDB, 0x29, 0x51, 0xDD, 0x2C, 0xEC, 0xFA, 0x61, 0x93, 0x93, 0x44, 0xF2, 0x7E, + 0xD7, 0xA2, 0x79, 0xF1, 0xBD, 0x19, 0x81, 0x36, 0x04, 0x3A, 0x26, 0x20, 0x07, 0x3E, 0x01, 0x8E, + 0x16, 0xE0, 0x6F, 0xF6, 0x29, 0xB8, 0x0B, 0xAC, 0x37, 0x19, 0x39, 0x91, 0x09, 0x23, 0xA6, 0x9C, + 0xAD, 0x08, 0x70, 0xA8, 0x66, 0x0A, 0x22, 0xA2, 0x2E, 0xC5, 0xB9, 0x7F, 0x58, 0xC0, 0x2F, 0x07, + 0x61, 0xB9, 0x2D, 0x3F, 0xA9, 0xB1, 0x67, 0x52, 0xC1, 0x1C, 0x2C, 0xB4, 0xFC, 0x02, 0xA8, 0x4F, + 0x71, 0x87, 0x7F, 0x42, 0x35, 0x93, 0x25, 0xF5, 0x81, 0x07, 0xF9, 0x75, 0x01, 0xBE, 0x08, 0x15, + 0xC5, 0xD1, 0xED, 0x91, 0xB6, 0x0B, 0xC8, 0x8B, 0x4D, 0x62, 0x54, 0xD7, 0x14, 0x9C, 0x3E, 0xEA, + 0x15, 0x3E, 0x91, 0x4F, 0x2F, 0xB5, 0x5C, 0x5A, 0x13, 0x6D, 0x24, 0xE5, 0xB1, 0xA2, 0xFC, 0xAF, + 0x5F, 0x85, 0x13, 0x52, 0x9F, 0x80, 0x19, 0xBB, 0xB7, 0x9A, 0xC6, 0x92, 0x49, 0x2D, 0x28, 0xA7, + 0xA2, 0x28, 0xFA, 0x4A, 0x7B, 0xBA, 0x99, 0x15, 0xA9, 0xF3, 0x51, 0xED, 0xA5, 0xD7, 0x9A, 0xC1, + 0x7A, 0x1E, 0x77, 0x57, 0xBB, 0xA7, 0x25, 0x10, 0xE9, 0x69, 0xAC, 0x50, 0xEF, 0xEC, 0x85, 0x02, + 0x52, 0xC9, 0x29, 0xE9, 0xCB, 0xC8, 0xD0, 0x2D, 0x43, 0xAD, 0x26, 0x93, 0xA8, 0x12, 0xE3, 0xEB, + 0xB1, 0x1E, 0xA2, 0x8D, 0xE4, 0xF7, 0x8F, 0x4B, 0x55, 0xE7, 0xD7, 0x98, 0x3B, 0x7B, 0x85, 0x16, + 0xEE, 0x5A, 0xD8, 0x61, 0x65, 0x57, 0xBC, 0x74, 0x62, 0xD3, 0xDC, 0x7C, 0x6D, 0xCC, 0x56, 0xB0, + 0x3B, 0xA7, 0xE9, 0x10, 0xDE, 0x6A, 0xF4, 0x3A, 0xEC, 0x7E, 0x2E, 0xD0, 0x1E, 0x81, 0x48, 0xD3, + 0xEC, 0xD7, 0xC5, 0xDB, 0x16, 0xBD, 0xD5, 0x5B, 0xAD, 0x8E, 0x13, 0x5A, 0x2A, 0x9E, 0x1A, 0x96, + 0xC3, 0x7E, 0x23, 0xAD, 0xA7, 0x45, 0xE0, 0xCE, 0xA4, 0x52, 0x0C, 0x2A, 0x2E, 0x84, 0x9D, 0xB3, + 0xB4, 0x21, 0x18, 0xA7, 0xCF, 0x57, 0xA3, 0xFE, 0xA1, 0x27, 0x99, 0xCE, 0x48, 0x1E, 0xA7, 0xDB, + 0x62, 0x13, 0x9B, 0x19, 0xE3, 0xBF, 0xAA, 0xA2, 0x9D, 0x29, 0xC9, 0x92, 0xD1, 0x5A, 0x43, 0x4E, + 0xC4, 0xF8, 0xB4, 0xD9, 0xFC, 0xBD, 0x1A, 0xBB, 0x4D, 0x23, 0x99, 0xF3, 0x86, 0xE6, 0xBC, 0xB7, + 0x03, 0xE1, 0xA9, 0xD7, 0xDF, 0x5C, 0x15, 0x56, 0xB4, 0x63, 0xC2, 0x71, 0x6D, 0x15, 0xF1, 0x85, + 0xB6, 0xFF, 0x85, 0x4B, 0x6C, 0x36, 0xDB, 0xA8, 0x07, 0x22, 0x92, 0x4F, 0xD5, 0xA3, 0x2B, 0x40, + 0x8F, 0x6D, 0x89, 0xE3, 0x3E, 0xA2, 0x40, 0xAE, 0x80, 0xA5, 0x3A, 0xD2, 0x5D, 0x7E, 0x74, 0x6A, + 0x94, 0xED, 0xA3, 0xF2, 0x4C, 0x2E, 0x57, 0xF2, 0xBE, 0x8B, 0x25, 0xEF, 0x87, 0x0C, 0x05, 0x99, + 0x27, 0x5E, 0xA5, 0xDE, 0xAE, 0x94, 0x49, 0xFD, 0x7A, 0x62, 0xA7, 0x74, 0x58, 0x8A, 0x1A, 0xED, + 0x15, 0x23, 0x1D, 0x83, 0xD7, 0xA4, 0x6B, 0x4F, 0x3F, 0x9C, 0xBB, 0x5B, 0x27, 0xAD, 0x5C, 0x7E, + 0xA2, 0xE0, 0xBF, 0x39, 0x0C, 0x73, 0xB1, 0x48, 0x07, 0xC1, 0x3B, 0xD5, 0xA6, 0x2D, 0x94, 0x20, + 0x6D, 0xE6, 0x91, 0xAD, 0xCC, 0xDE, 0x4A, 0x3C, 0x4C, 0x02, 0x92, 0xCD, 0x41, 0x46, 0x3C, 0x88, + 0x5A, 0xB6, 0xF6, 0x8F, 0x85, 0x05, 0x7E, 0x75, 0xAC, 0x92, 0x92, 0x99, 0xF4, 0x36, 0x21, 0xE9, + 0x0D, 0x19, 0x02, 0xA1, 0xF0, 0xF1, 0xDB, 0xD8, 0x8F, 0x48, 0x11, 0x5D, 0x84, 0x80, 0x24, 0xD8, + 0xEE, 0x57, 0xB2, 0x3A, 0xE6, 0x0E, 0xC5, 0xA1, 0x26, 0xF9, 0x0C, 0x2E, 0x6C, 0x3A, 0x7A, 0x8B, + 0x0B, 0x9B, 0x3D, 0x2E, 0xAF, 0x26, 0x7D, 0x02, 0x63, 0xC8, 0x0D, 0x24, 0x7D, 0x36, 0x19, 0xAB, + 0xAC, 0xA9, 0x10, 0xA0, 0x53, 0x25, 0x4C, 0xC7, 0x4C, 0x28, 0x4A, 0xC3, 0x38, 0x92, 0xE2, 0x3D, + 0xF3, 0xE1, 0x93, 0xDE, 0x3E, 0x77, 0xAC, 0xEF, 0x6A, 0x08, 0x44, 0xE8, 0x20, 0x18, 0xA3, 0xA0, + 0x90, 0x56, 0xDD, 0xAB, 0x77, 0x7D, 0x36, 0xC2, 0x91, 0xB5, 0x44, 0x8C, 0xD4, 0x57, 0x2C, 0x81, + 0xA1, 0xB9, 0xD9, 0x59, 0x50, 0x8A, 0x76, 0x88, 0x5A, 0x5E, 0x45, 0x99, 0xAC, 0x8C, 0x40, 0x14, + 0x46, 0x28, 0x77, 0xED, 0x1C, 0x7C, 0x59, 0x36, 0x83, 0x4A, 0xA7, 0x0A, 0x71, 0x9C, 0x3B, 0x02, + 0x43, 0x50, 0x74, 0x85, 0xE3, 0xD4, 0x0A, 0x3B, 0x1B, 0xE2, 0xD7, 0x1F, 0x79, 0x78, 0x4B, 0x00, + 0x8E, 0x0A, 0x99, 0xDF, 0x14, 0x17, 0xCD, 0xB8, 0xCF, 0x21, 0xB3, 0x85, 0x38, 0xDE, 0x01, 0xBA, + 0x1B, 0x95, 0x4B, 0x97, 0x2B, 0xB0, 0xC9, 0xED, 0x45, 0xCE, 0x22, 0x5B, 0x8E, 0x04, 0x91, 0x07, + 0x58, 0xC8, 0xB5, 0xA7, 0x06, 0x62, 0x9D, 0xC4, 0xAC, 0x1E, 0x08, 0xFD, 0xEA, 0xB7, 0x4D, 0x0B, + 0xD2, 0x79, 0xA8, 0xEF, 0x4F, 0xBE, 0x80, 0xE6, 0x55, 0x44, 0x7B, 0x59, 0x5E, 0x9C, 0x92, 0x6A, + 0x92, 0xF7, 0xE7, 0x78, 0xFB, 0x46, 0xA1, 0xF4, 0x1E, 0x36, 0x8B, 0xE2, 0x86, 0xA2, 0xE1, 0x19, + 0xB5, 0x29, 0xEA, 0xD2, 0x1D, 0x0B, 0x68, 0xC5, 0x2F, 0x4F, 0x48, 0x6A, 0xC8, 0x92, 0xCE, 0x64, + 0x9D, 0xA5, 0x86, 0xA5, 0x05, 0x40, 0xCE, 0xD7, 0x6C, 0x69, 0x9F, 0x6C, 0xB2, 0xA3, 0x11, 0x08, + 0xEF, 0x9B, 0xCD, 0x10, 0x07, 0x7B, 0x9E, 0x25, 0xF4, 0x1A, 0x2B, 0x21, 0x7E, 0xA5, 0xB9, 0xE1, + 0x33, 0x52, 0xFA, 0x04, 0x09, 0xD4, 0x78, 0xCB, 0x56, 0xE6, 0x55, 0x2C, 0xB4, 0x5D, 0xBB, 0x40, + 0x34, 0xE5, 0x23, 0x30, 0xB8, 0x65, 0x19, 0xF1, 0x5A, 0x08, 0xF2, 0xF4, 0x86, 0x45, 0xB7, 0x87, + 0x17, 0xFA, 0x68, 0x6A, 0x1F, 0x7E, 0x69, 0xDA, 0x89, 0x8E, 0xCA, 0xB6, 0xFF, 0x9F, 0x4E, 0x6F, + 0x25, 0x46, 0x46, 0xF6, 0x7B, 0x1E, 0xB3, 0x3D, 0x2C, 0x8C, 0x01, 0xA9, 0x7B, 0xDA, 0xE9, 0x4D, + 0x6E, 0x89, 0x9D, 0x0F, 0x3F, 0x9F, 0x15, 0x3C, 0xFE, 0x35, 0x61, 0x2A, 0x45, 0xC2, 0xA9, 0xC5, + 0x5C, 0x51, 0xCC, 0x6B, 0xCC, 0x2F, 0xA7, 0x60, 0x03, 0x71, 0xF0, 0xB3, 0xBF, 0x7B, 0x76, 0xCC, + 0x89, 0x2C, 0x31, 0x79, 0xE6, 0xDC, 0x7C, 0x39, 0x24, 0xD8, 0x1A, 0x98, 0x1F, 0x98, 0xCD, 0xD4, + 0x7E, 0x04, 0xF2, 0x92, 0x8D, 0x23, 0x03, 0x5F, 0xF3, 0x05, 0x3B, 0xB0, 0x0A, 0xF0, 0x7A, 0xCA, + 0x76, 0xCB, 0xD0, 0xBA, 0xA0, 0x7F, 0xBA, 0x0D, 0x68, 0x60, 0xC3, 0xEF, 0xDC, 0x44, 0x2E, 0x40, + 0x24, 0x9D, 0xCB, 0x1D, 0x5A, 0x0C, 0x51, 0x66, 0x1A, 0x2A, 0x68, 0xA6, 0x83, 0x20, 0x79, 0x9B, + 0x24, 0xEA, 0x10, 0x5A, 0xB4, 0x39, 0x58, 0xAC, 0xA0, 0x45, 0x3B, 0x16, 0xBE, 0x24, 0x59, 0x1D, + 0x18, 0x5C, 0xD8, 0xCD, 0xFE, 0x16, 0x5C, 0x84, 0x5C, 0x2D, 0x7D, 0x28, 0xC9, 0xCE, 0x9D, 0x38, + 0xF6, 0x2F, 0x9A, 0x8A, 0x93, 0x95, 0xDC, 0x73, 0x48, 0xFD, 0xF5, 0xAB, 0xF4, 0x06, 0xB4, 0x11, + 0x79, 0x7B, 0xF7, 0x75, 0x73, 0xC2, 0x2D, 0x9C, 0x91, 0x7E, 0x51, 0x12, 0x54, 0xAC, 0x55, 0x29, + 0x48, 0x7F, 0x50, 0x15, 0xC2, 0x79, 0x05, 0x3C, 0x8F, 0xB4, 0xAE, 0xDD, 0x28, 0x09, 0xCC, 0x1D, + 0xDE, 0xEF, 0x82, 0xFD, 0x64, 0xD1, 0x5A, 0xFE, 0x06, 0x18, 0x7C, 0xF6, 0x32, 0x67, 0xDB, 0xF1, + 0x55, 0xF4, 0x09, 0x33, 0xB4, 0x91, 0xA7, 0x68, 0xE7, 0xA3, 0x60, 0x93, 0xE6, 0x36, 0xDE, 0x28, + 0xB3, 0xBD, 0x90, 0x46, 0x7F, 0xE5, 0xAF, 0x3C, 0xB6, 0x5E, 0xF2, 0x98, 0xE6, 0x28, 0x07, 0xA9, + 0x21, 0x4C, 0xAA, 0xF7, 0x95, 0xD9, 0x25, 0x51, 0x7F, 0x26, 0x8F, 0xC9, 0xD6, 0x65, 0xCA, 0x07, + 0x82, 0x1F, 0x8E, 0xBF, 0xBA, 0x65, 0xF7, 0xB1, 0x51, 0x85, 0x99, 0x23, 0x4E, 0x48, 0x2E, 0x7B, + 0xC8, 0x09, 0xC4, 0x93, 0xB9, 0xDB, 0x6B, 0xAF, 0xCA, 0xC7, 0x0A, 0xC5, 0x6D, 0xD0, 0xC2, 0xD4, + 0xF5, 0xA1, 0x5E, 0x45, 0x28, 0x54, 0x1D, 0x87, 0xC8, 0x83, 0xAF, 0x9E, 0xB7, 0xC7, 0x4D, 0x48, + 0x3B, 0x49, 0x23, 0x8B, 0x23, 0x6A, 0x2D, 0xD6, 0x30, 0xAD, 0xD3, 0xFA, 0x35, 0x67, 0xF0, 0x0D, + 0x3A, 0xDC, 0x42, 0x57, 0xBE, 0xE6, 0x5B, 0x26, 0x0B, 0x30, 0x45, 0x7E, 0x71, 0x5D, 0x82, 0xE7, + 0x40, 0x45, 0x58, 0xBB, 0xF5, 0x07, 0xEC, 0x36, 0x47, 0xF7, 0x98, 0x05, 0x70, 0x83, 0x17, 0x9D, + 0xDD, 0x4A, 0x4A, 0xB7, 0xB5, 0xBC, 0x8B, 0xF5, 0x08, 0x47, 0x74, 0xF3, 0x0F, 0x3C, 0xB0, 0xC7, + 0x30, 0x88, 0xCF, 0xA2, 0xE1, 0xC3, 0x13, 0x52, 0x20, 0x2D, 0xAD, 0xB3, 0x99, 0x37, 0x71, 0x91, + 0xBB, 0x3F, 0x31, 0xAC, 0xEC, 0xB8, 0x2A, 0x84, 0x12, 0x34, 0x84, 0xE5, 0xBF, 0x47, 0x94, 0xD6, + 0x9A, 0x1F, 0xEB, 0x34, 0xAF, 0xDA, 0x93, 0x5D, 0x22, 0x88, 0x27, 0x1A, 0x04, 0x13, 0xAA, 0x06, + 0x52, 0x8C, 0x44, 0xCB, 0xCC, 0x70, 0x7A, 0xBF, 0xC3, 0x3D, 0x21, 0x71, 0x99, 0x4F, 0x06, 0x42, + 0x8B, 0x7F, 0xDA, 0xBC, 0xAF, 0x7C, 0x24, 0x94, 0x3F, 0xC9, 0xB9, 0xF0, 0xFB, 0x9C, 0xFB, 0x94, + 0xFC, 0x7F, 0xA0, 0x2F, 0x20, 0x4D, 0x57, 0x06, 0xDB, 0xA8, 0xC4, 0xBD, 0x02, 0x6C, 0xDD, 0x00, + 0x8C, 0x84, 0xEF, 0x63, 0xDB, 0x45, 0x34, 0x21, 0x69, 0x73, 0x53, 0x22, 0xD3, 0x61, 0xA6, 0x7A, + 0xDE, 0xC1, 0x66, 0xFD, 0x3B, 0x95, 0x13, 0x76, 0x06, 0xE4, 0x76, 0x0E, 0x63, 0xF2, 0x66, 0x56, + 0xE3, 0x80, 0x55, 0x57, 0xF3, 0x88, 0xA2, 0x5E, 0x84, 0x29, 0xFD, 0x44, 0x78, 0xA9, 0xF0, 0x3A, + 0xF9, 0xE7, 0xDD, 0x66, 0xE1, 0x48, 0xA4, 0xD7, 0x15, 0x06, 0x47, 0xBA, 0x1E, 0x70, 0xA0, 0xA2, + 0xBC, 0x79, 0xCF, 0x9B, 0xA6, 0x61, 0x95, 0x4F, 0xF8, 0x46, 0xA7, 0xD5, 0xB5, 0x5F, 0x66, 0xDD, + 0xE2, 0x5A, 0x8B, 0x29, 0xBA, 0x02, 0xC8, 0x1A, 0x17, 0xFD, 0x72, 0x45, 0xED, 0x63, 0x46, 0x64, + 0x5E, 0xC9, 0x24, 0x8D, 0x91, 0x38, 0xD1, 0xEF, 0xDF, 0x82, 0x09, 0xB0, 0x5B, 0x8C, 0x43, 0x5F, + 0xF9, 0x05, 0x34, 0x1E, 0x2B, 0x4D, 0xA8, 0xC3, 0xE5, 0x9A, 0xD5, 0x95, 0x1B, 0xC0, 0xB9, 0x30, + 0x55, 0xB1, 0xEF, 0x53, 0xD2, 0x86, 0x65, 0x96, 0xD1, 0x3C, 0x75, 0x9E, 0x43, 0xED, 0x72, 0x92, + 0x5F, 0xC3, 0xF8, 0x4C, 0x14, 0xA7, 0x77, 0x22, 0x48, 0x5E, 0xD0, 0x02, 0x32, 0xB4, 0x5F, 0xA9, + 0xCD, 0x9C, 0xF6, 0x46, 0x60, 0xEF, 0x4D, 0x14, 0x84, 0x6E, 0xC5, 0x2C, 0xA6, 0xB2, 0xFB, 0x38, + 0xD1, 0x0C, 0xB2, 0x87, 0xE8, 0x64, 0x1E, 0xFD, 0xC4, 0x28, 0x08, 0x37, 0x61, 0x85, 0x11, 0x44, + 0x76, 0xC9, 0x9F, 0xAD, 0x6D, 0xBC, 0xC0, 0xC8, 0x02, 0xC8, 0xDA, 0x22, 0x1D, 0xB3, 0x54, 0x5F, + 0x38, 0x0D, 0x1D, 0xC0, 0x78, 0x46, 0x7C, 0x46, 0x05, 0xC1, 0x51, 0x9A, 0xF7, 0x7E, 0x51, 0x75, + 0x32, 0xD6, 0xB1, 0x7E, 0x8B, 0x3A, 0xB9, 0xA8, 0x12, 0xAF, 0xF8, 0x20, 0x69, 0xED, 0x37, 0xB4, + 0xD2, 0x7D, 0x7C, 0x08, 0xE4, 0x74, 0xD8, 0x18, 0x2B, 0x6E, 0x65, 0x21, 0xC4, 0x8C, 0xF0, 0xB2, + 0x1A, 0x7D, 0xDD, 0xA5, 0xE9, 0xC3, 0x88, 0xEE, 0x7E, 0x80, 0xE3, 0x4B, 0x3A, 0x56, 0x3D, 0x4B, + 0x75, 0x62, 0xE1, 0xCE, 0xB6, 0xD5, 0xF1, 0xFC, 0x0C, 0x0A, 0x66, 0x10, 0xD2, 0xC0, 0xF3, 0xD3, + 0xCA, 0xFE, 0xD6, 0x73, 0xE4, 0x21, 0xDA, 0xED, 0xE4, 0xE4, 0x5A, 0xAC, 0x31, 0x6D, 0x84, 0x8E, + 0x24, 0x56, 0x6B, 0x09, 0x14, 0x09, 0x81, 0xD6, 0xC6, 0x92, 0x2B, 0xE5, 0x2F, 0x61, 0xCE, 0xD3, + 0xBD, 0x31, 0x10, 0x56, 0x4C, 0x68, 0x18, 0xA2, 0x4E, 0xBF, 0x22, 0x71, 0x77, 0x4A, 0xEC, 0x3F, + 0x8A, 0x10, 0xF9, 0x62, 0x7B, 0x4F, 0x7E, 0xE3, 0x16, 0x23, 0x3C, 0x4A, 0x7B, 0xD9, 0xCC, 0xA1, + 0x13, 0x09, 0x31, 0xD8, 0xD1, 0x23, 0xC4, 0xAD, 0x48, 0xD6, 0xC7, 0xCF, 0xB6, 0xE2, 0x5E, 0x53, + 0xAF, 0x45, 0xF4, 0xE4, 0x82, 0xDC, 0xB3, 0x5D, 0x19, 0x4A, 0x71, 0xBE, 0x75, 0x1D, 0x82, 0x9C, + 0xCD, 0x1F, 0x1E, 0xCE, 0xE1, 0xB6, 0x94, 0xED, 0x9A, 0x3A, 0x1A, 0x66, 0xFF, 0x5C, 0x43, 0x7D, + 0x51, 0x46, 0x09, 0xBB, 0xD0, 0x5D, 0x1A, 0x81, 0x98, 0x9A, 0xAC, 0x74, 0x94, 0xD3, 0x05, 0x55, + 0xE1, 0xE4, 0x2A, 0x43, 0xCC, 0xC8, 0x2C, 0x10, 0xA7, 0xE8, 0xAD, 0x5F, 0x02, 0xDF, 0x3B, 0x10, + 0x33, 0x43, 0x8A, 0x92, 0xF9, 0xCF, 0x12, 0x04, 0x60, 0xCD, 0xA0, 0x30, 0xA9, 0xE8, 0x32, 0x30, + 0x80, 0x8B, 0xF2, 0x09, 0xA4, 0x91, 0xFA, 0x3B, 0xBD, 0x1D, 0x54, 0xFD, 0xF8, 0xCF, 0x74, 0x70, + 0x50, 0x9B, 0x8D, 0x40, 0xBD, 0xC7, 0x3D, 0x4F, 0x03, 0x7B, 0x63, 0x32, 0xCE, 0x8B, 0x5B, 0x7C, + 0x9A, 0xE0, 0x3A, 0x37, 0x38, 0xCA, 0x31, 0x21, 0xDB, 0x4F, 0xF6, 0xF0, 0xDB, 0x4E, 0xE5, 0xDC, + 0x69, 0x4B, 0xAE, 0x28, 0x01, 0xF2, 0x46, 0x38, 0x6A, 0x9A, 0x50, 0x2D, 0xF4, 0x36, 0x5D, 0xEF, + 0x25, 0xB1, 0x31, 0xCA, 0x58, 0x5E, 0x4B, 0xE6, 0xAC, 0xCF, 0x0C, 0x20, 0x84, 0x7F, 0xF5, 0xC1, + 0x1A, 0xE5, 0x94, 0xC3, 0x3D, 0x77, 0x8E, 0xA3, 0x9B, 0xAF, 0x96, 0xBF, 0xD1, 0xEC, 0x35, 0x17, + 0x15, 0xDF, 0x2B, 0x00, 0xCD, 0x2C, 0xDB, 0xD3, 0x31, 0x8A, 0x6D, 0xE0, 0xB3, 0x1F, 0x71, 0xB4, + 0xA4, 0xCA, 0xFA, 0x40, 0xEB, 0x99, 0x4C, 0xFB, 0xFE, 0x9D, 0xBA, 0x26, 0x0F, 0x1B, 0x6D, 0xE6, + 0xB6, 0x2C, 0xAD, 0xF4, 0xD8, 0x12, 0xC0, 0xA3, 0xA4, 0x65, 0x10, 0x1B, 0xCD, 0xFD, 0x0A, 0xB0, + 0x52, 0x71, 0x56, 0xD4, 0x01, 0x49, 0xC9, 0x68, 0x06, 0xA1, 0xD3, 0x61, 0x8A, 0xC1, 0x07, 0x1B, + 0x06, 0x48, 0x78, 0x1B, 0x96, 0xCB, 0x7B, 0xC5, 0xF4, 0x8B, 0x27, 0x93, 0xF1, 0x10, 0x40, 0xB3, + 0x36, 0xA3, 0xA8, 0x19, 0xF3, 0x1B, 0x1B, 0xA4, 0xCD, 0x19, 0x18, 0x25, 0x7C, 0x24, 0xAC, 0x05, + 0xD1, 0xB2, 0xA1, 0x1E, 0x0B, 0xB3, 0xDA, 0x82, 0x3E, 0x78, 0x87, 0x12, 0x8F, 0xE6, 0xB9, 0x59, + 0x02, 0xDC, 0x15, 0x31, 0xA3, 0xAE, 0x22, 0x2F, 0xB7, 0x60, 0x08, 0x42, 0xA0, 0x4B, 0x94, 0xA1, + 0x1A, 0xD9, 0x32, 0x40, 0x2C, 0x33, 0x5A, 0x62, 0xB3, 0xDB, 0x9C, 0x04, 0x3B, 0xCE, 0x40, 0xCD, + 0x3C, 0x29, 0xDB, 0x1C, 0x98, 0xC7, 0x7B, 0x09, 0x65, 0x91, 0xCD, 0xB9, 0x71, 0x80, 0xF2, 0x14, + 0x90, 0x27, 0xA5, 0xC7, 0x16, 0xBB, 0xC8, 0x6D, 0x79, 0x0F, 0xC7, 0x06, 0x4F, 0xFD, 0xEF, 0x3D, + 0x7E, 0xA9, 0x1A, 0x20, 0x4A, 0x94, 0x3F, 0x84, 0xA1, 0x97, 0xE1, 0x99, 0xF5, 0x9E, 0xB2, 0x46, + 0x23, 0xC3, 0x48, 0x46, 0xC0, 0x2C, 0x7D, 0x64, 0x45, 0x7B, 0xA0, 0xBF, 0x5F, 0x14, 0xBC, 0xB2, + 0x17, 0x87, 0x68, 0x5C, 0x17, 0xCE, 0xCA, 0xEA, 0x73, 0x3C, 0xAE, 0x6C, 0x8C, 0x4A, 0x2C, 0xFB, + 0x77, 0x52, 0xE7, 0xA1, 0xFF, 0x6C, 0x23, 0x05, 0x1E, 0x69, 0x22, 0xF1, 0xDA, 0x6B, 0xB6, 0x01, + 0x44, 0xDE, 0xEB, 0x80, 0xB7, 0x84, 0x5B, 0xC7, 0xEA, 0x59, 0x5B, 0x3F, 0x23, 0x7E, 0x10, 0x00, + 0x27, 0x5C, 0x6A, 0x7B, 0xEB, 0xFF, 0xDF, 0x82, 0xEE, 0x85, 0x6C, 0xA5, 0x1A, 0xBF, 0xEB, 0x64, + 0xBB, 0x10, 0x46, 0x40, 0x51, 0x29, 0x2C, 0x6A, 0xD2, 0xF5, 0x58, 0x61, 0x5F, 0x77, 0x31, 0xBD, + 0x59, 0x0A, 0x1B, 0xF5, 0xC2, 0xFA, 0x9A, 0xB4, 0x59, 0xF4, 0x0A, 0xD1, 0x68, 0xCC, 0x21, 0x44, + 0xDC, 0x70, 0x80, 0xD1, 0x67, 0xCC, 0x24, 0x22, 0xC0, 0x77, 0x04, 0xED, 0xA3, 0xB4, 0x23, 0xC8, + 0xAD, 0x5E, 0x18, 0x64, 0x57, 0x89, 0x52, 0xDD, 0x25, 0x6C, 0x38, 0xCE, 0x5D, 0x45, 0x42, 0x18, + 0xA3, 0xE2, 0xD8, 0x6E, 0x21, 0x5F, 0xBB, 0x9D, 0xCA, 0x90, 0x57, 0x85, 0x0C, 0xD5, 0x56, 0xC8, + 0x12, 0x39, 0x27, 0x44, 0x77, 0xE6, 0x59, 0xE7, 0x08, 0xB0, 0x4E, 0x80, 0xBD, 0xE3, 0xE6, 0x8B, + 0xE1, 0x4B, 0x6E, 0xCE, 0xA9, 0x5C, 0x8E, 0xF2, 0xE2, 0xFE, 0x18, 0xFB, 0x74, 0xD6, 0x3C, 0x76, + 0xB8, 0xB0, 0x90, 0x00, 0x3A, 0xF4, 0xE4, 0xB7, 0xFD, 0x05, 0xA3, 0x7A, 0xD9, 0xF7, 0x0E, 0x18, + 0x66, 0xBC, 0x9A, 0x47, 0x18, 0x80, 0x4F, 0x4A, 0x6B, 0x9C, 0xF8, 0x48, 0x16, 0x49, 0x3F, 0x21, + 0xB4, 0x20, 0x59, 0x51, 0xDA, 0xD1, 0x4B, 0xE8, 0x5E, 0x48, 0x95, 0x77, 0x0A, 0x82, 0xA1, 0x8F, + 0xD2, 0x77, 0xC9, 0xC5, 0xE2, 0x79, 0x24, 0x87, 0x34, 0x0C, 0x9E, 0x17, 0x6F, 0x7B, 0xEA, 0x14, + 0x79, 0xF6, 0x0C, 0x95, 0x5F, 0x1C, 0x61, 0x01, 0x61, 0x6D, 0xD1, 0xF2, 0x6A, 0xA8, 0x09, 0xAA, + 0x0A, 0x6E, 0xF9, 0x28, 0x69, 0x49, 0x14, 0x60, 0x6D, 0xA3, 0xCF, 0x5E, 0x4C, 0x34, 0x8E, 0xFC, + 0x7E, 0x3E, 0x72, 0x3E, 0x02, 0x78, 0x3D, 0x1B, 0xA4, 0x93, 0x46, 0x39, 0x46, 0x0E, 0xF0, 0xE3, + 0x46, 0xF0, 0x4C, 0x2F, 0xE2, 0x14, 0x93, 0xF0, 0x2A, 0x5B, 0xE8, 0x05, 0xF7, 0x10, 0x3A, 0x6D, + 0x03, 0xA0, 0x5D, 0xF8, 0x5D, 0xD1, 0x4C, 0x58, 0x7B, 0xBF, 0xAB, 0x52, 0xC1, 0x6E, 0x72, 0x1E, + 0x60, 0x8C, 0x33, 0x4E, 0x22, 0xE7, 0x12, 0x51, 0x0B, 0xFE, 0x22, 0xDA, 0x8A, 0x53, 0xA7, 0xC6, + 0x9A, 0x66, 0x92, 0x76, 0x46, 0x3C, 0xC5, 0x72, 0x55, 0x6C, 0xD2, 0x8D, 0xF1, 0xD5, 0x6C, 0x09, + 0xEA, 0x2D, 0x1A, 0xF9, 0x99, 0x5E, 0x65, 0xCC, 0x6D, 0x55, 0x5F, 0x46, 0x66, 0xC3, 0xBB, 0xBE, + 0x1C, 0x53, 0x40, 0x3B, 0xE9, 0x15, 0x6C, 0xD6, 0x94, 0x8C, 0x5D, 0xB4, 0x4A, 0xDC, 0x2F, 0x2F, + 0xC1, 0xA8, 0xE1, 0xDF, 0x7A, 0xB5, 0x6D, 0xE2, 0xF8, 0xDB, 0xAA, 0x5D, 0x3D, 0x80, 0x5D, 0x33, + 0x6F, 0xCD, 0x5A, 0x84, 0xBC, 0x2D, 0x6E, 0x28, 0x97, 0x07, 0xA6, 0xF1, 0x0B, 0x22, 0x23, 0x58, + 0xDF, 0x50, 0x15, 0x73, 0xD6, 0x75, 0x63, 0xB6, 0x0F, 0xD8, 0x75, 0x9B, 0xF9, 0x9D, 0xBF, 0xE6, + 0xAF, 0xF8, 0xBF, 0xB4, 0x3A, 0xD4, 0x02, 0x3B, 0x8A, 0x4D, 0xF6, 0x44, 0x0E, 0x7F, 0x2B, 0xDB, + 0x9C, 0xAC, 0xD6, 0xB8, 0xC5, 0xB5, 0xEF, 0x1B, 0x67, 0xB0, 0x10, 0xCC, 0x1E, 0x24, 0xD4, 0x05, + 0x06, 0x6D, 0x3A, 0xFE, 0x95, 0x4C, 0x00, 0x8A, 0xD2, 0x53, 0x1B, 0x7A, 0xDE, 0xA0, 0x9F, 0x2D, + 0x10, 0x43, 0x2D, 0xA3, 0x8E, 0x66, 0x36, 0x27, 0x77, 0x05, 0x26, 0x78, 0x21, 0x09, 0x18, 0xD0, + 0x2E, 0x86, 0x1E, 0x56, 0x3B, 0x71, 0x3A, 0x46, 0x24, 0x7C, 0x90, 0x1E, 0x42, 0x36, 0x11, 0xA1, + 0x7C, 0x04, 0x80, 0x42, 0x0F, 0xA8, 0x4E, 0x07, 0xA1, 0x7B, 0x55, 0x5F, 0xA8, 0x8A, 0x1D, 0x36, + 0x9C, 0x16, 0xBD, 0xE0, 0x63, 0x0A, 0xE3, 0xC5, 0xF9, 0x55, 0xA4, 0xE9, 0x75, 0x7D, 0xD5, 0x82, + 0x32, 0x1E, 0x6B, 0x05, 0xE4, 0xF9, 0x8A, 0x8C, 0x18, 0x0E, 0xA0, 0xDF, 0x23, 0x4D, 0xA8, 0x4E, + 0xF0, 0x85, 0xFF, 0x04, 0xC5, 0xFE, 0x1E, 0x8A, 0x3F, 0xBF, 0x54, 0x05, 0x82, 0x8A, 0x0C, 0xDF, + 0xCA, 0x0A, 0xD0, 0x43, 0x76, 0xE5, 0x49, 0x55, 0x36, 0x24, 0x6F, 0x2F, 0x20, 0x58, 0x3A, 0xFE, + 0x62, 0x3A, 0x11, 0xAA, 0x2F, 0xB2, 0x25, 0x6F, 0x0B, 0x9D, 0xD8, 0xCC, 0xC5, 0x26, 0x16, 0x2E, + 0x74, 0x56, 0xBE, 0x99, 0xF4, 0xE7, 0x90, 0x88, 0x65, 0x1E, 0x6C, 0xAA, 0xB4, 0x2C, 0xCF, 0x12, + 0x63, 0x86, 0x8E, 0x9C, 0xF5, 0x75, 0x5A, 0x71, 0xBF, 0xFB, 0x54, 0xF3, 0x86, 0x61, 0xC5, 0x59, + 0xB4, 0xD5, 0x8E, 0x5D, 0x91, 0xA0, 0xB0, 0x9B, 0xB1, 0x95, 0xCE, 0x45, 0x0C, 0x4A, 0xFC, 0xE0, + 0x56, 0x73, 0x96, 0xC1, 0xAA, 0x0A, 0x65, 0x42, 0x42, 0xC1, 0xC7, 0x2D, 0x6E, 0xC8, 0x4A, 0x7F, + 0x40, 0x53, 0x0C, 0x7A, 0x99, 0x96, 0x59, 0xFA, 0xEC, 0xAD, 0xA1, 0xF0, 0xAB, 0xFE, 0xB6, 0x58, + 0x49, 0x65, 0xF4, 0x29, 0x2A, 0x21, 0x42, 0x93, 0x0A, 0xED, 0x38, 0xC0, 0x33, 0xFD, 0xCF, 0x8E, + 0xC1, 0xEC, 0x3A, 0xF9, 0x1F, 0xEA, 0x8F, 0xA2, 0xEA, 0xAE, 0xC4, 0xE7, 0x43, 0xCB, 0x53, 0xF1, + 0x77, 0xC9, 0x6C, 0x61, 0x35, 0xE2, 0xED, 0x25, 0x68, 0xF6, 0x8E, 0x06, 0xD6, 0x41, 0x87, 0x58, + 0x8A, 0xE4, 0x5F, 0x80, 0x59, 0xC7, 0x21, 0xAC, 0xC1, 0x95, 0xC8, 0xBA, 0xF9, 0x84, 0x1F, 0x70, + 0x15, 0x1C, 0xB1, 0xF1, 0x2B, 0xB4, 0xB7, 0xA0, 0x4B, 0xE3, 0xB3, 0xD4, 0x3C, 0x9C, 0x01, 0xB2, + 0x4A, 0xE5, 0x47, 0x39, 0x10, 0x32, 0xE0, 0x0E, 0x1C, 0xE9, 0x3E, 0x2E, 0xDD, 0x12, 0x2C, 0xDF, + 0xB7, 0x47, 0xE8, 0x88, 0x53, 0x28, 0xF2, 0xC6, 0x11, 0x12, 0x15, 0x4A, 0x60, 0x14, 0xA4, 0x78, + 0x54, 0x8E, 0x6A, 0x77, 0xD6, 0x74, 0xC2, 0xCD, 0x4B, 0xF9, 0xC2, 0x84, 0xE8, 0xD6, 0xED, 0x4D, + 0xB3, 0x0C, 0x32, 0x39, 0xCF, 0xB9, 0xF9, 0x0B, 0xC3, 0x52, 0xF5, 0x6E, 0x9A, 0x38, 0x84, 0xED, + 0x0D, 0x83, 0xFA, 0x83, 0x2D, 0xF4, 0xB3, 0xEE, 0x71, 0xE0, 0x47, 0x48, 0xE6, 0x1A, 0x0B, 0xD9, + 0x54, 0x74, 0xB8, 0x39, 0xA1, 0x4C, 0xC7, 0x3C, 0x52, 0x02, 0x07, 0x61, 0x12, 0x1B, 0x49, 0x0B, + 0x7D, 0x08, 0xAA, 0xEA, 0xB0, 0x3A, 0x05, 0x65, 0x9A, 0xEA, 0x68, 0x0C, 0x5B, 0xA6, 0x37, 0xC6, + 0x5F, 0x10, 0x7D, 0xC8, 0xAE, 0xCA, 0x65, 0x1F, 0x16, 0x80, 0x38, 0xF1, 0xB7, 0xB5, 0xDB, 0x1D, + 0x37, 0x5A, 0x1D, 0xEB, 0x7B, 0x2C, 0xA1, 0x7B, 0x72, 0xCE, 0x0D, 0x34, 0xB4, 0x17, 0x23, 0x52, + 0x8B, 0x3A, 0xD6, 0xEC, 0xE5, 0x8D, 0x23, 0x6A, 0xCF, 0x34, 0xDE, 0x02, 0x5A, 0xA4, 0x54, 0xFF, + 0x85, 0x85, 0x3E, 0x33, 0x87, 0xF9, 0x27, 0x59, 0xE2, 0x32, 0xAB, 0x8D, 0xBA, 0x8A, 0x92, 0xEB, + 0x5D, 0xA7, 0xF6, 0x6A, 0xDF, 0x32, 0xAD, 0xAC, 0x70, 0xCF, 0x91, 0xA9, 0x8E, 0x4C, 0x39, 0x71, + 0x4C, 0x1B, 0xBF, 0xD1, 0xD0, 0x68, 0x19, 0x9C, 0x8A, 0x7B, 0x57, 0x52, 0x40, 0xCE, 0xCC, 0x86, + 0xB7, 0x0E, 0x3D, 0x5E, 0xAD, 0xD0, 0x2B, 0xD4, 0x58, 0x5C, 0x5B, 0xD8, 0x00, 0x7F, 0x42, 0x99, + 0x84, 0x5D, 0x2D, 0x86, 0x40, 0x10, 0x35, 0x15, 0x05, 0x67, 0xDE, 0x22, 0x6C, 0xB4, 0x5C, 0x7B, + 0xCA, 0xDF, 0xF4, 0x1D, 0xD2, 0xCB, 0x34, 0x02, 0x6C, 0x22, 0x10, 0x4F, 0x7F, 0xDF, 0x18, 0xFF, + 0x5A, 0x81, 0x4C, 0xAC, 0xF7, 0xF3, 0xF1, 0x5D, 0xBA, 0x72, 0x36, 0x26, 0x88, 0xAE, 0xCA, 0xE0, + 0x79, 0x84, 0x68, 0x86, 0xCE, 0x35, 0xAF, 0x27, 0xB4, 0x21, 0xFD, 0x05, 0xB1, 0x38, 0x17, 0x7D, + 0x9B, 0x5A, 0x12, 0x29, 0x76, 0xE5, 0xA0, 0x39, 0x0B, 0xAD, 0x4C, 0x33, 0xCB, 0x45, 0x59, 0x82, + 0xB7, 0x03, 0xD2, 0x1A, 0xF7, 0x2F, 0x54, 0x43, 0x92, 0xC9, 0x8B, 0x6F, 0x6C, 0x6C, 0x1B, 0x10, + 0xEE, 0x97, 0x38, 0xA5, 0x8B, 0x16, 0xDE, 0xFC, 0xDA, 0x83, 0x4B, 0x39, 0x79, 0x17, 0xB7, 0x5A, + 0x59, 0x01, 0x11, 0xC0, 0xC6, 0x36, 0xD5, 0xBA, 0xB1, 0x46, 0x9E, 0x6B, 0xA1, 0xCB, 0x96, 0x7E, + 0x56, 0x91, 0x87, 0x68, 0x59, 0x8E, 0xCF, 0xB5, 0x58, 0x24, 0x2C, 0xD9, 0x0A, 0x06, 0x25, 0xCB, + 0x8C, 0xE6, 0x02, 0xE3, 0x5A, 0x19, 0x4D, 0x8F, 0x43, 0x5B, 0x40, 0x3F, 0x7D, 0x50, 0x24, 0x90, + 0x71, 0x3E, 0x88, 0x96, 0x3C, 0xCE, 0x2C, 0x80, 0x35, 0x68, 0x3E, 0x21, 0x67, 0x8A, 0x03, 0x68, + 0x49, 0x6B, 0xFA, 0xE2, 0x5A, 0xC7, 0xFF, 0x9C, 0xDF, 0x0D, 0xD9, 0xB5, 0x12, 0x07, 0x35, 0x7B, + 0x35, 0xDC, 0xF7, 0x12, 0x55, 0x71, 0x8A, 0x9F, 0x68, 0x66, 0x2A, 0x72, 0x55, 0x14, 0x82, 0xE2, + 0xBC, 0x3A, 0x39, 0xA7, 0x91, 0xA9, 0x91, 0xC8, 0x2B, 0x5F, 0x0A, 0x09, 0xFD, 0xE0, 0x6B, 0x58, + 0x85, 0x58, 0x1D, 0xCD, 0xEA, 0xAE, 0xBA, 0xA5, 0x49, 0xFF, 0x69, 0x4A, 0x10, 0xDD, 0x5A, 0xE0, + 0x0E, 0xD3, 0x9C, 0x0B, 0xD8, 0x28, 0x2E, 0xCA, 0x8E, 0x9F, 0x29, 0x84, 0xC8, 0xCA, 0x47, 0x79, + 0xB9, 0xCC, 0x71, 0xC6, 0xE1, 0xC1, 0x4D, 0x15, 0xB6, 0x1F, 0x92, 0x13, 0x2C, 0x83, 0xBE, 0x0D, + 0x03, 0x0A, 0x7C, 0x02, 0x7C, 0x2C, 0xFA, 0x8E, 0xC8, 0x23, 0xE1, 0xFD, 0x83, 0xDC, 0x61, 0xDB, + 0x1C, 0xE4, 0x3F, 0xE8, 0xA9, 0x1C, 0x55, 0x1E, 0xB2, 0xF1, 0x47, 0x6C, 0x5A, 0xD8, 0xD9, 0xD4, + 0xA8, 0xBF, 0x4B, 0xF9, 0x0A, 0xD5, 0xBF, 0x1D, 0x88, 0x30, 0x12, 0x80, 0x72, 0x49, 0x6C, 0x91, + 0x70, 0x6A, 0xB7, 0x4D, 0x86, 0x34, 0x8F, 0x57, 0x1A, 0x6A, 0x16, 0x7B, 0xA5, 0x5D, 0x3C, 0x74, + 0x8E, 0x03, 0x1D, 0x53, 0xD6, 0x1C, 0x75, 0x83, 0x2C, 0xF7, 0x5E, 0xF6, 0xE0, 0xC9, 0x25, 0x11, + 0x9F, 0x98, 0x73, 0xD2, 0xBE, 0x50, 0x56, 0xD6, 0x73, 0x38, 0xC8, 0x30, 0x5A, 0xB5, 0xF6, 0x67, + 0x37, 0x75, 0x7E, 0x99, 0x71, 0xC7, 0x30, 0x26, 0x0D, 0x43, 0xA2, 0x0B, 0xF0, 0xC2, 0xCC, 0x38, + 0xDF, 0x0F, 0x37, 0x25, 0xA0, 0x4F, 0x18, 0x5A, 0x40, 0x75, 0x2D, 0xFC, 0x52, 0xFF, 0x37, 0xD5, + 0x38, 0x06, 0xC6, 0x62, 0x13, 0xA0, 0x8E, 0x7A, 0xFA, 0xDD, 0xB9, 0x25, 0xBE, 0xBC, 0x1F, 0x02, + 0x4C, 0x56, 0xA1, 0xBA, 0x08, 0xBB, 0x65, 0xAE, 0xAC, 0x14, 0x4E, 0x65, 0xD7, 0xD1, 0x99, 0xFF, + 0x14, 0x33, 0x9F, 0x18, 0x1D, 0x54, 0x70, 0x6F, 0xBC, 0x85, 0xB4, 0x49, 0x82, 0x4C, 0x0A, 0xA6, + 0xE8, 0x10, 0x61, 0x8F, 0xED, 0xFD, 0x7F, 0x10, 0xAA, 0xAC, 0x13, 0xB5, 0xE2, 0x5D, 0xF3, 0x69, + 0x2B, 0xC3, 0xE1, 0xC2, 0x89, 0x9A, 0x46, 0xF0, 0x97, 0x34, 0xFC, 0x93, 0x31, 0x45, 0xE9, 0x7A, + 0xD4, 0x46, 0x1A, 0x31, 0xFF, 0x65, 0x39, 0xAE, 0xCE, 0xC5, 0x40, 0x2F, 0xD0, 0xCB, 0x1E, 0xC6, + 0x86, 0xDC, 0x2F, 0x72, 0x34, 0x35, 0x28, 0xAD, 0x96, 0xC3, 0xBE, 0xE4, 0xC8, 0xA5, 0xB6, 0x6B, + 0xBD, 0xFB, 0x9B, 0xE5, 0x16, 0x01, 0x4A, 0x55, 0xA2, 0xB0, 0xE8, 0x66, 0x4A, 0xC1, 0xE3, 0xC0, + 0xB9, 0x87, 0xF4, 0xD6, 0x8C, 0xF4, 0x61, 0x42, 0xA4, 0xBF, 0x73, 0x03, 0x67, 0xBD, 0x2F, 0x30, + 0x6E, 0x97, 0x45, 0x0F, 0xC6, 0xBD, 0xCA, 0x2E, 0x69, 0x72, 0x41, 0x07, 0x38, 0x74, 0x18, 0xB1, + 0xCB, 0x5C, 0xD3, 0xC2, 0x1D, 0xB7, 0xF2, 0xAF, 0xEC, 0x00, 0xCD, 0x4F, 0x6F, 0xDE, 0xB2, 0xAC, + 0x44, 0x4C, 0x1A, 0x56, 0xC3, 0x93, 0x21, 0x57, 0x8C, 0x6B, 0x1C, 0xD7, 0xF9, 0xC7, 0xC0, 0xA9, + 0xF7, 0xE4, 0xA3, 0xD8, 0x58, 0x9B, 0x35, 0xE6, 0x00, 0x7C, 0xE2, 0x12, 0xD0, 0x53, 0x61, 0x1F, + 0xC6, 0xA5, 0x81, 0x7A, 0x52, 0xEF, 0x09, 0x36, 0x1A, 0x62, 0x3C, 0x92, 0xD2, 0x65, 0x43, 0xF6, + 0xDF, 0x0B, 0x89, 0x7E, 0xC6, 0xB9, 0x47, 0xF4, 0x52, 0x14, 0x0C, 0x44, 0x4D, 0x23, 0x55, 0x6F, + 0x80, 0xC2, 0xBE, 0xC5, 0x59, 0xF8, 0xB5, 0x27, 0xE6, 0xE8, 0xF0, 0x32, 0x91, 0x3A, 0x59, 0x2B, + 0x1D, 0xF9, 0xAC, 0xF9, 0x2E, 0xF3, 0xB9, 0x36, 0x8C, 0x1A, 0x5D, 0x92, 0x33, 0xEA, 0xA6, 0xAF, + 0x71, 0x24, 0xE2, 0x7F, 0x18, 0xB1, 0x23, 0x3C, 0x53, 0xF3, 0xCC, 0x5D, 0xD4, 0x2D, 0x2B, 0x7A, + 0xF8, 0x94, 0x04, 0xC0, 0x8C, 0x65, 0x4D, 0x3A, 0xFA, 0xCF, 0xF9, 0x07, 0xC2, 0xD7, 0x75, 0x87, + 0x47, 0x9E, 0x6E, 0xA0, 0x79, 0x81, 0x6E, 0x03, 0xC7, 0xD2, 0x75, 0xF6, 0xC3, 0x85, 0x22, 0x28, + 0x1B, 0x39, 0x63, 0xCC, 0x12, 0x7E, 0x4A, 0xC3, 0x2A, 0x45, 0x85, 0xA9, 0x54, 0xDF, 0xB2, 0x33, + 0xEF, 0x76, 0x25, 0x31, 0xC9, 0xCD, 0xDA, 0x14, 0xE7, 0xD8, 0x4D, 0x18, 0xCE, 0xAB, 0xE7, 0x85, + 0xDD, 0x95, 0x8D, 0x36, 0xA1, 0x18, 0x87, 0x5E, 0xB6, 0x75, 0x2F, 0x3B, 0x97, 0x09, 0x18, 0x47, + 0xC8, 0x90, 0x37, 0xA3, 0xB2, 0xD2, 0x09, 0x3C, 0x5E, 0x6C, 0x2E, 0x72, 0x38, 0x08, 0x24, 0x99, + 0x90, 0xD0, 0x86, 0xC7, 0xD3, 0xFB, 0x4E, 0xA2, 0xDF, 0xC7, 0x26, 0x4D, 0x8E, 0x81, 0x98, 0x19, + 0x15, 0xD0, 0x4C, 0xB8, 0x44, 0xF7, 0x53, 0x1C, 0x0F, 0xAF, 0x78, 0x4C, 0x20, 0xB8, 0xCC, 0xBB, + 0x20, 0x60, 0xEC, 0x55, 0x70, 0xBD, 0xE9, 0x02, 0x63, 0x9F, 0x1F, 0xA7, 0xD5, 0x27, 0x18, 0x33, + 0x29, 0xA8, 0x33, 0x6E, 0xCB, 0x80, 0x40, 0x2D, 0x52, 0xDF, 0x6C, 0x78, 0x8F, 0xA6, 0x1D, 0xCF, + 0xE8, 0xB9, 0x54, 0x6B + }, + // ModuleKey + { + 0xAE, 0x25, 0xBC, 0x51, 0x06, 0x3B, 0x77, 0xBD, 0x36, 0x3C, 0x3E, 0xFE, 0x0F, 0xC1, 0x73, 0xF9 + }, + // Seed + { + 0x4D, 0x80, 0x8D, 0x2C, 0x77, 0xD9, 0x05, 0xC4, 0x1A, 0x63, 0x80, 0xEC, 0x08, 0x58, 0x6A, 0xFE + }, + // ServerKeySeed + { + 0xC2, 0xB7, 0xAD, 0xED, 0xFC, 0xCC, 0xA9, 0xC2, 0xBF, 0xB3, 0xF8, 0x56, 0x02, 0xBA, 0x80, 0x9B + }, + // ClientKeySeed + { + 0x7F, 0x96, 0xEE, 0xFD, 0xA5, 0xB6, 0x3D, 0x20, 0xA4, 0xDF, 0x8E, 0x00, 0xCB, 0xF4, 0x83, 0x04 + }, + // ClientKeySeedHash (SHA1(ClientKeySeed)) + { + 0x56, 0x8C, 0x05, 0x4C, 0x78, 0x1A, 0x97, 0x2A, 0x60, 0x37, 0xA2, 0x29, 0x0C, 0x22, 0xB5, 0x25, 0x71, 0xA0, 0x6F, 0x4E + } }; #endif diff --git a/src/server/game/Warden/Warden.cpp b/src/server/game/Warden/Warden.cpp index 3d625df63d0..0734e0a0f63 100644 --- a/src/server/game/Warden/Warden.cpp +++ b/src/server/game/Warden/Warden.cpp @@ -187,15 +187,17 @@ std::string Warden::Penalty(WardenCheck* check /*= NULL*/) duration << sWorld->getIntConfig(CONFIG_WARDEN_CLIENT_BAN_DURATION) << "s"; std::string accountName; AccountMgr::GetName(_session->GetAccountId(), accountName); - sWorld->BanAccount(BAN_ACCOUNT, accountName, duration.str(), "Warden Anticheat violation","Server"); + std::stringstream banReason; + banReason << "Warden Anticheat Violation: " << check->Comment << " (CheckId: " << check->CheckId << ")"; + sWorld->BanAccount(BAN_ACCOUNT, accountName, duration.str(), banReason.str(),"Server"); return "Ban"; break; } default: - return "Undefined"; break; } + return "Undefined"; } void WorldSession::HandleWardenDataOpcode(WorldPacket& recvData) @@ -203,7 +205,7 @@ void WorldSession::HandleWardenDataOpcode(WorldPacket& recvData) _warden->DecryptData(const_cast(recvData.contents()), recvData.size()); uint8 opcode; recvData >> opcode; - sLog->outDebug(LOG_FILTER_WARDEN, "Got packet, opcode %02X, size %u", opcode, recvData.size()); + sLog->outDebug(LOG_FILTER_WARDEN, "Got packet, opcode %02X, size %u", opcode, uint32(recvData.size())); recvData.hexlike(); switch(opcode) @@ -228,7 +230,7 @@ void WorldSession::HandleWardenDataOpcode(WorldPacket& recvData) sLog->outDebug(LOG_FILTER_WARDEN, "NYI WARDEN_CMSG_MODULE_FAILED received!"); break; default: - sLog->outDebug(LOG_FILTER_WARDEN, "Got unknown warden opcode %02X of size %u.", opcode, recvData.size() - 1); + sLog->outDebug(LOG_FILTER_WARDEN, "Got unknown warden opcode %02X of size %u.", opcode, uint32(recvData.size() - 1)); break; } } diff --git a/src/server/game/Warden/Warden.h b/src/server/game/Warden/Warden.h index e06ea7dca25..d16890b31b9 100644 --- a/src/server/game/Warden/Warden.h +++ b/src/server/game/Warden/Warden.h @@ -107,7 +107,7 @@ class Warden public: Warden(); - ~Warden(); + virtual ~Warden(); virtual void Init(WorldSession* session, BigNumber* k) = 0; virtual ClientWardenModule* GetModuleForClient() = 0; diff --git a/src/server/game/Warden/WardenCheckMgr.cpp b/src/server/game/Warden/WardenCheckMgr.cpp index 77332bd30a8..f4c7a5069cf 100644 --- a/src/server/game/Warden/WardenCheckMgr.cpp +++ b/src/server/game/Warden/WardenCheckMgr.cpp @@ -25,10 +25,8 @@ #include "WardenCheckMgr.h" #include "Warden.h" - WardenCheckMgr::WardenCheckMgr() { - InternalDataID = 1; } WardenCheckMgr::~WardenCheckMgr() @@ -50,17 +48,6 @@ void WardenCheckMgr::LoadWardenChecks() return; } - // For reload case - for (uint16 i = 0; i < CheckStore.size(); ++i) - delete CheckStore[i]; - - CheckStore.clear(); - - for (CheckResultContainer::iterator itr = CheckResultStore.begin(); itr != CheckResultStore.end(); ++itr) - delete itr->second; - CheckResultStore.clear(); - - QueryResult result = WorldDatabase.Query("SELECT MAX(id) FROM warden_checks"); if (!result) @@ -72,17 +59,17 @@ void WardenCheckMgr::LoadWardenChecks() Field* fields = result->Fetch(); - uint32 maxCheckId = fields[0].GetUInt32(); + uint16 maxCheckId = fields[0].GetUInt16(); CheckStore.resize(maxCheckId + 1); - // 0 1 2 3 4 5 6 - result = WorldDatabase.Query("SELECT id, type, data, result, address, length, str FROM warden_checks ORDER BY id ASC"); + // 0 1 2 3 4 5 6 7 + result = WorldDatabase.Query("SELECT id, type, data, result, address, length, str, comment FROM warden_checks ORDER BY id ASC"); uint32 count = 0; do { - Field* fields = result->Fetch(); + fields = result->Fetch(); uint16 id = fields[0].GetUInt16(); uint8 checkType = fields[1].GetUInt8(); @@ -91,9 +78,11 @@ void WardenCheckMgr::LoadWardenChecks() uint32 address = fields[4].GetUInt32(); uint8 length = fields[5].GetUInt8(); std::string str = fields[6].GetString(); + std::string comment = fields[7].GetString(); WardenCheck* wardenCheck = new WardenCheck(); wardenCheck->Type = checkType; + wardenCheck->CheckId = id; // Initialize action with default action from config wardenCheck->Action = WardenActions(sWorld->getIntConfig(CONFIG_WARDEN_CLIENT_FAIL_ACTION)); @@ -147,35 +136,57 @@ void WardenCheckMgr::LoadWardenChecks() CheckResultStore[id] = wr; } + if (comment.empty()) + wardenCheck->Comment = "Undocumented Check"; + else + wardenCheck->Comment = comment; + ++count; } while (result->NextRow()); - // Fetch overrides from char db and overwrite default action in CheckStore - QueryResult overrideResult = CharacterDatabase.Query("SELECT wardenId, action FROM warden_action"); + sLog->outString(">> Loaded %u warden checks.", count); + sLog->outString(); +} - uint32 overrideCount = 0; +void WardenCheckMgr::LoadWardenOverrides() +{ + // 0 1 + QueryResult result = CharacterDatabase.Query("SELECT wardenId, action FROM warden_action"); - if(overrideResult) + if (!result) { - do - { - Field * fields = overrideResult->Fetch(); + sLog->outString(">> Loaded 0 Warden action overrides. DB table `warden_action` is empty!"); + sLog->outString(); + return; + } + + uint32 count = 0; - uint16 checkId = fields[0].GetUInt16(); + ACE_WRITE_GUARD(ACE_RW_Mutex, g, _checkStoreLock); - // Check if override check ID actually exists in current Warden checks - if (checkId > maxCheckId) - sLog->outError("Warden check action override for invalid check (ID: %u, action: %u), skipped", checkId, fields[1].GetUInt8()); - else - CheckStore[fields[0].GetUInt16()]->Action = WardenActions(fields[1].GetUInt8()); + do + { + Field* fields = result->Fetch(); + + uint16 checkId = fields[0].GetUInt16(); + uint8 action = fields[1].GetUInt8(); - ++overrideCount; + // Check if action value is in range (0-2, see WardenActions enum) + if (action > WARDEN_ACTION_BAN) + sLog->outError("Warden check override action out of range (ID: %u, action: %u)", checkId, action); + // Check if check actually exists before accessing the CheckStore vector + else if (checkId > CheckStore.size()) + sLog->outError("Warden check action override for non-existing check (ID: %u, action: %u), skipped", checkId, action); + else + { + CheckStore[checkId]->Action = WardenActions(action); + ++count; } - while (overrideResult->NextRow()); } + while (result->NextRow()); - sLog->outString(">> Loaded %u warden checks and %u action overrides.", count, overrideCount); + sLog->outString(">> Loaded %u warden action overrides.", count); sLog->outString(); } diff --git a/src/server/game/Warden/WardenCheckMgr.h b/src/server/game/Warden/WardenCheckMgr.h index cbe8460db3b..7a83d8f0c6d 100644 --- a/src/server/game/Warden/WardenCheckMgr.h +++ b/src/server/game/Warden/WardenCheckMgr.h @@ -36,6 +36,8 @@ struct WardenCheck uint32 Address; // PROC_CHECK, MEM_CHECK, PAGE_CHECK uint8 Length; // PROC_CHECK, MEM_CHECK, PAGE_CHECK std::string Str; // LUA, MPQ, DRIVER + std::string Comment; + uint16 CheckId; enum WardenActions Action; }; @@ -58,11 +60,13 @@ class WardenCheckMgr WardenCheck* GetWardenDataById(uint16 Id); WardenCheckResult* GetWardenResultById(uint16 Id); - uint32 InternalDataID; std::vector MemChecksIdPool; std::vector OtherChecksIdPool; void LoadWardenChecks(); + void LoadWardenOverrides(); + + ACE_RW_Mutex _checkStoreLock; private: CheckContainer CheckStore; diff --git a/src/server/game/Warden/WardenMac.cpp b/src/server/game/Warden/WardenMac.cpp index f62aa11a339..a60ae765013 100644 --- a/src/server/game/Warden/WardenMac.cpp +++ b/src/server/game/Warden/WardenMac.cpp @@ -122,7 +122,7 @@ void WardenMac::HandleHashResult(ByteBuffer &buff) uint8 mod_seed[16] = { 0x4D, 0x80, 0x8D, 0x2C, 0x77, 0xD9, 0x05, 0xC4, 0x1A, 0x63, 0x80, 0xEC, 0x08, 0x58, 0x6A, 0xFE }; - for(int i = 0; i < 4; ++i) + for (int i = 0; i < 4; ++i) { keyIn[i] = *(int*)(&mod_seed[0] + i * 4); } diff --git a/src/server/game/Warden/WardenWin.cpp b/src/server/game/Warden/WardenWin.cpp index a77c77a3261..a7485d7da51 100644 --- a/src/server/game/Warden/WardenWin.cpp +++ b/src/server/game/Warden/WardenWin.cpp @@ -49,16 +49,8 @@ void WardenWin::Init(WorldSession* session, BigNumber *k) SHA1Randx WK(k->AsByteArray(), k->GetNumBytes()); WK.generate(_inputKey, 16); WK.generate(_outputKey, 16); - /* - Seed: 4D808D2C77D905C41A6380EC08586AFE (0x05 packet) - Hash: 568C054C781A972A6037A2290C22B52571A06F4E (0x04 packet) - Module MD5: 79C0768D657977D697E10BAD956CCED1 - New Client Key: 7F 96 EE FD A5 B6 3D 20 A4 DF 8E 00 CB F4 83 04 - New Cerver Key: C2 B7 AD ED FC CC A9 C2 BF B3 F8 56 02 BA 80 9B - */ - uint8 mod_seed[16] = { 0x4D, 0x80, 0x8D, 0x2C, 0x77, 0xD9, 0x05, 0xC4, 0x1A, 0x63, 0x80, 0xEC, 0x08, 0x58, 0x6A, 0xFE }; - memcpy(_seed, mod_seed, 16); + memcpy(_seed, Module.Seed, 16); _inputCrypto.Init(_inputKey); _outputCrypto.Init(_outputKey); @@ -79,13 +71,13 @@ ClientWardenModule* WardenWin::GetModuleForClient() { ClientWardenModule *mod = new ClientWardenModule; - uint32 length = sizeof(Module_79C0768D657977D697E10BAD956CCED1_Data); + uint32 length = sizeof(Module.Module); // data assign mod->CompressedSize = length; mod->CompressedData = new uint8[length]; - memcpy(mod->CompressedData, Module_79C0768D657977D697E10BAD956CCED1_Data, length); - memcpy(mod->Key, Module_79C0768D657977D697E10BAD956CCED1_Key, 16); + memcpy(mod->CompressedData, Module.Module, length); + memcpy(mod->Key, Module.ModuleKey, 16); // md5 hash MD5_CTX ctx; @@ -104,7 +96,6 @@ void WardenWin::InitializeModule() WardenInitModuleRequest Request; Request.Command1 = WARDEN_SMSG_MODULE_INITIALIZE; Request.Size1 = 20; - Request.CheckSumm1 = BuildChecksum(&Request.Unk1, 20); Request.Unk1 = 1; Request.Unk2 = 0; Request.Type = 1; @@ -113,24 +104,25 @@ void WardenWin::InitializeModule() Request.Function1[1] = 0x000218C0; // 0x00400000 + 0x000218C0 SFileGetFileSize Request.Function1[2] = 0x00022530; // 0x00400000 + 0x00022530 SFileReadFile Request.Function1[3] = 0x00022910; // 0x00400000 + 0x00022910 SFileCloseFile + Request.CheckSumm1 = BuildChecksum(&Request.Unk1, 20); Request.Command2 = WARDEN_SMSG_MODULE_INITIALIZE; Request.Size2 = 8; - Request.CheckSumm2 = BuildChecksum(&Request.Unk2, 8); Request.Unk3 = 4; Request.Unk4 = 0; Request.String_library2 = 0; Request.Function2 = 0x00419D40; // 0x00400000 + 0x00419D40 FrameScript::GetText Request.Function2_set = 1; + Request.CheckSumm2 = BuildChecksum(&Request.Unk2, 8); Request.Command3 = WARDEN_SMSG_MODULE_INITIALIZE; Request.Size3 = 8; - Request.CheckSumm3 = BuildChecksum(&Request.Unk5, 8); Request.Unk5 = 1; Request.Unk6 = 1; Request.String_library3 = 0; Request.Function3 = 0x0046AE20; // 0x00400000 + 0x0046AE20 PerformanceCounter Request.Function3_set = 1; + Request.CheckSumm3 = BuildChecksum(&Request.Unk5, 8); // Encrypt with warden RC4 key. EncryptData((uint8*)&Request, sizeof(WardenInitModuleRequest)); @@ -161,10 +153,8 @@ void WardenWin::HandleHashResult(ByteBuffer &buff) { buff.rpos(buff.wpos()); - const uint8 validHash[20] = { 0x56, 0x8C, 0x05, 0x4C, 0x78, 0x1A, 0x97, 0x2A, 0x60, 0x37, 0xA2, 0x29, 0x0C, 0x22, 0xB5, 0x25, 0x71, 0xA0, 0x6F, 0x4E }; - // Verify key - if (memcmp(buff.contents() + 1, validHash, sizeof(validHash)) != 0) + if (memcmp(buff.contents() + 1, Module.ClientKeySeedHash, 20) != 0) { sLog->outDebug(LOG_FILTER_WARDEN, "Request hash reply: failed"); sLog->outWarden("WARDEN: Player %s (guid: %u, account: %u) failed hash reply. Action: %s", @@ -174,15 +164,9 @@ void WardenWin::HandleHashResult(ByteBuffer &buff) sLog->outDebug(LOG_FILTER_WARDEN, "Request hash reply: succeed"); - // Client 7F96EEFDA5B63D20A4DF8E00CBF48304 - const uint8 client_key[16] = { 0x7F, 0x96, 0xEE, 0xFD, 0xA5, 0xB6, 0x3D, 0x20, 0xA4, 0xDF, 0x8E, 0x00, 0xCB, 0xF4, 0x83, 0x04 }; - - // Server C2B7ADEDFCCCA9C2BFB3F85602BA809B - const uint8 server_key[16] = { 0xC2, 0xB7, 0xAD, 0xED, 0xFC, 0xCC, 0xA9, 0xC2, 0xBF, 0xB3, 0xF8, 0x56, 0x02, 0xBA, 0x80, 0x9B }; - // Change keys here - memcpy(_inputKey, client_key, 16); - memcpy(_outputKey, server_key, 16); + memcpy(_inputKey, Module.ClientKeySeed, 16); + memcpy(_outputKey, Module.ServerKeySeed, 16); _inputCrypto.Init(_inputKey); _outputCrypto.Init(_outputKey); @@ -228,6 +212,8 @@ void WardenWin::RequestData() ByteBuffer buff; buff << uint8(WARDEN_SMSG_CHEAT_CHECKS_REQUEST); + ACE_READ_GUARD(ACE_RW_Mutex, g, sWardenCheckMgr->_checkStoreLock); + for (uint32 i = 0; i < sWorld->getIntConfig(CONFIG_WARDEN_NUM_OTHER_CHECKS); ++i) { // If todo list is done break loop (will be filled on next Update() run) @@ -339,7 +325,7 @@ void WardenWin::RequestData() for (std::list::iterator itr = _currentChecks.begin(); itr != _currentChecks.end(); ++itr) stream << *itr << " "; - sLog->outWarden("%s", stream.str().c_str()); + sLog->outDebug(LOG_FILTER_WARDEN, "%s", stream.str().c_str()); } void WardenWin::HandleData(ByteBuffer &buff) @@ -393,6 +379,8 @@ void WardenWin::HandleData(ByteBuffer &buff) uint8 type; uint16 checkFailed = 0; + ACE_READ_GUARD(ACE_RW_Mutex, g, sWardenCheckMgr->_checkStoreLock); + for (std::list::iterator itr = _currentChecks.begin(); itr != _currentChecks.end(); ++itr) { rd = sWardenCheckMgr->GetWardenDataById(*itr); diff --git a/src/server/game/Weather/Weather.cpp b/src/server/game/Weather/Weather.cpp index 2a48ede4c81..965e6bf3805 100755 --- a/src/server/game/Weather/Weather.cpp +++ b/src/server/game/Weather/Weather.cpp @@ -147,7 +147,7 @@ bool Weather::ReGenerate() } // At this point, only weather that isn't doing anything remains but that have weather data - uint32 chance1 = m_weatherChances->data[season].rainChance; + uint32 chance1 = m_weatherChances->data[season].rainChance; uint32 chance2 = chance1+ m_weatherChances->data[season].snowChance; uint32 chance3 = chance2+ m_weatherChances->data[season].stormChance; diff --git a/src/server/game/Weather/Weather.h b/src/server/game/Weather/Weather.h index 0c17cfd1efe..dadd1151a53 100755 --- a/src/server/game/Weather/Weather.h +++ b/src/server/game/Weather/Weather.h @@ -89,4 +89,3 @@ class Weather WeatherData const* m_weatherChances; }; #endif - diff --git a/src/server/game/Weather/WeatherMgr.cpp b/src/server/game/Weather/WeatherMgr.cpp index 731aba8d197..bb8fadf08bc 100755 --- a/src/server/game/Weather/WeatherMgr.cpp +++ b/src/server/game/Weather/WeatherMgr.cpp @@ -24,14 +24,14 @@ #include "Weather.h" #include "Log.h" #include "ObjectMgr.h" -#include +#include "AutoPtr.h" namespace WeatherMgr { namespace { - typedef UNORDERED_MAP > WeatherMap; + typedef UNORDERED_MAP > WeatherMap; typedef UNORDERED_MAP WeatherZoneMap; WeatherMap m_weathers; @@ -108,9 +108,9 @@ void LoadWeatherData() for (uint8 season = 0; season < WEATHER_SEASONS; ++season) { - wzc.data[season].rainChance = fields[season * (MAX_WEATHER_TYPE-1) + 1].GetUInt32(); - wzc.data[season].snowChance = fields[season * (MAX_WEATHER_TYPE-1) + 2].GetUInt32(); - wzc.data[season].stormChance = fields[season * (MAX_WEATHER_TYPE-1) + 3].GetUInt32(); + wzc.data[season].rainChance = fields[season * (MAX_WEATHER_TYPE-1) + 1].GetUInt8(); + wzc.data[season].snowChance = fields[season * (MAX_WEATHER_TYPE-1) + 2].GetUInt8(); + wzc.data[season].stormChance = fields[season * (MAX_WEATHER_TYPE-1) + 3].GetUInt8(); if (wzc.data[season].rainChance > 100) { diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 45b1c4dac64..b5c0e13c425 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -77,8 +77,9 @@ #include "Channel.h" #include "WardenCheckMgr.h" #include "Warden.h" +#include "CalendarMgr.h" -volatile bool World::m_stopEvent = false; +ACE_Atomic_Op World::m_stopEvent = false; uint8 World::m_ExitCode = SHUTDOWN_EXIT_CODE; volatile uint32 World::m_worldLoopCounter = 0; @@ -207,6 +208,7 @@ bool World::RemoveSession(uint32 id) { if (itr->second->PlayerLoading()) return false; + itr->second->KickPlayer(); } @@ -218,8 +220,7 @@ void World::AddSession(WorldSession* s) addSessQueue.add(s); } -void -World::AddSession_(WorldSession* s) +void World::AddSession_(WorldSession* s) { ASSERT (s); @@ -267,16 +268,13 @@ World::AddSession_(WorldSession* s) { AddQueuedPlayer (s); UpdateMaxSessionCounters(); - sLog->outDetail ("PlayerQueue: Account id %u is in Queue Position (%u).", s->GetAccountId(), ++QueueSize); + sLog->outDetail("PlayerQueue: Account id %u is in Queue Position (%u).", s->GetAccountId(), ++QueueSize); return; } s->SendAuthResponse(AUTH_OK, true); - s->SendAddonsInfo(); - s->SendClientCacheVersion(sWorld->getIntConfig(CONFIG_CLIENTCACHE_VERSION)); - s->SendTutorialsData(); UpdateMaxSessionCounters(); @@ -287,7 +285,7 @@ World::AddSession_(WorldSession* s) float popu = (float)GetActiveSessionCount(); // updated number of users on the server popu /= pLimit; popu *= 2; - sLog->outDetail ("Server Population (%f).", popu); + sLog->outDetail("Server Population (%f).", popu); } } @@ -1203,7 +1201,9 @@ void World::LoadConfigSettings(bool reload) m_bool_configs[CONFIG_PDUMP_NO_PATHS] = ConfigMgr::GetBoolDefault("PlayerDump.DisallowPaths", true); m_bool_configs[CONFIG_PDUMP_NO_OVERWRITE] = ConfigMgr::GetBoolDefault("PlayerDump.DisallowOverwrite", true); - sScriptMgr->OnConfigLoad(reload); + // call ScriptMgr if we're reloading the configuration + if (reload) + sScriptMgr->OnConfigLoad(reload); } extern void LoadGameObjectModelList(); @@ -1279,6 +1279,9 @@ void World::SetInitialWorldSettings() sLog->outString("Loading SpellInfo store..."); sSpellMgr->LoadSpellInfoStore(); + sLog->outString("Loading SkillLineAbilityMultiMap Data..."); + sSpellMgr->LoadSkillLineAbilityMap(); + sLog->outString("Loading spell custom attributes..."); sSpellMgr->LoadSpellCustomAttr(); @@ -1291,9 +1294,6 @@ void World::SetInitialWorldSettings() sLog->outString("Loading Instance Template..."); sObjectMgr->LoadInstanceTemplate(); - sLog->outString("Loading SkillLineAbilityMultiMap Data..."); - sSpellMgr->LoadSkillLineAbilityMap(); - // Must be called before `creature_respawn`/`gameobject_respawn` tables sLog->outString("Loading instances..."); sInstanceSaveMgr->LoadInstances(); @@ -1591,7 +1591,7 @@ void World::SetInitialWorldSettings() sSmartWaypointMgr->LoadFromDB(); sLog->outString("Loading Creature Formations..."); - FormationMgr::LoadCreatureFormations(); + sFormationMgr->LoadCreatureFormations(); sLog->outString("Loading World States..."); // must be loaded before battleground, outdoor PvP and conditions LoadWorldStates(); @@ -1653,8 +1653,12 @@ void World::SetInitialWorldSettings() sLog->outString("Loading Creature Texts..."); sCreatureTextMgr->LoadCreatureTexts(); + sLog->outString("Loading Creature Text Locales..."); + sCreatureTextMgr->LoadCreatureTextLocales(); + sLog->outString("Initializing Scripts..."); sScriptMgr->Initialize(); + sScriptMgr->OnConfigLoad(false); // must be done after the ScriptMgr has been properly initialized sLog->outString("Validating spell scripts..."); sObjectMgr->ValidateSpellScripts(); @@ -1662,21 +1666,16 @@ void World::SetInitialWorldSettings() sLog->outString("Loading SmartAI scripts..."); sSmartScriptMgr->LoadSmartAIFromDB(); + sLog->outString("Loading Calendar data..."); + sCalendarMgr->LoadFromDB(); + ///- Initialize game time and timers sLog->outString("Initialize game time and timers"); m_gameTime = time(NULL); - m_startTime=m_gameTime; - - tm local; - time_t curr; - time(&curr); - local=*(localtime(&curr)); // dereference and assign - char isoDate[128]; - sprintf(isoDate, "%04d-%02d-%02d %02d:%02d:%02d", - local.tm_year+1900, local.tm_mon+1, local.tm_mday, local.tm_hour, local.tm_min, local.tm_sec); + m_startTime = m_gameTime; - LoginDatabase.PExecute("INSERT INTO uptime (realmid, starttime, startstring, uptime, revision) VALUES('%u', " UI64FMTD ", '%s', 0, '%s')", - realmID, uint64(m_startTime), isoDate, _FULLVERSION); // One-time query + LoginDatabase.PExecute("INSERT INTO uptime (realmid, starttime, uptime, revision) VALUES(%u, %u, 0, '%s')", + realmID, uint32(m_startTime), _FULLVERSION); // One-time query m_timers[WUPDATE_WEATHERS].SetInterval(1*IN_MILLISECONDS); m_timers[WUPDATE_AUCTIONS].SetInterval(MINUTE*IN_MILLISECONDS); @@ -1742,8 +1741,11 @@ void World::SetInitialWorldSettings() sLog->outString("Loading Warden Checks..." ); sWardenCheckMgr->LoadWardenChecks(); + sLog->outString("Loading Warden Action Overrides..." ); + sWardenCheckMgr->LoadWardenOverrides(); + sLog->outString("Deleting expired bans..."); - LoginDatabase.Execute("DELETE FROM ip_banned WHERE unbandate <= UNIX_TIMESTAMP() AND unbandate<>bandate"); + LoginDatabase.Execute("DELETE FROM ip_banned WHERE unbandate <= UNIX_TIMESTAMP() AND unbandate<>bandate"); // One-time query sLog->outString("Calculate next daily quest reset time..."); InitDailyQuestResetTime(); @@ -1774,7 +1776,7 @@ void World::SetInitialWorldSettings() uint32 startupDuration = GetMSTimeDiffToNow(startupBegin); sLog->outString(); - sLog->outString("WORLD: World initialized in %u minutes %u seconds", (startupDuration / 60000), ((startupDuration % 60000) / 1000) ); + sLog->outString("WORLD: World initialized in %u minutes %u seconds", (startupDuration / 60000), ((startupDuration % 60000) / 1000)); sLog->outString(); } @@ -1964,10 +1966,10 @@ void World::Update(uint32 diff) PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_UPTIME_PLAYERS); - stmt->setUInt64(0, uint64(tmpDiff)); + stmt->setUInt32(0, tmpDiff); stmt->setUInt16(1, uint16(maxOnlinePlayers)); stmt->setUInt32(2, realmID); - stmt->setUInt64(3, uint64(m_startTime)); + stmt->setUInt32(3, uint32(m_startTime)); LoginDatabase.Execute(stmt); } @@ -2313,7 +2315,7 @@ BanReturn World::BanAccount(BanMode mode, std::string nameOrIP, std::string dura do { Field* fieldsAccount = resultAccounts->Fetch(); - uint32 account = fieldsAccount->GetUInt32(); + uint32 account = fieldsAccount[0].GetUInt32(); if (mode != BAN_IP) { @@ -2449,7 +2451,7 @@ void World::_UpdateGameTime() m_gameTime = thisTime; ///- if there is a shutdown timer - if (!m_stopEvent && m_ShutdownTimer > 0 && elapsed > 0) + if (!IsStopped() && m_ShutdownTimer > 0 && elapsed > 0) { ///- ... and it is overdue, stop the world (set m_stopEvent) if (m_ShutdownTimer <= elapsed) @@ -2473,7 +2475,7 @@ void World::_UpdateGameTime() void World::ShutdownServ(uint32 time, uint32 options, uint8 exitcode) { // ignore if server shutdown at next tick - if (m_stopEvent) + if (IsStopped()) return; m_ShutdownMask = options; @@ -2525,7 +2527,7 @@ void World::ShutdownMsg(bool show, Player* player) void World::ShutdownCancel() { // nothing cancel or too later - if (!m_ShutdownTimer || m_stopEvent) + if (!m_ShutdownTimer || m_stopEvent.value()) return; ServerMessageType msgid = (m_ShutdownMask & SHUTDOWN_MASK_RESTART) ? SERVER_MSG_RESTART_CANCELLED : SERVER_MSG_SHUTDOWN_CANCELLED; @@ -2609,7 +2611,7 @@ void World::SendAutoBroadcast() std::string msg; - msg = SelectRandomContainerElement(m_Autobroadcasts); + msg = Trinity::Containers::SelectRandomContainerElement(m_Autobroadcasts); uint32 abcenter = sWorld->getIntConfig(CONFIG_AUTOBROADCAST_CENTER); @@ -2649,15 +2651,15 @@ void World::_UpdateRealmCharCount(PreparedQueryResult resultCharCount) { Field* fields = resultCharCount->Fetch(); uint32 accountId = fields[0].GetUInt32(); - uint32 charCount = fields[1].GetUInt32(); + uint8 charCount = uint8(fields[1].GetUInt64()); - PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_REALM_CHARACTERS); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_REALM_CHARACTERS_BY_REALM); stmt->setUInt32(0, accountId); stmt->setUInt32(1, realmID); LoginDatabase.Execute(stmt); stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_REALM_CHARACTERS); - stmt->setUInt32(0, charCount); + stmt->setUInt8(0, charCount); stmt->setUInt32(1, accountId); stmt->setUInt32(2, realmID); LoginDatabase.Execute(stmt); @@ -2749,9 +2751,12 @@ void World::ResetDailyQuests() void World::LoadDBAllowedSecurityLevel() { - QueryResult result = LoginDatabase.PQuery("SELECT allowedSecurityLevel from realmlist WHERE id = '%d'", realmID); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_REALMLIST_SECURITY_LEVEL); + stmt->setInt32(0, int32(realmID)); + PreparedQueryResult result = LoginDatabase.Query(stmt); + if (result) - SetPlayerSecurityLimit(AccountTypes(result->Fetch()->GetUInt16())); + SetPlayerSecurityLimit(AccountTypes(result->Fetch()->GetUInt8())); } void World::SetPlayerSecurityLimit(AccountTypes _sec) @@ -2930,7 +2935,7 @@ void World::LoadCharacterNameData() { sLog->outString("Loading character name data"); - QueryResult result = CharacterDatabase.Query("SELECT guid, name, race, gender, class FROM characters"); + QueryResult result = CharacterDatabase.Query("SELECT guid, name, race, gender, class FROM characters WHERE deleteDate IS NULL"); if (!result) { sLog->outError("No character name data loaded, empty query"); @@ -2941,7 +2946,7 @@ void World::LoadCharacterNameData() do { - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); AddCharacterNameData(fields[0].GetUInt32(), fields[1].GetString(), fields[3].GetUInt8() /*gender*/, fields[2].GetUInt8() /*race*/, fields[4].GetUInt8() /*class*/); ++count; diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h index 6304699e7e1..51f384770da 100755 --- a/src/server/game/World/World.h +++ b/src/server/game/World/World.h @@ -26,6 +26,7 @@ #include "Common.h" #include "Timer.h" #include +#include #include "SharedDefines.h" #include "QueryResult.h" #include "Callback.h" @@ -660,7 +661,7 @@ class World void ShutdownMsg(bool show = false, Player* player = NULL); static uint8 GetExitCode() { return m_ExitCode; } static void StopNow(uint8 exitcode) { m_stopEvent = true; m_ExitCode = exitcode; } - static bool IsStopped() { return m_stopEvent; } + static bool IsStopped() { return m_stopEvent.value(); } void Update(uint32 diff); @@ -778,7 +779,7 @@ class World void ResetWeeklyQuests(); void ResetRandomBG(); private: - static volatile bool m_stopEvent; + static ACE_Atomic_Op m_stopEvent; static uint8 m_ExitCode; uint32 m_ShutdownTimer; uint32 m_ShutdownMask; diff --git a/src/server/scripts/CMakeLists.txt b/src/server/scripts/CMakeLists.txt index 62336e95ff6..792fdeb3e7b 100644 --- a/src/server/scripts/CMakeLists.txt +++ b/src/server/scripts/CMakeLists.txt @@ -34,7 +34,6 @@ set(scripts_STAT_SRCS ../game/AI/ScriptedAI/ScriptedEscortAI.cpp ../game/AI/ScriptedAI/ScriptedCreature.cpp ../game/AI/ScriptedAI/ScriptedFollowerAI.cpp - ../game/AI/ScriptedAI/ScriptedSimpleAI.cpp ) if(SCRIPTS) @@ -54,7 +53,6 @@ include_directories( ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/dep/g3dlite/include ${CMAKE_SOURCE_DIR}/dep/SFMT - ${CMAKE_SOURCE_DIR}/dep/mersennetwister ${CMAKE_SOURCE_DIR}/dep/zlib ${CMAKE_SOURCE_DIR}/src/server/shared ${CMAKE_SOURCE_DIR}/src/server/shared/Configuration @@ -121,6 +119,7 @@ include_directories( ${CMAKE_SOURCE_DIR}/src/server/game/Maps ${CMAKE_SOURCE_DIR}/src/server/game/Movement ${CMAKE_SOURCE_DIR}/src/server/game/Movement/MovementGenerators + ${CMAKE_SOURCE_DIR}/src/server/game/Movement/Spline ${CMAKE_SOURCE_DIR}/src/server/game/Movement/Waypoints ${CMAKE_SOURCE_DIR}/src/server/game/Opcodes ${CMAKE_SOURCE_DIR}/src/server/game/OutdoorPvP diff --git a/src/server/scripts/Commands/CMakeLists.txt b/src/server/scripts/Commands/CMakeLists.txt index b17350c265d..86fe984e197 100644 --- a/src/server/scripts/Commands/CMakeLists.txt +++ b/src/server/scripts/Commands/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2011 TrinityCore +# Copyright (C) 2008-2012 TrinityCore # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without @@ -17,7 +17,6 @@ set(scripts_STAT_SRCS Commands/cs_gm.cpp Commands/cs_go.cpp Commands/cs_gobject.cpp - Commands/cs_gps.cpp Commands/cs_honor.cpp Commands/cs_learn.cpp Commands/cs_misc.cpp diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp index 7372c92c4dd..b52102479b5 100644 --- a/src/server/scripts/Commands/cs_account.cpp +++ b/src/server/scripts/Commands/cs_account.cpp @@ -194,8 +194,11 @@ public: static bool HandleAccountOnlineListCommand(ChatHandler* handler, char const* /*args*/) { ///- Get the list of accounts ID logged to the realm - QueryResult resultDB = CharacterDatabase.Query("SELECT name, account, map, zone FROM characters WHERE online > 0"); - if (!resultDB) + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_ONLINE); + + PreparedQueryResult result = CharacterDatabase.Query(stmt); + + if (!result) { handler->SendSysMessage(LANG_ACCOUNT_LIST_EMPTY); return true; @@ -209,31 +212,28 @@ public: ///- Cycle through accounts do { - Field* fieldsDB = resultDB->Fetch(); + Field* fieldsDB = result->Fetch(); std::string name = fieldsDB[0].GetString(); uint32 account = fieldsDB[1].GetUInt32(); ///- Get the username, last IP and GM level of each account // No SQL injection. account is uint32. - QueryResult resultLogin = - LoginDatabase.PQuery("SELECT a.username, a.last_ip, aa.gmlevel, a.expansion " - "FROM account a " - "LEFT JOIN account_access aa " - "ON (a.id = aa.id) " - "WHERE a.id = '%u'", account); + stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_INFO); + stmt->setUInt32(0, account); + PreparedQueryResult resultLogin = LoginDatabase.Query(stmt); if (resultLogin) { Field* fieldsLogin = resultLogin->Fetch(); handler->PSendSysMessage(LANG_ACCOUNT_LIST_LINE, fieldsLogin[0].GetCString(), name.c_str(), fieldsLogin[1].GetCString(), - fieldsDB[2].GetUInt16(), fieldsDB[3].GetUInt16(), fieldsLogin[3].GetUInt32(), - fieldsLogin[2].GetUInt32()); + fieldsDB[2].GetUInt16(), fieldsDB[3].GetUInt16(), fieldsLogin[3].GetUInt8(), + fieldsLogin[2].GetUInt8()); } else handler->PSendSysMessage(LANG_ACCOUNT_LIST_ERROR, name.c_str()); - } while (resultDB->NextRow()); + } while (result->NextRow()); handler->SendSysMessage(LANG_ACCOUNT_LIST_BAR); return true; @@ -382,7 +382,7 @@ public: // Let set addon state only for lesser (strong) security level // or to self account - if (handler->GetSession() && handler->GetSession()->GetAccountId () != accountId && + if (handler->GetSession() && handler->GetSession()->GetAccountId() != accountId && handler->HasLowerSecurityAccount(NULL, accountId, true)) return false; @@ -469,7 +469,13 @@ public: // Check and abort if the target gm has a higher rank on one of the realms and the new realm is -1 if (gmRealmID == -1 && !AccountMgr::IsConsoleAccount(playerSecurity)) { - QueryResult result = LoginDatabase.PQuery("SELECT * FROM account_access WHERE id = '%u' AND gmlevel > '%d'", targetAccountId, gm); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_ACCESS_GMLEVEL_TEST); + + stmt->setUInt32(0, targetAccountId); + stmt->setUInt8(1, uint8(gm)); + + PreparedQueryResult result = LoginDatabase.Query(stmt); + if (result) { handler->SendSysMessage(LANG_YOURS_SECURITY_IS_LOW); @@ -502,11 +508,12 @@ public: stmt->setUInt32(0, targetAccountId); stmt->setUInt32(1, realmID); } + LoginDatabase.Execute(stmt); if (gm != 0) { - PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_ACCOUNT_ACCESS); + stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_ACCOUNT_ACCESS); stmt->setUInt32(0, targetAccountId); stmt->setUInt8(1, uint8(gm)); diff --git a/src/server/scripts/Commands/cs_achievement.cpp b/src/server/scripts/Commands/cs_achievement.cpp index f136cba46ab..7667e79ece7 100644 --- a/src/server/scripts/Commands/cs_achievement.cpp +++ b/src/server/scripts/Commands/cs_achievement.cpp @@ -67,7 +67,7 @@ public: return false; } - if (AchievementEntry const* achievementEntry = GetAchievementStore()->LookupEntry(achievementId)) + if (AchievementEntry const* achievementEntry = sAchievementStore.LookupEntry(achievementId)) target->CompletedAchievement(achievementEntry); return true; diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index 4c4869c1c5b..6accc96260b 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -46,7 +46,7 @@ public: { "cinematic", SEC_MODERATOR, false, &HandleDebugPlayCinematicCommand, "", NULL }, { "movie", SEC_MODERATOR, false, &HandleDebugPlayMovieCommand, "", NULL }, { "sound", SEC_MODERATOR, false, &HandleDebugPlaySoundCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } + { NULL, SEC_PLAYER, false, NULL, "", NULL } }; static ChatCommand debugSendCommandTable[] = { @@ -61,7 +61,7 @@ public: { "sellerror", SEC_ADMINISTRATOR, false, &HandleDebugSendSellErrorCommand, "", NULL }, { "setphaseshift", SEC_ADMINISTRATOR, false, &HandleDebugSendSetPhaseShiftCommand, "", NULL }, { "spellfail", SEC_ADMINISTRATOR, false, &HandleDebugSendSpellFailCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } + { NULL, SEC_PLAYER, false, NULL, "", NULL } }; static ChatCommand debugCommandTable[] = { @@ -89,12 +89,14 @@ public: { "itemexpire", SEC_ADMINISTRATOR, false, &HandleDebugItemExpireCommand, "", NULL }, { "areatriggers", SEC_ADMINISTRATOR, false, &HandleDebugAreaTriggersCommand, "", NULL }, { "los", SEC_MODERATOR, false, &HandleDebugLoSCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } + { "moveflags", SEC_ADMINISTRATOR, false, &HandleDebugMoveflagsCommand, "", NULL }, + { NULL, SEC_PLAYER, false, NULL, "", NULL } }; static ChatCommand commandTable[] = { { "debug", SEC_MODERATOR, true, NULL, "", debugCommandTable }, - { NULL, 0, false, NULL, "", NULL } + { "wpgps", SEC_ADMINISTRATOR, false, &HandleWPGPSCommand, "", NULL }, + { NULL, SEC_PLAYER, false, NULL, "", NULL } }; return commandTable; } @@ -1197,7 +1199,7 @@ public: int currentValue = (int)handler->GetSession()->GetPlayer()->GetUInt32Value(opcode); currentValue += value; - handler->GetSession()->GetPlayer()->SetUInt32Value(opcode , (uint32)currentValue); + handler->GetSession()->GetPlayer()->SetUInt32Value(opcode, (uint32)currentValue); handler->PSendSysMessage(LANG_CHANGE_32BIT_FIELD, opcode, currentValue); @@ -1283,6 +1285,51 @@ public: handler->PSendSysMessage(LANG_SET_32BIT_FIELD, opcode, value); return true; } + + static bool HandleDebugMoveflagsCommand(ChatHandler* handler, char const* args) + { + Unit* target = handler->getSelectedUnit(); + if (!target) + target = handler->GetSession()->GetPlayer(); + + if (!*args) + { + //! Display case + handler->PSendSysMessage(LANG_MOVEFLAGS_GET, target->GetUnitMovementFlags(), target->GetExtraUnitMovementFlags()); + } + else + { + char* mask1 = strtok((char*)args, " "); + if (!mask1) + return false; + + char* mask2 = strtok(NULL, " \n"); + + uint32 moveFlags = (uint32)atoi(mask1); + target->SetUnitMovementFlags(moveFlags); + + if (mask2) + { + uint32 moveFlagsExtra = uint32(atoi(mask2)); + target->SetExtraUnitMovementFlags(moveFlagsExtra); + } + + target->SendMovementFlagUpdate(); + handler->PSendSysMessage(LANG_MOVEFLAGS_SET, target->GetUnitMovementFlags(), target->GetExtraUnitMovementFlags()); + } + + return true; + } + + static bool HandleWPGPSCommand(ChatHandler* handler, char const* /*args*/) + { + Player* player = handler->GetSession()->GetPlayer(); + + sLog->outSQLDev("(@PATH, XX, %.3f, %.3f, %.5f, 0,0, 0,100, 0),", player->GetPositionX(), player->GetPositionY(), player->GetPositionZ()); + + handler->PSendSysMessage("Waypoint SQL written to SQL Developer log"); + return true; + } }; void AddSC_debug_commandscript() diff --git a/src/server/scripts/Commands/cs_gm.cpp b/src/server/scripts/Commands/cs_gm.cpp index 0dcb6995cb1..ba5a7f10d7d 100644 --- a/src/server/scripts/Commands/cs_gm.cpp +++ b/src/server/scripts/Commands/cs_gm.cpp @@ -153,7 +153,11 @@ public: static bool HandleGMListFullCommand(ChatHandler* handler, char const* /*args*/) { ///- Get the accounts with GM Level >0 - QueryResult result = LoginDatabase.PQuery("SELECT a.username, aa.gmlevel FROM account a, account_access aa WHERE a.id=aa.id AND aa.gmlevel >= %u AND (aa.realmid = -1 OR aa.realmid = %u)", SEC_MODERATOR, realmID); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_GM_ACCOUNTS); + stmt->setUInt8(0, uint8(SEC_MODERATOR)); + stmt->setInt32(1, int32(realmID)); + PreparedQueryResult result = LoginDatabase.Query(stmt); + if (result) { handler->SendSysMessage(LANG_GMLIST); diff --git a/src/server/scripts/Commands/cs_gobject.cpp b/src/server/scripts/Commands/cs_gobject.cpp index 74b8272201b..232aad9f21c 100644 --- a/src/server/scripts/Commands/cs_gobject.cpp +++ b/src/server/scripts/Commands/cs_gobject.cpp @@ -535,11 +535,17 @@ public: uint32 count = 0; Player* player = handler->GetSession()->GetPlayer(); - QueryResult result = WorldDatabase.PQuery("SELECT guid, id, position_x, position_y, position_z, map, " - "(POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) AS order_ " - "FROM gameobject WHERE map='%u' AND (POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) <= '%f' ORDER BY order_", - player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), - player->GetMapId(), player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), distance * distance); + + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_GAMEOBJECT_NEAREST); + stmt->setFloat(0, player->GetPositionX()); + stmt->setFloat(1, player->GetPositionY()); + stmt->setFloat(2, player->GetPositionZ()); + stmt->setUInt32(3, player->GetMapId()); + stmt->setFloat(4, player->GetPositionX()); + stmt->setFloat(5, player->GetPositionY()); + stmt->setFloat(6, player->GetPositionZ()); + stmt->setFloat(7, distance * distance); + PreparedQueryResult result = WorldDatabase.Query(stmt); if (result) { diff --git a/src/server/scripts/Commands/cs_gps.cpp b/src/server/scripts/Commands/cs_gps.cpp deleted file mode 100644 index 12a5efddf47..00000000000 --- a/src/server/scripts/Commands/cs_gps.cpp +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright (C) 2008-2012 TrinityCore - * - * 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; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; 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, see . - */ - -/* ScriptData -Name: gps_commandscript -%Complete: 100 -Comment: GPS/WPGPS commands -Category: commandscripts -EndScriptData */ - -#include "ObjectAccessor.h" -#include "ScriptMgr.h" -#include "Chat.h" -#include "CellImpl.h" - -class gps_commandscript : public CommandScript -{ -public: - gps_commandscript() : CommandScript("gps_commandscript") { } - - ChatCommand* GetCommands() const - { - static ChatCommand commandTable[] = - { - { "gps", SEC_ADMINISTRATOR, false, &HandleGPSCommand, "", NULL }, - { "wpgps", SEC_ADMINISTRATOR, false, &HandleWPGPSCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } - }; - return commandTable; - } - - static bool HandleGPSCommand(ChatHandler* handler, char const* args) - { - WorldObject* object = NULL; - if (*args) - { - uint64 guid = handler->extractGuidFromLink((char*)args); - if (guid) - object = (WorldObject*)ObjectAccessor::GetObjectByTypeMask(*handler->GetSession()->GetPlayer(), guid, TYPEMASK_UNIT | TYPEMASK_GAMEOBJECT); - - if (!object) - { - handler->SendSysMessage(LANG_PLAYER_NOT_FOUND); - handler->SetSentErrorMessage(true); - return false; - } - } - else - { - object = handler->getSelectedUnit(); - - if (!object) - { - handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE); - handler->SetSentErrorMessage(true); - return false; - } - } - - CellCoord cellCoord = Trinity::ComputeCellCoord(object->GetPositionX(), object->GetPositionY()); - Cell cell(cellCoord); - - uint32 zoneId, areaId; - object->GetZoneAndAreaId(zoneId, areaId); - - MapEntry const* mapEntry = sMapStore.LookupEntry(object->GetMapId()); - AreaTableEntry const* zoneEntry = GetAreaEntryByAreaID(zoneId); - AreaTableEntry const* areaEntry = GetAreaEntryByAreaID(areaId); - - float zoneX = object->GetPositionX(); - float zoneY = object->GetPositionY(); - - Map2ZoneCoordinates(zoneX, zoneY, zoneId); - - Map const* map = object->GetMap(); - float groundZ = map->GetHeight(object->GetPhaseMask(), object->GetPositionX(), object->GetPositionY(), MAX_HEIGHT); - float floorZ = map->GetHeight(object->GetPhaseMask(), object->GetPositionX(), object->GetPositionY(), object->GetPositionZ()); - - GridCoord gridCoord = Trinity::ComputeGridCoord(object->GetPositionX(), object->GetPositionY()); - - // 63? WHY? - int gridX = 63 - gridCoord.x_coord; - int gridY = 63 - gridCoord.y_coord; - - uint32 haveMap = Map::ExistMap(object->GetMapId(), gridX, gridY) ? 1 : 0; - uint32 haveVMap = Map::ExistVMap(object->GetMapId(), gridX, gridY) ? 1 : 0; - - if (haveVMap) - { - if (map->IsOutdoors(object->GetPositionX(), object->GetPositionY(), object->GetPositionZ())) - handler->PSendSysMessage("You are outdoors"); - else - handler->PSendSysMessage("You are indoors"); - } - else - handler->PSendSysMessage("no VMAP available for area info"); - - handler->PSendSysMessage(LANG_MAP_POSITION, - object->GetMapId(), (mapEntry ? mapEntry->name : ""), - zoneId, (zoneEntry ? zoneEntry->area_name : ""), - areaId, (areaEntry ? areaEntry->area_name : ""), - object->GetPhaseMask(), - object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), object->GetOrientation(), - cell.GridX(), cell.GridY(), cell.CellX(), cell.CellY(), object->GetInstanceId(), - zoneX, zoneY, groundZ, floorZ, haveMap, haveVMap); - - LiquidData liquidStatus; - ZLiquidStatus status = map->getLiquidStatus(object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), MAP_ALL_LIQUIDS, &liquidStatus); - - if (status) - handler->PSendSysMessage(LANG_LIQUID_STATUS, liquidStatus.level, liquidStatus.depth_level, liquidStatus.type, status); - - return true; - } - - static bool HandleWPGPSCommand(ChatHandler* handler, char const* /*args*/) - { - Player* player = handler->GetSession()->GetPlayer(); - - sLog->outSQLDev("(@PATH, XX, %.3f, %.3f, %.5f, 0,0, 0,100, 0),", player->GetPositionX(), player->GetPositionY(), player->GetPositionZ()); - - handler->PSendSysMessage("Waypoint SQL written to SQL Developer log"); - return true; - } -}; - -void AddSC_gps_commandscript() -{ - new gps_commandscript(); -} diff --git a/src/server/scripts/Commands/cs_learn.cpp b/src/server/scripts/Commands/cs_learn.cpp index fcabaaa7e5b..ae573577d7e 100644 --- a/src/server/scripts/Commands/cs_learn.cpp +++ b/src/server/scripts/Commands/cs_learn.cpp @@ -248,7 +248,7 @@ public: return false; } - CreatureTemplate const* creatureInfo = pet->GetCreatureInfo(); + CreatureTemplate const* creatureInfo = pet->GetCreatureTemplate(); if (!creatureInfo) { handler->SendSysMessage(LANG_WRONG_PET_TYPE); diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index 5f0434e5c55..7c431566f52 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -17,6 +17,9 @@ #include "ScriptPCH.h" #include "Chat.h" +#include "ObjectAccessor.h" +#include "ScriptMgr.h" +#include "CellImpl.h" class misc_commandscript : public CommandScript { @@ -27,7 +30,8 @@ public: { static ChatCommand commandTable[] = { - { "dev", SEC_ADMINISTRATOR, false, &HandleDevCommand, "", NULL }, + { "dev", SEC_ADMINISTRATOR, false, &HandleDevCommand, "", NULL }, + { "gps", SEC_ADMINISTRATOR, false, &HandleGPSCommand, "", NULL }, { NULL, 0, false, NULL, "", NULL } }; return commandTable; @@ -64,6 +68,90 @@ public: handler->SetSentErrorMessage(true); return false; } + + static bool HandleGPSCommand(ChatHandler* handler, char const* args) + { + WorldObject* object = NULL; + if (*args) + { + uint64 guid = handler->extractGuidFromLink((char*)args); + if (guid) + object = (WorldObject*)ObjectAccessor::GetObjectByTypeMask(*handler->GetSession()->GetPlayer(), guid, TYPEMASK_UNIT | TYPEMASK_GAMEOBJECT); + + if (!object) + { + handler->SendSysMessage(LANG_PLAYER_NOT_FOUND); + handler->SetSentErrorMessage(true); + return false; + } + } + else + { + object = handler->getSelectedUnit(); + + if (!object) + { + handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE); + handler->SetSentErrorMessage(true); + return false; + } + } + + CellCoord cellCoord = Trinity::ComputeCellCoord(object->GetPositionX(), object->GetPositionY()); + Cell cell(cellCoord); + + uint32 zoneId, areaId; + object->GetZoneAndAreaId(zoneId, areaId); + + MapEntry const* mapEntry = sMapStore.LookupEntry(object->GetMapId()); + AreaTableEntry const* zoneEntry = GetAreaEntryByAreaID(zoneId); + AreaTableEntry const* areaEntry = GetAreaEntryByAreaID(areaId); + + float zoneX = object->GetPositionX(); + float zoneY = object->GetPositionY(); + + Map2ZoneCoordinates(zoneX, zoneY, zoneId); + + Map const* map = object->GetMap(); + float groundZ = map->GetHeight(object->GetPhaseMask(), object->GetPositionX(), object->GetPositionY(), MAX_HEIGHT); + float floorZ = map->GetHeight(object->GetPhaseMask(), object->GetPositionX(), object->GetPositionY(), object->GetPositionZ()); + + GridCoord gridCoord = Trinity::ComputeGridCoord(object->GetPositionX(), object->GetPositionY()); + + // 63? WHY? + int gridX = 63 - gridCoord.x_coord; + int gridY = 63 - gridCoord.y_coord; + + uint32 haveMap = Map::ExistMap(object->GetMapId(), gridX, gridY) ? 1 : 0; + uint32 haveVMap = Map::ExistVMap(object->GetMapId(), gridX, gridY) ? 1 : 0; + + if (haveVMap) + { + if (map->IsOutdoors(object->GetPositionX(), object->GetPositionY(), object->GetPositionZ())) + handler->PSendSysMessage("You are outdoors"); + else + handler->PSendSysMessage("You are indoors"); + } + else + handler->PSendSysMessage("no VMAP available for area info"); + + handler->PSendSysMessage(LANG_MAP_POSITION, + object->GetMapId(), (mapEntry ? mapEntry->name[handler->GetSessionDbcLocale()] : ""), + zoneId, (zoneEntry ? zoneEntry->area_name[handler->GetSessionDbcLocale()] : ""), + areaId, (areaEntry ? areaEntry->area_name[handler->GetSessionDbcLocale()] : ""), + object->GetPhaseMask(), + object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), object->GetOrientation(), + cell.GridX(), cell.GridY(), cell.CellX(), cell.CellY(), object->GetInstanceId(), + zoneX, zoneY, groundZ, floorZ, haveMap, haveVMap); + + LiquidData liquidStatus; + ZLiquidStatus status = map->getLiquidStatus(object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), MAP_ALL_LIQUIDS, &liquidStatus); + + if (status) + handler->PSendSysMessage(LANG_LIQUID_STATUS, liquidStatus.level, liquidStatus.depth_level, liquidStatus.entry, liquidStatus.type_flags, status); + + return true; + } }; void AddSC_misc_commandscript() diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index 93aa188c071..0de3637586c 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -33,6 +33,16 @@ public: ChatCommand* GetCommands() const { + static ChatCommand modifyspeedCommandTable[] = + { + { "fly", SEC_MODERATOR, false, &HandleModifyFlyCommand, "", NULL }, + { "all", SEC_MODERATOR, false, &HandleModifyASpeedCommand, "", NULL }, + { "walk", SEC_MODERATOR, false, &HandleModifySpeedCommand, "", NULL }, + { "backwalk", SEC_MODERATOR, false, &HandleModifyBWalkCommand, "", NULL }, + { "swim", SEC_MODERATOR, false, &HandleModifySwimCommand, "", NULL }, + { "", SEC_MODERATOR, false, &HandleModifyASpeedCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } + }; static ChatCommand modifyCommandTable[] = { { "hp", SEC_MODERATOR, false, &HandleModifyHPCommand, "", NULL }, @@ -41,31 +51,28 @@ public: { "runicpower", SEC_MODERATOR, false, &HandleModifyRunicPowerCommand, "", NULL }, { "energy", SEC_MODERATOR, false, &HandleModifyEnergyCommand, "", NULL }, { "money", SEC_MODERATOR, false, &HandleModifyMoneyCommand, "", NULL }, - { "speed", SEC_MODERATOR, false, &HandleModifySpeedCommand, "", NULL }, - { "swim", SEC_MODERATOR, false, &HandleModifySwimCommand, "", NULL }, { "scale", SEC_MODERATOR, false, &HandleModifyScaleCommand, "", NULL }, { "bit", SEC_MODERATOR, false, &HandleModifyBitCommand, "", NULL }, - { "bwalk", SEC_MODERATOR, false, &HandleModifyBWalkCommand, "", NULL }, - { "fly", SEC_MODERATOR, false, &HandleModifyFlyCommand, "", NULL }, - { "aspeed", SEC_MODERATOR, false, &HandleModifyASpeedCommand, "", NULL }, { "faction", SEC_MODERATOR, false, &HandleModifyFactionCommand, "", NULL }, { "spell", SEC_MODERATOR, false, &HandleModifySpellCommand, "", NULL }, - { "tp", SEC_MODERATOR, false, &HandleModifyTalentCommand, "", NULL }, + { "talentpoints", SEC_MODERATOR, false, &HandleModifyTalentCommand, "", NULL }, { "mount", SEC_MODERATOR, false, &HandleModifyMountCommand, "", NULL }, { "honor", SEC_MODERATOR, false, &HandleModifyHonorCommand, "", NULL }, - { "rep", SEC_GAMEMASTER, false, &HandleModifyRepCommand, "", NULL }, - { "arena", SEC_MODERATOR, false, &HandleModifyArenaCommand, "", NULL }, + { "reputation", SEC_GAMEMASTER, false, &HandleModifyRepCommand, "", NULL }, + { "arenapoints", SEC_MODERATOR, false, &HandleModifyArenaCommand, "", NULL }, { "drunk", SEC_MODERATOR, false, &HandleModifyDrunkCommand, "", NULL }, { "standstate", SEC_GAMEMASTER, false, &HandleModifyStandStateCommand, "", NULL }, - { "morph", SEC_GAMEMASTER, false, &HandleModifyMorphCommand, "", NULL }, { "phase", SEC_ADMINISTRATOR, false, &HandleModifyPhaseCommand, "", NULL }, { "gender", SEC_GAMEMASTER, false, &HandleModifyGenderCommand, "", NULL }, { "collision", SEC_GAMEMASTER, false, &HandleModifyCollisionCommand, "", NULL }, + { "speed", SEC_MODERATOR, false, NULL, "", modifyspeedCommandTable }, { NULL, 0, false, NULL, "", NULL } }; static ChatCommand commandTable[] = { - { "modify", SEC_MODERATOR, false, NULL, "", modifyCommandTable }, + { "morph", SEC_GAMEMASTER, false, &HandleModifyMorphCommand, "", NULL }, + { "demorph", SEC_GAMEMASTER, false, &HandleDeMorphCommand, "", NULL }, + { "modify", SEC_MODERATOR, false, NULL, "", modifyCommandTable }, { NULL, 0, false, NULL, "", NULL } }; return commandTable; @@ -361,7 +368,9 @@ public: //Edit Player Spell static bool HandleModifySpellCommand(ChatHandler* handler, const char* args) { - if (!*args) return false; + if (!*args) + return false; + char* pspellflatid = strtok((char*)args, " "); if (!pspellflatid) return false; @@ -710,7 +719,7 @@ public: (ChatHandler(player)).PSendSysMessage(LANG_YOURS_SIZE_CHANGED, handler->GetNameLink().c_str(), Scale); } - target->SetFloatValue(OBJECT_FIELD_SCALE_X, Scale); + target->SetObjectScale(Scale); return true; } @@ -1142,10 +1151,10 @@ public: static bool HandleModifyRepCommand(ChatHandler* handler, const char* args) { - if (!*args) return false; + if (!*args) + return false; Player* target = handler->getSelectedPlayer(); - if (!target) { handler->SendSysMessage(LANG_PLAYER_NOT_FOUND); @@ -1233,7 +1242,7 @@ public: return false; } - target->GetReputationMgr().SetReputation(factionEntry, amount); + target->GetReputationMgr().SetOneFactionReputation(factionEntry, amount, false); handler->PSendSysMessage(LANG_COMMAND_MODIFY_REP, factionEntry->name, factionId, handler->GetNameLink(target).c_str(), target->GetReputationMgr().GetReputation(factionEntry)); return true; @@ -1375,6 +1384,21 @@ public: return true; } +//demorph player or unit + static bool HandleDeMorphCommand(ChatHandler* handler, const char* /*args*/) + { + Unit* target = handler->getSelectedUnit(); + if (!target) + target = handler->GetSession()->GetPlayer(); + + // check online security + else if (target->GetTypeId() == TYPEID_PLAYER && handler->HasLowerSecurity(target->ToPlayer(), 0)) + return false; + + target->DeMorph(); + + return true; + } static bool HandleModifyCollisionCommand(ChatHandler* handler, const char* args) { diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index 57932ef56c6..832f7958fc8 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -28,6 +28,7 @@ EndScriptData */ #include "Transport.h" #include "CreatureGroups.h" #include "TargetedMovementGenerator.h" // for HandleNpcUnFollowCommand +#include "CreatureAI.h" class npc_commandscript : public CommandScript { @@ -73,6 +74,7 @@ public: { "phase", SEC_GAMEMASTER, false, &HandleNpcSetPhaseCommand, "", NULL }, { "spawndist", SEC_GAMEMASTER, false, &HandleNpcSetSpawnDistCommand, "", NULL }, { "spawntime", SEC_GAMEMASTER, false, &HandleNpcSetSpawnTimeCommand, "", NULL }, + { "data", SEC_ADMINISTRATOR, false, &HandleNpcSetDataCommand, "", NULL }, //{ TODO: fix or remove these commands { "name", SEC_GAMEMASTER, false, &HandleNpcSetNameCommand, "", NULL }, { "subname", SEC_GAMEMASTER, false, &HandleNpcSetSubNameCommand, "", NULL }, @@ -108,6 +110,7 @@ public: { if (!*args) return false; + char* charID = handler->extractKeyFromLink((char*)args, "Hcreature_entry"); if (!charID) return false; @@ -130,12 +133,24 @@ public: { uint32 tguid = chr->GetTransport()->AddNPCPassenger(0, id, chr->GetTransOffsetX(), chr->GetTransOffsetY(), chr->GetTransOffsetZ(), chr->GetTransOffsetO()); if (tguid > 0) - WorldDatabase.PExecute("INSERT INTO creature_transport (guid, npc_entry, transport_entry, TransOffsetX, TransOffsetY, TransOffsetZ, TransOffsetO) values (%u, %u, %f, %f, %f, %f, %u)", tguid, id, chr->GetTransport()->GetEntry(), chr->GetTransOffsetX(), chr->GetTransOffsetY(), chr->GetTransOffsetZ(), chr->GetTransOffsetO()); + { + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_CREATURE_TRANSPORT); + + stmt->setInt32(0, int32(tguid)); + stmt->setInt32(1, int32(id)); + stmt->setInt32(2, int32(chr->GetTransport()->GetEntry())); + stmt->setFloat(3, chr->GetTransOffsetX()); + stmt->setFloat(4, chr->GetTransOffsetY()); + stmt->setFloat(5, chr->GetTransOffsetZ()); + stmt->setFloat(6, chr->GetTransOffsetO()); + + WorldDatabase.Execute(stmt); + } return true; } - Creature* creature = new Creature; + Creature* creature = new Creature(); if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0, (uint32)teamval, x, y, z, o)) { delete creature; @@ -462,7 +477,7 @@ public: // Faction is set in creature_template - not inside creature // Update in memory.. - if (CreatureTemplate const* cinfo = creature->GetCreatureInfo()) + if (CreatureTemplate const* cinfo = creature->GetCreatureTemplate()) { const_cast(cinfo)->faction_A = factionId; const_cast(cinfo)->faction_H = factionId; @@ -511,6 +526,39 @@ public: return true; } + //set data of creature for testing scripting + static bool HandleNpcSetDataCommand(ChatHandler* handler, const char* args) + { + if (!*args) + return false; + + char* arg1 = strtok((char*)args, " "); + char* arg2 = strtok((char*)NULL, ""); + + if (!arg1 || !arg2) + return false; + + uint32 data_1 = (uint32)atoi(arg1); + uint32 data_2 = (uint32)atoi(arg2); + + if (!data_1 || !data_2) + return false; + + Creature* creature = handler->getSelectedCreature(); + + if (!creature) + { + handler->SendSysMessage(LANG_SELECT_CREATURE); + handler->SetSentErrorMessage(true); + return false; + } + + creature->AI()->SetData(data_1, data_2); + std::string AIorScript = creature->GetAIName() != "" ? "AI type: " + creature->GetAIName() : (creature->GetScriptName() != "" ? "Script Name: " + creature->GetScriptName() : "No AI or Script Name Set"); + handler->PSendSysMessage(LANG_NPC_SETDATA, creature->GetGUID(), creature->GetEntry(), creature->GetName(), data_1, data_2, AIorScript.c_str()); + return true; + } + //npc follow handling static bool HandleNpcFollowCommand(ChatHandler* handler, const char* /*args*/) { @@ -547,7 +595,7 @@ public: uint32 displayid = target->GetDisplayId(); uint32 nativeid = target->GetNativeDisplayId(); uint32 Entry = target->GetEntry(); - CreatureTemplate const* cInfo = target->GetCreatureInfo(); + CreatureTemplate const* cInfo = target->GetCreatureTemplate(); int64 curRespawnDelay = target->GetRespawnTimeEx()-time(NULL); if (curRespawnDelay < 0) @@ -677,9 +725,16 @@ public: return false; } - if (target->GetTransport()) - if (target->GetGUIDTransport()) - WorldDatabase.PExecute("UPDATE creature_transport SET emote=%u WHERE transport_entry=%u AND guid=%u", emote, target->GetTransport()->GetEntry(), target->GetGUIDTransport()); + if (target->GetTransport() && target->GetGUIDTransport()) + { + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_TRANSPORT_EMOTE); + + stmt->setInt32(0, int32(emote)); + stmt->setInt32(1, target->GetTransport()->GetEntry()); + stmt->setInt32(2, target->GetGUIDTransport()); + + WorldDatabase.Execute(stmt); + } target->SetUInt32Value(UNIT_NPC_EMOTESTATE, emote); @@ -1036,7 +1091,7 @@ public: } if (/*creature->GetMotionMaster()->empty() ||*/ - creature->GetMotionMaster()->GetCurrentMovementGeneratorType () != FOLLOW_MOTION_TYPE) + creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != FOLLOW_MOTION_TYPE) { handler->PSendSysMessage(LANG_CREATURE_NOT_FOLLOW_YOU, creature->GetName()); handler->SetSentErrorMessage(true); @@ -1131,24 +1186,24 @@ public: //npc tame handling static bool HandleNpcTameCommand(ChatHandler* handler, const char* /*args*/) { - Creature* creatureTarget = handler->getSelectedCreature (); - if (!creatureTarget || creatureTarget->isPet ()) + Creature* creatureTarget = handler->getSelectedCreature(); + if (!creatureTarget || creatureTarget->isPet()) { handler->PSendSysMessage (LANG_SELECT_CREATURE); handler->SetSentErrorMessage (true); return false; } - Player* player = handler->GetSession()->GetPlayer (); + Player* player = handler->GetSession()->GetPlayer(); - if (player->GetPetGUID ()) + if (player->GetPetGUID()) { handler->SendSysMessage (LANG_YOU_ALREADY_HAVE_PET); handler->SetSentErrorMessage (true); return false; } - CreatureTemplate const* cInfo = creatureTarget->GetCreatureInfo(); + CreatureTemplate const* cInfo = creatureTarget->GetCreatureTemplate(); if (!cInfo->isTameable (player->CanTameExoticPets())) { @@ -1168,8 +1223,8 @@ public: // place pet before player float x, y, z; - player->GetClosePoint (x, y, z, creatureTarget->GetObjectSize (), CONTACT_DISTANCE); - pet->Relocate (x, y, z, M_PI-player->GetOrientation ()); + player->GetClosePoint (x, y, z, creatureTarget->GetObjectSize(), CONTACT_DISTANCE); + pet->Relocate(x, y, z, M_PI-player->GetOrientation()); // set pet to defensive mode by default (some classes can't control controlled pets in fact). pet->SetReactState(REACT_DEFENSIVE); @@ -1229,7 +1284,7 @@ public: group_member->leaderGUID = leaderGUID; group_member->groupAI = 0; - CreatureGroupMap[lowguid] = group_member; + sFormationMgr->CreatureGroupMap[lowguid] = group_member; creature->SearchFormation(); PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_CREATURE_FORMATION); diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp index 17c819f2f22..1c119fdef4c 100644 --- a/src/server/scripts/Commands/cs_reload.cpp +++ b/src/server/scripts/Commands/cs_reload.cpp @@ -37,6 +37,7 @@ EndScriptData */ #include "SkillExtraItems.h" #include "Chat.h" #include "WaypointManager.h" +#include "WardenCheckMgr.h" class reload_commandscript : public CommandScript { @@ -105,6 +106,7 @@ public: { "lfg_dungeon_rewards", SEC_ADMINISTRATOR, true, &HandleReloadLfgRewardsCommand, "", NULL }, { "locales_achievement_reward", SEC_ADMINISTRATOR, true, &HandleReloadLocalesAchievementRewardCommand, "", NULL }, { "locales_creature", SEC_ADMINISTRATOR, true, &HandleReloadLocalesCreatureCommand, "", NULL }, + { "locales_creature_text", SEC_ADMINISTRATOR, true, &HandleReloadLocalesCreatureTextCommand, "", NULL }, { "locales_gameobject", SEC_ADMINISTRATOR, true, &HandleReloadLocalesGameobjectCommand, "", NULL }, { "locales_gossip_menu_option", SEC_ADMINISTRATOR, true, &HandleReloadLocalesGossipMenuOptionCommand, "", NULL }, { "locales_item", SEC_ADMINISTRATOR, true, &HandleReloadLocalesItemCommand, "", NULL }, @@ -151,6 +153,7 @@ public: { "spell_threats", SEC_ADMINISTRATOR, true, &HandleReloadSpellThreatsCommand, "", NULL }, { "spell_group_stack_rules", SEC_ADMINISTRATOR, true, &HandleReloadSpellGroupStackRulesCommand, "", NULL }, { "trinity_string", SEC_ADMINISTRATOR, true, &HandleReloadTrinityStringCommand, "", NULL }, + { "warden_action", SEC_ADMINISTRATOR, true, &HandleReloadWardenactionCommand, "", NULL }, { "waypoint_scripts", SEC_ADMINISTRATOR, true, &HandleReloadWpScriptsCommand, "", NULL }, { "waypoint_data", SEC_ADMINISTRATOR, true, &HandleReloadWpCommand, "", NULL }, { "vehicle_accessory", SEC_ADMINISTRATOR, true, &HandleReloadVehicleAccessoryCommand, "", NULL }, @@ -317,6 +320,7 @@ public: { HandleReloadLocalesAchievementRewardCommand(handler, "a"); HandleReloadLocalesCreatureCommand(handler, "a"); + HandleReloadLocalesCreatureTextCommand(handler, "a"); HandleReloadLocalesGameobjectCommand(handler, "a"); HandleReloadLocalesGossipMenuOptionCommand(handler, "a"); HandleReloadLocalesItemCommand(handler, "a"); @@ -409,14 +413,18 @@ public: for (Tokens::const_iterator itr = entries.begin(); itr != entries.end(); ++itr) { uint32 entry = uint32(atoi(*itr)); - QueryResult result = WorldDatabase.PQuery("SELECT difficulty_entry_1, difficulty_entry_2, difficulty_entry_3, KillCredit1, KillCredit2, modelid1, modelid2, modelid3, modelid4, name, subname, IconName, gossip_menu_id, minlevel, maxlevel, exp, faction_A, faction_H, npcflag, speed_walk, speed_run, scale, rank, mindmg, maxdmg, dmgschool, attackpower, dmg_multiplier, baseattacktime, rangeattacktime, unit_class, unit_flags, dynamicflags, family, trainer_type, trainer_spell, trainer_class, trainer_race, minrangedmg, maxrangedmg, rangedattackpower, type, type_flags, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, PetSpellDataId, VehicleId, mingold, maxgold, AIName, MovementType, InhabitType, Health_mod, Mana_mod, Armor_mod, RacialLeader, questItem1, questItem2, questItem3, questItem4, questItem5, questItem6, movementId, RegenHealth, equipment_id, mechanic_immune_mask, flags_extra, ScriptName FROM creature_template WHERE entry = %u", entry); + + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_CREATURE_TEMPLATE); + stmt->setUInt32(0, entry); + PreparedQueryResult result = WorldDatabase.Query(stmt); + if (!result) { handler->PSendSysMessage(LANG_COMMAND_CREATURETEMPLATE_NOTFOUND, entry); continue; } - CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(entry); + CreatureTemplate* cInfo = const_cast(sObjectMgr->GetCreatureTemplate(entry)); if (!cInfo) { handler->PSendSysMessage(LANG_COMMAND_CREATURESTORAGE_NOTFOUND, entry); @@ -427,89 +435,88 @@ public: Field* fields = result->Fetch(); - const_cast(cInfo)->DifficultyEntry[0] = fields[0].GetUInt32(); - const_cast(cInfo)->DifficultyEntry[1] = fields[1].GetUInt32(); - const_cast(cInfo)->DifficultyEntry[2] = fields[2].GetUInt32(); - const_cast(cInfo)->KillCredit[0] = fields[3].GetUInt32(); - const_cast(cInfo)->KillCredit[1] = fields[4].GetUInt32(); - const_cast(cInfo)->Modelid1 = fields[5].GetUInt32(); - const_cast(cInfo)->Modelid2 = fields[6].GetUInt32(); - const_cast(cInfo)->Modelid3 = fields[7].GetUInt32(); - const_cast(cInfo)->Modelid4 = fields[8].GetUInt32(); - const_cast(cInfo)->Name = fields[9].GetString(); - const_cast(cInfo)->SubName = fields[10].GetString(); - const_cast(cInfo)->IconName = fields[11].GetString(); - const_cast(cInfo)->GossipMenuId = fields[12].GetUInt32(); - const_cast(cInfo)->minlevel = fields[13].GetUInt32(); - const_cast(cInfo)->maxlevel = fields[14].GetUInt32(); - const_cast(cInfo)->expansion = fields[15].GetUInt32(); - const_cast(cInfo)->faction_A = fields[16].GetUInt32(); - const_cast(cInfo)->faction_H = fields[17].GetUInt32(); - const_cast(cInfo)->npcflag = fields[18].GetUInt32(); - const_cast(cInfo)->speed_walk = fields[19].GetFloat(); - const_cast(cInfo)->speed_run = fields[20].GetFloat(); - const_cast(cInfo)->scale = fields[21].GetFloat(); - const_cast(cInfo)->rank = fields[22].GetUInt32(); - const_cast(cInfo)->mindmg = fields[23].GetFloat(); - const_cast(cInfo)->maxdmg = fields[24].GetFloat(); - const_cast(cInfo)->dmgschool = fields[25].GetUInt32(); - const_cast(cInfo)->attackpower = fields[26].GetUInt32(); - const_cast(cInfo)->dmg_multiplier = fields[27].GetFloat(); - const_cast(cInfo)->baseattacktime = fields[28].GetUInt32(); - const_cast(cInfo)->rangeattacktime = fields[29].GetUInt32(); - const_cast(cInfo)->unit_class = fields[30].GetUInt32(); - const_cast(cInfo)->unit_flags = fields[31].GetUInt32(); - const_cast(cInfo)->dynamicflags = fields[32].GetUInt32(); - const_cast(cInfo)->family = fields[33].GetUInt32(); - const_cast(cInfo)->trainer_type = fields[34].GetUInt32(); - const_cast(cInfo)->trainer_spell = fields[35].GetUInt32(); - const_cast(cInfo)->trainer_class = fields[36].GetUInt32(); - const_cast(cInfo)->trainer_race = fields[37].GetUInt32(); - const_cast(cInfo)->minrangedmg = fields[38].GetFloat(); - const_cast(cInfo)->maxrangedmg = fields[39].GetFloat(); - const_cast(cInfo)->rangedattackpower = fields[40].GetUInt32(); - const_cast(cInfo)->type = fields[41].GetUInt32(); - const_cast(cInfo)->type_flags = fields[42].GetUInt32(); - const_cast(cInfo)->lootid = fields[43].GetUInt32(); - const_cast(cInfo)->pickpocketLootId = fields[44].GetUInt32(); - const_cast(cInfo)->SkinLootId = fields[45].GetUInt32(); + cInfo->DifficultyEntry[0] = fields[0].GetUInt32(); + cInfo->DifficultyEntry[1] = fields[1].GetUInt32(); + cInfo->DifficultyEntry[2] = fields[2].GetUInt32(); + cInfo->KillCredit[0] = fields[3].GetUInt32(); + cInfo->KillCredit[1] = fields[4].GetUInt32(); + cInfo->Modelid1 = fields[5].GetUInt32(); + cInfo->Modelid2 = fields[6].GetUInt32(); + cInfo->Modelid3 = fields[7].GetUInt32(); + cInfo->Modelid4 = fields[8].GetUInt32(); + cInfo->Name = fields[9].GetString(); + cInfo->SubName = fields[10].GetString(); + cInfo->IconName = fields[11].GetString(); + cInfo->GossipMenuId = fields[12].GetUInt32(); + cInfo->minlevel = fields[13].GetUInt8(); + cInfo->maxlevel = fields[14].GetUInt8(); + cInfo->expansion = fields[15].GetUInt16(); + cInfo->faction_A = fields[16].GetUInt16(); + cInfo->faction_H = fields[17].GetUInt16(); + cInfo->npcflag = fields[18].GetUInt32(); + cInfo->speed_walk = fields[19].GetFloat(); + cInfo->speed_run = fields[20].GetFloat(); + cInfo->scale = fields[21].GetFloat(); + cInfo->rank = fields[22].GetUInt8(); + cInfo->mindmg = fields[23].GetFloat(); + cInfo->maxdmg = fields[24].GetFloat(); + cInfo->dmgschool = fields[25].GetUInt8(); + cInfo->attackpower = fields[26].GetUInt32(); + cInfo->dmg_multiplier = fields[27].GetFloat(); + cInfo->baseattacktime = fields[28].GetUInt32(); + cInfo->rangeattacktime = fields[29].GetUInt32(); + cInfo->unit_class = fields[30].GetUInt8(); + cInfo->unit_flags = fields[31].GetUInt32(); + cInfo->dynamicflags = fields[32].GetUInt32(); + cInfo->family = fields[33].GetUInt8(); + cInfo->trainer_type = fields[34].GetUInt8(); + cInfo->trainer_spell = fields[35].GetUInt32(); + cInfo->trainer_class = fields[36].GetUInt8(); + cInfo->trainer_race = fields[37].GetUInt8(); + cInfo->minrangedmg = fields[38].GetFloat(); + cInfo->maxrangedmg = fields[39].GetFloat(); + cInfo->rangedattackpower = fields[40].GetUInt16(); + cInfo->type = fields[41].GetUInt8(); + cInfo->type_flags = fields[42].GetUInt32(); + cInfo->lootid = fields[43].GetUInt32(); + cInfo->pickpocketLootId = fields[44].GetUInt32(); + cInfo->SkinLootId = fields[45].GetUInt32(); for (uint8 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i) - { - const_cast(cInfo)->resistance[i] = fields[46 + i -1].GetUInt32(); - } - - const_cast(cInfo)->spells[0] = fields[52].GetUInt32(); - const_cast(cInfo)->spells[1] = fields[53].GetUInt32(); - const_cast(cInfo)->spells[2] = fields[54].GetUInt32(); - const_cast(cInfo)->spells[3] = fields[55].GetUInt32(); - const_cast(cInfo)->spells[4] = fields[56].GetUInt32(); - const_cast(cInfo)->spells[5] = fields[57].GetUInt32(); - const_cast(cInfo)->spells[6] = fields[58].GetUInt32(); - const_cast(cInfo)->spells[7] = fields[59].GetUInt32(); - const_cast(cInfo)->PetSpellDataId = fields[60].GetUInt32(); - const_cast(cInfo)->VehicleId = fields[61].GetUInt32(); - const_cast(cInfo)->mingold = fields[62].GetUInt32(); - const_cast(cInfo)->maxgold = fields[63].GetUInt32(); - const_cast(cInfo)->AIName = fields[64].GetString(); - const_cast(cInfo)->MovementType = fields[65].GetUInt32(); - const_cast(cInfo)->InhabitType = fields[66].GetUInt32(); - const_cast(cInfo)->ModHealth = fields[67].GetFloat(); - const_cast(cInfo)->ModMana = fields[68].GetFloat(); - const_cast(cInfo)->ModArmor = fields[69].GetFloat(); - const_cast(cInfo)->RacialLeader = fields[70].GetBool(); - const_cast(cInfo)->questItems[0] = fields[71].GetUInt32(); - const_cast(cInfo)->questItems[1] = fields[72].GetUInt32(); - const_cast(cInfo)->questItems[2] = fields[73].GetUInt32(); - const_cast(cInfo)->questItems[3] = fields[74].GetUInt32(); - const_cast(cInfo)->questItems[4] = fields[75].GetUInt32(); - const_cast(cInfo)->questItems[5] = fields[76].GetUInt32(); - const_cast(cInfo)->movementId = fields[77].GetUInt32(); - const_cast(cInfo)->RegenHealth = fields[78].GetBool(); - const_cast(cInfo)->equipmentId = fields[79].GetUInt32(); - const_cast(cInfo)->MechanicImmuneMask = fields[80].GetUInt32(); - const_cast(cInfo)->flags_extra = fields[81].GetUInt32(); - const_cast(cInfo)->ScriptID = sObjectMgr->GetScriptId(fields[82].GetCString()); + cInfo->resistance[i] = fields[46 + i -1].GetUInt16(); + + cInfo->spells[0] = fields[52].GetUInt32(); + cInfo->spells[1] = fields[53].GetUInt32(); + cInfo->spells[2] = fields[54].GetUInt32(); + cInfo->spells[3] = fields[55].GetUInt32(); + cInfo->spells[4] = fields[56].GetUInt32(); + cInfo->spells[5] = fields[57].GetUInt32(); + cInfo->spells[6] = fields[58].GetUInt32(); + cInfo->spells[7] = fields[59].GetUInt32(); + cInfo->PetSpellDataId = fields[60].GetUInt32(); + cInfo->VehicleId = fields[61].GetUInt32(); + cInfo->mingold = fields[62].GetUInt32(); + cInfo->maxgold = fields[63].GetUInt32(); + cInfo->AIName = fields[64].GetString(); + cInfo->MovementType = fields[65].GetUInt8(); + cInfo->InhabitType = fields[66].GetUInt8(); + cInfo->HoverHeight = fields[67].GetFloat(); + cInfo->ModHealth = fields[68].GetFloat(); + cInfo->ModMana = fields[69].GetFloat(); + cInfo->ModArmor = fields[70].GetFloat(); + cInfo->RacialLeader = fields[71].GetBool(); + cInfo->questItems[0] = fields[72].GetUInt32(); + cInfo->questItems[1] = fields[73].GetUInt32(); + cInfo->questItems[2] = fields[74].GetUInt32(); + cInfo->questItems[3] = fields[75].GetUInt32(); + cInfo->questItems[4] = fields[76].GetUInt32(); + cInfo->questItems[5] = fields[77].GetUInt32(); + cInfo->movementId = fields[78].GetUInt32(); + cInfo->RegenHealth = fields[79].GetBool(); + cInfo->equipmentId = fields[80].GetUInt32(); + cInfo->MechanicImmuneMask = fields[81].GetUInt32(); + cInfo->flags_extra = fields[82].GetUInt32(); + cInfo->ScriptID = sObjectMgr->GetScriptId(fields[83].GetCString()); sObjectMgr->CheckCreatureTemplate(cInfo); } @@ -724,6 +731,21 @@ public: return true; } + static bool HandleReloadWardenactionCommand(ChatHandler* handler, const char* /*args*/) + { + if (!sWorld->getBoolConfig(CONFIG_WARDEN_ENABLED)) + { + handler->SendSysMessage("Warden system disabled by config - reloading warden_action skipped."); + handler->SetSentErrorMessage(true); + return false; + } + + sLog->outString("Re-Loading warden_action Table!"); + sWardenCheckMgr->LoadWardenOverrides(); + handler->SendGlobalGMSysMessage("DB table `warden_action` reloaded."); + return true; + } + static bool HandleReloadNpcTrainerCommand(ChatHandler* handler, const char* /*args*/) { sLog->outString("Re-Loading `npc_trainer` Table!"); @@ -1154,6 +1176,14 @@ public: return true; } + static bool HandleReloadLocalesCreatureTextCommand(ChatHandler* handler, const char* /*args*/) + { + sLog->outString("Re-Loading Locales Creature Texts..."); + sCreatureTextMgr->LoadCreatureTextLocales(); + handler->SendGlobalGMSysMessage("DB table `locales_creature_text` reloaded."); + return true; + } + static bool HandleReloadLocalesGameobjectCommand(ChatHandler* handler, const char* /*args*/) { sLog->outString("Re-Loading Locales Gameobject ... "); diff --git a/src/server/scripts/Commands/cs_tele.cpp b/src/server/scripts/Commands/cs_tele.cpp index 5054bd83f32..ca7c3af7fde 100644 --- a/src/server/scripts/Commands/cs_tele.cpp +++ b/src/server/scripts/Commands/cs_tele.cpp @@ -131,12 +131,15 @@ public: target->TeleportTo(target->m_homebindMapId, target->m_homebindX, target->m_homebindY, target->m_homebindZ, target->GetOrientation()); else { - QueryResult resultDB = CharacterDatabase.PQuery("SELECT mapId, zoneId, posX, posY, posZ FROM character_homebind WHERE guid = %u", target_guid); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_HOMEBIND); + stmt->setUInt32(0, target_guid); + PreparedQueryResult resultDB = CharacterDatabase.Query(stmt); + if (resultDB) { Field* fieldsDB = resultDB->Fetch(); - uint32 mapId = fieldsDB[0].GetUInt32(); - uint32 zoneId = fieldsDB[1].GetUInt32(); + uint32 mapId = fieldsDB[0].GetUInt16(); + uint32 zoneId = fieldsDB[1].GetUInt16(); float posX = fieldsDB[2].GetFloat(); float posY = fieldsDB[3].GetFloat(); float posZ = fieldsDB[4].GetFloat(); diff --git a/src/server/scripts/Commands/cs_wp.cpp b/src/server/scripts/Commands/cs_wp.cpp index 8f5e862555c..99ec263b8f9 100644 --- a/src/server/scripts/Commands/cs_wp.cpp +++ b/src/server/scripts/Commands/cs_wp.cpp @@ -91,7 +91,10 @@ public: pathid = target->GetWaypointPath(); else { - QueryResult result = WorldDatabase.Query("SELECT MAX(id) FROM waypoint_data"); + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_DATA_MAX_ID); + + PreparedQueryResult result = WorldDatabase.Query(stmt); + uint32 maxpathid = result->Fetch()->GetInt32(); pathid = maxpathid+1; handler->PSendSysMessage("%s%s|r", "|cff00ff00", "New path started."); @@ -109,7 +112,9 @@ public: return true; } - QueryResult result = WorldDatabase.PQuery("SELECT MAX(point) FROM waypoint_data WHERE id = '%u'", pathid); + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_DATA_MAX_POINT); + stmt->setUInt32(0, pathid); + PreparedQueryResult result = WorldDatabase.Query(stmt); if (result) point = (*result)[0].GetUInt32(); @@ -117,7 +122,7 @@ public: Player* player = handler->GetSession()->GetPlayer(); //Map* map = player->GetMap(); - PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_WAYPOINT_DATA); + stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_WAYPOINT_DATA); stmt->setUInt32(0, pathid); stmt->setUInt32(1, point + 1); @@ -173,9 +178,12 @@ public: } guidLow = target->GetDBTableGUIDLow(); - QueryResult result = WorldDatabase.PQuery("SELECT guid FROM creature_addon WHERE guid = '%u'", guidLow); - PreparedStatement* stmt; + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_CREATURE_ADDON_BY_GUID); + + stmt->setUInt32(0, guidLow); + + PreparedQueryResult result = WorldDatabase.Query(stmt); if (result) { @@ -223,6 +231,7 @@ public: sWaypointMgr->ReloadPath(id); return true; } + static bool HandleWpUnLoadCommand(ChatHandler* handler, const char* /*args*/) { @@ -276,7 +285,8 @@ public: std::string show = show_str; // Check - if ((show != "add") && (show != "mod") && (show != "del") && (show != "listid")) return false; + if ((show != "add") && (show != "mod") && (show != "del") && (show != "listid")) + return false; char* arg_id = strtok(NULL, " "); uint32 id = 0; @@ -288,7 +298,9 @@ public: if (id) { - QueryResult result = WorldDatabase.PQuery("SELECT id FROM waypoint_scripts WHERE guid = %u", id); + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_SCRIPT_ID_BY_GUID); + stmt->setUInt32(0, id); + PreparedQueryResult result = WorldDatabase.Query(stmt); if (!result) { @@ -305,10 +317,13 @@ public: } else { - QueryResult result = WorldDatabase.Query("SELECT MAX(guid) FROM waypoint_scripts"); + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_SCRIPTS_MAX_ID); + + PreparedQueryResult result = WorldDatabase.Query(stmt); + id = result->Fetch()->GetUInt32(); - PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_WAYPOINT_SCRIPT); + stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_WAYPOINT_SCRIPT); stmt->setUInt32(0, id + 1); @@ -334,7 +349,9 @@ public: float a8, a9, a10, a11; char const* a7; - QueryResult result = WorldDatabase.PQuery("SELECT guid, delay, command, datalong, datalong2, dataint, x, y, z, o FROM waypoint_scripts WHERE id = %u", id); + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_SCRIPT_BY_ID); + stmt->setUInt32(0, id); + PreparedQueryResult result = WorldDatabase.Query(stmt); if (!result) { @@ -367,7 +384,11 @@ public: { id = atoi(arg_id); - QueryResult result = WorldDatabase.PQuery("SELECT guid FROM waypoint_scripts WHERE guid = %u", id); + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_SCRIPT_ID_BY_GUID); + + stmt->setUInt32(0, id); + + PreparedQueryResult result = WorldDatabase.Query(stmt); if (result) { @@ -445,7 +466,9 @@ public: } else { - QueryResult result = WorldDatabase.PQuery("SELECT id FROM waypoint_scripts WHERE guid='%u'", id); + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_SCRIPT_ID_BY_GUID); + stmt->setUInt32(0, id); + PreparedQueryResult result = WorldDatabase.Query(stmt); if (!result) { @@ -565,7 +588,9 @@ public: // User did select a visual waypoint? // Check the creature - QueryResult result = WorldDatabase.PQuery("SELECT id, point FROM waypoint_data WHERE wpguid = %u", wpGuid); + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_DATA_BY_WPGUID); + stmt->setUInt32(0, wpGuid); + PreparedQueryResult result = WorldDatabase.Query(stmt); if (!result) { @@ -576,9 +601,17 @@ public: // Here we search for all waypoints that only differ in one from 1 thousand // (0.001) - There is no other way to compare C++ floats with mySQL floats // See also: http://dev.mysql.com/doc/refman/5.0/en/problems-with-float.html - const char* maxDIFF = "0.01"; - result = WorldDatabase.PQuery("SELECT id, point FROM waypoint_data WHERE (abs(position_x - %f) <= %s) and (abs(position_y - %f) <= %s) and (abs(position_z - %f) <= %s)", - target->GetPositionX(), maxDIFF, target->GetPositionY(), maxDIFF, target->GetPositionZ(), maxDIFF); + std::string maxDiff = "0.01"; + + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_DATA_BY_POS); + stmt->setFloat(0, target->GetPositionX()); + stmt->setString(1, maxDiff); + stmt->setFloat(2, target->GetPositionY()); + stmt->setString(3, maxDiff); + stmt->setFloat(4, target->GetPositionZ()); + stmt->setString(5, maxDiff); + PreparedQueryResult result = WorldDatabase.Query(stmt); + if (!result) { handler->PSendSysMessage(LANG_WAYPOINT_NOTFOUNDDBPROBLEM, wpGuid); @@ -605,7 +638,7 @@ public: return false; } - if (show == "del" && target) + if (show == "del") { handler->PSendSysMessage("|cff00ff00DEBUG: wp modify del, PathID: |r|cff00ffff%u|r", pathid); @@ -615,9 +648,12 @@ public: if (wpGuid != 0) { wpCreature = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(MAKE_NEW_GUID(wpGuid, VISUAL_WAYPOINT, HIGHGUID_UNIT)); - wpCreature->CombatStop(); - wpCreature->DeleteFromDB(); - wpCreature->AddObjectToRemoveList(); + if (wpCreature) + { + wpCreature->CombatStop(); + wpCreature->DeleteFromDB(); + wpCreature->AddObjectToRemoveList(); + } } PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_WAYPOINT_DATA); @@ -638,7 +674,7 @@ public: return true; } // del - if (show == "move" && target) + if (show == "move") { handler->PSendSysMessage("|cff00ff00DEBUG: wp move, PathID: |r|cff00ffff%u|r", pathid); @@ -652,16 +688,20 @@ public: // Respawn the owner of the waypoints if (wpGuid != 0) { - wpCreature = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(MAKE_NEW_GUID(wpGuid, VISUAL_WAYPOINT, HIGHGUID_UNIT)); - wpCreature->CombatStop(); - wpCreature->DeleteFromDB(); - wpCreature->AddObjectToRemoveList(); + wpCreature = map->GetCreature(MAKE_NEW_GUID(wpGuid, VISUAL_WAYPOINT, HIGHGUID_UNIT)); + if (wpCreature) + { + wpCreature->CombatStop(); + wpCreature->DeleteFromDB(); + wpCreature->AddObjectToRemoveList(); + } // re-create Creature* wpCreature2 = new Creature; if (!wpCreature2->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), VISUAL_WAYPOINT, 0, 0, chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ(), chr->GetOrientation())) { handler->PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, VISUAL_WAYPOINT); delete wpCreature2; + wpCreature2 = NULL; return false; } @@ -672,6 +712,7 @@ public: { handler->PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, VISUAL_WAYPOINT); delete wpCreature2; + wpCreature2 = NULL; return false; } //sMapMgr->GetMap(npcCreature->GetMapId())->Add(wpCreature2); @@ -755,7 +796,6 @@ public: } std::string show = show_str; - uint32 Maxpoint; //handler->PSendSysMessage("wpshow - show: %s", show); @@ -770,7 +810,11 @@ public: return false; } - QueryResult result = WorldDatabase.PQuery("SELECT id, point, delay, move_flag, action, action_chance FROM waypoint_data WHERE wpguid = %u", target->GetGUIDLow()); + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_DATA_ALL_BY_WPGUID); + + stmt->setUInt32(0, target->GetGUIDLow()); + + PreparedQueryResult result = WorldDatabase.Query(stmt); if (!result) { @@ -802,7 +846,11 @@ public: if (show == "on") { - QueryResult result = WorldDatabase.PQuery("SELECT point, position_x, position_y, position_z FROM waypoint_data WHERE id = '%u'", pathid); + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_DATA_POS_BY_ID); + + stmt->setUInt32(0, pathid); + + PreparedQueryResult result = WorldDatabase.Query(stmt); if (!result) { @@ -814,7 +862,11 @@ public: handler->PSendSysMessage("|cff00ff00DEBUG: wp on, PathID: |cff00ffff%u|r", pathid); // Delete all visuals for this NPC - QueryResult result2 = WorldDatabase.PQuery("SELECT wpguid FROM waypoint_data WHERE id = '%u' and wpguid <> 0", pathid); + stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_DATA_WPGUID_BY_ID); + + stmt->setUInt32(0, pathid); + + PreparedQueryResult result2 = WorldDatabase.Query(stmt); if (result2) { @@ -897,7 +949,7 @@ public: if (target) { wpCreature->SetDisplayId(target->GetDisplayId()); - wpCreature->SetFloatValue(OBJECT_FIELD_SCALE_X, 0.5f); + wpCreature->SetObjectScale(0.5f); wpCreature->SetLevel(point > STRONG_MAX_LEVEL ? STRONG_MAX_LEVEL : point); } } @@ -911,7 +963,10 @@ public: { handler->PSendSysMessage("|cff00ff00DEBUG: wp first, GUID: %u|r", pathid); - QueryResult result = WorldDatabase.PQuery("SELECT position_x, position_y, position_z FROM waypoint_data WHERE point='1' AND id = '%u'", pathid); + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_DATA_POS_FIRST_BY_ID); + stmt->setUInt32(0, pathid); + PreparedQueryResult result = WorldDatabase.Query(stmt); + if (!result) { handler->PSendSysMessage(LANG_WAYPOINT_NOTFOUND, pathid); @@ -948,7 +1003,7 @@ public: if (target) { creature->SetDisplayId(target->GetDisplayId()); - creature->SetFloatValue(OBJECT_FIELD_SCALE_X, 0.5f); + creature->SetObjectScale(0.5f); } return true; @@ -958,13 +1013,10 @@ public: { handler->PSendSysMessage("|cff00ff00DEBUG: wp last, PathID: |r|cff00ffff%u|r", pathid); - QueryResult result = WorldDatabase.PQuery("SELECT MAX(point) FROM waypoint_data WHERE id = '%u'", pathid); - if (result) - Maxpoint = (*result)[0].GetUInt32(); - else - Maxpoint = 0; + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_DATA_POS_LAST_BY_ID); + stmt->setUInt32(0, pathid); + PreparedQueryResult result = WorldDatabase.Query(stmt); - result = WorldDatabase.PQuery("SELECT position_x, position_y, position_z, orientation FROM waypoint_data WHERE point ='%u' AND id = '%u'", Maxpoint, pathid); if (!result) { handler->PSendSysMessage(LANG_WAYPOINT_NOTFOUNDLAST, pathid); @@ -1000,7 +1052,7 @@ public: if (target) { creature->SetDisplayId(target->GetDisplayId()); - creature->SetFloatValue(OBJECT_FIELD_SCALE_X, 0.5f); + creature->SetObjectScale(0.5f); } return true; @@ -1008,7 +1060,10 @@ public: if (show == "off") { - QueryResult result = WorldDatabase.PQuery("SELECT guid FROM creature WHERE id = '%u'", 1); + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_CREATURE_BY_ID); + stmt->setUInt32(0, 1); + PreparedQueryResult result = WorldDatabase.Query(stmt); + if (!result) { handler->SendSysMessage(LANG_WAYPOINT_VP_NOTFOUND); @@ -1041,7 +1096,7 @@ public: } while (result->NextRow()); // set "wpguid" column to "empty" - no visual waypoint spawned - PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_ALL_WAYPOINT_DATA_WPGUID); + stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_WAYPOINT_DATA_ALL_WPGUID); WorldDatabase.Execute(stmt); //WorldDatabase.PExecute("UPDATE creature_movement SET wpguid = '0' WHERE wpguid <> '0'"); diff --git a/src/server/scripts/Custom/CMakeLists.txt b/src/server/scripts/Custom/CMakeLists.txt index 1570ca17312..62abde25905 100644 --- a/src/server/scripts/Custom/CMakeLists.txt +++ b/src/server/scripts/Custom/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2011 TrinityCore +# Copyright (C) 2008-2012 TrinityCore # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp index 1292cdaee17..93de16fc80b 100644 --- a/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp +++ b/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp @@ -139,7 +139,7 @@ public: summons.Summon(summoned); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { summons.DespawnAll(); } diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp index 7ef11e5256a..9375cc33f27 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp @@ -126,11 +126,11 @@ public: InstanceScript* instance; - uint8 EventPhase; + uint8 EventPhase; uint32 Event_Timer; - uint8 MobSpawnId; - uint8 MobCount; + uint8 MobSpawnId; + uint8 MobCount; uint32 MobDeath_Timer; uint64 RingMobGUID[4]; @@ -142,16 +142,16 @@ public: { me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - EventPhase = 0; - Event_Timer = 1000; + EventPhase = 0; + Event_Timer = 1000; - MobCount = 0; - MobDeath_Timer = 0; + MobCount = 0; + MobDeath_Timer = 0; for (uint8 i = 0; i < MAX_MOB_AMOUNT; ++i) RingMobGUID[i] = 0; - RingBossGUID = 0; + RingBossGUID = 0; CanWalk = false; } @@ -177,39 +177,39 @@ public: MobDeath_Timer = 2500; } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - switch (i) + switch (waypointId) { - case 0: - DoScriptText(SCRIPT_TEXT1, me);//2 - CanWalk = false; - Event_Timer = 5000; - break; - case 1: - DoScriptText(SCRIPT_TEXT2, me);//4 - CanWalk = false; - Event_Timer = 5000; - break; - case 2: - CanWalk = false; - break; - case 3: - DoScriptText(SCRIPT_TEXT3, me);//5 - break; - case 4: - DoScriptText(SCRIPT_TEXT4, me);//6 - CanWalk = false; - Event_Timer = 5000; - break; - case 5: - if (instance) - { - instance->UpdateEncounterState(ENCOUNTER_CREDIT_KILL_CREATURE, NPC_GRIMSTONE, me); - instance->SetData(TYPE_RING_OF_LAW, DONE); - sLog->outDebug(LOG_FILTER_TSCR, "TSCR: npc_grimstone: event reached end and set complete."); - } - break; + case 0: + DoScriptText(SCRIPT_TEXT1, me);//2 + CanWalk = false; + Event_Timer = 5000; + break; + case 1: + DoScriptText(SCRIPT_TEXT2, me);//4 + CanWalk = false; + Event_Timer = 5000; + break; + case 2: + CanWalk = false; + break; + case 3: + DoScriptText(SCRIPT_TEXT3, me);//5 + break; + case 4: + DoScriptText(SCRIPT_TEXT4, me);//6 + CanWalk = false; + Event_Timer = 5000; + break; + case 5: + if (instance) + { + instance->UpdateEncounterState(ENCOUNTER_CREDIT_KILL_CREATURE, NPC_GRIMSTONE, me); + instance->SetData(TYPE_RING_OF_LAW, DONE); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: npc_grimstone: event reached end and set complete."); + } + break; } } @@ -227,16 +227,16 @@ public: { if (MobDeath_Timer <= diff) { - MobDeath_Timer = 2500; + MobDeath_Timer = 2500; if (RingBossGUID) { Creature* boss = Unit::GetCreature(*me, RingBossGUID); if (boss && !boss->isAlive() && boss->isDead()) { - RingBossGUID = 0; - Event_Timer = 5000; - MobDeath_Timer = 0; + RingBossGUID = 0; + Event_Timer = 5000; + MobDeath_Timer = 0; return; } return; @@ -247,7 +247,7 @@ public: Creature* mob = Unit::GetCreature(*me, RingMobGUID[i]); if (mob && !mob->isAlive() && mob->isDead()) { - RingMobGUID[i] = 0; + RingMobGUID[i] = 0; --MobCount; //seems all are gone, so set timer to continue and discontinue this @@ -355,7 +355,7 @@ public: struct mob_phalanxAI : public ScriptedAI { - mob_phalanxAI(Creature* c) : ScriptedAI(c) {} + mob_phalanxAI(Creature* creature) : ScriptedAI(creature) {} uint32 ThunderClap_Timer; uint32 FireballVolley_Timer; @@ -363,9 +363,9 @@ public: void Reset() { - ThunderClap_Timer = 12000; - FireballVolley_Timer = 0; - MightyBlow_Timer = 15000; + ThunderClap_Timer = 12000; + FireballVolley_Timer = 0; + MightyBlow_Timer = 15000; } void UpdateAI(const uint32 diff) @@ -426,7 +426,7 @@ class npc_kharan_mighthammer : public CreatureScript public: npc_kharan_mighthammer() : CreatureScript("npc_kharan_mighthammer") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*Sender*/, uint32 action) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); switch (action) @@ -520,7 +520,7 @@ class npc_lokhtos_darkbargainer : public CreatureScript public: npc_lokhtos_darkbargainer() : CreatureScript("npc_lokhtos_darkbargainer") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*Sender*/, uint32 action) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); if (action == GOSSIP_ACTION_INFO_DEF + 1) @@ -564,7 +564,6 @@ enum DughalQuests QUEST_JAIL_BREAK = 4322 }; -// DELETE THIS IF IT IS NOT NEEDED! #define SAY_DUGHAL_FREE "Thank you, $N! I'm free!!!" #define GOSSIP_DUGHAL "You're free, Dughal! Get out of here!" @@ -585,7 +584,7 @@ public: return dughal_stormwingAI; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 Sender, uint32 action) + bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action) { player->PlayerTalkClass->ClearMenus(); if (action == GOSSIP_ACTION_INFO_DEF + 1) @@ -610,20 +609,24 @@ public: struct npc_dughal_stormwingAI : public npc_escortAI { - npc_dughal_stormwingAI(Creature* c) : npc_escortAI(c) {} + npc_dughal_stormwingAI(Creature* creature) : npc_escortAI(creature) {} - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - switch (i) + switch (waypointId) { - case 0:me->Say(SAY_DUGHAL_FREE, LANG_UNIVERSAL, PlayerGUID); break; - case 1:instance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_OBJECTIVE_COMPLETED);break; - case 2: - me->SetVisibility(VISIBILITY_OFF); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - instance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_ENDED); - break; + case 0: + me->Say(SAY_DUGHAL_FREE, LANG_UNIVERSAL, PlayerGUID); + break; + case 1: + instance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_OBJECTIVE_COMPLETED); + break; + case 2: + me->SetVisible(false); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + instance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_ENDED); + break; } } @@ -634,7 +637,7 @@ public: { if (IsBeingEscorted && killer == me) { - me->SetVisibility(VISIBILITY_OFF); + me->SetVisible(false); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); instance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_ENDED); @@ -646,13 +649,13 @@ public: if (instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return; if ((instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS || instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_FAILED || instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_ENDED)&& instance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_ENDED) { - me->SetVisibility(VISIBILITY_OFF); + me->SetVisible(false); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } else { - me->SetVisibility(VISIBILITY_ON); + me->SetVisible(true); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } @@ -713,78 +716,85 @@ public: bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) { if (quest->GetQuestId() == 4322) - {PlayerStart = player; + { + PlayerStart = player; if (instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) { - CAST_AI(npc_escort::npc_escortAI, (creature->AI()))->Start(true, false, player->GetGUID()); - instance->SetData(DATA_QUEST_JAIL_BREAK, ENCOUNTER_STATE_IN_PROGRESS); - creature->setFaction(11); - } + CAST_AI(npc_escort::npc_escortAI, (creature->AI()))->Start(true, false, player->GetGUID()); + instance->SetData(DATA_QUEST_JAIL_BREAK, ENCOUNTER_STATE_IN_PROGRESS); + creature->setFaction(11); } + } return false; } struct npc_marshal_windsorAI : public npc_escortAI { - npc_marshal_windsorAI(Creature* c) : npc_escortAI(c) + npc_marshal_windsorAI(Creature* creature) : npc_escortAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - switch (i) + switch (waypointId) { - case 1: - me->Say(SAY_WINDSOR_1, LANG_UNIVERSAL, PlayerGUID); - break; - case 7: - me->HandleEmoteCommand(EMOTE_STATE_POINT); - me->Say(SAY_WINDSOR_4_1, LANG_UNIVERSAL, PlayerGUID); - IsOnHold=true; - break; - case 10: - me->setFaction(534); - break; - case 12: - me->Say(SAY_WINDSOR_6, LANG_UNIVERSAL, PlayerGUID); - instance->SetData(DATA_SUPPLY_ROOM, ENCOUNTER_STATE_IN_PROGRESS); - break; - case 13: - me->HandleEmoteCommand(EMOTE_STATE_USESTANDING);//EMOTE_STATE_WORK - break; - case 14: - instance->SetData(DATA_GATE_SR, 0); - me->setFaction(11); - break; - case 16: - me->Say(SAY_WINDSOR_9, LANG_UNIVERSAL, PlayerGUID); - break; - case 17: - me->HandleEmoteCommand(EMOTE_STATE_USESTANDING);//EMOTE_STATE_WORK - break; - case 18: - instance->SetData(DATA_GATE_SC, 0); - break; - case 19: - me->SetVisibility(VISIBILITY_OFF); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->SummonCreature(MOB_ENTRY_REGINALD_WINDSOR, 403.61f, -51.71f, -63.92f, 3.600434f, TEMPSUMMON_DEAD_DESPAWN, 0); - instance->SetData(DATA_SUPPLY_ROOM, ENCOUNTER_STATE_ENDED); - break; + case 1: + me->Say(SAY_WINDSOR_1, LANG_UNIVERSAL, PlayerGUID); + break; + case 7: + me->HandleEmoteCommand(EMOTE_STATE_POINT); + me->Say(SAY_WINDSOR_4_1, LANG_UNIVERSAL, PlayerGUID); + IsOnHold = true; + break; + case 10: + me->setFaction(534); + break; + case 12: + me->Say(SAY_WINDSOR_6, LANG_UNIVERSAL, PlayerGUID); + instance->SetData(DATA_SUPPLY_ROOM, ENCOUNTER_STATE_IN_PROGRESS); + break; + case 13: + me->HandleEmoteCommand(EMOTE_STATE_USESTANDING);//EMOTE_STATE_WORK + break; + case 14: + instance->SetData(DATA_GATE_SR, 0); + me->setFaction(11); + break; + case 16: + me->Say(SAY_WINDSOR_9, LANG_UNIVERSAL, PlayerGUID); + break; + case 17: + me->HandleEmoteCommand(EMOTE_STATE_USESTANDING);//EMOTE_STATE_WORK + break; + case 18: + instance->SetData(DATA_GATE_SC, 0); + break; + case 19: + me->SetVisible(false); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->SummonCreature(MOB_ENTRY_REGINALD_WINDSOR, 403.61f, -51.71f, -63.92f, 3.600434f, TEMPSUMMON_DEAD_DESPAWN, 0); + instance->SetData(DATA_SUPPLY_ROOM, ENCOUNTER_STATE_ENDED); + break; } } void EnterCombat(Unit* who) - { + { switch (urand(0, 2)) { - case 0: me->Say(SAY_WINDSOR_AGGRO1, LANG_UNIVERSAL, PlayerGUID); break; - case 1: me->Say(SAY_WINDSOR_AGGRO2, LANG_UNIVERSAL, PlayerGUID); break; - case 2: me->Say(SAY_WINDSOR_AGGRO3, LANG_UNIVERSAL, PlayerGUID); break; - } + case 0: + me->Say(SAY_WINDSOR_AGGRO1, LANG_UNIVERSAL, PlayerGUID); + break; + case 1: + me->Say(SAY_WINDSOR_AGGRO2, LANG_UNIVERSAL, PlayerGUID); + break; + case 2: + me->Say(SAY_WINDSOR_AGGRO3, LANG_UNIVERSAL, PlayerGUID); + break; } + } void Reset() {} @@ -795,28 +805,31 @@ public: void UpdateAI(const uint32 diff) { - if (instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return; + if (instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) + return; + if (instance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_OBJECTIVE_COMPLETED) SetEscortPaused(false); + if (!instance->GetData(DATA_GATE_D) && instance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_NOT_STARTED) - { + { me->Say(SAY_WINDSOR_4_2, LANG_UNIVERSAL, PlayerGUID); instance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_BEFORE_START); - } + } if (instance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_OBJECTIVE_COMPLETED) - { + { me->Say(SAY_WINDSOR_4_3, LANG_UNIVERSAL, PlayerGUID); instance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_ENDED); - } + } if ((instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS || instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_FAILED || instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_ENDED)&& instance->GetData(DATA_SUPPLY_ROOM) == ENCOUNTER_STATE_ENDED) { - me->SetVisibility(VISIBILITY_OFF); + me->SetVisible(false); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } else { - me->SetVisibility(VISIBILITY_ON); + me->SetVisible(true); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } @@ -897,65 +910,65 @@ public: struct npc_marshal_reginald_windsorAI : public npc_escortAI { - npc_marshal_reginald_windsorAI(Creature* c) : npc_escortAI(c) + npc_marshal_reginald_windsorAI(Creature* creature) : npc_escortAI(creature) { } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - wp=i; - switch (i) + wp = waypointId; + switch (waypointId) { - case 0: - me->setFaction(11); - me->Say(SAY_REGINALD_WINDSOR_0_1, LANG_UNIVERSAL, PlayerGUID); - break; - case 1: - me->Say(SAY_REGINALD_WINDSOR_0_2, LANG_UNIVERSAL, PlayerGUID); - break; - case 7: - me->HandleEmoteCommand(EMOTE_STATE_POINT); - me->Say(SAY_REGINALD_WINDSOR_5_1, LANG_UNIVERSAL, PlayerGUID); - IsOnHold=true; - break; - case 8: - me->Say(SAY_REGINALD_WINDSOR_5_2, LANG_UNIVERSAL, PlayerGUID); - break; - case 11: - me->HandleEmoteCommand(EMOTE_STATE_POINT); - me->Say(SAY_REGINALD_WINDSOR_7_1, LANG_UNIVERSAL, PlayerGUID); - IsOnHold=true; - break; - case 12: - me->Say(SAY_REGINALD_WINDSOR_7_2, LANG_UNIVERSAL, PlayerGUID); - break; - case 13: - me->Say(SAY_REGINALD_WINDSOR_7_3, LANG_UNIVERSAL, PlayerGUID); - break; - case 20: - me->HandleEmoteCommand(EMOTE_STATE_POINT); - me->Say(SAY_REGINALD_WINDSOR_13_1, LANG_UNIVERSAL, PlayerGUID); - IsOnHold=true; - break; - case 21: - me->Say(SAY_REGINALD_WINDSOR_13_3, LANG_UNIVERSAL, PlayerGUID); - break; - case 23: - me->HandleEmoteCommand(EMOTE_STATE_POINT); - me->Say(SAY_REGINALD_WINDSOR_14_1, LANG_UNIVERSAL, PlayerGUID); - IsOnHold=true; - break; - case 24: - me->Say(SAY_REGINALD_WINDSOR_14_2, LANG_UNIVERSAL, PlayerGUID); - break; - case 31: - me->Say(SAY_REGINALD_WINDSOR_20_1, LANG_UNIVERSAL, PlayerGUID); - break; - case 32: - me->Say(SAY_REGINALD_WINDSOR_20_2, LANG_UNIVERSAL, PlayerGUID); - PlayerStart->GroupEventHappens(QUEST_JAIL_BREAK, me); - instance->SetData(DATA_SHILL, ENCOUNTER_STATE_ENDED); - break; + case 0: + me->setFaction(11); + me->Say(SAY_REGINALD_WINDSOR_0_1, LANG_UNIVERSAL, PlayerGUID); + break; + case 1: + me->Say(SAY_REGINALD_WINDSOR_0_2, LANG_UNIVERSAL, PlayerGUID); + break; + case 7: + me->HandleEmoteCommand(EMOTE_STATE_POINT); + me->Say(SAY_REGINALD_WINDSOR_5_1, LANG_UNIVERSAL, PlayerGUID); + IsOnHold=true; + break; + case 8: + me->Say(SAY_REGINALD_WINDSOR_5_2, LANG_UNIVERSAL, PlayerGUID); + break; + case 11: + me->HandleEmoteCommand(EMOTE_STATE_POINT); + me->Say(SAY_REGINALD_WINDSOR_7_1, LANG_UNIVERSAL, PlayerGUID); + IsOnHold=true; + break; + case 12: + me->Say(SAY_REGINALD_WINDSOR_7_2, LANG_UNIVERSAL, PlayerGUID); + break; + case 13: + me->Say(SAY_REGINALD_WINDSOR_7_3, LANG_UNIVERSAL, PlayerGUID); + break; + case 20: + me->HandleEmoteCommand(EMOTE_STATE_POINT); + me->Say(SAY_REGINALD_WINDSOR_13_1, LANG_UNIVERSAL, PlayerGUID); + IsOnHold=true; + break; + case 21: + me->Say(SAY_REGINALD_WINDSOR_13_3, LANG_UNIVERSAL, PlayerGUID); + break; + case 23: + me->HandleEmoteCommand(EMOTE_STATE_POINT); + me->Say(SAY_REGINALD_WINDSOR_14_1, LANG_UNIVERSAL, PlayerGUID); + IsOnHold=true; + break; + case 24: + me->Say(SAY_REGINALD_WINDSOR_14_2, LANG_UNIVERSAL, PlayerGUID); + break; + case 31: + me->Say(SAY_REGINALD_WINDSOR_20_1, LANG_UNIVERSAL, PlayerGUID); + break; + case 32: + me->Say(SAY_REGINALD_WINDSOR_20_2, LANG_UNIVERSAL, PlayerGUID); + PlayerStart->GroupEventHappens(QUEST_JAIL_BREAK, me); + instance->SetData(DATA_SHILL, ENCOUNTER_STATE_ENDED); + break; } } @@ -979,14 +992,20 @@ public: } void EnterCombat(Unit* who) - { + { switch (urand(0, 2)) { - case 0: me->Say(SAY_WINDSOR_AGGRO1, LANG_UNIVERSAL, PlayerGUID); break; - case 1: me->Say(SAY_WINDSOR_AGGRO2, LANG_UNIVERSAL, PlayerGUID); break; - case 2: me->Say(SAY_WINDSOR_AGGRO3, LANG_UNIVERSAL, PlayerGUID); break; - } + case 0: + me->Say(SAY_WINDSOR_AGGRO1, LANG_UNIVERSAL, PlayerGUID); + break; + case 1: + me->Say(SAY_WINDSOR_AGGRO2, LANG_UNIVERSAL, PlayerGUID); + break; + case 2: + me->Say(SAY_WINDSOR_AGGRO3, LANG_UNIVERSAL, PlayerGUID); + break; } + } void Reset() {} void JustDied(Unit* slayer) @@ -996,47 +1015,49 @@ public: void UpdateAI(const uint32 diff) { - if (instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return; + if (instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) + return; + if (wp == 7) - { + { if (!instance->GetData(DATA_GATE_J) && instance->GetData(DATA_JAZ) == ENCOUNTER_STATE_NOT_STARTED) - { - instance->SetData(DATA_CREATURE_JAZ, 1); - instance->SetData(DATA_JAZ, ENCOUNTER_STATE_IN_PROGRESS); - } + { + instance->SetData(DATA_CREATURE_JAZ, 1); + instance->SetData(DATA_JAZ, ENCOUNTER_STATE_IN_PROGRESS); + } if (instance->GetData(DATA_CREATURE_JAZ) && instance->GetData(DATA_CREATURE_OGRABISI) && instance->GetData(DATA_JAZ) == ENCOUNTER_STATE_IN_PROGRESS) - { - SetEscortPaused(false); - instance->SetData(DATA_JAZ, ENCOUNTER_STATE_ENDED); - } + { + SetEscortPaused(false); + instance->SetData(DATA_JAZ, ENCOUNTER_STATE_ENDED); } + } else if (wp == 11) - { + { if (!instance->GetData(DATA_GATE_S) && instance->GetData(DATA_SHILL) == ENCOUNTER_STATE_NOT_STARTED) - { - instance->SetData(DATA_CREATURE_SHILL, 1); - instance->SetData(DATA_SHILL, ENCOUNTER_STATE_IN_PROGRESS); - } + { + instance->SetData(DATA_CREATURE_SHILL, 1); + instance->SetData(DATA_SHILL, ENCOUNTER_STATE_IN_PROGRESS); + } if (instance->GetData(DATA_CREATURE_SHILL) && instance->GetData(DATA_SHILL) == ENCOUNTER_STATE_IN_PROGRESS) - { - instance->SetData(DATA_SHILL, ENCOUNTER_STATE_ENDED); - SetEscortPaused(false); - } + { + instance->SetData(DATA_SHILL, ENCOUNTER_STATE_ENDED); + SetEscortPaused(false); } + } else if (wp == 20) - { + { if (!instance->GetData(DATA_GATE_C) && instance->GetData(DATA_CREST) == ENCOUNTER_STATE_NOT_STARTED) - { - instance->SetData(DATA_CREATURE_CREST, 1); - me->Say(SAY_REGINALD_WINDSOR_13_2, LANG_UNIVERSAL, PlayerGUID); - instance->SetData(DATA_CREST, ENCOUNTER_STATE_IN_PROGRESS); - } + { + instance->SetData(DATA_CREATURE_CREST, 1); + me->Say(SAY_REGINALD_WINDSOR_13_2, LANG_UNIVERSAL, PlayerGUID); + instance->SetData(DATA_CREST, ENCOUNTER_STATE_IN_PROGRESS); + } if (instance->GetData(DATA_CREATURE_CREST) && instance->GetData(DATA_CREST) == ENCOUNTER_STATE_IN_PROGRESS) - { - SetEscortPaused(false); - instance->SetData(DATA_CREST, ENCOUNTER_STATE_ENDED); - } + { + SetEscortPaused(false); + instance->SetData(DATA_CREST, ENCOUNTER_STATE_ENDED); } + } if (instance->GetData(DATA_TOBIAS) == ENCOUNTER_STATE_OBJECTIVE_COMPLETED) SetEscortPaused(false); npc_escortAI::UpdateAI(diff); } @@ -1046,6 +1067,7 @@ public: // npc_tobias_seecher #define SAY_TOBIAS_FREE "Thank you! I will run for safety immediately!" + /* class npc_tobias_seecher : public CreatureScript { @@ -1065,7 +1087,7 @@ public: return tobias_seecherAI; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 Sender, uint32 action) + bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action) { player->PlayerTalkClass->ClearMenus(); if (action == GOSSIP_ACTION_INFO_DEF + 1) @@ -1090,7 +1112,7 @@ public: struct npc_tobias_seecherAI : public npc_escortAI { - npc_tobias_seecherAI(Creature* c) :npc_escortAI(c) {} + npc_tobias_seecherAI(Creature* creature) : npc_escortAI(creature) {} void EnterCombat(Unit* who) {} void Reset() {} @@ -1099,41 +1121,46 @@ public: { if (IsBeingEscorted && killer == me) { - me->SetVisibility(VISIBILITY_OFF); + me->SetVisible(false); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); instance->SetData(DATA_TOBIAS, ENCOUNTER_STATE_ENDED); } } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - switch (i) + switch (waypointId) { - case 0:me->Say(SAY_TOBIAS_FREE, LANG_UNIVERSAL, PlayerGUID); break; - case 2: - instance->SetData(DATA_TOBIAS, ENCOUNTER_STATE_OBJECTIVE_COMPLETED);break; - case 4: - me->SetVisibility(VISIBILITY_OFF); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - instance->SetData(DATA_TOBIAS, ENCOUNTER_STATE_ENDED); - break; + case 0: + me->Say(SAY_TOBIAS_FREE, LANG_UNIVERSAL, PlayerGUID); + break; + case 2: + instance->SetData(DATA_TOBIAS, ENCOUNTER_STATE_OBJECTIVE_COMPLETED); + break; + case 4: + me->SetVisible(false); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + instance->SetData(DATA_TOBIAS, ENCOUNTER_STATE_ENDED); + break; } } void UpdateAI(const uint32 diff) { - if (instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return; + if (instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) + return; + if ((instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS || instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_FAILED || instance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_ENDED)&& instance->GetData(DATA_TOBIAS) == ENCOUNTER_STATE_ENDED) { - me->SetVisibility(VISIBILITY_OFF); + me->SetVisible(false); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } else { - me->SetVisibility(VISIBILITY_ON); + me->SetVisible(true); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } @@ -1217,8 +1244,8 @@ public: if (HasEscortState(STATE_ESCORT_ESCORTING)) return; - BreakKeg_Timer = 0; - BreakDoor_Timer = 0; + BreakKeg_Timer = 0; + BreakDoor_Timer = 0; } void DoGo(uint32 id, uint32 state) @@ -1227,29 +1254,29 @@ public: go->SetGoState((GOState)state); } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { if (!instance) return; - switch (i) + switch (waypointId) { - case 1: - me->HandleEmoteCommand(EMOTE_ONESHOT_KICK); - break; - case 2: - me->HandleEmoteCommand(EMOTE_ONESHOT_ATTACK_UNARMED); - break; - case 3: - me->HandleEmoteCommand(EMOTE_ONESHOT_ATTACK_UNARMED); - break; - case 4: - me->HandleEmoteCommand(EMOTE_ONESHOT_KICK); - break; - case 5: - me->HandleEmoteCommand(EMOTE_ONESHOT_KICK); - BreakKeg_Timer = 2000; - break; + case 1: + me->HandleEmoteCommand(EMOTE_ONESHOT_KICK); + break; + case 2: + me->HandleEmoteCommand(EMOTE_ONESHOT_ATTACK_UNARMED); + break; + case 3: + me->HandleEmoteCommand(EMOTE_ONESHOT_ATTACK_UNARMED); + break; + case 4: + me->HandleEmoteCommand(EMOTE_ONESHOT_KICK); + break; + case 5: + me->HandleEmoteCommand(EMOTE_ONESHOT_KICK); + BreakKeg_Timer = 2000; + break; } } @@ -1263,8 +1290,8 @@ public: if (BreakKeg_Timer <= diff) { DoGo(DATA_GO_BAR_KEG, 0); - BreakKeg_Timer = 0; - BreakDoor_Timer = 1000; + BreakKeg_Timer = 0; + BreakDoor_Timer = 1000; } else BreakKeg_Timer -= diff; } diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_ambassador_flamelash.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_ambassador_flamelash.cpp index 2e8dc029d44..ff0f1a4cedd 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_ambassador_flamelash.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_ambassador_flamelash.cpp @@ -42,8 +42,8 @@ public: void Reset() { - FireBlast_Timer = 2000; - Spirit_Timer = 24000; + FireBlast_Timer = 2000; + Spirit_Timer = 24000; } void EnterCombat(Unit* /*who*/) {} diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_anubshiah.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_anubshiah.cpp index b4a4c416693..2585796e28e 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_anubshiah.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_anubshiah.cpp @@ -49,11 +49,11 @@ public: void Reset() { - ShadowBolt_Timer = 7000; - CurseOfTongues_Timer = 24000; - CurseOfWeakness_Timer = 12000; - DemonArmor_Timer = 3000; - EnvelopingWeb_Timer = 16000; + ShadowBolt_Timer = 7000; + CurseOfTongues_Timer = 24000; + CurseOfWeakness_Timer = 12000; + DemonArmor_Timer = 3000; + EnvelopingWeb_Timer = 16000; } void EnterCombat(Unit* /*who*/) {} diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp index e894fd35bd1..073c4fde82a 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp @@ -55,9 +55,9 @@ public: void Reset() { - HandOfThaurissan_Timer = 4000; - AvatarOfFlame_Timer = 25000; - //Counter = 0; + HandOfThaurissan_Timer = 4000; + AvatarOfFlame_Timer = 25000; + //Counter= 0; } void EnterCombat(Unit* /*who*/) @@ -71,7 +71,7 @@ public: DoScriptText(SAY_SLAY, me); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (Creature* Moira = ObjectAccessor::GetCreature(*me, instance ? instance->GetData64(DATA_MOIRA) : 0)) { @@ -100,7 +100,7 @@ public: //else //{ HandOfThaurissan_Timer = 5000; - //Counter = 0; + //Counter = 0; //} } else HandOfThaurissan_Timer -= diff; diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_general_angerforge.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_general_angerforge.cpp index 69808386423..703f684cc9f 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_general_angerforge.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_general_angerforge.cpp @@ -47,11 +47,11 @@ public: void Reset() { - MightyBlow_Timer = 8000; - HamString_Timer = 12000; - Cleave_Timer = 16000; - Adds_Timer = 0; - Medics = false; + MightyBlow_Timer = 8000; + HamString_Timer = 12000; + Cleave_Timer = 16000; + Adds_Timer = 0; + Medics = false; } void EnterCombat(Unit* /*who*/) {} diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_gorosh_the_dervish.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_gorosh_the_dervish.cpp index 883c601709e..b2c93d949c2 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_gorosh_the_dervish.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_gorosh_the_dervish.cpp @@ -43,8 +43,8 @@ public: void Reset() { - WhirlWind_Timer = 12000; - MortalStrike_Timer = 22000; + WhirlWind_Timer = 12000; + MortalStrike_Timer = 22000; } void EnterCombat(Unit* /*who*/) diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_grizzle.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_grizzle.cpp index 7686ece3c2e..63d945ade90 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_grizzle.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_grizzle.cpp @@ -43,8 +43,8 @@ public: void Reset() { - GroundTremor_Timer = 12000; - Frenzy_Timer = 0; + GroundTremor_Timer = 12000; + Frenzy_Timer =0; } void EnterCombat(Unit* /*who*/) {} diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_high_interrogator_gerstahn.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_high_interrogator_gerstahn.cpp index 26e2bc80eb2..f4f245be4be 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_high_interrogator_gerstahn.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_high_interrogator_gerstahn.cpp @@ -47,10 +47,10 @@ public: void Reset() { - ShadowWordPain_Timer = 4000; - ManaBurn_Timer = 14000; - PsychicScream_Timer = 32000; - ShadowShield_Timer = 8000; + ShadowWordPain_Timer = 4000; + ManaBurn_Timer = 14000; + PsychicScream_Timer = 32000; + ShadowShield_Timer = 8000; } void EnterCombat(Unit* /*who*/) {} diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_magmus.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_magmus.cpp index 141b8307b7b..3d2cc627145 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_magmus.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_magmus.cpp @@ -48,8 +48,8 @@ public: void Reset() { - FieryBurst_Timer = 5000; - WarStomp_Timer = 0; + FieryBurst_Timer = 5000; + WarStomp_Timer =0; } void EnterCombat(Unit* /*who*/) {} @@ -80,9 +80,9 @@ public: DoMeleeAttackIfReady(); } // When he die open door to last chamber - void JustDied(Unit* who) + void JustDied(Unit* killer) { - if (InstanceScript* instance = who->GetInstanceScript()) + if (InstanceScript* instance = killer->GetInstanceScript()) instance->HandleGameObject(instance->GetData64(DATA_THRONE_DOOR), true); } }; diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_moira_bronzebeard.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_moira_bronzebeard.cpp index 72a60daea2d..e6f65ab4252 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_moira_bronzebeard.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_moira_bronzebeard.cpp @@ -49,10 +49,10 @@ public: void Reset() { - Heal_Timer = 12000; // These times are probably wrong - MindBlast_Timer = 16000; - ShadowWordPain_Timer = 2000; - Smite_Timer = 8000; + Heal_Timer = 12000; //These times are probably wrong + MindBlast_Timer = 16000; + ShadowWordPain_Timer = 2000; + Smite_Timer = 8000; } void EnterCombat(Unit* /*who*/) {} diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp index 3c8d5fc4fa8..211930e4f1a 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp @@ -45,7 +45,7 @@ class boss_gloomrel : public CreatureScript public: boss_gloomrel() : CreatureScript("boss_gloomrel") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*Sender*/, uint32 action) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); switch (action) @@ -104,7 +104,7 @@ class boss_doomrel : public CreatureScript public: boss_doomrel() : CreatureScript("boss_doomrel") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*Sender*/, uint32 action) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); switch (action) @@ -156,11 +156,11 @@ public: void Reset() { - ShadowVolley_Timer = 10000; - Immolate_Timer = 18000; - CurseOfWeakness_Timer = 5000; - DemonArmor_Timer = 16000; - Voidwalkers = false; + ShadowVolley_Timer = 10000; + Immolate_Timer = 18000; + CurseOfWeakness_Timer = 5000; + DemonArmor_Timer = 16000; + Voidwalkers = false; me->setFaction(FACTION_FRIEND); @@ -193,7 +193,7 @@ public: instance->SetData64(DATA_EVENSTARTER, 0); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(DATA_GHOSTKILL, 1); diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp index 2ef3ef48ecb..03cb077936b 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp @@ -115,57 +115,57 @@ public: { memset(&encounter, 0, sizeof(encounter)); - EmperorGUID = 0; - PhalanxGUID = 0; - MagmusGUID = 0; - MoiraGUID = 0; - - GoArena1GUID = 0; - GoArena2GUID = 0; - GoArena3GUID = 0; - GoArena4GUID = 0; - GoShadowLockGUID = 0; - GoShadowMechGUID = 0; - GoShadowGiantGUID = 0; - GoShadowDummyGUID = 0; - GoBarKegGUID = 0; - GoBarKegTrapGUID = 0; - GoBarDoorGUID = 0; - GoTombEnterGUID = 0; - GoTombExitGUID = 0; - GoLyceumGUID = 0; - GoSFSGUID = 0; - GoSFNGUID = 0; - GoGolemNGUID = 0; - GoGolemSGUID = 0; - GoThroneGUID = 0; - GoChestGUID = 0; - GoSpectralChaliceGUID = 0; - - BarAleCount = 0; - GhostKillCount = 0; - TombEventStarterGUID = 0; + EmperorGUID = 0; + PhalanxGUID = 0; + MagmusGUID = 0; + MoiraGUID = 0; + + GoArena1GUID = 0; + GoArena2GUID = 0; + GoArena3GUID = 0; + GoArena4GUID = 0; + GoShadowLockGUID = 0; + GoShadowMechGUID = 0; + GoShadowGiantGUID = 0; + GoShadowDummyGUID = 0; + GoBarKegGUID = 0; + GoBarKegTrapGUID = 0; + GoBarDoorGUID = 0; + GoTombEnterGUID = 0; + GoTombExitGUID = 0; + GoLyceumGUID = 0; + GoSFSGUID = 0; + GoSFNGUID = 0; + GoGolemNGUID = 0; + GoGolemSGUID = 0; + GoThroneGUID = 0; + GoChestGUID = 0; + GoSpectralChaliceGUID = 0; + + BarAleCount = 0; + GhostKillCount = 0; + TombEventStarterGUID = 0; TombTimer = TIMER_TOMBOFTHESEVEN; - TombEventCounter = 0; + TombEventCounter = 0; for (uint8 i = 0; i < 7; ++i) - TombBossGUIDs[i] = 0; + TombBossGUIDs[i] = 0; } void OnCreatureCreate(Creature* creature) { switch (creature->GetEntry()) { - case NPC_EMPEROR: EmperorGUID = creature->GetGUID(); break; - case NPC_PHALANX: PhalanxGUID = creature->GetGUID(); break; - case NPC_MOIRA: MoiraGUID = creature->GetGUID(); break; - case NPC_DOOMREL: TombBossGUIDs[0] = creature->GetGUID(); break; - case NPC_DOPEREL: TombBossGUIDs[1] = creature->GetGUID(); break; - case NPC_HATEREL: TombBossGUIDs[2] = creature->GetGUID(); break; - case NPC_VILEREL: TombBossGUIDs[3] = creature->GetGUID(); break; - case NPC_SEETHREL: TombBossGUIDs[4] = creature->GetGUID(); break; - case NPC_GLOOMREL: TombBossGUIDs[5] = creature->GetGUID(); break; - case NPC_ANGERREL: TombBossGUIDs[6] = creature->GetGUID(); break; + case NPC_EMPEROR: EmperorGUID = creature->GetGUID(); break; + case NPC_PHALANX: PhalanxGUID = creature->GetGUID(); break; + case NPC_MOIRA: MoiraGUID = creature->GetGUID(); break; + case NPC_DOOMREL: TombBossGUIDs[0] = creature->GetGUID(); break; + case NPC_DOPEREL: TombBossGUIDs[1] = creature->GetGUID(); break; + case NPC_HATEREL: TombBossGUIDs[2] = creature->GetGUID(); break; + case NPC_VILEREL: TombBossGUIDs[3] = creature->GetGUID(); break; + case NPC_SEETHREL: TombBossGUIDs[4] = creature->GetGUID(); break; + case NPC_GLOOMREL: TombBossGUIDs[5] = creature->GetGUID(); break; + case NPC_ANGERREL: TombBossGUIDs[6] = creature->GetGUID(); break; case NPC_MAGMUS: MagmusGUID = creature->GetGUID(); if (!creature->isAlive()) diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.h b/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.h index e51c6b9130d..0af2af948d3 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.h +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.h @@ -33,7 +33,8 @@ enum Data DATA_WARCHIEF_REND_BLACKHAND, DATA_GYTH, DATA_THE_BEAST, - DATA_GENERAL_DRAKKISATH + DATA_GENERAL_DRAKKISATH, + DATA_DRAGONSPIRE_ROOM, }; enum Npc { @@ -51,17 +52,51 @@ enum Npc NPC_GYTH = 10339, NPC_THE_BEAST = 10430, NPC_GENERAL_DRAKKISATH = 10363, + NPC_BLACKHAND_DREADWEAVER = 9817, + NPC_BLACKHAND_SUMMONER = 9818, + NPC_BLACKHAND_VETERAN = 9819, }; enum AdditionalData { SPELL_SUMMON_ROOKERY_WHELP = 15745, MAX_ENCOUNTER = 14, + MAX_DRAGONSPIRE_HALL_RUNES = 7, + EVENT_PYROGUARD_EMBERSEER = 4884, + AREATRIGGER_ENTER_UBRS = 2046, + AREATRIGGER_STADIUM = 2026, }; enum GameObjects { - GO_WHELP_SPAWNER = 175622, //trap spawned by go id 175124 + GO_WHELP_SPAWNER = 175622, // trap spawned by go id 175124 + + // Doors + GO_EMBERSEER_IN = 175244, // First door to Pyroguard Emberseer + GO_DOORS = 175705, // Second door to Pyroguard Emberseer + GO_EMBERSEER_OUT = 175153, // Door after Pyroguard Emberseer event + GO_GYTH_ENTRY_DOOR = 164726, + GO_GYTH_COMBAT_DOOR = 175185, + GO_GYTH_EXIT_DOOR = 175186, + GO_DRAKKISATH_DOOR_1 = 175946, + GO_DRAKKISATH_DOOR_2 = 175947, + + // Runes + GO_ROOM_1_RUNE = 175197, + GO_ROOM_2_RUNE = 175199, + GO_ROOM_3_RUNE = 175195, + GO_ROOM_4_RUNE = 175200, + GO_ROOM_5_RUNE = 175198, + GO_ROOM_6_RUNE = 175196, + GO_ROOM_7_RUNE = 175194, + + GO_EMBERSEER_RUNE_1 = 175266, + GO_EMBERSEER_RUNE_2 = 175267, + GO_EMBERSEER_RUNE_3 = 175268, + GO_EMBERSEER_RUNE_4 = 175269, + GO_EMBERSEER_RUNE_5 = 175270, + GO_EMBERSEER_RUNE_6 = 175271, + GO_EMBERSEER_RUNE_7 = 175272, }; #endif diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_drakkisath.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_drakkisath.cpp index ff17e989cd9..ff40094debd 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_drakkisath.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_drakkisath.cpp @@ -64,7 +64,7 @@ public: events.ScheduleEvent(EVENT_THUNDERCLAP, 17 * IN_MILLISECONDS); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { _JustDied(); } diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp index 0d8cabcf89c..214ce4e02f3 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp @@ -79,7 +79,7 @@ public: events.ScheduleEvent(EVENT_AGGRO, 60 * IN_MILLISECONDS); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { _JustDied(); } @@ -117,7 +117,7 @@ public: // Interrupt any spell casting me->InterruptNonMeleeSpells(false); // Gyth model - me->SetDisplayId(me->GetCreatureInfo()->Modelid1); + me->SetDisplayId(me->GetCreatureTemplate()->Modelid1); me->SummonCreature(NPC_WARCHIEF_REND_BLACKHAND, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 900 * IN_MILLISECONDS); events.ScheduleEvent(EVENT_CORROSIVE_ACID, 8 * IN_MILLISECONDS); events.ScheduleEvent(EVENT_FREEZE, 11 * IN_MILLISECONDS); diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_halycon.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_halycon.cpp index a944ee6daf8..c5d566c51cb 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_halycon.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_halycon.cpp @@ -63,7 +63,7 @@ public: events.ScheduleEvent(EVENT_MIGHTY_BLOW, 14 * IN_MILLISECONDS); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { _JustDied(); } diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_highlord_omokk.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_highlord_omokk.cpp index bc9de52d91d..027952dc74a 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_highlord_omokk.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_highlord_omokk.cpp @@ -73,7 +73,7 @@ public: events.ScheduleEvent(EVENT_SLOW, 24 * IN_MILLISECONDS); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { _JustDied(); } diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_mother_smolderweb.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_mother_smolderweb.cpp index 973ffe7e53b..c455b1d404d 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_mother_smolderweb.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_mother_smolderweb.cpp @@ -59,7 +59,7 @@ public: events.ScheduleEvent(EVENT_MOTHERS_MILK, 10 * IN_MILLISECONDS); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { _JustDied(); } diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_overlord_wyrmthalak.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_overlord_wyrmthalak.cpp index b7492998d56..0c23f55bd39 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_overlord_wyrmthalak.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_overlord_wyrmthalak.cpp @@ -77,7 +77,7 @@ public: events.ScheduleEvent(EVENT_KNOCK_AWAY, 12 * IN_MILLISECONDS); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { _JustDied(); } diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp index d76d0d7f47c..0279f3e2834 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp @@ -20,11 +20,24 @@ #include "ScriptedCreature.h" #include "blackrock_spire.h" +enum Text +{ + EMOTE_ONE_STACK = 0, + EMOTE_TEN_STACK = 1, + EMOTE_FREE_OF_BONDS = 2, + YELL_FREE_OF_BONDS = 3, +}; + enum Spells { - SPELL_FIRENOVA = 23462, - SPELL_FLAMEBUFFET = 23341, - SPELL_PYROBLAST = 17274, + SPELL_ENCAGED_EMBERSEER = 15282, // Self on spawn + SPELL_FIRE_SHIELD_TRIGGER = 13377, // Self on spawn missing from 335 dbc + SPELL_FREEZE_ANIM = 16245, // Self on event start + SPELL_EMBERSEER_GROWING = 16048, // Self on event start + SPELL_EMBERSEER_FULL_STRENGTH = 16047, // Emberseer Full Strength + SPELL_FIRENOVA = 23462, // Combat + SPELL_FLAMEBUFFET = 23341, // Combat + SPELL_PYROBLAST = 17274, // Combat }; enum Events @@ -51,6 +64,12 @@ public: void Reset() { + if(instance->GetBossState(DATA_PYROGAURD_EMBERSEER) == IN_PROGRESS) + OpenDoors(false); + instance->SetBossState(DATA_PYROGAURD_EMBERSEER,NOT_STARTED); + // respawn any dead Blackhand Incarcerators + DoCast(me, SPELL_ENCAGED_EMBERSEER); + //DoCast(me, SPELL_FIRE_SHIELD_TRIGGER); _Reset(); } @@ -62,14 +81,28 @@ public: events.ScheduleEvent(EVENT_PYROBLAST, 14 * IN_MILLISECONDS); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { + instance->SetBossState(DATA_PYROGAURD_EMBERSEER,DONE); + OpenDoors(true); _JustDied(); } + void OpenDoors(bool Boss_Killed) + { + if (GameObject* door1 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_IN))) + door1->SetGoState(GO_STATE_ACTIVE); + if (GameObject* door2 = me->GetMap()->GetGameObject(instance->GetData64(GO_DOORS))) + door2->SetGoState(GO_STATE_ACTIVE); + if (Boss_Killed) + if (GameObject* door3 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_OUT))) + door3->SetGoState(GO_STATE_ACTIVE); + } + void UpdateAI(uint32 const diff) { if (!UpdateVictim()) + return; events.Update(diff); diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_quartermaster_zigris.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_quartermaster_zigris.cpp index 4fb7e513f5d..d1eb60fbb71 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_quartermaster_zigris.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_quartermaster_zigris.cpp @@ -60,7 +60,7 @@ public: events.ScheduleEvent(EVENT_STUN_BOMB, 16 * IN_MILLISECONDS); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { _JustDied(); } diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp index ce19a03571a..1f7e3697a6d 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp @@ -61,7 +61,7 @@ public: events.ScheduleEvent(EVENT_THUNDERCLAP, 9 * IN_MILLISECONDS); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { _JustDied(); } diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp index f93466cbece..99e87dc617b 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp @@ -62,7 +62,7 @@ public: events.ScheduleEvent(EVENT_CLEAVE, 14 * IN_MILLISECONDS); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { _JustDied(); } diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_the_beast.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_the_beast.cpp index 88a09d57138..843679b460d 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_the_beast.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_the_beast.cpp @@ -61,7 +61,7 @@ public: events.ScheduleEvent(EVENT_TERRIFYING_ROAR, 23 * IN_MILLISECONDS); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { _JustDied(); } diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_warmaster_voone.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_warmaster_voone.cpp index 2dc05799e51..a3891ef8590 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_warmaster_voone.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_warmaster_voone.cpp @@ -70,7 +70,7 @@ public: events.ScheduleEvent(EVENT_THROW_AXE, 1 * IN_MILLISECONDS); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { _JustDied(); } diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/instance_blackrock_spire.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/instance_blackrock_spire.cpp index ff97984fa09..fdb73fe1196 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/instance_blackrock_spire.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/instance_blackrock_spire.cpp @@ -49,6 +49,12 @@ public: uint64 Gyth; uint64 TheBeast; uint64 GeneralDrakkisath; + uint64 go_emberseerin; + uint64 go_doors; + uint64 go_emberseerout; + uint64 go_roomrunes[MAX_DRAGONSPIRE_HALL_RUNES]; + uint8 Runemaxprotectors[MAX_DRAGONSPIRE_HALL_RUNES]; + uint8 Runeprotectorsdead[MAX_DRAGONSPIRE_HALL_RUNES]; void Initialize() { @@ -67,6 +73,9 @@ public: Gyth = 0; TheBeast = 0; GeneralDrakkisath = 0; + go_emberseerin = 0; + go_doors = 0; + go_emberseerout = 0; } bool IsEncounterInProgress() const @@ -125,7 +134,11 @@ public: case NPC_GENERAL_DRAKKISATH: GeneralDrakkisath = creature->GetGUID(); break; - } + case NPC_BLACKHAND_DREADWEAVER: + case NPC_BLACKHAND_SUMMONER: + case NPC_BLACKHAND_VETERAN: + break; + } } void OnGameObjectCreate(GameObject* go) @@ -135,6 +148,36 @@ public: case GO_WHELP_SPAWNER: go->CastSpell(NULL, SPELL_SUMMON_ROOKERY_WHELP); break; + case GO_EMBERSEER_IN: + go_emberseerin = go->GetGUID(); + break; + case GO_DOORS: + go_doors = go->GetGUID(); + break; + case GO_EMBERSEER_OUT: + go_emberseerout = go->GetGUID(); + break; + case GO_ROOM_1_RUNE: + go_roomrunes[0] = go->GetGUID(); + break; + case GO_ROOM_2_RUNE: + go_roomrunes[1] = go->GetGUID(); + break; + case GO_ROOM_3_RUNE: + go_roomrunes[2] = go->GetGUID(); + break; + case GO_ROOM_4_RUNE: + go_roomrunes[3] = go->GetGUID(); + break; + case GO_ROOM_5_RUNE: + go_roomrunes[4] = go->GetGUID(); + break; + case GO_ROOM_6_RUNE: + go_roomrunes[5] = go->GetGUID(); + break; + case GO_ROOM_7_RUNE: + go_roomrunes[6] = go->GetGUID(); + break; } } @@ -167,6 +210,18 @@ public: return true; } + void ProcessEvent(WorldObject* /*gameObject*/, uint32 eventId) + { + switch (eventId) + { + case EVENT_PYROGUARD_EMBERSEER: + SetBossState(DATA_PYROGAURD_EMBERSEER,IN_PROGRESS); + break; + default: + break; + } + } + uint64 GetData64(uint32 type) { switch (type) @@ -199,6 +254,26 @@ public: return TheBeast; case DATA_GENERAL_DRAKKISATH: return GeneralDrakkisath; + case GO_EMBERSEER_IN: + return go_emberseerin; + case GO_DOORS: + return go_doors; + case GO_EMBERSEER_OUT: + return go_emberseerout; + case GO_ROOM_1_RUNE: + return go_roomrunes[0]; + case GO_ROOM_2_RUNE: + return go_roomrunes[1]; + case GO_ROOM_3_RUNE: + return go_roomrunes[2]; + case GO_ROOM_4_RUNE: + return go_roomrunes[3]; + case GO_ROOM_5_RUNE: + return go_roomrunes[4]; + case GO_ROOM_6_RUNE: + return go_roomrunes[5]; + case GO_ROOM_7_RUNE: + return go_roomrunes[6]; } return 0; diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp index 7a4ba5777d1..af0dfd38ae8 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp @@ -59,10 +59,10 @@ public: void Reset() { - Cleave_Timer = 8000; // These times are probably wrong - BlastWave_Timer = 12000; - MortalStrike_Timer = 20000; - KnockBack_Timer = 30000; + Cleave_Timer = 8000; // These times are probably wrong + BlastWave_Timer = 12000; + MortalStrike_Timer = 20000; + KnockBack_Timer = 30000; } void EnterCombat(Unit* /*who*/) diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp index 818dcace078..a3eb0cea5ad 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp @@ -245,7 +245,7 @@ public: Unit* unit; if ((*i) && (*i)->getSource()) { - unit = Unit::GetUnit((*me), (*i)->getUnitGuid()); + unit = Unit::GetUnit(*me, (*i)->getUnitGuid()); if (unit) { //Cast affliction diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp index c4e0d6ea715..5d4cc442a49 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp @@ -92,15 +92,15 @@ public: void Reset() { - ShadowFlame_Timer = 12000; // These times are probably wrong - BellowingRoar_Timer = 30000; - VeilOfShadow_Timer = 15000; - Cleave_Timer = 7000; - TailLash_Timer = 10000; - ClassCall_Timer = 35000; // 35-40 seconds + ShadowFlame_Timer = 12000; // These times are probably wrong + BellowingRoar_Timer = 30000; + VeilOfShadow_Timer = 15000; + Cleave_Timer = 7000; + TailLash_Timer = 10000; + ClassCall_Timer = 35000; // 35-40 seconds Phase3 = false; - DespawnTimer = 5000; + DespawnTimer = 5000; } void KilledUnit(Unit* Victim) @@ -111,7 +111,7 @@ public: DoScriptText(SAY_SLAY, me, Victim); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); } diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp index a4fb4ad22a3..24fc74cc7cb 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp @@ -75,7 +75,7 @@ public: DoZoneInCombat(); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); } diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp index 4a72bd0ca38..eaa8c118f19 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp @@ -51,20 +51,20 @@ class boss_vaelastrasz : public CreatureScript public: boss_vaelastrasz() : CreatureScript("boss_vaelastrasz") { } - void SendDefaultMenu(Player* player, Creature* creature, uint32 Action) + void SendDefaultMenu(Player* player, Creature* creature, uint32 action) { - if (Action == GOSSIP_ACTION_INFO_DEF + 1) //Fight time + if (action == GOSSIP_ACTION_INFO_DEF + 1) //Fight time { player->CLOSE_GOSSIP_MENU(); CAST_AI(boss_vaelastrasz::boss_vaelAI, creature->AI())->BeginSpeech(player); } } - bool OnGossipSelect(Player* player, Creature* creature, uint32 Sender, uint32 Action) + bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (Sender == GOSSIP_SENDER_MAIN) - SendDefaultMenu(player, creature, Action); + if (sender == GOSSIP_SENDER_MAIN) + SendDefaultMenu(player, creature, action); return true; } @@ -108,17 +108,17 @@ public: void Reset() { - PlayerGUID = 0; - SpeechTimer = 0; - SpeechNum = 0; - Cleave_Timer = 8000; //These times are probably wrong - FlameBreath_Timer = 11000; - BurningAdrenalineCaster_Timer = 15000; - BurningAdrenalineTank_Timer = 45000; - FireNova_Timer = 5000; - TailSwipe_Timer = 20000; - HasYelled = false; - DoingSpeech = false; + PlayerGUID = 0; + SpeechTimer = 0; + SpeechNum = 0; + Cleave_Timer = 8000; // These times are probably wrong + FlameBreath_Timer = 11000; + BurningAdrenalineCaster_Timer = 15000; + BurningAdrenalineTank_Timer = 45000; + FireNova_Timer = 5000; + TailSwipe_Timer = 20000; + HasYelled = false; + DoingSpeech = false; } void BeginSpeech(Unit* target) @@ -176,9 +176,9 @@ public: break; case 2: me->setFaction(103); - if (PlayerGUID && Unit::GetUnit((*me), PlayerGUID)) + if (PlayerGUID && Unit::GetUnit(*me, PlayerGUID)) { - AttackStart(Unit::GetUnit((*me), PlayerGUID)); + AttackStart(Unit::GetUnit(*me, PlayerGUID)); DoCast(me, SPELL_ESSENCEOFTHERED); } SpeechTimer = 0; diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp index 2c7cd73c604..668b84d38dd 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp @@ -83,10 +83,10 @@ class boss_victor_nefarius : public CreatureScript public: boss_victor_nefarius() : CreatureScript("boss_victor_nefarius") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*Sender*/, uint32 Action) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (Action) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); @@ -220,13 +220,13 @@ public: void Reset() { - SpawnedAdds = 0; - AddSpawnTimer = 10000; - ShadowBoltTimer = 5000; - FearTimer = 8000; - ResetTimer = 900000; //On official it takes him 15 minutes(900 seconds) to reset. We are only doing 1 minute to make testing easier - NefarianGUID = 0; - NefCheckTime = 2000; + SpawnedAdds = 0; + AddSpawnTimer = 10000; + ShadowBoltTimer = 5000; + FearTimer = 8000; + ResetTimer = 900000; // On official it takes him 15 minutes(900 seconds) to reset. We are only doing 1 minute to make testing easier + NefarianGUID = 0; + NefCheckTime = 2000; me->SetUInt32Value(UNIT_NPC_FLAGS, 1); me->setFaction(35); diff --git a/src/server/scripts/EasternKingdoms/CMakeLists.txt b/src/server/scripts/EasternKingdoms/CMakeLists.txt index 5af9dd2f23e..5dc3b52dec1 100644 --- a/src/server/scripts/EasternKingdoms/CMakeLists.txt +++ b/src/server/scripts/EasternKingdoms/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2011 TrinityCore +# Copyright (C) 2008-2012 TrinityCore # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without @@ -84,7 +84,6 @@ set(scripts_STAT_SRCS EasternKingdoms/MoltenCore/instance_molten_core.cpp EasternKingdoms/MoltenCore/boss_sulfuron_harbinger.cpp EasternKingdoms/MoltenCore/boss_magmadar.cpp - EasternKingdoms/MoltenCore/molten_core.cpp EasternKingdoms/MoltenCore/boss_shazzrah.cpp EasternKingdoms/Stratholme/boss_baroness_anastari.cpp EasternKingdoms/Stratholme/boss_nerubenkan.cpp diff --git a/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp b/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp index 9830563ac87..4885d8620b0 100644 --- a/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp +++ b/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp @@ -127,7 +127,7 @@ public: DoCastAOE(SPELL_SMITE_STOMP, false); SetCombatMovement(false); if (instance) - if (GameObject* go = GameObject::GetGameObject((*me), instance->GetData64(DATA_SMITE_CHEST))) + if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_SMITE_CHEST))) { me->GetMotionMaster()->Clear(); me->GetMotionMaster()->MovePoint(1, go->GetPositionX() - 3.0f, go->GetPositionY(), go->GetPositionZ()); @@ -158,7 +158,6 @@ public: me->GetMotionMaster()->MoveChase(me->getVictim(), me->m_CombatDistance); uiPhase = 0; break; - } } else uiTimer -= uiDiff; } @@ -174,9 +173,7 @@ public: uiTimer = 1500; uiPhase = 1; } - }; - }; void AddSC_boss_mr_smite() diff --git a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp index fffd8d41264..6c6b0647c5f 100644 --- a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp +++ b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp @@ -45,17 +45,16 @@ public: player->GetSession()->SendNotification("Instance script not initialized"); return true; } - if (instance->GetData(EVENT_STATE)!= CANNON_NOT_USED) + + if (instance->GetData(EVENT_STATE) != CANNON_NOT_USED) return false; + if (targets.GetGOTarget() && targets.GetGOTarget()->GetEntry() == GO_DEFIAS_CANNON) - { instance->SetData(EVENT_STATE, CANNON_GUNPOWDER_USED); - } player->DestroyItemCount(item->GetEntry(), 1, true); return true; } - }; void AddSC_deadmines() diff --git a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h index 55726fb2a8e..419af40ee36 100644 --- a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h +++ b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h @@ -47,4 +47,3 @@ enum GameObjects GO_MR_SMITE_CHEST = 144111 }; #endif - diff --git a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp index 1b037be8afa..46e84481fee 100644 --- a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp +++ b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp @@ -156,7 +156,7 @@ class instance_deadmines : public InstanceMapScript void MoveCreatureInside(Creature* creature) { - creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + creature->SetWalk(false); creature->GetMotionMaster()->MovePoint(0, -102.7f, -655.9f, creature->GetPositionZ()); } diff --git a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp index cd5566007ee..b5a7984d945 100644 --- a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp +++ b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp @@ -95,10 +95,10 @@ public: return new npc_blastmaster_emi_shortfuseAI(creature); } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { if (npc_escortAI* pEscortAI = CAST_AI(npc_blastmaster_emi_shortfuse::npc_blastmaster_emi_shortfuseAI, creature->AI())) pEscortAI->Start(true, false, player->GetGUID()); @@ -189,11 +189,11 @@ public: if (bBool) { if (instance) - if (GameObject* go = GameObject::GetGameObject((*me), instance->GetData64(DATA_GO_CAVE_IN_RIGHT))) + if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_RIGHT))) instance->HandleGameObject(0, false, go); }else if (instance) - if (GameObject* go = GameObject::GetGameObject((*me), instance->GetData64(DATA_GO_CAVE_IN_LEFT))) + if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_LEFT))) instance->HandleGameObject(0, false, go); } @@ -204,10 +204,10 @@ public: if (bBool) { - if (GameObject* go = GameObject::GetGameObject((*me), instance->GetData64(DATA_GO_CAVE_IN_RIGHT))) + if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_RIGHT))) me->SetFacingToObject(go); }else - if (GameObject* go = GameObject::GetGameObject((*me), instance->GetData64(DATA_GO_CAVE_IN_LEFT))) + if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_LEFT))) me->SetFacingToObject(go); } @@ -216,10 +216,10 @@ public: if (!instance) return; - if (GameObject* go = GameObject::GetGameObject((*me), instance->GetData64(DATA_GO_CAVE_IN_RIGHT))) + if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_RIGHT))) instance->HandleGameObject(0, false, go); - if (GameObject* go = GameObject::GetGameObject((*me), instance->GetData64(DATA_GO_CAVE_IN_LEFT))) + if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_LEFT))) instance->HandleGameObject(0, false, go); if (!GoSummonList.empty()) @@ -266,14 +266,14 @@ public: } } - void WaypointReached(uint32 uiPoint) + void WaypointReached(uint32 waypointId) { //just in case if (GetPlayerForEscort()) if (me->getFaction() != GetPlayerForEscort()->getFaction()) me->setFaction(GetPlayerForEscort()->getFaction()); - switch (uiPoint) + switch (waypointId) { case 3: SetEscortPaused(true); @@ -445,7 +445,7 @@ public: DoScriptText(SAY_BLASTMASTER_5, me); Summon(1); if (instance) - if (GameObject* go = GameObject::GetGameObject((*me), instance->GetData64(DATA_GO_CAVE_IN_RIGHT))) + if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_RIGHT))) instance->HandleGameObject(0, true, go); NextStep(3000, true); break; @@ -491,7 +491,7 @@ public: DoScriptText(SAY_BLASTMASTER_23, me); SetInFace(false); if (instance) - if (GameObject* go = GameObject::GetGameObject((*me), instance->GetData64(DATA_GO_CAVE_IN_LEFT))) + if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_GO_CAVE_IN_LEFT))) instance->HandleGameObject(0, true, go); NextStep(2000, true); break; diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp index b1fa4d54eb6..96bda019f6a 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp @@ -55,7 +55,7 @@ public: struct boss_curatorAI : public ScriptedAI { - boss_curatorAI(Creature* c) : ScriptedAI(c) {} + boss_curatorAI(Creature* creature) : ScriptedAI(creature) {} uint32 AddTimer; uint32 HatefulBoltTimer; @@ -80,7 +80,7 @@ public: DoScriptText(RAND(SAY_KILL1, SAY_KILL2), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); } diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp index 66de84abbc2..e19efc7c4e5 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp @@ -51,7 +51,7 @@ public: struct boss_maiden_of_virtueAI : public ScriptedAI { - boss_maiden_of_virtueAI(Creature* c) : ScriptedAI(c) {} + boss_maiden_of_virtueAI(Creature* creature) : ScriptedAI(creature) {} uint32 Repentance_Timer; uint32 Holyfire_Timer; @@ -78,7 +78,7 @@ public: DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2, SAY_SLAY3), me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); } diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp index 65b758b55e7..2bba875ad1f 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp @@ -58,7 +58,7 @@ public: struct boss_attumenAI : public ScriptedAI { - boss_attumenAI(Creature* c) : ScriptedAI(c) + boss_attumenAI(Creature* creature) : ScriptedAI(creature) { Phase = 1; @@ -89,7 +89,7 @@ public: DoScriptText(RAND(SAY_KILL1, SAY_KILL2), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); if (Unit* pMidnight = Unit::GetUnit(*me, Midnight)) @@ -119,7 +119,7 @@ public: struct boss_midnightAI : public ScriptedAI { - boss_midnightAI(Creature* c) : ScriptedAI(c) {} + boss_midnightAI(Creature* creature) : ScriptedAI(creature) {} uint64 Attumen; uint8 Phase; @@ -185,7 +185,7 @@ public: pAttumen->GetMotionMaster()->MoveChase(pAttumen->getVictim()); pAttumen->SetTarget(pAttumen->getVictim()->GetGUID()); } - pAttumen->SetFloatValue(OBJECT_FIELD_SCALE_X, 1); + pAttumen->SetObjectScale(1); } } else Mount_Timer -= diff; } @@ -203,16 +203,16 @@ public: pAttumen->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); float angle = me->GetAngle(pAttumen); float distance = me->GetDistance2d(pAttumen); - float newX = me->GetPositionX() + cos(angle)*(distance/2) ; - float newY = me->GetPositionY() + sin(angle)*(distance/2) ; + float newX = me->GetPositionX() + cos(angle)*(distance/2); + float newY = me->GetPositionY() + sin(angle)*(distance/2); float newZ = 50; //me->Relocate(newX, newY, newZ, angle); //me->SendMonsterMove(newX, newY, newZ, 0, true, 1000); me->GetMotionMaster()->Clear(); me->GetMotionMaster()->MovePoint(0, newX, newY, newZ); distance += 10; - newX = me->GetPositionX() + cos(angle)*(distance/2) ; - newY = me->GetPositionY() + sin(angle)*(distance/2) ; + newX = me->GetPositionX() + cos(angle)*(distance/2); + newY = me->GetPositionY() + sin(angle)*(distance/2); pAttumen->GetMotionMaster()->Clear(); pAttumen->GetMotionMaster()->MovePoint(0, newX, newY, newZ); //pAttumen->Relocate(newX, newY, newZ, -angle); @@ -244,8 +244,8 @@ void boss_attumen::boss_attumenAI::UpdateAI(const uint32 diff) Midnight = 0; me->SetVisible(false); me->Kill(me); - } - } else ResetTimer -= diff; + } else ResetTimer -= diff; + } //Return since we have no target if (!UpdateVictim()) diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp index 484515be0f8..f69cecdb4c3 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp @@ -72,13 +72,12 @@ public: struct boss_moroesAI : public ScriptedAI { - boss_moroesAI(Creature* c) : ScriptedAI(c) + boss_moroesAI(Creature* creature) : ScriptedAI(creature) { for (uint8 i = 0; i < 4; ++i) - { AddId[i] = 0; - } - instance = c->GetInstanceScript(); + + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -136,7 +135,7 @@ public: DoScriptText(RAND(SAY_KILL_1, SAY_KILL_2, SAY_KILL_3), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); @@ -202,7 +201,7 @@ public: void DeSpawnAdds() { - for (uint8 i = 0; i < 4 ; ++i) + for (uint8 i = 0; i < 4; ++i) { Creature* Temp = NULL; if (AddGUID[i]) @@ -322,12 +321,12 @@ struct boss_moroes_guestAI : public ScriptedAI uint64 GuestGUID[4]; - boss_moroes_guestAI(Creature* c) : ScriptedAI(c) + boss_moroes_guestAI(Creature* creature) : ScriptedAI(creature) { for (uint8 i = 0; i < 4; ++i) GuestGUID[i] = 0; - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } void Reset() @@ -359,7 +358,7 @@ struct boss_moroes_guestAI : public ScriptedAI uint64 TempGUID = GuestGUID[rand()%4]; if (TempGUID) { - Unit* unit = Unit::GetUnit((*me), TempGUID); + Unit* unit = Unit::GetUnit(*me, TempGUID); if (unit && unit->isAlive()) return unit; } @@ -417,7 +416,7 @@ public: struct boss_baroness_dorothea_millstipeAI : public boss_moroes_guestAI { //Shadow Priest - boss_baroness_dorothea_millstipeAI(Creature* c) : boss_moroes_guestAI(c) {} + boss_baroness_dorothea_millstipeAI(Creature* creature) : boss_moroes_guestAI(creature) {} uint32 ManaBurn_Timer; uint32 MindFlay_Timer; @@ -481,7 +480,7 @@ public: struct boss_baron_rafe_dreugerAI : public boss_moroes_guestAI { //Retr Pally - boss_baron_rafe_dreugerAI(Creature* c) : boss_moroes_guestAI(c){} + boss_baron_rafe_dreugerAI(Creature* creature) : boss_moroes_guestAI(creature){} uint32 HammerOfJustice_Timer; uint32 SealOfCommand_Timer; @@ -539,7 +538,7 @@ public: struct boss_lady_catriona_von_indiAI : public boss_moroes_guestAI { //Holy Priest - boss_lady_catriona_von_indiAI(Creature* c) : boss_moroes_guestAI(c) {} + boss_lady_catriona_von_indiAI(Creature* creature) : boss_moroes_guestAI(creature) {} uint32 DispelMagic_Timer; uint32 GreaterHeal_Timer; @@ -610,7 +609,7 @@ public: struct boss_lady_keira_berrybuckAI : public boss_moroes_guestAI { //Holy Pally - boss_lady_keira_berrybuckAI(Creature* c) : boss_moroes_guestAI(c) {} + boss_lady_keira_berrybuckAI(Creature* creature) : boss_moroes_guestAI(creature) {} uint32 Cleanse_Timer; uint32 GreaterBless_Timer; @@ -685,7 +684,7 @@ public: struct boss_lord_robin_darisAI : public boss_moroes_guestAI { //Arms Warr - boss_lord_robin_darisAI(Creature* c) : boss_moroes_guestAI(c) {} + boss_lord_robin_darisAI(Creature* creature) : boss_moroes_guestAI(creature) {} uint32 Hamstring_Timer; uint32 MortalStrike_Timer; @@ -742,7 +741,7 @@ public: struct boss_lord_crispin_ferenceAI : public boss_moroes_guestAI { //Arms Warr - boss_lord_crispin_ferenceAI(Creature* c) : boss_moroes_guestAI(c) {} + boss_lord_crispin_ferenceAI(Creature* creature) : boss_moroes_guestAI(creature) {} uint32 Disarm_Timer; uint32 HeroicStrike_Timer; diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp index c1fe9c9c56c..f89abca76cf 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp @@ -70,9 +70,9 @@ public: struct boss_netherspiteAI : public ScriptedAI { - boss_netherspiteAI(Creature* c) : ScriptedAI(c) + boss_netherspiteAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); for (int i=0; i<3; ++i) { diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp index 728446aa833..ded5e6903a5 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp @@ -70,9 +70,9 @@ public: struct boss_nightbaneAI : public ScriptedAI { - boss_nightbaneAI(Creature* c) : ScriptedAI(c) + boss_nightbaneAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); Intro = true; } @@ -121,8 +121,8 @@ public: MovePhase = 0; me->SetSpeed(MOVE_RUN, 2.0f); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetDisableGravity(true); + me->SetWalk(false); me->setActive(true); if (instance) @@ -240,7 +240,7 @@ public: me->InterruptSpell(CURRENT_GENERIC_SPELL); me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetDisableGravity(true); (*me).GetMotionMaster()->Clear(false); (*me).GetMotionMaster()->MovePoint(0, IntroWay[2][0], IntroWay[2][1], IntroWay[2][2]); @@ -263,7 +263,7 @@ public: { if (MovePhase >= 7) { - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(false); me->HandleEmoteCommand(EMOTE_ONESHOT_LAND); me->GetMotionMaster()->MovePoint(8, IntroWay[7][0], IntroWay[7][1], IntroWay[7][2]); } @@ -277,7 +277,7 @@ public: { if (MovePhase >= 7) { - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(false); me->HandleEmoteCommand(EMOTE_ONESHOT_LAND); me->GetMotionMaster()->MovePoint(8, IntroWay[7][0], IntroWay[7][1], IntroWay[7][2]); } diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp index 14add92fd16..4700ad71fab 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp @@ -108,7 +108,7 @@ public: struct netherspite_infernalAI : public ScriptedAI { - netherspite_infernalAI(Creature* c) : ScriptedAI(c), + netherspite_infernalAI(Creature* creature) : ScriptedAI(creature), HellfireTimer(0), CleanupTimer(0), malchezaar(0), point(NULL) {} uint32 HellfireTimer; @@ -183,9 +183,9 @@ public: struct boss_malchezaarAI : public ScriptedAI { - boss_malchezaarAI(Creature* c) : ScriptedAI(c) + boss_malchezaarAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -243,7 +243,7 @@ public: DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2, SAY_SLAY3), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); @@ -297,7 +297,7 @@ public: SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); //damage - const CreatureTemplate* cinfo = me->GetCreatureInfo(); + const CreatureTemplate* cinfo = me->GetCreatureTemplate(); me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, cinfo->mindmg); me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, cinfo->maxdmg); me->UpdateDamagePhysical(BASE_ATTACK); @@ -420,7 +420,7 @@ public: SetEquipmentSlots(false, EQUIP_ID_AXE, EQUIP_ID_AXE, EQUIP_NO_CHANGE); //damage - const CreatureTemplate* cinfo = me->GetCreatureInfo(); + const CreatureTemplate* cinfo = me->GetCreatureTemplate(); me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, 2*cinfo->mindmg); me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, 2*cinfo->maxdmg); me->UpdateDamagePhysical(BASE_ATTACK); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp index 119cb7d9de6..d95b4aa3ae1 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp @@ -24,7 +24,6 @@ SDCategory: Karazhan EndScriptData */ #include "ScriptPCH.h" -#include "ScriptedSimpleAI.h" #include "karazhan.h" #include "GameObject.h" @@ -93,9 +92,9 @@ public: struct boss_aranAI : public ScriptedAI { - boss_aranAI(Creature* c) : ScriptedAI(c) + boss_aranAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -162,7 +161,7 @@ public: DoScriptText(RAND(SAY_KILL1, SAY_KILL2), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); @@ -523,7 +522,7 @@ public: struct water_elementalAI : public ScriptedAI { - water_elementalAI(Creature* c) : ScriptedAI(c) {} + water_elementalAI(Creature* creature) : ScriptedAI(creature) {} uint32 CastTimer; @@ -549,33 +548,8 @@ public: }; -// CONVERT TO ACID -class mob_shadow_of_aran : public CreatureScript -{ -public: - mob_shadow_of_aran() : CreatureScript("mob_shadow_of_aran") { } - - CreatureAI* GetAI(Creature* creature) const - { - sLog->outString("TSCR: Convert simpleAI script for Creature Entry %u to ACID", creature->GetEntry()); - SimpleAI* ai = new SimpleAI (creature); - - ai->Spell[0].Enabled = true; - ai->Spell[0].Spell_Id = SPELL_SHADOW_PYRO; - ai->Spell[0].Cooldown = 5000; - ai->Spell[0].First_Cast = 1000; - ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET; - - ai->EnterEvadeMode(); - - return ai; - } - -}; - void AddSC_boss_shade_of_aran() { new boss_shade_of_aran(); - new mob_shadow_of_aran(); new mob_aran_elemental(); } diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp index 15750c5b9c5..2f19d2c7fc1 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp @@ -68,9 +68,9 @@ public: struct mob_kilrekAI : public ScriptedAI { - mob_kilrekAI(Creature* c) : ScriptedAI(c) + mob_kilrekAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -94,14 +94,14 @@ public: } } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (instance) { uint64 TerestianGUID = instance->GetData64(DATA_TERESTIAN); if (TerestianGUID) { - Unit* Terestian = Unit::GetUnit((*me), TerestianGUID); + Unit* Terestian = Unit::GetUnit(*me, TerestianGUID); if (Terestian && Terestian->isAlive()) DoCast(Terestian, SPELL_BROKEN_PACT, true); } @@ -140,7 +140,7 @@ public: struct mob_demon_chainAI : public ScriptedAI { - mob_demon_chainAI(Creature* c) : ScriptedAI(c) {} + mob_demon_chainAI(Creature* creature) : ScriptedAI(creature) {} uint64 SacrificeGUID; @@ -157,7 +157,7 @@ public: { if (SacrificeGUID) { - Unit* Sacrifice = Unit::GetUnit((*me), SacrificeGUID); + Unit* Sacrifice = Unit::GetUnit(*me, SacrificeGUID); if (Sacrifice) Sacrifice->RemoveAurasDueToSpell(SPELL_SACRIFICE); } @@ -178,7 +178,7 @@ public: struct mob_fiendish_portalAI : public PassiveAI { - mob_fiendish_portalAI(Creature* c) : PassiveAI(c), summons(me){} + mob_fiendish_portalAI(Creature* creature) : PassiveAI(creature), summons(me){} SummonList summons; @@ -215,7 +215,7 @@ public: struct mob_fiendish_impAI : public ScriptedAI { - mob_fiendish_impAI(Creature* c) : ScriptedAI(c) {} + mob_fiendish_impAI(Creature* creature) : ScriptedAI(creature) {} uint32 FireboltTimer; @@ -258,11 +258,11 @@ public: struct boss_terestianAI : public ScriptedAI { - boss_terestianAI(Creature* c) : ScriptedAI(c) + boss_terestianAI(Creature* creature) : ScriptedAI(creature) { for (uint8 i = 0; i < 2; ++i) PortalGUID[i] = 0; - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp index b15cb7d3da1..6f8121ef5b6 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp @@ -114,9 +114,9 @@ public: struct boss_dorotheeAI : public ScriptedAI { - boss_dorotheeAI(Creature* c) : ScriptedAI(c) + boss_dorotheeAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -229,7 +229,7 @@ public: struct mob_titoAI : public ScriptedAI { - mob_titoAI(Creature* c) : ScriptedAI(c) {} + mob_titoAI(Creature* creature) : ScriptedAI(creature) {} uint64 DorotheeGUID; uint32 YipTimer; @@ -296,9 +296,9 @@ public: struct boss_strawmanAI : public ScriptedAI { - boss_strawmanAI(Creature* c) : ScriptedAI(c) + boss_strawmanAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -411,9 +411,9 @@ public: struct boss_tinheadAI : public ScriptedAI { - boss_tinheadAI(Creature* c) : ScriptedAI(c) + boss_tinheadAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -521,9 +521,9 @@ public: struct boss_roarAI : public ScriptedAI { - boss_roarAI(Creature* c) : ScriptedAI(c) + boss_roarAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -630,9 +630,9 @@ public: struct boss_croneAI : public ScriptedAI { - boss_croneAI(Creature* c) : ScriptedAI(c) + boss_croneAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -712,7 +712,7 @@ public: struct mob_cycloneAI : public ScriptedAI { - mob_cycloneAI(Creature* c) : ScriptedAI(c) {} + mob_cycloneAI(Creature* creature) : ScriptedAI(creature) {} uint32 MoveTimer; @@ -769,10 +769,10 @@ class npc_grandmother : public CreatureScript public: npc_grandmother() : CreatureScript("npc_grandmother") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF) + if (action == GOSSIP_ACTION_INFO_DEF) { if (Creature* pBigBadWolf = creature->SummonCreature(CREATURE_BIG_BAD_WOLF, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR*2*IN_MILLISECONDS)) pBigBadWolf->AI()->AttackStart(player); @@ -805,9 +805,9 @@ public: struct boss_bigbadwolfAI : public ScriptedAI { - boss_bigbadwolfAI(Creature* c) : ScriptedAI(c) + boss_bigbadwolfAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -886,7 +886,7 @@ public: { IsChasing = false; - if (Unit* target = Unit::GetUnit((*me), HoodGUID)) + if (Unit* target = Unit::GetUnit(*me, HoodGUID)) { HoodGUID = 0; if (DoGetThreat(target)) @@ -1004,9 +1004,9 @@ public: struct boss_julianneAI : public ScriptedAI { - boss_julianneAI(Creature* c) : ScriptedAI(c) + boss_julianneAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); EntryYellTimer = 1000; AggroYellTimer = 10000; IsFakingDeath = false; @@ -1127,9 +1127,9 @@ public: struct boss_romuloAI : public ScriptedAI { - boss_romuloAI(Creature* c) : ScriptedAI(c) + boss_romuloAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); EntryYellTimer = 8000; AggroYellTimer = 15000; } diff --git a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp index 056a2e95448..b37f6913b8d 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp @@ -109,11 +109,11 @@ public: struct npc_barnesAI : public npc_escortAI { - npc_barnesAI(Creature* c) : npc_escortAI(c) + npc_barnesAI(Creature* creature) : npc_escortAI(creature) { RaidWiped = false; m_uiEventId = 0; - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -158,12 +158,12 @@ public: void EnterCombat(Unit* /*who*/) {} - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { if (!instance) return; - switch (i) + switch (waypointId) { case 0: DoCast(me, SPELL_TUXEDO, false); @@ -324,12 +324,12 @@ public: } }; - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); npc_barnesAI* pBarnesAI = CAST_AI(npc_barnes::npc_barnesAI, creature->AI()); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, OZ_GOSSIP2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); @@ -414,10 +414,10 @@ class npc_berthold : public CreatureScript public: npc_berthold() : CreatureScript("npc_berthold") { } - bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + if (action == GOSSIP_ACTION_INFO_DEF + 1) player->CastSpell(player, SPELL_TELEPORT, true); player->CLOSE_GOSSIP_MENU(); @@ -474,9 +474,9 @@ public: struct npc_image_of_medivhAI : public ScriptedAI { - npc_image_of_medivhAI(Creature* c) : ScriptedAI(c) + npc_image_of_medivhAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -527,7 +527,7 @@ public: if (!Arcanagos) return; ArcanagosGUID = Arcanagos->GetGUID(); - Arcanagos->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + Arcanagos->SetDisableGravity(true); (*Arcanagos).GetMotionMaster()->MovePoint(0, ArcanagosPos[0], ArcanagosPos[1], ArcanagosPos[2]); Arcanagos->SetOrientation(ArcanagosPos[3]); me->SetOrientation(MedivPos[3]); @@ -536,7 +536,7 @@ public: uint32 NextStep(uint32 Step) { - Unit* arca = Unit::GetUnit((*me), ArcanagosGUID); + Unit* arca = Unit::GetUnit(*me, ArcanagosGUID); Map* map = me->GetMap(); switch (Step) { @@ -625,7 +625,7 @@ public: if (Step >= 7 && Step <= 12) { - Unit* arca = Unit::GetUnit((*me), ArcanagosGUID); + Unit* arca = Unit::GetUnit(*me, ArcanagosGUID); if (FireArcanagosTimer <= diff) { diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp index dd37f659eec..c53793b6e30 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp @@ -89,9 +89,9 @@ public: struct boss_felblood_kaelthasAI : public ScriptedAI { - boss_felblood_kaelthasAI(Creature* c) : ScriptedAI(c) + boss_felblood_kaelthasAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -154,14 +154,18 @@ public: if (!instance) return; - instance->HandleGameObject(instance->GetData64(DATA_KAEL_DOOR), true); // Open the encounter door + instance->HandleGameObject(instance->GetData64(DATA_KAEL_DOOR), true); + + // Enable the Translocation Orb Exit + if (GameObject* escapeOrb = ObjectAccessor::GetGameObject(*me, instance->GetData64(DATA_ESCAPE_ORB))) + escapeOrb->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); } void DamageTaken(Unit* /*done_by*/, uint32 &damage) { if (damage > me->GetHealth()) - RemoveGravityLapse(); // Remove Gravity Lapse so that players fall to ground if they kill him when in air. + RemoveGravityLapse(); // Remove Gravity Lapse so that players fall to ground if they kill him when in air. } void EnterCombat(Unit* /*who*/) @@ -169,8 +173,8 @@ public: if (!instance) return; + //Close the encounter door, open it in JustDied/Reset instance->HandleGameObject(instance->GetData64(DATA_KAEL_DOOR), false); - //Close the encounter door, open it in JustDied/Reset } void MoveInLineOfSight(Unit* who) @@ -193,7 +197,7 @@ public: std::list::const_iterator i = m_threatlist.begin(); for (i = m_threatlist.begin(); i != m_threatlist.end(); ++i) { - Unit* unit = Unit::GetUnit((*me), (*i)->getUnitGuid()); + Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid()); if (unit && unit->isAlive()) { float threat = me->getThreatManager().getThreat(unit); @@ -211,7 +215,7 @@ public: std::list::const_iterator i = me->getThreatManager().getThreatList().begin(); for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i) { - Unit* unit = Unit::GetUnit((*me), (*i)->getUnitGuid()); + Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid()); if (unit && (unit->GetTypeId() == TYPEID_PLAYER)) unit->CastSpell(unit, SPELL_TELEPORT_CENTER, true); } @@ -223,7 +227,7 @@ public: std::list::const_iterator i = me->getThreatManager().getThreatList().begin(); for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i) { - Unit* unit = Unit::GetUnit((*me), (*i)->getUnitGuid()); + Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid()); if (unit && (unit->GetTypeId() == TYPEID_PLAYER)) // Knockback into the air unit->CastSpell(unit, SPELL_GRAVITY_LAPSE_DOT, true, 0, 0, me->GetGUID()); @@ -235,7 +239,7 @@ public: std::list::const_iterator i = me->getThreatManager().getThreatList().begin(); for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i) { - Unit* unit = Unit::GetUnit((*me), (*i)->getUnitGuid()); + Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid()); if (unit && (unit->GetTypeId() == TYPEID_PLAYER)) { // Also needs an exception in spell system. @@ -254,7 +258,7 @@ public: std::list::const_iterator i = me->getThreatManager().getThreatList().begin(); for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i) { - Unit* unit = Unit::GetUnit((*me), (*i)->getUnitGuid()); + Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid()); if (unit && (unit->GetTypeId() == TYPEID_PLAYER)) { unit->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_FLY); @@ -439,7 +443,7 @@ public: struct mob_felkael_flamestrikeAI : public ScriptedAI { - mob_felkael_flamestrikeAI(Creature* c) : ScriptedAI(c) + mob_felkael_flamestrikeAI(Creature* creature) : ScriptedAI(creature) { } @@ -481,9 +485,9 @@ public: struct mob_felkael_phoenixAI : public ScriptedAI { - mob_felkael_phoenixAI(Creature* c) : ScriptedAI(c) + mob_felkael_phoenixAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -495,7 +499,7 @@ public: void Reset() { me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetDisableGravity(true); DoCast(me, SPELL_PHOENIX_BURN, true); BurnTimer = 2000; Death_Timer = 3000; @@ -542,7 +546,7 @@ public: } - void JustDied(Unit* /*slayer*/) + void JustDied(Unit* /*killer*/) { me->SummonCreature(CREATURE_PHOENIX_EGG, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000); } @@ -601,7 +605,7 @@ public: struct mob_felkael_phoenix_eggAI : public ScriptedAI { - mob_felkael_phoenix_eggAI(Creature* c) : ScriptedAI(c) {} + mob_felkael_phoenix_eggAI(Creature* creature) : ScriptedAI(creature) {} uint32 HatchTimer; @@ -638,7 +642,7 @@ public: struct mob_arcane_sphereAI : public ScriptedAI { - mob_arcane_sphereAI(Creature* c) : ScriptedAI(c) { Reset(); } + mob_arcane_sphereAI(Creature* creature) : ScriptedAI(creature) { Reset(); } uint32 DespawnTimer; uint32 ChangeTargetTimer; @@ -649,7 +653,7 @@ public: ChangeTargetTimer = urand(6000, 12000); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetDisableGravity(true); me->setFaction(14); DoCast(me, SPELL_ARCANE_SPHERE_PASSIVE, true); } diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp index b9d4f600329..883932fdb9b 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp @@ -99,9 +99,9 @@ public: struct boss_priestess_delrissaAI : public ScriptedAI { - boss_priestess_delrissaAI(Creature* c) : ScriptedAI(c) + boss_priestess_delrissaAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); memset(&m_auiLackeyGUID, 0, sizeof(m_auiLackeyGUID)); LackeyEntryList.clear(); } @@ -341,9 +341,9 @@ enum eHealingPotion //all 8 possible lackey use this common struct boss_priestess_lackey_commonAI : public ScriptedAI { - boss_priestess_lackey_commonAI(Creature* c) : ScriptedAI(c) + boss_priestess_lackey_commonAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); memset(&m_auiLackeyGUIDs, 0, sizeof(m_auiLackeyGUIDs)); AcquireGUIDs(); } @@ -495,7 +495,7 @@ public: struct boss_kagani_nightstrikeAI : public boss_priestess_lackey_commonAI { //Rogue - boss_kagani_nightstrikeAI(Creature* c) : boss_priestess_lackey_commonAI(c) {} + boss_kagani_nightstrikeAI(Creature* creature) : boss_priestess_lackey_commonAI(creature) {} uint32 Gouge_Timer; uint32 Kick_Timer; @@ -600,7 +600,7 @@ public: struct boss_ellris_duskhallowAI : public boss_priestess_lackey_commonAI { //Warlock - boss_ellris_duskhallowAI(Creature* c) : boss_priestess_lackey_commonAI(c) {} + boss_ellris_duskhallowAI(Creature* creature) : boss_priestess_lackey_commonAI(creature) {} uint32 Immolate_Timer; uint32 Shadow_Bolt_Timer; @@ -692,7 +692,7 @@ public: struct boss_eramas_brightblazeAI : public boss_priestess_lackey_commonAI { //Monk - boss_eramas_brightblazeAI(Creature* c) : boss_priestess_lackey_commonAI(c) {} + boss_eramas_brightblazeAI(Creature* creature) : boss_priestess_lackey_commonAI(creature) {} uint32 Knockdown_Timer; uint32 Snap_Kick_Timer; @@ -754,7 +754,7 @@ public: struct boss_yazzaiAI : public boss_priestess_lackey_commonAI { //Mage - boss_yazzaiAI(Creature* c) : boss_priestess_lackey_commonAI(c) {} + boss_yazzaiAI(Creature* creature) : boss_priestess_lackey_commonAI(creature) {} bool HasIceBlocked; @@ -885,7 +885,7 @@ public: struct boss_warlord_salarisAI : public boss_priestess_lackey_commonAI { //Warrior - boss_warlord_salarisAI(Creature* c) : boss_priestess_lackey_commonAI(c) {} + boss_warlord_salarisAI(Creature* creature) : boss_priestess_lackey_commonAI(creature) {} uint32 Intercept_Stun_Timer; uint32 Disarm_Timer; @@ -1006,7 +1006,10 @@ public: struct boss_garaxxasAI : public boss_priestess_lackey_commonAI { //Hunter - boss_garaxxasAI(Creature* c) : boss_priestess_lackey_commonAI(c) { m_uiPetGUID = 0; } + boss_garaxxasAI(Creature* creature) : boss_priestess_lackey_commonAI(creature) + { + m_uiPetGUID = 0; + } uint64 m_uiPetGUID; @@ -1126,7 +1129,7 @@ public: struct boss_apokoAI : public boss_priestess_lackey_commonAI { //Shaman - boss_apokoAI(Creature* c) : boss_priestess_lackey_commonAI(c) {} + boss_apokoAI(Creature* creature) : boss_priestess_lackey_commonAI(creature) {} uint32 Totem_Timer; uint8 Totem_Amount; @@ -1225,7 +1228,7 @@ public: struct boss_zelfanAI : public boss_priestess_lackey_commonAI { //Engineer - boss_zelfanAI(Creature* c) : boss_priestess_lackey_commonAI(c) {} + boss_zelfanAI(Creature* creature) : boss_priestess_lackey_commonAI(creature) {} uint32 Goblin_Dragon_Gun_Timer; uint32 Rocket_Launch_Timer; diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp index fa97e4eefc0..af7deda4545 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp @@ -63,9 +63,9 @@ public: struct boss_selin_fireheartAI : public ScriptedAI { - boss_selin_fireheartAI(Creature* c) : ScriptedAI(c) + boss_selin_fireheartAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); Crystals.clear(); //GUIDs per instance is static, so we only need to load them once. @@ -171,7 +171,7 @@ public: float x, y, z; // coords that we move to, close to the crystal. CrystalChosen->GetClosePoint(x, y, z, me->GetObjectSize(), CONTACT_DISTANCE); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); me->GetMotionMaster()->MovePoint(1, x, y, z); DrainingCrystal = true; } @@ -333,7 +333,7 @@ public: struct mob_fel_crystalAI : public ScriptedAI { - mob_fel_crystalAI(Creature* c) : ScriptedAI(c) {} + mob_fel_crystalAI(Creature* creature) : ScriptedAI(creature) {} void Reset() {} void EnterCombat(Unit* /*who*/) {} diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp index 5f3716d9dea..327c611b2d6 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp @@ -71,9 +71,9 @@ public: struct boss_vexallusAI : public ScriptedAI { - boss_vexallusAI(Creature* c) : ScriptedAI(c) + boss_vexallusAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -101,7 +101,7 @@ public: DoScriptText(SAY_KILL, me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(DATA_VEXALLUS_EVENT, DONE); @@ -206,7 +206,7 @@ public: struct mob_pure_energyAI : public ScriptedAI { - mob_pure_energyAI(Creature* c) : ScriptedAI(c) {} + mob_pure_energyAI(Creature* creature) : ScriptedAI(creature) {} void Reset() {} diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp index 642f7955b2e..aa43cb3702f 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp @@ -35,6 +35,25 @@ EndScriptData */ 3 - Kael'thas Sunstrider */ +enum Creatures +{ + NPC_SELIN = 24723, + NPC_DELRISSA = 24560, + NPC_FELCRYSTALS = 24722 +}; + +enum GameObjects +{ + GO_VEXALLUS_DOOR = 187896, + GO_SELIN_DOOR = 187979, + GO_SELIN_ENCOUNTER_DOOR = 188065, + GO_DELRISSA_DOOR = 187770, + GO_KAEL_DOOR = 188064, + GO_KAEL_STATUE_1 = 188165, + GO_KAEL_STATUE_2 = 188166, + GO_ESCAPE_ORB = 188173 +}; + class instance_magisters_terrace : public InstanceMapScript { public: @@ -49,7 +68,7 @@ public: { instance_magisters_terrace_InstanceMapScript(Map* map) : InstanceScript(map) {} - uint32 m_auiEncounter[MAX_ENCOUNTER]; + uint32 Encounter[MAX_ENCOUNTER]; uint32 DelrissaDeathCount; std::list FelCrystals; @@ -63,12 +82,13 @@ public: uint64 DelrissaDoorGUID; uint64 KaelDoorGUID; uint64 KaelStatue[2]; + uint64 EscapeOrbGUID; bool InitializedItr; void Initialize() { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + memset(&Encounter, 0, sizeof(Encounter)); FelCrystals.clear(); @@ -83,6 +103,7 @@ public: KaelDoorGUID = 0; KaelStatue[0] = 0; KaelStatue[1] = 0; + EscapeOrbGUID = 0; InitializedItr = false; } @@ -90,7 +111,7 @@ public: bool IsEncounterInProgress() const { for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) + if (Encounter[i] == IN_PROGRESS) return true; return false; } @@ -99,12 +120,18 @@ public: { switch (identifier) { - case DATA_SELIN_EVENT: return m_auiEncounter[0]; - case DATA_VEXALLUS_EVENT: return m_auiEncounter[1]; - case DATA_DELRISSA_EVENT: return m_auiEncounter[2]; - case DATA_KAELTHAS_EVENT: return m_auiEncounter[3]; - case DATA_DELRISSA_DEATH_COUNT: return DelrissaDeathCount; - case DATA_FEL_CRYSTAL_SIZE: return FelCrystals.size(); + case DATA_SELIN_EVENT: + return Encounter[0]; + case DATA_VEXALLUS_EVENT: + return Encounter[1]; + case DATA_DELRISSA_EVENT: + return Encounter[2]; + case DATA_KAELTHAS_EVENT: + return Encounter[3]; + case DATA_DELRISSA_DEATH_COUNT: + return DelrissaDeathCount; + case DATA_FEL_CRYSTAL_SIZE: + return FelCrystals.size(); } return 0; } @@ -113,21 +140,24 @@ public: { switch (identifier) { - case DATA_SELIN_EVENT: m_auiEncounter[0] = data; break; + case DATA_SELIN_EVENT: + Encounter[0] = data; + break; case DATA_VEXALLUS_EVENT: if (data == DONE) DoUseDoorOrButton(VexallusDoorGUID); - m_auiEncounter[1] = data; + Encounter[1] = data; break; case DATA_DELRISSA_EVENT: if (data == DONE) DoUseDoorOrButton(DelrissaDoorGUID); if (data == IN_PROGRESS) DelrissaDeathCount = 0; - m_auiEncounter[2] = data; + Encounter[2] = data; + break; + case DATA_KAELTHAS_EVENT: + Encounter[3] = data; break; - case DATA_KAELTHAS_EVENT: m_auiEncounter[3] = data; break; - case DATA_DELRISSA_DEATH_COUNT: if (data == SPECIAL) ++DelrissaDeathCount; @@ -141,9 +171,15 @@ public: { switch (creature->GetEntry()) { - case 24723: SelinGUID = creature->GetGUID(); break; - case 24560: DelrissaGUID = creature->GetGUID(); break; - case 24722: FelCrystals.push_back(creature->GetGUID()); break; + case NPC_SELIN: + SelinGUID = creature->GetGUID(); + break; + case NPC_DELRISSA: + DelrissaGUID = creature->GetGUID(); + break; + case NPC_FELCRYSTALS: + FelCrystals.push_back(creature->GetGUID()); + break; } } @@ -151,15 +187,30 @@ public: { switch (go->GetEntry()) { - case 187896: VexallusDoorGUID = go->GetGUID(); break; - //SunwellRaid Gate 02 - case 187979: SelinDoorGUID = go->GetGUID(); break; - //Assembly Chamber Door - case 188065: SelinEncounterDoorGUID = go->GetGUID(); break; - case 187770: DelrissaDoorGUID = go->GetGUID(); break; - case 188064: KaelDoorGUID = go->GetGUID(); break; - case 188165: KaelStatue[0] = go->GetGUID(); break; - case 188166: KaelStatue[1] = go->GetGUID(); break; + case GO_VEXALLUS_DOOR: + VexallusDoorGUID = go->GetGUID(); + break; + case GO_SELIN_DOOR: + SelinDoorGUID = go->GetGUID(); + break; + case GO_SELIN_ENCOUNTER_DOOR: + SelinEncounterDoorGUID = go->GetGUID(); + break; + case GO_DELRISSA_DOOR: + DelrissaDoorGUID = go->GetGUID(); + break; + case GO_KAEL_DOOR: + KaelDoorGUID = go->GetGUID(); + break; + case GO_KAEL_STATUE_1: + KaelStatue[0] = go->GetGUID(); + break; + case GO_KAEL_STATUE_2: + KaelStatue[1] = go->GetGUID(); + break; + case GO_ESCAPE_ORB: + EscapeOrbGUID = go->GetGUID(); + break; } } @@ -167,15 +218,26 @@ public: { switch (identifier) { - case DATA_SELIN: return SelinGUID; - case DATA_DELRISSA: return DelrissaGUID; - case DATA_VEXALLUS_DOOR: return VexallusDoorGUID; - case DATA_SELIN_DOOR: return SelinDoorGUID; - case DATA_SELIN_ENCOUNTER_DOOR: return SelinEncounterDoorGUID; - case DATA_DELRISSA_DOOR: return DelrissaDoorGUID; - case DATA_KAEL_DOOR: return KaelDoorGUID; - case DATA_KAEL_STATUE_LEFT: return KaelStatue[0]; - case DATA_KAEL_STATUE_RIGHT: return KaelStatue[1]; + case DATA_SELIN: + return SelinGUID; + case DATA_DELRISSA: + return DelrissaGUID; + case DATA_VEXALLUS_DOOR: + return VexallusDoorGUID; + case DATA_SELIN_DOOR: + return SelinDoorGUID; + case DATA_SELIN_ENCOUNTER_DOOR: + return SelinEncounterDoorGUID; + case DATA_DELRISSA_DOOR: + return DelrissaDoorGUID; + case DATA_KAEL_DOOR: + return KaelDoorGUID; + case DATA_KAEL_STATUE_LEFT: + return KaelStatue[0]; + case DATA_KAEL_STATUE_RIGHT: + return KaelStatue[1]; + case DATA_ESCAPE_ORB: + return EscapeOrbGUID; case DATA_FEL_CRYSTAL: { diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp index 679db023b63..ccaaa0ec68d 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp @@ -56,10 +56,10 @@ class npc_kalecgos : public CreatureScript public: npc_kalecgos() : CreatureScript("npc_kalecgos") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAEL_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h index dcea4424bf5..78aa14b9102 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h @@ -19,27 +19,31 @@ #ifndef DEF_MAGISTERS_TERRACE_H #define DEF_MAGISTERS_TERRACE_H -#define DATA_SELIN_EVENT 1 -#define DATA_VEXALLUS_EVENT 2 -#define DATA_DELRISSA_EVENT 3 -#define DATA_KAELTHAS_EVENT 4 +#define ERROR_INST_DATA "TSCR Error: Instance Data not set properly for Magister's Terrace instance (map 585). Encounters will be buggy." +#endif -#define DATA_SELIN 5 -#define DATA_FEL_CRYSTAL 6 -#define DATA_FEL_CRYSTAL_SIZE 7 +enum Data +{ + DATA_SELIN_EVENT = 0, + DATA_VEXALLUS_EVENT = 1, + DATA_DELRISSA_EVENT = 2, + DATA_KAELTHAS_EVENT = 3, -#define DATA_VEXALLUS_DOOR 8 -#define DATA_SELIN_DOOR 9 -#define DATA_DELRISSA 10 -#define DATA_DELRISSA_DOOR 11 -#define DATA_SELIN_ENCOUNTER_DOOR 12 + DATA_SELIN = 4, + DATA_FEL_CRYSTAL = 5, + DATA_FEL_CRYSTAL_SIZE = 6, -#define DATA_KAEL_DOOR 13 -#define DATA_KAEL_STATUE_LEFT 14 -#define DATA_KAEL_STATUE_RIGHT 15 + DATA_VEXALLUS_DOOR = 7, + DATA_SELIN_DOOR = 8, + DATA_DELRISSA = 9, + DATA_DELRISSA_DOOR = 10, + DATA_SELIN_ENCOUNTER_DOOR = 11, -#define DATA_DELRISSA_DEATH_COUNT 16 + DATA_KAEL_DOOR = 12, + DATA_KAEL_STATUE_LEFT = 13, + DATA_KAEL_STATUE_RIGHT = 14, -#define ERROR_INST_DATA "TSCR Error: Instance Data not set properly for Magister's Terrace instance (map 585). Encounters will be buggy." -#endif + DATA_DELRISSA_DEATH_COUNT = 15, + DATA_ESCAPE_ORB = 16 +}; diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp index 862a980394a..f085e15fcb7 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp @@ -200,7 +200,7 @@ class boss_majordomo : public CreatureScript return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 /*uiAction*/) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 /*action*/) { player->CLOSE_GOSSIP_MENU(); creature->AI()->DoAction(ACTION_START_RAGNAROS); diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp index 47d50925d56..0160f35f143 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp @@ -316,12 +316,12 @@ class mob_son_of_flame : public CreatureScript struct mob_son_of_flameAI : public ScriptedAI //didnt work correctly in EAI for me... { - mob_son_of_flameAI(Creature* c) : ScriptedAI(c) + mob_son_of_flameAI(Creature* creature) : ScriptedAI(creature) { instance = me->GetInstanceScript(); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(DATA_RAGNAROS_ADDS, 1); diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_sulfuron_harbinger.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_sulfuron_harbinger.cpp index 9f511c1394a..343298d29fe 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_sulfuron_harbinger.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_sulfuron_harbinger.cpp @@ -103,7 +103,7 @@ class boss_sulfuron : public CreatureScript { std::list healers = DoFindFriendlyMissingBuff(45.0f, SPELL_INSPIRE); if (!healers.empty()) - DoCast(SelectRandomContainerElement(healers), SPELL_INSPIRE); + DoCast(Trinity::Containers::SelectRandomContainerElement(healers), SPELL_INSPIRE); DoCast(me, SPELL_INSPIRE); events.ScheduleEvent(EVENT_INSPIRE, urand(20000, 26000)); diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/molten_core.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/molten_core.cpp deleted file mode 100644 index 801a11fbfc8..00000000000 --- a/src/server/scripts/EasternKingdoms/MoltenCore/molten_core.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (C) 2008-2012 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 - * - * 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; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; 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, see . - */ - -/* ScriptData -SDName: Molten_Core -SD%Complete: 100 -SDComment: -SDCategory: Molten Core -EndScriptData */ - -/* ContentData -mob_ancient_core_hound -EndContentData */ - -#include "ScriptPCH.h" -#include "ScriptedSimpleAI.h" - -enum Spells -{ - SPELL_CONE_OF_FIRE = 19630, - SPELL_BITE = 19771, - - //Random Debuff (each hound has only one of these) - SPELL_GROUND_STOMP = 19364, - SPELL_ANCIENT_DREAD = 19365, - SPELL_CAUTERIZING_FLAMES = 19366, - SPELL_WITHERING_HEAT = 19367, - SPELL_ANCIENT_DESPAIR = 19369, - SPELL_ANCIENT_HYSTERIA = 19372 -}; - -class mob_ancient_core_hound : public CreatureScript -{ -public: - mob_ancient_core_hound() : CreatureScript("mob_ancient_core_hound") { } - - CreatureAI* GetAI(Creature* creature) const - { - SimpleAI* ai = new SimpleAI(creature); - - ai->Spell[0].Enabled = true; - ai->Spell[0].Spell_Id = SPELL_CONE_OF_FIRE; - ai->Spell[0].Cooldown = 7000; - ai->Spell[0].First_Cast = 10000; - ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET; - - uint32 RandDebuff = RAND(SPELL_GROUND_STOMP, SPELL_ANCIENT_DREAD, SPELL_CAUTERIZING_FLAMES, - SPELL_WITHERING_HEAT, SPELL_ANCIENT_DESPAIR, SPELL_ANCIENT_HYSTERIA); - - ai->Spell[1].Enabled = true; - ai->Spell[1].Spell_Id = RandDebuff; - ai->Spell[1].Cooldown = 24000; - ai->Spell[1].First_Cast = 15000; - ai->Spell[1].Cast_Target_Type = CAST_HOSTILE_TARGET; - - ai->Spell[2].Enabled = true; - ai->Spell[2].Spell_Id = SPELL_BITE; - ai->Spell[2].Cooldown = 6000; - ai->Spell[2].First_Cast = 4000; - ai->Spell[2].Cast_Target_Type = CAST_HOSTILE_TARGET; - - ai->EnterEvadeMode(); - - return ai; - } -}; - -void AddSC_molten_core() -{ - new mob_ancient_core_hound(); -} diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index a2c8a890feb..bf887bec164 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -102,13 +102,13 @@ public: struct npc_unworthy_initiateAI : public ScriptedAI { - npc_unworthy_initiateAI(Creature* c) : ScriptedAI(c) + npc_unworthy_initiateAI(Creature* creature) : ScriptedAI(creature) { me->SetReactState(REACT_PASSIVE); if (!me->GetEquipmentId()) if (const CreatureTemplate* info = sObjectMgr->GetCreatureTemplate(28406)) if (info->equipmentId) - const_cast(me->GetCreatureInfo())->equipmentId = info->equipmentId; + const_cast(me->GetCreatureTemplate())->equipmentId = info->equipmentId; } uint64 playerGUID; @@ -293,7 +293,7 @@ public: struct npc_unworthy_initiate_anchorAI : public PassiveAI { - npc_unworthy_initiate_anchorAI(Creature* c) : PassiveAI(c), prisonerGUID(0) {} + npc_unworthy_initiate_anchorAI(Creature* creature) : PassiveAI(creature), prisonerGUID(0) {} uint64 prisonerGUID; @@ -303,9 +303,11 @@ public: prisonerGUID = guid; } - uint64 GetGUID(int32 /*id*/) { return prisonerGUID; } + uint64 GetGUID(int32 /*id*/) + { + return prisonerGUID; + } }; - }; class go_acherus_soul_prison : public GameObjectScript @@ -362,10 +364,10 @@ class npc_death_knight_initiate : public CreatureScript public: npc_death_knight_initiate() : CreatureScript("npc_death_knight_initiate") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF) + if (action == GOSSIP_ACTION_INFO_DEF) { player->CLOSE_GOSSIP_MENU(); @@ -531,7 +533,7 @@ public: struct npc_dark_rider_of_acherusAI : public ScriptedAI { - npc_dark_rider_of_acherusAI(Creature* c) : ScriptedAI(c) {} + npc_dark_rider_of_acherusAI(Creature* creature) : ScriptedAI(creature) {} uint32 PhaseTimer; uint32 Phase; @@ -587,7 +589,7 @@ public: return; TargetGUID = who->GetGUID(); - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); me->SetSpeed(MOVE_RUN, 0.4f); me->GetMotionMaster()->MoveChase(who); me->SetTarget(TargetGUID); @@ -623,7 +625,7 @@ public: struct npc_salanar_the_horsemanAI : public ScriptedAI { - npc_salanar_the_horsemanAI(Creature* c) : ScriptedAI(c) {} + npc_salanar_the_horsemanAI(Creature* creature) : ScriptedAI(creature) {} void SpellHit(Unit* caster, const SpellInfo* spell) { @@ -662,7 +664,7 @@ public: { CAST_PLR(charmer)->GroupEventHappens(12687, me); charmer->RemoveAurasDueToSpell(SPELL_EFFECT_OVERTAKE); - CAST_CRE(who)->ForcedDespawn(); + CAST_CRE(who)->DespawnOrUnsummon(); //CAST_CRE(who)->Respawn(true); } @@ -692,7 +694,7 @@ public: struct npc_ros_dark_riderAI : public ScriptedAI { - npc_ros_dark_riderAI(Creature* c) : ScriptedAI(c) {} + npc_ros_dark_riderAI(Creature* creature) : ScriptedAI(creature) {} void EnterCombat(Unit* /*who*/) { @@ -702,7 +704,9 @@ public: void Reset() { Creature* deathcharger = me->FindNearestCreature(28782, 30); - if (!deathcharger) return; + if (!deathcharger) + return; + deathcharger->RestoreFaction(); deathcharger->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); deathcharger->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -713,7 +717,9 @@ public: void JustDied(Unit* killer) { Creature* deathcharger = me->FindNearestCreature(28782, 30); - if (!deathcharger) return; + if (!deathcharger) + return; + if (killer->GetTypeId() == TYPEID_PLAYER && deathcharger->GetTypeId() == TYPEID_UNIT && deathcharger->IsVehicle()) { deathcharger->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); @@ -743,7 +749,7 @@ public: struct npc_dkc1_gothikAI : public ScriptedAI { - npc_dkc1_gothikAI(Creature* c) : ScriptedAI(c) {} + npc_dkc1_gothikAI(Creature* creature) : ScriptedAI(creature) {} void MoveInLineOfSight(Unit* who) { @@ -761,7 +767,7 @@ public: //Todo: Creatures must not be removed, but, must instead // stand next to Gothik and be commanded into the pit // and dig into the ground. - CAST_CRE(who)->ForcedDespawn(); + CAST_CRE(who)->DespawnOrUnsummon(); if (CAST_PLR(owner)->GetQuestStatus(12698) == QUEST_STATUS_COMPLETE) owner->RemoveAllMinionsByEntry(GHOULS); @@ -785,7 +791,7 @@ public: struct npc_scarlet_ghoulAI : public ScriptedAI { - npc_scarlet_ghoulAI(Creature* c) : ScriptedAI(c) + npc_scarlet_ghoulAI(Creature* creature) : ScriptedAI(creature) { // Ghouls should display their Birth Animation // Crawling out of the ground @@ -803,11 +809,11 @@ public: { for (std::list::const_iterator itr = MinionList.begin(); itr != MinionList.end(); ++itr) { - if (CAST_CRE(*itr)->GetOwner()->GetGUID() == me->GetOwner()->GetGUID()) + if ((*itr)->GetOwner()->GetGUID() == me->GetOwner()->GetGUID()) { - if (CAST_CRE(*itr)->isInCombat() && CAST_CRE(*itr)->getAttackerForHelper()) + if ((*itr)->isInCombat() && (*itr)->getAttackerForHelper()) { - AttackStart(CAST_CRE(*itr)->getAttackerForHelper()); + AttackStart((*itr)->getAttackerForHelper()); } } } @@ -820,16 +826,13 @@ public: { if (Unit* owner = me->GetOwner()) { - if (owner->GetTypeId() == TYPEID_PLAYER && CAST_PLR(owner)->isInCombat()) + Player* plrOwner = owner->ToPlayer(); + if (plrOwner && plrOwner->isInCombat()) { - if (CAST_PLR(owner)->getAttackerForHelper() && CAST_PLR(owner)->getAttackerForHelper()->GetEntry() == GHOSTS) - { - AttackStart(CAST_PLR(owner)->getAttackerForHelper()); - } + if (plrOwner->getAttackerForHelper() && plrOwner->getAttackerForHelper()->GetEntry() == GHOSTS) + AttackStart(plrOwner->getAttackerForHelper()); else - { FindMinions(owner); - } } } } @@ -868,17 +871,17 @@ class npc_scarlet_miner_cart : public CreatureScript public: npc_scarlet_miner_cart() : CreatureScript("npc_scarlet_miner_cart") { } - CreatureAI* GetAI(Creature* _Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new npc_scarlet_miner_cartAI(_Creature); + return new npc_scarlet_miner_cartAI(creature); } struct npc_scarlet_miner_cartAI : public PassiveAI { - npc_scarlet_miner_cartAI(Creature* c) : PassiveAI(c), minerGUID(0) + npc_scarlet_miner_cartAI(Creature* creature) : PassiveAI(creature), minerGUID(0) { me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); - me->SetDisplayId(me->GetCreatureInfo()->Modelid1); // Modelid2 is a horse. + me->SetDisplayId(me->GetCreatureTemplate()->Modelid1); // Modelid2 is a horse. } uint64 minerGUID; @@ -892,7 +895,7 @@ public: { if (Creature* miner = Unit::GetCreature(*me, minerGUID)) { - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); //Not 100% correct, but movement is smooth. Sometimes miner walks faster //than normal, this speed is fast enough to keep up at those times. @@ -924,14 +927,14 @@ class npc_scarlet_miner : public CreatureScript public: npc_scarlet_miner() : CreatureScript("npc_scarlet_miner") { } - CreatureAI* GetAI(Creature* _Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new npc_scarlet_minerAI(_Creature); + return new npc_scarlet_minerAI(creature); } struct npc_scarlet_minerAI : public npc_escortAI { - npc_scarlet_minerAI(Creature* c) : npc_escortAI(c) + npc_scarlet_minerAI(Creature* creature) : npc_escortAI(creature) { me->SetReactState(REACT_PASSIVE); } @@ -988,9 +991,9 @@ public: SetDespawnAtFar(false); } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - switch (i) + switch (waypointId) { case 1: if (Unit* car = Unit::GetCreature(*me, carGUID)) @@ -1057,7 +1060,7 @@ class go_inconspicuous_mine_car : public GameObjectScript public: go_inconspicuous_mine_car() : GameObjectScript("go_inconspicuous_mine_car") { } - bool OnGossipHello(Player* player, GameObject* /*pGO*/) + bool OnGossipHello(Player* player, GameObject* /*go*/) { if (player->GetQuestStatus(12701) == QUEST_STATUS_INCOMPLETE) { diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp index 4583a33a196..1c17e6afa9b 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp @@ -111,12 +111,33 @@ public: switch (uiSpeech_counter) { - case 1: DoScriptText(SAY_PERSUADED1, me); uiSpeech_timer = 8000; break; - case 2: DoScriptText(SAY_PERSUADED2, me); uiSpeech_timer = 8000; break; - case 3: DoScriptText(SAY_PERSUADED3, me); uiSpeech_timer = 8000; break; - case 4: DoScriptText(SAY_PERSUADED4, me); uiSpeech_timer = 8000; break; - case 5: DoScriptText(SAY_PERSUADED5, player); uiSpeech_timer = 8000; break; - case 6: DoScriptText(SAY_PERSUADED6, me); + case 1: + DoScriptText(SAY_PERSUADED1, me); + uiSpeech_timer = 8000; + break; + + case 2: + DoScriptText(SAY_PERSUADED2, me); + uiSpeech_timer = 8000; + break; + + case 3: + DoScriptText(SAY_PERSUADED3, me); + uiSpeech_timer = 8000; + break; + + case 4: + DoScriptText(SAY_PERSUADED4, me); + uiSpeech_timer = 8000; + break; + + case 5: + DoScriptText(SAY_PERSUADED5, player); + uiSpeech_timer = 8000; + break; + + case 6: + DoScriptText(SAY_PERSUADED6, me); player->Kill(me); //me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); //me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -218,9 +239,9 @@ public: } } - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { - switch (uiPointId) + switch (waypointId) { case 0: DoScriptText(SAY_BREAKOUT1, me); @@ -256,9 +277,7 @@ public: void JustSummoned(Creature* summoned) { if (Player* player = GetPlayerForEscort()) - { summoned->AI()->AttackStart(player); - } if (summoned->GetEntry() == NPC_HIGH_INQUISITOR_VALROTH) m_uiValrothGUID = summoned->GetGUID(); @@ -400,7 +419,7 @@ public: switch (uiStage) { case 1: - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); if (GameObject* tree = me->FindNearestGameObject(GO_INCONSPICUOUS_TREE, 40.0f)) { DoScriptText(SAY_TREE1, me); @@ -608,48 +627,48 @@ public: me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); } - bool MeetQuestCondition(Unit* player) + bool MeetQuestCondition(Player* player) { switch (me->GetEntry()) { case 29061: // Ellen Stanbridge - if (CAST_PLR(player)->GetQuestStatus(12742) == QUEST_STATUS_INCOMPLETE) + if (player->GetQuestStatus(12742) == QUEST_STATUS_INCOMPLETE) return true; break; case 29072: // Kug Ironjaw - if (CAST_PLR(player)->GetQuestStatus(12748) == QUEST_STATUS_INCOMPLETE) + if (player->GetQuestStatus(12748) == QUEST_STATUS_INCOMPLETE) return true; break; case 29067: // Donovan Pulfrost - if (CAST_PLR(player)->GetQuestStatus(12744) == QUEST_STATUS_INCOMPLETE) + if (player->GetQuestStatus(12744) == QUEST_STATUS_INCOMPLETE) return true; break; case 29065: // Yazmina Oakenthorn - if (CAST_PLR(player)->GetQuestStatus(12743) == QUEST_STATUS_INCOMPLETE) + if (player->GetQuestStatus(12743) == QUEST_STATUS_INCOMPLETE) return true; break; case 29071: // Antoine Brack - if (CAST_PLR(player)->GetQuestStatus(12750) == QUEST_STATUS_INCOMPLETE) + if (player->GetQuestStatus(12750) == QUEST_STATUS_INCOMPLETE) return true; break; case 29032: // Malar Bravehorn - if (CAST_PLR(player)->GetQuestStatus(12739) == QUEST_STATUS_INCOMPLETE) + if (player->GetQuestStatus(12739) == QUEST_STATUS_INCOMPLETE) return true; break; case 29068: // Goby Blastenheimer - if (CAST_PLR(player)->GetQuestStatus(12745) == QUEST_STATUS_INCOMPLETE) + if (player->GetQuestStatus(12745) == QUEST_STATUS_INCOMPLETE) return true; break; case 29073: // Iggy Darktusk - if (CAST_PLR(player)->GetQuestStatus(12749) == QUEST_STATUS_INCOMPLETE) + if (player->GetQuestStatus(12749) == QUEST_STATUS_INCOMPLETE) return true; break; case 29074: // Lady Eonys - if (CAST_PLR(player)->GetQuestStatus(12747) == QUEST_STATUS_INCOMPLETE) + if (player->GetQuestStatus(12747) == QUEST_STATUS_INCOMPLETE) return true; break; case 29070: // Valok the Righteous - if (CAST_PLR(player)->GetQuestStatus(12746) == QUEST_STATUS_INCOMPLETE) + if (player->GetQuestStatus(12746) == QUEST_STATUS_INCOMPLETE) return true; break; } @@ -662,7 +681,7 @@ public: if (PlayerGUID || who->GetTypeId() != TYPEID_PLAYER || !who->IsWithinDist(me, INTERACTION_DISTANCE)) return; - if (MeetQuestCondition(who)) + if (MeetQuestCondition(who->ToPlayer())) PlayerGUID = who->GetGUID(); } @@ -704,7 +723,9 @@ public: me->SetStandState(UNIT_STAND_STATE_KNEEL); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; - case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break; + case 10: + DoScriptText(SAY_EXEC_WAITING, me, player); + break; case 11: DoScriptText(EMOTE_DIES, me); me->setDeathState(JUST_DIED); @@ -732,7 +753,9 @@ public: me->SetStandState(UNIT_STAND_STATE_KNEEL); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; - case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break; + case 10: + DoScriptText(SAY_EXEC_WAITING, me, player); + break; case 11: DoScriptText(EMOTE_DIES, me); me->setDeathState(JUST_DIED); @@ -760,7 +783,9 @@ public: me->SetStandState(UNIT_STAND_STATE_KNEEL); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; - case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break; + case 10: + DoScriptText(SAY_EXEC_WAITING, me, player); + break; case 11: DoScriptText(EMOTE_DIES, me); me->setDeathState(JUST_DIED); @@ -788,7 +813,9 @@ public: me->SetStandState(UNIT_STAND_STATE_KNEEL); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; - case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break; + case 10: + DoScriptText(SAY_EXEC_WAITING, me, player); + break; case 11: DoScriptText(EMOTE_DIES, me); me->setDeathState(JUST_DIED); @@ -816,7 +843,9 @@ public: me->SetStandState(UNIT_STAND_STATE_KNEEL); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; - case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break; + case 10: + DoScriptText(SAY_EXEC_WAITING, me, player); + break; case 11: DoScriptText(EMOTE_DIES, me); me->setDeathState(JUST_DIED); @@ -844,7 +873,9 @@ public: me->SetStandState(UNIT_STAND_STATE_KNEEL); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; - case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break; + case 10: + DoScriptText(SAY_EXEC_WAITING, me, player); + break; case 11: DoScriptText(EMOTE_DIES, me); me->setDeathState(JUST_DIED); @@ -872,7 +903,9 @@ public: me->SetStandState(UNIT_STAND_STATE_KNEEL); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; - case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break; + case 10: + DoScriptText(SAY_EXEC_WAITING, me, player); + break; case 11: DoScriptText(EMOTE_DIES, me); me->setDeathState(JUST_DIED); @@ -900,7 +933,9 @@ public: me->SetStandState(UNIT_STAND_STATE_KNEEL); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; - case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break; + case 10: + DoScriptText(SAY_EXEC_WAITING, me, player); + break; case 11: DoScriptText(EMOTE_DIES, me); me->setDeathState(JUST_DIED); @@ -928,7 +963,9 @@ public: me->SetStandState(UNIT_STAND_STATE_KNEEL); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; - case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break; + case 10: + DoScriptText(SAY_EXEC_WAITING, me, player); + break; case 11: DoScriptText(EMOTE_DIES, me); me->setDeathState(JUST_DIED); @@ -956,7 +993,9 @@ public: me->SetStandState(UNIT_STAND_STATE_KNEEL); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); break; - case 10: DoScriptText(SAY_EXEC_WAITING, me, player); break; + case 10: + DoScriptText(SAY_EXEC_WAITING, me, player); + break; case 11: DoScriptText(EMOTE_DIES, me); me->setDeathState(JUST_DIED); @@ -978,7 +1017,6 @@ public: } } }; - }; void AddSC_the_scarlet_enclave_c2() diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp index 81c4b1261ef..8cee23fab1c 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp @@ -287,10 +287,10 @@ class npc_highlord_darion_mograine : public CreatureScript public: npc_highlord_darion_mograine() : CreatureScript("npc_highlord_darion_mograine") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->CLOSE_GOSSIP_MENU(); @@ -497,17 +497,16 @@ public: SetEscortPaused(bOnHold); } - void WaypointReached(uint32 wpId) + void WaypointReached(uint32 waypointId) { - switch (wpId) + switch (waypointId) { case 0: - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); SetHoldState(true); break; case 1: SetHoldState(true); - SpawnNPC(); if (Creature* temp = Unit::GetCreature(*me, uiKorfaxGUID)) DoScriptText(SAY_LIGHT_OF_DAWN07, temp); @@ -537,7 +536,7 @@ public: bIsBattle = true; break; case 2: - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); DoCast(me, SPELL_THE_LIGHT_OF_DAWN); break; case 3: @@ -551,34 +550,35 @@ public: { if (temp->HasAura(SPELL_THE_LIGHT_OF_DAWN, 0)) temp->RemoveAurasDueToSpell(SPELL_THE_LIGHT_OF_DAWN); - temp->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(true); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[19].x, LightofDawnLoc[19].y, LightofDawnLoc[19].z); } if (Creature* temp = Unit::GetCreature(*me, uiThassarianGUID)) { if (temp->HasAura(SPELL_THE_LIGHT_OF_DAWN, 0)) temp->RemoveAurasDueToSpell(SPELL_THE_LIGHT_OF_DAWN); - temp->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(true); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[21].x, LightofDawnLoc[21].y, LightofDawnLoc[21].z); } if (Creature* temp = Unit::GetCreature(*me, uiKorfaxGUID)) { - temp->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(true); temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[10].x, LightofDawnLoc[10].y, LightofDawnLoc[10].z); } if (Creature* temp = Unit::GetCreature(*me, uiMaxwellGUID)) { - temp->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(true); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[13].x, LightofDawnLoc[13].y, LightofDawnLoc[13].z); } if (Creature* temp = Unit::GetCreature(*me, uiEligorGUID)) { - temp->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(true); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[16].x, LightofDawnLoc[16].y, LightofDawnLoc[16].z); } JumpToNextStep(10000); - } break; + } + break; case 4: DoScriptText(SAY_LIGHT_OF_DAWN27, me); me->SetStandState(UNIT_STAND_STATE_KNEEL); @@ -664,7 +664,7 @@ public: if (uiSummon_counter < ENCOUNTER_GHOUL_NUMBER) { Unit* temp = me->SummonCreature(NPC_ACHERUS_GHOUL, (me->GetPositionX()-20)+rand()%40, (me->GetPositionY()-20)+rand()%40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->setFaction(2084); uiGhoulGUID[uiSummon_counter] = temp->GetGUID(); ++uiSummon_counter; @@ -682,7 +682,7 @@ public: if (uiSummon_counter < ENCOUNTER_ABOMINATION_NUMBER) { Unit* temp = me->SummonCreature(NPC_RAMPAGING_ABOMINATION, (me->GetPositionX()-20)+rand()%40, (me->GetPositionY()-20)+rand()%40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->setFaction(2084); uiAbominationGUID[uiSummon_counter] = temp->GetGUID(); ++uiSummon_counter; @@ -700,7 +700,7 @@ public: if (uiSummon_counter < ENCOUNTER_WARRIOR_NUMBER) { Unit* temp = me->SummonCreature(NPC_WARRIOR_OF_THE_FROZEN_WASTES, (me->GetPositionX()-20)+rand()%40, (me->GetPositionY()-20)+rand()%40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->setFaction(2084); uiWarriorGUID[uiSummon_counter] = temp->GetGUID(); ++uiSummon_counter; @@ -718,7 +718,7 @@ public: if (uiSummon_counter < ENCOUNTER_BEHEMOTH_NUMBER) { Unit* temp = me->SummonCreature(NPC_FLESH_BEHEMOTH, (me->GetPositionX()-20)+rand()%40, (me->GetPositionY()-20)+rand()%40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->setFaction(2084); uiBehemothGUID[uiSummon_counter] = temp->GetGUID(); ++uiSummon_counter; @@ -739,17 +739,17 @@ public: SetHoldState(false); if (Creature* temp = Unit::GetCreature(*me, uiKoltiraGUID)) { - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); } if (Creature* temp = Unit::GetCreature(*me, uiOrbazGUID)) { - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); } if (Creature* temp = Unit::GetCreature(*me, uiThassarianGUID)) { - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); } for (uint8 i = 0; i < ENCOUNTER_ABOMINATION_NUMBER; ++i) @@ -824,7 +824,7 @@ public: if (Unit* temp = me->SummonCreature(NPC_DARION_MOGRAINE, LightofDawnLoc[24].x, LightofDawnLoc[24].y, LightofDawnLoc[24].z, LightofDawnLoc[24].o, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000)) { DoScriptText(SAY_LIGHT_OF_DAWN35, temp); - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); uiDarionGUID = temp->GetGUID(); } JumpToNextStep(4000); @@ -938,9 +938,9 @@ public: case 33: // Darion supports to jump to lich king here if (Unit::GetCreature(*me, uiLichKingGUID)) DoCast(me, SPELL_MOGRAINE_CHARGE); // jumping charge - // doesn't make it looks well, so workarounds, Darion charges, looks better + // doesn't make it looks well, so workarounds, Darion charges, looks better me->SetSpeed(MOVE_RUN, 3.0f); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); SetHoldState(false); JumpToNextStep(0); break; @@ -1010,10 +1010,9 @@ public: if (fLichPositionX && fLichPositionY) { - Unit* temp; - temp = me->SummonCreature(NPC_DEFENDER_OF_THE_LIGHT, LightofDawnLoc[0].x+rand()%10, LightofDawnLoc[0].y+rand()%10, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000); + Unit* temp = me->SummonCreature(NPC_DEFENDER_OF_THE_LIGHT, LightofDawnLoc[0].x+rand()%10, LightofDawnLoc[0].y+rand()%10, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000); temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->SetSpeed(MOVE_RUN, 2.0f); temp->setFaction(me->getFaction()); temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); @@ -1021,7 +1020,7 @@ public: temp = me->SummonCreature(NPC_RIMBLAT_EARTHSHATTER, LightofDawnLoc[0].x+rand()%10, LightofDawnLoc[0].y+rand()%10, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000); temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->SetSpeed(MOVE_RUN, 2.0f); temp->setFaction(me->getFaction()); temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); @@ -1030,7 +1029,7 @@ public: if (Creature* temp = Unit::GetCreature(*me, uiMaxwellGUID)) { temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->SetSpeed(MOVE_RUN, 2.0f); temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); DoScriptText(SAY_LIGHT_OF_DAWN50, temp); @@ -1038,7 +1037,7 @@ public: if (Creature* temp = Unit::GetCreature(*me, uiKorfaxGUID)) { temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->SetSpeed(MOVE_RUN, 2.0f); temp->HandleEmoteCommand(EMOTE_STATE_ATTACK_UNARMED); temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); @@ -1046,7 +1045,7 @@ public: if (Creature* temp = Unit::GetCreature(*me, uiEligorGUID)) { temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->SetSpeed(MOVE_RUN, 2.0f); temp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); } @@ -1111,7 +1110,7 @@ public: case 46: // Darion stand up, "not today" me->SetSpeed(MOVE_RUN, 1.0f); - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); me->SetStandState(UNIT_STAND_STATE_STAND); DoScriptText(SAY_LIGHT_OF_DAWN53, me); SetHoldState(false); // Darion throws sword @@ -1171,7 +1170,7 @@ public: temp->CastSpell(temp, SPELL_TIRION_CHARGE, false); // jumping charge temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H); temp->SetSpeed(MOVE_RUN, 3.0f); // workarounds, make Tirion still running - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[2].x, LightofDawnLoc[2].y, LightofDawnLoc[2].z); if (Creature* lktemp = Unit::GetCreature(*me, uiLichKingGUID)) lktemp->Relocate(LightofDawnLoc[28].x, LightofDawnLoc[28].y, LightofDawnLoc[28].z); // workarounds, he should kick back by Tirion, but here we relocate him @@ -1189,7 +1188,7 @@ public: if (Creature* temp = Unit::GetCreature(*me, uiLichKingGUID)) { temp->SetSpeed(MOVE_RUN, 1.0f); - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[29].x, LightofDawnLoc[29].y, LightofDawnLoc[29].z); // 26 } JumpToNextStep(4000); @@ -1249,7 +1248,7 @@ public: case 62: if (Creature* temp = Unit::GetCreature(*me, uiTirionGUID)) { - temp->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(true); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[7].x, LightofDawnLoc[7].y, LightofDawnLoc[7].z); } JumpToNextStep(5500); @@ -1309,7 +1308,6 @@ public: case 71: //if (GameObject* go = me->GetMap()->GetGameObject(uiDawnofLightGUID)) // Turn off dawn of light // go->SetPhaseMask(0, true); - { Map* map = me->GetMap(); // search players with in 50 yards for quest credit Map::PlayerList const &PlayerList = map->GetPlayers(); @@ -1438,7 +1436,7 @@ public: me->DeleteThreatList(); me->CombatStop(true); me->InterruptNonMeleeSpells(false); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); for (uint8 i = 0; i < ENCOUNTER_DEFENDER_NUMBER; ++i) DespawnNPC(uiDefenderGUID[i]); @@ -1460,7 +1458,7 @@ public: temp->CombatStop(true); temp->AttackStop(); temp->setFaction(me->getFaction()); - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[9].x, LightofDawnLoc[9].y, LightofDawnLoc[9].z); } @@ -1471,7 +1469,7 @@ public: temp->CombatStop(true); temp->AttackStop(); temp->setFaction(me->getFaction()); - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[12].x, LightofDawnLoc[12].y, LightofDawnLoc[12].z); } @@ -1482,7 +1480,7 @@ public: temp->CombatStop(true); temp->AttackStop(); temp->setFaction(me->getFaction()); - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[15].x, LightofDawnLoc[15].y, LightofDawnLoc[15].z); } DespawnNPC(uiRayneGUID); @@ -1494,7 +1492,7 @@ public: temp->CombatStop(true); temp->AttackStop(); temp->setFaction(me->getFaction()); - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[18].x, LightofDawnLoc[18].y, LightofDawnLoc[18].z); temp->CastSpell(temp, SPELL_THE_LIGHT_OF_DAWN, false); } @@ -1509,7 +1507,7 @@ public: temp->CombatStop(true); temp->AttackStop(); temp->setFaction(me->getFaction()); - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); temp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[20].x, LightofDawnLoc[20].y, LightofDawnLoc[20].z); temp->CastSpell(temp, SPELL_THE_LIGHT_OF_DAWN, false); } diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp index 9512d66b6eb..0ef2dddda8d 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp @@ -35,7 +35,7 @@ public: struct npc_valkyr_battle_maidenAI : public PassiveAI { - npc_valkyr_battle_maidenAI(Creature* c) : PassiveAI(c) {} + npc_valkyr_battle_maidenAI(Creature* creature) : PassiveAI(creature) {} uint32 FlyBackTimer; float x, y, z; @@ -46,7 +46,7 @@ public: me->setActive(true); me->SetVisible(false); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->SetFlying(true); + me->SetCanFly(true); FlyBackTimer = 500; phase = 0; @@ -74,7 +74,7 @@ public: switch (phase) { case 0: - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); me->HandleEmoteCommand(EMOTE_STATE_FLYGRABCLOSED); FlyBackTimer = 500; break; diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp index 77099f2e2d7..813c43288d0 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp @@ -296,8 +296,11 @@ public: if (spell->Id == SPELL_FLYING_HEAD) { - if (Phase < 3) ++Phase; - else Phase = 3; + if (Phase < 3) + ++Phase; + else + Phase = 3; + withbody = false; if (!bodyGUID) bodyGUID = caster->GetGUID(); @@ -319,7 +322,8 @@ public: if (wait <= diff) { wait = 1000; - if (!me->getVictim()) return; + if (!me->getVictim()) + return; me->GetMotionMaster()->Clear(false); me->GetMotionMaster()->MoveFleeing(me->getVictim()); } @@ -344,7 +348,7 @@ public: if (wait <= diff) { die = false; - if (Unit* body = Unit::GetUnit((*me), bodyGUID)) + if (Unit* body = Unit::GetUnit(*me, bodyGUID)) body->Kill(body); me->Kill(me); } @@ -429,7 +433,7 @@ public: { me->SetVisible(false); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING); + me->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_DISABLE_GRAVITY); me->SetSpeed(MOVE_WALK, 5.0f, true); wp_reached = false; count = 0; @@ -462,7 +466,7 @@ public: instance->SetData(GAMEOBJECT_PUMPKIN_SHRINE, 0); //hide gameobject break; case 19: - me->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING); + me->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_DISABLE_GRAVITY); break; case 20: { @@ -471,7 +475,7 @@ public: wp_reached = false; me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); SaySound(SAY_ENTRANCE); - if (Unit* player = Unit::GetUnit((*me), PlayerGUID)) + if (Unit* player = Unit::GetUnit(*me, PlayerGUID)) DoStartMovement(player); break; } @@ -485,12 +489,18 @@ public: instance->SetData(DATA_HORSEMAN_EVENT, IN_PROGRESS); DoZoneInCombat(); } - void AttackStart(Unit* who) {ScriptedAI::AttackStart(who);} + + void AttackStart(Unit* who) + { + ScriptedAI::AttackStart(who); + } + void MoveInLineOfSight(Unit* who) { if (withhead && Phase != 0) ScriptedAI::MoveInLineOfSight(who); } + void KilledUnit(Unit* player) { if (player->GetTypeId() == TYPEID_PLAYER) @@ -576,7 +586,7 @@ public: std::list::const_iterator itr; for (itr = caster->getThreatManager().getThreatList().begin(); itr != caster->getThreatManager().getThreatList().end(); ++itr) { - Unit* unit = Unit::GetUnit((*me), (*itr)->getUnitGuid()); + Unit* unit = Unit::GetUnit(*me, (*itr)->getUnitGuid()); if (unit && unit->isAlive() && unit != caster) me->AddThreat(unit, caster->getThreatManager().getThreat(unit)); } @@ -595,7 +605,8 @@ public: if (!headGUID) headGUID = DoSpawnCreature(HEAD, float(rand()%6), float(rand()%6), 0, 0, TEMPSUMMON_DEAD_DESPAWN, 0)->GetGUID(); - Unit* Head = Unit::GetUnit((*me), headGUID); + + Unit* Head = Unit::GetUnit(*me, headGUID); if (Head && Head->isAlive()) { Head->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); @@ -803,14 +814,22 @@ public: void Despawn() { - if (!debuffGUID) return; - Unit* debuff = Unit::GetUnit((*me), debuffGUID); + if (!debuffGUID) + return; + + Unit* debuff = Unit::GetUnit(*me, debuffGUID); if (debuff) + { debuff->SetVisible(false); debuffGUID = 0; + } } - void JustDied(Unit* /*killer*/) { if (!sprouted) Despawn(); } + void JustDied(Unit* /*killer*/) + { + if (!sprouted) + Despawn(); + } void MoveInLineOfSight(Unit* who) { diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp index 16b90f89bb5..58c21d86a2f 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp @@ -152,7 +152,12 @@ public: uint32 Start_Timer; void Reset() {} - void WaypointReached(uint32 /*point*/) {} + + void WaypointReached(uint32 /*waypointId*/) + { + + } + void EnterCombat(Unit* /*who*/) {} void UpdateAI(const uint32 diff) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp index a64636a4223..1989c318c84 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp @@ -66,9 +66,15 @@ public: Sleep_Timer = 30000; Dispel_Timer = 20000; PowerWordShield = false; + me->SetStandState(UNIT_STAND_STATE_DEAD); + me->SetUInt32Value(UNIT_FIELD_BYTES_1, 7); } - void EnterCombat(Unit* /*who*/) {} + void EnterCombat(Unit* /*who*/) + { + me->SetStandState(UNIT_STAND_STATE_STAND); + me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + } void UpdateAI(const uint32 diff) { diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp index 058c688641f..fd978136339 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp @@ -78,12 +78,12 @@ public: DoScriptText(SAY_KILL, me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (!instance) return; - //Any other actions to do with vorrel? setStandState? + //Any other Actions to do with vorrel? setStandState? if (Unit* vorrel = Unit::GetUnit(*me, instance->GetData64(DATA_VORREL))) DoScriptText(SAY_TRIGGER_VORREL, vorrel); } diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp index ec6ac34b0bb..8d813bfe502 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp @@ -132,7 +132,7 @@ public: return; //On first death, fake death and open door, as well as initiate whitemane if exist - if (Unit* Whitemane = Unit::GetUnit((*me), instance->GetData64(DATA_WHITEMANE))) + if (Unit* Whitemane = Unit::GetUnit(*me, instance->GetData64(DATA_WHITEMANE))) { instance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, IN_PROGRESS); @@ -181,7 +181,7 @@ public: if (_bHasDied && !_bHeal && instance && instance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == SPECIAL) { //On ressurection, stop fake death and heal whitemane and resume fight - if (Unit* Whitemane = Unit::GetUnit((*me), instance->GetData64(DATA_WHITEMANE))) + if (Unit* Whitemane = Unit::GetUnit(*me, instance->GetData64(DATA_WHITEMANE))) { me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetStandState(UNIT_STAND_STATE_STAND); @@ -292,7 +292,7 @@ public: //When casting resuruction make sure to delay so on rez when reinstate battle deepsleep runs out if (instance && Wait_Timer <= diff) { - if (Unit* Mograine = Unit::GetUnit((*me), instance->GetData64(DATA_MOGRAINE))) + if (Unit* Mograine = Unit::GetUnit(*me, instance->GetData64(DATA_MOGRAINE))) { DoCast(Mograine, SPELL_SCARLETRESURRECTION); DoScriptText(SAY_WH_RESSURECT, me); diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp index 4ddc240a03c..2bc0320b81d 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp @@ -62,7 +62,7 @@ public: struct boss_darkmaster_gandlingAI : public ScriptedAI { - boss_darkmaster_gandlingAI(Creature* c) : ScriptedAI(c) + boss_darkmaster_gandlingAI(Creature* creature) : ScriptedAI(creature) { instance = me->GetInstanceScript(); } diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_death_knight_darkreaver.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_death_knight_darkreaver.cpp index 693cad06bd5..967f771fe7a 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_death_knight_darkreaver.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_death_knight_darkreaver.cpp @@ -37,7 +37,7 @@ public: struct boss_death_knight_darkreaverAI : public ScriptedAI { - boss_death_knight_darkreaverAI(Creature* c) : ScriptedAI(c) {} + boss_death_knight_darkreaverAI(Creature* creature) : ScriptedAI(creature) {} void Reset() { diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp index 05d662c4fe3..82f4dc85060 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp @@ -45,7 +45,7 @@ public: struct boss_theolenkrastinovAI : public ScriptedAI { - boss_theolenkrastinovAI(Creature* c) : ScriptedAI(c) {} + boss_theolenkrastinovAI(Creature* creature) : ScriptedAI(creature) {} uint32 m_uiRend_Timer; uint32 m_uiBackhand_Timer; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp index 92f0fcd25c4..e438ae56a2b 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp @@ -43,7 +43,7 @@ public: struct boss_illuciabarovAI : public ScriptedAI { - boss_illuciabarovAI(Creature* c) : ScriptedAI(c) {} + boss_illuciabarovAI(Creature* creature) : ScriptedAI(creature) {} uint32 CurseOfAgony_Timer; uint32 ShadowShock_Timer; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp index 295d9440d2e..498e6596b06 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp @@ -44,7 +44,7 @@ public: struct boss_instructormaliciaAI : public ScriptedAI { - boss_instructormaliciaAI(Creature* c) : ScriptedAI(c) {} + boss_instructormaliciaAI(Creature* creature) : ScriptedAI(creature) {} uint32 CallOfGraves_Timer; uint32 Corruption_Timer; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp index 48bf000745c..064faa5643d 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp @@ -43,7 +43,7 @@ public: struct boss_jandicebarovAI : public ScriptedAI { - boss_jandicebarovAI(Creature* c) : ScriptedAI(c) {} + boss_jandicebarovAI(Creature* creature) : ScriptedAI(creature) {} uint32 CurseOfBlood_Timer; uint32 Illusion_Timer; @@ -165,7 +165,7 @@ public: struct mob_illusionofjandicebarovAI : public ScriptedAI { - mob_illusionofjandicebarovAI(Creature* c) : ScriptedAI(c) {} + mob_illusionofjandicebarovAI(Creature* creature) : ScriptedAI(creature) {} uint32 Cleave_Timer; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp index 7c279e726a6..5fd5a96d605 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp @@ -40,7 +40,7 @@ public: struct boss_kormokAI : public ScriptedAI { - boss_kormokAI(Creature* c) : ScriptedAI(c) {} + boss_kormokAI(Creature* creature) : ScriptedAI(creature) {} uint32 ShadowVolley_Timer; uint32 BoneShield_Timer; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp index 5109e6e1468..327c1df921d 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp @@ -41,7 +41,7 @@ public: struct boss_lordalexeibarovAI : public ScriptedAI { - boss_lordalexeibarovAI(Creature* c) : ScriptedAI(c) {} + boss_lordalexeibarovAI(Creature* creature) : ScriptedAI(creature) {} uint32 Immolate_Timer; uint32 VeilofShadow_Timer; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp index 754640bff9e..1919a1ba099 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp @@ -43,7 +43,7 @@ public: struct boss_lorekeeperpolkeltAI : public ScriptedAI { - boss_lorekeeperpolkeltAI(Creature* c) : ScriptedAI(c) {} + boss_lorekeeperpolkeltAI(Creature* creature) : ScriptedAI(creature) {} uint32 VolatileInfection_Timer; uint32 Darkplague_Timer; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp index 902838da152..fd10c6374a6 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp @@ -44,7 +44,7 @@ public: struct boss_rasfrostAI : public ScriptedAI { - boss_rasfrostAI(Creature* c) : ScriptedAI(c) {} + boss_rasfrostAI(Creature* creature) : ScriptedAI(creature) {} uint32 IceArmor_Timer; uint32 Frostbolt_Timer; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp index 13fa450f5ee..a28cecf3772 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp @@ -43,7 +43,7 @@ public: struct boss_theravenianAI : public ScriptedAI { - boss_theravenianAI(Creature* c) : ScriptedAI(c) {} + boss_theravenianAI(Creature* creature) : ScriptedAI(creature) {} uint32 Trample_Timer; uint32 Cleave_Timer; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp index 657b458e148..f5f453c30bd 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp @@ -45,7 +45,7 @@ public: struct boss_vectusAI : public ScriptedAI { - boss_vectusAI(Creature* c) : ScriptedAI(c) {} + boss_vectusAI(Creature* creature) : ScriptedAI(creature) {} uint32 m_uiFireShield_Timer; uint32 m_uiBlastWave_Timer; diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp index dded75e193c..63e753a18ba 100644 --- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp +++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp @@ -63,10 +63,10 @@ public: return new npc_shadowfang_prisonerAI(creature); } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { player->CLOSE_GOSSIP_MENU(); @@ -90,18 +90,18 @@ public: struct npc_shadowfang_prisonerAI : public npc_escortAI { - npc_shadowfang_prisonerAI(Creature* c) : npc_escortAI(c) + npc_shadowfang_prisonerAI(Creature* creature) : npc_escortAI(creature) { - instance = c->GetInstanceScript(); - uiNpcEntry = c->GetEntry(); + instance = creature->GetInstanceScript(); + uiNpcEntry = creature->GetEntry(); } InstanceScript* instance; uint32 uiNpcEntry; - void WaypointReached(uint32 uiPoint) + void WaypointReached(uint32 waypointId) { - switch (uiPoint) + switch (waypointId) { case 0: if (uiNpcEntry == NPC_ASH) @@ -175,10 +175,7 @@ public: if (uiDarkOffering <= uiDiff) { if (Creature* pFriend = me->FindNearestCreature(me->GetEntry(), 25.0f, true)) - { - if (pFriend) - DoCast(pFriend, SPELL_DARK_OFFERING); - } + DoCast(pFriend, SPELL_DARK_OFFERING); else DoCast(me, SPELL_DARK_OFFERING); uiDarkOffering = urand(4400, 12500); diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp index 0c659117f5d..85faa14900b 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp @@ -89,7 +89,7 @@ public: struct boss_baron_rivendareAI : public ScriptedAI { - boss_baron_rivendareAI(Creature* c) : ScriptedAI(c) + boss_baron_rivendareAI(Creature* creature) : ScriptedAI(creature) { instance = me->GetInstanceScript(); } @@ -126,7 +126,7 @@ public: summoned->AI()->AttackStart(target); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(TYPE_BARON, DONE); diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp index a01846cb862..106719d654f 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp @@ -43,7 +43,7 @@ public: struct boss_baroness_anastariAI : public ScriptedAI { - boss_baroness_anastariAI(Creature* c) : ScriptedAI(c) + boss_baroness_anastariAI(Creature* creature) : ScriptedAI(creature) { instance = me->GetInstanceScript(); } @@ -67,7 +67,7 @@ public: { } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(TYPE_BARONESS, IN_PROGRESS); diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_cannon_master_willey.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_cannon_master_willey.cpp index d84bd489dab..01299ae06b6 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_cannon_master_willey.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_cannon_master_willey.cpp @@ -88,7 +88,7 @@ public: struct boss_cannon_master_willeyAI : public ScriptedAI { - boss_cannon_master_willeyAI(Creature* c) : ScriptedAI(c) {} + boss_cannon_master_willeyAI(Creature* creature) : ScriptedAI(creature) {} uint32 KnockAway_Timer; uint32 Pummel_Timer; @@ -103,7 +103,7 @@ public: SummonRifleman_Timer = 15000; } - void JustDied(Unit* /*Victim*/) + void JustDied(Unit* /*killer*/) { me->SummonCreature(11054, ADD_1X, ADD_1Y, ADD_1Z, ADD_1O, TEMPSUMMON_TIMED_DESPAWN, 240000); me->SummonCreature(11054, ADD_2X, ADD_2Y, ADD_2Z, ADD_2O, TEMPSUMMON_TIMED_DESPAWN, 240000); diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp index 8a14f1e2401..21e3e19d890 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp @@ -77,7 +77,7 @@ public: struct boss_dathrohan_balnazzarAI : public ScriptedAI { - boss_dathrohan_balnazzarAI(Creature* c) : ScriptedAI(c) {} + boss_dathrohan_balnazzarAI(Creature* creature) : ScriptedAI(creature) {} uint32 m_uiCrusadersHammer_Timer; uint32 m_uiCrusaderStrike_Timer; @@ -105,7 +105,7 @@ public: me->UpdateEntry(NPC_DATHROHAN); } - void JustDied(Unit* /*Victim*/) + void JustDied(Unit* /*killer*/) { static uint32 uiCount = sizeof(m_aSummonPoint)/sizeof(SummonDef); diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_magistrate_barthilas.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_magistrate_barthilas.cpp index 48b1fc2acc7..37e0bd5757f 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_magistrate_barthilas.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_magistrate_barthilas.cpp @@ -46,7 +46,7 @@ public: struct boss_magistrate_barthilasAI : public ScriptedAI { - boss_magistrate_barthilasAI(Creature* c) : ScriptedAI(c) {} + boss_magistrate_barthilasAI(Creature* creature) : ScriptedAI(creature) {} uint32 DrainingBlow_Timer; uint32 CrowdPummel_Timer; @@ -75,7 +75,7 @@ public: ScriptedAI::MoveInLineOfSight(who); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { me->SetDisplayId(MODEL_HUMAN); } diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp index 1dc22a20d08..f8a10f06155 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp @@ -43,7 +43,7 @@ public: struct boss_maleki_the_pallidAI : public ScriptedAI { - boss_maleki_the_pallidAI(Creature* c) : ScriptedAI(c) + boss_maleki_the_pallidAI(Creature* creature) : ScriptedAI(creature) { instance = me->GetInstanceScript(); } @@ -65,7 +65,7 @@ public: { } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(TYPE_PALLID, IN_PROGRESS); diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp index a7c91c3636d..c9a43edb66d 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp @@ -43,7 +43,7 @@ public: struct boss_nerubenkanAI : public ScriptedAI { - boss_nerubenkanAI(Creature* c) : ScriptedAI(c) + boss_nerubenkanAI(Creature* creature) : ScriptedAI(creature) { instance = me->GetInstanceScript(); } @@ -67,7 +67,7 @@ public: { } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(TYPE_NERUB, IN_PROGRESS); diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp index 3393b9e5797..ebeda248331 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp @@ -54,9 +54,9 @@ public: struct boss_silver_hand_bossesAI : public ScriptedAI { - boss_silver_hand_bossesAI(Creature* c) : ScriptedAI(c) + boss_silver_hand_bossesAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -96,30 +96,34 @@ public: { } - void JustDied(Unit* Killer) + void JustDied(Unit* killer) { - if (instance) + if (!instance) + return; + + switch (me->GetEntry()) { - switch (me->GetEntry()) - { - case SH_AELMAR: - instance->SetData(TYPE_SH_AELMAR, 2); - break; - case SH_CATHELA: - instance->SetData(TYPE_SH_CATHELA, 2); - break; - case SH_GREGOR: - instance->SetData(TYPE_SH_GREGOR, 2); - break; - case SH_NEMAS: - instance->SetData(TYPE_SH_NEMAS, 2); - break; - case SH_VICAR: - instance->SetData(TYPE_SH_VICAR, 2); - break; - } - if (instance->GetData(TYPE_SH_QUEST) && Killer->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(Killer)->KilledMonsterCredit(SH_QUEST_CREDIT, 0); + case SH_AELMAR: + instance->SetData(TYPE_SH_AELMAR, 2); + break; + case SH_CATHELA: + instance->SetData(TYPE_SH_CATHELA, 2); + break; + case SH_GREGOR: + instance->SetData(TYPE_SH_GREGOR, 2); + break; + case SH_NEMAS: + instance->SetData(TYPE_SH_NEMAS, 2); + break; + case SH_VICAR: + instance->SetData(TYPE_SH_VICAR, 2); + break; + } + + if (instance->GetData(TYPE_SH_QUEST)) + { + if (Player* player = killer->ToPlayer()) + player->KilledMonsterCredit(SH_QUEST_CREDIT, 0); } } diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_postmaster_malown.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_postmaster_malown.cpp index 869a82011ad..cf8b10a2ee5 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_postmaster_malown.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_postmaster_malown.cpp @@ -48,7 +48,7 @@ public: struct boss_postmaster_malownAI : public ScriptedAI { - boss_postmaster_malownAI(Creature* c) : ScriptedAI(c) {} + boss_postmaster_malownAI(Creature* creature) : ScriptedAI(creature) {} uint32 WailingDead_Timer; uint32 Backhand_Timer; diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp index f35bcc05ec2..3bb1ce7959d 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp @@ -43,7 +43,7 @@ public: struct boss_ramstein_the_gorgerAI : public ScriptedAI { - boss_ramstein_the_gorgerAI(Creature* c) : ScriptedAI(c) + boss_ramstein_the_gorgerAI(Creature* creature) : ScriptedAI(creature) { instance = me->GetInstanceScript(); } @@ -63,7 +63,7 @@ public: { } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { for (uint8 i = 0; i < 30; ++i) { diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_timmy_the_cruel.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_timmy_the_cruel.cpp index 405527ab383..a281c1b59c6 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_timmy_the_cruel.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_timmy_the_cruel.cpp @@ -41,7 +41,7 @@ public: struct boss_timmy_the_cruelAI : public ScriptedAI { - boss_timmy_the_cruelAI(Creature* c) : ScriptedAI(c) {} + boss_timmy_the_cruelAI(Creature* creature) : ScriptedAI(creature) {} uint32 RavenousClaw_Timer; bool HasYelled; diff --git a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp index 5b2b2fd46c1..7e167093e07 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp @@ -99,7 +99,7 @@ public: struct mob_freed_soulAI : public ScriptedAI { - mob_freed_soulAI(Creature* c) : ScriptedAI(c) {} + mob_freed_soulAI(Creature* creature) : ScriptedAI(creature) {} void Reset() { @@ -133,7 +133,7 @@ public: struct mob_restless_soulAI : public ScriptedAI { - mob_restless_soulAI(Creature* c) : ScriptedAI(c) {} + mob_restless_soulAI(Creature* creature) : ScriptedAI(creature) {} uint64 Tagger; uint32 Die_Timer; @@ -165,7 +165,7 @@ public: summoned->CastSpell(summoned, SPELL_SOUL_FREED, false); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (Tagged) me->SummonCreature(ENTRY_FREED, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN, 300000); @@ -211,7 +211,7 @@ public: struct mobs_spectral_ghostly_citizenAI : public ScriptedAI { - mobs_spectral_ghostly_citizenAI(Creature* c) : ScriptedAI(c) {} + mobs_spectral_ghostly_citizenAI(Creature* creature) : ScriptedAI(creature) {} uint32 Die_Timer; bool Tagged; @@ -230,7 +230,7 @@ public: Tagged = true; } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (Tagged) { diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp index 1404fd14e91..43c94f8a57d 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp @@ -78,9 +78,9 @@ public: struct boss_brutallusAI : public ScriptedAI { - boss_brutallusAI(Creature* c) : ScriptedAI(c) + boss_brutallusAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); Intro = true; } @@ -132,7 +132,7 @@ public: DoScriptText(RAND(YELL_KILL1, YELL_KILL2, YELL_KILL3), me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(YELL_DEATH, me); @@ -216,7 +216,7 @@ public: break; case 3: DoCast(me, SPELL_INTRO_FROST_BLAST); - Madrigosa->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + Madrigosa->SetDisableGravity(true); me->AttackStop(); Madrigosa->AttackStop(); IntroFrostBoltTimer = 3000; diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp index 56d7909336c..03486a644a2 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp @@ -97,9 +97,9 @@ public: struct boss_sacrolashAI : public ScriptedAI { - boss_sacrolashAI(Creature* c) : ScriptedAI(c) + boss_sacrolashAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -120,7 +120,7 @@ public: if (instance) { - Unit* Temp = Unit::GetUnit((*me), instance->GetData64(DATA_ALYTHESS)); + Unit* Temp = Unit::GetUnit(*me, instance->GetData64(DATA_ALYTHESS)); if (Temp) { if (Temp->isDead()) @@ -152,7 +152,7 @@ public: if (instance) { - Unit* Temp = Unit::GetUnit((*me), instance->GetData64(DATA_ALYTHESS)); + Unit* Temp = Unit::GetUnit(*me, instance->GetData64(DATA_ALYTHESS)); if (Temp && Temp->isAlive() && !(Temp->getVictim())) CAST_CRE(Temp)->AI()->AttackStart(who); } @@ -167,7 +167,7 @@ public: DoScriptText(RAND(YELL_SAC_KILL_1, YELL_SAC_KILL_2), me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { // only if ALY death if (SisterDeath) @@ -231,7 +231,7 @@ public: if (instance) { Unit* Temp = NULL; - Temp = Unit::GetUnit((*me), instance->GetData64(DATA_ALYTHESS)); + Temp = Unit::GetUnit(*me, instance->GetData64(DATA_ALYTHESS)); if (Temp && Temp->isDead()) { DoScriptText(YELL_SISTER_ALYTHESS_DEAD, me); @@ -355,9 +355,9 @@ public: struct boss_alythessAI : public Scripted_NoMovementAI { - boss_alythessAI(Creature* c) : Scripted_NoMovementAI(c) + boss_alythessAI(Creature* creature) : Scripted_NoMovementAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); IntroStepCounter = 10; } @@ -382,7 +382,7 @@ public: if (instance) { - Unit* Temp = Unit::GetUnit((*me), instance->GetData64(DATA_SACROLASH)); + Unit* Temp = Unit::GetUnit(*me, instance->GetData64(DATA_SACROLASH)); if (Temp) { if (Temp->isDead()) @@ -415,7 +415,7 @@ public: if (instance) { - Unit* Temp = Unit::GetUnit((*me), instance->GetData64(DATA_SACROLASH)); + Unit* Temp = Unit::GetUnit(*me, instance->GetData64(DATA_SACROLASH)); if (Temp && Temp->isAlive() && !(Temp->getVictim())) CAST_CRE(Temp)->AI()->AttackStart(who); } @@ -462,7 +462,7 @@ public: } } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (SisterDeath) { @@ -567,7 +567,7 @@ public: if (instance) { Unit* Temp = NULL; - Temp = Unit::GetUnit((*me), instance->GetData64(DATA_SACROLASH)); + Temp = Unit::GetUnit(*me, instance->GetData64(DATA_SACROLASH)); if (Temp && Temp->isDead()) { DoScriptText(YELL_SISTER_SACROLASH_DEAD, me); @@ -684,7 +684,7 @@ public: struct mob_shadow_imageAI : public ScriptedAI { - mob_shadow_imageAI(Creature* c) : ScriptedAI(c) {} + mob_shadow_imageAI(Creature* creature) : ScriptedAI(creature) {} uint32 ShadowfuryTimer; uint32 KillTimer; diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp index c65ce2c8f98..72ad1100752 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp @@ -115,9 +115,9 @@ public: struct boss_felmystAI : public ScriptedAI { - boss_felmystAI(Creature* c) : ScriptedAI(c) + boss_felmystAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -137,7 +137,7 @@ public: uiFlightCount = 0; - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetDisableGravity(true); me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10); me->SetFloatValue(UNIT_FIELD_COMBATREACH, 10); @@ -184,7 +184,7 @@ public: DoScriptText(YELL_BIRTH, me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(YELL_DEATH, me); @@ -254,7 +254,7 @@ public: events.ScheduleEvent(EVENT_FLIGHT, 60000); break; case PHASE_FLIGHT: - me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); + me->SetUnitMovementFlags(MOVEMENTFLAG_DISABLE_GRAVITY); events.ScheduleEvent(EVENT_FLIGHT_SEQUENCE, 1000); uiFlightCount = 0; uiBreathCount = 0; @@ -391,7 +391,7 @@ public: } break; case 10: - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetDisableGravity(false); me->HandleEmoteCommand(EMOTE_ONESHOT_LAND); EnterPhase(PHASE_GROUND); AttackStart(SelectTarget(SELECT_TARGET_TOPAGGRO)); @@ -522,7 +522,7 @@ public: struct mob_felmyst_vaporAI : public ScriptedAI { - mob_felmyst_vaporAI(Creature* c) : ScriptedAI(c) + mob_felmyst_vaporAI(Creature* creature) : ScriptedAI(creature) { me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetSpeed(MOVE_RUN, 0.8f); @@ -555,7 +555,7 @@ public: struct mob_felmyst_trailAI : public ScriptedAI { - mob_felmyst_trailAI(Creature* c) : ScriptedAI(c) + mob_felmyst_trailAI(Creature* creature) : ScriptedAI(creature) { me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); DoCast(me, SPELL_TRAIL_TRIGGER, true); diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp index d7c90732a80..f783fcc1eb5 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp @@ -115,9 +115,9 @@ public: struct boss_kalecgosAI : public ScriptedAI { - boss_kalecgosAI(Creature* c) : ScriptedAI(c) + boss_kalecgosAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); SathGUID = 0; DoorGUID = 0; bJustReset = false; @@ -159,7 +159,7 @@ public: if (!bJustReset) //first reset at create { me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetDisableGravity(false); me->SetVisible(true); me->SetStandState(UNIT_STAND_STATE_SLEEP); } @@ -231,7 +231,7 @@ public: if (ResetTimer <= diff) { me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetDisableGravity(false); me->SetVisible(true); me->SetStandState(UNIT_STAND_STATE_SLEEP); ResetTimer = 10000; @@ -400,7 +400,7 @@ public: TalkTimer = 10000; break; case 3: - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetDisableGravity(true); me->GetMotionMaster()->MovePoint(0, FLY_X, FLY_Y, FLY_Z); TalkTimer = 600000; break; @@ -418,7 +418,7 @@ public: TalkTimer = 3000; break; case 2: - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetDisableGravity(true); me->GetMotionMaster()->MovePoint(0, FLY_X, FLY_Y, FLY_Z); TalkTimer = 15000; break; @@ -456,9 +456,9 @@ public: bool isEnraged; // if demon is enraged - boss_kalecAI(Creature* c) : ScriptedAI(c) + boss_kalecAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } void Reset() @@ -575,9 +575,9 @@ public: struct boss_sathrovarrAI : public ScriptedAI { - boss_sathrovarrAI(Creature* c) : ScriptedAI(c) + boss_sathrovarrAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); KalecGUID = 0; KalecgosGUID = 0; } @@ -676,7 +676,9 @@ public: void TeleportAllPlayersBack() { Map* map = me->GetMap(); - if (!map->IsDungeon()) return; + if (!map->IsDungeon()) + return; + Map::PlayerList const &PlayerList = map->GetPlayers(); for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) { diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp index 337eea13438..8a64d45abcb 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp @@ -251,9 +251,9 @@ public: struct boss_kalecgos_kjAI : public ScriptedAI { - boss_kalecgos_kjAI(Creature* c) : ScriptedAI(c) + boss_kalecgos_kjAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -264,7 +264,7 @@ public: { OrbsEmpowered = 0; EmpowerCount = 0; - me->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING); + me->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_DISABLE_GRAVITY); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->setActive(true); @@ -406,9 +406,9 @@ public: struct mob_kiljaeden_controllerAI : public Scripted_NoMovementAI { - mob_kiljaeden_controllerAI(Creature* c) : Scripted_NoMovementAI(c), summons(me) + mob_kiljaeden_controllerAI(Creature* creature) : Scripted_NoMovementAI(creature), summons(me) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -434,8 +434,9 @@ public: { phase = PHASE_DECEIVERS; - if (Creature* pKalecKJ = Unit::GetCreature((*me), instance->GetData64(DATA_KALECGOS_KJ))) - CAST_AI(boss_kalecgos_kj::boss_kalecgos_kjAI, pKalecKJ->AI())->ResetOrbs(); + if (instance) + if (Creature* pKalecKJ = Unit::GetCreature((*me), instance->GetData64(DATA_KALECGOS_KJ))) + CAST_AI(boss_kalecgos_kj::boss_kalecgos_kjAI, pKalecKJ->AI())->ResetOrbs(); deceiverDeathCount = 0; bSummonedDeceivers = false; bKiljaedenDeath = false; @@ -451,7 +452,7 @@ public: summoned->CastSpell(summoned, SPELL_SHADOW_CHANNELING, false); break; case CREATURE_ANVEENA: - summoned->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING); + summoned->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_DISABLE_GRAVITY); summoned->CastSpell(summoned, SPELL_ANVEENA_PRISON, true); summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); break; @@ -506,9 +507,9 @@ public: struct boss_kiljaedenAI : public Scripted_NoMovementAI { - boss_kiljaedenAI(Creature* c) : Scripted_NoMovementAI(c), summons(me) + boss_kiljaedenAI(Creature* creature) : Scripted_NoMovementAI(creature), summons(me) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -660,17 +661,9 @@ public: DoScriptText(RAND(SAY_KJ_REFLECTION1, SAY_KJ_REFLECTION2), me); for (uint8 i = 0; i < 4; ++i) { - float x, y, z; - Unit* target = NULL; - for (uint8 i = 0; i < 6; ++i) - { - target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); - if (!target || !target->HasAura(SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT, 0)) - break; - } - - if (target) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true, -SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT)) { + float x, y, z; target->GetPosition(x, y, z); if (Creature* pSinisterReflection = me->SummonCreature(CREATURE_SINISTER_REFLECTION, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0)) { @@ -922,9 +915,9 @@ public: struct mob_hand_of_the_deceiverAI : public ScriptedAI { - mob_hand_of_the_deceiverAI(Creature* c) : ScriptedAI(c) + mob_hand_of_the_deceiverAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -1023,7 +1016,7 @@ public: struct mob_felfire_portalAI : public Scripted_NoMovementAI { - mob_felfire_portalAI(Creature* c) : Scripted_NoMovementAI(c) {} + mob_felfire_portalAI(Creature* creature) : Scripted_NoMovementAI(creature) {} uint32 uiSpawnFiendTimer; @@ -1068,7 +1061,7 @@ public: struct mob_volatile_felfire_fiendAI : public ScriptedAI { - mob_volatile_felfire_fiendAI(Creature* c) : ScriptedAI(c) {} + mob_volatile_felfire_fiendAI(Creature* creature) : ScriptedAI(creature) {} uint32 uiExplodeTimer; @@ -1126,7 +1119,7 @@ public: struct mob_armageddonAI : public Scripted_NoMovementAI { - mob_armageddonAI(Creature* c) : Scripted_NoMovementAI(c) {} + mob_armageddonAI(Creature* creature) : Scripted_NoMovementAI(creature) {} uint8 spell; uint32 uiTimer; @@ -1181,9 +1174,9 @@ public: struct mob_shield_orbAI : public ScriptedAI { - mob_shield_orbAI(Creature* c) : ScriptedAI(c) + mob_shield_orbAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -1196,7 +1189,7 @@ public: void Reset() { - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetDisableGravity(true); bPointReached = true; uiTimer = urand(500, 1000); uiCheckTimer = 1000; @@ -1269,7 +1262,7 @@ public: struct mob_sinster_reflectionAI : public ScriptedAI { - mob_sinster_reflectionAI(Creature* c) : ScriptedAI(c) {} + mob_sinster_reflectionAI(Creature* creature) : ScriptedAI(creature) {} uint8 victimClass; uint32 uiTimer[3]; diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp index 9b5d941589b..66030a1c78c 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp @@ -113,9 +113,9 @@ public: struct boss_entropiusAI : public ScriptedAI { - boss_entropiusAI(Creature* c) : ScriptedAI(c), Summons(me) + boss_entropiusAI(Creature* creature) : ScriptedAI(creature), Summons(me) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -213,9 +213,9 @@ public: struct boss_muruAI : public Scripted_NoMovementAI { - boss_muruAI(Creature* c) : Scripted_NoMovementAI(c), Summons(me) + boss_muruAI(Creature* creature) : Scripted_NoMovementAI(creature), Summons(me) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -378,9 +378,9 @@ public: struct npc_muru_portalAI : public Scripted_NoMovementAI { - npc_muru_portalAI(Creature* c) : Scripted_NoMovementAI(c), Summons(me) + npc_muru_portalAI(Creature* creature) : Scripted_NoMovementAI(creature), Summons(me) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -462,7 +462,7 @@ public: struct npc_dark_fiendAI : public ScriptedAI { - npc_dark_fiendAI(Creature* c) : ScriptedAI(c) {} + npc_dark_fiendAI(Creature* creature) : ScriptedAI(creature) {} uint32 WaitTimer; bool InAction; @@ -525,7 +525,7 @@ public: struct npc_void_sentinelAI : public ScriptedAI { - npc_void_sentinelAI(Creature* c) : ScriptedAI(c){} + npc_void_sentinelAI(Creature* creature) : ScriptedAI(creature){} uint32 PulseTimer; uint32 VoidBlastTimer; @@ -581,9 +581,9 @@ public: struct npc_blackholeAI : public ScriptedAI { - npc_blackholeAI(Creature* c) : ScriptedAI(c) + npc_blackholeAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp index 0872ac9adca..7a946e9d5bf 100644 --- a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp +++ b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp @@ -153,7 +153,7 @@ class boss_archaedas : public CreatureScript // wake a wall minion if (uiWallMinionTimer <= uiDiff) { - instance->SetData (DATA_MINIONS, IN_PROGRESS); + instance->SetData(DATA_MINIONS, IN_PROGRESS); uiWallMinionTimer = 10000; } else uiWallMinionTimer -= uiDiff; @@ -232,7 +232,7 @@ class mob_archaedas_minions : public CreatureScript struct mob_archaedas_minionsAI : public ScriptedAI { - mob_archaedas_minionsAI(Creature* c) : ScriptedAI(c) + mob_archaedas_minionsAI(Creature* creature) : ScriptedAI(creature) { instance = me->GetInstanceScript(); } @@ -394,7 +394,7 @@ class go_altar_of_archaedas : public GameObjectScript { } - bool OnGossipHello(Player* player, GameObject* /*pGO*/) + bool OnGossipHello(Player* player, GameObject* /*go*/) { InstanceScript* instance = player->GetInstanceScript(); if (!instance) diff --git a/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp b/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp index 60d17a7e5d2..fea64c55377 100644 --- a/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp +++ b/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp @@ -184,8 +184,8 @@ class instance_uldaman : public InstanceMapScript return; // only want the first one we find } // if we get this far than all four are dead so open the door - SetData (DATA_ALTAR_DOORS, DONE); - SetDoor (uiArchaedasTempleDoor, true); //open next the door too + SetData(DATA_ALTAR_DOORS, DONE); + SetDoor(uiArchaedasTempleDoor, true); //open next the door too } void ActivateWallMinions() @@ -320,7 +320,7 @@ class instance_uldaman : public InstanceMapScript uiIronayaSealDoorTimer -= diff; } - void SetData (uint32 type, uint32 data) + void SetData(uint32 type, uint32 data) { switch (type) { @@ -386,7 +386,7 @@ class instance_uldaman : public InstanceMapScript } } - void SetData64 (uint32 type, uint64 data) + void SetData64(uint32 type, uint64 data) { // Archaedas if (type == 0) @@ -425,7 +425,8 @@ class instance_uldaman : public InstanceMapScript void OnCreatureCreate(Creature* creature) { - switch (creature->GetEntry()) { + switch (creature->GetEntry()) + { case 4857: // Stone Keeper SetFrozenState (creature); vStoneKeeper.push_back(creature->GetGUID()); @@ -458,10 +459,10 @@ class instance_uldaman : public InstanceMapScript uiArchaedasGUID = creature->GetGUID(); break; - } // end switch - } // end OnCreatureCreate + } + } - uint64 GetData64 (uint32 identifier) + uint64 GetData64(uint32 identifier) { if (identifier == 0) return uiWhoWokeuiArchaedasGUID; if (identifier == 1) return vVaultWalker[0]; // VaultWalker1 diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp index eee6b08d834..a715dbfce9d 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp @@ -72,9 +72,9 @@ class boss_akilzon : public CreatureScript struct boss_akilzonAI : public ScriptedAI { - boss_akilzonAI(Creature* c) : ScriptedAI(c) + boss_akilzonAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -131,7 +131,7 @@ class boss_akilzon : public CreatureScript instance->SetData(DATA_AKILZONEVENT, IN_PROGRESS); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { me->MonsterYell(SAY_ONDEATH, LANG_UNIVERSAL, 0); DoPlaySoundToSet(me, SOUND_ONDEATH); @@ -209,9 +209,7 @@ class boss_akilzon : public CreatureScript for (std::list::const_iterator i = tempUnitMap.begin(); i != tempUnitMap.end(); ++i) { if (!Cloud->IsWithinDist(*i, 6, false)) - { Cloud->CastCustomSpell(*i, 43137, &bp0, NULL, NULL, true, 0, 0, me->GetGUID()); - } } // visual float x, y, z; @@ -311,7 +309,8 @@ class boss_akilzon : public CreatureScript isRaining = true; } - if (ElectricalStorm_Timer <= diff) { + if (ElectricalStorm_Timer <= diff) + { Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50, true); if (!target) { @@ -324,16 +323,16 @@ class boss_akilzon : public CreatureScript target->GetPosition(x, y, z); if (target) { - target->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); + target->SetUnitMovementFlags(MOVEMENTFLAG_DISABLE_GRAVITY); target->MonsterMoveWithSpeed(x, y, me->GetPositionZ()+15, 0); } Unit* Cloud = me->SummonTrigger(x, y, me->GetPositionZ()+16, 0, 15000); if (Cloud) { CloudGUID = Cloud->GetGUID(); - Cloud->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); + Cloud->SetUnitMovementFlags(MOVEMENTFLAG_DISABLE_GRAVITY); Cloud->StopMoving(); - Cloud->SetFloatValue(OBJECT_FIELD_SCALE_X, 1.0f); + Cloud->SetObjectScale(1.0f); Cloud->setFaction(35); Cloud->SetMaxHealth(9999999); Cloud->SetHealth(9999999); @@ -390,15 +389,11 @@ class boss_akilzon : public CreatureScript class mob_akilzon_eagle : public CreatureScript { public: - - mob_akilzon_eagle() - : CreatureScript("mob_akilzon_eagle") - { - } + mob_akilzon_eagle() : CreatureScript("mob_akilzon_eagle") { } struct mob_akilzon_eagleAI : public ScriptedAI { - mob_akilzon_eagleAI(Creature* c) : ScriptedAI(c) {} + mob_akilzon_eagleAI(Creature* creature) : ScriptedAI(creature) { } uint32 EagleSwoop_Timer; bool arrived; @@ -409,10 +404,13 @@ class mob_akilzon_eagle : public CreatureScript EagleSwoop_Timer = urand(5000, 10000); arrived = true; TargetGUID = 0; - me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); + me->SetUnitMovementFlags(MOVEMENTFLAG_DISABLE_GRAVITY); } - void EnterCombat(Unit* /*who*/) {DoZoneInCombat();} + void EnterCombat(Unit* /*who*/) + { + DoZoneInCombat(); + } void MoveInLineOfSight(Unit* /*who*/) {} diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp index db0e201298c..3baa6ebdf62 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp @@ -83,9 +83,9 @@ class boss_halazzi : public CreatureScript struct boss_halazziAI : public ScriptedAI { - boss_halazziAI(Creature* c) : ScriptedAI(c) + boss_halazziAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -324,7 +324,7 @@ class boss_halazzi : public CreatureScript } } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(DATA_HALAZZIEVENT, DONE); @@ -352,7 +352,7 @@ class mob_halazzi_lynx : public CreatureScript struct mob_halazzi_lynxAI : public ScriptedAI { - mob_halazzi_lynxAI(Creature* c) : ScriptedAI(c) {} + mob_halazzi_lynxAI(Creature* creature) : ScriptedAI(creature) {} uint32 FrenzyTimer; uint32 shredder_timer; diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp index 5efd4af55ea..b5698d851f8 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp @@ -179,14 +179,17 @@ struct boss_hexlord_addAI : public ScriptedAI { InstanceScript* instance; - boss_hexlord_addAI(Creature* c) : ScriptedAI(c) + boss_hexlord_addAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } void Reset() {} - void EnterCombat(Unit* /*who*/) {DoZoneInCombat();} + void EnterCombat(Unit* /*who*/) + { + DoZoneInCombat(); + } void UpdateAI(const uint32 /*diff*/) { @@ -211,9 +214,9 @@ class boss_hexlord_malacrass : public CreatureScript struct boss_hex_lord_malacrassAI : public ScriptedAI { - boss_hex_lord_malacrassAI(Creature* c) : ScriptedAI(c) + boss_hex_lord_malacrassAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); SelectAddEntry(); for (uint8 i = 0; i < 4; ++i) AddGUID[i] = 0; @@ -264,7 +267,7 @@ class boss_hexlord_malacrass : public CreatureScript for (uint8 i = 0; i < 4; ++i) { - Unit* Temp = Unit::GetUnit((*me), AddGUID[i]); + Unit* Temp = Unit::GetUnit(*me, AddGUID[i]); if (Temp && Temp->isAlive()) CAST_CRE(Temp)->AI()->AttackStart(me->getVictim()); else @@ -290,7 +293,7 @@ class boss_hexlord_malacrass : public CreatureScript } } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(DATA_HEXLORDEVENT, DONE); @@ -298,9 +301,9 @@ class boss_hexlord_malacrass : public CreatureScript me->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, 0); DoPlaySoundToSet(me, SOUND_YELL_DEATH); - for (uint8 i = 0; i < 4 ; ++i) + for (uint8 i = 0; i < 4; ++i) { - Unit* Temp = Unit::GetUnit((*me), AddGUID[i]); + Unit* Temp = Unit::GetUnit(*me, AddGUID[i]); if (Temp && Temp->isAlive()) Temp->DealDamage(Temp, Temp->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); } @@ -488,7 +491,7 @@ class boss_thurg : public CreatureScript struct boss_thurgAI : public boss_hexlord_addAI { - boss_thurgAI(Creature* c) : boss_hexlord_addAI(c) {} + boss_thurgAI(Creature* creature) : boss_hexlord_addAI(creature) {} uint32 bloodlust_timer; uint32 cleave_timer; @@ -548,7 +551,7 @@ class boss_alyson_antille : public CreatureScript struct boss_alyson_antilleAI : public boss_hexlord_addAI { //Holy Priest - boss_alyson_antilleAI(Creature* c) : boss_hexlord_addAI(c) {} + boss_alyson_antilleAI(Creature* creature) : boss_hexlord_addAI(creature) {} uint32 flashheal_timer; uint32 dispelmagic_timer; @@ -637,7 +640,7 @@ class boss_alyson_antille : public CreatureScript struct boss_gazakrothAI : public boss_hexlord_addAI { - boss_gazakrothAI(Creature* c) : boss_hexlord_addAI(c) {} + boss_gazakrothAI(Creature* creature) : boss_hexlord_addAI(creature) {} uint32 firebolt_timer; @@ -691,7 +694,7 @@ class boss_lord_raadan : public CreatureScript struct boss_lord_raadanAI : public boss_hexlord_addAI { - boss_lord_raadanAI(Creature* c) : boss_hexlord_addAI(c) {} + boss_lord_raadanAI(Creature* creature) : boss_hexlord_addAI(creature) {} uint32 flamebreath_timer; uint32 thunderclap_timer; @@ -744,7 +747,7 @@ class boss_darkheart : public CreatureScript struct boss_darkheartAI : public boss_hexlord_addAI { - boss_darkheartAI(Creature* c) : boss_hexlord_addAI(c) {} + boss_darkheartAI(Creature* creature) : boss_hexlord_addAI(creature) {} uint32 psychicwail_timer; @@ -787,7 +790,7 @@ class boss_slither : public CreatureScript struct boss_slitherAI : public boss_hexlord_addAI { - boss_slitherAI(Creature* c) : boss_hexlord_addAI(c) {} + boss_slitherAI(Creature* creature) : boss_hexlord_addAI(creature) {} uint32 venomspit_timer; @@ -847,7 +850,7 @@ class boss_fenstalker : public CreatureScript struct boss_fenstalkerAI : public boss_hexlord_addAI { - boss_fenstalkerAI(Creature* c) : boss_hexlord_addAI(c) {} + boss_fenstalkerAI(Creature* creature) : boss_hexlord_addAI(creature) {} uint32 volatileinf_timer; @@ -894,7 +897,7 @@ class boss_koragg : public CreatureScript struct boss_koraggAI : public boss_hexlord_addAI { - boss_koraggAI(Creature* c) : boss_hexlord_addAI(c) {} + boss_koraggAI(Creature* creature) : boss_hexlord_addAI(creature) {} uint32 coldstare_timer; uint32 mightyblow_timer; diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp index 21245209e45..a2125c45689 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp @@ -113,9 +113,9 @@ class boss_janalai : public CreatureScript struct boss_janalaiAI : public ScriptedAI { - boss_janalaiAI(Creature* c) : ScriptedAI(c) + boss_janalaiAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -159,7 +159,7 @@ class boss_janalai : public CreatureScript HatchAllEggs(1); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); @@ -221,12 +221,13 @@ class boss_janalai : public CreatureScript dy = float(irand(-area_dy/2, area_dy/2)); Creature* bomb = DoSpawnCreature(MOB_FIRE_BOMB, dx, dy, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 15000); - if (bomb) FireBombGUIDs[i] = bomb->GetGUID(); + if (bomb) + FireBombGUIDs[i] = bomb->GetGUID(); } BombCount = 0; } - bool HatchAllEggs(uint32 uiAction) //1: reset, 2: isHatching all + bool HatchAllEggs(uint32 action) //1: reset, 2: isHatching all { std::list templist; float x, y, z; @@ -251,9 +252,9 @@ class boss_janalai : public CreatureScript for (std::list::const_iterator i = templist.begin(); i != templist.end(); ++i) { - if (uiAction == 1) + if (action == 1) (*i)->SetDisplayId(10056); - else if (uiAction == 2 &&(*i)->GetDisplayId() != 11686) + else if (action == 2 &&(*i)->GetDisplayId() != 11686) (*i)->CastSpell(*i, SPELL_HATCH_EGG, false); } return true; @@ -288,7 +289,7 @@ class boss_janalai : public CreatureScript { if (BombCount < 40) { - if (Unit* FireBomb = Unit::GetUnit((*me), FireBombGUIDs[BombCount])) + if (Unit* FireBomb = Unit::GetUnit(*me, FireBombGUIDs[BombCount])) { FireBomb->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); DoCast(FireBomb, SPELL_FIRE_BOMB_THROW, true); @@ -374,7 +375,9 @@ class boss_janalai : public CreatureScript //Teleport every Player into the middle Map* map = me->GetMap(); - if (!map->IsDungeon()) return; + if (!map->IsDungeon()) + return; + Map::PlayerList const &PlayerList = map->GetPlayers(); for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) if (Player* i_pl = i->getSource()) @@ -448,7 +451,7 @@ class mob_janalai_firebomb : public CreatureScript struct mob_janalai_firebombAI : public ScriptedAI { - mob_janalai_firebombAI(Creature* c) : ScriptedAI(c){} + mob_janalai_firebombAI(Creature* creature) : ScriptedAI(creature){} void Reset() {} @@ -484,9 +487,9 @@ class mob_janalai_hatcher : public CreatureScript struct mob_janalai_hatcherAI : public ScriptedAI { - mob_janalai_hatcherAI(Creature* c) : ScriptedAI(c) + mob_janalai_hatcherAI(Creature* creature) : ScriptedAI(creature) { - instance =c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -501,7 +504,7 @@ class mob_janalai_hatcher : public CreatureScript void Reset() { - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); side =(me->GetPositionY() < 1150); waypoint = 0; isHatching = false; @@ -616,9 +619,9 @@ class mob_janalai_hatchling : public CreatureScript struct mob_janalai_hatchlingAI : public ScriptedAI { - mob_janalai_hatchlingAI(Creature* c) : ScriptedAI(c) + mob_janalai_hatchlingAI(Creature* creature) : ScriptedAI(creature) { - instance =c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -632,7 +635,7 @@ class mob_janalai_hatchling : public CreatureScript else me->GetMotionMaster()->MovePoint(0, hatcherway[1][3][0]+rand()%4-2, 1150.0f+rand()%4-2, hatcherway[1][3][2]); - me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); + me->SetUnitMovementFlags(MOVEMENTFLAG_DISABLE_GRAVITY); } void EnterCombat(Unit* /*who*/) {/*DoZoneInCombat();*/} diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp index 954f232f786..48a406f22a4 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp @@ -101,11 +101,11 @@ class boss_nalorakk : public CreatureScript struct boss_nalorakkAI : public ScriptedAI { - boss_nalorakkAI(Creature* c) : ScriptedAI(c) + boss_nalorakkAI(Creature* creature) : ScriptedAI(creature) { MoveEvent = true; MovePhase = 0; - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -136,7 +136,7 @@ class boss_nalorakk : public CreatureScript inMove = false; waitTimer = 0; me->SetSpeed(MOVE_RUN, 2); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); }else { (*me).GetMotionMaster()->MovePoint(0, NalorakkWay[7][0], NalorakkWay[7][1], NalorakkWay[7][2]); @@ -276,7 +276,7 @@ class boss_nalorakk : public CreatureScript DoZoneInCombat(); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(DATA_NALORAKKEVENT, DONE); diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp index b5130630d05..2df202af088 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp @@ -151,9 +151,9 @@ class boss_zuljin : public CreatureScript struct boss_zuljinAI : public ScriptedAI { - boss_zuljinAI(Creature* c) : ScriptedAI(c), Summons(me) + boss_zuljinAI(Creature* creature) : ScriptedAI(creature), Summons(me) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -252,7 +252,7 @@ class boss_zuljin : public CreatureScript } } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(DATA_ZULJINEVENT, DONE); @@ -604,7 +604,7 @@ class mob_zuljin_vortex : public CreatureScript struct mob_zuljin_vortexAI : public ScriptedAI { - mob_zuljin_vortexAI(Creature* c) : ScriptedAI(c) {} + mob_zuljin_vortexAI(Creature* creature) : ScriptedAI(creature) {} void Reset() {} diff --git a/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp index ac1554bd00e..884fe109785 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp @@ -109,7 +109,8 @@ class instance_zulaman : public InstanceMapScript bool IsEncounterInProgress() const { for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; + if (m_auiEncounter[i] == IN_PROGRESS) + return true; return false; } @@ -188,7 +189,9 @@ class instance_zulaman : public InstanceMapScript void Load(const char* load) { - if (!load) return; + if (!load) + return; + std::istringstream ss(load); //sLog->outError("TSCR: Zul'aman loaded, %s.", ss.str().c_str()); char dataHead; // S diff --git a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp index bf951dd186c..bfb22483b09 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp @@ -49,9 +49,9 @@ class npc_forest_frog : public CreatureScript struct npc_forest_frogAI : public ScriptedAI { - npc_forest_frogAI(Creature* c) : ScriptedAI(c) + npc_forest_frogAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -120,24 +120,29 @@ static uint32 ChestEntry[] = {186648, 187021, 186672, 186667}; class npc_zulaman_hostage : public CreatureScript { public: - - npc_zulaman_hostage() - : CreatureScript("npc_zulaman_hostage") - { - } + npc_zulaman_hostage() : CreatureScript("npc_zulaman_hostage") { } struct npc_zulaman_hostageAI : public ScriptedAI { - npc_zulaman_hostageAI(Creature* c) : ScriptedAI(c) {IsLoot = false;} + npc_zulaman_hostageAI(Creature* creature) : ScriptedAI(creature) + { + IsLoot = false; + } + bool IsLoot; uint64 PlayerGUID; + void Reset() {} + void EnterCombat(Unit* /*who*/) {} - void JustDied(Unit* /*who*/) + + void JustDied(Unit* /*killer*/) { Player* player = Unit::GetPlayer(*me, PlayerGUID); - if (player) player->SendLoot(me->GetGUID(), LOOT_CORPSE); + if (player) + player->SendLoot(me->GetGUID(), LOOT_CORPSE); } + void UpdateAI(const uint32 /*diff*/) { if (IsLoot) @@ -157,14 +162,16 @@ class npc_zulaman_hostage : public CreatureScript return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + + if (action == GOSSIP_ACTION_INFO_DEF + 1) player->CLOSE_GOSSIP_MENU(); if (!creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) return true; + creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); InstanceScript* instance = creature->GetInstanceScript(); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp index 27ddc215543..4ba0c187973 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp @@ -61,10 +61,10 @@ class boss_arlokk : public CreatureScript { boss_arlokkAI(Creature* creature) : ScriptedAI(creature) { - m_instance = creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; uint32 m_uiShadowWordPain_Timer; uint32 m_uiGouge_Timer; @@ -110,8 +110,8 @@ class boss_arlokk : public CreatureScript void JustReachedHome() { - if (m_instance) - m_instance->SetData(DATA_ARLOKK, NOT_STARTED); + if (instance) + instance->SetData(DATA_ARLOKK, NOT_STARTED); //we should be summoned, so despawn me->DespawnOrUnsummon(); @@ -124,8 +124,8 @@ class boss_arlokk : public CreatureScript me->SetDisplayId(MODEL_ID_NORMAL); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - if (m_instance) - m_instance->SetData(DATA_ARLOKK, DONE); + if (instance) + instance->SetData(DATA_ARLOKK, DONE); } void DoSummonPhanters() @@ -237,7 +237,7 @@ class boss_arlokk : public CreatureScript me->SetDisplayId(MODEL_ID_PANTHER); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - const CreatureTemplate* cinfo = me->GetCreatureInfo(); + const CreatureTemplate* cinfo = me->GetCreatureTemplate(); me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35))); me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35))); me->UpdateDamagePhysical(BASE_ATTACK); @@ -271,12 +271,12 @@ class go_gong_of_bethekk : public GameObjectScript bool OnGossipHello(Player* /*player*/, GameObject* go) { - if (InstanceScript* m_instance = go->GetInstanceScript()) + if (InstanceScript* instance = go->GetInstanceScript()) { - if (m_instance->GetData(DATA_ARLOKK) == DONE || m_instance->GetData(DATA_ARLOKK) == IN_PROGRESS) + if (instance->GetData(DATA_ARLOKK) == DONE || instance->GetData(DATA_ARLOKK) == IN_PROGRESS) return true; - m_instance->SetData(DATA_ARLOKK, IN_PROGRESS); + instance->SetData(DATA_ARLOKK, IN_PROGRESS); return true; } diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp index a944a857f74..ce2fd0848f9 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp @@ -32,15 +32,11 @@ EndScriptData */ class boss_gahzranka : public CreatureScript { public: - - boss_gahzranka() - : CreatureScript("boss_gahzranka") - { - } + boss_gahzranka() : CreatureScript("boss_gahzranka") { } struct boss_gahzrankaAI : public ScriptedAI { - boss_gahzrankaAI(Creature* c) : ScriptedAI(c) {} + boss_gahzrankaAI(Creature* creature) : ScriptedAI(creature) { } uint32 Frostbreath_Timer; uint32 MassiveGeyser_Timer; uint32 Slam_Timer; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp index 68ae6dbbf0c..cdd45a3fa0d 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp @@ -32,15 +32,11 @@ EndScriptData */ class boss_grilek : public CreatureScript { public: - - boss_grilek() - : CreatureScript("boss_grilek") - { - } + boss_grilek() : CreatureScript("boss_grilek") { } struct boss_grilekAI : public ScriptedAI { - boss_grilekAI(Creature* c) : ScriptedAI(c) {} + boss_grilekAI(Creature* creature) : ScriptedAI(creature) { } uint32 Avartar_Timer; uint32 GroundTremor_Timer; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp index 6a1309983c3..9edd82c39b0 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp @@ -55,12 +55,12 @@ class boss_hakkar : public CreatureScript struct boss_hakkarAI : public ScriptedAI { - boss_hakkarAI(Creature* c) : ScriptedAI(c) + boss_hakkarAI(Creature* creature) : ScriptedAI(creature) { - m_instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; uint32 BloodSiphon_Timer; uint32 CorruptedBlood_Timer; @@ -156,9 +156,9 @@ class boss_hakkar : public CreatureScript //Checking if Jeklik is dead. If not we cast her Aspect if (CheckJeklik_Timer <= diff) { - if (m_instance) + if (instance) { - if (m_instance->GetData(DATA_JEKLIK) != DONE) + if (instance->GetData(DATA_JEKLIK) != DONE) { if (AspectOfJeklik_Timer <= diff) { @@ -173,9 +173,9 @@ class boss_hakkar : public CreatureScript //Checking if Venoxis is dead. If not we cast his Aspect if (CheckVenoxis_Timer <= diff) { - if (m_instance) + if (instance) { - if (m_instance->GetData(DATA_VENOXIS) != DONE) + if (instance->GetData(DATA_VENOXIS) != DONE) { if (AspectOfVenoxis_Timer <= diff) { @@ -190,9 +190,9 @@ class boss_hakkar : public CreatureScript //Checking if Marli is dead. If not we cast her Aspect if (CheckMarli_Timer <= diff) { - if (m_instance) + if (instance) { - if (m_instance->GetData(DATA_MARLI) != DONE) + if (instance->GetData(DATA_MARLI) != DONE) { if (AspectOfMarli_Timer <= diff) { @@ -208,9 +208,9 @@ class boss_hakkar : public CreatureScript //Checking if Thekal is dead. If not we cast his Aspect if (CheckThekal_Timer <= diff) { - if (m_instance) + if (instance) { - if (m_instance->GetData(DATA_THEKAL) != DONE) + if (instance->GetData(DATA_THEKAL) != DONE) { if (AspectOfThekal_Timer <= diff) { @@ -225,9 +225,9 @@ class boss_hakkar : public CreatureScript //Checking if Arlokk is dead. If yes we cast her Aspect if (CheckArlokk_Timer <= diff) { - if (m_instance) + if (instance) { - if (m_instance->GetData(DATA_ARLOKK) != DONE) + if (instance->GetData(DATA_ARLOKK) != DONE) { if (AspectOfArlokk_Timer <= diff) { diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp index 69a4f5dbab5..27c46b8e0f2 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp @@ -40,7 +40,7 @@ class boss_hazzarah : public CreatureScript struct boss_hazzarahAI : public ScriptedAI { - boss_hazzarahAI(Creature* c) : ScriptedAI(c) {} + boss_hazzarahAI(Creature* creature) : ScriptedAI(creature) {} uint32 ManaBurn_Timer; uint32 Sleep_Timer; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp index d2ac4f3bceb..7d2215f8311 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp @@ -54,12 +54,12 @@ class boss_jeklik : public CreatureScript struct boss_jeklikAI : public ScriptedAI { - boss_jeklikAI(Creature* c) : ScriptedAI(c) + boss_jeklikAI(Creature* creature) : ScriptedAI(creature) { - m_instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; uint32 Charge_Timer; uint32 SonicBurst_Timer; @@ -94,12 +94,12 @@ class boss_jeklik : public CreatureScript DoCast(me, SPELL_BAT_FORM); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); - if (m_instance) - m_instance->SetData(DATA_JEKLIK, DONE); + if (instance) + instance->SetData(DATA_JEKLIK, DONE); } void UpdateAI(const uint32 diff) @@ -236,12 +236,12 @@ class mob_batrider : public CreatureScript struct mob_batriderAI : public ScriptedAI { - mob_batriderAI(Creature* c) : ScriptedAI(c) + mob_batriderAI(Creature* creature) : ScriptedAI(creature) { - m_instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; uint32 Bomb_Timer; uint32 Check_Timer; @@ -274,9 +274,9 @@ class mob_batrider : public CreatureScript //Check_Timer if (Check_Timer <= diff) { - if (m_instance) + if (instance) { - if (m_instance->GetData(DATA_JEKLIK) == DONE) + if (instance->GetData(DATA_JEKLIK) == DONE) { me->setDeathState(JUST_DIED); me->RemoveCorpse(); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp index 132812c932a..f4a17da56fb 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp @@ -52,7 +52,7 @@ class boss_jindo : public CreatureScript struct boss_jindoAI : public ScriptedAI { - boss_jindoAI(Creature* c) : ScriptedAI(c) {} + boss_jindoAI(Creature* creature) : ScriptedAI(creature) {} uint32 BrainWashTotem_Timer; uint32 HealingWard_Timer; @@ -187,9 +187,9 @@ class mob_healing_ward : public CreatureScript struct mob_healing_wardAI : public ScriptedAI { - mob_healing_wardAI(Creature* c) : ScriptedAI(c) + mob_healing_wardAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 Heal_Timer; @@ -212,7 +212,7 @@ class mob_healing_ward : public CreatureScript { if (instance) { - Unit* pJindo = Unit::GetUnit((*me), instance->GetData64(DATA_JINDO)); + Unit* pJindo = Unit::GetUnit(*me, instance->GetData64(DATA_JINDO)); if (pJindo) DoCast(pJindo, SPELL_HEAL); } @@ -241,7 +241,7 @@ class mob_shade_of_jindo : public CreatureScript struct mob_shade_of_jindoAI : public ScriptedAI { - mob_shade_of_jindoAI(Creature* c) : ScriptedAI(c) {} + mob_shade_of_jindoAI(Creature* creature) : ScriptedAI(creature) {} uint32 ShadowShock_Timer; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp index 10708cd7f95..cbe1178e6c4 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp @@ -55,9 +55,9 @@ class boss_mandokir : public CreatureScript struct boss_mandokirAI : public ScriptedAI { - boss_mandokirAI(Creature* c) : ScriptedAI(c) + boss_mandokirAI(Creature* creature) : ScriptedAI(creature) { - m_instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 KillCount; @@ -72,7 +72,7 @@ class boss_mandokir : public CreatureScript float targetY; float targetZ; - InstanceScript* m_instance; + InstanceScript* instance; bool endWatch; bool someWatched; @@ -116,9 +116,9 @@ class boss_mandokir : public CreatureScript { DoScriptText(SAY_DING_KILL, me); - if (m_instance) + if (instance) { - uint64 JindoGUID = m_instance->GetData64(DATA_JINDO); + uint64 JindoGUID = instance->GetData64(DATA_JINDO); if (JindoGUID) { if (Unit* jTemp = Unit::GetUnit(*me, JindoGUID)) @@ -256,9 +256,9 @@ class boss_mandokir : public CreatureScript //Checking if Ohgan is dead. If yes Mandokir will enrage. if (Check_Timer <= diff) { - if (m_instance) + if (instance) { - if (m_instance->GetData(DATA_OHGAN) == DONE) + if (instance->GetData(DATA_OHGAN) == DONE) { if (!RaptorDead) { @@ -294,13 +294,13 @@ class mob_ohgan : public CreatureScript struct mob_ohganAI : public ScriptedAI { - mob_ohganAI(Creature* c) : ScriptedAI(c) + mob_ohganAI(Creature* creature) : ScriptedAI(creature) { - m_instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 SunderArmor_Timer; - InstanceScript* m_instance; + InstanceScript* instance; void Reset() { @@ -309,10 +309,10 @@ class mob_ohgan : public CreatureScript void EnterCombat(Unit* /*who*/) {} - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { - if (m_instance) - m_instance->SetData(DATA_OHGAN, DONE); + if (instance) + instance->SetData(DATA_OHGAN, DONE); } void UpdateAI (const uint32 diff) diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp index 38d9be78f2a..44ab5d851f5 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp @@ -51,12 +51,12 @@ class boss_marli : public CreatureScript struct boss_marliAI : public ScriptedAI { - boss_marliAI(Creature* c) : ScriptedAI(c) + boss_marliAI(Creature* creature) : ScriptedAI(creature) { - m_instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; uint32 SpawnStartSpiders_Timer; uint32 PoisonVolley_Timer; @@ -88,11 +88,11 @@ class boss_marli : public CreatureScript DoScriptText(SAY_AGGRO, me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); - if (m_instance) - m_instance->SetData(DATA_MARLI, DONE); + if (instance) + instance->SetData(DATA_MARLI, DONE); } void UpdateAI(const uint32 diff) @@ -156,7 +156,7 @@ class boss_marli : public CreatureScript { DoScriptText(SAY_TRANSFORM, me); DoCast(me, SPELL_SPIDER_FORM); - const CreatureTemplate* cinfo = me->GetCreatureInfo(); + const CreatureTemplate* cinfo = me->GetCreatureTemplate(); me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35))); me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35))); me->UpdateDamagePhysical(BASE_ATTACK); @@ -196,7 +196,7 @@ class boss_marli : public CreatureScript if (TransformBack_Timer <= diff) { me->SetDisplayId(15220); - const CreatureTemplate* cinfo = me->GetCreatureInfo(); + const CreatureTemplate* cinfo = me->GetCreatureTemplate(); me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 1))); me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 1))); me->UpdateDamagePhysical(BASE_ATTACK); @@ -230,7 +230,7 @@ class mob_spawn_of_marli : public CreatureScript struct mob_spawn_of_marliAI : public ScriptedAI { - mob_spawn_of_marliAI(Creature* c) : ScriptedAI(c) {} + mob_spawn_of_marliAI(Creature* creature) : ScriptedAI(creature) {} uint32 LevelUp_Timer; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp index f988d0df77a..81260c28d73 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp @@ -42,7 +42,7 @@ class boss_renataki : public CreatureScript struct boss_renatakiAI : public ScriptedAI { - boss_renatakiAI(Creature* c) : ScriptedAI(c) {} + boss_renatakiAI(Creature* creature) : ScriptedAI(creature) {} uint32 Invisible_Timer; uint32 Ambush_Timer; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp index 4185ba2f3e7..3da74d16dc3 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp @@ -66,9 +66,9 @@ class boss_thekal : public CreatureScript struct boss_thekalAI : public ScriptedAI { - boss_thekalAI(Creature* c) : ScriptedAI(c) + boss_thekalAI(Creature* creature) : ScriptedAI(creature) { - m_instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 MortalCleave_Timer; @@ -81,7 +81,7 @@ class boss_thekal : public CreatureScript uint32 Check_Timer; uint32 Resurrect_Timer; - InstanceScript* m_instance; + InstanceScript* instance; bool Enraged; bool PhaseTwo; bool WasDead; @@ -108,17 +108,17 @@ class boss_thekal : public CreatureScript DoScriptText(SAY_AGGRO, me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); - if (m_instance) - m_instance->SetData(DATA_THEKAL, DONE); + if (instance) + instance->SetData(DATA_THEKAL, DONE); } void JustReachedHome() { - if (m_instance) - m_instance->SetData(DATA_THEKAL, NOT_STARTED); + if (instance) + instance->SetData(DATA_THEKAL, NOT_STARTED); } void UpdateAI(const uint32 diff) @@ -129,26 +129,26 @@ class boss_thekal : public CreatureScript //Check_Timer for the death of LorKhan and Zath. if (!WasDead && Check_Timer <= diff) { - if (m_instance) + if (instance) { - if (m_instance->GetData(DATA_LORKHAN) == SPECIAL) + if (instance->GetData(DATA_LORKHAN) == SPECIAL) { //Resurrect LorKhan - if (Unit* pLorKhan = Unit::GetUnit((*me), m_instance->GetData64(DATA_LORKHAN))) + if (Unit* pLorKhan = Unit::GetUnit(*me, instance->GetData64(DATA_LORKHAN))) { pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); pLorKhan->setFaction(14); pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); pLorKhan->SetFullHealth(); - m_instance->SetData(DATA_LORKHAN, DONE); + instance->SetData(DATA_LORKHAN, DONE); } } - if (m_instance->GetData(DATA_ZATH) == SPECIAL) + if (instance->GetData(DATA_ZATH) == SPECIAL) { //Resurrect Zath - Unit* pZath = Unit::GetUnit((*me), m_instance->GetData64(DATA_ZATH)); + Unit* pZath = Unit::GetUnit(*me, instance->GetData64(DATA_ZATH)); if (pZath) { pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); @@ -156,7 +156,7 @@ class boss_thekal : public CreatureScript pZath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); pZath->SetFullHealth(); - m_instance->SetData(DATA_ZATH, DONE); + instance->SetData(DATA_ZATH, DONE); } } } @@ -185,8 +185,8 @@ class boss_thekal : public CreatureScript me->SetStandState(UNIT_STAND_STATE_SLEEP); me->AttackStop(); - if (m_instance) - m_instance->SetData(DATA_THEKAL, SPECIAL); + if (instance) + instance->SetData(DATA_THEKAL, SPECIAL); WasDead=true; } @@ -197,11 +197,11 @@ class boss_thekal : public CreatureScript if (Resurrect_Timer <= diff) { DoCast(me, SPELL_TIGER_FORM); - me->SetFloatValue(OBJECT_FIELD_SCALE_X, 2.00f); + me->SetObjectScale(2.00f); me->SetStandState(UNIT_STAND_STATE_STAND); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetFullHealth(); - const CreatureTemplate* cinfo = me->GetCreatureInfo(); + const CreatureTemplate* cinfo = me->GetCreatureTemplate(); me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 40))); me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 40))); me->UpdateDamagePhysical(BASE_ATTACK); @@ -277,9 +277,9 @@ class mob_zealot_lorkhan : public CreatureScript struct mob_zealot_lorkhanAI : public ScriptedAI { - mob_zealot_lorkhanAI(Creature* c) : ScriptedAI(c) + mob_zealot_lorkhanAI(Creature* creature) : ScriptedAI(creature) { - m_instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 Shield_Timer; @@ -290,7 +290,7 @@ class mob_zealot_lorkhan : public CreatureScript bool FakeDeath; - InstanceScript* m_instance; + InstanceScript* instance; void Reset() { @@ -302,8 +302,8 @@ class mob_zealot_lorkhan : public CreatureScript FakeDeath = false; - if (m_instance) - m_instance->SetData(DATA_LORKHAN, NOT_STARTED); + if (instance) + instance->SetData(DATA_LORKHAN, NOT_STARTED); me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -335,10 +335,10 @@ class mob_zealot_lorkhan : public CreatureScript //Casting Greaterheal to Thekal or Zath if they are in meele range. if (GreaterHeal_Timer <= diff) { - if (m_instance) + if (instance) { - Unit* pThekal = Unit::GetUnit((*me), m_instance->GetData64(DATA_THEKAL)); - Unit* pZath = Unit::GetUnit((*me), m_instance->GetData64(DATA_ZATH)); + Unit* pThekal = Unit::GetUnit(*me, instance->GetData64(DATA_THEKAL)); + Unit* pZath = Unit::GetUnit(*me, instance->GetData64(DATA_ZATH)); if (!pThekal || !pZath) return; @@ -369,12 +369,12 @@ class mob_zealot_lorkhan : public CreatureScript //Check_Timer for the death of LorKhan and Zath. if (!FakeDeath && Check_Timer <= diff) { - if (m_instance) + if (instance) { - if (m_instance->GetData(DATA_THEKAL) == SPECIAL) + if (instance->GetData(DATA_THEKAL) == SPECIAL) { //Resurrect Thekal - if (Unit* pThekal = Unit::GetUnit((*me), m_instance->GetData64(DATA_THEKAL))) + if (Unit* pThekal = Unit::GetUnit(*me, instance->GetData64(DATA_THEKAL))) { pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -383,10 +383,10 @@ class mob_zealot_lorkhan : public CreatureScript } } - if (m_instance->GetData(DATA_ZATH) == SPECIAL) + if (instance->GetData(DATA_ZATH) == SPECIAL) { //Resurrect Zath - if (Unit* pZath = Unit::GetUnit((*me), m_instance->GetData64(DATA_ZATH))) + if (Unit* pZath = Unit::GetUnit(*me, instance->GetData64(DATA_ZATH))) { pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); pZath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -409,8 +409,8 @@ class mob_zealot_lorkhan : public CreatureScript me->setFaction(35); me->AttackStop(); - if (m_instance) - m_instance->SetData(DATA_LORKHAN, SPECIAL); + if (instance) + instance->SetData(DATA_LORKHAN, SPECIAL); FakeDeath = true; } @@ -437,9 +437,9 @@ class mob_zealot_zath : public CreatureScript struct mob_zealot_zathAI : public ScriptedAI { - mob_zealot_zathAI(Creature* c) : ScriptedAI(c) + mob_zealot_zathAI(Creature* creature) : ScriptedAI(creature) { - m_instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 SweepingStrikes_Timer; @@ -451,7 +451,7 @@ class mob_zealot_zath : public CreatureScript bool FakeDeath; - InstanceScript* m_instance; + InstanceScript* instance; void Reset() { @@ -464,8 +464,8 @@ class mob_zealot_zath : public CreatureScript FakeDeath = false; - if (m_instance) - m_instance->SetData(DATA_ZATH, NOT_STARTED); + if (instance) + instance->SetData(DATA_ZATH, NOT_STARTED); me->SetStandState(UNIT_STAND_STATE_STAND); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -522,12 +522,12 @@ class mob_zealot_zath : public CreatureScript //Check_Timer for the death of LorKhan and Zath. if (!FakeDeath && Check_Timer <= diff) { - if (m_instance) + if (instance) { - if (m_instance->GetData(DATA_LORKHAN) == SPECIAL) + if (instance->GetData(DATA_LORKHAN) == SPECIAL) { //Resurrect LorKhan - if (Unit* pLorKhan = Unit::GetUnit((*me), m_instance->GetData64(DATA_LORKHAN))) + if (Unit* pLorKhan = Unit::GetUnit(*me, instance->GetData64(DATA_LORKHAN))) { pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -536,10 +536,10 @@ class mob_zealot_zath : public CreatureScript } } - if (m_instance->GetData(DATA_THEKAL) == SPECIAL) + if (instance->GetData(DATA_THEKAL) == SPECIAL) { //Resurrect Thekal - if (Unit* pThekal = Unit::GetUnit((*me), m_instance->GetData64(DATA_THEKAL))) + if (Unit* pThekal = Unit::GetUnit(*me, instance->GetData64(DATA_THEKAL))) { pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -562,8 +562,8 @@ class mob_zealot_zath : public CreatureScript me->setFaction(35); me->AttackStop(); - if (m_instance) - m_instance->SetData(DATA_ZATH, SPECIAL); + if (instance) + instance->SetData(DATA_ZATH, SPECIAL); FakeDeath = true; } diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp index bd6f6ec4748..06448032dff 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp @@ -186,7 +186,7 @@ class boss_venoxis : public CreatureScript events.ScheduleEvent(EVENT_THRASH, urand(10000, 20000)); break; - // troll form spells and actions (first part) + // troll form spells and Actions (first part) case EVENT_DISPEL_MAGIC: DoCast(me, SPELL_DISPEL_MAGIC); events.ScheduleEvent(EVENT_DISPEL_MAGIC, urand(15000, 20000), 0, PHASE_ONE); @@ -198,7 +198,7 @@ class boss_venoxis : public CreatureScript case EVENT_HOLY_NOVA: _inMeleeRange = 0; - for (uint8 i = 0; i < 10 ; ++i) + for (uint8 i = 0; i < 10; ++i) { if (Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, i)) // check if target is within melee-distance @@ -224,7 +224,7 @@ class boss_venoxis : public CreatureScript break; // - // snake form spells and actions + // snake form spells and Actions // case EVENT_VENOM_SPIT: diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp index 702a69207ba..b22630f51bb 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp @@ -40,7 +40,7 @@ class boss_wushoolay : public CreatureScript struct boss_wushoolayAI : public ScriptedAI { - boss_wushoolayAI(Creature* c) : ScriptedAI(c) {} + boss_wushoolayAI(Creature* creature) : ScriptedAI(creature) {} uint32 LightningCloud_Timer; uint32 LightningWave_Timer; diff --git a/src/server/scripts/EasternKingdoms/arathi_highlands.cpp b/src/server/scripts/EasternKingdoms/arathi_highlands.cpp index 82b09b9dc18..d4d35b107b2 100644 --- a/src/server/scripts/EasternKingdoms/arathi_highlands.cpp +++ b/src/server/scripts/EasternKingdoms/arathi_highlands.cpp @@ -62,38 +62,44 @@ class npc_professor_phizzlethorpe : public CreatureScript struct npc_professor_phizzlethorpeAI : public npc_escortAI { - npc_professor_phizzlethorpeAI(Creature* c) : npc_escortAI(c) {} + npc_professor_phizzlethorpeAI(Creature* creature) : npc_escortAI(creature) {} - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - switch (uiPointId) + switch (waypointId) { - case 4:Talk(SAY_PROGRESS_2, player->GetGUID());break; - case 5:Talk(SAY_PROGRESS_3, player->GetGUID());break; - case 8:Talk(EMOTE_PROGRESS_4);break; - case 9: - { - me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96f, -2142.49f, 20.15f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); - me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96f, -2142.49f, 20.15f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); - break; - } - case 10:Talk(SAY_PROGRESS_5, player->GetGUID());break; - case 11: - Talk(SAY_PROGRESS_6, player->GetGUID()); - SetRun(); - break; - case 19:Talk(SAY_PROGRESS_7, player->GetGUID()); break; - case 20: - Talk(EMOTE_PROGRESS_8); - Talk(SAY_PROGRESS_9, player->GetGUID()); - if (player) - CAST_PLR(player)->GroupEventHappens(QUEST_SUNKEN_TREASURE, me); - break; + case 4: + Talk(SAY_PROGRESS_2, player->GetGUID()); + break; + case 5: + Talk(SAY_PROGRESS_3, player->GetGUID()); + break; + case 8: + Talk(EMOTE_PROGRESS_4); + break; + case 9: + me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96f, -2142.49f, 20.15f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); + me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96f, -2142.49f, 20.15f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); + break; + case 10: + Talk(SAY_PROGRESS_5, player->GetGUID()); + break; + case 11: + Talk(SAY_PROGRESS_6, player->GetGUID()); + SetRun(); + break; + case 19: + Talk(SAY_PROGRESS_7, player->GetGUID()); + break; + case 20: + Talk(EMOTE_PROGRESS_8); + Talk(SAY_PROGRESS_9, player->GetGUID()); + player->GroupEventHappens(QUEST_SUNKEN_TREASURE, me); + break; } } diff --git a/src/server/scripts/EasternKingdoms/blasted_lands.cpp b/src/server/scripts/EasternKingdoms/blasted_lands.cpp index 2ad03f8b504..2042e5313c3 100644 --- a/src/server/scripts/EasternKingdoms/blasted_lands.cpp +++ b/src/server/scripts/EasternKingdoms/blasted_lands.cpp @@ -44,10 +44,10 @@ class npc_deathly_usher : public CreatureScript public: npc_deathly_usher() : CreatureScript("npc_deathly_usher") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF) + if (action == GOSSIP_ACTION_INFO_DEF) { player->CLOSE_GOSSIP_MENU(); creature->CastSpell(player, SPELL_TELEPORT_SINGLE, true); @@ -65,7 +65,6 @@ public: return true; } - }; void AddSC_blasted_lands() diff --git a/src/server/scripts/EasternKingdoms/boss_kruul.cpp b/src/server/scripts/EasternKingdoms/boss_kruul.cpp index 126f55838b9..8749c943a6f 100644 --- a/src/server/scripts/EasternKingdoms/boss_kruul.cpp +++ b/src/server/scripts/EasternKingdoms/boss_kruul.cpp @@ -45,7 +45,7 @@ public: struct boss_kruulAI : public ScriptedAI { - boss_kruulAI(Creature* c) : ScriptedAI(c) {} + boss_kruulAI(Creature* creature) : ScriptedAI(creature) {} uint32 ShadowVolley_Timer; uint32 Cleave_Timer; @@ -151,7 +151,6 @@ public: DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_kruul() diff --git a/src/server/scripts/EasternKingdoms/burning_steppes.cpp b/src/server/scripts/EasternKingdoms/burning_steppes.cpp index 1d2725b10ee..b526246f670 100644 --- a/src/server/scripts/EasternKingdoms/burning_steppes.cpp +++ b/src/server/scripts/EasternKingdoms/burning_steppes.cpp @@ -51,10 +51,10 @@ class npc_ragged_john : public CreatureScript public: npc_ragged_john() : CreatureScript("npc_ragged_john") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); @@ -127,7 +127,7 @@ public: struct npc_ragged_johnAI : public ScriptedAI { - npc_ragged_johnAI(Creature* c) : ScriptedAI(c) {} + npc_ragged_johnAI(Creature* creature) : ScriptedAI(creature) {} void Reset() {} @@ -147,7 +147,6 @@ public: void EnterCombat(Unit* /*who*/) {} }; - }; void AddSC_burning_steppes() diff --git a/src/server/scripts/EasternKingdoms/duskwood.cpp b/src/server/scripts/EasternKingdoms/duskwood.cpp index 5d04489bbca..10cb5987ce5 100644 --- a/src/server/scripts/EasternKingdoms/duskwood.cpp +++ b/src/server/scripts/EasternKingdoms/duskwood.cpp @@ -60,7 +60,6 @@ public: } return false; }; - }; /*###### @@ -83,7 +82,7 @@ public: struct boss_twilight_corrupterAI : public ScriptedAI { - boss_twilight_corrupterAI(Creature* c) : ScriptedAI(c) {} + boss_twilight_corrupterAI(Creature* creature) : ScriptedAI(creature) {} uint32 SoulCorruption_Timer; uint32 CreatureOfNightmare_Timer; @@ -133,7 +132,6 @@ public: DoMeleeAttackIfReady(); }; }; - }; void AddSC_duskwood() diff --git a/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp b/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp index 2b4bb61c603..0519ce94b32 100644 --- a/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp +++ b/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp @@ -32,35 +32,30 @@ EndContentData */ #include "ScriptPCH.h" -//id8530 - cannibal ghoul -//id8531 - gibbering ghoul -//id8532 - diseased flayer - class mobs_ghoul_flayer : public CreatureScript { public: mobs_ghoul_flayer() : CreatureScript("mobs_ghoul_flayer") { } - CreatureAI* GetAI(Creature* creature) const - { - return new mobs_ghoul_flayerAI (creature); - } - struct mobs_ghoul_flayerAI : public ScriptedAI { - mobs_ghoul_flayerAI(Creature* c) : ScriptedAI(c) {} + mobs_ghoul_flayerAI(Creature* creature) : ScriptedAI(creature) { } void Reset() {} void EnterCombat(Unit* /*who*/) {} - void JustDied(Unit* Killer) + void JustDied(Unit* killer) { - if (Killer->GetTypeId() == TYPEID_PLAYER) + if (killer->GetTypeId() == TYPEID_PLAYER) me->SummonCreature(11064, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 60000); } }; + CreatureAI* GetAI(Creature* creature) const + { + return new mobs_ghoul_flayerAI (creature); + } }; /*###### @@ -72,10 +67,10 @@ class npc_augustus_the_touched : public CreatureScript public: npc_augustus_the_touched() : CreatureScript("npc_augustus_the_touched") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_TRADE) + if (action == GOSSIP_ACTION_TRADE) player->GetSession()->SendListInventory(creature->GetGUID()); return true; } @@ -91,7 +86,6 @@ public: player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); return true; } - }; /*###### @@ -120,7 +114,7 @@ public: struct npc_darrowshire_spiritAI : public ScriptedAI { - npc_darrowshire_spiritAI(Creature* c) : ScriptedAI(c) {} + npc_darrowshire_spiritAI(Creature* creature) : ScriptedAI(creature) {} void Reset() { @@ -129,9 +123,7 @@ public: } void EnterCombat(Unit* /*who*/) {} - }; - }; /*###### @@ -148,10 +140,10 @@ class npc_tirion_fordring : public CreatureScript public: npc_tirion_fordring() : CreatureScript("npc_tirion_fordring") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); @@ -185,7 +177,6 @@ public: return true; } - }; void AddSC_eastern_plaguelands() diff --git a/src/server/scripts/EasternKingdoms/eversong_woods.cpp b/src/server/scripts/EasternKingdoms/eversong_woods.cpp index 4797774ef49..8ae72e142c8 100644 --- a/src/server/scripts/EasternKingdoms/eversong_woods.cpp +++ b/src/server/scripts/EasternKingdoms/eversong_woods.cpp @@ -124,7 +124,6 @@ public: void Reset() { - timer = 2000; questPhase = 0; summonerGuid = 0; @@ -248,7 +247,7 @@ public: CAST_PLR(Killed)->FailQuest(QUEST_SECOND_TRIAL); } - void JustDied(Unit* Killer); + void JustDied(Unit* killer); }; }; @@ -294,7 +293,7 @@ public: struct master_kelerun_bloodmournAI : public ScriptedAI { - master_kelerun_bloodmournAI(Creature* c) : ScriptedAI(c) {} + master_kelerun_bloodmournAI(Creature* creature) : ScriptedAI(creature) {} uint8 questPhase; uint8 paladinPhase; @@ -366,10 +365,8 @@ public: void StartEvent() { - if (questPhase == 1) { // no player check, quest can be finished as group, so no complex PlayerGUID/group search code - for (uint8 i = 0; i < 4; ++i) if (Creature* summoned = DoSpawnCreature(PaladinEntry[i], SpawnPosition[i].x, SpawnPosition[i].y, SpawnPosition[i].z, SpawnPosition[i].o, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 180000)) paladinGuid[i] = summoned->GetGUID(); @@ -420,15 +417,14 @@ class go_second_trial : public GameObjectScript public: go_second_trial() : GameObjectScript("go_second_trial") { } - bool OnGossipHello(Player* /*player*/, GameObject* pGO) + bool OnGossipHello(Player* /*player*/, GameObject* go) { // find spawn :: master_kelerun_bloodmourn - if (Creature* creature = pGO->FindNearestCreature(MASTER_KELERUN_BLOODMOURN, 30.0f)) + if (Creature* creature = go->FindNearestCreature(MASTER_KELERUN_BLOODMOURN, 30.0f)) CAST_AI(npc_second_trial_controller::master_kelerun_bloodmournAI, creature->AI())->StartEvent(); return true; } - }; /*###### @@ -461,7 +457,7 @@ public: struct npc_apprentice_mirvedaAI : public ScriptedAI { - npc_apprentice_mirvedaAI(Creature* c) : ScriptedAI(c), Summons(me) {} + npc_apprentice_mirvedaAI(Creature* creature) : ScriptedAI(creature), Summons(me) {} uint32 KillCount; uint64 PlayerGUID; @@ -494,14 +490,14 @@ public: { if (PlayerGUID) if (Player* player = Unit::GetPlayer(*me, PlayerGUID)) - CAST_PLR(player)->FailQuest(QUEST_UNEXPECTED_RESULT); + player->FailQuest(QUEST_UNEXPECTED_RESULT); } void UpdateAI(const uint32 /*diff*/) { if (KillCount >= 3 && PlayerGUID) if (Player* player = Unit::GetPlayer(*me, PlayerGUID)) - CAST_PLR(player)->CompleteQuest(QUEST_UNEXPECTED_RESULT); + player->CompleteQuest(QUEST_UNEXPECTED_RESULT); if (Summon) { @@ -512,7 +508,6 @@ public: } } }; - }; /*###### @@ -552,7 +547,7 @@ public: struct npc_infused_crystalAI : public Scripted_NoMovementAI { - npc_infused_crystalAI(Creature* c) : Scripted_NoMovementAI(c) {} + npc_infused_crystalAI(Creature* creature) : Scripted_NoMovementAI(creature) {} uint32 EndTimer; uint32 WaveTimer; @@ -621,7 +616,6 @@ public: } else WaveTimer -= diff; } }; - }; void AddSC_eversong_woods() diff --git a/src/server/scripts/EasternKingdoms/ghostlands.cpp b/src/server/scripts/EasternKingdoms/ghostlands.cpp index 412613572f1..e40a2f785e6 100644 --- a/src/server/scripts/EasternKingdoms/ghostlands.cpp +++ b/src/server/scripts/EasternKingdoms/ghostlands.cpp @@ -44,10 +44,10 @@ class npc_budd_nedreck : public CreatureScript public: npc_budd_nedreck() : CreatureScript("npc_budd_nedreck") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF) + if (action == GOSSIP_ACTION_INFO_DEF) { player->CLOSE_GOSSIP_MENU(); creature->CastSpell(player, 42540, false); @@ -66,7 +66,6 @@ public: player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); return true; } - }; /*###### @@ -78,10 +77,10 @@ class npc_rathis_tomber : public CreatureScript public: npc_rathis_tomber() : CreatureScript("npc_rathis_tomber") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_TRADE) + if (action == GOSSIP_ACTION_TRADE) player->GetSession()->SendListInventory(creature->GetGUID()); return true; } @@ -100,7 +99,6 @@ public: return true; } - }; /*###### @@ -130,61 +128,63 @@ public: struct npc_ranger_lilathaAI : public npc_escortAI { - npc_ranger_lilathaAI(Creature* c) : npc_escortAI(c) {} + npc_ranger_lilathaAI(Creature* creature) : npc_escortAI(creature) {} - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - switch (i) + switch (waypointId) { - case 0: - { - me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20)) - Cage->SetGoState(GO_STATE_ACTIVE); - DoScriptText(SAY_START, me, player); - break; - } - case 5: - DoScriptText(SAY_PROGRESS1, me, player); - case 11: - DoScriptText(SAY_PROGRESS2, me, player); - me->SetOrientation(4.762841f); - break; - case 18: - { - DoScriptText(SAY_PROGRESS3, me, player); - Creature* Summ1 = me->SummonCreature(16342, 7627.083984f, -7532.538086f, 152.128616f, 1.082733f, TEMPSUMMON_DEAD_DESPAWN, 0); - Creature* Summ2 = me->SummonCreature(16343, 7620.432129f, -7532.550293f, 152.454865f, 0.827478f, TEMPSUMMON_DEAD_DESPAWN, 0); - if (Summ1 && Summ2) - { - Summ1->Attack(me, true); - Summ2->Attack(player, true); - } - me->AI()->AttackStart(Summ1); - break; - } - case 19: me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); break; - case 25: me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); break; - case 30: - if (player && player->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(player)->GroupEventHappens(QUEST_ESCAPE_FROM_THE_CATACOMBS, me); - break; - case 32: - me->SetOrientation(2.978281f); - DoScriptText(SAY_END1, me, player); - break; - case 33: - me->SetOrientation(5.858011f); - DoScriptText(SAY_END2, me, player); - Unit* CaptainHelios = me->FindNearestCreature(NPC_CAPTAIN_HELIOS, 50); - if (CaptainHelios) - DoScriptText(SAY_CAPTAIN_ANSWER, CaptainHelios, player); - break; + case 0: + me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20)) + Cage->SetGoState(GO_STATE_ACTIVE); + DoScriptText(SAY_START, me, player); + break; + case 5: + DoScriptText(SAY_PROGRESS1, me, player); + break; + case 11: + DoScriptText(SAY_PROGRESS2, me, player); + me->SetOrientation(4.762841f); + break; + case 18: + { + DoScriptText(SAY_PROGRESS3, me, player); + Creature* Summ1 = me->SummonCreature(16342, 7627.083984f, -7532.538086f, 152.128616f, 1.082733f, TEMPSUMMON_DEAD_DESPAWN, 0); + Creature* Summ2 = me->SummonCreature(16343, 7620.432129f, -7532.550293f, 152.454865f, 0.827478f, TEMPSUMMON_DEAD_DESPAWN, 0); + if (Summ1 && Summ2) + { + Summ1->Attack(me, true); + Summ2->Attack(player, true); + } + me->AI()->AttackStart(Summ1); + } + break; + case 19: + me->SetWalk(false); + break; + case 25: + me->SetWalk(true); + break; + case 30: + if (player->GetTypeId() == TYPEID_PLAYER) + CAST_PLR(player)->GroupEventHappens(QUEST_ESCAPE_FROM_THE_CATACOMBS, me); + break; + case 32: + me->SetOrientation(2.978281f); + DoScriptText(SAY_END1, me, player); + break; + case 33: + me->SetOrientation(5.858011f); + DoScriptText(SAY_END2, me, player); + Unit* CaptainHelios = me->FindNearestCreature(NPC_CAPTAIN_HELIOS, 50); + if (CaptainHelios) + DoScriptText(SAY_CAPTAIN_ANSWER, CaptainHelios, player); + break; } } diff --git a/src/server/scripts/EasternKingdoms/hinterlands.cpp b/src/server/scripts/EasternKingdoms/hinterlands.cpp index 7021deeae75..8de895cb51f 100644 --- a/src/server/scripts/EasternKingdoms/hinterlands.cpp +++ b/src/server/scripts/EasternKingdoms/hinterlands.cpp @@ -87,9 +87,9 @@ public: void Reset() { } - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { - switch (uiPointId) + switch (waypointId) { case 26: DoScriptText(SAY_OOX_AMBUSH, me); @@ -146,7 +146,6 @@ public: summoned->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()); } }; - }; /*###### @@ -273,18 +272,17 @@ public: void JustSummoned(Creature* summoned) { - summoned->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + summoned->SetWalk(false); summoned->GetMotionMaster()->MovePoint(0, m_afAmbushMoveTo[m_iSpawnId].m_fX, m_afAmbushMoveTo[m_iSpawnId].m_fY, m_afAmbushMoveTo[m_iSpawnId].m_fZ); } - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - switch (uiPointId) + switch (waypointId) { case 1: DoScriptText(SAY_RIN_FREE, me, player); @@ -315,7 +313,7 @@ public: { m_uiPostEventTimer = 3000; - if (Unit* player = GetPlayerForEscort()) + if (Player* player = GetPlayerForEscort()) { switch (m_uiPostEventCount) { @@ -345,7 +343,6 @@ public: DoMeleeAttackIfReady(); } }; - }; void AddSC_hinterlands() diff --git a/src/server/scripts/EasternKingdoms/ironforge.cpp b/src/server/scripts/EasternKingdoms/ironforge.cpp index 5a0ee3c5630..93a8d7423c9 100644 --- a/src/server/scripts/EasternKingdoms/ironforge.cpp +++ b/src/server/scripts/EasternKingdoms/ironforge.cpp @@ -44,10 +44,10 @@ class npc_royal_historian_archesonus : public CreatureScript public: npc_royal_historian_archesonus() : CreatureScript("npc_royal_historian_archesonus") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ROYAL_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); @@ -88,7 +88,6 @@ public: return true; } - }; void AddSC_ironforge() diff --git a/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp b/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp index f2095de49c3..27d8ea3e51c 100644 --- a/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp +++ b/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp @@ -51,7 +51,7 @@ public: struct npc_converted_sentryAI : public ScriptedAI { - npc_converted_sentryAI(Creature* c) : ScriptedAI(c) {} + npc_converted_sentryAI(Creature* creature) : ScriptedAI(creature) {} bool Credit; uint32 Timer; @@ -85,7 +85,6 @@ public: } } }; - }; /*###### @@ -109,7 +108,7 @@ public: struct npc_greengill_slaveAI : public ScriptedAI { - npc_greengill_slaveAI(Creature* c) : ScriptedAI(c) {} + npc_greengill_slaveAI(Creature* creature) : ScriptedAI(creature) {} uint64 PlayerGUID; @@ -130,8 +129,8 @@ public: PlayerGUID = caster->GetGUID(); if (PlayerGUID) { - Unit* player = Unit::GetUnit((*me), PlayerGUID); - if (player && CAST_PLR(player)->GetQuestStatus(QUESTG) == QUEST_STATUS_INCOMPLETE) + Player* player = Unit::GetPlayer(*me, PlayerGUID); + if (player && player->GetQuestStatus(QUESTG) == QUEST_STATUS_INCOMPLETE) DoCast(player, 45110, true); } DoCast(me, ENRAGE); @@ -149,7 +148,6 @@ public: DoMeleeAttackIfReady(); } }; - }; void AddSC_isle_of_queldanas() diff --git a/src/server/scripts/EasternKingdoms/loch_modan.cpp b/src/server/scripts/EasternKingdoms/loch_modan.cpp index 9ce9de4381a..7ea8a62a5bd 100644 --- a/src/server/scripts/EasternKingdoms/loch_modan.cpp +++ b/src/server/scripts/EasternKingdoms/loch_modan.cpp @@ -47,10 +47,10 @@ class npc_mountaineer_pebblebitty : public CreatureScript public: npc_mountaineer_pebblebitty() : CreatureScript("npc_mountaineer_pebblebitty") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); @@ -95,7 +95,6 @@ public: return true; } - }; void AddSC_loch_modan() diff --git a/src/server/scripts/EasternKingdoms/redridge_mountains.cpp b/src/server/scripts/EasternKingdoms/redridge_mountains.cpp index d7b00af33e8..3ade1da4a19 100644 --- a/src/server/scripts/EasternKingdoms/redridge_mountains.cpp +++ b/src/server/scripts/EasternKingdoms/redridge_mountains.cpp @@ -76,17 +76,16 @@ public: uiShieldBashTimer = 8000; } - void WaypointReached(uint32 uiI) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - if (uiI >= 65 && me->GetUnitMovementFlags() == MOVEMENTFLAG_WALKING) - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + if (waypointId >= 65 && me->GetUnitMovementFlags() == MOVEMENTFLAG_WALKING) + me->SetWalk(false); - switch (uiI) + switch (waypointId) { case 39: SetEscortPaused(true); @@ -94,7 +93,7 @@ public: uiPhase = 1; break; case 65: - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); break; case 115: player->AreaExploredOrEventHappens(QUEST_MISSING_IN_ACTION); @@ -164,7 +163,6 @@ public: DoMeleeAttackIfReady(); } }; - }; void AddSC_redridge_mountains() diff --git a/src/server/scripts/EasternKingdoms/silvermoon_city.cpp b/src/server/scripts/EasternKingdoms/silvermoon_city.cpp index 8d04e92b9b8..e6595a83b66 100644 --- a/src/server/scripts/EasternKingdoms/silvermoon_city.cpp +++ b/src/server/scripts/EasternKingdoms/silvermoon_city.cpp @@ -53,7 +53,7 @@ public: struct npc_blood_knight_stillbladeAI : public ScriptedAI { - npc_blood_knight_stillbladeAI(Creature* c) : ScriptedAI(c) {} + npc_blood_knight_stillbladeAI(Creature* creature) : ScriptedAI(creature) {} uint32 lifeTimer; bool spellHit; @@ -100,7 +100,6 @@ public: } } }; - }; void AddSC_silvermoon_city() diff --git a/src/server/scripts/EasternKingdoms/silverpine_forest.cpp b/src/server/scripts/EasternKingdoms/silverpine_forest.cpp index 4d897c4f3b8..bc3110878de 100644 --- a/src/server/scripts/EasternKingdoms/silverpine_forest.cpp +++ b/src/server/scripts/EasternKingdoms/silverpine_forest.cpp @@ -64,37 +64,46 @@ public: struct npc_deathstalker_erlandAI : public npc_escortAI { - npc_deathstalker_erlandAI(Creature* c) : npc_escortAI(c) {} + npc_deathstalker_erlandAI(Creature* creature) : npc_escortAI(creature) {} - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - switch (i) + switch (waypointId) { - case 1: DoScriptText(SAY_START, me, player);break; - case 13: - DoScriptText(SAY_LAST, me, player); - player->GroupEventHappens(QUEST_ESCORTING, me); break; - case 14: DoScriptText(SAY_THANKS, me, player); break; - case 15: { - Unit* Rane = me->FindNearestCreature(NPC_RANE, 20); - if (Rane) + case 1: + DoScriptText(SAY_START, me, player); + break; + case 13: + DoScriptText(SAY_LAST, me, player); + player->GroupEventHappens(QUEST_ESCORTING, me); + break; + case 14: + DoScriptText(SAY_THANKS, me, player); + break; + case 15: + if (Unit* Rane = me->FindNearestCreature(NPC_RANE, 20)) DoScriptText(SAY_RANE, Rane); - break;} - case 16: DoScriptText(SAY_ANSWER, me); break; - case 17: DoScriptText(SAY_MOVE_QUINN, me); break; - case 24: DoScriptText(SAY_GREETINGS, me); break; - case 25: { - Unit* Quinn = me->FindNearestCreature(NPC_QUINN, 20); - if (Quinn) + break; + case 16: + DoScriptText(SAY_ANSWER, me); + break; + case 17: + DoScriptText(SAY_MOVE_QUINN, me); + break; + case 24: + DoScriptText(SAY_GREETINGS, me); + break; + case 25: + if (Unit* Quinn = me->FindNearestCreature(NPC_QUINN, 20)) DoScriptText(SAY_QUINN, Quinn); - break;} - case 26: DoScriptText(SAY_ON_BYE, me, NULL); break; - + break; + case 26: + DoScriptText(SAY_ON_BYE, me, NULL); + break; } } @@ -123,7 +132,6 @@ public: { return new npc_deathstalker_erlandAI(creature); } - }; /*###### @@ -177,7 +185,7 @@ public: struct pyrewood_ambushAI : public ScriptedAI { - pyrewood_ambushAI(Creature* c) : ScriptedAI(c), Summons(me) + pyrewood_ambushAI(Creature* creature) : ScriptedAI(creature), Summons(me) { QuestInProgress = false; } @@ -309,7 +317,6 @@ public: ++Phase; //prepare next phase } }; - }; /*###### diff --git a/src/server/scripts/EasternKingdoms/stormwind_city.cpp b/src/server/scripts/EasternKingdoms/stormwind_city.cpp index a4eca1950f8..96ad1da725d 100644 --- a/src/server/scripts/EasternKingdoms/stormwind_city.cpp +++ b/src/server/scripts/EasternKingdoms/stormwind_city.cpp @@ -47,10 +47,10 @@ class npc_archmage_malin : public CreatureScript public: npc_archmage_malin() : CreatureScript("npc_archmage_malin") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF) + if (action == GOSSIP_ACTION_INFO_DEF) { player->CLOSE_GOSSIP_MENU(); creature->CastSpell(player, 42711, true); @@ -71,7 +71,6 @@ public: return true; } - }; /*###### @@ -106,9 +105,9 @@ public: struct npc_bartlebyAI : public ScriptedAI { - npc_bartlebyAI(Creature* c) : ScriptedAI(c) + npc_bartlebyAI(Creature* creature) : ScriptedAI(creature) { - m_uiNormalFaction = c->getFaction(); + m_uiNormalFaction = creature->getFaction(); } uint32 m_uiNormalFaction; @@ -143,7 +142,6 @@ public: } } }; - }; /*###### @@ -160,10 +158,10 @@ class npc_lady_katrana_prestor : public CreatureScript public: npc_lady_katrana_prestor() : CreatureScript("npc_lady_katrana_prestor") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAT_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); @@ -197,7 +195,6 @@ public: return true; } - }; /*###### @@ -271,9 +268,9 @@ public: } } - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { - switch (uiPointId) + switch (waypointId) { case 14: SetEscortPaused(true); @@ -370,7 +367,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*###### @@ -391,7 +387,7 @@ public: { npc_marzon_silent_bladeAI(Creature* creature) : ScriptedAI(creature) { - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); } void Reset() @@ -407,7 +403,7 @@ public: { if (Unit* summoner = me->ToTempSummon()->GetSummoner()) { - if (summoner && summoner->GetTypeId() == TYPEID_UNIT && summoner->isAlive() && !summoner->isInCombat()) + if (summoner->GetTypeId() == TYPEID_UNIT && summoner->isAlive() && !summoner->isInCombat()) summoner->ToCreature()->AI()->AttackStart(who); } } @@ -421,7 +417,7 @@ public: { if (Unit* summoner = me->ToTempSummon()->GetSummoner()) { - if (summoner && summoner->GetTypeId() == TYPEID_UNIT && summoner->isAlive()) + if (summoner->GetTypeId() == TYPEID_UNIT && summoner->isAlive()) summoner->ToCreature()->DisappearAndDie(); } } @@ -457,7 +453,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*###### @@ -502,9 +497,9 @@ public: uiPhase = 0; } - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { - switch (uiPointId) + switch (waypointId) { case 1: SetEscortPaused(true); @@ -606,7 +601,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*###### @@ -636,7 +630,6 @@ public: } return false; } - }; void AddSC_stormwind_city() diff --git a/src/server/scripts/EasternKingdoms/stranglethorn_vale.cpp b/src/server/scripts/EasternKingdoms/stranglethorn_vale.cpp index a6effe29ff7..03f92ce6d61 100644 --- a/src/server/scripts/EasternKingdoms/stranglethorn_vale.cpp +++ b/src/server/scripts/EasternKingdoms/stranglethorn_vale.cpp @@ -45,7 +45,7 @@ public: struct mob_yennikuAI : public ScriptedAI { - mob_yennikuAI(Creature* c) : ScriptedAI(c) + mob_yennikuAI(Creature* creature) : ScriptedAI(creature) { bReset = false; } @@ -114,7 +114,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*###### diff --git a/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp b/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp index ef6fccd8bde..6507ec911c0 100644 --- a/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp +++ b/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp @@ -106,24 +106,24 @@ public: } } - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { - switch (uiPointId) + switch (waypointId) { - case 0: - if (GameObject* pCage = me->GetMap()->GetGameObject(m_uiGalensCageGUID)) - pCage->ResetDoorOrButton(); - break; - case 20: - if (Player* player = GetPlayerForEscort()) - { - me->SetFacingToObject(player); - DoScriptText(SAY_QUEST_COMPLETE, me, player); - DoScriptText(EMOTE_WHISPER, me, player); - player->GroupEventHappens(QUEST_GALENS_ESCAPE, me); - } - SetRun(true); - break; + case 0: + if (GameObject* pCage = me->GetMap()->GetGameObject(m_uiGalensCageGUID)) + pCage->ResetDoorOrButton(); + break; + case 20: + if (Player* player = GetPlayerForEscort()) + { + me->SetFacingToObject(player); + DoScriptText(SAY_QUEST_COMPLETE, me, player); + DoScriptText(EMOTE_WHISPER, me, player); + player->GroupEventHappens(QUEST_GALENS_ESCAPE, me); + } + SetRun(true); + break; } } diff --git a/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp b/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp index 0d72ab6fb2f..4687fa3630f 100644 --- a/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp +++ b/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp @@ -150,7 +150,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*###### @@ -185,7 +184,6 @@ public: return false; } - }; class go_mausoleum_trigger : public GameObjectScript @@ -207,7 +205,6 @@ public: return false; } - }; void AddSC_tirisfal_glades() diff --git a/src/server/scripts/EasternKingdoms/undercity.cpp b/src/server/scripts/EasternKingdoms/undercity.cpp index fe9c40e6dbd..a9b627ded34 100644 --- a/src/server/scripts/EasternKingdoms/undercity.cpp +++ b/src/server/scripts/EasternKingdoms/undercity.cpp @@ -47,7 +47,15 @@ enum Sylvanas SPELL_HIGHBORNE_AURA = 37090, SPELL_SYLVANAS_CAST = 36568, - SPELL_RIBBON_OF_SOULS = 34432, //the real one to use might be 37099 + SPELL_RIBBON_OF_SOULS = 34432, // the real one to use might be 37099 + + // Combat spells + SPELL_BLACK_ARROW = 59712, + SPELL_FADE = 20672, + SPELL_FADE_BLINK = 29211, + SPELL_MULTI_SHOT = 59713, + SPELL_SHOT = 59710, + SPELL_SUMMON_SKELETON = 59711 }; float HighborneLoc[4][3]= @@ -88,17 +96,29 @@ public: struct npc_lady_sylvanas_windrunnerAI : public ScriptedAI { - npc_lady_sylvanas_windrunnerAI(Creature* c) : ScriptedAI(c) {} + npc_lady_sylvanas_windrunnerAI(Creature* creature) : ScriptedAI(creature) {} - uint32 LamentEvent_Timer; + uint32 LamentEventTimer; bool LamentEvent; uint64 targetGUID; + uint32 FadeTimer; + uint32 SummonSkeletonTimer; + uint32 BlackArrowTimer; + uint32 ShotTimer; + uint32 MultiShotTimer; + void Reset() { - LamentEvent_Timer = 5000; + LamentEventTimer = 5000; LamentEvent = false; targetGUID = 0; + + FadeTimer = 30000; + SummonSkeletonTimer = 20000; + BlackArrowTimer = 15000; + ShotTimer = 8000; + MultiShotTimer = 10000; } void EnterCombat(Unit* /*who*/) {} @@ -114,7 +134,7 @@ public: summoned->CastSpell(target, SPELL_RIBBON_OF_SOULS, false); } - summoned->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + summoned->SetDisableGravity(true); targetGUID = summoned->GetGUID(); } } @@ -123,27 +143,73 @@ public: { if (LamentEvent) { - if (LamentEvent_Timer <= diff) + if (LamentEventTimer <= diff) { DoSummon(ENTRY_HIGHBORNE_BUNNY, me, 10.0f, 3000, TEMPSUMMON_TIMED_DESPAWN); - LamentEvent_Timer = 2000; + LamentEventTimer = 2000; if (!me->HasAura(SPELL_SYLVANAS_CAST)) { DoScriptText(SAY_LAMENT_END, me); DoScriptText(EMOTE_LAMENT_END, me); LamentEvent = false; } - } else LamentEvent_Timer -= diff; + } else LamentEventTimer -= diff; } if (!UpdateVictim()) return; + // Combat spells + + if (FadeTimer <= diff) + { + DoCast(me, SPELL_FADE); + // add a blink to simulate a stealthed movement and reappearing elsewhere + DoCast(me, SPELL_FADE_BLINK); + FadeTimer = 30000 + rand()%5000; + // if the victim is out of melee range she cast multi shot + if (Unit* victim = me->getVictim()) + if (me->GetDistance(victim) > 10.0f) + DoCast(victim, SPELL_MULTI_SHOT); + } else FadeTimer -= diff; + + if (SummonSkeletonTimer <= diff) + { + DoCast(me, SPELL_SUMMON_SKELETON); + SummonSkeletonTimer = 20000 + rand()%10000; + } else SummonSkeletonTimer -= diff; + + if (BlackArrowTimer <= diff) + { + if (Unit* victim = me->getVictim()) + { + DoCast(victim, SPELL_BLACK_ARROW); + BlackArrowTimer = 15000 + rand()%5000; + } + } else BlackArrowTimer -= diff; + + if (ShotTimer <= diff) + { + if (Unit* victim = me->getVictim()) + { + DoCast(victim, SPELL_SHOT); + ShotTimer = 8000 + rand()%2000; + } + } else ShotTimer -= diff; + + if (MultiShotTimer <= diff) + { + if (Unit* victim = me->getVictim()) + { + DoCast(victim, SPELL_MULTI_SHOT); + MultiShotTimer = 10000 + rand()%3000; + } + } else MultiShotTimer -= diff; + DoMeleeAttackIfReady(); } }; - }; /*###### @@ -162,17 +228,17 @@ public: struct npc_highborne_lamenterAI : public ScriptedAI { - npc_highborne_lamenterAI(Creature* c) : ScriptedAI(c) {} + npc_highborne_lamenterAI(Creature* creature) : ScriptedAI(creature) {} - uint32 EventMove_Timer; - uint32 EventCast_Timer; + uint32 EventMoveTimer; + uint32 EventCastTimer; bool EventMove; bool EventCast; void Reset() { - EventMove_Timer = 10000; - EventCast_Timer = 17500; + EventMoveTimer = 10000; + EventCastTimer = 17500; EventMove = true; EventCast = true; } @@ -183,25 +249,24 @@ public: { if (EventMove) { - if (EventMove_Timer <= diff) + if (EventMoveTimer <= diff) { - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetDisableGravity(true); me->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW, me->GetDistance(me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW) / (5000 * 0.001f)); me->SetPosition(me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW, me->GetOrientation()); EventMove = false; - } else EventMove_Timer -= diff; + } else EventMoveTimer -= diff; } if (EventCast) { - if (EventCast_Timer <= diff) + if (EventCastTimer <= diff) { DoCast(me, SPELL_HIGHBORNE_AURA); EventCast = false; - } else EventCast_Timer -= diff; + } else EventCastTimer -= diff; } } }; - }; /*###### @@ -219,15 +284,15 @@ class npc_parqual_fintallas : public CreatureScript public: npc_parqual_fintallas() : CreatureScript("npc_parqual_fintallas") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { player->CLOSE_GOSSIP_MENU(); creature->CastSpell(player, SPELL_MARK_OF_SHAME, false); } - if (uiAction == GOSSIP_ACTION_INFO_DEF+2) + if (action == GOSSIP_ACTION_INFO_DEF+2) { player->CLOSE_GOSSIP_MENU(); player->AreaExploredOrEventHappens(6628); @@ -252,7 +317,6 @@ public: return true; } - }; /*###### diff --git a/src/server/scripts/EasternKingdoms/western_plaguelands.cpp b/src/server/scripts/EasternKingdoms/western_plaguelands.cpp index a04a94f73b1..0057c01b882 100644 --- a/src/server/scripts/EasternKingdoms/western_plaguelands.cpp +++ b/src/server/scripts/EasternKingdoms/western_plaguelands.cpp @@ -49,10 +49,10 @@ class npcs_dithers_and_arbington : public CreatureScript public: npcs_dithers_and_arbington() : CreatureScript("npcs_dithers_and_arbington") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_TRADE: player->GetSession()->SendListInventory(creature->GetGUID()); @@ -85,6 +85,7 @@ public: { if (creature->isQuestGiver()) player->PrepareQuestMenu(creature->GetGUID()); + if (creature->isVendor()) player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); @@ -95,12 +96,12 @@ public: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HDA3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HDA4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); player->SEND_GOSSIP_MENU(3985, creature->GetGUID()); - }else + } + else player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); return true; } - }; /*###### @@ -121,10 +122,10 @@ class npc_myranda_the_hag : public CreatureScript public: npc_myranda_the_hag() : CreatureScript("npc_myranda_the_hag") { } - bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + if (action == GOSSIP_ACTION_INFO_DEF + 1) { player->CLOSE_GOSSIP_MENU(); player->CastSpell(player, SPELL_SCARLET_ILLUSION, false); @@ -149,7 +150,6 @@ public: return true; } - }; /*###### @@ -168,7 +168,7 @@ public: struct npc_the_scourge_cauldronAI : public ScriptedAI { - npc_the_scourge_cauldronAI(Creature* c) : ScriptedAI(c) {} + npc_the_scourge_cauldronAI(Creature* creature) : ScriptedAI(creature) {} void Reset() {} @@ -229,7 +229,6 @@ public: } } }; - }; /*###### @@ -253,7 +252,7 @@ public: struct npc_andorhal_towerAI : public Scripted_NoMovementAI { - npc_andorhal_towerAI(Creature* c) : Scripted_NoMovementAI(c) {} + npc_andorhal_towerAI(Creature* creature) : Scripted_NoMovementAI(creature) {} void MoveInLineOfSight(Unit* who) { @@ -264,7 +263,6 @@ public: CAST_PLR(who)->KilledMonsterCredit(me->GetEntry(), me->GetGUID()); } }; - }; /*###### @@ -330,10 +328,11 @@ public: summoned->AI()->AttackStart(me); } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - switch (i) + + switch (waypointId) { case 8: DoScriptText(SAY_WP_0, me); @@ -359,7 +358,7 @@ public: break; case 23: Ughost = me->SummonCreature(NPC_GHOST_UTHER, 971.86f, -1825.42f, 81.99f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - Ughost->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + Ughost->SetDisableGravity(true); DoScriptText(SAY_WP_4, Ughost, me); m_uiChatTimer = 4000; break; @@ -382,8 +381,7 @@ public: void JustDied(Unit* /*killer*/) { - Player* player = GetPlayerForEscort(); - if (player) + if (Player* player = GetPlayerForEscort()) player->FailQuest(QUEST_TOMB_LIGHTBRINGER); } @@ -395,7 +393,6 @@ public: m_uiChatTimer = 6000; } }; - }; /*###### diff --git a/src/server/scripts/EasternKingdoms/westfall.cpp b/src/server/scripts/EasternKingdoms/westfall.cpp index 271e1d99d63..46f1526c5bf 100644 --- a/src/server/scripts/EasternKingdoms/westfall.cpp +++ b/src/server/scripts/EasternKingdoms/westfall.cpp @@ -85,9 +85,15 @@ public: { switch (uiWPHolder) { - case 7: DoScriptText(SAY_DS_DOWN_1, me); break; - case 8: DoScriptText(SAY_DS_DOWN_2, me); break; - case 9: DoScriptText(SAY_DS_DOWN_3, me); break; + case 7: + DoScriptText(SAY_DS_DOWN_1, me); + break; + case 8: + DoScriptText(SAY_DS_DOWN_2, me); + break; + case 9: + DoScriptText(SAY_DS_DOWN_3, me); + break; } } else @@ -96,16 +102,15 @@ public: uiShootTimer = 0; } - void WaypointReached(uint32 uiPoint) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - uiWPHolder = uiPoint; + uiWPHolder = waypointId; - switch (uiPoint) + switch (waypointId) { case 4: SetEquipmentSlots(false, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE, EQUIP_ID_RIFLE); @@ -185,7 +190,6 @@ public: } else uiShootTimer -= diff; } }; - }; /*###### @@ -225,16 +229,15 @@ public: struct npc_defias_traitorAI : public npc_escortAI { - npc_defias_traitorAI(Creature* c) : npc_escortAI(c) { Reset(); } + npc_defias_traitorAI(Creature* creature) : npc_escortAI(creature) { Reset(); } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - switch (i) + switch (waypointId) { case 35: SetRun(false); @@ -244,13 +247,11 @@ public: break; case 44: DoScriptText(SAY_END, me, player); - { - if (player) - player->GroupEventHappens(QUEST_DEFIAS_BROTHERHOOD, me); - } + player->GroupEventHappens(QUEST_DEFIAS_BROTHERHOOD, me); break; } } + void EnterCombat(Unit* who) { DoScriptText(RAND(SAY_AGGRO_1, SAY_AGGRO_2), me, who); @@ -258,7 +259,6 @@ public: void Reset() {} }; - }; void AddSC_westfall() diff --git a/src/server/scripts/EasternKingdoms/wetlands.cpp b/src/server/scripts/EasternKingdoms/wetlands.cpp index 3b196720242..bf28d9838a4 100644 --- a/src/server/scripts/EasternKingdoms/wetlands.cpp +++ b/src/server/scripts/EasternKingdoms/wetlands.cpp @@ -67,14 +67,13 @@ public: m_bFriendSummoned = false; } - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { - switch (uiPointId) + switch (waypointId) { case 2: if (me->HasStealthAura()) me->RemoveAurasByType(SPELL_AURA_MOD_STEALTH); - SetRun(); me->setFaction(FACTION_ENEMY); break; @@ -132,7 +131,6 @@ public: } } }; - }; /*###### @@ -161,7 +159,6 @@ public: } return false; } - }; /*###### diff --git a/src/server/scripts/Examples/CMakeLists.txt b/src/server/scripts/Examples/CMakeLists.txt index 14002100713..dde6fe2c37c 100644 --- a/src/server/scripts/Examples/CMakeLists.txt +++ b/src/server/scripts/Examples/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2011 TrinityCore +# Copyright (C) 2008-2012 TrinityCore # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without diff --git a/src/server/scripts/Examples/example_creature.cpp b/src/server/scripts/Examples/example_creature.cpp index f1b336f07f9..7f75a0fb481 100644 --- a/src/server/scripts/Examples/example_creature.cpp +++ b/src/server/scripts/Examples/example_creature.cpp @@ -90,7 +90,7 @@ class example_creature : public CreatureScript { // *** HANDLED FUNCTION *** //This is the constructor, called only once when the Creature is first created - example_creatureAI(Creature* c) : ScriptedAI(c) {} + example_creatureAI(Creature* creature) : ScriptedAI(creature) {} // *** CUSTOM VARIABLES **** //These variables are for use only by this individual script. @@ -271,10 +271,10 @@ class example_creature : public CreatureScript return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { player->CLOSE_GOSSIP_MENU(); //Set our faction to hostile towards all diff --git a/src/server/scripts/Examples/example_escort.cpp b/src/server/scripts/Examples/example_escort.cpp index cae09266b49..851a32538e9 100644 --- a/src/server/scripts/Examples/example_escort.cpp +++ b/src/server/scripts/Examples/example_escort.cpp @@ -75,9 +75,9 @@ class example_escort : public CreatureScript } // Pure Virtual Functions (Have to be implemented) - void WaypointReached(uint32 uiWP) + void WaypointReached(uint32 waypointId) { - switch (uiWP) + switch (waypointId) { case 1: DoScriptText(SAY_WP_1, me); @@ -123,9 +123,7 @@ class example_escort : public CreatureScript { // not a likely case, code here for the sake of example if (killer == me) - { DoScriptText(SAY_DEATH_1, me, player); - } else DoScriptText(SAY_DEATH_2, me, player); } @@ -197,12 +195,12 @@ class example_escort : public CreatureScript return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); npc_escortAI* pEscortAI = CAST_AI(example_escort::example_escortAI, creature->AI()); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->CLOSE_GOSSIP_MENU(); diff --git a/src/server/scripts/Examples/example_gossip_codebox.cpp b/src/server/scripts/Examples/example_gossip_codebox.cpp index c288123f117..6d57f1ac798 100644 --- a/src/server/scripts/Examples/example_gossip_codebox.cpp +++ b/src/server/scripts/Examples/example_gossip_codebox.cpp @@ -58,10 +58,10 @@ class example_gossip_codebox : public CreatureScript return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+2) + if (action == GOSSIP_ACTION_INFO_DEF+2) { DoScriptText(SAY_NOT_INTERESTED, creature); player->CLOSE_GOSSIP_MENU(); @@ -70,12 +70,12 @@ class example_gossip_codebox : public CreatureScript return true; } - bool OnGossipSelectCode(Player* player, Creature* creature, uint32 uiSender, uint32 uiAction, const char* code) + bool OnGossipSelectCode(Player* player, Creature* creature, uint32 sender, uint32 action, const char* code) { player->PlayerTalkClass->ClearMenus(); - if (uiSender == GOSSIP_SENDER_MAIN) + if (sender == GOSSIP_SENDER_MAIN) { - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: if (std::strcmp(code, player->GetName()) != 0) diff --git a/src/server/scripts/Examples/example_spell.cpp b/src/server/scripts/Examples/example_spell.cpp index 71dbd7f4fb0..70d7f43135c 100644 --- a/src/server/scripts/Examples/example_spell.cpp +++ b/src/server/scripts/Examples/example_spell.cpp @@ -92,7 +92,7 @@ class spell_ex_5581 : public SpellScriptLoader void HandleAfterCast() { - sLog->outString("All immediate actions for the spell are finished now"); + sLog->outString("All immediate Actions for the spell are finished now"); // this is a safe for triggering additional effects for a spell without interfering // with visuals or with other effects of the spell //GetCaster()->CastSpell(target, SPELL_TRIGGERED, true); @@ -102,7 +102,7 @@ class spell_ex_5581 : public SpellScriptLoader { // in this hook you can add additional requirements for spell caster (and throw a client error if reqs're not passed) // in this case we're disallowing to select non-player as a target of the spell - //if (!GetTargetUnit() || GetTargetUnit()->ToPlayer()) + //if (!GetExplTargetUnit() || GetExplTargetUnit()->ToPlayer()) //return SPELL_FAILED_BAD_TARGETS; return SPELL_CAST_OK; } diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp index 3bfaa448b85..a86b2b8b17a 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp @@ -201,7 +201,7 @@ class npc_morridune : public CreatureScript public: npc_morridune() : CreatureScript("npc_morridune") { } - bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*Sender*/, uint32 action) + bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); switch (action) @@ -236,9 +236,9 @@ public: Start(false, false, 0); } - void WaypointReached(uint32 uiPoint) + void WaypointReached(uint32 waypointId) { - switch (uiPoint) + switch (waypointId) { case 4: SetEscortPaused(true); diff --git a/src/server/scripts/Kalimdor/CMakeLists.txt b/src/server/scripts/Kalimdor/CMakeLists.txt index 9c68451122f..7f63c521594 100644 --- a/src/server/scripts/Kalimdor/CMakeLists.txt +++ b/src/server/scripts/Kalimdor/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2011 TrinityCore +# Copyright (C) 2008-2012 TrinityCore # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp index 6bc179bba40..85f82c62079 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp @@ -64,11 +64,10 @@ public: struct boss_anetheronAI : public hyjal_trashAI { - boss_anetheronAI(Creature* c) : hyjal_trashAI(c) + boss_anetheronAI(Creature* creature) : hyjal_trashAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); go = false; - pos = 0; } uint32 SwarmTimer; @@ -76,7 +75,6 @@ public: uint32 AuraTimer; uint32 InfernoTimer; bool go; - uint32 pos; void Reset() { @@ -117,20 +115,19 @@ public: } } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - pos = i; - if (i == 7 && instance) + if (waypointId == 7 && instance) { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_JAINAPROUDMOORE)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_JAINAPROUDMOORE)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); } } - void JustDied(Unit* victim) + void JustDied(Unit* killer) { - hyjal_trashAI::JustDied(victim); + hyjal_trashAI::JustDied(killer); if (instance && IsEvent) instance->SetData(DATA_ANETHERONEVENT, DONE); DoPlaySoundToSet(me, SOUND_ONDEATH); @@ -248,9 +245,9 @@ public: struct mob_towering_infernalAI : public ScriptedAI { - mob_towering_infernalAI(Creature* c) : ScriptedAI(c) + mob_towering_infernalAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); if (instance) AnetheronGUID = instance->GetData64(DATA_ANETHERON); } @@ -275,7 +272,7 @@ public: { } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp index a5239e5a649..f07aaaa1f2a 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp @@ -86,9 +86,9 @@ public: struct mob_ancient_wispAI : public ScriptedAI { - mob_ancient_wispAI(Creature* c) : ScriptedAI(c) + mob_ancient_wispAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); ArchimondeGUID = 0; } @@ -108,13 +108,16 @@ public: void EnterCombat(Unit* /*who*/) {} - void DamageTaken(Unit* /*done_by*/, uint32 &damage) { damage = 0; } + void DamageTaken(Unit* /*done_by*/, uint32 &damage) + { + damage = 0; + } void UpdateAI(const uint32 diff) { if (CheckTimer <= diff) { - if (Unit* Archimonde = Unit::GetUnit((*me), ArchimondeGUID)) + if (Unit* Archimonde = Unit::GetUnit(*me, ArchimondeGUID)) { if (Archimonde->HealthBelowPct(2) || !Archimonde->isAlive()) DoCast(me, SPELL_DENOUEMENT_WISP); @@ -142,15 +145,18 @@ public: struct mob_doomfireAI : public ScriptedAI { - mob_doomfireAI(Creature* c) : ScriptedAI(c) {} + mob_doomfireAI(Creature* creature) : ScriptedAI(creature) {} void Reset() { } void MoveInLineOfSight(Unit* /*who*/) {} void EnterCombat(Unit* /*who*/) {} - void DamageTaken(Unit* /*done_by*/, uint32 &damage) { damage = 0; } - }; + void DamageTaken(Unit* /*done_by*/, uint32 &damage) + { + damage = 0; + } + }; }; /* This is the script for the Doomfire Spirit Mob. This mob simply follow players or @@ -167,7 +173,7 @@ public: struct mob_doomfire_targettingAI : public ScriptedAI { - mob_doomfire_targettingAI(Creature* c) : ScriptedAI(c) {} + mob_doomfire_targettingAI(Creature* creature) : ScriptedAI(creature) {} uint64 TargetGUID; uint32 ChangeTargetTimer; @@ -188,7 +194,10 @@ public: void EnterCombat(Unit* /*who*/) {} - void DamageTaken(Unit* /*done_by*/, uint32 &damage) { damage = 0; } + void DamageTaken(Unit* /*done_by*/, uint32 &damage) + { + damage = 0; + } void UpdateAI(const uint32 diff) { @@ -233,9 +242,9 @@ public: struct boss_archimondeAI : public hyjal_trashAI { - boss_archimondeAI(Creature* c) : hyjal_trashAI(c) + boss_archimondeAI(Creature* creature) : hyjal_trashAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -334,9 +343,9 @@ public: ++SoulChargeCount; } - void JustDied(Unit* victim) + void JustDied(Unit* killer) { - hyjal_trashAI::JustDied(victim); + hyjal_trashAI::JustDied(killer); DoScriptText(SAY_DEATH, me); if (instance) @@ -358,7 +367,7 @@ public: std::list::const_iterator itr = m_threatlist.begin(); for (; itr != m_threatlist.end(); ++itr) { - Unit* unit = Unit::GetUnit((*me), (*itr)->getUnitGuid()); + Unit* unit = Unit::GetUnit(*me, (*itr)->getUnitGuid()); if (unit && unit->isAlive()) targets.push_back(unit); } @@ -635,7 +644,11 @@ public: DoMeleeAttackIfReady(); } - void WaypointReached(uint32 /*i*/){} + + void WaypointReached(uint32 /*waypointId*/) + { + + } }; }; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp index 2885276f2b6..a9e0c866ab9 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp @@ -55,11 +55,10 @@ public: struct boss_azgalorAI : public hyjal_trashAI { - boss_azgalorAI(Creature* c) : hyjal_trashAI(c) + boss_azgalorAI(Creature* creature) : hyjal_trashAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); go = false; - pos = 0; } uint32 RainTimer; @@ -70,7 +69,6 @@ public: bool enraged; bool go; - uint32 pos; void Reset() { @@ -113,20 +111,19 @@ public: } } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - pos = i; - if (i == 7 && instance) + if (waypointId == 7 && instance) { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_THRALL)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); } } - void JustDied(Unit* victim) + void JustDied(Unit* killer) { - hyjal_trashAI::JustDied(victim); + hyjal_trashAI::JustDied(killer); if (instance && IsEvent) instance->SetData(DATA_AZGALOREVENT, DONE); DoPlaySoundToSet(me, SOUND_ONDEATH); @@ -215,9 +212,9 @@ public: struct mob_lesser_doomguardAI : public hyjal_trashAI { - mob_lesser_doomguardAI(Creature* c) : hyjal_trashAI(c) + mob_lesser_doomguardAI(Creature* creature) : hyjal_trashAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); if (instance) AzgalorGUID = instance->GetData64(DATA_AZGALOR); } @@ -244,7 +241,7 @@ public: { } - void WaypointReached(uint32 /*i*/) + void WaypointReached(uint32 /*waypointId*/) { } @@ -254,7 +251,7 @@ public: AttackStart(who); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp index 7d1b292fd12..407faa19eaa 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp @@ -52,11 +52,10 @@ public: struct boss_kazrogalAI : public hyjal_trashAI { - boss_kazrogalAI(Creature* c) : hyjal_trashAI(c) + boss_kazrogalAI(Creature* creature) : hyjal_trashAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); go = false; - pos = 0; } uint32 CleaveTimer; @@ -64,7 +63,6 @@ public: uint32 MarkTimer; uint32 MarkTimerBase; bool go; - uint32 pos; void Reset() { @@ -105,20 +103,19 @@ public: } } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - pos = i; - if (i == 7 && instance) + if (waypointId == 7 && instance) { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_THRALL)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); } } - void JustDied(Unit* victim) + void JustDied(Unit* killer) { - hyjal_trashAI::JustDied(victim); + hyjal_trashAI::JustDied(killer); if (instance && IsEvent) instance->SetData(DATA_KAZROGALEVENT, DONE); DoPlaySoundToSet(me, SOUND_ONDEATH); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp index 3f39b61192a..5d7ee1fe194 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp @@ -58,11 +58,10 @@ public: struct boss_rage_winterchillAI : public hyjal_trashAI { - boss_rage_winterchillAI(Creature* c) : hyjal_trashAI(c) + boss_rage_winterchillAI(Creature* creature) : hyjal_trashAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); go = false; - pos = 0; } uint32 FrostArmorTimer; @@ -70,7 +69,6 @@ public: uint32 NovaTimer; uint32 IceboltTimer; bool go; - uint32 pos; void Reset() { @@ -107,20 +105,19 @@ public: } } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - pos = i; - if (i == 7 && instance) + if (waypointId == 7 && instance) { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_JAINAPROUDMOORE)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_JAINAPROUDMOORE)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); } } - void JustDied(Unit* victim) + void JustDied(Unit* killer) { - hyjal_trashAI::JustDied(victim); + hyjal_trashAI::JustDied(killer); if (instance && IsEvent) instance->SetData(DATA_RAGEWINTERCHILLEVENT, DONE); DoPlaySoundToSet(me, SOUND_ONDEATH); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp index 12485293650..22307468f14 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp @@ -50,11 +50,11 @@ class npc_jaina_proudmoore : public CreatureScript public: npc_jaina_proudmoore() : CreatureScript("npc_jaina_proudmoore") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); hyjalAI* ai = CAST_AI(hyjalAI, creature->AI()); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: ai->StartEvent(player); @@ -126,12 +126,12 @@ class npc_thrall : public CreatureScript public: npc_thrall() : CreatureScript("npc_thrall") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); hyjalAI* ai = CAST_AI(hyjalAI, creature->AI()); ai->DeSpawnVeins();//despawn the alliance veins - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: ai->StartEvent(player); @@ -212,10 +212,10 @@ public: return ai; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF) + if (action == GOSSIP_ACTION_INFO_DEF) { ItemPosCountVec dest; uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_TEAR_OF_GODDESS, 1); @@ -226,7 +226,6 @@ public: player->SendNewItem(item, 1, true, false, true); } player->SEND_GOSSIP_MENU(907, creature->GetGUID()); - CAST_AI(hyjalAI, creature->AI()); } return true; } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp index 107c9e8f2f9..2f6bbb7edb5 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp @@ -310,9 +310,9 @@ float HordeFirePos[65][8]=//spawn points for the fire visuals (GO) in the horde {5545.43f, -2647.82f, 1483.05f, 5.38848f, 0, 0, 0.432578f, -0.901596f} }; -hyjalAI::hyjalAI(Creature* c) : npc_escortAI(c), Summons(me) +hyjalAI::hyjalAI(Creature* creature) : npc_escortAI(creature), Summons(me) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); VeinsSpawned[0] = false; VeinsSpawned[1] = false; for (uint8 i=0; i<14; ++i) @@ -492,7 +492,7 @@ void hyjalAI::SummonCreature(uint32 entry, float Base[4][3]) // Increment Enemy Count to be used in World States and instance script ++EnemyCount; - creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + creature->SetWalk(false); creature->setActive(true); switch (entry) { @@ -855,7 +855,7 @@ void hyjalAI::UpdateAI(const uint32 diff) { if (BossGUID[i]) { - Unit* unit = Unit::GetUnit((*me), BossGUID[i]); + Unit* unit = Unit::GetUnit(*me, BossGUID[i]); if (unit && (!unit->isAlive())) { if (BossGUID[i] == BossGUID[0]) @@ -896,9 +896,17 @@ void hyjalAI::UpdateAI(const uint32 diff) switch (Spells[i].TargetType) { - case TARGETTYPE_SELF: target = me; break; - case TARGETTYPE_RANDOM: target = SelectTarget(SELECT_TARGET_RANDOM, 0); break; - case TARGETTYPE_VICTIM: target = me->getVictim(); break; + case TARGETTYPE_SELF: + target = me; + break; + + case TARGETTYPE_RANDOM: + target = SelectTarget(SELECT_TARGET_RANDOM, 0); + break; + + case TARGETTYPE_VICTIM: + target = me->getVictim(); + break; } if (target && target->isAlive()) @@ -972,9 +980,9 @@ void hyjalAI::RespawnNearPos(float x, float y) cell.Visit(p, obj_worker, *me->GetMap(), *me, me->GetGridActivationRange()); } -void hyjalAI::WaypointReached(uint32 i) +void hyjalAI::WaypointReached(uint32 waypointId) { - if (i == 1 || (i == 0 && me->GetEntry() == THRALL)) + if (waypointId == 1 || (waypointId == 0 && me->GetEntry() == THRALL)) { me->MonsterYell(YELL_HURRY, 0, 0); WaitForTeleport = true; @@ -983,7 +991,7 @@ void hyjalAI::WaypointReached(uint32 i) DoCast(me, SPELL_MASS_TELEPORT, false); if (me->GetEntry() == THRALL && DummyGuid) { - Unit* Dummy = Unit::GetUnit((*me), DummyGuid); + Unit* Dummy = Unit::GetUnit(*me, DummyGuid); if (Dummy) { CAST_AI(hyjalAI, CAST_CRE(Dummy)->AI())->DoMassTeleport = true; @@ -1014,7 +1022,7 @@ void hyjalAI::WaypointReached(uint32 i) if ((*itr) && (*itr)->isAlive() && (*itr) != me && (*itr)->GetEntry() != JAINA) { if (!(*itr)->IsWithinDist(me, 60)) - (*itr)->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + (*itr)->SetWalk(false); float x, y, z; (*itr)->SetDefaultMovementType(IDLE_MOTION_TYPE); (*itr)->GetMotionMaster()->Initialize(); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h index d91c2ead123..b32288ca43a 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.h @@ -171,7 +171,7 @@ const Yells ThrallQuotes[]= struct hyjalAI : public npc_escortAI { - hyjalAI(Creature* c); + hyjalAI(Creature* creature); void Reset(); // Generically used to reset our variables. Do *not* call in EnterEvadeMode as this may make problems if the raid is still in combat @@ -196,7 +196,7 @@ struct hyjalAI : public npc_escortAI void SummonedCreatureDespawn(Creature* summoned); void HideNearPos(float x, float y); void RespawnNearPos(float x, float y); - void WaypointReached(uint32 i); + void WaypointReached(uint32 waypointId); void DoOverrun(uint32 faction, const uint32 diff); void MoveInLineOfSight(Unit* who); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp index c94cb874bfa..840aa5de081 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp @@ -155,9 +155,9 @@ float HordeOverrunWP[21][3]=//waypoints in the horde base used in the end in the {5429.91f, -2718.44f, 1493.42f}//20 end 2 }; -hyjal_trashAI::hyjal_trashAI(Creature* c) : npc_escortAI(c) +hyjal_trashAI::hyjal_trashAI(Creature* creature) : npc_escortAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); IsEvent = false; Delay = 0; LastOverronPos = 0; @@ -377,10 +377,11 @@ void hyjal_trashAI::UpdateAI(const uint32 /*diff*/) } } -void hyjal_trashAI::JustDied(Unit* /*victim*/) +void hyjal_trashAI::JustDied(Unit* /*killer*/) { if (!instance) return; + if (IsEvent && !me->isWorldBoss()) instance->SetData(DATA_TRASH, 0);//signal trash is dead @@ -395,9 +396,9 @@ public: struct mob_giant_infernalAI : public hyjal_trashAI { - mob_giant_infernalAI(Creature* c) : hyjal_trashAI(c) + mob_giant_infernalAI(Creature* creature) : hyjal_trashAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); meteor = false;//call once! CanMove = false; Delay = rand()%30000; @@ -405,7 +406,6 @@ public: me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetDisplayId(MODEL_INVIS); go = false; - pos = 0; Reset(); } @@ -413,7 +413,6 @@ public: bool CanMove; bool WpEnabled; bool go; - uint32 pos; uint32 spawnTimer; uint32 FlameBuffetTimer; bool imol; @@ -427,14 +426,13 @@ public: void EnterCombat(Unit* /*who*/) {} - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - pos = i; - if (i == 0 && instance && !IsOverrun) + if (waypointId == 0 && instance && !IsOverrun) { if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_THRALL)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); } @@ -459,7 +457,7 @@ public: { trigger->SetVisible(false); trigger->setFaction(me->getFaction()); - trigger->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + trigger->SetDisableGravity(true); trigger->CastSpell(me, SPELL_METEOR, true); } me->GetMotionMaster()->Clear(); @@ -475,7 +473,7 @@ public: { if (instance->GetData(DATA_ALLIANCE_RETREAT) && !instance->GetData(DATA_HORDE_RETREAT)) { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_THRALL)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); } else if (instance->GetData(DATA_ALLIANCE_RETREAT) && instance->GetData(DATA_HORDE_RETREAT)){ @@ -539,39 +537,38 @@ public: struct mob_abominationAI : public hyjal_trashAI { - mob_abominationAI(Creature* c) : hyjal_trashAI(c) + mob_abominationAI(Creature* creature) : hyjal_trashAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); go = false; - pos = 0; Reset(); } bool go; uint32 KnockDownTimer; - uint32 pos; void Reset() { KnockDownTimer = 10000; } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - pos = i; - if (i == 7 && instance && !IsOverrun) + if (waypointId == 7 && instance && !IsOverrun) { if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_THRALL)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); - }else{ - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_JAINAPROUDMOORE)); + } + else + { + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_JAINAPROUDMOORE)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); } } - if (i == LastOverronPos && IsOverrun) + if (waypointId == LastOverronPos && IsOverrun) { if ((faction == 0 && LastOverronPos == 17) || (faction == 1 && LastOverronPos == 21)) { @@ -640,17 +637,15 @@ public: struct mob_ghoulAI : public hyjal_trashAI { - mob_ghoulAI(Creature* c) : hyjal_trashAI(c) + mob_ghoulAI(Creature* creature) : hyjal_trashAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); go = false; - pos = 0; Reset(); } bool go; uint32 FrenzyTimer; - uint32 pos; uint32 MoveTimer; bool RandomMove; void Reset() @@ -660,23 +655,24 @@ public: RandomMove = false; } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - pos = i; - if (i == 7 && instance && !IsOverrun) + if (waypointId == 7 && instance && !IsOverrun) { if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_THRALL)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); - }else{ - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_JAINAPROUDMOORE)); + } + else + { + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_JAINAPROUDMOORE)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); } } - if (i == LastOverronPos && IsOverrun) + if (waypointId == LastOverronPos && IsOverrun) { me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_ATTACK_UNARMED); if ((faction == 0 && LastOverronPos == 17) || (faction == 1 && LastOverronPos == 21)) @@ -684,7 +680,6 @@ public: me->setDeathState(DEAD); me->RemoveCorpse(); } - } } @@ -749,17 +744,17 @@ public: struct mob_necromancerAI : public hyjal_trashAI { - mob_necromancerAI(Creature* c) : hyjal_trashAI(c), summons(me) + mob_necromancerAI(Creature* creature) : hyjal_trashAI(creature), summons(me) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); go = false; - pos = 0; Reset(); } + SummonList summons; bool go; uint32 ShadowBoltTimer; - uint32 pos; + void Reset() { ShadowBoltTimer = 1000+rand()%5000; @@ -773,19 +768,25 @@ public: summon->Attack(target, false); summons.Summon(summon); } - void SummonedCreatureDespawn(Creature* summon) {summons.Despawn(summon);} - void WaypointReached(uint32 i) + + void SummonedCreatureDespawn(Creature* summon) { - pos = i; - if (i == 7 && instance && !IsOverrun) + summons.Despawn(summon); + } + + void WaypointReached(uint32 waypointId) + { + if (waypointId == 7 && instance && !IsOverrun) { if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_THRALL)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); - }else{ - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_JAINAPROUDMOORE)); + } + else + { + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_JAINAPROUDMOORE)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); } @@ -815,8 +816,10 @@ public: void UpdateAI(const uint32 diff) { hyjal_trashAI::UpdateAI(diff); + if (IsEvent || IsOverrun) npc_escortAI::UpdateAI(diff); + if (IsEvent) { if (!go) @@ -840,8 +843,10 @@ public: } } } + if (!UpdateVictim()) return; + if (ShadowBoltTimer <= diff) { DoCast(me->getVictim(), SPELL_SHADOW_BOLT); @@ -870,11 +875,10 @@ public: struct mob_bansheeAI : public hyjal_trashAI { - mob_bansheeAI(Creature* c) : hyjal_trashAI(c) + mob_bansheeAI(Creature* creature) : hyjal_trashAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); go = false; - pos = 0; Reset(); } @@ -882,7 +886,7 @@ public: uint32 CourseTimer; uint32 WailTimer; uint32 ShellTimer; - uint32 pos; + void Reset() { CourseTimer = 20000+rand()%5000; @@ -890,18 +894,19 @@ public: ShellTimer = 50000+rand()%10000; } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - pos = i; - if (i == 7 && instance && !IsOverrun) + if (waypointId == 7 && instance && !IsOverrun) { if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_THRALL)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); - }else{ - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_JAINAPROUDMOORE)); + } + else + { + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_JAINAPROUDMOORE)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); } @@ -975,34 +980,34 @@ public: struct mob_crypt_fiendAI : public hyjal_trashAI { - mob_crypt_fiendAI(Creature* c) : hyjal_trashAI(c) + mob_crypt_fiendAI(Creature* creature) : hyjal_trashAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); go = false; - pos = 0; Reset(); } bool go; uint32 WebTimer; - uint32 pos; + void Reset() { WebTimer = 20000+rand()%5000; } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - pos = i; - if (i == 7 && instance && !IsOverrun) + if (waypointId == 7 && instance && !IsOverrun) { if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_THRALL)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); - }else{ - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_JAINAPROUDMOORE)); + } + else + { + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_JAINAPROUDMOORE)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); } @@ -1067,34 +1072,34 @@ public: struct mob_fel_stalkerAI : public hyjal_trashAI { - mob_fel_stalkerAI(Creature* c) : hyjal_trashAI(c) + mob_fel_stalkerAI(Creature* creature) : hyjal_trashAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); go = false; - pos = 0; Reset(); } bool go; uint32 ManaBurnTimer; - uint32 pos; + void Reset() { ManaBurnTimer = 9000+rand()%5000; } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - pos = i; - if (i == 7 && instance && !IsOverrun) + if (waypointId == 7 && instance && !IsOverrun) { if (instance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_THRALL)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); - }else{ - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_JAINAPROUDMOORE)); + } + else + { + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_JAINAPROUDMOORE)); if (target && target->isAlive()) me->AddThreat(target, 0.0f); } @@ -1159,32 +1164,29 @@ public: struct mob_frost_wyrmAI : public hyjal_trashAI { - mob_frost_wyrmAI(Creature* c) : hyjal_trashAI(c) + mob_frost_wyrmAI(Creature* creature) : hyjal_trashAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); go = false; - pos = 0; Reset(); } bool go; uint32 FrostBreathTimer; - uint32 pos; uint32 MoveTimer; void Reset() { FrostBreathTimer = 5000; MoveTimer = 0; - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetDisableGravity(true); } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - pos = i; - if (i == 2 && instance && !IsOverrun) + if (waypointId == 2 && instance && !IsOverrun) { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_THRALL)); if (target && target->isAlive()) { me->AddThreat(target, 0.0f); @@ -1193,7 +1195,7 @@ public: } } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { if (instance && IsEvent) instance->SetData(DATA_TRASH, 0);//signal trash is dead @@ -1276,18 +1278,16 @@ public: struct mob_gargoyleAI : public hyjal_trashAI { - mob_gargoyleAI(Creature* c) : hyjal_trashAI(c) + mob_gargoyleAI(Creature* creature) : hyjal_trashAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); go = false; - pos = 0; DummyTarget[0] = 0;DummyTarget[1] = 0;DummyTarget[2] = 0; Reset(); } bool go; uint32 StrikeTimer; - uint32 pos; uint32 MoveTimer; float Zpos; bool forcemove; @@ -1298,15 +1298,14 @@ public: Zpos = 10.0f; StrikeTimer = 2000+rand()%5000; MoveTimer = 0; - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetDisableGravity(true); } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - pos = i; - if (i == 2 && instance && !IsOverrun) + if (waypointId == 2 && instance && !IsOverrun) { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_THRALL)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_THRALL)); if (target && target->isAlive()) { me->AddThreat(target, 0.0f); @@ -1315,14 +1314,14 @@ public: } } - void JustDied(Unit* victim) + void JustDied(Unit* killer) { float x, y, z; me->GetPosition(x, y, z); z = me->GetMap()->GetHeight(me->GetPhaseMask(), x, y, z); me->GetMotionMaster()->MovePoint(0, x, y, z); me->SetPosition(x, y, z, 0); - hyjal_trashAI::JustDied(victim); + hyjal_trashAI::JustDied(killer); } void UpdateAI(const uint32 diff) @@ -1382,8 +1381,9 @@ public: float x, y, z; me->getVictim()->GetPosition(x, y, z); me->GetMotionMaster()->MovePoint(0, x, y, z+Zpos); - Zpos-=1.0f; - if (Zpos <= 0)Zpos=0; + Zpos -= 1.0f; + if (Zpos <= 0) + Zpos = 0; MoveTimer = 2000; } else MoveTimer-=diff; } @@ -1416,14 +1416,14 @@ public: struct alliance_riflemanAI : public Scripted_NoMovementAI { - alliance_riflemanAI(Creature* c) : Scripted_NoMovementAI(c) + alliance_riflemanAI(Creature* creature) : Scripted_NoMovementAI(creature) { Reset(); } uint32 ExplodeTimer; - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.h b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.h index 047c0dc308e..cb994167641 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.h +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.h @@ -25,7 +25,7 @@ struct hyjal_trashAI : public npc_escortAI { - hyjal_trashAI(Creature* c); + hyjal_trashAI(Creature* creature); void UpdateAI(const uint32 diff); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp index b87379d599f..ad8ebdb370a 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp @@ -110,7 +110,8 @@ public: bool IsEncounterInProgress() const { for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; + if (m_auiEncounter[i] == IN_PROGRESS) + return true; return false; } @@ -175,17 +176,23 @@ public: { switch (type) { - case DATA_RAGEWINTERCHILLEVENT: m_auiEncounter[0] = data; break; + case DATA_RAGEWINTERCHILLEVENT: + m_auiEncounter[0] = data; + break; case DATA_ANETHERONEVENT: m_auiEncounter[1] = data; break; - case DATA_KAZROGALEVENT: m_auiEncounter[2] = data; break; + case DATA_KAZROGALEVENT: + m_auiEncounter[2] = data; + break; case DATA_AZGALOREVENT: { m_auiEncounter[3] = data; if (data == DONE) { - if (ArchiYell)break; + if (ArchiYell) + break; + ArchiYell = true; Creature* creature = instance->GetCreature(Azgalor); @@ -219,12 +226,17 @@ public: } } break; - case DATA_ARCHIMONDEEVENT: m_auiEncounter[4] = data; break; - case DATA_RESET_TRASH_COUNT: Trash = 0; break; - + case DATA_ARCHIMONDEEVENT: + m_auiEncounter[4] = data; + break; + case DATA_RESET_TRASH_COUNT: + Trash = 0; + break; case DATA_TRASH: - if (data) Trash = data; - else Trash--; + if (data) + Trash = data; + else + Trash--; DoUpdateWorldState(WORLD_STATE_ENEMYCOUNT, Trash); break; case TYPE_RETREAT: diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_epoch.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_epoch.cpp index 35c1848456b..b2853f25a33 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_epoch.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_epoch.cpp @@ -60,9 +60,9 @@ public: struct boss_epochAI : public ScriptedAI { - boss_epochAI(Creature* c) : ScriptedAI(c) + boss_epochAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint8 uiStep; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite.cpp index 7947c9be48d..ccf60f9bd0b 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite.cpp @@ -43,9 +43,9 @@ public: struct boss_infinite_corruptorAI : public ScriptedAI { - boss_infinite_corruptorAI(Creature* c) : ScriptedAI(c) + boss_infinite_corruptorAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp index b61838a253a..a038a06f815 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp @@ -77,9 +77,9 @@ public: struct boss_mal_ganisAI : public ScriptedAI { - boss_mal_ganisAI(Creature* c) : ScriptedAI(c) + boss_mal_ganisAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiCarrionSwarmTimer; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_meathook.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_meathook.cpp index c36b98ed510..d5dd597960f 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_meathook.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_meathook.cpp @@ -57,9 +57,9 @@ public: struct boss_meathookAI : public ScriptedAI { - boss_meathookAI(Creature* c) : ScriptedAI(c) + boss_meathookAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); if (instance) DoScriptText(SAY_SPAWN, me); } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm.cpp index 7a5e0d06158..7828d172e1e 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm.cpp @@ -66,9 +66,9 @@ public: struct boss_salrammAI : public ScriptedAI { - boss_salrammAI(Creature* c) : ScriptedAI(c) + boss_salrammAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); if (instance) DoScriptText(SAY_SPAWN, me); } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp index 9518abd1635..6454083e424 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp @@ -446,9 +446,9 @@ public: ++uiStep; } - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { - switch (uiPointId) + switch (waypointId) { case 0: case 1: @@ -591,11 +591,11 @@ public: } //After waypoint 0 case 1: - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); if (Unit* pUther = me->SummonCreature(NPC_UTHER, 1794.357f, 1272.183f, 140.558f, 1.37f, TEMPSUMMON_DEAD_DESPAWN, 180000)) { uiUtherGUID = pUther->GetGUID(); - pUther->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + pUther->SetWalk(false); pUther->GetMotionMaster()->MovePoint(0, 1897.018f, 1287.487f, 143.481f); pUther->SetTarget(me->GetGUID()); me->SetTarget(uiUtherGUID); @@ -680,7 +680,7 @@ public: case 17: if (Creature* pUther = Unit::GetCreature(*me, uiUtherGUID)) { - pUther->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + pUther->SetWalk(true); pUther->GetMotionMaster()->MovePoint(0, 1794.357f, 1272.183f, 140.558f); } JumpToNextStep(1000); @@ -689,7 +689,7 @@ public: if (Creature* pJaina = Unit::GetCreature(*me, uiJainaGUID)) { me->SetTarget(uiJainaGUID); - pJaina->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + pJaina->SetWalk(true); pJaina->GetMotionMaster()->MovePoint(0, 1794.357f, 1272.183f, 140.558f); } JumpToNextStep(1000); @@ -755,7 +755,7 @@ public: if (Creature* pCityman = Unit::GetCreature(*me, uiCitymenGUID[0])) { pCityman->SetTarget(me->GetGUID()); - pCityman->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + pCityman->SetWalk(true); pCityman->GetMotionMaster()->MovePoint(0, 2088.625f, 1279.191f, 140.743f); } JumpToNextStep(2000); @@ -929,7 +929,7 @@ public: if (Unit* pBoss = me->SummonCreature(uiBossID, 2232.19f, 1331.933f, 126.662f, 3.15f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 900000)) { uiBossGUID = pBoss->GetGUID(); - pBoss->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + pBoss->SetWalk(true); pBoss->GetMotionMaster()->MovePoint(0, 2194.110f, 1332.00f, 130.00f); } } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp index 9a91e1e232b..b232cae4657 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp @@ -16,6 +16,7 @@ */ #include "ScriptPCH.h" +#include "CreatureTextMgr.h" #include "culling_of_stratholme.h" #define MAX_ENCOUNTER 5 diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_aeonus.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_aeonus.cpp index b895b56379c..5b47c2ee07d 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_aeonus.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_aeonus.cpp @@ -55,9 +55,9 @@ public: struct boss_aeonusAI : public ScriptedAI { - boss_aeonusAI(Creature* c) : ScriptedAI(c) + boss_aeonusAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -93,7 +93,7 @@ public: ScriptedAI::MoveInLineOfSight(who); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_chrono_lord_deja.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_chrono_lord_deja.cpp index 99e43495c96..a4e805b3b75 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_chrono_lord_deja.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_chrono_lord_deja.cpp @@ -55,9 +55,9 @@ public: struct boss_chrono_lord_dejaAI : public ScriptedAI { - boss_chrono_lord_dejaAI(Creature* c) : ScriptedAI(c) + boss_chrono_lord_dejaAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -100,7 +100,7 @@ public: DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_temporus.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_temporus.cpp index 9b272491717..f59c9f0ef4c 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_temporus.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_temporus.cpp @@ -54,9 +54,9 @@ public: struct boss_temporusAI : public ScriptedAI { - boss_temporusAI(Creature* c) : ScriptedAI(c) + boss_temporusAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -84,7 +84,7 @@ public: DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp index 4ff34fc3349..c2a41cb29d1 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp @@ -68,9 +68,9 @@ public: struct npc_medivh_bmAI : public ScriptedAI { - npc_medivh_bmAI(Creature* c) : ScriptedAI(c) + npc_medivh_bmAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -111,7 +111,7 @@ public: instance->SetData(TYPE_MEDIVH, IN_PROGRESS); DoCast(me, SPELL_CHANNEL, false); Check_Timer = 5000; - } + } else if (who->GetTypeId() == TYPEID_UNIT && me->IsWithinDistInMap(who, 15.0f)) { if (instance->GetData(TYPE_MEDIVH) != IN_PROGRESS) @@ -153,9 +153,9 @@ public: SpellCorrupt_Timer = 3000; } - void JustDied(Unit* Killer) + void JustDied(Unit* killer) { - if (Killer->GetEntry() == me->GetEntry()) + if (killer->GetEntry() == me->GetEntry()) return; DoScriptText(SAY_DEATH, me); @@ -170,7 +170,7 @@ public: { if (SpellCorrupt_Timer <= diff) { - instance->SetData(TYPE_MEDIVH, SPECIAL); + instance->SetData(TYPE_MEDIVH, SPECIAL); if (me->HasAura(SPELL_CORRUPT_AEONUS)) SpellCorrupt_Timer = 1000; @@ -261,9 +261,9 @@ public: struct npc_time_riftAI : public ScriptedAI { - npc_time_riftAI(Creature* c) : ScriptedAI(c) + npc_time_riftAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -318,11 +318,11 @@ public: void DoSelectSummon() { - uint32 entry = 0; - if ((mRiftWaveCount > 2 && mWaveId < 1) || mRiftWaveCount > 3) mRiftWaveCount = 0; + uint32 entry = 0; + entry = PortalWaves[mWaveId].PortalMob[mRiftWaveCount]; sLog->outDebug(LOG_FILTER_TSCR, "TSCR: npc_time_rift: summoning wave Creature (Wave %u, Entry %u).", mRiftWaveCount, entry); @@ -370,10 +370,10 @@ class npc_saat : public CreatureScript public: npc_saat() : CreatureScript("npc_saat") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { player->CLOSE_GOSSIP_MENU(); creature->CastSpell(player, SPELL_CHRONO_BEACON, false); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/instance_dark_portal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/instance_dark_portal.cpp index dabf3db13cb..2c8cd096644 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/instance_dark_portal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/instance_dark_portal.cpp @@ -116,9 +116,9 @@ public: DoUpdateWorldState(WORLD_STATE_BM_RIFT, 0); } - bool IsEncounterInProgress() + bool IsEncounterInProgress() const { - if (GetData(TYPE_MEDIVH) == IN_PROGRESS) + if (const_cast(this)->GetData(TYPE_MEDIVH) == IN_PROGRESS) return true; return false; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp index 89877f2cc7b..c27507cdcec 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp @@ -52,9 +52,9 @@ public: struct boss_captain_skarlocAI : public ScriptedAI { - boss_captain_skarlocAI(Creature* c) : ScriptedAI(c) + boss_captain_skarlocAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -88,7 +88,7 @@ public: DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp index 8307eb44013..82bd0a9e9be 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp @@ -54,9 +54,9 @@ public: struct boss_epoch_hunterAI : public ScriptedAI { - boss_epoch_hunterAI(Creature* c) : ScriptedAI(c) + boss_epoch_hunterAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -84,7 +84,7 @@ public: DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp index 1f0ba93645f..45825a81eb2 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp @@ -36,9 +36,9 @@ class go_barrel_old_hillsbrad : public GameObjectScript public: go_barrel_old_hillsbrad() : GameObjectScript("go_barrel_old_hillsbrad") { } - bool OnGossipHello(Player* /*player*/, GameObject* pGO) + bool OnGossipHello(Player* /*player*/, GameObject* go) { - if (InstanceScript* instance = pGO->GetInstanceScript()) + if (InstanceScript* instance = go->GetInstanceScript()) { if (instance->GetData(TYPE_BARREL_DIVERSION) == DONE) return false; @@ -111,7 +111,7 @@ public: struct boss_lieutenant_drakeAI : public ScriptedAI { - boss_lieutenant_drakeAI(Creature* c) : ScriptedAI(c) {} + boss_lieutenant_drakeAI(Creature* creature) : ScriptedAI(creature) {} bool CanPatrol; uint32 wpId; @@ -142,7 +142,7 @@ public: DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp index aa57b3d9499..7d9da6771dc 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp @@ -51,10 +51,10 @@ class npc_erozion : public CreatureScript public: npc_erozion() : CreatureScript("npc_erozion") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { ItemPosCountVec dest; uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_ENTRY_BOMBS, 1); @@ -64,7 +64,7 @@ public: } player->SEND_GOSSIP_MENU(9515, creature->GetGUID()); } - if (uiAction == GOSSIP_ACTION_INFO_DEF+2) + if (action == GOSSIP_ACTION_INFO_DEF+2) { player->CLOSE_GOSSIP_MENU(); } @@ -198,11 +198,11 @@ public: return new npc_thrall_old_hillsbradAI(creature); } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); InstanceScript* instance = creature->GetInstanceScript(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->CLOSE_GOSSIP_MENU(); @@ -282,9 +282,9 @@ public: struct npc_thrall_old_hillsbradAI : public npc_escortAI { - npc_thrall_old_hillsbradAI(Creature* c) : npc_escortAI(c) + npc_thrall_old_hillsbradAI(Creature* creature) : npc_escortAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); HadMount = false; me->setActive(true); } @@ -296,12 +296,12 @@ public: bool LowHp; bool HadMount; - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { if (!instance) return; - switch (i) + switch (waypointId) { case 8: SetRun(false); @@ -401,7 +401,7 @@ public: SetRun(); break; case 91: - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); SetRun(false); break; case 93: @@ -413,7 +413,7 @@ public: case 94: if (uint64 TarethaGUID = instance->GetData64(DATA_TARETHA)) { - if (Unit* Taretha = Unit::GetUnit((*me), TarethaGUID)) + if (Unit* Taretha = Unit::GetUnit(*me, TarethaGUID)) DoScriptText(SAY_TA_ESCAPED, Taretha, me); } break; @@ -433,7 +433,6 @@ public: //trigger epoch Yell("Thrall! Come outside and face your fate! ....") //from here, thrall should not never be allowed to move to point 106 which he currently does. break; - case 106: { //trigger taretha to run down outside @@ -581,16 +580,16 @@ public: return new npc_tarethaAI(creature); } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); InstanceScript* instance = creature->GetInstanceScript(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_EPOCH2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); player->SEND_GOSSIP_MENU(GOSSIP_ID_EPOCH2, creature->GetGUID()); } - if (uiAction == GOSSIP_ACTION_INFO_DEF+2) + if (action == GOSSIP_ACTION_INFO_DEF+2) { player->CLOSE_GOSSIP_MENU(); @@ -624,16 +623,16 @@ public: struct npc_tarethaAI : public npc_escortAI { - npc_tarethaAI(Creature* c) : npc_escortAI(c) + npc_tarethaAI(Creature* creature) : npc_escortAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - switch (i) + switch (waypointId) { case 6: DoScriptText(SAY_TA_FREE, me); @@ -643,6 +642,7 @@ public: break; } } + void Reset() {} void EnterCombat(Unit* /*who*/) {} diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp index 38d9ce31563..d7043965271 100644 --- a/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp +++ b/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp @@ -59,7 +59,7 @@ public: void EnterCombat(Unit* /*who*/) { } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { me->SummonCreature(13716, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 600000); } diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp index 3b42fc3ed7b..6e6e089ba02 100644 --- a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp +++ b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp @@ -114,11 +114,11 @@ public: { boss_onyxiaAI(Creature* creature) : ScriptedAI(creature), Summons(me) { - m_instance = creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); Reset(); } - InstanceScript* m_instance; + InstanceScript* instance; SummonList Summons; uint32 m_uiPhase; @@ -169,11 +169,11 @@ public: m_uiSummonWhelpCount = 0; m_bIsMoving = false; - if (m_instance) + if (instance) { - m_instance->SetData(DATA_ONYXIA, NOT_STARTED); - m_instance->SetData(DATA_ONYXIA_PHASE, m_uiPhase); - m_instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT); + instance->SetData(DATA_ONYXIA, NOT_STARTED); + instance->SetData(DATA_ONYXIA_PHASE, m_uiPhase); + instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT); } } @@ -182,17 +182,17 @@ public: DoScriptText(SAY_AGGRO, me); me->SetInCombatWithZone(); - if (m_instance) + if (instance) { - m_instance->SetData(DATA_ONYXIA, IN_PROGRESS); - m_instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT); + instance->SetData(DATA_ONYXIA, IN_PROGRESS); + instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT); } } void JustDied(Unit* /*killer*/) { - if (m_instance) - m_instance->SetData(DATA_ONYXIA, DONE); + if (instance) + instance->SetData(DATA_ONYXIA, DONE); Summons.DespawnAll(); } @@ -261,12 +261,12 @@ public: m_uiBellowingRoarTimer = 1000; break; case 10: - me->SetFlying(true); + me->SetCanFly(true); me->GetMotionMaster()->MovePoint(11, Phase2Location.GetPositionX(), Phase2Location.GetPositionY(), Phase2Location.GetPositionZ()+25); me->SetSpeed(MOVE_FLIGHT, 1.0f); DoScriptText(SAY_PHASE_2_TRANS, me); - if (m_instance) - m_instance->SetData(DATA_ONYXIA_PHASE, m_uiPhase); + if (instance) + instance->SetData(DATA_ONYXIA_PHASE, m_uiPhase); m_uiWhelpTimer = 5000; m_uiLairGuardTimer = 15000; break; @@ -301,9 +301,9 @@ public: (pSpell->Id >= 22267 && pSpell->Id <= 22268)) && (target->GetTypeId() == TYPEID_PLAYER)) { - if (m_instance) + if (instance) { - m_instance->SetData(DATA_SHE_DEEP_BREATH_MORE, FAIL); + instance->SetData(DATA_SHE_DEEP_BREATH_MORE, FAIL); } } } @@ -362,8 +362,8 @@ public: Trinity::GameObjectInRangeCheck check(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 15); Trinity::GameObjectLastSearcher searcher(me, pFloor, check); me->VisitNearbyGridObject(30, searcher); - if (m_instance && pFloor) - m_instance->SetData64(DATA_FLOOR_ERUPTION_GUID, pFloor->GetGUID()); + if (instance && pFloor) + instance->SetData64(DATA_FLOOR_ERUPTION_GUID, pFloor->GetGUID()); m_uiBellowingRoarTimer = 30000; } else @@ -409,12 +409,12 @@ public: if (HealthBelowPct(40)) { m_uiPhase = PHASE_END; - if (m_instance) - m_instance->SetData(DATA_ONYXIA_PHASE, m_uiPhase); + if (instance) + instance->SetData(DATA_ONYXIA_PHASE, m_uiPhase); DoScriptText(SAY_PHASE_3_TRANS, me); SetCombatMovement(true); - me->SetFlying(false); + me->SetCanFly(false); m_bIsMoving = false; me->GetMotionMaster()->MovePoint(9, me->GetHomePosition()); return; diff --git a/src/server/scripts/Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp b/src/server/scripts/Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp index d0da864809c..bda5267713d 100644 --- a/src/server/scripts/Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp +++ b/src/server/scripts/Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp @@ -48,7 +48,7 @@ public: struct boss_amnennar_the_coldbringerAI : public ScriptedAI { - boss_amnennar_the_coldbringerAI(Creature* c) : ScriptedAI(c) {} + boss_amnennar_the_coldbringerAI(Creature* creature) : ScriptedAI(creature) {} uint32 AmnenarsWrath_Timer; uint32 FrostBolt_Timer; diff --git a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp index ac9bf524e7a..b84ecea4de3 100644 --- a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp +++ b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp @@ -52,16 +52,16 @@ class npc_henry_stern : public CreatureScript public: npc_henry_stern() : CreatureScript("npc_henry_stern") { } - bool OnGossipSelect (Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + if (action == GOSSIP_ACTION_INFO_DEF + 1) { player->CastSpell(player, SPELL_TEACHING_GOLDTHORN_TEA, true); player->SEND_GOSSIP_MENU(GOSSIP_TEXT_TEA_ANSWER, creature->GetGUID()); } - if (uiAction == GOSSIP_ACTION_INFO_DEF + 2) + if (action == GOSSIP_ACTION_INFO_DEF + 2) { player->CastSpell(player, SPELL_TEACHING_MIGHTY_TROLLS_BLOOD_POTION, true); player->SEND_GOSSIP_MENU(GOSSIP_TEXT_POTION_ANSWER, creature->GetGUID()); @@ -70,7 +70,7 @@ public: return true; } - bool OnGossipHello (Player* player, Creature* creature) + bool OnGossipHello(Player* player, Creature* creature) { if (player->GetBaseSkillValue(SKILL_COOKING) >= 175 && !player->HasSpell(SPELL_GOLDTHORN_TEA)) player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TEA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); @@ -81,7 +81,6 @@ public: player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); return true; } - }; /*###### @@ -93,10 +92,10 @@ class go_gong : public GameObjectScript public: go_gong() : GameObjectScript("go_gong") { } - bool OnGossipHello(Player* /*player*/, GameObject* pGO) + bool OnGossipHello(Player* /*player*/, GameObject* go) { //basic support, not blizzlike data is missing... - InstanceScript* instance = pGO->GetInstanceScript(); + InstanceScript* instance = go->GetInstanceScript(); if (instance) { diff --git a/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp b/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp index 1bc0a3b7a19..43e3fe6efdd 100644 --- a/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp +++ b/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp @@ -70,57 +70,56 @@ public: struct npc_willixAI : public npc_escortAI { - npc_willixAI(Creature* c) : npc_escortAI(c) {} + npc_willixAI(Creature* creature) : npc_escortAI(creature) {} - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - switch (i) + switch (waypointId) { - case 3: - me->HandleEmoteCommand(EMOTE_STATE_POINT); - DoScriptText(SAY_POINT, me, player); - break; - case 4: - me->SummonCreature(ENTRY_BOAR, 2137.66f, 1843.98f, 48.08f, 1.54f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - break; - case 8: - DoScriptText(SAY_BLUELEAF, me, player); - break; - case 9: - DoScriptText(SAY_DANGER, me, player); - break; - case 13: - DoScriptText(SAY_BAD, me, player); - break; - case 14: - me->SummonCreature(ENTRY_BOAR, 2078.91f, 1704.54f, 56.77f, 1.54f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - break; - case 25: - DoScriptText(SAY_THINK, me, player); - break; - case 31: - DoScriptText(SAY_SOON, me, player); - break; - case 42: - DoScriptText(SAY_FINALY, me, player); - break; - case 43: - me->SummonCreature(ENTRY_BOAR, 1956.43f, 1596.97f, 81.75f, 1.54f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - break; - case 45: - DoScriptText(SAY_WIN, me, player); - me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); - if (player && player->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(player)->GroupEventHappens(QUEST_WILLIX_THE_IMPORTER, me); - break; - case 46: - DoScriptText(SAY_END, me, player); - break; + case 3: + me->HandleEmoteCommand(EMOTE_STATE_POINT); + DoScriptText(SAY_POINT, me, player); + break; + case 4: + me->SummonCreature(ENTRY_BOAR, 2137.66f, 1843.98f, 48.08f, 1.54f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + break; + case 8: + DoScriptText(SAY_BLUELEAF, me, player); + break; + case 9: + DoScriptText(SAY_DANGER, me, player); + break; + case 13: + DoScriptText(SAY_BAD, me, player); + break; + case 14: + me->SummonCreature(ENTRY_BOAR, 2078.91f, 1704.54f, 56.77f, 1.54f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + break; + case 25: + DoScriptText(SAY_THINK, me, player); + break; + case 31: + DoScriptText(SAY_SOON, me, player); + break; + case 42: + DoScriptText(SAY_FINALY, me, player); + break; + case 43: + me->SummonCreature(ENTRY_BOAR, 1956.43f, 1596.97f, 81.75f, 1.54f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + break; + case 45: + DoScriptText(SAY_WIN, me, player); + me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); + if (player->GetTypeId() == TYPEID_PLAYER) + CAST_PLR(player)->GroupEventHappens(QUEST_WILLIX_THE_IMPORTER, me); + break; + case 46: + DoScriptText(SAY_END, me, player); + break; } } diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp index a290b07e60f..18a77519ba2 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp @@ -147,7 +147,7 @@ class boss_moam : public CreatureScript targetList.push_back((*itr)->getTarget()); } - Trinity::RandomResizeList(targetList, 5); + Trinity::Containers::RandomResizeList(targetList, 5); for (std::list::iterator itr = targetList.begin(); itr != targetList.end(); ++itr) DoCast(*itr, SPELL_DRAIN_MANA); diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp index eaeec50ef7b..36b1871c96e 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp @@ -49,9 +49,9 @@ public: struct boss_kriAI : public ScriptedAI { - boss_kriAI(Creature* c) : ScriptedAI(c) + boss_kriAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -146,9 +146,9 @@ public: struct boss_vemAI : public ScriptedAI { - boss_vemAI(Creature* c) : ScriptedAI(c) + boss_vemAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -168,7 +168,7 @@ public: Enraged = false; } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (instance) { @@ -239,9 +239,9 @@ public: struct boss_yaujAI : public ScriptedAI { - boss_yaujAI(Creature* c) : ScriptedAI(c) + boss_yaujAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -261,7 +261,7 @@ public: VemDead = false; } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (instance) { @@ -303,8 +303,8 @@ public: { if (instance) { - Unit* pKri = Unit::GetUnit((*me), instance->GetData64(DATA_KRI)); - Unit* pVem = Unit::GetUnit((*me), instance->GetData64(DATA_VEM)); + Unit* pKri = Unit::GetUnit(*me, instance->GetData64(DATA_KRI)); + Unit* pVem = Unit::GetUnit(*me, instance->GetData64(DATA_VEM)); switch (urand(0, 2)) { diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp index a6409ca056f..11efccd14b7 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp @@ -176,9 +176,9 @@ public: struct eye_of_cthunAI : public Scripted_NoMovementAI { - eye_of_cthunAI(Creature* c) : Scripted_NoMovementAI(c) + eye_of_cthunAI(Creature* creature) : Scripted_NoMovementAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); if (!instance) sLog->outError("TSCR: No Instance eye_of_cthunAI"); } @@ -480,11 +480,11 @@ public: struct cthunAI : public Scripted_NoMovementAI { - cthunAI(Creature* c) : Scripted_NoMovementAI(c) + cthunAI(Creature* creature) : Scripted_NoMovementAI(creature) { SetCombatMovement(false); - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); if (!instance) sLog->outError("TSCR: No Instance eye_of_cthunAI"); } @@ -607,7 +607,8 @@ public: if (WisperTimer <= diff) { Map* map = me->GetMap(); - if (!map->IsDungeon()) return; + if (!map->IsDungeon()) + return; //Play random sound to the zone Map::PlayerList const &PlayerList = map->GetPlayers(); @@ -935,7 +936,7 @@ public: struct eye_tentacleAI : public Scripted_NoMovementAI { - eye_tentacleAI(Creature* c) : Scripted_NoMovementAI(c) + eye_tentacleAI(Creature* creature) : Scripted_NoMovementAI(creature) { if (Creature* pPortal = me->SummonCreature(MOB_SMALL_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN)) { @@ -948,7 +949,7 @@ public: uint32 KillSelfTimer; uint64 Portal; - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (Unit* p = Unit::GetUnit(*me, Portal)) p->Kill(p); @@ -1008,7 +1009,7 @@ public: struct claw_tentacleAI : public Scripted_NoMovementAI { - claw_tentacleAI(Creature* c) : Scripted_NoMovementAI(c) + claw_tentacleAI(Creature* creature) : Scripted_NoMovementAI(creature) { SetCombatMovement(false); @@ -1024,7 +1025,7 @@ public: uint32 EvadeTimer; uint64 Portal; - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (Unit* p = Unit::GetUnit(*me, Portal)) p->Kill(p); @@ -1118,7 +1119,7 @@ public: struct giant_claw_tentacleAI : public Scripted_NoMovementAI { - giant_claw_tentacleAI(Creature* c) : Scripted_NoMovementAI(c) + giant_claw_tentacleAI(Creature* creature) : Scripted_NoMovementAI(creature) { SetCombatMovement(false); @@ -1135,7 +1136,7 @@ public: uint32 EvadeTimer; uint64 Portal; - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (Unit* p = Unit::GetUnit(*me, Portal)) p->Kill(p); @@ -1237,7 +1238,7 @@ public: struct giant_eye_tentacleAI : public Scripted_NoMovementAI { - giant_eye_tentacleAI(Creature* c) : Scripted_NoMovementAI(c) + giant_eye_tentacleAI(Creature* creature) : Scripted_NoMovementAI(creature) { SetCombatMovement(false); @@ -1251,7 +1252,7 @@ public: uint32 BeamTimer; uint64 Portal; - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (Unit* p = Unit::GetUnit(*me, Portal)) p->Kill(p); @@ -1301,7 +1302,7 @@ public: struct flesh_tentacleAI : public Scripted_NoMovementAI { - flesh_tentacleAI(Creature* c) : Scripted_NoMovementAI(c) + flesh_tentacleAI(Creature* creature) : Scripted_NoMovementAI(creature) { SetCombatMovement(false); } diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp index 9ccff0bff48..613bc91182b 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp @@ -49,7 +49,7 @@ public: struct boss_fankrissAI : public ScriptedAI { - boss_fankrissAI(Creature* c) : ScriptedAI(c) {} + boss_fankrissAI(Creature* creature) : ScriptedAI(creature) {} uint32 MortalWound_Timer; uint32 SpawnHatchlings_Timer; diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp index c0ccd55f219..53fac3ee3ec 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp @@ -47,7 +47,7 @@ public: struct boss_huhuranAI : public ScriptedAI { - boss_huhuranAI(Creature* c) : ScriptedAI(c) {} + boss_huhuranAI(Creature* creature) : ScriptedAI(creature) {} uint32 Frenzy_Timer; uint32 Wyvern_Timer; diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp index b0e5112aa6b..81205780e7d 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp @@ -45,7 +45,7 @@ public: struct boss_ouroAI : public ScriptedAI { - boss_ouroAI(Creature* c) : ScriptedAI(c) {} + boss_ouroAI(Creature* creature) : ScriptedAI(creature) {} uint32 Sweep_Timer; uint32 SandBlast_Timer; diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp index 4d5aff16770..8c6c0fa0ad0 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp @@ -49,7 +49,7 @@ public: struct boss_sarturaAI : public ScriptedAI { - boss_sarturaAI(Creature* c) : ScriptedAI(c) {} + boss_sarturaAI(Creature* creature) : ScriptedAI(creature) {} uint32 WhirlWind_Timer; uint32 WhirlWindRandom_Timer; @@ -84,7 +84,7 @@ public: DoScriptText(SAY_AGGRO, me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); } @@ -192,7 +192,7 @@ public: struct mob_sartura_royal_guardAI : public ScriptedAI { - mob_sartura_royal_guardAI(Creature* c) : ScriptedAI(c) {} + mob_sartura_royal_guardAI(Creature* creature) : ScriptedAI(creature) {} uint32 WhirlWind_Timer; uint32 WhirlWindRandom_Timer; diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp index 7f3c19ac69c..4df4bf73330 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp @@ -63,7 +63,7 @@ public: struct boss_skeramAI : public ScriptedAI { - boss_skeramAI(Creature* c) : ScriptedAI(c) + boss_skeramAI(Creature* creature) : ScriptedAI(creature) { IsImage = false; } @@ -105,7 +105,7 @@ public: DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2, SAY_SLAY3), me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (!IsImage) DoScriptText(SAY_DEATH, me); diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp index b03d2dc3a4a..abaab9d830e 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp @@ -61,9 +61,9 @@ EndScriptData */ struct boss_twinemperorsAI : public ScriptedAI { - boss_twinemperorsAI(Creature* c): ScriptedAI(c) + boss_twinemperorsAI(Creature* creature): ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -120,7 +120,7 @@ struct boss_twinemperorsAI : public ScriptedAI } } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { Creature* pOtherBoss = GetOtherBoss(); if (pOtherBoss) @@ -393,7 +393,7 @@ public: struct boss_veknilashAI : public boss_twinemperorsAI { bool IAmVeklor() {return false;} - boss_veknilashAI(Creature* c) : boss_twinemperorsAI(c) {} + boss_veknilashAI(Creature* creature) : boss_twinemperorsAI(creature) {} uint32 UpperCut_Timer; uint32 UnbalancingStrike_Timer; @@ -479,7 +479,7 @@ public: struct boss_veklorAI : public boss_twinemperorsAI { bool IAmVeklor() {return true;} - boss_veklorAI(Creature* c) : boss_twinemperorsAI(c) {} + boss_veklorAI(Creature* creature) : boss_twinemperorsAI(creature) {} uint32 ShadowBolt_Timer; uint32 Blizzard_Timer; diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp index 38ea8e8748b..f1cc0b401c3 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp @@ -117,7 +117,7 @@ public: return 0; } - uint64 GetData64 (uint32 identifier) + uint64 GetData64(uint32 identifier) { switch (identifier) { diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp index 45e9797328e..556247d85af 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp @@ -86,7 +86,7 @@ public: } } - aqsentinelAI(Creature* c) : ScriptedAI(c) + aqsentinelAI(Creature* creature) : ScriptedAI(creature) { ClearBuddyList(); abselected = 0; // just initialization of variable @@ -242,7 +242,7 @@ public: DoZoneInCombat(); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { for (int ni=0; ni<3; ++ni) { diff --git a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp index 8eb3d20d528..7e93cc7e4c7 100644 --- a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp +++ b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp @@ -85,11 +85,11 @@ public: return new npc_disciple_of_naralexAI(creature); } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); InstanceScript* instance = creature->GetInstanceScript(); - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + if (action == GOSSIP_ACTION_INFO_DEF + 1) { player->CLOSE_GOSSIP_MENU(); if (instance) @@ -136,9 +136,9 @@ public: struct npc_disciple_of_naralexAI : public npc_escortAI { - npc_disciple_of_naralexAI(Creature* c) : npc_escortAI(c) + npc_disciple_of_naralexAI(Creature* creature) : npc_escortAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); eventTimer = 0; currentEvent = 0; eventProgress = 0; @@ -151,35 +151,35 @@ public: uint32 eventProgress; InstanceScript* instance; - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { if (!instance) return; - switch (i) + switch (waypointId) { case 4: eventProgress = 1; currentEvent = TYPE_NARALEX_PART1; instance->SetData(TYPE_NARALEX_PART1, IN_PROGRESS); - break; + break; case 5: DoScriptText(SAY_MUST_CONTINUE, me); instance->SetData(TYPE_NARALEX_PART1, DONE); - break; + break; case 11: eventProgress = 1; currentEvent = TYPE_NARALEX_PART2; instance->SetData(TYPE_NARALEX_PART2, IN_PROGRESS); - break; + break; case 19: DoScriptText(SAY_BEYOND_THIS_CORRIDOR, me); - break; + break; case 24: eventProgress = 1; currentEvent = TYPE_NARALEX_PART3; instance->SetData(TYPE_NARALEX_PART3, IN_PROGRESS); - break; + break; } } @@ -315,7 +315,7 @@ public: eventTimer = 3000; if (Creature* naralex = instance->instance->GetCreature(instance->GetData64(DATA_NARALEX))) { - AchievementEntry const* AchievWC = GetAchievementStore()->LookupEntry(ACHIEVEMENT_WAILING_CAVERNS); + AchievementEntry const* AchievWC = sAchievementStore.LookupEntry(ACHIEVEMENT_WAILING_CAVERNS); if (AchievWC) { Map* map = me->GetMap(); diff --git a/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp b/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp index 33a2ce73e21..b6c69584358 100644 --- a/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp +++ b/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp @@ -301,14 +301,15 @@ public: { if (npc->isAlive()) { - npc->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + npc->SetWalk(true); npc->GetMotionMaster()->MovePoint(1, x, y, z); npc->SetHomePosition(x, y, z, o); } } } - void SpawnPyramidWave(uint32 wave){ + void SpawnPyramidWave(uint32 wave) + { for (int i = 0; i < pyramidSpawnTotal; i++) { if (pyramidSpawns[i][0] == (float)wave) @@ -321,7 +322,8 @@ public: } } - bool IsWaveAllDead(){ + bool IsWaveAllDead() + { for (std::list::iterator itr = addsAtBase.begin(); itr != addsAtBase.end(); ++itr) { if (Creature* add = instance->GetCreature((*itr))) diff --git a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp index 61fe526407c..9e3d9240321 100644 --- a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp +++ b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp @@ -61,10 +61,10 @@ class npc_sergeant_bly : public CreatureScript public: npc_sergeant_bly() : CreatureScript("npc_sergeant_bly") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { player->CLOSE_GOSSIP_MENU(); CAST_AI(npc_sergeant_bly::npc_sergeant_blyAI, creature->AI())->PlayerGUID = player->GetGUID(); @@ -199,18 +199,6 @@ public: +## go_troll_cage +######*/ -void initBlyCrewMember(InstanceScript* instance, uint32 entry, float x, float y, float z) -{ - if (Creature* crew = instance->instance->GetCreature(instance->GetData64(entry))) - { - crew->SetReactState(REACT_AGGRESSIVE); - crew->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); - crew->SetHomePosition(x, y, z, 0); - crew->GetMotionMaster()->MovePoint(1, x, y, z); - crew->setFaction(FACTION_FREED); - } -} - class go_troll_cage : public GameObjectScript { public: @@ -231,6 +219,18 @@ public: return false; } +private: + void initBlyCrewMember(InstanceScript* instance, uint32 entry, float x, float y, float z) + { + if (Creature* crew = instance->instance->GetCreature(instance->GetData64(entry))) + { + crew->SetReactState(REACT_AGGRESSIVE); + crew->SetWalk(true); + crew->SetHomePosition(x, y, z, 0); + crew->GetMotionMaster()->MovePoint(1, x, y, z); + crew->setFaction(FACTION_FREED); + } + } }; /*###### @@ -258,10 +258,10 @@ class npc_weegli_blastfuse : public CreatureScript public: npc_weegli_blastfuse() : CreatureScript("npc_weegli_blastfuse") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { player->CLOSE_GOSSIP_MENU(); //here we make him run to door, set the charge and run away off to nowhere @@ -322,7 +322,7 @@ public: AttackStartCaster(victim, 10);//keep back & toss bombs/shoot } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { /*if (instance) instance->SetData(0, DONE);*/ @@ -399,9 +399,9 @@ public: enum { - ZOMBIE = 7286, - DEAD_HERO = 7276, - ZOMBIE_CHANCE = 65, + ZOMBIE = 7286, + DEAD_HERO = 7276, + ZOMBIE_CHANCE = 65, DEAD_HERO_CHANCE = 10 }; @@ -419,13 +419,12 @@ public: if (randomchance < ZOMBIE_CHANCE) go->SummonCreature(ZOMBIE, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000); else - if ((randomchance-ZOMBIE_CHANCE) < DEAD_HERO_CHANCE) + if ((randomchance - ZOMBIE_CHANCE) < DEAD_HERO_CHANCE) go->SummonCreature(DEAD_HERO, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000); } go->AddUse(); return false; } - }; /*###### diff --git a/src/server/scripts/Kalimdor/ashenvale.cpp b/src/server/scripts/Kalimdor/ashenvale.cpp index 5d26653a1a8..e28665c038e 100644 --- a/src/server/scripts/Kalimdor/ashenvale.cpp +++ b/src/server/scripts/Kalimdor/ashenvale.cpp @@ -28,7 +28,8 @@ npc_torek npc_ruul_snowhoof EndContentData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" #include "ScriptedEscortAI.h" /*#### @@ -76,36 +77,33 @@ class npc_torek : public CreatureScript uint32 Thunderclap_Timer; bool Completed; - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - Player* player = GetPlayerForEscort(); - - if (!player) - return; - - switch (i) + if (Player* player = GetPlayerForEscort()) { - case 1: - Talk(SAY_MOVE, player->GetGUID()); - break; - case 8: - Talk(SAY_PREPARE, player->GetGUID()); - break; - case 19: - //TODO: verify location and creatures amount. - me->SummonCreature(ENTRY_DURIEL, 1776.73f, -2049.06f, 109.83f, 1.54f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - me->SummonCreature(ENTRY_SILVERWING_SENTINEL, 1774.64f, -2049.41f, 109.83f, 1.40f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - me->SummonCreature(ENTRY_SILVERWING_WARRIOR, 1778.73f, -2049.50f, 109.83f, 1.67f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - break; - case 20: - DoScriptText(SAY_WIN, me, player); - Completed = true; - if (player) - player->GroupEventHappens(QUEST_TOREK_ASSULT, me); - break; - case 21: - Talk(SAY_END, player->GetGUID()); - break; + switch (waypointId) + { + case 1: + Talk(SAY_MOVE, player->GetGUID()); + break; + case 8: + Talk(SAY_PREPARE, player->GetGUID()); + break; + case 19: + //TODO: verify location and creatures amount. + me->SummonCreature(ENTRY_DURIEL, 1776.73f, -2049.06f, 109.83f, 1.54f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + me->SummonCreature(ENTRY_SILVERWING_SENTINEL, 1774.64f, -2049.41f, 109.83f, 1.40f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + me->SummonCreature(ENTRY_SILVERWING_WARRIOR, 1778.73f, -2049.50f, 109.83f, 1.67f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + break; + case 20: + DoScriptText(SAY_WIN, me, player); + Completed = true; + player->GroupEventHappens(QUEST_TOREK_ASSULT, me); + break; + case 21: + Talk(SAY_END, player->GetGUID()); + break; + } } } @@ -171,53 +169,62 @@ class npc_torek : public CreatureScript # npc_ruul_snowhoof ####*/ -#define QUEST_FREEDOM_TO_RUUL 6482 -#define GO_CAGE 178147 +enum RuulSnowhoof +{ + NPC_THISTLEFUR_URSA = 3921, + NPC_THISTLEFUR_TOTEMIC = 3922, + NPC_THISTLEFUR_PATHFINDER = 3926, + + QUEST_FREEDOM_TO_RUUL = 6482, + + GO_CAGE = 178147 +}; + +Position const RuulSnowhoofSummonsCoord[6] = +{ + {3449.218018f, -587.825073f, 174.978867f, 4.714445f}, + {3446.384521f, -587.830872f, 175.186279f, 4.714445f}, + {3444.218994f, -587.835327f, 175.380600f, 4.714445f}, + {3508.344482f, -492.024261f, 186.929031f, 4.145029f}, + {3506.265625f, -490.531006f, 186.740128f, 4.239277f}, + {3503.682373f, -489.393799f, 186.629684f, 4.349232f} +}; class npc_ruul_snowhoof : public CreatureScript { public: - - npc_ruul_snowhoof() - : CreatureScript("npc_ruul_snowhoof") - { - } + npc_ruul_snowhoof() : CreatureScript("npc_ruul_snowhoof") { } struct npc_ruul_snowhoofAI : public npc_escortAI { - npc_ruul_snowhoofAI(Creature* c) : npc_escortAI(c) {} + npc_ruul_snowhoofAI(Creature* creature) : npc_escortAI(creature) { } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - switch (i) + switch (waypointId) { - case 0: { + case 0: me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20); - if (Cage) + if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20)) Cage->SetGoState(GO_STATE_ACTIVE); - break;} - case 13: - me->SummonCreature(3922, 3449.218018f, -587.825073f, 174.978867f, 4.714445f, TEMPSUMMON_DEAD_DESPAWN, 60000); - me->SummonCreature(3921, 3446.384521f, -587.830872f, 175.186279f, 4.714445f, TEMPSUMMON_DEAD_DESPAWN, 60000); - me->SummonCreature(3926, 3444.218994f, -587.835327f, 175.380600f, 4.714445f, TEMPSUMMON_DEAD_DESPAWN, 60000); break; - case 19: - me->SummonCreature(3922, 3508.344482f, -492.024261f, 186.929031f, 4.145029f, TEMPSUMMON_DEAD_DESPAWN, 60000); - me->SummonCreature(3921, 3506.265625f, -490.531006f, 186.740128f, 4.239277f, TEMPSUMMON_DEAD_DESPAWN, 60000); - me->SummonCreature(3926, 3503.682373f, -489.393799f, 186.629684f, 4.349232f, TEMPSUMMON_DEAD_DESPAWN, 60000); + case 13: + me->SummonCreature(NPC_THISTLEFUR_TOTEMIC, RuulSnowhoofSummonsCoord[0], TEMPSUMMON_DEAD_DESPAWN, 60000); + me->SummonCreature(NPC_THISTLEFUR_URSA, RuulSnowhoofSummonsCoord[1], TEMPSUMMON_DEAD_DESPAWN, 60000); + me->SummonCreature(NPC_THISTLEFUR_PATHFINDER, RuulSnowhoofSummonsCoord[2], TEMPSUMMON_DEAD_DESPAWN, 60000); + break; + case 19: + me->SummonCreature(NPC_THISTLEFUR_TOTEMIC, RuulSnowhoofSummonsCoord[3], TEMPSUMMON_DEAD_DESPAWN, 60000); + me->SummonCreature(NPC_THISTLEFUR_URSA, RuulSnowhoofSummonsCoord[4], TEMPSUMMON_DEAD_DESPAWN, 60000); + me->SummonCreature(NPC_THISTLEFUR_PATHFINDER, RuulSnowhoofSummonsCoord[5], TEMPSUMMON_DEAD_DESPAWN, 60000); + break; + case 21: + player->GroupEventHappens(QUEST_FREEDOM_TO_RUUL, me); break; - - case 21:{ - if (player) - player->GroupEventHappens(QUEST_FREEDOM_TO_RUUL, me); - - break; } } } @@ -225,8 +232,7 @@ class npc_ruul_snowhoof : public CreatureScript void Reset() { - GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20); - if (Cage) + if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20)) Cage->SetGoState(GO_STATE_READY); } @@ -260,7 +266,7 @@ class npc_ruul_snowhoof : public CreatureScript } }; -enum eEnums +enum Muglash { SAY_MUG_START1 = -1800054, SAY_MUG_START2 = -1800055, @@ -289,21 +295,21 @@ enum eEnums NPC_MUGLASH = 12717 }; -static float m_afFirstNagaCoord[3][3]= +Position const FirstNagaCoord[3] = { - {3603.504150f, 1122.631104f, 1.635f}, // rider - {3589.293945f, 1148.664063f, 5.565f}, // sorceress - {3609.925537f, 1168.759521f, -1.168f} // razortail + {3603.504150f, 1122.631104f, 1.635f, 0.0f}, // rider + {3589.293945f, 1148.664063f, 5.565f, 0.0f}, // sorceress + {3609.925537f, 1168.759521f, -1.168f, 0.0f} // razortail }; -static float m_afSecondNagaCoord[3][3]= +Position const SecondNagaCoord[3] = { - {3609.925537f, 1168.759521f, -1.168f}, // witch - {3645.652100f, 1139.425415f, 1.322f}, // priest - {3583.602051f, 1128.405762f, 2.347f} // myrmidon + {3609.925537f, 1168.759521f, -1.168f, 0.0f}, // witch + {3645.652100f, 1139.425415f, 1.322f, 0.0f}, // priest + {3583.602051f, 1128.405762f, 2.347f, 0.0f} // myrmidon }; -static float m_fVorshaCoord[]={3633.056885f, 1172.924072f, -5.388f}; +Position const VorshaCoord = {3633.056885f, 1172.924072f, -5.388f, 0.0f}; class npc_muglash : public CreatureScript { @@ -314,47 +320,44 @@ class npc_muglash : public CreatureScript { npc_muglashAI(Creature* creature) : npc_escortAI(creature) { } - uint32 m_uiWaveId; - uint32 m_uiEventTimer; - bool m_bIsBrazierExtinguished; + uint8 WaveId; + uint32 EventTimer; + bool IsBrazierExtinguished; void JustSummoned(Creature* summoned) { summoned->AI()->AttackStart(me); } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - Player* player = GetPlayerForEscort(); - - switch (i) + if (Player* player = GetPlayerForEscort()) { - case 0: - if (player) + switch (waypointId) + { + case 0: DoScriptText(SAY_MUG_START2, me, player); - break; - case 24: - if (player) + break; + case 24: DoScriptText(SAY_MUG_BRAZIER, me, player); - if (GameObject* go = GetClosestGameObjectWithEntry(me, GO_NAGA_BRAZIER, INTERACTION_DISTANCE*2)) - { - go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); - SetEscortPaused(true); - } - break; - case 25: - DoScriptText(SAY_MUG_GRATITUDE, me); - - if (player) + if (GameObject* go = GetClosestGameObjectWithEntry(me, GO_NAGA_BRAZIER, INTERACTION_DISTANCE*2)) + { + go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); + SetEscortPaused(true); + } + break; + case 25: + DoScriptText(SAY_MUG_GRATITUDE, me); player->GroupEventHappens(QUEST_VORSHA, me); - break; - case 26: - DoScriptText(SAY_MUG_PATROL, me); - break; - case 27: - DoScriptText(SAY_MUG_RETURN, me); - break; + break; + case 26: + DoScriptText(SAY_MUG_PATROL, me); + break; + case 27: + DoScriptText(SAY_MUG_RETURN, me); + break; + } } } @@ -371,39 +374,34 @@ class npc_muglash : public CreatureScript void Reset() { - m_uiEventTimer = 10000; - m_uiWaveId = 0; - m_bIsBrazierExtinguished = false; + EventTimer = 10000; + WaveId = 0; + IsBrazierExtinguished = false; } void JustDied(Unit* /*killer*/) { - Player* player = GetPlayerForEscort(); if (HasEscortState(STATE_ESCORT_ESCORTING)) - { - if (player) - { + if (Player* player = GetPlayerForEscort()) player->FailQuest(QUEST_VORSHA); - } - } } void DoWaveSummon() { - switch (m_uiWaveId) + switch (WaveId) { case 1: - me->SummonCreature(NPC_WRATH_RIDER, m_afFirstNagaCoord[0][0], m_afFirstNagaCoord[0][1], m_afFirstNagaCoord[0][2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); - me->SummonCreature(NPC_WRATH_SORCERESS, m_afFirstNagaCoord[1][0], m_afFirstNagaCoord[1][1], m_afFirstNagaCoord[1][2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); - me->SummonCreature(NPC_WRATH_RAZORTAIL, m_afFirstNagaCoord[2][0], m_afFirstNagaCoord[2][1], m_afFirstNagaCoord[2][2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + me->SummonCreature(NPC_WRATH_RIDER, FirstNagaCoord[0], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + me->SummonCreature(NPC_WRATH_SORCERESS, FirstNagaCoord[1], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + me->SummonCreature(NPC_WRATH_RAZORTAIL, FirstNagaCoord[2], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break; case 2: - me->SummonCreature(NPC_WRATH_PRIESTESS, m_afSecondNagaCoord[0][0], m_afSecondNagaCoord[0][1], m_afSecondNagaCoord[0][2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); - me->SummonCreature(NPC_WRATH_MYRMIDON, m_afSecondNagaCoord[1][0], m_afSecondNagaCoord[1][1], m_afSecondNagaCoord[1][2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); - me->SummonCreature(NPC_WRATH_SEAWITCH, m_afSecondNagaCoord[2][0], m_afSecondNagaCoord[2][1], m_afSecondNagaCoord[2][2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + me->SummonCreature(NPC_WRATH_PRIESTESS, SecondNagaCoord[0], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + me->SummonCreature(NPC_WRATH_MYRMIDON, SecondNagaCoord[1], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + me->SummonCreature(NPC_WRATH_SEAWITCH, SecondNagaCoord[2], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break; case 3: - me->SummonCreature(NPC_VORSHA, m_fVorshaCoord[0], m_fVorshaCoord[1], m_fVorshaCoord[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + me->SummonCreature(NPC_VORSHA, VorshaCoord, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); break; case 4: SetEscortPaused(false); @@ -418,16 +416,16 @@ class npc_muglash : public CreatureScript if (!me->getVictim()) { - if (HasEscortState(STATE_ESCORT_PAUSED) && m_bIsBrazierExtinguished) + if (HasEscortState(STATE_ESCORT_PAUSED) && IsBrazierExtinguished) { - if (m_uiEventTimer < uiDiff) + if (EventTimer < uiDiff) { - ++m_uiWaveId; + ++WaveId; DoWaveSummon(); - m_uiEventTimer = 10000; + EventTimer = 10000; } else - m_uiEventTimer -= uiDiff; + EventTimer -= uiDiff; } return; } @@ -459,11 +457,7 @@ class npc_muglash : public CreatureScript class go_naga_brazier : public GameObjectScript { public: - - go_naga_brazier() - : GameObjectScript("go_naga_brazier") - { - } + go_naga_brazier() : GameObjectScript("go_naga_brazier") { } bool OnGossipHello(Player* /*player*/, GameObject* go) { @@ -473,7 +467,7 @@ class go_naga_brazier : public GameObjectScript { DoScriptText(SAY_MUG_BRAZIER_WAIT, creature); - pEscortAI->m_bIsBrazierExtinguished = true; + pEscortAI->IsBrazierExtinguished = true; return false; } } diff --git a/src/server/scripts/Kalimdor/azshara.cpp b/src/server/scripts/Kalimdor/azshara.cpp index 2e621c4a3ba..eae5baa8db2 100644 --- a/src/server/scripts/Kalimdor/azshara.cpp +++ b/src/server/scripts/Kalimdor/azshara.cpp @@ -30,9 +30,9 @@ mob_rizzle_sprysprocket mob_depth_charge EndContentData */ -#include "ScriptPCH.h" -#include "World.h" -#include "WorldPacket.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" /*###### ## mobs_spitelashes @@ -50,7 +50,7 @@ public: struct mobs_spitelashesAI : public ScriptedAI { - mobs_spitelashesAI(Creature* c) : ScriptedAI(c) {} + mobs_spitelashesAI(Creature* creature) : ScriptedAI(creature) {} uint32 morphtimer; bool spellhit; @@ -120,10 +120,10 @@ class npc_loramus_thalipedes : public CreatureScript public: npc_loramus_thalipedes() : CreatureScript("npc_loramus_thalipedes") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->CLOSE_GOSSIP_MENU(); @@ -179,9 +179,12 @@ public: # mob_rizzle_sprysprocket ####*/ -enum eRizzleSprysprocketData +enum RizzleSprysprocketData { + QUEST_CHASING_THE_MOONSTONE = 10994, + MOB_DEPTH_CHARGE = 23025, + SPELL_RIZZLE_BLACKJACK = 39865, SPELL_RIZZLE_ESCAPE = 39871, SPELL_RIZZLE_FROST_GRENADE = 40525, @@ -199,67 +202,66 @@ enum eRizzleSprysprocketData #define GOSSIP_GET_MOONSTONE "Hand over the Southfury moonstone and I'll let you go." -float WPs[58][4] = +Position const WPs[58] = { -//pos_x pos_y pos_z orien -{3691.97f, -3962.41f, 35.9118f, 3.67f}, -{3675.02f, -3960.49f, 35.9118f, 3.67f}, -{3653.19f, -3958.33f, 33.9118f, 3.59f}, -{3621.12f, -3958.51f, 29.9118f, 3.48f}, -{3604.86f, -3963, 29.9118f, 3.48f}, -{3569.94f, -3970.25f, 29.9118f, 3.44f}, -{3541.03f, -3975.64f, 29.9118f, 3.41f}, -{3510.84f, -3978.71f, 29.9118f, 3.41f}, -{3472.7f, -3997.07f, 29.9118f, 3.35f}, -{3439.15f, -4014.55f, 29.9118f, 3.29f}, -{3412.8f, -4025.87f, 29.9118f, 3.25f}, -{3384.95f, -4038.04f, 29.9118f, 3.24f}, -{3346.77f, -4052.93f, 29.9118f, 3.22f}, -{3299.56f, -4071.59f, 29.9118f, 3.20f}, -{3261.22f, -4080.38f, 30.9118f, 3.19f}, -{3220.68f, -4083.09f, 31.9118f, 3.18f}, -{3187.11f, -4070.45f, 33.9118f, 3.16f}, -{3162.78f, -4062.75f, 33.9118f, 3.15f}, -{3136.09f, -4050.32f, 33.9118f, 3.07f}, -{3119.47f, -4044.51f, 36.0363f, 3.07f}, -{3098.95f, -4019.8f, 33.9118f, 3.07f}, -{3073.07f, -4011.42f, 33.9118f, 3.07f}, -{3051.71f, -3993.37f, 33.9118f, 3.02f}, -{3027.52f, -3978.6f, 33.9118f, 3.00f}, -{3003.78f, -3960.14f, 33.9118f, 2.98f}, -{2977.99f, -3941.98f, 31.9118f, 2.96f}, -{2964.57f, -3932.07f, 30.9118f, 2.96f}, -{2947.9f, -3921.31f, 29.9118f, 2.96f}, -{2924.91f, -3910.8f, 29.9118f, 2.94f}, -{2903.04f, -3896.42f, 29.9118f, 2.93f}, -{2884.75f, -3874.03f, 29.9118f, 2.90f}, -{2868.19f, -3851.48f, 29.9118f, 2.82f}, -{2854.62f, -3819.72f, 29.9118f, 2.80f}, -{2825.53f, -3790.4f, 29.9118f, 2.744f}, -{2804.31f, -3773.05f, 29.9118f, 2.71f}, -{2769.78f, -3763.57f, 29.9118f, 2.70f}, -{2727.23f, -3745.92f, 30.9118f, 2.69f}, -{2680.12f, -3737.49f, 30.9118f, 2.67f}, -{2647.62f, -3739.94f, 30.9118f, 2.66f}, -{2616.6f, -3745.75f, 30.9118f, 2.64f}, -{2589.38f, -3731.97f, 30.9118f, 2.61f}, -{2562.94f, -3722.35f, 31.9118f, 2.56f}, -{2521.05f, -3716.6f, 31.9118f, 2.55f}, -{2485.26f, -3706.67f, 31.9118f, 2.51f}, -{2458.93f, -3696.67f, 31.9118f, 2.51f}, -{2432, -3692.03f, 31.9118f, 2.46f}, -{2399.59f, -3681.97f, 31.9118f, 2.45f}, -{2357.75f, -3666.6f, 31.9118f, 2.44f}, -{2311.99f, -3656.88f, 31.9118f, 2.94f}, -{2263.41f, -3649.55f, 31.9118f, 3.02f}, -{2209.05f, -3641.76f, 31.9118f, 2.99f}, -{2164.83f, -3637.64f, 31.9118f, 3.15f}, -{2122.42f, -3639, 31.9118f, 3.21f}, -{2075.73f, -3643.59f, 31.9118f, 3.22f}, -{2033.59f, -3649.52f, 31.9118f, 3.42f}, -{1985.22f, -3662.99f, 31.9118f, 3.42f}, -{1927.09f, -3679.56f, 33.9118f, 3.42f}, -{1873.57f, -3695.32f, 33.9118f, 3.44f} + {3691.97f, -3962.41f, 35.9118f, 3.67f}, + {3675.02f, -3960.49f, 35.9118f, 3.67f}, + {3653.19f, -3958.33f, 33.9118f, 3.59f}, + {3621.12f, -3958.51f, 29.9118f, 3.48f}, + {3604.86f, -3963, 29.9118f, 3.48f}, + {3569.94f, -3970.25f, 29.9118f, 3.44f}, + {3541.03f, -3975.64f, 29.9118f, 3.41f}, + {3510.84f, -3978.71f, 29.9118f, 3.41f}, + {3472.7f, -3997.07f, 29.9118f, 3.35f}, + {3439.15f, -4014.55f, 29.9118f, 3.29f}, + {3412.8f, -4025.87f, 29.9118f, 3.25f}, + {3384.95f, -4038.04f, 29.9118f, 3.24f}, + {3346.77f, -4052.93f, 29.9118f, 3.22f}, + {3299.56f, -4071.59f, 29.9118f, 3.20f}, + {3261.22f, -4080.38f, 30.9118f, 3.19f}, + {3220.68f, -4083.09f, 31.9118f, 3.18f}, + {3187.11f, -4070.45f, 33.9118f, 3.16f}, + {3162.78f, -4062.75f, 33.9118f, 3.15f}, + {3136.09f, -4050.32f, 33.9118f, 3.07f}, + {3119.47f, -4044.51f, 36.0363f, 3.07f}, + {3098.95f, -4019.8f, 33.9118f, 3.07f}, + {3073.07f, -4011.42f, 33.9118f, 3.07f}, + {3051.71f, -3993.37f, 33.9118f, 3.02f}, + {3027.52f, -3978.6f, 33.9118f, 3.00f}, + {3003.78f, -3960.14f, 33.9118f, 2.98f}, + {2977.99f, -3941.98f, 31.9118f, 2.96f}, + {2964.57f, -3932.07f, 30.9118f, 2.96f}, + {2947.9f, -3921.31f, 29.9118f, 2.96f}, + {2924.91f, -3910.8f, 29.9118f, 2.94f}, + {2903.04f, -3896.42f, 29.9118f, 2.93f}, + {2884.75f, -3874.03f, 29.9118f, 2.90f}, + {2868.19f, -3851.48f, 29.9118f, 2.82f}, + {2854.62f, -3819.72f, 29.9118f, 2.80f}, + {2825.53f, -3790.4f, 29.9118f, 2.744f}, + {2804.31f, -3773.05f, 29.9118f, 2.71f}, + {2769.78f, -3763.57f, 29.9118f, 2.70f}, + {2727.23f, -3745.92f, 30.9118f, 2.69f}, + {2680.12f, -3737.49f, 30.9118f, 2.67f}, + {2647.62f, -3739.94f, 30.9118f, 2.66f}, + {2616.6f, -3745.75f, 30.9118f, 2.64f}, + {2589.38f, -3731.97f, 30.9118f, 2.61f}, + {2562.94f, -3722.35f, 31.9118f, 2.56f}, + {2521.05f, -3716.6f, 31.9118f, 2.55f}, + {2485.26f, -3706.67f, 31.9118f, 2.51f}, + {2458.93f, -3696.67f, 31.9118f, 2.51f}, + {2432, -3692.03f, 31.9118f, 2.46f}, + {2399.59f, -3681.97f, 31.9118f, 2.45f}, + {2357.75f, -3666.6f, 31.9118f, 2.44f}, + {2311.99f, -3656.88f, 31.9118f, 2.94f}, + {2263.41f, -3649.55f, 31.9118f, 3.02f}, + {2209.05f, -3641.76f, 31.9118f, 2.99f}, + {2164.83f, -3637.64f, 31.9118f, 3.15f}, + {2122.42f, -3639, 31.9118f, 3.21f}, + {2075.73f, -3643.59f, 31.9118f, 3.22f}, + {2033.59f, -3649.52f, 31.9118f, 3.42f}, + {1985.22f, -3662.99f, 31.9118f, 3.42f}, + {1927.09f, -3679.56f, 33.9118f, 3.42f}, + {1873.57f, -3695.32f, 33.9118f, 3.44f} }; class mob_rizzle_sprysprocket : public CreatureScript @@ -267,22 +269,22 @@ class mob_rizzle_sprysprocket : public CreatureScript public: mob_rizzle_sprysprocket() : CreatureScript("mob_rizzle_sprysprocket") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1 && player->GetQuestStatus(10994) == QUEST_STATUS_INCOMPLETE) + if (action == GOSSIP_ACTION_INFO_DEF + 1 && player->GetQuestStatus(QUEST_CHASING_THE_MOONSTONE) == QUEST_STATUS_INCOMPLETE) { player->CLOSE_GOSSIP_MENU(); creature->CastSpell(player, SPELL_GIVE_SOUTHFURY_MOONSTONE, true); - CAST_AI(mob_rizzle_sprysprocket::mob_rizzle_sprysprocketAI, creature->AI())->Must_Die_Timer = 3000; - CAST_AI(mob_rizzle_sprysprocket::mob_rizzle_sprysprocketAI, creature->AI())->Must_Die = true; + CAST_AI(mob_rizzle_sprysprocket::mob_rizzle_sprysprocketAI, creature->AI())->MustDieTimer = 3000; + CAST_AI(mob_rizzle_sprysprocket::mob_rizzle_sprysprocketAI, creature->AI())->MustDie = true; } return true; } bool OnGossipHello(Player* player, Creature* creature) { - if (player->GetQuestStatus(10994) != QUEST_STATUS_INCOMPLETE) + if (player->GetQuestStatus(QUEST_CHASING_THE_MOONSTONE) != QUEST_STATUS_INCOMPLETE) return true; player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_GET_MOONSTONE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); player->SEND_GOSSIP_MENU(10811, creature->GetGUID()); @@ -296,34 +298,34 @@ public: struct mob_rizzle_sprysprocketAI : public ScriptedAI { - mob_rizzle_sprysprocketAI(Creature* c) : ScriptedAI(c) {} + mob_rizzle_sprysprocketAI(Creature* creature) : ScriptedAI(creature) {} - uint32 spellEscape_Timer; - uint32 Teleport_Timer; - uint32 Check_Timer; - uint32 Grenade_Timer; - uint32 Must_Die_Timer; + uint32 SpellEscapeTimer; + uint32 TeleportTimer; + uint32 CheckTimer; + uint32 GrenadeTimer; + uint32 MustDieTimer; uint32 CurrWP; uint64 PlayerGUID; - bool Must_Die; + bool MustDie; bool Escape; bool ContinueWP; bool Reached; void Reset() { - spellEscape_Timer = 1300; - Teleport_Timer = 3500; - Check_Timer = 10000; - Grenade_Timer = 30000; - Must_Die_Timer = 3000; + SpellEscapeTimer = 1300; + TeleportTimer = 3500; + CheckTimer = 10000; + GrenadeTimer = 30000; + MustDieTimer = 3000; CurrWP = 0; PlayerGUID = 0; - Must_Die = false; + MustDie = false; Escape = false; ContinueWP = false; Reached = false; @@ -331,13 +333,13 @@ public: void UpdateAI(const uint32 diff) { - if (Must_Die) + if (MustDie) { - if (Must_Die_Timer <= diff) + if (MustDieTimer <= diff) { me->DespawnOrUnsummon(); return; - } else Must_Die_Timer -= diff; + } else MustDieTimer -= diff; } if (!Escape) @@ -345,17 +347,16 @@ public: if (!PlayerGUID) return; - if (spellEscape_Timer <= diff) + if (SpellEscapeTimer <= diff) { DoCast(me, SPELL_RIZZLE_ESCAPE, false); - spellEscape_Timer = 10000; - } else spellEscape_Timer -= diff; + SpellEscapeTimer = 10000; + } else SpellEscapeTimer -= diff; - if (Teleport_Timer <= diff) + if (TeleportTimer <= diff) { //temp solution - unit can't be teleported by core using spelleffect 5, only players - Map* map = me->GetMap(); - if (map) + if (me->GetMap()) { me->SetPosition(3706.39f, -3969.15f, 35.9118f, 0); me->AI_SendMoveToPacket(3706.39f, -3969.15f, 35.9118f, 0, 0, 0); @@ -367,20 +368,20 @@ public: me->SetUnitMovementFlags(MOVEMENTFLAG_HOVER | MOVEMENTFLAG_SWIMMING); me->SetSpeed(MOVE_RUN, 0.85f, true); me->GetMotionMaster()->MovementExpired(); - me->GetMotionMaster()->MovePoint(CurrWP, WPs[CurrWP][0], WPs[CurrWP][1], WPs[CurrWP][2]); + me->GetMotionMaster()->MovePoint(CurrWP, WPs[CurrWP]); Escape = true; - } else Teleport_Timer -= diff; + } else TeleportTimer -= diff; return; } if (ContinueWP) { - me->GetMotionMaster()->MovePoint(CurrWP, WPs[CurrWP][0], WPs[CurrWP][1], WPs[CurrWP][2]); + me->GetMotionMaster()->MovePoint(CurrWP, WPs[CurrWP]); ContinueWP = false; } - if (Grenade_Timer <= diff) + if (GrenadeTimer <= diff) { Player* player = Unit::GetPlayer(*me, PlayerGUID); if (player) @@ -388,10 +389,10 @@ public: DoScriptText(SAY_RIZZLE_GRENADE, me, player); DoCast(player, SPELL_RIZZLE_FROST_GRENADE, true); } - Grenade_Timer = 30000; - } else Grenade_Timer -= diff; + GrenadeTimer = 30000; + } else GrenadeTimer -= diff; - if (Check_Timer <= diff) + if (CheckTimer <= diff) { Player* player = Unit::GetPlayer(*me, PlayerGUID); if (!player) @@ -410,8 +411,8 @@ public: Reached = true; } - Check_Timer = 1000; - } else Check_Timer -= diff; + CheckTimer = 1000; + } else CheckTimer -= diff; } @@ -427,7 +428,7 @@ public: if (!who || PlayerGUID) return; - if (who->GetTypeId() == TYPEID_PLAYER && CAST_PLR(who)->GetQuestStatus(10994) == QUEST_STATUS_INCOMPLETE) + if (who->GetTypeId() == TYPEID_PLAYER && CAST_PLR(who)->GetQuestStatus(QUEST_CHASING_THE_MOONSTONE) == QUEST_STATUS_INCOMPLETE) { PlayerGUID = who->GetGUID(); DoScriptText(SAY_RIZZLE_START, me); @@ -470,27 +471,27 @@ public: struct mob_depth_chargeAI : public ScriptedAI { - mob_depth_chargeAI(Creature* c) : ScriptedAI(c) {} + mob_depth_chargeAI(Creature* creature) : ScriptedAI(creature) {} - bool we_must_die; - uint32 must_die_timer; + bool WeMustDie; + uint32 WeMustDieTimer; void Reset() { me->SetUnitMovementFlags(MOVEMENTFLAG_HOVER | MOVEMENTFLAG_SWIMMING); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - we_must_die = false; - must_die_timer = 1000; + WeMustDie = false; + WeMustDieTimer = 1000; } void UpdateAI(const uint32 diff) { - if (we_must_die) + if (WeMustDie) { - if (must_die_timer <= diff) - { + if (WeMustDieTimer <= diff) me->DespawnOrUnsummon(); - } else must_die_timer -= diff; + else + WeMustDieTimer -= diff; } return; } @@ -503,20 +504,15 @@ public: if (who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 5)) { DoCast(who, SPELL_DEPTH_CHARGE_TRAP); - we_must_die = true; + WeMustDie = true; return; } } - void AttackStart(Unit* /*who*/) - { - } + void AttackStart(Unit* /*who*/) {} - void EnterCombat(Unit* /*who*/) - { - } + void EnterCombat(Unit* /*who*/) {} }; - }; void AddSC_azshara() diff --git a/src/server/scripts/Kalimdor/azuremyst_isle.cpp b/src/server/scripts/Kalimdor/azuremyst_isle.cpp index 09f4b9415a9..608117ca9af 100644 --- a/src/server/scripts/Kalimdor/azuremyst_isle.cpp +++ b/src/server/scripts/Kalimdor/azuremyst_isle.cpp @@ -33,15 +33,19 @@ go_ravager_cage npc_death_ravager EndContentData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" #include "ScriptedEscortAI.h" -#include +#include "ScriptedGossip.h" +#include "Cell.h" +#include "CellImpl.h" +#include "GridNotifiers.h" /*###### ## npc_draenei_survivor ######*/ -enum eEnums +enum draeneiSurvivor { SAY_HEAL1 = -1000176, SAY_HEAL2 = -1000177, @@ -69,7 +73,7 @@ public: struct npc_draenei_survivorAI : public ScriptedAI { - npc_draenei_survivorAI(Creature* c) : ScriptedAI(c) {} + npc_draenei_survivorAI(Creature* creature) : ScriptedAI(creature) {} uint64 pCaster; @@ -175,7 +179,7 @@ public: ## npc_engineer_spark_overgrind ######*/ -enum eOvergrind +enum Overgrind { SAY_TEXT = -1000184, SAY_EMOTE = -1000185, @@ -195,10 +199,10 @@ class npc_engineer_spark_overgrind : public CreatureScript public: npc_engineer_spark_overgrind() : CreatureScript("npc_engineer_spark_overgrind") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF) + if (action == GOSSIP_ACTION_INFO_DEF) { player->CLOSE_GOSSIP_MENU(); creature->setFaction(FACTION_HOSTILE); @@ -223,27 +227,27 @@ public: struct npc_engineer_spark_overgrindAI : public ScriptedAI { - npc_engineer_spark_overgrindAI(Creature* c) : ScriptedAI(c) + npc_engineer_spark_overgrindAI(Creature* creature) : ScriptedAI(creature) { - NormFaction = c->getFaction(); - NpcFlags = c->GetUInt32Value(UNIT_NPC_FLAGS); + NormFaction = creature->getFaction(); + NpcFlags = creature->GetUInt32Value(UNIT_NPC_FLAGS); - if (c->GetAreaId() == AREA_COVE || c->GetAreaId() == AREA_ISLE) + if (creature->GetAreaId() == AREA_COVE || creature->GetAreaId() == AREA_ISLE) IsTreeEvent = true; } uint32 NormFaction; uint32 NpcFlags; - uint32 Dynamite_Timer; - uint32 Emote_Timer; + uint32 DynamiteTimer; + uint32 EmoteTimer; bool IsTreeEvent; void Reset() { - Dynamite_Timer = 8000; - Emote_Timer = urand(120000, 150000); + DynamiteTimer = 8000; + EmoteTimer = urand(120000, 150000); me->setFaction(NormFaction); me->SetUInt32Value(UNIT_NPC_FLAGS, NpcFlags); @@ -260,12 +264,12 @@ public: { if (!me->isInCombat() && !IsTreeEvent) { - if (Emote_Timer <= diff) + if (EmoteTimer <= diff) { DoScriptText(SAY_TEXT, me); DoScriptText(SAY_EMOTE, me); - Emote_Timer = urand(120000, 150000); - } else Emote_Timer -= diff; + EmoteTimer = urand(120000, 150000); + } else EmoteTimer -= diff; } else if (IsTreeEvent) return; @@ -273,11 +277,11 @@ public: if (!UpdateVictim()) return; - if (Dynamite_Timer <= diff) + if (DynamiteTimer <= diff) { DoCast(me->getVictim(), SPELL_DYNAMITE); - Dynamite_Timer = 8000; - } else Dynamite_Timer -= diff; + DynamiteTimer = 8000; + } else DynamiteTimer -= diff; DoMeleeAttackIfReady(); } @@ -301,29 +305,29 @@ public: struct npc_injured_draeneiAI : public ScriptedAI { - npc_injured_draeneiAI(Creature* c) : ScriptedAI(c) {} + npc_injured_draeneiAI(Creature* creature) : ScriptedAI(creature) {} void Reset() { me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); me->SetHealth(me->CountPctFromMaxHealth(15)); - switch (rand()%2) + switch (urand(0, 1)) { - case 0: me->SetStandState(UNIT_STAND_STATE_SIT); break; - case 1: me->SetStandState(UNIT_STAND_STATE_SLEEP); break; + case 0: + me->SetStandState(UNIT_STAND_STATE_SIT); + break; + + case 1: + me->SetStandState(UNIT_STAND_STATE_SLEEP); + break; } } void EnterCombat(Unit* /*who*/) {} - void MoveInLineOfSight(Unit* /*who*/) - { - } - - void UpdateAI(const uint32 /*diff*/) - { - } + void MoveInLineOfSight(Unit* /*who*/) {} + void UpdateAI(const uint32 /*diff*/) {} }; }; @@ -332,7 +336,7 @@ public: ## npc_magwin ######*/ -enum eMagwin +enum Magwin { SAY_START = -1000111, SAY_AGGRO = -1000112, @@ -367,31 +371,29 @@ public: struct npc_magwinAI : public npc_escortAI { - npc_magwinAI(Creature* c) : npc_escortAI(c) {} + npc_magwinAI(Creature* creature) : npc_escortAI(creature) {} - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - Player* player = GetPlayerForEscort(); - - if (!player) - return; - - switch (i) + if (Player* player = GetPlayerForEscort()) { - case 0: - DoScriptText(SAY_START, me, player); - break; - case 17: - DoScriptText(SAY_PROGRESS, me, player); - break; - case 28: - DoScriptText(SAY_END1, me, player); - break; - case 29: - DoScriptText(EMOTE_HUG, me, player); - DoScriptText(SAY_END2, me, player); - player->GroupEventHappens(QUEST_A_CRY_FOR_SAY_HELP, me); - break; + switch (waypointId) + { + case 0: + DoScriptText(SAY_START, me, player); + break; + case 17: + DoScriptText(SAY_PROGRESS, me, player); + break; + case 28: + DoScriptText(SAY_END1, me, player); + break; + case 29: + DoScriptText(EMOTE_HUG, me, player); + DoScriptText(SAY_END2, me, player); + player->GroupEventHappens(QUEST_A_CRY_FOR_SAY_HELP, me); + break; + } } } @@ -400,7 +402,7 @@ public: DoScriptText(SAY_AGGRO, me, who); } - void Reset() { } + void Reset() {} }; }; @@ -409,7 +411,7 @@ public: ## npc_geezle ######*/ -enum eGeezle +enum Geezle { QUEST_TREES_COMPANY = 9531, @@ -429,7 +431,7 @@ enum eGeezle GO_NAGA_FLAG = 181694 }; -static float SparkPos[3] = {-5029.91f, -11291.79f, 8.096f}; +Position const SparkPos = {-5029.91f, -11291.79f, 8.096f, 0.0f}; class npc_geezle : public CreatureScript { @@ -443,11 +445,11 @@ public: struct npc_geezleAI : public ScriptedAI { - npc_geezleAI(Creature* c) : ScriptedAI(c) {} + npc_geezleAI(Creature* creature) : ScriptedAI(creature) {} uint64 SparkGUID; - uint32 Step; + uint8 Step; uint32 SayTimer; bool EventStarted; @@ -465,8 +467,7 @@ public: { Step = 0; EventStarted = true; - Creature* Spark = me->SummonCreature(MOB_SPARK, SparkPos[0], SparkPos[1], SparkPos[2], 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1000); - if (Spark) + if (Creature* Spark = me->SummonCreature(MOB_SPARK, SparkPos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1000)) { SparkGUID = Spark->GetGUID(); Spark->setActive(true); @@ -475,47 +476,47 @@ public: SayTimer = 8000; } - uint32 NextStep(uint32 Step) + uint32 NextStep(uint8 Step) { Creature* Spark = Unit::GetCreature(*me, SparkGUID); switch (Step) { - case 0: - if (Spark) - Spark->GetMotionMaster()->MovePoint(0, -5080.70f, -11253.61f, 0.56f); - me->GetMotionMaster()->MovePoint(0, -5092.26f, -11252, 0.71f); - return 9000; // NPCs are walking up to fire - case 1: - DespawnNagaFlag(true); - DoScriptText(EMOTE_SPARK, Spark); - return 1000; - case 2: - DoScriptText(GEEZLE_SAY_1, me, Spark); - if (Spark) - { - Spark->SetInFront(me); - me->SetInFront(Spark); - } - return 5000; - case 3: DoScriptText(SPARK_SAY_2, Spark); return 7000; - case 4: DoScriptText(SPARK_SAY_3, Spark); return 8000; - case 5: DoScriptText(GEEZLE_SAY_4, me, Spark); return 8000; - case 6: DoScriptText(SPARK_SAY_5, Spark); return 9000; - case 7: DoScriptText(SPARK_SAY_6, Spark); return 8000; - case 8: DoScriptText(GEEZLE_SAY_7, me, Spark); return 2000; - case 9: - me->GetMotionMaster()->MoveTargetedHome(); - if (Spark) - Spark->GetMotionMaster()->MovePoint(0, SparkPos[0], SparkPos[1], SparkPos[2]); - CompleteQuest(); - return 9000; - case 10: - if (Spark) - Spark->DisappearAndDie(); - DespawnNagaFlag(false); - me->DisappearAndDie(); - default: return 99999999; + case 0: + if (Spark) + Spark->GetMotionMaster()->MovePoint(0, -5080.70f, -11253.61f, 0.56f); + me->GetMotionMaster()->MovePoint(0, -5092.26f, -11252, 0.71f); + return 9000; // NPCs are walking up to fire + case 1: + DespawnNagaFlag(true); + DoScriptText(EMOTE_SPARK, Spark); + return 1000; + case 2: + DoScriptText(GEEZLE_SAY_1, me, Spark); + if (Spark) + { + Spark->SetInFront(me); + me->SetInFront(Spark); + } + return 5000; + case 3: DoScriptText(SPARK_SAY_2, Spark); return 7000; + case 4: DoScriptText(SPARK_SAY_3, Spark); return 8000; + case 5: DoScriptText(GEEZLE_SAY_4, me, Spark); return 8000; + case 6: DoScriptText(SPARK_SAY_5, Spark); return 9000; + case 7: DoScriptText(SPARK_SAY_6, Spark); return 8000; + case 8: DoScriptText(GEEZLE_SAY_7, me, Spark); return 2000; + case 9: + me->GetMotionMaster()->MoveTargetedHome(); + if (Spark) + Spark->GetMotionMaster()->MovePoint(0, SparkPos); + CompleteQuest(); + return 9000; + case 10: + if (Spark) + Spark->DisappearAndDie(); + DespawnNagaFlag(false); + me->DisappearAndDie(); + default: return 99999999; } } @@ -529,13 +530,8 @@ public: me->VisitNearbyWorldObject(radius, searcher); for (std::list::const_iterator itr = players.begin(); itr != players.end(); ++itr) - { - if ((*itr)->GetQuestStatus(QUEST_TREES_COMPANY) == QUEST_STATUS_INCOMPLETE - &&(*itr)->HasAura(SPELL_TREE_DISGUISE)) - { + if ((*itr)->GetQuestStatus(QUEST_TREES_COMPANY) == QUEST_STATUS_INCOMPLETE && (*itr)->HasAura(SPELL_TREE_DISGUISE)) (*itr)->KilledMonsterCredit(MOB_SPARK, 0); - } - } } void DespawnNagaFlag(bool despawn) @@ -548,13 +544,13 @@ public: for (std::list::const_iterator itr = FlagList.begin(); itr != FlagList.end(); ++itr) { if (despawn) - { (*itr)->SetLootState(GO_JUST_DEACTIVATED); - } else (*itr)->Respawn(); } - } else sLog->outError("SD2 ERROR: FlagList is empty!"); + } + else + sLog->outError("SD2 ERROR: FlagList is empty!"); } void UpdateAI(const uint32 diff) @@ -562,16 +558,16 @@ public: if (SayTimer <= diff) { if (EventStarted) - { SayTimer = NextStep(Step++); - } - } else SayTimer -= diff; + } + else + SayTimer -= diff; } }; }; -enum eRavegerCage +enum RavegerCage { NPC_DEATH_RAVAGER = 17556, @@ -597,7 +593,7 @@ public: ravager->AI()->AttackStart(player); } } - return true ; + return true; } }; @@ -613,7 +609,7 @@ public: struct npc_death_ravagerAI : public ScriptedAI { - npc_death_ravagerAI(Creature* c) : ScriptedAI(c){} + npc_death_ravagerAI(Creature* creature) : ScriptedAI(creature){} uint32 RendTimer; uint32 EnragingBiteTimer; diff --git a/src/server/scripts/Kalimdor/bloodmyst_isle.cpp b/src/server/scripts/Kalimdor/bloodmyst_isle.cpp index c114c02b16d..3883b740d02 100644 --- a/src/server/scripts/Kalimdor/bloodmyst_isle.cpp +++ b/src/server/scripts/Kalimdor/bloodmyst_isle.cpp @@ -28,14 +28,16 @@ mob_webbed_creature npc_captured_sunhawk_agent EndContentData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" /*###### ## mob_webbed_creature ######*/ //possible creatures to be spawned -const uint32 possibleSpawns[32] = {17322, 17661, 17496, 17522, 17340, 17352, 17333, 17524, 17654, 17348, 17339, 17345, 17359, 17353, 17336, 17550, 17330, 17701, 17321, 17680, 17325, 17320, 17683, 17342, 17715, 17334, 17341, 17338, 17337, 17346, 17344, 17327}; +uint32 const possibleSpawns[32] = {17322, 17661, 17496, 17522, 17340, 17352, 17333, 17524, 17654, 17348, 17339, 17345, 17359, 17353, 17336, 17550, 17330, 17701, 17321, 17680, 17325, 17320, 17683, 17342, 17715, 17334, 17341, 17338, 17337, 17346, 17344, 17327}; class mob_webbed_creature : public CreatureScript { @@ -49,17 +51,13 @@ public: struct mob_webbed_creatureAI : public ScriptedAI { - mob_webbed_creatureAI(Creature* c) : ScriptedAI(c) {} + mob_webbed_creatureAI(Creature* creature) : ScriptedAI(creature) {} - void Reset() - { - } + void Reset() {} - void EnterCombat(Unit* /*who*/) - { - } + void EnterCombat(Unit* /*who*/) {} - void JustDied(Unit* Killer) + void JustDied(Unit* killer) { uint32 spawnCreatureID = 0; @@ -67,8 +65,8 @@ public: { case 0: spawnCreatureID = 17681; - if (Killer->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(Killer)->KilledMonsterCredit(spawnCreatureID, 0); + if (Player* player = killer->ToPlayer()) + player->KilledMonsterCredit(spawnCreatureID, 0); break; case 1: case 2: @@ -101,10 +99,10 @@ class npc_captured_sunhawk_agent : public CreatureScript public: npc_captured_sunhawk_agent() : CreatureScript("npc_captured_sunhawk_agent") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_CSA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); @@ -153,7 +151,7 @@ public: ## Quest 9667: Saving Princess Stillpine ######*/ -enum eStillpine +enum Stillpine { QUEST_SAVING_PRINCESS_STILLPINE = 9667, NPC_PRINCESS_STILLPINE = 17682, @@ -193,7 +191,7 @@ public: if (type == POINT_MOTION_TYPE && id == 1) { DoScriptText(SAY_DIRECTION, me); - me->ForcedDespawn(); + me->DespawnOrUnsummon(); } } }; diff --git a/src/server/scripts/Kalimdor/boss_azuregos.cpp b/src/server/scripts/Kalimdor/boss_azuregos.cpp index 4c415014eef..ec098951c03 100644 --- a/src/server/scripts/Kalimdor/boss_azuregos.cpp +++ b/src/server/scripts/Kalimdor/boss_azuregos.cpp @@ -23,17 +23,24 @@ SDComment: Teleport not included, spell reflect not effecting dots (Core problem SDCategory: Azshara EndScriptData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" -#define SAY_TELEPORT -1000100 +enum Say +{ + SAY_TELEPORT = -1000100 +}; -#define SPELL_MARKOFFROST 23182 -#define SPELL_MANASTORM 21097 -#define SPELL_CHILL 21098 -#define SPELL_FROSTBREATH 21099 -#define SPELL_REFLECT 22067 -#define SPELL_CLEAVE 8255 //Perhaps not right ID -#define SPELL_ENRAGE 23537 +enum Spells +{ + SPELL_MARKOFFROST = 23182, + SPELL_MANASTORM = 21097, + SPELL_CHILL = 21098, + SPELL_FROSTBREATH = 21099, + SPELL_REFLECT = 22067, + SPELL_CLEAVE = 8255, //Perhaps not right ID + SPELL_ENRAGE = 23537 +}; class boss_azuregos : public CreatureScript { @@ -47,28 +54,28 @@ public: struct boss_azuregosAI : public ScriptedAI { - boss_azuregosAI(Creature* c) : ScriptedAI(c) {} - - uint32 MarkOfFrost_Timer; - uint32 ManaStorm_Timer; - uint32 Chill_Timer; - uint32 Breath_Timer; - uint32 Teleport_Timer; - uint32 Reflect_Timer; - uint32 Cleave_Timer; - uint32 Enrage_Timer; + boss_azuregosAI(Creature* creature) : ScriptedAI(creature) {} + + uint32 MarkOfFrostTimer; + uint32 ManaStormTimer; + uint32 ChillTimer; + uint32 BreathTimer; + uint32 TeleportTimer; + uint32 ReflectTimer; + uint32 CleaveTimer; + uint32 EnrageTimer; bool Enraged; void Reset() { - MarkOfFrost_Timer = 35000; - ManaStorm_Timer = urand(5000, 17000); - Chill_Timer = urand(10000, 30000); - Breath_Timer = urand(2000, 8000); - Teleport_Timer = 30000; - Reflect_Timer = urand(15000, 30000); - Cleave_Timer = 7000; - Enrage_Timer = 0; + MarkOfFrostTimer = 35000; + ManaStormTimer = urand(5000, 17000); + ChillTimer = urand(10000, 30000); + BreathTimer = urand(2000, 8000); + TeleportTimer = 30000; + ReflectTimer = urand(15000, 30000); + CleaveTimer = 7000; + EnrageTimer = 0; Enraged = false; } @@ -80,14 +87,14 @@ public: if (!UpdateVictim()) return; - if (Teleport_Timer <= diff) + if (TeleportTimer <= diff) { DoScriptText(SAY_TELEPORT, me); - std::list& m_threatlist = me->getThreatManager().getThreatList(); - std::list::const_iterator i = m_threatlist.begin(); - for (i = m_threatlist.begin(); i!= m_threatlist.end(); ++i) + std::list& threatlist = me->getThreatManager().getThreatList(); + std::list::const_iterator i = threatlist.begin(); + for (i = threatlist.begin(); i!= threatlist.end(); ++i) { - Unit* unit = Unit::GetUnit((*me), (*i)->getUnitGuid()); + Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid()); if (unit && (unit->GetTypeId() == TYPEID_PLAYER)) { DoTeleportPlayer(unit, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()+3, unit->GetOrientation()); @@ -95,53 +102,53 @@ public: } DoResetThreat(); - Teleport_Timer = 30000; - } else Teleport_Timer -= diff; + TeleportTimer = 30000; + } else TeleportTimer -= diff; - // //MarkOfFrost_Timer - // if (MarkOfFrost_Timer <= diff) + // //MarkOfFrostTimer + // if (MarkOfFrostTimer <= diff) // { // DoCast(me->getVictim(), SPELL_MARKOFFROST); - // MarkOfFrost_Timer = 25000; - // } else MarkOfFrost_Timer -= diff; + // MarkOfFrostTimer = 25000; + // } else MarkOfFrostTimer -= diff; - //Chill_Timer - if (Chill_Timer <= diff) + //ChillTimer + if (ChillTimer <= diff) { DoCast(me->getVictim(), SPELL_CHILL); - Chill_Timer = urand(13000, 25000); - } else Chill_Timer -= diff; + ChillTimer = urand(13000, 25000); + } else ChillTimer -= diff; - //Breath_Timer - if (Breath_Timer <= diff) + //BreathTimer + if (BreathTimer <= diff) { DoCast(me->getVictim(), SPELL_FROSTBREATH); - Breath_Timer = urand(10000, 15000); - } else Breath_Timer -= diff; + BreathTimer = urand(10000, 15000); + } else BreathTimer -= diff; - //ManaStorm_Timer - if (ManaStorm_Timer <= diff) + //ManaStormTimer + if (ManaStormTimer <= diff) { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_MANASTORM); - ManaStorm_Timer = urand(7500, 12500); - } else ManaStorm_Timer -= diff; + ManaStormTimer = urand(7500, 12500); + } else ManaStormTimer -= diff; - //Reflect_Timer - if (Reflect_Timer <= diff) + //ReflectTimer + if (ReflectTimer <= diff) { DoCast(me, SPELL_REFLECT); - Reflect_Timer = urand(20000, 35000); - } else Reflect_Timer -= diff; + ReflectTimer = urand(20000, 35000); + } else ReflectTimer -= diff; - //Cleave_Timer - if (Cleave_Timer <= diff) + //CleaveTimer + if (CleaveTimer <= diff) { DoCast(me->getVictim(), SPELL_CLEAVE); - Cleave_Timer = 7000; - } else Cleave_Timer -= diff; + CleaveTimer = 7000; + } else CleaveTimer -= diff; - //Enrage_Timer + //EnrageTimer if (HealthBelowPct(26) && !Enraged) { DoCast(me, SPELL_ENRAGE); diff --git a/src/server/scripts/Kalimdor/darkshore.cpp b/src/server/scripts/Kalimdor/darkshore.cpp index a2c10b94ff9..0e02a77169e 100644 --- a/src/server/scripts/Kalimdor/darkshore.cpp +++ b/src/server/scripts/Kalimdor/darkshore.cpp @@ -29,7 +29,9 @@ npc_prospector_remtravel npc_threshwackonator EndContentData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" #include "ScriptedEscortAI.h" #include "ScriptedFollowerAI.h" @@ -37,7 +39,7 @@ EndContentData */ # npc_kerlonian ####*/ -enum eKerlonian +enum Kerlonian { SAY_KER_START = -1000434, @@ -94,11 +96,11 @@ public: { npc_kerlonianAI(Creature* creature) : FollowerAI(creature) { } - uint32 m_uiFallAsleepTimer; + uint32 FallAsleepTimer; void Reset() { - m_uiFallAsleepTimer = urand(10000, 45000); + FallAsleepTimer = urand(10000, 45000); } void MoveInLineOfSight(Unit* who) @@ -150,7 +152,7 @@ public: SetFollowPaused(false); } - void UpdateFollowerAI(const uint32 uiDiff) + void UpdateFollowerAI(const uint32 Diff) { if (!UpdateVictim()) { @@ -159,13 +161,13 @@ public: if (!HasFollowState(STATE_FOLLOW_PAUSED)) { - if (m_uiFallAsleepTimer <= uiDiff) + if (FallAsleepTimer <= Diff) { SetSleeping(); - m_uiFallAsleepTimer = urand(25000, 90000); + FallAsleepTimer = urand(25000, 90000); } else - m_uiFallAsleepTimer -= uiDiff; + FallAsleepTimer -= Diff; } return; @@ -181,7 +183,7 @@ public: # npc_prospector_remtravel ####*/ -enum eRemtravel +enum Remtravel { SAY_REM_START = -1000327, SAY_REM_AGGRO = -1000328, @@ -231,66 +233,64 @@ public: { npc_prospector_remtravelAI(Creature* creature) : npc_escortAI(creature) {} - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - Player* player = GetPlayerForEscort(); - - if (!player) - return; - - switch (i) + if (Player* player = GetPlayerForEscort()) { - case 0: - DoScriptText(SAY_REM_START, me, player); - break; - case 5: - DoScriptText(SAY_REM_RAMP1_1, me, player); - break; - case 6: - DoSpawnCreature(NPC_GRAVEL_SCOUT, -10.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - DoSpawnCreature(NPC_GRAVEL_BONE, -10.0f, 7.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - break; - case 9: - DoScriptText(SAY_REM_RAMP1_2, me, player); - break; - case 14: - //depend quest rewarded? - DoScriptText(SAY_REM_BOOK, me, player); - break; - case 15: - DoScriptText(SAY_REM_TENT1_1, me, player); - break; - case 16: - DoSpawnCreature(NPC_GRAVEL_SCOUT, -10.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - DoSpawnCreature(NPC_GRAVEL_BONE, -10.0f, 7.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - break; - case 17: - DoScriptText(SAY_REM_TENT1_2, me, player); - break; - case 26: - DoScriptText(SAY_REM_MOSS, me, player); - break; - case 27: - DoScriptText(EMOTE_REM_MOSS, me, player); - break; - case 28: - DoScriptText(SAY_REM_MOSS_PROGRESS, me, player); - break; - case 29: - DoSpawnCreature(NPC_GRAVEL_SCOUT, -15.0f, 3.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - DoSpawnCreature(NPC_GRAVEL_BONE, -15.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - DoSpawnCreature(NPC_GRAVEL_GEO, -15.0f, 7.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - break; - case 31: - DoScriptText(SAY_REM_PROGRESS, me, player); - break; - case 41: - DoScriptText(SAY_REM_REMEMBER, me, player); - break; - case 42: - DoScriptText(EMOTE_REM_END, me, player); - player->GroupEventHappens(QUEST_ABSENT_MINDED_PT2, me); - break; + switch (waypointId) + { + case 0: + DoScriptText(SAY_REM_START, me, player); + break; + case 5: + DoScriptText(SAY_REM_RAMP1_1, me, player); + break; + case 6: + DoSpawnCreature(NPC_GRAVEL_SCOUT, -10.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + DoSpawnCreature(NPC_GRAVEL_BONE, -10.0f, 7.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + break; + case 9: + DoScriptText(SAY_REM_RAMP1_2, me, player); + break; + case 14: + //depend quest rewarded? + DoScriptText(SAY_REM_BOOK, me, player); + break; + case 15: + DoScriptText(SAY_REM_TENT1_1, me, player); + break; + case 16: + DoSpawnCreature(NPC_GRAVEL_SCOUT, -10.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + DoSpawnCreature(NPC_GRAVEL_BONE, -10.0f, 7.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + break; + case 17: + DoScriptText(SAY_REM_TENT1_2, me, player); + break; + case 26: + DoScriptText(SAY_REM_MOSS, me, player); + break; + case 27: + DoScriptText(EMOTE_REM_MOSS, me, player); + break; + case 28: + DoScriptText(SAY_REM_MOSS_PROGRESS, me, player); + break; + case 29: + DoSpawnCreature(NPC_GRAVEL_SCOUT, -15.0f, 3.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + DoSpawnCreature(NPC_GRAVEL_BONE, -15.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + DoSpawnCreature(NPC_GRAVEL_GEO, -15.0f, 7.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + break; + case 31: + DoScriptText(SAY_REM_PROGRESS, me, player); + break; + case 41: + DoScriptText(SAY_REM_REMEMBER, me, player); + break; + case 42: + DoScriptText(EMOTE_REM_END, me, player); + player->GroupEventHappens(QUEST_ABSENT_MINDED_PT2, me); + break; + } } } @@ -298,7 +298,7 @@ public: void EnterCombat(Unit* who) { - if (rand()%2) + if (urand(0, 1)) DoScriptText(SAY_REM_AGGRO, me, who); } @@ -315,7 +315,7 @@ public: # npc_threshwackonator ####*/ -enum eThreshwackonator +enum Threshwackonator { EMOTE_START = -1000325, //signed for 4966 SAY_AT_CLOSE = -1000326, //signed for 4966 @@ -331,10 +331,10 @@ class npc_threshwackonator : public CreatureScript public: npc_threshwackonator() : CreatureScript("npc_threshwackonator") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { player->CLOSE_GOSSIP_MENU(); diff --git a/src/server/scripts/Kalimdor/desolace.cpp b/src/server/scripts/Kalimdor/desolace.cpp index 49a9be21a98..e196c71f681 100644 --- a/src/server/scripts/Kalimdor/desolace.cpp +++ b/src/server/scripts/Kalimdor/desolace.cpp @@ -30,10 +30,12 @@ npc_dalinda_malem go_demon_portal EndContentData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" #include "ScriptedEscortAI.h" -enum eDyingKodo +enum DyingKodo { // signed for 9999 SAY_SMEED_HOME_1 = -1000348, @@ -114,11 +116,11 @@ public: { npc_aged_dying_ancient_kodoAI(Creature* creature) : ScriptedAI(creature) { Reset(); } - uint32 m_uiDespawnTimer; + uint32 DespawnTimer; void Reset() { - m_uiDespawnTimer = 0; + DespawnTimer = 0; } void MoveInLineOfSight(Unit* who) @@ -143,14 +145,14 @@ public: if (pSpell->Id == SPELL_KODO_KOMBO_GOSSIP) { me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - m_uiDespawnTimer = 60000; + DespawnTimer = 60000; } } void UpdateAI(const uint32 diff) { //timer should always be == 0 unless we already updated entry of creature. Then not expect this updated to ever be in combat. - if (m_uiDespawnTimer && m_uiDespawnTimer <= diff) + if (DespawnTimer && DespawnTimer <= diff) { if (!me->getVictim() && me->isAlive()) { @@ -159,7 +161,7 @@ public: me->Respawn(); return; } - } else m_uiDespawnTimer -= diff; + } else DespawnTimer -= diff; if (!UpdateVictim()) return; @@ -175,7 +177,7 @@ public: ## Hand of Iruxos ######*/ -enum +enum Iruxos { QUEST_HAND_IRUXOS = 5381, NPC_DEMON_SPIRIT = 11876, @@ -199,7 +201,10 @@ class go_iruxos : public GameObjectScript ## npc_dalinda_malem. Quest 1440 ######*/ -#define QUEST_RETURN_TO_VAHLARRIEL 1440 +enum Dalinda +{ + QUEST_RETURN_TO_VAHLARRIEL = 1440 +}; class npc_dalinda : public CreatureScript { @@ -228,17 +233,18 @@ public: { npc_dalindaAI(Creature* creature) : npc_escortAI(creature) { } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - switch (i) + + switch (waypointId) { case 1: me->IsStandState(); break; case 15: if (player) - player->GroupEventHappens(QUEST_RETURN_TO_VAHLARRIEL, me); + player->GroupEventHappens(QUEST_RETURN_TO_VAHLARRIEL, me); break; } } @@ -249,15 +255,14 @@ public: void JustDied(Unit* /*killer*/) { - Player* player = GetPlayerForEscort(); - if (player) + if (Player* player = GetPlayerForEscort()) player->FailQuest(QUEST_RETURN_TO_VAHLARRIEL); return; } - void UpdateAI(const uint32 uiDiff) + void UpdateAI(const uint32 Diff) { - npc_escortAI::UpdateAI(uiDiff); + npc_escortAI::UpdateAI(Diff); if (!UpdateVictim()) return; DoMeleeAttackIfReady(); diff --git a/src/server/scripts/Kalimdor/durotar.cpp b/src/server/scripts/Kalimdor/durotar.cpp index 6c91c64f981..ec06a542b6f 100644 --- a/src/server/scripts/Kalimdor/durotar.cpp +++ b/src/server/scripts/Kalimdor/durotar.cpp @@ -15,8 +15,10 @@ * with this program. If not, see . */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" #include "Vehicle.h" +#include "SpellScript.h" /*###### ##Quest 5441: Lazy Peons @@ -48,17 +50,17 @@ public: struct npc_lazy_peonAI : public ScriptedAI { - npc_lazy_peonAI(Creature* c) : ScriptedAI(c) {} + npc_lazy_peonAI(Creature* creature) : ScriptedAI(creature) {} - uint64 uiPlayerGUID; + uint64 PlayerGUID; - uint32 m_uiRebuffTimer; + uint32 RebuffTimer; bool work; - void Reset () + void Reset() { - uiPlayerGUID = 0; - m_uiRebuffTimer = 0; + PlayerGUID = 0; + RebuffTimer = 0; work = false; } @@ -81,17 +83,17 @@ public: } } - void UpdateAI(const uint32 uiDiff) + void UpdateAI(const uint32 Diff) { if (work == true) me->HandleEmoteCommand(EMOTE_ONESHOT_WORK_CHOPWOOD); - if (m_uiRebuffTimer <= uiDiff) + if (RebuffTimer <= Diff) { DoCast(me, SPELL_BUFF_SLEEP); - m_uiRebuffTimer = 300000; //Rebuff agian in 5 minutes + RebuffTimer = 300000; //Rebuff agian in 5 minutes } else - m_uiRebuffTimer -= uiDiff; + RebuffTimer -= Diff; if (!UpdateVictim()) return; DoMeleeAttackIfReady(); @@ -170,7 +172,7 @@ enum Points class npc_tiger_matriarch_credit : public CreatureScript { public: - npc_tiger_matriarch_credit() : CreatureScript("npc_tiger_matriarch_credit"){} + npc_tiger_matriarch_credit() : CreatureScript("npc_tiger_matriarch_credit") { } struct npc_tiger_matriarch_creditAI : public Scripted_NoMovementAI { @@ -179,7 +181,7 @@ class npc_tiger_matriarch_credit : public CreatureScript events.ScheduleEvent(EVENT_CHECK_SUMMON_AURA, 2000); } - void UpdateAI(const uint32 diff) + void UpdateAI(uint32 const diff) { events.Update(diff); @@ -223,27 +225,32 @@ class npc_tiger_matriarch_credit : public CreatureScript class npc_tiger_matriarch : public CreatureScript { public: - npc_tiger_matriarch() : CreatureScript("npc_tiger_matriarch"){} + npc_tiger_matriarch() : CreatureScript("npc_tiger_matriarch") {} struct npc_tiger_matriarchAI : public ScriptedAI { npc_tiger_matriarchAI(Creature* creature) : ScriptedAI(creature), - _tiger(NULL) + _tigerGuid(0) { } + void EnterCombat(Unit* /*target*/) + { + _events.Reset(); + _events.ScheduleEvent(EVENT_POUNCE, 100); + _events.ScheduleEvent(EVENT_NOSUMMON, 50000); + } + void IsSummonedBy(Unit* summoner) { - if (summoner->GetTypeId() != TYPEID_PLAYER) + if (summoner->GetTypeId() != TYPEID_PLAYER || !summoner->GetVehicle()) return; - _tiger = summoner->GetVehicle()->GetBase(); - if (_tiger) + _tigerGuid = summoner->GetVehicle()->GetBase()->GetGUID(); + if (Unit* tiger = ObjectAccessor::GetUnit(*me, _tigerGuid)) { - me->AddThreat(_tiger, 500000.0f); + me->AddThreat(tiger, 500000.0f); DoCast(me, SPELL_FURIOUS_BITE); - events.ScheduleEvent(EVENT_POUNCE, 100); - events.ScheduleEvent(EVENT_NOSUMMON, 50000); } } @@ -259,7 +266,7 @@ class npc_tiger_matriarch : public CreatureScript vehSummoner->RemoveAurasDueToSpell(SPELL_SPIRIT_OF_THE_TIGER_RIDER); vehSummoner->RemoveAurasDueToSpell(SPELL_SUMMON_ZENTABRA_TRIGGER); } - me->ForcedDespawn(); + me->DespawnOrUnsummon(); } void DamageTaken(Unit* attacker, uint32& damage) @@ -282,7 +289,7 @@ class npc_tiger_matriarch : public CreatureScript vehSummoner->RemoveAurasDueToSpell(SPELL_SUMMON_ZENTABRA_TRIGGER); } - me->ForcedDespawn(); + me->DespawnOrUnsummon(); } } @@ -291,24 +298,27 @@ class npc_tiger_matriarch : public CreatureScript if (!UpdateVictim()) return; - if (!_tiger) + if (!_tigerGuid) return; - events.Update(diff); + _events.Update(diff); - while (uint32 eventId = events.ExecuteEvent()) + while (uint32 eventId = _events.ExecuteEvent()) { switch (eventId) { case EVENT_POUNCE: DoCastVictim(SPELL_POUNCE); - events.ScheduleEvent(EVENT_POUNCE, 30000); + _events.ScheduleEvent(EVENT_POUNCE, 30000); break; case EVENT_NOSUMMON: // Reapply SPELL_NO_SUMMON_AURA - if (_tiger && _tiger->isSummon()) - if (Unit* vehSummoner = _tiger->ToTempSummon()->GetSummoner()) - me->AddAura(SPELL_NO_SUMMON_AURA, vehSummoner); - events.ScheduleEvent(EVENT_NOSUMMON, 50000); + if (Unit* tiger = ObjectAccessor::GetUnit(*me, _tigerGuid)) + { + if (tiger->isSummon()) + if (Unit* vehSummoner = tiger->ToTempSummon()->GetSummoner()) + me->AddAura(SPELL_NO_SUMMON_AURA, vehSummoner); + } + _events.ScheduleEvent(EVENT_NOSUMMON, 50000); break; default: break; @@ -319,8 +329,8 @@ class npc_tiger_matriarch : public CreatureScript } private: - EventMap events; - Unit* _tiger; + EventMap _events; + uint64 _tigerGuid; }; CreatureAI* GetAI(Creature* creature) const @@ -345,26 +355,32 @@ class npc_troll_volunteer : public CreatureScript { npc_troll_volunteerAI(Creature* creature) : ScriptedAI(creature) { + } + + void InitializeAI() + { + if (me->isDead() || !me->GetOwner()) + return; + Reset(); - Player* player = me->GetOwner()->ToPlayer(); - switch (urand(1, 4)) + switch (urand(0, 3)) { - case 1: + case 0: _mountModel = 6471; break; - case 2: + case 1: _mountModel = 6473; break; - case 3: + case 2: _mountModel = 6469; break; - case 4: + default: _mountModel = 6472; break; } me->SetDisplayId(trollmodel[urand(0, 39)]); - if (player) + if (Player* player = me->GetOwner()->ToPlayer()) me->GetMotionMaster()->MoveFollow(player, 5.0f, float(rand_norm() + 1.0f) * M_PI / 3.0f * 4.0f); } @@ -417,6 +433,8 @@ class npc_troll_volunteer : public CreatureScript } }; +typedef npc_troll_volunteer::npc_troll_volunteerAI VolunteerAI; + class spell_mount_check : public SpellScriptLoader { public: @@ -442,9 +460,8 @@ class spell_mount_check : public SpellScriptLoader if (owner->IsMounted() && !target->IsMounted()) { - if (Creature* volunteer = target->ToCreature()) - if (uint32 mountid = CAST_AI(npc_troll_volunteer::npc_troll_volunteerAI, volunteer->AI())->GetMountId()) - target->Mount(mountid); + if (VolunteerAI* volunteerAI = CAST_AI(VolunteerAI, target->GetAI())) + target->Mount(volunteerAI->GetMountId()); } else if (!owner->IsMounted() && target->IsMounted()) target->Dismount(); @@ -493,7 +510,7 @@ class spell_voljin_war_drums : public SpellScriptLoader else if (target->GetEntry() == NPC_CITIZEN_2) motivate = SPELL_MOTIVATE_2; if (motivate) - caster->CastSpell(target, motivate, true, NULL, NULL, caster->GetGUID()); + caster->CastSpell(target, motivate, false); } } @@ -511,13 +528,13 @@ class spell_voljin_war_drums : public SpellScriptLoader enum VoodooSpells { - SPELL_BREW = 16712, // Special Brew - SPELL_GHOSTLY = 16713, // Ghostly - SPELL_HEX1 = 16707, // Hex - SPELL_HEX2 = 16708, // Hex - SPELL_HEX3 = 16709, // Hex - SPELL_GROW = 16711, // Grow - SPELL_LAUNCH = 16716, // Launch (Whee!) + SPELL_BREW = 16712, // Special Brew + SPELL_GHOSTLY = 16713, // Ghostly + SPELL_HEX1 = 16707, // Hex + SPELL_HEX2 = 16708, // Hex + SPELL_HEX3 = 16709, // Hex + SPELL_GROW = 16711, // Grow + SPELL_LAUNCH = 16716, // Launch (Whee!) }; // 17009 @@ -542,13 +559,9 @@ class spell_voodoo : public SpellScriptLoader void HandleDummy(SpellEffIndex /*effIndex*/) { - Unit* caster = GetCaster(); + uint32 spellid = RAND(SPELL_BREW, SPELL_GHOSTLY, RAND(SPELL_HEX1, SPELL_HEX2, SPELL_HEX3), SPELL_GROW, SPELL_LAUNCH); if (Unit* target = GetHitUnit()) - { - caster->CastSpell(target, RAND(SPELL_BREW, SPELL_GHOSTLY, - RAND(SPELL_HEX1, SPELL_HEX2, SPELL_HEX3), - SPELL_GROW, SPELL_LAUNCH), false); - } + GetCaster()->CastSpell(target, spellid, false); } void Register() diff --git a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp index eede1aa069a..45e1c1808c1 100644 --- a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp +++ b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp @@ -32,8 +32,11 @@ npc_private_hendel npc_cassa_crimsonwing - handled by npc_taxi EndContentData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" #include "ScriptedEscortAI.h" +#include "ScriptedGossip.h" +#include "SpellScript.h" /*###### ## mobs_risen_husk_spirit @@ -132,7 +135,7 @@ class mobs_risen_husk_spirit : public CreatureScript ## npc_deserter_agitator ######*/ -enum eDeserter +enum Deserter { QUEST_TRAITORS_AMONG_US = 11126, NPC_THERAMORE_DESERTER = 23602, @@ -157,11 +160,11 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_SENDER_INFO) + if (action == GOSSIP_SENDER_INFO) { player->CLOSE_GOSSIP_MENU(); switch (urand(0, 1)) @@ -203,12 +206,12 @@ public: me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); } - void MovementInform(uint32 uiType, uint32 uiId) + void MovementInform(uint32 Type, uint32 Id) { - if (uiType != POINT_MOTION_TYPE) + if (Type != POINT_MOTION_TYPE) return; - if (uiId == 1) + if (Id == 1) me->DisappearAndDie(); } }; @@ -218,7 +221,7 @@ public: ## npc_deserter_agitator ######*/ -enum eTheramoreGuard +enum TheramoreGuard { SAY_QUEST1 = -1000641, SAY_QUEST2 = -1000642, @@ -255,18 +258,18 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_SENDER_INFO) + if (action == GOSSIP_SENDER_INFO) { player->CLOSE_GOSSIP_MENU(); player->KilledMonsterCredit(NPC_THERAMORE_GUARD, 0); DoScriptText(SAY_QUEST1, creature); creature->CastSpell(creature, SPELL_DOCTORED_LEAFLET, false); creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - CAST_AI(npc_theramore_guard::npc_theramore_guardAI, creature->AI())->uiYellTimer = 4000; + CAST_AI(npc_theramore_guard::npc_theramore_guardAI, creature->AI())->YellTimer = 4000; CAST_AI(npc_theramore_guard::npc_theramore_guardAI, creature->AI())->bYellTimer = true; } @@ -282,40 +285,40 @@ public: { npc_theramore_guardAI(Creature* creature) : ScriptedAI(creature) { } - uint32 uiYellTimer; - uint32 uiStep; + uint32 YellTimer; + uint32 Step; bool bYellTimer; void Reset() { bYellTimer = false; - uiStep = 0; + Step = 0; } - void UpdateAI(const uint32 uiDiff) + void UpdateAI(const uint32 Diff) { if (!me->HasAura(SPELL_PROPAGANDIZED)) me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - if (bYellTimer && uiYellTimer <= uiDiff) + if (bYellTimer && YellTimer <= Diff) { - switch (uiStep) + switch (Step) { case 0: DoScriptText(RAND(SAY_QUEST2, SAY_QUEST3, SAY_QUEST4, SAY_QUEST5, SAY_QUEST6), me); - uiYellTimer = 3000; - ++uiStep; + YellTimer = 3000; + ++Step; break; case 1: DoScriptText(RAND(SAY_QUEST7, SAY_QUEST8, SAY_QUEST9), me); me->HandleEmoteCommand(EMOTE_ONESHOT_LAUGH); - uiStep = 0; + Step = 0; bYellTimer = false; break; } } else - uiYellTimer -= uiDiff; + YellTimer -= Diff; } }; }; @@ -324,7 +327,7 @@ public: ## npc_lady_jaina_proudmoore ######*/ -enum eLadyJaina +enum LadyJaina { QUEST_JAINAS_AUTOGRAPH = 558, SPELL_JAINAS_AUTOGRAPH = 23122 @@ -337,10 +340,10 @@ class npc_lady_jaina_proudmoore : public CreatureScript public: npc_lady_jaina_proudmoore() : CreatureScript("npc_lady_jaina_proudmoore") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_SENDER_INFO) + if (action == GOSSIP_SENDER_INFO) { player->SEND_GOSSIP_MENU(7012, creature->GetGUID()); player->CastSpell(player, SPELL_JAINAS_AUTOGRAPH, false); @@ -367,7 +370,7 @@ public: ## npc_nat_pagle ######*/ -enum eNatPagle +enum NatPagle { QUEST_NATS_MEASURING_TAPE = 8227 }; @@ -377,10 +380,10 @@ class npc_nat_pagle : public CreatureScript public: npc_nat_pagle() : CreatureScript("npc_nat_pagle") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_TRADE) + if (action == GOSSIP_ACTION_TRADE) player->GetSession()->SendListInventory(creature->GetGUID()); return true; @@ -408,7 +411,7 @@ public: ## npc_private_hendel ######*/ -enum eHendel +enum Hendel { // looks like all this text ids are wrong. SAY_PROGRESS_1_TER = -1000411, // signed for 3568 @@ -464,11 +467,11 @@ public: AttackStart(pAttacker); } - void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) + void DamageTaken(Unit* pDoneBy, uint32 &Damage) { - if (uiDamage > me->GetHealth() || me->HealthBelowPctDamaged(20, uiDamage)) + if (Damage > me->GetHealth() || me->HealthBelowPctDamaged(20, Damage)) { - uiDamage = 0; + Damage = 0; if (Player* player = pDoneBy->GetCharmerOrOwnerPlayerOrPlayerItself()) player->GroupEventHappens(QUEST_MISSING_DIPLO_PT16, me); @@ -485,9 +488,9 @@ public: ## npc_zelfrax ######*/ -const Position MovePosition = {-2967.030f, -3872.1799f, 35.620f, 0.0f}; +Position const MovePosition = {-2967.030f, -3872.1799f, 35.620f, 0.0f}; -enum eZelfrax +enum Zelfrax { SAY_ZELFRAX = -1000472, SAY_ZELFRAX_2 = -1000473 @@ -525,9 +528,9 @@ public: } } - void MovementInform(uint32 uiType, uint32 /*uiId*/) + void MovementInform(uint32 Type, uint32 /*Id*/) { - if (uiType != POINT_MOTION_TYPE) + if (Type != POINT_MOTION_TYPE) return; me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation()); @@ -547,7 +550,7 @@ public: DoScriptText(SAY_ZELFRAX_2, me); } - void UpdateAI(uint32 const /*uiDiff*/) + void UpdateAI(uint32 const /*Diff*/) { if (!UpdateVictim()) return; @@ -562,7 +565,7 @@ public: ## npc_stinky ######*/ -enum eStinky +enum Stinky { QUEST_STINKYS_ESCAPE_H = 1270, QUEST_STINKYS_ESCAPE_A = 1222, @@ -607,49 +610,48 @@ public: { npc_stinkyAI(Creature* creature) : npc_escortAI(creature) { } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); if (!player) return; - switch (i) + switch (waypointId) { - case 7: - DoScriptText(SAY_STAY_1, me, player); - break; - case 11: - DoScriptText(SAY_STAY_2, me, player); - break; - case 25: - DoScriptText(SAY_STAY_3, me, player); - break; - case 26: - DoScriptText(SAY_STAY_4, me, player); - break; - case 27: - DoScriptText(SAY_STAY_5, me, player); - break; - case 28: - DoScriptText(SAY_STAY_6, me, player); - me->SetStandState(UNIT_STAND_STATE_KNEEL); - break; - case 29: - me->SetStandState(UNIT_STAND_STATE_STAND); - break; - case 37: - DoScriptText(SAY_QUEST_COMPLETE, me, player); - me->SetSpeed(MOVE_RUN, 1.2f, true); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); - if (player && player->GetQuestStatus(QUEST_STINKYS_ESCAPE_H)) - player->GroupEventHappens(QUEST_STINKYS_ESCAPE_H, me); - if (player && player->GetQuestStatus(QUEST_STINKYS_ESCAPE_A)) - player->GroupEventHappens(QUEST_STINKYS_ESCAPE_A, me); - break; - case 39: - DoScriptText(EMOTE_DISAPPEAR, me); - break; - + case 7: + DoScriptText(SAY_STAY_1, me, player); + break; + case 11: + DoScriptText(SAY_STAY_2, me, player); + break; + case 25: + DoScriptText(SAY_STAY_3, me, player); + break; + case 26: + DoScriptText(SAY_STAY_4, me, player); + break; + case 27: + DoScriptText(SAY_STAY_5, me, player); + break; + case 28: + DoScriptText(SAY_STAY_6, me, player); + me->SetStandState(UNIT_STAND_STATE_KNEEL); + break; + case 29: + me->SetStandState(UNIT_STAND_STATE_STAND); + break; + case 37: + DoScriptText(SAY_QUEST_COMPLETE, me, player); + me->SetSpeed(MOVE_RUN, 1.2f, true); + me->SetWalk(false); + if (player->GetQuestStatus(QUEST_STINKYS_ESCAPE_H)) + player->GroupEventHappens(QUEST_STINKYS_ESCAPE_H, me); + if (player->GetQuestStatus(QUEST_STINKYS_ESCAPE_A)) + player->GroupEventHappens(QUEST_STINKYS_ESCAPE_A, me); + break; + case 39: + DoScriptText(EMOTE_DISAPPEAR, me); + break; } } @@ -663,10 +665,11 @@ public: void JustDied(Unit* /*killer*/) { Player* player = GetPlayerForEscort(); - if (HasEscortState(STATE_ESCORT_ESCORTING) && player) + if (player && HasEscortState(STATE_ESCORT_ESCORTING)) { if (player->GetQuestStatus(QUEST_STINKYS_ESCAPE_H)) player->FailQuest(QUEST_STINKYS_ESCAPE_H); + if (player->GetQuestStatus(QUEST_STINKYS_ESCAPE_A)) player->FailQuest(QUEST_STINKYS_ESCAPE_A); } @@ -713,7 +716,7 @@ class spell_ooze_zap : public SpellScriptLoader if (!GetCaster()->HasAura(GetSpellInfo()->Effects[EFFECT_1].CalcValue())) return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; // This is actually correct - if (!GetTargetUnit()) + if (!GetExplTargetUnit()) return SPELL_FAILED_BAD_TARGETS; return SPELL_CAST_OK; @@ -847,7 +850,7 @@ public: player->KilledMonsterCredit(NPC_THERAMORE_PRISONER, 0); prisoner->AI()->Talk(SAY_FREE); // We also emote cry here (handled in creature_text.emote) - prisoner->ForcedDespawn(6000); + prisoner->DespawnOrUnsummon(6000); } return true; } diff --git a/src/server/scripts/Kalimdor/felwood.cpp b/src/server/scripts/Kalimdor/felwood.cpp index 91d8a875f17..9243ea0017e 100644 --- a/src/server/scripts/Kalimdor/felwood.cpp +++ b/src/server/scripts/Kalimdor/felwood.cpp @@ -27,7 +27,9 @@ EndScriptData */ npcs_riverbreeze_and_silversky EndContentData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" /*###### ## npcs_riverbreeze_and_silversky @@ -35,32 +37,43 @@ EndContentData */ #define GOSSIP_ITEM_BEACON "Please make me a Cenarion Beacon" +enum RiverbreezeAndSilversky +{ + SPELL_CENARION_BEACON = 15120, + + NPC_ARATHANDRIS_SILVERSKY = 9528, + NPC_MAYBESS_RIVERBREEZE = 9529, + + QUEST_CLEASING_FELWOOD_A = 4101, + QUEST_CLEASING_FELWOOD_H = 4102 +}; + class npcs_riverbreeze_and_silversky : public CreatureScript { public: npcs_riverbreeze_and_silversky() : CreatureScript("npcs_riverbreeze_and_silversky") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { player->CLOSE_GOSSIP_MENU(); - creature->CastSpell(player, 15120, false); + creature->CastSpell(player, SPELL_CENARION_BEACON, false); } return true; } bool OnGossipHello(Player* player, Creature* creature) { - uint32 eCreature = creature->GetEntry(); - if (creature->isQuestGiver()) player->PrepareQuestMenu(creature->GetGUID()); - if (eCreature == 9528) + uint32 creatureId = creature->GetEntry(); + + if (creatureId == NPC_ARATHANDRIS_SILVERSKY) { - if (player->GetQuestRewardStatus(4101)) + if (player->GetQuestRewardStatus(QUEST_CLEASING_FELWOOD_A)) { player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEACON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); player->SEND_GOSSIP_MENU(2848, creature->GetGUID()); @@ -70,9 +83,9 @@ public: player->SEND_GOSSIP_MENU(2844, creature->GetGUID()); } - if (eCreature == 9529) + if (creatureId == NPC_MAYBESS_RIVERBREEZE) { - if (player->GetQuestRewardStatus(4102)) + if (player->GetQuestRewardStatus(QUEST_CLEASING_FELWOOD_H)) { player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEACON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); player->SEND_GOSSIP_MENU(2849, creature->GetGUID()); @@ -84,7 +97,6 @@ public: return true; } - }; void AddSC_felwood() diff --git a/src/server/scripts/Kalimdor/feralas.cpp b/src/server/scripts/Kalimdor/feralas.cpp index 37a0e4e8f88..4fcd20951c9 100644 --- a/src/server/scripts/Kalimdor/feralas.cpp +++ b/src/server/scripts/Kalimdor/feralas.cpp @@ -23,8 +23,10 @@ SDComment: Quest support: 3520, 2767, Special vendor Gregan Brewspewer SDCategory: Feralas EndScriptData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" #include "ScriptedEscortAI.h" +#include "ScriptedGossip.h" /*###### ## npc_gregan_brewspewer @@ -37,15 +39,15 @@ class npc_gregan_brewspewer : public CreatureScript public: npc_gregan_brewspewer() : CreatureScript("npc_gregan_brewspewer") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); player->SEND_GOSSIP_MENU(2434, creature->GetGUID()); } - if (uiAction == GOSSIP_ACTION_TRADE) + if (action == GOSSIP_ACTION_TRADE) player->GetSession()->SendListInventory(creature->GetGUID()); return true; } @@ -68,7 +70,7 @@ public: ## npc_oox22fe ######*/ -enum eOOX +enum OOX { //signed for 7806 SAY_OOX_START = -1000287, @@ -124,9 +126,9 @@ public: { npc_oox22feAI(Creature* creature) : npc_escortAI(creature) { } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - switch (i) + switch (waypointId) { // First Ambush(3 Yetis) case 11: @@ -154,9 +156,7 @@ public: DoScriptText(SAY_OOX_END, me); // Award quest credit if (Player* player = GetPlayerForEscort()) - { - player->GroupEventHappens(QUEST_RESCUE_OOX22FE, me); - } + player->GroupEventHappens(QUEST_RESCUE_OOX22FE, me); break; } } diff --git a/src/server/scripts/Kalimdor/moonglade.cpp b/src/server/scripts/Kalimdor/moonglade.cpp index 2d6e34ab9ee..9df208d2578 100644 --- a/src/server/scripts/Kalimdor/moonglade.cpp +++ b/src/server/scripts/Kalimdor/moonglade.cpp @@ -31,14 +31,16 @@ npc_clintar_spirit npc_clintar_dreamwalker EndContentData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" #include "ScriptedEscortAI.h" +#include "ScriptedGossip.h" /*###### ## npc_bunthen_plainswind ######*/ -enum eBunthen +enum Bunthen { QUEST_SEA_LION_HORDE = 30, QUEST_SEA_LION_ALLY = 272, @@ -54,10 +56,10 @@ class npc_bunthen_plainswind : public CreatureScript public: npc_bunthen_plainswind() : CreatureScript("npc_bunthen_plainswind") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: player->CLOSE_GOSSIP_MENU(); @@ -113,10 +115,10 @@ class npc_great_bear_spirit : public CreatureScript public: npc_great_bear_spirit() : CreatureScript("npc_great_bear_spirit") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BEAR2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); @@ -169,10 +171,10 @@ class npc_silva_filnaveth : public CreatureScript public: npc_silva_filnaveth() : CreatureScript("npc_silva_filnaveth") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: player->CLOSE_GOSSIP_MENU(); @@ -218,70 +220,68 @@ public: ## npc_clintar_spirit ######*/ -float Clintar_spirit_WP[41][5] = +float const Clintar_spirit_WP[41][5] = { - //pos_x pos_y pos_z orien waitTime -{7465.28f, -3115.46f, 439.327f, 0.83f, 4000}, -{7476.49f, -3101, 443.457f, 0.89f, 0}, -{7486.57f, -3085.59f, 439.478f, 1.07f, 0}, -{7472.19f, -3085.06f, 443.142f, 3.07f, 0}, -{7456.92f, -3085.91f, 438.862f, 3.24f, 0}, -{7446.68f, -3083.43f, 438.245f, 2.40f, 0}, -{7446.17f, -3080.21f, 439.826f, 1.10f, 6000}, -{7452.41f, -3085.8f, 438.984f, 5.78f, 0}, -{7469.11f, -3084.94f, 443.048f, 6.25f, 0}, -{7483.79f, -3085.44f, 439.607f, 6.25f, 0}, -{7491.14f, -3090.96f, 439.983f, 5.44f, 0}, -{7497.62f, -3098.22f, 436.854f, 5.44f, 0}, -{7498.72f, -3113.41f, 434.596f, 4.84f, 0}, -{7500.06f, -3122.51f, 434.749f, 5.17f, 0}, -{7504.96f, -3131.53f, 434.475f, 4.74f, 0}, -{7504.31f, -3133.53f, 435.693f, 3.84f, 6000}, -{7504.55f, -3133.27f, 435.476f, 0.68f, 15000}, -{7501.99f, -3126.01f, 434.93f, 1.83f, 0}, -{7490.76f, -3114.97f, 434.431f, 2.51f, 0}, -{7479.64f, -3105.51f, 431.123f, 1.83f, 0}, -{7474.63f, -3086.59f, 428.994f, 1.83f, 2000}, -{7472.96f, -3074.18f, 427.566f, 1.57f, 0}, -{7472.25f, -3063, 428.268f, 1.55f, 0}, -{7473.46f, -3054.22f, 427.588f, 0.36f, 0}, -{7475.08f, -3053.6f, 428.653f, 0.36f, 6000}, -{7474.66f, -3053.56f, 428.433f, 3.19f, 4000}, -{7471.81f, -3058.84f, 427.073f, 4.29f, 0}, -{7472.16f, -3064.91f, 427.772f, 4.95f, 0}, -{7471.56f, -3085.36f, 428.924f, 4.72f, 0}, -{7473.56f, -3093.48f, 429.294f, 5.04f, 0}, -{7478.94f, -3104.29f, 430.638f, 5.23f, 0}, -{7484.46f, -3109.61f, 432.769f, 5.79f, 0}, -{7490.23f, -3111.08f, 434.431f, 0.02f, 0}, -{7496.29f, -3108, 434.783f, 1.15f, 0}, -{7497.46f, -3100.66f, 436.191f, 1.50f, 0}, -{7495.64f, -3093.39f, 438.349f, 2.10f, 0}, -{7492.44f, -3086.01f, 440.267f, 1.38f, 0}, -{7498.26f, -3076.44f, 440.808f, 0.71f, 0}, -{7506.4f, -3067.35f, 443.64f, 0.77f, 0}, -{7518.37f, -3057.42f, 445.584f, 0.74f, 0}, -{7517.51f, -3056.3f, 444.568f, 2.49f, 4500} + //pos_x pos_y pos_z orien waitTime + {7465.28f, -3115.46f, 439.327f, 0.83f, 4000}, + {7476.49f, -3101, 443.457f, 0.89f, 0}, + {7486.57f, -3085.59f, 439.478f, 1.07f, 0}, + {7472.19f, -3085.06f, 443.142f, 3.07f, 0}, + {7456.92f, -3085.91f, 438.862f, 3.24f, 0}, + {7446.68f, -3083.43f, 438.245f, 2.40f, 0}, + {7446.17f, -3080.21f, 439.826f, 1.10f, 6000}, + {7452.41f, -3085.8f, 438.984f, 5.78f, 0}, + {7469.11f, -3084.94f, 443.048f, 6.25f, 0}, + {7483.79f, -3085.44f, 439.607f, 6.25f, 0}, + {7491.14f, -3090.96f, 439.983f, 5.44f, 0}, + {7497.62f, -3098.22f, 436.854f, 5.44f, 0}, + {7498.72f, -3113.41f, 434.596f, 4.84f, 0}, + {7500.06f, -3122.51f, 434.749f, 5.17f, 0}, + {7504.96f, -3131.53f, 434.475f, 4.74f, 0}, + {7504.31f, -3133.53f, 435.693f, 3.84f, 6000}, + {7504.55f, -3133.27f, 435.476f, 0.68f, 15000}, + {7501.99f, -3126.01f, 434.93f, 1.83f, 0}, + {7490.76f, -3114.97f, 434.431f, 2.51f, 0}, + {7479.64f, -3105.51f, 431.123f, 1.83f, 0}, + {7474.63f, -3086.59f, 428.994f, 1.83f, 2000}, + {7472.96f, -3074.18f, 427.566f, 1.57f, 0}, + {7472.25f, -3063, 428.268f, 1.55f, 0}, + {7473.46f, -3054.22f, 427.588f, 0.36f, 0}, + {7475.08f, -3053.6f, 428.653f, 0.36f, 6000}, + {7474.66f, -3053.56f, 428.433f, 3.19f, 4000}, + {7471.81f, -3058.84f, 427.073f, 4.29f, 0}, + {7472.16f, -3064.91f, 427.772f, 4.95f, 0}, + {7471.56f, -3085.36f, 428.924f, 4.72f, 0}, + {7473.56f, -3093.48f, 429.294f, 5.04f, 0}, + {7478.94f, -3104.29f, 430.638f, 5.23f, 0}, + {7484.46f, -3109.61f, 432.769f, 5.79f, 0}, + {7490.23f, -3111.08f, 434.431f, 0.02f, 0}, + {7496.29f, -3108, 434.783f, 1.15f, 0}, + {7497.46f, -3100.66f, 436.191f, 1.50f, 0}, + {7495.64f, -3093.39f, 438.349f, 2.10f, 0}, + {7492.44f, -3086.01f, 440.267f, 1.38f, 0}, + {7498.26f, -3076.44f, 440.808f, 0.71f, 0}, + {7506.4f, -3067.35f, 443.64f, 0.77f, 0}, + {7518.37f, -3057.42f, 445.584f, 0.74f, 0}, + {7517.51f, -3056.3f, 444.568f, 2.49f, 4500} }; -#define ASPECT_RAVEN 22915 - -#define ASPECT_RAVEN_SUMMON_X 7472.96f -#define ASPECT_RAVEN_SUMMON_Y -3074.18f -#define ASPECT_RAVEN_SUMMON_Z 427.566f -#define CLINTAR_SPIRIT_SUMMON_X 7459.2275f -#define CLINTAR_SPIRIT_SUMMON_Y -3122.5632f -#define CLINTAR_SPIRIT_SUMMON_Z 438.9842f -#define CLINTAR_SPIRIT_SUMMON_O 0.8594f - -//from -1000292 to -1000287 are signed for 7806. but all this texts ids wrong. -#define CLINTAR_SPIRIT_SAY_START -1000286 -#define CLINTAR_SPIRIT_SAY_UNDER_ATTACK_1 -1000287 -#define CLINTAR_SPIRIT_SAY_UNDER_ATTACK_2 -1000288 -#define CLINTAR_SPIRIT_SAY_GET_ONE -1000289 -#define CLINTAR_SPIRIT_SAY_GET_TWO -1000290 -#define CLINTAR_SPIRIT_SAY_GET_THREE -1000291 -#define CLINTAR_SPIRIT_SAY_GET_FINAL -1000292 +Position const AspectRavenSummon = {7472.96f, -3074.18f, 427.566f, 0.0f}; +Position const ClintarSpiritSummon = {7459.2275f, -3122.5632f, 438.9842f, 0.8594f}; + +enum ClintarSpirit +{ + ASPECT_RAVEN = 22915, + + //from -1000292 to -1000287 are signed for 7806. but all this texts ids wrong. + CLINTAR_SPIRIT_SAY_START = -1000286, + CLINTAR_SPIRIT_SAY_UNDER_ATTACK_1 = -1000287, + CLINTAR_SPIRIT_SAY_UNDER_ATTACK_2 = -1000288, + CLINTAR_SPIRIT_SAY_GET_ONE = -1000289, + CLINTAR_SPIRIT_SAY_GET_TWO = -1000290, + CLINTAR_SPIRIT_SAY_GET_THREE = -1000291, + CLINTAR_SPIRIT_SAY_GET_FINAL = -1000292 +}; class npc_clintar_spirit : public CreatureScript { @@ -296,16 +296,16 @@ public: struct npc_clintar_spiritAI : public npc_escortAI { public: - npc_clintar_spiritAI(Creature* c) : npc_escortAI(c) {} + npc_clintar_spiritAI(Creature* creature) : npc_escortAI(creature) {} - uint32 Step; + uint8 Step; uint32 CurrWP; - uint32 Event_Timer; - uint32 checkPlayer_Timer; + uint32 EventTimer; + uint32 checkPlayerTimer; uint64 PlayerGUID; - bool Event_onWait; + bool EventOnWait; void Reset() { @@ -313,10 +313,10 @@ public: { Step = 0; CurrWP = 0; - Event_Timer = 0; + EventTimer = 0; PlayerGUID = 0; - checkPlayer_Timer = 1000; - Event_onWait = false; + checkPlayerTimer = 1000; + EventOnWait = false; } } @@ -347,8 +347,7 @@ public: void EnterCombat(Unit* who) { - uint32 rnd = rand()%2; - switch (rnd) + switch (urand(0, 1)) { case 0: DoScriptText(CLINTAR_SPIRIT_SAY_UNDER_ATTACK_1, me, who); break; case 1: DoScriptText(CLINTAR_SPIRIT_SAY_UNDER_ATTACK_2, me, who); break; @@ -357,9 +356,7 @@ public: void StartEvent(Player* player) { - if (!player) - return; - if (player->GetQuestStatus(10965) == QUEST_STATUS_INCOMPLETE) + if (player && player->GetQuestStatus(10965) == QUEST_STATUS_INCOMPLETE) { for (uint8 i = 0; i < 41; ++i) { @@ -381,18 +378,18 @@ public: return; } - if (!me->isInCombat() && !Event_onWait) + if (!me->isInCombat() && !EventOnWait) { - if (checkPlayer_Timer <= diff) + if (checkPlayerTimer <= diff) { Player* player = Unit::GetPlayer(*me, PlayerGUID); if (player && player->isInCombat() && player->getAttackerForHelper()) AttackStart(player->getAttackerForHelper()); - checkPlayer_Timer = 1000; - } else checkPlayer_Timer -= diff; + checkPlayerTimer = 1000; + } else checkPlayerTimer -= diff; } - if (Event_onWait && Event_Timer <= diff) + if (EventOnWait && EventTimer <= diff) { Player* player = Unit::GetPlayer(*me, PlayerGUID); @@ -409,11 +406,11 @@ public: { case 0: me->Say(CLINTAR_SPIRIT_SAY_START, 0, PlayerGUID); - Event_Timer = 8000; + EventTimer = 8000; Step = 1; break; case 1: - Event_onWait = false; + EventOnWait = false; break; } break; @@ -422,13 +419,13 @@ public: { case 0: me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 133); - Event_Timer = 5000; + EventTimer = 5000; Step = 1; break; case 1: me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); DoScriptText(CLINTAR_SPIRIT_SAY_GET_ONE, me, player); - Event_onWait = false; + EventOnWait = false; break; } break; @@ -437,12 +434,12 @@ public: { case 0: me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 133); - Event_Timer = 5000; + EventTimer = 5000; Step = 1; break; case 1: me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); - Event_onWait = false; + EventOnWait = false; break; } break; @@ -451,11 +448,11 @@ public: { case 0: DoScriptText(CLINTAR_SPIRIT_SAY_GET_TWO, me, player); - Event_Timer = 15000; + EventTimer = 15000; Step = 1; break; case 1: - Event_onWait = false; + EventOnWait = false; break; } break; @@ -463,19 +460,16 @@ public: switch (Step) { case 0: - { - Creature* mob = me->SummonCreature(ASPECT_RAVEN, ASPECT_RAVEN_SUMMON_X, ASPECT_RAVEN_SUMMON_Y, ASPECT_RAVEN_SUMMON_Z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000); - if (mob) + if (Creature* mob = me->SummonCreature(ASPECT_RAVEN, AspectRavenSummon, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000)) { mob->AddThreat(me, 10000.0f); mob->AI()->AttackStart(me); } - Event_Timer = 2000; + EventTimer = 2000; Step = 1; break; - } case 1: - Event_onWait = false; + EventOnWait = false; break; } break; @@ -484,12 +478,12 @@ public: { case 0: me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 133); - Event_Timer = 5000; + EventTimer = 5000; Step = 1; break; case 1: me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); - Event_onWait = false; + EventOnWait = false; break; } break; @@ -498,11 +492,11 @@ public: { case 0: DoScriptText(CLINTAR_SPIRIT_SAY_GET_THREE, me, player); - Event_Timer = 4000; + EventTimer = 4000; Step = 1; break; case 1: - Event_onWait = false; + EventOnWait = false; break; } break; @@ -513,12 +507,12 @@ public: me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 2); DoScriptText(CLINTAR_SPIRIT_SAY_GET_FINAL, me, player); player->CompleteQuest(10965); - Event_Timer = 1500; + EventTimer = 1500; Step = 1; break; case 1: me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); - Event_Timer = 3000; + EventTimer = 3000; Step = 2; break; case 2: @@ -530,19 +524,19 @@ public: } break; default: - Event_onWait = false; + EventOnWait = false; break; } - } else if (Event_onWait) Event_Timer -= diff; + } else if (EventOnWait) EventTimer -= diff; } - void WaypointReached(uint32 id) + void WaypointReached(uint32 waypointId) { - CurrWP = id; - Event_Timer = 0; + CurrWP = waypointId; + EventTimer = 0; Step = 0; - Event_onWait = true; + EventOnWait = true; } }; @@ -552,7 +546,10 @@ public: # npc_clintar_dreamwalker ####*/ -#define CLINTAR_SPIRIT 22916 +enum Clintar +{ + CLINTAR_SPIRIT = 22916 +}; class npc_clintar_dreamwalker : public CreatureScript { @@ -562,11 +559,8 @@ public: bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) { if (quest->GetQuestId() == 10965) - { - Creature* clintar_spirit = creature->SummonCreature(CLINTAR_SPIRIT, CLINTAR_SPIRIT_SUMMON_X, CLINTAR_SPIRIT_SUMMON_Y, CLINTAR_SPIRIT_SUMMON_Z, CLINTAR_SPIRIT_SUMMON_O, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 100000); - if (clintar_spirit) + if (Creature* clintar_spirit = creature->SummonCreature(CLINTAR_SPIRIT, ClintarSpiritSummon, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 100000)) CAST_AI(npc_clintar_spirit::npc_clintar_spiritAI, clintar_spirit->AI())->StartEvent(player); - } return true; } diff --git a/src/server/scripts/Kalimdor/mulgore.cpp b/src/server/scripts/Kalimdor/mulgore.cpp index c689d6954a4..5b35688c2b8 100644 --- a/src/server/scripts/Kalimdor/mulgore.cpp +++ b/src/server/scripts/Kalimdor/mulgore.cpp @@ -29,8 +29,9 @@ npc_kyle_frenzied npc_plains_vision EndContentData */ -#include "ScriptPCH.h" -#include "ScriptedEscortAI.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" /*###### # npc_skorn_whitecloud @@ -43,10 +44,10 @@ class npc_skorn_whitecloud : public CreatureScript public: npc_skorn_whitecloud() : CreatureScript("npc_skorn_whitecloud") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF) + if (action == GOSSIP_ACTION_INFO_DEF) player->SEND_GOSSIP_MENU(523, creature->GetGUID()); return true; @@ -71,7 +72,7 @@ public: # npc_kyle_frenzied ######*/ -enum eKyleFrenzied +enum KyleFrenzied { //emote signed for 7780 but propably thats wrong id. EMOTE_SEE_LUNCH = -1000340, @@ -96,32 +97,32 @@ public: struct npc_kyle_frenziedAI : public ScriptedAI { - npc_kyle_frenziedAI(Creature* c) : ScriptedAI(c) {} + npc_kyle_frenziedAI(Creature* creature) : ScriptedAI(creature) {} - bool bEvent; - bool m_bIsMovingToLunch; - uint64 uiPlayerGUID; - uint32 uiEventTimer; - uint8 uiEventPhase; + bool EventActive; + bool IsMovingToLunch; + uint64 PlayerGUID; + uint32 EventTimer; + uint8 EventPhase; void Reset() { - bEvent = false; - m_bIsMovingToLunch = false; - uiPlayerGUID = 0; - uiEventTimer = 5000; - uiEventPhase = 0; + EventActive = false; + IsMovingToLunch = false; + PlayerGUID = 0; + EventTimer = 5000; + EventPhase = 0; if (me->GetEntry() == NPC_KYLE_FRIENDLY) me->UpdateEntry(NPC_KYLE_FRENZIED); } - void SpellHit(Unit* pCaster, SpellInfo const* pSpell) + void SpellHit(Unit* Caster, SpellInfo const* Spell) { - if (!me->getVictim() && !bEvent && pSpell->Id == SPELL_LUNCH) + if (!me->getVictim() && !EventActive && Spell->Id == SPELL_LUNCH) { - if (pCaster->GetTypeId() == TYPEID_PLAYER) - uiPlayerGUID = pCaster->GetGUID(); + if (Caster->GetTypeId() == TYPEID_PLAYER) + PlayerGUID = Caster->GetGUID(); if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE) { @@ -130,41 +131,41 @@ public: me->StopMoving(); } - bEvent = true; + EventActive = true; DoScriptText(EMOTE_SEE_LUNCH, me); me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_CREATURE_SPECIAL); } } - void MovementInform(uint32 uiType, uint32 uiPointId) + void MovementInform(uint32 Type, uint32 PointId) { - if (uiType != POINT_MOTION_TYPE || !bEvent) + if (Type != POINT_MOTION_TYPE || !EventActive) return; - if (uiPointId == POINT_ID) - m_bIsMovingToLunch = false; + if (PointId == POINT_ID) + IsMovingToLunch = false; } void UpdateAI(const uint32 diff) { - if (bEvent) + if (EventActive) { - if (m_bIsMovingToLunch) + if (IsMovingToLunch) return; - if (uiEventTimer <= diff) + if (EventTimer <= diff) { - uiEventTimer = 5000; - ++uiEventPhase; + EventTimer = 5000; + ++EventPhase; - switch (uiEventPhase) + switch (EventPhase) { case 1: - if (Unit* unit = Unit::GetUnit(*me, uiPlayerGUID)) + if (Unit* unit = Unit::GetUnit(*me, PlayerGUID)) { if (GameObject* go = unit->GetGameObject(SPELL_LUNCH)) { - m_bIsMovingToLunch = true; + IsMovingToLunch = true; me->GetMotionMaster()->MovePoint(POINT_ID, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ()); } } @@ -174,13 +175,13 @@ public: me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_USE_STANDING); break; case 3: - if (Player* unit = Unit::GetPlayer(*me, uiPlayerGUID)) + if (Player* unit = Unit::GetPlayer(*me, PlayerGUID)) unit->TalkedToCreature(me->GetEntry(), me->GetGUID()); me->UpdateEntry(NPC_KYLE_FRIENDLY); break; case 4: - uiEventTimer = 30000; + EventTimer = 30000; DoScriptText(EMOTE_DANCE, me); me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_DANCESPECIAL); break; @@ -192,7 +193,7 @@ public: } } else - uiEventTimer -= diff; + EventTimer -= diff; } } }; @@ -203,58 +204,58 @@ public: # npc_plains_vision ######*/ -float wp_plain_vision[50][3] = +Position const wpPlainVision[50] = { - {-2226.32f, -408.095f, -9.36235f}, - {-2203.04f, -437.212f, -5.72498f}, - {-2163.91f, -457.851f, -7.09049f}, - {-2123.87f, -448.137f, -9.29591f}, - {-2104.66f, -427.166f, -6.49513f}, - {-2101.48f, -422.826f, -5.3567f}, - {-2097.56f, -417.083f, -7.16716f}, - {-2084.87f, -398.626f, -9.88973f}, - {-2072.71f, -382.324f, -10.2488f}, - {-2054.05f, -356.728f, -6.22468f}, - {-2051.8f, -353.645f, -5.35791f}, - {-2049.08f, -349.912f, -6.15723f}, - {-2030.6f, -310.724f, -9.59302f}, - {-2002.15f, -249.308f, -10.8124f}, - {-1972.85f, -195.811f, -10.6316f}, - {-1940.93f, -147.652f, -11.7055f}, - {-1888.06f, -81.943f, -11.4404f}, - {-1837.05f, -34.0109f, -12.258f}, - {-1796.12f, -14.6462f, -10.3581f}, - {-1732.61f, -4.27746f, -10.0213f}, - {-1688.94f, -0.829945f, -11.7103f}, - {-1681.32f, 13.0313f, -9.48056f}, - {-1677.04f, 36.8349f, -7.10318f}, - {-1675.2f, 68.559f, -8.95384f}, - {-1676.57f, 89.023f, -9.65104f}, - {-1678.16f, 110.939f, -10.1782f}, - {-1677.86f, 128.681f, -5.73869f}, - {-1675.27f, 144.324f, -3.47916f}, - {-1671.7f, 163.169f, -1.23098f}, - {-1666.61f, 181.584f, 5.26145f}, - {-1661.51f, 196.154f, 8.95252f}, - {-1655.47f, 210.811f, 8.38727f}, - {-1647.07f, 226.947f, 5.27755f}, - {-1621.65f, 232.91f, 2.69579f}, - {-1600.23f, 237.641f, 2.98539f}, - {-1576.07f, 242.546f, 4.66541f}, - {-1554.57f, 248.494f, 6.60377f}, - {-1547.53f, 259.302f, 10.6741f}, - {-1541.7f, 269.847f, 16.4418f}, - {-1539.83f, 278.989f, 21.0597f}, - {-1540.16f, 290.219f, 27.8247f}, - {-1538.99f, 298.983f, 34.0032f}, - {-1540.38f, 307.337f, 41.3557f}, - {-1536.61f, 314.884f, 48.0179f}, - {-1532.42f, 323.277f, 55.6667f}, - {-1528.77f, 329.774f, 61.1525f}, - {-1525.65f, 333.18f, 63.2161f}, - {-1517.01f, 350.713f, 62.4286f}, - {-1511.39f, 362.537f, 62.4539f}, - {-1508.68f, 366.822f, 62.733f} + {-2226.32f, -408.095f, -9.36235f, 0.0f}, + {-2203.04f, -437.212f, -5.72498f, 0.0f}, + {-2163.91f, -457.851f, -7.09049f, 0.0f}, + {-2123.87f, -448.137f, -9.29591f, 0.0f}, + {-2104.66f, -427.166f, -6.49513f, 0.0f}, + {-2101.48f, -422.826f, -5.3567f, 0.0f}, + {-2097.56f, -417.083f, -7.16716f, 0.0f}, + {-2084.87f, -398.626f, -9.88973f, 0.0f}, + {-2072.71f, -382.324f, -10.2488f, 0.0f}, + {-2054.05f, -356.728f, -6.22468f, 0.0f}, + {-2051.8f, -353.645f, -5.35791f, 0.0f}, + {-2049.08f, -349.912f, -6.15723f, 0.0f}, + {-2030.6f, -310.724f, -9.59302f, 0.0f}, + {-2002.15f, -249.308f, -10.8124f, 0.0f}, + {-1972.85f, -195.811f, -10.6316f, 0.0f}, + {-1940.93f, -147.652f, -11.7055f, 0.0f}, + {-1888.06f, -81.943f, -11.4404f, 0.0f}, + {-1837.05f, -34.0109f, -12.258f, 0.0f}, + {-1796.12f, -14.6462f, -10.3581f, 0.0f}, + {-1732.61f, -4.27746f, -10.0213f, 0.0f}, + {-1688.94f, -0.829945f, -11.7103f, 0.0f}, + {-1681.32f, 13.0313f, -9.48056f, 0.0f}, + {-1677.04f, 36.8349f, -7.10318f, 0.0f}, + {-1675.2f, 68.559f, -8.95384f, 0.0f}, + {-1676.57f, 89.023f, -9.65104f, 0.0f}, + {-1678.16f, 110.939f, -10.1782f, 0.0f}, + {-1677.86f, 128.681f, -5.73869f, 0.0f}, + {-1675.27f, 144.324f, -3.47916f, 0.0f}, + {-1671.7f, 163.169f, -1.23098f, 0.0f}, + {-1666.61f, 181.584f, 5.26145f, 0.0f}, + {-1661.51f, 196.154f, 8.95252f, 0.0f}, + {-1655.47f, 210.811f, 8.38727f, 0.0f}, + {-1647.07f, 226.947f, 5.27755f, 0.0f}, + {-1621.65f, 232.91f, 2.69579f, 0.0f}, + {-1600.23f, 237.641f, 2.98539f, 0.0f}, + {-1576.07f, 242.546f, 4.66541f, 0.0f}, + {-1554.57f, 248.494f, 6.60377f, 0.0f}, + {-1547.53f, 259.302f, 10.6741f, 0.0f}, + {-1541.7f, 269.847f, 16.4418f, 0.0f}, + {-1539.83f, 278.989f, 21.0597f, 0.0f}, + {-1540.16f, 290.219f, 27.8247f, 0.0f}, + {-1538.99f, 298.983f, 34.0032f, 0.0f}, + {-1540.38f, 307.337f, 41.3557f, 0.0f}, + {-1536.61f, 314.884f, 48.0179f, 0.0f}, + {-1532.42f, 323.277f, 55.6667f, 0.0f}, + {-1528.77f, 329.774f, 61.1525f, 0.0f}, + {-1525.65f, 333.18f, 63.2161f, 0.0f}, + {-1517.01f, 350.713f, 62.4286f, 0.0f}, + {-1511.39f, 362.537f, 62.4539f, 0.0f}, + {-1508.68f, 366.822f, 62.733f, 0.0f} }; class npc_plains_vision : public CreatureScript @@ -269,7 +270,7 @@ public: struct npc_plains_visionAI : public ScriptedAI { - npc_plains_visionAI(Creature* c) : ScriptedAI(c) {} + npc_plains_visionAI(Creature* creature) : ScriptedAI(creature) {} bool newWaypoint; uint8 WayPointId; @@ -305,7 +306,7 @@ public: { if (newWaypoint) { - me->GetMotionMaster()->MovePoint(WayPointId, wp_plain_vision[WayPointId][0], wp_plain_vision[WayPointId][1], wp_plain_vision[WayPointId][2]); + me->GetMotionMaster()->MovePoint(WayPointId, wpPlainVision[WayPointId]); newWaypoint = false; } } diff --git a/src/server/scripts/Kalimdor/orgrimmar.cpp b/src/server/scripts/Kalimdor/orgrimmar.cpp index 629abb84fc1..fca8d0f5fc5 100644 --- a/src/server/scripts/Kalimdor/orgrimmar.cpp +++ b/src/server/scripts/Kalimdor/orgrimmar.cpp @@ -28,13 +28,15 @@ npc_shenthul npc_thrall_warchief EndContentData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" /*###### ## npc_shenthul ######*/ -enum eShenthul +enum Shenthul { QUEST_SHATTERED_SALUTE = 2460 }; @@ -61,20 +63,20 @@ public: struct npc_shenthulAI : public ScriptedAI { - npc_shenthulAI(Creature* c) : ScriptedAI(c) {} + npc_shenthulAI(Creature* creature) : ScriptedAI(creature) {} bool CanTalk; bool CanEmote; - uint32 Salute_Timer; - uint32 Reset_Timer; + uint32 SaluteTimer; + uint32 ResetTimer; uint64 PlayerGUID; void Reset() { CanTalk = false; CanEmote = false; - Salute_Timer = 6000; - Reset_Timer = 0; + SaluteTimer = 6000; + ResetTimer = 0; PlayerGUID = 0; } @@ -84,7 +86,7 @@ public: { if (CanEmote) { - if (Reset_Timer <= diff) + if (ResetTimer <= diff) { if (Player* player = Unit::GetPlayer(*me, PlayerGUID)) { @@ -92,17 +94,17 @@ public: player->FailQuest(QUEST_SHATTERED_SALUTE); } Reset(); - } else Reset_Timer -= diff; + } else ResetTimer -= diff; } if (CanTalk && !CanEmote) { - if (Salute_Timer <= diff) + if (SaluteTimer <= diff) { me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); CanEmote = true; - Reset_Timer = 60000; - } else Salute_Timer -= diff; + ResetTimer = 60000; + } else SaluteTimer -= diff; } if (!UpdateVictim()) @@ -130,10 +132,13 @@ public: ## npc_thrall_warchief ######*/ -#define QUEST_6566 6566 +enum ThrallWarchief +{ + QUEST_6566 = 6566, -#define SPELL_CHAIN_LIGHTNING 16033 -#define SPELL_SHOCK 16034 + SPELL_CHAIN_LIGHTNING = 16033, + SPELL_SHOCK = 16034 +}; #define GOSSIP_HTW "Please share your wisdom with me, Warchief." #define GOSSIP_STW1 "What discoveries?" @@ -149,10 +154,10 @@ class npc_thrall_warchief : public CreatureScript public: npc_thrall_warchief() : CreatureScript("npc_thrall_warchief") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); @@ -205,15 +210,15 @@ public: struct npc_thrall_warchiefAI : public ScriptedAI { - npc_thrall_warchiefAI(Creature* c) : ScriptedAI(c) {} + npc_thrall_warchiefAI(Creature* creature) : ScriptedAI(creature) {} - uint32 ChainLightning_Timer; - uint32 Shock_Timer; + uint32 ChainLightningTimer; + uint32 ShockTimer; void Reset() { - ChainLightning_Timer = 2000; - Shock_Timer = 8000; + ChainLightningTimer = 2000; + ShockTimer = 8000; } void EnterCombat(Unit* /*who*/) {} @@ -223,17 +228,17 @@ public: if (!UpdateVictim()) return; - if (ChainLightning_Timer <= diff) + if (ChainLightningTimer <= diff) { DoCast(me->getVictim(), SPELL_CHAIN_LIGHTNING); - ChainLightning_Timer = 9000; - } else ChainLightning_Timer -= diff; + ChainLightningTimer = 9000; + } else ChainLightningTimer -= diff; - if (Shock_Timer <= diff) + if (ShockTimer <= diff) { DoCast(me->getVictim(), SPELL_SHOCK); - Shock_Timer = 15000; - } else Shock_Timer -= diff; + ShockTimer = 15000; + } else ShockTimer -= diff; DoMeleeAttackIfReady(); } diff --git a/src/server/scripts/Kalimdor/silithus.cpp b/src/server/scripts/Kalimdor/silithus.cpp index fac56021c3a..639de3dc3b2 100644 --- a/src/server/scripts/Kalimdor/silithus.cpp +++ b/src/server/scripts/Kalimdor/silithus.cpp @@ -29,7 +29,9 @@ npcs_rutgar_and_frankal quest_a_pawn_on_the_eternal_pawn EndContentData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" #include "Group.h" /*### @@ -49,10 +51,10 @@ class npc_highlord_demitrian : public CreatureScript public: npc_highlord_demitrian() : CreatureScript("npc_highlord_demitrian") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEMITRIAN2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); @@ -125,19 +127,21 @@ public: #define GOSSIP_ITEM14 "I should ask the monkey about this" #define GOSSIP_ITEM15 "Then what..." -//trigger creatures to kill -#define TRIGGER_RUTGAR 15222 -#define TRIGGER_FRANKAL 15221 +enum RutgarAndFrankal //trigger creatures to kill +{ + TRIGGER_FRANKAL = 15221, + TRIGGER_RUTGAR = 15222 +}; class npcs_rutgar_and_frankal : public CreatureScript { public: npcs_rutgar_and_frankal() : CreatureScript("npcs_rutgar_and_frankal") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); @@ -223,7 +227,7 @@ public: /*#### # quest_a_pawn_on_the_eternal_board (Defines) ####*/ -enum eEternalBoard +enum EternalBoard { QUEST_A_PAWN_ON_THE_ETERNAL_BOARD = 8519, @@ -290,7 +294,6 @@ TO DO: get correct spell IDs and timings for spells cast upon dragon transformat TO DO: Dragons should use the HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF) after transformation, but for some unknown reason it doesnt work. EndContentData */ -#define QUEST_A_PAWN_ON_THE_ETERNAL_BOARD 8519 #define EVENT_AREA_RADIUS 65 //65yds #define EVENT_COOLDOWN 500000 //in ms. appear after event completed or failed (should be = Adds despawn time) @@ -374,7 +377,7 @@ static QuestCinematic EventAnim[]= }; //Cordinates for Spawns -static const Position SpawnLocation[]= +Position const SpawnLocation[] = { {-8085.0f, 1528.0f, 2.61f, 3.141592f}, //Kaldorei Infantry {-8080.0f, 1526.0f, 2.61f, 3.141592f}, //Kaldorei Infantry @@ -455,7 +458,7 @@ struct WaveData int32 WaveTextId; }; -static WaveData WavesInfo[] = +static WaveData WavesInfo[5] = { {30, 0, 15423, 0, 0, 24000, 0}, // Kaldorei Soldier { 3, 35, 15424, 0, 0, 24000, 0}, // Anubisath Conqueror @@ -470,7 +473,7 @@ struct SpawnSpells uint32 Timer1, Timer2, SpellId; }; -static SpawnSpells SpawnCast[]=// +static SpawnSpells SpawnCast[4] = { {100000, 2000, 33652}, // Stop Time {38500, 300000, 28528}, // Poison Cloud @@ -485,14 +488,14 @@ class npc_anachronos_the_ancient : public CreatureScript public: npc_anachronos_the_ancient() : CreatureScript("npc_anachronos_the_ancient") { } - CreatureAI* GetAI(Creature* c) const + CreatureAI* GetAI(Creature* creature) const { - return new npc_anachronos_the_ancientAI(c); + return new npc_anachronos_the_ancientAI(creature); } struct npc_anachronos_the_ancientAI : public ScriptedAI { - npc_anachronos_the_ancientAI(Creature* c) : ScriptedAI(c) {} + npc_anachronos_the_ancientAI(Creature* creature) : ScriptedAI(creature) {} uint32 AnimationTimer; uint8 AnimationCount; @@ -576,7 +579,7 @@ public: break; case 10: Merithra->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); - Merithra->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + Merithra->SetDisableGravity(true); Merithra->GetMotionMaster()->MoveCharge(-8065, 1530, 6.61f, 3); break; case 11: @@ -603,7 +606,7 @@ public: break; case 18: Arygos->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); - Arygos->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + Arygos->SetDisableGravity(true); Arygos->GetMotionMaster()->MoveCharge(-8065, 1530, 6.61f, 42); break; case 19: @@ -630,7 +633,7 @@ public: break; case 26: Caelestrasz->HandleEmoteCommand(254); - Caelestrasz->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + Caelestrasz->SetDisableGravity(true); Caelestrasz->GetMotionMaster()->MoveCharge(-8065, 1530, 7.61f, 4); break; case 27: @@ -769,7 +772,7 @@ public: break; case 63: me->HandleEmoteCommand(254); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetDisableGravity(true); break; case 64: me->GetMotionMaster()->MoveCharge(-8000, 1400, 150, 9); @@ -813,14 +816,14 @@ class mob_qiraj_war_spawn : public CreatureScript public: mob_qiraj_war_spawn() : CreatureScript("mob_qiraj_war_spawn") { } - CreatureAI* GetAI(Creature* c) const + CreatureAI* GetAI(Creature* creature) const { - return new mob_qiraj_war_spawnAI(c); + return new mob_qiraj_war_spawnAI(creature); } struct mob_qiraj_war_spawnAI : public ScriptedAI { - mob_qiraj_war_spawnAI(Creature* c) : ScriptedAI(c) {} + mob_qiraj_war_spawnAI(Creature* creature) : ScriptedAI(creature) {} uint64 MobGUID; uint64 PlayerGUID; @@ -928,14 +931,14 @@ class npc_anachronos_quest_trigger : public CreatureScript public: npc_anachronos_quest_trigger() : CreatureScript("npc_anachronos_quest_trigger") { } - CreatureAI* GetAI(Creature* c) const + CreatureAI* GetAI(Creature* creature) const { - return new npc_anachronos_quest_triggerAI(c); + return new npc_anachronos_quest_triggerAI(creature); } struct npc_anachronos_quest_triggerAI : public ScriptedAI { - npc_anachronos_quest_triggerAI(Creature* c) : ScriptedAI(c) {} + npc_anachronos_quest_triggerAI(Creature* creature) : ScriptedAI(creature) {} uint64 PlayerGUID; @@ -967,16 +970,15 @@ public: void SummonNextWave() { - //uint8 count = WavesInfo[WaveCount].SpawnCount; uint8 locIndex = WavesInfo[WaveCount].UsedSpawnPoint; - //uint8 KaldoreiSoldierCount = 0; - //uint8 AnubisathConquerorCount = 0; - //uint8 QirajiWaspCount = 0; - for (uint8 i = 0; i < 67; ++i) + uint8 count = locIndex + WavesInfo[WaveCount].SpawnCount; + + for (uint8 i = locIndex; i <= count; ++i) { - if (Creature* spawn = me->SummonCreature(WavesInfo[WaveCount].CreatureId, SpawnLocation[locIndex + i], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, WavesInfo[WaveCount].DespTimer)) + uint32 desptimer = WavesInfo[WaveCount].DespTimer; + + if (Creature* spawn = me->SummonCreature(WavesInfo[WaveCount].CreatureId, SpawnLocation[i], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, desptimer)) { - spawn->LoadCreaturesAddon(); if (spawn->GetEntry() == 15423) spawn->SetUInt32Value(UNIT_FIELD_DISPLAYID, 15427+rand()%4); if (i >= 30) WaveCount = 1; @@ -986,12 +988,15 @@ public: if (WaveCount < 5) //1-4 Wave { - mob_qiraj_war_spawn::mob_qiraj_war_spawnAI* spawnAI = CAST_AI(mob_qiraj_war_spawn::mob_qiraj_war_spawnAI, spawn->AI()); - spawnAI->MobGUID = me->GetGUID(); - spawnAI->PlayerGUID = PlayerGUID; + if (mob_qiraj_war_spawn::mob_qiraj_war_spawnAI* spawnAI = CAST_AI(mob_qiraj_war_spawn::mob_qiraj_war_spawnAI, spawn->AI())) + { + spawnAI->MobGUID = me->GetGUID(); + spawnAI->PlayerGUID = PlayerGUID; + } } } } + WaveTimer = WavesInfo[WaveCount].SpawnTimer; AnnounceTimer = WavesInfo[WaveCount].YellTimer; } @@ -1005,27 +1010,27 @@ public: if (Group* EventGroup = player->GetGroup()) { - Player* GroupMember; + Player* groupMember; uint8 GroupMemberCount = 0; uint8 DeadMemberCount = 0; uint8 FailedMemberCount = 0; - const Group::MemberSlotList members = EventGroup->GetMemberSlots(); + Group::MemberSlotList const members = EventGroup->GetMemberSlots(); for (Group::member_citerator itr = members.begin(); itr!= members.end(); ++itr) { - GroupMember = (Unit::GetPlayer(*me, itr->guid)); - if (!GroupMember) + groupMember = (Unit::GetPlayer(*me, itr->guid)); + if (!groupMember) continue; - if (!GroupMember->IsWithinDistInMap(me, EVENT_AREA_RADIUS) && GroupMember->GetQuestStatus(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD) == QUEST_STATUS_INCOMPLETE) + if (!groupMember->IsWithinDistInMap(me, EVENT_AREA_RADIUS) && groupMember->GetQuestStatus(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD) == QUEST_STATUS_INCOMPLETE) { - GroupMember->FailQuest(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD); + groupMember->FailQuest(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD); ++FailedMemberCount; } ++GroupMemberCount; - if (GroupMember->isDead()) + if (groupMember->isDead()) ++DeadMemberCount; } @@ -1069,8 +1074,13 @@ public: void mob_qiraj_war_spawn::mob_qiraj_war_spawnAI::JustDied(Unit* /*slayer*/) { me->RemoveCorpse(); - if (Creature* Mob = (Unit::GetCreature(*me, MobGUID))) - CAST_AI(npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI, Mob->AI())->LiveCounter(); + + if (!MobGUID) + return; + + if (Creature* mob = Unit::GetCreature(*me, MobGUID)) + if (npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI* triggerAI = CAST_AI(npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI, mob->AI())) + triggerAI->LiveCounter(); }; @@ -1087,15 +1097,13 @@ public: { if (quest->GetQuestId() == QUEST_A_PAWN_ON_THE_ETERNAL_BOARD) { - - if (Unit* Anachronos_Quest_Trigger = go->FindNearestCreature(15454, 100, player)) + if (Creature* trigger = go->FindNearestCreature(15454, 100, player)) { - - Unit* Merithra = Anachronos_Quest_Trigger->SummonCreature(15378, -8034.535f, 1535.14f, 2.61f, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000); - Unit* Caelestrasz = Anachronos_Quest_Trigger->SummonCreature(15379, -8032.767f, 1533.148f, 2.61f, 1.5f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000); - Unit* Arygos = Anachronos_Quest_Trigger->SummonCreature(15380, -8034.52f, 1537.843f, 2.61f, 5.7f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000); - /* Unit* Fandral = */ Anachronos_Quest_Trigger->SummonCreature(15382, -8028.462f, 1535.843f, 2.61f, 3.141592f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000); - Creature* Anachronos = Anachronos_Quest_Trigger->SummonCreature(15381, -8028.75f, 1538.795f, 2.61f, 4, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000); + Unit* Merithra = trigger->SummonCreature(15378, -8034.535f, 1535.14f, 2.61f, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000); + Unit* Caelestrasz = trigger->SummonCreature(15379, -8032.767f, 1533.148f, 2.61f, 1.5f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000); + Unit* Arygos = trigger->SummonCreature(15380, -8034.52f, 1537.843f, 2.61f, 5.7f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000); + /* Unit* Fandral = */ trigger->SummonCreature(15382, -8028.462f, 1535.843f, 2.61f, 3.141592f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000); + Creature* Anachronos = trigger->SummonCreature(15381, -8028.75f, 1538.795f, 2.61f, 4, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000); if (Merithra) { @@ -1123,11 +1131,16 @@ public: if (Anachronos) { - CAST_AI(npc_anachronos_the_ancient::npc_anachronos_the_ancientAI, Anachronos->AI())->PlayerGUID = player->GetGUID(); - CAST_AI(npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI, CAST_CRE(Anachronos_Quest_Trigger)->AI())->Failed=false; - CAST_AI(npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI, CAST_CRE(Anachronos_Quest_Trigger)->AI())->PlayerGUID = player->GetGUID(); - CAST_AI(npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI, CAST_CRE(Anachronos_Quest_Trigger)->AI())->EventStarted=true; - CAST_AI(npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI, CAST_CRE(Anachronos_Quest_Trigger)->AI())->Announced=true; + if (npc_anachronos_the_ancient::npc_anachronos_the_ancientAI* anachronosAI = CAST_AI(npc_anachronos_the_ancient::npc_anachronos_the_ancientAI, Anachronos->AI())) + anachronosAI->PlayerGUID = player->GetGUID(); + + if (npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI* triggerAI = CAST_AI(npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI, trigger->AI())) + { + triggerAI->Failed = false; + triggerAI->PlayerGUID = player->GetGUID(); + triggerAI->EventStarted = true; + triggerAI->Announced = true; + } } } } diff --git a/src/server/scripts/Kalimdor/stonetalon_mountains.cpp b/src/server/scripts/Kalimdor/stonetalon_mountains.cpp index c31a7731865..d38395c7b37 100644 --- a/src/server/scripts/Kalimdor/stonetalon_mountains.cpp +++ b/src/server/scripts/Kalimdor/stonetalon_mountains.cpp @@ -28,7 +28,9 @@ npc_braug_dimspirit npc_kaya_flathoof EndContentData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" #include "ScriptedEscortAI.h" /*###### @@ -46,16 +48,16 @@ class npc_braug_dimspirit : public CreatureScript public: npc_braug_dimspirit() : CreatureScript("npc_braug_dimspirit") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { player->CLOSE_GOSSIP_MENU(); creature->CastSpell(player, 6766, false); } - if (uiAction == GOSSIP_ACTION_INFO_DEF+2) + if (action == GOSSIP_ACTION_INFO_DEF+2) { player->CLOSE_GOSSIP_MENU(); player->AreaExploredOrEventHappens(6627); @@ -90,7 +92,7 @@ public: ## npc_kaya_flathoof ######*/ -enum eKaya +enum Kaya { FACTION_ESCORTEE_H = 775, @@ -112,28 +114,27 @@ public: struct npc_kaya_flathoofAI : public npc_escortAI { - npc_kaya_flathoofAI(Creature* c) : npc_escortAI(c) {} + npc_kaya_flathoofAI(Creature* creature) : npc_escortAI(creature) {} - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - switch (i) + switch (waypointId) { - case 16: - DoScriptText(SAY_AMBUSH, me); - me->SummonCreature(NPC_GRIMTOTEM_BRUTE, -48.53f, -503.34f, -46.31f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - me->SummonCreature(NPC_GRIMTOTEM_RUFFIAN, -38.85f, -503.77f, -45.90f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - me->SummonCreature(NPC_GRIMTOTEM_SORCERER, -36.37f, -496.23f, -45.71f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - break; - case 18: me->SetInFront(player); - DoScriptText(SAY_END, me, player); - if (player) + case 16: + DoScriptText(SAY_AMBUSH, me); + me->SummonCreature(NPC_GRIMTOTEM_BRUTE, -48.53f, -503.34f, -46.31f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + me->SummonCreature(NPC_GRIMTOTEM_RUFFIAN, -38.85f, -503.77f, -45.90f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + me->SummonCreature(NPC_GRIMTOTEM_SORCERER, -36.37f, -496.23f, -45.71f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + break; + case 18: + me->SetInFront(player); + DoScriptText(SAY_END, me, player); player->GroupEventHappens(QUEST_PROTECT_KAYA, me); - break; + break; } } diff --git a/src/server/scripts/Kalimdor/tanaris.cpp b/src/server/scripts/Kalimdor/tanaris.cpp index ff6cdccb66a..9b742b495bb 100644 --- a/src/server/scripts/Kalimdor/tanaris.cpp +++ b/src/server/scripts/Kalimdor/tanaris.cpp @@ -33,7 +33,9 @@ npc_OOX17 npc_tooga EndContentData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" #include "ScriptedEscortAI.h" #include "ScriptedFollowerAI.h" @@ -41,10 +43,13 @@ EndContentData */ ## mob_aquementas ######*/ -#define AGGRO_YELL_AQUE -1000350 +enum Aquementas +{ + AGGRO_YELL_AQUE = -1000350, -#define SPELL_AQUA_JET 13586 -#define SPELL_FROST_SHOCK 15089 + SPELL_AQUA_JET = 13586, + SPELL_FROST_SHOCK = 15089 +}; class mob_aquementas : public CreatureScript { @@ -58,24 +63,24 @@ public: struct mob_aquementasAI : public ScriptedAI { - mob_aquementasAI(Creature* c) : ScriptedAI(c) {} + mob_aquementasAI(Creature* creature) : ScriptedAI(creature) {} - uint32 SendItem_Timer; - uint32 SwitchFaction_Timer; + uint32 SendItemTimer; + uint32 SwitchFactionTimer; bool isFriendly; - uint32 FrostShock_Timer; - uint32 AquaJet_Timer; + uint32 FrostShockTimer; + uint32 AquaJetTimer; void Reset() { - SendItem_Timer = 0; - SwitchFaction_Timer = 10000; + SendItemTimer = 0; + SwitchFactionTimer = 10000; me->setFaction(35); isFriendly = true; - AquaJet_Timer = 5000; - FrostShock_Timer = 1000; + AquaJetTimer = 5000; + FrostShockTimer = 1000; } void SendItem(Unit* receiver) @@ -101,11 +106,11 @@ public: { if (isFriendly) { - if (SwitchFaction_Timer <= diff) + if (SwitchFactionTimer <= diff) { me->setFaction(91); isFriendly = false; - } else SwitchFaction_Timer -= diff; + } else SwitchFactionTimer -= diff; } if (!UpdateVictim()) @@ -113,25 +118,25 @@ public: if (!isFriendly) { - if (SendItem_Timer <= diff) + if (SendItemTimer <= diff) { if (me->getVictim()->GetTypeId() == TYPEID_PLAYER) SendItem(me->getVictim()); - SendItem_Timer = 5000; - } else SendItem_Timer -= diff; + SendItemTimer = 5000; + } else SendItemTimer -= diff; } - if (FrostShock_Timer <= diff) + if (FrostShockTimer <= diff) { DoCast(me->getVictim(), SPELL_FROST_SHOCK); - FrostShock_Timer = 15000; - } else FrostShock_Timer -= diff; + FrostShockTimer = 15000; + } else FrostShockTimer -= diff; - if (AquaJet_Timer <= diff) + if (AquaJetTimer <= diff) { DoCast(me, SPELL_AQUA_JET); - AquaJet_Timer = 15000; - } else AquaJet_Timer -= diff; + AquaJetTimer = 15000; + } else AquaJetTimer -= diff; DoMeleeAttackIfReady(); } @@ -143,20 +148,23 @@ public: ## npc_custodian_of_time ######*/ -#define WHISPER_CUSTODIAN_1 -1000217 -#define WHISPER_CUSTODIAN_2 -1000218 -#define WHISPER_CUSTODIAN_3 -1000219 -#define WHISPER_CUSTODIAN_4 -1000220 -#define WHISPER_CUSTODIAN_5 -1000221 -#define WHISPER_CUSTODIAN_6 -1000222 -#define WHISPER_CUSTODIAN_7 -1000223 -#define WHISPER_CUSTODIAN_8 -1000224 -#define WHISPER_CUSTODIAN_9 -1000225 -#define WHISPER_CUSTODIAN_10 -1000226 -#define WHISPER_CUSTODIAN_11 -1000227 -#define WHISPER_CUSTODIAN_12 -1000228 -#define WHISPER_CUSTODIAN_13 -1000229 -#define WHISPER_CUSTODIAN_14 -1000230 +enum CustodianOfTime +{ + WHISPER_CUSTODIAN_1 = -1000217, + WHISPER_CUSTODIAN_2 = -1000218, + WHISPER_CUSTODIAN_3 = -1000219, + WHISPER_CUSTODIAN_4 = -1000220, + WHISPER_CUSTODIAN_5 = -1000221, + WHISPER_CUSTODIAN_6 = -1000222, + WHISPER_CUSTODIAN_7 = -1000223, + WHISPER_CUSTODIAN_8 = -1000224, + WHISPER_CUSTODIAN_9 = -1000225, + WHISPER_CUSTODIAN_10 = -1000226, + WHISPER_CUSTODIAN_11 = -1000227, + WHISPER_CUSTODIAN_12 = -1000228, + WHISPER_CUSTODIAN_13 = -1000229, + WHISPER_CUSTODIAN_14 = -1000230 +}; class npc_custodian_of_time : public CreatureScript { @@ -170,39 +178,72 @@ public: struct npc_custodian_of_timeAI : public npc_escortAI { - npc_custodian_of_timeAI(Creature* c) : npc_escortAI(c) {} + npc_custodian_of_timeAI(Creature* creature) : npc_escortAI(creature) {} - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - Player* player = GetPlayerForEscort(); - if (!player) - return; - - switch (i) + if (Player* player = GetPlayerForEscort()) { - case 0: DoScriptText(WHISPER_CUSTODIAN_1, me, player); break; - case 1: DoScriptText(WHISPER_CUSTODIAN_2, me, player); break; - case 2: DoScriptText(WHISPER_CUSTODIAN_3, me, player); break; - case 3: DoScriptText(WHISPER_CUSTODIAN_4, me, player); break; - case 5: DoScriptText(WHISPER_CUSTODIAN_5, me, player); break; - case 6: DoScriptText(WHISPER_CUSTODIAN_6, me, player); break; - case 7: DoScriptText(WHISPER_CUSTODIAN_7, me, player); break; - case 8: DoScriptText(WHISPER_CUSTODIAN_8, me, player); break; - case 9: DoScriptText(WHISPER_CUSTODIAN_9, me, player); break; - case 10: DoScriptText(WHISPER_CUSTODIAN_4, me, player); break; - case 13: DoScriptText(WHISPER_CUSTODIAN_10, me, player); break; - case 14: DoScriptText(WHISPER_CUSTODIAN_4, me, player); break; - case 16: DoScriptText(WHISPER_CUSTODIAN_11, me, player); break; - case 17: DoScriptText(WHISPER_CUSTODIAN_12, me, player); break; - case 18: DoScriptText(WHISPER_CUSTODIAN_4, me, player); break; - case 22: DoScriptText(WHISPER_CUSTODIAN_13, me, player); break; - case 23: DoScriptText(WHISPER_CUSTODIAN_4, me, player); break; - case 24: - DoScriptText(WHISPER_CUSTODIAN_14, me, player); - DoCast(player, 34883); - // below here is temporary workaround, to be removed when spell works properly - player->AreaExploredOrEventHappens(10277); - break; + switch (waypointId) + { + case 0: + DoScriptText(WHISPER_CUSTODIAN_1, me, player); + break; + case 1: + DoScriptText(WHISPER_CUSTODIAN_2, me, player); + break; + case 2: + DoScriptText(WHISPER_CUSTODIAN_3, me, player); + break; + case 3: + DoScriptText(WHISPER_CUSTODIAN_4, me, player); + break; + case 5: + DoScriptText(WHISPER_CUSTODIAN_5, me, player); + break; + case 6: + DoScriptText(WHISPER_CUSTODIAN_6, me, player); + break; + case 7: + DoScriptText(WHISPER_CUSTODIAN_7, me, player); + break; + case 8: + DoScriptText(WHISPER_CUSTODIAN_8, me, player); + break; + case 9: + DoScriptText(WHISPER_CUSTODIAN_9, me, player); + break; + case 10: + DoScriptText(WHISPER_CUSTODIAN_4, me, player); + break; + case 13: + DoScriptText(WHISPER_CUSTODIAN_10, me, player); + break; + case 14: + DoScriptText(WHISPER_CUSTODIAN_4, me, player); + break; + case 16: + DoScriptText(WHISPER_CUSTODIAN_11, me, player); + break; + case 17: + DoScriptText(WHISPER_CUSTODIAN_12, me, player); + break; + case 18: + DoScriptText(WHISPER_CUSTODIAN_4, me, player); + break; + case 22: + DoScriptText(WHISPER_CUSTODIAN_13, me, player); + break; + case 23: + DoScriptText(WHISPER_CUSTODIAN_4, me, player); + break; + case 24: + DoScriptText(WHISPER_CUSTODIAN_14, me, player); + DoCast(player, 34883); + // below here is temporary workaround, to be removed when spell works properly + player->AreaExploredOrEventHappens(10277); + break; + } } } @@ -225,7 +266,7 @@ public: } void EnterCombat(Unit* /*who*/) {} - void Reset() { } + void Reset() {} void UpdateAI(const uint32 diff) { @@ -244,10 +285,10 @@ class npc_marin_noggenfogger : public CreatureScript public: npc_marin_noggenfogger() : CreatureScript("npc_marin_noggenfogger") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_TRADE) + if (action == GOSSIP_ACTION_TRADE) player->GetSession()->SendListInventory(creature->GetGUID()); return true; @@ -287,10 +328,10 @@ public: return false; } - bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + if (action == GOSSIP_ACTION_INFO_DEF + 1) player->CastSpell(player, 34891, true); //(Flight through Caverns) return true; @@ -330,10 +371,10 @@ class npc_stone_watcher_of_norgannon : public CreatureScript public: npc_stone_watcher_of_norgannon() : CreatureScript("npc_stone_watcher_of_norgannon") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); @@ -382,7 +423,7 @@ public: ## npc_OOX17 ######*/ -enum e00X17 +enum Npc00X17 { //texts are signed for 7806 SAY_OOX_START = -1000287, @@ -426,39 +467,33 @@ public: struct npc_OOX17AI : public npc_escortAI { - npc_OOX17AI(Creature* c) : npc_escortAI(c) {} + npc_OOX17AI(Creature* creature) : npc_escortAI(creature) {} - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - Player* player = GetPlayerForEscort(); - - if (!player) - return; - - switch (i) { - case 23: - me->SummonCreature(SPAWN_FIRST, -8350.96f, -4445.79f, 10.10f, 6.20f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - me->SummonCreature(SPAWN_FIRST, -8355.96f, -4447.79f, 10.10f, 6.27f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - me->SummonCreature(SPAWN_FIRST, -8353.96f, -4442.79f, 10.10f, 6.08f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - DoScriptText(SAY_OOX_AMBUSH, me); - break; - - case 56: - me->SummonCreature(SPAWN_SECOND_1, -7510.07f, -4795.50f, 9.35f, 6.06f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - me->SummonCreature(SPAWN_SECOND_2, -7515.07f, -4797.50f, 9.35f, 6.22f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - me->SummonCreature(SPAWN_SECOND_2, -7518.07f, -4792.50f, 9.35f, 6.22f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - DoScriptText(SAY_OOX_AMBUSH, me); - if (Unit* scoff = me->FindNearestCreature(SPAWN_SECOND_2, 30)) - DoScriptText(SAY_OOX17_AMBUSH_REPLY, scoff); - break; - - case 86: - if (player) - { + if (Player* player = GetPlayerForEscort()) + { + switch (waypointId) + { + case 23: + me->SummonCreature(SPAWN_FIRST, -8350.96f, -4445.79f, 10.10f, 6.20f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + me->SummonCreature(SPAWN_FIRST, -8355.96f, -4447.79f, 10.10f, 6.27f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + me->SummonCreature(SPAWN_FIRST, -8353.96f, -4442.79f, 10.10f, 6.08f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + DoScriptText(SAY_OOX_AMBUSH, me); + break; + case 56: + me->SummonCreature(SPAWN_SECOND_1, -7510.07f, -4795.50f, 9.35f, 6.06f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + me->SummonCreature(SPAWN_SECOND_2, -7515.07f, -4797.50f, 9.35f, 6.22f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + me->SummonCreature(SPAWN_SECOND_2, -7518.07f, -4792.50f, 9.35f, 6.22f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + DoScriptText(SAY_OOX_AMBUSH, me); + if (Unit* scoff = me->FindNearestCreature(SPAWN_SECOND_2, 30)) + DoScriptText(SAY_OOX17_AMBUSH_REPLY, scoff); + break; + case 86: DoScriptText(SAY_OOX_END, me); player->GroupEventHappens(Q_OOX17, me); - } - break; + break; + } } } @@ -474,14 +509,13 @@ public: summoned->AI()->AttackStart(me); } }; - }; /*#### # npc_tooga ####*/ -enum eTooga +enum Tooga { SAY_TOOG_THIRST = -1000391, SAY_TOOG_WORRIED = -1000392, @@ -499,7 +533,7 @@ enum eTooga FACTION_TOOG_ESCORTEE = 113 }; -const float m_afToWaterLoc[] = {-7032.664551f, -4906.199219f, -1.606446f}; +Position const ToWaterLoc = {-7032.664551f, -4906.199219f, -1.606446f, 0.0f}; class npc_tooga : public CreatureScript { @@ -526,17 +560,17 @@ public: { npc_toogaAI(Creature* creature) : FollowerAI(creature) { } - uint32 m_uiCheckSpeechTimer; - uint32 m_uiPostEventTimer; - uint32 m_uiPhasePostEvent; + uint32 CheckSpeechTimer; + uint32 PostEventTimer; + uint32 PhasePostEvent; uint64 TortaGUID; void Reset() { - m_uiCheckSpeechTimer = 2500; - m_uiPostEventTimer = 1000; - m_uiPhasePostEvent = 0; + CheckSpeechTimer = 2500; + PostEventTimer = 1000; + PhasePostEvent = 0; TortaGUID = 0; } @@ -549,11 +583,9 @@ public: { if (me->IsWithinDistInMap(who, INTERACTION_DISTANCE)) { - if (Player* player = GetLeaderForFollower()) - { - if (player->GetQuestStatus(QUEST_TOOGA) == QUEST_STATUS_INCOMPLETE) - player->GroupEventHappens(QUEST_TOOGA, me); - } + Player* player = GetLeaderForFollower(); + if (player && player->GetQuestStatus(QUEST_TOOGA) == QUEST_STATUS_INCOMPLETE) + player->GroupEventHappens(QUEST_TOOGA, me); TortaGUID = who->GetGUID(); SetFollowComplete(true); @@ -561,27 +593,27 @@ public: } } - void MovementInform(uint32 uiMotionType, uint32 uiPointId) + void MovementInform(uint32 MotionType, uint32 PointId) { - FollowerAI::MovementInform(uiMotionType, uiPointId); + FollowerAI::MovementInform(MotionType, PointId); - if (uiMotionType != POINT_MOTION_TYPE) + if (MotionType != POINT_MOTION_TYPE) return; - if (uiPointId == POINT_ID_TO_WATER) + if (PointId == POINT_ID_TO_WATER) SetFollowComplete(); } - void UpdateFollowerAI(const uint32 uiDiff) + void UpdateFollowerAI(const uint32 Diff) { if (!UpdateVictim()) { //we are doing the post-event, or... if (HasFollowState(STATE_FOLLOW_POSTEVENT)) { - if (m_uiPostEventTimer <= uiDiff) + if (PostEventTimer <= Diff) { - m_uiPostEventTimer = 5000; + PostEventTimer = 5000; Unit* pTorta = Unit::GetUnit(*me, TortaGUID); if (!pTorta || !pTorta->isAlive()) @@ -591,7 +623,7 @@ public: return; } - switch (m_uiPhasePostEvent) + switch (PhasePostEvent) { case 1: DoScriptText(SAY_TOOG_POST_1, me); @@ -610,27 +642,27 @@ public: break; case 6: DoScriptText(SAY_TORT_POST_6, pTorta); - me->GetMotionMaster()->MovePoint(POINT_ID_TO_WATER, m_afToWaterLoc[0], m_afToWaterLoc[1], m_afToWaterLoc[2]); + me->GetMotionMaster()->MovePoint(POINT_ID_TO_WATER, ToWaterLoc); break; } - ++m_uiPhasePostEvent; + ++PhasePostEvent; } else - m_uiPostEventTimer -= uiDiff; + PostEventTimer -= Diff; } //...we are doing regular speech check else if (HasFollowState(STATE_FOLLOW_INPROGRESS)) { - if (m_uiCheckSpeechTimer <= uiDiff) + if (CheckSpeechTimer <= Diff) { - m_uiCheckSpeechTimer = 5000; + CheckSpeechTimer = 5000; if (urand(0, 9) > 8) DoScriptText(RAND(SAY_TOOG_THIRST, SAY_TOOG_WORRIED), me); } else - m_uiCheckSpeechTimer -= uiDiff; + CheckSpeechTimer -= Diff; } return; diff --git a/src/server/scripts/Kalimdor/teldrassil.cpp b/src/server/scripts/Kalimdor/teldrassil.cpp index d7cac99c374..7f2b2fc7f05 100644 --- a/src/server/scripts/Kalimdor/teldrassil.cpp +++ b/src/server/scripts/Kalimdor/teldrassil.cpp @@ -27,14 +27,15 @@ EndScriptData */ npc_mist EndContentData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" #include "ScriptedFollowerAI.h" /*#### # npc_mist ####*/ -enum eMist +enum Mist { SAY_AT_HOME = -1000323, EMOTE_AT_HOME = -1000324, @@ -51,10 +52,8 @@ public: bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) { if (quest->GetQuestId() == QUEST_MIST) - { if (npc_mistAI* pMistAI = CAST_AI(npc_mist::npc_mistAI, creature->AI())) pMistAI->StartFollow(player, FACTION_DARNASSUS, quest); - } return true; } @@ -88,18 +87,16 @@ public: { DoScriptText(EMOTE_AT_HOME, me); - if (Player* player = GetLeaderForFollower()) - { - if (player->GetQuestStatus(QUEST_MIST) == QUEST_STATUS_INCOMPLETE) - player->GroupEventHappens(QUEST_MIST, me); - } + Player* player = GetLeaderForFollower(); + if (player && player->GetQuestStatus(QUEST_MIST) == QUEST_STATUS_INCOMPLETE) + player->GroupEventHappens(QUEST_MIST, me); //The follow is over (and for later development, run off to the woods before really end) SetFollowComplete(); } //call not needed here, no known abilities - /*void UpdateFollowerAI(const uint32 uiDiff) + /*void UpdateFollowerAI(const uint32 Diff) { if (!UpdateVictim()) return; diff --git a/src/server/scripts/Kalimdor/the_barrens.cpp b/src/server/scripts/Kalimdor/the_barrens.cpp index e12897c1def..f4983558b67 100644 --- a/src/server/scripts/Kalimdor/the_barrens.cpp +++ b/src/server/scripts/Kalimdor/the_barrens.cpp @@ -32,7 +32,9 @@ npc_twiggy_flathead npc_wizzlecrank_shredder EndContentData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" #include "ScriptedEscortAI.h" /*###### @@ -41,7 +43,7 @@ EndContentData */ #define GOSSIP_CORPSE "Examine corpse in detail..." -enum eQuests +enum BeatenCorpse { QUEST_LOST_IN_BATTLE = 4921 }; @@ -51,10 +53,10 @@ class npc_beaten_corpse : public CreatureScript public: npc_beaten_corpse() : CreatureScript("npc_beaten_corpse") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF +1) + if (action == GOSSIP_ACTION_INFO_DEF +1) { player->SEND_GOSSIP_MENU(3558, creature->GetGUID()); player->TalkedToCreature(creature->GetEntry(), creature->GetGUID()); @@ -77,7 +79,7 @@ public: # npc_gilthares ######*/ -enum eGilthares +enum Gilthares { SAY_GIL_START = -1000370, SAY_GIL_AT_LAST = -1000371, @@ -127,14 +129,13 @@ public: void Reset() { } - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - switch (uiPointId) + switch (waypointId) { case 16: DoScriptText(SAY_GIL_AT_LAST, me, player); @@ -186,10 +187,10 @@ class npc_sputtervalve : public CreatureScript public: npc_sputtervalve() : CreatureScript("npc_sputtervalve") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF) + if (action == GOSSIP_ACTION_INFO_DEF) { player->SEND_GOSSIP_MENU(2013, creature->GetGUID()); player->AreaExploredOrEventHappens(6981); @@ -215,7 +216,7 @@ public: ## npc_taskmaster_fizzule ######*/ -enum eEnums +enum TaskmasterFizzule { FACTION_FRIENDLY_F = 35, SPELL_FLARE = 10113, @@ -234,20 +235,20 @@ public: struct npc_taskmaster_fizzuleAI : public ScriptedAI { - npc_taskmaster_fizzuleAI(Creature* c) : ScriptedAI(c) + npc_taskmaster_fizzuleAI(Creature* creature) : ScriptedAI(creature) { - factionNorm = c->getFaction(); + factionNorm = creature->getFaction(); } uint32 factionNorm; bool IsFriend; - uint32 Reset_Timer; + uint32 ResetTimer; uint8 FlareCount; void Reset() { IsFriend = false; - Reset_Timer = 120000; + ResetTimer = 120000; FlareCount = 0; me->setFaction(factionNorm); } @@ -282,11 +283,11 @@ public: { if (IsFriend) { - if (Reset_Timer <= diff) + if (ResetTimer <= diff) { EnterEvadeMode(); return; - } else Reset_Timer -= diff; + } else ResetTimer -= diff; } if (!UpdateVictim()) @@ -316,7 +317,7 @@ public: ## npc_twiggy_flathead #####*/ -enum eTwiggyFlathead +enum TwiggyFlathead { NPC_BIG_WILL = 6238, NPC_AFFRAY_CHALLENGER = 6240, @@ -328,7 +329,7 @@ enum eTwiggyFlathead SAY_TWIGGY_FLATHEAD_OVER = -1000127, }; -float AffrayChallengerLoc[6][4]= +Position const AffrayChallengerLoc[6] = { {-1683.0f, -4326.0f, 2.79f, 0.0f}, {-1682.0f, -4329.0f, 2.79f, 0.0f}, @@ -350,15 +351,15 @@ public: struct npc_twiggy_flatheadAI : public ScriptedAI { - npc_twiggy_flatheadAI(Creature* c) : ScriptedAI(c) {} + npc_twiggy_flatheadAI(Creature* creature) : ScriptedAI(creature) {} bool EventInProgress; bool EventGrate; bool EventBigWill; - bool Challenger_down[6]; - uint32 Wave; - uint32 Wave_Timer; - uint32 Challenger_checker; + bool ChallengerDown[6]; + uint8 Wave; + uint32 WaveTimer; + uint32 ChallengerChecker; uint64 PlayerGUID; uint64 AffrayChallenger[6]; uint64 BigWill; @@ -368,15 +369,15 @@ public: EventInProgress = false; EventGrate = false; EventBigWill = false; - Wave_Timer = 600000; - Challenger_checker = 0; + WaveTimer = 600000; + ChallengerChecker = 0; Wave = 0; PlayerGUID = 0; for (uint8 i = 0; i < 6; ++i) { AffrayChallenger[i] = 0; - Challenger_down[i] = false; + ChallengerDown[i] = false; } BigWill = 0; } @@ -385,7 +386,8 @@ public: void MoveInLineOfSight(Unit* who) { - if (!who || (!who->isAlive())) return; + if (!who || (!who->isAlive())) + return; if (me->IsWithinDistInMap(who, 10.0f) && (who->GetTypeId() == TYPEID_PLAYER) && CAST_PLR(who)->GetQuestStatus(1719) == QUEST_STATUS_INCOMPLETE && !EventInProgress) { @@ -408,40 +410,26 @@ public: return; if (!pWarrior->isAlive() && pWarrior->GetQuestStatus(1719) == QUEST_STATUS_INCOMPLETE) { - EventInProgress = false; DoScriptText(SAY_TWIGGY_FLATHEAD_DOWN, me); pWarrior->FailQuest(1719); - for (uint8 i = 0; i < 6; ++i) + for (uint8 i = 0; i < 6; ++i) // unsummon challengers { if (AffrayChallenger[i]) { Creature* creature = Unit::GetCreature((*me), AffrayChallenger[i]); - if (creature) { - if (creature->isAlive()) - { - creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); - creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - creature->setDeathState(JUST_DIED); - } - } + if (creature && creature->isAlive()) + creature->DisappearAndDie(); } - AffrayChallenger[i] = 0; - Challenger_down[i] = false; } - if (BigWill) + if (BigWill) // unsummon bigWill { Creature* creature = Unit::GetCreature((*me), BigWill); - if (creature) { - if (creature->isAlive()) { - creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); - creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - creature->setDeathState(JUST_DIED); - } - } + if (creature && creature->isAlive()) + creature->DisappearAndDie(); } - BigWill = 0; + Reset(); } if (!EventGrate && EventInProgress) @@ -451,11 +439,11 @@ public: if (x >= -1684 && x <= -1674 && y >= -4334 && y <= -4324) { pWarrior->AreaExploredOrEventHappens(1719); - DoScriptText(SAY_TWIGGY_FLATHEAD_BEGIN, me); + DoScriptText(SAY_TWIGGY_FLATHEAD_BEGIN, me, pWarrior); for (uint8 i = 0; i < 6; ++i) { - Creature* creature = me->SummonCreature(NPC_AFFRAY_CHALLENGER, AffrayChallengerLoc[i][0], AffrayChallengerLoc[i][1], AffrayChallengerLoc[i][2], AffrayChallengerLoc[i][3], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); + Creature* creature = me->SummonCreature(NPC_AFFRAY_CHALLENGER, AffrayChallengerLoc[i], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); if (!creature) continue; creature->setFaction(35); @@ -464,31 +452,31 @@ public: creature->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); AffrayChallenger[i] = creature->GetGUID(); } - Wave_Timer = 5000; - Challenger_checker = 1000; + WaveTimer = 5000; + ChallengerChecker = 1000; EventGrate = true; } } else if (EventInProgress) { - if (Challenger_checker <= diff) + if (ChallengerChecker <= diff) { for (uint8 i = 0; i < 6; ++i) { if (AffrayChallenger[i]) { Creature* creature = Unit::GetCreature((*me), AffrayChallenger[i]); - if ((!creature || (!creature->isAlive())) && !Challenger_down[i]) + if ((!creature || (!creature->isAlive())) && !ChallengerDown[i]) { DoScriptText(SAY_TWIGGY_FLATHEAD_DOWN, me); - Challenger_down[i] = true; + ChallengerDown[i] = true; } } } - Challenger_checker = 1000; - } else Challenger_checker -= diff; + ChallengerChecker = 1000; + } else ChallengerChecker -= diff; - if (Wave_Timer <= diff) + if (WaveTimer <= diff) { if (Wave < 6 && AffrayChallenger[Wave] && !EventBigWill) { @@ -502,7 +490,7 @@ public: creature->setFaction(14); creature->AI()->AttackStart(pWarrior); ++Wave; - Wave_Timer = 20000; + WaveTimer = 20000; } } else if (Wave >= 6 && !EventBigWill) { @@ -514,7 +502,7 @@ public: creature->GetMotionMaster()->MovePoint(2, -1682, -4329, 2.79f); creature->HandleEmoteCommand(EMOTE_STATE_READY_UNARMED); EventBigWill = true; - Wave_Timer = 1000; + WaveTimer = 1000; } } else if (Wave >= 6 && EventBigWill && BigWill) @@ -523,14 +511,10 @@ public: if (!creature || !creature->isAlive()) { DoScriptText(SAY_TWIGGY_FLATHEAD_OVER, me); - EventInProgress = false; - EventBigWill = false; - EventGrate = false; - PlayerGUID = 0; - Wave = 0; + Reset(); } } - } else Wave_Timer -= diff; + } else WaveTimer -= diff; } } } @@ -542,7 +526,7 @@ public: ## npc_wizzlecrank_shredder #####*/ -enum eEnums_Wizzlecrank +enum Wizzlecrank { SAY_START = -1000298, SAY_STARTUP1 = -1000299, @@ -568,14 +552,14 @@ public: { npc_wizzlecrank_shredderAI(Creature* creature) : npc_escortAI(creature) { - m_bIsPostEvent = false; - m_uiPostEventTimer = 1000; - m_uiPostEventCount = 0; + IsPostEvent = false; + PostEventTimer = 1000; + PostEventCount = 0; } - bool m_bIsPostEvent; - uint32 m_uiPostEventTimer; - uint32 m_uiPostEventCount; + bool IsPostEvent; + uint32 PostEventTimer; + uint32 PostEventCount; void Reset() { @@ -584,48 +568,43 @@ public: if (me->getStandState() == UNIT_STAND_STATE_DEAD) me->SetStandState(UNIT_STAND_STATE_STAND); - m_bIsPostEvent = false; - m_uiPostEventTimer = 1000; - m_uiPostEventCount = 0; + IsPostEvent = false; + PostEventTimer = 1000; + PostEventCount = 0; } } - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { - Player* player = GetPlayerForEscort(); - - if (!player) - return; - - switch (uiPointId) + switch (waypointId) { - case 0: - DoScriptText(SAY_STARTUP1, me); - break; - case 9: - SetRun(false); - break; - case 17: - if (Creature* temp = me->SummonCreature(NPC_MERCENARY, 1128.489f, -3037.611f, 92.701f, 1.472f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000)) - { - DoScriptText(SAY_MERCENARY, temp); - me->SummonCreature(NPC_MERCENARY, 1160.172f, -2980.168f, 97.313f, 3.690f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); - } - break; - case 24: - m_bIsPostEvent = true; - break; + case 0: + DoScriptText(SAY_STARTUP1, me); + break; + case 9: + SetRun(false); + break; + case 17: + if (Creature* temp = me->SummonCreature(NPC_MERCENARY, 1128.489f, -3037.611f, 92.701f, 1.472f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000)) + { + DoScriptText(SAY_MERCENARY, temp); + me->SummonCreature(NPC_MERCENARY, 1160.172f, -2980.168f, 97.313f, 3.690f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); + } + break; + case 24: + IsPostEvent = true; + break; } } - void WaypointStart(uint32 uiPointId) + void WaypointStart(uint32 PointId) { Player* player = GetPlayerForEscort(); if (!player) return; - switch (uiPointId) + switch (PointId) { case 9: DoScriptText(SAY_STARTUP2, me, player); @@ -646,15 +625,15 @@ public: summoned->AI()->AttackStart(me); } - void UpdateEscortAI(const uint32 uiDiff) + void UpdateEscortAI(const uint32 Diff) { if (!UpdateVictim()) { - if (m_bIsPostEvent) + if (IsPostEvent) { - if (m_uiPostEventTimer <= uiDiff) + if (PostEventTimer <= Diff) { - switch (m_uiPostEventCount) + switch (PostEventCount) { case 0: DoScriptText(SAY_PROGRESS_2, me); @@ -674,11 +653,11 @@ public: break; } - ++m_uiPostEventCount; - m_uiPostEventTimer = 5000; + ++PostEventCount; + PostEventTimer = 5000; } else - m_uiPostEventTimer -= uiDiff; + PostEventTimer -= Diff; } return; diff --git a/src/server/scripts/Kalimdor/thousand_needles.cpp b/src/server/scripts/Kalimdor/thousand_needles.cpp index 2349b4493ce..b9ae356ddf1 100644 --- a/src/server/scripts/Kalimdor/thousand_needles.cpp +++ b/src/server/scripts/Kalimdor/thousand_needles.cpp @@ -32,14 +32,16 @@ npc_enraged_panther go_panther_cage EndContentData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" #include "ScriptedEscortAI.h" /*##### # npc_kanati ######*/ -enum eKanati +enum Kanati { SAY_KAN_START = -1000410, @@ -47,7 +49,7 @@ enum eKanati NPC_GALAK_ASS = 10720 }; -const float m_afGalakLoc[]= {-4867.387695f, -1357.353760f, -48.226f }; +Position const GalakLoc = {-4867.387695f, -1357.353760f, -48.226f, 0.0f}; class npc_kanati : public CreatureScript { @@ -57,10 +59,9 @@ public: bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) { if (quest->GetQuestId() == QUEST_PROTECT_KANATI) - { if (npc_kanatiAI* pEscortAI = CAST_AI(npc_kanati::npc_kanatiAI, creature->AI())) pEscortAI->Start(false, false, player->GetGUID(), quest, true); - } + return true; } @@ -73,11 +74,11 @@ public: { npc_kanatiAI(Creature* creature) : npc_escortAI(creature) { } - void Reset() { } + void Reset() {} - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { - switch (uiPointId) + switch (waypointId) { case 0: DoScriptText(SAY_KAN_START, me); @@ -93,9 +94,7 @@ public: void DoSpawnGalak() { for (int i = 0; i < 3; ++i) - me->SummonCreature(NPC_GALAK_ASS, - m_afGalakLoc[0], m_afGalakLoc[1], m_afGalakLoc[2], 0.0f, - TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + me->SummonCreature(NPC_GALAK_ASS, GalakLoc, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); } void JustSummoned(Creature* summoned) @@ -110,7 +109,7 @@ public: # npc_lakota_windsong ######*/ -enum eLakota +enum Lakota { SAY_LAKO_START = -1000365, SAY_LAKO_LOOK_OUT = -1000366, @@ -127,14 +126,14 @@ enum eLakota ID_AMBUSH_3 = 4 }; -float m_afBanditLoc[6][6]= +Position const BanditLoc[6] = { - {-4905.479492f, -2062.732666f, 84.352f}, - {-4915.201172f, -2073.528320f, 84.733f}, - {-4878.883301f, -1986.947876f, 91.966f}, - {-4877.503906f, -1966.113403f, 91.859f}, - {-4767.985352f, -1873.169189f, 90.192f}, - {-4788.861328f, -1888.007813f, 89.888f} + {-4905.479492f, -2062.732666f, 84.352f, 0.0f}, + {-4915.201172f, -2073.528320f, 84.733f, 0.0f}, + {-4878.883301f, -1986.947876f, 91.966f, 0.0f}, + {-4877.503906f, -1966.113403f, 91.859f, 0.0f}, + {-4767.985352f, -1873.169189f, 90.192f, 0.0f}, + {-4788.861328f, -1888.007813f, 89.888f, 0.0f} }; class npc_lakota_windsong : public CreatureScript @@ -164,11 +163,11 @@ public: { npc_lakota_windsongAI(Creature* creature) : npc_escortAI(creature) { } - void Reset() { } + void Reset() {} - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { - switch (uiPointId) + switch (waypointId) { case 8: DoScriptText(SAY_LAKO_LOOK_OUT, me); @@ -189,12 +188,10 @@ public: } } - void DoSpawnBandits(int uiAmbushId) + void DoSpawnBandits(int AmbushId) { for (int i = 0; i < 2; ++i) - me->SummonCreature(NPC_GRIM_BANDIT, - m_afBanditLoc[i+uiAmbushId][0], m_afBanditLoc[i+uiAmbushId][1], m_afBanditLoc[i+uiAmbushId][2], 0.0f, - TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); + me->SummonCreature(NPC_GRIM_BANDIT, BanditLoc[i+AmbushId], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); } }; @@ -204,7 +201,7 @@ public: # npc_paoka_swiftmountain ######*/ -enum ePacka +enum Packa { SAY_START = -1000362, SAY_WYVERN = -1000363, @@ -215,11 +212,11 @@ enum ePacka FACTION_ESCORTEE = 232 //guessed }; -float m_afWyvernLoc[3][3]= +Position const WyvernLoc[3] = { - {-4990.606f, -906.057f, -5.343f}, - {-4970.241f, -927.378f, -4.951f}, - {-4985.364f, -952.528f, -5.199f} + {-4990.606f, -906.057f, -5.343f, 0.0f}, + {-4970.241f, -927.378f, -4.951f, 0.0f}, + {-4985.364f, -952.528f, -5.199f, 0.0f} }; class npc_paoka_swiftmountain : public CreatureScript @@ -249,11 +246,11 @@ public: { npc_paoka_swiftmountainAI(Creature* creature) : npc_escortAI(creature) { } - void Reset() { } + void Reset() {} - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { - switch (uiPointId) + switch (waypointId) { case 15: DoScriptText(SAY_WYVERN, me); @@ -272,12 +269,9 @@ public: void DoSpawnWyvern() { for (int i = 0; i < 3; ++i) - me->SummonCreature(NPC_WYVERN, - m_afWyvernLoc[i][0], m_afWyvernLoc[i][1], m_afWyvernLoc[i][2], 0.0f, - TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); + me->SummonCreature(NPC_WYVERN, WyvernLoc[i], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); } }; - }; /*##### @@ -286,7 +280,7 @@ public: #define GOSSIP_P "Please tell me the Phrase.." -enum ePlucky +enum Plucky { FACTION_FRIENDLY = 35, QUEST_SCOOP = 1950, @@ -299,10 +293,10 @@ class npc_plucky : public CreatureScript public: npc_plucky() : CreatureScript("npc_plucky") { } - bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->CLOSE_GOSSIP_MENU(); @@ -316,6 +310,7 @@ public: { if (player->GetQuestStatus(QUEST_SCOOP) == QUEST_STATUS_INCOMPLETE) player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_P, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + player->SEND_GOSSIP_MENU(738, creature->GetGUID()); return true; @@ -328,17 +323,17 @@ public: struct npc_pluckyAI : public ScriptedAI { - npc_pluckyAI(Creature* c) : ScriptedAI(c) { m_uiNormFaction = c->getFaction(); } + npc_pluckyAI(Creature* creature) : ScriptedAI(creature) { NormFaction = creature->getFaction(); } - uint32 m_uiNormFaction; - uint32 m_uiResetTimer; + uint32 NormFaction; + uint32 ResetTimer; void Reset() { - m_uiResetTimer = 120000; + ResetTimer = 120000; - if (me->getFaction() != m_uiNormFaction) - me->setFaction(m_uiNormFaction); + if (me->getFaction() != NormFaction) + me->setFaction(NormFaction); if (me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); @@ -346,11 +341,11 @@ public: DoCast(me, SPELL_PLUCKY_CHICKEN, false); } - void ReceiveEmote(Player* player, uint32 uiTextEmote) + void ReceiveEmote(Player* player, uint32 TextEmote) { if (player->GetQuestStatus(QUEST_SCOOP) == QUEST_STATUS_INCOMPLETE) { - if (uiTextEmote == TEXT_EMOTE_BECKON) + if (TextEmote == TEXT_EMOTE_BECKON) { me->setFaction(FACTION_FRIENDLY); me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); @@ -358,7 +353,7 @@ public: } } - if (uiTextEmote == TEXT_EMOTE_CHICKEN) + if (TextEmote == TEXT_EMOTE_CHICKEN) { if (me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) return; @@ -372,11 +367,11 @@ public: } } - void UpdateAI(const uint32 uiDiff) + void UpdateAI(const uint32 Diff) { if (me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) { - if (m_uiResetTimer <= uiDiff) + if (ResetTimer <= Diff) { if (!me->getVictim()) EnterEvadeMode(); @@ -386,7 +381,7 @@ public: return; } else - m_uiResetTimer -= uiDiff; + ResetTimer -= Diff; } if (!UpdateVictim()) @@ -398,7 +393,7 @@ public: }; -enum ePantherCage +enum PantherCage { ENRAGED_PANTHER = 10992 }; @@ -410,7 +405,6 @@ public: bool OnGossipHello(Player* player, GameObject* go) { - if (player->GetQuestStatus(5151) == QUEST_STATUS_INCOMPLETE) { if (Creature* panther = go->FindNearestCreature(ENRAGED_PANTHER, 5, true)) @@ -421,7 +415,7 @@ public: } } - return true ; + return true; } }; @@ -437,7 +431,7 @@ public: struct npc_enraged_pantherAI : public ScriptedAI { - npc_enraged_pantherAI(Creature* c) : ScriptedAI(c) {} + npc_enraged_pantherAI(Creature* creature) : ScriptedAI(creature) {} void Reset() { diff --git a/src/server/scripts/Kalimdor/thunder_bluff.cpp b/src/server/scripts/Kalimdor/thunder_bluff.cpp index 67a876c40b2..b8b05b9692f 100644 --- a/src/server/scripts/Kalimdor/thunder_bluff.cpp +++ b/src/server/scripts/Kalimdor/thunder_bluff.cpp @@ -23,17 +23,22 @@ SDComment: Quest support: 925 SDCategory: Thunder Bluff EndScriptData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" /*##### # npc_cairne_bloodhoof ######*/ -#define SPELL_BERSERKER_CHARGE 16636 -#define SPELL_CLEAVE 16044 -#define SPELL_MORTAL_STRIKE 16856 -#define SPELL_THUNDERCLAP 23931 -#define SPELL_UPPERCUT 22916 +enum CairneBloodhoof +{ + SPELL_BERSERKER_CHARGE = 16636, + SPELL_CLEAVE = 16044, + SPELL_MORTAL_STRIKE = 16856, + SPELL_THUNDERCLAP = 23931, + SPELL_UPPERCUT = 22916 +}; #define GOSSIP_HCB "I know this is rather silly but a young ward who is a bit shy would like your hoofprint." //TODO: verify abilities/timers @@ -42,10 +47,10 @@ class npc_cairne_bloodhoof : public CreatureScript public: npc_cairne_bloodhoof() : CreatureScript("npc_cairne_bloodhoof") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_SENDER_INFO) + if (action == GOSSIP_SENDER_INFO) { player->CastSpell(player, 23123, false); player->SEND_GOSSIP_MENU(7014, creature->GetGUID()); @@ -73,21 +78,21 @@ public: struct npc_cairne_bloodhoofAI : public ScriptedAI { - npc_cairne_bloodhoofAI(Creature* c) : ScriptedAI(c) {} + npc_cairne_bloodhoofAI(Creature* creature) : ScriptedAI(creature) {} - uint32 BerserkerCharge_Timer; - uint32 Cleave_Timer; - uint32 MortalStrike_Timer; - uint32 Thunderclap_Timer; - uint32 Uppercut_Timer; + uint32 BerserkerChargeTimer; + uint32 CleaveTimer; + uint32 MortalStrikeTimer; + uint32 ThunderclapTimer; + uint32 UppercutTimer; void Reset() { - BerserkerCharge_Timer = 30000; - Cleave_Timer = 5000; - MortalStrike_Timer = 10000; - Thunderclap_Timer = 15000; - Uppercut_Timer = 10000; + BerserkerChargeTimer = 30000; + CleaveTimer = 5000; + MortalStrikeTimer = 10000; + ThunderclapTimer = 15000; + UppercutTimer = 10000; } void EnterCombat(Unit* /*who*/) {} @@ -97,37 +102,37 @@ public: if (!UpdateVictim()) return; - if (BerserkerCharge_Timer <= diff) + if (BerserkerChargeTimer <= diff) { Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0); if (target) DoCast(target, SPELL_BERSERKER_CHARGE); - BerserkerCharge_Timer = 25000; - } else BerserkerCharge_Timer -= diff; + BerserkerChargeTimer = 25000; + } else BerserkerChargeTimer -= diff; - if (Uppercut_Timer <= diff) + if (UppercutTimer <= diff) { DoCast(me->getVictim(), SPELL_UPPERCUT); - Uppercut_Timer = 20000; - } else Uppercut_Timer -= diff; + UppercutTimer = 20000; + } else UppercutTimer -= diff; - if (Thunderclap_Timer <= diff) + if (ThunderclapTimer <= diff) { DoCast(me->getVictim(), SPELL_THUNDERCLAP); - Thunderclap_Timer = 15000; - } else Thunderclap_Timer -= diff; + ThunderclapTimer = 15000; + } else ThunderclapTimer -= diff; - if (MortalStrike_Timer <= diff) + if (MortalStrikeTimer <= diff) { DoCast(me->getVictim(), SPELL_MORTAL_STRIKE); - MortalStrike_Timer = 15000; - } else MortalStrike_Timer -= diff; + MortalStrikeTimer = 15000; + } else MortalStrikeTimer -= diff; - if (Cleave_Timer <= diff) + if (CleaveTimer <= diff) { DoCast(me->getVictim(), SPELL_CLEAVE); - Cleave_Timer = 7000; - } else Cleave_Timer -= diff; + CleaveTimer = 7000; + } else CleaveTimer -= diff; DoMeleeAttackIfReady(); } diff --git a/src/server/scripts/Kalimdor/ungoro_crater.cpp b/src/server/scripts/Kalimdor/ungoro_crater.cpp index 0e2a1b2c4d9..786d2fc0cd3 100644 --- a/src/server/scripts/Kalimdor/ungoro_crater.cpp +++ b/src/server/scripts/Kalimdor/ungoro_crater.cpp @@ -28,11 +28,12 @@ npc_a-me npc_ringo EndContentData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" #include "ScriptedEscortAI.h" #include "ScriptedFollowerAI.h" -enum eAMeData +enum AmeData { SAY_READY = -1000517, SAY_AGGRO1 = -1000518, @@ -74,45 +75,42 @@ public: struct npc_ameAI : public npc_escortAI { - npc_ameAI(Creature* c) : npc_escortAI(c) {} + npc_ameAI(Creature* creature) : npc_escortAI(creature) {} - uint32 DEMORALIZINGSHOUT_Timer; + uint32 DemoralizingShoutTimer; - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - Player* player = GetPlayerForEscort(); - - if (!player) - return; - - switch (i) + if (Player* player = GetPlayerForEscort()) { - case 19: - me->SummonCreature(ENTRY_STOMPER, -6391.69f, -1730.49f, -272.83f, 4.96f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - DoScriptText(SAY_AGGRO1, me, player); - break; - case 28: - DoScriptText(SAY_SEARCH, me, player); - break; - case 38: - me->SummonCreature(ENTRY_TARLORD, -6370.75f, -1382.84f, -270.51f, 6.06f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - DoScriptText(SAY_AGGRO2, me, player); - break; - case 49: - me->SummonCreature(ENTRY_TARLORD1, -6324.44f, -1181.05f, -270.17f, 4.34f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - DoScriptText(SAY_AGGRO3, me, player); - break; - case 55: - DoScriptText(SAY_FINISH, me, player); - if (player) + switch (waypointId) + { + case 19: + me->SummonCreature(ENTRY_STOMPER, -6391.69f, -1730.49f, -272.83f, 4.96f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + DoScriptText(SAY_AGGRO1, me, player); + break; + case 28: + DoScriptText(SAY_SEARCH, me, player); + break; + case 38: + me->SummonCreature(ENTRY_TARLORD, -6370.75f, -1382.84f, -270.51f, 6.06f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + DoScriptText(SAY_AGGRO2, me, player); + break; + case 49: + me->SummonCreature(ENTRY_TARLORD1, -6324.44f, -1181.05f, -270.17f, 4.34f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + DoScriptText(SAY_AGGRO3, me, player); + break; + case 55: + DoScriptText(SAY_FINISH, me, player); player->GroupEventHappens(QUEST_CHASING_AME, me); - break; + break; + } } } void Reset() { - DEMORALIZINGSHOUT_Timer = 5000; + DemoralizingShoutTimer = 5000; } void JustSummoned(Creature* summoned) @@ -132,11 +130,11 @@ public: if (!UpdateVictim()) return; - if (DEMORALIZINGSHOUT_Timer <= diff) + if (DemoralizingShoutTimer <= diff) { DoCast(me->getVictim(), SPELL_DEMORALIZINGSHOUT); - DEMORALIZINGSHOUT_Timer = 70000; - } else DEMORALIZINGSHOUT_Timer -= diff; + DemoralizingShoutTimer = 70000; + } else DemoralizingShoutTimer -= diff; } }; }; @@ -145,7 +143,7 @@ public: # npc_ringo ####*/ -enum eRingo +enum Ringo { SAY_RIN_START_1 = -1000416, SAY_RIN_START_2 = -1000417, @@ -203,17 +201,17 @@ public: { npc_ringoAI(Creature* creature) : FollowerAI(creature) { } - uint32 m_uiFaintTimer; - uint32 m_uiEndEventProgress; - uint32 m_uiEndEventTimer; + uint32 FaintTimer; + uint32 EndEventProgress; + uint32 EndEventTimer; uint64 SpraggleGUID; void Reset() { - m_uiFaintTimer = urand(30000, 60000); - m_uiEndEventProgress = 0; - m_uiEndEventTimer = 1000; + FaintTimer = urand(30000, 60000); + EndEventProgress = 0; + EndEventTimer = 1000; SpraggleGUID = 0; } @@ -268,13 +266,13 @@ public: SetFollowPaused(false); } - void UpdateFollowerAI(const uint32 uiDiff) + void UpdateFollowerAI(const uint32 Diff) { if (!UpdateVictim()) { if (HasFollowState(STATE_FOLLOW_POSTEVENT)) { - if (m_uiEndEventTimer <= uiDiff) + if (EndEventTimer <= Diff) { Unit* pSpraggle = Unit::GetUnit(*me, SpraggleGUID); if (!pSpraggle || !pSpraggle->isAlive()) @@ -283,64 +281,61 @@ public: return; } - switch (m_uiEndEventProgress) + switch (EndEventProgress) { case 1: DoScriptText(SAY_RIN_END_1, me); - m_uiEndEventTimer = 3000; + EndEventTimer = 3000; break; case 2: DoScriptText(SAY_SPR_END_2, pSpraggle); - m_uiEndEventTimer = 5000; + EndEventTimer = 5000; break; case 3: DoScriptText(SAY_RIN_END_3, me); - m_uiEndEventTimer = 1000; + EndEventTimer = 1000; break; case 4: DoScriptText(EMOTE_RIN_END_4, me); SetFaint(); - m_uiEndEventTimer = 9000; + EndEventTimer = 9000; break; case 5: DoScriptText(EMOTE_RIN_END_5, me); ClearFaint(); - m_uiEndEventTimer = 1000; + EndEventTimer = 1000; break; case 6: DoScriptText(SAY_RIN_END_6, me); - m_uiEndEventTimer = 3000; + EndEventTimer = 3000; break; case 7: DoScriptText(SAY_SPR_END_7, pSpraggle); - m_uiEndEventTimer = 10000; + EndEventTimer = 10000; break; case 8: DoScriptText(EMOTE_RIN_END_8, me); - m_uiEndEventTimer = 5000; + EndEventTimer = 5000; break; case 9: SetFollowComplete(); break; } - ++m_uiEndEventProgress; + ++EndEventProgress; } else - m_uiEndEventTimer -= uiDiff; + EndEventTimer -= Diff; } - else if (HasFollowState(STATE_FOLLOW_INPROGRESS)) + else if (HasFollowState(STATE_FOLLOW_INPROGRESS) && !HasFollowState(STATE_FOLLOW_PAUSED)) { - if (!HasFollowState(STATE_FOLLOW_PAUSED)) + if (FaintTimer <= Diff) { - if (m_uiFaintTimer <= uiDiff) - { - SetFaint(); - m_uiFaintTimer = urand(60000, 120000); - } - else - m_uiFaintTimer -= uiDiff; + SetFaint(); + FaintTimer = urand(60000, 120000); } + else + FaintTimer -= Diff; } return; diff --git a/src/server/scripts/Kalimdor/winterspring.cpp b/src/server/scripts/Kalimdor/winterspring.cpp index 00bb250d64d..a02156ee110 100644 --- a/src/server/scripts/Kalimdor/winterspring.cpp +++ b/src/server/scripts/Kalimdor/winterspring.cpp @@ -29,7 +29,9 @@ npc_rivern_frostwind npc_witch_doctor_mauari EndContentData */ -#include "ScriptPCH.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" /*###### ## npc_lorax @@ -48,10 +50,10 @@ class npc_lorax : public CreatureScript public: npc_lorax() : CreatureScript("npc_lorax") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SL1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); @@ -105,10 +107,10 @@ class npc_rivern_frostwind : public CreatureScript public: npc_rivern_frostwind() : CreatureScript("npc_rivern_frostwind") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_TRADE) + if (action == GOSSIP_ACTION_TRADE) player->GetSession()->SendListInventory(creature->GetGUID()); return true; @@ -140,10 +142,10 @@ class npc_witch_doctor_mauari : public CreatureScript public: npc_witch_doctor_mauari() : CreatureScript("npc_witch_doctor_mauari") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { player->CLOSE_GOSSIP_MENU(); creature->CastSpell(player, 16351, false); @@ -161,12 +163,12 @@ public: { player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HWDM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); player->SEND_GOSSIP_MENU(3377, creature->GetGUID()); - }else + } + else player->SEND_GOSSIP_MENU(3375, creature->GetGUID()); return true; } - }; void AddSC_winterspring() diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp index b16ad9934d8..8f34fa56525 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp @@ -48,9 +48,9 @@ public: struct boss_amanitarAI : public ScriptedAI { - boss_amanitarAI(Creature* c) : ScriptedAI(c) + boss_amanitarAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); bFirstTime = true; } @@ -83,7 +83,7 @@ public: } } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (instance) { @@ -167,7 +167,7 @@ public: struct mob_amanitar_mushroomsAI : public Scripted_NoMovementAI { - mob_amanitar_mushroomsAI(Creature* c) : Scripted_NoMovementAI(c) {} + mob_amanitar_mushroomsAI(Creature* creature) : Scripted_NoMovementAI(creature) {} uint32 uiAuraTimer; uint32 uiDeathTimer; diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp index 85abaa46a5d..ea757e86f4d 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp @@ -105,7 +105,7 @@ class boss_elder_nadox : public CreatureScript DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2, SAY_SLAY_3), me); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_SLAY_3, me); //SAY_SLAY_3 on death? @@ -229,7 +229,7 @@ class mob_ahnkahar_nerubian : public CreatureScript uiSprintTimer = 10000; } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (me->GetEntry() == MOB_AHNKAHAR_GUARDIAN_ENTRY) if (Creature* Nadox = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_ELDER_NADOX))) @@ -278,10 +278,10 @@ public: struct mob_nadox_eggsAI : public Scripted_NoMovementAI { - mob_nadox_eggsAI(Creature* c) : Scripted_NoMovementAI(c) + mob_nadox_eggsAI(Creature* creature) : Scripted_NoMovementAI(creature) { - c->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); - c->UpdateAllStats(); + creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); + creature->UpdateAllStats(); } void Reset() {} void EnterCombat(Unit* /*who*/) {} diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp index 2789bc48a4c..d6e50097765 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp @@ -73,9 +73,9 @@ public: struct boss_jedoga_shadowseekerAI : public ScriptedAI { - boss_jedoga_shadowseekerAI(Creature* c) : ScriptedAI(c) + boss_jedoga_shadowseekerAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); bFirstTime = true; bPreDone = false; } @@ -149,7 +149,7 @@ public: DoScriptText(RAND(TEXT_SLAY_1, TEXT_SLAY_2, TEXT_SLAY_3), me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(TEXT_DEATH, me); if (instance) @@ -355,9 +355,9 @@ public: struct mob_jedoga_initiandAI : public ScriptedAI { - mob_jedoga_initiandAI(Creature* c) : ScriptedAI(c) + mob_jedoga_initiandAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -390,9 +390,9 @@ public: } } - void JustDied(Unit* Killer) + void JustDied(Unit* killer) { - if (!Killer || !instance) + if (!killer || !instance) return; if (bWalking) @@ -402,7 +402,7 @@ public: if (!CAST_AI(boss_jedoga_shadowseeker::boss_jedoga_shadowseekerAI, boss->AI())->bOpFerok) CAST_AI(boss_jedoga_shadowseeker::boss_jedoga_shadowseekerAI, boss->AI())->bOpFerokFail = true; - if (Killer->GetTypeId() == TYPEID_PLAYER) + if (killer->GetTypeId() == TYPEID_PLAYER) boss->AI()->DoAction(ACTION_INITIAND_KILLED); } @@ -410,8 +410,8 @@ public: bWalking = false; } - if (Killer->GetTypeId() == TYPEID_PLAYER) - instance->SetData64(DATA_PL_JEDOGA_TARGET, Killer->GetGUID()); + if (killer->GetTypeId() == TYPEID_PLAYER) + instance->SetData64(DATA_PL_JEDOGA_TARGET, killer->GetGUID()); } void EnterCombat(Unit* who) @@ -531,9 +531,9 @@ public: struct npc_jedogas_aufseher_triggerAI : public Scripted_NoMovementAI { - npc_jedogas_aufseher_triggerAI(Creature* c) : Scripted_NoMovementAI(c) + npc_jedogas_aufseher_triggerAI(Creature* creature) : Scripted_NoMovementAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); bRemoved = false; bRemoved2 = false; bCasted = false; diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp index 0f4b046f7d5..cf3c4274e48 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp @@ -36,7 +36,8 @@ enum Spells SPELL_VANISH = 55964, CREATURE_FLAME_SPHERE = 30106, H_CREATURE_FLAME_SPHERE_1 = 31686, - H_CREATURE_FLAME_SPHERE_2 = 31687 + H_CREATURE_FLAME_SPHERE_2 = 31687, + SPELL_HOVER_FALL = 60425 }; enum Misc { @@ -45,18 +46,17 @@ enum Misc DATA_SPHERE_DISTANCE = 15 }; #define DATA_SPHERE_ANGLE_OFFSET 0.7f -#define DATA_GROUND_POSITION_Z 11.4f +#define DATA_GROUND_POSITION_Z 11.30809f enum Yells { - SAY_AGGRO = -1619021, - SAY_SLAY_1 = -1619022, - SAY_SLAY_2 = -1619023, - SAY_DEATH = -1619024, - SAY_FEED_1 = -1619025, - SAY_FEED_2 = -1619026, - SAY_VANISH_1 = -1619027, - SAY_VANISH_2 = -1619028 + SAY_1 = 0, + SAY_WARNING = 1, + SAY_AGGRO = 2, + SAY_SLAY = 3, + SAY_DEATH = 4, + SAY_FEED = 5, + SAY_VANISH = 6, }; enum CombatPhase { @@ -79,11 +79,10 @@ public: struct boss_taldaramAI : public ScriptedAI { - boss_taldaramAI(Creature* c) : ScriptedAI(c) + boss_taldaramAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + instance = creature->GetInstanceScript(); + me->SetDisableGravity(true); } uint32 uiBloodthirstTimer; @@ -118,7 +117,7 @@ public: { if (instance) instance->SetData(DATA_PRINCE_TALDARAM_EVENT, IN_PROGRESS); - DoScriptText(SAY_AGGRO, me); + Talk(SAY_AGGRO); } void UpdateAI(const uint32 diff) @@ -180,7 +179,8 @@ public: break; case VANISHED: if (Unit* pEmbraceTarget = GetEmbraceTarget()) - DoCast(pEmbraceTarget, SPELL_EMBRACE_OF_THE_VAMPYR); + DoCast(pEmbraceTarget, DUNGEON_MODE(SPELL_EMBRACE_OF_THE_VAMPYR, H_SPELL_EMBRACE_OF_THE_VAMPYR)); + Talk(SAY_FEED); me->GetMotionMaster()->Clear(); me->SetSpeed(MOVE_WALK, 1.0f, true); me->GetMotionMaster()->MoveChase(me->getVictim()); @@ -201,7 +201,8 @@ public: if (uiFlamesphereTimer <= diff) { - DoCast(me, SPELL_CONJURE_FLAME_SPHERE); + // because TARGET_UNIT_TARGET_ENEMY we need a target selected to cast + DoCastVictim(SPELL_CONJURE_FLAME_SPHERE); Phase = CASTING_FLAME_SPHERES; uiPhaseTimer = 3*IN_MILLISECONDS + diff; uiFlamesphereTimer = 15*IN_MILLISECONDS; @@ -224,7 +225,7 @@ public: //He only vanishes if there are 3 or more alive players if (target_list.size() > 2) { - DoScriptText(RAND(SAY_VANISH_1, SAY_VANISH_2), me); + Talk(SAY_VANISH); DoCast(me, SPELL_VANISH); Phase = JUST_VANISHED; uiPhaseTimer = 500; @@ -260,7 +261,7 @@ public: void JustDied(Unit* /*killer*/) { - DoScriptText(SAY_DEATH, me); + Talk(SAY_DEATH); if (instance) instance->SetData(DATA_PRINCE_TALDARAM_EVENT, DONE); @@ -278,7 +279,7 @@ public: uiPhaseTimer = 0; uiEmbraceTarget = 0; } - DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2), me); + Talk(SAY_SLAY); } bool CheckSpheres() @@ -314,12 +315,13 @@ public: { if (!instance) return; - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->RemoveAurasDueToSpell(SPELL_BEAM_VISUAL); - me->SetUnitMovementFlags(MOVEMENTFLAG_WALKING); me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), DATA_GROUND_POSITION_Z, me->GetOrientation()); + DoCast(SPELL_HOVER_FALL); + me->SetDisableGravity(false); + me->GetMotionMaster()->MovePoint(0, me->GetHomePosition()); + Talk(SAY_WARNING); uint64 prison_GUID = instance->GetData64(DATA_PRINCE_TALDARAM_PLATFORM); instance->HandleGameObject(prison_GUID, true); } @@ -338,9 +340,9 @@ public: struct mob_taldaram_flamesphereAI : public ScriptedAI { - mob_taldaram_flamesphereAI(Creature* c) : ScriptedAI(c) + mob_taldaram_flamesphereAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiDespawnTimer; @@ -349,9 +351,10 @@ public: void Reset() { me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + //! HACK: Creature's can't have MOVEMENTFLAG_FLYING me->AddUnitMovementFlag(MOVEMENTFLAG_FLYING); me->setFaction(16); - me->SetFloatValue(OBJECT_FIELD_SCALE_X, 1.0f); + me->SetObjectScale(1.0f); DoCast(me, SPELL_FLAME_SPHERE_VISUAL); DoCast(me, SPELL_FLAME_SPHERE_SPAWN_EFFECT); DoCast(me, SPELL_FLAME_SPHERE_PERIODIC); @@ -361,7 +364,7 @@ public: void EnterCombat(Unit* /*who*/) {} void MoveInLineOfSight(Unit* /*who*/) {} - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { DoCast(me, SPELL_FLAME_SPHERE_DEATH_EFFECT); } @@ -386,21 +389,30 @@ class prince_taldaram_sphere : public GameObjectScript public: prince_taldaram_sphere() : GameObjectScript("prince_taldaram_sphere") { } - bool OnGossipHello(Player* /*player*/, GameObject* pGO) + bool OnGossipHello(Player* /*player*/, GameObject* go) { - InstanceScript* instance = pGO->GetInstanceScript(); + InstanceScript* instance = go->GetInstanceScript(); + if (!instance) + return true; - Creature* pPrinceTaldaram = Unit::GetCreature(*pGO, instance ? instance->GetData64(DATA_PRINCE_TALDARAM) : 0); + Creature* pPrinceTaldaram = Unit::GetCreature(*go, instance->GetData64(DATA_PRINCE_TALDARAM)); if (pPrinceTaldaram && pPrinceTaldaram->isAlive()) { // maybe these are hacks :( - pGO->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); - pGO->SetGoState(GO_STATE_ACTIVE); + go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); + go->SetGoState(GO_STATE_ACTIVE); - switch (pGO->GetEntry()) + switch (go->GetEntry()) { - case GO_SPHERE1: instance->SetData(DATA_SPHERE1_EVENT, IN_PROGRESS); break; - case GO_SPHERE2: instance->SetData(DATA_SPHERE2_EVENT, IN_PROGRESS); break; + case GO_SPHERE1: + instance->SetData(DATA_SPHERE1_EVENT, IN_PROGRESS); + pPrinceTaldaram->AI()->Talk(SAY_1); + break; + + case GO_SPHERE2: + instance->SetData(DATA_SPHERE2_EVENT, IN_PROGRESS); + pPrinceTaldaram->AI()->Talk(SAY_1); + break; } CAST_AI(boss_taldaram::boss_taldaramAI, pPrinceTaldaram->AI())->CheckSpheres(); diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/instance_ahnkahet.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/instance_ahnkahet.cpp index 3ae78d4053b..74643e58e30 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/instance_ahnkahet.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/instance_ahnkahet.cpp @@ -87,7 +87,8 @@ public: bool IsEncounterInProgress() const { for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; + if (m_auiEncounter[i] == IN_PROGRESS) + return true; return false; } @@ -109,26 +110,37 @@ public: { switch (go->GetEntry()) { - case 193564: Prince_TaldaramPlatform = go->GetGUID(); - if (m_auiEncounter[1] == DONE) HandleGameObject(0, true, go); break; - case 193093: Prince_TaldaramSpheres[0] = go->GetGUID(); + case 193564: + Prince_TaldaramPlatform = go->GetGUID(); + if (m_auiEncounter[1] == DONE) + HandleGameObject(0, true, go); + break; + + case 193093: + Prince_TaldaramSpheres[0] = go->GetGUID(); if (spheres[0] == IN_PROGRESS) { go->SetGoState(GO_STATE_ACTIVE); go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); } - else go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); + else + go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); break; - case 193094: Prince_TaldaramSpheres[1] = go->GetGUID(); + case 193094: + Prince_TaldaramSpheres[1] = go->GetGUID(); if (spheres[1] == IN_PROGRESS) { go->SetGoState(GO_STATE_ACTIVE); go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); } - else go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); + else + go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); + break; + case 192236: + Prince_TaldaramGate = go->GetGUID(); // Web gate past Prince Taldaram + if (m_auiEncounter[1] == DONE) + HandleGameObject(0, true, go); break; - case 192236: Prince_TaldaramGate = go->GetGUID(); // Web gate past Prince Taldaram - if (m_auiEncounter[1] == DONE)HandleGameObject(0, true, go);break; } } @@ -136,8 +148,13 @@ public: { switch (idx) { - case DATA_ADD_JEDOGA_OPFER: JedogaSacrifices = guid; break; - case DATA_PL_JEDOGA_TARGET: JedogaTarget = guid; break; + case DATA_ADD_JEDOGA_OPFER: + JedogaSacrifices = guid; + break; + + case DATA_PL_JEDOGA_TARGET: + JedogaTarget = guid; + break; } } @@ -178,7 +195,9 @@ public: { switch (type) { - case DATA_ELDER_NADOX_EVENT: m_auiEncounter[0] = data; break; + case DATA_ELDER_NADOX_EVENT: + m_auiEncounter[0] = data; + break; case DATA_PRINCE_TALDARAM_EVENT: if (data == DONE) HandleGameObject(Prince_TaldaramGate, true); @@ -200,11 +219,21 @@ public: } } break; - case DATA_HERALD_VOLAZJ_EVENT: m_auiEncounter[3] = data; break; - case DATA_AMANITAR_EVENT: m_auiEncounter[4] = data; break; - case DATA_SPHERE1_EVENT: spheres[0] = data; break; - case DATA_SPHERE2_EVENT: spheres[1] = data; break; - case DATA_JEDOGA_TRIGGER_SWITCH: switchtrigger = data; break; + case DATA_HERALD_VOLAZJ_EVENT: + m_auiEncounter[3] = data; + break; + case DATA_AMANITAR_EVENT: + m_auiEncounter[4] = data; + break; + case DATA_SPHERE1_EVENT: + spheres[0] = data; + break; + case DATA_SPHERE2_EVENT: + spheres[1] = data; + break; + case DATA_JEDOGA_TRIGGER_SWITCH: + switchtrigger = data; + break; case DATA_JEDOGA_RESET_INITIANDS: for (std::set::const_iterator itr = InitiandGUIDs.begin(); itr != InitiandGUIDs.end(); ++itr) { @@ -236,7 +265,8 @@ public: for (std::set::const_iterator itr = InitiandGUIDs.begin(); itr != InitiandGUIDs.end(); ++itr) { Creature* cr = instance->GetCreature(*itr); - if (!cr || (cr && cr->isAlive())) return 0; + if (!cr || (cr && cr->isAlive())) + return 0; } return 1; case DATA_JEDOGA_TRIGGER_SWITCH: return switchtrigger; diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp index 79a102c803f..ca71d8c313e 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp @@ -267,7 +267,7 @@ public: } } else DatterTimer -= diff; - if(me->HasAura(SPELL_LEECHING_SWARM)) + if (me->HasAura(SPELL_LEECHING_SWARM)) me->RemoveAurasDueToSpell(SPELL_LEECHING_SWARM); } diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp index da629fd45e9..6587631f249 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp @@ -51,9 +51,9 @@ public: struct boss_hadronoxAI : public ScriptedAI { - boss_hadronoxAI(Creature* c) : ScriptedAI(c) + boss_hadronoxAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); fMaxDistance = 50.0f; bFirstTime = true; } @@ -99,7 +99,7 @@ public: me->ModifyHealth(int32(me->CountPctFromMaxHealth(10))); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(DATA_HADRONOX_EVENT, DONE); @@ -136,7 +136,8 @@ public: void UpdateAI(const uint32 diff) { //Return since we have no target - if (!UpdateVictim()) return; + if (!UpdateVictim()) + return; // Without he comes up through the air to players on the bridge after krikthir if players crossing this bridge! CheckDistance(fMaxDistance, diff); diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp index 878e1f7555f..4d83be53c93 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp @@ -94,9 +94,9 @@ public: struct boss_krik_thirAI : public ScriptedAI { - boss_krik_thirAI(Creature* c) : ScriptedAI(c) + boss_krik_thirAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -212,7 +212,7 @@ public: struct npc_skittering_infectorAI : public ScriptedAI { - npc_skittering_infectorAI(Creature* c) : ScriptedAI(c) {} + npc_skittering_infectorAI(Creature* creature) : ScriptedAI(creature) {} void JustDied(Unit* /*killer*/) { @@ -234,7 +234,7 @@ public: struct npc_anub_ar_skirmisherAI : public ScriptedAI { - npc_anub_ar_skirmisherAI(Creature* c) : ScriptedAI(c) {} + npc_anub_ar_skirmisherAI(Creature* creature) : ScriptedAI(creature) {} uint32 uiChargeTimer; uint32 uiBackstabTimer; @@ -285,7 +285,7 @@ public: struct npc_anub_ar_shadowcasterAI : public ScriptedAI { - npc_anub_ar_shadowcasterAI(Creature* c) : ScriptedAI(c) {} + npc_anub_ar_shadowcasterAI(Creature* creature) : ScriptedAI(creature) {} uint32 uiShadowBoltTimer; uint32 uiShadowNovaTimer; @@ -331,7 +331,7 @@ public: struct npc_anub_ar_warriorAI : public ScriptedAI { - npc_anub_ar_warriorAI(Creature* c) : ScriptedAI(c){} + npc_anub_ar_warriorAI(Creature* creature) : ScriptedAI(creature){} uint32 uiCleaveTimer; uint32 uiStrikeTimer; @@ -376,7 +376,7 @@ public: struct npc_watcher_gashraAI : public ScriptedAI { - npc_watcher_gashraAI(Creature* c) : ScriptedAI(c) {} + npc_watcher_gashraAI(Creature* creature) : ScriptedAI(creature) {} uint32 uiWebWrapTimer; uint32 uiInfectedBiteTimer; @@ -427,7 +427,7 @@ public: struct npc_watcher_narjilAI : public ScriptedAI { - npc_watcher_narjilAI(Creature* c) : ScriptedAI(c) {} + npc_watcher_narjilAI(Creature* creature) : ScriptedAI(creature) {} uint32 uiWebWrapTimer; uint32 uiInfectedBiteTimer; @@ -481,7 +481,7 @@ public: struct npc_watcher_silthikAI : public ScriptedAI { - npc_watcher_silthikAI(Creature* c) : ScriptedAI(c) {} + npc_watcher_silthikAI(Creature* creature) : ScriptedAI(creature) {} uint32 uiWebWrapTimer; uint32 uiInfectedBiteTimer; diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp index e00db5d6494..12622174e29 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp @@ -64,7 +64,8 @@ public: bool IsEncounterInProgress() const { for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (auiEncounter[i] == IN_PROGRESS) return true; + if (auiEncounter[i] == IN_PROGRESS) + return true; return false; } diff --git a/src/server/scripts/Northrend/CMakeLists.txt b/src/server/scripts/Northrend/CMakeLists.txt index 53b47884e57..3502e7fb104 100644 --- a/src/server/scripts/Northrend/CMakeLists.txt +++ b/src/server/scripts/Northrend/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2011 TrinityCore +# Copyright (C) 2008-2012 TrinityCore # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without @@ -22,7 +22,7 @@ set(scripts_STAT_SRCS Northrend/Ulduar/Ulduar/ulduar_teleporter.cpp Northrend/Ulduar/Ulduar/boss_thorim.cpp Northrend/Ulduar/Ulduar/boss_ignis.cpp - Northrend/Ulduar/Ulduar/boss_algalon.cpp + Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp Northrend/Ulduar/Ulduar/instance_ulduar.cpp Northrend/Ulduar/Ulduar/boss_auriaya.cpp Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp diff --git a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp index 3e9d8144c19..b115a4ee827 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp @@ -480,7 +480,7 @@ public: if (temp->isAlive() && !temp->getVictim()) { if (temp->HasUnitMovementFlag(MOVEMENTFLAG_WALKING)) - temp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + temp->SetWalk(false); if (temp->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) temp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); @@ -926,9 +926,7 @@ struct dummy_dragonAI : public ScriptedAI if (instance && instance->GetData(TYPE_SARTHARION_EVENT) != IN_PROGRESS) instance->SetData(TYPE_SHADRON_PREKILLED, 1); if (Creature* pAcolyte = me->FindNearestCreature(NPC_ACOLYTE_OF_SHADRON, 100.0f)) - { pAcolyte->Kill(pAcolyte); - } break; case NPC_VESPERON: iTextId = SAY_VESPERON_DEATH; @@ -936,9 +934,7 @@ struct dummy_dragonAI : public ScriptedAI if (instance && instance->GetData(TYPE_SARTHARION_EVENT) != IN_PROGRESS) instance->SetData(TYPE_VESPERON_PREKILLED, 1); if (Creature* pAcolyte = me->FindNearestCreature(NPC_ACOLYTE_OF_VESPERON, 100.0f)) - { pAcolyte->Kill(pAcolyte); - } break; } @@ -955,7 +951,7 @@ struct dummy_dragonAI : public ScriptedAI return; // Twilight Revenge to main boss - if (Unit* pSartharion = Unit::GetUnit((*me), instance->GetData64(DATA_SARTHARION))) + if (Unit* pSartharion = Unit::GetUnit(*me, instance->GetData64(DATA_SARTHARION))) if (pSartharion->isAlive()) { pSartharion->RemoveAurasDueToSpell(uiSpellId); diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp index f41522f844d..b2cf755c7af 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp @@ -227,9 +227,9 @@ class npc_onyx_flamecaller : public CreatureScript zarithrian->AI()->JustSummoned(me); } - void WaypointReached(uint32 pointId) + void WaypointReached(uint32 waypointId) { - if (pointId == MAX_PATH_FLAMECALLER_WAYPOINTS || pointId == MAX_PATH_FLAMECALLER_WAYPOINTS*2) + if (waypointId == MAX_PATH_FLAMECALLER_WAYPOINTS || waypointId == MAX_PATH_FLAMECALLER_WAYPOINTS*2) { DoZoneInCombat(); SetEscortPaused(true); diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp index 78810e27b05..4e5e01cc745 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp @@ -105,8 +105,8 @@ class boss_saviana_ragefire : public CreatureScript Talk(SAY_CONFLAGRATION); break; case POINT_LAND: - me->SetFlying(false); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetCanFly(false); + me->SetDisableGravity(false); me->SetReactState(REACT_AGGRESSIVE); if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == POINT_MOTION_TYPE) me->GetMotionMaster()->MovementExpired(); @@ -120,8 +120,8 @@ class boss_saviana_ragefire : public CreatureScript void JustReachedHome() { _JustReachedHome(); - me->SetFlying(false); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetCanFly(false); + me->SetDisableGravity(false); } void KilledUnit(Unit* victim) @@ -146,8 +146,8 @@ class boss_saviana_ragefire : public CreatureScript { case EVENT_FLIGHT: { - me->SetFlying(true); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetCanFly(true); + me->SetDisableGravity(true); me->SetReactState(REACT_PASSIVE); me->GetMotionMaster()->MovePoint(POINT_FLIGHT, SavianaRagefireFlyPos); events.ScheduleEvent(EVENT_FLIGHT, 50000); @@ -206,7 +206,7 @@ class spell_saviana_conflagration_init : public SpellScriptLoader unitList.remove_if (ConflagrationTargetSelector()); uint8 maxSize = uint8(GetCaster()->GetMap()->GetSpawnMode() & 1 ? 6 : 3); if (unitList.size() > maxSize) - Trinity::RandomResizeList(unitList, maxSize); + Trinity::Containers::RandomResizeList(unitList, maxSize); } void HandleDummy(SpellEffIndex effIndex) diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.cpp index cfbbb79c5f6..19ae66b6a60 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.cpp @@ -71,7 +71,7 @@ class npc_xerestrasza : public CreatureScript _isIntro = false; Talk(SAY_XERESTRASZA_EVENT); - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); me->GetMotionMaster()->MovePoint(0, xerestraszaMovePos); _events.ScheduleEvent(EVENT_XERESTRASZA_EVENT_1, 16000); diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp index 19ed96e8885..305266ee628 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp @@ -414,8 +414,8 @@ public: void JustDied(Unit* /*killer*/) { - if (me->isSummon()) - if (Unit* summoner = me->ToTempSummon()->GetSummoner()) + if (TempSummon* summ = me->ToTempSummon()) + if (Unit* summoner = summ->GetSummoner()) if (summoner->isAlive()) summoner->GetAI()->SetData(1, 0); } @@ -447,9 +447,9 @@ public: uint8 uiWaypoint; - void WaypointReached(uint32 uiPoint) + void WaypointReached(uint32 waypointId) { - if (uiPoint == 0) + if (waypointId == 0) { switch (uiWaypoint) { diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp index 0848d1e9524..9768b50b214 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp @@ -356,7 +356,7 @@ public: Start(false, true, 0, NULL); } - void WaypointReached(uint32 /*i*/) + void WaypointReached(uint32 /*waypointId*/) { } diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp index 9fcfcfa47e5..18c972b966c 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp @@ -203,17 +203,19 @@ public: Start(false, true, 0, NULL); } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - switch (i) + if (!instance) + return; + + switch (waypointId) { case 2: - if ((instance && uiWaypointPath == 3) || uiWaypointPath == 2) + if (uiWaypointPath == 3 || uiWaypointPath == 2) instance->SetData(DATA_MOVEMENT_DONE, instance->GetData(DATA_MOVEMENT_DONE)+1); break; case 3: - if (instance) - instance->SetData(DATA_MOVEMENT_DONE, instance->GetData(DATA_MOVEMENT_DONE)+1); + instance->SetData(DATA_MOVEMENT_DONE, instance->GetData(DATA_MOVEMENT_DONE)+1); break; } } diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp index c17ea7411a0..c8236ace88c 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp @@ -125,8 +125,8 @@ public: break; case DATA_IN_POSITION: //movement done. me->GetMotionMaster()->MovePoint(1, 735.81f, 661.92f, 412.39f); - if (GameObject* pGO = GameObject::GetGameObject(*me, instance->GetData64(DATA_MAIN_GATE))) - instance->HandleGameObject(pGO->GetGUID(), false); + if (GameObject* go = GameObject::GetGameObject(*me, instance->GetData64(DATA_MAIN_GATE))) + instance->HandleGameObject(go->GetGUID(), false); NextStep(10000, false, 3); break; case DATA_LESSER_CHAMPIONS_DEFEATED: @@ -488,10 +488,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { player->CLOSE_GOSSIP_MENU(); CAST_AI(npc_announcer_toc5::npc_announcer_toc5AI, creature->AI())->StartEncounter(); diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp index a9e41d90899..e4dcf978574 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp @@ -104,7 +104,7 @@ enum BossSpells SPELL_SPIKE_TELE = 66170, }; -#define SPELL_PERMAFROST_HELPER RAID_MODE(66193, 67856, 67855, 67857) +#define SPELL_PERMAFROST_HELPER RAID_MODE(66193, 67855, 67856, 67857) enum SummonActions { @@ -141,10 +141,10 @@ public: { boss_anubarak_trialAI(Creature* creature) : ScriptedAI(creature), Summons(me) { - m_instance = (InstanceScript*)creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; SummonList Summons; std::list m_vBurrowGUID; @@ -195,8 +195,8 @@ public: if (who->GetTypeId() == TYPEID_PLAYER) { DoScriptText(urand(0, 1) ? SAY_KILL1 : SAY_KILL2, me); - if (m_instance) - m_instance->SetData(DATA_TRIBUTE_TO_IMMORTALITY_ELEGIBLE, 0); + if (instance) + instance->SetData(DATA_TRIBUTE_TO_IMMORTALITY_ELEGIBLE, 0); } } @@ -211,8 +211,8 @@ public: void JustReachedHome() { - if (m_instance) - m_instance->SetData(TYPE_ANUBARAK, FAIL); + if (instance) + instance->SetData(TYPE_ANUBARAK, FAIL); //Summon Scarab Swarms neutral at random places for (int i=0; i < 10; i++) if (Creature* temp = me->SummonCreature(NPC_SCARAB, AnubarakLoc[1].GetPositionX()+urand(0, 50)-25, AnubarakLoc[1].GetPositionY()+urand(0, 50)-25, AnubarakLoc[1].GetPositionZ())) @@ -223,8 +223,8 @@ public: { Summons.DespawnAll(); DoScriptText(SAY_DEATH, me); - if (m_instance) - m_instance->SetData(TYPE_ANUBARAK, DONE); + if (instance) + instance->SetData(TYPE_ANUBARAK, DONE); } void JustSummoned(Creature* summoned) @@ -260,10 +260,11 @@ public: DoScriptText(SAY_AGGRO, me); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); me->SetInCombatWithZone(); - if (m_instance) - m_instance->SetData(TYPE_ANUBARAK, IN_PROGRESS); + if (instance) + instance->SetData(TYPE_ANUBARAK, IN_PROGRESS); //Despawn Scarab Swarms neutral - Summons.DoAction(NPC_SCARAB, ACTION_SCARAB_SUBMERGE); + EntryCheckPredicate pred(NPC_SCARAB); + Summons.DoAction(ACTION_SCARAB_SUBMERGE, pred); //Spawn Burrow for (int i=0; i < 4; i++) me->SummonCreature(NPC_BURROW, AnubarakLoc[i+2]); @@ -278,6 +279,9 @@ public: if (!UpdateVictim()) return; + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + switch (m_uiStage) { case 0: @@ -301,7 +305,8 @@ public: if (IsHeroic() && m_uiNerubianShadowStrikeTimer <= uiDiff) { - Summons.DoAction(NPC_BURROWER, ACTION_SHADOW_STRIKE); + EntryCheckPredicate pred(NPC_BURROWER); + Summons.DoAction(ACTION_SHADOW_STRIKE, pred); m_uiNerubianShadowStrikeTimer = 30*IN_MILLISECONDS; } else m_uiNerubianShadowStrikeTimer -= uiDiff; @@ -426,10 +431,10 @@ public: { mob_swarm_scarabAI(Creature* creature) : ScriptedAI(creature) { - m_instance = (InstanceScript*)creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; uint32 m_uiDeterminationTimer; @@ -493,10 +498,10 @@ public: { mob_nerubian_burrowerAI(Creature* creature) : ScriptedAI(creature) { - m_instance = (InstanceScript*)creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; uint32 m_uiSpiderFrenzyTimer; uint32 m_uiSubmergeTimer; @@ -571,8 +576,11 @@ class mob_frost_sphere : public CreatureScript { _isFalling = false; me->SetReactState(REACT_PASSIVE); - me->SetFlying(true); - me->SetDisplayId(me->GetCreatureInfo()->Modelid2); + //! Confirmed sniff 3.3.5.a + me->SetDisableGravity(true); + me->SetByteValue(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER); + //! end + me->SetDisplayId(me->GetCreatureTemplate()->Modelid2); me->SetSpeed(MOVE_RUN, 0.5f, false); me->GetMotionMaster()->MoveRandom(20.0f); DoCast(SPELL_FROST_SPHERE); @@ -604,10 +612,10 @@ class mob_frost_sphere : public CreatureScript { case POINT_FALL_GROUND: me->RemoveAurasDueToSpell(SPELL_FROST_SPHERE); - me->SetDisplayId(me->GetCreatureInfo()->Modelid1); + me->SetDisplayId(me->GetCreatureTemplate()->Modelid1); DoCast(SPELL_PERMAFROST_VISUAL); DoCast(SPELL_PERMAFROST); - me->SetFloatValue(OBJECT_FIELD_SCALE_X, 2.0f); + me->SetObjectScale(2.0f); break; } } @@ -636,10 +644,10 @@ public: { mob_anubarak_spikeAI(Creature* creature) : ScriptedAI(creature) { - m_instance = (InstanceScript*)creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; uint32 m_uiIncreaseSpeedTimer; uint8 m_uiSpeed; uint64 m_uiTargetGUID; @@ -651,6 +659,11 @@ public: m_uiTargetGUID = 0; } + bool CanAIAttack(Unit const* victim) const + { + return victim->GetTypeId() == TYPEID_PLAYER; + } + void EnterCombat(Unit* who) { m_uiTargetGUID = who->GetGUID(); @@ -671,7 +684,7 @@ public: Unit* target = Unit::GetPlayer(*me, m_uiTargetGUID); if (!target || !target->isAlive() || !target->HasAura(SPELL_MARK)) { - if (Creature* pAnubarak = Unit::GetCreature((*me), m_instance->GetData64(NPC_ANUBARAK))) + if (Creature* pAnubarak = Unit::GetCreature((*me), instance->GetData64(NPC_ANUBARAK))) pAnubarak->CastSpell(pAnubarak, SPELL_SPIKE_TELE, false); me->DisappearAndDie(); return; diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp index 2fe0bd3f397..79bbb470edf 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp @@ -64,10 +64,10 @@ public: { boss_toc_champion_controllerAI(Creature* creature) : ScriptedAI(creature), Summons(me) { - m_instance = (InstanceScript*) creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; SummonList Summons; uint32 m_uiChampionsNotStarted; uint32 m_uiChampionsFailed; @@ -101,7 +101,7 @@ public: vOtherEntries.push_back(playerTeam == ALLIANCE ? NPC_HORDE_WARRIOR : NPC_ALLIANCE_WARRIOR); uint8 healersSubtracted = 2; - if (m_instance->instance->GetSpawnMode() == RAID_DIFFICULTY_25MAN_NORMAL || m_instance->instance->GetSpawnMode() == RAID_DIFFICULTY_25MAN_HEROIC) + if (instance->instance->GetSpawnMode() == RAID_DIFFICULTY_25MAN_NORMAL || instance->instance->GetSpawnMode() == RAID_DIFFICULTY_25MAN_HEROIC) healersSubtracted = 1; for (uint8 i = 0; i < healersSubtracted; ++i) { @@ -136,7 +136,7 @@ public: vHealersEntries.erase(vHealersEntries.begin()+pos); } - if (m_instance->instance->GetSpawnMode() == RAID_DIFFICULTY_10MAN_NORMAL || m_instance->instance->GetSpawnMode() == RAID_DIFFICULTY_10MAN_HEROIC) + if (instance->instance->GetSpawnMode() == RAID_DIFFICULTY_10MAN_NORMAL || instance->instance->GetSpawnMode() == RAID_DIFFICULTY_10MAN_HEROIC) for (uint8 i = 0; i < 4; ++i) vOtherEntries.erase(vOtherEntries.begin()+urand(0, vOtherEntries.size()-1)); @@ -214,7 +214,7 @@ public: m_uiChampionsFailed++; if (m_uiChampionsFailed + m_uiChampionsKilled >= Summons.size()) { - m_instance->SetData(TYPE_CRUSADERS, FAIL); + instance->SetData(TYPE_CRUSADERS, FAIL); Summons.DespawnAll(); me->DespawnOrUnsummon(); } @@ -227,16 +227,16 @@ public: m_uiChampionsKilled = 0; m_bInProgress = true; Summons.DoZoneInCombat(); - m_instance->SetData(TYPE_CRUSADERS, IN_PROGRESS); + instance->SetData(TYPE_CRUSADERS, IN_PROGRESS); } break; case DONE: m_uiChampionsKilled++; if (m_uiChampionsKilled == 1) - m_instance->SetData(TYPE_CRUSADERS, SPECIAL); + instance->SetData(TYPE_CRUSADERS, SPECIAL); else if (m_uiChampionsKilled >= Summons.size()) { - m_instance->SetData(TYPE_CRUSADERS, DONE); + instance->SetData(TYPE_CRUSADERS, DONE); Summons.DespawnAll(); me->DespawnOrUnsummon(); } @@ -253,11 +253,11 @@ struct boss_faction_championsAI : public ScriptedAI { boss_faction_championsAI(Creature* creature, uint32 aitype) : ScriptedAI(creature) { - m_instance = (InstanceScript*) creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); mAIType = aitype; } - InstanceScript* m_instance; + InstanceScript* instance; uint64 championControllerGUID; uint32 mAIType; @@ -273,8 +273,8 @@ struct boss_faction_championsAI : public ScriptedAI void JustReachedHome() { - if (m_instance) - if (Creature* pChampionController = Unit::GetCreature((*me), m_instance->GetData64(NPC_CHAMPIONS_CONTROLLER))) + if (instance) + if (Creature* pChampionController = Unit::GetCreature((*me), instance->GetData64(NPC_CHAMPIONS_CONTROLLER))) pChampionController->AI()->SetData(2, FAIL); me->DespawnOrUnsummon(); } @@ -292,7 +292,7 @@ struct boss_faction_championsAI : public ScriptedAI std::list const& tList = me->getThreatManager().getThreatList(); for (std::list::const_iterator itr = tList.begin(); itr != tList.end(); ++itr) { - Unit* unit = Unit::GetUnit((*me), (*itr)->getUnitGuid()); + Unit* unit = Unit::GetUnit(*me, (*itr)->getUnitGuid()); if (unit && me->getThreatManager().getThreat(unit)) { if (unit->GetTypeId()==TYPEID_PLAYER) @@ -326,8 +326,8 @@ struct boss_faction_championsAI : public ScriptedAI void JustDied(Unit* /*killer*/) { if (mAIType != AI_PET) - if (m_instance) - if (Creature* pChampionController = Unit::GetCreature((*me), m_instance->GetData64(NPC_CHAMPIONS_CONTROLLER))) + if (instance) + if (Creature* pChampionController = Unit::GetCreature((*me), instance->GetData64(NPC_CHAMPIONS_CONTROLLER))) pChampionController->AI()->SetData(2, DONE); } @@ -335,8 +335,8 @@ struct boss_faction_championsAI : public ScriptedAI { DoCast(me, SPELL_ANTI_AOE, true); me->SetInCombatWithZone(); - if (m_instance) - if (Creature* pChampionController = Unit::GetCreature((*me), m_instance->GetData64(NPC_CHAMPIONS_CONTROLLER))) + if (instance) + if (Creature* pChampionController = Unit::GetCreature((*me), instance->GetData64(NPC_CHAMPIONS_CONTROLLER))) pChampionController->AI()->SetData(2, IN_PROGRESS); } @@ -351,18 +351,18 @@ struct boss_faction_championsAI : public ScriptedAI if (Player* player = players.begin()->getSource()) TeamInInstance = player->GetTeam(); - if (m_instance) + if (instance) { if (TeamInInstance == ALLIANCE) { - if (Creature* temp = Unit::GetCreature(*me, m_instance->GetData64(NPC_VARIAN))) + if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(NPC_VARIAN))) DoScriptText(SAY_VARIAN_KILL_HORDE_PLAYER4+urand(0, 3), temp); // + cause we are on negative } else if (Creature* temp = me->FindNearestCreature(NPC_GARROSH, 300.f)) DoScriptText(SAY_GARROSH_KILL_ALLIANCE_PLAYER4+urand(0, 3), temp); // + cause we are on negative - m_instance->SetData(DATA_TRIBUTE_TO_IMMORTALITY_ELEGIBLE, 0); + instance->SetData(DATA_TRIBUTE_TO_IMMORTALITY_ELEGIBLE, 0); } } } @@ -384,7 +384,7 @@ struct boss_faction_championsAI : public ScriptedAI Unit* target; for (iter = tList.begin(); iter!=tList.end(); ++iter) { - target = Unit::GetUnit((*me), (*iter)->getUnitGuid()); + target = Unit::GetUnit(*me, (*iter)->getUnitGuid()); if (target && target->getPowerType() == POWER_MANA) return target; } @@ -399,7 +399,7 @@ struct boss_faction_championsAI : public ScriptedAI Unit* target; for (iter = tList.begin(); iter!=tList.end(); ++iter) { - target = Unit::GetUnit((*me), (*iter)->getUnitGuid()); + target = Unit::GetUnit(*me, (*iter)->getUnitGuid()); if (target && me->GetDistance2d(target) < distance) ++count; } @@ -408,7 +408,8 @@ struct boss_faction_championsAI : public ScriptedAI void AttackStart(Unit* who) { - if (!who) return; + if (!who) + return; if (me->Attack(who, true)) { @@ -494,7 +495,8 @@ public: void UpdateAI(const uint32 uiDiff) { - if (!UpdateVictim()) return; + if (!UpdateVictim()) + return; if (m_uiNatureGraspTimer <= uiDiff) { @@ -588,7 +590,8 @@ public: void UpdateAI(const uint32 uiDiff) { - if (!UpdateVictim()) return; + if (!UpdateVictim()) + return; if (m_uiHeroismOrBloodlustTimer <= uiDiff) { @@ -687,7 +690,8 @@ public: void UpdateAI(const uint32 uiDiff) { - if (!UpdateVictim()) return; + if (!UpdateVictim()) + return; if (m_uiBubbleTimer <= uiDiff) { @@ -786,7 +790,8 @@ public: void UpdateAI(const uint32 uiDiff) { - if (!UpdateVictim()) return; + if (!UpdateVictim()) + return; if (m_uiPsychicScreamTimer <= uiDiff) { @@ -879,7 +884,8 @@ public: void UpdateAI(const uint32 uiDiff) { - if (!UpdateVictim()) return; + if (!UpdateVictim()) + return; if (m_uiPsychicScreamTimer <= uiDiff) { @@ -990,7 +996,8 @@ public: void UpdateAI(const uint32 uiDiff) { - if (!UpdateVictim()) return; + if (!UpdateVictim()) + return; if (m_uiFearTimer <= uiDiff) { @@ -1093,7 +1100,8 @@ public: void UpdateAI(const uint32 uiDiff) { - if (!UpdateVictim()) return; + if (!UpdateVictim()) + return; if (m_uiCounterspellTimer <= uiDiff) { @@ -1204,7 +1212,8 @@ public: void UpdateAI(const uint32 uiDiff) { - if (!UpdateVictim()) return; + if (!UpdateVictim()) + return; if (m_uiDisengageTimer <= uiDiff) { @@ -1312,7 +1321,8 @@ public: void UpdateAI(const uint32 uiDiff) { - if (!UpdateVictim()) return; + if (!UpdateVictim()) + return; if (m_uiBarkskinTimer <= uiDiff) { @@ -1424,7 +1434,8 @@ public: void UpdateAI(const uint32 uiDiff) { - if (!UpdateVictim()) return; + if (!UpdateVictim()) + return; if (m_uiBladestormTimer <= uiDiff) { @@ -1534,7 +1545,8 @@ public: void UpdateAI(const uint32 uiDiff) { - if (!UpdateVictim()) return; + if (!UpdateVictim()) + return; if (m_uiIceboundFortitudeTimer <= uiDiff) { @@ -1636,7 +1648,8 @@ public: void UpdateAI(const uint32 uiDiff) { - if (!UpdateVictim()) return; + if (!UpdateVictim()) + return; if (m_uiFanOfKnivesTimer <= uiDiff) { @@ -1773,7 +1786,8 @@ public: void UpdateAI(const uint32 uiDiff) { - if (!UpdateVictim()) return; + if (!UpdateVictim()) + return; if (m_uiHeroismOrBloodlustTimer <= uiDiff) { @@ -1873,7 +1887,8 @@ public: void UpdateAI(const uint32 uiDiff) { - if (!UpdateVictim()) return; + if (!UpdateVictim()) + return; if (m_uiRepeteanceTimer <= uiDiff) { @@ -1951,7 +1966,8 @@ public: void UpdateAI(const uint32 uiDiff) { - if (!UpdateVictim()) return; + if (!UpdateVictim()) + return; if (m_uiDevourMagicTimer <= uiDiff) { @@ -2000,7 +2016,8 @@ public: void UpdateAI(const uint32 uiDiff) { - if (!UpdateVictim()) return; + if (!UpdateVictim()) + return; if (m_uiClawTimer <= uiDiff) { @@ -2011,11 +2028,8 @@ public: boss_faction_championsAI::UpdateAI(uiDiff); } }; - }; -/*========================================================*/ - void AddSC_boss_faction_champions() { new boss_toc_champion_controller(); diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp index 6cd049967c1..a7328b43826 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp @@ -106,11 +106,11 @@ public: { boss_jaraxxusAI(Creature* creature) : ScriptedAI(creature), Summons(me) { - m_instance = creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); Reset(); } - InstanceScript* m_instance; + InstanceScript* instance; SummonList Summons; @@ -124,8 +124,8 @@ public: void Reset() { - if (m_instance) - m_instance->SetData(TYPE_JARAXXUS, NOT_STARTED); + if (instance) + instance->SetData(TYPE_JARAXXUS, NOT_STARTED); SetEquipmentSlots(false, EQUIP_MAIN, EQUIP_OFFHAND, EQUIP_RANGED); m_uiFelFireballTimer = 5*IN_MILLISECONDS; m_uiFelLightningTimer = urand(10*IN_MILLISECONDS, 15*IN_MILLISECONDS); @@ -139,8 +139,8 @@ public: void JustReachedHome() { - if (m_instance) - m_instance->SetData(TYPE_JARAXXUS, FAIL); + if (instance) + instance->SetData(TYPE_JARAXXUS, FAIL); DoCast(me, SPELL_JARAXXUS_CHAINS); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->SetReactState(REACT_PASSIVE); @@ -150,8 +150,8 @@ public: { if (who->GetTypeId() == TYPEID_PLAYER) { - if (m_instance) - m_instance->SetData(DATA_TRIBUTE_TO_IMMORTALITY_ELEGIBLE, 0); + if (instance) + instance->SetData(DATA_TRIBUTE_TO_IMMORTALITY_ELEGIBLE, 0); } } @@ -159,8 +159,8 @@ public: { Summons.DespawnAll(); DoScriptText(SAY_DEATH, me); - if (m_instance) - m_instance->SetData(TYPE_JARAXXUS, DONE); + if (instance) + instance->SetData(TYPE_JARAXXUS, DONE); } void JustSummoned(Creature* summoned) @@ -171,8 +171,8 @@ public: void EnterCombat(Unit* /*who*/) { me->SetInCombatWithZone(); - if (m_instance) - m_instance->SetData(TYPE_JARAXXUS, IN_PROGRESS); + if (instance) + instance->SetData(TYPE_JARAXXUS, IN_PROGRESS); DoScriptText(SAY_AGGRO, me); } @@ -289,11 +289,11 @@ public: { mob_infernal_volcanoAI(Creature* creature) : Scripted_NoMovementAI(creature), Summons(me) { - m_instance = (InstanceScript*)creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); Reset(); } - InstanceScript* m_instance; + InstanceScript* instance; SummonList Summons; @@ -344,11 +344,11 @@ public: { mob_fel_infernalAI(Creature* creature) : ScriptedAI(creature) { - m_instance = (InstanceScript*)creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); Reset(); } - InstanceScript* m_instance; + InstanceScript* instance; uint32 m_uiFelStreakTimer; void Reset() @@ -368,7 +368,7 @@ public: if (!UpdateVictim()) return; - if (m_instance && m_instance->GetData(TYPE_JARAXXUS) != IN_PROGRESS) + if (instance && instance->GetData(TYPE_JARAXXUS) != IN_PROGRESS) me->DespawnOrUnsummon(); if (m_uiFelStreakTimer <= uiDiff) @@ -398,11 +398,11 @@ public: { mob_nether_portalAI(Creature* creature) : ScriptedAI(creature), Summons(me) { - m_instance = (InstanceScript*)creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); Reset(); } - InstanceScript* m_instance; + InstanceScript* instance; SummonList Summons; @@ -453,13 +453,13 @@ public: { mob_mistress_of_painAI(Creature* creature) : ScriptedAI(creature) { - m_instance = (InstanceScript*)creature->GetInstanceScript(); - if (m_instance) - m_instance->SetData(DATA_MISTRESS_OF_PAIN_COUNT, INCREASE); + instance = creature->GetInstanceScript(); + if (instance) + instance->SetData(DATA_MISTRESS_OF_PAIN_COUNT, INCREASE); Reset(); } - InstanceScript* m_instance; + InstanceScript* instance; uint32 m_uiShivanSlashTimer; uint32 m_uiSpinningStrikeTimer; uint32 m_uiMistressKissTimer; @@ -474,13 +474,13 @@ public: void JustDied(Unit* /*killer*/) { - if (m_instance) - m_instance->SetData(DATA_MISTRESS_OF_PAIN_COUNT, DECREASE); + if (instance) + instance->SetData(DATA_MISTRESS_OF_PAIN_COUNT, DECREASE); } void UpdateAI(const uint32 uiDiff) { - if (m_instance && m_instance->GetData(TYPE_JARAXXUS) != IN_PROGRESS) + if (instance && instance->GetData(TYPE_JARAXXUS) != IN_PROGRESS) { me->DespawnOrUnsummon(); return; diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp index 1eca7edb590..5bda32941c2 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp @@ -123,10 +123,10 @@ public: { boss_gormokAI(Creature* creature) : ScriptedAI(creature), Summons(me) { - m_instance = (InstanceScript*)creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; uint32 m_uiImpaleTimer; uint32 m_uiStaggeringStompTimer; @@ -151,7 +151,7 @@ public: void EnterEvadeMode() { - m_instance->DoUseDoorOrButton(m_instance->GetData64(GO_MAIN_GATE_DOOR)); + instance->DoUseDoorOrButton(instance->GetData64(GO_MAIN_GATE_DOOR)); ScriptedAI::EnterEvadeMode(); } @@ -163,7 +163,7 @@ public: switch (pointId) { case 0: - m_instance->DoUseDoorOrButton(m_instance->GetData64(GO_MAIN_GATE_DOOR)); + instance->DoUseDoorOrButton(instance->GetData64(GO_MAIN_GATE_DOOR)); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); me->SetReactState(REACT_AGGRESSIVE); me->SetInCombatWithZone(); @@ -173,16 +173,16 @@ public: void JustDied(Unit* /*killer*/) { - if (m_instance) - m_instance->SetData(TYPE_NORTHREND_BEASTS, GORMOK_DONE); + if (instance) + instance->SetData(TYPE_NORTHREND_BEASTS, GORMOK_DONE); } void JustReachedHome() { - if (m_instance) + if (instance) { - m_instance->DoUseDoorOrButton(m_instance->GetData64(GO_MAIN_GATE_DOOR)); - m_instance->SetData(TYPE_NORTHREND_BEASTS, FAIL); + instance->DoUseDoorOrButton(instance->GetData64(GO_MAIN_GATE_DOOR)); + instance->SetData(TYPE_NORTHREND_BEASTS, FAIL); } me->DespawnOrUnsummon(); } @@ -190,7 +190,7 @@ public: void EnterCombat(Unit* /*who*/) { me->SetInCombatWithZone(); - m_instance->SetData(TYPE_NORTHREND_BEASTS, GORMOK_IN_PROGRESS); + instance->SetData(TYPE_NORTHREND_BEASTS, GORMOK_IN_PROGRESS); } void JustSummoned(Creature* summon) @@ -263,12 +263,12 @@ public: { mob_snobold_vassalAI(Creature* creature) : ScriptedAI(creature) { - m_instance = (InstanceScript*)creature->GetInstanceScript(); - if (m_instance) - m_instance->SetData(DATA_SNOBOLD_COUNT, INCREASE); + instance = creature->GetInstanceScript(); + if (instance) + instance->SetData(DATA_SNOBOLD_COUNT, INCREASE); } - InstanceScript* m_instance; + InstanceScript* instance; uint32 m_uiFireBombTimer; uint32 m_uiBatterTimer; uint32 m_uiHeadCrackTimer; @@ -284,15 +284,15 @@ public: m_uiTargetGUID = 0; m_bTargetDied = false; - if (m_instance) - m_uiBossGUID = m_instance->GetData64(NPC_GORMOK); + if (instance) + m_uiBossGUID = instance->GetData64(NPC_GORMOK); //Workaround for Snobold me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); } void EnterEvadeMode() { - m_instance->DoUseDoorOrButton(m_instance->GetData64(GO_MAIN_GATE_DOOR)); + instance->DoUseDoorOrButton(instance->GetData64(GO_MAIN_GATE_DOOR)); ScriptedAI::EnterEvadeMode(); } @@ -328,8 +328,8 @@ public: if (Unit* target = Unit::GetPlayer(*me, m_uiTargetGUID)) if (target->isAlive()) target->RemoveAurasDueToSpell(SPELL_SNOBOLLED); - if (m_instance) - m_instance->SetData(DATA_SNOBOLD_COUNT, DECREASE); + if (instance) + instance->SetData(DATA_SNOBOLD_COUNT, DECREASE); } void UpdateAI(uint32 const diff) @@ -341,9 +341,9 @@ public: { if (!target->isAlive()) { - if (m_instance) + if (instance) { - Unit* gormok = ObjectAccessor::GetCreature(*me, m_instance->GetData64(NPC_GORMOK)); + Unit* gormok = ObjectAccessor::GetCreature(*me, instance->GetData64(NPC_GORMOK)); if (gormok && gormok->isAlive()) { SetCombatMovement(false); @@ -454,7 +454,8 @@ struct boss_jormungarAI : public ScriptedAI void UpdateAI(uint32 const diff) { - if (!UpdateVictim()) return; + if (!UpdateVictim()) + return; if (instanceScript && instanceScript->GetData(TYPE_NORTHREND_BEASTS) == SNAKES_SPECIAL && !enraged) { @@ -757,10 +758,10 @@ public: { boss_icehowlAI(Creature* creature) : ScriptedAI(creature) { - m_instance = (InstanceScript*)creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; uint32 m_uiFerociousButtTimer; uint32 m_uiArticBreathTimer; @@ -794,8 +795,8 @@ public: void JustDied(Unit* /*killer*/) { - if (m_instance) - m_instance->SetData(TYPE_NORTHREND_BEASTS, ICEHOWL_DONE); + if (instance) + instance->SetData(TYPE_NORTHREND_BEASTS, ICEHOWL_DONE); } void MovementInform(uint32 type, uint32 pointId) @@ -826,7 +827,7 @@ public: m_bMovementFinish = true; break; case 2: - m_instance->DoUseDoorOrButton(m_instance->GetData64(GO_MAIN_GATE_DOOR)); + instance->DoUseDoorOrButton(instance->GetData64(GO_MAIN_GATE_DOOR)); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); me->SetReactState(REACT_AGGRESSIVE); me->SetInCombatWithZone(); @@ -836,16 +837,16 @@ public: void EnterEvadeMode() { - m_instance->DoUseDoorOrButton(m_instance->GetData64(GO_MAIN_GATE_DOOR)); + instance->DoUseDoorOrButton(instance->GetData64(GO_MAIN_GATE_DOOR)); ScriptedAI::EnterEvadeMode(); } void JustReachedHome() { - if (m_instance) + if (instance) { - m_instance->DoUseDoorOrButton(m_instance->GetData64(GO_MAIN_GATE_DOOR)); - m_instance->SetData(TYPE_NORTHREND_BEASTS, FAIL); + instance->DoUseDoorOrButton(instance->GetData64(GO_MAIN_GATE_DOOR)); + instance->SetData(TYPE_NORTHREND_BEASTS, FAIL); } me->DespawnOrUnsummon(); } @@ -854,15 +855,15 @@ public: { if (who->GetTypeId() == TYPEID_PLAYER) { - if (m_instance) - m_instance->SetData(DATA_TRIBUTE_TO_IMMORTALITY_ELEGIBLE, 0); + if (instance) + instance->SetData(DATA_TRIBUTE_TO_IMMORTALITY_ELEGIBLE, 0); } } void EnterCombat(Unit* /*who*/) { - if (m_instance) - m_instance->SetData(TYPE_NORTHREND_BEASTS, ICEHOWL_IN_PROGRESS); + if (instance) + instance->SetData(TYPE_NORTHREND_BEASTS, ICEHOWL_IN_PROGRESS); me->SetInCombatWithZone(); } diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp index 242b2f2f0ea..cf84abb482f 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp @@ -143,10 +143,10 @@ struct boss_twin_baseAI : public ScriptedAI { boss_twin_baseAI(Creature* creature) : ScriptedAI(creature), Summons(me) { - m_instance = (InstanceScript*)creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; SummonList Summons; AuraStateType m_uiAuraState; @@ -176,7 +176,7 @@ struct boss_twin_baseAI : public ScriptedAI me->SetReactState(REACT_PASSIVE); me->ModifyAuraState(m_uiAuraState, true); /* Uncomment this once that they are flying above the ground - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetLevitate(true); me->SetFlying(true); */ m_bIsBerserk = false; @@ -190,8 +190,8 @@ struct boss_twin_baseAI : public ScriptedAI void JustReachedHome() { - if (m_instance) - m_instance->SetData(TYPE_VALKIRIES, FAIL); + if (instance) + instance->SetData(TYPE_VALKIRIES, FAIL); Summons.DespawnAll(); me->DespawnOrUnsummon(); @@ -199,12 +199,13 @@ struct boss_twin_baseAI : public ScriptedAI void MovementInform(uint32 uiType, uint32 uiId) { - if (uiType != POINT_MOTION_TYPE) return; + if (uiType != POINT_MOTION_TYPE) + return; switch (uiId) { case 1: - m_instance->DoUseDoorOrButton(m_instance->GetData64(GO_MAIN_GATE_DOOR)); + instance->DoUseDoorOrButton(instance->GetData64(GO_MAIN_GATE_DOOR)); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE); me->SetReactState(REACT_AGGRESSIVE); break; @@ -216,8 +217,8 @@ struct boss_twin_baseAI : public ScriptedAI if (who->GetTypeId() == TYPEID_PLAYER) { DoScriptText(urand(0, 1) ? SAY_KILL1 : SAY_KILL2, me); - if (m_instance) - m_instance->SetData(DATA_TRIBUTE_TO_IMMORTALITY_ELEGIBLE, 0); + if (instance) + instance->SetData(DATA_TRIBUTE_TO_IMMORTALITY_ELEGIBLE, 0); } } @@ -231,12 +232,12 @@ struct boss_twin_baseAI : public ScriptedAI switch (summoned->GetEntry()) { case NPC_LIGHT_ESSENCE: - m_instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_LIGHT_ESSENCE_HELPER); - m_instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_POWERING_UP_HELPER); + instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_LIGHT_ESSENCE_HELPER); + instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_POWERING_UP_HELPER); break; case NPC_DARK_ESSENCE: - m_instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_DARK_ESSENCE_HELPER); - m_instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_POWERING_UP_HELPER); + instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_DARK_ESSENCE_HELPER); + instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_POWERING_UP_HELPER); break; case NPC_BULLET_CONTROLLER: me->m_Events.AddEvent(new OrbsDespawner(me), me->m_Events.CalculateTime(100)); @@ -248,7 +249,7 @@ struct boss_twin_baseAI : public ScriptedAI void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); - if (m_instance) + if (instance) { if (Creature* pSister = GetSister()) { @@ -257,13 +258,13 @@ struct boss_twin_baseAI : public ScriptedAI me->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); pSister->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); - m_instance->SetData(TYPE_VALKIRIES, DONE); + instance->SetData(TYPE_VALKIRIES, DONE); Summons.DespawnAll(); } else { me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); - m_instance->SetData(TYPE_VALKIRIES, SPECIAL); + instance->SetData(TYPE_VALKIRIES, SPECIAL); } } } @@ -273,20 +274,20 @@ struct boss_twin_baseAI : public ScriptedAI // Called when sister pointer needed Creature* GetSister() { - return Unit::GetCreature((*me), m_instance->GetData64(m_uiSisterNpcId)); + return Unit::GetCreature((*me), instance->GetData64(m_uiSisterNpcId)); } void EnterCombat(Unit* /*who*/) { me->SetInCombatWithZone(); - if (m_instance) + if (instance) { if (Creature* pSister = GetSister()) { me->AddAura(m_uiMyEmphatySpellId, pSister); pSister->SetInCombatWithZone(); } - m_instance->SetData(TYPE_VALKIRIES, IN_PROGRESS); + instance->SetData(TYPE_VALKIRIES, IN_PROGRESS); } DoScriptText(SAY_AGGRO, me); @@ -315,7 +316,7 @@ struct boss_twin_baseAI : public ScriptedAI void UpdateAI(const uint32 uiDiff) { - if (!m_instance || !UpdateVictim()) + if (!instance || !UpdateVictim()) return; switch (m_uiStage) @@ -406,10 +407,10 @@ public: { boss_fjolaAI(Creature* creature) : boss_twin_baseAI(creature) { - m_instance = (InstanceScript*)creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; void Reset() { boss_twin_baseAI::Reset(); @@ -429,17 +430,17 @@ public: m_uiTouchSpellId = SPELL_LIGHT_TOUCH; m_uiSpikeSpellId = SPELL_LIGHT_TWIN_SPIKE; - if (m_instance) + if (instance) { - m_instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, EVENT_START_TWINS_FIGHT); + instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, EVENT_START_TWINS_FIGHT); } } void EnterCombat(Unit* who) { - if (m_instance) + if (instance) { - m_instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, EVENT_START_TWINS_FIGHT); + instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, EVENT_START_TWINS_FIGHT); } me->SummonCreature(NPC_BULLET_CONTROLLER, ToCCommonLoc[1].GetPositionX(), ToCCommonLoc[1].GetPositionY(), ToCCommonLoc[1].GetPositionZ(), 0.0f, TEMPSUMMON_MANUAL_DESPAWN); @@ -448,14 +449,14 @@ public: void EnterEvadeMode() { - m_instance->DoUseDoorOrButton(m_instance->GetData64(GO_MAIN_GATE_DOOR)); + instance->DoUseDoorOrButton(instance->GetData64(GO_MAIN_GATE_DOOR)); boss_twin_baseAI::EnterEvadeMode(); } void JustReachedHome() { - if (m_instance) - m_instance->DoUseDoorOrButton(m_instance->GetData64(GO_MAIN_GATE_DOOR)); + if (instance) + instance->DoUseDoorOrButton(instance->GetData64(GO_MAIN_GATE_DOOR)); boss_twin_baseAI::JustReachedHome(); } @@ -552,10 +553,10 @@ struct mob_unleashed_ballAI : public ScriptedAI { mob_unleashed_ballAI(Creature* creature) : ScriptedAI(creature) { - m_instance = (InstanceScript*)creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; uint32 m_uiRangeCheckTimer; void MoveToNextPoint() @@ -576,8 +577,8 @@ struct mob_unleashed_ballAI : public ScriptedAI { me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE); me->SetReactState(REACT_PASSIVE); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - me->SetFlying(true); + me->SetDisableGravity(true); + me->SetCanFly(true); SetCombatMovement(false); MoveToNextPoint(); m_uiRangeCheckTimer = IN_MILLISECONDS; @@ -585,7 +586,8 @@ struct mob_unleashed_ballAI : public ScriptedAI void MovementInform(uint32 uiType, uint32 uiId) { - if (uiType != POINT_MOTION_TYPE) return; + if (uiType != POINT_MOTION_TYPE) + return; switch (uiId) { @@ -617,8 +619,7 @@ public: { if (m_uiRangeCheckTimer < uiDiff) { - if (Unit* target = me->SelectNearestTarget(2.0f)) - if (target->GetTypeId() == TYPEID_PLAYER && target->isAlive()) + if (me->SelectNearestPlayer(2.0f)) { DoCastAOE(SPELL_UNLEASHED_DARK); me->GetMotionMaster()->MoveIdle(); @@ -659,8 +660,7 @@ public: { if (m_uiRangeCheckTimer < uiDiff) { - if (Unit* target = me->SelectNearestTarget(2.0f)) - if (target->GetTypeId() == TYPEID_PLAYER && target->isAlive()) + if (me->SelectNearestPlayer(2.0f)) { DoCastAOE(SPELL_UNLEASHED_LIGHT); me->GetMotionMaster()->MoveIdle(); @@ -759,7 +759,7 @@ class spell_powering_up : public SpellScriptLoader uint32 spellId; - bool Validate(SpellEntry const* /*spellEntry*/) + bool Load() { spellId = sSpellMgr->GetSpellIdForDifficulty(SPELL_SURGE_OF_SPEED, GetCaster()); if (!sSpellMgr->GetSpellInfo(spellId)) @@ -769,7 +769,7 @@ class spell_powering_up : public SpellScriptLoader void HandleScriptEffect(SpellEffIndex /*effIndex*/) { - if (Unit* target = GetTargetUnit()) + if (Unit* target = GetExplTargetUnit()) if (urand(0, 99) < 15) target->CastSpell(target, spellId, true); } diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp index 03de3d374ef..1966e26b128 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp @@ -105,7 +105,7 @@ class instance_trial_of_the_crusader : public InstanceMapScript bool IsEncounterInProgress() const { - for (uint8 i = 0; i < MAX_ENCOUNTERS ; ++i) + for (uint8 i = 0; i < MAX_ENCOUNTERS; ++i) if (EncounterStatus[i] == IN_PROGRESS) return true; return false; diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp index 3831e4824ad..2643b8d60c7 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp @@ -106,10 +106,10 @@ class npc_announcer_toc10 : public CreatureScript { npc_announcer_toc10AI(Creature* creature) : ScriptedAI(creature) { - m_instance = (InstanceScript*)creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; void Reset() { @@ -239,10 +239,10 @@ class boss_lich_king_toc : public CreatureScript { boss_lich_king_tocAI(Creature* creature) : ScriptedAI(creature) { - m_instance = (InstanceScript*)creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; uint32 m_uiUpdateTimer; void Reset() @@ -254,8 +254,8 @@ class boss_lich_king_toc : public CreatureScript summoned->CastSpell(summoned, 51807, false); summoned->SetDisplayId(11686); } - if (m_instance) m_instance->SetData(TYPE_LICH_KING, IN_PROGRESS); - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + if (instance) instance->SetData(TYPE_LICH_KING, IN_PROGRESS); + me->SetWalk(true); } void MovementInform(uint32 uiType, uint32 uiId) @@ -265,77 +265,80 @@ class boss_lich_king_toc : public CreatureScript switch (uiId) { case 0: - m_instance->SetData(TYPE_EVENT, 5030); + instance->SetData(TYPE_EVENT, 5030); break; case 1: - m_instance->SetData(TYPE_EVENT, 5050); + instance->SetData(TYPE_EVENT, 5050); break; } } void UpdateAI(const uint32 uiDiff) { - if (!m_instance) return; - if (m_instance->GetData(TYPE_EVENT_NPC) != NPC_LICH_KING_1) return; + if (!instance) + return; + + if (instance->GetData(TYPE_EVENT_NPC) != NPC_LICH_KING_1) + return; - m_uiUpdateTimer = m_instance->GetData(TYPE_EVENT_TIMER); + m_uiUpdateTimer = instance->GetData(TYPE_EVENT_TIMER); if (m_uiUpdateTimer <= uiDiff) { - switch (m_instance->GetData(TYPE_EVENT)) + switch (instance->GetData(TYPE_EVENT)) { case 5010: DoScriptText(SAY_STAGE_4_02, me); m_uiUpdateTimer = 3000; me->GetMotionMaster()->MovePoint(0, LichKingLoc[0]); - m_instance->SetData(TYPE_EVENT, 5020); + instance->SetData(TYPE_EVENT, 5020); break; case 5030: DoScriptText(SAY_STAGE_4_04, me); me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_TALK); m_uiUpdateTimer = 10000; - m_instance->SetData(TYPE_EVENT, 5040); + instance->SetData(TYPE_EVENT, 5040); break; case 5040: me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); me->GetMotionMaster()->MovePoint(1, LichKingLoc[1]); m_uiUpdateTimer = 1000; - m_instance->SetData(TYPE_EVENT, 0); + instance->SetData(TYPE_EVENT, 0); break; case 5050: me->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION); m_uiUpdateTimer = 3000; - m_instance->SetData(TYPE_EVENT, 5060); + instance->SetData(TYPE_EVENT, 5060); break; case 5060: DoScriptText(SAY_STAGE_4_05, me); me->HandleEmoteCommand(EMOTE_ONESHOT_KNEEL); m_uiUpdateTimer = 2500; - m_instance->SetData(TYPE_EVENT, 5070); + instance->SetData(TYPE_EVENT, 5070); break; case 5070: me->CastSpell(me, 68198, false); m_uiUpdateTimer = 1500; - m_instance->SetData(TYPE_EVENT, 5080); + instance->SetData(TYPE_EVENT, 5080); break; case 5080: - if (GameObject* pGoFloor = m_instance->instance->GetGameObject(m_instance->GetData64(GO_ARGENT_COLISEUM_FLOOR))) - pGoFloor->SetDestructibleState(GO_DESTRUCTIBLE_DESTROYED); + if (GameObject* go = instance->instance->GetGameObject(instance->GetData64(GO_ARGENT_COLISEUM_FLOOR))) + go->SetDestructibleState(GO_DESTRUCTIBLE_DESTROYED); me->CastSpell(me, 69016, false); - if (m_instance) + if (instance) { - m_instance->SetData(TYPE_LICH_KING, DONE); - Creature* temp = Unit::GetCreature(*me, m_instance->GetData64(NPC_ANUBARAK)); + instance->SetData(TYPE_LICH_KING, DONE); + Creature* temp = Unit::GetCreature(*me, instance->GetData64(NPC_ANUBARAK)); if (!temp || !temp->isAlive()) temp = me->SummonCreature(NPC_ANUBARAK, AnubarakLoc[0].GetPositionX(), AnubarakLoc[0].GetPositionY(), AnubarakLoc[0].GetPositionZ(), 3, TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME); - m_instance->SetData(TYPE_EVENT, 0); + instance->SetData(TYPE_EVENT, 0); } me->DespawnOrUnsummon(); m_uiUpdateTimer = 20000; break; } } else m_uiUpdateTimer -= uiDiff; - m_instance->SetData(TYPE_EVENT_TIMER, m_uiUpdateTimer); + instance->SetData(TYPE_EVENT_TIMER, m_uiUpdateTimer); } }; @@ -355,10 +358,10 @@ class npc_fizzlebang_toc : public CreatureScript { npc_fizzlebang_tocAI(Creature* creature) : ScriptedAI(creature), Summons(me) { - m_instance = (InstanceScript*)me->GetInstanceScript(); + instance = me->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; SummonList Summons; uint32 m_uiUpdateTimer; uint64 m_uiPortalGUID; @@ -367,8 +370,8 @@ class npc_fizzlebang_toc : public CreatureScript void JustDied(Unit* killer) { DoScriptText(SAY_STAGE_1_06, me, killer); - m_instance->SetData(TYPE_EVENT, 1180); - if (Creature* temp = Unit::GetCreature(*me, m_instance->GetData64(NPC_JARAXXUS))) + instance->SetData(TYPE_EVENT, 1180); + if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(NPC_JARAXXUS))) { temp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); temp->SetReactState(REACT_AGGRESSIVE); @@ -378,24 +381,25 @@ class npc_fizzlebang_toc : public CreatureScript void Reset() { - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); m_uiPortalGUID = 0; me->GetMotionMaster()->MovePoint(1, ToCCommonLoc[10].GetPositionX(), ToCCommonLoc[10].GetPositionY()-60, ToCCommonLoc[10].GetPositionZ()); } void MovementInform(uint32 uiType, uint32 uiId) { - if (uiType != POINT_MOTION_TYPE) return; + if (uiType != POINT_MOTION_TYPE) + return; switch (uiId) { case 1: - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); - if (m_instance) + me->SetWalk(false); + if (instance) { - m_instance->DoUseDoorOrButton(m_instance->GetData64(GO_MAIN_GATE_DOOR)); - m_instance->SetData(TYPE_EVENT, 1120); - m_instance->SetData(TYPE_EVENT_TIMER, 1000); + instance->DoUseDoorOrButton(instance->GetData64(GO_MAIN_GATE_DOOR)); + instance->SetData(TYPE_EVENT, 1120); + instance->SetData(TYPE_EVENT_TIMER, 1000); } break; } @@ -408,22 +412,24 @@ class npc_fizzlebang_toc : public CreatureScript void UpdateAI(const uint32 uiDiff) { - if (!m_instance) return; + if (!instance) + return; - if (m_instance->GetData(TYPE_EVENT_NPC) != NPC_FIZZLEBANG) return; + if (instance->GetData(TYPE_EVENT_NPC) != NPC_FIZZLEBANG) + return; - m_uiUpdateTimer = m_instance->GetData(TYPE_EVENT_TIMER); + m_uiUpdateTimer = instance->GetData(TYPE_EVENT_TIMER); if (m_uiUpdateTimer <= uiDiff) { - switch (m_instance->GetData(TYPE_EVENT)) + switch (instance->GetData(TYPE_EVENT)) { case 1110: - m_instance->SetData(TYPE_EVENT, 1120); + instance->SetData(TYPE_EVENT, 1120); m_uiUpdateTimer = 4000; break; case 1120: DoScriptText(SAY_STAGE_1_02, me); - m_instance->SetData(TYPE_EVENT, 1130); + instance->SetData(TYPE_EVENT, 1130); m_uiUpdateTimer = 12000; break; case 1130: @@ -433,16 +439,16 @@ class npc_fizzlebang_toc : public CreatureScript if (Unit* pTrigger = me->SummonCreature(NPC_TRIGGER, ToCCommonLoc[1].GetPositionX(), ToCCommonLoc[1].GetPositionY(), ToCCommonLoc[1].GetPositionZ(), 4.69494f, TEMPSUMMON_MANUAL_DESPAWN)) { m_uiTriggerGUID = pTrigger->GetGUID(); - pTrigger->SetFloatValue(OBJECT_FIELD_SCALE_X, 2.0f); + pTrigger->SetObjectScale(2.0f); pTrigger->SetDisplayId(22862); pTrigger->CastSpell(pTrigger, SPELL_WILFRED_PORTAL, false); } - m_instance->SetData(TYPE_EVENT, 1132); + instance->SetData(TYPE_EVENT, 1132); m_uiUpdateTimer = 4000; break; case 1132: me->GetMotionMaster()->MovementExpired(); - m_instance->SetData(TYPE_EVENT, 1134); + instance->SetData(TYPE_EVENT, 1134); m_uiUpdateTimer = 4000; break; case 1134: @@ -450,15 +456,15 @@ class npc_fizzlebang_toc : public CreatureScript if (Creature* pPortal = me->SummonCreature(NPC_WILFRED_PORTAL, ToCCommonLoc[1].GetPositionX(), ToCCommonLoc[1].GetPositionY(), ToCCommonLoc[1].GetPositionZ(), 4.71239f, TEMPSUMMON_MANUAL_DESPAWN)) { pPortal->SetReactState(REACT_PASSIVE); - pPortal->SetFloatValue(OBJECT_FIELD_SCALE_X, 2.0f); + pPortal->SetObjectScale(2.0f); pPortal->CastSpell(pPortal, SPELL_WILFRED_PORTAL, false); m_uiPortalGUID = pPortal->GetGUID(); } m_uiUpdateTimer = 4000; - m_instance->SetData(TYPE_EVENT, 1135); + instance->SetData(TYPE_EVENT, 1135); break; case 1135: - m_instance->SetData(TYPE_EVENT, 1140); + instance->SetData(TYPE_EVENT, 1140); m_uiUpdateTimer = 3000; break; case 1140: @@ -469,27 +475,27 @@ class npc_fizzlebang_toc : public CreatureScript temp->SetReactState(REACT_PASSIVE); temp->GetMotionMaster()->MovePoint(0, ToCCommonLoc[1].GetPositionX(), ToCCommonLoc[1].GetPositionY()-10, ToCCommonLoc[1].GetPositionZ()); } - m_instance->SetData(TYPE_EVENT, 1142); + instance->SetData(TYPE_EVENT, 1142); m_uiUpdateTimer = 5000; break; case 1142: - if (Creature* temp = Unit::GetCreature(*me, m_instance->GetData64(NPC_JARAXXUS))) + if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(NPC_JARAXXUS))) temp->SetTarget(me->GetGUID()); if (Creature* pTrigger = Unit::GetCreature(*me, m_uiTriggerGUID)) pTrigger->DespawnOrUnsummon(); if (Creature* pPortal = Unit::GetCreature(*me, m_uiPortalGUID)) pPortal->DespawnOrUnsummon(); - m_instance->SetData(TYPE_EVENT, 1144); + instance->SetData(TYPE_EVENT, 1144); m_uiUpdateTimer = 10000; break; case 1144: - if (Creature* temp = Unit::GetCreature(*me, m_instance->GetData64(NPC_JARAXXUS))) + if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(NPC_JARAXXUS))) DoScriptText(SAY_STAGE_1_05, temp); - m_instance->SetData(TYPE_EVENT, 1150); + instance->SetData(TYPE_EVENT, 1150); m_uiUpdateTimer = 5000; break; case 1150: - if (Creature* temp = Unit::GetCreature(*me, m_instance->GetData64(NPC_JARAXXUS))) + if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(NPC_JARAXXUS))) { //1-shot Fizzlebang temp->CastSpell(me, 67888, false); @@ -497,12 +503,12 @@ class npc_fizzlebang_toc : public CreatureScript temp->AddThreat(me, 1000.0f); temp->AI()->AttackStart(me); } - m_instance->SetData(TYPE_EVENT, 1160); + instance->SetData(TYPE_EVENT, 1160); m_uiUpdateTimer = 3000; break; } } else m_uiUpdateTimer -= uiDiff; - m_instance->SetData(TYPE_EVENT_TIMER, m_uiUpdateTimer); + instance->SetData(TYPE_EVENT_TIMER, m_uiUpdateTimer); } }; @@ -522,10 +528,10 @@ class npc_tirion_toc : public CreatureScript { npc_tirion_tocAI(Creature* creature) : ScriptedAI(creature) { - m_instance = (InstanceScript*)me->GetInstanceScript(); + instance = me->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; uint32 m_uiUpdateTimer; void Reset() {} @@ -534,31 +540,34 @@ class npc_tirion_toc : public CreatureScript void UpdateAI(const uint32 uiDiff) { - if (!m_instance) return; - if (m_instance->GetData(TYPE_EVENT_NPC) != NPC_TIRION) return; + if (!instance) + return; - m_uiUpdateTimer = m_instance->GetData(TYPE_EVENT_TIMER); + if (instance->GetData(TYPE_EVENT_NPC) != NPC_TIRION) + return; + + m_uiUpdateTimer = instance->GetData(TYPE_EVENT_TIMER); if (m_uiUpdateTimer <= uiDiff) { - switch (m_instance->GetData(TYPE_EVENT)) + switch (instance->GetData(TYPE_EVENT)) { case 110: me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_TALK); DoScriptText(SAY_STAGE_0_01, me); m_uiUpdateTimer = 22000; - m_instance->SetData(TYPE_EVENT, 120); + instance->SetData(TYPE_EVENT, 120); break; case 140: me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_TALK); DoScriptText(SAY_STAGE_0_02, me); m_uiUpdateTimer = 5000; - m_instance->SetData(TYPE_EVENT, 150); + instance->SetData(TYPE_EVENT, 150); break; case 150: me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE); - if (m_instance->GetData(TYPE_BEASTS) != DONE) + if (instance->GetData(TYPE_BEASTS) != DONE) { - m_instance->DoUseDoorOrButton(m_instance->GetData64(GO_MAIN_GATE_DOOR)); + instance->DoUseDoorOrButton(instance->GetData64(GO_MAIN_GATE_DOOR)); if (Creature* temp = me->SummonCreature(NPC_GORMOK, ToCSpawnLoc[0].GetPositionX(), ToCSpawnLoc[0].GetPositionY(), ToCSpawnLoc[0].GetPositionZ(), 5, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30*IN_MILLISECONDS)) { @@ -568,26 +577,26 @@ class npc_tirion_toc : public CreatureScript } } m_uiUpdateTimer = 3000; - m_instance->SetData(TYPE_EVENT, 155); + instance->SetData(TYPE_EVENT, 155); break; case 155: - m_instance->SetData(TYPE_BEASTS, IN_PROGRESS); + instance->SetData(TYPE_BEASTS, IN_PROGRESS); m_uiUpdateTimer = 5000; - m_instance->SetData(TYPE_EVENT, 160); + instance->SetData(TYPE_EVENT, 160); break; case 200: DoScriptText(SAY_STAGE_0_04, me); m_uiUpdateTimer = 8000; - m_instance->SetData(TYPE_EVENT, 205); + instance->SetData(TYPE_EVENT, 205); break; case 205: m_uiUpdateTimer = 3000; - m_instance->SetData(TYPE_EVENT, 210); + instance->SetData(TYPE_EVENT, 210); break; case 210: - if (m_instance->GetData(TYPE_BEASTS) != DONE) + if (instance->GetData(TYPE_BEASTS) != DONE) { - m_instance->DoUseDoorOrButton(m_instance->GetData64(GO_MAIN_GATE_DOOR)); + instance->DoUseDoorOrButton(instance->GetData64(GO_MAIN_GATE_DOOR)); if (Creature* temp = me->SummonCreature(NPC_DREADSCALE, ToCSpawnLoc[1].GetPositionX(), ToCSpawnLoc[1].GetPositionY(), ToCSpawnLoc[1].GetPositionZ(), 5, TEMPSUMMON_MANUAL_DESPAWN)) { temp->GetMotionMaster()->MovePoint(0, ToCCommonLoc[8].GetPositionX(), ToCCommonLoc[8].GetPositionY(), ToCCommonLoc[8].GetPositionZ()); @@ -602,24 +611,24 @@ class npc_tirion_toc : public CreatureScript } } m_uiUpdateTimer = 5000; - m_instance->SetData(TYPE_EVENT, 220); + instance->SetData(TYPE_EVENT, 220); break; case 220: - m_instance->SetData(TYPE_EVENT, 230); + instance->SetData(TYPE_EVENT, 230); break; case 300: DoScriptText(SAY_STAGE_0_05, me); m_uiUpdateTimer = 8000; - m_instance->SetData(TYPE_EVENT, 305); + instance->SetData(TYPE_EVENT, 305); break; case 305: m_uiUpdateTimer = 3000; - m_instance->SetData(TYPE_EVENT, 310); + instance->SetData(TYPE_EVENT, 310); break; case 310: - if (m_instance->GetData(TYPE_BEASTS) != DONE) + if (instance->GetData(TYPE_BEASTS) != DONE) { - m_instance->DoUseDoorOrButton(m_instance->GetData64(GO_MAIN_GATE_DOOR)); + instance->DoUseDoorOrButton(instance->GetData64(GO_MAIN_GATE_DOOR)); if (Creature* temp = me->SummonCreature(NPC_ICEHOWL, ToCSpawnLoc[0].GetPositionX(), ToCSpawnLoc[0].GetPositionY(), ToCSpawnLoc[0].GetPositionZ(), 5, TEMPSUMMON_DEAD_DESPAWN)) { temp->GetMotionMaster()->MovePoint(2, ToCCommonLoc[5].GetPositionX(), ToCCommonLoc[5].GetPositionY(), ToCCommonLoc[5].GetPositionZ()); @@ -629,92 +638,92 @@ class npc_tirion_toc : public CreatureScript } } m_uiUpdateTimer = 5000; - m_instance->SetData(TYPE_EVENT, 315); + instance->SetData(TYPE_EVENT, 315); break; case 315: - m_instance->SetData(TYPE_EVENT, 320); + instance->SetData(TYPE_EVENT, 320); break; case 400: DoScriptText(SAY_STAGE_0_06, me); m_uiUpdateTimer = 5000; - m_instance->SetData(TYPE_EVENT, 0); + instance->SetData(TYPE_EVENT, 0); break; case 666: DoScriptText(SAY_STAGE_0_WIPE, me); m_uiUpdateTimer = 5000; - m_instance->SetData(TYPE_EVENT, 0); + instance->SetData(TYPE_EVENT, 0); break; case 1010: DoScriptText(SAY_STAGE_1_01, me); m_uiUpdateTimer = 7000; - m_instance->DoUseDoorOrButton(m_instance->GetData64(GO_MAIN_GATE_DOOR)); + instance->DoUseDoorOrButton(instance->GetData64(GO_MAIN_GATE_DOOR)); me->SummonCreature(NPC_FIZZLEBANG, ToCSpawnLoc[0].GetPositionX(), ToCSpawnLoc[0].GetPositionY(), ToCSpawnLoc[0].GetPositionZ(), 2, TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME); - m_instance->SetData(TYPE_EVENT, 0); + instance->SetData(TYPE_EVENT, 0); break; case 1180: DoScriptText(SAY_STAGE_1_07, me); m_uiUpdateTimer = 3000; - m_instance->SetData(TYPE_EVENT, 0); + instance->SetData(TYPE_EVENT, 0); break; case 2000: DoScriptText(SAY_STAGE_1_08, me); m_uiUpdateTimer = 18000; - m_instance->SetData(TYPE_EVENT, 2010); + instance->SetData(TYPE_EVENT, 2010); break; case 2030: DoScriptText(SAY_STAGE_1_11, me); m_uiUpdateTimer = 5000; - m_instance->SetData(TYPE_EVENT, 0); + instance->SetData(TYPE_EVENT, 0); break; case 3000: DoScriptText(SAY_STAGE_2_01, me); m_uiUpdateTimer = 12000; - m_instance->SetData(TYPE_EVENT, 3050); + instance->SetData(TYPE_EVENT, 3050); break; case 3001: DoScriptText(SAY_STAGE_2_01, me); m_uiUpdateTimer = 12000; - m_instance->SetData(TYPE_EVENT, 3051); + instance->SetData(TYPE_EVENT, 3051); break; case 3060: DoScriptText(SAY_STAGE_2_03, me); m_uiUpdateTimer = 5000; - m_instance->SetData(TYPE_EVENT, 3070); + instance->SetData(TYPE_EVENT, 3070); break; case 3061: DoScriptText(SAY_STAGE_2_03, me); m_uiUpdateTimer = 5000; - m_instance->SetData(TYPE_EVENT, 3071); + instance->SetData(TYPE_EVENT, 3071); break; //Summoning crusaders case 3091: if (Creature* pChampionController = me->SummonCreature(NPC_CHAMPIONS_CONTROLLER, ToCCommonLoc[1])) pChampionController->AI()->SetData(0, HORDE); m_uiUpdateTimer = 3000; - m_instance->SetData(TYPE_EVENT, 3092); + instance->SetData(TYPE_EVENT, 3092); break; //Summoning crusaders case 3090: if (Creature* pChampionController = me->SummonCreature(NPC_CHAMPIONS_CONTROLLER, ToCCommonLoc[1])) pChampionController->AI()->SetData(0, ALLIANCE); m_uiUpdateTimer = 3000; - m_instance->SetData(TYPE_EVENT, 3092); + instance->SetData(TYPE_EVENT, 3092); break; case 3092: - if (Creature* pChampionController = Unit::GetCreature((*me), m_instance->GetData64(NPC_CHAMPIONS_CONTROLLER))) + if (Creature* pChampionController = Unit::GetCreature((*me), instance->GetData64(NPC_CHAMPIONS_CONTROLLER))) pChampionController->AI()->SetData(1, NOT_STARTED); - m_instance->SetData(TYPE_EVENT, 3095); + instance->SetData(TYPE_EVENT, 3095); break; //Crusaders battle end case 3100: DoScriptText(SAY_STAGE_2_06, me); m_uiUpdateTimer = 5000; - m_instance->SetData(TYPE_EVENT, 0); + instance->SetData(TYPE_EVENT, 0); break; case 4000: DoScriptText(SAY_STAGE_3_01, me); m_uiUpdateTimer = 13000; - m_instance->SetData(TYPE_EVENT, 4010); + instance->SetData(TYPE_EVENT, 4010); break; case 4010: DoScriptText(SAY_STAGE_3_02, me); @@ -733,72 +742,72 @@ class npc_tirion_toc : public CreatureScript temp->SummonCreature(NPC_DARK_ESSENCE, TwinValkyrsLoc[3].GetPositionX(), TwinValkyrsLoc[3].GetPositionY(), TwinValkyrsLoc[3].GetPositionZ()); } m_uiUpdateTimer = 3000; - m_instance->SetData(TYPE_EVENT, 4015); + instance->SetData(TYPE_EVENT, 4015); break; case 4015: - m_instance->DoUseDoorOrButton(m_instance->GetData64(GO_MAIN_GATE_DOOR)); - if (Creature* temp = Unit::GetCreature((*me), m_instance->GetData64(NPC_LIGHTBANE))) + instance->DoUseDoorOrButton(instance->GetData64(GO_MAIN_GATE_DOOR)); + if (Creature* temp = Unit::GetCreature((*me), instance->GetData64(NPC_LIGHTBANE))) { temp->GetMotionMaster()->MovePoint(1, ToCCommonLoc[8].GetPositionX(), ToCCommonLoc[8].GetPositionY(), ToCCommonLoc[8].GetPositionZ()); temp->SetVisible(true); } - if (Creature* temp = Unit::GetCreature((*me), m_instance->GetData64(NPC_DARKBANE))) + if (Creature* temp = Unit::GetCreature((*me), instance->GetData64(NPC_DARKBANE))) { temp->GetMotionMaster()->MovePoint(1, ToCCommonLoc[9].GetPositionX(), ToCCommonLoc[9].GetPositionY(), ToCCommonLoc[9].GetPositionZ()); temp->SetVisible(true); } m_uiUpdateTimer = 5000; - m_instance->SetData(TYPE_EVENT, 4016); + instance->SetData(TYPE_EVENT, 4016); break; case 4016: - m_instance->SetData(TYPE_EVENT, 4017); + instance->SetData(TYPE_EVENT, 4017); break; case 4040: m_uiUpdateTimer = 60000; - m_instance->SetData(TYPE_EVENT, 5000); + instance->SetData(TYPE_EVENT, 5000); break; case 5000: DoScriptText(SAY_STAGE_4_01, me); m_uiUpdateTimer = 10000; - m_instance->SetData(TYPE_EVENT, 5005); + instance->SetData(TYPE_EVENT, 5005); break; case 5005: m_uiUpdateTimer = 8000; - m_instance->SetData(TYPE_EVENT, 5010); + instance->SetData(TYPE_EVENT, 5010); me->SummonCreature(NPC_LICH_KING_1, ToCSpawnLoc[0].GetPositionX(), ToCSpawnLoc[0].GetPositionY(), ToCSpawnLoc[0].GetPositionZ(), 5); break; case 5020: DoScriptText(SAY_STAGE_4_03, me); m_uiUpdateTimer = 1000; - m_instance->SetData(TYPE_EVENT, 0); + instance->SetData(TYPE_EVENT, 0); break; case 6000: me->NearTeleportTo(AnubarakLoc[0].GetPositionX(), AnubarakLoc[0].GetPositionY(), AnubarakLoc[0].GetPositionZ(), 4.0f); m_uiUpdateTimer = 20000; - m_instance->SetData(TYPE_EVENT, 6005); + instance->SetData(TYPE_EVENT, 6005); break; case 6005: DoScriptText(SAY_STAGE_4_06, me); m_uiUpdateTimer = 20000; - m_instance->SetData(TYPE_EVENT, 6010); + instance->SetData(TYPE_EVENT, 6010); break; case 6010: if (IsHeroic()) { DoScriptText(SAY_STAGE_4_07, me); m_uiUpdateTimer = 60000; - m_instance->SetData(TYPE_ANUBARAK, SPECIAL); - m_instance->SetData(TYPE_EVENT, 6020); - } else m_instance->SetData(TYPE_EVENT, 6030); + instance->SetData(TYPE_ANUBARAK, SPECIAL); + instance->SetData(TYPE_EVENT, 6020); + } else instance->SetData(TYPE_EVENT, 6030); break; case 6020: me->DespawnOrUnsummon(); m_uiUpdateTimer = 5000; - m_instance->SetData(TYPE_EVENT, 6030); + instance->SetData(TYPE_EVENT, 6030); break; } } else m_uiUpdateTimer -= uiDiff; - m_instance->SetData(TYPE_EVENT_TIMER, m_uiUpdateTimer); + instance->SetData(TYPE_EVENT_TIMER, m_uiUpdateTimer); } }; @@ -818,10 +827,10 @@ class npc_garrosh_toc : public CreatureScript { npc_garrosh_tocAI(Creature* creature) : ScriptedAI(creature) { - m_instance = (InstanceScript*)me->GetInstanceScript(); + instance = me->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; uint32 m_uiUpdateTimer; void Reset() {} @@ -830,53 +839,56 @@ class npc_garrosh_toc : public CreatureScript void UpdateAI(const uint32 uiDiff) { - if (!m_instance) return; - if (m_instance->GetData(TYPE_EVENT_NPC) != NPC_GARROSH) return; + if (!instance) + return; + + if (instance->GetData(TYPE_EVENT_NPC) != NPC_GARROSH) + return; - m_uiUpdateTimer = m_instance->GetData(TYPE_EVENT_TIMER); + m_uiUpdateTimer = instance->GetData(TYPE_EVENT_TIMER); if (m_uiUpdateTimer <= uiDiff) { - switch (m_instance->GetData(TYPE_EVENT)) + switch (instance->GetData(TYPE_EVENT)) { case 130: me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_TALK); DoScriptText(SAY_STAGE_0_03h, me); m_uiUpdateTimer = 3000; - m_instance->SetData(TYPE_EVENT, 132); + instance->SetData(TYPE_EVENT, 132); break; case 132: me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE); m_uiUpdateTimer = 5000; - m_instance->SetData(TYPE_EVENT, 140); + instance->SetData(TYPE_EVENT, 140); break; case 2010: DoScriptText(SAY_STAGE_1_09, me); m_uiUpdateTimer = 9000; - m_instance->SetData(TYPE_EVENT, 2020); + instance->SetData(TYPE_EVENT, 2020); break; case 3050: DoScriptText(SAY_STAGE_2_02h, me); m_uiUpdateTimer = 15000; - m_instance->SetData(TYPE_EVENT, 3060); + instance->SetData(TYPE_EVENT, 3060); break; case 3070: DoScriptText(SAY_STAGE_2_04h, me); m_uiUpdateTimer = 6000; - m_instance->SetData(TYPE_EVENT, 3080); + instance->SetData(TYPE_EVENT, 3080); break; case 3081: DoScriptText(SAY_STAGE_2_05h, me); m_uiUpdateTimer = 3000; - m_instance->SetData(TYPE_EVENT, 3091); + instance->SetData(TYPE_EVENT, 3091); break; case 4030: DoScriptText(SAY_STAGE_3_03h, me); m_uiUpdateTimer = 5000; - m_instance->SetData(TYPE_EVENT, 4040); + instance->SetData(TYPE_EVENT, 4040); break; } } else m_uiUpdateTimer -= uiDiff; - m_instance->SetData(TYPE_EVENT_TIMER, m_uiUpdateTimer); + instance->SetData(TYPE_EVENT_TIMER, m_uiUpdateTimer); } }; @@ -896,10 +908,10 @@ class npc_varian_toc : public CreatureScript { npc_varian_tocAI(Creature* creature) : ScriptedAI(creature) { - m_instance = (InstanceScript*)me->GetInstanceScript(); + instance = me->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; uint32 m_uiUpdateTimer; void Reset() {} @@ -908,53 +920,56 @@ class npc_varian_toc : public CreatureScript void UpdateAI(const uint32 uiDiff) { - if (!m_instance) return; - if (m_instance->GetData(TYPE_EVENT_NPC) != NPC_VARIAN) return; + if (!instance) + return; + + if (instance->GetData(TYPE_EVENT_NPC) != NPC_VARIAN) + return; - m_uiUpdateTimer = m_instance->GetData(TYPE_EVENT_TIMER); + m_uiUpdateTimer = instance->GetData(TYPE_EVENT_TIMER); if (m_uiUpdateTimer <= uiDiff) { - switch (m_instance->GetData(TYPE_EVENT)) + switch (instance->GetData(TYPE_EVENT)) { case 120: me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_TALK); DoScriptText(SAY_STAGE_0_03a, me); m_uiUpdateTimer = 2000; - m_instance->SetData(TYPE_EVENT, 122); + instance->SetData(TYPE_EVENT, 122); break; case 122: me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE); m_uiUpdateTimer = 3000; - m_instance->SetData(TYPE_EVENT, 130); + instance->SetData(TYPE_EVENT, 130); break; case 2020: DoScriptText(SAY_STAGE_1_10, me); m_uiUpdateTimer = 5000; - m_instance->SetData(TYPE_EVENT, 2030); + instance->SetData(TYPE_EVENT, 2030); break; case 3051: DoScriptText(SAY_STAGE_2_02a, me); m_uiUpdateTimer = 10000; - m_instance->SetData(TYPE_EVENT, 3061); + instance->SetData(TYPE_EVENT, 3061); break; case 3071: DoScriptText(SAY_STAGE_2_04a, me); m_uiUpdateTimer = 5000; - m_instance->SetData(TYPE_EVENT, 3081); + instance->SetData(TYPE_EVENT, 3081); break; case 3080: DoScriptText(SAY_STAGE_2_05a, me); m_uiUpdateTimer = 3000; - m_instance->SetData(TYPE_EVENT, 3090); + instance->SetData(TYPE_EVENT, 3090); break; case 4020: DoScriptText(SAY_STAGE_3_03a, me); m_uiUpdateTimer = 5000; - m_instance->SetData(TYPE_EVENT, 4040); + instance->SetData(TYPE_EVENT, 4040); break; } } else m_uiUpdateTimer -= uiDiff; - m_instance->SetData(TYPE_EVENT_TIMER, m_uiUpdateTimer); + instance->SetData(TYPE_EVENT_TIMER, m_uiUpdateTimer); } }; diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_dred.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_dred.cpp index e96ef4ff366..95acc79231d 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/boss_dred.cpp +++ b/src/server/scripts/Northrend/DraktharonKeep/boss_dred.cpp @@ -161,7 +161,7 @@ class boss_dred : public CreatureScript return 0; } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(DATA_DRED_EVENT, DONE); @@ -211,7 +211,7 @@ class npc_drakkari_gutripper : public CreatureScript DoMeleeAttackIfReady(); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (Creature* Dred = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_DRED))) Dred->AI()->DoAction(ACTION_RAPTOR_KILLED); @@ -261,7 +261,7 @@ class npc_drakkari_scytheclaw : public CreatureScript DoMeleeAttackIfReady(); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (Creature* Dred = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_DRED))) Dred->AI()->DoAction(ACTION_RAPTOR_KILLED); diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp index 5418cf8c4d0..9ff8ee9c9ed 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp +++ b/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp @@ -72,9 +72,9 @@ public: struct boss_novosAI : public Scripted_NoMovementAI { - boss_novosAI(Creature* c) : Scripted_NoMovementAI(c), lSummons(me) + boss_novosAI(Creature* creature) : Scripted_NoMovementAI(creature), lSummons(me) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiTimer; @@ -260,9 +260,9 @@ public: struct mob_crystal_handlerAI : public ScriptedAI { - mob_crystal_handlerAI(Creature* c) : ScriptedAI(c) + mob_crystal_handlerAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiFlashOfDarknessTimer; @@ -317,9 +317,9 @@ public: struct mob_novos_minionAI : public ScriptedAI { - mob_novos_minionAI(Creature* c) : ScriptedAI(c) + mob_novos_minionAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp index 97f2ee4e9a1..b1d588a0d0d 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp +++ b/src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp @@ -71,9 +71,9 @@ public: struct boss_tharon_jaAI : public ScriptedAI { - boss_tharon_jaAI(Creature* c) : ScriptedAI(c) + boss_tharon_jaAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiPhaseTimer; diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp index 9fc964000e3..26e4e9db99e 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp +++ b/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp @@ -61,9 +61,9 @@ public: struct boss_trollgoreAI : public ScriptedAI { - boss_trollgoreAI(Creature* c) : ScriptedAI(c), lSummons(me) + boss_trollgoreAI(Creature* creature) : ScriptedAI(creature), lSummons(me) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiConsumeTimer; diff --git a/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp b/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp index 8e5e7c3e185..aff3f1b8e36 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp +++ b/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp @@ -83,7 +83,8 @@ public: bool IsEncounterInProgress() const { for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; + if (m_auiEncounter[i] == IN_PROGRESS) + return true; return false; } diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp index c8f18dba1d0..1469e26fd20 100644 --- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp @@ -18,53 +18,6 @@ #include "ScriptPCH.h" #include "forge_of_souls.h" -enum Spells -{ - //Spiteful Apparition - SPELL_SPITE = 68895, - H_SPELL_SPITE = 70212, - - //Spectral Warden - SPELL_VEIL_OF_SHADOWS = 69633, - SPELL_WAIL_OF_SOULS = 69148, - H_SPELL_WAIL_OF_SOULS = 70210, - - //Soulguard Watchman - SPELL_SHROUD_OF_RUNES = 69056, - SPELL_UNHOLY_RAGE = 69053, - - //Soulguard Reaper - SPELL_FROST_NOVA = 69060, - H_SPELL_FROST_NOVA = 70209, - SPELL_SHADOW_LANCE = 69058, - - //Soulguard Bonecaster - SPELL_BONE_VOLLEY = 69080, - H_SPELL_BONE_VOLLEY = 70206, - SPELL_RAISE_DEAD = 69562, - SPELL_SHIELD_OF_BONES = 69069, - H_SPELL_SHIELD_OF_BONES = 70207, - - //Soulguard Animator - // Raise dead 69562 - SPELL_SHADOW_BOLT = 69068, - H_SPELL_SHADOW_BOLT = 70208, - SPELL_SOUL_SICKNESS = 69131, - SPELL_SOUL_SIPHON = 69128, - - //Soulguard Adept - //Raise dead 69562 - //Shadow Bolt 69068/70208 - SPELL_DRAIN_LIFE = 69066, - H_SPELL_DRAIN_LIFE = 70213, - SPELL_SHADOW_MEND = 69564, - H_SPELL_SHADOW_MEND = 70205, - - //Soul Horror - SPELL_SOUL_STRIKE = 69088, - H_SPELL_SOUL_STRIKE = 70211, -}; - enum Events { EVENT_NONE, @@ -78,38 +31,6 @@ enum Events EVENT_INTRO_6, EVENT_INTRO_7, EVENT_INTRO_8, - - //Spiteful Apparition - EVENT_SPITE, - - //Spectral Warden - EVENT_VEIL_OF_SHADOWS, - EVENT_WAIL_OF_SOULS, - - //Soulguard Watchman - EVENT_SHROUD_OF_RUNES, - EVENT_UNHOLY_RAGE, - - //Soulguard Reaper - EVENT_FROST_NOVA, - EVENT_SHADOW_LANCE, - - //Soulguard Bonecaster - EVENT_BONE_VOLLEY, - EVENT_RAISE_DEAD, - EVENT_SHIELD_OF_BONES, - - //Soulguard Animator - EVENT_SHADOW_BOLT, - EVENT_SOUL_SICKNESS, - EVENT_SOUL_SIPHON, - - //Soulguard Adept - EVENT_DRAIN_LIFE, - EVENT_SHADOW_MEND, - - //Soul Horror - EVENT_SOUL_STRIKE, }; /****************************************SYLVANAS************************************/ @@ -251,10 +172,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->CLOSE_GOSSIP_MENU(); @@ -388,10 +309,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->CLOSE_GOSSIP_MENU(); @@ -410,508 +331,8 @@ public: } }; -class mob_spiteful_apparition : public CreatureScript -{ -public: - mob_spiteful_apparition() : CreatureScript("mob_spiteful_apparition") { } - - struct mob_spiteful_apparitionAI: public ScriptedAI - { - mob_spiteful_apparitionAI(Creature* creature) : ScriptedAI(creature) - { - } - - EventMap events; - - void Reset() - { - events.Reset(); - } - - void EnterCombat(Unit* /*who*/) - { - events.ScheduleEvent(EVENT_SPITE, 8000); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - events.Update(diff); - - if (me->HasUnitState(UNIT_STATE_CASTING)) - return; - - while (uint32 eventId = events.ExecuteEvent()) - { - switch (eventId) - { - case EVENT_SPITE: - DoCastVictim(SPELL_SPITE); - events.RescheduleEvent(EVENT_SPITE, 8000); - return; - } - } - - DoMeleeAttackIfReady(); - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_spiteful_apparitionAI(creature); - } -}; - -class mob_spectral_warden : public CreatureScript -{ -public: - mob_spectral_warden() : CreatureScript("mob_spectral_warden") { } - - struct mob_spectral_wardenAI: public ScriptedAI - { - mob_spectral_wardenAI(Creature* creature) : ScriptedAI(creature) - { - } - - EventMap events; - - void Reset() - { - events.Reset(); - } - - void EnterCombat(Unit* /*who*/) - { - events.ScheduleEvent(EVENT_VEIL_OF_SHADOWS, 5000); - events.ScheduleEvent(EVENT_WAIL_OF_SOULS, 10000); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - events.Update(diff); - - if (me->HasUnitState(UNIT_STATE_CASTING)) - return; - - while (uint32 eventId = events.ExecuteEvent()) - { - switch (eventId) - { - case EVENT_VEIL_OF_SHADOWS: - DoCastVictim(SPELL_VEIL_OF_SHADOWS); - events.RescheduleEvent(EVENT_VEIL_OF_SHADOWS, 10000); - return; - case EVENT_WAIL_OF_SOULS: - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_WAIL_OF_SOULS); - events.RescheduleEvent(EVENT_WAIL_OF_SOULS, 5000); - return; - } - } - DoMeleeAttackIfReady(); - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_spectral_wardenAI(creature); - } -}; - -class mob_soulguard_watchman : public CreatureScript -{ -public: - mob_soulguard_watchman() : CreatureScript("mob_soulguard_watchman") { } - - struct mob_soulguard_watchmanAI: public ScriptedAI - { - mob_soulguard_watchmanAI(Creature* creature) : ScriptedAI(creature) { } - - EventMap events; - - void Reset() - { - events.Reset(); - } - - void EnterCombat(Unit* /*who*/) - { - events.ScheduleEvent(EVENT_SHROUD_OF_RUNES, 1000); - events.ScheduleEvent(EVENT_UNHOLY_RAGE, 1000); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - events.Update(diff); - - if (me->HasUnitState(UNIT_STATE_CASTING)) - return; - - while (uint32 eventId = events.ExecuteEvent()) - { - switch (eventId) - { - case EVENT_SHROUD_OF_RUNES: - DoCast(me, SPELL_SHROUD_OF_RUNES); - events.RescheduleEvent(EVENT_SHROUD_OF_RUNES, 5000); - return; - case EVENT_UNHOLY_RAGE: - DoCast(me, SPELL_UNHOLY_RAGE); - events.RescheduleEvent(EVENT_UNHOLY_RAGE, 99999); - return; - } - } - DoMeleeAttackIfReady(); - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_soulguard_watchmanAI(creature); - } -}; - -class mob_soulguard_reaper : public CreatureScript -{ -public: - mob_soulguard_reaper() : CreatureScript("mob_soulguard_reaper") { } - - struct mob_soulguard_reaperAI: public ScriptedAI - { - mob_soulguard_reaperAI(Creature* creature) : ScriptedAI(creature) { } - - EventMap events; - - void Reset() - { - events.Reset(); - } - - void EnterCombat(Unit* /*who*/) - { - events.ScheduleEvent(EVENT_FROST_NOVA, 8000); - events.ScheduleEvent(EVENT_SHADOW_LANCE, 5000); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - events.Update(diff); - - if (me->HasUnitState(UNIT_STATE_CASTING)) - return; - - while (uint32 eventId = events.ExecuteEvent()) - { - switch (eventId) - { - case EVENT_FROST_NOVA: - DoCast(me, SPELL_FROST_NOVA); - events.RescheduleEvent(EVENT_FROST_NOVA, 9600); - return; - case EVENT_SHADOW_LANCE: - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_SHADOW_LANCE); - events.RescheduleEvent(EVENT_SHADOW_LANCE, 8000); - return; - } - } - - DoMeleeAttackIfReady(); - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_soulguard_reaperAI(creature); - } -}; - -class mob_soulguard_bonecaster : public CreatureScript -{ -public: - mob_soulguard_bonecaster() : CreatureScript("mob_soulguard_bonecaster") { } - - struct mob_soulguard_bonecasterAI: public ScriptedAI - { - mob_soulguard_bonecasterAI(Creature* creature) : ScriptedAI(creature) { } - - EventMap events; - - void Reset() - { - events.Reset(); - } - - void EnterCombat(Unit* /*who*/) - { - events.ScheduleEvent(EVENT_BONE_VOLLEY, 6000); - events.ScheduleEvent(EVENT_RAISE_DEAD, 25000); - events.ScheduleEvent(EVENT_SHIELD_OF_BONES, 6000); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - events.Update(diff); - - if (me->HasUnitState(UNIT_STATE_CASTING)) - return; - - while (uint32 eventId = events.ExecuteEvent()) - { - switch (eventId) - { - case EVENT_BONE_VOLLEY: - DoCastAOE(SPELL_BONE_VOLLEY); - events.RescheduleEvent(EVENT_BONE_VOLLEY, 7000); - return; - case EVENT_RAISE_DEAD: - DoCast(me, SPELL_RAISE_DEAD); - events.RescheduleEvent(EVENT_RAISE_DEAD, 25000); - return; - case EVENT_SHIELD_OF_BONES: - DoCast(me, SPELL_SHIELD_OF_BONES); - events.RescheduleEvent(EVENT_SHIELD_OF_BONES, 8000); - return; - } - } - - DoMeleeAttackIfReady(); - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_soulguard_bonecasterAI(creature); - } -}; - -class mob_soulguard_animator : public CreatureScript -{ -public: - mob_soulguard_animator() : CreatureScript("mob_soulguard_animator") { } - - struct mob_soulguard_animatorAI : public ScriptedAI - { - mob_soulguard_animatorAI(Creature* creature) : ScriptedAI(creature) - { - } - - EventMap events; - - void Reset() - { - events.Reset(); - } - - void EnterCombat(Unit* /*who*/) - { - events.ScheduleEvent(EVENT_RAISE_DEAD, 25000); - events.ScheduleEvent(EVENT_SHADOW_BOLT, 5000); - events.ScheduleEvent(EVENT_SOUL_SICKNESS, 8000); - events.ScheduleEvent(EVENT_SOUL_SIPHON, 10000); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - events.Update(diff); - - if (me->HasUnitState(UNIT_STATE_CASTING)) - return; - - while (uint32 eventId = events.ExecuteEvent()) - { - switch (eventId) - { - case EVENT_RAISE_DEAD: - DoCast(me, SPELL_RAISE_DEAD); - events.RescheduleEvent(EVENT_RAISE_DEAD, 25000); - return; - case EVENT_SHADOW_BOLT: - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_SHADOW_BOLT); - events.RescheduleEvent(EVENT_SHADOW_BOLT, 5000); - return; - case EVENT_SOUL_SICKNESS: - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_SOUL_SICKNESS); - events.RescheduleEvent(EVENT_SOUL_SICKNESS, 10000); - return; - case EVENT_SOUL_SIPHON: - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_SOUL_SIPHON); - events.RescheduleEvent(EVENT_SOUL_SIPHON, 8000); - return; - } - } - - DoMeleeAttackIfReady(); - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_soulguard_animatorAI(creature); - } -}; - -class mob_soulguard_adept : public CreatureScript -{ -public: - mob_soulguard_adept() : CreatureScript("mob_soulguard_adept") { } - - struct mob_soulguard_adeptAI: public ScriptedAI - { - mob_soulguard_adeptAI(Creature* creature) : ScriptedAI(creature) - { - } - - EventMap events; - - void Reset() - { - events.Reset(); - } - - void EnterCombat(Unit* /*who*/) - { - events.ScheduleEvent(EVENT_RAISE_DEAD, 25000); - events.ScheduleEvent(EVENT_SHADOW_BOLT, 8000); - events.ScheduleEvent(EVENT_DRAIN_LIFE, 7000); - events.ScheduleEvent(EVENT_SHADOW_MEND, 35000); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - events.Update(diff); - - if (me->HasUnitState(UNIT_STATE_CASTING)) - return; - - while (uint32 eventId = events.ExecuteEvent()) - { - switch (eventId) - { - case EVENT_RAISE_DEAD: - DoCast(me, SPELL_RAISE_DEAD); - events.RescheduleEvent(EVENT_RAISE_DEAD, 25000); - return; - case EVENT_SHADOW_BOLT: - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_SHADOW_BOLT); - events.RescheduleEvent(EVENT_SHADOW_BOLT, 4000); - return; - case EVENT_DRAIN_LIFE: - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_DRAIN_LIFE); - events.RescheduleEvent(EVENT_DRAIN_LIFE, 9000); - return; - case EVENT_SHADOW_MEND: - DoCast(me, SPELL_SHADOW_MEND); - events.RescheduleEvent(EVENT_SHADOW_MEND, 20000); - return; - } - } - - DoMeleeAttackIfReady(); - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_soulguard_adeptAI(creature); - } -}; - -class mob_soul_horror : public CreatureScript -{ -public: - mob_soul_horror() : CreatureScript("mob_soul_horror") { } - - struct mob_soul_horrorAI : public ScriptedAI - { - mob_soul_horrorAI(Creature* creature) : ScriptedAI(creature) { } - - EventMap events; - - void Reset() - { - events.Reset(); - } - - void EnterCombat(Unit* /*who*/) - { - events.ScheduleEvent(EVENT_SOUL_STRIKE, 6000); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - events.Update(diff); - - if (me->HasUnitState(UNIT_STATE_CASTING)) - return; - - while (uint32 eventId = events.ExecuteEvent()) - { - switch (eventId) - { - case EVENT_SOUL_STRIKE: - DoCast(me->getVictim(), SPELL_SOUL_STRIKE); - events.RescheduleEvent(EVENT_SOUL_STRIKE, 8000); - return; - } - } - - DoMeleeAttackIfReady(); - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_soul_horrorAI(creature); - } -}; - void AddSC_forge_of_souls() { new npc_sylvanas_fos(); new npc_jaina_fos(); - new mob_spiteful_apparition(); - new mob_spectral_warden(); - new mob_soulguard_watchman(); - new mob_soulguard_reaper(); - new mob_soulguard_bonecaster(); - new mob_soulguard_animator(); - new mob_soulguard_adept(); - new mob_soul_horror(); } diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp index 1583bdbdcd4..2abb60d5de2 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp @@ -157,10 +157,10 @@ private: public: npc_jaina_or_sylvanas_hor(bool isSylvana, const char* name) : CreatureScript(name), m_isSylvana(isSylvana) { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->CLOSE_GOSSIP_MENU(); @@ -248,7 +248,7 @@ public: { case EVENT_START_INTRO: me->GetMotionMaster()->MovePoint(0, MoveThronePos); - // Begining of intro is differents between factions as the speech sequence and timers are differents. + // Begining of intro is differents between fActions as the speech sequence and timers are differents. if (instance->GetData(DATA_TEAM_IN_INSTANCE) == ALLIANCE) events.ScheduleEvent(EVENT_INTRO_A2_1, 0); else @@ -633,7 +633,7 @@ public: struct npc_ghostly_priestAI: public ScriptedAI { - npc_ghostly_priestAI(Creature* c) : ScriptedAI(c) + npc_ghostly_priestAI(Creature* creature) : ScriptedAI(creature) { } @@ -715,7 +715,7 @@ public: struct npc_phantom_mageAI: public ScriptedAI { - npc_phantom_mageAI(Creature* c) : ScriptedAI(c) + npc_phantom_mageAI(Creature* creature) : ScriptedAI(creature) { } @@ -792,11 +792,11 @@ public: struct npc_phantom_hallucinationAI : public npc_phantom_mage::npc_phantom_mageAI { - npc_phantom_hallucinationAI(Creature* c) : npc_phantom_mage::npc_phantom_mageAI(c) + npc_phantom_hallucinationAI(Creature* creature) : npc_phantom_mage::npc_phantom_mageAI(creature) { } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { DoCast(SPELL_HALLUCINATION_2); } @@ -816,7 +816,7 @@ public: struct npc_shadowy_mercenaryAI: public ScriptedAI { - npc_shadowy_mercenaryAI(Creature* c) : ScriptedAI(c) + npc_shadowy_mercenaryAI(Creature* creature) : ScriptedAI(creature) { } @@ -887,7 +887,7 @@ public: struct npc_spectral_footmanAI: public ScriptedAI { - npc_spectral_footmanAI(Creature* c) : ScriptedAI(c) + npc_spectral_footmanAI(Creature* creature) : ScriptedAI(creature) { } @@ -952,7 +952,7 @@ public: struct npc_tortured_riflemanAI : public ScriptedAI { - npc_tortured_riflemanAI(Creature* c) : ScriptedAI(c) + npc_tortured_riflemanAI(Creature* creature) : ScriptedAI(creature) { } diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp index 64609efd7ff..a3b8c5df4e7 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp @@ -20,14 +20,15 @@ enum Yells { - SAY_AGGRO = -1658001, - SAY_SLAY_1 = -1658002, - SAY_SLAY_2 = -1658003, - SAY_DEATH = -1658004, - SAY_PHASE2 = -1658005, - SAY_PHASE3 = -1658006, - - SAY_TYRANNUS_DEATH = -1658007, + SAY_AGGRO = 0, + SAY_PHASE2 = 1, + SAY_PHASE3 = 2, + SAY_DEATH = 3, + SAY_SLAY = 4, + SAY_THROW_SARONITE = 5, + SAY_CAST_DEEP_FREEZE = 6, + + SAY_TYRANNUS_DEATH = -1658007, // todo }; enum Spells @@ -107,8 +108,9 @@ class boss_garfrost : public CreatureScript void EnterCombat(Unit* /*who*/) { - DoScriptText(SAY_AGGRO, me); + Talk(SAY_AGGRO); DoCast(me, SPELL_PERMAFROST); + me->CallForHelp(70.0f); events.ScheduleEvent(EVENT_THROW_SARONITE, 7000); instance->SetBossState(DATA_GARFROST, IN_PROGRESS); @@ -117,12 +119,13 @@ class boss_garfrost : public CreatureScript void KilledUnit(Unit* victim) { if (victim->GetTypeId() == TYPEID_PLAYER) - DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2), me); + Talk(SAY_SLAY); } void JustDied(Unit* /*killer*/) { - DoScriptText(SAY_DEATH, me); + Talk(SAY_DEATH); + if (Creature* tyrannus = me->GetCreature(*me, instance->GetData64(DATA_TYRANNUS))) DoScriptText(SAY_TYRANNUS_DEATH, tyrannus); @@ -134,6 +137,7 @@ class boss_garfrost : public CreatureScript if (events.GetPhaseMask() & PHASE_ONE_MASK && !HealthAbovePct(66)) { events.SetPhase(PHASE_TWO); + Talk(SAY_PHASE2); events.DelayEvents(8000); DoCast(me, SPELL_THUNDERING_STOMP); events.ScheduleEvent(EVENT_JUMP, 1500); @@ -143,6 +147,7 @@ class boss_garfrost : public CreatureScript if (events.GetPhaseMask() & PHASE_TWO_MASK && !HealthAbovePct(33)) { events.SetPhase(PHASE_THREE); + Talk(SAY_PHASE3); events.DelayEvents(8000); DoCast(me, SPELL_THUNDERING_STOMP); events.ScheduleEvent(EVENT_JUMP, 1500); @@ -199,7 +204,10 @@ class boss_garfrost : public CreatureScript { case EVENT_THROW_SARONITE: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) + { + Talk(SAY_THROW_SARONITE); DoCast(target, SPELL_THROW_SARONITE); + } events.ScheduleEvent(EVENT_THROW_SARONITE, urand(12500, 20000)); break; case EVENT_CHILLING_WAVE: @@ -208,7 +216,10 @@ class boss_garfrost : public CreatureScript break; case EVENT_DEEP_FREEZE: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) + { + Talk(SAY_CAST_DEEP_FREEZE); DoCast(target, SPELL_DEEP_FREEZE); + } events.ScheduleEvent(EVENT_DEEP_FREEZE, 35000, 0, PHASE_THREE); break; case EVENT_JUMP: diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp index 8e211cbd2cb..fa260cb298d 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp @@ -347,7 +347,7 @@ class boss_krick : public CreatureScript else tyrannusPtr = me->SummonCreature(NPC_TYRANNUS_EVENTS, outroPos[1], TEMPSUMMON_MANUAL_DESPAWN); - tyrannusPtr->SetFlying(true); + tyrannusPtr->SetCanFly(true); me->GetMotionMaster()->MovePoint(POINT_KRICK_INTRO, outroPos[0].GetPositionX(), outroPos[0].GetPositionY(), outroPos[0].GetPositionZ()); tyrannusPtr->SetFacingToObject(me); } @@ -439,6 +439,7 @@ class boss_krick : public CreatureScript _events.ScheduleEvent(EVENT_OUTRO_8, 5000); break; case EVENT_OUTRO_8: + //! HACK: Creature's can't have MOVEMENTFLAG_FLYING me->AddUnitMovementFlag(MOVEMENTFLAG_FLYING); me->GetMotionMaster()->MovePoint(0, outroPos[5]); DoCast(me, SPELL_STRANGULATING); @@ -453,8 +454,9 @@ class boss_krick : public CreatureScript _events.ScheduleEvent(EVENT_OUTRO_10, 1000); break; case EVENT_OUTRO_10: + //! HACK: Creature's can't have MOVEMENTFLAG_FLYING me->RemoveUnitMovementFlag(MOVEMENTFLAG_FLYING); - me->AddUnitMovementFlag(MOVEMENTFLAG_FALLING); + me->AddUnitMovementFlag(MOVEMENTFLAG_FALLING_FAR); me->GetMotionMaster()->MovePoint(0, outroPos[6]); _events.ScheduleEvent(EVENT_OUTRO_11, 2000); break; diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp index d6b2c2e3a97..8d015adf4a4 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp @@ -295,7 +295,7 @@ class boss_rimefang : public CreatureScript _events.SetPhase(PHASE_NONE); _currentWaypoint = 0; _hoarfrostTargetGUID = 0; - me->SetFlying(true); + me->SetCanFly(true); me->SetReactState(REACT_PASSIVE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } @@ -387,8 +387,7 @@ class player_overlord_brandAI : public PlayerAI void SetGUID(uint64 guid, int32 /*type*/) { tyrannus = ObjectAccessor::GetCreature(*me, guid); - if (!tyrannus) - me->IsAIEnabled = false; + me->IsAIEnabled = tyrannus != NULL; } void DamageDealt(Unit* /*victim*/, uint32& damage, DamageEffectType /*damageType*/) @@ -423,10 +422,9 @@ class spell_tyrannus_overlord_brand : public SpellScriptLoader return; oldAI = GetTarget()->GetAI(); + oldAIState = GetTarget()->IsAIEnabled; GetTarget()->SetAI(new player_overlord_brandAI(GetTarget()->ToPlayer())); GetTarget()->GetAI()->SetGUID(GetCasterGUID()); - oldAIState = GetTarget()->IsAIEnabled; - GetTarget()->IsAIEnabled = true; } void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp index 24529801564..1301acf4c99 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp @@ -23,6 +23,13 @@ Position const SlaveLeaderPos = {689.7158f, -104.8736f, 513.7360f, 0.0f}; // position for Jaina and Sylvanas Position const EventLeaderPos2 = {1054.368f, 107.14620f, 628.4467f, 0.0f}; +DoorData const Doors[] = +{ + {GO_ICE_WALL, DATA_GARFROST, DOOR_TYPE_PASSAGE, BOUNDARY_NONE}, + {GO_ICE_WALL, DATA_ICK, DOOR_TYPE_PASSAGE, BOUNDARY_NONE}, + {GO_HALLS_OF_REFLECTION_PORTCULLIS, DATA_TYRANNUS, DOOR_TYPE_PASSAGE, BOUNDARY_NONE}, +}; + class instance_pit_of_saron : public InstanceMapScript { public: @@ -33,6 +40,7 @@ class instance_pit_of_saron : public InstanceMapScript instance_pit_of_saron_InstanceScript(Map* map) : InstanceScript(map) { SetBossNumber(MAX_ENCOUNTER); + LoadDoorData(Doors); _garfrostGUID = 0; _krickGUID = 0; _ickGUID = 0; @@ -154,6 +162,28 @@ class instance_pit_of_saron : public InstanceMapScript } } + void OnGameObjectCreate(GameObject* go) + { + switch (go->GetEntry()) + { + case GO_ICE_WALL: + case GO_HALLS_OF_REFLECTION_PORTCULLIS: + AddDoor(go, true); + break; + } + } + + void OnGameObjectRemove(GameObject* go) + { + switch (go->GetEntry()) + { + case GO_ICE_WALL: + case GO_HALLS_OF_REFLECTION_PORTCULLIS: + AddDoor(go, false); + break; + } + } + bool SetBossState(uint32 type, EncounterState state) { if (!InstanceScript::SetBossState(type, state)) diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp index a91951ca25e..b6c821ef66a 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp @@ -25,9 +25,6 @@ enum eSpells SPELL_HELLFIRE = 69586, SPELL_TACTICAL_BLINK = 69584, SPELL_FROST_BREATH = 69527, //Iceborn Proto-Drake - SPELL_BLINDING_DIRT = 70302, //Wrathbone Laborer - SPELL_PUNCTURE_WOUND = 70278, - SPELL_SHOVELLED = 69572, SPELL_LEAPING_FACE_MAUL = 69504, // Geist Ambusher }; @@ -36,11 +33,6 @@ enum eEvents // Ymirjar Flamebearer EVENT_FIREBALL = 1, EVENT_TACTICAL_BLINK = 2, - - //Wrathbone Laborer - EVENT_BLINDING_DIRT = 3, - EVENT_PUNCTURE_WOUND = 4, - EVENT_SHOVELLED = 5, }; class mob_ymirjar_flamebearer : public CreatureScript @@ -157,73 +149,6 @@ class mob_iceborn_protodrake : public CreatureScript } }; -class mob_wrathbone_laborer : public CreatureScript -{ - public: - mob_wrathbone_laborer() : CreatureScript("mob_wrathbone_laborer") { } - - struct mob_wrathbone_laborerAI: public ScriptedAI - { - mob_wrathbone_laborerAI(Creature* creature) : ScriptedAI(creature) - { - } - - void Reset() - { - _events.Reset(); - } - - void EnterCombat(Unit* /*who*/) - { - _events.ScheduleEvent(EVENT_BLINDING_DIRT, 8000); - _events.ScheduleEvent(EVENT_PUNCTURE_WOUND, 9000); - _events.ScheduleEvent(EVENT_SHOVELLED, 5000); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - _events.Update(diff); - - if (me->HasUnitState(UNIT_STATE_CASTING)) - return; - - while (uint32 eventId = _events.ExecuteEvent()) - { - switch (eventId) - { - case EVENT_BLINDING_DIRT: - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 10.0f, true)) - DoCast(target, SPELL_BLINDING_DIRT); - _events.RescheduleEvent(EVENT_BLINDING_DIRT, 10000); - return; - case EVENT_PUNCTURE_WOUND: - DoCastVictim(SPELL_PUNCTURE_WOUND); - _events.RescheduleEvent(EVENT_PUNCTURE_WOUND, 9000); - return; - case EVENT_SHOVELLED: - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, -5.0f)) - DoCast(target, SPELL_SHOVELLED); - _events.RescheduleEvent(EVENT_SHOVELLED, 7000); - return; - } - } - - DoMeleeAttackIfReady(); - } - - private: - EventMap _events; - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_wrathbone_laborerAI(creature); - } -}; - class mob_geist_ambusher : public CreatureScript { public: @@ -240,12 +165,13 @@ class mob_geist_ambusher : public CreatureScript _leapingFaceMaulCooldown = 9000; } - void MoveInLineOfSight(Unit* who) + void EnterCombat(Unit* who) { if (who->GetTypeId() != TYPEID_PLAYER) return; - if (me->IsWithinDistInMap(who, 30.0f)) + // the max range is determined by aggro range + if (me->GetDistance(who) > 5.0f) DoCast(who, SPELL_LEAPING_FACE_MAUL); } @@ -309,7 +235,6 @@ class spell_trash_mob_glacial_strike : public SpellScriptLoader void AddSC_pit_of_saron() { new mob_ymirjar_flamebearer(); - new mob_wrathbone_laborer(); new mob_iceborn_protodrake(); new mob_geist_ambusher(); new spell_trash_mob_glacial_strike(); diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.h b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.h index 728e0ccd955..768c3ba40ec 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.h +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.h @@ -90,6 +90,8 @@ enum CreatureIds enum GameObjectIds { GO_SARONITE_ROCK = 196485, + GO_ICE_WALL = 201885, + GO_HALLS_OF_REFLECTION_PORTCULLIS = 201848, }; #endif diff --git a/src/server/scripts/Northrend/Gundrak/boss_eck.cpp b/src/server/scripts/Northrend/Gundrak/boss_eck.cpp index c665d3cdf5a..3e803c24d61 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_eck.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_eck.cpp @@ -41,9 +41,9 @@ public: struct boss_eckAI : public ScriptedAI { - boss_eckAI(Creature* c) : ScriptedAI(c) + boss_eckAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiBerserkTimer; @@ -145,14 +145,14 @@ public: struct npc_ruins_dwellerAI : public ScriptedAI { - npc_ruins_dwellerAI(Creature* c) : ScriptedAI(c) + npc_ruins_dwellerAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (instance) { diff --git a/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp b/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp index daa5ee86483..be9b09a1263 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp @@ -75,9 +75,9 @@ public: struct boss_gal_darahAI : public ScriptedAI { - boss_gal_darahAI(Creature* c) : ScriptedAI(c) + boss_gal_darahAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiStampedeTimer; diff --git a/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp b/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp index 5071802f897..b827f43dc99 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp @@ -80,9 +80,9 @@ public: struct boss_slad_ranAI : public ScriptedAI { - boss_slad_ranAI(Creature* c) : ScriptedAI(c), lSummons(me) + boss_slad_ranAI(Creature* creature) : ScriptedAI(creature), lSummons(me) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiPoisonNovaTimer; @@ -219,7 +219,7 @@ public: struct mob_slad_ran_constrictorAI : public ScriptedAI { - mob_slad_ran_constrictorAI(Creature* c) : ScriptedAI(c) {} + mob_slad_ran_constrictorAI(Creature* creature) : ScriptedAI(creature) {} uint32 uiGripOfSladRanTimer; @@ -272,7 +272,7 @@ public: struct mob_slad_ran_viperAI : public ScriptedAI { - mob_slad_ran_viperAI(Creature* c) : ScriptedAI(c) {} + mob_slad_ran_viperAI(Creature* creature) : ScriptedAI(creature) {} uint32 uiVenomousBiteTimer; diff --git a/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp b/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp index c0fc722385b..c22a0e17cd5 100644 --- a/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp +++ b/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp @@ -131,7 +131,8 @@ public: bool IsEncounterInProgress() const { for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; + if (m_auiEncounter[i] == IN_PROGRESS) + return true; return false; } @@ -519,17 +520,17 @@ class go_gundrak_altar : public GameObjectScript public: go_gundrak_altar() : GameObjectScript("go_gundrak_altar") { } - bool OnGossipHello(Player* /*player*/, GameObject* pGO) + bool OnGossipHello(Player* /*player*/, GameObject* go) { - InstanceScript* instance = pGO->GetInstanceScript(); + InstanceScript* instance = go->GetInstanceScript(); uint64 uiStatue = 0; - pGO->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); - pGO->SetGoState(GO_STATE_ACTIVE); + go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); + go->SetGoState(GO_STATE_ACTIVE); if (instance) { - switch (pGO->GetEntry()) + switch (go->GetEntry()) { case 192518: uiStatue = instance->GetData64(DATA_SLAD_RAN_STATUE); @@ -545,8 +546,8 @@ public: if (!instance->GetData64(DATA_STATUE_ACTIVATE)) { instance->SetData64(DATA_STATUE_ACTIVATE, uiStatue); - pGO->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); - pGO->SetGoState(GO_STATE_ACTIVE); + go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); + go->SetGoState(GO_STATE_ACTIVE); } return true; } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp index 70b07c61e79..d091a87dbfe 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp @@ -103,6 +103,7 @@ enum Spells SPELL_UNSTABLE = 72059, SPELL_KINETIC_BOMB_VISUAL = 72054, SPELL_KINETIC_BOMB_EXPLOSION = 72052, + SPELL_KINETIC_BOMB_KNOCKBACK = 72087, // Shock Vortex SPELL_SHOCK_VORTEX_PERIODIC = 71945, @@ -210,19 +211,19 @@ class boss_blood_council_controller : public CreatureScript if (Creature* keleseth = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_PRINCE_KELESETH_GUID))) { - instance->SendEncounterUnit(ENCOUNTER_FRAME_ADD, keleseth); + instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, keleseth); DoZoneInCombat(keleseth); } if (Creature* taldaram = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_PRINCE_TALDARAM_GUID))) { - instance->SendEncounterUnit(ENCOUNTER_FRAME_ADD, taldaram); + instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, taldaram); DoZoneInCombat(taldaram); } if (Creature* valanar = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_PRINCE_VALANAR_GUID))) { - instance->SendEncounterUnit(ENCOUNTER_FRAME_ADD, valanar); + instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, valanar); DoZoneInCombat(valanar); } @@ -412,12 +413,12 @@ class boss_prince_keleseth_icc : public CreatureScript summons.DespawnAll(); Talk(SAY_KELESETH_DEATH); - instance->SendEncounterUnit(ENCOUNTER_FRAME_REMOVE, me); + instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); } void JustReachedHome() { - instance->SendEncounterUnit(ENCOUNTER_FRAME_REMOVE, me); + instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); me->SetHealth(_spawnHealth); _isEmpowered = false; if (Creature* controller = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_BLOOD_PRINCES_CONTROL))) @@ -443,20 +444,12 @@ class boss_prince_keleseth_icc : public CreatureScript { summons.Summon(summon); Position pos; - pos.Relocate(summon); + me->GetPosition(&pos); float maxRange = me->GetDistance2d(summon); float angle = me->GetAngle(summon); - // prevent spawning outside of room - while (!me->IsWithinLOS(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ())) - { - maxRange -= 5.0f; - if (maxRange < 5.0f) - break; - - summon->MovePosition(pos, float(rand_norm() * maxRange), angle); - } - + me->MovePositionToFirstCollision(pos, maxRange, angle); summon->NearTeleportTo(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation()); + summon->ToTempSummon()->SetTempSummonType(TEMPSUMMON_CORPSE_DESPAWN); } void DamageDealt(Unit* /*target*/, uint32& damage, DamageEffectType damageType) @@ -636,12 +629,12 @@ class boss_prince_taldaram_icc : public CreatureScript summons.DespawnAll(); Talk(EMOTE_TALDARAM_DEATH); - instance->SendEncounterUnit(ENCOUNTER_FRAME_REMOVE, me); + instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); } void JustReachedHome() { - instance->SendEncounterUnit(ENCOUNTER_FRAME_REMOVE, me); + instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); me->SetHealth(_spawnHealth); _isEmpowered = false; if (Creature* controller = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_BLOOD_PRINCES_CONTROL))) @@ -859,12 +852,12 @@ class boss_prince_valanar_icc : public CreatureScript summons.DespawnAll(); Talk(SAY_VALANAR_DEATH); - instance->SendEncounterUnit(ENCOUNTER_FRAME_REMOVE, me); + instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); } void JustReachedHome() { - instance->SendEncounterUnit(ENCOUNTER_FRAME_REMOVE, me); + instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); me->SetHealth(me->GetMaxHealth()); _isEmpowered = false; if (Creature* controller = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_BLOOD_PRINCES_CONTROL))) @@ -894,6 +887,7 @@ class boss_prince_valanar_icc : public CreatureScript summon->GetPosition(x, y, z); float ground_Z = summon->GetMap()->GetHeight(summon->GetPhaseMask(), x, y, z, true, 500.0f); summon->GetMotionMaster()->MovePoint(POINT_KINETIC_BOMB_IMPACT, x, y, ground_Z); + summon->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); break; } case NPC_SHOCK_VORTEX: @@ -1058,7 +1052,7 @@ class npc_blood_queen_lana_thel : public CreatureScript void Reset() { _events.Reset(); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetDisableGravity(true); if (_instance->GetBossState(DATA_BLOOD_PRINCE_COUNCIL) == DONE) { me->SetVisible(false); @@ -1073,7 +1067,7 @@ class npc_blood_queen_lana_thel : public CreatureScript if (_introDone) return; - if (!me->IsWithinDistInMap(who, 35.0f)) + if (!me->IsWithinDistInMap(who, 35.0f, false)) return; _introDone = true; @@ -1232,12 +1226,12 @@ class npc_kinetic_bomb : public CreatureScript void Reset() { _events.Reset(); - me->SetDisplayId(DISPLAY_KINETIC_BOMB); + me->SetWalk(true); me->CastSpell(me, SPELL_UNSTABLE, true); me->CastSpell(me, SPELL_KINETIC_BOMB_VISUAL, true); me->SetReactState(REACT_PASSIVE); - me->SetSpeed(MOVE_FLIGHT, IsHeroic() ? 0.3f : 0.15f, true); me->GetPosition(_x, _y, _groundZ); + me->DespawnOrUnsummon(60000); _groundZ = me->GetMap()->GetHeight(me->GetPhaseMask(), _x, _y, _groundZ, true, 500.0f); } @@ -1247,9 +1241,9 @@ class npc_kinetic_bomb : public CreatureScript _events.ScheduleEvent(EVENT_BOMB_DESPAWN, 1000); else if (action == ACTION_KINETIC_BOMB_JUMP) { - me->GetMotionMaster()->Clear(); - me->GetMotionMaster()->MoveJump(_x, _y, me->GetPositionZ() + 7.0f, 1.0f, 7.0f); - _events.ScheduleEvent(EVENT_CONTINUE_FALLING, 700); + if (!me->HasAura(SPELL_KINETIC_BOMB_KNOCKBACK)) + me->GetMotionMaster()->MoveCharge(_x, _y, me->GetPositionZ() + 100.0f, me->GetSpeed(MOVE_RUN), 0); + _events.RescheduleEvent(EVENT_CONTINUE_FALLING, 3000); } } @@ -1263,10 +1257,10 @@ class npc_kinetic_bomb : public CreatureScript { case EVENT_BOMB_DESPAWN: me->SetVisible(false); + me->DespawnOrUnsummon(5000); break; case EVENT_CONTINUE_FALLING: - me->GetMotionMaster()->Clear(); - me->GetMotionMaster()->MovePoint(POINT_KINETIC_BOMB_IMPACT, _x, _y, _groundZ); + me->GetMotionMaster()->MoveCharge(_x, _y, _groundZ, me->GetSpeed(MOVE_WALK), POINT_KINETIC_BOMB_IMPACT); break; default: break; @@ -1329,17 +1323,16 @@ class npc_dark_nucleus : public CreatureScript void DamageTaken(Unit* attacker, uint32& /*damage*/) { - if (attacker == me) + if (attacker == me || attacker == me->getVictim()) return; - if (!_lockedTarget) - if (me->getVictim() == attacker) - _lockedTarget = true; + me->DeleteThreatList(); + me->AddThreat(attacker, 500000000.0f); } - void UpdateAI(const uint32 diff) + void UpdateAI(uint32 const diff) { - if (!me->isInCombat()) + if (!UpdateVictim()) return; if (_targetAuraCheck <= diff) @@ -1355,23 +1348,6 @@ class npc_dark_nucleus : public CreatureScript } else _targetAuraCheck -= diff; - - if (!_lockedTarget) - { - if (Unit* victim = me->SelectVictim()) - { - if (me->getVictim() && me->getVictim() != victim) - { - me->getVictim()->RemoveAurasDueToSpell(SPELL_SHADOW_RESONANCE_RESIST, me->GetGUID()); - _lockedTarget = true; - } - - _lockedTarget = true; - AttackStart(victim); - DoCast(victim, SPELL_SHADOW_RESONANCE_RESIST); - me->ClearUnitState(UNIT_STATE_CASTING); - } - } } private: @@ -1521,10 +1497,11 @@ class spell_valanar_kinetic_bomb : public SpellScriptLoader void ChangeSummonPos(SpellEffIndex /*effIndex*/) { - WorldLocation summonPos = *GetTargetDest(); + WorldLocation summonPos = *GetExplTargetDest(); Position offset = {0.0f, 0.0f, 20.0f, 0.0f}; summonPos.RelocateOffset(offset); - SetTargetDest(summonPos); + SetExplTargetDest(summonPos); + GetHitDest()->RelocateOffset(offset); } void Register() @@ -1586,7 +1563,7 @@ class spell_valanar_kinetic_bomb_knockback : public SpellScriptLoader void Register() { - AfterHit += SpellHitFn(spell_valanar_kinetic_bomb_knockback_SpellScript::KnockIntoAir); + BeforeHit += SpellHitFn(spell_valanar_kinetic_bomb_knockback_SpellScript::KnockIntoAir); } }; @@ -1663,7 +1640,7 @@ class spell_blood_council_shadow_prison_damage : public SpellScriptLoader void AddExtraDamage() { if (Aura* aur = GetHitUnit()->GetAura(GetSpellInfo()->Id)) - if (AuraEffect const* eff = aur->GetEffect(1)) + if (AuraEffect const* eff = aur->GetEffect(EFFECT_1)) SetHitDamage(GetHitDamage() + eff->GetAmount()); } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp index 79a577f6591..ee966256e2b 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp @@ -149,7 +149,7 @@ class boss_blood_queen_lana_thel : public CreatureScript events.ScheduleEvent(EVENT_SWARMING_SHADOWS, 30500, EVENT_GROUP_NORMAL); events.ScheduleEvent(EVENT_TWILIGHT_BLOODBOLT, urand(20000, 25000), EVENT_GROUP_NORMAL); events.ScheduleEvent(EVENT_AIR_PHASE, 124000 + uint32(Is25ManRaid() ? 3000 : 0)); - instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_UNCONTROLLABLE_FRENZY); + CleanAuras(); me->SetSpeed(MOVE_FLIGHT, 0.642857f, true); _offtank = NULL; _vampires.clear(); @@ -170,6 +170,7 @@ class boss_blood_queen_lana_thel : public CreatureScript DoZoneInCombat(); Talk(SAY_AGGRO); instance->SetBossState(DATA_BLOOD_QUEEN_LANA_THEL, IN_PROGRESS); + CleanAuras(); DoCast(me, SPELL_SHROUD_OF_SORROW, true); DoCast(me, SPELL_FRENZIED_BLOODTHIRST_VISUAL, true); @@ -180,15 +181,7 @@ class boss_blood_queen_lana_thel : public CreatureScript { _JustDied(); Talk(SAY_DEATH); - instance->DoRemoveAurasDueToSpellOnPlayers(ESSENCE_OF_BLOOD_QUEEN); - instance->DoRemoveAurasDueToSpellOnPlayers(ESSENCE_OF_BLOOD_QUEEN_PLR); - instance->DoRemoveAurasDueToSpellOnPlayers(FRENZIED_BLOODTHIRST); - instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_UNCONTROLLABLE_FRENZY); - instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_BLOOD_MIRROR_DAMAGE); - instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_BLOOD_MIRROR_VISUAL); - instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_BLOOD_MIRROR_DUMMY); - instance->DoRemoveAurasDueToSpellOnPlayers(DELIRIOUS_SLASH); - instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_PACT_OF_THE_DARKFALLEN); + CleanAuras(); // Blah, credit the quest if (_creditBloodQuickening) { @@ -198,8 +191,8 @@ class boss_blood_queen_lana_thel : public CreatureScript if (Creature* minchar = me->FindNearestCreature(NPC_INFILTRATOR_MINCHAR_BQ, 200.0f)) { minchar->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); - minchar->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, 0x01); - minchar->SetFlying(false); + minchar->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND); + minchar->SetCanFly(false); minchar->SendMovementFlagUpdate(); minchar->RemoveAllAuras(); minchar->GetMotionMaster()->MoveCharge(4629.3711f, 2782.6089f, 401.5301f, SPEED_CHARGE/3.0f); @@ -207,6 +200,19 @@ class boss_blood_queen_lana_thel : public CreatureScript } } + void CleanAuras() + { + instance->DoRemoveAurasDueToSpellOnPlayers(ESSENCE_OF_BLOOD_QUEEN); + instance->DoRemoveAurasDueToSpellOnPlayers(ESSENCE_OF_BLOOD_QUEEN_PLR); + instance->DoRemoveAurasDueToSpellOnPlayers(FRENZIED_BLOODTHIRST); + instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_UNCONTROLLABLE_FRENZY); + instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_BLOOD_MIRROR_DAMAGE); + instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_BLOOD_MIRROR_VISUAL); + instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_BLOOD_MIRROR_DUMMY); + instance->DoRemoveAurasDueToSpellOnPlayers(DELIRIOUS_SLASH); + instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_PACT_OF_THE_DARKFALLEN); + } + void DoAction(int32 const action) { if (action != ACTION_KILL_MINCHAR) @@ -216,9 +222,9 @@ class boss_blood_queen_lana_thel : public CreatureScript _killMinchar = true; else { - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, 0x01); - me->SetFlying(true); + me->SetDisableGravity(true); + me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND); + me->SetCanFly(true); me->SendMovementFlagUpdate(); me->GetMotionMaster()->MovePoint(POINT_MINCHAR, mincharPos); } @@ -227,12 +233,13 @@ class boss_blood_queen_lana_thel : public CreatureScript void EnterEvadeMode() { _EnterEvadeMode(); + CleanAuras(); if (_killMinchar) { _killMinchar = false; - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, 0x01); - me->SetFlying(true); + me->SetDisableGravity(true); + me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND); + me->SetCanFly(true); me->GetMotionMaster()->MovePoint(POINT_MINCHAR, mincharPos); } else @@ -244,9 +251,9 @@ class boss_blood_queen_lana_thel : public CreatureScript void JustReachedHome() { - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, 0x01); - me->SetFlying(false); + me->SetDisableGravity(false); + me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND); + me->SetCanFly(false); me->SetReactState(REACT_AGGRESSIVE); _JustReachedHome(); Talk(SAY_WIPE); @@ -295,9 +302,9 @@ class boss_blood_queen_lana_thel : public CreatureScript events.ScheduleEvent(EVENT_AIR_FLY_DOWN, 10000); break; case POINT_GROUND: - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, 0x01); - me->SetFlying(false); + me->SetDisableGravity(false); + me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND); + me->SetCanFly(false); me->SendMovementFlagUpdate(); me->SetReactState(REACT_AGGRESSIVE); if (Unit* victim = me->SelectVictim()) @@ -372,7 +379,7 @@ class boss_blood_queen_lana_thel : public CreatureScript break; } case EVENT_DELIRIOUS_SLASH: - if (_offtank && !me->HasByteFlag(UNIT_FIELD_BYTES_1, 3, 0x03)) + if (_offtank && !me->HasByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER)) DoCast(_offtank, SPELL_DELIRIOUS_SLASH); events.ScheduleEvent(EVENT_DELIRIOUS_SLASH, urand(20000, 24000), EVENT_GROUP_NORMAL); break; @@ -386,7 +393,7 @@ class boss_blood_queen_lana_thel : public CreatureScript ++targetCount; if (Is25ManRaid()) ++targetCount; - Trinity::RandomResizeList(targets, targetCount); + Trinity::Containers::RandomResizeList(targets, targetCount); if (targets.size() > 1) { Talk(SAY_PACT_OF_THE_DARKFALLEN); @@ -409,7 +416,7 @@ class boss_blood_queen_lana_thel : public CreatureScript { std::list targets; SelectRandomTarget(false, &targets); - Trinity::RandomResizeList(targets, uint32(Is25ManRaid() ? 4 : 2)); + Trinity::Containers::RandomResizeList(targets, uint32(Is25ManRaid() ? 4 : 2)); for (std::list::iterator itr = targets.begin(); itr != targets.end(); ++itr) DoCast(*itr, SPELL_TWILIGHT_BLOODBOLT); DoCast(me, SPELL_TWILIGHT_BLOODBOLT_TARGET); @@ -424,9 +431,9 @@ class boss_blood_queen_lana_thel : public CreatureScript me->GetMotionMaster()->MovePoint(POINT_CENTER, centerPos); break; case EVENT_AIR_START_FLYING: - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, 0x01); - me->SetFlying(true); + me->SetDisableGravity(true); + me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND); + me->SetCanFly(true); me->SendMovementFlagUpdate(); me->GetMotionMaster()->MovePoint(POINT_AIR, airPos); break; @@ -481,7 +488,7 @@ class boss_blood_queen_lana_thel : public CreatureScript return tempTargets.front(); } - return SelectRandomContainerElement(tempTargets); + return Trinity::Containers::SelectRandomContainerElement(tempTargets); } std::set _vampires; @@ -522,7 +529,7 @@ class spell_blood_queen_vampiric_bite : public SpellScriptLoader SpellCastResult CheckTarget() { - if (IsVampire(GetTargetUnit())) + if (IsVampire(GetExplTargetUnit())) { SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_CANT_TARGET_VAMPIRES); return SPELL_FAILED_CUSTOM_ERROR; @@ -658,7 +665,7 @@ class spell_blood_queen_bloodbolt : public SpellScriptLoader { uint32 targetCount = (targets.size() + 2) / 3; targets.remove_if (BloodboltHitCheck(static_cast(GetCaster()->GetAI()))); - Trinity::RandomResizeList(targets, targetCount); + Trinity::Containers::RandomResizeList(targets, targetCount); // mark targets now, effect hook has missile travel time delay (might cast next in that time) for (std::list::const_iterator itr = targets.begin(); itr != targets.end(); ++itr) GetCaster()->GetAI()->SetGUID((*itr)->GetGUID(), GUID_BLOODBOLT); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp index 3c795187f43..494be259baa 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp @@ -39,6 +39,7 @@ enum ScriptTexts SAY_FRENZY = 11, SAY_BERSERK = 12, SAY_DEATH = 13, + EMOTE_SCENT_OF_BLOOD = 14, // High Overlord Saurfang SAY_INTRO_HORDE_1 = 0, @@ -111,6 +112,8 @@ enum Spells SPELL_RIDE_VEHICLE = 70640, // Outro SPELL_ACHIEVEMENT = 72928, + SPELL_REMOVE_MARKS_OF_THE_FALLEN_CHAMPION = 72257, + SPELL_PERMANENT_FEIGN_DEATH = 70628, }; // Helper to get id of the aura on different modes (HasAura(baseId) wont work) @@ -143,6 +146,7 @@ enum EventTypes EVENT_BOILING_BLOOD = 20, EVENT_BLOOD_NOVA = 21, EVENT_RUNE_OF_BLOOD = 22, + EVENT_SCENT_OF_BLOOD = 52, EVENT_OUTRO_ALLIANCE_1 = 23, EVENT_OUTRO_ALLIANCE_2 = 24, @@ -254,6 +258,7 @@ class boss_deathbringer_saurfang : public CreatureScript me->SetReactState(REACT_DEFENSIVE); events.SetPhase(PHASE_COMBAT); _frenzied = false; + _dead = false; me->SetPower(POWER_ENERGY, 0); DoCast(me, SPELL_ZERO_POWER, true); DoCast(me, SPELL_BLOOD_LINK, true); @@ -266,6 +271,9 @@ class boss_deathbringer_saurfang : public CreatureScript void EnterCombat(Unit* who) { + if (_dead) + return; + if (!instance->CheckRequiredBosses(DATA_DEATHBRINGER_SAURFANG, who->ToPlayer())) { EnterEvadeMode(); @@ -291,7 +299,7 @@ class boss_deathbringer_saurfang : public CreatureScript Talk(SAY_AGGRO); events.ScheduleEvent(EVENT_SUMMON_BLOOD_BEAST, 30000, 0, PHASE_COMBAT); - events.ScheduleEvent(EVENT_BERSERK, 480000, 0, PHASE_COMBAT); + events.ScheduleEvent(EVENT_BERSERK, IsHeroic() ? 360000 : 480000, 0, PHASE_COMBAT); events.ScheduleEvent(EVENT_BOILING_BLOOD, 15500, 0, PHASE_COMBAT); events.ScheduleEvent(EVENT_BLOOD_NOVA, 17000, 0, PHASE_COMBAT); events.ScheduleEvent(EVENT_RUNE_OF_BLOOD, 20000, 0, PHASE_COMBAT); @@ -303,13 +311,6 @@ class boss_deathbringer_saurfang : public CreatureScript void JustDied(Unit* /*killer*/) { - _JustDied(); - DoCast(me, SPELL_ACHIEVEMENT, true); - Talk(SAY_DEATH); - - instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_MARK_OF_THE_FALLEN_CHAMPION); - if (Creature* creature = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_SAURFANG_EVENT_NPC))) - creature->AI()->DoAction(ACTION_START_OUTRO); } void AttackStart(Unit* victim) @@ -340,14 +341,34 @@ class boss_deathbringer_saurfang : public CreatureScript Talk(SAY_KILL); } - void DamageTaken(Unit* /*attacker*/, uint32& /*damage*/) + void DamageTaken(Unit* /*attacker*/, uint32& damage) { + if (damage >= me->GetHealth()) + damage = me->GetHealth() - 1; + if (!_frenzied && HealthBelowPct(31)) // AT 30%, not below { _frenzied = true; DoCast(me, SPELL_FRENZY); Talk(SAY_FRENZY); } + + if (!_dead && me->GetHealth() < FightWonValue) + { + _dead = true; + _JustDied(); + _EnterEvadeMode(); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE); + + DoCastAOE(SPELL_REMOVE_MARKS_OF_THE_FALLEN_CHAMPION); + DoCast(me, SPELL_ACHIEVEMENT, true); + Talk(SAY_DEATH); + + //instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_MARK_OF_THE_FALLEN_CHAMPION); + DoCast(me, SPELL_PERMANENT_FEIGN_DEATH); + if (Creature* creature = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_SAURFANG_EVENT_NPC))) + creature->AI()->DoAction(ACTION_START_OUTRO); + } } void JustSummoned(Creature* summon) @@ -355,16 +376,13 @@ class boss_deathbringer_saurfang : public CreatureScript if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true)) summon->AI()->AttackStart(target); - if (IsHeroic()) - DoCast(summon, SPELL_SCENT_OF_BLOOD); - - summon->AI()->DoCast(summon, SPELL_BLOOD_LINK_BEAST, true); - summon->AI()->DoCast(summon, SPELL_RESISTANT_SKIN, true); + summon->CastSpell(summon, SPELL_BLOOD_LINK_BEAST, true); + summon->CastSpell(summon, SPELL_RESISTANT_SKIN, true); summons.Summon(summon); DoZoneInCombat(summon); } - void SummonedCreatureDespawn(Creature* summon) + void SummonedCreatureDies(Creature* summon, Unit* /*killer*/) { summons.Despawn(summon); } @@ -444,18 +462,13 @@ class boss_deathbringer_saurfang : public CreatureScript DoCast(me, SPELL_SUMMON_BLOOD_BEAST_25_MAN+i25); Talk(SAY_BLOOD_BEASTS); events.ScheduleEvent(EVENT_SUMMON_BLOOD_BEAST, 40000, 0, PHASE_COMBAT); + if (IsHeroic()) + events.ScheduleEvent(EVENT_SCENT_OF_BLOOD, 10000, 0, PHASE_COMBAT); break; case EVENT_BLOOD_NOVA: - { - // select at range only - Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, -10.0f, true); - if (!target) - target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true); // noone? select melee - if (target) - DoCast(target, SPELL_BLOOD_NOVA_TRIGGER); + DoCastAOE(SPELL_BLOOD_NOVA_TRIGGER); events.ScheduleEvent(EVENT_BLOOD_NOVA, urand(20000, 25000), 0, PHASE_COMBAT); break; - } case EVENT_RUNE_OF_BLOOD: DoCastVictim(SPELL_RUNE_OF_BLOOD); events.ScheduleEvent(EVENT_RUNE_OF_BLOOD, urand(20000, 25000), 0, PHASE_COMBAT); @@ -468,6 +481,13 @@ class boss_deathbringer_saurfang : public CreatureScript DoCast(me, SPELL_BERSERK); Talk(SAY_BERSERK); break; + case EVENT_SCENT_OF_BLOOD: + if (!summons.empty()) + { + Talk(EMOTE_SCENT_OF_BLOOD); + DoCastAOE(SPELL_SCENT_OF_BLOOD); + } + break; default: break; } @@ -542,10 +562,13 @@ class boss_deathbringer_saurfang : public CreatureScript } } + static uint32 const FightWonValue; + private: uint32 _fallenChampionCastCount; bool _introDone; bool _frenzied; // faster than iterating all auras to find Frenzy + bool _dead; }; CreatureAI* GetAI(Creature* creature) const @@ -554,6 +577,8 @@ class boss_deathbringer_saurfang : public CreatureScript } }; +uint32 const boss_deathbringer_saurfang::boss_deathbringer_saurfangAI::FightWonValue = 100000; + class npc_high_overlord_saurfang_icc : public CreatureScript { public: @@ -605,10 +630,8 @@ class npc_high_overlord_saurfang_icc : public CreatureScript _events.ScheduleEvent(EVENT_OUTRO_HORDE_3, 18000); // say _events.ScheduleEvent(EVENT_OUTRO_HORDE_4, 24000); // cast _events.ScheduleEvent(EVENT_OUTRO_HORDE_5, 30000); // move - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - me->SendMovementFlagUpdate(); - me->Relocate(me->GetPositionX(), me->GetPositionY(), 539.2917f); - me->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), 539.2917f, 0.0f); + me->SetDisableGravity(false); + me->GetMotionMaster()->MoveFall(); for (std::list::iterator itr = _guardList.begin(); itr != _guardList.end(); ++itr) (*itr)->AI()->DoAction(ACTION_DESPAWN); break; @@ -629,7 +652,7 @@ class npc_high_overlord_saurfang_icc : public CreatureScript { if (spell->Id == SPELL_GRIP_OF_AGONY) { - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetDisableGravity(true); me->GetMotionMaster()->MovePoint(POINT_CHOKE, chokePos[0]); } } @@ -641,7 +664,7 @@ class npc_high_overlord_saurfang_icc : public CreatureScript switch (id) { case POINT_FIRST_STEP: - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); Talk(SAY_INTRO_HORDE_3); _events.ScheduleEvent(EVENT_INTRO_HORDE_5, 15500, 0, PHASE_INTRO_H); _events.ScheduleEvent(EVENT_INTRO_HORDE_6, 29500, 0, PHASE_INTRO_H); @@ -655,7 +678,7 @@ class npc_high_overlord_saurfang_icc : public CreatureScript { deathbringer->CastSpell(me, SPELL_RIDE_VEHICLE, true); // for the packet logs. deathbringer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - deathbringer->setDeathState(ALIVE); + deathbringer->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_DROWNED); } _events.ScheduleEvent(EVENT_OUTRO_HORDE_5, 1000); // move _events.ScheduleEvent(EVENT_OUTRO_HORDE_6, 4000); // say @@ -687,7 +710,7 @@ class npc_high_overlord_saurfang_icc : public CreatureScript switch (eventId) { case EVENT_INTRO_HORDE_3: - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); me->GetMotionMaster()->MovePoint(POINT_FIRST_STEP, firstStepPos.GetPositionX(), firstStepPos.GetPositionY(), firstStepPos.GetPositionZ()); break; case EVENT_INTRO_HORDE_5: @@ -718,7 +741,7 @@ class npc_high_overlord_saurfang_icc : public CreatureScript { float x, y, z; deathbringer->GetClosePoint(x, y, z, deathbringer->GetObjectSize()); - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); me->GetMotionMaster()->MovePoint(POINT_CORPSE, x, y, z); } break; @@ -812,12 +835,14 @@ class npc_muradin_bronzebeard_icc : public CreatureScript { me->RemoveAurasDueToSpell(SPELL_GRIP_OF_AGONY); Talk(SAY_OUTRO_ALLIANCE_1); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - me->SendMovementFlagUpdate(); - me->Relocate(me->GetPositionX(), me->GetPositionY(), 539.2917f); - me->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), 539.2917f, 0.0f); + me->SetDisableGravity(false); + me->GetMotionMaster()->MoveFall(); for (std::list::iterator itr = _guardList.begin(); itr != _guardList.end(); ++itr) (*itr)->AI()->DoAction(ACTION_DESPAWN); + + // temp until outro fully done - to put deathbringer on respawn timer (until next reset) + if (Creature* deathbringer = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_DEATHBRINGER_SAURFANG))) + deathbringer->DespawnOrUnsummon(5000); break; } case ACTION_INTERRUPT_INTRO: @@ -832,7 +857,7 @@ class npc_muradin_bronzebeard_icc : public CreatureScript { if (spell->Id == SPELL_GRIP_OF_AGONY) { - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetDisableGravity(true); me->GetMotionMaster()->MovePoint(POINT_CHOKE, chokePos[0]); } } @@ -841,7 +866,7 @@ class npc_muradin_bronzebeard_icc : public CreatureScript { if (type == POINT_MOTION_TYPE && id == POINT_FIRST_STEP) { - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); Talk(SAY_INTRO_ALLIANCE_4); _events.ScheduleEvent(EVENT_INTRO_ALLIANCE_5, 5000, 0, PHASE_INTRO_A); if (Creature* deathbringer = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_DEATHBRINGER_SAURFANG))) @@ -865,7 +890,7 @@ class npc_muradin_bronzebeard_icc : public CreatureScript switch (eventId) { case EVENT_INTRO_ALLIANCE_4: - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); me->GetMotionMaster()->MovePoint(POINT_FIRST_STEP, firstStepPos.GetPositionX(), firstStepPos.GetPositionY(), firstStepPos.GetPositionZ()); break; case EVENT_INTRO_ALLIANCE_5: @@ -934,7 +959,7 @@ class npc_saurfang_event : public CreatureScript { if (spell->Id == SPELL_GRIP_OF_AGONY) { - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetDisableGravity(true); me->GetMotionMaster()->MovePoint(POINT_CHOKE, chokePos[_index]); } } @@ -1175,6 +1200,9 @@ class spell_deathbringer_blood_nova_targeting : public SpellScriptLoader void FilterTargetsInitial(std::list& unitList) { + if (unitList.empty()) + return; + // select one random target, with preference of ranged targets uint32 targetsAtRange = 0; uint32 const minTargets = uint32(GetCaster()->GetMap()->GetSpawnMode() & 1 ? 10 : 4); @@ -1189,7 +1217,9 @@ class spell_deathbringer_blood_nova_targeting : public SpellScriptLoader if (targetsAtRange < minTargets) targetsAtRange = std::min(unitList.size() - 1, minTargets); - target = SelectRandomContainerElement(unitList); + std::list::const_iterator itr = unitList.begin(); + std::advance(itr, urand(0, targetsAtRange)); + target = *itr; unitList.clear(); unitList.push_back(target); } @@ -1204,10 +1234,16 @@ class spell_deathbringer_blood_nova_targeting : public SpellScriptLoader unitList.push_back(target); } + void HandleForceCast(SpellEffIndex /*effIndex*/) + { + GetCaster()->CastSpell(GetHitUnit(), uint32(GetEffectValue()), TRIGGERED_FULL_MASK); + } + void Register() { OnUnitTargetSelect += SpellUnitTargetFn(spell_deathbringer_blood_nova_targeting_SpellScript::FilterTargetsInitial, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); OnUnitTargetSelect += SpellUnitTargetFn(spell_deathbringer_blood_nova_targeting_SpellScript::FilterTargetsSubsequent, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); + OnEffectHitTarget += SpellEffectFn(spell_deathbringer_blood_nova_targeting_SpellScript::HandleForceCast, EFFECT_0, SPELL_EFFECT_FORCE_CAST); } Unit* target; @@ -1239,7 +1275,7 @@ class spell_deathbringer_boiling_blood : public SpellScriptLoader if (unitList.empty()) return; - Unit* target = SelectRandomContainerElement(unitList); + Unit* target = Trinity::Containers::SelectRandomContainerElement(unitList); unitList.clear(); unitList.push_back(target); } @@ -1256,6 +1292,33 @@ class spell_deathbringer_boiling_blood : public SpellScriptLoader } }; +class spell_deathbringer_remove_marks : public SpellScriptLoader +{ + public: + spell_deathbringer_remove_marks() : SpellScriptLoader("spell_deathbringer_remove_marks") { } + + class spell_deathbringer_remove_marks_SpellScript : public SpellScript + { + PrepareSpellScript(spell_deathbringer_remove_marks_SpellScript); + + void HandleScript(SpellEffIndex effIndex) + { + PreventHitDefaultEffect(effIndex); + GetHitUnit()->RemoveAurasDueToSpell(uint32(GetEffectValue())); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_deathbringer_remove_marks_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_deathbringer_remove_marks_SpellScript(); + } +}; + class achievement_ive_gone_and_made_a_mess : public AchievementCriteriaScript { public: @@ -1285,5 +1348,6 @@ void AddSC_boss_deathbringer_saurfang() new spell_deathbringer_blood_nova(); new spell_deathbringer_blood_nova_targeting(); new spell_deathbringer_boiling_blood(); + new spell_deathbringer_remove_marks(); new achievement_ive_gone_and_made_a_mess(); } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp index a97c6f7d138..58856f9fb44 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp @@ -328,7 +328,7 @@ class npc_stinky_icc : public CreatureScript DoMeleeAttackIfReady(); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (Creature* festergut = me->GetCreature(*me, _instance->GetData64(DATA_FESTERGUT))) if (festergut->isAlive()) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp index 6edf3fe300b..0515ba83480 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp @@ -605,7 +605,7 @@ class boss_lady_deathwhisper : public CreatureScript return; // select random cultist - Creature* cultist = SelectRandomContainerElement(temp); + Creature* cultist = Trinity::Containers::SelectRandomContainerElement(temp); DoCast(cultist, cultist->GetEntry() == NPC_CULT_FANATIC ? SPELL_DARK_TRANSFORMATION_T : SPELL_DARK_EMPOWERMENT_T, true); Talk(uint8(cultist->GetEntry() == NPC_CULT_FANATIC ? SAY_DARK_TRANSFORMATION : SAY_DARK_EMPOWERMENT)); } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp index 8623fcfde81..a0fca522f61 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp @@ -64,6 +64,9 @@ enum Spells SPELL_MALLEABLE_GOO = 70852, SPELL_UNSTABLE_EXPERIMENT = 70351, SPELL_TEAR_GAS = 71617, // phase transition + SPELL_TEAR_GAS_CREATURE = 71618, + SPELL_TEAR_GAS_CANCEL = 71620, + SPELL_TEAR_GAS_PERIODIC_TRIGGER = 73170, SPELL_CREATE_CONCOCTION = 71621, SPELL_GUZZLE_POTIONS = 71893, SPELL_OOZE_TANK_PROTECTION = 71770, // protects the tank @@ -86,6 +89,7 @@ enum Spells SPELL_GASEOUS_BLOAT_PROC = 70215, SPELL_GASEOUS_BLOAT = 70672, SPELL_GASEOUS_BLOAT_PROTECTION = 70812, + SPELL_EXPUNGED_GAS = 70701, // Volatile Ooze SPELL_OOZE_ERUPTION = 70492, @@ -167,6 +171,33 @@ enum PutricideData #define EXPERIMENT_STATE_OOZE false #define EXPERIMENT_STATE_GAS true +class AbominationDespawner +{ + public: + explicit AbominationDespawner(Unit* owner) : _owner(owner) { } + + bool operator()(uint64 guid) + { + if (Unit* summon = ObjectAccessor::GetUnit(*_owner, guid)) + { + if (summon->GetEntry() == NPC_MUTATED_ABOMINATION_10 || summon->GetEntry() == NPC_MUTATED_ABOMINATION_25) + { + if (Vehicle* veh = summon->GetVehicleKit()) + veh->RemoveAllPassengers(); // also despawns the vehicle + + return true; + } + + return false; + } + + return true; + } + + private: + Unit* _owner; +}; + class boss_professor_putricide : public CreatureScript { public: @@ -191,7 +222,7 @@ class boss_professor_putricide : public CreatureScript SetPhase(PHASE_COMBAT_1); _experimentState = EXPERIMENT_STATE_OOZE; me->SetReactState(REACT_DEFENSIVE); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == POINT_MOTION_TYPE) me->GetMotionMaster()->MovementExpired(); @@ -230,7 +261,7 @@ class boss_professor_putricide : public CreatureScript void JustReachedHome() { _JustReachedHome(); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); if (events.GetPhaseMask() & PHASE_MASK_COMBAT) instance->SetBossState(DATA_PROFESSOR_PUTRICIDE, FAIL); } @@ -477,8 +508,7 @@ class boss_professor_putricide : public CreatureScript SetPhase(PHASE_COMBAT_3); events.ScheduleEvent(EVENT_MUTATED_PLAGUE, 25000); events.CancelEvent(EVENT_UNSTABLE_EXPERIMENT); - summons.DespawnEntry(NPC_MUTATED_ABOMINATION_10); - summons.DespawnEntry(NPC_MUTATED_ABOMINATION_25); + summons.remove_if(AbominationDespawner(me)); break; default: break; @@ -514,7 +544,7 @@ class boss_professor_putricide : public CreatureScript void UpdateAI(uint32 const diff) { - if ((!UpdateVictim() && !(events.GetPhaseMask() & PHASE_MASK_NOT_SELF)) || !CheckInRoom()) + if ((!(events.GetPhaseMask() & PHASE_MASK_NOT_SELF) && !UpdateVictim()) || !CheckInRoom()) return; events.Update(diff); @@ -569,13 +599,15 @@ class boss_professor_putricide : public CreatureScript break; case EVENT_TEAR_GAS: me->GetMotionMaster()->MovePoint(POINT_TABLE, tablePos); + DoCast(me, SPELL_TEAR_GAS_PERIODIC_TRIGGER, true); break; case EVENT_RESUME_ATTACK: me->SetReactState(REACT_DEFENSIVE); AttackStart(me->getVictim()); // remove Tear Gas + me->RemoveAurasDueToSpell(SPELL_TEAR_GAS_PERIODIC_TRIGGER); instance->DoRemoveAurasDueToSpellOnPlayers(71615); - instance->DoRemoveAurasDueToSpellOnPlayers(71618); + DoCastAOE(SPELL_TEAR_GAS_CANCEL); instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_GAS_VARIABLE); instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_OOZE_VARIABLE); break; @@ -673,27 +705,36 @@ class npc_volatile_ooze : public CreatureScript public: npc_volatile_ooze() : CreatureScript("npc_volatile_ooze") { } - struct npc_volatile_oozeAI : public ScriptedAI + struct npc_putricide_oozeAI : public ScriptedAI { - npc_volatile_oozeAI(Creature* creature) : ScriptedAI(creature) + npc_putricide_oozeAI(Creature* creature) : ScriptedAI(creature) { _newTargetSelectTimer = 0; } void SpellHitTarget(Unit* /*target*/, SpellInfo const* spell) { - if (!_newTargetSelectTimer && sSpellMgr->GetSpellDifficultyId(spell->Id) == sSpellMgr->GetSpellDifficultyId(SPELL_OOZE_ERUPTION)) + if (!_newTargetSelectTimer && spell->Id == sSpellMgr->GetSpellIdForDifficulty(SPELL_OOZE_ERUPTION, me)) + _newTargetSelectTimer = 1000; + } + + void SpellHit(Unit* /*caster*/, SpellInfo const* spell) + { + if (spell->Id == SPELL_TEAR_GAS_CREATURE) _newTargetSelectTimer = 1000; } void UpdateAI(uint32 const diff) { - if (!UpdateVictim()) + if (!UpdateVictim() && !_newTargetSelectTimer) return; if (!_newTargetSelectTimer) return; + if (me->HasAura(SPELL_TEAR_GAS_CREATURE)) + return; + if (_newTargetSelectTimer <= diff) { _newTargetSelectTimer = 0; @@ -704,13 +745,68 @@ class npc_volatile_ooze : public CreatureScript } private: - // no need to use EventMap for just one event uint32 _newTargetSelectTimer; }; CreatureAI* GetAI(Creature* creature) const { - return GetIcecrownCitadelAI(creature); + return GetIcecrownCitadelAI(creature); + } +}; + +class npc_gas_cloud : public CreatureScript +{ + public: + npc_gas_cloud() : CreatureScript("npc_gas_cloud") { } + + struct npc_gas_cloudAI : public ScriptedAI + { + npc_gas_cloudAI(Creature* creature) : ScriptedAI(creature) + { + _newTargetSelectTimer = 0; + } + + void SpellHitTarget(Unit* /*target*/, SpellInfo const* spell) + { + if (!_newTargetSelectTimer && spell->Id == sSpellMgr->GetSpellIdForDifficulty(SPELL_EXPUNGED_GAS, me)) + _newTargetSelectTimer = 1000; + } + + void SpellHit(Unit* /*caster*/, SpellInfo const* spell) + { + if (spell->Id == SPELL_TEAR_GAS_CREATURE) + _newTargetSelectTimer = 1000; + } + + void UpdateAI(uint32 const diff) + { + if (!UpdateVictim() && !_newTargetSelectTimer) + return; + + DoMeleeAttackIfReady(); + + if (!_newTargetSelectTimer) + return; + + if (me->HasAura(SPELL_TEAR_GAS_CREATURE)) + return; + + if (_newTargetSelectTimer <= diff) + { + _newTargetSelectTimer = 0; + me->CastCustomSpell(SPELL_GASEOUS_BLOAT, SPELLVALUE_AURA_STACK, 10, me, false); + } + else + _newTargetSelectTimer -= diff; + } + + private: + uint32 _newTargetSelectTimer; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return GetIcecrownCitadelAI(creature); } }; @@ -729,8 +825,8 @@ class spell_putricide_gaseous_bloat : public SpellScriptLoader if (Unit* caster = GetCaster()) { target->RemoveAuraFromStack(GetSpellInfo()->Id, GetCasterGUID()); - if (!target->HasAura(GetId())&& caster->GetTypeId() == TYPEID_UNIT) - caster->ToCreature()->DespawnOrUnsummon(); + if (!target->HasAura(GetId())) + caster->CastCustomSpell(SPELL_GASEOUS_BLOAT, SPELLVALUE_AURA_STACK, 10, caster, false); } } @@ -781,7 +877,7 @@ class spell_putricide_ooze_channel : public SpellScriptLoader return; } - Unit* target = SelectRandomContainerElement(targetList); + Unit* target = Trinity::Containers::SelectRandomContainerElement(targetList); targetList.clear(); targetList.push_back(target); _target = target; @@ -797,7 +893,19 @@ class spell_putricide_ooze_channel : public SpellScriptLoader void StartAttack() { GetCaster()->ClearUnitState(UNIT_STATE_CASTING); + GetCaster()->DeleteThreatList(); GetCaster()->ToCreature()->AI()->AttackStart(GetHitUnit()); + GetCaster()->AddThreat(GetHitUnit(), 500000000.0f); // value seen in sniff + } + + // temporary, until SelectTarget are not called on empty lists + void CheckTarget() + { + if (_target) + return; + + FinishCast(SPELL_FAILED_NO_VALID_TARGETS); + GetCaster()->ToCreature()->DespawnOrUnsummon(1); // despawn next update } void Register() @@ -806,6 +914,7 @@ class spell_putricide_ooze_channel : public SpellScriptLoader OnUnitTargetSelect += SpellUnitTargetFn(spell_putricide_ooze_channel_SpellScript::SetTarget, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); OnUnitTargetSelect += SpellUnitTargetFn(spell_putricide_ooze_channel_SpellScript::SetTarget, EFFECT_2, TARGET_UNIT_SRC_AREA_ENEMY); AfterHit += SpellHitFn(spell_putricide_ooze_channel_SpellScript::StartAttack); + OnCast += SpellCastFn(spell_putricide_ooze_channel_SpellScript::CheckTarget); } Unit* _target; @@ -905,13 +1014,13 @@ class spell_putricide_unstable_experiment : public SpellScriptLoader uint32 stage = GetCaster()->ToCreature()->AI()->GetData(DATA_EXPERIMENT_STAGE); Creature* target = NULL; std::list creList; - GetCreatureListWithEntryInGrid(creList, GetCaster(), NPC_ABOMINATION_WING_MAD_SCIENTIST_STALKER, 100.0f); + GetCreatureListWithEntryInGrid(creList, GetCaster(), NPC_ABOMINATION_WING_MAD_SCIENTIST_STALKER, 200.0f); // 2 of them are spawned at green place - weird trick blizz for (std::list::iterator itr = creList.begin(); itr != creList.end(); ++itr) { target = *itr; std::list tmp; - GetCreatureListWithEntryInGrid(tmp, target, NPC_ABOMINATION_WING_MAD_SCIENTIST_STALKER, 1.0f); + GetCreatureListWithEntryInGrid(tmp, target, NPC_ABOMINATION_WING_MAD_SCIENTIST_STALKER, 10.0f); if ((!stage && tmp.size() > 1) || (stage && tmp.size() == 1)) break; } @@ -931,42 +1040,6 @@ class spell_putricide_unstable_experiment : public SpellScriptLoader } }; -class spell_putricide_ooze_summon : public SpellScriptLoader -{ - public: - spell_putricide_ooze_summon() : SpellScriptLoader("spell_putricide_ooze_summon") { } - - class spell_putricide_ooze_summon_AuraScript : public AuraScript - { - PrepareAuraScript(spell_putricide_ooze_summon_AuraScript); - - void HandleTriggerSpell(AuraEffect const* aurEff) - { - PreventDefaultAction(); - if (Unit* caster = GetCaster()) - { - uint32 triggerSpellId = GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell; - float x, y, z; - GetTarget()->GetPosition(x, y, z); - z = GetTarget()->GetMap()->GetHeight(GetTarget()->GetPhaseMask(), x, y, z, true, 25.0f); - x += 10.0f * cosf(caster->GetOrientation()); - y += 10.0f * sinf(caster->GetOrientation()); - caster->CastSpell(x, y, z, triggerSpellId, true, NULL, NULL, GetCasterGUID()); - } - } - - void Register() - { - OnEffectPeriodic += AuraEffectPeriodicFn(spell_putricide_ooze_summon_AuraScript::HandleTriggerSpell, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); - } - }; - - AuraScript* GetAuraScript() const - { - return new spell_putricide_ooze_summon_AuraScript(); - } -}; - class spell_putricide_ooze_eruption_searcher : public SpellScriptLoader { public: @@ -1207,11 +1280,11 @@ class spell_putricide_mutation_init : public SpellScriptLoader SpellCastResult CheckRequirementInternal(SpellCustomErrors& extendedError) { - InstanceScript* instance = GetTargetUnit()->GetInstanceScript(); + InstanceScript* instance = GetExplTargetUnit()->GetInstanceScript(); if (!instance) return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; - Creature* professor = ObjectAccessor::GetCreature(*GetTargetUnit(), instance->GetData64(DATA_PROFESSOR_PUTRICIDE)); + Creature* professor = ObjectAccessor::GetCreature(*GetExplTargetUnit(), instance->GetData64(DATA_PROFESSOR_PUTRICIDE)); if (!professor) return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; @@ -1232,17 +1305,17 @@ class spell_putricide_mutation_init : public SpellScriptLoader SpellCastResult CheckRequirement() { - if (!GetTargetUnit()) + if (!GetExplTargetUnit()) return SPELL_FAILED_BAD_TARGETS; - if (GetTargetUnit()->GetTypeId() != TYPEID_PLAYER) + if (GetExplTargetUnit()->GetTypeId() != TYPEID_PLAYER) return SPELL_FAILED_TARGET_NOT_PLAYER; SpellCustomErrors extension = SPELL_CUSTOM_ERROR_NONE; SpellCastResult result = CheckRequirementInternal(extension); if (result != SPELL_CAST_OK) { - Spell::SendCastResult(GetTargetUnit()->ToPlayer(), GetSpellInfo(), 0, result, extension); + Spell::SendCastResult(GetExplTargetUnit()->ToPlayer(), GetSpellInfo(), 0, result, extension); return result; } @@ -1429,14 +1502,15 @@ class spell_putricide_regurgitated_ooze : public SpellScriptLoader } }; -class spell_putricide_clear_mutated_plague : public SpellScriptLoader +// Removes aura with id stored in effect value +class spell_putricide_clear_aura_effect_value : public SpellScriptLoader { public: - spell_putricide_clear_mutated_plague() : SpellScriptLoader("spell_putricide_clear_mutated_plague") { } + spell_putricide_clear_aura_effect_value() : SpellScriptLoader("spell_putricide_clear_aura_effect_value") { } - class spell_putricide_clear_mutated_plague_SpellScript : public SpellScript + class spell_putricide_clear_aura_effect_value_SpellScript : public SpellScript { - PrepareSpellScript(spell_putricide_clear_mutated_plague_SpellScript); + PrepareSpellScript(spell_putricide_clear_aura_effect_value_SpellScript); void HandleScript(SpellEffIndex effIndex) { @@ -1447,13 +1521,13 @@ class spell_putricide_clear_mutated_plague : public SpellScriptLoader void Register() { - OnEffectHitTarget += SpellEffectFn(spell_putricide_clear_mutated_plague_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + OnEffectHitTarget += SpellEffectFn(spell_putricide_clear_aura_effect_value_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); } }; SpellScript* GetSpellScript() const { - return new spell_putricide_clear_mutated_plague_SpellScript(); + return new spell_putricide_clear_aura_effect_value_SpellScript(); } }; @@ -1492,12 +1566,12 @@ void AddSC_boss_professor_putricide() { new boss_professor_putricide(); new npc_volatile_ooze(); + new npc_gas_cloud(); new spell_putricide_gaseous_bloat(); new spell_putricide_ooze_channel(); new spell_putricide_slime_puddle(); new spell_putricide_slime_puddle_aura(); new spell_putricide_unstable_experiment(); - new spell_putricide_ooze_summon(); new spell_putricide_ooze_eruption_searcher(); new spell_putricide_choking_gas_bomb(); new spell_putricide_unbound_plague(); @@ -1508,6 +1582,6 @@ void AddSC_boss_professor_putricide() new spell_putricide_mutated_transformation(); new spell_putricide_mutated_transformation_dmg(); new spell_putricide_regurgitated_ooze(); - new spell_putricide_clear_mutated_plague(); + new spell_putricide_clear_aura_effect_value(); new spell_stinky_precious_decimate(); } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp index 9649b6c8ef8..a4ab13f6ada 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp @@ -441,6 +441,10 @@ class spell_rotface_ooze_flood : public SpellScriptLoader std::list triggers; GetHitUnit()->GetCreatureListWithEntryInGrid(triggers, GetHitUnit()->GetEntry(), 12.5f); + + if (triggers.empty()) + return; + triggers.sort(Trinity::ObjectDistanceOrderPred(GetHitUnit())); GetHitUnit()->CastSpell(triggers.back(), uint32(GetEffectValue()), false, NULL, NULL, GetOriginalCaster() ? GetOriginalCaster()->GetGUID() : 0); } @@ -494,7 +498,7 @@ class spell_rotface_mutated_infection : public SpellScriptLoader if (targets.empty()) return; - Unit* target = SelectRandomContainerElement(targets); + Unit* target = Trinity::Containers::SelectRandomContainerElement(targets); targets.clear(); targets.push_back(target); _target = target; @@ -712,13 +716,13 @@ class spell_rotface_unstable_ooze_explosion : public SpellScriptLoader void CheckTarget(SpellEffIndex effIndex) { PreventHitDefaultEffect(EFFECT_0); - if (!GetTargetDest()) + if (!GetExplTargetDest()) return; uint32 triggered_spell_id = GetSpellInfo()->Effects[effIndex].TriggerSpell; float x, y, z; - GetTargetDest()->GetPosition(x, y, z); + GetExplTargetDest()->GetPosition(x, y, z); // let Rotface handle the cast - caster dies before this executes if (InstanceScript* script = GetCaster()->GetInstanceScript()) if (Creature* rotface = script->instance->GetCreature(script->GetData64(DATA_ROTFACE))) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index 1d9c3c14897..6039ace44ab 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -61,6 +61,7 @@ enum Spells SPELL_ASPHYXIATION = 71665, SPELL_FROST_BOMB_TRIGGER = 69846, SPELL_FROST_BOMB_VISUAL = 70022, + SPELL_BIRTH_NO_VISUAL = 40031, SPELL_FROST_BOMB = 69845, SPELL_MYSTIC_BUFFET = 70128, @@ -98,6 +99,8 @@ enum Events EVENT_LAND = 12, EVENT_AIR_MOVEMENT = 21, EVENT_THIRD_PHASE_CHECK = 22, + EVENT_AIR_MOVEMENT_FAR = 23, + EVENT_LAND_GROUND = 24, // Spinestalker EVENT_BELLOWING_ROAR = 13, @@ -133,6 +136,8 @@ enum MovementPoints POINT_AIR_PHASE = 3, POINT_TAKEOFF = 4, POINT_LAND = 5, + POINT_AIR_PHASE_FAR = 6, + POINT_LAND_GROUND = 7, }; enum Shadowmourne @@ -152,6 +157,8 @@ Position const SindragosaSpawnPos = {4818.700f, 2483.710f, 287.0650f, 3.089233f Position const SindragosaFlyPos = {4475.190f, 2484.570f, 234.8510f, 3.141593f}; Position const SindragosaLandPos = {4419.190f, 2484.570f, 203.3848f, 3.141593f}; Position const SindragosaAirPos = {4475.990f, 2484.430f, 247.9340f, 3.141593f}; +Position const SindragosaAirPosFar = {4525.600f, 2485.150f, 245.0820f, 3.141593f}; +Position const SindragosaFlyInPos = {4419.190f, 2484.360f, 232.5150f, 3.141593f}; class FrostwyrmLandEvent : public BasicEvent { @@ -169,6 +176,23 @@ class FrostwyrmLandEvent : public BasicEvent Position const& _dest; }; +class FrostBombExplosion : public BasicEvent +{ + public: + FrostBombExplosion(Creature* owner, uint64 sindragosaGUID) : _owner(owner), _sindragosaGUID(sindragosaGUID) { } + + bool Execute(uint64 /*eventTime*/, uint32 /*updateTime*/) + { + _owner->CastSpell((Unit*)NULL, SPELL_FROST_BOMB, true, NULL, NULL, _sindragosaGUID); + _owner->RemoveAurasDueToSpell(SPELL_FROST_BOMB_VISUAL); + return true; + } + + private: + Creature* _owner; + uint64 _sindragosaGUID; +}; + class boss_sindragosa : public CreatureScript { public: @@ -198,8 +222,8 @@ class boss_sindragosa : public CreatureScript if (instance->GetData(DATA_SINDRAGOSA_FROSTWYRMS) != 255) { - me->SetFlying(true); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetCanFly(true); + me->SetDisableGravity(true); } } @@ -228,8 +252,8 @@ class boss_sindragosa : public CreatureScript { BossAI::JustReachedHome(); instance->SetBossState(DATA_SINDRAGOSA, FAIL); - me->SetFlying(false); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetCanFly(false); + me->SetDisableGravity(false); } void KilledUnit(Unit* victim) @@ -250,6 +274,9 @@ class boss_sindragosa : public CreatureScript return; me->setActive(true); + me->SetCanFly(true); + me->SetDisableGravity(true); + me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER); me->SetSpeed(MOVE_FLIGHT, 4.0f); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); float moveTime = me->GetExactDist(&SindragosaFlyPos) / (me->GetSpeed(MOVE_FLIGHT) * 0.001f); @@ -275,11 +302,12 @@ class boss_sindragosa : public CreatureScript { case POINT_FROSTWYRM_LAND: me->setActive(false); - me->SetFlying(false); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetCanFly(false); + me->SetDisableGravity(false); + me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER); me->SetHomePosition(SindragosaLandPos); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->SetSpeed(MOVE_FLIGHT, 2.0f); + me->SetSpeed(MOVE_FLIGHT, 2.5f); // Sindragosa enters combat as soon as she lands DoZoneInCombat(); @@ -289,19 +317,31 @@ class boss_sindragosa : public CreatureScript break; case POINT_AIR_PHASE: me->CastCustomSpell(SPELL_ICE_TOMB_TARGET, SPELLVALUE_MAX_TARGETS, RAID_MODE(2, 5, 2, 6), NULL); - events.ScheduleEvent(EVENT_FROST_BOMB, 8000); + me->SetFacingTo(float(M_PI)); + events.ScheduleEvent(EVENT_AIR_MOVEMENT_FAR, 1); + events.ScheduleEvent(EVENT_FROST_BOMB, 9000); + break; + case POINT_AIR_PHASE_FAR: + me->SetFacingTo(float(M_PI)); + events.ScheduleEvent(EVENT_LAND, 30000); break; case POINT_LAND: - me->SetFlying(false); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + events.ScheduleEvent(EVENT_LAND_GROUND, 1); + break; + case POINT_LAND_GROUND: + { + me->SetCanFly(false); + me->SetDisableGravity(false); + me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER); me->SetReactState(REACT_DEFENSIVE); if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == POINT_MOTION_TYPE) me->GetMotionMaster()->MovementExpired(); - DoStartMovement(me->getVictim()); _isInAirPhase = false; // trigger Asphyxiation - summons.DoAction(NPC_ICE_TOMB, ACTION_TRIGGER_ASPHYXIATION); + EntryCheckPredicate pred(NPC_ICE_TOMB); + summons.DoAction(ACTION_TRIGGER_ASPHYXIATION, pred); break; + } default: break; } @@ -320,6 +360,12 @@ class boss_sindragosa : public CreatureScript void JustSummoned(Creature* summon) { summons.Summon(summon); + if (summon->GetEntry() == NPC_FROST_BOMB) + { + summon->CastSpell(summon, SPELL_FROST_BOMB_VISUAL, true); + summon->CastSpell(summon, SPELL_BIRTH_NO_VISUAL, true); + summon->m_Events.AddEvent(new FrostBombExplosion(summon, me->GetGUID()), summon->m_Events.CalculateTime(5500)); + } } void SummonedCreatureDespawn(Creature* summon) @@ -332,18 +378,25 @@ class boss_sindragosa : public CreatureScript void SpellHitTarget(Unit* target, SpellInfo const* spell) { if (uint32 spellId = sSpellMgr->GetSpellIdForDifficulty(70127, me)) + { if (spellId == spell->Id) + { if (Aura const* mysticBuffet = target->GetAura(spell->Id)) _mysticBuffetStack = std::max(_mysticBuffetStack, mysticBuffet->GetStackAmount()); + return; + } + } + // Frost Infusion if (Player* player = target->ToPlayer()) { if (uint32 spellId = sSpellMgr->GetSpellIdForDifficulty(_isThirdPhase ? SPELL_FROST_BREATH_P2 : SPELL_FROST_BREATH_P1, me)) { - if (player->GetQuestStatus(QUEST_FROST_INFUSION) == QUEST_STATUS_INCOMPLETE && spellId == spell->Id) + if (spellId == spell->Id) { - if (Item* shadowsEdge = player->GetWeaponForAttack(BASE_ATTACK, true)) + Item* shadowsEdge = player->GetWeaponForAttack(BASE_ATTACK, true); + if (player->GetQuestStatus(QUEST_FROST_INFUSION) == QUEST_STATUS_INCOMPLETE && shadowsEdge) { if (!player->HasAura(SPELL_FROST_IMBUED_BLADE) && shadowsEdge->GetEntry() == ITEM_SHADOW_S_EDGE) { @@ -361,15 +414,11 @@ class boss_sindragosa : public CreatureScript player->CastSpell(player, SPELL_FROST_INFUSION, true); } } + + return; } } } - - if (spell->Id == SPELL_FROST_BOMB_TRIGGER) - { - target->CastSpell(target, SPELL_FROST_BOMB, true); - target->RemoveAurasDueToSpell(SPELL_FROST_BOMB_VISUAL); - } } void UpdateAI(uint32 const diff) @@ -410,7 +459,6 @@ class boss_sindragosa : public CreatureScript break; case EVENT_ICY_GRIP: DoCast(me, SPELL_ICY_GRIP); - events.ScheduleEvent(EVENT_ICY_GRIP, urand(70000, 75000), EVENT_GROUP_LAND_PHASE); events.ScheduleEvent(EVENT_BLISTERING_COLD, 1000, EVENT_GROUP_LAND_PHASE); break; case EVENT_BLISTERING_COLD: @@ -425,22 +473,25 @@ class boss_sindragosa : public CreatureScript { _isInAirPhase = true; Talk(SAY_AIR_PHASE); - me->SetFlying(true); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetCanFly(true); + me->SetDisableGravity(true); + me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER); me->SetReactState(REACT_PASSIVE); + me->AttackStop(); Position pos; pos.Relocate(me); pos.m_positionZ += 17.0f; me->GetMotionMaster()->MoveTakeoff(POINT_TAKEOFF, pos, 8.30078125f); - events.DelayEvents(45000, EVENT_GROUP_LAND_PHASE); + events.CancelEventGroup(EVENT_GROUP_LAND_PHASE); events.ScheduleEvent(EVENT_AIR_PHASE, 110000); - events.RescheduleEvent(EVENT_UNCHAINED_MAGIC, urand(55000, 60000), EVENT_GROUP_LAND_PHASE); - events.ScheduleEvent(EVENT_LAND, 45000); break; } case EVENT_AIR_MOVEMENT: me->GetMotionMaster()->MovePoint(POINT_AIR_PHASE, SindragosaAirPos); break; + case EVENT_AIR_MOVEMENT_FAR: + me->GetMotionMaster()->MovePoint(POINT_AIR_PHASE_FAR, SindragosaAirPosFar); + break; case EVENT_ICE_TOMB: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true, -SPELL_ICE_TOMB_UNTARGETABLE)) { @@ -452,30 +503,28 @@ class boss_sindragosa : public CreatureScript case EVENT_FROST_BOMB: { float destX, destY, destZ; - destX = float(rand_norm()) * 117.25f + 4339.25f; - if (destX > 4371.5f && destX < 4432.0f) - destY = float(rand_norm()) * 111.0f + 2429.0f; - else - destY = float(rand_norm()) * 31.23f + 2454.64f; + destX = float(rand_norm()) * 75.0f + 4350.0f; + destY = float(rand_norm()) * 75.0f + 2450.0f; destZ = 205.0f; // random number close to ground, get exact in next call me->UpdateGroundPositionZ(destX, destY, destZ); - Position pos; - pos.Relocate(destX, destY, destZ, 0.0f); - if (TempSummon* summ = me->SummonCreature(NPC_FROST_BOMB, pos, TEMPSUMMON_TIMED_DESPAWN, 40000)) - { - summ->CastSpell(summ, SPELL_FROST_BOMB_VISUAL, true); - DoCast(summ, SPELL_FROST_BOMB_TRIGGER); - //me->CastSpell(destX, destY, destZ, SPELL_FROST_BOMB_TRIGGER, false); - } - events.ScheduleEvent(EVENT_FROST_BOMB, urand(5000, 10000)); + me->CastSpell(destX, destY, destZ, SPELL_FROST_BOMB_TRIGGER, false); + events.ScheduleEvent(EVENT_FROST_BOMB, urand(6000, 8000)); break; } case EVENT_LAND: { events.CancelEvent(EVENT_FROST_BOMB); - me->GetMotionMaster()->MovePoint(POINT_LAND, SindragosaLandPos); + me->GetMotionMaster()->MovePoint(POINT_LAND, SindragosaFlyInPos); break; } + case EVENT_LAND_GROUND: + events.ScheduleEvent(EVENT_CLEAVE, urand(13000, 15000), EVENT_GROUP_LAND_PHASE); + events.ScheduleEvent(EVENT_TAIL_SMASH, urand(19000, 23000), EVENT_GROUP_LAND_PHASE); + events.ScheduleEvent(EVENT_FROST_BREATH, urand(10000, 15000), EVENT_GROUP_LAND_PHASE); + events.ScheduleEvent(EVENT_UNCHAINED_MAGIC, urand(12000, 17000), EVENT_GROUP_LAND_PHASE); + events.ScheduleEvent(EVENT_ICY_GRIP, urand(35000, 40000), EVENT_GROUP_LAND_PHASE); + me->GetMotionMaster()->MoveLand(POINT_LAND_GROUND, SindragosaLandPos, 0.0f); + break; case EVENT_THIRD_PHASE_CHECK: { if (!_isInAirPhase) @@ -617,8 +666,8 @@ class npc_spinestalker : public CreatureScript if (_instance->GetData(DATA_SPINESTALKER) != 255) { - me->SetFlying(true); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetCanFly(true); + me->SetDisableGravity(true); } } @@ -660,9 +709,11 @@ class npc_spinestalker : public CreatureScript return; me->setActive(false); - me->SetFlying(false); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetCanFly(false); + me->SetDisableGravity(false); + me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER); me->SetHomePosition(SpinestalkerLandPos); + me->SetFacingTo(SpinestalkerLandPos.GetOrientation()); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } @@ -742,8 +793,8 @@ class npc_rimefang : public CreatureScript if (_instance->GetData(DATA_RIMEFANG) != 255) { - me->SetFlying(true); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetCanFly(true); + me->SetDisableGravity(true); } } @@ -785,9 +836,11 @@ class npc_rimefang : public CreatureScript return; me->setActive(false); - me->SetFlying(false); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetCanFly(false); + me->SetDisableGravity(false); + me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER); me->SetHomePosition(RimefangLandPos); + me->SetFacingTo(RimefangLandPos.GetOrientation()); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); } @@ -819,7 +872,7 @@ class npc_rimefang : public CreatureScript _icyBlastCounter = RAID_MODE(5, 7, 6, 8); me->SetReactState(REACT_PASSIVE); me->AttackStop(); - me->SetFlying(true); + me->SetCanFly(true); me->GetMotionMaster()->MovePoint(POINT_FROSTWYRM_FLY_IN, RimefangFlyPos); float moveTime = me->GetExactDist(&RimefangFlyPos)/(me->GetSpeed(MOVE_FLIGHT)*0.001f); _events.ScheduleEvent(EVENT_ICY_BLAST, uint64(moveTime) + urand(60000, 70000)); @@ -840,7 +893,7 @@ class npc_rimefang : public CreatureScript { me->SetReactState(REACT_DEFENSIVE); AttackStart(victim); - me->SetFlying(false); + me->SetCanFly(false); } break; default: @@ -1046,10 +1099,10 @@ class spell_sindragosa_unchained_magic : public SpellScriptLoader void FilterTargets(std::list& unitList) { - unitList.remove_if (UnchainedMagicTargetSelector()); - uint32 maxSize = uint32(GetCaster()->GetMap()->GetSpawnMode() & 1 ? 5 : 2); + unitList.remove_if(UnchainedMagicTargetSelector()); + uint32 maxSize = uint32(GetCaster()->GetMap()->GetSpawnMode() & 1 ? 6 : 2); if (unitList.size() > maxSize) - Trinity::RandomResizeList(unitList, maxSize); + Trinity::Containers::RandomResizeList(unitList, maxSize); } void Register() @@ -1198,94 +1251,77 @@ class spell_sindragosa_ice_tomb : public SpellScriptLoader } }; -class FrostBombTargetSelector -{ - public: - FrostBombTargetSelector(Unit* caster, std::list const& collisionList) : _caster(caster), _collisionList(collisionList) { } - - bool operator()(Unit* unit) - { - if (unit->HasAura(SPELL_ICE_TOMB_DAMAGE)) - return true; - - for (std::list::const_iterator itr = _collisionList.begin(); itr != _collisionList.end(); ++itr) - if ((*itr)->IsInBetween(_caster, unit)) - return true; - - return false; - } - - private: - Unit* _caster; - std::list const& _collisionList; -}; - -class spell_sindragosa_collision_filter : public SpellScriptLoader +class spell_sindragosa_icy_grip : public SpellScriptLoader { public: - spell_sindragosa_collision_filter() : SpellScriptLoader("spell_sindragosa_collision_filter") { } + spell_sindragosa_icy_grip() : SpellScriptLoader("spell_sindragosa_icy_grip") { } - class spell_sindragosa_collision_filter_SpellScript : public SpellScript + class spell_sindragosa_icy_grip_SpellScript : public SpellScript { - PrepareSpellScript(spell_sindragosa_collision_filter_SpellScript); + PrepareSpellScript(spell_sindragosa_icy_grip_SpellScript); bool Validate(SpellInfo const* /*spell*/) { - if (!sSpellMgr->GetSpellInfo(SPELL_ICE_TOMB_DAMAGE)) + if (!sSpellMgr->GetSpellInfo(SPELL_ICY_GRIP_JUMP)) return false; return true; } - void FilterTargets(std::list& unitList) + void HandleScript(SpellEffIndex effIndex) { - std::list tombs; - GetCreatureListWithEntryInGrid(tombs, GetCaster(), NPC_ICE_TOMB, 200.0f); - unitList.remove_if (FrostBombTargetSelector(GetCaster(), tombs)); + PreventHitDefaultEffect(effIndex); + GetHitUnit()->CastSpell(GetCaster(), SPELL_ICY_GRIP_JUMP, true); } void Register() { - OnUnitTargetSelect += SpellUnitTargetFn(spell_sindragosa_collision_filter_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnEffectHitTarget += SpellEffectFn(spell_sindragosa_icy_grip_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); } }; SpellScript* GetSpellScript() const { - return new spell_sindragosa_collision_filter_SpellScript(); + return new spell_sindragosa_icy_grip_SpellScript(); } }; -class spell_sindragosa_icy_grip : public SpellScriptLoader +class MysticBuffetTargetFilter { public: - spell_sindragosa_icy_grip() : SpellScriptLoader("spell_sindragosa_icy_grip") { } + explicit MysticBuffetTargetFilter(Unit* caster) : _caster(caster) { } - class spell_sindragosa_icy_grip_SpellScript : public SpellScript + bool operator()(Unit* unit) { - PrepareSpellScript(spell_sindragosa_icy_grip_SpellScript); + return !unit->IsWithinLOSInMap(_caster); + } - bool Validate(SpellInfo const* /*spell*/) - { - if (!sSpellMgr->GetSpellInfo(SPELL_ICY_GRIP_JUMP)) - return false; - return true; - } + private: + Unit* _caster; +}; - void HandleScript(SpellEffIndex effIndex) +class spell_sindragosa_mystic_buffet : public SpellScriptLoader +{ + public: + spell_sindragosa_mystic_buffet() : SpellScriptLoader("spell_sindragosa_mystic_buffet") { } + + class spell_sindragosa_mystic_buffet_SpellScript : public SpellScript + { + PrepareSpellScript(spell_sindragosa_mystic_buffet_SpellScript); + + void FilterTargets(std::list& unitList) { - PreventHitDefaultEffect(effIndex); - GetHitUnit()->CastSpell(GetCaster(), SPELL_ICY_GRIP_JUMP, true); + unitList.remove_if(MysticBuffetTargetFilter(GetCaster())); } void Register() { - OnEffectHitTarget += SpellEffectFn(spell_sindragosa_icy_grip_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + OnUnitTargetSelect += SpellUnitTargetFn(spell_sindragosa_mystic_buffet_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); } }; SpellScript* GetSpellScript() const { - return new spell_sindragosa_icy_grip_SpellScript(); + return new spell_sindragosa_mystic_buffet_SpellScript(); } }; @@ -1308,7 +1344,7 @@ class spell_rimefang_icy_blast : public SpellScriptLoader void HandleTriggerMissile(SpellEffIndex effIndex) { PreventHitDefaultEffect(effIndex); - if (Position const* pos = GetTargetDest()) + if (Position const* pos = GetExplTargetDest()) if (TempSummon* summon = GetCaster()->SummonCreature(NPC_ICY_BLAST, *pos, TEMPSUMMON_TIMED_DESPAWN, 40000)) summon->CastSpell(summon, SPELL_ICY_BLAST_AREA, true); } @@ -1370,7 +1406,7 @@ class spell_frostwarden_handler_order_whelp : public SpellScriptLoader if (unitList.empty()) return; - Unit* target = SelectRandomContainerElement(unitList); + Unit* target = Trinity::Containers::SelectRandomContainerElement(unitList); unitList.clear(); unitList.push_back(target); } @@ -1387,7 +1423,7 @@ class spell_frostwarden_handler_order_whelp : public SpellScriptLoader if (unitList.empty()) return; - SelectRandomContainerElement(unitList)->CastSpell(GetHitUnit(), uint32(GetEffectValue()), true); + Trinity::Containers::SelectRandomContainerElement(unitList)->CastSpell(GetHitUnit(), uint32(GetEffectValue()), true); } void Register() @@ -1513,8 +1549,8 @@ void AddSC_boss_sindragosa() new spell_sindragosa_instability(); new spell_sindragosa_frost_beacon(); new spell_sindragosa_ice_tomb(); - new spell_sindragosa_collision_filter(); new spell_sindragosa_icy_grip(); + new spell_sindragosa_mystic_buffet(); new spell_rimefang_icy_blast(); new spell_frostwarden_handler_order_whelp(); new spell_frostwarden_handler_focus_fire(); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp index fbed870eb19..4dab215d1da 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -26,6 +26,7 @@ #include "CellImpl.h" #include "GridNotifiers.h" #include "GridNotifiersImpl.h" +#include "CreatureTextMgr.h" #include "icecrown_citadel.h" enum Texts @@ -499,8 +500,8 @@ class boss_the_lich_king : public CreatureScript { _JustDied(); DoCastAOE(SPELL_PLAY_MOVIE, false); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, 0x03); + me->SetDisableGravity(false); + me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER); me->GetMotionMaster()->MoveFall(); } @@ -553,7 +554,8 @@ class boss_the_lich_king : public CreatureScript if (Creature* tirion = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_HIGHLORD_TIRION_FORDRING))) tirion->AI()->EnterEvadeMode(); DoCastAOE(SPELL_KILL_FROSTMOURNE_PLAYERS); - summons.DoAction(NPC_STRANGULATE_VEHICLE, ACTION_TELEPORT_BACK); + EntryCheckPredicate pred(NPC_STRANGULATE_VEHICLE); + summons.DoAction(ACTION_TELEPORT_BACK, pred); } void KilledUnit(Unit* victim) @@ -584,8 +586,8 @@ class boss_the_lich_king : public CreatureScript SendLightOverride(0, 5000); break; case ACTION_BREAK_FROSTMOURNE: - DoCastAOE(SPELL_SUMMON_BROKEN_FROSTMOURNE); - DoCastAOE(SPELL_SUMMON_BROKEN_FROSTMOURNE_2); + me->CastSpell((Unit*)NULL, SPELL_SUMMON_BROKEN_FROSTMOURNE, TRIGGERED_IGNORE_CAST_IN_PROGRESS); + me->CastSpell((Unit*)NULL, SPELL_SUMMON_BROKEN_FROSTMOURNE_2, TRIGGERED_IGNORE_CAST_IN_PROGRESS); SetEquipmentSlots(false, EQUIP_BROKEN_FROSTMOURNE); events.ScheduleEvent(EVENT_OUTRO_TALK_6, 2500, 0, PHASE_OUTRO); break; @@ -594,12 +596,15 @@ class boss_the_lich_king : public CreatureScript events.ScheduleEvent(EVENT_OUTRO_TALK_8, 17000, 0, PHASE_OUTRO); break; case ACTION_TELEPORT_BACK: - summons.DoAction(NPC_STRANGULATE_VEHICLE, ACTION_TELEPORT_BACK); + { + EntryCheckPredicate pred(NPC_STRANGULATE_VEHICLE); + summons.DoAction(ACTION_TELEPORT_BACK, pred); if (!IsHeroic()) Talk(SAY_LK_FROSTMOURNE_ESCAPE); else DoCastAOE(SPELL_TRIGGER_VILE_SPIRIT_HEROIC); break; + } default: break; } @@ -660,7 +665,7 @@ class boss_the_lich_king : public CreatureScript summons.DespawnAll(); SendMusicToPlayers(MUSIC_FURY_OF_FROSTMOURNE); DoCastAOE(SPELL_FURY_OF_FROSTMOURNE); - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); events.ScheduleEvent(EVENT_OUTRO_TALK_1, 2600, 0, PHASE_OUTRO); events.ScheduleEvent(EVENT_OUTRO_EMOTE_TALK, 6600, 0, PHASE_OUTRO); events.ScheduleEvent(EVENT_OUTRO_EMOTE_TALK, 17600, 0, PHASE_OUTRO); @@ -864,7 +869,7 @@ class boss_the_lich_king : public CreatureScript case EVENT_INTRO_MOVE_1: me->SetSheath(SHEATH_STATE_MELEE); me->RemoveAurasDueToSpell(SPELL_EMOTE_SIT_NO_SHEATH); - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); me->GetMotionMaster()->MovePoint(POINT_LK_INTRO_1, LichKingIntro[0]); break; case EVENT_INTRO_MOVE_2: @@ -894,7 +899,7 @@ class boss_the_lich_king : public CreatureScript events.ScheduleEvent(EVENT_FINISH_INTRO, 1000, 0, PHASE_INTRO); break; case EVENT_FINISH_INTRO: - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); me->SetReactState(REACT_AGGRESSIVE); events.SetPhase(PHASE_ONE); @@ -1064,16 +1069,15 @@ class boss_the_lich_king : public CreatureScript Talk(SAY_LK_OUTRO_6); if (Creature* tirion = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_HIGHLORD_TIRION_FORDRING))) tirion->SetFacingToObject(me); - me->ClearUnitState(UNIT_STATE_CASTING); - DoCastAOE(SPELL_SUMMON_BROKEN_FROSTMOURNE_3); + me->CastSpell((Unit*)NULL, SPELL_SUMMON_BROKEN_FROSTMOURNE_3, TRIGGERED_IGNORE_CAST_IN_PROGRESS); SetEquipmentSlots(false, EQUIP_UNEQUIP); break; case EVENT_OUTRO_SOUL_BARRAGE: - DoCastAOE(SPELL_SOUL_BARRAGE); + me->CastSpell((Unit*)NULL, SPELL_SOUL_BARRAGE, TRIGGERED_IGNORE_CAST_IN_PROGRESS); sCreatureTextMgr->SendSound(me, SOUND_PAIN, CHAT_MSG_MONSTER_YELL, 0, TEXT_RANGE_NORMAL, TEAM_OTHER, false); // set flight - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, 0x03); + me->SetDisableGravity(true); + me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER); me->GetMotionMaster()->MovePoint(POINT_LK_OUTRO_2, OutroFlying); break; case EVENT_OUTRO_TALK_7: @@ -1222,11 +1226,11 @@ class npc_tirion_fordring_tft : public CreatureScript void sGossipSelect(Player* /*player*/, uint32 sender, uint32 action) { - if (me->GetCreatureInfo()->GossipMenuId == sender && !action) + if (me->GetCreatureTemplate()->GossipMenuId == sender && !action) { _events.SetPhase(PHASE_INTRO); me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); me->GetMotionMaster()->MovePoint(POINT_TIRION_INTRO, TirionIntro); } } @@ -1264,7 +1268,7 @@ class npc_tirion_fordring_tft : public CreatureScript me->HandleEmoteCommand(EMOTE_ONESHOT_POINT_NO_SHEATHE); break; case EVENT_INTRO_CHARGE: - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); me->GetMotionMaster()->MovePoint(POINT_TIRION_CHARGE, TirionCharge); break; case EVENT_OUTRO_TALK_1: @@ -2466,7 +2470,7 @@ class spell_the_lich_king_summon_into_air : public SpellScriptLoader void ModDestHeight(SpellEffIndex effIndex) { static Position const offset = {0.0f, 0.0f, 15.0f, 0.0f}; - WorldLocation* dest = const_cast(GetTargetDest()); + WorldLocation* dest = const_cast(GetExplTargetDest()); dest->RelocateOffset(offset); // spirit bombs get higher if (GetSpellInfo()->Effects[effIndex].MiscValue == NPC_SPIRIT_BOMB) @@ -2550,7 +2554,7 @@ class spell_the_lich_king_valkyr_target_search : public SpellScriptLoader if (unitList.empty()) return; - _target = SelectRandomContainerElement(unitList); + _target = Trinity::Containers::SelectRandomContainerElement(unitList); unitList.clear(); unitList.push_back(_target); GetCaster()->GetAI()->SetGUID(_target->GetGUID()); @@ -2723,7 +2727,7 @@ class spell_the_lich_king_vile_spirits_visual : public SpellScriptLoader void ModDestHeight(SpellEffIndex /*effIndex*/) { Position offset = {0.0f, 0.0f, 15.0f, 0.0f}; - const_cast(GetTargetDest())->RelocateOffset(offset); + const_cast(GetExplTargetDest())->RelocateOffset(offset); } void Register() @@ -2758,7 +2762,7 @@ class spell_the_lich_king_vile_spirit_move_target_search : public SpellScriptLoa if (targets.empty()) return; - _target = SelectRandomContainerElement(targets); + _target = Trinity::Containers::SelectRandomContainerElement(targets); } void HandleScript(SpellEffIndex effIndex) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp index e0993178890..c40a521c794 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp @@ -232,7 +232,7 @@ class ValithriaDespawner : public BasicEvent { case NPC_VALITHRIA_DREAMWALKER: if (InstanceScript* instance = creature->GetInstanceScript()) - instance->SendEncounterUnit(ENCOUNTER_FRAME_REMOVE, creature); + instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, creature); break; case NPC_BLAZING_SKELETON: case NPC_SUPPRESSER: @@ -262,7 +262,7 @@ class ValithriaDespawner : public BasicEvent if (CreatureData const* data = creature->GetCreatureData()) creature->SetPosition(data->posX, data->posY, data->posZ, data->orientation); - creature->ForcedDespawn(); + creature->DespawnOrUnsummon(); creature->SetCorpseDelay(corpseDelay); creature->SetRespawnDelay(respawnDelay); @@ -304,7 +304,7 @@ class boss_valithria_dreamwalker : public CreatureScript me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_HEAL_PCT, true); // Glyph of Dispel Magic - not a percent heal by effect, its cast with custom basepoints me->ApplySpellImmune(0, IMMUNITY_ID, 56131, true); - _instance->SendEncounterUnit(ENCOUNTER_FRAME_REMOVE, me); + _instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); _missedPortals = 0; _under25PercentTalkDone = false; _over75PercentTalkDone = false; @@ -322,21 +322,26 @@ class boss_valithria_dreamwalker : public CreatureScript return; DoCast(me, SPELL_COPY_DAMAGE); - _instance->SendEncounterUnit(ENCOUNTER_FRAME_ADD, me); + _instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me); _events.ScheduleEvent(EVENT_INTRO_TALK, 15000); _events.ScheduleEvent(EVENT_DREAM_PORTAL, urand(45000, 48000)); if (IsHeroic()) _events.ScheduleEvent(EVENT_BERSERK, 420000); } - void HealReceived(Unit* /*healer*/, uint32& heal) + void HealReceived(Unit* healer, uint32& heal) { + if (!me->hasLootRecipient()) + me->SetLootRecipient(healer); + + me->LowerPlayerDamageReq(heal); + // encounter complete if (me->HealthAbovePctHealed(100, heal) && !_done) { _done = true; Talk(SAY_VALITHRIA_SUCCESS); - _instance->SendEncounterUnit(ENCOUNTER_FRAME_REMOVE, me); + _instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); me->RemoveAurasDueToSpell(SPELL_CORRUPTION_VALITHRIA); DoCast(me, SPELL_ACHIEVEMENT_CHECK); DoCastAOE(SPELL_DREAMWALKERS_RAGE); @@ -371,7 +376,7 @@ class boss_valithria_dreamwalker : public CreatureScript { _justDied = true; Talk(SAY_VALITHRIA_DEATH); - _instance->SendEncounterUnit(ENCOUNTER_FRAME_REMOVE, me); + _instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); if (Creature* trigger = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_VALITHRIA_TRIGGER))) trigger->AI()->DoAction(ACTION_DEATH); } @@ -1082,7 +1087,7 @@ class npc_dream_cloud : public CreatureScript me->GetMotionMaster()->MoveIdle(); // must use originalCaster the same for all clouds to allow stacking me->CastSpell(me, EMERALD_VIGOR, false, NULL, NULL, _instance->GetData64(DATA_VALITHRIA_DREAMWALKER)); - me->ForcedDespawn(100); + me->DespawnOrUnsummon(100); break; default: break; @@ -1191,7 +1196,7 @@ class spell_dreamwalker_summoner : public SpellScriptLoader if (targets.empty()) return; - Unit* target = SelectRandomContainerElement(targets); + Unit* target = Trinity::Containers::SelectRandomContainerElement(targets); targets.clear(); targets.push_back(target); } @@ -1237,7 +1242,7 @@ class spell_dreamwalker_summon_suppresser : public SpellScriptLoader std::list summoners; GetCreatureListWithEntryInGrid(summoners, caster, NPC_WORLD_TRIGGER, 100.0f); summoners.remove_if (Trinity::UnitAuraCheck(true, SPELL_RECENTLY_SPAWNED)); - Trinity::RandomResizeList(summoners, 2); + Trinity::Containers::RandomResizeList(summoners, 2); if (summoners.empty()) return; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp index 60e85165cd5..fab9a5f0740 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp @@ -346,7 +346,7 @@ class FrostwingGauntletRespawner if (CreatureData const* data = creature->GetCreatureData()) creature->SetPosition(data->posX, data->posY, data->posZ, data->orientation); - creature->ForcedDespawn(); + creature->DespawnOrUnsummon(); creature->SetCorpseDelay(corpseDelay); creature->SetRespawnDelay(respawnDelay); @@ -796,7 +796,8 @@ class boss_sister_svalna : public CreatureScript { _JustReachedHome(); me->SetReactState(REACT_PASSIVE); - me->SetFlying(false); + me->SetDisableGravity(false); + me->SetHover(false); } void DoAction(int32 const action) @@ -838,13 +839,14 @@ class boss_sister_svalna : public CreatureScript void MovementInform(uint32 type, uint32 id) { - if (type != POINT_MOTION_TYPE || id != POINT_LAND) + if (type != EFFECT_MOTION_TYPE || id != POINT_LAND) return; _isEventInProgress = false; me->setActive(false); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); - me->SetFlying(false); + me->SetDisableGravity(false); + me->SetHover(false); } void SpellHitTarget(Unit* target, SpellInfo const* spell) @@ -1204,7 +1206,7 @@ class npc_crok_scourgebane : public CreatureScript struct npc_argent_captainAI : public ScriptedAI { public: - npc_argent_captainAI(Creature* creature) : ScriptedAI(creature), Instance(creature->GetInstanceScript()), _firstDeath(true) + npc_argent_captainAI(Creature* creature) : ScriptedAI(creature), instance(creature->GetInstanceScript()), _firstDeath(true) { FollowAngle = PET_FOLLOW_ANGLE; FollowDist = PET_FOLLOW_DIST; @@ -1232,7 +1234,7 @@ struct npc_argent_captainAI : public ScriptedAI { if (action == ACTION_START_GAUNTLET) { - if (Creature* crok = ObjectAccessor::GetCreature(*me, Instance->GetData64(DATA_CROK_SCOURGEBANE))) + if (Creature* crok = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_CROK_SCOURGEBANE))) { me->SetReactState(REACT_DEFENSIVE); FollowAngle = me->GetAngle(crok) + me->GetOrientation(); @@ -1276,7 +1278,7 @@ struct npc_argent_captainAI : public ScriptedAI if (!me->GetVehicle()) { me->GetMotionMaster()->Clear(false); - if (Creature* crok = ObjectAccessor::GetCreature(*me, Instance->GetData64(DATA_CROK_SCOURGEBANE))) + if (Creature* crok = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_CROK_SCOURGEBANE))) me->GetMotionMaster()->MoveFollow(crok, FollowDist, FollowAngle, MOTION_SLOT_IDLE); } @@ -1288,7 +1290,7 @@ struct npc_argent_captainAI : public ScriptedAI if (spell->Id == SPELL_REVIVE_CHAMPION && !IsUndead) { IsUndead = true; - me->setDeathState(JUST_ALIVED); + me->setDeathState(JUST_RESPAWNED); uint32 newEntry = 0; switch (me->GetEntry()) { @@ -1309,14 +1311,14 @@ struct npc_argent_captainAI : public ScriptedAI } Talk(SAY_CAPTAIN_RESURRECTED); - me->UpdateEntry(newEntry, Instance->GetData(DATA_TEAM_IN_INSTANCE), me->GetCreatureData()); + me->UpdateEntry(newEntry, instance->GetData(DATA_TEAM_IN_INSTANCE), me->GetCreatureData()); DoCast(me, SPELL_UNDEATH, true); } } protected: EventMap Events; - InstanceScript* Instance; + InstanceScript* instance; float FollowAngle; float FollowDist; bool IsUndead; @@ -1368,7 +1370,7 @@ class npc_captain_arnath : public CreatureScript case EVENT_ARNATH_PW_SHIELD: { std::list targets = DoFindFriendlyMissingBuff(40.0f, SPELL_POWER_WORD_SHIELD); - DoCast(SelectRandomContainerElement(targets), SPELL_POWER_WORD_SHIELD); + DoCast(Trinity::Containers::SelectRandomContainerElement(targets), SPELL_POWER_WORD_SHIELD); Events.ScheduleEvent(EVENT_ARNATH_PW_SHIELD, urand(15000, 20000)); break; } @@ -1822,7 +1824,7 @@ class spell_frost_giant_death_plague : public SpellScriptLoader unitList.remove_if (DeathPlagueTargetSelector(GetCaster())); if (!unitList.empty()) { - Unit* target = SelectRandomContainerElement(unitList); + Unit* target = Trinity::Containers::SelectRandomContainerElement(unitList); unitList.clear(); unitList.push_back(target); } @@ -1909,7 +1911,7 @@ class spell_svalna_revive_champion : public SpellScriptLoader void RemoveAliveTarget(std::list& unitList) { unitList.remove_if(AliveCheck()); - Trinity::RandomResizeList(unitList, 2); + Trinity::Containers::RandomResizeList(unitList, 2); } void Land(SpellEffIndex /*effIndex*/) @@ -1921,10 +1923,10 @@ class spell_svalna_revive_champion : public SpellScriptLoader Position pos; caster->GetPosition(&pos); caster->GetNearPosition(pos, 5.0f, 0.0f); - pos.m_positionZ = caster->GetBaseMap()->GetHeight(caster->GetPhaseMask(), pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), true, 20.0f); - pos.m_positionZ += 0.05f; + //pos.m_positionZ = caster->GetBaseMap()->GetHeight(caster->GetPhaseMask(), pos.GetPositionX(), pos.GetPositionY(), caster->GetPositionZ(), true, 50.0f); + //pos.m_positionZ += 0.05f; caster->SetHomePosition(pos); - caster->GetMotionMaster()->MovePoint(POINT_LAND, pos); + caster->GetMotionMaster()->MoveLand(POINT_LAND, pos, caster->GetSpeed(MOVE_FLIGHT)); } void Register() diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h index 085aea139a3..224777c3db7 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h @@ -331,6 +331,10 @@ enum GameObjectsIds GO_DOODAD_ICECROWN_ROOSTPORTCULLIS_02 = 201381, GO_DOODAD_ICECROWN_ROOSTPORTCULLIS_03 = 201382, GO_DOODAD_ICECROWN_ROOSTPORTCULLIS_04 = 201383, + GO_CACHE_OF_THE_DREAMWALKER_10N = 201959, + GO_CACHE_OF_THE_DREAMWALKER_25N = 202339, + GO_CACHE_OF_THE_DREAMWALKER_10H = 202338, + GO_CACHE_OF_THE_DREAMWALKER_25H = 202340, // Sindragosa GO_SINDRAGOSA_ENTRANCE_DOOR = 201373, diff --git a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp index 98f5c04ba42..cb83efc748f 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp @@ -452,6 +452,14 @@ class instance_icecrown_citadel : public InstanceMapScript case GO_DRINK_ME: PutricideTableGUID = go->GetGUID(); break; + case GO_CACHE_OF_THE_DREAMWALKER_10N: + case GO_CACHE_OF_THE_DREAMWALKER_25N: + case GO_CACHE_OF_THE_DREAMWALKER_10H: + case GO_CACHE_OF_THE_DREAMWALKER_25H: + if (Creature* valithria = instance->GetCreature(ValithriaDreamwalkerGUID)) + go->SetLootRecipient(valithria->GetLootRecipient()); + go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED | GO_FLAG_NOT_SELECTABLE | GO_FLAG_NODESPAWN); + break; case GO_ARTHAS_PLATFORM: // this enables movement at The Frozen Throne, when printed this value is 0.000000f // however, when represented as integer client will accept only this value @@ -638,7 +646,13 @@ class instance_icecrown_citadel : public InstanceMapScript switch (state) { case DONE: - DoRespawnGameObject(DeathbringersCacheGUID, 7*DAY); + if (GameObject* loot = instance->GetGameObject(DeathbringersCacheGUID)) + { + if (Creature* deathbringer = instance->GetCreature(DeathbringerSaurfangGUID)) + loot->SetLootRecipient(deathbringer->GetLootRecipient()); + loot->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED | GO_FLAG_NOT_SELECTABLE | GO_FLAG_NODESPAWN); + } + // no break case NOT_STARTED: if (GameObject* teleporter = instance->GetGameObject(SaurfangTeleportGUID)) { diff --git a/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp b/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp index 942cfd7c5a8..1671eab0b32 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp @@ -63,7 +63,7 @@ public: struct boss_anubrekhanAI : public BossAI { - boss_anubrekhanAI(Creature* c) : BossAI(c, BOSS_ANUBREKHAN) {} + boss_anubrekhanAI(Creature* creature) : BossAI(creature, BOSS_ANUBREKHAN) {} bool hasTaunted; @@ -99,7 +99,7 @@ public: DoScriptText(SAY_SLAY, me); } - void JustDied(Unit*) + void JustDied(Unit* /*killer*/) { _JustDied(); diff --git a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp index 47151ef6d80..17ed6a79c76 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp @@ -89,7 +89,7 @@ public: struct boss_four_horsemenAI : public BossAI { - boss_four_horsemenAI(Creature* c) : BossAI(c, BOSS_HORSEMEN) + boss_four_horsemenAI(Creature* creature) : BossAI(creature, BOSS_HORSEMEN) { id = Horsemen(0); for (uint8 i = 0; i < 4; ++i) @@ -113,7 +113,7 @@ public: void Reset() { if (!encounterActionReset) - DoEncounterAction(NULL, false, true, false); + DoEncounteraction(NULL, false, true, false); if (instance) instance->SetData(DATA_HORSEMEN0 + id, NOT_STARTED); @@ -131,15 +131,15 @@ public: _Reset(); } - bool DoEncounterAction(Unit* who, bool attack, bool reset, bool checkAllDead) + bool DoEncounteraction(Unit* who, bool attack, bool reset, bool checkAllDead) { if (!instance) return false; - Creature* Thane = CAST_CRE(Unit::GetUnit(*me, instance->GetData64(DATA_THANE))); - Creature* Lady = CAST_CRE(Unit::GetUnit(*me, instance->GetData64(DATA_LADY))); - Creature* Baron = CAST_CRE(Unit::GetUnit(*me, instance->GetData64(DATA_BARON))); - Creature* Sir = CAST_CRE(Unit::GetUnit(*me, instance->GetData64(DATA_SIR))); + Creature* Thane = Unit::GetCreature(*me, instance->GetData64(DATA_THANE)); + Creature* Lady = Unit::GetCreature(*me, instance->GetData64(DATA_LADY)); + Creature* Baron = Unit::GetCreature(*me, instance->GetData64(DATA_BARON)); + Creature* Sir = Unit::GetCreature(*me, instance->GetData64(DATA_SIR)); if (Thane && Lady && Baron && Sir) { @@ -194,7 +194,7 @@ public: { movementStarted = true; me->SetReactState(REACT_PASSIVE); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); me->SetSpeed(MOVE_RUN, me->GetSpeedRate(MOVE_RUN), true); switch (id) @@ -272,7 +272,7 @@ public: BeginFourHorsemenMovement(); if (!encounterActionAttack) - DoEncounterAction(who, true, false, false); + DoEncounteraction(who, true, false, false); } else if (movementCompleted && movementStarted) { @@ -302,7 +302,7 @@ public: if (instance) instance->SetData(DATA_HORSEMEN0 + id, DONE); - if (instance && DoEncounterAction(NULL, false, false, true)) + if (instance && DoEncounteraction(NULL, false, false, true)) { instance->SetBossState(BOSS_HORSEMEN, DONE); instance->SaveToDB(); diff --git a/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp b/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp index 0ef4e3d74c2..47dfaa7f772 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp @@ -57,7 +57,7 @@ public: struct boss_gluthAI : public BossAI { - boss_gluthAI(Creature* c) : BossAI(c, BOSS_GLUTH) + boss_gluthAI(Creature* creature) : BossAI(creature, BOSS_GLUTH) { // Do not let Gluth be affected by zombies' debuff me->ApplySpellImmune(0, IMMUNITY_ID, SPELL_INFECTED_WOUND, true); diff --git a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp index 8c6afba18fd..8d23de5427c 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp @@ -234,7 +234,7 @@ class boss_gothik : public CreatureScript DoScriptText(SAY_KILL, me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { LiveTriggerGUID.clear(); DeadTriggerGUID.clear(); @@ -424,7 +424,8 @@ class boss_gothik : public CreatureScript { if (instance) instance->SetData(DATA_GOTHIK_GATE, GO_STATE_ACTIVE); - summons.DoAction(0, 0); + DummyEntryCheckPredicate pred; + summons.DoAction(0, pred); //! Magic numbers fail summons.DoZoneInCombat(); mergedSides = true; } @@ -447,7 +448,8 @@ class boss_gothik : public CreatureScript DoScriptText(SAY_TELEPORT, me); DoTeleportTo(PosGroundLiveSide); me->SetReactState(REACT_AGGRESSIVE); - summons.DoAction(0, 0); + DummyEntryCheckPredicate pred; + summons.DoAction(0, pred); //! Magic numbers fail summons.DoZoneInCombat(); events.ScheduleEvent(EVENT_BOLT, 1000); events.ScheduleEvent(EVENT_HARVEST, urand(3000, 15000)); diff --git a/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp b/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp index e353a71b0b9..039b9b1e007 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp @@ -45,7 +45,7 @@ public: struct boss_grobbulusAI : public BossAI { - boss_grobbulusAI(Creature* c) : BossAI(c, BOSS_GROBBULUS) + boss_grobbulusAI(Creature* creature) : BossAI(creature, BOSS_GROBBULUS) { me->ApplySpellImmune(0, IMMUNITY_ID, SPELL_POISON_CLOUD_ADD, true); } diff --git a/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp b/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp index 7a2d3ec55ab..d84cfb8949e 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp @@ -57,7 +57,7 @@ public: struct boss_heiganAI : public BossAI { - boss_heiganAI(Creature* c) : BossAI(c, BOSS_HEIGAN) {} + boss_heiganAI(Creature* creature) : BossAI(creature, BOSS_HEIGAN) {} uint32 eruptSection; bool eruptDirection; @@ -86,7 +86,7 @@ public: return 0; } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { _JustDied(); DoScriptText(SAY_DEATH, me); diff --git a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp index 161c9160293..0a4fdec7222 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp @@ -266,7 +266,7 @@ public: struct boss_kelthuzadAI : public BossAI { - boss_kelthuzadAI(Creature* c) : BossAI(c, BOSS_KELTHUZAD), spawns(c) + boss_kelthuzadAI(Creature* creature) : BossAI(creature, BOSS_KELTHUZAD), spawns(creature) { uiFaction = me->getFaction(); } @@ -299,7 +299,7 @@ public: for (itr = chained.begin(); itr != chained.end(); ++itr) { if (Player* charmed = Unit::GetPlayer(*me, (*itr).first)) - charmed->SetFloatValue(OBJECT_FIELD_SCALE_X, (*itr).second); + charmed->SetObjectScale((*itr).second); } chained.clear(); @@ -338,7 +338,7 @@ public: DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2), me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { _JustDied(); DoScriptText(SAY_DEATH, me); @@ -347,7 +347,7 @@ public: for (itr = chained.begin(); itr != chained.end(); ++itr) { if (Player* player = Unit::GetPlayer(*me, (*itr).first)) - player->SetFloatValue(OBJECT_FIELD_SCALE_X, (*itr).second); + player->SetObjectScale((*itr).second); } chained.clear(); } @@ -457,7 +457,7 @@ public: { if (HealthBelowPct(45)) { - Phase = 3 ; + Phase = 3; DoScriptText(SAY_REQUEST_AID, me); //here Lich King should respond to KelThuzad but I don't know which Creature to make talk //so for now just make Kelthuzad says it. @@ -512,7 +512,7 @@ public: DoCast(target, SPELL_CHAINS_OF_KELTHUZAD); float scale = target->GetFloatValue(OBJECT_FIELD_SCALE_X); chained.insert(std::make_pair(target->GetGUID(), scale)); - target->SetFloatValue(OBJECT_FIELD_SCALE_X, scale * 2); + target->SetObjectScale(scale * 2); events.ScheduleEvent(EVENT_CHAINED_SPELL, 2000); //core has 2000ms to set unit flag charm } } @@ -530,7 +530,7 @@ public: { if (!player->isCharmed()) { - player->SetFloatValue(OBJECT_FIELD_SCALE_X, (*itr).second); + player->SetObjectScale((*itr).second); std::map::iterator next = itr; ++next; chained.erase(itr); @@ -667,7 +667,7 @@ public: if (!instance || instance->IsEncounterInProgress() || instance->GetBossState(BOSS_KELTHUZAD) == DONE) return false; - Creature* pKelthuzad = CAST_CRE(Unit::GetUnit(*player, instance->GetData64(DATA_KELTHUZAD))); + Creature* pKelthuzad = Unit::GetCreature(*player, instance->GetData64(DATA_KELTHUZAD)); if (!pKelthuzad) return false; @@ -714,7 +714,6 @@ public: return true; } - }; class npc_kelthuzad_abomination : public CreatureScript @@ -726,16 +725,13 @@ class npc_kelthuzad_abomination : public CreatureScript { npc_kelthuzad_abominationAI(Creature* creature) : ScriptedAI(creature) { - instance = me->GetInstanceScript(); + _instance = creature->GetInstanceScript(); } - InstanceScript* instance; - EventMap events; - void Reset() { - events.Reset(); - events.ScheduleEvent(EVENT_MORTAL_WOUND, urand(2000, 5000)); + _events.Reset(); + _events.ScheduleEvent(EVENT_MORTAL_WOUND, urand(2000, 5000)); DoCast(me, SPELL_FRENZY, true); } @@ -744,15 +740,15 @@ class npc_kelthuzad_abomination : public CreatureScript if (!UpdateVictim()) return; - events.Update(diff); + _events.Update(diff); - while (uint32 eventId = events.ExecuteEvent()) + while (uint32 eventId = _events.ExecuteEvent()) { switch (eventId) { case EVENT_MORTAL_WOUND: DoCastVictim(SPELL_MORTAL_WOUND, true); - events.ScheduleEvent(EVENT_MORTAL_WOUND, urand(10000, 15000)); + _events.ScheduleEvent(EVENT_MORTAL_WOUND, urand(10000, 15000)); break; default: break; @@ -760,11 +756,15 @@ class npc_kelthuzad_abomination : public CreatureScript } } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { - if (instance) - instance->SetData(DATA_ABOMINATION_KILLED, instance->GetData(DATA_ABOMINATION_KILLED) + 1); + if (_instance) + _instance->SetData(DATA_ABOMINATION_KILLED, _instance->GetData(DATA_ABOMINATION_KILLED) + 1); } + + private: + InstanceScript* _instance; + EventMap _events; }; CreatureAI* GetAI(Creature* creature) const @@ -776,9 +776,7 @@ class npc_kelthuzad_abomination : public CreatureScript class achievement_just_cant_get_enough : public AchievementCriteriaScript { public: - achievement_just_cant_get_enough() : AchievementCriteriaScript("achievement_just_cant_get_enough") - { - } + achievement_just_cant_get_enough() : AchievementCriteriaScript("achievement_just_cant_get_enough") { } bool OnCheck(Player* /*player*/, Unit* target) { diff --git a/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp b/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp index 0163101b8ed..3c258f08030 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp @@ -68,7 +68,7 @@ public: struct boss_maexxnaAI : public BossAI { - boss_maexxnaAI(Creature* c) : BossAI(c, BOSS_MAEXXNA) {} + boss_maexxnaAI(Creature* creature) : BossAI(creature, BOSS_MAEXXNA) {} bool enraged; @@ -159,7 +159,7 @@ public: struct mob_webwrapAI : public NullCreatureAI { - mob_webwrapAI(Creature* c) : NullCreatureAI(c), victimGUID(0) {} + mob_webwrapAI(Creature* creature) : NullCreatureAI(creature), victimGUID(0) {} uint64 victimGUID; diff --git a/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp b/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp index 7143b940916..75be596fd77 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp @@ -75,7 +75,7 @@ public: struct boss_nothAI : public BossAI { - boss_nothAI(Creature* c) : BossAI(c, BOSS_NOTH) {} + boss_nothAI(Creature* creature) : BossAI(creature, BOSS_NOTH) {} uint32 waveCount, balconyCount; @@ -124,7 +124,7 @@ public: summon->AI()->DoZoneInCombat(); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { _JustDied(); DoScriptText(SAY_DEATH, me); diff --git a/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp b/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp index a9ed499c5e5..b826a530719 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp @@ -62,7 +62,7 @@ public: struct boss_patchwerkAI : public BossAI { - boss_patchwerkAI(Creature* c) : BossAI(c, BOSS_PATCHWERK) {} + boss_patchwerkAI(Creature* creature) : BossAI(creature, BOSS_PATCHWERK) {} bool Enraged; @@ -80,7 +80,7 @@ public: DoScriptText(SAY_SLAY, me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { _JustDied(); DoScriptText(SAY_DEATH, me); diff --git a/src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp b/src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp index b27ab3730da..e06aa6b03c5 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp @@ -64,7 +64,7 @@ public: struct boss_razuviousAI : public BossAI { - boss_razuviousAI(Creature* c) : BossAI(c, BOSS_RAZUVIOUS) {} + boss_razuviousAI(Creature* creature) : BossAI(creature, BOSS_RAZUVIOUS) {} void KilledUnit(Unit* /*victim*/) { diff --git a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp index 16b1e7ac996..37fb5f3f4a9 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp @@ -81,7 +81,7 @@ public: struct boss_sapphironAI : public BossAI { - boss_sapphironAI(Creature* c) : BossAI(c, BOSS_SAPPHIRON) + boss_sapphironAI(Creature* creature) : BossAI(creature, BOSS_SAPPHIRON) , phase(PHASE_NULL) { map = me->GetMap(); @@ -145,7 +145,7 @@ public: } } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { _JustDied(); me->CastSpell(me, SPELL_DIES, true); @@ -153,7 +153,7 @@ public: CheckPlayersFrostResist(); if (CanTheHundredClub) { - AchievementEntry const* AchievTheHundredClub = GetAchievementStore()->LookupEntry(ACHIEVEMENT_THE_HUNDRED_CLUB); + AchievementEntry const* AchievTheHundredClub = sAchievementStore.LookupEntry(ACHIEVEMENT_THE_HUNDRED_CLUB); if (AchievTheHundredClub) { if (map && map->IsDungeon()) @@ -296,7 +296,7 @@ public: { case EVENT_LIFTOFF: me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetDisableGravity(true); me->SendMovementFlagUpdate(); events.ScheduleEvent(EVENT_ICEBOLT, 1500); iceboltCount = RAID_MODE(2, 3); @@ -340,7 +340,7 @@ public: return; case EVENT_LAND: me->HandleEmoteCommand(EMOTE_ONESHOT_LAND); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetDisableGravity(false); me->SendMovementFlagUpdate(); events.ScheduleEvent(EVENT_GROUND, 1500); return; diff --git a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp index e64099da3ac..ccc8e9a5663 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp @@ -120,7 +120,7 @@ public: struct boss_thaddiusAI : public BossAI { - boss_thaddiusAI(Creature* c) : BossAI(c, BOSS_THADDIUS) + boss_thaddiusAI(Creature* creature) : BossAI(creature, BOSS_THADDIUS) { // init is a bit tricky because thaddius shall track the life of both adds, but not if there was a wipe // and, in particular, if there was a crash after both adds were killed (should not respawn) @@ -158,7 +158,7 @@ public: DoScriptText(SAY_SLAY, me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { _JustDied(); DoScriptText(SAY_DEATH, me); @@ -295,9 +295,9 @@ public: struct mob_stalaggAI : public ScriptedAI { - mob_stalaggAI(Creature* c) : ScriptedAI(c) + mob_stalaggAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -381,9 +381,9 @@ public: struct mob_feugenAI : public ScriptedAI { - mob_feugenAI(Creature* c) : ScriptedAI(c) + mob_feugenAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp b/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp index c05d9a21850..50eb52cc4c2 100644 --- a/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp +++ b/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp @@ -465,7 +465,6 @@ public: playerDied = buff2; } }; - }; void AddSC_instance_naxxramas() diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp index 437d9980af3..ac5520b025a 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp @@ -240,8 +240,8 @@ public: _cannotMove = true; - me->SetFlying(true); - + me->SetCanFly(true); + if (instance) instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT); } @@ -271,7 +271,7 @@ public: { me->SetHomePosition(_homePosition); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetDisableGravity(true); BossAI::EnterEvadeMode(); @@ -354,15 +354,15 @@ public: { _EnterCombat(); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - me->SetFlying(false); + me->SetDisableGravity(false); + me->SetCanFly(false); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); Talk(SAY_AGGRO_P_ONE); DoCast(SPELL_BERSEKER); // periodic aura, first tick in 10 minutes - + if (instance) instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT); } @@ -412,8 +412,8 @@ public: void PrepareForVortex() { - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - me->SetFlying(true); + me->SetDisableGravity(true); + me->SetCanFly(true); me->GetMotionMaster()->MovementExpired(); me->GetMotionMaster()->MovePoint(MOVE_VORTEX, MalygosPositions[1].GetPositionX(), MalygosPositions[1].GetPositionY(), MalygosPositions[1].GetPositionZ()); @@ -461,8 +461,8 @@ public: { SetPhase(PHASE_TWO, true); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - me->SetFlying(true); + me->SetDisableGravity(true); + me->SetCanFly(true); me->GetMotionMaster()->MoveIdle(); me->GetMotionMaster()->MovePoint(MOVE_DEEP_BREATH_ROTATION, MalygosPhaseTwoWaypoints[0]); @@ -704,8 +704,8 @@ class spell_malygos_vortex_visual : public SpellScriptLoader // Anyway even with this issue, the boss does not enter in evade mode - this prevents iterate an empty list in the next vortex execution. malygos->SetInCombatWithZone(); - malygos->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - malygos->SetFlying(false); + malygos->SetDisableGravity(false); + malygos->SetCanFly(false); malygos->GetMotionMaster()->MoveChase(caster->getVictim()); malygos->RemoveAura(SPELL_VORTEX_1); @@ -963,8 +963,9 @@ public: // we dont do melee damage! } - void WaypointReached(uint32 /*i*/) + void WaypointReached(uint32 /*waypointId*/) { + } private: diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_anomalus.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_anomalus.cpp index 5e87ffb8973..7552ba4f389 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/boss_anomalus.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_anomalus.cpp @@ -101,7 +101,7 @@ class boss_anomalus : public CreatureScript instance->SetData(DATA_ANOMALUS_EVENT, IN_PROGRESS); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp index 44c6c25fa3e..5c1dee1d4e4 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp @@ -61,9 +61,9 @@ public: struct boss_keristraszaAI : public ScriptedAI { - boss_keristraszaAI(Creature* c) : ScriptedAI(c) + boss_keristraszaAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -208,16 +208,16 @@ class containment_sphere : public GameObjectScript public: containment_sphere() : GameObjectScript("containment_sphere") { } - bool OnGossipHello(Player* /*player*/, GameObject* pGO) + bool OnGossipHello(Player* /*player*/, GameObject* go) { - InstanceScript* instance = pGO->GetInstanceScript(); + InstanceScript* instance = go->GetInstanceScript(); - Creature* pKeristrasza = Unit::GetCreature(*pGO, instance ? instance->GetData64(DATA_KERISTRASZA) : 0); + Creature* pKeristrasza = Unit::GetCreature(*go, instance ? instance->GetData64(DATA_KERISTRASZA) : 0); if (pKeristrasza && pKeristrasza->isAlive()) { // maybe these are hacks :( - pGO->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); - pGO->SetGoState(GO_STATE_ACTIVE); + go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); + go->SetGoState(GO_STATE_ACTIVE); CAST_AI(boss_keristrasza::boss_keristraszaAI, pKeristrasza->AI())->CheckContainmentSpheres(true); } diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp index 03f467ce180..ad188738c12 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp @@ -67,9 +67,9 @@ public: struct boss_magus_telestraAI : public ScriptedAI { - boss_magus_telestraAI(Creature* c) : ScriptedAI(c) + boss_magus_telestraAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp index 4453ec94494..c70db7d4ebc 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp @@ -61,9 +61,9 @@ public: struct boss_ormorokAI : public ScriptedAI { - boss_ormorokAI(Creature* c) : ScriptedAI(c) + boss_ormorokAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -195,7 +195,7 @@ public: std::list::const_iterator i = me->getThreatManager().getThreatList().begin(); for (; i != me->getThreatManager().getThreatList().end(); ++i) { - Unit* temp = Unit::GetUnit((*me), (*i)->getUnitGuid()); + Unit* temp = Unit::GetUnit(*me, (*i)->getUnitGuid()); if (temp && temp->GetTypeId() == TYPEID_PLAYER && temp->getClass() == Healer) { target = temp; @@ -234,7 +234,7 @@ public: struct mob_crystal_spikeAI : public Scripted_NoMovementAI { - mob_crystal_spikeAI(Creature* c) : Scripted_NoMovementAI(c) + mob_crystal_spikeAI(Creature* creature) : Scripted_NoMovementAI(creature) { } @@ -277,7 +277,7 @@ public: struct mob_crystalline_tanglerAI : public ScriptedAI { - mob_crystalline_tanglerAI(Creature* c) : ScriptedAI(c) {} + mob_crystalline_tanglerAI(Creature* creature) : ScriptedAI(creature) {} uint32 uiRootsTimer; diff --git a/src/server/scripts/Northrend/Nexus/Nexus/commander_kolurg.cpp b/src/server/scripts/Northrend/Nexus/Nexus/commander_kolurg.cpp index 6d07ac960b5..5ea3eb32c1d 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/commander_kolurg.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/commander_kolurg.cpp @@ -49,7 +49,7 @@ public: struct boss_commander_kolurgAI : public ScriptedAI { - boss_commander_kolurgAI(Creature* c) : ScriptedAI(c) {} + boss_commander_kolurgAI(Creature* creature) : ScriptedAI(creature) {} void Reset() {} void EnterCombat(Unit* /*who*/) {} diff --git a/src/server/scripts/Northrend/Nexus/Nexus/commander_stoutbeard.cpp b/src/server/scripts/Northrend/Nexus/Nexus/commander_stoutbeard.cpp index 71a153c802a..da4b49740c1 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/commander_stoutbeard.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/commander_stoutbeard.cpp @@ -49,7 +49,7 @@ public: struct boss_commander_stoutbeardAI : public ScriptedAI { - boss_commander_stoutbeardAI(Creature* c) : ScriptedAI(c) {} + boss_commander_stoutbeardAI(Creature* creature) : ScriptedAI(creature) {} void Reset() {} void EnterCombat(Unit* /*who*/) diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp index 9671d59bcec..b96d7c4aa84 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp @@ -203,7 +203,7 @@ public: if (!instance || instance->GetData(DATA_UROM_PLATAFORM) > 2) return; - for (uint8 i = 0; i < 4 ; i++) + for (uint8 i = 0; i < 4; i++) { SetPosition(i); me->SummonCreature(Group[group[instance->GetData(DATA_UROM_PLATAFORM)]].entry[i], x, y, me->GetPositionZ(), me->GetOrientation()); @@ -316,7 +316,9 @@ public: LeaveCombat(); break; case SPELL_TELEPORT: - me->AddUnitMovementFlag(MOVEMENTFLAG_CAN_FLY); // with out it the npc will fall down while is casting + //! Unconfirmed, previous below + me->SetDisableGravity(true); + //me->AddUnitMovementFlag(MOVEMENTFLAG_CAN_FLY); // with out it the npc will fall down while is casting canCast = true; break; default: diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp index 8852338c362..19a84fdae84 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp @@ -169,7 +169,9 @@ class npc_azure_ring_captain : public CreatureScript { targetGUID = 0; - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING | MOVEMENTFLAG_FLYING); + me->SetWalk(true); + //! HACK: Creature's can't have MOVEMENTFLAG_FLYING + me->AddUnitMovementFlag(MOVEMENTFLAG_FLYING); me->SetReactState(REACT_AGGRESSIVE); } @@ -214,7 +216,7 @@ class npc_azure_ring_captain : public CreatureScript if (Unit* victim = varos->AI()->SelectTarget(SELECT_TARGET_RANDOM, 0)) { me->SetReactState(REACT_PASSIVE); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); me->GetMotionMaster()->MovePoint(ACTION_CALL_DRAGON_EVENT, victim->GetPositionX(), victim->GetPositionY(), victim->GetPositionZ() + 20.0f); targetGUID = victim->GetGUID(); } @@ -306,7 +308,7 @@ class spell_varos_energize_core_area_enemy : public SpellScriptLoader float orientation = CAST_AI(boss_varos::boss_varosAI, varos->AI())->GetCoreEnergizeOrientation(); - for (std::list::iterator itr = targetList.begin() ; itr != targetList.end();) + for (std::list::iterator itr = targetList.begin(); itr != targetList.end();) { Position pos; (*itr)->GetPosition(&pos); @@ -353,7 +355,7 @@ class spell_varos_energize_core_area_entry : public SpellScriptLoader float orientation = CAST_AI(boss_varos::boss_varosAI, varos->AI())->GetCoreEnergizeOrientation(); - for (std::list::iterator itr = targetList.begin() ; itr != targetList.end();) + for (std::list::iterator itr = targetList.begin(); itr != targetList.end();) { Position pos; (*itr)->GetPosition(&pos); diff --git a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp index 11433bfde37..23f55a3033b 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp @@ -61,13 +61,13 @@ class npc_oculus_drake : public CreatureScript public: npc_oculus_drake() : CreatureScript("npc_oculus_drake") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); switch (creature->GetEntry()) { case NPC_VERDISA: //Verdisa - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: if (!HAS_ESSENCE(player)) @@ -97,7 +97,7 @@ public: } break; case NPC_BELGARISTRASZ: //Belgaristrasz - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: if (!HAS_ESSENCE(player)) @@ -127,7 +127,7 @@ public: } break; case NPC_ETERNOS: //Eternos - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: if (!HAS_ESSENCE(player)) diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp index c6f72890d1f..9f39cecbb23 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp @@ -29,17 +29,15 @@ EndScriptData */ enum eEnums { //Yell - SAY_AGGRO = -1602000, - SAY_SLAY_1 = -1602001, - SAY_SLAY_2 = -1602002, - SAY_SLAY_3 = -1602003, - SAY_DEATH = -1602004, - SAY_BATTLE_STANCE = -1602005, - EMOTE_BATTLE_STANCE = -1602006, - SAY_BERSEKER_STANCE = -1602007, - EMOTE_BERSEKER_STANCE = -1602008, - SAY_DEFENSIVE_STANCE = -1602009, - EMOTE_DEFENSIVE_STANCE = -1602010, + SAY_AGGRO = 0, + SAY_DEFENSIVE_STANCE = 1, + SAY_BATTLE_STANCE = 2, + SAY_BERSEKER_STANCE = 3, + SAY_SLAY = 4, + SAY_DEATH = 5, + EMOTE_DEFENSIVE_STANCE = 6, + EMOTE_BATTLE_STANCE = 7, + EMOTE_BERSEKER_STANCE = 8, SPELL_DEFENSIVE_STANCE = 53790, //SPELL_DEFENSIVE_AURA = 41105, @@ -95,13 +93,13 @@ public: { boss_bjarngrimAI(Creature* creature) : ScriptedAI(creature) { - m_instance = creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); m_uiStance = STANCE_DEFENSIVE; memset(&m_auiStormforgedLieutenantGUID, 0, sizeof(m_auiStormforgedLieutenantGUID)); canBuff = true; } - InstanceScript* m_instance; + InstanceScript* instance; bool m_bIsChangingStance; bool canBuff; @@ -169,8 +167,8 @@ public: SetEquipmentSlots(false, EQUIP_SWORD, EQUIP_SHIELD, EQUIP_NO_CHANGE); - if (m_instance) - m_instance->SetData(TYPE_BJARNGRIM, NOT_STARTED); + if (instance) + instance->SetData(TYPE_BJARNGRIM, NOT_STARTED); } void EnterEvadeMode() @@ -185,26 +183,26 @@ public: void EnterCombat(Unit* /*who*/) { - DoScriptText(SAY_AGGRO, me); + Talk(SAY_AGGRO); //must get both lieutenants here and make sure they are with him me->CallForHelp(30.0f); - if (m_instance) - m_instance->SetData(TYPE_BJARNGRIM, IN_PROGRESS); + if (instance) + instance->SetData(TYPE_BJARNGRIM, IN_PROGRESS); } void KilledUnit(Unit* /*victim*/) { - DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2, SAY_SLAY_3), me); + Talk(SAY_SLAY); } void JustDied(Unit* /*killer*/) { - DoScriptText(SAY_DEATH, me); + Talk(SAY_DEATH); - if (m_instance) - m_instance->SetData(TYPE_BJARNGRIM, DONE); + if (instance) + instance->SetData(TYPE_BJARNGRIM, DONE); } //TODO: remove when removal is done by the core @@ -249,20 +247,20 @@ public: switch (m_uiStance) { case STANCE_DEFENSIVE: - DoScriptText(SAY_DEFENSIVE_STANCE, me); - DoScriptText(EMOTE_DEFENSIVE_STANCE, me); + Talk(SAY_DEFENSIVE_STANCE); + Talk(EMOTE_DEFENSIVE_STANCE); DoCast(me, SPELL_DEFENSIVE_STANCE); SetEquipmentSlots(false, EQUIP_SWORD, EQUIP_SHIELD, EQUIP_NO_CHANGE); break; case STANCE_BERSERKER: - DoScriptText(SAY_BERSEKER_STANCE, me); - DoScriptText(EMOTE_BERSEKER_STANCE, me); + Talk(SAY_BERSEKER_STANCE); + Talk(EMOTE_BERSEKER_STANCE); DoCast(me, SPELL_BERSEKER_STANCE); SetEquipmentSlots(false, EQUIP_SWORD, EQUIP_SWORD, EQUIP_NO_CHANGE); break; case STANCE_BATTLE: - DoScriptText(SAY_BATTLE_STANCE, me); - DoScriptText(EMOTE_BATTLE_STANCE, me); + Talk(SAY_BATTLE_STANCE); + Talk(EMOTE_BATTLE_STANCE); DoCast(me, SPELL_BATTLE_STANCE); SetEquipmentSlots(false, EQUIP_MACE, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); break; @@ -387,10 +385,10 @@ public: { mob_stormforged_lieutenantAI(Creature* creature) : ScriptedAI(creature) { - m_instance = creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; uint32 m_uiArcWeld_Timer; uint32 m_uiRenewSteel_Timer; @@ -403,9 +401,9 @@ public: void EnterCombat(Unit* who) { - if (m_instance) + if (instance) { - if (Creature* pBjarngrim = m_instance->instance->GetCreature(m_instance->GetData64(DATA_BJARNGRIM))) + if (Creature* pBjarngrim = instance->instance->GetCreature(instance->GetData64(DATA_BJARNGRIM))) { if (pBjarngrim->isAlive() && !pBjarngrim->getVictim()) pBjarngrim->AI()->AttackStart(who); @@ -429,9 +427,9 @@ public: if (m_uiRenewSteel_Timer <= uiDiff) { - if (m_instance) + if (instance) { - if (Creature* pBjarngrim = m_instance->instance->GetCreature(m_instance->GetData64(DATA_BJARNGRIM))) + if (Creature* pBjarngrim = instance->instance->GetCreature(instance->GetData64(DATA_BJARNGRIM))) { if (pBjarngrim->isAlive()) DoCast(pBjarngrim, SPELL_RENEW_STEEL_N); diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp index 016c4d27cfa..abdf5ecb1e1 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp @@ -41,13 +41,10 @@ enum Spells enum Yells { - SAY_AGGRO = -1602011, - SAY_SLAY_1 = -1602012, - SAY_SLAY_2 = -1602013, - SAY_SLAY_3 = -1602014, - SAY_DEATH = -1602015, - SAY_SPLIT_1 = -1602016, - SAY_SPLIT_2 = -1602017 + SAY_AGGRO = 0, + SAY_SPLIT = 1, + SAY_SLAY = 2, + SAY_DEATH = 3 }; enum Creatures @@ -122,7 +119,7 @@ public: void EnterCombat(Unit* /*who*/) { - DoScriptText(SAY_AGGRO, me); + Talk(SAY_AGGRO); if (instance) instance->SetData(TYPE_IONAR, IN_PROGRESS); @@ -130,7 +127,7 @@ public: void JustDied(Unit* /*killer*/) { - DoScriptText(SAY_DEATH, me); + Talk(SAY_DEATH); lSparkList.DespawnAll(); @@ -140,7 +137,7 @@ public: void KilledUnit(Unit* /*victim*/) { - DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2, SAY_SLAY_3), me); + Talk(SAY_SLAY); } void SpellHit(Unit* /*caster*/, const SpellInfo* spell) @@ -278,7 +275,7 @@ public: { bHasDispersed = true; - DoScriptText(RAND(SAY_SPLIT_1, SAY_SPLIT_2), me); + Talk(SAY_SPLIT); if (me->IsNonMeleeSpellCasted(false)) me->InterruptNonMeleeSpells(false); diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp index 171215c605a..2e2744baa3c 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp @@ -30,20 +30,16 @@ enum eEnums { ACHIEV_TIMELY_DEATH_START_EVENT = 20384, - SAY_AGGRO = -1602018, - SAY_INTRO_1 = -1602019, - SAY_INTRO_2 = -1602020, - SAY_SLAY_1 = -1602021, - SAY_SLAY_2 = -1602022, - SAY_SLAY_3 = -1602023, - SAY_DEATH = -1602024, - SAY_NOVA_1 = -1602025, - SAY_NOVA_2 = -1602026, - SAY_NOVA_3 = -1602027, - SAY_75HEALTH = -1602028, - SAY_50HEALTH = -1602029, - SAY_25HEALTH = -1602030, - EMOTE_NOVA = -1602031, + SAY_INTRO_1 = 0, + SAY_INTRO_2 = 1, + SAY_AGGRO = 2, + SAY_NOVA = 3, + SAY_SLAY = 4, + SAY_75HEALTH = 5, + SAY_50HEALTH = 6, + SAY_25HEALTH = 7, + SAY_DEATH = 8, + EMOTE_NOVA = 9, SPELL_ARC_LIGHTNING = 52921, SPELL_LIGHTNING_NOVA_N = 52960, @@ -72,10 +68,10 @@ public: { boss_lokenAI(Creature* creature) : ScriptedAI(creature) { - m_instance = creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; bool m_bIsAura; @@ -97,35 +93,35 @@ public: m_uiHealthAmountModifier = 1; - if (m_instance) + if (instance) { - m_instance->SetData(TYPE_LOKEN, NOT_STARTED); - m_instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMELY_DEATH_START_EVENT); + instance->SetData(TYPE_LOKEN, NOT_STARTED); + instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMELY_DEATH_START_EVENT); } } void EnterCombat(Unit* /*who*/) { - DoScriptText(SAY_AGGRO, me); + Talk(SAY_AGGRO); - if (m_instance) + if (instance) { - m_instance->SetData(TYPE_LOKEN, IN_PROGRESS); - m_instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMELY_DEATH_START_EVENT); + instance->SetData(TYPE_LOKEN, IN_PROGRESS); + instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMELY_DEATH_START_EVENT); } } void JustDied(Unit* /*killer*/) { - DoScriptText(SAY_DEATH, me); + Talk(SAY_DEATH); - if (m_instance) - m_instance->SetData(TYPE_LOKEN, DONE); + if (instance) + instance->SetData(TYPE_LOKEN, DONE); } void KilledUnit(Unit* /*victim*/) { - DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2, SAY_SLAY_3), me); + Talk(SAY_SLAY); } void UpdateAI(const uint32 uiDiff) @@ -190,8 +186,8 @@ public: if (m_uiLightningNova_Timer <= uiDiff) { - DoScriptText(RAND(SAY_NOVA_1, SAY_NOVA_2, SAY_NOVA_3), me); - DoScriptText(EMOTE_NOVA, me); + Talk(SAY_NOVA); + Talk(EMOTE_NOVA); DoCast(me, SPELL_LIGHTNING_NOVA_N); m_bIsAura = false; @@ -206,9 +202,9 @@ public: { switch (m_uiHealthAmountModifier) { - case 1: DoScriptText(SAY_75HEALTH, me); break; - case 2: DoScriptText(SAY_50HEALTH, me); break; - case 3: DoScriptText(SAY_25HEALTH, me); break; + case 1: Talk(SAY_75HEALTH); break; + case 2: Talk(SAY_50HEALTH); break; + case 3: Talk(SAY_25HEALTH); break; } ++m_uiHealthAmountModifier; diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp index 1fc724c8b6c..5c7bf0d1c1e 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp @@ -28,17 +28,13 @@ EndScriptData */ enum eEnums { - SAY_AGGRO = -1602032, - SAY_SLAY_1 = -1602033, - SAY_SLAY_2 = -1602034, - SAY_SLAY_3 = -1602035, - SAY_DEATH = -1602036, - SAY_STOMP_1 = -1602037, - SAY_STOMP_2 = -1602038, - SAY_FORGE_1 = -1602039, - SAY_FORGE_2 = -1602040, - EMOTE_TO_ANVIL = -1602041, - EMOTE_SHATTER = -1602042, + SAY_AGGRO = 0, + SAY_FORGE = 1, + SAY_STOMP = 2, + SAY_SLAY = 3, + SAY_DEATH = 4, + EMOTE_TO_ANVIL = 5, + EMOTE_SHATTER = 6, SPELL_HEAT_N = 52387, SPELL_HEAT_H = 59528, @@ -83,10 +79,10 @@ public: { boss_volkhanAI(Creature* creature) : ScriptedAI(creature) { - m_instance = creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; std::list m_lGolemGUIDList; @@ -121,16 +117,16 @@ public: DespawnGolem(); m_lGolemGUIDList.clear(); - if (m_instance) - m_instance->SetData(TYPE_VOLKHAN, NOT_STARTED); + if (instance) + instance->SetData(TYPE_VOLKHAN, NOT_STARTED); } void EnterCombat(Unit* /*who*/) { - DoScriptText(SAY_AGGRO, me); + Talk(SAY_AGGRO); - if (m_instance) - m_instance->SetData(TYPE_VOLKHAN, IN_PROGRESS); + if (instance) + instance->SetData(TYPE_VOLKHAN, IN_PROGRESS); } void AttackStart(Unit* who) @@ -148,15 +144,15 @@ public: void JustDied(Unit* /*killer*/) { - DoScriptText(SAY_DEATH, me); + Talk(SAY_DEATH); DespawnGolem(); - if (m_instance) - m_instance->SetData(TYPE_VOLKHAN, DONE); + if (instance) + instance->SetData(TYPE_VOLKHAN, DONE); if (IsHeroic() && GolemsShattered < 5) { - AchievementEntry const* AchievShatterResistant = GetAchievementStore()->LookupEntry(ACHIEVEMENT_SHATTER_RESISTANT); + AchievementEntry const* AchievShatterResistant = sAchievementStore.LookupEntry(ACHIEVEMENT_SHATTER_RESISTANT); if (AchievShatterResistant) { Map* map = me->GetMap(); @@ -172,7 +168,7 @@ public: void KilledUnit(Unit* /*victim*/) { - DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2, SAY_SLAY_3), me); + Talk(SAY_SLAY); } void DespawnGolem() @@ -263,11 +259,11 @@ public: if (m_uiShatteringStomp_Timer <= uiDiff) { // Should he stomp even if he has no brittle golem to shatter? - DoScriptText(RAND(SAY_STOMP_1, SAY_STOMP_2), me); + Talk(SAY_STOMP); DoCast(me, SPELL_SHATTERING_STOMP_N); - DoScriptText(EMOTE_SHATTER, me); + Talk(EMOTE_SHATTER); m_uiShatteringStomp_Timer = 30000; m_bCanShatterGolem = true; @@ -297,7 +293,7 @@ public: if (me->IsNonMeleeSpellCasted(false)) me->InterruptNonMeleeSpells(false); - DoScriptText(RAND(SAY_FORGE_1, SAY_FORGE_2), me); + Talk(SAY_FORGE); m_bHasTemper = true; @@ -308,7 +304,7 @@ public: { case 1: // 1 - Start run to Anvil - DoScriptText(EMOTE_TO_ANVIL, me); + Talk(EMOTE_TO_ANVIL); me->GetMotionMaster()->MoveTargetedHome(); m_uiSummonPhase = 2; // Set Next Phase break; diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp index d1aba800094..bc57ce21a4d 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp @@ -61,9 +61,9 @@ public: struct boss_krystallusAI : public ScriptedAI { - boss_krystallusAI(Creature* c) : ScriptedAI(c) + boss_krystallusAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiBoulderTossTimer; diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp index cd4d7ae94a1..65711643827 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp @@ -65,7 +65,7 @@ public: struct boss_maiden_of_griefAI : public ScriptedAI { - boss_maiden_of_griefAI(Creature* c) : ScriptedAI(c) + boss_maiden_of_griefAI(Creature* creature) : ScriptedAI(creature) { instance = me->GetInstanceScript(); } diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp index 2c7026207e5..c2a8e905950 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp @@ -90,9 +90,9 @@ public: struct boss_sjonnirAI : public ScriptedAI { - boss_sjonnirAI(Creature* c) : ScriptedAI(c), lSummons(me) + boss_sjonnirAI(Creature* creature) : ScriptedAI(creature), lSummons(me) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } bool bIsFrenzy; @@ -258,7 +258,7 @@ public: struct mob_malformed_oozeAI : public ScriptedAI { - mob_malformed_oozeAI(Creature* c) : ScriptedAI(c) {} + mob_malformed_oozeAI(Creature* creature) : ScriptedAI(creature) {} uint32 uiMergeTimer; @@ -301,9 +301,9 @@ public: struct mob_iron_sludgeAI : public ScriptedAI { - mob_iron_sludgeAI(Creature* c) : ScriptedAI(c) + mob_iron_sludgeAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp index 1c8d9380a2b..a608de5fcf3 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp @@ -142,9 +142,9 @@ public: struct mob_tribuna_controllerAI : public ScriptedAI { - mob_tribuna_controllerAI(Creature* c) : ScriptedAI(c) + mob_tribuna_controllerAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); SetCombatMovement(false); } @@ -268,10 +268,10 @@ class npc_brann_hos : public CreatureScript public: npc_brann_hos() : CreatureScript("npc_brann_hos") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1 || uiAction == GOSSIP_ACTION_INFO_DEF+2) + if (action == GOSSIP_ACTION_INFO_DEF+1 || action == GOSSIP_ACTION_INFO_DEF+2) { player->CLOSE_GOSSIP_MENU(); CAST_AI(npc_brann_hos::npc_brann_hosAI, creature->AI())->StartWP(); @@ -298,9 +298,9 @@ public: struct npc_brann_hosAI : public npc_escortAI { - npc_brann_hosAI(Creature* c) : npc_escortAI(c) + npc_brann_hosAI(Creature* creature) : npc_escortAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiStep; @@ -346,9 +346,9 @@ public: lDwarfGUIDList.clear(); } - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { - switch (uiPointId) + switch (waypointId) { case 7: if (Creature* creature = GetClosestCreatureWithEntry(me, CREATURE_TRIBUNAL_OF_THE_AGES, 100.0f)) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon.cpp deleted file mode 100644 index e54d8a898de..00000000000 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon.cpp +++ /dev/null @@ -1,376 +0,0 @@ -/* - * Copyright (C) 2008-2012 TrinityCore - * - * 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; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; 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, see . - */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ulduar.h" - -#define GAMEOBJECT_GIVE_OF_THE_OBSERVER 194821 - -enum Spells -{ - SPELL_ASCEND = 64487, - SPELL_BERSERK = 47008, - SPELL_BIG_BANG = 64443, - H_SPELL_BIG_BANG = 64584, - SPELL_COSMIC_SMASH = 62301, - H_SPELL_COSMIC_SMASH = 64598, - SPELL_PHASE_PUNCH = 64412, - SPELL_QUANTUM_STRIKE = 64395, - H_SPELL_QUANTUM_STRIKE = 64592, - SPELL_BLACK_HOLE_EXPLOSION = 64122, - SPELL_ARCANE_BARAGE = 64599, - H_SPELL_ARCANE_BARAGE = 64607 -}; - -enum Creatures -{ - CREATURE_COLLAPSING_STAR = 32955, - CREATURE_BLACK_HOLE = 32953, - CREATURE_LIVING_CONSTELLATION = 33052, - CREATURE_DARK_MATTER = 33089 -}; - -enum Yells -{ - SAY_AGGRO = -1603000, - SAY_SLAY_1 = -1603001, - SAY_SLAY_2 = -1603002, - SAY_ENGADED_FOR_FIRTS_TIME = -1603003, - SAY_PHASE_2 = -1603004, - SAY_SUMMON_COLLAPSING_STAR = -1603005, - SAY_DEATH_1 = -1603006, - SAY_DEATH_2 = -1603007, - SAY_DEATH_3 = -1603008, - SAY_DEATH_4 = -1603009, - SAY_DEATH_5 = -1603010, - SAY_BERSERK = -1603011, - SAY_BIG_BANG_1 = -1603012, - SAY_BIG_BANG_2 = -1603013, - SAY_TIMER_1 = -1603014, - SAY_TIMER_2 = -1603015, - SAY_TIMER_3 = -1603016, - SAY_SUMMON_1 = -1603017, - SAY_SUMMON_2 = -1603018, - SAY_SUMMON_3 = -1603019, -}; - -class boss_algalon : public CreatureScript -{ -public: - boss_algalon() : CreatureScript("boss_algalon") { } - - CreatureAI* GetAI(Creature* creature) const - { - return GetUlduarAI(creature); - } - - struct boss_algalonAI : public ScriptedAI - { - boss_algalonAI(Creature* c) : ScriptedAI(c) - { - instance = c->GetInstanceScript(); - Summon = false; // not in reset. intro speech done only once. - } - - InstanceScript* instance; - - std::list m_lCollapsingStarGUIDList; - - uint32 Phase; - uint32 Ascend_Timer; - uint32 Berserk_Timer; - uint32 BigBang_Timer; - uint32 CosmicSmash_Timer; - uint32 PhasePunch_Timer; - uint32 QuantumStrike_Timer; - uint32 CollapsingStar_Timer; - uint32 uiPhase_timer; - uint32 uiStep; - - uint64 BlackHoleGUID; - - bool Enrage; - bool Summon; - - void EnterCombat(Unit* who) - { - if (Summon) - { - DoScriptText(SAY_AGGRO, me); - me->InterruptSpell(CURRENT_CHANNELED_SPELL); - DoZoneInCombat(who->ToCreature()); - } - else - { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->SetReactState(REACT_PASSIVE); - uiStep = 1; - } - - if (instance) - instance->SetData(BOSS_ALGALON, IN_PROGRESS); - } - - void KilledUnit(Unit* /*victim*/) - { - DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2), me); - } - - void Reset() - { - Phase = 1; - - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - if (instance) - instance->SetData(BOSS_ALGALON, NOT_STARTED); - - BlackHoleGUID = 0; - - uiPhase_timer = 0; - Ascend_Timer = 480000; //8 minutes - QuantumStrike_Timer = urand(4000, 14000); - Berserk_Timer = 360000; //6 minutes - CollapsingStar_Timer = urand(15000, 20000); //Spawns between 15 to 20 seconds - BigBang_Timer = 90000; - PhasePunch_Timer = 8000; - CosmicSmash_Timer = urand(30000, 60000); - Enrage = false; - } - - void JumpToNextStep(uint32 uiTimer) - { - uiPhase_timer = uiTimer; - ++uiStep; - } - - void DespawnCollapsingStar() - { - if (m_lCollapsingStarGUIDList.empty()) - return; - - for (std::list::const_iterator itr = m_lCollapsingStarGUIDList.begin(); itr != m_lCollapsingStarGUIDList.end(); ++itr) - { - if (Creature* temp = Unit::GetCreature(*me, *itr)) - { - if (temp->isAlive()) - temp->DespawnOrUnsummon(); - } - } - m_lCollapsingStarGUIDList.clear(); - } - - void JustSummoned(Creature* summoned) - { - if (summoned->GetEntry() == CREATURE_COLLAPSING_STAR) - { - Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0); - if (me->getVictim()) - summoned->AI()->AttackStart(target ? target : me->getVictim()); - m_lCollapsingStarGUIDList.push_back(summoned->GetGUID()); - } - } - - void SummonCollapsingStar(Unit* target) - { - DoScriptText(SAY_SUMMON_COLLAPSING_STAR, me); - me->SummonCreature(CREATURE_COLLAPSING_STAR, target->GetPositionX()+15.0f, target->GetPositionY()+15.0f, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 100000); - me->SummonCreature(CREATURE_BLACK_HOLE, target->GetPositionX()+15.0f, target->GetPositionY()+15.0f, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 27000); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (Phase == 1 && HealthBelowPct(20)) - { - Phase = 2; - DoScriptText(SAY_PHASE_2, me); - } - - if (HealthBelowPct(2)) - { - me->SummonGameObject(GAMEOBJECT_GIVE_OF_THE_OBSERVER, 1634.258667f, -295.101166f, 417.321381f, 0, 0, 0, 0, 0, 0); - - // All of them. or random? - DoScriptText(SAY_DEATH_1, me); - DoScriptText(SAY_DEATH_2, me); - DoScriptText(SAY_DEATH_3, me); - DoScriptText(SAY_DEATH_4, me); - DoScriptText(SAY_DEATH_5, me); - - me->DisappearAndDie(); - - if (instance) - instance->SetData(BOSS_ALGALON, DONE); - - return; - } - - if (Phase == 1) - { - if (!Summon) - { - if (uiPhase_timer <= diff) - { - switch (uiStep) - { - case 1: - DoScriptText(SAY_SUMMON_1, me); - JumpToNextStep(3000); - break; - case 2: - DoScriptText(SAY_SUMMON_2, me); - JumpToNextStep(3000); - break; - case 3: - DoScriptText(SAY_SUMMON_3, me); - JumpToNextStep(3000); - break; - case 4: - DoScriptText(SAY_ENGADED_FOR_FIRTS_TIME, me); - JumpToNextStep(3000); - break; - case 5: - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->SetReactState(REACT_AGGRESSIVE); - Summon = true; - break; - } - } else uiPhase_timer -= diff; - - return; - } - - if (QuantumStrike_Timer <= diff) - { - DoCast(me->getVictim(), RAID_MODE(SPELL_QUANTUM_STRIKE, H_SPELL_QUANTUM_STRIKE), true); - - QuantumStrike_Timer = urand(4000, 14000); - } else QuantumStrike_Timer -= diff; - - if (BigBang_Timer <= diff) - { - DoScriptText(RAND(SAY_BIG_BANG_1, SAY_BIG_BANG_2), me); - DoCast(me->getVictim(), RAID_MODE(SPELL_BIG_BANG, H_SPELL_BIG_BANG), true); - - BigBang_Timer = 90000; - } else BigBang_Timer -= diff; - - if (Ascend_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_ASCEND, true); - - Ascend_Timer = 480000; - } else Ascend_Timer -= diff; - - if (PhasePunch_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_PHASE_PUNCH, true); - - PhasePunch_Timer = 8000; - } else PhasePunch_Timer -= diff; - - if (CosmicSmash_Timer <= diff) - { - DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0), RAID_MODE(SPELL_COSMIC_SMASH, H_SPELL_COSMIC_SMASH), true); - - CosmicSmash_Timer = urand(30000, 60000); - } else CosmicSmash_Timer -= diff; - - if (Berserk_Timer <= diff) - { - DoScriptText(SAY_BERSERK, me); - DoCast(me->getVictim(), SPELL_BERSERK, true); - - Berserk_Timer = 360000; - } else Berserk_Timer -= diff; - - DoMeleeAttackIfReady(); - - EnterEvadeIfOutOfCombatArea(diff); - } - - if (Phase == 2) - { - if (Enrage) - { - if (Ascend_Timer <= diff) - { - DoCast(me, SPELL_ASCEND); - DoScriptText(SAY_BERSERK, me); - Ascend_Timer = urand(360000, 365000); - Enrage = false; - } else Ascend_Timer -= diff; - } - } - - DoMeleeAttackIfReady(); - } - }; - -}; - -//Collapsing Star -class mob_collapsing_star : public CreatureScript -{ -public: - mob_collapsing_star() : CreatureScript("mob_collapsing_star") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_collapsing_starAI(creature); - } - - struct mob_collapsing_starAI : public ScriptedAI - { - mob_collapsing_starAI(Creature* creature) : ScriptedAI(creature) - { - instance = creature->GetInstanceScript(); - } - - InstanceScript* instance; - - uint32 BlackHoleExplosion_Timer; - - void Reset() - { - BlackHoleExplosion_Timer = 0; - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (BlackHoleExplosion_Timer <= diff) - { - me->CastSpell(me, SPELL_BLACK_HOLE_EXPLOSION, false); - BlackHoleExplosion_Timer = 0; - } else BlackHoleExplosion_Timer -= diff; - } - }; - -}; - -void AddSC_boss_Algalon() -{ - new boss_algalon(); - new mob_collapsing_star(); -} diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp new file mode 100644 index 00000000000..2af73389ecb --- /dev/null +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp @@ -0,0 +1,1374 @@ +/* + * Copyright (C) 2008-2012 TrinityCore + * + * 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; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; 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, see . + */ + +#include "ObjectMgr.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "SpellScript.h" +#include "PassiveAI.h" +#include "GameObjectAI.h" +#include "MapManager.h" +#include "MoveSplineInit.h" +#include "ulduar.h" + +enum Texts +{ + SAY_BRANN_ALGALON_INTRO_1 = 0, + SAY_BRANN_ALGALON_INTRO_2 = 1, + SAY_BRANN_ALGALON_OUTRO = 2, + + SAY_ALGALON_INTRO_1 = 0, + SAY_ALGALON_INTRO_2 = 1, + SAY_ALGALON_INTRO_3 = 2, + SAY_ALGALON_START_TIMER = 3, + SAY_ALGALON_AGGRO = 4, + SAY_ALGALON_COLLAPSING_STAR = 5, + EMOTE_ALGALON_COLLAPSING_STAR = 6, + SAY_ALGALON_BIG_BANG = 7, + EMOTE_ALGALON_BIG_BANG = 8, + SAY_ALGALON_ASCEND = 9, + EMOTE_ALGALON_COSMIC_SMASH = 10, + SAY_ALGALON_PHASE_TWO = 11, + SAY_ALGALON_OUTRO_1 = 12, + SAY_ALGALON_OUTRO_2 = 13, + SAY_ALGALON_OUTRO_3 = 14, + SAY_ALGALON_OUTRO_4 = 15, + SAY_ALGALON_OUTRO_5 = 16, + SAY_ALGALON_DESPAWN_1 = 17, + SAY_ALGALON_DESPAWN_2 = 18, + SAY_ALGALON_DESPAWN_3 = 19, + SAY_ALGALON_KILL = 20, +}; + +enum Spells +{ + // Algalon the Observer + SPELL_ARRIVAL = 64997, + SPELL_RIDE_THE_LIGHTNING = 64986, + SPELL_SUMMON_AZEROTH = 64994, + SPELL_REORIGINATION = 64996, + SPELL_SUPERMASSIVE_FAIL = 65311, + SPELL_QUANTUM_STRIKE = 64395, + SPELL_PHASE_PUNCH = 64412, + SPELL_BIG_BANG = 64443, + SPELL_ASCEND_TO_THE_HEAVENS = 64487, + SPELL_COSMIC_SMASH = 62301, + SPELL_COSMIC_SMASH_TRIGGERED = 62304, + SPELL_COSMIC_SMASH_VISUAL_STATE = 62300, + SPELL_SELF_STUN = 65256, + SPELL_KILL_CREDIT = 65184, + SPELL_TELEPORT = 62940, + + // Algalon Stalker + SPELL_TRIGGER_3_ADDS = 62266, // Triggers Living Constellation + + // Living Constellation + SPELL_ARCANE_BARRAGE = 64599, + + // Collapsing Star + SPELL_COLLAPSE = 62018, + SPELL_BLACK_HOLE_SPAWN_VISUAL = 62003, + SPELL_SUMMON_BLACK_HOLE = 62189, + + // Black Hole + SPELL_BLACK_HOLE_TRIGGER = 62185, + SPELL_CONSTELLATION_PHASE_TRIGGER = 65508, + SPELL_CONSTELLATION_PHASE_EFFECT = 65509, + SPELL_BLACK_HOLE_EXPLOSION = 64122, + SPELL_SUMMON_VOID_ZONE_VISUAL = 64470, + SPELL_VOID_ZONE_VISUAL = 64469, + SPELL_BLACK_HOLE_CREDIT = 65312, + + // Worm Hole + SPELL_WORM_HOLE_TRIGGER = 65251, + SPELL_SUMMON_UNLEASHED_DARK_MATTER = 64450, +}; + +uint32 const PhasePunchAlphaId[5] = {64435, 64434, 64428, 64421, 64417}; + +enum Events +{ + // Celestial Planetarium Access + EVENT_DESPAWN_CONSOLE = 1, + + // Brann Bronzebeard + EVENT_BRANN_MOVE_INTRO = 2, + EVENT_SUMMON_ALGALON = 3, + EVENT_BRANN_OUTRO_1 = 4, + EVENT_BRANN_OUTRO_2 = 5, + + // Algalon the Observer + EVENT_INTRO_1 = 6, + EVENT_INTRO_2 = 7, + EVENT_INTRO_3 = 8, + EVENT_INTRO_FINISH = 9, + EVENT_START_COMBAT = 10, + EVENT_INTRO_TIMER_DONE = 11, + EVENT_QUANTUM_STRIKE = 12, + EVENT_PHASE_PUNCH = 13, + EVENT_SUMMON_COLLAPSING_STAR = 14, + EVENT_BIG_BANG = 15, + EVENT_RESUME_UPDATING = 16, + EVENT_ASCEND_TO_THE_HEAVENS = 17, + EVENT_EVADE = 18, + EVENT_COSMIC_SMASH = 19, + EVENT_UNLOCK_YELL = 20, + EVENT_OUTRO_START = 21, + EVENT_OUTRO_1 = 22, + EVENT_OUTRO_2 = 23, + EVENT_OUTRO_3 = 24, + EVENT_OUTRO_4 = 25, + EVENT_OUTRO_5 = 26, + EVENT_OUTRO_6 = 27, + EVENT_OUTRO_7 = 28, + EVENT_OUTRO_8 = 29, + EVENT_OUTRO_9 = 30, + EVENT_OUTRO_10 = 31, + EVENT_OUTRO_11 = 32, + EVENT_OUTRO_12 = 33, + EVENT_OUTRO_13 = 34, + EVENT_OUTRO_14 = 35, + EVENT_DESPAWN_ALGALON_1 = 36, + EVENT_DESPAWN_ALGALON_2 = 37, + EVENT_DESPAWN_ALGALON_3 = 38, + + // Living Constellation + EVENT_ARCANE_BARRAGE = 39, +}; + +enum Actions +{ + ACTION_START_INTRO = 0, + ACTION_FINISH_INTRO = 1, + ACTION_ACTIVATE_STAR = 2, + ACTION_BIG_BANG = 3, + ACTION_ASCEND = 4, + ACTION_OUTRO = 5, +}; + +enum Points +{ + POINT_BRANN_INTRO = 0, + MAX_BRANN_WAYPOINTS_INTRO = 10, + POINT_BRANN_OUTRO = 10, + POINT_BRANN_OUTRO_END = 11, + + POINT_ALGALON_LAND = 1, + POINT_ALGALON_OUTRO = 2, +}; + +enum EncounterPhases +{ + PHASE_NORMAL = 0, + PHASE_ROLE_PLAY = 1, + PHASE_BIG_BANG = 2, + + PHASE_MASK_NO_UPDATE = (1 << PHASE_ROLE_PLAY) | (1 << PHASE_BIG_BANG), + PHASE_MASK_NO_CAST_CHECK = 1 << PHASE_ROLE_PLAY, +}; + +enum AchievmentInfo +{ + EVENT_ID_SUPERMASSIVE_START = 21697, + DATA_HAS_FED_ON_TEARS = 30043005, +}; + + +Position const BrannIntroSpawnPos = {1676.277f, -162.5308f, 427.3326f, 3.235537f}; +Position const BrannIntroWaypoint[MAX_BRANN_WAYPOINTS_INTRO] = +{ + {1642.482f, -164.0812f, 427.2602f, 0.0f}, + {1635.000f, -169.5145f, 427.2523f, 0.0f}, + {1632.814f, -173.9334f, 427.2621f, 0.0f}, + {1632.676f, -190.5927f, 425.8831f, 0.0f}, + {1631.497f, -214.2221f, 418.1152f, 0.0f}, + {1624.717f, -224.6876f, 418.1152f, 0.0f}, + {1631.497f, -214.2221f, 418.1152f, 0.0f}, + {1632.676f, -190.5927f, 425.8831f, 0.0f}, + {1632.814f, -173.9334f, 427.2621f, 0.0f}, + {1635.000f, -169.5145f, 427.2523f, 0.0f}, +}; +Position const AlgalonSummonPos = {1632.531f, -304.8516f, 450.1123f, 1.530165f}; +Position const AlgalonLandPos = {1632.668f, -302.7656f, 417.3211f, 1.530165f}; + +#define LIVING_CONSTELLATION_COUNT 11 +Position const ConstellationPos[LIVING_CONSTELLATION_COUNT] = +{ + {1625.208f, -267.2771f, 446.4296f, 5.044002f}, + {1658.279f, -262.5490f, 441.9073f, 4.188790f}, + {1678.677f, -276.3280f, 427.7531f, 3.979351f}, + {1593.389f, -299.4325f, 432.4636f, 6.073746f}, + {1685.613f, -300.1219f, 443.2366f, 3.385939f}, + {1591.706f, -263.8201f, 441.4153f, 5.253441f}, + {1668.317f, -324.7676f, 457.9394f, 3.211406f}, + {1592.242f, -325.5323f, 446.9508f, 0.226893f}, + {1635.821f, -363.3442f, 424.3459f, 1.466077f}, + {1672.188f, -357.2484f, 436.7337f, 2.338741f}, + {1615.800f, -348.0065f, 442.9586f, 1.134464f}, +}; + +#define COLLAPSING_STAR_COUNT 4 +Position const CollapsingStarPos[COLLAPSING_STAR_COUNT] = +{ + {1649.438f, -319.8127f, 418.3941f, 1.082104f}, + {1647.005f, -288.6790f, 417.3955f, 3.490659f}, + {1622.451f, -321.1563f, 417.6188f, 4.677482f}, + {1615.060f, -291.6816f, 417.7796f, 3.490659f}, +}; +Position const AlgalonOutroPos = {1633.64f, -317.78f, 417.3211f, 0.0f}; +Position const BrannOutroPos[3] = +{ + {1632.023f, -243.7434f, 417.9118f, 0.0f}, + {1631.986f, -297.7831f, 417.3210f, 0.0f}, + {1633.832f, -216.2948f, 417.0463f, 0.0f}, +}; + +class ActivateLivingConstellation : public BasicEvent +{ + public: + ActivateLivingConstellation(Unit* owner) : _owner(owner), _instance(owner->GetInstanceScript()) + { + } + + bool Execute(uint64 execTime, uint32 /*diff*/) + { + if (!_instance || _instance->GetBossState(BOSS_ALGALON) != IN_PROGRESS) + return true; // delete event + + _owner->CastSpell((Unit*)NULL, SPELL_TRIGGER_3_ADDS, TRIGGERED_FULL_MASK); + _owner->m_Events.AddEvent(this, execTime + urand(45000, 50000)); + return false; + } + + private: + Unit* _owner; + InstanceScript* _instance; +}; + +class CosmicSmashDamageEvent : public BasicEvent +{ + public: + CosmicSmashDamageEvent(Unit* caster) : _caster(caster) + { + } + + bool Execute(uint64 /*execTime*/, uint32 /*diff*/) + { + _caster->CastSpell((Unit*)NULL, SPELL_COSMIC_SMASH_TRIGGERED, TRIGGERED_FULL_MASK); + return true; + } + + private: + Unit* _caster; +}; + +class SummonUnleashedDarkMatter : public BasicEvent +{ + public: + SummonUnleashedDarkMatter(Unit* caster) : _caster(caster) + { + } + + bool Execute(uint64 execTime, uint32 /*diff*/) + { + _caster->CastSpell((Unit*)NULL, SPELL_SUMMON_UNLEASHED_DARK_MATTER, TRIGGERED_FULL_MASK); + _caster->m_Events.AddEvent(this, execTime + 30000); + return false; + } + + private: + Unit* _caster; +}; + +class boss_algalon_the_observer : public CreatureScript +{ + public: + boss_algalon_the_observer() : CreatureScript("boss_algalon_the_observer") {} + + struct boss_algalon_the_observerAI : public BossAI + { + boss_algalon_the_observerAI(Creature* creature) : BossAI(creature, BOSS_ALGALON) + { + _firstPull = true; + _fedOnTears = false; + } + + void Reset() + { + _Reset(); + me->SetReactState(REACT_PASSIVE); + _phaseTwo = false; + _fightWon = false; + _hasYelled = false; + } + + void KilledUnit(Unit* victim) + { + if (victim->GetTypeId() == TYPEID_UNIT) + { + _fedOnTears = true; + if (!_hasYelled) + { + _hasYelled = true; + events.ScheduleEvent(EVENT_UNLOCK_YELL, 1000); + Talk(SAY_ALGALON_KILL); + } + } + } + + void DoAction(int32 const action) + { + switch (action) + { + case ACTION_START_INTRO: + { + me->SetFlag(UNIT_FIELD_FLAGS_2, 0x20); + me->SetDisableGravity(true); + DoCast(me, SPELL_ARRIVAL, true); + DoCast(me, SPELL_RIDE_THE_LIGHTNING, true); + me->GetMotionMaster()->MovePoint(POINT_ALGALON_LAND, AlgalonLandPos); + me->SetHomePosition(AlgalonLandPos); + Movement::MoveSplineInit init(*me); + init.MoveTo(AlgalonLandPos.GetPositionX(), AlgalonLandPos.GetPositionY(), AlgalonLandPos.GetPositionZ()); + init.SetOrientationFixed(true); + init.Launch(); + events.Reset(); + events.SetPhase(PHASE_ROLE_PLAY); + events.ScheduleEvent(EVENT_INTRO_1, 5000, 0, PHASE_ROLE_PLAY); + events.ScheduleEvent(EVENT_INTRO_2, 15000, 0, PHASE_ROLE_PLAY); + events.ScheduleEvent(EVENT_INTRO_3, 23000, 0, PHASE_ROLE_PLAY); + events.ScheduleEvent(EVENT_INTRO_FINISH, 36000, 0, PHASE_ROLE_PLAY); + break; + } + case ACTION_ASCEND: + events.SetPhase(PHASE_BIG_BANG); + events.CancelEvent(EVENT_RESUME_UPDATING); + events.ScheduleEvent(EVENT_ASCEND_TO_THE_HEAVENS, 1500); + break; + case EVENT_DESPAWN_ALGALON: + events.Reset(); + events.SetPhase(PHASE_ROLE_PLAY); + if (me->isInCombat()) + events.ScheduleEvent(EVENT_ASCEND_TO_THE_HEAVENS, 1); + events.ScheduleEvent(EVENT_DESPAWN_ALGALON_1, 5000); + events.ScheduleEvent(EVENT_DESPAWN_ALGALON_2, 17000); + events.ScheduleEvent(EVENT_DESPAWN_ALGALON_3, 26000); + me->DespawnOrUnsummon(34000); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_NPC); + break; + case ACTION_INIT_ALGALON: + _firstPull = false; + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); + break;; + } + } + + uint32 GetData(uint32 type) + { + return type == DATA_HAS_FED_ON_TEARS ? _fedOnTears : 1; + } + + void EnterCombat(Unit* /*target*/) + { + uint32 introDelay = 0; + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_NPC); + events.Reset(); + events.SetPhase(PHASE_ROLE_PLAY); + + if (!_firstPull) + { + Talk(SAY_ALGALON_AGGRO); + _EnterCombat(); + introDelay = 8000; + } + else + { + _firstPull = false; + Talk(SAY_ALGALON_START_TIMER); + if (Creature* brann = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_BRANN_BRONZEBEARD_ALG))) + brann->AI()->DoAction(ACTION_FINISH_INTRO); + + me->setActive(true); + DoZoneInCombat(); + introDelay = 26000; + summons.DespawnEntry(NPC_AZEROTH); + instance->SetData(EVENT_DESPAWN_ALGALON, 0); + events.ScheduleEvent(EVENT_START_COMBAT, 18000); + } + + events.ScheduleEvent(EVENT_INTRO_TIMER_DONE, introDelay); + events.ScheduleEvent(EVENT_QUANTUM_STRIKE, 3500 + introDelay); + events.ScheduleEvent(EVENT_PHASE_PUNCH, 15500 + introDelay); + events.ScheduleEvent(EVENT_SUMMON_COLLAPSING_STAR, 18000 + introDelay); + events.ScheduleEvent(EVENT_BIG_BANG, 90000 + introDelay); + events.ScheduleEvent(EVENT_ASCEND_TO_THE_HEAVENS, 360000 + introDelay); + events.ScheduleEvent(EVENT_COSMIC_SMASH, 25000 + introDelay); + + std::list stalkers; + me->GetCreatureListWithEntryInGrid(stalkers, NPC_ALGALON_STALKER, 200.0f); + for (std::list::iterator itr = stalkers.begin(); itr != stalkers.end(); ++itr) + (*itr)->m_Events.KillAllEvents(true); + } + + void MovementInform(uint32 movementType, uint32 pointId) + { + if (movementType != POINT_MOTION_TYPE) + return; + + if (pointId == POINT_ALGALON_LAND) + me->SetDisableGravity(false); + else if (pointId == POINT_ALGALON_OUTRO) + { + me->SetFacingTo(1.605703f); + events.ScheduleEvent(EVENT_OUTRO_3, 1200); + events.ScheduleEvent(EVENT_OUTRO_4, 2400); + events.ScheduleEvent(EVENT_OUTRO_5, 8500); + events.ScheduleEvent(EVENT_OUTRO_6, 15500); + events.ScheduleEvent(EVENT_OUTRO_7, 55500); + events.ScheduleEvent(EVENT_OUTRO_8, 73500); + events.ScheduleEvent(EVENT_OUTRO_9, 85500); + events.ScheduleEvent(EVENT_OUTRO_10, 108500); + events.ScheduleEvent(EVENT_OUTRO_11, 123500); + } + } + + void JustSummoned(Creature* summon) + { + summons.Summon(summon); + switch (summon->GetEntry()) + { + case NPC_AZEROTH: + DoCastAOE(SPELL_REORIGINATION, true); + break; + case NPC_COLLAPSING_STAR: + summon->SetReactState(REACT_PASSIVE); + summon->GetMotionMaster()->MoveRandom(20.0f); + summon->CastSpell(summon, SPELL_COLLAPSE, TRIGGERED_FULL_MASK); + break; + case NPC_BLACK_HOLE: + summon->SetReactState(REACT_PASSIVE); + summon->CastSpell((Unit*)NULL, SPELL_BLACK_HOLE_TRIGGER, TRIGGERED_FULL_MASK); + summon->CastSpell(summon, SPELL_CONSTELLATION_PHASE_TRIGGER, TRIGGERED_FULL_MASK); + summon->CastSpell((Unit*)NULL, SPELL_BLACK_HOLE_EXPLOSION); + summon->CastSpell(summon, SPELL_SUMMON_VOID_ZONE_VISUAL, TRIGGERED_FULL_MASK); + break; + case NPC_ALGALON_VOID_ZONE_VISUAL_STALKER: + summon->CastSpell(summon, SPELL_VOID_ZONE_VISUAL, TRIGGERED_FULL_MASK); + break; + case NPC_ALGALON_STALKER_ASTEROID_TARGET_01: + summon->CastSpell(summon, SPELL_COSMIC_SMASH_VISUAL_STATE, TRIGGERED_FULL_MASK); + break; + case NPC_ALGALON_STALKER_ASTEROID_TARGET_02: + summon->m_Events.AddEvent(new CosmicSmashDamageEvent(summon), summon->m_Events.CalculateTime(3250)); + break; + case NPC_WORM_HOLE: + summon->SetReactState(REACT_PASSIVE); + summon->CastSpell(summon, SPELL_WORM_HOLE_TRIGGER, TRIGGERED_FULL_MASK); + summon->CastSpell(summon, SPELL_SUMMON_VOID_ZONE_VISUAL, TRIGGERED_FULL_MASK); + break; + case NPC_UNLEASHED_DARK_MATTER: + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, NonTankTargetSelector(me))) + if (summon->Attack(target, true)) + summon->GetMotionMaster()->MoveChase(target); + break; + } + } + + void EnterEvadeMode() + { + instance->SetBossState(BOSS_ALGALON, FAIL); + BossAI::EnterEvadeMode(); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); + me->SetSheath(SHEATH_STATE_UNARMED); + } + + void DamageTaken(Unit* /*attacker*/, uint32& damage) + { + if (_fightWon) + { + damage = 0; + return; + } + + if (!_phaseTwo && me->HealthBelowPctDamaged(20, damage)) + { + _phaseTwo = true; + Talk(SAY_ALGALON_PHASE_TWO); + summons.DespawnEntry(NPC_LIVING_CONSTELLATION); + summons.DespawnEntry(NPC_COLLAPSING_STAR); + summons.DespawnEntry(NPC_BLACK_HOLE); + summons.DespawnEntry(NPC_ALGALON_VOID_ZONE_VISUAL_STALKER); + events.CancelEvent(EVENT_SUMMON_COLLAPSING_STAR); + std::list stalkers; + me->GetCreatureListWithEntryInGrid(stalkers, NPC_ALGALON_STALKER, 200.0f); + for (std::list::iterator itr = stalkers.begin(); itr != stalkers.end(); ++itr) + (*itr)->m_Events.KillAllEvents(true); + for (uint32 i = 0; i < COLLAPSING_STAR_COUNT; ++i) + if (Creature* wormHole = DoSummon(NPC_WORM_HOLE, CollapsingStarPos[i], TEMPSUMMON_MANUAL_DESPAWN)) + wormHole->m_Events.AddEvent(new SummonUnleashedDarkMatter(wormHole), wormHole->m_Events.CalculateTime(i >= 2 ? 8000 : 6000)); + } + else if ((int32(me->GetHealth()) - int32(damage)) < CalculatePctF(int32(me->GetMaxHealth()), 2.5f) && !_fightWon) + { + _fightWon = true; + damage = 0; + me->SetReactState(REACT_PASSIVE); + me->AttackStop(); + me->setFaction(35); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + DoCast(me, SPELL_SELF_STUN); + events.Reset(); + summons.DespawnAll(); + events.SetPhase(PHASE_ROLE_PLAY); + events.ScheduleEvent(EVENT_OUTRO_START, 1500); + events.ScheduleEvent(EVENT_OUTRO_1, 7200); + events.ScheduleEvent(EVENT_OUTRO_2, 8700); + } + } + + void UpdateAI(uint32 const diff) + { + if ((!(events.GetPhaseMask() & PHASE_MASK_NO_UPDATE) && !UpdateVictim()) || !CheckInRoom()) + return; + + events.Update(diff); + + if (!(events.GetPhaseMask() & PHASE_MASK_NO_CAST_CHECK)) + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_INTRO_1: + me->RemoveAurasDueToSpell(SPELL_RIDE_THE_LIGHTNING); + Talk(SAY_ALGALON_INTRO_1); + break; + case EVENT_INTRO_2: + DoCastAOE(SPELL_SUMMON_AZEROTH, true); + Talk(SAY_ALGALON_INTRO_2); + break; + case EVENT_INTRO_3: + Talk(SAY_ALGALON_INTRO_3); + break; + case EVENT_INTRO_FINISH: + events.Reset(); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); + break; + case EVENT_START_COMBAT: + instance->SetBossState(BOSS_ALGALON, IN_PROGRESS); + break; + case EVENT_INTRO_TIMER_DONE: + { + events.SetPhase(PHASE_NORMAL); + me->SetSheath(SHEATH_STATE_MELEE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetReactState(REACT_DEFENSIVE); + DoCastAOE(SPELL_SUPERMASSIVE_FAIL, true); + //! Workaround for Creature::_IsTargetAcceptable returning false + //! for creatures that start combat in REACT_PASSIVE and UNIT_FLAG_NOT_SELECTABLE + //! causing them to immediately evade + if (!me->getThreatManager().isThreatListEmpty()) + AttackStart(me->getThreatManager().getHostilTarget()); + for (uint32 i = 0; i < LIVING_CONSTELLATION_COUNT; ++i) + if (Creature* summon = DoSummon(NPC_LIVING_CONSTELLATION, ConstellationPos[i], 0, TEMPSUMMON_DEAD_DESPAWN)) + summon->SetReactState(REACT_PASSIVE); + + std::list stalkers; + me->GetCreatureListWithEntryInGrid(stalkers, NPC_ALGALON_STALKER, 200.0f); + if (!stalkers.empty()) + { + Unit* stalker = Trinity::Containers::SelectRandomContainerElement(stalkers); + stalker->m_Events.AddEvent(new ActivateLivingConstellation(stalker), stalker->m_Events.CalculateTime(urand(45000, 50000))); + } + break; + } + case EVENT_QUANTUM_STRIKE: + DoCastVictim(SPELL_QUANTUM_STRIKE); + events.ScheduleEvent(EVENT_QUANTUM_STRIKE, urand(3000, 5000)); + break; + case EVENT_PHASE_PUNCH: + DoCastVictim(SPELL_PHASE_PUNCH); + events.ScheduleEvent(EVENT_PHASE_PUNCH, 15500); + break; + case EVENT_SUMMON_COLLAPSING_STAR: + Talk(SAY_ALGALON_COLLAPSING_STAR); + Talk(EMOTE_ALGALON_COLLAPSING_STAR); + for (uint32 i = 0; i < COLLAPSING_STAR_COUNT; ++i) + me->SummonCreature(NPC_COLLAPSING_STAR, CollapsingStarPos[i], TEMPSUMMON_CORPSE_DESPAWN); + events.ScheduleEvent(EVENT_SUMMON_COLLAPSING_STAR, 60000); + break; + case EVENT_BIG_BANG: + { + Talk(SAY_ALGALON_BIG_BANG); + Talk(EMOTE_ALGALON_BIG_BANG); + events.SetPhase(PHASE_BIG_BANG); + std::list constellations; + me->GetCreatureListWithEntryInGrid(constellations, NPC_LIVING_CONSTELLATION, 200.0f); + for (std::list::iterator itr = constellations.begin(); itr != constellations.end(); ++itr) + (*itr)->AI()->DoAction(ACTION_BIG_BANG); + DoCastAOE(SPELL_BIG_BANG); + events.ScheduleEvent(EVENT_BIG_BANG, 90500); + events.ScheduleEvent(EVENT_RESUME_UPDATING, 9500); + break; + } + case EVENT_RESUME_UPDATING: + events.SetPhase(0); + break; + case EVENT_ASCEND_TO_THE_HEAVENS: + Talk(SAY_ALGALON_ASCEND); + DoCastAOE(SPELL_ASCEND_TO_THE_HEAVENS); + events.ScheduleEvent(EVENT_EVADE, 2500); + break; + case EVENT_EVADE: + EnterEvadeMode(); + break; + case EVENT_COSMIC_SMASH: + Talk(EMOTE_ALGALON_COSMIC_SMASH); + DoCastAOE(SPELL_COSMIC_SMASH); + events.ScheduleEvent(EVENT_COSMIC_SMASH, 25500); + break; + case EVENT_UNLOCK_YELL: + _hasYelled = false; + break; + case EVENT_OUTRO_START: + instance->SetBossState(BOSS_ALGALON, DONE); + break; + case EVENT_OUTRO_1: + me->RemoveAllAuras(); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_RENAME); + break; + case EVENT_OUTRO_2: + _EnterEvadeMode(); + me->AddUnitState(UNIT_STATE_EVADE); + me->GetMotionMaster()->MovePoint(POINT_ALGALON_OUTRO, AlgalonOutroPos); + break; + case EVENT_OUTRO_3: + DoCastAOE(SPELL_KILL_CREDIT); + break; + case EVENT_OUTRO_4: + DoCastAOE(SPELL_SUPERMASSIVE_FAIL); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + break; + case EVENT_OUTRO_5: + if (Creature* brann = DoSummon(NPC_BRANN_BRONZBEARD_ALG, BrannOutroPos[0], 131500, TEMPSUMMON_TIMED_DESPAWN)) + brann->AI()->DoAction(ACTION_OUTRO); + break; + case EVENT_OUTRO_6: + Talk(SAY_ALGALON_OUTRO_1); + me->SetStandState(UNIT_STAND_STATE_KNEEL); + break; + case EVENT_OUTRO_7: + Talk(SAY_ALGALON_OUTRO_2); + break; + case EVENT_OUTRO_8: + Talk(SAY_ALGALON_OUTRO_3); + break; + case EVENT_OUTRO_9: + Talk(SAY_ALGALON_OUTRO_4); + break; + case EVENT_OUTRO_10: + Talk(SAY_ALGALON_OUTRO_5); + break; + case EVENT_OUTRO_11: + me->SetStandState(UNIT_STAND_STATE_STAND); + DoCast(me, SPELL_TELEPORT); + me->DespawnOrUnsummon(1500); + break; + } + } + + DoMeleeAttackIfReady(); + } + + private: + bool _firstPull; + bool _fedOnTears; + bool _phaseTwo; + bool _fightWon; + bool _hasYelled; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return GetUlduarAI(creature); + } +}; + +class npc_living_constellation : public CreatureScript +{ + public: + npc_living_constellation() : CreatureScript("npc_living_constellation") { } + + struct npc_living_constellationAI : public CreatureAI + { + npc_living_constellationAI(Creature* creature) : CreatureAI(creature) + { + } + + void Reset() + { + _events.Reset(); + _events.ScheduleEvent(EVENT_ARCANE_BARRAGE, 2500); + _isActive = false; + } + + uint32 GetData(uint32 /*type*/) + { + return _isActive ? 1 : 0; + } + + void DoAction(int32 const action) + { + switch (action) + { + case ACTION_ACTIVATE_STAR: + if (Creature* algalon = me->FindNearestCreature(NPC_ALGALON, 200.0f)) + { + if (Unit* target = algalon->AI()->SelectTarget(SELECT_TARGET_RANDOM, 0, NonTankTargetSelector(algalon))) + { + me->SetReactState(REACT_AGGRESSIVE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + AttackStart(target); + DoZoneInCombat(); + _isActive = true; + } + } + break; + case ACTION_BIG_BANG: + _events.SetPhase(PHASE_BIG_BANG); + _events.DelayEvents(9500); + _events.ScheduleEvent(EVENT_RESUME_UPDATING, 9500); + break; + } + } + + void SpellHit(Unit* caster, SpellInfo const* spell) + { + if (spell->Id != SPELL_CONSTELLATION_PHASE_EFFECT || caster->GetTypeId() != TYPEID_UNIT) + return; + + me->DespawnOrUnsummon(1); + if (InstanceScript* instance = me->GetInstanceScript()) + instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, EVENT_ID_SUPERMASSIVE_START); + caster->CastSpell((Unit*)NULL, SPELL_BLACK_HOLE_CREDIT, TRIGGERED_FULL_MASK); + caster->ToCreature()->DespawnOrUnsummon(1); + } + + void UpdateAI(uint32 const diff) + { + if (!(_events.GetPhaseMask() & PHASE_MASK_NO_UPDATE) && !UpdateVictim()) + return; + + _events.Update(diff); + + while (uint32 eventId = _events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_ARCANE_BARRAGE: + DoCastAOE(SPELL_ARCANE_BARRAGE); + _events.ScheduleEvent(EVENT_ARCANE_BARRAGE, 2500); + break; + case EVENT_RESUME_UPDATING: + _events.SetPhase(0); + break; + } + } + } + + private: + EventMap _events; + bool _isActive; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return GetUlduarAI(creature); + } +}; + +class npc_collapsing_star : public CreatureScript +{ + public: + npc_collapsing_star() : CreatureScript("npc_collapsing_star") { } + + struct npc_collapsing_starAI : public PassiveAI + { + npc_collapsing_starAI(Creature* creature) : PassiveAI(creature) + { + _dying = false; + } + + void JustSummoned(Creature* summon) + { + if (summon->GetEntry() != NPC_BLACK_HOLE) + return; + + if (TempSummon* summ = me->ToTempSummon()) + if (Creature* algalon = ObjectAccessor::GetCreature(*me, summ->GetSummonerGUID())) + algalon->AI()->JustSummoned(summon); + + me->DespawnOrUnsummon(1); + } + + void DamageTaken(Unit* /*attacker*/, uint32& damage) + { + if (_dying) + { + damage = 0; + return; + } + + if (damage >= me->GetHealth()) + { + _dying = true; + damage = 0; + DoCast(me, SPELL_BLACK_HOLE_SPAWN_VISUAL, true); + DoCast(me, SPELL_SUMMON_BLACK_HOLE, true); + } + } + + bool _dying; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return GetUlduarAI(creature); + } +}; + +class npc_brann_bronzebeard_algalon : public CreatureScript +{ + public: + npc_brann_bronzebeard_algalon() : CreatureScript("npc_brann_bronzebeard_algalon") { } + + struct npc_brann_bronzebeard_algalonAI : public CreatureAI + { + npc_brann_bronzebeard_algalonAI(Creature* creature) : CreatureAI(creature) + { + } + + void DoAction(int32 const action) + { + switch (action) + { + case ACTION_START_INTRO: + _currentPoint = 0; + _events.Reset(); + me->SetWalk(false); + _events.ScheduleEvent(EVENT_BRANN_MOVE_INTRO, 1); + break; + case ACTION_FINISH_INTRO: + Talk(SAY_BRANN_ALGALON_INTRO_2); + _events.ScheduleEvent(EVENT_BRANN_MOVE_INTRO, 1); + break; + case ACTION_OUTRO: + me->GetMotionMaster()->MovePoint(POINT_BRANN_OUTRO, BrannOutroPos[1]); + _events.ScheduleEvent(EVENT_BRANN_OUTRO_1, 89500); + _events.ScheduleEvent(EVENT_BRANN_OUTRO_2, 116500); + break; + } + } + + void MovementInform(uint32 movementType, uint32 pointId) + { + if (movementType != POINT_MOTION_TYPE) + return; + + uint32 delay = 1; + _currentPoint = pointId + 1; + switch (pointId) + { + case 2: + delay = 8000; + me->SetWalk(true); + break; + case 5: + me->SetWalk(false); + Talk(SAY_BRANN_ALGALON_INTRO_1); + _events.ScheduleEvent(EVENT_SUMMON_ALGALON, 7500); + return; + case 9: + me->DespawnOrUnsummon(1); + return; + case POINT_BRANN_OUTRO: + case POINT_BRANN_OUTRO_END: + return; + } + + _events.ScheduleEvent(EVENT_BRANN_MOVE_INTRO, delay); + } + + void UpdateAI(uint32 const diff) + { + UpdateVictim(); + + if (_events.Empty()) + return; + + _events.Update(diff); + + while (uint32 eventId = _events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_BRANN_MOVE_INTRO: + if (_currentPoint < MAX_BRANN_WAYPOINTS_INTRO) + me->GetMotionMaster()->MovePoint(_currentPoint, BrannIntroWaypoint[_currentPoint]); + break; + case EVENT_SUMMON_ALGALON: + if (Creature* algalon = me->GetMap()->SummonCreature(NPC_ALGALON, AlgalonSummonPos)) + algalon->AI()->DoAction(ACTION_START_INTRO); + break; + case EVENT_BRANN_OUTRO_1: + Talk(SAY_BRANN_ALGALON_OUTRO); + break; + case EVENT_BRANN_OUTRO_2: + me->GetMotionMaster()->MovePoint(POINT_BRANN_OUTRO_END, BrannOutroPos[2]); + break; + } + } + } + + private: + EventMap _events; + uint32 _currentPoint; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return GetUlduarAI(creature); + } +}; + +class go_celestial_planetarium_access : public GameObjectScript +{ + public: + go_celestial_planetarium_access() : GameObjectScript("go_celestial_planetarium_access") {} + + struct go_celestial_planetarium_accessAI : public GameObjectAI + { + go_celestial_planetarium_accessAI(GameObject* go) : GameObjectAI(go) + { + } + + bool GossipHello(Player* player) + { + bool hasKey = true; + if (LockEntry const* lock = sLockStore.LookupEntry(go->GetGOInfo()->goober.lockId)) + { + hasKey = false; + for (uint32 i = 0; i < MAX_LOCK_CASE; ++i) + { + if (!lock->Index[i]) + continue; + + if (player->HasItemCount(lock->Index[i], 1)) + { + hasKey = true; + break; + } + } + } + + if (!hasKey) + return false; + + // Start Algalon event + go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE); + _events.ScheduleEvent(EVENT_DESPAWN_CONSOLE, 5000); + if (Creature* brann = go->SummonCreature(NPC_BRANN_BRONZBEARD_ALG, BrannIntroSpawnPos)) + brann->AI()->DoAction(ACTION_START_INTRO); + + if (InstanceScript* instance = go->GetInstanceScript()) + { + instance->SetData(DATA_ALGALON_SUMMON_STATE, 1); + if (GameObject* sigil = ObjectAccessor::GetGameObject(*go, instance->GetData64(DATA_SIGILDOOR_01))) + sigil->SetGoState(GO_STATE_ACTIVE); + + if (GameObject* sigil = ObjectAccessor::GetGameObject(*go, instance->GetData64(DATA_SIGILDOOR_02))) + sigil->SetGoState(GO_STATE_ACTIVE); + } + + return false; + } + + void UpdateAI(uint32 diff) + { + if (_events.Empty()) + return; + + _events.Update(diff); + + while (uint32 eventId = _events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_DESPAWN_CONSOLE: + go->Delete(); + break; + } + } + } + + EventMap _events; + }; + + GameObjectAI* GetAI(GameObject* go) const + { + return GetUlduarAI(go); + } +}; + +class spell_algalon_phase_punch : public SpellScriptLoader +{ + public: + spell_algalon_phase_punch() : SpellScriptLoader("spell_algalon_phase_punch") { } + + class spell_algalon_phase_punch_AuraScript : public AuraScript + { + PrepareAuraScript(spell_algalon_phase_punch_AuraScript); + + void HandlePeriodic(AuraEffect const* /*aurEff*/) + { + PreventDefaultAction(); + if (GetStackAmount() != 1) + GetTarget()->RemoveAurasDueToSpell(PhasePunchAlphaId[GetStackAmount() - 2]); + GetTarget()->CastSpell(GetTarget(), PhasePunchAlphaId[GetStackAmount() - 1], TRIGGERED_FULL_MASK); + if (GetStackAmount() == 5) + Remove(AURA_REMOVE_BY_DEFAULT); + } + + void OnRemove(AuraEffect const*, AuraEffectHandleModes) + { + if (GetStackAmount() != 5) + GetTarget()->RemoveAurasDueToSpell(PhasePunchAlphaId[GetStackAmount() - 1]); + } + + void Register() + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_algalon_phase_punch_AuraScript::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); + OnEffectRemove += AuraEffectRemoveFn(spell_algalon_phase_punch_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_algalon_phase_punch_AuraScript(); + } +}; + +class NotVictimFilter +{ + public: + NotVictimFilter(Unit* caster) : _victim(caster->getVictim()) + { + } + + bool operator()(Unit* target) + { + return target != _victim; + } + + private: + Unit* _victim; +}; + +class spell_algalon_arcane_barrage : public SpellScriptLoader +{ + public: + spell_algalon_arcane_barrage() : SpellScriptLoader("spell_algalon_arcane_barrage") { } + + class spell_algalon_arcane_barrage_SpellScript : public SpellScript + { + PrepareSpellScript(spell_algalon_arcane_barrage_SpellScript); + + void SelectTarget(std::list& targets) + { + targets.remove_if(NotVictimFilter(GetCaster())); + } + + void Register() + { + OnUnitTargetSelect += SpellUnitTargetFn(spell_algalon_arcane_barrage_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_algalon_arcane_barrage_SpellScript(); + } +}; + +class ActiveConstellationFilter +{ + public: + bool operator()(Unit* target) const + { + return target->GetAI()->GetData(0); + } +}; + +class spell_algalon_trigger_3_adds : public SpellScriptLoader +{ + public: + spell_algalon_trigger_3_adds() : SpellScriptLoader("spell_algalon_trigger_3_adds") { } + + class spell_algalon_trigger_3_adds_SpellScript : public SpellScript + { + PrepareSpellScript(spell_algalon_trigger_3_adds_SpellScript); + + void SelectTarget(std::list& targets) + { + targets.remove_if(ActiveConstellationFilter()); + } + + void HandleDummy(SpellEffIndex effIndex) + { + PreventHitDefaultEffect(effIndex); + Creature* target = GetHitCreature(); + if (!target) + return; + + target->AI()->DoAction(ACTION_ACTIVATE_STAR); + } + + void Register() + { + OnUnitTargetSelect += SpellUnitTargetFn(spell_algalon_trigger_3_adds_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_algalon_trigger_3_adds_SpellScript(); + } +}; + +class spell_algalon_collapse : public SpellScriptLoader +{ + public: + spell_algalon_collapse() : SpellScriptLoader("spell_algalon_collapse") { } + + class spell_algalon_collapse_AuraScript : public AuraScript + { + PrepareAuraScript(spell_algalon_collapse_AuraScript); + + void HandlePeriodic(AuraEffect const* /*aurEff*/) + { + PreventDefaultAction(); + GetTarget()->DealDamage(GetTarget(), GetTarget()->CountPctFromMaxHealth(1), NULL, NODAMAGE); + } + + void Register() + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_algalon_collapse_AuraScript::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_algalon_collapse_AuraScript(); + } +}; + +class spell_algalon_big_bang : public SpellScriptLoader +{ + public: + spell_algalon_big_bang() : SpellScriptLoader("spell_algalon_big_bang") { } + + class spell_algalon_big_bang_SpellScript : public SpellScript + { + PrepareSpellScript(spell_algalon_big_bang_SpellScript); + + bool Load() + { + _targetCount = 0; + return true; + } + + void CountTargets(std::list& targets) + { + _targetCount = targets.size(); + } + + void CheckTargets() + { + if (!_targetCount) + GetCaster()->GetAI()->DoAction(ACTION_ASCEND); + } + + void Register() + { + OnUnitTargetSelect += SpellUnitTargetFn(spell_algalon_big_bang_SpellScript::CountTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + AfterCast += SpellCastFn(spell_algalon_big_bang_SpellScript::CheckTargets); + } + + uint32 _targetCount; + }; + + SpellScript* GetSpellScript() const + { + return new spell_algalon_big_bang_SpellScript(); + } +}; + +class spell_algalon_remove_phase : public SpellScriptLoader +{ + public: + spell_algalon_remove_phase() : SpellScriptLoader("spell_algalon_remove_phase") { } + + class spell_algalon_remove_phase_AuraScript : public AuraScript + { + PrepareAuraScript(spell_algalon_remove_phase_AuraScript); + + void HandlePeriodic(AuraEffect const* /*aurEff*/) + { + PreventDefaultAction(); + GetTarget()->RemoveAurasByType(SPELL_AURA_PHASE); + } + + void Register() + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_algalon_remove_phase_AuraScript::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_algalon_remove_phase_AuraScript(); + } +}; + +class spell_algalon_cosmic_smash : public SpellScriptLoader +{ + public: + spell_algalon_cosmic_smash() : SpellScriptLoader("spell_algalon_cosmic_smash") { } + + class spell_algalon_cosmic_smash_SpellScript : public SpellScript + { + PrepareSpellScript(spell_algalon_cosmic_smash_SpellScript); + + void ModDestHeight(SpellEffIndex /*effIndex*/) + { + Position offset = {0.0f, 0.0f, 65.0f, 0.0f}; + const_cast(GetExplTargetDest())->RelocateOffset(offset); + GetHitDest()->RelocateOffset(offset); + } + + void Register() + { + OnEffectLaunch += SpellEffectFn(spell_algalon_cosmic_smash_SpellScript::ModDestHeight, EFFECT_0, SPELL_EFFECT_SUMMON); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_algalon_cosmic_smash_SpellScript(); + } +}; + +class spell_algalon_cosmic_smash_damage : public SpellScriptLoader +{ + public: + spell_algalon_cosmic_smash_damage() : SpellScriptLoader("spell_algalon_cosmic_smash_damage") { } + + class spell_algalon_cosmic_smash_damage_SpellScript : public SpellScript + { + PrepareSpellScript(spell_algalon_cosmic_smash_damage_SpellScript); + + void RecalculateDamage() + { + if (!GetExplTargetDest() || !GetHitUnit()) + return; + + float distance = GetHitUnit()->GetDistance2d(GetExplTargetDest()->GetPositionX(), GetExplTargetDest()->GetPositionY()); + if (distance > 6.0f) + SetHitDamage(int32(float(GetHitDamage()) / distance) * 2); + } + + void Register() + { + OnHit += SpellHitFn(spell_algalon_cosmic_smash_damage_SpellScript::RecalculateDamage); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_algalon_cosmic_smash_damage_SpellScript(); + } +}; + +class spell_algalon_supermassive_fail : public SpellScriptLoader +{ + public: + spell_algalon_supermassive_fail() : SpellScriptLoader("spell_algalon_supermassive_fail") { } + + class spell_algalon_supermassive_fail_SpellScript : public SpellScript + { + PrepareSpellScript(spell_algalon_supermassive_fail_SpellScript); + + void RecalculateDamage() + { + if (!GetHitPlayer()) + return; + + GetHitPlayer()->GetAchievementMgr().ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, ACHIEVEMENT_CRITERIA_CONDITION_NO_SPELL_HIT, GetSpellInfo()->Id, true); + } + + void Register() + { + OnHit += SpellHitFn(spell_algalon_supermassive_fail_SpellScript::RecalculateDamage); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_algalon_supermassive_fail_SpellScript(); + } +}; + +class achievement_he_feeds_on_your_tears : public AchievementCriteriaScript +{ + public: + achievement_he_feeds_on_your_tears() : AchievementCriteriaScript("achievement_he_feeds_on_your_tears") { } + + bool OnCheck(Player* /*source*/, Unit* target) + { + return !target->GetAI()->GetData(DATA_HAS_FED_ON_TEARS); + } +}; + +void AddSC_boss_algalon_the_observer() +{ + new boss_algalon_the_observer(); + new npc_living_constellation(); + new npc_collapsing_star(); + new npc_brann_bronzebeard_algalon(); + new go_celestial_planetarium_access(); + new spell_algalon_phase_punch(); + new spell_algalon_arcane_barrage(); + new spell_algalon_trigger_3_adds(); + new spell_algalon_collapse(); + new spell_algalon_big_bang(); + new spell_algalon_remove_phase(); + new spell_algalon_cosmic_smash(); + new spell_algalon_cosmic_smash_damage(); + new spell_algalon_supermassive_fail(); + new achievement_he_feeds_on_your_tears(); +} diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp index eadc524348b..0967c38c2e7 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp @@ -251,7 +251,7 @@ class boss_steelbreaker : public CreatureScript } } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { DoScriptText(RAND(SAY_STEELBREAKER_DEATH_1, SAY_STEELBREAKER_DEATH_2), me); if (IsEncounterComplete(instance, me)) @@ -375,7 +375,7 @@ class boss_runemaster_molgeim : public CreatureScript } } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { DoScriptText(RAND(SAY_MOLGEIM_DEATH_1, SAY_MOLGEIM_DEATH_2), me); if (IsEncounterComplete(instance, me)) @@ -575,7 +575,7 @@ class boss_stormcaller_brundir : public CreatureScript _Reset(); phase = 0; me->RemoveAllAuras(); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetDisableGravity(false); me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_INTERRUPT, false); // Should be interruptable unless overridden by spell (Overload) me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_STUN, false); // Reset immumity, Brundir should be stunnable by default RespawnEncounter(instance, me); @@ -616,7 +616,7 @@ class boss_stormcaller_brundir : public CreatureScript } } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { DoScriptText(RAND(SAY_BRUNDIR_DEATH_1, SAY_BRUNDIR_DEATH_2), me); if (IsEncounterComplete(instance, me)) @@ -681,7 +681,7 @@ class boss_stormcaller_brundir : public CreatureScript DoCast(RAID_MODE(SPELL_LIGHTNING_TENDRILS_10M, SPELL_LIGHTNING_TENDRILS_25M)); DoCast(SPELL_LIGHTNING_TENDRILS_VISUAL); me->AttackStop(); - //me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + //me->SetLevitate(true); me->GetMotionMaster()->Initialize(); me->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), FINAL_FLIGHT_Z); events.DelayEvents(35000); @@ -708,7 +708,7 @@ class boss_stormcaller_brundir : public CreatureScript events.ScheduleEvent(EVENT_GROUND, 2500); break; case EVENT_GROUND: - //me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + //me->SetLevitate(false); me->RemoveAurasDueToSpell(RAID_MODE(SPELL_LIGHTNING_TENDRILS_10M, SPELL_LIGHTNING_TENDRILS_25M)); me->RemoveAurasDueToSpell(SPELL_LIGHTNING_TENDRILS_VISUAL); DoStartMovement(me->getVictim()); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp index 1c478cd83e9..472ff153d73 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp @@ -204,7 +204,7 @@ class boss_auriaya : public CreatureScript } } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); _JustDied(); @@ -298,14 +298,14 @@ class npc_auriaya_seeping_trigger : public CreatureScript void Reset() { - me->ForcedDespawn(600000); + me->DespawnOrUnsummon(600000); DoCast(me, SPELL_SEEPING_ESSENCE); } void UpdateAI(uint32 const /*diff*/) { if (instance->GetBossState(BOSS_AURIAYA) != IN_PROGRESS) - me->ForcedDespawn(); + me->DespawnOrUnsummon(); } private: @@ -376,7 +376,7 @@ class npc_sanctum_sentry : public CreatureScript DoMeleeAttackIfReady(); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (Creature* Auriaya = ObjectAccessor::GetCreature(*me, instance->GetData64(BOSS_AURIAYA))) Auriaya->AI()->DoAction(ACTION_CRAZY_CAT_LADY); @@ -451,7 +451,7 @@ class npc_feral_defender : public CreatureScript DoMeleeAttackIfReady(); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { DoCast(me, SPELL_SUMMON_ESSENCE); if (Creature* Auriaya = ObjectAccessor::GetCreature(*me, instance->GetData64(BOSS_AURIAYA))) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp index c4f973726bc..0e453eceaa1 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp @@ -26,6 +26,10 @@ #include "ScriptedCreature.h" #include "ScriptedGossip.h" #include "ScriptedEscortAI.h" +#include "Cell.h" +#include "CellImpl.h" +#include "GridNotifiers.h" +#include "GridNotifiersImpl.h" #include "CombatAI.h" #include "PassiveAI.h" #include "ObjectMgr.h" @@ -167,7 +171,7 @@ enum Yells enum MiscellanousData { - // Other actions are in Ulduar.h + // Other Actions are in Ulduar.h ACTION_START_HARD_MODE = 5, ACTION_SPAWN_VEHICLES = 6, // Amount of seats depending on Raid mode @@ -324,7 +328,7 @@ class boss_flame_leviathan : public CreatureScript DoScriptText(SAY_AGGRO, me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { _JustDied(); // Set Field Flags 67108928 = 64 | 67108864 = UNIT_FLAG_UNK_6 | UNIT_FLAG_SKINNABLE @@ -573,7 +577,7 @@ class boss_flame_leviathan_seat : public CreatureScript { ASSERT(vehicle); me->SetReactState(REACT_PASSIVE); - me->SetDisplayId(me->GetCreatureInfo()->Modelid2); + me->SetDisplayId(me->GetCreatureTemplate()->Modelid2); instance = creature->GetInstanceScript(); } @@ -639,7 +643,7 @@ class boss_flame_leviathan_defense_cannon : public CreatureScript uint32 NapalmTimer; - void Reset () + void Reset() { NapalmTimer = 5*IN_MILLISECONDS; DoCast(me, AURA_STEALTH_DETECTION); @@ -883,7 +887,7 @@ class npc_colossus : public CreatureScript InstanceScript* instance; - void JustDied(Unit* /*Who*/) + void JustDied(Unit* /*killer*/) { if (me->GetHomePosition().IsInDist(Center, 50.f)) instance->SetData(DATA_COLOSSUS, instance->GetData(DATA_COLOSSUS)+1); @@ -960,8 +964,9 @@ public: me->SetReactState(REACT_PASSIVE); } - void WaypointReached(uint32 /*i*/) + void WaypointReached(uint32 /*waypointId*/) { + } void Reset() @@ -1151,7 +1156,7 @@ class npc_lorekeeper : public CreatureScript } }; - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 action) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); InstanceScript* instance = creature->GetInstanceScript(); @@ -1224,10 +1229,10 @@ class npc_brann_bronzebeard : public CreatureScript public: npc_brann_bronzebeard() : CreatureScript("npc_brann_bronzebeard") { } - //bool OnGossipSelect(Player* player, Creature* creature, uint32 uiSender, uint32 uiAction) + //bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action) //{ // player->PlayerTalkClass->ClearMenus(); - // switch(uiAction) + // switch(action) // { // case GOSSIP_ACTION_INFO_DEF+1: // if (player) @@ -1268,7 +1273,7 @@ class go_ulduar_tower : public GameObjectScript public: go_ulduar_tower() : GameObjectScript("go_ulduar_tower") { } - void OnDestroyed(GameObject* go, Player* /*player*/, uint32 /*value*/) + void OnDestroyed(GameObject* go, Player* /*player*/) { InstanceScript* instance = go->GetInstanceScript(); if (!instance) @@ -1673,7 +1678,7 @@ class spell_pursue : public SpellScriptLoader else { //! In the end, only one target should be selected - _target = SelectRandomContainerElement(targets); + _target = Trinity::Containers::SelectRandomContainerElement(targets); FilterTargetsSubsequently(targets); } } @@ -1681,7 +1686,7 @@ class spell_pursue : public SpellScriptLoader void FilterTargetsSubsequently(std::list& targets) { targets.clear(); - if(_target) + if (_target) targets.push_back(_target); } @@ -1738,7 +1743,7 @@ class spell_vehicle_throw_passenger : public SpellScriptLoader { // use 99 because it is 3d search std::list targetList; - Trinity::WorldObjectSpellAreaTargetCheck check(99, GetTargetDest(), GetCaster(), GetCaster(), GetSpellInfo(), TARGET_CHECK_DEFAULT, NULL); + Trinity::WorldObjectSpellAreaTargetCheck check(99, GetExplTargetDest(), GetCaster(), GetCaster(), GetSpellInfo(), TARGET_CHECK_DEFAULT, NULL); Trinity::WorldObjectListSearcher searcher(GetCaster(), targetList, check); GetCaster()->GetMap()->VisitAll(GetCaster()->m_positionX, GetCaster()->m_positionY, 99, searcher); float minDist = 99 * 99; @@ -1752,7 +1757,7 @@ class spell_vehicle_throw_passenger : public SpellScriptLoader if (Unit* device = seat->GetPassenger(2)) if (!device->GetCurrentSpell(CURRENT_CHANNELED_SPELL)) { - float dist = unit->GetExactDistSq(targets.GetDst()); + float dist = unit->GetExactDistSq(targets.GetDstPos()); if (dist < minDist) { minDist = dist; @@ -1760,13 +1765,13 @@ class spell_vehicle_throw_passenger : public SpellScriptLoader } } } - if (target && target->IsWithinDist2d(targets.GetDst(), GetSpellInfo()->Effects[effIndex].CalcRadius() * 2)) // now we use *2 because the location of the seat is not correct + if (target && target->IsWithinDist2d(targets.GetDstPos(), GetSpellInfo()->Effects[effIndex].CalcRadius() * 2)) // now we use *2 because the location of the seat is not correct passenger->EnterVehicle(target, 0); else { passenger->ExitVehicle(); float x, y, z; - targets.GetDst()->GetPosition(x, y, z); + targets.GetDstPos()->GetPosition(x, y, z); passenger->GetMotionMaster()->MoveJump(x, y, z, targets.GetSpeedXY(), targets.GetSpeedZ()); } } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp index 159e2a9702b..a3c9cb847e5 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp @@ -245,7 +245,7 @@ class npc_iron_roots : public CreatureScript me->SetInCombatWith(summoner); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (Player* target = ObjectAccessor::GetPlayer(*me, summonerGUID)) { @@ -507,7 +507,7 @@ class boss_freya : public CreatureScript for (uint8 n = 0; n < 3; ++n) { summons.remove(Elemental[n][i]->GetGUID()); - Elemental[n][i]->ForcedDespawn(5000); + Elemental[n][i]->DespawnOrUnsummon(5000); trioDefeated[i] = true; Elemental[n][i]->CastSpell(me, SPELL_REMOVE_10STACK, true); } @@ -590,7 +590,7 @@ class boss_freya : public CreatureScript waveCount++; } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { //! Freya's chest is dynamically spawned on death by different spells. const uint32 summonSpell[2][4] = @@ -664,12 +664,12 @@ class boss_freya : public CreatureScript case NPC_DETONATING_LASHER: summoned->CastSpell(me, SPELL_REMOVE_2STACK, true); summoned->CastSpell(who, SPELL_DETONATE, true); - summoned->ForcedDespawn(5000); + summoned->DespawnOrUnsummon(5000); summons.remove(summoned->GetGUID()); break; case NPC_ANCIENT_CONSERVATOR: summoned->CastSpell(me, SPELL_REMOVE_25STACK, true); - summoned->ForcedDespawn(5000); + summoned->DespawnOrUnsummon(5000); summons.remove(summoned->GetGUID()); break; } @@ -710,12 +710,12 @@ class boss_elder_brightleaf : public CreatureScript DoScriptText(RAND(SAY_BRIGHTLEAF_SLAY_1, SAY_BRIGHTLEAF_SLAY_2), me); } - void JustDied(Unit* who) + void JustDied(Unit* killer) { _JustDied(); DoScriptText(SAY_BRIGHTLEAF_DEATH, me); - if (who && who->GetTypeId() == TYPEID_PLAYER) + if (killer && killer->GetTypeId() == TYPEID_PLAYER) { if (Creature* Ironbranch = ObjectAccessor::GetCreature(*me, instance->GetData64(BOSS_IRONBRANCH))) Ironbranch->AI()->DoAction(ACTION_ELDER_DEATH); @@ -830,12 +830,12 @@ class boss_elder_stonebark : public CreatureScript DoScriptText(RAND(SAY_STONEBARK_SLAY_1, SAY_STONEBARK_SLAY_2), me); } - void JustDied(Unit* who) + void JustDied(Unit* killer) { _JustDied(); DoScriptText(SAY_STONEBARK_DEATH, me); - if (who && who->GetTypeId() == TYPEID_PLAYER) + if (killer && killer->GetTypeId() == TYPEID_PLAYER) { if (Creature* Ironbranch = ObjectAccessor::GetCreature(*me, instance->GetData64(BOSS_IRONBRANCH))) Ironbranch->AI()->DoAction(ACTION_ELDER_DEATH); @@ -956,12 +956,12 @@ class boss_elder_ironbranch : public CreatureScript DoScriptText(RAND(SAY_IRONBRANCH_SLAY_1, SAY_IRONBRANCH_SLAY_2), me); } - void JustDied(Unit* who) + void JustDied(Unit* killer) { _JustDied(); DoScriptText(SAY_IRONBRANCH_DEATH, me); - if (who && who->GetTypeId() == TYPEID_PLAYER) + if (killer && killer->GetTypeId() == TYPEID_PLAYER) { if (Creature* Brightleaf = ObjectAccessor::GetCreature(*me, instance->GetData64(BOSS_BRIGHTLEAF))) Brightleaf->AI()->DoAction(ACTION_ELDER_DEATH); @@ -1138,7 +1138,7 @@ class npc_ancient_water_spirit : public CreatureScript DoMeleeAttackIfReady(); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (Creature* Freya = ObjectAccessor::GetCreature(*me, instance->GetData64(BOSS_FREYA))) { @@ -1204,7 +1204,7 @@ class npc_storm_lasher : public CreatureScript DoMeleeAttackIfReady(); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (Creature* Freya = ObjectAccessor::GetCreature(*me, instance->GetData64(BOSS_FREYA))) { @@ -1251,7 +1251,7 @@ class npc_snaplasher : public CreatureScript DoMeleeAttackIfReady(); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (Creature* Freya = ObjectAccessor::GetCreature(*me, instance->GetData64(BOSS_FREYA))) { @@ -1385,7 +1385,7 @@ class npc_healthy_spore : public CreatureScript if (lifeTimer <= diff) { me->RemoveAurasDueToSpell(SPELL_GROW); - me->ForcedDespawn(2200); + me->DespawnOrUnsummon(2200); lifeTimer = urand(22000, 30000); } else @@ -1423,7 +1423,7 @@ class npc_eonars_gift : public CreatureScript { me->RemoveAurasDueToSpell(SPELL_GROW); DoCast(SPELL_LIFEBINDERS_GIFT); - me->ForcedDespawn(2500); + me->DespawnOrUnsummon(2500); lifeBindersGiftTimer = 12000; } else diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp index c7918f85245..3556bf188de 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp @@ -211,7 +211,7 @@ class boss_general_vezax : public CreatureScript DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2), me); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { _JustDied(); DoScriptText(SAY_DEATH, me); @@ -290,7 +290,7 @@ class boss_general_vezax : public CreatureScript if (size < playersMin) return NULL; - return SelectRandomContainerElement(PlayerList); + return Trinity::Containers::SelectRandomContainerElement(PlayerList); } return NULL; @@ -323,7 +323,7 @@ class boss_saronite_animus : public CreatureScript events.ScheduleEvent(EVENT_PROFOUND_OF_DARKNESS, 3000); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (Creature* Vezax = me->GetCreature(*me, instance->GetData64(BOSS_VEZAX))) Vezax->AI()->DoAction(ACTION_ANIMUS_DIE); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp index 33f50d0b3de..c9fe1c5b707 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp @@ -179,7 +179,7 @@ class npc_flash_freeze : public CreatureScript npc_flash_freezeAI(Creature* creature) : ScriptedAI(creature) { instance = me->GetInstanceScript(); - me->SetDisplayId(me->GetCreatureInfo()->Modelid2); + me->SetDisplayId(me->GetCreatureTemplate()->Modelid2); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_STUNNED | UNIT_FLAG_PACIFIED); } @@ -246,7 +246,7 @@ class npc_ice_block : public CreatureScript npc_ice_blockAI(Creature* creature) : ScriptedAI(creature) { instance = me->GetInstanceScript(); - me->SetDisplayId(me->GetCreatureInfo()->Modelid2); + me->SetDisplayId(me->GetCreatureTemplate()->Modelid2); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_STUNNED | UNIT_FLAG_PACIFIED); targetGUID = 0; } @@ -512,7 +512,7 @@ class npc_icicle : public CreatureScript { npc_icicleAI(Creature* creature) : ScriptedAI(creature) { - me->SetDisplayId(me->GetCreatureInfo()->Modelid1); + me->SetDisplayId(me->GetCreatureTemplate()->Modelid1); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_PACIFIED | UNIT_FLAG_NOT_SELECTABLE); me->SetReactState(REACT_PASSIVE); } @@ -560,7 +560,7 @@ class npc_snowpacked_icicle : public CreatureScript { npc_snowpacked_icicleAI(Creature* creature) : ScriptedAI(creature) { - me->SetDisplayId(me->GetCreatureInfo()->Modelid2); + me->SetDisplayId(me->GetCreatureTemplate()->Modelid2); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PACIFIED); me->SetReactState(REACT_PASSIVE); } @@ -651,7 +651,7 @@ class npc_hodir_priest : public CreatureScript DoSpellAttackIfReady(SPELL_SMITE); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (Creature* Hodir = ObjectAccessor::GetCreature(*me, instance ? instance->GetData64(BOSS_HODIR) : 0)) Hodir->AI()->DoAction(ACTION_I_HAVE_THE_COOLEST_FRIENDS); @@ -713,7 +713,7 @@ class npc_hodir_shaman : public CreatureScript DoSpellAttackIfReady(SPELL_LAVA_BURST); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (Creature* Hodir = ObjectAccessor::GetCreature(*me, instance ? instance->GetData64(BOSS_HODIR) : 0)) Hodir->AI()->DoAction(ACTION_I_HAVE_THE_COOLEST_FRIENDS); @@ -774,7 +774,7 @@ class npc_hodir_druid : public CreatureScript DoSpellAttackIfReady(SPELL_WRATH); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (Creature* Hodir = ObjectAccessor::GetCreature(*me, instance ? instance->GetData64(BOSS_HODIR) : 0)) Hodir->AI()->DoAction(ACTION_I_HAVE_THE_COOLEST_FRIENDS); @@ -854,7 +854,7 @@ class npc_hodir_mage : public CreatureScript DoSpellAttackIfReady(SPELL_FIREBALL); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (Creature* Hodir = ObjectAccessor::GetCreature(*me, instance ? instance->GetData64(BOSS_HODIR) : 0)) Hodir->AI()->DoAction(ACTION_I_HAVE_THE_COOLEST_FRIENDS); @@ -881,7 +881,7 @@ class npc_toasty_fire : public CreatureScript { npc_toasty_fireAI(Creature* creature) : ScriptedAI(creature) { - me->SetDisplayId(me->GetCreatureInfo()->Modelid2); + me->SetDisplayId(me->GetCreatureTemplate()->Modelid2); } void Reset() diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp index d8a3ef0b8df..540876f421b 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp @@ -148,7 +148,7 @@ class boss_ignis : public CreatureScript instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEVEMENT_IGNIS_START_EVENT); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { _JustDied(); DoScriptText(SAY_DEATH, me); @@ -371,15 +371,15 @@ class npc_scorch_ground : public CreatureScript creature->SetDisplayId(16925); //model 2 in db cannot overwrite wdb fields } - void MoveInLineOfSight(Unit* unit) + void MoveInLineOfSight(Unit* who) { if (!_heat) { - if (unit->GetEntry() == NPC_IRON_CONSTRUCT) + if (who->GetEntry() == NPC_IRON_CONSTRUCT) { - if (!unit->HasAura(SPELL_HEAT) || !unit->HasAura(SPELL_MOLTEN)) + if (!who->HasAura(SPELL_HEAT) || !who->HasAura(SPELL_MOLTEN)) { - _constructGUID = unit->GetGUID(); + _constructGUID = who->GetGUID(); _heat = true; } } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp index d5034e4827e..d89d640b083 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp @@ -135,7 +135,7 @@ class boss_kologarn : public CreatureScript eyebeamTarget = 0; } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); DoCast(SPELL_KOLOGARN_PACIFY); @@ -184,11 +184,8 @@ class boss_kologarn : public CreatureScript if (Creature* rubbleStalker = who->FindNearestCreature(NPC_RUBBLE_STALKER, 70.0f)) { - if (rubbleStalker) - { - rubbleStalker->CastSpell(rubbleStalker, SPELL_FALLING_RUBBLE, true); - rubbleStalker->CastSpell(rubbleStalker, SPELL_SUMMON_RUBBLE, true); - } + rubbleStalker->CastSpell(rubbleStalker, SPELL_FALLING_RUBBLE, true); + rubbleStalker->CastSpell(rubbleStalker, SPELL_SUMMON_RUBBLE, true); } if (!right && !left) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp index 45f9a1fa012..e8e938dc06b 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp @@ -177,7 +177,7 @@ class boss_razorscale_controller : public CreatureScript { boss_razorscale_controllerAI(Creature* creature) : BossAI(creature, DATA_RAZORSCALE_CONTROL) { - me->SetDisplayId(me->GetCreatureInfo()->Modelid2); + me->SetDisplayId(me->GetCreatureTemplate()->Modelid2); } void Reset() @@ -211,7 +211,7 @@ class boss_razorscale_controller : public CreatureScript } } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { _JustDied(); } @@ -330,7 +330,7 @@ class boss_razorscale : public CreatureScript void Reset() { _Reset(); - me->SetFlying(true); + me->SetCanFly(true); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetReactState(REACT_PASSIVE); PermaGround = false; @@ -354,7 +354,7 @@ class boss_razorscale : public CreatureScript events.ScheduleEvent(EVENT_FLIGHT, 0, 0, PHASE_GROUND); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { _JustDied(); if (Creature* controller = ObjectAccessor::GetCreature(*me, instance ? instance->GetData64(DATA_RAZORSCALE_CONTROL) : 0)) @@ -419,7 +419,7 @@ class boss_razorscale : public CreatureScript case EVENT_FLIGHT: phase = PHASE_FLIGHT; events.SetPhase(PHASE_FLIGHT); - me->SetFlying(true); + me->SetCanFly(true); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetReactState(REACT_PASSIVE); me->AttackStop(); @@ -430,7 +430,7 @@ class boss_razorscale : public CreatureScript ++FlyCount; return; case EVENT_LAND: - me->SetFlying(false); + me->SetCanFly(false); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED | UNIT_FLAG_PACIFIED); if (Creature* commander = ObjectAccessor::GetCreature(*me, instance ? instance->GetData64(DATA_EXPEDITION_COMMANDER) : 0)) @@ -524,7 +524,7 @@ class boss_razorscale : public CreatureScript me->MonsterTextEmote(EMOTE_PERMA, 0, true); phase = PHASE_PERMAGROUND; events.SetPhase(PHASE_PERMAGROUND); - me->SetFlying(false); + me->SetCanFly(false); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetReactState(REACT_AGGRESSIVE); me->RemoveAurasDueToSpell(SPELL_HARPOON_TRIGGER); @@ -647,7 +647,7 @@ class npc_expedition_commander : public CreatureScript for (uint8 n = 0; n < RAID_MODE(2, 4); n++) { Engineer[n] = me->SummonCreature(NPC_ENGINEER, PosEngSpawn, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000); - Engineer[n]->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + Engineer[n]->SetWalk(false); Engineer[n]->SetSpeed(MOVE_RUN, 0.5f); Engineer[n]->SetHomePosition(PosEngRepair[n]); Engineer[n]->GetMotionMaster()->MoveTargetedHome(); @@ -660,7 +660,7 @@ class npc_expedition_commander : public CreatureScript for (uint8 n = 0; n < 4; n++) { Defender[n] = me->SummonCreature(NPC_DEFENDER, PosDefSpawn[n], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000); - Defender[n]->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + Defender[n]->SetWalk(false); Defender[n]->SetHomePosition(PosDefCombat[n]); Defender[n]->GetMotionMaster()->MoveTargetedHome(); } @@ -1006,7 +1006,7 @@ class spell_razorscale_devouring_flame : public SpellScriptLoader PreventHitDefaultEffect(effIndex); Unit* caster = GetCaster(); uint32 entry = uint32(GetSpellInfo()->Effects[effIndex].MiscValue); - WorldLocation const* summonLocation = GetTargetDest(); + WorldLocation const* summonLocation = GetExplTargetDest(); if (!caster || !summonLocation) return; diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp index 72741ee0679..084cd3e0f86 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp @@ -73,7 +73,7 @@ public: DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); _JustDied(); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp index 724eb45d586..c7091b42c5a 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp @@ -244,7 +244,7 @@ class boss_xt002 : public CreatureScript DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); _JustDied(); @@ -947,13 +947,19 @@ class spell_xt002_tympanic_tantrum : public SpellScriptLoader void FilterTargets(std::list& unitList) { - unitList.remove_if (PlayerOrPetCheck()); + unitList.remove_if(PlayerOrPetCheck()); + } + + void RecalculateDamage() + { + SetHitDamage(GetHitUnit()->CountPctFromMaxHealth(GetHitDamage())); } void Register() { OnUnitTargetSelect += SpellUnitTargetFn(spell_xt002_tympanic_tantrum_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); OnUnitTargetSelect += SpellUnitTargetFn(spell_xt002_tympanic_tantrum_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); + OnHit += SpellHitFn(spell_xt002_tympanic_tantrum_SpellScript::RecalculateDamage); } }; diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp index 3f01f21b189..58ba125b994 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp @@ -18,18 +18,27 @@ #include "ScriptMgr.h" #include "ulduar.h" -enum Sara_Yells +enum Sara { - SAY_SARA_PREFIGHT_1 = -1603310, - SAY_SARA_PREFIGHT_2 = -1603311, - SAY_SARA_AGGRO_1 = -1603312, - SAY_SARA_AGGRO_2 = -1603313, - SAY_SARA_AGGRO_3 = -1603314, - SAY_SARA_SLAY_1 = -1603315, - SAY_SARA_SLAY_2 = -1603316, - WHISP_SARA_INSANITY = -1603317, - SAY_SARA_PHASE2_1 = -1603318, - SAY_SARA_PHASE2_2 = -1603319, + // text + YELL_SARA_PREFIGHT = 0, + YELL_COMBAT_PHASE_1 = 1, + YELL_COMBAT_PHASE_2 = 2, + YELL_SLAY = 3, + + // Phase 1 spells + SPELL_SARAS_ANGER_1 = 63147, // Target Entry 33136 + SPELL_SARAS_ANGER_2 = 63744, // Target Entry 33136 + SPELL_SARAS_FEVOR_1 = 63138, // Target Player + SPELL_SARAS_FEVOR_2 = 63747, // Target Player + SPELL_SARAS_BLESSING_1 = 63134, // Target Player + SPELL_SARAS_BLESSING_2 = 63745, // Target Self + + // Phase 2 spells + SPELL_PHYCHOSIS = 63795, // Target Self + SPELL_MALADY_OF_THE_MIND = 63830, // Target Self + SPELL_DEATH_RAY = 63891, // Target Self + SPELL_BRAIN_LINK = 63802, // Target Self }; enum YoggSaron_Yells diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp index e12393f047f..654d763ddbc 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp @@ -22,9 +22,14 @@ static DoorData const doorData[] = { - { GO_LEVIATHAN_DOOR, BOSS_LEVIATHAN, DOOR_TYPE_ROOM, BOUNDARY_S }, - { GO_XT_002_DOOR, BOSS_XT002, DOOR_TYPE_ROOM, BOUNDARY_S }, - { 0, 0, DOOR_TYPE_ROOM, BOUNDARY_NONE }, + {GO_LEVIATHAN_DOOR, BOSS_LEVIATHAN, DOOR_TYPE_ROOM, BOUNDARY_S }, + {GO_XT_002_DOOR, BOSS_XT002, DOOR_TYPE_ROOM, BOUNDARY_S }, + {GO_DOODAD_UL_SIGILDOOR_03, BOSS_ALGALON, DOOR_TYPE_ROOM, BOUNDARY_W }, + {GO_DOODAD_UL_UNIVERSEFLOOR_01, BOSS_ALGALON, DOOR_TYPE_ROOM, BOUNDARY_NONE }, + {GO_DOODAD_UL_UNIVERSEFLOOR_02, BOSS_ALGALON, DOOR_TYPE_SPAWN_HOLE, BOUNDARY_NONE }, + {GO_DOODAD_UL_UNIVERSEGLOBE01, BOSS_ALGALON, DOOR_TYPE_SPAWN_HOLE, BOUNDARY_NONE }, + {GO_DOODAD_UL_ULDUAR_TRAPDOOR_03, BOSS_ALGALON, DOOR_TYPE_SPAWN_HOLE, BOUNDARY_NONE }, + {0, 0, DOOR_TYPE_ROOM, BOUNDARY_NONE }, }; class instance_ulduar : public InstanceMapScript @@ -36,7 +41,6 @@ class instance_ulduar : public InstanceMapScript { instance_ulduar_InstanceMapScript(InstanceMap* map) : InstanceScript(map) { } - uint32 Encounter[MAX_ENCOUNTER]; std::string m_strInstData; // Creatures @@ -72,6 +76,12 @@ class instance_ulduar : public InstanceMapScript uint64 HodirDoorGUID; uint64 HodirIceDoorGUID; uint64 ArchivumDoorGUID; + uint64 AlgalonSigilDoorGUID[3]; + uint64 AlgalonFloorGUID[2]; + uint64 AlgalonUniverseGUID; + uint64 AlgalonTrapdoorGUID; + uint64 BrannBronzebeardAlgGUID; + uint64 GiftOfTheObserverGUID; // Miscellaneous uint32 TeamInInstance; @@ -111,35 +121,49 @@ class instance_ulduar : public InstanceMapScript HodirDoorGUID = 0; HodirIceDoorGUID = 0; ArchivumDoorGUID = 0; + AlgalonUniverseGUID = 0; + AlgalonTrapdoorGUID = 0; + BrannBronzebeardAlgGUID = 0; + GiftOfTheObserverGUID = 0; + _algalonTimer = 61; + _maxArmorItemLevel = 0; + _maxWeaponItemLevel = 0; TeamInInstance = 0; HodirRareCacheData = 0; ColossusData = 0; elderCount = 0; conSpeedAtory = false; Unbroken = true; + _summonAlgalon = false; - memset(Encounter, 0, sizeof(Encounter)); + memset(AlgalonSigilDoorGUID, 0, sizeof(AlgalonSigilDoorGUID)); + memset(AlgalonFloorGUID, 0, sizeof(AlgalonFloorGUID)); memset(XTToyPileGUIDs, 0, sizeof(XTToyPileGUIDs)); memset(AssemblyGUIDs, 0, sizeof(AssemblyGUIDs)); memset(RazorHarpoonGUIDs, 0, sizeof(RazorHarpoonGUIDs)); memset(KeeperGUIDs, 0, sizeof(KeeperGUIDs)); } - bool IsEncounterInProgress() const + void FillInitialWorldStates(WorldPacket& packet) { - for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - { - if (Encounter[i] == IN_PROGRESS) - return true; - } - - return false; + packet << uint32(WORLD_STATE_ALGALON_TIMER_ENABLED) << uint32(_algalonTimer && _algalonTimer <= 60); + packet << uint32(WORLD_STATE_ALGALON_DESPAWN_TIMER) << uint32(std::min(_algalonTimer, 60)); } void OnPlayerEnter(Player* player) { if (!TeamInInstance) TeamInInstance = player->GetTeam(); + + if (_summonAlgalon) + { + _summonAlgalon = false; + TempSummon* algalon = instance->SummonCreature(NPC_ALGALON, AlgalonLandPos); + if (_algalonTimer && _algalonTimer <= 60) + algalon->AI()->DoAction(ACTION_INIT_ALGALON); + else + algalon->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); + } } void OnCreatureCreate(Creature* creature) @@ -234,7 +258,6 @@ class instance_ulduar : public InstanceMapScript case NPC_ALGALON: AlgalonGUID = creature->GetGUID(); break; - // Hodir's Helper NPCs case NPC_EIVI_NIGHTFEATHER: if (TeamInInstance == HORDE) @@ -268,9 +291,32 @@ class instance_ulduar : public InstanceMapScript if (TeamInInstance == HORDE) creature->UpdateEntry(NPC_BATTLE_PRIEST_GINA, HORDE); break; + case NPC_BRANN_BRONZBEARD_ALG: + BrannBronzebeardAlgGUID = creature->GetGUID(); + break; + //! These creatures are summoned by something else than Algalon + //! but need to be controlled/despawned by him - so they need to be + //! registered in his summon list + case NPC_ALGALON_VOID_ZONE_VISUAL_STALKER: + case NPC_ALGALON_STALKER_ASTEROID_TARGET_01: + case NPC_ALGALON_STALKER_ASTEROID_TARGET_02: + case NPC_UNLEASHED_DARK_MATTER: + if (Creature* algalon = instance->GetCreature(AlgalonGUID)) + algalon->AI()->JustSummoned(creature); + break; } + } - } + void OnCreatureRemove(Creature* creature) + { + switch (creature->GetEntry()) + { + case NPC_BRANN_BRONZBEARD_ALG: + if (BrannBronzebeardAlgGUID == creature->GetGUID()) + BrannBronzebeardAlgGUID = 0; + break; + } + } void OnGameObjectCreate(GameObject* gameObject) { @@ -341,6 +387,45 @@ class instance_ulduar : public InstanceMapScript if (GetBossState(BOSS_ASSEMBLY_OF_IRON) != DONE) HandleGameObject(ArchivumDoorGUID, false); break; + case GO_CELESTIAL_PLANETARIUM_ACCESS_10: + case GO_CELESTIAL_PLANETARIUM_ACCESS_25: + if (_algalonSummoned) + gameObject->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE); + break; + case GO_DOODAD_UL_SIGILDOOR_01: + AlgalonSigilDoorGUID[0] = gameObject->GetGUID(); + if (_algalonSummoned) + gameObject->SetGoState(GO_STATE_ACTIVE); + break; + case GO_DOODAD_UL_SIGILDOOR_02: + AlgalonSigilDoorGUID[1] = gameObject->GetGUID(); + if (_algalonSummoned) + gameObject->SetGoState(GO_STATE_ACTIVE); + break; + case GO_DOODAD_UL_SIGILDOOR_03: + AlgalonSigilDoorGUID[2] = gameObject->GetGUID(); + AddDoor(gameObject, true); + break; + case GO_DOODAD_UL_UNIVERSEFLOOR_01: + AlgalonFloorGUID[0] = gameObject->GetGUID(); + AddDoor(gameObject, true); + break; + case GO_DOODAD_UL_UNIVERSEFLOOR_02: + AlgalonFloorGUID[1] = gameObject->GetGUID(); + AddDoor(gameObject, true); + break; + case GO_DOODAD_UL_UNIVERSEGLOBE01: + AlgalonUniverseGUID = gameObject->GetGUID(); + AddDoor(gameObject, true); + break; + case GO_DOODAD_UL_ULDUAR_TRAPDOOR_03: + AlgalonTrapdoorGUID = gameObject->GetGUID(); + AddDoor(gameObject, true); + break; + case GO_GIFT_OF_THE_OBSERVER_10: + case GO_GIFT_OF_THE_OBSERVER_25: + GiftOfTheObserverGUID = gameObject->GetGUID(); + break; } } @@ -349,10 +434,14 @@ class instance_ulduar : public InstanceMapScript switch (gameObject->GetEntry()) { case GO_LEVIATHAN_DOOR: - AddDoor(gameObject, false); - break; case GO_XT_002_DOOR: + case GO_DOODAD_UL_SIGILDOOR_03: + case GO_DOODAD_UL_UNIVERSEFLOOR_01: + case GO_DOODAD_UL_UNIVERSEFLOOR_02: + case GO_DOODAD_UL_UNIVERSEGLOBE01: + case GO_DOODAD_UL_ULDUAR_TRAPDOOR_03: AddDoor(gameObject, false); + break; default: break; } @@ -390,6 +479,7 @@ class instance_ulduar : public InstanceMapScript // Flame Leviathan's Tower Event triggers Creature* FlameLeviathan = instance->GetCreature(LeviathanGUID); if (FlameLeviathan && FlameLeviathan->isAlive()) // No leviathan, no event triggering ;) + { switch (eventId) { case EVENT_TOWER_OF_STORM_DESTROYED: @@ -405,6 +495,7 @@ class instance_ulduar : public InstanceMapScript FlameLeviathan->AI()->DoAction(ACTION_TOWER_OF_LIFE_DESTROYED); break; } + } } @@ -465,6 +556,52 @@ class instance_ulduar : public InstanceMapScript if (GameObject* gameObject = instance->GetGameObject(ThorimChestGUID)) gameObject->SetRespawnTime(gameObject->GetRespawnDelay()); break; + case BOSS_ALGALON: + if (state == DONE) + { + _events.CancelEvent(EVENT_UPDATE_ALGALON_TIMER); + _events.CancelEvent(EVENT_DESPAWN_ALGALON); + DoUpdateWorldState(WORLD_STATE_ALGALON_TIMER_ENABLED, 0); + _algalonTimer = 61; + if (GameObject* gameObject = instance->GetGameObject(GiftOfTheObserverGUID)) + gameObject->SetRespawnTime(gameObject->GetRespawnDelay()); + // get item level (recheck weapons) + Map::PlayerList const& players = instance->GetPlayers(); + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + if (Player* player = itr->getSource()) + for (uint8 slot = EQUIPMENT_SLOT_MAINHAND; slot <= EQUIPMENT_SLOT_RANGED; ++slot) + if (Item* item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, slot)) + if (item->GetTemplate()->ItemLevel > _maxWeaponItemLevel) + _maxWeaponItemLevel = item->GetTemplate()->ItemLevel; + } + else if (state == IN_PROGRESS) + { + // get item level (armor cannot be swapped in combat) + Map::PlayerList const& players = instance->GetPlayers(); + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Player* player = itr->getSource()) + { + for (uint8 slot = EQUIPMENT_SLOT_START; slot < EQUIPMENT_SLOT_END; ++slot) + { + if (slot == EQUIPMENT_SLOT_TABARD || slot == EQUIPMENT_SLOT_BODY) + continue; + + if (Item* item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, slot)) + { + if (slot >= EQUIPMENT_SLOT_MAINHAND && slot <= EQUIPMENT_SLOT_RANGED) + { + if (item->GetTemplate()->ItemLevel > _maxWeaponItemLevel) + _maxWeaponItemLevel = item->GetTemplate()->ItemLevel; + } + else if (item->GetTemplate()->ItemLevel > _maxArmorItemLevel) + _maxArmorItemLevel = item->GetTemplate()->ItemLevel; + } + } + } + } + } + break; } return true; @@ -497,6 +634,16 @@ class instance_ulduar : public InstanceMapScript case DATA_UNBROKEN: Unbroken = bool(data); break; + case EVENT_DESPAWN_ALGALON: + DoUpdateWorldState(WORLD_STATE_ALGALON_TIMER_ENABLED, 1); + DoUpdateWorldState(WORLD_STATE_ALGALON_DESPAWN_TIMER, 60); + _algalonTimer = 60; + _events.ScheduleEvent(EVENT_DESPAWN_ALGALON, 3600000); + _events.ScheduleEvent(EVENT_UPDATE_ALGALON_TIMER, 60000); + break; + case DATA_ALGALON_SUMMON_STATE: + _algalonSummoned = true; + break; default: break; } @@ -571,6 +718,22 @@ class instance_ulduar : public InstanceMapScript return KeeperGUIDs[1]; case BOSS_STONEBARK: return KeeperGUIDs[2]; + case DATA_SIGILDOOR_01: + return AlgalonSigilDoorGUID[0]; + case DATA_SIGILDOOR_02: + return AlgalonSigilDoorGUID[1]; + case DATA_SIGILDOOR_03: + return AlgalonSigilDoorGUID[2]; + case DATA_UNIVERSE_FLOOR_01: + return AlgalonFloorGUID[0]; + case DATA_UNIVERSE_FLOOR_02: + return AlgalonFloorGUID[1]; + case DATA_UNIVERSE_GLOBE: + return AlgalonUniverseGUID; + case DATA_ALGALON_TRAPDOOR: + return AlgalonTrapdoorGUID; + case DATA_BRANN_BRONZEBEARD_ALG: + return BrannBronzebeardAlgGUID; } return 0; @@ -593,12 +756,23 @@ class instance_ulduar : public InstanceMapScript return 0; } + bool CheckAchievementCriteriaMeet(uint32 criteriaId, Player const* , Unit const* /* = NULL */, uint32 /* = 0 */) + { + switch (criteriaId) + { + case CRITERIA_HERALD_OF_TITANS: + return _maxArmorItemLevel <= MAX_HERALD_ARMOR_ITEMLEVEL && _maxWeaponItemLevel <= MAX_HERALD_WEAPON_ITEMLEVEL; + } + + return false; + } + std::string GetSaveData() { OUT_SAVE_INST_DATA; std::ostringstream saveStream; - saveStream << "U U " << GetBossSaveData() << GetData(DATA_COLOSSUS); + saveStream << "U U " << GetBossSaveData() << GetData(DATA_COLOSSUS) << ' ' << _algalonTimer << ' ' << (_algalonSummoned ? 1 : 0); OUT_SAVE_INST_DATA_COMPLETE; return saveStream.str(); @@ -628,15 +802,68 @@ class instance_ulduar : public InstanceMapScript if (tmpState == IN_PROGRESS || tmpState > SPECIAL) tmpState = NOT_STARTED; - if (i == DATA_COLOSSUS) - SetData(i, tmpState); - else - SetBossState(i, EncounterState(tmpState)); + SetBossState(i, EncounterState(tmpState)); + } + + uint32 tempState; + loadStream >> tempState; + if (tempState == IN_PROGRESS || tempState > SPECIAL) + tempState = NOT_STARTED; + SetData(DATA_COLOSSUS, tempState); + + loadStream >> _algalonTimer; + loadStream >> tempState; + _algalonSummoned = tempState != 0; + if (_algalonSummoned && GetBossState(BOSS_ALGALON) != DONE) + { + _summonAlgalon = true; + if (_algalonTimer && _algalonTimer <= 60) + { + _events.ScheduleEvent(EVENT_UPDATE_ALGALON_TIMER, 60000); + DoUpdateWorldState(WORLD_STATE_ALGALON_TIMER_ENABLED, 1); + DoUpdateWorldState(WORLD_STATE_ALGALON_DESPAWN_TIMER, _algalonTimer); + } } } OUT_LOAD_INST_DATA_COMPLETE; } + + void Update(uint32 diff) + { + if (_events.Empty()) + return; + + _events.Update(diff); + + while (uint32 eventId = _events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_UPDATE_ALGALON_TIMER: + SaveToDB(); + DoUpdateWorldState(WORLD_STATE_ALGALON_DESPAWN_TIMER, --_algalonTimer); + if (_algalonTimer) + _events.ScheduleEvent(EVENT_UPDATE_ALGALON_TIMER, 60000); + else + { + DoUpdateWorldState(WORLD_STATE_ALGALON_TIMER_ENABLED, 0); + _events.CancelEvent(EVENT_UPDATE_ALGALON_TIMER); + if (Creature* algalon = instance->GetCreature(AlgalonGUID)) + algalon->AI()->DoAction(EVENT_DESPAWN_ALGALON); + } + break; + } + } + } + + private: + EventMap _events; + uint32 _algalonTimer; + bool _summonAlgalon; + bool _algalonSummoned; + uint32 _maxArmorItemLevel; + uint32 _maxWeaponItemLevel; }; InstanceScript* GetInstanceScript(InstanceMap* map) const diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h index a31954b8a16..d35f0559080 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h @@ -21,6 +21,8 @@ #include "ObjectMgr.h" #define UlduarScriptName "instance_ulduar" +extern Position const AlgalonLandPos; + enum UlduarBosses { MAX_ENCOUNTER = 20, @@ -50,98 +52,124 @@ enum UlduarBosses enum UlduarNPCs { // General - NPC_LEVIATHAN = 33113, - NPC_SALVAGED_DEMOLISHER = 33109, - NPC_SALVAGED_SIEGE_ENGINE = 33060, - NPC_IGNIS = 33118, - NPC_RAZORSCALE = 33186, - NPC_RAZORSCALE_CONTROLLER = 33233, - NPC_STEELFORGED_DEFFENDER = 33236, - NPC_EXPEDITION_COMMANDER = 33210, - NPC_XT002 = 33293, - NPC_XT_TOY_PILE = 33337, - NPC_STEELBREAKER = 32867, - NPC_MOLGEIM = 32927, - NPC_BRUNDIR = 32857, - NPC_KOLOGARN = 32930, - NPC_FOCUSED_EYEBEAM = 33632, - NPC_FOCUSED_EYEBEAM_RIGHT = 33802, - NPC_LEFT_ARM = 32933, - NPC_RIGHT_ARM = 32934, - NPC_RUBBLE = 33768, - NPC_AURIAYA = 33515, - NPC_MIMIRON = 33350, - NPC_HODIR = 32845, - NPC_THORIM = 32865, - NPC_FREYA = 32906, - NPC_VEZAX = 33271, - NPC_YOGGSARON = 33288, - NPC_ALGALON = 32871, + NPC_LEVIATHAN = 33113, + NPC_SALVAGED_DEMOLISHER = 33109, + NPC_SALVAGED_SIEGE_ENGINE = 33060, + NPC_IGNIS = 33118, + NPC_RAZORSCALE = 33186, + NPC_RAZORSCALE_CONTROLLER = 33233, + NPC_STEELFORGED_DEFFENDER = 33236, + NPC_EXPEDITION_COMMANDER = 33210, + NPC_XT002 = 33293, + NPC_XT_TOY_PILE = 33337, + NPC_STEELBREAKER = 32867, + NPC_MOLGEIM = 32927, + NPC_BRUNDIR = 32857, + NPC_KOLOGARN = 32930, + NPC_FOCUSED_EYEBEAM = 33632, + NPC_FOCUSED_EYEBEAM_RIGHT = 33802, + NPC_LEFT_ARM = 32933, + NPC_RIGHT_ARM = 32934, + NPC_RUBBLE = 33768, + NPC_AURIAYA = 33515, + NPC_MIMIRON = 33350, + NPC_HODIR = 32845, + NPC_THORIM = 32865, + NPC_FREYA = 32906, + NPC_VEZAX = 33271, + NPC_YOGGSARON = 33288, + NPC_ALGALON = 32871, // Mimiron - NPC_LEVIATHAN_MKII = 33432, - NPC_VX_001 = 33651, - NPC_AERIAL_COMMAND_UNIT = 33670, + NPC_LEVIATHAN_MKII = 33432, + NPC_VX_001 = 33651, + NPC_AERIAL_COMMAND_UNIT = 33670, // Freya's Keepers - NPC_IRONBRANCH = 32913, - NPC_BRIGHTLEAF = 32915, - NPC_STONEBARK = 32914, + NPC_IRONBRANCH = 32913, + NPC_BRIGHTLEAF = 32915, + NPC_STONEBARK = 32914, // Hodir's Helper NPCs - NPC_TOR_GREYCLOUD = 32941, - NPC_KAR_GREYCLOUD = 33333, - NPC_EIVI_NIGHTFEATHER = 33325, - NPC_ELLIE_NIGHTFEATHER = 32901, - NPC_SPIRITWALKER_TARA = 33332, - NPC_SPIRITWALKER_YONA = 32950, - NPC_ELEMENTALIST_MAHFUUN = 33328, - NPC_ELEMENTALIST_AVUUN = 32900, - NPC_AMIRA_BLAZEWEAVER = 33331, - NPC_VEESHA_BLAZEWEAVER = 32946, - NPC_MISSY_FLAMECUFFS = 32893, - NPC_SISSY_FLAMECUFFS = 33327, - NPC_BATTLE_PRIEST_ELIZA = 32948, - NPC_BATTLE_PRIEST_GINA = 33330, - NPC_FIELD_MEDIC_PENNY = 32897, - NPC_FIELD_MEDIC_JESSI = 33326, + NPC_TOR_GREYCLOUD = 32941, + NPC_KAR_GREYCLOUD = 33333, + NPC_EIVI_NIGHTFEATHER = 33325, + NPC_ELLIE_NIGHTFEATHER = 32901, + NPC_SPIRITWALKER_TARA = 33332, + NPC_SPIRITWALKER_YONA = 32950, + NPC_ELEMENTALIST_MAHFUUN = 33328, + NPC_ELEMENTALIST_AVUUN = 32900, + NPC_AMIRA_BLAZEWEAVER = 33331, + NPC_VEESHA_BLAZEWEAVER = 32946, + NPC_MISSY_FLAMECUFFS = 32893, + NPC_SISSY_FLAMECUFFS = 33327, + NPC_BATTLE_PRIEST_ELIZA = 32948, + NPC_BATTLE_PRIEST_GINA = 33330, + NPC_FIELD_MEDIC_PENNY = 32897, + NPC_FIELD_MEDIC_JESSI = 33326, // Freya's trash NPCs - NPC_CORRUPTED_SERVITOR = 33354, - NPC_MISGUIDED_NYMPH = 33355, - NPC_GUARDIAN_LASHER = 33430, - NPC_FOREST_SWARMER = 33431, - NPC_MANGROVE_ENT = 33525, - NPC_IRONROOT_LASHER = 33526, - NPC_NATURES_BLADE = 33527, - NPC_GUARDIAN_OF_LIFE = 33528, + NPC_CORRUPTED_SERVITOR = 33354, + NPC_MISGUIDED_NYMPH = 33355, + NPC_GUARDIAN_LASHER = 33430, + NPC_FOREST_SWARMER = 33431, + NPC_MANGROVE_ENT = 33525, + NPC_IRONROOT_LASHER = 33526, + NPC_NATURES_BLADE = 33527, + NPC_GUARDIAN_OF_LIFE = 33528, + + // Algalon the Observer + NPC_BRANN_BRONZBEARD_ALG = 34064, + NPC_AZEROTH = 34246, + NPC_LIVING_CONSTELLATION = 33052, + NPC_ALGALON_STALKER = 33086, + NPC_COLLAPSING_STAR = 32955, + NPC_BLACK_HOLE = 32953, + NPC_WORM_HOLE = 34099, + NPC_ALGALON_VOID_ZONE_VISUAL_STALKER = 34100, + NPC_ALGALON_STALKER_ASTEROID_TARGET_01 = 33104, + NPC_ALGALON_STALKER_ASTEROID_TARGET_02 = 33105, + NPC_UNLEASHED_DARK_MATTER = 34097, }; enum UlduarGameObjects { - GO_KOLOGARN_CHEST_HERO = 195047, - GO_KOLOGARN_CHEST = 195046, - GO_KOLOGARN_BRIDGE = 194232, - GO_KOLOGARN_DOOR = 194553, - GO_THORIM_CHEST_HERO = 194315, - GO_THORIM_CHEST = 194314, - GO_HODIR_RARE_CACHE_OF_WINTER = 194200, - GO_HODIR_RARE_CACHE_OF_WINTER_HERO = 194201, - GO_HODIR_CHEST_HERO = 194308, - GO_HODIR_CHEST = 194307, - GO_LEVIATHAN_DOOR = 194905, - GO_LEVIATHAN_GATE = 194630, - GO_XT_002_DOOR = 194631, - GO_VEZAX_DOOR = 194750, - GO_MOLE_MACHINE = 194316, - GO_RAZOR_HARPOON_1 = 194542, - GO_RAZOR_HARPOON_2 = 194541, - GO_RAZOR_HARPOON_3 = 194543, - GO_RAZOR_HARPOON_4 = 194519, - GO_RAZOR_BROKEN_HARPOON = 194565, - GO_HODIR_DOOR = 194634, - GO_HODIR_ICE_DOOR = 194441, - GO_ARCHIVUM_DOOR = 194556, + GO_KOLOGARN_CHEST_HERO = 195047, + GO_KOLOGARN_CHEST = 195046, + GO_KOLOGARN_BRIDGE = 194232, + GO_KOLOGARN_DOOR = 194553, + GO_THORIM_CHEST_HERO = 194315, + GO_THORIM_CHEST = 194314, + GO_HODIR_RARE_CACHE_OF_WINTER = 194200, + GO_HODIR_RARE_CACHE_OF_WINTER_HERO = 194201, + GO_HODIR_CHEST_HERO = 194308, + GO_HODIR_CHEST = 194307, + GO_LEVIATHAN_DOOR = 194905, + GO_LEVIATHAN_GATE = 194630, + GO_XT_002_DOOR = 194631, + GO_VEZAX_DOOR = 194750, + GO_MOLE_MACHINE = 194316, + GO_RAZOR_HARPOON_1 = 194542, + GO_RAZOR_HARPOON_2 = 194541, + GO_RAZOR_HARPOON_3 = 194543, + GO_RAZOR_HARPOON_4 = 194519, + GO_RAZOR_BROKEN_HARPOON = 194565, + GO_HODIR_DOOR = 194634, + GO_HODIR_ICE_DOOR = 194441, + GO_ARCHIVUM_DOOR = 194556, + + // Algalon the Observer + GO_CELESTIAL_PLANETARIUM_ACCESS_10 = 194628, + GO_CELESTIAL_PLANETARIUM_ACCESS_25 = 194752, + GO_DOODAD_UL_SIGILDOOR_01 = 194767, + GO_DOODAD_UL_SIGILDOOR_02 = 194911, + GO_DOODAD_UL_SIGILDOOR_03 = 194910, + GO_DOODAD_UL_UNIVERSEFLOOR_01 = 194715, + GO_DOODAD_UL_UNIVERSEFLOOR_02 = 194716, + GO_DOODAD_UL_UNIVERSEGLOBE01 = 194148, + GO_DOODAD_UL_ULDUAR_TRAPDOOR_03 = 194253, + GO_GIFT_OF_THE_OBSERVER_10 = 194821, + GO_GIFT_OF_THE_OBSERVER_25 = 194822, }; enum LeviathanData @@ -161,6 +189,7 @@ enum UlduarAchievementCriteriaIds { CRITERIA_CON_SPEED_ATORY = 21597, CRITERIA_DISARMED = 21687, + CRITERIA_HERALD_OF_TITANS = 10678, }; enum UlduarData @@ -180,12 +209,38 @@ enum UlduarData // Hodir DATA_HODIR_RARE_CACHE, + + // Algalon the Observer + DATA_ALGALON_SUMMON_STATE, + DATA_SIGILDOOR_01, + DATA_SIGILDOOR_02, + DATA_SIGILDOOR_03, + DATA_UNIVERSE_FLOOR_01, + DATA_UNIVERSE_FLOOR_02, + DATA_UNIVERSE_GLOBE, + DATA_ALGALON_TRAPDOOR, + DATA_BRANN_BRONZEBEARD_ALG, +}; + +enum UlduarWorldStates +{ + WORLD_STATE_ALGALON_DESPAWN_TIMER = 4131, + WORLD_STATE_ALGALON_TIMER_ENABLED = 4132, }; enum UlduarAchievementData { // FL Achievement boolean DATA_UNBROKEN = 29052906, // 2905, 2906 are achievement IDs, + MAX_HERALD_ARMOR_ITEMLEVEL = 226, + MAX_HERALD_WEAPON_ITEMLEVEL = 232, +}; + +enum UlduarEvents +{ + EVENT_DESPAWN_ALGALON = 1, + EVENT_UPDATE_ALGALON_TIMER = 2, + ACTION_INIT_ALGALON = 6, }; template @@ -199,6 +254,17 @@ CreatureAI* GetUlduarAI(Creature* creature) return NULL; } +template +GameObjectAI* GetUlduarAI(GameObject* go) +{ + if (InstanceMap* instance = go->GetMap()->ToInstanceMap()) + if (instance->GetInstanceScript()) + if (instance->GetScriptId() == sObjectMgr->GetScriptId(UlduarScriptName)) + return new AI(go); + + return NULL; +} + class PlayerOrPetCheck { public: diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp index a11f88fc6af..a7853a07e22 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp @@ -309,9 +309,9 @@ public: struct mob_annhylde_the_callerAI : public ScriptedAI { - mob_annhylde_the_callerAI(Creature* c) : ScriptedAI(c) + mob_annhylde_the_callerAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } float x, y, z; @@ -321,6 +321,7 @@ public: void Reset() { + //! HACK: Creature's can't have MOVEMENTFLAG_FLYING me->AddUnitMovementFlag(MOVEMENTFLAG_FLYING | MOVEMENTFLAG_HOVER); me->SetSpeed(MOVE_SWIM, 1.0f); me->SetSpeed(MOVE_RUN, 1.0f); @@ -343,7 +344,7 @@ public: { if (type != POINT_MOTION_TYPE) return; - Unit* ingvar = Unit::GetUnit((*me), instance ? instance->GetData64(DATA_INGVAR) : 0); + Unit* ingvar = Unit::GetUnit(*me, instance ? instance->GetData64(DATA_INGVAR) : 0); if (ingvar) { switch (id) @@ -423,7 +424,7 @@ public: struct mob_ingvar_throw_dummyAI : public ScriptedAI { - mob_ingvar_throw_dummyAI(Creature* c) : ScriptedAI(c) + mob_ingvar_throw_dummyAI(Creature* creature) : ScriptedAI(creature) { } @@ -444,6 +445,7 @@ public: void AttackStart(Unit* /*who*/) {} void MoveInLineOfSight(Unit* /*who*/) {} void EnterCombat(Unit* /*who*/) {} + void UpdateAI(const uint32 diff) { if (uiDespawnTimer <= diff) @@ -454,7 +456,6 @@ public: } else uiDespawnTimer -= diff; } }; - }; void AddSC_boss_ingvar_the_plunderer() diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp index 333278daa10..915d1c71bb2 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp @@ -69,9 +69,9 @@ public: struct boss_skarvald_the_constructorAI : public ScriptedAI { - boss_skarvald_the_constructorAI(Creature* c) : ScriptedAI(c) + boss_skarvald_the_constructorAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -93,7 +93,7 @@ public: ghost = (me->GetEntry() == MOB_SKARVALD_GHOST); if (!ghost && instance) { - Unit* dalronn = Unit::GetUnit((*me), instance->GetData64(DATA_DALRONN)); + Unit* dalronn = Unit::GetUnit(*me, instance->GetData64(DATA_DALRONN)); if (dalronn && dalronn->isDead()) CAST_CRE(dalronn)->Respawn(); @@ -107,7 +107,7 @@ public: { DoScriptText(YELL_SKARVALD_AGGRO, me); - Unit* dalronn = Unit::GetUnit((*me), instance->GetData64(DATA_DALRONN)); + Unit* dalronn = Unit::GetUnit(*me, instance->GetData64(DATA_DALRONN)); if (dalronn && dalronn->isAlive() && !dalronn->getVictim()) dalronn->getThreatManager().addThreat(who, 0.0f); @@ -115,11 +115,11 @@ public: } } - void JustDied(Unit* Killer) + void JustDied(Unit* killer) { if (!ghost && instance) { - Unit* dalronn = Unit::GetUnit((*me), instance->GetData64(DATA_DALRONN)); + Unit* dalronn = Unit::GetUnit(*me, instance->GetData64(DATA_DALRONN)); if (dalronn) { if (dalronn->isDead()) @@ -138,7 +138,7 @@ public: if (temp) { temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - temp->AI()->AttackStart(Killer); + temp->AI()->AttackStart(killer); } } } @@ -221,9 +221,9 @@ public: struct boss_dalronn_the_controllerAI : public ScriptedAI { - boss_dalronn_the_controllerAI(Creature* c) : ScriptedAI(c) + boss_dalronn_the_controllerAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -250,7 +250,7 @@ public: ghost = me->GetEntry() == MOB_DALRONN_GHOST; if (!ghost && instance) { - Unit* skarvald = Unit::GetUnit((*me), instance->GetData64(DATA_SKARVALD)); + Unit* skarvald = Unit::GetUnit(*me, instance->GetData64(DATA_SKARVALD)); if (skarvald && skarvald->isDead()) CAST_CRE(skarvald)->Respawn(); @@ -262,7 +262,7 @@ public: { if (!ghost && instance) { - Unit* skarvald = Unit::GetUnit((*me), instance->GetData64(DATA_SKARVALD)); + Unit* skarvald = Unit::GetUnit(*me, instance->GetData64(DATA_SKARVALD)); if (skarvald && skarvald->isAlive() && !skarvald->getVictim()) skarvald->getThreatManager().addThreat(who, 0.0f); @@ -273,11 +273,11 @@ public: } } - void JustDied(Unit* Killer) + void JustDied(Unit* killer) { if (!ghost && instance) { - Unit* skarvald = Unit::GetUnit((*me), instance->GetData64(DATA_SKARVALD)); + Unit* skarvald = Unit::GetUnit(*me, instance->GetData64(DATA_SKARVALD)); if (skarvald) { if (skarvald->isDead()) @@ -297,7 +297,7 @@ public: if (temp) { temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - temp->AI()->AttackStart(Killer); + temp->AI()->AttackStart(killer); } } } diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/instance_utgarde_keep.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/instance_utgarde_keep.cpp index 6ecc1883afc..fda4767e16b 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/instance_utgarde_keep.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/instance_utgarde_keep.cpp @@ -100,7 +100,8 @@ public: bool IsEncounterInProgress() const { for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; + if (m_auiEncounter[i] == IN_PROGRESS) + return true; return false; } diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp index d660b1516b3..95d2cb1709e 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp @@ -37,9 +37,9 @@ public: struct npc_dragonflayer_forge_masterAI : public ScriptedAI { - npc_dragonflayer_forge_masterAI(Creature* c) : ScriptedAI(c) + npc_dragonflayer_forge_masterAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); fm_Type = 0; } @@ -48,65 +48,77 @@ public: void Reset() { - if (fm_Type == 0) fm_Type = GetForgeMasterType(); + if (fm_Type == 0) + fm_Type = GetForgeMasterType(); + CheckForge(); } void CheckForge() { - if (instance) + if (instance) { switch (fm_Type) { - case 1: - instance->SetData(EVENT_FORGE_1, me->isAlive() ? NOT_STARTED : DONE); - break; - case 2: - instance->SetData(EVENT_FORGE_2, me->isAlive() ? NOT_STARTED : DONE); - break; - case 3: - instance->SetData(EVENT_FORGE_3, me->isAlive() ? NOT_STARTED : DONE); - break; + case 1: + instance->SetData(EVENT_FORGE_1, me->isAlive() ? NOT_STARTED : DONE); + break; + + case 2: + instance->SetData(EVENT_FORGE_2, me->isAlive() ? NOT_STARTED : DONE); + break; + + case 3: + instance->SetData(EVENT_FORGE_3, me->isAlive() ? NOT_STARTED : DONE); + break; } } } void JustDied(Unit* /*killer*/) { - if (fm_Type == 0) fm_Type = GetForgeMasterType(); + if (fm_Type == 0) + fm_Type = GetForgeMasterType(); + if (instance) { switch (fm_Type) { - case 1: - instance->SetData(EVENT_FORGE_1, DONE); - break; - case 2: - instance->SetData(EVENT_FORGE_2, DONE); - break; - case 3: - instance->SetData(EVENT_FORGE_3, DONE); - break; + case 1: + instance->SetData(EVENT_FORGE_1, DONE); + break; + + case 2: + instance->SetData(EVENT_FORGE_2, DONE); + break; + + case 3: + instance->SetData(EVENT_FORGE_3, DONE); + break; } } } void EnterCombat(Unit* /*who*/) { - if (fm_Type == 0) fm_Type = GetForgeMasterType(); + if (fm_Type == 0) + fm_Type = GetForgeMasterType(); + if (instance) { switch (fm_Type) { - case 1: - instance->SetData(EVENT_FORGE_1, IN_PROGRESS); - break; - case 2: - instance->SetData(EVENT_FORGE_2, IN_PROGRESS); - break; - case 3: - instance->SetData(EVENT_FORGE_3, IN_PROGRESS); - break; + case 1: + instance->SetData(EVENT_FORGE_1, IN_PROGRESS); + break; + + case 2: + instance->SetData(EVENT_FORGE_2, IN_PROGRESS); + break; + + case 3: + instance->SetData(EVENT_FORGE_3, IN_PROGRESS); + break; } } me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); @@ -115,29 +127,26 @@ public: uint8 GetForgeMasterType() { float diff = 30.0f; - int near_f = 0; + uint8 near_f = 0; - for (uint8 i = 0; i < 3 ; ++i) + for (uint8 i = 0; i < 3; ++i) { - GameObject* temp; - temp = me->FindNearestGameObject(entry_search[i], 30); - if (temp) + if (GameObject* go = me->FindNearestGameObject(entry_search[i], 30)) { - if (me->IsWithinDist(temp, diff, false)) + if (me->IsWithinDist(go, diff, false)) { near_f = i + 1; - diff = me->GetDistance2d(temp); - + diff = me->GetDistance2d(go); } } } switch (near_f) { - case 1: return 1; - case 2: return 2; - case 3: return 3; - default: return 0; + case 1: return 1; + case 2: return 2; + case 3: return 3; + default: return 0; } } @@ -152,7 +161,6 @@ public: DoMeleeAttackIfReady(); } }; - }; void AddSC_utgarde_keep() diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp index 656b2931abb..e2943f491f6 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp @@ -94,9 +94,9 @@ public: struct boss_palehoofAI : public ScriptedAI { - boss_palehoofAI(Creature* c) : ScriptedAI(c) + boss_palehoofAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiArcingSmashTimer; @@ -297,9 +297,9 @@ public: struct mob_ravenous_furbolgAI : public ScriptedAI { - mob_ravenous_furbolgAI(Creature* c) : ScriptedAI(c) + mob_ravenous_furbolgAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiChainLightingTimer; @@ -410,9 +410,9 @@ public: struct mob_frenzied_worgenAI : public ScriptedAI { - mob_frenzied_worgenAI(Creature* c) : ScriptedAI(c) + mob_frenzied_worgenAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiMortalWoundTimer; @@ -526,9 +526,9 @@ public: struct mob_ferocious_rhinoAI : public ScriptedAI { - mob_ferocious_rhinoAI(Creature* c) : ScriptedAI(c) + mob_ferocious_rhinoAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiStompTimer; @@ -646,9 +646,9 @@ public: struct mob_massive_jormungarAI : public ScriptedAI { - mob_massive_jormungarAI(Creature* c) : ScriptedAI(c) + mob_massive_jormungarAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiAcidSpitTimer; @@ -752,9 +752,9 @@ public: struct mob_palehoof_orbAI : public ScriptedAI { - mob_palehoof_orbAI(Creature* c) : ScriptedAI(c) + mob_palehoof_orbAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -765,6 +765,7 @@ public: { currentPhase = PHASE_NONE; SummonTimer = 5000; + //! HACK: Creature's can't have MOVEMENTFLAG_FLYING me->AddUnitMovementFlag(MOVEMENTFLAG_FLYING); me->RemoveAurasDueToSpell(SPELL_ORB_VISUAL); me->SetSpeed(MOVE_FLIGHT, 0.5f); @@ -834,15 +835,15 @@ class go_palehoof_sphere : public GameObjectScript public: go_palehoof_sphere() : GameObjectScript("go_palehoof_sphere") { } - bool OnGossipHello(Player* /*player*/, GameObject* pGO) + bool OnGossipHello(Player* /*player*/, GameObject* go) { - InstanceScript* instance = pGO->GetInstanceScript(); + InstanceScript* instance = go->GetInstanceScript(); - Creature* pPalehoof = Unit::GetCreature(*pGO, instance ? instance->GetData64(DATA_GORTOK_PALEHOOF) : 0); + Creature* pPalehoof = Unit::GetCreature(*go, instance ? instance->GetData64(DATA_GORTOK_PALEHOOF) : 0); if (pPalehoof && pPalehoof->isAlive()) { - pGO->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); - pGO->SetGoState(GO_STATE_ACTIVE); + go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); + go->SetGoState(GO_STATE_ACTIVE); CAST_AI(boss_palehoof::boss_palehoofAI, pPalehoof->AI())->NextPhase(); } diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp index d5cd79b25f1..5132dd0f046 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp @@ -168,12 +168,12 @@ public: struct boss_skadiAI : public ScriptedAI { - boss_skadiAI(Creature* c) : ScriptedAI(c), Summons(me) + boss_skadiAI(Creature* creature) : ScriptedAI(creature), Summons(me) { - m_instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; SummonList Summons; uint64 m_uiGraufGUID; std::vector triggersGUID; @@ -208,16 +208,16 @@ public: me->SetSpeed(MOVE_FLIGHT, 3.0f); if ((Unit::GetCreature((*me), m_uiGraufGUID) == NULL) && !me->IsMounted()) me->SummonCreature(CREATURE_GRAUF, Location[0].GetPositionX(), Location[0].GetPositionY(), Location[0].GetPositionZ(), 3.0f); - if (m_instance) + if (instance) { - m_instance->SetData(DATA_SKADI_THE_RUTHLESS_EVENT, NOT_STARTED); - m_instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT); + instance->SetData(DATA_SKADI_THE_RUTHLESS_EVENT, NOT_STARTED); + instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT); } } void JustReachedHome() { - me->SetFlying(false); + me->SetCanFly(false); me->Dismount(); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); if (Unit::GetCreature((*me), m_uiGraufGUID) == NULL) @@ -235,12 +235,12 @@ public: m_uiMovementTimer = 1000; m_uiSummonTimer = 10000; me->SetInCombatWithZone(); - if (m_instance) + if (instance) { - m_instance->SetData(DATA_SKADI_THE_RUTHLESS_EVENT, IN_PROGRESS); - m_instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT); + instance->SetData(DATA_SKADI_THE_RUTHLESS_EVENT, IN_PROGRESS); + instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT); me->GetMotionMaster()->MoveJump(Location[0].GetPositionX(), Location[0].GetPositionY(), Location[0].GetPositionZ(), 5.0f, 10.0f); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); m_uiMountTimer = 1000; Summons.DespawnEntry(CREATURE_GRAUF); } @@ -284,7 +284,7 @@ public: if (m_uiSpellHitCount >= 3) { Phase = SKADI; - me->SetFlying(false); + me->SetCanFly(false); me->Dismount(); if (Creature* pGrauf = me->SummonCreature(CREATURE_GRAUF, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3*IN_MILLISECONDS)) { @@ -328,7 +328,7 @@ public: if (m_uiMountTimer && m_uiMountTimer <= diff) { me->Mount(DATA_MOUNT); - me->SetFlying(true); + me->SetCanFly(true); m_uiMountTimer = 0; } else m_uiMountTimer -= diff; @@ -411,8 +411,8 @@ public: { DoScriptText(SAY_DEATH, me); Summons.DespawnAll(); - if (m_instance) - m_instance->SetData(DATA_SKADI_THE_RUTHLESS_EVENT, DONE); + if (instance) + instance->SetData(DATA_SKADI_THE_RUTHLESS_EVENT, DONE); } void KilledUnit(Unit* /*victim*/) @@ -426,9 +426,17 @@ public: { switch (urand(0, 2)) { - case 0: me->SummonCreature(CREATURE_YMIRJAR_WARRIOR, SpawnLoc.GetPositionX()+rand()%5, SpawnLoc.GetPositionY()+rand()%5, SpawnLoc.GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); break; - case 1: me->SummonCreature(CREATURE_YMIRJAR_WITCH_DOCTOR, SpawnLoc.GetPositionX()+rand()%5, SpawnLoc.GetPositionY()+rand()%5, SpawnLoc.GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); break; - case 2: me->SummonCreature(CREATURE_YMIRJAR_HARPOONER, SpawnLoc.GetPositionX()+rand()%5, SpawnLoc.GetPositionY()+rand()%5, SpawnLoc.GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); break; + case 0: + me->SummonCreature(CREATURE_YMIRJAR_WARRIOR, SpawnLoc.GetPositionX()+rand()%5, SpawnLoc.GetPositionY()+rand()%5, SpawnLoc.GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + break; + + case 1: + me->SummonCreature(CREATURE_YMIRJAR_WITCH_DOCTOR, SpawnLoc.GetPositionX()+rand()%5, SpawnLoc.GetPositionY()+rand()%5, SpawnLoc.GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + break; + + case 2: + me->SummonCreature(CREATURE_YMIRJAR_HARPOONER, SpawnLoc.GetPositionX()+rand()%5, SpawnLoc.GetPositionY()+rand()%5, SpawnLoc.GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + break; } } } @@ -461,15 +469,15 @@ class go_harpoon_launcher : public GameObjectScript public: go_harpoon_launcher() : GameObjectScript("go_harpoon_launcher") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { - InstanceScript* m_instance = pGO->GetInstanceScript(); - if (!m_instance) return false; + InstanceScript* instance = go->GetInstanceScript(); + if (!instance) + return false; - if (Creature* pSkadi = Unit::GetCreature((*pGO), m_instance->GetData64(DATA_SKADI_THE_RUTHLESS))) - { + if (Creature* pSkadi = Unit::GetCreature(*go, instance->GetData64(DATA_SKADI_THE_RUTHLESS))) player->CastSpell(pSkadi, SPELL_RAPID_FIRE, true); - } + return false; } diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp index 915ead98bb7..29b8f2e7f48 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp @@ -94,11 +94,6 @@ enum SvalaPhase SVALADEAD }; -enum SvalaPoint -{ - POINT_FALL_GROUND = 1, -}; - #define DATA_INCREDIBLE_HULK 2043 static const float spectatorWP[2][3] = @@ -158,15 +153,11 @@ public: summons.DespawnAll(); me->RemoveAllAuras(); - if (Phase > INTRO) - { - me->SetFlying(true); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - } - if (Phase > NORMAL) Phase = NORMAL; + me->SetDisableGravity(Phase == NORMAL); + introTimer = 1 * IN_MILLISECONDS; introPhase = 0; arthasGUID = 0; @@ -178,17 +169,6 @@ public: } } - void JustReachedHome() - { - if (Phase > INTRO) - { - me->SetFlying(false); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - me->SetOrientation(1.58f); - me->SendMovementFlagUpdate(); - } - } - void EnterCombat(Unit* /*who*/) { Talk(SAY_AGGRO); @@ -240,44 +220,13 @@ public: Talk(SAY_SLAY); } - void DamageTaken(Unit* attacker, uint32 &damage) - { - if (Phase == SVALADEAD) - { - if (attacker != me) - damage = 0; - return; - } - - if (damage >= me->GetHealth()) - { - if (Phase == SACRIFICING) - SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE); - - damage = 0; - Phase = SVALADEAD; - me->InterruptNonMeleeSpells(true); - me->RemoveAllAuras(); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->SetHealth(1); - - SetCombatMovement(false); - me->HandleEmoteCommand(EMOTE_ONESHOT_FLYDEATH); - me->GetMotionMaster()->MoveFall(POINT_FALL_GROUND); - } - } - - void MovementInform(uint32 motionType, uint32 pointId) + void JustDied(Unit* /*killer*/) { - if (motionType != EFFECT_MOTION_TYPE) - return; + if (Phase == SACRIFICING) + SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE); - if (pointId == POINT_FALL_GROUND) - me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } + me->HandleEmoteCommand(EMOTE_ONESHOT_FLYDEATH); - void JustDied(Unit* /*killer*/) - { summons.DespawnAll(); if (instance) @@ -325,8 +274,6 @@ public: break; case 2: arthas->CastSpell(me, SPELL_TRANSFORMING_CHANNEL, false); - me->SetFlying(true); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); pos.Relocate(me); pos.m_positionZ += 8.0f; me->GetMotionMaster()->MoveTakeoff(0, pos, 3.30078125f); @@ -340,7 +287,7 @@ public: if ((*itr)->isAlive()) { (*itr)->SetStandState(UNIT_STAND_STATE_STAND); - (*itr)->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + (*itr)->SetWalk(false); (*itr)->GetMotionMaster()->MovePoint(1, spectatorWP[0][0], spectatorWP[0][1], spectatorWP[0][2]); } } @@ -382,14 +329,13 @@ public: introTimer = 13800; break; case 8: - me->SetFlying(false); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - me->SendMovementFlagUpdate(); pos.Relocate(me); pos.m_positionX = me->GetHomePosition().GetPositionX(); pos.m_positionY = me->GetHomePosition().GetPositionY(); pos.m_positionZ = 90.6065f; me->GetMotionMaster()->MoveLand(0, pos, 6.247422f); + me->SetDisableGravity(false, true); + me->SetHover(true); ++introPhase; introTimer = 3000; break; @@ -403,7 +349,8 @@ public: break; } } - else introTimer -= diff; + else + introTimer -= diff; return; } @@ -414,33 +361,29 @@ public: if (!UpdateVictim()) return; - if (me->IsWithinMeleeRange(me->getVictim()) && me->HasUnitMovementFlag(MOVEMENTFLAG_LEVITATING)) - { - me->SetFlying(false); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - me->SendMovementFlagUpdate(); - } - if (sinsterStrikeTimer <= diff) { DoCast(me->getVictim(), SPELL_SINSTER_STRIKE); sinsterStrikeTimer = urand(5 * IN_MILLISECONDS, 9 * IN_MILLISECONDS); - } else sinsterStrikeTimer -= diff; + } + else + sinsterStrikeTimer -= diff; if (callFlamesTimer <= diff) { - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true)) { DoCast(target, SPELL_CALL_FLAMES); callFlamesTimer = urand(10 * IN_MILLISECONDS, 20 * IN_MILLISECONDS); } - } else callFlamesTimer -= diff; + } + else callFlamesTimer -= diff; if (!sacrificed) { if (HealthBelowPct(50)) { - if (Unit* sacrificeTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 80, true)) + if (Unit* sacrificeTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 80.0f, true)) { if (instance) instance->SetData64(DATA_SACRIFICED_PLAYER, sacrificeTarget->GetGUID()); @@ -450,8 +393,6 @@ public: DoCast(sacrificeTarget, SPELL_RITUAL_PREPARATION); SetCombatMovement(false); - me->SetFlying(true); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); Phase = SACRIFICING; sacrePhase = 0; diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp index 29d6278124f..f9251c637ba 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp @@ -108,9 +108,9 @@ public: struct boss_ymironAI : public ScriptedAI { - boss_ymironAI(Creature* c) : ScriptedAI(c) + boss_ymironAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); for (int i = 0; i < 4; ++i) m_uiActiveOrder[i] = i; for (int i = 0; i < 3; ++i) @@ -218,7 +218,7 @@ public: m_uiActivedCreatureGUID = temp->GetGUID(); temp->CastSpell(me, SPELL_CHANNEL_SPIRIT_TO_YMIRON, true); temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); - temp->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + temp->SetDisableGravity(true); switch (m_uiActiveOrder[m_uiActivedNumber]) { case 0: m_bIsActiveWithBJORN = true; break; diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_pinnacle.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_pinnacle.cpp index cb596f284c5..26fbbf4d717 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_pinnacle.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_pinnacle.cpp @@ -97,7 +97,8 @@ public: bool IsEncounterInProgress() const { for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; + if (m_auiEncounter[i] == IN_PROGRESS) + return true; return false; } diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp index 2f4079d4e3c..4980ed36ec3 100644 --- a/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp +++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp @@ -139,7 +139,7 @@ class boss_emalon : public CreatureScript case EVENT_OVERCHARGE: if (!summons.empty()) { - Creature* minion = Unit::GetCreature(*me, SelectRandomContainerElement(summons)); + Creature* minion = Unit::GetCreature(*me, Trinity::Containers::SelectRandomContainerElement(summons)); if (minion && minion->isAlive()) { minion->CastSpell(me, SPELL_OVERCHARGED, true); @@ -189,7 +189,7 @@ class mob_tempest_minion : public CreatureScript OverchargedTimer = 0; } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (Creature* emalon = Unit::GetCreature(*me, instance ? instance->GetData64(DATA_EMALON) : 0)) { diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp index 162f59fa5b7..100f1fccac8 100644 --- a/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp +++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp @@ -125,7 +125,7 @@ class mob_frost_warder : public CreatureScript struct mob_frost_warderAI : public ScriptedAI { - mob_frost_warderAI(Creature* c) : ScriptedAI(c) {} + mob_frost_warderAI(Creature* creature) : ScriptedAI(creature) {} void Reset() { diff --git a/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp b/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp index 74fc2505969..37ef8bf2788 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp @@ -57,9 +57,9 @@ public: struct boss_cyanigosaAI : public ScriptedAI { - boss_cyanigosaAI(Creature* c) : ScriptedAI(c) + boss_cyanigosaAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiArcaneVacuumTimer; @@ -168,7 +168,7 @@ class achievement_defenseless : public AchievementCriteriaScript bool OnCheck(Player* /*player*/, Unit* target) { - if(!target) + if (!target) return false; InstanceScript* instance = target->GetInstanceScript(); diff --git a/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp b/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp index 63f0cd39893..31902acfc46 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp @@ -55,9 +55,9 @@ public: struct boss_erekemAI : public ScriptedAI { - boss_erekemAI(Creature* c) : ScriptedAI(c) + boss_erekemAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiBloodlustTimer; @@ -270,9 +270,9 @@ public: struct mob_erekem_guardAI : public ScriptedAI { - mob_erekem_guardAI(Creature* c) : ScriptedAI(c) + mob_erekem_guardAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiGushingWoundTimer; diff --git a/src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp b/src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp index c5b2cb3c327..7a8254ad2b6 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp @@ -41,9 +41,9 @@ public: struct boss_lavanthorAI : public ScriptedAI { - boss_lavanthorAI(Creature* c) : ScriptedAI(c) + boss_lavanthorAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiFireboltTimer; diff --git a/src/server/scripts/Northrend/VioletHold/boss_moragg.cpp b/src/server/scripts/Northrend/VioletHold/boss_moragg.cpp index 84b04579681..1a70846e1b6 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_moragg.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_moragg.cpp @@ -37,9 +37,9 @@ public: struct boss_moraggAI : public ScriptedAI { - boss_moraggAI(Creature* c) : ScriptedAI(c) + boss_moraggAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiOpticLinkTimer; diff --git a/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp b/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp index ff2009c2a17..4569741e459 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp @@ -61,9 +61,9 @@ public: struct boss_zuramatAI : public ScriptedAI { - boss_zuramatAI(Creature* c) : ScriptedAI(c) + boss_zuramatAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; diff --git a/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp b/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp index 5980c534595..37a13388b5f 100644 --- a/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp +++ b/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp @@ -221,7 +221,8 @@ public: bool IsEncounterInProgress() const { for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; + if (m_auiEncounter[i] == IN_PROGRESS) + return true; return false; } @@ -689,7 +690,8 @@ public: { AddWave(); bActive = false; - uiActivationTimer = 5000; + // 1 minute waiting time after each boss fight + uiActivationTimer = (uiWaveCount == 6 || uiWaveCount == 12) ? 60000 : 5000; } else uiActivationTimer -= diff; } @@ -795,7 +797,7 @@ public: } } - void ProcessEvent(WorldObject* /*pGO*/, uint32 uiEventId) + void ProcessEvent(WorldObject* /*go*/, uint32 uiEventId) { switch (uiEventId) { diff --git a/src/server/scripts/Northrend/VioletHold/violet_hold.cpp b/src/server/scripts/Northrend/VioletHold/violet_hold.cpp index 8b77cb250da..e9d2c85e13e 100644 --- a/src/server/scripts/Northrend/VioletHold/violet_hold.cpp +++ b/src/server/scripts/Northrend/VioletHold/violet_hold.cpp @@ -253,10 +253,10 @@ class npc_sinclari_vh : public CreatureScript public: npc_sinclari_vh() : CreatureScript("npc_sinclari_vh") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->CLOSE_GOSSIP_MENU(); @@ -363,7 +363,7 @@ public: { if (Creature* pGuard = *itr) { - pGuard->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + pGuard->SetWalk(false); pGuard->GetMotionMaster()->MovePoint(0, MovePosition); } } @@ -426,9 +426,9 @@ public: struct mob_azure_saboteurAI : public npc_escortAI { - mob_azure_saboteurAI(Creature* c):npc_escortAI(c) + mob_azure_saboteurAI(Creature* creature):npc_escortAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); bHasGotMovingPoints = false; uiBoss = 0; Reset(); @@ -447,32 +447,32 @@ public: me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); } - void WaypointReached(uint32 uiWPointId) + void WaypointReached(uint32 waypointId) { switch (uiBoss) { case 1: - if (uiWPointId == 2) + if (waypointId == 2) FinishPointReached(); break; case 2: - if (uiWPointId == 2) + if (waypointId == 2) FinishPointReached(); break; case 3: - if (uiWPointId == 1) + if (waypointId == 1) FinishPointReached(); break; case 4: - if (uiWPointId == 0) + if (waypointId == 0) FinishPointReached(); break; case 5: - if (uiWPointId == 0) + if (waypointId == 0) FinishPointReached(); break; case 6: - if (uiWPointId == 4) + if (waypointId == 4) FinishPointReached(); break; } @@ -550,9 +550,9 @@ public: struct npc_teleportation_portalAI : public ScriptedAI { - npc_teleportation_portalAI(Creature* c) : ScriptedAI(c), listOfMobs(me) + npc_teleportation_portalAI(Creature* creature) : ScriptedAI(creature), listOfMobs(me) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); uiTypeOfMobsPortal = urand(0, 1); // 0 - elite mobs 1 - portal guardian or portal keeper with regular mobs bPortalGuardianOrKeeperOrEliteSpawn = false; } @@ -675,9 +675,9 @@ public: struct violet_hold_trashAI : public npc_escortAI { - violet_hold_trashAI(Creature* c):npc_escortAI(c) + violet_hold_trashAI(Creature* creature):npc_escortAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); bHasGotMovingPoints = false; if (instance) portalLocationID = instance->GetData(DATA_PORTAL_LOCATION); @@ -690,32 +690,32 @@ struct violet_hold_trashAI : public npc_escortAI uint32 portalLocationID; uint32 secondPortalRouteID; - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { switch (portalLocationID) { case 0: - if (uiPointId == 5) + if (waypointId == 5) CreatureStartAttackDoor(); break; case 1: - if ((uiPointId == 8 && secondPortalRouteID == 0) || (uiPointId == 7 && secondPortalRouteID == 1)) + if ((waypointId == 8 && secondPortalRouteID == 0) || (waypointId == 7 && secondPortalRouteID == 1)) CreatureStartAttackDoor(); break; case 2: - if (uiPointId == 7) + if (waypointId == 7) CreatureStartAttackDoor(); break; case 3: - if (uiPointId == 8) + if (waypointId == 8) CreatureStartAttackDoor(); break; case 4: - if (uiPointId == 5) + if (waypointId == 5) CreatureStartAttackDoor(); break; case 5: - if (uiPointId == 3) + if (waypointId == 3) CreatureStartAttackDoor(); break; } @@ -778,7 +778,7 @@ struct violet_hold_trashAI : public npc_escortAI } } - void JustDied(Unit* /*unit*/) + void JustDied(Unit* /*killer*/) { if (Creature* portal = Unit::GetCreature((*me), instance->GetData64(DATA_TELEPORTATION_PORTAL))) CAST_AI(npc_teleportation_portal_vh::npc_teleportation_portalAI, portal->AI())->SummonedMobDied(me); @@ -808,9 +808,9 @@ public: struct mob_azure_invaderAI : public violet_hold_trashAI { - mob_azure_invaderAI(Creature* c) : violet_hold_trashAI(c) + mob_azure_invaderAI(Creature* creature) : violet_hold_trashAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiCleaveTimer; @@ -886,9 +886,9 @@ public: struct mob_azure_binderAI : public violet_hold_trashAI { - mob_azure_binderAI(Creature* c) : violet_hold_trashAI(c) + mob_azure_binderAI(Creature* creature) : violet_hold_trashAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiArcaneExplosionTimer; @@ -964,9 +964,9 @@ public: struct mob_azure_mage_slayerAI : public violet_hold_trashAI { - mob_azure_mage_slayerAI(Creature* c) : violet_hold_trashAI(c) + mob_azure_mage_slayerAI(Creature* creature) : violet_hold_trashAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiArcaneEmpowermentTimer; @@ -1024,9 +1024,9 @@ public: struct mob_azure_raiderAI : public violet_hold_trashAI { - mob_azure_raiderAI(Creature* c) : violet_hold_trashAI(c) + mob_azure_raiderAI(Creature* creature) : violet_hold_trashAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiConcussionBlowTimer; @@ -1076,9 +1076,9 @@ public: struct mob_azure_stalkerAI : public violet_hold_trashAI { - mob_azure_stalkerAI(Creature* c) : violet_hold_trashAI(c) + mob_azure_stalkerAI(Creature* creature) : violet_hold_trashAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiBackstabTimer; uint32 uiTacticalBlinkTimer; @@ -1135,9 +1135,9 @@ public: struct mob_azure_spellbreakerAI : public violet_hold_trashAI { - mob_azure_spellbreakerAI(Creature* c) : violet_hold_trashAI(c) + mob_azure_spellbreakerAI(Creature* creature) : violet_hold_trashAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiArcaneBlastTimer; @@ -1219,9 +1219,9 @@ public: struct mob_azure_captainAI : public violet_hold_trashAI { - mob_azure_captainAI(Creature* c) : violet_hold_trashAI(c) + mob_azure_captainAI(Creature* creature) : violet_hold_trashAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiMortalStrikeTimer; @@ -1271,9 +1271,9 @@ public: struct mob_azure_sorcerorAI : public violet_hold_trashAI { - mob_azure_sorcerorAI(Creature* c) : violet_hold_trashAI(c) + mob_azure_sorcerorAI(Creature* creature) : violet_hold_trashAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 uiArcaneStreamTimer; diff --git a/src/server/scripts/Northrend/borean_tundra.cpp b/src/server/scripts/Northrend/borean_tundra.cpp index 11fb0933b9b..8b51618eedd 100644 --- a/src/server/scripts/Northrend/borean_tundra.cpp +++ b/src/server/scripts/Northrend/borean_tundra.cpp @@ -60,7 +60,7 @@ public: struct npc_sinkhole_kill_creditAI : public ScriptedAI { - npc_sinkhole_kill_creditAI(Creature* c) : ScriptedAI(c){} + npc_sinkhole_kill_creditAI(Creature* creature) : ScriptedAI(creature){} uint32 uiPhaseTimer; uint8 Phase; @@ -139,7 +139,7 @@ public: case 7: DoCast(me, SPELL_EXPLODE_CART, true); if (Player* caster = Unit::GetPlayer(*me, casterGuid)) - caster->KilledMonster(me->GetCreatureInfo(), me->GetGUID()); + caster->KilledMonster(me->GetCreatureTemplate(), me->GetGUID()); uiPhaseTimer = 5000; Phase = 8; break; @@ -170,7 +170,7 @@ public: struct npc_khunok_the_behemothAI : public ScriptedAI { - npc_khunok_the_behemothAI(Creature* c) : ScriptedAI(c) {} + npc_khunok_the_behemothAI(Creature* creature) : ScriptedAI(creature) {} void MoveInLineOfSight(Unit* who) { @@ -186,7 +186,7 @@ public: if (owner->GetTypeId() == TYPEID_PLAYER) { owner->CastSpell(owner, 46231, true); - CAST_CRE(who)->ForcedDespawn(); + CAST_CRE(who)->DespawnOrUnsummon(); } } } @@ -228,10 +228,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + if (action == GOSSIP_ACTION_INFO_DEF + 1) { player->CLOSE_GOSSIP_MENU(); player->CastSpell(player, SPELL_TELEPORT_TO_SARAGOSA, true); @@ -273,10 +273,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { player->CLOSE_GOSSIP_MENU(); @@ -309,7 +309,6 @@ public: bool OnGossipHello(Player* player, Creature* creature) { - if (player->GetQuestStatus(QUEST_SPIRITS_WATCH_OVER_US) == QUEST_STATUS_INCOMPLETE) player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_I, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); @@ -317,10 +316,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->CastSpell(player, SPELL_CREATURE_TOTEM_OF_ISSLIRUK, true); @@ -350,27 +349,28 @@ public: struct mob_nerubar_victimAI : public ScriptedAI { - mob_nerubar_victimAI(Creature* c) : ScriptedAI(c) {} + mob_nerubar_victimAI(Creature* creature) : ScriptedAI(creature) {} void Reset() {} void EnterCombat(Unit* /*who*/) {} void MoveInLineOfSight(Unit* /*who*/) {} - void JustDied(Unit* Killer) + void JustDied(Unit* killer) { - if (Killer->GetTypeId() == TYPEID_PLAYER) + Player* player = killer->ToPlayer(); + if (!player) + return; + + if (player->GetQuestStatus(11611) == QUEST_STATUS_INCOMPLETE) { - if (CAST_PLR(Killer)->GetQuestStatus(11611) == QUEST_STATUS_INCOMPLETE) + uint8 uiRand = urand(0, 99); + if (uiRand < 25) { - uint8 uiRand = urand(0, 99); - if (uiRand < 25) - { - Killer->CastSpell(me, 45532, true); - CAST_PLR(Killer)->KilledMonsterCredit(WARSONG_PEON, 0); - } - else if (uiRand < 75) - Killer->CastSpell(me, nerubarVictims[urand(0, 2)], true); + player->CastSpell(me, 45532, true); + player->KilledMonsterCredit(WARSONG_PEON, 0); } + else if (uiRand < 75) + player->CastSpell(me, nerubarVictims[urand(0, 2)], true); } } }; @@ -403,9 +403,9 @@ public: { me->SetReactState(REACT_PASSIVE); - if (GameObject* pGO = me->FindNearestGameObject(GO_SCOURGE_CAGE, 5.0f)) - if (pGO->GetGoState() == GO_STATE_ACTIVE) - pGO->SetGoState(GO_STATE_READY); + if (GameObject* go = me->FindNearestGameObject(GO_SCOURGE_CAGE, 5.0f)) + if (go->GetGoState() == GO_STATE_ACTIVE) + go->SetGoState(GO_STATE_READY); } }; @@ -575,7 +575,7 @@ public: struct npc_nesingwary_trapperAI : public ScriptedAI { - npc_nesingwary_trapperAI(Creature* c) : ScriptedAI(c) { c->SetVisible(false); } + npc_nesingwary_trapperAI(Creature* creature) : ScriptedAI(creature) { creature->SetVisible(false); } uint64 go_caribouGUID; uint8 Phase; @@ -588,10 +588,11 @@ public: Phase = 1; go_caribouGUID = 0; } + void EnterCombat(Unit* /*who*/) {} void MoveInLineOfSight(Unit* /*who*/) {} - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (GameObject* go_caribou = me->GetMap()->GetGameObject(go_caribouGUID)) go_caribou->SetLootState(GO_JUST_DEACTIVATED); @@ -617,7 +618,6 @@ public: uiPhaseTimer = 2000; Phase = 2; break; - case 2: if (GameObject* go_fur = me->FindNearestGameObject(GO_HIGH_QUALITY_FUR, 11.0f)) me->GetMotionMaster()->MovePoint(0, go_fur->GetPositionX(), go_fur->GetPositionY(), go_fur->GetPositionZ()); @@ -645,7 +645,6 @@ public: uiPhaseTimer = 500; Phase = 7; break; - case 7: { GameObject* go_caribou = NULL; @@ -662,7 +661,7 @@ public: Phase = 8; uiPhaseTimer = 1000; } - break; + break; case 8: DoCast(me, SPELL_TRAPPED, true); Phase = 0; @@ -718,9 +717,9 @@ public: } } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { - switch (i) + switch (waypointId) { case 0: IntroPhase = 1; @@ -849,7 +848,7 @@ public: struct npc_nexus_drake_hatchlingAI : public FollowerAI //The spell who makes the npc follow the player is missing, also we can use FollowerAI! { - npc_nexus_drake_hatchlingAI(Creature* c) : FollowerAI(c) {} + npc_nexus_drake_hatchlingAI(Creature* creature) : FollowerAI(creature) {} uint64 HarpoonerGUID; bool WithRedDragonBlood; @@ -1014,14 +1013,13 @@ public: uiPhaseTimer = 0; } - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - switch (uiPointId) + switch (waypointId) { case 3: SetEscortPaused(true); @@ -1030,18 +1028,17 @@ public: uiArthas = pArthas->GetGUID(); pArthas->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); pArthas->SetReactState(REACT_PASSIVE); - pArthas->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + pArthas->SetWalk(true); pArthas->GetMotionMaster()->MovePoint(0, 3737.374756f, 3564.841309f, 477.433014f); } if (Creature* pTalbot = me->SummonCreature(NPC_COUNSELOR_TALBOT, 3747.23f, 3614.936f, 473.321f, 4.462012f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 120000)) { uiTalbot = pTalbot->GetGUID(); - pTalbot->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + pTalbot->SetWalk(true); pTalbot->GetMotionMaster()->MovePoint(0, 3738.000977f, 3568.882080f, 477.433014f); } - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); break; - case 4: SetEscortPaused(true); uiPhase = 7; @@ -1118,13 +1115,13 @@ public: if (Creature* pArlos = me->SummonCreature(NPC_GENERAL_ARLOS, 3745.527100f, 3615.655029f, 473.321533f, 4.447805f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 120000)) { uiArlos = pArlos->GetGUID(); - pArlos->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + pArlos->SetWalk(true); pArlos->GetMotionMaster()->MovePoint(0, 3735.570068f, 3572.419922f, 477.441010f); } if (Creature* pLeryssa = me->SummonCreature(NPC_LERYSSA, 3749.654541f, 3614.959717f, 473.323486f, 4.524959f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 120000)) { uiLeryssa = pLeryssa->GetGUID(); - pLeryssa->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + pLeryssa->SetWalk(false); pLeryssa->SetReactState(REACT_PASSIVE); pLeryssa->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); pLeryssa->GetMotionMaster()->MovePoint(0, 3741.969971f, 3571.439941f, 477.441010f); @@ -1256,10 +1253,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: CAST_AI(npc_escortAI, (creature->AI()))->Start(true, false, player->GetGUID()); @@ -1446,11 +1443,11 @@ public: pArlos->Kill(pArlos, false); pLeryssa->RemoveAura(SPELL_STUN); pLeryssa->ClearUnitState(UNIT_STATE_STUNNED); - pLeryssa->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + pLeryssa->SetWalk(false); pLeryssa->GetMotionMaster()->MovePoint(0, 3722.114502f, 3564.201660f, 477.441437f); - if (killer->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(killer)->RewardPlayerAndGroupAtEvent(NPC_PRINCE_VALANAR, 0); + if (Player* player = killer->ToPlayer()) + player->RewardPlayerAndGroupAtEvent(NPC_PRINCE_VALANAR, 0); } }; @@ -1631,7 +1628,10 @@ public: StartFollow(pCaster->ToPlayer(), 0, NULL); me->UpdateEntry(NPC_CAPTURED_BERLY_SORCERER, TEAM_NEUTRAL); DoCast(me, SPELL_COSMETIC_ENSLAVE_CHAINS_SELF, true); - CAST_PLR(pCaster)->KilledMonsterCredit(NPC_CAPTURED_BERLY_SORCERER, 0); + + if (Player* player = pCaster->ToPlayer()) + player->KilledMonsterCredit(NPC_CAPTURED_BERLY_SORCERER, 0); + bEnslaved = true; } } @@ -1841,7 +1841,7 @@ public: struct npc_mootoo_the_youngerAI : public npc_escortAI { - npc_mootoo_the_youngerAI(Creature* c) : npc_escortAI(c) {} + npc_mootoo_the_youngerAI(Creature* creature) : npc_escortAI(creature) {} void Reset() { @@ -1854,35 +1854,33 @@ public: player->FailQuest(QUEST_ESCAPING_THE_MIST); } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - switch (i) + switch (waypointId) { - case 10: - me->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION); - DoScriptText(SAY_2, me); - break; - case 12: - DoScriptText(SAY_3, me); - me->HandleEmoteCommand(EMOTE_ONESHOT_LOOT); - break; - case 16: - DoScriptText(SAY_4, me); - me->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION); - break; - case 20: - me->SetPhaseMask(1, true); - DoScriptText(SAY_5, me); - me->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION); - if (player) + case 10: + me->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION); + DoScriptText(SAY_2, me); + break; + case 12: + DoScriptText(SAY_3, me); + me->HandleEmoteCommand(EMOTE_ONESHOT_LOOT); + break; + case 16: + DoScriptText(SAY_4, me); + me->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION); + break; + case 20: + me->SetPhaseMask(1, true); + DoScriptText(SAY_5, me); + me->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION); player->GroupEventHappens(QUEST_ESCAPING_THE_MIST, me); - SetRun(true); - break; + SetRun(true); + break; } } }; @@ -1926,7 +1924,7 @@ public: struct npc_bonker_togglevoltAI : public npc_escortAI { - npc_bonker_togglevoltAI(Creature* c) : npc_escortAI(c) {} + npc_bonker_togglevoltAI(Creature* creature) : npc_escortAI(creature) {} uint32 Bonker_agro; void Reset() @@ -1955,18 +1953,16 @@ public: else Bonker_agro=0; } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - switch (i) + switch (waypointId) { case 29: - if (player) - player->GroupEventHappens(QUEST_GET_ME_OUTA_HERE, me); + player->GroupEventHappens(QUEST_GET_ME_OUTA_HERE, me); break; } } @@ -2026,7 +2022,7 @@ public: struct npc_trapped_mammoth_calfAI : public ScriptedAI { - npc_trapped_mammoth_calfAI(Creature* c) : ScriptedAI(c) {} + npc_trapped_mammoth_calfAI(Creature* creature) : ScriptedAI(creature) {} uint32 uiTimer; bool bStarted; @@ -2036,7 +2032,7 @@ public: uiTimer = 1500; bStarted = false; - GameObject* pTrap; + GameObject* pTrap = NULL; for (uint8 i = 0; i < MammothTrapsNum; ++i) { pTrap = me->FindNearestGameObject(MammothTraps[i], 11.0f); @@ -2071,11 +2067,12 @@ public: void MovementInform(uint32 uiType, uint32 /*uiId*/) { - if (uiType != POINT_MOTION_TYPE) return; + me->DisappearAndDie(); - GameObject* pTrap; + + GameObject* pTrap = NULL; for (uint8 i = 0; i < MammothTrapsNum; ++i) { pTrap = me->FindNearestGameObject(MammothTraps[i], 11.0f); @@ -2114,18 +2111,21 @@ public: struct npc_magmoth_crusherAI : public ScriptedAI { - npc_magmoth_crusherAI(Creature* c) : ScriptedAI(c) {} + npc_magmoth_crusherAI(Creature* creature) : ScriptedAI(creature) {} void JustDied(Unit* killer) { - if (killer->GetTypeId() == TYPEID_PLAYER && - CAST_PLR(killer)->GetQuestStatus(QUEST_YOU_RE_NOT_SO_BIG_NOW) == QUEST_STATUS_INCOMPLETE && + Player* player = killer->ToPlayer(); + if (!player) + return; + + if (player->GetQuestStatus(QUEST_YOU_RE_NOT_SO_BIG_NOW) == QUEST_STATUS_INCOMPLETE && (me->HasAura(SPELL_AURA_NOTSOBIG_1) || me->HasAura(SPELL_AURA_NOTSOBIG_2) || me->HasAura(SPELL_AURA_NOTSOBIG_3) || me->HasAura(SPELL_AURA_NOTSOBIG_4))) { Quest const* qInfo = sObjectMgr->GetQuestTemplate(QUEST_YOU_RE_NOT_SO_BIG_NOW); if (qInfo) - CAST_PLR(killer)->KilledMonsterCredit(qInfo->RequiredNpcOrGo[0], 0); + player->KilledMonsterCredit(qInfo->RequiredNpcOrGo[0], 0); } } }; @@ -2150,13 +2150,15 @@ public: struct npc_seaforium_depth_chargeAI : public ScriptedAI { - npc_seaforium_depth_chargeAI(Creature* c) : ScriptedAI(c) {} + npc_seaforium_depth_chargeAI(Creature* creature) : ScriptedAI(creature) { } uint32 uiExplosionTimer; + void Reset() { uiExplosionTimer = urand(5000, 10000); } + void UpdateAI(const uint32 diff) { if (uiExplosionTimer < diff) @@ -2203,7 +2205,7 @@ public: struct npc_valiance_keep_cannoneerAI : public ScriptedAI { - npc_valiance_keep_cannoneerAI(Creature* c) : ScriptedAI(c) {} + npc_valiance_keep_cannoneerAI(Creature* creature) : ScriptedAI(creature) {} uint32 uiTimer; @@ -2229,7 +2231,6 @@ public: if (!UpdateVictim()) return; } - }; CreatureAI* GetAI(Creature* creature) const @@ -2540,18 +2541,18 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { player->CLOSE_GOSSIP_MENU(); creature->AI()->SetGUID(player->GetGUID()); creature->AI()->DoAction(1); } - if (uiAction == GOSSIP_ACTION_TRADE) + if (action == GOSSIP_ACTION_TRADE) player->GetSession()->SendListInventory(creature->GetGUID()); return true; @@ -2561,31 +2562,31 @@ public: void AddSC_borean_tundra() { - new npc_sinkhole_kill_credit; - new npc_khunok_the_behemoth; - new npc_keristrasza; - new npc_corastrasza; - new npc_iruk; - new mob_nerubar_victim; - new npc_scourge_prisoner; - new npc_jenny; - new npc_fezzix_geartwist; - new npc_nesingwary_trapper; - new npc_lurgglbr; - new npc_nexus_drake_hatchling; - new npc_thassarian; - new npc_image_lich_king; - new npc_counselor_talbot; - new npc_leryssa; - new npc_general_arlos; - new npc_beryl_sorcerer; - new npc_imprisoned_beryl_sorcerer; - new npc_mootoo_the_younger; - new npc_bonker_togglevolt; - new npc_trapped_mammoth_calf; - new npc_magmoth_crusher; - new npc_seaforium_depth_charge; - new npc_valiance_keep_cannoneer; - new npc_warmage_coldarra; - new npc_hidden_cultist; + new npc_sinkhole_kill_credit(); + new npc_khunok_the_behemoth(); + new npc_keristrasza(); + new npc_corastrasza(); + new npc_iruk(); + new mob_nerubar_victim(); + new npc_scourge_prisoner(); + new npc_jenny(); + new npc_fezzix_geartwist(); + new npc_nesingwary_trapper(); + new npc_lurgglbr(); + new npc_nexus_drake_hatchling(); + new npc_thassarian(); + new npc_image_lich_king(); + new npc_counselor_talbot(); + new npc_leryssa(); + new npc_general_arlos(); + new npc_beryl_sorcerer(); + new npc_imprisoned_beryl_sorcerer(); + new npc_mootoo_the_younger(); + new npc_bonker_togglevolt(); + new npc_trapped_mammoth_calf(); + new npc_magmoth_crusher(); + new npc_seaforium_depth_charge(); + new npc_valiance_keep_cannoneer(); + new npc_warmage_coldarra(); + new npc_hidden_cultist(); } diff --git a/src/server/scripts/Northrend/dalaran.cpp b/src/server/scripts/Northrend/dalaran.cpp index 258d038ee4b..e7b92732066 100644 --- a/src/server/scripts/Northrend/dalaran.cpp +++ b/src/server/scripts/Northrend/dalaran.cpp @@ -153,13 +153,13 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_TRAIN) + if (action == GOSSIP_ACTION_TRAIN) player->GetSession()->SendTrainerList(creature->GetGUID()); - if (uiAction == GOSSIP_ACTION_TRADE) + if (action == GOSSIP_ACTION_TRADE) player->GetSession()->SendListInventory(creature->GetGUID()); return true; diff --git a/src/server/scripts/Northrend/dragonblight.cpp b/src/server/scripts/Northrend/dragonblight.cpp index 0c1837ec37d..4cbe280a9f2 100644 --- a/src/server/scripts/Northrend/dragonblight.cpp +++ b/src/server/scripts/Northrend/dragonblight.cpp @@ -56,10 +56,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { player->CLOSE_GOSSIP_MENU(); player->SendMovieStart(MOVIE_ID_GATES); diff --git a/src/server/scripts/Northrend/grizzly_hills.cpp b/src/server/scripts/Northrend/grizzly_hills.cpp index ccb31c869a4..2da84dd3fdb 100644 --- a/src/server/scripts/Northrend/grizzly_hills.cpp +++ b/src/server/scripts/Northrend/grizzly_hills.cpp @@ -74,12 +74,13 @@ public: summoned->AI()->AttackStart(me->getVictim()); } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); if (!player) return; - switch (i) + + switch (waypointId) { case 9: if (Creature* Mrfloppy = GetClosestCreatureWithEntry(me, NPC_MRFLOPPY, 100.0f)) @@ -162,7 +163,7 @@ public: player->GroupEventHappens(QUEST_PERILOUS_ADVENTURE, me); DoScriptText(SAY_QUEST_COMPLETE, me, player); } - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); break; case 25: DoScriptText(SAY_VICTORY4, me); @@ -194,9 +195,7 @@ public: if (HasEscortState(STATE_ESCORT_ESCORTING)) { if (m_uiChatTimer <= uiDiff) - { m_uiChatTimer = 12000; - } else m_uiChatTimer -= uiDiff; } @@ -209,9 +208,7 @@ public: { DoScriptText(SAY_QUEST_ACCEPT, creature); if (Creature* Mrfloppy = GetClosestCreatureWithEntry(creature, NPC_MRFLOPPY, 180.0f)) - { Mrfloppy->GetMotionMaster()->MoveFollow(creature, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE); - } if (npc_escortAI* pEscortAI = CAST_AI(npc_emily::npc_emilyAI, (creature->AI()))) pEscortAI->Start(true, false, player->GetGUID()); @@ -233,7 +230,7 @@ public: struct npc_mrfloppyAI : public ScriptedAI { - npc_mrfloppyAI(Creature* c) : ScriptedAI(c) {} + npc_mrfloppyAI(Creature* creature) : ScriptedAI(creature) {} uint64 EmilyGUID; uint64 RWORGGUID; @@ -318,7 +315,7 @@ public: void SpellHit(Unit* pCaster, const SpellInfo* pSpell) { if (pSpell->Id == SPELL_OUTHOUSE_GROANS) - { + { ++m_counter; if (m_counter < 5) DoCast(pCaster, SPELL_CAMERA_SHAKE, true); @@ -327,8 +324,13 @@ public: DoCast(me, SPELL_DUST_FIELD, true); switch (m_gender) { - case GENDER_FEMALE: DoPlaySoundToSet(me, SOUND_FEMALE); break; - case GENDER_MALE: DoPlaySoundToSet(me, SOUND_MALE); break; + case GENDER_FEMALE: + DoPlaySoundToSet(me, SOUND_FEMALE); + break; + + case GENDER_MALE: + DoPlaySoundToSet(me, SOUND_MALE); + break; } } } @@ -471,13 +473,13 @@ public: struct npc_wounded_skirmisherAI : public ScriptedAI { - npc_wounded_skirmisherAI(Creature* c) : ScriptedAI(c) {} + npc_wounded_skirmisherAI(Creature* creature) : ScriptedAI(creature) {} uint64 uiPlayerGUID; uint32 DespawnTimer; - void Reset () + void Reset() { DespawnTimer = 5000; uiPlayerGUID = 0; @@ -503,7 +505,6 @@ public: me->SetStandState(UNIT_STAND_STATE_STAND); me->DespawnOrUnsummon(DespawnTimer); } - } } @@ -511,6 +512,7 @@ public: { if (!UpdateVictim()) return; + DoMeleeAttackIfReady(); } }; @@ -695,12 +697,12 @@ public: void AddSC_grizzly_hills() { - new npc_emily; - new npc_mrfloppy; - new npc_outhouse_bunny; - new npc_tallhorn_stag; - new npc_amberpine_woodsman; - new npc_wounded_skirmisher; + new npc_emily(); + new npc_mrfloppy(); + new npc_outhouse_bunny(); + new npc_tallhorn_stag(); + new npc_amberpine_woodsman(); + new npc_wounded_skirmisher(); new npc_lightning_sentry(); new npc_venture_co_straggler(); } diff --git a/src/server/scripts/Northrend/howling_fjord.cpp b/src/server/scripts/Northrend/howling_fjord.cpp index 3c44fa0eb44..88cc297868b 100644 --- a/src/server/scripts/Northrend/howling_fjord.cpp +++ b/src/server/scripts/Northrend/howling_fjord.cpp @@ -71,7 +71,7 @@ public: npc_Apothecary_HanesAI(Creature* creature) : npc_escortAI(creature){} uint32 PotTimer; - void Reset () + void Reset() { SetDespawnAtFar(false); PotTimer = 10000; //10 sec cooldown on potion @@ -97,20 +97,20 @@ public: DoMeleeAttackIfReady(); } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); if (!player) return; - switch (i) + + switch (waypointId) { case 1: me->SetReactState(REACT_AGGRESSIVE); SetRun(true); break; case 23: - if (player) - player->GroupEventHappens(QUEST_TRAIL_OF_FIRE, me); + player->GroupEventHappens(QUEST_TRAIL_OF_FIRE, me); me->DespawnOrUnsummon(); break; case 5: @@ -254,10 +254,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_RAZAEL2, creature->GetGUID()); @@ -303,10 +303,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_MG_II, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); @@ -389,7 +389,7 @@ public: { if (player->isAlive()) { - summon->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + summon->SetWalk(false); summon->GetMotionMaster()->MovePoint(0, afCenter[0], afCenter[1], afCenter[2]); summon->AI()->AttackStart(player); return; diff --git a/src/server/scripts/Northrend/icecrown.cpp b/src/server/scripts/Northrend/icecrown.cpp index 8da992af8fb..fb2e0f6c389 100644 --- a/src/server/scripts/Northrend/icecrown.cpp +++ b/src/server/scripts/Northrend/icecrown.cpp @@ -75,10 +75,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ARETE_ITEM2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); @@ -149,10 +149,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { player->CLOSE_GOSSIP_MENU(); creature->SummonCreature(NPC_ARGENT_VALIANT, 8575.451f, 952.472f, 547.554f, 0.38f); diff --git a/src/server/scripts/Northrend/sholazar_basin.cpp b/src/server/scripts/Northrend/sholazar_basin.cpp index 36dc6177f64..93d0182ea08 100644 --- a/src/server/scripts/Northrend/sholazar_basin.cpp +++ b/src/server/scripts/Northrend/sholazar_basin.cpp @@ -55,7 +55,7 @@ public: struct npc_injured_rainspeaker_oracleAI : public npc_escortAI { - npc_injured_rainspeaker_oracleAI(Creature* c) : npc_escortAI(c) { c_guid = c->GetGUID(); } + npc_injured_rainspeaker_oracleAI(Creature* creature) : npc_escortAI(creature) { c_guid = creature->GetGUID(); } uint64 c_guid; @@ -70,39 +70,40 @@ public: } } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - switch (i) + switch (waypointId) { - case 1: SetRun(); break; - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - me->RemoveUnitMovementFlag(MOVEMENTFLAG_SWIMMING); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_JUMPING); - me->SetSpeed(MOVE_SWIM, 0.85f, true); - me->AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_LEVITATING); - break; - case 19: - me->SetUnitMovementFlags(MOVEMENTFLAG_JUMPING); - break; - case 28: - player->GroupEventHappens(QUEST_FORTUNATE_MISUNDERSTANDINGS, me); - // me->RestoreFaction(); - DoScriptText(SAY_END_IRO, me); - SetRun(false); - break; + case 1: + SetRun(); + break; + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + me->RemoveUnitMovementFlag(MOVEMENTFLAG_SWIMMING); + me->RemoveUnitMovementFlag(MOVEMENTFLAG_FALLING); + me->SetSpeed(MOVE_SWIM, 0.85f, true); + me->AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_DISABLE_GRAVITY); + break; + case 19: + me->SetUnitMovementFlags(MOVEMENTFLAG_FALLING); + break; + case 28: + player->GroupEventHappens(QUEST_FORTUNATE_MISUNDERSTANDINGS, me); + // me->RestoreFaction(); + DoScriptText(SAY_END_IRO, me); + SetRun(false); + break; } } @@ -113,8 +114,8 @@ public: if (Player* player = GetPlayerForEscort()) { - if (player->GetQuestStatus(QUEST_FORTUNATE_MISUNDERSTANDINGS) != QUEST_STATUS_COMPLETE) - player->FailQuest(QUEST_FORTUNATE_MISUNDERSTANDINGS); + if (player->GetQuestStatus(QUEST_FORTUNATE_MISUNDERSTANDINGS) != QUEST_STATUS_COMPLETE) + player->FailQuest(QUEST_FORTUNATE_MISUNDERSTANDINGS); } } }; @@ -132,14 +133,14 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { CAST_AI(npc_escortAI, (creature->AI()))->Start(true, false, player->GetGUID()); CAST_AI(npc_escortAI, (creature->AI()))->SetMaxPlayerDistance(35.0f); - creature->SetUnitMovementFlags(MOVEMENTFLAG_JUMPING); + creature->SetUnitMovementFlags(MOVEMENTFLAG_FALLING); DoScriptText(SAY_START_IRO, creature); switch (player->GetTeam()){ @@ -206,10 +207,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_VEKJIK_ITEM2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); @@ -263,10 +264,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_AOF2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); @@ -305,10 +306,9 @@ public: if (me->isDead()) return; - if (me->isSummon()) - if (Unit* summoner = me->ToTempSummon()->GetSummoner()) - if (summoner) - me->GetMotionMaster()->MovePoint(0, summoner->GetPositionX(), summoner->GetPositionY(), summoner->GetPositionZ()); + if (TempSummon* summ = me->ToTempSummon()) + if (Unit* summoner = summ->GetSummoner()) + me->GetMotionMaster()->MovePoint(0, summoner->GetPositionX(), summoner->GetPositionY(), summoner->GetPositionZ()); Reset(); } @@ -359,10 +359,11 @@ public: uint32 m_uiChatTimer; - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - switch (i) + + switch (waypointId) { case 0: DoScriptText(SAY_WP_2, me); @@ -401,12 +402,12 @@ public: { m_uiChatTimer = 4000; } + void JustDied(Unit* /*killer*/) { - Player* player = GetPlayerForEscort(); if (HasEscortState(STATE_ESCORT_ESCORTING)) { - if (player) + if (Player* player = GetPlayerForEscort()) player->FailQuest(QUEST_DISASTER); } } @@ -647,11 +648,11 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); uint32 spellId = 0; - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: spellId = SPELL_ADD_ORANGE; break; case GOSSIP_ACTION_INFO_DEF + 2: spellId = SPELL_ADD_BANANAS; break; diff --git a/src/server/scripts/Northrend/storm_peaks.cpp b/src/server/scripts/Northrend/storm_peaks.cpp index 7bd59b92b7f..15239e9f836 100644 --- a/src/server/scripts/Northrend/storm_peaks.cpp +++ b/src/server/scripts/Northrend/storm_peaks.cpp @@ -61,10 +61,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { DoScriptText(SAY_AGGRO, creature); player->CLOSE_GOSSIP_MENU(); @@ -106,10 +106,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); @@ -166,10 +166,10 @@ public: return false; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->ADD_GOSSIP_ITEM(0, GOSSIP_SN1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); @@ -192,43 +192,6 @@ public: } }; -/*###### -## npc_goblin_prisoner -######*/ - -enum eGoblinPrisoner -{ - GO_RUSTY_CAGE = 191544 -}; - -class npc_goblin_prisoner : public CreatureScript -{ -public: - npc_goblin_prisoner() : CreatureScript("npc_goblin_prisoner") { } - - struct npc_goblin_prisonerAI : public ScriptedAI - { - npc_goblin_prisonerAI(Creature* creature) : ScriptedAI (creature){} - - void Reset() - { - me->SetReactState(REACT_PASSIVE); - - if (GameObject* pGO = me->FindNearestGameObject(GO_RUSTY_CAGE, 5.0f)) - { - if (pGO->GetGoState() == GO_STATE_ACTIVE) - pGO->SetGoState(GO_STATE_READY); - } - } - - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_goblin_prisonerAI(creature); - } -}; - /*###### ## npc_victorious_challenger ######*/ @@ -307,10 +270,10 @@ public: return false; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { player->CLOSE_GOSSIP_MENU(); creature->setFaction(14); @@ -363,10 +326,10 @@ public: return false; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOKLIRACRONE1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); @@ -411,18 +374,20 @@ public: { npc_injured_goblinAI(Creature* creature) : npc_escortAI(creature) { } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - switch (i) + if (!player) + return; + + switch (waypointId) { - case 26: - DoScriptText(SAY_END_WP_REACHED, me, player); - break; - case 27: - if (player) + case 26: + DoScriptText(SAY_END_WP_REACHED, me, player); + break; + case 27: player->GroupEventHappens(QUEST_BITTER_DEPARTURE, me); - break; + break; } } @@ -474,12 +439,12 @@ public: return false; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); npc_escortAI* pEscortAI = CAST_AI(npc_injured_goblin::npc_injured_goblinAI, creature->AI()); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { pEscortAI->Start(true, true, player->GetGUID()); creature->setFaction(113); @@ -585,7 +550,7 @@ public: // drake unsummoned, passengers dropped if (!me->IsOnVehicle(drake) && !hasEmptySeats) - me->ForcedDespawn(3000); + me->DespawnOrUnsummon(3000); if (enter_timer <= 0) return; @@ -602,9 +567,9 @@ public: enter_timer -= diff; } - void MoveInLineOfSight(Unit* unit) + void MoveInLineOfSight(Unit* who) { - if (!unit || !drakeGUID) + if (!who || !drakeGUID) return; Creature* drake = Unit::GetCreature(*me, drakeGUID); @@ -616,21 +581,21 @@ public: if (!me->IsOnVehicle(drake) && !me->HasAura(SPELL_ICE_PRISON)) { - if (unit->IsVehicle() && me->IsWithinDist(unit, 25.0f, true) && unit->ToCreature() && unit->ToCreature()->GetEntry() == 29709) + if (who->IsVehicle() && me->IsWithinDist(who, 25.0f, true) && who->ToCreature() && who->ToCreature()->GetEntry() == 29709) { - uint8 seat = unit->GetVehicleKit()->GetNextEmptySeat(0, true); + uint8 seat = who->GetVehicleKit()->GetNextEmptySeat(0, true); if (seat <= 0) return; - me->EnterVehicle(unit, seat); + me->EnterVehicle(who, seat); me->SendMovementFlagUpdate(); hasEmptySeats = false; } } - if (unit->ToCreature() && me->IsOnVehicle(drake)) + if (who->ToCreature() && me->IsOnVehicle(drake)) { - if (unit->ToCreature()->GetEntry() == NPC_QUEST_GIVER && me->IsWithinDist(unit, 15.0f, false)) + if (who->ToCreature()->GetEntry() == NPC_QUEST_GIVER && me->IsWithinDist(who, 15.0f, false)) { Unit* rider = drake->GetVehicleKit()->GetPassenger(0); if (!rider) @@ -640,7 +605,7 @@ public: me->ExitVehicle(); me->CastSpell(me, SPELL_SUMMON_LIBERATED, true); - me->ForcedDespawn(500); + me->DespawnOrUnsummon(500); // drake is empty now, deliver credit for drake and despawn him if (drake->GetVehicleKit()->HasEmptySeat(1) && @@ -651,7 +616,7 @@ public: if (rider->ToPlayer()) rider->ToPlayer()->KilledMonsterCredit(29709, 0); - drake->ToCreature()->ForcedDespawn(0); + drake->DespawnOrUnsummon(0); } } } @@ -706,7 +671,7 @@ public: } } - void WaypointReached(uint32 /*wp*/) + void WaypointReached(uint32 /*waypointId*/) { } @@ -746,7 +711,7 @@ class npc_hyldsmeet_protodrake : public CreatureScript class npc_hyldsmeet_protodrakeAI : public CreatureAI { public: - npc_hyldsmeet_protodrakeAI(Creature* c) : CreatureAI(c), _accessoryRespawnTimer(0), _vehicleKit(c->GetVehicleKit()) {} + npc_hyldsmeet_protodrakeAI(Creature* creature) : CreatureAI(creature), _accessoryRespawnTimer(0), _vehicleKit(creature->GetVehicleKit()) {} void PassengerBoarded(Unit* who, int8 /*seat*/, bool apply) { @@ -783,15 +748,14 @@ class npc_hyldsmeet_protodrake : public CreatureScript void AddSC_storm_peaks() { - new npc_agnetta_tyrsdottar; - new npc_frostborn_scout; - new npc_thorim; - new npc_goblin_prisoner; - new npc_victorious_challenger; - new npc_loklira_crone; - new npc_injured_goblin; - new npc_roxi_ramrocket; - new npc_brunnhildar_prisoner; - new npc_icefang; - new npc_hyldsmeet_protodrake; + new npc_agnetta_tyrsdottar(); + new npc_frostborn_scout(); + new npc_thorim(); + new npc_victorious_challenger(); + new npc_loklira_crone(); + new npc_injured_goblin(); + new npc_roxi_ramrocket(); + new npc_brunnhildar_prisoner(); + new npc_icefang(); + new npc_hyldsmeet_protodrake(); } diff --git a/src/server/scripts/Northrend/zuldrak.cpp b/src/server/scripts/Northrend/zuldrak.cpp index 0af82345dce..369f47cfb1c 100644 --- a/src/server/scripts/Northrend/zuldrak.cpp +++ b/src/server/scripts/Northrend/zuldrak.cpp @@ -52,8 +52,7 @@ public: float x, y, z; me->GetClosePoint(x, y, z, me->GetObjectSize() / 3, 0.1f); - if (Unit* summon = me->SummonCreature(NPC_RAGECLAW, x, y, z, - 0, TEMPSUMMON_DEAD_DESPAWN, 1000)) + if (Unit* summon = me->SummonCreature(NPC_RAGECLAW, x, y, z, 0, TEMPSUMMON_DEAD_DESPAWN, 1000)) { RageclawGUID = summon->GetGUID(); LockRageclaw(); @@ -92,7 +91,7 @@ public: if (Creature* pRageclaw = Unit::GetCreature(*me, RageclawGUID)) { UnlockRageclaw(pCaster); - pCaster->ToPlayer()->KilledMonster(pRageclaw->GetCreatureInfo(), RageclawGUID); + pCaster->ToPlayer()->KilledMonster(pRageclaw->GetCreatureTemplate(), RageclawGUID); me->DisappearAndDie(); } else @@ -156,7 +155,7 @@ public: me->RemoveAurasDueToSpell(SPELL_KNEEL); - me->setFaction(me->GetCreatureInfo()->faction_H); + me->setFaction(me->GetCreatureTemplate()->faction_H); DoCast(me, SPELL_UNSHACKLED, true); me->MonsterSay(SAY_RAGECLAW, LANG_UNIVERSAL, 0); @@ -223,10 +222,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { player->CLOSE_GOSSIP_MENU(); player->CastSpell(player, SPELL_GYMER, true); @@ -617,9 +616,9 @@ public: pWhisker->RemoveFromWorld(); } - void MovementInform(uint32 uiType, uint32 /*uiId*/) + void MovementInform(uint32 type, uint32 /*pointId*/) { - if (uiType != POINT_MOTION_TYPE) + if (type != EFFECT_MOTION_TYPE) return; me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); @@ -741,9 +740,9 @@ public: bEnrage = false; } - void WaypointReached(uint32 uiI) + void WaypointReached(uint32 waypointId) { - switch (uiI) + switch (waypointId) { case 6: me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0); @@ -935,9 +934,9 @@ public: bThunderClap = false; } - void WaypointReached(uint32 uiI) + void WaypointReached(uint32 waypointId) { - switch (uiI) + switch (waypointId) { case 7: me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); @@ -1072,7 +1071,7 @@ public: SummonList.clear(); - for (uint8 uiI = 0; uiI < 16 ; uiI++) + for (uint8 uiI = 0; uiI < 16; uiI++) { if (Creature* summon = me->SummonCreature(Boss[uiBossRandom].uiAdd, AddSpawnPosition[uiI])) { @@ -1328,7 +1327,7 @@ public: break; case 2: // walk forward - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); me->GetMotionMaster()->MovePoint(0, me->GetPositionX() + (cos(m_heading) * 10), me->GetPositionY() + (sin(m_heading) * 10), me->GetPositionZ()); m_uiTimer = 5000; m_uiPhase = 3; @@ -1365,10 +1364,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF +1) + if (action == GOSSIP_ACTION_INFO_DEF +1) { player->CLOSE_GOSSIP_MENU(); creature->CastSpell(player, SPELL_QUEST_CREDIT, true); @@ -1397,14 +1396,14 @@ class go_scourge_enclosure : public GameObjectScript public: go_scourge_enclosure() : GameObjectScript("go_scourge_enclosure") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { if (player->GetQuestStatus(QUEST_OUR_ONLY_HOPE) == QUEST_STATUS_INCOMPLETE) { - Creature* pGymerDummy = pGO->FindNearestCreature(NPC_GYMER_DUMMY, 20.0f); + Creature* pGymerDummy = go->FindNearestCreature(NPC_GYMER_DUMMY, 20.0f); if (pGymerDummy) { - pGO->UseDoorOrButton(); + go->UseDoorOrButton(); player->KilledMonsterCredit(pGymerDummy->GetEntry(), pGymerDummy->GetGUID()); pGymerDummy->CastSpell(pGymerDummy, 55529, true); pGymerDummy->DisappearAndDie(); diff --git a/src/server/scripts/OutdoorPvP/CMakeLists.txt b/src/server/scripts/OutdoorPvP/CMakeLists.txt index 450f0f6cc7d..237b974aa9d 100644 --- a/src/server/scripts/OutdoorPvP/CMakeLists.txt +++ b/src/server/scripts/OutdoorPvP/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2011 TrinityCore +# Copyright (C) 2008-2012 TrinityCore # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp index 6eb306b52af..1db4fb4dfc9 100755 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp @@ -244,7 +244,6 @@ void OPvPCapturePointEP_NPT::ChangeState() // complete quest objective if (m_TowerState == EP_TS_A || m_TowerState == EP_TS_H) SendObjectiveComplete(EP_NPT_CM, 0); - } void OPvPCapturePointEP_NPT::SendChangePhase() diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPEP.h b/src/server/scripts/OutdoorPvP/OutdoorPvPEP.h index e019ba7ed7b..14712e0150d 100755 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPEP.h +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPEP.h @@ -329,4 +329,3 @@ class OutdoorPvPEP : public OutdoorPvP }; #endif - diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp index 5b3468de203..38fed30f542 100755 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp @@ -176,7 +176,6 @@ OutdoorPvPZM::OutdoorPvPZM() m_GraveYard = NULL; m_AllianceTowersControlled = 0; m_HordeTowersControlled = 0; - } bool OutdoorPvPZM::SetupOutdoorPvP() diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.h b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.h index 2a11139a701..8d2124a3791 100755 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.h +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.h @@ -219,7 +219,7 @@ class OPvPCapturePointZM_GraveYard : public OPvPCapturePoint bool HandleDropFlag(Player* player, uint32 spellId); - bool CanTalkTo(Player* player, Creature* c, GossipMenuItems const& gso); + bool CanTalkTo(Player* player, Creature* creature, GossipMenuItems const& gso); uint32 GetGraveYardState() const; diff --git a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp index ef160a3a5c5..ae1a7296de6 100644 --- a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp +++ b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp @@ -53,7 +53,7 @@ public: struct mob_stolen_soulAI : public ScriptedAI { - mob_stolen_soulAI(Creature* c) : ScriptedAI(c) {} + mob_stolen_soulAI(Creature* creature) : ScriptedAI(creature) {} uint8 myClass; uint32 Class_Timer; @@ -162,7 +162,7 @@ public: struct boss_exarch_maladaarAI : public ScriptedAI { - boss_exarch_maladaarAI(Creature* c) : ScriptedAI(c) + boss_exarch_maladaarAI(Creature* creature) : ScriptedAI(creature) { HasTaunted = false; } @@ -233,7 +233,7 @@ public: DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2), me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); //When Exarch Maladar is defeated D'ore appear. @@ -319,7 +319,7 @@ public: struct mob_avatar_of_martyredAI : public ScriptedAI { - mob_avatar_of_martyredAI(Creature* c) : ScriptedAI(c) {} + mob_avatar_of_martyredAI(Creature* creature) : ScriptedAI(creature) {} uint32 Mortal_Strike_timer; diff --git a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp index d359917ab28..5fc912f2a01 100644 --- a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp +++ b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp @@ -52,7 +52,7 @@ public: struct boss_shirrak_the_dead_watcherAI : public ScriptedAI { - boss_shirrak_the_dead_watcherAI(Creature* c) : ScriptedAI(c) + boss_shirrak_the_dead_watcherAI(Creature* creature) : ScriptedAI(creature) { } @@ -170,7 +170,7 @@ public: struct mob_focus_fireAI : public ScriptedAI { - mob_focus_fireAI(Creature* c) : ScriptedAI(c) + mob_focus_fireAI(Creature* creature) : ScriptedAI(creature) { } diff --git a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp index aa63f1adf18..a4bba5f28fb 100644 --- a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp +++ b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp @@ -67,7 +67,7 @@ public: struct boss_nexusprince_shaffarAI : public ScriptedAI { - boss_nexusprince_shaffarAI(Creature* c) : ScriptedAI(c), summons(me) { HasTaunted = false; } + boss_nexusprince_shaffarAI(Creature* creature) : ScriptedAI(creature), summons(me) { HasTaunted = false; } uint32 Blink_Timer; uint32 Beacon_Timer; @@ -145,7 +145,7 @@ public: DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2), me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEAD, me); summons.DespawnAll(); @@ -233,7 +233,7 @@ public: struct mob_ethereal_beaconAI : public ScriptedAI { - mob_ethereal_beaconAI(Creature* c) : ScriptedAI(c) + mob_ethereal_beaconAI(Creature* creature) : ScriptedAI(creature) { } @@ -325,7 +325,7 @@ public: struct mob_ethereal_apprenticeAI : public ScriptedAI { - mob_ethereal_apprenticeAI(Creature* c) : ScriptedAI(c) {} + mob_ethereal_apprenticeAI(Creature* creature) : ScriptedAI(creature) {} uint32 Cast_Timer; diff --git a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp index d9ba99fcf24..487a1dd41ea 100644 --- a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp +++ b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp @@ -53,7 +53,7 @@ public: struct boss_pandemoniusAI : public ScriptedAI { - boss_pandemoniusAI(Creature* c) : ScriptedAI(c) + boss_pandemoniusAI(Creature* creature) : ScriptedAI(creature) { } @@ -68,7 +68,7 @@ public: VoidBlast_Counter = 0; } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); } diff --git a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp index 2fd7498ea82..37544f9377b 100644 --- a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp +++ b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp @@ -65,7 +65,7 @@ public: struct boss_darkweaver_sythAI : public ScriptedAI { - boss_darkweaver_sythAI(Creature* c) : ScriptedAI(c) + boss_darkweaver_sythAI(Creature* creature) : ScriptedAI(creature) { } @@ -97,7 +97,7 @@ public: DoScriptText(RAND(SAY_AGGRO_1, SAY_AGGRO_2, SAY_AGGRO_3), me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); } @@ -206,7 +206,7 @@ public: struct mob_syth_fireAI : public ScriptedAI { - mob_syth_fireAI(Creature* c) : ScriptedAI(c) + mob_syth_fireAI(Creature* creature) : ScriptedAI(creature) { } @@ -265,7 +265,7 @@ public: struct mob_syth_arcaneAI : public ScriptedAI { - mob_syth_arcaneAI(Creature* c) : ScriptedAI(c) + mob_syth_arcaneAI(Creature* creature) : ScriptedAI(creature) { } @@ -319,7 +319,7 @@ public: struct mob_syth_frostAI : public ScriptedAI { - mob_syth_frostAI(Creature* c) : ScriptedAI(c) + mob_syth_frostAI(Creature* creature) : ScriptedAI(creature) { } @@ -374,7 +374,7 @@ public: struct mob_syth_shadowAI : public ScriptedAI { - mob_syth_shadowAI(Creature* c) : ScriptedAI(c) + mob_syth_shadowAI(Creature* creature) : ScriptedAI(creature) { } diff --git a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp index c3c53416a9b..768c4bf12d3 100644 --- a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp +++ b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp @@ -64,9 +64,9 @@ public: struct boss_talon_king_ikissAI : public ScriptedAI { - boss_talon_king_ikissAI(Creature* c) : ScriptedAI(c) + boss_talon_king_ikissAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -101,7 +101,7 @@ public: DoScriptText(SAY_INTRO, me); } - if (!me->canFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) + if (!me->CanFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) return; float attackRadius = me->GetAttackDistance(who); @@ -118,7 +118,7 @@ public: DoScriptText(RAND(SAY_AGGRO_1, SAY_AGGRO_2, SAY_AGGRO_3), me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp index d3ea73c5ba0..d92e76685d1 100644 --- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp @@ -58,10 +58,10 @@ public: { boss_ambassador_hellmawAI(Creature* creature) : npc_escortAI(creature) { - m_instance = creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); } - InstanceScript* m_instance; + InstanceScript* instance; uint32 EventCheck_Timer; uint32 CorrosiveAcid_Timer; @@ -81,17 +81,17 @@ public: IsBanished = true; Enraged = false; - if (m_instance && me->isAlive()) + if (instance && me->isAlive()) { - if (m_instance->GetData(TYPE_OVERSEER) != DONE) + if (instance->GetData(TYPE_OVERSEER) != DONE) DoCast(me, SPELL_BANISH, true); } } void JustReachedHome() { - if (m_instance) - m_instance->SetData(TYPE_HELLMAW, FAIL); + if (instance) + instance->SetData(TYPE_HELLMAW, FAIL); } void MoveInLineOfSight(Unit* who) @@ -102,7 +102,7 @@ public: npc_escortAI::MoveInLineOfSight(who); } - void WaypointReached(uint32 /*i*/) + void WaypointReached(uint32 /*waypointId*/) { } @@ -114,15 +114,15 @@ public: IsBanished = false; Intro = true; - if (m_instance) + if (instance) { - if (m_instance->GetData(TYPE_HELLMAW) != FAIL) + if (instance->GetData(TYPE_HELLMAW) != FAIL) { DoScriptText(SAY_INTRO, me); Start(true, false, 0, NULL, false, true); } - m_instance->SetData(TYPE_HELLMAW, IN_PROGRESS); + instance->SetData(TYPE_HELLMAW, IN_PROGRESS); } } @@ -136,12 +136,12 @@ public: DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); - if (m_instance) - m_instance->SetData(TYPE_HELLMAW, DONE); + if (instance) + instance->SetData(TYPE_HELLMAW, DONE); } void UpdateAI(const uint32 diff) @@ -150,9 +150,9 @@ public: { if (EventCheck_Timer <= diff) { - if (m_instance) + if (instance) { - if (m_instance->GetData(TYPE_OVERSEER) == DONE) + if (instance->GetData(TYPE_OVERSEER) == DONE) { DoIntro(); return; diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_blackheart_the_inciter.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_blackheart_the_inciter.cpp index f7032d78bb6..6eac36f71c8 100644 --- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_blackheart_the_inciter.cpp +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_blackheart_the_inciter.cpp @@ -66,9 +66,9 @@ public: struct boss_blackheart_the_inciterAI : public ScriptedAI { - boss_blackheart_the_inciterAI(Creature* c) : ScriptedAI(c) + boss_blackheart_the_inciterAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -96,7 +96,7 @@ public: DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp index 81a7750d512..8d971c37559 100644 --- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp @@ -74,7 +74,7 @@ public: struct mob_voidtravelerAI : public ScriptedAI { - mob_voidtravelerAI(Creature* c) : ScriptedAI(c) + mob_voidtravelerAI(Creature* creature) : ScriptedAI(creature) { } @@ -147,9 +147,9 @@ public: struct boss_grandmaster_vorpilAI : public ScriptedAI { - boss_grandmaster_vorpilAI(Creature* c) : ScriptedAI(c) + boss_grandmaster_vorpilAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); Intro = false; } @@ -201,7 +201,7 @@ public: { for (uint8 i = 0; i < 5; ++i) { - Unit* Portal = Unit::GetUnit((*me), PortalsGuid[i]); + Unit* Portal = Unit::GetUnit(*me, PortalsGuid[i]); if (Portal && Portal->isAlive()) Portal->DealDamage(Portal, Portal->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); PortalsGuid[i] = 0; @@ -232,7 +232,7 @@ public: DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); destroyPortals(); diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp index 5fd908c44e8..99661d8818c 100644 --- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp @@ -48,7 +48,7 @@ public: struct boss_murmurAI : public ScriptedAI { - boss_murmurAI(Creature* c) : ScriptedAI(c) + boss_murmurAI(Creature* creature) : ScriptedAI(creature) { SetCombatMovement(false); } @@ -166,7 +166,7 @@ public: { std::list& m_threatlist = me->getThreatManager().getThreatList(); for (std::list::const_iterator i = m_threatlist.begin(); i != m_threatlist.end(); ++i) - if (Unit* target = Unit::GetUnit((*me), (*i)->getUnitGuid())) + if (Unit* target = Unit::GetUnit(*me, (*i)->getUnitGuid())) if (target->isAlive() && !me->IsWithinDist(target, 35, false)) DoCast(target, SPELL_THUNDERING_STORM, true); ThunderingStorm_Timer = 15000; @@ -189,7 +189,7 @@ public: { std::list& m_threatlist = me->getThreatManager().getThreatList(); for (std::list::const_iterator i = m_threatlist.begin(); i != m_threatlist.end(); ++i) - if (Unit* target = Unit::GetUnit((*me), (*i)->getUnitGuid())) + if (Unit* target = Unit::GetUnit(*me, (*i)->getUnitGuid())) if (target->isAlive() && me->IsWithinMeleeRange(target)) { me->TauntApply(target); diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/instance_shadow_labyrinth.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/instance_shadow_labyrinth.cpp index 1a9155dacb2..846669552ba 100644 --- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/instance_shadow_labyrinth.cpp +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/instance_shadow_labyrinth.cpp @@ -75,7 +75,8 @@ public: bool IsEncounterInProgress() const { for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; + if (m_auiEncounter[i] == IN_PROGRESS) + return true; return false; } diff --git a/src/server/scripts/Outland/BlackTemple/black_temple.cpp b/src/server/scripts/Outland/BlackTemple/black_temple.cpp index a934d5587c2..546f9ee1e7d 100644 --- a/src/server/scripts/Outland/BlackTemple/black_temple.cpp +++ b/src/server/scripts/Outland/BlackTemple/black_temple.cpp @@ -42,10 +42,10 @@ class npc_spirit_of_olum : public CreatureScript public: npc_spirit_of_olum() : CreatureScript("npc_spirit_of_olum") { } - bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + if (action == GOSSIP_ACTION_INFO_DEF + 1) player->CLOSE_GOSSIP_MENU(); player->InterruptNonMeleeSpells(false); diff --git a/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp b/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp index 3227e685fc4..caac89da765 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp @@ -67,9 +67,9 @@ public: struct boss_gurtogg_bloodboilAI : public ScriptedAI { - boss_gurtogg_bloodboilAI(Creature* c) : ScriptedAI(c) + boss_gurtogg_bloodboilAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -130,7 +130,7 @@ public: DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(DATA_GURTOGGBLOODBOILEVENT, DONE); @@ -186,7 +186,7 @@ public: void RevertThreatOnTarget(uint64 guid) { Unit* unit = NULL; - unit = Unit::GetUnit((*me), guid); + unit = Unit::GetUnit(*me, guid); if (unit) { if (DoGetThreat(unit)) diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp index 58f0e10c950..1926929c97c 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp @@ -379,7 +379,7 @@ public: struct flame_of_azzinothAI : public ScriptedAI { - flame_of_azzinothAI(Creature* c) : ScriptedAI(c) {} + flame_of_azzinothAI(Creature* creature) : ScriptedAI(creature) {} uint32 FlameBlastTimer; uint32 CheckTimer; @@ -392,7 +392,10 @@ public: GlaiveGUID = 0; } - void EnterCombat(Unit* /*who*/) {DoZoneInCombat();} + void EnterCombat(Unit* /*who*/) + { + DoZoneInCombat(); + } void ChargeCheck() { @@ -430,7 +433,10 @@ public: } } - void SetGlaiveGUID(uint64 guid){ GlaiveGUID = guid; } + void SetGlaiveGUID(uint64 guid) + { + GlaiveGUID = guid; + } void UpdateAI(const uint32 diff) { @@ -471,9 +477,9 @@ public: struct boss_illidan_stormrageAI : public ScriptedAI { - boss_illidan_stormrageAI(Creature* c) : ScriptedAI(c), Summons(me) + boss_illidan_stormrageAI(Creature* creature) : ScriptedAI(creature), Summons(me) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); DoCast(me, SPELL_DUAL_WIELD, true); } @@ -502,7 +508,7 @@ public: void SummonedCreatureDespawn(Creature* summon) { - if (summon->GetCreatureInfo()->Entry == FLAME_OF_AZZINOTH) + if (summon->GetCreatureTemplate()->Entry == FLAME_OF_AZZINOTH) { for (uint8 i = 0; i < 2; ++i) if (summon->GetGUID() == FlameGUID[i]) @@ -566,7 +572,9 @@ public: void KilledUnit(Unit* victim) { - if (victim == me) return; + if (victim == me) + return; + // TODO: Find better way to handle emote switch (urand(0, 1)) { @@ -747,10 +755,11 @@ public: final.y = 2 * final.y - initial.y; Creature* Trigger = me->SummonCreature(23069, initial.x, initial.y, initial.z, 0, TEMPSUMMON_TIMED_DESPAWN, 13000); - if (!Trigger) return; + if (!Trigger) + return; Trigger->SetSpeed(MOVE_WALK, 3); - Trigger->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + Trigger->SetWalk(true); Trigger->GetMotionMaster()->MovePoint(0, final.x, final.y, final.z); // Trigger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -798,7 +807,7 @@ public: { case 1: // lift off me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); - me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); + me->SetUnitMovementFlags(MOVEMENTFLAG_DISABLE_GRAVITY); me->StopMoving(); me->MonsterYell(SAY_TAKEOFF, LANG_UNIVERSAL, 0); DoPlaySoundToSet(me, SOUND_TAKEOFF); @@ -856,7 +865,7 @@ public: { if (GlaiveGUID[i]) { - Unit* Glaive = Unit::GetUnit((*me), GlaiveGUID[i]); + Unit* Glaive = Unit::GetUnit(*me, GlaiveGUID[i]); if (Glaive) { Glaive->CastSpell(me, SPELL_GLAIVE_RETURNS, false); // Make it look like the Glaive flies back up to us @@ -867,7 +876,7 @@ public: Timer[EVENT_FLIGHT_SEQUENCE] = 2000; break; case 9: // land - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetDisableGravity(false); me->StopMoving(); me->HandleEmoteCommand(EMOTE_ONESHOT_LAND); for (uint8 i = 0; i < 2; ++i) @@ -1157,7 +1166,7 @@ public: struct boss_maievAI : public ScriptedAI { - boss_maievAI(Creature* c) : ScriptedAI(c) {}; + boss_maievAI(Creature* creature) : ScriptedAI(creature) {}; uint64 IllidanGUID; @@ -1181,7 +1190,11 @@ public: void EnterCombat(Unit* /*who*/) {} void MoveInLineOfSight(Unit* /*who*/) {} void EnterEvadeMode() {} - void GetIllidanGUID(uint64 guid) { IllidanGUID = guid; } + + void GetIllidanGUID(uint64 guid) + { + IllidanGUID = guid; + } void DamageTaken(Unit* done_by, uint32 &damage) { @@ -1372,9 +1385,9 @@ public: struct npc_akama_illidanAI : public ScriptedAI { - npc_akama_illidanAI(Creature* c) : ScriptedAI(c) + npc_akama_illidanAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); JustCreated = true; } bool JustCreated; @@ -1479,7 +1492,7 @@ public: std::vector eliteList; for (std::list::const_iterator itr = threatList.begin(); itr != threatList.end(); ++itr) { - Unit* unit = Unit::GetUnit((*me), (*itr)->getUnitGuid()); + Unit* unit = Unit::GetUnit(*me, (*itr)->getUnitGuid()); if (unit && unit->GetEntry() == ILLIDARI_ELITE) eliteList.push_back(unit); } @@ -1537,7 +1550,7 @@ public: void BeginWalk() { - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); me->SetSpeed(MOVE_RUN, 1.0f); me->GetMotionMaster()->MovePoint(0, AkamaWP[WalkCount].x, AkamaWP[WalkCount].y, AkamaWP[WalkCount].z); } @@ -1636,9 +1649,9 @@ public: Unit* Channel = NULL, *Spirit[2] = { NULL, NULL }; if (ChannelCount <= 5) { - Channel = Unit::GetUnit((*me), ChannelGUID); - Spirit[0] = Unit::GetUnit((*me), SpiritGUID[0]); - Spirit[1] = Unit::GetUnit((*me), SpiritGUID[1]); + Channel = Unit::GetUnit(*me, ChannelGUID); + Spirit[0] = Unit::GetUnit(*me, SpiritGUID[0]); + Spirit[1] = Unit::GetUnit(*me, SpiritGUID[1]); if (!Channel || !Spirit[0] || !Spirit[1]) return; } @@ -1801,10 +1814,10 @@ public: } }; - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF) // Time to begin the Event + if (action == GOSSIP_ACTION_INFO_DEF) // Time to begin the Event { player->CLOSE_GOSSIP_MENU(); CAST_AI(npc_akama_illidan::npc_akama_illidanAI, creature->AI())->EnterPhase(PHASE_CHANNEL); @@ -1869,7 +1882,7 @@ void boss_illidan_stormrage::boss_illidan_stormrageAI::Reset() me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetDisableGravity(false); me->setActive(false); Summons.DespawnAll(); } @@ -1932,7 +1945,7 @@ void boss_illidan_stormrage::boss_illidan_stormrageAI::HandleTalkSequence() // Equip our warglaives! SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_ID_OFF_HAND, EQUIP_NO_CHANGE); me->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); break; case 9: if (GETCRE(Akama, AkamaGUID)) @@ -2019,7 +2032,7 @@ public: struct cage_trap_triggerAI : public ScriptedAI { - cage_trap_triggerAI(Creature* c) : ScriptedAI(c) {} + cage_trap_triggerAI(Creature* creature) : ScriptedAI(creature) {} uint64 IllidanGUID; uint32 DespawnTimer; @@ -2083,7 +2096,6 @@ public: // } } }; - }; class gameobject_cage_trap : public GameObjectScript @@ -2102,7 +2114,6 @@ public: go->SetGoState(GO_STATE_ACTIVE); return true; } - }; class mob_shadow_demon : public CreatureScript @@ -2117,11 +2128,14 @@ public: struct shadow_demonAI : public ScriptedAI { - shadow_demonAI(Creature* c) : ScriptedAI(c) {} + shadow_demonAI(Creature* creature) : ScriptedAI(creature) {} uint64 TargetGUID; - void EnterCombat(Unit* /*who*/) {DoZoneInCombat();} + void EnterCombat(Unit* /*who*/) + { + DoZoneInCombat(); + } void Reset() { @@ -2131,15 +2145,17 @@ public: void JustDied(Unit* /*killer*/) { - if (Unit* target = Unit::GetUnit((*me), TargetGUID)) + if (Unit* target = Unit::GetUnit(*me, TargetGUID)) target->RemoveAurasDueToSpell(SPELL_PARALYZE); } void UpdateAI(const uint32 /*diff*/) { - if (!UpdateVictim()) return; + if (!UpdateVictim()) + return; - if (me->getVictim()->GetTypeId() != TYPEID_PLAYER) return; // Only cast the below on players. + if (me->getVictim()->GetTypeId() != TYPEID_PLAYER) + return; // Only cast the below on players. if (!me->getVictim()->HasAura(SPELL_PARALYZE)) { @@ -2153,7 +2169,6 @@ public: DoCast(me->getVictim(), SPELL_CONSUME_SOUL); } }; - }; class mob_blade_of_azzinoth : public CreatureScript @@ -2168,7 +2183,7 @@ public: struct blade_of_azzinothAI : public NullCreatureAI { - blade_of_azzinothAI(Creature* c) : NullCreatureAI(c) {} + blade_of_azzinothAI(Creature* creature) : NullCreatureAI(creature) {} void SpellHit(Unit* /*caster*/, const SpellInfo* spell) { @@ -2192,9 +2207,9 @@ public: // Shadowfiends interact with Illidan, setting more targets in Illidan's hashmap struct mob_parasitic_shadowfiendAI : public ScriptedAI { - mob_parasitic_shadowfiendAI(Creature* c) : ScriptedAI(c) + mob_parasitic_shadowfiendAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -2212,7 +2227,10 @@ public: DoCast(me, SPELL_SHADOWFIEND_PASSIVE, true); } - void EnterCombat(Unit* /*who*/) { DoZoneInCombat(); } + void EnterCombat(Unit* /*who*/) + { + DoZoneInCombat(); + } void DoMeleeAttackIfReady() { @@ -2258,7 +2276,6 @@ public: DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_illidan() diff --git a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp index 3c7f0d3b89c..4e4607a7d44 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp @@ -90,9 +90,9 @@ public: struct boss_shahrazAI : public ScriptedAI { - boss_shahrazAI(Creature* c) : ScriptedAI(c) + boss_shahrazAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -149,7 +149,7 @@ public: DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(DATA_MOTHERSHAHRAZEVENT, DONE); @@ -250,7 +250,7 @@ public: Unit* unit = NULL; if (TargetGUID[i]) { - unit = Unit::GetUnit((*me), TargetGUID[i]); + unit = Unit::GetUnit(*me, TargetGUID[i]); if (unit) unit->CastSpell(unit, SPELL_ATTRACTION, true); TargetGUID[i] = 0; diff --git a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp index b0c29afda34..c5e78f2fa7b 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp @@ -113,7 +113,7 @@ public: struct npc_enslaved_soulAI : public ScriptedAI { - npc_enslaved_soulAI(Creature* c) : ScriptedAI(c) {} + npc_enslaved_soulAI(Creature* creature) : ScriptedAI(creature) {} uint64 ReliquaryGUID; @@ -142,9 +142,9 @@ public: struct boss_reliquary_of_soulsAI : public ScriptedAI { - boss_reliquary_of_soulsAI(Creature* c) : ScriptedAI(c) + boss_reliquary_of_soulsAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); EssenceGUID = 0; } @@ -197,8 +197,11 @@ public: uint32 random = rand()%6; float x = Coords[random].x; float y = Coords[random].y; + Creature* Soul = me->SummonCreature(CREATURE_ENSLAVED_SOUL, x, y, me->GetPositionZ(), me->GetOrientation(), TEMPSUMMON_CORPSE_DESPAWN, 0); - if (!Soul) return false; + if (!Soul) + return false; + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) { CAST_AI(npc_enslaved_soul::npc_enslaved_soulAI, Soul->AI())->ReliquaryGUID = me->GetGUID(); @@ -216,7 +219,7 @@ public: std::list::const_iterator itr = m_threatlist.begin(); for (; itr != m_threatlist.end(); ++itr) { - Unit* unit = Unit::GetUnit((*me), (*itr)->getUnitGuid()); + Unit* unit = Unit::GetUnit(*me, (*itr)->getUnitGuid()); if (unit) { DoModifyThreatPercent(unit, -100); @@ -379,7 +382,7 @@ public: struct boss_essence_of_sufferingAI : public ScriptedAI { - boss_essence_of_sufferingAI(Creature* c) : ScriptedAI(c) {} + boss_essence_of_sufferingAI(Creature* creature) : ScriptedAI(creature) {} uint64 StatAuraGUID; @@ -438,7 +441,7 @@ public: std::list::const_iterator itr = m_threatlist.begin(); for (; itr != m_threatlist.end(); ++itr) { - Unit* unit = Unit::GetUnit((*me), (*itr)->getUnitGuid()); + Unit* unit = Unit::GetUnit(*me, (*itr)->getUnitGuid()); if (unit && unit->isAlive() && (unit->GetTypeId() == TYPEID_PLAYER)) // Only alive players targets.push_back(unit); } @@ -504,7 +507,7 @@ public: struct boss_essence_of_desireAI : public ScriptedAI { - boss_essence_of_desireAI(Creature* c) : ScriptedAI(c) {} + boss_essence_of_desireAI(Creature* creature) : ScriptedAI(creature) {} uint32 RuneShieldTimer; uint32 DeadenTimer; @@ -607,7 +610,7 @@ public: struct boss_essence_of_angerAI : public ScriptedAI { - boss_essence_of_angerAI(Creature* c) : ScriptedAI(c) {} + boss_essence_of_angerAI(Creature* creature) : ScriptedAI(creature) {} uint64 AggroTargetGUID; @@ -640,7 +643,7 @@ public: DoCast(me, AURA_OF_ANGER, true); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(ANGER_SAY_DEATH, me); } diff --git a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp index 5ca3189ebca..630e44429fa 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp @@ -121,7 +121,10 @@ public: struct mob_ashtongue_channelerAI : public ScriptedAI { - mob_ashtongue_channelerAI(Creature* c) : ScriptedAI(c) {ShadeGUID = 0;} + mob_ashtongue_channelerAI(Creature* creature) : ScriptedAI(creature) + { + ShadeGUID = 0; + } uint64 ShadeGUID; @@ -147,7 +150,10 @@ public: struct mob_ashtongue_sorcererAI : public ScriptedAI { - mob_ashtongue_sorcererAI(Creature* c) : ScriptedAI(c) {ShadeGUID = 0;} + mob_ashtongue_sorcererAI(Creature* creature) : ScriptedAI(creature) + { + ShadeGUID = 0; + } uint64 ShadeGUID; uint32 CheckTimer; @@ -202,9 +208,9 @@ public: struct boss_shade_of_akamaAI : public ScriptedAI { - boss_shade_of_akamaAI(Creature* c) : ScriptedAI(c), summons(me) + boss_shade_of_akamaAI(Creature* creature) : ScriptedAI(creature), summons(me) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); AkamaGUID = instance ? instance->GetData64(DATA_AKAMA_SHADE) : 0; me->setActive(true);//if view distance is too low me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true); @@ -320,7 +326,8 @@ public: void AttackStart(Unit* who) { - if (!who || IsBanished) return; + if (!who || IsBanished) + return; if (who->isTargetableForAttack() && who != me) DoStartMovement(who); @@ -354,7 +361,7 @@ public: if (Sorcerer) { CAST_AI(mob_ashtongue_sorcerer::mob_ashtongue_sorcererAI, Sorcerer->AI())->ShadeGUID = me->GetGUID(); - Sorcerer->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + Sorcerer->SetWalk(false); Sorcerer->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()); Sorcerer->SetTarget(me->GetGUID()); Sorcerers.push_back(Sorcerer->GetGUID()); @@ -369,7 +376,7 @@ public: Creature* Spawn = me->SummonCreature(spawnEntries[i], X, Y, Z_SPAWN, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 25000); if (Spawn) { - Spawn->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + Spawn->SetWalk(false); Spawn->GetMotionMaster()->MovePoint(0, AGGRO_X, AGGRO_Y, AGGRO_Z); Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1); Spawn->AI()->AttackStart(target); @@ -430,7 +437,7 @@ public: Creature* Defender = me->SummonCreature(CREATURE_DEFENDER, SpawnLocations[ran].x, SpawnLocations[ran].y, Z_SPAWN, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 25000); if (Defender) { - Defender->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + Defender->SetWalk(false); bool move = true; if (AkamaGUID) { @@ -541,10 +548,10 @@ class npc_akama_shade : public CreatureScript public: npc_akama_shade() : CreatureScript("npc_akama_shade") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) //Fight time + if (action == GOSSIP_ACTION_INFO_DEF + 1) //Fight time { player->CLOSE_GOSSIP_MENU(); CAST_AI(npc_akama_shade::npc_akamaAI, creature->AI())->BeginEvent(player); @@ -571,11 +578,11 @@ public: struct npc_akamaAI : public ScriptedAI { - npc_akamaAI(Creature* c) : ScriptedAI(c), summons(me) + npc_akamaAI(Creature* creature) : ScriptedAI(creature), summons(me) { ShadeHasDied = false; StartCombat = false; - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); if (instance) ShadeGUID = instance->GetData64(DATA_SHADEOFAKAMA); else @@ -662,7 +669,8 @@ public: me->CombatStart(Shade); Shade->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE); Shade->SetTarget(me->GetGUID()); - if (player) Shade->AddThreat(player, 1.0f); + if (player) + Shade->AddThreat(player, 1.0f); DoZoneInCombat(Shade); EventBegun = true; } @@ -675,17 +683,19 @@ public: switch (id) { - case 0: ++WayPointId; break; + case 0: + ++WayPointId; + break; - case 1: - if (Creature* Shade = Unit::GetCreature(*me, ShadeGUID)) - { - me->SetTarget(ShadeGUID); - DoCast(Shade, SPELL_AKAMA_SOUL_RETRIEVE); - EndingTalkCount = 0; - SoulRetrieveTimer = 16000; - } - break; + case 1: + if (Creature* Shade = Unit::GetCreature(*me, ShadeGUID)) + { + me->SetTarget(ShadeGUID); + DoCast(Shade, SPELL_AKAMA_SOUL_RETRIEVE); + EndingTalkCount = 0; + SoulRetrieveTimer = 16000; + } + break; } } @@ -760,7 +770,7 @@ public: { ShadeHasDied = true; WayPointId = 0; - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); me->GetMotionMaster()->MovePoint(WayPointId, AkamaWP[0].x, AkamaWP[0].y, AkamaWP[0].z); } if (Shade && Shade->isAlive()) @@ -878,7 +888,6 @@ public: DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_shade_of_akama() diff --git a/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp b/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp index 5a02ffc891f..ce1732433c8 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp @@ -65,7 +65,7 @@ public: struct molten_flameAI : public NullCreatureAI { - molten_flameAI(Creature* c) : NullCreatureAI(c) {} + molten_flameAI(Creature* creature) : NullCreatureAI(creature) {} void InitializeAI() { @@ -91,9 +91,9 @@ public: struct boss_supremusAI : public ScriptedAI { - boss_supremusAI(Creature* c) : ScriptedAI(c), summons(me) + boss_supremusAI(Creature* creature) : ScriptedAI(creature), summons(me) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -134,7 +134,8 @@ public: if (!phase || phase == PHASE_CHASE) { phase = PHASE_STRIKE; - summons.DoAction(EVENT_VOLCANO, 0); + DummyEntryCheckPredicate pred; + summons.DoAction(EVENT_VOLCANO, pred); events.ScheduleEvent(EVENT_HATEFUL_STRIKE, 5000, GCD_CAST, PHASE_STRIKE); me->SetSpeed(MOVE_RUN, 1.2f); me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false); @@ -165,8 +166,15 @@ public: summons.DespawnAll(); } - void JustSummoned(Creature* summon) {summons.Summon(summon);} - void SummonedCreatureDespawn(Creature* summon) {summons.Despawn(summon);} + void JustSummoned(Creature* summon) + { + summons.Summon(summon); + } + + void SummonedCreatureDespawn(Creature* summon) + { + summons.Despawn(summon); + } Unit* CalculateHatefulStrikeTarget() { @@ -177,7 +185,7 @@ public: std::list::const_iterator i = m_threatlist.begin(); for (i = m_threatlist.begin(); i!= m_threatlist.end(); ++i) { - Unit* unit = Unit::GetUnit((*me), (*i)->getUnitGuid()); + Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid()); if (unit && me->IsWithinMeleeRange(unit)) { if (unit->GetHealth() > health) @@ -263,7 +271,7 @@ public: struct npc_volcanoAI : public Scripted_NoMovementAI { - npc_volcanoAI(Creature* c) : Scripted_NoMovementAI(c) {} + npc_volcanoAI(Creature* creature) : Scripted_NoMovementAI(creature) {} void Reset() { diff --git a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp index 278488eac9e..bc12a6c1c6c 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp @@ -63,7 +63,7 @@ public: struct mob_doom_blossomAI : public ScriptedAI { - mob_doom_blossomAI(Creature* c) : ScriptedAI(c) {} + mob_doom_blossomAI(Creature* creature) : ScriptedAI(creature) {} uint32 CheckTeronTimer; uint32 ShadowBoltTimer; @@ -112,9 +112,11 @@ public: return; } - void SetTeronGUID(uint64 guid){ TeronGUID = guid; } + void SetTeronGUID(uint64 guid) + { + TeronGUID = guid; + } }; - }; class mob_shadowy_construct : public CreatureScript @@ -129,7 +131,7 @@ public: struct mob_shadowy_constructAI : public ScriptedAI { - mob_shadowy_constructAI(Creature* c) : ScriptedAI(c) {} + mob_shadowy_constructAI(Creature* creature) : ScriptedAI(creature) {} uint64 GhostGUID; uint64 TeronGUID; @@ -173,7 +175,7 @@ public: std::list targets; for (; itr != m_threatlist.end(); ++itr) { - Unit* unit = Unit::GetUnit((*me), (*itr)->getUnitGuid()); + Unit* unit = Unit::GetUnit(*me, (*itr)->getUnitGuid()); if (unit && unit->isAlive()) targets.push_back(unit); } @@ -219,9 +221,9 @@ public: struct boss_teron_gorefiendAI : public ScriptedAI { - boss_teron_gorefiendAI(Creature* c) : ScriptedAI(c) + boss_teron_gorefiendAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -291,7 +293,7 @@ public: DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(DATA_TERONGOREFIENDEVENT, DONE); @@ -316,13 +318,14 @@ public: void SetThreatList(Creature* Blossom) { - if (!Blossom) return; + if (!Blossom) + return; std::list& m_threatlist = me->getThreatManager().getThreatList(); std::list::const_iterator i = m_threatlist.begin(); for (i = m_threatlist.begin(); i != m_threatlist.end(); ++i) { - Unit* unit = Unit::GetUnit((*me), (*i)->getUnitGuid()); + Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid()); if (unit && unit->isAlive()) { float threat = DoGetThreat(unit); @@ -342,7 +345,7 @@ public: Unit* Ghost = NULL; if (GhostGUID) - Ghost = Unit::GetUnit((*me), GhostGUID); + Ghost = Unit::GetUnit(*me, GhostGUID); if (Ghost && Ghost->isAlive() && Ghost->HasAura(SPELL_SHADOW_OF_DEATH)) { /*float x, y, z; @@ -389,7 +392,7 @@ public: Done = true; if (AggroTargetGUID) { - Unit* unit = Unit::GetUnit((*me), AggroTargetGUID); + Unit* unit = Unit::GetUnit(*me, AggroTargetGUID); if (unit) AttackStart(unit); diff --git a/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp b/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp index 47f82447a80..5b2bb8e7bf5 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp @@ -72,9 +72,9 @@ public: struct boss_najentusAI : public ScriptedAI { - boss_najentusAI(Creature* c) : ScriptedAI(c) + boss_najentusAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -98,7 +98,7 @@ public: events.DelayEvents(5000, GCD_YELL); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(DATA_HIGHWARLORDNAJENTUSEVENT, DONE); @@ -130,7 +130,9 @@ public: bool RemoveImpalingSpine() { - if (!SpineTargetGUID) return false; + if (!SpineTargetGUID) + return false; + Unit* target = Unit::GetUnit(*me, SpineTargetGUID); if (target && target->HasAura(SPELL_IMPALING_SPINE)) target->RemoveAurasDueToSpell(SPELL_IMPALING_SPINE); diff --git a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp index b0c6dcdda41..0742f174ccf 100644 --- a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp +++ b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp @@ -122,7 +122,7 @@ public: struct mob_blood_elf_council_voice_triggerAI : public ScriptedAI { - mob_blood_elf_council_voice_triggerAI(Creature* c) : ScriptedAI(c) + mob_blood_elf_council_voice_triggerAI(Creature* creature) : ScriptedAI(creature) { for (uint8 i = 0; i < 4; ++i) Council[i] = 0; @@ -217,9 +217,9 @@ public: struct mob_illidari_councilAI : public ScriptedAI { - mob_illidari_councilAI(Creature* c) : ScriptedAI(c) + mob_illidari_councilAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); for (uint8 i = 0; i < 4; ++i) Council[i] = 0; } @@ -299,7 +299,7 @@ public: Unit* Member = NULL; if (Council[i]) { - Member = Unit::GetUnit((*me), Council[i]); + Member = Unit::GetUnit(*me, Council[i]); if (Member && Member->isAlive()) CAST_CRE(Member)->AI()->AttackStart(target); } @@ -313,7 +313,8 @@ public: void UpdateAI(const uint32 diff) { - if (!EventBegun) return; + if (!EventBegun) + return; if (EndEventTimer) { @@ -378,9 +379,9 @@ public: struct boss_illidari_councilAI : public ScriptedAI { - boss_illidari_councilAI(Creature* c) : ScriptedAI(c) + boss_illidari_councilAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); for (uint8 i = 0; i < 4; ++i) Council[i] = 0; LoadedGUIDs = false; @@ -475,7 +476,7 @@ public: struct boss_gathios_the_shattererAI : public boss_illidari_councilAI { - boss_gathios_the_shattererAI(Creature* c) : boss_illidari_councilAI(c) {} + boss_gathios_the_shattererAI(Creature* creature) : boss_illidari_councilAI(creature) {} uint32 ConsecrationTimer; uint32 HammerOfJusticeTimer; @@ -497,7 +498,7 @@ public: DoScriptText(SAY_GATH_SLAY, me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_GATH_DEATH, me); } @@ -511,7 +512,7 @@ public: member = urand(1, 3); if (member != 2) // No need to create another pointer to us using Unit::GetUnit - unit = Unit::GetUnit((*me), Council[member]); + unit = Unit::GetUnit(*me, Council[member]); return unit; } @@ -525,7 +526,7 @@ public: } for (uint8 i = 0; i < 4; ++i) { - Unit* unit = Unit::GetUnit((*me), Council[i]); + Unit* unit = Unit::GetUnit(*me, Council[i]); if (unit) unit->CastSpell(unit, spellid, true, 0, 0, me->GetGUID()); } @@ -542,8 +543,13 @@ public: { switch (urand(0, 1)) { - case 0: DoCast(unit, SPELL_BLESS_SPELLWARD); break; - case 1: DoCast(unit, SPELL_BLESS_PROTECTION); break; + case 0: + DoCast(unit, SPELL_BLESS_SPELLWARD); + break; + + case 1: + DoCast(unit, SPELL_BLESS_PROTECTION); + break; } } BlessingTimer = 60000; @@ -602,7 +608,7 @@ public: struct boss_high_nethermancer_zerevorAI : public boss_illidari_councilAI { - boss_high_nethermancer_zerevorAI(Creature* c) : boss_illidari_councilAI(c) {} + boss_high_nethermancer_zerevorAI(Creature* creature) : boss_illidari_councilAI(creature) {} uint32 BlizzardTimer; uint32 FlamestrikeTimer; @@ -626,7 +632,7 @@ public: DoScriptText(SAY_ZERE_SLAY, me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_ZERE_DEATH, me); } @@ -706,7 +712,7 @@ public: struct boss_lady_malandeAI : public boss_illidari_councilAI { - boss_lady_malandeAI(Creature* c) : boss_illidari_councilAI(c) {} + boss_lady_malandeAI(Creature* creature) : boss_illidari_councilAI(creature) {} uint32 EmpoweredSmiteTimer; uint32 CircleOfHealingTimer; @@ -726,7 +732,7 @@ public: DoScriptText(SAY_MALA_SLAY, me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_MALA_DEATH, me); } @@ -784,7 +790,7 @@ public: struct boss_veras_darkshadowAI : public boss_illidari_councilAI { - boss_veras_darkshadowAI(Creature* c) : boss_illidari_councilAI(c) {} + boss_veras_darkshadowAI(Creature* creature) : boss_illidari_councilAI(creature) {} uint64 EnvenomTargetGUID; @@ -812,7 +818,7 @@ public: DoScriptText(SAY_VERA_SLAY, me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_VERA_DEATH, me); } diff --git a/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp b/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp index d4184a0b145..49bce6d82c0 100644 --- a/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp +++ b/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp @@ -118,7 +118,8 @@ public: bool IsEncounterInProgress() const { for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; + if (m_auiEncounter[i] == IN_PROGRESS) + return true; return false; } @@ -163,28 +164,75 @@ public: { switch (go->GetEntry()) { - case 185483: NajentusGate = go->GetGUID();// Gate past Naj'entus (at the entrance to Supermoose's courtyards) - if (m_auiEncounter[0] == DONE)HandleGameObject(0, true, go);break; - case 185882: MainTempleDoors = go->GetGUID();// Main Temple Doors - right past Supermoose (Supremus) - if (m_auiEncounter[1] == DONE)HandleGameObject(0, true, go);break; - case 185478: ShadeOfAkamaDoor = go->GetGUID();break; - case 185480: CommonDoor = go->GetGUID(); - if (m_auiEncounter[3] == DONE)HandleGameObject(0, true, go);break; - case 186153: TeronDoor = go->GetGUID(); - if (m_auiEncounter[3] == DONE)HandleGameObject(0, true, go);break; - case 185892: GuurtogDoor = go->GetGUID(); - if (m_auiEncounter[4] == DONE)HandleGameObject(0, true, go);break; - case 185479: TempleDoor = go->GetGUID(); - if (m_auiEncounter[5] == DONE)HandleGameObject(0, true, go);break; - case 185482: MotherDoor = go->GetGUID(); - if (m_auiEncounter[6] == DONE)HandleGameObject(0, true, go);break; - case 185481: CouncilDoor = go->GetGUID(); - if (m_auiEncounter[7] == DONE)HandleGameObject(0, true, go);break; - case 186152: SimpleDoor = go->GetGUID(); - if (m_auiEncounter[7] == DONE)HandleGameObject(0, true, go);break; - case 185905: IllidanGate = go->GetGUID(); break; // Gate leading to Temple Summit - case 186261: IllidanDoor[0] = go->GetGUID(); break; // Right door at Temple Summit - case 186262: IllidanDoor[1] = go->GetGUID(); break; // Left door at Temple Summit + case 185483: + NajentusGate = go->GetGUID();// Gate past Naj'entus (at the entrance to Supermoose's courtyards) + if (m_auiEncounter[0] == DONE) + HandleGameObject(0, true, go); + break; + + case 185882: + MainTempleDoors = go->GetGUID();// Main Temple Doors - right past Supermoose (Supremus) + if (m_auiEncounter[1] == DONE) + HandleGameObject(0, true, go); + break; + + case 185478: + ShadeOfAkamaDoor = go->GetGUID(); + break; + + case 185480: + CommonDoor = go->GetGUID(); + if (m_auiEncounter[3] == DONE) + HandleGameObject(0, true, go); + break; + + case 186153: + TeronDoor = go->GetGUID(); + if (m_auiEncounter[3] == DONE) + HandleGameObject(0, true, go); + break; + + case 185892: + GuurtogDoor = go->GetGUID(); + if (m_auiEncounter[4] == DONE) + HandleGameObject(0, true, go); + break; + + case 185479: + TempleDoor = go->GetGUID(); + if (m_auiEncounter[5] == DONE) + HandleGameObject(0, true, go); + break; + + case 185482: + MotherDoor = go->GetGUID(); + if (m_auiEncounter[6] == DONE) + HandleGameObject(0, true, go); + break; + + case 185481: + CouncilDoor = go->GetGUID(); + if (m_auiEncounter[7] == DONE) + HandleGameObject(0, true, go); + break; + + case 186152: + SimpleDoor = go->GetGUID(); + if (m_auiEncounter[7] == DONE) + HandleGameObject(0, true, go); + break; + + case 185905: + IllidanGate = go->GetGUID(); // Gate leading to Temple Summit + break; + + case 186261: + IllidanDoor[0] = go->GetGUID(); // Right door at Temple Summit + break; + + case 186262: + IllidanDoor[1] = go->GetGUID(); // Left door at Temple Summit + break; } } @@ -220,63 +268,65 @@ public: { case DATA_HIGHWARLORDNAJENTUSEVENT: if (data == DONE) - { HandleGameObject(NajentusGate, true); - } - m_auiEncounter[0] = data;break; + m_auiEncounter[0] = data; + break; case DATA_SUPREMUSEVENT: if (data == DONE) - { HandleGameObject(NajentusGate, true); - } - m_auiEncounter[1] = data; break; + m_auiEncounter[1] = data; + break; case DATA_SHADEOFAKAMAEVENT: if (data == IN_PROGRESS) - { HandleGameObject(ShadeOfAkamaDoor, false); - } else HandleGameObject(ShadeOfAkamaDoor, true); - m_auiEncounter[2] = data; break; + else + HandleGameObject(ShadeOfAkamaDoor, true); + m_auiEncounter[2] = data; + break; case DATA_TERONGOREFIENDEVENT: if (data == IN_PROGRESS) { HandleGameObject(TeronDoor, false); HandleGameObject(CommonDoor, false); - }else + } + else { HandleGameObject(TeronDoor, true); HandleGameObject(CommonDoor, true); } - m_auiEncounter[3] = data; break; + m_auiEncounter[3] = data; + break; case DATA_GURTOGGBLOODBOILEVENT: if (data == DONE) - { HandleGameObject(GuurtogDoor, true); - } - m_auiEncounter[4] = data; break; + m_auiEncounter[4] = data; + break; case DATA_RELIQUARYOFSOULSEVENT: if (data == DONE) - { HandleGameObject(TempleDoor, true); - } - m_auiEncounter[5] = data; break; + m_auiEncounter[5] = data; + break; case DATA_MOTHERSHAHRAZEVENT: if (data == DONE) - { HandleGameObject(MotherDoor, true); - } - m_auiEncounter[6] = data; break; + m_auiEncounter[6] = data; + break; case DATA_ILLIDARICOUNCILEVENT: if (data == IN_PROGRESS) { HandleGameObject(CouncilDoor, false); HandleGameObject(SimpleDoor, false); - }else + } + else { HandleGameObject(CouncilDoor, true); HandleGameObject(SimpleDoor, true); } - m_auiEncounter[7] = data; break; - case DATA_ILLIDANSTORMRAGEEVENT: m_auiEncounter[8] = data; break; + m_auiEncounter[7] = data; + break; + case DATA_ILLIDANSTORMRAGEEVENT: + m_auiEncounter[8] = data; + break; } if (data == DONE) diff --git a/src/server/scripts/Outland/CMakeLists.txt b/src/server/scripts/Outland/CMakeLists.txt index 229f7de72ec..6056fa8b143 100644 --- a/src/server/scripts/Outland/CMakeLists.txt +++ b/src/server/scripts/Outland/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2011 TrinityCore +# Copyright (C) 2008-2012 TrinityCore # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp index 9edc7179d5e..3937b213e7e 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp @@ -107,9 +107,9 @@ public: struct boss_fathomlord_karathressAI : public ScriptedAI { - boss_fathomlord_karathressAI(Creature* c) : ScriptedAI(c) + boss_fathomlord_karathressAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); Advisors[0] = 0; Advisors[1] = 0; Advisors[2] = 0; @@ -225,7 +225,7 @@ public: //Only if not incombat check if the event is started if (!me->isInCombat() && instance && instance->GetData(DATA_KARATHRESSEVENT)) { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_KARATHRESSEVENT_STARTER)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_KARATHRESSEVENT_STARTER)); if (target) { @@ -317,9 +317,9 @@ public: struct boss_fathomguard_sharkkisAI : public ScriptedAI { - boss_fathomguard_sharkkisAI(Creature* c) : ScriptedAI(c) + boss_fathomguard_sharkkisAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -354,7 +354,7 @@ public: instance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { if (instance) { @@ -381,7 +381,7 @@ public: //Only if not incombat check if the event is started if (!me->isInCombat() && instance && instance->GetData(DATA_KARATHRESSEVENT)) { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_KARATHRESSEVENT_STARTER)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_KARATHRESSEVENT_STARTER)); if (target) { @@ -471,9 +471,9 @@ public: struct boss_fathomguard_tidalvessAI : public ScriptedAI { - boss_fathomguard_tidalvessAI(Creature* c) : ScriptedAI(c) + boss_fathomguard_tidalvessAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -494,7 +494,7 @@ public: instance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { if (instance) { @@ -522,7 +522,7 @@ public: //Only if not incombat check if the event is started if (!me->isInCombat() && instance && instance->GetData(DATA_KARATHRESSEVENT)) { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_KARATHRESSEVENT_STARTER)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_KARATHRESSEVENT_STARTER)); if (target) { @@ -598,9 +598,9 @@ public: struct boss_fathomguard_caribdisAI : public ScriptedAI { - boss_fathomguard_caribdisAI(Creature* c) : ScriptedAI(c) + boss_fathomguard_caribdisAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -621,7 +621,7 @@ public: instance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { if (instance) { @@ -648,7 +648,7 @@ public: //Only if not incombat check if the event is started if (!me->isInCombat() && instance && instance->GetData(DATA_KARATHRESSEVENT)) { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_KARATHRESSEVENT_STARTER)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_KARATHRESSEVENT_STARTER)); if (target) { @@ -691,7 +691,7 @@ public: Creature* Cyclone = me->SummonCreature(CREATURE_CYCLONE, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), float(rand()%5), TEMPSUMMON_TIMED_DESPAWN, 15000); if (Cyclone) { - CAST_CRE(Cyclone)->SetFloatValue(OBJECT_FIELD_SCALE_X, 3.0f); + CAST_CRE(Cyclone)->SetObjectScale(3.0f); Cyclone->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); Cyclone->setFaction(me->getFaction()); Cyclone->CastSpell(Cyclone, SPELL_CYCLONE_CYCLONE, true); @@ -730,13 +730,13 @@ public: switch (rand()%4) { case 0: - unit = Unit::GetUnit((*me), instance->GetData64(DATA_KARATHRESS)); + unit = Unit::GetUnit(*me, instance->GetData64(DATA_KARATHRESS)); break; case 1: - unit = Unit::GetUnit((*me), instance->GetData64(DATA_SHARKKIS)); + unit = Unit::GetUnit(*me, instance->GetData64(DATA_SHARKKIS)); break; case 2: - unit = Unit::GetUnit((*me), instance->GetData64(DATA_TIDALVESS)); + unit = Unit::GetUnit(*me, instance->GetData64(DATA_TIDALVESS)); break; case 3: unit = me; diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp index 6f020c16402..7abd2bbc8a8 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp @@ -88,9 +88,9 @@ public: struct boss_hydross_the_unstableAI : public ScriptedAI { - boss_hydross_the_unstableAI(Creature* c) : ScriptedAI(c), Summons(me) + boss_hydross_the_unstableAI(Creature* creature) : ScriptedAI(creature), Summons(me) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -177,13 +177,9 @@ public: void KilledUnit(Unit* /*victim*/) { if (CorruptedForm) - { DoScriptText(RAND(SAY_CORRUPT_SLAY1, SAY_CORRUPT_SLAY2), me); - } else - { DoScriptText(RAND(SAY_CLEAN_SLAY1, SAY_CLEAN_SLAY2), me); - } } void JustSummoned(Creature* summoned) @@ -207,7 +203,7 @@ public: Summons.Despawn(summon); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { if (CorruptedForm) DoScriptText(SAY_CORRUPT_DEATH, me); @@ -242,12 +238,29 @@ public: switch (MarkOfCorruption_Count) { - case 0: mark_spell = SPELL_MARK_OF_CORRUPTION1; break; - case 1: mark_spell = SPELL_MARK_OF_CORRUPTION2; break; - case 2: mark_spell = SPELL_MARK_OF_CORRUPTION3; break; - case 3: mark_spell = SPELL_MARK_OF_CORRUPTION4; break; - case 4: mark_spell = SPELL_MARK_OF_CORRUPTION5; break; - case 5: mark_spell = SPELL_MARK_OF_CORRUPTION6; break; + case 0: + mark_spell = SPELL_MARK_OF_CORRUPTION1; + break; + + case 1: + mark_spell = SPELL_MARK_OF_CORRUPTION2; + break; + + case 2: + mark_spell = SPELL_MARK_OF_CORRUPTION3; + break; + + case 3: + mark_spell = SPELL_MARK_OF_CORRUPTION4; + break; + + case 4: + mark_spell = SPELL_MARK_OF_CORRUPTION5; + break; + + case 5: + mark_spell = SPELL_MARK_OF_CORRUPTION6; + break; } DoCast(me->getVictim(), mark_spell); @@ -309,12 +322,29 @@ public: switch (MarkOfHydross_Count) { - case 0: mark_spell = SPELL_MARK_OF_HYDROSS1; break; - case 1: mark_spell = SPELL_MARK_OF_HYDROSS2; break; - case 2: mark_spell = SPELL_MARK_OF_HYDROSS3; break; - case 3: mark_spell = SPELL_MARK_OF_HYDROSS4; break; - case 4: mark_spell = SPELL_MARK_OF_HYDROSS5; break; - case 5: mark_spell = SPELL_MARK_OF_HYDROSS6; break; + case 0: + mark_spell = SPELL_MARK_OF_HYDROSS1; + break; + + case 1: + mark_spell = SPELL_MARK_OF_HYDROSS2; + break; + + case 2: + mark_spell = SPELL_MARK_OF_HYDROSS3; + break; + + case 3: + mark_spell = SPELL_MARK_OF_HYDROSS4; + break; + + case 4: + mark_spell = SPELL_MARK_OF_HYDROSS5; + break; + + case 5: + mark_spell = SPELL_MARK_OF_HYDROSS6; + break; } DoCast(me->getVictim(), mark_spell); @@ -375,7 +405,6 @@ public: DoMeleeAttackIfReady(); } }; - }; void AddSC_boss_hydross_the_unstable() diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp index 33ce04e45e3..18d8b2b5a1e 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp @@ -25,7 +25,6 @@ EndScriptData */ #include "ScriptPCH.h" #include "serpent_shrine.h" -#include "ScriptedSimpleAI.h" #include "Spell.h" #define SAY_INTRO -1548042 @@ -132,7 +131,6 @@ float ShieldGeneratorChannelPos[4][4] = {49.3126f, -943.398f, 42.5501f, 2.40174f} }; -//Lady Vashj AI class boss_lady_vashj : public CreatureScript { public: @@ -145,12 +143,12 @@ public: struct boss_lady_vashjAI : public ScriptedAI { - boss_lady_vashjAI (Creature* c) : ScriptedAI(c) + boss_lady_vashjAI (Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); Intro = false; JustCreated = true; - c->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); //set it only once on Creature create (no need do intro if wiped) + creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); // set it only once on Creature create (no need do intro if wiped) } InstanceScript* instance; @@ -158,18 +156,18 @@ public: uint64 ShieldGeneratorChannel[4]; uint32 AggroTimer; - uint32 ShockBlast_Timer; - uint32 Entangle_Timer; - uint32 StaticCharge_Timer; - uint32 ForkedLightning_Timer; - uint32 Check_Timer; - uint32 EnchantedElemental_Timer; - uint32 TaintedElemental_Timer; - uint32 CoilfangElite_Timer; - uint32 CoilfangStrider_Timer; - uint32 SummonSporebat_Timer; - uint32 SummonSporebat_StaticTimer; - uint8 EnchantedElemental_Pos; + uint32 ShockBlastTimer; + uint32 EntangleTimer; + uint32 StaticChargeTimer; + uint32 ForkedLightningTimer; + uint32 CheckTimer; + uint32 EnchantedElementalTimer; + uint32 TaintedElementalTimer; + uint32 CoilfangEliteTimer; + uint32 CoilfangStriderTimer; + uint32 SummonSporebatTimer; + uint32 SummonSporebatStaticTimer; + uint8 EnchantedElementalPos; uint8 Phase; bool Entangle; @@ -180,18 +178,18 @@ public: void Reset() { AggroTimer = 19000; - ShockBlast_Timer = 1+rand()%60000; - Entangle_Timer = 30000; - StaticCharge_Timer = 10000+rand()%15000; - ForkedLightning_Timer = 2000; - Check_Timer = 15000; - EnchantedElemental_Timer = 5000; - TaintedElemental_Timer = 50000; - CoilfangElite_Timer = 45000+rand()%5000; - CoilfangStrider_Timer = 60000+rand()%10000; - SummonSporebat_Timer = 10000; - SummonSporebat_StaticTimer = 30000; - EnchantedElemental_Pos = 0; + ShockBlastTimer = 1+rand()%60000; + EntangleTimer = 30000; + StaticChargeTimer = 10000+rand()%15000; + ForkedLightningTimer = 2000; + CheckTimer = 15000; + EnchantedElementalTimer = 5000; + TaintedElementalTimer = 50000; + CoilfangEliteTimer = 45000+rand()%5000; + CoilfangStriderTimer = 60000+rand()%10000; + SummonSporebatTimer = 10000; + SummonSporebatStaticTimer = 30000; + EnchantedElementalPos = 0; Phase = 0; Entangle = false; @@ -201,13 +199,10 @@ public: JustCreated = false; } else CanAttack = true; - Unit* remo; + for (uint8 i = 0; i < 4; ++i) - { - remo = Unit::GetUnit(*me, ShieldGeneratorChannel[i]); - if (remo) + if (Unit* remo = Unit::GetUnit(*me, ShieldGeneratorChannel[i])) remo->setDeathState(JUST_DIED); - } if (instance) instance->SetData(DATA_LADYVASHJEVENT, NOT_STARTED); @@ -219,19 +214,19 @@ public: me->SetCorpseDelay(1000*60*60); } - //Called when a tainted elemental dies + // Called when a tainted elemental dies void EventTaintedElementalDeath() { - //the next will spawn 50 seconds after the previous one's death - if (TaintedElemental_Timer > 50000) - TaintedElemental_Timer = 50000; + // the next will spawn 50 seconds after the previous one's death + if (TaintedElementalTimer > 50000) + TaintedElementalTimer = 50000; } void KilledUnit(Unit* /*victim*/) { DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2, SAY_SLAY3), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); @@ -253,18 +248,14 @@ public: { if (instance) { - //remove old tainted cores to prevent cheating in phase 2 + // remove old tainted cores to prevent cheating in phase 2 Map* map = me->GetMap(); Map::PlayerList const &PlayerList = map->GetPlayers(); - for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - { - if (Player* i_pl = i->getSource()) - { - i_pl->DestroyItemCount(31088, 1, true); - } - } + for (Map::PlayerList::const_iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr) + if (Player* player = itr->getSource()) + player->DestroyItemCount(31088, 1, true); } - StartEvent();//this is EnterCombat(), so were are 100% in combat, start the event + StartEvent(); // this is EnterCombat(), so were are 100% in combat, start the event if (Phase != 2) AttackStart(who); @@ -287,10 +278,7 @@ public: float attackRadius = me->GetAttackDistance(who); if (me->IsWithinDistInMap(who, attackRadius) && me->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && me->IsWithinLOSInMap(who)) { - //if (who->HasStealthAura()) - // who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); - - if (!me->isInCombat())//AttackStart() sets UNIT_FLAG_IN_COMBAT, so this msut be before attacking + if (!me->isInCombat()) // AttackStart() sets UNIT_FLAG_IN_COMBAT, so this msut be before attacking StartEvent(); if (Phase != 2) @@ -304,13 +292,13 @@ public: switch (urand(0, 1)) { case 0: - //Shoot - //Used in Phases 1 and 3 after Entangle or while having nobody in melee range. A shot that hits her target for 4097-5543 Physical damage. + // Shoot + // Used in Phases 1 and 3 after Entangle or while having nobody in melee range. A shot that hits her target for 4097-5543 Physical damage. DoCast(me->getVictim(), SPELL_SHOOT); break; case 1: - //Multishot - //Used in Phases 1 and 3 after Entangle or while having nobody in melee range. A shot that hits 1 person and 4 people around him for 6475-7525 physical damage. + // Multishot + // Used in Phases 1 and 3 after Entangle or while having nobody in melee range. A shot that hits 1 person and 4 people around him for 6475-7525 physical damage. DoCast(me->getVictim(), SPELL_MULTI_SHOT); break; } @@ -329,231 +317,209 @@ public: CanAttack = true; me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); AggroTimer=19000; - }else + } + else { AggroTimer-=diff; return; } } - //to prevent abuses during phase 2 + // to prevent abuses during phase 2 if (Phase == 2 && !me->getVictim() && me->isInCombat()) { EnterEvadeMode(); return; } - //Return since we have no target + // Return since we have no target if (!UpdateVictim()) return; if (Phase == 1 || Phase == 3) { - //ShockBlast_Timer - if (ShockBlast_Timer <= diff) + // ShockBlastTimer + if (ShockBlastTimer <= diff) { - //Shock Burst - //Randomly used in Phases 1 and 3 on Vashj's target, it's a Shock spell doing 8325-9675 nature damage and stunning the target for 5 seconds, during which she will not attack her target but switch to the next person on the aggro list. + // Shock Burst + // Randomly used in Phases 1 and 3 on Vashj's target, it's a Shock spell doing 8325-9675 nature damage and stunning the target for 5 seconds, during which she will not attack her target but switch to the next person on the aggro list. DoCast(me->getVictim(), SPELL_SHOCK_BLAST); me->TauntApply(me->getVictim()); - ShockBlast_Timer = 1000+rand()%14000; //random cooldown - } else ShockBlast_Timer -= diff; + ShockBlastTimer = 1000+rand()%14000; // random cooldown + } else ShockBlastTimer -= diff; - //StaticCharge_Timer - if (StaticCharge_Timer <= diff) + // StaticChargeTimer + if (StaticChargeTimer <= diff) { - //Static Charge - //Used on random people (only 1 person at any given time) in Phases 1 and 3, it's a debuff doing 2775 to 3225 Nature damage to the target and everybody in about 5 yards around it, every 1 seconds for 30 seconds. It can be removed by Cloak of Shadows, Iceblock, Divine Shield, etc, but not by Cleanse or Dispel Magic. - Unit* target = NULL; - target = SelectTarget(SELECT_TARGET_RANDOM, 0, 200, true); - - if (target && !target->HasAura(SPELL_STATIC_CHARGE_TRIGGER)) - //cast Static Charge every 2 seconds for 20 seconds - DoCast(target, SPELL_STATIC_CHARGE_TRIGGER); + // Static Charge + // Used on random people (only 1 person at any given time) in Phases 1 and 3, it's a debuff doing 2775 to 3225 Nature damage to the target and everybody in about 5 yards around it, every 1 seconds for 30 seconds. It can be removed by Cloak of Shadows, Iceblock, Divine Shield, etc, but not by Cleanse or Dispel Magic. + Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 200, true); + if (target && !target->HasAura(SPELL_STATIC_CHARGE_TRIGGER)) + DoCast(target, SPELL_STATIC_CHARGE_TRIGGER); // cast Static Charge every 2 seconds for 20 seconds - StaticCharge_Timer = 10000+rand()%20000; //blizzlike - } else StaticCharge_Timer -= diff; + StaticChargeTimer = 10000+rand()%20000; + } else StaticChargeTimer -= diff; - //Entangle_Timer - if (Entangle_Timer <= diff) + // EntangleTimer + if (EntangleTimer <= diff) { if (!Entangle) { - //Entangle - //Used in Phases 1 and 3, it casts Entangling Roots on everybody in a 15 yard radius of Vashj, immobilzing them for 10 seconds and dealing 500 damage every 2 seconds. It's not a magic effect so it cannot be dispelled, but is removed by various buffs such as Cloak of Shadows or Blessing of Freedom. + // Entangle + // Used in Phases 1 and 3, it casts Entangling Roots on everybody in a 15 yard radius of Vashj, immobilzing them for 10 seconds and dealing 500 damage every 2 seconds. It's not a magic effect so it cannot be dispelled, but is removed by various buffs such as Cloak of Shadows or Blessing of Freedom. DoCast(me->getVictim(), SPELL_ENTANGLE); Entangle = true; - Entangle_Timer = 10000; + EntangleTimer = 10000; } else { CastShootOrMultishot(); Entangle = false; - Entangle_Timer = 20000+rand()%5000; + EntangleTimer = 20000+rand()%5000; } - } else Entangle_Timer -= diff; + } else EntangleTimer -= diff; - //Phase 1 + // Phase 1 if (Phase == 1) { - //Start phase 2 + // Start phase 2 if (HealthBelowPct(70)) { - //Phase 2 begins when Vashj hits 70%. She will run to the middle of her platform and surround herself in a shield making her invulerable. + // Phase 2 begins when Vashj hits 70%. She will run to the middle of her platform and surround herself in a shield making her invulerable. Phase = 2; me->GetMotionMaster()->Clear(); DoTeleportTo(MIDDLE_X, MIDDLE_Y, MIDDLE_Z); - Creature* creature; for (uint8 i = 0; i < 4; ++i) - { - creature = me->SummonCreature(SHIED_GENERATOR_CHANNEL, ShieldGeneratorChannelPos[i][0], ShieldGeneratorChannelPos[i][1], ShieldGeneratorChannelPos[i][2], ShieldGeneratorChannelPos[i][3], TEMPSUMMON_CORPSE_DESPAWN, 0); - if (creature) + if (Creature* creature = me->SummonCreature(SHIED_GENERATOR_CHANNEL, ShieldGeneratorChannelPos[i][0], ShieldGeneratorChannelPos[i][1], ShieldGeneratorChannelPos[i][2], ShieldGeneratorChannelPos[i][3], TEMPSUMMON_CORPSE_DESPAWN, 0)) ShieldGeneratorChannel[i] = creature->GetGUID(); - } + DoScriptText(SAY_PHASE2, me); } } - //Phase 3 + // Phase 3 else { - //SummonSporebat_Timer - if (SummonSporebat_Timer <= diff) + // SummonSporebatTimer + if (SummonSporebatTimer <= diff) { - Creature* Sporebat = NULL; - Sporebat = me->SummonCreature(TOXIC_SPOREBAT, SPOREBAT_X, SPOREBAT_Y, SPOREBAT_Z, SPOREBAT_O, TEMPSUMMON_CORPSE_DESPAWN, 0); + if (Creature* sporebat = me->SummonCreature(TOXIC_SPOREBAT, SPOREBAT_X, SPOREBAT_Y, SPOREBAT_Z, SPOREBAT_O, TEMPSUMMON_CORPSE_DESPAWN, 0)) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) + sporebat->AI()->AttackStart(target); - if (Sporebat) - { - Unit* target = NULL; - target = SelectTarget(SELECT_TARGET_RANDOM, 0); - if (target) - Sporebat->AI()->AttackStart(target); - } + // summon sporebats faster and faster + if (SummonSporebatStaticTimer > 1000) + SummonSporebatStaticTimer -= 1000; - //summon sporebats faster and faster - if (SummonSporebat_StaticTimer > 1000) - SummonSporebat_StaticTimer -= 1000; + SummonSporebatTimer = SummonSporebatStaticTimer; - SummonSporebat_Timer = SummonSporebat_StaticTimer; + if (SummonSporebatTimer < 5000) + SummonSporebatTimer = 5000; - if (SummonSporebat_Timer < 5000) - SummonSporebat_Timer = 5000; - - } else SummonSporebat_Timer -= diff; + } else SummonSporebatTimer -= diff; } - //Melee attack + // Melee attack DoMeleeAttackIfReady(); - //Check_Timer - used to check if somebody is in melee range - if (Check_Timer <= diff) + // CheckTimer - used to check if somebody is in melee range + if (CheckTimer <= diff) { - bool InMeleeRange = false; - Unit* target; + bool inMeleeRange = false; std::list t_list = me->getThreatManager().getThreatList(); for (std::list::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) { - target = Unit::GetUnit(*me, (*itr)->getUnitGuid()); - //if in melee range - if (target && target->IsWithinDistInMap(me, 5)) + Unit* target = Unit::GetUnit(*me, (*itr)->getUnitGuid()); + if (target && target->IsWithinDistInMap(me, 5)) // if in melee range { - InMeleeRange = true; + inMeleeRange = true; break; } } - //if nobody is in melee range - if (!InMeleeRange) + // if nobody is in melee range + if (!inMeleeRange) CastShootOrMultishot(); - Check_Timer = 5000; - } else Check_Timer -= diff; + CheckTimer = 5000; + } else CheckTimer -= diff; } - //Phase 2 + // Phase 2 else { - //ForkedLightning_Timer - if (ForkedLightning_Timer <= diff) + // ForkedLightningTimer + if (ForkedLightningTimer <= diff) { - //Forked Lightning - //Used constantly in Phase 2, it shoots out completely randomly targeted bolts of lightning which hit everybody in a roughtly 60 degree cone in front of Vashj for 2313-2687 nature damage. - Unit* target = NULL; - target = SelectTarget(SELECT_TARGET_RANDOM, 0); + // Forked Lightning + // Used constantly in Phase 2, it shoots out completely randomly targeted bolts of lightning which hit everybody in a roughtly 60 degree cone in front of Vashj for 2313-2687 nature damage. + Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0); if (!target) target = me->getVictim(); DoCast(target, SPELL_FORKED_LIGHTNING); - ForkedLightning_Timer = 2000+rand()%6000; //blizzlike - } else ForkedLightning_Timer -= diff; + ForkedLightningTimer = 2000+rand()%6000; + } else ForkedLightningTimer -= diff; - //EnchantedElemental_Timer - if (EnchantedElemental_Timer <= diff) + // EnchantedElementalTimer + if (EnchantedElementalTimer <= diff) { - me->SummonCreature(ENCHANTED_ELEMENTAL, ElementPos[EnchantedElemental_Pos][0], ElementPos[EnchantedElemental_Pos][1], ElementPos[EnchantedElemental_Pos][2], ElementPos[EnchantedElemental_Pos][3], TEMPSUMMON_CORPSE_DESPAWN, 0); + me->SummonCreature(ENCHANTED_ELEMENTAL, ElementPos[EnchantedElementalPos][0], ElementPos[EnchantedElementalPos][1], ElementPos[EnchantedElementalPos][2], ElementPos[EnchantedElementalPos][3], TEMPSUMMON_CORPSE_DESPAWN, 0); - if (EnchantedElemental_Pos == 7) - EnchantedElemental_Pos = 0; + if (EnchantedElementalPos == 7) + EnchantedElementalPos = 0; else - ++EnchantedElemental_Pos; + ++EnchantedElementalPos; - EnchantedElemental_Timer = 10000+rand()%5000; - } else EnchantedElemental_Timer -= diff; + EnchantedElementalTimer = 10000+rand()%5000; + } else EnchantedElementalTimer -= diff; - //TaintedElemental_Timer - if (TaintedElemental_Timer <= diff) + // TaintedElementalTimer + if (TaintedElementalTimer <= diff) { uint32 pos = rand()%8; me->SummonCreature(TAINTED_ELEMENTAL, ElementPos[pos][0], ElementPos[pos][1], ElementPos[pos][2], ElementPos[pos][3], TEMPSUMMON_DEAD_DESPAWN, 0); - TaintedElemental_Timer = 120000; - } else TaintedElemental_Timer -= diff; + TaintedElementalTimer = 120000; + } else TaintedElementalTimer -= diff; - //CoilfangElite_Timer - if (CoilfangElite_Timer <= diff) + // CoilfangEliteTimer + if (CoilfangEliteTimer <= diff) { uint32 pos = rand()%3; - Creature* CoilfangElite = NULL; - CoilfangElite = me->SummonCreature(COILFANG_ELITE, CoilfangElitePos[pos][0], CoilfangElitePos[pos][1], CoilfangElitePos[pos][2], CoilfangElitePos[pos][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - if (CoilfangElite) + Creature* coilfangElite = me->SummonCreature(COILFANG_ELITE, CoilfangElitePos[pos][0], CoilfangElitePos[pos][1], CoilfangElitePos[pos][2], CoilfangElitePos[pos][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + if (coilfangElite) { - Unit* target = NULL; - target = SelectTarget(SELECT_TARGET_RANDOM, 0); - if (target) - CoilfangElite->AI()->AttackStart(target); + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) + coilfangElite->AI()->AttackStart(target); else if (me->getVictim()) - CoilfangElite->AI()->AttackStart(me->getVictim()); + coilfangElite->AI()->AttackStart(me->getVictim()); } - CoilfangElite_Timer = 45000+rand()%5000; - } else CoilfangElite_Timer -= diff; + CoilfangEliteTimer = 45000+rand()%5000; + } else CoilfangEliteTimer -= diff; - //CoilfangStrider_Timer - if (CoilfangStrider_Timer <= diff) + // CoilfangStriderTimer + if (CoilfangStriderTimer <= diff) { uint32 pos = rand()%3; - Creature* CoilfangStrider = NULL; - CoilfangStrider = me->SummonCreature(COILFANG_STRIDER, CoilfangStriderPos[pos][0], CoilfangStriderPos[pos][1], CoilfangStriderPos[pos][2], CoilfangStriderPos[pos][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - if (CoilfangStrider) + if (Creature* CoilfangStrider = me->SummonCreature(COILFANG_STRIDER, CoilfangStriderPos[pos][0], CoilfangStriderPos[pos][1], CoilfangStriderPos[pos][2], CoilfangStriderPos[pos][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000)) { - Unit* target = NULL; - target = SelectTarget(SELECT_TARGET_RANDOM, 0); - if (target) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) CoilfangStrider->AI()->AttackStart(target); else if (me->getVictim()) CoilfangStrider->AI()->AttackStart(me->getVictim()); } - CoilfangStrider_Timer = 60000+rand()%10000; - } else CoilfangStrider_Timer -= diff; + CoilfangStriderTimer = 60000+rand()%10000; + } else CoilfangStriderTimer -= diff; - //Check_Timer - if (Check_Timer <= diff) + // CheckTimer + if (CheckTimer <= diff) { - //Start Phase 3 + // Start Phase 3 if (instance && instance->GetData(DATA_CANSTARTPHASE3)) { - //set life 50% + // set life 50% me->SetHealth(me->CountPctFromMaxHealth(50)); me->RemoveAurasDueToSpell(SPELL_MAGIC_BARRIER); @@ -562,19 +528,19 @@ public: Phase = 3; - //return to the tank + // return to the tank me->GetMotionMaster()->MoveChase(me->getVictim()); } - Check_Timer = 1000; - } else Check_Timer -= diff; + CheckTimer = 1000; + } else CheckTimer -= diff; } } }; }; -//Enchanted Elemental -//If one of them reaches Vashj he will increase her damage done by 5%. +// Enchanted Elemental +// If one of them reaches Vashj he will increase her damage done by 5%. class mob_enchanted_elemental : public CreatureScript { public: @@ -587,45 +553,42 @@ public: struct mob_enchanted_elementalAI : public ScriptedAI { - mob_enchanted_elementalAI(Creature* c) : ScriptedAI(c) + mob_enchanted_elementalAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; - uint32 move; - uint32 phase; - float x, y, z; + uint32 Move; + uint32 Phase; + float X, Y, Z; uint64 VashjGUID; void Reset() { - me->SetSpeed(MOVE_WALK, 0.6f);//walk - me->SetSpeed(MOVE_RUN, 0.6f);//run - move = 0; - phase = 1; + me->SetSpeed(MOVE_WALK, 0.6f); // walk + me->SetSpeed(MOVE_RUN, 0.6f); // run + Move = 0; + Phase = 1; VashjGUID = 0; - for (int i = 0; i<8; ++i)//search for nearest waypoint (up on stairs) + X = ElementWPPos[0][0]; + Y = ElementWPPos[0][1]; + Z = ElementWPPos[0][2]; + + //search for nearest waypoint (up on stairs) + for (uint32 i = 1; i < 8; ++i) { - if (!x || !y || !z) + if (me->GetDistance(ElementWPPos[i][0], ElementWPPos[i][1], ElementWPPos[i][2]) < me->GetDistance(X, Y, Z)) { - x = ElementWPPos[i][0]; - y = ElementWPPos[i][1]; - z = ElementWPPos[i][2]; - } - else - { - if (me->GetDistance(ElementWPPos[i][0], ElementWPPos[i][1], ElementWPPos[i][2]) < me->GetDistance(x, y, z)) - { - x = ElementWPPos[i][0]; - y = ElementWPPos[i][1]; - z = ElementWPPos[i][2]; - } + X = ElementWPPos[i][0]; + Y = ElementWPPos[i][1]; + Z = ElementWPPos[i][2]; } } + if (instance) VashjGUID = instance->GetData64(DATA_LADYVASHJ); } @@ -642,41 +605,36 @@ public: if (!VashjGUID) return; - if (move <= diff) + if (Move <= diff) { - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); - if (phase == 1) - me->GetMotionMaster()->MovePoint(0, x, y, z); - if (phase == 1 && me->IsWithinDist3d(x, y, z, 0.1f)) - phase = 2; - if (phase == 2) + me->SetWalk(true); + if (Phase == 1) + me->GetMotionMaster()->MovePoint(0, X, Y, Z); + if (Phase == 1 && me->IsWithinDist3d(X, Y, Z, 0.1f)) + Phase = 2; + if (Phase == 2) { me->GetMotionMaster()->MovePoint(0, MIDDLE_X, MIDDLE_Y, MIDDLE_Z); - phase = 3; + Phase = 3; } - if (phase == 3) + if (Phase == 3) { me->GetMotionMaster()->MovePoint(0, MIDDLE_X, MIDDLE_Y, MIDDLE_Z); if (me->IsWithinDist3d(MIDDLE_X, MIDDLE_Y, MIDDLE_Z, 3)) DoCast(me, SPELL_SURGE); } - if (Creature* Vashj = Unit::GetCreature(*me, VashjGUID)) - { - if (!Vashj->isInCombat() || CAST_AI(boss_lady_vashj::boss_lady_vashjAI, Vashj->AI())->Phase != 2 || Vashj->isDead()) - { - //call Unsummon() + if (Creature* vashj = Unit::GetCreature(*me, VashjGUID)) + if (!vashj->isInCombat() || CAST_AI(boss_lady_vashj::boss_lady_vashjAI, vashj->AI())->Phase != 2 || vashj->isDead()) me->Kill(me); - } - } - move = 1000; - } else move -= diff; + Move = 1000; + } else Move -= diff; } }; }; -//Tainted Elemental -//This mob has 7, 900 life, doesn't move, and shoots Poison Bolts at one person anywhere in the area, doing 3, 000 nature damage and placing a posion doing 2, 000 damage every 2 seconds. He will switch targets often, or sometimes just hang on a single player, but there is nothing you can do about it except heal the damage and kill the Tainted Elemental +// Tainted Elemental +// This mob has 7, 900 life, doesn't move, and shoots Poison Bolts at one person anywhere in the area, doing 3, 000 nature damage and placing a posion doing 2, 000 damage every 2 seconds. He will switch targets often, or sometimes just hang on a single player, but there is nothing you can do about it except heal the damage and kill the Tainted Elemental class mob_tainted_elemental : public CreatureScript { public: @@ -689,32 +647,27 @@ public: struct mob_tainted_elementalAI : public ScriptedAI { - mob_tainted_elementalAI(Creature* c) : ScriptedAI(c) + mob_tainted_elementalAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; - uint32 PoisonBolt_Timer; - uint32 Despawn_Timer; + uint32 PoisonBoltTimer; + uint32 DespawnTimer; void Reset() { - PoisonBolt_Timer = 5000+rand()%5000; - Despawn_Timer = 30000; + PoisonBoltTimer = 5000+rand()%5000; + DespawnTimer = 30000; } void JustDied(Unit* /*killer*/) { if (instance) - { - Creature* Vashj = NULL; - Vashj = (Unit::GetCreature((*me), instance->GetData64(DATA_LADYVASHJ))); - - if (Vashj) - CAST_AI(boss_lady_vashj::boss_lady_vashjAI, Vashj->AI())->EventTaintedElementalDeath(); - } + if (Creature* vashj = Unit::GetCreature((*me), instance->GetData64(DATA_LADYVASHJ))) + CAST_AI(boss_lady_vashj::boss_lady_vashjAI, vashj->AI())->EventTaintedElementalDeath(); } void EnterCombat(Unit* who) @@ -724,27 +677,26 @@ public: void UpdateAI(const uint32 diff) { - //PoisonBolt_Timer - if (PoisonBolt_Timer <= diff) + // PoisonBoltTimer + if (PoisonBoltTimer <= diff) { - Unit* target = NULL; - target = SelectTarget(SELECT_TARGET_RANDOM, 0); + Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0); if (target && target->IsWithinDistInMap(me, 30)) DoCast(target, SPELL_POISON_BOLT); - PoisonBolt_Timer = 5000+rand()%5000; - } else PoisonBolt_Timer -= diff; + PoisonBoltTimer = 5000+rand()%5000; + } else PoisonBoltTimer -= diff; - //Despawn_Timer - if (Despawn_Timer <= diff) + // DespawnTimer + if (DespawnTimer <= diff) { - //call Unsummon() + // call Unsummon() me->setDeathState(DEAD); - //to prevent crashes - Despawn_Timer = 1000; - } else Despawn_Timer -= diff; + // to prevent crashes + DespawnTimer = 1000; + } else DespawnTimer -= diff; } }; @@ -764,37 +716,31 @@ public: struct mob_toxic_sporebatAI : public ScriptedAI { - mob_toxic_sporebatAI(Creature* c) : ScriptedAI(c) + mob_toxic_sporebatAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); EnterEvadeMode(); } InstanceScript* instance; - uint32 movement_timer; - uint32 ToxicSpore_Timer; - uint32 bolt_timer; - uint32 Check_Timer; + uint32 MovementTimer; + uint32 ToxicSporeTimer; + uint32 BoltTimer; + uint32 CheckTimer; void Reset() { - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetDisableGravity(true); me->setFaction(14); - movement_timer = 0; - ToxicSpore_Timer = 5000; - bolt_timer = 5500; - Check_Timer = 1000; - } - - void EnterCombat(Unit* /*who*/) - { - + MovementTimer = 0; + ToxicSporeTimer = 5000; + BoltTimer = 5500; + CheckTimer = 1000; } void MoveInLineOfSight(Unit* /*who*/) { - } void MovementInform(uint32 type, uint32 id) @@ -803,113 +749,57 @@ public: return; if (id == 1) - movement_timer = 0; + MovementTimer = 0; } void UpdateAI (const uint32 diff) { - //Random movement - if (movement_timer <= diff) + // Random movement + if (MovementTimer <= diff) { uint32 rndpos = rand()%8; me->GetMotionMaster()->MovePoint(1, SporebatWPPos[rndpos][0], SporebatWPPos[rndpos][1], SporebatWPPos[rndpos][2]); - movement_timer = 6000; - } else movement_timer -= diff; + MovementTimer = 6000; + } else MovementTimer -= diff; - //toxic spores - if (bolt_timer <= diff) + // toxic spores + if (BoltTimer <= diff) { - Unit* target = NULL; - target = SelectTarget(SELECT_TARGET_RANDOM, 0); - if (target) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) { - Creature* trig = me->SummonCreature(TOXIC_SPORES_TRIGGER, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 30000); - if (trig) + if (Creature* trig = me->SummonCreature(TOXIC_SPORES_TRIGGER, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 30000)) { trig->setFaction(14); trig->CastSpell(trig, SPELL_TOXIC_SPORES, true); } } - bolt_timer = 10000+rand()%5000; + BoltTimer = 10000+rand()%5000; } - else bolt_timer -= diff; + else BoltTimer -= diff; - //Check_Timer - if (Check_Timer <= diff) + // CheckTimer + if (CheckTimer <= diff) { if (instance) { - //check if vashj is death - Unit* Vashj = NULL; - Vashj = Unit::GetUnit((*me), instance->GetData64(DATA_LADYVASHJ)); + // check if vashj is death + Unit* Vashj = Unit::GetUnit(*me, instance->GetData64(DATA_LADYVASHJ)); if (!Vashj || (Vashj && !Vashj->isAlive()) || (Vashj && CAST_AI(boss_lady_vashj::boss_lady_vashjAI, CAST_CRE(Vashj)->AI())->Phase != 3)) { - //remove + // remove me->setDeathState(DEAD); me->RemoveCorpse(); me->setFaction(35); } } - Check_Timer = 1000; - } else Check_Timer -= diff; + CheckTimer = 1000; + } else CheckTimer -= diff; } }; }; -//Coilfang Elite -//It's an elite Naga mob with 170, 000 HP. It does about 5000 damage on plate, and has a nasty cleave hitting for about 7500 damage -class mob_coilfang_elite : public CreatureScript -{ -public: - mob_coilfang_elite() : CreatureScript("mob_coilfang_elite") { } - - CreatureAI* GetAI(Creature* creature) const - { - SimpleAI* ai = new SimpleAI (creature); - - ai->Spell[0].Enabled = true; - ai->Spell[0].Spell_Id = 31345; //Cleave - ai->Spell[0].Cooldown = 15000; - ai->Spell[0].CooldownRandomAddition = 5000; - ai->Spell[0].First_Cast = 5000; - ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_RANDOM; - - ai->EnterEvadeMode(); - - return ai; - } - -}; - -//Coilfang Strider -//It hits plate for about 8000 damage, has a Mind Blast spell doing about 3000 shadow damage, and a Psychic Scream Aura, which fears everybody in a 8 yard range of it every 2-3 seconds, for 5 seconds and increasing their movement speed by 150% during the fear. -class mob_coilfang_strider : public CreatureScript -{ -public: - mob_coilfang_strider() : CreatureScript("mob_coilfang_strider") { } - - CreatureAI* GetAI(Creature* creature) const - { - SimpleAI* ai = new SimpleAI (creature); - - ai->Spell[0].Enabled = true; - ai->Spell[0].Spell_Id = 41374; //Mind Blast - ai->Spell[0].Cooldown = 30000; - ai->Spell[0].CooldownRandomAddition = 10000; - ai->Spell[0].First_Cast = 8000; - ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET; - - //Scream aura not implemented - - ai->EnterEvadeMode(); - - return ai; - } - -}; - class mob_shield_generator_channel : public CreatureScript { public: @@ -922,25 +812,24 @@ public: struct mob_shield_generator_channelAI : public ScriptedAI { - mob_shield_generator_channelAI(Creature* c) : ScriptedAI(c) + mob_shield_generator_channelAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; - uint32 Check_Timer; + uint32 CheckTimer; bool Casted; + void Reset() { - Check_Timer = 0; + CheckTimer = 0; Casted = false; - me->SetDisplayId(11686); //invisible + me->SetDisplayId(11686); // invisible me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); } - void EnterCombat(Unit* /*who*/) {} - void MoveInLineOfSight(Unit* /*who*/) {} void UpdateAI (const uint32 diff) @@ -948,22 +837,21 @@ public: if (!instance) return; - if (Check_Timer <= diff) + if (CheckTimer <= diff) { - Unit* Vashj = NULL; - Vashj = Unit::GetUnit((*me), instance->GetData64(DATA_LADYVASHJ)); + Unit* vashj = Unit::GetUnit(*me, instance->GetData64(DATA_LADYVASHJ)); - if (Vashj && Vashj->isAlive()) + if (vashj && vashj->isAlive()) { - //start visual channel - if (!Casted || !Vashj->HasAura(SPELL_MAGIC_BARRIER)) + // start visual channel + if (!Casted || !vashj->HasAura(SPELL_MAGIC_BARRIER)) { - DoCast(Vashj, SPELL_MAGIC_BARRIER, true); + DoCast(vashj, SPELL_MAGIC_BARRIER, true); Casted = true; } } - Check_Timer = 1000; - } else Check_Timer -= diff; + CheckTimer = 1000; + } else CheckTimer -= diff; } }; @@ -974,41 +862,39 @@ class item_tainted_core : public ItemScript public: item_tainted_core() : ItemScript("item_tainted_core") { } - bool OnUse(Player* player, Item* /*_Item*/, SpellCastTargets const& targets) + bool OnUse(Player* player, Item* /*item*/, SpellCastTargets const& targets) { InstanceScript* instance = player->GetInstanceScript(); - if (!instance) { player->GetSession()->SendNotification(TEXT_NOT_INITIALIZED); return true; } - Creature* Vashj = NULL; - Vashj = (Unit::GetCreature((*player), instance->GetData64(DATA_LADYVASHJ))); - if (Vashj && (CAST_AI(boss_lady_vashj::boss_lady_vashjAI, Vashj->AI())->Phase == 2)) + Creature* vashj = Unit::GetCreature((*player), instance->GetData64(DATA_LADYVASHJ)); + if (vashj && (CAST_AI(boss_lady_vashj::boss_lady_vashjAI, vashj->AI())->Phase == 2)) { if (GameObject* gObj = targets.GetGOTarget()) { uint32 identifier; - uint8 channel_identifier; + uint8 channelIdentifier; switch (gObj->GetEntry()) { case 185052: identifier = DATA_SHIELDGENERATOR1; - channel_identifier = 0; + channelIdentifier = 0; break; case 185053: identifier = DATA_SHIELDGENERATOR2; - channel_identifier = 1; + channelIdentifier = 1; break; case 185051: identifier = DATA_SHIELDGENERATOR3; - channel_identifier = 2; + channelIdentifier = 2; break; case 185054: identifier = DATA_SHIELDGENERATOR4; - channel_identifier = 3; + channelIdentifier = 3; break; default: return true; @@ -1020,18 +906,13 @@ public: return true; } - //get and remove channel - Unit* Channel = NULL; - Channel = Unit::GetCreature(*Vashj, CAST_AI(boss_lady_vashj::boss_lady_vashjAI, Vashj->AI())->ShieldGeneratorChannel[channel_identifier]); - if (Channel) - { - //call Unsummon() - Channel->setDeathState(JUST_DIED); - } + // get and remove channel + if (Unit* channel = Unit::GetCreature(*vashj, CAST_AI(boss_lady_vashj::boss_lady_vashjAI, vashj->AI())->ShieldGeneratorChannel[channelIdentifier])) + channel->setDeathState(JUST_DIED); // call Unsummon() instance->SetData(identifier, 1); - //remove this item + // remove this item player->DestroyItemCount(31088, 1, true); return true; } @@ -1055,8 +936,6 @@ void AddSC_boss_lady_vashj() new mob_enchanted_elemental(); new mob_tainted_elemental(); new mob_toxic_sporebat(); - new mob_coilfang_elite(); - new mob_coilfang_strider(); new mob_shield_generator_channel(); new item_tainted_core(); } diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp index 5111a8eaa8e..4876410890c 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp @@ -53,6 +53,7 @@ EndScriptData */ #define MODEL_NIGHTELF 20514 #define DEMON_FORM 21875 #define MOB_SPELLBINDER 21806 +#define INNER_DEMON_VICTIM 1 #define SAY_AGGRO -1548009 #define SAY_SWITCH_TO_DEMON -1548010 @@ -79,7 +80,7 @@ public: struct mob_inner_demonAI : public ScriptedAI { - mob_inner_demonAI(Creature* c) : ScriptedAI(c) + mob_inner_demonAI(Creature* creature) : ScriptedAI(creature) { victimGUID = 0; } @@ -94,9 +95,23 @@ public: ShadowBolt_Timer = 10000; Link_Timer = 1000; } - void JustDied(Unit* /*victim*/) + + void SetGUID(uint64 guid, int32 id/* = 0 */) + { + if (id == INNER_DEMON_VICTIM) + victimGUID = guid; + } + + uint64 GetGUID(int32 id/* = 0 */) { - Unit* unit = Unit::GetUnit((*me), victimGUID); + if (id == INNER_DEMON_VICTIM) + return victimGUID; + return 0; + } + + void JustDied(Unit* /*killer*/) + { + Unit* unit = Unit::GetUnit(*me, victimGUID); if (unit && unit->HasAura(SPELL_INSIDIOUS_WHISPER)) unit->RemoveAurasDueToSpell(SPELL_INSIDIOUS_WHISPER); } @@ -112,7 +127,8 @@ public: void EnterCombat(Unit* /*who*/) { - if (!victimGUID) return; + if (!victimGUID) + return; } void UpdateAI(const uint32 diff) @@ -124,7 +140,7 @@ public: if (me->getVictim()->GetGUID() != victimGUID) { DoModifyThreatPercent(me->getVictim(), -100); - Unit* owner = Unit::GetUnit((*me), victimGUID); + Unit* owner = Unit::GetUnit(*me, victimGUID); if (owner && owner->isAlive()) { me->AddThreat(owner, 999999); @@ -170,10 +186,10 @@ public: struct boss_leotheras_the_blindAI : public ScriptedAI { - boss_leotheras_the_blindAI(Creature* c) : ScriptedAI(c) + boss_leotheras_the_blindAI(Creature* creature) : ScriptedAI(creature) { - c->GetPosition(x, y, z); - instance = c->GetInstanceScript(); + creature->GetPosition(x, y, z); + instance = creature->GetInstanceScript(); Demon = 0; for (uint8 i = 0; i < 3; ++i)//clear guids @@ -218,6 +234,7 @@ public: IsFinalForm = false; NeedThreatReset = false; EnrageUsed = false; + memset(InnderDemon, 0, sizeof(InnderDemon)); InnerDemon_Count = 0; me->SetSpeed(MOVE_RUN, 2.0f, true); me->SetDisplayId(MODEL_NIGHTELF); @@ -356,7 +373,7 @@ public: Creature* unit = Unit::GetCreature((*me), InnderDemon[i]); if (unit && unit->isAlive()) { - Unit* unit_target = Unit::GetUnit(*unit, CAST_AI(mob_inner_demon::mob_inner_demonAI, unit->AI())->victimGUID); + Unit* unit_target = Unit::GetUnit(*unit, unit->AI()->GetGUID(INNER_DEMON_VICTIM)); if (unit_target && unit_target->isAlive()) { unit->CastSpell(unit_target, SPELL_CONSUMING_MADNESS, true); @@ -382,7 +399,7 @@ public: } } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); @@ -524,7 +541,7 @@ public: if (demon) { demon->AI()->AttackStart((*itr)); - CAST_AI(mob_inner_demon::mob_inner_demonAI, demon->AI())->victimGUID = (*itr)->GetGUID(); + demon->AI()->SetGUID((*itr)->GetGUID(), INNER_DEMON_VICTIM); (*itr)->AddAura(SPELL_INSIDIOUS_WHISPER, *itr); @@ -600,7 +617,7 @@ public: struct boss_leotheras_the_blind_demonformAI : public ScriptedAI { - boss_leotheras_the_blind_demonformAI(Creature* c) : ScriptedAI(c) {} + boss_leotheras_the_blind_demonformAI(Creature* creature) : ScriptedAI(creature) {} uint32 ChaosBlast_Timer; bool DealDamage; @@ -624,7 +641,7 @@ public: DoScriptText(RAND(SAY_DEMON_SLAY1, SAY_DEMON_SLAY2, SAY_DEMON_SLAY3), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { //invisibility (blizzlike, at the end of the fight he doesn't die, he disappears) DoCast(me, 8149, true); @@ -673,9 +690,9 @@ public: struct mob_greyheart_spellbinderAI : public ScriptedAI { - mob_greyheart_spellbinderAI(Creature* c) : ScriptedAI(c) + mob_greyheart_spellbinderAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); leotherasGUID = 0; AddedBanish = false; } diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp index 0ed9d8e7833..00de1802bc9 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp @@ -25,7 +25,6 @@ EndScriptData */ #include "ScriptPCH.h" #include "serpent_shrine.h" -#include "ScriptedSimpleAI.h" #include "Spell.h" #define SPELL_SPOUT 37433 @@ -55,15 +54,16 @@ EndScriptData */ float AddPos[9][3] = { - {2.8553810f, -459.823914f, -19.182686f}, //MOVE_AMBUSHER_1 X, Y, Z - {12.400000f, -466.042267f, -19.182686f}, //MOVE_AMBUSHER_2 X, Y, Z - {51.366653f, -460.836060f, -19.182686f}, //MOVE_AMBUSHER_3 X, Y, Z - {62.597980f, -457.433044f, -19.182686f}, //MOVE_AMBUSHER_4 X, Y, Z - {77.607452f, -384.302765f, -19.182686f}, //MOVE_AMBUSHER_5 X, Y, Z - {63.897900f, -378.984924f, -19.182686f}, //MOVE_AMBUSHER_6 X, Y, Z - {34.447250f, -387.333618f, -19.182686f}, //MOVE_GUARDIAN_1 X, Y, Z - {14.388216f, -423.468018f, -19.625271f}, //MOVE_GUARDIAN_2 X, Y, Z - {42.471519f, -445.115295f, -19.769423f} //MOVE_GUARDIAN_3 X, Y, Z + // MOVE_AMBUSHER_1 X, Y, Z + {2.8553810f, -459.823914f, -19.182686f}, + {12.400000f, -466.042267f, -19.182686f}, + {51.366653f, -460.836060f, -19.182686f}, + {62.597980f, -457.433044f, -19.182686f}, + {77.607452f, -384.302765f, -19.182686f}, + {63.897900f, -378.984924f, -19.182686f}, + {34.447250f, -387.333618f, -19.182686f}, + {14.388216f, -423.468018f, -19.625271f}, + {42.471519f, -445.115295f, -19.769423f} }; class boss_the_lurker_below : public CreatureScript @@ -78,9 +78,9 @@ public: struct boss_the_lurker_belowAI : public Scripted_NoMovementAI { - boss_the_lurker_belowAI(Creature* c) : Scripted_NoMovementAI(c), Summons(me) + boss_the_lurker_belowAI(Creature* creature) : Scripted_NoMovementAI(creature), Summons(me) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -109,19 +109,19 @@ public: } void Reset() { - me->AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_LEVITATING); + me->AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_DISABLE_GRAVITY); SpoutAnimTimer = 1000; RotTimer = 0; - WaterboltTimer = 15000;//give time to get in range when fight starts + WaterboltTimer = 15000; // give time to get in range when fight starts SpoutTimer = 45000; - WhirlTimer = 18000;//after avery spout + WhirlTimer = 18000; // after avery spout PhaseTimer = 120000; GeyserTimer = rand()%5000 + 15000; - CheckTimer = 15000;//give time to get in range when fight starts - WaitTimer = 60000;//never reached - WaitTimer2 = 60000;//never reached + CheckTimer = 15000; // give time to get in range when fight starts + WaitTimer = 60000; // never reached + WaitTimer2 = 60000; // never reached - Submerged = true;//will be false at combat start + Submerged = true; // will be false at combat start Spawned = false; InRange = false; CanStartEvent = false; @@ -133,13 +133,13 @@ public: instance->SetData(DATA_THELURKERBELOWEVENT, NOT_STARTED); instance->SetData(DATA_STRANGE_POOL, NOT_STARTED); } - DoCast(me, SPELL_SUBMERGE);//submerge anim - me->SetVisible(false);//we start invis under water, submerged + DoCast(me, SPELL_SUBMERGE); // submerge anim + me->SetVisible(false); // we start invis under water, submerged me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (instance) { @@ -159,15 +159,13 @@ public: void MoveInLineOfSight(Unit* who) { - if (!CanStartEvent)//boss is invisible, don't attack + if (!CanStartEvent) // boss is invisible, don't attack return; if (!me->getVictim() && who->IsValidAttackTarget(me)) { float attackRadius = me->GetAttackDistance(who); if (me->IsWithinDistInMap(who, attackRadius)) - { AttackStart(who); - } } } @@ -179,7 +177,7 @@ public: void UpdateAI(const uint32 diff) { - if (!CanStartEvent)//boss is invisible, don't attack + if (!CanStartEvent) // boss is invisible, don't attack { if (CheckCanStart()) { @@ -190,21 +188,21 @@ public: WaitTimer2 = 500; } - if (!Submerged && WaitTimer2 <= diff)//wait 500ms before emerge anim + if (!Submerged && WaitTimer2 <= diff) // wait 500ms before emerge anim { me->RemoveAllAuras(); me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); DoCast(me, SPELL_EMERGE, false); - WaitTimer2 = 60000;//never reached + WaitTimer2 = 60000; // never reached WaitTimer = 3000; } else WaitTimer2 -= diff; - if (WaitTimer <= diff)//wait 3secs for emerge anim, then attack + if (WaitTimer <= diff) // wait 3secs for emerge anim, then attack { WaitTimer = 3000; - CanStartEvent = true;//fresh fished from pool + CanStartEvent = true; // fresh fished from pool me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); } @@ -214,7 +212,7 @@ public: return; } - if (me->getThreatManager().getThreatList().empty())//check if should evade + if (me->getThreatManager().getThreatList().empty()) // check if should evade { if (me->isInCombat()) EnterEvadeMode(); @@ -226,7 +224,7 @@ public: { me->InterruptNonMeleeSpells(false); DoCast(me, SPELL_SUBMERGE); - PhaseTimer = 60000;//60secs submerged + PhaseTimer = 60000; // 60secs submerged Submerged = true; } else PhaseTimer-=diff; @@ -236,12 +234,12 @@ public: me->SetReactState(REACT_PASSIVE); me->GetMotionMaster()->MoveRotate(20000, urand(0, 1) ? ROTATE_DIRECTION_LEFT : ROTATE_DIRECTION_RIGHT); SpoutTimer = 45000; - WhirlTimer = 20000;//whirl directly after spout + WhirlTimer = 20000; // whirl directly after spout RotTimer = 20000; return; } else SpoutTimer -= diff; - //Whirl directly after a Spout and at random times + // Whirl directly after a Spout and at random times if (WhirlTimer <= diff) { WhirlTimer = 18000; @@ -273,7 +271,7 @@ public: for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) { if (i->getSource() && i->getSource()->isAlive() && me->HasInArc(float(diff/20000*M_PI*2), i->getSource()) && me->IsWithinDist(i->getSource(), SPOUT_DIST) && !i->getSource()->IsInWater()) - DoCast(i->getSource(), SPELL_SPOUT, true);//only knock back palyers in arc, in 100yards, not in water + DoCast(i->getSource(), SPELL_SPOUT, true); // only knock back players in arc, in 100yards, not in water } } @@ -300,7 +298,7 @@ public: GeyserTimer = rand()%5000 + 15000; } else GeyserTimer -= diff; - if (!InRange)//if on players in melee range cast Waterbolt + if (!InRange) // if on players in melee range cast Waterbolt { if (WaterboltTimer <= diff) { @@ -318,12 +316,13 @@ public: DoMeleeAttackIfReady(); - }else//submerged + } + else // submerged { if (PhaseTimer <= diff) { Submerged = false; - me->InterruptNonMeleeSpells(false);//shouldn't be any + me->InterruptNonMeleeSpells(false); // shouldn't be any me->RemoveAllAuras(); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); me->RemoveFlag(UNIT_NPC_EMOTESTATE, EMOTE_STATE_SUBMERGED); @@ -334,28 +333,22 @@ public: return; } else PhaseTimer-=diff; - if (me->getThreatManager().getThreatList().empty())//check if should evade + if (me->getThreatManager().getThreatList().empty()) // check if should evade { EnterEvadeMode(); return; } + if (!me->isInCombat()) DoZoneInCombat(); if (!Spawned) { me->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); - //spawn adds + // spawn adds for (uint8 i = 0; i < 9; ++i) - { - Creature* Summoned; - if (i < 6) - Summoned = me->SummonCreature(MOB_COILFANG_AMBUSHER, AddPos[i][0], AddPos[i][1], AddPos[i][2], 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - else Summoned = me->SummonCreature(MOB_COILFANG_GUARDIAN, AddPos[i][0], AddPos[i][1], AddPos[i][2], 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - - if (Summoned) - Summons.Summon(Summoned); - } + if (Creature* summoned = me->SummonCreature(i < 6 ? MOB_COILFANG_AMBUSHER : MOB_COILFANG_GUARDIAN, AddPos[i][0], AddPos[i][1], AddPos[i][2], 0, TEMPSUMMON_CORPSE_DESPAWN, 0)) + Summons.Summon(summoned); Spawned = true; } } @@ -363,32 +356,6 @@ public: }; }; -class mob_coilfang_guardian : public CreatureScript -{ -public: - mob_coilfang_guardian() : CreatureScript("mob_coilfang_guardian") { } - - CreatureAI* GetAI(Creature* creature) const - { - SimpleAI* ai = new SimpleAI (creature); - - ai->Spell[0].Enabled = true; - ai->Spell[0].Spell_Id = SPELL_ARCINGSMASH; - ai->Spell[0].Cooldown = 15000; - ai->Spell[0].First_Cast = 5000; - ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET; - - ai->Spell[1].Enabled = true; - ai->Spell[1].Spell_Id = SPELL_HAMSTRING; - ai->Spell[1].Cooldown = 10000; - ai->Spell[1].First_Cast = 2000; - ai->Spell[1].Cast_Target_Type = CAST_HOSTILE_TARGET; - - return ai; - } - -}; - class mob_coilfang_ambusher : public CreatureScript { public: @@ -401,7 +368,7 @@ public: struct mob_coilfang_ambusherAI : public Scripted_NoMovementAI { - mob_coilfang_ambusherAI(Creature* c) : Scripted_NoMovementAI(c) + mob_coilfang_ambusherAI(Creature* creature) : Scripted_NoMovementAI(creature) { } @@ -412,22 +379,15 @@ public: { MultiShotTimer = 10000; ShootBowTimer = 4000; - - } - - void EnterCombat(Unit* /*who*/) - { - } void MoveInLineOfSight(Unit* who) { - if (!who || me->getVictim()) return; + if (!who || me->getVictim()) + return; if (who->isInAccessiblePlaceFor(me) && me->IsValidAttackTarget(who) && me->IsWithinDistInMap(who, 45)) - { AttackStart(who); - } } void UpdateAI(const uint32 diff) @@ -438,18 +398,16 @@ public: DoCast(me->getVictim(), SPELL_SPREAD_SHOT, true); MultiShotTimer = 10000+rand()%10000; - ShootBowTimer += 1500;//add global cooldown + ShootBowTimer += 1500; // add global cooldown } else MultiShotTimer -= diff; if (ShootBowTimer <= diff) { - Unit* target = NULL; - target = SelectTarget(SELECT_TARGET_RANDOM, 0); int bp0 = 1100; - if (target) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) me->CastCustomSpell(target, SPELL_SHOOT, &bp0, NULL, NULL, true); ShootBowTimer = 4000+rand()%5000; - MultiShotTimer += 1500;//add global cooldown + MultiShotTimer += 1500; // add global cooldown } else ShootBowTimer -= diff; } }; @@ -482,7 +440,6 @@ class go_strange_pool : public GameObjectScript void AddSC_boss_the_lurker_below() { new boss_the_lurker_below(); - new mob_coilfang_guardian(); new mob_coilfang_ambusher(); new go_strange_pool(); } diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp index eeef50e3f9c..865fb143800 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp @@ -89,9 +89,9 @@ public: struct boss_morogrim_tidewalkerAI : public ScriptedAI { - boss_morogrim_tidewalkerAI(Creature* c) : ScriptedAI(c) + boss_morogrim_tidewalkerAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -140,7 +140,7 @@ public: DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2, SAY_SLAY3), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); @@ -296,7 +296,7 @@ public: struct mob_water_globuleAI : public ScriptedAI { - mob_water_globuleAI(Creature* c) : ScriptedAI(c) {} + mob_water_globuleAI(Creature* creature) : ScriptedAI(creature) {} uint32 Check_Timer; diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp index 6c4019c7989..3ed3d1a82de 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp @@ -153,7 +153,7 @@ class instance_serpent_shrine : public InstanceMapScript if (Creature* frenzy = player->SummonCreature(MOB_COILFANG_FRENZY, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 2000)) { frenzy->Attack(player, false); - frenzy->AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_LEVITATING); + frenzy->AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_DISABLE_GRAVITY); } DoSpawnFrenzy = false; } diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_hydromancer_thespia.cpp b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_hydromancer_thespia.cpp index c3203621dbb..48c5a360619 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_hydromancer_thespia.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_hydromancer_thespia.cpp @@ -58,9 +58,9 @@ public: struct boss_thespiaAI : public ScriptedAI { - boss_thespiaAI(Creature* c) : ScriptedAI(c) + boss_thespiaAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -79,7 +79,7 @@ public: instance->SetData(TYPE_HYDROMANCER_THESPIA, NOT_STARTED); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEAD, me); @@ -158,7 +158,7 @@ public: struct mob_coilfang_waterelementalAI : public ScriptedAI { - mob_coilfang_waterelementalAI(Creature* c) : ScriptedAI(c) {} + mob_coilfang_waterelementalAI(Creature* creature) : ScriptedAI(creature) {} uint32 WaterBoltVolley_Timer; diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp index ce73e467c0c..739168863f4 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp @@ -60,9 +60,9 @@ public: struct boss_mekgineer_steamriggerAI : public ScriptedAI { - boss_mekgineer_steamriggerAI(Creature* c) : ScriptedAI(c) + boss_mekgineer_steamriggerAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -88,7 +88,7 @@ public: instance->SetData(TYPE_MEKGINEER_STEAMRIGGER, NOT_STARTED); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); @@ -204,9 +204,9 @@ public: struct mob_steamrigger_mechanicAI : public ScriptedAI { - mob_steamrigger_mechanicAI(Creature* c) : ScriptedAI(c) + mob_steamrigger_mechanicAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -231,7 +231,7 @@ public: { if (instance && instance->GetData64(DATA_MEKGINEERSTEAMRIGGER) && instance->GetData(TYPE_MEKGINEER_STEAMRIGGER) == IN_PROGRESS) { - if (Unit* pMekgineer = Unit::GetUnit((*me), instance->GetData64(DATA_MEKGINEERSTEAMRIGGER))) + if (Unit* pMekgineer = Unit::GetUnit(*me, instance->GetData64(DATA_MEKGINEERSTEAMRIGGER))) { if (me->IsWithinDistInMap(pMekgineer, MAX_REPAIR_RANGE)) { diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp index bfbeff81d3e..cae1117805a 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp @@ -54,9 +54,9 @@ public: struct mob_naga_distillerAI : public ScriptedAI { - mob_naga_distillerAI(Creature* c) : ScriptedAI(c) + mob_naga_distillerAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -112,9 +112,9 @@ public: struct boss_warlord_kalithreshAI : public ScriptedAI { - boss_warlord_kalithreshAI(Creature* c) : ScriptedAI(c) + boss_warlord_kalithreshAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -157,7 +157,7 @@ public: me->RemoveAurasDueToSpell(SPELL_WARLORDS_RAGE_PROC); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); diff --git a/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp index aebd71bbd47..42d617992ed 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp @@ -40,7 +40,7 @@ public: struct boss_hungarfenAI : public ScriptedAI { - boss_hungarfenAI(Creature* c) : ScriptedAI(c) + boss_hungarfenAI(Creature* creature) : ScriptedAI(creature) { } @@ -112,7 +112,7 @@ public: struct mob_underbog_mushroomAI : public ScriptedAI { - mob_underbog_mushroomAI(Creature* c) : ScriptedAI(c) {} + mob_underbog_mushroomAI(Creature* creature) : ScriptedAI(creature) {} bool Stop; uint32 Grow_Timer; diff --git a/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp index fb3be660b5e..f7079e5c664 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp @@ -47,7 +47,7 @@ public: struct boss_the_black_stalkerAI : public ScriptedAI { - boss_the_black_stalkerAI(Creature* c) : ScriptedAI(c) + boss_the_black_stalkerAI(Creature* creature) : ScriptedAI(creature) { } @@ -88,7 +88,7 @@ public: } } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { for (std::list::const_iterator i = Striders.begin(); i != Striders.end(); ++i) if (Creature* strider = Unit::GetCreature(*me, *i)) diff --git a/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp b/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp index b7604c41794..0e654ade995 100644 --- a/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp +++ b/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp @@ -66,9 +66,9 @@ public: struct boss_gruulAI : public ScriptedAI { - boss_gruulAI(Creature* c) : ScriptedAI(c) + boss_gruulAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } InstanceScript* instance; @@ -109,7 +109,7 @@ public: DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2, SAY_SLAY3), me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); @@ -130,8 +130,13 @@ public: { switch (urand(0, 1)) { - case 0: target->CastSpell(target, SPELL_MAGNETIC_PULL, true, NULL, NULL, me->GetGUID()); break; - case 1: target->CastSpell(target, SPELL_KNOCK_BACK, true, NULL, NULL, me->GetGUID()); break; + case 0: + target->CastSpell(target, SPELL_MAGNETIC_PULL, true, NULL, NULL, me->GetGUID()); + break; + + case 1: + target->CastSpell(target, SPELL_KNOCK_BACK, true, NULL, NULL, me->GetGUID()); + break; } } } diff --git a/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp b/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp index 4636334e668..0f42b1b7e53 100644 --- a/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp +++ b/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp @@ -118,9 +118,9 @@ public: struct boss_high_king_maulgarAI : public ScriptedAI { - boss_high_king_maulgarAI(Creature* c) : ScriptedAI(c) + boss_high_king_maulgarAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); for (uint8 i = 0; i < 4; ++i) Council[i] = 0; } @@ -173,7 +173,7 @@ public: DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2, SAY_SLAY3), me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); @@ -223,7 +223,7 @@ public: //Only if not incombat check if the event is started if (!me->isInCombat() && instance && instance->GetData(DATA_MAULGAREVENT)) { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_MAULGAREVENT_TANK)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_MAULGAREVENT_TANK)); if (target) { @@ -317,9 +317,9 @@ public: struct boss_olm_the_summonerAI : public ScriptedAI { - boss_olm_the_summonerAI(Creature* c) : ScriptedAI(c) + boss_olm_the_summonerAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 DarkDecay_Timer; @@ -363,7 +363,7 @@ public: } } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (instance) { @@ -383,7 +383,7 @@ public: //Only if not incombat check if the event is started if (!me->isInCombat() && instance && instance->GetData(DATA_MAULGAREVENT)) { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_MAULGAREVENT_TANK)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_MAULGAREVENT_TANK)); if (target) { @@ -445,9 +445,9 @@ public: struct boss_kiggler_the_crazedAI : public ScriptedAI { - boss_kiggler_the_crazedAI(Creature* c) : ScriptedAI(c) + boss_kiggler_the_crazedAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 GreaterPolymorph_Timer; @@ -478,7 +478,7 @@ public: } } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (instance) { @@ -498,7 +498,7 @@ public: //Only if not incombat check if the event is started if (!me->isInCombat() && instance && instance->GetData(DATA_MAULGAREVENT)) { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_MAULGAREVENT_TANK)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_MAULGAREVENT_TANK)); if (target) { @@ -567,9 +567,9 @@ public: struct boss_blindeye_the_seerAI : public ScriptedAI { - boss_blindeye_the_seerAI(Creature* c) : ScriptedAI(c) + boss_blindeye_the_seerAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 GreaterPowerWordShield_Timer; @@ -598,7 +598,7 @@ public: } } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (instance) { @@ -618,7 +618,7 @@ public: //Only if not incombat check if the event is started if (!me->isInCombat() && instance && instance->GetData(DATA_MAULGAREVENT)) { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_MAULGAREVENT_TANK)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_MAULGAREVENT_TANK)); if (target) { @@ -677,9 +677,9 @@ public: struct boss_krosh_firehandAI : public ScriptedAI { - boss_krosh_firehandAI(Creature* c) : ScriptedAI(c) + boss_krosh_firehandAI(Creature* creature) : ScriptedAI(creature) { - instance = c->GetInstanceScript(); + instance = creature->GetInstanceScript(); } uint32 GreaterFireball_Timer; @@ -708,7 +708,7 @@ public: } } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (instance) { @@ -728,7 +728,7 @@ public: //Only if not incombat check if the event is started if (!me->isInCombat() && instance && instance->GetData(DATA_MAULGAREVENT)) { - Unit* target = Unit::GetUnit((*me), instance->GetData64(DATA_MAULGAREVENT_TANK)); + Unit* target = Unit::GetUnit(*me, instance->GetData64(DATA_MAULGAREVENT_TANK)); if (target) { diff --git a/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp b/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp index bd4f91e8e39..3514732b53a 100644 --- a/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp +++ b/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp @@ -77,7 +77,8 @@ public: bool IsEncounterInProgress() const { for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; + if (m_auiEncounter[i] == IN_PROGRESS) + return true; return false; } @@ -136,12 +137,18 @@ public: switch (type) { case DATA_MAULGAREVENT: - if (data == DONE) HandleGameObject(MaulgarDoor, true); - m_auiEncounter[0] = data; break; + if (data == DONE) + HandleGameObject(MaulgarDoor, true); + m_auiEncounter[0] = data; + break; + case DATA_GRUULEVENT: - if (data == IN_PROGRESS) HandleGameObject(GruulDoor, false); - else HandleGameObject(GruulDoor, true); - m_auiEncounter[1] = data; break; + if (data == IN_PROGRESS) + HandleGameObject(GruulDoor, false); + else + HandleGameObject(GruulDoor, true); + m_auiEncounter[1] = data; + break; } if (data == DONE) diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp index 7fa417cacb2..f6b7518661e 100644 --- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp @@ -121,7 +121,7 @@ class boss_broggok : public CreatureScript DoMeleeAttackIfReady(); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (instance) { @@ -133,9 +133,9 @@ class boss_broggok : public CreatureScript }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_broggokAI (Creature); + return new boss_broggokAI(creature); } }; diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp index b847500fc36..01873afeaa9 100644 --- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp @@ -158,7 +158,9 @@ class boss_kelidan_the_breaker : public CreatureScript uint64 GetChanneled(Creature* channeler1) { SummonChannelers(); - if (!channeler1) return 0; + if (!channeler1) + return 0; + uint8 i; for (i=0; i<5; ++i) { @@ -183,7 +185,7 @@ class boss_kelidan_the_breaker : public CreatureScript } } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DIE, me); @@ -268,9 +270,9 @@ class boss_kelidan_the_breaker : public CreatureScript }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_kelidan_the_breakerAI (Creature); + return new boss_kelidan_the_breakerAI(creature); } }; @@ -324,10 +326,10 @@ class mob_shadowmoon_channeler : public CreatureScript DoStartMovement(who); } - void JustDied(Unit* Killer) + void JustDied(Unit* killer) { if (Creature* Kelidan = me->FindNearestCreature(ENTRY_KELIDAN, 100)) - CAST_AI(boss_kelidan_the_breaker::boss_kelidan_the_breakerAI, Kelidan->AI())->ChannelerDied(Killer); + CAST_AI(boss_kelidan_the_breaker::boss_kelidan_the_breakerAI, Kelidan->AI())->ChannelerDied(killer); } void UpdateAI(const uint32 diff) @@ -371,9 +373,9 @@ class mob_shadowmoon_channeler : public CreatureScript } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new mob_shadowmoon_channelerAI (Creature); + return new mob_shadowmoon_channelerAI(creature); } }; diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp index f056ccd40ee..dc9f83b073d 100644 --- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp @@ -94,7 +94,7 @@ class boss_the_maker : public CreatureScript DoScriptText(RAND(SAY_KILL_1, SAY_KILL_2), me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DIE, me); @@ -153,9 +153,9 @@ class boss_the_maker : public CreatureScript } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_the_makerAI (Creature); + return new boss_the_makerAI(creature); } }; diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp index a6adb6b952e..2ab2b2b5b2e 100644 --- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp @@ -113,7 +113,7 @@ class boss_omor_the_unscarred : public CreatureScript ++SummonedCount; } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DIE, me); } @@ -143,7 +143,7 @@ class boss_omor_the_unscarred : public CreatureScript if (Player* temp = Unit::GetPlayer(*me, PlayerGUID)) { //if unit dosen't have this flag, then no pulling back (script will attempt cast, even if orbital strike was resisted) - if (temp->HasUnitMovementFlag(MOVEMENTFLAG_FALLING)) + if (temp->HasUnitMovementFlag(MOVEMENTFLAG_FALLING_FAR)) { me->InterruptNonMeleeSpells(false); DoCast(temp, SPELL_SHADOW_WHIP); @@ -219,9 +219,9 @@ class boss_omor_the_unscarred : public CreatureScript } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_omor_the_unscarredAI (Creature); + return new boss_omor_the_unscarredAI(creature); } }; diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp index ecea5e6abb4..a5cdebea754 100644 --- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp @@ -145,8 +145,8 @@ class boss_nazan : public CreatureScript flight = false; BellowingRoar_Timer = 6000; ConeOfFire_Timer = 12000; - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetDisableGravity(false); + me->SetWalk(true); me->GetMotionMaster()->Clear(); if (Unit* victim = SelectTarget(SELECT_TARGET_NEAREST, 0)) me->AI()->AttackStart(victim); @@ -194,9 +194,9 @@ class boss_nazan : public CreatureScript } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_nazanAI (Creature); + return new boss_nazanAI(creature); } }; @@ -236,9 +236,9 @@ class boss_vazruden : public CreatureScript DoScriptText(RAND(SAY_KILL_1, SAY_KILL_2), me); } - void JustDied(Unit* who) + void JustDied(Unit* killer) { - if (who && who != me) + if (killer && killer != me) DoScriptText(SAY_DIE, me); } @@ -272,9 +272,9 @@ class boss_vazruden : public CreatureScript DoMeleeAttackIfReady(); } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_vazrudenAI (Creature); + return new boss_vazrudenAI(creature); } }; @@ -374,7 +374,7 @@ class boss_vazruden_the_herald : public CreatureScript if (summoned->GetEntry() == ENTRY_NAZAN) { CAST_AI(boss_nazan::boss_nazanAI, summoned->AI())->VazrudenGUID = VazrudenGUID; - summoned->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + summoned->SetDisableGravity(true); summoned->SetSpeed(MOVE_FLIGHT, 2.5f); if (victim) AttackStartNoMove(victim); @@ -453,9 +453,9 @@ class boss_vazruden_the_herald : public CreatureScript } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_vazruden_the_heraldAI (Creature); + return new boss_vazruden_the_heraldAI(creature); } }; @@ -480,10 +480,10 @@ class mob_hellfire_sentry : public CreatureScript void EnterCombat(Unit* /*who*/) {} - void JustDied(Unit* who) + void JustDied(Unit* killer) { if (Creature* herald = me->FindNearestCreature(ENTRY_VAZRUDEN_HERALD, 150)) - CAST_AI(boss_vazruden_the_herald::boss_vazruden_the_heraldAI, herald->AI())->SentryDownBy(who); + CAST_AI(boss_vazruden_the_herald::boss_vazruden_the_heraldAI, herald->AI())->SentryDownBy(killer); } void UpdateAI(const uint32 diff) @@ -503,9 +503,9 @@ class mob_hellfire_sentry : public CreatureScript DoMeleeAttackIfReady(); } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new mob_hellfire_sentryAI (Creature); + return new mob_hellfire_sentryAI(creature); } }; void AddSC_boss_vazruden_the_herald() diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp index b2f8af2c80d..2c00a68321a 100644 --- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp @@ -87,7 +87,7 @@ class boss_watchkeeper_gargolmar : public CreatureScript { if (!me->getVictim() && me->canCreatureAttack(who)) { - if (!me->canFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) + if (!me->CanFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) return; float attackRadius = me->GetAttackDistance(who); @@ -109,7 +109,7 @@ class boss_watchkeeper_gargolmar : public CreatureScript DoScriptText(RAND(SAY_KILL_1, SAY_KILL_2), me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DIE, me); } @@ -163,9 +163,9 @@ class boss_watchkeeper_gargolmar : public CreatureScript } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_watchkeeper_gargolmarAI (Creature); + return new boss_watchkeeper_gargolmarAI(creature); } }; diff --git a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp index c355079e0e8..1b29abf1afc 100644 --- a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp @@ -198,9 +198,9 @@ class mob_abyssal : public CreatureScript } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new mob_abyssalAI(Creature); + return new mob_abyssalAI(creature); } }; @@ -322,7 +322,7 @@ class boss_magtheridon : public CreatureScript DoScriptText(SAY_PLAYER_KILLED, me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(DATA_MAGTHERIDON_EVENT, DONE); @@ -464,9 +464,9 @@ class boss_magtheridon : public CreatureScript } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_magtheridonAI(Creature); + return new boss_magtheridonAI(creature); } }; @@ -533,7 +533,7 @@ class mob_hellfire_channeler : public CreatureScript DoCast(me, SPELL_SOUL_TRANSFER, true); } - void JustDied(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(DATA_CHANNELER_EVENT, DONE); @@ -583,9 +583,9 @@ class mob_hellfire_channeler : public CreatureScript } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new mob_hellfire_channelerAI(Creature); + return new mob_hellfire_channelerAI(creature); } }; @@ -597,16 +597,16 @@ public: { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { - InstanceScript* instance = pGO->GetInstanceScript(); + InstanceScript* instance = go->GetInstanceScript(); if (!instance) return true; if (instance->GetData(DATA_MAGTHERIDON_EVENT) != IN_PROGRESS) return true; - Creature* Magtheridon =Unit::GetCreature(*pGO, instance->GetData64(DATA_MAGTHERIDON)); + Creature* Magtheridon =Unit::GetCreature(*go, instance->GetData64(DATA_MAGTHERIDON)); if (!Magtheridon || !Magtheridon->isAlive()) return true; @@ -617,7 +617,7 @@ public: player->InterruptNonMeleeSpells(false); player->CastSpell(player, SPELL_SHADOW_GRASP, true); player->CastSpell(player, SPELL_SHADOW_GRASP_VISUAL, false); - CAST_AI(boss_magtheridon::boss_magtheridonAI, Magtheridon->AI())->SetClicker(pGO->GetGUID(), player->GetGUID()); + CAST_AI(boss_magtheridon::boss_magtheridonAI, Magtheridon->AI())->SetClicker(go->GetGUID(), player->GetGUID()); return true; } }; diff --git a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp index caaedc4c51b..cb55d627f7d 100644 --- a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp @@ -80,7 +80,9 @@ class instance_magtheridons_lair : public InstanceMapScript bool IsEncounterInProgress() const { for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; + if (m_auiEncounter[i] == IN_PROGRESS) + return true; + return false; } diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp index 970c089918e..7dfdc40a787 100644 --- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp @@ -224,7 +224,7 @@ class boss_grand_warlock_nethekurse : public CreatureScript DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2), me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DIE, me); @@ -301,9 +301,9 @@ class boss_grand_warlock_nethekurse : public CreatureScript } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_grand_warlock_nethekurseAI (Creature); + return new boss_grand_warlock_nethekurseAI(creature); } }; @@ -356,7 +356,7 @@ class mob_fel_orc_convert : public CreatureScript } } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { if (instance) { @@ -383,9 +383,9 @@ class mob_fel_orc_convert : public CreatureScript } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new mob_fel_orc_convertAI (Creature); + return new mob_fel_orc_convertAI(creature); } }; diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp index 5e8ed53fa4b..5371473e21e 100644 --- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp @@ -143,9 +143,9 @@ class mob_omrogg_heads : public CreatureScript } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new mob_omrogg_headsAI (Creature); + return new mob_omrogg_headsAI(creature); } }; @@ -295,7 +295,7 @@ class boss_warbringer_omrogg : public CreatureScript } } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { Unit* pLeftHead = Unit::GetUnit(*me, LeftHeadGUID); Unit* pRightHead = Unit::GetUnit(*me, RightHeadGUID); diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp index 3f07552441b..c1489671292 100644 --- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp @@ -95,7 +95,7 @@ class boss_warchief_kargath_bladefist : public CreatureScript removeAdds(); me->SetSpeed(MOVE_RUN, 2); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); summoned = 2; InBlade = false; @@ -137,7 +137,7 @@ class boss_warchief_kargath_bladefist : public CreatureScript } } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); removeAdds(); @@ -166,7 +166,7 @@ class boss_warchief_kargath_bladefist : public CreatureScript { for (std::vector::const_iterator itr = adds.begin(); itr!= adds.end(); ++itr) { - Unit* temp = Unit::GetUnit((*me), *itr); + Unit* temp = Unit::GetUnit(*me, *itr); if (temp && temp->isAlive()) { (*temp).GetMotionMaster()->Clear(true); @@ -178,7 +178,7 @@ class boss_warchief_kargath_bladefist : public CreatureScript for (std::vector::const_iterator itr = assassins.begin(); itr!= assassins.end(); ++itr) { - Unit* temp = Unit::GetUnit((*me), *itr); + Unit* temp = Unit::GetUnit(*me, *itr); if (temp && temp->isAlive()) { (*temp).GetMotionMaster()->Clear(true); @@ -236,8 +236,8 @@ class boss_warchief_kargath_bladefist : public CreatureScript float x, y, randx, randy; randx = 0.0f + rand()%40; randy = 0.0f + rand()%40; - x = 210+ randx ; - y = -60- randy ; + x = 210+ randx; + y = -60- randy; me->GetMotionMaster()->MovePoint(1, x, y, me->GetPositionZ()); Wait_Timer = 0; } @@ -316,9 +316,9 @@ class boss_warchief_kargath_bladefist : public CreatureScript } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_warchief_kargath_bladefistAI (Creature); + return new boss_warchief_kargath_bladefistAI(creature); } }; diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp index fcfe6c0ea16..25207073708 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp @@ -130,7 +130,7 @@ class boss_alar : public CreatureScript //me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10); //me->SetFloatValue(UNIT_FIELD_COMBATREACH, 10); me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); - me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); + me->SetUnitMovementFlags(MOVEMENTFLAG_DISABLE_GRAVITY); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->setActive(false); } @@ -140,12 +140,12 @@ class boss_alar : public CreatureScript if (instance) instance->SetData(DATA_ALAREVENT, IN_PROGRESS); - me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); // after enterevademode will be set walk movement + me->SetUnitMovementFlags(MOVEMENTFLAG_DISABLE_GRAVITY); // after enterevademode will be set walk movement DoZoneInCombat(); me->setActive(true); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { if (instance) instance->SetData(DATA_ALAREVENT, DONE); @@ -409,7 +409,7 @@ class boss_alar : public CreatureScript if (Summoned) { Summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - Summoned->SetFloatValue(OBJECT_FIELD_SCALE_X, Summoned->GetFloatValue(OBJECT_FIELD_SCALE_X)*2.5f); + Summoned->SetObjectScale(Summoned->GetFloatValue(OBJECT_FIELD_SCALE_X)*2.5f); Summoned->SetDisplayId(11686); Summoned->setFaction(me->getFaction()); Summoned->SetLevel(me->getLevel()); @@ -450,9 +450,9 @@ class boss_alar : public CreatureScript } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_alarAI(Creature); + return new boss_alarAI(creature); } }; @@ -470,7 +470,7 @@ class mob_ember_of_alar : public CreatureScript mob_ember_of_alarAI(Creature* creature) : ScriptedAI(creature) { instance = creature->GetInstanceScript(); - creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); + creature->SetUnitMovementFlags(MOVEMENTFLAG_DISABLE_GRAVITY); creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); } @@ -500,7 +500,7 @@ class mob_ember_of_alar : public CreatureScript me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); if (instance && instance->GetData(DATA_ALAREVENT) == 2) { - if (Unit* Alar = Unit::GetUnit((*me), instance->GetData64(DATA_ALAR))) + if (Unit* Alar = Unit::GetUnit(*me, instance->GetData64(DATA_ALAR))) { int32 AlarHealth = int32(Alar->GetHealth()) - int32(Alar->CountPctFromMaxHealth(3)); if (AlarHealth > 0) @@ -529,9 +529,9 @@ class mob_ember_of_alar : public CreatureScript }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new mob_ember_of_alarAI(Creature); + return new mob_ember_of_alarAI(creature); } }; @@ -554,9 +554,9 @@ class mob_flame_patch_alar : public CreatureScript void UpdateAI(const uint32 /*diff*/) {} }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new mob_flame_patch_alarAI(Creature); + return new mob_flame_patch_alarAI(creature); } }; diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp index 05fad24f35e..d202fdd2f44 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp @@ -140,7 +140,7 @@ class boss_high_astromancer_solarian : public CreatureScript me->SetArmor(defaultarmor); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetVisible(true); - me->SetFloatValue(OBJECT_FIELD_SCALE_X, defaultsize); + me->SetObjectScale(defaultsize); me->SetDisplayId(MODEL_HUMAN); Summons.DespawnAll(); @@ -151,9 +151,9 @@ class boss_high_astromancer_solarian : public CreatureScript DoScriptText(RAND(SAY_KILL1, SAY_KILL2, SAY_KILL3), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { - me->SetFloatValue(OBJECT_FIELD_SCALE_X, defaultsize); + me->SetObjectScale(defaultsize); me->SetDisplayId(MODEL_HUMAN); DoScriptText(SAY_DEATH, me); if (instance) @@ -397,7 +397,7 @@ class boss_high_astromancer_solarian : public CreatureScript DoScriptText(SAY_VOIDB, me); me->SetArmor(WV_ARMOR); me->SetDisplayId(MODEL_VOIDWALKER); - me->SetFloatValue(OBJECT_FIELD_SCALE_X, defaultsize*2.5f); + me->SetObjectScale(defaultsize*2.5f); } DoMeleeAttackIfReady(); } @@ -454,7 +454,7 @@ class mob_solarium_priest : public CreatureScript { case 0: if (instance) - target = Unit::GetUnit((*me), instance->GetData64(DATA_ASTROMANCER)); + target = Unit::GetUnit(*me, instance->GetData64(DATA_ASTROMANCER)); break; case 1: target = me; @@ -490,9 +490,9 @@ class mob_solarium_priest : public CreatureScript } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new mob_solarium_priestAI (Creature); + return new mob_solarium_priestAI(creature); } }; diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp index 7a60b1545d0..b66fc5f5e24 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp @@ -147,11 +147,11 @@ struct advisorbase_ai : public ScriptedAI { advisorbase_ai(Creature* creature) : ScriptedAI(creature) { - m_instance = creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); m_bDoubled_Health = false; } - InstanceScript* m_instance; + InstanceScript* instance; bool FakeDeath; bool m_bDoubled_Health; uint32 DelayRes_Timer; @@ -174,8 +174,8 @@ struct advisorbase_ai : public ScriptedAI me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); //reset encounter - if (m_instance && (m_instance->GetData(DATA_KAELTHASEVENT) == 1 || m_instance->GetData(DATA_KAELTHASEVENT) == 3)) - if (Creature* Kaelthas = Unit::GetCreature((*me), m_instance->GetData64(DATA_KAELTHAS))) + if (instance && (instance->GetData(DATA_KAELTHASEVENT) == 1 || instance->GetData(DATA_KAELTHASEVENT) == 3)) + if (Creature* Kaelthas = Unit::GetCreature((*me), instance->GetData64(DATA_KAELTHAS))) Kaelthas->AI()->EnterEvadeMode(); } @@ -214,14 +214,14 @@ struct advisorbase_ai : public ScriptedAI return; //Prevent glitch if in fake death - if (FakeDeath && m_instance && m_instance->GetData(DATA_KAELTHASEVENT) != 0) + if (FakeDeath && instance && instance->GetData(DATA_KAELTHASEVENT) != 0) { damage = 0; return; } //Don't really die in phase 1 & 3, only die after that - if (m_instance && m_instance->GetData(DATA_KAELTHASEVENT) != 0) + if (instance && instance->GetData(DATA_KAELTHASEVENT) != 0) { //prevent death damage = 0; @@ -253,7 +253,7 @@ struct advisorbase_ai : public ScriptedAI DelayRes_Timer = 0; FakeDeath = false; - Unit* Target = Unit::GetUnit((*me), DelayRes_Target); + Unit* Target = Unit::GetUnit(*me, DelayRes_Target); if (!Target) Target = me->getVictim(); @@ -280,11 +280,11 @@ class boss_kaelthas : public CreatureScript { boss_kaelthasAI(Creature* creature) : ScriptedAI(creature), summons(me) { - m_instance = creature->GetInstanceScript(); + instance = creature->GetInstanceScript(); memset(&m_auiAdvisorGuid, 0, sizeof(m_auiAdvisorGuid)); } - InstanceScript* m_instance; + InstanceScript* instance; uint32 Fireball_Timer; uint32 ArcaneDisruption_Timer; @@ -335,8 +335,8 @@ class boss_kaelthas : public CreatureScript me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - if (m_instance) - m_instance->SetData(DATA_KAELTHASEVENT, 0); + if (instance) + instance->SetData(DATA_KAELTHASEVENT, 0); } void PrepareAdvisors() @@ -355,13 +355,13 @@ class boss_kaelthas : public CreatureScript void StartEvent() { - if (!m_instance) + if (!instance) return; - m_auiAdvisorGuid[0] = m_instance->GetData64(DATA_THALADREDTHEDARKENER); - m_auiAdvisorGuid[1] = m_instance->GetData64(DATA_LORDSANGUINAR); - m_auiAdvisorGuid[2] = m_instance->GetData64(DATA_GRANDASTROMANCERCAPERNIAN); - m_auiAdvisorGuid[3] = m_instance->GetData64(DATA_MASTERENGINEERTELONICUS); + m_auiAdvisorGuid[0] = instance->GetData64(DATA_THALADREDTHEDARKENER); + m_auiAdvisorGuid[1] = instance->GetData64(DATA_LORDSANGUINAR); + m_auiAdvisorGuid[2] = instance->GetData64(DATA_GRANDASTROMANCERCAPERNIAN); + m_auiAdvisorGuid[3] = instance->GetData64(DATA_MASTERENGINEERTELONICUS); if (!m_auiAdvisorGuid[0] || !m_auiAdvisorGuid[1] || !m_auiAdvisorGuid[2] || !m_auiAdvisorGuid[3]) { @@ -371,7 +371,7 @@ class boss_kaelthas : public CreatureScript Phase = 4; - m_instance->SetData(DATA_KAELTHASEVENT, 4); + instance->SetData(DATA_KAELTHASEVENT, 4); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); @@ -386,7 +386,7 @@ class boss_kaelthas : public CreatureScript DoScriptText(SAY_INTRO, me); - m_instance->SetData(DATA_KAELTHASEVENT, 1); + instance->SetData(DATA_KAELTHASEVENT, 1); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); PhaseSubphase = 0; @@ -399,7 +399,7 @@ class boss_kaelthas : public CreatureScript { if (!me->HasUnitState(UNIT_STATE_STUNNED) && me->canCreatureAttack(who)) { - if (!me->canFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) + if (!me->CanFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) return; float attackRadius = me->GetAttackDistance(who); @@ -412,7 +412,7 @@ class boss_kaelthas : public CreatureScript } else if (me->GetMap()->IsDungeon()) { - if (m_instance && !m_instance->GetData(DATA_KAELTHASEVENT) && !Phase) + if (instance && !instance->GetData(DATA_KAELTHASEVENT) && !Phase) StartEvent(); who->SetInCombatWith(me); @@ -424,7 +424,7 @@ class boss_kaelthas : public CreatureScript void EnterCombat(Unit* /*who*/) { - if (m_instance && !m_instance->GetData(DATA_KAELTHASEVENT) && !Phase) + if (instance && !instance->GetData(DATA_KAELTHASEVENT) && !Phase) StartEvent(); } @@ -445,9 +445,12 @@ class boss_kaelthas : public CreatureScript } } - void SummonedCreatureDespawn(Creature* summon) {summons.Despawn(summon);} + void SummonedCreatureDespawn(Creature* summon) + { + summons.Despawn(summon); + } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); @@ -456,12 +459,12 @@ class boss_kaelthas : public CreatureScript summons.DespawnAll(); - if (m_instance) - m_instance->SetData(DATA_KAELTHASEVENT, 0); + if (instance) + instance->SetData(DATA_KAELTHASEVENT, 0); for (uint8 i = 0; i < MAX_ADVISORS; ++i) { - if (Unit* pAdvisor = Unit::GetUnit((*me), m_auiAdvisorGuid[i])) + if (Unit* pAdvisor = Unit::GetUnit(*me, m_auiAdvisorGuid[i])) pAdvisor->Kill(pAdvisor); } } @@ -621,8 +624,8 @@ class boss_kaelthas : public CreatureScript if (Advisor && (Advisor->getStandState() == UNIT_STAND_STATE_DEAD)) { Phase = 2; - if (m_instance) - m_instance->SetData(DATA_KAELTHASEVENT, 2); + if (instance) + instance->SetData(DATA_KAELTHASEVENT, 2); DoScriptText(SAY_PHASE2_WEAPON, me); @@ -666,8 +669,8 @@ class boss_kaelthas : public CreatureScript if (Phase_Timer <= diff) { DoScriptText(SAY_PHASE3_ADVANCE, me); - if (m_instance) - m_instance->SetData(DATA_KAELTHASEVENT, 3); + if (instance) + instance->SetData(DATA_KAELTHASEVENT, 3); Phase = 3; PhaseSubphase = 0; } @@ -704,8 +707,8 @@ class boss_kaelthas : public CreatureScript DoScriptText(SAY_PHASE4_INTRO2, me); Phase = 4; - if (m_instance) - m_instance->SetData(DATA_KAELTHASEVENT, 4); + if (instance) + instance->SetData(DATA_KAELTHASEVENT, 4); // Sometimes people can collect Aggro in Phase 1-3. Reset threat before releasing Kael. DoResetThreat(); @@ -809,8 +812,8 @@ class boss_kaelthas : public CreatureScript { if (HealthBelowPct(50)) { - if (m_instance) - m_instance->SetData(DATA_KAELTHASEVENT, 4); + if (instance) + instance->SetData(DATA_KAELTHASEVENT, 4); Phase = 5; Phase_Timer = 10000; @@ -892,7 +895,7 @@ class boss_kaelthas : public CreatureScript // 1) Kael'thas will portal the whole raid right into his body for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i) { - Unit* unit = Unit::GetUnit((*me), (*i)->getUnitGuid()); + Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid()); if (unit && (unit->GetTypeId() == TYPEID_PLAYER)) { //Use work around packet to prevent player from being dropped from combat @@ -913,7 +916,7 @@ class boss_kaelthas : public CreatureScript // 2) At that point he will put a Gravity Lapse debuff on everyone for (i = me->getThreatManager().getThreatList().begin(); i != me->getThreatManager().getThreatList().end(); ++i) { - if (Unit* unit = Unit::GetUnit((*me), (*i)->getUnitGuid())) + if (Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid())) { DoCast(unit, SPELL_KNOCKBACK, true); //Gravity lapse - needs an exception in Spell system to work @@ -945,7 +948,7 @@ class boss_kaelthas : public CreatureScript //Remove flight for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i) { - if (Unit* unit = Unit::GetUnit((*me), (*i)->getUnitGuid())) + if (Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid())) { //Using packet workaround WorldPacket data(SMSG_MOVE_UNSET_CAN_FLY, 12); @@ -996,9 +999,9 @@ class boss_kaelthas : public CreatureScript } } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_kaelthasAI(Creature); + return new boss_kaelthasAI(creature); } }; @@ -1042,7 +1045,7 @@ class boss_thaladred_the_darkener : public CreatureScript void JustDied(Unit* /*killer*/) { - if (m_instance && m_instance->GetData(DATA_KAELTHASEVENT) == 3) + if (instance && instance->GetData(DATA_KAELTHASEVENT) == 3) DoScriptText(SAY_THALADRED_DEATH, me); } @@ -1094,9 +1097,9 @@ class boss_thaladred_the_darkener : public CreatureScript } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_thaladred_the_darkenerAI(Creature); + return new boss_thaladred_the_darkenerAI(creature); } }; @@ -1132,9 +1135,9 @@ class boss_lord_sanguinar : public CreatureScript DoScriptText(SAY_SANGUINAR_AGGRO, me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { - if (m_instance && m_instance->GetData(DATA_KAELTHASEVENT) == 3) + if (instance && instance->GetData(DATA_KAELTHASEVENT) == 3) DoScriptText(SAY_SANGUINAR_DEATH, me); } @@ -1162,9 +1165,9 @@ class boss_lord_sanguinar : public CreatureScript DoMeleeAttackIfReady(); } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_lord_sanguinarAI(Creature); + return new boss_lord_sanguinarAI(creature); } }; //Grand Astromancer Capernian AI @@ -1199,7 +1202,7 @@ class boss_grand_astromancer_capernian : public CreatureScript void JustDied(Unit* /*killer*/) { - if (m_instance && m_instance->GetData(DATA_KAELTHASEVENT) == 3) + if (instance && instance->GetData(DATA_KAELTHASEVENT) == 3) DoScriptText(SAY_CAPERNIAN_DEATH, me); } @@ -1284,7 +1287,7 @@ class boss_grand_astromancer_capernian : public CreatureScript std::list& m_threatlist = me->getThreatManager().getThreatList(); for (std::list::const_iterator i = m_threatlist.begin(); i!= m_threatlist.end(); ++i) { - Unit* unit = Unit::GetUnit((*me), (*i)->getUnitGuid()); + Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid()); //if in melee range if (unit && unit->IsWithinDistInMap(me, 5)) { @@ -1306,9 +1309,9 @@ class boss_grand_astromancer_capernian : public CreatureScript } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_grand_astromancer_capernianAI(Creature); + return new boss_grand_astromancer_capernianAI(creature); } }; @@ -1338,7 +1341,7 @@ class boss_master_engineer_telonicus : public CreatureScript void JustDied(Unit* /*killer*/) { - if (m_instance && m_instance->GetData(DATA_KAELTHASEVENT) == 3) + if (instance && instance->GetData(DATA_KAELTHASEVENT) == 3) DoScriptText(SAY_TELONICUS_DEATH, me); } @@ -1389,9 +1392,9 @@ class boss_master_engineer_telonicus : public CreatureScript } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_master_engineer_telonicusAI(Creature); + return new boss_master_engineer_telonicusAI(creature); } }; @@ -1453,9 +1456,9 @@ class mob_kael_flamestrike : public CreatureScript } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new mob_kael_flamestrikeAI(Creature); + return new mob_kael_flamestrikeAI(creature); } }; @@ -1507,9 +1510,9 @@ class mob_phoenix_tk : public CreatureScript } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new mob_phoenix_tkAI(Creature); + return new mob_phoenix_tkAI(creature); } }; diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp index 576d0a8bbf2..275a72e75ac 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp @@ -76,8 +76,8 @@ class boss_void_reaver : public CreatureScript Enraged = false; - if (instance && me->isAlive()) - instance->SetData(DATA_VOIDREAVEREVENT, NOT_STARTED); + if (instance && me->isAlive()) + instance->SetData(DATA_VOIDREAVEREVENT, NOT_STARTED); } void KilledUnit(Unit* /*victim*/) @@ -85,7 +85,7 @@ class boss_void_reaver : public CreatureScript DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2, SAY_SLAY3), me); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); DoZoneInCombat(); diff --git a/src/server/scripts/Outland/TempestKeep/Eye/instance_the_eye.cpp b/src/server/scripts/Outland/TempestKeep/Eye/instance_the_eye.cpp index 1ec4a6e55ec..f25b6749055 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/instance_the_eye.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/instance_the_eye.cpp @@ -78,7 +78,8 @@ class instance_the_eye : public InstanceMapScript bool IsEncounterInProgress() const { for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; + if (m_auiEncounter[i] == IN_PROGRESS) + return true; return false; } diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp index b8b0ffd4d2e..a1287a57402 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp @@ -86,7 +86,7 @@ class boss_gatewatcher_iron_hand : public CreatureScript DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2), me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH_1, me); //TODO: Add door check/open code diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp index 7e435187be9..59837fdbed1 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp @@ -101,7 +101,7 @@ class boss_nethermancer_sepethrea : public CreatureScript DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2), me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); if (instance) diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp index cdc3b799b2c..3a4d449707d 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp @@ -103,7 +103,7 @@ class boss_pathaleon_the_calculator : public CreatureScript DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2), me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp index 9db2b660d2a..ad3c899237f 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp @@ -66,7 +66,7 @@ class instance_mechanar : public InstanceMapScript return false; } - uint64 GetData64 (uint32 /*identifier*/) + uint64 GetData64(uint32 /*identifier*/) { return 0; } diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp index db95f60f556..d675b438968 100644 --- a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp +++ b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp @@ -128,7 +128,7 @@ class npc_millhouse_manastorm : public CreatureScript Talk(SAY_KILL); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { Talk(SAY_DEATH); @@ -316,7 +316,7 @@ class npc_warden_mellichar : public CreatureScript if (!me->getVictim() && me->canCreatureAttack(who)) { - if (!me->canFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) + if (!me->CanFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) return; if (who->GetTypeId() != TYPEID_PLAYER) return; diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp index de86ec8672c..c2eeaf9fe7a 100644 --- a/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp +++ b/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp @@ -112,7 +112,7 @@ class boss_harbinger_skyriss : public CreatureScript void EnterCombat(Unit* /*who*/) {} - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); if (instance) diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp index 6a27d295ebc..ffe96fb7bd1 100644 --- a/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp +++ b/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp @@ -93,7 +93,8 @@ class instance_arcatraz : public InstanceMapScript bool IsEncounterInProgress() const { for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; + if (m_auiEncounter[i] == IN_PROGRESS) + return true; return false; } @@ -102,15 +103,41 @@ class instance_arcatraz : public InstanceMapScript { switch (go->GetEntry()) { - case CONTAINMENT_CORE_SECURITY_FIELD_ALPHA: Containment_Core_Security_Field_AlphaGUID = go->GetGUID(); break; - case CONTAINMENT_CORE_SECURITY_FIELD_BETA: Containment_Core_Security_Field_BetaGUID = go->GetGUID(); break; - case POD_ALPHA: Pod_AlphaGUID = go->GetGUID(); break; - case POD_GAMMA: Pod_GammaGUID = go->GetGUID(); break; - case POD_BETA: Pod_BetaGUID = go->GetGUID(); break; - case POD_DELTA: Pod_DeltaGUID = go->GetGUID(); break; - case POD_OMEGA: Pod_OmegaGUID = go->GetGUID(); break; - case SEAL_SPHERE: GoSphereGUID = go->GetGUID(); break; - //case WARDENS_SHIELD: Wardens_ShieldGUID = go->GetGUID(); break; + case CONTAINMENT_CORE_SECURITY_FIELD_ALPHA: + Containment_Core_Security_Field_AlphaGUID = go->GetGUID(); + break; + + case CONTAINMENT_CORE_SECURITY_FIELD_BETA: + Containment_Core_Security_Field_BetaGUID = go->GetGUID(); + break; + + case POD_ALPHA: + Pod_AlphaGUID = go->GetGUID(); + break; + + case POD_GAMMA: + Pod_GammaGUID = go->GetGUID(); + break; + + case POD_BETA: + Pod_BetaGUID = go->GetGUID(); + break; + + case POD_DELTA: + Pod_DeltaGUID = go->GetGUID(); + break; + + case POD_OMEGA: + Pod_OmegaGUID = go->GetGUID(); + break; + + case SEAL_SPHERE: + GoSphereGUID = go->GetGUID(); + break; + + /*case WARDENS_SHIELD: + Wardens_ShieldGUID = go->GetGUID(); + break;*/ } } diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp index ccac73c5dc6..ba61a1bfb12 100644 --- a/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp +++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp @@ -107,7 +107,7 @@ class boss_high_botanist_freywinn : public CreatureScript DoScriptText(RAND(SAY_KILL_1, SAY_KILL_2), me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); } @@ -195,9 +195,9 @@ class boss_high_botanist_freywinn : public CreatureScript } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_high_botanist_freywinnAI (Creature); + return new boss_high_botanist_freywinnAI(creature); } }; diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_laj.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_laj.cpp index 488ddba40cf..e8188f892b3 100644 --- a/src/server/scripts/Outland/TempestKeep/botanica/boss_laj.cpp +++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_laj.cpp @@ -211,9 +211,9 @@ class boss_laj : public CreatureScript } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_lajAI (Creature); + return new boss_lajAI(creature); } }; diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp index 7e9960225bb..3acde2455db 100644 --- a/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp +++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp @@ -118,9 +118,9 @@ class mob_warp_splinter_treant : public CreatureScript DoMeleeAttackIfReady(); } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new mob_warp_splinter_treantAI (Creature); + return new mob_warp_splinter_treantAI(creature); } }; @@ -169,7 +169,7 @@ class boss_warp_splinter : public CreatureScript DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2), me); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { DoScriptText(SAY_DEATH, me); } @@ -226,9 +226,9 @@ class boss_warp_splinter : public CreatureScript } }; - CreatureAI* GetAI(Creature* Creature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_warp_splinterAI (Creature); + return new boss_warp_splinterAI(creature); } }; diff --git a/src/server/scripts/Outland/blades_edge_mountains.cpp b/src/server/scripts/Outland/blades_edge_mountains.cpp index f99851f013e..4ec1d04b6ad 100644 --- a/src/server/scripts/Outland/blades_edge_mountains.cpp +++ b/src/server/scripts/Outland/blades_edge_mountains.cpp @@ -61,7 +61,7 @@ public: struct mobs_bladespire_ogreAI : public ScriptedAI { - mobs_bladespire_ogreAI(Creature* c) : ScriptedAI(c) {} + mobs_bladespire_ogreAI(Creature* creature) : ScriptedAI(creature) {} void Reset() { } @@ -73,7 +73,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*###### @@ -113,7 +112,7 @@ public: struct mobs_nether_drakeAI : public ScriptedAI { - mobs_nether_drakeAI(Creature* c) : ScriptedAI(c) {} + mobs_nether_drakeAI(Creature* creature) : ScriptedAI(creature) {} bool IsNihil; uint32 NihilSpeech_Timer; @@ -253,7 +252,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*###### @@ -278,7 +276,7 @@ public: struct npc_daranelleAI : public ScriptedAI { - npc_daranelleAI(Creature* c) : ScriptedAI(c) {} + npc_daranelleAI(Creature* creature) : ScriptedAI(creature) {} void Reset() { } @@ -299,7 +297,6 @@ public: ScriptedAI::MoveInLineOfSight(who); } }; - }; /*###### @@ -313,10 +310,10 @@ class npc_overseer_nuaar : public CreatureScript public: npc_overseer_nuaar() : CreatureScript("npc_overseer_nuaar") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { player->SEND_GOSSIP_MENU(10533, creature->GetGUID()); player->AreaExploredOrEventHappens(10682); @@ -333,7 +330,6 @@ public: return true; } - }; /*###### @@ -348,10 +344,10 @@ class npc_saikkal_the_elder : public CreatureScript public: npc_saikkal_the_elder() : CreatureScript("npc_saikkal_the_elder") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_STE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); @@ -374,7 +370,6 @@ public: return true; } - }; /*###### @@ -423,7 +418,6 @@ public: return true; } - }; /*###### @@ -469,7 +463,6 @@ public: void UpdateAI(const uint32 /*uiDiff*/) {} }; - }; /*###### @@ -499,7 +492,8 @@ public: void MoveInLineOfSight(Unit* who) { - if (!who || (!who->isAlive())) return; + if (!who || (!who->isAlive())) + return; if (me->IsWithinDistInMap(who, 50.0f)) { @@ -523,7 +517,7 @@ public: me->GetMotionMaster()->MoveTargetedHome(); Creature* Credit = me->FindNearestCreature(NPC_QUEST_CREDIT, 50, true); if (player && Credit) - player->KilledMonster(Credit->GetCreatureInfo(), Credit->GetGUID()); + player->KilledMonster(Credit->GetCreatureTemplate(), Credit->GetGUID()); } } @@ -534,7 +528,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*###### @@ -759,7 +752,7 @@ class npc_simon_bunny : public CreatureScript // Used for getting involved player guid. Parameter id is used for defining if is a large(Monument) or small(Relic) node void SetGUID(uint64 guid, int32 id) { - me->SetFlying(true); + me->SetCanFly(true); large = (bool)id; playerGUID = guid; @@ -781,7 +774,7 @@ class npc_simon_bunny : public CreatureScript colorSequence.clear(); playableSequence.clear(); playerSequence.clear(); - me->SetFloatValue(OBJECT_FIELD_SCALE_X, large ? 2 : 1); + me->SetObjectScale(large ? 2.0f : 1.0f); std::list ClusterList; Trinity::AllWorldObjectsInRange objects(me, searchDistance); @@ -797,20 +790,42 @@ class npc_simon_bunny : public CreatureScript { switch (go->GetGOInfo()->displayId) { - case GO_BLUE_CLUSTER_DISPLAY_LARGE: clusterIds[SIMON_BLUE] = go->GetEntry(); break; - case GO_RED_CLUSTER_DISPLAY_LARGE: clusterIds[SIMON_RED] = go->GetEntry(); break; - case GO_GREEN_CLUSTER_DISPLAY_LARGE: clusterIds[SIMON_GREEN] = go->GetEntry(); break; - case GO_YELLOW_CLUSTER_DISPLAY_LARGE: clusterIds[SIMON_YELLOW] = go->GetEntry(); break; + case GO_BLUE_CLUSTER_DISPLAY_LARGE: + clusterIds[SIMON_BLUE] = go->GetEntry(); + break; + + case GO_RED_CLUSTER_DISPLAY_LARGE: + clusterIds[SIMON_RED] = go->GetEntry(); + break; + + case GO_GREEN_CLUSTER_DISPLAY_LARGE: + clusterIds[SIMON_GREEN] = go->GetEntry(); + break; + + case GO_YELLOW_CLUSTER_DISPLAY_LARGE: + clusterIds[SIMON_YELLOW] = go->GetEntry(); + break; } } else { switch (go->GetGOInfo()->displayId) { - case GO_BLUE_CLUSTER_DISPLAY: clusterIds[SIMON_BLUE] = go->GetEntry(); break; - case GO_RED_CLUSTER_DISPLAY: clusterIds[SIMON_RED] = go->GetEntry(); break; - case GO_GREEN_CLUSTER_DISPLAY: clusterIds[SIMON_GREEN] = go->GetEntry(); break; - case GO_YELLOW_CLUSTER_DISPLAY: clusterIds[SIMON_YELLOW] = go->GetEntry(); break; + case GO_BLUE_CLUSTER_DISPLAY: + clusterIds[SIMON_BLUE] = go->GetEntry(); + break; + + case GO_RED_CLUSTER_DISPLAY: + clusterIds[SIMON_RED] = go->GetEntry(); + break; + + case GO_GREEN_CLUSTER_DISPLAY: + clusterIds[SIMON_GREEN] = go->GetEntry(); + break; + + case GO_YELLOW_CLUSTER_DISPLAY: + clusterIds[SIMON_YELLOW] = go->GetEntry(); + break; } } } @@ -840,7 +855,7 @@ class npc_simon_bunny : public CreatureScript if (GameObject* relic = me->FindNearestGameObject(large ? GO_APEXIS_MONUMENT : GO_APEXIS_RELIC, searchDistance)) relic->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); - me->ForcedDespawn(1000); + me->DespawnOrUnsummon(1000); } /* diff --git a/src/server/scripts/Outland/boss_doomlord_kazzak.cpp b/src/server/scripts/Outland/boss_doomlord_kazzak.cpp index 2f6e0823da1..a213713ae1a 100644 --- a/src/server/scripts/Outland/boss_doomlord_kazzak.cpp +++ b/src/server/scripts/Outland/boss_doomlord_kazzak.cpp @@ -18,7 +18,7 @@ #include "ScriptPCH.h" -enum Yells +enum Texts { SAY_INTRO = 0, SAY_AGGRO = 1, @@ -31,15 +31,15 @@ enum Yells enum Spells { - SPELL_SHADOWVOLLEY = 32963, + SPELL_SHADOW_VOLLEY = 32963, SPELL_CLEAVE = 31779, SPELL_THUNDERCLAP = 36706, - SPELL_VOIDBOLT = 39329, - SPELL_MARKOFKAZZAK = 32960, - SPELL_MARKOFKAZZAK_DAMAGE = 32961, + SPELL_VOID_BOLT = 39329, + SPELL_MARK_OF_KAZZAK = 32960, SPELL_ENRAGE = 32964, - SPELL_CAPTURESOUL = 32966, - SPELL_TWISTEDREFLECTION = 21063 + SPELL_CAPTURE_SOUL = 32966, + SPELL_TWISTED_REFLECTION = 21063, + SPELL_BERSERK = 32965, }; enum Events @@ -47,10 +47,11 @@ enum Events EVENT_SHADOW_VOLLEY = 1, EVENT_CLEAVE = 2, EVENT_THUNDERCLAP = 3, - EVENT_VOIDBOLT = 4, + EVENT_VOID_BOLT = 4, EVENT_MARK_OF_KAZZAK = 5, EVENT_ENRAGE = 6, - EVENT_TWISTED_REFLECTION = 7 + EVENT_TWISTED_REFLECTION = 7, + EVENT_BERSERK = 8 }; class boss_doomlord_kazzak : public CreatureScript @@ -70,10 +71,11 @@ class boss_doomlord_kazzak : public CreatureScript _events.ScheduleEvent(EVENT_SHADOW_VOLLEY, urand(6000, 10000)); _events.ScheduleEvent(EVENT_CLEAVE, 7000); _events.ScheduleEvent(EVENT_THUNDERCLAP, urand(14000, 18000)); - _events.ScheduleEvent(EVENT_VOIDBOLT, 30000); + _events.ScheduleEvent(EVENT_VOID_BOLT, 30000); _events.ScheduleEvent(EVENT_MARK_OF_KAZZAK, 25000); _events.ScheduleEvent(EVENT_ENRAGE, 60000); _events.ScheduleEvent(EVENT_TWISTED_REFLECTION, 33000); + _events.ScheduleEvent(EVENT_BERSERK, 180000); } void JustRespawned() @@ -92,12 +94,12 @@ class boss_doomlord_kazzak : public CreatureScript if (victim->GetTypeId() != TYPEID_PLAYER) return; - DoCast(me, SPELL_CAPTURESOUL); + DoCast(me, SPELL_CAPTURE_SOUL); Talk(SAY_KILL); } - void JustDied(Unit* /*victim*/) + void JustDied(Unit* /*killer*/) { Talk(SAY_DEATH); } @@ -118,7 +120,7 @@ class boss_doomlord_kazzak : public CreatureScript switch (eventId) { case EVENT_SHADOW_VOLLEY: - DoCastVictim(SPELL_SHADOWVOLLEY); + DoCastVictim(SPELL_SHADOW_VOLLEY); _events.ScheduleEvent(EVENT_SHADOW_VOLLEY, urand(4000, 6000)); break; case EVENT_CLEAVE: @@ -129,13 +131,13 @@ class boss_doomlord_kazzak : public CreatureScript DoCastVictim(SPELL_THUNDERCLAP); _events.ScheduleEvent(EVENT_THUNDERCLAP, urand(10000, 14000)); break; - case EVENT_VOIDBOLT: - DoCastVictim(SPELL_VOIDBOLT); - _events.ScheduleEvent(EVENT_VOIDBOLT, urand(15000, 18000)); + case EVENT_VOID_BOLT: + DoCastVictim(SPELL_VOID_BOLT); + _events.ScheduleEvent(EVENT_VOID_BOLT, urand(15000, 18000)); break; case EVENT_MARK_OF_KAZZAK: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true)) - DoCast(target, SPELL_MARKOFKAZZAK); + DoCast(target, SPELL_MARK_OF_KAZZAK); _events.ScheduleEvent(EVENT_MARK_OF_KAZZAK, 20000); break; case EVENT_ENRAGE: @@ -145,9 +147,12 @@ class boss_doomlord_kazzak : public CreatureScript break; case EVENT_TWISTED_REFLECTION: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true)) - DoCast(target, SPELL_TWISTEDREFLECTION); + DoCast(target, SPELL_TWISTED_REFLECTION); _events.ScheduleEvent(EVENT_TWISTED_REFLECTION, 15000); break; + case EVENT_BERSERK: + DoCast(me, SPELL_BERSERK); + break; default: break; } diff --git a/src/server/scripts/Outland/boss_doomwalker.cpp b/src/server/scripts/Outland/boss_doomwalker.cpp index c4bd232cc85..67834601d6f 100644 --- a/src/server/scripts/Outland/boss_doomwalker.cpp +++ b/src/server/scripts/Outland/boss_doomwalker.cpp @@ -18,7 +18,7 @@ #include "ScriptPCH.h" -enum Yells +enum Texts { SAY_AGGRO = 0, SAY_EARTHQUAKE = 1, @@ -79,7 +79,7 @@ class boss_doomwalker : public CreatureScript Talk(SAY_SLAY); } - void JustDied(Unit* /*Killer*/) + void JustDied(Unit* /*killer*/) { Talk(SAY_DEATH); } diff --git a/src/server/scripts/Outland/hellfire_peninsula.cpp b/src/server/scripts/Outland/hellfire_peninsula.cpp index 7d4de409b8b..b0e19f0e322 100644 --- a/src/server/scripts/Outland/hellfire_peninsula.cpp +++ b/src/server/scripts/Outland/hellfire_peninsula.cpp @@ -66,7 +66,7 @@ public: struct npc_aeranasAI : public ScriptedAI { - npc_aeranasAI(Creature* c) : ScriptedAI(c) {} + npc_aeranasAI(Creature* creature) : ScriptedAI(creature) {} uint32 Faction_Timer; uint32 EnvelopingWinds_Timer; @@ -124,7 +124,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*###### @@ -181,9 +180,9 @@ public: npc_escortAI::MoveInLineOfSight(who); } - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { - switch (uiPointId) + switch (waypointId) { case 0: DoScriptText(EMOTE_WOLF_LIFT_HEAD, me); @@ -198,7 +197,6 @@ public: } } }; - }; /*###### @@ -215,7 +213,6 @@ public: go->SummonCreature(C_AERANAS, -1321.79f, 4043.80f, 116.24f, 1.25f, TEMPSUMMON_TIMED_DESPAWN, 180000); return false; } - }; /*###### @@ -234,10 +231,10 @@ class npc_naladu : public CreatureScript public: npc_naladu() : CreatureScript("npc_naladu") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_NALADU1, creature->GetGUID()); return true; @@ -252,7 +249,6 @@ public: player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); return true; } - }; /*###### @@ -274,10 +270,10 @@ class npc_tracy_proudwell : public CreatureScript public: npc_tracy_proudwell() : CreatureScript("npc_tracy_proudwell") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TRACY_PROUDWELL_ITEM2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); @@ -308,7 +304,6 @@ public: player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); return true; } - }; /*###### @@ -331,10 +326,10 @@ class npc_trollbane : public CreatureScript public: npc_trollbane() : CreatureScript("npc_trollbane") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TROLLBANE_ITEM2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); @@ -361,7 +356,6 @@ public: player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); return true; } - }; /*###### @@ -406,40 +400,39 @@ public: struct npc_wounded_blood_elfAI : public npc_escortAI { - npc_wounded_blood_elfAI(Creature* c) : npc_escortAI(c) {} + npc_wounded_blood_elfAI(Creature* creature) : npc_escortAI(creature) {} - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - switch (i) + switch (waypointId) { - case 0: - DoScriptText(SAY_ELF_START, me, player); - break; - case 9: - DoScriptText(SAY_ELF_SUMMON1, me, player); - // Spawn two Haal'eshi Talonguard - DoSpawnCreature(16967, -15, -15, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - DoSpawnCreature(16967, -17, -17, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - break; - case 13: - DoScriptText(SAY_ELF_RESTING, me, player); - break; - case 14: - DoScriptText(SAY_ELF_SUMMON2, me, player); - // Spawn two Haal'eshi Windwalker - DoSpawnCreature(16966, -15, -15, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - DoSpawnCreature(16966, -17, -17, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - break; - case 27: - DoScriptText(SAY_ELF_COMPLETE, me, player); - // Award quest credit - player->GroupEventHappens(QUEST_ROAD_TO_FALCON_WATCH, me); - break; + case 0: + DoScriptText(SAY_ELF_START, me, player); + break; + case 9: + DoScriptText(SAY_ELF_SUMMON1, me, player); + // Spawn two Haal'eshi Talonguard + DoSpawnCreature(16967, -15, -15, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + DoSpawnCreature(16967, -17, -17, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + break; + case 13: + DoScriptText(SAY_ELF_RESTING, me, player); + break; + case 14: + DoScriptText(SAY_ELF_SUMMON2, me, player); + // Spawn two Haal'eshi Windwalker + DoSpawnCreature(16966, -15, -15, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + DoSpawnCreature(16966, -17, -17, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + break; + case 27: + DoScriptText(SAY_ELF_COMPLETE, me, player); + // Award quest credit + player->GroupEventHappens(QUEST_ROAD_TO_FALCON_WATCH, me); + break; } } @@ -456,7 +449,6 @@ public: summoned->AI()->AttackStart(me); } }; - }; /*###### @@ -529,7 +521,6 @@ public: DoMeleeAttackIfReady(); } }; - }; void AddSC_hellfire_peninsula() diff --git a/src/server/scripts/Outland/nagrand.cpp b/src/server/scripts/Outland/nagrand.cpp index 668db2efcbb..871a2f200bb 100644 --- a/src/server/scripts/Outland/nagrand.cpp +++ b/src/server/scripts/Outland/nagrand.cpp @@ -57,10 +57,10 @@ class npc_greatmother_geyah : public CreatureScript public: npc_greatmother_geyah() : CreatureScript("npc_greatmother_geyah") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); @@ -90,7 +90,6 @@ public: player->AreaExploredOrEventHappens(10044); player->CLOSE_GOSSIP_MENU(); break; - case GOSSIP_ACTION_INFO_DEF + 10: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11); player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); @@ -135,12 +134,10 @@ public: player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); } else - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); return true; } - }; /*##### @@ -224,9 +221,9 @@ public: DoCast(me, SPELL_EARTHBIND_TOTEM, false); } - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { - switch (uiPointId) + switch (waypointId) { case 7: DoScriptText(SAY_MAG_MORE, me); @@ -235,7 +232,6 @@ public: DoScriptText(SAY_MAG_MORE_REPLY, temp); me->SummonCreature(NPC_MURK_PUTRIFIER, m_afAmbushB[0]-2.5f, m_afAmbushB[1]-2.5f, m_afAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - me->SummonCreature(NPC_MURK_SCAVENGER, m_afAmbushB[0]+2.5f, m_afAmbushB[1]+2.5f, m_afAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); me->SummonCreature(NPC_MURK_SCAVENGER, m_afAmbushB[0]+2.5f, m_afAmbushB[1]-2.5f, m_afAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); break; @@ -258,7 +254,7 @@ public: if (summoned->isTotem()) return; - summoned->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + summoned->SetWalk(false); summoned->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()); summoned->AI()->AttackStart(me); @@ -311,7 +307,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*###### @@ -330,7 +325,7 @@ public: struct npc_creditmarker_visit_with_ancestorsAI : public ScriptedAI { - npc_creditmarker_visit_with_ancestorsAI(Creature* c) : ScriptedAI(c) {} + npc_creditmarker_visit_with_ancestorsAI(Creature* creature) : ScriptedAI(creature) {} void Reset() {} @@ -356,7 +351,6 @@ public: } } }; - }; /*###### @@ -401,6 +395,7 @@ public: player->KilledMonsterCredit(NPC_CORKI_CREDIT_1, 0); } } + if (go->GetEntry() == GO_CORKIS_PRISON_2) { if (Creature* corki = go->FindNearestCreature(NPC_CORKI_2, 25, true)) @@ -411,6 +406,7 @@ public: player->KilledMonsterCredit(NPC_CORKI_2, 0); } } + if (go->GetEntry() == GO_CORKIS_PRISON_3) { if (Creature* corki = go->FindNearestCreature(NPC_CORKI_3, 25, true)) @@ -444,18 +440,22 @@ public: void Reset() { + Say_Timer = 5000; ReleasedFromCage = false; } void UpdateAI(uint32 const diff) { - if (Say_Timer <= diff && ReleasedFromCage) + if (ReleasedFromCage) { - me->ForcedDespawn(); - ReleasedFromCage = false; + if (Say_Timer <= diff) + { + me->DespawnOrUnsummon(); + ReleasedFromCage = false; + } + else + Say_Timer -= diff; } - else - Say_Timer -= diff; } void MovementInform(uint32 type, uint32 id) @@ -565,9 +565,9 @@ public: } } - void WaypointReached(uint32 PointId) + void WaypointReached(uint32 waypointId) { - switch(PointId) + switch (waypointId) { case 3: { @@ -603,7 +603,7 @@ public: if (summoned->isTotem()) return; - summoned->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + summoned->SetWalk(false); summoned->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()); summoned->AI()->AttackStart(me); } @@ -685,15 +685,11 @@ class go_warmaul_prison : public GameObjectScript if (Creature* prisoner = go->FindNearestCreature(NPC_MAGHAR_PRISONER, 5.0f)) { - if (prisoner) - { - go->UseDoorOrButton(); - if (player) - player->KilledMonsterCredit(NPC_MAGHAR_PRISONER, 0); + go->UseDoorOrButton(); + player->KilledMonsterCredit(NPC_MAGHAR_PRISONER, 0); - prisoner->AI()->Talk(SAY_FREE, player->GetGUID()); - prisoner->ForcedDespawn(6000); - } + prisoner->AI()->Talk(SAY_FREE, player->GetGUID()); + prisoner->DespawnOrUnsummon(6000); } return true; } diff --git a/src/server/scripts/Outland/netherstorm.cpp b/src/server/scripts/Outland/netherstorm.cpp index 79811069402..afc18c71b92 100644 --- a/src/server/scripts/Outland/netherstorm.cpp +++ b/src/server/scripts/Outland/netherstorm.cpp @@ -78,7 +78,7 @@ public: struct npc_manaforge_control_consoleAI : public ScriptedAI { - npc_manaforge_control_consoleAI(Creature* c) : ScriptedAI(c) {} + npc_manaforge_control_consoleAI(Creature* creature) : ScriptedAI(creature) {} uint32 Event_Timer; uint32 Wave_Timer; @@ -115,7 +115,7 @@ public: if (someplayer) { - Unit* p = Unit::GetUnit((*me), someplayer); + Unit* p = Unit::GetUnit(*me, someplayer); if (p && p->GetTypeId() == TYPEID_PLAYER) { switch (me->GetEntry()) @@ -142,7 +142,7 @@ public: if (goConsole) { - if (GameObject* go = GameObject::GetGameObject((*me), goConsole)) + if (GameObject* go = GameObject::GetGameObject(*me, goConsole)) go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE); } } @@ -243,7 +243,7 @@ public: case 1: if (someplayer) { - Unit* u = Unit::GetUnit((*me), someplayer); + Unit* u = Unit::GetUnit(*me, someplayer); if (u && u->GetTypeId() == TYPEID_PLAYER) DoScriptText(EMOTE_START, me, u); } Event_Timer = 60000; @@ -271,14 +271,14 @@ public: DoScriptText(EMOTE_COMPLETE, me); if (someplayer) { - Unit* u = Unit::GetUnit((*me), someplayer); + Unit* u = Unit::GetUnit(*me, someplayer); if (u && u->GetTypeId() == TYPEID_PLAYER) CAST_PLR(u)->KilledMonsterCredit(me->GetEntry(), me->GetGUID()); DoCast(me, SPELL_DISABLE_VISUAL); } if (goConsole) { - if (GameObject* go = GameObject::GetGameObject((*me), goConsole)) + if (GameObject* go = GameObject::GetGameObject(*me, goConsole)) go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE); } ++Phase; @@ -295,7 +295,6 @@ public: } } }; - }; /*###### @@ -350,7 +349,6 @@ public: } return true; } - }; /*###### @@ -396,7 +394,7 @@ public: struct npc_commander_dawnforgeAI : public ScriptedAI { - npc_commander_dawnforgeAI(Creature* c) : ScriptedAI(c) { Reset (); } + npc_commander_dawnforgeAI(Creature* creature) : ScriptedAI(creature) { Reset(); } uint64 PlayerGUID; uint64 ardonisGUID; @@ -633,7 +631,6 @@ public: } } }; - }; class at_commander_dawnforge : public AreaTriggerScript @@ -650,7 +647,6 @@ public: if (player->isAlive() && player->GetQuestStatus(QUEST_INFO_GATHERING) == QUEST_STATUS_INCOMPLETE) { Creature* Dawnforge = player->FindNearestCreature(CreatureEntry[1], 30.0f); - if (!Dawnforge) return false; @@ -659,7 +655,6 @@ public: } return false; } - }; /*###### @@ -690,10 +685,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { creature->CastSpell(player, SPELL_PHASE_DISTRUPTOR, false); player->CLOSE_GOSSIP_MENU(); @@ -714,7 +709,6 @@ public: return true; } - }; /*###### @@ -750,7 +744,7 @@ public: struct mob_phase_hunterAI : public ScriptedAI { - mob_phase_hunterAI(Creature* c) : ScriptedAI(c) {} + mob_phase_hunterAI(Creature* creature) : ScriptedAI(creature) {} bool Weak; bool Materialize; @@ -818,7 +812,7 @@ public: } if (!UnitsWithMana.empty()) { - DoCast(SelectRandomContainerElement(UnitsWithMana), SPELL_MANA_BURN); + DoCast(Trinity::Containers::SelectRandomContainerElement(UnitsWithMana), SPELL_MANA_BURN); ManaBurnTimer = 8000 + (rand() % 10 * 1000); // 8-18 sec cd } else @@ -849,7 +843,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*###### @@ -888,8 +881,7 @@ public: struct npc_bessyAI : public npc_escortAI { - - npc_bessyAI(Creature* c) : npc_escortAI(c) {} + npc_bessyAI(Creature* creature) : npc_escortAI(creature) {} void JustDied(Unit* /*killer*/) { @@ -897,34 +889,32 @@ public: player->FailQuest(Q_ALMABTRIEB); } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - switch (i) + switch (waypointId) { case 3: //first spawn me->SummonCreature(SPAWN_FIRST, 2449.67f, 2183.11f, 96.85f, 6.20f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); me->SummonCreature(SPAWN_FIRST, 2449.53f, 2184.43f, 96.36f, 6.27f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); me->SummonCreature(SPAWN_FIRST, 2449.85f, 2186.34f, 97.57f, 6.08f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); break; - case 7: me->SummonCreature(SPAWN_SECOND, 2309.64f, 2186.24f, 92.25f, 6.06f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); me->SummonCreature(SPAWN_SECOND, 2309.25f, 2183.46f, 91.75f, 6.22f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); break; - case 12: - if (player) - player->GroupEventHappens(Q_ALMABTRIEB, me); + player->GroupEventHappens(Q_ALMABTRIEB, me); if (me->FindNearestCreature(N_THADELL, 30)) - DoScriptText(SAY_THADELL_1, me); break; + DoScriptText(SAY_THADELL_1, me); + break; case 13: if (me->FindNearestCreature(N_THADELL, 30)) - DoScriptText(SAY_THADELL_2, me, player); break; + DoScriptText(SAY_THADELL_2, me, player); + break; } } @@ -937,9 +927,7 @@ public: { me->RestoreFaction(); } - }; - }; /*###### @@ -975,13 +963,13 @@ public: uiTakeTimer=3000; } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); if (!player) return; - switch (i) + switch (waypointId) { case 7: case 17: @@ -996,16 +984,14 @@ public: } break; case 36: //return and quest_complete - if (player) - player->CompleteQuest(QUEST_MARK_V_IS_ALIVE); + player->CompleteQuest(QUEST_MARK_V_IS_ALIVE); break; } } void JustDied(Unit* /*killer*/) { - Player* player = GetPlayerForEscort(); - if (player) + if (Player* player = GetPlayerForEscort()) player->FailQuest(QUEST_MARK_V_IS_ALIVE); } @@ -1018,12 +1004,12 @@ public: if (uiTakeTimer < uiDiff) { me->HandleEmoteCommand(EMOTE_STATE_NONE); - if (GameObject* pGO = GetClosestGameObjectWithEntry(me, GO_DRAENEI_MACHINE, INTERACTION_DISTANCE)) + if (GameObject* go = GetClosestGameObjectWithEntry(me, GO_DRAENEI_MACHINE, INTERACTION_DISTANCE)) { SetEscortPaused(false); bTake=false; uiTakeTimer = 3000; - pGO->Delete(); + go->Delete(); } } else @@ -1071,7 +1057,7 @@ class go_captain_tyralius_prison : public GameObjectScript player->KilledMonsterCredit(NPC_CAPTAIN_TYRALIUS, 0); tyralius->AI()->Talk(SAY_FREE); - tyralius->ForcedDespawn(8000); + tyralius->DespawnOrUnsummon(8000); } return true; } diff --git a/src/server/scripts/Outland/shadowmoon_valley.cpp b/src/server/scripts/Outland/shadowmoon_valley.cpp index 19c4754c4fd..340049ba4fa 100644 --- a/src/server/scripts/Outland/shadowmoon_valley.cpp +++ b/src/server/scripts/Outland/shadowmoon_valley.cpp @@ -75,7 +75,7 @@ public: struct mob_mature_netherwing_drakeAI : public ScriptedAI { - mob_mature_netherwing_drakeAI(Creature* c) : ScriptedAI(c) { } + mob_mature_netherwing_drakeAI(Creature* creature) : ScriptedAI(creature) { } uint64 uiPlayerGUID; @@ -96,12 +96,12 @@ public: CastTimer = 5000; } - void SpellHit(Unit* pCaster, SpellInfo const* pSpell) + void SpellHit(Unit* pCaster, SpellInfo const* spell) { if (bCanEat || bIsEating) return; - if (pCaster->GetTypeId() == TYPEID_PLAYER && pSpell->Id == SPELL_PLACE_CARCASS && !me->HasAura(SPELL_JUST_EATEN)) + if (pCaster->GetTypeId() == TYPEID_PLAYER && spell->Id == SPELL_PLACE_CARCASS && !me->HasAura(SPELL_JUST_EATEN)) { uiPlayerGUID = pCaster->GetGUID(); bCanEat = true; @@ -179,7 +179,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*### @@ -207,7 +206,7 @@ public: struct mob_enslaved_netherwing_drakeAI : public ScriptedAI { - mob_enslaved_netherwing_drakeAI(Creature* c) : ScriptedAI(c) + mob_enslaved_netherwing_drakeAI(Creature* creature) : ScriptedAI(creature) { PlayerGUID = 0; Tapped = false; @@ -224,7 +223,7 @@ public: me->setFaction(FACTION_DEFAULT); FlyTimer = 10000; - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetDisableGravity(false); me->SetVisible(true); } @@ -242,7 +241,6 @@ public: DoCast(caster, SPELL_FORCE_OF_NELTHARAKU, true); Unit* Dragonmaw = me->FindNearestCreature(CREATURE_DRAGONMAW_SUBJUGATOR, 50); - if (Dragonmaw) { me->AddThreat(Dragonmaw, 100000.0f); @@ -264,14 +262,14 @@ public: { if (PlayerGUID) { - Unit* player = Unit::GetUnit((*me), PlayerGUID); + Unit* player = Unit::GetUnit(*me, PlayerGUID); if (player) DoCast(player, SPELL_FORCE_OF_NELTHARAKU, true); PlayerGUID = 0; } me->SetVisible(false); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetDisableGravity(false); me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); me->RemoveCorpse(); } @@ -309,7 +307,7 @@ public: pos.m_positionZ += 25; } - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetDisableGravity(true); me->GetMotionMaster()->MovePoint(1, pos); } } @@ -321,7 +319,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*##### @@ -340,7 +337,7 @@ public: struct mob_dragonmaw_peonAI : public ScriptedAI { - mob_dragonmaw_peonAI(Creature* c) : ScriptedAI(c) {} + mob_dragonmaw_peonAI(Creature* creature) : ScriptedAI(creature) {} uint64 PlayerGUID; bool Tapped; @@ -366,7 +363,7 @@ public: float x, y, z; caster->GetClosePoint(x, y, z, me->GetObjectSize()); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); me->GetMotionMaster()->MovePoint(1, x, y, z); } } @@ -401,7 +398,6 @@ public: } } }; - }; /*###### @@ -413,10 +409,10 @@ class npc_drake_dealer_hurlunk : public CreatureScript public: npc_drake_dealer_hurlunk() : CreatureScript("npc_drake_dealer_hurlunk") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_TRADE) + if (action == GOSSIP_ACTION_TRADE) player->GetSession()->SendListInventory(creature->GetGUID()); return true; @@ -431,7 +427,6 @@ public: return true; } - }; /*###### @@ -446,10 +441,10 @@ class npcs_flanis_swiftwing_and_kagrosh : public CreatureScript public: npcs_flanis_swiftwing_and_kagrosh() : CreatureScript("npcs_flanis_swiftwing_and_kagrosh") { } - bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { ItemPosCountVec dest; uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 30658, 1, NULL); @@ -459,7 +454,7 @@ public: player->PlayerTalkClass->ClearMenus(); } } - if (uiAction == GOSSIP_ACTION_INFO_DEF+2) + if (action == GOSSIP_ACTION_INFO_DEF+2) { ItemPosCountVec dest; uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 30659, 1, NULL); @@ -483,7 +478,6 @@ public: return true; } - }; /*###### @@ -504,10 +498,10 @@ class npc_murkblood_overseer : public CreatureScript public: npc_murkblood_overseer() : CreatureScript("npc_murkblood_overseer") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SMO1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); @@ -552,7 +546,6 @@ public: player->SEND_GOSSIP_MENU(10940, creature->GetGUID()); return true; } - }; /*###### @@ -572,10 +565,10 @@ class npc_oronok_tornheart : public CreatureScript public: npc_oronok_tornheart() : CreatureScript("npc_oronok_tornheart") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_TRADE: player->GetSession()->SendListInventory(creature->GetGUID()); @@ -628,7 +621,6 @@ public: return true; } - }; /*#### @@ -721,7 +713,7 @@ public: struct npc_overlord_morghorAI : public ScriptedAI { - npc_overlord_morghorAI(Creature* c) : ScriptedAI(c) {} + npc_overlord_morghorAI(Creature* creature) : ScriptedAI(creature) {} uint64 PlayerGUID; uint64 IllidanGUID; @@ -766,9 +758,8 @@ public: uint32 NextStep(uint32 Step) { - Unit* player = Unit::GetUnit((*me), PlayerGUID); - - Unit* Illi = Unit::GetUnit((*me), IllidanGUID); + Player* player = Unit::GetPlayer(*me, PlayerGUID); + Unit* Illi = Unit::GetUnit(*me, IllidanGUID); if (!player || !Illi) { @@ -778,95 +769,178 @@ public: switch (Step) { - case 0: return 0; break; - case 1: me->GetMotionMaster()->MovePoint(0, -5104.41f, 595.297f, 85.6838f); return 9000; break; - case 2: DoScriptText(OVERLORD_YELL_1, me, player); return 4500; break; - case 3: me->SetInFront(player); return 3200; break; - case 4: DoScriptText(OVERLORD_SAY_2, me, player); return 2000; break; - case 5: Illi->SetVisible(true); - Illi->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); return 350; break; - case 6: - Illi->CastSpell(Illi, SPELL_ONE, true); - Illi->SetTarget(me->GetGUID()); - me->SetTarget(IllidanGUID); - return 2000; break; - case 7: DoScriptText(OVERLORD_YELL_2, me); return 4500; break; - case 8: me->SetUInt32Value(UNIT_FIELD_BYTES_1, 8); return 2500; break; - case 9: DoScriptText(OVERLORD_SAY_3, me); return 6500; break; - case 10: DoScriptText(LORD_ILLIDAN_SAY_1, Illi); return 5000; break; - case 11: DoScriptText(OVERLORD_SAY_4, me, player); return 6000; break; - case 12: DoScriptText(LORD_ILLIDAN_SAY_2, Illi); return 5500; break; - case 13: DoScriptText(LORD_ILLIDAN_SAY_3, Illi); return 4000; break; - case 14: Illi->SetTarget(PlayerGUID); return 1500; break; - case 15: DoScriptText(LORD_ILLIDAN_SAY_4, Illi); return 1500; break; - case 16: - if (player) - { - Illi->CastSpell(player, SPELL_TWO, true); - player->RemoveAurasDueToSpell(SPELL_THREE); - player->RemoveAurasDueToSpell(SPELL_FOUR); + case 0: + return 0; + break; + case 1: + me->GetMotionMaster()->MovePoint(0, -5104.41f, 595.297f, 85.6838f); + return 9000; + break; + case 2: + DoScriptText(OVERLORD_YELL_1, me, player); + return 4500; + break; + case 3: + me->SetInFront(player); + return 3200; + break; + case 4: + DoScriptText(OVERLORD_SAY_2, me, player); + return 2000; + break; + case 5: + Illi->SetVisible(true); + Illi->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + return 350; + break; + case 6: + Illi->CastSpell(Illi, SPELL_ONE, true); + Illi->SetTarget(me->GetGUID()); + me->SetTarget(IllidanGUID); + return 2000; + break; + case 7: + DoScriptText(OVERLORD_YELL_2, me); + return 4500; + break; + case 8: + me->SetUInt32Value(UNIT_FIELD_BYTES_1, 8); + return 2500; + break; + case 9: + DoScriptText(OVERLORD_SAY_3, me); + return 6500; + break; + case 10: + DoScriptText(LORD_ILLIDAN_SAY_1, Illi); return 5000; - }else{ - CAST_PLR(player)->FailQuest(QUEST_LORD_ILLIDAN_STORMRAGE); Step = 30; return 100; - } - break; - case 17: DoScriptText(LORD_ILLIDAN_SAY_5, Illi); return 5000; break; - case 18: DoScriptText(LORD_ILLIDAN_SAY_6, Illi); return 5000; break; - case 19: DoScriptText(LORD_ILLIDAN_SAY_7, Illi); return 5000; break; - case 20: - Illi->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); - Illi->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - return 500; break; - case 21: DoScriptText(OVERLORD_SAY_5, me); return 500; break; - case 22: - Illi->SetVisible(false); - Illi->setDeathState(JUST_DIED); - return 1000; break; - case 23: me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); return 2000; break; - case 24: me->SetTarget(PlayerGUID); return 5000; break; - case 25: DoScriptText(OVERLORD_SAY_6, me); return 2000; break; - case 26: - if (player) - CAST_PLR(player)->GroupEventHappens(QUEST_LORD_ILLIDAN_STORMRAGE, me); - return 6000; break; - case 27: - { - Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50); - if (Yarzill) - Yarzill->SetTarget(PlayerGUID); - return 500; } - break; - case 28: - player->RemoveAurasDueToSpell(SPELL_TWO); - player->RemoveAurasDueToSpell(41519); - player->CastSpell(player, SPELL_THREE, true); - player->CastSpell(player, SPELL_FOUR, true); - return 1000; break; - case 29: - { - Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50); - if (Yarzill) - DoScriptText(YARZILL_THE_MERC_SAY, Yarzill, player); - return 5000; } - break; - case 30: - { - Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50); - if (Yarzill) - Yarzill->SetTarget(0); - return 5000; } - break; - case 31: - { - Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50); - if (Yarzill) - Yarzill->CastSpell(player, 41540, true); - return 1000;} - break; - case 32: me->GetMotionMaster()->MovePoint(0, -5085.77f, 577.231f, 86.6719f); return 5000; break; - case 33: Reset(); return 100; break; - - default : return 0; + break; + case 11: + DoScriptText(OVERLORD_SAY_4, me, player); + return 6000; + break; + case 12: + DoScriptText(LORD_ILLIDAN_SAY_2, Illi); + return 5500; + break; + case 13: + DoScriptText(LORD_ILLIDAN_SAY_3, Illi); + return 4000; + break; + case 14: + Illi->SetTarget(PlayerGUID); + return 1500; + break; + case 15: + DoScriptText(LORD_ILLIDAN_SAY_4, Illi); + return 1500; + break; + case 16: + if (player) + { + Illi->CastSpell(player, SPELL_TWO, true); + player->RemoveAurasDueToSpell(SPELL_THREE); + player->RemoveAurasDueToSpell(SPELL_FOUR); + return 5000; + } + else + { + player->FailQuest(QUEST_LORD_ILLIDAN_STORMRAGE); + Step = 30; + return 100; + } + break; + case 17: + DoScriptText(LORD_ILLIDAN_SAY_5, Illi); + return 5000; + break; + case 18: + DoScriptText(LORD_ILLIDAN_SAY_6, Illi); + return 5000; + break; + case 19: + DoScriptText(LORD_ILLIDAN_SAY_7, Illi); + return 5000; + break; + case 20: + Illi->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); + Illi->SetDisableGravity(true); + return 500; + break; + case 21: + DoScriptText(OVERLORD_SAY_5, me); + return 500; + break; + case 22: + Illi->SetVisible(false); + Illi->setDeathState(JUST_DIED); + return 1000; + break; + case 23: + me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + return 2000; + break; + case 24: + me->SetTarget(PlayerGUID); + return 5000; + break; + case 25: + DoScriptText(OVERLORD_SAY_6, me); + return 2000; + break; + case 26: + player->GroupEventHappens(QUEST_LORD_ILLIDAN_STORMRAGE, me); + return 6000; + break; + case 27: + { + Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50); + if (Yarzill) + Yarzill->SetTarget(PlayerGUID); + return 500; + } + break; + case 28: + player->RemoveAurasDueToSpell(SPELL_TWO); + player->RemoveAurasDueToSpell(41519); + player->CastSpell(player, SPELL_THREE, true); + player->CastSpell(player, SPELL_FOUR, true); + return 1000; + break; + case 29: + { + Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50); + if (Yarzill) + DoScriptText(YARZILL_THE_MERC_SAY, Yarzill, player); + return 5000; + } + break; + case 30: + { + Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50); + if (Yarzill) + Yarzill->SetTarget(0); + return 5000; + } + break; + case 31: + { + Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50); + if (Yarzill) + Yarzill->CastSpell(player, 41540, true); + return 1000; + } + break; + case 32: + me->GetMotionMaster()->MovePoint(0, -5085.77f, 577.231f, 86.6719f); return 5000; + break; + case 33: + Reset(); + return 100; + break; + default : + return 0; + break; } } @@ -878,13 +952,10 @@ public: if (ConversationTimer <= diff) { if (Event && IllidanGUID && PlayerGUID) - { ConversationTimer = NextStep(++Step); - } } else ConversationTimer -= diff; } }; - }; /*#### @@ -948,14 +1019,13 @@ public: m_uiHealingTimer = 0; } - void WaypointReached(uint32 uiPointId) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - switch (uiPointId) + switch (waypointId) { case 13: DoScriptText(SAY_WIL_PROGRESS1, me, player); @@ -1002,7 +1072,6 @@ public: break; case 50: DoScriptText(SAY_WIL_END, me, player); - player->GroupEventHappens(QUEST_ESCAPE_COILSCAR, me); break; } @@ -1061,7 +1130,6 @@ public: } } }; - }; /*##### @@ -1176,7 +1244,7 @@ public: struct mob_torloth_the_magnificentAI : public ScriptedAI { - mob_torloth_the_magnificentAI(Creature* c) : ScriptedAI(c) {} + mob_torloth_the_magnificentAI(Creature* creature) : ScriptedAI(creature) {} uint32 AnimationTimer, SpellTimer1, SpellTimer2, SpellTimer3; @@ -1265,7 +1333,6 @@ public: me->CombatStop(); } else if (!Timers) { - SpellTimer1 = SpawnCast[6].Timer1; SpellTimer2 = SpawnCast[7].Timer1; SpellTimer3 = SpawnCast[8].Timer1; @@ -1296,32 +1363,29 @@ public: DoMeleeAttackIfReady(); } - void JustDied(Unit* slayer) + void JustDied(Unit* killer) { - if (slayer) - switch (slayer->GetTypeId()) - { - case TYPEID_UNIT: - if (Unit* owner = slayer->GetOwner()) - if (owner->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(owner)->GroupEventHappens(QUEST_BATTLE_OF_THE_CRIMSON_WATCH, me); - break; - - case TYPEID_PLAYER: - CAST_PLR(slayer)->GroupEventHappens(QUEST_BATTLE_OF_THE_CRIMSON_WATCH, me); - break; - default: - break; - } + switch (killer->GetTypeId()) + { + case TYPEID_UNIT: + if (Unit* owner = killer->GetOwner()) + if (owner->GetTypeId() == TYPEID_PLAYER) + CAST_PLR(owner)->GroupEventHappens(QUEST_BATTLE_OF_THE_CRIMSON_WATCH, me); + break; + case TYPEID_PLAYER: + CAST_PLR(killer)->GroupEventHappens(QUEST_BATTLE_OF_THE_CRIMSON_WATCH, me); + break; + default: + break; + } if (Creature* LordIllidan = (Unit::GetCreature(*me, LordIllidanGUID))) { - DoScriptText(END_TEXT, LordIllidan, slayer); + DoScriptText(END_TEXT, LordIllidan, killer); LordIllidan->AI()->EnterEvadeMode(); } } }; - }; /*##### @@ -1340,7 +1404,7 @@ public: struct npc_lord_illidan_stormrageAI : public ScriptedAI { - npc_lord_illidan_stormrageAI(Creature* c) : ScriptedAI(c) {} + npc_lord_illidan_stormrageAI(Creature* creature) : ScriptedAI(creature) {} uint64 PlayerGUID; @@ -1467,7 +1531,6 @@ public: EnterEvadeMode(); } }; - }; /*###### @@ -1486,7 +1549,7 @@ public: struct mob_illidari_spawnAI : public ScriptedAI { - mob_illidari_spawnAI(Creature* c) : ScriptedAI(c) {} + mob_illidari_spawnAI(Creature* creature) : ScriptedAI(creature) {} uint64 LordIllidanGUID; uint32 SpellTimer1, SpellTimer2, SpellTimer3; @@ -1499,7 +1562,8 @@ public: } void EnterCombat(Unit* /*who*/) {} - void JustDied(Unit* /*slayer*/) + + void JustDied(Unit* /*killer*/) { me->RemoveCorpse(); if (Creature* LordIllidan = (Unit::GetCreature(*me, LordIllidanGUID))) @@ -1586,7 +1650,6 @@ public: DoMeleeAttackIfReady(); } }; - }; void npc_lord_illidan_stormrage::npc_lord_illidan_stormrageAI::SummonNextWave() @@ -1680,7 +1743,6 @@ public: } return true; } - }; /*#### @@ -1739,9 +1801,9 @@ public: struct npc_enraged_spiritAI : public ScriptedAI { - npc_enraged_spiritAI(Creature* c) : ScriptedAI(c) {} + npc_enraged_spiritAI(Creature* creature) : ScriptedAI(creature) {} - void Reset() { } + void Reset() { } void EnterCombat(Unit* /*who*/){} @@ -1753,7 +1815,8 @@ public: uint32 entry = 0; uint32 credit = 0; - switch (me->GetEntry()) { + switch (me->GetEntry()) + { case ENTRY_ENRAGED_FIRE_SPIRIT: entry = ENTRY_FIERY_SOUL; //credit = SPELL_FIERY_SOUL_CAPTURED_CREDIT; @@ -1801,7 +1864,6 @@ public: } } }; - }; /*##### diff --git a/src/server/scripts/Outland/shattrath_city.cpp b/src/server/scripts/Outland/shattrath_city.cpp index ed68f55aeb5..79cce47e16c 100644 --- a/src/server/scripts/Outland/shattrath_city.cpp +++ b/src/server/scripts/Outland/shattrath_city.cpp @@ -55,10 +55,10 @@ class npc_raliq_the_drunk : public CreatureScript public: npc_raliq_the_drunk() : CreatureScript("npc_raliq_the_drunk") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { player->CLOSE_GOSSIP_MENU(); creature->setFaction(FACTION_HOSTILE_RD); @@ -83,9 +83,9 @@ public: struct npc_raliq_the_drunkAI : public ScriptedAI { - npc_raliq_the_drunkAI(Creature* c) : ScriptedAI(c) + npc_raliq_the_drunkAI(Creature* creature) : ScriptedAI(creature) { - m_uiNormFaction = c->getFaction(); + m_uiNormFaction = creature->getFaction(); } uint32 m_uiNormFaction; @@ -111,7 +111,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*###### @@ -152,7 +151,7 @@ public: struct npc_salsalabimAI : public ScriptedAI { - npc_salsalabimAI(Creature* c) : ScriptedAI(c) {} + npc_salsalabimAI(Creature* creature) : ScriptedAI(creature) {} uint32 MagneticPull_Timer; @@ -187,12 +186,11 @@ public: DoMeleeAttackIfReady(); } }; - }; /* ################################################## -Shattrath City Flask Vendors provides flasks to people exalted with 3 factions: +Shattrath City Flask Vendors provides flasks to people exalted with 3 fActions: Haldor the Compulsive Arcanist Xorith Both sell special flasks for use in Outlands 25man raids only, @@ -206,10 +204,10 @@ class npc_shattrathflaskvendors : public CreatureScript public: npc_shattrathflaskvendors() : CreatureScript("npc_shattrathflaskvendors") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_TRADE) + if (action == GOSSIP_ACTION_TRADE) player->GetSession()->SendListInventory(creature->GetGUID()); return true; @@ -247,7 +245,6 @@ public: return true; } - }; /*###### @@ -261,10 +258,10 @@ class npc_zephyr : public CreatureScript public: npc_zephyr() : CreatureScript("npc_zephyr") { } - bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) player->CastSpell(player, 37778, false); return true; @@ -279,7 +276,6 @@ public: return true; } - }; /*###### @@ -321,41 +317,82 @@ public: struct npc_kservantAI : public npc_escortAI { public: - npc_kservantAI(Creature* c) : npc_escortAI(c) {} + npc_kservantAI(Creature* creature) : npc_escortAI(creature) {} - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - switch (i) + switch (waypointId) { - case 0: DoScriptText(SAY1, me, player); break; - case 4: DoScriptText(WHISP1, me, player); break; - case 6: DoScriptText(WHISP2, me, player); break; - case 7: DoScriptText(WHISP3, me, player); break; - case 8: DoScriptText(WHISP4, me, player); break; - case 17: DoScriptText(WHISP5, me, player); break; - case 18: DoScriptText(WHISP6, me, player); break; - case 19: DoScriptText(WHISP7, me, player); break; - case 33: DoScriptText(WHISP8, me, player); break; - case 34: DoScriptText(WHISP9, me, player); break; - case 35: DoScriptText(WHISP10, me, player); break; - case 36: DoScriptText(WHISP11, me, player); break; - case 43: DoScriptText(WHISP12, me, player); break; - case 44: DoScriptText(WHISP13, me, player); break; - case 49: DoScriptText(WHISP14, me, player); break; - case 50: DoScriptText(WHISP15, me, player); break; - case 51: DoScriptText(WHISP16, me, player); break; - case 52: DoScriptText(WHISP17, me, player); break; - case 53: DoScriptText(WHISP18, me, player); break; - case 54: DoScriptText(WHISP19, me, player); break; - case 55: DoScriptText(WHISP20, me, player); break; - case 56: DoScriptText(WHISP21, me, player); - if (player) - player->GroupEventHappens(10211, me); + case 0: + DoScriptText(SAY1, me, player); + break; + case 4: + DoScriptText(WHISP1, me, player); + break; + case 6: + DoScriptText(WHISP2, me, player); + break; + case 7: + DoScriptText(WHISP3, me, player); + break; + case 8: + DoScriptText(WHISP4, me, player); + break; + case 17: + DoScriptText(WHISP5, me, player); + break; + case 18: + DoScriptText(WHISP6, me, player); + break; + case 19: + DoScriptText(WHISP7, me, player); + break; + case 33: + DoScriptText(WHISP8, me, player); + break; + case 34: + DoScriptText(WHISP9, me, player); + break; + case 35: + DoScriptText(WHISP10, me, player); + break; + case 36: + DoScriptText(WHISP11, me, player); + break; + case 43: + DoScriptText(WHISP12, me, player); + break; + case 44: + DoScriptText(WHISP13, me, player); + break; + case 49: + DoScriptText(WHISP14, me, player); + break; + case 50: + DoScriptText(WHISP15, me, player); + break; + case 51: + DoScriptText(WHISP16, me, player); + break; + case 52: + DoScriptText(WHISP17, me, player); + break; + case 53: + DoScriptText(WHISP18, me, player); + break; + case 54: + DoScriptText(WHISP19, me, player); + break; + case 55: + DoScriptText(WHISP20, me, player); + break; + case 56: + DoScriptText(WHISP21, me, player); + player->GroupEventHappens(10211, me); break; } } @@ -406,7 +443,7 @@ public: struct npc_dirty_larryAI : public ScriptedAI { - npc_dirty_larryAI(Creature* c) : ScriptedAI(c) {} + npc_dirty_larryAI(Creature* creature) : ScriptedAI(creature) {} bool Event; bool Attack; @@ -543,10 +580,10 @@ public: } }; - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { CAST_AI(npc_dirty_larry::npc_dirty_larryAI, creature->AI())->Event = true; CAST_AI(npc_dirty_larry::npc_dirty_larryAI, creature->AI())->PlayerGUID = player->GetGUID(); @@ -572,7 +609,6 @@ public: { return new npc_dirty_larryAI (creature); } - }; /*###### @@ -587,12 +623,12 @@ class npc_ishanah : public CreatureScript public: npc_ishanah() : CreatureScript("npc_ishanah") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) player->SEND_GOSSIP_MENU(9458, creature->GetGUID()); - else if (uiAction == GOSSIP_ACTION_INFO_DEF+2) + else if (action == GOSSIP_ACTION_INFO_DEF+2) player->SEND_GOSSIP_MENU(9459, creature->GetGUID()); return true; @@ -610,7 +646,6 @@ public: return true; } - }; /*###### @@ -629,10 +664,10 @@ class npc_khadgar : public CreatureScript public: npc_khadgar() : CreatureScript("npc_khadgar") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, KHADGAR_GOSSIP_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); @@ -678,7 +713,6 @@ public: return true; } - }; void AddSC_shattrath_city() diff --git a/src/server/scripts/Outland/terokkar_forest.cpp b/src/server/scripts/Outland/terokkar_forest.cpp index 043b74b6924..6c2214cde37 100644 --- a/src/server/scripts/Outland/terokkar_forest.cpp +++ b/src/server/scripts/Outland/terokkar_forest.cpp @@ -62,7 +62,7 @@ public: struct mob_unkor_the_ruthlessAI : public ScriptedAI { - mob_unkor_the_ruthlessAI(Creature* c) : ScriptedAI(c) {} + mob_unkor_the_ruthlessAI(Creature* creature) : ScriptedAI(creature) {} bool CanDoQuest; uint32 UnkorUnfriendly_Timer; @@ -99,12 +99,12 @@ public: { for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) { - Player* pGroupie = itr->getSource(); - if (pGroupie && - pGroupie->GetQuestStatus(QUEST_DONTKILLTHEFATONE) == QUEST_STATUS_INCOMPLETE && - pGroupie->GetReqKillOrCastCurrentCount(QUEST_DONTKILLTHEFATONE, 18260) == 10) + Player* groupie = itr->getSource(); + if (groupie && + groupie->GetQuestStatus(QUEST_DONTKILLTHEFATONE) == QUEST_STATUS_INCOMPLETE && + groupie->GetReqKillOrCastCurrentCount(QUEST_DONTKILLTHEFATONE, 18260) == 10) { - pGroupie->AreaExploredOrEventHappens(QUEST_DONTKILLTHEFATONE); + groupie->AreaExploredOrEventHappens(QUEST_DONTKILLTHEFATONE); if (!CanDoQuest) CanDoQuest = true; } @@ -150,7 +150,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*###### @@ -169,7 +168,7 @@ public: struct mob_infested_root_walkerAI : public ScriptedAI { - mob_infested_root_walkerAI(Creature* c) : ScriptedAI(c) {} + mob_infested_root_walkerAI(Creature* creature) : ScriptedAI(creature) {} void Reset() { } void EnterCombat(Unit* /*who*/) { } @@ -183,7 +182,6 @@ public: DoCast(me, 39130, true); } }; - }; /*###### @@ -202,15 +200,15 @@ public: struct npc_skywingAI : public npc_escortAI { public: - npc_skywingAI(Creature* c) : npc_escortAI(c) {} + npc_skywingAI(Creature* creature) : npc_escortAI(creature) {} - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); if (!player) return; - switch (i) + switch (waypointId) { case 8: player->AreaExploredOrEventHappens(10898); @@ -245,7 +243,6 @@ public: npc_escortAI::UpdateAI(diff); } }; - }; /*###### @@ -264,7 +261,7 @@ public: struct mob_rotting_forest_ragerAI : public ScriptedAI { - mob_rotting_forest_ragerAI(Creature* c) : ScriptedAI(c) {} + mob_rotting_forest_ragerAI(Creature* creature) : ScriptedAI(creature) {} void Reset() { } void EnterCombat(Unit* /*who*/) { } @@ -278,7 +275,6 @@ public: DoCast(me, 39134, true); } }; - }; /*###### @@ -304,34 +300,35 @@ public: struct mob_netherweb_victimAI : public ScriptedAI { - mob_netherweb_victimAI(Creature* c) : ScriptedAI(c) {} + mob_netherweb_victimAI(Creature* creature) : ScriptedAI(creature) {} void Reset() { } void EnterCombat(Unit* /*who*/) { } void MoveInLineOfSight(Unit* /*who*/) { } - void JustDied(Unit* Killer) + void JustDied(Unit* killer) { - if (Killer->GetTypeId() == TYPEID_PLAYER) + Player* player = killer->ToPlayer(); + if (!player) + return; + + if (player->GetQuestStatus(10873) == QUEST_STATUS_INCOMPLETE) { - if (CAST_PLR(Killer)->GetQuestStatus(10873) == QUEST_STATUS_INCOMPLETE) + if (rand()%100 < 25) { - if (rand()%100 < 25) - { - me->SummonCreature(QUEST_TARGET, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); - CAST_PLR(Killer)->KilledMonsterCredit(QUEST_TARGET, 0); - } - else - me->SummonCreature(netherwebVictims[rand()%6], 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + me->SummonCreature(QUEST_TARGET, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + player->KilledMonsterCredit(QUEST_TARGET, 0); + } + else + me->SummonCreature(netherwebVictims[rand()%6], 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); - if (rand()%100 < 75) - me->SummonCreature(netherwebVictims[rand()%6], 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + if (rand()%100 < 75) me->SummonCreature(netherwebVictims[rand()%6], 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); - } + + me->SummonCreature(netherwebVictims[rand()%6], 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); } } }; - }; /*###### @@ -358,15 +355,15 @@ class npc_floon : public CreatureScript public: npc_floon() : CreatureScript("npc_floon") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF) + if (action == GOSSIP_ACTION_INFO_DEF) { player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FLOON2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); player->SEND_GOSSIP_MENU(9443, creature->GetGUID()); } - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { player->CLOSE_GOSSIP_MENU(); creature->setFaction(FACTION_HOSTILE_FL); @@ -392,9 +389,9 @@ public: struct npc_floonAI : public ScriptedAI { - npc_floonAI(Creature* c) : ScriptedAI(c) + npc_floonAI(Creature* creature) : ScriptedAI(creature) { - m_uiNormFaction = c->getFaction(); + m_uiNormFaction = creature->getFaction(); } uint32 m_uiNormFaction; @@ -439,7 +436,6 @@ public: DoMeleeAttackIfReady(); } }; - }; /*###### @@ -465,39 +461,44 @@ public: struct npc_isla_starmaneAI : public npc_escortAI { - npc_isla_starmaneAI(Creature* c) : npc_escortAI(c) {} + npc_isla_starmaneAI(Creature* creature) : npc_escortAI(creature) {} - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - switch (i) + switch (waypointId) { - case 0: - { - GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 10); - if (Cage) - Cage->SetGoState(GO_STATE_ACTIVE); - } - break; - case 2: DoScriptText(SAY_PROGRESS_1, me, player); break; - case 5: DoScriptText(SAY_PROGRESS_2, me, player); break; - case 6: DoScriptText(SAY_PROGRESS_3, me, player); break; - case 29:DoScriptText(SAY_PROGRESS_4, me, player); - if (player) - { + case 0: + if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 10)) + Cage->SetGoState(GO_STATE_ACTIVE); + break; + case 2: + DoScriptText(SAY_PROGRESS_1, me, player); + break; + case 5: + DoScriptText(SAY_PROGRESS_2, me, player); + break; + case 6: + DoScriptText(SAY_PROGRESS_3, me, player); + break; + case 29: + DoScriptText(SAY_PROGRESS_4, me, player); if (player->GetTeam() == ALLIANCE) player->GroupEventHappens(QUEST_EFTW_A, me); else if (player->GetTeam() == HORDE) player->GroupEventHappens(QUEST_EFTW_H, me); - } - me->SetInFront(player); break; - case 30: me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); break; - case 31: DoCast(me, SPELL_CAT); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); break; + me->SetInFront(player); + break; + case 30: + me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); + break; + case 31: + DoCast(me, SPELL_CAT); + me->SetWalk(false); + break; } } @@ -532,7 +533,6 @@ public: { return new npc_isla_starmaneAI(creature); } - }; /*###### @@ -548,12 +548,12 @@ class go_skull_pile : public GameObjectScript public: go_skull_pile() : GameObjectScript("go_skull_pile") { } - bool OnGossipSelect(Player* player, GameObject* go, uint32 uiSender, uint32 uiAction) + bool OnGossipSelect(Player* player, GameObject* go, uint32 sender, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiSender) + switch (sender) { - case GOSSIP_SENDER_MAIN: SendActionMenu(player, go, uiAction); break; + case GOSSIP_SENDER_MAIN: SendActionMenu(player, go, action); break; } return true; } @@ -572,9 +572,9 @@ public: return true; } - void SendActionMenu(Player* player, GameObject* /*go*/, uint32 uiAction) + void SendActionMenu(Player* player, GameObject* /*go*/, uint32 action) { - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: player->CastSpell(player, 40642, false); @@ -606,10 +606,10 @@ class npc_slim : public CreatureScript public: npc_slim() : CreatureScript("npc_slim") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_TRADE) + if (action == GOSSIP_ACTION_TRADE) player->GetSession()->SendListInventory(creature->GetGUID()); return true; @@ -627,7 +627,6 @@ public: return true; } - }; /*######## @@ -667,23 +666,22 @@ public: struct npc_akunoAI : public npc_escortAI { - npc_akunoAI(Creature* c) : npc_escortAI(c) {} + npc_akunoAI(Creature* creature) : npc_escortAI(creature) {} - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - switch (i) + switch (waypointId) { case 3: me->SummonCreature(NPC_CABAL_SKRIMISHER, -2795.99f, 5420.33f, -34.53f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); me->SummonCreature(NPC_CABAL_SKRIMISHER, -2793.55f, 5412.79f, -34.53f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); break; case 11: - if (player && player->GetTypeId() == TYPEID_PLAYER) + if (player->GetTypeId() == TYPEID_PLAYER) player->GroupEventHappens(QUEST_ESCAPING_THE_TOMB, me); break; } @@ -694,7 +692,6 @@ public: summon->AI()->AttackStart(me); } }; - }; void AddSC_terokkar_forest() diff --git a/src/server/scripts/Outland/zangarmarsh.cpp b/src/server/scripts/Outland/zangarmarsh.cpp index fc7a3f4d667..90ce070ecc7 100644 --- a/src/server/scripts/Outland/zangarmarsh.cpp +++ b/src/server/scripts/Outland/zangarmarsh.cpp @@ -56,6 +56,7 @@ public: { if (creature->GetEntry() == 17900) player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BLESS_ASH, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + if (creature->GetEntry() == 17901) player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BLESS_KEL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); } @@ -64,10 +65,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + if (action == GOSSIP_ACTION_INFO_DEF+1) { creature->setPowerType(POWER_MANA); creature->SetMaxPower(POWER_MANA, 200); //set a "fake" mana value, we can't depend on database doing it in this case @@ -149,9 +150,9 @@ public: struct npc_cooshcooshAI : public ScriptedAI { - npc_cooshcooshAI(Creature* c) : ScriptedAI(c) + npc_cooshcooshAI(Creature* creature) : ScriptedAI(creature) { - m_uiNormFaction = c->getFaction(); + m_uiNormFaction = creature->getFaction(); } uint32 m_uiNormFaction; @@ -195,10 +196,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF) + if (action == GOSSIP_ACTION_INFO_DEF) { player->CLOSE_GOSSIP_MENU(); creature->setFaction(FACTION_HOSTILE_CO); @@ -231,10 +232,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KUR2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); @@ -284,10 +285,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_TRADE) + if (action == GOSSIP_ACTION_TRADE) player->GetSession()->SendListInventory(creature->GetGUID()); return true; } @@ -317,18 +318,17 @@ public: struct npc_kayra_longmaneAI : public npc_escortAI { - npc_kayra_longmaneAI(Creature* c) : npc_escortAI(c) {} + npc_kayra_longmaneAI(Creature* creature) : npc_escortAI(creature) {} void Reset() { } - void WaypointReached(uint32 i) + void WaypointReached(uint32 waypointId) { Player* player = GetPlayerForEscort(); - if (!player) return; - switch (i) + switch (waypointId) { case 4: DoScriptText(SAY_AMBUSH1, me, player); @@ -404,10 +404,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF+1: player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_TIMOTHY_DANIELS1, creature->GetGUID()); diff --git a/src/server/scripts/Spells/CMakeLists.txt b/src/server/scripts/Spells/CMakeLists.txt index 496324e4de9..04dcee9287c 100644 --- a/src/server/scripts/Spells/CMakeLists.txt +++ b/src/server/scripts/Spells/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2011 TrinityCore +# Copyright (C) 2008-2012 TrinityCore # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index eb42b377128..36dcb53ad00 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -337,11 +337,11 @@ class spell_dk_death_pact : public SpellScriptLoader void FilterTargets(std::list& unitList) { Unit* unit_to_add = NULL; - for (std::list::iterator itr = unitList.begin() ; itr != unitList.end(); ++itr) + for (std::list::iterator itr = unitList.begin(); itr != unitList.end(); ++itr) { if ((*itr)->GetTypeId() == TYPEID_UNIT && (*itr)->GetOwnerGUID() == GetCaster()->GetGUID() - && (*itr)->ToCreature()->GetCreatureInfo()->type == CREATURE_TYPE_UNDEAD) + && (*itr)->ToCreature()->GetCreatureTemplate()->type == CREATURE_TYPE_UNDEAD) { unit_to_add = (*itr); break; @@ -642,9 +642,7 @@ public: void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - Unit* target = GetTarget(); - if (target->HasAura(DK_SPELL_UNHOLY_PRESENCE)) - target->RemoveAura(DK_SPELL_IMPROVED_UNHOLY_PRESENCE_TRIGGERED); + GetTarget()->RemoveAura(DK_SPELL_IMPROVED_UNHOLY_PRESENCE_TRIGGERED); } void Register() @@ -713,6 +711,7 @@ enum DeathCoil { SPELL_DEATH_COIL_DAMAGE = 47632, SPELL_DEATH_COIL_HEAL = 47633, + SPELL_SIGIL_VENGEFUL_HEART = 64962, }; class spell_dk_death_coil : public SpellScriptLoader @@ -743,12 +742,34 @@ class spell_dk_death_coil : public SpellScriptLoader caster->CastCustomSpell(target, SPELL_DEATH_COIL_HEAL, &bp, NULL, NULL, true); } else + { + if (AuraEffect const* auraEffect = caster->GetAuraEffect(SPELL_SIGIL_VENGEFUL_HEART, EFFECT_1)) + damage += auraEffect->GetBaseAmount(); caster->CastCustomSpell(target, SPELL_DEATH_COIL_DAMAGE, &damage, NULL, NULL, true); + } } } + SpellCastResult CheckCast() + { + Unit* caster = GetCaster(); + if (Unit* target = GetExplTargetUnit()) + { + if (!caster->IsFriendlyTo(target) && !caster->isInFront(target)) + return SPELL_FAILED_UNIT_NOT_INFRONT; + + if (target->IsFriendlyTo(caster) && target->GetCreatureType() != CREATURE_TYPE_UNDEAD) + return SPELL_FAILED_BAD_TARGETS; + } + else + return SPELL_FAILED_BAD_TARGETS; + + return SPELL_CAST_OK; + } + void Register() { + OnCheckCast += SpellCheckCastFn(spell_dk_death_coil_SpellScript::CheckCast); OnEffectHitTarget += SpellEffectFn(spell_dk_death_coil_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } @@ -769,16 +790,14 @@ class spell_dk_death_grip : public SpellScriptLoader { PrepareSpellScript(spell_dk_death_grip_SpellScript); - void HandleDummy(SpellEffIndex effIndex) + void HandleDummy(SpellEffIndex /*effIndex*/) { int32 damage = GetEffectValue(); - Position pos; + Position const* pos = GetExplTargetDest(); if (Unit* target = GetHitUnit()) { - GetSummonPosition(effIndex, pos, 0.0f, 0); - if (!target->HasAuraType(SPELL_AURA_DEFLECT_SPELLS)) // Deterrence - target->CastSpell(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), damage, true); + target->CastSpell(pos->GetPositionX(), pos->GetPositionY(), pos->GetPositionZ(), damage, true); } } diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index 4c440f18bd9..898350dbd71 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -237,7 +237,7 @@ class spell_dru_t10_restoration_4p_bonus : public SpellScriptLoader } else { - unitList.remove(GetTargetUnit()); + unitList.remove(GetExplTargetUnit()); std::list tempTargets; for (std::list::const_iterator itr = unitList.begin(); itr != unitList.end(); ++itr) if ((*itr)->GetTypeId() == TYPEID_PLAYER && GetCaster()->IsInRaidWith(*itr)) @@ -250,7 +250,7 @@ class spell_dru_t10_restoration_4p_bonus : public SpellScriptLoader return; } - Unit* target = SelectRandomContainerElement(tempTargets); + Unit* target = Trinity::Containers::SelectRandomContainerElement(tempTargets); unitList.clear(); unitList.push_back(target); } @@ -279,7 +279,7 @@ class spell_dru_starfall_aoe : public SpellScriptLoader void FilterTargets(std::list& unitList) { - unitList.remove(GetTargetUnit()); + unitList.remove(GetExplTargetUnit()); } void Register() diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 886384a1c68..0c879cfb029 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -169,7 +169,7 @@ class spell_gen_burn_brutallus : public SpellScriptLoader } }; -enum eCannibalizeSpells +enum CannibalizeSpells { SPELL_CANNIBALIZE_TRIGGERED = 20578, }; @@ -224,7 +224,7 @@ class spell_gen_cannibalize : public SpellScriptLoader }; // 45472 Parachute -enum eParachuteSpells +enum ParachuteSpells { SPELL_PARACHUTE = 45472, SPELL_PARACHUTE_BUFF = 44795, @@ -365,7 +365,7 @@ class spell_gen_remove_flight_auras : public SpellScriptLoader }; // 66118 Leeching Swarm -enum eLeechingSwarmSpells +enum LeechingSwarmSpells { SPELL_LEECHING_SWARM_DMG = 66240, SPELL_LEECHING_SWARM_HEAL = 66125, @@ -481,7 +481,7 @@ class spell_gen_elune_candle : public SpellScriptLoader }; // 24750 Trick -enum eTrickSpells +enum TrickSpells { SPELL_PIRATE_COSTUME_MALE = 24708, SPELL_PIRATE_COSTUME_FEMALE = 24709, @@ -557,7 +557,7 @@ class spell_gen_trick : public SpellScriptLoader }; // 24751 Trick or Treat -enum eTrickOrTreatSpells +enum TrickOrTreatSpells { SPELL_TRICK = 24714, SPELL_TREAT = 24715, @@ -1234,30 +1234,30 @@ class spell_gen_magic_rooster : public SpellScriptLoader class spell_gen_allow_cast_from_item_only : public SpellScriptLoader { -public: - spell_gen_allow_cast_from_item_only() : SpellScriptLoader("spell_gen_allow_cast_from_item_only") { } - - class spell_gen_allow_cast_from_item_only_SpellScript : public SpellScript - { - PrepareSpellScript(spell_gen_allow_cast_from_item_only_SpellScript); + public: + spell_gen_allow_cast_from_item_only() : SpellScriptLoader("spell_gen_allow_cast_from_item_only") { } - SpellCastResult CheckRequirement() + class spell_gen_allow_cast_from_item_only_SpellScript : public SpellScript { - if (!GetCastItem()) - return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; - return SPELL_CAST_OK; - } + PrepareSpellScript(spell_gen_allow_cast_from_item_only_SpellScript); - void Register() + SpellCastResult CheckRequirement() + { + if (!GetCastItem()) + return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; + return SPELL_CAST_OK; + } + + void Register() + { + OnCheckCast += SpellCheckCastFn(spell_gen_allow_cast_from_item_only_SpellScript::CheckRequirement); + } + }; + + SpellScript* GetSpellScript() const { - OnCheckCast += SpellCheckCastFn(spell_gen_allow_cast_from_item_only_SpellScript::CheckRequirement); + return new spell_gen_allow_cast_from_item_only_SpellScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_gen_allow_cast_from_item_only_SpellScript(); - } }; enum Launch @@ -1282,7 +1282,7 @@ class spell_gen_launch : public SpellScriptLoader void Launch() { - WorldLocation const* const position = GetTargetDest(); + WorldLocation const* const position = GetExplTargetDest(); if (Player* player = GetHitPlayer()) { @@ -1312,6 +1312,11 @@ class spell_gen_launch : public SpellScriptLoader } }; +enum VehicleScaling +{ + SPELL_GEAR_SCALING = 66668, +}; + class spell_gen_vehicle_scaling : public SpellScriptLoader { public: @@ -1323,7 +1328,7 @@ class spell_gen_vehicle_scaling : public SpellScriptLoader bool Load() { - return GetCaster()->GetTypeId() == TYPEID_PLAYER; + return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER; } void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) @@ -1335,7 +1340,7 @@ class spell_gen_vehicle_scaling : public SpellScriptLoader // TODO: Reserach coeffs for different vehicles switch (GetId()) { - case 66668: + case SPELL_GEAR_SCALING: factor = 1.0f; baseItemLevel = 205; break; @@ -1508,7 +1513,7 @@ class spell_gen_luck_of_the_draw : public SpellScriptLoader if (group->isLFGGroup()) if (uint32 dungeonId = sLFGMgr->GetDungeon(group->GetGUID(), true)) if (LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(dungeonId)) - if (uint32(dungeon->map) == map->GetId() && dungeon->difficulty == map->GetDifficulty()) + if (uint32(dungeon->map) == map->GetId() && dungeon->difficulty == uint32(map->GetDifficulty())) if (randomDungeon && randomDungeon->type == LFG_TYPE_RANDOM) return; // in correct dungeon @@ -1585,19 +1590,17 @@ class spell_gen_spirit_healer_res : public SpellScriptLoader bool Load() { - return GetOriginalCaster()->GetTypeId() == TYPEID_PLAYER; + return GetOriginalCaster() && GetOriginalCaster()->GetTypeId() == TYPEID_PLAYER; } void HandleDummy(SpellEffIndex /* effIndex */) { - if (Player* originalCaster = GetOriginalCaster()->ToPlayer()) + Player* originalCaster = GetOriginalCaster()->ToPlayer(); + if (Unit* target = GetHitUnit()) { - if (Unit* target = GetHitUnit()) - { - WorldPacket data(SMSG_SPIRIT_HEALER_CONFIRM, 8); - data << uint64(target->GetGUID()); - originalCaster->GetSession()->SendPacket(&data); - } + WorldPacket data(SMSG_SPIRIT_HEALER_CONFIRM, 8); + data << uint64(target->GetGUID()); + originalCaster->GetSession()->SendPacket(&data); } } @@ -2550,6 +2553,141 @@ class spell_gen_chaos_blast : public SpellScriptLoader }; +class spell_gen_ds_flush_knockback : public SpellScriptLoader +{ + public: + spell_gen_ds_flush_knockback() : SpellScriptLoader("spell_gen_ds_flush_knockback") {} + + class spell_gen_ds_flush_knockback_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_ds_flush_knockback_SpellScript); + + void HandleScript(SpellEffIndex /*effIndex*/) + { + // Here the target is the water spout and determines the position where the player is knocked from + if (Unit* target = GetHitUnit()) + { + if (Player* player = GetCaster()->ToPlayer()) + { + float horizontalSpeed = 20.0f + (40.0f - GetCaster()->GetDistance(target)); + float verticalSpeed = 8.0f; + // This method relies on the Dalaran Sewer map disposition and Water Spout position + // What we do is knock the player from a position exactly behind him and at the end of the pipe + player->KnockbackFrom(target->GetPositionX(), player->GetPositionY(), horizontalSpeed, verticalSpeed); + } + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_gen_ds_flush_knockback_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_gen_ds_flush_knockback_SpellScript(); + } +}; + +class spell_gen_wg_water : public SpellScriptLoader +{ + public: + spell_gen_wg_water() : SpellScriptLoader("spell_gen_wg_water") {} + + class spell_gen_wg_water_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_wg_water_SpellScript); + + SpellCastResult CheckCast() + { + if (!GetSpellInfo()->CheckTargetCreatureType(GetCaster())) + return SPELL_FAILED_DONT_REPORT; + return SPELL_CAST_OK; + } + + void Register() + { + OnCheckCast += SpellCheckCastFn(spell_gen_wg_water_SpellScript::CheckCast); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_gen_wg_water_SpellScript(); + } +}; + +class spell_gen_count_pct_from_max_hp : public SpellScriptLoader +{ + public: + spell_gen_count_pct_from_max_hp(char const* name, int32 damagePct = 0) : SpellScriptLoader(name), _damagePct(damagePct) { } + + class spell_gen_count_pct_from_max_hp_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_count_pct_from_max_hp_SpellScript) + + public: + spell_gen_count_pct_from_max_hp_SpellScript(int32 damagePct) : SpellScript(), _damagePct(damagePct) { } + + void RecalculateDamage() + { + if (!_damagePct) + _damagePct = GetHitDamage(); + + SetHitDamage(GetHitUnit()->CountPctFromMaxHealth(_damagePct)); + } + + void Register() + { + OnHit += SpellHitFn(spell_gen_count_pct_from_max_hp_SpellScript::RecalculateDamage); + } + + private: + int32 _damagePct; + }; + + SpellScript* GetSpellScript() const + { + return new spell_gen_count_pct_from_max_hp_SpellScript(_damagePct); + } + + private: + int32 _damagePct; +}; + +class spell_gen_despawn_self : public SpellScriptLoader +{ +public: + spell_gen_despawn_self() : SpellScriptLoader("spell_gen_despawn_self") { } + + class spell_gen_despawn_self_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_despawn_self_SpellScript); + + bool Load() + { + return GetCaster()->GetTypeId() == TYPEID_UNIT; + } + + void HandleDummy(SpellEffIndex effIndex) + { + if (GetSpellInfo()->Effects[effIndex].Effect == SPELL_EFFECT_DUMMY || GetSpellInfo()->Effects[effIndex].Effect == SPELL_EFFECT_SCRIPT_EFFECT) + GetCaster()->ToCreature()->DespawnOrUnsummon(); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_gen_despawn_self_SpellScript::HandleDummy, EFFECT_ALL, SPELL_EFFECT_ANY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_gen_despawn_self_SpellScript(); + } +}; + void AddSC_generic_spell_scripts() { new spell_gen_absorb0_hitlimit1(); @@ -2599,4 +2737,9 @@ void AddSC_generic_spell_scripts() new spell_gen_on_tournament_mount(); new spell_gen_tournament_pennant(); new spell_gen_chaos_blast(); + new spell_gen_ds_flush_knockback(); + new spell_gen_wg_water(); + new spell_gen_count_pct_from_max_hp("spell_gen_default_count_pct_from_max_hp"); + new spell_gen_count_pct_from_max_hp("spell_gen_50pct_count_pct_from_max_hp", 50); + new spell_gen_despawn_self(); } diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index 855af75cd83..896ed331bde 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -137,8 +137,9 @@ class spell_hun_chimera_shot : public SpellScriptLoader { int32 TickCount = aurEff->GetTotalTicks(); spellId = HUNTER_SPELL_CHIMERA_SHOT_SERPENT; - basePoint = caster->SpellDamageBonus(unitTarget, aura->GetSpellInfo(), aurEff->GetAmount(), DOT, aura->GetStackAmount()); + basePoint = caster->SpellDamageBonusDone(unitTarget, aura->GetSpellInfo(), aurEff->GetAmount(), DOT, aura->GetStackAmount()); ApplyPctN(basePoint, TickCount * 40); + basePoint = unitTarget->SpellDamageBonusTaken(caster, aura->GetSpellInfo(), basePoint, DOT, aura->GetStackAmount()); } // Viper Sting - Instantly restores mana to you equal to 60% of the total amount drained by your Viper Sting. else if (familyFlag[1] & 0x00000080) @@ -286,8 +287,8 @@ class spell_hun_masters_call : public SpellScriptLoader target->CastSpell(target, HUNTER_SPELL_MASTERS_CALL_TRIGGERED, castMask); // there is a possibility that this effect should access effect 0 (dummy) target, but i dubt that // it's more likely that on on retail it's possible to call target selector based on dbc values - // anyways, we're using GetTargetUnit() here and it's ok - if (Unit* ally = GetTargetUnit()) + // anyways, we're using GetExplTargetUnit() here and it's ok + if (Unit* ally = GetExplTargetUnit()) { target->CastSpell(ally, GetEffectValue(), castMask); target->CastSpell(ally, GetSpellInfo()->Effects[EFFECT_0].CalcValue(), castMask); @@ -560,6 +561,64 @@ class spell_hun_pet_carrion_feeder : public SpellScriptLoader } }; +// 34477 Misdirection +class spell_hun_misdirection : public SpellScriptLoader +{ + public: + spell_hun_misdirection() : SpellScriptLoader("spell_hun_misdirection") { } + + class spell_hun_misdirection_AuraScript : public AuraScript + { + PrepareAuraScript(spell_hun_misdirection_AuraScript); + + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Unit* caster = GetCaster()) + if (!GetDuration()) + caster->SetReducedThreatPercent(0, 0); + } + + void Register() + { + AfterEffectRemove += AuraEffectRemoveFn(spell_hun_misdirection_AuraScript::OnRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_hun_misdirection_AuraScript(); + } +}; + +// 35079 Misdirection proc +class spell_hun_misdirection_proc : public SpellScriptLoader +{ + public: + spell_hun_misdirection_proc() : SpellScriptLoader("spell_hun_misdirection_proc") { } + + class spell_hun_misdirection_proc_AuraScript : public AuraScript + { + PrepareAuraScript(spell_hun_misdirection_proc_AuraScript); + + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (GetCaster()) + GetCaster()->SetReducedThreatPercent(0, 0); + } + + void Register() + { + AfterEffectRemove += AuraEffectRemoveFn(spell_hun_misdirection_proc_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_hun_misdirection_proc_AuraScript(); + } +}; + + void AddSC_hunter_spell_scripts() { new spell_hun_aspect_of_the_beast(); @@ -572,4 +631,6 @@ void AddSC_hunter_spell_scripts() new spell_hun_sniper_training(); new spell_hun_pet_heart_of_the_phoenix(); new spell_hun_pet_carrion_feeder(); + new spell_hun_misdirection(); + new spell_hun_misdirection_proc(); } diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 416869d98ce..4e2eb633662 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -55,8 +55,8 @@ class spell_item_trigger_spell : public SpellScriptLoader void HandleDummy(SpellEffIndex /*effIndex*/) { Unit* caster = GetCaster(); - if (Item* pItem = GetCastItem()) - caster->CastSpell(caster, _triggeredSpellId, true, pItem); + if (Item* item = GetCastItem()) + caster->CastSpell(caster, _triggeredSpellId, true, item); } void Register() @@ -1095,7 +1095,7 @@ class spell_item_shimmering_vessel : public SpellScriptLoader void HandleDummy(SpellEffIndex /* effIndex */) { if (Creature* target = GetHitCreature()) - target->setDeathState(JUST_ALIVED); + target->setDeathState(JUST_RESPAWNED); } void Register() @@ -1513,7 +1513,7 @@ class spell_item_complete_raptor_capture : public SpellScriptLoader enum ImpaleLeviroth { NPC_LEVIROTH = 26452, - SPELL_LEVIROTH_SELF_IMPALE = 49882 + SPELL_LEVIROTH_SELF_IMPALE = 49882, }; class spell_item_impale_leviroth : public SpellScriptLoader @@ -1534,11 +1534,9 @@ class spell_item_impale_leviroth : public SpellScriptLoader void HandleDummy(SpellEffIndex /* effIndex */) { - Unit* target = GetHitCreature(); - if (!target || target->GetEntry() != NPC_LEVIROTH || !target->HealthBelowPct(95)) - return; - - target->CastSpell(target, SPELL_LEVIROTH_SELF_IMPALE, true); + if (Unit* target = GetHitCreature()) + if (target->GetEntry() == NPC_LEVIROTH && !target->HealthBelowPct(95)) + target->CastSpell(target, SPELL_LEVIROTH_SELF_IMPALE, true); } void Register() @@ -1591,15 +1589,15 @@ class spell_item_brewfest_mount_transformation : public SpellScriptLoader { case SPELL_BREWFEST_MOUNT_TRANSFORM: if (caster->GetSpeedRate(MOVE_RUN) >= 2.0f) - spell_id = caster->GetTeam() == ALLIANCE ? SPELL_MOUNT_RAM_100 : SPELL_MOUNT_KODO_100 ; + spell_id = caster->GetTeam() == ALLIANCE ? SPELL_MOUNT_RAM_100 : SPELL_MOUNT_KODO_100; else - spell_id = caster->GetTeam() == ALLIANCE ? SPELL_MOUNT_RAM_60 : SPELL_MOUNT_KODO_60 ; + spell_id = caster->GetTeam() == ALLIANCE ? SPELL_MOUNT_RAM_60 : SPELL_MOUNT_KODO_60; break; case SPELL_BREWFEST_MOUNT_TRANSFORM_REVERSE: if (caster->GetSpeedRate(MOVE_RUN) >= 2.0f) - spell_id = caster->GetTeam() == HORDE ? SPELL_MOUNT_RAM_100 : SPELL_MOUNT_KODO_100 ; + spell_id = caster->GetTeam() == HORDE ? SPELL_MOUNT_RAM_100 : SPELL_MOUNT_KODO_100; else - spell_id = caster->GetTeam() == HORDE ? SPELL_MOUNT_RAM_60 : SPELL_MOUNT_KODO_60 ; + spell_id = caster->GetTeam() == HORDE ? SPELL_MOUNT_RAM_60 : SPELL_MOUNT_KODO_60; break; default: return; @@ -1746,11 +1744,20 @@ class spell_item_rocket_boots : public SpellScriptLoader if (Battleground* bg = caster->GetBattleground()) bg->EventPlayerDroppedFlag(caster); + caster->RemoveSpellCooldown(SPELL_ROCKET_BOOTS_PROC); caster->CastSpell(caster, SPELL_ROCKET_BOOTS_PROC, true, NULL); } + SpellCastResult CheckCast() + { + if (GetCaster()->IsInWater()) + return SPELL_FAILED_ONLY_ABOVEWATER; + return SPELL_CAST_OK; + } + void Register() { + OnCheckCast += SpellCheckCastFn(spell_item_rocket_boots_SpellScript::CheckCast); OnEffectHitTarget += SpellEffectFn(spell_item_rocket_boots_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; @@ -1994,6 +2001,65 @@ class spell_item_refocus : public SpellScriptLoader } }; +class spell_item_muisek_vessel : public SpellScriptLoader +{ + public: + spell_item_muisek_vessel() : SpellScriptLoader("spell_item_muisek_vessel") { } + + class spell_item_muisek_vessel_SpellScript : public SpellScript + { + PrepareSpellScript(spell_item_muisek_vessel_SpellScript); + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + if (Creature* target = GetHitCreature()) + if (target->isDead()) + target->DespawnOrUnsummon(); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_item_muisek_vessel_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_item_muisek_vessel_SpellScript(); + } +}; + +enum GreatmothersSoulcather +{ + SPELL_FORCE_CAST_SUMMON_GNOME_SOUL = 46486, +}; +class spell_item_greatmothers_soulcatcher : public SpellScriptLoader +{ +public: + spell_item_greatmothers_soulcatcher() : SpellScriptLoader("spell_item_greatmothers_soulcatcher") { } + + class spell_item_greatmothers_soulcatcher_SpellScript : public SpellScript + { + PrepareSpellScript(spell_item_greatmothers_soulcatcher_SpellScript); + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + if (GetHitUnit()) + GetCaster()->CastSpell(GetCaster(),SPELL_FORCE_CAST_SUMMON_GNOME_SOUL); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_item_greatmothers_soulcatcher_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_item_greatmothers_soulcatcher_SpellScript(); + } +}; + void AddSC_item_spell_scripts() { // 23074 Arcanite Dragonling @@ -2045,4 +2111,6 @@ void AddSC_item_spell_scripts() new spell_item_unusual_compass(); new spell_item_uded(); new spell_item_chicken_cover(); + new spell_item_muisek_vessel(); + new spell_item_greatmothers_soulcatcher(); } diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index ea1af10816b..050741ffaba 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -123,6 +123,12 @@ class spell_mage_cold_snap : public SpellScriptLoader } }; +enum SilvermoonPolymorph +{ + NPC_AUROSALIA = 18744, +}; + +// TODO: move out of here and rename - not a mage spell class spell_mage_polymorph_cast_visual : public SpellScriptLoader { public: @@ -132,22 +138,22 @@ class spell_mage_polymorph_cast_visual : public SpellScriptLoader { PrepareSpellScript(spell_mage_polymorph_cast_visual_SpellScript); - static const uint32 spell_list[6]; + static const uint32 PolymorhForms[6]; bool Validate(SpellInfo const* /*spellEntry*/) { // check if spell ids exist in dbc - for (int i = 0; i < 6; i++) - if (!sSpellMgr->GetSpellInfo(spell_list[i])) + for (uint32 i = 0; i < 6; i++) + if (!sSpellMgr->GetSpellInfo(PolymorhForms[i])) return false; return true; } void HandleDummy(SpellEffIndex /*effIndex*/) { - if (Unit* unitTarget = GetHitUnit()) - if (unitTarget->GetTypeId() == TYPEID_UNIT) - unitTarget->CastSpell(unitTarget, spell_list[urand(0, 5)], true); + if (Unit* target = GetCaster()->FindNearestCreature(NPC_AUROSALIA, 30.0f)) + if (target->GetTypeId() == TYPEID_UNIT) + target->CastSpell(target, PolymorhForms[urand(0, 5)], true); } void Register() @@ -163,7 +169,7 @@ class spell_mage_polymorph_cast_visual : public SpellScriptLoader } }; -const uint32 spell_mage_polymorph_cast_visual::spell_mage_polymorph_cast_visual_SpellScript::spell_list[6] = +const uint32 spell_mage_polymorph_cast_visual::spell_mage_polymorph_cast_visual_SpellScript::PolymorhForms[6] = { SPELL_MAGE_SQUIRREL_FORM, SPELL_MAGE_GIRAFFE_FORM, @@ -244,9 +250,11 @@ class spell_mage_frost_warding_trigger : public SpellScriptLoader if (roll_chance_i(chance)) { - absorbAmount = dmgInfo.GetDamage(); - int32 bp = absorbAmount; + int32 bp = dmgInfo.GetDamage(); + dmgInfo.AbsorbDamage(bp); target->CastCustomSpell(target, SPELL_MAGE_FROST_WARDING_TRIGGERED, &bp, NULL, NULL, true, NULL, aurEff); + absorbAmount = 0; + PreventDefaultAction(); } } } diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index d823c629d4b..4baa1eb3735 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -285,9 +285,29 @@ class spell_pal_holy_shock : public SpellScriptLoader } } + SpellCastResult CheckCast() + { + Player* caster = GetCaster()->ToPlayer(); + if (Unit* target = GetExplTargetUnit()) + { + if (!caster->IsFriendlyTo(target)) + { + if (!caster->IsValidAttackTarget(target)) + return SPELL_FAILED_BAD_TARGETS; + + if (!caster->isInFront(target)) + return SPELL_FAILED_UNIT_NOT_INFRONT; + } + } + else + return SPELL_FAILED_BAD_TARGETS; + return SPELL_CAST_OK; + } + void Register() { // add dummy effect spell handler to Holy Shock + OnCheckCast += SpellCheckCastFn(spell_pal_holy_shock_SpellScript::CheckCast); OnEffectHitTarget += SpellEffectFn(spell_pal_holy_shock_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index b012fe5f183..8088004c9d1 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -185,6 +185,11 @@ class spell_pri_penance : public SpellScriptLoader { PrepareSpellScript(spell_pri_penance_SpellScript); + bool Load() + { + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } + bool Validate(SpellInfo const* spellEntry) { if (!sSpellMgr->GetSpellInfo(PRIEST_SPELL_PENANCE_R1)) @@ -207,7 +212,7 @@ class spell_pri_penance : public SpellScriptLoader Unit* caster = GetCaster(); if (Unit* unitTarget = GetHitUnit()) { - if(!unitTarget->isAlive()) + if (!unitTarget->isAlive()) return; uint8 rank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id); @@ -219,10 +224,20 @@ class spell_pri_penance : public SpellScriptLoader } } + SpellCastResult CheckCast() + { + Player* caster = GetCaster()->ToPlayer(); + if (Unit* target = GetExplTargetUnit()) + if (!caster->IsFriendlyTo(target) && !caster->IsValidAttackTarget(target)) + return SPELL_FAILED_BAD_TARGETS; + return SPELL_CAST_OK; + } + void Register() { // add dummy effect spell handler to Penance OnEffectHitTarget += SpellEffectFn(spell_pri_penance_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + OnCheckCast += SpellCheckCastFn(spell_pri_penance_SpellScript::CheckCast); } }; @@ -275,12 +290,53 @@ class spell_pri_reflective_shield_trigger : public SpellScriptLoader } }; +enum PrayerOfMending +{ + SPELL_T9_HEALING_2_PIECE = 67201, +}; +// Prayer of Mending Heal +class spell_pri_prayer_of_mending_heal : public SpellScriptLoader +{ +public: + spell_pri_prayer_of_mending_heal() : SpellScriptLoader("spell_pri_prayer_of_mending_heal") { } + + class spell_pri_prayer_of_mending_heal_SpellScript : public SpellScript + { + PrepareSpellScript(spell_pri_prayer_of_mending_heal_SpellScript); + + void HandleHeal(SpellEffIndex /*effIndex*/) + { + if (Unit* caster = GetOriginalCaster()) + { + if (AuraEffect* aurEff = caster->GetAuraEffect(SPELL_T9_HEALING_2_PIECE,EFFECT_0)) + { + int32 heal = GetHitHeal(); + AddPctN(heal, aurEff->GetAmount()); + SetHitHeal(heal); + } + } + + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_pri_prayer_of_mending_heal_SpellScript::HandleHeal, EFFECT_0, SPELL_EFFECT_HEAL); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_pri_prayer_of_mending_heal_SpellScript(); + } +}; + void AddSC_priest_spell_scripts() { new spell_pri_guardian_spirit(); - new spell_pri_mana_burn; - new spell_pri_pain_and_suffering_proc; - new spell_pri_penance; + new spell_pri_mana_burn(); + new spell_pri_pain_and_suffering_proc(); + new spell_pri_penance(); new spell_pri_reflective_shield_trigger(); new spell_pri_mind_sear(); + new spell_pri_prayer_of_mending_heal(); } diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index 09c34e3499d..810cc20e04b 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -275,7 +275,7 @@ class spell_q11396_11399_scourging_crystal_controller : public SpellScriptLoader void HandleDummy(SpellEffIndex /*effIndex*/) { - if (Unit* target = GetTargetUnit()) + if (Unit* target = GetExplTargetUnit()) if (target->GetTypeId() == TYPEID_UNIT && target->HasAura(SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3)) // Make sure nobody else is channeling the same target if (!target->HasAura(SPELL_SCOURGING_CRYSTAL_CONTROLLER)) @@ -636,6 +636,10 @@ class spell_q12851_going_bearback : public SpellScriptLoader if (Unit* caster = GetCaster()) { Unit* target = GetTarget(); + // Already in fire + if (target->HasAura(SPELL_ABLAZE)) + return; + if (Player* player = caster->GetCharmerOrOwnerPlayerOrPlayerItself()) { switch (target->GetEntry()) @@ -833,7 +837,7 @@ class spell_q12659_ahunaes_knife : public SpellScriptLoader Player* caster = GetCaster()->ToPlayer(); if (Creature* target = GetHitCreature()) { - target->ForcedDespawn(); + target->DespawnOrUnsummon(); caster->KilledMonsterCredit(NPC_SCALPS_KC_BUNNY, 0); } } @@ -1025,9 +1029,9 @@ class spell_q14112_14145_chum_the_water: public SpellScriptLoader // http://old01.wowhead.com/quest=9452 - Red Snapper - Very Tasty! enum RedSnapperVeryTasty { - SPELL_CAST_NET = 29866, - ITEM_RED_SNAPPER = 23614, - NPC_ANGRY_MURLOC = 17102, + SPELL_CAST_NET = 29866, + ITEM_RED_SNAPPER = 23614, + SPELL_NEW_SUMMON_TEST = 49214, }; class spell_q9452_cast_net: public SpellScriptLoader @@ -1047,16 +1051,10 @@ class spell_q9452_cast_net: public SpellScriptLoader void HandleDummy(SpellEffIndex /*effIndex*/) { Player* caster = GetCaster()->ToPlayer(); - switch (urand(0, 2)) - { - case 0: case 1: - caster->AddItem(ITEM_RED_SNAPPER, 1); - break; - case 2: - if (Creature* murloc = caster->SummonCreature(NPC_ANGRY_MURLOC, caster->GetPositionX()+5, caster->GetPositionY(), caster->GetPositionZ(), 0.0f, TEMPSUMMON_MANUAL_DESPAWN, 120000)) - murloc->AI()->AttackStart(caster); - break; - } + if (roll_chance_i(66)) + caster->AddItem(ITEM_RED_SNAPPER, 1); + else + caster->CastSpell(caster, SPELL_NEW_SUMMON_TEST, true); } void Register() @@ -1107,6 +1105,63 @@ public: } }; +enum LeaveNothingToChance +{ + NPC_UPPER_MINE_SHAFT = 27436, + NPC_LOWER_MINE_SHAFT = 27437, + + SPELL_UPPER_MINE_SHAFT_CREDIT = 48744, + SPELL_LOWER_MINE_SHAFT_CREDIT = 48745, +}; + +class spell_q12277_wintergarde_mine_explosion : public SpellScriptLoader +{ + public: + spell_q12277_wintergarde_mine_explosion() : SpellScriptLoader("spell_q12277_wintergarde_mine_explosion") { } + + class spell_q12277_wintergarde_mine_explosion_SpellScript : public SpellScript + { + PrepareSpellScript(spell_q12277_wintergarde_mine_explosion_SpellScript); + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + if (Creature* unitTarget = GetHitCreature()) + { + if (Unit* caster = GetCaster()) + { + if (caster->GetTypeId() == TYPEID_UNIT) + { + if (Unit* owner = caster->GetOwner()) + { + switch (unitTarget->GetEntry()) + { + case NPC_UPPER_MINE_SHAFT: + caster->CastSpell(owner, SPELL_UPPER_MINE_SHAFT_CREDIT, true); + break; + case NPC_LOWER_MINE_SHAFT: + caster->CastSpell(owner, SPELL_LOWER_MINE_SHAFT_CREDIT, true); + break; + default: + break; + } + } + } + } + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_q12277_wintergarde_mine_explosion_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_q12277_wintergarde_mine_explosion_SpellScript(); + } +}; + void AddSC_quest_spell_scripts() { new spell_q55_sacred_cleansing(); @@ -1133,4 +1188,5 @@ void AddSC_quest_spell_scripts() new spell_q14112_14145_chum_the_water(); new spell_q9452_cast_net(); new spell_q12987_read_pronouncement(); + new spell_q12277_wintergarde_mine_explosion(); } diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index 96ee7a18429..c9c036d5329 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -35,6 +35,9 @@ enum ShamanSpells SHAMAN_SPELL_FIRE_NOVA_TRIGGERED_R1 = 8349, SHAMAN_SPELL_SATED = 57724, SHAMAN_SPELL_EXHAUSTION = 57723, + + SHAMAN_SPELL_STORM_EARTH_AND_FIRE = 51483, + EARTHBIND_TOTEM_SPELL_EARTHGRAB = 64695, // For Earthen Power SHAMAN_TOTEM_SPELL_EARTHBIND_TOTEM = 6474, @@ -210,20 +213,35 @@ class spell_sha_earthbind_totem : public SpellScriptLoader return true; } - void HandleEffectPeriodic(AuraEffect const* aurEff) + void HandleEffectPeriodic(AuraEffect const* /*aurEff*/) { - if (Unit* target = GetTarget()) - if (Unit* caster = aurEff->GetBase()->GetCaster()) - if (TempSummon* summon = caster->ToTempSummon()) - if (Unit* owner = summon->GetOwner()) - if (AuraEffect* aur = owner->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, 2289, 0)) - if (roll_chance_i(aur->GetBaseAmount()) && target->HasAuraWithMechanic(1 << MECHANIC_SNARE)) - caster->CastSpell(caster, SHAMAN_TOTEM_SPELL_EARTHEN_POWER, true, NULL, aurEff); + if (!GetCaster()) + return; + if (Player* owner = GetCaster()->GetCharmerOrOwnerPlayerOrPlayerItself()) + if (AuraEffect* aur = owner->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, 2289, 0)) + if (roll_chance_i(aur->GetBaseAmount())) + GetTarget()->CastSpell((Unit*)NULL, SHAMAN_TOTEM_SPELL_EARTHEN_POWER, true); + } + + void Apply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (!GetCaster()) + return; + Player* owner = GetCaster()->GetCharmerOrOwnerPlayerOrPlayerItself(); + if (!owner) + return; + // Storm, Earth and Fire + if (AuraEffect* aurEff = owner->GetAuraEffectOfRankedSpell(SHAMAN_SPELL_STORM_EARTH_AND_FIRE, EFFECT_1)) + { + if (roll_chance_i(aurEff->GetAmount())) + GetCaster()->CastSpell(GetCaster(), EARTHBIND_TOTEM_SPELL_EARTHGRAB, false); + } } void Register() { OnEffectPeriodic += AuraEffectPeriodicFn(spell_sha_earthbind_totem_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + OnEffectApply += AuraEffectApplyFn(spell_sha_earthbind_totem_AuraScript::Apply, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL); } }; @@ -233,6 +251,46 @@ class spell_sha_earthbind_totem : public SpellScriptLoader } }; +class EarthenPowerTargetSelector +{ + public: + EarthenPowerTargetSelector() { } + + bool operator() (Unit* target) + { + if (!target->HasAuraWithMechanic(1 << MECHANIC_SNARE)) + return true; + + return false; + } +}; + +class spell_sha_earthen_power : public SpellScriptLoader +{ + public: + spell_sha_earthen_power() : SpellScriptLoader("spell_sha_earthen_power") { } + + class spell_sha_earthen_power_SpellScript : public SpellScript + { + PrepareSpellScript(spell_sha_earthen_power_SpellScript); + + void FilterTargets(std::list& unitList) + { + unitList.remove_if(EarthenPowerTargetSelector()); + } + + void Register() + { + OnUnitTargetSelect += SpellUnitTargetFn(spell_sha_earthen_power_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_sha_earthen_power_SpellScript(); + } +}; + class spell_sha_bloodlust : public SpellScriptLoader { public: @@ -251,7 +309,7 @@ class spell_sha_bloodlust : public SpellScriptLoader void RemoveInvalidTargets(std::list& targets) { - targets.remove_if (Trinity::UnitAuraCheck(true, SHAMAN_SPELL_SATED)); + targets.remove_if(Trinity::UnitAuraCheck(true, SHAMAN_SPELL_SATED)); } void ApplyDebuff() @@ -430,7 +488,7 @@ class spell_sha_healing_stream_totem : public SpellScriptLoader if (Unit* owner = caster->GetOwner()) { if (triggeringSpell) - damage = int32(owner->SpellHealingBonus(target, triggeringSpell, damage, HEAL)); + damage = int32(owner->SpellHealingBonusDone(target, triggeringSpell, damage, HEAL)); // Restorative Totems if (AuraEffect* dummy = owner->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, ICON_ID_RESTORATIVE_TOTEMS, 1)) @@ -439,6 +497,8 @@ class spell_sha_healing_stream_totem : public SpellScriptLoader // Glyph of Healing Stream Totem if (AuraEffect const* aurEff = owner->GetAuraEffect(SPELL_GLYPH_OF_HEALING_STREAM_TOTEM, EFFECT_0)) AddPctN(damage, aurEff->GetAmount()); + + damage = int32(target->SpellHealingBonusTaken(owner, triggeringSpell, damage, HEAL)); } caster->CastCustomSpell(target, SPELL_HEALING_STREAM_TOTEM_HEAL, &damage, 0, 0, true, 0, 0, GetOriginalCaster()->GetGUID()); } @@ -542,6 +602,55 @@ class spell_sha_lava_lash : public SpellScriptLoader } }; +// 1064 Chain Heal +class spell_sha_chain_heal : public SpellScriptLoader +{ + public: + spell_sha_chain_heal() : SpellScriptLoader("spell_sha_chain_heal") { } + + class spell_sha_chain_heal_SpellScript : public SpellScript + { + PrepareSpellScript(spell_sha_chain_heal_SpellScript); + + bool Load() + { + firstHeal = true; + riptide = false; + return true; + } + + void HandleHeal(SpellEffIndex /*effIndex*/) + { + if (firstHeal) + { + // Check if the target has Riptide + if (AuraEffect* aurEff = GetHitUnit()->GetAuraEffect(SPELL_AURA_PERIODIC_HEAL, SPELLFAMILY_SHAMAN, 0, 0, 0x10, GetCaster()->GetGUID())) + { + riptide = true; + // Consume it + GetHitUnit()->RemoveAura(aurEff->GetBase()); + } + firstHeal = false; + } + // Riptide increases the Chain Heal effect by 25% + if (riptide) + SetHitHeal(GetHitHeal() * 1.25f); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_sha_chain_heal_SpellScript::HandleHeal, EFFECT_0, SPELL_EFFECT_HEAL); + } + + bool firstHeal; + bool riptide; + }; + + SpellScript* GetSpellScript() const + { + return new spell_sha_chain_heal_SpellScript(); + } +}; void AddSC_shaman_spell_scripts() { @@ -549,6 +658,7 @@ void AddSC_shaman_spell_scripts() new spell_sha_fire_nova(); new spell_sha_mana_tide_totem(); new spell_sha_earthbind_totem(); + new spell_sha_earthen_power(); new spell_sha_bloodlust(); new spell_sha_heroism(); new spell_sha_ancestral_awakening_proc(); @@ -556,4 +666,5 @@ void AddSC_shaman_spell_scripts() new spell_sha_healing_stream_totem(); new spell_sha_mana_spring_totem(); new spell_sha_lava_lash(); + new spell_sha_chain_heal(); } diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index b1aff706db0..838b9e4f932 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -34,6 +34,9 @@ enum WarlockSpells WARLOCK_DEMONIC_EMPOWERMENT_IMP = 54444, WARLOCK_IMPROVED_HEALTHSTONE_R1 = 18692, WARLOCK_IMPROVED_HEALTHSTONE_R2 = 18693, + WARLOCK_DEMONIC_CIRCLE_SUMMON = 48018, + WARLOCK_DEMONIC_CIRCLE_TELEPORT = 48020, + WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST = 62388, }; class spell_warl_banish : public SpellScriptLoader @@ -169,6 +172,19 @@ class spell_warl_create_healthstone : public SpellScriptLoader return true; } + SpellCastResult CheckCast() + { + if (Player* caster = GetCaster()->ToPlayer()) + { + uint8 spellRank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id); + ItemPosCountVec dest; + InventoryResult msg = caster->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, iTypes[spellRank - 1][0], 1, NULL); + if (msg != EQUIP_ERR_OK) + return SPELL_FAILED_TOO_MANY_OF_ITEM; + } + return SPELL_CAST_OK; + } + void HandleScriptEffect(SpellEffIndex effIndex) { if (Unit* unitTarget = GetHitUnit()) @@ -195,6 +211,7 @@ class spell_warl_create_healthstone : public SpellScriptLoader void Register() { OnEffectHitTarget += SpellEffectFn(spell_warl_create_healthstone_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + OnCheckCast += SpellCheckCastFn(spell_warl_create_healthstone_SpellScript::CheckCast); } }; @@ -284,8 +301,8 @@ class spell_warl_seed_of_corruption : public SpellScriptLoader void FilterTargets(std::list& unitList) { - if (GetTargetUnit()) - unitList.remove(GetTargetUnit()); + if (GetExplTargetUnit()) + unitList.remove(GetExplTargetUnit()); } void Register() @@ -327,11 +344,7 @@ class spell_warl_soulshatter : public SpellScriptLoader if (Unit* target = GetHitUnit()) { if (target->CanHaveThreatList() && target->getThreatManager().getThreat(caster) > 0.0f) - { - sLog->outString("THREATREDUCTION"); caster->CastSpell(target, SPELL_SOULSHATTER, true); - } else - sLog->outString("can have threat? %u . threat number? %f ",target->CanHaveThreatList(),target->getThreatManager().getThreat(caster)); } } @@ -349,9 +362,6 @@ class spell_warl_soulshatter : public SpellScriptLoader enum LifeTap { - SPELL_LIFE_TAP_RANK_6 = 11689, - SPELL_LIFE_TAP_RANK_7 = 27222, - SPELL_LIFE_TAP_RANK_8 = 57946, SPELL_LIFE_TAP_ENERGIZE = 31818, SPELL_LIFE_TAP_ENERGIZE_2 = 32553, ICON_ID_IMPROVED_LIFE_TAP = 208, @@ -374,9 +384,7 @@ class spell_warl_life_tap : public SpellScriptLoader bool Validate(SpellInfo const* /*spell*/) { - if (!sSpellMgr->GetSpellInfo(SPELL_LIFE_TAP_RANK_6) || !sSpellMgr->GetSpellInfo(SPELL_LIFE_TAP_RANK_7) - || !sSpellMgr->GetSpellInfo(SPELL_LIFE_TAP_RANK_8) || !sSpellMgr->GetSpellInfo(SPELL_LIFE_TAP_ENERGIZE) - || !sSpellMgr->GetSpellInfo(SPELL_LIFE_TAP_ENERGIZE_2)) + if (!sSpellMgr->GetSpellInfo(SPELL_LIFE_TAP_ENERGIZE) || !sSpellMgr->GetSpellInfo(SPELL_LIFE_TAP_ENERGIZE_2)) return false; return true; } @@ -386,18 +394,8 @@ class spell_warl_life_tap : public SpellScriptLoader Player* caster = GetCaster()->ToPlayer(); if (Unit* target = GetHitUnit()) { - SpellInfo const* spellInfo = GetSpellInfo(); - float spFactor = 0.0f; - int32 damage = int32(GetEffectValue() + (6.3875 * spellInfo->BaseLevel)); - switch (spellInfo->Id) - { - case SPELL_LIFE_TAP_RANK_6: spFactor = 0.2f; break; - case SPELL_LIFE_TAP_RANK_7: - case SPELL_LIFE_TAP_RANK_8: spFactor = 0.5f; break; - default: break; - } - - int32 mana = int32(damage + (caster->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS+SPELL_SCHOOL_SHADOW) * spFactor)); + int32 damage = GetEffectValue(); + int32 mana = int32(damage + (caster->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS+SPELL_SCHOOL_SHADOW) * 0.5f)); // Shouldn't Appear in Combat Log target->ModifyHealth(-damage); @@ -424,9 +422,7 @@ class spell_warl_life_tap : public SpellScriptLoader SpellCastResult CheckCast() { if ((int32(GetCaster()->GetHealth()) > int32(GetSpellInfo()->Effects[EFFECT_0].CalcValue() + (6.3875 * GetSpellInfo()->BaseLevel)))) - { return SPELL_CAST_OK; - } return SPELL_FAILED_FIZZLE; } @@ -443,6 +439,90 @@ class spell_warl_life_tap : public SpellScriptLoader } }; +class spell_warl_demonic_circle_summon : public SpellScriptLoader +{ + public: + spell_warl_demonic_circle_summon() : SpellScriptLoader("spell_warl_demonic_circle_summon") { } + + class spell_warl_demonic_circle_summon_AuraScript : public AuraScript + { + PrepareAuraScript(spell_warl_demonic_circle_summon_AuraScript); + + void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes mode) + { + // If effect is removed by expire remove the summoned demonic circle too. + if (!(mode & AURA_EFFECT_HANDLE_REAPPLY)) + GetTarget()->RemoveGameObject(GetId(), true); + + GetTarget()->RemoveAura(WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST); + } + + void HandleDummyTick(AuraEffect const* /*aurEff*/) + { + if (GameObject* circle = GetTarget()->GetGameObject(GetId())) + { + // Here we check if player is in demonic circle teleport range, if so add + // WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST; allowing him to cast the WARLOCK_DEMONIC_CIRCLE_TELEPORT. + // If not in range remove the WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST. + + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_CIRCLE_TELEPORT); + + if (GetTarget()->IsWithinDist(circle, spellInfo->GetMaxRange(true))) + { + if (!GetTarget()->HasAura(WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST)) + GetTarget()->CastSpell(GetTarget(), WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST, true); + } + else + GetTarget()->RemoveAura(WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST); + } + } + + void Register() + { + OnEffectRemove += AuraEffectApplyFn(spell_warl_demonic_circle_summon_AuraScript::HandleRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + OnEffectPeriodic += AuraEffectPeriodicFn(spell_warl_demonic_circle_summon_AuraScript::HandleDummyTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_warl_demonic_circle_summon_AuraScript(); + } +}; + +class spell_warl_demonic_circle_teleport : public SpellScriptLoader +{ + public: + spell_warl_demonic_circle_teleport() : SpellScriptLoader("spell_warl_demonic_circle_teleport") { } + + class spell_warl_demonic_circle_teleport_AuraScript : public AuraScript + { + PrepareAuraScript(spell_warl_demonic_circle_teleport_AuraScript); + + void HandleTeleport(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Player* player = GetTarget()->ToPlayer()) + { + if (GameObject* circle = player->GetGameObject(WARLOCK_DEMONIC_CIRCLE_SUMMON)) + { + player->NearTeleportTo(circle->GetPositionX(), circle->GetPositionY(), circle->GetPositionZ(), circle->GetOrientation()); + player->RemoveMovementImpairingAuras(); + } + } + } + + void Register() + { + OnEffectApply += AuraEffectApplyFn(spell_warl_demonic_circle_teleport_AuraScript::HandleTeleport, EFFECT_0, SPELL_AURA_MECHANIC_IMMUNITY, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_warl_demonic_circle_teleport_AuraScript(); + } +}; + void AddSC_warlock_spell_scripts() { new spell_warl_banish(); @@ -453,4 +533,6 @@ void AddSC_warlock_spell_scripts() new spell_warl_seed_of_corruption(); new spell_warl_soulshatter(); new spell_warl_life_tap(); + new spell_warl_demonic_circle_summon(); + new spell_warl_demonic_circle_teleport(); } diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index 1084398c37d..0ba5c866d63 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -177,24 +177,27 @@ class spell_warr_deep_wounds : public SpellScriptLoader void HandleDummy(SpellEffIndex /* effIndex */) { int32 damage = GetEffectValue(); + Unit* caster = GetCaster(); if (Unit* target = GetHitUnit()) - if (Unit* caster = GetCaster()) - { - // apply percent damage mods - damage = caster->SpellDamageBonus(target, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE); + { + // apply percent damage mods + damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE); - ApplyPctN(damage, 16 * sSpellMgr->GetSpellRank(GetSpellInfo()->Id)); + ApplyPctN(damage, 16 * sSpellMgr->GetSpellRank(GetSpellInfo()->Id)); + + damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE); + + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_DEEP_WOUNDS_RANK_PERIODIC); + uint32 ticks = spellInfo->GetDuration() / spellInfo->Effects[EFFECT_0].Amplitude; - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_DEEP_WOUNDS_RANK_PERIODIC); - uint32 ticks = spellInfo->GetDuration() / spellInfo->Effects[EFFECT_0].Amplitude; + // Add remaining ticks to damage done + if (AuraEffect const* aurEff = target->GetAuraEffect(SPELL_DEEP_WOUNDS_RANK_PERIODIC, EFFECT_0, caster->GetGUID())) + damage += aurEff->GetAmount() * (ticks - aurEff->GetTickNumber()); - // Add remaining ticks to damage done - if (AuraEffect const* aurEff = target->GetAuraEffect(SPELL_DEEP_WOUNDS_RANK_PERIODIC, EFFECT_0, caster->GetGUID())) - damage += aurEff->GetAmount() * (ticks - aurEff->GetTickNumber()); + damage = damage / ticks; - damage = damage / ticks; - caster->CastCustomSpell(target, SPELL_DEEP_WOUNDS_RANK_PERIODIC, &damage, NULL, NULL, true); - } + caster->CastCustomSpell(target, SPELL_DEEP_WOUNDS_RANK_PERIODIC, &damage, NULL, NULL, true); + } } void Register() @@ -365,7 +368,7 @@ class spell_warr_concussion_blow : public SpellScriptLoader void HandleDummy(SpellEffIndex /* effIndex */) { - SetHitDamage(GetHitDamage() + CalculatePctF(GetHitDamage(),GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK))); + SetHitDamage(CalculatePctN(GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK), GetEffectValue())); } void Register() @@ -397,8 +400,7 @@ class spell_warr_bloodthirst : public SpellScriptLoader void HandleDummy(SpellEffIndex /* effIndex */) { int32 damage = GetEffectValue(); - if (GetHitUnit()) - GetCaster()->CastCustomSpell(GetHitUnit(), SPELL_BLOODTHIRST, &damage, NULL, NULL, true, NULL); + GetCaster()->CastCustomSpell(GetCaster(), SPELL_BLOODTHIRST, &damage, NULL, NULL, true, NULL); } void Register() @@ -413,6 +415,51 @@ class spell_warr_bloodthirst : public SpellScriptLoader } }; +enum Overpower +{ + SPELL_UNRELENTING_ASSAULT_RANK_1 = 46859, + SPELL_UNRELENTING_ASSAULT_RANK_2 = 46860, + SPELL_UNRELENTING_ASSAULT_TRIGGER_1 = 64849, + SPELL_UNRELENTING_ASSAULT_TRIGGER_2 = 64850, +}; + +class spell_warr_overpower : public SpellScriptLoader +{ +public: + spell_warr_overpower() : SpellScriptLoader("spell_warr_overpower") { } + + class spell_warr_overpower_SpellScript : public SpellScript + { + PrepareSpellScript(spell_warr_overpower_SpellScript); + + void HandleEffect(SpellEffIndex /* effIndex */) + { + uint32 spellId = 0; + if (GetCaster()->HasAura(SPELL_UNRELENTING_ASSAULT_RANK_1)) + spellId = SPELL_UNRELENTING_ASSAULT_TRIGGER_1; + else if (GetCaster()->HasAura(SPELL_UNRELENTING_ASSAULT_RANK_2)) + spellId = SPELL_UNRELENTING_ASSAULT_TRIGGER_2; + + if (!spellId) + return; + + if (Player* target = GetHitPlayer()) + if (target->HasUnitState(UNIT_STATE_CASTING)) + target->CastSpell(target, spellId, true); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_warr_overpower_SpellScript::HandleEffect, EFFECT_0, SPELL_EFFECT_ANY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_warr_overpower_SpellScript(); + } +}; + void AddSC_warrior_spell_scripts() { new spell_warr_last_stand(); @@ -424,4 +471,5 @@ void AddSC_warrior_spell_scripts() new spell_warr_execute(); new spell_warr_concussion_blow(); new spell_warr_bloodthirst(); + new spell_warr_overpower(); } diff --git a/src/server/scripts/World/CMakeLists.txt b/src/server/scripts/World/CMakeLists.txt index 41ba775efec..f081a5225e4 100644 --- a/src/server/scripts/World/CMakeLists.txt +++ b/src/server/scripts/World/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2011 TrinityCore +# Copyright (C) 2008-2012 TrinityCore # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without diff --git a/src/server/scripts/World/areatrigger_scripts.cpp b/src/server/scripts/World/areatrigger_scripts.cpp index 8f86f760775..daf0ef213d9 100644 --- a/src/server/scripts/World/areatrigger_scripts.cpp +++ b/src/server/scripts/World/areatrigger_scripts.cpp @@ -32,6 +32,7 @@ at_sholazar_waygate q12548 at_nats_landing q11209 at_bring_your_orphan_to q910 q910 q1800 q1479 q1687 q1558 q10951 q10952 at_brewfest +at_area_52_entrance EndContentData */ #include "ScriptPCH.h" @@ -251,8 +252,13 @@ class AreaTrigger_at_sholazar_waygate : public AreaTriggerScript { switch (trigger->id) { - case AT_SHOLAZAR: player->CastSpell(player, SPELL_SHOLAZAR_TO_UNGORO_TELEPORT, false); break; - case AT_UNGORO: player->CastSpell(player, SPELL_UNGORO_TO_SHOLAZAR_TELEPORT, false); break; + case AT_SHOLAZAR: + player->CastSpell(player, SPELL_SHOLAZAR_TO_UNGORO_TELEPORT, false); + break; + + case AT_UNGORO: + player->CastSpell(player, SPELL_UNGORO_TO_SHOLAZAR_TELEPORT, false); + break; } } @@ -420,6 +426,75 @@ class AreaTrigger_at_brewfest : public AreaTriggerScript std::map _triggerTimes; }; +/*###### +## at_area_52_entrance +######*/ + +enum Area52Entrance +{ + SPELL_A52_NEURALYZER = 34400, + NPC_SPOTLIGHT = 19913, + SUMMON_COOLDOWN = 5, + + AT_AREA_52_SOUTH = 4472, + AT_AREA_52_NORTH = 4466, + AT_AREA_52_WEST = 4471, + AT_AREA_52_EAST = 4422, +}; + +class AreaTrigger_at_area_52_entrance : public AreaTriggerScript +{ + public: + AreaTrigger_at_area_52_entrance() : AreaTriggerScript("at_area_52_entrance") + { + _triggerTimes[AT_AREA_52_SOUTH] = _triggerTimes[AT_AREA_52_NORTH] = _triggerTimes[AT_AREA_52_WEST] = _triggerTimes[AT_AREA_52_EAST] = 0; + } + + bool OnTrigger(Player* player, AreaTriggerEntry const* trigger) + { + float x = 0.0f, y = 0.0f, z = 0.0f; + + if (!player->isAlive()) + return false; + + uint32 triggerId = trigger->id; + if (sWorld->GetGameTime() - _triggerTimes[trigger->id] < SUMMON_COOLDOWN) + return false; + + switch (triggerId) + { + case AT_AREA_52_EAST: + x = 3044.176f; + y = 3610.692f; + z = 143.61f; + break; + case AT_AREA_52_NORTH: + x = 3114.87f; + y = 3687.619f; + z = 143.62f; + break; + case AT_AREA_52_WEST: + x = 3017.79f; + y = 3746.806f; + z = 144.27f; + break; + case AT_AREA_52_SOUTH: + x = 2950.63f; + y = 3719.905f; + z = 143.33f; + break; + } + + player->SummonCreature(NPC_SPOTLIGHT, x, y, z, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 5000); + player->AddAura(SPELL_A52_NEURALYZER, player); + _triggerTimes[trigger->id] = sWorld->GetGameTime(); + return false; + } + + private: + std::map _triggerTimes; +}; + void AddSC_areatrigger_scripts() { new AreaTrigger_at_coilfang_waterfall(); @@ -431,4 +506,5 @@ void AddSC_areatrigger_scripts() new AreaTrigger_at_nats_landing(); new AreaTrigger_at_bring_your_orphan_to(); new AreaTrigger_at_brewfest(); + new AreaTrigger_at_area_52_entrance(); } diff --git a/src/server/scripts/World/boss_emerald_dragons.cpp b/src/server/scripts/World/boss_emerald_dragons.cpp index 9f652e7a859..045dea9c9a9 100644 --- a/src/server/scripts/World/boss_emerald_dragons.cpp +++ b/src/server/scripts/World/boss_emerald_dragons.cpp @@ -198,7 +198,7 @@ class npc_dream_fog : public CreatureScript me->GetMotionMaster()->MoveRandom(25.0f); } // Seeping fog movement is slow enough for a player to be able to walk backwards and still outpace it - me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(true); me->SetSpeed(MOVE_WALK, 0.75f); } else @@ -371,7 +371,7 @@ class boss_ysondre : public CreatureScript { Talk(SAY_YSONDRE_SUMMON_DRUIDS); - for (uint8 i = 0 ; i < 10 ; ++i) + for (uint8 i = 0; i < 10; ++i) DoCast(me, SPELL_SUMMON_DRUID_SPIRITS, true); ++_stage; } diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp index 3dfc85d7eb4..790a9d0f814 100644 --- a/src/server/scripts/World/go_scripts.cpp +++ b/src/server/scripts/World/go_scripts.cpp @@ -34,7 +34,6 @@ go_tablet_of_madness go_tablet_of_the_seven go_tele_to_dalaran_crystal go_tele_to_violet_stand -go_rusty_cage go_scourge_cage go_jotunheim_cage go_table_theka @@ -44,7 +43,6 @@ go_ethereal_teleport_pad go_soulwell go_dragonflayer_cage go_tadpole_cage -go_black_cage go_amberpine_outhouse go_hive_pod go_gjalerbron_cage @@ -68,7 +66,7 @@ class go_cat_figurine : public GameObjectScript public: go_cat_figurine() : GameObjectScript("go_cat_figurine") { } - bool OnGossipHello(Player* player, GameObject* /*pGO*/) + bool OnGossipHello(Player* player, GameObject* /*go*/) { player->CastSpell(player, SPELL_SUMMON_GHOST_SABER, true); return false; @@ -83,12 +81,12 @@ class go_northern_crystal_pylon : public GameObjectScript public: go_northern_crystal_pylon() : GameObjectScript("go_northern_crystal_pylon") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { - if (pGO->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER) + if (go->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER) { - player->PrepareQuestMenu(pGO->GetGUID()); - player->SendPreparedQuest(pGO->GetGUID()); + player->PrepareQuestMenu(go->GetGUID()); + player->SendPreparedQuest(go->GetGUID()); } if (player->GetQuestStatus(4285) == QUEST_STATUS_INCOMPLETE) @@ -103,12 +101,12 @@ class go_eastern_crystal_pylon : public GameObjectScript public: go_eastern_crystal_pylon() : GameObjectScript("go_eastern_crystal_pylon") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { - if (pGO->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER) + if (go->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER) { - player->PrepareQuestMenu(pGO->GetGUID()); - player->SendPreparedQuest(pGO->GetGUID()); + player->PrepareQuestMenu(go->GetGUID()); + player->SendPreparedQuest(go->GetGUID()); } if (player->GetQuestStatus(4287) == QUEST_STATUS_INCOMPLETE) @@ -123,12 +121,12 @@ class go_western_crystal_pylon : public GameObjectScript public: go_western_crystal_pylon() : GameObjectScript("go_western_crystal_pylon") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { - if (pGO->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER) + if (go->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER) { - player->PrepareQuestMenu(pGO->GetGUID()); - player->SendPreparedQuest(pGO->GetGUID()); + player->PrepareQuestMenu(go->GetGUID()); + player->SendPreparedQuest(go->GetGUID()); } if (player->GetQuestStatus(4288) == QUEST_STATUS_INCOMPLETE) @@ -147,12 +145,11 @@ class go_barov_journal : public GameObjectScript public: go_barov_journal() : GameObjectScript("go_barov_journal") { } - bool OnGossipHello(Player* player, GameObject* /*pGO*/) + bool OnGossipHello(Player* player, GameObject* /*go*/) { if (player->HasSkill(SKILL_TAILORING) && player->GetBaseSkillValue(SKILL_TAILORING) >= 280 && !player->HasSpell(26086)) - { player->CastSpell(player, 26095, false); - } + return true; } }; @@ -166,12 +163,11 @@ class go_field_repair_bot_74A : public GameObjectScript public: go_field_repair_bot_74A() : GameObjectScript("go_field_repair_bot_74A") { } - bool OnGossipHello(Player* player, GameObject* /*pGO*/) + bool OnGossipHello(Player* player, GameObject* /*go*/) { if (player->HasSkill(SKILL_ENGINEERING) && player->GetBaseSkillValue(SKILL_ENGINEERING) >= 300 && !player->HasSpell(22704)) - { player->CastSpell(player, 22864, false); - } + return true; } }; @@ -190,9 +186,9 @@ class go_gilded_brazier : public GameObjectScript public: go_gilded_brazier() : GameObjectScript("go_gilded_brazier") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { - if (pGO->GetGoType() == GAMEOBJECT_TYPE_GOOBER) + if (go->GetGoType() == GAMEOBJECT_TYPE_GOOBER) { if (player->GetQuestStatus(9678) == QUEST_STATUS_INCOMPLETE) { @@ -213,7 +209,7 @@ class go_orb_of_command : public GameObjectScript public: go_orb_of_command() : GameObjectScript("go_orb_of_command") { } - bool OnGossipHello(Player* player, GameObject* /*pGO*/) + bool OnGossipHello(Player* player, GameObject* /*go*/) { if (player->GetQuestRewardStatus(7761)) player->CastSpell(player, 23460, true); @@ -231,12 +227,11 @@ class go_tablet_of_madness : public GameObjectScript public: go_tablet_of_madness() : GameObjectScript("go_tablet_of_madness") { } - bool OnGossipHello(Player* player, GameObject* /*pGO*/) + bool OnGossipHello(Player* player, GameObject* /*go*/) { if (player->HasSkill(SKILL_ALCHEMY) && player->GetSkillValue(SKILL_ALCHEMY) >= 300 && !player->HasSpell(24266)) - { player->CastSpell(player, 24267, false); - } + return true; } }; @@ -251,9 +246,9 @@ public: go_tablet_of_the_seven() : GameObjectScript("go_tablet_of_the_seven") { } //TODO: use gossip option ("Transcript the Tablet") instead, if Trinity adds support. - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { - if (pGO->GetGoType() != GAMEOBJECT_TYPE_QUESTGIVER) + if (go->GetGoType() != GAMEOBJECT_TYPE_QUESTGIVER) return true; if (player->GetQuestStatus(4296) == QUEST_STATUS_INCOMPLETE) @@ -272,10 +267,10 @@ class go_jump_a_tron : public GameObjectScript public: go_jump_a_tron() : GameObjectScript("go_jump_a_tron") { } - bool OnGossipHello(Player* player, GameObject* /*pGO*/) + bool OnGossipHello(Player* player, GameObject* /*go*/) { if (player->GetQuestStatus(10111) == QUEST_STATUS_INCOMPLETE) - player->CastSpell(player, 33382, true); + player->CastSpell(player, 33382, true); return true; } @@ -306,12 +301,11 @@ class go_ethereum_prison : public GameObjectScript public: go_ethereum_prison() : GameObjectScript("go_ethereum_prison") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { int Random = rand() % (sizeof(NpcPrisonEntry) / sizeof(uint32)); - if (Creature* creature = player->SummonCreature(NpcPrisonEntry[Random], - pGO->GetPositionX(), pGO->GetPositionY(), pGO->GetPositionZ(), pGO->GetAngle(player), + if (Creature* creature = player->SummonCreature(NpcPrisonEntry[Random], go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), go->GetAngle(player), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000)) { if (!creature->IsHostileTo(player)) @@ -356,12 +350,11 @@ class go_ethereum_stasis : public GameObjectScript public: go_ethereum_stasis() : GameObjectScript("go_ethereum_stasis") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { int Random = rand() % (sizeof(NpcStasisEntry) / sizeof(uint32)); - player->SummonCreature(NpcStasisEntry[Random], - pGO->GetPositionX(), pGO->GetPositionY(), pGO->GetPositionZ(), pGO->GetAngle(player), + player->SummonCreature(NpcStasisEntry[Random], go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), go->GetAngle(player), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); return false; @@ -382,10 +375,10 @@ class go_resonite_cask : public GameObjectScript public: go_resonite_cask() : GameObjectScript("go_resonite_cask") { } - bool OnGossipHello(Player* /*player*/, GameObject* pGO) + bool OnGossipHello(Player* /*player*/, GameObject* go) { - if (pGO->GetGoType() == GAMEOBJECT_TYPE_GOOBER) - pGO->SummonCreature(NPC_GOGGEROC, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 300000); + if (go->GetGoType() == GAMEOBJECT_TYPE_GOOBER) + go->SummonCreature(NPC_GOGGEROC, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 300000); return false; } @@ -402,9 +395,9 @@ class go_sacred_fire_of_life : public GameObjectScript public: go_sacred_fire_of_life() : GameObjectScript("go_sacred_fire_of_life") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { - if (pGO->GetGoType() == GAMEOBJECT_TYPE_GOOBER) + if (go->GetGoType() == GAMEOBJECT_TYPE_GOOBER) player->SummonCreature(NPC_ARIKARA, -5008.338f, -2118.894f, 83.657f, 0.874f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); return true; @@ -430,14 +423,14 @@ class go_shrine_of_the_birds : public GameObjectScript public: go_shrine_of_the_birds() : GameObjectScript("go_shrine_of_the_birds") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { uint32 BirdEntry = 0; float fX, fY, fZ; - pGO->GetClosePoint(fX, fY, fZ, pGO->GetObjectSize(), INTERACTION_DISTANCE); + go->GetClosePoint(fX, fY, fZ, go->GetObjectSize(), INTERACTION_DISTANCE); - switch (pGO->GetEntry()) + switch (go->GetEntry()) { case GO_SHRINE_HAWK: BirdEntry = NPC_HAWK_GUARD; @@ -451,7 +444,7 @@ public: } if (BirdEntry) - player->SummonCreature(BirdEntry, fX, fY, fZ, pGO->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + player->SummonCreature(BirdEntry, fX, fY, fZ, go->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); return false; } @@ -473,7 +466,7 @@ class go_southfury_moonstone : public GameObjectScript public: go_southfury_moonstone() : GameObjectScript("go_southfury_moonstone") { } - bool OnGossipHello(Player* player, GameObject* /*pGO*/) + bool OnGossipHello(Player* player, GameObject* /*go*/) { //implicitTarget=48 not implemented as of writing this code, and manual summon may be just ok for our purpose //player->CastSpell(player, SPELL_SUMMON_RIZZLE, false); @@ -496,19 +489,18 @@ enum eDalaranCrystal }; #define GO_TELE_TO_DALARAN_CRYSTAL_FAILED "This teleport crystal cannot be used until the teleport crystal in Dalaran has been used at least once." + class go_tele_to_dalaran_crystal : public GameObjectScript { public: go_tele_to_dalaran_crystal() : GameObjectScript("go_tele_to_dalaran_crystal") { } - bool OnGossipHello(Player* player, GameObject* /*pGO*/) + bool OnGossipHello(Player* player, GameObject* /*go*/) { if (player->GetQuestRewardStatus(QUEST_TELE_CRYSTAL_FLAG)) - { return false; - } - else - player->GetSession()->SendNotification(GO_TELE_TO_DALARAN_CRYSTAL_FAILED); + + player->GetSession()->SendNotification(GO_TELE_TO_DALARAN_CRYSTAL_FAILED); return true; } @@ -523,7 +515,7 @@ class go_tele_to_violet_stand : public GameObjectScript public: go_tele_to_violet_stand() : GameObjectScript("go_tele_to_violet_stand") { } - bool OnGossipHello(Player* player, GameObject* /*pGO*/) + bool OnGossipHello(Player* player, GameObject* /*go*/) { if (player->GetQuestRewardStatus(QUEST_LEARN_LEAVE_RETURN) || player->GetQuestStatus(QUEST_LEARN_LEAVE_RETURN) == QUEST_STATUS_INCOMPLETE) return false; @@ -553,38 +545,38 @@ class go_fel_crystalforge : public GameObjectScript public: go_fel_crystalforge() : GameObjectScript("go_fel_crystalforge") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { - if (pGO->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER) /* != GAMEOBJECT_TYPE_QUESTGIVER) */ - player->PrepareQuestMenu(pGO->GetGUID()); /* return true*/ + if (go->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER) /* != GAMEOBJECT_TYPE_QUESTGIVER) */ + player->PrepareQuestMenu(go->GetGUID()); /* return true*/ player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FEL_CRYSTALFORGE_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FEL_CRYSTALFORGE_ITEM_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - player->SEND_GOSSIP_MENU(GOSSIP_FEL_CRYSTALFORGE_TEXT, pGO->GetGUID()); + player->SEND_GOSSIP_MENU(GOSSIP_FEL_CRYSTALFORGE_TEXT, go->GetGUID()); return true; } - bool OnGossipSelect(Player* player, GameObject* pGO, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, GameObject* go, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF: player->CastSpell(player, SPELL_CREATE_1_FLASK_OF_BEAST, false); player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FEL_CRYSTALFORGE_ITEM_RETURN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - player->SEND_GOSSIP_MENU(GOSSIP_FEL_CRYSTALFORGE_ITEM_TEXT_RETURN, pGO->GetGUID()); + player->SEND_GOSSIP_MENU(GOSSIP_FEL_CRYSTALFORGE_ITEM_TEXT_RETURN, go->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 1: player->CastSpell(player, SPELL_CREATE_5_FLASK_OF_BEAST, false); player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FEL_CRYSTALFORGE_ITEM_RETURN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - player->SEND_GOSSIP_MENU(GOSSIP_FEL_CRYSTALFORGE_ITEM_TEXT_RETURN, pGO->GetGUID()); + player->SEND_GOSSIP_MENU(GOSSIP_FEL_CRYSTALFORGE_ITEM_TEXT_RETURN, go->GetGUID()); break; - case GOSSIP_ACTION_INFO_DEF + 2: + case GOSSIP_ACTION_INFO_DEF + 2: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FEL_CRYSTALFORGE_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FEL_CRYSTALFORGE_ITEM_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - player->SEND_GOSSIP_MENU(GOSSIP_FEL_CRYSTALFORGE_TEXT, pGO->GetGUID()); + player->SEND_GOSSIP_MENU(GOSSIP_FEL_CRYSTALFORGE_TEXT, go->GetGUID()); break; } return true; @@ -612,38 +604,38 @@ class go_bashir_crystalforge : public GameObjectScript public: go_bashir_crystalforge() : GameObjectScript("go_bashir_crystalforge") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { - if (pGO->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER) /* != GAMEOBJECT_TYPE_QUESTGIVER) */ - player->PrepareQuestMenu(pGO->GetGUID()); /* return true*/ + if (go->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER) /* != GAMEOBJECT_TYPE_QUESTGIVER) */ + player->PrepareQuestMenu(go->GetGUID()); /* return true*/ player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BASHIR_CRYSTALFORGE_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BASHIR_CRYSTALFORGE_ITEM_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - player->SEND_GOSSIP_MENU(GOSSIP_BASHIR_CRYSTALFORGE_TEXT, pGO->GetGUID()); + player->SEND_GOSSIP_MENU(GOSSIP_BASHIR_CRYSTALFORGE_TEXT, go->GetGUID()); return true; } - bool OnGossipSelect(Player* player, GameObject* pGO, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, GameObject* go, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF: player->CastSpell(player, SPELL_CREATE_1_FLASK_OF_SORCERER, false); player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BASHIR_CRYSTALFORGE_ITEM_RETURN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - player->SEND_GOSSIP_MENU(GOSSIP_BASHIR_CRYSTALFORGE_ITEM_TEXT_RETURN, pGO->GetGUID()); + player->SEND_GOSSIP_MENU(GOSSIP_BASHIR_CRYSTALFORGE_ITEM_TEXT_RETURN, go->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 1: player->CastSpell(player, SPELL_CREATE_5_FLASK_OF_SORCERER, false); player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BASHIR_CRYSTALFORGE_ITEM_RETURN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - player->SEND_GOSSIP_MENU(GOSSIP_BASHIR_CRYSTALFORGE_ITEM_TEXT_RETURN, pGO->GetGUID()); + player->SEND_GOSSIP_MENU(GOSSIP_BASHIR_CRYSTALFORGE_ITEM_TEXT_RETURN, go->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF + 2: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BASHIR_CRYSTALFORGE_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BASHIR_CRYSTALFORGE_ITEM_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - player->SEND_GOSSIP_MENU(GOSSIP_BASHIR_CRYSTALFORGE_TEXT, pGO->GetGUID()); + player->SEND_GOSSIP_MENU(GOSSIP_BASHIR_CRYSTALFORGE_TEXT, go->GetGUID()); break; } return true; @@ -676,9 +668,9 @@ class go_matrix_punchograph : public GameObjectScript public: go_matrix_punchograph() : GameObjectScript("go_matrix_punchograph") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { - switch (pGO->GetEntry()) + switch (go->GetEntry()) { case MATRIX_PUNCHOGRAPH_3005_A: if (player->HasItemCount(ITEM_WHITE_PUNCH_CARD, 1)) @@ -715,33 +707,6 @@ public: } }; -/*###### -## go_rusty_cage -######*/ - -enum eRustyCage -{ - NPC_GOBLIN_PRISIONER = 29466 -}; - -class go_rusty_cage : public GameObjectScript -{ -public: - go_rusty_cage() : GameObjectScript("go_rusty_cage") { } - - bool OnGossipHello(Player* player, GameObject* pGO) - { - if (Creature* pGoblinPrisoner = pGO->FindNearestCreature(NPC_GOBLIN_PRISIONER, 5.0f, true)) - { - pGO->SetGoState(GO_STATE_ACTIVE); - player->KilledMonsterCredit(NPC_GOBLIN_PRISIONER, pGoblinPrisoner->GetGUID()); - pGoblinPrisoner->DisappearAndDie(); - } - - return true; - } -}; - /*###### ## go_scourge_cage ######*/ @@ -756,11 +721,11 @@ class go_scourge_cage : public GameObjectScript public: go_scourge_cage() : GameObjectScript("go_scourge_cage") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { - if (Creature* pNearestPrisoner = pGO->FindNearestCreature(NPC_SCOURGE_PRISONER, 5.0f, true)) + if (Creature* pNearestPrisoner = go->FindNearestCreature(NPC_SCOURGE_PRISONER, 5.0f, true)) { - pGO->SetGoState(GO_STATE_ACTIVE); + go->SetGoState(GO_STATE_ACTIVE); player->KilledMonsterCredit(NPC_SCOURGE_PRISONER, pNearestPrisoner->GetGUID()); pNearestPrisoner->DisappearAndDie(); } @@ -784,15 +749,15 @@ class go_arcane_prison : public GameObjectScript public: go_arcane_prison() : GameObjectScript("go_arcane_prison") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { if (player->GetQuestStatus(QUEST_PRISON_BREAK) == QUEST_STATUS_INCOMPLETE) { - pGO->SummonCreature(25318, 3485.089844f, 6115.7422188f, 70.966812f, 0, TEMPSUMMON_TIMED_DESPAWN, 60000); + go->SummonCreature(25318, 3485.089844f, 6115.7422188f, 70.966812f, 0, TEMPSUMMON_TIMED_DESPAWN, 60000); player->CastSpell(player, SPELL_ARCANE_PRISONER_KILL_CREDIT, true); return true; - } else - return false; + } + return false; } }; @@ -807,9 +772,9 @@ class go_blood_filled_orb : public GameObjectScript public: go_blood_filled_orb() : GameObjectScript("go_blood_filled_orb") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { - if (pGO->GetGoType() == GAMEOBJECT_TYPE_GOOBER) + if (go->GetGoType() == GAMEOBJECT_TYPE_GOOBER) player->SummonCreature(NPC_ZELEMAR, -369.746f, 166.759f, -21.50f, 5.235f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); return true; @@ -838,17 +803,17 @@ class go_jotunheim_cage : public GameObjectScript public: go_jotunheim_cage() : GameObjectScript("go_jotunheim_cage") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { - Creature* pPrisoner = pGO->FindNearestCreature(NPC_EBON_BLADE_PRISONER_HUMAN, 5.0f, true); + Creature* pPrisoner = go->FindNearestCreature(NPC_EBON_BLADE_PRISONER_HUMAN, 5.0f, true); if (!pPrisoner) { - pPrisoner = pGO->FindNearestCreature(NPC_EBON_BLADE_PRISONER_TROLL, 5.0f, true); + pPrisoner = go->FindNearestCreature(NPC_EBON_BLADE_PRISONER_TROLL, 5.0f, true); if (!pPrisoner) { - pPrisoner = pGO->FindNearestCreature(NPC_EBON_BLADE_PRISONER_ORC, 5.0f, true); + pPrisoner = go->FindNearestCreature(NPC_EBON_BLADE_PRISONER_ORC, 5.0f, true); if (!pPrisoner) - pPrisoner = pGO->FindNearestCreature(NPC_EBON_BLADE_PRISONER_NE, 5.0f, true); + pPrisoner = go->FindNearestCreature(NPC_EBON_BLADE_PRISONER_NE, 5.0f, true); } } if (!pPrisoner || !pPrisoner->isAlive()) @@ -887,12 +852,12 @@ class go_table_theka : public GameObjectScript public: go_table_theka() : GameObjectScript("go_table_theka") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { if (player->GetQuestStatus(QUEST_SPIDER_GOLD) == QUEST_STATUS_INCOMPLETE) player->AreaExploredOrEventHappens(QUEST_SPIDER_GOLD); - player->SEND_GOSSIP_MENU(GOSSIP_TABLE_THEKA, pGO->GetGUID()); + player->SEND_GOSSIP_MENU(GOSSIP_TABLE_THEKA, go->GetGUID()); return true; } @@ -913,7 +878,7 @@ class go_inconspicuous_landmark : public GameObjectScript public: go_inconspicuous_landmark() : GameObjectScript("go_inconspicuous_landmark") { } - bool OnGossipHello(Player* player, GameObject* /*pGO*/) + bool OnGossipHello(Player* player, GameObject* /*go*/) { if (player->HasItemCount(ITEM_CUERGOS_KEY, 1)) return false; @@ -939,12 +904,12 @@ class go_ethereal_teleport_pad : public GameObjectScript public: go_ethereal_teleport_pad() : GameObjectScript("go_ethereal_teleport_pad") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { if (!player->HasItemCount(ITEM_TELEPORTER_POWER_PACK, 1)) return false; - pGO->SummonCreature(NPC_IMAGE_WIND_TRADER, pGO->GetPositionX(), pGO->GetPositionY(), pGO->GetPositionZ(), pGO->GetAngle(player), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); + go->SummonCreature(NPC_IMAGE_WIND_TRADER, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), go->GetAngle(player), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); return true; } @@ -959,9 +924,9 @@ class go_soulwell : public GameObjectScript public: go_soulwell() : GameObjectScript("go_soulwell") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { - Unit* caster = pGO->GetOwner(); + Unit* caster = go->GetOwner(); if (!caster || caster->GetTypeId() != TYPEID_PLAYER) return true; @@ -972,7 +937,7 @@ public: // GO scripting with at least On Create and On Update events, the other options are no less // ugly and hacky. uint32 newSpell = 0; - if (pGO->GetEntry() == 193169) // Soulwell for rank 2 + if (go->GetEntry() == 193169) // Soulwell for rank 2 { if (caster->HasAura(18693)) // Improved Healthstone rank 2 newSpell = 58898; @@ -980,7 +945,7 @@ public: newSpell = 58896; else newSpell = 58890; } - else if (pGO->GetEntry() == 181621) // Soulwell for rank 1 + else if (go->GetEntry() == 181621) // Soulwell for rank 1 { if (caster->HasAura(18693)) // Improved Healthstone rank 2 newSpell = 34150; @@ -989,7 +954,7 @@ public: else newSpell = 34130; } - pGO->AddUse(); + go->AddUse(); player->CastSpell(player, newSpell, true); return true; } @@ -1014,20 +979,20 @@ class go_dragonflayer_cage : public GameObjectScript public: go_dragonflayer_cage() : GameObjectScript("go_dragonflayer_cage") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { if (player->GetQuestStatus(QUEST_PRISONERS_OF_WYRMSKULL) != QUEST_STATUS_INCOMPLETE) return true; - Creature* pPrisoner = pGO->FindNearestCreature(NPC_PRISONER_PRIEST, 2.0f); + Creature* pPrisoner = go->FindNearestCreature(NPC_PRISONER_PRIEST, 2.0f); if (!pPrisoner) { - pPrisoner = pGO->FindNearestCreature(NPC_PRISONER_MAGE, 2.0f); + pPrisoner = go->FindNearestCreature(NPC_PRISONER_MAGE, 2.0f); if (!pPrisoner) { - pPrisoner = pGO->FindNearestCreature(NPC_PRISONER_WARRIOR, 2.0f); + pPrisoner = go->FindNearestCreature(NPC_PRISONER_WARRIOR, 2.0f); if (!pPrisoner) - pPrisoner = pGO->FindNearestCreature(NPC_PRISONER_PALADIN, 2.0f); + pPrisoner = go->FindNearestCreature(NPC_PRISONER_PALADIN, 2.0f); } } @@ -1061,14 +1026,14 @@ class go_tadpole_cage : public GameObjectScript public: go_tadpole_cage() : GameObjectScript("go_tadpole_cage") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { if (player->GetQuestStatus(QUEST_OH_NOES_THE_TADPOLES) == QUEST_STATUS_INCOMPLETE) { - Creature* pTadpole = pGO->FindNearestCreature(NPC_WINTERFIN_TADPOLE, 1.0f); + Creature* pTadpole = go->FindNearestCreature(NPC_WINTERFIN_TADPOLE, 1.0f); if (pTadpole) { - pGO->UseDoorOrButton(); + go->UseDoorOrButton(); pTadpole->DisappearAndDie(); player->KilledMonsterCredit(NPC_WINTERFIN_TADPOLE, 0); //FIX: Summon minion tadpole @@ -1078,43 +1043,6 @@ public: } }; -/*###### -## Quest 14096 & 14142: You've Really Done It This Time, Kul -## go_black_cage -######*/ - -enum eReallyDoneItThisTime -{ - QUEST_ALLIANCE_YOU_VE_REALLY_DONE_IT_THIS_TIME_KUL = 14096, - QUEST_HORDE_YOU_VE_REALLY_DONE_IT_THIS_TIME_KUL = 14142, - NPC_CAPTIVE_ASPIRANT = 34716, - NPC_KUL = 34956 -}; - -class go_black_cage : public GameObjectScript -{ -public: - go_black_cage() : GameObjectScript("go_black_cage") { } - - bool OnGossipHello(Player* player, GameObject* pGO) - { - if ((player->GetTeamId() == TEAM_ALLIANCE && player->GetQuestStatus(QUEST_ALLIANCE_YOU_VE_REALLY_DONE_IT_THIS_TIME_KUL) == QUEST_STATUS_INCOMPLETE) || - (player->GetTeamId() == TEAM_HORDE && player->GetQuestStatus(QUEST_HORDE_YOU_VE_REALLY_DONE_IT_THIS_TIME_KUL) == QUEST_STATUS_INCOMPLETE)) - { - Creature* pPrisoner = pGO->FindNearestCreature(NPC_CAPTIVE_ASPIRANT, 1.0f); - if (!pPrisoner) - pPrisoner = pGO->FindNearestCreature(NPC_KUL, 1.0f); - if (pPrisoner) - { - pGO->UseDoorOrButton(); - pPrisoner->DisappearAndDie(); - player->KilledMonsterCredit(pPrisoner->GetEntry(), 0); - } - } - return true; - } -}; - /*###### ## go_amberpine_outhouse ######*/ @@ -1139,35 +1067,35 @@ class go_amberpine_outhouse : public GameObjectScript public: go_amberpine_outhouse() : GameObjectScript("go_amberpine_outhouse") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { QuestStatus status = player->GetQuestStatus(QUEST_DOING_YOUR_DUTY); if (status == QUEST_STATUS_INCOMPLETE || status == QUEST_STATUS_COMPLETE || status == QUEST_STATUS_REWARDED) { player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_USE_OUTHOUSE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - player->SEND_GOSSIP_MENU(GOSSIP_OUTHOUSE_VACANT, pGO->GetGUID()); + player->SEND_GOSSIP_MENU(GOSSIP_OUTHOUSE_VACANT, go->GetGUID()); return true; } else - player->SEND_GOSSIP_MENU(GOSSIP_OUTHOUSE_INUSE, pGO->GetGUID()); + player->SEND_GOSSIP_MENU(GOSSIP_OUTHOUSE_INUSE, go->GetGUID()); return true; } - bool OnGossipSelect(Player* player, GameObject* pGO, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, GameObject* go, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF +1) + if (action == GOSSIP_ACTION_INFO_DEF +1) { player->CLOSE_GOSSIP_MENU(); Creature* target = GetClosestCreatureWithEntry(player, NPC_OUTHOUSE_BUNNY, 3.0f); if (target) { target->AI()->SetData(1, player->getGender()); - pGO->CastSpell(target, SPELL_INDISPOSED_III); + go->CastSpell(target, SPELL_INDISPOSED_III); } - pGO->CastSpell(player, SPELL_INDISPOSED); + go->CastSpell(player, SPELL_INDISPOSED); if (player->HasItemCount(ITEM_ANDERHOLS_SLIDER_CIDER, 1)) - pGO->CastSpell(player, SPELL_CREATE_AMBERSEEDS); + go->CastSpell(player, SPELL_CREATE_AMBERSEEDS); return true; } else @@ -1195,11 +1123,11 @@ class go_hive_pod : public GameObjectScript public: go_hive_pod() : GameObjectScript("go_hive_pod") { } - bool OnGossipHello(Player* player, GameObject* pGO) + bool OnGossipHello(Player* player, GameObject* go) { - player->SendLoot(pGO->GetGUID(), LOOT_CORPSE); - pGO->SummonCreature(NPC_HIVE_AMBUSHER, pGO->GetPositionX()+1, pGO->GetPositionY(), pGO->GetPositionZ(), pGO->GetAngle(player), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); - pGO->SummonCreature(NPC_HIVE_AMBUSHER, pGO->GetPositionX(), pGO->GetPositionY()+1, pGO->GetPositionZ(), pGO->GetAngle(player), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); + player->SendLoot(go->GetGUID(), LOOT_CORPSE); + go->SummonCreature(NPC_HIVE_AMBUSHER, go->GetPositionX()+1, go->GetPositionY(), go->GetPositionZ(), go->GetAngle(player), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); + go->SummonCreature(NPC_HIVE_AMBUSHER, go->GetPositionX(), go->GetPositionY()+1, go->GetPositionZ(), go->GetAngle(player), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); return true; } }; @@ -1246,7 +1174,7 @@ class go_gjalerbron_cage : public GameObjectScript player->KilledMonsterCredit(NPC_GJALERBRON_PRISONER, 0); prisoner->AI()->Talk(SAY_FREE); - prisoner->ForcedDespawn(6000); + prisoner->DespawnOrUnsummon(6000); } } return true; @@ -1273,7 +1201,7 @@ class go_large_gjalerbron_cage : public GameObjectScript { go->UseDoorOrButton(); player->KilledMonsterCredit(NPC_GJALERBRON_PRISONER, (*itr)->GetGUID()); - (*itr)->ForcedDespawn(6000); + (*itr)->DespawnOrUnsummon(6000); (*itr)->AI()->Talk(SAY_FREE); } } @@ -1307,7 +1235,7 @@ class go_veil_skith_cage : public GameObjectScript { go->UseDoorOrButton(); player->KilledMonsterCredit(NPC_CAPTIVE_CHILD, (*itr)->GetGUID()); - (*itr)->ForcedDespawn(5000); + (*itr)->DespawnOrUnsummon(5000); (*itr)->GetMotionMaster()->MovePoint(1, go->GetPositionX()+5, go->GetPositionY(), go->GetPositionZ()); (*itr)->AI()->Talk(SAY_FREE_0); (*itr)->GetMotionMaster()->Clear(); @@ -1341,7 +1269,6 @@ void AddSC_go_scripts() new go_fel_crystalforge; new go_bashir_crystalforge; new go_matrix_punchograph; - new go_rusty_cage; new go_scourge_cage; new go_arcane_prison; new go_blood_filled_orb; @@ -1352,7 +1279,6 @@ void AddSC_go_scripts() new go_soulwell; new go_tadpole_cage; new go_dragonflayer_cage; - new go_black_cage; new go_amberpine_outhouse; new go_hive_pod; new go_massive_seaforium_charge; diff --git a/src/server/scripts/World/guards.cpp b/src/server/scripts/World/guards.cpp index 9bc511931b9..e3100522fbe 100644 --- a/src/server/scripts/World/guards.cpp +++ b/src/server/scripts/World/guards.cpp @@ -177,7 +177,6 @@ public: //Set our global cooldown globalCooldown = GENERIC_CREATURE_COOLDOWN; - } //If no spells available and we arn't moving run to target else if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != CHASE_MOTION_TYPE) { @@ -196,12 +195,26 @@ public: { switch (emote) { - case TEXT_EMOTE_KISS: me->HandleEmoteCommand(EMOTE_ONESHOT_BOW); break; - case TEXT_EMOTE_WAVE: me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); break; - case TEXT_EMOTE_SALUTE: me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); break; - case TEXT_EMOTE_SHY: me->HandleEmoteCommand(EMOTE_ONESHOT_FLEX); break; + case TEXT_EMOTE_KISS: + me->HandleEmoteCommand(EMOTE_ONESHOT_BOW); + break; + + case TEXT_EMOTE_WAVE: + me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); + break; + + case TEXT_EMOTE_SALUTE: + me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); + break; + + case TEXT_EMOTE_SHY: + me->HandleEmoteCommand(EMOTE_ONESHOT_FLEX); + break; + case TEXT_EMOTE_RUDE: - case TEXT_EMOTE_CHICKEN: me->HandleEmoteCommand(EMOTE_ONESHOT_POINT); break; + case TEXT_EMOTE_CHICKEN: + me->HandleEmoteCommand(EMOTE_ONESHOT_POINT); + break; } } diff --git a/src/server/scripts/World/item_scripts.cpp b/src/server/scripts/World/item_scripts.cpp index 165ef9f18b1..ae69744ea2b 100644 --- a/src/server/scripts/World/item_scripts.cpp +++ b/src/server/scripts/World/item_scripts.cpp @@ -47,9 +47,9 @@ class item_only_for_flight : public ItemScript public: item_only_for_flight() : ItemScript("item_only_for_flight") { } - bool OnUse(Player* player, Item* pItem, SpellCastTargets const& /*targets*/) + bool OnUse(Player* player, Item* item, SpellCastTargets const& /*targets*/) { - uint32 itemId = pItem->GetEntry(); + uint32 itemId = item->GetEntry(); bool disabled = false; //for special scripts @@ -64,8 +64,8 @@ public: disabled = true; break; case 34475: - if (const SpellInfo* pSpellInfo = sSpellMgr->GetSpellInfo(SPELL_ARCANE_CHARGES)) - Spell::SendCastResult(player, pSpellInfo, 1, SPELL_FAILED_NOT_ON_GROUND); + if (const SpellInfo* spellInfo = sSpellMgr->GetSpellInfo(SPELL_ARCANE_CHARGES)) + Spell::SendCastResult(player, spellInfo, 1, SPELL_FAILED_NOT_ON_GROUND); break; } @@ -74,7 +74,7 @@ public: return false; // error - player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pItem, NULL); + player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL); return true; } }; @@ -94,6 +94,7 @@ public: { if (Creature* nether = player->SummonCreature(22408, player->GetPositionX(), player->GetPositionY()+20, player->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 180000)) nether->AI()->AttackStart(player); + if (Creature* nether = player->SummonCreature(22408, player->GetPositionX(), player->GetPositionY()-20, player->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 180000)) nether->AI()->AttackStart(player); } @@ -110,13 +111,13 @@ class item_gor_dreks_ointment : public ItemScript public: item_gor_dreks_ointment() : ItemScript("item_gor_dreks_ointment") { } - bool OnUse(Player* player, Item* pItem, SpellCastTargets const& targets) + bool OnUse(Player* player, Item* item, SpellCastTargets const& targets) { if (targets.GetUnitTarget() && targets.GetUnitTarget()->GetTypeId() == TYPEID_UNIT && targets.GetUnitTarget()->GetEntry() == 20748 && !targets.GetUnitTarget()->HasAura(32578)) return false; - player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pItem, NULL); + player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL); return true; } }; @@ -130,13 +131,13 @@ class item_incendiary_explosives : public ItemScript public: item_incendiary_explosives() : ItemScript("item_incendiary_explosives") { } - bool OnUse(Player* player, Item* pItem, SpellCastTargets const & /*targets*/) + bool OnUse(Player* player, Item* item, SpellCastTargets const & /*targets*/) { if (player->FindNearestCreature(26248, 15) || player->FindNearestCreature(26249, 15)) return false; else { - player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, pItem, NULL); + player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, item, NULL); return true; } } @@ -150,6 +151,7 @@ class item_mysterious_egg : public ItemScript { public: item_mysterious_egg() : ItemScript("item_mysterious_egg") { } + bool OnExpire(Player* player, ItemTemplate const* /*pItemProto*/) { ItemPosCountVec dest; @@ -219,7 +221,7 @@ class item_pile_fake_furs : public ItemScript public: item_pile_fake_furs() : ItemScript("item_pile_fake_furs") { } - bool OnUse(Player* player, Item* /*pItem*/, SpellCastTargets const & /*targets*/) + bool OnUse(Player* player, Item* /*item*/, SpellCastTargets const & /*targets*/) { GameObject* go = NULL; for (uint8 i = 0; i < CaribouTrapsNum; ++i) @@ -264,17 +266,17 @@ class item_petrov_cluster_bombs : public ItemScript public: item_petrov_cluster_bombs() : ItemScript("item_petrov_cluster_bombs") { } - bool OnUse(Player* player, Item* pItem, const SpellCastTargets & /*pTargets*/) + bool OnUse(Player* player, Item* item, const SpellCastTargets & /*targets*/) { if (player->GetZoneId() != ZONE_ID_HOWLING) return false; if (!player->GetTransport() || player->GetAreaId() != AREA_ID_SHATTERED_STRAITS) { - player->SendEquipError(EQUIP_ERR_NONE, pItem, NULL); + player->SendEquipError(EQUIP_ERR_NONE, item, NULL); - if (const SpellInfo* pSpellInfo = sSpellMgr->GetSpellInfo(SPELL_PETROV_BOMB)) - Spell::SendCastResult(player, pSpellInfo, 1, SPELL_FAILED_NOT_HERE); + if (const SpellInfo* spellInfo = sSpellMgr->GetSpellInfo(SPELL_PETROV_BOMB)) + Spell::SendCastResult(player, spellInfo, 1, SPELL_FAILED_NOT_HERE); return true; } @@ -330,17 +332,16 @@ class item_dehta_trap_smasher : public ItemScript public: item_dehta_trap_smasher() : ItemScript("item_dehta_trap_smasher") { } - bool OnUse(Player* player, Item* /*pItem*/, const SpellCastTargets & /*pTargets*/) + bool OnUse(Player* player, Item* /*item*/, const SpellCastTargets & /*targets*/) { if (player->GetQuestStatus(QUEST_CANNOT_HELP_THEMSELVES) != QUEST_STATUS_INCOMPLETE) return false; - Creature* pMammoth; - pMammoth = player->FindNearestCreature(NPC_TRAPPED_MAMMOTH_CALF, 5.0f); + Creature* pMammoth = player->FindNearestCreature(NPC_TRAPPED_MAMMOTH_CALF, 5.0f); if (!pMammoth) return false; - GameObject* pTrap; + GameObject* pTrap = NULL; for (uint8 i = 0; i < MammothTrapsNum; ++i) { pTrap = player->FindNearestGameObject(MammothTraps[i], 11.0f); @@ -367,7 +368,7 @@ class item_trident_of_nazjan : public ItemScript public: item_trident_of_nazjan() : ItemScript("item_Trident_of_Nazjan") { } - bool OnUse(Player* player, Item* pItem, const SpellCastTargets & /*pTargets*/) + bool OnUse(Player* player, Item* item, const SpellCastTargets & /*targets*/) { if (player->GetQuestStatus(QUEST_THE_EMISSARY) == QUEST_STATUS_INCOMPLETE) { @@ -376,9 +377,9 @@ public: pLeviroth->AI()->AttackStart(player); return false; } else - player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, pItem, NULL); + player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, item, NULL); } else - player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pItem, NULL); + player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL); return true; } }; @@ -394,17 +395,17 @@ class item_captured_frog : public ItemScript public: item_captured_frog() : ItemScript("item_captured_frog") { } - bool OnUse(Player* player, Item* pItem, SpellCastTargets const& /*targets*/) + bool OnUse(Player* player, Item* item, SpellCastTargets const& /*targets*/) { if (player->GetQuestStatus(QUEST_THE_PERFECT_SPIES) == QUEST_STATUS_INCOMPLETE) { if (player->FindNearestCreature(NPC_VANIRAS_SENTRY_TOTEM, 10.0f)) return false; else - player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, pItem, NULL); + player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, item, NULL); } else - player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pItem, NULL); + player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL); return true; } }; diff --git a/src/server/scripts/World/mob_generic_creature.cpp b/src/server/scripts/World/mob_generic_creature.cpp index 3a61b9f9e18..208effee61b 100644 --- a/src/server/scripts/World/mob_generic_creature.cpp +++ b/src/server/scripts/World/mob_generic_creature.cpp @@ -34,7 +34,7 @@ public: struct generic_creatureAI : public ScriptedAI { - generic_creatureAI(Creature* c) : ScriptedAI(c) {} + generic_creatureAI(Creature* creature) : ScriptedAI(creature) {} uint32 GlobalCooldown; //This variable acts like the global cooldown that players have (1.5 seconds) uint32 BuffTimer; //This variable keeps track of buffs @@ -105,7 +105,7 @@ public: else info = SelectSpell(me->getVictim(), 0, 0, SELECT_TARGET_ANY_ENEMY, 0, 0, 0, 0, SELECT_EFFECT_DONTCARE); //50% chance if elite or higher, 20% chance if not, to replace our white hit with a spell - if (info && (rand() % (me->GetCreatureInfo()->rank > 1 ? 2 : 5) == 0) && !GlobalCooldown) + if (info && (rand() % (me->GetCreatureTemplate()->rank > 1 ? 2 : 5) == 0) && !GlobalCooldown) { //Cast the spell if (Healing)DoCastSpell(me, info); @@ -174,7 +174,7 @@ public: struct trigger_periodicAI : public NullCreatureAI { - trigger_periodicAI(Creature* c) : NullCreatureAI(c) + trigger_periodicAI(Creature* creature) : NullCreatureAI(creature) { spell = me->m_spells[0] ? sSpellMgr->GetSpellInfo(me->m_spells[0]) : NULL; interval = me->GetAttackTime(BASE_ATTACK); @@ -210,7 +210,7 @@ public: struct trigger_deathAI : public NullCreatureAI { - trigger_deathAI(Creature* c) : NullCreatureAI(c) {} + trigger_deathAI(Creature* creature) : NullCreatureAI(creature) {} void JustDied(Unit* killer) { if (me->m_spells[0]) diff --git a/src/server/scripts/World/npc_innkeeper.cpp b/src/server/scripts/World/npc_innkeeper.cpp index 334eb48cb05..fb7c0833d22 100644 --- a/src/server/scripts/World/npc_innkeeper.cpp +++ b/src/server/scripts/World/npc_innkeeper.cpp @@ -79,10 +79,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF+HALLOWEEN_EVENTID && IsEventActive(HALLOWEEN_EVENTID) && !player->HasAura(SPELL_TRICK_OR_TREATED)) + if (action == GOSSIP_ACTION_INFO_DEF+HALLOWEEN_EVENTID && IsEventActive(HALLOWEEN_EVENTID) && !player->HasAura(SPELL_TRICK_OR_TREATED)) { player->CastSpell(player, SPELL_TRICK_OR_TREATED, true); @@ -116,7 +116,7 @@ public: player->CLOSE_GOSSIP_MENU(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_TRADE: player->GetSession()->SendListInventory(creature->GetGUID()); break; case GOSSIP_ACTION_INN: player->SetBindPoint(creature->GetGUID()); break; diff --git a/src/server/scripts/World/npc_professions.cpp b/src/server/scripts/World/npc_professions.cpp index 336e232236d..2afa80dd42c 100644 --- a/src/server/scripts/World/npc_professions.cpp +++ b/src/server/scripts/World/npc_professions.cpp @@ -83,11 +83,8 @@ there is no difference here (except that default text is chosen with `gameobject #define BOX_UNLEARN_WEAPON_SPEC "Do you really want to unlearn your weaponsmith specialty and lose all associated recipes? \n Cost: " -#define GOSSIP_LEARN_DRAGON "I am absolutely certain that i want to learn dragonscale leatherworking" #define GOSSIP_UNLEARN_DRAGON "I wish to unlearn Dragonscale Leatherworking" -#define GOSSIP_LEARN_ELEMENTAL "I am absolutely certain that i want to learn elemental leatherworking" #define GOSSIP_UNLEARN_ELEMENTAL "I wish to unlearn Elemental Leatherworking" -#define GOSSIP_LEARN_TRIBAL "I am absolutely certain that i want to learn tribal leatherworking" #define GOSSIP_UNLEARN_TRIBAL "I wish to unlearn Tribal Leatherworking" #define BOX_UNLEARN_LEATHER_SPEC "Do you really want to unlearn your leatherworking specialty and lose all associated recipes? \n Cost: " @@ -101,9 +98,6 @@ there is no difference here (except that default text is chosen with `gameobject #define BOX_UNLEARN_TAILOR_SPEC "Do you really want to unlearn your tailoring specialty and lose all associated recipes? \n Cost: " -#define GOSSIP_LEARN_GOBLIN "I am absolutely certain that i want to learn Goblin engineering" -#define GOSSIP_LEARN_GNOMISH "I am absolutely certain that i want to learn Gnomish engineering" - /*### # spells defines ###*/ @@ -213,7 +207,7 @@ int32 DoLowUnlearnCost(Player* player) //blacksmith return 100000; } -void ProcessCastAction(Player* player, Creature* creature, uint32 spellId, uint32 triggeredSpellId, int32 cost) +void ProcessCastaction(Player* player, Creature* creature, uint32 spellId, uint32 triggeredSpellId, int32 cost) { if (!(spellId && player->HasSpell(spellId)) && player->HasEnoughMoney(cost)) { @@ -241,14 +235,14 @@ bool EquippedOk(Player* player, uint32 spellId) if (!reqSpell) continue; - Item* pItem; + Item* item = NULL; for (uint8 j = EQUIPMENT_SLOT_START; j < EQUIPMENT_SLOT_END; ++j) { - pItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, j); - if (pItem && pItem->GetTemplate()->RequiredSpell == reqSpell) + item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, j); + if (item && item->GetTemplate()->RequiredSpell == reqSpell) { //player has item equipped that require specialty. Not allow to unlearn, player has to unequip first - sLog->outDebug(LOG_FILTER_TSCR, "TSCR: player attempt to unlearn spell %u, but item %u is equipped.", reqSpell, pItem->GetEntry()); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: player attempt to unlearn spell %u, but item %u is equipped.", reqSpell, item->GetEntry()); return false; } } @@ -387,8 +381,10 @@ public: { if (creature->isQuestGiver()) player->PrepareQuestMenu(creature->GetGUID()); + if (creature->isVendor()) player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + if (creature->isTrainer()) player->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, GOSSIP_TEXT_TRAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN); @@ -424,9 +420,9 @@ public: return true; } - void SendActionMenu(Player* player, Creature* creature, uint32 uiAction) + void SendActionMenu(Player* player, Creature* creature, uint32 action) { - switch (uiAction) + switch (action) { case GOSSIP_ACTION_TRADE: player->GetSession()->SendListInventory(creature->GetGUID()); @@ -436,45 +432,45 @@ public: break; //Learn Alchemy case GOSSIP_ACTION_INFO_DEF + 1: - ProcessCastAction(player, creature, S_TRANSMUTE, S_LEARN_TRANSMUTE, DoLearnCost(player)); + ProcessCastaction(player, creature, S_TRANSMUTE, S_LEARN_TRANSMUTE, DoLearnCost(player)); break; case GOSSIP_ACTION_INFO_DEF + 2: - ProcessCastAction(player, creature, S_ELIXIR, S_LEARN_ELIXIR, DoLearnCost(player)); + ProcessCastaction(player, creature, S_ELIXIR, S_LEARN_ELIXIR, DoLearnCost(player)); break; case GOSSIP_ACTION_INFO_DEF + 3: - ProcessCastAction(player, creature, S_POTION, S_LEARN_POTION, DoLearnCost(player)); + ProcessCastaction(player, creature, S_POTION, S_LEARN_POTION, DoLearnCost(player)); break; //Unlearn Alchemy case GOSSIP_ACTION_INFO_DEF + 4: - ProcessCastAction(player, creature, 0, S_UNLEARN_TRANSMUTE, DoHighUnlearnCost(player)); + ProcessCastaction(player, creature, 0, S_UNLEARN_TRANSMUTE, DoHighUnlearnCost(player)); break; case GOSSIP_ACTION_INFO_DEF + 5: - ProcessCastAction(player, creature, 0, S_UNLEARN_ELIXIR, DoHighUnlearnCost(player)); + ProcessCastaction(player, creature, 0, S_UNLEARN_ELIXIR, DoHighUnlearnCost(player)); break; case GOSSIP_ACTION_INFO_DEF + 6: - ProcessCastAction(player, creature, 0, S_UNLEARN_POTION, DoHighUnlearnCost(player)); + ProcessCastaction(player, creature, 0, S_UNLEARN_POTION, DoHighUnlearnCost(player)); break; } } - void SendConfirmLearn(Player* player, Creature* creature, uint32 uiAction) + void SendConfirmLearn(Player* player, Creature* creature, uint32 action) { - if (uiAction) + if (action) { switch (creature->GetEntry()) { case 22427: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_TRANSMUTE, GOSSIP_SENDER_CHECK, uiAction); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_TRANSMUTE, GOSSIP_SENDER_CHECK, action); //unknown textID () player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); break; case 19052: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_ELIXIR, GOSSIP_SENDER_CHECK, uiAction); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_ELIXIR, GOSSIP_SENDER_CHECK, action); //unknown textID () player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); break; case 17909: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_POTION, GOSSIP_SENDER_CHECK, uiAction); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_POTION, GOSSIP_SENDER_CHECK, action); //unknown textID () player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); break; @@ -482,24 +478,24 @@ public: } } - void SendConfirmUnlearn(Player* player, Creature* creature, uint32 uiAction) + void SendConfirmUnlearn(Player* player, Creature* creature, uint32 action) { - if (uiAction) + if (action) { switch (creature->GetEntry()) { case 22427: //Zarevhi - player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_TRANSMUTE, GOSSIP_SENDER_CHECK, uiAction, BOX_UNLEARN_ALCHEMY_SPEC, DoHighUnlearnCost(player), false); + player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_TRANSMUTE, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_ALCHEMY_SPEC, DoHighUnlearnCost(player), false); //unknown textID () player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); break; case 19052: //Lorokeem - player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_ELIXIR, GOSSIP_SENDER_CHECK, uiAction, BOX_UNLEARN_ALCHEMY_SPEC, DoHighUnlearnCost(player), false); + player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_ELIXIR, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_ALCHEMY_SPEC, DoHighUnlearnCost(player), false); //unknown textID () player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); break; case 17909: //Lauranna Thar'well - player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_POTION, GOSSIP_SENDER_CHECK, uiAction, BOX_UNLEARN_ALCHEMY_SPEC, DoHighUnlearnCost(player), false); + player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_POTION, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_ALCHEMY_SPEC, DoHighUnlearnCost(player), false); //unknown textID () player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); break; @@ -507,15 +503,26 @@ public: } } - bool OnGossipSelect(Player* player, Creature* creature, uint32 uiSender, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiSender) + switch (sender) { - case GOSSIP_SENDER_MAIN: SendActionMenu(player, creature, uiAction); break; - case GOSSIP_SENDER_LEARN: SendConfirmLearn(player, creature, uiAction); break; - case GOSSIP_SENDER_UNLEARN: SendConfirmUnlearn(player, creature, uiAction); break; - case GOSSIP_SENDER_CHECK: SendActionMenu(player, creature, uiAction); break; + case GOSSIP_SENDER_MAIN: + SendActionMenu(player, creature, action); + break; + + case GOSSIP_SENDER_LEARN: + SendConfirmLearn(player, creature, action); + break; + + case GOSSIP_SENDER_UNLEARN: + SendConfirmUnlearn(player, creature, action); + break; + + case GOSSIP_SENDER_CHECK: + SendActionMenu(player, creature, action); + break; } return true; } @@ -539,16 +546,18 @@ public: { if (creature->isQuestGiver()) player->PrepareQuestMenu(creature->GetGUID()); + if (creature->isVendor()) player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + if (creature->isTrainer()) player->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, GOSSIP_TEXT_TRAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN); - uint32 eCreature = creature->GetEntry(); + uint32 creatureId = creature->GetEntry(); //WEAPONSMITH & ARMORSMITH if (player->GetBaseSkillValue(SKILL_BLACKSMITHING) >= 225) { - switch (eCreature) + switch (creatureId) { case 11145: //Myolor Sunderfury case 11176: //Krathok Moltenfist @@ -572,7 +581,7 @@ public: //WEAPONSMITH SPEC if (player->HasSpell(S_WEAPON) && player->getLevel() > 49 && player->GetBaseSkillValue(SKILL_BLACKSMITHING) >= 250) { - switch (eCreature) + switch (creatureId) { case 11191: //Lilith the Lithe if (!HasWeaponSub(player)) @@ -599,9 +608,9 @@ public: return true; } - void SendActionMenu(Player* player, Creature* creature, uint32 uiAction) + void SendActionMenu(Player* player, Creature* creature, uint32 action) { - switch (uiAction) + switch (action) { case GOSSIP_ACTION_TRADE: player->GetSession()->SendListInventory(creature->GetGUID()); @@ -665,24 +674,24 @@ public: } } - void SendConfirmLearn(Player* player, Creature* creature, uint32 uiAction) + void SendConfirmLearn(Player* player, Creature* creature, uint32 action) { - if (uiAction) + if (action) { switch (creature->GetEntry()) { case 11191: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_HAMMER, GOSSIP_SENDER_CHECK, uiAction); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_HAMMER, GOSSIP_SENDER_CHECK, action); //unknown textID (TALK_HAMMER_LEARN) player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); break; case 11192: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_AXE, GOSSIP_SENDER_CHECK, uiAction); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_AXE, GOSSIP_SENDER_CHECK, action); //unknown textID (TALK_AXE_LEARN) player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); break; case 11193: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_SWORD, GOSSIP_SENDER_CHECK, uiAction); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_SWORD, GOSSIP_SENDER_CHECK, action); //unknown textID (TALK_SWORD_LEARN) player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); break; @@ -690,9 +699,9 @@ public: } } - void SendConfirmUnlearn(Player* player, Creature* creature, uint32 uiAction) + void SendConfirmUnlearn(Player* player, Creature* creature, uint32 action) { - if (uiAction) + if (action) { switch (creature->GetEntry()) { @@ -700,23 +709,23 @@ public: case 11178: //Borgosh Corebender case 5164: //Grumnus Steelshaper case 11177: //Okothos Ironrager - player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_SMITH_SPEC, GOSSIP_SENDER_CHECK, uiAction, BOX_UNLEARN_ARMORORWEAPON, DoLowUnlearnCost(player), false); + player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_SMITH_SPEC, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_ARMORORWEAPON, DoLowUnlearnCost(player), false); //unknown textID (TALK_UNLEARN_AXEORWEAPON) player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); break; case 11191: - player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_HAMMER, GOSSIP_SENDER_CHECK, uiAction, BOX_UNLEARN_WEAPON_SPEC, DoMedUnlearnCost(player), false); + player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_HAMMER, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_WEAPON_SPEC, DoMedUnlearnCost(player), false); //unknown textID (TALK_HAMMER_UNLEARN) player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); break; case 11192: - player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_AXE, GOSSIP_SENDER_CHECK, uiAction, BOX_UNLEARN_WEAPON_SPEC, DoMedUnlearnCost(player), false); + player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_AXE, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_WEAPON_SPEC, DoMedUnlearnCost(player), false); //unknown textID (TALK_AXE_UNLEARN) player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); break; case 11193: - player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_SWORD, GOSSIP_SENDER_CHECK, uiAction, BOX_UNLEARN_WEAPON_SPEC, DoMedUnlearnCost(player), false); + player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_SWORD, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_WEAPON_SPEC, DoMedUnlearnCost(player), false); //unknown textID (TALK_SWORD_UNLEARN) player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); break; @@ -724,15 +733,26 @@ public: } } - bool OnGossipSelect(Player* player, Creature* creature, uint32 uiSender, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiSender) + switch (sender) { - case GOSSIP_SENDER_MAIN: SendActionMenu(player, creature, uiAction); break; - case GOSSIP_SENDER_LEARN: SendConfirmLearn(player, creature, uiAction); break; - case GOSSIP_SENDER_UNLEARN: SendConfirmUnlearn(player, creature, uiAction); break; - case GOSSIP_SENDER_CHECK: SendActionMenu(player, creature, uiAction); break; + case GOSSIP_SENDER_MAIN: + SendActionMenu(player, creature, action); + break; + + case GOSSIP_SENDER_LEARN: + SendConfirmLearn(player, creature, action); + break; + + case GOSSIP_SENDER_UNLEARN: + SendConfirmUnlearn(player, creature, action); + break; + + case GOSSIP_SENDER_CHECK: + SendActionMenu(player, creature, action); + break; } return true; } @@ -763,7 +783,6 @@ enum eEngineeringTrinkets #define GOSSIP_ITEM_ZAP "[PH] Unknown" #define GOSSIP_ITEM_JHORDY "I must build a beacon for this marvelous device!" #define GOSSIP_ITEM_KABLAM "[PH] Unknown" -#define GOSSIP_ITEM_SMILES "[PH] Unknown" class npc_engineering_tele_trinket : public CreatureScript { @@ -824,16 +843,16 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 uiSender, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action) { player->PlayerTalkClass->ClearMenus(); - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + if (action == GOSSIP_ACTION_INFO_DEF + 1) player->CLOSE_GOSSIP_MENU(); - if (uiSender != creature->GetEntry()) + if (sender != creature->GetEntry()) return true; - switch (uiSender) + switch (sender) { case NPC_ZAP: player->CastSpell(player, SPELL_LEARN_TO_EVERLOOK, false); @@ -866,8 +885,10 @@ public: { if (creature->isQuestGiver()) player->PrepareQuestMenu(creature->GetGUID()); + if (creature->isVendor()) player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + if (creature->isTrainer()) player->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, GOSSIP_TEXT_TRAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN); @@ -897,9 +918,9 @@ public: return true; } - void SendActionMenu(Player* player, Creature* creature, uint32 uiAction) + void SendActionMenu(Player* player, Creature* creature, uint32 action) { - switch (uiAction) + switch (action) { case GOSSIP_ACTION_TRADE: player->GetSession()->SendListInventory(creature->GetGUID()); @@ -920,27 +941,27 @@ public: } } - void SendConfirmUnlearn(Player* player, Creature* creature, uint32 uiAction) + void SendConfirmUnlearn(Player* player, Creature* creature, uint32 action) { - if (uiAction) + if (action) { switch (creature->GetEntry()) { case 7866: //Peter Galen case 7867: //Thorkaf Dragoneye - player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_DRAGON, GOSSIP_SENDER_CHECK, uiAction, BOX_UNLEARN_LEATHER_SPEC, DoMedUnlearnCost(player), false); + player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_DRAGON, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_LEATHER_SPEC, DoMedUnlearnCost(player), false); //unknown textID () player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); break; case 7868: //Sarah Tanner case 7869: //Brumn Winterhoof - player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_ELEMENTAL, GOSSIP_SENDER_CHECK, uiAction, BOX_UNLEARN_LEATHER_SPEC, DoMedUnlearnCost(player), false); + player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_ELEMENTAL, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_LEATHER_SPEC, DoMedUnlearnCost(player), false); //unknown textID () player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); break; case 7870: //Caryssia Moonhunter case 7871: //Se'Jib - player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_TRIBAL, GOSSIP_SENDER_CHECK, uiAction, BOX_UNLEARN_LEATHER_SPEC, DoMedUnlearnCost(player), false); + player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_TRIBAL, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_LEATHER_SPEC, DoMedUnlearnCost(player), false); //unknown textID () player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); break; @@ -948,14 +969,22 @@ public: } } - bool OnGossipSelect(Player* player, Creature* creature, uint32 uiSender, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiSender) + switch (sender) { - case GOSSIP_SENDER_MAIN: SendActionMenu(player, creature, uiAction); break; - case GOSSIP_SENDER_UNLEARN: SendConfirmUnlearn(player, creature, uiAction); break; - case GOSSIP_SENDER_CHECK: SendActionMenu(player, creature, uiAction); break; + case GOSSIP_SENDER_MAIN: + SendActionMenu(player, creature, action); + break; + + case GOSSIP_SENDER_UNLEARN: + SendConfirmUnlearn(player, creature, action); + break; + + case GOSSIP_SENDER_CHECK: + SendActionMenu(player, creature, action); + break; } return true; } @@ -979,8 +1008,10 @@ public: { if (creature->isQuestGiver()) player->PrepareQuestMenu(creature->GetGUID()); + if (creature->isVendor()) player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + if (creature->isTrainer()) player->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, GOSSIP_TEXT_TRAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN); @@ -1017,9 +1048,9 @@ public: return true; } - void SendActionMenu(Player* player, Creature* creature, uint32 uiAction) + void SendActionMenu(Player* player, Creature* creature, uint32 action) { - switch (uiAction) + switch (action) { case GOSSIP_ACTION_TRADE: player->GetSession()->SendListInventory(creature->GetGUID()); @@ -1029,13 +1060,13 @@ public: break; //Learn Tailor case GOSSIP_ACTION_INFO_DEF + 1: - ProcessCastAction(player, creature, S_SPELLFIRE, S_LEARN_SPELLFIRE, DoLearnCost(player)); + ProcessCastaction(player, creature, S_SPELLFIRE, S_LEARN_SPELLFIRE, DoLearnCost(player)); break; case GOSSIP_ACTION_INFO_DEF + 2: - ProcessCastAction(player, creature, S_MOONCLOTH, S_LEARN_MOONCLOTH, DoLearnCost(player)); + ProcessCastaction(player, creature, S_MOONCLOTH, S_LEARN_MOONCLOTH, DoLearnCost(player)); break; case GOSSIP_ACTION_INFO_DEF + 3: - ProcessCastAction(player, creature, S_SHADOWEAVE, S_LEARN_SHADOWEAVE, DoLearnCost(player)); + ProcessCastaction(player, creature, S_SHADOWEAVE, S_LEARN_SHADOWEAVE, DoLearnCost(player)); break; //Unlearn Tailor case GOSSIP_ACTION_INFO_DEF + 4: @@ -1050,24 +1081,24 @@ public: } } - void SendConfirmLearn(Player* player, Creature* creature, uint32 uiAction) + void SendConfirmLearn(Player* player, Creature* creature, uint32 action) { - if (uiAction) + if (action) { switch (creature->GetEntry()) { case 22213: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_SPELLFIRE, GOSSIP_SENDER_CHECK, uiAction); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_SPELLFIRE, GOSSIP_SENDER_CHECK, action); //unknown textID () player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); break; case 22208: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_MOONCLOTH, GOSSIP_SENDER_CHECK, uiAction); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_MOONCLOTH, GOSSIP_SENDER_CHECK, action); //unknown textID () player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); break; case 22212: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_SHADOWEAVE, GOSSIP_SENDER_CHECK, uiAction); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_SHADOWEAVE, GOSSIP_SENDER_CHECK, action); //unknown textID () player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); break; @@ -1075,24 +1106,24 @@ public: } } - void SendConfirmUnlearn(Player* player, Creature* creature, uint32 uiAction) + void SendConfirmUnlearn(Player* player, Creature* creature, uint32 action) { - if (uiAction) + if (action) { switch (creature->GetEntry()) { case 22213: //Gidge Spellweaver - player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_SPELLFIRE, GOSSIP_SENDER_CHECK, uiAction, BOX_UNLEARN_TAILOR_SPEC, DoHighUnlearnCost(player), false); + player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_SPELLFIRE, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_TAILOR_SPEC, DoHighUnlearnCost(player), false); //unknown textID () player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); break; case 22208: //Nasmara Moonsong - player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_MOONCLOTH, GOSSIP_SENDER_CHECK, uiAction, BOX_UNLEARN_TAILOR_SPEC, DoHighUnlearnCost(player), false); + player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_MOONCLOTH, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_TAILOR_SPEC, DoHighUnlearnCost(player), false); //unknown textID () player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); break; case 22212: //Andrion Darkspinner - player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_SHADOWEAVE, GOSSIP_SENDER_CHECK, uiAction, BOX_UNLEARN_TAILOR_SPEC, DoHighUnlearnCost(player), false); + player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_SHADOWEAVE, GOSSIP_SENDER_CHECK, action, BOX_UNLEARN_TAILOR_SPEC, DoHighUnlearnCost(player), false); //unknown textID () player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); break; @@ -1100,29 +1131,36 @@ public: } } - bool OnGossipSelect(Player* player, Creature* creature, uint32 uiSender, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiSender) + switch (sender) { - case GOSSIP_SENDER_MAIN: SendActionMenu(player, creature, uiAction); break; - case GOSSIP_SENDER_LEARN: SendConfirmLearn(player, creature, uiAction); break; - case GOSSIP_SENDER_UNLEARN: SendConfirmUnlearn(player, creature, uiAction); break; - case GOSSIP_SENDER_CHECK: SendActionMenu(player, creature, uiAction); break; + case GOSSIP_SENDER_MAIN: + SendActionMenu(player, creature, action); + break; + + case GOSSIP_SENDER_LEARN: + SendConfirmLearn(player, creature, action); + break; + + case GOSSIP_SENDER_UNLEARN: + SendConfirmUnlearn(player, creature, action); + break; + + case GOSSIP_SENDER_CHECK: + SendActionMenu(player, creature, action); + break; } return true; } }; -/*### -# -###*/ - void AddSC_npc_professions() { - new npc_prof_alchemy; - new npc_prof_blacksmith; - new npc_engineering_tele_trinket; - new npc_prof_leather; - new npc_prof_tailor; + new npc_prof_alchemy(); + new npc_prof_blacksmith(); + new npc_engineering_tele_trinket(); + new npc_prof_leather(); + new npc_prof_tailor(); } diff --git a/src/server/scripts/World/npc_taxi.cpp b/src/server/scripts/World/npc_taxi.cpp index aff326e152d..ceda8e0f6ac 100644 --- a/src/server/scripts/World/npc_taxi.cpp +++ b/src/server/scripts/World/npc_taxi.cpp @@ -38,7 +38,7 @@ EndScriptData #define GOSSIP_BRACK2 "Fly me to The Abyssal Shelf" #define GOSSIP_BRACK3 "Fly me to Spinebreaker Post" #define GOSSIP_IRENA "Fly me to Skettis please" -#define GOSSIP_CLOUDBREAKER1 "Speaking of uiAction, I've been ordered to undertake an air strike." +#define GOSSIP_CLOUDBREAKER1 "Speaking of action, I've been ordered to undertake an air strike." #define GOSSIP_CLOUDBREAKER2 "I need to intercept the Dawnblade reinforcements." #define GOSSIP_DRAGONHAWK "" #define GOSSIP_VERONIA "Fly me to Manaforge Coruu please" @@ -186,10 +186,10 @@ public: return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); - switch (uiAction) + switch (action) { case GOSSIP_ACTION_INFO_DEF: //spellId is correct, however it gives flight a somewhat funny effect //TaxiPath 506. @@ -201,9 +201,10 @@ public: player->ActivateTaxiPathTo(627); //TaxiPath 627 (possibly 627+628(152->153->154->155)) break; case GOSSIP_ACTION_INFO_DEF + 2: - if (!player->HasItemCount(25853, 1)) { + if (!player->HasItemCount(25853, 1)) player->SEND_GOSSIP_MENU(9780, creature->GetGUID()); - } else { + else + { player->CLOSE_GOSSIP_MENU(); player->ActivateTaxiPathTo(534); //TaxiPath 534 } diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index 1e1e34431a2..ecd1a439a58 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -137,8 +137,8 @@ public: if (!spawnedTemplate) { - SpawnAssoc = NULL; sLog->outErrorDb("TCSR: Creature template entry %u does not exist in DB, which is required by npc_air_force_bots", SpawnAssoc->spawnedCreatureEntry); + SpawnAssoc = NULL; return; } } @@ -315,7 +315,7 @@ public: struct npc_chicken_cluckAI : public ScriptedAI { - npc_chicken_cluckAI(Creature* c) : ScriptedAI(c) {} + npc_chicken_cluckAI(Creature* creature) : ScriptedAI(creature) {} uint32 ResetFlagTimer; @@ -407,7 +407,7 @@ public: struct npc_dancing_flamesAI : public ScriptedAI { - npc_dancing_flamesAI(Creature* c) : ScriptedAI(c) {} + npc_dancing_flamesAI(Creature* creature) : ScriptedAI(creature) {} bool Active; uint32 CanIteract; @@ -421,7 +421,7 @@ public: float x, y, z; me->GetPosition(x, y, z); me->Relocate(x, y, z + 0.94f); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetDisableGravity(true); me->HandleEmoteCommand(EMOTE_ONESHOT_DANCE); WorldPacket data; //send update position to client me->BuildHeartBeatMsg(&data); @@ -558,7 +558,7 @@ public: struct npc_doctorAI : public ScriptedAI { - npc_doctorAI(Creature* c) : ScriptedAI(c) {} + npc_doctorAI(Creature* creature) : ScriptedAI(creature) {} uint64 PlayerGUID; @@ -703,7 +703,7 @@ public: struct npc_injured_patientAI : public ScriptedAI { - npc_injured_patientAI(Creature* c) : ScriptedAI(c) {} + npc_injured_patientAI(Creature* creature) : ScriptedAI(creature) {} uint64 DoctorGUID; Location* Coord; @@ -764,7 +764,7 @@ public: DoScriptText(RAND(SAY_DOC1, SAY_DOC2, SAY_DOC3), me); uint32 mobId = me->GetEntry(); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + me->SetWalk(false); switch (mobId) { @@ -905,7 +905,7 @@ public: struct npc_garments_of_questsAI : public npc_escortAI { - npc_garments_of_questsAI(Creature* c) : npc_escortAI(c) {Reset();} + npc_garments_of_questsAI(Creature* creature) : npc_escortAI(creature) {Reset();} uint64 CasterGUID; @@ -1040,8 +1040,9 @@ public: } } - void WaypointReached(uint32 /*point*/) + void WaypointReached(uint32 /*waypointId*/) { + } void UpdateAI(uint32 const diff) @@ -1105,7 +1106,7 @@ public: struct npc_guardianAI : public ScriptedAI { - npc_guardianAI(Creature* c) : ScriptedAI(c) {} + npc_guardianAI(Creature* creature) : ScriptedAI(creature) {} void Reset() { @@ -1477,7 +1478,7 @@ public: struct npc_steam_tonkAI : public ScriptedAI { - npc_steam_tonkAI(Creature* c) : ScriptedAI(c) {} + npc_steam_tonkAI(Creature* creature) : ScriptedAI(creature) {} void Reset() {} void EnterCombat(Unit* /*who*/) {} @@ -1495,7 +1496,6 @@ public: else me->SetReactState(REACT_AGGRESSIVE); } - }; CreatureAI* GetAI(Creature* creature) const @@ -1513,7 +1513,7 @@ public: struct npc_tonk_mineAI : public ScriptedAI { - npc_tonk_mineAI(Creature* c) : ScriptedAI(c) + npc_tonk_mineAI(Creature* creature) : ScriptedAI(creature) { me->SetReactState(REACT_PASSIVE); } @@ -1558,7 +1558,7 @@ public: struct npc_brewfest_revelerAI : public ScriptedAI { - npc_brewfest_revelerAI(Creature* c) : ScriptedAI(c) {} + npc_brewfest_revelerAI(Creature* creature) : ScriptedAI(creature) {} void ReceiveEmote(Player* player, uint32 emote) { if (!IsHolidayActive(HOLIDAY_BREWFEST)) @@ -1594,7 +1594,7 @@ class npc_winter_reveler : public CreatureScript struct npc_winter_revelerAI : public ScriptedAI { - npc_winter_revelerAI(Creature* c) : ScriptedAI(c) {} + npc_winter_revelerAI(Creature* creature) : ScriptedAI(creature) {} void ReceiveEmote(Player* player, uint32 emote) { @@ -1639,7 +1639,7 @@ public: struct npc_snake_trap_serpentsAI : public ScriptedAI { - npc_snake_trap_serpentsAI(Creature* c) : ScriptedAI(c) {} + npc_snake_trap_serpentsAI(Creature* creature) : ScriptedAI(creature) {} uint32 SpellTimer; bool IsViper; @@ -1650,7 +1650,7 @@ public: { SpellTimer = 0; - CreatureTemplate const* Info = me->GetCreatureInfo(); + CreatureTemplate const* Info = me->GetCreatureTemplate(); IsViper = Info->Entry == C_VIPER ? true : false; @@ -1753,15 +1753,13 @@ public: struct mob_mojoAI : public ScriptedAI { - mob_mojoAI(Creature* c) : ScriptedAI(c) {Reset();} - - uint32 Hearts; - uint64 VictimGUID; - + mob_mojoAI(Creature* creature) : ScriptedAI(creature) {Reset();} + uint32 hearts; + uint64 victimGUID; void Reset() { - VictimGUID = 0; - Hearts = 15000; + victimGUID = 0; + hearts = 15000; if (Unit* own = me->GetOwner()) me->GetMotionMaster()->MoveFollow(own, 0, 0); } @@ -1772,12 +1770,11 @@ public: { if (me->HasAura(20372)) { - if (Hearts <= diff) + if (hearts <= diff) { me->RemoveAurasDueToSpell(20372); - Hearts = 15000; - } - Hearts -= diff; + hearts = 15000; + } hearts -= diff; } } @@ -1821,14 +1818,14 @@ public: } me->MonsterWhisper(whisp.c_str(), player->GetGUID()); - if (VictimGUID) - if (Player* victim = Unit::GetPlayer(*me, VictimGUID)) + if (victimGUID) + if (Player* victim = Unit::GetPlayer(*me, victimGUID)) victim->RemoveAura(43906);//remove polymorph frog thing me->AddAura(43906, player);//add polymorph frog thing - VictimGUID = player->GetGUID(); + victimGUID = player->GetGUID(); DoCast(me, 20372, true);//tag.hearts me->GetMotionMaster()->MoveFollow(player, 0, 0); - Hearts = 15000; + hearts = 15000; } } }; @@ -1846,7 +1843,7 @@ public: struct npc_mirror_imageAI : CasterAI { - npc_mirror_imageAI(Creature* c) : CasterAI(c) {} + npc_mirror_imageAI(Creature* creature) : CasterAI(creature) {} void InitializeAI() { @@ -1892,9 +1889,9 @@ public: struct npc_ebon_gargoyleAI : CasterAI { - npc_ebon_gargoyleAI(Creature* c) : CasterAI(c) {} + npc_ebon_gargoyleAI(Creature* creature) : CasterAI(creature) {} - uint32 DespawnTimer; + uint32 despawnTimer; void InitializeAI() { @@ -1903,7 +1900,7 @@ public: if (!ownerGuid) return; // Not needed to be despawned now - DespawnTimer = 0; + despawnTimer = 0; // Find victim of Summon Gargoyle spell std::list targets; Trinity::AnyUnfriendlyUnitInObjectRangeCheck u_check(me, me, 30); @@ -1941,6 +1938,7 @@ public: me->CastSpell(me, 54661, true); me->SetReactState(REACT_PASSIVE); + //! HACK: Creature's can't have MOVEMENTFLAG_FLYING // Fly Away me->AddUnitMovementFlag(MOVEMENTFLAG_CAN_FLY|MOVEMENTFLAG_ASCENDING|MOVEMENTFLAG_FLYING); me->SetSpeed(MOVE_FLIGHT, 0.75f, true); @@ -1952,15 +1950,15 @@ public: me->GetMotionMaster()->MovePoint(0, x, y, z); // Despawn as soon as possible - DespawnTimer = 4 * IN_MILLISECONDS; + despawnTimer = 4 * IN_MILLISECONDS; } void UpdateAI(const uint32 diff) { - if (DespawnTimer > 0) + if (despawnTimer > 0) { - if (DespawnTimer > diff) - DespawnTimer -= diff; + if (despawnTimer > diff) + despawnTimer -= diff; else me->DespawnOrUnsummon(); return; @@ -1977,33 +1975,31 @@ public: class npc_lightwell : public CreatureScript { -public: - npc_lightwell() : CreatureScript("npc_lightwell") { } - - struct npc_lightwellAI : public PassiveAI - { - npc_lightwellAI(Creature* c) : PassiveAI(c) {} + public: + npc_lightwell() : CreatureScript("npc_lightwell") { } - void Reset() + struct npc_lightwellAI : public PassiveAI { - DoCast(me, 59907, false); // Spell for Lightwell Charges - } + npc_lightwellAI(Creature* creature) : PassiveAI(creature) + { + DoCast(me, 59907, false); + } - void EnterEvadeMode() - { - if (!me->isAlive()) - return; + void EnterEvadeMode() + { + if (!me->isAlive()) + return; - me->DeleteThreatList(); - me->CombatStop(true); - me->ResetPlayerDamageReq(); - } - }; + me->DeleteThreatList(); + me->CombatStop(true); + me->ResetPlayerDamageReq(); + } + }; - CreatureAI* GetAI(Creature* creature) const - { - return new npc_lightwellAI(creature); - } + CreatureAI* GetAI(Creature* creature) const + { + return new npc_lightwellAI(creature); + } }; enum eTrainingDummy @@ -2021,20 +2017,20 @@ public: { npc_training_dummyAI(Creature* creature) : Scripted_NoMovementAI(creature) { - Entry = creature->GetEntry(); + entry = creature->GetEntry(); } - uint32 Entry; - uint32 ResetTimer; - uint32 DespawnTimer; + uint32 entry; + uint32 resetTimer; + uint32 despawnTimer; void Reset() { me->SetControlled(true, UNIT_STATE_STUNNED);//disable rotate me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);//imune to knock aways like blast wave - ResetTimer = 5000; - DespawnTimer = 15000; + resetTimer = 5000; + despawnTimer = 15000; } void EnterEvadeMode() @@ -2047,13 +2043,13 @@ public: void DamageTaken(Unit* /*doneBy*/, uint32& damage) { - ResetTimer = 5000; + resetTimer = 5000; damage = 0; } void EnterCombat(Unit* /*who*/) { - if (Entry != NPC_ADVANCED_TARGET_DUMMY && Entry != NPC_TARGET_DUMMY) + if (entry != NPC_ADVANCED_TARGET_DUMMY && entry != NPC_TARGET_DUMMY) return; } @@ -2065,23 +2061,23 @@ public: if (!me->HasUnitState(UNIT_STATE_STUNNED)) me->SetControlled(true, UNIT_STATE_STUNNED);//disable rotate - if (Entry != NPC_ADVANCED_TARGET_DUMMY && Entry != NPC_TARGET_DUMMY) + if (entry != NPC_ADVANCED_TARGET_DUMMY && entry != NPC_TARGET_DUMMY) { - if (ResetTimer <= diff) + if (resetTimer <= diff) { EnterEvadeMode(); - ResetTimer = 5000; + resetTimer = 5000; } else - ResetTimer -= diff; + resetTimer -= diff; return; } else { - if (DespawnTimer <= diff) + if (despawnTimer <= diff) me->DespawnOrUnsummon(); else - DespawnTimer -= diff; + despawnTimer -= diff; } } void MoveInLineOfSight(Unit* /*who*/){return;} @@ -2101,34 +2097,26 @@ public: class npc_shadowfiend : public CreatureScript { -public: - npc_shadowfiend() : CreatureScript("npc_shadowfiend") { } - - struct npc_shadowfiendAI : public ScriptedAI - { - npc_shadowfiendAI(Creature* creature) : ScriptedAI(creature) {} + public: + npc_shadowfiend() : CreatureScript("npc_shadowfiend") { } - void DamageTaken(Unit* /*killer*/, uint32& damage) + struct npc_shadowfiendAI : public ScriptedAI { - if (me->isSummon()) - if (Unit* owner = me->ToTempSummon()->GetSummoner()) - if (owner->HasAura(GLYPH_OF_SHADOWFIEND) && damage >= me->GetHealth()) - owner->CastSpell(owner, GLYPH_OF_SHADOWFIEND_MANA, true); - } + npc_shadowfiendAI(Creature* creature) : ScriptedAI(creature) {} - void UpdateAI(uint32 const /*diff*/) - { - if (!UpdateVictim()) - return; + void DamageTaken(Unit* /*killer*/, uint32& damage) + { + if (me->isSummon()) + if (Unit* owner = me->ToTempSummon()->GetSummoner()) + if (owner->HasAura(GLYPH_OF_SHADOWFIEND) && damage >= me->GetHealth()) + owner->CastSpell(owner, GLYPH_OF_SHADOWFIEND_MANA, true); + } + }; - DoMeleeAttackIfReady(); + CreatureAI* GetAI(Creature* creature) const + { + return new npc_shadowfiendAI(creature); } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_shadowfiendAI(creature); - } }; /*###### @@ -2195,7 +2183,7 @@ public: } }; - CreatureAI *GetAI(Creature* creature) const + CreatureAI* GetAI(Creature* creature) const { return new npc_fire_elementalAI(creature); } @@ -2240,7 +2228,7 @@ public: } }; - CreatureAI *GetAI(Creature* creature) const + CreatureAI* GetAI(Creature* creature) const { return new npc_earth_elementalAI(creature); } @@ -2250,78 +2238,111 @@ public: # npc_wormhole ######*/ -#define GOSSIP_ENGINEERING1 "Borean Tundra." -#define GOSSIP_ENGINEERING2 "Howling Fjord." -#define GOSSIP_ENGINEERING3 "Sholazar Basin." -#define GOSSIP_ENGINEERING4 "Icecrown." -#define GOSSIP_ENGINEERING5 "Storm Peaks." +#define GOSSIP_ENGINEERING1 "Borean Tundra" +#define GOSSIP_ENGINEERING2 "Howling Fjord" +#define GOSSIP_ENGINEERING3 "Sholazar Basin" +#define GOSSIP_ENGINEERING4 "Icecrown" +#define GOSSIP_ENGINEERING5 "Storm Peaks" +#define GOSSIP_ENGINEERING6 "Underground..." -enum eWormhole +enum WormholeSpells { - SPELL_HOWLING_FJORD = 67838, + SPELL_BOREAN_TUNDRA = 67834, SPELL_SHOLAZAR_BASIN = 67835, SPELL_ICECROWN = 67836, SPELL_STORM_PEAKS = 67837, + SPELL_HOWLING_FJORD = 67838, + SPELL_UNDERGROUND = 68081, - TEXT_WORMHOLE = 907 + TEXT_WORMHOLE = 907, + + DATA_SHOW_UNDERGROUND = 1, }; class npc_wormhole : public CreatureScript { -public: - npc_wormhole() : CreatureScript("npc_wormhole") { } + public: + npc_wormhole() : CreatureScript("npc_wormhole") {} - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isSummon()) + struct npc_wormholeAI : public PassiveAI { - if (player == creature->ToTempSummon()->GetSummoner()) + npc_wormholeAI(Creature* creature) : PassiveAI(creature) {} + + void InitializeAI() { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ENGINEERING1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ENGINEERING2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ENGINEERING3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ENGINEERING4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ENGINEERING5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); + _showUnderground = urand(0, 100) == 0; // Guessed value, it is really rare though + } - player->PlayerTalkClass->SendGossipMenu(TEXT_WORMHOLE, creature->GetGUID()); + uint32 GetData(uint32 type) + { + return (type == DATA_SHOW_UNDERGROUND && _showUnderground) ? 1 : 0; } + + private: + bool _showUnderground; + }; + + bool OnGossipHello(Player* player, Creature* creature) + { + if (creature->isSummon()) + { + if (player == creature->ToTempSummon()->GetSummoner()) + { + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ENGINEERING1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ENGINEERING2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ENGINEERING3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ENGINEERING4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ENGINEERING5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); + + if (creature->AI()->GetData(DATA_SHOW_UNDERGROUND)) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ENGINEERING6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); + + player->PlayerTalkClass->SendGossipMenu(TEXT_WORMHOLE, creature->GetGUID()); + } + } + + return true; } - return true; - } - bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - bool roll = urand(0, 1); + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) + { + player->PlayerTalkClass->ClearMenus(); - switch (action) + switch (action) + { + case GOSSIP_ACTION_INFO_DEF + 1: // Borean Tundra + player->CLOSE_GOSSIP_MENU(); + creature->CastSpell(player, SPELL_BOREAN_TUNDRA, false); + break; + case GOSSIP_ACTION_INFO_DEF + 2: // Howling Fjord + player->CLOSE_GOSSIP_MENU(); + creature->CastSpell(player, SPELL_HOWLING_FJORD, false); + break; + case GOSSIP_ACTION_INFO_DEF + 3: // Sholazar Basin + player->CLOSE_GOSSIP_MENU(); + creature->CastSpell(player, SPELL_SHOLAZAR_BASIN, false); + break; + case GOSSIP_ACTION_INFO_DEF + 4: // Icecrown + player->CLOSE_GOSSIP_MENU(); + creature->CastSpell(player, SPELL_ICECROWN, false); + break; + case GOSSIP_ACTION_INFO_DEF + 5: // Storm peaks + player->CLOSE_GOSSIP_MENU(); + creature->CastSpell(player, SPELL_STORM_PEAKS, false); + break; + case GOSSIP_ACTION_INFO_DEF + 6: // Underground + player->CLOSE_GOSSIP_MENU(); + creature->CastSpell(player, SPELL_UNDERGROUND, false); + break; + } + + return true; + } + + CreatureAI* GetAI(Creature* creature) const { - case GOSSIP_ACTION_INFO_DEF + 1: //Borean Tundra - player->CLOSE_GOSSIP_MENU(); - if (roll) //At the moment we don't have chance on spell_target_position table so we hack this - player->TeleportTo(571, 4305.505859f, 5450.839844f, 63.005806f, 0.627286f); - else - player->TeleportTo(571, 3201.936279f, 5630.123535f, 133.658798f, 3.855272f); - break; - case GOSSIP_ACTION_INFO_DEF + 2: //Howling Fjord - player->CLOSE_GOSSIP_MENU(); - player->CastSpell(player, SPELL_HOWLING_FJORD, true); - break; - case GOSSIP_ACTION_INFO_DEF + 3: //Sholazar Basin - player->CLOSE_GOSSIP_MENU(); - player->CastSpell(player, SPELL_SHOLAZAR_BASIN, true); - break; - case GOSSIP_ACTION_INFO_DEF + 4: //Icecrown - player->CLOSE_GOSSIP_MENU(); - player->CastSpell(player, SPELL_ICECROWN, true); - break; - case GOSSIP_ACTION_INFO_DEF + 5: //Storm peaks - player->CLOSE_GOSSIP_MENU(); - player->CastSpell(player, SPELL_STORM_PEAKS, true); - break; + return new npc_wormholeAI(creature); } - return true; - } }; /*###### @@ -2402,6 +2423,9 @@ enum eLockSmith QUEST_HOTTER_THAN_HELL_H = 10764, QUEST_RETURN_TO_KHAGDAR = 9837, QUEST_CONTAINMENT = 13159, + QUEST_ETERNAL_VIGILANCE = 11011, + QUEST_KEY_TO_THE_FOCUSING_IRIS = 13372, + QUEST_HC_KEY_TO_THE_FOCUSING_IRIS = 13375, ITEM_ARCATRAZ_KEY = 31084, ITEM_SHADOWFORGE_KEY = 11000, @@ -2409,21 +2433,28 @@ enum eLockSmith ITEM_SHATTERED_HALLS_KEY = 28395, ITEM_THE_MASTERS_KEY = 24490, ITEM_VIOLET_HOLD_KEY = 42482, + ITEM_ESSENCE_INFUSED_MOONSTONE = 32449, + ITEM_KEY_TO_THE_FOCUSING_IRIS = 44582, + ITEM_HC_KEY_TO_THE_FOCUSING_IRIS = 44581, SPELL_ARCATRAZ_KEY = 54881, SPELL_SHADOWFORGE_KEY = 54882, SPELL_SKELETON_KEY = 54883, SPELL_SHATTERED_HALLS_KEY = 54884, SPELL_THE_MASTERS_KEY = 54885, - SPELL_VIOLET_HOLD_KEY = 67253 + SPELL_VIOLET_HOLD_KEY = 67253, + SPELL_ESSENCE_INFUSED_MOONSTONE = 40173, }; -#define GOSSIP_LOST_ARCATRAZ_KEY "I've lost my key to the Arcatraz." -#define GOSSIP_LOST_SHADOWFORGE_KEY "I've lost my key to the Blackrock Depths." -#define GOSSIP_LOST_SKELETON_KEY "I've lost my key to the Scholomance." -#define GOSSIP_LOST_SHATTERED_HALLS_KEY "I've lost my key to the Shattered Halls." -#define GOSSIP_LOST_THE_MASTERS_KEY "I've lost my key to the Karazhan." -#define GOSSIP_LOST_VIOLET_HOLD_KEY "I've lost my key to the Violet Hold." +#define GOSSIP_LOST_ARCATRAZ_KEY "I've lost my key to the Arcatraz." +#define GOSSIP_LOST_SHADOWFORGE_KEY "I've lost my key to the Blackrock Depths." +#define GOSSIP_LOST_SKELETON_KEY "I've lost my key to the Scholomance." +#define GOSSIP_LOST_SHATTERED_HALLS_KEY "I've lost my key to the Shattered Halls." +#define GOSSIP_LOST_THE_MASTERS_KEY "I've lost my key to the Karazhan." +#define GOSSIP_LOST_VIOLET_HOLD_KEY "I've lost my key to the Violet Hold." +#define GOSSIP_LOST_ESSENCE_INFUSED_MOONSTONE "I've lost my Essence-Infused Moonstone." +#define GOSSIP_LOST_KEY_TO_THE_FOCUSING_IRIS "I've lost my Key to the Focusing Iris." +#define GOSSIP_LOST_HC_KEY_TO_THE_FOCUSING_IRIS "I've lost my Heroic Key to the Focusing Iris." class npc_locksmith : public CreatureScript { @@ -2458,6 +2489,18 @@ public: if (player->GetQuestRewardStatus(QUEST_CONTAINMENT) && !player->HasItemCount(ITEM_VIOLET_HOLD_KEY, 1, true)) player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_VIOLET_HOLD_KEY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); + // Essence-Infused Moonstone + if (player->GetQuestRewardStatus(QUEST_ETERNAL_VIGILANCE) && !player->HasItemCount(ITEM_ESSENCE_INFUSED_MOONSTONE, 1, true)) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_ESSENCE_INFUSED_MOONSTONE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7); + + // Key to the Focusing Iris + if (player->GetQuestRewardStatus(QUEST_KEY_TO_THE_FOCUSING_IRIS) && !player->HasItemCount(ITEM_KEY_TO_THE_FOCUSING_IRIS, 1, true)) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_KEY_TO_THE_FOCUSING_IRIS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8); + + // Heroic Key to the Focusing Iris + if (player->GetQuestRewardStatus(QUEST_HC_KEY_TO_THE_FOCUSING_IRIS) && !player->HasItemCount(ITEM_HC_KEY_TO_THE_FOCUSING_IRIS, 1, true)) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_HC_KEY_TO_THE_FOCUSING_IRIS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9); + player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); return true; @@ -2492,171 +2535,17 @@ public: player->CLOSE_GOSSIP_MENU(); player->CastSpell(player, SPELL_VIOLET_HOLD_KEY, false); break; - } - return true; - } -}; - -/*###### -## npc_tabard_vendor -######*/ - -enum -{ - QUEST_TRUE_MASTERS_OF_LIGHT = 9737, - QUEST_THE_UNWRITTEN_PROPHECY = 9762, - QUEST_INTO_THE_BREACH = 10259, - QUEST_BATTLE_OF_THE_CRIMSON_WATCH = 10781, - QUEST_SHARDS_OF_AHUNE = 11972, - - ACHIEVEMENT_EXPLORE_NORTHREND = 45, - ACHIEVEMENT_TWENTYFIVE_TABARDS = 1021, - ACHIEVEMENT_THE_LOREMASTER_A = 1681, - ACHIEVEMENT_THE_LOREMASTER_H = 1682, - - ITEM_TABARD_OF_THE_HAND = 24344, - ITEM_TABARD_OF_THE_BLOOD_KNIGHT = 25549, - ITEM_TABARD_OF_THE_PROTECTOR = 28788, - ITEM_OFFERING_OF_THE_SHATAR = 31408, - ITEM_GREEN_TROPHY_TABARD_OF_THE_ILLIDARI = 31404, - ITEM_PURPLE_TROPHY_TABARD_OF_THE_ILLIDARI = 31405, - ITEM_TABARD_OF_THE_SUMMER_SKIES = 35279, - ITEM_TABARD_OF_THE_SUMMER_FLAMES = 35280, - ITEM_TABARD_OF_THE_ACHIEVER = 40643, - ITEM_LOREMASTERS_COLORS = 43300, - ITEM_TABARD_OF_THE_EXPLORER = 43348, - - SPELL_TABARD_OF_THE_BLOOD_KNIGHT = 54974, - SPELL_TABARD_OF_THE_HAND = 54976, - SPELL_GREEN_TROPHY_TABARD_OF_THE_ILLIDARI = 54977, - SPELL_PURPLE_TROPHY_TABARD_OF_THE_ILLIDARI = 54982, - SPELL_TABARD_OF_THE_ACHIEVER = 55006, - SPELL_TABARD_OF_THE_PROTECTOR = 55008, - SPELL_LOREMASTERS_COLORS = 58194, - SPELL_TABARD_OF_THE_EXPLORER = 58224, - SPELL_TABARD_OF_SUMMER_SKIES = 62768, - SPELL_TABARD_OF_SUMMER_FLAMES = 62769 -}; - -#define GOSSIP_LOST_TABARD_OF_BLOOD_KNIGHT "I've lost my Tabard of Blood Knight." -#define GOSSIP_LOST_TABARD_OF_THE_HAND "I've lost my Tabard of the Hand." -#define GOSSIP_LOST_TABARD_OF_THE_PROTECTOR "I've lost my Tabard of the Protector." -#define GOSSIP_LOST_GREEN_TROPHY_TABARD_OF_THE_ILLIDARI "I've lost my Green Trophy Tabard of the Illidari." -#define GOSSIP_LOST_PURPLE_TROPHY_TABARD_OF_THE_ILLIDARI "I've lost my Purple Trophy Tabard of the Illidari." -#define GOSSIP_LOST_TABARD_OF_SUMMER_SKIES "I've lost my Tabard of Summer Skies." -#define GOSSIP_LOST_TABARD_OF_SUMMER_FLAMES "I've lost my Tabard of Summer Flames." -#define GOSSIP_LOST_LOREMASTERS_COLORS "I've lost my Loremaster's Colors." -#define GOSSIP_LOST_TABARD_OF_THE_EXPLORER "I've lost my Tabard of the Explorer." -#define GOSSIP_LOST_TABARD_OF_THE_ACHIEVER "I've lost my Tabard of the Achiever." - -class npc_tabard_vendor : public CreatureScript -{ -public: - npc_tabard_vendor() : CreatureScript("npc_tabard_vendor") { } - - bool OnGossipHello(Player* player, Creature* creature) - { - bool lostBloodKnight = false; - bool lostHand = false; - bool lostProtector = false; - bool lostIllidari = false; - bool lostSummer = false; - - //Tabard of the Blood Knight - if (player->GetQuestRewardStatus(QUEST_TRUE_MASTERS_OF_LIGHT) && !player->HasItemCount(ITEM_TABARD_OF_THE_BLOOD_KNIGHT, 1, true)) - lostBloodKnight = true; - - //Tabard of the Hand - if (player->GetQuestRewardStatus(QUEST_THE_UNWRITTEN_PROPHECY) && !player->HasItemCount(ITEM_TABARD_OF_THE_HAND, 1, true)) - lostHand = true; - - //Tabard of the Protector - if (player->GetQuestRewardStatus(QUEST_INTO_THE_BREACH) && !player->HasItemCount(ITEM_TABARD_OF_THE_PROTECTOR, 1, true)) - lostProtector = true; - - //Green Trophy Tabard of the Illidari - //Purple Trophy Tabard of the Illidari - if (player->GetQuestRewardStatus(QUEST_BATTLE_OF_THE_CRIMSON_WATCH) && - (!player->HasItemCount(ITEM_GREEN_TROPHY_TABARD_OF_THE_ILLIDARI, 1, true) && - !player->HasItemCount(ITEM_PURPLE_TROPHY_TABARD_OF_THE_ILLIDARI, 1, true) && - !player->HasItemCount(ITEM_OFFERING_OF_THE_SHATAR, 1, true))) - lostIllidari = true; - - //Tabard of Summer Skies - //Tabard of Summer Flames - if (player->GetQuestRewardStatus(QUEST_SHARDS_OF_AHUNE) && - !player->HasItemCount(ITEM_TABARD_OF_THE_SUMMER_SKIES, 1, true) && - !player->HasItemCount(ITEM_TABARD_OF_THE_SUMMER_FLAMES, 1, true)) - lostSummer = true; - - if (lostBloodKnight || lostHand || lostProtector || lostIllidari || lostSummer) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); - - if (lostBloodKnight) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_TABARD_OF_BLOOD_KNIGHT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - - if (lostHand) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_TABARD_OF_THE_HAND, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - - if (lostProtector) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_TABARD_OF_THE_PROTECTOR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - - if (lostIllidari) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_GREEN_TROPHY_TABARD_OF_THE_ILLIDARI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_PURPLE_TROPHY_TABARD_OF_THE_ILLIDARI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); - } - - if (lostSummer) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_TABARD_OF_SUMMER_SKIES, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_TABARD_OF_SUMMER_FLAMES, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7); - } - - player->SEND_GOSSIP_MENU(13583, creature->GetGUID()); - } - else - player->GetSession()->SendListInventory(creature->GetGUID()); - - return true; - } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - switch (action) - { - case GOSSIP_ACTION_TRADE: - player->GetSession()->SendListInventory(creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 1: - player->CLOSE_GOSSIP_MENU(); - player->CastSpell(player, SPELL_TABARD_OF_THE_BLOOD_KNIGHT, false); - break; - case GOSSIP_ACTION_INFO_DEF + 2: - player->CLOSE_GOSSIP_MENU(); - player->CastSpell(player, SPELL_TABARD_OF_THE_HAND, false); - break; - case GOSSIP_ACTION_INFO_DEF + 3: - player->CLOSE_GOSSIP_MENU(); - player->CastSpell(player, SPELL_TABARD_OF_THE_PROTECTOR, false); - break; - case GOSSIP_ACTION_INFO_DEF + 4: - player->CLOSE_GOSSIP_MENU(); - player->CastSpell(player, SPELL_GREEN_TROPHY_TABARD_OF_THE_ILLIDARI, false); - break; - case GOSSIP_ACTION_INFO_DEF + 5: + case GOSSIP_ACTION_INFO_DEF + 7: player->CLOSE_GOSSIP_MENU(); - player->CastSpell(player, SPELL_PURPLE_TROPHY_TABARD_OF_THE_ILLIDARI, false); + player->CastSpell(player, SPELL_ESSENCE_INFUSED_MOONSTONE, false); break; - case GOSSIP_ACTION_INFO_DEF + 6: + case GOSSIP_ACTION_INFO_DEF + 8: player->CLOSE_GOSSIP_MENU(); - player->CastSpell(player, SPELL_TABARD_OF_SUMMER_SKIES, false); + player->AddItem(ITEM_KEY_TO_THE_FOCUSING_IRIS,1); break; - case GOSSIP_ACTION_INFO_DEF + 7: + case GOSSIP_ACTION_INFO_DEF + 9: player->CLOSE_GOSSIP_MENU(); - player->CastSpell(player, SPELL_TABARD_OF_SUMMER_FLAMES, false); + player->AddItem(ITEM_HC_KEY_TO_THE_FOCUSING_IRIS,1); break; } return true; @@ -2999,7 +2888,7 @@ public: } }; - CreatureAI *GetAI(Creature* creature) const + CreatureAI* GetAI(Creature* creature) const { return new npc_fireworkAI(creature); } @@ -3031,7 +2920,7 @@ public: struct npc_spring_rabbitAI : public ScriptedAI { - npc_spring_rabbitAI(Creature* c) : ScriptedAI(c) { } + npc_spring_rabbitAI(Creature* creature) : ScriptedAI(creature) { } bool inLove; uint32 jumpTimer; @@ -3101,35 +2990,34 @@ public: void AddSC_npcs_special() { - new npc_air_force_bots; - new npc_lunaclaw_spirit; - new npc_chicken_cluck; - new npc_dancing_flames; - new npc_doctor; - new npc_injured_patient; - new npc_garments_of_quests; - new npc_guardian; - new npc_mount_vendor; - new npc_rogue_trainer; - new npc_sayge; - new npc_steam_tonk; - new npc_tonk_mine; - new npc_winter_reveler; - new npc_brewfest_reveler; - new npc_snake_trap; - new npc_mirror_image; - new npc_ebon_gargoyle; - new npc_lightwell; - new mob_mojo; - new npc_training_dummy; - new npc_shadowfiend; - new npc_wormhole; - new npc_pet_trainer; - new npc_locksmith; - new npc_tabard_vendor; - new npc_experience; - new npc_fire_elemental; - new npc_earth_elemental; - new npc_firework; + new npc_air_force_bots(); + new npc_lunaclaw_spirit(); + new npc_chicken_cluck(); + new npc_dancing_flames(); + new npc_doctor(); + new npc_injured_patient(); + new npc_garments_of_quests(); + new npc_guardian(); + new npc_mount_vendor(); + new npc_rogue_trainer(); + new npc_sayge(); + new npc_steam_tonk(); + new npc_tonk_mine(); + new npc_winter_reveler(); + new npc_brewfest_reveler(); + new npc_snake_trap(); + new npc_mirror_image(); + new npc_ebon_gargoyle(); + new npc_lightwell(); + new mob_mojo(); + new npc_training_dummy(); + new npc_shadowfiend(); + new npc_wormhole(); + new npc_pet_trainer(); + new npc_locksmith(); + new npc_experience(); + new npc_fire_elemental(); + new npc_earth_elemental(); + new npc_firework(); new npc_spring_rabbit(); } diff --git a/src/server/shared/AutoPtr.h b/src/server/shared/AutoPtr.h new file mode 100644 index 00000000000..988c46cc5a2 --- /dev/null +++ b/src/server/shared/AutoPtr.h @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2008-2012 TrinityCore + * + * 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; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; 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, see . + */ + +#ifndef _TRINITY_AUTO_PTR_H +#define _TRINITY_AUTO_PTR_H + +#include + +namespace Trinity +{ + template + class AutoPtr : public ACE_Strong_Bound_Ptr + { + public: + AutoPtr() : ACE_Strong_Bound_Ptr() {} + + AutoPtr(Pointer* x) + { + ACE_Strong_Bound_Ptr::reset(x); + } + + operator bool() const + { + return ACE_Strong_Bound_Ptr::get() != NULL; + } + + bool operator !() const + { + return ACE_Strong_Bound_Ptr::get() == NULL; + } + + bool operator !=(Pointer* x) const + { + return ACE_Strong_Bound_Ptr::get() != x; + } + }; +}; + +#endif \ No newline at end of file diff --git a/src/server/shared/CMakeLists.txt b/src/server/shared/CMakeLists.txt index 3ec35b5394a..de998442419 100644 --- a/src/server/shared/CMakeLists.txt +++ b/src/server/shared/CMakeLists.txt @@ -53,7 +53,6 @@ set(shared_STAT_SRCS include_directories( ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/dep/SFMT - ${CMAKE_SOURCE_DIR}/dep/mersennetwister ${CMAKE_SOURCE_DIR}/dep/sockets/include ${CMAKE_SOURCE_DIR}/dep/utf8cpp ${CMAKE_SOURCE_DIR}/src/server diff --git a/src/server/shared/Common.h b/src/server/shared/Common.h index 57809cca255..259c60ade20 100755 --- a/src/server/shared/Common.h +++ b/src/server/shared/Common.h @@ -208,10 +208,14 @@ typedef std::vector StringVector; ACE_Guard< MUTEX > TRINITY_GUARD_OBJECT (LOCK); \ if (TRINITY_GUARD_OBJECT.locked() == 0) ASSERT(false); +//! For proper implementation of multiple-read, single-write pattern, use +//! ACE_RW_Mutex as underlying @MUTEX # define TRINITY_WRITE_GUARD(MUTEX, LOCK) \ ACE_Write_Guard< MUTEX > TRINITY_GUARD_OBJECT (LOCK); \ if (TRINITY_GUARD_OBJECT.locked() == 0) ASSERT(false); +//! For proper implementation of multiple-read, single-write pattern, use +//! ACE_RW_Mutex as underlying @MUTEX # define TRINITY_READ_GUARD(MUTEX, LOCK) \ ACE_Read_Guard< MUTEX > TRINITY_GUARD_OBJECT (LOCK); \ if (TRINITY_GUARD_OBJECT.locked() == 0) ASSERT(false); diff --git a/src/server/shared/Containers.h b/src/server/shared/Containers.h new file mode 100644 index 00000000000..f0242cbff0e --- /dev/null +++ b/src/server/shared/Containers.h @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2008-2012 TrinityCore + * + * 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; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; 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, see . + */ + +#ifndef TRINITY_CONTAINERS_H +#define TRINITY_CONTAINERS_H + +#include + +//! Because circular includes are bad +extern uint32 urand(uint32 min, uint32 max); + +namespace Trinity +{ + namespace Containers + { + template + void RandomResizeList(std::list &list, uint32 size) + { + size_t list_size = list.size(); + + while (list_size > size) + { + typename std::list::iterator itr = list.begin(); + std::advance(itr, urand(0, list_size - 1)); + list.erase(itr); + --list_size; + } + } + + template + void RandomResizeList(std::list &list, Predicate& predicate, uint32 size) + { + //! First use predicate filter + std::list listCopy; + for (typename std::list::iterator itr = list.begin(); itr != list.end(); ++itr) + if (predicate(*itr)) + listCopy.push_back(*itr); + + if (size) + RandomResizeList(listCopy, size); + + list = listCopy; + } + + /* Select a random element from a container. Note: make sure you explicitly empty check the container */ + template typename C::value_type const& SelectRandomContainerElement(C const& container) + { + typename C::const_iterator it = container.begin(); + std::advance(it, urand(0, container.size() - 1)); + return *it; + } + }; + //! namespace Containers +}; +//! namespace Trinity + +#endif //! #ifdef TRINITY_CONTAINERS_H \ No newline at end of file diff --git a/src/server/shared/Cryptography/BigNumber.cpp b/src/server/shared/Cryptography/BigNumber.cpp index f55e87c99fc..364ee76ec75 100755 --- a/src/server/shared/Cryptography/BigNumber.cpp +++ b/src/server/shared/Cryptography/BigNumber.cpp @@ -16,6 +16,8 @@ * with this program. If not, see . */ +#include + #include "Cryptography/BigNumber.h" #include #include @@ -169,6 +171,8 @@ uint8 *BigNumber::AsByteArray(int minSize, bool reverse) { int length = (minSize >= GetNumBytes()) ? minSize : GetNumBytes(); + ACE_GUARD_RETURN(ACE_Mutex, g, _lock, 0); + if (_array) { delete[] _array; diff --git a/src/server/shared/Cryptography/BigNumber.h b/src/server/shared/Cryptography/BigNumber.h index 7196aae6579..6646245a6a0 100755 --- a/src/server/shared/Cryptography/BigNumber.h +++ b/src/server/shared/Cryptography/BigNumber.h @@ -20,6 +20,7 @@ #define _AUTH_BIGNUMBER_H #include "Define.h" +#include struct bignum_st; @@ -89,6 +90,10 @@ class BigNumber private: struct bignum_st *_bn; uint8 *_array; + + // This mutex only controls thread-safe access to AsByteArray() and should be replaced with a thread-safe implementation of BigNumber + ACE_Mutex _lock; + }; #endif diff --git a/src/server/shared/Cryptography/HMACSHA1.cpp b/src/server/shared/Cryptography/HMACSHA1.cpp index 447d0b58efc..c9de1191464 100755 --- a/src/server/shared/Cryptography/HMACSHA1.cpp +++ b/src/server/shared/Cryptography/HMACSHA1.cpp @@ -31,19 +31,9 @@ HmacHash::~HmacHash() HMAC_CTX_cleanup(&m_ctx); } -void HmacHash::UpdateBigNumber(BigNumber* bn) -{ - UpdateData(bn->AsByteArray(), bn->GetNumBytes()); -} - -void HmacHash::UpdateData(const uint8 *data, int length) -{ - HMAC_Update(&m_ctx, data, length); -} - void HmacHash::UpdateData(const std::string &str) { - UpdateData((uint8 const*)str.c_str(), str.length()); + HMAC_Update(&m_ctx, (uint8 const*)str.c_str(), str.length()); } void HmacHash::Finalize() diff --git a/src/server/shared/Cryptography/HMACSHA1.h b/src/server/shared/Cryptography/HMACSHA1.h index bd0418b600e..4b7667968ca 100755 --- a/src/server/shared/Cryptography/HMACSHA1.h +++ b/src/server/shared/Cryptography/HMACSHA1.h @@ -33,8 +33,6 @@ class HmacHash public: HmacHash(uint32 len, uint8 *seed); ~HmacHash(); - void UpdateBigNumber(BigNumber* bn); - void UpdateData(const uint8 *data, int length); void UpdateData(const std::string &str); void Finalize(); uint8 *ComputeHash(BigNumber* bn); diff --git a/src/server/shared/Cryptography/SHA1.h b/src/server/shared/Cryptography/SHA1.h index b5bf97fd7d9..7c77defebfa 100755 --- a/src/server/shared/Cryptography/SHA1.h +++ b/src/server/shared/Cryptography/SHA1.h @@ -31,7 +31,6 @@ class SHA1Hash SHA1Hash(); ~SHA1Hash(); - void UpdateFinalizeBigNumbers(BigNumber* bn0, ...); void UpdateBigNumbers(BigNumber* bn0, ...); void UpdateData(const uint8 *dta, int len); diff --git a/src/server/shared/Database/DatabaseWorkerPool.h b/src/server/shared/Database/DatabaseWorkerPool.h index b91972e5b0c..314d196cc06 100755 --- a/src/server/shared/Database/DatabaseWorkerPool.h +++ b/src/server/shared/Database/DatabaseWorkerPool.h @@ -33,17 +33,11 @@ class PingOperation : public SQLOperation { - /// Operation for idle delaythreads + //! Operation for idle delaythreads bool Execute() { - if (m_conn->LockIfReady()) - { - m_conn->Ping(); - m_conn->Unlock(); - return true; - } - - return false; + m_conn->Ping(); + return true; } }; @@ -53,10 +47,10 @@ class DatabaseWorkerPool public: /* Activity state */ DatabaseWorkerPool() : - m_queue(new ACE_Activation_Queue(new ACE_Message_Queue)) + _queue(new ACE_Activation_Queue()) { - memset(m_connectionCount, 0, sizeof(m_connectionCount)); - m_connections.resize(IDX_SIZE); + memset(_connectionCount, 0, sizeof(_connectionCount)); + _connections.resize(IDX_SIZE); WPFatal (mysql_thread_safe(), "Used MySQL library isn't thread-safe."); } @@ -68,64 +62,72 @@ class DatabaseWorkerPool bool Open(const std::string& infoString, uint8 async_threads, uint8 synch_threads) { bool res = true; - m_connectionInfo = MySQLConnectionInfo(infoString); + _connectionInfo = MySQLConnectionInfo(infoString); - sLog->outSQLDriver("Opening databasepool '%s'. Async threads: %u, synch threads: %u", m_connectionInfo.database.c_str(), async_threads, synch_threads); + sLog->outSQLDriver("Opening DatabasePool '%s'. Asynchronous connections: %u, synchronous connections: %u.", + GetDatabaseName(), async_threads, synch_threads); - /// Open asynchronous connections (delayed operations) - m_connections[IDX_ASYNC].resize(async_threads); + //! Open asynchronous connections (delayed operations) + _connections[IDX_ASYNC].resize(async_threads); for (uint8 i = 0; i < async_threads; ++i) { - T* t = new T(m_queue, m_connectionInfo); + T* t = new T(_queue, _connectionInfo); res &= t->Open(); - m_connections[IDX_ASYNC][i] = t; - ++m_connectionCount[IDX_ASYNC]; + _connections[IDX_ASYNC][i] = t; + ++_connectionCount[IDX_ASYNC]; } - /// Open synchronous connections (direct, blocking operations) - m_connections[IDX_SYNCH].resize(synch_threads); + //! Open synchronous connections (direct, blocking operations) + _connections[IDX_SYNCH].resize(synch_threads); for (uint8 i = 0; i < synch_threads; ++i) { - T* t = new T(m_connectionInfo); + T* t = new T(_connectionInfo); res &= t->Open(); - m_connections[IDX_SYNCH][i] = t; - ++m_connectionCount[IDX_SYNCH]; + _connections[IDX_SYNCH][i] = t; + ++_connectionCount[IDX_SYNCH]; } - sLog->outSQLDriver("Databasepool opened successfully. %u total connections running.", (m_connectionCount[IDX_SYNCH] + m_connectionCount[IDX_ASYNC])); + if (res) + sLog->outSQLDriver("DatabasePool '%s' opened successfully. %u total connections running.", GetDatabaseName(), + (_connectionCount[IDX_SYNCH] + _connectionCount[IDX_ASYNC])); + else + sLog->outError("DatabasePool %s NOT opened. There were errors opening the MySQL connections. Check your SQLDriverLogFile " + "for specific errors.", GetDatabaseName()); return res; } void Close() { - sLog->outSQLDriver("Closing down databasepool '%s'.", m_connectionInfo.database.c_str()); + sLog->outSQLDriver("Closing down DatabasePool '%s'.", GetDatabaseName()); - /// Shuts down delaythreads for this connection pool by underlying deactivate() - m_queue->queue()->close(); + //! Shuts down delaythreads for this connection pool by underlying deactivate(). + //! The next dequeue attempt in the worker thread tasks will result in an error, + //! ultimately ending the worker thread task. + _queue->queue()->close(); - for (uint8 i = 0; i < m_connectionCount[IDX_ASYNC]; ++i) + for (uint8 i = 0; i < _connectionCount[IDX_ASYNC]; ++i) { - /// TODO: Better way. probably should flip a boolean and check it on low level code before doing anything on the mysql ctx - /// Now we just wait until m_queue gives the signal to the worker threads to stop - T* t = m_connections[IDX_ASYNC][i]; + T* t = _connections[IDX_ASYNC][i]; DatabaseWorker* worker = t->m_worker; - worker->wait(); + worker->wait(); //! Block until no more threads are running this task. delete worker; - t->Close(); + t->Close(); //! Closes the actualy MySQL connection. } - sLog->outSQLDriver("Asynchronous connections on databasepool '%s' terminated. Proceeding with synchronous connections.", m_connectionInfo.database.c_str()); + sLog->outSQLDriver("Asynchronous connections on DatabasePool '%s' terminated. Proceeding with synchronous connections.", + GetDatabaseName()); - /// Shut down the synchronous connections - for (uint8 i = 0; i < m_connectionCount[IDX_SYNCH]; ++i) - { - T* t = m_connections[IDX_SYNCH][i]; - //while (1) - // if (t->LockIfReady()) -- For some reason deadlocks us - t->Close(); - } + //! Shut down the synchronous connections + //! There's no need for locking the connection, because DatabaseWorkerPool<>::Close + //! should only be called after any other thread tasks in the core have exited, + //! meaning there can be no concurrent access at this point. + for (uint8 i = 0; i < _connectionCount[IDX_SYNCH]; ++i) + _connections[IDX_SYNCH][i]->Close(); + + //! Deletes the ACE_Activation_Queue object and its underlying ACE_Message_Queue + delete _queue; - sLog->outSQLDriver("All connections on databasepool %s closed.", m_connectionInfo.database.c_str()); + sLog->outSQLDriver("All connections on DatabasePool '%s' closed.", GetDatabaseName()); } /** @@ -133,6 +135,7 @@ class DatabaseWorkerPool */ //! Enqueues a one-way SQL operation in string format that will be executed asynchronously. + //! This method should only be used for queries that are only executed once, e.g during startup. void Execute(const char* sql) { if (!sql) @@ -143,6 +146,7 @@ class DatabaseWorkerPool } //! Enqueues a one-way SQL operation in string format -with variable args- that will be executed asynchronously. + //! This method should only be used for queries that are only executed once, e.g during startup. void PExecute(const char* sql, ...) { if (!sql) @@ -166,10 +170,11 @@ class DatabaseWorkerPool } /** - Direct syncrhonous one-way statement methods. + Direct synchronous one-way statement methods. */ //! Directly executes a one-way SQL operation in string format, that will block the calling thread until finished. + //! This method should only be used for queries that are only executed once, e.g during startup. void DirectExecute(const char* sql) { if (!sql) @@ -181,6 +186,7 @@ class DatabaseWorkerPool } //! Directly executes a one-way SQL operation in string format -with variable args-, that will block the calling thread until finished. + //! This method should only be used for queries that are only executed once, e.g during startup. void DirectPExecute(const char* sql, ...) { if (!sql) @@ -233,7 +239,7 @@ class DatabaseWorkerPool va_list ap; char szQuery[MAX_QUERY_LEN]; - va_start(ap, sql); + va_start(ap, conn); vsnprintf(szQuery, MAX_QUERY_LEN, sql, ap); va_end(ap); @@ -265,6 +271,9 @@ class DatabaseWorkerPool PreparedResultSet* ret = t->Query(stmt); t->Unlock(); + //! Delete proxy-class. Not needed anymore + delete stmt; + if (!ret || !ret->GetRowCount()) return PreparedQueryResult(NULL); @@ -335,20 +344,22 @@ class DatabaseWorkerPool //! were appended to the transaction will be respected during execution. void CommitTransaction(SQLTransaction transaction) { - if (sLog->GetSQLDriverQueryLogging()) + #ifdef TRINITY_DEBUG + //! Only analyze transaction weaknesses in Debug mode. + //! Ideally we catch the faults in Debug mode and then correct them, + //! so there's no need to waste these CPU cycles in Release mode. + switch (transaction->GetSize()) { - switch (transaction->GetSize()) - { - case 0: - sLog->outSQLDriver("Transaction contains 0 queries. Not executing."); - return; - case 1: - sLog->outSQLDriver("Warning: Transaction only holds 1 query, consider removing Transaction context in code."); - break; - default: - break; - } + case 0: + sLog->outSQLDriver("Transaction contains 0 queries. Not executing."); + return; + case 1: + sLog->outSQLDriver("Warning: Transaction only holds 1 query, consider removing Transaction context in code."); + break; + default: + break; } + #endif // TRINITY_DEBUG Enqueue(new TransactionTask(transaction)); } @@ -364,9 +375,11 @@ class DatabaseWorkerPool return; } + //! Handle MySQL Errno 1213 without extending deadlock to the core itself + //! TODO: More elegant way if (con->GetLastError() == 1213) { - uint8 loopBreaker = 5; // Handle MySQL Errno 1213 without extending deadlock to the core itself + uint8 loopBreaker = 5; for (uint8 i = 0; i < loopBreaker; ++i) { if (con->ExecuteTransaction(transaction)) @@ -374,7 +387,7 @@ class DatabaseWorkerPool } } - // Clean up now. + //! Clean up now. transaction->Cleanup(); con->Unlock(); @@ -405,6 +418,7 @@ class DatabaseWorkerPool */ //! Automanaged (internally) pointer to a prepared statement object for usage in upper level code. + //! Pointer is deleted in this->Query(PreparedStatement*) or PreparedStatementTask::~PreparedStatementTask. //! This object is not tied to the prepared statement on the MySQL context yet until execution. PreparedStatement* GetPreparedStatement(uint32 index) { @@ -426,10 +440,10 @@ class DatabaseWorkerPool //! Keeps all our MySQL connections alive, prevent the server from disconnecting us. void KeepAlive() { - /// Ping synchronous connections - for (uint8 i = 0; i < m_connectionCount[IDX_SYNCH]; ++i) + //! Ping synchronous connections + for (uint8 i = 0; i < _connectionCount[IDX_SYNCH]; ++i) { - T* t = m_connections[IDX_SYNCH][i]; + T* t = _connections[IDX_SYNCH][i]; if (t->LockIfReady()) { t->Ping(); @@ -437,10 +451,10 @@ class DatabaseWorkerPool } } - /// Assuming all worker threads are free, every worker thread will receive 1 ping operation request - /// If one or more worker threads are busy, the ping operations will not be split evenly, but this doesn't matter - /// as the sole purpose is to prevent connections from idling. - for (size_t i = 0; i < m_connections[IDX_ASYNC].size(); ++i) + //! Assuming all worker threads are free, every worker thread will receive 1 ping operation request + //! If one or more worker threads are busy, the ping operations will not be split evenly, but this doesn't matter + //! as the sole purpose is to prevent connections from idling. + for (size_t i = 0; i < _connections[IDX_ASYNC].size(); ++i) Enqueue(new PingOperation); } @@ -450,41 +464,50 @@ class DatabaseWorkerPool if (!to || !from || !length) return 0; - return mysql_real_escape_string(m_connections[IDX_SYNCH][0]->GetHandle(), to, from, length); + return mysql_real_escape_string(_connections[IDX_SYNCH][0]->GetHandle(), to, from, length); } void Enqueue(SQLOperation* op) { - m_queue->enqueue(op); + _queue->enqueue(op); } + //! Gets a free connection in the synchronous connection pool. + //! Caller MUST call t->Unlock() after touching the MySQL context to prevent deadlocks. T* GetFreeConnection() { uint8 i = 0; - size_t num_cons = m_connectionCount[IDX_SYNCH]; - for (;;) /// Block forever until a connection is free + size_t num_cons = _connectionCount[IDX_SYNCH]; + //! Block forever until a connection is free + for (;;) { - T* t = m_connections[IDX_SYNCH][++i % num_cons ]; - if (t->LockIfReady()) /// Must be matched with t->Unlock() or you will get deadlocks + T* t = _connections[IDX_SYNCH][++i % num_cons]; + //! Must be matched with t->Unlock() or you will get deadlocks + if (t->LockIfReady()) return t; } - // This will be called when Celine Dion learns to sing + //! This will be called when Celine Dion learns to sing return NULL; } + char const* GetDatabaseName() const + { + return _connectionInfo.database.c_str(); + } + private: - enum + enum _internalIndex { IDX_ASYNC, IDX_SYNCH, IDX_SIZE, }; - ACE_Activation_Queue* m_queue; //! Queue shared by async worker threads. - std::vector< std::vector > m_connections; - uint32 m_connectionCount[2]; //! Counter of MySQL connections; - MySQLConnectionInfo m_connectionInfo; + ACE_Activation_Queue* _queue; //! Queue shared by async worker threads. + std::vector< std::vector > _connections; + uint32 _connectionCount[2]; //! Counter of MySQL connections; + MySQLConnectionInfo _connectionInfo; }; #endif diff --git a/src/server/shared/Database/Field.h b/src/server/shared/Database/Field.h index 355f6b47ff2..bfa42dbe574 100755 --- a/src/server/shared/Database/Field.h +++ b/src/server/shared/Database/Field.h @@ -41,12 +41,13 @@ class Field return 0; #ifdef TRINITY_DEBUG - if (!IsNumeric()) + if (!IsType(MYSQL_TYPE_TINY)) { - sLog->outSQLDriver("Error: GetUInt8() on non-numeric field."); + sLog->outSQLDriver("Warning: GetUInt8() on non-tinyint field. Using type: %s.", FieldTypeToString(data.type)); return 0; } #endif + if (data.raw) return *reinterpret_cast(data.value); return static_cast(atol((char*)data.value)); @@ -58,12 +59,13 @@ class Field return 0; #ifdef TRINITY_DEBUG - if (!IsNumeric()) + if (!IsType(MYSQL_TYPE_TINY)) { - sLog->outSQLDriver("Error: GeInt8() on non-numeric field."); + sLog->outSQLDriver("Warning: GetInt8() on non-tinyint field. Using type: %s.", FieldTypeToString(data.type)); return 0; } #endif + if (data.raw) return *reinterpret_cast(data.value); return static_cast(atol((char*)data.value)); @@ -75,12 +77,13 @@ class Field return 0; #ifdef TRINITY_DEBUG - if (!IsNumeric()) + if (!IsType(MYSQL_TYPE_SHORT) && !IsType(MYSQL_TYPE_YEAR)) { - sLog->outSQLDriver("Error: GetUInt16() on non-numeric field."); + sLog->outSQLDriver("Warning: GetUInt16() on non-smallint field. Using type: %s.", FieldTypeToString(data.type)); return 0; } #endif + if (data.raw) return *reinterpret_cast(data.value); return static_cast(atol((char*)data.value)); @@ -92,12 +95,13 @@ class Field return 0; #ifdef TRINITY_DEBUG - if (!IsNumeric()) + if (!IsType(MYSQL_TYPE_SHORT) && !IsType(MYSQL_TYPE_YEAR)) { - sLog->outSQLDriver("Error: GetInt16() on non-numeric field."); + sLog->outSQLDriver("Warning: GetInt16() on non-smallint field. Using type: %s.", FieldTypeToString(data.type)); return 0; } #endif + if (data.raw) return *reinterpret_cast(data.value); return static_cast(atol((char*)data.value)); @@ -109,12 +113,13 @@ class Field return 0; #ifdef TRINITY_DEBUG - if (!IsNumeric()) + if (!IsType(MYSQL_TYPE_INT24) && !IsType(MYSQL_TYPE_LONG)) { - sLog->outSQLDriver("Error: GetUInt32() on non-numeric field."); + sLog->outSQLDriver("Warning: GetUInt32() on non-(medium)int field. Using type: %s.", FieldTypeToString(data.type)); return 0; } #endif + if (data.raw) return *reinterpret_cast(data.value); return static_cast(atol((char*)data.value)); @@ -126,12 +131,13 @@ class Field return 0; #ifdef TRINITY_DEBUG - if (!IsNumeric()) + if (!IsType(MYSQL_TYPE_INT24) && !IsType(MYSQL_TYPE_LONG)) { - sLog->outSQLDriver("Error: GetInt32() on non-numeric field."); + sLog->outSQLDriver("Warning: GetInt32() on non-(medium)int field. Using type: %s.", FieldTypeToString(data.type)); return 0; } #endif + if (data.raw) return *reinterpret_cast(data.value); return static_cast(atol((char*)data.value)); @@ -143,12 +149,13 @@ class Field return 0; #ifdef TRINITY_DEBUG - if (!IsNumeric()) + if (!IsType(MYSQL_TYPE_LONGLONG) && !IsType(MYSQL_TYPE_BIT)) { - sLog->outSQLDriver("Error: GetUInt64() on non-numeric field."); + sLog->outSQLDriver("Warning: GetUInt64() on non-bigint field. Using type: %s.", FieldTypeToString(data.type)); return 0; } #endif + if (data.raw) return *reinterpret_cast(data.value); return static_cast(atol((char*)data.value)); @@ -160,12 +167,13 @@ class Field return 0; #ifdef TRINITY_DEBUG - if (!IsNumeric()) + if (!IsType(MYSQL_TYPE_LONGLONG) && !IsType(MYSQL_TYPE_BIT)) { - sLog->outSQLDriver("Error: GetInt64() on non-numeric field."); + sLog->outSQLDriver("Warning: GetInt64() on non-bigint field. Using type: %s.", FieldTypeToString(data.type)); return 0; } #endif + if (data.raw) return *reinterpret_cast(data.value); return static_cast(strtol((char*)data.value, NULL, 10)); @@ -177,12 +185,13 @@ class Field return 0.0f; #ifdef TRINITY_DEBUG - if (!IsNumeric()) + if (!IsType(MYSQL_TYPE_FLOAT)) { - sLog->outSQLDriver("Error: GetFloat() on non-numeric field."); + sLog->outSQLDriver("Warning: GetFloat() on non-float field. Using type: %s.", FieldTypeToString(data.type)); return 0.0f; } #endif + if (data.raw) return *reinterpret_cast(data.value); return static_cast(atof((char*)data.value)); @@ -194,18 +203,19 @@ class Field return 0.0f; #ifdef TRINITY_DEBUG - if (!IsNumeric()) + if (!IsType(MYSQL_TYPE_DOUBLE)) { - sLog->outSQLDriver("Error: GetDouble() on non-numeric field."); + sLog->outSQLDriver("Warning: GetDouble() on non-double field. Using type: %s.", FieldTypeToString(data.type)); return 0.0f; } #endif + if (data.raw) return *reinterpret_cast(data.value); return static_cast(atof((char*)data.value)); } - const char* GetCString() const + char const* GetCString() const { if (!data.value) return NULL; @@ -213,11 +223,12 @@ class Field #ifdef TRINITY_DEBUG if (IsNumeric()) { - sLog->outSQLDriver("Error: GetCString() on numeric field."); + sLog->outSQLDriver("Error: GetCString() on numeric field. Using type: %s.", FieldTypeToString(data.type)); return NULL; } #endif - return static_cast(data.value); + return static_cast(data.value); + } std::string GetString() const @@ -227,7 +238,7 @@ class Field if (data.raw) { - const char* string = GetCString(); + char const* string = GetCString(); if (!string) string = ""; return std::string(string, data.length); @@ -257,7 +268,7 @@ class Field #pragma pack(pop) #endif - void SetByteValue(const void* newValue, const size_t newSize, enum_field_types newType, uint32 length); + void SetByteValue(void const* newValue, size_t const newSize, enum_field_types newType, uint32 length); void SetStructuredValue(char* newValue, enum_field_types newType); void CleanUp() @@ -316,6 +327,11 @@ class Field } } + bool IsType(enum_field_types type) const + { + return data.type == type; + } + bool IsNumeric() const { return (data.type == MYSQL_TYPE_TINY || @@ -326,6 +342,43 @@ class Field data.type == MYSQL_TYPE_DOUBLE || data.type == MYSQL_TYPE_LONGLONG ); } + + private: + #ifdef TRINITY_DEBUG + static char const* FieldTypeToString(enum_field_types type) + { + switch (type) + { + case MYSQL_TYPE_BIT: return "BIT"; + case MYSQL_TYPE_BLOB: return "BLOB"; + case MYSQL_TYPE_DATE: return "DATE"; + case MYSQL_TYPE_DATETIME: return "DATETIME"; + case MYSQL_TYPE_NEWDECIMAL: return "NEWDECIMAL"; + case MYSQL_TYPE_DECIMAL: return "DECIMAL"; + case MYSQL_TYPE_DOUBLE: return "DOUBLE"; + case MYSQL_TYPE_ENUM: return "ENUM"; + case MYSQL_TYPE_FLOAT: return "FLOAT"; + case MYSQL_TYPE_GEOMETRY: return "GEOMETRY"; + case MYSQL_TYPE_INT24: return "INT24"; + case MYSQL_TYPE_LONG: return "LONG"; + case MYSQL_TYPE_LONGLONG: return "LONGLONG"; + case MYSQL_TYPE_LONG_BLOB: return "LONG_BLOB"; + case MYSQL_TYPE_MEDIUM_BLOB: return "MEDIUM_BLOB"; + case MYSQL_TYPE_NEWDATE: return "NEWDATE"; + case MYSQL_TYPE_NULL: return "NULL"; + case MYSQL_TYPE_SET: return "SET"; + case MYSQL_TYPE_SHORT: return "SHORT"; + case MYSQL_TYPE_STRING: return "STRING"; + case MYSQL_TYPE_TIME: return "TIME"; + case MYSQL_TYPE_TIMESTAMP: return "TIMESTAMP"; + case MYSQL_TYPE_TINY: return "TINY"; + case MYSQL_TYPE_TINY_BLOB: return "TINY_BLOB"; + case MYSQL_TYPE_VAR_STRING: return "VAR_STRING"; + case MYSQL_TYPE_YEAR: return "YEAR"; + default: return "-Unknown-"; + } + } + #endif }; #endif diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index 72f509706e8..42e7fdbe087 100755 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -27,13 +27,15 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_DEL_NONEXISTENT_GUILD_BANK_ITEM, "DELETE FROM guild_bank_item WHERE guildid = ? AND TabId = ? AND SlotId = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_EXPIRED_BANS, "UPDATE character_banned SET active = 0 WHERE unbandate <= UNIX_TIMESTAMP() AND unbandate <> bandate", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_GUID_BY_NAME, "SELECT guid FROM characters WHERE name = ?", CONNECTION_BOTH); - PREPARE_STATEMENT(CHAR_SEL_CHECK_NAME, "SELECT 1 FROM characters WHERE name = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_SEL_SUM_CHARS, "SELECT COUNT(guid) FROM characters WHERE account = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_SEL_CHECK_NAME, "SELECT 1 FROM characters WHERE name = ?", CONNECTION_BOTH); + PREPARE_STATEMENT(CHAR_SEL_CHECK_GUID, "SELECT 1 FROM characters WHERE guid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_SUM_CHARS, "SELECT COUNT(guid) FROM characters WHERE account = ?", CONNECTION_BOTH); PREPARE_STATEMENT(CHAR_SEL_CHAR_CREATE_INFO, "SELECT level, race, class FROM characters WHERE account = ? LIMIT 0, ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_INS_CHARACTER_BAN, "INSERT INTO character_banned VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, ?, ?, 1)", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_UPD_CHARACTER_BAN, "UPDATE character_banned SET active = 0 WHERE guid = ? AND active != 0", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_DEL_CHARACTER_BAN, "DELETE cb FROM character_banned cb INNER JOIN characters c ON c.guid = cb.guid WHERE c.account = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_SEL_BANINFO, "SELECT FROM_UNIXTIME(bandate), unbandate-bandate, active, unbandate, banreason, bannedby FROM character_banned WHERE guid = ? ORDER BY bandate ASC", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_SEL_GUID_BY_NAME_FILTER, "SELECT guid, name FROM characters WHERE name LIKE CONCAT('%', ?, '%')", CONNECTION_SYNCH) + PREPARE_STATEMENT(CHAR_SEL_GUID_BY_NAME_FILTER, "SELECT guid, name FROM characters WHERE name LIKE CONCAT('%%', ?, '%%')", CONNECTION_SYNCH) PREPARE_STATEMENT(CHAR_SEL_BANINFO_LIST, "SELECT bandate, unbandate, bannedby, banreason FROM character_banned WHERE guid = ? ORDER BY unbandate", CONNECTION_SYNCH) PREPARE_STATEMENT(CHAR_SEL_BANNED_NAME, "SELECT characters.name FROM characters, character_banned WHERE character_banned.guid = ? AND character_banned.guid = characters.guid", CONNECTION_SYNCH) PREPARE_STATEMENT(CHAR_SEL_ENUM, "SELECT c.guid, c.name, c.race, c.class, c.gender, c.playerBytes, c.playerBytes2, c.level, c.zone, c.map, c.position_x, c.position_y, c.position_z, gm.guildid, c.playerFlags, c.at_login, cp.entry, cp.modelid, cp.level, c.equipmentCache, cb.guid FROM characters AS c LEFT JOIN character_pet AS cp ON c.guid = cp.owner AND cp.slot = ? LEFT JOIN guild_member AS gm ON c.guid = gm.guid LEFT JOIN character_banned AS cb ON c.guid = cb.guid AND cb.active = 1 WHERE c.account = ? ORDER BY c.guid", CONNECTION_ASYNC); @@ -43,7 +45,13 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_SEL_PET_ENTRY, "SELECT entry FROM character_pet WHERE owner = ? AND id = ? AND slot >= ? AND slot <= ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_SEL_PET_SLOT_BY_ID, "SELECT slot, entry FROM character_pet WHERE owner = ? AND id = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_SEL_FREE_NAME, "SELECT guid, name FROM characters WHERE guid = ? AND account = ? AND (at_login & ?) = ? AND NOT EXISTS (SELECT NULL FROM characters WHERE name = ?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_SEL_GUID_RACE_ACC_BY_NAME, "SELECT guid, race, account FROM characters WHERE name = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_SEL_GUID_RACE_ACC_BY_NAME, "SELECT guid, race, account FROM characters WHERE name = ?", CONNECTION_BOTH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_RACE, "SELECT race FROM characters WHERE guid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_LEVEL, "SELECT level FROM characters WHERE guid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_ZONE, "SELECT zone FROM characters WHERE guid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHARACTER_NAME_DATA, "SELECT race, class, gender FROM characters WHERE guid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_POSITION_XYZ, "SELECT map, position_x, position_y, position_z FROM characters WHERE guid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_POSITION, "SELECT position_x, position_y, position_z, orientation, map, taxi_path FROM characters WHERE guid = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_DEL_QUEST_STATUS_DAILY, "DELETE FROM character_queststatus_daily", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_DEL_QUEST_STATUS_WEEKLY, "DELETE FROM character_queststatus_weekly", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_DEL_QUEST_STATUS_SEASONAL, "DELETE FROM character_queststatus_seasonal WHERE event = ?", CONNECTION_ASYNC); @@ -59,13 +67,13 @@ void CharacterDatabaseConnection::DoPrepareStatements() "resettalents_time, talentTree, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, online, death_expire_time, taxi_path, instance_mode_mask, " "conquestPoints, totalHonorPoints, totalKills, todayKills, yesterdayKills, chosenTitle, watchedFaction, drunk, " "health, power1, power2, power3, power4, power5, instance_id, speccount, activespec, exploredZones, equipmentCache, knownTitles, actionBars, grantableLevels, guildId FROM characters WHERE guid = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_SEL_GROUP_MEMBER, "SELECT guid FROM group_member WHERE memberGuid = ?", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_SEL_GROUP_MEMBER, "SELECT guid FROM group_member WHERE memberGuid = ?", CONNECTION_BOTH) PREPARE_STATEMENT(CHAR_SEL_CHARACTER_INSTANCE, "SELECT id, permanent, map, difficulty, resettime FROM character_instance LEFT JOIN instance ON instance = id WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_CHARACTER_AURAS, "SELECT caster_guid, spell, effect_mask, recalculate_mask, stackcount, amount0, amount1, amount2, " "base_amount0, base_amount1, base_amount2, maxduration, remaintime, remaincharges FROM character_aura WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_CHARACTER_SPELL, "SELECT spell, active, disabled FROM character_spell WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_CHARACTER_QUESTSTATUS, "SELECT quest, status, explored, timer, mobcount1, mobcount2, mobcount3, mobcount4, " - "itemcount1, itemcount2, itemcount3, itemcount4, playercount FROM character_queststatus WHERE guid = ?", CONNECTION_ASYNC) + "itemcount1, itemcount2, itemcount3, itemcount4, playercount FROM character_queststatus WHERE guid = ? AND status <> 0", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_CHARACTER_DAILYQUESTSTATUS, "SELECT quest, time FROM character_queststatus_daily WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_CHARACTER_WEEKLYQUESTSTATUS, "SELECT quest FROM character_queststatus_weekly WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_CHARACTER_SEASONALQUESTSTATUS, "SELECT quest, event FROM character_queststatus_seasonal WHERE guid = ?", CONNECTION_ASYNC) @@ -78,11 +86,12 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_SEL_CHARACTER_ACTIONS, "SELECT a.button, a.action, a.type FROM character_action as a, characters as c WHERE a.guid = c.guid AND a.spec = c.activespec AND a.guid = ? ORDER BY button", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_CHARACTER_MAILCOUNT, "SELECT COUNT(id) FROM mail WHERE receiver = ? AND (checked & 1) = 0 AND deliver_time <= ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_CHARACTER_MAILDATE, "SELECT MIN(deliver_time) FROM mail WHERE receiver = ? AND (checked & 1) = 0", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_SEL_MAIL_COUNT, "SELECT COUNT(*) FROM mail WHERE receiver = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_SEL_CHARACTER_SOCIALLIST, "SELECT friend, flags, note FROM character_social JOIN characters ON characters.guid = character_social.friend WHERE character_social.guid = ? AND deleteinfos_name IS NULL LIMIT 255", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_CHARACTER_HOMEBIND, "SELECT mapId, zoneId, posX, posY, posZ FROM character_homebind WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_CHARACTER_SPELLCOOLDOWNS, "SELECT spell, item, time FROM character_spell_cooldown WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_CHARACTER_DECLINEDNAMES, "SELECT genitive, dative, accusative, instrumental, prepositional FROM character_declinedname WHERE guid = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_SEL_GUILD_MEMBER, "SELECT guildid, rank FROM guild_member WHERE guid = ?", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_SEL_GUILD_MEMBER, "SELECT guildid, rank FROM guild_member WHERE guid = ?", CONNECTION_BOTH) PREPARE_STATEMENT(CHAR_SEL_CHARACTER_ACHIEVEMENTS, "SELECT achievement, date FROM character_achievement WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_CHARACTER_CRITERIAPROGRESS, "SELECT criteria, counter, date FROM character_achievement_progress WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_CHARACTER_EQUIPMENTSETS, "SELECT setguid, setindex, name, iconname, item0, item1, item2, item3, item4, item5, item6, item7, item8, " @@ -103,8 +112,10 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_SEL_AUCTIONS, "SELECT id, auctioneerguid, itemguid, itemEntry, itemowner, buyoutprice, time, buyguid, lastbid, startbid, deposit FROM auctionhouse ah INNER JOIN item_instance ii ON ii.guid = ah.itemguid", CONNECTION_SYNCH) PREPARE_STATEMENT(CHAR_INS_AUCTION, "INSERT INTO auctionhouse (id, auctioneerguid, itemguid, itemowner, buyoutprice, time, buyguid, lastbid, startbid, deposit) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_AUCTION, "DELETE FROM auctionhouse WHERE id = ?", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_SEL_AUCTION_BY_TIME, "SELECT id FROM auctionhouse WHERE time <= ? ORDER BY TIME ASC", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_UPD_AUCTION_BID, "UPDATE auctionhouse SET buyguid = ?, lastbid = ? WHERE id = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_INS_MAIL, "INSERT INTO mail(id, messageType, stationery, mailTemplateId, sender, receiver, subject, body, has_items, expire_time, deliver_time, money, cod, checked) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_MAIL, "DELETE FROM mail WHERE id = ?", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_DEL_MAIL_BY_ID, "DELETE FROM mail WHERE id = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_INS_MAIL_ITEM, "INSERT INTO mail_items(mail_id, item_guid, receiver) VALUES (?, ?, ?)", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_MAIL_ITEM, "DELETE FROM mail_items WHERE item_guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_DEL_INVALID_MAIL_ITEM, "DELETE FROM mail_items WHERE item_guid = ?", CONNECTION_ASYNC); @@ -120,17 +131,20 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_DEL_ITEM_BOP_TRADE, "DELETE FROM item_soulbound_trade_data WHERE itemGuid = ? LIMIT 1", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_INS_ITEM_BOP_TRADE, "INSERT INTO item_soulbound_trade_data VALUES (?, ?)", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_REP_INVENTORY_ITEM, "REPLACE INTO character_inventory (guid, bag, slot, item) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_INVENTORY_ITEM, "DELETE FROM character_inventory WHERE item = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_REP_ITEM_INSTANCE, "REPLACE INTO item_instance (itemEntry, owner_guid, creatorGuid, giftCreatorGuid, count, duration, charges, flags, enchantments, randomPropertyId, durability, playedTime, text, guid) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_UPD_ITEM_INSTANCE, "UPDATE item_instance SET itemEntry = ?, owner_guid = ?, creatorGuid = ?, giftCreatorGuid = ?, count = ?, duration = ?, charges = ?, flags = ?, enchantments = ?, randomPropertyId = ?, durability = ?, playedTime = ?, text = ? WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_UPD_ITEM_INSTANCE_ON_LOAD, "UPDATE item_instance SET duration = ?, flags = ?, durability = ? WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_ITEM_INSTANCE, "DELETE FROM item_instance WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_UPD_GIFT_OWNER, "UPDATE character_gifts SET guid = ? WHERE item_guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_GIFT, "DELETE FROM character_gifts WHERE item_guid = ?", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_SEL_CHARACTER_GIFT_BY_ITEM, "SELECT entry, flags FROM character_gifts WHERE item_guid = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_SEL_ACCOUNT_BY_NAME, "SELECT account FROM characters WHERE name = ?", CONNECTION_SYNCH) + PREPARE_STATEMENT(CHAR_SEL_ACCOUNT_BY_GUID, "SELECT account FROM characters WHERE guid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_ACCOUNT_NAME_BY_GUID, "SELECT account, name FROM characters WHERE guid = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_DEL_ACCOUNT_INSTANCE_LOCK_TIMES, "DELETE FROM account_instance_times WHERE accountId = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_INS_ACCOUNT_INSTANCE_LOCK_TIMES, "INSERT INTO account_instance_times (accountId, instanceId, releaseTime) VALUES (?, ?, ?)", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_CHARACTER_NAME_CLASS, "SELECT name, class FROM characters WHERE guid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHARACTER_NAME, "SELECT name FROM characters WHERE guid = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_SEL_MATCH_MAKER_RATING, "SELECT matchMakerRating FROM character_arena_stats WHERE guid = ? AND slot = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_SEL_CHARACTER_COUNT, "SELECT account, COUNT(guid) FROM characters WHERE account = ? GROUP BY account", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_UPD_NAME, "UPDATE characters set name = ?, at_login = at_login & ~ ? WHERE guid = ?", CONNECTION_ASYNC); @@ -229,13 +243,12 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_DEL_EQUIP_SET, "DELETE FROM character_equipmentsets WHERE setguid=?", CONNECTION_ASYNC) // Auras - PREPARE_STATEMENT(CHAR_DEL_AURA, "DELETE FROM character_aura WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_INS_AURA, "INSERT INTO character_aura (guid, caster_guid, item_guid, spell, effect_mask, recalculate_mask, stackcount, amount0, amount1, amount2, base_amount0, base_amount1, base_amount2, maxduration, remaintime, remaincharges) " "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) // Account data PREPARE_STATEMENT(CHAR_SEL_ACCOUNT_DATA, "SELECT type, time, data FROM account_data WHERE accountId = ?", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_REP_ACCOUNT_DATA, "REPLACE INTO account_data(accountId, type, time, data) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_REP_ACCOUNT_DATA, "REPLACE INTO account_data (accountId, type, time, data) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_ACCOUNT_DATA, "DELETE FROM account_data WHERE accountId = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_PLAYER_ACCOUNT_DATA, "SELECT type, time, data FROM character_account_data WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_REP_PLAYER_ACCOUNT_DATA, "REPLACE INTO character_account_data(guid, type, time, data) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC) @@ -266,6 +279,13 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_SEL_PETITION_SIGNATURE, "SELECT playerguid FROM petition_sign WHERE petitionguid = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_DEL_ALL_PETITION_SIGNATURES, "DELETE FROM petition_sign WHERE playerguid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_DEL_PETITION_SIGNATURE, "DELETE FROM petition_sign WHERE playerguid = ? AND type = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_SEL_PETITION_BY_OWNER, "SELECT petitionguid FROM petition WHERE ownerguid = ? AND type = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_PETITION_TYPE, "SELECT type FROM petition WHERE petitionguid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_PETITION_SIGNATURES, "SELECT ownerguid, (SELECT COUNT(playerguid) FROM petition_sign WHERE petition_sign.petitionguid = ?) AS signs, type FROM petition WHERE petitionguid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_PETITION_SIG_BY_ACCOUNT, "SELECT playerguid FROM petition_sign WHERE player_account = ? AND petitionguid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_PETITION_OWNER_BY_GUID, "SELECT ownerguid FROM petition WHERE petitionguid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_PETITION_SIG_BY_GUID, "SELECT ownerguid, petitionguid FROM petition_sign WHERE playerguid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_PETITION_SIG_BY_GUID_TYPE, "SELECT ownerguid, petitionguid FROM petition_sign WHERE playerguid = ? AND type = ?", CONNECTION_SYNCH); // Arena teams PREPARE_STATEMENT(CHAR_SEL_CHARACTER_ARENAINFO, "SELECT arenaTeamId, weekGames, seasonGames, seasonWins, personalRating FROM arena_team_member WHERE guid = ?", CONNECTION_ASYNC) @@ -283,7 +303,6 @@ void CharacterDatabaseConnection::DoPrepareStatements() // Character battleground data PREPARE_STATEMENT(CHAR_INS_PLAYER_BGDATA, "INSERT INTO character_battleground_data (guid, instanceId, team, joinX, joinY, joinZ, joinO, joinMapId, taxiStart, taxiEnd, mountSpell) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_PLAYER_BGDATA, "DELETE FROM character_battleground_data WHERE guid = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_UPD_PLAYERS_BGDATA, "UPDATE character_battleground_data SET instanceId = 0", CONNECTION_SYNCH) // Character homebind PREPARE_STATEMENT(CHAR_INS_PLAYER_HOMEBIND, "INSERT INTO character_homebind (guid, mapId, zoneId, posX, posY, posZ) VALUES (?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) @@ -296,7 +315,6 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_DEL_CORPSE, "DELETE FROM corpse WHERE corpseGuid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_PLAYER_CORPSES, "DELETE FROM corpse WHERE guid = ? AND corpseType <> 0", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_OLD_CORPSES, "DELETE FROM corpse WHERE corpseType = 0 OR time < (UNIX_TIMESTAMP(NOW()) - ?)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_UPD_NONEXISTENT_INSTANCE_FOR_CORPSES, "UPDATE corpse SET instanceId = 0 WHERE instanceId > 0 AND instanceId NOT IN (SELECT id FROM instance)", CONNECTION_SYNCH) // Creature respawn PREPARE_STATEMENT(CHAR_SEL_CREATURE_RESPAWNS, "SELECT guid, respawnTime, instanceId FROM creature_respawn", CONNECTION_SYNCH) @@ -305,15 +323,12 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_DEL_CREATURE_RESPAWN_BY_GUID, "DELETE FROM creature_respawn WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_CREATURE_RESPAWN_BY_INSTANCE, "DELETE FROM creature_respawn WHERE instanceId = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_MAX_CREATURE_RESPAWNS, "SELECT MAX(respawnTime), instanceId FROM creature_respawn WHERE instanceId > 0 GROUP BY instanceId", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_DEL_NONEXISTENT_INSTANCE_CREATURE_RESPAWNS, "DELETE FROM creature_respawn WHERE instanceId > 0 AND instanceId NOT IN (SELECT id FROM instance)", CONNECTION_SYNCH) // Gameobject respawn PREPARE_STATEMENT(CHAR_SEL_GO_RESPAWNS, "SELECT guid, respawnTime, instanceId FROM gameobject_respawn", CONNECTION_SYNCH) PREPARE_STATEMENT(CHAR_REP_GO_RESPAWN, "REPLACE INTO gameobject_respawn (guid, respawnTime, instanceId) VALUES (?, ?, ?)", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_GO_RESPAWN, "DELETE FROM gameobject_respawn WHERE guid = ? AND instanceId = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_GO_RESPAWN_BY_INSTANCE, "DELETE FROM gameobject_respawn WHERE instanceId = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_EXPIRED_GO_RESPAWNS, "DELETE FROM gameobject_respawn WHERE respawnTime <= UNIX_TIMESTAMP(NOW())", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_DEL_NONEXISTENT_INSTANCE_GO_RESPAWNS, "DELETE FROM gameobject_respawn WHERE instanceId > 0 AND instanceId NOT IN (SELECT id FROM instance)", CONNECTION_SYNCH) // GM Tickets PREPARE_STATEMENT(CHAR_SEL_GM_TICKETS, "SELECT ticketId, guid, name, message, createTime, mapId, posX, posY, posZ, lastModifiedTime, closedBy, assignedTo, comment, completed, escalated, viewed FROM gm_tickets", CONNECTION_SYNCH) @@ -324,7 +339,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() // GM Survey/subsurvey/lag report PREPARE_STATEMENT(CHAR_INS_GM_SURVEY, "INSERT INTO gm_surveys (guid, surveyId, mainSurvey, overallComment, createTime) VALUES (?, ?, ?, ?, UNIX_TIMESTAMP(NOW()))", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_INS_GM_SUBSURVEY, "INSERT INTO gm_subsurveys (surveyId, subsurveyId, rank, comment) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_INS_LAG_REPORT, "INSERT INTO lag_reports (guid, lagType, mapId, posX, posY, posZ) VALUES (?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_INS_LAG_REPORT, "INSERT INTO lag_reports (guid, lagType, mapId, posX, posY, posZ, latency, createTime) VALUES (?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) // For loading and deleting expired auctions at startup PREPARE_STATEMENT(CHAR_SEL_EXPIRED_AUCTIONS, "SELECT id, auctioneerguid, itemguid, itemEntry, itemowner, buyoutprice, time, buyguid, lastbid, startbid, deposit FROM auctionhouse ah INNER JOIN item_instance ii ON ii.guid = ah.itemguid WHERE ah.time <= ?", CONNECTION_SYNCH) @@ -386,7 +401,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_UPD_CHAR_NAME_AT_LOGIN, "UPDATE characters set name = ?, at_login = at_login & ~ ? WHERE guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_UPD_WORLDSTATE, "UPDATE worldstates SET value = ? WHERE entry = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_INS_WORLDSTATE, "INSERT INTO worldstates (entry, value) VALUES (?, ?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_DEL_CHAR_INSTANCE, "DELETE FROM character_instance WHERE guid = ? AND instance = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_INSTANCE_BY_INSTANCE_GUID, "DELETE FROM character_instance WHERE guid = ? AND instance = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_UPD_CHAR_INSTANCE, "UPDATE character_instance SET instance = ?, permanent = ? WHERE guid = ? AND instance = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_INS_CHAR_INSTANCE, "INSERT INTO character_instance (guid, instance, permanent) VALUES (?, ?, ?)", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_UPD_GENDER_PLAYERBYTES, "UPDATE characters SET gender = ?, playerBytes = ?, playerBytes2 = ? WHERE guid = ?", CONNECTION_ASYNC); @@ -397,5 +412,145 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_DEL_CHARACTER_SOCIAL, "DELETE FROM character_social WHERE guid = ? AND friend = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_UPD_CHARACTER_SOCIAL_NOTE, "UPDATE character_social SET note = ? WHERE guid = ? AND friend = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_UPD_CHARACTER_POSITION, "UPDATE characters SET position_x = ?, position_y = ?, position_z = ?, orientation = ?, map = ?, zone = ?, trans_x = 0, trans_y = 0, trans_z = 0, transguid = 0, taxi_path = '' WHERE guid = ?", CONNECTION_ASYNC); - + PREPARE_STATEMENT(CHAR_SEL_CHARACTER_AURA_FROZEN, "SELECT characters.name FROM characters LEFT JOIN character_aura ON (characters.guid = character_aura.guid) WHERE character_aura.spell = 9454", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHARACTER_ONLINE, "SELECT name, account, map, zone FROM characters WHERE online > 0", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_DEL_INFO_BY_GUID, "SELECT guid, deleteInfos_Name, deleteInfos_Account, deleteDate FROM characters WHERE deleteDate IS NOT NULL AND guid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_DEL_INFO_BY_NAME, "SELECT guid, deleteInfos_Name, deleteInfos_Account, deleteDate FROM characters WHERE deleteDate IS NOT NULL AND deleteInfos_Name LIKE CONCAT('%%', ?, '%%')", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_DEL_INFO, "SELECT guid, deleteInfos_Name, deleteInfos_Account, deleteDate FROM characters WHERE deleteDate IS NOT NULL", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHARS_BY_ACCOUNT_ID, "SELECT guid FROM characters WHERE account = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_PINFO, "SELECT totaltime, level, money, account, race, class, map, zone FROM characters WHERE guid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_PINFO_BANS, "SELECT unbandate, bandate = unbandate, bannedby, banreason FROM character_banned WHERE guid = ? AND active ORDER BY bandate ASC LIMIT 1", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_HOMEBIND, "SELECT mapId, zoneId, posX, posY, posZ FROM character_homebind WHERE guid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_GUID_NAME_BY_ACC, "SELECT guid, name FROM characters WHERE account = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_POOL_QUEST_SAVE, "SELECT quest_id FROM pool_quest_save WHERE pool_id = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHARACTER_AT_LOGIN, "SELECT at_login FROM characters WHERE guid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_CLASS_LVL_AT_LOGIN, "SELECT class, level, at_login FROM characters WHERE guid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_INSTANCE, "SELECT data, completedEncounters FROM instance WHERE map = ? AND id = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_PET_SPELL_LIST, "SELECT DISTINCT pet_spell.spell FROM pet_spell, character_pet WHERE character_pet.owner = ? AND character_pet.id = pet_spell.guid AND character_pet.id <> ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_PET, "SELECT id FROM character_pet WHERE owner = ? AND id <> ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_PETS, "SELECT id FROM character_pet WHERE owner = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_COD_ITEM_MAIL, "SELECT id, messageType, mailTemplateId, sender, subject, body, money, has_items FROM mail WHERE receiver = ? AND has_items <> 0 AND cod <> 0", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_SOCIAL, "SELECT DISTINCT guid FROM character_social WHERE friend = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_PET_AURA, "SELECT caster_guid, spell, effect_mask, recalculate_mask, stackcount, amount0, amount1, amount2, base_amount0, base_amount1, base_amount2, maxduration, remaintime, remaincharges FROM pet_aura WHERE guid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_OLD_CHARS, "SELECT guid, deleteInfos_Account FROM characters WHERE deleteDate IS NOT NULL AND deleteDate < ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_ARENA_TEAM_ID_BY_PLAYER_GUID, "SELECT arena_team_member.arenateamid FROM arena_team_member JOIN arena_team ON arena_team_member.arenateamid = arena_team.arenateamid WHERE guid = ? AND type = ? LIMIT 1", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_MAIL, "SELECT id, messageType, sender, receiver, subject, body, has_items, expire_time, deliver_time, money, cod, checked, stationery, mailTemplateId FROM mail WHERE receiver = ? ORDER BY id DESC", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_PLAYERBYTES2, "SELECT playerBytes2 FROM characters WHERE guid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_PET_SPELL, "SELECT spell, active FROM pet_spell WHERE guid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_PET_SPELL_COOLDOWN, "SELECT spell, time FROM pet_spell_cooldown WHERE guid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_PET_DECLINED_NAME, "SELECT genitive, dative, accusative, instrumental, prepositional FROM character_pet_declinedname WHERE owner = ? AND id = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_GUID_BY_NAME, "SELECT guid FROM characters WHERE name = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_DEL_CHAR_AURA_FROZEN, "DELETE FROM character_aura WHERE spell = 9454 AND guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_SEL_CHAR_INVENTORY_COUNT_ITEM, "SELECT COUNT(itemEntry) FROM character_inventory ci INNER JOIN item_instance ii ON ii.guid = ci.item WHERE itemEntry = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_MAIL_COUNT_ITEM, "SELECT COUNT(itemEntry) FROM mail_items mi INNER JOIN item_instance ii ON ii.guid = mi.item_guid WHERE itemEntry = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_AUCTIONHOUSE_COUNT_ITEM,"SELECT COUNT(itemEntry) FROM auctionhouse ah INNER JOIN item_instance ii ON ii.guid = ah.itemguid WHERE itemEntry = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_GUILD_BANK_COUNT_ITEM, "SELECT COUNT(itemEntry) FROM guild_bank_item gbi INNER JOIN item_instance ii ON ii.guid = gbi.item_guid WHERE itemEntry = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_INVENTORY_ITEM_BY_ENTRY, "SELECT ci.item, cb.slot AS bag, ci.slot, ci.guid, c.account, c.name FROM characters c INNER JOIN character_inventory ci ON ci.guid = c.guid INNER JOIN item_instance ii ON ii.guid = ci.item LEFT JOIN character_inventory cb ON cb.item = ci.bag WHERE ii.itemEntry = ? LIMIT ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_MAIL_ITEMS_BY_ENTRY, "SELECT mi.item_guid, m.sender, m.receiver, cs.account, cs.name, cr.account, cr.name FROM mail m INNER JOIN mail_items mi ON mi.mail_id = m.id INNER JOIN item_instance ii ON ii.guid = mi.item_guid INNER JOIN characters cs ON cs.guid = m.sender INNER JOIN characters cr ON cr.guid = m.receiver WHERE ii.itemEntry = ? LIMIT ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_AUCTIONHOUSE_ITEM_BY_ENTRY, "SELECT ah.itemguid, ah.itemowner, c.account, c.name FROM auctionhouse ah INNER JOIN characters c ON c.guid = ah.itemowner INNER JOIN item_instance ii ON ii.guid = ah.itemguid WHERE ii.itemEntry = ? LIMIT ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_GUILD_BANK_ITEM_BY_ENTRY, "SELECT gi.item_guid, gi.guildid, g.name FROM guild_bank_item gi INNER JOIN guild g ON g.guildid = gi.guildid INNER JOIN item_instance ii ON ii.guid = gi.item_guid WHERE ii.itemEntry = ? LIMIT ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_PET_BY_ENTRY, "SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, curhappiness, abdata, savetime, CreatedBySpell, PetType FROM character_pet WHERE owner = ? AND id = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_PET_BY_ENTRY_AND_SLOT_2, "SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, curhappiness, abdata, savetime, CreatedBySpell, PetType FROM character_pet WHERE owner = ? AND entry = ? AND (slot = ? OR slot > ?)", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_PET_BY_SLOT, "SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, curhappiness, abdata, savetime, CreatedBySpell, PetType FROM character_pet WHERE owner = ? AND (slot = ? OR slot > ?) ", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_DEL_CHAR_ACHIEVEMENT, "DELETE FROM character_achievement WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_ACHIEVEMENT_PROGRESS, "DELETE FROM character_achievement_progress WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_REPUTATION_BY_FACTION, "DELETE FROM character_reputation WHERE guid = ? AND faction = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_INS_CHAR_REPUTATION_BY_FACTION, "INSERT INTO character_reputation (guid, faction, standing, flags) VALUES (?, ?, ? , ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_UPD_CHAR_ARENA_POINTS, "UPDATE characters SET arenaPoints = (arenaPoints + ?) WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_ITEM_REFUND_INSTANCE, "DELETE FROM item_refund_instance WHERE item_guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_INS_ITEM_REFUND_INSTANCE, "INSERT INTO item_refund_instance (item_guid, player_guid, paidMoney, paidExtendedCost) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_GROUP, "DELETE FROM groups WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_GROUP_MEMBER_ALL, "DELETE FROM group_member WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_INS_CHAR_GIFT, "INSERT INTO character_gifts (guid, item_guid, entry, flags) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_INSTANCE_BY_INSTANCE, "DELETE FROM instance WHERE id = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_INSTANCE_BY_INSTANCE, "DELETE FROM character_instance WHERE instance = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_INSTANCE_BY_MAP_DIFF, "DELETE FROM character_instance USING character_instance LEFT JOIN instance ON character_instance.instance = id WHERE map = ? and difficulty = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_GROUP_INSTANCE_BY_MAP_DIFF, "DELETE FROM group_instance USING group_instance LEFT JOIN instance ON group_instance.instance = id WHERE map = ? and difficulty = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_INSTANCE_BY_MAP_DIFF, "DELETE FROM instance WHERE map = ? and difficulty = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_MAIL_ITEM_BY_ID, "DELETE FROM mail_items WHERE mail_id = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_PET_DECLINEDNAME, "DELETE FROM character_pet_declinedname WHERE id = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_ADD_CHAR_PET_DECLINEDNAME, "INSERT INTO character_pet_declinedname (id, owner, genitive, dative, accusative, instrumental, prepositional) VALUES (?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_UPD_CHAR_PET_NAME, "UPDATE character_pet SET name = ?, renamed = 1 WHERE owner = ? AND id = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_INS_PETITION, "INSERT INTO petition (ownerguid, petitionguid, name, type) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_PETITION_BY_GUID, "DELETE FROM petition WHERE petitionguid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_PETITION_SIGNATURE_BY_GUID, "DELETE FROM petition_sign WHERE petitionguid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_UDP_CHAR_PET_SLOT_BY_SLOT_EXCLUDE_ID, "UPDATE character_pet SET slot = ? WHERE owner = ? AND slot = ? AND id <> ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_UDP_CHAR_PET_SLOT_BY_SLOT, "UPDATE character_pet SET slot = ? WHERE owner = ? AND slot = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_UPD_CHAR_PET_SLOT_BY_ID, "UPDATE character_pet SET slot = ? WHERE owner = ? AND id = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_PET_BY_ID, "DELETE FROM character_pet WHERE id = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_PET_BY_SLOT, "DELETE FROM character_pet WHERE owner = ? AND (slot = ? OR slot > ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_PET_AURAS, "DELETE FROM pet_aura WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_PET_SPELLS, "DELETE FROM pet_spell WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_PET_SPELL_COOLDOWNS, "DELETE FROM pet_spell_cooldown WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_INS_PET_SPELL_COOLDOWN, "INSERT INTO pet_spell_cooldown (guid, spell, time) VALUES (?, ?, ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_PET_SPELL_BY_SPELL, "DELETE FROM pet_spell WHERE guid = ? and spell = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_INS_PET_SPELL, "INSERT INTO pet_spell (guid, spell, active) VALUES (?, ?, ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_INS_PET_AURA, "INSERT INTO pet_aura (guid, caster_guid, spell, effect_mask, recalculate_mask, stackcount, amount0, amount1, amount2, base_amount0, base_amount1, base_amount2, maxduration, remaintime, remaincharges) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_DECLINED_NAME, "DELETE FROM character_declinedname WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_INS_CHAR_DECLINED_NAME, "INSERT INTO character_declinedname (guid, genitive, dative, accusative, instrumental, prepositional) VALUES (?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_UPD_FACTION_OR_RACE, "UPDATE characters SET name = ?, race = ?, at_login = at_login & ~ ? WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_SKILL_LANGUAGES, "DELETE FROM character_skills WHERE skill IN (98, 113, 759, 111, 313, 109, 115, 315, 673, 137) AND guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_INS_CHAR_SKILL_LANGUAGE, "INSERT INTO `character_skills` (guid, skill, value, max) VALUES (?, ?, 300, 300)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_UPD_CHAR_TAXI_PATH, "UPDATE characters SET taxi_path = '' WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_UPD_CHAR_TAXIMASK, "UPDATE characters SET taximask = ? WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_QUESTSTATUS, "DELETE FROM character_queststatus WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_SOCIAL_BY_GUID, "DELETE FROM character_social WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_SOCIAL_BY_FRIEND, "DELETE FROM character_social WHERE friend = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_ACHIEVEMENT_BY_ACHIEVEMENT, "DELETE FROM character_achievement WHERE achievement = ? AND guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_UPD_CHAR_ACHIEVEMENT, "UPDATE character_achievement SET achievement = ? where achievement = ? AND guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_UPD_CHAR_INVENTORY_FACTION_CHANGE, "UPDATE item_instance ii, character_inventory ci SET ii.itemEntry = ? WHERE ii.itemEntry = ? AND ci.guid = ? AND ci.item = ii.guid", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_SPELL_BY_SPELL, "DELETE FROM character_spell WHERE spell = ? AND guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_UPD_CHAR_SPELL_FACTION_CHANGE, "UPDATE character_spell SET spell = ? where spell = ? AND guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_REP_BY_FACTION, "DELETE FROM character_reputation WHERE faction = ? AND guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_UPD_CHAR_REP_FACTION_CHANGE, "UPDATE character_reputation SET faction = ? where faction = ? AND guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_SPELL_COOLDOWN, "DELETE FROM character_spell_cooldown WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHARACTER, "DELETE FROM characters WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_ACTION, "DELETE FROM character_action WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_AURA, "DELETE FROM character_aura WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_GIFT, "DELETE FROM character_gifts WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_INSTANCE, "DELETE FROM character_instance WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_INVENTORY, "DELETE FROM character_inventory WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_QUESTSTATUS_REWARDED, "DELETE FROM character_queststatus_rewarded WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_REPUTATION, "DELETE FROM character_reputation WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_SPELL, "DELETE FROM character_spell WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_MAIL, "DELETE FROM mail WHERE receiver = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_MAIL_ITEMS, "DELETE FROM mail_items WHERE receiver = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_PET_BY_OWNER, "DELETE FROM character_pet WHERE owner = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_PET_DECLINEDNAME_BY_OWNER, "DELETE FROM character_pet_declinedname WHERE owner = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_ACHIEVEMENTS, "DELETE FROM character_achievement WHERE guid = ? AND achievement NOT BETWEEN '456' AND '467' AND achievement NOT BETWEEN '1400' AND '1427' AND achievement NOT IN(1463, 3117, 3259)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_EQUIPMENTSETS, "DELETE FROM character_equipmentsets WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_GUILD_EVENTLOG_BY_PLAYER, "DELETE FROM guild_eventlog WHERE PlayerGuid1 = ? OR PlayerGuid2 = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_GUILD_BANK_EVENTLOG_BY_PLAYER, "DELETE FROM guild_bank_eventlog WHERE PlayerGuid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_GLYPHS, "DELETE FROM character_glyphs WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_QUESTSTATUS_DAILY, "DELETE FROM character_queststatus_daily WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_TALENT, "DELETE FROM character_talent WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_SKILLS, "DELETE FROM character_skills WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_UDP_CHAR_HONOR_POINTS, "UPDATE characters SET totalHonorPoints = ? WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_UDP_CHAR_ARENA_POINTS, "UPDATE characters SET arenaPoints = ? WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_UDP_CHAR_MONEY, "UPDATE characters SET money = ? WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_INS_CHAR_ACTION, "INSERT INTO character_action (guid, spec, button, action, type) VALUES (?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_UPD_CHAR_ACTION, "UPDATE character_action SET action = ?, type = ? WHERE guid = ? AND button = ? AND spec = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_ACTION_BY_BUTTON_SPEC, "DELETE FROM character_action WHERE guid = ? and button = ? and spec = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_INVENTORY_BY_ITEM, "DELETE FROM character_inventory WHERE item = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_INVENTORY_BY_BAG_SLOT, "DELETE FROM character_inventory WHERE bag = ? AND slot = ? AND guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_UPD_MAIL, "UPDATE mail SET has_items = ?, expire_time = ?, deliver_time = ?, money = ?, cod = ?, checked = ? WHERE id = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_REP_CHAR_QUESTSTATUS, "REPLACE INTO character_queststatus (guid, quest, status, explored, timer, mobcount1, mobcount2, mobcount3, mobcount4, itemcount1, itemcount2, itemcount3, itemcount4, playercount) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_QUESTSTATUS_BY_QUEST, "DELETE FROM character_queststatus WHERE guid = ? AND quest = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_INS_CHAR_QUESTSTATUS, "INSERT IGNORE INTO character_queststatus_rewarded (guid, quest) VALUES (?, ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_QUESTSTATUS_REWARDED_BY_QUEST, "DELETE FROM character_queststatus_rewarded WHERE guid = ? AND quest = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_SKILL_BY_SKILL, "DELETE FROM character_skills WHERE guid = ? AND skill = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_INS_CHAR_SKILLS, "INSERT INTO character_skills (guid, skill, value, max) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_UDP_CHAR_SKILLS, "UPDATE character_skills SET value = ?, max = ? WHERE guid = ? AND skill = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_INS_CHAR_SPELL, "INSERT INTO character_spell (guid, spell, active, disabled) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_STATS, "DELETE FROM character_stats WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_INS_CHAR_STATS, "INSERT INTO character_stats (guid, maxhealth, maxpower1, maxpower2, maxpower3, maxpower4, maxpower5, maxpower6, maxpower7, strength, agility, stamina, intellect, spirit, armor, resHoly, resFire, resNature, resFrost, resShadow, resArcane, blockPct, dodgePct, parryPct, critPct, rangedCritPct, spellCritPct, attackPower, rangedAttackPower, spellPower, resilience) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_PETITION_BY_OWNER, "DELETE FROM petition WHERE ownerguid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_PETITION_SIGNATURE_BY_OWNER, "DELETE FROM petition_sign WHERE ownerguid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_PETITION_BY_OWNER_AND_TYPE, "DELETE FROM petition WHERE ownerguid = ? AND type = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_PETITION_SIGNATURE_BY_OWNER_AND_TYPE, "DELETE FROM petition_sign WHERE ownerguid = ? AND type = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_INS_CHAR_GLYPHS, "INSERT INTO character_glyphs VALUES(?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_TALENT_BY_SPELL_SPEC, "DELETE FROM character_talent WHERE guid = ? and spell = ? and spec = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_INS_CHAR_TALENT, "INSERT INTO character_talent (guid, spell, spec) VALUES (?, ?, ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_ACTION_EXCEPT_SPEC, "DELETE FROM character_action WHERE spec<>? AND guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_SEL_CHAR_PET_BY_ENTRY_AND_SLOT, "SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, curhappiness, abdata, savetime, CreatedBySpell, PetType FROM character_pet WHERE owner = ? AND slot = ?", CONNECTION_SYNCH); } diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.h b/src/server/shared/Database/Implementation/CharacterDatabase.h index fa3654dc0c9..85b948f6ce6 100755 --- a/src/server/shared/Database/Implementation/CharacterDatabase.h +++ b/src/server/shared/Database/Implementation/CharacterDatabase.h @@ -48,10 +48,12 @@ enum CharacterDatabaseStatements CHAR_DEL_EXPIRED_BANS, CHAR_SEL_GUID_BY_NAME, CHAR_SEL_CHECK_NAME, + CHAR_SEL_CHECK_GUID, CHAR_SEL_SUM_CHARS, CHAR_SEL_CHAR_CREATE_INFO, CHAR_INS_CHARACTER_BAN, CHAR_UPD_CHARACTER_BAN, + CHAR_DEL_CHARACTER_BAN, CHAR_SEL_BANINFO, CHAR_SEL_GUID_BY_NAME_FILTER, CHAR_SEL_BANINFO_LIST, @@ -64,6 +66,12 @@ enum CharacterDatabaseStatements CHAR_SEL_PET_SLOT_BY_ID, CHAR_SEL_FREE_NAME, CHAR_SEL_GUID_RACE_ACC_BY_NAME, + CHAR_SEL_CHAR_RACE, + CHAR_SEL_CHAR_LEVEL, + CHAR_SEL_CHAR_ZONE, + CHAR_SEL_CHARACTER_NAME_DATA, + CHAR_SEL_CHAR_POSITION_XYZ, + CHAR_SEL_CHAR_POSITION, CHAR_DEL_QUEST_STATUS_DAILY, CHAR_DEL_QUEST_STATUS_WEEKLY, CHAR_DEL_QUEST_STATUS_SEASONAL, @@ -91,6 +99,7 @@ enum CharacterDatabaseStatements CHAR_SEL_CHARACTER_ACTIONS_SPEC, CHAR_SEL_CHARACTER_MAILCOUNT, CHAR_SEL_CHARACTER_MAILDATE, + CHAR_SEL_MAIL_COUNT, CHAR_SEL_CHARACTER_SOCIALLIST, CHAR_SEL_CHARACTER_HOMEBIND, CHAR_SEL_CHARACTER_SPELLCOOLDOWNS, @@ -112,9 +121,11 @@ enum CharacterDatabaseStatements CHAR_SEL_AUCTION_ITEMS, CHAR_INS_AUCTION, CHAR_DEL_AUCTION, + CHAR_SEL_AUCTION_BY_TIME, + CHAR_UPD_AUCTION_BID, CHAR_SEL_AUCTIONS, CHAR_INS_MAIL, - CHAR_DEL_MAIL, + CHAR_DEL_MAIL_BY_ID, CHAR_INS_MAIL_ITEM, CHAR_DEL_MAIL_ITEM, CHAR_DEL_INVALID_MAIL_ITEM, @@ -129,21 +140,24 @@ enum CharacterDatabaseStatements CHAR_DEL_ITEM_BOP_TRADE, CHAR_INS_ITEM_BOP_TRADE, CHAR_REP_INVENTORY_ITEM, - CHAR_DEL_INVENTORY_ITEM, CHAR_REP_ITEM_INSTANCE, CHAR_UPD_ITEM_INSTANCE, CHAR_UPD_ITEM_INSTANCE_ON_LOAD, CHAR_DEL_ITEM_INSTANCE, CHAR_UPD_GIFT_OWNER, CHAR_DEL_GIFT, + CHAR_SEL_CHARACTER_GIFT_BY_ITEM, CHAR_SEL_ACCOUNT_BY_NAME, + CHAR_SEL_ACCOUNT_BY_GUID, CHAR_DEL_ACCOUNT_INSTANCE_LOCK_TIMES, CHAR_INS_ACCOUNT_INSTANCE_LOCK_TIMES, CHAR_SEL_CHARACTER_NAME_CLASS, + CHAR_SEL_CHARACTER_NAME, CHAR_SEL_MATCH_MAKER_RATING, CHAR_SEL_CHARACTER_COUNT, CHAR_UPD_NAME, CHAR_DEL_DECLINED_NAME, + CHAR_SEL_ACCOUNT_NAME_BY_GUID, CHAR_INS_GUILD, CHAR_DEL_GUILD, @@ -220,7 +234,6 @@ enum CharacterDatabaseStatements CHAR_INS_EQUIP_SET, CHAR_DEL_EQUIP_SET, - CHAR_DEL_AURA, CHAR_INS_AURA, CHAR_SEL_ACCOUNT_DATA, @@ -261,10 +274,16 @@ enum CharacterDatabaseStatements CHAR_SEL_PETITION_SIGNATURE, CHAR_DEL_ALL_PETITION_SIGNATURES, CHAR_DEL_PETITION_SIGNATURE, + CHAR_SEL_PETITION_BY_OWNER, + CHAR_SEL_PETITION_TYPE, + CHAR_SEL_PETITION_SIGNATURES, + CHAR_SEL_PETITION_SIG_BY_ACCOUNT, + CHAR_SEL_PETITION_OWNER_BY_GUID, + CHAR_SEL_PETITION_SIG_BY_GUID, + CHAR_SEL_PETITION_SIG_BY_GUID_TYPE, CHAR_INS_PLAYER_BGDATA, CHAR_DEL_PLAYER_BGDATA, - CHAR_UPD_PLAYERS_BGDATA, CHAR_INS_PLAYER_HOMEBIND, CHAR_UPD_PLAYER_HOMEBIND, @@ -275,7 +294,6 @@ enum CharacterDatabaseStatements CHAR_DEL_CORPSE, CHAR_DEL_PLAYER_CORPSES, CHAR_DEL_OLD_CORPSES, - CHAR_UPD_NONEXISTENT_INSTANCE_FOR_CORPSES, CHAR_SEL_CREATURE_RESPAWNS, CHAR_REP_CREATURE_RESPAWN, @@ -283,14 +301,11 @@ enum CharacterDatabaseStatements CHAR_DEL_CREATURE_RESPAWN_BY_GUID, CHAR_DEL_CREATURE_RESPAWN_BY_INSTANCE, CHAR_SEL_MAX_CREATURE_RESPAWNS, - CHAR_DEL_NONEXISTENT_INSTANCE_CREATURE_RESPAWNS, CHAR_SEL_GO_RESPAWNS, CHAR_REP_GO_RESPAWN, CHAR_DEL_GO_RESPAWN, CHAR_DEL_GO_RESPAWN_BY_INSTANCE, - CHAR_DEL_EXPIRED_GO_RESPAWNS, - CHAR_DEL_NONEXISTENT_INSTANCE_GO_RESPAWNS, CHAR_SEL_GM_TICKETS, CHAR_REP_GM_TICKET, @@ -342,7 +357,7 @@ enum CharacterDatabaseStatements CHAR_UPD_CHAR_NAME_AT_LOGIN, CHAR_UPD_WORLDSTATE, CHAR_INS_WORLDSTATE, - CHAR_DEL_CHAR_INSTANCE, + CHAR_DEL_CHAR_INSTANCE_BY_INSTANCE_GUID, CHAR_UPD_CHAR_INSTANCE, CHAR_INS_CHAR_INSTANCE, CHAR_UPD_GENDER_PLAYERBYTES, @@ -357,6 +372,150 @@ enum CharacterDatabaseStatements CHAR_INS_LFG_DATA, CHAR_DEL_LFG_DATA, + CHAR_SEL_CHARACTER_AURA_FROZEN, + CHAR_SEL_CHARACTER_ONLINE, + + CHAR_SEL_CHAR_DEL_INFO_BY_GUID, + CHAR_SEL_CHAR_DEL_INFO_BY_NAME, + CHAR_SEL_CHAR_DEL_INFO, + + CHAR_SEL_CHARS_BY_ACCOUNT_ID, + CHAR_SEL_CHAR_PINFO, + CHAR_SEL_PINFO_BANS, + CHAR_SEL_CHAR_HOMEBIND, + CHAR_SEL_CHAR_GUID_NAME_BY_ACC, + CHAR_SEL_POOL_QUEST_SAVE, + CHAR_SEL_CHARACTER_AT_LOGIN, + CHAR_SEL_CHAR_CLASS_LVL_AT_LOGIN, + CHAR_SEL_INSTANCE, + CHAR_SEL_PET_SPELL_LIST, + CHAR_SEL_CHAR_PET, + CHAR_SEL_CHAR_PETS, + CHAR_SEL_CHAR_COD_ITEM_MAIL, + CHAR_SEL_CHAR_SOCIAL, + CHAR_SEL_PET_AURA, + CHAR_SEL_CHAR_OLD_CHARS, + CHAR_SEL_ARENA_TEAM_ID_BY_PLAYER_GUID, + CHAR_SEL_MAIL, + CHAR_SEL_CHAR_PLAYERBYTES2, + CHAR_SEL_PET_SPELL, + CHAR_SEL_PET_SPELL_COOLDOWN, + CHAR_SEL_PET_DECLINED_NAME, + CHAR_SEL_CHAR_GUID_BY_NAME, + CHAR_DEL_CHAR_AURA_FROZEN, + CHAR_SEL_CHAR_INVENTORY_COUNT_ITEM, + CHAR_SEL_MAIL_COUNT_ITEM, + CHAR_SEL_AUCTIONHOUSE_COUNT_ITEM, + CHAR_SEL_GUILD_BANK_COUNT_ITEM, + CHAR_SEL_CHAR_INVENTORY_ITEM_BY_ENTRY, + CHAR_SEL_MAIL_ITEMS_BY_ENTRY, + CHAR_SEL_AUCTIONHOUSE_ITEM_BY_ENTRY, + CHAR_SEL_GUILD_BANK_ITEM_BY_ENTRY, + CHAR_SEL_CHAR_PET_BY_ENTRY, + CHAR_SEL_CHAR_PET_BY_ENTRY_AND_SLOT_2, + CHAR_SEL_CHAR_PET_BY_SLOT, + CHAR_DEL_CHAR_ACHIEVEMENT, + CHAR_DEL_CHAR_ACHIEVEMENT_PROGRESS, + CHAR_DEL_CHAR_REPUTATION_BY_FACTION, + CHAR_INS_CHAR_REPUTATION_BY_FACTION, + CHAR_UPD_CHAR_ARENA_POINTS, + CHAR_DEL_ITEM_REFUND_INSTANCE, + CHAR_INS_ITEM_REFUND_INSTANCE, + CHAR_DEL_GROUP, + CHAR_DEL_GROUP_MEMBER_ALL, + CHAR_INS_CHAR_GIFT, + CHAR_DEL_INSTANCE_BY_INSTANCE, + CHAR_DEL_CHAR_INSTANCE_BY_INSTANCE, + CHAR_DEL_CHAR_INSTANCE_BY_MAP_DIFF, + CHAR_DEL_GROUP_INSTANCE_BY_MAP_DIFF, + CHAR_DEL_INSTANCE_BY_MAP_DIFF, + CHAR_DEL_MAIL_ITEM_BY_ID, + CHAR_DEL_CHAR_PET_DECLINEDNAME, + CHAR_ADD_CHAR_PET_DECLINEDNAME, + CHAR_UPD_CHAR_PET_NAME, + CHAR_INS_PETITION, + CHAR_DEL_PETITION_BY_GUID, + CHAR_DEL_PETITION_SIGNATURE_BY_GUID, + CHAR_UDP_CHAR_PET_SLOT_BY_SLOT_EXCLUDE_ID, + CHAR_UDP_CHAR_PET_SLOT_BY_SLOT, + CHAR_UPD_CHAR_PET_SLOT_BY_ID, + CHAR_DEL_CHAR_PET_BY_ID, + CHAR_DEL_CHAR_PET_BY_SLOT, + CHAR_DEL_PET_AURAS, + CHAR_DEL_PET_SPELLS, + CHAR_DEL_PET_SPELL_COOLDOWNS, + CHAR_INS_PET_SPELL_COOLDOWN, + CHAR_DEL_PET_SPELL_BY_SPELL, + CHAR_INS_PET_SPELL, + CHAR_INS_PET_AURA, + CHAR_DEL_CHAR_DECLINED_NAME, + CHAR_INS_CHAR_DECLINED_NAME, + CHAR_UPD_FACTION_OR_RACE, + CHAR_DEL_CHAR_SKILL_LANGUAGES, + CHAR_INS_CHAR_SKILL_LANGUAGE, + CHAR_UPD_CHAR_TAXI_PATH, + CHAR_UPD_CHAR_TAXIMASK, + CHAR_DEL_CHAR_QUESTSTATUS, + CHAR_DEL_CHAR_SOCIAL_BY_GUID, + CHAR_DEL_CHAR_SOCIAL_BY_FRIEND, + CHAR_DEL_CHAR_ACHIEVEMENT_BY_ACHIEVEMENT, + CHAR_UPD_CHAR_ACHIEVEMENT, + CHAR_UPD_CHAR_INVENTORY_FACTION_CHANGE, + CHAR_DEL_CHAR_SPELL_BY_SPELL, + CHAR_UPD_CHAR_SPELL_FACTION_CHANGE, + CHAR_DEL_CHAR_REP_BY_FACTION, + CHAR_UPD_CHAR_REP_FACTION_CHANGE, + CHAR_DEL_CHAR_SPELL_COOLDOWN, + CHAR_DEL_CHARACTER, + CHAR_DEL_CHAR_ACTION, + CHAR_DEL_CHAR_AURA, + CHAR_DEL_CHAR_GIFT, + CHAR_DEL_CHAR_INSTANCE, + CHAR_DEL_CHAR_INVENTORY, + CHAR_DEL_CHAR_QUESTSTATUS_REWARDED, + CHAR_DEL_CHAR_REPUTATION, + CHAR_DEL_CHAR_SPELL, + CHAR_DEL_MAIL, + CHAR_DEL_MAIL_ITEMS, + CHAR_DEL_CHAR_PET_BY_OWNER, + CHAR_DEL_CHAR_PET_DECLINEDNAME_BY_OWNER, + CHAR_DEL_CHAR_ACHIEVEMENTS, + CHAR_DEL_CHAR_EQUIPMENTSETS, + CHAR_DEL_GUILD_EVENTLOG_BY_PLAYER, + CHAR_DEL_GUILD_BANK_EVENTLOG_BY_PLAYER, + CHAR_DEL_CHAR_GLYPHS, + CHAR_DEL_CHAR_QUESTSTATUS_DAILY, + CHAR_DEL_CHAR_TALENT, + CHAR_DEL_CHAR_SKILLS, + CHAR_UDP_CHAR_HONOR_POINTS, + CHAR_UDP_CHAR_ARENA_POINTS, + CHAR_UDP_CHAR_MONEY, + CHAR_INS_CHAR_ACTION, + CHAR_UPD_CHAR_ACTION, + CHAR_DEL_CHAR_ACTION_BY_BUTTON_SPEC, + CHAR_DEL_CHAR_INVENTORY_BY_ITEM, + CHAR_DEL_CHAR_INVENTORY_BY_BAG_SLOT, + CHAR_UPD_MAIL, + CHAR_REP_CHAR_QUESTSTATUS, + CHAR_DEL_CHAR_QUESTSTATUS_BY_QUEST, + CHAR_INS_CHAR_QUESTSTATUS, + CHAR_DEL_CHAR_QUESTSTATUS_REWARDED_BY_QUEST, + CHAR_DEL_CHAR_SKILL_BY_SKILL, + CHAR_INS_CHAR_SKILLS, + CHAR_UDP_CHAR_SKILLS, + CHAR_INS_CHAR_SPELL, + CHAR_DEL_CHAR_STATS, + CHAR_INS_CHAR_STATS, + CHAR_DEL_PETITION_BY_OWNER, + CHAR_DEL_PETITION_SIGNATURE_BY_OWNER, + CHAR_DEL_PETITION_BY_OWNER_AND_TYPE, + CHAR_DEL_PETITION_SIGNATURE_BY_OWNER_AND_TYPE, + CHAR_INS_CHAR_GLYPHS, + CHAR_DEL_CHAR_TALENT_BY_SPELL_SPEC, + CHAR_INS_CHAR_TALENT, + CHAR_DEL_CHAR_ACTION_EXCEPT_SPEC, + CHAR_SEL_CHAR_PET_BY_ENTRY_AND_SLOT, + MAX_CHARACTERDATABASE_STATEMENTS, }; diff --git a/src/server/shared/Database/Implementation/LoginDatabase.cpp b/src/server/shared/Database/Implementation/LoginDatabase.cpp index 8ef8d3b48cf..028d927a720 100755 --- a/src/server/shared/Database/Implementation/LoginDatabase.cpp +++ b/src/server/shared/Database/Implementation/LoginDatabase.cpp @@ -22,13 +22,18 @@ void LoginDatabaseConnection::DoPrepareStatements() if (!m_reconnecting) m_stmts.resize(MAX_LOGINDATABASE_STATEMENTS); - PREPARE_STATEMENT(LOGIN_SEL_REALMLIST, "SELECT id, name, address, port, icon, color, timezone, allowedSecurityLevel, population, gamebuild FROM realmlist WHERE color <> 3 ORDER BY name", CONNECTION_SYNCH) + PREPARE_STATEMENT(LOGIN_SEL_REALMLIST, "SELECT id, name, address, port, icon, flag, timezone, allowedSecurityLevel, population, gamebuild FROM realmlist WHERE flag <> 3 ORDER BY name", CONNECTION_SYNCH) PREPARE_STATEMENT(LOGIN_DEL_EXPIRED_IP_BANS, "DELETE FROM ip_banned WHERE unbandate<>bandate AND unbandate<=UNIX_TIMESTAMP()", CONNECTION_ASYNC) PREPARE_STATEMENT(LOGIN_UPD_EXPIRED_ACCOUNT_BANS, "UPDATE account_banned SET active = 0 WHERE active = 1 AND unbandate<>bandate AND unbandate<=UNIX_TIMESTAMP()", CONNECTION_ASYNC) PREPARE_STATEMENT(LOGIN_SEL_IP_BANNED, "SELECT * FROM ip_banned WHERE ip = ?", CONNECTION_SYNCH) PREPARE_STATEMENT(LOGIN_INS_IP_AUTO_BANNED, "INSERT INTO ip_banned VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, 'Trinity realmd', 'Failed login autoban')", CONNECTION_ASYNC) + PREPARE_STATEMENT(LOGIN_SEL_IP_BANNED_ALL, "SELECT ip, bandate, unbandate, bannedby, banreason FROM ip_banned WHERE (bandate = unbandate OR unbandate > UNIX_TIMESTAMP()) ORDER BY unbandate", CONNECTION_SYNCH); + PREPARE_STATEMENT(LOGIN_SEL_IP_BANNED_BY_IP, "SELECT ip, bandate, unbandate, bannedby, banreason FROM ip_banned WHERE (bandate = unbandate OR unbandate > UNIX_TIMESTAMP()) AND ip LIKE CONCAT('%%', ?, '%%') ORDER BY unbandate", CONNECTION_SYNCH); PREPARE_STATEMENT(LOGIN_SEL_ACCOUNT_BANNED, "SELECT bandate, unbandate FROM account_banned WHERE id = ? AND active = 1", CONNECTION_SYNCH) + PREPARE_STATEMENT(LOGIN_SEL_ACCOUNT_BANNED_ALL, "SELECT account.id, username FROM account, account_banned WHERE account.id = account_banned.id AND active = 1 GROUP BY account.id", CONNECTION_SYNCH); + PREPARE_STATEMENT(LOGIN_SEL_ACCOUNT_BANNED_BY_USERNAME, "SELECT account.id, username FROM account, account_banned WHERE account.id = account_banned.id AND active = 1 AND username LIKE CONCAT('%%', ?, '%%') GROUP BY account.id", CONNECTION_SYNCH); PREPARE_STATEMENT(LOGIN_INS_ACCOUNT_AUTO_BANNED, "INSERT INTO account_banned VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, 'Trinity realmd', 'Failed login autoban', 1)", CONNECTION_ASYNC) + PREPARE_STATEMENT(LOGIN_DEL_ACCOUNT_BANNED, "DELETE FROM account_banned WHERE id = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(LOGIN_SEL_SESSIONKEY, "SELECT a.sessionkey, a.id, aa.gmlevel FROM account a LEFT JOIN account_access aa ON (a.id = aa.id) WHERE username = ?", CONNECTION_SYNCH) PREPARE_STATEMENT(LOGIN_UPD_VS, "UPDATE account SET v = ?, s = ? WHERE username = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(LOGIN_UPD_LOGONPROOF, "UPDATE account SET sessionkey = ?, last_ip = ?, last_login = NOW(), locale = ?, failed_logins = 0, os = ? WHERE username = ?", CONNECTION_ASYNC) @@ -36,19 +41,22 @@ void LoginDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(LOGIN_UPD_FAILEDLOGINS, "UPDATE account SET failed_logins = failed_logins + 1 WHERE username = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(LOGIN_SEL_FAILEDLOGINS, "SELECT id, failed_logins FROM account WHERE username = ?", CONNECTION_SYNCH) PREPARE_STATEMENT(LOGIN_SEL_ACCOUNT_ID_BY_NAME, "SELECT id FROM account WHERE username = ?", CONNECTION_SYNCH) + PREPARE_STATEMENT(LOGIN_SEL_ACCOUNT_LIST_BY_NAME, "SELECT id, username FROM account WHERE username = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(LOGIN_SEL_ACCOUNT_INFO_BY_NAME, "SELECT id, sessionkey, last_ip, locked, v, s, expansion, mutetime, locale, recruiter, os FROM account WHERE username = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(LOGIN_SEL_ACCOUNT_LIST_BY_EMAIL, "SELECT id, username FROM account WHERE email = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(LOGIN_SEL_NUM_CHARS_ON_REALM, "SELECT numchars FROM realmcharacters WHERE realmid = ? AND acctid= ?", CONNECTION_SYNCH) - PREPARE_STATEMENT(LOGIN_SEL_ACCOUNT_BY_IP, "SELECT id FROM account WHERE last_ip = ?", CONNECTION_SYNCH) + PREPARE_STATEMENT(LOGIN_SEL_ACCOUNT_BY_IP, "SELECT id, username FROM account WHERE last_ip = ?", CONNECTION_SYNCH) + PREPARE_STATEMENT(LOGIN_SEL_ACCOUNT_BY_ID, "SELECT 1 FROM account WHERE id = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(LOGIN_INS_IP_BANNED, "INSERT INTO ip_banned VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, ?, ?)", CONNECTION_ASYNC) PREPARE_STATEMENT(LOGIN_DEL_IP_NOT_BANNED, "DELETE FROM ip_banned WHERE ip = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(LOGIN_INS_ACCOUNT_BANNED, "INSERT INTO account_banned VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, ?, ?, 1)", CONNECTION_ASYNC) PREPARE_STATEMENT(LOGIN_UPD_ACCOUNT_NOT_BANNED, "UPDATE account_banned SET active = 0 WHERE id = ? AND active != 0", CONNECTION_ASYNC) - PREPARE_STATEMENT(LOGIN_DEL_REALM_CHARACTERS, "DELETE FROM realmcharacters WHERE acctid = ? AND realmid = ?", CONNECTION_ASYNC) + PREPARE_STATEMENT(LOGIN_DEL_REALM_CHARACTERS_BY_REALM, "DELETE FROM realmcharacters WHERE acctid = ? AND realmid = ?", CONNECTION_ASYNC) + PREPARE_STATEMENT(LOGIN_DEL_REALM_CHARACTERS, "DELETE FROM realmcharacters WHERE acctid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(LOGIN_INS_REALM_CHARACTERS, "INSERT INTO realmcharacters (numchars, acctid, realmid) VALUES (?, ?, ?)", CONNECTION_ASYNC) PREPARE_STATEMENT(LOGIN_SEL_SUM_REALM_CHARACTERS, "SELECT SUM(numchars) FROM realmcharacters WHERE acctid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(LOGIN_INS_ACCOUNT, "INSERT INTO account(username, sha_pass_hash, joindate) VALUES(?, ?, NOW())", CONNECTION_ASYNC); PREPARE_STATEMENT(LOGIN_INS_REALM_CHARACTERS_INIT, "INSERT INTO realmcharacters (realmid, acctid, numchars) SELECT realmlist.id, account.id, 0 FROM realmlist, account LEFT JOIN realmcharacters ON acctid=account.id WHERE acctid IS NULL", CONNECTION_ASYNC); - PREPARE_STATEMENT(LOGIN_DEL_OLD_BANS, "DELETE FROM ip_banned WHERE unbandate <= UNIX_TIMESTAMP() AND unbandate<>bandate", CONNECTION_ASYNC); - PREPARE_STATEMENT(LOGIN_DEL_OLD_IP_BANS, "DELETE FROM ip_banned WHERE unbandate <= UNIX_TIMESTAMP() AND unbandate<>bandate", CONNECTION_ASYNC); PREPARE_STATEMENT(LOGIN_UPD_EXPANSION, "UPDATE account SET expansion = ? WHERE id = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(LOGIN_UPD_ACCOUNT_LOCK, "UPDATE account SET locked = ? WHERE id = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(LOGIN_INS_LOG, "INSERT INTO logs (time, realm, type, string) VALUES (UNIX_TIMESTAMP(), ? , ?, ?)", CONNECTION_ASYNC); @@ -62,4 +70,21 @@ void LoginDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(LOGIN_DEL_ACCOUNT_ACCESS, "DELETE FROM account_access WHERE id = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(LOGIN_DEL_ACCOUNT_ACCESS_BY_REALM, "DELETE FROM account_access WHERE id = ? AND (RealmID = ? OR RealmID = -1)", CONNECTION_ASYNC); PREPARE_STATEMENT(LOGIN_INS_ACCOUNT_ACCESS, "INSERT INTO account_access (id,gmlevel,RealmID) VALUES (?, ?, ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(LOGIN_GET_ACCOUNT_ID_BY_USERNAME, "SELECT id FROM account WHERE username = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(LOGIN_GET_ACCOUNT_ACCESS_GMLEVEL, "SELECT gmlevel FROM account_access WHERE id = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(LOGIN_GET_GMLEVEL_BY_REALMID, "SELECT gmlevel FROM account_access WHERE id = ? AND (RealmID = ? OR RealmID = -1)", CONNECTION_SYNCH); + PREPARE_STATEMENT(LOGIN_GET_USERNAME_BY_ID, "SELECT username FROM account WHERE id = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(LOGIN_SEL_CHECK_PASSWORD, "SELECT 1 FROM account WHERE id = ? AND sha_pass_hash = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(LOGIN_SEL_CHECK_PASSWORD_BY_NAME, "SELECT 1 FROM account WHERE username = ? AND sha_pass_hash = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(LOGIN_SEL_PINFO, "SELECT a.username, aa.gmlevel, a.email, a.last_ip, DATE_FORMAT(a.last_login, '%Y-%m-%d %T'), a.mutetime FROM account a LEFT JOIN account_access aa ON (a.id = aa.id AND (aa.RealmID = ? OR aa.RealmID = -1)) WHERE a.id = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(LOGIN_SEL_PINFO_BANS, "SELECT unbandate, bandate = unbandate, bannedby, banreason FROM account_banned WHERE id = ? AND active ORDER BY bandate ASC LIMIT 1", CONNECTION_SYNCH); + PREPARE_STATEMENT(LOGIN_SEL_GM_ACCOUNTS, "SELECT a.username, aa.gmlevel FROM account a, account_access aa WHERE a.id=aa.id AND aa.gmlevel >= ? AND (aa.realmid = -1 OR aa.realmid = ?)", CONNECTION_SYNCH); + PREPARE_STATEMENT(LOGIN_SEL_ACCOUNT_INFO, "SELECT a.username, a.last_ip, aa.gmlevel, a.expansion FROM account a LEFT JOIN account_access aa ON (a.id = aa.id) WHERE a.id = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(LOGIN_SEL_ACCOUNT_ACCESS_GMLEVEL_TEST, "SELECT 1 FROM account_access WHERE id = ? AND gmlevel > ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(LOGIN_SEL_ACCOUNT_ACCESS, "SELECT a.id, aa.gmlevel, aa.RealmID FROM account a LEFT JOIN account_access aa ON (a.id = aa.id) WHERE a.username = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(LOGIN_SEL_ACCOUNT_RECRUITER, "SELECT 1 FROM account WHERE recruiter = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(LOGIN_SEL_BANS, "SELECT 1 FROM account_banned WHERE id = ? AND active = 1 UNION SELECT 1 FROM ip_banned WHERE ip = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(LOGIN_SEL_ACCOUNT_WHOIS, "SELECT username, email, last_ip FROM account WHERE id = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(LOGIN_SEL_REALMLIST_SECURITY_LEVEL, "SELECT allowedSecurityLevel from realmlist WHERE id = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(LOGIN_DEL_ACCOUNT, "DELETE FROM account WHERE id = ?", CONNECTION_ASYNC); } diff --git a/src/server/shared/Database/Implementation/LoginDatabase.h b/src/server/shared/Database/Implementation/LoginDatabase.h index afb188020c7..7c2a94eec94 100755 --- a/src/server/shared/Database/Implementation/LoginDatabase.h +++ b/src/server/shared/Database/Implementation/LoginDatabase.h @@ -48,7 +48,10 @@ enum LoginDatabaseStatements LOGIN_SEL_IP_BANNED, LOGIN_INS_IP_AUTO_BANNED, LOGIN_SEL_ACCOUNT_BANNED, + LOGIN_SEL_ACCOUNT_BANNED_ALL, + LOGIN_SEL_ACCOUNT_BANNED_BY_USERNAME, LOGIN_INS_ACCOUNT_AUTO_BANNED, + LOGIN_DEL_ACCOUNT_BANNED, LOGIN_SEL_SESSIONKEY, LOGIN_UPD_VS, LOGIN_UPD_LOGONPROOF, @@ -56,19 +59,24 @@ enum LoginDatabaseStatements LOGIN_UPD_FAILEDLOGINS, LOGIN_SEL_FAILEDLOGINS, LOGIN_SEL_ACCOUNT_ID_BY_NAME, + LOGIN_SEL_ACCOUNT_LIST_BY_NAME, + LOGIN_SEL_ACCOUNT_INFO_BY_NAME, + LOGIN_SEL_ACCOUNT_LIST_BY_EMAIL, LOGIN_SEL_NUM_CHARS_ON_REALM, LOGIN_SEL_ACCOUNT_BY_IP, LOGIN_INS_IP_BANNED, LOGIN_DEL_IP_NOT_BANNED, + LOGIN_SEL_IP_BANNED_ALL, + LOGIN_SEL_IP_BANNED_BY_IP, + LOGIN_SEL_ACCOUNT_BY_ID, LOGIN_INS_ACCOUNT_BANNED, LOGIN_UPD_ACCOUNT_NOT_BANNED, + LOGIN_DEL_REALM_CHARACTERS_BY_REALM, LOGIN_DEL_REALM_CHARACTERS, LOGIN_INS_REALM_CHARACTERS, LOGIN_SEL_SUM_REALM_CHARACTERS, LOGIN_INS_ACCOUNT, LOGIN_INS_REALM_CHARACTERS_INIT, - LOGIN_DEL_OLD_BANS, - LOGIN_DEL_OLD_IP_BANS, LOGIN_UPD_EXPANSION, LOGIN_UPD_ACCOUNT_LOCK, LOGIN_INS_LOG, @@ -82,6 +90,23 @@ enum LoginDatabaseStatements LOGIN_DEL_ACCOUNT_ACCESS, LOGIN_DEL_ACCOUNT_ACCESS_BY_REALM, LOGIN_INS_ACCOUNT_ACCESS, + LOGIN_GET_ACCOUNT_ID_BY_USERNAME, + LOGIN_GET_ACCOUNT_ACCESS_GMLEVEL, + LOGIN_GET_GMLEVEL_BY_REALMID, + LOGIN_GET_USERNAME_BY_ID, + LOGIN_SEL_CHECK_PASSWORD, + LOGIN_SEL_CHECK_PASSWORD_BY_NAME, + LOGIN_SEL_PINFO, + LOGIN_SEL_PINFO_BANS, + LOGIN_SEL_GM_ACCOUNTS, + LOGIN_SEL_ACCOUNT_INFO, + LOGIN_SEL_ACCOUNT_ACCESS_GMLEVEL_TEST, + LOGIN_SEL_ACCOUNT_ACCESS, + LOGIN_SEL_ACCOUNT_RECRUITER, + LOGIN_SEL_BANS, + LOGIN_SEL_ACCOUNT_WHOIS, + LOGIN_SEL_REALMLIST_SECURITY_LEVEL, + LOGIN_DEL_ACCOUNT, MAX_LOGINDATABASE_STATEMENTS, }; diff --git a/src/server/shared/Database/Implementation/WorldDatabase.cpp b/src/server/shared/Database/Implementation/WorldDatabase.cpp index d7d8491008b..e3455891909 100755 --- a/src/server/shared/Database/Implementation/WorldDatabase.cpp +++ b/src/server/shared/Database/Implementation/WorldDatabase.cpp @@ -36,6 +36,7 @@ void WorldDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(WORLD_DEL_GAME_TELE, "DELETE FROM game_tele WHERE name = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(WORLD_INS_NPC_VENODR, "INSERT INTO npc_vendor (entry, item, maxcount, incrtime, extendedcost) VALUES(?, ?, ?, ?, ?)", CONNECTION_ASYNC); PREPARE_STATEMENT(WORLD_DEL_NPC_VENDOR, "DELETE FROM npc_vendor WHERE entry = ? AND item = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(WORLD_SEL_NPC_VENDOR_REF, "SELECT item, maxcount, incrtime, ExtendedCost FROM npc_vendor WHERE entry = ? ORDER BY slot ASC", CONNECTION_SYNCH); PREPARE_STATEMENT(WORLD_UPD_CREATURE_MOVEMENT_TYPE, "UPDATE creature SET MovementType = ? WHERE guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(WORLD_UPD_CREATURE_FACTION, "UPDATE creature_template SET faction_A = ?, faction_H = ? WHERE entry = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(WORLD_UPD_CREATURE_NPCFLAG, "UPDATE creature_template SET npcflag = ? WHERE entry = ?", CONNECTION_ASYNC); @@ -48,10 +49,23 @@ void WorldDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(WORLD_UPD_WAYPOINT_DATA_POINT, "UPDATE waypoint_data SET point = point - 1 WHERE id = ? AND point > ?", CONNECTION_ASYNC); PREPARE_STATEMENT(WORLD_UPD_WAYPOINT_DATA_POSITION, "UPDATE waypoint_data SET position_x = ?, position_y = ?, position_z = ? where id = ? AND point = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(WORLD_UPD_WAYPOINT_DATA_WPGUID, "UPDATE waypoint_data SET wpguid = ? WHERE id = ? and point = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(WORLD_UPD_ALL_WAYPOINT_DATA_WPGUID, "UPDATE waypoint_data SET wpguid = 0", CONNECTION_ASYNC); + PREPARE_STATEMENT(WORLD_SEL_WAYPOINT_DATA_MAX_ID, "SELECT MAX(id) FROM waypoint_data", CONNECTION_SYNCH); + PREPARE_STATEMENT(WORLD_SEL_WAYPOINT_DATA_MAX_POINT, "SELECT MAX(point) FROM waypoint_data WHERE id = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(WORLD_SEL_WAYPOINT_DATA_BY_ID, "SELECT point, position_x, position_y, position_z, orientation, move_flag, delay, action, action_chance FROM waypoint_data WHERE id = ? ORDER BY point", CONNECTION_SYNCH); + PREPARE_STATEMENT(WORLD_SEL_WAYPOINT_DATA_POS_BY_ID, "SELECT point, position_x, position_y, position_z FROM waypoint_data WHERE id = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(WORLD_SEL_WAYPOINT_DATA_POS_FIRST_BY_ID, "SELECT position_x, position_y, position_z FROM waypoint_data WHERE point = 1 AND id = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(WORLD_SEL_WAYPOINT_DATA_POS_LAST_BY_ID, "SELECT position_x, position_y, position_z, orientation FROM waypoint_data WHERE id = ? ORDER BY point DESC LIMIT 1", CONNECTION_SYNCH); + PREPARE_STATEMENT(WORLD_SEL_WAYPOINT_DATA_BY_WPGUID, "SELECT id, point FROM waypoint_data WHERE wpguid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(WORLD_SEL_WAYPOINT_DATA_ALL_BY_WPGUID, "SELECT id, point, delay, move_flag, action, action_chance FROM waypoint_data WHERE wpguid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(WORLD_UPD_WAYPOINT_DATA_ALL_WPGUID, "UPDATE waypoint_data SET wpguid = 0", CONNECTION_ASYNC); + PREPARE_STATEMENT(WORLD_SEL_WAYPOINT_DATA_BY_POS, "SELECT id, point FROM waypoint_data WHERE (abs(position_x - ?) <= ?) and (abs(position_y - ?) <= ?) and (abs(position_z - ?) <= ?)", CONNECTION_SYNCH); + PREPARE_STATEMENT(WORLD_SEL_WAYPOINT_DATA_WPGUID_BY_ID, "SELECT wpguid FROM waypoint_data WHERE id = ? and wpguid <> 0", CONNECTION_SYNCH); + PREPARE_STATEMENT(WOLRD_SEL_WAYPOINT_DATA_ACTION, "SELECT DISTINCT action FROM waypoint_data", CONNECTION_SYNCH); + PREPARE_STATEMENT(WORLD_SEL_WAYPOINT_SCRIPTS_MAX_ID, "SELECT MAX(guid) FROM waypoint_scripts", CONNECTION_SYNCH); PREPARE_STATEMENT(WORLD_INS_CREATURE_ADDON, "INSERT INTO creature_addon(guid, path_id) VALUES (?, ?)", CONNECTION_ASYNC); PREPARE_STATEMENT(WORLD_UPD_CREATURE_ADDON_PATH, "UPDATE creature_addon SET path_id = ? WHERE guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(WORLD_DEL_CREATURE_ADDON, "DELETE FROM creature_addon WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(WORLD_SEL_CREATURE_ADDON_BY_GUID, "SELECT guid FROM creature_addon WHERE guid = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(WORLD_INS_WAYPOINT_SCRIPT, "INSERT INTO waypoint_scripts (guid) VALUES (?)", CONNECTION_ASYNC); PREPARE_STATEMENT(WORLD_DEL_WAYPOINT_SCRIPT, "DELETE FROM waypoint_scripts WHERE guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(WORLD_UPD_WAYPOINT_SCRIPT_ID, "UPDATE waypoint_scripts SET id = ? WHERE guid = ?", CONNECTION_ASYNC); @@ -59,5 +73,19 @@ void WorldDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(WORLD_UPD_WAYPOINT_SCRIPT_Y, "UPDATE waypoint_scripts SET y = ? WHERE guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(WORLD_UPD_WAYPOINT_SCRIPT_Z, "UPDATE waypoint_scripts SET z = ? WHERE guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(WORLD_UPD_WAYPOINT_SCRIPT_O, "UPDATE waypoint_scripts SET o = ? WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(WORLD_SEL_WAYPOINT_SCRIPT_ID_BY_GUID, "SELECT id FROM waypoint_scripts WHERE guid = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(WORLD_DEL_CREATURE, "DELETE FROM creature WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(WORLD_INS_CREATURE_TRANSPORT, "INSERT INTO creature_transport (guid, npc_entry, transport_entry, TransOffsetX, TransOffsetY, TransOffsetZ, TransOffsetO) values (?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(WORLD_UPD_CREATURE_TRANSPORT_EMOTE, "UPDATE creature_transport SET emote = ? WHERE transport_entry = ? AND guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(WORLD_SEL_COMMANDS, "SELECT name, security, help FROM command", CONNECTION_SYNCH); + PREPARE_STATEMENT(WORLD_SEL_CREATURE_TEMPLATE, "SELECT difficulty_entry_1, difficulty_entry_2, difficulty_entry_3, KillCredit1, KillCredit2, modelid1, modelid2, modelid3, modelid4, name, subname, IconName, gossip_menu_id, minlevel, maxlevel, exp, faction_A, faction_H, npcflag, speed_walk, speed_run, scale, rank, mindmg, maxdmg, dmgschool, attackpower, dmg_multiplier, baseattacktime, rangeattacktime, unit_class, unit_flags, dynamicflags, family, trainer_type, trainer_spell, trainer_class, trainer_race, minrangedmg, maxrangedmg, rangedattackpower, type, type_flags, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, PetSpellDataId, VehicleId, mingold, maxgold, AIName, MovementType, InhabitType, HoverHeight, Health_mod, Mana_mod, Armor_mod, RacialLeader, questItem1, questItem2, questItem3, questItem4, questItem5, questItem6, movementId, RegenHealth, equipment_id, mechanic_immune_mask, flags_extra, ScriptName FROM creature_template WHERE entry = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(WORLD_SEL_WAYPOINT_SCRIPT_BY_ID, "SELECT guid, delay, command, datalong, datalong2, dataint, x, y, z, o FROM waypoint_scripts WHERE id = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(WORLD_SEL_IP2NATION_COUNTRY, "SELECT c.country FROM ip2nationCountries c, ip2nation i WHERE i.ip < ? AND c.code = i.country ORDER BY i.ip DESC LIMIT 0,1", CONNECTION_SYNCH); + PREPARE_STATEMENT(WORLD_SEL_ITEM_TEMPLATE_BY_NAME, "SELECT entry FROM item_template WHERE name = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(WORLD_SEL_CREATURE_BY_ID, "SELECT guid FROM creature WHERE id = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(WORLD_SEL_GAMEOBJECT_NEAREST, "SELECT guid, id, position_x, position_y, position_z, map, (POW(position_x - ?, 2) + POW(position_y - ?, 2) + POW(position_z - ?, 2)) AS order_ FROM gameobject WHERE map = ? AND (POW(position_x - ?, 2) + POW(position_y - ?, 2) + POW(position_z - ?, 2)) <= ? ORDER BY order_", CONNECTION_SYNCH); + PREPARE_STATEMENT(WORLD_INS_CREATURE, "INSERT INTO creature (guid, id , map, spawnMask, phaseMask, modelid, equipment_id, position_x, position_y, position_z, orientation, spawntimesecs, spawndist, currentwaypoint, curhealth, curmana, MovementType, npcflag, unit_flags, dynamicflags) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(WORLD_DEL_GAME_EVENT_CREATURE, "DELETE FROM game_event_creature WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(WORLD_DEL_GAME_EVENT_MODEL_EQUIP, "DELETE FROM game_event_model_equip WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(WORLD_INS_GAMEOBJECT, "INSERT INTO gameobject (guid, id, map, spawnMask, phaseMask, position_x, position_y, position_z, orientation, rotation0, rotation1, rotation2, rotation3, spawntimesecs, animprogress, state) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); } diff --git a/src/server/shared/Database/Implementation/WorldDatabase.h b/src/server/shared/Database/Implementation/WorldDatabase.h index e708177503f..0580cecec7e 100755 --- a/src/server/shared/Database/Implementation/WorldDatabase.h +++ b/src/server/shared/Database/Implementation/WorldDatabase.h @@ -56,6 +56,7 @@ enum WorldDatabaseStatements WORLD_DEL_GAME_TELE, WORLD_INS_NPC_VENODR, WORLD_DEL_NPC_VENDOR, + WORLD_SEL_NPC_VENDOR_REF, WORLD_UPD_CREATURE_MOVEMENT_TYPE, WORLD_UPD_CREATURE_FACTION, WORLD_UPD_CREATURE_NPCFLAG, @@ -68,10 +69,23 @@ enum WorldDatabaseStatements WORLD_UPD_WAYPOINT_DATA_POINT, WORLD_UPD_WAYPOINT_DATA_POSITION, WORLD_UPD_WAYPOINT_DATA_WPGUID, - WORLD_UPD_ALL_WAYPOINT_DATA_WPGUID, + WORLD_UPD_WAYPOINT_DATA_ALL_WPGUID, + WORLD_SEL_WAYPOINT_DATA_MAX_ID, + WORLD_SEL_WAYPOINT_DATA_BY_ID, + WORLD_SEL_WAYPOINT_DATA_POS_BY_ID, + WORLD_SEL_WAYPOINT_DATA_POS_FIRST_BY_ID, + WORLD_SEL_WAYPOINT_DATA_POS_LAST_BY_ID, + WORLD_SEL_WAYPOINT_DATA_BY_WPGUID, + WORLD_SEL_WAYPOINT_DATA_ALL_BY_WPGUID, + WORLD_SEL_WAYPOINT_DATA_MAX_POINT, + WORLD_SEL_WAYPOINT_DATA_BY_POS, + WORLD_SEL_WAYPOINT_DATA_WPGUID_BY_ID, + WOLRD_SEL_WAYPOINT_DATA_ACTION, + WORLD_SEL_WAYPOINT_SCRIPTS_MAX_ID, WORLD_UPD_CREATURE_ADDON_PATH, WORLD_INS_CREATURE_ADDON, WORLD_DEL_CREATURE_ADDON, + WORLD_SEL_CREATURE_ADDON_BY_GUID, WORLD_INS_WAYPOINT_SCRIPT, WORLD_DEL_WAYPOINT_SCRIPT, WORLD_UPD_WAYPOINT_SCRIPT_ID, @@ -79,7 +93,22 @@ enum WorldDatabaseStatements WORLD_UPD_WAYPOINT_SCRIPT_Y, WORLD_UPD_WAYPOINT_SCRIPT_Z, WORLD_UPD_WAYPOINT_SCRIPT_O, + WORLD_SEL_WAYPOINT_SCRIPT_ID_BY_GUID, WORLD_DEL_CREATURE, + WORLD_INS_CREATURE_TRANSPORT, + WORLD_UPD_CREATURE_TRANSPORT_EMOTE, + WORLD_SEL_COMMANDS, + WORLD_SEL_CREATURE_TEMPLATE, + WORLD_SEL_WAYPOINT_SCRIPT_BY_ID, + WORLD_SEL_IP2NATION_COUNTRY, + WORLD_SEL_ITEM_TEMPLATE_BY_NAME, + WORLD_SEL_CREATURE_BY_ID, + WORLD_SEL_GAMEOBJECT_NEAREST, + WORLD_SEL_GAMEOBJECT_TARGET, + WORLD_INS_CREATURE, + WORLD_DEL_GAME_EVENT_CREATURE, + WORLD_DEL_GAME_EVENT_MODEL_EQUIP, + WORLD_INS_GAMEOBJECT, MAX_WORLDDATABASE_STATEMENTS, }; diff --git a/src/server/shared/Database/MySQLConnection.cpp b/src/server/shared/Database/MySQLConnection.cpp index f686db4c199..7fb4a4f7025 100755 --- a/src/server/shared/Database/MySQLConnection.cpp +++ b/src/server/shared/Database/MySQLConnection.cpp @@ -58,17 +58,13 @@ MySQLConnection::~MySQLConnection() { ASSERT (m_Mysql); /// MySQL context must be present at this point - sLog->outSQLDriver("MySQLConnection::~MySQLConnection()"); for (size_t i = 0; i < m_stmts.size(); ++i) delete m_stmts[i]; for (PreparedStatementMap::const_iterator itr = m_queries.begin(); itr != m_queries.end(); ++itr) - { free((void *)m_queries[itr->first].first); - } mysql_close(m_Mysql); - Unlock(); /// Unlock while we die, how ironic } void MySQLConnection::Close() diff --git a/src/server/shared/Database/PreparedStatement.cpp b/src/server/shared/Database/PreparedStatement.cpp index baeb591ffb1..db26dabaee7 100755 --- a/src/server/shared/Database/PreparedStatement.cpp +++ b/src/server/shared/Database/PreparedStatement.cpp @@ -42,12 +42,20 @@ void PreparedStatement::BindParameters() m_stmt->setBool(i, statement_data[i].data.boolean); break; case TYPE_UI8: + m_stmt->setUInt8(i, statement_data[i].data.ui8); + break; case TYPE_UI16: + m_stmt->setUInt16(i, statement_data[i].data.ui16); + break; case TYPE_UI32: m_stmt->setUInt32(i, statement_data[i].data.ui32); break; case TYPE_I8: + m_stmt->setInt8(i, statement_data[i].data.i8); + break; case TYPE_I16: + m_stmt->setInt16(i, statement_data[i].data.i16); + break; case TYPE_I32: m_stmt->setInt32(i, statement_data[i].data.i32); break; @@ -89,7 +97,7 @@ void PreparedStatement::setUInt8(const uint8 index, const uint8 value) if (index >= statement_data.size()) statement_data.resize(index+1); - statement_data[index].data.ui32 = value; + statement_data[index].data.ui8 = value; statement_data[index].type = TYPE_UI8; } @@ -98,7 +106,7 @@ void PreparedStatement::setUInt16(const uint8 index, const uint16 value) if (index >= statement_data.size()) statement_data.resize(index+1); - statement_data[index].data.ui32 = value; + statement_data[index].data.ui16 = value; statement_data[index].type = TYPE_UI16; } @@ -125,7 +133,7 @@ void PreparedStatement::setInt8(const uint8 index, const int8 value) if (index >= statement_data.size()) statement_data.resize(index+1); - statement_data[index].data.i32 = value; + statement_data[index].data.i8 = value; statement_data[index].type = TYPE_I8; } @@ -134,7 +142,7 @@ void PreparedStatement::setInt16(const uint8 index, const int16 value) if (index >= statement_data.size()) statement_data.resize(index+1); - statement_data[index].data.i32 = value; + statement_data[index].data.i16 = value; statement_data[index].type = TYPE_I16; } @@ -201,6 +209,11 @@ m_bind(NULL) MySQLPreparedStatement::~MySQLPreparedStatement() { ClearParameters(); + if(m_Mstmt->bind_result_done) + { + delete[] m_Mstmt->bind->length; + delete[] m_Mstmt->bind->is_null; + } mysql_stmt_close(m_Mstmt); delete[] m_bind; } @@ -230,17 +243,23 @@ bool MySQLPreparedStatement::CheckValidIndex(uint8 index) void MySQLPreparedStatement::setBool(const uint8 index, const bool value) { - setUInt32(index, value); + setUInt8(index, value ? 1 : 0); } void MySQLPreparedStatement::setUInt8(const uint8 index, const uint8 value) { - setUInt32(index, value); + CheckValidIndex(index); + m_paramsSet[index] = true; + MYSQL_BIND* param = &m_bind[index]; + setValue(param, MYSQL_TYPE_TINY, &value, sizeof(uint8), true); } void MySQLPreparedStatement::setUInt16(const uint8 index, const uint16 value) { - setUInt32(index, value); + CheckValidIndex(index); + m_paramsSet[index] = true; + MYSQL_BIND* param = &m_bind[index]; + setValue(param, MYSQL_TYPE_SHORT, &value, sizeof(uint16), true); } void MySQLPreparedStatement::setUInt32(const uint8 index, const uint32 value) @@ -261,12 +280,18 @@ void MySQLPreparedStatement::setUInt64(const uint8 index, const uint64 value) void MySQLPreparedStatement::setInt8(const uint8 index, const int8 value) { - setInt32(index, value); + CheckValidIndex(index); + m_paramsSet[index] = true; + MYSQL_BIND* param = &m_bind[index]; + setValue(param, MYSQL_TYPE_TINY, &value, sizeof(int8), false); } void MySQLPreparedStatement::setInt16(const uint8 index, const int16 value) { - setInt32(index, value); + CheckValidIndex(index); + m_paramsSet[index] = true; + MYSQL_BIND* param = &m_bind[index]; + setValue(param, MYSQL_TYPE_SHORT, &value, sizeof(int16), false); } void MySQLPreparedStatement::setInt32(const uint8 index, const int32 value) @@ -348,12 +373,20 @@ std::string MySQLPreparedStatement::getQueryString(const char *query) replace << (m_stmt->statement_data[i].data.boolean ? '1' : '0'); break; case TYPE_UI8: + replace << uint16(m_stmt->statement_data[i].data.ui8); // stringstream will append a character with that code instead of numeric representation + break; case TYPE_UI16: + replace << m_stmt->statement_data[i].data.ui16; + break; case TYPE_UI32: replace << m_stmt->statement_data[i].data.ui32; break; case TYPE_I8: + replace << int16(m_stmt->statement_data[i].data.i8); // stringstream will append a character with that code instead of numeric representation + break; case TYPE_I16: + replace << m_stmt->statement_data[i].data.i16; + break; case TYPE_I32: replace << m_stmt->statement_data[i].data.i32; break; diff --git a/src/server/shared/Database/QueryResult.h b/src/server/shared/Database/QueryResult.h index 524532f30ec..e32b16555bc 100755 --- a/src/server/shared/Database/QueryResult.h +++ b/src/server/shared/Database/QueryResult.h @@ -19,7 +19,7 @@ #ifndef QUERYRESULT_H #define QUERYRESULT_H -#include +#include "AutoPtr.h" #include #include "Field.h" @@ -58,7 +58,7 @@ class ResultSet MYSQL_FIELD* _fields; }; -typedef ACE_Refcounted_Auto_Ptr QueryResult; +typedef Trinity::AutoPtr QueryResult; class PreparedResultSet { @@ -103,7 +103,7 @@ class PreparedResultSet }; -typedef ACE_Refcounted_Auto_Ptr PreparedQueryResult; +typedef Trinity::AutoPtr PreparedQueryResult; #endif diff --git a/src/server/shared/Database/Transaction.h b/src/server/shared/Database/Transaction.h index 92002819951..805d48f76cf 100755 --- a/src/server/shared/Database/Transaction.h +++ b/src/server/shared/Database/Transaction.h @@ -47,7 +47,7 @@ class Transaction bool _cleanedUp; }; -typedef ACE_Refcounted_Auto_Ptr SQLTransaction; +typedef Trinity::AutoPtr SQLTransaction; /*! Low level class*/ class TransactionTask : public SQLOperation diff --git a/src/server/shared/Debugging/Errors.h b/src/server/shared/Debugging/Errors.h index 6927fdb483f..48a8bda32ed 100755 --- a/src/server/shared/Debugging/Errors.h +++ b/src/server/shared/Debugging/Errors.h @@ -24,10 +24,10 @@ #include #include -#define WPAssert( assertion ) { if (!(assertion)) { ACE_Stack_Trace st; sLog->outError( "\n%s:%i in %s ASSERTION FAILED:\n %s\n%s\n", __FILE__, __LINE__, __FUNCTION__, #assertion, st.c_str()); assert( #assertion &&0 ); ((void(*)())NULL)();} } -#define WPError( assertion, errmsg ) if ( ! (assertion) ) { sLog->outError( "%\n%s:%i in %s ERROR:\n %s\n", __FILE__, __LINE__, __FUNCTION__, (char *)errmsg ); assert( false ); } -#define WPWarning( assertion, errmsg ) if ( ! (assertion) ) { sLog->outError( "\n%s:%i in %s WARNING:\n %s\n", __FILE__, __LINE__, __FUNCTION__, (char *)errmsg ); } -#define WPFatal( assertion, errmsg ) if ( ! (assertion) ) { sLog->outError( "\n%s:%i in %s FATAL ERROR:\n %s\n", __FILE__, __LINE__, __FUNCTION__, (char *)errmsg ); ACE_OS::sleep(10); assert( #assertion &&0 ); abort(); } +#define WPAssert(assertion) { if (!(assertion)) { ACE_Stack_Trace st; sLog->outError("\n%s:%i in %s ASSERTION FAILED:\n %s\n%s\n", __FILE__, __LINE__, __FUNCTION__, #assertion, st.c_str()); *((volatile int*)NULL) = 0; } } +#define WPError(assertion, errmsg) { if (!(assertion)) { sLog->outError("%\n%s:%i in %s ERROR:\n %s\n", __FILE__, __LINE__, __FUNCTION__, (char *)errmsg); *((volatile int*)NULL) = 0; } } +#define WPWarning(assertion, errmsg) { if (!(assertion)) { sLog->outError("\n%s:%i in %s WARNING:\n %s\n", __FILE__, __LINE__, __FUNCTION__, (char *)errmsg); } } +#define WPFatal(assertion, errmsg) { if (!(assertion)) { sLog->outError("\n%s:%i in %s FATAL ERROR:\n %s\n", __FILE__, __LINE__, __FUNCTION__, (char *)errmsg); ACE_OS::sleep(10); *((volatile int*)NULL) = 0; } } #define ASSERT WPAssert #endif diff --git a/src/server/shared/Debugging/WheatyExceptionReport.cpp b/src/server/shared/Debugging/WheatyExceptionReport.cpp index 63648f66e29..febc5ef3573 100644 --- a/src/server/shared/Debugging/WheatyExceptionReport.cpp +++ b/src/server/shared/Debugging/WheatyExceptionReport.cpp @@ -195,7 +195,23 @@ BOOL WheatyExceptionReport::_GetWindowsVersion(TCHAR* szVersion, DWORD cntMax) case VER_PLATFORM_WIN32_NT: // Test for the specific product family. if (osvi.dwMajorVersion == 6) - _tcsncat(szVersion, _T("Windows Vista or Windows Server 2008 "), cntMax); + { + #if WINVER < 0x0500 + if (osvi.wReserved[1] == VER_NT_WORKSTATION) + #else + if (osvi.wProductType == VER_NT_WORKSTATION) + #endif // WINVER < 0x0500 + { + if (osvi.dwMinorVersion == 1) + _tcsncat(szVersion, _T("Windows 7 "), cntMax); + else + _tcsncat(szVersion, _T("Windows Vista "), cntMax); + } + else if (osvi.dwMinorVersion == 1) + _tcsncat(szVersion, _T("Windows Server 2008 R2 "), cntMax); + else + _tcsncat(szVersion, _T("Windows Server 2008 "), cntMax); + } if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2) _tcsncat(szVersion, _T("Microsoft Windows Server 2003 "), cntMax); if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1) diff --git a/src/server/shared/Dynamic/TypeContainerFunctionsPtr.h b/src/server/shared/Dynamic/TypeContainerFunctionsPtr.h deleted file mode 100755 index 2c065d96d4a..00000000000 --- a/src/server/shared/Dynamic/TypeContainerFunctionsPtr.h +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright (C) 2008-2012 TrinityCore - * Copyright (C) 2005-2009 MaNGOS - * - * 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; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; 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, see . - */ - -#ifndef TYPECONTAINER_FUNCTIONS_PTR_H -#define TYPECONTAINER_FUNCTIONS_PTR_H - -/* - * Here you'll find a list of helper functions to make - * the TypeContainer usefull. Without it, its hard - * to access or mutate the container. - */ - -#include "Platform/Define.h" -#include "Utilities/TypeList.h" -#include - -namespace Trinity -{ - /* ContainerMapList Helpers */ - // count functions - // template size_t Count(const ContainerMapList &elements, CountedPtr* /*fake*/) - // { - // return elements._element.size(); - // }; - // - // template size_t Count(const ContainerMapList &elements, CountedPtr* /*fake*/) - // { - // return 0; - // } - // - // template size_t Count(const ContainerMapList &elements, CountedPtr* /*fake*/) - // { - // return 0; - // } - // - // template size_t Count(const ContainerMapList >&elements, SPECIFIC_TYPE* fake) - // { - // return Count(elements._elements, fake); - // } - // - // template size_t Count(const ContainerMapList >&elements, SPECIFIC_TYPE* fake) - // { - // return Count(elements._TailElements, fake); - // } - - // non-const find functions - template CountedPtr& Find(ContainerMapList &elements, OBJECT_HANDLE hdl, CountedPtr* /*fake*/) - { - typename std::map >::iterator iter = elements._element.find(hdl); - return (iter == elements._element.end() ? NullPtr((SPECIFIC_TYPE*)NULL) : iter->second); - }; - - template CountedPtr& Find(ContainerMapList &elements, OBJECT_HANDLE hdl, CountedPtr* /*fake*/) - { - return NullPtr((SPECIFIC_TYPE*)NULL);// terminate recursion - } - - template CountedPtr& Find(ContainerMapList &elements, OBJECT_HANDLE hdl, CountedPtr* /*fake*/) - { - return NullPtr((SPECIFIC_TYPE*)NULL);// this is a missed - } - - template CountedPtr& Find(ContainerMapList >&elements, OBJECT_HANDLE hdl, CountedPtr* fake) - { - CountedPtr &t = Find(elements._elements, hdl, fake); - return (!t ? Find(elements._TailElements, hdl, fake) : t); - } - - // const find functions - template const CountedPtr& Find(const ContainerMapList &elements, OBJECT_HANDLE hdl, CountedPtr* /*fake*/) - { - typename CountedPtr::iterator iter = elements._element.find(hdl); - return (iter == elements._element.end() ? NullPtr((SPECIFIC_TYPE*)NULL) : iter->second); - }; - - template const CountedPtr& Find(const ContainerMapList &elements, OBJECT_HANDLE hdl, CountedPtr* /*fake*/) - { - return NullPtr((SPECIFIC_TYPE*)NULL); - } - - template const CountedPtr& Find(const ContainerMapList &elements, OBJECT_HANDLE hdl, CountedPtr* /*fake*/) - { - return NullPtr((SPECIFIC_TYPE*)NULL); - } - - template CountedPtr& Find(const ContainerMapList >&elements, OBJECT_HANDLE hdl, CountedPtr* fake) - { - CountedPtr &t = Find(elements._elements, hdl, fake); - if (!t) - t = Find(elements._TailElement, hdl, fake); - - return t; - } - - // non-const insert functions - template CountedPtr& Insert(ContainerMapList &elements, CountedPtr &obj, OBJECT_HANDLE hdl) - { - elements._element[hdl] = obj; - return obj; - }; - - template CountedPtr& Insert(ContainerMapList &elements, CountedPtr &obj, OBJECT_HANDLE hdl) - { - return NullPtr((SPECIFIC_TYPE*)NULL); - } - - // this is a missed - template CountedPtr& Insert(ContainerMapList &elements, CountedPtr &obj, OBJECT_HANDLE hdl) - { - return NullPtr((SPECIFIC_TYPE*)NULL);// a missed - } - - // Recursion - template CountedPtr& Insert(ContainerMapList >&elements, CountedPtr &obj, OBJECT_HANDLE hdl) - { - CountedPtr &t= Insert(elements._elements, obj, hdl); - return (!t ? Insert(elements._TailElements, obj, hdl) : t); - } - - // non-const remove method - template bool Remove(ContainerMapList &elements, CountedPtr &obj, OBJECT_HANDLE hdl) - { - typename std::map >::iterator iter = elements._element.find(hdl); - if ( iter != elements._element.end() ) - { - elements._element.erase(iter); - return true; - } - - return false; // found... terminate the search - } - - template bool Remove(ContainerMapList &elements, CountedPtr &obj, OBJECT_HANDLE hdl) - { - return false; - } - - // this is a missed - template bool Remove(ContainerMapList &elements, CountedPtr &obj, OBJECT_HANDLE hdl) - { - return false; - } - - template bool Remove(ContainerMapList > &elements, CountedPtr &obj, OBJECT_HANDLE hdl) - { - // The head element is bad - bool t = Remove(elements._elements, obj, hdl); - return ( !t ? Remove(elements._TailElements, obj, hdl) : t ); - } - -} -#endif - diff --git a/src/server/shared/Logging/Log.cpp b/src/server/shared/Logging/Log.cpp index b583d742748..493e30d36c0 100755 --- a/src/server/shared/Logging/Log.cpp +++ b/src/server/shared/Logging/Log.cpp @@ -38,11 +38,11 @@ Log::Log() : Log::~Log() { - if ( logfile != NULL ) + if (logfile != NULL) fclose(logfile); logfile = NULL; - if ( gmLogfile != NULL ) + if (gmLogfile != NULL) fclose(gmLogfile); gmLogfile = NULL; @@ -50,7 +50,7 @@ Log::~Log() fclose(charLogfile); charLogfile = NULL; - if ( dberLogfile != NULL ) + if (dberLogfile != NULL) fclose(dberLogfile); dberLogfile = NULL; @@ -81,32 +81,32 @@ Log::~Log() void Log::SetLogLevel(char *Level) { - int32 NewLevel =atoi((char*)Level); - if ( NewLevel <0 ) + int32 NewLevel = atoi((char*)Level); + if (NewLevel < 0) NewLevel = 0; m_logLevel = NewLevel; - outString( "LogLevel is %u", m_logLevel ); + outString("LogLevel is %u", m_logLevel); } void Log::SetLogFileLevel(char *Level) { - int32 NewLevel =atoi((char*)Level); - if ( NewLevel <0 ) + int32 NewLevel = atoi((char*)Level); + if (NewLevel < 0) NewLevel = 0; m_logFileLevel = NewLevel; - outString( "LogFileLevel is %u", m_logFileLevel ); + outString("LogFileLevel is %u", m_logFileLevel); } void Log::SetDBLogLevel(char *Level) { int32 NewLevel = atoi((char*)Level); - if ( NewLevel < 0 ) + if (NewLevel < 0) NewLevel = 0; m_dbLogLevel = NewLevel; - outString( "DBLogLevel is %u", m_dbLogLevel ); + outString("DBLogLevel is %u", m_dbLogLevel); } void Log::Initialize() @@ -382,7 +382,7 @@ void Log::outDB(LogTypes type, const char * str) PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_LOG); stmt->setInt32(0, realm); - stmt->setInt32(1, type); + stmt->setUInt8(1, uint8(type)); stmt->setString(2, logStr); LoginDatabase.Execute(stmt); diff --git a/src/server/shared/Logging/Log.h b/src/server/shared/Logging/Log.h index cbaa2d80451..e32ea7765a9 100755 --- a/src/server/shared/Logging/Log.h +++ b/src/server/shared/Logging/Log.h @@ -31,7 +31,7 @@ enum DebugLogFilters LOG_FILTER_PETS = 0x00000002, LOG_FILTER_VEHICLES = 0x00000004, LOG_FILTER_TSCR = 0x00000008, // C++ AI, instance scripts, etc. - LOG_FILTER_DATABASE_AI = 0x08000010, // SmartAI, EventAI, CreatureAI + LOG_FILTER_DATABASE_AI = 0x00000010, // SmartAI, EventAI, CreatureAI LOG_FILTER_MAPSCRIPTS = 0x00000020, LOG_FILTER_NETWORKIO = 0x00000040, // Anything packet/netcode related LOG_FILTER_SPELLS_AURAS = 0x00000080, @@ -118,28 +118,28 @@ class Log void SetColor(bool stdout_stream, ColorTypes color); void ResetColor(bool stdout_stream); - void outErrorST( const char * err, ... ) ATTR_PRINTF(2, 3); - void outDB( LogTypes type, const char * str ); - void outString( const char * str, ... ) ATTR_PRINTF(2, 3); - void outString( ); - void outStringInLine( const char * str, ... ) ATTR_PRINTF(2, 3); - void outError( const char * err, ... ) ATTR_PRINTF(2, 3); - void outCrash( const char * err, ... ) ATTR_PRINTF(2, 3); - void outBasic( const char * str, ... ) ATTR_PRINTF(2, 3); - void outDetail( const char * str, ... ) ATTR_PRINTF(2, 3); - void outSQLDev( const char * str, ... ) ATTR_PRINTF(2, 3); + void outErrorST(const char * err, ...) ATTR_PRINTF(2, 3); + void outDB(LogTypes type, const char * str); + void outString(const char * str, ...) ATTR_PRINTF(2, 3); + void outString(); + void outStringInLine(const char * str, ...) ATTR_PRINTF(2, 3); + void outError(const char * err, ...) ATTR_PRINTF(2, 3); + void outCrash(const char * err, ...) ATTR_PRINTF(2, 3); + void outBasic(const char * str, ...) ATTR_PRINTF(2, 3); + void outDetail(const char * str, ...) ATTR_PRINTF(2, 3); + void outSQLDev(const char * str, ...) ATTR_PRINTF(2, 3); void outDebug(DebugLogFilters f, const char* str, ...) ATTR_PRINTF(3, 4); - void outStaticDebug( const char * str, ... ) ATTR_PRINTF(2, 3); - void outDebugInLine( const char * str, ... ) ATTR_PRINTF(2, 3); - void outErrorDb( const char * str, ... ) ATTR_PRINTF(2, 3); - void outChar( const char * str, ... ) ATTR_PRINTF(2, 3); - void outCommand( uint32 account, const char * str, ...) ATTR_PRINTF(3, 4); - void outRemote( const char * str, ... ) ATTR_PRINTF(2, 3); - void outChat( const char * str, ... ) ATTR_PRINTF(2, 3); - void outArena( const char * str, ... ) ATTR_PRINTF(2, 3); - void outSQLDriver( const char* str, ... ) ATTR_PRINTF(2, 3); - void outWarden( const char * str, ... ) ATTR_PRINTF(2, 3); - void outCharDump( const char * str, uint32 account_id, uint32 guid, const char * name ); + void outStaticDebug(const char * str, ...) ATTR_PRINTF(2, 3); + void outDebugInLine(const char * str, ...) ATTR_PRINTF(2, 3); + void outErrorDb(const char * str, ...) ATTR_PRINTF(2, 3); + void outChar(const char * str, ...) ATTR_PRINTF(2, 3); + void outCommand(uint32 account, const char * str, ...) ATTR_PRINTF(3, 4); + void outRemote(const char * str, ...) ATTR_PRINTF(2, 3); + void outChat(const char * str, ...) ATTR_PRINTF(2, 3); + void outArena(const char * str, ...) ATTR_PRINTF(2, 3); + void outSQLDriver(const char* str, ...) ATTR_PRINTF(2, 3); + void outWarden(const char * str, ...) ATTR_PRINTF(2, 3); + void outCharDump(const char * str, uint32 account_id, uint32 guid, const char * name); void outOpCode(uint32 op, const char * name, bool smsg = true); static void outTimestamp(FILE* file); diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h index 3506913fc23..24ca412d6f2 100755 --- a/src/server/shared/Packets/ByteBuffer.h +++ b/src/server/shared/Packets/ByteBuffer.h @@ -29,22 +29,52 @@ class ByteBufferException { public: - ByteBufferException(bool _add, size_t _pos, size_t _esize, size_t _size) - : add(_add), pos(_pos), esize(_esize), size(_size) + ByteBufferException(size_t pos, size_t size, size_t valueSize) + : Pos(pos), Size(size), ValueSize(valueSize) { - PrintPosError(); } - void PrintPosError() const + protected: + size_t Pos; + size_t Size; + size_t ValueSize; +}; + +class ByteBufferPositionException : public ByteBufferException +{ + public: + ByteBufferPositionException(bool add, size_t pos, size_t size, size_t valueSize) + : ByteBufferException(pos, size, valueSize), _add(add) + { + PrintError(); + } + + protected: + void PrintError() const { - sLog->outError("Attempted to %s in ByteBuffer (pos: " SIZEFMTD " size: "SIZEFMTD") value with size: " SIZEFMTD, - (add ? "put" : "get"), pos, size, esize); + sLog->outError("Attempted to %s value with size: "SIZEFMTD" in ByteBuffer (pos: " SIZEFMTD " size: "SIZEFMTD") " , + (_add ? "put" : "get"), ValueSize, Pos, Size); } + private: - bool add; - size_t pos; - size_t esize; - size_t size; + bool _add; +}; + +class ByteBufferSourceException : public ByteBufferException +{ + public: + ByteBufferSourceException(size_t pos, size_t size, size_t valueSize) + : ByteBufferException(pos, size, valueSize) + { + PrintError(); + } + + protected: + void PrintError() const + { + sLog->outError("Attempted to put a %s in ByteBuffer (pos: "SIZEFMTD" size: "SIZEFMTD")", + (ValueSize > 0 ? "NULL-pointer" : "zero-sized value"), Pos, Size); + } }; class BitStream @@ -288,14 +318,17 @@ class ByteBuffer ByteBuffer &operator<<(const std::string &value) { - append((uint8 const*)value.c_str(), value.length()); + if (size_t len = value.length()) + append((uint8 const*)value.c_str(), len); append((uint8)0); return *this; } ByteBuffer &operator<<(const char *str) { - append((uint8 const*)str, str ? strlen(str) : 0); + size_t len = 0; + if (str && (len = strlen(str))) + append((uint8 const*)str, len); append((uint8)0); return *this; } @@ -421,7 +454,7 @@ class ByteBuffer void read_skip(size_t skip) { if (_rpos + skip > size()) - throw ByteBufferException(false, _rpos, skip, size()); + throw ByteBufferPositionException(false, _rpos, skip, size()); _rpos += skip; } @@ -435,7 +468,7 @@ class ByteBuffer template T read(size_t pos) const { if (pos + sizeof(T) > size()) - throw ByteBufferException(false, pos, sizeof(T), size()); + throw ByteBufferPositionException(false, pos, sizeof(T), size()); T val = *((T const*)&_storage[pos]); EndianConvert(val); return val; @@ -444,7 +477,7 @@ class ByteBuffer void read(uint8 *dest, size_t len) { if (_rpos + len > size()) - throw ByteBufferException(false, _rpos, len, size()); + throw ByteBufferPositionException(false, _rpos, len, size()); memcpy(dest, &_storage[_rpos], len); _rpos += len; } @@ -452,7 +485,7 @@ class ByteBuffer void readPackGUID(uint64& guid) { if (rpos() + 1 > size()) - throw ByteBufferException(false, _rpos, 1, size()); + throw ByteBufferPositionException(false, _rpos, 1, size()); guid = 0; @@ -464,7 +497,7 @@ class ByteBuffer if (guidmark & (uint8(1) << i)) { if (rpos() + 1 > size()) - throw ByteBufferException(false, _rpos, 1, size()); + throw ByteBufferPositionException(false, _rpos, 1, size()); uint8 bit; (*this) >> bit; @@ -557,7 +590,7 @@ class ByteBuffer void resize(size_t newsize) { - _storage.resize(newsize); + _storage.resize(newsize, 0); _rpos = 0; _wpos = size(); } @@ -568,11 +601,6 @@ class ByteBuffer _storage.reserve(ressize); } - void append(const std::string& str) - { - append((uint8 const*)str.c_str(), str.size() + 1); - } - void append(const char *src, size_t cnt) { return append((const uint8 *)src, cnt); @@ -586,7 +614,10 @@ class ByteBuffer void append(const uint8 *src, size_t cnt) { if (!cnt) - return; + throw ByteBufferSourceException(_wpos, size(), cnt); + + if (!src) + throw ByteBufferSourceException(_wpos, size(), cnt); ASSERT(size() < 10000000); @@ -634,7 +665,11 @@ class ByteBuffer void put(size_t pos, const uint8 *src, size_t cnt) { if (pos + cnt > size()) - throw ByteBufferException(true, pos, cnt, size()); + throw ByteBufferPositionException(true, pos, cnt, size()); + + if (!src) + throw ByteBufferSourceException(_wpos, size(), cnt); + memcpy(&_storage[pos], src, cnt); } diff --git a/src/server/shared/Utilities/Util.cpp b/src/server/shared/Utilities/Util.cpp index 52ce74be8f8..7bedf9690ca 100755 --- a/src/server/shared/Utilities/Util.cpp +++ b/src/server/shared/Utilities/Util.cpp @@ -19,15 +19,10 @@ #include #include "Util.h" #include "utf8.h" -#ifdef USE_SFMT_FOR_RNG #include "SFMT.h" -#else -#include "MersenneTwister.h" -#endif #include #include -#ifdef USE_SFMT_FOR_RNG typedef ACE_TSS SFMTRandTSS; static SFMTRandTSS sfmtRand; @@ -61,41 +56,6 @@ double rand_chance(void) return sfmtRand->Random() * 100.0; } -#else -typedef ACE_TSS MTRandTSS; -static MTRandTSS mtRand; - -int32 irand(int32 min, int32 max) -{ - return int32(mtRand->randInt(max - min)) + min; -} - -uint32 urand(uint32 min, uint32 max) -{ - return mtRand->randInt(max - min) + min; -} - -float frand(float min, float max) -{ - return float(mtRand->randExc(max - min) + min); -} - -int32 rand32() -{ - return mtRand->randInt(); -} - -double rand_norm(void) -{ - return mtRand->randExc(); -} - -double rand_chance(void) -{ - return mtRand->randExc(100.0); -} -#endif - Tokens::Tokens(const std::string &src, const char sep, uint32 vectorReserve) { m_str = new char[src.length() + 1]; diff --git a/src/server/shared/Utilities/Util.h b/src/server/shared/Utilities/Util.h index 4c2c1936993..196882dc2a0 100755 --- a/src/server/shared/Utilities/Util.h +++ b/src/server/shared/Utilities/Util.h @@ -20,7 +20,7 @@ #define _UTIL_H #include "Common.h" - +#include "Containers.h" #include #include @@ -73,7 +73,7 @@ inline uint32 secsToTimeBitFields(time_t secs) double rand_norm(void); /* Return a random double from 0.0 to 99.9999999999999. Floats support only 7 valid decimal digits. - * A double supports up to 15 valid decimal digits and is used internaly (RAND32_MAX has 10 digits). + * A double supports up to 15 valid decimal digits and is used internally (RAND32_MAX has 10 digits). * With an FPU, there is usually no difference in performance between float and double. */ double rand_chance(void); @@ -653,12 +653,4 @@ public: }; }; -/* Select a random element from a container. Note: make sure you explicitly empty check the container */ -template typename C::value_type const& SelectRandomContainerElement(C const& container) -{ - typename C::const_iterator it = container.begin(); - std::advance(it, urand(0, container.size() - 1)); - return *it; -} - #endif diff --git a/src/server/worldserver/CMakeLists.txt b/src/server/worldserver/CMakeLists.txt index b75dfcfc064..0d51f30449e 100644 --- a/src/server/worldserver/CMakeLists.txt +++ b/src/server/worldserver/CMakeLists.txt @@ -48,7 +48,6 @@ include_directories( ${CMAKE_SOURCE_DIR}/dep/gsoap ${CMAKE_SOURCE_DIR}/dep/sockets/include ${CMAKE_SOURCE_DIR}/dep/SFMT - ${CMAKE_SOURCE_DIR}/dep/mersennetwister ${CMAKE_SOURCE_DIR}/src/server/collision ${CMAKE_SOURCE_DIR}/src/server/collision/Management ${CMAKE_SOURCE_DIR}/src/server/collision/Models @@ -134,6 +133,7 @@ include_directories( ${CMAKE_SOURCE_DIR}/src/server/game/Weather ${CMAKE_SOURCE_DIR}/src/server/game/World ${CMAKE_SOURCE_DIR}/src/server/authserver/Server + ${CMAKE_SOURCE_DIR}/src/server/authserver/Realms ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/CommandLine ${CMAKE_CURRENT_SOURCE_DIR}/RemoteAccess @@ -201,4 +201,3 @@ if( USE_COREPCH ) add_native_precompiled_header(worldserver ${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders/worldPCH) endif() endif() - diff --git a/src/server/worldserver/CommandLine/CliRunnable.cpp b/src/server/worldserver/CommandLine/CliRunnable.cpp index 8e04a9c2f34..e85a3e1870d 100755 --- a/src/server/worldserver/CommandLine/CliRunnable.cpp +++ b/src/server/worldserver/CommandLine/CliRunnable.cpp @@ -125,29 +125,44 @@ void commandFinished(void*, bool /*success*/) */ bool ChatHandler::GetDeletedCharacterInfoList(DeletedInfoList& foundList, std::string searchString) { - QueryResult resultChar; + PreparedQueryResult result; + PreparedStatement* stmt; if (!searchString.empty()) { // search by GUID if (isNumeric(searchString.c_str())) - resultChar = CharacterDatabase.PQuery("SELECT guid, deleteInfos_Name, deleteInfos_Account, deleteDate FROM characters WHERE deleteDate IS NOT NULL AND guid = %u", uint64(atoi(searchString.c_str()))); + { + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_DEL_INFO_BY_GUID); + + stmt->setUInt32(0, uint32(atoi(searchString.c_str()))); + + result = CharacterDatabase.Query(stmt); + } // search by name else { if (!normalizePlayerName(searchString)) return false; - resultChar = CharacterDatabase.PQuery("SELECT guid, deleteInfos_Name, deleteInfos_Account, deleteDate FROM characters WHERE deleteDate IS NOT NULL AND deleteInfos_Name " _LIKE_ " " _CONCAT3_("'%%'", "'%s'", "'%%'"), searchString.c_str()); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_DEL_INFO_BY_NAME); + + stmt->setString(0, searchString); + + result = CharacterDatabase.Query(stmt); } } else - resultChar = CharacterDatabase.Query("SELECT guid, deleteInfos_Name, deleteInfos_Account, deleteDate FROM characters WHERE deleteDate IS NOT NULL"); + { + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_DEL_INFO); - if (resultChar) + result = CharacterDatabase.Query(stmt); + } + + if (result) { do { - Field* fields = resultChar->Fetch(); + Field* fields = result->Fetch(); DeletedInfo info; @@ -161,7 +176,7 @@ bool ChatHandler::GetDeletedCharacterInfoList(DeletedInfoList& foundList, std::s info.deleteDate = time_t(fields[3].GetUInt32()); foundList.push_back(info); - } while (resultChar->NextRow()); + } while (result->NextRow()); } return true; @@ -299,6 +314,11 @@ void ChatHandler::HandleCharacterDeletedRestoreHelper(DeletedInfo const& delInfo stmt->setUInt32(2, delInfo.lowguid); CharacterDatabase.Execute(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_NAME_DATA); + stmt->setUInt32(0, delInfo.lowguid); + if (PreparedQueryResult result = CharacterDatabase.Query(stmt)) + sWorld->AddCharacterNameData(delInfo.lowguid, delInfo.name, (*result)[2].GetUInt8(), (*result)[0].GetUInt8(), (*result)[1].GetUInt8()); } /** diff --git a/src/server/worldserver/Main.cpp b/src/server/worldserver/Main.cpp index 23f925dedef..04820f59355 100755 --- a/src/server/worldserver/Main.cpp +++ b/src/server/worldserver/Main.cpp @@ -137,8 +137,8 @@ extern int main(int argc, char **argv) } sLog->outString("Using configuration file %s.", cfg_file); - sLog->outDetail("%s (Library: %s)", OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION)); - sLog->outDetail("Using ACE: %s", ACE_VERSION); + sLog->outString("Using SSL version: %s (library: %s)", OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION)); + sLog->outString("Using ACE version: %s", ACE_VERSION); ///- and run the 'Master' /// \todo Why do we need this 'Master'? Can't all of this be in the Main as for Realmd? diff --git a/src/server/worldserver/Master.cpp b/src/server/worldserver/Master.cpp index d84cfc1a4a4..03b2859c514 100755 --- a/src/server/worldserver/Master.cpp +++ b/src/server/worldserver/Master.cpp @@ -41,6 +41,7 @@ #include "Timer.h" #include "Util.h" #include "AuthSocket.h" +#include "RealmList.h" #include "BigNumber.h" @@ -136,13 +137,6 @@ int Master::Run() sLog->outString(" C O R E /\\___/"); sLog->outString("http://TrinityCore.org \\/__/\n"); -#ifdef USE_SFMT_FOR_RNG - sLog->outString("\n"); - sLog->outString("SFMT has been enabled as the random number generator, if worldserver"); - sLog->outString("freezes or crashes randomly, first, try disabling SFMT in CMAKE configuration"); - sLog->outString("\n"); -#endif //USE_SFMT_FOR_RNG - /// worldserver PID file creation std::string pidfile = ConfigMgr::GetStringDefault("PidFile", ""); if (!pidfile.empty()) @@ -162,7 +156,7 @@ int Master::Run() return 1; // set server offline (not connectable) - LoginDatabase.DirectPExecute("UPDATE realmlist SET color = (color & ~%u) | %u WHERE id = '%d'", REALM_FLAG_OFFLINE, REALM_FLAG_INVALID, realmID); + LoginDatabase.DirectPExecute("UPDATE realmlist SET flag = (flag & ~%u) | %u WHERE id = '%d'", REALM_FLAG_OFFLINE, REALM_FLAG_INVALID, realmID); ///- Initialize the World sWorld->SetInitialWorldSettings(); @@ -273,10 +267,14 @@ int Master::Run() } // set server online (allow connecting now) - LoginDatabase.DirectPExecute("UPDATE realmlist SET color = color & ~%u, population = 0 WHERE id = '%u'", REALM_FLAG_INVALID, realmID); + LoginDatabase.DirectPExecute("UPDATE realmlist SET flag = flag & ~%u, population = 0 WHERE id = '%u'", REALM_FLAG_INVALID, realmID); sLog->outString("%s (worldserver-daemon) ready...", _FULLVERSION); - sWorldSocketMgr->Wait(); + + // when the main thread closes the singletons get unloaded + // since worldrunnable uses them, it will crash if unloaded after master + world_thread.wait(); + rar_thread.wait(); if (soap_thread) { @@ -286,15 +284,10 @@ int Master::Run() } // set server offline - LoginDatabase.DirectPExecute("UPDATE realmlist SET color = color | %u WHERE id = '%d'", REALM_FLAG_OFFLINE, realmID); - - // when the main thread closes the singletons get unloaded - // since worldrunnable uses them, it will crash if unloaded after master - world_thread.wait(); - rar_thread.wait(); + LoginDatabase.DirectPExecute("UPDATE realmlist SET flag = flag | %u WHERE id = '%d'", REALM_FLAG_OFFLINE, realmID); ///- Clean database before leaving - clearOnlineAccounts(); + ClearOnlineAccounts(); _StopDB(); @@ -454,7 +447,7 @@ bool Master::_StartDB() sLog->SetRealmID(realmID); ///- Clean the database before starting - clearOnlineAccounts(); + ClearOnlineAccounts(); ///- Insert version info into DB WorldDatabase.PExecute("UPDATE version SET core_version = '%s', core_revision = '%s'", _FULLVERSION, _HASH); // One-time query @@ -475,16 +468,14 @@ void Master::_StopDB() } /// Clear 'online' status for all accounts with characters in this realm -void Master::clearOnlineAccounts() +void Master::ClearOnlineAccounts() { - // Cleanup online status for characters hosted at current realm - /// \todo Only accounts with characters logged on *this* realm should have online status reset. Move the online column from 'account' to 'realmcharacters'? - LoginDatabase.DirectPExecute( - "UPDATE account SET online = 0 WHERE online > 0 " - "AND id IN (SELECT acctid FROM realmcharacters WHERE realmid = '%d')", realmID); + // Reset online status for all accounts with characters on the current realm + LoginDatabase.DirectPExecute("UPDATE account SET online = 0 WHERE online > 0 AND id IN (SELECT acctid FROM realmcharacters WHERE realmid = %d)", realmID); + // Reset online status for all characters CharacterDatabase.DirectExecute("UPDATE characters SET online = 0 WHERE online <> 0"); // Battleground instance ids reset at server restart - CharacterDatabase.DirectExecute(CharacterDatabase.GetPreparedStatement(CHAR_UPD_PLAYERS_BGDATA)); + CharacterDatabase.DirectExecute("UPDATE character_battleground_data SET instanceId = 0"); } diff --git a/src/server/worldserver/Master.h b/src/server/worldserver/Master.h index 17c230ef7c7..548cd02c64a 100755 --- a/src/server/worldserver/Master.h +++ b/src/server/worldserver/Master.h @@ -37,7 +37,7 @@ class Master bool _StartDB(); void _StopDB(); - void clearOnlineAccounts(); + void ClearOnlineAccounts(); }; #define sMaster ACE_Singleton::instance() diff --git a/src/server/worldserver/RemoteAccess/RASocket.cpp b/src/server/worldserver/RemoteAccess/RASocket.cpp index e5637d282c6..ebc7c7624d9 100755 --- a/src/server/worldserver/RemoteAccess/RASocket.cpp +++ b/src/server/worldserver/RemoteAccess/RASocket.cpp @@ -32,7 +32,7 @@ RASocket::RASocket() { - iMinLevel = ConfigMgr::GetIntDefault("RA.MinLevel", 3); + _minLevel = ConfigMgr::GetIntDefault("RA.MinLevel", 3); } RASocket::~RASocket() @@ -174,12 +174,15 @@ int RASocket::process_command(const std::string& command) int RASocket::check_access_level(const std::string& user) { - std::string safe_user = user; + std::string safeUser = user; + + AccountMgr::normalizeString(safeUser); + - AccountMgr::normalizeString(safe_user); - LoginDatabase.EscapeString(safe_user); - QueryResult result = LoginDatabase.PQuery("SELECT a.id, aa.gmlevel, aa.RealmID FROM account a LEFT JOIN account_access aa ON (a.id = aa.id) WHERE a.username = '%s'", safe_user.c_str()); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_ACCESS); + stmt->setString(0, safeUser); + PreparedQueryResult result = LoginDatabase.Query(stmt); if (!result) { @@ -189,7 +192,7 @@ int RASocket::check_access_level(const std::string& user) Field* fields = result->Fetch(); - if (fields[1].GetUInt32() < iMinLevel) + if (fields[1].GetUInt8() < _minLevel) { sLog->outRemote("User %s has no privilege to login", user.c_str()); return -1; @@ -207,19 +210,20 @@ int RASocket::check_password(const std::string& user, const std::string& pass) { std::string safe_user = user; AccountMgr::normalizeString(safe_user); - LoginDatabase.EscapeString(safe_user); std::string safe_pass = pass; AccountMgr::normalizeString(safe_pass); - LoginDatabase.EscapeString(safe_pass); std::string hash = AccountMgr::CalculateShaPassHash(safe_user, safe_pass); - QueryResult check = LoginDatabase.PQuery( - "SELECT 1 FROM account WHERE username = '%s' AND sha_pass_hash = '%s'", - safe_user.c_str(), hash.c_str()); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_CHECK_PASSWORD_BY_NAME); - if (!check) + stmt->setString(0, safe_user); + stmt->setString(1, hash); + + PreparedQueryResult result = LoginDatabase.Query(stmt); + + if (!result) { sLog->outRemote("Wrong password for user: %s", user.c_str()); return -1; diff --git a/src/server/worldserver/RemoteAccess/RASocket.h b/src/server/worldserver/RemoteAccess/RASocket.h index 1c9b1ac24b5..450245a0ff4 100755 --- a/src/server/worldserver/RemoteAccess/RASocket.h +++ b/src/server/worldserver/RemoteAccess/RASocket.h @@ -56,7 +56,7 @@ class RASocket: public ACE_Svc_Handler private: /// Minimum security level required to connect - uint8 iMinLevel; + uint8 _minLevel; }; #endif /// @} diff --git a/src/server/worldserver/WorldThread/WorldRunnable.cpp b/src/server/worldserver/WorldThread/WorldRunnable.cpp index 8ea54ca599e..42cfaae41ec 100755 --- a/src/server/worldserver/WorldThread/WorldRunnable.cpp +++ b/src/server/worldserver/WorldThread/WorldRunnable.cpp @@ -30,6 +30,7 @@ #include "MapManager.h" #include "Timer.h" #include "WorldRunnable.h" +#include "OutdoorPvPMgr.h" #define WORLD_SLEEP_CONST 50 @@ -93,4 +94,5 @@ void WorldRunnable::run() sMapMgr->UnloadAll(); // unload all grids (including locked in memory) sObjectAccessor->UnloadAll(); // unload 'i_player2corpse' storage and remove from world sScriptMgr->Unload(); + sOutdoorPvPMgr->Die(); } diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index ac4d3fb1bc0..6c598667a1f 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -1409,10 +1409,10 @@ AllowTickets = 1 # # DungeonFinder.Enable # Description: Dungeon and raid finder system. -# Default: 0 - (Disabled) -# 1 - (Enabled, Experimental as of still being in development) +# Default: 1 - (Enabled) +# 0 - (Disabled) -DungeonFinder.Enable = 0 +DungeonFinder.Enable = 1 # # DBC.EnforceItemAttributes diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp index fb64adb3c61..241be4982ab 100644 --- a/src/tools/map_extractor/System.cpp +++ b/src/tools/map_extractor/System.cpp @@ -313,16 +313,16 @@ void ReadLiquidTypeTableDBC() exit(1); } - size_t LiqType_count = dbc.getRecordCount(); - size_t LiqType_maxid = dbc.getMaxId(); - LiqType = new uint16[LiqType_maxid + 1]; - memset(LiqType, 0xff, (LiqType_maxid + 1) * sizeof(uint16)); + size_t liqTypeCount = dbc.getRecordCount(); + size_t liqTypeMaxId = dbc.getMaxId(); + LiqType = new uint16[liqTypeMaxId + 1]; + memset(LiqType, 0xff, (liqTypeMaxId + 1) * sizeof(uint16)); - for(uint32 x = 0; x < LiqType_count; ++x) + for(uint32 x = 0; x < liqTypeCount; ++x) LiqType[dbc.getRecord(x).getUInt(0)] = dbc.getRecord(x).getUInt(3); SFileCloseFile(dbcFile); - printf("Done! (%u LiqTypes loaded)\n", LiqType_count); + printf("Done! (%u LiqTypes loaded)\n", liqTypeCount); } // @@ -331,7 +331,7 @@ void ReadLiquidTypeTableDBC() // Map file format data static char const* MAP_MAGIC = "MAPS"; -static char const* MAP_VERSION_MAGIC = "v1.1"; +static char const* MAP_VERSION_MAGIC = "v1.2"; static char const* MAP_AREA_MAGIC = "AREA"; static char const* MAP_HEIGHT_MAGIC = "MHGT"; static char const* MAP_LIQUID_MAGIC = "MLIQ"; @@ -414,7 +414,8 @@ uint16 uint16_V9[ADT_GRID_SIZE+1][ADT_GRID_SIZE+1]; uint8 uint8_V8[ADT_GRID_SIZE][ADT_GRID_SIZE]; uint8 uint8_V9[ADT_GRID_SIZE+1][ADT_GRID_SIZE+1]; -uint8 liquid_type[ADT_CELLS_PER_GRID][ADT_CELLS_PER_GRID]; +uint16 liquid_entry[ADT_CELLS_PER_GRID][ADT_CELLS_PER_GRID]; +uint8 liquid_flags[ADT_CELLS_PER_GRID][ADT_CELLS_PER_GRID]; bool liquid_show[ADT_GRID_SIZE][ADT_GRID_SIZE]; float liquid_height[ADT_GRID_SIZE+1][ADT_GRID_SIZE+1]; @@ -426,7 +427,8 @@ bool ConvertADT(char *filename, char *filename2, int cell_y, int cell_x, uint32 return false; memset(liquid_show, 0, sizeof(liquid_show)); - memset(liquid_type, 0, sizeof(liquid_type)); + memset(liquid_flags, 0, sizeof(liquid_flags)); + memset(liquid_entry, 0, sizeof(liquid_entry)); // Prepare map header map_fileheader map; @@ -663,13 +665,75 @@ bool ConvertADT(char *filename, char *filename2, int cell_y, int cell_x, uint32 map.heightMapSize+= sizeof(V9) + sizeof(V8); } + // Get from MCLQ chunk (old) + for (int i = 0; i < ADT_CELLS_PER_GRID; i++) + { + for(int j = 0; j < ADT_CELLS_PER_GRID; j++) + { + adt_MCNK *cell = cells->getMCNK(i, j); + if (!cell) + continue; + + adt_MCLQ *liquid = cell->getMCLQ(); + int count = 0; + if (!liquid || cell->sizeMCLQ <= 8) + continue; + + for (int y = 0; y < ADT_CELL_SIZE; y++) + { + int cy = i * ADT_CELL_SIZE + y; + for (int x = 0; x < ADT_CELL_SIZE; x++) + { + int cx = j * ADT_CELL_SIZE + x; + if (liquid->flags[y][x] != 0x0F) + { + liquid_show[cy][cx] = true; + if (liquid->flags[y][x] & (1<<7)) + liquid_flags[i][j] |= MAP_LIQUID_TYPE_DARK_WATER; + ++count; + } + } + } + + uint32 c_flag = cell->flags; + if (c_flag & (1<<2)) + { + liquid_entry[i][j] = 1; + liquid_flags[i][j] |= MAP_LIQUID_TYPE_WATER; // water + } + if (c_flag & (1<<3)) + { + liquid_entry[i][j] = 2; + liquid_flags[i][j] |= MAP_LIQUID_TYPE_OCEAN; // ocean + } + if (c_flag & (1<<4)) + { + liquid_entry[i][j] = 3; + liquid_flags[i][j] |= MAP_LIQUID_TYPE_MAGMA; // magma/slime + } + + if (!count && liquid_flags[i][j]) + fprintf(stderr, "Wrong liquid detect in MCLQ chunk"); + + for (int y = 0; y <= ADT_CELL_SIZE; y++) + { + int cy = i * ADT_CELL_SIZE + y; + for (int x = 0; x <= ADT_CELL_SIZE; x++) + { + int cx = j * ADT_CELL_SIZE + x; + liquid_height[cy][cx] = liquid->liquid[y][x].height; + } + } + } + } + // Get liquid map for grid (in WOTLK used MH2O chunk) adt_MH2O * h2o = adt.a_grid->getMH2O(); if (h2o) { - for (int i=0;igetLiquidData(i,j); if (!h) @@ -677,111 +741,58 @@ bool ConvertADT(char *filename, char *filename2, int cell_y, int cell_x, uint32 int count = 0; uint64 show = h2o->getLiquidShowMap(h); - for (int y=0; y < h->height;y++) + for (int y = 0; y < h->height; y++) { - int cy = i*ADT_CELL_SIZE + y + h->yOffset; - for (int x=0; x < h->width; x++) + int cy = i * ADT_CELL_SIZE + y + h->yOffset; + for (int x = 0; x < h->width; x++) { - int cx = j*ADT_CELL_SIZE + x + h->xOffset; + int cx = j * ADT_CELL_SIZE + x + h->xOffset; if (show & 1) { liquid_show[cy][cx] = true; ++count; } - show>>=1; + show >>= 1; } } - uint32 type = LiqType[h->liquidType]; - switch (type) + liquid_entry[i][j] = h->liquidType; + switch (LiqType[h->liquidType]) { - case LIQUID_TYPE_WATER: liquid_type[i][j] |= MAP_LIQUID_TYPE_WATER; break; - case LIQUID_TYPE_OCEAN: liquid_type[i][j] |= MAP_LIQUID_TYPE_OCEAN; break; - case LIQUID_TYPE_MAGMA: liquid_type[i][j] |= MAP_LIQUID_TYPE_MAGMA; break; - case LIQUID_TYPE_SLIME: liquid_type[i][j] |= MAP_LIQUID_TYPE_SLIME; break; + case LIQUID_TYPE_WATER: liquid_flags[i][j] |= MAP_LIQUID_TYPE_WATER; break; + case LIQUID_TYPE_OCEAN: liquid_flags[i][j] |= MAP_LIQUID_TYPE_OCEAN; break; + case LIQUID_TYPE_MAGMA: liquid_flags[i][j] |= MAP_LIQUID_TYPE_MAGMA; break; + case LIQUID_TYPE_SLIME: liquid_flags[i][j] |= MAP_LIQUID_TYPE_SLIME; break; default: printf("\nCan't find Liquid type %u for map %s\nchunk %d,%d\n", h->liquidType, filename, i, j); break; } // Dark water detect - if (type == LIQUID_TYPE_OCEAN) + if (LiqType[h->liquidType] == LIQUID_TYPE_OCEAN) { - uint8 *lm = h2o->getLiquidLightMap(h); + uint8* lm = h2o->getLiquidLightMap(h); if (!lm) - liquid_type[i][j]|=MAP_LIQUID_TYPE_DARK_WATER; + liquid_flags[i][j] |= MAP_LIQUID_TYPE_DARK_WATER; } - if (!count && liquid_type[i][j]) + if (!count && liquid_flags[i][j]) printf("Wrong liquid detect in MH2O chunk"); - float *height = h2o->getLiquidHeightMap(h); + float* height = h2o->getLiquidHeightMap(h); int pos = 0; - for (int y=0; y<=h->height;y++) + for (int y = 0; y <= h->height; y++) { - int cy = i*ADT_CELL_SIZE + y + h->yOffset; - for (int x=0; x<= h->width; x++) + int cy = i * ADT_CELL_SIZE + y + h->yOffset; + for (int x = 0; x <= h->width; x++) { - int cx = j*ADT_CELL_SIZE + x + h->xOffset; + int cx = j * ADT_CELL_SIZE + x + h->xOffset; + if (height) liquid_height[cy][cx] = height[pos]; else liquid_height[cy][cx] = h->heightLevel1; - pos++; - } - } - } - } - } - else - { - // Get from MCLQ chunk (old) - for (int i=0;igetMCLQ(); - int count = 0; - if (!liquid || cell->sizeMCLQ <= 8) - continue; - - for (int y=0; y < ADT_CELL_SIZE; y++) - { - int cy = i*ADT_CELL_SIZE + y; - for (int x=0; x < ADT_CELL_SIZE; x++) - { - int cx = j*ADT_CELL_SIZE + x; - if (liquid->flags[y][x] != 0x0F) - { - liquid_show[cy][cx] = true; - if (liquid->flags[y][x]&(1<<7)) - liquid_type[i][j]|=MAP_LIQUID_TYPE_DARK_WATER; - ++count; - } - } - } - - uint32 c_flag = cell->flags; - if(c_flag & (1<<2)) - liquid_type[i][j]|=MAP_LIQUID_TYPE_WATER; // water - if(c_flag & (1<<3)) - liquid_type[i][j]|=MAP_LIQUID_TYPE_OCEAN; // ochean - if(c_flag & (1<<4)) - liquid_type[i][j]|=MAP_LIQUID_TYPE_MAGMA; // magma/slime - if (!count && liquid_type[i][j]) - printf("Wrong liquid detect in MCLQ chunk"); - - for (int y=0; y <= ADT_CELL_SIZE; y++) - { - int cy = i*ADT_CELL_SIZE + y; - for (int x=0; x<= ADT_CELL_SIZE; x++) - { - int cx = j*ADT_CELL_SIZE + x; - liquid_height[cy][cx] = liquid->liquid[y][x].height; + pos++; } } } @@ -791,13 +802,13 @@ bool ConvertADT(char *filename, char *filename2, int cell_y, int cell_x, uint32 //============================================ // Pack liquid data //============================================ - uint8 type = liquid_type[0][0]; + uint8 type = liquid_flags[0][0]; bool fullType = false; - for (int y=0;y& filelist) { - uint32 filenum; - if(libmpq__file_number(mpq_a, "(listfile)", &filenum)) return; - libmpq__off_t size, transferred; - libmpq__file_unpacked_size(mpq_a, filenum, &size); + uint32 filenum; + if(libmpq__file_number(mpq_a, "(listfile)", &filenum)) return; + libmpq__off_t size, transferred; + libmpq__file_unpacked_size(mpq_a, filenum, &size); char *buffer = new char[size]; - libmpq__file_read(mpq_a, filenum, (unsigned char*)buffer, size, &transferred); + libmpq__file_read(mpq_a, filenum, (unsigned char*)buffer, size, &transferred); char seps[] = "\n"; char *token; diff --git a/src/tools/vmap4_extractor/vmapexport.cpp b/src/tools/vmap4_extractor/vmapexport.cpp index 599290a9254..e60a773c6de 100644 --- a/src/tools/vmap4_extractor/vmapexport.cpp +++ b/src/tools/vmap4_extractor/vmapexport.cpp @@ -76,7 +76,7 @@ bool preciseVectorData = false; //static const char * szWorkDirMaps = ".\\Maps"; const char* szWorkDirWmo = "./Buildings"; -const char* szRawVMAPMagic = "VMAP004"; +const char* szRawVMAPMagic = "VMAP041"; // Local testing functions @@ -261,20 +261,7 @@ void ParsMapFiles() void getGamePath() { #ifdef _WIN32 - HKEY key; - DWORD t,s; - LONG l; - s = sizeof(input_path); - memset(input_path,0,s); - l = RegOpenKeyEx(HKEY_LOCAL_MACHINE,"SOFTWARE\\Blizzard Entertainment\\World of Warcraft",0,KEY_QUERY_VALUE,&key); - //l = RegOpenKeyEx(HKEY_LOCAL_MACHINE,"SOFTWARE\\Blizzard Entertainment\\Burning Crusade Closed Beta",0,KEY_QUERY_VALUE,&key); - l = RegQueryValueEx(key,"InstallPath",0,&t,(LPBYTE)input_path,&s); - RegCloseKey(key); - if (strlen(input_path) > 0) - { - if (input_path[strlen(input_path) - 1] != '\\') strcat(input_path, "\\"); - } - strcat(input_path,"Data\\"); + strcpy(input_path,"Data\\"); #else strcpy(input_path,"Data/"); #endif diff --git a/src/tools/vmap4_extractor/vmapexport.h b/src/tools/vmap4_extractor/vmapexport.h index b407e7a106e..0381011efb7 100644 --- a/src/tools/vmap4_extractor/vmapexport.h +++ b/src/tools/vmap4_extractor/vmapexport.h @@ -23,8 +23,8 @@ enum ModelFlags { - MOD_M2 = 1, - MOD_WORLDSPAWN = 1<<1, + MOD_M2 = 1, + MOD_WORLDSPAWN = 1<<1, MOD_HAS_BOUND = 1<<2 }; diff --git a/src/tools/vmap4_extractor/wmo.cpp b/src/tools/vmap4_extractor/wmo.cpp index 58957e007c1..6703872111b 100644 --- a/src/tools/vmap4_extractor/wmo.cpp +++ b/src/tools/vmap4_extractor/wmo.cpp @@ -404,11 +404,53 @@ int WMOGroup::ConvertToVMAPGroupWmo(FILE *output, WMORoot *rootWMO, bool pPrecis if (rootWMO->liquidType & 4) liquidEntry = liquidType; else if (liquidType == 15) - liquidEntry = 1; // first entry, generic "Water" + liquidEntry = 0; else liquidEntry = liquidType + 1; - // overwrite material type in header... - hlq->type = LiqType[liquidEntry]; + + if (!liquidEntry) + { + int v1; // edx@1 + int v2; // eax@1 + + v1 = hlq->xtiles * hlq->ytiles; + v2 = 0; + if (v1 > 0) + { + while ((LiquBytes[v2] & 0xF) == 15) + { + ++v2; + if (v2 >= v1) + break; + } + + if (v2 < v1 && (LiquBytes[v2] & 0xF) != 15) + liquidEntry = (LiquBytes[v2] & 0xF) + 1; + } + } + + if (liquidEntry && liquidEntry < 21) + { + switch (((uint8)liquidEntry - 1) & 3) + { + case 0: + liquidEntry = ((mogpFlags & 0x80000) != 0) + 13; + break; + case 1: + liquidEntry = 14; + break; + case 2: + liquidEntry = 19; + break; + case 3: + liquidEntry = 20; + break; + default: + break; + } + } + + hlq->type = liquidEntry; /* std::ofstream llog("Buildings/liquid.log", ios_base::out | ios_base::app); llog << filename; -- cgit v1.2.3 From 774f3cdc9b2861f0ba2bf496a8528e41f0f578c3 Mon Sep 17 00:00:00 2001 From: kaelima Date: Wed, 30 May 2012 09:22:56 +0200 Subject: Fixed some merging errors, there could be more, but at least it compiles. --- src/server/game/Battlegrounds/ArenaTeamMgr.cpp | 4 +-- src/server/game/Battlegrounds/BattlegroundMgr.cpp | 7 +++-- src/server/game/DataStores/DBCStores.cpp | 8 ++++++ src/server/game/DataStores/DBCStores.h | 2 ++ src/server/game/DataStores/DBCStructure.h | 34 ++++++++++++----------- src/server/game/DataStores/DBCfmt.h | 4 +-- src/server/game/Entities/Creature/Creature.cpp | 4 +-- src/server/game/Entities/Pet/Pet.cpp | 2 +- src/server/game/Entities/Player/Player.cpp | 23 +++++++-------- src/server/game/Entities/Unit/Unit.cpp | 14 +++++----- src/server/game/Handlers/LFGHandler.cpp | 2 +- src/server/game/Handlers/MiscHandler.cpp | 2 +- src/server/game/Handlers/MovementHandler.cpp | 4 +-- src/server/game/Handlers/QuestHandler.cpp | 2 -- src/server/game/Server/Protocol/Opcodes.cpp | 1 - src/server/game/Server/Protocol/Opcodes.h | 24 ++++++++++++++++ src/server/game/Server/WorldSocket.cpp | 13 --------- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 13 ++++++--- src/server/game/Spells/Spell.cpp | 17 ------------ src/server/game/Spells/SpellEffects.cpp | 4 +-- src/server/scripts/Commands/cs_misc.cpp | 3 +- src/server/shared/Packets/ByteBuffer.h | 4 +-- 22 files changed, 101 insertions(+), 90 deletions(-) (limited to 'src') diff --git a/src/server/game/Battlegrounds/ArenaTeamMgr.cpp b/src/server/game/Battlegrounds/ArenaTeamMgr.cpp index 47282be3a8e..c964f47f495 100644 --- a/src/server/game/Battlegrounds/ArenaTeamMgr.cpp +++ b/src/server/game/Battlegrounds/ArenaTeamMgr.cpp @@ -153,10 +153,10 @@ void ArenaTeamMgr::DistributeArenaPoints() SQLTransaction trans = CharacterDatabase.BeginTransaction(); - PreparedStatement* stmt; - // Cycle that gives points to all players /* + PreparedStatement* stmt; + for (std::map::iterator playerItr = PlayerPoints.begin(); playerItr != PlayerPoints.end(); ++playerItr) { // Add points to player if online diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index 167933b9c0c..eae84c9c7b3 100755 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -771,10 +771,11 @@ void BattlegroundMgr::CreateInitialBattlegrounds() continue; } - data.StartMaxDist = fields[9].GetFloat(); - - //data.BattlegroundName = bl->name[sWorld->GetDefaultDbcLocale()]; + selectionWeight = fields[9].GetUInt8(); + // data.StartMaxDist = fields[9].GetFloat(); ? data.scriptId = sObjectMgr->GetScriptId(fields[10].GetCString()); + + //data.BattlegroundName = bl->name[sWorld->GetDefaultDbcLocale()]; data.MapID = bl->mapid[0]; if (!CreateBattleground(data)) diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index e8087753efd..973421bc2e3 100755 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -1006,6 +1006,14 @@ std::vector const* GetTalentTreePrimarySpells(uint32 talentTree) return &itr->second; } +uint32 GetLiquidFlags(uint32 liquidType) +{ + if (LiquidTypeEntry const* liq = sLiquidTypeStore.LookupEntry(liquidType)) + return 1 << liq->Type; + + return 0; +} + uint32 ScalingStatValuesEntry::GetStatMultiplier(uint32 inventoryType) const { if (inventoryType < MAX_INVTYPE) diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h index d04dc4ff131..c22f2ccd625 100755 --- a/src/server/game/DataStores/DBCStores.h +++ b/src/server/game/DataStores/DBCStores.h @@ -67,6 +67,8 @@ MapDifficulty const* GetDownscaledMapDifficultyData(uint32 mapId, Difficulty &di uint32 const* /*[MAX_TALENT_TABS]*/ GetTalentTabPages(uint8 cls); std::vector const* GetTalentTreePrimarySpells(uint32 talentTree); +uint32 GetLiquidFlags(uint32 liquidType); + PvPDifficultyEntry const* GetBattlegroundBracketByLevel(uint32 mapid, uint32 level); PvPDifficultyEntry const* GetBattlegroundBracketById(uint32 mapid, BattlegroundBracketId id); diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index f0b462e827c..54e961eaf84 100755 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -543,10 +543,9 @@ struct AreaTableEntry //uint32 unk8; // 8, //uint32 unk9; // 9, int32 area_level; // 10 + char* area_name; // 11 uint32 team; // 12 - //uint32 unk14; // 14, All zeros (4.2.2) - //uint32 unk15; // 15, - //uint32 unk16; // 16, Only Naxxramas has value (21) + uint32 LiquidTypeOverride[4]; // 13-16 liquid override by type //float unk13; // 17, //float unk13; // 18, //uint32 unk19; // 19, All zeros (4.2.2) @@ -1134,21 +1133,24 @@ struct HolidayNamesEntry }; */ +#define MAX_HOLIDAY_DURATIONS 10 +#define MAX_HOLIDAY_DATES 26 +#define MAX_HOLIDAY_FLAGS 10 + struct HolidaysEntry { - uint32 ID; // 0, holiday id - //uint32 unk1; // 1 - //uint32 unk2; // 2 - //uint32 unk3[8] // 3-10, empty fields - //uint32 unk11[13] // 11-23, some unknown data (bit strings?) - //uint32 unk11[13] // 24-36, some empty fields (continue prev?) - //uint32 unk11[12] // 37-48, counters? - //uint32 holidayNameId; // 49, id for HolidayNames.dbc - //uint32 holidayDescriptionId; // 50, id for HolidayDescriptions.dbc - //uint32 unk51; // 51 - //uint32 unk52; // 52 - //uint32 unk53; // 53 - //uint32 unk54; // 54 + uint32 Id; // 0 m_ID + uint32 Duration[MAX_HOLIDAY_DURATIONS]; // 1-10 m_duration + uint32 Date[MAX_HOLIDAY_DATES]; // 11-36 m_date (dates in unix time starting at January, 1, 2000) + uint32 Region; // 37 m_region (wow region) + uint32 Looping; // 38 m_looping + uint32 CalendarFlags[MAX_HOLIDAY_FLAGS]; // 39-48 m_calendarFlags + //uint32 holidayNameId; // 49 m_holidayNameID (HolidayNames.dbc) + //uint32 holidayDescriptionId; // 50 m_holidayDescriptionID (HolidayDescriptions.dbc) + char* TextureFilename; // 51 m_textureFilename + uint32 Priority; // 52 m_priority + uint32 CalendarFilterType; // 53 m_calendarFilterType (-1 = Fishing Contest, 0 = Unk, 1 = Darkmoon Festival, 2 = Yearly holiday) + //uint32 flags; // 54 m_flags (0 = Darkmoon Faire, Fishing Contest and Wotlk Launch, rest is 1) }; // common struct for: diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index df5e1ce5035..50af8928e6b 100755 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -23,7 +23,7 @@ const char Achievementfmt[]="niixsxiixixxii"; //const std::string CustomAchievementfmt="pppaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaapapaaaaaaaaaaaaaaaaaapp"; //const std::string CustomAchievementIndex = "ID"; const char AchievementCriteriafmt[]="niiiiiiiisiiiiixxiiiiii"; -const char AreaTableEntryfmt[]="iiinixxxxxisixxxxxxxxxxxxx"; +const char AreaTableEntryfmt[]="iiinixxxxxisiiiiixxxxxxxxx"; const char AreaGroupEntryfmt[]="niiiiiii"; const char AreaPOIEntryfmt[]="niiiiiiiiiiiffixixxixx"; const char AreaTriggerEntryfmt[]="nifffxxxfffff"; @@ -75,7 +75,7 @@ const char GtOCTRegenHPfmt[]="f"; const char GtRegenHPPerSptfmt[]="f"; const char GtRegenMPPerSptfmt[]="xf"; -const char Holidaysfmt[]="nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; +const char Holidaysfmt[]="niiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiixxsiix"; const char ItemBagFamilyfmt[]="nx"; const char ItemArmorQualityfmt[]="nfffffffi"; const char ItemArmorShieldfmt[]="nifffffff"; diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index ca075703277..bbce6cf56c1 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -2474,7 +2474,7 @@ bool Creature::SetDisableGravity(bool disable, bool packetOnly/*=false*/) if (!movespline->Initialized()) return true; - WorldPacket data(disable ? SMSG_SPLINE_MOVE_GRAVITY_DISABLE : SMSG_SPLINE_MOVE_GRAVITY_ENABLE, 9); + WorldPacket data(disable ? SMSG_MOVE_SPLINE_DISABLE_GRAVITY : SMSG_MOVE_SPLINE_ENABLE_GRAVITY, 9); data.append(GetPackGUID()); SendMessageToSet(&data, false); return true; @@ -2495,7 +2495,7 @@ bool Creature::SetHover(bool enable) return true; //! Not always a packet is sent - WorldPacket data(enable ? SMSG_SPLINE_MOVE_SET_HOVER : SMSG_SPLINE_MOVE_UNSET_HOVER, 9); + WorldPacket data(enable ? SMSG_MOVE_SPLINE_SET_HOVER : SMSG_MOVE_SPLINE_UNSET_HOVER, 9); data.append(GetPackGUID()); SendMessageToSet(&data, false); return true; diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index 414792c8d5c..efd5e577f9e 100755 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -1850,7 +1850,7 @@ bool Pet::IsPermanentPetFor(Player* owner) case CLASS_DEATH_KNIGHT: return GetCreatureTemplate()->type == CREATURE_TYPE_UNDEAD; case CLASS_MAGE: - return GetCreatureInfo()->type == CREATURE_TYPE_ELEMENTAL; + return GetCreatureTemplate()->type == CREATURE_TYPE_ELEMENTAL; default: return false; } diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index d62e0ccfd53..890ceb72c3e 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -19081,7 +19081,7 @@ void Player::_SaveActions(SQLTransaction& trans) case ACTIONBUTTON_NEW: stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_ACTION); stmt->setUInt32(0, GetGUIDLow()); - stmt->setUInt8(1, m_activeSpec); + stmt->setUInt8(1, GetActiveSpec()); stmt->setUInt8(2, itr->first); stmt->setUInt32(3, itr->second.GetAction()); stmt->setUInt8(4, uint8(itr->second.GetType())); @@ -19096,7 +19096,7 @@ void Player::_SaveActions(SQLTransaction& trans) stmt->setUInt8(1, uint8(itr->second.GetType())); stmt->setUInt32(2, GetGUIDLow()); stmt->setUInt8(3, itr->first); - stmt->setUInt8(4, m_activeSpec); + stmt->setUInt8(4, GetActiveSpec()); trans->Append(stmt); itr->second.uState = ACTIONBUTTON_UNCHANGED; @@ -19106,7 +19106,7 @@ void Player::_SaveActions(SQLTransaction& trans) stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACTION_BY_BUTTON_SPEC); stmt->setUInt32(0, GetGUIDLow()); stmt->setUInt8(1, itr->first); - stmt->setUInt8(2, m_activeSpec); + stmt->setUInt8(2, GetActiveSpec()); trans->Append(stmt); m_actionButtons.erase(itr++); @@ -19646,6 +19646,7 @@ void Player::_SaveStats(SQLTransaction& trans) stmt->setUInt32(index++, GetGUIDLow()); stmt->setUInt32(index++, GetMaxHealth()); + for (uint8 i = 0; i < MAX_STORED_POWERS; ++i) stmt->setUInt32(index++, GetMaxPower(Powers(i))); for (uint8 i = 0; i < MAX_STATS; ++i) @@ -25093,7 +25094,7 @@ void Player::_SaveGlyphs(SQLTransaction& trans) trans->Append(stmt); - for (uint8 spec = 0; spec < m_specsCount; ++spec) + for (uint8 spec = 0; spec < GetSpecsCount(); ++spec) { uint8 index = 0; @@ -25103,7 +25104,7 @@ void Player::_SaveGlyphs(SQLTransaction& trans) stmt->setUInt8(index++, spec); for (uint8 i = 0; i < MAX_GLYPH_SLOT_INDEX; ++i) - stmt->setUInt16(index++, uint16(m_Glyphs[spec][i])); + stmt->setUInt16(index++, uint16(GetGlyph(spec, i))); trans->Append(stmt); } @@ -25193,7 +25194,7 @@ void Player::UpdateSpecCount(uint8 count) _SaveActions(trans); stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACTION_EXCEPT_SPEC); - stmt->setUInt8(0, m_activeSpec); + stmt->setUInt8(0, GetActiveSpec()); stmt->setUInt32(1, GetGUIDLow()); trans->Append(stmt); @@ -25688,8 +25689,8 @@ void Player::SendMovementSetCanFly(bool apply) void Player::SendMovementSetCanTransitionBetweenSwimAndFly(bool apply) { WorldPacket data(apply ? - SMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY : - SMSG_MOVE_UNSET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, 12); + SMSG_MOVE_ENABLE_TRANSITION_BETWEEN_SWIM_AND_FLY : + SMSG_MOVE_DISABLE_TRANSITION_BETWEEN_SWIM_AND_FLY, 12); data.append(GetPackGUID()); data << uint32(0); //! movement counter SendDirectMessage(&data); @@ -25697,7 +25698,7 @@ void Player::SendMovementSetCanTransitionBetweenSwimAndFly(bool apply) void Player::SendMovementSetHover(bool apply) { - WorldPacket data(apply ? SMSG_MOVE_SET_HOVER : SMSG_MOVE_UNSET_HOVER, 12); + WorldPacket data(apply ? SMSG_MOVE_SET_HOVERING : SMSG_MOVE_SPLINE_UNSET_HOVER, 12); data.append(GetPackGUID()); data << uint32(0); //! movement counter SendDirectMessage(&data); @@ -25705,7 +25706,7 @@ void Player::SendMovementSetHover(bool apply) void Player::SendMovementSetWaterWalking(bool apply) { - WorldPacket data(apply ? SMSG_MOVE_WATER_WALK : SMSG_MOVE_LAND_WALK, 12); + WorldPacket data(apply ? SMSG_MOVE_SET_WATER_WALK : SMSG_MOVE_SET_LAND_WALK, 12); data.append(GetPackGUID()); data << uint32(0); //! movement counter SendDirectMessage(&data); @@ -25713,7 +25714,7 @@ void Player::SendMovementSetWaterWalking(bool apply) void Player::SendMovementSetFeatherFall(bool apply) { - WorldPacket data(apply ? SMSG_MOVE_FEATHER_FALL : SMSG_MOVE_NORMAL_FALL, 12); + WorldPacket data(apply ? SMSG_MOVE_SET_FEATHER_FALL : SMSG_MOVE_SET_NORMAL_FALL, 12); data.append(GetPackGUID()); data << uint32(0); //! movement counter SendDirectMessage(&data); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 6ae8e0b7caf..347a51a67d9 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -10828,7 +10828,7 @@ uint32 Unit::SpellDamageBonusTaken(Unit* caster, SpellInfo const* spellProto, ui // From caster spells AuraEffectList const& mOwnerTaken = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_FROM_CASTER); for (AuraEffectList::const_iterator i = mOwnerTaken.begin(); i != mOwnerTaken.end(); ++i) - if ((*i)->GetCasterGUID() == caster->GetGUID() && (*i)->IsAffectedOnSpell(spellProto)) + if ((*i)->GetCasterGUID() == caster->GetGUID() && (*i)->IsAffectingSpell(spellProto)) AddPctN(TakenTotalMod, (*i)->GetAmount()); // Mod damage from spell mechanic @@ -11431,7 +11431,7 @@ uint32 Unit::SpellHealingBonusTaken(Unit* caster, SpellInfo const* spellProto, u AuraEffectList const& mHealingGet= GetAuraEffectsByType(SPELL_AURA_MOD_HEALING_RECEIVED); for (AuraEffectList::const_iterator i = mHealingGet.begin(); i != mHealingGet.end(); ++i) - if (caster->GetGUID() == (*i)->GetCasterGUID() && (*i)->IsAffectedOnSpell(spellProto)) + if (caster->GetGUID() == (*i)->GetCasterGUID() && (*i)->IsAffectingSpell(spellProto)) AddPctN(TakenTotalMod, (*i)->GetAmount()); for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) @@ -11844,7 +11844,7 @@ uint32 Unit::MeleeDamageBonusTaken(Unit* attacker, uint32 pdamage, WeaponAttackT // From caster spells AuraEffectList const& mOwnerTaken = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_FROM_CASTER); for (AuraEffectList::const_iterator i = mOwnerTaken.begin(); i != mOwnerTaken.end(); ++i) - if ((*i)->GetCasterGUID() == attacker->GetGUID() && (*i)->IsAffectedOnSpell(spellProto)) + if ((*i)->GetCasterGUID() == attacker->GetGUID() && (*i)->IsAffectingSpell(spellProto)) AddPctN(TakenTotalMod, (*i)->GetAmount()); // Mod damage from spell mechanic @@ -17696,8 +17696,8 @@ void Unit::BuildMovementPacket(ByteBuffer *data) const switch (GetTypeId()) { case TYPEID_UNIT: - if (canFly()) - const_cast(this)->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + if (CanFly()) + const_cast(this)->AddUnitMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY); break; case TYPEID_PLAYER: // remove unknown, unused etc flags for now @@ -17718,7 +17718,7 @@ void Unit::BuildMovementPacket(ByteBuffer *data) const bool swimming = ((GetUnitMovementFlags() & (MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING)) || (m_movementInfo.flags2 & MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING)); bool interPolatedTurning = m_movementInfo.flags2 & MOVEMENTFLAG2_INTERPOLATED_TURNING; - bool jumping = GetUnitMovementFlags() & MOVEMENTFLAG_JUMPING; + bool jumping = GetUnitMovementFlags() & MOVEMENTFLAG_FALLING; bool splineElevation = GetUnitMovementFlags() & MOVEMENTFLAG_SPLINE_ELEVATION; bool splineData = false; @@ -18187,7 +18187,7 @@ void Unit::SendMovementHover() if (GetTypeId() == TYPEID_PLAYER) ToPlayer()->SendMovementSetHover(HasUnitMovementFlag(MOVEMENTFLAG_HOVER)); - WorldPacket data(MSG_MOVE_HOVER, 64); + WorldPacket data(MSG_MOVE_HOVER, 64); // SMSG_MOVE_SET_HOVERING? data.append(GetPackGUID()); BuildMovementPacket(&data); SendMessageToSet(&data, false); diff --git a/src/server/game/Handlers/LFGHandler.cpp b/src/server/game/Handlers/LFGHandler.cpp index 9c66ca44383..82afdfb9044 100755 --- a/src/server/game/Handlers/LFGHandler.cpp +++ b/src/server/game/Handlers/LFGHandler.cpp @@ -529,7 +529,7 @@ void WorldSession::SendLfgBootPlayer(const LfgPlayerBoot* pBoot) } sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_BOOT_PROPOSAL_UPDATE [" UI64FMTD "] inProgress: %u - didVote: %u - agree: %u - victim: [" UI64FMTD "] votes: %u - agrees: %u - left: %u - needed: %u - reason %s", guid, uint8(pBoot->inProgress), uint8(playerVote != LFG_ANSWER_PENDING), uint8(playerVote == LFG_ANSWER_AGREE), pBoot->victim, votesNum, agreeNum, secsleft, pBoot->votedNeeded, pBoot->reason.c_str()); - WorldPacket data(SMSG_LFG_BOOT_PROPOSAL_UPDATE, 1 + 1 + 1 + 8 + 4 + 4 + 4 + 4 + pBoot->reason.length()); + WorldPacket data(SMSG_LFG_BOOT_PLAYER, 1 + 1 + 1 + 8 + 4 + 4 + 4 + 4 + pBoot->reason.length()); data << uint8(pBoot->inProgress); // Vote in progress data << uint8(playerVote != LFG_ANSWER_PENDING); // Did Vote data << uint8(playerVote == LFG_ANSWER_AGREE); // Agree diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 7cea7b2ea8e..247db1975a4 100755 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -1829,7 +1829,7 @@ void WorldSession::HandleUpdateMissileTrajectory(WorldPacket& recvPacket) { uint32 opcode; recvPacket >> opcode; - recvPacket.SetOpcode(opcode); + recvPacket.SetOpcode(MSG_MOVE_STOP); // always set to MSG_MOVE_STOP in client SetOpcode HandleMovementOpcodes(recvPacket); } } diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp index 3d9968d9a9d..592b2cbeff6 100755 --- a/src/server/game/Handlers/MovementHandler.cpp +++ b/src/server/game/Handlers/MovementHandler.cpp @@ -345,7 +345,7 @@ void WorldSession::HandleMovementOpcodes(WorldPacket & recvData) /*----------------------*/ /* process position-change */ - WorldPacket data(SMSG_PLAYER_MOVE, recv_data.size()); + WorldPacket data(SMSG_PLAYER_MOVE, recvData.size()); movementInfo.time = getMSTime(); movementInfo.guid = mover->GetGUID(); WriteMovementInfo(data, &movementInfo); @@ -824,7 +824,7 @@ void WorldSession::WriteMovementInfo(WorldPacket &data, MovementInfo* mi) HavePitch = (mi->HasMovementFlag(MovementFlags(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING))) || (mi->flags2 & MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING), HaveFallData = mi->HasExtraMovementFlag(MOVEMENTFLAG2_INTERPOLATED_TURNING), - HaveFallDirection = mi->HasMovementFlag(MOVEMENTFLAG_JUMPING), + HaveFallDirection = mi->HasMovementFlag(MOVEMENTFLAG_FALLING), HaveSplineElevation = mi->HasMovementFlag(MOVEMENTFLAG_SPLINE_ELEVATION), HaveSpline = false; diff --git a/src/server/game/Handlers/QuestHandler.cpp b/src/server/game/Handlers/QuestHandler.cpp index 62372004f03..ccd2e178f88 100755 --- a/src/server/game/Handlers/QuestHandler.cpp +++ b/src/server/game/Handlers/QuestHandler.cpp @@ -489,8 +489,6 @@ void WorldSession::HandleQuestgiverCompleteQuest(WorldPacket& recv_data) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_COMPLETE_QUEST npc = %u, questId = %u", uint32(GUID_LOPART(playerGuid)), questId); Object* object = ObjectAccessor::GetObjectByTypeMask(*_player, playerGuid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT); - if (!object || !object->hasInvolvedQuest(questId)) - Object* object = ObjectAccessor::GetObjectByTypeMask(*_player, guid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT); if (!object || !object->hasInvolvedQuest(questId)) return; diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index dc9dcad3d17..51760b3323e 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -835,7 +835,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_UNROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_FEATHER_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_NORMAL_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_UNSET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_LAND_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 0920da2543e..dfcf56c388b 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -483,7 +483,10 @@ enum Opcodes MSG_LIST_STABLED_PETS = 0x88CA, MSG_MINIMAP_PING = 0x00, MSG_MOVE_FALL_LAND = 0x00A5, + MSG_MOVE_FEATHER_FALL = 0x00, + MSG_MOVE_GRAVITY_CHNG = 0x00, MSG_MOVE_HEARTBEAT = 0xB024, + MSG_MOVE_HOVER = 0x00, MSG_MOVE_JUMP = 0x9225, MSG_MOVE_SET_ALL_SPEED_CHEAT = 0x00, MSG_MOVE_SET_FACING = 0x02A4, @@ -517,6 +520,8 @@ enum Opcodes MSG_MOVE_TOGGLE_COLLISION_CHEAT = 0x00, MSG_MOVE_TOGGLE_FALL_LOGGING = 0x00, MSG_MOVE_TOGGLE_LOGGING = 0x00, + MSG_MOVE_WATER_WALK = 0x00, + MSG_MOVE_UPDATE_CAN_FLY = 0x00, MSG_NOTIFY_PARTY_SQUELCH = 0x00, MSG_PARTY_ASSIGNMENT = 0x00, MSG_PETITION_DECLINE = 0x98E7, @@ -603,9 +608,28 @@ enum Opcodes SMSG_BUY_BANK_SLOT_RESULT = 0x00, SMSG_BUY_FAILED = 0x4A7F, SMSG_BUY_ITEM = 0xCA67, + SMSG_CALENDAR_ACTION_PENDING = 0x00, + SMSG_CALENDAR_ARENA_TEAM = 0x00, + SMSG_CALENDAR_CLEAR_PENDING_ACTION = 0x00, SMSG_CALENDAR_COMMAND_RESULT = 0x9A4E, + SMSG_CALENDAR_EVENT_INVITE = 0x00, + SMSG_CALENDAR_EVENT_INVITE_ALERT = 0x00, + SMSG_CALENDAR_EVENT_INVITE_NOTES = 0x00, + SMSG_CALENDAR_EVENT_INVITE_NOTES_ALERT = 0x00, + SMSG_CALENDAR_EVENT_INVITE_REMOVED = 0x00, + SMSG_CALENDAR_EVENT_INVITE_REMOVED_ALERT = 0x00, + SMSG_CALENDAR_EVENT_INVITE_STATUS_ALERT = 0x00, + SMSG_CALENDAR_EVENT_MODERATOR_STATUS_ALERT = 0x00, + SMSG_CALENDAR_EVENT_REMOVED_ALERT = 0x5C72, + SMSG_CALENDAR_EVENT_STATUS = 0x00, + SMSG_CALENDAR_EVENT_UPDATED_ALERT = 0x5CFA, + SMSG_CALENDAR_RAID_LOCKOUT_ADDED = 0x9AC2, + SMSG_CALENDAR_RAID_LOCKOUT_REMOVED = 0x985B, + SMSG_CALENDAR_RAID_LOCKOUT_UPDATED = 0xDCDF, SMSG_CALENDAR_SEND_CALENDAR = 0x08FB, + SMSG_CALENDAR_SEND_EVENT = 0x00, SMSG_CALENDAR_SEND_NUM_PENDING = 0x00, + SMSG_CALENDAR_UPDATE_INVITE_LIST = 0x00, SMSG_CAMERA_SHAKE = 0x5CFB, SMSG_CANCEL_AUTO_REPEAT = 0x5ACB, SMSG_CANCEL_COMBAT = 0x4AC7, diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index 3e4a38ba6b1..11837b0cbab 100755 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -858,19 +858,6 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) stmt->setString(0, account); PreparedQueryResult result = LoginDatabase.Query(stmt); - "sessionkey, " //1 - "last_ip, " //2 - "locked, " //3 - "v, " //4 - "s, " //5 - "expansion, " //6 - "mutetime, " //7 - "locale, " //8 - "recruiter, " //9 - "os " - "FROM account " - "WHERE username = '%s'", - safe_account.c_str()); // Stop if the account is not found if (!result) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 200007c3190..7cff80cf6a0 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -1516,7 +1516,9 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const if (target->GetTypeId() == TYPEID_PLAYER) { - const PlayerSpellMap& sp_list = target->ToPlayer()->GetSpellMap(); + Player* plrTarget = target->ToPlayer(); + + PlayerSpellMap const& sp_list = plrTarget->GetSpellMap(); for (PlayerSpellMap::const_iterator itr = sp_list.begin(); itr != sp_list.end(); ++itr) { if (itr->second->state == PLAYERSPELL_REMOVED || itr->second->disabled) @@ -1536,13 +1538,14 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const // Also do it for Glyphs for (uint32 i = 0; i < MAX_GLYPH_SLOT_INDEX; ++i) { - if (uint32 glyphId = target->ToPlayer()->GetGlyph(i)) + if (uint32 glyphId = plrTarget->GetGlyph(plrTarget->GetActiveSpec(), i)) { if (GlyphPropertiesEntry const* glyph = sGlyphPropertiesStore.LookupEntry(glyphId)) { SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(glyph->SpellId); if (!spellInfo || !(spellInfo->Attributes & (SPELL_ATTR0_PASSIVE | SPELL_ATTR0_HIDDEN_CLIENTSIDE))) continue; + if (spellInfo->Stances & (1<<(GetMiscValue()-1))) target->CastSpell(target, glyph->SpellId, true, NULL, this); } @@ -1550,19 +1553,21 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const } // Leader of the Pack - if (target->ToPlayer()->HasSpell(17007)) + if (plrTarget->HasSpell(17007)) { SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(24932); if (spellInfo && spellInfo->Stances & (1<<(GetMiscValue()-1))) target->CastSpell(target, 24932, true, NULL, this); } + // Improved Barkskin - apply/remove armor bonus due to shapeshift - if (target->ToPlayer()->HasSpell(63410) || target->ToPlayer()->HasSpell(63411)) + if (plrTarget->HasSpell(63410) || target->ToPlayer()->HasSpell(63411)) { target->RemoveAurasDueToSpell(66530); if (GetMiscValue() == FORM_TRAVEL || GetMiscValue() == FORM_NONE) // "while in Travel Form or while not shapeshifted" target->CastSpell(target, 66530, true); } + // Heart of the Wild if (HotWSpellId) { // hacky, but the only way as spell family is not SPELLFAMILY_DRUID diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index fd0530e171f..d833782bc76 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3800,23 +3800,6 @@ void Spell::SendCastResult(Player* caster, SpellInfo const* spellInfo, uint8 cas data << uint32(missingItem); // first missing item break; } - case SPELL_FAILED_PREVENTED_BY_MECHANIC: - data << uint32(spellInfo->Mechanic); - break; - case SPELL_FAILED_NEED_EXOTIC_AMMO: - data << uint32(spellInfo->EquippedItemSubClassMask); - break; - case SPELL_FAILED_NEED_MORE_ITEMS: - data << uint32(0); // Item entry - data << uint32(0); // Count - break; - case SPELL_FAILED_MIN_SKILL: - data << uint32(0); // SkillLine.dbc Id - data << uint32(0); // Amount - break; - case SPELL_FAILED_FISHING_TOO_LOW: - data << uint32(0); // Skill level - break; default: break; } diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 4069cd5271a..8c95bc054d9 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -670,8 +670,8 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex) if (Item* item = caster->GetWeaponForAttack(RANGED_ATTACK)) { ItemTemplate const* weaponTemplate = item->GetTemplate(); - float dmg_min = weaponTemplate->Damage[0].DamageMin; - float dmg_max = weaponTemplate->Damage[0].DamageMax; + float dmg_min = weaponTemplate->DamageMin; + float dmg_max = weaponTemplate->DamageMax; if (dmg_max == 0.0f && dmg_min > dmg_max) damage += int32(dmg_min); else diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index 7c431566f52..2deac95d287 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -135,7 +135,7 @@ public: else handler->PSendSysMessage("no VMAP available for area info"); - handler->PSendSysMessage(LANG_MAP_POSITION, + /*handler->PSendSysMessage(LANG_MAP_POSITION, object->GetMapId(), (mapEntry ? mapEntry->name[handler->GetSessionDbcLocale()] : ""), zoneId, (zoneEntry ? zoneEntry->area_name[handler->GetSessionDbcLocale()] : ""), areaId, (areaEntry ? areaEntry->area_name[handler->GetSessionDbcLocale()] : ""), @@ -143,6 +143,7 @@ public: object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), object->GetOrientation(), cell.GridX(), cell.GridY(), cell.CellX(), cell.CellY(), object->GetInstanceId(), zoneX, zoneY, groundZ, floorZ, haveMap, haveVMap); + */ LiquidData liquidStatus; ZLiquidStatus status = map->getLiquidStatus(object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), MAP_ALL_LIQUIDS, &liquidStatus); diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h index 24ca412d6f2..1e346760e30 100755 --- a/src/server/shared/Packets/ByteBuffer.h +++ b/src/server/shared/Packets/ByteBuffer.h @@ -416,14 +416,14 @@ class ByteBuffer uint8& operator[](size_t const pos) { if (pos >= size()) - throw ByteBufferException(false, pos, 1, size()); + throw ByteBufferPositionException(false, pos, 1, size()); return _storage[pos]; } uint8 const& operator[](size_t const pos) const { if (pos >= size()) - throw ByteBufferException(false, pos, 1, size()); + throw ByteBufferPositionException(false, pos, 1, size()); return _storage[pos]; } -- cgit v1.2.3 From 853f96217da40c00be8d09fae171484f69723393 Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 30 May 2012 13:15:51 +0200 Subject: Core/Players: 310% mounted speed is identified by riding skill 375, no need for a custom flag anymore. --- .../2012_05_30_00_characters_characters.sql | 2 + src/server/game/Entities/Player/Player.cpp | 50 ---------------------- src/server/game/Entities/Player/Player.h | 3 -- src/server/game/Spells/Auras/SpellAuras.cpp | 1 - src/server/game/Spells/Auras/SpellAuras.h | 2 +- src/server/game/Spells/SpellEffects.cpp | 38 ++++++++-------- src/server/scripts/Spells/spell_druid.cpp | 2 +- 7 files changed, 23 insertions(+), 75 deletions(-) create mode 100644 sql/updates/characters/2012_05_30_00_characters_characters.sql (limited to 'src') diff --git a/sql/updates/characters/2012_05_30_00_characters_characters.sql b/sql/updates/characters/2012_05_30_00_characters_characters.sql new file mode 100644 index 00000000000..9336e826580 --- /dev/null +++ b/sql/updates/characters/2012_05_30_00_characters_characters.sql @@ -0,0 +1,2 @@ +-- Remove unused flag +UPDATE `characters` SET `extra_flags`=`extra_flags`&~0x40; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 890ceb72c3e..e8d89110f82 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -3895,12 +3895,6 @@ bool Player::addSpell(uint32 spellId, bool active, bool learning, bool dependent if (!pSkill) continue; - if (!Has310Flyer(false) && pSkill->id == SKILL_MOUNTS) - for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) - if (spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED && - spellInfo->Effects[i].CalcValue() == 310) - SetHas310Flyer(true); - if (HasSkill(pSkill->id)) continue; @@ -4165,16 +4159,6 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank) SetSkill(pSkill->id, GetSkillStep(pSkill->id), 0, 0); } - - // most likely will never be used, haven't heard of cases where players unlearn a mount - if (Has310Flyer(false) && _spell_idx->second->skillId == SKILL_MOUNTS) - { - if (spellInfo) - for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) - if (spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED && - spellInfo->Effects[i].CalcValue() == 310) - Has310Flyer(true, spell_id); // with true as first argument its also used to set/remove the flag - } } } @@ -4255,40 +4239,6 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank) } } -bool Player::Has310Flyer(bool checkAllSpells, uint32 excludeSpellId) -{ - if (!checkAllSpells) - return m_ExtraFlags & PLAYER_EXTRA_HAS_310_FLYER; - else - { - SetHas310Flyer(false); - SpellInfo const* spellInfo; - for (PlayerSpellMap::iterator itr = m_spells.begin(); itr != m_spells.end(); ++itr) - { - if (itr->first == excludeSpellId) - continue; - - SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(itr->first); - for (SkillLineAbilityMap::const_iterator _spell_idx = bounds.first; _spell_idx != bounds.second; ++_spell_idx) - { - if (_spell_idx->second->skillId != SKILL_MOUNTS) - break; // We can break because mount spells belong only to one skillline (at least 310 flyers do) - - spellInfo = sSpellMgr->GetSpellInfo(itr->first); - for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) - if (spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED && - spellInfo->Effects[i].CalcValue() == 310) - { - SetHas310Flyer(true); - return true; - } - } - } - } - - return false; -} - void Player::RemoveSpellCooldown(uint32 spell_id, bool update /* = false */) { m_spellCooldowns.erase(spell_id); diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index dc6fd7eab26..24a1c35b8e2 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -500,7 +500,6 @@ enum PlayerExtraFlags PLAYER_EXTRA_TAXICHEAT = 0x0008, PLAYER_EXTRA_GM_INVISIBLE = 0x0010, PLAYER_EXTRA_GM_CHAT = 0x0020, // Show GM badge in chat messages - PLAYER_EXTRA_HAS_310_FLYER = 0x0040, // Marks if player already has 310% speed flying mount // other states PLAYER_EXTRA_PVP_DEATH = 0x0100 // store PvP death status until corpse creating. @@ -1197,8 +1196,6 @@ class Player : public Unit, public GridObject void SetTaxiCheater(bool on) { if (on) m_ExtraFlags |= PLAYER_EXTRA_TAXICHEAT; else m_ExtraFlags &= ~PLAYER_EXTRA_TAXICHEAT; } bool isGMVisible() const { return !(m_ExtraFlags & PLAYER_EXTRA_GM_INVISIBLE); } void SetGMVisible(bool on); - bool Has310Flyer(bool checkAllSpells, uint32 excludeSpellId = 0); - void SetHas310Flyer(bool on) { if (on) m_ExtraFlags |= PLAYER_EXTRA_HAS_310_FLYER; else m_ExtraFlags &= ~PLAYER_EXTRA_HAS_310_FLYER; } void SetPvPDeath(bool on) { if (on) m_ExtraFlags |= PLAYER_EXTRA_PVP_DEATH; else m_ExtraFlags &= ~PLAYER_EXTRA_PVP_DEATH; } void GiveXP(uint32 xp, Unit* victim, float group_rate=1.0f); diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index ea25c0b76b5..58c8ce5c558 100755 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -2479,4 +2479,3 @@ void DynObjAura::FillTargetMap(std::map & targets, Unit* /*caster* } } } - diff --git a/src/server/game/Spells/Auras/SpellAuras.h b/src/server/game/Spells/Auras/SpellAuras.h index 2f50d47a79b..36398bafa97 100755 --- a/src/server/game/Spells/Auras/SpellAuras.h +++ b/src/server/game/Spells/Auras/SpellAuras.h @@ -166,7 +166,7 @@ class Aura void SetLoadedState(int32 maxduration, int32 duration, int32 charges, uint8 stackamount, uint8 recalculateMask, int32 * amount); // helpers for aura effects - bool HasEffect(uint8 effIndex) const { return bool(GetEffect(effIndex)); } + bool HasEffect(uint8 effIndex) const { return GetEffect(effIndex) != NULL; } bool HasEffectType(AuraType type) const; AuraEffect* GetEffect(uint8 effIndex) const { ASSERT (effIndex < MAX_SPELL_EFFECTS); return m_effects[effIndex]; } uint8 GetEffectMask() const { uint8 effMask = 0; for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) if (m_effects[i]) effMask |= 1<ToPlayer()->GetBaseSkillValue(SKILL_RIDING)) { - case 75: unitTarget->CastSpell(unitTarget, 75619, true); break; - case 150: unitTarget->CastSpell(unitTarget, 75620, true); break; - case 225: + case 75: unitTarget->CastSpell(unitTarget, 75619, true); break; + case 150: unitTarget->CastSpell(unitTarget, 75620, true); break; + case 225: { if (canFly) unitTarget->CastSpell(unitTarget, 75617, true); else unitTarget->CastSpell(unitTarget, 75620, true); - }break; - case 300: + } + break; + case 300: { if (canFly) - { - if (unitTarget->ToPlayer()->Has310Flyer(false)) - unitTarget->CastSpell(unitTarget, 76153, true); - else - unitTarget->CastSpell(unitTarget, 75618, true); - } + unitTarget->CastSpell(unitTarget, 75618, true); else unitTarget->CastSpell(unitTarget, 75620, true); - }break; + } + break; + case 375: + if (canFly) + unitTarget->CastSpell(unitTarget, 76153, true); + else + unitTarget->CastSpell(unitTarget, 75620, true); + break; } return; } @@ -4427,13 +4430,10 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) // Triggered spell id dependent on riding skill if (uint16 skillval = unitTarget->ToPlayer()->GetSkillValue(SKILL_RIDING)) { - if (skillval >= 300) - { - if (unitTarget->ToPlayer()->Has310Flyer(false)) - unitTarget->CastSpell(unitTarget, 76154, true); - else - unitTarget->CastSpell(unitTarget, 75972, true); - } + if (skillval >= 375) + unitTarget->CastSpell(unitTarget, 76154, true); + else if (skillval >= 300) + unitTarget->CastSpell(unitTarget, 75972, true); else unitTarget->CastSpell(unitTarget, 75957, true); } diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index 898350dbd71..286bec6abab 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -312,7 +312,7 @@ class spell_dru_swift_flight_passive : public SpellScriptLoader void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/) { if (Player* caster = GetCaster()->ToPlayer()) - if (caster->Has310Flyer(false)) + if (caster->GetSkillValue(SKILL_RIDING) >= 375) amount = 310; } -- cgit v1.2.3 From 8fa351b786607dcfa4638f291e68066336e2b23d Mon Sep 17 00:00:00 2001 From: Nay Date: Wed, 30 May 2012 14:18:28 +0100 Subject: Core/DBLayer: Fix some errors with character DB prepared statements --- sql/base/characters_database.sql | 4 ++-- .../shared/Database/Implementation/CharacterDatabase.cpp | 12 +++++------- .../shared/Database/Implementation/CharacterDatabase.h | 2 -- 3 files changed, 7 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/sql/base/characters_database.sql b/sql/base/characters_database.sql index 6820bdee1c0..ada0f0d3ab4 100644 --- a/sql/base/characters_database.sql +++ b/sql/base/characters_database.sql @@ -1,6 +1,6 @@ -- MySQL dump 10.13 Distrib 5.5.21, for Win64 (x86) -- --- Host: localhost Database: characters +-- Host: localhost Database: characters_4x -- ------------------------------------------------------ -- Server version 5.5.21 @@ -2265,4 +2265,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2012-03-25 21:14:19 +-- Dump completed on 2012-05-30 12:56:18 diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index 42e7fdbe087..ea9165f86ec 100755 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -449,14 +449,13 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_SEL_MAIL_ITEMS_BY_ENTRY, "SELECT mi.item_guid, m.sender, m.receiver, cs.account, cs.name, cr.account, cr.name FROM mail m INNER JOIN mail_items mi ON mi.mail_id = m.id INNER JOIN item_instance ii ON ii.guid = mi.item_guid INNER JOIN characters cs ON cs.guid = m.sender INNER JOIN characters cr ON cr.guid = m.receiver WHERE ii.itemEntry = ? LIMIT ?", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_SEL_AUCTIONHOUSE_ITEM_BY_ENTRY, "SELECT ah.itemguid, ah.itemowner, c.account, c.name FROM auctionhouse ah INNER JOIN characters c ON c.guid = ah.itemowner INNER JOIN item_instance ii ON ii.guid = ah.itemguid WHERE ii.itemEntry = ? LIMIT ?", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_SEL_GUILD_BANK_ITEM_BY_ENTRY, "SELECT gi.item_guid, gi.guildid, g.name FROM guild_bank_item gi INNER JOIN guild g ON g.guildid = gi.guildid INNER JOIN item_instance ii ON ii.guid = gi.item_guid WHERE ii.itemEntry = ? LIMIT ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_SEL_CHAR_PET_BY_ENTRY, "SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, curhappiness, abdata, savetime, CreatedBySpell, PetType FROM character_pet WHERE owner = ? AND id = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_SEL_CHAR_PET_BY_ENTRY_AND_SLOT_2, "SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, curhappiness, abdata, savetime, CreatedBySpell, PetType FROM character_pet WHERE owner = ? AND entry = ? AND (slot = ? OR slot > ?)", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_SEL_CHAR_PET_BY_SLOT, "SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, curhappiness, abdata, savetime, CreatedBySpell, PetType FROM character_pet WHERE owner = ? AND (slot = ? OR slot > ?) ", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_PET_BY_ENTRY, "SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, abdata, savetime, CreatedBySpell, PetType FROM character_pet WHERE owner = ? AND id = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_PET_BY_ENTRY_AND_SLOT_2, "SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, abdata, savetime, CreatedBySpell, PetType FROM character_pet WHERE owner = ? AND entry = ? AND (slot = ? OR slot > ?)", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_PET_BY_SLOT, "SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, abdata, savetime, CreatedBySpell, PetType FROM character_pet WHERE owner = ? AND (slot = ? OR slot > ?) ", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_DEL_CHAR_ACHIEVEMENT, "DELETE FROM character_achievement WHERE guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_DEL_CHAR_ACHIEVEMENT_PROGRESS, "DELETE FROM character_achievement_progress WHERE guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_DEL_CHAR_REPUTATION_BY_FACTION, "DELETE FROM character_reputation WHERE guid = ? AND faction = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_INS_CHAR_REPUTATION_BY_FACTION, "INSERT INTO character_reputation (guid, faction, standing, flags) VALUES (?, ?, ? , ?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UPD_CHAR_ARENA_POINTS, "UPDATE characters SET arenaPoints = (arenaPoints + ?) WHERE guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_DEL_ITEM_REFUND_INSTANCE, "DELETE FROM item_refund_instance WHERE item_guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_INS_ITEM_REFUND_INSTANCE, "INSERT INTO item_refund_instance (item_guid, player_guid, paidMoney, paidExtendedCost) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_DEL_GROUP, "DELETE FROM groups WHERE guid = ?", CONNECTION_ASYNC); @@ -526,7 +525,6 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_DEL_CHAR_TALENT, "DELETE FROM character_talent WHERE guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_DEL_CHAR_SKILLS, "DELETE FROM character_skills WHERE guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_UDP_CHAR_HONOR_POINTS, "UPDATE characters SET totalHonorPoints = ? WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UDP_CHAR_ARENA_POINTS, "UPDATE characters SET arenaPoints = ? WHERE guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_UDP_CHAR_MONEY, "UPDATE characters SET money = ? WHERE guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_INS_CHAR_ACTION, "INSERT INTO character_action (guid, spec, button, action, type) VALUES (?, ?, ?, ?, ?)", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_UPD_CHAR_ACTION, "UPDATE character_action SET action = ?, type = ? WHERE guid = ? AND button = ? AND spec = ?", CONNECTION_ASYNC); @@ -543,7 +541,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_UDP_CHAR_SKILLS, "UPDATE character_skills SET value = ?, max = ? WHERE guid = ? AND skill = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_INS_CHAR_SPELL, "INSERT INTO character_spell (guid, spell, active, disabled) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_DEL_CHAR_STATS, "DELETE FROM character_stats WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_INS_CHAR_STATS, "INSERT INTO character_stats (guid, maxhealth, maxpower1, maxpower2, maxpower3, maxpower4, maxpower5, maxpower6, maxpower7, strength, agility, stamina, intellect, spirit, armor, resHoly, resFire, resNature, resFrost, resShadow, resArcane, blockPct, dodgePct, parryPct, critPct, rangedCritPct, spellCritPct, attackPower, rangedAttackPower, spellPower, resilience) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_INS_CHAR_STATS, "INSERT INTO character_stats (guid, maxhealth, maxpower1, maxpower2, maxpower3, maxpower4, maxpower5, strength, agility, stamina, intellect, spirit, armor, resHoly, resFire, resNature, resFrost, resShadow, resArcane, blockPct, dodgePct, parryPct, critPct, rangedCritPct, spellCritPct, attackPower, rangedAttackPower, spellPower, resilience) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_DEL_PETITION_BY_OWNER, "DELETE FROM petition WHERE ownerguid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_DEL_PETITION_SIGNATURE_BY_OWNER, "DELETE FROM petition_sign WHERE ownerguid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_DEL_PETITION_BY_OWNER_AND_TYPE, "DELETE FROM petition WHERE ownerguid = ? AND type = ?", CONNECTION_ASYNC); @@ -552,5 +550,5 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_DEL_CHAR_TALENT_BY_SPELL_SPEC, "DELETE FROM character_talent WHERE guid = ? and spell = ? and spec = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_INS_CHAR_TALENT, "INSERT INTO character_talent (guid, spell, spec) VALUES (?, ?, ?)", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_DEL_CHAR_ACTION_EXCEPT_SPEC, "DELETE FROM character_action WHERE spec<>? AND guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_SEL_CHAR_PET_BY_ENTRY_AND_SLOT, "SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, curhappiness, abdata, savetime, CreatedBySpell, PetType FROM character_pet WHERE owner = ? AND slot = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHAR_PET_BY_ENTRY_AND_SLOT, "SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, abdata, savetime, CreatedBySpell, PetType FROM character_pet WHERE owner = ? AND slot = ?", CONNECTION_SYNCH); } diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.h b/src/server/shared/Database/Implementation/CharacterDatabase.h index 85b948f6ce6..51ab97fe021 100755 --- a/src/server/shared/Database/Implementation/CharacterDatabase.h +++ b/src/server/shared/Database/Implementation/CharacterDatabase.h @@ -418,7 +418,6 @@ enum CharacterDatabaseStatements CHAR_DEL_CHAR_ACHIEVEMENT_PROGRESS, CHAR_DEL_CHAR_REPUTATION_BY_FACTION, CHAR_INS_CHAR_REPUTATION_BY_FACTION, - CHAR_UPD_CHAR_ARENA_POINTS, CHAR_DEL_ITEM_REFUND_INSTANCE, CHAR_INS_ITEM_REFUND_INSTANCE, CHAR_DEL_GROUP, @@ -488,7 +487,6 @@ enum CharacterDatabaseStatements CHAR_DEL_CHAR_TALENT, CHAR_DEL_CHAR_SKILLS, CHAR_UDP_CHAR_HONOR_POINTS, - CHAR_UDP_CHAR_ARENA_POINTS, CHAR_UDP_CHAR_MONEY, CHAR_INS_CHAR_ACTION, CHAR_UPD_CHAR_ACTION, -- cgit v1.2.3 From 9ab6e76a7822758859bd781e294d90252526ac16 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 31 May 2012 00:59:40 +0200 Subject: Merge fix for map extractor --- dep/StormLib/CMakeLists.txt | 34 ++++++++-------------------------- src/tools/map_extractor/System.cpp | 2 +- 2 files changed, 9 insertions(+), 27 deletions(-) (limited to 'src') diff --git a/dep/StormLib/CMakeLists.txt b/dep/StormLib/CMakeLists.txt index 33f5f7b830d..bc6f947af13 100644 --- a/dep/StormLib/CMakeLists.txt +++ b/dep/StormLib/CMakeLists.txt @@ -1,6 +1,3 @@ -project(StormLib) -cmake_minimum_required(VERSION 2.6) - set(SRC_FILES src/adpcm/adpcm.cpp src/huffman/huff.cpp @@ -239,26 +236,21 @@ set(TEST_SRC_FILES add_definitions(-D_7ZIP_ST -DBZ_STRICT_ANSI) -if(WIN32) - if(MSVC) - message(STATUS "Using MSVC") +if( WIN32 ) + if( MSVC ) add_definitions(-D_7ZIP_ST -DWIN32) - else() - message(STATUS "Using mingw") endif() set(SRC_ADDITIONAL_FILES ${ZLIB_BZIP2_FILES} ${TOMCRYPT_FILES} ${TOMMATH_FILES}) endif() -if(APPLE) - message(STATUS "Using Mac OS X port") +if( APPLE ) set(LINK_LIBS z bz2) set(SRC_ADDITIONAL_FILES ${TOMCRYPT_FILES} ${TOMMATH_FILES}) endif() -if (${CMAKE_SYSTEM_NAME} STREQUAL Linux) - message(STATUS "Using Linux port") +if( ${CMAKE_SYSTEM_NAME} STREQUAL Linux ) option(WITH_LIBTOMCRYPT "Use system LibTomCrypt library" OFF) - if(WITH_LIBTOMCRYPT) + if( WITH_LIBTOMCRYPT ) set(LINK_LIBS z bz2 tomcrypt) else() set(LINK_LIBS z bz2) @@ -269,27 +261,17 @@ endif() add_library(storm STATIC ${SRC_FILES} ${SRC_ADDITIONAL_FILES}) target_link_libraries(storm ${LINK_LIBS}) -option(WITH_TEST "Compile Test application" OFF) -if(WITH_TEST) - add_executable(storm_test ${TEST_SRC_FILES}) - target_link_libraries(storm_test storm) -endif() - -if(APPLE) +if( APPLE ) set_target_properties(storm PROPERTIES FRAMEWORK true) set_target_properties(storm PROPERTIES PUBLIC_HEADER "src/StormLib.h src/StormPort.h") set_target_properties(storm PROPERTIES LINK_FLAGS "-framework Carbon") endif() -if(UNIX) +if( UNIX ) set_target_properties(storm PROPERTIES SOVERSION 0) endif() # On Win32, build StormLib.dll since we don't want to clash with Storm.dll -if(WIN32) +if( WIN32 ) set_target_properties(storm PROPERTIES OUTPUT_NAME StormLib) endif() - -#install(TARGETS storm ARCHIVE DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib FRAMEWORK DESTINATION /Library/Frameworks) -#install(FILES src/StormLib.h src/StormPort.h DESTINATION include) - diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp index 241be4982ab..41941795b20 100644 --- a/src/tools/map_extractor/System.cpp +++ b/src/tools/map_extractor/System.cpp @@ -670,7 +670,7 @@ bool ConvertADT(char *filename, char *filename2, int cell_y, int cell_x, uint32 { for(int j = 0; j < ADT_CELLS_PER_GRID; j++) { - adt_MCNK *cell = cells->getMCNK(i, j); + adt_MCNK *cell = adt.cells[i][j]; if (!cell) continue; -- cgit v1.2.3 From 6fe1657fe98035d9a762d2e92f275826bec6d1fe Mon Sep 17 00:00:00 2001 From: kaelima Date: Thu, 28 Jun 2012 11:45:13 +0200 Subject: Core/Protocol: Added a couple of opcodes --- src/server/game/Server/Protocol/Opcodes.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index dfcf56c388b..a32ad631dd9 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -155,7 +155,7 @@ enum Opcodes CMSG_DESTROYITEM = 0x4E7A, CMSG_DUEL_ACCEPTED = 0x9CCB, CMSG_DUEL_CANCELLED = 0x1E4F, - CMSG_EJECT_PASSENGER = 0x00, + CMSG_EJECT_PASSENGER = 0xDE5A, CMSG_EMOTE = 0x9843, CMSG_ENABLE_NAGLE = 0x00, CMSG_EQUIPMENT_SET_DELETE = 0x9CF2, @@ -186,7 +186,7 @@ enum Opcodes CMSG_GOSSIP_HELLO = 0xAD3, CMSG_GOSSIP_SELECT_OPTION = 0x984E, CMSG_GRANT_LEVEL = 0x1CD6, - CMSG_GROUP_ACCEPT = 0x00, + CMSG_GROUP_ACCEPT = 0x0B62, CMSG_GROUP_ASSISTANT_LEADER = 0xC8CA, CMSG_GROUP_CANCEL = 0x00, CMSG_GROUP_CHANGE_SUB_GROUP = 0x1AD2, @@ -239,11 +239,12 @@ enum Opcodes CMSG_LEAVE_BATTLEFIELD = 0x1AE7, CMSG_LEAVE_CHANNEL = 0x60C9, CMSG_LFG_GET_PLAYER_INFO = 0x00, - CMSG_LFG_JOIN = 0x00, - CMSG_LFG_LEAVE = 0x00, + CMSG_LFG_JOIN = 0x58E2, + CMSG_LFG_LEAVE = 0x0EF7, CMSG_LFG_LFR_JOIN = 0x8CFA, + CMSG_LFG_LFR_LEAVE = 0x18CA, CMSG_LFG_PARTY_LOCK_INFO_REQUEST = 0xC867, - CMSG_LFG_PROPOSAL_RESULT = 0x00, + CMSG_LFG_PROPOSAL_RESULT = 0x985A, CMSG_LFG_SET_ROLES = 0x4843, CMSG_LFG_TELEPORT = 0x8C7A, CMSG_LIST_INVENTORY = 0xDCFE, @@ -252,10 +253,10 @@ enum Opcodes CMSG_LOGOUT_CANCEL = 0xA76, CMSG_LOGOUT_REQUEST = 0x4C7A, CMSG_LOOT = 0x1E62, - CMSG_LOOT_METHOD = 0x00, + CMSG_LOOT_METHOD = 0xCCC6, CMSG_LOOT_MONEY = 0x4A42, CMSG_LOOT_RELEASE = 0x4A6A, - CMSG_LOOT_ROLL = 0x00, + CMSG_LOOT_ROLL = 0x4AFF, CMSG_MAIL_CREATE_TEXT_ITEM = 0x886E, CMSG_MAIL_DELETE = 0x4CCF, CMSG_MAIL_MARK_AS_READ = 0x00, -- cgit v1.2.3 From 568fba707c019229b63319336a879151ade3d54b Mon Sep 17 00:00:00 2001 From: LordJZ Date: Tue, 5 Jun 2012 07:17:14 +0400 Subject: Fix vmap extractor for 15595. Now uses StormLib. Haven't checked if it works on nix though, will do later. --- src/tools/map_extractor/System.cpp | 16 +- src/tools/vmap4_extractor/CMakeLists.txt | 8 +- src/tools/vmap4_extractor/adtfile.cpp | 4 +- src/tools/vmap4_extractor/adtfile.h | 2 +- src/tools/vmap4_extractor/dbcfile.cpp | 14 +- src/tools/vmap4_extractor/dbcfile.h | 4 +- src/tools/vmap4_extractor/gameobject_extract.cpp | 4 +- src/tools/vmap4_extractor/model.cpp | 6 +- src/tools/vmap4_extractor/modelheaders.h | 7 +- src/tools/vmap4_extractor/mpq_libmpq.cpp | 111 -------- src/tools/vmap4_extractor/mpq_libmpq04.h | 90 ------- src/tools/vmap4_extractor/mpqfile.cpp | 86 ++++++ src/tools/vmap4_extractor/mpqfile.h | 80 ++++++ src/tools/vmap4_extractor/vmapexport.cpp | 323 +++++++++++++++-------- src/tools/vmap4_extractor/wdtfile.cpp | 6 +- src/tools/vmap4_extractor/wdtfile.h | 2 +- src/tools/vmap4_extractor/wmo.cpp | 8 +- src/tools/vmap4_extractor/wmo.h | 1 + 18 files changed, 437 insertions(+), 335 deletions(-) delete mode 100644 src/tools/vmap4_extractor/mpq_libmpq.cpp delete mode 100644 src/tools/vmap4_extractor/mpq_libmpq04.h create mode 100644 src/tools/vmap4_extractor/mpqfile.cpp create mode 100644 src/tools/vmap4_extractor/mpqfile.h (limited to 'src') diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp index 41941795b20..e9577d0f108 100644 --- a/src/tools/map_extractor/System.cpp +++ b/src/tools/map_extractor/System.cpp @@ -85,7 +85,7 @@ char const* CONF_mpq_list[]= "expansion3.MPQ", }; -uint32 const Builds[] = {13164, 13205, 13287, 13329, 13596, 13623, 13914, 14007, 14333, 14480, 14545, 15005, 15050, 15211, 0}; +uint32 const Builds[] = {13164, 13205, 13287, 13329, 13596, 13623, 13914, 14007, 14333, 14480, 14545, 15005, 15050, 15211, 15354, 15595, 0}; #define LAST_DBC_IN_DATA_BUILD 13623 // after this build mpqs with dbc are back to locale folder char* const Locales[] = {"enGB", "enUS", "deDE", "esES", "frFR", "koKR", "zhCN", "zhTW", "enCN", "enTW", "esMX", "ruRU"}; @@ -1150,8 +1150,15 @@ void LoadCommonMPQFiles(uint32 build) _stprintf(filename, _T("%s/Data/%s"), input_path, CONF_mpq_list[i]); if (!SFileOpenPatchArchive(WorldMpq, filename, "", 0)) + { if (GetLastError() != ERROR_PATH_NOT_FOUND) _tprintf(_T("Cannot open archive %s\n"), filename); + else + _tprintf(_T("Not found %s\n"), filename); + } + else + _tprintf(_T("Loaded %s\n"), filename); + } char const* prefix = NULL; @@ -1173,8 +1180,12 @@ void LoadCommonMPQFiles(uint32 build) { if (GetLastError() != ERROR_PATH_NOT_FOUND) _tprintf(_T("Cannot open patch archive %s\n"), filename); + else + _tprintf(_T("Not found %s\n"), filename); continue; } + else + _tprintf(_T("Loaded %s\n"), filename); } } @@ -1191,9 +1202,6 @@ int main(int argc, char * arg[]) for (int i = 0; i < LOCALES_COUNT; ++i) { - TCHAR tmp1[512]; - _stprintf(tmp1, _T("%s/Data/%s/locale-%s.MPQ"), input_path, Locales[i], Locales[i]); - //Open MPQs if (!LoadLocaleMPQFile(i)) { diff --git a/src/tools/vmap4_extractor/CMakeLists.txt b/src/tools/vmap4_extractor/CMakeLists.txt index c1ef3125a20..3f6b2673be2 100644 --- a/src/tools/vmap4_extractor/CMakeLists.txt +++ b/src/tools/vmap4_extractor/CMakeLists.txt @@ -15,9 +15,11 @@ file(GLOB_RECURSE sources *.cpp *.h) add_definitions("-DIOMAP_DEBUG") # build setup currently only supports libmpq 0.4.x -add_definitions("-Wall") -add_definitions("-ggdb") -add_definitions("-O3") +if( NOT WIN32 ) + add_definitions("-Wall") + add_definitions("-ggdb") + add_definitions("-O3") +endif() include_directories( ${CMAKE_SOURCE_DIR}/dep/StormLib/src diff --git a/src/tools/vmap4_extractor/adtfile.cpp b/src/tools/vmap4_extractor/adtfile.cpp index a966172a3be..c53b63ffa5e 100644 --- a/src/tools/vmap4_extractor/adtfile.cpp +++ b/src/tools/vmap4_extractor/adtfile.cpp @@ -78,7 +78,9 @@ char * GetExtension(char * FileName) return NULL; } -ADTFile::ADTFile(char* filename): ADT(filename) +extern HANDLE WorldMpq; + +ADTFile::ADTFile(char* filename): ADT(WorldMpq, filename) { Adtfilename.append(filename); } diff --git a/src/tools/vmap4_extractor/adtfile.h b/src/tools/vmap4_extractor/adtfile.h index 08814996f68..795eebc892f 100644 --- a/src/tools/vmap4_extractor/adtfile.h +++ b/src/tools/vmap4_extractor/adtfile.h @@ -19,7 +19,7 @@ #ifndef ADT_H #define ADT_H -#include "mpq_libmpq04.h" +#include "mpqfile.h" #include "wmo.h" #include "model.h" diff --git a/src/tools/vmap4_extractor/dbcfile.cpp b/src/tools/vmap4_extractor/dbcfile.cpp index 5b5fe314799..efc8aeabe8c 100644 --- a/src/tools/vmap4_extractor/dbcfile.cpp +++ b/src/tools/vmap4_extractor/dbcfile.cpp @@ -20,13 +20,16 @@ #include "dbcfile.h" -DBCFile::DBCFile(HANDLE file) : - _file(file), _data(NULL), _stringTable(NULL) +DBCFile::DBCFile(HANDLE mpq, const char* filename) : + _mpq(mpq), _filename(filename), _file(NULL), _data(NULL), _stringTable(NULL) { } bool DBCFile::open() { + if (!SFileOpenFileEx(_mpq, _filename, SFILE_OPEN_PATCHED_FILE, &_file)) + return false; + char header[4]; unsigned int na, nb, es, ss; @@ -38,18 +41,22 @@ bool DBCFile::open() if (header[0] != 'W' || header[1] != 'D' || header[2] != 'B' || header[3] != 'C') return false; + readBytes = 0; SFileReadFile(_file, &na, 4, &readBytes, NULL); if (readBytes != 4) // Number of records return false; + readBytes = 0; SFileReadFile(_file, &nb, 4, &readBytes, NULL); if (readBytes != 4) // Number of fields return false; + readBytes = 0; SFileReadFile(_file, &es, 4, &readBytes, NULL); if (readBytes != 4) // Size of a record return false; + readBytes = 0; SFileReadFile(_file, &ss, 4, &readBytes, NULL); if (readBytes != 4) // String size return false; @@ -65,6 +72,7 @@ bool DBCFile::open() _stringTable = _data + _recordSize*_recordCount; size_t data_size = _recordSize * _recordCount + _stringSize; + readBytes = 0; SFileReadFile(_file, _data, data_size, &readBytes, NULL); if (readBytes != data_size) return false; @@ -75,6 +83,8 @@ bool DBCFile::open() DBCFile::~DBCFile() { delete [] _data; + if (_file != NULL) + SFileCloseFile(_file); } DBCFile::Record DBCFile::getRecord(size_t id) diff --git a/src/tools/vmap4_extractor/dbcfile.h b/src/tools/vmap4_extractor/dbcfile.h index 9fdb7a9e268..007ccb6cdcb 100644 --- a/src/tools/vmap4_extractor/dbcfile.h +++ b/src/tools/vmap4_extractor/dbcfile.h @@ -25,7 +25,7 @@ class DBCFile { public: - DBCFile(HANDLE file); + DBCFile(HANDLE mpq, const char* filename); ~DBCFile(); // Open database. It must be openened before it can be used. @@ -131,6 +131,8 @@ class DBCFile size_t getMaxId(); private: + HANDLE _mpq; + const char* _filename; HANDLE _file; size_t _recordSize; size_t _recordCount; diff --git a/src/tools/vmap4_extractor/gameobject_extract.cpp b/src/tools/vmap4_extractor/gameobject_extract.cpp index 8a1f67cd2c2..4c8e423bfc4 100644 --- a/src/tools/vmap4_extractor/gameobject_extract.cpp +++ b/src/tools/vmap4_extractor/gameobject_extract.cpp @@ -35,10 +35,12 @@ bool ExtractSingleModel(std::string& fname) return mdl.ConvertToVMAPModel(output.c_str()); } +extern HANDLE LocaleMpq; + void ExtractGameobjectModels() { printf("Extracting GameObject models..."); - DBCFile dbc("DBFilesClient\\GameObjectDisplayInfo.dbc"); + DBCFile dbc(LocaleMpq, "DBFilesClient\\GameObjectDisplayInfo.dbc"); if(!dbc.open()) { printf("Fatal error: Invalid GameObjectDisplayInfo.dbc file format!\n"); diff --git a/src/tools/vmap4_extractor/model.cpp b/src/tools/vmap4_extractor/model.cpp index e81972f521f..d98dca9001b 100644 --- a/src/tools/vmap4_extractor/model.cpp +++ b/src/tools/vmap4_extractor/model.cpp @@ -19,18 +19,20 @@ #include "vmapexport.h" #include "model.h" #include "wmo.h" -#include "mpq_libmpq04.h" +#include "mpqfile.h" #include #include #include +extern HANDLE WorldMpq; + Model::Model(std::string &filename) : filename(filename), vertices(0), indices(0) { } bool Model::open() { - MPQFile f(filename.c_str()); + MPQFile f(WorldMpq, filename.c_str()); ok = !f.isEof(); diff --git a/src/tools/vmap4_extractor/modelheaders.h b/src/tools/vmap4_extractor/modelheaders.h index d859fd3511e..7fd908d7442 100644 --- a/src/tools/vmap4_extractor/modelheaders.h +++ b/src/tools/vmap4_extractor/modelheaders.h @@ -19,12 +19,7 @@ #ifndef MODELHEADERS_H #define MODELHEADERS_H -/* typedef unsigned char uint8; -typedef char int8; -typedef unsigned short uint16; -typedef short int16; -typedef unsigned int uint32; -typedef int int32; */ +#include "mpqfile.h" // integer typedefs #pragma pack(push,1) diff --git a/src/tools/vmap4_extractor/mpq_libmpq.cpp b/src/tools/vmap4_extractor/mpq_libmpq.cpp deleted file mode 100644 index 528b9679a58..00000000000 --- a/src/tools/vmap4_extractor/mpq_libmpq.cpp +++ /dev/null @@ -1,111 +0,0 @@ -#include "mpq_libmpq04.h" -#include -#include - -ArchiveSet gOpenArchives; - -MPQArchive::MPQArchive(const char* filename) -{ - int result = libmpq__archive_open(&mpq_a, filename, -1); - printf("Opening %s\n", filename); - if(result) { - switch(result) { - case LIBMPQ_ERROR_OPEN : - printf("Error opening archive '%s': Does file really exist?\n", filename); - break; - case LIBMPQ_ERROR_FORMAT : /* bad file format */ - printf("Error opening archive '%s': Bad file format\n", filename); - break; - case LIBMPQ_ERROR_SEEK : /* seeking in file failed */ - printf("Error opening archive '%s': Seeking in file failed\n", filename); - break; - case LIBMPQ_ERROR_READ : /* Read error in archive */ - printf("Error opening archive '%s': Read error in archive\n", filename); - break; - case LIBMPQ_ERROR_MALLOC : /* maybe not enough memory? :) */ - printf("Error opening archive '%s': Maybe not enough memory\n", filename); - break; - default: - printf("Error opening archive '%s': Unknown error\n", filename); - break; - } - return; - } - gOpenArchives.push_front(this); -} - -void MPQArchive::close() -{ - //gOpenArchives.erase(erase(&mpq_a); - libmpq__archive_close(mpq_a); -} - -MPQFile::MPQFile(const char* filename): - eof(false), - buffer(0), - pointer(0), - size(0) -{ - for(ArchiveSet::iterator i=gOpenArchives.begin(); i!=gOpenArchives.end();++i) - { - mpq_archive *mpq_a = (*i)->mpq_a; - - uint32 filenum; - if(libmpq__file_number(mpq_a, filename, &filenum)) continue; - libmpq__off_t transferred; - libmpq__file_unpacked_size(mpq_a, filenum, &size); - - // HACK: in patch.mpq some files don't want to open and give 1 for filesize - if (size<=1) { - // printf("info: file %s has size %d; considered dummy file.\n", filename, size); - eof = true; - buffer = 0; - return; - } - buffer = new char[size]; - - //libmpq_file_getdata - libmpq__file_read(mpq_a, filenum, (unsigned char*)buffer, size, &transferred); - /*libmpq_file_getdata(&mpq_a, hash, fileno, (unsigned char*)buffer);*/ - return; - - } - eof = true; - buffer = 0; -} - -size_t MPQFile::read(void* dest, size_t bytes) -{ - if (eof) return 0; - - size_t rpos = pointer + bytes; - if (rpos > size) { - bytes = size - pointer; - eof = true; - } - - memcpy(dest, &(buffer[pointer]), bytes); - - pointer = rpos; - - return bytes; -} - -void MPQFile::seek(int offset) -{ - pointer = offset; - eof = (pointer >= size); -} - -void MPQFile::seekRelative(int offset) -{ - pointer += offset; - eof = (pointer >= size); -} - -void MPQFile::close() -{ - if (buffer) delete[] buffer; - buffer = 0; - eof = true; -} diff --git a/src/tools/vmap4_extractor/mpq_libmpq04.h b/src/tools/vmap4_extractor/mpq_libmpq04.h deleted file mode 100644 index 5101309002e..00000000000 --- a/src/tools/vmap4_extractor/mpq_libmpq04.h +++ /dev/null @@ -1,90 +0,0 @@ -#define _CRT_SECURE_NO_DEPRECATE -#define _CRT_SECURE_NO_WARNINGS - -#ifndef MPQ_H -#define MPQ_H - -#include "libmpq/mpq.h" -#include -#include -#include -#include -#include - -using namespace std; - -class MPQArchive -{ - -public: - mpq_archive_s *mpq_a; - - MPQArchive(const char* filename); - void close(); - - void GetFileListTo(vector& filelist) { - uint32 filenum; - if(libmpq__file_number(mpq_a, "(listfile)", &filenum)) return; - libmpq__off_t size, transferred; - libmpq__file_unpacked_size(mpq_a, filenum, &size); - - char *buffer = new char[size]; - - libmpq__file_read(mpq_a, filenum, (unsigned char*)buffer, size, &transferred); - - char seps[] = "\n"; - char *token; - - token = strtok( buffer, seps ); - uint32 counter = 0; - while ((token != NULL) && (counter < size)) { - //cout << token << endl; - token[strlen(token) - 1] = 0; - string s = token; - filelist.push_back(s); - counter += strlen(token) + 2; - token = strtok(NULL, seps); - } - - delete[] buffer; - } -}; -typedef std::deque ArchiveSet; - -class MPQFile -{ - //MPQHANDLE handle; - bool eof; - char *buffer; - libmpq__off_t pointer,size; - - // disable copying - MPQFile(const MPQFile &f) {} - void operator=(const MPQFile &f) {} - -public: - MPQFile(const char* filename); // filenames are not case sensitive - ~MPQFile() { close(); } - size_t read(void* dest, size_t bytes); - size_t getSize() { return size; } - size_t getPos() { return pointer; } - char* getBuffer() { return buffer; } - char* getPointer() { return buffer + pointer; } - bool isEof() { return eof; } - void seek(int offset); - void seekRelative(int offset); - void close(); -}; - -inline void flipcc(char *fcc) -{ - char t; - t=fcc[0]; - fcc[0]=fcc[3]; - fcc[3]=t; - t=fcc[1]; - fcc[1]=fcc[2]; - fcc[2]=t; -} - -#endif diff --git a/src/tools/vmap4_extractor/mpqfile.cpp b/src/tools/vmap4_extractor/mpqfile.cpp new file mode 100644 index 00000000000..9f019f99f38 --- /dev/null +++ b/src/tools/vmap4_extractor/mpqfile.cpp @@ -0,0 +1,86 @@ +#include "mpqfile.h" +#include +#include +#include "StormLib.h" + +MPQFile::MPQFile(HANDLE mpq, const char* filename): + eof(false), + buffer(0), + pointer(0), + size(0) +{ + HANDLE file; + if (!SFileOpenFileEx(mpq, filename, SFILE_OPEN_PATCHED_FILE, &file)) + { + fprintf(stderr, "Can't open %s, err=%u!\n", filename, GetLastError()); + eof = true; + return; + } + + DWORD hi = 0; + size = SFileGetFileSize(file, &hi); + + if (hi) + { + fprintf(stderr, "Can't open %s, size[hi] = %u!\n", filename, (uint32)hi); + SFileCloseFile(file); + eof = true; + return; + } + + if (size <= 1) + { + fprintf(stderr, "Can't open %s, size = %u!\n", filename, size); + SFileCloseFile(file); + eof = true; + return; + } + + DWORD read = 0; + buffer = new char[size]; + if (!SFileReadFile(file, buffer, size, &read) || size != read) + { + fprintf(stderr, "Can't read %s, size=%u read=%u!\n", filename, size, read); + SFileCloseFile(file); + eof = true; + return; + } + + SFileCloseFile(file); +} + +size_t MPQFile::read(void* dest, size_t bytes) +{ + if (eof) return 0; + + size_t rpos = pointer + bytes; + if (rpos > size) { + bytes = size - pointer; + eof = true; + } + + memcpy(dest, &(buffer[pointer]), bytes); + + pointer = rpos; + + return bytes; +} + +void MPQFile::seek(int offset) +{ + pointer = offset; + eof = (pointer >= size); +} + +void MPQFile::seekRelative(int offset) +{ + pointer += offset; + eof = (pointer >= size); +} + +void MPQFile::close() +{ + if (buffer) delete[] buffer; + buffer = 0; + eof = true; +} diff --git a/src/tools/vmap4_extractor/mpqfile.h b/src/tools/vmap4_extractor/mpqfile.h new file mode 100644 index 00000000000..115d096a215 --- /dev/null +++ b/src/tools/vmap4_extractor/mpqfile.h @@ -0,0 +1,80 @@ +#define _CRT_SECURE_NO_DEPRECATE +#ifndef _CRT_SECURE_NO_WARNINGS // fuck the police^Wwarnings +#define _CRT_SECURE_NO_WARNINGS +#endif + +#ifndef MPQ_H +#define MPQ_H + +#include +#include +#include +#include +#include + +#ifdef _WIN32 +#include // mainly only HANDLE definition is required +typedef __int64 int64; +typedef __int32 int32; +typedef __int16 int16; +typedef __int8 int8; +typedef unsigned __int64 uint64; +typedef unsigned __int32 uint32; +typedef unsigned __int16 uint16; +typedef unsigned __int8 uint8; +#else +#include +#ifndef uint64_t +#ifdef __linux__ +#include +#endif +#endif +typedef int64_t int64; +typedef int32_t int32; +typedef int16_t int16; +typedef int8_t int8; +typedef uint64_t uint64; +typedef uint32_t uint32; +typedef uint16_t uint16; +typedef uint8_t uint8; +#endif + +using namespace std; + +class MPQFile +{ + //MPQHANDLE handle; + bool eof; + char *buffer; + size_t pointer,size; + + // disable copying + MPQFile(const MPQFile &f); + void operator=(const MPQFile &f); + +public: + MPQFile(HANDLE mpq, const char* filename); // filenames are not case sensitive + ~MPQFile() { close(); } + size_t read(void* dest, size_t bytes); + size_t getSize() { return size; } + size_t getPos() { return pointer; } + char* getBuffer() { return buffer; } + char* getPointer() { return buffer + pointer; } + bool isEof() { return eof; } + void seek(int offset); + void seekRelative(int offset); + void close(); +}; + +inline void flipcc(char *fcc) +{ + char t; + t=fcc[0]; + fcc[0]=fcc[3]; + fcc[3]=t; + t=fcc[1]; + fcc[1]=fcc[2]; + fcc[2]=t; +} + +#endif diff --git a/src/tools/vmap4_extractor/vmapexport.cpp b/src/tools/vmap4_extractor/vmapexport.cpp index e60a773c6de..a1fd4e8321a 100644 --- a/src/tools/vmap4_extractor/vmapexport.cpp +++ b/src/tools/vmap4_extractor/vmapexport.cpp @@ -45,7 +45,7 @@ #include "wdtfile.h" #include "dbcfile.h" #include "wmo.h" -#include "mpq_libmpq04.h" +#include "mpqfile.h" #include "vmapexport.h" @@ -56,7 +56,37 @@ //----------------------------------------------------------------------------- -extern ArchiveSet gOpenArchives; +HANDLE WorldMpq = NULL; +HANDLE LocaleMpq = NULL; + +uint32 CONF_TargetBuild = 15595; // 4.3.4.15595 + +// List MPQ for extract maps from +char const* CONF_mpq_list[]= +{ + "world.MPQ", + "art.MPQ", + "expansion1.MPQ", + "expansion2.MPQ", + "expansion3.MPQ", + "world2.MPQ", +}; + +uint32 const Builds[] = {13164, 13205, 13287, 13329, 13596, 13623, 13914, 14007, 14333, 14480, 14545, 15005, 15050, 15211, 15354, 15595, 0}; +#define LAST_DBC_IN_DATA_BUILD 13623 // after this build mpqs with dbc are back to locale folder + +char* const Locales[] = {"enGB", "enUS", "deDE", "esES", "frFR", "koKR", "zhCN", "zhTW", "enCN", "enTW", "esMX", "ruRU"}; +TCHAR* const LocalesT[] = +{ + _T("enGB"), _T("enUS"), + _T("deDE"), _T("esES"), + _T("frFR"), _T("koKR"), + _T("zhCN"), _T("zhTW"), + _T("enCN"), _T("enTW"), + _T("esMX"), _T("ruRU"), +}; + +#define LOCALES_COUNT 12 typedef struct { @@ -69,7 +99,6 @@ uint16 *LiqType = 0; uint32 map_count; char output_path[128]="."; char input_path[1024]="."; -bool hasInputPathParam = false; bool preciseVectorData = false; // Constants @@ -78,6 +107,148 @@ bool preciseVectorData = false; const char* szWorkDirWmo = "./Buildings"; const char* szRawVMAPMagic = "VMAP041"; +bool LoadLocaleMPQFile(int locale) +{ + TCHAR buff[512]; + memset(buff, 0, sizeof(buff)); + _stprintf(buff, _T("%s%s/locale-%s.MPQ"), input_path, LocalesT[locale], LocalesT[locale]); + if (!SFileOpenArchive(buff, 0, MPQ_OPEN_READ_ONLY, &LocaleMpq)) + { + if (GetLastError() != ERROR_PATH_NOT_FOUND) + _tprintf(_T("Cannot open archive %s\n"), buff); + return false; + } + + char const* prefix = NULL; + for (int i = 0; Builds[i] && Builds[i] <= CONF_TargetBuild; ++i) + { + memset(buff, 0, sizeof(buff)); + if (Builds[i] > LAST_DBC_IN_DATA_BUILD) + { + prefix = ""; + _stprintf(buff, _T("%s%s/wow-update-%s-%u.MPQ"), input_path, LocalesT[locale], LocalesT[locale], Builds[i]); + } + else + { + prefix = Locales[locale]; + _stprintf(buff, _T("%swow-update-%u.MPQ"), input_path, Builds[i]); + } + + if (!SFileOpenPatchArchive(LocaleMpq, buff, prefix, 0)) + { + if (GetLastError() != ERROR_FILE_NOT_FOUND) + _tprintf(_T("Cannot open patch archive %s\n"), buff); + continue; + } + } + + return true; +} + +void LoadCommonMPQFiles(uint32 build) +{ + TCHAR filename[512]; + _stprintf(filename, _T("%sworld.MPQ"), input_path); + if (!SFileOpenArchive(filename, 0, MPQ_OPEN_READ_ONLY, &WorldMpq)) + { + if (GetLastError() != ERROR_PATH_NOT_FOUND) + _tprintf(_T("Cannot open archive %s\n"), filename); + return; + } + + int count = sizeof(CONF_mpq_list) / sizeof(char*); + for (int i = 1; i < count; ++i) + { + if (build < 15211 && !strcmp("world2.MPQ", CONF_mpq_list[i])) // 4.3.2 and higher MPQ + continue; + + _stprintf(filename, _T("%s%s"), input_path, CONF_mpq_list[i]); + if (!SFileOpenPatchArchive(WorldMpq, filename, "", 0)) + { + if (GetLastError() != ERROR_PATH_NOT_FOUND) + _tprintf(_T("Cannot open archive %s\n"), filename); + else + _tprintf(_T("Not found %s\n"), filename); + } + else + { + _tprintf(_T("Loaded %s\n"), filename); + + bool found = false; + int count = 0; + SFILE_FIND_DATA data; + HANDLE find = SFileFindFirstFile(WorldMpq, "*.*", &data, NULL); + if (find != NULL) + { + do + { + ++count; + if (data.dwFileFlags & MPQ_FILE_PATCH_FILE) + { + found = true; + break; + } + } + while (SFileFindNextFile(find, &data)); + } + SFileFindClose(find); + printf("Scanned %d files, found patch = %d\n", count, found); + } + } + + char const* prefix = NULL; + for (int i = 0; Builds[i] && Builds[i] <= CONF_TargetBuild; ++i) + { + memset(filename, 0, sizeof(filename)); + if (Builds[i] > LAST_DBC_IN_DATA_BUILD) + { + prefix = ""; + _stprintf(filename, _T("%swow-update-base-%u.MPQ"), input_path, Builds[i]); + } + else + { + prefix = "base"; + _stprintf(filename, _T("%swow-update-%u.MPQ"), input_path, Builds[i]); + } + + if (!SFileOpenPatchArchive(WorldMpq, filename, prefix, 0)) + { + if (GetLastError() != ERROR_PATH_NOT_FOUND) + _tprintf(_T("Cannot open patch archive %s\n"), filename); + else + _tprintf(_T("Not found %s\n"), filename); + continue; + } + else + { + _tprintf(_T("Loaded %s\n"), filename); + + + bool found = false; + int count = 0; + SFILE_FIND_DATA data; + HANDLE find = SFileFindFirstFile(WorldMpq, "*.*", &data, NULL); + if (find != NULL) + { + do + { + ++count; + if (data.dwFileFlags & MPQ_FILE_PATCH_FILE) + { + found = true; + break; + } + } + while (SFileFindNextFile(find, &data)); + } + SFileFindClose(find); + printf("Scanned %d files, found patch = %d\n", count, found); + } + } + +} + + // Local testing functions bool FileExists(const char* file) @@ -103,7 +274,8 @@ void strToLower(char* str) void ReadLiquidTypeTableDBC() { printf("Read LiquidType.dbc file..."); - DBCFile dbc("DBFilesClient\\LiquidType.dbc"); + + DBCFile dbc(LocaleMpq, "DBFilesClient\\LiquidType.dbc"); if(!dbc.open()) { printf("Fatal error: Invalid LiquidType.dbc file format!\n"); @@ -123,21 +295,23 @@ void ReadLiquidTypeTableDBC() bool ExtractWmo() { - bool success = true; + bool success = false; //const char* ParsArchiveNames[] = {"patch-2.MPQ", "patch.MPQ", "common.MPQ", "expansion.MPQ"}; - for (ArchiveSet::const_iterator ar_itr = gOpenArchives.begin(); ar_itr != gOpenArchives.end() && success; ++ar_itr) + SFILE_FIND_DATA data; + HANDLE find = SFileFindFirstFile(WorldMpq, "*.wmo", &data, NULL); + if (find != NULL) { - vector filelist; - - (*ar_itr)->GetFileListTo(filelist); - for (vector::iterator fname = filelist.begin(); fname != filelist.end() && success; ++fname) + do { - if (fname->find(".wmo") != string::npos) - success = ExtractSingleWmo(*fname); + std::string str = data.cFileName; + //printf("Extracting wmo %s\n", str.c_str()); + success |= ExtractSingleWmo(str); } + while (SFileFindNextFile(find, &data)); } + SFileFindClose(find); if (success) printf("\nExtract wmo complete (No (fatal) errors)\n"); @@ -297,91 +471,10 @@ bool scan_patches(char* scanmatch, std::vector& pArchiveNames) return(true); } -bool fillArchiveNameVector(std::vector& pArchiveNames) -{ - if(!hasInputPathParam) - getGamePath(); - - printf("\nGame path: %s\n", input_path); - - char path[512]; - string in_path(input_path); - std::vector locales, searchLocales; - - searchLocales.push_back("enGB"); - searchLocales.push_back("enUS"); - searchLocales.push_back("deDE"); - searchLocales.push_back("esES"); - searchLocales.push_back("frFR"); - searchLocales.push_back("koKR"); - searchLocales.push_back("zhCN"); - searchLocales.push_back("zhTW"); - searchLocales.push_back("enCN"); - searchLocales.push_back("enTW"); - searchLocales.push_back("esMX"); - searchLocales.push_back("ruRU"); - - for (std::vector::iterator i = searchLocales.begin(); i != searchLocales.end(); ++i) - { - std::string localePath = in_path + *i; - // check if locale exists: - struct stat status; - if (stat(localePath.c_str(), &status)) - continue; - if ((status.st_mode & S_IFDIR) == 0) - continue; - printf("Found locale '%s'\n", i->c_str()); - locales.push_back(*i); - } - printf("\n"); - - // open locale expansion and common files - printf("Adding data files from locale directories.\n"); - for (std::vector::iterator i = locales.begin(); i != locales.end(); ++i) - { - pArchiveNames.push_back(in_path + *i + "/locale-" + *i + ".MPQ"); - pArchiveNames.push_back(in_path + *i + "/expansion-locale-" + *i + ".MPQ"); - pArchiveNames.push_back(in_path + *i + "/lichking-locale-" + *i + ".MPQ"); - } - - // open expansion and common files - pArchiveNames.push_back(input_path + string("common.MPQ")); - pArchiveNames.push_back(input_path + string("common-2.MPQ")); - pArchiveNames.push_back(input_path + string("expansion.MPQ")); - pArchiveNames.push_back(input_path + string("lichking.MPQ")); - - // now, scan for the patch levels in the core dir - printf("Scanning patch levels from data directory.\n"); - sprintf(path, "%spatch", input_path); - if (!scan_patches(path, pArchiveNames)) - return(false); - - // now, scan for the patch levels in locale dirs - printf("Scanning patch levels from locale directories.\n"); - bool foundOne = false; - for (std::vector::iterator i = locales.begin(); i != locales.end(); ++i) - { - printf("Locale: %s\n", i->c_str()); - sprintf(path, "%s%s/patch-%s", input_path, i->c_str(), i->c_str()); - if(scan_patches(path, pArchiveNames)) - foundOne = true; - } - - printf("\n"); - - if(!foundOne) - { - printf("no locale found\n"); - return false; - } - - return true; -} - bool processArgv(int argc, char ** argv, const char *versionString) { bool result = true; - hasInputPathParam = false; + bool hasInputPathParam = false; bool preciseVectorData = false; for(int i=1; i< argc; ++i) @@ -413,6 +506,11 @@ bool processArgv(int argc, char ** argv, const char *versionString) { preciseVectorData = true; } + else if(strcmp("-b",argv[i]) == 0) + { + if (i + 1 < argc) // all ok + CONF_TargetBuild = atoi(argv[i++ + 1]); + } else { result = false; @@ -428,6 +526,10 @@ bool processArgv(int argc, char ** argv, const char *versionString) printf(" -d : Path to the vector data source folder.\n"); printf(" -? : This message.\n"); } + + if(!hasInputPathParam) + getGamePath(); + return result; } @@ -443,6 +545,7 @@ bool processArgv(int argc, char ** argv, const char *versionString) int main(int argc, char ** argv) { + getc(stdin); bool success=true; const char *versionString = "V4.00 2012_02"; @@ -476,21 +579,24 @@ int main(int argc, char ** argv) )) success = (errno == EEXIST); - // prepare archive name list - std::vector archiveNames; - fillArchiveNameVector(archiveNames); - for (size_t i=0; i < archiveNames.size(); ++i) - { - MPQArchive *archive = new MPQArchive(archiveNames[i].c_str()); - if(!gOpenArchives.size() || gOpenArchives.front() != archive) - delete archive; - } + LoadCommonMPQFiles(CONF_TargetBuild); + + int FirstLocale = -1; - if(gOpenArchives.empty()) + for (int i = 0; i < LOCALES_COUNT; ++i) { - printf("FATAL ERROR: None MPQ archive found by path '%s'. Use -d option with proper path.\n",input_path); - return 1; + //Open MPQs + if (!LoadLocaleMPQFile(i)) + { + if (GetLastError() != ERROR_PATH_NOT_FOUND) + printf("Unable to load %s locale archives!\n", Locales[i]); + continue; + } + + printf("Detected and using locale locale: %s\n", Locales[i]); + break; } + ReadLiquidTypeTableDBC(); // extract data @@ -501,7 +607,7 @@ int main(int argc, char ** argv) //map.dbc if(success) { - DBCFile * dbc = new DBCFile("DBFilesClient\\Map.dbc"); + DBCFile * dbc = new DBCFile(LocaleMpq, "DBFilesClient\\Map.dbc"); if(!dbc->open()) { delete dbc; @@ -526,6 +632,9 @@ int main(int argc, char ** argv) ExtractGameobjectModels(); } + SFileCloseArchive(LocaleMpq); + SFileCloseArchive(WorldMpq); + printf("\n"); if(!success) { diff --git a/src/tools/vmap4_extractor/wdtfile.cpp b/src/tools/vmap4_extractor/wdtfile.cpp index e3ee545db19..2dd7396ae7d 100644 --- a/src/tools/vmap4_extractor/wdtfile.cpp +++ b/src/tools/vmap4_extractor/wdtfile.cpp @@ -30,7 +30,9 @@ char * wdtGetPlainName(char * FileName) return FileName; } -WDTFile::WDTFile(char* file_name, char* file_name1):WDT(file_name) +extern HANDLE WorldMpq; + +WDTFile::WDTFile(char* file_name, char* file_name1):WDT(WorldMpq, file_name) { filename.append(file_name1,strlen(file_name1)); } @@ -129,6 +131,6 @@ ADTFile* WDTFile::GetMap(int x, int z) char name[512]; - sprintf(name,"World\\Maps\\%s\\%s_%d_%d.adt", filename.c_str(), filename.c_str(), x, z); + sprintf(name,"World\\Maps\\%s\\%s_%d_%d_obj0.adt", filename.c_str(), filename.c_str(), x, z); return new ADTFile(name); } diff --git a/src/tools/vmap4_extractor/wdtfile.h b/src/tools/vmap4_extractor/wdtfile.h index f3d71c41791..ef3ec6db98c 100644 --- a/src/tools/vmap4_extractor/wdtfile.h +++ b/src/tools/vmap4_extractor/wdtfile.h @@ -1,7 +1,7 @@ #ifndef WDTFILE_H #define WDTFILE_H -#include "mpq_libmpq04.h" +#include "mpqfile.h" #include "wmo.h" #include #include "stdlib.h" diff --git a/src/tools/vmap4_extractor/wmo.cpp b/src/tools/vmap4_extractor/wmo.cpp index 6703872111b..8bba5610c88 100644 --- a/src/tools/vmap4_extractor/wmo.cpp +++ b/src/tools/vmap4_extractor/wmo.cpp @@ -26,7 +26,7 @@ #include #undef min #undef max -#include "mpq_libmpq04.h" +#include "mpqfile.h" using namespace std; extern uint16 *LiqType; @@ -35,9 +35,11 @@ WMORoot::WMORoot(std::string &filename) : filename(filename) { } +extern HANDLE WorldMpq; + bool WMORoot::open() { - MPQFile f(filename.c_str()); + MPQFile f(WorldMpq, filename.c_str()); if(f.isEof ()) { printf("No such file.\n"); @@ -143,7 +145,7 @@ WMOGroup::WMOGroup(std::string &filename) : filename(filename), bool WMOGroup::open() { - MPQFile f(filename.c_str()); + MPQFile f(WorldMpq, filename.c_str()); if(f.isEof ()) { printf("No such file.\n"); diff --git a/src/tools/vmap4_extractor/wmo.h b/src/tools/vmap4_extractor/wmo.h index 8c5993d91d5..7020bb90f12 100644 --- a/src/tools/vmap4_extractor/wmo.h +++ b/src/tools/vmap4_extractor/wmo.h @@ -24,6 +24,7 @@ #include #include #include "vec3d.h" +#include "mpqfile.h" // MOPY flags #define WMO_MATERIAL_NOCAMCOLLIDE 0x01 -- cgit v1.2.3 From 7bd0540ca436a5ca8d882a2c202e91c51e7b3a21 Mon Sep 17 00:00:00 2001 From: LordJZ Date: Tue, 5 Jun 2012 15:24:15 +0400 Subject: Load art.MPQ in mapextractor --- src/tools/map_extractor/System.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp index e9577d0f108..c8d5c105af3 100644 --- a/src/tools/map_extractor/System.cpp +++ b/src/tools/map_extractor/System.cpp @@ -79,6 +79,7 @@ uint32 CONF_TargetBuild = 14545; // 4.2.2.14545 char const* CONF_mpq_list[]= { "world.MPQ", + "art.MPQ", "world2.MPQ", "expansion1.MPQ", "expansion2.MPQ", -- cgit v1.2.3 From ee06bef31b943fba45d8b018df151f3400e07242 Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 4 Jul 2012 14:04:12 +0200 Subject: Core/DBC: 4.3.4 structure updates --- ...2012_07_03_00_world_item_template_addon_434.sql | 1 + src/server/game/DataStores/DB2Structure.h | 4 +- src/server/game/DataStores/DB2fmt.h | 4 +- src/server/game/DataStores/DBCStructure.h | 36 +++---- src/server/game/DataStores/DBCfmt.h | 8 +- src/server/game/Globals/ObjectMgr.cpp | 104 +++++++++++++++++++-- 6 files changed, 124 insertions(+), 33 deletions(-) create mode 100644 sql/updates/world/2012_07_03_00_world_item_template_addon_434.sql (limited to 'src') diff --git a/sql/updates/world/2012_07_03_00_world_item_template_addon_434.sql b/sql/updates/world/2012_07_03_00_world_item_template_addon_434.sql new file mode 100644 index 00000000000..6cc5b547867 --- /dev/null +++ b/sql/updates/world/2012_07_03_00_world_item_template_addon_434.sql @@ -0,0 +1 @@ +ALTER TABLE `item_template_addon` DROP `BuyCount`; diff --git a/src/server/game/DataStores/DB2Structure.h b/src/server/game/DataStores/DB2Structure.h index e4632e835d8..7f6eee0206c 100644 --- a/src/server/game/DataStores/DB2Structure.h +++ b/src/server/game/DataStores/DB2Structure.h @@ -62,6 +62,9 @@ struct ItemSparseEntry uint32 Quality; // 1 uint32 Flags; // 2 uint32 Flags2; // 3 + float Unk430_1; + float Unk430_2; + uint32 BuyCount; uint32 BuyPrice; // 4 uint32 SellPrice; // 5 uint32 InventoryType; // 6 @@ -109,7 +112,6 @@ struct ItemSparseEntry uint32 RandomProperty; // 108 uint32 RandomSuffix; // 109 uint32 ItemSet; // 110 - uint32 MaxDurability; // 111 uint32 Area; // 112 uint32 Map; // 113 uint32 BagFamily; // 114 diff --git a/src/server/game/DataStores/DB2fmt.h b/src/server/game/DataStores/DB2fmt.h index ed48443d543..3cc3a9b7693 100644 --- a/src/server/game/DataStores/DB2fmt.h +++ b/src/server/game/DataStores/DB2fmt.h @@ -20,7 +20,7 @@ const char Itemfmt[]="niiiiiii"; const char ItemCurrencyCostfmt[]="xn"; -const char ItemSparsefmt[]="niiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiifiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiisssssiiiiiiiiiiiiiiiiiiiiiiifiiifii"; +const char ItemSparsefmt[]="niiiffiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiifiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiisssssiiiiiiiiiiiiiiiiiiiiiifiiifii"; const char ItemExtendedCostEntryfmt[]="nxxiiiiiiiiiiiixiiiiiiiiiixxxxx"; -#endif \ No newline at end of file +#endif diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 54e961eaf84..1bf09ea4036 100755 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -1269,21 +1269,21 @@ struct LFGDungeonEntry { uint32 ID; // 0 //char* name[16]; // 1-17 Name lang - uint32 minlevel; // 18 - uint32 maxlevel; // 19 - uint32 reclevel; // 20 - uint32 recminlevel; // 21 - uint32 recmaxlevel; // 22 - int32 map; // 23 - uint32 difficulty; // 24 - //uint32 unk; // 25 - uint32 type; // 26 - //uint32 unk2; // 27 - //char* unk3; // 28 - uint32 expansion; // 29 - //uint32 unk4; // 30 - uint32 grouptype; // 31 - //char* desc; // 32 Description + uint32 minlevel; // 2 + uint32 maxlevel; // 3 + uint32 reclevel; // 4 + uint32 recminlevel; // 5 + uint32 recmaxlevel; // 6 + int32 map; // 7 + uint32 difficulty; // 8 + //uint32 unk; // 9 + uint32 type; // 10 + //uint32 unk2; // 11 + //char* unk3; // 12 + uint32 expansion; // 13 + //uint32 unk4; // 14 + uint32 grouptype; // 15 + //char* desc; // 16 Description // Helpers uint32 Entry() const { return ID + (type << 24); } }; @@ -1850,7 +1850,8 @@ struct SpellPowerEntry uint32 ManaCostPercentage; // 3 m_manaCostPct uint32 manaPerSecond; // 4 m_manaPerSecond //uint32 PowerDisplayId; // 5 m_powerDisplayID - id from PowerDisplay.dbc, new in 3.1 - //uint32 unk1; // 6 4.0.0 + //uint32 unk1; // 6 4.0.0 + //float unk2; // 7 4.3.0 }; struct SpellRuneCostEntry @@ -2216,6 +2217,9 @@ struct WorldMapAreaEntry int32 virtual_map_id; // 8 -1 (map_id have correct map) other: virtual map where zone show (map_id - where zone in fact internally) // int32 dungeonMap_id; // 9 pointer to DungeonMap.dbc (owerride x1, x2, y1, y2 coordinates) // uint32 parentMapID; // 10 + + // uint32 minRecommendedLevel; // 12 Minimum recommended level displayed on world map + // uint32 maxRecommendedLevel; // 13 Maximum recommended level displayed on world map }; #define MAX_WORLD_MAP_OVERLAY_AREA_IDX 4 diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index 50af8928e6b..5ed2568e0d0 100755 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -87,7 +87,7 @@ const char ItemLimitCategoryEntryfmt[]="nxii"; const char ItemRandomPropertiesfmt[]="nxiiixxs"; const char ItemRandomSuffixfmt[]="nsxiiiiiiiiii"; const char ItemSetEntryfmt[]="dsiiiiiiiiiixxxxxxxiiiiiiiiiiiiiiiiii"; -const char LFGDungeonEntryfmt[]="nxiiiiiiixixxixixx"; +const char LFGDungeonEntryfmt[]="nxiiiiiiixixxixixxxxx"; const char LiquidTypefmt[]="nxxixixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; const char LockEntryfmt[]="niiiiiiiiiiiiiiiiiiiiiiiixxxxxxxx"; const char PhaseEntryfmt[]="nsi"; @@ -109,7 +109,7 @@ const char ScalingStatDistributionfmt[]="niiiiiiiiiiiiiiiiiiiixi"; const char ScalingStatValuesfmt[]="iniiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii"; const char SkillLinefmt[]="nisxixi"; const char SkillLineAbilityfmt[]="niiiixxiiiiixx"; -const char SoundEntriesfmt[]="nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; +const char SoundEntriesfmt[]="nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; const char SpellCastTimefmt[]="nixx"; const char SpellCategoriesEntryfmt[]="diiiiii"; const char SpellDifficultyfmt[]="niiii"; @@ -129,7 +129,7 @@ const char SpellReagentsEntryfmt[]="diiiiiiiiiiiiiiii"; const char SpellScalingEntryfmt[]="diiiiffffffffffi"; const char SpellTotemsEntryfmt[]="niiii"; const char SpellTargetRestrictionsEntryfmt[]="nxiiii"; -const char SpellPowerEntryfmt[]="diiiixx"; +const char SpellPowerEntryfmt[]="diiiixxx"; const char SpellInterruptsEntryfmt[]="dixixi"; const char SpellEquippedItemsEntryfmt[]="diii"; const char SpellAuraOptionsEntryfmt[]="niiii"; @@ -154,7 +154,7 @@ const char TotemCategoryEntryfmt[]="nxii"; const char VehicleEntryfmt[]="niffffiiiiiiiifffffffffffffffssssfifiixx"; const char VehicleSeatEntryfmt[]="niiffffffffffiiiiiifffffffiiifffiiiiiiiffiiiiixxxxxxxxxxxxxxxxxxxx"; const char WMOAreaTableEntryfmt[]="niiixxxxxiixxxx"; -const char WorldMapAreaEntryfmt[]="xinxffffixxx"; +const char WorldMapAreaEntryfmt[]="xinxffffixxxxx"; const char WorldMapOverlayEntryfmt[]="nxiiiixxxxxxxxx"; const char WorldSafeLocsEntryfmt[]="nifffx"; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index a14a49d2069..806d7bd5acd 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -2191,6 +2191,89 @@ uint32 FillItemArmor(uint32 itemlevel, uint32 itemClass, uint32 itemSubclass, ui return uint32(shield->Value[quality] + 0.5f); } +uint32 FillMaxDurability(uint32 itemClass, uint32 itemSubClass, uint32 inventoryType, uint32 quality, uint32 itemLevel) +{ + if (itemClass != ITEM_CLASS_ARMOR && itemClass != ITEM_CLASS_WEAPON) + return 0; + + static float const qualityMultipliers[MAX_ITEM_QUALITY] = + { + 1.0f, 1.0f, 1.0f, 1.17f, 1.37f, 1.68f, 0.0f, 0.0f + }; + + static float const armorMultipliers[MAX_INVTYPE] = + { + 0.00f, // INVTYPE_NON_EQUIP + 0.59f, // INVTYPE_HEAD + 0.00f, // INVTYPE_NECK + 0.59f, // INVTYPE_SHOULDERS + 0.00f, // INVTYPE_BODY + 1.00f, // INVTYPE_CHEST + 0.35f, // INVTYPE_WAIST + 0.75f, // INVTYPE_LEGS + 0.49f, // INVTYPE_FEET + 0.35f, // INVTYPE_WRISTS + 0.35f, // INVTYPE_HANDS + 0.00f, // INVTYPE_FINGER + 0.00f, // INVTYPE_TRINKET + 0.00f, // INVTYPE_WEAPON + 1.00f, // INVTYPE_SHIELD + 0.00f, // INVTYPE_RANGED + 0.00f, // INVTYPE_CLOAK + 0.00f, // INVTYPE_2HWEAPON + 0.00f, // INVTYPE_BAG + 0.00f, // INVTYPE_TABARD + 1.00f, // INVTYPE_ROBE + 0.00f, // INVTYPE_WEAPONMAINHAND + 0.00f, // INVTYPE_WEAPONOFFHAND + 0.00f, // INVTYPE_HOLDABLE + 0.00f, // INVTYPE_AMMO + 0.00f, // INVTYPE_THROWN + 0.00f, // INVTYPE_RANGEDRIGHT + 0.00f, // INVTYPE_QUIVER + 0.00f, // INVTYPE_RELIC + }; + + static float const weaponMultipliers[MAX_ITEM_SUBCLASS_WEAPON] = + { + 0.89f, // ITEM_SUBCLASS_WEAPON_AXE + 1.03f, // ITEM_SUBCLASS_WEAPON_AXE2 + 0.77f, // ITEM_SUBCLASS_WEAPON_BOW + 0.77f, // ITEM_SUBCLASS_WEAPON_GUN + 0.89f, // ITEM_SUBCLASS_WEAPON_MACE + 1.03f, // ITEM_SUBCLASS_WEAPON_MACE2 + 1.03f, // ITEM_SUBCLASS_WEAPON_POLEARM + 0.89f, // ITEM_SUBCLASS_WEAPON_SWORD + 1.03f, // ITEM_SUBCLASS_WEAPON_SWORD2 + 0.00f, // ITEM_SUBCLASS_WEAPON_Obsolete + 1.03f, // ITEM_SUBCLASS_WEAPON_STAFF + 0.00f, // ITEM_SUBCLASS_WEAPON_EXOTIC + 0.00f, // ITEM_SUBCLASS_WEAPON_EXOTIC2 + 0.64f, // ITEM_SUBCLASS_WEAPON_FIST_WEAPON + 0.00f, // ITEM_SUBCLASS_WEAPON_MISCELLANEOUS + 0.64f, // ITEM_SUBCLASS_WEAPON_DAGGER + 0.64f, // ITEM_SUBCLASS_WEAPON_THROWN + 0.00f, // ITEM_SUBCLASS_WEAPON_SPEAR + 0.77f, // ITEM_SUBCLASS_WEAPON_CROSSBOW + 0.64f, // ITEM_SUBCLASS_WEAPON_WAND + 0.64f, // ITEM_SUBCLASS_WEAPON_FISHING_POLE + }; + + float levelPenalty = 1.0f; + if (itemLevel <= 28) + levelPenalty = 0.966f - float(28u - itemLevel) * 1.0f / 54.0f; + + if (itemClass == ITEM_CLASS_ARMOR) + { + if (inventoryType > INVTYPE_ROBE) + return 0; + + return 5 * uint32(23.0f * qualityMultipliers[quality] * armorMultipliers[inventoryType] * levelPenalty + 0.5f); + } + + return 5 * uint32(17.0f * qualityMultipliers[quality] * weaponMultipliers[itemSubClass] * levelPenalty + 0.5f); +}; + void FillDisenchantFields(uint32* disenchantID, uint32* requiredDisenchantSkill, ItemTemplate const& itemTemplate) { *disenchantID = 0; @@ -2255,7 +2338,7 @@ void ObjectMgr::LoadItemTemplates() itemTemplate.Quality = sparse->Quality; itemTemplate.Flags = sparse->Flags; itemTemplate.Flags2 = sparse->Flags2; - itemTemplate.BuyCount = 1; + itemTemplate.BuyCount = std::max(sparse->BuyCount, 1u); itemTemplate.BuyPrice = sparse->BuyPrice; itemTemplate.SellPrice = sparse->SellPrice; itemTemplate.InventoryType = db2Data->InventoryType; @@ -2315,7 +2398,7 @@ void ObjectMgr::LoadItemTemplates() itemTemplate.RandomProperty = sparse->RandomProperty; itemTemplate.RandomSuffix = sparse->RandomSuffix; itemTemplate.ItemSet = sparse->ItemSet; - itemTemplate.MaxDurability = sparse->MaxDurability; + itemTemplate.MaxDurability = FillMaxDurability(db2Data->Class, db2Data->SubClass, sparse->Quality, sparse->InventoryType, sparse->ItemLevel); itemTemplate.Area = sparse->Area; itemTemplate.Map = sparse->Map; itemTemplate.BagFamily = sparse->BagFamily; @@ -2463,7 +2546,9 @@ void ObjectMgr::LoadItemTemplates() itemTemplate.RandomProperty = fields[109].GetInt32(); itemTemplate.RandomSuffix = fields[110].GetInt32(); itemTemplate.ItemSet = fields[111].GetUInt32(); - itemTemplate.MaxDurability = fields[112].GetUInt32(); + itemTemplate.MaxDurability = FillMaxDurability(itemTemplate.Class, itemTemplate.SubClass, + itemTemplate.Quality, itemTemplate.InventoryType, itemTemplate.ItemLevel); + itemTemplate.Area = fields[113].GetUInt32(); itemTemplate.Map = fields[114].GetUInt32(); itemTemplate.BagFamily = fields[115].GetUInt32(); @@ -2525,7 +2610,7 @@ void ObjectMgr::LoadItemTemplateAddon() uint32 oldMSTime = getMSTime(); uint32 count = 0; - QueryResult result = WorldDatabase.Query("SELECT Id, BuyCount, FoodType, MinMoneyLoot, MaxMoneyLoot, SpellPPMChance FROM item_template_addon"); + QueryResult result = WorldDatabase.Query("SELECT Id, FoodType, MinMoneyLoot, MaxMoneyLoot, SpellPPMChance FROM item_template_addon"); if (result) { do @@ -2545,9 +2630,9 @@ void ObjectMgr::LoadItemTemplateAddon() buyCount = 1; } - uint8 foodType = fields[2].GetUInt8(); - uint32 minMoneyLoot = fields[3].GetUInt32(); - uint32 maxMoneyLoot = fields[4].GetUInt32(); + uint8 foodType = fields[1].GetUInt8(); + uint32 minMoneyLoot = fields[2].GetUInt32(); + uint32 maxMoneyLoot = fields[3].GetUInt32(); if (minMoneyLoot > maxMoneyLoot) { sLog->outErrorDb("Minimum money loot specified in `item_template_addon` for item %u was greater than maximum amount, swapping.", itemId); @@ -2555,11 +2640,10 @@ void ObjectMgr::LoadItemTemplateAddon() } ItemTemplate& itemTemplate = _itemTemplateStore[itemId]; - itemTemplate.BuyCount = buyCount; itemTemplate.FoodType = foodType; itemTemplate.MinMoneyLoot = minMoneyLoot; itemTemplate.MaxMoneyLoot = maxMoneyLoot; - itemTemplate.SpellPPMRate = fields[5].GetFloat(); + itemTemplate.SpellPPMRate = fields[4].GetFloat(); ++count; } while (result->NextRow()); } @@ -2650,7 +2734,7 @@ void ObjectMgr::LoadItemSetNames() if (setEntry->itemId[i]) itemSetItems.insert(setEntry->itemId[i]); } - + // 0 1 2 QueryResult result = WorldDatabase.Query("SELECT `entry`, `name`, `InventoryType` FROM `item_set_names`"); -- cgit v1.2.3 From a6a556ce09facff3918a33be6b976e5ccb7e1469 Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 4 Jul 2012 18:12:29 +0200 Subject: Core: Minor startup error fixes (db structure) --- src/server/game/Battlegrounds/BattlegroundMgr.cpp | 6 +- src/server/game/Globals/ObjectMgr.cpp | 137 +++++++++++----------- src/server/game/Quests/QuestDef.cpp | 12 +- 3 files changed, 79 insertions(+), 76 deletions(-) (limited to 'src') diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index eae84c9c7b3..b7079fb00e0 100755 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -771,9 +771,9 @@ void BattlegroundMgr::CreateInitialBattlegrounds() continue; } - selectionWeight = fields[9].GetUInt8(); - // data.StartMaxDist = fields[9].GetFloat(); ? - data.scriptId = sObjectMgr->GetScriptId(fields[10].GetCString()); + selectionWeight = fields[10].GetUInt8(); + data.StartMaxDist = fields[9].GetFloat(); + data.scriptId = sObjectMgr->GetScriptId(fields[11].GetCString()); //data.BattlegroundName = bl->name[sWorld->GetDefaultDbcLocale()]; data.MapID = bl->mapid[0]; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 806d7bd5acd..43381267545 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -2477,39 +2477,39 @@ void ObjectMgr::LoadItemTemplates() ItemTemplate& itemTemplate = _itemTemplateStore[itemId]; - itemTemplate.ItemId = itemId; - itemTemplate.Class = fields[1].GetUInt32(); - itemTemplate.SubClass = fields[2].GetUInt32(); - itemTemplate.Unk0 = fields[3].GetInt32(); - itemTemplate.Name1 = fields[4].GetString(); - itemTemplate.DisplayInfoID = fields[5].GetUInt32(); - itemTemplate.Quality = fields[6].GetUInt32(); - itemTemplate.Flags = fields[7].GetUInt32(); - itemTemplate.Flags2 = fields[8].GetUInt32(); - itemTemplate.BuyCount = 1; - itemTemplate.BuyPrice = fields[9].GetInt32(); - itemTemplate.SellPrice = fields[10].GetUInt32(); - itemTemplate.InventoryType = fields[11].GetUInt32(); - itemTemplate.AllowableClass = fields[12].GetUInt32(); - itemTemplate.AllowableRace = fields[13].GetUInt32(); - itemTemplate.ItemLevel = fields[14].GetUInt32(); - itemTemplate.RequiredLevel = fields[15].GetUInt32(); - itemTemplate.RequiredSkill = fields[16].GetUInt32(); - itemTemplate.RequiredSkillRank = fields[17].GetUInt32(); - itemTemplate.RequiredSpell = fields[18].GetUInt32(); - itemTemplate.RequiredHonorRank = fields[19].GetUInt32(); - itemTemplate.RequiredCityRank = fields[20].GetUInt32(); + itemTemplate.ItemId = itemId; + itemTemplate.Class = uint32(fields[1].GetUInt8()); + itemTemplate.SubClass = uint32(fields[2].GetUInt8()); + itemTemplate.Unk0 = fields[3].GetInt32(); + itemTemplate.Name1 = fields[4].GetString(); + itemTemplate.DisplayInfoID = fields[5].GetUInt32(); + itemTemplate.Quality = uint32(fields[6].GetUInt8()); + itemTemplate.Flags = uint32(fields[7].GetInt64()); + itemTemplate.Flags2 = fields[8].GetUInt32(); + itemTemplate.BuyCount = 1; + itemTemplate.BuyPrice = fields[9].GetInt64(); + itemTemplate.SellPrice = fields[10].GetUInt32(); + itemTemplate.InventoryType = fields[11].GetUInt32(); + itemTemplate.AllowableClass = fields[12].GetUInt32(); + itemTemplate.AllowableRace = fields[13].GetUInt32(); + itemTemplate.ItemLevel = fields[14].GetUInt32(); + itemTemplate.RequiredLevel = fields[15].GetUInt32(); + itemTemplate.RequiredSkill = fields[16].GetUInt32(); + itemTemplate.RequiredSkillRank = fields[17].GetUInt32(); + itemTemplate.RequiredSpell = fields[18].GetUInt32(); + itemTemplate.RequiredHonorRank = fields[19].GetUInt32(); + itemTemplate.RequiredCityRank = fields[20].GetUInt32(); itemTemplate.RequiredReputationFaction = fields[21].GetUInt32(); - itemTemplate.RequiredReputationRank = fields[22].GetUInt32(); - itemTemplate.MaxCount = fields[23].GetInt32(); - itemTemplate.Stackable = fields[24].GetInt32(); - itemTemplate.ContainerSlots = fields[25].GetUInt32(); + itemTemplate.RequiredReputationRank = fields[22].GetUInt32(); + itemTemplate.MaxCount = fields[23].GetInt32(); + itemTemplate.Stackable = fields[24].GetInt32(); + itemTemplate.ContainerSlots = fields[25].GetUInt32(); for (uint32 i = 0; i < MAX_ITEM_PROTO_STATS; ++i) { - itemTemplate.ItemStat[i].ItemStatType = fields[26 + i * 4].GetUInt32(); - itemTemplate.ItemStat[i].ItemStatValue = fields[26 + i * 4 + 1].GetInt32(); - itemTemplate.ItemStat[i].ItemStatUnk1 = fields[26 + i * 4 + 2].GetInt32(); - itemTemplate.ItemStat[i].ItemStatUnk2 = fields[26 + i * 4 + 3].GetInt32(); + itemTemplate.ItemStat[i].ItemStatType = fields[26 + i * 4].GetUInt8(); + itemTemplate.ItemStat[i].ItemStatValue = fields[26 + i * 4 + 1].GetInt16(); + itemTemplate.ItemStat[i].ItemStatUnk1 = fields[26 + i * 4 + 2].GetInt32(); + itemTemplate.ItemStat[i].ItemStatUnk2 = fields[26 + i * 4 + 3].GetInt32(); } itemTemplate.ScalingStatDistribution = fields[66].GetUInt32(); @@ -2519,61 +2519,64 @@ void ObjectMgr::LoadItemTemplates() itemTemplate.Class, itemTemplate.SubClass, itemTemplate.Quality, fields[68].GetUInt32(), fields[129].GetFloat(), itemTemplate.InventoryType, itemTemplate.Flags2); - itemTemplate.DamageType = fields[67].GetUInt32(); - itemTemplate.Armor = FillItemArmor(itemTemplate.ItemLevel, itemTemplate.Class, itemTemplate.SubClass, itemTemplate.Quality, itemTemplate.InventoryType); - itemTemplate.Delay = fields[68].GetUInt32(); - itemTemplate.RangedModRange = fields[69].GetFloat(); + itemTemplate.DamageType = fields[67].GetUInt32(); + itemTemplate.Armor = FillItemArmor(itemTemplate.ItemLevel, itemTemplate.Class, + itemTemplate.SubClass, itemTemplate.Quality, + itemTemplate.InventoryType); + + itemTemplate.Delay = fields[68].GetUInt32(); + itemTemplate.RangedModRange = fields[69].GetFloat(); for (uint32 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i) { - itemTemplate.Spells[i].SpellId = fields[70 + 6 * i].GetInt32(); - itemTemplate.Spells[i].SpellTrigger = fields[70 + 6 * i + 1].GetUInt32(); - itemTemplate.Spells[i].SpellCharges = fields[70 + 6 * i + 2].GetInt32(); - itemTemplate.Spells[i].SpellCooldown = fields[70 + 6 * i + 3].GetInt32(); - itemTemplate.Spells[i].SpellCategory = fields[70 + 6 * i + 4].GetUInt32(); + itemTemplate.Spells[i].SpellId = fields[70 + 6 * i].GetInt32(); + itemTemplate.Spells[i].SpellTrigger = fields[70 + 6 * i + 1].GetUInt32(); + itemTemplate.Spells[i].SpellCharges = fields[70 + 6 * i + 2].GetInt32(); + itemTemplate.Spells[i].SpellCooldown = fields[70 + 6 * i + 3].GetInt32(); + itemTemplate.Spells[i].SpellCategory = fields[70 + 6 * i + 4].GetUInt32(); itemTemplate.Spells[i].SpellCategoryCooldown = fields[70 + 6 * i + 5].GetInt32(); } - itemTemplate.SpellPPMRate = 0.0f; - itemTemplate.Bonding = fields[100].GetUInt32(); - itemTemplate.Description = fields[101].GetString(); - itemTemplate.PageText = fields[102].GetUInt32(); - itemTemplate.LanguageID = fields[103].GetUInt32(); - itemTemplate.PageMaterial = fields[104].GetUInt32(); - itemTemplate.StartQuest = fields[105].GetUInt32(); - itemTemplate.LockID = fields[106].GetUInt32(); - itemTemplate.Material = fields[107].GetInt32(); - itemTemplate.Sheath = fields[108].GetUInt32(); + itemTemplate.SpellPPMRate = 0.0f; + itemTemplate.Bonding = fields[100].GetUInt32(); + itemTemplate.Description = fields[101].GetString(); + itemTemplate.PageText = fields[102].GetUInt32(); + itemTemplate.LanguageID = fields[103].GetUInt32(); + itemTemplate.PageMaterial = fields[104].GetUInt32(); + itemTemplate.StartQuest = fields[105].GetUInt32(); + itemTemplate.LockID = fields[106].GetUInt32(); + itemTemplate.Material = fields[107].GetInt32(); + itemTemplate.Sheath = fields[108].GetUInt32(); itemTemplate.RandomProperty = fields[109].GetInt32(); - itemTemplate.RandomSuffix = fields[110].GetInt32(); - itemTemplate.ItemSet = fields[111].GetUInt32(); - itemTemplate.MaxDurability = FillMaxDurability(itemTemplate.Class, itemTemplate.SubClass, + itemTemplate.RandomSuffix = fields[110].GetInt32(); + itemTemplate.ItemSet = fields[111].GetUInt32(); + itemTemplate.MaxDurability = FillMaxDurability(itemTemplate.Class, itemTemplate.SubClass, itemTemplate.Quality, itemTemplate.InventoryType, itemTemplate.ItemLevel); - itemTemplate.Area = fields[113].GetUInt32(); - itemTemplate.Map = fields[114].GetUInt32(); - itemTemplate.BagFamily = fields[115].GetUInt32(); + itemTemplate.Area = fields[113].GetUInt32(); + itemTemplate.Map = fields[114].GetUInt32(); + itemTemplate.BagFamily = fields[115].GetUInt32(); itemTemplate.TotemCategory = fields[116].GetUInt32(); for (uint32 i = 0; i < MAX_ITEM_PROTO_SOCKETS; ++i) { - itemTemplate.Socket[i].Color = fields[117 + i * 2].GetUInt32(); + itemTemplate.Socket[i].Color = fields[117 + i * 2].GetUInt32(); itemTemplate.Socket[i].Content = fields[117 + i * 2 + 1].GetUInt32(); } - itemTemplate.socketBonus = fields[123].GetUInt32(); + itemTemplate.socketBonus = fields[123].GetUInt32(); itemTemplate.GemProperties = fields[124].GetUInt32(); FillDisenchantFields(&itemTemplate.DisenchantID, &itemTemplate.RequiredDisenchantSkill, itemTemplate); itemTemplate.ArmorDamageModifier = fields[125].GetFloat(); - itemTemplate.Duration = fields[126].GetUInt32(); - itemTemplate.ItemLimitCategory = fields[127].GetUInt32(); - itemTemplate.HolidayId = fields[128].GetUInt32(); - itemTemplate.StatScalingFactor = fields[129].GetFloat(); - itemTemplate.Field130 = fields[130].GetInt32(); - itemTemplate.Field131 = fields[131].GetInt32(); - itemTemplate.ScriptId = 0; - itemTemplate.FoodType = 0; - itemTemplate.MinMoneyLoot = 0; - itemTemplate.MaxMoneyLoot = 0; + itemTemplate.Duration = fields[126].GetUInt32(); + itemTemplate.ItemLimitCategory = fields[127].GetUInt32(); + itemTemplate.HolidayId = fields[128].GetUInt32(); + itemTemplate.StatScalingFactor = fields[129].GetFloat(); + itemTemplate.Field130 = fields[130].GetInt32(); + itemTemplate.Field131 = fields[131].GetInt32(); + itemTemplate.ScriptId = 0; + itemTemplate.FoodType = 0; + itemTemplate.MinMoneyLoot = 0; + itemTemplate.MaxMoneyLoot = 0; ++dbCount; } while (result->NextRow()); } diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index 31c05c2723e..26f4ad71cda 100755 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -61,14 +61,14 @@ Quest::Quest(Field* questRecord) SourceSpellid = questRecord[36].GetUInt32(); Flags = questRecord[37].GetUInt32(); uint32 SpecialFlags = questRecord[38].GetUInt8(); - MinimapTargetMark = questRecord[39].GetUInt32(); + MinimapTargetMark = questRecord[39].GetUInt8(); RewardTitleId = questRecord[40].GetUInt8(); RequiredPlayerKills = questRecord[41].GetUInt8(); RewardTalents = questRecord[42].GetUInt8(); RewardArenaPoints = questRecord[43].GetUInt16(); - RewardSkillId = questRecord[44].GetUInt32(); - RewardSkillPoints = questRecord[45].GetUInt32(); - RewardReputationMask = questRecord[46].GetUInt32(); + RewardSkillId = questRecord[44].GetUInt16(); + RewardSkillPoints = questRecord[45].GetUInt8(); + RewardReputationMask = questRecord[46].GetUInt8(); QuestGiverPortrait = questRecord[47].GetUInt32(); QuestTurnInPortrait = questRecord[48].GetUInt32(); @@ -147,8 +147,8 @@ Quest::Quest(Field* questRecord) QuestGiverTargetName = questRecord[149].GetString(); QuestTurnTextWindow = questRecord[150].GetString(); QuestTurnTargetName = questRecord[151].GetString(); - SoundAccept = questRecord[152].GetUInt32(); - SoundTurnIn = questRecord[153].GetUInt32(); + SoundAccept = questRecord[152].GetUInt16(); + SoundTurnIn = questRecord[153].GetUInt16(); for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) DetailsEmote[i] = questRecord[154+i].GetUInt16(); -- cgit v1.2.3 From c95905ddbb22e2b5b5362b790aa851ef10d4e27e Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 4 Jul 2012 18:24:05 +0200 Subject: Core: Added 4.3.4 opcodes from WPP, commented out some code to fix compile (switches with opcodes - duplicate case 0: labels) and fixed authentication --- src/server/authserver/Authentication/AuthCodes.cpp | 7 +- src/server/authserver/Authentication/AuthCodes.h | 3 +- src/server/game/Handlers/AuthHandler.cpp | 23 +- src/server/game/Handlers/ChatHandler.cpp | 36 +- src/server/game/Handlers/MovementHandler.cpp | 18 +- src/server/game/Handlers/VehicleHandler.cpp | 4 +- src/server/game/Movement/MovementStructures.h | 80 +- src/server/game/Server/Protocol/Opcodes.cpp | 2681 ++++++++++---------- src/server/game/Server/Protocol/Opcodes.h | 2150 ++++++++-------- src/server/game/Server/WorldSession.cpp | 6 +- src/server/game/Server/WorldSession.h | 2 +- src/server/game/Server/WorldSocket.cpp | 150 +- src/server/game/World/World.cpp | 4 +- src/server/shared/Packets/ByteBuffer.h | 12 +- 14 files changed, 2606 insertions(+), 2570 deletions(-) (limited to 'src') diff --git a/src/server/authserver/Authentication/AuthCodes.cpp b/src/server/authserver/Authentication/AuthCodes.cpp index 5dacb2df35e..7a97cbee3de 100644 --- a/src/server/authserver/Authentication/AuthCodes.cpp +++ b/src/server/authserver/Authentication/AuthCodes.cpp @@ -19,7 +19,7 @@ namespace AuthHelper { - bool IsAcceptedBuild(int build) + bool IsAcceptedClientBuild(int build) { static int accepted_versions[] = TRINITYCORE_ACCEPTED_CLIENT_BUILD; @@ -29,9 +29,4 @@ namespace AuthHelper return false; } - - bool IsAcceptedClientBuild(int build) - { - return (IsAcceptedBuild(build)); - } }; diff --git a/src/server/authserver/Authentication/AuthCodes.h b/src/server/authserver/Authentication/AuthCodes.h index 6dc76ce0c56..9d631a5800d 100755 --- a/src/server/authserver/Authentication/AuthCodes.h +++ b/src/server/authserver/Authentication/AuthCodes.h @@ -65,13 +65,12 @@ enum LoginResult LOGIN_LOCKED_ENFORCED = 0x10, }; -#define TRINITYCORE_ACCEPTED_CLIENT_BUILD {14545, 14480, 14333, 14007, 0} +#define TRINITYCORE_ACCEPTED_CLIENT_BUILD {15595, 12340, 0} // accept one Cataclysm and one Wrath of the Lich King build namespace AuthHelper { bool IsAcceptedClientBuild(int build); - bool IsAcceptedBuild(int build); }; #endif diff --git a/src/server/game/Handlers/AuthHandler.cpp b/src/server/game/Handlers/AuthHandler.cpp index c5dbcb4f946..4a3f8d55fdc 100755 --- a/src/server/game/Handlers/AuthHandler.cpp +++ b/src/server/game/Handlers/AuthHandler.cpp @@ -19,21 +19,26 @@ #include "WorldSession.h" #include "WorldPacket.h" -void WorldSession::SendAuthResponse(uint8 code, bool shortForm, uint32 queuePos) +void WorldSession::SendAuthResponse(uint8 code, bool queued, uint32 queuePos) { - WorldPacket packet(SMSG_AUTH_RESPONSE, 1 + 4 + 1 + 4 + 1 + (shortForm ? 0 : (4 + 1))); - packet << uint8(code); + WorldPacket packet(SMSG_AUTH_RESPONSE, 1 /*bits*/ + 4 + 1 + 4 + 1 + 4 + 1 + 1 + (queued ? 4 : 0)); + packet.WriteBit(queued); + if (queued) + packet.WriteBit(0); + + packet.WriteBit(1); // has account info + + // account info packet << uint32(0); // BillingTimeRemaining - packet << uint8(0); // BillingPlanFlags - packet << uint32(0); // BillingTimeRested packet << uint8(Expansion()); // 0 - normal, 1 - TBC, 2 - WOTLK, 3 - CATA; must be set in database manually for each account + packet << uint32(0); packet << uint8(Expansion()); // Unknown, these two show the same + packet << uint32(0); // BillingTimeRested + packet << uint8(0); // BillingPlanFlags - if (!shortForm) - { + packet << uint8(code); + if (queued) packet << uint32(queuePos); // Queue position - packet << uint8(0); // Unk 3.3.0 - } SendPacket(&packet); } diff --git a/src/server/game/Handlers/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cpp index 4aab82945f1..c1246799e4b 100755 --- a/src/server/game/Handlers/ChatHandler.cpp +++ b/src/server/game/Handlers/ChatHandler.cpp @@ -91,15 +91,15 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) case CMSG_MESSAGECHAT_AFK: type = CHAT_MSG_AFK; break; - case CMSG_MESSAGECHAT_DND: - type = CHAT_MSG_DND; - break; - case CMSG_MESSAGECHAT_EMOTE: - type = CHAT_MSG_EMOTE; - break; - case CMSG_MESSAGECHAT_PARTY: - type = CHAT_MSG_PARTY; - break; + //case CMSG_MESSAGECHAT_DND: + // type = CHAT_MSG_DND; + // break; + //case CMSG_MESSAGECHAT_EMOTE: + // type = CHAT_MSG_EMOTE; + // break; + //case CMSG_MESSAGECHAT_PARTY: + // type = CHAT_MSG_PARTY; + // break; //case CMSG_MESSAGECHAT_PARTY_LEADER: // type = CHAT_MSG_PARTY_LEADER; // break; @@ -139,7 +139,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) if (type != CHAT_MSG_EMOTE) { recvData >> lang; - + // prevent talking at unknown language (cheating) LanguageDesc const* langDesc = GetLanguageDescByID(lang); if (!langDesc) @@ -542,7 +542,7 @@ void WorldSession::HandleAddonMessagechatOpcode(WorldPacket& recvData) { Player* sender = GetPlayer(); ChatMsg type; - + switch (recvData.GetOpcode()) { case CMSG_MESSAGECHAT_ADDON_BATTLEGROUND: @@ -554,12 +554,12 @@ void WorldSession::HandleAddonMessagechatOpcode(WorldPacket& recvData) case CMSG_MESSAGECHAT_ADDON_PARTY: type = CHAT_MSG_PARTY; break; - case CMSG_MESSAGECHAT_ADDON_RAID: - type = CHAT_MSG_RAID; - break; - case CMSG_MESSAGECHAT_ADDON_WHISPER: - type = CHAT_MSG_WHISPER; - break; + //case CMSG_MESSAGECHAT_ADDON_RAID: + // type = CHAT_MSG_RAID; + // break; + //case CMSG_MESSAGECHAT_ADDON_WHISPER: + // type = CHAT_MSG_WHISPER; + // break; default: sLog->outDetail("HandleAddonMessagechatOpcode: Unknown addon chat opcode (%u)", recvData.GetOpcode()); recvData.hexlike(); @@ -624,7 +624,7 @@ void WorldSession::HandleAddonMessagechatOpcode(WorldPacket& recvData) case CHAT_MSG_PARTY: case CHAT_MSG_RAID: { - + Group* group = sender->GetGroup(); if (!group || group->isBGGroup()) break; diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp index 592b2cbeff6..40d63235af3 100755 --- a/src/server/game/Handlers/MovementHandler.cpp +++ b/src/server/game/Handlers/MovementHandler.cpp @@ -426,15 +426,15 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recv_data) switch (opcode) { - case CMSG_MOVE_FORCE_WALK_SPEED_CHANGE_ACK: move_type = MOVE_WALK; force_move_type = MOVE_WALK; break; - case CMSG_MOVE_FORCE_RUN_SPEED_CHANGE_ACK: move_type = MOVE_RUN; force_move_type = MOVE_RUN; break; - case CMSG_MOVE_FORCE_RUN_BACK_SPEED_CHANGE_ACK: move_type = MOVE_RUN_BACK; force_move_type = MOVE_RUN_BACK; break; - case CMSG_MOVE_FORCE_SWIM_SPEED_CHANGE_ACK: move_type = MOVE_SWIM; force_move_type = MOVE_SWIM; break; - case CMSG_MOVE_FORCE_SWIM_BACK_SPEED_CHANGE_ACK: move_type = MOVE_SWIM_BACK; force_move_type = MOVE_SWIM_BACK; break; - case CMSG_MOVE_FORCE_TURN_RATE_CHANGE_ACK: move_type = MOVE_TURN_RATE; force_move_type = MOVE_TURN_RATE; break; - case CMSG_MOVE_FORCE_FLIGHT_SPEED_CHANGE_ACK: move_type = MOVE_FLIGHT; force_move_type = MOVE_FLIGHT; break; - case CMSG_MOVE_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK: move_type = MOVE_FLIGHT_BACK; force_move_type = MOVE_FLIGHT_BACK; break; - case CMSG_MOVE_FORCE_PITCH_RATE_CHANGE_ACK: move_type = MOVE_PITCH_RATE; force_move_type = MOVE_PITCH_RATE; break; + //case CMSG_MOVE_FORCE_WALK_SPEED_CHANGE_ACK: move_type = MOVE_WALK; force_move_type = MOVE_WALK; break; + //case CMSG_MOVE_FORCE_RUN_SPEED_CHANGE_ACK: move_type = MOVE_RUN; force_move_type = MOVE_RUN; break; + //case CMSG_MOVE_FORCE_RUN_BACK_SPEED_CHANGE_ACK: move_type = MOVE_RUN_BACK; force_move_type = MOVE_RUN_BACK; break; + //case CMSG_MOVE_FORCE_SWIM_SPEED_CHANGE_ACK: move_type = MOVE_SWIM; force_move_type = MOVE_SWIM; break; + //case CMSG_MOVE_FORCE_SWIM_BACK_SPEED_CHANGE_ACK: move_type = MOVE_SWIM_BACK; force_move_type = MOVE_SWIM_BACK; break; + //case CMSG_MOVE_FORCE_TURN_RATE_CHANGE_ACK: move_type = MOVE_TURN_RATE; force_move_type = MOVE_TURN_RATE; break; + //case CMSG_MOVE_FORCE_FLIGHT_SPEED_CHANGE_ACK: move_type = MOVE_FLIGHT; force_move_type = MOVE_FLIGHT; break; + //case CMSG_MOVE_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK: move_type = MOVE_FLIGHT_BACK; force_move_type = MOVE_FLIGHT_BACK; break; + //case CMSG_MOVE_FORCE_PITCH_RATE_CHANGE_ACK: move_type = MOVE_PITCH_RATE; force_move_type = MOVE_PITCH_RATE; break; default: sLog->outError("WorldSession::HandleForceSpeedChangeAck: Unknown move type opcode: %u", opcode); return; diff --git a/src/server/game/Handlers/VehicleHandler.cpp b/src/server/game/Handlers/VehicleHandler.cpp index cfd73c2c987..dd95b903497 100644 --- a/src/server/game/Handlers/VehicleHandler.cpp +++ b/src/server/game/Handlers/VehicleHandler.cpp @@ -67,7 +67,7 @@ void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket &recv_data) recv_data.GetOpcode(), GetPlayer()->GetGUIDLow(), seat->m_flags); return; } - + /* switch (recv_data.GetOpcode()) { case CMSG_REQUEST_VEHICLE_PREV_SEAT: @@ -122,7 +122,7 @@ void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket &recv_data) } default: break; - } + }*/ } void WorldSession::HandleEnterPlayerVehicle(WorldPacket &data) diff --git a/src/server/game/Movement/MovementStructures.h b/src/server/game/Movement/MovementStructures.h index 013e759e573..84b6d79cbd5 100644 --- a/src/server/game/Movement/MovementStructures.h +++ b/src/server/game/Movement/MovementStructures.h @@ -1325,46 +1325,46 @@ MovementStatusElements* GetMovementStatusElementsSequence(Opcodes opcode) { switch(opcode) { - case SMSG_PLAYER_MOVE://done - return PlayerMoveSequence; - case MSG_MOVE_FALL_LAND://done - return MovementFallLandSequence; - case MSG_MOVE_HEARTBEAT://done - return MovementHeartBeatSequence; - case MSG_MOVE_JUMP://done - return MovementJumpSequence; - case MSG_MOVE_SET_FACING://done - return MovementSetFacingSequence; - case MSG_MOVE_SET_PITCH://done - return MovementSetPitchSequence; - case MSG_MOVE_START_BACKWARD://done - return MovementStartBackwardSequence; - case MSG_MOVE_START_FORWARD://done - return MovementStartForwardSequence; - case MSG_MOVE_START_STRAFE_LEFT://done - return MovementStartStrafeLeftSequence; - case MSG_MOVE_START_STRAFE_RIGHT://done - return MovementStartStrafeRightSequence; - case MSG_MOVE_START_TURN_LEFT://done - return MovementStartTurnLeftSequence; - case MSG_MOVE_START_TURN_RIGHT://done - return MovementStartTurnRightSequence; - case MSG_MOVE_STOP://done - return MovementStopSequence; - case MSG_MOVE_STOP_STRAFE://done - return MovementStopStrafeSequence; - case MSG_MOVE_STOP_TURN://done - return MovementStopTurnSequence; - case MSG_MOVE_START_ASCEND://done - return MovementStartAscendSequence; - case MSG_MOVE_START_DESCEND://done - return MovementStartDescendSequence; - case MSG_MOVE_START_SWIM://done - return MovementStartSwimSequence; - case MSG_MOVE_STOP_ASCEND://done - return MovementStopAscendSequence; - default: - break; + case SMSG_PLAYER_MOVE: + return PlayerMoveSequence; + case MSG_MOVE_FALL_LAND: + return MovementFallLandSequence; + //case MSG_MOVE_HEARTBEAT: + // return MovementHeartBeatSequence; + case MSG_MOVE_JUMP: + return MovementJumpSequence; + //case MSG_MOVE_SET_FACING: + // return MovementSetFacingSequence; + //case MSG_MOVE_SET_PITCH: + // return MovementSetPitchSequence; + case MSG_MOVE_START_BACKWARD: + return MovementStartBackwardSequence; + case MSG_MOVE_START_FORWARD: + return MovementStartForwardSequence; + case MSG_MOVE_START_STRAFE_LEFT: + return MovementStartStrafeLeftSequence; + case MSG_MOVE_START_STRAFE_RIGHT: + return MovementStartStrafeRightSequence; + case MSG_MOVE_START_TURN_LEFT: + return MovementStartTurnLeftSequence; + case MSG_MOVE_START_TURN_RIGHT: + return MovementStartTurnRightSequence; + case MSG_MOVE_STOP: + return MovementStopSequence; + case MSG_MOVE_STOP_STRAFE: + return MovementStopStrafeSequence; + case MSG_MOVE_STOP_TURN: + return MovementStopTurnSequence; + case MSG_MOVE_START_ASCEND: + return MovementStartAscendSequence; + case MSG_MOVE_START_DESCEND: + return MovementStartDescendSequence; + case MSG_MOVE_START_SWIM: + return MovementStartSwimSequence; + case MSG_MOVE_STOP_ASCEND: + return MovementStopAscendSequence; + default: + break; } return NULL; } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 51760b3323e..bf701d41ec2 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -41,1349 +41,1344 @@ void InitOpcodes() memset(opcodeTable, 0, sizeof(opcodeTable)); - //DEFINE_OPCODE_HANDLER(MSG_NULL_ACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_BOOTME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_DBLOOKUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_DBLOOKUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_QUERY_OBJECT_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_QUERY_OBJECT_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_QUERY_OBJECT_ROTATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_QUERY_OBJECT_ROTATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_WORLD_TELEPORT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWorldTeleportOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_TELEPORT_TO_UNIT, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_ZONE_MAP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_ZONE_MAP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_CHANGECELLZONE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_CHARACTER_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_CHARACTER_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_RECHARGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LEARN_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CREATEMONSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_DESTROYMONSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CREATEITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CREATEGAMEOBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_CHECK_FOR_BOTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_MAKEMONSTERATTACKGUID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_BOT_DETECTED2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_FORCEACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_FORCEACTIONONOTHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_FORCEACTIONSHOW, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_FORCEACTIONSHOW, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_PETGODMODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_PETGODMODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_REFER_A_FRIEND_EXPIRED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_WEATHER_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_UNDRESSPLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_BEASTMASTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GODMODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(SMSG_GODMODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_SETMONEY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LEVEL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_PET_LEVEL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_WORLDSTATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_COOLDOWN_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_USE_SKILL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_FLAG_QUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_FLAG_QUEST_FINISH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_QUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SEND_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_AISTATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_DEBUG_AISTATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_DISABLE_PVP_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_ADVANCE_SPAWN_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(SMSG_DESTRUCTIBLE_BUILDING_DAMAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_AUTH_SRP6_BEGIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_AUTH_SRP6_PROOF, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_AUTH_SRP6_RECODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_CHAR_CREATE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharCreateOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_CHAR_ENUM, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharEnumOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_CHAR_DELETE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharDeleteOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_AUTH_SRP6_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CHAR_CREATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CHAR_ENUM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CHAR_DELETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_PLAYER_LOGIN, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayerLoginOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_LOAD_SCREEN, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleLoadScreenOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_NEW_WORLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_TRANSFER_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_TRANSFER_ABORTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CHARACTER_LOGIN_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LOGIN_SETTIMESPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GAMETIME_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_GAMETIME_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(SMSG_GAMETIME_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_GAMESPEED_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(SMSG_GAMESPEED_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_SERVERTIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(SMSG_SERVERTIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_PLAYER_LOGOUT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayerLogoutOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_LOGOUT_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLogoutRequestOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_LOGOUT_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LOGOUT_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_LOGOUT_CANCEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLogoutCancelOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_LOGOUT_CANCEL_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNameQueryOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_PET_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetNameQuery ); - DEFINE_OPCODE_HANDLER(SMSG_PET_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_QUERY, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildQueryOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_XP, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildQueryXPOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_GUILD_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_DB_REPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_PAGE_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePageTextQueryOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_PAGE_TEXT_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_QUEST_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestQueryOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_QUEST_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJECT_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleGameObjectQueryOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_CREATURE_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleCreatureQueryOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_CREATURE_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_WHO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWhoOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_WHO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_WHOIS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWhoisOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_WHOIS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_CONTACT_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleContactListOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_CONTACT_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_FRIEND_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_ADD_FRIEND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddFriendOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_DEL_FRIEND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDelFriendOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_SET_CONTACT_NOTES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetContactNotesOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_ADD_IGNORE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddIgnoreOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_DEL_IGNORE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDelIgnoreOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_GROUP_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupInviteOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_GROUP_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_GROUP_CANCEL, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_GROUP_CANCEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_GROUP_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupAcceptOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GROUP_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupDeclineOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_GROUP_DECLINE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_GROUP_UNINVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupUninviteOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GROUP_UNINVITE_GUID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupUninviteGuidOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_GROUP_UNINVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_GROUP_SET_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupSetLeaderOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_GROUP_SET_LEADER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_LOOT_METHOD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMethodOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GROUP_DISBAND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupDisbandOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_GROUP_DESTROYED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GROUP_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PARTY_MEMBER_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PARTY_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(UMSG_UPDATE_GROUP_MEMBERS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_CREATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildCreateOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildInviteOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildAcceptOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDeclineOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_DECLINE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildInfoOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_GUILD_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_ROSTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildRosterOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_ROSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_PROMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildPromoteOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_DEMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDemoteOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildLeaveOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_REMOVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildRemoveOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_DISBAND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDisbandOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildLeaderOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_MOTD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildMOTDOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_GUILD_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GUILD_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(UMSG_UPDATE_GUILD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_BATTLEGROUND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_GUILD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_PARTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_RAID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_WHISPER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_AFK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_BATTLEGROUND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_BATTLEGROUND_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_DND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_GUILD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_OFFICER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_PARTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_PARTY_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_RAID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_RAID_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_RAID_WARNING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_SAY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_WHISPER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_YELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_MESSAGECHAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_JOIN_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleJoinChannel ); - DEFINE_OPCODE_HANDLER(CMSG_LEAVE_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLeaveChannel ); - DEFINE_OPCODE_HANDLER(SMSG_CHANNEL_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelList ); - DEFINE_OPCODE_HANDLER(SMSG_CHANNEL_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_PASSWORD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelPassword ); - DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_SET_OWNER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelSetOwner ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_OWNER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelOwner ); - DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_MODERATOR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelModerator ); - DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNMODERATOR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelUnmoderator ); - DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_MUTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelMute ); - DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNMUTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelUnmute ); - DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelInvite ); - DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_KICK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelKick ); - DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_BAN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelBan ); - DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNBAN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelUnban ); - DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_ANNOUNCEMENTS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelAnnouncements ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_MODERATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(SMSG_UPDATE_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_DESTROY_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_USE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUseItemOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_OPEN_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleOpenItemOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_READ_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReadItem ); - DEFINE_OPCODE_HANDLER(SMSG_READ_ITEM_OK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_READ_ITEM_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_ITEM_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJ_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGameObjectUseOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_DESTROY_ITEMS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_CUSTOM_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_AREATRIGGER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaTriggerOpcode ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_START_FORWARD, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_START_BACKWARD, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_START_STRAFE_LEFT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_START_STRAFE_RIGHT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_STRAFE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_JUMP, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_START_TURN_LEFT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_START_TURN_RIGHT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_TURN, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_START_PITCH_UP, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_START_PITCH_DOWN, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_PITCH, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_RUN_MODE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_WALK_MODE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_TOGGLE_LOGGING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(SMSG_MOVE_TELEPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_TELEPORT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_MOVE_TELEPORT_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveTeleportAck ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_TOGGLE_FALL_LOGGING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_FALL_LAND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_START_SWIM, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_SWIM, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_BACK_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_RUN_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_WALK_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_SWIM_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_SWIM_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_SWIM_BACK_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_SWIM_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_ALL_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_TURN_RATE_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_TOGGLE_COLLISION_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_FACING, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_PITCH, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - DEFINE_OPCODE_HANDLER(CMSG_WORLD_PORT_RESPONSE, STATUS_TRANSFER, PROCESS_THREADUNSAFE, &WorldSession::HandleMoveWorldportAckOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_MONSTER_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_LAND_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_CHARM_PORT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_RELATIVE_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_RUN_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_RUN_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_RUN_BACK_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_SWIM_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_SWIM_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_FORCE_MOVE_ROOT_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveRootAck ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_FORCE_MOVE_UNROOT_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveUnRootAck ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_UNROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_HEARTBEAT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_KNOCK_BACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_KNOCK_BACK_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveKnockBackAck ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_KNOCK_BACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_FEATHER_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_NORMAL_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_UNSET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_HOVER_ACK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMoveHoverAck ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_HOVERING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_TRIGGER_CINEMATIC_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_OPENING_CINEMATIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(SMSG_TRIGGER_CINEMATIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_NEXT_CINEMATIC_CAMERA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNextCinematicCamera ); - DEFINE_OPCODE_HANDLER(CMSG_COMPLETE_CINEMATIC, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCompleteCinematic ); - DEFINE_OPCODE_HANDLER(SMSG_TUTORIAL_FLAGS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_FLAG, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialFlag ); - DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_CLEAR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialClear ); - DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_RESET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialReset ); - DEFINE_OPCODE_HANDLER(CMSG_STANDSTATECHANGE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStandStateChangeOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEmoteOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_EMOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_TEXT_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTextEmoteOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_TEXT_EMOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_AUTOEQUIP_GROUND_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_GROUND_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_LOOT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutostoreLootItemOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_STORE_LOOT_IN_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_AUTOEQUIP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoEquipItemOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_BAG_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoStoreBagItemOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_SWAP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSwapItem ); - DEFINE_OPCODE_HANDLER(CMSG_SWAP_INV_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSwapInvItemOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_SPLIT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSplitItemOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_AUTOEQUIP_ITEM_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoEquipItemSlotOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_UNCLAIM_LICENSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_DESTROYITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDestroyItemOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_INVENTORY_CHANGE_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_OPEN_CONTAINER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_INSPECT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_INSPECT_RESULTS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_INITIATE_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInitiateTradeOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_BEGIN_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBeginTradeOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_BUSY_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBusyTradeOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleIgnoreTradeOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_ACCEPT_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAcceptTradeOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_UNACCEPT_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnacceptTradeOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_CANCEL_TRADE, STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelTradeOpcode); - //DEFINE_OPCODE_HANDLER(CMSG_SET_TRADE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTradeItemOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_TRADE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleClearTradeItemOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_TRADE_GOLD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTradeGoldOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_TRADE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_TRADE_STATUS_EXTENDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_INITIALIZE_FACTIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SET_FACTION_VISIBLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SET_FACTION_STANDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_FACTION_ATWAR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetFactionAtWar ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_FACTION_CHEAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetFactionCheat ); - DEFINE_OPCODE_HANDLER(SMSG_SET_PROFICIENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_SET_ACTION_BUTTON, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActionButtonOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_ACTION_BUTTONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_INITIAL_SPELLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LEARNED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SUPERCEDED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_NEW_SPELL_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_CAST_SPELL, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleCastSpellOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_CANCEL_CAST, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleCancelCastOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_CAST_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPELL_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPELL_GO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPELL_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPELL_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COOLDOWN_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_CANCEL_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelAuraOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_EQUIPMENT_SET_SAVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_CAST_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(MSG_CHANNEL_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_CHANNEL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_CANCEL_CHANNELLING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelChanneling ); - DEFINE_OPCODE_HANDLER(SMSG_AI_REACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_SET_SELECTION, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleSetSelectionOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_EQUIPMENT_SET_DELETE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetDelete ); - //DEFINE_OPCODE_HANDLER(CMSG_INSTANCE_LOCK_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInstanceLockResponse ); - //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_PASSIVE_AURA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_ATTACKSWING, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleAttackSwingOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_ATTACKSTOP, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleAttackStopOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_ATTACKSTART, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_ATTACKSTOP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_ATTACKSWING_NOTINRANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_ATTACKSWING_BADFACING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_LOCK_WARNING_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ATTACKSWING_DEADTARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ATTACKSWING_CANT_ATTACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ATTACKERSTATEUPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_PORT_DENIED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_PERFORM_ACTION_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_RESUME_CAST_BAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CANCEL_COMBAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELLBREAKLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPELLHEALLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPELLENERGIZELOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_BREAK_TARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_SAVE_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SETDEATHBINDPOINT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(SMSG_BINDPOINTUPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_GETDEATHBINDZONE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_BINDZONEREPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PLAYERBOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CLIENT_CONTROL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_REPOP_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepopRequestOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_RESURRECT_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_RESURRECT_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleResurrectResponseOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_LOOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_LOOT_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMoneyOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_LOOT_RELEASE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootReleaseOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_LOOT_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LOOT_RELEASE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LOOT_REMOVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LOOT_MONEY_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LOOT_ITEM_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LOOT_CLEAR_MONEY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_ITEM_PUSH_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_DUEL_REQUESTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DUEL_OUTOFBOUNDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DUEL_INBOUNDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_DUEL_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_DUEL_WINNER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_DUEL_ACCEPTED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDuelAcceptedOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_DUEL_CANCELLED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDuelCancelledOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_MOUNTRESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DISMOUNTRESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_REMOVED_FROM_PVP_QUEUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_MOUNTSPECIAL_ANIM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMountSpecialAnimOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_MOUNTSPECIAL_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_TAME_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_PET_SET_ACTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetSetAction ); - DEFINE_OPCODE_HANDLER(CMSG_PET_ACTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetAction ); - //DEFINE_OPCODE_HANDLER(CMSG_PET_ABANDON, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetAbandon ); - //DEFINE_OPCODE_HANDLER(CMSG_PET_RENAME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetRename ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_NAME_INVALID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PET_SPELLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PET_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_GOSSIP_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGossipHelloOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_GOSSIP_SELECT_OPTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGossipSelectOptionOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_GOSSIP_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GOSSIP_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_NPC_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNpcTextQueryOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_NPC_TEXT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_NPC_WONT_TALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_STATUS_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleQuestgiverStatusQueryOpcode); - DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverHelloOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_QUERY_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverQueryQuestOpcode); - //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_QUEST_AUTOLAUNCH, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverQuestAutoLaunch ); - DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_DETAILS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_ACCEPT_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverAcceptQuestOpcode); - DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_COMPLETE_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverCompleteQuest ); - DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_REQUEST_ITEMS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_REQUEST_REWARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverRequestRewardOpcode); - //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_OFFER_REWARD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_CHOOSE_REWARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverChooseRewardOpcode); - //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_INVALID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_CANCEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverCancel ); - DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_QUESTLOG_SWAP_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestLogSwapQuest ); - DEFINE_OPCODE_HANDLER(CMSG_QUESTLOG_REMOVE_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestLogRemoveQuest ); - DEFINE_OPCODE_HANDLER(SMSG_QUESTLOG_FULL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_FAILEDTIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_ADD_KILL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_ADD_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_QUEST_CONFIRM_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestConfirmAccept ); - DEFINE_OPCODE_HANDLER(SMSG_QUEST_CONFIRM_ACCEPT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_PUSHQUESTTOPARTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePushQuestToParty ); - DEFINE_OPCODE_HANDLER(CMSG_LIST_INVENTORY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleListInventoryOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_LIST_INVENTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_SELL_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSellItemOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_SELL_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_BUY_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyItemOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_BUY_ITEM_IN_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyItemInSlotOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_BUY_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_BUY_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_TAXICLEARALLNODES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_TAXIENABLEALLNODES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_TAXISHOWNODES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_SHOWTAXINODES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_TAXINODE_STATUS_QUERY, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleTaxiNodeStatusQueryOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_TAXINODE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_TAXIQUERYAVAILABLENODES, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleTaxiQueryAvailableNodes ); - DEFINE_OPCODE_HANDLER(CMSG_ACTIVATETAXI, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleActivateTaxiOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_ACTIVATETAXIREPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_NEW_TAXI_PATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_TRAINER_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerListOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_TRAINER_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_TRAINER_BUY_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerBuySpellOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_SUCCEEDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_BINDER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBinderActivateOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_PLAYERBINDERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_BANKER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBankerActivateOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_SHOW_BANK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_BUY_BANK_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyBankSlotOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_BUY_BANK_SLOT_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_PETITION_SHOWLIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionShowListOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_PETITION_SHOWLIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_PETITION_BUY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionBuyOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_PETITION_SHOW_SIGNATURES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionShowSignOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_PETITION_SHOW_SIGNATURES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_PETITION_SIGN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionSignOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_PETITION_SIGN_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(MSG_PETITION_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionDeclineOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_OFFER_PETITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleOfferPetitionOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_TURN_IN_PETITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTurnInPetitionOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_TURN_IN_PETITION_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_PETITION_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionQueryOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_PETITION_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_FISH_NOT_HOOKED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_FISH_ESCAPED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_BUG, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBugOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_PLAYED_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayedTime ); - DEFINE_OPCODE_HANDLER(SMSG_PLAYED_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_QUERY_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryTimeOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_QUERY_TIME_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LOG_XPGAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_AURACASTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_RECLAIM_CORPSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReclaimCorpseOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_WRAP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWrapItemOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_LEVELUP_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(MSG_MINIMAP_PING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMinimapPingOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_RESISTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_ENCHANTMENTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_SKILL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(SMSG_START_MIRROR_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PAUSE_MIRROR_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_STOP_MIRROR_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_PING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); - DEFINE_OPCODE_HANDLER(SMSG_PONG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_PAGETEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_SETSHEATHED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleSetSheathedOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_COOLDOWN_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPELL_DELAYED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_QUEST_POI_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestPOIQuery ); - DEFINE_OPCODE_HANDLER(SMSG_QUEST_POI_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_GHOST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_INVIS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(SMSG_INVALID_PROMOTION_CODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(MSG_GM_BIND_OTHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_GM_SUMMON, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_ITEM_TIME_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ITEM_ENCHANT_TIME_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_AUTH_CHALLENGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_AUTH_SESSION, STATUS_NEVER, PROCESS_THREADUNSAFE, &WorldSession::Handle_EarlyProccess ); - DEFINE_OPCODE_HANDLER(SMSG_AUTH_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(MSG_GM_SHOWLABEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_PET_CAST_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetCastSpellOpcode ); - DEFINE_OPCODE_HANDLER(MSG_SAVE_GUILD_EMBLEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSaveGuildEmblemOpcode ); - DEFINE_OPCODE_HANDLER(MSG_TABARDVENDOR_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTabardVendorActivateOpcode); - //DEFINE_OPCODE_HANDLER(SMSG_PLAY_SPELL_VISUAL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_ZONEUPDATE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleZoneUpdateOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_PARTYKILLLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_UPDATE_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PLAY_SPELL_IMPACT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_EXPLORATION_EXPERIENCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_SET_SECURITY_GROUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_NUKE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_RANDOM_ROLL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRandomRollOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_ENVIRONMENTALDAMAGELOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANGEPLAYER_DIFFICULTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_RWHOIS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_PLAYER_REWARD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LFG_TELEPORT_DENIED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_SKILL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnlearnSkillOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_REMOVED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_DECHARGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_CREATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketCreateOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_CREATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_UPDATETEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketUpdateOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_UPDATETEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_ACCOUNT_DATA_TIMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_REQUEST_ACCOUNT_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestAccountData ); - DEFINE_OPCODE_HANDLER(CMSG_UPDATE_ACCOUNT_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateAccountData ); - DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ACCOUNT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_FAR_SIGHT_IMMEDIATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHANGEPLAYER_DIFFICULTY_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_TEACH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_CREATE_ITEM_TARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_GETTICKET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketGetTicketOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_GETTICKET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_TALENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(SMSG_UPDATE_INSTANCE_ENCOUNTER_UNIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_DESPAWN_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(MSG_CORPSE_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCorpseQueryOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_DELETETICKET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketDeleteOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_DELETETICKET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHAT_WRONG_FACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_SYSTEMSTATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketSystemStatusOpcode); - DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_SYSTEMSTATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_SPIRIT_HEALER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSpiritHealerActivateOpcode); - //DEFINE_OPCODE_HANDLER(CMSG_SET_STAT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_QUEST_FORCE_REMOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_SKILL_BUY_STEP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SKILL_BUY_RANK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_XP_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(SMSG_SPIRIT_HEALER_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_CHARACTER_POINT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(SMSG_GOSSIP_POI, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_CHAT_IGNORED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChatIgnoredOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_VISION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SERVER_COMMAND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_SILENCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_REVEALTO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_RESURRECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_SUMMONMOB, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_MOVECORPSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_FREEZE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_UBERINVIS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_REQUEST_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_GM_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_RANK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildRankOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_ADD_RANK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildAddRankOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_DEL_RANK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDelRankOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_SET_PUBLIC_NOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildSetPublicNoteOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_SET_OFFICER_NOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildSetOfficerNoteOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_LOGIN_VERIFY_WORLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_EXPLORATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SEND_MAIL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSendMail ); - DEFINE_OPCODE_HANDLER(SMSG_SEND_MAIL_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_GET_MAIL_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGetMailList ); - DEFINE_OPCODE_HANDLER(SMSG_MAIL_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlefieldListOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_JOIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_FORCE_SET_VEHICLE_REC_ID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_VEHICLE_REC_ID_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_TAXICLEARNODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_TAXIENABLENODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_ITEM_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemTextQuery ); - //DEFINE_OPCODE_HANDLER(SMSG_ITEM_TEXT_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_MAIL_TAKE_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailTakeMoney ); - DEFINE_OPCODE_HANDLER(CMSG_MAIL_TAKE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailTakeItem ); - //DEFINE_OPCODE_HANDLER(CMSG_MAIL_MARK_AS_READ, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailMarkAsRead ); - //DEFINE_OPCODE_HANDLER(CMSG_MAIL_RETURN_TO_SENDER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailReturnToSender ); - DEFINE_OPCODE_HANDLER(CMSG_MAIL_DELETE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailDelete ); - DEFINE_OPCODE_HANDLER(CMSG_MAIL_CREATE_TEXT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailCreateTextItem ); - DEFINE_OPCODE_HANDLER(SMSG_SPELLLOGMISS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPELLLOGEXECUTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DEBUGAURAPROC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PERIODICAURALOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPELLDAMAGESHIELD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPELLNONMELEEDAMAGELOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_LEARN_TALENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnTalentOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_RESURRECT_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_TOGGLE_PVP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTogglePvP ); - DEFINE_OPCODE_HANDLER(SMSG_ZONE_UNDER_ATTACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(MSG_AUCTION_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionHelloOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_SELL_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionSellItem ); - //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_REMOVE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionRemoveItem ); - //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListItems ); - DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_OWNER_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListOwnerItems ); - DEFINE_OPCODE_HANDLER(CMSG_AUCTION_PLACE_BID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionPlaceBid ); - DEFINE_OPCODE_HANDLER(SMSG_AUCTION_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_AUCTION_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_AUCTION_OWNER_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_AUCTION_BIDDER_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_AUCTION_OWNER_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PROCRESIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMBAT_EVENT_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DISPEL_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPELLORDAMAGE_IMMUNE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_BIDDER_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListBidderItems ); - DEFINE_OPCODE_HANDLER(SMSG_AUCTION_BIDDER_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SET_FLAT_SPELL_MODIFIER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SET_PCT_SPELL_MODIFIER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CORPSE_RECLAIM_DELAY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIVE_MOVER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActiveMoverOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_PET_CANCEL_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetCancelAuraOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_PLAYER_AI_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_AUTO_REPEAT_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelAutoRepeatSpellOpcode); - //DEFINE_OPCODE_HANDLER(MSG_GM_ACCOUNT_ONLINE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(MSG_LIST_STABLED_PETS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleListStabledPetsOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_STABLE_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStablePet ); - //DEFINE_OPCODE_HANDLER(CMSG_UNSTABLE_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnstablePet ); - //DEFINE_OPCODE_HANDLER(CMSG_BUY_STABLE_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyStableSlot ); - //DEFINE_OPCODE_HANDLER(SMSG_STABLE_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_STABLE_REVIVE_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStableRevivePet ); - //DEFINE_OPCODE_HANDLER(CMSG_STABLE_SWAP_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStableSwapPet ); - //DEFINE_OPCODE_HANDLER(MSG_QUEST_PUSH_RESULT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestPushResult ); - //DEFINE_OPCODE_HANDLER(SMSG_PLAY_MUSIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PLAY_OBJECT_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PET_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestPetInfoOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_FAR_SIGHT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleFarSightOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELLDISPELLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DAMAGE_CALC_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_ENABLE_DAMAGE_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_GROUP_CHANGE_SUB_GROUP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupChangeSubGroupOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PARTY_MEMBER_STATS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestPartyMemberStatsOpcode); - DEFINE_OPCODE_HANDLER(CMSG_GROUP_SWAP_SUB_GROUP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupSwapSubGroupOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_RESET_FACTION_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_BANK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoStoreBankItemOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_AUTOBANK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoBankItemOpcode ); - DEFINE_OPCODE_HANDLER(MSG_QUERY_NEXT_MAIL_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryNextMailTime ); - DEFINE_OPCODE_HANDLER(SMSG_RECEIVED_MAIL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_RAID_GROUP_ONLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_DURABILITY_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_PVP_RANK_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_ADD_PVP_MEDAL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_DEL_PVP_MEDAL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_PVP_TITLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(SMSG_PVP_CREDIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_AUCTION_REMOVED_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_GROUP_RAID_CONVERT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupRaidConvertOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GROUP_ASSISTANT_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupAssistantLeaderOpcode); - DEFINE_OPCODE_HANDLER(CMSG_BUYBACK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuybackItem ); - DEFINE_OPCODE_HANDLER(SMSG_SERVER_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_SAVED_INSTANCE_EXTEND, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(SMSG_LFG_OFFER_CONTINUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_TEST_DROP_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_TEST_DROP_RATE_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_LFG_GET_STATUS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_SHOW_MAILBOX, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RESET_RANGED_COMBAT_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_MEETINGSTONE_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_MEMBER_ADDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHAT_NOT_IN_PARTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_GROWTH_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelGrowthAuraOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_CANCEL_AUTO_REPEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_STANDSTATE_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LOOT_ALL_PASSED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LOOT_ROLL_WON, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_LOOT_ROLL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootRoll ); - DEFINE_OPCODE_HANDLER(SMSG_LOOT_START_ROLL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LOOT_ROLL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_LOOT_MASTER_GIVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMasterGiveOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_LOOT_MASTER_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SET_FORCED_REACTIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPELL_FAILED_OTHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_RESET_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_REPAIR_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepairItemOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_CHAT_PLAYER_NOT_FOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(MSG_TALENT_WIPE_CONFIRM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTalentWipeConfirmOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_SUMMON_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_SUMMON_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSummonResponseOpcode ); - //DEFINE_OPCODE_HANDLER(MSG_DEV_SHOWLABEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(SMSG_MONSTER_MOVE_TRANSPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_BROKEN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_FEATHER_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SERVER_BROADCAST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SELF_RES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSelfResOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_FEIGN_DEATH_RESISTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_RUN_SCRIPT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_SCRIPT_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_DUEL_COUNTDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_AREA_TRIGGER_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_SHOWING_HELM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleShowingHelmOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_SHOWING_CLOAK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleShowingCloakOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_LFG_ROLE_CHOSEN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PLAYER_SKINNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DURABILITY_DAMAGE_DEATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_EXPLORATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIONBAR_TOGGLES, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActionBarToggles ); - //DEFINE_OPCODE_HANDLER(UMSG_DELETE_GUILD_CHARTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_PETITION_RENAME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionRenameOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_INIT_WORLD_STATES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_UPDATE_WORLD_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_ITEM_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemNameQueryOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_ITEM_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PET_ACTION_FEEDBACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_CHAR_RENAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharRenameOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_CHAR_RENAME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SPLINE_DONE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveSplineDoneOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FALL_RESET, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_SAVE_CREATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_RAID_INSTANCE_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RAID_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestRaidInfoOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_TIME_SKIPPED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleMoveTimeSkippedOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FEATHER_FALL_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleFeatherFallAck ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_WATER_WALK_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveWaterWalkAck ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_NOT_ACTIVE_MOVER, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveNotActiveMover ); - DEFINE_OPCODE_HANDLER(SMSG_PLAY_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_STATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlefieldStatusOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_PORT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattleFieldPortOpcode ); - //DEFINE_OPCODE_HANDLER(MSG_INSPECT_HONOR_STATS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectHonorStatsOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlemasterHelloOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_START_SWIM_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_STOP_SWIM_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_WALK_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_SWIM_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_SWIM_BACK_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_TURN_RATE_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); - //DEFINE_OPCODE_HANDLER(MSG_PVP_LOG_DATA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePVPLogDataOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_LEAVE_BATTLEFIELD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLeaveBattlefieldOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_AREA_SPIRIT_HEALER_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaSpiritHealerQueryOpcode); - DEFINE_OPCODE_HANDLER(CMSG_AREA_SPIRIT_HEALER_QUEUE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaSpiritHealerQueueOpcode); - //DEFINE_OPCODE_HANDLER(SMSG_AREA_SPIRIT_HEALER_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_UNTEACH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_WARDEN_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_WARDEN_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleWardenDataOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_GROUP_JOINED_BATTLEGROUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(MSG_BATTLEGROUND_PLAYER_POSITIONS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlegroundPlayerPositionsOpcode); - DEFINE_OPCODE_HANDLER(CMSG_PET_STOP_ATTACK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetStopAttack ); - DEFINE_OPCODE_HANDLER(SMSG_BINDER_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_PLAYER_JOINED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_PLAYER_LEFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_JOIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlemasterJoinOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_ADDON_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_PET_UNLEARN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_UNLEARN_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PARTY_MEMBER_STATS_FULL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_PET_SPELL_AUTOCAST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetSpellAutocastOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_WEATHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PLAY_TIME_WARNING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MINIGAME_SETUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MINIGAME_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_MINIGAME_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_MINIGAME_MOVE_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_RAID_INSTANCE_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_MOVES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_INFO_TEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildChangeInfoTextOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_CHAT_RESTRICTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_RUN_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_SWIM_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_SWIM_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_UNROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_FEATHER_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_NORMAL_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_UNSET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_LAND_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_START_SWIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_STOP_SWIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_RUN_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_WALK_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_NUKE_ACCOUNT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_GM_DESTROY_CORPSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_DESTROY_ONLINE_CORPSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_ACTIVATETAXIEXPRESS, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleActivateTaxiExpressOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_SET_FACTION_ATWAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GAMETIMEBIAS_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_ACTIONS_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_ACTIONS_STOP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_FACTION_INACTIVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetFactionInactiveOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_SET_WATCHED_FACTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetWatchedFactionOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SKIP_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_EXPLORATION_ALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(SMSG_INVALIDATE_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_RESET_INSTANCES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleResetInstancesOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_RESET_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_UPDATE_LAST_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(MSG_RAID_TARGET_UPDATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidTargetUpdateOpcode ); - DEFINE_OPCODE_HANDLER(MSG_RAID_READY_CHECK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidReadyCheckOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_LUA_USAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(SMSG_PET_ACTION_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PET_DISMISS_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GHOSTEE_GONE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_UPDATE_TICKET_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_GM_TICKET_STATUS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(MSG_SET_DUNGEON_DIFFICULTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetDungeonDifficultyOpcode); - //DEFINE_OPCODE_HANDLER(CMSG_GMSURVEY_SUBMIT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMSurveySubmit ); - //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_INSTANCE_OWNERSHIP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_KNOCKBACK_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(SMSG_CHAT_PLAYER_AMBIGUOUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(MSG_DELAY_GHOST_TELEPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(SMSG_SPELLINSTAKILLLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELL_UPDATE_CHAIN_TARGETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_CHAT_FILTERED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_EXPECTED_SPAM_RECORDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELLSTEALLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_LOTTERY_QUERY_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_LOTTERY_QUERY_RESULT_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_BUY_LOTTERY_TICKET_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_LOTTERY_RESULT_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHARACTER_PROFILE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHARACTER_PROFILE_REALM_CONNECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_DEFENSE_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_DIFFICULTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(MSG_GM_RESETINSTANCELIMIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(SMSG_MOTD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_SWIM_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_SWIM_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_UNSET_FLYING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_CAN_FLY_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveSetCanFlyAckOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_FLY, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(CMSG_SOCKET_GEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSocketOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_CREATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamQueryOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_ROSTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamRosterOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_ROSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamInviteOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamAcceptOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamDeclineOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamLeaveOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_REMOVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamRemoveOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_DISBAND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamDisbandOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamLeaderOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_JOIN_ARENA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlemasterJoinArena ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_START_ASCEND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_ASCEND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_LFG_JOIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgJoinOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_LFG_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgLeaveOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_SEARCH_LFG_JOIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfrSearchOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_SEARCH_LFG_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfrLeaveOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LFG_PROPOSAL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_LFG_PROPOSAL_RESULT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgProposalResultOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_LFG_ROLE_CHECK_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LFG_JOIN_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LFG_QUEUE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_LFG_COMMENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetCommentOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_PARTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_SEARCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_ROLES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetRolesOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_NEEDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_BOOT_VOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetBootVoteOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_LFG_BOOT_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_BOOT_PROPOSAL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_LFD_PLAYER_LOCK_INFO_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgPlayerLockInfoRequestOpcode); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_LFG_TELEPORT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgTeleportOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_LFD_PARTY_LOCK_INFO_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgPartyLockInfoRequestOpcode); - DEFINE_OPCODE_HANDLER(SMSG_LFG_PARTY_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_TITLE_EARNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_SET_TITLE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTitleOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_CANCEL_MOUNT_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelMountAuraOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_ARENA_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(MSG_INSPECT_ARENA_TEAMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectArenaTeamsOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_DEATH_RELEASE_LOC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_CANCEL_TEMP_ENCHANTMENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelTempEnchantmentOpcode); - //DEFINE_OPCODE_HANDLER(SMSG_FORCED_DEATH_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_SET_HONOR_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_SET_ARENA_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_FLIGHT_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_FLIGHT_BACK_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_FLIGHT_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_MAELSTROM_INVALIDATE_CACHE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(SMSG_FLIGHT_SPLINE_SYNC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_TAXI_BENCHMARK_MODE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTaxiBenchmarkOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_JOINED_BATTLEGROUND_QUEUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_REALM_SPLIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_REALM_SPLIT, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRealmSplitOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_CHNG_TRANSPORT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_PARTY_ASSIGNMENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePartyAssignmentOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_OFFER_PETITION_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_TIME_SYNC_REQ, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_TIME_SYNC_RESP, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleTimeSyncResp ); - //DEFINE_OPCODE_HANDLER(CMSG_SEND_LOCAL_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SEND_GENERAL_TRIGGER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SEND_COMBAT_TRIGGER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MAELSTROM_GM_SENT_MAIL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_RESET_FAILED_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_REAL_GROUP_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LFG_DISABLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_ACTIVE_PVP_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY_RESPONSE_WRITE_FILE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_UPDATE_COMBO_POINTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_ROSTER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_LEAVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_ADJUST_PRIORITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_VOICE_SET_TALKER_MUTED_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SET_TALKER_MUTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_INIT_EXTRA_AURA_INFO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SET_EXTRA_AURA_INFO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SET_EXTRA_AURA_INFO_NEED_UPDATE_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_EXTRA_AURA_INFO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_START_DESCEND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_REQUIREMENTS_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_IGNORE_REQUIREMENTS_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELL_CHANCE_PROC_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(SMSG_DISMOUNT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_RAID_READY_CHECK_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_VOICE_SESSION_ENABLE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleVoiceSessionEnableOpcode ); - //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_VOICE_PARENTAL_CONTROLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_WHISPER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_GM_MESSAGECHAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(MSG_GM_GEARRATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_STATE_CHANGED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_GET_MAP_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_MAP_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_GET_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_GET_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_ENTER_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_EXIT_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_INSTANCE_COMMAND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(SMSG_CLEAR_TARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_BOT_DETECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(SMSG_CROSSED_INEBRIATION_THRESHOLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_PLAYER_LOGIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_PLAYER_LOOKUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_CHEAT_PLAYER_LOOKUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_KICK_REASON, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(MSG_RAID_READY_CHECK_FINISHED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidReadyCheckFinishedOpcode); - //DEFINE_OPCODE_HANDLER(CMSG_COMPLAIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleComplainOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_COMPLAIN_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_FEATURE_SYSTEM_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_SHOW_COMPLAINTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_UNSQUELCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_SILENCE_VOICE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_SILENCE_ALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNSILENCE_VOICE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNSILENCE_ALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_TARGET_CAST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_TARGET_SCRIPT_CAST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_DISPLAY_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelDisplayListQuery ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIVE_VOICE_CHANNEL, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActiveVoiceChannel ); - //DEFINE_OPCODE_HANDLER(CMSG_GET_CHANNEL_MEMBER_COUNT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGetChannelMemberCount ); - //DEFINE_OPCODE_HANDLER(SMSG_CHANNEL_MEMBER_COUNT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_VOICE_ON, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelVoiceOnOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_VOICE_OFF, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_LIST_TARGETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_DEBUG_LIST_TARGETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_AVAILABLE_VOICE_CHANNEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_ADD_VOICE_IGNORE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_DEL_VOICE_IGNORE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_PARTY_SILENCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_PARTY_UNSILENCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_NOTIFY_PARTY_SQUELCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_COMSAT_RECONNECT_TRY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMSAT_DISCONNECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMSAT_CONNECT_FAIL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_VOICE_CHAT_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_REPORT_PVP_AFK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReportPvPAFK ); - DEFINE_OPCODE_HANDLER(SMSG_REPORT_PVP_AFK_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANKER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankerActivate ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_QUERY_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankQueryTab ); - DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_SWAP_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankSwapItems ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_BUY_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankBuyTab ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_UPDATE_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankUpdateTab ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_DEPOSIT_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankDepositMoney ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_WITHDRAW_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankWithdrawMoney ); - DEFINE_OPCODE_HANDLER(MSG_GUILD_BANK_LOG_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankLogQuery ); - DEFINE_OPCODE_HANDLER(CMSG_SET_CHANNEL_WATCH, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetChannelWatch ); - //DEFINE_OPCODE_HANDLER(SMSG_USERLIST_ADD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_USERLIST_REMOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_USERLIST_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_CHANNEL_WATCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(SMSG_INSPECT_TALENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GOGOGO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ECHO_PARTY_SQUELCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_TITLE_SUFFIX, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_SPELLCLICK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSpellClick ); - DEFINE_OPCODE_HANDLER(SMSG_LOOT_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_CHARACTER_RESTORE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_CHARACTER_SAVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_VOICESESSION_FULL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(MSG_GUILD_PERMISSIONS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildPermissions ); - //DEFINE_OPCODE_HANDLER(MSG_GUILD_BANK_MONEY_WITHDRAWN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankMoneyWithdrawn ); - DEFINE_OPCODE_HANDLER(MSG_GUILD_EVENT_LOG_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildEventLogQueryOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MAELSTROM_RENAME_GUILD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_GET_MIRRORIMAGE_DATA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMirrorImageDataRequest ); - //DEFINE_OPCODE_HANDLER(SMSG_MIRRORIMAGE_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_FORCE_DISPLAY_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELL_CHANCE_RESIST_PUSHBACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_DIMINISHING_RETURNS_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_IGNORE_DIMINISHING_RETURNS_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_KEEP_ALIVE, STATUS_NEVER, PROCESS_THREADUNSAFE, &WorldSession::Handle_EarlyProccess ); - //DEFINE_OPCODE_HANDLER(SMSG_RAID_READY_CHECK_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_OPT_OUT_OF_LOOT, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleOptOutOfLootOpcode ); - //DEFINE_OPCODE_HANDLER(MSG_QUERY_GUILD_BANK_TEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryGuildBankTabText ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_GUILD_BANK_TEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetGuildBankTabText ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_GRANTABLE_LEVELS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_GRANT_LEVEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGrantLevel ); - //DEFINE_OPCODE_HANDLER(CMSG_REFER_A_FRIEND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_GM_CHANGE_ARENA_RATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_DECLINE_CHANNEL_INVITE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleChannelDeclineInvite ); - //DEFINE_OPCODE_HANDLER(SMSG_GROUPACTION_THROTTLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_OVERRIDE_LIGHT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_TOTEM_CREATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_TOTEM_DESTROYED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTotemDestroyed ); - //DEFINE_OPCODE_HANDLER(CMSG_EXPIRE_RAID_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_NO_SPELL_VARIANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverStatusMultipleQuery); - DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_STATUS_MULTIPLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_PLAYER_DECLINED_NAMES, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetPlayerDeclinedNames ); - //DEFINE_OPCODE_HANDLER(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_QUERY_SERVER_BUCK_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_SERVER_BUCK_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_SERVER_BUCK_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SEND_UNLEARN_SPELLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PROPOSE_LEVEL_GRANT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_ACCEPT_LEVEL_GRANT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAcceptGrantLevel ); - //DEFINE_OPCODE_HANDLER(SMSG_REFER_A_FRIEND_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FLYING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_UNSET_FLYING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SUMMON_CANCEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANGE_PERSONAL_ARENA_RATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_ALTER_APPEARANCE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAlterAppearance ); - DEFINE_OPCODE_HANDLER(SMSG_ENABLE_BARBER_SHOP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_BARBER_SHOP_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_GET_CALENDAR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGetCalendar ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_GET_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGetEvent ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_GUILD_FILTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGuildFilter ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_ARENA_TEAM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarArenaTeam ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_ADD_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarAddEvent ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_UPDATE_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarUpdateEvent ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_REMOVE_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarRemoveEvent ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_COPY_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarCopyEvent ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventInvite ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_RSVP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventRsvp ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_REMOVE_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventRemoveInvite ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_STATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventStatus ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_MODERATOR_STATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventModeratorStatus); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_SEND_CALENDAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_SEND_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_FILTER_GUILD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_ARENA_TEAM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_REMOVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_RAID_LOCKOUT_ADDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_RAID_LOCKOUT_REMOVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_REMOVED_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_STATUS_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_REMOVED_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_UPDATED_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_MODERATOR_STATUS_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_COMPLAIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarComplain ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_GET_NUM_PENDING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGetNumPending ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_SEND_NUM_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_SAVE_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_NOTIFY_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_PLAY_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_PLAY_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_LOAD_DANCES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_STOP_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_STOP_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_SYNC_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_DANCE_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_DANCE_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_INVALIDATE_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_DELETE_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(SMSG_LEARNED_DANCE_MOVES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_LEARN_DANCE_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_DANCE_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_RUNE_COUNT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_RUNE_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_PITCH_RATE_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_PITCH_RATE_CHANGE_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_INVITE_NOTES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_NOTES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_NOTES_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_UPDATE_MISSILE_TRAJECTORY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateMissileTrajectory ); - DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ACCOUNT_DATA_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_TRIGGER_MOVIE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_COMPLETE_MOVIE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_GLYPH_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_GLYPH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(SMSG_ACHIEVEMENT_EARNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DYNAMIC_DROP_ROLL_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CRITERIA_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_QUERY_INSPECT_ACHIEVEMENTS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryInspectAchievements ); - //DEFINE_OPCODE_HANDLER(SMSG_RESPOND_INSPECT_ACHIEVEMENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_DISMISS_CONTROLLED_VEHICLE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDismissControlledVehicle ); - //DEFINE_OPCODE_HANDLER(CMSG_COMPLETE_ACHIEVEMENT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_ADD_PVP_KILL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_CRITERIA_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_RAID_LOCKOUT_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_UNITANIMTIER_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CHAR_CUSTOMIZE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharCustomize ); - //DEFINE_OPCODE_HANDLER(SMSG_CHAR_CUSTOMIZE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_RENAMEABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_EXIT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestVehicleExit ); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_PREV_SEAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_NEXT_SEAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_SWITCH_SEAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); - DEFINE_OPCODE_HANDLER(CMSG_PET_LEARN_TALENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetLearnTalent ); - //DEFINE_OPCODE_HANDLER(CMSG_PET_UNLEARN_TALENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_SET_PHASE_SHIFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_ALL_ACHIEVEMENT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_ACHIEVEMENT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_FORCE_SAY_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_HEALTH_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_POWER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJ_REPORT_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGameobjectReportUse ); - DEFINE_OPCODE_HANDLER(SMSG_HIGHEST_THREAT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_THREAT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_THREAT_REMOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_THREAT_CLEAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CONVERT_RUNE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_RESYNC_RUNES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ADD_RUNE_POWER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_START_QUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_REMOVE_GLYPH, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRemoveGlyph ); - //DEFINE_OPCODE_HANDLER(CMSG_DUMP_OBJECTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_DUMP_OBJECTS_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_DISMISS_CRITTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDismissCritter ); - //DEFINE_OPCODE_HANDLER(SMSG_NOTIFY_DEST_LOC_SPELL_CAST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_PENDING_SALES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListPendingSales ); - //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_LIST_PENDING_SALES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MODIFY_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PET_UPDATE_COMBO_POINTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_ENABLETAXI, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleTaxiQueryAvailableNodes ); - DEFINE_OPCODE_HANDLER(SMSG_PRE_RESURRECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_AURA_UPDATE_ALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_AURA_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_FLOOD_GRACE_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_SERVER_FIRST_ACHIEVEMENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PET_LEARNED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_REMOVED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); - DEFINE_OPCODE_HANDLER(CMSG_HEARTH_AND_RESURRECT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleHearthAndResurrect ); - //DEFINE_OPCODE_HANDLER(SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CRITERIA_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ACHIEVEMENT_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_SERVER_INFO_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_SERVER_INFO_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_CHECK_LOGIN_CRITERIA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_SERVER_BUCK_DATA_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_BREATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_QUERY_VEHICLE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_INFO_THROTTLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PLAYER_VEHICLE_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_PLAYER_VEHICLE_ENTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEnterPlayerVehicle ); - //DEFINE_OPCODE_HANDLER(CMSG_CONTROLLER_EJECT_PASSENGER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEjectPassenger ); - DEFINE_OPCODE_HANDLER(SMSG_PET_GUIDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CLIENTCACHE_VERSION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANGE_GDF_ARENA_RATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_ARENA_TEAM_RATING_BY_INDEX, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_ARENA_TEAM_WEEKLY_GAMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_ARENA_TEAM_SEASON_GAMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_ARENA_MEMBER_WEEKLY_GAMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_ARENA_MEMBER_SEASON_GAMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_ITEM_REFUND_INFO_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_ITEM_REFUND_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemRefundInfoRequest ); - //DEFINE_OPCODE_HANDLER(CMSG_ITEM_REFUND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemRefund ); - //DEFINE_OPCODE_HANDLER(SMSG_ITEM_REFUND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_CORPSE_MAP_POSITION_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCorpseMapPositionQuery ); - //DEFINE_OPCODE_HANDLER(SMSG_CORPSE_MAP_POSITION_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_UNUSED5, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_UNUSED6, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_SIGNUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_CLEAR_PENDING_ACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_EQUIPMENT_SET_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_EQUIPMENT_SET_SAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetSave ); - //DEFINE_OPCODE_HANDLER(CMSG_UPDATE_PROJECTILE_POSITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateProjectilePosition ); - //DEFINE_OPCODE_HANDLER(SMSG_SET_PROJECTILE_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_TALENTS_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_TALENTS_INVOLUNTARILY_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_LEARN_PREVIEW_TALENTS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnPreviewTalents ); - DEFINE_OPCODE_HANDLER(CMSG_LEARN_PREVIEW_TALENTS_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnPreviewTalentsPet ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIVE_TALENT_GROUP_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_GRANT_ACHIEVEMENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_REMOVE_ACHIEVEMENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_SET_CRITERIA_FOR_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_ARENA_OPPONENT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_CHANGE_FAILED_QUEUED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_PROFILEDATA_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_PROFILEDATA_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_START_BATTLEFIELD_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_END_BATTLEFIELD_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_MULTIPLE_PACKETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_GRAVITY_DISABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_GRAVITY_DISABLE_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_GRAVITY_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_GRAVITY_ENABLE_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_GRAVITY_CHNG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_GRAVITY_DISABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_GRAVITY_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_EQUIPMENT_SET_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetUse ); - //DEFINE_OPCODE_HANDLER(SMSG_EQUIPMENT_SET_USE_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_FORCE_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_FORCE_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_CHAR_FACTION_CHANGE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharFactionOrRaceChange ); - //DEFINE_OPCODE_HANDLER(SMSG_CHAR_FACTION_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_PVP_QUEUE_STATS_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_PVP_QUEUE_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_PAID_SERVICE_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_ENTRY_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_ENTRY_INVITE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_ENTERED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_QUEUE_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_QUEUE_INVITE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_QUEUE_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_EJECT_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_EJECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_EXIT_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_STATE_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MANAGER_ADVANCE_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MANAGER_SET_NEXT_TRANSITION_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_SET_RAID_DIFFICULTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetRaidDifficultyOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_TOGGLE_XP_GAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_TOGGLE_XP_GAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GMRESPONSE_DB_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GMRESPONSE_RECEIVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_GMRESPONSE_RESOLVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMResponseResolve ); - //DEFINE_OPCODE_HANDLER(SMSG_GMRESPONSE_STATUS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GMRESPONSE_CREATE_TICKET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_GMRESPONSE_CREATE_TICKET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SERVERINFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_SERVERINFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_WORLD_STATE_UI_TIMER_UPDATE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleWorldStateUITimerUpdate ); - DEFINE_OPCODE_HANDLER(SMSG_WORLD_STATE_UI_TIMER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_CHAR_RACE_CHANGE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharFactionOrRaceChange ); - //DEFINE_OPCODE_HANDLER(MSG_VIEW_PHASE_SHIFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_TALENTS_INVOLUNTARILY_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_SERVER_GEO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_DEBUG_SERVER_GEO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LOOT_SLOT_CHANGED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(UMSG_UPDATE_GROUP_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_READY_FOR_ACCOUNT_DATA_TIMES, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleReadyForAccountDataTimes ); - DEFINE_OPCODE_HANDLER(CMSG_QUERY_QUESTS_COMPLETED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryQuestsCompleted ); - //DEFINE_OPCODE_HANDLER(SMSG_QUERY_QUESTS_COMPLETED_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_GM_REPORT_LAG, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReportLag ); - //DEFINE_OPCODE_HANDLER(CMSG_AFK_MONITOR_INFO_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_AFK_MONITOR_INFO_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_AFK_MONITOR_INFO_CLEAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - ////DEFINE_OPCODE_HANDLER(SMSG_CORPSE_IS_NOT_IN_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_NUKE_CHARACTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_ALLOW_LOW_LEVEL_RAID1, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_ALLOW_LOW_LEVEL_RAID2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(SMSG_CAMERA_SHAKE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ITEM_ENCHANTMENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_CHARACTER_MODEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_REDIRECT_CLIENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_REDIRECTION_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_SUSPEND_COMMS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_SUSPEND_COMMS_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(SMSG_FORCE_SEND_QUEUED_PACKETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_REDIRECTION_AUTH_PROOF, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_DROP_NEW_CONNECTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_SEND_ALL_COMBAT_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_OPEN_LFG_DUNGEON_FINDER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_COLLISION_HEIGHT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_COLLISION_HGT_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_COLLISION_HGT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_RANDOM_BG_WIN_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_HOLIDAY_BG_WIN_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_SKIRMISH_QUEUE_COMMAND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_SKIRMISH_QUEUE_RESULT1, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_SKIRMISH_QUEUE_RESULT2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_UNKNOWN_1310, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(MSG_VERIFY_CONNECTIVITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); - //DEFINE_OPCODE_HANDLER(CMSG_LOG_DISCONNECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); - DEFINE_OPCODE_HANDLER(CMSG_RETURN_TO_GRAVEYARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReturnToGraveyard ); - DEFINE_OPCODE_HANDLER(CMSG_RANDOMIZE_CHAR_NAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRandomizeCharNameOpcode ); - DEFINE_OPCODE_HANDLER(SMSG_RANDOMIZE_CHAR_NAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PLAYER_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(CMSG_REQUEST_HOTFIX, STATUS_AUTHED, PROCESS_INPLACE, &WorldSession::HandleRequestHotfix ); - DEFINE_OPCODE_HANDLER(SMSG_HOTFIX_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_REQUEST_SCORE_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); Need to send the response - DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_SETQUEUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_ACCEPT_LEVEL_GRANT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAcceptGrantLevel ); + //DEFINE_OPCODE_HANDLER(CMSG_ACCEPT_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAcceptTradeOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_ACTIVATETAXI, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleActivateTaxiOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_ACTIVATETAXIEXPRESS, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleActivateTaxiExpressOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_ACTIVE_PVP_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_ADD_FRIEND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddFriendOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_ADD_IGNORE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddIgnoreOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_ADD_PVP_MEDAL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_ADD_VOICE_IGNORE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_ADVANCE_SPAWN_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_AFK_MONITOR_INFO_CLEAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_AFK_MONITOR_INFO_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_ALTER_APPEARANCE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAlterAppearance ); + //DEFINE_OPCODE_HANDLER(CMSG_AREATRIGGER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaTriggerOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_AREA_SPIRIT_HEALER_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaSpiritHealerQueryOpcode); + //DEFINE_OPCODE_HANDLER(CMSG_AREA_SPIRIT_HEALER_QUEUE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaSpiritHealerQueueOpcode); + //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamAcceptOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_CREATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamDeclineOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_DISBAND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamDisbandOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamInviteOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamLeaderOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamLeaveOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamQueryOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_REMOVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamRemoveOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_ROSTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamRosterOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_ATTACKSTOP, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleAttackStopOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_ATTACKSWING, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleAttackSwingOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_BIDDER_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListBidderItems ); + //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListItems ); + //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_OWNER_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListOwnerItems ); + //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_PENDING_SALES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListPendingSales ); + //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_PLACE_BID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionPlaceBid ); + //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_REMOVE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionRemoveItem ); + //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_SELL_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionSellItem ); + DEFINE_OPCODE_HANDLER(CMSG_AUTH_SESSION, STATUS_NEVER, PROCESS_THREADUNSAFE, &WorldSession::Handle_EarlyProccess ); + //DEFINE_OPCODE_HANDLER(CMSG_AUTH_SRP6_BEGIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_AUTH_SRP6_PROOF, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_AUTH_SRP6_RECODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_AUTOBANK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoBankItemOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_AUTOEQUIP_GROUND_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_AUTOEQUIP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoEquipItemOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_AUTOEQUIP_ITEM_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoEquipItemSlotOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_BAG_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoStoreBagItemOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_BANK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoStoreBankItemOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_GROUND_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_LOOT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutostoreLootItemOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_BANKER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBankerActivateOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_JOIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlefieldListOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MANAGER_ADVANCE_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MANAGER_SET_NEXT_TRANSITION_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_ENTRY_INVITE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_EXIT_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_QUEUE_INVITE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_QUEUE_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_PORT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattleFieldPortOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_REQUEST_SCORE_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); Need to send the response + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_STATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlefieldStatusOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlemasterHelloOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_JOIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlemasterJoinOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_JOIN_ARENA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlemasterJoinArena ); + //DEFINE_OPCODE_HANDLER(CMSG_BEASTMASTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_BEGIN_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBeginTradeOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_BINDER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBinderActivateOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_BOOTME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_BOT_DETECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_BOT_DETECTED2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_BUG, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBugOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_BUSY_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBusyTradeOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_BUYBACK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuybackItem ); + //DEFINE_OPCODE_HANDLER(CMSG_BUY_BANK_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyBankSlotOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_BUY_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyItemOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_BUY_ITEM_IN_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyItemInSlotOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_BUY_LOTTERY_TICKET_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_BUY_STABLE_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyStableSlot ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_ADD_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarAddEvent ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_ARENA_TEAM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarArenaTeam ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_COMPLAIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarComplain ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_COPY_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarCopyEvent ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventInvite ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_INVITE_NOTES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_MODERATOR_STATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventModeratorStatus); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_REMOVE_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventRemoveInvite ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_RSVP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventRsvp ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_SIGNUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_STATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventStatus ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_GET_CALENDAR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGetCalendar ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_GET_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGetEvent ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_GET_NUM_PENDING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGetNumPending ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_GUILD_FILTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGuildFilter ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_REMOVE_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarRemoveEvent ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_UPDATE_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarUpdateEvent ); + //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelAuraOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_AUTO_REPEAT_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelAutoRepeatSpellOpcode); + //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_CAST, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleCancelCastOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_CHANNELLING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelChanneling ); + //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_GROWTH_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelGrowthAuraOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_MOUNT_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelMountAuraOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_TEMP_ENCHANTMENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelTempEnchantmentOpcode); + //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_TRADE, STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelTradeOpcode); + //DEFINE_OPCODE_HANDLER(CMSG_CAST_SPELL, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleCastSpellOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANGEPLAYER_DIFFICULTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANGE_GDF_ARENA_RATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANGE_PERSONAL_ARENA_RATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_ANNOUNCEMENTS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelAnnouncements ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_BAN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelBan ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_DISPLAY_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelDisplayListQuery ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelInvite ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_KICK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelKick ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelList ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_MODERATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_MODERATOR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelModerator ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_MUTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelMute ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_OWNER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelOwner ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_PASSWORD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelPassword ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_SET_OWNER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelSetOwner ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_SILENCE_ALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_SILENCE_VOICE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNBAN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelUnban ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNMODERATOR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelUnmoderator ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNMUTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelUnmute ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNSILENCE_ALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNSILENCE_VOICE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_VOICE_OFF, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_VOICE_ON, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelVoiceOnOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_CHARACTER_POINT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHAR_CREATE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharCreateOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_CHAR_CUSTOMIZE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharCustomize ); + //DEFINE_OPCODE_HANDLER(CMSG_CHAR_DELETE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharDeleteOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_CHAR_ENUM, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharEnumOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_CHAR_FACTION_CHANGE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharFactionOrRaceChange ); + //DEFINE_OPCODE_HANDLER(CMSG_CHAR_RACE_CHANGE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharFactionOrRaceChange ); + //DEFINE_OPCODE_HANDLER(CMSG_CHAR_RENAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharRenameOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_CHAT_FILTERED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHAT_IGNORED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChatIgnoredOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_PLAYER_LOGIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_PLAYER_LOOKUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_SETMONEY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_SET_ARENA_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_SET_HONOR_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHECK_LOGIN_CRITERIA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_CHANNEL_WATCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_EXPLORATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_HOLIDAY_BG_WIN_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_QUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_RANDOM_BG_WIN_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_SERVER_BUCK_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_TRADE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleClearTradeItemOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_ENTER_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_EXIT_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_GET_MAP_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_GET_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_INSTANCE_COMMAND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_SKIRMISH_QUEUE_COMMAND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_COMPLAIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleComplainOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_COMPLETE_ACHIEVEMENT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_COMPLETE_CINEMATIC, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCompleteCinematic ); + //DEFINE_OPCODE_HANDLER(CMSG_COMPLETE_MOVIE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CONTACT_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleContactListOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_CONTROLLER_EJECT_PASSENGER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEjectPassenger ); + //DEFINE_OPCODE_HANDLER(CMSG_COOLDOWN_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CORPSE_MAP_POSITION_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCorpseMapPositionQuery ); + //DEFINE_OPCODE_HANDLER(CMSG_CREATEGAMEOBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CREATEITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CREATEMONSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CREATURE_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleCreatureQueryOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_DANCE_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DBLOOKUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_ACTIONS_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_ACTIONS_STOP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_AISTATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_CHANGECELLZONE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_LIST_TARGETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_PASSIVE_AURA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_SERVER_GEO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DECHARGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DECLINE_CHANNEL_INVITE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleChannelDeclineInvite ); + //DEFINE_OPCODE_HANDLER(CMSG_DELETE_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DEL_FRIEND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDelFriendOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_DEL_IGNORE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDelIgnoreOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_DEL_PVP_MEDAL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DEL_VOICE_IGNORE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DESTROYITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDestroyItemOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_DESTROYMONSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DESTROY_ITEMS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DISABLE_PVP_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DISMISS_CONTROLLED_VEHICLE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDismissControlledVehicle ); + //DEFINE_OPCODE_HANDLER(CMSG_DISMISS_CRITTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDismissCritter ); + //DEFINE_OPCODE_HANDLER(CMSG_DROP_NEW_CONNECTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DUEL_ACCEPTED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDuelAcceptedOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_DUEL_CANCELLED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDuelCancelledOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_DUMP_OBJECTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEmoteOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_ENABLETAXI, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleTaxiQueryAvailableNodes ); + //DEFINE_OPCODE_HANDLER(CMSG_ENABLE_DAMAGE_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_END_BATTLEFIELD_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_EQUIPMENT_SET_DELETE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetDelete ); + //DEFINE_OPCODE_HANDLER(CMSG_EQUIPMENT_SET_SAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetSave ); + //DEFINE_OPCODE_HANDLER(CMSG_EQUIPMENT_SET_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetUse ); + //DEFINE_OPCODE_HANDLER(CMSG_EXPIRE_RAID_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_FAR_SIGHT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleFarSightOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_FLAG_QUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_FLAG_QUEST_FINISH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_FLOOD_GRACE_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_FORCEACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_FORCEACTIONONOTHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_FORCEACTIONSHOW, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_FORCE_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_FORCE_MOVE_ROOT_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveRootAck ); + //DEFINE_OPCODE_HANDLER(CMSG_FORCE_MOVE_UNROOT_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveUnRootAck ); + //DEFINE_OPCODE_HANDLER(CMSG_FORCE_SAY_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJECT_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleGameObjectQueryOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJ_REPORT_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGameobjectReportUse ); + //DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJ_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGameObjectUseOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GAMESPEED_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GAMETIME_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GETDEATHBINDZONE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GET_CHANNEL_MEMBER_COUNT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGetChannelMemberCount ); + //DEFINE_OPCODE_HANDLER(CMSG_GET_MAIL_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGetMailList ); + //DEFINE_OPCODE_HANDLER(CMSG_GET_MIRRORIMAGE_DATA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMirrorImageDataRequest ); + //DEFINE_OPCODE_HANDLER(CMSG_GHOST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GMRESPONSE_CREATE_TICKET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GMRESPONSE_RESOLVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMResponseResolve ); + //DEFINE_OPCODE_HANDLER(CMSG_GMSURVEY_SUBMIT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMSurveySubmit ); + //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_CREATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketCreateOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_DELETETICKET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketDeleteOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_GETTICKET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketGetTicketOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_SYSTEMSTATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketSystemStatusOpcode); + //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_UPDATETEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketUpdateOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_CHARACTER_RESTORE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_CHARACTER_SAVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_CREATE_ITEM_TARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_DESTROY_ONLINE_CORPSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_FREEZE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_GRANT_ACHIEVEMENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_INVIS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_MOVECORPSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_NUKE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_NUKE_ACCOUNT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_NUKE_CHARACTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_REMOVE_ACHIEVEMENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_REPORT_LAG, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReportLag ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_REQUEST_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_RESURRECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_REVEALTO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_SET_CRITERIA_FOR_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_SET_SECURITY_GROUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_SHOW_COMPLAINTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_SILENCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_SUMMONMOB, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_TEACH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_UBERINVIS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_UNSQUELCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_UNTEACH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_UPDATE_TICKET_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_VISION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_WHISPER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GODMODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GOSSIP_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGossipHelloOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GOSSIP_SELECT_OPTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGossipSelectOptionOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GRANT_LEVEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGrantLevel ); + //DEFINE_OPCODE_HANDLER(CMSG_GROUP_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupAcceptOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GROUP_ASSISTANT_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupAssistantLeaderOpcode); + //DEFINE_OPCODE_HANDLER(CMSG_GROUP_CANCEL, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GROUP_CHANGE_SUB_GROUP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupChangeSubGroupOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GROUP_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupDeclineOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GROUP_DISBAND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupDisbandOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GROUP_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupInviteOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GROUP_RAID_CONVERT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupRaidConvertOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GROUP_SET_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupSetLeaderOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GROUP_SWAP_SUB_GROUP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupSwapSubGroupOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GROUP_UNINVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupUninviteOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GROUP_UNINVITE_GUID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupUninviteGuidOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildAcceptOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_ADD_RANK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildAddRankOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANKER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankerActivate ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_BUY_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankBuyTab ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_DEPOSIT_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankDepositMoney ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_QUERY_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankQueryTab ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_SWAP_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankSwapItems ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_UPDATE_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankUpdateTab ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_WITHDRAW_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankWithdrawMoney ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_CREATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildCreateOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDeclineOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_DEL_RANK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDelRankOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_DEMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDemoteOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_DISBAND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDisbandOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildInfoOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_INFO_TEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildChangeInfoTextOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildInviteOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildLeaderOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildLeaveOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_MOTD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildMOTDOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_PROMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildPromoteOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_QUERY, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildQueryOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_RANK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildRankOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_REMOVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildRemoveOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_ROSTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildRosterOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_SET_OFFICER_NOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildSetOfficerNoteOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_SET_PUBLIC_NOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildSetPublicNoteOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_HEARTH_AND_RESURRECT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleHearthAndResurrect ); + //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_DIMINISHING_RETURNS_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_KNOCKBACK_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_REQUIREMENTS_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleIgnoreTradeOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_INITIATE_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInitiateTradeOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_INSPECT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_INSTANCE_LOCK_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInstanceLockResponse ); + //DEFINE_OPCODE_HANDLER(CMSG_ITEM_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemNameQueryOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_ITEM_REFUND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemRefund ); + //DEFINE_OPCODE_HANDLER(CMSG_ITEM_REFUND_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemRefundInfoRequest ); + //DEFINE_OPCODE_HANDLER(CMSG_ITEM_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemTextQuery ); + //DEFINE_OPCODE_HANDLER(CMSG_JOIN_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleJoinChannel ); + //DEFINE_OPCODE_HANDLER(CMSG_KEEP_ALIVE, STATUS_NEVER, PROCESS_THREADUNSAFE, &WorldSession::Handle_EarlyProccess ); + //DEFINE_OPCODE_HANDLER(CMSG_LEARN_DANCE_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LEARN_PREVIEW_TALENTS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnPreviewTalents ); + //DEFINE_OPCODE_HANDLER(CMSG_LEARN_PREVIEW_TALENTS_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnPreviewTalentsPet ); + //DEFINE_OPCODE_HANDLER(CMSG_LEARN_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LEARN_TALENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnTalentOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_LEAVE_BATTLEFIELD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLeaveBattlefieldOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_LEAVE_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLeaveChannel ); + //DEFINE_OPCODE_HANDLER(CMSG_LEVEL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LFD_PARTY_LOCK_INFO_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgPartyLockInfoRequestOpcode); + //DEFINE_OPCODE_HANDLER(CMSG_LFD_PLAYER_LOCK_INFO_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgPlayerLockInfoRequestOpcode); + //DEFINE_OPCODE_HANDLER(CMSG_LFG_GET_STATUS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LFG_JOIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgJoinOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_LFG_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgLeaveOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_LFG_PROPOSAL_RESULT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgProposalResultOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_BOOT_VOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetBootVoteOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_NEEDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_ROLES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetRolesOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_LFG_TELEPORT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgTeleportOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_LIST_INVENTORY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleListInventoryOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_LOAD_DANCES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LOAD_SCREEN, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleLoadScreenOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_LOGOUT_CANCEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLogoutCancelOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_LOGOUT_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLogoutRequestOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_LOG_DISCONNECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); + //DEFINE_OPCODE_HANDLER(CMSG_LOOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_LOOT_MASTER_GIVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMasterGiveOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_LOOT_METHOD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMethodOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_LOOT_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMoneyOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_LOOT_RELEASE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootReleaseOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_LOOT_ROLL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootRoll ); + //DEFINE_OPCODE_HANDLER(CMSG_LOTTERY_QUERY_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LUA_USAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MAELSTROM_GM_SENT_MAIL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MAELSTROM_INVALIDATE_CACHE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MAELSTROM_RENAME_GUILD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MAIL_CREATE_TEXT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailCreateTextItem ); + //DEFINE_OPCODE_HANDLER(CMSG_MAIL_DELETE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailDelete ); + //DEFINE_OPCODE_HANDLER(CMSG_MAIL_MARK_AS_READ, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailMarkAsRead ); + //DEFINE_OPCODE_HANDLER(CMSG_MAIL_RETURN_TO_SENDER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailReturnToSender ); + //DEFINE_OPCODE_HANDLER(CMSG_MAIL_TAKE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailTakeItem ); + //DEFINE_OPCODE_HANDLER(CMSG_MAIL_TAKE_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailTakeMoney ); + //DEFINE_OPCODE_HANDLER(CMSG_MAKEMONSTERATTACKGUID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MEETINGSTONE_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_BATTLEGROUND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_GUILD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_PARTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_RAID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_WHISPER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_AFK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_BATTLEGROUND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_BATTLEGROUND_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_DND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_GUILD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_OFFICER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_PARTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_PARTY_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_RAID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_RAID_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_RAID_WARNING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_SAY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_WHISPER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_YELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_MINIGAME_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOUNTSPECIAL_ANIM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMountSpecialAnimOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_CHARACTER_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_CHARM_PORT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_CHNG_TRANSPORT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FALL_RESET, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FEATHER_FALL_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleFeatherFallAck ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_FLIGHT_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_PITCH_RATE_CHANGE_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_RUN_BACK_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_RUN_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_SWIM_BACK_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_SWIM_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_TURN_RATE_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_WALK_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_GRAVITY_DISABLE_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_GRAVITY_ENABLE_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_HOVER_ACK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMoveHoverAck ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_KNOCK_BACK_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveKnockBackAck ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_NOT_ACTIVE_MOVER, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveNotActiveMover ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_CAN_FLY_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveSetCanFlyAckOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_COLLISION_HGT_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_FLY, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_RELATIVE_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SPLINE_DONE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveSplineDoneOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_START_SWIM_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_STOP_SWIM_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_TELEPORT_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveTeleportAck ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_TELEPORT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_TIME_SKIPPED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleMoveTimeSkippedOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_WATER_WALK_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveWaterWalkAck ); + //DEFINE_OPCODE_HANDLER(CMSG_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNameQueryOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_NEW_SPELL_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_NEXT_CINEMATIC_CAMERA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNextCinematicCamera ); + //DEFINE_OPCODE_HANDLER(CMSG_NO_SPELL_VARIANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_NPC_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNpcTextQueryOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_OFFER_PETITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleOfferPetitionOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_OPENING_CINEMATIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_OPEN_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleOpenItemOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_OPT_OUT_OF_LOOT, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleOptOutOfLootOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_PAGE_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePageTextQueryOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_PARTY_SILENCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_PARTY_UNSILENCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_PERFORM_ACTION_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_PETGODMODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_PETITION_BUY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionBuyOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_PETITION_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionQueryOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_PETITION_SHOWLIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionShowListOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_PETITION_SHOW_SIGNATURES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionShowSignOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_PETITION_SIGN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionSignOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_PET_ABANDON, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetAbandon ); + //DEFINE_OPCODE_HANDLER(CMSG_PET_ACTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetAction ); + //DEFINE_OPCODE_HANDLER(CMSG_PET_CANCEL_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetCancelAuraOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_PET_CAST_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetCastSpellOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_PET_LEARN_TALENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetLearnTalent ); + //DEFINE_OPCODE_HANDLER(CMSG_PET_LEVEL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_PET_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetNameQuery ); + //DEFINE_OPCODE_HANDLER(CMSG_PET_RENAME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetRename ); + //DEFINE_OPCODE_HANDLER(CMSG_PET_SET_ACTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetSetAction ); + //DEFINE_OPCODE_HANDLER(CMSG_PET_SPELL_AUTOCAST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetSpellAutocastOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_PET_STOP_ATTACK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetStopAttack ); + //DEFINE_OPCODE_HANDLER(CMSG_PET_UNLEARN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_PET_UNLEARN_TALENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_PING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); + //DEFINE_OPCODE_HANDLER(CMSG_PLAYED_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayedTime ); + //DEFINE_OPCODE_HANDLER(CMSG_PLAYER_AI_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_PLAYER_LOGIN, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayerLoginOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_PLAYER_LOGOUT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayerLogoutOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_PLAYER_VEHICLE_ENTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEnterPlayerVehicle ); + //DEFINE_OPCODE_HANDLER(CMSG_PLAY_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_PROFILEDATA_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_PUSHQUESTTOPARTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePushQuestToParty ); + //DEFINE_OPCODE_HANDLER(CMSG_PVP_QUEUE_STATS_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_XP, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildQueryXPOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_QUERY_INSPECT_ACHIEVEMENTS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryInspectAchievements ); + //DEFINE_OPCODE_HANDLER(CMSG_QUERY_OBJECT_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_QUERY_OBJECT_ROTATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_QUERY_QUESTS_COMPLETED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryQuestsCompleted ); + //DEFINE_OPCODE_HANDLER(CMSG_QUERY_SERVER_BUCK_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_QUERY_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryTimeOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_QUERY_VEHICLE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_ACCEPT_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverAcceptQuestOpcode); + //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_CANCEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverCancel ); + //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_CHOOSE_REWARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverChooseRewardOpcode); + //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_COMPLETE_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverCompleteQuest ); + //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverHelloOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_QUERY_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverQueryQuestOpcode); + //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_QUEST_AUTOLAUNCH, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverQuestAutoLaunch ); + //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_REQUEST_REWARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverRequestRewardOpcode); + //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverStatusMultipleQuery); + //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_STATUS_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleQuestgiverStatusQueryOpcode); + //DEFINE_OPCODE_HANDLER(CMSG_QUESTLOG_REMOVE_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestLogRemoveQuest ); + //DEFINE_OPCODE_HANDLER(CMSG_QUESTLOG_SWAP_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestLogSwapQuest ); + //DEFINE_OPCODE_HANDLER(CMSG_QUEST_CONFIRM_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestConfirmAccept ); + //DEFINE_OPCODE_HANDLER(CMSG_QUEST_POI_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestPOIQuery ); + //DEFINE_OPCODE_HANDLER(CMSG_QUEST_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestQueryOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_RANDOMIZE_CHAR_NAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRandomizeCharNameOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_READY_FOR_ACCOUNT_DATA_TIMES, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleReadyForAccountDataTimes ); + //DEFINE_OPCODE_HANDLER(CMSG_READ_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReadItem ); + //DEFINE_OPCODE_HANDLER(CMSG_REALM_SPLIT, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRealmSplitOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_RECHARGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_RECLAIM_CORPSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReclaimCorpseOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_REDIRECTION_AUTH_PROOF, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_REDIRECTION_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_REFER_A_FRIEND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_REMOVE_GLYPH, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRemoveGlyph ); + //DEFINE_OPCODE_HANDLER(CMSG_REPAIR_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepairItemOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_REPOP_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepopRequestOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_REPORT_PVP_AFK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReportPvPAFK ); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_ACCOUNT_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestAccountData ); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_HOTFIX, STATUS_AUTHED, PROCESS_INPLACE, &WorldSession::HandleRequestHotfix ); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PARTY_MEMBER_STATS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestPartyMemberStatsOpcode); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PET_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestPetInfoOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RAID_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestRaidInfoOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_EXIT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestVehicleExit ); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_NEXT_SEAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_PREV_SEAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_SWITCH_SEAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); + //DEFINE_OPCODE_HANDLER(CMSG_RESET_FACTION_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_RESET_INSTANCES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleResetInstancesOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_RESURRECT_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleResurrectResponseOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_RETURN_TO_GRAVEYARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReturnToGraveyard ); + //DEFINE_OPCODE_HANDLER(CMSG_RUN_SCRIPT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SAVE_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SAVE_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SEARCH_LFG_JOIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfrSearchOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_SEARCH_LFG_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfrLeaveOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_SELF_RES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSelfResOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_SELL_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSellItemOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_SEND_COMBAT_TRIGGER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SEND_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SEND_GENERAL_TRIGGER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SEND_LOCAL_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SEND_MAIL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSendMail ); + //DEFINE_OPCODE_HANDLER(CMSG_SERVERINFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SERVERTIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SERVER_BROADCAST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SERVER_COMMAND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SERVER_INFO_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SETDEATHBINDPOINT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SETSHEATHED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleSetSheathedOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIONBAR_TOGGLES, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActionBarToggles ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_ACTION_BUTTON, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActionButtonOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIVE_MOVER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActiveMoverOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIVE_TALENT_GROUP_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIVE_VOICE_CHANNEL, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActiveVoiceChannel ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_ALLOW_LOW_LEVEL_RAID1, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_ALLOW_LOW_LEVEL_RAID2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_ARENA_MEMBER_SEASON_GAMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_ARENA_MEMBER_WEEKLY_GAMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_ARENA_TEAM_RATING_BY_INDEX, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_ARENA_TEAM_SEASON_GAMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_ARENA_TEAM_WEEKLY_GAMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_BREATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_CHANNEL_WATCH, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetChannelWatch ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_CHARACTER_MODEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_CONTACT_NOTES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetContactNotesOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_CRITERIA_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_DURABILITY_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_EXPLORATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_EXPLORATION_ALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_FACTION_ATWAR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetFactionAtWar ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_FACTION_CHEAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetFactionCheat ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_FACTION_INACTIVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetFactionInactiveOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_GLYPH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_GLYPH_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_GRANTABLE_LEVELS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_GUILD_BANK_TEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetGuildBankTabText ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_LFG_COMMENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetCommentOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_PAID_SERVICE_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_PLAYER_DECLINED_NAMES, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetPlayerDeclinedNames ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_PVP_RANK_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_PVP_TITLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_RUNE_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_RUNE_COUNT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_SAVED_INSTANCE_EXTEND, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_SELECTION, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleSetSelectionOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_SKILL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_STAT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_TAXI_BENCHMARK_MODE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTaxiBenchmarkOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_TITLE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTitleOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_TITLE_SUFFIX, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_TRADE_GOLD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTradeGoldOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_TRADE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTradeItemOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_VEHICLE_REC_ID_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_WATCHED_FACTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetWatchedFactionOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_WORLDSTATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SHOWING_CLOAK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleShowingCloakOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_SHOWING_HELM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleShowingHelmOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_SKILL_BUY_RANK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SKILL_BUY_STEP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SOCKET_GEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSocketOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_SPELLCLICK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSpellClick ); + //DEFINE_OPCODE_HANDLER(CMSG_SPIRIT_HEALER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSpiritHealerActivateOpcode); + //DEFINE_OPCODE_HANDLER(CMSG_SPLIT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSplitItemOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_STABLE_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStablePet ); + //DEFINE_OPCODE_HANDLER(CMSG_STABLE_REVIVE_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStableRevivePet ); + //DEFINE_OPCODE_HANDLER(CMSG_STABLE_SWAP_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStableSwapPet ); + //DEFINE_OPCODE_HANDLER(CMSG_STANDSTATECHANGE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStandStateChangeOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_START_BATTLEFIELD_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_START_QUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_STOP_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_STORE_LOOT_IN_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SUMMON_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSummonResponseOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_SUSPEND_COMMS_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SWAP_INV_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSwapInvItemOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_SWAP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSwapItem ); + //DEFINE_OPCODE_HANDLER(CMSG_SYNC_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_TARGET_CAST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_TARGET_SCRIPT_CAST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_TAXICLEARALLNODES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_TAXICLEARNODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_TAXIENABLEALLNODES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_TAXIENABLENODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_TAXINODE_STATUS_QUERY, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleTaxiNodeStatusQueryOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_TAXIQUERYAVAILABLENODES, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleTaxiQueryAvailableNodes ); + //DEFINE_OPCODE_HANDLER(CMSG_TAXISHOWNODES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_TELEPORT_TO_UNIT, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_TEST_DROP_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_TEXT_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTextEmoteOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_TIME_SYNC_RESP, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleTimeSyncResp ); + //DEFINE_OPCODE_HANDLER(CMSG_TOGGLE_PVP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTogglePvP ); + //DEFINE_OPCODE_HANDLER(CMSG_TOGGLE_XP_GAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_TOTEM_DESTROYED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTotemDestroyed ); + //DEFINE_OPCODE_HANDLER(CMSG_TRAINER_BUY_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerBuySpellOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_TRAINER_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerListOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_TRIGGER_CINEMATIC_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_TURN_IN_PETITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTurnInPetitionOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_CLEAR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialClear ); + //DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_FLAG, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialFlag ); + //DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_RESET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialReset ); + //DEFINE_OPCODE_HANDLER(CMSG_UNACCEPT_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnacceptTradeOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_UNCLAIM_LICENSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_UNDRESSPLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_UNITANIMTIER_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_DANCE_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_SKILL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnlearnSkillOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_TALENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_UNSTABLE_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnstablePet ); + //DEFINE_OPCODE_HANDLER(CMSG_UNUSED5, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_UNUSED6, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_UPDATE_ACCOUNT_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateAccountData ); + //DEFINE_OPCODE_HANDLER(CMSG_UPDATE_MISSILE_TRAJECTORY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateMissileTrajectory ); + //DEFINE_OPCODE_HANDLER(CMSG_UPDATE_PROJECTILE_POSITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateProjectilePosition ); + //DEFINE_OPCODE_HANDLER(CMSG_USE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUseItemOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_USE_SKILL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_VOICE_SESSION_ENABLE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleVoiceSessionEnableOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_VOICE_SET_TALKER_MUTED_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_WARDEN_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleWardenDataOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_WEATHER_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_WHO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWhoOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_WHOIS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWhoisOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_WORLD_PORT_RESPONSE, STATUS_TRANSFER, PROCESS_THREADUNSAFE, &WorldSession::HandleMoveWorldportAckOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_WORLD_STATE_UI_TIMER_UPDATE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleWorldStateUITimerUpdate ); + //DEFINE_OPCODE_HANDLER(CMSG_WORLD_TELEPORT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWorldTeleportOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_WRAP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWrapItemOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_XP_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_ZONEUPDATE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleZoneUpdateOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_ZONE_MAP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_AUCTION_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionHelloOpcode ); + //DEFINE_OPCODE_HANDLER(MSG_BATTLEGROUND_PLAYER_POSITIONS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlegroundPlayerPositionsOpcode); + //DEFINE_OPCODE_HANDLER(MSG_CHANNEL_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_CHANNEL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_CORPSE_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCorpseQueryOpcode ); + //DEFINE_OPCODE_HANDLER(MSG_DELAY_GHOST_TELEPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_DEV_SHOWLABEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_GM_ACCOUNT_ONLINE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_GM_BIND_OTHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_GM_CHANGE_ARENA_RATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_GM_DESTROY_CORPSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_GM_GEARRATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_GM_RESETINSTANCELIMIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_GM_SHOWLABEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_GM_SUMMON, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_GUILD_BANK_LOG_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankLogQuery ); + //DEFINE_OPCODE_HANDLER(MSG_GUILD_BANK_MONEY_WITHDRAWN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankMoneyWithdrawn ); + //DEFINE_OPCODE_HANDLER(MSG_GUILD_EVENT_LOG_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildEventLogQueryOpcode ); + //DEFINE_OPCODE_HANDLER(MSG_GUILD_PERMISSIONS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildPermissions ); + //DEFINE_OPCODE_HANDLER(MSG_INSPECT_ARENA_TEAMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectArenaTeamsOpcode ); + //DEFINE_OPCODE_HANDLER(MSG_INSPECT_HONOR_STATS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectHonorStatsOpcode ); + //DEFINE_OPCODE_HANDLER(MSG_LIST_STABLED_PETS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleListStabledPetsOpcode ); + //DEFINE_OPCODE_HANDLER(MSG_MINIMAP_PING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMinimapPingOpcode ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_FALL_LAND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_FEATHER_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_GRAVITY_CHNG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_HEARTBEAT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_JUMP, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_ALL_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_COLLISION_HGT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_FACING, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_FLIGHT_BACK_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_FLIGHT_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_PITCH, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_PITCH_RATE_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_BACK_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_SWIM_BACK_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_SWIM_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_TURN_RATE_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_WALK_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_ASCEND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_BACKWARD, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_DESCEND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_FORWARD, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_PITCH_DOWN, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_PITCH_UP, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_STRAFE_LEFT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_STRAFE_RIGHT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_SWIM, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_SWIM_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_TURN_LEFT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_TURN_RIGHT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_ASCEND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_PITCH, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_STRAFE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_SWIM, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_SWIM_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_TURN, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_TOGGLE_COLLISION_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_TOGGLE_FALL_LOGGING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_TOGGLE_LOGGING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_UNROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_NOTIFY_PARTY_SQUELCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_NULL_ACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_PARTY_ASSIGNMENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePartyAssignmentOpcode ); + //DEFINE_OPCODE_HANDLER(MSG_PETITION_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionDeclineOpcode ); + //DEFINE_OPCODE_HANDLER(MSG_PETITION_RENAME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionRenameOpcode ); + //DEFINE_OPCODE_HANDLER(MSG_PVP_LOG_DATA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePVPLogDataOpcode ); + //DEFINE_OPCODE_HANDLER(MSG_QUERY_GUILD_BANK_TEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryGuildBankTabText ); + //DEFINE_OPCODE_HANDLER(MSG_QUERY_NEXT_MAIL_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryNextMailTime ); + //DEFINE_OPCODE_HANDLER(MSG_QUEST_PUSH_RESULT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestPushResult ); + //DEFINE_OPCODE_HANDLER(MSG_RAID_READY_CHECK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidReadyCheckOpcode ); + //DEFINE_OPCODE_HANDLER(MSG_RAID_READY_CHECK_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_RAID_READY_CHECK_FINISHED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidReadyCheckFinishedOpcode); + //DEFINE_OPCODE_HANDLER(MSG_RAID_TARGET_UPDATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidTargetUpdateOpcode ); + //DEFINE_OPCODE_HANDLER(MSG_RANDOM_ROLL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRandomRollOpcode ); + //DEFINE_OPCODE_HANDLER(MSG_SAVE_GUILD_EMBLEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSaveGuildEmblemOpcode ); + //DEFINE_OPCODE_HANDLER(MSG_SET_DUNGEON_DIFFICULTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetDungeonDifficultyOpcode); + //DEFINE_OPCODE_HANDLER(MSG_SET_RAID_DIFFICULTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetRaidDifficultyOpcode ); + //DEFINE_OPCODE_HANDLER(MSG_TABARDVENDOR_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTabardVendorActivateOpcode); + //DEFINE_OPCODE_HANDLER(MSG_TALENT_WIPE_CONFIRM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTalentWipeConfirmOpcode ); + //DEFINE_OPCODE_HANDLER(MSG_VERIFY_CONNECTIVITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); + //DEFINE_OPCODE_HANDLER(MSG_VIEW_PHASE_SHIFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(SMSG_ACCOUNT_DATA_TIMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ACHIEVEMENT_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ACHIEVEMENT_EARNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ACTION_BUTTONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ACTIVATETAXIREPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ADDON_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ADD_RUNE_POWER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_AFK_MONITOR_INFO_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_AI_REACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ALL_ACHIEVEMENT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_AREA_SPIRIT_HEALER_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_AREA_TRIGGER_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ARENA_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ARENA_OPPONENT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_CHANGE_FAILED_QUEUED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_ROSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ATTACKERSTATEUPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ATTACKSTART, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ATTACKSTOP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ATTACKSWING_BADFACING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ATTACKSWING_CANT_ATTACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ATTACKSWING_DEADTARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ATTACKSWING_NOTINRANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_BIDDER_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_BIDDER_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_LIST_PENDING_SALES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_OWNER_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_OWNER_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_REMOVED_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_AURACASTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_AURA_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_AURA_UPDATE_ALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_AUTH_CHALLENGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_AUTH_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_AVAILABLE_VOICE_CHANNEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BARBER_SHOP_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_EJECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_EJECT_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_ENTERED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_ENTRY_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_QUEUE_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_STATE_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_PORT_DENIED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_INFO_THROTTLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_PLAYER_JOINED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_PLAYER_LEFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BINDER_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BINDPOINTUPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BINDZONEREPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BREAK_TARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BUY_BANK_SLOT_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BUY_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BUY_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_ARENA_TEAM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_CLEAR_PENDING_ACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_NOTES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_NOTES_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_REMOVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_REMOVED_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_STATUS_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_MODERATOR_STATUS_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_REMOVED_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_UPDATED_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_FILTER_GUILD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_RAID_LOCKOUT_ADDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_RAID_LOCKOUT_REMOVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_RAID_LOCKOUT_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_SEND_CALENDAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_SEND_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_SEND_NUM_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CAMERA_SHAKE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CANCEL_AUTO_REPEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CANCEL_COMBAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CAST_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHANGEPLAYER_DIFFICULTY_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHANNEL_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHANNEL_MEMBER_COUNT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHANNEL_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHARACTER_LOGIN_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHARACTER_PROFILE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHARACTER_PROFILE_REALM_CONNECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHAR_CREATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHAR_CUSTOMIZE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHAR_DELETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHAR_ENUM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHAR_FACTION_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHAR_RENAME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHAT_NOT_IN_PARTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHAT_PLAYER_AMBIGUOUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHAT_PLAYER_NOT_FOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHAT_RESTRICTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHAT_WRONG_FACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY_RESPONSE_WRITE_FILE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHEAT_PLAYER_LOOKUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHECK_FOR_BOTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_EXTRA_AURA_INFO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_FAR_SIGHT_IMMEDIATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_TARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CLIENTCACHE_VERSION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CLIENT_CONTROL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMBAT_EVENT_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_GET_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_MAP_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_SKIRMISH_QUEUE_RESULT1, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_SKIRMISH_QUEUE_RESULT2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_STATE_CHANGED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMPLAIN_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_ACHIEVEMENT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_MOVES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_UNKNOWN_1310, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_UPDATE_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMSAT_CONNECT_FAIL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMSAT_DISCONNECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMSAT_RECONNECT_TRY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CONTACT_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CONVERT_RUNE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COOLDOWN_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COOLDOWN_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CORPSE_IS_NOT_IN_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CORPSE_MAP_POSITION_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CORPSE_RECLAIM_DELAY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CREATURE_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CRITERIA_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CRITERIA_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CROSSED_INEBRIATION_THRESHOLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DAMAGE_CALC_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DANCE_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DBLOOKUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DB_REPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DEATH_RELEASE_LOC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DEBUGAURAPROC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DEBUG_AISTATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DEBUG_LIST_TARGETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DEBUG_SERVER_GEO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DEFENSE_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DESTROY_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DESTRUCTIBLE_BUILDING_DAMAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DISMOUNT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DISMOUNTRESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DISPEL_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DUEL_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DUEL_COUNTDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DUEL_INBOUNDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DUEL_OUTOFBOUNDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DUEL_REQUESTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DUEL_WINNER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DUMP_OBJECTS_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DURABILITY_DAMAGE_DEATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DYNAMIC_DROP_ROLL_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ECHO_PARTY_SQUELCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_EMOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ENABLE_BARBER_SHOP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ENCHANTMENTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ENVIRONMENTALDAMAGELOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_EQUIPMENT_SET_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_EQUIPMENT_SET_SAVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_EQUIPMENT_SET_USE_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_EXPECTED_SPAM_RECORDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_EXPLORATION_EXPERIENCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_FEATURE_SYSTEM_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_FEIGN_DEATH_RESISTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_FISH_ESCAPED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_FISH_NOT_HOOKED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_FLIGHT_SPLINE_SYNC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_FORCEACTIONSHOW, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_FORCED_DEATH_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_FORCE_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_FORCE_DISPLAY_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_FORCE_SEND_QUEUED_PACKETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_FORCE_SET_VEHICLE_REC_ID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_FRIEND_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_CUSTOM_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_DESPAWN_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_PAGETEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_RESET_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GAMESPEED_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GAMETIMEBIAS_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GAMETIME_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GAMETIME_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GHOSTEE_GONE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GMRESPONSE_CREATE_TICKET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GMRESPONSE_DB_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GMRESPONSE_RECEIVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GMRESPONSE_STATUS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_CREATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_DELETETICKET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_GETTICKET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_SYSTEMSTATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_UPDATETEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GM_MESSAGECHAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GM_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_GM_TICKET_STATUS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GODMODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GOGOGO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GOSSIP_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GOSSIP_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GOSSIP_POI, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GROUPACTION_THROTTLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GROUP_CANCEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GROUP_DECLINE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GROUP_DESTROYED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GROUP_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GROUP_JOINED_BATTLEGROUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GROUP_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GROUP_SET_LEADER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GROUP_UNINVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_DECLINE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_ROSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_HEALTH_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_HIGHEST_THREAT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_HOTFIX_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_IGNORE_DIMINISHING_RETURNS_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_IGNORE_REQUIREMENTS_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_INITIALIZE_FACTIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_INITIAL_SPELLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_INIT_EXTRA_AURA_INFO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_INIT_WORLD_STATES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_INSPECT_RESULTS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_INSPECT_TALENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_DIFFICULTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_LOCK_WARNING_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_RESET_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_SAVE_CREATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_INVALIDATE_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_INVALIDATE_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_INVALID_PROMOTION_CODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_INVENTORY_CHANGE_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ITEM_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ITEM_ENCHANT_TIME_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ITEM_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ITEM_PUSH_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ITEM_REFUND_INFO_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ITEM_REFUND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ITEM_TEXT_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ITEM_TIME_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_JOINED_BATTLEGROUND_QUEUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_KICK_REASON, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LEARNED_DANCE_MOVES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LEARNED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LEVELUP_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_BOOT_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_BOOT_PROPOSAL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_DISABLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_JOIN_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_OFFER_CONTINUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_PARTY_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_PLAYER_REWARD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_PROPOSAL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_QUEUE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_ROLE_CHECK_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_ROLE_CHOSEN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_TELEPORT_DENIED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_PARTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_SEARCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LIST_INVENTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LOGIN_SETTIMESPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LOGIN_VERIFY_WORLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LOGOUT_CANCEL_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LOGOUT_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LOGOUT_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LOG_XPGAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LOOT_ALL_PASSED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LOOT_CLEAR_MONEY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LOOT_ITEM_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LOOT_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LOOT_MASTER_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LOOT_MONEY_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LOOT_RELEASE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LOOT_REMOVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LOOT_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LOOT_ROLL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LOOT_ROLL_WON, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LOOT_SLOT_CHANGED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LOOT_START_ROLL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LOTTERY_QUERY_RESULT_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LOTTERY_RESULT_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MAIL_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_MEMBER_ADDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_SETQUEUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MESSAGECHAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MINIGAME_MOVE_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MINIGAME_SETUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MINIGAME_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MIRRORIMAGE_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MODIFY_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MONSTER_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MONSTER_MOVE_TRANSPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOTD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOUNTRESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOUNTSPECIAL_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_CHARACTER_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_GRAVITY_DISABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_GRAVITY_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_KNOCK_BACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_COLLISION_HEIGHT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_HOVERING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_RUN_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_SWIM_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_SWIM_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SKIP_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_FEATHER_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_LAND_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_NORMAL_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_RUN_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_RUN_MODE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_SWIM_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_SWIM_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_WALK_MODE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_SET_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_UNROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_UNSET_FLYING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SPLINE_UNSET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_TELEPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_KNOCK_BACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_MULTIPLE_PACKETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_NEW_TAXI_PATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_NEW_WORLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_NOTIFY_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_NOTIFY_DEST_LOC_SPELL_CAST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_NPC_TEXT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_NPC_WONT_TALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_OFFER_PETITION_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_OPEN_CONTAINER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_OPEN_LFG_DUNGEON_FINDER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_OVERRIDE_LIGHT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PAGE_TEXT_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PARTYKILLLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PARTY_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PARTY_MEMBER_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PARTY_MEMBER_STATS_FULL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PAUSE_MIRROR_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PERIODICAURALOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PETGODMODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PETITION_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PETITION_SHOWLIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PETITION_SHOW_SIGNATURES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PETITION_SIGN_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_ACTION_FEEDBACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_ACTION_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_BROKEN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_CAST_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_DISMISS_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_GUIDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_LEARNED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_NAME_INVALID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_REMOVED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_RENAMEABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_SPELLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_TAME_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_UNLEARN_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_UPDATE_COMBO_POINTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PLAYED_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PLAYERBINDERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PLAYERBOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PLAYER_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PLAYER_SKINNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PLAYER_VEHICLE_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PLAY_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PLAY_MUSIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PLAY_OBJECT_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PLAY_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PLAY_SPELL_IMPACT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PLAY_SPELL_VISUAL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PLAY_TIME_WARNING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PONG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_POWER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PRE_RESURRECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PROCRESIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PROFILEDATA_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PROPOSE_LEVEL_GRANT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PVP_CREDIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PVP_QUEUE_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_QUERY_OBJECT_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_QUERY_OBJECT_ROTATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_QUERY_QUESTS_COMPLETED_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_QUERY_TIME_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_OFFER_REWARD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_DETAILS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_INVALID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_REQUEST_ITEMS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_STATUS_MULTIPLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_QUESTLOG_FULL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_ADD_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_ADD_KILL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_ADD_PVP_KILL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_FAILEDTIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_QUEST_CONFIRM_ACCEPT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_QUEST_FORCE_REMOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_QUEST_POI_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_QUEST_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RAID_GROUP_ONLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RAID_INSTANCE_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RAID_INSTANCE_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RAID_READY_CHECK_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RANDOMIZE_CHAR_NAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_READ_ITEM_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_READ_ITEM_OK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_REALM_SPLIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_REAL_GROUP_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RECEIVED_MAIL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_REDIRECT_CLIENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_REFER_A_FRIEND_EXPIRED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_REFER_A_FRIEND_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_REMOVED_FROM_PVP_QUEUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_REMOVED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_REPORT_PVP_AFK_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_RESET_FAILED_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RESET_RANGED_COMBAT_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RESISTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RESPOND_INSPECT_ACHIEVEMENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RESUME_CAST_BAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RESURRECT_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RESURRECT_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RESYNC_RUNES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RWHOIS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SCRIPT_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SELL_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SEND_ALL_COMBAT_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SEND_MAIL_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SEND_UNLEARN_SPELLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SERVERINFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SERVERTIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SERVER_BUCK_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SERVER_BUCK_DATA_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SERVER_FIRST_ACHIEVEMENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SERVER_INFO_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SERVER_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SET_EXTRA_AURA_INFO_NEED_UPDATE_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SET_EXTRA_AURA_INFO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SET_FACTION_ATWAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SET_FACTION_STANDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SET_FACTION_VISIBLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SET_FLAT_SPELL_MODIFIER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SET_FORCED_REACTIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SET_PCT_SPELL_MODIFIER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SET_PHASE_SHIFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SET_PROFICIENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SET_PROJECTILE_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SHOWTAXINODES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SHOW_BANK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SHOW_MAILBOX, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELLBREAKLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELLDAMAGESHIELD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELLDISPELLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELLENERGIZELOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELLHEALLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELLINSTAKILLLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELLLOGEXECUTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELLLOGMISS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELLNONMELEEDAMAGELOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELLORDAMAGE_IMMUNE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELLSTEALLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELL_CHANCE_PROC_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELL_CHANCE_RESIST_PUSHBACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELL_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELL_DELAYED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELL_FAILED_OTHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELL_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELL_GO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELL_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELL_UPDATE_CHAIN_TARGETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPIRIT_HEALER_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_FEATHER_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_GRAVITY_DISABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_GRAVITY_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_LAND_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_NORMAL_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FLYING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_RUN_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_WALK_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_START_SWIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_STOP_SWIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_UNSET_FLYING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_UNSET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_RUN_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_SWIM_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_SWIM_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_STABLE_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_STANDSTATE_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_START_MIRROR_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_STOP_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_STOP_MIRROR_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SUMMON_CANCEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SUMMON_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SUPERCEDED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SUSPEND_COMMS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_TALENTS_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_TALENTS_INVOLUNTARILY_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_TALENTS_INVOLUNTARILY_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_TAXINODE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_TEST_DROP_RATE_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_TEXT_EMOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_THREAT_CLEAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_THREAT_REMOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_THREAT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_TIME_SYNC_REQ, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_TITLE_EARNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_TOGGLE_XP_GAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_TOTEM_CREATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_TRADE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_TRADE_STATUS_EXTENDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_SUCCEEDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_TRANSFER_ABORTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_TRANSFER_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_TRIGGER_CINEMATIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_TRIGGER_MOVIE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_TURN_IN_PETITION_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TUTORIAL_FLAGS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ACCOUNT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ACCOUNT_DATA_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_COMBO_POINTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_INSTANCE_ENCOUNTER_UNIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_INSTANCE_OWNERSHIP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ITEM_ENCHANTMENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_LAST_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_WORLD_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_USERLIST_ADD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_USERLIST_REMOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_USERLIST_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_VOICESESSION_FULL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_VOICE_CHAT_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_VOICE_PARENTAL_CONTROLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_ADJUST_PRIORITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_LEAVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_ROSTER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SET_TALKER_MUTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_WARDEN_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_WEATHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_WHO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_WHOIS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_WORLD_STATE_UI_TIMER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ZONE_MAP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ZONE_UNDER_ATTACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); #undef DEFINE_OPCODE_HANDLER }; diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index a32ad631dd9..14f9687cdcd 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -28,1082 +28,1082 @@ /// List of Opcodes enum Opcodes { - NUM_OPCODE_HANDLERS = (0xFFFF+1), - UNKNOWN_OPCODE = NUM_OPCODE_HANDLERS, - NULL_OPCODE = 0, + NUM_OPCODE_HANDLERS = (0xFFFF+1), + UNKNOWN_OPCODE = NUM_OPCODE_HANDLERS, + NULL_OPCODE = 0, - CMSG_ACCEPT_LEVEL_GRANT = 0xDC4B, - CMSG_ACCEPT_TRADE = 0xB4A5, - CMSG_ACTIVATETAXI = 0x8CDB, - CMSG_ACTIVATETAXIEXPRESS = 0x5E7F, - CMSG_ADD_FRIEND = 0x5C57, - CMSG_ADD_IGNORE = 0xCEEA, - CMSG_ADD_VOICE_IGNORE = 0x0A7A, - CMSG_ALTER_APPEARANCE = 0x5CE3, - CMSG_AREA_SPIRIT_HEALER_QUERY = 0xDC7E, - CMSG_AREA_SPIRIT_HEALER_QUEUE = 0x8846, - CMSG_AREATRIGGER = 0x5862, - CMSG_ARENA_TEAM_ACCEPT = 0xDA42, - CMSG_ARENA_TEAM_DECLINE = 0x8E73, - CMSG_ARENA_TEAM_DISBAND = 0x4A5A, - CMSG_ARENA_TEAM_INVITE = 0x4862, - CMSG_ARENA_TEAM_LEADER = 0x08F3, - CMSG_ARENA_TEAM_LEAVE = 0x48EB, - CMSG_ARENA_TEAM_QUERY = 0x0872, - CMSG_ARENA_TEAM_REMOVE = 0xCE5E, - CMSG_ARENA_TEAM_ROSTER = 0x0A42, - CMSG_ATTACKSTOP = 0x5AC3, - CMSG_ATTACKSWING = 0xDE66, - CMSG_AUCTION_LIST_BIDDER_ITEMS = 0x187A, - CMSG_AUCTION_LIST_ITEMS = 0xDC5F, - CMSG_AUCTION_LIST_OWNER_ITEMS = 0x9CDA, - CMSG_AUCTION_PLACE_BID = 0x8E76, - CMSG_AUCTION_REMOVE_ITEM = 0xCEC3, - CMSG_AUCTION_SELL_ITEM = 0x0CE6, - CMSG_AUTH_SESSION = 0x1019, - CMSG_AUTO_DECLINE_GUILD_INVITES = 0x586F, - CMSG_AUTOBANK_ITEM = 0x8C56, - CMSG_AUTOEQUIP_GROUND_ITEM = 0x00, - CMSG_AUTOEQUIP_ITEM = 0x8E66, - CMSG_AUTOEQUIP_ITEM_SLOT = 0x9E67, - CMSG_AUTOSTORE_BAG_ITEM = 0x0EEE, - CMSG_AUTOSTORE_BANK_ITEM = 0x1C5F, - CMSG_AUTOSTORE_GROUND_ITEM = 0x00, - CMSG_AUTOSTORE_LOOT_ITEM = 0xD876, - CMSG_BANKER_ACTIVATE = 0x0A5A, - CMSG_BATTLEFIELD_JOIN = 0x0225, - CMSG_BATTLEFIELD_LIST = 0x32A4, - CMSG_BATTLEFIELD_REQUEST_SCORE_DATA = 0x85A5, - CMSG_BATTLEFIELD_STATUS = 0x00, - CMSG_BATTLEMASTER_JOIN_ARENA = 0x00, - CMSG_BEGIN_TRADE = 0x3724, - CMSG_BINDER_ACTIVATE = 0x58FB, - CMSG_BOT_DETECTED2 = 0x00, - CMSG_BUG = 0x1A77, - CMSG_BUSY_TRADE = 0x00, - CMSG_BUY_BANK_SLOT = 0x487F, - CMSG_BUY_ITEM = 0x1E5A, - CMSG_BUYBACK_ITEM = 0xDEE6, - CMSG_CALENDAR_ADD_EVENT = 0x1CF3, - CMSG_CALENDAR_ARENA_TEAM = 0x00, - CMSG_CALENDAR_CONTEXT_EVENT_SIGNUP = 0x00, - CMSG_CALENDAR_COPY_EVENT = 0x00, - CMSG_CALENDAR_EVENT_INVITE = 0x1EDA, - CMSG_CALENDAR_EVENT_MODERATOR_STATUS = 0xCCFA, - CMSG_CALENDAR_EVENT_REMOVE_INVITE = 0xCCD2, - CMSG_CALENDAR_EVENT_RSVP = 0x1EDA, - CMSG_CALENDAR_EVENT_STATUS = 0x4E67, - CMSG_CALENDAR_GET_EVENT = 0x00, - CMSG_CALENDAR_GET_NUM_PENDING = 0x00, - CMSG_CALENDAR_GUILD_FILTER = 0x00, - CMSG_CALENDAR_REMOVE_EVENT = 0x00, - CMSG_CALENDAR_UPDATE_EVENT = 0x5CD2, - CMSG_CANCEL_AURA = 0x9C43, - CMSG_CANCEL_AUTO_REPEAT_SPELL = 0x5CEE, - CMSG_CANCEL_CAST = 0x5A73, - CMSG_CANCEL_CHANNELLING = 0xC8FE, - CMSG_CANCEL_GROWTH_AURA = 0xDEF7, - CMSG_CANCEL_MOUNT_AURA = 0xD8F3, - CMSG_CANCEL_TEMP_ENCHANTMENT = 0x0ACE, - CMSG_CANCEL_TRADE = 0x35A5, - CMSG_CAST_SPELL = 0x5E4E, - CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE = 0x00, - CMSG_CHANNEL_ANNOUNCEMENTS = 0x70D1, - CMSG_CHANNEL_BAN = 0x2041, - CMSG_CHANNEL_DISPLAY_LIST = 0x00, - CMSG_CHANNEL_INVITE = 0x7451, - CMSG_CHANNEL_KICK = 0x3049, - CMSG_CHANNEL_LIST = 0x64D9, - CMSG_CHANNEL_MODERATOR = 0x20D1, - CMSG_CHANNEL_MUTE = 0x34C9, - CMSG_CHANNEL_OWNER = 0x00, - CMSG_CHANNEL_PASSWORD = 0x30D1, - CMSG_CHANNEL_ROSTER_INFO = 0x00, - CMSG_CHANNEL_SET_OWNER = 0x7449, - CMSG_CHANNEL_UNBAN = 0x6451, - CMSG_CHANNEL_UNMODERATOR = 0x6051, - CMSG_CHANNEL_UNMUTE = 0x74C9, - CMSG_CHAR_CREATE = 0x1AC6, - CMSG_CHAR_CUSTOMIZE = 0xDECF, - CMSG_CHAR_DELETE = 0x1ED3, - CMSG_CHAR_ENUM = 0x4A8B, - CMSG_CHAR_FACTION_CHANGE = 0xCCEE, - CMSG_CHAR_RACE_CHANGE = 0xDC57, - CMSG_CHAR_RENAME = 0x5E6F, - CMSG_CLEAR_CHANNEL_WATCH = 0x9CC2, - CMSG_CLEAR_TRADE_ITEM = 0x00, - CMSG_COMMENTATOR_ENABLE = 0x1CF7, - CMSG_COMMENTATOR_ENTER_INSTANCE = 0x8EF6, - CMSG_COMMENTATOR_EXIT_INSTANCE = 0x4C7B, - CMSG_COMMENTATOR_GET_MAP_INFO = 0xDEE7, - CMSG_COMMENTATOR_GET_PLAYER_INFO = 0x9EF3, - CMSG_COMMENTATOR_INSTANCE_COMMAND = 0x5CEB, - CMSG_COMMENTATOR_SKIRMISH_QUEUE_COMMAND = 0x9C4E, - CMSG_COMMENTATOR_START_WARGAME = 0x00, - CMSG_COMPLAIN = 0x00, - CMSG_COMPLETE_CINEMATIC = 0x1A6F, - CMSG_COMPLETE_MOVIE = 0x00, - CMSG_CONTACT_LIST = 0xCECF, - CMSG_CORPSE_MAP_POSITION_QUERY = 0xDC7F, - CMSG_CREATURE_QUERY = 0x5A7E, - CMSG_DANCE_QUERY = 0x5C5E, - CMSG_DECLINE_CHANNEL_INVITE = 0x4EFB, - CMSG_DEL_FRIEND = 0xC852, - CMSG_DEL_IGNORE = 0x8ADA, - CMSG_DEL_VOICE_IGNORE = 0x8C73, - CMSG_DESTROY_ITEMS = 0x00, - CMSG_DESTROYITEM = 0x4E7A, - CMSG_DUEL_ACCEPTED = 0x9CCB, - CMSG_DUEL_CANCELLED = 0x1E4F, - CMSG_EJECT_PASSENGER = 0xDE5A, - CMSG_EMOTE = 0x9843, - CMSG_ENABLE_NAGLE = 0x00, - CMSG_EQUIPMENT_SET_DELETE = 0x9CF2, - CMSG_EQUIPMENT_SET_SAVE = 0x5E5F, - CMSG_EQUIPMENT_SET_USE = 0x4853, - CMSG_FORCE_MOVE_ROOT_ACK = 0x00A4, - CMSG_FORCE_MOVE_UNROOT_ACK = 0x27A5, - CMSG_GAMEOBJ_REPORT_USE = 0x9A4A, - CMSG_GAMEOBJ_USE = 0x1E77, - CMSG_GAMEOBJECT_QUERY = 0xCEFF, - CMSG_GAMESPEED_SET = 0x00, - CMSG_GAMETIME_SET = 0x00, - CMSG_GET_MAIL_LIST = 0xB284, - CMSG_GET_MIRRORIMAGE_DATA = 0xDAF3, - CMSG_GETDEATHBINDZONE = 0x00, - CMSG_GHOST = 0x00, - CMSG_GM_INVIS = 0x00, - CMSG_GM_NUKE = 0x00, - CMSG_GM_REPORT_LAG = 0x9C6B, - CMSG_GM_SET_SECURITY_GROUP = 0x00, - CMSG_GMRESPONSE_RESOLVE = 0x00, - CMSG_GMSURVEY_SUBMIT = 0x00, - CMSG_GMTICKET_CREATE = 0x0A7B, - CMSG_GMTICKET_DELETETICKET = 0xC87F, - CMSG_GMTICKET_GETTICKET = 0x985F, - CMSG_GMTICKET_SYSTEMSTATUS = 0x4A7A, - CMSG_GMTICKET_UPDATETEXT = 0x8A7B, - CMSG_GOSSIP_HELLO = 0xAD3, - CMSG_GOSSIP_SELECT_OPTION = 0x984E, - CMSG_GRANT_LEVEL = 0x1CD6, - CMSG_GROUP_ACCEPT = 0x0B62, - CMSG_GROUP_ASSISTANT_LEADER = 0xC8CA, - CMSG_GROUP_CANCEL = 0x00, - CMSG_GROUP_CHANGE_SUB_GROUP = 0x1AD2, - CMSG_GROUP_DECLINE = 0x00, - CMSG_GROUP_DISBAND = 0x00, - CMSG_GROUP_INVITE = 0xC88A, - CMSG_GROUP_RAID_CONVERT = 0xC85A, - CMSG_GROUP_SET_LEADER = 0xCEC7, - CMSG_GROUP_SWAP_SUB_GROUP = 0x5AD7, - CMSG_GROUP_UNINVITE = 0x00, - CMSG_GROUP_UNINVITE_GUID = 0xCE66, - CMSG_GUILD_ACCEPT = 0x8889, - CMSG_GUILD_BANK_BUY_TAB = 0x00, - CMSG_GUILD_BANK_DEPOSIT_MONEY = 0x4847, - CMSG_GUILD_BANK_NOTE = 0x00, - CMSG_GUILD_BANK_QUERY_TAB = 0xDE46, - CMSG_GUILD_BANK_SWAP_ITEMS = 0x85B, - CMSG_GUILD_BANK_UPDATE_TAB = 0x00, - CMSG_GUILD_BANK_WITHDRAW_MONEY = 0x00, - CMSG_GUILD_BANKER_ACTIVATE = 0x4E77, - CMSG_GUILD_CREATE = 0x00, - CMSG_GUILD_DECLINE = 0x8D5A, - CMSG_GUILD_DEMOTE = 0x00, - CMSG_GUILD_DISBAND = 0x8958, - CMSG_GUILD_INFO = 0xCE76, - CMSG_GUILD_INVITE = 0x8C67, - CMSG_GUILD_LEADER = 0x28C4, - CMSG_GUILD_LEAVE = 0x00, - CMSG_GUILD_MOTD = 0x00, - CMSG_GUILD_PROMOTE = 0x00, - CMSG_GUILD_QUERY = 0x8E57, - CMSG_GUILD_RANK = 0x8D50, - CMSG_GUILD_REMOVE = 0x00, - CMSG_GUILD_ROSTER = 0x9952, - CMSG_GUILD_SET_NOTE = 0x9958, - CMSG_GUILDFINDER_JOIN = 0x68C5, - CMSG_HEARTH_AND_RESURRECT = 0xDC4E, - CMSG_IGNORE_TRADE = 0x00, - CMSG_INITIATE_TRADE = 0x00, - CMSG_INSPECT = 0x9A7B, - CMSG_INSTANCE_LOCK_WARNING_RESPONSE = 0x8CF7, - CMSG_ITEM_REFUND = 0xCC3, - CMSG_ITEM_REFUND_INFO = 0x1C7E, - CMSG_ITEM_TEXT_QUERY = 0x4AEB, - CMSG_JOIN_CHANNEL = 0x3441, - CMSG_KEEP_ALIVE = 0xC87A, - CMSG_LEARN_PREVIEW_TALENTS = 0xDEE3, - CMSG_LEARN_PREVIEW_TALENTS_PET = 0x9AFB, - CMSG_LEARN_TALENT = 0x98F3, - CMSG_LEAVE_BATTLEFIELD = 0x1AE7, - CMSG_LEAVE_CHANNEL = 0x60C9, - CMSG_LFG_GET_PLAYER_INFO = 0x00, - CMSG_LFG_JOIN = 0x58E2, - CMSG_LFG_LEAVE = 0x0EF7, - CMSG_LFG_LFR_JOIN = 0x8CFA, - CMSG_LFG_LFR_LEAVE = 0x18CA, - CMSG_LFG_PARTY_LOCK_INFO_REQUEST = 0xC867, - CMSG_LFG_PROPOSAL_RESULT = 0x985A, - CMSG_LFG_SET_ROLES = 0x4843, - CMSG_LFG_TELEPORT = 0x8C7A, - CMSG_LIST_INVENTORY = 0xDCFE, - CMSG_LOAD_SCREEN = 0x0888, - CMSG_LOG_DISCONNECT = 0x00, - CMSG_LOGOUT_CANCEL = 0xA76, - CMSG_LOGOUT_REQUEST = 0x4C7A, - CMSG_LOOT = 0x1E62, - CMSG_LOOT_METHOD = 0xCCC6, - CMSG_LOOT_MONEY = 0x4A42, - CMSG_LOOT_RELEASE = 0x4A6A, - CMSG_LOOT_ROLL = 0x4AFF, - CMSG_MAIL_CREATE_TEXT_ITEM = 0x886E, - CMSG_MAIL_DELETE = 0x4CCF, - CMSG_MAIL_MARK_AS_READ = 0x00, - CMSG_MAIL_RETURN_TO_SENDER = 0x587E, - CMSG_MAIL_TAKE_ITEM = 0xCC2, - CMSG_MAIL_TAKE_MONEY = 0x4CD6, - CMSG_MEETINGSTONE_INFO = 0xCA5B, - CMSG_MESSAGECHAT_ADDON_BATTLEGROUND = 0x6059, - CMSG_MESSAGECHAT_ADDON_GUILD = 0x24D9, - CMSG_MESSAGECHAT_ADDON_PARTY = 0x6041, - CMSG_MESSAGECHAT_ADDON_RAID = 0x3041, - CMSG_MESSAGECHAT_ADDON_WHISPER = 0x20C1, - CMSG_MESSAGECHAT_AFK = 0x30C1, - CMSG_MESSAGECHAT_BATTLEGROUND = 0x20C9, - CMSG_MESSAGECHAT_BATTLEGROUND_LEADER = 0x00, - CMSG_MESSAGECHAT_CHANNEL = 0x7459, - CMSG_MESSAGECHAT_DND = 0x30C9, - CMSG_MESSAGECHAT_EMOTE = 0x6449, - CMSG_MESSAGECHAT_GUILD = 0x60C1, - CMSG_MESSAGECHAT_OFFICER = 0x7049, - CMSG_MESSAGECHAT_PARTY = 0x24C9, - CMSG_MESSAGECHAT_PARTY_LEADER = 0x00, - CMSG_MESSAGECHAT_RAID = 0x60D1, - CMSG_MESSAGECHAT_RAID_LEADER = 0x00, - CMSG_MESSAGECHAT_RAID_WARNING = 0x2449, - CMSG_MESSAGECHAT_SAY = 0x2459, - CMSG_MESSAGECHAT_WHISPER = 0x70D9, - CMSG_MESSAGECHAT_YELL = 0x70C1, - CMSG_MINIGAME_MOVE = 0x00, - CMSG_MOUNTSPECIAL_ANIM = 0x00, - CMSG_MOVE_CHARM_TELEPORT_CHEAT = 0x16A4, - CMSG_MOVE_ENABLE_SWIM_TO_FLY_TRANS_ACK = 0x05A4, - CMSG_MOVE_FEATHER_FALL_ACK = 0x8525, - CMSG_MOVE_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK = 0x82A4, - CMSG_MOVE_FORCE_FLIGHT_SPEED_CHANGE_ACK = 0x9525, - CMSG_MOVE_FORCE_PITCH_RATE_CHANGE_ACK = 0x0025, - CMSG_MOVE_FORCE_RUN_BACK_SPEED_CHANGE_ACK = 0xB7A5, - CMSG_MOVE_FORCE_RUN_SPEED_CHANGE_ACK = 0x20A4, - CMSG_MOVE_FORCE_SWIM_BACK_SPEED_CHANGE_ACK = 0x21A5, - CMSG_MOVE_FORCE_SWIM_SPEED_CHANGE_ACK = 0x96A4, - CMSG_MOVE_FORCE_TURN_RATE_CHANGE_ACK = 0xA324, - CMSG_MOVE_FORCE_WALK_SPEED_CHANGE_ACK = 0x2224, - CMSG_MOVE_GRAVITY_DISABLE_ACK = 0x3524, - CMSG_MOVE_GRAVITY_ENABLE_ACK = 0x80A5, - CMSG_MOVE_HOVER_ACK = 0x31A4, - CMSG_MOVE_KNOCK_BACK_ACK = 0xA025, - CMSG_MOVE_SET_CAN_FLY_ACK = 0xA325, - CMSG_MOVE_SET_COLLISION_HEIGHT_ACK = 0x0525, - CMSG_MOVE_SET_RELATIVE_POSITION = 0x0024, - CMSG_MOVE_SET_VEHICLE_REC_ID_ACK = 0x3525, - CMSG_MOVE_TELEPORT_ACK = 0x2425, - CMSG_MOVE_TELEPORT_CHEAT = 0xA5A5, - CMSG_MOVE_TIME_SKIPPED = 0x3424, - CMSG_MOVE_TOGGLE_COLLISION_ACK = 0x0000, // exists, but not yet known - CMSG_MOVE_WATER_WALK_ACK = 0x25A4, - CMSG_NAME_QUERY = 0x586A, - CMSG_NEW_SPELL_SLOT = 0x00, - CMSG_NEXT_CINEMATIC_CAMERA = 0x8E63, - CMSG_NPC_TEXT_QUERY = 0x5C63, - CMSG_OFFER_PETITION = 0xC8DE, - CMSG_OPEN_ITEM = 0x88C7, - CMSG_OPENING_CINEMATIC = 0xD8D2, - CMSG_OPT_OUT_OF_LOOT = 0x00, - CMSG_PAGE_TEXT_QUERY = 0x8A5F, - CMSG_PET_ABANDON = 0x00, - CMSG_PET_ACTION = 0x1AEA, - CMSG_PET_CANCEL_AURA = 0x00, - CMSG_PET_CAST_SPELL = 0x00, - CMSG_PET_LEARN_TALENT = 0x48E6, - CMSG_PET_NAME_QUERY = 0xDA76, - CMSG_PET_RENAME = 0x00, - CMSG_PET_SET_ACTION = 0x18CF, - CMSG_PET_SPELL_AUTOCAST = 0x00, - CMSG_PET_STOP_ATTACK = 0x9E46, - CMSG_PETITION_BUY = 0x8E4E, - CMSG_PETITION_QUERY = 0xCEF3, - CMSG_PETITION_SHOW_SIGNATURES = 0x1E66, - CMSG_PETITION_SHOWLIST = 0x00, - CMSG_PETITION_SIGN = 0x4A5E, - CMSG_PING = 0x1008, - CMSG_PLAY_DANCE = 0x5857, - CMSG_PLAYED_TIME = 0x5A56, - CMSG_PLAYER_DIFFICULTY_CHANGE = 0x00, - CMSG_PLAYER_LOGIN = 0x0898, - CMSG_PLAYER_LOGOUT = 0x1CEE, - CMSG_PLAYER_VEHICLE_ENTER = 0x0A62, - CMSG_PUSHQUESTTOPARTY = 0xA47, - CMSG_QUERY_GUILD_MAX_XP = 0x00, - CMSG_QUERY_GUILD_REWARDS = 0x00, - CMSG_QUERY_GUILD_XP = 0x0952, - CMSG_QUERY_QUESTS_COMPLETED = 0x98DF, - CMSG_QUERY_TIME = 0x18FE, - CMSG_QUEST_CONFIRM_ACCEPT = 0x8CD3, - CMSG_QUEST_NPC_QUERY = 0x9ED6, - CMSG_QUEST_POI_QUERY = 0x12A5, - CMSG_QUEST_QUERY = 0xCE7F, - CMSG_QUESTGIVER_ACCEPT_QUEST = 0x0C63, - CMSG_QUESTGIVER_CANCEL = 0x0000, - CMSG_QUESTGIVER_CHOOSE_REWARD = 0x18F3, - CMSG_QUESTGIVER_COMPLETE_QUEST = 0xCCE3, - CMSG_QUESTGIVER_HELLO = 0xC86A, - CMSG_QUESTGIVER_QUERY_QUEST = 0x8CE7, - CMSG_QUESTGIVER_QUEST_AUTOLAUNCH = 0x00, - CMSG_QUESTGIVER_REQUEST_REWARD = 0xD8E7, - CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY = 0xC8DB, - CMSG_QUESTGIVER_STATUS_QUERY = 0x88C6, - CMSG_QUESTLOG_REMOVE_QUEST = 0x8EFF, - CMSG_QUESTLOG_SWAP_QUEST = 0x00, - CMSG_RANDOMIZE_CHAR_NAME = 0x8A99, - CMSG_READ_ITEM = 0x184F, - CMSG_READY_FOR_ACCOUNT_DATA_TIMES = 0xCCDB, - CMSG_REALM_SPLIT = 0xDC66, - CMSG_RECLAIM_CORPSE = 0x88DB, - CMSG_REDIRECTION_AUTH_PROOF = 0x1039, - CMSG_REPAIR_ITEM = 0xCF3, - CMSG_REPLACE_ACCOUNT_DATA = 0x00, - CMSG_REPOP_REQUEST = 0x8872, - CMSG_REPORT_PVP_AFK = 0x00, - CMSG_REQUEST_ACCOUNT_DATA = 0x8AF2, - CMSG_REQUEST_CATEGORY_COOLDOWNS = 0x00, - CMSG_REQUEST_CEMETERY_LIST = 0x00, - CMSG_REQUEST_HOTFIX = 0x8A8B, - CMSG_REQUEST_PARTY_MEMBER_STATS = 0x987E, - CMSG_REQUEST_PET_INFO = 0x9A47, - CMSG_REQUEST_RAID_INFO = 0xECF, - CMSG_REQUEST_RATED_BG_INFO = 0x00, - CMSG_REQUEST_VEHICLE_EXIT = 0xCC6, - CMSG_REQUEST_VEHICLE_NEXT_SEAT = 0xCAD6, - CMSG_REQUEST_VEHICLE_PREV_SEAT = 0x1AE2, - CMSG_REQUEST_VEHICLE_SWITCH_SEAT = 0x9A46, - CMSG_RESET_INSTANCES = 0x9EEA, - CMSG_RESURRECT_RESPONSE = 0xDE46, - CMSG_RETURN_TO_GRAVEYARD = 0x91A4, - CMSG_SAVE_PLAYER = 0x00, - CMSG_SEARCH_LFG_JOIN = 0x00, - CMSG_SEARCH_LFG_LEAVE = 0x00, - CMSG_SELF_RES = 0xCCFE, - CMSG_SELL_ITEM = 0x5EE3, - CMSG_SERVERTIME = 0x00, - CMSG_SET_ACTION_BUTTON = 0xDAC3, - CMSG_SET_ACTIONBAR_TOGGLES = 0x584F, - CMSG_SET_ACTIVE_MOVER = 0x00, - CMSG_SET_ACTIVE_VOICE_CHANNEL = 0x00, - CMSG_SET_ALLOW_LOW_LEVEL_RAID1 = 0xC863, - CMSG_SET_ALLOW_LOW_LEVEL_RAID2 = 0x4CE7, - CMSG_SET_CHANNEL_WATCH = 0x9CFB, - CMSG_SET_CONTACT_NOTES = 0x1AF3, - CMSG_SET_FACTION_ATWAR = 0x4AD2, - CMSG_SET_FACTION_CHEAT = 0x00, - CMSG_SET_GUILD_BANK_TEXT = 0x00, - CMSG_SET_LFG_COMMENT = 0x00, - CMSG_SET_PLAYER_DECLINED_NAMES = 0xC847, - CMSG_SET_PRIMARY_TALENT_TREE = 0x185E, - CMSG_SET_SAVED_INSTANCE_EXTEND = 0x8E62, - CMSG_SET_SELECTION = 0x4C4E, - CMSG_SET_SKILL_CHEAT = 0x00, - CMSG_SET_TAXI_BENCHMARK_MODE = 0x1EFF, - CMSG_SET_TITLE = 0xCE63, - CMSG_SET_TRADE_GOLD = 0x27A4, - CMSG_SET_TRADE_ITEM = 0x00, - CMSG_SET_WATCHED_FACTION = 0x5CD3, - CMSG_SETDEATHBINDPOINT = 0x00, - CMSG_SETSHEATHED = 0xCA5F, - CMSG_SHOWING_CLOAK = 0x8AE3, - CMSG_SHOWING_HELM = 0xCEFA, - CMSG_SOCKET_GEMS = 0x00, - CMSG_SPELLCLICK = 0xC8F2, - CMSG_SPIRIT_HEALER_ACTIVATE = 0x5AEB, - CMSG_SPLIT_ITEM = 0xDCFA, - CMSG_STANDSTATECHANGE = 0x9EC6, - CMSG_START_QUEST = 0x00, - CMSG_STOP_DANCE = 0x00, - CMSG_STORE_LOOT_IN_SLOT = 0x00, - CMSG_SUMMON_RESPONSE = 0xD84E, - CMSG_SUSPEND_TOKEN = 0x1009, - CMSG_SWAP_INV_ITEM = 0x5CE7, - CMSG_SWAP_ITEM = 0xDED6, - CMSG_TAXICLEARALLNODES = 0x00, - CMSG_TAXIENABLEALLNODES = 0x00, - CMSG_TAXINODE_STATUS_QUERY = 0x98E3, - CMSG_TAXIQUERYAVAILABLENODES = 0x00, - CMSG_TAXISHOWNODES = 0x00, - CMSG_TELEPORT_TO_UNIT = 0x8C72, - CMSG_TEXT_EMOTE = 0x08D3, - CMSG_TIME_SYNC_RESP = 0x07A5, - CMSG_TOGGLE_PVP = 0x8ECA, - CMSG_TOTEM_DESTROYED = 0x00, - CMSG_TRAINER_BUY_SPELL = 0xAF7, - CMSG_TRAINER_LIST = 0xCC7F, - CMSG_TRIGGER_CINEMATIC_CHEAT = 0x00, - CMSG_TURN_IN_PETITION = 0x9C67, - CMSG_TUTORIAL_CLEAR = 0x1CE7, - CMSG_TUTORIAL_FLAG = 0x9E73, - CMSG_TUTORIAL_RESET = 0x8AF7, - CMSG_UNACCEPT_TRADE = 0x00, - CMSG_UNLEARN_SKILL = 0xAC3, - CMSG_UNREGISTER_ALL_ADDON_PREFIXES = 0x00, - CMSG_UPDATE_ACCOUNT_DATA = 0x4AFE, - CMSG_UPDATE_MISSILE_TRAJECTORY = 0x9525, - CMSG_UPDATE_PROJECTILE_POSITION = 0x00, // sub_677360 - CMSG_USE_ITEM = 0xD8EA, - CMSG_VIOLENCE_LEVEL = 0x00, - CMSG_VOICE_SESSION_ENABLE = 0x00, - CMSG_WARDEN_DATA = 0x5847, - CMSG_WHO = 0x9AD7, - CMSG_WHOIS = 0xCCE6, - CMSG_WORLD_PORT_RESPONSE = 0x0A9A, - CMSG_WORLD_STATE_UI_TIMER_UPDATE = 0x58F6, - CMSG_WORLD_TELEPORT = 0x00, - CMSG_WRAP_ITEM = 0x00, - CMSG_ZONEUPDATE = 0x4AE2, - MSG_AUCTION_HELLO = 0xCC7A, - MSG_BATTLEGROUND_PLAYER_POSITIONS = 0x00, - MSG_CHANNEL_START = 0xDCC2, - MSG_CHANNEL_UPDATE = 0xCC5E, - MSG_CORPSE_QUERY = 0xC876, - MSG_GM_BIND_OTHER = 0x00, - MSG_GM_SHOWLABEL = 0x00, - MSG_GM_SUMMON = 0x00, - MSG_GUILD_BANK_LOG_QUERY = 0x4CD2, - MSG_GUILD_BANK_MONEY_WITHDRAWN = 0xDE77, - MSG_GUILD_EVENT_LOG_QUERY = 0xCEDA, - MSG_GUILD_PERMISSIONS = 0xDC73, - MSG_INSPECT_ARENA_TEAMS = 0xDA4F, - MSG_LIST_STABLED_PETS = 0x88CA, - MSG_MINIMAP_PING = 0x00, - MSG_MOVE_FALL_LAND = 0x00A5, - MSG_MOVE_FEATHER_FALL = 0x00, - MSG_MOVE_GRAVITY_CHNG = 0x00, - MSG_MOVE_HEARTBEAT = 0xB024, - MSG_MOVE_HOVER = 0x00, - MSG_MOVE_JUMP = 0x9225, - MSG_MOVE_SET_ALL_SPEED_CHEAT = 0x00, - MSG_MOVE_SET_FACING = 0x02A4, - MSG_MOVE_SET_FLIGHT_BACK_SPEED_CHEAT = 0x00, - MSG_MOVE_SET_FLIGHT_SPEED_CHEAT = 0x00, - MSG_MOVE_SET_PITCH = 0xA7A5, - MSG_MOVE_SET_RAW_POSITION_ACK = 0x00, - MSG_MOVE_SET_RUN_BACK_SPEED_CHEAT = 0x00, - MSG_MOVE_SET_RUN_SPEED_CHEAT = 0x00, - MSG_MOVE_SET_SWIM_BACK_SPEED_CHEAT = 0x00, - MSG_MOVE_SET_SWIM_SPEED_CHEAT = 0x00, - MSG_MOVE_SET_TURN_RATE_CHEAT = 0x00, - MSG_MOVE_SET_WALK_SPEED_CHEAT = 0x00, - MSG_MOVE_START_ASCEND = 0x0624, - MSG_MOVE_START_BACKWARD = 0x10A5, - MSG_MOVE_START_DESCEND = 0x2624, - MSG_MOVE_START_FORWARD = 0xA0A4, - MSG_MOVE_START_PITCH_DOWN = 0x2025, - MSG_MOVE_START_PITCH_UP = 0x9524, - MSG_MOVE_START_STRAFE_LEFT = 0xA024, - MSG_MOVE_START_STRAFE_RIGHT = 0x9125, - MSG_MOVE_START_SWIM = 0x85A4, - MSG_MOVE_START_TURN_LEFT = 0x01A5, - MSG_MOVE_START_TURN_RIGHT = 0xB6A4, - MSG_MOVE_STOP = 0xA3A4, - MSG_MOVE_STOP_ASCEND = 0x1125, - MSG_MOVE_STOP_PITCH = 0x8425, - MSG_MOVE_STOP_STRAFE = 0x0125, - MSG_MOVE_STOP_SWIM = 0xB424, - MSG_MOVE_STOP_TURN = 0x90A4, - MSG_MOVE_TOGGLE_COLLISION_CHEAT = 0x00, - MSG_MOVE_TOGGLE_FALL_LOGGING = 0x00, - MSG_MOVE_TOGGLE_LOGGING = 0x00, - MSG_MOVE_WATER_WALK = 0x00, - MSG_MOVE_UPDATE_CAN_FLY = 0x00, - MSG_NOTIFY_PARTY_SQUELCH = 0x00, - MSG_PARTY_ASSIGNMENT = 0x00, - MSG_PETITION_DECLINE = 0x98E7, - MSG_PETITION_RENAME = 0x4857, - MSG_PVP_LOG_DATA = 0x00, - MSG_QUERY_GUILD_BANK_TEXT = 0x8CCF, - MSG_QUERY_NEXT_MAIL_TIME = 0xCEE6, - MSG_QUEST_PUSH_RESULT = 0x1863, - MSG_RAID_READY_CHECK = 0x584E, - MSG_RAID_READY_CHECK_CONFIRM = 0x00, - MSG_RAID_READY_CHECK_FINISHED = 0x00, - MSG_RAID_TARGET_UPDATE = 0x1E5F, - MSG_RANDOM_ROLL = 0x4C57, - MSG_SAVE_GUILD_EMBLEM = 0x4EE3, - MSG_SET_DUNGEON_DIFFICULTY = 0x0C4F, - MSG_SET_RAID_DIFFICULTY = 0x1A5A, - MSG_TABARDVENDOR_ACTIVATE = 0x98EB, - MSG_TALENT_WIPE_CONFIRM = 0x4C52, - MSG_VERIFY_CONNECTIVITY = 0x4F57, - SMSG_ACCOUNT_DATA_TIMES = 0x5EE2, - SMSG_ACHIEVEMENT_DELETED = 0x9ED2, - SMSG_ACHIEVEMENT_EARNED = 0x484E, - SMSG_ACTION_BUTTONS = 0x8A6B, - SMSG_ACTIVATETAXIREPLY = 0x8E4F, - SMSG_ADD_RUNE_POWER = 0x00, - SMSG_ADDON_INFO = 0x9863, - SMSG_AI_REACTION = 0xCEC2, - SMSG_ALL_ACHIEVEMENT_DATA = 0xE6EC, - SMSG_AREA_SPIRIT_HEALER_TIME = 0x00, - SMSG_AREA_TRIGGER_MESSAGE = 0xCC42, - SMSG_ARENA_ERROR = 0x08C7, - SMSG_ARENA_OPPONENT_UPDATE = 0x0AD6, - SMSG_ARENA_TEAM_CHANGE_FAILED_QUEUED = 0x4A4E, - SMSG_ARENA_TEAM_COMMAND_RESULT = 0x605C, - SMSG_ARENA_TEAM_EVENT = 0x5CDA, - SMSG_ARENA_TEAM_INVITE = 0x5EDB, - SMSG_ARENA_TEAM_QUERY_RESPONSE = 0x8CCE, - SMSG_ARENA_TEAM_ROSTER = 0xCE7A, - SMSG_ARENA_TEAM_STATS = 0xDEF2, - SMSG_ATTACKERSTATEUPDATE = 0x0E6A, - SMSG_ATTACKSTART = 0xCA4A, - SMSG_ATTACKSTOP = 0xCED7, - SMSG_ATTACKSWING_BADFACING = 0x18E2, - SMSG_ATTACKSWING_CANT_ATTACK = 0x00, // 0x1CEA or 0x4CFE - SMSG_ATTACKSWING_DEADTARGET = 0x00, // 0x1CEA or 0x4CFE - SMSG_ATTACKSWING_NOTINRANGE = 0xCC62, - SMSG_AUCTION_BIDDER_LIST_RESULT = 0x88E3, - SMSG_AUCTION_BIDDER_NOTIFICATION = 0xC85B, - SMSG_AUCTION_COMMAND_RESULT = 0xCCCE, - SMSG_AUCTION_LIST_PENDING_SALES = 0x8EC7, - SMSG_AUCTION_LIST_RESULT = 0xDEDE, - SMSG_AUCTION_OWNER_LIST_RESULT = 0x4EDA, - SMSG_AUCTION_OWNER_NOTIFICATION = 0xCA6A, - SMSG_AUCTION_REMOVED_NOTIFICATION = 0x4CFB, - SMSG_AURA_UPDATE = 0x4C66, - SMSG_AURA_UPDATE_ALL = 0x18EE, - SMSG_AURACASTLOG = 0x00, - SMSG_AUTH_CHALLENGE = 0x1181, - SMSG_AUTH_RESPONSE = 0x8867, - SMSG_AVAILABLE_VOICE_CHANNEL = 0x9C7B, - SMSG_BARBER_SHOP_RESULT = 0x9847, - SMSG_BATTLEFIELD_LIST = 0xB64E, - SMSG_BATTLEFIELD_MGR_EJECT_PENDING = 0x724C, - SMSG_BATTLEFIELD_MGR_EJECTED = 0x32EC, - SMSG_BATTLEFIELD_MGR_ENTERED = 0x66DC, - SMSG_BATTLEFIELD_MGR_ENTRY_INVITE = 0x70DE, - SMSG_BATTLEFIELD_MGR_QUEUE_INVITE = 0x644E, - SMSG_BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE = 0x326E, - SMSG_BATTLEFIELD_MGR_STATE_CHANGE = 0x32EE, - SMSG_BATTLEFIELD_PORT_DENIED = 0x00, - SMSG_BATTLEFIELD_STATUS = 0x00, - SMSG_BATTLEFIELD_STATUS1 = 0x70EE, - SMSG_BATTLEFIELD_STATUS2 = 0x20DC, - SMSG_BATTLEFIELD_STATUS3 = 0x36DE, - SMSG_BATTLEFIELD_STATUS4 = 0x626E, - SMSG_BATTLEGROUND_INFO_THROTTLED = 0x00, - SMSG_BATTLEGROUND_PLAYER_JOINED = 0x00, - SMSG_BATTLEGROUND_PLAYER_LEFT = 0x00, - SMSG_BATTLEGROUND_PLAYER_POSITIONS = 0x00, - SMSG_BINDER_CONFIRM = 0x0ADA, - SMSG_BINDPOINTUPDATE = 0x98CF, - SMSG_BINDZONEREPLY = 0x1A42, - SMSG_BREAK_TARGET = 0x0E7E, - SMSG_BUY_BANK_SLOT_RESULT = 0x00, - SMSG_BUY_FAILED = 0x4A7F, - SMSG_BUY_ITEM = 0xCA67, - SMSG_CALENDAR_ACTION_PENDING = 0x00, - SMSG_CALENDAR_ARENA_TEAM = 0x00, - SMSG_CALENDAR_CLEAR_PENDING_ACTION = 0x00, - SMSG_CALENDAR_COMMAND_RESULT = 0x9A4E, - SMSG_CALENDAR_EVENT_INVITE = 0x00, - SMSG_CALENDAR_EVENT_INVITE_ALERT = 0x00, - SMSG_CALENDAR_EVENT_INVITE_NOTES = 0x00, - SMSG_CALENDAR_EVENT_INVITE_NOTES_ALERT = 0x00, - SMSG_CALENDAR_EVENT_INVITE_REMOVED = 0x00, - SMSG_CALENDAR_EVENT_INVITE_REMOVED_ALERT = 0x00, - SMSG_CALENDAR_EVENT_INVITE_STATUS_ALERT = 0x00, - SMSG_CALENDAR_EVENT_MODERATOR_STATUS_ALERT = 0x00, - SMSG_CALENDAR_EVENT_REMOVED_ALERT = 0x5C72, - SMSG_CALENDAR_EVENT_STATUS = 0x00, - SMSG_CALENDAR_EVENT_UPDATED_ALERT = 0x5CFA, - SMSG_CALENDAR_RAID_LOCKOUT_ADDED = 0x9AC2, - SMSG_CALENDAR_RAID_LOCKOUT_REMOVED = 0x985B, - SMSG_CALENDAR_RAID_LOCKOUT_UPDATED = 0xDCDF, - SMSG_CALENDAR_SEND_CALENDAR = 0x08FB, - SMSG_CALENDAR_SEND_EVENT = 0x00, - SMSG_CALENDAR_SEND_NUM_PENDING = 0x00, - SMSG_CALENDAR_UPDATE_INVITE_LIST = 0x00, - SMSG_CAMERA_SHAKE = 0x5CFB, - SMSG_CANCEL_AUTO_REPEAT = 0x5ACB, - SMSG_CANCEL_COMBAT = 0x4AC7, - SMSG_CAST_FAILED = 0x1AEB, - SMSG_CHANNEL_LIST = 0x9C47, - SMSG_CHANNEL_MEMBER_COUNT = 0x5EEA, - SMSG_CHANNEL_NOTIFY = 0x9C7F, - SMSG_CHAR_CREATE = 0x4C5B, - SMSG_CHAR_CUSTOMIZE = 0x0AE3, - SMSG_CHAR_DELETE = 0x48CE, - SMSG_CHAR_ENUM = 0xA05C, - SMSG_CHAR_FACTION_CHANGE = 0x885A, - SMSG_CHAR_RENAME = 0x5EF6, - SMSG_CHARACTER_LOGIN_FAILED = 0x4AE6, - SMSG_CHAT_PLAYER_AMBIGUOUS = 0xDE7F, - SMSG_CHAT_PLAYER_NOT_FOUND = 0x4E6F, - SMSG_CHAT_RESTRICTED = 0x4863, - SMSG_CHAT_WRONG_FACTION = 0x0E66, - SMSG_CHECK_FOR_BOTS = 0x00, - SMSG_CLEAR_COOLDOWN = 0x986F, - SMSG_CLEAR_TARGET = 0xDA7A, - SMSG_CLIENT_CONTROL_UPDATE = 0x08CB, - SMSG_CLIENTCACHE_VERSION = 0x88F2, - SMSG_COMBAT_LOG_MULTIPLE = 0x5C56, - SMSG_COMMENTATOR_MAP_INFO = 0x0C73, - SMSG_COMMENTATOR_PLAYER_INFO = 0x9A6E, - SMSG_COMMENTATOR_STATE_CHANGED = 0x4EEE, - SMSG_COMPLAIN_RESULT = 0x8A4B, - SMSG_COMPRESSED_ACHIEVEMENT_DATA = 0x5C3B, - SMSG_COMPRESSED_CHAR_ENUM = 0x380A, - SMSG_COMPRESSED_GUILD_ROSTER = 0x5A29, - SMSG_COMPRESSED_MOVES = 0x0862, - SMSG_COMPRESSED_UPDATE_OBJECT = 0x1CC3, - SMSG_CONTACT_LIST = 0x0A6B, - SMSG_CONVERT_RUNE = 0x9EE7, - SMSG_COOLDOWN_CHEAT = 0x9856, - SMSG_COOLDOWN_EVENT = 0x185F, - SMSG_CORPSE_MAP_POSITION_QUERY_RESPONSE = 0x00, - SMSG_CORPSE_NOT_IN_INSTANCE = 0xCACB, - SMSG_CORPSE_RECLAIM_DELAY = 0xCD46, - SMSG_CREATURE_QUERY_RESPONSE = 0xD847, - SMSG_CRITERIA_DELETED = 0x1A5B, - SMSG_CRITERIA_UPDATE = 0xD87F, - SMSG_CROSSED_INEBRIATION_THRESHOLD = 0x9CD7, - SMSG_DAMAGE_CALC_LOG = 0x5C47, - SMSG_DAMAGE_DONE_OBSOLETE = 0x00, - SMSG_DANCE_QUERY_RESPONSE = 0x9E42, - SMSG_DB_REPLY = 0x76EC, - SMSG_DEATH_RELEASE_LOC = 0x08C6, - SMSG_DEFENSE_MESSAGE = 0x9EC3, - SMSG_DESTROY_OBJECT = 0x486B, - SMSG_DESTRUCTIBLE_BUILDING_DAMAGE = 0x1C5E, - SMSG_DISMOUNT = 0xCEE7, - SMSG_DISMOUNTRESULT = 0x00, - SMSG_DISPEL_FAILED = 0x1E4A, - SMSG_DUEL_COMPLETE = 0x5846, - SMSG_DUEL_COUNTDOWN = 0x1A5F, - SMSG_DUEL_INBOUNDS = 0x00, - SMSG_DUEL_OUTOFBOUNDS = 0x00, - SMSG_DUEL_REQUESTED = 0x1EC6, - SMSG_DUEL_WINNER = 0xDA52, - SMSG_DURABILITY_DAMAGE_DEATH = 0x0ACF, - SMSG_ECHO_PARTY_SQUELCH = 0x5ED7, - SMSG_EMOTE = 0x0C67, - SMSG_ENABLE_BARBER_SHOP = 0x9C7A, - SMSG_ENCHANTMENTLOG = 0x48E2, - SMSG_ENVIRONMENTALDAMAGELOG = 0x5A6B, - SMSG_EQUIPMENT_SET_LIST = 0x18DF, - SMSG_EQUIPMENT_SET_SAVED = 0x00, - SMSG_EQUIPMENT_SET_USE_RESULT = 0x00, - SMSG_EXPECTED_SPAM_RECORDS = 0x48E7, - SMSG_EXPLORATION_EXPERIENCE = 0x0EE7, - SMSG_FEATURE_SYSTEM_STATUS = 0x70CE, - SMSG_FISH_ESCAPED = 0x9C66, - SMSG_FISH_NOT_HOOKED = 0x18C3, - SMSG_FLIGHT_SPLINE_SYNC = 0x1C63, - SMSG_FORCE_DISPLAY_UPDATE = 0x00, - SMSG_FORCE_SEND_QUEUED_PACKETS = 0x1380, - SMSG_FORCEACTIONSHOW = 0x00, - SMSG_FORCED_DEATH_UPDATE = 0x00, - SMSG_FRIEND_STATUS = 0xD852, - SMSG_GAMEOBJECT_CUSTOM_ANIM = 0x0CCE, - SMSG_GAMEOBJECT_DESPAWN_ANIM = 0x0A5E, - SMSG_GAMEOBJECT_PAGETEXT = 0xD8DE, - SMSG_GAMEOBJECT_QUERY_RESPONSE = 0xCCF7, - SMSG_GAMEOBJECT_RESET_STATE = 0x9CF3, - SMSG_GAMESPEED_SET = 0x5ACA, - SMSG_GAMETIME_SET = 0x9C4A, - SMSG_GAMETIME_UPDATE = 0x18E3, - SMSG_GM_MESSAGECHAT = 0x8E5E, - SMSG_GMRESPONSE_RECEIVED = 0xCCEA, - SMSG_GMRESPONSE_STATUS_UPDATE = 0x00, - SMSG_GMTICKET_CREATE = 0xC84A, - SMSG_GMTICKET_DELETETICKET = 0x1A6E, - SMSG_GMTICKET_GETTICKET = 0x00, - SMSG_GMTICKET_SYSTEMSTATUS = 0x9C7E, - SMSG_GMTICKET_UPDATETEXT = 0x00, - SMSG_GODMODE = 0xDEEE, - SMSG_GOSSIP_COMPLETE = 0xDE7B, - SMSG_GOSSIP_MESSAGE = 0xCCEB, - SMSG_GOSSIP_POI = 0x1866, - SMSG_GROUP_CANCEL = 0x0ED6, - SMSG_GROUP_DECLINE = 0x0863, - SMSG_GROUP_DESTROYED = 0x8ACF, - SMSG_GROUP_INVITE = 0x00, - SMSG_GROUP_JOINED_BATTLEGROUND = 0x0000, - SMSG_GROUP_LIST = 0x5C7E, - SMSG_GROUP_SET_LEADER = 0xCCF2, - SMSG_GROUP_UNINVITE = 0x9CEA, - SMSG_GUILD_ACHIEVEMENT_DATA = 0xA67E, - SMSG_GUILD_BANK_LIST = 0x5EFB, - SMSG_GUILD_CANCEL = 0x08C3, - SMSG_GUILD_COMMAND_RESULT = 0xDAD7, - SMSG_GUILD_DECLINE = 0x1E5B, - SMSG_GUILD_EVENT = 0x8AC2, - SMSG_GUILD_INFO = 0x5876, - SMSG_GUILD_INVITE = 0x00, - SMSG_GUILD_MAX_DAILY_XP = 0x00, - SMSG_GUILD_NEWS_UPDATE = 0x00, - SMSG_GUILD_QUERY_RESPONSE = 0xCA66, - SMSG_GUILD_RANK = 0xA6EC, - SMSG_GUILD_RANKS_UPDATE = 0x00, - SMSG_GUILD_REWARDS_LIST = 0x00, - SMSG_GUILD_ROSTER = 0x664C, - SMSG_GUILD_SET_NOTE = 0xB6CE, - SMSG_GUILD_TRADESKILL_UPDATE = 0x00, - SMSG_GUILD_UPDATE_ROSTER = 0x00, - SMSG_GUILD_XP_UPDATE = 0x00, - SMSG_GUILDFINDER_SEARCH_RESULT = 0xE0CE, - SMSG_HOTFIX_INFO = 0xA04C, - SMSG_HIGHEST_THREAT_UPDATE = 0x5E7B, - SMSG_INIT_CURRENCY = 0x227E, - SMSG_INIT_WORLD_STATES = 0x9EDA, - SMSG_INITIAL_SPELLS = 0x88FE, - SMSG_INITIALIZE_FACTIONS = 0xCC6F, - SMSG_INSPECT = 0x0E46, - SMSG_INSPECT_HONOR_STATS = 0x00, - SMSG_INSPECT_TALENT = 0x48EF, - SMSG_INSTANCE_DIFFICULTY = 0x00, - SMSG_INSTANCE_LOCK_WARNING_QUERY = 0x4E7F, - SMSG_INSTANCE_RESET = 0xDAC2, - SMSG_INSTANCE_RESET_FAILED = 0xCEFE, - SMSG_INSTANCE_SAVE_CREATED = 0xCE56, - SMSG_INVALID_PROMOTION_CODE = 0xD8FE, - SMSG_INVALIDATE_DANCE = 0x1EEF, - SMSG_INVALIDATE_PLAYER = 0x5C5F, - SMSG_INVENTORY_CHANGE_FAILURE = 0xC8EE, - SMSG_ITEM_COOLDOWN = 0x5CC2, - SMSG_ITEM_ENCHANT_TIME_UPDATE = 0xDCE6, - SMSG_ITEM_NAME_QUERY_RESPONSE = 0x00, - SMSG_ITEM_PUSH_RESULT = 0x8EFB, - SMSG_ITEM_REFUND_INFO_RESPONSE = 0x304E, - SMSG_ITEM_REFUND_RESULT = 0x60DC, - SMSG_ITEM_TEXT_QUERY_RESPONSE = 0x984A, - SMSG_ITEM_TIME_UPDATE = 0x8AEB, - SMSG_JOINED_BATTLEGROUND_QUEUE = 0x00, - SMSG_KICK_REASON = 0x8A67, - SMSG_LEARNED_DANCE_MOVES = 0xE52, - SMSG_LEARNED_SPELL = 0x88D3, - SMSG_LEVELUP_INFO = 0x9A73, - SMSG_LFG_BOOT_PLAYER = 0x4A5F, - SMSG_LFG_DISABLED = 0xCAEA, - SMSG_LFG_JOIN_RESULT = 0xCCCB, - SMSG_LFG_OFFER_CONTINUE = 0x8E7E, - SMSG_LFG_OPEN_FROM_GOSSIP = 0x0C5E, - SMSG_LFG_PARTY_INFO = 0x5E47, - SMSG_LFG_PLAYER_INFO = 0xC85F, - SMSG_LFG_PLAYER_REWARD = 0x00, - SMSG_LFG_PROPOSAL_UPDATE = 0x485E, - SMSG_LFG_QUEUE_STATUS = 0x5AF6, - SMSG_LFG_ROLE_CHECK_UPDATE = 0x5C6F, - SMSG_LFG_ROLE_CHOSEN = 0x8C5A, - SMSG_LFG_TELEPORT_DENIED = 0x585F, - SMSG_LFG_UPDATE_LIST = 0x0EFB, - SMSG_LFG_UPDATE_PARTY = 0xCCF6, - SMSG_LFG_UPDATE_PLAYER = 0x00, - SMSG_LFG_UPDATE_SEARCH = 0x1E53, - SMSG_LIST_INVENTORY = 0x264C, - SMSG_LOG_XPGAIN = 0x4E7E, - SMSG_LOGIN_SETTIMESPEED = 0x5ECA, - SMSG_LOGIN_VERIFY_WORLD = 0xC86E, - SMSG_LOGOUT_CANCEL_ACK = 0xD8EF, - SMSG_LOGOUT_COMPLETE = 0xCC6B, - SMSG_LOGOUT_RESPONSE = 0x886A, - SMSG_LOOT_ALL_PASSED = 0x1C7A, - SMSG_LOOT_CLEAR_MONEY = 0x586E, - SMSG_LOOT_ITEM_NOTIFY = 0xD8E3, - SMSG_LOOT_LIST = 0x8C5B, - SMSG_LOOT_MASTER_LIST = 0xDE4E, - SMSG_LOOT_MONEY_NOTIFY = 0x0EF3, - SMSG_LOOT_RELEASE_RESPONSE = 0x88FF, - SMSG_LOOT_REMOVED = 0x8E6B, - SMSG_LOOT_RESPONSE = 0x0842, - SMSG_LOOT_ROLL = 0x4C4F, - SMSG_LOOT_ROLL_WON = 0x5E4B, - SMSG_LOOT_SLOT_CHANGED = 0xDCDA, - SMSG_LOOT_START_ROLL = 0xC8C2, - SMSG_MAIL_LIST_RESULT = 0x5CD7, - SMSG_MEETINGSTONE_COMPLETE = 0xDA43, - SMSG_MEETINGSTONE_IN_PROGRESS = 0xCACE, - SMSG_MEETINGSTONE_MEMBER_ADDED = 0x1AFF, - SMSG_MEETINGSTONE_SETQUEUE = 0x0A73, - SMSG_MESSAGECHAT = 0x5E52, - SMSG_MIRRORIMAGE_DATA = 0x8AFB, - SMSG_MODIFY_COOLDOWN = 0xD8DF, - SMSG_MONSTER_MOVE = 0x4C53, - SMSG_MONSTER_MOVE_TRANSPORT = 0x88FB, - SMSG_MOTD = 0xCA4B, - SMSG_MOUNTRESULT = 0x00, - SMSG_MOUNTSPECIAL_ANIM = 0x9E77, - SMSG_MOVE_DISABLE_COLLISION = 0xF2DE, //forced, for self - SMSG_MOVE_DISABLE_GRAVITY = 0x60DC, //forced, for self - SMSG_MOVE_DISABLE_TRANSITION_BETWEEN_SWIM_AND_FLY= 0x365E, //forced, for self - SMSG_MOVE_ENABLE_COLLISION = 0x64DC, //forced, for self - SMSG_MOVE_ENABLE_GRAVITY = 0x645E, //forced, for self - SMSG_MOVE_ENABLE_TRANSITION_BETWEEN_SWIM_AND_FLY = 0x60CC, //forced, for self - SMSG_MOVE_KNOCK_BACK = 0x60FE, //forced, for self - SMSG_MOVE_ROOT = 0xB0DE, //forced, for self - SMSG_MOVE_SET_ACTIVE_MOVER = 0xA0DE, - SMSG_MOVE_SET_CAN_FLY = 0xB66E, //forced, for self - SMSG_MOVE_SET_COLLISION_HEIGHT = 0x20DC, //forced, for self - SMSG_MOVE_SET_COMPOUND_STATE = 0xF25E, - SMSG_MOVE_SET_FEATHER_FALL = 0xF2CC, //forced, for self - SMSG_MOVE_SET_FLIGHT_BACK_SPEED = 0x627C, //forced, for self - SMSG_MOVE_SET_FLIGHT_SPEED = 0x365C, //forced, for self - SMSG_MOVE_SET_HOVERING = 0x74FC, //forced, for self - SMSG_MOVE_SET_LAND_WALK = 0x76CE, //forced, for self - SMSG_MOVE_SET_NORMAL_FALL = 0xF4DC, //forced, for self - SMSG_MOVE_SET_PITCH_RATE = 0x24FE, //forced, for self - SMSG_MOVE_SET_RUN_BACK_SPEED = 0x747C, //forced, for self - SMSG_MOVE_SET_RUN_SPEED = 0xE24E, // for self - SMSG_MOVE_SET_SWIM_BACK_SPEED = 0xE6CC, //forced, for self - SMSG_MOVE_SET_SWIM_SPEED = 0x30FC, //forced, for self - SMSG_MOVE_SET_TURN_RATE = 0xA04E, //forced, for self - SMSG_MOVE_SET_VEHICLE_REC_ID = 0xA44C, //forced, for self - SMSG_MOVE_SET_WALK_IN_AIR = 0x00, - SMSG_MOVE_SET_WALK_SPEED = 0x246E, //forced, for self - SMSG_MOVE_SET_WATER_WALK = 0x625E, //forced, for self - SMSG_MOVE_SKIP_TIME = 0x32DE, - SMSG_MOVE_SPLINE_DISABLE_COLLISION = 0xE04E, - SMSG_MOVE_SPLINE_DISABLE_GRAVITY = 0xF04C, - SMSG_MOVE_SPLINE_ENABLE_COLLISION = 0x227C, - SMSG_MOVE_SPLINE_ENABLE_GRAVITY = 0xA4DE, - SMSG_MOVE_SPLINE_ROOT = 0x265C, - SMSG_MOVE_SPLINE_SET_FEATHER_FALL = 0xB6CC, - SMSG_MOVE_SPLINE_SET_FLIGHT_BACK_SPEED = 0x70EC, - SMSG_MOVE_SPLINE_SET_FLIGHT_SPEED = 0x644C, - SMSG_MOVE_SPLINE_SET_FLYING = 0x70DC, - SMSG_MOVE_SPLINE_SET_HOVER = 0x667E, - SMSG_MOVE_SPLINE_SET_LAND_WALK = 0xA65E, - SMSG_MOVE_SPLINE_SET_NORMAL_FALL = 0xE2FC, - SMSG_MOVE_SPLINE_SET_PITCH_RATE = 0x60CE, - SMSG_MOVE_SPLINE_SET_RUN_BACK_SPEED = 0x624E, - SMSG_MOVE_SPLINE_SET_RUN_MODE = 0x26CC, - SMSG_MOVE_SPLINE_SET_RUN_SPEED = 0xB2CE, // for others - SMSG_MOVE_SPLINE_SET_SWIM_BACK_SPEED = 0x326C, - SMSG_MOVE_SPLINE_SET_SWIM_SPEED = 0x327E, - SMSG_MOVE_SPLINE_SET_TURN_RATE = 0x745C, - SMSG_MOVE_SPLINE_SET_WALK_MODE = 0xF65C, - SMSG_MOVE_SPLINE_SET_WALK_SPEED = 0x0000, // exists, but not yet known - SMSG_MOVE_SPLINE_SET_WATER_WALK = 0xA24E, - SMSG_MOVE_SPLINE_START_SWIM = 0xF0FC, - SMSG_MOVE_SPLINE_STOP_SWIM = 0x66EE, - SMSG_MOVE_SPLINE_UNROOT = 0x64EE, - SMSG_MOVE_SPLINE_UNSET_FLYING = 0xB06E, - SMSG_MOVE_SPLINE_UNSET_HOVER = 0xA07E, - SMSG_MOVE_TELEPORT = 0xF25C, - SMSG_MOVE_UNROOT = 0xB0CE, //forced, for self - SMSG_MOVE_UNSET_CAN_FLY = 0xA24C, //forced, for self - SMSG_MOVE_UNSET_HOVERING = 0x325E, //forced, for self - SMSG_MOVE_UNSET_WALK_IN_AIR = 0x00, - SMSG_MOVE_UPDATE_KNOCK_BACK = 0x725C, - SMSG_MOVE_UPDATE_TELEPORT = 0xF6DC, - SMSG_MULTIPLE_PACKETS = 0xDCEA, - SMSG_NAME_QUERY_RESPONSE = 0x9CE6, - SMSG_NEW_TAXI_PATH = 0xC8FF, - SMSG_NEW_WORLD = 0x647E, - SMSG_NOTIFICATION = 0x1A56, - SMSG_NOTIFY_DANCE = 0xCE62, - SMSG_NOTIFY_DEST_LOC_SPELL_CAST = 0x5CE2, - SMSG_NPC_TEXT_UPDATE = 0x4C72, - SMSG_NPC_WONT_TALK = 0x00, - SMSG_OFFER_PETITION_ERROR = 0x1E7F, - SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA = 0x00, - SMSG_OPEN_CONTAINER = 0x00, - SMSG_OVERRIDE_LIGHT = 0xCC56, - SMSG_PAGE_TEXT_QUERY_RESPONSE = 0x18D2, - SMSG_PARTY_COMMAND_RESULT = 0xCCD6, - SMSG_PARTY_MEMBER_STATS = 0xDC5A, - SMSG_PARTY_MEMBER_STATS_FULL = 0x0EDF, - SMSG_PARTYKILLLOG = 0xCCC2, - SMSG_PAUSE_MIRROR_TIMER = 0xD8EE, - SMSG_PERIODICAURALOG = 0x8CF2, - SMSG_PET_ACTION_FEEDBACK = 0x4E5A, - SMSG_PET_ACTION_SOUND = 0x0CC7, - SMSG_PET_CAST_FAILED = 0x00, - SMSG_PET_DISMISS_SOUND = 0x9A56, - SMSG_PET_GUIDS = 0x5E6B, - SMSG_PET_LEARNED_SPELL = 0xDC5E, - SMSG_PET_MODE = 0x58DE, - SMSG_PET_NAME_INVALID = 0x00, - SMSG_PET_NAME_QUERY_RESPONSE = 0xDCD3, - SMSG_PET_REMOVED_SPELL = 0x18F6, - SMSG_PET_SPELLS = 0x5A43, - SMSG_PET_TAME_FAILURE = 0x48F7, - SMSG_PET_UPDATE_COMBO_POINTS = 0x1A47, - SMSG_PETGODMODE = 0x00, - SMSG_PETITION_QUERY_RESPONSE = 0xCAEE, - SMSG_PETITION_SHOW_SIGNATURES = 0x4E4A, - SMSG_PETITION_SHOWLIST = 0x8ED7, - SMSG_PETITION_SIGN_RESULTS = 0x5EE6, - SMSG_PLAY_DANCE = 0x8CFE, - SMSG_PLAY_MUSIC = 0x00, - SMSG_PLAY_OBJECT_SOUND = 0xCC57, - SMSG_PLAY_SOUND = 0x4ACF, - SMSG_PLAY_SPELL_IMPACT = 0x00, - SMSG_PLAY_SPELL_VISUAL = 0x00, - SMSG_PLAY_TIME_WARNING = 0xD857, - SMSG_PLAYED_TIME = 0x187F, - SMSG_PLAYER_DIFFICULTY_CHANGE = 0xD846, - SMSG_PLAYER_MOVE = 0xF66C, - SMSG_PLAYER_SKINNED = 0xDA63, - SMSG_PLAYER_VEHICLE_DATA = 0x186E, - SMSG_PLAYER_UNK_DEAD_ALIVE = 0x0AF3, // causes client to Signal either PLAYER_ALIVE or DEAD events. - SMSG_PLAYERBINDERROR = 0x5A4F, - SMSG_PLAYERBOUND = 0xCC46, - SMSG_PONG = 0x0380, - SMSG_POWER_UPDATE = 0x487E, - SMSG_PRE_RESURRECT = 0x1CFB, - SMSG_PROCRESIST = 0x9AEA, - SMSG_PROPOSE_LEVEL_GRANT = 0x0C42, - SMSG_PUREMOUNT_CANCELLED_OBSOLETE = 0x00, - SMSG_PVP_CREDIT = 0x9EF2, - SMSG_QUERY_QUESTS_COMPLETED_RESPONSE = 0x8E7A, - SMSG_QUERY_TIME_RESPONSE = 0xD85A, - SMSG_QUEST_CONFIRM_ACCEPT = 0x184B, - SMSG_QUEST_FORCE_REMOVED = 0x00, - SMSG_QUEST_NPC_QUERY_RESPONSE = 0xF67C, - SMSG_QUEST_POI_QUERY_RESPONSE = 0x8CC3, - SMSG_QUEST_QUERY_RESPONSE = 0x9E56, - SMSG_QUESTGIVER_OFFER_REWARD = 0x00, - SMSG_QUESTGIVER_QUEST_COMPLETE = 0x24EE, - SMSG_QUESTGIVER_QUEST_DETAILS = 0xCE5F, - SMSG_QUESTGIVER_QUEST_FAILED = 0xD8FF, - SMSG_QUESTGIVER_QUEST_INVALID = 0x00, - SMSG_QUESTGIVER_QUEST_LIST = 0xDEF6, - SMSG_QUESTGIVER_REQUEST_ITEMS = 0x9CEE, - SMSG_QUESTGIVER_STATUS = 0xC846, - SMSG_QUESTGIVER_STATUS_MULTIPLE = 0xDCFF, - SMSG_QUESTLOG_FULL = 0x4EDE, - SMSG_QUESTUPDATE_ADD_ITEM = 0x9CCF, - SMSG_QUESTUPDATE_ADD_KILL = 0x00, - SMSG_QUESTUPDATE_ADD_PVP_KILL = 0x00, - SMSG_QUESTUPDATE_COMPLETE = 0x9CD6, - SMSG_QUESTUPDATE_FAILED = 0x9EF6, - SMSG_QUESTUPDATE_FAILEDTIMER = 0x00, - SMSG_RAID_GROUP_ONLY = 0xDCDB, - SMSG_RAID_INSTANCE_INFO = 0x4ACA, - SMSG_RAID_INSTANCE_MESSAGE = 0xD862, - SMSG_RANDOMIZE_CHAR_NAME = 0xF0DC, - SMSG_READ_ITEM_FAILED = 0x0C5B, - SMSG_READ_ITEM_OK = 0x9ECE, - SMSG_REAL_GROUP_UPDATE = 0x4C56, - SMSG_REALM_SPLIT = 0x1AF2, - SMSG_RECEIVED_MAIL = 0xDEE2, - SMSG_REDIRECT_CLIENT = 0x0180, - SMSG_REFER_A_FRIEND_FAILURE = 0x4867, - SMSG_REMOVED_SPELL = 0x98FE, - SMSG_REPORT_PVP_AFK_RESULT = 0x0E56, - SMSG_REQUEST_CEMETERY_LIST_RESPONSE = 0x00, - SMSG_RESET_FAILED_NOTIFY = 0x00, - SMSG_RESISTLOG = 0x00, - SMSG_RESPOND_INSPECT_ACHIEVEMENTS = 0x00, - SMSG_RESURRECT_REQUEST = 0x0AFE, - SMSG_RESYNC_RUNES = 0x9E76, - SMSG_RWHOIS = 0xCCE2, - SMSG_SELL_ITEM = 0x9CD3, - SMSG_SEND_MAIL_RESULT = 0x8CC2, - SMSG_SEND_UNLEARN_SPELLS = 0xCED2, - SMSG_SERVER_FIRST_ACHIEVEMENT = 0x0CDF, - SMSG_SERVER_MESSAGE = 0xC873, - SMSG_SERVERTIME = 0x1CD7, - SMSG_SET_FACTION_ATWAR = 0x1E47, - SMSG_SET_FACTION_STANDING = 0x1AE3, - SMSG_SET_FACTION_VISIBLE = 0x4CEB, - SMSG_SET_FLAT_SPELL_MODIFIER = 0x4EF2, - SMSG_SET_FORCED_REACTIONS = 0xD8C3, - SMSG_SET_PCT_SPELL_MODIFIER = 0x485B, - SMSG_SET_PHASE_SHIFT = 0x204C, - SMSG_SET_PLAY_HOVER_ANIM = 0xA27E, //forced, for self - SMSG_SET_PLAYER_DECLINED_NAMES_RESULT = 0x0E67, - SMSG_SET_PROFICIENCY = 0x9C5F, - SMSG_SET_PROJECTILE_POSITION = 0xC8F7, - SMSG_SHOW_BANK = 0x0CCA, - SMSG_SHOWTAXINODES = 0x0000, - SMSG_SPELL_COOLDOWN = 0x88D6, - SMSG_SPELL_DELAYED = 0x1AD3, - SMSG_SPELL_FAILED_OTHER = 0xCE4A, - SMSG_SPELL_FAILURE = 0x9A66, - SMSG_SPELL_GO = 0x0A53, - SMSG_SPELL_START = 0xCE43, - SMSG_SPELL_UPDATE_CHAIN_TARGETS = 0x98EE, - SMSG_SPELLBREAKLOG = 0x9E5F, - SMSG_SPELLDAMAGESHIELD = 0x8AFE, - SMSG_SPELLDISPELLOG = 0x08EA, - SMSG_SPELLENERGIZELOG = 0xD8FB, - SMSG_SPELLHEALLOG = 0xDE4A, - SMSG_SPELLINSTAKILLLOG = 0x8ED2, - SMSG_SPELLLOGEXECUTE = 0x8AD7, - SMSG_SPELLLOGMISS = 0x1CFF, - SMSG_SPELLNONMELEEDAMAGELOG = 0x5CCF, - SMSG_SPELLORDAMAGE_IMMUNE = 0x48FA, - SMSG_SPELLSTEALLOG = 0x08E3, - SMSG_SPIRIT_HEALER_CONFIRM = 0x0A4A, - SMSG_STABLE_RESULT = 0x0A5B, - SMSG_STANDSTATE_UPDATE = 0x4E52, - SMSG_START_MIRROR_TIMER = 0xDA66, - SMSG_STOP_DANCE = 0x8E5F, - SMSG_STOP_MIRROR_TIMER = 0x1E52, - SMSG_SUMMON_CANCEL = 0x8A4E, - SMSG_SUMMON_REQUEST = 0x9A52, - SMSG_SUPERCEDED_SPELL = 0xDE53, - SMSG_SUSPEND_TOKEN_RESPONSE = 0xE2EE, - SMSG_TALENTS_ERROR = 0x8AE2, // int32 : 1: ERR_TALENT_FAILED_UNKNOWN 2: ERR_TALENT_FAILED_NOT_ENOUGH_TALENTS_IN_PRIMARY_TREE 3: ERR_TALENT_FAILED_NO_PRIMARY_TREE_SELECTED - SMSG_TALENTS_INFO = 0x5EC6, - SMSG_TALENTS_INVOLUNTARILY_RESET = 0x1C7B, - SMSG_TAXINODE_STATUS = 0x8CFB, - SMSG_TEXT_EMOTE = 0x9E5A, - SMSG_THREAT_CLEAR = 0x9E4A, - SMSG_THREAT_REMOVE = 0x8A7E, - SMSG_THREAT_UPDATE = 0x0CE3, - SMSG_TIME_SYNC_REQ = 0xE46E, - SMSG_TITLE_EARNED = 0x1AFA, - SMSG_TOGGLE_XP_GAIN = 0x8A5B, - SMSG_TOTEM_CREATED = 0xCEF6, - SMSG_TRADE_STATUS = 0xA0DC, - SMSG_TRADE_STATUS_EXTENDED = 0xF0EC, - SMSG_TRAINER_BUY_RESULT = 0x00, - SMSG_TRAINER_BUY_SUCCEEDED = 0xDCDE, - SMSG_TRAINER_LIST = 0xC84E, - SMSG_TRANSFER_ABORTED = 0x0CF7, - SMSG_TRANSFER_PENDING = 0xCA6E, - SMSG_TRIGGER_CINEMATIC = 0xCE5B, - SMSG_TRIGGER_MOVIE = 0x1A7B, - SMSG_TURN_IN_PETITION_RESULTS = 0x08DB, - SMSG_TUTORIAL_FLAGS = 0x1A46, - SMSG_UNIT_SPELLCAST_START = 0x8C63, - SMSG_UPDATE_ACCOUNT_DATA = 0x4A73, - SMSG_UPDATE_ACCOUNT_DATA_COMPLETE = 0x5E53, - SMSG_UPDATE_COMBO_POINTS = 0x9AF6, - SMSG_UPDATE_CURRENCY = 0x00, - SMSG_UPDATE_CURRENCY_WEEK_LIMIT = 0x00, - SMSG_UPDATE_INSTANCE_ENCOUNTER_UNIT = 0x8C4A, - SMSG_UPDATE_INSTANCE_OWNERSHIP = 0xCA73, - SMSG_UPDATE_ITEM_ENCHANTMENTS = 0xCA43, - SMSG_UPDATE_LAST_INSTANCE = 0x58FE, - SMSG_UPDATE_OBJECT = 0x1EE7, - SMSG_UPDATE_WORLD_STATE = 0x08E2, - SMSG_USERLIST_ADD = 0x4CEE, - SMSG_USERLIST_REMOVE = 0x9A6B, - SMSG_USERLIST_UPDATE = 0x4A4B, - SMSG_VOICE_CHAT_STATUS = 0x9ADF, - SMSG_VOICE_PARENTAL_CONTROLS = 0x5ADE, - SMSG_VOICE_SESSION_LEAVE = 0xCE72, - SMSG_VOICE_SESSION_ROSTER_UPDATE = 0x8AC7, - SMSG_VOICE_SET_TALKER_MUTED = 0x8873, - SMSG_WARDEN_DATA = 0x484F, - SMSG_WEATHER = 0x4ECE, - SMSG_WHO = 0x4C7F, - SMSG_WHOIS = 0x9CFF, - SMSG_WORLD_STATE_UI_TIMER_UPDATE = 0xDE5E, - SMSG_ZONE_UNDER_ATTACK = 0x08CF, - SMSG_GMRESPONSE_DB_ERROR = 0x5843, + CMSG_ACCEPT_LEVEL_GRANT = 0x0205, + CMSG_ACCEPT_TRADE = 0x7110, + CMSG_ACTIVATETAXI = 0x0000, + CMSG_ACTIVATETAXIEXPRESS = 0x0000, + CMSG_ADD_FRIEND = 0x6C29, + CMSG_ADD_IGNORE = 0x0000, + CMSG_ADD_VOICE_IGNORE = 0x0F06, + CMSG_ALTER_APPEARANCE = 0x0914, + CMSG_AREATRIGGER = 0x0937, + CMSG_AREA_SPIRIT_HEALER_QUERY = 0x4907, + CMSG_AREA_SPIRIT_HEALER_QUEUE = 0x0000, + CMSG_ARENA_TEAM_ACCEPT = 0x0000, + CMSG_ARENA_TEAM_DECLINE = 0x0000, + CMSG_ARENA_TEAM_DISBAND = 0x6504, + CMSG_ARENA_TEAM_INVITE = 0x2F27, + CMSG_ARENA_TEAM_LEADER = 0x4204, + CMSG_ARENA_TEAM_LEAVE = 0x0E16, + CMSG_ARENA_TEAM_QUERY = 0x0000, + CMSG_ARENA_TEAM_REMOVE = 0x2F05, + CMSG_ARENA_TEAM_ROSTER = 0x0000, + CMSG_ATTACKSTOP = 0x4106, + CMSG_ATTACKSWING = 0x0926, + CMSG_AUCTION_LIST_BIDDER_ITEMS = 0x0000, + CMSG_AUCTION_LIST_ITEMS = 0x0324, + CMSG_AUCTION_LIST_OWNER_ITEMS = 0x0000, + CMSG_AUCTION_PLACE_BID = 0x2306, + CMSG_AUCTION_REMOVE_ITEM = 0x6426, + CMSG_AUCTION_SELL_ITEM = 0x4A06, + CMSG_AUTH_SESSION = 0x0449, + CMSG_AUTOBANK_ITEM = 0x0000, + CMSG_AUTOEQUIP_GROUND_ITEM = 0x0000, + CMSG_AUTOEQUIP_ITEM = 0x4304, + CMSG_AUTOEQUIP_ITEM_SLOT = 0x0000, + CMSG_AUTOSTORE_BAG_ITEM = 0x0000, + CMSG_AUTOSTORE_BANK_ITEM = 0x0000, + CMSG_AUTOSTORE_GROUND_ITEM = 0x0000, + CMSG_AUTOSTORE_LOOT_ITEM = 0x0E34, + CMSG_AUTO_DECLINE_GUILD_INVITES = 0x2034, + CMSG_BANKER_ACTIVATE = 0x0000, + CMSG_BATTLEFIELD_JOIN = 0x0000, + CMSG_BATTLEFIELD_LIST = 0x3814, + CMSG_BATTLEFIELD_REQUEST_SCORE_DATA = 0x0000, + CMSG_BATTLEFIELD_STATUS = 0x2500, + CMSG_BATTLEMASTER_JOIN_ARENA = 0x0000, + CMSG_BEGIN_TRADE = 0x0000, + CMSG_BINDER_ACTIVATE = 0x4006, + CMSG_BOT_DETECTED2 = 0x0000, + CMSG_BUG = 0x4035, + CMSG_BUSY_TRADE = 0x0000, + CMSG_BUYBACK_ITEM = 0x6C17, + CMSG_BUY_BANK_SLOT = 0x0425, + CMSG_BUY_ITEM = 0x0736, + CMSG_CALENDAR_ADD_EVENT = 0x0000, + CMSG_CALENDAR_ARENA_TEAM = 0x0000, + CMSG_CALENDAR_CONTEXT_EVENT_SIGNUP = 0x0000, + CMSG_CALENDAR_COPY_EVENT = 0x0000, + CMSG_CALENDAR_EVENT_INVITE = 0x0227, + CMSG_CALENDAR_EVENT_MODERATOR_STATUS = 0x0000, + CMSG_CALENDAR_EVENT_REMOVE_INVITE = 0x0000, + CMSG_CALENDAR_EVENT_RSVP = 0x0000, + CMSG_CALENDAR_EVENT_STATUS = 0x0000, + CMSG_CALENDAR_GET_EVENT = 0x0000, + CMSG_CALENDAR_GET_NUM_PENDING = 0x0000, + CMSG_CALENDAR_GUILD_FILTER = 0x0000, + CMSG_CALENDAR_REMOVE_EVENT = 0x0000, + CMSG_CALENDAR_UPDATE_EVENT = 0x0000, + CMSG_CANCEL_AURA = 0x0E26, + CMSG_CANCEL_AUTO_REPEAT_SPELL = 0x6C35, + CMSG_CANCEL_CAST = 0x0115, + CMSG_CANCEL_CHANNELLING = 0x6C25, + CMSG_CANCEL_GROWTH_AURA = 0x0000, + CMSG_CANCEL_MOUNT_AURA = 0x0635, + CMSG_CANCEL_TEMP_ENCHANTMENT = 0x0000, + CMSG_CANCEL_TRADE = 0x731E, + CMSG_CAST_SPELL = 0x4C07, + CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE = 0x0000, + CMSG_CHANNEL_ANNOUNCEMENTS = 0x1146, + CMSG_CHANNEL_BAN = 0x3D56, + CMSG_CHANNEL_DISPLAY_LIST = 0x2144, + CMSG_CHANNEL_INVITE = 0x0144, + CMSG_CHANNEL_KICK = 0x3156, + CMSG_CHANNEL_LIST = 0x1556, + CMSG_CHANNEL_MODERATOR = 0x2944, + CMSG_CHANNEL_MUTE = 0x2554, + CMSG_CHANNEL_OWNER = 0x3D44, + CMSG_CHANNEL_PASSWORD = 0x9558, + CMSG_CHANNEL_ROSTER_INFO = 0x3546, + CMSG_CHANNEL_SET_OWNER = 0x3556, + CMSG_CHANNEL_UNBAN = 0x2D46, + CMSG_CHANNEL_UNMODERATOR = 0x1954, + CMSG_CHANNEL_UNMUTE = 0x3554, + CMSG_CHAR_CREATE = 0x4A36, + CMSG_CHAR_CUSTOMIZE = 0x0000, + CMSG_CHAR_DELETE = 0x6425, + CMSG_CHAR_ENUM = 0x0502, + CMSG_CHAR_FACTION_CHANGE = 0x2735, + CMSG_CHAR_RACE_CHANGE = 0x0D24, + CMSG_CHAR_RENAME = 0x2327, + CMSG_CLEAR_CHANNEL_WATCH = 0x2604, + CMSG_CLEAR_TRADE_ITEM = 0x0000, + CMSG_COMMENTATOR_ENABLE = 0x0B07, + CMSG_COMMENTATOR_ENTER_INSTANCE = 0x4105, + CMSG_COMMENTATOR_EXIT_INSTANCE = 0x6136, + CMSG_COMMENTATOR_GET_MAP_INFO = 0x0026, + CMSG_COMMENTATOR_GET_PLAYER_INFO = 0x0D14, + CMSG_COMMENTATOR_INSTANCE_COMMAND = 0x0917, + CMSG_COMMENTATOR_SKIRMISH_QUEUE_COMMAND = 0x0025, + CMSG_COMMENTATOR_START_WARGAME = 0x0000, + CMSG_COMPLAIN = 0x0000, + CMSG_COMPLETE_CINEMATIC = 0x0A16, + CMSG_COMPLETE_MOVIE = 0x0000, + CMSG_CONTACT_LIST = 0x4534, + CMSG_CORPSE_MAP_POSITION_QUERY = 0x0000, + CMSG_CREATURE_QUERY = 0x2706, + CMSG_DANCE_QUERY = 0x0000, + CMSG_DECLINE_CHANNEL_INVITE = 0x0000, + CMSG_DEL_FRIEND = 0x6A15, + CMSG_DEL_IGNORE = 0x4727, + CMSG_DEL_VOICE_IGNORE = 0x0024, + CMSG_DESTROYITEM = 0x0000, + CMSG_DESTROY_ITEMS = 0x4A27, + CMSG_DUEL_ACCEPTED = 0x0000, + CMSG_DUEL_CANCELLED = 0x0000, + CMSG_EJECT_PASSENGER = 0x0000, + CMSG_EMOTE = 0x4C26, + CMSG_ENABLE_NAGLE = 0x0000, + CMSG_EQUIPMENT_SET_DELETE = 0x0000, + CMSG_EQUIPMENT_SET_SAVE = 0x0000, + CMSG_EQUIPMENT_SET_USE = 0x0000, + CMSG_FORCE_MOVE_ROOT_ACK = 0x0000, + CMSG_FORCE_MOVE_UNROOT_ACK = 0x7DB4, + CMSG_GAMEOBJECT_QUERY = 0x4017, + CMSG_GAMEOBJ_REPORT_USE = 0x0000, + CMSG_GAMEOBJ_USE = 0x0000, + CMSG_GAMESPEED_SET = 0x0000, + CMSG_GAMETIME_SET = 0x0000, + CMSG_GETDEATHBINDZONE = 0x0000, + CMSG_GET_MAIL_LIST = 0x4D37, + CMSG_GET_MIRRORIMAGE_DATA = 0x0C25, + CMSG_GHOST = 0x0000, + CMSG_GMRESPONSE_RESOLVE = 0x0000, + CMSG_GMSURVEY_SUBMIT = 0x0000, + CMSG_GMTICKET_CREATE = 0x0000, + CMSG_GMTICKET_DELETETICKET = 0x0000, + CMSG_GMTICKET_GETTICKET = 0x0000, + CMSG_GMTICKET_SYSTEMSTATUS = 0x0000, + CMSG_GMTICKET_UPDATETEXT = 0x0636, + CMSG_GM_INVIS = 0x0000, + CMSG_GM_NUKE = 0x0000, + CMSG_GM_REPORT_LAG = 0x0000, + CMSG_GM_SET_SECURITY_GROUP = 0x0000, + CMSG_GOSSIP_HELLO = 0x4525, + CMSG_GOSSIP_SELECT_OPTION = 0x0216, + CMSG_GRANT_LEVEL = 0x0000, + CMSG_GROUP_ACCEPT = 0x0000, + CMSG_GROUP_ASSISTANT_LEADER = 0x6025, + CMSG_GROUP_CANCEL = 0x0000, + CMSG_GROUP_CHANGE_SUB_GROUP = 0x4124, + CMSG_GROUP_DECLINE = 0x0000, + CMSG_GROUP_DISBAND = 0x0000, + CMSG_GROUP_INVITE = 0x0000, + CMSG_GROUP_RAID_CONVERT = 0x6E27, + CMSG_GROUP_SET_LEADER = 0x4C17, + CMSG_GROUP_SWAP_SUB_GROUP = 0x0034, + CMSG_GROUP_UNINVITE = 0x0000, + CMSG_GROUP_UNINVITE_GUID = 0x0000, + CMSG_GUILDFINDER_JOIN = 0x0000, + CMSG_GUILD_ACCEPT = 0x2531, + CMSG_GUILD_BANKER_ACTIVATE = 0x2E37, + CMSG_GUILD_BANK_BUY_TAB = 0x0000, + CMSG_GUILD_BANK_DEPOSIT_MONEY = 0x0000, + CMSG_GUILD_BANK_NOTE = 0x0000, + CMSG_GUILD_BANK_QUERY_TAB = 0x2E35, + CMSG_GUILD_BANK_SWAP_ITEMS = 0x2315, + CMSG_GUILD_BANK_UPDATE_TAB = 0x0106, + CMSG_GUILD_BANK_WITHDRAW_MONEY = 0x0000, + CMSG_GUILD_CREATE = 0x0000, + CMSG_GUILD_DECLINE = 0x0000, + CMSG_GUILD_DEMOTE = 0x0000, + CMSG_GUILD_DISBAND = 0x0000, + CMSG_GUILD_INFO = 0x0000, + CMSG_GUILD_INVITE = 0x0000, + CMSG_GUILD_LEADER = 0x0000, + CMSG_GUILD_LEAVE = 0x0000, + CMSG_GUILD_MOTD = 0x1035, + CMSG_GUILD_PROMOTE = 0x0000, + CMSG_GUILD_QUERY = 0x4426, + CMSG_GUILD_RANK = 0x0000, + CMSG_GUILD_REMOVE = 0x0000, + CMSG_GUILD_ROSTER = 0x1026, + CMSG_GUILD_SET_NOTE = 0x0000, + CMSG_HEARTH_AND_RESURRECT = 0x4B34, + CMSG_IGNORE_TRADE = 0x0000, + CMSG_INITIATE_TRADE = 0x0000, + CMSG_INSPECT = 0x0927, + CMSG_INSTANCE_LOCK_WARNING_RESPONSE = 0x6234, + CMSG_ITEM_REFUND = 0x6134, + CMSG_ITEM_REFUND_INFO = 0x2206, + CMSG_ITEM_TEXT_QUERY = 0x0000, + CMSG_JOIN_CHANNEL = 0x0156, + CMSG_KEEP_ALIVE = 0x0000, + CMSG_LEARN_PREVIEW_TALENTS = 0x2415, + CMSG_LEARN_PREVIEW_TALENTS_PET = 0x0000, + CMSG_LEARN_TALENT = 0x6E24, + CMSG_LEAVE_BATTLEFIELD = 0x0000, + CMSG_LEAVE_CHANNEL = 0x0000, + CMSG_LFG_GET_PLAYER_INFO = 0x0000, + CMSG_LFG_JOIN = 0x2581, + CMSG_LFG_LEAVE = 0x0000, + CMSG_LFG_LFR_JOIN = 0x0000, + CMSG_LFG_LFR_LEAVE = 0x0000, + CMSG_LFG_PARTY_LOCK_INFO_REQUEST = 0x0000, + CMSG_LFG_PROPOSAL_RESULT = 0x0000, + CMSG_LFG_SET_ROLES = 0x25B1, + CMSG_LFG_TELEPORT = 0x0000, + CMSG_LIST_INVENTORY = 0x2806, + CMSG_LOAD_SCREEN = 0x2422, + CMSG_LOGOUT_CANCEL = 0x2324, + CMSG_LOGOUT_REQUEST = 0x0A25, + CMSG_LOG_DISCONNECT = 0x446D, + CMSG_LOOT = 0x0127, + CMSG_LOOT_METHOD = 0x2F24, + CMSG_LOOT_MONEY = 0x6227, + CMSG_LOOT_RELEASE = 0x2007, + CMSG_LOOT_ROLL = 0x0000, + CMSG_MAIL_CREATE_TEXT_ITEM = 0x0B14, + CMSG_MAIL_DELETE = 0x0000, + CMSG_MAIL_MARK_AS_READ = 0x0000, + CMSG_MAIL_RETURN_TO_SENDER = 0x0000, + CMSG_MAIL_TAKE_ITEM = 0x2B06, + CMSG_MAIL_TAKE_MONEY = 0x4034, + CMSG_MEETINGSTONE_INFO = 0x0000, + CMSG_MESSAGECHAT_ADDON_BATTLEGROUND = 0x0000, + CMSG_MESSAGECHAT_ADDON_GUILD = 0x0544, + CMSG_MESSAGECHAT_ADDON_PARTY = 0x0546, + CMSG_MESSAGECHAT_ADDON_RAID = 0x0000, + CMSG_MESSAGECHAT_ADDON_WHISPER = 0x0000, + CMSG_MESSAGECHAT_AFK = 0x0000, + CMSG_MESSAGECHAT_BATTLEGROUND = 0x0000, + CMSG_MESSAGECHAT_BATTLEGROUND_LEADER = 0x0000, + CMSG_MESSAGECHAT_CHANNEL = 0x1D44, + CMSG_MESSAGECHAT_DND = 0x0000, + CMSG_MESSAGECHAT_EMOTE = 0x0000, + CMSG_MESSAGECHAT_GUILD = 0x3956, + CMSG_MESSAGECHAT_OFFICER = 0x1946, + CMSG_MESSAGECHAT_PARTY = 0x0000, + CMSG_MESSAGECHAT_PARTY_LEADER = 0x0000, + CMSG_MESSAGECHAT_RAID = 0x0000, + CMSG_MESSAGECHAT_RAID_LEADER = 0x0000, + CMSG_MESSAGECHAT_RAID_WARNING = 0x0000, + CMSG_MESSAGECHAT_SAY = 0x1154, + CMSG_MESSAGECHAT_WHISPER = 0x0D56, + CMSG_MESSAGECHAT_YELL = 0x3544, + CMSG_MINIGAME_MOVE = 0x0000, + CMSG_MOUNTSPECIAL_ANIM = 0x0000, + CMSG_MOVE_CHARM_TELEPORT_CHEAT = 0x0000, + CMSG_MOVE_ENABLE_SWIM_TO_FLY_TRANS_ACK = 0x0000, + CMSG_MOVE_FEATHER_FALL_ACK = 0x0000, + CMSG_MOVE_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK = 0x0000, + CMSG_MOVE_FORCE_FLIGHT_SPEED_CHANGE_ACK = 0x0000, + CMSG_MOVE_FORCE_PITCH_RATE_CHANGE_ACK = 0x0000, + CMSG_MOVE_FORCE_RUN_BACK_SPEED_CHANGE_ACK = 0x0000, + CMSG_MOVE_FORCE_RUN_SPEED_CHANGE_ACK = 0x0000, + CMSG_MOVE_FORCE_SWIM_BACK_SPEED_CHANGE_ACK = 0x0000, + CMSG_MOVE_FORCE_SWIM_SPEED_CHANGE_ACK = 0x0000, + CMSG_MOVE_FORCE_TURN_RATE_CHANGE_ACK = 0x0000, + CMSG_MOVE_FORCE_WALK_SPEED_CHANGE_ACK = 0x0000, + CMSG_MOVE_GRAVITY_DISABLE_ACK = 0x0000, + CMSG_MOVE_GRAVITY_ENABLE_ACK = 0x0000, + CMSG_MOVE_HOVER_ACK = 0x0000, + CMSG_MOVE_KNOCK_BACK_ACK = 0x5CB4, + CMSG_MOVE_SET_CAN_FLY_ACK = 0x0000, + CMSG_MOVE_SET_COLLISION_HEIGHT_ACK = 0x0000, + CMSG_MOVE_SET_RELATIVE_POSITION = 0x0000, + CMSG_MOVE_SET_VEHICLE_REC_ID_ACK = 0x0000, + CMSG_MOVE_TELEPORT_ACK = 0x0000, + CMSG_MOVE_TELEPORT_CHEAT = 0x0000, + CMSG_MOVE_TIME_SKIPPED = 0x7A0A, + CMSG_MOVE_TOGGLE_COLLISION_ACK = 0x0000, + CMSG_MOVE_WATER_WALK_ACK = 0x0000, + CMSG_NAME_QUERY = 0x2224, + CMSG_NEW_SPELL_SLOT = 0x0000, + CMSG_NEXT_CINEMATIC_CAMERA = 0x0000, + CMSG_NPC_TEXT_QUERY = 0x4E24, + CMSG_OFFER_PETITION = 0x4817, + CMSG_OPENING_CINEMATIC = 0x0000, + CMSG_OPEN_ITEM = 0x0000, + CMSG_OPT_OUT_OF_LOOT = 0x0000, + CMSG_PAGE_TEXT_QUERY = 0x0000, + CMSG_PETITION_BUY = 0x4E05, + CMSG_PETITION_QUERY = 0x0000, + CMSG_PETITION_SHOWLIST = 0x0000, + CMSG_PETITION_SHOW_SIGNATURES = 0x0000, + CMSG_PETITION_SIGN = 0x0E04, + CMSG_PET_ABANDON = 0x0000, + CMSG_PET_ACTION = 0x0226, + CMSG_PET_CANCEL_AURA = 0x0000, + CMSG_PET_CAST_SPELL = 0x6337, + CMSG_PET_LEARN_TALENT = 0x0000, + CMSG_PET_NAME_QUERY = 0x0000, + CMSG_PET_RENAME = 0x0000, + CMSG_PET_SET_ACTION = 0x0000, + CMSG_PET_SPELL_AUTOCAST = 0x0000, + CMSG_PET_STOP_ATTACK = 0x0000, + CMSG_PING = 0x444D, + CMSG_PLAYED_TIME = 0x0804, + CMSG_PLAYER_DIFFICULTY_CHANGE = 0x0000, + CMSG_PLAYER_LOGIN = 0x05B1, + CMSG_PLAYER_LOGOUT = 0x0000, + CMSG_PLAYER_VEHICLE_ENTER = 0x0000, + CMSG_PLAY_DANCE = 0x0000, + CMSG_PUSHQUESTTOPARTY = 0x4B14, + CMSG_QUERY_GUILD_MAX_XP = 0x0000, + CMSG_QUERY_GUILD_REWARDS = 0x0000, + CMSG_QUERY_GUILD_XP = 0x0000, + CMSG_QUERY_QUESTS_COMPLETED = 0x2317, + CMSG_QUERY_TIME = 0x0A36, + CMSG_QUESTGIVER_ACCEPT_QUEST = 0x0000, + CMSG_QUESTGIVER_CANCEL = 0x0000, + CMSG_QUESTGIVER_CHOOSE_REWARD = 0x0000, + CMSG_QUESTGIVER_COMPLETE_QUEST = 0x7302, + CMSG_QUESTGIVER_HELLO = 0x0D17, + CMSG_QUESTGIVER_QUERY_QUEST = 0x0000, + CMSG_QUESTGIVER_QUEST_AUTOLAUNCH = 0x0000, + CMSG_QUESTGIVER_REQUEST_REWARD = 0x0000, + CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY = 0x6305, + CMSG_QUESTGIVER_STATUS_QUERY = 0x4407, + CMSG_QUESTLOG_REMOVE_QUEST = 0x0000, + CMSG_QUESTLOG_SWAP_QUEST = 0x0000, + CMSG_QUEST_CONFIRM_ACCEPT = 0x0000, + CMSG_QUEST_NPC_QUERY = 0x0000, + CMSG_QUEST_POI_QUERY = 0x4037, + CMSG_QUEST_QUERY = 0x0D06, + CMSG_RANDOMIZE_CHAR_NAME = 0x2413, + CMSG_READY_FOR_ACCOUNT_DATA_TIMES = 0x2B16, + CMSG_READ_ITEM = 0x0000, + CMSG_REALM_SPLIT = 0x2906, + CMSG_RECLAIM_CORPSE = 0x4036, + CMSG_REDIRECTION_AUTH_PROOF = 0x044D, + CMSG_REPAIR_ITEM = 0x2917, + CMSG_REPLACE_ACCOUNT_DATA = 0x0000, + CMSG_REPOP_REQUEST = 0x0000, + CMSG_REPORT_PVP_AFK = 0x0000, + CMSG_REQUEST_ACCOUNT_DATA = 0x6505, + CMSG_REQUEST_CATEGORY_COOLDOWNS = 0x7102, + CMSG_REQUEST_CEMETERY_LIST = 0x720A, + CMSG_REQUEST_HOTFIX = 0x2401, + CMSG_REQUEST_PARTY_MEMBER_STATS = 0x0000, + CMSG_REQUEST_PET_INFO = 0x4924, + CMSG_REQUEST_RAID_INFO = 0x2F26, + CMSG_REQUEST_RATED_BG_INFO = 0x34A1, + CMSG_REQUEST_VEHICLE_EXIT = 0x0000, + CMSG_REQUEST_VEHICLE_NEXT_SEAT = 0x0000, + CMSG_REQUEST_VEHICLE_PREV_SEAT = 0x0000, + CMSG_REQUEST_VEHICLE_SWITCH_SEAT = 0x0000, + CMSG_RESET_INSTANCES = 0x6E14, + CMSG_RESURRECT_RESPONSE = 0x6827, + CMSG_RETURN_TO_GRAVEYARD = 0x0000, + CMSG_SAVE_PLAYER = 0x0000, + CMSG_SEARCH_LFG_JOIN = 0x0000, + CMSG_SEARCH_LFG_LEAVE = 0x0000, + CMSG_SELF_RES = 0x6115, + CMSG_SELL_ITEM = 0x4E15, + CMSG_SERVERTIME = 0x0000, + CMSG_SETDEATHBINDPOINT = 0x0000, + CMSG_SETSHEATHED = 0x4326, + CMSG_SET_ACTIONBAR_TOGGLES = 0x2506, + CMSG_SET_ACTION_BUTTON = 0x6F06, + CMSG_SET_ACTIVE_MOVER = 0x3314, + CMSG_SET_ACTIVE_VOICE_CHANNEL = 0x4305, + CMSG_SET_ALLOW_LOW_LEVEL_RAID1 = 0x4435, + CMSG_SET_ALLOW_LOW_LEVEL_RAID2 = 0x0536, + CMSG_SET_CHANNEL_WATCH = 0x0000, + CMSG_SET_CONTACT_NOTES = 0x0000, + CMSG_SET_FACTION_ATWAR = 0x0000, + CMSG_SET_FACTION_CHEAT = 0x0000, + CMSG_SET_GUILD_BANK_TEXT = 0x0000, + CMSG_SET_LFG_COMMENT = 0x0000, + CMSG_SET_PLAYER_DECLINED_NAMES = 0x0000, + CMSG_SET_PRIMARY_TALENT_TREE = 0x4524, + CMSG_SET_SAVED_INSTANCE_EXTEND = 0x6706, + CMSG_SET_SELECTION = 0x0506, + CMSG_SET_SKILL_CHEAT = 0x0000, + CMSG_SET_TAXI_BENCHMARK_MODE = 0x4314, + CMSG_SET_TITLE = 0x2117, + CMSG_SET_TRADE_GOLD = 0x0000, + CMSG_SET_TRADE_ITEM = 0x0000, + CMSG_SET_WATCHED_FACTION = 0x0000, + CMSG_SHOWING_CLOAK = 0x4135, + CMSG_SHOWING_HELM = 0x0735, + CMSG_SOCKET_GEMS = 0x2F04, + CMSG_SPELLCLICK = 0x0000, + CMSG_SPIRIT_HEALER_ACTIVATE = 0x2E26, + CMSG_SPLIT_ITEM = 0x0000, + CMSG_STANDSTATECHANGE = 0x0535, + CMSG_START_QUEST = 0x0000, + CMSG_STOP_DANCE = 0x0000, + CMSG_STORE_LOOT_IN_SLOT = 0x0000, + CMSG_SUMMON_RESPONSE = 0x0000, + CMSG_SUSPEND_TOKEN = 0x046D, + CMSG_SWAP_INV_ITEM = 0x2614, + CMSG_SWAP_ITEM = 0x6326, + CMSG_TAXICLEARALLNODES = 0x0000, + CMSG_TAXIENABLEALLNODES = 0x0000, + CMSG_TAXINODE_STATUS_QUERY = 0x2F25, + CMSG_TAXIQUERYAVAILABLENODES = 0x0000, + CMSG_TAXISHOWNODES = 0x0000, + CMSG_TELEPORT_TO_UNIT = 0x0000, + CMSG_TEXT_EMOTE = 0x2E24, + CMSG_TIME_SYNC_RESP = 0x3B0C, + CMSG_TOGGLE_PVP = 0x6815, + CMSG_TOTEM_DESTROYED = 0x0000, + CMSG_TRAINER_BUY_SPELL = 0x4415, + CMSG_TRAINER_LIST = 0x2336, + CMSG_TRIGGER_CINEMATIC_CHEAT = 0x0000, + CMSG_TURN_IN_PETITION = 0x0000, + CMSG_TUTORIAL_CLEAR = 0x0000, + CMSG_TUTORIAL_FLAG = 0x0000, + CMSG_TUTORIAL_RESET = 0x0000, + CMSG_UNACCEPT_TRADE = 0x0000, + CMSG_UNLEARN_SKILL = 0x0000, + CMSG_UNREGISTER_ALL_ADDON_PREFIXES = 0x3D54, + CMSG_UPDATE_ACCOUNT_DATA = 0x4736, + CMSG_UPDATE_MISSILE_TRAJECTORY = 0x0000, + CMSG_UPDATE_PROJECTILE_POSITION = 0x0000, + CMSG_USE_ITEM = 0x0000, + CMSG_VIOLENCE_LEVEL = 0x7816, + CMSG_VOICE_SESSION_ENABLE = 0x2314, + CMSG_WARDEN_DATA = 0x25A2, + CMSG_WHO = 0x6C15, + CMSG_WHOIS = 0x6B05, + CMSG_WORLD_PORT_RESPONSE = 0x0000, + CMSG_WORLD_STATE_UI_TIMER_UPDATE = 0x4605, + CMSG_WORLD_TELEPORT = 0x3330, + CMSG_WRAP_ITEM = 0x0000, + CMSG_ZONEUPDATE = 0x4F37, + MSG_AUCTION_HELLO = 0x2307, + MSG_BATTLEGROUND_PLAYER_POSITIONS = 0x0000, + MSG_CHANNEL_START = 0x0000, + MSG_CHANNEL_UPDATE = 0x0000, + MSG_CORPSE_QUERY = 0x0000, + MSG_GM_BIND_OTHER = 0x0000, + MSG_GM_SHOWLABEL = 0x0000, + MSG_GM_SUMMON = 0x0000, + MSG_GUILD_BANK_LOG_QUERY = 0x0000, + MSG_GUILD_BANK_MONEY_WITHDRAWN = 0x0000, + MSG_GUILD_EVENT_LOG_QUERY = 0x0000, + MSG_GUILD_PERMISSIONS = 0x3022, + MSG_INSPECT_ARENA_TEAMS = 0x0000, + MSG_LIST_STABLED_PETS = 0x0000, + MSG_MINIMAP_PING = 0x6635, + MSG_MOVE_FALL_LAND = 0x380A, + MSG_MOVE_FEATHER_FALL = 0x0000, + MSG_MOVE_GRAVITY_CHNG = 0x0000, + MSG_MOVE_HEARTBEAT = 0x0000, + MSG_MOVE_HOVER = 0x0000, + MSG_MOVE_JUMP = 0x7A06, + MSG_MOVE_SET_ALL_SPEED_CHEAT = 0x0000, + MSG_MOVE_SET_FACING = 0x0000, + MSG_MOVE_SET_FLIGHT_BACK_SPEED_CHEAT = 0x0000, + MSG_MOVE_SET_FLIGHT_SPEED_CHEAT = 0x0000, + MSG_MOVE_SET_PITCH = 0x0000, + MSG_MOVE_SET_RAW_POSITION_ACK = 0x0000, + MSG_MOVE_SET_RUN_BACK_SPEED_CHEAT = 0x0000, + MSG_MOVE_SET_RUN_SPEED_CHEAT = 0x0000, + MSG_MOVE_SET_SWIM_BACK_SPEED_CHEAT = 0x0000, + MSG_MOVE_SET_SWIM_SPEED_CHEAT = 0x0000, + MSG_MOVE_SET_TURN_RATE_CHEAT = 0x0000, + MSG_MOVE_SET_WALK_SPEED_CHEAT = 0x0000, + MSG_MOVE_START_ASCEND = 0x390A, + MSG_MOVE_START_BACKWARD = 0x330A, + MSG_MOVE_START_DESCEND = 0x3800, + MSG_MOVE_START_FORWARD = 0x7814, + MSG_MOVE_START_PITCH_DOWN = 0x3908, + MSG_MOVE_START_PITCH_UP = 0x3304, + MSG_MOVE_START_STRAFE_LEFT = 0x3A16, + MSG_MOVE_START_STRAFE_RIGHT = 0x3A02, + MSG_MOVE_START_SWIM = 0x3206, + MSG_MOVE_START_TURN_LEFT = 0x700C, + MSG_MOVE_START_TURN_RIGHT = 0x7000, + MSG_MOVE_STOP = 0x320A, + MSG_MOVE_STOP_ASCEND = 0x7B00, + MSG_MOVE_STOP_PITCH = 0x7312, + MSG_MOVE_STOP_STRAFE = 0x3002, + MSG_MOVE_STOP_SWIM = 0x3802, + MSG_MOVE_STOP_TURN = 0x331E, + MSG_MOVE_TOGGLE_COLLISION_CHEAT = 0x7B04, + MSG_MOVE_TOGGLE_FALL_LOGGING = 0x0000, + MSG_MOVE_TOGGLE_LOGGING = 0x0000, + MSG_MOVE_UPDATE_CAN_FLY = 0x0000, + MSG_MOVE_WATER_WALK = 0x0000, + MSG_NOTIFY_PARTY_SQUELCH = 0x0000, + MSG_PARTY_ASSIGNMENT = 0x0000, + MSG_PETITION_DECLINE = 0x31E0, + MSG_PETITION_RENAME = 0x4005, + MSG_PVP_LOG_DATA = 0x5CB2, + MSG_QUERY_GUILD_BANK_TEXT = 0x0000, + MSG_QUERY_NEXT_MAIL_TIME = 0x0F04, + MSG_QUEST_PUSH_RESULT = 0x0000, + MSG_RAID_READY_CHECK = 0x0000, + MSG_RAID_READY_CHECK_CONFIRM = 0x0000, + MSG_RAID_READY_CHECK_FINISHED = 0x0000, + MSG_RAID_TARGET_UPDATE = 0x2C36, + MSG_RANDOM_ROLL = 0x0905, + MSG_SAVE_GUILD_EMBLEM = 0x2404, + MSG_SET_DUNGEON_DIFFICULTY = 0x4925, + MSG_SET_RAID_DIFFICULTY = 0x0614, + MSG_TABARDVENDOR_ACTIVATE = 0x6926, + MSG_TALENT_WIPE_CONFIRM = 0x0000, + MSG_VERIFY_CONNECTIVITY = 0x4F57, + SMSG_ACCOUNT_DATA_TIMES = 0x4B05, + SMSG_ACHIEVEMENT_DELETED = 0x0000, + SMSG_ACHIEVEMENT_EARNED = 0x4405, + SMSG_ACTION_BUTTONS = 0x38B5, + SMSG_ACTIVATETAXIREPLY = 0x0000, + SMSG_ADDON_INFO = 0x2C14, + SMSG_ADD_RUNE_POWER = 0x0000, + SMSG_AI_REACTION = 0x0637, + SMSG_ALL_ACHIEVEMENT_DATA = 0x58B1, + SMSG_AREA_SPIRIT_HEALER_TIME = 0x0000, + SMSG_AREA_TRIGGER_MESSAGE = 0x0000, + SMSG_ARENA_ERROR = 0x0000, + SMSG_ARENA_OPPONENT_UPDATE = 0x0000, + SMSG_ARENA_TEAM_CHANGE_FAILED_QUEUED = 0x0000, + SMSG_ARENA_TEAM_COMMAND_RESULT = 0x0000, + SMSG_ARENA_TEAM_EVENT = 0x0000, + SMSG_ARENA_TEAM_INVITE = 0x0000, + SMSG_ARENA_TEAM_QUERY_RESPONSE = 0x0000, + SMSG_ARENA_TEAM_ROSTER = 0x2717, + SMSG_ARENA_TEAM_STATS = 0x0000, + SMSG_ATTACKERSTATEUPDATE = 0x0B25, + SMSG_ATTACKSTART = 0x2D15, + SMSG_ATTACKSTOP = 0x0934, + SMSG_ATTACKSWING_BADFACING = 0x0B36, + SMSG_ATTACKSWING_CANT_ATTACK = 0x0016, + SMSG_ATTACKSWING_DEADTARGET = 0x0000, + SMSG_ATTACKSWING_NOTINRANGE = 0x0000, + SMSG_AUCTION_BIDDER_LIST_RESULT = 0x0000, + SMSG_AUCTION_BIDDER_NOTIFICATION = 0x0000, + SMSG_AUCTION_COMMAND_RESULT = 0x0000, + SMSG_AUCTION_LIST_PENDING_SALES = 0x0000, + SMSG_AUCTION_LIST_RESULT = 0x0000, + SMSG_AUCTION_OWNER_LIST_RESULT = 0x0000, + SMSG_AUCTION_OWNER_NOTIFICATION = 0x0000, + SMSG_AUCTION_REMOVED_NOTIFICATION = 0x0000, + SMSG_AURACASTLOG = 0x0000, + SMSG_AURA_UPDATE = 0x4707, + SMSG_AURA_UPDATE_ALL = 0x6916, + SMSG_AUTH_CHALLENGE = 0x4542, + SMSG_AUTH_RESPONSE = 0x5DB6, + SMSG_AVAILABLE_VOICE_CHANNEL = 0x0000, + SMSG_BARBER_SHOP_RESULT = 0x6125, + SMSG_BATTLEFIELD_LIST = 0x71B5, + SMSG_BATTLEFIELD_MGR_EJECTED = 0x0000, + SMSG_BATTLEFIELD_MGR_EJECT_PENDING = 0x0000, + SMSG_BATTLEFIELD_MGR_ENTERED = 0x0000, + SMSG_BATTLEFIELD_MGR_ENTRY_INVITE = 0x0000, + SMSG_BATTLEFIELD_MGR_QUEUE_INVITE = 0x0000, + SMSG_BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE = 0x0000, + SMSG_BATTLEFIELD_MGR_STATE_CHANGE = 0x0000, + SMSG_BATTLEFIELD_PORT_DENIED = 0x0000, + SMSG_BATTLEFIELD_STATUS = 0x0000, + SMSG_BATTLEFIELD_STATUS1 = 0x0000, + SMSG_BATTLEFIELD_STATUS2 = 0x0000, + SMSG_BATTLEFIELD_STATUS3 = 0x0000, + SMSG_BATTLEFIELD_STATUS4 = 0x0000, + SMSG_BATTLEGROUND_INFO_THROTTLED = 0x0000, + SMSG_BATTLEGROUND_PLAYER_JOINED = 0x0000, + SMSG_BATTLEGROUND_PLAYER_LEFT = 0x0000, + SMSG_BATTLEGROUND_PLAYER_POSITIONS = 0x0000, + SMSG_BINDER_CONFIRM = 0x0000, + SMSG_BINDPOINTUPDATE = 0x0527, + SMSG_BINDZONEREPLY = 0x0000, + SMSG_BREAK_TARGET = 0x0000, + SMSG_BUY_BANK_SLOT_RESULT = 0x0000, + SMSG_BUY_FAILED = 0x0000, + SMSG_BUY_ITEM = 0x0F26, + SMSG_CALENDAR_ACTION_PENDING = 0x0000, + SMSG_CALENDAR_ARENA_TEAM = 0x0000, + SMSG_CALENDAR_CLEAR_PENDING_ACTION = 0x0000, + SMSG_CALENDAR_COMMAND_RESULT = 0x6F36, + SMSG_CALENDAR_EVENT_INVITE = 0x0000, + SMSG_CALENDAR_EVENT_INVITE_ALERT = 0x0000, + SMSG_CALENDAR_EVENT_INVITE_NOTES = 0x0000, + SMSG_CALENDAR_EVENT_INVITE_NOTES_ALERT = 0x0000, + SMSG_CALENDAR_EVENT_INVITE_REMOVED = 0x0000, + SMSG_CALENDAR_EVENT_INVITE_REMOVED_ALERT = 0x0000, + SMSG_CALENDAR_EVENT_INVITE_STATUS_ALERT = 0x0000, + SMSG_CALENDAR_EVENT_MODERATOR_STATUS_ALERT = 0x0000, + SMSG_CALENDAR_EVENT_REMOVED_ALERT = 0x0000, + SMSG_CALENDAR_EVENT_STATUS = 0x0000, + SMSG_CALENDAR_EVENT_UPDATED_ALERT = 0x0000, + SMSG_CALENDAR_RAID_LOCKOUT_ADDED = 0x0000, + SMSG_CALENDAR_RAID_LOCKOUT_REMOVED = 0x0000, + SMSG_CALENDAR_RAID_LOCKOUT_UPDATED = 0x0000, + SMSG_CALENDAR_SEND_CALENDAR = 0x0000, + SMSG_CALENDAR_SEND_EVENT = 0x0000, + SMSG_CALENDAR_SEND_NUM_PENDING = 0x0000, + SMSG_CALENDAR_UPDATE_INVITE_LIST = 0x0000, + SMSG_CAMERA_SHAKE = 0x0000, + SMSG_CANCEL_AUTO_REPEAT = 0x6436, + SMSG_CANCEL_COMBAT = 0x0000, + SMSG_CAST_FAILED = 0x0000, + SMSG_CHANNEL_LIST = 0x0000, + SMSG_CHANNEL_MEMBER_COUNT = 0x0000, + SMSG_CHANNEL_NOTIFY = 0x0825, + SMSG_CHARACTER_LOGIN_FAILED = 0x0000, + SMSG_CHAR_CREATE = 0x2D05, + SMSG_CHAR_CUSTOMIZE = 0x0000, + SMSG_CHAR_DELETE = 0x0304, + SMSG_CHAR_ENUM = 0x10B0, + SMSG_CHAR_FACTION_CHANGE = 0x0000, + SMSG_CHAR_RENAME = 0x0000, + SMSG_CHAT_PLAYER_AMBIGUOUS = 0x0000, + SMSG_CHAT_PLAYER_NOT_FOUND = 0x0000, + SMSG_CHAT_RESTRICTED = 0x0000, + SMSG_CHAT_WRONG_FACTION = 0x0000, + SMSG_CHECK_FOR_BOTS = 0x0000, + SMSG_CLEAR_COOLDOWN = 0x0000, + SMSG_CLEAR_TARGET = 0x4B26, + SMSG_CLIENTCACHE_VERSION = 0x2734, + SMSG_CLIENT_CONTROL_UPDATE = 0x0000, + SMSG_COMBAT_LOG_MULTIPLE = 0x0000, + SMSG_COMMENTATOR_MAP_INFO = 0x0000, + SMSG_COMMENTATOR_PLAYER_INFO = 0x0000, + SMSG_COMMENTATOR_STATE_CHANGED = 0x0000, + SMSG_COMPLAIN_RESULT = 0x0000, + SMSG_COMPRESSED_ACHIEVEMENT_DATA = 0x0000, + SMSG_COMPRESSED_CHAR_ENUM = 0x0000, + SMSG_COMPRESSED_GUILD_ROSTER = 0x0000, + SMSG_COMPRESSED_MOVES = 0x0000, + SMSG_COMPRESSED_UPDATE_OBJECT = 0x0000, + SMSG_CONTACT_LIST = 0x6017, + SMSG_CONVERT_RUNE = 0x0000, + SMSG_COOLDOWN_CHEAT = 0x0000, + SMSG_COOLDOWN_EVENT = 0x4F26, + SMSG_CORPSE_MAP_POSITION_QUERY_RESPONSE = 0x0000, + SMSG_CORPSE_NOT_IN_INSTANCE = 0x0000, + SMSG_CORPSE_RECLAIM_DELAY = 0x0D34, + SMSG_CREATURE_QUERY_RESPONSE = 0x6024, + SMSG_CRITERIA_DELETED = 0x0000, + SMSG_CRITERIA_UPDATE = 0x6E37, + SMSG_CROSSED_INEBRIATION_THRESHOLD = 0x0000, + SMSG_DAMAGE_CALC_LOG = 0x0000, + SMSG_DAMAGE_DONE_OBSOLETE = 0x0000, + SMSG_DANCE_QUERY_RESPONSE = 0x0000, + SMSG_DB_REPLY = 0x38A4, + SMSG_DEATH_RELEASE_LOC = 0x0000, + SMSG_DEFENSE_MESSAGE = 0x0314, + SMSG_DESTROY_OBJECT = 0x4724, + SMSG_DESTRUCTIBLE_BUILDING_DAMAGE = 0x0000, + SMSG_DISMOUNT = 0x0000, + SMSG_DISMOUNTRESULT = 0x0000, + SMSG_DISPEL_FAILED = 0x0000, + SMSG_DUEL_COMPLETE = 0x0000, + SMSG_DUEL_COUNTDOWN = 0x0000, + SMSG_DUEL_INBOUNDS = 0x0000, + SMSG_DUEL_OUTOFBOUNDS = 0x0000, + SMSG_DUEL_REQUESTED = 0x4504, + SMSG_DUEL_WINNER = 0x2527, + SMSG_DURABILITY_DAMAGE_DEATH = 0x0000, + SMSG_ECHO_PARTY_SQUELCH = 0x0000, + SMSG_EMOTE = 0x0A34, + SMSG_ENABLE_BARBER_SHOP = 0x0000, + SMSG_ENCHANTMENTLOG = 0x6035, + SMSG_ENVIRONMENTALDAMAGELOG = 0x0000, + SMSG_EQUIPMENT_SET_LIST = 0x2E04, + SMSG_EQUIPMENT_SET_SAVED = 0x0000, + SMSG_EQUIPMENT_SET_USE_RESULT = 0x0000, + SMSG_EXPECTED_SPAM_RECORDS = 0x0000, + SMSG_EXPLORATION_EXPERIENCE = 0x0000, + SMSG_FEATURE_SYSTEM_STATUS = 0x3DB7, + SMSG_FISH_ESCAPED = 0x0000, + SMSG_FISH_NOT_HOOKED = 0x0000, + SMSG_FLIGHT_SPLINE_SYNC = 0x0924, + SMSG_FORCEACTIONSHOW = 0x0000, + SMSG_FORCED_DEATH_UPDATE = 0x0000, + SMSG_FORCE_DISPLAY_UPDATE = 0x0000, + SMSG_FORCE_SEND_QUEUED_PACKETS = 0x0140, + SMSG_FRIEND_STATUS = 0x0000, + SMSG_GAMEOBJECT_CUSTOM_ANIM = 0x0000, + SMSG_GAMEOBJECT_DESPAWN_ANIM = 0x0000, + SMSG_GAMEOBJECT_PAGETEXT = 0x0000, + SMSG_GAMEOBJECT_QUERY_RESPONSE = 0x0915, + SMSG_GAMEOBJECT_RESET_STATE = 0x0000, + SMSG_GAMESPEED_SET = 0x0000, + SMSG_GAMETIME_SET = 0x0000, + SMSG_GAMETIME_UPDATE = 0x0000, + SMSG_GMRESPONSE_DB_ERROR = 0x0000, + SMSG_GMRESPONSE_RECEIVED = 0x0000, + SMSG_GMRESPONSE_STATUS_UPDATE = 0x0000, + SMSG_GMTICKET_CREATE = 0x0000, + SMSG_GMTICKET_DELETETICKET = 0x0000, + SMSG_GMTICKET_GETTICKET = 0x0000, + SMSG_GMTICKET_SYSTEMSTATUS = 0x0000, + SMSG_GMTICKET_UPDATETEXT = 0x0000, + SMSG_GM_MESSAGECHAT = 0x6434, + SMSG_GODMODE = 0x0000, + SMSG_GOSSIP_COMPLETE = 0x0806, + SMSG_GOSSIP_MESSAGE = 0x2035, + SMSG_GOSSIP_POI = 0x4316, + SMSG_GROUP_CANCEL = 0x0000, + SMSG_GROUP_DECLINE = 0x0000, + SMSG_GROUP_DESTROYED = 0x0000, + SMSG_GROUP_INVITE = 0x0000, + SMSG_GROUP_JOINED_BATTLEGROUND = 0x0000, + SMSG_GROUP_LIST = 0x4C24, + SMSG_GROUP_SET_LEADER = 0x0526, + SMSG_GROUP_UNINVITE = 0x0000, + SMSG_GUILDFINDER_SEARCH_RESULT = 0x0000, + SMSG_GUILD_ACHIEVEMENT_DATA = 0x0000, + SMSG_GUILD_BANK_LIST = 0x78A5, + SMSG_GUILD_CANCEL = 0x0000, + SMSG_GUILD_COMMAND_RESULT = 0x0000, + SMSG_GUILD_DECLINE = 0x0000, + SMSG_GUILD_EVENT = 0x0705, + SMSG_GUILD_INFO = 0x0000, + SMSG_GUILD_INVITE = 0x14A2, + SMSG_GUILD_MAX_DAILY_XP = 0x0000, + SMSG_GUILD_NEWS_UPDATE = 0x0000, + SMSG_GUILD_QUERY_RESPONSE = 0x0E06, + SMSG_GUILD_RANK = 0x30B4, + SMSG_GUILD_RANKS_UPDATE = 0x0000, + SMSG_GUILD_REWARDS_LIST = 0x0000, + SMSG_GUILD_ROSTER = 0x3DA3, + SMSG_GUILD_SET_NOTE = 0x0000, + SMSG_GUILD_TRADESKILL_UPDATE = 0x0000, + SMSG_GUILD_UPDATE_ROSTER = 0x18B0, + SMSG_GUILD_XP_UPDATE = 0x0000, + SMSG_HIGHEST_THREAT_UPDATE = 0x0000, + SMSG_HOTFIX_INFO = 0x19B5, + SMSG_INITIALIZE_FACTIONS = 0x4634, + SMSG_INITIAL_SPELLS = 0x0104, + SMSG_INIT_CURRENCY = 0x15A5, + SMSG_INIT_WORLD_STATES = 0x4C15, + SMSG_INSPECT = 0x0000, + SMSG_INSPECT_HONOR_STATS = 0x0000, + SMSG_INSPECT_TALENT = 0x0000, + SMSG_INSTANCE_DIFFICULTY = 0x0000, + SMSG_INSTANCE_LOCK_WARNING_QUERY = 0x0000, + SMSG_INSTANCE_RESET = 0x0000, + SMSG_INSTANCE_RESET_FAILED = 0x0000, + SMSG_INSTANCE_SAVE_CREATED = 0x0000, + SMSG_INVALIDATE_DANCE = 0x0000, + SMSG_INVALIDATE_PLAYER = 0x6325, + SMSG_INVALID_PROMOTION_CODE = 0x0000, + SMSG_INVENTORY_CHANGE_FAILURE = 0x0000, + SMSG_ITEM_COOLDOWN = 0x0000, + SMSG_ITEM_ENCHANT_TIME_UPDATE = 0x0F27, + SMSG_ITEM_NAME_QUERY_RESPONSE = 0x0000, + SMSG_ITEM_PUSH_RESULT = 0x0000, + SMSG_ITEM_REFUND_INFO_RESPONSE = 0x0000, + SMSG_ITEM_REFUND_RESULT = 0x0000, + SMSG_ITEM_TEXT_QUERY_RESPONSE = 0x0000, + SMSG_ITEM_TIME_UPDATE = 0x0000, + SMSG_JOINED_BATTLEGROUND_QUEUE = 0x0000, + SMSG_KICK_REASON = 0x0000, + SMSG_LEARNED_DANCE_MOVES = 0x0E05, + SMSG_LEARNED_SPELL = 0x58A2, + SMSG_LEVELUP_INFO = 0x0000, + SMSG_LFG_BOOT_PLAYER = 0x0000, + SMSG_LFG_DISABLED = 0x0000, + SMSG_LFG_JOIN_RESULT = 0x0000, + SMSG_LFG_OFFER_CONTINUE = 0x0000, + SMSG_LFG_OPEN_FROM_GOSSIP = 0x0000, + SMSG_LFG_PARTY_INFO = 0x0000, + SMSG_LFG_PLAYER_INFO = 0x4B36, + SMSG_LFG_PLAYER_REWARD = 0x0000, + SMSG_LFG_PROPOSAL_UPDATE = 0x0000, + SMSG_LFG_QUEUE_STATUS = 0x0000, + SMSG_LFG_ROLE_CHECK_UPDATE = 0x0000, + SMSG_LFG_ROLE_CHOSEN = 0x0000, + SMSG_LFG_TELEPORT_DENIED = 0x0000, + SMSG_LFG_UPDATE_LIST = 0x0000, + SMSG_LFG_UPDATE_PARTY = 0x0000, + SMSG_LFG_UPDATE_PLAYER = 0x0000, + SMSG_LFG_UPDATE_SEARCH = 0x0000, + SMSG_LIST_INVENTORY = 0x7CB0, + SMSG_LOGIN_SETTIMESPEED = 0x4D15, + SMSG_LOGIN_VERIFY_WORLD = 0x2005, + SMSG_LOGOUT_CANCEL_ACK = 0x0000, + SMSG_LOGOUT_COMPLETE = 0x2137, + SMSG_LOGOUT_RESPONSE = 0x0524, + SMSG_LOG_XPGAIN = 0x4514, + SMSG_LOOT_ALL_PASSED = 0x6237, + SMSG_LOOT_CLEAR_MONEY = 0x0E15, + SMSG_LOOT_ITEM_NOTIFY = 0x6D15, + SMSG_LOOT_LIST = 0x0000, + SMSG_LOOT_MASTER_LIST = 0x0000, + SMSG_LOOT_MONEY_NOTIFY = 0x0000, + SMSG_LOOT_RELEASE_RESPONSE = 0x6D25, + SMSG_LOOT_REMOVED = 0x6817, + SMSG_LOOT_RESPONSE = 0x4C16, + SMSG_LOOT_ROLL = 0x6507, + SMSG_LOOT_ROLL_WON = 0x6617, + SMSG_LOOT_SLOT_CHANGED = 0x0000, + SMSG_LOOT_START_ROLL = 0x0000, + SMSG_MAIL_LIST_RESULT = 0x4217, + SMSG_MEETINGSTONE_COMPLETE = 0x0000, + SMSG_MEETINGSTONE_IN_PROGRESS = 0x0000, + SMSG_MEETINGSTONE_MEMBER_ADDED = 0x0000, + SMSG_MEETINGSTONE_SETQUEUE = 0x0000, + SMSG_MESSAGECHAT = 0x2026, + SMSG_MIRRORIMAGE_DATA = 0x0000, + SMSG_MODIFY_COOLDOWN = 0x0000, + SMSG_MONSTER_MOVE = 0x6E17, + SMSG_MONSTER_MOVE_TRANSPORT = 0x0000, + SMSG_MOTD = 0x0A35, + SMSG_MOUNTRESULT = 0x0000, + SMSG_MOUNTSPECIAL_ANIM = 0x0000, + SMSG_MOVE_DISABLE_COLLISION = 0x0000, + SMSG_MOVE_DISABLE_GRAVITY = 0x0000, + SMSG_MOVE_DISABLE_TRANSITION_BETWEEN_SWIM_AND_FLY = 0x0000, + SMSG_MOVE_ENABLE_COLLISION = 0x0000, + SMSG_MOVE_ENABLE_GRAVITY = 0x0000, + SMSG_MOVE_ENABLE_TRANSITION_BETWEEN_SWIM_AND_FLY = 0x0000, + SMSG_MOVE_KNOCK_BACK = 0x0000, + SMSG_MOVE_ROOT = 0x0000, + SMSG_MOVE_SET_ACTIVE_MOVER = 0x0000, + SMSG_MOVE_SET_CAN_FLY = 0x0000, + SMSG_MOVE_SET_COLLISION_HEIGHT = 0x0000, + SMSG_MOVE_SET_COMPOUND_STATE = 0x0000, + SMSG_MOVE_SET_FEATHER_FALL = 0x0000, + SMSG_MOVE_SET_FLIGHT_BACK_SPEED = 0x0000, + SMSG_MOVE_SET_FLIGHT_SPEED = 0x0000, + SMSG_MOVE_SET_HOVERING = 0x0000, + SMSG_MOVE_SET_LAND_WALK = 0x0000, + SMSG_MOVE_SET_NORMAL_FALL = 0x0000, + SMSG_MOVE_SET_PITCH_RATE = 0x0000, + SMSG_MOVE_SET_RUN_BACK_SPEED = 0x0000, + SMSG_MOVE_SET_RUN_SPEED = 0x0000, + SMSG_MOVE_SET_SWIM_BACK_SPEED = 0x0000, + SMSG_MOVE_SET_SWIM_SPEED = 0x0000, + SMSG_MOVE_SET_TURN_RATE = 0x0000, + SMSG_MOVE_SET_VEHICLE_REC_ID = 0x0000, + SMSG_MOVE_SET_WALK_IN_AIR = 0x0000, + SMSG_MOVE_SET_WALK_SPEED = 0x0000, + SMSG_MOVE_SET_WATER_WALK = 0x0000, + SMSG_MOVE_SKIP_TIME = 0x0000, + SMSG_MOVE_SPLINE_DISABLE_COLLISION = 0x0000, + SMSG_MOVE_SPLINE_DISABLE_GRAVITY = 0x0000, + SMSG_MOVE_SPLINE_ENABLE_COLLISION = 0x0000, + SMSG_MOVE_SPLINE_ENABLE_GRAVITY = 0x0000, + SMSG_MOVE_SPLINE_ROOT = 0x0000, + SMSG_MOVE_SPLINE_SET_FEATHER_FALL = 0x0000, + SMSG_MOVE_SPLINE_SET_FLIGHT_BACK_SPEED = 0x0000, + SMSG_MOVE_SPLINE_SET_FLIGHT_SPEED = 0x0000, + SMSG_MOVE_SPLINE_SET_FLYING = 0x0000, + SMSG_MOVE_SPLINE_SET_HOVER = 0x0000, + SMSG_MOVE_SPLINE_SET_LAND_WALK = 0x0000, + SMSG_MOVE_SPLINE_SET_NORMAL_FALL = 0x0000, + SMSG_MOVE_SPLINE_SET_PITCH_RATE = 0x0000, + SMSG_MOVE_SPLINE_SET_RUN_BACK_SPEED = 0x0000, + SMSG_MOVE_SPLINE_SET_RUN_MODE = 0x0000, + SMSG_MOVE_SPLINE_SET_RUN_SPEED = 0x0000, + SMSG_MOVE_SPLINE_SET_SWIM_BACK_SPEED = 0x0000, + SMSG_MOVE_SPLINE_SET_SWIM_SPEED = 0x0000, + SMSG_MOVE_SPLINE_SET_TURN_RATE = 0x0000, + SMSG_MOVE_SPLINE_SET_WALK_MODE = 0x0000, + SMSG_MOVE_SPLINE_SET_WALK_SPEED = 0x0000, + SMSG_MOVE_SPLINE_SET_WATER_WALK = 0x0000, + SMSG_MOVE_SPLINE_START_SWIM = 0x0000, + SMSG_MOVE_SPLINE_STOP_SWIM = 0x0000, + SMSG_MOVE_SPLINE_UNROOT = 0x0000, + SMSG_MOVE_SPLINE_UNSET_FLYING = 0x0000, + SMSG_MOVE_SPLINE_UNSET_HOVER = 0x0000, + SMSG_MOVE_TELEPORT = 0x0000, + SMSG_MOVE_UNROOT = 0x0000, + SMSG_MOVE_UNSET_CAN_FLY = 0x0000, + SMSG_MOVE_UNSET_HOVERING = 0x0000, + SMSG_MOVE_UNSET_WALK_IN_AIR = 0x0000, + SMSG_MOVE_UPDATE_KNOCK_BACK = 0x0000, + SMSG_MOVE_UPDATE_TELEPORT = 0x0000, + SMSG_MULTIPLE_PACKETS = 0x0000, + SMSG_NAME_QUERY_RESPONSE = 0x6E04, + SMSG_NEW_TAXI_PATH = 0x0000, + SMSG_NEW_WORLD = 0x31A2, + SMSG_NOTIFICATION = 0x0000, + SMSG_NOTIFY_DANCE = 0x0000, + SMSG_NOTIFY_DEST_LOC_SPELL_CAST = 0x0000, + SMSG_NPC_TEXT_UPDATE = 0x4436, + SMSG_NPC_WONT_TALK = 0x0000, + SMSG_OFFER_PETITION_ERROR = 0x0000, + SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA = 0x0000, + SMSG_OPEN_CONTAINER = 0x0000, + SMSG_OVERRIDE_LIGHT = 0x0000, + SMSG_PAGE_TEXT_QUERY_RESPONSE = 0x0000, + SMSG_PARTYKILLLOG = 0x0000, + SMSG_PARTY_COMMAND_RESULT = 0x0000, + SMSG_PARTY_MEMBER_STATS = 0x0000, + SMSG_PARTY_MEMBER_STATS_FULL = 0x0000, + SMSG_PAUSE_MIRROR_TIMER = 0x0000, + SMSG_PERIODICAURALOG = 0x0416, + SMSG_PETGODMODE = 0x0000, + SMSG_PETITION_QUERY_RESPONSE = 0x0000, + SMSG_PETITION_SHOWLIST = 0x0000, + SMSG_PETITION_SHOW_SIGNATURES = 0x0000, + SMSG_PETITION_SIGN_RESULTS = 0x0000, + SMSG_PET_ACTION_FEEDBACK = 0x0000, + SMSG_PET_ACTION_SOUND = 0x0000, + SMSG_PET_CAST_FAILED = 0x0000, + SMSG_PET_DISMISS_SOUND = 0x0000, + SMSG_PET_GUIDS = 0x2D26, + SMSG_PET_LEARNED_SPELL = 0x0000, + SMSG_PET_MODE = 0x2235, + SMSG_PET_NAME_INVALID = 0x0000, + SMSG_PET_NAME_QUERY_RESPONSE = 0x4C37, + SMSG_PET_REMOVED_SPELL = 0x0000, + SMSG_PET_SPELLS = 0x4114, + SMSG_PET_TAME_FAILURE = 0x0000, + SMSG_PET_UPDATE_COMBO_POINTS = 0x0000, + SMSG_PLAYED_TIME = 0x6037, + SMSG_PLAYERBINDERROR = 0x0000, + SMSG_PLAYERBOUND = 0x0000, + SMSG_PLAYER_DIFFICULTY_CHANGE = 0x0000, + SMSG_PLAYER_MOVE = 0x79A2, + SMSG_PLAYER_SKINNED = 0x0000, + SMSG_PLAYER_UNK_DEAD_ALIVE = 0x0000, + SMSG_PLAYER_VEHICLE_DATA = 0x0000, + SMSG_PLAY_DANCE = 0x0000, + SMSG_PLAY_MUSIC = 0x0000, + SMSG_PLAY_OBJECT_SOUND = 0x0000, + SMSG_PLAY_SOUND = 0x2134, + SMSG_PLAY_SPELL_IMPACT = 0x0000, + SMSG_PLAY_SPELL_VISUAL = 0x55A5, + SMSG_PLAY_TIME_WARNING = 0x0000, + SMSG_PONG = 0x4D42, + SMSG_POWER_UPDATE = 0x4A07, + SMSG_PRE_RESURRECT = 0x0000, + SMSG_PROCRESIST = 0x0000, + SMSG_PROPOSE_LEVEL_GRANT = 0x0000, + SMSG_PUREMOUNT_CANCELLED_OBSOLETE = 0x0000, + SMSG_PVP_CREDIT = 0x0000, + SMSG_QUERY_QUESTS_COMPLETED_RESPONSE = 0x6314, + SMSG_QUERY_TIME_RESPONSE = 0x2124, + SMSG_QUESTGIVER_OFFER_REWARD = 0x2427, + SMSG_QUESTGIVER_QUEST_COMPLETE = 0x55A4, + SMSG_QUESTGIVER_QUEST_DETAILS = 0x2425, + SMSG_QUESTGIVER_QUEST_FAILED = 0x0000, + SMSG_QUESTGIVER_QUEST_INVALID = 0x0000, + SMSG_QUESTGIVER_QUEST_LIST = 0x0000, + SMSG_QUESTGIVER_REQUEST_ITEMS = 0x0000, + SMSG_QUESTGIVER_STATUS = 0x2115, + SMSG_QUESTGIVER_STATUS_MULTIPLE = 0x4F25, + SMSG_QUESTLOG_FULL = 0x0000, + SMSG_QUESTUPDATE_ADD_ITEM = 0x0000, + SMSG_QUESTUPDATE_ADD_KILL = 0x0D27, + SMSG_QUESTUPDATE_ADD_PVP_KILL = 0x0000, + SMSG_QUESTUPDATE_COMPLETE = 0x0000, + SMSG_QUESTUPDATE_FAILED = 0x0000, + SMSG_QUESTUPDATE_FAILEDTIMER = 0x0000, + SMSG_QUEST_CONFIRM_ACCEPT = 0x0000, + SMSG_QUEST_FORCE_REMOVED = 0x0000, + SMSG_QUEST_NPC_QUERY_RESPONSE = 0x0000, + SMSG_QUEST_POI_QUERY_RESPONSE = 0x6304, + SMSG_QUEST_QUERY_RESPONSE = 0x6936, + SMSG_RAID_GROUP_ONLY = 0x0000, + SMSG_RAID_INSTANCE_INFO = 0x6626, + SMSG_RAID_INSTANCE_MESSAGE = 0x0000, + SMSG_RANDOMIZE_CHAR_NAME = 0x38B1, + SMSG_READ_ITEM_FAILED = 0x0000, + SMSG_READ_ITEM_OK = 0x0000, + SMSG_REALM_SPLIT = 0x2714, + SMSG_REAL_GROUP_UPDATE = 0x0000, + SMSG_RECEIVED_MAIL = 0x4927, + SMSG_REDIRECT_CLIENT = 0x0942, + SMSG_REFER_A_FRIEND_FAILURE = 0x0000, + SMSG_REMOVED_SPELL = 0x4804, + SMSG_REPORT_PVP_AFK_RESULT = 0x0000, + SMSG_REQUEST_CEMETERY_LIST_RESPONSE = 0x0000, + SMSG_RESET_FAILED_NOTIFY = 0x0000, + SMSG_RESISTLOG = 0x0000, + SMSG_RESPOND_INSPECT_ACHIEVEMENTS = 0x0000, + SMSG_RESURRECT_REQUEST = 0x0000, + SMSG_RESYNC_RUNES = 0x0000, + SMSG_RWHOIS = 0x0000, + SMSG_SELL_ITEM = 0x6105, + SMSG_SEND_MAIL_RESULT = 0x0000, + SMSG_SEND_UNLEARN_SPELLS = 0x4E25, + SMSG_SERVERTIME = 0x0000, + SMSG_SERVER_FIRST_ACHIEVEMENT = 0x0000, + SMSG_SERVER_MESSAGE = 0x6C04, + SMSG_SET_FACTION_ATWAR = 0x0000, + SMSG_SET_FACTION_STANDING = 0x0126, + SMSG_SET_FACTION_VISIBLE = 0x0000, + SMSG_SET_FLAT_SPELL_MODIFIER = 0x0224, + SMSG_SET_FORCED_REACTIONS = 0x0000, + SMSG_SET_PCT_SPELL_MODIFIER = 0x2834, + SMSG_SET_PHASE_SHIFT = 0x70A0, + SMSG_SET_PLAYER_DECLINED_NAMES_RESULT = 0x0000, + SMSG_SET_PLAY_HOVER_ANIM = 0x0000, + SMSG_SET_PROFICIENCY = 0x6207, + SMSG_SET_PROJECTILE_POSITION = 0x0000, + SMSG_SHOWTAXINODES = 0x0000, + SMSG_SHOW_BANK = 0x0000, + SMSG_SPELLBREAKLOG = 0x0000, + SMSG_SPELLDAMAGESHIELD = 0x2927, + SMSG_SPELLDISPELLOG = 0x0000, + SMSG_SPELLENERGIZELOG = 0x0414, + SMSG_SPELLHEALLOG = 0x2816, + SMSG_SPELLINSTAKILLLOG = 0x0000, + SMSG_SPELLLOGEXECUTE = 0x0626, + SMSG_SPELLLOGMISS = 0x0625, + SMSG_SPELLNONMELEEDAMAGELOG = 0x4315, + SMSG_SPELLORDAMAGE_IMMUNE = 0x4507, + SMSG_SPELLSTEALLOG = 0x0000, + SMSG_SPELL_COOLDOWN = 0x4B16, + SMSG_SPELL_DELAYED = 0x0000, + SMSG_SPELL_FAILED_OTHER = 0x0000, + SMSG_SPELL_FAILURE = 0x0000, + SMSG_SPELL_GO = 0x6E16, + SMSG_SPELL_START = 0x6415, + SMSG_SPELL_UPDATE_CHAIN_TARGETS = 0x0000, + SMSG_SPIRIT_HEALER_CONFIRM = 0x0000, + SMSG_STABLE_RESULT = 0x0000, + SMSG_STANDSTATE_UPDATE = 0x6F04, + SMSG_START_MIRROR_TIMER = 0x0000, + SMSG_STOP_DANCE = 0x0000, + SMSG_STOP_MIRROR_TIMER = 0x0000, + SMSG_SUMMON_CANCEL = 0x0000, + SMSG_SUMMON_REQUEST = 0x0000, + SMSG_SUPERCEDED_SPELL = 0x0000, + SMSG_SUSPEND_TOKEN_RESPONSE = 0x14B1, + SMSG_TALENTS_ERROR = 0x0000, + SMSG_TALENTS_INFO = 0x6F26, + SMSG_TALENTS_INVOLUNTARILY_RESET = 0x0000, + SMSG_TAXINODE_STATUS = 0x2936, + SMSG_TEXT_EMOTE = 0x0B05, + SMSG_THREAT_CLEAR = 0x0000, + SMSG_THREAT_REMOVE = 0x0000, + SMSG_THREAT_UPDATE = 0x4104, + SMSG_TIME_SYNC_REQ = 0x3CA4, + SMSG_TITLE_EARNED = 0x0000, + SMSG_TOGGLE_XP_GAIN = 0x0000, + SMSG_TOTEM_CREATED = 0x0000, + SMSG_TRADE_STATUS = 0x5CA3, + SMSG_TRADE_STATUS_EXTENDED = 0x0000, + SMSG_TRAINER_BUY_RESULT = 0x0000, + SMSG_TRAINER_BUY_SUCCEEDED = 0x6A05, + SMSG_TRAINER_LIST = 0x4414, + SMSG_TRANSFER_ABORTED = 0x0000, + SMSG_TRANSFER_PENDING = 0x0000, + SMSG_TRIGGER_CINEMATIC = 0x6C27, + SMSG_TRIGGER_MOVIE = 0x0000, + SMSG_TURN_IN_PETITION_RESULTS = 0x0000, + SMSG_TUTORIAL_FLAGS = 0x0B35, + SMSG_UNIT_SPELLCAST_START = 0x0000, + SMSG_UPDATE_ACCOUNT_DATA = 0x6837, + SMSG_UPDATE_ACCOUNT_DATA_COMPLETE = 0x2015, + SMSG_UPDATE_COMBO_POINTS = 0x0000, + SMSG_UPDATE_CURRENCY = 0x0000, + SMSG_UPDATE_CURRENCY_WEEK_LIMIT = 0x70A7, + SMSG_UPDATE_INSTANCE_ENCOUNTER_UNIT = 0x0000, + SMSG_UPDATE_INSTANCE_OWNERSHIP = 0x0000, + SMSG_UPDATE_ITEM_ENCHANTMENTS = 0x0000, + SMSG_UPDATE_LAST_INSTANCE = 0x0000, + SMSG_UPDATE_OBJECT = 0x4715, + SMSG_UPDATE_WORLD_STATE = 0x4816, + SMSG_USERLIST_ADD = 0x0000, + SMSG_USERLIST_REMOVE = 0x2006, + SMSG_USERLIST_UPDATE = 0x0135, + SMSG_VOICE_CHAT_STATUS = 0x0000, + SMSG_VOICE_PARENTAL_CONTROLS = 0x0000, + SMSG_VOICE_SESSION_LEAVE = 0x0000, + SMSG_VOICE_SESSION_ROSTER_UPDATE = 0x0000, + SMSG_VOICE_SET_TALKER_MUTED = 0x0000, + SMSG_WARDEN_DATA = 0x31A0, + SMSG_WEATHER = 0x0000, + SMSG_WHO = 0x6907, + SMSG_WHOIS = 0x0000, + SMSG_WORLD_STATE_UI_TIMER_UPDATE = 0x4A14, + SMSG_ZONE_UNDER_ATTACK = 0x0000, }; /// Player state diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index a9e4ffbf362..0f41ea1ca37 100755 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -634,15 +634,19 @@ void WorldSession::SendAuthWaitQue(uint32 position) if (position == 0) { WorldPacket packet(SMSG_AUTH_RESPONSE, 1); + packet.WriteBit(0); // has queue info + packet.WriteBit(0); // has account info packet << uint8(AUTH_OK); SendPacket(&packet); } else { WorldPacket packet(SMSG_AUTH_RESPONSE, 6); + packet.WriteBit(1); // has queue info + packet.WriteBit(0); // unk queue bool + packet.WriteBit(0); // has account info packet << uint8(AUTH_WAIT_QUEUE); packet << uint32(position); - packet << uint8(0); // unk SendPacket(&packet); } } diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index c370b0dd0f3..c7c19eeeacd 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -250,7 +250,7 @@ class WorldSession void SendSetPhaseShift(uint32 phaseShift); void SendQueryTimeResponse(); - void SendAuthResponse(uint8 code, bool shortForm, uint32 queuePos = 0); + void SendAuthResponse(uint8 code, bool queued, uint32 queuePos = 0); void SendClientCacheVersion(uint32 version); AccountTypes GetSecurity() const { return _security; } diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index 11837b0cbab..5f55ddbc254 100755 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -785,16 +785,16 @@ int WorldSocket::ProcessIncoming (WorldPacket* new_pct) int WorldSocket::HandleSendAuthSession() { WorldPacket packet(SMSG_AUTH_CHALLENGE, 37); - packet << uint32(0); - packet << uint32(0); - packet << uint32(0); - packet << uint32(0); + BigNumber seed1; + seed1.SetRand(16 * 8); + packet.append(seed1.AsByteArray(16), 16); // new encryption seeds + + BigNumber seed2; + seed2.SetRand(16 * 8); + packet.append(seed2.AsByteArray(16), 16); // new encryption seeds + packet << m_Seed; packet << uint8(1); - packet << uint32(0); - packet << uint32(0); - packet << uint32(0); - packet << uint32(0); return SendPacket(packet); } @@ -804,47 +804,58 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) uint32 clientSeed; uint16 clientBuild, security; uint32 id; - uint32 m_addonSize; + uint32 addonSize; LocaleConstant locale; std::string account; SHA1Hash sha; BigNumber v, s, g, N, k; - WorldPacket packet; + WorldPacket addonsData; + recvPacket.read_skip(); + recvPacket.read_skip(); recvPacket.read_skip(); - recvPacket.read(digest, 5); + recvPacket >> digest[10]; + recvPacket >> digest[18]; + recvPacket >> digest[12]; + recvPacket >> digest[5]; + recvPacket.read_skip(); + recvPacket >> digest[15]; + recvPacket >> digest[9]; + recvPacket >> digest[19]; + recvPacket >> digest[4]; + recvPacket >> digest[7]; + recvPacket >> digest[16]; + recvPacket >> digest[3]; recvPacket >> clientBuild; - recvPacket.read(digest, 2); - recvPacket.read_skip(); + recvPacket >> digest[8]; recvPacket.read_skip(); - recvPacket.read(digest, 4); - recvPacket.read_skip(); recvPacket.read_skip(); - recvPacket.read(digest, 2); - recvPacket.read_skip(); - recvPacket.read(digest, 4); + recvPacket >> digest[17]; + recvPacket >> digest[6]; + recvPacket >> digest[0]; + recvPacket >> digest[1]; + recvPacket >> digest[11]; recvPacket >> clientSeed; - recvPacket.read(digest, 2); + recvPacket >> digest[2]; recvPacket.read_skip(); - recvPacket.read(digest, 1); - recvPacket.read_skip(); - recvPacket >> account; - recvPacket >> m_addonSize; + recvPacket >> digest[14]; + recvPacket >> digest[13]; - uint8 * tableauAddon = new uint8[m_addonSize]; - WorldPacket packetAddon; - for (uint32 i = 0; i < m_addonSize; i++) - { - uint8 ByteSize = 0; - recvPacket >> ByteSize; - tableauAddon[i] = ByteSize; - packetAddon << ByteSize; - } - delete tableauAddon; + recvPacket >> addonSize; + addonsData.resize(addonSize); + recvPacket.read((uint8*)addonsData.contents(), addonSize); + + uint8 highBitsAccountLen; + uint8 lowBitsAccountLen; + recvPacket >> highBitsAccountLen; + recvPacket >> lowBitsAccountLen; + account = recvPacket.ReadString(((highBitsAccountLen << 5) & 0xFF) | (lowBitsAccountLen >> 3)); if (sWorld->IsClosed()) { - packet.Initialize(SMSG_AUTH_RESPONSE, 1); + WorldPacket packet(SMSG_AUTH_RESPONSE, 1); + packet.WriteBit(0); // has queue info + packet.WriteBit(0); // has account info packet << uint8(AUTH_REJECT); SendPacket(packet); @@ -862,8 +873,10 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) // Stop if the account is not found if (!result) { - packet.Initialize (SMSG_AUTH_RESPONSE, 1); - packet << uint8 (AUTH_UNKNOWN_ACCOUNT); + WorldPacket packet(SMSG_AUTH_RESPONSE, 1); + packet.WriteBit(0); // has queue info + packet.WriteBit(0); // has account info + packet << uint8(AUTH_UNKNOWN_ACCOUNT); SendPacket(packet); @@ -878,29 +891,31 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) if (expansion > world_expansion) expansion = world_expansion; - N.SetHexStr ("894B645E89E1535BBDAD5B8B290650530801B18EBFBF5E8FAB3C82872A3E9BB7"); - g.SetDword (7); + N.SetHexStr("894B645E89E1535BBDAD5B8B290650530801B18EBFBF5E8FAB3C82872A3E9BB7"); + g.SetDword(7); v.SetHexStr(fields[4].GetCString()); - s.SetHexStr (fields[5].GetCString()); + s.SetHexStr(fields[5].GetCString()); const char* sStr = s.AsHexStr(); //Must be freed by OPENSSL_free() const char* vStr = v.AsHexStr(); //Must be freed by OPENSSL_free() - sLog->outStaticDebug ("WorldSocket::HandleAuthSession: (s,v) check s: %s v: %s", + sLog->outStaticDebug("WorldSocket::HandleAuthSession: (s,v) check s: %s v: %s", sStr, vStr); - OPENSSL_free ((void*) sStr); - OPENSSL_free ((void*) vStr); + OPENSSL_free((void*) sStr); + OPENSSL_free((void*) vStr); ///- Re-check ip locking (same check as in realmd). if (fields[3].GetUInt8() == 1) // if ip is locked { if (strcmp (fields[2].GetCString(), GetRemoteAddress().c_str())) { - packet.Initialize (SMSG_AUTH_RESPONSE, 1); - packet << uint8 (AUTH_FAILED); + WorldPacket packet(SMSG_AUTH_RESPONSE, 1); + packet.WriteBit(0); // has queue info + packet.WriteBit(0); // has account info + packet << uint8(AUTH_FAILED); SendPacket(packet); sLog->outBasic ("WorldSocket::HandleAuthSession: Sent Auth Response (Account IP differs)."); @@ -914,7 +929,7 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) security = SEC_ADMINISTRATOR; */ - k.SetHexStr (fields[1].GetCString()); + k.SetHexStr(fields[1].GetCString()); int64 mutetime = fields[7].GetInt64(); //! Negative mutetime indicates amount of seconds to be muted effective on next login - which is now. @@ -963,8 +978,10 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) if (banresult) // if account banned { - packet.Initialize (SMSG_AUTH_RESPONSE, 1); - packet << uint8 (AUTH_BANNED); + WorldPacket packet(SMSG_AUTH_RESPONSE, 1); + packet.WriteBit(0); // has queue info + packet.WriteBit(0); // has account info + packet << uint8(AUTH_BANNED); SendPacket(packet); sLog->outError("WorldSocket::HandleAuthSession: Sent Auth Response (Account banned)."); @@ -976,8 +993,10 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) sLog->outDebug(LOG_FILTER_NETWORKIO, "Allowed Level: %u Player Level %u", allowedAccountType, AccountTypes(security)); if (allowedAccountType > SEC_PLAYER && AccountTypes(security) < allowedAccountType) { - WorldPacket Packet (SMSG_AUTH_RESPONSE, 1); - Packet << uint8 (AUTH_UNAVAILABLE); + WorldPacket packet(SMSG_AUTH_RESPONSE, 1); + packet.WriteBit(0); // has queue info + packet.WriteBit(0); // has account info + packet << uint8(AUTH_UNAVAILABLE); SendPacket(packet); @@ -989,16 +1008,27 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) uint32 t = 0; uint32 seed = m_Seed; - sha.UpdateData (account); - sha.UpdateData ((uint8 *) & t, 4); - sha.UpdateData ((uint8 *) & clientSeed, 4); - sha.UpdateData ((uint8 *) & seed, 4); - sha.UpdateBigNumbers (&k, NULL); + sha.UpdateData(account); + sha.UpdateData((uint8*)&t, 4); + sha.UpdateData((uint8*)&clientSeed, 4); + sha.UpdateData((uint8*)&seed, 4); + sha.UpdateBigNumbers(&k, NULL); sha.Finalize(); std::string address = GetRemoteAddress(); - sLog->outStaticDebug ("WorldSocket::HandleAuthSession: Client '%s' authenticated successfully from %s.", + if (memcmp(sha.GetDigest(), digest, 20)) + { + WorldPacket packet(SMSG_AUTH_RESPONSE, 1); + packet << uint8(AUTH_FAILED); + + SendPacket(packet); + + sLog->outError("WorldSocket::HandleAuthSession: Authentication failed for account: %u ('%s') address: %s", id, account.c_str(), address.c_str()); + return -1; + } + + sLog->outStaticDebug("WorldSocket::HandleAuthSession: Client '%s' authenticated successfully from %s.", account.c_str(), address.c_str()); @@ -1023,14 +1053,13 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) LoginDatabase.Execute(stmt); // NOTE ATM the socket is single-threaded, have this in mind ... - ACE_NEW_RETURN (m_Session, WorldSession (id, this, AccountTypes(security), expansion, mutetime, locale, recruiter, isRecruiter), -1); + ACE_NEW_RETURN(m_Session, WorldSession(id, this, AccountTypes(security), expansion, mutetime, locale, recruiter, isRecruiter), -1); m_Crypt.Init(&k); m_Session->LoadGlobalAccountData(); m_Session->LoadTutorialsData(); - packetAddon.rpos(0); - m_Session->ReadAddonsInfo(packetAddon); + m_Session->ReadAddonsInfo(addonsData); // Initialize Warden system only if it is enabled by config if (sWorld->getBoolConfig(CONFIG_WARDEN_ENABLED)) @@ -1038,10 +1067,9 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) // Sleep this Network thread for uint32 sleepTime = sWorld->getIntConfig(CONFIG_SESSION_ADD_DELAY); - ACE_OS::sleep (ACE_Time_Value (0, sleepTime)); - - sWorld->AddSession (m_Session); + ACE_OS::sleep(ACE_Time_Value (0, sleepTime)); + sWorld->AddSession(m_Session); return 0; } diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index b5c0e13c425..a3b9054bd68 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -272,7 +272,7 @@ void World::AddSession_(WorldSession* s) return; } - s->SendAuthResponse(AUTH_OK, true); + s->SendAuthResponse(AUTH_OK, false); s->SendAddonsInfo(); s->SendClientCacheVersion(sWorld->getIntConfig(CONFIG_CLIENTCACHE_VERSION)); s->SendTutorialsData(); @@ -328,7 +328,7 @@ void World::AddQueuedPlayer(WorldSession* sess) m_QueuedPlayer.push_back(sess); // The 1st SMSG_AUTH_RESPONSE needs to contain other info too. - sess->SendAuthResponse(AUTH_WAIT_QUEUE, false, GetQueuePos(sess)); + sess->SendAuthResponse(AUTH_WAIT_QUEUE, true, GetQueuePos(sess)); } bool World::RemoveQueuedPlayer(WorldSession* sess) diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h index 1e346760e30..bc87950da16 100755 --- a/src/server/shared/Packets/ByteBuffer.h +++ b/src/server/shared/Packets/ByteBuffer.h @@ -564,11 +564,21 @@ class ByteBuffer std::string ReadString() { - std::string s = 0; + std::string s; (*this) >> s; return s; } + std::string ReadString(uint32 length) + { + char* buffer = new char[length + 1]; + memset(buffer, 0, length + 1); + read((uint8*)buffer, length); + std::string retval = buffer; + delete[] buffer; + return retval; + } + bool ReadBoolean() { uint8 b = 0; -- cgit v1.2.3 From 138375c0455fc0c7f1c2fc0e6b94930dea28ae9c Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 4 Jul 2012 18:26:54 +0200 Subject: Merged pull request #6873 --- dep/StormLib/CMakeLists.txt | 20 +------------ dep/StormLib/searchFix.patch | 49 -------------------------------- src/tools/map_extractor/System.cpp | 7 +++-- src/tools/vmap4_extractor/vmapexport.cpp | 5 ++-- 4 files changed, 9 insertions(+), 72 deletions(-) delete mode 100644 dep/StormLib/searchFix.patch (limited to 'src') diff --git a/dep/StormLib/CMakeLists.txt b/dep/StormLib/CMakeLists.txt index c7595b9c8be..a6735e0a6a0 100644 --- a/dep/StormLib/CMakeLists.txt +++ b/dep/StormLib/CMakeLists.txt @@ -1,6 +1,3 @@ -project(StormLib) -cmake_minimum_required(VERSION 2.6) - set(SRC_FILES src/adpcm/adpcm.cpp src/huffman/huff.cpp @@ -241,23 +238,18 @@ add_definitions(-D_7ZIP_ST -DBZ_STRICT_ANSI) if(WIN32) if(MSVC) - message(STATUS "Using MSVC") add_definitions(-D_7ZIP_ST -DWIN32) - else() - message(STATUS "Using mingw") endif() set(SRC_ADDITIONAL_FILES ${ZLIB_BZIP2_FILES} ${TOMCRYPT_FILES} ${TOMMATH_FILES}) set(LINK_LIBS wininet) endif() if(APPLE) - message(STATUS "Using Mac OS X port") set(LINK_LIBS z bz2) set(SRC_ADDITIONAL_FILES ${TOMCRYPT_FILES} ${TOMMATH_FILES}) endif() if (${CMAKE_SYSTEM_NAME} STREQUAL Linux) - message(STATUS "Using Linux port") option(WITH_LIBTOMCRYPT "Use system LibTomCrypt library" OFF) if(WITH_LIBTOMCRYPT) set(LINK_LIBS z bz2 tomcrypt) @@ -267,15 +259,9 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL Linux) endif() endif() -add_library(storm SHARED ${SRC_FILES} ${SRC_ADDITIONAL_FILES}) +add_library(storm STATIC ${SRC_FILES} ${SRC_ADDITIONAL_FILES}) target_link_libraries(storm ${LINK_LIBS}) -option(WITH_TEST "Compile Test application" OFF) -if(WITH_TEST) - add_executable(storm_test ${TEST_SRC_FILES}) - target_link_libraries(storm_test storm) -endif() - if(APPLE) set_target_properties(storm PROPERTIES FRAMEWORK true) set_target_properties(storm PROPERTIES PUBLIC_HEADER "src/StormLib.h src/StormPort.h") @@ -290,7 +276,3 @@ endif() if(WIN32) set_target_properties(storm PROPERTIES OUTPUT_NAME StormLib) endif() - -install(TARGETS storm RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib FRAMEWORK DESTINATION /Library/Frameworks) -install(FILES src/StormLib.h src/StormPort.h DESTINATION include) - diff --git a/dep/StormLib/searchFix.patch b/dep/StormLib/searchFix.patch deleted file mode 100644 index d4ba11d8645..00000000000 --- a/dep/StormLib/searchFix.patch +++ /dev/null @@ -1,49 +0,0 @@ -diff --git a/dep/StormLib/src/SFileFindFile.cpp b/dep/StormLib/src/SFileFindFile.cpp -index aa065d2..542637b 100644 ---- a/dep/StormLib/src/SFileFindFile.cpp -+++ b/dep/StormLib/src/SFileFindFile.cpp -@@ -31,7 +31,7 @@ struct TMPQSearch - DWORD dwSearchTableItems; // Number of items in the search table - DWORD dwNextIndex; // Next file index to be checked - DWORD dwFlagMask; // For checking flag mask -- char szSearchMask[1]; // Search mask (variable length) -+ char * szSearchMask; // Search mask (variable length) - }; - - //----------------------------------------------------------------------------- -@@ -69,7 +69,7 @@ bool CheckWildCard(const char * szString, const char * szWildCard) - szString++; - } - -- // If there is '*', means zero or more chars. We have to -+ // If there is '*', means zero or more chars. We have to - // find the sequence after '*' - if(*szWildCard == '*') - { -@@ -337,6 +337,8 @@ static void FreeMPQSearch(TMPQSearch *& hs) - { - if(hs->pSearchTable != NULL) - STORM_FREE(hs->pSearchTable); -+ if(hs->szSearchMask != NULL) -+ free(hs->szSearchMask); // allocated with strdup - STORM_FREE(hs); - hs = NULL; - } -@@ -376,7 +378,7 @@ HANDLE WINAPI SFileFindFirstFile(HANDLE hMpq, const char * szMask, SFILE_FIND_DA - if(nError == ERROR_SUCCESS) - { - memset(hs, 0, sizeof(TMPQSearch)); -- strcpy(hs->szSearchMask, szMask); -+ hs->szSearchMask = strdup(szMask); - hs->dwFlagMask = MPQ_FILE_EXISTS; - hs->ha = ha; - -@@ -406,7 +408,7 @@ HANDLE WINAPI SFileFindFirstFile(HANDLE hMpq, const char * szMask, SFILE_FIND_DA - FreeMPQSearch(hs); - SetLastError(nError); - } -- -+ - // Return the result value - return (HANDLE)hs; - } diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp index c8d5c105af3..4f300f0ef0e 100644 --- a/src/tools/map_extractor/System.cpp +++ b/src/tools/map_extractor/System.cpp @@ -1019,7 +1019,9 @@ void ExtractDBCFiles(int l, bool basicLocale) uint32 count = 0; if (listFile) { - std::string outputPath = "./dbc/"; + std::string outputPath = output_path; + outputPath += "/dbc/"; + CreateDir(outputPath); if (!basicLocale) { @@ -1063,7 +1065,8 @@ void ExtractDB2Files(int l, bool basicLocale) uint32 count = 0; if (listFile) { - std::string outputPath = "./dbc/"; + std::string outputPath = output_path; + outputPath += "/dbc/"; if (!basicLocale) { outputPath += Locales[l]; diff --git a/src/tools/vmap4_extractor/vmapexport.cpp b/src/tools/vmap4_extractor/vmapexport.cpp index a1fd4e8321a..1582f9d0b25 100644 --- a/src/tools/vmap4_extractor/vmapexport.cpp +++ b/src/tools/vmap4_extractor/vmapexport.cpp @@ -59,7 +59,7 @@ HANDLE WorldMpq = NULL; HANDLE LocaleMpq = NULL; -uint32 CONF_TargetBuild = 15595; // 4.3.4.15595 +uint32 CONF_TargetBuild = 14545; // 4.2.2.14545 // List MPQ for extract maps from char const* CONF_mpq_list[]= @@ -517,6 +517,7 @@ bool processArgv(int argc, char ** argv, const char *versionString) break; } } + if(!result) { printf("Extract %s.\n",versionString); @@ -524,6 +525,7 @@ bool processArgv(int argc, char ** argv, const char *versionString) printf(" -s : (default) small size (data size optimization), ~500MB less vmap data.\n"); printf(" -l : large size, ~500MB more vmap data. (might contain more details)\n"); printf(" -d : Path to the vector data source folder.\n"); + printf(" -b : target build (default 14545)"); printf(" -? : This message.\n"); } @@ -545,7 +547,6 @@ bool processArgv(int argc, char ** argv, const char *versionString) int main(int argc, char ** argv) { - getc(stdin); bool success=true; const char *versionString = "V4.00 2012_02"; -- cgit v1.2.3 From ccaca5f7cafc38292aeaf8a44c3a1a4a447dadb1 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 5 Jul 2012 15:12:52 +0200 Subject: Core/Networking: Handle few more auth-time opcodes and left comments for CMSG_ENABLE_NAGLE --- src/server/game/Handlers/MiscHandler.cpp | 7 +++++++ src/server/game/Server/Protocol/Opcodes.cpp | 9 +++++---- src/server/game/Server/Protocol/Opcodes.h | 2 +- src/server/game/Server/WorldSession.h | 1 + src/server/game/Server/WorldSocket.cpp | 17 +++++++++++------ 5 files changed, 25 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 46e40e16c08..956179b9d26 100755 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -1036,6 +1036,13 @@ void WorldSession::HandleRequestAccountData(WorldPacket& recv_data) SendPacket(&data); } +int32 WorldSession::HandleEnableNagleAlgorithm() +{ + // Instructs the server we wish to receive few amounts of large packets (SMSG_MULTIPLE_PACKETS?) + // instead of large amount of small packets + return 0; +} + void WorldSession::HandleSetActionButtonOpcode(WorldPacket& recv_data) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_SET_ACTION_BUTTON"); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 195dd9391bd..90245e8b109 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -240,6 +240,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEmoteOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_ENABLETAXI, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleTaxiQueryAvailableNodes ); //DEFINE_OPCODE_HANDLER(CMSG_ENABLE_DAMAGE_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_ENABLE_NAGLE, STATUS_NEVER , PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); //DEFINE_OPCODE_HANDLER(CMSG_END_BATTLEFIELD_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_EQUIPMENT_SET_DELETE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetDelete ); //DEFINE_OPCODE_HANDLER(CMSG_EQUIPMENT_SET_SAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetSave ); @@ -525,7 +526,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_RANDOMIZE_CHAR_NAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRandomizeCharNameOpcode ); DEFINE_OPCODE_HANDLER(CMSG_READY_FOR_ACCOUNT_DATA_TIMES, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleReadyForAccountDataTimes ); //DEFINE_OPCODE_HANDLER(CMSG_READ_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReadItem ); - //DEFINE_OPCODE_HANDLER(CMSG_REALM_SPLIT, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRealmSplitOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_REALM_SPLIT, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRealmSplitOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_RECHARGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_RECLAIM_CORPSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReclaimCorpseOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_REDIRECTION_AUTH_PROOF, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -668,7 +669,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_UNSTABLE_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnstablePet ); //DEFINE_OPCODE_HANDLER(CMSG_UNUSED5, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_UNUSED6, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_UPDATE_ACCOUNT_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateAccountData ); + DEFINE_OPCODE_HANDLER(CMSG_UPDATE_ACCOUNT_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateAccountData ); //DEFINE_OPCODE_HANDLER(CMSG_UPDATE_MISSILE_TRAJECTORY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateMissileTrajectory ); //DEFINE_OPCODE_HANDLER(CMSG_UPDATE_PROJECTILE_POSITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateProjectilePosition ); //DEFINE_OPCODE_HANDLER(CMSG_USE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUseItemOpcode ); @@ -1212,7 +1213,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_RANDOMIZE_CHAR_NAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_READ_ITEM_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_READ_ITEM_OK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_REALM_SPLIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_REALM_SPLIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_REAL_GROUP_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_RECEIVED_MAIL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_REDIRECT_CLIENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1350,7 +1351,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_TURN_IN_PETITION_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TUTORIAL_FLAGS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ACCOUNT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ACCOUNT_DATA_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ACCOUNT_DATA_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_COMBO_POINTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_INSTANCE_ENCOUNTER_UNIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_INSTANCE_OWNERSHIP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 4f6cda222e9..f73f3af0446 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -157,7 +157,7 @@ enum Opcodes CMSG_DUEL_CANCELLED = 0x0000, CMSG_EJECT_PASSENGER = 0x0000, CMSG_EMOTE = 0x4C26, - CMSG_ENABLE_NAGLE = 0x0000, + CMSG_ENABLE_NAGLE = 0x4449, // client CVar disableServerNagle set to 1 prevents sending this opcode CMSG_EQUIPMENT_SET_DELETE = 0x0000, CMSG_EQUIPMENT_SET_SAVE = 0x0000, CMSG_EQUIPMENT_SET_USE = 0x0000, diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index c1d1cb5d53c..1d648fec6c9 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -932,6 +932,7 @@ class WorldSession void HandleEnterPlayerVehicle(WorldPacket& data); void HandleUpdateProjectilePosition(WorldPacket& recvPacket); void HandleRequestHotfix(WorldPacket& recvPacket); + int32 HandleEnableNagleAlgorithm(); private: void InitializeQueryCallbackParameters(); diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index c2a02d6f12c..a9c53f3a817 100755 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -657,7 +657,7 @@ int WorldSocket::ProcessIncoming(WorldPacket* new_pct) ACE_ASSERT (new_pct); // manage memory ;) - ACE_Auto_Ptr aptr (new_pct); + ACE_Auto_Ptr aptr(new_pct); const ACE_UINT16 opcode = PacketFilter::DropHighBytes(new_pct->GetOpcode()); @@ -675,7 +675,7 @@ int WorldSocket::ProcessIncoming(WorldPacket* new_pct) switch (opcode) { case CMSG_PING: - return HandlePing (*new_pct); + return HandlePing(*new_pct); case CMSG_AUTH_SESSION: if (m_Session) { @@ -684,9 +684,9 @@ int WorldSocket::ProcessIncoming(WorldPacket* new_pct) } sScriptMgr->OnPacketReceive(this, WorldPacket(*new_pct)); - return HandleAuthSession (*new_pct); + return HandleAuthSession(*new_pct); case CMSG_KEEP_ALIVE: - sLog->outStaticDebug ("CMSG_KEEP_ALIVE, size: " UI64FMTD, uint64(new_pct->size())); + sLog->outStaticDebug("CMSG_KEEP_ALIVE, size: " UI64FMTD, uint64(new_pct->size())); sScriptMgr->OnPacketReceive(this, WorldPacket(*new_pct)); return 0; case CMSG_LOG_DISCONNECT: @@ -705,9 +705,14 @@ int WorldSocket::ProcessIncoming(WorldPacket* new_pct) return -1; return HandleSendAuthSession(); } + case CMSG_ENABLE_NAGLE: + { + sScriptMgr->OnPacketReceive(this, WorldPacket(*new_pct)); + return m_Session ? m_Session->HandleEnableNagleAlgorithm() : -1; + } default: { - ACE_GUARD_RETURN (LockType, Guard, m_SessionLock, -1); + ACE_GUARD_RETURN(LockType, Guard, m_SessionLock, -1); if (!opcodeTable[Opcodes(opcode)]) { sLog->outError("Opcode with no defined handler received from client: %u", new_pct->GetOpcode()); @@ -723,7 +728,7 @@ int WorldSocket::ProcessIncoming(WorldPacket* new_pct) aptr.release(); // WARNINIG here we call it with locks held. // Its possible to cause deadlock if QueuePacket calls back - m_Session->QueuePacket (new_pct); + m_Session->QueuePacket(new_pct); return 0; } else -- cgit v1.2.3 From 06a4ade88a9aee90e66c02852752c6acc30b7a6d Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 9 Jul 2012 11:08:33 +0200 Subject: Core/Achievements: Implemented guild achievements --- sql/base/characters_database.sql | 51 + ...12_07_09_00_characters_guild_achievement_4x.sql | 24 + ...00_characters_guild_achievement_progress_4x.sql | 25 + src/server/game/Achievements/AchievementMgr.cpp | 1118 +++++++++++++++----- src/server/game/Achievements/AchievementMgr.h | 51 +- src/server/game/AuctionHouse/AuctionHouseMgr.cpp | 6 +- src/server/game/Battlegrounds/Battleground.cpp | 20 +- .../game/Battlegrounds/Zones/BattlegroundAB.cpp | 4 +- .../game/Battlegrounds/Zones/BattlegroundAV.cpp | 8 +- .../game/Battlegrounds/Zones/BattlegroundEY.cpp | 2 +- .../game/Battlegrounds/Zones/BattlegroundWS.cpp | 4 +- src/server/game/DataStores/DBCEnums.h | 254 ++--- src/server/game/DungeonFinding/LFGMgr.cpp | 2 +- src/server/game/Entities/Player/Player.cpp | 107 +- src/server/game/Entities/Player/Player.h | 8 +- src/server/game/Entities/Unit/Unit.cpp | 16 +- src/server/game/Groups/Group.cpp | 4 +- src/server/game/Guilds/Guild.cpp | 4 +- src/server/game/Guilds/Guild.h | 7 +- src/server/game/Guilds/GuildMgr.cpp | 20 +- src/server/game/Handlers/AuctionHouseHandler.cpp | 8 +- src/server/game/Handlers/CharacterHandler.cpp | 4 +- src/server/game/Handlers/ChatHandler.cpp | 2 +- src/server/game/Handlers/GroupHandler.cpp | 4 +- src/server/game/Handlers/ItemHandler.cpp | 6 +- src/server/game/Handlers/LootHandler.cpp | 10 +- src/server/game/Handlers/MailHandler.cpp | 2 +- src/server/game/Handlers/MiscHandler.cpp | 11 +- src/server/game/Handlers/QuestHandler.cpp | 2 +- src/server/game/Handlers/SpellHandler.cpp | 4 +- src/server/game/Maps/Map.h | 1 + src/server/game/Reputation/ReputationMgr.cpp | 10 +- src/server/game/Server/Protocol/Opcodes.cpp | 14 +- src/server/game/Server/Protocol/Opcodes.h | 15 +- src/server/game/Server/WorldSession.h | 1 + src/server/game/Server/WorldSocket.cpp | 2 +- src/server/game/Spells/Spell.cpp | 10 +- src/server/scripts/Commands/cs_reset.cpp | 2 +- src/server/shared/DataStores/DBCStore.h | 2 +- .../Database/Implementation/CharacterDatabase.cpp | 8 + .../Database/Implementation/CharacterDatabase.h | 8 + src/server/shared/Packets/ByteBuffer.h | 2 +- 42 files changed, 1345 insertions(+), 518 deletions(-) create mode 100644 sql/updates/characters/2012_07_09_00_characters_guild_achievement_4x.sql create mode 100644 sql/updates/characters/2012_07_09_00_characters_guild_achievement_progress_4x.sql (limited to 'src') diff --git a/sql/base/characters_database.sql b/sql/base/characters_database.sql index bbbc799a6af..3016614cd0e 100644 --- a/sql/base/characters_database.sql +++ b/sql/base/characters_database.sql @@ -1558,6 +1558,57 @@ LOCK TABLES `guild` WRITE; /*!40000 ALTER TABLE `guild` ENABLE KEYS */; UNLOCK TABLES; +-- +-- Table structure for table `guild_achievement` +-- + +DROP TABLE IF EXISTS `guild_achievement`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `guild_achievement` ( + `guildId` int(10) unsigned NOT NULL, + `achievement` smallint(5) unsigned NOT NULL, + `date` int(10) unsigned NOT NULL DEFAULT '0', + `guids` text NOT NULL, + PRIMARY KEY (`guildId`,`achievement`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `guild_achievement` +-- + +LOCK TABLES `guild_achievement` WRITE; +/*!40000 ALTER TABLE `guild_achievement` DISABLE KEYS */; +/*!40000 ALTER TABLE `guild_achievement` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `guild_achievement_progress` +-- + +DROP TABLE IF EXISTS `guild_achievement_progress`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `guild_achievement_progress` ( + `guildId` int(10) unsigned NOT NULL, + `criteria` smallint(5) unsigned NOT NULL, + `counter` int(10) unsigned NOT NULL, + `date` int(10) unsigned NOT NULL DEFAULT '0', + `completedGuid` int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`guildId`,`criteria`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `guild_achievement_progress` +-- + +LOCK TABLES `guild_achievement_progress` WRITE; +/*!40000 ALTER TABLE `guild_achievement_progress` DISABLE KEYS */; +/*!40000 ALTER TABLE `guild_achievement_progress` ENABLE KEYS */; +UNLOCK TABLES; + -- -- Table structure for table `guild_bank_eventlog` -- diff --git a/sql/updates/characters/2012_07_09_00_characters_guild_achievement_4x.sql b/sql/updates/characters/2012_07_09_00_characters_guild_achievement_4x.sql new file mode 100644 index 00000000000..fffe375b464 --- /dev/null +++ b/sql/updates/characters/2012_07_09_00_characters_guild_achievement_4x.sql @@ -0,0 +1,24 @@ +-- +-- Table structure for table `guild_achievement` +-- + +DROP TABLE IF EXISTS `guild_achievement`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `guild_achievement` ( + `guildId` int(10) unsigned NOT NULL, + `achievement` smallint(5) unsigned NOT NULL, + `date` int(10) unsigned NOT NULL DEFAULT '0', + `guids` text NOT NULL DEFAULT '', + PRIMARY KEY (`guildId`,`achievement`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `guild_achievement` +-- + +LOCK TABLES `guild_achievement` WRITE; +/*!40000 ALTER TABLE `guild_achievement` DISABLE KEYS */; +/*!40000 ALTER TABLE `guild_achievement` ENABLE KEYS */; +UNLOCK TABLES; diff --git a/sql/updates/characters/2012_07_09_00_characters_guild_achievement_progress_4x.sql b/sql/updates/characters/2012_07_09_00_characters_guild_achievement_progress_4x.sql new file mode 100644 index 00000000000..c69e41a4ad4 --- /dev/null +++ b/sql/updates/characters/2012_07_09_00_characters_guild_achievement_progress_4x.sql @@ -0,0 +1,25 @@ +-- +-- Table structure for table `guild_achievement_progress` +-- + +DROP TABLE IF EXISTS `guild_achievement_progress`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `guild_achievement_progress` ( + `guildId` int(10) unsigned NOT NULL, + `criteria` smallint(5) unsigned NOT NULL, + `counter` int(10) unsigned NOT NULL, + `date` int(10) unsigned NOT NULL DEFAULT '0', + `completedGuid` int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`guildId`,`criteria`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `guild_achievement_progress` +-- + +LOCK TABLES `guild_achievement_progress` WRITE; +/*!40000 ALTER TABLE `guild_achievement_progress` DISABLE KEYS */; +/*!40000 ALTER TABLE `guild_achievement_progress` ENABLE KEYS */; +UNLOCK TABLES; diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 252e120f0c9..7ff744a1dc8 100755 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -377,45 +377,90 @@ bool AchievementCriteriaDataSet::Meets(Player const* source, Unit const* target, return true; } -AchievementMgr::AchievementMgr(Player* player) +template +AchievementMgr::AchievementMgr(T* owner) { - m_player = player; + _owner = owner; } -AchievementMgr::~AchievementMgr() +template +AchievementMgr::~AchievementMgr() { } -void AchievementMgr::Reset() +template +void AchievementMgr::SendPacket(WorldPacket* data) const { - for (CompletedAchievementMap::const_iterator iter = m_completedAchievements.begin(); iter != m_completedAchievements.end(); ++iter) - { - WorldPacket data(SMSG_ACHIEVEMENT_DELETED, 4); - data << uint32(iter->first); - m_player->SendDirectMessage(&data); - } +} - for (CriteriaProgressMap::const_iterator iter = m_criteriaProgress.begin(); iter != m_criteriaProgress.end(); ++iter) - { - WorldPacket data(SMSG_CRITERIA_DELETED, 4); - data << uint32(iter->first); - m_player->SendDirectMessage(&data); - } +template<> +void AchievementMgr::SendPacket(WorldPacket* data) const +{ + GetOwner()->BroadcastPacket(data); +} - m_completedAchievements.clear(); - m_criteriaProgress.clear(); - DeleteFromDB(m_player->GetGUIDLow()); +template<> +void AchievementMgr::SendPacket(WorldPacket* data) const +{ + GetOwner()->GetSession()->SendPacket(data); +} - // re-fill data - CheckAllAchievementCriteria(); +template +void AchievementMgr::RemoveCriteriaProgress(const AchievementCriteriaEntry* entry) +{ + CriteriaProgressMap::iterator criteriaProgress = m_criteriaProgress.find(entry->ID); + if (criteriaProgress == m_criteriaProgress.end()) + return; + + WorldPacket data(SMSG_CRITERIA_DELETED, 4); + data << uint32(entry->ID); + SendPacket(&data); + + m_criteriaProgress.erase(criteriaProgress); +} + +template<> +void AchievementMgr::RemoveCriteriaProgress(const AchievementCriteriaEntry* entry) +{ + CriteriaProgressMap::iterator criteriaProgress = m_criteriaProgress.find(entry->ID); + if (criteriaProgress == m_criteriaProgress.end()) + return; + + uint8 guidBytes[8]; + *reinterpret_cast(&guidBytes[0]) = GetOwner()->GetGUID(); + + WorldPacket data(SMSG_GUILD_CRITERIA_DELETED, 4 + 8); + data.WriteBit(guidBytes[6]); + data.WriteBit(guidBytes[5]); + data.WriteBit(guidBytes[7]); + data.WriteBit(guidBytes[0]); + data.WriteBit(guidBytes[1]); + data.WriteBit(guidBytes[3]); + data.WriteBit(guidBytes[2]); + data.WriteBit(guidBytes[4]); + + data.WriteByteSeq(guidBytes[2]); + data.WriteByteSeq(guidBytes[3]); + data.WriteByteSeq(guidBytes[4]); + data.WriteByteSeq(guidBytes[1]); + data.WriteByteSeq(guidBytes[7]); + data << uint32(entry->ID); + data.WriteByteSeq(guidBytes[5]); + data.WriteByteSeq(guidBytes[0]); + data.WriteByteSeq(guidBytes[6]); + + SendPacket(&data); + + m_criteriaProgress.erase(criteriaProgress); } -void AchievementMgr::ResetAchievementCriteria(AchievementCriteriaTypes type, uint32 miscvalue1, uint32 miscvalue2, bool evenIfCriteriaComplete) +template +void AchievementMgr::ResetAchievementCriteria(AchievementCriteriaTypes type, uint32 miscvalue1, uint32 miscvalue2, bool evenIfCriteriaComplete) { sLog->outDebug(LOG_FILTER_ACHIEVEMENTSYS, "AchievementMgr::ResetAchievementCriteria(%u, %u, %u)", type, miscvalue1, miscvalue2); // disable for gamemasters with GM-mode enabled - if (m_player->isGameMaster()) + if (GetOwner()->isGameMaster()) return; AchievementCriteriaEntryList const& achievementCriteriaList = sAchievementMgr->GetAchievementCriteriaByType(type); @@ -442,7 +487,19 @@ void AchievementMgr::ResetAchievementCriteria(AchievementCriteriaTypes type, uin } } -void AchievementMgr::DeleteFromDB(uint32 lowguid) +template<> +void AchievementMgr::ResetAchievementCriteria(AchievementCriteriaTypes /*type*/, uint32 /*miscvalue1*/, uint32 /*miscvalue2*/, bool /*evenIfCriteriaComplete*/) +{ + // Not needed +} + +template +void AchievementMgr::DeleteFromDB(uint32 /*lowguid*/) +{ +} + +template<> +void AchievementMgr::DeleteFromDB(uint32 lowguid) { SQLTransaction trans = CharacterDatabase.BeginTransaction(); @@ -457,7 +514,29 @@ void AchievementMgr::DeleteFromDB(uint32 lowguid) CharacterDatabase.CommitTransaction(trans); } -void AchievementMgr::SaveToDB(SQLTransaction& trans) +template<> +void AchievementMgr::DeleteFromDB(uint32 lowguid) +{ + SQLTransaction trans = CharacterDatabase.BeginTransaction(); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ALL_GUILD_ACHIEVEMENTS); + stmt->setUInt32(0, lowguid); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ALL_GUILD_ACHIEVEMENT_CRITERIA); + stmt->setUInt32(0, lowguid); + trans->Append(stmt); + + CharacterDatabase.CommitTransaction(trans); +} + +template +void AchievementMgr::SaveToDB(SQLTransaction& /*trans*/) +{ +} + +template<> +void AchievementMgr::SaveToDB(SQLTransaction& trans) { if (!m_completedAchievements.empty()) { @@ -472,7 +551,7 @@ void AchievementMgr::SaveToDB(SQLTransaction& trans) /// first new/changed record prefix if (!need_execute) { - ssdel << "DELETE FROM character_achievement WHERE guid = " << GetPlayer()->GetGUIDLow() << " AND achievement IN ("; + ssdel << "DELETE FROM character_achievement WHERE guid = " << GetOwner()->GetGUIDLow() << " AND achievement IN ("; ssins << "INSERT INTO character_achievement (guid, achievement, date) VALUES "; need_execute = true; } @@ -485,7 +564,7 @@ void AchievementMgr::SaveToDB(SQLTransaction& trans) // new/changed record data ssdel << iter->first; - ssins << '(' << GetPlayer()->GetGUIDLow() << ',' << iter->first << ',' << uint64(iter->second.date) << ')'; + ssins << '(' << GetOwner()->GetGUIDLow() << ',' << iter->first << ',' << uint64(iter->second.date) << ')'; /// mark as saved in db iter->second.changed = false; @@ -516,7 +595,7 @@ void AchievementMgr::SaveToDB(SQLTransaction& trans) /// first new/changed record prefix (for any counter value) if (!need_execute_del) { - ssdel << "DELETE FROM character_achievement_progress WHERE guid = " << GetPlayer()->GetGUIDLow() << " AND criteria IN ("; + ssdel << "DELETE FROM character_achievement_progress WHERE guid = " << GetOwner()->GetGUIDLow() << " AND criteria IN ("; need_execute_del = true; } /// next new/changed record prefix @@ -541,7 +620,7 @@ void AchievementMgr::SaveToDB(SQLTransaction& trans) ssins << ','; // new/changed record data - ssins << '(' << GetPlayer()->GetGUIDLow() << ',' << iter->first << ',' << iter->second.counter << ',' << iter->second.date << ')'; + ssins << '(' << GetOwner()->GetGUIDLow() << ',' << iter->first << ',' << iter->second.counter << ',' << iter->second.date << ')'; } /// mark as updated in db @@ -561,7 +640,61 @@ void AchievementMgr::SaveToDB(SQLTransaction& trans) } } -void AchievementMgr::LoadFromDB(PreparedQueryResult achievementResult, PreparedQueryResult criteriaResult) +template<> +void AchievementMgr::SaveToDB(SQLTransaction& trans) +{ + PreparedStatement* stmt; + std::ostringstream guidstr; + for (CompletedAchievementMap::const_iterator itr = m_completedAchievements.begin(); itr != m_completedAchievements.end(); ++itr) + { + if (!itr->second.changed) + continue; + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_ACHIEVEMENT); + stmt->setUInt32(0, GetOwner()->GetId()); + stmt->setUInt16(1, itr->first); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GUILD_ACHIEVEMENT); + stmt->setUInt32(0, GetOwner()->GetId()); + stmt->setUInt16(1, itr->first); + stmt->setUInt32(2, itr->second.date); + for (std::set::const_iterator gItr = itr->second.guids.begin(); gItr != itr->second.guids.end(); ++gItr) + guidstr << GUID_LOPART(*gItr) << ','; + + stmt->setString(3, guidstr.str()); + trans->Append(stmt); + + guidstr.str(""); + } + + for (CriteriaProgressMap::const_iterator itr = m_criteriaProgress.begin(); itr != m_criteriaProgress.end(); ++itr) + { + if (!itr->second.changed) + continue; + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_ACHIEVEMENT_CRITERIA); + stmt->setUInt32(0, GetOwner()->GetId()); + stmt->setUInt16(1, itr->first); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GUILD_ACHIEVEMENT_CRITERIA); + stmt->setUInt32(0, GetOwner()->GetId()); + stmt->setUInt16(1, itr->first); + stmt->setUInt32(2, itr->second.counter); + stmt->setUInt32(3, itr->second.date); + stmt->setUInt32(4, GUID_LOPART(itr->second.CompletedGUID)); + trans->Append(stmt); + } +} + +template +void AchievementMgr::LoadFromDB(PreparedQueryResult achievementResult, PreparedQueryResult criteriaResult) +{ +} + +template<> +void AchievementMgr::LoadFromDB(PreparedQueryResult achievementResult, PreparedQueryResult criteriaResult) { if (achievementResult) { @@ -581,10 +714,10 @@ void AchievementMgr::LoadFromDB(PreparedQueryResult achievementResult, PreparedQ // title achievement rewards are retroactive if (AchievementReward const* reward = sAchievementMgr->GetAchievementReward(achievement)) - if (uint32 titleId = reward->titleId[Player::TeamForRace(GetPlayer()->getRace()) == ALLIANCE ? 0 : 1]) + if (uint32 titleId = reward->titleId[Player::TeamForRace(GetOwner()->getRace()) == ALLIANCE ? 0 : 1]) if (CharTitlesEntry const* titleEntry = sCharTitlesStore.LookupEntry(titleId)) - if (!GetPlayer()->HasTitle(titleEntry)) - GetPlayer()->SetTitle(titleEntry); + if (!GetOwner()->HasTitle(titleEntry)) + GetOwner()->SetTitle(titleEntry); } while (achievementResult->NextRow()); } @@ -605,9 +738,7 @@ void AchievementMgr::LoadFromDB(PreparedQueryResult achievementResult, PreparedQ sLog->outError("Non-existing achievement criteria %u data removed from table `character_achievement_progress`.", id); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVALID_ACHIEV_PROGRESS_CRITERIA); - stmt->setUInt16(0, uint16(id)); - CharacterDatabase.Execute(stmt); continue; @@ -624,11 +755,136 @@ void AchievementMgr::LoadFromDB(PreparedQueryResult achievementResult, PreparedQ } } -void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement) const +template<> +void AchievementMgr::LoadFromDB(PreparedQueryResult achievementResult, PreparedQueryResult criteriaResult) { - if (GetPlayer()->GetSession()->PlayerLoading()) - return; + if (achievementResult) + { + do + { + Field* fields = achievementResult->Fetch(); + uint32 achievementid = fields[0].GetUInt16(); + + // must not happen: cleanup at server startup in sAchievementMgr->LoadCompletedAchievements() + AchievementEntry const* achievement = sAchievementStore.LookupEntry(achievementid); + if (!achievement) + continue; + + CompletedAchievementData& ca = m_completedAchievements[achievementid]; + ca.date = time_t(fields[1].GetUInt32()); + Tokens guids(fields[2].GetString(), ' '); + for (uint32 i = 0; i < guids.size(); ++i) + ca.guids.insert(MAKE_NEW_GUID(atol(guids[i]), 0, HIGHGUID_PLAYER)); + + ca.changed = false; + + } while (achievementResult->NextRow()); + } + if (criteriaResult) + { + time_t now = time(NULL); + do + { + Field* fields = criteriaResult->Fetch(); + uint32 id = fields[0].GetUInt16(); + uint32 counter = fields[1].GetUInt32(); + time_t date = time_t(fields[2].GetUInt32()); + uint64 guid = fields[3].GetUInt32(); + + AchievementCriteriaEntry const* criteria = sAchievementCriteriaStore.LookupEntry(id); + if (!criteria) + { + // we will remove not existed criteria for all guilds + sLog->outError("Non-existing achievement criteria %u data removed from table `guild_achievement_progress`.", id); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVALID_ACHIEV_PROGRESS_CRITERIA); + stmt->setUInt16(0, uint16(id)); + CharacterDatabase.Execute(stmt); + continue; + } + + if (criteria->timeLimit && time_t(date + criteria->timeLimit) < now) + continue; + + CriteriaProgress& progress = m_criteriaProgress[id]; + progress.counter = counter; + progress.date = date; + progress.CompletedGUID = MAKE_NEW_GUID(guid, 0, HIGHGUID_PLAYER); + progress.changed = false; + } while (criteriaResult->NextRow()); + } +} + +template +void AchievementMgr::Reset() +{ + for (CompletedAchievementMap::const_iterator iter = m_completedAchievements.begin(); iter != m_completedAchievements.end(); ++iter) + { + WorldPacket data(SMSG_ACHIEVEMENT_DELETED, 4); + data << uint32(iter->first); + SendPacket(&data); + } + + for (CriteriaProgressMap::const_iterator iter = m_criteriaProgress.begin(); iter != m_criteriaProgress.end(); ++iter) + { + WorldPacket data(SMSG_CRITERIA_DELETED, 4); + data << uint32(iter->first); + SendPacket(&data); + } + + m_completedAchievements.clear(); + m_criteriaProgress.clear(); + DeleteFromDB(_owner->GetGUIDLow()); + + // re-fill data + CheckAllAchievementCriteria(); +} + +template<> +void AchievementMgr::Reset() +{ + uint8 guidBytes[8]; + *reinterpret_cast(&guidBytes[0]) = GetOwner()->GetGUID(); + + for (CompletedAchievementMap::const_iterator iter = m_completedAchievements.begin(); iter != m_completedAchievements.end(); ++iter) + { + WorldPacket data(SMSG_GUILD_ACHIEVEMENT_DELETED, 4); + data.WriteBit(guidBytes[4]); + data.WriteBit(guidBytes[1]); + data.WriteBit(guidBytes[2]); + data.WriteBit(guidBytes[3]); + data.WriteBit(guidBytes[0]); + data.WriteBit(guidBytes[7]); + data.WriteBit(guidBytes[5]); + data.WriteBit(guidBytes[6]); + data << uint32(iter->first); + data.WriteByteSeq(guidBytes[5]); + data.WriteByteSeq(guidBytes[1]); + data.WriteByteSeq(guidBytes[3]); + data.WriteByteSeq(guidBytes[6]); + data.WriteByteSeq(guidBytes[0]); + data.WriteByteSeq(guidBytes[7]); + data << uint32(secsToTimeBitFields(iter->second.date)); + data.WriteByteSeq(guidBytes[4]); + data.WriteByteSeq(guidBytes[2]); + SendPacket(&data); + } + + while (!m_criteriaProgress.empty()) + if (AchievementCriteriaEntry const* criteria = sAchievementCriteriaStore.LookupEntry(m_criteriaProgress.begin()->first)) + RemoveCriteriaProgress(criteria); + + m_completedAchievements.clear(); + DeleteFromDB(_owner->GetId()); + + // re-fill data + CheckAllAchievementCriteria(); +} + +template +void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement) const +{ // Don't send for achievements with ACHIEVEMENT_FLAG_TRACKING if (achievement->flags & ACHIEVEMENT_FLAG_HIDDEN) return; @@ -637,47 +893,83 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement) sLog->outDebug(LOG_FILTER_ACHIEVEMENTSYS, "AchievementMgr::SendAchievementEarned(%u)", achievement->ID); #endif - if (Guild* guild = sGuildMgr->GetGuildById(GetPlayer()->GetGuildId())) + if (Guild* guild = sGuildMgr->GetGuildById(GetOwner()->GetGuildId())) { - Trinity::AchievementChatBuilder say_builder(*GetPlayer(), CHAT_MSG_GUILD_ACHIEVEMENT, LANG_ACHIEVEMENT_EARNED, achievement->ID); + Trinity::AchievementChatBuilder say_builder(*GetOwner(), CHAT_MSG_GUILD_ACHIEVEMENT, LANG_ACHIEVEMENT_EARNED, achievement->ID); Trinity::LocalizedPacketDo say_do(say_builder); - guild->BroadcastWorker(say_do, GetPlayer()); + guild->BroadcastWorker(say_do); } - if (achievement->flags & (ACHIEVEMENT_FLAG_REALM_FIRST_KILL|ACHIEVEMENT_FLAG_REALM_FIRST_REACH)) + if (achievement->flags & (ACHIEVEMENT_FLAG_REALM_FIRST_KILL | ACHIEVEMENT_FLAG_REALM_FIRST_REACH)) { // broadcast realm first reached - WorldPacket data(SMSG_SERVER_FIRST_ACHIEVEMENT, strlen(GetPlayer()->GetName())+1+8+4+4); - data << GetPlayer()->GetName(); - data << uint64(GetPlayer()->GetGUID()); + WorldPacket data(SMSG_SERVER_FIRST_ACHIEVEMENT, strlen(GetOwner()->GetName())+1+8+4+4); + data << GetOwner()->GetName(); + data << uint64(GetOwner()->GetGUID()); data << uint32(achievement->ID); data << uint32(0); // 1=link supplied string as player name, 0=display plain string sWorld->SendGlobalMessage(&data); } // if player is in world he can tell his friends about new achievement - else if (GetPlayer()->IsInWorld()) + else if (GetOwner()->IsInWorld()) { - CellCoord p = Trinity::ComputeCellCoord(GetPlayer()->GetPositionX(), GetPlayer()->GetPositionY()); + CellCoord p = Trinity::ComputeCellCoord(GetOwner()->GetPositionX(), GetOwner()->GetPositionY()); Cell cell(p); cell.SetNoCreate(); - Trinity::AchievementChatBuilder say_builder(*GetPlayer(), CHAT_MSG_ACHIEVEMENT, LANG_ACHIEVEMENT_EARNED, achievement->ID); + Trinity::AchievementChatBuilder say_builder(*GetOwner(), CHAT_MSG_ACHIEVEMENT, LANG_ACHIEVEMENT_EARNED, achievement->ID); Trinity::LocalizedPacketDo say_do(say_builder); - Trinity::PlayerDistWorker > say_worker(GetPlayer(), sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), say_do); + Trinity::PlayerDistWorker > say_worker(GetOwner(), sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), say_do); TypeContainerVisitor >, WorldTypeMapContainer > message(say_worker); - cell.Visit(p, message, *GetPlayer()->GetMap(), *GetPlayer(), sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY)); + cell.Visit(p, message, *GetOwner()->GetMap(), *GetOwner(), sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY)); } WorldPacket data(SMSG_ACHIEVEMENT_EARNED, 8+4+8); - data.append(GetPlayer()->GetPackGUID()); + data.append(GetOwner()->GetPackGUID()); data << uint32(achievement->ID); data << uint32(secsToTimeBitFields(time(NULL))); - data << uint32(0); - GetPlayer()->SendMessageToSetInRange(&data, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), true); + data << uint32(0); // does not notify player ingame + GetOwner()->SendMessageToSetInRange(&data, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), true); } -void AchievementMgr::SendCriteriaUpdate(AchievementCriteriaEntry const* entry, CriteriaProgress const* progress, uint32 timeElapsed, bool timedCompleted) const +template<> +void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement) const +{ + uint8 guidBytes[8]; + *reinterpret_cast(&guidBytes[0]) = GetOwner()->GetGUID(); + + WorldPacket data(SMSG_GUILD_ACHIEVEMENT_EARNED, 8+4+8); + data.WriteByteMask(guidBytes[3]); + data.WriteByteMask(guidBytes[1]); + data.WriteByteMask(guidBytes[0]); + data.WriteByteMask(guidBytes[7]); + data.WriteByteMask(guidBytes[4]); + data.WriteByteMask(guidBytes[6]); + data.WriteByteMask(guidBytes[2]); + data.WriteByteMask(guidBytes[5]); + + data.WriteByteSeq(guidBytes[2]); + data << uint32(secsToTimeBitFields(time(NULL))); + data.WriteByteSeq(guidBytes[0]); + data.WriteByteSeq(guidBytes[4]); + data.WriteByteSeq(guidBytes[1]); + data.WriteByteSeq(guidBytes[3]); + data << uint32(achievement->ID); + data.WriteByteSeq(guidBytes[7]); + data.WriteByteSeq(guidBytes[5]); + data.WriteByteSeq(guidBytes[6]); + + SendPacket(&data); +} + +template +void AchievementMgr::SendCriteriaUpdate(AchievementCriteriaEntry const* /*entry*/, CriteriaProgress const* /*progress*/, uint32 /*timeElapsed*/, bool /*timedCompleted*/) const +{ +} + +template<> +void AchievementMgr::SendCriteriaUpdate(AchievementCriteriaEntry const* entry, CriteriaProgress const* progress, uint32 timeElapsed, bool timedCompleted) const { WorldPacket data(SMSG_CRITERIA_UPDATE, 8+4+8); data << uint32(entry->ID); @@ -685,7 +977,7 @@ void AchievementMgr::SendCriteriaUpdate(AchievementCriteriaEntry const* entry, C // the counter is packed like a packed Guid data.appendPackGUID(progress->counter); - data.append(GetPlayer()->GetPackGUID()); + data.appendPackGUID(GetOwner()->GetGUID()); if (!entry->timeLimit) data << uint32(0); else @@ -693,13 +985,68 @@ void AchievementMgr::SendCriteriaUpdate(AchievementCriteriaEntry const* entry, C data << uint32(secsToTimeBitFields(progress->date)); data << uint32(timeElapsed); // time elapsed in seconds data << uint32(0); // unk - GetPlayer()->SendDirectMessage(&data); + SendPacket(&data); +} + +template<> +void AchievementMgr::SendCriteriaUpdate(AchievementCriteriaEntry const* entry, CriteriaProgress const* progress, uint32 /*timeElapsed*/, bool /*timedCompleted*/) const +{ + //will send response to criteria progress request + WorldPacket data(SMSG_GUILD_CRITERIA_DATA, 3 + 1 + 1 + 8 + 8 + 4 + 4 + 4 + 4 + 4); + + uint8 criteriaProgress[8]; + uint8 criteriaGuid[8]; + *reinterpret_cast(&criteriaProgress[0]) = progress->counter; + *reinterpret_cast(&criteriaGuid[0]) = progress->CompletedGUID; + + data.WriteBits(1, 21); + data.WriteBit(criteriaProgress[4]); + data.WriteBit(criteriaProgress[1]); + data.WriteBit(criteriaGuid[2]); + data.WriteBit(criteriaProgress[3]); + data.WriteBit(criteriaGuid[1]); + data.WriteBit(criteriaProgress[5]); + data.WriteBit(criteriaProgress[0]); + data.WriteBit(criteriaGuid[3]); + data.WriteBit(criteriaProgress[2]); + data.WriteBit(criteriaGuid[7]); + data.WriteBit(criteriaGuid[5]); + data.WriteBit(criteriaGuid[0]); + data.WriteBit(criteriaProgress[6]); + data.WriteBit(criteriaGuid[6]); + data.WriteBit(criteriaProgress[7]); + data.WriteBit(criteriaGuid[4]); + + data.WriteByteSeq(criteriaGuid[5]); + data << uint32(progress->date); // unknown date + data.WriteByteSeq(criteriaProgress[3]); + data.WriteByteSeq(criteriaProgress[7]); + data << uint32(progress->date); // unknown date + data.WriteByteSeq(criteriaProgress[6]); + data.WriteByteSeq(criteriaGuid[4]); + data.WriteByteSeq(criteriaGuid[1]); + data.WriteByteSeq(criteriaProgress[4]); + data.WriteByteSeq(criteriaGuid[3]); + data.WriteByteSeq(criteriaProgress[0]); + data.WriteByteSeq(criteriaGuid[2]); + data.WriteByteSeq(criteriaProgress[1]); + data.WriteByteSeq(criteriaGuid[6]); + data << uint32(progress->date); // last update time (not packed!) + data << uint32(entry->ID); + data.WriteByteSeq(criteriaProgress[5]); + data << uint32(0); + data.WriteByteSeq(criteriaGuid[7]); + data.WriteByteSeq(criteriaProgress[2]); + data.WriteByteSeq(criteriaGuid[0]); + + SendPacket(&data); } /** * called at player login. The player might have fulfilled some achievements when the achievement system wasn't working yet */ -void AchievementMgr::CheckAllAchievementCriteria() +template +void AchievementMgr::CheckAllAchievementCriteria() { // suppress sending packets for (uint32 i=0; i static bool IsGuild() { return false; } +template<> static bool IsGuild() { return true; } + /** * this function will be called whenever the user might have done a criteria relevant action */ -void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1 /*= 0*/, uint32 miscValue2 /*= 0*/, Unit* unit /*= NULL*/) +template +void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1 /*= 0*/, uint32 miscValue2 /*= 0*/, Unit* unit /*= NULL*/, Player* referencePlayer /*= NULL*/) { sLog->outDebug(LOG_FILTER_ACHIEVEMENTSYS, "AchievementMgr::UpdateAchievementCriteria(%u, %u, %u)", type, miscValue1, miscValue2); // disable for gamemasters with GM-mode enabled - if (m_player->isGameMaster()) + if (referencePlayer->isGameMaster()) return; - AchievementCriteriaEntryList const& achievementCriteriaList = sAchievementMgr->GetAchievementCriteriaByType(type); + AchievementCriteriaEntryList const& achievementCriteriaList = sAchievementMgr->GetAchievementCriteriaByType(type, IsGuild()); for (AchievementCriteriaEntryList::const_iterator i = achievementCriteriaList.begin(); i != achievementCriteriaList.end(); ++i) { AchievementCriteriaEntry const* achievementCriteria = (*i); @@ -737,12 +1089,12 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (!achievement) continue; - if (!CanUpdateCriteria(achievementCriteria, achievement, miscValue1, miscValue2, unit)) + if (!CanUpdateCriteria(achievementCriteria, achievement, miscValue1, miscValue2, unit, referencePlayer)) continue; // requirements not found in the dbc if (AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria)) - if (!data->Meets(GetPlayer(), unit, miscValue1)) + if (!data->Meets(referencePlayer, unit, miscValue1)) continue; switch (type) @@ -761,7 +1113,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui // AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case if (!miscValue1) continue; - SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); + SetCriteriaProgress(achievementCriteria, 1, referencePlayer, PROGRESS_ACCUMULATE); break; // std case: increment at miscvalue1 case ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_VENDORS: @@ -777,7 +1129,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui // AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case if (!miscValue1) continue; - SetCriteriaProgress(achievementCriteria, miscValue1, PROGRESS_ACCUMULATE); + SetCriteriaProgress(achievementCriteria, miscValue1, referencePlayer, PROGRESS_ACCUMULATE); break; // std case: high value at miscvalue1 case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_BID: @@ -789,7 +1141,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui // AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case if (!miscValue1) continue; - SetCriteriaProgress(achievementCriteria, miscValue1, PROGRESS_HIGHEST); + SetCriteriaProgress(achievementCriteria, miscValue1, referencePlayer, PROGRESS_HIGHEST); break; // specialized cases @@ -799,7 +1151,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (!miscValue1) continue; - SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); + SetCriteriaProgress(achievementCriteria, 1, referencePlayer, PROGRESS_ACCUMULATE); break; } case ACHIEVEMENT_CRITERIA_TYPE_WIN_BG: @@ -807,10 +1159,10 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui // AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case if (!miscValue1) continue; - if (achievementCriteria->win_bg.bgMapID != GetPlayer()->GetMapId()) + if (achievementCriteria->win_bg.bgMapID != referencePlayer->GetMapId()) continue; - SetCriteriaProgress(achievementCriteria, miscValue1, PROGRESS_ACCUMULATE); + SetCriteriaProgress(achievementCriteria, miscValue1, referencePlayer, PROGRESS_ACCUMULATE); break; } case ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE: @@ -821,33 +1173,33 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (achievementCriteria->kill_creature.creatureID != miscValue1) continue; - SetCriteriaProgress(achievementCriteria, miscValue2, PROGRESS_ACCUMULATE); + SetCriteriaProgress(achievementCriteria, miscValue2, referencePlayer, PROGRESS_ACCUMULATE); break; } case ACHIEVEMENT_CRITERIA_TYPE_REACH_LEVEL: - SetCriteriaProgress(achievementCriteria, GetPlayer()->getLevel()); + SetCriteriaProgress(achievementCriteria, referencePlayer->getLevel(), referencePlayer); break; case ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL: // update at loading or specific skill update if (miscValue1 && miscValue1 != achievementCriteria->reach_skill_level.skillID) continue; - if (uint32 skillvalue = GetPlayer()->GetBaseSkillValue(achievementCriteria->reach_skill_level.skillID)) - SetCriteriaProgress(achievementCriteria, skillvalue); + if (uint32 skillvalue = referencePlayer->GetBaseSkillValue(achievementCriteria->reach_skill_level.skillID)) + SetCriteriaProgress(achievementCriteria, skillvalue, referencePlayer); break; case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LEVEL: // update at loading or specific skill update if (miscValue1 && miscValue1 != achievementCriteria->learn_skill_level.skillID) continue; - if (uint32 maxSkillvalue = GetPlayer()->GetPureMaxSkillValue(achievementCriteria->learn_skill_level.skillID)) - SetCriteriaProgress(achievementCriteria, maxSkillvalue); + if (uint32 maxSkillvalue = referencePlayer->GetPureMaxSkillValue(achievementCriteria->learn_skill_level.skillID)) + SetCriteriaProgress(achievementCriteria, maxSkillvalue, referencePlayer); break; case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT: if (m_completedAchievements.find(achievementCriteria->complete_achievement.linkedAchievement) != m_completedAchievements.end()) - SetCriteriaProgress(achievementCriteria, 1); + SetCriteriaProgress(achievementCriteria, 1, referencePlayer); break; case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST_COUNT: { - SetCriteriaProgress(achievementCriteria, GetPlayer()->GetRewardedQuestCount()); + SetCriteriaProgress(achievementCriteria, referencePlayer->GetRewardedQuestCount(), referencePlayer); break; } case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST_DAILY: @@ -859,7 +1211,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui { // reset if player missed one day. if (progress && progress->date < (nextDailyResetTime - 2 * DAY)) - SetCriteriaProgress(achievementCriteria, 0, PROGRESS_SET); + SetCriteriaProgress(achievementCriteria, 0, referencePlayer, PROGRESS_SET); continue; } @@ -877,7 +1229,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui // last progress is within the day before the reset => Already counted today. continue; - SetCriteriaProgress(achievementCriteria, 1, progressType); + SetCriteriaProgress(achievementCriteria, 1, referencePlayer, progressType); break; } case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUESTS_IN_ZONE: @@ -888,31 +1240,31 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui uint32 counter = 0; - const RewardedQuestSet &rewQuests = GetPlayer()->getRewardedQuests(); + const RewardedQuestSet &rewQuests = referencePlayer->getRewardedQuests(); for (RewardedQuestSet::const_iterator itr = rewQuests.begin(); itr != rewQuests.end(); ++itr) { Quest const* quest = sObjectMgr->GetQuestTemplate(*itr); if (quest && quest->GetZoneOrSort() >= 0 && uint32(quest->GetZoneOrSort()) == achievementCriteria->complete_quests_in_zone.zoneID) ++counter; } - SetCriteriaProgress(achievementCriteria, counter); + SetCriteriaProgress(achievementCriteria, counter, referencePlayer); break; } case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_BATTLEGROUND: // AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case if (!miscValue1) continue; - if (GetPlayer()->GetMapId() != achievementCriteria->complete_battleground.mapID) + if (referencePlayer->GetMapId() != achievementCriteria->complete_battleground.mapID) continue; - SetCriteriaProgress(achievementCriteria, miscValue1, PROGRESS_ACCUMULATE); + SetCriteriaProgress(achievementCriteria, miscValue1, referencePlayer, PROGRESS_ACCUMULATE); break; case ACHIEVEMENT_CRITERIA_TYPE_DEATH_AT_MAP: // AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case if (!miscValue1) continue; - if (GetPlayer()->GetMapId() != achievementCriteria->death_at_map.mapID) + if (referencePlayer->GetMapId() != achievementCriteria->death_at_map.mapID) continue; - SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); + SetCriteriaProgress(achievementCriteria, 1, referencePlayer, PROGRESS_ACCUMULATE); break; case ACHIEVEMENT_CRITERIA_TYPE_DEATH: { @@ -925,7 +1277,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui { if (achievIdByArenaSlot[j] == achievement->ID) { - Battleground* bg = GetPlayer()->GetBattleground(); + Battleground* bg = referencePlayer->GetBattleground(); if (!bg || !bg->isArena() || ArenaTeam::GetSlotByType(bg->GetArenaType()) != j) notfit = true; @@ -935,7 +1287,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (notfit) continue; - SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); + SetCriteriaProgress(achievementCriteria, 1, referencePlayer, PROGRESS_ACCUMULATE); break; } case ACHIEVEMENT_CRITERIA_TYPE_DEATH_IN_DUNGEON: @@ -944,7 +1296,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (!miscValue1) continue; - Map const* map = GetPlayer()->IsInWorld() ? GetPlayer()->GetMap() : sMapMgr->FindMap(GetPlayer()->GetMapId(), GetPlayer()->GetInstanceId()); + Map const* map = referencePlayer->IsInWorld() ? referencePlayer->GetMap() : sMapMgr->FindMap(referencePlayer->GetMapId(), referencePlayer->GetInstanceId()); if (!map || !map->IsDungeon()) continue; @@ -960,7 +1312,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (!achievIdForDungeon[j][2]) break; // for } - else if (GetPlayer()->GetDungeonDifficulty() == DUNGEON_DIFFICULTY_NORMAL) + else if (referencePlayer->GetDungeonDifficulty() == DUNGEON_DIFFICULTY_NORMAL) { // dungeon in normal mode accepted if (!achievIdForDungeon[j][1]) @@ -983,7 +1335,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui //FIXME: work only for instances where max == min for players if (((InstanceMap*)map)->GetMaxPlayers() != achievementCriteria->death_in_dungeon.manLimit) continue; - SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); + SetCriteriaProgress(achievementCriteria, 1, referencePlayer, PROGRESS_ACCUMULATE); break; } @@ -993,7 +1345,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui continue; if (miscValue1 != achievementCriteria->killed_by_creature.creatureEntry) continue; - SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); + SetCriteriaProgress(achievementCriteria, 1, referencePlayer, PROGRESS_ACCUMULATE); break; case ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_PLAYER: // AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case @@ -1001,10 +1353,10 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui continue; // if team check required: must kill by opposition faction - if (achievement->ID == 318 && miscValue2 == GetPlayer()->GetTeam()) + if (achievement->ID == 318 && miscValue2 == referencePlayer->GetTeam()) continue; - SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); + SetCriteriaProgress(achievementCriteria, 1, referencePlayer, PROGRESS_ACCUMULATE); break; case ACHIEVEMENT_CRITERIA_TYPE_FALL_WITHOUT_DYING: { @@ -1013,7 +1365,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui continue; // miscvalue1 is the ingame fallheight*100 as stored in dbc - SetCriteriaProgress(achievementCriteria, miscValue1); + SetCriteriaProgress(achievementCriteria, miscValue1, referencePlayer); break; } case ACHIEVEMENT_CRITERIA_TYPE_DEATHS_FROM: @@ -1022,7 +1374,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui continue; if (miscValue2 != achievementCriteria->death_from.type) continue; - SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); + SetCriteriaProgress(achievementCriteria, 1, referencePlayer, PROGRESS_ACCUMULATE); break; case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST: { @@ -1035,15 +1387,15 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui else { // login case. - if (!GetPlayer()->GetQuestRewardStatus(achievementCriteria->complete_quest.questID)) + if (!referencePlayer->GetQuestRewardStatus(achievementCriteria->complete_quest.questID)) continue; } if (AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria)) - if (!data->Meets(GetPlayer(), unit)) + if (!data->Meets(referencePlayer, unit)) continue; - SetCriteriaProgress(achievementCriteria, 1); + SetCriteriaProgress(achievementCriteria, 1, referencePlayer); break; } case ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET: @@ -1052,7 +1404,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (!miscValue1 || miscValue1 != achievementCriteria->be_spell_target.spellID) continue; - SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); + SetCriteriaProgress(achievementCriteria, 1, referencePlayer, PROGRESS_ACCUMULATE); break; } case ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL: @@ -1061,15 +1413,15 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (!miscValue1 || miscValue1 != achievementCriteria->cast_spell.spellID) continue; - SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); + SetCriteriaProgress(achievementCriteria, 1, referencePlayer, PROGRESS_ACCUMULATE); break; } case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL: if (miscValue1 && miscValue1 != achievementCriteria->learn_spell.spellID) continue; - if (GetPlayer()->HasSpell(achievementCriteria->learn_spell.spellID)) - SetCriteriaProgress(achievementCriteria, 1); + if (referencePlayer->HasSpell(achievementCriteria->learn_spell.spellID)) + SetCriteriaProgress(achievementCriteria, 1, referencePlayer); break; case ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE: { @@ -1080,20 +1432,20 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (miscValue1 != achievementCriteria->loot_type.lootType) continue; - SetCriteriaProgress(achievementCriteria, miscValue2, PROGRESS_ACCUMULATE); + SetCriteriaProgress(achievementCriteria, miscValue2, referencePlayer, PROGRESS_ACCUMULATE); break; } case ACHIEVEMENT_CRITERIA_TYPE_OWN_ITEM: // speedup for non-login case if (miscValue1 && achievementCriteria->own_item.itemID != miscValue1) continue; - SetCriteriaProgress(achievementCriteria, miscValue2, PROGRESS_ACCUMULATE); + SetCriteriaProgress(achievementCriteria, miscValue2, referencePlayer, PROGRESS_ACCUMULATE); break; case ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA: if (!miscValue1) // no update at login continue; - SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); + SetCriteriaProgress(achievementCriteria, 1, referencePlayer, PROGRESS_ACCUMULATE); break; case ACHIEVEMENT_CRITERIA_TYPE_USE_ITEM: // AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case @@ -1103,7 +1455,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (achievementCriteria->use_item.itemID != miscValue1) continue; - SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); + SetCriteriaProgress(achievementCriteria, 1, referencePlayer, PROGRESS_ACCUMULATE); break; case ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM: // You _have_ to loot that item, just owning it when logging in does _not_ count! @@ -1111,7 +1463,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui continue; if (miscValue1 != achievementCriteria->own_item.itemID) continue; - SetCriteriaProgress(achievementCriteria, miscValue2, PROGRESS_ACCUMULATE); + SetCriteriaProgress(achievementCriteria, miscValue2, referencePlayer, PROGRESS_ACCUMULATE); break; case ACHIEVEMENT_CRITERIA_TYPE_EXPLORE_AREA: { @@ -1133,7 +1485,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui uint32 playerIndexOffset = uint32(exploreFlag) / 32; uint32 mask = 1<< (uint32(exploreFlag) % 32); - if (GetPlayer()->GetUInt32Value(PLAYER_EXPLORED_ZONES_1 + playerIndexOffset) & mask) + if (referencePlayer->GetUInt32Value(PLAYER_EXPLORED_ZONES_1 + playerIndexOffset) & mask) { matchFound = true; break; @@ -1141,11 +1493,11 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui } if (matchFound) - SetCriteriaProgress(achievementCriteria, 1); + SetCriteriaProgress(achievementCriteria, 1, referencePlayer); break; } case ACHIEVEMENT_CRITERIA_TYPE_BUY_BANK_SLOT: - SetCriteriaProgress(achievementCriteria, GetPlayer()->GetBankBagSlotCount()); + SetCriteriaProgress(achievementCriteria, referencePlayer->GetBankBagSlotCount(), referencePlayer); break; case ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION: { @@ -1153,14 +1505,14 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (miscValue1 && miscValue1 != achievementCriteria->gain_reputation.factionID) continue; - int32 reputation = GetPlayer()->GetReputationMgr().GetReputation(achievementCriteria->gain_reputation.factionID); + int32 reputation = referencePlayer->GetReputationMgr().GetReputation(achievementCriteria->gain_reputation.factionID); if (reputation > 0) - SetCriteriaProgress(achievementCriteria, reputation); + SetCriteriaProgress(achievementCriteria, reputation, referencePlayer); break; } case ACHIEVEMENT_CRITERIA_TYPE_GAIN_EXALTED_REPUTATION: { - SetCriteriaProgress(achievementCriteria, GetPlayer()->GetReputationMgr().GetExaltedFactionCount()); + SetCriteriaProgress(achievementCriteria, referencePlayer->GetReputationMgr().GetExaltedFactionCount(), referencePlayer); break; } case ACHIEVEMENT_CRITERIA_TYPE_VISIT_BARBER_SHOP: @@ -1168,7 +1520,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui // skip for login case if (!miscValue1) continue; - SetCriteriaProgress(achievementCriteria, 1); + SetCriteriaProgress(achievementCriteria, 1, referencePlayer); break; } case ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM: @@ -1181,7 +1533,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (miscValue2 != achievementCriteria->equip_epic_item.itemSlot) continue; - SetCriteriaProgress(achievementCriteria, 1); + SetCriteriaProgress(achievementCriteria, 1, referencePlayer); break; } @@ -1199,7 +1551,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (!pProto) continue; - SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); + SetCriteriaProgress(achievementCriteria, 1, referencePlayer, PROGRESS_ACCUMULATE); break; } case ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE: @@ -1210,7 +1562,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (miscValue1 != achievementCriteria->do_emote.emoteID) continue; - SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); + SetCriteriaProgress(achievementCriteria, 1, referencePlayer, PROGRESS_ACCUMULATE); break; } case ACHIEVEMENT_CRITERIA_TYPE_DAMAGE_DONE: @@ -1221,7 +1573,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (achievementCriteria->additionalRequirements[0].additionalRequirement_type == ACHIEVEMENT_CRITERIA_CONDITION_BG_MAP) { - if (GetPlayer()->GetMapId() != achievementCriteria->additionalRequirements[0].additionalRequirement_value) + if (referencePlayer->GetMapId() != achievementCriteria->additionalRequirements[0].additionalRequirement_value) continue; // map specific case (BG in fact) expected player targeted damage/heal @@ -1229,7 +1581,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui continue; } - SetCriteriaProgress(achievementCriteria, miscValue1, PROGRESS_ACCUMULATE); + SetCriteriaProgress(achievementCriteria, miscValue1, referencePlayer, PROGRESS_ACCUMULATE); break; } case ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM: @@ -1239,7 +1591,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (miscValue1 != achievementCriteria->equip_item.itemID) continue; - SetCriteriaProgress(achievementCriteria, 1); + SetCriteriaProgress(achievementCriteria, 1, referencePlayer); break; case ACHIEVEMENT_CRITERIA_TYPE_USE_GAMEOBJECT: // miscvalue1 = go entry @@ -1248,7 +1600,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (miscValue1 != achievementCriteria->use_gameobject.goEntry) continue; - SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); + SetCriteriaProgress(achievementCriteria, 1, referencePlayer, PROGRESS_ACCUMULATE); break; case ACHIEVEMENT_CRITERIA_TYPE_FISH_IN_GAMEOBJECT: if (!miscValue1) @@ -1256,7 +1608,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (miscValue1 != achievementCriteria->fish_in_gameobject.goEntry) continue; - SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); + SetCriteriaProgress(achievementCriteria, 1, referencePlayer, PROGRESS_ACCUMULATE); break; case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS: { @@ -1264,8 +1616,8 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui continue; uint32 spellCount = 0; - for (PlayerSpellMap::const_iterator spellIter = GetPlayer()->GetSpellMap().begin(); - spellIter != GetPlayer()->GetSpellMap().end(); + for (PlayerSpellMap::const_iterator spellIter = referencePlayer->GetSpellMap().begin(); + spellIter != referencePlayer->GetSpellMap().end(); ++spellIter) { SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellIter->first); @@ -1275,7 +1627,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui spellCount++; } } - SetCriteriaProgress(achievementCriteria, spellCount); + SetCriteriaProgress(achievementCriteria, spellCount, referencePlayer); break; } case ACHIEVEMENT_CRITERIA_TYPE_WIN_DUEL: @@ -1283,16 +1635,16 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (!miscValue1) continue; - SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); + SetCriteriaProgress(achievementCriteria, 1, referencePlayer, PROGRESS_ACCUMULATE); break; case ACHIEVEMENT_CRITERIA_TYPE_GAIN_REVERED_REPUTATION: - SetCriteriaProgress(achievementCriteria, GetPlayer()->GetReputationMgr().GetReveredFactionCount()); + SetCriteriaProgress(achievementCriteria, referencePlayer->GetReputationMgr().GetReveredFactionCount(), referencePlayer); break; case ACHIEVEMENT_CRITERIA_TYPE_GAIN_HONORED_REPUTATION: - SetCriteriaProgress(achievementCriteria, GetPlayer()->GetReputationMgr().GetHonoredFactionCount()); + SetCriteriaProgress(achievementCriteria, referencePlayer->GetReputationMgr().GetHonoredFactionCount(), referencePlayer); break; case ACHIEVEMENT_CRITERIA_TYPE_KNOWN_FACTIONS: - SetCriteriaProgress(achievementCriteria, GetPlayer()->GetReputationMgr().GetVisibleFactionCount()); + SetCriteriaProgress(achievementCriteria, referencePlayer->GetReputationMgr().GetVisibleFactionCount(), referencePlayer); break; case ACHIEVEMENT_CRITERIA_TYPE_LOOT_EPIC_ITEM: case ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM: @@ -1303,7 +1655,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui ItemTemplate const* proto = sObjectMgr->GetItemTemplate(miscValue1); if (!proto || proto->Quality < ITEM_QUALITY_EPIC) continue; - SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); + SetCriteriaProgress(achievementCriteria, 1, referencePlayer, PROGRESS_ACCUMULATE); break; } case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LINE: @@ -1312,8 +1664,8 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui continue; uint32 spellCount = 0; - for (PlayerSpellMap::const_iterator spellIter = GetPlayer()->GetSpellMap().begin(); - spellIter != GetPlayer()->GetSpellMap().end(); + for (PlayerSpellMap::const_iterator spellIter = referencePlayer->GetSpellMap().begin(); + spellIter != referencePlayer->GetSpellMap().end(); ++spellIter) { SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellIter->first); @@ -1321,26 +1673,26 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (skillIter->second->skillId == achievementCriteria->learn_skill_line.skillLine) spellCount++; } - SetCriteriaProgress(achievementCriteria, spellCount); + SetCriteriaProgress(achievementCriteria, spellCount, referencePlayer); break; } case ACHIEVEMENT_CRITERIA_TYPE_EARN_HONORABLE_KILL: - SetCriteriaProgress(achievementCriteria, GetPlayer()->GetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS)); + SetCriteriaProgress(achievementCriteria, referencePlayer->GetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS), referencePlayer); break; case ACHIEVEMENT_CRITERIA_TYPE_HK_CLASS: if (!miscValue1 || miscValue1 != achievementCriteria->hk_class.classID) continue; - SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); + SetCriteriaProgress(achievementCriteria, 1, referencePlayer, PROGRESS_ACCUMULATE); break; case ACHIEVEMENT_CRITERIA_TYPE_HK_RACE: if (!miscValue1 || miscValue1 != achievementCriteria->hk_race.raceID) continue; - SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); + SetCriteriaProgress(achievementCriteria, 1, referencePlayer, PROGRESS_ACCUMULATE); break; case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_GOLD_VALUE_OWNED: - SetCriteriaProgress(achievementCriteria, GetPlayer()->GetMoney(), PROGRESS_HIGHEST); + SetCriteriaProgress(achievementCriteria, referencePlayer->GetMoney(), referencePlayer, PROGRESS_HIGHEST); break; case ACHIEVEMENT_CRITERIA_TYPE_EARN_ACHIEVEMENT_POINTS: { @@ -1350,10 +1702,10 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui for (CompletedAchievementMap::iterator itr = m_completedAchievements.begin(); itr != m_completedAchievements.end(); ++itr) if (AchievementEntry const* pAchievement = sAchievementStore.LookupEntry(itr->first)) points += pAchievement->points; - SetCriteriaProgress(achievementCriteria, points, PROGRESS_SET); + SetCriteriaProgress(achievementCriteria, points, referencePlayer, PROGRESS_SET); } else - SetCriteriaProgress(achievementCriteria, miscValue1, PROGRESS_ACCUMULATE); + SetCriteriaProgress(achievementCriteria, miscValue1, referencePlayer, PROGRESS_ACCUMULATE); break; } case ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE: @@ -1361,7 +1713,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (!miscValue1 || miscValue1 != achievementCriteria->bg_objective.objectiveId) continue; - SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); + SetCriteriaProgress(achievementCriteria, 1, referencePlayer, PROGRESS_ACCUMULATE); break; } case ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL: @@ -1372,7 +1724,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (!miscValue1) continue; - SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); + SetCriteriaProgress(achievementCriteria, 1, referencePlayer, PROGRESS_ACCUMULATE); break; } case ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL_AT_AREA: @@ -1380,7 +1732,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (!miscValue1 || miscValue1 != achievementCriteria->honorable_kill_at_area.areaID) continue; - SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); + SetCriteriaProgress(achievementCriteria, 1, referencePlayer, PROGRESS_ACCUMULATE); break; } case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_TEAM_RATING: @@ -1392,13 +1744,13 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (miscValue2 != reqTeamType) continue; - SetCriteriaProgress(achievementCriteria, miscValue1, PROGRESS_HIGHEST); + SetCriteriaProgress(achievementCriteria, miscValue1, referencePlayer, PROGRESS_HIGHEST); } else // login case { for (uint32 arena_slot = 0; arena_slot < MAX_ARENA_SLOT; ++arena_slot) { - uint32 teamId = GetPlayer()->GetArenaTeamId(arena_slot); + uint32 teamId = referencePlayer->GetArenaTeamId(arena_slot); if (!teamId) continue; @@ -1406,7 +1758,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (!team || team->GetType() != reqTeamType) continue; - SetCriteriaProgress(achievementCriteria, team->GetStats().Rating, PROGRESS_HIGHEST); + SetCriteriaProgress(achievementCriteria, team->GetStats().Rating, referencePlayer, PROGRESS_HIGHEST); break; } } @@ -1422,13 +1774,13 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (miscValue2 != reqTeamType) continue; - SetCriteriaProgress(achievementCriteria, miscValue1, PROGRESS_HIGHEST); + SetCriteriaProgress(achievementCriteria, miscValue1, referencePlayer, PROGRESS_HIGHEST); } else // login case { for (uint32 arena_slot = 0; arena_slot < MAX_ARENA_SLOT; ++arena_slot) { - uint32 teamId = GetPlayer()->GetArenaTeamId(arena_slot); + uint32 teamId = referencePlayer->GetArenaTeamId(arena_slot); if (!teamId) continue; @@ -1436,9 +1788,9 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (!team || team->GetType() != reqTeamType) continue; - if (ArenaTeamMember const* member = team->GetMember(GetPlayer()->GetGUID())) + if (ArenaTeamMember const* member = team->GetMember(referencePlayer->GetGUID())) { - SetCriteriaProgress(achievementCriteria, member->PersonalRating, PROGRESS_HIGHEST); + SetCriteriaProgress(achievementCriteria, member->PersonalRating, referencePlayer, PROGRESS_HIGHEST); break; } } @@ -1453,7 +1805,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui continue; if (int64(miscValue2) < 0) continue; - SetCriteriaProgress(achievementCriteria, miscValue2, PROGRESS_ACCUMULATE); + SetCriteriaProgress(achievementCriteria, miscValue2, referencePlayer, PROGRESS_ACCUMULATE); break; // FIXME: not triggered in code as result, need to implement case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_RAID: @@ -1479,22 +1831,23 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui } if (IsCompletedCriteria(achievementCriteria, achievement)) - CompletedCriteriaFor(achievement); + CompletedCriteriaFor(achievement, referencePlayer); // check again the completeness for SUMM and REQ COUNT achievements, // as they don't depend on the completed criteria but on the sum of the progress of each individual criteria if (achievement->flags & ACHIEVEMENT_FLAG_SUMM) if (IsCompletedAchievement(achievement)) - CompletedAchievement(achievement); + CompletedAchievement(achievement, referencePlayer); if (AchievementEntryList const* achRefList = sAchievementMgr->GetAchievementByReferencedId(achievement->ID)) for (AchievementEntryList::const_iterator itr = achRefList->begin(); itr != achRefList->end(); ++itr) if (IsCompletedAchievement(*itr)) - CompletedAchievement(*itr); + CompletedAchievement(*itr, referencePlayer); } } -bool AchievementMgr::IsCompletedCriteria(AchievementCriteriaEntry const* achievementCriteria, AchievementEntry const* achievement) +template +bool AchievementMgr::IsCompletedCriteria(AchievementCriteriaEntry const* achievementCriteria, AchievementEntry const* achievement) { // counter can never complete if (achievement->flags & ACHIEVEMENT_FLAG_COUNTER) @@ -1651,7 +2004,8 @@ bool AchievementMgr::IsCompletedCriteria(AchievementCriteriaEntry const* achieve return false; } -void AchievementMgr::CompletedCriteriaFor(AchievementEntry const* achievement) +template +void AchievementMgr::CompletedCriteriaFor(AchievementEntry const* achievement, Player* referencePlayer) { // counter can never complete if (achievement->flags & ACHIEVEMENT_FLAG_COUNTER) @@ -1662,10 +2016,11 @@ void AchievementMgr::CompletedCriteriaFor(AchievementEntry const* achievement) return; if (IsCompletedAchievement(achievement)) - CompletedAchievement(achievement); + CompletedAchievement(achievement, referencePlayer); } -bool AchievementMgr::IsCompletedAchievement(AchievementEntry const* entry) +template +bool AchievementMgr::IsCompletedAchievement(AchievementEntry const* entry) { // counter can never complete if (entry->flags & ACHIEVEMENT_FLAG_COUNTER) @@ -1727,7 +2082,8 @@ bool AchievementMgr::IsCompletedAchievement(AchievementEntry const* entry) return false; } -CriteriaProgress* AchievementMgr::GetCriteriaProgress(AchievementCriteriaEntry const* entry) +template +CriteriaProgress* AchievementMgr::GetCriteriaProgress(AchievementCriteriaEntry const* entry) { CriteriaProgressMap::iterator iter = m_criteriaProgress.find(entry->ID); @@ -1737,14 +2093,15 @@ CriteriaProgress* AchievementMgr::GetCriteriaProgress(AchievementCriteriaEntry c return &(iter->second); } -void AchievementMgr::SetCriteriaProgress(AchievementCriteriaEntry const* entry, uint32 changeValue, ProgressType ptype) +template +void AchievementMgr::SetCriteriaProgress(AchievementCriteriaEntry const* entry, uint32 changeValue, Player* referencePlayer, ProgressType ptype) { // Don't allow to cheat - doing timed achievements without timer active TimedAchievementMap::iterator timedIter = m_timedAchievements.find(entry->ID); if (entry->timeLimit && timedIter == m_timedAchievements.end()) return; - sLog->outDebug(LOG_FILTER_ACHIEVEMENTSYS, "AchievementMgr::SetCriteriaProgress(%u, %u) for (GUID:%u)", entry->ID, changeValue, m_player->GetGUIDLow()); + sLog->outDebug(LOG_FILTER_ACHIEVEMENTSYS, "AchievementMgr::SetCriteriaProgress(%u, %u) for (%s GUID: "UI64FMTD")", entry->ID, changeValue, GetLogNameForGuid(GetOwner()->GetGUID()), GetOwner()->GetGUID()); CriteriaProgress* progress = GetCriteriaProgress(entry); if (!progress) @@ -1787,38 +2144,28 @@ void AchievementMgr::SetCriteriaProgress(AchievementCriteriaEntry const* entry, progress->changed = true; progress->date = time(NULL); // set the date to the latest update. + AchievementEntry const* achievement = sAchievementStore.LookupEntry(entry->referredAchievement); uint32 timeElapsed = 0; - bool timedCompleted = false; + bool criteriaComplete = IsCompletedCriteria(entry, achievement); if (entry->timeLimit) { - // has to exist else we wouldn't be here - timedCompleted = IsCompletedCriteria(entry, sAchievementStore.LookupEntry(entry->referredAchievement)); // Client expects this in packet timeElapsed = entry->timeLimit - (timedIter->second/IN_MILLISECONDS); // Remove the timer, we wont need it anymore - if (timedCompleted) + if (criteriaComplete) m_timedAchievements.erase(timedIter); } - SendCriteriaUpdate(entry, progress, timeElapsed, timedCompleted); -} - -void AchievementMgr::RemoveCriteriaProgress(const AchievementCriteriaEntry* entry) -{ - CriteriaProgressMap::iterator criteriaProgress = m_criteriaProgress.find(entry->ID); - if (criteriaProgress == m_criteriaProgress.end()) - return; - - WorldPacket data(SMSG_CRITERIA_DELETED, 4); - data << uint32(entry->ID); - m_player->SendDirectMessage(&data); + if (criteriaComplete && achievement->flags & ACHIEVEMENT_FLAG_SHOW_CRITERIA_MEMBERS && !progress->CompletedGUID) + progress->CompletedGUID = referencePlayer->GetGUID(); - m_criteriaProgress.erase(criteriaProgress); + SendCriteriaUpdate(entry, progress, timeElapsed, criteriaComplete); } -void AchievementMgr::UpdateTimedAchievements(uint32 timeDiff) +template +void AchievementMgr::UpdateTimedAchievements(uint32 timeDiff) { if (!m_timedAchievements.empty()) { @@ -1840,7 +2187,13 @@ void AchievementMgr::UpdateTimedAchievements(uint32 timeDiff) } } -void AchievementMgr::StartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry, uint32 timeLost /*= 0*/) +template +void AchievementMgr::StartTimedAchievement(AchievementCriteriaTimedTypes /*type*/, uint32 /*entry*/, uint32 /*timeLost = 0*/) +{ +} + +template<> +void AchievementMgr::StartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry, uint32 timeLost /* = 0 */) { AchievementCriteriaEntryList const& achievementCriteriaList = sAchievementMgr->GetTimedAchievementCriteriaByType(type); for (AchievementCriteriaEntryList::const_iterator i = achievementCriteriaList.begin(); i != achievementCriteriaList.end(); ++i) @@ -1857,13 +2210,14 @@ void AchievementMgr::StartTimedAchievement(AchievementCriteriaTimedTypes type, u m_timedAchievements[(*i)->ID] = (*i)->timeLimit * IN_MILLISECONDS - timeLost; // and at client too - SetCriteriaProgress(*i, 0, PROGRESS_SET); + SetCriteriaProgress(*i, 0, GetOwner(), PROGRESS_SET); } } } } -void AchievementMgr::RemoveTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry) +template +void AchievementMgr::RemoveTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry) { AchievementCriteriaEntryList const& achievementCriteriaList = sAchievementMgr->GetTimedAchievementCriteriaByType(type); for (AchievementCriteriaEntryList::const_iterator i = achievementCriteriaList.begin(); i!=achievementCriteriaList.end(); ++i) @@ -1884,18 +2238,21 @@ void AchievementMgr::RemoveTimedAchievement(AchievementCriteriaTimedTypes type, } } -void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement) +template +void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement, Player* /*referencePlayer*/) { sLog->outDetail("AchievementMgr::CompletedAchievement(%u)", achievement->ID); // disable for gamemasters with GM-mode enabled - if (m_player->isGameMaster()) + if (_owner->isGameMaster()) return; if (achievement->flags & ACHIEVEMENT_FLAG_COUNTER || HasAchieved(achievement->ID)) return; - SendAchievementEarned(achievement); + if (!GetOwner()->GetSession()->PlayerLoading()) + SendAchievementEarned(achievement); + CompletedAchievementData& ca = m_completedAchievements[achievement->ID]; ca.date = time(NULL); ca.changed = true; @@ -1920,16 +2277,16 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement) //! Since no common attributes were found, (not even in titleRewardFlags field) //! we explicitly check by ID. Maybe in the future we could move the achievement_reward //! condition fields to the condition system. - if (uint32 titleId = reward->titleId[achievement->ID == 1793 ? GetPlayer()->getGender() : (GetPlayer()->GetTeam() == ALLIANCE ? 0 : 1)]) + if (uint32 titleId = reward->titleId[achievement->ID == 1793 ? GetOwner()->getGender() : (GetOwner()->GetTeam() == ALLIANCE ? 0 : 1)]) if (CharTitlesEntry const* titleEntry = sCharTitlesStore.LookupEntry(titleId)) - GetPlayer()->SetTitle(titleEntry); + GetOwner()->SetTitle(titleEntry); // mail if (reward->sender) { - Item* item = reward->itemId ? Item::CreateItem(reward->itemId, 1, GetPlayer()) : NULL; + Item* item = reward->itemId ? Item::CreateItem(reward->itemId, 1, GetOwner()) : NULL; - int loc_idx = GetPlayer()->GetSession()->GetSessionDbLocaleIndex(); + int loc_idx = GetOwner()->GetSession()->GetSessionDbLocaleIndex(); // subject and text std::string subject = reward->subject; @@ -1955,100 +2312,336 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement) draft.AddItem(item); } - draft.SendMailTo(trans, GetPlayer(), MailSender(MAIL_CREATURE, reward->sender)); + draft.SendMailTo(trans, GetOwner(), MailSender(MAIL_CREATURE, reward->sender)); CharacterDatabase.CommitTransaction(trans); } } -void AchievementMgr::SendAllAchievementData() const +template<> +void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement, Player* referencePlayer) { - WorldPacket data(SMSG_ALL_ACHIEVEMENT_DATA, m_completedAchievements.size()*8+4+m_criteriaProgress.size()*38+4); - BuildAllDataPacket(&data); + sLog->outDetail("AchievementMgr::CompletedAchievement(%u)", achievement->ID); + + if (achievement->flags & ACHIEVEMENT_FLAG_COUNTER || HasAchieved(achievement->ID)) + return; + + SendAchievementEarned(achievement); + CompletedAchievementData& ca = m_completedAchievements[achievement->ID]; + ca.date = time(NULL); + ca.changed = true; + + if (achievement->flags & ACHIEVEMENT_FLAG_SHOW_GUILD_MEMBERS) + { + if (referencePlayer->GetGuildId() == GetOwner()->GetId()) + ca.guids.insert(referencePlayer->GetGUID()); + + if (Group const* group = referencePlayer->GetGroup()) + for (GroupReference const* ref = group->GetFirstMember(); ref != NULL; ref = ref->next()) + if (Player const* groupMember = ref->getSource()) + if (groupMember->GetGuildId() == GetOwner()->GetId()) + ca.guids.insert(groupMember->GetGUID()); + } + + sAchievementMgr->SetRealmCompleted(achievement); + + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EARN_ACHIEVEMENT_POINTS, achievement->points); +} + +struct VisibleAchievementPred +{ + bool operator()(CompletedAchievementMap::value_type const& val) + { + AchievementEntry const* achievement = sAchievementStore.LookupEntry(val.first); + return achievement && !(achievement->flags & ACHIEVEMENT_FLAG_HIDDEN); + } +}; + +template +void AchievementMgr::SendAllAchievementData(Player* /*receiver*/) const +{ + VisibleAchievementPred isVisible; + size_t numCriteria = m_criteriaProgress.size(); + size_t numAchievements = std::count_if(m_completedAchievements.begin(), m_completedAchievements.end(), isVisible); + ByteBuffer criteriaData(numCriteria * (4 + 4 + 4 + 4 + 8 + 8)); + uint8 guidBytes[8]; + uint8 progressBytes[8]; + *reinterpret_cast(&guidBytes[0]) = GetOwner()->GetGUID(); + + WorldPacket data(SMSG_ALL_ACHIEVEMENT_DATA, 4 + numAchievements * (4 + 4) + 4 + numCriteria * (4 + 4 + 4 + 4 + 8 + 8)); + data.WriteBits(21, numCriteria); + for (CriteriaProgressMap::const_iterator itr = m_criteriaProgress.begin(); itr != m_criteriaProgress.end(); ++itr) + { + *reinterpret_cast(&progressBytes[0]) = itr->second.counter; + + data.WriteBit(guidBytes[4]); + data.WriteBit(progressBytes[3]); + data.WriteBit(guidBytes[5]); + data.WriteBit(progressBytes[0]); + data.WriteBit(progressBytes[6]); + data.WriteBit(guidBytes[3]); + data.WriteBit(guidBytes[0]); + data.WriteBit(progressBytes[4]); + data.WriteBit(guidBytes[2]); + data.WriteBit(progressBytes[7]); + data.WriteBit(guidBytes[7]); + data.WriteBits(0, 2); + data.WriteBit(guidBytes[6]); + data.WriteBit(progressBytes[2]); + data.WriteBit(progressBytes[1]); + data.WriteBit(progressBytes[5]); + data.WriteBit(guidBytes[1]); + + criteriaData.WriteByteSeq(guidBytes[3]); + criteriaData.WriteByteSeq(progressBytes[5]); + criteriaData.WriteByteSeq(progressBytes[6]); + criteriaData.WriteByteSeq(guidBytes[4]); + criteriaData.WriteByteSeq(guidBytes[6]); + criteriaData.WriteByteSeq(progressBytes[2]); + criteriaData << uint32(0); // timer 2 + criteriaData.WriteByteSeq(guidBytes[2]); + criteriaData << uint32(itr->first); // criteria id + criteriaData.WriteByteSeq(guidBytes[5]); + criteriaData.WriteByteSeq(progressBytes[0]); + criteriaData.WriteByteSeq(progressBytes[3]); + criteriaData.WriteByteSeq(progressBytes[1]); + criteriaData.WriteByteSeq(progressBytes[4]); + criteriaData.WriteByteSeq(guidBytes[0]); + criteriaData.WriteByteSeq(guidBytes[7]); + criteriaData.WriteByteSeq(progressBytes[7]); + criteriaData << uint32(0); // timer 1 + criteriaData << uint32(secsToTimeBitFields(itr->second.date)); // criteria date + criteriaData.WriteByteSeq(guidBytes[1]); + } + + data.WriteBits(numAchievements, 23); + data.append(criteriaData); + + for (CompletedAchievementMap::const_iterator itr = m_completedAchievements.begin(); itr != m_completedAchievements.end(); ++itr) + { + if (!isVisible(*itr)) + continue; + + data << uint32(secsToTimeBitFields(itr->second.date)); + data << uint32(itr->first); + } + if (data.size() > 0x1000) data.Compress(SMSG_COMPRESSED_ACHIEVEMENT_DATA); - GetPlayer()->GetSession()->SendPacket(&data); + SendPacket(&data); } -void AchievementMgr::SendRespondInspectAchievements(Player* player) const +template<> +void AchievementMgr::SendAllAchievementData(Player* receiver) const { - WorldPacket data(SMSG_RESPOND_INSPECT_ACHIEVEMENTS, 9+m_completedAchievements.size()*8+4+m_criteriaProgress.size()*38+4); - data.append(GetPlayer()->GetPackGUID()); - BuildAllDataPacket(&data); - player->GetSession()->SendPacket(&data); + WorldPacket data(SMSG_GUILD_ACHIEVEMENT_DATA, m_completedAchievements.size() * (4 + 4) + 4); + data.WriteBits(m_completedAchievements.size(), 23); + for (CompletedAchievementMap::const_iterator itr = m_completedAchievements.begin(); itr != m_completedAchievements.end(); ++itr) + { + data << uint32(secsToTimeBitFields(itr->second.date)); + data << uint32(itr->first); + } + + receiver->GetSession()->SendPacket(&data); } -/** - * used by SMSG_RESPOND_INSPECT_ACHIEVEMENT and SMSG_ALL_ACHIEVEMENT_DATA - */ -void AchievementMgr::BuildAllDataPacket(WorldPacket* data) const +template +void AchievementMgr::SendAchievementInfo(Player* receiver, uint32 achievementId /*= 0*/) const { - size_t numCriterias = m_criteriaProgress.size(); - uint32 achievementCount = 0; - ByteBuffer bitBuffer(numCriterias * 2 / 8 + 1); // 2 bits per criteria/8 bits per byte - ByteBuffer counterBuffer(numCriterias * 8); // uint64 values - ByteBuffer guidBuffer(numCriterias * 8); - ByteBuffer criteriaDateBuffer(numCriterias * 4); - ByteBuffer zeros(numCriterias * 4, true); // fill with zeros - ByteBuffer criteriaIdBuffer(numCriterias * 4); - ByteBuffer achievementDateBuffer(m_completedAchievements.size() * 4); - ByteBuffer achievementIdBuffer(m_completedAchievements.size() * 4); - - AchievementEntry const* achievement = NULL; - for (CompletedAchievementMap::const_iterator iter = m_completedAchievements.begin(); iter != m_completedAchievements.end(); ++iter) +} + +template<> +void AchievementMgr::SendAchievementInfo(Player* receiver, uint32 /*achievementId = 0 */) const +{ + uint8 guidBytes[8]; + uint8 progressBytes[8]; + + VisibleAchievementPred isVisible; + size_t numCriteria = m_criteriaProgress.size(); + size_t numAchievements = std::count_if(m_completedAchievements.begin(), m_completedAchievements.end(), isVisible); + ByteBuffer criteriaData(numCriteria * (0)); + *reinterpret_cast(&guidBytes[0]) = GetOwner()->GetGUID(); + + WorldPacket data(SMSG_RESPOND_INSPECT_ACHIEVEMENTS, 1 + 8 + 3 + 3 + numAchievements * (4 + 4) + numCriteria * (0)); + data.WriteBit(guidBytes[7]); + data.WriteBit(guidBytes[4]); + data.WriteBit(guidBytes[1]); + data.WriteBits(numAchievements, 23); + data.WriteBit(guidBytes[0]); + data.WriteBit(guidBytes[3]); + data.WriteBits(numCriteria, 21); + data.WriteBit(guidBytes[2]); + for (CriteriaProgressMap::const_iterator itr = m_criteriaProgress.begin(); itr != m_criteriaProgress.end(); ++itr) + { + *reinterpret_cast(&progressBytes[0]) = itr->second.counter; + data.WriteBit(progressBytes[5]); + data.WriteBit(progressBytes[3]); + data.WriteBit(guidBytes[1]); + data.WriteBit(guidBytes[4]); + data.WriteBit(guidBytes[2]); + data.WriteBit(progressBytes[6]); + data.WriteBit(guidBytes[0]); + data.WriteBit(progressBytes[4]); + data.WriteBit(progressBytes[1]); + data.WriteBit(progressBytes[2]); + data.WriteBit(guidBytes[3]); + data.WriteBit(guidBytes[7]); + data.WriteBits(0, 2); // criteria progress flags + data.WriteBit(progressBytes[0]); + data.WriteBit(guidBytes[5]); + data.WriteBit(guidBytes[6]); + data.WriteBit(progressBytes[7]); + + criteriaData.WriteByteSeq(guidBytes[3]); + criteriaData.WriteByteSeq(progressBytes[4]); + criteriaData << uint32(0); // timer 1 + criteriaData.WriteByteSeq(guidBytes[1]); + criteriaData << uint32(secsToTimeBitFields(itr->second.date)); + criteriaData.WriteByteSeq(progressBytes[3]); + criteriaData.WriteByteSeq(progressBytes[7]); + criteriaData.WriteByteSeq(guidBytes[5]); + criteriaData.WriteByteSeq(progressBytes[0]); + criteriaData.WriteByteSeq(guidBytes[4]); + criteriaData.WriteByteSeq(guidBytes[2]); + criteriaData.WriteByteSeq(guidBytes[6]); + criteriaData.WriteByteSeq(guidBytes[7]); + criteriaData.WriteByteSeq(progressBytes[6]); + criteriaData << uint32(itr->first); + criteriaData << uint32(0); // timer 2 + criteriaData.WriteByteSeq(progressBytes[1]); + criteriaData.WriteByteSeq(progressBytes[5]); + criteriaData.WriteByteSeq(guidBytes[0]); + criteriaData.WriteByteSeq(progressBytes[2]); + } + + data.WriteBit(guidBytes[6]); + data.WriteBit(guidBytes[5]); + data.append(criteriaData); + data.WriteByteSeq(guidBytes[1]); + data.WriteByteSeq(guidBytes[6]); + data.WriteByteSeq(guidBytes[3]); + data.WriteByteSeq(guidBytes[0]); + data.WriteByteSeq(guidBytes[2]); + + for (CompletedAchievementMap::const_iterator itr = m_completedAchievements.begin(); itr != m_completedAchievements.end(); ++itr) { - // Skip hidden achievements - achievement = sAchievementStore.LookupEntry(iter->first); - if (achievement->flags & ACHIEVEMENT_FLAG_HIDDEN) + if (!isVisible(*itr)) continue; - achievementDateBuffer << uint32(secsToTimeBitFields(iter->second.date)); - achievementIdBuffer << uint32(achievement->ID); - ++achievementCount; + data << uint32(itr->first); + data << uint32(secsToTimeBitFields(itr->second.date)); } - for (CriteriaProgressMap::const_iterator itr = m_criteriaProgress.begin(); itr != m_criteriaProgress.end(); ++itr) + data.WriteByteSeq(guidBytes[7]); + data.WriteByteSeq(guidBytes[4]); + data.WriteByteSeq(guidBytes[5]); + + receiver->GetSession()->SendPacket(&data); +} + +template<> +void AchievementMgr::SendAchievementInfo(Player* receiver, uint32 achievementId /*= 0*/) const +{ + //will send response to criteria progress request + AchievementCriteriaEntryList const* criteria = sAchievementMgr->GetAchievementCriteriaByAchievement(achievementId); + if (!criteria) + { + // send empty packet + WorldPacket data(SMSG_GUILD_CRITERIA_DATA, 3); + data.WriteBits(0, 21); + receiver->GetSession()->SendPacket(&data); + return; + } + + uint8 criteriaProgress[8]; + uint8 criteriaGuid[8]; + uint32 numCriteria = 0; + ByteBuffer criteriaData(criteria->size() * (8 + 8 + 4 + 4 + 4)); + ByteBuffer criteriaBits(criteria->size() * (8 + 8) / 8); + for (AchievementCriteriaEntryList::const_iterator itr = criteria->begin(); itr != criteria->end(); ++itr) + { + uint32 criteriaId = (*itr)->ID; + CriteriaProgressMap::const_iterator progress = m_criteriaProgress.find(criteriaId); + if (progress == m_criteriaProgress.end()) + continue; + + ++numCriteria; + *reinterpret_cast(&criteriaProgress[0]) = progress->second.counter; + *reinterpret_cast(&criteriaGuid[0]) = progress->second.CompletedGUID; + + criteriaBits.WriteBit(criteriaProgress[4]); + criteriaBits.WriteBit(criteriaProgress[1]); + criteriaBits.WriteBit(criteriaGuid[2]); + criteriaBits.WriteBit(criteriaProgress[3]); + criteriaBits.WriteBit(criteriaGuid[1]); + criteriaBits.WriteBit(criteriaProgress[5]); + criteriaBits.WriteBit(criteriaProgress[0]); + criteriaBits.WriteBit(criteriaGuid[3]); + criteriaBits.WriteBit(criteriaProgress[2]); + criteriaBits.WriteBit(criteriaGuid[7]); + criteriaBits.WriteBit(criteriaGuid[5]); + criteriaBits.WriteBit(criteriaGuid[0]); + criteriaBits.WriteBit(criteriaProgress[6]); + criteriaBits.WriteBit(criteriaGuid[6]); + criteriaBits.WriteBit(criteriaProgress[7]); + criteriaBits.WriteBit(criteriaGuid[4]); + + criteriaData.WriteByteSeq(criteriaGuid[5]); + criteriaData << uint32(progress->second.date); // unknown date + criteriaData.WriteByteSeq(criteriaProgress[3]); + criteriaData.WriteByteSeq(criteriaProgress[7]); + criteriaData << uint32(progress->second.date); // unknown date + criteriaData.WriteByteSeq(criteriaProgress[6]); + criteriaData.WriteByteSeq(criteriaGuid[4]); + criteriaData.WriteByteSeq(criteriaGuid[1]); + criteriaData.WriteByteSeq(criteriaProgress[4]); + criteriaData.WriteByteSeq(criteriaGuid[3]); + criteriaData.WriteByteSeq(criteriaProgress[0]); + criteriaData.WriteByteSeq(criteriaGuid[2]); + criteriaData.WriteByteSeq(criteriaProgress[1]); + criteriaData.WriteByteSeq(criteriaGuid[6]); + criteriaData << uint32(progress->second.date); // last update time (not packed!) + criteriaData << uint32(criteriaId); + criteriaData.WriteByteSeq(criteriaProgress[5]); + criteriaData << uint32(0); + criteriaData.WriteByteSeq(criteriaGuid[7]); + criteriaData.WriteByteSeq(criteriaProgress[2]); + criteriaData.WriteByteSeq(criteriaGuid[0]); + } + + WorldPacket data(SMSG_GUILD_CRITERIA_DATA, 3 + criteriaBits.size() + criteriaData.size()); + data.WriteBits(numCriteria, 21); + if (numCriteria) { - bitBuffer.WriteBits(0, 2); - counterBuffer << uint64(itr->second.counter); - guidBuffer << uint64(GetPlayer()->GetGUID()); - criteriaDateBuffer << uint32(secsToTimeBitFields(itr->second.date)); - criteriaIdBuffer << uint32(itr->first); + data.append(criteriaBits); + data.append(criteriaData); } - bitBuffer.FlushBits(); - *data << uint32(numCriterias); - data->append(bitBuffer); - data->append(counterBuffer); - *data << uint32(achievementCount); - data->append(achievementDateBuffer); - data->append(guidBuffer); - data->append(criteriaDateBuffer); - data->append(zeros); - data->append(achievementIdBuffer); - data->append(criteriaIdBuffer); - data->append(zeros); + receiver->GetSession()->SendPacket(&data); } -bool AchievementMgr::HasAchieved(uint32 achievementId) const +template +bool AchievementMgr::HasAchieved(uint32 achievementId) const { return m_completedAchievements.find(achievementId) != m_completedAchievements.end(); } -bool AchievementMgr::CanUpdateCriteria(AchievementCriteriaEntry const* criteria, AchievementEntry const* achievement, uint64 miscValue1, uint64 miscValue2, Unit* unit) +template +bool AchievementMgr::CanUpdateCriteria(AchievementCriteriaEntry const* criteria, AchievementEntry const* achievement, uint64 miscValue1, uint64 /*miscValue2*/, Unit* unit, Player* referencePlayer) { if (DisableMgr::IsDisabledFor(DISABLE_TYPE_ACHIEVEMENT_CRITERIA, criteria->ID, NULL)) return false; - if (achievement->mapID != -1 && GetPlayer()->GetMapId() != uint32(achievement->mapID)) + if (achievement->mapID != -1 && referencePlayer->GetMapId() != uint32(achievement->mapID)) return false; // don't update already completed criteria if (IsCompletedCriteria(criteria, achievement)) return false; - if ((achievement->requiredFaction == ACHIEVEMENT_FACTION_HORDE && GetPlayer()->GetTeam() != HORDE) || - (achievement->requiredFaction == ACHIEVEMENT_FACTION_ALLIANCE && GetPlayer()->GetTeam() != ALLIANCE)) + if ((achievement->requiredFaction == ACHIEVEMENT_FACTION_HORDE && referencePlayer->GetTeam() != HORDE) || + (achievement->requiredFaction == ACHIEVEMENT_FACTION_ALLIANCE && referencePlayer->GetTeam() != ALLIANCE)) return false; for (uint32 i = 0; i < MAX_CRITERIA_REQUIREMENTS; ++i) @@ -2059,11 +2652,11 @@ bool AchievementMgr::CanUpdateCriteria(AchievementCriteriaEntry const* criteria, switch (criteria->additionalRequirements[i].additionalRequirement_type) { case ACHIEVEMENT_CRITERIA_CONDITION_BG_MAP: - if (GetPlayer()->GetMapId() != criteria->additionalRequirements[i].additionalRequirement_value) + if (referencePlayer->GetMapId() != criteria->additionalRequirements[i].additionalRequirement_value) return false; break; case ACHIEVEMENT_CRITERIA_CONDITION_NOT_IN_GROUP: - if (GetPlayer()->GetGroup()) + if (referencePlayer->GetGroup()) return false; break; default: @@ -2093,26 +2686,26 @@ bool AchievementMgr::CanUpdateCriteria(AchievementCriteriaEntry const* criteria, return false; break; case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_MAP_DIFFICULTY: - if (GetPlayer()->GetDifficulty(GetPlayer()->GetMap()->IsRaid()) != value) + if (uint32(referencePlayer->GetMap()->GetDifficulty()) != value) return false; break; case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_MAP: - if (GetPlayer()->GetMapId() != value) + if (referencePlayer->GetMapId() != value) return false; break; case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_ZONE: - if (GetPlayer()->GetZoneId() != value) + if (referencePlayer->GetZoneId() != value) return false; break; case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_AREA: - if (GetPlayer()->GetAreaId() != value) + if (referencePlayer->GetAreaId() != value) return false; break; case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_MUST_BE_ENEMY: if (!unit) return false; if (const Player* player = unit->ToPlayer()) - if (player->GetTeam() == GetPlayer()->GetTeam()) + if (player->GetTeam() == referencePlayer->GetTeam()) return false; break; case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_CREATURE_ENTRY: @@ -2122,7 +2715,7 @@ bool AchievementMgr::CanUpdateCriteria(AchievementCriteriaEntry const* criteria, return false; break; case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_HAS_AURA: - if (!GetPlayer()->HasAura(value)) + if (!referencePlayer->HasAura(value)) return false; break; case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_HAS_AURA: @@ -2139,11 +2732,11 @@ bool AchievementMgr::CanUpdateCriteria(AchievementCriteriaEntry const* criteria, return false; break; case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_RACE: - if (GetPlayer()->getRace() != value) + if (referencePlayer->getRace() != value) return false; break; case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_CLASS: - if (GetPlayer()->getClass() != value) + if (referencePlayer->getClass() != value) return false; break; case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_RACE: @@ -2159,7 +2752,7 @@ bool AchievementMgr::CanUpdateCriteria(AchievementCriteriaEntry const* criteria, return false; break; case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_MAX_GROUP_MEMBERS: - if (GetPlayer()->GetGroup() && GetPlayer()->GetGroup()->GetMembersCount() >= value) + if (referencePlayer->GetGroup() && referencePlayer->GetGroup()->GetMembersCount() >= value) return false; break; case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_CREATURE_TYPE: @@ -2169,7 +2762,7 @@ bool AchievementMgr::CanUpdateCriteria(AchievementCriteriaEntry const* criteria, return false; break; case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_LEVEL: - if (GetPlayer()->getLevel() != value) + if (referencePlayer->getLevel() != value) return false; break; case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_LEVEL: @@ -2193,6 +2786,9 @@ bool AchievementMgr::CanUpdateCriteria(AchievementCriteriaEntry const* criteria, return true; } +template class AchievementMgr; +template class AchievementMgr; + //========================================================== void AchievementGlobalMgr::LoadAchievementCriteriaList() { @@ -2205,20 +2801,28 @@ void AchievementGlobalMgr::LoadAchievementCriteriaList() return; } + uint32 criterias = 0; + uint32 guildCriterias = 0; for (uint32 entryId = 0; entryId < sAchievementCriteriaStore.GetNumRows(); ++entryId) { AchievementCriteriaEntry const* criteria = sAchievementCriteriaStore.LookupEntry(entryId); if (!criteria) continue; - m_AchievementCriteriasByType[criteria->requiredType].push_back(criteria); + AchievementEntry const* achievement = sAchievementStore.LookupEntry(criteria->referredAchievement); + m_AchievementCriteriaListByAchievement[criteria->referredAchievement].push_back(criteria); + if (achievement && achievement->flags & ACHIEVEMENT_FLAG_GUILD) + ++guildCriterias, m_GuildAchievementCriteriasByType[criteria->requiredType].push_back(criteria); + else + ++criterias, m_AchievementCriteriasByType[criteria->requiredType].push_back(criteria); + if (criteria->timeLimit) m_AchievementCriteriasByTimedType[criteria->timedCriteriaStartType].push_back(criteria); } - sLog->outString(">> Loaded %lu achievement criteria in %u ms", (unsigned long)m_AchievementCriteriasByType->size(), GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(">> Loaded %u achievement criteria and %u guild achievement crieteria in %u ms", criterias, guildCriterias, GetMSTimeDiffToNow(oldMSTime)); sLog->outString(); } diff --git a/src/server/game/Achievements/AchievementMgr.h b/src/server/game/Achievements/AchievementMgr.h index 7e0f715f2d2..636160d4437 100755 --- a/src/server/game/Achievements/AchievementMgr.h +++ b/src/server/game/Achievements/AchievementMgr.h @@ -37,6 +37,7 @@ struct CriteriaProgress { uint32 counter; time_t date; // latest update time. + uint64 CompletedGUID; // GUID of the player that completed this criteria (guild achievements) bool changed; }; @@ -52,6 +53,7 @@ enum AchievementCriteriaDataType ACHIEVEMENT_CRITERIA_DATA_TYPE_T_LEVEL = 9, // minlevel minlevel of target ACHIEVEMENT_CRITERIA_DATA_TYPE_T_GENDER = 10, // gender 0=male; 1=female ACHIEVEMENT_CRITERIA_DATA_TYPE_SCRIPT = 11, // scripted requirement + // REUSE ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_PLAYER_COUNT = 13, // count "with less than %u people in the zone" ACHIEVEMENT_CRITERIA_DATA_TYPE_T_TEAM = 14, // team HORDE(67), ALLIANCE(469) ACHIEVEMENT_CRITERIA_DATA_TYPE_S_DRUNK = 15, // drunken_state 0 (enum DrunkenState) of player @@ -208,6 +210,7 @@ typedef std::map AchievementRewardLocales; struct CompletedAchievementData { time_t date; + std::set guids; bool changed; }; @@ -218,10 +221,11 @@ class Unit; class Player; class WorldPacket; +template class AchievementMgr { public: - AchievementMgr(Player* player); + AchievementMgr(T* owner); ~AchievementMgr(); void Reset(); @@ -229,13 +233,14 @@ class AchievementMgr void LoadFromDB(PreparedQueryResult achievementResult, PreparedQueryResult criteriaResult); void SaveToDB(SQLTransaction& trans); void ResetAchievementCriteria(AchievementCriteriaTypes type, uint32 miscvalue1 = 0, uint32 miscvalue2 = 0, bool evenIfCriteriaComplete = false); - void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1 = 0, uint32 miscValue2 = 0, Unit* unit = NULL); - void CompletedAchievement(AchievementEntry const* entry); + void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1 = 0, uint32 miscValue2 = 0, Unit* unit = NULL, Player* referencePlayer = NULL); + void CompletedAchievement(AchievementEntry const* entry, Player* referencePlayer); void CheckAllAchievementCriteria(); - void SendAllAchievementData() const; - void SendRespondInspectAchievements(Player* player) const; + void SendAllAchievementData(Player* receiver) const; + void SendAchievementInfo(Player* receiver, uint32 achievementId = 0) const; bool HasAchieved(uint32 achievementId) const; - Player* GetPlayer() const { return m_player; } + T* GetOwner() const { return _owner; } + void UpdateTimedAchievements(uint32 timeDiff); void StartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry, uint32 timeLost = 0); void RemoveTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry); // used for quest and scripted timed achievements @@ -245,15 +250,15 @@ class AchievementMgr void SendAchievementEarned(AchievementEntry const* achievement) const; void SendCriteriaUpdate(AchievementCriteriaEntry const* entry, CriteriaProgress const* progress, uint32 timeElapsed, bool timedCompleted) const; CriteriaProgress* GetCriteriaProgress(AchievementCriteriaEntry const* entry); - void SetCriteriaProgress(AchievementCriteriaEntry const* entry, uint32 changeValue, ProgressType ptype = PROGRESS_SET); + void SetCriteriaProgress(AchievementCriteriaEntry const* entry, uint32 changeValue, Player* referencePlayer, ProgressType ptype = PROGRESS_SET); void RemoveCriteriaProgress(AchievementCriteriaEntry const* entry); - void CompletedCriteriaFor(AchievementEntry const* achievement); + void CompletedCriteriaFor(AchievementEntry const* achievement, Player* referencePlayer); bool IsCompletedCriteria(AchievementCriteriaEntry const* achievementCriteria, AchievementEntry const* achievement); bool IsCompletedAchievement(AchievementEntry const* entry); - bool CanUpdateCriteria(AchievementCriteriaEntry const* criteria, AchievementEntry const* achievement, uint64 miscValue1, uint64 miscValue2, Unit* unit); - void BuildAllDataPacket(WorldPacket* data) const; + bool CanUpdateCriteria(AchievementCriteriaEntry const* criteria, AchievementEntry const* achievement, uint64 miscValue1, uint64 miscValue2, Unit* unit, Player* referencePlayer); + void SendPacket(WorldPacket* data) const; - Player* m_player; + T* _owner; CriteriaProgressMap m_criteriaProgress; CompletedAchievementMap m_completedAchievements; typedef std::map TimedAchievementMap; @@ -267,9 +272,9 @@ class AchievementGlobalMgr ~AchievementGlobalMgr() {} public: - AchievementCriteriaEntryList const& GetAchievementCriteriaByType(AchievementCriteriaTypes type) const + AchievementCriteriaEntryList const& GetAchievementCriteriaByType(AchievementCriteriaTypes type, bool guild = false) const { - return m_AchievementCriteriasByType[type]; + return guild ? m_GuildAchievementCriteriasByType[type] : m_AchievementCriteriasByType[type]; } AchievementCriteriaEntryList const& GetTimedAchievementCriteriaByType(AchievementCriteriaTimedTypes type) const @@ -317,6 +322,22 @@ class AchievementGlobalMgr m_allCompletedAchievements.insert(achievement->ID); } + bool IsGroupCriteriaType(AchievementCriteriaTypes type) const + { + switch (type) + { + case ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE: + case ACHIEVEMENT_CRITERIA_TYPE_WIN_BG: + case ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET: // NYI + case ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA: + case ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2: // NYI + case ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_BATTLEGROUND: // NYI + return true; + } + + return false; + } + void LoadAchievementCriteriaList(); void LoadAchievementCriteriaData(); void LoadAchievementReferenceList(); @@ -328,9 +349,13 @@ class AchievementGlobalMgr // store achievement criterias by type to speed up lookup AchievementCriteriaEntryList m_AchievementCriteriasByType[ACHIEVEMENT_CRITERIA_TYPE_TOTAL]; + AchievementCriteriaEntryList m_GuildAchievementCriteriasByType[ACHIEVEMENT_CRITERIA_TYPE_TOTAL]; + AchievementCriteriaEntryList m_AchievementCriteriasByTimedType[ACHIEVEMENT_TIMED_TYPE_MAX]; + // store achievement criterias by achievement to speed up lookup AchievementCriteriaListByAchievement m_AchievementCriteriaListByAchievement; + // store achievements by referenced achievement id to speed up lookup AchievementListByReferencedId m_AchievementListByReferencedId; diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp index a156583a006..cb119884558 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp @@ -154,7 +154,7 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry* auction, SQLTransaction& { bidder->GetSession()->SendAuctionBidderNotification(auction->GetHouseId(), auction->Id, bidder_guid, 0, 0, auction->item_template); // FIXME: for offline player need also - bidder->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WON_AUCTIONS, 1); + bidder->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WON_AUCTIONS, 1); } MailDraft(msgAuctionWonSubject.str(), msgAuctionWonBody.str()) @@ -219,8 +219,8 @@ void AuctionHouseMgr::SendAuctionSuccessfulMail(AuctionEntry* auction, SQLTransa //FIXME: what do if owner offline if (owner) { - owner->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_EARNED_BY_AUCTIONS, profit); - owner->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_SOLD, auction->bid); + owner->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_EARNED_BY_AUCTIONS, profit); + owner->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_SOLD, auction->bid); //send auction owner notification, bidder must be current! owner->GetSession()->SendAuctionOwnerNotification(auction); } diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index ebcf5495a55..3c47b739072 100755 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -34,6 +34,8 @@ #include "SpellAuras.h" #include "SpellAuraEffects.h" #include "Util.h" +#include "Guild.h" +#include "GuildMgr.h" namespace Trinity { @@ -799,6 +801,7 @@ void Battleground::EndBattleground(uint32 winner) } } + bool guildAwarded = false; uint8 aliveWinners = GetAlivePlayersCountByTeam(winner); for (BattlegroundPlayerMap::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr) { @@ -851,7 +854,7 @@ void Battleground::EndBattleground(uint32 winner) { // update achievement BEFORE personal rating update uint32 rating = player->GetArenaPersonalRating(winner_arena_team->GetSlot()); - player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA, rating ? rating : 1); + player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA, rating ? rating : 1); winner_arena_team->MemberWon(player, loser_matchmaker_rating, winner_matchmaker_change); } @@ -883,7 +886,18 @@ void Battleground::EndBattleground(uint32 winner) player->SetRandomWinner(true); } - player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_BG, 1); + player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_BG, 1); + if (!guildAwarded) + { + guildAwarded = true; + if (uint32 guildId = GetBgMap()->GetOwnerGuildId(player->GetTeam())) + if (Guild* guild = sGuildMgr->GetGuildById(guildId)) + { + guild->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_BG, 1, 0, NULL, player); + if (isArena() && isRated() && winner_arena_team && loser_arena_team && winner_arena_team != loser_arena_team) + guild->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA, std::max(winner_arena_team->GetRating(), 1), 0, NULL, player); + } + } } else { @@ -902,7 +916,7 @@ void Battleground::EndBattleground(uint32 winner) BattlegroundQueueTypeId bgQueueTypeId = BattlegroundMgr::BGQueueTypeId(GetTypeID(), GetArenaType()); sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, this, player->GetBattlegroundQueueIndex(bgQueueTypeId), STATUS_IN_PROGRESS, TIME_TO_AUTOREMOVE, GetStartTime(), GetArenaType()); player->GetSession()->SendPacket(&data); - player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_BATTLEGROUND, 1); + player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_BATTLEGROUND, 1); } if (isArena() && isRated() && winner_arena_team && loser_arena_team && winner_arena_team != loser_arena_team) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp index d28f5ddfe6a..86f3d5c54cb 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp @@ -681,11 +681,11 @@ void BattlegroundAB::UpdatePlayerScore(Player* Source, uint32 type, uint32 value { case SCORE_BASES_ASSAULTED: ((BattlegroundABScore*)itr->second)->BasesAssaulted += value; - Source->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, AB_OBJECTIVE_ASSAULT_BASE); + Source->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, AB_OBJECTIVE_ASSAULT_BASE); break; case SCORE_BASES_DEFENDED: ((BattlegroundABScore*)itr->second)->BasesDefended += value; - Source->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, AB_OBJECTIVE_DEFEND_BASE); + Source->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, AB_OBJECTIVE_DEFEND_BASE); break; default: Battleground::UpdatePlayerScore(Source, type, value, doAddHonor); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp index d2cbab2be54..715564d3252 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp @@ -540,19 +540,19 @@ void BattlegroundAV::UpdatePlayerScore(Player* Source, uint32 type, uint32 value { case SCORE_GRAVEYARDS_ASSAULTED: ((BattlegroundAVScore*)itr->second)->GraveyardsAssaulted += value; - Source->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, AV_OBJECTIVE_ASSAULT_GRAVEYARD); + Source->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, AV_OBJECTIVE_ASSAULT_GRAVEYARD); break; case SCORE_GRAVEYARDS_DEFENDED: ((BattlegroundAVScore*)itr->second)->GraveyardsDefended += value; - Source->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, AV_OBJECTIVE_DEFEND_GRAVEYARD); + Source->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, AV_OBJECTIVE_DEFEND_GRAVEYARD); break; case SCORE_TOWERS_ASSAULTED: ((BattlegroundAVScore*)itr->second)->TowersAssaulted += value; - Source->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, AV_OBJECTIVE_ASSAULT_TOWER); + Source->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, AV_OBJECTIVE_ASSAULT_TOWER); break; case SCORE_TOWERS_DEFENDED: ((BattlegroundAVScore*)itr->second)->TowersDefended += value; - Source->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, AV_OBJECTIVE_DEFEND_TOWER); + Source->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, AV_OBJECTIVE_DEFEND_TOWER); break; case SCORE_MINES_CAPTURED: ((BattlegroundAVScore*)itr->second)->MinesCaptured += value; diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp index 8269a04a383..2b02caaf5a2 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp @@ -816,7 +816,7 @@ void BattlegroundEY::UpdatePlayerScore(Player* Source, uint32 type, uint32 value { case SCORE_FLAG_CAPTURES: // flags captured ((BattlegroundEYScore*)itr->second)->FlagCaptures += value; - Source->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, EY_OBJECTIVE_CAPTURE_FLAG); + Source->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, EY_OBJECTIVE_CAPTURE_FLAG); break; default: Battleground::UpdatePlayerScore(Source, type, value, doAddHonor); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp index d100dc645a2..0c583ddde3f 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp @@ -759,11 +759,11 @@ void BattlegroundWS::UpdatePlayerScore(Player* Source, uint32 type, uint32 value { case SCORE_FLAG_CAPTURES: // flags captured ((BattlegroundWGScore*)itr->second)->FlagCaptures += value; - Source->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, WS_OBJECTIVE_CAPTURE_FLAG); + Source->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, WS_OBJECTIVE_CAPTURE_FLAG); break; case SCORE_FLAG_RETURNS: // flags returned ((BattlegroundWGScore*)itr->second)->FlagReturns += value; - Source->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, WS_OBJECTIVE_RETURN_FLAG); + Source->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, WS_OBJECTIVE_RETURN_FLAG); break; default: Battleground::UpdatePlayerScore(Source, type, value, doAddHonor); diff --git a/src/server/game/DataStores/DBCEnums.h b/src/server/game/DataStores/DBCEnums.h index e032335c3bc..cd8accd3759 100755 --- a/src/server/game/DataStores/DBCEnums.h +++ b/src/server/game/DataStores/DBCEnums.h @@ -60,7 +60,7 @@ enum AchievementFlags { ACHIEVEMENT_FLAG_COUNTER = 0x00000001, // Just count statistic (never stop and complete) ACHIEVEMENT_FLAG_HIDDEN = 0x00000002, // Not sent to client - internal use only - ACHIEVEMENT_FLAG_STORE_MAX_VALUE = 0x00000004, // Store only max value? used only in "Reach level xx" + ACHIEVEMENT_FLAG_PLAY_NO_VISUAL = 0x00000004, // Client does not play achievement earned visual ACHIEVEMENT_FLAG_SUMM = 0x00000008, // Use summ criteria value from all reqirements (and calculate max value) ACHIEVEMENT_FLAG_MAX_USED = 0x00000010, // Show max criteria (and calculate max value ??) ACHIEVEMENT_FLAG_REQ_COUNT = 0x00000020, // Use not zero req count (and calculate max value) @@ -70,8 +70,8 @@ enum AchievementFlags ACHIEVEMENT_FLAG_REALM_FIRST_KILL = 0x00000200, // ACHIEVEMENT_FLAG_UNK3 = 0x00000400, // ACHIEVEMENT_FLAG_HIDE_NAME_IN_TIE ACHIEVEMENT_FLAG_REALM_FIRST_GUILD = 0x00000800, // first guild on realm done something - ACHIEVEMENT_FLAG_UNK4 = 0x00001000, // as guild group? - ACHIEVEMENT_FLAG_UNK5 = 0x00002000, // as guild group? + ACHIEVEMENT_FLAG_SHOW_IN_GUILD_NEWS = 0x00001000, // Shows in guild news + ACHIEVEMENT_FLAG_SHOW_IN_GUILD_HEADER = 0x00002000, // Shows in guild news header ACHIEVEMENT_FLAG_GUILD = 0x00004000, // ACHIEVEMENT_FLAG_SHOW_GUILD_MEMBERS = 0x00008000, // ACHIEVEMENT_FLAG_SHOW_CRITERIA_MEMBERS = 0x00010000, // @@ -191,137 +191,143 @@ enum AchievementCriteriaTimedTypes enum AchievementCriteriaTypes { - ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE = 0, - ACHIEVEMENT_CRITERIA_TYPE_WIN_BG = 1, - ACHIEVEMENT_CRITERIA_TYPE_UNK3 = 3, // struct { uint32 itemCount; } - ACHIEVEMENT_CRITERIA_TYPE_REACH_LEVEL = 5, - ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL = 7, - ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT = 8, - ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST_COUNT = 9, + ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE = 0, + ACHIEVEMENT_CRITERIA_TYPE_WIN_BG = 1, + ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ARCHAEOLOGY_PROJECTS = 3, // struct { uint32 itemCount; } + ACHIEVEMENT_CRITERIA_TYPE_REACH_LEVEL = 5, + ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL = 7, + ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT = 8, + ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST_COUNT = 9, // you have to complete a daily quest x times in a row - ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST_DAILY = 10, - ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUESTS_IN_ZONE = 11, - ACHIEVEMENT_CRITERIA_TYPE_CURRENCY = 12, - ACHIEVEMENT_CRITERIA_TYPE_DAMAGE_DONE = 13, - ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST = 14, - ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_BATTLEGROUND= 15, - ACHIEVEMENT_CRITERIA_TYPE_DEATH_AT_MAP= 16, - ACHIEVEMENT_CRITERIA_TYPE_DEATH= 17, - ACHIEVEMENT_CRITERIA_TYPE_DEATH_IN_DUNGEON = 18, - ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_RAID = 19, - ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_CREATURE = 20, - ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_PLAYER = 23, - ACHIEVEMENT_CRITERIA_TYPE_FALL_WITHOUT_DYING = 24, - ACHIEVEMENT_CRITERIA_TYPE_DEATHS_FROM = 26, - ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST = 27, - ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET = 28, - ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL= 29, - ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE = 30, - ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL_AT_AREA = 31, - ACHIEVEMENT_CRITERIA_TYPE_WIN_ARENA = 32, - ACHIEVEMENT_CRITERIA_TYPE_PLAY_ARENA = 33, - ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL = 34, - ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL = 35, - ACHIEVEMENT_CRITERIA_TYPE_OWN_ITEM = 36, - ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA = 37, - ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_TEAM_RATING = 38, - ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_PERSONAL_RATING = 39, - ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LEVEL = 40, - ACHIEVEMENT_CRITERIA_TYPE_USE_ITEM = 41, - ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM= 42, - ACHIEVEMENT_CRITERIA_TYPE_EXPLORE_AREA = 43, - ACHIEVEMENT_CRITERIA_TYPE_OWN_RANK= 44, - ACHIEVEMENT_CRITERIA_TYPE_BUY_BANK_SLOT= 45, - ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION= 46, - ACHIEVEMENT_CRITERIA_TYPE_GAIN_EXALTED_REPUTATION= 47, + ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST_DAILY = 10, + ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUESTS_IN_ZONE = 11, + ACHIEVEMENT_CRITERIA_TYPE_CURRENCY = 12, + ACHIEVEMENT_CRITERIA_TYPE_DAMAGE_DONE = 13, + ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST = 14, + ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_BATTLEGROUND = 15, + ACHIEVEMENT_CRITERIA_TYPE_DEATH_AT_MAP = 16, + ACHIEVEMENT_CRITERIA_TYPE_DEATH = 17, + ACHIEVEMENT_CRITERIA_TYPE_DEATH_IN_DUNGEON = 18, + ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_RAID = 19, + ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_CREATURE = 20, + ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_PLAYER = 23, + ACHIEVEMENT_CRITERIA_TYPE_FALL_WITHOUT_DYING = 24, + ACHIEVEMENT_CRITERIA_TYPE_DEATHS_FROM = 26, + ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST = 27, + ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET = 28, + ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL = 29, + ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE = 30, + ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL_AT_AREA = 31, + ACHIEVEMENT_CRITERIA_TYPE_WIN_ARENA = 32, + ACHIEVEMENT_CRITERIA_TYPE_PLAY_ARENA = 33, + ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL = 34, + ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL = 35, + ACHIEVEMENT_CRITERIA_TYPE_OWN_ITEM = 36, + ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA = 37, + ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_TEAM_RATING = 38, + ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_PERSONAL_RATING = 39, + ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LEVEL = 40, + ACHIEVEMENT_CRITERIA_TYPE_USE_ITEM = 41, + ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM = 42, + ACHIEVEMENT_CRITERIA_TYPE_EXPLORE_AREA = 43, + ACHIEVEMENT_CRITERIA_TYPE_OWN_RANK = 44, + ACHIEVEMENT_CRITERIA_TYPE_BUY_BANK_SLOT = 45, + ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION = 46, + ACHIEVEMENT_CRITERIA_TYPE_GAIN_EXALTED_REPUTATION = 47, // noted: rewarded as soon as the player payed, not at taking place at the seat - ACHIEVEMENT_CRITERIA_TYPE_VISIT_BARBER_SHOP= 48, - ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM = 49, + ACHIEVEMENT_CRITERIA_TYPE_VISIT_BARBER_SHOP = 48, + ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM = 49, // TODO: itemlevel is mentioned in text but not present in dbc - ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED_ON_LOOT = 50, - ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED_ON_LOOT= 51, - ACHIEVEMENT_CRITERIA_TYPE_HK_CLASS = 52, - ACHIEVEMENT_CRITERIA_TYPE_HK_RACE = 53, - ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE = 54, - ACHIEVEMENT_CRITERIA_TYPE_HEALING_DONE = 55, + ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED_ON_LOOT = 50, + ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED_ON_LOOT = 51, + ACHIEVEMENT_CRITERIA_TYPE_HK_CLASS = 52, + ACHIEVEMENT_CRITERIA_TYPE_HK_RACE = 53, + ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE = 54, + ACHIEVEMENT_CRITERIA_TYPE_HEALING_DONE = 55, // TODO: in some cases map not present, and in some cases need do without die - ACHIEVEMENT_CRITERIA_TYPE_GET_KILLING_BLOWS = 56, - ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM = 57, - ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_VENDORS = 59, - ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TALENTS = 60, - ACHIEVEMENT_CRITERIA_TYPE_NUMBER_OF_TALENT_RESETS = 61, - ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_QUEST_REWARD = 62, - ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TRAVELLING = 63, - ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_AT_BARBER = 65, - ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_MAIL = 66, - ACHIEVEMENT_CRITERIA_TYPE_LOOT_MONEY = 67, - ACHIEVEMENT_CRITERIA_TYPE_USE_GAMEOBJECT = 68, - ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2= 69, - ACHIEVEMENT_CRITERIA_TYPE_SPECIAL_PVP_KILL= 70, - ACHIEVEMENT_CRITERIA_TYPE_FISH_IN_GAMEOBJECT = 72, + ACHIEVEMENT_CRITERIA_TYPE_GET_KILLING_BLOWS = 56, + ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM = 57, + ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_VENDORS = 59, + ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TALENTS = 60, + ACHIEVEMENT_CRITERIA_TYPE_NUMBER_OF_TALENT_RESETS = 61, + ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_QUEST_REWARD = 62, + ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TRAVELLING = 63, + ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_AT_BARBER = 65, + ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_MAIL = 66, + ACHIEVEMENT_CRITERIA_TYPE_LOOT_MONEY = 67, + ACHIEVEMENT_CRITERIA_TYPE_USE_GAMEOBJECT = 68, + ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2 = 69, + ACHIEVEMENT_CRITERIA_TYPE_SPECIAL_PVP_KILL = 70, + ACHIEVEMENT_CRITERIA_TYPE_FISH_IN_GAMEOBJECT = 72, // TODO: title id is not mentioned in dbc - ACHIEVEMENT_CRITERIA_TYPE_EARNED_PVP_TITLE = 74, - ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS= 75, - ACHIEVEMENT_CRITERIA_TYPE_WIN_DUEL = 76, - ACHIEVEMENT_CRITERIA_TYPE_LOSE_DUEL = 77, + ACHIEVEMENT_CRITERIA_TYPE_EARNED_PVP_TITLE = 74, + ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS = 75, + ACHIEVEMENT_CRITERIA_TYPE_WIN_DUEL = 76, + ACHIEVEMENT_CRITERIA_TYPE_LOSE_DUEL = 77, // TODO: creature type (demon, undead etc.) is not stored in dbc - ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE_TYPE = 78, - ACHIEVEMENT_CRITERIA_TYPE_GOLD_EARNED_BY_AUCTIONS= 80, - ACHIEVEMENT_CRITERIA_TYPE_CREATE_AUCTION= 82, - ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_BID= 83, - ACHIEVEMENT_CRITERIA_TYPE_WON_AUCTIONS= 84, - ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_SOLD = 85, - ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_GOLD_VALUE_OWNED = 86, - ACHIEVEMENT_CRITERIA_TYPE_GAIN_REVERED_REPUTATION = 87, - ACHIEVEMENT_CRITERIA_TYPE_GAIN_HONORED_REPUTATION = 88, - ACHIEVEMENT_CRITERIA_TYPE_KNOWN_FACTIONS = 89, - ACHIEVEMENT_CRITERIA_TYPE_LOOT_EPIC_ITEM = 90, - ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM = 91, - ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED = 93, - ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED = 94, - ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HIT_DEALT = 101, - ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HIT_RECEIVED = 102, - ACHIEVEMENT_CRITERIA_TYPE_TOTAL_DAMAGE_RECEIVED = 103, - ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEAL_CASTED = 104, - ACHIEVEMENT_CRITERIA_TYPE_TOTAL_HEALING_RECEIVED = 105, - ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEALING_RECEIVED = 106, - ACHIEVEMENT_CRITERIA_TYPE_QUEST_ABANDONED = 107, - ACHIEVEMENT_CRITERIA_TYPE_FLIGHT_PATHS_TAKEN = 108, - ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE = 109, + ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE_TYPE = 78, + ACHIEVEMENT_CRITERIA_TYPE_GOLD_EARNED_BY_AUCTIONS = 80, + ACHIEVEMENT_CRITERIA_TYPE_CREATE_AUCTION = 82, + ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_BID = 83, + ACHIEVEMENT_CRITERIA_TYPE_WON_AUCTIONS = 84, + ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_SOLD = 85, + ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_GOLD_VALUE_OWNED = 86, + ACHIEVEMENT_CRITERIA_TYPE_GAIN_REVERED_REPUTATION = 87, + ACHIEVEMENT_CRITERIA_TYPE_GAIN_HONORED_REPUTATION = 88, + ACHIEVEMENT_CRITERIA_TYPE_KNOWN_FACTIONS = 89, + ACHIEVEMENT_CRITERIA_TYPE_LOOT_EPIC_ITEM = 90, + ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM = 91, + ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED = 93, + ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED = 94, + ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HIT_DEALT = 101, + ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HIT_RECEIVED = 102, + ACHIEVEMENT_CRITERIA_TYPE_TOTAL_DAMAGE_RECEIVED = 103, + ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEAL_CASTED = 104, + ACHIEVEMENT_CRITERIA_TYPE_TOTAL_HEALING_RECEIVED = 105, + ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEALING_RECEIVED = 106, + ACHIEVEMENT_CRITERIA_TYPE_QUEST_ABANDONED = 107, + ACHIEVEMENT_CRITERIA_TYPE_FLIGHT_PATHS_TAKEN = 108, + ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE = 109, // TODO: target entry is missing - ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL2 = 110, - ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LINE= 112, - ACHIEVEMENT_CRITERIA_TYPE_EARN_HONORABLE_KILL = 113, - ACHIEVEMENT_CRITERIA_TYPE_ACCEPTED_SUMMONINGS = 114, - ACHIEVEMENT_CRITERIA_TYPE_EARN_ACHIEVEMENT_POINTS = 115, - ACHIEVEMENT_CRITERIA_TYPE_UNK118 = 118, + ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL2 = 110, + ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LINE = 112, + ACHIEVEMENT_CRITERIA_TYPE_EARN_HONORABLE_KILL = 113, + ACHIEVEMENT_CRITERIA_TYPE_ACCEPTED_SUMMONINGS = 114, + ACHIEVEMENT_CRITERIA_TYPE_EARN_ACHIEVEMENT_POINTS = 115, + ACHIEVEMENT_CRITERIA_TYPE_UNK118 = 118, ACHIEVEMENT_CRITERIA_TYPE_USE_LFD_TO_GROUP_WITH_PLAYERS = 119, - ACHIEVEMENT_CRITERIA_TYPE_UNK120 = 120, - ACHIEVEMENT_CRITERIA_TYPE_UNK121 = 121, - ACHIEVEMENT_CRITERIA_TYPE_UNK122 = 122, - ACHIEVEMENT_CRITERIA_TYPE_UNK123 = 123, - ACHIEVEMENT_CRITERIA_TYPE_SPENT_GOLD_GUILD_REPAIRS = 124, - ACHIEVEMENT_CRITERIA_TYPE_REACH_GUILD_LEVEL = 125, - ACHIEVEMENT_CRITERIA_TYPE_CRAFT_ITEMS_GUILD = 126, - ACHIEVEMENT_CRITERIA_TYPE_CATCH_FROM_POOL = 127, - ACHIEVEMENT_CRITERIA_TYPE_BUY_GUILD_BANK_SLOTS = 128, + ACHIEVEMENT_CRITERIA_TYPE_UNK120 = 120, + ACHIEVEMENT_CRITERIA_TYPE_UNK121 = 121, + ACHIEVEMENT_CRITERIA_TYPE_UNK122 = 122, + ACHIEVEMENT_CRITERIA_TYPE_UNK123 = 123, + ACHIEVEMENT_CRITERIA_TYPE_SPENT_GOLD_GUILD_REPAIRS = 124, + ACHIEVEMENT_CRITERIA_TYPE_REACH_GUILD_LEVEL = 125, + ACHIEVEMENT_CRITERIA_TYPE_CRAFT_ITEMS_GUILD = 126, + ACHIEVEMENT_CRITERIA_TYPE_CATCH_FROM_POOL = 127, + ACHIEVEMENT_CRITERIA_TYPE_BUY_GUILD_BANK_SLOTS = 128, ACHIEVEMENT_CRITERIA_TYPE_EARN_GUILD_ACHIEVEMENT_POINTS = 129, - ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_BATTLEGROUND = 130, - ACHIEVEMENT_CRITERIA_TYPE_REACH_BG_RATING = 132, - ACHIEVEMENT_CRITERIA_TYPE_BUY_GUILD_TABARD = 133, - ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUESTS_GUILD = 134, - ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILLS_GUILD = 135, - ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE_TYPE_GUILD = 136, - ACHIEVEMENT_CRITERIA_TYPE_UNK137 = 137, - ACHIEVEMENT_CRITERIA_TYPE_UNK138 = 138, //struct { Flag flag; uint32 count; } 1: Guild Dungeon, 2:Guild Challenge, 3:Guild battlefield - ACHIEVEMENT_CRITERIA_TYPE_UNK139 = 139, //struct { uint32 count; } Guild Challenge - ACHIEVEMENT_CRITERIA_TYPE_UNK140 = 140, - ACHIEVEMENT_CRITERIA_TYPE_UNK141 = 141, - ACHIEVEMENT_CRITERIA_TYPE_UNK142 = 142, - ACHIEVEMENT_CRITERIA_TYPE_UNK143 = 143, - ACHIEVEMENT_CRITERIA_TYPE_UNK144 = 144, + ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_BATTLEGROUND = 130, + ACHIEVEMENT_CRITERIA_TYPE_REACH_BG_RATING = 132, + ACHIEVEMENT_CRITERIA_TYPE_BUY_GUILD_TABARD = 133, + ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUESTS_GUILD = 134, + ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILLS_GUILD = 135, + ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE_TYPE_GUILD = 136, + ACHIEVEMENT_CRITERIA_TYPE_UNK137 = 137, + ACHIEVEMENT_CRITERIA_TYPE_UNK138 = 138, //struct { Flag flag; uint32 count; } 1: Guild Dungeon, 2:Guild Challenge, 3:Guild battlefield + ACHIEVEMENT_CRITERIA_TYPE_UNK139 = 139, //struct { uint32 count; } Guild Challenge + ACHIEVEMENT_CRITERIA_TYPE_UNK140 = 140, + ACHIEVEMENT_CRITERIA_TYPE_UNK141 = 141, + ACHIEVEMENT_CRITERIA_TYPE_UNK142 = 142, + ACHIEVEMENT_CRITERIA_TYPE_UNK143 = 143, + ACHIEVEMENT_CRITERIA_TYPE_UNK144 = 144, + ACHIEVEMENT_CRITERIA_TYPE_UNK145 = 145, + ACHIEVEMENT_CRITERIA_TYPE_UNK146 = 146, + ACHIEVEMENT_CRITERIA_TYPE_UNK147 = 147, + ACHIEVEMENT_CRITERIA_TYPE_UNK148 = 148, + ACHIEVEMENT_CRITERIA_TYPE_UNK149 = 149, + ACHIEVEMENT_CRITERIA_TYPE_UNK150 = 150, // 0..144 => 145 criteria types total - ACHIEVEMENT_CRITERIA_TYPE_TOTAL = 145, + ACHIEVEMENT_CRITERIA_TYPE_TOTAL = 151, }; enum AchievementCategory diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index 91f9104b0b1..b3e5f2a3eab 100755 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -1901,7 +1901,7 @@ void LFGMgr::RewardDungeonDoneFor(const uint32 dungeonId, Player* player) // Update achievements if (dungeon->difficulty == DUNGEON_DIFFICULTY_HEROIC) - player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_USE_LFD_TO_GROUP_WITH_PLAYERS, 1); + player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_USE_LFD_TO_GROUP_WITH_PLAYERS, 1); LfgReward const* reward = GetRandomDungeonReward(rDungeonId, player->getLevel()); if (!reward) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index ba7ca524521..f66f3b95128 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -432,6 +432,7 @@ void TradeData::SetAccepted(bool state, bool crosssend /*= false*/) // 4.3. Give reputation (player must not be on BG). // 4.4. Give kill credit (player must not be in group, or he must be alive or without corpse). // 5. Credit instance encounter. +// 6. Update guild achievements. KillRewarder::KillRewarder(Player* killer, Unit* victim, bool isBattleGround) : // 1. Initialize internal variables to default values. _killer(killer), _victim(victim), _group(killer->GetGroup()), @@ -623,10 +624,18 @@ void KillRewarder::Reward() } // 5. Credit instance encounter. + // 6. Update guild achievements. if (Creature* victim = _victim->ToCreature()) + { if (victim->IsDungeonBoss()) if (InstanceScript* instance = _victim->GetInstanceScript()) instance->UpdateEncounterState(ENCOUNTER_CREDIT_KILL_CREATURE, _victim->GetEntry(), _victim); + + if (uint32 guildId = victim->GetMap()->GetOwnerGuildId()) + if (Guild* guild = sGuildMgr->GetGuildById(guildId)) + guild->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE, victim->GetEntry(), 1, victim, _killer); + } + } // == Player ==================================================== @@ -1277,7 +1286,7 @@ uint32 Player::EnvironmentalDamage(EnviromentalDamage type, uint32 damage) GetSession()->SendPacket(&data2); } - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DEATHS_FROM, 1, type); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DEATHS_FROM, 1, type); } return final_damage; @@ -1816,9 +1825,9 @@ void Player::setDeathState(DeathState s) // passive spell if (!ressSpellId) ressSpellId = GetResurrectionSpellId(); - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DEATH_AT_MAP, 1); - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DEATH, 1); - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DEATH_IN_DUNGEON, 1); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DEATH_AT_MAP, 1); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DEATH, 1); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DEATH_IN_DUNGEON, 1); GetAchievementMgr().ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, ACHIEVEMENT_CRITERIA_CONDITION_NO_DEATH); GetAchievementMgr().ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL, ACHIEVEMENT_CRITERIA_CONDITION_NO_DEATH); GetAchievementMgr().ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GET_KILLING_BLOWS, ACHIEVEMENT_CRITERIA_CONDITION_NO_DEATH); @@ -3158,7 +3167,7 @@ void Player::GiveLevel(uint8 level) CharacterDatabase.CommitTransaction(trans); } - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_LEVEL); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_LEVEL); // Refer-A-Friend if (GetSession()->GetRecruiterId()) @@ -3939,11 +3948,11 @@ bool Player::addSpell(uint32 spellId, bool active, bool learning, bool dependent // not ranked skills for (SkillLineAbilityMap::const_iterator _spell_idx = skill_bounds.first; _spell_idx != skill_bounds.second; ++_spell_idx) { - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LINE, _spell_idx->second->skillId); - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS, _spell_idx->second->skillId); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LINE, _spell_idx->second->skillId); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS, _spell_idx->second->skillId); } - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL, spellId); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL, spellId); } // return true (for send learn packet) only if spell active (in case ranked spells) and not replace old spell @@ -4511,8 +4520,8 @@ bool Player::ResetTalents(bool no_cost) if (!no_cost) { ModifyMoney(-(int32)cost); - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TALENTS, cost); - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_NUMBER_OF_TALENT_RESETS, 1); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TALENTS, cost); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_NUMBER_OF_TALENT_RESETS, 1); SetTalentResetCost(cost); SetTalentResetTime(time(NULL)); @@ -6219,7 +6228,7 @@ bool Player::UpdateSkill(uint32 skill_id, uint32 step) if (itr->second.uState != SKILL_NEW) itr->second.uState = SKILL_CHANGED; UpdateSkillEnchantments(skill_id, value, new_value); - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL, skill_id); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL, skill_id); return true; } @@ -6362,7 +6371,7 @@ bool Player::UpdateSkillPro(uint16 SkillId, int32 Chance, uint32 step) } } UpdateSkillEnchantments(SkillId, SkillValue, new_value); - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL, SkillId); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL, SkillId); sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "Player::UpdateSkillPro Chance=%3.1f%% taken", Chance / 10.0f); return true; } @@ -6552,8 +6561,8 @@ void Player::SetSkill(uint16 id, uint16 step, uint16 newVal, uint16 maxVal) // if skill value is going up, update enchantments after setting the new value if (newVal > currVal) UpdateSkillEnchantments(id, currVal, newVal); - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL, id); - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LEVEL, id); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL, id); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LEVEL, id); } else //remove { @@ -6593,8 +6602,8 @@ void Player::SetSkill(uint16 id, uint16 step, uint16 newVal, uint16 maxVal) SetUInt32Value(PLAYER_SKILL_INDEX(i), MAKE_PAIR32(id, step)); SetUInt32Value(PLAYER_SKILL_VALUE_INDEX(i), MAKE_SKILL_VALUE(newVal, maxVal)); UpdateSkillEnchantments(id, currVal, newVal); - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL, id); - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LEVEL, id); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL, id); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LEVEL, id); // insert new entry or update if not deleted old entry yet if (itr != mSkillStatus.end()) @@ -6964,7 +6973,7 @@ void Player::CheckAreaExploreAndOutdoor() { SetUInt32Value(PLAYER_EXPLORED_ZONES_1 + offset, (uint32)(currFields | val)); - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EXPLORE_AREA); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EXPLORE_AREA); AreaTableEntry const* areaEntry = GetAreaEntryByAreaFlagAndMap(areaFlag, GetMapId()); if (!areaEntry) @@ -7494,7 +7503,7 @@ void Player::ModifyCurrency(uint32 id, int32 count) if (IsInWorld() && !GetSession()->PlayerLoading()) { if (count > 0) - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CURRENCY, id, count); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CURRENCY, id, count); WorldPacket packet(SMSG_UPDATE_CURRENCY, 12); packet << uint32(id); @@ -7870,10 +7879,10 @@ void Player::DuelComplete(DuelCompleteType type) } break; case DUEL_WON: - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOSE_DUEL, 1); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOSE_DUEL, 1); if (duel->opponent) { - duel->opponent->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_DUEL, 1); + duel->opponent->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_DUEL, 1); //Credit for quest Death's Challenge if (getClass() == CLASS_DEATH_KNIGHT && duel->opponent->GetQuestStatus(12733) == QUEST_STATUS_INCOMPLETE) @@ -12163,8 +12172,8 @@ Item* Player::StoreNewItem(ItemPosCountVec const& dest, uint32 item, bool update if (pItem) { ItemAddedQuestCheck(item, count); - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, item, count); - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_OWN_ITEM, item, 1); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, item, count); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_OWN_ITEM, item, 1); if (randomPropertyId) pItem->SetItemRandomProperties(randomPropertyId); pItem = StoreItem(dest, pItem, update); @@ -12334,7 +12343,7 @@ Item* Player::EquipNewItem(uint16 pos, uint32 item, bool update) if (Item* pItem = Item::CreateItem(item, 1, this)) { ItemAddedQuestCheck(item, 1); - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, item, 1); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, item, 1); return EquipItem(pos, pItem, update); } @@ -12444,8 +12453,8 @@ Item* Player::EquipItem(uint16 pos, Item* pItem, bool update) } // only for full equip instead adding to stack - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM, pItem->GetEntry()); - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM, pItem->GetEntry(), slot); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM, pItem->GetEntry()); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM, pItem->GetEntry(), slot); return pItem; } @@ -12466,8 +12475,8 @@ void Player::QuickEquipItem(uint16 pos, Item* pItem) pItem->SendUpdateToPlayer(this); } - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM, pItem->GetEntry()); - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM, pItem->GetEntry(), slot); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM, pItem->GetEntry()); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM, pItem->GetEntry(), slot); } } @@ -12613,7 +12622,7 @@ void Player::MoveItemToInventory(ItemPosCountVec const& dest, Item* pItem, bool { // update quest counters ItemAddedQuestCheck(pItem->GetEntry(), pItem->GetCount()); - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, pItem->GetEntry(), pItem->GetCount()); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, pItem->GetEntry(), pItem->GetCount()); // store item Item* pLastItem = StoreItem(dest, pItem, update); @@ -15210,7 +15219,7 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver, ModifyMoney(moneyRew); if (moneyRew > 0) - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_QUEST_REWARD, uint32(moneyRew)); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_QUEST_REWARD, uint32(moneyRew)); } // honor reward @@ -15244,8 +15253,8 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver, SetDailyQuestStatus(quest_id); if (quest->IsDaily()) { - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST, quest_id); - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST_DAILY, quest_id); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST, quest_id); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST_DAILY, quest_id); } } else if (quest->IsWeekly()) @@ -15273,9 +15282,9 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver, CastSpell(this, quest->GetRewSpell(), true); if (quest->GetZoneOrSort() > 0) - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUESTS_IN_ZONE, quest->GetZoneOrSort()); - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST_COUNT); - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST, quest->GetQuestId()); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUESTS_IN_ZONE, quest->GetZoneOrSort()); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST_COUNT); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST, quest->GetQuestId()); uint32 zone = 0; uint32 area = 0; @@ -16055,7 +16064,7 @@ void Player::KilledMonsterCredit(uint32 entry, uint64 guid) } GetAchievementMgr().StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_CREATURE, real_entry); // MUST BE CALLED FIRST - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE, real_entry, addkillcount, guid ? GetMap()->GetCreature(guid) : NULL); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE, real_entry, addkillcount, guid ? GetMap()->GetCreature(guid) : NULL); for (uint8 i = 0; i < MAX_QUEST_LOG_SIZE; ++i) { @@ -20883,8 +20892,8 @@ bool Player::ActivateTaxiPathTo(std::vector const& nodes, Creature* npc //Checks and preparations done, DO FLIGHT ModifyMoney(-(int32)totalcost); - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TRAVELLING, totalcost); - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_FLIGHT_PATHS_TAKEN, 1); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TRAVELLING, totalcost); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_FLIGHT_PATHS_TAKEN, 1); // prevent stealth flight //RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TALK); @@ -22218,7 +22227,7 @@ void Player::SendInitialPacketsBeforeAddToMap() SendInitialActionButtons(); m_reputationMgr.SendInitialReputations(); - m_achievementMgr.SendAllAchievementData(); + m_achievementMgr.SendAllAchievementData(this); SendEquipmentSetList(); @@ -22852,7 +22861,7 @@ void Player::SummonIfPossible(bool agree) m_summon_expire = 0; - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ACCEPTED_SUMMONINGS, 1); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ACCEPTED_SUMMONINGS, 1); TeleportTo(m_summon_mapid, m_summon_x, m_summon_y, m_summon_z, GetOrientation()); } @@ -24021,9 +24030,9 @@ void Player::StoreLootItem(uint8 lootSlot, Loot* loot) --loot->unlootedCount; SendNewItem(newitem, uint32(item->count), false, false, true); - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM, item->itemid, item->count); - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE, loot->loot_type, item->count); - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_EPIC_ITEM, item->itemid, item->count); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM, item->itemid, item->count); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE, loot->loot_type, item->count); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_EPIC_ITEM, item->itemid, item->count); } else SendEquipError(msg, NULL, NULL, item->itemid); @@ -24303,7 +24312,7 @@ void Player::HandleFall(MovementInfo const& movementInfo) // recheck alive, might have died of EnvironmentalDamage, avoid cases when player die in fact like Spirit of Redemption case if (isAlive() && final_damage < original_health) - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_FALL_WITHOUT_DYING, uint32(z_diff*100)); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_FALL_WITHOUT_DYING, uint32(z_diff*100)); } //Z given by moveinfo, LastZ, FallTime, WaterZ, MapZ, Damage, Safefall reduction @@ -24315,12 +24324,20 @@ void Player::HandleFall(MovementInfo const& movementInfo) void Player::UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1 /*= 0*/, uint32 miscValue2 /*= 0*/, Unit* unit /*= NULL*/) { - GetAchievementMgr().UpdateAchievementCriteria(type, miscValue1, miscValue2, unit); + GetAchievementMgr().UpdateAchievementCriteria(type, miscValue1, miscValue2, unit, this); + + // Update only individual achievement criteria here, otherwise we may get multiple updates + // from a single boss kill + if (sAchievementMgr->IsGroupCriteriaType(type)) + return; + + if (Guild* guild = sGuildMgr->GetGuildById(m_guildId)) + guild->GetAchievementMgr().UpdateAchievementCriteria(type, miscValue1, miscValue2, unit, this); } void Player::CompletedAchievement(AchievementEntry const* entry) { - GetAchievementMgr().CompletedAchievement(entry); + GetAchievementMgr().CompletedAchievement(entry, this); } bool Player::LearnTalent(uint32 talentId, uint32 talentRank) diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index dbe9cd94a21..e273ba81077 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1887,7 +1887,7 @@ class Player : public Unit, public GridObject CharacterDatabase.Execute(stmt); m_guildId = GuildId; } - uint32 GetGuildId() { return m_guildId; } + uint32 GetGuildId() const { return m_guildId; } static uint32 GetGuildIdFromDB(uint64 guid); void SetRank(uint8 rankId) { SetUInt32Value(PLAYER_GUILDRANK, rankId); } @@ -2532,8 +2532,8 @@ class Player : public Unit, public GridObject void AddRunePower(uint8 index); void InitRunes(); - AchievementMgr& GetAchievementMgr() { return m_achievementMgr; } - AchievementMgr const& GetAchievementMgr() const { return m_achievementMgr; } + AchievementMgr& GetAchievementMgr() { return m_achievementMgr; } + AchievementMgr const& GetAchievementMgr() const { return m_achievementMgr; } void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1 = 0, uint32 miscValue2 = 0, Unit* unit = NULL); void CompletedAchievement(AchievementEntry const* entry); @@ -2914,7 +2914,7 @@ class Player : public Unit, public GridObject uint32 m_temporaryUnsummonedPetNumber; uint32 m_oldpetspell; - AchievementMgr m_achievementMgr; + AchievementMgr m_achievementMgr; ReputationMgr m_reputationMgr; SpellCooldowns m_spellCooldowns; diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 5fe8f0bf657..599c79dedbd 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -693,7 +693,7 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam // call before auras are removed if (Player* killer = GetCharmerOrOwnerPlayerOrPlayerItself()) - killer->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_SPECIAL_PVP_KILL, 1, 0, victim); + killer->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_SPECIAL_PVP_KILL, 1, 0, victim); } Kill(victim, durabilityLoss); @@ -10019,15 +10019,15 @@ int32 Unit::DealHeal(Unit* victim, uint32 addhealth) // use the actual gain, as the overheal shall not be counted, skip gain 0 (it ignored anyway in to criteria) if (gain) - player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HEALING_DONE, gain, 0, victim); + player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HEALING_DONE, gain, 0, victim); - player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEAL_CASTED, addhealth); + player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEAL_CASTED, addhealth); } if (Player* player = victim->ToPlayer()) { - player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_TOTAL_HEALING_RECEIVED, gain); - player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEALING_RECEIVED, addhealth); + player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_TOTAL_HEALING_RECEIVED, gain); + player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEALING_RECEIVED, addhealth); } return gain; @@ -15971,7 +15971,7 @@ void Unit::Kill(Unit* victim, bool durabilityLoss) // update get killing blow achievements, must be done before setDeathState to be able to require auras on target // and before Spirit of Redemption as it also removes auras if (player) - player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GET_KILLING_BLOWS, 1, 0, victim); + player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GET_KILLING_BLOWS, 1, 0, victim); // if talent known but not triggered (check priest class for speedup check) bool spiritOfRedemption = false; @@ -16122,9 +16122,9 @@ void Unit::Kill(Unit* victim, bool durabilityLoss) if (victim->GetTypeId() == TYPEID_PLAYER) { if (GetTypeId() == TYPEID_UNIT) - victim->ToPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_CREATURE, GetEntry()); + victim->ToPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_CREATURE, GetEntry()); else if (GetTypeId() == TYPEID_PLAYER && victim != this) - victim->ToPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_PLAYER, 1, ToPlayer()->GetTeam()); + victim->ToPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_PLAYER, 1, ToPlayer()->GetTeam()); } // Hook for OnPVPKill Event diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index 743d56886f0..da363fbbb15 100755 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -1194,7 +1194,7 @@ void Group::CountTheRoll(Rolls::iterator rollI) if (player && player->GetSession()) { - player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED_ON_LOOT, roll->itemid, maxresul); + player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED_ON_LOOT, roll->itemid, maxresul); ItemPosCountVec dest; LootItem* item = &(roll->getLoot()->items[roll->itemSlot]); @@ -1244,7 +1244,7 @@ void Group::CountTheRoll(Rolls::iterator rollI) if (player && player->GetSession()) { - player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED_ON_LOOT, roll->itemid, maxresul); + player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED_ON_LOOT, roll->itemid, maxresul); LootItem* item = &(roll->getLoot()->items[roll->itemSlot]); diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index b57e9970dab..94a9aff18bc 100755 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -1070,7 +1070,7 @@ InventoryResult Guild::BankMoveItemData::CanStore(Item* pItem, bool swap) /////////////////////////////////////////////////////////////////////////////// // Guild -Guild::Guild() : m_id(0), m_leaderGuid(0), m_createdDate(0), m_accountsNumber(0), m_bankMoney(0), m_eventLog(NULL) +Guild::Guild() : m_id(0), m_leaderGuid(0), m_createdDate(0), m_accountsNumber(0), m_bankMoney(0), m_eventLog(NULL), m_achievementMgr(this) { memset(&m_bankEventLog, 0, (GUILD_BANK_MAX_TABS + 1) * sizeof(LogHolder*)); } @@ -1227,7 +1227,7 @@ void Guild::HandleQuery(WorldSession* session) { WorldPacket data(SMSG_GUILD_QUERY_RESPONSE, 8 * 32 + 200); // Guess size - data << uint64(GetGuid()); + data << uint64(GetGUID()); data << m_name; // Rank name diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h index f5d71d50023..59552da2c41 100755 --- a/src/server/game/Guilds/Guild.h +++ b/src/server/game/Guilds/Guild.h @@ -600,7 +600,7 @@ public: // Getters uint32 GetId() const { return m_id; } - uint64 GetGuid() const { return MAKE_NEW_GUID(m_id, 0, HIGHGUID_GUILD); } + uint64 GetGUID() const { return MAKE_NEW_GUID(m_id, 0, HIGHGUID_GUILD); } uint64 GetLeaderGUID() const { return m_leaderGuid; } const std::string& GetName() const { return m_name; } const std::string& GetMOTD() const { return m_motd; } @@ -679,6 +679,9 @@ public: // Bank tabs void SetBankTabText(uint8 tabId, const std::string& text); + AchievementMgr& GetAchievementMgr() { return m_achievementMgr; } + AchievementMgr const& GetAchievementMgr() const { return m_achievementMgr; } + protected: uint32 m_id; std::string m_name; @@ -699,6 +702,8 @@ protected: LogHolder* m_eventLog; LogHolder* m_bankEventLog[GUILD_BANK_MAX_TABS + 1]; + AchievementMgr m_achievementMgr; + private: inline uint8 _GetRanksSize() const { return uint8(m_ranks.size()); } inline const RankInfo* GetRankInfo(uint8 rankId) const { return rankId < _GetRanksSize() ? &m_ranks[rankId] : NULL; } diff --git a/src/server/game/Guilds/GuildMgr.cpp b/src/server/game/Guilds/GuildMgr.cpp index 450a49e345c..a6b73664695 100644 --- a/src/server/game/Guilds/GuildMgr.cpp +++ b/src/server/game/Guilds/GuildMgr.cpp @@ -405,7 +405,25 @@ void GuildMgr::LoadGuilds() } } - // 9. Validate loaded guild data + // 9. Load guild achievements + { + PreparedQueryResult achievementResult; + PreparedQueryResult criteriaResult; + for (GuildContainer::const_iterator itr = GuildStore.begin(); itr != GuildStore.end(); ++itr) + { + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_ACHIEVEMENT); + stmt->setUInt32(0, itr->first); + achievementResult = CharacterDatabase.Query(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_ACHIEVEMENT_CRITERIA); + stmt->setUInt32(0, itr->first); + criteriaResult = CharacterDatabase.Query(stmt); + + itr->second->GetAchievementMgr().LoadFromDB(achievementResult, criteriaResult); + } + } + + // 10. Validate loaded guild data sLog->outString("Validating data of loaded guilds..."); { uint32 oldMSTime = getMSTime(); diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp index 95204dfa353..f26379f4101 100755 --- a/src/server/game/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Handlers/AuctionHouseHandler.cpp @@ -276,7 +276,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data) SendAuctionCommandResult(AH->Id, AUCTION_SELL_ITEM, AUCTION_OK); - GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CREATE_AUCTION, 1); + GetPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CREATE_AUCTION, 1); return; } else // Required stack size of auction does not match to current item stack size, clone item and set correct stack size @@ -345,7 +345,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data) SendAuctionCommandResult(AH->Id, AUCTION_SELL_ITEM, AUCTION_OK); - GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CREATE_AUCTION, 1); + GetPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CREATE_AUCTION, 1); return; } } @@ -437,7 +437,7 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket& recv_data) auction->bidder = player->GetGUIDLow(); auction->bid = price; - GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_BID, price); + GetPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_BID, price); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_AUCTION_BID); stmt->setUInt32(0, auction->bidder); @@ -460,7 +460,7 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket& recv_data) } auction->bidder = player->GetGUIDLow(); auction->bid = auction->buyout; - GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_BID, auction->buyout); + GetPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_BID, auction->buyout); //- Mails must be under transaction control too to prevent data loss sAuctionMgr->SendAuctionSalePendingMail(auction, trans); diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 1c79b20ce81..26a3e7c67ea 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -1441,7 +1441,7 @@ void WorldSession::HandleAlterAppearance(WorldPacket & recv_data) } _player->ModifyMoney(-int32(Cost)); // it isn't free - _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_AT_BARBER, Cost); + _player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_AT_BARBER, Cost); _player->SetByteValue(PLAYER_BYTES, 2, uint8(bs_hair->hair_id)); _player->SetByteValue(PLAYER_BYTES, 3, uint8(Color)); @@ -1449,7 +1449,7 @@ void WorldSession::HandleAlterAppearance(WorldPacket & recv_data) if (bs_skinColor) _player->SetByteValue(PLAYER_BYTES, 0, uint8(bs_skinColor->hair_id)); - _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_VISIT_BARBER_SHOP, 1); + _player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_VISIT_BARBER_SHOP, 1); _player->SetStandState(0); // stand up } diff --git a/src/server/game/Handlers/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cpp index c1246799e4b..08d36328cf0 100755 --- a/src/server/game/Handlers/ChatHandler.cpp +++ b/src/server/game/Handlers/ChatHandler.cpp @@ -740,7 +740,7 @@ void WorldSession::HandleTextEmoteOpcode(WorldPacket & recv_data) TypeContainerVisitor >, WorldTypeMapContainer> message(emote_worker); cell.Visit(p, message, *GetPlayer()->GetMap(), *GetPlayer(), sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE)); - GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE, text_emote, 0, unit); + GetPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE, text_emote, 0, unit); //Send scripted event call if (unit && unit->GetTypeId() == TYPEID_UNIT && ((Creature*)unit)->AI()) diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp index eadc0958518..626221e9696 100755 --- a/src/server/game/Handlers/GroupHandler.cpp +++ b/src/server/game/Handlers/GroupHandler.cpp @@ -476,10 +476,10 @@ void WorldSession::HandleLootRoll(WorldPacket& recvData) switch (rollType) { case ROLL_NEED: - GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED, 1); + GetPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED, 1); break; case ROLL_GREED: - GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED, 1); + GetPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED, 1); break; } } diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 5baa54a2779..1e29ea2621e 100755 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -584,7 +584,7 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recv_data) uint32 money = pProto->SellPrice * count; _player->ModifyMoney(money); - _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_VENDORS, money); + _player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_VENDORS, money); } else _player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid, 0); @@ -632,7 +632,7 @@ void WorldSession::HandleBuybackItem(WorldPacket & recv_data) _player->ModifyMoney(-(int32)price); _player->RemoveItemFromBuyBackSlot(slot, false); _player->ItemAddedQuestCheck(pItem->GetEntry(), pItem->GetCount()); - _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, pItem->GetEntry(), pItem->GetCount()); + _player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, pItem->GetEntry(), pItem->GetCount()); _player->StoreItem(dest, pItem, true); } else @@ -947,7 +947,7 @@ void WorldSession::HandleBuyBankSlotOpcode(WorldPacket& recvPacket) data << uint32(ERR_BANKSLOT_OK); SendPacket(&data); - _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BUY_BANK_SLOT); + _player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BUY_BANK_SLOT); } void WorldSession::HandleAutoBankItemOpcode(WorldPacket& recvPacket) diff --git a/src/server/game/Handlers/LootHandler.cpp b/src/server/game/Handlers/LootHandler.cpp index 339c7a44d9f..53e589e31fd 100755 --- a/src/server/game/Handlers/LootHandler.cpp +++ b/src/server/game/Handlers/LootHandler.cpp @@ -179,7 +179,7 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket & /*recv_data*/) for (std::vector::const_iterator i = playersNear.begin(); i != playersNear.end(); ++i) { (*i)->ModifyMoney(goldPerPlayer); - (*i)->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_MONEY, goldPerPlayer); + (*i)->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_MONEY, goldPerPlayer); WorldPacket data(SMSG_LOOT_MONEY_NOTIFY, 4 + 1); data << uint32(goldPerPlayer); @@ -190,7 +190,7 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket & /*recv_data*/) else { player->ModifyMoney(loot->gold); - player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_MONEY, loot->gold); + player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_MONEY, loot->gold); WorldPacket data(SMSG_LOOT_MONEY_NOTIFY, 4 + 1); data << uint32(loot->gold); @@ -496,9 +496,9 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPacket & recv_data) // not move item from loot to target inventory Item* newitem = target->StoreNewItem(dest, item.itemid, true, item.randomPropertyId, looters); target->SendNewItem(newitem, uint32(item.count), false, false, true); - target->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM, item.itemid, item.count); - target->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE, loot->loot_type, item.count); - target->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_EPIC_ITEM, item.itemid, item.count); + target->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM, item.itemid, item.count); + target->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE, loot->loot_type, item.count); + target->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_EPIC_ITEM, item.itemid, item.count); // mark as looted item.count=0; diff --git a/src/server/game/Handlers/MailHandler.cpp b/src/server/game/Handlers/MailHandler.cpp index ce056d2729c..dd76c3a4c80 100755 --- a/src/server/game/Handlers/MailHandler.cpp +++ b/src/server/game/Handlers/MailHandler.cpp @@ -246,7 +246,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data) player->SendMailResult(0, MAIL_SEND, MAIL_OK); player->ModifyMoney(-int32(reqmoney)); - player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_MAIL, cost); + player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_MAIL, cost); bool needItemDelay = false; diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 956179b9d26..1c02d2082b8 100755 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -1691,7 +1691,16 @@ void WorldSession::HandleQueryInspectAchievements(WorldPacket & recv_data) if (!player) return; - player->GetAchievementMgr().SendRespondInspectAchievements(_player); + player->GetAchievementMgr().SendAchievementInfo(_player); +} + +void WorldSession::HandleGuildAchievementProgressQuery(WorldPacket& recvData) +{ + uint32 achievementId; + recvData >> achievementId; + + if (Guild* guild = sGuildMgr->GetGuildById(_player->GetGuildId())) + guild->GetAchievementMgr().SendAchievementInfo(_player, achievementId); } void WorldSession::HandleWorldStateUITimerUpdate(WorldPacket& /*recv_data*/) diff --git a/src/server/game/Handlers/QuestHandler.cpp b/src/server/game/Handlers/QuestHandler.cpp index 2998b8a1c75..62924c6ef36 100755 --- a/src/server/game/Handlers/QuestHandler.cpp +++ b/src/server/game/Handlers/QuestHandler.cpp @@ -440,7 +440,7 @@ void WorldSession::HandleQuestLogRemoveQuest(WorldPacket& recv_data) _player->SetQuestSlot(slot, 0); - _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_QUEST_ABANDONED, 1); + _player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_QUEST_ABANDONED, 1); } } diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp index 5823a38fb42..6aba8c82477 100755 --- a/src/server/game/Handlers/SpellHandler.cpp +++ b/src/server/game/Handlers/SpellHandler.cpp @@ -306,7 +306,7 @@ void WorldSession::HandleGameobjectReportUse(WorldPacket& recvPacket) go->AI()->GossipHello(_player); - _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_USE_GAMEOBJECT, go->GetEntry()); + _player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_USE_GAMEOBJECT, go->GetEntry()); } void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket) @@ -599,7 +599,7 @@ void WorldSession::HandleMirrorImageDataRequest(WorldPacket & recv_data) data << uint8(player->GetByteValue(PLAYER_BYTES, 2)); // hair data << uint8(player->GetByteValue(PLAYER_BYTES, 3)); // haircolor data << uint8(player->GetByteValue(PLAYER_BYTES_2, 0)); // facialhair - data << uint64(guild ? guild->GetGuid() : 0); + data << uint64(guild ? guild->GetGUID() : 0); static EquipmentSlots const itemSlots[] = { diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h index 6d526f23a94..5eb11416fdd 100755 --- a/src/server/game/Maps/Map.h +++ b/src/server/game/Maps/Map.h @@ -444,6 +444,7 @@ class Map : public GridRefManager bool Contains(const GameObjectModel& mdl) const { return _dynamicTree.contains(mdl);} bool getObjectHitPos(uint32 phasemask, float x1, float y1, float z1, float x2, float y2, float z2, float& rx, float &ry, float& rz, float modifyDist); + virtual uint32 GetOwnerGuildId(uint32 /*team*/ = TEAM_OTHER) const { return 0; } /* RESPAWN TIMES */ diff --git a/src/server/game/Reputation/ReputationMgr.cpp b/src/server/game/Reputation/ReputationMgr.cpp index 94a6590cc4a..0ae16d72758 100755 --- a/src/server/game/Reputation/ReputationMgr.cpp +++ b/src/server/game/Reputation/ReputationMgr.cpp @@ -388,11 +388,11 @@ bool ReputationMgr::SetOneFactionReputation(FactionEntry const* factionEntry, in UpdateRankCounters(old_rank, new_rank); _player->ReputationChanged(factionEntry); - _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KNOWN_FACTIONS, factionEntry->ID); - _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION, factionEntry->ID); - _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_EXALTED_REPUTATION, factionEntry->ID); - _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_REVERED_REPUTATION, factionEntry->ID); - _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_HONORED_REPUTATION, factionEntry->ID); + _player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KNOWN_FACTIONS, factionEntry->ID); + _player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION, factionEntry->ID); + _player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_EXALTED_REPUTATION, factionEntry->ID); + _player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_REVERED_REPUTATION, factionEntry->ID); + _player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_HONORED_REPUTATION, factionEntry->ID); return true; } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 90245e8b109..ee28bd59618 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -320,6 +320,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_GROUP_UNINVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupUninviteOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_UNINVITE_GUID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupUninviteGuidOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildAcceptOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_ACHIEVEMENT_PROGRESS_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildAchievementProgressQuery); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_ADD_RANK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildAddRankOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANKER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankerActivate ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_BUY_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankBuyTab ); @@ -779,7 +780,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(MSG_VIEW_PHASE_SHIFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(SMSG_ACCOUNT_DATA_TIMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ACHIEVEMENT_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ACHIEVEMENT_EARNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ACHIEVEMENT_EARNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ACTION_BUTTONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ACTIVATETAXIREPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ADDON_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -916,8 +917,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_CORPSE_MAP_POSITION_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CORPSE_RECLAIM_DELAY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CREATURE_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CRITERIA_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CRITERIA_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CRITERIA_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CRITERIA_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CROSSED_INEBRIATION_THRESHOLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DAMAGE_CALC_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DANCE_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1001,8 +1002,13 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_GROUP_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GROUP_SET_LEADER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GROUP_UNINVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_ACHIEVEMENT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_ACHIEVEMENT_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_ACHIEVEMENT_EARNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_CRITERIA_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_CRITERIA_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_DECLINE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1240,7 +1246,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_SERVERTIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SERVER_BUCK_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SERVER_BUCK_DATA_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SERVER_FIRST_ACHIEVEMENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SERVER_FIRST_ACHIEVEMENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SERVER_INFO_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SERVER_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SET_EXTRA_AURA_INFO_NEED_UPDATE_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index f73f3af0446..26e3c65a1b7 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -200,6 +200,7 @@ enum Opcodes CMSG_GROUP_UNINVITE_GUID = 0x0000, CMSG_GUILDFINDER_JOIN = 0x0000, CMSG_GUILD_ACCEPT = 0x2531, + CMSG_GUILD_ACHIEVEMENT_PROGRESS_QUERY = 0x3235, CMSG_GUILD_BANKER_ACTIVATE = 0x2E37, CMSG_GUILD_BANK_BUY_TAB = 0x0000, CMSG_GUILD_BANK_DEPOSIT_MONEY = 0x0000, @@ -543,7 +544,7 @@ enum Opcodes MSG_TALENT_WIPE_CONFIRM = 0x0000, MSG_VERIFY_CONNECTIVITY = 0x4F57, SMSG_ACCOUNT_DATA_TIMES = 0x4B05, - SMSG_ACHIEVEMENT_DELETED = 0x0000, + SMSG_ACHIEVEMENT_DELETED = 0x6A16, SMSG_ACHIEVEMENT_EARNED = 0x4405, SMSG_ACTION_BUTTONS = 0x38B5, SMSG_ACTIVATETAXIREPLY = 0x0000, @@ -672,7 +673,7 @@ enum Opcodes SMSG_CORPSE_NOT_IN_INSTANCE = 0x0000, SMSG_CORPSE_RECLAIM_DELAY = 0x0D34, SMSG_CREATURE_QUERY_RESPONSE = 0x6024, - SMSG_CRITERIA_DELETED = 0x0000, + SMSG_CRITERIA_DELETED = 0x2915, SMSG_CRITERIA_UPDATE = 0x6E37, SMSG_CROSSED_INEBRIATION_THRESHOLD = 0x0000, SMSG_DAMAGE_CALC_LOG = 0x0000, @@ -742,10 +743,14 @@ enum Opcodes SMSG_GROUP_SET_LEADER = 0x0526, SMSG_GROUP_UNINVITE = 0x0000, SMSG_GUILDFINDER_SEARCH_RESULT = 0x0000, - SMSG_GUILD_ACHIEVEMENT_DATA = 0x0000, + SMSG_GUILD_ACHIEVEMENT_DATA = 0x54B7, + SMSG_GUILD_ACHIEVEMENT_DELETED = 0x35A0, + SMSG_GUILD_ACHIEVEMENT_EARNED = 0x50B5, SMSG_GUILD_BANK_LIST = 0x78A5, SMSG_GUILD_CANCEL = 0x0000, SMSG_GUILD_COMMAND_RESULT = 0x0000, + SMSG_GUILD_CRITERIA_DATA = 0x14B4, + SMSG_GUILD_CRITERIA_DELETED = 0x55B1, SMSG_GUILD_DECLINE = 0x0000, SMSG_GUILD_EVENT = 0x0705, SMSG_GUILD_INFO = 0x0000, @@ -977,7 +982,7 @@ enum Opcodes SMSG_REQUEST_CEMETERY_LIST_RESPONSE = 0x0000, SMSG_RESET_FAILED_NOTIFY = 0x0000, SMSG_RESISTLOG = 0x0000, - SMSG_RESPOND_INSPECT_ACHIEVEMENTS = 0x0000, + SMSG_RESPOND_INSPECT_ACHIEVEMENTS = 0x15B0, SMSG_RESURRECT_REQUEST = 0x0000, SMSG_RESYNC_RUNES = 0x0000, SMSG_RWHOIS = 0x0000, @@ -985,7 +990,7 @@ enum Opcodes SMSG_SEND_MAIL_RESULT = 0x0000, SMSG_SEND_UNLEARN_SPELLS = 0x4E25, SMSG_SERVERTIME = 0x0000, - SMSG_SERVER_FIRST_ACHIEVEMENT = 0x0000, + SMSG_SERVER_FIRST_ACHIEVEMENT = 0x6424, SMSG_SERVER_MESSAGE = 0x6C04, SMSG_SET_FACTION_ATWAR = 0x0000, SMSG_SET_FACTION_STANDING = 0x0126, diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 1d648fec6c9..7495a57f399 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -921,6 +921,7 @@ class WorldSession void HandleRemoveGlyph(WorldPacket& recv_data); void HandleCharCustomize(WorldPacket& recv_data); void HandleQueryInspectAchievements(WorldPacket& recv_data); + void HandleGuildAchievementProgressQuery(WorldPacket& recvData); void HandleEquipmentSetSave(WorldPacket& recv_data); void HandleEquipmentSetDelete(WorldPacket& recv_data); void HandleEquipmentSetUse(WorldPacket& recv_data); diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index a9c53f3a817..968a5b850e2 100755 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -1028,7 +1028,7 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) // Sleep this Network thread for uint32 sleepTime = sWorld->getIntConfig(CONFIG_SESSION_ADD_DELAY); - ACE_OS::sleep(ACE_Time_Value (0, sleepTime)); + ACE_OS::sleep(ACE_Time_Value(0, sleepTime)); sWorld->AddSession(m_Session); return 0; diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 54b3ae310e2..76cae551bbd 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -2602,14 +2602,14 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA if (unit->GetTypeId() == TYPEID_PLAYER) { unit->ToPlayer()->GetAchievementMgr().StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_SPELL_TARGET, m_spellInfo->Id); - unit->ToPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, m_spellInfo->Id, 0, m_caster); - unit->ToPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2, m_spellInfo->Id); + unit->ToPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, m_spellInfo->Id, 0, m_caster); + unit->ToPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2, m_spellInfo->Id); } if (m_caster->GetTypeId() == TYPEID_PLAYER) { m_caster->ToPlayer()->GetAchievementMgr().StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_SPELL_CASTER, m_spellInfo->Id); - m_caster->ToPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL2, m_spellInfo->Id, 0, unit); + m_caster->ToPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL2, m_spellInfo->Id, 0, unit); } if (m_caster != unit) @@ -3251,10 +3251,10 @@ void Spell::cast(bool skipCheck) if (!(_triggeredCastFlags & TRIGGERED_IGNORE_CAST_ITEM) && m_CastItem) { m_caster->ToPlayer()->GetAchievementMgr().StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_ITEM, m_CastItem->GetEntry()); - m_caster->ToPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_USE_ITEM, m_CastItem->GetEntry()); + m_caster->ToPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_USE_ITEM, m_CastItem->GetEntry()); } - m_caster->ToPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL, m_spellInfo->Id); + m_caster->ToPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL, m_spellInfo->Id); } if (!(_triggeredCastFlags & TRIGGERED_IGNORE_POWER_AND_REAGENT_COST)) diff --git a/src/server/scripts/Commands/cs_reset.cpp b/src/server/scripts/Commands/cs_reset.cpp index a8294dc9ddb..82c692ce39e 100644 --- a/src/server/scripts/Commands/cs_reset.cpp +++ b/src/server/scripts/Commands/cs_reset.cpp @@ -62,7 +62,7 @@ public: if (target) target->GetAchievementMgr().Reset(); else - AchievementMgr::DeleteFromDB(GUID_LOPART(targetGuid)); + AchievementMgr::DeleteFromDB(GUID_LOPART(targetGuid)); return true; } diff --git a/src/server/shared/DataStores/DBCStore.h b/src/server/shared/DataStores/DBCStore.h index 589d331f22d..f8a983d22f3 100755 --- a/src/server/shared/DataStores/DBCStore.h +++ b/src/server/shared/DataStores/DBCStore.h @@ -41,7 +41,7 @@ struct SqlDbc for (uint32 i = 0; i< sqlTableName.size(); ++i) { if (isalpha(sqlTableName[i])) - sqlTableName[i] = tolower(sqlTableName[i]); + sqlTableName[i] = char(tolower(sqlTableName[i])); else if (sqlTableName[i] == '.') sqlTableName[i] = '_'; } diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index 27bf92ad846..3bd398d040e 100755 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -228,6 +228,14 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_UPD_GUILD_RANK_BANK_TIME4, "UPDATE guild_member SET BankResetTimeTab4 = 0 WHERE guildid = ? AND rank = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_UPD_GUILD_RANK_BANK_TIME5, "UPDATE guild_member SET BankResetTimeTab5 = 0 WHERE guildid = ? AND rank = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_CHAR_DATA_FOR_GUILD, "SELECT name, level, class, zone, account FROM characters WHERE guid = ?", CONNECTION_SYNCH) + PREPARE_STATEMENT(CHAR_DEL_GUILD_ACHIEVEMENT, "DELETE FROM guild_achievement WHERE guildId = ? AND achievement = ?", CONNECTION_SYNCH) + PREPARE_STATEMENT(CHAR_INS_GUILD_ACHIEVEMENT, "INSERT INTO guild_achievement (guildId, achievement, date, guids) VALUES (?, ?, ?, ?)", CONNECTION_SYNCH) + PREPARE_STATEMENT(CHAR_DEL_GUILD_ACHIEVEMENT_CRITERIA, "DELETE FROM guild_achievement_progress WHERE guildId = ? AND criteria = ?", CONNECTION_SYNCH) + PREPARE_STATEMENT(CHAR_INS_GUILD_ACHIEVEMENT_CRITERIA, "INSERT INTO guild_achievement_progress (guildId, criteria, counter, date, completedGuid) VALUES (?, ?, ?, ?, ?)", CONNECTION_SYNCH) + PREPARE_STATEMENT(CHAR_DEL_ALL_GUILD_ACHIEVEMENTS, "DELETE FROM guild_achievement WHERE guildId = ?", CONNECTION_SYNCH) + PREPARE_STATEMENT(CHAR_DEL_ALL_GUILD_ACHIEVEMENT_CRITERIA, "DELETE FROM guild_achievement_progress WHERE guildId = ?", CONNECTION_SYNCH) + PREPARE_STATEMENT(CHAR_SEL_GUILD_ACHIEVEMENT, "SELECT achievement, date, guids FROM guild_achievement WHERE guildId = ?", CONNECTION_SYNCH) + PREPARE_STATEMENT(CHAR_SEL_GUILD_ACHIEVEMENT_CRITERIA, "SELECT criteria, counter, date, completedGuid FROM guild_achievement_progress WHERE guildId = ?", CONNECTION_SYNCH) // Chat channel handling PREPARE_STATEMENT(CHAR_SEL_CHANNEL, "SELECT announce, ownership, password, bannedList FROM channels WHERE name = ? AND team = ?", CONNECTION_SYNCH) diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.h b/src/server/shared/Database/Implementation/CharacterDatabase.h index 08265c455d6..adaa4acf7c5 100755 --- a/src/server/shared/Database/Implementation/CharacterDatabase.h +++ b/src/server/shared/Database/Implementation/CharacterDatabase.h @@ -222,6 +222,14 @@ enum CharacterDatabaseStatements CHAR_UPD_GUILD_RANK_BANK_TIME4, CHAR_UPD_GUILD_RANK_BANK_TIME5, CHAR_SEL_CHAR_DATA_FOR_GUILD, + CHAR_DEL_GUILD_ACHIEVEMENT, + CHAR_INS_GUILD_ACHIEVEMENT, + CHAR_DEL_GUILD_ACHIEVEMENT_CRITERIA, + CHAR_INS_GUILD_ACHIEVEMENT_CRITERIA, + CHAR_DEL_ALL_GUILD_ACHIEVEMENTS, + CHAR_DEL_ALL_GUILD_ACHIEVEMENT_CRITERIA, + CHAR_SEL_GUILD_ACHIEVEMENT, + CHAR_SEL_GUILD_ACHIEVEMENT_CRITERIA, CHAR_SEL_CHANNEL, CHAR_INS_CHANNEL, diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h index 27d5e78bac5..b78d78c69f2 100755 --- a/src/server/shared/Packets/ByteBuffer.h +++ b/src/server/shared/Packets/ByteBuffer.h @@ -234,7 +234,7 @@ class ByteBuffer if (!bit) byte = 0; else - byte = ReadUInt8() ^ bit; + byte = uint8(ReadUInt8() ^ bit); } void WriteByteMask(uint8 b) -- cgit v1.2.3 From 9f52f4df537c6ce0cd5329b03ee04c5bc57f271e Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 9 Jul 2012 14:22:54 +0200 Subject: Core/Achievements: Fixed a mistake in building guild criteria packets --- src/server/game/Achievements/AchievementMgr.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 7ff744a1dc8..dafcd88433f 100755 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -2567,6 +2567,17 @@ void AchievementMgr::SendAchievementInfo(Player* receiver, uint32 achieve continue; ++numCriteria; + } + + criteriaBits.WriteBits(numCriteria, 21); + + for (AchievementCriteriaEntryList::const_iterator itr = criteria->begin(); itr != criteria->end(); ++itr) + { + uint32 criteriaId = (*itr)->ID; + CriteriaProgressMap::const_iterator progress = m_criteriaProgress.find(criteriaId); + if (progress == m_criteriaProgress.end()) + continue; + *reinterpret_cast(&criteriaProgress[0]) = progress->second.counter; *reinterpret_cast(&criteriaGuid[0]) = progress->second.CompletedGUID; @@ -2610,13 +2621,10 @@ void AchievementMgr::SendAchievementInfo(Player* receiver, uint32 achieve criteriaData.WriteByteSeq(criteriaGuid[0]); } - WorldPacket data(SMSG_GUILD_CRITERIA_DATA, 3 + criteriaBits.size() + criteriaData.size()); - data.WriteBits(numCriteria, 21); + WorldPacket data(SMSG_GUILD_CRITERIA_DATA, criteriaBits.size() + criteriaData.size()); + data.append(criteriaBits); if (numCriteria) - { - data.append(criteriaBits); data.append(criteriaData); - } receiver->GetSession()->SendPacket(&data); } -- cgit v1.2.3 From d9e830c4842cfb333c1385e794b8ad1f875e2dc6 Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 9 Jul 2012 14:23:55 +0200 Subject: Core/PacketIO: Updated character list packet structure to 4.3.4 --- src/server/game/Entities/Object/ObjectDefines.h | 2 +- src/server/game/Entities/Player/Player.cpp | 242 +++++++++++------------- src/server/game/Entities/Player/Player.h | 2 +- src/server/game/Handlers/CharacterHandler.cpp | 106 +++-------- src/server/game/Server/Protocol/Opcodes.cpp | 8 +- 5 files changed, 143 insertions(+), 217 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Object/ObjectDefines.h b/src/server/game/Entities/Object/ObjectDefines.h index 922ff519d75..a9d14b85a59 100755 --- a/src/server/game/Entities/Object/ObjectDefines.h +++ b/src/server/game/Entities/Object/ObjectDefines.h @@ -45,7 +45,7 @@ enum HighGuid HIGHGUID_CORPSE = 0xF101, // blizz F100 HIGHGUID_MO_TRANSPORT = 0x1FC0, // blizz 1FC0 (for GAMEOBJECT_TYPE_MO_TRANSPORT) HIGHGUID_GROUP = 0x1F50, - HIGHGUID_GUILD = 0x1FF // new 4.x + HIGHGUID_GUILD = 0x1FF5, // new 4.x }; #define IS_EMPTY_GUID(Guid) (Guid == 0) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index f66f3b95128..cdd0927bed5 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -1843,7 +1843,8 @@ void Player::setDeathState(DeathState s) //clear aura case after resurrection by another way (spells will be applied before next death) SetUInt32Value(PLAYER_SELF_RES_SPELL, 0); } -bool Player::BuildEnumData(PreparedQueryResult result, ByteBuffer* data) + +bool Player::BuildEnumData(PreparedQueryResult result, ByteBuffer* dataBuffer, ByteBuffer* bitBuffer) { // 0 1 2 3 4 5 6 7 // "SELECT characters.guid, characters.name, characters.race, characters.class, characters.gender, characters.playerBytes, characters.playerBytes2, characters.level, " @@ -1852,70 +1853,31 @@ bool Player::BuildEnumData(PreparedQueryResult result, ByteBuffer* data) // 15 16 17 18 19 20 21 // "characters.at_login, character_pet.entry, character_pet.modelid, character_pet.level, characters.data, character_banned.guid, character_declinedname.genitive " - Field *fields = result->Fetch(); - - //uint64 GuildGuid = (*result)[13].GetUInt32();//TODO: store as uin64 + Field* fields = result->Fetch(); + uint8 guid[8]; + uint8 guildGuid[8]; + *reinterpret_cast(&guid[0]) = MAKE_NEW_GUID(fields[0].GetUInt32(), 0, HIGHGUID_PLAYER); + std::string name = fields[1].GetString(); uint8 plrRace = fields[2].GetUInt8(); uint8 plrClass = fields[3].GetUInt8(); uint8 gender = fields[4].GetUInt8(); + uint8 skin = uint8(fields[5].GetUInt32() & 0xFF); + uint8 face = uint8((fields[5].GetUInt32() >> 8) & 0xFF); + uint8 hairStyle = uint8((fields[5].GetUInt32() >> 16) & 0xFF); + uint8 hairColor = uint8((fields[5].GetUInt32() >> 24) & 0xFF); + uint8 facialHair = uint8(fields[6].GetUInt32() & 0xFF); uint8 level = fields[7].GetUInt8(); - uint32 GuidLow = fields[0].GetUInt32(); - uint32 playerBytes = fields[5].GetUInt32(); - uint32 playerFlags = fields[14].GetUInt32(); - uint32 atLoginFlags = fields[15].GetUInt32(); uint32 zone = fields[8].GetUInt16(); - uint32 petDisplayId = 0; - uint32 petLevel = 0; - uint32 petFamily = 0; - // show pet at selection character in character list only for non-ghost character - if (result && !(playerFlags & PLAYER_FLAGS_GHOST) && (plrClass == CLASS_WARLOCK || plrClass == CLASS_HUNTER || plrClass == CLASS_DEATH_KNIGHT)) - { - uint32 entry = fields[16].GetUInt32(); - CreatureTemplate const* creatureInfo = sObjectMgr->GetCreatureTemplate(entry); - if (creatureInfo) - { - petDisplayId = fields[17].GetUInt32(); - petLevel = fields[18].GetUInt16(); - petFamily = creatureInfo->family; - } - } - - *data << fields[1].GetString(); // name - *data << uint8(playerBytes >> 8); // face - *data << uint32(fields[9].GetUInt16()); // map - - uint8 Guid0 = uint8(GuidLow); - uint8 Guid1 = uint8(GuidLow >> 8); - uint8 Guid2 = uint8(GuidLow >> 16); - uint8 Guid3 = uint8(GuidLow >> 24); - - if (Guid1) - *data << uint8(Guid1^1); - - //if (uint8(GuildGuid)) - // *data << uint8(GuildGuid^1); - - *data << fields[10].GetFloat(); // x - *data << fields[11].GetFloat(); // y - *data << fields[12].GetFloat(); // z - - if (Guid0) - *data << uint8(Guid0^1); - - *data << uint32(zone); // Zone id - *data << uint32(petLevel); // pet level - - if (Guid3) - *data << uint8(Guid3^1); - - //*data << uint8(2); // unk, bit 14 - - uint32 playerBytes2 = fields[6].GetUInt32(); - *data << uint8(playerBytes2 & 0xFF); // facial hair - *data << uint8(playerBytes); // skin - *data << uint8(plrClass); // class - *data << uint32(petFamily); // Pet Family + uint32 mapId = uint32(fields[9].GetUInt16()); + float x = fields[10].GetFloat(); + float y = fields[11].GetFloat(); + float z = fields[12].GetFloat(); + uint32 guildId = fields[13].GetUInt32(); + *reinterpret_cast(&guildGuid[0]) = MAKE_NEW_GUID(guildId, 0, guildId ? HIGHGUID_GUILD : 0); + uint32 playerFlags = fields[14].GetUInt32(); + uint32 atLoginFlags = fields[15].GetUInt16(); + Tokens equipment(fields[19].GetString(), ' '); uint32 charFlags = 0; if (playerFlags & PLAYER_FLAGS_HIDE_HELM) @@ -1933,55 +1895,65 @@ bool Player::BuildEnumData(PreparedQueryResult result, ByteBuffer* data) if (fields[20].GetUInt32()) charFlags |= CHARACTER_FLAG_LOCKED_BY_BILLING; - if (sWorld->getBoolConfig(CONFIG_DECLINED_NAMES_USED)) - { - if (!fields[21].GetString().empty()) - charFlags |= CHARACTER_FLAG_DECLINED; - } - else + if (sWorld->getBoolConfig(CONFIG_DECLINED_NAMES_USED) && !fields[21].GetString().empty()) charFlags |= CHARACTER_FLAG_DECLINED; - *data << uint32(charFlags); // character flags - - if (Guid2) - *data << uint8(Guid2^1); - - *data << uint32(petDisplayId); // Pet DisplayID - - //if (uint8(GuildGuid >> 56)) - // *data << uint8(GuildGuid^1 >> 56); - - *data << uint8(level); // Level - *data << uint8(playerBytes >> 16); // Hair style - - //if (uint8(GuildGuid >> 16)) - // *data << uint8(GuildGuid^1 >> 16); - - *data << uint8(plrRace); // Race - *data << uint8(playerBytes >> 24); // Hair color - - //if (uint8(GuildGuid >> 48)) - // *data << uint8(GuildGuid^1 >> 48); - - *data << uint8(gender); // Gender - - //if (uint8(GuildGuid >> 24)) - // *data << uint8(GuildGuid^1 >> 24); + uint32 customizationFlag = 0; + if (atLoginFlags & AT_LOGIN_CUSTOMIZE) + customizationFlag = CHAR_CUSTOMIZE_FLAG_CUSTOMIZE; + else if (atLoginFlags & AT_LOGIN_CHANGE_FACTION) + customizationFlag = CHAR_CUSTOMIZE_FLAG_FACTION; + else if (atLoginFlags & AT_LOGIN_CHANGE_RACE) + customizationFlag = CHAR_CUSTOMIZE_FLAG_RACE; - *data << uint8(0); // character order id (used for char list positioning) TODO: implement + uint32 petDisplayId = 0; + uint32 petLevel = 0; + uint32 petFamily = 0; + // show pet at selection character in character list only for non-ghost character + if (result && !(playerFlags & PLAYER_FLAGS_GHOST) && (plrClass == CLASS_WARLOCK || plrClass == CLASS_HUNTER || plrClass == CLASS_DEATH_KNIGHT)) + { + uint32 entry = fields[16].GetUInt32(); + CreatureTemplate const* creatureInfo = sObjectMgr->GetCreatureTemplate(entry); + if (creatureInfo) + { + petDisplayId = fields[17].GetUInt32(); + petLevel = fields[18].GetUInt16(); + petFamily = creatureInfo->family; + } + } - Tokens equipment(fields[19].GetString(), ' '); - for (uint8 slot = 0; slot < EQUIPMENT_SLOT_END; ++slot) + // Packet content flags + bitBuffer->WriteBit(guid[3]); + bitBuffer->WriteBit(guildGuid[1]); + bitBuffer->WriteBit(guildGuid[7]); + bitBuffer->WriteBit(guildGuid[2]); + bitBuffer->WriteBits(uint32(name.length()), 7); + bitBuffer->WriteBit(guid[4]); + bitBuffer->WriteBit(guid[7]); + bitBuffer->WriteBit(guildGuid[3]); + bitBuffer->WriteBit(guid[5]); + bitBuffer->WriteBit(guildGuid[6]); + bitBuffer->WriteBit(guid[1]); + bitBuffer->WriteBit(guildGuid[5]); + bitBuffer->WriteBit(guildGuid[4]); + bitBuffer->WriteBit(atLoginFlags & AT_LOGIN_FIRST); + bitBuffer->WriteBit(guid[0]); + bitBuffer->WriteBit(guid[2]); + bitBuffer->WriteBit(guid[6]); + bitBuffer->WriteBit(guildGuid[0]); + + // Character data + *dataBuffer << uint8(plrClass); // Class + for (uint8 slot = 0; slot < INVENTORY_SLOT_BAG_END; ++slot) { uint32 visualbase = slot * 2; uint32 itemId = GetUInt32ValueFromArray(equipment, visualbase); ItemTemplate const* proto = sObjectMgr->GetItemTemplate(itemId); - ItemEntry const *db2Item = sItemStore.LookupEntry(itemId); // Use Item.db2.DisplayID for Char Enum - if (!proto || !db2Item) + if (!proto) { - *data << uint32(0); - *data << uint8(0); - *data << uint32(0); + *dataBuffer << uint8(0); + *dataBuffer << uint32(0); + *dataBuffer << uint32(0); continue; } @@ -1998,35 +1970,48 @@ bool Player::BuildEnumData(PreparedQueryResult result, ByteBuffer* data) if (enchant) break; } - *data << uint32(enchant ? enchant->aura_id : 0); - *data << uint8(proto->InventoryType); - *data << uint32(db2Item->DisplayId); - } - - // Bags (not supported) TODO: implement - for (uint32 i = 0; i < 4; ++i) - { - *data << uint32(0); // enchant - *data << uint8(0); // invtype - *data << uint32(0); // displayid - } - - // character customize flags - if (atLoginFlags & AT_LOGIN_CUSTOMIZE) - *data << uint32(CHAR_CUSTOMIZE_FLAG_CUSTOMIZE); - - else if (atLoginFlags & AT_LOGIN_CHANGE_FACTION) - *data << uint32(CHAR_CUSTOMIZE_FLAG_FACTION); - - else if (atLoginFlags & AT_LOGIN_CHANGE_RACE) - *data << uint32(CHAR_CUSTOMIZE_FLAG_RACE); - - else - *data << uint32(CHAR_CUSTOMIZE_FLAG_NONE); - - //if (uint8(GuildGuid >> 8)) - // *data << uint8(GuildGuid^1 >> 8); + *dataBuffer << uint8(proto->InventoryType); + *dataBuffer << uint32(proto->DisplayInfoID); + *dataBuffer << uint32(enchant ? enchant->aura_id : 0); + } + + *dataBuffer << uint32(petFamily); // Pet family + dataBuffer->WriteByteSeq(guildGuid[2]); + *dataBuffer << uint8(0); // List order + *dataBuffer << uint8(hairStyle); // Hair style + dataBuffer->WriteByteSeq(guildGuid[3]); + *dataBuffer << uint32(petDisplayId); // Pet DisplayID + *dataBuffer << uint32(charFlags); // Character flags + *dataBuffer << uint8(hairColor); // Hair color + dataBuffer->WriteByteSeq(guid[4]); + *dataBuffer << uint32(mapId); // Map Id + dataBuffer->WriteByteSeq(guildGuid[5]); + *dataBuffer << float(z); // Z + dataBuffer->WriteByteSeq(guildGuid[6]); + *dataBuffer << uint32(petLevel); // Pet level + dataBuffer->WriteByteSeq(guid[3]); + *dataBuffer << float(y); // Y + *dataBuffer << uint32(customizationFlag); // Character customization flags + *dataBuffer << uint8(facialHair); // Facial hair + dataBuffer->WriteByteSeq(guid[7]); + *dataBuffer << uint8(gender); // Gender + dataBuffer->append(name.c_str(), name.length()); // Name + *dataBuffer << uint8(face); // Face + dataBuffer->WriteByteSeq(guid[0]); + dataBuffer->WriteByteSeq(guid[2]); + dataBuffer->WriteByteSeq(guildGuid[1]); + dataBuffer->WriteByteSeq(guildGuid[7]); + *dataBuffer << float(x); // X + *dataBuffer << uint8(skin); // Skin + *dataBuffer << uint8(plrRace); // Race + *dataBuffer << uint8(level); // Level + dataBuffer->WriteByteSeq(guid[6]); + dataBuffer->WriteByteSeq(guildGuid[4]); + dataBuffer->WriteByteSeq(guildGuid[0]); + dataBuffer->WriteByteSeq(guid[5]); + dataBuffer->WriteByteSeq(guid[1]); + *dataBuffer << uint32(zone); // Zone id return true; } @@ -16496,7 +16481,7 @@ void Player::SendQuestReward(Quest const* quest, uint32 XP, Object* questGiver) sGameEventMgr->HandleQuestComplete(questId); WorldPacket data(SMSG_QUESTGIVER_QUEST_COMPLETE, (4+4+4+4+4)); - data << int8(0x80); // 4.x unknown flag, most common value is 0x80 (it might be a single bit) + data << uint8(0x80); // 4.x unknown flag, most common value is 0x80 (it might be a single bit) if (getLevel() < sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) { @@ -24695,7 +24680,6 @@ void Player::BuildPlayerTalentsInfoData(WorldPacket* data) // find class talent tabs (all players have 3 talent tabs) uint32 const* talentTabIds = GetTalentTabPages(getClass()); - uint32 talentCounts[3] = { 0, 0, 0 }; for (uint8 i = 0; i < MAX_TALENT_TABS; ++i) { diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index e273ba81077..82189bf03e2 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1150,7 +1150,7 @@ class Player : public Unit, public GridObject void Update(uint32 time); - static bool BuildEnumData(PreparedQueryResult result, ByteBuffer* data); + static bool BuildEnumData(PreparedQueryResult result, ByteBuffer* dataBuffer, ByteBuffer* bitBuffer); void SetInWater(bool apply); diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 26a3e7c67ea..d31e1c8316f 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -203,100 +203,42 @@ bool LoginQueryHolder::Initialize() void WorldSession::HandleCharEnum(PreparedQueryResult result) { - WorldPacket data(SMSG_CHAR_ENUM, 270); - - data << uint8(0x80); // 0 causes the client to free memory of charlist - data << uint32(0); // number of characters - data << uint32(0); // unk loop counter + uint32 charCount = 0; + ByteBuffer bitBuffer; + ByteBuffer dataBuffer; + bitBuffer.WriteBits(0, 23); + bitBuffer.WriteBit(1); if (result) { - typedef std::pair Guids; - std::vector guidsVect; - ByteBuffer buffer; _allowedCharsToLogin.clear(); - do - { - uint32 GuidLow = (*result)[0].GetUInt32(); - uint64 GuildGuid = (*result)[13].GetUInt32();//TODO: store as uin64 + charCount = uint32(result->GetRowCount()); + bitBuffer.reserve(24 * charCount / 8); + dataBuffer.reserve(charCount * 381); - guidsVect.push_back(std::make_pair(GuidLow, GuildGuid)); + bitBuffer.WriteBits(charCount, 17); - sLog->outDetail("Loading char guid %u from account %u.", GuidLow, GetAccountId()); + do + { + uint32 guidLow = (*result)[0].GetUInt32(); - if (!Player::BuildEnumData(result, &buffer)) - { - sLog->outError("Building enum data for SMSG_CHAR_ENUM has failed, aborting"); - return; - } - _allowedCharsToLogin.insert(GuidLow); - } - while (result->NextRow()); + sLog->outDetail("Loading char guid %u from account %u.", guidLow, GetAccountId()); - for (std::vector::iterator itr = guidsVect.begin(); itr != guidsVect.end(); ++itr) - { - uint32 GuidLow = (*itr).first; - uint64 GuildGuid = (*itr).second; + Player::BuildEnumData(result, &dataBuffer, &bitBuffer); - uint8 Guid0 = uint8(GuidLow); - uint8 Guid1 = uint8(GuidLow >> 8); - uint8 Guid2 = uint8(GuidLow >> 16); - uint8 Guid3 = uint8(GuidLow >> 24); + _allowedCharsToLogin.insert(guidLow); + } while (result->NextRow()); - for (uint8 i = 0; i < 17; ++i) - { - switch(i) - { - //case 14: - // data.writeBit(1);//unk - // break; - case 11: data.WriteBit(Guid0 ? 1 : 0); break; - case 12: data.WriteBit(Guid1 ? 1 : 0); break; - case 9: data.WriteBit(Guid2 ? 1 : 0); break; - case 8: data.WriteBit(Guid3 ? 1 : 0); break; - /*case 15: - if(uint8(GuildGuid)) - data.writeBit(1); - break; - case 4: - if(uint8(GuildGuid >> 8)) - data.writeBit(1); - break; - case 13: - if(uint8(GuildGuid >> 16)) - data.writeBit(1); - break; - case 2: - if(uint8(GuildGuid >> 24)) - data.writeBit(1); - break;*/ - /*case 0: - if(uint8(GuildGuid >> 32)) - data.writeBit(1); - break; - case 0: - if(uint8(GuildGuid >> 40)) - data.writeBit(1); - break;*/ - /*case 5: - if(uint8(GuildGuid >> 48)) - data.writeBit(1); - break; - case 3: - if(uint8(GuildGuid >> 56)) - data.writeBit(1); - break;*/ - default: - data.WriteBit(0); - break; - } - } - } - data.FlushBits(); - data.append(buffer); - data.put(1, guidsVect.size()); + bitBuffer.FlushBits(); } + else + bitBuffer.WriteBits(0, 17); + + WorldPacket data(SMSG_CHAR_ENUM, 7 + bitBuffer.size() + dataBuffer.size()); + data.append(bitBuffer); + if (charCount) + data.append(dataBuffer); SendPacket(&data); } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index ee28bd59618..f1f0bcc2f5b 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -172,7 +172,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_CHAR_CREATE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharCreateOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_CHAR_CUSTOMIZE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharCustomize ); //DEFINE_OPCODE_HANDLER(CMSG_CHAR_DELETE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharDeleteOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_CHAR_ENUM, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharEnumOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_CHAR_ENUM, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharEnumOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_CHAR_FACTION_CHANGE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharFactionOrRaceChange ); //DEFINE_OPCODE_HANDLER(CMSG_CHAR_RACE_CHANGE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharFactionOrRaceChange ); //DEFINE_OPCODE_HANDLER(CMSG_CHAR_RENAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharRenameOpcode ); @@ -537,7 +537,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_REPAIR_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepairItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_REPOP_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepopRequestOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_REPORT_PVP_AFK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReportPvPAFK ); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_ACCOUNT_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestAccountData ); + DEFINE_OPCODE_HANDLER(CMSG_REQUEST_ACCOUNT_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestAccountData ); //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_HOTFIX, STATUS_AUTHED, PROCESS_INPLACE, &WorldSession::HandleRequestHotfix ); //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PARTY_MEMBER_STATS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestPartyMemberStatsOpcode); //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PET_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestPetInfoOpcode ); @@ -876,7 +876,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_CHAR_CREATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHAR_CUSTOMIZE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHAR_DELETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHAR_ENUM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CHAR_ENUM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHAR_FACTION_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHAR_RENAME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHAT_NOT_IN_PARTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1356,7 +1356,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_TRIGGER_MOVIE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TURN_IN_PETITION_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TUTORIAL_FLAGS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ACCOUNT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ACCOUNT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ACCOUNT_DATA_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_COMBO_POINTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_INSTANCE_ENCOUNTER_UNIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From 6ea13e0080ac75733a9061d5531172a45e823875 Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 9 Jul 2012 20:29:44 +0200 Subject: Tools/Extractors: Corrected merge errors (libmpq was removed) --- src/tools/map_extractor/CMakeLists.txt | 1 - src/tools/vmap4_extractor/CMakeLists.txt | 1 - 2 files changed, 2 deletions(-) (limited to 'src') diff --git a/src/tools/map_extractor/CMakeLists.txt b/src/tools/map_extractor/CMakeLists.txt index 99bdc1feb5f..af66b73827e 100644 --- a/src/tools/map_extractor/CMakeLists.txt +++ b/src/tools/map_extractor/CMakeLists.txt @@ -23,7 +23,6 @@ add_executable(mapextractor ) target_link_libraries(mapextractor - mpq ${BZIP2_LIBRARIES} ${ZLIB_LIBRARIES} storm diff --git a/src/tools/vmap4_extractor/CMakeLists.txt b/src/tools/vmap4_extractor/CMakeLists.txt index 8066b18423a..3f6b2673be2 100644 --- a/src/tools/vmap4_extractor/CMakeLists.txt +++ b/src/tools/vmap4_extractor/CMakeLists.txt @@ -28,7 +28,6 @@ include_directories( add_executable(vmap4extractor ${sources}) target_link_libraries(vmap4extractor - mpq ${BZIP2_LIBRARIES} ${ZLIB_LIBRARIES} storm -- cgit v1.2.3 From 85135512b19fa0ece751afabe84716b787e274c5 Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 9 Jul 2012 21:15:01 +0200 Subject: Buildsystem/Tools: Corrected vmap tool dependencies --- src/tools/vmap4_assembler/CMakeLists.txt | 2 +- src/tools/vmap4_extractor/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/tools/vmap4_assembler/CMakeLists.txt b/src/tools/vmap4_assembler/CMakeLists.txt index e4f57646c49..f0f2e88c471 100644 --- a/src/tools/vmap4_assembler/CMakeLists.txt +++ b/src/tools/vmap4_assembler/CMakeLists.txt @@ -22,7 +22,7 @@ include_directories( add_definitions(-DNO_CORE_FUNCS) add_executable(vmap4assembler VMapAssembler.cpp) -add_dependencies(vmap4assembler mpq) +add_dependencies(vmap4assembler storm) if(CMAKE_SYSTEM_NAME MATCHES "Darwin") set_target_properties(vmap4assembler PROPERTIES LINK_FLAGS "-framework Carbon") diff --git a/src/tools/vmap4_extractor/CMakeLists.txt b/src/tools/vmap4_extractor/CMakeLists.txt index 3f6b2673be2..5a40e89f1ac 100644 --- a/src/tools/vmap4_extractor/CMakeLists.txt +++ b/src/tools/vmap4_extractor/CMakeLists.txt @@ -33,7 +33,7 @@ target_link_libraries(vmap4extractor storm ) -add_dependencies(vmap4extractor mpq) +add_dependencies(vmap4extractor storm) if( UNIX ) install(TARGETS vmap4extractor DESTINATION bin) -- cgit v1.2.3 From d8ce0c88307fe35f2f10270c7cf64d0e0763a8dc Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 10 Jul 2012 18:59:40 +0200 Subject: Core/Objects: Updated UpdateFields --- .../game/Entities/Object/Updates/UpdateFields.h | 1004 ++++++++++---------- src/server/game/Entities/Player/Player.cpp | 290 +++--- src/server/game/Entities/Player/Player.h | 2 +- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 8 +- 4 files changed, 684 insertions(+), 620 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Object/Updates/UpdateFields.h b/src/server/game/Entities/Object/Updates/UpdateFields.h index c0e0582449e..399895860ff 100755 --- a/src/server/game/Entities/Object/Updates/UpdateFields.h +++ b/src/server/game/Entities/Object/Updates/UpdateFields.h @@ -16,532 +16,548 @@ * with this program. If not, see . */ -#ifndef _UPDATEFIELDS_AUTO_H -#define _UPDATEFIELDS_AUTO_H +#ifndef _UPDATEFIELDS_H +#define _UPDATEFIELDS_H -// Auto generated for version 4, 2, 2, 14545 +// Auto generated for version 4, 3, 4, 15595 enum EObjectFields { - OBJECT_FIELD_GUID = 0x0000, // Size: 2, Type: LONG, Flags: PUBLIC - OBJECT_FIELD_DATA = 0x0002, // Size: 2, Type: LONG, Flags: PUBLIC - OBJECT_FIELD_TYPE = 0x0004, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - OBJECT_FIELD_ENTRY = 0x0005, // Size: 1, Type: INT, Flags: PUBLIC - OBJECT_FIELD_SCALE_X = 0x0006, // Size: 1, Type: FLOAT, Flags: PUBLIC - OBJECT_FIELD_PADDING = 0x0007, // Size: 1, Type: INT, Flags: NONE - OBJECT_END = 0x0008, + OBJECT_FIELD_GUID = 0x0000, // Size: 2, Type: LONG, Flags: PUBLIC + OBJECT_FIELD_DATA = 0x0002, // Size: 2, Type: LONG, Flags: PUBLIC + OBJECT_FIELD_TYPE = 0x0004, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + OBJECT_FIELD_ENTRY = 0x0005, // Size: 1, Type: INT, Flags: PUBLIC + OBJECT_FIELD_SCALE_X = 0x0006, // Size: 1, Type: FLOAT, Flags: PUBLIC + OBJECT_FIELD_PADDING = 0x0007, // Size: 1, Type: INT, Flags: NONE + OBJECT_END = 0x0008, }; enum EItemFields { - ITEM_FIELD_OWNER = OBJECT_END + 0x0000, // Size: 2, Type: LONG, Flags: PUBLIC - ITEM_FIELD_CONTAINED = OBJECT_END + 0x0002, // Size: 2, Type: LONG, Flags: PUBLIC - ITEM_FIELD_CREATOR = OBJECT_END + 0x0004, // Size: 2, Type: LONG, Flags: PUBLIC - ITEM_FIELD_GIFTCREATOR = OBJECT_END + 0x0006, // Size: 2, Type: LONG, Flags: PUBLIC - ITEM_FIELD_STACK_COUNT = OBJECT_END + 0x0008, // Size: 1, Type: INT, Flags: OWNER, UNUSED1 - ITEM_FIELD_DURATION = OBJECT_END + 0x0009, // Size: 1, Type: INT, Flags: OWNER, UNUSED1 - ITEM_FIELD_SPELL_CHARGES = OBJECT_END + 0x000A, // Size: 5, Type: INT, Flags: OWNER, UNUSED1 - ITEM_FIELD_FLAGS = OBJECT_END + 0x000F, // Size: 1, Type: INT, Flags: PUBLIC - ITEM_FIELD_ENCHANTMENT_1_1 = OBJECT_END + 0x0010, // Size: 2, Type: INT, Flags: PUBLIC - ITEM_FIELD_ENCHANTMENT_1_3 = OBJECT_END + 0x0012, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - ITEM_FIELD_ENCHANTMENT_2_1 = OBJECT_END + 0x0013, // Size: 2, Type: INT, Flags: PUBLIC - ITEM_FIELD_ENCHANTMENT_2_3 = OBJECT_END + 0x0015, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - ITEM_FIELD_ENCHANTMENT_3_1 = OBJECT_END + 0x0016, // Size: 2, Type: INT, Flags: PUBLIC - ITEM_FIELD_ENCHANTMENT_3_3 = OBJECT_END + 0x0018, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - ITEM_FIELD_ENCHANTMENT_4_1 = OBJECT_END + 0x0019, // Size: 2, Type: INT, Flags: PUBLIC - ITEM_FIELD_ENCHANTMENT_4_3 = OBJECT_END + 0x001B, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - ITEM_FIELD_ENCHANTMENT_5_1 = OBJECT_END + 0x001C, // Size: 2, Type: INT, Flags: PUBLIC - ITEM_FIELD_ENCHANTMENT_5_3 = OBJECT_END + 0x001E, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - ITEM_FIELD_ENCHANTMENT_6_1 = OBJECT_END + 0x001F, // Size: 2, Type: INT, Flags: PUBLIC - ITEM_FIELD_ENCHANTMENT_6_3 = OBJECT_END + 0x0021, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - ITEM_FIELD_ENCHANTMENT_7_1 = OBJECT_END + 0x0022, // Size: 2, Type: INT, Flags: PUBLIC - ITEM_FIELD_ENCHANTMENT_7_3 = OBJECT_END + 0x0024, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - ITEM_FIELD_ENCHANTMENT_8_1 = OBJECT_END + 0x0025, // Size: 2, Type: INT, Flags: PUBLIC - ITEM_FIELD_ENCHANTMENT_8_3 = OBJECT_END + 0x0027, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - ITEM_FIELD_ENCHANTMENT_9_1 = OBJECT_END + 0x0028, // Size: 2, Type: INT, Flags: PUBLIC - ITEM_FIELD_ENCHANTMENT_9_3 = OBJECT_END + 0x002A, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - ITEM_FIELD_ENCHANTMENT_10_1 = OBJECT_END + 0x002B, // Size: 2, Type: INT, Flags: PUBLIC - ITEM_FIELD_ENCHANTMENT_10_3 = OBJECT_END + 0x002D, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - ITEM_FIELD_ENCHANTMENT_11_1 = OBJECT_END + 0x002E, // Size: 2, Type: INT, Flags: PUBLIC - ITEM_FIELD_ENCHANTMENT_11_3 = OBJECT_END + 0x0030, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - ITEM_FIELD_ENCHANTMENT_12_1 = OBJECT_END + 0x0031, // Size: 2, Type: INT, Flags: PUBLIC - ITEM_FIELD_ENCHANTMENT_12_3 = OBJECT_END + 0x0033, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - ITEM_FIELD_ENCHANTMENT_13_1 = OBJECT_END + 0x0034, // Size: 2, Type: INT, Flags: PUBLIC - ITEM_FIELD_ENCHANTMENT_13_3 = OBJECT_END + 0x0036, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - ITEM_FIELD_ENCHANTMENT_14_1 = OBJECT_END + 0x0037, // Size: 2, Type: INT, Flags: PUBLIC - ITEM_FIELD_ENCHANTMENT_14_3 = OBJECT_END + 0x0039, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - ITEM_FIELD_PROPERTY_SEED = OBJECT_END + 0x003A, // Size: 1, Type: INT, Flags: PUBLIC - ITEM_FIELD_RANDOM_PROPERTIES_ID = OBJECT_END + 0x003B, // Size: 1, Type: INT, Flags: PUBLIC - ITEM_FIELD_DURABILITY = OBJECT_END + 0x003C, // Size: 1, Type: INT, Flags: OWNER, UNUSED1 - ITEM_FIELD_MAXDURABILITY = OBJECT_END + 0x003D, // Size: 1, Type: INT, Flags: OWNER, UNUSED1 - ITEM_FIELD_CREATE_PLAYED_TIME = OBJECT_END + 0x003E, // Size: 1, Type: INT, Flags: PUBLIC - ITEM_FIELD_PAD = OBJECT_END + 0x003F, // Size: 1, Type: INT, Flags: NONE - ITEM_END = OBJECT_END + 0x0040, + ITEM_FIELD_OWNER = OBJECT_END + 0x0000, // Size: 2, Type: LONG, Flags: PUBLIC + ITEM_FIELD_CONTAINED = OBJECT_END + 0x0002, // Size: 2, Type: LONG, Flags: PUBLIC + ITEM_FIELD_CREATOR = OBJECT_END + 0x0004, // Size: 2, Type: LONG, Flags: PUBLIC + ITEM_FIELD_GIFTCREATOR = OBJECT_END + 0x0006, // Size: 2, Type: LONG, Flags: PUBLIC + ITEM_FIELD_STACK_COUNT = OBJECT_END + 0x0008, // Size: 1, Type: INT, Flags: OWNER, UNUSED1 + ITEM_FIELD_DURATION = OBJECT_END + 0x0009, // Size: 1, Type: INT, Flags: OWNER, UNUSED1 + ITEM_FIELD_SPELL_CHARGES = OBJECT_END + 0x000A, // Size: 5, Type: INT, Flags: OWNER, UNUSED1 + ITEM_FIELD_FLAGS = OBJECT_END + 0x000F, // Size: 1, Type: INT, Flags: PUBLIC + ITEM_FIELD_ENCHANTMENT_1_1 = OBJECT_END + 0x0010, // Size: 2, Type: INT, Flags: PUBLIC + ITEM_FIELD_ENCHANTMENT_1_3 = OBJECT_END + 0x0012, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + ITEM_FIELD_ENCHANTMENT_2_1 = OBJECT_END + 0x0013, // Size: 2, Type: INT, Flags: PUBLIC + ITEM_FIELD_ENCHANTMENT_2_3 = OBJECT_END + 0x0015, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + ITEM_FIELD_ENCHANTMENT_3_1 = OBJECT_END + 0x0016, // Size: 2, Type: INT, Flags: PUBLIC + ITEM_FIELD_ENCHANTMENT_3_3 = OBJECT_END + 0x0018, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + ITEM_FIELD_ENCHANTMENT_4_1 = OBJECT_END + 0x0019, // Size: 2, Type: INT, Flags: PUBLIC + ITEM_FIELD_ENCHANTMENT_4_3 = OBJECT_END + 0x001B, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + ITEM_FIELD_ENCHANTMENT_5_1 = OBJECT_END + 0x001C, // Size: 2, Type: INT, Flags: PUBLIC + ITEM_FIELD_ENCHANTMENT_5_3 = OBJECT_END + 0x001E, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + ITEM_FIELD_ENCHANTMENT_6_1 = OBJECT_END + 0x001F, // Size: 2, Type: INT, Flags: PUBLIC + ITEM_FIELD_ENCHANTMENT_6_3 = OBJECT_END + 0x0021, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + ITEM_FIELD_ENCHANTMENT_7_1 = OBJECT_END + 0x0022, // Size: 2, Type: INT, Flags: PUBLIC + ITEM_FIELD_ENCHANTMENT_7_3 = OBJECT_END + 0x0024, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + ITEM_FIELD_ENCHANTMENT_8_1 = OBJECT_END + 0x0025, // Size: 2, Type: INT, Flags: PUBLIC + ITEM_FIELD_ENCHANTMENT_8_3 = OBJECT_END + 0x0027, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + ITEM_FIELD_ENCHANTMENT_9_1 = OBJECT_END + 0x0028, // Size: 2, Type: INT, Flags: PUBLIC + ITEM_FIELD_ENCHANTMENT_9_3 = OBJECT_END + 0x002A, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + ITEM_FIELD_ENCHANTMENT_10_1 = OBJECT_END + 0x002B, // Size: 2, Type: INT, Flags: PUBLIC + ITEM_FIELD_ENCHANTMENT_10_3 = OBJECT_END + 0x002D, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + ITEM_FIELD_ENCHANTMENT_11_1 = OBJECT_END + 0x002E, // Size: 2, Type: INT, Flags: PUBLIC + ITEM_FIELD_ENCHANTMENT_11_3 = OBJECT_END + 0x0030, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + ITEM_FIELD_ENCHANTMENT_12_1 = OBJECT_END + 0x0031, // Size: 2, Type: INT, Flags: PUBLIC + ITEM_FIELD_ENCHANTMENT_12_3 = OBJECT_END + 0x0033, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + ITEM_FIELD_ENCHANTMENT_13_1 = OBJECT_END + 0x0034, // Size: 2, Type: INT, Flags: PUBLIC + ITEM_FIELD_ENCHANTMENT_13_3 = OBJECT_END + 0x0036, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + ITEM_FIELD_ENCHANTMENT_14_1 = OBJECT_END + 0x0037, // Size: 2, Type: INT, Flags: PUBLIC + ITEM_FIELD_ENCHANTMENT_14_3 = OBJECT_END + 0x0039, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + ITEM_FIELD_ENCHANTMENT_15_1 = OBJECT_END + 0x003A, // Size: 2, Type: INT, Flags: PUBLIC + ITEM_FIELD_ENCHANTMENT_15_3 = OBJECT_END + 0x003C, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + ITEM_FIELD_PROPERTY_SEED = OBJECT_END + 0x003D, // Size: 1, Type: INT, Flags: PUBLIC + ITEM_FIELD_RANDOM_PROPERTIES_ID = OBJECT_END + 0x003E, // Size: 1, Type: INT, Flags: PUBLIC + ITEM_FIELD_DURABILITY = OBJECT_END + 0x003F, // Size: 1, Type: INT, Flags: OWNER, UNUSED1 + ITEM_FIELD_MAXDURABILITY = OBJECT_END + 0x0040, // Size: 1, Type: INT, Flags: OWNER, UNUSED1 + ITEM_FIELD_CREATE_PLAYED_TIME = OBJECT_END + 0x0041, // Size: 1, Type: INT, Flags: PUBLIC + ITEM_END = OBJECT_END + 0x0042, }; enum EContainerFields { - CONTAINER_FIELD_NUM_SLOTS = ITEM_END + 0x0000, // Size: 1, Type: INT, Flags: PUBLIC - CONTAINER_ALIGN_PAD = ITEM_END + 0x0001, // Size: 1, Type: BYTES, Flags: NONE - CONTAINER_FIELD_SLOT_1 = ITEM_END + 0x0002, // Size: 72, Type: LONG, Flags: PUBLIC - CONTAINER_END = ITEM_END + 0x004A, + CONTAINER_FIELD_NUM_SLOTS = ITEM_END + 0x0000, // Size: 1, Type: INT, Flags: PUBLIC + CONTAINER_ALIGN_PAD = ITEM_END + 0x0001, // Size: 1, Type: BYTES, Flags: NONE + CONTAINER_FIELD_SLOT_1 = ITEM_END + 0x0002, // Size: 72, Type: LONG, Flags: PUBLIC + CONTAINER_END = ITEM_END + 0x004A, }; enum EUnitFields { - UNIT_FIELD_CHARM = OBJECT_END + 0x0000, // Size: 2, Type: LONG, Flags: PUBLIC - UNIT_FIELD_SUMMON = OBJECT_END + 0x0002, // Size: 2, Type: LONG, Flags: PUBLIC - UNIT_FIELD_CRITTER = OBJECT_END + 0x0004, // Size: 2, Type: LONG, Flags: PRIVATE - UNIT_FIELD_CHARMEDBY = OBJECT_END + 0x0006, // Size: 2, Type: LONG, Flags: PUBLIC - UNIT_FIELD_SUMMONEDBY = OBJECT_END + 0x0008, // Size: 2, Type: LONG, Flags: PUBLIC - UNIT_FIELD_CREATEDBY = OBJECT_END + 0x000A, // Size: 2, Type: LONG, Flags: PUBLIC - UNIT_FIELD_TARGET = OBJECT_END + 0x000C, // Size: 2, Type: LONG, Flags: PUBLIC - UNIT_FIELD_CHANNEL_OBJECT = OBJECT_END + 0x000E, // Size: 2, Type: LONG, Flags: PUBLIC - UNIT_CHANNEL_SPELL = OBJECT_END + 0x0010, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_BYTES_0 = OBJECT_END + 0x0011, // Size: 1, Type: BYTES, Flags: PUBLIC - UNIT_FIELD_HEALTH = OBJECT_END + 0x0012, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_POWER1 = OBJECT_END + 0x0013, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_POWER2 = OBJECT_END + 0x0014, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_POWER3 = OBJECT_END + 0x0015, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_POWER4 = OBJECT_END + 0x0016, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_POWER5 = OBJECT_END + 0x0017, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_MAXHEALTH = OBJECT_END + 0x0018, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_MAXPOWER1 = OBJECT_END + 0x0019, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_MAXPOWER2 = OBJECT_END + 0x001A, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_MAXPOWER3 = OBJECT_END + 0x001B, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_MAXPOWER4 = OBJECT_END + 0x001C, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_MAXPOWER5 = OBJECT_END + 0x001D, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER = OBJECT_END + 0x001E, // Size: 5, Type: FLOAT, Flags: PRIVATE, OWNER, PARTY_MEMBER + UNIT_FIELD_CHARM = OBJECT_END + 0x0000, // Size: 2, Type: LONG, Flags: PUBLIC + UNIT_FIELD_SUMMON = OBJECT_END + 0x0002, // Size: 2, Type: LONG, Flags: PUBLIC + UNIT_FIELD_CRITTER = OBJECT_END + 0x0004, // Size: 2, Type: LONG, Flags: PRIVATE + UNIT_FIELD_CHARMEDBY = OBJECT_END + 0x0006, // Size: 2, Type: LONG, Flags: PUBLIC + UNIT_FIELD_SUMMONEDBY = OBJECT_END + 0x0008, // Size: 2, Type: LONG, Flags: PUBLIC + UNIT_FIELD_CREATEDBY = OBJECT_END + 0x000A, // Size: 2, Type: LONG, Flags: PUBLIC + UNIT_FIELD_TARGET = OBJECT_END + 0x000C, // Size: 2, Type: LONG, Flags: PUBLIC + UNIT_FIELD_CHANNEL_OBJECT = OBJECT_END + 0x000E, // Size: 2, Type: LONG, Flags: PUBLIC + UNIT_CHANNEL_SPELL = OBJECT_END + 0x0010, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_BYTES_0 = OBJECT_END + 0x0011, // Size: 1, Type: BYTES, Flags: PUBLIC + UNIT_FIELD_HEALTH = OBJECT_END + 0x0012, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_POWER1 = OBJECT_END + 0x0013, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_POWER2 = OBJECT_END + 0x0014, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_POWER3 = OBJECT_END + 0x0015, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_POWER4 = OBJECT_END + 0x0016, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_POWER5 = OBJECT_END + 0x0017, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_MAXHEALTH = OBJECT_END + 0x0018, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_MAXPOWER1 = OBJECT_END + 0x0019, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_MAXPOWER2 = OBJECT_END + 0x001A, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_MAXPOWER3 = OBJECT_END + 0x001B, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_MAXPOWER4 = OBJECT_END + 0x001C, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_MAXPOWER5 = OBJECT_END + 0x001D, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER = OBJECT_END + 0x001E, // Size: 5, Type: FLOAT, Flags: PRIVATE, OWNER, PARTY_MEMBER UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER = OBJECT_END + 0x0023, // Size: 5, Type: FLOAT, Flags: PRIVATE, OWNER, PARTY_MEMBER - UNIT_FIELD_LEVEL = OBJECT_END + 0x0028, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_FACTIONTEMPLATE = OBJECT_END + 0x0029, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_VIRTUAL_ITEM_SLOT_ID = OBJECT_END + 0x002A, // Size: 3, Type: INT, Flags: PUBLIC - UNIT_FIELD_FLAGS = OBJECT_END + 0x002D, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_FLAGS_2 = OBJECT_END + 0x002E, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_AURASTATE = OBJECT_END + 0x002F, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_BASEATTACKTIME = OBJECT_END + 0x0030, // Size: 2, Type: INT, Flags: PUBLIC - UNIT_FIELD_RANGEDATTACKTIME = OBJECT_END + 0x0032, // Size: 1, Type: INT, Flags: PRIVATE - UNIT_FIELD_BOUNDINGRADIUS = OBJECT_END + 0x0033, // Size: 1, Type: FLOAT, Flags: PUBLIC - UNIT_FIELD_COMBATREACH = OBJECT_END + 0x0034, // Size: 1, Type: FLOAT, Flags: PUBLIC - UNIT_FIELD_DISPLAYID = OBJECT_END + 0x0035, // Size: 1, Type: INT, Flags: UNUSED2 - UNIT_FIELD_NATIVEDISPLAYID = OBJECT_END + 0x0036, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_MOUNTDISPLAYID = OBJECT_END + 0x0037, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_MINDAMAGE = OBJECT_END + 0x0038, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER, ITEM_OWNER - UNIT_FIELD_MAXDAMAGE = OBJECT_END + 0x0039, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER, ITEM_OWNER - UNIT_FIELD_MINOFFHANDDAMAGE = OBJECT_END + 0x003A, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER, ITEM_OWNER - UNIT_FIELD_MAXOFFHANDDAMAGE = OBJECT_END + 0x003B, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER, ITEM_OWNER - UNIT_FIELD_BYTES_1 = OBJECT_END + 0x003C, // Size: 1, Type: BYTES, Flags: PUBLIC - UNIT_FIELD_PETNUMBER = OBJECT_END + 0x003D, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_PET_NAME_TIMESTAMP = OBJECT_END + 0x003E, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_PETEXPERIENCE = OBJECT_END + 0x003F, // Size: 1, Type: INT, Flags: OWNER - UNIT_FIELD_PETNEXTLEVELEXP = OBJECT_END + 0x0040, // Size: 1, Type: INT, Flags: OWNER - UNIT_DYNAMIC_FLAGS = OBJECT_END + 0x0041, // Size: 1, Type: INT, Flags: UNUSED2 - UNIT_MOD_CAST_SPEED = OBJECT_END + 0x0042, // Size: 1, Type: FLOAT, Flags: PUBLIC - UNIT_MOD_CAST_HASTE = OBJECT_END + 0x0043, // Size: 1, Type: FLOAT, Flags: PUBLIC - UNIT_CREATED_BY_SPELL = OBJECT_END + 0x0044, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_NPC_FLAGS = OBJECT_END + 0x0045, // Size: 1, Type: INT, Flags: UNUSED2 - UNIT_NPC_EMOTESTATE = OBJECT_END + 0x0046, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_STAT0 = OBJECT_END + 0x0047, // Size: 1, Type: INT, Flags: PRIVATE, OWNER - UNIT_FIELD_STAT1 = OBJECT_END + 0x0048, // Size: 1, Type: INT, Flags: PRIVATE, OWNER - UNIT_FIELD_STAT2 = OBJECT_END + 0x0049, // Size: 1, Type: INT, Flags: PRIVATE, OWNER - UNIT_FIELD_STAT3 = OBJECT_END + 0x004A, // Size: 1, Type: INT, Flags: PRIVATE, OWNER - UNIT_FIELD_STAT4 = OBJECT_END + 0x004B, // Size: 1, Type: INT, Flags: PRIVATE, OWNER - UNIT_FIELD_POSSTAT0 = OBJECT_END + 0x004C, // Size: 1, Type: INT, Flags: PRIVATE, OWNER - UNIT_FIELD_POSSTAT1 = OBJECT_END + 0x004D, // Size: 1, Type: INT, Flags: PRIVATE, OWNER - UNIT_FIELD_POSSTAT2 = OBJECT_END + 0x004E, // Size: 1, Type: INT, Flags: PRIVATE, OWNER - UNIT_FIELD_POSSTAT3 = OBJECT_END + 0x004F, // Size: 1, Type: INT, Flags: PRIVATE, OWNER - UNIT_FIELD_POSSTAT4 = OBJECT_END + 0x0050, // Size: 1, Type: INT, Flags: PRIVATE, OWNER - UNIT_FIELD_NEGSTAT0 = OBJECT_END + 0x0051, // Size: 1, Type: INT, Flags: PRIVATE, OWNER - UNIT_FIELD_NEGSTAT1 = OBJECT_END + 0x0052, // Size: 1, Type: INT, Flags: PRIVATE, OWNER - UNIT_FIELD_NEGSTAT2 = OBJECT_END + 0x0053, // Size: 1, Type: INT, Flags: PRIVATE, OWNER - UNIT_FIELD_NEGSTAT3 = OBJECT_END + 0x0054, // Size: 1, Type: INT, Flags: PRIVATE, OWNER - UNIT_FIELD_NEGSTAT4 = OBJECT_END + 0x0055, // Size: 1, Type: INT, Flags: PRIVATE, OWNER - UNIT_FIELD_RESISTANCES = OBJECT_END + 0x0056, // Size: 7, Type: INT, Flags: PRIVATE, OWNER, ITEM_OWNER - UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE = OBJECT_END + 0x005D, // Size: 7, Type: INT, Flags: PRIVATE, OWNER - UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE = OBJECT_END + 0x0064, // Size: 7, Type: INT, Flags: PRIVATE, OWNER - UNIT_FIELD_BASE_MANA = OBJECT_END + 0x006B, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_BASE_HEALTH = OBJECT_END + 0x006C, // Size: 1, Type: INT, Flags: PRIVATE, OWNER - UNIT_FIELD_BYTES_2 = OBJECT_END + 0x006D, // Size: 1, Type: BYTES, Flags: PUBLIC - UNIT_FIELD_ATTACK_POWER = OBJECT_END + 0x006E, // Size: 1, Type: INT, Flags: PRIVATE, OWNER - UNIT_FIELD_ATTACK_POWER_MOD_POS = OBJECT_END + 0x006F, // Size: 1, Type: INT, Flags: PRIVATE, OWNER - UNIT_FIELD_ATTACK_POWER_MOD_NEG = OBJECT_END + 0x0070, // Size: 1, Type: INT, Flags: PRIVATE, OWNER - UNIT_FIELD_ATTACK_POWER_MULTIPLIER = OBJECT_END + 0x0071, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER - UNIT_FIELD_RANGED_ATTACK_POWER = OBJECT_END + 0x0072, // Size: 1, Type: INT, Flags: PRIVATE, OWNER - UNIT_FIELD_RANGED_ATTACK_POWER_MOD_POS = OBJECT_END + 0x0073, // Size: 1, Type: INT, Flags: PRIVATE, OWNER - UNIT_FIELD_RANGED_ATTACK_POWER_MOD_NEG = OBJECT_END + 0x0074, // Size: 1, Type: INT, Flags: PRIVATE, OWNER - UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER = OBJECT_END + 0x0075, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER - UNIT_FIELD_MINRANGEDDAMAGE = OBJECT_END + 0x0076, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER - UNIT_FIELD_MAXRANGEDDAMAGE = OBJECT_END + 0x0077, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER - UNIT_FIELD_POWER_COST_MODIFIER = OBJECT_END + 0x0078, // Size: 7, Type: INT, Flags: PRIVATE, OWNER - UNIT_FIELD_POWER_COST_MULTIPLIER = OBJECT_END + 0x007F, // Size: 7, Type: FLOAT, Flags: PRIVATE, OWNER - UNIT_FIELD_MAXHEALTHMODIFIER = OBJECT_END + 0x0086, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER - UNIT_FIELD_HOVERHEIGHT = OBJECT_END + 0x0087, // Size: 1, Type: FLOAT, Flags: PUBLIC - UNIT_FIELD_MAXITEMLEVEL = OBJECT_END + 0x0088, // Size: 1, Type: INT, Flags: PUBLIC - UNIT_FIELD_PADDING = OBJECT_END + 0x0089, // Size: 1, Type: INT, Flags: NONE - UNIT_END = OBJECT_END + 0x008A, + UNIT_FIELD_LEVEL = OBJECT_END + 0x0028, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_FACTIONTEMPLATE = OBJECT_END + 0x0029, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_VIRTUAL_ITEM_SLOT_ID = OBJECT_END + 0x002A, // Size: 3, Type: INT, Flags: PUBLIC + UNIT_FIELD_FLAGS = OBJECT_END + 0x002D, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_FLAGS_2 = OBJECT_END + 0x002E, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_AURASTATE = OBJECT_END + 0x002F, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_BASEATTACKTIME = OBJECT_END + 0x0030, // Size: 2, Type: INT, Flags: PUBLIC + UNIT_FIELD_RANGEDATTACKTIME = OBJECT_END + 0x0032, // Size: 1, Type: INT, Flags: PRIVATE + UNIT_FIELD_BOUNDINGRADIUS = OBJECT_END + 0x0033, // Size: 1, Type: FLOAT, Flags: PUBLIC + UNIT_FIELD_COMBATREACH = OBJECT_END + 0x0034, // Size: 1, Type: FLOAT, Flags: PUBLIC + UNIT_FIELD_DISPLAYID = OBJECT_END + 0x0035, // Size: 1, Type: INT, Flags: UNUSED2 + UNIT_FIELD_NATIVEDISPLAYID = OBJECT_END + 0x0036, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_MOUNTDISPLAYID = OBJECT_END + 0x0037, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_MINDAMAGE = OBJECT_END + 0x0038, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER, ITEM_OWNER + UNIT_FIELD_MAXDAMAGE = OBJECT_END + 0x0039, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER, ITEM_OWNER + UNIT_FIELD_MINOFFHANDDAMAGE = OBJECT_END + 0x003A, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER, ITEM_OWNER + UNIT_FIELD_MAXOFFHANDDAMAGE = OBJECT_END + 0x003B, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER, ITEM_OWNER + UNIT_FIELD_BYTES_1 = OBJECT_END + 0x003C, // Size: 1, Type: BYTES, Flags: PUBLIC + UNIT_FIELD_PETNUMBER = OBJECT_END + 0x003D, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_PET_NAME_TIMESTAMP = OBJECT_END + 0x003E, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_PETEXPERIENCE = OBJECT_END + 0x003F, // Size: 1, Type: INT, Flags: OWNER + UNIT_FIELD_PETNEXTLEVELEXP = OBJECT_END + 0x0040, // Size: 1, Type: INT, Flags: OWNER + UNIT_DYNAMIC_FLAGS = OBJECT_END + 0x0041, // Size: 1, Type: INT, Flags: UNUSED2 + UNIT_MOD_CAST_SPEED = OBJECT_END + 0x0042, // Size: 1, Type: FLOAT, Flags: PUBLIC + UNIT_MOD_CAST_HASTE = OBJECT_END + 0x0043, // Size: 1, Type: FLOAT, Flags: PUBLIC + UNIT_CREATED_BY_SPELL = OBJECT_END + 0x0044, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_NPC_FLAGS = OBJECT_END + 0x0045, // Size: 1, Type: INT, Flags: UNUSED2 + UNIT_NPC_EMOTESTATE = OBJECT_END + 0x0046, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_STAT0 = OBJECT_END + 0x0047, // Size: 1, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_STAT1 = OBJECT_END + 0x0048, // Size: 1, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_STAT2 = OBJECT_END + 0x0049, // Size: 1, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_STAT3 = OBJECT_END + 0x004A, // Size: 1, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_STAT4 = OBJECT_END + 0x004B, // Size: 1, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_POSSTAT0 = OBJECT_END + 0x004C, // Size: 1, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_POSSTAT1 = OBJECT_END + 0x004D, // Size: 1, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_POSSTAT2 = OBJECT_END + 0x004E, // Size: 1, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_POSSTAT3 = OBJECT_END + 0x004F, // Size: 1, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_POSSTAT4 = OBJECT_END + 0x0050, // Size: 1, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_NEGSTAT0 = OBJECT_END + 0x0051, // Size: 1, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_NEGSTAT1 = OBJECT_END + 0x0052, // Size: 1, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_NEGSTAT2 = OBJECT_END + 0x0053, // Size: 1, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_NEGSTAT3 = OBJECT_END + 0x0054, // Size: 1, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_NEGSTAT4 = OBJECT_END + 0x0055, // Size: 1, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_RESISTANCES = OBJECT_END + 0x0056, // Size: 7, Type: INT, Flags: PRIVATE, OWNER, ITEM_OWNER + UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE = OBJECT_END + 0x005D, // Size: 7, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE = OBJECT_END + 0x0064, // Size: 7, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_BASE_MANA = OBJECT_END + 0x006B, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_BASE_HEALTH = OBJECT_END + 0x006C, // Size: 1, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_BYTES_2 = OBJECT_END + 0x006D, // Size: 1, Type: BYTES, Flags: PUBLIC + UNIT_FIELD_ATTACK_POWER = OBJECT_END + 0x006E, // Size: 1, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_ATTACK_POWER_MOD_POS = OBJECT_END + 0x006F, // Size: 1, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_ATTACK_POWER_MOD_NEG = OBJECT_END + 0x0070, // Size: 1, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_ATTACK_POWER_MULTIPLIER = OBJECT_END + 0x0071, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER + UNIT_FIELD_RANGED_ATTACK_POWER = OBJECT_END + 0x0072, // Size: 1, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_RANGED_ATTACK_POWER_MOD_POS = OBJECT_END + 0x0073, // Size: 1, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_RANGED_ATTACK_POWER_MOD_NEG = OBJECT_END + 0x0074, // Size: 1, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER = OBJECT_END + 0x0075, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER + UNIT_FIELD_MINRANGEDDAMAGE = OBJECT_END + 0x0076, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER + UNIT_FIELD_MAXRANGEDDAMAGE = OBJECT_END + 0x0077, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER + UNIT_FIELD_POWER_COST_MODIFIER = OBJECT_END + 0x0078, // Size: 7, Type: INT, Flags: PRIVATE, OWNER + UNIT_FIELD_POWER_COST_MULTIPLIER = OBJECT_END + 0x007F, // Size: 7, Type: FLOAT, Flags: PRIVATE, OWNER + UNIT_FIELD_MAXHEALTHMODIFIER = OBJECT_END + 0x0086, // Size: 1, Type: FLOAT, Flags: PRIVATE, OWNER + UNIT_FIELD_HOVERHEIGHT = OBJECT_END + 0x0087, // Size: 1, Type: FLOAT, Flags: PUBLIC + UNIT_FIELD_MAXITEMLEVEL = OBJECT_END + 0x0088, // Size: 1, Type: INT, Flags: PUBLIC + UNIT_FIELD_PADDING = OBJECT_END + 0x0089, // Size: 1, Type: INT, Flags: NONE + UNIT_END = OBJECT_END + 0x008A, }; enum EPlayerFields { - PLAYER_DUEL_ARBITER = UNIT_END + 0x0000, // Size: 2, Type: LONG, Flags: PUBLIC - PLAYER_FLAGS = UNIT_END + 0x0002, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_GUILDRANK = UNIT_END + 0x0003, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_GUILDDELETE_DATE = UNIT_END + 0x0004, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_GUILDLEVEL = UNIT_END + 0x0005, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_BYTES = UNIT_END + 0x0006, // Size: 1, Type: BYTES, Flags: PUBLIC - PLAYER_BYTES_2 = UNIT_END + 0x0007, // Size: 1, Type: BYTES, Flags: PUBLIC - PLAYER_BYTES_3 = UNIT_END + 0x0008, // Size: 1, Type: BYTES, Flags: PUBLIC - PLAYER_DUEL_TEAM = UNIT_END + 0x0009, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_GUILD_TIMESTAMP = UNIT_END + 0x000A, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_QUEST_LOG_1_1 = UNIT_END + 0x000B, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_1_2 = UNIT_END + 0x000C, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_1_3 = UNIT_END + 0x000D, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_1_4 = UNIT_END + 0x000F, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_2_1 = UNIT_END + 0x0010, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_2_2 = UNIT_END + 0x0011, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_2_3 = UNIT_END + 0x0012, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_2_5 = UNIT_END + 0x0014, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_3_1 = UNIT_END + 0x0015, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_3_2 = UNIT_END + 0x0016, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_3_3 = UNIT_END + 0x0017, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_3_5 = UNIT_END + 0x0019, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_4_1 = UNIT_END + 0x001A, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_4_2 = UNIT_END + 0x001B, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_4_3 = UNIT_END + 0x001C, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_4_5 = UNIT_END + 0x001E, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_5_1 = UNIT_END + 0x001F, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_5_2 = UNIT_END + 0x0020, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_5_3 = UNIT_END + 0x0021, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_5_5 = UNIT_END + 0x0023, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_6_1 = UNIT_END + 0x0024, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_6_2 = UNIT_END + 0x0025, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_6_3 = UNIT_END + 0x0026, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_6_5 = UNIT_END + 0x0028, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_7_1 = UNIT_END + 0x0029, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_7_2 = UNIT_END + 0x002A, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_7_3 = UNIT_END + 0x002B, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_7_5 = UNIT_END + 0x002D, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_8_1 = UNIT_END + 0x002E, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_8_2 = UNIT_END + 0x002F, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_8_3 = UNIT_END + 0x0030, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_8_5 = UNIT_END + 0x0032, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_9_1 = UNIT_END + 0x0033, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_9_2 = UNIT_END + 0x0034, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_9_3 = UNIT_END + 0x0035, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_9_5 = UNIT_END + 0x0037, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_10_1 = UNIT_END + 0x0038, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_10_2 = UNIT_END + 0x0039, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_10_3 = UNIT_END + 0x003A, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_10_5 = UNIT_END + 0x003C, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_11_1 = UNIT_END + 0x003D, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_11_2 = UNIT_END + 0x003E, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_11_3 = UNIT_END + 0x003F, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_11_5 = UNIT_END + 0x0041, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_12_1 = UNIT_END + 0x0042, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_12_2 = UNIT_END + 0x0043, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_12_3 = UNIT_END + 0x0044, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_12_5 = UNIT_END + 0x0046, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_13_1 = UNIT_END + 0x0047, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_13_2 = UNIT_END + 0x0048, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_13_3 = UNIT_END + 0x0049, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_13_5 = UNIT_END + 0x004B, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_14_1 = UNIT_END + 0x004C, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_14_2 = UNIT_END + 0x004D, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_14_3 = UNIT_END + 0x004E, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_14_5 = UNIT_END + 0x0050, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_15_1 = UNIT_END + 0x0051, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_15_2 = UNIT_END + 0x0052, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_15_3 = UNIT_END + 0x0053, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_15_5 = UNIT_END + 0x0055, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_16_1 = UNIT_END + 0x0056, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_16_2 = UNIT_END + 0x0057, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_16_3 = UNIT_END + 0x0058, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_16_5 = UNIT_END + 0x005A, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_17_1 = UNIT_END + 0x005B, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_17_2 = UNIT_END + 0x005C, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_17_3 = UNIT_END + 0x005D, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_17_5 = UNIT_END + 0x005F, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_18_1 = UNIT_END + 0x0060, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_18_2 = UNIT_END + 0x0061, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_18_3 = UNIT_END + 0x0062, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_18_5 = UNIT_END + 0x0064, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_19_1 = UNIT_END + 0x0065, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_19_2 = UNIT_END + 0x0066, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_19_3 = UNIT_END + 0x0067, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_19_5 = UNIT_END + 0x0069, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_20_1 = UNIT_END + 0x006A, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_20_2 = UNIT_END + 0x006B, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_20_3 = UNIT_END + 0x006C, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_20_5 = UNIT_END + 0x006E, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_21_1 = UNIT_END + 0x006F, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_21_2 = UNIT_END + 0x0070, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_21_3 = UNIT_END + 0x0071, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_21_5 = UNIT_END + 0x0073, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_22_1 = UNIT_END + 0x0074, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_22_2 = UNIT_END + 0x0075, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_22_3 = UNIT_END + 0x0076, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_22_5 = UNIT_END + 0x0078, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_23_1 = UNIT_END + 0x0079, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_23_2 = UNIT_END + 0x007A, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_23_3 = UNIT_END + 0x007B, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_23_5 = UNIT_END + 0x007D, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_24_1 = UNIT_END + 0x007E, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_24_2 = UNIT_END + 0x007F, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_24_3 = UNIT_END + 0x0080, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_24_5 = UNIT_END + 0x0082, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_25_1 = UNIT_END + 0x0083, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_25_2 = UNIT_END + 0x0084, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_25_3 = UNIT_END + 0x0085, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_25_5 = UNIT_END + 0x0087, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_26_1 = UNIT_END + 0x0088, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_26_2 = UNIT_END + 0x0089, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_26_3 = UNIT_END + 0x008A, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_26_5 = UNIT_END + 0x008C, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_27_1 = UNIT_END + 0x008D, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_27_2 = UNIT_END + 0x008E, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_27_3 = UNIT_END + 0x008F, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_27_5 = UNIT_END + 0x0091, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_28_1 = UNIT_END + 0x0092, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_28_2 = UNIT_END + 0x0093, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_28_3 = UNIT_END + 0x0094, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_28_5 = UNIT_END + 0x0096, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_29_1 = UNIT_END + 0x0097, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_29_2 = UNIT_END + 0x0098, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_29_3 = UNIT_END + 0x0099, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_29_5 = UNIT_END + 0x009B, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_30_1 = UNIT_END + 0x009C, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_30_2 = UNIT_END + 0x009D, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_30_3 = UNIT_END + 0x009E, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_30_5 = UNIT_END + 0x00A0, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_31_1 = UNIT_END + 0x00A1, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_31_2 = UNIT_END + 0x00A2, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_31_3 = UNIT_END + 0x00A3, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_31_5 = UNIT_END + 0x00A5, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_32_1 = UNIT_END + 0x00A6, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_32_2 = UNIT_END + 0x00A7, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_32_3 = UNIT_END + 0x00A8, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_32_5 = UNIT_END + 0x00AA, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_33_1 = UNIT_END + 0x00AB, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_33_2 = UNIT_END + 0x00AC, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_33_3 = UNIT_END + 0x00AD, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_33_5 = UNIT_END + 0x00AF, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_34_1 = UNIT_END + 0x00B0, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_34_2 = UNIT_END + 0x00B1, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_34_3 = UNIT_END + 0x00B2, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_34_5 = UNIT_END + 0x00B4, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_35_1 = UNIT_END + 0x00B5, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_35_2 = UNIT_END + 0x00B6, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_35_3 = UNIT_END + 0x00B7, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_35_5 = UNIT_END + 0x00B9, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_36_1 = UNIT_END + 0x00BA, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_36_2 = UNIT_END + 0x00BB, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_36_3 = UNIT_END + 0x00BC, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_36_5 = UNIT_END + 0x00BE, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_37_1 = UNIT_END + 0x00BF, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_37_2 = UNIT_END + 0x00C0, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_37_3 = UNIT_END + 0x00C1, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_37_5 = UNIT_END + 0x00C3, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_38_1 = UNIT_END + 0x00C4, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_38_2 = UNIT_END + 0x00C5, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_38_3 = UNIT_END + 0x00C6, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_38_5 = UNIT_END + 0x00C8, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_39_1 = UNIT_END + 0x00C9, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_39_2 = UNIT_END + 0x00CA, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_39_3 = UNIT_END + 0x00CB, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_39_5 = UNIT_END + 0x00CD, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_40_1 = UNIT_END + 0x00CE, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_40_2 = UNIT_END + 0x00CF, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_40_3 = UNIT_END + 0x00D0, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_40_5 = UNIT_END + 0x00D2, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_41_1 = UNIT_END + 0x00D3, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_41_2 = UNIT_END + 0x00D4, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_41_3 = UNIT_END + 0x00D5, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_41_5 = UNIT_END + 0x00D7, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_42_1 = UNIT_END + 0x00D8, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_42_2 = UNIT_END + 0x00D9, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_42_3 = UNIT_END + 0x00DA, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_42_5 = UNIT_END + 0x00DC, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_43_1 = UNIT_END + 0x00DD, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_43_2 = UNIT_END + 0x00DE, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_43_3 = UNIT_END + 0x00DF, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_43_5 = UNIT_END + 0x00E1, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_44_1 = UNIT_END + 0x00E2, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_44_2 = UNIT_END + 0x00E3, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_44_3 = UNIT_END + 0x00E4, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_44_5 = UNIT_END + 0x00E6, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_45_1 = UNIT_END + 0x00E7, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_45_2 = UNIT_END + 0x00E8, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_45_3 = UNIT_END + 0x00E9, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_45_5 = UNIT_END + 0x00EB, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_46_1 = UNIT_END + 0x00EC, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_46_2 = UNIT_END + 0x00ED, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_46_3 = UNIT_END + 0x00EE, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_46_5 = UNIT_END + 0x00F0, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_47_1 = UNIT_END + 0x00F1, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_47_2 = UNIT_END + 0x00F2, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_47_3 = UNIT_END + 0x00F3, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_47_5 = UNIT_END + 0x00F5, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_48_1 = UNIT_END + 0x00F6, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_48_2 = UNIT_END + 0x00F7, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_48_3 = UNIT_END + 0x00F8, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_48_5 = UNIT_END + 0x00FA, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_49_1 = UNIT_END + 0x00FB, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_49_2 = UNIT_END + 0x00FC, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_49_3 = UNIT_END + 0x00FD, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_49_5 = UNIT_END + 0x00FF, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_50_1 = UNIT_END + 0x0100, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_50_2 = UNIT_END + 0x0101, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_50_3 = UNIT_END + 0x0102, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER - PLAYER_QUEST_LOG_50_5 = UNIT_END + 0x0104, // Size: 1, Type: INT, Flags: PARTY_LEADER - PLAYER_VISIBLE_ITEM_1_ENTRYID = UNIT_END + 0x0105, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_1_ENCHANTMENT = UNIT_END + 0x0106, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_2_ENTRYID = UNIT_END + 0x0107, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_2_ENCHANTMENT = UNIT_END + 0x0108, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_3_ENTRYID = UNIT_END + 0x0109, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_3_ENCHANTMENT = UNIT_END + 0x010A, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_4_ENTRYID = UNIT_END + 0x010B, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_4_ENCHANTMENT = UNIT_END + 0x010C, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_5_ENTRYID = UNIT_END + 0x010D, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_5_ENCHANTMENT = UNIT_END + 0x010E, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_6_ENTRYID = UNIT_END + 0x010F, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_6_ENCHANTMENT = UNIT_END + 0x0110, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_7_ENTRYID = UNIT_END + 0x0111, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_7_ENCHANTMENT = UNIT_END + 0x0112, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_8_ENTRYID = UNIT_END + 0x0113, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_8_ENCHANTMENT = UNIT_END + 0x0114, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_9_ENTRYID = UNIT_END + 0x0115, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_9_ENCHANTMENT = UNIT_END + 0x0116, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_10_ENTRYID = UNIT_END + 0x0117, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_10_ENCHANTMENT = UNIT_END + 0x0118, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_11_ENTRYID = UNIT_END + 0x0119, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_11_ENCHANTMENT = UNIT_END + 0x011A, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_12_ENTRYID = UNIT_END + 0x011B, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_12_ENCHANTMENT = UNIT_END + 0x011C, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_13_ENTRYID = UNIT_END + 0x011D, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_13_ENCHANTMENT = UNIT_END + 0x011E, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_14_ENTRYID = UNIT_END + 0x011F, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_14_ENCHANTMENT = UNIT_END + 0x0120, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_15_ENTRYID = UNIT_END + 0x0121, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_15_ENCHANTMENT = UNIT_END + 0x0122, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_16_ENTRYID = UNIT_END + 0x0123, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_16_ENCHANTMENT = UNIT_END + 0x0124, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_17_ENTRYID = UNIT_END + 0x0125, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_17_ENCHANTMENT = UNIT_END + 0x0126, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_18_ENTRYID = UNIT_END + 0x0127, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_18_ENCHANTMENT = UNIT_END + 0x0128, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_19_ENTRYID = UNIT_END + 0x0129, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_VISIBLE_ITEM_19_ENCHANTMENT = UNIT_END + 0x012A, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC - PLAYER_CHOSEN_TITLE = UNIT_END + 0x012B, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_FAKE_INEBRIATION = UNIT_END + 0x012C, // Size: 1, Type: INT, Flags: PUBLIC - PLAYER_FIELD_PAD_0 = UNIT_END + 0x012D, // Size: 1, Type: INT, Flags: NONE - PLAYER_FIELD_INV_SLOT_HEAD = UNIT_END + 0x012E, // Size: 46, Type: LONG, Flags: PRIVATE - PLAYER_FIELD_PACK_SLOT_1 = UNIT_END + 0x015C, // Size: 32, Type: LONG, Flags: PRIVATE - PLAYER_FIELD_BANK_SLOT_1 = UNIT_END + 0x017C, // Size: 56, Type: LONG, Flags: PRIVATE - PLAYER_FIELD_BANKBAG_SLOT_1 = UNIT_END + 0x01B4, // Size: 14, Type: LONG, Flags: PRIVATE - PLAYER_FIELD_VENDORBUYBACK_SLOT_1 = UNIT_END + 0x01C2, // Size: 24, Type: LONG, Flags: PRIVATE - PLAYER_FARSIGHT = UNIT_END + 0x01DA, // Size: 2, Type: LONG, Flags: PRIVATE - PLAYER__FIELD_KNOWN_TITLES = UNIT_END + 0x01DC, // Size: 2, Type: LONG, Flags: PRIVATE - PLAYER__FIELD_KNOWN_TITLES1 = UNIT_END + 0x01DE, // Size: 2, Type: LONG, Flags: PRIVATE - PLAYER__FIELD_KNOWN_TITLES2 = UNIT_END + 0x01E0, // Size: 2, Type: LONG, Flags: PRIVATE - PLAYER_XP = UNIT_END + 0x01E2, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_NEXT_LEVEL_XP = UNIT_END + 0x01E3, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_SKILL_INFO_1_1 = UNIT_END + 0x01E4, // Size: 384, Type: TWO_SHORT, Flags: PRIVATE - PLAYER_CHARACTER_POINTS = UNIT_END + 0x0364, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_TRACK_CREATURES = UNIT_END + 0x0365, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_TRACK_RESOURCES = UNIT_END + 0x0366, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_EXPERTISE = UNIT_END + 0x0367, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_OFFHAND_EXPERTISE = UNIT_END + 0x0368, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_BLOCK_PERCENTAGE = UNIT_END + 0x0369, // Size: 1, Type: FLOAT, Flags: PRIVATE - PLAYER_DODGE_PERCENTAGE = UNIT_END + 0x036A, // Size: 1, Type: FLOAT, Flags: PRIVATE - PLAYER_PARRY_PERCENTAGE = UNIT_END + 0x036B, // Size: 1, Type: FLOAT, Flags: PRIVATE - PLAYER_CRIT_PERCENTAGE = UNIT_END + 0x036C, // Size: 1, Type: FLOAT, Flags: PRIVATE - PLAYER_RANGED_CRIT_PERCENTAGE = UNIT_END + 0x036D, // Size: 1, Type: FLOAT, Flags: PRIVATE - PLAYER_OFFHAND_CRIT_PERCENTAGE = UNIT_END + 0x036E, // Size: 1, Type: FLOAT, Flags: PRIVATE - PLAYER_SPELL_CRIT_PERCENTAGE1 = UNIT_END + 0x036F, // Size: 7, Type: FLOAT, Flags: PRIVATE - PLAYER_SHIELD_BLOCK = UNIT_END + 0x0376, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_SHIELD_BLOCK_CRIT_PERCENTAGE = UNIT_END + 0x0377, // Size: 1, Type: FLOAT, Flags: PRIVATE - PLAYER_MASTERY = UNIT_END + 0x0378, // Size: 1, Type: FLOAT, Flags: PRIVATE - PLAYER_EXPLORED_ZONES_1 = UNIT_END + 0x0379, // Size: 144, Type: BYTES, Flags: PRIVATE - PLAYER_REST_STATE_EXPERIENCE = UNIT_END + 0x0409, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_FIELD_COINAGE = UNIT_END + 0x040A, // Size: 2, Type: LONG, Flags: PRIVATE - PLAYER_FIELD_MOD_DAMAGE_DONE_POS = UNIT_END + 0x040C, // Size: 7, Type: INT, Flags: PRIVATE - PLAYER_FIELD_MOD_DAMAGE_DONE_NEG = UNIT_END + 0x0413, // Size: 7, Type: INT, Flags: PRIVATE - PLAYER_FIELD_MOD_DAMAGE_DONE_PCT = UNIT_END + 0x041A, // Size: 7, Type: INT, Flags: PRIVATE - PLAYER_FIELD_MOD_HEALING_DONE_POS = UNIT_END + 0x0421, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_FIELD_MOD_HEALING_PCT = UNIT_END + 0x0422, // Size: 1, Type: FLOAT, Flags: PRIVATE - PLAYER_FIELD_MOD_HEALING_DONE_PCT = UNIT_END + 0x0423, // Size: 1, Type: FLOAT, Flags: PRIVATE - PLAYER_FIELD_WEAPON_DMG_MULTIPLIERS = UNIT_END + 0x0424, // Size: 3, Type: FLOAT, Flags: PRIVATE - PLAYER_FIELD_MOD_SPELL_POWER_PCT = UNIT_END + 0x0427, // Size: 1, Type: FLOAT, Flags: PRIVATE - PLAYER_FIELD_MOD_TARGET_RESISTANCE = UNIT_END + 0x0428, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_FIELD_MOD_TARGET_PHYSICAL_RESISTANCE = UNIT_END + 0x0429, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_FIELD_BYTES = UNIT_END + 0x042A, // Size: 1, Type: BYTES, Flags: PRIVATE - PLAYER_SELF_RES_SPELL = UNIT_END + 0x042B, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_FIELD_PVP_MEDALS = UNIT_END + 0x042C, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_FIELD_BUYBACK_PRICE_1 = UNIT_END + 0x042D, // Size: 12, Type: INT, Flags: PRIVATE - PLAYER_FIELD_BUYBACK_TIMESTAMP_1 = UNIT_END + 0x0439, // Size: 12, Type: INT, Flags: PRIVATE - PLAYER_FIELD_KILLS = UNIT_END + 0x0445, // Size: 1, Type: TWO_SHORT, Flags: PRIVATE - PLAYER_FIELD_LIFETIME_HONORABLE_KILLS = UNIT_END + 0x0446, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_FIELD_BYTES2 = UNIT_END + 0x0447, // Size: 1, Type: 6, Flags: PRIVATE - PLAYER_FIELD_WATCHED_FACTION_INDEX = UNIT_END + 0x0448, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_FIELD_COMBAT_RATING_1 = UNIT_END + 0x0449, // Size: 26, Type: INT, Flags: PRIVATE - PLAYER_FIELD_ARENA_TEAM_INFO_1_1 = UNIT_END + 0x0463, // Size: 21, Type: INT, Flags: PRIVATE - PLAYER_FIELD_BATTLEGROUND_RATING = UNIT_END + 0x0478, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_FIELD_MAX_LEVEL = UNIT_END + 0x0479, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_FIELD_DAILY_QUESTS_1 = UNIT_END + 0x047A, // Size: 25, Type: INT, Flags: PRIVATE - PLAYER_RUNE_REGEN_1 = UNIT_END + 0x0493, // Size: 4, Type: FLOAT, Flags: PRIVATE - PLAYER_NO_REAGENT_COST_1 = UNIT_END + 0x0497, // Size: 3, Type: INT, Flags: PRIVATE - PLAYER_FIELD_GLYPH_SLOTS_1 = UNIT_END + 0x049A, // Size: 9, Type: INT, Flags: PRIVATE - PLAYER_FIELD_GLYPHS_1 = UNIT_END + 0x04A3, // Size: 9, Type: INT, Flags: PRIVATE - PLAYER_GLYPHS_ENABLED = UNIT_END + 0x04AC, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_PET_SPELL_POWER = UNIT_END + 0x04AD, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_FIELD_RESEARCHING_1 = UNIT_END + 0x04AE, // Size: 8, Type: TWO_SHORT, Flags: PRIVATE - PLAYER_FIELD_RESERACH_SITE_1 = UNIT_END + 0x04B6, // Size: 8, Type: TWO_SHORT, Flags: PRIVATE - PLAYER_PROFESSION_SKILL_LINE_1 = UNIT_END + 0x04BE, // Size: 2, Type: INT, Flags: PRIVATE - PLAYER_FIELD_UI_HIT_MODIFIER = UNIT_END + 0x04C0, // Size: 1, Type: FLOAT, Flags: PRIVATE - PLAYER_FIELD_UI_SPELL_HIT_MODIFIER = UNIT_END + 0x04C1, // Size: 1, Type: FLOAT, Flags: PRIVATE - PLAYER_FIELD_HOME_REALM_TIME_OFFSET = UNIT_END + 0x04C2, // Size: 1, Type: INT, Flags: PRIVATE - PLAYER_FIELD_MOD_HASTE = UNIT_END + 0x04C3, // Size: 1, Type: FLOAT, Flags: PRIVATE - PLAYER_FIELD_MOD_RANGED_HASTE = UNIT_END + 0x04C4, // Size: 1, Type: FLOAT, Flags: PRIVATE - PLAYER_FIELD_MOD_PET_HASTE = UNIT_END + 0x04C5, // Size: 1, Type: FLOAT, Flags: PRIVATE - PLAYER_FIELD_MOD_HASTE_REGEN = UNIT_END + 0x04C6, // Size: 1, Type: FLOAT, Flags: PRIVATE - PLAYER_FIELD_PADDING = UNIT_END + 0x04C7, // Size: 1, Type: INT, Flags: NONE - PLAYER_END = UNIT_END + 0x04C8, + PLAYER_DUEL_ARBITER = UNIT_END + 0x0000, // Size: 2, Type: LONG, Flags: PUBLIC + PLAYER_FLAGS = UNIT_END + 0x0002, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_GUILDRANK = UNIT_END + 0x0003, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_GUILDDELETE_DATE = UNIT_END + 0x0004, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_GUILDLEVEL = UNIT_END + 0x0005, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_BYTES = UNIT_END + 0x0006, // Size: 1, Type: BYTES, Flags: PUBLIC + PLAYER_BYTES_2 = UNIT_END + 0x0007, // Size: 1, Type: BYTES, Flags: PUBLIC + PLAYER_BYTES_3 = UNIT_END + 0x0008, // Size: 1, Type: BYTES, Flags: PUBLIC + PLAYER_DUEL_TEAM = UNIT_END + 0x0009, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_GUILD_TIMESTAMP = UNIT_END + 0x000A, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_QUEST_LOG_1_1 = UNIT_END + 0x000B, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_1_2 = UNIT_END + 0x000C, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_1_3 = UNIT_END + 0x000D, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_1_4 = UNIT_END + 0x000F, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_2_1 = UNIT_END + 0x0010, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_2_2 = UNIT_END + 0x0011, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_2_3 = UNIT_END + 0x0012, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_2_5 = UNIT_END + 0x0014, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_3_1 = UNIT_END + 0x0015, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_3_2 = UNIT_END + 0x0016, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_3_3 = UNIT_END + 0x0017, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_3_5 = UNIT_END + 0x0019, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_4_1 = UNIT_END + 0x001A, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_4_2 = UNIT_END + 0x001B, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_4_3 = UNIT_END + 0x001C, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_4_5 = UNIT_END + 0x001E, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_5_1 = UNIT_END + 0x001F, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_5_2 = UNIT_END + 0x0020, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_5_3 = UNIT_END + 0x0021, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_5_5 = UNIT_END + 0x0023, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_6_1 = UNIT_END + 0x0024, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_6_2 = UNIT_END + 0x0025, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_6_3 = UNIT_END + 0x0026, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_6_5 = UNIT_END + 0x0028, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_7_1 = UNIT_END + 0x0029, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_7_2 = UNIT_END + 0x002A, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_7_3 = UNIT_END + 0x002B, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_7_5 = UNIT_END + 0x002D, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_8_1 = UNIT_END + 0x002E, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_8_2 = UNIT_END + 0x002F, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_8_3 = UNIT_END + 0x0030, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_8_5 = UNIT_END + 0x0032, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_9_1 = UNIT_END + 0x0033, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_9_2 = UNIT_END + 0x0034, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_9_3 = UNIT_END + 0x0035, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_9_5 = UNIT_END + 0x0037, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_10_1 = UNIT_END + 0x0038, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_10_2 = UNIT_END + 0x0039, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_10_3 = UNIT_END + 0x003A, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_10_5 = UNIT_END + 0x003C, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_11_1 = UNIT_END + 0x003D, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_11_2 = UNIT_END + 0x003E, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_11_3 = UNIT_END + 0x003F, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_11_5 = UNIT_END + 0x0041, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_12_1 = UNIT_END + 0x0042, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_12_2 = UNIT_END + 0x0043, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_12_3 = UNIT_END + 0x0044, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_12_5 = UNIT_END + 0x0046, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_13_1 = UNIT_END + 0x0047, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_13_2 = UNIT_END + 0x0048, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_13_3 = UNIT_END + 0x0049, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_13_5 = UNIT_END + 0x004B, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_14_1 = UNIT_END + 0x004C, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_14_2 = UNIT_END + 0x004D, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_14_3 = UNIT_END + 0x004E, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_14_5 = UNIT_END + 0x0050, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_15_1 = UNIT_END + 0x0051, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_15_2 = UNIT_END + 0x0052, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_15_3 = UNIT_END + 0x0053, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_15_5 = UNIT_END + 0x0055, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_16_1 = UNIT_END + 0x0056, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_16_2 = UNIT_END + 0x0057, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_16_3 = UNIT_END + 0x0058, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_16_5 = UNIT_END + 0x005A, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_17_1 = UNIT_END + 0x005B, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_17_2 = UNIT_END + 0x005C, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_17_3 = UNIT_END + 0x005D, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_17_5 = UNIT_END + 0x005F, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_18_1 = UNIT_END + 0x0060, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_18_2 = UNIT_END + 0x0061, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_18_3 = UNIT_END + 0x0062, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_18_5 = UNIT_END + 0x0064, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_19_1 = UNIT_END + 0x0065, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_19_2 = UNIT_END + 0x0066, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_19_3 = UNIT_END + 0x0067, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_19_5 = UNIT_END + 0x0069, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_20_1 = UNIT_END + 0x006A, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_20_2 = UNIT_END + 0x006B, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_20_3 = UNIT_END + 0x006C, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_20_5 = UNIT_END + 0x006E, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_21_1 = UNIT_END + 0x006F, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_21_2 = UNIT_END + 0x0070, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_21_3 = UNIT_END + 0x0071, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_21_5 = UNIT_END + 0x0073, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_22_1 = UNIT_END + 0x0074, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_22_2 = UNIT_END + 0x0075, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_22_3 = UNIT_END + 0x0076, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_22_5 = UNIT_END + 0x0078, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_23_1 = UNIT_END + 0x0079, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_23_2 = UNIT_END + 0x007A, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_23_3 = UNIT_END + 0x007B, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_23_5 = UNIT_END + 0x007D, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_24_1 = UNIT_END + 0x007E, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_24_2 = UNIT_END + 0x007F, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_24_3 = UNIT_END + 0x0080, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_24_5 = UNIT_END + 0x0082, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_25_1 = UNIT_END + 0x0083, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_25_2 = UNIT_END + 0x0084, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_25_3 = UNIT_END + 0x0085, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_25_5 = UNIT_END + 0x0087, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_26_1 = UNIT_END + 0x0088, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_26_2 = UNIT_END + 0x0089, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_26_3 = UNIT_END + 0x008A, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_26_5 = UNIT_END + 0x008C, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_27_1 = UNIT_END + 0x008D, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_27_2 = UNIT_END + 0x008E, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_27_3 = UNIT_END + 0x008F, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_27_5 = UNIT_END + 0x0091, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_28_1 = UNIT_END + 0x0092, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_28_2 = UNIT_END + 0x0093, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_28_3 = UNIT_END + 0x0094, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_28_5 = UNIT_END + 0x0096, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_29_1 = UNIT_END + 0x0097, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_29_2 = UNIT_END + 0x0098, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_29_3 = UNIT_END + 0x0099, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_29_5 = UNIT_END + 0x009B, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_30_1 = UNIT_END + 0x009C, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_30_2 = UNIT_END + 0x009D, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_30_3 = UNIT_END + 0x009E, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_30_5 = UNIT_END + 0x00A0, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_31_1 = UNIT_END + 0x00A1, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_31_2 = UNIT_END + 0x00A2, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_31_3 = UNIT_END + 0x00A3, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_31_5 = UNIT_END + 0x00A5, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_32_1 = UNIT_END + 0x00A6, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_32_2 = UNIT_END + 0x00A7, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_32_3 = UNIT_END + 0x00A8, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_32_5 = UNIT_END + 0x00AA, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_33_1 = UNIT_END + 0x00AB, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_33_2 = UNIT_END + 0x00AC, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_33_3 = UNIT_END + 0x00AD, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_33_5 = UNIT_END + 0x00AF, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_34_1 = UNIT_END + 0x00B0, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_34_2 = UNIT_END + 0x00B1, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_34_3 = UNIT_END + 0x00B2, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_34_5 = UNIT_END + 0x00B4, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_35_1 = UNIT_END + 0x00B5, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_35_2 = UNIT_END + 0x00B6, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_35_3 = UNIT_END + 0x00B7, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_35_5 = UNIT_END + 0x00B9, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_36_1 = UNIT_END + 0x00BA, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_36_2 = UNIT_END + 0x00BB, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_36_3 = UNIT_END + 0x00BC, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_36_5 = UNIT_END + 0x00BE, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_37_1 = UNIT_END + 0x00BF, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_37_2 = UNIT_END + 0x00C0, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_37_3 = UNIT_END + 0x00C1, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_37_5 = UNIT_END + 0x00C3, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_38_1 = UNIT_END + 0x00C4, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_38_2 = UNIT_END + 0x00C5, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_38_3 = UNIT_END + 0x00C6, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_38_5 = UNIT_END + 0x00C8, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_39_1 = UNIT_END + 0x00C9, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_39_2 = UNIT_END + 0x00CA, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_39_3 = UNIT_END + 0x00CB, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_39_5 = UNIT_END + 0x00CD, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_40_1 = UNIT_END + 0x00CE, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_40_2 = UNIT_END + 0x00CF, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_40_3 = UNIT_END + 0x00D0, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_40_5 = UNIT_END + 0x00D2, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_41_1 = UNIT_END + 0x00D3, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_41_2 = UNIT_END + 0x00D4, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_41_3 = UNIT_END + 0x00D5, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_41_5 = UNIT_END + 0x00D7, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_42_1 = UNIT_END + 0x00D8, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_42_2 = UNIT_END + 0x00D9, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_42_3 = UNIT_END + 0x00DA, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_42_5 = UNIT_END + 0x00DC, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_43_1 = UNIT_END + 0x00DD, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_43_2 = UNIT_END + 0x00DE, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_43_3 = UNIT_END + 0x00DF, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_43_5 = UNIT_END + 0x00E1, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_44_1 = UNIT_END + 0x00E2, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_44_2 = UNIT_END + 0x00E3, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_44_3 = UNIT_END + 0x00E4, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_44_5 = UNIT_END + 0x00E6, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_45_1 = UNIT_END + 0x00E7, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_45_2 = UNIT_END + 0x00E8, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_45_3 = UNIT_END + 0x00E9, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_45_5 = UNIT_END + 0x00EB, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_46_1 = UNIT_END + 0x00EC, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_46_2 = UNIT_END + 0x00ED, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_46_3 = UNIT_END + 0x00EE, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_46_5 = UNIT_END + 0x00F0, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_47_1 = UNIT_END + 0x00F1, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_47_2 = UNIT_END + 0x00F2, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_47_3 = UNIT_END + 0x00F3, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_47_5 = UNIT_END + 0x00F5, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_48_1 = UNIT_END + 0x00F6, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_48_2 = UNIT_END + 0x00F7, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_48_3 = UNIT_END + 0x00F8, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_48_5 = UNIT_END + 0x00FA, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_49_1 = UNIT_END + 0x00FB, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_49_2 = UNIT_END + 0x00FC, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_49_3 = UNIT_END + 0x00FD, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_49_5 = UNIT_END + 0x00FF, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_50_1 = UNIT_END + 0x0100, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_50_2 = UNIT_END + 0x0101, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_50_3 = UNIT_END + 0x0102, // Size: 2, Type: TWO_SHORT, Flags: PARTY_LEADER + PLAYER_QUEST_LOG_50_5 = UNIT_END + 0x0104, // Size: 1, Type: INT, Flags: PARTY_LEADER + PLAYER_VISIBLE_ITEM_1_ENTRYID = UNIT_END + 0x0105, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_1_ENCHANTMENT = UNIT_END + 0x0106, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_2_ENTRYID = UNIT_END + 0x0107, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_2_ENCHANTMENT = UNIT_END + 0x0108, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_3_ENTRYID = UNIT_END + 0x0109, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_3_ENCHANTMENT = UNIT_END + 0x010A, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_4_ENTRYID = UNIT_END + 0x010B, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_4_ENCHANTMENT = UNIT_END + 0x010C, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_5_ENTRYID = UNIT_END + 0x010D, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_5_ENCHANTMENT = UNIT_END + 0x010E, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_6_ENTRYID = UNIT_END + 0x010F, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_6_ENCHANTMENT = UNIT_END + 0x0110, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_7_ENTRYID = UNIT_END + 0x0111, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_7_ENCHANTMENT = UNIT_END + 0x0112, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_8_ENTRYID = UNIT_END + 0x0113, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_8_ENCHANTMENT = UNIT_END + 0x0114, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_9_ENTRYID = UNIT_END + 0x0115, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_9_ENCHANTMENT = UNIT_END + 0x0116, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_10_ENTRYID = UNIT_END + 0x0117, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_10_ENCHANTMENT = UNIT_END + 0x0118, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_11_ENTRYID = UNIT_END + 0x0119, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_11_ENCHANTMENT = UNIT_END + 0x011A, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_12_ENTRYID = UNIT_END + 0x011B, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_12_ENCHANTMENT = UNIT_END + 0x011C, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_13_ENTRYID = UNIT_END + 0x011D, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_13_ENCHANTMENT = UNIT_END + 0x011E, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_14_ENTRYID = UNIT_END + 0x011F, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_14_ENCHANTMENT = UNIT_END + 0x0120, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_15_ENTRYID = UNIT_END + 0x0121, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_15_ENCHANTMENT = UNIT_END + 0x0122, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_16_ENTRYID = UNIT_END + 0x0123, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_16_ENCHANTMENT = UNIT_END + 0x0124, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_17_ENTRYID = UNIT_END + 0x0125, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_17_ENCHANTMENT = UNIT_END + 0x0126, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_18_ENTRYID = UNIT_END + 0x0127, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_18_ENCHANTMENT = UNIT_END + 0x0128, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_19_ENTRYID = UNIT_END + 0x0129, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_VISIBLE_ITEM_19_ENCHANTMENT = UNIT_END + 0x012A, // Size: 1, Type: TWO_SHORT, Flags: PUBLIC + PLAYER_CHOSEN_TITLE = UNIT_END + 0x012B, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_FAKE_INEBRIATION = UNIT_END + 0x012C, // Size: 1, Type: INT, Flags: PUBLIC + PLAYER_FIELD_PAD_0 = UNIT_END + 0x012D, // Size: 1, Type: INT, Flags: NONE + PLAYER_FIELD_INV_SLOT_HEAD = UNIT_END + 0x012E, // Size: 46, Type: LONG, Flags: PRIVATE + PLAYER_FIELD_PACK_SLOT_1 = UNIT_END + 0x015C, // Size: 32, Type: LONG, Flags: PRIVATE + PLAYER_FIELD_BANK_SLOT_1 = UNIT_END + 0x017C, // Size: 56, Type: LONG, Flags: PRIVATE + PLAYER_FIELD_BANKBAG_SLOT_1 = UNIT_END + 0x01B4, // Size: 14, Type: LONG, Flags: PRIVATE + PLAYER_FIELD_VENDORBUYBACK_SLOT_1 = UNIT_END + 0x01C2, // Size: 24, Type: LONG, Flags: PRIVATE + PLAYER_FARSIGHT = UNIT_END + 0x01DA, // Size: 2, Type: LONG, Flags: PRIVATE + PLAYER__FIELD_KNOWN_TITLES = UNIT_END + 0x01DC, // Size: 2, Type: LONG, Flags: PRIVATE + PLAYER__FIELD_KNOWN_TITLES1 = UNIT_END + 0x01DE, // Size: 2, Type: LONG, Flags: PRIVATE + PLAYER__FIELD_KNOWN_TITLES2 = UNIT_END + 0x01E0, // Size: 2, Type: LONG, Flags: PRIVATE + PLAYER__FIELD_KNOWN_TITLES3 = UNIT_END + 0x01E2, // Size: 2, Type: LONG, Flags: PRIVATE + PLAYER_XP = UNIT_END + 0x01E4, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_NEXT_LEVEL_XP = UNIT_END + 0x01E5, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_SKILL_LINEID_0 = UNIT_END + 0x01E6, // Size: 64, Type: TWO_SHORT, Flags: PRIVATE + PLAYER_SKILL_STEP_0 = UNIT_END + 0x0226, // Size: 64, Type: TWO_SHORT, Flags: PRIVATE + PLAYER_SKILL_RANK_0 = UNIT_END + 0x0266, // Size: 64, Type: TWO_SHORT, Flags: PRIVATE + PLAYER_SKILL_MAX_RANK_0 = UNIT_END + 0x02A6, // Size: 64, Type: TWO_SHORT, Flags: PRIVATE + PLAYER_SKILL_MODIFIER_0 = UNIT_END + 0x02E6, // Size: 64, Type: TWO_SHORT, Flags: PRIVATE + PLAYER_SKILL_TALENT_0 = UNIT_END + 0x0326, // Size: 64, Type: TWO_SHORT, Flags: PRIVATE + PLAYER_CHARACTER_POINTS = UNIT_END + 0x0366, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_TRACK_CREATURES = UNIT_END + 0x0367, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_TRACK_RESOURCES = UNIT_END + 0x0368, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_EXPERTISE = UNIT_END + 0x0369, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_OFFHAND_EXPERTISE = UNIT_END + 0x036A, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_BLOCK_PERCENTAGE = UNIT_END + 0x036B, // Size: 1, Type: FLOAT, Flags: PRIVATE + PLAYER_DODGE_PERCENTAGE = UNIT_END + 0x036C, // Size: 1, Type: FLOAT, Flags: PRIVATE + PLAYER_PARRY_PERCENTAGE = UNIT_END + 0x036D, // Size: 1, Type: FLOAT, Flags: PRIVATE + PLAYER_CRIT_PERCENTAGE = UNIT_END + 0x036E, // Size: 1, Type: FLOAT, Flags: PRIVATE + PLAYER_RANGED_CRIT_PERCENTAGE = UNIT_END + 0x036F, // Size: 1, Type: FLOAT, Flags: PRIVATE + PLAYER_OFFHAND_CRIT_PERCENTAGE = UNIT_END + 0x0370, // Size: 1, Type: FLOAT, Flags: PRIVATE + PLAYER_SPELL_CRIT_PERCENTAGE1 = UNIT_END + 0x0371, // Size: 7, Type: FLOAT, Flags: PRIVATE + PLAYER_SHIELD_BLOCK = UNIT_END + 0x0378, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_SHIELD_BLOCK_CRIT_PERCENTAGE = UNIT_END + 0x0379, // Size: 1, Type: FLOAT, Flags: PRIVATE + PLAYER_MASTERY = UNIT_END + 0x037A, // Size: 1, Type: FLOAT, Flags: PRIVATE + PLAYER_EXPLORED_ZONES_1 = UNIT_END + 0x037B, // Size: 156, Type: BYTES, Flags: PRIVATE + PLAYER_REST_STATE_EXPERIENCE = UNIT_END + 0x0417, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_FIELD_COINAGE = UNIT_END + 0x0418, // Size: 2, Type: LONG, Flags: PRIVATE + PLAYER_FIELD_MOD_DAMAGE_DONE_POS = UNIT_END + 0x041A, // Size: 7, Type: INT, Flags: PRIVATE + PLAYER_FIELD_MOD_DAMAGE_DONE_NEG = UNIT_END + 0x0421, // Size: 7, Type: INT, Flags: PRIVATE + PLAYER_FIELD_MOD_DAMAGE_DONE_PCT = UNIT_END + 0x0428, // Size: 7, Type: INT, Flags: PRIVATE + PLAYER_FIELD_MOD_HEALING_DONE_POS = UNIT_END + 0x042F, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_FIELD_MOD_HEALING_PCT = UNIT_END + 0x0430, // Size: 1, Type: FLOAT, Flags: PRIVATE + PLAYER_FIELD_MOD_HEALING_DONE_PCT = UNIT_END + 0x0431, // Size: 1, Type: FLOAT, Flags: PRIVATE + PLAYER_FIELD_WEAPON_DMG_MULTIPLIERS = UNIT_END + 0x0432, // Size: 3, Type: FLOAT, Flags: PRIVATE + PLAYER_FIELD_MOD_SPELL_POWER_PCT = UNIT_END + 0x0435, // Size: 1, Type: FLOAT, Flags: PRIVATE + PLAYER_FIELD_OVERRIDE_SPELL_POWER_BY_AP_PCT = UNIT_END + 0x0436, // Size: 1, Type: FLOAT, Flags: PRIVATE + PLAYER_FIELD_MOD_TARGET_RESISTANCE = UNIT_END + 0x0437, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_FIELD_MOD_TARGET_PHYSICAL_RESISTANCE = UNIT_END + 0x0438, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_FIELD_BYTES = UNIT_END + 0x0439, // Size: 1, Type: BYTES, Flags: PRIVATE + PLAYER_SELF_RES_SPELL = UNIT_END + 0x043A, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_FIELD_PVP_MEDALS = UNIT_END + 0x043B, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_FIELD_BUYBACK_PRICE_1 = UNIT_END + 0x043C, // Size: 12, Type: INT, Flags: PRIVATE + PLAYER_FIELD_BUYBACK_TIMESTAMP_1 = UNIT_END + 0x0448, // Size: 12, Type: INT, Flags: PRIVATE + PLAYER_FIELD_KILLS = UNIT_END + 0x0454, // Size: 1, Type: TWO_SHORT, Flags: PRIVATE + PLAYER_FIELD_LIFETIME_HONORABLE_KILLS = UNIT_END + 0x0455, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_FIELD_BYTES2 = UNIT_END + 0x0456, // Size: 1, Type: 6, Flags: PRIVATE + PLAYER_FIELD_WATCHED_FACTION_INDEX = UNIT_END + 0x0457, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_FIELD_COMBAT_RATING_1 = UNIT_END + 0x0458, // Size: 26, Type: INT, Flags: PRIVATE + PLAYER_FIELD_ARENA_TEAM_INFO_1_1 = UNIT_END + 0x0472, // Size: 21, Type: INT, Flags: PRIVATE + PLAYER_FIELD_BATTLEGROUND_RATING = UNIT_END + 0x0487, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_FIELD_MAX_LEVEL = UNIT_END + 0x0488, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_FIELD_DAILY_QUESTS_1 = UNIT_END + 0x0489, // Size: 25, Type: INT, Flags: PRIVATE + PLAYER_RUNE_REGEN_1 = UNIT_END + 0x04A2, // Size: 4, Type: FLOAT, Flags: PRIVATE + PLAYER_NO_REAGENT_COST_1 = UNIT_END + 0x04A6, // Size: 3, Type: INT, Flags: PRIVATE + PLAYER_FIELD_GLYPH_SLOTS_1 = UNIT_END + 0x04A9, // Size: 9, Type: INT, Flags: PRIVATE + PLAYER_FIELD_GLYPHS_1 = UNIT_END + 0x04B2, // Size: 9, Type: INT, Flags: PRIVATE + PLAYER_GLYPHS_ENABLED = UNIT_END + 0x04BB, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_PET_SPELL_POWER = UNIT_END + 0x04BC, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_FIELD_RESEARCHING_1 = UNIT_END + 0x04BD, // Size: 8, Type: TWO_SHORT, Flags: PRIVATE + PLAYER_FIELD_RESERACH_SITE_1 = UNIT_END + 0x04C5, // Size: 8, Type: TWO_SHORT, Flags: PRIVATE + PLAYER_PROFESSION_SKILL_LINE_1 = UNIT_END + 0x04CD, // Size: 2, Type: INT, Flags: PRIVATE + PLAYER_FIELD_UI_HIT_MODIFIER = UNIT_END + 0x04CF, // Size: 1, Type: FLOAT, Flags: PRIVATE + PLAYER_FIELD_UI_SPELL_HIT_MODIFIER = UNIT_END + 0x04D0, // Size: 1, Type: FLOAT, Flags: PRIVATE + PLAYER_FIELD_HOME_REALM_TIME_OFFSET = UNIT_END + 0x04D1, // Size: 1, Type: INT, Flags: PRIVATE + PLAYER_FIELD_MOD_HASTE = UNIT_END + 0x04D2, // Size: 1, Type: FLOAT, Flags: PRIVATE + PLAYER_FIELD_MOD_RANGED_HASTE = UNIT_END + 0x04D3, // Size: 1, Type: FLOAT, Flags: PRIVATE + PLAYER_FIELD_MOD_PET_HASTE = UNIT_END + 0x04D4, // Size: 1, Type: FLOAT, Flags: PRIVATE + PLAYER_FIELD_MOD_HASTE_REGEN = UNIT_END + 0x04D5, // Size: 1, Type: FLOAT, Flags: PRIVATE + PLAYER_END = UNIT_END + 0x04D6, }; enum EGameObjectFields { - OBJECT_FIELD_CREATED_BY = OBJECT_END + 0x0000, // Size: 2, Type: LONG, Flags: PUBLIC - GAMEOBJECT_DISPLAYID = OBJECT_END + 0x0002, // Size: 1, Type: INT, Flags: PUBLIC - GAMEOBJECT_FLAGS = OBJECT_END + 0x0003, // Size: 1, Type: INT, Flags: PUBLIC - GAMEOBJECT_PARENTROTATION = OBJECT_END + 0x0004, // Size: 4, Type: FLOAT, Flags: PUBLIC - GAMEOBJECT_DYNAMIC = OBJECT_END + 0x0008, // Size: 1, Type: TWO_SHORT, Flags: UNUSED2 - GAMEOBJECT_FACTION = OBJECT_END + 0x0009, // Size: 1, Type: INT, Flags: PUBLIC - GAMEOBJECT_LEVEL = OBJECT_END + 0x000A, // Size: 1, Type: INT, Flags: PUBLIC - GAMEOBJECT_BYTES_1 = OBJECT_END + 0x000B, // Size: 1, Type: BYTES, Flags: PUBLIC - GAMEOBJECT_END = OBJECT_END + 0x000C, + OBJECT_FIELD_CREATED_BY = OBJECT_END + 0x0000, // Size: 2, Type: LONG, Flags: PUBLIC + GAMEOBJECT_DISPLAYID = OBJECT_END + 0x0002, // Size: 1, Type: INT, Flags: PUBLIC + GAMEOBJECT_FLAGS = OBJECT_END + 0x0003, // Size: 1, Type: INT, Flags: PUBLIC + GAMEOBJECT_PARENTROTATION = OBJECT_END + 0x0004, // Size: 4, Type: FLOAT, Flags: PUBLIC + GAMEOBJECT_DYNAMIC = OBJECT_END + 0x0008, // Size: 1, Type: TWO_SHORT, Flags: UNUSED2 + GAMEOBJECT_FACTION = OBJECT_END + 0x0009, // Size: 1, Type: INT, Flags: PUBLIC + GAMEOBJECT_LEVEL = OBJECT_END + 0x000A, // Size: 1, Type: INT, Flags: PUBLIC + GAMEOBJECT_BYTES_1 = OBJECT_END + 0x000B, // Size: 1, Type: BYTES, Flags: PUBLIC + GAMEOBJECT_END = OBJECT_END + 0x000C, }; enum EDynamicObjectFields { - DYNAMICOBJECT_CASTER = OBJECT_END + 0x0000, // Size: 2, Type: LONG, Flags: PUBLIC - DYNAMICOBJECT_BYTES = OBJECT_END + 0x0002, // Size: 1, Type: INT, Flags: UNUSED2 - DYNAMICOBJECT_SPELLID = OBJECT_END + 0x0003, // Size: 1, Type: INT, Flags: PUBLIC - DYNAMICOBJECT_RADIUS = OBJECT_END + 0x0004, // Size: 1, Type: FLOAT, Flags: PUBLIC - DYNAMICOBJECT_CASTTIME = OBJECT_END + 0x0005, // Size: 1, Type: INT, Flags: PUBLIC - DYNAMICOBJECT_END = OBJECT_END + 0x0006, + DYNAMICOBJECT_CASTER = OBJECT_END + 0x0000, // Size: 2, Type: LONG, Flags: PUBLIC + DYNAMICOBJECT_BYTES = OBJECT_END + 0x0002, // Size: 1, Type: INT, Flags: UNUSED2 + DYNAMICOBJECT_SPELLID = OBJECT_END + 0x0003, // Size: 1, Type: INT, Flags: PUBLIC + DYNAMICOBJECT_RADIUS = OBJECT_END + 0x0004, // Size: 1, Type: FLOAT, Flags: PUBLIC + DYNAMICOBJECT_CASTTIME = OBJECT_END + 0x0005, // Size: 1, Type: INT, Flags: PUBLIC + DYNAMICOBJECT_END = OBJECT_END + 0x0006, }; enum ECorpseFields { - CORPSE_FIELD_OWNER = OBJECT_END + 0x0000, // Size: 2, Type: LONG, Flags: PUBLIC - CORPSE_FIELD_PARTY = OBJECT_END + 0x0002, // Size: 2, Type: LONG, Flags: PUBLIC - CORPSE_FIELD_DISPLAY_ID = OBJECT_END + 0x0004, // Size: 1, Type: INT, Flags: PUBLIC - CORPSE_FIELD_ITEM = OBJECT_END + 0x0005, // Size: 19, Type: INT, Flags: PUBLIC - CORPSE_FIELD_BYTES_1 = OBJECT_END + 0x0018, // Size: 1, Type: BYTES, Flags: PUBLIC - CORPSE_FIELD_BYTES_2 = OBJECT_END + 0x0019, // Size: 1, Type: BYTES, Flags: PUBLIC - CORPSE_FIELD_FLAGS = OBJECT_END + 0x001A, // Size: 1, Type: INT, Flags: PUBLIC - CORPSE_FIELD_DYNAMIC_FLAGS = OBJECT_END + 0x001B, // Size: 1, Type: INT, Flags: UNUSED2 - CORPSE_END = OBJECT_END + 0x001C, + CORPSE_FIELD_OWNER = OBJECT_END + 0x0000, // Size: 2, Type: LONG, Flags: PUBLIC + CORPSE_FIELD_PARTY = OBJECT_END + 0x0002, // Size: 2, Type: LONG, Flags: PUBLIC + CORPSE_FIELD_DISPLAY_ID = OBJECT_END + 0x0004, // Size: 1, Type: INT, Flags: PUBLIC + CORPSE_FIELD_ITEM = OBJECT_END + 0x0005, // Size: 19, Type: INT, Flags: PUBLIC + CORPSE_FIELD_BYTES_1 = OBJECT_END + 0x0018, // Size: 1, Type: BYTES, Flags: PUBLIC + CORPSE_FIELD_BYTES_2 = OBJECT_END + 0x0019, // Size: 1, Type: BYTES, Flags: PUBLIC + CORPSE_FIELD_FLAGS = OBJECT_END + 0x001A, // Size: 1, Type: INT, Flags: PUBLIC + CORPSE_FIELD_DYNAMIC_FLAGS = OBJECT_END + 0x001B, // Size: 1, Type: INT, Flags: UNUSED2 + CORPSE_END = OBJECT_END + 0x001C, }; -#endif +enum EAreaTriggerFields +{ + AREATRIGGER_SPELLID = OBJECT_END + 0x0000, // Size: 1, Type: INT, Flags: PUBLIC + AREATRIGGER_SPELLVISUALID = OBJECT_END + 0x0001, // Size: 1, Type: INT, Flags: PUBLIC + AREATRIGGER_DURATION = OBJECT_END + 0x0002, // Size: 1, Type: INT, Flags: PUBLIC + AREATRIGGER_FINAL_POS = OBJECT_END + 0x0003, // Size: 3, Type: FLOAT, Flags: PUBLIC + AREATRIGGER_END = OBJECT_END + 0x0006, +}; + +#endif // _UPDATEFIELDS_H diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index cdd0927bed5..58bd08ddcf0 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -78,18 +78,6 @@ #define ZONE_UPDATE_INTERVAL (1*IN_MILLISECONDS) -#define PLAYER_SKILL_INDEX(x) (PLAYER_SKILL_INFO_1_1 + ((x)*3)) -#define PLAYER_SKILL_VALUE_INDEX(x) (PLAYER_SKILL_INDEX(x)+1) -#define PLAYER_SKILL_BONUS_INDEX(x) (PLAYER_SKILL_INDEX(x)+2) - -#define SKILL_VALUE(x) PAIR32_LOPART(x) -#define SKILL_MAX(x) PAIR32_HIPART(x) -#define MAKE_SKILL_VALUE(v, m) MAKE_PAIR32(v, m) - -#define SKILL_TEMP_BONUS(x) int16(PAIR32_LOPART(x)) -#define SKILL_PERM_BONUS(x) int16(PAIR32_HIPART(x)) -#define MAKE_SKILL_BONUS(t, p) MAKE_PAIR32(t, p) - enum CharacterFlags { CHARACTER_FLAG_NONE = 0x00000000, @@ -6195,23 +6183,25 @@ bool Player::UpdateSkill(uint32 skill_id, uint32 step) if (itr == mSkillStatus.end() || itr->second.uState == SKILL_DELETED) return false; - uint32 valueIndex = PLAYER_SKILL_VALUE_INDEX(itr->second.pos); - uint32 data = GetUInt32Value(valueIndex); - uint32 value = SKILL_VALUE(data); - uint32 max = SKILL_MAX(data); + uint16 field = itr->second.pos / 2; + uint8 offset = itr->second.pos & 1; // itr->second.pos % 2 + + uint16 value = GetUInt16Value(PLAYER_SKILL_RANK_0 + field, offset); + uint16 max = GetUInt16Value(PLAYER_SKILL_MAX_RANK_0 + field, offset); - if ((!max) || (!value) || (value >= max)) + if (!max || !value || value >= max) return false; if (value < max) { - uint32 new_value = value+step; + uint16 new_value = value + step; if (new_value > max) new_value = max; - SetUInt32Value(valueIndex, MAKE_SKILL_VALUE(new_value, max)); + SetUInt16Value(PLAYER_SKILL_RANK_0 + field, offset, new_value); if (itr->second.uState != SKILL_NEW) itr->second.uState = SKILL_CHANGED; + UpdateSkillEnchantments(skill_id, value, new_value); UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL, skill_id); return true; @@ -6326,36 +6316,38 @@ bool Player::UpdateSkillPro(uint16 SkillId, int32 Chance, uint32 step) if (itr == mSkillStatus.end() || itr->second.uState == SKILL_DELETED) return false; - uint32 valueIndex = PLAYER_SKILL_VALUE_INDEX(itr->second.pos); + uint16 field = itr->second.pos / 2; + uint8 offset = itr->second.pos & 1; // itr->second.pos % 2 - uint32 data = GetUInt32Value(valueIndex); - uint16 SkillValue = SKILL_VALUE(data); - uint16 MaxValue = SKILL_MAX(data); + uint16 value = GetUInt16Value(PLAYER_SKILL_RANK_0 + field, offset); + uint16 max = GetUInt16Value(PLAYER_SKILL_MAX_RANK_0 + field, offset); - if (!MaxValue || !SkillValue || SkillValue >= MaxValue) + if (!max || !value || value >= max) return false; int32 Roll = irand(1, 1000); if (Roll <= Chance) { - uint32 new_value = SkillValue+step; - if (new_value > MaxValue) - new_value = MaxValue; + uint16 new_value = value + step; + if (new_value > max) + new_value = max; - SetUInt32Value(valueIndex, MAKE_SKILL_VALUE(new_value, MaxValue)); + SetUInt16Value(PLAYER_SKILL_RANK_0 + field, offset, new_value); if (itr->second.uState != SKILL_NEW) itr->second.uState = SKILL_CHANGED; + for (size_t i = 0; i < bonusSkillLevelsSize; ++i) { uint32 bsl = bonusSkillLevels[i]; - if (SkillValue < bsl && new_value >= bsl) + if (value < bsl && new_value >= bsl) { learnSkillRewardedSpells(SkillId, new_value); break; } } - UpdateSkillEnchantments(SkillId, SkillValue, new_value); + + UpdateSkillEnchantments(SkillId, value, new_value); UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL, SkillId); sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "Player::UpdateSkillPro Chance=%3.1f%% taken", Chance / 10.0f); return true; @@ -6435,16 +6427,12 @@ void Player::ModifySkillBonus(uint32 skillid, int32 val, bool talent) if (itr == mSkillStatus.end() || itr->second.uState == SKILL_DELETED) return; - uint32 bonusIndex = PLAYER_SKILL_BONUS_INDEX(itr->second.pos); + uint16 field = itr->second.pos / 2 + (talent ? PLAYER_SKILL_TALENT_0 : PLAYER_SKILL_MODIFIER_0); + uint8 offset = itr->second.pos & 1; // itr->second.pos % 2 - uint32 bonus_val = GetUInt32Value(bonusIndex); - int16 temp_bonus = SKILL_TEMP_BONUS(bonus_val); - int16 perm_bonus = SKILL_PERM_BONUS(bonus_val); + uint16 bonus = GetUInt16Value(field, offset); - if (talent) // permanent bonus stored in high part - SetUInt32Value(bonusIndex, MAKE_SKILL_BONUS(temp_bonus, perm_bonus+val)); - else // temporary/item bonus stored in low part - SetUInt32Value(bonusIndex, MAKE_SKILL_BONUS(temp_bonus+val, perm_bonus)); + SetUInt16Value(field, offset, bonus + val); } void Player::UpdateSkillsForLevel() @@ -6467,10 +6455,11 @@ void Player::UpdateSkillsForLevel() if (GetSkillRangeType(pSkill, false) != SKILL_RANGE_LEVEL) continue; - uint32 valueIndex = PLAYER_SKILL_VALUE_INDEX(itr->second.pos); - uint32 data = GetUInt32Value(valueIndex); - uint32 max = SKILL_MAX(data); - uint32 val = SKILL_VALUE(data); + uint16 field = itr->second.pos / 2; + uint8 offset = itr->second.pos & 1; // itr->second.pos % 2 + + uint16 val = GetUInt16Value(PLAYER_SKILL_RANK_0 + field, offset); + uint16 max = GetUInt16Value(PLAYER_SKILL_MAX_RANK_0 + field, offset); /// update only level dependent max skill values if (max != 1) @@ -6478,13 +6467,16 @@ void Player::UpdateSkillsForLevel() /// maximize skill always if (alwaysMaxSkill) { - SetUInt32Value(valueIndex, MAKE_SKILL_VALUE(maxSkill, maxSkill)); + SetUInt16Value(PLAYER_SKILL_RANK_0 + field, offset, maxSkill); + SetUInt16Value(PLAYER_SKILL_MAX_RANK_0 + field, offset, maxSkill); if (itr->second.uState != SKILL_NEW) itr->second.uState = SKILL_CHANGED; } + else if (max != maxconfskill) /// update max skill value if current max skill not maximized { - SetUInt32Value(valueIndex, MAKE_SKILL_VALUE(val, maxSkill)); + SetUInt16Value(PLAYER_SKILL_RANK_0 + field, offset, val); + SetUInt16Value(PLAYER_SKILL_MAX_RANK_0 + field, offset, maxSkill); if (itr->second.uState != SKILL_NEW) itr->second.uState = SKILL_CHANGED; } @@ -6502,13 +6494,16 @@ void Player::UpdateSkillsToMaxSkillsForLevel() uint32 pskill = itr->first; if (IsProfessionOrRidingSkill(pskill)) continue; - uint32 valueIndex = PLAYER_SKILL_VALUE_INDEX(itr->second.pos); - uint32 data = GetUInt32Value(valueIndex); - uint32 max = SKILL_MAX(data); + + uint16 field = itr->second.pos / 2; + uint8 offset = itr->second.pos & 1; // itr->second.pos % 2 + + uint16 max = GetUInt16Value(PLAYER_SKILL_MAX_RANK_0 + field, offset); if (max > 1) { - SetUInt32Value(valueIndex, MAKE_SKILL_VALUE(max, max)); + SetUInt16Value(PLAYER_SKILL_RANK_0 + field, offset, max); + if (itr->second.uState != SKILL_NEW) itr->second.uState = SKILL_CHANGED; } @@ -6530,22 +6525,29 @@ void Player::SetSkill(uint16 id, uint16 step, uint16 newVal, uint16 maxVal) //has skill if (itr != mSkillStatus.end() && itr->second.uState != SKILL_DELETED) { - currVal = SKILL_VALUE(GetUInt32Value(PLAYER_SKILL_VALUE_INDEX(itr->second.pos))); + uint16 field = itr->second.pos / 2; + uint8 offset = itr->second.pos & 1; // itr->second.pos % 2 + currVal = GetUInt16Value(PLAYER_SKILL_RANK_0 + field, offset); if (newVal) { // if skill value is going down, update enchantments before setting the new value if (newVal < currVal) UpdateSkillEnchantments(id, currVal, newVal); + // update step - SetUInt32Value(PLAYER_SKILL_VALUE_INDEX(itr->second.pos), MAKE_PAIR32(id, step)); + SetUInt16Value(PLAYER_SKILL_STEP_0 + field, offset, step); // update value - SetUInt32Value(PLAYER_SKILL_VALUE_INDEX(itr->second.pos), MAKE_SKILL_VALUE(newVal, maxVal)); + SetUInt16Value(PLAYER_SKILL_RANK_0 + field, offset, newVal); + SetUInt16Value(PLAYER_SKILL_MAX_RANK_0 + field, offset, maxVal); + if (itr->second.uState != SKILL_NEW) itr->second.uState = SKILL_CHANGED; + learnSkillRewardedSpells(id, newVal); // if skill value is going up, update enchantments after setting the new value if (newVal > currVal) UpdateSkillEnchantments(id, currVal, newVal); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL, id); UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LEVEL, id); } @@ -6554,9 +6556,12 @@ void Player::SetSkill(uint16 id, uint16 step, uint16 newVal, uint16 maxVal) //remove enchantments needing this skill UpdateSkillEnchantments(id, currVal, 0); // clear skill fields - SetUInt32Value(PLAYER_SKILL_INDEX(itr->second.pos), 0); - SetUInt32Value(PLAYER_SKILL_VALUE_INDEX(itr->second.pos), 0); - SetUInt32Value(PLAYER_SKILL_BONUS_INDEX(itr->second.pos), 0); + SetUInt16Value(PLAYER_SKILL_LINEID_0 + field, offset, 0); + SetUInt16Value(PLAYER_SKILL_STEP_0 + field, offset, 0); + SetUInt16Value(PLAYER_SKILL_RANK_0 + field, offset, 0); + SetUInt16Value(PLAYER_SKILL_MAX_RANK_0 + field, offset, 0); + SetUInt16Value(PLAYER_SKILL_MODIFIER_0 + field, offset, 0); + SetUInt16Value(PLAYER_SKILL_TALENT_0 + field, offset, 0); // mark as deleted or simply remove from map if not saved yet if (itr->second.uState != SKILL_NEW) @@ -6574,49 +6579,58 @@ void Player::SetSkill(uint16 id, uint16 step, uint16 newVal, uint16 maxVal) else if (newVal) //add { currVal = 0; - for (int i=0; i < PLAYER_MAX_SKILLS; ++i) - if (!GetUInt32Value(PLAYER_SKILL_INDEX(i))) + for (uint32 i = 0; i < PLAYER_MAX_SKILLS; ++i) { - SkillLineEntry const* pSkill = sSkillLineStore.LookupEntry(id); - if (!pSkill) + uint16 field = i / 2; + uint8 offset = i & 1; // i % 2 + + if (!GetUInt16Value(PLAYER_SKILL_LINEID_0 + field, offset)) { - sLog->outError("Skill not found in SkillLineStore: skill #%u", id); - return; - } + SkillLineEntry const* pSkill = sSkillLineStore.LookupEntry(id); + if (!pSkill) + { + sLog->outError("Skill not found in SkillLineStore: skill #%u", id); + return; + } - SetUInt32Value(PLAYER_SKILL_INDEX(i), MAKE_PAIR32(id, step)); - SetUInt32Value(PLAYER_SKILL_VALUE_INDEX(i), MAKE_SKILL_VALUE(newVal, maxVal)); - UpdateSkillEnchantments(id, currVal, newVal); - UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL, id); - UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LEVEL, id); + SetUInt16Value(PLAYER_SKILL_LINEID_0 + field, offset, id); + SetUInt16Value(PLAYER_SKILL_STEP_0 + field, offset, step); + SetUInt16Value(PLAYER_SKILL_RANK_0 + field, offset, newVal); + SetUInt16Value(PLAYER_SKILL_MAX_RANK_0 + field, offset, maxVal); - // insert new entry or update if not deleted old entry yet - if (itr != mSkillStatus.end()) - { - itr->second.pos = i; - itr->second.uState = SKILL_CHANGED; - } - else - mSkillStatus.insert(SkillStatusMap::value_type(id, SkillStatusData(i, SKILL_NEW))); + UpdateSkillEnchantments(id, currVal, newVal); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL, id); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LEVEL, id); - // apply skill bonuses - SetUInt32Value(PLAYER_SKILL_BONUS_INDEX(i), 0); + // insert new entry or update if not deleted old entry yet + if (itr != mSkillStatus.end()) + { + itr->second.pos = i; + itr->second.uState = SKILL_CHANGED; + } + else + mSkillStatus.insert(SkillStatusMap::value_type(id, SkillStatusData(i, SKILL_NEW))); - // temporary bonuses - AuraEffectList const& mModSkill = GetAuraEffectsByType(SPELL_AURA_MOD_SKILL); - for (AuraEffectList::const_iterator j = mModSkill.begin(); j != mModSkill.end(); ++j) - if ((*j)->GetMiscValue() == int32(id)) + // apply skill bonuses + SetUInt16Value(PLAYER_SKILL_MODIFIER_0 + field, offset, 0); + SetUInt16Value(PLAYER_SKILL_TALENT_0 + field, offset, 0); + + // temporary bonuses + AuraEffectList const& mModSkill = GetAuraEffectsByType(SPELL_AURA_MOD_SKILL); + for (AuraEffectList::const_iterator j = mModSkill.begin(); j != mModSkill.end(); ++j) + if ((*j)->GetMiscValue() == int32(id)) (*j)->HandleEffect(this, AURA_EFFECT_HANDLE_SKILL, true); - // permanent bonuses - AuraEffectList const& mModSkillTalent = GetAuraEffectsByType(SPELL_AURA_MOD_SKILL_TALENT); - for (AuraEffectList::const_iterator j = mModSkillTalent.begin(); j != mModSkillTalent.end(); ++j) - if ((*j)->GetMiscValue() == int32(id)) + // permanent bonuses + AuraEffectList const& mModSkillTalent = GetAuraEffectsByType(SPELL_AURA_MOD_SKILL_TALENT); + for (AuraEffectList::const_iterator j = mModSkillTalent.begin(); j != mModSkillTalent.end(); ++j) + if ((*j)->GetMiscValue() == int32(id)) (*j)->HandleEffect(this, AURA_EFFECT_HANDLE_SKILL, true); - // Learn all spells for skill - learnSkillRewardedSpells(id, newVal); - return; + // Learn all spells for skill + learnSkillRewardedSpells(id, newVal); + return; + } } } } @@ -6639,7 +6653,7 @@ uint16 Player::GetSkillStep(uint16 skill) const if (itr == mSkillStatus.end() || itr->second.uState == SKILL_DELETED) return 0; - return PAIR32_HIPART(GetUInt32Value(PLAYER_SKILL_INDEX(itr->second.pos))); + return GetUInt16Value(PLAYER_SKILL_STEP_0 + itr->second.pos / 2, itr->second.pos & 1); } uint16 Player::GetSkillValue(uint32 skill) const @@ -6651,11 +6665,12 @@ uint16 Player::GetSkillValue(uint32 skill) const if (itr == mSkillStatus.end() || itr->second.uState == SKILL_DELETED) return 0; - uint32 bonus = GetUInt32Value(PLAYER_SKILL_BONUS_INDEX(itr->second.pos)); + uint16 field = itr->second.pos / 2; + uint8 offset = itr->second.pos & 1; - int32 result = int32(SKILL_VALUE(GetUInt32Value(PLAYER_SKILL_VALUE_INDEX(itr->second.pos)))); - result += SKILL_TEMP_BONUS(bonus); - result += SKILL_PERM_BONUS(bonus); + int32 result = int32(GetUInt16Value(PLAYER_SKILL_RANK_0 + field, offset)); + result += int32(GetUInt16Value(PLAYER_SKILL_MODIFIER_0 + field, offset)); + result += int32(GetUInt16Value(PLAYER_SKILL_TALENT_0 + field, offset)); return result < 0 ? 0 : result; } @@ -6668,11 +6683,12 @@ uint16 Player::GetMaxSkillValue(uint32 skill) const if (itr == mSkillStatus.end() || itr->second.uState == SKILL_DELETED) return 0; - uint32 bonus = GetUInt32Value(PLAYER_SKILL_BONUS_INDEX(itr->second.pos)); + uint16 field = itr->second.pos / 2; + uint8 offset = itr->second.pos & 1; - int32 result = int32(SKILL_MAX(GetUInt32Value(PLAYER_SKILL_VALUE_INDEX(itr->second.pos)))); - result += SKILL_TEMP_BONUS(bonus); - result += SKILL_PERM_BONUS(bonus); + int32 result = int32(GetUInt16Value(PLAYER_SKILL_MAX_RANK_0 + field, offset)); + result += int32(GetUInt16Value(PLAYER_SKILL_MODIFIER_0 + field, offset)); + result += int32(GetUInt16Value(PLAYER_SKILL_TALENT_0 + field, offset)); return result < 0 ? 0 : result; } @@ -6685,7 +6701,10 @@ uint16 Player::GetPureMaxSkillValue(uint32 skill) const if (itr == mSkillStatus.end() || itr->second.uState == SKILL_DELETED) return 0; - return SKILL_MAX(GetUInt32Value(PLAYER_SKILL_VALUE_INDEX(itr->second.pos))); + uint16 field = itr->second.pos / 2; + uint8 offset = itr->second.pos & 1; + + return GetUInt16Value(PLAYER_SKILL_MAX_RANK_0 + field, offset); } uint16 Player::GetBaseSkillValue(uint32 skill) const @@ -6697,8 +6716,11 @@ uint16 Player::GetBaseSkillValue(uint32 skill) const if (itr == mSkillStatus.end() || itr->second.uState == SKILL_DELETED) return 0; - int32 result = int32(SKILL_VALUE(GetUInt32Value(PLAYER_SKILL_VALUE_INDEX(itr->second.pos)))); - result += SKILL_PERM_BONUS(GetUInt32Value(PLAYER_SKILL_BONUS_INDEX(itr->second.pos))); + uint16 field = itr->second.pos / 2; + uint8 offset = itr->second.pos & 1; + + int32 result = int32(GetUInt16Value(PLAYER_SKILL_RANK_0 + field, offset)); + result += int32(GetUInt16Value(PLAYER_SKILL_TALENT_0 + field, offset)); return result < 0 ? 0 : result; } @@ -6711,7 +6733,10 @@ uint16 Player::GetPureSkillValue(uint32 skill) const if (itr == mSkillStatus.end() || itr->second.uState == SKILL_DELETED) return 0; - return SKILL_VALUE(GetUInt32Value(PLAYER_SKILL_VALUE_INDEX(itr->second.pos))); + uint16 field = itr->second.pos / 2; + uint8 offset = itr->second.pos & 1; + + return GetUInt16Value(PLAYER_SKILL_RANK_0 + field, offset); } int16 Player::GetSkillPermBonusValue(uint32 skill) const @@ -6723,7 +6748,10 @@ int16 Player::GetSkillPermBonusValue(uint32 skill) const if (itr == mSkillStatus.end() || itr->second.uState == SKILL_DELETED) return 0; - return SKILL_PERM_BONUS(GetUInt32Value(PLAYER_SKILL_BONUS_INDEX(itr->second.pos))); + uint16 field = itr->second.pos / 2; + uint8 offset = itr->second.pos & 1; + + return GetUInt16Value(PLAYER_SKILL_TALENT_0 + field, offset); } int16 Player::GetSkillTempBonusValue(uint32 skill) const @@ -6735,7 +6763,10 @@ int16 Player::GetSkillTempBonusValue(uint32 skill) const if (itr == mSkillStatus.end() || itr->second.uState == SKILL_DELETED) return 0; - return SKILL_TEMP_BONUS(GetUInt32Value(PLAYER_SKILL_BONUS_INDEX(itr->second.pos))); + uint16 field = itr->second.pos / 2; + uint8 offset = itr->second.pos & 1; + + return GetUInt16Value(PLAYER_SKILL_MODIFIER_0 + field, offset); } void Player::SendActionButtons(uint32 state) const @@ -14200,17 +14231,13 @@ void Player::UpdateSkillEnchantments(uint16 skill_id, uint16 curr_value, uint16 void Player::SendEnchantmentDurations() { for (EnchantDurationList::const_iterator itr = m_enchantDuration.begin(); itr != m_enchantDuration.end(); ++itr) - { GetSession()->SendItemEnchantTimeUpdate(GetGUID(), itr->item->GetGUID(), itr->slot, uint32(itr->leftduration) / 1000); - } } void Player::SendItemDurations() { for (ItemDurationList::const_iterator itr = m_itemDuration.begin(); itr != m_itemDuration.end(); ++itr) - { (*itr)->SendTimeUpdate(this); - } } void Player::SendNewItem(Item* item, uint32 count, bool received, bool created, bool broadcast) @@ -19502,9 +19529,11 @@ void Player::_SaveSkills(SQLTransaction& trans) continue; } - uint32 valueData = GetUInt32Value(PLAYER_SKILL_VALUE_INDEX(itr->second.pos)); - uint16 value = SKILL_VALUE(valueData); - uint16 max = SKILL_MAX(valueData); + uint16 field = itr->second.pos / 2; + uint8 offset = itr->second.pos & 1; + + uint16 value = GetUInt16Value(PLAYER_SKILL_RANK_0 + field, offset); + uint16 max = GetUInt16Value(PLAYER_SKILL_MAX_RANK_0 + field, offset); switch (itr->second.uState) { @@ -19515,7 +19544,6 @@ void Player::_SaveSkills(SQLTransaction& trans) stmt->setUInt16(2, value); stmt->setUInt16(3, max); trans->Append(stmt); - break; case SKILL_CHANGED: stmt = CharacterDatabase.GetPreparedStatement(CHAR_UDP_CHAR_SKILLS); @@ -19524,13 +19552,12 @@ void Player::_SaveSkills(SQLTransaction& trans) stmt->setUInt32(2, GetGUIDLow()); stmt->setUInt16(3, uint16(itr->first)); trans->Append(stmt); - break; default: break; } - itr->second.uState = SKILL_UNCHANGED; + itr->second.uState = SKILL_UNCHANGED; ++itr; } } @@ -24074,6 +24101,7 @@ void Player::_LoadSkills(PreparedQueryResult result) // SetPQuery(PLAYER_LOGIN_QUERY_LOADSKILLS, "SELECT skill, value, max FROM character_skills WHERE guid = '%u'", GUID_LOPART(m_guid)); uint32 count = 0; + uint8 professionCount = 0; if (result) { do @@ -24116,14 +24144,28 @@ void Player::_LoadSkills(PreparedQueryResult result) continue; } - // enable unlearn button for primary professions only + uint16 field = count / 2; + uint8 offset = count & 1; + + SetUInt16Value(PLAYER_SKILL_LINEID_0 + field, offset, skill); + uint16 step = 0; + + if (pSkill->categoryId == SKILL_CATEGORY_SECONDARY) + step = max / 75; + if (pSkill->categoryId == SKILL_CATEGORY_PROFESSION) - SetUInt32Value(PLAYER_SKILL_INDEX(count), MAKE_PAIR32(skill, 1)); - else - SetUInt32Value(PLAYER_SKILL_INDEX(count), MAKE_PAIR32(skill, 0)); + { + step = max / 75; - SetUInt32Value(PLAYER_SKILL_VALUE_INDEX(count), MAKE_SKILL_VALUE(value, max)); - SetUInt32Value(PLAYER_SKILL_BONUS_INDEX(count), 0); + if (professionCount < 2) + SetUInt32Value(PLAYER_PROFESSION_SKILL_LINE_1 + professionCount++, skill); + } + + SetUInt16Value(PLAYER_SKILL_STEP_0 + field, offset, step); + SetUInt16Value(PLAYER_SKILL_RANK_0 + field, offset, value); + SetUInt16Value(PLAYER_SKILL_MAX_RANK_0 + field, offset, max); + SetUInt16Value(PLAYER_SKILL_MODIFIER_0 + field, offset, 0); + SetUInt16Value(PLAYER_SKILL_TALENT_0 + field, offset, 0); mSkillStatus.insert(SkillStatusMap::value_type(skill, SkillStatusData(count, SKILL_UNCHANGED))); @@ -24142,9 +24184,15 @@ void Player::_LoadSkills(PreparedQueryResult result) for (; count < PLAYER_MAX_SKILLS; ++count) { - SetUInt32Value(PLAYER_SKILL_INDEX(count), 0); - SetUInt32Value(PLAYER_SKILL_VALUE_INDEX(count), 0); - SetUInt32Value(PLAYER_SKILL_BONUS_INDEX(count), 0); + uint16 field = count / 2; + uint8 offset = count & 1; + + SetUInt16Value(PLAYER_SKILL_LINEID_0 + field, offset, 0); + SetUInt16Value(PLAYER_SKILL_STEP_0 + field, offset, 0); + SetUInt16Value(PLAYER_SKILL_RANK_0 + field, offset, 0); + SetUInt16Value(PLAYER_SKILL_MAX_RANK_0 + field, offset, 0); + SetUInt16Value(PLAYER_SKILL_MODIFIER_0 + field, offset, 0); + SetUInt16Value(PLAYER_SKILL_TALENT_0 + field, offset, 0); } // special settings diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 82189bf03e2..1f912902b0e 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -57,7 +57,7 @@ class UpdateMask; typedef std::deque PlayerMails; -#define PLAYER_MAX_SKILLS 127 +#define PLAYER_MAX_SKILLS 128 #define PLAYER_MAX_DAILY_QUESTS 25 #define PLAYER_EXPLORED_ZONES_SIZE 128 diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 7817e5e0d4d..9746cac2bbf 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -2834,17 +2834,17 @@ void AuraEffect::HandleAuraModSkill(AuraApplication const* aurApp, uint8 mode, b { if (!(mode & (AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK | AURA_EFFECT_HANDLE_SKILL))) return; - Unit* target = aurApp->GetTarget(); - if (target->GetTypeId() != TYPEID_PLAYER) + Player* target = aurApp->GetTarget()->ToPlayer(); + if (!target) return; uint32 prot = GetMiscValue(); int32 points = GetAmount(); - target->ToPlayer()->ModifySkillBonus(prot, ((apply) ? points: -points), GetAuraType() == SPELL_AURA_MOD_SKILL_TALENT); + target->ModifySkillBonus(prot, (apply ? points : -points), GetAuraType() == SPELL_AURA_MOD_SKILL_TALENT); if (prot == SKILL_DEFENSE) - target->ToPlayer()->UpdateDefenseBonusesMod(); + target->UpdateDefenseBonusesMod(); } /****************************/ -- cgit v1.2.3 From d23ae07f643200202829acaae2b28d79d25bceec Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 11 Jul 2012 00:13:41 +0200 Subject: Core/Players: Fixed saving/loading glyphs --- sql/base/characters_database.sql | 3 +++ .../characters/2012_07_10_00_characters_character_glyphs.sql | 4 ++++ src/server/game/Entities/Item/ItemPrototype.h | 3 --- src/server/game/Entities/Player/Player.cpp | 6 ------ src/server/game/Server/WorldSocket.cpp | 3 ++- src/server/shared/Database/Implementation/CharacterDatabase.cpp | 2 +- 6 files changed, 10 insertions(+), 11 deletions(-) create mode 100644 sql/updates/characters/2012_07_10_00_characters_character_glyphs.sql (limited to 'src') diff --git a/sql/base/characters_database.sql b/sql/base/characters_database.sql index 3016614cd0e..93c5ee59cf1 100644 --- a/sql/base/characters_database.sql +++ b/sql/base/characters_database.sql @@ -623,6 +623,9 @@ CREATE TABLE `character_glyphs` ( `glyph4` smallint(5) unsigned DEFAULT '0', `glyph5` smallint(5) unsigned DEFAULT '0', `glyph6` smallint(5) unsigned DEFAULT '0', + `glyph7` smallint(5) unsigned DEFAULT '0', + `glyph8` smallint(5) unsigned DEFAULT '0', + `glyph9` smallint(5) unsigned DEFAULT '0', PRIMARY KEY (`guid`,`spec`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; diff --git a/sql/updates/characters/2012_07_10_00_characters_character_glyphs.sql b/sql/updates/characters/2012_07_10_00_characters_character_glyphs.sql new file mode 100644 index 00000000000..b8aba4d7798 --- /dev/null +++ b/sql/updates/characters/2012_07_10_00_characters_character_glyphs.sql @@ -0,0 +1,4 @@ +ALTER TABLE `character_glyphs` + ADD `glyph7` smallint(5) unsigned DEFAULT '0' AFTER `glyph6`, + ADD `glyph8` smallint(5) unsigned DEFAULT '0' AFTER `glyph7`, + ADD `glyph9` smallint(5) unsigned DEFAULT '0' AFTER `glyph8`; diff --git a/src/server/game/Entities/Item/ItemPrototype.h b/src/server/game/Entities/Item/ItemPrototype.h index 2da0e721a20..0b7e361213a 100755 --- a/src/server/game/Entities/Item/ItemPrototype.h +++ b/src/server/game/Entities/Item/ItemPrototype.h @@ -59,9 +59,6 @@ enum ItemModType ITEM_MOD_EXPERTISE_RATING = 37, ITEM_MOD_ATTACK_POWER = 38, ITEM_MOD_RANGED_ATTACK_POWER = 39, - //ITEM_MOD_FERAL_ATTACK_POWER = 40, not in 3.3 - ITEM_MOD_SPELL_HEALING_DONE = 41, // deprecated - ITEM_MOD_SPELL_DAMAGE_DONE = 42, // deprecated ITEM_MOD_MANA_REGENERATION = 43, ITEM_MOD_ARMOR_PENETRATION_RATING = 44, ITEM_MOD_SPELL_POWER = 45, diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 58bd08ddcf0..988404b1829 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -8179,10 +8179,6 @@ void Player::_ApplyItemBonuses(ItemTemplate const* proto, uint8 slot, bool apply ApplyModInt32Value(PLAYER_FIELD_MOD_TARGET_RESISTANCE, -val, apply); m_spellPenetrationItemMod += apply ? val : -val; break; - // deprecated item mods - case ITEM_MOD_SPELL_HEALING_DONE: - case ITEM_MOD_SPELL_DAMAGE_DONE: - break; case ITEM_MOD_FIRE_RESISTANCE: HandleStatModifier(UNIT_MOD_RESISTANCE_FIRE, BASE_VALUE, float(val), apply); break; @@ -14121,8 +14117,6 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool HandleBaseModValue(SHIELD_BLOCK_VALUE, FLAT_MOD, float(enchant_amount), apply); sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u BLOCK_VALUE", enchant_amount); break; - case ITEM_MOD_SPELL_HEALING_DONE: // deprecated - case ITEM_MOD_SPELL_DAMAGE_DONE: // deprecated default: break; } diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index 968a5b850e2..96aad364f13 100755 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -981,8 +981,9 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) if (memcmp(sha.GetDigest(), digest, 20)) { WorldPacket packet(SMSG_AUTH_RESPONSE, 1); + packet.WriteBit(0); // has queue info + packet.WriteBit(0); // has account info packet << uint8(AUTH_FAILED); - SendPacket(packet); sLog->outError("WorldSocket::HandleAuthSession: Authentication failed for account: %u ('%s') address: %s", id, account.c_str(), address.c_str()); diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index 3bd398d040e..b5c42f560ae 100755 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -553,7 +553,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_DEL_PETITION_SIGNATURE_BY_OWNER, "DELETE FROM petition_sign WHERE ownerguid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_DEL_PETITION_BY_OWNER_AND_TYPE, "DELETE FROM petition WHERE ownerguid = ? AND type = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_DEL_PETITION_SIGNATURE_BY_OWNER_AND_TYPE, "DELETE FROM petition_sign WHERE ownerguid = ? AND type = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_INS_CHAR_GLYPHS, "INSERT INTO character_glyphs VALUES(?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_INS_CHAR_GLYPHS, "INSERT INTO character_glyphs (guid, spec, glyph1, glyph2, glyph3, glyph4, glyph5, glyph6, glyph7, glyph8, glyph9) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_DEL_CHAR_TALENT_BY_SPELL_SPEC, "DELETE FROM character_talent WHERE guid = ? and spell = ? and spec = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_INS_CHAR_TALENT, "INSERT INTO character_talent (guid, spell, spec) VALUES (?, ?, ?)", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_DEL_CHAR_ACTION_EXCEPT_SPEC, "DELETE FROM character_action WHERE spec<>? AND guid = ?", CONNECTION_ASYNC); -- cgit v1.2.3 From 5713480e77ef151f92624cd1a128bca2e10c3003 Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 11 Jul 2012 00:14:19 +0200 Subject: Core/Misc: Updated ResponseCodes enum --- src/server/game/Miscellaneous/SharedDefines.h | 640 +++++++++++++------------- 1 file changed, 320 insertions(+), 320 deletions(-) (limited to 'src') diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 7d12f94d155..987876dd5e5 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -854,211 +854,211 @@ enum SpellEffects enum SpellCastResult { - SPELL_FAILED_SUCCESS = 0, - SPELL_FAILED_AFFECTING_COMBAT = 1, - SPELL_FAILED_ALREADY_AT_FULL_HEALTH = 2, - SPELL_FAILED_ALREADY_AT_FULL_MANA = 3, - SPELL_FAILED_ALREADY_AT_FULL_POWER = 4, - SPELL_FAILED_ALREADY_BEING_TAMED = 5, - SPELL_FAILED_ALREADY_HAVE_CHARM = 6, - SPELL_FAILED_ALREADY_HAVE_SUMMON = 7, - SPELL_FAILED_ALREADY_HAVE_PET = 8, - SPELL_FAILED_ALREADY_OPEN = 9, - SPELL_FAILED_AURA_BOUNCED = 10, - SPELL_FAILED_AUTOTRACK_INTERRUPTED = 11, - SPELL_FAILED_BAD_IMPLICIT_TARGETS = 12, - SPELL_FAILED_BAD_TARGETS = 13, - SPELL_FAILED_CANT_BE_CHARMED = 14, - SPELL_FAILED_CANT_BE_DISENCHANTED = 15, - SPELL_FAILED_CANT_BE_DISENCHANTED_SKILL = 16, - SPELL_FAILED_CANT_BE_MILLED = 17, - SPELL_FAILED_CANT_BE_PROSPECTED = 18, - SPELL_FAILED_CANT_CAST_ON_TAPPED = 19, - SPELL_FAILED_CANT_DUEL_WHILE_INVISIBLE = 20, - SPELL_FAILED_CANT_DUEL_WHILE_STEALTHED = 21, - SPELL_FAILED_CANT_STEALTH = 22, - SPELL_FAILED_CASTER_AURASTATE = 23, - SPELL_FAILED_CASTER_DEAD = 24, - SPELL_FAILED_CHARMED = 25, - SPELL_FAILED_CHEST_IN_USE = 26, - SPELL_FAILED_CONFUSED = 27, - SPELL_FAILED_DONT_REPORT = 28, - SPELL_FAILED_EQUIPPED_ITEM = 29, - SPELL_FAILED_EQUIPPED_ITEM_CLASS = 30, - SPELL_FAILED_EQUIPPED_ITEM_CLASS_MAINHAND = 31, - SPELL_FAILED_EQUIPPED_ITEM_CLASS_OFFHAND = 32, - SPELL_FAILED_ERROR = 33, - SPELL_FAILED_FALLING = 34, - SPELL_FAILED_FIZZLE = 35, - SPELL_FAILED_FLEEING = 36, - SPELL_FAILED_FOOD_LOWLEVEL = 37, - SPELL_FAILED_HIGHLEVEL = 38, - SPELL_FAILED_HUNGER_SATIATED = 39, - SPELL_FAILED_IMMUNE = 40, - SPELL_FAILED_INCORRECT_AREA = 41, - SPELL_FAILED_INTERRUPTED = 42, - SPELL_FAILED_INTERRUPTED_COMBAT = 43, - SPELL_FAILED_ITEM_ALREADY_ENCHANTED = 44, - SPELL_FAILED_ITEM_GONE = 45, - SPELL_FAILED_ITEM_NOT_FOUND = 46, - SPELL_FAILED_ITEM_NOT_READY = 47, - SPELL_FAILED_LEVEL_REQUIREMENT = 48, - SPELL_FAILED_LINE_OF_SIGHT = 49, - SPELL_FAILED_LOWLEVEL = 50, - SPELL_FAILED_LOW_CASTLEVEL = 51, - SPELL_FAILED_MAINHAND_EMPTY = 52, - SPELL_FAILED_MOVING = 53, - SPELL_FAILED_NEED_AMMO = 54, - SPELL_FAILED_NEED_AMMO_POUCH = 55, - SPELL_FAILED_NEED_EXOTIC_AMMO = 56, - SPELL_FAILED_NEED_MORE_ITEMS = 57, - SPELL_FAILED_NOPATH = 58, - SPELL_FAILED_NOT_BEHIND = 59, - SPELL_FAILED_NOT_FISHABLE = 60, - SPELL_FAILED_NOT_FLYING = 61, - SPELL_FAILED_NOT_HERE = 62, - SPELL_FAILED_NOT_INFRONT = 63, - SPELL_FAILED_NOT_IN_CONTROL = 64, - SPELL_FAILED_NOT_KNOWN = 65, - SPELL_FAILED_NOT_MOUNTED = 66, - SPELL_FAILED_NOT_ON_TAXI = 67, - SPELL_FAILED_NOT_ON_TRANSPORT = 68, - SPELL_FAILED_NOT_READY = 69, - SPELL_FAILED_NOT_SHAPESHIFT = 70, - SPELL_FAILED_NOT_STANDING = 71, - SPELL_FAILED_NOT_TRADEABLE = 72, - SPELL_FAILED_NOT_TRADING = 73, - SPELL_FAILED_NOT_UNSHEATHED = 74, - SPELL_FAILED_NOT_WHILE_GHOST = 75, - SPELL_FAILED_NOT_WHILE_LOOTING = 76, - SPELL_FAILED_NO_AMMO = 77, - SPELL_FAILED_NO_CHARGES_REMAIN = 78, - SPELL_FAILED_NO_CHAMPION = 79, - SPELL_FAILED_NO_COMBO_POINTS = 80, - SPELL_FAILED_NO_DUELING = 81, - SPELL_FAILED_NO_ENDURANCE = 82, - SPELL_FAILED_NO_FISH = 83, - SPELL_FAILED_NO_ITEMS_WHILE_SHAPESHIFTED = 84, - SPELL_FAILED_NO_MOUNTS_ALLOWED = 85, - SPELL_FAILED_NO_PET = 86, - SPELL_FAILED_NO_POWER = 87, - SPELL_FAILED_NOTHING_TO_DISPEL = 88, - SPELL_FAILED_NOTHING_TO_STEAL = 89, - SPELL_FAILED_ONLY_ABOVEWATER = 90, - SPELL_FAILED_ONLY_DAYTIME = 91, - SPELL_FAILED_ONLY_INDOORS = 92, - SPELL_FAILED_ONLY_MOUNTED = 93, - SPELL_FAILED_ONLY_NIGHTTIME = 94, - SPELL_FAILED_ONLY_OUTDOORS = 95, - SPELL_FAILED_ONLY_SHAPESHIFT = 96, - SPELL_FAILED_ONLY_STEALTHED = 97, - SPELL_FAILED_ONLY_UNDERWATER = 98, - SPELL_FAILED_OUT_OF_RANGE = 99, - SPELL_FAILED_PACIFIED = 100, - SPELL_FAILED_POSSESSED = 101, - SPELL_FAILED_REAGENTS = 102, - SPELL_FAILED_REQUIRES_AREA = 103, - SPELL_FAILED_REQUIRES_SPELL_FOCUS = 104, - SPELL_FAILED_ROOTED = 105, - SPELL_FAILED_SILENCED = 106, - SPELL_FAILED_SPELL_IN_PROGRESS = 107, - SPELL_FAILED_SPELL_LEARNED = 108, - SPELL_FAILED_SPELL_UNAVAILABLE = 109, - SPELL_FAILED_STUNNED = 110, - SPELL_FAILED_TARGETS_DEAD = 111, - SPELL_FAILED_TARGET_AFFECTING_COMBAT = 112, - SPELL_FAILED_TARGET_AURASTATE = 113, - SPELL_FAILED_TARGET_DUELING = 114, - SPELL_FAILED_TARGET_ENEMY = 115, - SPELL_FAILED_TARGET_ENRAGED = 116, - SPELL_FAILED_TARGET_FRIENDLY = 117, - SPELL_FAILED_TARGET_IN_COMBAT = 118, - SPELL_FAILED_TARGET_IS_PLAYER = 119, - SPELL_FAILED_TARGET_IS_PLAYER_CONTROLLED = 120, - SPELL_FAILED_TARGET_NOT_DEAD = 121, - SPELL_FAILED_TARGET_NOT_IN_PARTY = 122, - SPELL_FAILED_TARGET_NOT_LOOTED = 123, - SPELL_FAILED_TARGET_NOT_PLAYER = 124, - SPELL_FAILED_TARGET_NO_POCKETS = 125, - SPELL_FAILED_TARGET_NO_WEAPONS = 126, - SPELL_FAILED_TARGET_NO_RANGED_WEAPONS = 127, - SPELL_FAILED_TARGET_UNSKINNABLE = 128, - SPELL_FAILED_THIRST_SATIATED = 129, - SPELL_FAILED_TOO_CLOSE = 130, - SPELL_FAILED_TOO_MANY_OF_ITEM = 131, - SPELL_FAILED_TOTEM_CATEGORY = 132, - SPELL_FAILED_TOTEMS = 133, - SPELL_FAILED_TRY_AGAIN = 134, - SPELL_FAILED_UNIT_NOT_BEHIND = 135, - SPELL_FAILED_UNIT_NOT_INFRONT = 136, - SPELL_FAILED_VISION_OBSCURED = 137, - SPELL_FAILED_WRONG_PET_FOOD = 138, - SPELL_FAILED_NOT_WHILE_FATIGUED = 139, - SPELL_FAILED_TARGET_NOT_IN_INSTANCE = 140, - SPELL_FAILED_NOT_WHILE_TRADING = 141, - SPELL_FAILED_TARGET_NOT_IN_RAID = 142, - SPELL_FAILED_TARGET_FREEFORALL = 143, - SPELL_FAILED_NO_EDIBLE_CORPSES = 144, - SPELL_FAILED_ONLY_BATTLEGROUNDS = 145, - SPELL_FAILED_TARGET_NOT_GHOST = 146, - SPELL_FAILED_TRANSFORM_UNUSABLE = 147, - SPELL_FAILED_WRONG_WEATHER = 148, - SPELL_FAILED_DAMAGE_IMMUNE = 149, - SPELL_FAILED_PREVENTED_BY_MECHANIC = 150, - SPELL_FAILED_PLAY_TIME = 151, - SPELL_FAILED_REPUTATION = 152, - SPELL_FAILED_MIN_SKILL = 153, - SPELL_FAILED_NOT_IN_RATED_BATTLEGROUND = 154, - SPELL_FAILED_NOT_ON_SHAPESHIFT = 155, - SPELL_FAILED_NOT_ON_STEALTHED = 156, - SPELL_FAILED_NOT_ON_DAMAGE_IMMUNE = 157, - SPELL_FAILED_NOT_ON_MOUNTED = 158, - SPELL_FAILED_TOO_SHALLOW = 159, - SPELL_FAILED_TARGET_NOT_IN_SANCTUARY = 160, - SPELL_FAILED_TARGET_IS_TRIVIAL = 161, - SPELL_FAILED_BM_OR_INVISGOD = 162, - SPELL_FAILED_EXPERT_RIDING_REQUIREMENT = 163, - SPELL_FAILED_ARTISAN_RIDING_REQUIREMENT = 164, - SPELL_FAILED_NOT_IDLE = 165, - SPELL_FAILED_NOT_INACTIVE = 166, - SPELL_FAILED_PARTIAL_PLAYTIME = 167, - SPELL_FAILED_NO_PLAYTIME = 168, - SPELL_FAILED_NOT_IN_BATTLEGROUND = 169, - SPELL_FAILED_NOT_IN_RAID_INSTANCE = 170, - SPELL_FAILED_ONLY_IN_ARENA = 171, - SPELL_FAILED_TARGET_LOCKED_TO_RAID_INSTANCE= 172, - SPELL_FAILED_ON_USE_ENCHANT = 173, - SPELL_FAILED_NOT_ON_GROUND = 174, - SPELL_FAILED_CUSTOM_ERROR = 175, - SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW = 176, - SPELL_FAILED_TOO_MANY_SOCKETS = 177, - SPELL_FAILED_INVALID_GLYPH = 178, - SPELL_FAILED_UNIQUE_GLYPH = 179, - SPELL_FAILED_GLYPH_SOCKET_LOCKED = 180, - SPELL_FAILED_NO_VALID_TARGETS = 181, - SPELL_FAILED_ITEM_AT_MAX_CHARGES = 182, - SPELL_FAILED_NOT_IN_BARBERSHOP = 183, - SPELL_FAILED_FISHING_TOO_LOW = 184, - SPELL_FAILED_ITEM_ENCHANT_TRADE_WINDOW = 185, - SPELL_FAILED_SUMMON_PENDING = 186, - SPELL_FAILED_MAX_SOCKETS = 187, - SPELL_FAILED_PET_CAN_RENAME = 188, - SPELL_FAILED_TARGET_CANNOT_BE_RESURRECTED = 189, - SPELL_FAILED_NO_ACTIONS = 190, - SPELL_FAILED_CURRENCY_WEIGHT_MISMATCH = 191, - SPELL_FAILED_WEIGHT_NOT_ENOUGH = 192, - SPELL_FAILED_WEIGHT_TOO_MUCH = 193, - SPELL_FAILED_NO_VACANT_SEAT = 194, - SPELL_FAILED_NO_LIQUID = 195, - SPELL_FAILED_ONLY_NOT_SWIMMING = 196, - SPELL_FAILED_BY_NOT_MOVING = 197, - SPELL_FAILED_IN_COMBAT_RES_LIMIT_REACHED = 198, - SPELL_FAILED_NOT_IN_ARENA = 199, - SPELL_FAILED_TARGET_NOT_GROUNDED = 200, - SPELL_FAILED_EXCEEDED_WEEKLY_USAGE = 201, - SPELL_FAILED_NOT_IN_LFG_DUNGEON = 202, - SPELL_FAILED_UNKNOWN = 254, // custom value, default case - SPELL_CAST_OK = 255, // custom value, must not be sent to client + SPELL_FAILED_SUCCESS = 0, + SPELL_FAILED_AFFECTING_COMBAT = 1, + SPELL_FAILED_ALREADY_AT_FULL_HEALTH = 2, + SPELL_FAILED_ALREADY_AT_FULL_MANA = 3, + SPELL_FAILED_ALREADY_AT_FULL_POWER = 4, + SPELL_FAILED_ALREADY_BEING_TAMED = 5, + SPELL_FAILED_ALREADY_HAVE_CHARM = 6, + SPELL_FAILED_ALREADY_HAVE_SUMMON = 7, + SPELL_FAILED_ALREADY_HAVE_PET = 8, + SPELL_FAILED_ALREADY_OPEN = 9, + SPELL_FAILED_AURA_BOUNCED = 10, + SPELL_FAILED_AUTOTRACK_INTERRUPTED = 11, + SPELL_FAILED_BAD_IMPLICIT_TARGETS = 12, + SPELL_FAILED_BAD_TARGETS = 13, + SPELL_FAILED_CANT_BE_CHARMED = 14, + SPELL_FAILED_CANT_BE_DISENCHANTED = 15, + SPELL_FAILED_CANT_BE_DISENCHANTED_SKILL = 16, + SPELL_FAILED_CANT_BE_MILLED = 17, + SPELL_FAILED_CANT_BE_PROSPECTED = 18, + SPELL_FAILED_CANT_CAST_ON_TAPPED = 19, + SPELL_FAILED_CANT_DUEL_WHILE_INVISIBLE = 20, + SPELL_FAILED_CANT_DUEL_WHILE_STEALTHED = 21, + SPELL_FAILED_CANT_STEALTH = 22, + SPELL_FAILED_CASTER_AURASTATE = 23, + SPELL_FAILED_CASTER_DEAD = 24, + SPELL_FAILED_CHARMED = 25, + SPELL_FAILED_CHEST_IN_USE = 26, + SPELL_FAILED_CONFUSED = 27, + SPELL_FAILED_DONT_REPORT = 28, + SPELL_FAILED_EQUIPPED_ITEM = 29, + SPELL_FAILED_EQUIPPED_ITEM_CLASS = 30, + SPELL_FAILED_EQUIPPED_ITEM_CLASS_MAINHAND = 31, + SPELL_FAILED_EQUIPPED_ITEM_CLASS_OFFHAND = 32, + SPELL_FAILED_ERROR = 33, + SPELL_FAILED_FALLING = 34, + SPELL_FAILED_FIZZLE = 35, + SPELL_FAILED_FLEEING = 36, + SPELL_FAILED_FOOD_LOWLEVEL = 37, + SPELL_FAILED_HIGHLEVEL = 38, + SPELL_FAILED_HUNGER_SATIATED = 39, + SPELL_FAILED_IMMUNE = 40, + SPELL_FAILED_INCORRECT_AREA = 41, + SPELL_FAILED_INTERRUPTED = 42, + SPELL_FAILED_INTERRUPTED_COMBAT = 43, + SPELL_FAILED_ITEM_ALREADY_ENCHANTED = 44, + SPELL_FAILED_ITEM_GONE = 45, + SPELL_FAILED_ITEM_NOT_FOUND = 46, + SPELL_FAILED_ITEM_NOT_READY = 47, + SPELL_FAILED_LEVEL_REQUIREMENT = 48, + SPELL_FAILED_LINE_OF_SIGHT = 49, + SPELL_FAILED_LOWLEVEL = 50, + SPELL_FAILED_LOW_CASTLEVEL = 51, + SPELL_FAILED_MAINHAND_EMPTY = 52, + SPELL_FAILED_MOVING = 53, + SPELL_FAILED_NEED_AMMO = 54, + SPELL_FAILED_NEED_AMMO_POUCH = 55, + SPELL_FAILED_NEED_EXOTIC_AMMO = 56, + SPELL_FAILED_NEED_MORE_ITEMS = 57, + SPELL_FAILED_NOPATH = 58, + SPELL_FAILED_NOT_BEHIND = 59, + SPELL_FAILED_NOT_FISHABLE = 60, + SPELL_FAILED_NOT_FLYING = 61, + SPELL_FAILED_NOT_HERE = 62, + SPELL_FAILED_NOT_INFRONT = 63, + SPELL_FAILED_NOT_IN_CONTROL = 64, + SPELL_FAILED_NOT_KNOWN = 65, + SPELL_FAILED_NOT_MOUNTED = 66, + SPELL_FAILED_NOT_ON_TAXI = 67, + SPELL_FAILED_NOT_ON_TRANSPORT = 68, + SPELL_FAILED_NOT_READY = 69, + SPELL_FAILED_NOT_SHAPESHIFT = 70, + SPELL_FAILED_NOT_STANDING = 71, + SPELL_FAILED_NOT_TRADEABLE = 72, + SPELL_FAILED_NOT_TRADING = 73, + SPELL_FAILED_NOT_UNSHEATHED = 74, + SPELL_FAILED_NOT_WHILE_GHOST = 75, + SPELL_FAILED_NOT_WHILE_LOOTING = 76, + SPELL_FAILED_NO_AMMO = 77, + SPELL_FAILED_NO_CHARGES_REMAIN = 78, + SPELL_FAILED_NO_CHAMPION = 79, + SPELL_FAILED_NO_COMBO_POINTS = 80, + SPELL_FAILED_NO_DUELING = 81, + SPELL_FAILED_NO_ENDURANCE = 82, + SPELL_FAILED_NO_FISH = 83, + SPELL_FAILED_NO_ITEMS_WHILE_SHAPESHIFTED = 84, + SPELL_FAILED_NO_MOUNTS_ALLOWED = 85, + SPELL_FAILED_NO_PET = 86, + SPELL_FAILED_NO_POWER = 87, + SPELL_FAILED_NOTHING_TO_DISPEL = 88, + SPELL_FAILED_NOTHING_TO_STEAL = 89, + SPELL_FAILED_ONLY_ABOVEWATER = 90, + SPELL_FAILED_ONLY_DAYTIME = 91, + SPELL_FAILED_ONLY_INDOORS = 92, + SPELL_FAILED_ONLY_MOUNTED = 93, + SPELL_FAILED_ONLY_NIGHTTIME = 94, + SPELL_FAILED_ONLY_OUTDOORS = 95, + SPELL_FAILED_ONLY_SHAPESHIFT = 96, + SPELL_FAILED_ONLY_STEALTHED = 97, + SPELL_FAILED_ONLY_UNDERWATER = 98, + SPELL_FAILED_OUT_OF_RANGE = 99, + SPELL_FAILED_PACIFIED = 100, + SPELL_FAILED_POSSESSED = 101, + SPELL_FAILED_REAGENTS = 102, + SPELL_FAILED_REQUIRES_AREA = 103, + SPELL_FAILED_REQUIRES_SPELL_FOCUS = 104, + SPELL_FAILED_ROOTED = 105, + SPELL_FAILED_SILENCED = 106, + SPELL_FAILED_SPELL_IN_PROGRESS = 107, + SPELL_FAILED_SPELL_LEARNED = 108, + SPELL_FAILED_SPELL_UNAVAILABLE = 109, + SPELL_FAILED_STUNNED = 110, + SPELL_FAILED_TARGETS_DEAD = 111, + SPELL_FAILED_TARGET_AFFECTING_COMBAT = 112, + SPELL_FAILED_TARGET_AURASTATE = 113, + SPELL_FAILED_TARGET_DUELING = 114, + SPELL_FAILED_TARGET_ENEMY = 115, + SPELL_FAILED_TARGET_ENRAGED = 116, + SPELL_FAILED_TARGET_FRIENDLY = 117, + SPELL_FAILED_TARGET_IN_COMBAT = 118, + SPELL_FAILED_TARGET_IS_PLAYER = 119, + SPELL_FAILED_TARGET_IS_PLAYER_CONTROLLED = 120, + SPELL_FAILED_TARGET_NOT_DEAD = 121, + SPELL_FAILED_TARGET_NOT_IN_PARTY = 122, + SPELL_FAILED_TARGET_NOT_LOOTED = 123, + SPELL_FAILED_TARGET_NOT_PLAYER = 124, + SPELL_FAILED_TARGET_NO_POCKETS = 125, + SPELL_FAILED_TARGET_NO_WEAPONS = 126, + SPELL_FAILED_TARGET_NO_RANGED_WEAPONS = 127, + SPELL_FAILED_TARGET_UNSKINNABLE = 128, + SPELL_FAILED_THIRST_SATIATED = 129, + SPELL_FAILED_TOO_CLOSE = 130, + SPELL_FAILED_TOO_MANY_OF_ITEM = 131, + SPELL_FAILED_TOTEM_CATEGORY = 132, + SPELL_FAILED_TOTEMS = 133, + SPELL_FAILED_TRY_AGAIN = 134, + SPELL_FAILED_UNIT_NOT_BEHIND = 135, + SPELL_FAILED_UNIT_NOT_INFRONT = 136, + SPELL_FAILED_VISION_OBSCURED = 137, + SPELL_FAILED_WRONG_PET_FOOD = 138, + SPELL_FAILED_NOT_WHILE_FATIGUED = 139, + SPELL_FAILED_TARGET_NOT_IN_INSTANCE = 140, + SPELL_FAILED_NOT_WHILE_TRADING = 141, + SPELL_FAILED_TARGET_NOT_IN_RAID = 142, + SPELL_FAILED_TARGET_FREEFORALL = 143, + SPELL_FAILED_NO_EDIBLE_CORPSES = 144, + SPELL_FAILED_ONLY_BATTLEGROUNDS = 145, + SPELL_FAILED_TARGET_NOT_GHOST = 146, + SPELL_FAILED_TRANSFORM_UNUSABLE = 147, + SPELL_FAILED_WRONG_WEATHER = 148, + SPELL_FAILED_DAMAGE_IMMUNE = 149, + SPELL_FAILED_PREVENTED_BY_MECHANIC = 150, + SPELL_FAILED_PLAY_TIME = 151, + SPELL_FAILED_REPUTATION = 152, + SPELL_FAILED_MIN_SKILL = 153, + SPELL_FAILED_NOT_IN_RATED_BATTLEGROUND = 154, + SPELL_FAILED_NOT_ON_SHAPESHIFT = 155, + SPELL_FAILED_NOT_ON_STEALTHED = 156, + SPELL_FAILED_NOT_ON_DAMAGE_IMMUNE = 157, + SPELL_FAILED_NOT_ON_MOUNTED = 158, + SPELL_FAILED_TOO_SHALLOW = 159, + SPELL_FAILED_TARGET_NOT_IN_SANCTUARY = 160, + SPELL_FAILED_TARGET_IS_TRIVIAL = 161, + SPELL_FAILED_BM_OR_INVISGOD = 162, + SPELL_FAILED_EXPERT_RIDING_REQUIREMENT = 163, + SPELL_FAILED_ARTISAN_RIDING_REQUIREMENT = 164, + SPELL_FAILED_NOT_IDLE = 165, + SPELL_FAILED_NOT_INACTIVE = 166, + SPELL_FAILED_PARTIAL_PLAYTIME = 167, + SPELL_FAILED_NO_PLAYTIME = 168, + SPELL_FAILED_NOT_IN_BATTLEGROUND = 169, + SPELL_FAILED_NOT_IN_RAID_INSTANCE = 170, + SPELL_FAILED_ONLY_IN_ARENA = 171, + SPELL_FAILED_TARGET_LOCKED_TO_RAID_INSTANCE = 172, + SPELL_FAILED_ON_USE_ENCHANT = 173, + SPELL_FAILED_NOT_ON_GROUND = 174, + SPELL_FAILED_CUSTOM_ERROR = 175, + SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW = 176, + SPELL_FAILED_TOO_MANY_SOCKETS = 177, + SPELL_FAILED_INVALID_GLYPH = 178, + SPELL_FAILED_UNIQUE_GLYPH = 179, + SPELL_FAILED_GLYPH_SOCKET_LOCKED = 180, + SPELL_FAILED_NO_VALID_TARGETS = 181, + SPELL_FAILED_ITEM_AT_MAX_CHARGES = 182, + SPELL_FAILED_NOT_IN_BARBERSHOP = 183, + SPELL_FAILED_FISHING_TOO_LOW = 184, + SPELL_FAILED_ITEM_ENCHANT_TRADE_WINDOW = 185, + SPELL_FAILED_SUMMON_PENDING = 186, + SPELL_FAILED_MAX_SOCKETS = 187, + SPELL_FAILED_PET_CAN_RENAME = 188, + SPELL_FAILED_TARGET_CANNOT_BE_RESURRECTED = 189, + SPELL_FAILED_NO_ACTIONS = 190, + SPELL_FAILED_CURRENCY_WEIGHT_MISMATCH = 191, + SPELL_FAILED_WEIGHT_NOT_ENOUGH = 192, + SPELL_FAILED_WEIGHT_TOO_MUCH = 193, + SPELL_FAILED_NO_VACANT_SEAT = 194, + SPELL_FAILED_NO_LIQUID = 195, + SPELL_FAILED_ONLY_NOT_SWIMMING = 196, + SPELL_FAILED_BY_NOT_MOVING = 197, + SPELL_FAILED_IN_COMBAT_RES_LIMIT_REACHED = 198, + SPELL_FAILED_NOT_IN_ARENA = 199, + SPELL_FAILED_TARGET_NOT_GROUNDED = 200, + SPELL_FAILED_EXCEEDED_WEEKLY_USAGE = 201, + SPELL_FAILED_NOT_IN_LFG_DUNGEON = 202, + SPELL_FAILED_UNKNOWN = 254, // custom value, default case + SPELL_CAST_OK = 255, // custom value, must not be sent to client }; enum SpellCustomErrors @@ -3284,121 +3284,121 @@ enum EventId enum ResponseCodes { - RESPONSE_SUCCESS = 0x00, - RESPONSE_FAILURE = 0x01, - RESPONSE_CANCELLED = 0x02, - RESPONSE_DISCONNECTED = 0x03, - RESPONSE_FAILED_TO_CONNECT = 0x04, - RESPONSE_CONNECTED = 0x05, - RESPONSE_VERSION_MISMATCH = 0x06, - - CSTATUS_CONNECTING = 0x07, - CSTATUS_NEGOTIATING_SECURITY = 0x08, - CSTATUS_NEGOTIATION_COMPLETE = 0x09, - CSTATUS_NEGOTIATION_FAILED = 0x0A, - CSTATUS_AUTHENTICATING = 0x0B, - - AUTH_OK = 0x0C, - AUTH_FAILED = 0x0D, - AUTH_REJECT = 0x0E, - AUTH_BAD_SERVER_PROOF = 0x0F, - AUTH_UNAVAILABLE = 0x10, - AUTH_SYSTEM_ERROR = 0x11, - AUTH_BILLING_ERROR = 0x12, - AUTH_BILLING_EXPIRED = 0x13, - AUTH_VERSION_MISMATCH = 0x14, - AUTH_UNKNOWN_ACCOUNT = 0x15, - AUTH_INCORRECT_PASSWORD = 0x16, - AUTH_SESSION_EXPIRED = 0x17, - AUTH_SERVER_SHUTTING_DOWN = 0x18, - AUTH_ALREADY_LOGGING_IN = 0x19, - AUTH_LOGIN_SERVER_NOT_FOUND = 0x1A, - AUTH_WAIT_QUEUE = 0x1B, - AUTH_BANNED = 0x1C, - AUTH_ALREADY_ONLINE = 0x1D, - AUTH_NO_TIME = 0x1E, - AUTH_DB_BUSY = 0x1F, - AUTH_SUSPENDED = 0x20, - AUTH_PARENTAL_CONTROL = 0x21, - AUTH_LOCKED_ENFORCED = 0x22, - - REALM_LIST_IN_PROGRESS = 0x23, - REALM_LIST_SUCCESS = 0x24, - REALM_LIST_FAILED = 0x25, - REALM_LIST_INVALID = 0x26, - REALM_LIST_REALM_NOT_FOUND = 0x27, - - ACCOUNT_CREATE_IN_PROGRESS = 0x28, - ACCOUNT_CREATE_SUCCESS = 0x29, - ACCOUNT_CREATE_FAILED = 0x2A, - - CHAR_LIST_RETRIEVING = 0x2B, - CHAR_LIST_RETRIEVED = 0x2C, - CHAR_LIST_FAILED = 0x2D, - - CHAR_CREATE_IN_PROGRESS = 0x2E, - CHAR_CREATE_SUCCESS = 0x2F, - CHAR_CREATE_ERROR = 0x30, - CHAR_CREATE_FAILED = 0x31, - CHAR_CREATE_NAME_IN_USE = 0x32, - CHAR_CREATE_DISABLED = 0x33, - CHAR_CREATE_PVP_TEAMS_VIOLATION = 0x34, - CHAR_CREATE_SERVER_LIMIT = 0x35, - CHAR_CREATE_ACCOUNT_LIMIT = 0x36, - CHAR_CREATE_SERVER_QUEUE = 0x37, - CHAR_CREATE_ONLY_EXISTING = 0x38, - CHAR_CREATE_EXPANSION = 0x39, - CHAR_CREATE_EXPANSION_CLASS = 0x3A, - CHAR_CREATE_LEVEL_REQUIREMENT = 0x3B, - CHAR_CREATE_UNIQUE_CLASS_LIMIT = 0x3C, - CHAR_CREATE_CHARACTER_IN_GUILD = 0x3D, - CHAR_CREATE_RESTRICTED_RACECLASS = 0x3E, - CHAR_CREATE_CHARACTER_CHOOSE_RACE = 0x3F, - CHAR_CREATE_CHARACTER_ARENA_LEADER = 0x40, - CHAR_CREATE_CHARACTER_DELETE_MAIL = 0x41, - CHAR_CREATE_CHARACTER_SWAP_FACTION = 0x42, - CHAR_CREATE_CHARACTER_RACE_ONLY = 0x43, - - CHAR_CREATE_CHARACTER_GOLD_LIMIT = 0x44, - - CHAR_CREATE_FORCE_LOGIN = 0x45, - - CHAR_DELETE_IN_PROGRESS = 0x46, - CHAR_DELETE_SUCCESS = 0x47, - CHAR_DELETE_FAILED = 0x48, - CHAR_DELETE_FAILED_LOCKED_FOR_TRANSFER = 0x49, - CHAR_DELETE_FAILED_GUILD_LEADER = 0x4A, - CHAR_DELETE_FAILED_ARENA_CAPTAIN = 0x4B, - - CHAR_LOGIN_IN_PROGRESS = 0x4C, - CHAR_LOGIN_SUCCESS = 0x4D, - CHAR_LOGIN_NO_WORLD = 0x4E, - CHAR_LOGIN_DUPLICATE_CHARACTER = 0x4F, - CHAR_LOGIN_NO_INSTANCES = 0x50, - CHAR_LOGIN_FAILED = 0x51, - CHAR_LOGIN_DISABLED = 0x52, - CHAR_LOGIN_NO_CHARACTER = 0x53, - CHAR_LOGIN_LOCKED_FOR_TRANSFER = 0x54, - CHAR_LOGIN_LOCKED_BY_BILLING = 0x55, - CHAR_LOGIN_LOCKED_BY_MOBILE_AH = 0x56, - - CHAR_NAME_SUCCESS = 0x57, - CHAR_NAME_FAILURE = 0x58, - CHAR_NAME_NO_NAME = 0x59, - CHAR_NAME_TOO_SHORT = 0x5A, - CHAR_NAME_TOO_LONG = 0x5B, - CHAR_NAME_INVALID_CHARACTER = 0x5C, - CHAR_NAME_MIXED_LANGUAGES = 0x5D, - CHAR_NAME_PROFANE = 0x5E, - CHAR_NAME_RESERVED = 0x5F, - CHAR_NAME_INVALID_APOSTROPHE = 0x60, - CHAR_NAME_MULTIPLE_APOSTROPHES = 0x61, - CHAR_NAME_THREE_CONSECUTIVE = 0x62, - CHAR_NAME_INVALID_SPACE = 0x63, - CHAR_NAME_CONSECUTIVE_SPACES = 0x64, - CHAR_NAME_RUSSIAN_CONSECUTIVE_SILENT_CHARACTERS = 0x65, - CHAR_NAME_RUSSIAN_SILENT_CHARACTER_AT_BEGINNING_OR_END = 0x66, - CHAR_NAME_DECLENSION_DOESNT_MATCH_BASE_NAME = 0x67, + RESPONSE_SUCCESS = 0, + RESPONSE_FAILURE = 1, + RESPONSE_CANCELLED = 2, + RESPONSE_DISCONNECTED = 3, + RESPONSE_FAILED_TO_CONNECT = 4, + RESPONSE_CONNECTED = 5, + RESPONSE_VERSION_MISMATCH = 6, + + CSTATUS_CONNECTING = 7, + CSTATUS_NEGOTIATING_SECURITY = 8, + CSTATUS_NEGOTIATION_COMPLETE = 9, + CSTATUS_NEGOTIATION_FAILED = 10, + CSTATUS_AUTHENTICATING = 11, + + AUTH_OK = 12, + AUTH_FAILED = 13, + AUTH_REJECT = 14, + AUTH_BAD_SERVER_PROOF = 15, + AUTH_UNAVAILABLE = 16, + AUTH_SYSTEM_ERROR = 17, + AUTH_BILLING_ERROR = 18, + AUTH_BILLING_EXPIRED = 19, + AUTH_VERSION_MISMATCH = 20, + AUTH_UNKNOWN_ACCOUNT = 21, + AUTH_INCORRECT_PASSWORD = 22, + AUTH_SESSION_EXPIRED = 23, + AUTH_SERVER_SHUTTING_DOWN = 24, + AUTH_ALREADY_LOGGING_IN = 25, + AUTH_LOGIN_SERVER_NOT_FOUND = 26, + AUTH_WAIT_QUEUE = 27, + AUTH_BANNED = 28, + AUTH_ALREADY_ONLINE = 29, + AUTH_NO_TIME = 30, + AUTH_DB_BUSY = 31, + AUTH_SUSPENDED = 32, + AUTH_PARENTAL_CONTROL = 33, + AUTH_LOCKED_ENFORCED = 34, + + REALM_LIST_IN_PROGRESS = 35, + REALM_LIST_SUCCESS = 36, + REALM_LIST_FAILED = 37, + REALM_LIST_INVALID = 38, + REALM_LIST_REALM_NOT_FOUND = 39, + + ACCOUNT_CREATE_IN_PROGRESS = 40, + ACCOUNT_CREATE_SUCCESS = 41, + ACCOUNT_CREATE_FAILED = 42, + + CHAR_LIST_RETRIEVING = 43, + CHAR_LIST_RETRIEVED = 44, + CHAR_LIST_FAILED = 45, + + CHAR_CREATE_IN_PROGRESS = 46, + CHAR_CREATE_SUCCESS = 47, + CHAR_CREATE_ERROR = 48, + CHAR_CREATE_FAILED = 49, + CHAR_CREATE_NAME_IN_USE = 50, + CHAR_CREATE_DISABLED = 51, + CHAR_CREATE_PVP_TEAMS_VIOLATION = 52, + CHAR_CREATE_SERVER_LIMIT = 53, + CHAR_CREATE_ACCOUNT_LIMIT = 54, + CHAR_CREATE_SERVER_QUEUE = 55, + CHAR_CREATE_ONLY_EXISTING = 56, + CHAR_CREATE_EXPANSION = 57, + CHAR_CREATE_EXPANSION_CLASS = 58, + CHAR_CREATE_LEVEL_REQUIREMENT = 59, + CHAR_CREATE_UNIQUE_CLASS_LIMIT = 60, + CHAR_CREATE_CHARACTER_IN_GUILD = 61, + CHAR_CREATE_RESTRICTED_RACECLASS = 62, + CHAR_CREATE_CHARACTER_CHOOSE_RACE = 63, + CHAR_CREATE_CHARACTER_ARENA_LEADER = 64, + CHAR_CREATE_CHARACTER_DELETE_MAIL = 65, + CHAR_CREATE_CHARACTER_SWAP_FACTION = 66, + CHAR_CREATE_CHARACTER_RACE_ONLY = 67, + CHAR_CREATE_CHARACTER_GOLD_LIMIT = 68, + CHAR_CREATE_FORCE_LOGIN = 69, + + CHAR_DELETE_IN_PROGRESS = 70, + CHAR_DELETE_SUCCESS = 71, + CHAR_DELETE_FAILED = 72, + CHAR_DELETE_FAILED_LOCKED_FOR_TRANSFER = 73, + CHAR_DELETE_FAILED_GUILD_LEADER = 74, + CHAR_DELETE_FAILED_ARENA_CAPTAIN = 75, + CHAR_DELETE_FAILED_HAS_HEIRLOOM_OR_MAIL = 76, + + CHAR_LOGIN_IN_PROGRESS = 77, + CHAR_LOGIN_SUCCESS = 78, + CHAR_LOGIN_NO_WORLD = 79, + CHAR_LOGIN_DUPLICATE_CHARACTER = 80, + CHAR_LOGIN_NO_INSTANCES = 81, + CHAR_LOGIN_FAILED = 82, + CHAR_LOGIN_DISABLED = 83, + CHAR_LOGIN_NO_CHARACTER = 84, + CHAR_LOGIN_LOCKED_FOR_TRANSFER = 85, + CHAR_LOGIN_LOCKED_BY_BILLING = 86, + CHAR_LOGIN_LOCKED_BY_MOBILE_AH = 87, + CHAR_LOGIN_TEMPORARY_GM_LOCK = 88, + + CHAR_NAME_SUCCESS = 89, + CHAR_NAME_FAILURE = 90, + CHAR_NAME_NO_NAME = 91, + CHAR_NAME_TOO_SHORT = 92, + CHAR_NAME_TOO_LONG = 93, + CHAR_NAME_INVALID_CHARACTER = 94, + CHAR_NAME_MIXED_LANGUAGES = 95, + CHAR_NAME_PROFANE = 96, + CHAR_NAME_RESERVED = 97, + CHAR_NAME_INVALID_APOSTROPHE = 98, + CHAR_NAME_MULTIPLE_APOSTROPHES = 99, + CHAR_NAME_THREE_CONSECUTIVE = 100, + CHAR_NAME_INVALID_SPACE = 101, + CHAR_NAME_CONSECUTIVE_SPACES = 102, + CHAR_NAME_RUSSIAN_CONSECUTIVE_SILENT_CHARACTERS = 103, + CHAR_NAME_RUSSIAN_SILENT_CHARACTER_AT_BEGINNING_OR_END = 104, + CHAR_NAME_DECLENSION_DOESNT_MATCH_BASE_NAME = 105, }; /// Ban function modes -- cgit v1.2.3 From 7611ab69be5982dfe558d6e7554545ea253cbb60 Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 11 Jul 2012 13:41:30 +0200 Subject: Core/PacketIO: Defined and enabled character list time opcodes (customize, rename, change race and faction) --- src/server/game/Handlers/CharacterHandler.cpp | 2 -- src/server/game/Server/Protocol/Opcodes.cpp | 22 +++++++++++----------- src/server/game/Server/Protocol/Opcodes.h | 26 +++++++++++++------------- 3 files changed, 24 insertions(+), 26 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index d31e1c8316f..0461379b91b 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -1430,9 +1430,7 @@ void WorldSession::HandleCharCustomize(WorldPacket& recv_data) recv_data >> gender >> skin >> hairColor >> hairStyle >> facialHair >> face; PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_AT_LOGIN); - stmt->setUInt32(0, GUID_LOPART(guid)); - PreparedQueryResult result = CharacterDatabase.Query(stmt); if (!result) diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index f1f0bcc2f5b..844aae93ad4 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -169,13 +169,13 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_VOICE_OFF, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_VOICE_ON, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelVoiceOnOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_CHARACTER_POINT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CHAR_CREATE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharCreateOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_CHAR_CUSTOMIZE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharCustomize ); - //DEFINE_OPCODE_HANDLER(CMSG_CHAR_DELETE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharDeleteOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_CHAR_CREATE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharCreateOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_CHAR_CUSTOMIZE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharCustomize ); + DEFINE_OPCODE_HANDLER(CMSG_CHAR_DELETE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharDeleteOpcode ); DEFINE_OPCODE_HANDLER(CMSG_CHAR_ENUM, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharEnumOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_CHAR_FACTION_CHANGE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharFactionOrRaceChange ); - //DEFINE_OPCODE_HANDLER(CMSG_CHAR_RACE_CHANGE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharFactionOrRaceChange ); - //DEFINE_OPCODE_HANDLER(CMSG_CHAR_RENAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharRenameOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_CHAR_FACTION_CHANGE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharFactionOrRaceChange ); + DEFINE_OPCODE_HANDLER(CMSG_CHAR_RACE_CHANGE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharFactionOrRaceChange ); + DEFINE_OPCODE_HANDLER(CMSG_CHAR_RENAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharRenameOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_CHAT_FILTERED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CHAT_IGNORED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChatIgnoredOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -873,12 +873,12 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_CHARACTER_LOGIN_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHARACTER_PROFILE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHARACTER_PROFILE_REALM_CONNECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHAR_CREATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHAR_CUSTOMIZE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHAR_DELETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CHAR_CREATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CHAR_CUSTOMIZE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CHAR_DELETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CHAR_ENUM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHAR_FACTION_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHAR_RENAME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CHAR_FACTION_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CHAR_RENAME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHAT_NOT_IN_PARTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHAT_PLAYER_AMBIGUOUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHAT_PLAYER_NOT_FOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 26e3c65a1b7..d514593603e 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -124,7 +124,7 @@ enum Opcodes CMSG_CHANNEL_UNMODERATOR = 0x1954, CMSG_CHANNEL_UNMUTE = 0x3554, CMSG_CHAR_CREATE = 0x4A36, - CMSG_CHAR_CUSTOMIZE = 0x0000, + CMSG_CHAR_CUSTOMIZE = 0x2C34, CMSG_CHAR_DELETE = 0x6425, CMSG_CHAR_ENUM = 0x0502, CMSG_CHAR_FACTION_CHANGE = 0x2735, @@ -560,7 +560,7 @@ enum Opcodes SMSG_ARENA_TEAM_COMMAND_RESULT = 0x0000, SMSG_ARENA_TEAM_EVENT = 0x0000, SMSG_ARENA_TEAM_INVITE = 0x0000, - SMSG_ARENA_TEAM_QUERY_RESPONSE = 0x0000, + SMSG_ARENA_TEAM_QUERY_RESPONSE = 0x6336, SMSG_ARENA_TEAM_ROSTER = 0x2717, SMSG_ARENA_TEAM_STATS = 0x0000, SMSG_ATTACKERSTATEUPDATE = 0x0B25, @@ -639,13 +639,13 @@ enum Opcodes SMSG_CHANNEL_LIST = 0x0000, SMSG_CHANNEL_MEMBER_COUNT = 0x0000, SMSG_CHANNEL_NOTIFY = 0x0825, - SMSG_CHARACTER_LOGIN_FAILED = 0x0000, + SMSG_CHARACTER_LOGIN_FAILED = 0x4417, SMSG_CHAR_CREATE = 0x2D05, - SMSG_CHAR_CUSTOMIZE = 0x0000, + SMSG_CHAR_CUSTOMIZE = 0x4F16, SMSG_CHAR_DELETE = 0x0304, SMSG_CHAR_ENUM = 0x10B0, - SMSG_CHAR_FACTION_CHANGE = 0x0000, - SMSG_CHAR_RENAME = 0x0000, + SMSG_CHAR_FACTION_CHANGE = 0x4C06, + SMSG_CHAR_RENAME = 0x2024, SMSG_CHAT_PLAYER_AMBIGUOUS = 0x0000, SMSG_CHAT_PLAYER_NOT_FOUND = 0x0000, SMSG_CHAT_RESTRICTED = 0x0000, @@ -678,7 +678,7 @@ enum Opcodes SMSG_CROSSED_INEBRIATION_THRESHOLD = 0x0000, SMSG_DAMAGE_CALC_LOG = 0x0000, SMSG_DAMAGE_DONE_OBSOLETE = 0x0000, - SMSG_DANCE_QUERY_RESPONSE = 0x0000, + SMSG_DANCE_QUERY_RESPONSE = 0x2F06, SMSG_DB_REPLY = 0x38A4, SMSG_DEATH_RELEASE_LOC = 0x0000, SMSG_DEFENSE_MESSAGE = 0x0314, @@ -780,7 +780,7 @@ enum Opcodes SMSG_INSTANCE_RESET = 0x0000, SMSG_INSTANCE_RESET_FAILED = 0x0000, SMSG_INSTANCE_SAVE_CREATED = 0x0000, - SMSG_INVALIDATE_DANCE = 0x0000, + SMSG_INVALIDATE_DANCE = 0x0E27, SMSG_INVALIDATE_PLAYER = 0x6325, SMSG_INVALID_PROMOTION_CODE = 0x0000, SMSG_INVENTORY_CHANGE_FAILURE = 0x0000, @@ -790,7 +790,7 @@ enum Opcodes SMSG_ITEM_PUSH_RESULT = 0x0000, SMSG_ITEM_REFUND_INFO_RESPONSE = 0x0000, SMSG_ITEM_REFUND_RESULT = 0x0000, - SMSG_ITEM_TEXT_QUERY_RESPONSE = 0x0000, + SMSG_ITEM_TEXT_QUERY_RESPONSE = 0x2725, SMSG_ITEM_TIME_UPDATE = 0x0000, SMSG_JOINED_BATTLEGROUND_QUEUE = 0x0000, SMSG_KICK_REASON = 0x0000, @@ -817,7 +817,7 @@ enum Opcodes SMSG_LIST_INVENTORY = 0x7CB0, SMSG_LOGIN_SETTIMESPEED = 0x4D15, SMSG_LOGIN_VERIFY_WORLD = 0x2005, - SMSG_LOGOUT_CANCEL_ACK = 0x0000, + SMSG_LOGOUT_CANCEL_ACK = 0x6514, SMSG_LOGOUT_COMPLETE = 0x2137, SMSG_LOGOUT_RESPONSE = 0x0524, SMSG_LOG_XPGAIN = 0x4514, @@ -896,7 +896,7 @@ enum Opcodes SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA = 0x0000, SMSG_OPEN_CONTAINER = 0x0000, SMSG_OVERRIDE_LIGHT = 0x0000, - SMSG_PAGE_TEXT_QUERY_RESPONSE = 0x0000, + SMSG_PAGE_TEXT_QUERY_RESPONSE = 0x2B14, SMSG_PARTYKILLLOG = 0x0000, SMSG_PARTY_COMMAND_RESULT = 0x0000, SMSG_PARTY_MEMBER_STATS = 0x0000, @@ -904,7 +904,7 @@ enum Opcodes SMSG_PAUSE_MIRROR_TIMER = 0x0000, SMSG_PERIODICAURALOG = 0x0416, SMSG_PETGODMODE = 0x0000, - SMSG_PETITION_QUERY_RESPONSE = 0x0000, + SMSG_PETITION_QUERY_RESPONSE = 0x4B37, SMSG_PETITION_SHOWLIST = 0x0000, SMSG_PETITION_SHOW_SIGNATURES = 0x0000, SMSG_PETITION_SIGN_RESULTS = 0x0000, @@ -999,7 +999,7 @@ enum Opcodes SMSG_SET_FORCED_REACTIONS = 0x0000, SMSG_SET_PCT_SPELL_MODIFIER = 0x2834, SMSG_SET_PHASE_SHIFT = 0x70A0, - SMSG_SET_PLAYER_DECLINED_NAMES_RESULT = 0x0000, + SMSG_SET_PLAYER_DECLINED_NAMES_RESULT = 0x2B25, SMSG_SET_PLAY_HOVER_ANIM = 0x0000, SMSG_SET_PROFICIENCY = 0x6207, SMSG_SET_PROJECTILE_POSITION = 0x0000, -- cgit v1.2.3 From 492fd80b0621728889c6013682d07b420778ef9a Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 11 Jul 2012 19:26:26 +0200 Subject: Core/Misc * Cleaned up packet manipulation methods, no need to keep duplicate sets of functions doing the same * Added a very basic ObjectGuid structure for easier (and endian-safe) method of accessing individual guid bytes --- src/server/game/Achievements/AchievementMgr.cpp | 437 +++++++++++------------ src/server/game/Entities/Object/Object.h | 56 +++ src/server/game/Entities/Player/Player.cpp | 6 +- src/server/game/Entities/Unit/Unit.cpp | 304 ++++++++-------- src/server/game/Handlers/CharacterHandler.cpp | 43 +-- src/server/game/Handlers/GroupHandler.cpp | 40 +-- src/server/game/Handlers/GuildHandler.cpp | 16 +- src/server/game/Handlers/ItemHandler.cpp | 32 +- src/server/game/Handlers/MiscHandler.cpp | 47 +-- src/server/game/Handlers/MovementHandler.cpp | 37 +- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- src/server/game/Server/WorldSession.h | 6 - src/server/shared/Database/PreparedStatement.cpp | 9 +- src/server/shared/Packets/ByteBuffer.cpp | 85 ----- src/server/shared/Packets/ByteBuffer.h | 198 +--------- 15 files changed, 537 insertions(+), 781 deletions(-) delete mode 100644 src/server/shared/Packets/ByteBuffer.cpp (limited to 'src') diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index dafcd88433f..34b38ff1d35 100755 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -426,28 +426,27 @@ void AchievementMgr::RemoveCriteriaProgress(const AchievementCriteriaEntr if (criteriaProgress == m_criteriaProgress.end()) return; - uint8 guidBytes[8]; - *reinterpret_cast(&guidBytes[0]) = GetOwner()->GetGUID(); + ObjectGuid guid = GetOwner()->GetGUID(); WorldPacket data(SMSG_GUILD_CRITERIA_DELETED, 4 + 8); - data.WriteBit(guidBytes[6]); - data.WriteBit(guidBytes[5]); - data.WriteBit(guidBytes[7]); - data.WriteBit(guidBytes[0]); - data.WriteBit(guidBytes[1]); - data.WriteBit(guidBytes[3]); - data.WriteBit(guidBytes[2]); - data.WriteBit(guidBytes[4]); - - data.WriteByteSeq(guidBytes[2]); - data.WriteByteSeq(guidBytes[3]); - data.WriteByteSeq(guidBytes[4]); - data.WriteByteSeq(guidBytes[1]); - data.WriteByteSeq(guidBytes[7]); + data.WriteBit(guid[6]); + data.WriteBit(guid[5]); + data.WriteBit(guid[7]); + data.WriteBit(guid[0]); + data.WriteBit(guid[1]); + data.WriteBit(guid[3]); + data.WriteBit(guid[2]); + data.WriteBit(guid[4]); + + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[7]); data << uint32(entry->ID); - data.WriteByteSeq(guidBytes[5]); - data.WriteByteSeq(guidBytes[0]); - data.WriteByteSeq(guidBytes[6]); + data.WriteByteSeq(guid[5]); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[6]); SendPacket(&data); @@ -844,30 +843,28 @@ void AchievementMgr::Reset() template<> void AchievementMgr::Reset() { - uint8 guidBytes[8]; - *reinterpret_cast(&guidBytes[0]) = GetOwner()->GetGUID(); - + ObjectGuid guid = GetOwner()->GetGUID(); for (CompletedAchievementMap::const_iterator iter = m_completedAchievements.begin(); iter != m_completedAchievements.end(); ++iter) { WorldPacket data(SMSG_GUILD_ACHIEVEMENT_DELETED, 4); - data.WriteBit(guidBytes[4]); - data.WriteBit(guidBytes[1]); - data.WriteBit(guidBytes[2]); - data.WriteBit(guidBytes[3]); - data.WriteBit(guidBytes[0]); - data.WriteBit(guidBytes[7]); - data.WriteBit(guidBytes[5]); - data.WriteBit(guidBytes[6]); + data.WriteBit(guid[4]); + data.WriteBit(guid[1]); + data.WriteBit(guid[2]); + data.WriteBit(guid[3]); + data.WriteBit(guid[0]); + data.WriteBit(guid[7]); + data.WriteBit(guid[5]); + data.WriteBit(guid[6]); data << uint32(iter->first); - data.WriteByteSeq(guidBytes[5]); - data.WriteByteSeq(guidBytes[1]); - data.WriteByteSeq(guidBytes[3]); - data.WriteByteSeq(guidBytes[6]); - data.WriteByteSeq(guidBytes[0]); - data.WriteByteSeq(guidBytes[7]); + data.WriteByteSeq(guid[5]); + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[6]); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[7]); data << uint32(secsToTimeBitFields(iter->second.date)); - data.WriteByteSeq(guidBytes[4]); - data.WriteByteSeq(guidBytes[2]); + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[2]); SendPacket(&data); } @@ -936,29 +933,28 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievemen template<> void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement) const { - uint8 guidBytes[8]; - *reinterpret_cast(&guidBytes[0]) = GetOwner()->GetGUID(); + ObjectGuid guid = GetOwner()->GetGUID(); WorldPacket data(SMSG_GUILD_ACHIEVEMENT_EARNED, 8+4+8); - data.WriteByteMask(guidBytes[3]); - data.WriteByteMask(guidBytes[1]); - data.WriteByteMask(guidBytes[0]); - data.WriteByteMask(guidBytes[7]); - data.WriteByteMask(guidBytes[4]); - data.WriteByteMask(guidBytes[6]); - data.WriteByteMask(guidBytes[2]); - data.WriteByteMask(guidBytes[5]); - - data.WriteByteSeq(guidBytes[2]); + data.WriteBit(guid[3]); + data.WriteBit(guid[1]); + data.WriteBit(guid[0]); + data.WriteBit(guid[7]); + data.WriteBit(guid[4]); + data.WriteBit(guid[6]); + data.WriteBit(guid[2]); + data.WriteBit(guid[5]); + + data.WriteByteSeq(guid[2]); data << uint32(secsToTimeBitFields(time(NULL))); - data.WriteByteSeq(guidBytes[0]); - data.WriteByteSeq(guidBytes[4]); - data.WriteByteSeq(guidBytes[1]); - data.WriteByteSeq(guidBytes[3]); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[3]); data << uint32(achievement->ID); - data.WriteByteSeq(guidBytes[7]); - data.WriteByteSeq(guidBytes[5]); - data.WriteByteSeq(guidBytes[6]); + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[5]); + data.WriteByteSeq(guid[6]); SendPacket(&data); } @@ -994,50 +990,48 @@ void AchievementMgr::SendCriteriaUpdate(AchievementCriteriaEntry const* e //will send response to criteria progress request WorldPacket data(SMSG_GUILD_CRITERIA_DATA, 3 + 1 + 1 + 8 + 8 + 4 + 4 + 4 + 4 + 4); - uint8 criteriaProgress[8]; - uint8 criteriaGuid[8]; - *reinterpret_cast(&criteriaProgress[0]) = progress->counter; - *reinterpret_cast(&criteriaGuid[0]) = progress->CompletedGUID; + ObjectGuid counter = progress->counter; // for accessing every byte individually + ObjectGuid guid = progress->CompletedGUID; data.WriteBits(1, 21); - data.WriteBit(criteriaProgress[4]); - data.WriteBit(criteriaProgress[1]); - data.WriteBit(criteriaGuid[2]); - data.WriteBit(criteriaProgress[3]); - data.WriteBit(criteriaGuid[1]); - data.WriteBit(criteriaProgress[5]); - data.WriteBit(criteriaProgress[0]); - data.WriteBit(criteriaGuid[3]); - data.WriteBit(criteriaProgress[2]); - data.WriteBit(criteriaGuid[7]); - data.WriteBit(criteriaGuid[5]); - data.WriteBit(criteriaGuid[0]); - data.WriteBit(criteriaProgress[6]); - data.WriteBit(criteriaGuid[6]); - data.WriteBit(criteriaProgress[7]); - data.WriteBit(criteriaGuid[4]); - - data.WriteByteSeq(criteriaGuid[5]); + data.WriteBit(counter[4]); + data.WriteBit(counter[1]); + data.WriteBit(guid[2]); + data.WriteBit(counter[3]); + data.WriteBit(guid[1]); + data.WriteBit(counter[5]); + data.WriteBit(counter[0]); + data.WriteBit(guid[3]); + data.WriteBit(counter[2]); + data.WriteBit(guid[7]); + data.WriteBit(guid[5]); + data.WriteBit(guid[0]); + data.WriteBit(counter[6]); + data.WriteBit(guid[6]); + data.WriteBit(counter[7]); + data.WriteBit(guid[4]); + + data.WriteByteSeq(guid[5]); data << uint32(progress->date); // unknown date - data.WriteByteSeq(criteriaProgress[3]); - data.WriteByteSeq(criteriaProgress[7]); + data.WriteByteSeq(counter[3]); + data.WriteByteSeq(counter[7]); data << uint32(progress->date); // unknown date - data.WriteByteSeq(criteriaProgress[6]); - data.WriteByteSeq(criteriaGuid[4]); - data.WriteByteSeq(criteriaGuid[1]); - data.WriteByteSeq(criteriaProgress[4]); - data.WriteByteSeq(criteriaGuid[3]); - data.WriteByteSeq(criteriaProgress[0]); - data.WriteByteSeq(criteriaGuid[2]); - data.WriteByteSeq(criteriaProgress[1]); - data.WriteByteSeq(criteriaGuid[6]); + data.WriteByteSeq(counter[6]); + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(counter[4]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(counter[0]); + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(counter[1]); + data.WriteByteSeq(guid[6]); data << uint32(progress->date); // last update time (not packed!) data << uint32(entry->ID); - data.WriteByteSeq(criteriaProgress[5]); + data.WriteByteSeq(counter[5]); data << uint32(0); - data.WriteByteSeq(criteriaGuid[7]); - data.WriteByteSeq(criteriaProgress[2]); - data.WriteByteSeq(criteriaGuid[0]); + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(counter[2]); + data.WriteByteSeq(guid[0]); SendPacket(&data); } @@ -2364,54 +2358,53 @@ void AchievementMgr::SendAllAchievementData(Player* /*receiver*/) const size_t numCriteria = m_criteriaProgress.size(); size_t numAchievements = std::count_if(m_completedAchievements.begin(), m_completedAchievements.end(), isVisible); ByteBuffer criteriaData(numCriteria * (4 + 4 + 4 + 4 + 8 + 8)); - uint8 guidBytes[8]; - uint8 progressBytes[8]; - *reinterpret_cast(&guidBytes[0]) = GetOwner()->GetGUID(); + ObjectGuid guid = GetOwner()->GetGUID(); + ObjectGuid counter; WorldPacket data(SMSG_ALL_ACHIEVEMENT_DATA, 4 + numAchievements * (4 + 4) + 4 + numCriteria * (4 + 4 + 4 + 4 + 8 + 8)); data.WriteBits(21, numCriteria); for (CriteriaProgressMap::const_iterator itr = m_criteriaProgress.begin(); itr != m_criteriaProgress.end(); ++itr) { - *reinterpret_cast(&progressBytes[0]) = itr->second.counter; - - data.WriteBit(guidBytes[4]); - data.WriteBit(progressBytes[3]); - data.WriteBit(guidBytes[5]); - data.WriteBit(progressBytes[0]); - data.WriteBit(progressBytes[6]); - data.WriteBit(guidBytes[3]); - data.WriteBit(guidBytes[0]); - data.WriteBit(progressBytes[4]); - data.WriteBit(guidBytes[2]); - data.WriteBit(progressBytes[7]); - data.WriteBit(guidBytes[7]); + counter = itr->second.counter; + + data.WriteBit(guid[4]); + data.WriteBit(counter[3]); + data.WriteBit(guid[5]); + data.WriteBit(counter[0]); + data.WriteBit(counter[6]); + data.WriteBit(guid[3]); + data.WriteBit(guid[0]); + data.WriteBit(counter[4]); + data.WriteBit(guid[2]); + data.WriteBit(counter[7]); + data.WriteBit(guid[7]); data.WriteBits(0, 2); - data.WriteBit(guidBytes[6]); - data.WriteBit(progressBytes[2]); - data.WriteBit(progressBytes[1]); - data.WriteBit(progressBytes[5]); - data.WriteBit(guidBytes[1]); - - criteriaData.WriteByteSeq(guidBytes[3]); - criteriaData.WriteByteSeq(progressBytes[5]); - criteriaData.WriteByteSeq(progressBytes[6]); - criteriaData.WriteByteSeq(guidBytes[4]); - criteriaData.WriteByteSeq(guidBytes[6]); - criteriaData.WriteByteSeq(progressBytes[2]); + data.WriteBit(guid[6]); + data.WriteBit(counter[2]); + data.WriteBit(counter[1]); + data.WriteBit(counter[5]); + data.WriteBit(guid[1]); + + criteriaData.WriteByteSeq(guid[3]); + criteriaData.WriteByteSeq(counter[5]); + criteriaData.WriteByteSeq(counter[6]); + criteriaData.WriteByteSeq(guid[4]); + criteriaData.WriteByteSeq(guid[6]); + criteriaData.WriteByteSeq(counter[2]); criteriaData << uint32(0); // timer 2 - criteriaData.WriteByteSeq(guidBytes[2]); + criteriaData.WriteByteSeq(guid[2]); criteriaData << uint32(itr->first); // criteria id - criteriaData.WriteByteSeq(guidBytes[5]); - criteriaData.WriteByteSeq(progressBytes[0]); - criteriaData.WriteByteSeq(progressBytes[3]); - criteriaData.WriteByteSeq(progressBytes[1]); - criteriaData.WriteByteSeq(progressBytes[4]); - criteriaData.WriteByteSeq(guidBytes[0]); - criteriaData.WriteByteSeq(guidBytes[7]); - criteriaData.WriteByteSeq(progressBytes[7]); + criteriaData.WriteByteSeq(guid[5]); + criteriaData.WriteByteSeq(counter[0]); + criteriaData.WriteByteSeq(counter[3]); + criteriaData.WriteByteSeq(counter[1]); + criteriaData.WriteByteSeq(counter[4]); + criteriaData.WriteByteSeq(guid[0]); + criteriaData.WriteByteSeq(guid[7]); + criteriaData.WriteByteSeq(counter[7]); criteriaData << uint32(0); // timer 1 criteriaData << uint32(secsToTimeBitFields(itr->second.date)); // criteria date - criteriaData.WriteByteSeq(guidBytes[1]); + criteriaData.WriteByteSeq(guid[1]); } data.WriteBits(numAchievements, 23); @@ -2454,75 +2447,75 @@ void AchievementMgr::SendAchievementInfo(Player* receiver, uint32 achievement template<> void AchievementMgr::SendAchievementInfo(Player* receiver, uint32 /*achievementId = 0 */) const { - uint8 guidBytes[8]; - uint8 progressBytes[8]; + ObjectGuid guid = GetOwner()->GetGUID(); + ObjectGuid counter; VisibleAchievementPred isVisible; size_t numCriteria = m_criteriaProgress.size(); size_t numAchievements = std::count_if(m_completedAchievements.begin(), m_completedAchievements.end(), isVisible); ByteBuffer criteriaData(numCriteria * (0)); - *reinterpret_cast(&guidBytes[0]) = GetOwner()->GetGUID(); WorldPacket data(SMSG_RESPOND_INSPECT_ACHIEVEMENTS, 1 + 8 + 3 + 3 + numAchievements * (4 + 4) + numCriteria * (0)); - data.WriteBit(guidBytes[7]); - data.WriteBit(guidBytes[4]); - data.WriteBit(guidBytes[1]); + data.WriteBit(guid[7]); + data.WriteBit(guid[4]); + data.WriteBit(guid[1]); data.WriteBits(numAchievements, 23); - data.WriteBit(guidBytes[0]); - data.WriteBit(guidBytes[3]); + data.WriteBit(guid[0]); + data.WriteBit(guid[3]); data.WriteBits(numCriteria, 21); - data.WriteBit(guidBytes[2]); + data.WriteBit(guid[2]); for (CriteriaProgressMap::const_iterator itr = m_criteriaProgress.begin(); itr != m_criteriaProgress.end(); ++itr) { - *reinterpret_cast(&progressBytes[0]) = itr->second.counter; - data.WriteBit(progressBytes[5]); - data.WriteBit(progressBytes[3]); - data.WriteBit(guidBytes[1]); - data.WriteBit(guidBytes[4]); - data.WriteBit(guidBytes[2]); - data.WriteBit(progressBytes[6]); - data.WriteBit(guidBytes[0]); - data.WriteBit(progressBytes[4]); - data.WriteBit(progressBytes[1]); - data.WriteBit(progressBytes[2]); - data.WriteBit(guidBytes[3]); - data.WriteBit(guidBytes[7]); + counter = itr->second.counter; + + data.WriteBit(counter[5]); + data.WriteBit(counter[3]); + data.WriteBit(guid[1]); + data.WriteBit(guid[4]); + data.WriteBit(guid[2]); + data.WriteBit(counter[6]); + data.WriteBit(guid[0]); + data.WriteBit(counter[4]); + data.WriteBit(counter[1]); + data.WriteBit(counter[2]); + data.WriteBit(guid[3]); + data.WriteBit(guid[7]); data.WriteBits(0, 2); // criteria progress flags - data.WriteBit(progressBytes[0]); - data.WriteBit(guidBytes[5]); - data.WriteBit(guidBytes[6]); - data.WriteBit(progressBytes[7]); + data.WriteBit(counter[0]); + data.WriteBit(guid[5]); + data.WriteBit(guid[6]); + data.WriteBit(counter[7]); - criteriaData.WriteByteSeq(guidBytes[3]); - criteriaData.WriteByteSeq(progressBytes[4]); + criteriaData.WriteByteSeq(guid[3]); + criteriaData.WriteByteSeq(counter[4]); criteriaData << uint32(0); // timer 1 - criteriaData.WriteByteSeq(guidBytes[1]); + criteriaData.WriteByteSeq(guid[1]); criteriaData << uint32(secsToTimeBitFields(itr->second.date)); - criteriaData.WriteByteSeq(progressBytes[3]); - criteriaData.WriteByteSeq(progressBytes[7]); - criteriaData.WriteByteSeq(guidBytes[5]); - criteriaData.WriteByteSeq(progressBytes[0]); - criteriaData.WriteByteSeq(guidBytes[4]); - criteriaData.WriteByteSeq(guidBytes[2]); - criteriaData.WriteByteSeq(guidBytes[6]); - criteriaData.WriteByteSeq(guidBytes[7]); - criteriaData.WriteByteSeq(progressBytes[6]); + criteriaData.WriteByteSeq(counter[3]); + criteriaData.WriteByteSeq(counter[7]); + criteriaData.WriteByteSeq(guid[5]); + criteriaData.WriteByteSeq(counter[0]); + criteriaData.WriteByteSeq(guid[4]); + criteriaData.WriteByteSeq(guid[2]); + criteriaData.WriteByteSeq(guid[6]); + criteriaData.WriteByteSeq(guid[7]); + criteriaData.WriteByteSeq(counter[6]); criteriaData << uint32(itr->first); criteriaData << uint32(0); // timer 2 - criteriaData.WriteByteSeq(progressBytes[1]); - criteriaData.WriteByteSeq(progressBytes[5]); - criteriaData.WriteByteSeq(guidBytes[0]); - criteriaData.WriteByteSeq(progressBytes[2]); + criteriaData.WriteByteSeq(counter[1]); + criteriaData.WriteByteSeq(counter[5]); + criteriaData.WriteByteSeq(guid[0]); + criteriaData.WriteByteSeq(counter[2]); } - data.WriteBit(guidBytes[6]); - data.WriteBit(guidBytes[5]); + data.WriteBit(guid[6]); + data.WriteBit(guid[5]); data.append(criteriaData); - data.WriteByteSeq(guidBytes[1]); - data.WriteByteSeq(guidBytes[6]); - data.WriteByteSeq(guidBytes[3]); - data.WriteByteSeq(guidBytes[0]); - data.WriteByteSeq(guidBytes[2]); + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[6]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[2]); for (CompletedAchievementMap::const_iterator itr = m_completedAchievements.begin(); itr != m_completedAchievements.end(); ++itr) { @@ -2533,9 +2526,9 @@ void AchievementMgr::SendAchievementInfo(Player* receiver, uint32 /*achi data << uint32(secsToTimeBitFields(itr->second.date)); } - data.WriteByteSeq(guidBytes[7]); - data.WriteByteSeq(guidBytes[4]); - data.WriteByteSeq(guidBytes[5]); + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[5]); receiver->GetSession()->SendPacket(&data); } @@ -2554,8 +2547,8 @@ void AchievementMgr::SendAchievementInfo(Player* receiver, uint32 achieve return; } - uint8 criteriaProgress[8]; - uint8 criteriaGuid[8]; + ObjectGuid counter; + ObjectGuid guid; uint32 numCriteria = 0; ByteBuffer criteriaData(criteria->size() * (8 + 8 + 4 + 4 + 4)); ByteBuffer criteriaBits(criteria->size() * (8 + 8) / 8); @@ -2578,47 +2571,47 @@ void AchievementMgr::SendAchievementInfo(Player* receiver, uint32 achieve if (progress == m_criteriaProgress.end()) continue; - *reinterpret_cast(&criteriaProgress[0]) = progress->second.counter; - *reinterpret_cast(&criteriaGuid[0]) = progress->second.CompletedGUID; - - criteriaBits.WriteBit(criteriaProgress[4]); - criteriaBits.WriteBit(criteriaProgress[1]); - criteriaBits.WriteBit(criteriaGuid[2]); - criteriaBits.WriteBit(criteriaProgress[3]); - criteriaBits.WriteBit(criteriaGuid[1]); - criteriaBits.WriteBit(criteriaProgress[5]); - criteriaBits.WriteBit(criteriaProgress[0]); - criteriaBits.WriteBit(criteriaGuid[3]); - criteriaBits.WriteBit(criteriaProgress[2]); - criteriaBits.WriteBit(criteriaGuid[7]); - criteriaBits.WriteBit(criteriaGuid[5]); - criteriaBits.WriteBit(criteriaGuid[0]); - criteriaBits.WriteBit(criteriaProgress[6]); - criteriaBits.WriteBit(criteriaGuid[6]); - criteriaBits.WriteBit(criteriaProgress[7]); - criteriaBits.WriteBit(criteriaGuid[4]); - - criteriaData.WriteByteSeq(criteriaGuid[5]); + counter = progress->second.counter; + guid = progress->second.CompletedGUID; + + criteriaBits.WriteBit(counter[4]); + criteriaBits.WriteBit(counter[1]); + criteriaBits.WriteBit(guid[2]); + criteriaBits.WriteBit(counter[3]); + criteriaBits.WriteBit(guid[1]); + criteriaBits.WriteBit(counter[5]); + criteriaBits.WriteBit(counter[0]); + criteriaBits.WriteBit(guid[3]); + criteriaBits.WriteBit(counter[2]); + criteriaBits.WriteBit(guid[7]); + criteriaBits.WriteBit(guid[5]); + criteriaBits.WriteBit(guid[0]); + criteriaBits.WriteBit(counter[6]); + criteriaBits.WriteBit(guid[6]); + criteriaBits.WriteBit(counter[7]); + criteriaBits.WriteBit(guid[4]); + + criteriaData.WriteByteSeq(guid[5]); criteriaData << uint32(progress->second.date); // unknown date - criteriaData.WriteByteSeq(criteriaProgress[3]); - criteriaData.WriteByteSeq(criteriaProgress[7]); + criteriaData.WriteByteSeq(counter[3]); + criteriaData.WriteByteSeq(counter[7]); criteriaData << uint32(progress->second.date); // unknown date - criteriaData.WriteByteSeq(criteriaProgress[6]); - criteriaData.WriteByteSeq(criteriaGuid[4]); - criteriaData.WriteByteSeq(criteriaGuid[1]); - criteriaData.WriteByteSeq(criteriaProgress[4]); - criteriaData.WriteByteSeq(criteriaGuid[3]); - criteriaData.WriteByteSeq(criteriaProgress[0]); - criteriaData.WriteByteSeq(criteriaGuid[2]); - criteriaData.WriteByteSeq(criteriaProgress[1]); - criteriaData.WriteByteSeq(criteriaGuid[6]); + criteriaData.WriteByteSeq(counter[6]); + criteriaData.WriteByteSeq(guid[4]); + criteriaData.WriteByteSeq(guid[1]); + criteriaData.WriteByteSeq(counter[4]); + criteriaData.WriteByteSeq(guid[3]); + criteriaData.WriteByteSeq(counter[0]); + criteriaData.WriteByteSeq(guid[2]); + criteriaData.WriteByteSeq(counter[1]); + criteriaData.WriteByteSeq(guid[6]); criteriaData << uint32(progress->second.date); // last update time (not packed!) criteriaData << uint32(criteriaId); - criteriaData.WriteByteSeq(criteriaProgress[5]); + criteriaData.WriteByteSeq(counter[5]); criteriaData << uint32(0); - criteriaData.WriteByteSeq(criteriaGuid[7]); - criteriaData.WriteByteSeq(criteriaProgress[2]); - criteriaData.WriteByteSeq(criteriaGuid[0]); + criteriaData.WriteByteSeq(guid[7]); + criteriaData.WriteByteSeq(counter[2]); + criteriaData.WriteByteSeq(guid[0]); } WorldPacket data(SMSG_GUILD_CRITERIA_DATA, criteriaBits.size() + criteriaData.size()); diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index 1a04f7b3053..01ad11ba2df 100755 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -119,6 +119,62 @@ class Transport; typedef UNORDERED_MAP UpdateDataMapType; +//! Structure to ease conversions from single 64 bit integer guid into individual bytes, for packet sending purposes +//! Nuke this out when porting ObjectGuid from MaNGOS, but preserve the per-byte storage +struct ObjectGuid +{ + public: + ObjectGuid() { _data.u64 = 0i64; } + ObjectGuid(uint64 guid) { _data.u64 = guid; } + ObjectGuid(ObjectGuid const& other) { _data.u64 = other._data.u64; } + + uint8& operator[](uint32 index) + { + ASSERT(index < sizeof(uint64)); + +#if TRINITY_ENDIAN == TRINITY_LITTLEENDIAN + return _data.byte[index]; +#else + return _data.byte[7 - index]; +#endif + } + + uint8 const& operator[](uint32 index) const + { + ASSERT(index < sizeof(uint64)); + +#if TRINITY_ENDIAN == TRINITY_LITTLEENDIAN + return _data.byte[index]; +#else + return _data.byte[7 - index]; +#endif + } + + operator uint64() + { + return _data.u64; + } + + ObjectGuid& operator=(uint64 guid) + { + _data.u64 = guid; + return *this; + } + + ObjectGuid& operator=(ObjectGuid const& other) + { + _data.u64 = other._data.u64; + return *this; + } + + private: + union + { + uint64 u64; + uint8 byte[8]; + } _data; +}; + class Object { public: diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 988404b1829..558106c956d 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -1842,10 +1842,8 @@ bool Player::BuildEnumData(PreparedQueryResult result, ByteBuffer* dataBuffer, B // "characters.at_login, character_pet.entry, character_pet.modelid, character_pet.level, characters.data, character_banned.guid, character_declinedname.genitive " Field* fields = result->Fetch(); - uint8 guid[8]; - uint8 guildGuid[8]; - *reinterpret_cast(&guid[0]) = MAKE_NEW_GUID(fields[0].GetUInt32(), 0, HIGHGUID_PLAYER); + ObjectGuid guid = MAKE_NEW_GUID(fields[0].GetUInt32(), 0, HIGHGUID_PLAYER); std::string name = fields[1].GetString(); uint8 plrRace = fields[2].GetUInt8(); uint8 plrClass = fields[3].GetUInt8(); @@ -1862,7 +1860,7 @@ bool Player::BuildEnumData(PreparedQueryResult result, ByteBuffer* dataBuffer, B float y = fields[11].GetFloat(); float z = fields[12].GetFloat(); uint32 guildId = fields[13].GetUInt32(); - *reinterpret_cast(&guildGuid[0]) = MAKE_NEW_GUID(guildId, 0, guildId ? HIGHGUID_GUILD : 0); + ObjectGuid guildGuid = MAKE_NEW_GUID(guildId, 0, guildId ? HIGHGUID_GUILD : 0); uint32 playerFlags = fields[14].GetUInt32(); uint32 atLoginFlags = fields[15].GetUInt16(); Tokens equipment(fields[19].GetString(), ' '); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 599c79dedbd..9f064640a75 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -12733,14 +12733,14 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) break; case MOVE_RUN: data.Initialize(SMSG_SPLINE_MOVE_SET_RUN_SPEED, 1 + 8 + 4); - data.WriteByteMask(bytes[7]); - data.WriteByteMask(bytes[2]); - data.WriteByteMask(bytes[1]); - data.WriteByteMask(bytes[3]); - data.WriteByteMask(bytes[5]); - data.WriteByteMask(bytes[6]); - data.WriteByteMask(bytes[4]); - data.WriteByteMask(bytes[0]); + data.WriteBit(bytes[7]); + data.WriteBit(bytes[2]); + data.WriteBit(bytes[1]); + data.WriteBit(bytes[3]); + data.WriteBit(bytes[5]); + data.WriteBit(bytes[6]); + data.WriteBit(bytes[4]); + data.WriteBit(bytes[0]); data.WriteByteSeq(bytes[6]); data.WriteByteSeq(bytes[7]); @@ -12755,14 +12755,14 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) break; case MOVE_RUN_BACK: data.Initialize(SMSG_SPLINE_MOVE_SET_RUN_BACK_SPEED, 1 + 8 + 4); - data.WriteByteMask(bytes[4]); - data.WriteByteMask(bytes[0]); - data.WriteByteMask(bytes[6]); - data.WriteByteMask(bytes[3]); - data.WriteByteMask(bytes[5]); - data.WriteByteMask(bytes[1]); - data.WriteByteMask(bytes[7]); - data.WriteByteMask(bytes[2]); + data.WriteBit(bytes[4]); + data.WriteBit(bytes[0]); + data.WriteBit(bytes[6]); + data.WriteBit(bytes[3]); + data.WriteBit(bytes[5]); + data.WriteBit(bytes[1]); + data.WriteBit(bytes[7]); + data.WriteBit(bytes[2]); data.WriteByteSeq(bytes[1]); data.WriteByteSeq(bytes[7]); @@ -12777,14 +12777,14 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) break; case MOVE_SWIM: data.Initialize(SMSG_SPLINE_MOVE_SET_SWIM_SPEED, 1 + 8 + 4); - data.WriteByteMask(bytes[3]); - data.WriteByteMask(bytes[5]); - data.WriteByteMask(bytes[7]); - data.WriteByteMask(bytes[4]); - data.WriteByteMask(bytes[2]); - data.WriteByteMask(bytes[0]); - data.WriteByteMask(bytes[1]); - data.WriteByteMask(bytes[6]); + data.WriteBit(bytes[3]); + data.WriteBit(bytes[5]); + data.WriteBit(bytes[7]); + data.WriteBit(bytes[4]); + data.WriteBit(bytes[2]); + data.WriteBit(bytes[0]); + data.WriteBit(bytes[1]); + data.WriteBit(bytes[6]); data.WriteByteSeq(bytes[0]); data.WriteByteSeq(bytes[3]); @@ -12798,14 +12798,14 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) break; case MOVE_SWIM_BACK: data.Initialize(SMSG_SPLINE_MOVE_SET_SWIM_BACK_SPEED, 1 + 8 + 4); - data.WriteByteMask(bytes[3]); - data.WriteByteMask(bytes[5]); - data.WriteByteMask(bytes[4]); - data.WriteByteMask(bytes[0]); - data.WriteByteMask(bytes[2]); - data.WriteByteMask(bytes[1]); - data.WriteByteMask(bytes[6]); - data.WriteByteMask(bytes[7]); + data.WriteBit(bytes[3]); + data.WriteBit(bytes[5]); + data.WriteBit(bytes[4]); + data.WriteBit(bytes[0]); + data.WriteBit(bytes[2]); + data.WriteBit(bytes[1]); + data.WriteBit(bytes[6]); + data.WriteBit(bytes[7]); data.WriteByteSeq(bytes[1]); data.WriteByteSeq(bytes[0]); @@ -12819,14 +12819,14 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) break; case MOVE_TURN_RATE: data.Initialize(SMSG_SPLINE_MOVE_SET_TURN_RATE, 1 + 8 + 4); - data.WriteByteMask(bytes[0]); - data.WriteByteMask(bytes[4]); - data.WriteByteMask(bytes[5]); - data.WriteByteMask(bytes[1]); - data.WriteByteMask(bytes[6]); - data.WriteByteMask(bytes[3]); - data.WriteByteMask(bytes[7]); - data.WriteByteMask(bytes[2]); + data.WriteBit(bytes[0]); + data.WriteBit(bytes[4]); + data.WriteBit(bytes[5]); + data.WriteBit(bytes[1]); + data.WriteBit(bytes[6]); + data.WriteBit(bytes[3]); + data.WriteBit(bytes[7]); + data.WriteBit(bytes[2]); data.WriteByteSeq(bytes[2]); data.WriteByteSeq(bytes[4]); @@ -12840,14 +12840,14 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) break; case MOVE_FLIGHT: data.Initialize(SMSG_SPLINE_MOVE_SET_FLIGHT_SPEED, 1 + 8 + 4); - data.WriteByteMask(bytes[2]); - data.WriteByteMask(bytes[3]); - data.WriteByteMask(bytes[5]); - data.WriteByteMask(bytes[0]); - data.WriteByteMask(bytes[7]); - data.WriteByteMask(bytes[4]); - data.WriteByteMask(bytes[6]); - data.WriteByteMask(bytes[1]); + data.WriteBit(bytes[2]); + data.WriteBit(bytes[3]); + data.WriteBit(bytes[5]); + data.WriteBit(bytes[0]); + data.WriteBit(bytes[7]); + data.WriteBit(bytes[4]); + data.WriteBit(bytes[6]); + data.WriteBit(bytes[1]); data << float(GetSpeed(mtype)); @@ -12862,14 +12862,14 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) break; case MOVE_FLIGHT_BACK: data.Initialize(SMSG_SPLINE_MOVE_SET_FLIGHT_BACK_SPEED, 1 + 8 + 4); - data.WriteByteMask(bytes[1]); - data.WriteByteMask(bytes[6]); - data.WriteByteMask(bytes[0]); - data.WriteByteMask(bytes[2]); - data.WriteByteMask(bytes[7]); - data.WriteByteMask(bytes[5]); - data.WriteByteMask(bytes[4]); - data.WriteByteMask(bytes[3]); + data.WriteBit(bytes[1]); + data.WriteBit(bytes[6]); + data.WriteBit(bytes[0]); + data.WriteBit(bytes[2]); + data.WriteBit(bytes[7]); + data.WriteBit(bytes[5]); + data.WriteBit(bytes[4]); + data.WriteBit(bytes[3]); data.WriteByteSeq(bytes[5]); data.WriteByteSeq(bytes[6]); @@ -12883,14 +12883,14 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) break; case MOVE_PITCH_RATE: data.Initialize(SMSG_SPLINE_MOVE_SET_PITCH_RATE, 1 + 8 + 4); - data.WriteByteMask(bytes[7]); - data.WriteByteMask(bytes[2]); - data.WriteByteMask(bytes[3]); - data.WriteByteMask(bytes[5]); - data.WriteByteMask(bytes[4]); - data.WriteByteMask(bytes[0]); - data.WriteByteMask(bytes[6]); - data.WriteByteMask(bytes[1]); + data.WriteBit(bytes[7]); + data.WriteBit(bytes[2]); + data.WriteBit(bytes[3]); + data.WriteBit(bytes[5]); + data.WriteBit(bytes[4]); + data.WriteBit(bytes[0]); + data.WriteBit(bytes[6]); + data.WriteBit(bytes[1]); data.WriteByteSeq(bytes[0]); data.WriteByteSeq(bytes[1]); @@ -12937,14 +12937,14 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) { case MOVE_WALK: data.Initialize(SMSG_MOVE_SET_WALK_SPEED, 1 + 8 + 4 + 4 ); - data.WriteByteMask(bytes[6]); - data.WriteByteMask(bytes[5]); - data.WriteByteMask(bytes[7]); - data.WriteByteMask(bytes[0]); - data.WriteByteMask(bytes[2]); - data.WriteByteMask(bytes[4]); - data.WriteByteMask(bytes[1]); - data.WriteByteMask(bytes[3]); + data.WriteBit(bytes[6]); + data.WriteBit(bytes[5]); + data.WriteBit(bytes[7]); + data.WriteBit(bytes[0]); + data.WriteBit(bytes[2]); + data.WriteBit(bytes[4]); + data.WriteBit(bytes[1]); + data.WriteBit(bytes[3]); data.WriteByteSeq(bytes[3]); data.WriteByteSeq(bytes[1]); @@ -12959,14 +12959,14 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) break; case MOVE_RUN: data.Initialize(SMSG_MOVE_SET_RUN_SPEED, 1 + 8 + 4 + 4 ); - data.WriteByteMask(bytes[1]); - data.WriteByteMask(bytes[0]); - data.WriteByteMask(bytes[7]); - data.WriteByteMask(bytes[5]); - data.WriteByteMask(bytes[2]); - data.WriteByteMask(bytes[4]); - data.WriteByteMask(bytes[3]); - data.WriteByteMask(bytes[6]); + data.WriteBit(bytes[1]); + data.WriteBit(bytes[0]); + data.WriteBit(bytes[7]); + data.WriteBit(bytes[5]); + data.WriteBit(bytes[2]); + data.WriteBit(bytes[4]); + data.WriteBit(bytes[3]); + data.WriteBit(bytes[6]); data.WriteByteSeq(bytes[1]); @@ -12983,14 +12983,14 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) break; case MOVE_RUN_BACK: data.Initialize(SMSG_MOVE_SET_RUN_BACK_SPEED, 1 + 8 + 4 + 4 ); - data.WriteByteMask(bytes[3]); - data.WriteByteMask(bytes[0]); - data.WriteByteMask(bytes[6]); - data.WriteByteMask(bytes[2]); - data.WriteByteMask(bytes[7]); - data.WriteByteMask(bytes[1]); - data.WriteByteMask(bytes[4]); - data.WriteByteMask(bytes[5]); + data.WriteBit(bytes[3]); + data.WriteBit(bytes[0]); + data.WriteBit(bytes[6]); + data.WriteBit(bytes[2]); + data.WriteBit(bytes[7]); + data.WriteBit(bytes[1]); + data.WriteBit(bytes[4]); + data.WriteBit(bytes[5]); data << float(GetSpeed(mtype)); @@ -13006,14 +13006,14 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) break; case MOVE_SWIM: data.Initialize(SMSG_MOVE_SET_SWIM_SPEED, 1 + 8 + 4 + 4 ); - data.WriteByteMask(bytes[7]); - data.WriteByteMask(bytes[2]); - data.WriteByteMask(bytes[3]); - data.WriteByteMask(bytes[4]); - data.WriteByteMask(bytes[5]); - data.WriteByteMask(bytes[6]); - data.WriteByteMask(bytes[1]); - data.WriteByteMask(bytes[0]); + data.WriteBit(bytes[7]); + data.WriteBit(bytes[2]); + data.WriteBit(bytes[3]); + data.WriteBit(bytes[4]); + data.WriteBit(bytes[5]); + data.WriteBit(bytes[6]); + data.WriteBit(bytes[1]); + data.WriteBit(bytes[0]); data.WriteByteSeq(bytes[6]); data.WriteByteSeq(bytes[4]); @@ -13028,14 +13028,14 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) break; case MOVE_SWIM_BACK: data.Initialize(SMSG_MOVE_SET_SWIM_BACK_SPEED, 1 + 8 + 4 + 4 ); - data.WriteByteMask(bytes[3]); - data.WriteByteMask(bytes[1]); - data.WriteByteMask(bytes[4]); - data.WriteByteMask(bytes[2]); - data.WriteByteMask(bytes[7]); - data.WriteByteMask(bytes[6]); - data.WriteByteMask(bytes[5]); - data.WriteByteMask(bytes[0]); + data.WriteBit(bytes[3]); + data.WriteBit(bytes[1]); + data.WriteBit(bytes[4]); + data.WriteBit(bytes[2]); + data.WriteBit(bytes[7]); + data.WriteBit(bytes[6]); + data.WriteBit(bytes[5]); + data.WriteBit(bytes[0]); data.WriteByteSeq(bytes[6]); data.WriteByteSeq(bytes[3]); @@ -13050,14 +13050,14 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) break; case MOVE_TURN_RATE: data.Initialize(SMSG_MOVE_SET_TURN_RATE, 1 + 8 + 4 + 4 ); - data.WriteByteMask(bytes[0]); - data.WriteByteMask(bytes[2]); - data.WriteByteMask(bytes[1]); - data.WriteByteMask(bytes[5]); - data.WriteByteMask(bytes[3]); - data.WriteByteMask(bytes[7]); - data.WriteByteMask(bytes[6]); - data.WriteByteMask(bytes[4]); + data.WriteBit(bytes[0]); + data.WriteBit(bytes[2]); + data.WriteBit(bytes[1]); + data.WriteBit(bytes[5]); + data.WriteBit(bytes[3]); + data.WriteBit(bytes[7]); + data.WriteBit(bytes[6]); + data.WriteBit(bytes[4]); data << float(GetSpeed(mtype)); @@ -13073,14 +13073,14 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) break; case MOVE_FLIGHT: data.Initialize(SMSG_MOVE_SET_FLIGHT_SPEED, 1 + 8 + 4 + 4 ); - data.WriteByteMask(bytes[0]); - data.WriteByteMask(bytes[7]); - data.WriteByteMask(bytes[4]); - data.WriteByteMask(bytes[5]); - data.WriteByteMask(bytes[6]); - data.WriteByteMask(bytes[1]); - data.WriteByteMask(bytes[2]); - data.WriteByteMask(bytes[3]); + data.WriteBit(bytes[0]); + data.WriteBit(bytes[7]); + data.WriteBit(bytes[4]); + data.WriteBit(bytes[5]); + data.WriteBit(bytes[6]); + data.WriteBit(bytes[1]); + data.WriteBit(bytes[2]); + data.WriteBit(bytes[3]); data << float(GetSpeed(mtype)); @@ -13096,14 +13096,14 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) break; case MOVE_FLIGHT_BACK: data.Initialize(SMSG_MOVE_SET_FLIGHT_BACK_SPEED, 1 + 8 + 4 + 4 ); - data.WriteByteMask(bytes[3]); - data.WriteByteMask(bytes[4]); - data.WriteByteMask(bytes[5]); - data.WriteByteMask(bytes[6]); - data.WriteByteMask(bytes[1]); - data.WriteByteMask(bytes[0]); - data.WriteByteMask(bytes[2]); - data.WriteByteMask(bytes[7]); + data.WriteBit(bytes[3]); + data.WriteBit(bytes[4]); + data.WriteBit(bytes[5]); + data.WriteBit(bytes[6]); + data.WriteBit(bytes[1]); + data.WriteBit(bytes[0]); + data.WriteBit(bytes[2]); + data.WriteBit(bytes[7]); data.WriteByteSeq(bytes[0]); data << float(GetSpeed(mtype)); @@ -13118,14 +13118,14 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) break; case MOVE_PITCH_RATE: data.Initialize(SMSG_MOVE_SET_PITCH_RATE, 1 + 8 + 4 + 4 ); - data.WriteByteMask(bytes[7]); - data.WriteByteMask(bytes[5]); - data.WriteByteMask(bytes[6]); - data.WriteByteMask(bytes[2]); - data.WriteByteMask(bytes[4]); - data.WriteByteMask(bytes[0]); - data.WriteByteMask(bytes[3]); - data.WriteByteMask(bytes[1]); + data.WriteBit(bytes[7]); + data.WriteBit(bytes[5]); + data.WriteBit(bytes[6]); + data.WriteBit(bytes[2]); + data.WriteBit(bytes[4]); + data.WriteBit(bytes[0]); + data.WriteBit(bytes[3]); + data.WriteBit(bytes[1]); data.WriteByteSeq(bytes[0]); data << uint32(0); @@ -17031,14 +17031,14 @@ void Unit::KnockbackFrom(float x, float y, float speedXY, float speedZ) uint64 guid = GetGUID(); uint8* bytes = (uint8*)&guid; - data.WriteByteMask(bytes[5]); - data.WriteByteMask(bytes[2]); - data.WriteByteMask(bytes[6]); - data.WriteByteMask(bytes[3]); - data.WriteByteMask(bytes[1]); - data.WriteByteMask(bytes[4]); - data.WriteByteMask(bytes[0]); - data.WriteByteMask(bytes[7]); + data.WriteBit(bytes[5]); + data.WriteBit(bytes[2]); + data.WriteBit(bytes[6]); + data.WriteBit(bytes[3]); + data.WriteBit(bytes[1]); + data.WriteBit(bytes[4]); + data.WriteBit(bytes[0]); + data.WriteBit(bytes[7]); data.WriteByteSeq(bytes[0]); data << float(speedXY); @@ -17371,14 +17371,14 @@ void Unit::JumpTo(float speedXY, float speedZ, bool forward) uint64 guid = GetGUID(); uint8* bytes = (uint8*)&guid; - data.WriteByteMask(bytes[5]); - data.WriteByteMask(bytes[2]); - data.WriteByteMask(bytes[6]); - data.WriteByteMask(bytes[3]); - data.WriteByteMask(bytes[1]); - data.WriteByteMask(bytes[4]); - data.WriteByteMask(bytes[0]); - data.WriteByteMask(bytes[7]); + data.WriteBit(bytes[5]); + data.WriteBit(bytes[2]); + data.WriteBit(bytes[6]); + data.WriteBit(bytes[3]); + data.WriteBit(bytes[1]); + data.WriteBit(bytes[4]); + data.WriteBit(bytes[0]); + data.WriteBit(bytes[7]); data.WriteByteSeq(bytes[0]); data << float(speedXY); diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 0461379b91b..94b40b921e9 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -751,33 +751,35 @@ void WorldSession::HandleCharDeleteOpcode(WorldPacket & recv_data) SendPacket(&data); } -void WorldSession::HandlePlayerLoginOpcode(WorldPacket & recv_data) +void WorldSession::HandlePlayerLoginOpcode(WorldPacket& recvData) { if (PlayerLoading() || GetPlayer() != NULL) { - sLog->outError("Player tryes to login again, AccountId = %d", GetAccountId()); + sLog->outError("Player tries to login again, AccountId = %d", GetAccountId()); return; } m_playerLoading = true; - uint64 playerGuid = 0; + ObjectGuid playerGuid; sLog->outStaticDebug("WORLD: Recvd Player Logon Message"); - - BitStream mask = recv_data.ReadBitStream(8); - - ByteBuffer bytes(8, true); - - recv_data.ReadXorByte(mask[6], bytes[5]); - recv_data.ReadXorByte(mask[0], bytes[0]); - recv_data.ReadXorByte(mask[4], bytes[3]); - recv_data.ReadXorByte(mask[1], bytes[4]); - recv_data.ReadXorByte(mask[2], bytes[7]); - recv_data.ReadXorByte(mask[5], bytes[2]); - recv_data.ReadXorByte(mask[7], bytes[6]); - recv_data.ReadXorByte(mask[3], bytes[1]); - - playerGuid = BitConverter::ToUInt64(bytes); + playerGuid[2] = recvData.ReadBit(); + playerGuid[3] = recvData.ReadBit(); + playerGuid[0] = recvData.ReadBit(); + playerGuid[6] = recvData.ReadBit(); + playerGuid[4] = recvData.ReadBit(); + playerGuid[5] = recvData.ReadBit(); + playerGuid[1] = recvData.ReadBit(); + playerGuid[7] = recvData.ReadBit(); + + recvData.ReadByteSeq(playerGuid[2]); + recvData.ReadByteSeq(playerGuid[7]); + recvData.ReadByteSeq(playerGuid[0]); + recvData.ReadByteSeq(playerGuid[3]); + recvData.ReadByteSeq(playerGuid[5]); + recvData.ReadByteSeq(playerGuid[6]); + recvData.ReadByteSeq(playerGuid[1]); + recvData.ReadByteSeq(playerGuid[4]); sLog->outDebug(LOG_FILTER_NETWORKIO, "Character (Guid: %u) logging in", GUID_LOPART(playerGuid)); @@ -802,9 +804,10 @@ void WorldSession::HandlePlayerLoginOpcode(WorldPacket & recv_data) void WorldSession::HandleLoadScreenOpcode(WorldPacket& recvPacket) { sLog->outStaticDebug("WORLD: Recvd CMSG_LOAD_SCREEN"); - uint8 unkMask; // Loading start: 0x80, loading end: 0x0 uint32 mapID; - recvPacket >> unkMask >> mapID; + + recvPacket >> mapID; + recvPacket.ReadBit(); // TODO: Do something with this packet } diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp index 626221e9696..494a8471a6a 100755 --- a/src/server/game/Handlers/GroupHandler.cpp +++ b/src/server/game/Handlers/GroupHandler.cpp @@ -62,18 +62,18 @@ void WorldSession::SendPartyResult(PartyOperation operation, const std::string& void WorldSession::HandleGroupInviteOpcode(WorldPacket & recv_data) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_INVITE"); - - BytesGuid guid; - guid.guid = 0; - - recv_data.ReadByteMask(guid.bytes[6]); - recv_data.ReadByteMask(guid.bytes[5]); - recv_data.ReadByteMask(guid.bytes[0]); - recv_data.ReadByteMask(guid.bytes[3]); - recv_data.ReadByteMask(guid.bytes[4]); - recv_data.ReadByteMask(guid.bytes[7]); - recv_data.ReadByteMask(guid.bytes[1]); - recv_data.ReadByteMask(guid.bytes[2]); + + //BytesGuid guid; + //guid.guid = 0; + + //recv_data.ReadByteMask(guid.bytes[6]); + //recv_data.ReadByteMask(guid.bytes[5]); + //recv_data.ReadByteMask(guid.bytes[0]); + //recv_data.ReadByteMask(guid.bytes[3]); + //recv_data.ReadByteMask(guid.bytes[4]); + //recv_data.ReadByteMask(guid.bytes[7]); + //recv_data.ReadByteMask(guid.bytes[1]); + //recv_data.ReadByteMask(guid.bytes[2]); recv_data.read_skip(); recv_data.read_skip(); @@ -82,16 +82,16 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket & recv_data) recv_data >> membername; recv_data.read_skip(); - recv_data.ReadByteSeq(guid.bytes[0]); - recv_data.ReadByteSeq(guid.bytes[7]); - recv_data.ReadByteSeq(guid.bytes[4]); - recv_data.ReadByteSeq(guid.bytes[1]); - recv_data.ReadByteSeq(guid.bytes[2]); - recv_data.ReadByteSeq(guid.bytes[6]); - recv_data.ReadByteSeq(guid.bytes[5]); + //recv_data.ReadByteSeq(guid.bytes[0]); + //recv_data.ReadByteSeq(guid.bytes[7]); + //recv_data.ReadByteSeq(guid.bytes[4]); + //recv_data.ReadByteSeq(guid.bytes[1]); + //recv_data.ReadByteSeq(guid.bytes[2]); + //recv_data.ReadByteSeq(guid.bytes[6]); + //recv_data.ReadByteSeq(guid.bytes[5]); std::string string0; recv_data >> string0; - recv_data.ReadByteSeq(guid.bytes[3]); + //recv_data.ReadByteSeq(guid.bytes[3]); // attempt add selected player diff --git a/src/server/game/Handlers/GuildHandler.cpp b/src/server/game/Handlers/GuildHandler.cpp index 7117c4f4bea..9d91feabcf6 100755 --- a/src/server/game/Handlers/GuildHandler.cpp +++ b/src/server/game/Handlers/GuildHandler.cpp @@ -46,7 +46,7 @@ void WorldSession::HandleGuildQueryOpcode(WorldPacket& recvPacket) uint64 guildGuid, playerGuid; recvPacket >> guildGuid >> playerGuid; - + // If guild doesn't exist or player is not part of the guild send error if (Guild* guild = sGuildMgr->GetGuildByGuid(guildGuid)) if (guild->IsMember(playerGuid)) @@ -129,20 +129,8 @@ void WorldSession::HandleGuildRosterOpcode(WorldPacket& recvPacket) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_ROSTER"); - BitStream mask = recvPacket.ReadBitStream(8); - ByteBuffer bytes(8, true); - - recvPacket.ReadXorByte(mask[0], bytes[7]); - recvPacket.ReadXorByte(mask[3], bytes[5]); - recvPacket.ReadXorByte(mask[4], bytes[4]); - recvPacket.ReadXorByte(mask[5], bytes[0]); - recvPacket.ReadXorByte(mask[6], bytes[1]); - recvPacket.ReadXorByte(mask[1], bytes[2]); - recvPacket.ReadXorByte(mask[2], bytes[6]); - recvPacket.ReadXorByte(mask[7], bytes[3]); - - uint64 guildGuid = BitConverter::ToUInt64(bytes); + uint64 guildGuid = 0; if (Guild* guild = sGuildMgr->GetGuildByGuid(guildGuid)) if (guild->IsMember(GetPlayer()->GetGUID())) diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 1e29ea2621e..0bdff9016f7 100755 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -744,14 +744,14 @@ void WorldSession::SendListInventory(uint64 vendorGuid) if (!items) { WorldPacket data(SMSG_LIST_INVENTORY, 8 + 1 + 1); - data.WriteByteMask(bytes[5]); - data.WriteByteMask(bytes[6]); - data.WriteByteMask(bytes[1]); - data.WriteByteMask(bytes[2]); - data.WriteByteMask(bytes[3]); - data.WriteByteMask(bytes[0]); - data.WriteByteMask(bytes[7]); - data.WriteByteMask(bytes[4]); + data.WriteBit(bytes[5]); + data.WriteBit(bytes[6]); + data.WriteBit(bytes[1]); + data.WriteBit(bytes[2]); + data.WriteBit(bytes[3]); + data.WriteBit(bytes[0]); + data.WriteBit(bytes[7]); + data.WriteBit(bytes[4]); data.WriteByteSeq(bytes[2]); data.WriteByteSeq(bytes[3]); @@ -771,14 +771,14 @@ void WorldSession::SendListInventory(uint64 vendorGuid) WorldPacket data(SMSG_LIST_INVENTORY, 8 + 1 + itemCount * 8 * 4); - data.WriteByteMask(bytes[5]); - data.WriteByteMask(bytes[6]); - data.WriteByteMask(bytes[1]); - data.WriteByteMask(bytes[2]); - data.WriteByteMask(bytes[3]); - data.WriteByteMask(bytes[0]); - data.WriteByteMask(bytes[7]); - data.WriteByteMask(bytes[4]); + data.WriteBit(bytes[5]); + data.WriteBit(bytes[6]); + data.WriteBit(bytes[1]); + data.WriteBit(bytes[2]); + data.WriteBit(bytes[3]); + data.WriteBit(bytes[0]); + data.WriteBit(bytes[7]); + data.WriteBit(bytes[4]); data.WriteByteSeq(bytes[2]); data.WriteByteSeq(bytes[3]); diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 1c02d2082b8..1ff10abc36b 100755 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -1098,22 +1098,23 @@ void WorldSession::HandleMoveTimeSkippedOpcode(WorldPacket & recv_data) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_MOVE_TIME_SKIPPED"); - BitStream mask = recv_data.ReadBitStream(8); + recv_data.rfinish(); + return; uint32 time; recv_data >> time; - ByteBuffer bytes(8, true); - recv_data.ReadXorByte(mask[0], bytes[1]); - recv_data.ReadXorByte(mask[1], bytes[4]); - recv_data.ReadXorByte(mask[7], bytes[2]); - recv_data.ReadXorByte(mask[5], bytes[5]); - recv_data.ReadXorByte(mask[3], bytes[0]); - recv_data.ReadXorByte(mask[6], bytes[7]); - recv_data.ReadXorByte(mask[2], bytes[6]); - recv_data.ReadXorByte(mask[4], bytes[3]); + //ByteBuffer bytes(8, true); + //recv_data.ReadXorByte(mask[0], bytes[1]); + //recv_data.ReadXorByte(mask[1], bytes[4]); + //recv_data.ReadXorByte(mask[7], bytes[2]); + //recv_data.ReadXorByte(mask[5], bytes[5]); + //recv_data.ReadXorByte(mask[3], bytes[0]); + //recv_data.ReadXorByte(mask[6], bytes[7]); + //recv_data.ReadXorByte(mask[2], bytes[6]); + //recv_data.ReadXorByte(mask[4], bytes[3]); - uint64 guid = BitConverter::ToUInt64(bytes); + //uint64 guid = BitConverter::ToUInt64(bytes); //TODO! @@ -1763,14 +1764,15 @@ void WorldSession::HandleInstanceLockResponse(WorldPacket& recvPacket) void WorldSession::HandleRequestHotfix(WorldPacket& recvPacket) { + recvPacket.rfinish(); + return; + uint32 type, count; recvPacket >> type >> count; ByteBuffer* guidBytes = new ByteBuffer[count]; - BitStream* mask = new BitStream[count]; for (uint32 i = 0; i < count; ++i) { - mask[i] = recvPacket.ReadBitStream(8); guidBytes[i].resize(8); // damn c++ not allowing to use non-default constructor with new[] } @@ -1779,15 +1781,15 @@ void WorldSession::HandleRequestHotfix(WorldPacket& recvPacket) for (uint32 i = 0; i < count; ++i) { recvPacket >> entry; - recvPacket.ReadXorByte(mask[i][7], guidBytes[i][2]); - recvPacket.ReadXorByte(mask[i][4], guidBytes[i][6]); - recvPacket.ReadXorByte(mask[i][1], guidBytes[i][3]); - recvPacket.ReadXorByte(mask[i][2], guidBytes[i][0]); - recvPacket.ReadXorByte(mask[i][3], guidBytes[i][5]); - recvPacket.ReadXorByte(mask[i][0], guidBytes[i][7]); - recvPacket.ReadXorByte(mask[i][6], guidBytes[i][1]); - recvPacket.ReadXorByte(mask[i][5], guidBytes[i][4]); - guid = BitConverter::ToUInt64(guidBytes[i]); + //recvPacket.ReadXorByte(mask[i][7], guidBytes[i][2]); + //recvPacket.ReadXorByte(mask[i][4], guidBytes[i][6]); + //recvPacket.ReadXorByte(mask[i][1], guidBytes[i][3]); + //recvPacket.ReadXorByte(mask[i][2], guidBytes[i][0]); + //recvPacket.ReadXorByte(mask[i][3], guidBytes[i][5]); + //recvPacket.ReadXorByte(mask[i][0], guidBytes[i][7]); + //recvPacket.ReadXorByte(mask[i][6], guidBytes[i][1]); + //recvPacket.ReadXorByte(mask[i][5], guidBytes[i][4]); + //guid = BitConverter::ToUInt64(guidBytes[i]); switch (type) { @@ -1803,7 +1805,6 @@ void WorldSession::HandleRequestHotfix(WorldPacket& recvPacket) } delete[] guidBytes; - delete[] mask; } void WorldSession::HandleUpdateMissileTrajectory(WorldPacket& recvPacket) diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp index 598dafb200a..57afc614545 100755 --- a/src/server/game/Handlers/MovementHandler.cpp +++ b/src/server/game/Handlers/MovementHandler.cpp @@ -192,22 +192,14 @@ void WorldSession::HandleMoveTeleportAck(WorldPacket& recv_data) { sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_MOVE_TELEPORT_ACK"); - BitStream mask = recv_data.ReadBitStream(8); + recv_data.rfinish(); + return; uint32 flags, time; recv_data >> flags >> time; - ByteBuffer bytes(8, true); - recv_data.ReadXorByte(mask[6], bytes[1]); - recv_data.ReadXorByte(mask[0], bytes[3]); - recv_data.ReadXorByte(mask[1], bytes[2]); - recv_data.ReadXorByte(mask[7], bytes[0]); - recv_data.ReadXorByte(mask[5], bytes[6]); - recv_data.ReadXorByte(mask[3], bytes[4]); - recv_data.ReadXorByte(mask[2], bytes[7]); - recv_data.ReadXorByte(mask[4], bytes[5]); - uint64 guid = BitConverter::ToUInt64(bytes); + uint64 guid = 0; sLog->outStaticDebug("Guid " UI64FMTD, guid); sLog->outStaticDebug("Flags %u, time %u", flags, time/IN_MILLISECONDS); @@ -618,11 +610,8 @@ void WorldSession::ReadMovementInfo(WorldPacket &data, MovementInfo* mi) if (sequence == NULL) return; - BytesGuid guid; - BytesGuid tguid; - - guid.guid = 0; - tguid.guid = 0; + ObjectGuid guid; + ObjectGuid tguid; for (uint32 i = 0; i < MSE_COUNT; i++) { @@ -630,7 +619,7 @@ void WorldSession::ReadMovementInfo(WorldPacket &data, MovementInfo* mi) if (element >= MSEGuidByte0 && element <= MSEGuidByte7) { - data.ReadByteMask(guid.bytes[element - MSEGuidByte0]); + guid[element - MSEGuidByte0] = data.ReadBit(); continue; } @@ -638,13 +627,13 @@ void WorldSession::ReadMovementInfo(WorldPacket &data, MovementInfo* mi) element <= MSETransportGuidByte7) { if (HaveTransportData) - data.ReadByteMask(tguid.bytes[element - MSETransportGuidByte0]); + tguid[element - MSETransportGuidByte0] = data.ReadBit(); continue; } if (element >= MSEGuidByte0_2 && element <= MSEGuidByte7_2) { - data.ReadByteSeq(guid.bytes[element - MSEGuidByte0_2]); + data.ReadByteSeq(guid[element - MSEGuidByte0_2]); continue; } @@ -652,7 +641,7 @@ void WorldSession::ReadMovementInfo(WorldPacket &data, MovementInfo* mi) element <= MSETransportGuidByte7_2) { if (HaveTransportData) - data.ReadByteSeq(tguid.bytes[element - MSETransportGuidByte0_2]); + data.ReadByteSeq(tguid[element - MSETransportGuidByte0_2]); continue; } @@ -763,8 +752,8 @@ void WorldSession::ReadMovementInfo(WorldPacket &data, MovementInfo* mi) } } - mi->guid = guid.guid; - mi->t_guid = tguid.guid; + mi->guid = guid; + mi->t_guid = tguid; if (HaveTransportData && mi->pos.m_positionX != mi->t_pos.m_positionX) if (GetPlayer()->GetTransport()) @@ -866,7 +855,7 @@ void WorldSession::WriteMovementInfo(WorldPacket &data, MovementInfo* mi) if (element >= MSEGuidByte0 && element <= MSEGuidByte7) { - data.WriteByteMask(guid[element - MSEGuidByte0]); + data.WriteBit(guid[element - MSEGuidByte0]); continue; } @@ -874,7 +863,7 @@ void WorldSession::WriteMovementInfo(WorldPacket &data, MovementInfo* mi) element <= MSETransportGuidByte7) { if (HaveTransportData) - data.WriteByteMask(tguid[element - MSETransportGuidByte0]); + data.WriteBit(tguid[element - MSETransportGuidByte0]); continue; } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 844aae93ad4..f458f5a73dd 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -381,7 +381,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_LFG_TELEPORT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgTeleportOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LIST_INVENTORY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleListInventoryOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LOAD_DANCES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LOAD_SCREEN, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleLoadScreenOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_LOAD_SCREEN, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleLoadScreenOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LOGOUT_CANCEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLogoutCancelOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LOGOUT_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLogoutRequestOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LOG_DISCONNECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 7495a57f399..5d7d6b2d775 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -84,12 +84,6 @@ struct AccountData std::string Data; }; -union BytesGuid -{ - uint8 bytes[8]; - uint64 guid; -}; - enum PartyOperation { PARTY_OP_INVITE = 0, diff --git a/src/server/shared/Database/PreparedStatement.cpp b/src/server/shared/Database/PreparedStatement.cpp index 58aa2bd3aa0..ae69fc5f913 100755 --- a/src/server/shared/Database/PreparedStatement.cpp +++ b/src/server/shared/Database/PreparedStatement.cpp @@ -230,11 +230,16 @@ void MySQLPreparedStatement::ClearParameters() } } +static bool ParementerIndexAssertFail(uint32 stmtIndex, uint8 index, uint32 paramCount) +{ + sLog->outError("Attempted to bind parameter %u%s on a PreparedStatement %u (statement has only %u parameters)", uint32(index) + 1, (index == 1 ? "st" : (index == 2 ? "nd" : (index == 3 ? "rd" : "nd"))), stmtIndex, paramCount); + return false; +} + //- Bind on mysql level bool MySQLPreparedStatement::CheckValidIndex(uint8 index) { - if (index >= m_paramCount) - return false; + ASSERT(index < m_paramCount || ParementerIndexAssertFail(m_stmt->m_index, index, m_paramCount)); if (m_paramsSet[index]) sLog->outSQLDriver("[WARNING] Prepared Statement (id: %u) trying to bind value on already bound index (%u).", m_stmt->m_index, index); diff --git a/src/server/shared/Packets/ByteBuffer.cpp b/src/server/shared/Packets/ByteBuffer.cpp deleted file mode 100644 index adb58936c75..00000000000 --- a/src/server/shared/Packets/ByteBuffer.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (C) 2008-2011 TrinityCore - * - * 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; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; 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, see . - */ - -#include "ByteBuffer.h" - -void BitStream::Clear() -{ - _data.clear(); - _rpos = _wpos = 0; -} - -uint8 BitStream::GetBit(uint32 bit) -{ - ASSERT(_data.size() > bit); - return _data[bit]; -} - -uint8 BitStream::ReadBit() -{ - ASSERT(_data.size() < _rpos); - uint8 b = _data[_rpos]; - ++_rpos; - return b; -} - -void BitStream::WriteBit(uint32 bit) -{ - _data.push_back(bit ? uint8(1) : uint8(0)); - ++_wpos; -} - -template void BitStream::WriteBits(T value, size_t bits) -{ - for (int32 i = bits-1; i >= 0; --i) - WriteBit((value >> i) & 1); -} - -bool BitStream::Empty() -{ - return _data.empty(); -} - -void BitStream::Reverse() -{ - uint32 len = GetLength(); - std::vector b = _data; - Clear(); - - for(uint32 i = len; i > 0; --i) - WriteBit(b[i-1]); -} - -void BitStream::Print() -{ - if (!sLog->IsOutDebug()) - return; - std::stringstream ss; - ss << "BitStream: "; - for (uint32 i = 0; i < GetLength(); ++i) - ss << uint32(GetBit(i)) << " "; - - sLog->outDebug(LOG_FILTER_NETWORKIO, "%s", ss.str().c_str()); -} - -ByteBuffer::ByteBuffer(size_t res, bool init): _rpos(0), _wpos(0), _bitpos(8), _curbitval(0) -{ - if (init) - _storage.resize(res, 0); - else - _storage.reserve(res); -} diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h index b78d78c69f2..c08f794c5fa 100755 --- a/src/server/shared/Packets/ByteBuffer.h +++ b/src/server/shared/Packets/ByteBuffer.h @@ -77,60 +77,21 @@ class ByteBufferSourceException : public ByteBufferException } }; -class BitStream -{ - public: - BitStream(): _rpos(0), _wpos(0) {} - - BitStream(uint32 val, size_t len): _rpos(0), _wpos(0) - { - WriteBits(val, len); - } - - BitStream(BitStream const& bs) : _data(bs._data), _rpos(bs._rpos), _wpos(bs._wpos) {} - - void Clear(); - uint8 GetBit(uint32 bit); - uint8 ReadBit(); - void WriteBit(uint32 bit); - template void WriteBits(T value, size_t bits); - bool Empty(); - void Reverse(); - void Print(); - - size_t GetLength() { return _data.size(); } - uint32 GetReadPosition() { return _rpos; } - uint32 GetWritePosition() { return _wpos; } - void SetReadPos(uint32 pos) { _rpos = pos; } - - uint8 const& operator[](uint32 const pos) const - { - return _data[pos]; - } - - uint8& operator[] (uint32 const pos) - { - return _data[pos]; - } - - private: - std::vector _data; - uint32 _rpos, _wpos; -}; - class ByteBuffer { public: const static size_t DEFAULT_SIZE = 0x1000; // constructor - ByteBuffer(): _rpos(0), _wpos(0), _bitpos(8), _curbitval(0) + ByteBuffer() : _rpos(0), _wpos(0), _bitpos(8), _curbitval(0) { _storage.reserve(DEFAULT_SIZE); } - // constructor - ByteBuffer(size_t res, bool init = false); + ByteBuffer(size_t reserve) : _rpos(0), _wpos(0), _bitpos(8), _curbitval(0) + { + _storage.reserve(reserve); + } // copy constructor ByteBuffer(const ByteBuffer &buf) : _rpos(buf._rpos), _wpos(buf._wpos), @@ -205,43 +166,13 @@ class ByteBuffer return value; } - BitStream ReadBitStream(uint32 len) - { - BitStream b; - for (uint32 i = 0; i < len; ++i) - b.WriteBit(ReadBit()); - return b; - } - - void ReadByteMask(uint8& b) - { - b = ReadBit() ? 1 : 0; - } - + // Reads a byte (if needed) in-place void ReadByteSeq(uint8& b) { if (b != 0) b ^= read(); } - uint8 ReadXorByte() - { - return ReadUInt8() ^ 1; - } - - void ReadXorByte(uint32 bit, uint8& byte) - { - if (!bit) - byte = 0; - else - byte = uint8(ReadUInt8() ^ bit); - } - - void WriteByteMask(uint8 b) - { - WriteBit(b); - } - void WriteByteSeq(uint8 b) { if (b != 0) @@ -505,69 +436,6 @@ class ByteBuffer } } - uint8 ReadUInt8() - { - uint8 u = 0; - (*this) >> u; - return u; - } - - uint16 ReadUInt16() - { - uint16 u = 0; - (*this) >> u; - return u; - } - - uint32 ReadUInt32() - { - uint32 u = 0; - (*this) >> u; - return u; - } - - uint64 ReadUInt64() - { - uint64 u = 0; - (*this) >> u; - return u; - } - - int8 ReadInt8() - { - int8 u = 0; - (*this) >> u; - return u; - } - - int16 ReadInt16() - { - int16 u = 0; - (*this) >> u; - return u; - } - - int32 ReadInt32() - { - uint32 u = 0; - (*this) >> u; - return u; - } - - int64 ReadInt64() - { - int64 u = 0; - (*this) >> u; - return u; - } - - std::string ReadString() - { - std::string s; - (*this) >> s; - return s; - } - std::string ReadString(uint32 length) { char* buffer = new char[length + 1]; @@ -578,20 +446,6 @@ class ByteBuffer return retval; } - bool ReadBoolean() - { - uint8 b = 0; - (*this) >> b; - return b > 0 ? true : false; - } - - float ReadSingle() - { - float f = 0; - (*this) >> f; - return f; - } - const uint8 *contents() const { return &_storage[0]; } size_t size() const { return _storage.size(); } @@ -844,7 +698,6 @@ inline ByteBuffer &operator>>(ByteBuffer &b, std::map &m) return b; } -// TODO: Make a ByteBuffer.cpp and move all this inlining to it. template<> inline std::string ByteBuffer::read() { std::string tmp; @@ -871,44 +724,5 @@ inline void ByteBuffer::read_skip() read_skip(); } -class BitConverter -{ - public: - static uint8 ToUInt8(ByteBuffer const& buff, size_t start = 0) - { - return buff.read(start); - } - - static uint16 ToUInt16(ByteBuffer const& buff, size_t start = 0) - { - return buff.read(start); - } - - static uint32 ToUInt32(ByteBuffer const& buff, size_t start = 0) - { - return buff.read(start); - } - - static uint64 ToUInt64(ByteBuffer const& buff, size_t start = 0) - { - return buff.read(start); - } - - static int16 ToInt16(ByteBuffer const& buff, size_t start = 0) - { - return buff.read(start); - } - - static int32 ToInt32(ByteBuffer const& buff, size_t start = 0) - { - return buff.read(start); - } - - static int64 ToInt64(ByteBuffer const& buff, size_t start = 0) - { - return buff.read(start); - } -}; - #endif -- cgit v1.2.3 From 947dbcbabc004727b69d7fcae2db320fcc776c6b Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 11 Jul 2012 23:27:00 +0200 Subject: Core/Achievements: Fixed crash in CheckAllAchievementCriteria --- src/server/game/Achievements/AchievementMgr.cpp | 14 ++++++++------ src/server/game/Achievements/AchievementMgr.h | 2 +- src/server/game/Entities/Player/Player.cpp | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 34b38ff1d35..fb24c25fed2 100755 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -817,6 +817,11 @@ void AchievementMgr::LoadFromDB(PreparedQueryResult achievementResult, Pr template void AchievementMgr::Reset() +{ +} + +template<> +void AchievementMgr::Reset() { for (CompletedAchievementMap::const_iterator iter = m_completedAchievements.begin(); iter != m_completedAchievements.end(); ++iter) { @@ -837,7 +842,7 @@ void AchievementMgr::Reset() DeleteFromDB(_owner->GetGUIDLow()); // re-fill data - CheckAllAchievementCriteria(); + CheckAllAchievementCriteria(GetOwner()); } template<> @@ -874,9 +879,6 @@ void AchievementMgr::Reset() m_completedAchievements.clear(); DeleteFromDB(_owner->GetId()); - - // re-fill data - CheckAllAchievementCriteria(); } template @@ -1040,11 +1042,11 @@ void AchievementMgr::SendCriteriaUpdate(AchievementCriteriaEntry const* e * called at player login. The player might have fulfilled some achievements when the achievement system wasn't working yet */ template -void AchievementMgr::CheckAllAchievementCriteria() +void AchievementMgr::CheckAllAchievementCriteria(Player* referencePlayer) { // suppress sending packets for (uint32 i=0; iGetPreparedResult(PLAYER_LOGIN_QUERY_LOADDECLINEDNAMES)); - m_achievementMgr.CheckAllAchievementCriteria(); + m_achievementMgr.CheckAllAchievementCriteria(this); _LoadEquipmentSets(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADEQUIPMENTSETS)); -- cgit v1.2.3 From a2b1cf66ca00ae22bd19abd49051537179d144b3 Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 11 Jul 2012 23:28:40 +0200 Subject: Core/PacketIO: Update structures of many packets sent during the login process --- src/server/game/Entities/Player/Player.cpp | 65 +++++++++++++-------------- src/server/game/Handlers/CharacterHandler.cpp | 36 +++++++++++---- src/server/game/Reputation/ReputationMgr.cpp | 16 +++---- src/server/game/Server/Protocol/Opcodes.cpp | 43 +++++++++--------- 4 files changed, 87 insertions(+), 73 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 219878799ac..0e36bdf21c1 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -3376,7 +3376,7 @@ void Player::SendInitialSpells() data << uint32(itr->first); data << uint16(0); // it's not slot id - spellCount +=1; + ++spellCount; } data.put(countPos, spellCount); // write real count value @@ -3391,7 +3391,7 @@ void Player::SendInitialSpells() data << uint32(itr->first); - data << uint16(itr->second.itemid); // cast item id + data << uint32(itr->second.itemid); // cast item id data << uint16(sEntry->Category); // spell category // send infinity cooldown in special format @@ -6772,7 +6772,6 @@ void Player::SendActionButtons(uint32 state) const sLog->outDetail("Sending Action Buttons for '%u' spec '%u'", GetGUIDLow(), GetActiveSpec()); WorldPacket data(SMSG_ACTION_BUTTONS, 1+(MAX_ACTION_BUTTONS*4)); - data << uint8(state); /* state can be 0, 1, 2 0 - Looks to be sent when initial action buttons get sent, however on Trinity we use 1 since 0 had some difficulties @@ -6791,6 +6790,7 @@ void Player::SendActionButtons(uint32 state) const } } + data << uint8(state); GetSession()->SendPacket(&data); sLog->outDetail("Action Buttons for '%u' spec '%u' Sent", GetGUIDLow(), GetActiveSpec()); } @@ -7404,39 +7404,40 @@ bool Player::RewardHonor(Unit* victim, uint32 groupsize, int32 honor, bool pvpto void Player::SendCurrencies() const { - WorldPacket packet(SMSG_INIT_CURRENCY, 4 + m_currencies.size()*(5*4 + 1)); - packet << uint32(m_currencies.size()); + ByteBuffer currencyData; + WorldPacket packet(SMSG_INIT_CURRENCY, 4 + m_currencies.size()*(5*4 + 1)); + packet.WriteBits(m_currencies.size(), 23); - for (PlayerCurrenciesMap::const_iterator itr = m_currencies.begin(); itr != m_currencies.end(); ++itr) - { + for (PlayerCurrenciesMap::const_iterator itr = m_currencies.begin(); itr != m_currencies.end(); ++itr) + { CurrencyTypesEntry const* entry = sCurrencyTypesStore.LookupEntry(itr->first); - if (!entry) + if (!entry) // should never happen continue; uint32 precision = (entry->Flags & 0x8) ? 100 : 1; - packet.WriteBit(_GetCurrencyWeekCap(entry) / precision); - packet.WriteBit(0); - packet.WriteBit(itr->second.weekCount / precision); - } + uint32 weekCount = itr->second.weekCount / precision; + uint32 weekCap = _GetCurrencyWeekCap(entry) / precision; - for (PlayerCurrenciesMap::const_iterator itr = m_currencies.begin(); itr != m_currencies.end(); ++itr) - { - CurrencyTypesEntry const* entry = sCurrencyTypesStore.LookupEntry(itr->first); - if (!entry) - continue; + packet.WriteBit(weekCount); + packet.WriteBits(0, 4); // some flags + packet.WriteBit(weekCap); + packet.WriteBit(0); // season total earned - uint32 precision = (entry->Flags & 0x8) ? 100 : 1; - packet << uint32(entry->ID); - if (uint32 weekCap = (_GetCurrencyWeekCap(entry) / precision)) - packet << uint32(weekCap); - packet << uint32(itr->second.totalCount / precision); - packet << uint8(0); // unknown - //packet << uint32(0); // season total earned - if (uint32 weekCount = (itr->second.weekCount / precision)) - packet << uint32(weekCount); - } + currencyData << uint32(itr->second.totalCount / precision); + if (weekCap) + currencyData << uint32(weekCap); + + //if (seasonTotal) + // currencyData << uint32(seasonTotal); + + currencyData << uint32(entry->ID); + if (weekCount) + currencyData << uint32(weekCount); + } - GetSession()->SendPacket(&packet); + packet.FlushBits(); + packet.append(currencyData); + GetSession()->SendPacket(&packet); } uint32 Player::GetCurrency(uint32 id) const @@ -18687,7 +18688,7 @@ bool Player::_LoadHomeBind(PreparedQueryResult result) PlayerInfo const* info = sObjectMgr->GetPlayerInfo(getRace(), getClass()); if (!info) { - sLog->outError("Player (Name %s) has incorrect race/class pair. Can't be loaded.", GetName()); + sLog->outError("Player (Name %s) has incorrect race/class (%u/%u) pair. Can't be loaded.", GetName(), uint32(getRace()), uint32(getClass())); return false; } @@ -22217,12 +22218,6 @@ void Player::SendInitialPacketsBeforeAddToMap() SendTalentsInfoData(false); - // SMSG_INSTANCE_DIFFICULTY - data.Initialize(SMSG_INSTANCE_DIFFICULTY, 4+4); - data << uint32(GetMap()->GetDifficulty()); - data << uint32(0); - GetSession()->SendPacket(&data); - SendInitialSpells(); data.Initialize(SMSG_SEND_UNLEARN_SPELLS, 4); diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 94b40b921e9..7800a06024f 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -848,8 +848,31 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder) data.Initialize(SMSG_FEATURE_SYSTEM_STATUS, 7); // checked in 4.2.2 data << uint8(2); // unknown value - data << uint8(0); // enable(1) / disable(0) voice chat interface in client - data << uint32(0); // Complain System Status + data << uint32(0); + data << uint32(0); + data << uint32(0); + data << uint32(0); + data.WriteBit(0); + data.WriteBit(0); + data.WriteBit(0); + data.WriteBit(0); + data.WriteBit(0); + data.WriteBit(0); + data.FlushBits(); + //if (featureBit4) + //{ + // data << uint32(0); + // data << uint32(0); + // data << uint32(0); + // data << uint32(0); + //} + + //if (featureBit5) + //{ + // data << uint32(0); + // data << uint32(0); + // data << uint32(0); + //} SendPacket(&data); // Send MOTD @@ -916,13 +939,12 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder) } data.Initialize(SMSG_LEARNED_DANCE_MOVES, 4+4); - data << uint32(0); - data << uint32(0); + data << uint64(0); SendPacket(&data); data.Initialize(SMSG_HOTFIX_INFO); HotfixData const& hotfix = sObjectMgr->GetHotfixData(); - data << uint32(hotfix.size()); + data.WriteBits(hotfix.size(), 22); for (uint32 i = 0; i < hotfix.size(); ++i) { data << uint32(hotfix[i].Type); @@ -977,15 +999,11 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder) pCurrChar->SendInitialPacketsAfterAddToMap(); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_ONLINE); - stmt->setUInt32(0, pCurrChar->GetGUIDLow()); - CharacterDatabase.Execute(stmt); stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_ACCOUNT_ONLINE); - stmt->setUInt32(0, GetAccountId()); - LoginDatabase.Execute(stmt); pCurrChar->SetInGameTime(getMSTime()); diff --git a/src/server/game/Reputation/ReputationMgr.cpp b/src/server/game/Reputation/ReputationMgr.cpp index 0ae16d72758..78f2e44c29a 100755 --- a/src/server/game/Reputation/ReputationMgr.cpp +++ b/src/server/game/Reputation/ReputationMgr.cpp @@ -197,23 +197,23 @@ void ReputationMgr::SendState(FactionState const* faction) void ReputationMgr::SendInitialReputations() { - WorldPacket data(SMSG_INITIALIZE_FACTIONS, (4+128*5)); - data << uint32 (0x00000080); + WorldPacket data(SMSG_INITIALIZE_FACTIONS, (4+256*5)); + data << uint32(256); // count RepListID a = 0; for (FactionStateList::iterator itr = _factions.begin(); itr != _factions.end(); ++itr) { // fill in absent fields - for (; a != itr->first; a++) + for (; a != itr->first; ++a) { - data << uint8 (0x00); - data << uint32 (0x00000000); + data << uint8(0); + data << uint32(0); } // fill in encountered data - data << uint8 (itr->second.Flags); - data << uint32 (itr->second.Standing); + data << uint8(itr->second.Flags); + data << uint32(itr->second.Standing); itr->second.needSend = false; @@ -221,7 +221,7 @@ void ReputationMgr::SendInitialReputations() } // fill in absent fields - for (; a != 128; a++) + for (; a != 256; ++a) { data << uint8 (0x00); data << uint32 (0x00000000); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index f458f5a73dd..b92ddecc40b 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -494,7 +494,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_PING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); //DEFINE_OPCODE_HANDLER(CMSG_PLAYED_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayedTime ); //DEFINE_OPCODE_HANDLER(CMSG_PLAYER_AI_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_PLAYER_LOGIN, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayerLoginOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_PLAYER_LOGIN, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayerLoginOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_PLAYER_LOGOUT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayerLogoutOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_PLAYER_VEHICLE_ENTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEnterPlayerVehicle ); //DEFINE_OPCODE_HANDLER(CMSG_PLAY_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -772,8 +772,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(MSG_RAID_TARGET_UPDATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidTargetUpdateOpcode ); //DEFINE_OPCODE_HANDLER(MSG_RANDOM_ROLL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRandomRollOpcode ); //DEFINE_OPCODE_HANDLER(MSG_SAVE_GUILD_EMBLEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSaveGuildEmblemOpcode ); - //DEFINE_OPCODE_HANDLER(MSG_SET_DUNGEON_DIFFICULTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetDungeonDifficultyOpcode); - //DEFINE_OPCODE_HANDLER(MSG_SET_RAID_DIFFICULTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetRaidDifficultyOpcode ); + DEFINE_OPCODE_HANDLER(MSG_SET_DUNGEON_DIFFICULTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetDungeonDifficultyOpcode); + DEFINE_OPCODE_HANDLER(MSG_SET_RAID_DIFFICULTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetRaidDifficultyOpcode ); //DEFINE_OPCODE_HANDLER(MSG_TABARDVENDOR_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTabardVendorActivateOpcode); //DEFINE_OPCODE_HANDLER(MSG_TALENT_WIPE_CONFIRM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTalentWipeConfirmOpcode ); //DEFINE_OPCODE_HANDLER(MSG_VERIFY_CONNECTIVITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); @@ -781,7 +781,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_ACCOUNT_DATA_TIMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ACHIEVEMENT_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ACHIEVEMENT_EARNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ACTION_BUTTONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ACTION_BUTTONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ACTIVATETAXIREPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ADDON_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ADD_RUNE_POWER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -815,8 +815,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_OWNER_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_REMOVED_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_AURACASTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_AURA_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_AURA_UPDATE_ALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_AURA_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_AURA_UPDATE_ALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_AUTH_CHALLENGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_AUTH_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_AVAILABLE_VOICE_CHANNEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -835,7 +835,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_PLAYER_JOINED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_PLAYER_LEFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BINDER_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BINDPOINTUPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BINDPOINTUPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BINDZONEREPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BREAK_TARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BUY_BANK_SLOT_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -909,7 +909,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_COMSAT_CONNECT_FAIL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMSAT_DISCONNECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMSAT_RECONNECT_TRY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CONTACT_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CONTACT_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CONVERT_RUNE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COOLDOWN_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COOLDOWN_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -949,12 +949,12 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_ENABLE_BARBER_SHOP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ENCHANTMENTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ENVIRONMENTALDAMAGELOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_EQUIPMENT_SET_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_EQUIPMENT_SET_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_EQUIPMENT_SET_SAVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_EQUIPMENT_SET_USE_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_EXPECTED_SPAM_RECORDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_EXPLORATION_EXPERIENCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_FEATURE_SYSTEM_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_FEATURE_SYSTEM_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_FEIGN_DEATH_RESISTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_FISH_ESCAPED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_FISH_NOT_HOOKED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1017,11 +1017,12 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_GUILD_ROSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_HEALTH_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_HIGHEST_THREAT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_HOTFIX_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_HOTFIX_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_IGNORE_DIMINISHING_RETURNS_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_IGNORE_REQUIREMENTS_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_INITIALIZE_FACTIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_INITIAL_SPELLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_INITIALIZE_FACTIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_INITIAL_SPELLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_INIT_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_INIT_EXTRA_AURA_INFO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_INIT_WORLD_STATES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_INSPECT_RESULTS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1036,7 +1037,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_INVALID_PROMOTION_CODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_INVENTORY_CHANGE_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ITEM_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ITEM_ENCHANT_TIME_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ITEM_ENCHANT_TIME_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ITEM_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ITEM_PUSH_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ITEM_REFUND_INFO_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1045,7 +1046,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_ITEM_TIME_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_JOINED_BATTLEGROUND_QUEUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_KICK_REASON, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LEARNED_DANCE_MOVES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LEARNED_DANCE_MOVES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LEARNED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LEVELUP_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_BOOT_PROPOSAL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1065,8 +1066,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_SEARCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LIST_INVENTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LOGIN_SETTIMESPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LOGIN_VERIFY_WORLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOGIN_SETTIMESPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOGIN_VERIFY_WORLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOGOUT_CANCEL_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOGOUT_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOGOUT_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1097,7 +1098,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_MODIFY_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MONSTER_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MONSTER_MOVE_TRANSPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOTD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOTD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOUNTRESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOUNTSPECIAL_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_CHARACTER_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -1241,7 +1242,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_SELL_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SEND_ALL_COMBAT_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SEND_MAIL_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SEND_UNLEARN_SPELLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SEND_UNLEARN_SPELLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SERVERINFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SERVERTIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SERVER_BUCK_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1332,7 +1333,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_SUMMON_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SUPERCEDED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SUSPEND_COMMS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_TALENTS_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TALENTS_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TALENTS_INVOLUNTARILY_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TALENTS_INVOLUNTARILY_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TAXINODE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1341,7 +1342,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_THREAT_CLEAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_THREAT_REMOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_THREAT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_TIME_SYNC_REQ, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TIME_SYNC_REQ, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TITLE_EARNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TOGGLE_XP_GAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TOTEM_CREATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From adc22685f26f6e62744c71973fce97d2dd43bced Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 11 Jul 2012 23:29:33 +0200 Subject: Core/PacketIO: Check if server opcodes are enabled before sending them to client --- src/server/game/Server/WorldSession.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index 9b6eaaea6c3..0d961023120 100755 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -171,6 +171,12 @@ void WorldSession::SendPacket(WorldPacket const* packet) return; } + if (!opcodeTable[packet->GetOpcode()]) + { + sLog->outError("Prevented sending disabled opcode %d (hex %#04X)", packet->GetOpcode(), packet->GetOpcode()); + return; + } + #ifdef TRINITY_DEBUG // Code for network use statistic static uint64 sendPacketCount = 0; -- cgit v1.2.3 From b0f6311fe99671351e9b8fb08d61d365a483a570 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 12 Jul 2012 01:02:45 +0200 Subject: Core/PacketIO: More structure updates (SMSG_DB_REPLY, CMSG_REQUEST_HOTFIX) and enabled opcodes with verified structures --- src/server/game/Entities/Unit/Unit.cpp | 2 +- src/server/game/Handlers/ItemHandler.cpp | 18 +++++++----- src/server/game/Handlers/MiscHandler.cpp | 45 ++++++++++++++++++----------- src/server/game/Server/Protocol/Opcodes.cpp | 19 ++++++------ src/server/game/Server/Protocol/Opcodes.h | 4 +-- src/server/game/Server/WorldSession.h | 1 + 6 files changed, 53 insertions(+), 36 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 9f064640a75..1926976cf04 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -14105,7 +14105,7 @@ void Unit::SetPower(Powers power, int32 val) SetStatInt32Value(UNIT_FIELD_POWER1 + powerIndex, val); - WorldPacket data(SMSG_POWER_UPDATE); + WorldPacket data(SMSG_POWER_UPDATE, 8 + 4 + 1 + 4); data.append(GetPackGUID()); data << uint32(1);//unk data << uint8(powerIndex); diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 0bdff9016f7..faa24abdb65 100755 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -280,18 +280,19 @@ void WorldSession::HandleDestroyItemOpcode(WorldPacket & recv_data) void WorldSession::SendItemDb2Reply(uint32 entry) { WorldPacket data(SMSG_DB_REPLY, 44); - data << uint32(DB2_REPLY_ITEM); ItemTemplate const* proto = sObjectMgr->GetItemTemplate(entry); if (!proto) { data << uint32(-1); // entry - data << uint32(1322512289); // some kind of flags + data << uint32(DB2_REPLY_ITEM); + data << uint32(1322512289); // hotfix date data << uint32(0); // size of next block return; } data << uint32(entry); - data << uint32(1322512290); // flags + data << uint32(DB2_REPLY_ITEM); + data << uint32(1322512290); // hotfix date ByteBuffer buff; buff << uint32(entry); @@ -312,24 +313,28 @@ void WorldSession::SendItemDb2Reply(uint32 entry) void WorldSession::SendItemSparseDb2Reply(uint32 entry) { WorldPacket data(SMSG_DB_REPLY, 526); - data << uint32(DB2_REPLY_SPARSE); ItemTemplate const* proto = sObjectMgr->GetItemTemplate(entry); if (!proto) { data << uint32(-1); // entry - data << uint32(1322512289); // some kind of flags + data << uint32(DB2_REPLY_SPARSE); + data << uint32(1322512289); // hotfix date data << uint32(0); // size of next block return; } data << uint32(entry); - data << uint32(1322512290); // flags + data << uint32(DB2_REPLY_SPARSE); + data << uint32(1322512290); // hotfix date ByteBuffer buff; buff << uint32(entry); buff << uint32(proto->Quality); buff << uint32(proto->Flags); buff << uint32(proto->Flags2); + buff << float(1.0f); + buff << float(1.0f); + buff << uint32(proto->BuyCount); buff << int32(proto->BuyPrice); buff << uint32(proto->SellPrice); buff << uint32(proto->InventoryType); @@ -409,7 +414,6 @@ void WorldSession::SendItemSparseDb2Reply(uint32 entry) buff << int32(proto->RandomProperty); buff << int32(proto->RandomSuffix); buff << uint32(proto->ItemSet); - buff << uint32(proto->MaxDurability); buff << uint32(proto->Area); buff << uint32(proto->Map); diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 1ff10abc36b..7e72dd5e646 100755 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -1764,32 +1764,36 @@ void WorldSession::HandleInstanceLockResponse(WorldPacket& recvPacket) void WorldSession::HandleRequestHotfix(WorldPacket& recvPacket) { - recvPacket.rfinish(); - return; - uint32 type, count; - recvPacket >> type >> count; + recvPacket >> type; + + count = recvPacket.ReadBits(23); - ByteBuffer* guidBytes = new ByteBuffer[count]; + ObjectGuid* guids = new ObjectGuid[count]; for (uint32 i = 0; i < count; ++i) { - guidBytes[i].resize(8); // damn c++ not allowing to use non-default constructor with new[] + guids[i][0] = recvPacket.ReadBit(); + guids[i][4] = recvPacket.ReadBit(); + guids[i][7] = recvPacket.ReadBit(); + guids[i][2] = recvPacket.ReadBit(); + guids[i][5] = recvPacket.ReadBit(); + guids[i][3] = recvPacket.ReadBit(); + guids[i][6] = recvPacket.ReadBit(); + guids[i][1] = recvPacket.ReadBit(); } uint32 entry; - uint64 guid; for (uint32 i = 0; i < count; ++i) { + recvPacket.ReadByteSeq(guids[i][5]); + recvPacket.ReadByteSeq(guids[i][6]); + recvPacket.ReadByteSeq(guids[i][7]); + recvPacket.ReadByteSeq(guids[i][0]); + recvPacket.ReadByteSeq(guids[i][1]); + recvPacket.ReadByteSeq(guids[i][3]); + recvPacket.ReadByteSeq(guids[i][4]); recvPacket >> entry; - //recvPacket.ReadXorByte(mask[i][7], guidBytes[i][2]); - //recvPacket.ReadXorByte(mask[i][4], guidBytes[i][6]); - //recvPacket.ReadXorByte(mask[i][1], guidBytes[i][3]); - //recvPacket.ReadXorByte(mask[i][2], guidBytes[i][0]); - //recvPacket.ReadXorByte(mask[i][3], guidBytes[i][5]); - //recvPacket.ReadXorByte(mask[i][0], guidBytes[i][7]); - //recvPacket.ReadXorByte(mask[i][6], guidBytes[i][1]); - //recvPacket.ReadXorByte(mask[i][5], guidBytes[i][4]); - //guid = BitConverter::ToUInt64(guidBytes[i]); + recvPacket.ReadByteSeq(guids[i][2]); switch (type) { @@ -1804,7 +1808,7 @@ void WorldSession::HandleRequestHotfix(WorldPacket& recvPacket) } } - delete[] guidBytes; + delete[] guids; } void WorldSession::HandleUpdateMissileTrajectory(WorldPacket& recvPacket) @@ -1850,3 +1854,10 @@ void WorldSession::HandleUpdateMissileTrajectory(WorldPacket& recvPacket) HandleMovementOpcodes(recvPacket); } } + void WorldSession::HandleViolenceLevel(WorldPacket& recvPacket) + { + uint8 violenceLevel; + recvPacket >> violenceLevel; + + // do something? + } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index b92ddecc40b..0a6ea133ab6 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -538,7 +538,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_REPOP_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepopRequestOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_REPORT_PVP_AFK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReportPvPAFK ); DEFINE_OPCODE_HANDLER(CMSG_REQUEST_ACCOUNT_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestAccountData ); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_HOTFIX, STATUS_AUTHED, PROCESS_INPLACE, &WorldSession::HandleRequestHotfix ); + DEFINE_OPCODE_HANDLER(CMSG_REQUEST_HOTFIX, STATUS_AUTHED, PROCESS_INPLACE, &WorldSession::HandleRequestHotfix ); //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PARTY_MEMBER_STATS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestPartyMemberStatsOpcode); //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PET_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestPetInfoOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RAID_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestRaidInfoOpcode ); @@ -648,7 +648,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_TELEPORT_TO_UNIT, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_TEST_DROP_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_TEXT_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTextEmoteOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_TIME_SYNC_RESP, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleTimeSyncResp ); + DEFINE_OPCODE_HANDLER(CMSG_TIME_SYNC_RESP, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleTimeSyncResp ); //DEFINE_OPCODE_HANDLER(CMSG_TOGGLE_PVP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTogglePvP ); //DEFINE_OPCODE_HANDLER(CMSG_TOGGLE_XP_GAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_TOTEM_DESTROYED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTotemDestroyed ); @@ -675,6 +675,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_UPDATE_PROJECTILE_POSITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateProjectilePosition ); //DEFINE_OPCODE_HANDLER(CMSG_USE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUseItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_USE_SKILL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_VIOLENCE_LEVEL, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleViolenceLevel ); //DEFINE_OPCODE_HANDLER(CMSG_VOICE_SESSION_ENABLE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleVoiceSessionEnableOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_VOICE_SET_TALKER_MUTED_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_WARDEN_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleWardenDataOpcode ); @@ -779,7 +780,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(MSG_VERIFY_CONNECTIVITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); //DEFINE_OPCODE_HANDLER(MSG_VIEW_PHASE_SHIFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(SMSG_ACCOUNT_DATA_TIMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ACHIEVEMENT_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ACHIEVEMENT_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ACHIEVEMENT_EARNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ACTION_BUTTONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ACTIVATETAXIREPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -787,7 +788,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_ADD_RUNE_POWER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_AFK_MONITOR_INFO_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_AI_REACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ALL_ACHIEVEMENT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ALL_ACHIEVEMENT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_AREA_SPIRIT_HEALER_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_AREA_TRIGGER_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ARENA_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1024,7 +1025,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_INITIAL_SPELLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_INIT_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_INIT_EXTRA_AURA_INFO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_INIT_WORLD_STATES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_INIT_WORLD_STATES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_INSPECT_RESULTS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_INSPECT_TALENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_DIFFICULTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1182,7 +1183,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_PLAY_SPELL_VISUAL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PLAY_TIME_WARNING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PONG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_POWER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_POWER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PRE_RESURRECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PROCRESIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PROFILEDATA_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1255,9 +1256,9 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_SET_FACTION_ATWAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SET_FACTION_STANDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SET_FACTION_VISIBLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SET_FLAT_SPELL_MODIFIER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SET_FLAT_SPELL_MODIFIER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SET_FORCED_REACTIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SET_PCT_SPELL_MODIFIER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SET_PCT_SPELL_MODIFIER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SET_PHASE_SHIFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SET_PROFICIENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1365,7 +1366,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ITEM_ENCHANTMENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_LAST_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_WORLD_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_UPDATE_WORLD_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_USERLIST_ADD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_USERLIST_REMOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_USERLIST_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index d514593603e..cbbfd7323f0 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -995,9 +995,9 @@ enum Opcodes SMSG_SET_FACTION_ATWAR = 0x0000, SMSG_SET_FACTION_STANDING = 0x0126, SMSG_SET_FACTION_VISIBLE = 0x0000, - SMSG_SET_FLAT_SPELL_MODIFIER = 0x0224, + SMSG_SET_FLAT_SPELL_MODIFIER = 0x2834, SMSG_SET_FORCED_REACTIONS = 0x0000, - SMSG_SET_PCT_SPELL_MODIFIER = 0x2834, + SMSG_SET_PCT_SPELL_MODIFIER = 0x0224, SMSG_SET_PHASE_SHIFT = 0x70A0, SMSG_SET_PLAYER_DECLINED_NAMES_RESULT = 0x2B25, SMSG_SET_PLAY_HOVER_ANIM = 0x0000, diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 5d7d6b2d775..baff1a6a690 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -927,6 +927,7 @@ class WorldSession void HandleEnterPlayerVehicle(WorldPacket& data); void HandleUpdateProjectilePosition(WorldPacket& recvPacket); void HandleRequestHotfix(WorldPacket& recvPacket); + void HandleViolenceLevel(WorldPacket& recvPacket); int32 HandleEnableNagleAlgorithm(); private: -- cgit v1.2.3 From 9e6b5f89deb5137673b9af2ec59762cd4e62da85 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 12 Jul 2012 14:16:20 +0200 Subject: Core/PacketIO: Next batch of enabled opcodes --- src/server/game/Server/Protocol/Opcodes.cpp | 12 ++++++------ src/server/game/Server/Protocol/Opcodes.h | 8 ++++---- src/server/game/Server/WorldSession.cpp | 2 +- src/server/game/Server/WorldSocket.cpp | 2 +- src/server/game/Tickets/TicketMgr.cpp | 17 ++++------------- 5 files changed, 16 insertions(+), 25 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 0a6ea133ab6..cda598a5c11 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -272,7 +272,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_GMSURVEY_SUBMIT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMSurveySubmit ); //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_CREATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketCreateOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_DELETETICKET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketDeleteOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_GETTICKET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketGetTicketOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_GETTICKET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketGetTicketOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_SYSTEMSTATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketSystemStatusOpcode); //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_UPDATETEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketUpdateOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GM_CHARACTER_RESTORE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -491,7 +491,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_PET_STOP_ATTACK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetStopAttack ); //DEFINE_OPCODE_HANDLER(CMSG_PET_UNLEARN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_PET_UNLEARN_TALENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_PING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); + DEFINE_OPCODE_HANDLER(CMSG_PING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); //DEFINE_OPCODE_HANDLER(CMSG_PLAYED_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayedTime ); //DEFINE_OPCODE_HANDLER(CMSG_PLAYER_AI_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_PLAYER_LOGIN, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayerLoginOpcode ); @@ -916,7 +916,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_COOLDOWN_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CORPSE_IS_NOT_IN_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CORPSE_MAP_POSITION_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CORPSE_RECLAIM_DELAY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CORPSE_RECLAIM_DELAY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CREATURE_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CRITERIA_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CRITERIA_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -983,7 +983,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_GMRESPONSE_STATUS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_CREATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_DELETETICKET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_GETTICKET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_GETTICKET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_SYSTEMSTATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_UPDATETEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GM_MESSAGECHAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1182,7 +1182,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_PLAY_SPELL_IMPACT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PLAY_SPELL_VISUAL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PLAY_TIME_WARNING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PONG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PONG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_POWER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PRE_RESURRECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PROCRESIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1261,7 +1261,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_SET_PCT_SPELL_MODIFIER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SET_PHASE_SHIFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SET_PROFICIENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SET_PROFICIENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SET_PROJECTILE_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SHOWTAXINODES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SHOW_BANK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index cbbfd7323f0..f1780c15fe9 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -94,7 +94,7 @@ enum Opcodes CMSG_CALENDAR_EVENT_RSVP = 0x0000, CMSG_CALENDAR_EVENT_STATUS = 0x0000, CMSG_CALENDAR_GET_EVENT = 0x0000, - CMSG_CALENDAR_GET_NUM_PENDING = 0x0000, + CMSG_CALENDAR_GET_NUM_PENDING = 0x4D05, CMSG_CALENDAR_GUILD_FILTER = 0x0000, CMSG_CALENDAR_REMOVE_EVENT = 0x0000, CMSG_CALENDAR_UPDATE_EVENT = 0x0000, @@ -176,7 +176,7 @@ enum Opcodes CMSG_GMSURVEY_SUBMIT = 0x0000, CMSG_GMTICKET_CREATE = 0x0000, CMSG_GMTICKET_DELETETICKET = 0x0000, - CMSG_GMTICKET_GETTICKET = 0x0000, + CMSG_GMTICKET_GETTICKET = 0x0326, CMSG_GMTICKET_SYSTEMSTATUS = 0x0000, CMSG_GMTICKET_UPDATETEXT = 0x0636, CMSG_GM_INVIS = 0x0000, @@ -630,7 +630,7 @@ enum Opcodes SMSG_CALENDAR_RAID_LOCKOUT_UPDATED = 0x0000, SMSG_CALENDAR_SEND_CALENDAR = 0x0000, SMSG_CALENDAR_SEND_EVENT = 0x0000, - SMSG_CALENDAR_SEND_NUM_PENDING = 0x0000, + SMSG_CALENDAR_SEND_NUM_PENDING = 0x0C17, SMSG_CALENDAR_UPDATE_INVITE_LIST = 0x0000, SMSG_CAMERA_SHAKE = 0x0000, SMSG_CANCEL_AUTO_REPEAT = 0x6436, @@ -726,7 +726,7 @@ enum Opcodes SMSG_GMRESPONSE_STATUS_UPDATE = 0x0000, SMSG_GMTICKET_CREATE = 0x0000, SMSG_GMTICKET_DELETETICKET = 0x0000, - SMSG_GMTICKET_GETTICKET = 0x0000, + SMSG_GMTICKET_GETTICKET = 0x2C15, SMSG_GMTICKET_SYSTEMSTATUS = 0x0000, SMSG_GMTICKET_UPDATETEXT = 0x0000, SMSG_GM_MESSAGECHAT = 0x6434, diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index 0d961023120..f3ae9009572 100755 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -173,7 +173,7 @@ void WorldSession::SendPacket(WorldPacket const* packet) if (!opcodeTable[packet->GetOpcode()]) { - sLog->outError("Prevented sending disabled opcode %d (hex %#04X)", packet->GetOpcode(), packet->GetOpcode()); + sLog->outError("Prevented sending disabled opcode %d (hex 0x%04X)", packet->GetOpcode(), packet->GetOpcode()); return; } diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index 96aad364f13..78d18fe27f5 100755 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -1096,7 +1096,7 @@ int WorldSocket::HandlePing (WorldPacket& recvPacket) } } - WorldPacket packet (SMSG_PONG, 4); + WorldPacket packet(SMSG_PONG, 4); packet << ping; return SendPacket(packet); } diff --git a/src/server/game/Tickets/TicketMgr.cpp b/src/server/game/Tickets/TicketMgr.cpp index 0ed437461d5..04c2fb5df2a 100755 --- a/src/server/game/Tickets/TicketMgr.cpp +++ b/src/server/game/Tickets/TicketMgr.cpp @@ -356,28 +356,19 @@ void TicketMgr::SendTicket(WorldSession* session, GmTicket* ticket) const status = GMTICKET_STATUS_HASTEXT; } - WorldPacket data(SMSG_GMTICKET_GETTICKET, (4 + 4 + (ticket ? message.length() + 1 + 4 + 4 + 4 + 1 + 1 : 0))); + WorldPacket data(SMSG_GMTICKET_GETTICKET, (4 + (ticket ? 4 + message.length() + 1 + 4 + 4 + 4 + 1 + 1 : 0))); data << uint32(status); // standard 0x0A, 0x06 if text present - data << uint32(ticket ? ticket->GetId() : 0); // ticketID if (ticket) { + data << uint32(ticket->GetId()); // ticketID data << message.c_str(); // ticket text data << uint8(0x7); // ticket category; why is this hardcoded? does it make a diff re: client? // we've got the easy stuff done by now. // Now we need to go through the client logic for displaying various levels of ticket load - if (ticket) - ticket->WritePacket(data); - else - { - // we can't actually get any numbers here... - data << float(0); - data << float(0); - data << float(1); - data << uint8(0); - data << uint8(0); - } + ticket->WritePacket(data); } + session->SendPacket(&data); } -- cgit v1.2.3 From 9cc6ba860c5a39a272fb0e590e7f87bad41590bb Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 12 Jul 2012 14:17:04 +0200 Subject: Core/Items: Updated data sent in SMSG_DB_REPLY --- src/server/game/Globals/ObjectMgr.h | 10 ++++++++++ src/server/game/Handlers/ItemHandler.cpp | 8 ++++---- 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index 742259aa536..b1ee342a0e7 100755 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -1158,6 +1158,16 @@ class ObjectMgr void LoadHotfixData(); HotfixData const& GetHotfixData() const { return _hotfixData; } + time_t GetHotfixDate(uint32 entry, uint32 type) const + { + time_t ret = 0; + for (HotfixData::const_iterator itr = _hotfixData.begin(); itr != _hotfixData.end(); ++itr) + if (itr->Entry == entry && itr->Type == type) + if (itr->Timestamp > ret) + ret = itr->Timestamp; + + return ret; + } private: // first free id for selected id type diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index faa24abdb65..88d2d6afc53 100755 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -285,14 +285,14 @@ void WorldSession::SendItemDb2Reply(uint32 entry) { data << uint32(-1); // entry data << uint32(DB2_REPLY_ITEM); - data << uint32(1322512289); // hotfix date + data << uint32(time(NULL)); // hotfix date data << uint32(0); // size of next block return; } data << uint32(entry); data << uint32(DB2_REPLY_ITEM); - data << uint32(1322512290); // hotfix date + data << uint32(sObjectMgr->GetHotfixDate(entry, DB2_REPLY_ITEM)); ByteBuffer buff; buff << uint32(entry); @@ -318,14 +318,14 @@ void WorldSession::SendItemSparseDb2Reply(uint32 entry) { data << uint32(-1); // entry data << uint32(DB2_REPLY_SPARSE); - data << uint32(1322512289); // hotfix date + data << uint32(time(NULL)); // hotfix date data << uint32(0); // size of next block return; } data << uint32(entry); data << uint32(DB2_REPLY_SPARSE); - data << uint32(1322512290); // hotfix date + data << uint32(sObjectMgr->GetHotfixDate(entry, DB2_REPLY_SPARSE)); ByteBuffer buff; buff << uint32(entry); -- cgit v1.2.3 From 55bd065ddad8dcf50fcda9128b86a18d1a892072 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 12 Jul 2012 21:09:17 +0200 Subject: Core/Achievements: Corrected packet building --- src/server/game/Achievements/AchievementMgr.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index fb24c25fed2..0ff0ace60c3 100755 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -2364,10 +2364,10 @@ void AchievementMgr::SendAllAchievementData(Player* /*receiver*/) const ObjectGuid counter; WorldPacket data(SMSG_ALL_ACHIEVEMENT_DATA, 4 + numAchievements * (4 + 4) + 4 + numCriteria * (4 + 4 + 4 + 4 + 8 + 8)); - data.WriteBits(21, numCriteria); + data.WriteBits(numCriteria, 21); for (CriteriaProgressMap::const_iterator itr = m_criteriaProgress.begin(); itr != m_criteriaProgress.end(); ++itr) { - counter = itr->second.counter; + counter = uint64(itr->second.counter); data.WriteBit(guid[4]); data.WriteBit(counter[3]); @@ -2380,7 +2380,7 @@ void AchievementMgr::SendAllAchievementData(Player* /*receiver*/) const data.WriteBit(guid[2]); data.WriteBit(counter[7]); data.WriteBit(guid[7]); - data.WriteBits(0, 2); + data.WriteBits(0u, 2); data.WriteBit(guid[6]); data.WriteBit(counter[2]); data.WriteBit(counter[1]); @@ -2410,6 +2410,7 @@ void AchievementMgr::SendAllAchievementData(Player* /*receiver*/) const } data.WriteBits(numAchievements, 23); + data.FlushBits(); data.append(criteriaData); for (CompletedAchievementMap::const_iterator itr = m_completedAchievements.begin(); itr != m_completedAchievements.end(); ++itr) @@ -2417,8 +2418,8 @@ void AchievementMgr::SendAllAchievementData(Player* /*receiver*/) const if (!isVisible(*itr)) continue; - data << uint32(secsToTimeBitFields(itr->second.date)); data << uint32(itr->first); + data << uint32(secsToTimeBitFields(itr->second.date)); } if (data.size() > 0x1000) @@ -2512,6 +2513,7 @@ void AchievementMgr::SendAchievementInfo(Player* receiver, uint32 /*achi data.WriteBit(guid[6]); data.WriteBit(guid[5]); + data.FlushBits(); data.append(criteriaData); data.WriteByteSeq(guid[1]); data.WriteByteSeq(guid[6]); -- cgit v1.2.3 From 0b22b329d6d63af4b8ed73e2906c71236349b1bd Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 12 Jul 2012 21:20:34 +0200 Subject: Core/PacketIO: Updated SMSG_UPDATE_OBJECT structure --- src/server/game/Entities/Corpse/Corpse.cpp | 2 +- .../game/Entities/DynamicObject/DynamicObject.cpp | 2 +- src/server/game/Entities/GameObject/GameObject.cpp | 2 +- src/server/game/Entities/Object/Object.cpp | 338 +++++++++++++++------ src/server/game/Entities/Object/ObjectDefines.h | 35 ++- .../game/Entities/Object/Updates/UpdateData.cpp | 4 +- .../game/Entities/Object/Updates/UpdateData.h | 30 +- src/server/game/Entities/Unit/Unit.cpp | 2 +- src/server/game/Handlers/CharacterHandler.cpp | 1 + .../game/Movement/Spline/MovementPacketBuilder.cpp | 110 +++++-- .../game/Movement/Spline/MovementPacketBuilder.h | 3 +- src/server/game/Server/Protocol/Opcodes.cpp | 14 +- src/server/game/Server/WorldSocket.cpp | 1 + 13 files changed, 381 insertions(+), 163 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Corpse/Corpse.cpp b/src/server/game/Entities/Corpse/Corpse.cpp index 714be7d7c9e..ae76863c362 100755 --- a/src/server/game/Entities/Corpse/Corpse.cpp +++ b/src/server/game/Entities/Corpse/Corpse.cpp @@ -32,7 +32,7 @@ Corpse::Corpse(CorpseType type) : WorldObject(type != CORPSE_BONES) m_objectType |= TYPEMASK_CORPSE; m_objectTypeId = TYPEID_CORPSE; - m_updateFlag = (UPDATEFLAG_STATIONARY_POSITION | UPDATEFLAG_POSITION); + m_updateFlag = UPDATEFLAG_STATIONARY_POSITION; m_valuesCount = CORPSE_END; diff --git a/src/server/game/Entities/DynamicObject/DynamicObject.cpp b/src/server/game/Entities/DynamicObject/DynamicObject.cpp index 8dcafa3b2ae..23257b34758 100755 --- a/src/server/game/Entities/DynamicObject/DynamicObject.cpp +++ b/src/server/game/Entities/DynamicObject/DynamicObject.cpp @@ -33,7 +33,7 @@ DynamicObject::DynamicObject(bool isWorldObject) : WorldObject(isWorldObject), m_objectType |= TYPEMASK_DYNAMICOBJECT; m_objectTypeId = TYPEID_DYNAMICOBJECT; - m_updateFlag = (UPDATEFLAG_STATIONARY_POSITION | UPDATEFLAG_POSITION); + m_updateFlag = UPDATEFLAG_STATIONARY_POSITION; m_valuesCount = DYNAMICOBJECT_END; } diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 2a74d262daf..d20102e3081 100755 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -38,7 +38,7 @@ GameObject::GameObject() : WorldObject(false), m_model(NULL), m_goValue(new Game m_objectType |= TYPEMASK_GAMEOBJECT; m_objectTypeId = TYPEID_GAMEOBJECT; - m_updateFlag = (UPDATEFLAG_STATIONARY_POSITION | UPDATEFLAG_POSITION | UPDATEFLAG_ROTATION); + m_updateFlag = (UPDATEFLAG_STATIONARY_POSITION | UPDATEFLAG_ROTATION); m_valuesCount = GAMEOBJECT_END; m_respawnTime = 0; diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index d21ae63be45..f6c350ecb87 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -295,119 +295,281 @@ void Object::DestroyForPlayer(Player* target, bool onDeath) const void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const { - *data << uint16(flags); // update flags + uint32 unkLoopCounter = 0; + // Bit content + data->WriteBit(0); + data->WriteBit(0); + data->WriteBit(flags & UPDATEFLAG_ROTATION); + data->WriteBit(flags & UPDATEFLAG_ANIMKITS); + data->WriteBit(flags & UPDATEFLAG_HAS_TARGET); + data->WriteBit(flags & UPDATEFLAG_SELF); + data->WriteBit(flags & UPDATEFLAG_VEHICLE); + data->WriteBit(flags & UPDATEFLAG_LIVING); + data->WriteBits(unkLoopCounter, 24); + data->WriteBit(0); + data->WriteBit(flags & UPDATEFLAG_GO_TRANSPORT_POSITION); + data->WriteBit(flags & UPDATEFLAG_STATIONARY_POSITION); + data->WriteBit(0); + data->WriteBit(0); + data->WriteBit(flags & UPDATEFLAG_TRANSPORT); - // 0x20 if (flags & UPDATEFLAG_LIVING) { Unit const* self = ToUnit(); - self->BuildMovementPacket(data); + ObjectGuid guid = GetGUID(); + uint32 movementFlags = self->m_movementInfo.GetMovementFlags(); + uint16 movementFlagsExtra = self->m_movementInfo.GetExtraMovementFlags(); + + data->WriteBit(!movementFlags); + data->WriteBit(0); // Has Orientation + data->WriteBit(guid[7]); + data->WriteBit(guid[3]); + data->WriteBit(guid[2]); + if (movementFlags) + data->WriteBits(movementFlags, 30); + + data->WriteBit(0); + data->WriteBit(!((movementFlags & (MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING)) || + (movementFlagsExtra & MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING))); // Has pitch + data->WriteBit(movementFlags & MOVEMENTFLAG_SPLINE_ENABLED); // Has spline data + data->WriteBit(movementFlagsExtra & MOVEMENTFLAG2_INTERPOLATED_TURNING);// Has fall data + data->WriteBit(!(movementFlags & MOVEMENTFLAG_SPLINE_ELEVATION)); // Has spline elevation + data->WriteBit(guid[5]); + data->WriteBit(movementFlags & MOVEMENTFLAG_ONTRANSPORT); // Has transport data + data->WriteBit(0); // Is missing time + if (movementFlags & MOVEMENTFLAG_ONTRANSPORT) + { + ObjectGuid transGuid = self->m_movementInfo.t_guid; + + data->WriteBit(transGuid[1]); + data->WriteBit(movementFlagsExtra & MOVEMENTFLAG2_INTERPOLATED_MOVEMENT); + data->WriteBit(transGuid[4]); + data->WriteBit(transGuid[0]); + data->WriteBit(transGuid[6]); + data->WriteBit(0); // Has transport time 3 + data->WriteBit(transGuid[7]); + data->WriteBit(transGuid[5]); + data->WriteBit(transGuid[3]); + data->WriteBit(transGuid[2]); + } - *data << self->GetSpeed(MOVE_WALK); - *data << self->GetSpeed(MOVE_RUN); - *data << self->GetSpeed(MOVE_RUN_BACK); - *data << self->GetSpeed(MOVE_SWIM); - *data << self->GetSpeed(MOVE_SWIM_BACK); - *data << self->GetSpeed(MOVE_FLIGHT); - *data << self->GetSpeed(MOVE_FLIGHT_BACK); - *data << self->GetSpeed(MOVE_TURN_RATE); - *data << self->GetSpeed(MOVE_PITCH_RATE); + data->WriteBit(guid[4]); + if (movementFlags & MOVEMENTFLAG_SPLINE_ENABLED) + { + data->WriteBit(1); // Has extended spline data + Movement::PacketBuilder::WriteCreateBits(*self->movespline, *data); + } + + data->WriteBit(guid[6]); + if (movementFlagsExtra & MOVEMENTFLAG2_INTERPOLATED_TURNING) + data->WriteBit(movementFlags & MOVEMENTFLAG_FALLING); - // 0x08000000 - if (self->m_movementInfo.HasMovementFlag(MOVEMENTFLAG_SPLINE_ENABLED)) - Movement::PacketBuilder::WriteCreate(*self->movespline, *data); + data->WriteBit(guid[0]); + data->WriteBit(guid[1]); + data->WriteBit(0); + data->WriteBit(!movementFlagsExtra); + if (movementFlagsExtra) + data->WriteBits(movementFlagsExtra, 12); } - else + + if (flags & UPDATEFLAG_GO_TRANSPORT_POSITION) { - WorldObject* worldObj = ((WorldObject*)this); - if (flags & UPDATEFLAG_POSITION) - { - Transport* transport = worldObj->GetTransport(); - if (transport) - data->append(transport->GetPackGUID()); - else - *data << uint8(0); - - *data << worldObj->GetPositionX(); - *data << worldObj->GetPositionY(); - *data << worldObj->GetPositionZ(); - *data << worldObj->GetOrientation(); - if (isType(TYPEMASK_UNIT)) - *data << ((Unit*)this)->GetPositionZMinusOffset(); - else - *data << worldObj->GetPositionZ(); + WorldObject const* self = static_cast(this); + ObjectGuid transGuid = self->m_movementInfo.t_guid; + data->WriteBit(transGuid[5]); + data->WriteBit(0); // Has GO transport time 3 + data->WriteBit(transGuid[0]); + data->WriteBit(transGuid[3]); + data->WriteBit(transGuid[6]); + data->WriteBit(transGuid[1]); + data->WriteBit(transGuid[4]); + data->WriteBit(transGuid[2]); + data->WriteBit(0); // Has GO transport time 2 + data->WriteBit(transGuid[7]); + } - if (transport) - { - *data << worldObj->GetTransOffsetX(); - *data << worldObj->GetTransOffsetY(); - *data << worldObj->GetTransOffsetZ(); - } - else - { - *data << worldObj->GetPositionX(); - *data << worldObj->GetPositionY(); - if (isType(TYPEMASK_UNIT)) - *data << ((Unit*)this)->GetPositionZMinusOffset(); - else - *data << worldObj->GetPositionZ(); - } + if (flags & UPDATEFLAG_HAS_TARGET) + { + ObjectGuid victimGuid = ToUnit()->getVictim()->GetGUID(); // checked in BuildCreateUpdateBlockForPlayer + data->WriteBit(victimGuid[2]); + data->WriteBit(victimGuid[7]); + data->WriteBit(victimGuid[0]); + data->WriteBit(victimGuid[4]); + data->WriteBit(victimGuid[5]); + data->WriteBit(victimGuid[6]); + data->WriteBit(victimGuid[1]); + data->WriteBit(victimGuid[3]); + } - *data << worldObj->GetOrientation(); + if (flags & UPDATEFLAG_ANIMKITS) + { + data->WriteBit(1); // Missing AnimKit1 + data->WriteBit(1); // Missing AnimKit2 + data->WriteBit(1); // Missing AnimKit3 + } - if (GetTypeId() == TYPEID_CORPSE) - *data << worldObj->GetOrientation(); - else - *data << float(0); - } - else + data->FlushBits(); + + // Data + for (uint32 i = 0; i < unkLoopCounter; ++i) + *data << uint32(0); + + if (flags & UPDATEFLAG_LIVING) + { + Unit const* self = ToUnit(); + ObjectGuid guid = GetGUID(); + uint32 movementFlags = self->m_movementInfo.GetMovementFlags(); + uint16 movementFlagsExtra = self->m_movementInfo.GetExtraMovementFlags(); + + data->WriteByteSeq(guid[4]); + *data << self->GetSpeed(MOVE_RUN_BACK); + if (movementFlagsExtra & MOVEMENTFLAG2_INTERPOLATED_TURNING) { - // 0x40 - if (flags & UPDATEFLAG_STATIONARY_POSITION) + if (movementFlags & MOVEMENTFLAG_FALLING) { - *data << worldObj->GetPositionX(); - *data << worldObj->GetPositionY(); - if (isType(TYPEMASK_UNIT)) - *data << ((Unit*)this)->GetPositionZMinusOffset(); - else - *data << worldObj->GetPositionZ(); - *data << worldObj->GetOrientation(); + *data << float(self->m_movementInfo.j_cosAngle); + *data << float(self->m_movementInfo.j_xyspeed); + *data << float(self->m_movementInfo.j_sinAngle); } + + *data << uint32(self->m_movementInfo.fallTime); + *data << float(self->m_movementInfo.j_zspeed); } - } - // 0x4 - if (flags & UPDATEFLAG_HAS_TARGET) - { - if (Unit* victim = this->ToUnit()->getVictim()) - data->append(victim->GetPackGUID()); - else - *data << uint8(0); - } + *data << self->GetSpeed(MOVE_SWIM_BACK); + if (movementFlags & MOVEMENTFLAG_SPLINE_ELEVATION) + *data << float(self->m_movementInfo.splineElevation); - // 0x2 - if (flags & UPDATEFLAG_TRANSPORT) - *data << uint32(getMSTime()); // Unknown - getMSTime is wrong. + if (movementFlags & MOVEMENTFLAG_SPLINE_ENABLED) + Movement::PacketBuilder::WriteCreateData(*self->movespline, *data); + + *data << float(self->GetPositionZMinusOffset()); + data->WriteByteSeq(guid[5]); + if (movementFlags & MOVEMENTFLAG_ONTRANSPORT) + { + ObjectGuid transGuid = self->m_movementInfo.t_guid; + + data->WriteByteSeq(transGuid[5]); + data->WriteByteSeq(transGuid[7]); + *data << uint32(self->GetTransTime()); + *data << float(self->GetTransOffsetO()); + if (movementFlagsExtra & MOVEMENTFLAG2_INTERPOLATED_MOVEMENT) + *data << uint32(0); + + *data << float(self->GetTransOffsetY()); + *data << float(self->GetTransOffsetX()); + data->WriteByteSeq(transGuid[3]); + *data << float(self->GetTransOffsetZ()); + data->WriteByteSeq(transGuid[0]); + //if (hasTransportTime3) + // *data << uint32(0); + + *data << int8(self->GetTransSeat()); + data->WriteByteSeq(transGuid[1]); + data->WriteByteSeq(transGuid[6]); + data->WriteByteSeq(transGuid[2]); + data->WriteByteSeq(transGuid[4]); + } + + *data << float(self->GetPositionX()); + *data << self->GetSpeed(MOVE_PITCH_RATE); + data->WriteByteSeq(guid[0]); + data->WriteByteSeq(guid[3]); + *data << self->GetSpeed(MOVE_SWIM); + *data << float(self->GetPositionX()); + data->WriteByteSeq(guid[7]); + data->WriteByteSeq(guid[1]); + data->WriteByteSeq(guid[2]); + *data << self->GetSpeed(MOVE_WALK); + + //if (true) // Has time, controlled by bit just after HasTransport + *data << uint32(getMSTime()); + + *data << self->GetSpeed(MOVE_FLIGHT_BACK); + data->WriteByteSeq(guid[6]); + *data << self->GetSpeed(MOVE_TURN_RATE); + *data << float(self->GetOrientation()); + *data << self->GetSpeed(MOVE_RUN); + if ((movementFlags & (MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING)) || + (movementFlagsExtra & MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING)) + *data << float(self->m_movementInfo.pitch); + + *data << self->GetSpeed(MOVE_FLIGHT); + } - // 0x80 if (flags & UPDATEFLAG_VEHICLE) { - // TODO: Allow players to aquire this updateflag. - *data << uint32(((Unit*)this)->GetVehicleKit()->GetVehicleInfo()->m_ID); - *data << float(((Creature*)this)->GetOrientation()); + Unit const* self = ToUnit(); + *data << float(self->GetOrientation()); + *data << uint32(self->GetVehicleKit()->GetVehicleInfo()->m_ID); } - // 0x800 - AnimKits - if (flags & UPDATEFLAG_ANIMKITS) - *data << uint16(0) << uint16(0) << uint16(0); //unk + if (flags & UPDATEFLAG_GO_TRANSPORT_POSITION) + { + WorldObject const* self = static_cast(this); + ObjectGuid transGuid = self->m_movementInfo.t_guid; + + data->WriteBit(transGuid[0]); + data->WriteBit(transGuid[5]); + //if (hasTransportTime3) + // *data << uint32(0); + + data->WriteBit(transGuid[3]); + *data << float(self->GetTransOffsetX()); + data->WriteBit(transGuid[4]); + data->WriteBit(transGuid[6]); + data->WriteBit(transGuid[1]); + *data << uint32(self->GetTransTime()); + *data << float(self->GetTransOffsetY()); + data->WriteBit(transGuid[2]); + data->WriteBit(transGuid[7]); + *data << float(self->GetTransOffsetZ()); + *data << int8(self->GetTransSeat()); + *data << float(self->GetTransOffsetO()); + //if (hasTransportTime2) + // *data << uint32(0); + } - // 0x200 if (flags & UPDATEFLAG_ROTATION) - *data << int64(((GameObject*)this)->GetRotation()); + *data << uint64(ToGameObject()->GetRotation()); - // 0x1000 - if (flags & UPDATEFLAG_UNK3) - *data << uint8(0);//unk counter to read uint32 values + if (flags & UPDATEFLAG_STATIONARY_POSITION) + { + WorldObject const* self = static_cast(this); + *data << float(self->GetOrientation()); + *data << float(self->GetPositionX()); + *data << float(self->GetPositionY()); + if (Unit const* unit = ToUnit()) + *data << float(unit->GetPositionZMinusOffset()); + else + *data << float(self->GetPositionZ()); + } + + if (flags & UPDATEFLAG_HAS_TARGET) + { + ObjectGuid victimGuid = ToUnit()->getVictim()->GetGUID(); // checked in BuildCreateUpdateBlockForPlayer + data->WriteByteSeq(victimGuid[0]); + data->WriteByteSeq(victimGuid[3]); + data->WriteByteSeq(victimGuid[5]); + data->WriteByteSeq(victimGuid[7]); + data->WriteByteSeq(victimGuid[6]); + data->WriteByteSeq(victimGuid[2]); + data->WriteByteSeq(victimGuid[1]); + data->WriteByteSeq(victimGuid[4]); + } + + //if (flags & UPDATEFLAG_ANIMKITS) + //{ + // if (hasAnimKit1) + // *data << uint16(animKit1); + // if (hasAnimKit2) + // *data << uint16(animKit2); + // if (hasAnimKit3) + // *data << uint16(animKit3); + //} + + if (flags & UPDATEFLAG_TRANSPORT) + *data << uint32(getMSTime()); // Unknown - getMSTime is wrong. } void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask* updateMask, Player* target) const diff --git a/src/server/game/Entities/Object/ObjectDefines.h b/src/server/game/Entities/Object/ObjectDefines.h index a9d14b85a59..ef1eeb237b7 100755 --- a/src/server/game/Entities/Object/ObjectDefines.h +++ b/src/server/game/Entities/Object/ObjectDefines.h @@ -33,18 +33,18 @@ enum HighGuid { - HIGHGUID_ITEM = 0x4000, // blizz 4000 - HIGHGUID_CONTAINER = 0x4000, // blizz 4000 - HIGHGUID_PLAYER = 0x0000, // blizz 0000 - HIGHGUID_GAMEOBJECT = 0xF110, // blizz F110 - HIGHGUID_TRANSPORT = 0xF120, // blizz F120 (for GAMEOBJECT_TYPE_TRANSPORT) - HIGHGUID_UNIT = 0xF130, // blizz F130 - HIGHGUID_PET = 0xF140, // blizz F140 - HIGHGUID_VEHICLE = 0xF150, // blizz F550 - HIGHGUID_DYNAMICOBJECT = 0xF100, // blizz F100 + HIGHGUID_ITEM = 0x400, // blizz 4000 + HIGHGUID_CONTAINER = 0x400, // blizz 4000 + HIGHGUID_PLAYER = 0x000, // blizz 0000 + HIGHGUID_GAMEOBJECT = 0xF11, // blizz F110 + HIGHGUID_TRANSPORT = 0xF12, // blizz F120 (for GAMEOBJECT_TYPE_TRANSPORT) + HIGHGUID_UNIT = 0xF13, // blizz F130 + HIGHGUID_PET = 0xF14, // blizz F140 + HIGHGUID_VEHICLE = 0xF15, // blizz F550 + HIGHGUID_DYNAMICOBJECT = 0xF10, // blizz F100 HIGHGUID_CORPSE = 0xF101, // blizz F100 - HIGHGUID_MO_TRANSPORT = 0x1FC0, // blizz 1FC0 (for GAMEOBJECT_TYPE_MO_TRANSPORT) - HIGHGUID_GROUP = 0x1F50, + HIGHGUID_MO_TRANSPORT = 0x1FC, // blizz 1FC0 (for GAMEOBJECT_TYPE_MO_TRANSPORT) + HIGHGUID_GROUP = 0x1F5, HIGHGUID_GUILD = 0x1FF5, // new 4.x }; @@ -70,15 +70,20 @@ enum HighGuid // l - OBJECT_FIELD_GUID // e - OBJECT_FIELD_ENTRY for GO (except GAMEOBJECT_TYPE_MO_TRANSPORT) and creatures or UNIT_FIELD_PETNUMBER for pets // h - OBJECT_FIELD_GUID + 1 -#define MAKE_NEW_GUID(l, e, h) uint64(uint64(l) | (uint64(e) << 24) | (uint64(h) << 48)) +#define MAKE_NEW_GUID(l, e, h) uint64(uint64(l) | (uint64(e) << 32) | (uint64(h) << ((h == HIGHGUID_GUILD || h == HIGHGUID_CORPSE) ? 48 : 52))) -#define GUID_HIPART(x) (uint32)((uint64(x) >> 48) & 0x0000FFFF) +//#define GUID_HIPART(x) (uint32)((uint64(x) >> 52)) & 0x0000FFFF) +inline uint32 GUID_HIPART(uint64 guid) +{ + uint32 t = ((uint64(guid) >> 48) & 0x0000FFFF); + return (t == HIGHGUID_GUILD || t == HIGHGUID_CORPSE) ? t : ((uint32(t) >> 4) & 0x00000FFF); +} // We have different low and middle part size for different guid types #define _GUID_ENPART_2(x) 0 -#define _GUID_ENPART_3(x) (uint32)((uint64(x) >> 24) & UI64LIT(0x0000000000FFFFFF)) +#define _GUID_ENPART_3(x) (uint32)((uint64(x) >> 32) & UI64LIT(0x0000000000FFFFFF)) #define _GUID_LOPART_2(x) (uint32)(uint64(x) & UI64LIT(0x00000000FFFFFFFF)) -#define _GUID_LOPART_3(x) (uint32)(uint64(x) & UI64LIT(0x0000000000FFFFFF)) +#define _GUID_LOPART_3(x) (uint32)(uint64(x) & UI64LIT(0x00000000FFFFFFFF)) inline bool IsGuidHaveEnPart(uint64 guid) { diff --git a/src/server/game/Entities/Object/Updates/UpdateData.cpp b/src/server/game/Entities/Object/Updates/UpdateData.cpp index f9536122f73..1a1b0984f03 100755 --- a/src/server/game/Entities/Object/Updates/UpdateData.cpp +++ b/src/server/game/Entities/Object/Updates/UpdateData.cpp @@ -51,7 +51,7 @@ bool UpdateData::BuildPacket(WorldPacket* packet) packet->Initialize(SMSG_UPDATE_OBJECT, 2 + 4 + (m_outOfRangeGUIDs.empty() ? 0 : 1 + 4 + 9 * m_outOfRangeGUIDs.size()) + m_data.wpos()); *packet << uint16(m_map); - *packet << uint32(m_blockCount); + *packet << uint32(m_blockCount + (m_outOfRangeGUIDs.empty() ? 0 : 1)); if (!m_outOfRangeGUIDs.empty()) { @@ -59,9 +59,7 @@ bool UpdateData::BuildPacket(WorldPacket* packet) *packet << uint32(m_outOfRangeGUIDs.size()); for (std::set::const_iterator i = m_outOfRangeGUIDs.begin(); i != m_outOfRangeGUIDs.end(); ++i) - { packet->appendPackGUID(*i); - } } packet->append(m_data); diff --git a/src/server/game/Entities/Object/Updates/UpdateData.h b/src/server/game/Entities/Object/Updates/UpdateData.h index 11d54ac488e..27a42be5c2d 100755 --- a/src/server/game/Entities/Object/Updates/UpdateData.h +++ b/src/server/game/Entities/Object/Updates/UpdateData.h @@ -32,21 +32,21 @@ enum OBJECT_UPDATE_TYPE enum OBJECT_UPDATE_FLAGS { - UPDATEFLAG_NONE = 0x0000, - UPDATEFLAG_SELF = 0x0001, - UPDATEFLAG_TRANSPORT = 0x0002, - UPDATEFLAG_HAS_TARGET = 0x0004, - UPDATEFLAG_UNKNOWN = 0x0008, - UPDATEFLAG_LOWGUID = 0x0010, - UPDATEFLAG_LIVING = 0x0020, - UPDATEFLAG_STATIONARY_POSITION = 0x0040, - UPDATEFLAG_VEHICLE = 0x0080, - UPDATEFLAG_POSITION = 0x0100, - UPDATEFLAG_ROTATION = 0x0200, - UPDATEFLAG_UNK3 = 0x0400, - UPDATEFLAG_ANIMKITS = 0x0800, - UPDATEFLAG_UNK5 = 0x1000, - UPDATEFLAG_UNK6 = 0x2000 + UPDATEFLAG_NONE = 0x0000, + UPDATEFLAG_SELF = 0x0001, + UPDATEFLAG_TRANSPORT = 0x0002, + UPDATEFLAG_HAS_TARGET = 0x0004, + UPDATEFLAG_UNKNOWN = 0x0008, + UPDATEFLAG_LOWGUID = 0x0010, + UPDATEFLAG_LIVING = 0x0020, + UPDATEFLAG_STATIONARY_POSITION = 0x0040, + UPDATEFLAG_VEHICLE = 0x0080, + UPDATEFLAG_GO_TRANSPORT_POSITION = 0x0100, + UPDATEFLAG_ROTATION = 0x0200, + UPDATEFLAG_UNK3 = 0x0400, + UPDATEFLAG_ANIMKITS = 0x0800, + UPDATEFLAG_UNK5 = 0x1000, + UPDATEFLAG_UNK6 = 0x2000, }; class UpdateData diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 1926976cf04..743431849ab 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -164,7 +164,7 @@ m_HostileRefManager(this) m_objectType |= TYPEMASK_UNIT; m_objectTypeId = TYPEID_UNIT; - m_updateFlag = (UPDATEFLAG_LIVING | UPDATEFLAG_STATIONARY_POSITION); + m_updateFlag = UPDATEFLAG_LIVING; m_attackTimer[BASE_ATTACK] = 0; m_attackTimer[OFF_ATTACK] = 0; diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 7800a06024f..f1e33aa708b 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -945,6 +945,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder) data.Initialize(SMSG_HOTFIX_INFO); HotfixData const& hotfix = sObjectMgr->GetHotfixData(); data.WriteBits(hotfix.size(), 22); + data.FlushBits(); for (uint32 i = 0; i < hotfix.size(); ++i) { data << uint32(hotfix[i].Type); diff --git a/src/server/game/Movement/Spline/MovementPacketBuilder.cpp b/src/server/game/Movement/Spline/MovementPacketBuilder.cpp index 8aef671d2d1..2cf7bd6e2bb 100644 --- a/src/server/game/Movement/Spline/MovementPacketBuilder.cpp +++ b/src/server/game/Movement/Spline/MovementPacketBuilder.cpp @@ -139,44 +139,94 @@ namespace Movement WriteLinearPath(spline, data); } - void PacketBuilder::WriteCreate(const MoveSpline& move_spline, ByteBuffer& data) + void PacketBuilder::WriteCreateBits(MoveSpline const& moveSpline, ByteBuffer& data) { - //WriteClientStatus(mov,data); - //data.append(&mov.m_float_values[SpeedWalk], SpeedMaxCount); - //if (mov.SplineEnabled()) + data.WriteBits(uint8(moveSpline.spline.mode()), 2); + data.WriteBit(moveSpline.splineflags & (MoveSplineFlag::Parabolic | MoveSplineFlag::Animation)); + data.WriteBits(moveSpline.getPath().size(), 22); + switch (moveSpline.splineflags & MoveSplineFlag::Mask_Final_Facing) { - MoveSplineFlag splineFlags = move_spline.splineflags; - - data << splineFlags.raw(); - - if (splineFlags.final_angle) - { - data << move_spline.facing.angle; - } - else if (splineFlags.final_target) - { - data << move_spline.facing.target; - } - else if (splineFlags.final_point) + case MoveSplineFlag::Final_Target: { - data << move_spline.facing.f.x << move_spline.facing.f.y << move_spline.facing.f.z; + ObjectGuid targetGuid = moveSpline.facing.target; + data.WriteBits(2, 2); + data.WriteBit(targetGuid[4]); + data.WriteBit(targetGuid[3]); + data.WriteBit(targetGuid[7]); + data.WriteBit(targetGuid[2]); + data.WriteBit(targetGuid[6]); + data.WriteBit(targetGuid[1]); + data.WriteBit(targetGuid[0]); + data.WriteBit(targetGuid[5]); + break; } + case MoveSplineFlag::Final_Angle: + data.WriteBits(0, 2); + break; + case MoveSplineFlag::Final_Point: + data.WriteBits(1, 2); + break; + default: + data.WriteBits(3, 2); + break; + } + + data.WriteBit((moveSpline.splineflags & MoveSplineFlag::Parabolic) && moveSpline.effect_start_time < moveSpline.Duration()); + data.WriteBits(moveSpline.splineflags.raw(), 25); + } + + void PacketBuilder::WriteCreateData(MoveSpline const& moveSpline, ByteBuffer& data) + { + MoveSplineFlag splineFlags = moveSpline.splineflags; + + if ((splineFlags & MoveSplineFlag::Parabolic) && moveSpline.effect_start_time < moveSpline.Duration()) + data << moveSpline.vertical_acceleration; // added in 3.1 + + data << moveSpline.timePassed(); + + if (splineFlags.final_angle) + data << moveSpline.facing.angle; + else if (splineFlags.final_target) + { + ObjectGuid facingGuid = moveSpline.facing.target; + data.WriteByteSeq(facingGuid[5]); + data.WriteByteSeq(facingGuid[3]); + data.WriteByteSeq(facingGuid[7]); + data.WriteByteSeq(facingGuid[1]); + data.WriteByteSeq(facingGuid[6]); + data.WriteByteSeq(facingGuid[5]); + data.WriteByteSeq(facingGuid[2]); + data.WriteByteSeq(facingGuid[0]); + } + + uint32 nodes = moveSpline.getPath().size(); + for (uint32 i = 0; i < nodes; ++i) + { + data << float(moveSpline.getPath()[i].z); + data << float(moveSpline.getPath()[i].x); + data << float(moveSpline.getPath()[i].y); + } - data << move_spline.timePassed(); - data << move_spline.Duration(); - data << move_spline.GetId(); + if (splineFlags.final_point) + data << moveSpline.facing.f.x << moveSpline.facing.f.z << moveSpline.facing.f.y; - data << float(1.f); // splineInfo.duration_mod; added in 3.1 - data << float(1.f); // splineInfo.duration_mod_next; added in 3.1 + data << float(1.f); // splineInfo.duration_mod_next; added in 3.1 + data << moveSpline.Duration(); + if (splineFlags & (MoveSplineFlag::Parabolic | MoveSplineFlag::Animation)) + data << moveSpline.effect_start_time; // added in 3.1 - data << move_spline.vertical_acceleration; // added in 3.1 - data << move_spline.effect_start_time; // added in 3.1 + data << float(1.f); // splineInfo.duration_mod; added in 3.1 - uint32 nodes = move_spline.getPath().size(); - data << nodes; - data.append(&move_spline.getPath()[0], nodes); - data << uint8(move_spline.spline.mode()); // added in 3.1 - data << (move_spline.isCyclic() ? Vector3::zero() : move_spline.FinalDestination()); + if (!moveSpline.isCyclic()) + { + Vector3 dest = moveSpline.FinalDestination(); + data << float(dest.z); + data << float(dest.x); + data << float(dest.y); } + else + data << Vector3::zero(); + + data << moveSpline.GetId(); } } diff --git a/src/server/game/Movement/Spline/MovementPacketBuilder.h b/src/server/game/Movement/Spline/MovementPacketBuilder.h index 92a414e9b3b..a6e4e4d5d04 100644 --- a/src/server/game/Movement/Spline/MovementPacketBuilder.h +++ b/src/server/game/Movement/Spline/MovementPacketBuilder.h @@ -31,7 +31,8 @@ namespace Movement public: static void WriteMonsterMove(const MoveSpline& mov, WorldPacket& data); - static void WriteCreate(const MoveSpline& mov, ByteBuffer& data); + static void WriteCreateBits(MoveSpline const& moveSpline, ByteBuffer& data); + static void WriteCreateData(MoveSpline const& moveSpline, ByteBuffer& data); }; } #endif // TRINITYSERVER_PACKET_BUILDER_H diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index cda598a5c11..328311f99ee 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -210,7 +210,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_CREATEGAMEOBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CREATEITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CREATEMONSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CREATURE_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleCreatureQueryOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_CREATURE_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleCreatureQueryOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_DANCE_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_DBLOOKUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_ACTIONS_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -257,7 +257,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_FORCE_MOVE_ROOT_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveRootAck ); //DEFINE_OPCODE_HANDLER(CMSG_FORCE_MOVE_UNROOT_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveUnRootAck ); //DEFINE_OPCODE_HANDLER(CMSG_FORCE_SAY_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJECT_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleGameObjectQueryOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJECT_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleGameObjectQueryOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJ_REPORT_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGameobjectReportUse ); //DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJ_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGameObjectUseOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GAMESPEED_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -384,7 +384,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_LOAD_SCREEN, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleLoadScreenOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LOGOUT_CANCEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLogoutCancelOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LOGOUT_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLogoutRequestOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_LOG_DISCONNECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); + DEFINE_OPCODE_HANDLER(CMSG_LOG_DISCONNECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); //DEFINE_OPCODE_HANDLER(CMSG_LOOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LOOT_MASTER_GIVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMasterGiveOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LOOT_METHOD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMethodOpcode ); @@ -777,7 +777,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(MSG_SET_RAID_DIFFICULTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetRaidDifficultyOpcode ); //DEFINE_OPCODE_HANDLER(MSG_TABARDVENDOR_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTabardVendorActivateOpcode); //DEFINE_OPCODE_HANDLER(MSG_TALENT_WIPE_CONFIRM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTalentWipeConfirmOpcode ); - //DEFINE_OPCODE_HANDLER(MSG_VERIFY_CONNECTIVITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); + DEFINE_OPCODE_HANDLER(MSG_VERIFY_CONNECTIVITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); //DEFINE_OPCODE_HANDLER(MSG_VIEW_PHASE_SHIFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(SMSG_ACCOUNT_DATA_TIMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ACHIEVEMENT_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -917,7 +917,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_CORPSE_IS_NOT_IN_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CORPSE_MAP_POSITION_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CORPSE_RECLAIM_DELAY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CREATURE_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CREATURE_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CRITERIA_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CRITERIA_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CROSSED_INEBRIATION_THRESHOLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -970,7 +970,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_CUSTOM_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_DESPAWN_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_PAGETEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_RESET_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GAMESPEED_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GAMETIMEBIAS_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1365,7 +1365,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_INSTANCE_OWNERSHIP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ITEM_ENCHANTMENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_LAST_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_UPDATE_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_WORLD_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_USERLIST_ADD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_USERLIST_REMOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index 78d18fe27f5..e1d3d2c1412 100755 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -690,6 +690,7 @@ int WorldSocket::ProcessIncoming(WorldPacket* new_pct) sScriptMgr->OnPacketReceive(this, WorldPacket(*new_pct)); return 0; case CMSG_LOG_DISCONNECT: + new_pct->rfinish(); // contains uint32 disconnectReason; sLog->outStaticDebug("CMSG_LOG_DISCONNECT , size: " UI64FMTD, uint64(new_pct->size())); sScriptMgr->OnPacketReceive(this, WorldPacket(*new_pct)); return 0; -- cgit v1.2.3 From dfe7238d89a1b3852041e882a67a094ab4b30175 Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 13 Jul 2012 11:59:27 +0200 Subject: Core/PacketIO: Typo fix, thanks Zakamurite for noticing --- src/server/game/Entities/Object/Object.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index f6c350ecb87..d9d8c3c461a 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -476,7 +476,7 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const data->WriteByteSeq(guid[0]); data->WriteByteSeq(guid[3]); *data << self->GetSpeed(MOVE_SWIM); - *data << float(self->GetPositionX()); + *data << float(self->GetPositionY()); data->WriteByteSeq(guid[7]); data->WriteByteSeq(guid[1]); data->WriteByteSeq(guid[2]); -- cgit v1.2.3 From 555855c83abac9cf67609ebf4f74f721e283a0df Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 13 Jul 2012 23:13:29 +0200 Subject: Core/Movement: Update spline flags and enabled creature movement --- src/server/game/Movement/Spline/MoveSplineFlag.h | 132 +++++++++++---------- .../game/Movement/Spline/MovementPacketBuilder.cpp | 2 +- src/server/game/Server/Protocol/Opcodes.cpp | 4 +- src/server/game/Server/Protocol/Opcodes.h | 2 +- 4 files changed, 74 insertions(+), 66 deletions(-) (limited to 'src') diff --git a/src/server/game/Movement/Spline/MoveSplineFlag.h b/src/server/game/Movement/Spline/MoveSplineFlag.h index cfc2fdee450..b011efac5be 100644 --- a/src/server/game/Movement/Spline/MoveSplineFlag.h +++ b/src/server/game/Movement/Spline/MoveSplineFlag.h @@ -35,46 +35,50 @@ namespace Movement public: enum eFlags{ None = 0x00000000, - // x00-xFF(first byte) used as animation Ids storage in pair with Animation flag - Done = 0x00000100, - Falling = 0x00000200, // Affects elevation computation, can't be combined with Parabolic flag - No_Spline = 0x00000400, - Parabolic = 0x00000800, // Affects elevation computation, can't be combined with Falling flag - Walkmode = 0x00001000, - Flying = 0x00002000, // Smooth movement(Catmullrom interpolation mode), flying animation - OrientationFixed = 0x00004000, // Model orientation fixed - Final_Point = 0x00008000, - Final_Target = 0x00010000, - Final_Angle = 0x00020000, - Catmullrom = 0x00040000, // Used Catmullrom interpolation mode - Cyclic = 0x00080000, // Movement by cycled spline - Enter_Cycle = 0x00100000, // Everytimes appears with cyclic flag in monster move packet, erases first spline vertex after first cycle done - Animation = 0x00200000, // Plays animation after some time passed - Frozen = 0x00400000, // Will never arrive - TransportEnter = 0x00800000, - TransportExit = 0x01000000, - Unknown7 = 0x02000000, - Unknown8 = 0x04000000, - OrientationInversed = 0x08000000, - Unknown10 = 0x10000000, - Unknown11 = 0x20000000, - Unknown12 = 0x40000000, - Unknown13 = 0x80000000, + // x00-xF(first byte) used as animation Ids storage in pair with Animation flag + Unknown1 = 0x00000010, // NOT VERIFIED + Done = 0x00000020, + Falling = 0x00000040, // Affects elevation computation, can't be combined with Parabolic flag + No_Spline = 0x00000080, + Unknown2 = 0x00000100, // NOT VERIFIED + Flying = 0x00000200, // Smooth movement(Catmullrom interpolation mode), flying animation + OrientationFixed = 0x00000400, // Model orientation fixed + Catmullrom = 0x00000800, // Used Catmullrom interpolation mode + Cyclic = 0x00001000, // Movement by cycled spline + Enter_Cycle = 0x00002000, // Everytimes appears with cyclic flag in monster move packet, erases first spline vertex after first cycle done + Frozen = 0x00004000, // Will never arrive + TransportEnter = 0x00008000, + TransportExit = 0x00010000, + Unknown3 = 0x00020000, // NOT VERIFIED + Unknown4 = 0x00040000, // NOT VERIFIED + OrientationInversed = 0x00080000, + Unknown5 = 0x00100000, // NOT VERIFIED + Walkmode = 0x00200000, + UncompressedPath = 0x00400000, + Unknown6 = 0x00800000, // NOT VERIFIED + Animation = 0x01000000, // Plays animation after some time passed + Parabolic = 0x02000000, // Affects elevation computation, can't be combined with Falling flag + Final_Point = 0x04000000, + Final_Target = 0x08000000, + Final_Angle = 0x10000000, + Unknown7 = 0x20000000, // NOT VERIFIED + Unknown8 = 0x40000000, // NOT VERIFIED + Unknown9 = 0x80000000, // NOT VERIFIED // Masks Mask_Final_Facing = Final_Point | Final_Target | Final_Angle, // animation ids stored here, see AnimType enum, used with Animation flag - Mask_Animations = 0xFF, + Mask_Animations = 0xF, // flags that shouldn't be appended into SMSG_MONSTER_MOVE\SMSG_MONSTER_MOVE_TRANSPORT packet, should be more probably Mask_No_Monster_Move = Mask_Final_Facing | Mask_Animations | Done, // CatmullRom interpolation mode used - Mask_CatmullRom = Flying | Catmullrom, + Mask_CatmullRom = Catmullrom, // Unused, not suported flags - Mask_Unused = No_Spline|Enter_Cycle|Frozen|Unknown7|Unknown8|Unknown10|Unknown11|Unknown12|Unknown13, + Mask_Unused = No_Spline|Enter_Cycle|Frozen|UncompressedPath|Unknown1|Unknown2|Unknown3|Unknown4|Unknown5|Unknown6|Unknown7|Unknown8|Unknown9, }; - inline uint32& raw() { return (uint32&)*this;} - inline const uint32& raw() const { return (const uint32&)*this;} + inline uint32& raw() { return (uint32&)*this; } + inline const uint32& raw() const { return (const uint32&)*this; } MoveSplineFlag() { raw() = 0; } MoveSplineFlag(uint32 f) { raw() = f; } @@ -82,15 +86,15 @@ namespace Movement // Constant interface - bool isSmooth() const { return raw() & Mask_CatmullRom;} - bool isLinear() const { return !isSmooth();} - bool isFacing() const { return raw() & Mask_Final_Facing;} + bool isSmooth() const { return raw() & Mask_CatmullRom; } + bool isLinear() const { return !isSmooth(); } + bool isFacing() const { return raw() & Mask_Final_Facing; } - uint8 getAnimationId() const { return animId;} - bool hasAllFlags(uint32 f) const { return (raw() & f) == f;} - bool hasFlag(uint32 f) const { return (raw() & f) != 0;} - uint32 operator & (uint32 f) const { return (raw() & f);} - uint32 operator | (uint32 f) const { return (raw() | f);} + uint8 getAnimationId() const { return animId; } + bool hasAllFlags(uint32 f) const { return (raw() & f) == f; } + bool hasFlag(uint32 f) const { return (raw() & f) != 0; } + uint32 operator & (uint32 f) const { return (raw() & f); } + uint32 operator | (uint32 f) const { return (raw() | f); } std::string ToString() const; // Not constant interface @@ -109,31 +113,35 @@ namespace Movement void EnableTransportEnter() { raw() = (raw() & ~TransportExit) | TransportEnter; } void EnableTransportExit() { raw() = (raw() & ~TransportEnter) | TransportExit; } - uint8 animId : 8; - bool done : 1; - bool falling : 1; - bool no_spline : 1; - bool parabolic : 1; - bool walkmode : 1; - bool flying : 1; - bool orientationFixed : 1; - bool final_point : 1; - bool final_target : 1; - bool final_angle : 1; - bool catmullrom : 1; - bool cyclic : 1; - bool enter_cycle : 1; - bool animation : 1; - bool frozen : 1; - bool transportEnter: 1; - bool transportExit : 1; - bool unknown7 : 1; - bool unknown8 : 1; + uint8 animId : 4; + bool unknown1 : 1; + bool done : 1; + bool falling : 1; + bool no_spline : 1; + bool unknown2 : 1; + bool flying : 1; + bool orientationFixed : 1; + bool catmullrom : 1; + bool cyclic : 1; + bool enter_cycle : 1; + bool frozen : 1; + bool transportEnter : 1; + bool transportExit : 1; + bool unknown3 : 1; + bool unknown4 : 1; bool orientationInversed : 1; - bool unknown10 : 1; - bool unknown11 : 1; - bool unknown12 : 1; - bool unknown13 : 1; + bool unknown5 : 1; + bool walkmode : 1; + bool uncompressedPath : 1; + bool unknown6 : 1; + bool animation : 1; + bool parabolic : 1; + bool final_point : 1; + bool final_target : 1; + bool final_angle : 1; + bool unknown7 : 1; + bool unknown8 : 1; + bool unknown9 : 1; }; #if defined( __GNUC__ ) #pragma pack() diff --git a/src/server/game/Movement/Spline/MovementPacketBuilder.cpp b/src/server/game/Movement/Spline/MovementPacketBuilder.cpp index 2cf7bd6e2bb..f35d9e1b64f 100644 --- a/src/server/game/Movement/Spline/MovementPacketBuilder.cpp +++ b/src/server/game/Movement/Spline/MovementPacketBuilder.cpp @@ -128,7 +128,7 @@ namespace Movement const Spline& spline = move_spline.spline; MoveSplineFlag splineflags = move_spline.splineflags; - if (splineflags & MoveSplineFlag::Mask_CatmullRom) + if (splineflags & MoveSplineFlag::UncompressedPath) { if (splineflags.cyclic) WriteCatmullRomCyclicPath(spline, data); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 328311f99ee..b052e0735af 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -1097,8 +1097,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_MINIGAME_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MIRRORIMAGE_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MODIFY_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MONSTER_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MONSTER_MOVE_TRANSPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MONSTER_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MONSTER_MOVE_TRANSPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOTD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOUNTRESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOUNTSPECIAL_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index f1780c15fe9..d02961e3a8c 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -843,7 +843,7 @@ enum Opcodes SMSG_MIRRORIMAGE_DATA = 0x0000, SMSG_MODIFY_COOLDOWN = 0x0000, SMSG_MONSTER_MOVE = 0x6E17, - SMSG_MONSTER_MOVE_TRANSPORT = 0x0000, + SMSG_MONSTER_MOVE_TRANSPORT = 0x2004, SMSG_MOTD = 0x0A35, SMSG_MOUNTRESULT = 0x0000, SMSG_MOUNTSPECIAL_ANIM = 0x0000, -- cgit v1.2.3 From 2c291712b21666a59918e6ba76a031d89cd3370d Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 14 Jul 2012 00:12:05 +0200 Subject: Core/WorldSocket: Restored opcode check lost in between merges --- src/server/game/Server/WorldSocket.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index e1d3d2c1412..59734364934 100755 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -452,7 +452,7 @@ int WorldSocket::Update (void) int ret; do - ret = handle_output (get_handle()); + ret = handle_output(get_handle()); while (ret > 0); return ret; @@ -460,18 +460,18 @@ int WorldSocket::Update (void) int WorldSocket::handle_input_header (void) { - ACE_ASSERT (m_RecvWPct == NULL); + ACE_ASSERT(m_RecvWPct == NULL); - ACE_ASSERT (m_Header.length() == sizeof(ClientPktHeader)); + ACE_ASSERT(m_Header.length() == sizeof(ClientPktHeader)); - m_Crypt.DecryptRecv ((uint8*) m_Header.rd_ptr(), sizeof(ClientPktHeader)); + m_Crypt.DecryptRecv ((uint8*)m_Header.rd_ptr(), sizeof(ClientPktHeader)); - ClientPktHeader& header = *((ClientPktHeader*) m_Header.rd_ptr()); + ClientPktHeader& header = *((ClientPktHeader*)m_Header.rd_ptr()); EndianConvertReverse(header.size); EndianConvert(header.cmd); - if ((header.size < 4) || (header.size > 10240)) + if ((header.size < 4) || (header.size > 10240) || (header.cmd > 0xFFFF && (header.cmd >> 16) != 0x4C52)) // LR (from MSG_VERIFY_CONNECTIVITY) { Player* _player = m_Session ? m_Session->GetPlayer() : NULL; sLog->outError("WorldSocket::handle_input_header(): client (account: %u, char [GUID: %u, name: %s]) sent malformed packet (size: %d, cmd: %d)", @@ -486,11 +486,11 @@ int WorldSocket::handle_input_header (void) header.size -= 4; - ACE_NEW_RETURN (m_RecvWPct, WorldPacket (PacketFilter::DropHighBytes(Opcodes(header.cmd)), header.size), -1); + ACE_NEW_RETURN(m_RecvWPct, WorldPacket (PacketFilter::DropHighBytes(Opcodes(header.cmd)), header.size), -1); if (header.size > 0) { - m_RecvWPct->resize (header.size); + m_RecvWPct->resize(header.size); m_RecvPct.base ((char*) m_RecvWPct->contents(), m_RecvWPct->size()); } else -- cgit v1.2.3 From 37c32c4c07ae8c172b9e983793b317799c051677 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 14 Jul 2012 14:03:32 +0200 Subject: Tools: Updated default extractors client build --- src/tools/map_extractor/System.cpp | 2 +- src/tools/vmap4_extractor/vmapexport.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp index 9785f89b199..076c5c126e2 100644 --- a/src/tools/map_extractor/System.cpp +++ b/src/tools/map_extractor/System.cpp @@ -73,7 +73,7 @@ float CONF_float_to_int16_limit = 2048.0f; // Max accuracy = val/65536 float CONF_flat_height_delta_limit = 0.005f; // If max - min less this value - surface is flat float CONF_flat_liquid_delta_limit = 0.001f; // If max - min less this value - liquid surface is flat -uint32 CONF_TargetBuild = 14545; // 4.2.2.14545 +uint32 CONF_TargetBuild = 15595; // 4.3.4.15595 // List MPQ for extract maps from char const* CONF_mpq_list[]= diff --git a/src/tools/vmap4_extractor/vmapexport.cpp b/src/tools/vmap4_extractor/vmapexport.cpp index 1582f9d0b25..c82932e4339 100644 --- a/src/tools/vmap4_extractor/vmapexport.cpp +++ b/src/tools/vmap4_extractor/vmapexport.cpp @@ -59,7 +59,7 @@ HANDLE WorldMpq = NULL; HANDLE LocaleMpq = NULL; -uint32 CONF_TargetBuild = 14545; // 4.2.2.14545 +uint32 CONF_TargetBuild = 15595; // 4.3.4.15595 // List MPQ for extract maps from char const* CONF_mpq_list[]= -- cgit v1.2.3 From 2d144e49254c39e2a8cbf20c5f93ff4d422b5ce1 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 14 Jul 2012 19:06:20 +0200 Subject: Core/PacketIO: Enabled logout opcodes --- src/server/game/Handlers/MiscHandler.cpp | 6 +++--- src/server/game/Server/Protocol/Opcodes.cpp | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 7e72dd5e646..0468cffd28a 100755 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -383,8 +383,8 @@ void WorldSession::HandleLogoutRequestOpcode(WorldPacket & /*recv_data*/) if (reason) { WorldPacket data(SMSG_LOGOUT_RESPONSE, 1+4); - data << uint8(reason); data << uint32(0); + data << uint8(reason); SendPacket(&data); LogoutRequest(0); return; @@ -395,8 +395,8 @@ void WorldSession::HandleLogoutRequestOpcode(WorldPacket & /*recv_data*/) GetSecurity() >= AccountTypes(sWorld->getIntConfig(CONFIG_INSTANT_LOGOUT))) { WorldPacket data(SMSG_LOGOUT_RESPONSE, 1+4); - data << uint8(0); data << uint32(16777216); + data << uint8(0); SendPacket(&data); LogoutPlayer(true); return; @@ -415,8 +415,8 @@ void WorldSession::HandleLogoutRequestOpcode(WorldPacket & /*recv_data*/) } WorldPacket data(SMSG_LOGOUT_RESPONSE, 1+4); - data << uint8(0); data << uint32(0); + data << uint8(0); SendPacket(&data); LogoutRequest(time(NULL)); } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index b052e0735af..b7fa07ad430 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -382,9 +382,9 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_LIST_INVENTORY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleListInventoryOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LOAD_DANCES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_LOAD_SCREEN, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleLoadScreenOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_LOGOUT_CANCEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLogoutCancelOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_LOGOUT_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLogoutRequestOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_LOG_DISCONNECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); + DEFINE_OPCODE_HANDLER(CMSG_LOGOUT_CANCEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLogoutCancelOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_LOGOUT_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLogoutRequestOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_LOG_DISCONNECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); //DEFINE_OPCODE_HANDLER(CMSG_LOOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LOOT_MASTER_GIVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMasterGiveOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LOOT_METHOD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMethodOpcode ); @@ -1069,9 +1069,9 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_LIST_INVENTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LOGIN_SETTIMESPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LOGIN_VERIFY_WORLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LOGOUT_CANCEL_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LOGOUT_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LOGOUT_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOGOUT_CANCEL_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOGOUT_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOGOUT_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOG_XPGAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOOT_ALL_PASSED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOOT_CLEAR_MONEY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From 27ea130b55dd3d16092a3d58f2093b99abc0a46b Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 14 Jul 2012 23:39:12 +0200 Subject: Core/Movement * Updated movement flags * Cleaned up MovementStatusElements enum * Updated and enabled MSG_MOVE_START_FORWARD --- src/server/game/Entities/Object/Object.cpp | 15 +- src/server/game/Entities/Object/Object.h | 4 +- src/server/game/Entities/Player/Player.cpp | 5 +- src/server/game/Entities/Transport/Transport.cpp | 3 +- src/server/game/Entities/Unit/Unit.cpp | 11 +- src/server/game/Entities/Unit/Unit.h | 43 +- src/server/game/Entities/Vehicle/Vehicle.cpp | 2 - src/server/game/Handlers/MovementHandler.cpp | 707 ++++---- src/server/game/Movement/MovementStructures.h | 1870 ++++++++++---------- src/server/game/Movement/Spline/MoveSplineInit.cpp | 6 +- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- src/server/game/Server/WorldSession.cpp | 2 - .../ScarletMonastery/boss_headless_horseman.cpp | 4 +- .../SunwellPlateau/boss_kiljaeden.cpp | 4 +- .../TrialOfTheChampion/boss_grand_champions.cpp | 16 +- 15 files changed, 1404 insertions(+), 1290 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index d9d8c3c461a..6894928b551 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -47,6 +47,7 @@ #include "OutdoorPvPMgr.h" #include "MovementPacketBuilder.h" #include "DynamicTree.h" +#include "Unit.h" uint32 GuidHigh2TypeId(uint32 guid_hi) { @@ -331,13 +332,13 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const data->WriteBit(0); data->WriteBit(!((movementFlags & (MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING)) || (movementFlagsExtra & MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING))); // Has pitch - data->WriteBit(movementFlags & MOVEMENTFLAG_SPLINE_ENABLED); // Has spline data + data->WriteBit(self->IsSplineEnabled()); // Has spline data data->WriteBit(movementFlagsExtra & MOVEMENTFLAG2_INTERPOLATED_TURNING);// Has fall data data->WriteBit(!(movementFlags & MOVEMENTFLAG_SPLINE_ELEVATION)); // Has spline elevation data->WriteBit(guid[5]); - data->WriteBit(movementFlags & MOVEMENTFLAG_ONTRANSPORT); // Has transport data + data->WriteBit(self->m_movementInfo.t_guid); // Has transport data data->WriteBit(0); // Is missing time - if (movementFlags & MOVEMENTFLAG_ONTRANSPORT) + if (self->m_movementInfo.t_guid) { ObjectGuid transGuid = self->m_movementInfo.t_guid; @@ -354,7 +355,7 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const } data->WriteBit(guid[4]); - if (movementFlags & MOVEMENTFLAG_SPLINE_ENABLED) + if (self->IsSplineEnabled()) { data->WriteBit(1); // Has extended spline data Movement::PacketBuilder::WriteCreateBits(*self->movespline, *data); @@ -440,12 +441,12 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const if (movementFlags & MOVEMENTFLAG_SPLINE_ELEVATION) *data << float(self->m_movementInfo.splineElevation); - if (movementFlags & MOVEMENTFLAG_SPLINE_ENABLED) + if (self->IsSplineEnabled()) Movement::PacketBuilder::WriteCreateData(*self->movespline, *data); *data << float(self->GetPositionZMinusOffset()); data->WriteByteSeq(guid[5]); - if (movementFlags & MOVEMENTFLAG_ONTRANSPORT) + if (self->m_movementInfo.t_guid) { ObjectGuid transGuid = self->m_movementInfo.t_guid; @@ -1298,7 +1299,7 @@ void MovementInfo::OutDebug() sLog->outString("flags2 %u", flags2); sLog->outString("time %u current time " UI64FMTD "", flags2, uint64(::time(NULL))); sLog->outString("position: `%s`", pos.ToString().c_str()); - if (flags & MOVEMENTFLAG_ONTRANSPORT) + if (t_guid) { sLog->outString("TRANSPORT:"); sLog->outString("guid: " UI64FMTD, t_guid); diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index 01ad11ba2df..8e1677991f4 100755 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -529,16 +529,16 @@ struct MovementInfo // transport uint64 t_guid; Position t_pos; + int8 t_seat; uint32 t_time; uint32 t_time2; uint32 t_time3; - int8 t_seat; // swimming/flying float pitch; // falling uint32 fallTime; // jumping - float j_zspeed, j_sinAngle, j_cosAngle, j_xyspeed; + float j_zspeed, j_cosAngle, j_sinAngle, j_xyspeed; // spline float splineElevation; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index e5df31734a4..88f2170fdfb 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -2176,15 +2176,14 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati if (m_transport) { - if (options & TELE_TO_NOT_LEAVE_TRANSPORT) - AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT); - else + if (!(options & TELE_TO_NOT_LEAVE_TRANSPORT)) { m_transport->RemovePassenger(this); m_transport = NULL; m_movementInfo.t_pos.Relocate(0.0f, 0.0f, 0.0f, 0.0f); m_movementInfo.t_time = 0; m_movementInfo.t_seat = -1; + m_movementInfo.t_guid = 0; } } diff --git a/src/server/game/Entities/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp index ef3e1331a4c..e44f67f128d 100755 --- a/src/server/game/Entities/Transport/Transport.cpp +++ b/src/server/game/Entities/Transport/Transport.cpp @@ -642,8 +642,7 @@ uint32 Transport::AddNPCPassenger(uint32 tguid, uint32 entry, float x, float y, } creature->SetTransport(this); - creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT); - creature->m_movementInfo.guid = GetGUID(); + creature->m_movementInfo.t_guid = GetGUID(); creature->m_movementInfo.t_pos.Relocate(x, y, z, o); if (anim) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 2435a403408..19a8ab32ac1 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -396,7 +396,7 @@ void Unit::UpdateSplineMovement(uint32 t_diff) m_movesplineTimer.Reset(POSITION_UPDATE_DELAY); Movement::Location loc = movespline->ComputePosition(); - if (HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT)) + if (GetTransGUID()) { Position& pos = m_movementInfo.t_pos; pos.m_positionX = loc.x; @@ -420,7 +420,7 @@ void Unit::UpdateSplineMovement(uint32 t_diff) void Unit::DisableSpline() { - m_movementInfo.RemoveMovementFlag(MovementFlags(MOVEMENTFLAG_SPLINE_ENABLED|MOVEMENTFLAG_FORWARD)); + m_movementInfo.RemoveMovementFlag(MOVEMENTFLAG_FORWARD); movespline->_Interrupt(); } @@ -17644,7 +17644,7 @@ void Unit::BuildMovementPacket(ByteBuffer *data) const *data << GetPositionZMinusOffset(); *data << GetOrientation(); - bool onTransport = GetUnitMovementFlags() & MOVEMENTFLAG_ONTRANSPORT; + bool onTransport = m_movementInfo.t_guid != 0; bool hasInterpolatedMovement = m_movementInfo.flags2 & MOVEMENTFLAG2_INTERPOLATED_MOVEMENT; bool time3 = false; bool swimming = ((GetUnitMovementFlags() & (MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING)) @@ -18180,3 +18180,8 @@ void Unit::SendMovementCanFlyChange() BuildMovementPacket(&data); SendMessageToSet(&data, false); } + +bool Unit::IsSplineEnabled() const +{ + return !movespline->Finalized(); +} diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 6d188fe3593..7471ae603f6 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -675,28 +675,26 @@ enum MovementFlags MOVEMENTFLAG_PITCH_UP = 0x00000040, MOVEMENTFLAG_PITCH_DOWN = 0x00000080, MOVEMENTFLAG_WALKING = 0x00000100, // Walking - MOVEMENTFLAG_ONTRANSPORT = 0x00000200, // Used for flying on some creatures - MOVEMENTFLAG_DISABLE_GRAVITY = 0x00000400, // Former MOVEMENTFLAG_LEVITATING. This is used when walking is not possible. - MOVEMENTFLAG_ROOT = 0x00000800, // Must not be set along with MOVEMENTFLAG_MASK_MOVING - MOVEMENTFLAG_FALLING = 0x00001000, // damage dealt on that type of falling - MOVEMENTFLAG_FALLING_FAR = 0x00002000, - MOVEMENTFLAG_PENDING_STOP = 0x00004000, - MOVEMENTFLAG_PENDING_STRAFE_STOP = 0x00008000, - MOVEMENTFLAG_PENDING_FORWARD = 0x00010000, - MOVEMENTFLAG_PENDING_BACKWARD = 0x00020000, - MOVEMENTFLAG_PENDING_STRAFE_LEFT = 0x00040000, - MOVEMENTFLAG_PENDING_STRAFE_RIGHT = 0x00080000, - MOVEMENTFLAG_PENDING_ROOT = 0x00100000, - MOVEMENTFLAG_SWIMMING = 0x00200000, // appears with fly flag also - MOVEMENTFLAG_ASCENDING = 0x00400000, // press "space" when flying - MOVEMENTFLAG_DESCENDING = 0x00800000, - MOVEMENTFLAG_CAN_FLY = 0x01000000, // Appears when unit can fly AND also walk - MOVEMENTFLAG_FLYING = 0x02000000, // unit is actually flying. pretty sure this is only used for players. creatures use disable_gravity - MOVEMENTFLAG_SPLINE_ELEVATION = 0x04000000, // used for flight paths - MOVEMENTFLAG_SPLINE_ENABLED = 0x08000000, // used for flight paths - MOVEMENTFLAG_WATERWALKING = 0x10000000, // prevent unit from falling through water - MOVEMENTFLAG_FALLING_SLOW = 0x20000000, // active rogue safe fall spell (passive) - MOVEMENTFLAG_HOVER = 0x40000000, // hover, cannot jump + MOVEMENTFLAG_DISABLE_GRAVITY = 0x00000200, // Former MOVEMENTFLAG_LEVITATING. This is used when walking is not possible. + MOVEMENTFLAG_ROOT = 0x00000400, // Must not be set along with MOVEMENTFLAG_MASK_MOVING + MOVEMENTFLAG_FALLING = 0x00000800, // damage dealt on that type of falling + MOVEMENTFLAG_FALLING_FAR = 0x00001000, + MOVEMENTFLAG_PENDING_STOP = 0x00002000, + MOVEMENTFLAG_PENDING_STRAFE_STOP = 0x00004000, + MOVEMENTFLAG_PENDING_FORWARD = 0x00008000, + MOVEMENTFLAG_PENDING_BACKWARD = 0x00010000, + MOVEMENTFLAG_PENDING_STRAFE_LEFT = 0x00020000, + MOVEMENTFLAG_PENDING_STRAFE_RIGHT = 0x00040000, + MOVEMENTFLAG_PENDING_ROOT = 0x00080000, + MOVEMENTFLAG_SWIMMING = 0x00100000, // appears with fly flag also + MOVEMENTFLAG_ASCENDING = 0x00200000, // press "space" when flying + MOVEMENTFLAG_DESCENDING = 0x00400000, + MOVEMENTFLAG_CAN_FLY = 0x00800000, // Appears when unit can fly AND also walk + MOVEMENTFLAG_FLYING = 0x01000000, // unit is actually flying. pretty sure this is only used for players. creatures use disable_gravity + MOVEMENTFLAG_SPLINE_ELEVATION = 0x02000000, // used for flight paths + MOVEMENTFLAG_WATERWALKING = 0x04000000, // prevent unit from falling through water + MOVEMENTFLAG_FALLING_SLOW = 0x08000000, // active rogue safe fall spell (passive) + MOVEMENTFLAG_HOVER = 0x10000000, // hover, cannot jump // TODO: Check if PITCH_UP and PITCH_DOWN really belong here.. MOVEMENTFLAG_MASK_MOVING = @@ -2103,6 +2101,7 @@ class Unit : public WorldObject uint16 HasExtraUnitMovementFlag(uint16 f) const { return m_movementInfo.flags2 & f; } uint16 GetExtraUnitMovementFlags() const { return m_movementInfo.flags2; } void SetExtraUnitMovementFlags(uint16 f) { m_movementInfo.flags2 = f; } + bool IsSplineEnabled() const; float GetPositionZMinusOffset() const { diff --git a/src/server/game/Entities/Vehicle/Vehicle.cpp b/src/server/game/Entities/Vehicle/Vehicle.cpp index eb50f3fe229..3d36f6ccda5 100755 --- a/src/server/game/Entities/Vehicle/Vehicle.cpp +++ b/src/server/game/Entities/Vehicle/Vehicle.cpp @@ -342,7 +342,6 @@ bool Vehicle::AddPassenger(Unit* unit, int8 seatId) if (seat->second.SeatInfo->m_flags && !(seat->second.SeatInfo->m_flags & VEHICLE_SEAT_FLAG_ALLOW_TURNING)) unit->AddUnitState(UNIT_STATE_ONVEHICLE); - unit->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT); VehicleSeatEntry const* veSeat = seat->second.SeatInfo; unit->m_movementInfo.t_pos.m_positionX = veSeat->m_attachmentOffsetX; unit->m_movementInfo.t_pos.m_positionY = veSeat->m_attachmentOffsetY; @@ -419,7 +418,6 @@ void Vehicle::RemovePassenger(Unit* unit) if (_me->IsInWorld()) { - unit->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT); unit->m_movementInfo.t_pos.Relocate(0, 0, 0, 0); unit->m_movementInfo.t_time = 0; unit->m_movementInfo.t_seat = 0; diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp index 57afc614545..df28e01d5c7 100755 --- a/src/server/game/Handlers/MovementHandler.cpp +++ b/src/server/game/Handlers/MovementHandler.cpp @@ -277,7 +277,7 @@ void WorldSession::HandleMovementOpcodes(WorldPacket & recvData) } /* handle special cases */ - if (movementInfo.flags & MOVEMENTFLAG_ONTRANSPORT) + if (movementInfo.t_guid) { // transports size limited // (also received at zeppelin leave by some reason with t_* as absolute in continent coordinates, can be safely skipped) @@ -339,7 +339,7 @@ void WorldSession::HandleMovementOpcodes(WorldPacket & recvData) { GameObject* go = mover->GetMap()->GetGameObject(movementInfo.t_guid); if (!go || go->GetGoType() != GAMEOBJECT_TYPE_TRANSPORT) - movementInfo.flags &= ~MOVEMENTFLAG_ONTRANSPORT; + movementInfo.t_guid = 0; } } else if (plrMover && plrMover->GetTransport()) // if we were on a transport, leave @@ -595,167 +595,205 @@ void WorldSession::HandleSummonResponseOpcode(WorldPacket& recv_data) _player->SummonIfPossible(agree); } -void WorldSession::ReadMovementInfo(WorldPacket &data, MovementInfo* mi) +void WorldSession::ReadMovementInfo(WorldPacket& data, MovementInfo* mi) { - bool HaveTransportData = false, - HaveTransportTime2 = false, - HaveTransportTime3 = false, - HavePitch = false, - HaveFallData = false, - HaveFallDirection = false, - HaveSplineElevation = false, - HaveSpline = false; - - MovementStatusElements *sequence = GetMovementStatusElementsSequence(data.GetOpcode()); - if (sequence == NULL) - return; - - ObjectGuid guid; - ObjectGuid tguid; - - for (uint32 i = 0; i < MSE_COUNT; i++) - { - MovementStatusElements element = sequence[i]; - - if (element >= MSEGuidByte0 && element <= MSEGuidByte7) - { - guid[element - MSEGuidByte0] = data.ReadBit(); - continue; - } - - if (element >= MSETransportGuidByte0 && - element <= MSETransportGuidByte7) - { - if (HaveTransportData) - tguid[element - MSETransportGuidByte0] = data.ReadBit(); - continue; - } - - if (element >= MSEGuidByte0_2 && element <= MSEGuidByte7_2) - { - data.ReadByteSeq(guid[element - MSEGuidByte0_2]); - continue; - } - - if (element >= MSETransportGuidByte0_2 && - element <= MSETransportGuidByte7_2) - { - if (HaveTransportData) - data.ReadByteSeq(tguid[element - MSETransportGuidByte0_2]); - continue; - } - - switch (element) - { - case MSEFlags: - mi->flags = data.ReadBits(30); - break; - case MSEFlags2: - mi->flags2 = data.ReadBits(12); - break; - case MSETimestamp: - data >> mi->time; - break; - case MSEHavePitch: - HavePitch = data.ReadBit(); - break; - case MSEHaveFallData: - HaveFallData = data.ReadBit(); - break; - case MSEHaveFallDirection: - if (HaveFallData) - HaveFallDirection = data.ReadBit(); - break; - case MSEHaveTransportData: - HaveTransportData = data.ReadBit(); - break; - case MSETransportHaveTime2: - if (HaveTransportData) - HaveTransportTime2 = data.ReadBit(); - break; - case MSETransportHaveTime3: - if (HaveTransportData) - HaveTransportTime3 = data.ReadBit(); - break; - case MSEHaveSpline: - HaveSpline = data.ReadBit(); - break; - case MSEHaveSplineElev: - HaveSplineElevation = data.ReadBit(); - break; - case MSEPositionX: - data >> mi->pos.PositionXYZStream(); - break; - case MSEPositionY: - case MSEPositionZ: - break; // assume they always go as vector of 3 - case MSEPositionO: - data >> mi->pos.m_orientation; - break; - case MSEPitch: - if (HavePitch) - data >> mi->pitch; - break; - case MSEFallTime: - if (HaveFallData) - data >> mi->fallTime; - break; - case MSESplineElev: - if (HaveSplineElevation) - data >> mi->splineElevation; - break; - case MSEFallHorizontalSpeed: - if (HaveFallDirection) - data >> mi->j_xyspeed; - break; - case MSEFallVerticalSpeed: - if (HaveFallData) - data >> mi->j_zspeed; - break; - case MSEFallCosAngle: - if (HaveFallDirection) - data >> mi->j_cosAngle; - break; - case MSEFallSinAngle: - if (HaveFallDirection) - data >> mi->j_sinAngle; - break; - case MSETransportSeat: - if (HaveTransportData) - data >> mi->t_seat; - break; - case MSETransportPositionO: - if (HaveTransportData) - data >> mi->t_pos.m_orientation; - break; - case MSETransportPositionX: - if (HaveTransportData) - data >> mi->t_pos.PositionXYZStream(); - break; - case MSETransportPositionY: - case MSETransportPositionZ: - break; // assume they always go as vector of 3 - case MSETransportTime: - if (HaveTransportData) - data >> mi->t_time; - break; - case MSETransportTime2: - if (HaveTransportTime2) - data >> mi->t_time2; - break; - case MSETransportTime3: - if (HaveTransportTime3) - data >> mi->t_time3; - break; - default: - WPError(false, "Incorrect sequence element detected at ReadMovementInfo"); - } - } - - mi->guid = guid; - mi->t_guid = tguid; - - if (HaveTransportData && mi->pos.m_positionX != mi->t_pos.m_positionX) + bool hasMovementFlags = false; + bool hasMovementFlags2 = false; + bool hasTimestamp = false; + bool hasOrientation = false; + bool hasTransportData = false; + bool hasTransportTime2 = false; + bool hasTransportTime3 = false; + bool hasPitch = false; + bool hasFallData = false; + bool hasFallDirection = false; + bool hasSplineElevation = false; + bool hasSpline = false; + + MovementStatusElements* sequence = GetMovementStatusElementsSequence(data.GetOpcode()); + if (sequence == NULL) + { + sLog->outError("WorldSession::ReadMovementInfo: No movement sequence found for opcode 0x%04X", uint32(data.GetOpcode())); + return; + } + + ObjectGuid guid; + ObjectGuid tguid; + + for (uint32 i = 0; i < MSE_COUNT; ++i) + { + MovementStatusElements element = sequence[i]; + if (element == MSEEnd) + break; + + if (element >= MSEHasGuidByte0 && element <= MSEHasGuidByte7) + { + guid[element - MSEHasGuidByte0] = data.ReadBit(); + continue; + } + + if (element >= MSEHasTransportGuidByte0 && + element <= MSEHasTransportGuidByte7) + { + if (hasTransportData) + tguid[element - MSEHasTransportGuidByte0] = data.ReadBit(); + continue; + } + + if (element >= MSEGuidByte0 && element <= MSEGuidByte7) + { + data.ReadByteSeq(guid[element - MSEGuidByte0]); + continue; + } + + if (element >= MSETransportGuidByte0 && + element <= MSETransportGuidByte7) + { + if (hasTransportData) + data.ReadByteSeq(tguid[element - MSETransportGuidByte0]); + continue; + } + + switch (element) + { + case MSEHasMovementFlags: + hasMovementFlags = !data.ReadBit(); + break; + case MSEHasMovementFlags2: + hasMovementFlags2 = !data.ReadBit(); + break; + case MSEHasTimestamp: + hasTimestamp = !data.ReadBit(); + break; + case MSEHasOrientation: + hasOrientation = !data.ReadBit(); + break; + case MSEHasTransportData: + hasTransportData = data.ReadBit(); + break; + case MSEHasTransportTime2: + if (hasTransportData) + hasTransportTime2 = data.ReadBit(); + break; + case MSEHasTransportTime3: + if (hasTransportData) + hasTransportTime3 = data.ReadBit(); + break; + case MSEHasPitch: + hasPitch = !data.ReadBit(); + break; + case MSEHasFallData: + hasFallData = data.ReadBit(); + break; + case MSEHasFallDirection: + if (hasFallData) + hasFallDirection = data.ReadBit(); + break; + case MSEHasSplineElev: + hasSplineElevation = !data.ReadBit(); + break; + case MSEHasSpline: + hasSpline = data.ReadBit(); + break; + case MSEMovementFlags: + if (hasMovementFlags) + mi->flags = data.ReadBits(30); + break; + case MSEMovementFlags2: + if (hasMovementFlags2) + mi->flags2 = data.ReadBits(12); + break; + case MSETimestamp: + if (hasTimestamp) + data >> mi->time; + break; + case MSEPositionX: + data >> mi->pos.m_positionX; + break; + case MSEPositionY: + data >> mi->pos.m_positionY; + break; + case MSEPositionZ: + data >> mi->pos.m_positionZ; + break; + case MSEOrientation: + if (hasOrientation) + data >> mi->pos.m_orientation; + break; + case MSETransportPositionX: + if (hasTransportData) + data >> mi->t_pos.m_positionX; + break; + case MSETransportPositionY: + if (hasTransportData) + data >> mi->t_pos.m_positionY; + break; + case MSETransportPositionZ: + if (hasTransportData) + data >> mi->t_pos.m_positionZ; + break; + case MSETransportOrientation: + if (hasTransportData) + data >> mi->t_pos.m_orientation; + break; + case MSETransportSeat: + if (hasTransportData) + data >> mi->t_seat; + break; + case MSETransportTime: + if (hasTransportData) + data >> mi->t_time; + break; + case MSETransportTime2: + if (hasTransportData && hasTransportTime2) + data >> mi->t_time2; + break; + case MSETransportTime3: + if (hasTransportData && hasTransportTime3) + data >> mi->t_time3; + break; + case MSEPitch: + if (hasPitch) + data >> mi->pitch; + break; + case MSEFallTime: + if (hasFallData) + data >> mi->fallTime; + break; + case MSEFallVerticalSpeed: + if (hasFallData) + data >> mi->j_zspeed; + break; + case MSEFallCosAngle: + if (hasFallDirection) + data >> mi->j_cosAngle; + break; + case MSEFallSinAngle: + if (hasFallDirection) + data >> mi->j_sinAngle; + break; + case MSEFallHorizontalSpeed: + if (hasFallDirection) + data >> mi->j_xyspeed; + break; + case MSESplineElev: + if (hasSplineElevation) + data >> mi->splineElevation; + break; + case MSEZeroBit: + case MSEOneBit: + data.ReadBit(); + break; + default: + ASSERT(false && "Incorrect sequence element detected at ReadMovementInfo"); + break; + } + } + + mi->guid = guid; + mi->t_guid = tguid; + + if (hasTransportData && mi->pos.m_positionX != mi->t_pos.m_positionX) if (GetPlayer()->GetTransport()) GetPlayer()->GetTransport()->UpdatePosition(mi); @@ -834,157 +872,196 @@ void WorldSession::ReadMovementInfo(WorldPacket &data, MovementInfo* mi) void WorldSession::WriteMovementInfo(WorldPacket &data, MovementInfo* mi) { - bool HaveTransportData = mi->HasMovementFlag(MOVEMENTFLAG_ONTRANSPORT), - HaveTransportTime2 = (mi->flags2 & MOVEMENTFLAG2_INTERPOLATED_MOVEMENT) != 0, - HaveTransportTime3 = false, - HavePitch = (mi->HasMovementFlag(MovementFlags(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING))) - || (mi->flags2 & MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING), - HaveFallData = mi->HasExtraMovementFlag(MOVEMENTFLAG2_INTERPOLATED_TURNING), - HaveFallDirection = mi->HasMovementFlag(MOVEMENTFLAG_FALLING), - HaveSplineElevation = mi->HasMovementFlag(MOVEMENTFLAG_SPLINE_ELEVATION), - HaveSpline = false; - - MovementStatusElements *sequence = GetMovementStatusElementsSequence(data.GetOpcode()); - if(!sequence) - return; - uint8 *guid = (uint8 *)&mi->guid; - uint8 *tguid = (uint8 *)&mi->t_guid; - for(uint32 i=0; i < MSE_COUNT; i++) - { - MovementStatusElements element = sequence[i]; - - if (element >= MSEGuidByte0 && element <= MSEGuidByte7) - { - data.WriteBit(guid[element - MSEGuidByte0]); - continue; - } - - if (element >= MSETransportGuidByte0 && - element <= MSETransportGuidByte7) - { - if (HaveTransportData) - data.WriteBit(tguid[element - MSETransportGuidByte0]); - continue; - } - - if (element >= MSEGuidByte0_2 && element <= MSEGuidByte7_2) - { - data.WriteByteSeq(guid[element - MSEGuidByte0_2]); - continue; - } - - if (element >= MSETransportGuidByte0_2 && - element <= MSETransportGuidByte7_2) - { - if (HaveTransportData) - data.WriteByteSeq(tguid[element - MSETransportGuidByte0_2]); - continue; - } - - switch (element) - { - case MSEFlags: - data.WriteBits(mi->flags, 30); - break; - case MSEFlags2: - data.WriteBits(mi->flags2, 12); - break; - case MSETimestamp: - data << mi->time; - break; - case MSEHavePitch: - data.WriteBit(HavePitch); - break; - case MSEHaveFallData: - data.WriteBit(HaveFallData); - break; - case MSEHaveFallDirection: - if (HaveFallData) - data.WriteBit(HaveFallDirection); - break; - case MSEHaveTransportData: - data.WriteBit(HaveTransportData); - break; - case MSETransportHaveTime2: - if (HaveTransportData) - data.WriteBit(HaveTransportTime2); - break; - case MSETransportHaveTime3: - if (HaveTransportData) - data.WriteBit(HaveTransportTime3); - break; - case MSEHaveSpline: - data.WriteBit(HaveSpline); - break; - case MSEHaveSplineElev: - data.WriteBit(HaveSplineElevation); - break; - case MSEPositionX: - data << mi->pos.PositionXYZStream(); - break; - case MSEPositionY: - case MSEPositionZ: - break; // assume they always go as vector of 3 - case MSEPositionO: - data << mi->pos.m_orientation; - break; - case MSEPitch: - if (HavePitch) - data << mi->pitch; - break; - case MSEFallTime: - if (HaveFallData) - data << mi->fallTime; - break; - case MSESplineElev: - if (HaveSplineElevation) - data << mi->splineElevation; - break; - case MSEFallHorizontalSpeed: - if (HaveFallDirection) - data << mi->j_xyspeed; - break; - case MSEFallVerticalSpeed: - if (HaveFallData) - data << mi->j_zspeed; - break; - case MSEFallCosAngle: - if (HaveFallDirection) - data << mi->j_cosAngle; - break; - case MSEFallSinAngle: - if (HaveFallDirection) - data << mi->j_sinAngle; - break; - case MSETransportSeat: - if (HaveTransportData) - data << mi->t_seat; - break; - case MSETransportPositionO: - if (HaveTransportData) - data << mi->t_pos.m_orientation; - break; - case MSETransportPositionX: - if (HaveTransportData) - data << mi->t_pos.PositionXYZStream(); - break; - case MSETransportPositionY: - case MSETransportPositionZ: - break; // assume they always go as vector of 3 - case MSETransportTime: - if (HaveTransportData) - data << mi->t_time; - break; - case MSETransportTime2: - if (HaveTransportTime2) - data << mi->t_time2; - break; - case MSETransportTime3: - if (HaveTransportTime3) - data << mi->t_time3; - break; - default: - WPError(false, "Incorrect sequence element detected at ReadMovementInfo"); - } - } + bool hasMovementFlags = mi->GetMovementFlags() != 0; + bool hasMovementFlags2 = mi->GetExtraMovementFlags() != 0; + bool hasTimestamp = mi->time != 0; + bool hasOrientation = !G3D::fuzzyEq(mi->pos.GetOrientation(), 0.0f); + bool hasTransportData = mi->t_guid != 0; + bool hasTransportTime2 = mi->HasExtraMovementFlag(MOVEMENTFLAG2_INTERPOLATED_MOVEMENT); + bool hasTransportTime3 = false; + bool hasPitch = mi->HasMovementFlag(MovementFlags(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING)) || mi->HasExtraMovementFlag(MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING); + bool hasFallData = mi->HasExtraMovementFlag(MOVEMENTFLAG2_INTERPOLATED_TURNING); + bool hasFallDirection = mi->HasMovementFlag(MOVEMENTFLAG_FALLING); + bool hasSplineElevation = mi->HasMovementFlag(MOVEMENTFLAG_SPLINE_ELEVATION); + bool hasSpline = false; + + MovementStatusElements* sequence = GetMovementStatusElementsSequence(data.GetOpcode()); + if (!sequence) + { + sLog->outError("WorldSession::WriteMovementInfo: No movement sequence found for opcode 0x%04X", uint32(data.GetOpcode())); + return; + } + + ObjectGuid guid = mi->guid; + ObjectGuid tguid = mi->t_guid; + + for(uint32 i = 0; i < MSE_COUNT; ++i) + { + MovementStatusElements element = sequence[i]; + + if (element >= MSEHasGuidByte0 && element <= MSEHasGuidByte7) + { + data.WriteBit(guid[element - MSEHasGuidByte0]); + continue; + } + + if (element >= MSEHasTransportGuidByte0 && + element <= MSEHasTransportGuidByte7) + { + if (hasTransportData) + data.WriteBit(tguid[element - MSEHasTransportGuidByte0]); + continue; + } + + if (element >= MSEGuidByte0 && element <= MSEGuidByte7) + { + data.WriteByteSeq(guid[element - MSEGuidByte0]); + continue; + } + + if (element >= MSETransportGuidByte0 && + element <= MSETransportGuidByte7) + { + if (hasTransportData) + data.WriteByteSeq(tguid[element - MSETransportGuidByte0]); + continue; + } + + switch (element) + { + case MSEHasMovementFlags: + data.WriteBit(!hasMovementFlags); + break; + case MSEHasMovementFlags2: + data.WriteBit(!hasMovementFlags2); + break; + case MSEHasTimestamp: + data.WriteBit(!hasTimestamp); + break; + case MSEHasOrientation: + data.WriteBit(!hasOrientation); + break; + case MSEHasTransportData: + data.WriteBit(hasTransportData); + break; + case MSEHasTransportTime2: + if (hasTransportData) + data.WriteBit(hasTransportTime2); + break; + case MSEHasTransportTime3: + if (hasTransportData) + data.WriteBit(hasTransportTime3); + break; + case MSEHasPitch: + data.WriteBit(!hasPitch); + break; + case MSEHasFallData: + data.WriteBit(hasFallData); + break; + case MSEHasFallDirection: + if (hasFallData) + data.WriteBit(hasFallDirection); + break; + case MSEHasSplineElev: + data.WriteBit(!hasSplineElevation); + break; + case MSEHasSpline: + data.WriteBit(hasSpline); + break; + case MSEMovementFlags: + if (hasMovementFlags) + data.WriteBits(mi->flags, 30); + break; + case MSEMovementFlags2: + if (hasMovementFlags2) + data.WriteBits(mi->flags2, 12); + break; + case MSETimestamp: + if (hasTimestamp) + data << mi->time; + break; + case MSEPositionX: + data << mi->pos.m_positionX; + break; + case MSEPositionY: + data << mi->pos.m_positionY; + break; + case MSEPositionZ: + data << mi->pos.m_positionZ; + break; + case MSEOrientation: + if (hasOrientation) + data << mi->pos.m_orientation; + break; + case MSETransportPositionX: + if (hasTransportData) + data << mi->t_pos.m_positionX; + break; + case MSETransportPositionY: + if (hasTransportData) + data << mi->t_pos.m_positionY; + break; + case MSETransportPositionZ: + if (hasTransportData) + data << mi->t_pos.m_positionZ; + break; + case MSETransportOrientation: + if (hasTransportData) + data << mi->t_pos.m_orientation; + break; + case MSETransportSeat: + if (hasTransportData) + data << mi->t_seat; + break; + case MSETransportTime: + if (hasTransportData) + data << mi->t_time; + break; + case MSETransportTime2: + if (hasTransportData && hasTransportTime2) + data << mi->t_time2; + break; + case MSETransportTime3: + if (hasTransportData && hasTransportTime3) + data << mi->t_time3; + break; + case MSEPitch: + if (hasPitch) + data << mi->pitch; + break; + case MSEFallTime: + if (hasFallData) + data << mi->fallTime; + break; + case MSEFallVerticalSpeed: + if (hasFallData) + data << mi->j_zspeed; + break; + case MSEFallCosAngle: + if (hasFallDirection) + data << mi->j_cosAngle; + break; + case MSEFallSinAngle: + if (hasFallDirection) + data << mi->j_sinAngle; + break; + case MSEFallHorizontalSpeed: + if (hasFallDirection) + data << mi->j_xyspeed; + break; + case MSESplineElev: + if (hasSplineElevation) + data << mi->splineElevation; + break; + case MSEZeroBit: + data.WriteBit(0); + break; + case MSEOneBit: + data.WriteBit(1); + break; + default: + ASSERT(false && "Incorrect sequence element detected at ReadMovementInfo"); + break; + } + } } diff --git a/src/server/game/Movement/MovementStructures.h b/src/server/game/Movement/MovementStructures.h index 84b6d79cbd5..87439bbedbc 100644 --- a/src/server/game/Movement/MovementStructures.h +++ b/src/server/game/Movement/MovementStructures.h @@ -21,10 +21,35 @@ enum MovementStatusElements { - MSEFlags, - MSEFlags2, - MSETimestamp, - MSEHavePitch, + MSEHasGuidByte0, + MSEHasGuidByte1, + MSEHasGuidByte2, + MSEHasGuidByte3, + MSEHasGuidByte4, + MSEHasGuidByte5, + MSEHasGuidByte6, + MSEHasGuidByte7, + MSEHasMovementFlags, + MSEHasMovementFlags2, + MSEHasTimestamp, + MSEHasOrientation, + MSEHasTransportData, + MSEHasTransportGuidByte0, + MSEHasTransportGuidByte1, + MSEHasTransportGuidByte2, + MSEHasTransportGuidByte3, + MSEHasTransportGuidByte4, + MSEHasTransportGuidByte5, + MSEHasTransportGuidByte6, + MSEHasTransportGuidByte7, + MSEHasTransportTime2, + MSEHasTransportTime3, + MSEHasPitch, + MSEHasFallData, + MSEHasFallDirection, + MSEHasSplineElev, + MSEHasSpline, + MSEGuidByte0, MSEGuidByte1, MSEGuidByte2, @@ -33,11 +58,13 @@ enum MovementStatusElements MSEGuidByte5, MSEGuidByte6, MSEGuidByte7, - MSEHaveFallData, - MSEHaveFallDirection, - MSEHaveTransportData, - MSETransportHaveTime2, - MSETransportHaveTime3, + MSEMovementFlags, + MSEMovementFlags2, + MSETimestamp, + MSEPositionX, + MSEPositionY, + MSEPositionZ, + MSEOrientation, MSETransportGuidByte0, MSETransportGuidByte1, MSETransportGuidByte2, @@ -46,1326 +73,1337 @@ enum MovementStatusElements MSETransportGuidByte5, MSETransportGuidByte6, MSETransportGuidByte7, - MSEHaveSpline, - MSEHaveSplineElev, - MSEPositionX, - MSEPositionY, - MSEPositionZ, - MSEPositionO, - MSEGuidByte0_2, - MSEGuidByte1_2, - MSEGuidByte2_2, - MSEGuidByte3_2, - MSEGuidByte4_2, - MSEGuidByte5_2, - MSEGuidByte6_2, - MSEGuidByte7_2, - MSEPitch, - MSEFallTime, - MSETransportGuidByte0_2, - MSETransportGuidByte1_2, - MSETransportGuidByte2_2, - MSETransportGuidByte3_2, - MSETransportGuidByte4_2, - MSETransportGuidByte5_2, - MSETransportGuidByte6_2, - MSETransportGuidByte7_2, - MSESplineElev, - MSEFallHorizontalSpeed, - MSEFallVerticalSpeed, - MSEFallCosAngle, - MSEFallSinAngle, - MSETransportSeat, - MSETransportPositionO, MSETransportPositionX, MSETransportPositionY, MSETransportPositionZ, + MSETransportOrientation, + MSETransportSeat, MSETransportTime, MSETransportTime2, MSETransportTime3, + MSEPitch, + MSEFallTime, + MSEFallVerticalSpeed, + MSEFallCosAngle, + MSEFallSinAngle, + MSEFallHorizontalSpeed, + MSESplineElev, + + // Special + MSEZeroBit, // writes bit value 1 or skips read bit + MSEOneBit, // writes bit value 0 or skips read bit + MSEEnd, // marks end of parsing MSE_COUNT }; + //4.2.2 MovementStatusElements PlayerMoveSequence[] = { - MSEHaveSplineElev, - MSEHaveTransportData, - MSEGuidByte5, - MSETransportGuidByte2, - MSETransportGuidByte4, - MSETransportGuidByte1, - MSETransportGuidByte3, - MSETransportGuidByte0, - MSETransportHaveTime2, - MSETransportGuidByte7, - MSETransportHaveTime3, - MSETransportGuidByte6, - MSETransportGuidByte5, - MSEGuidByte7, - MSEGuidByte3, - MSEGuidByte1, + MSEHasSplineElev, + MSEHasTransportData, + MSEHasGuidByte5, + MSEHasTransportGuidByte2, + MSEHasTransportGuidByte4, + MSEHasTransportGuidByte1, + MSEHasTransportGuidByte3, + MSEHasTransportGuidByte0, + MSEHasTransportTime2, + MSEHasTransportGuidByte7, + MSEHasTransportTime3, + MSEHasTransportGuidByte6, + MSEHasTransportGuidByte5, + MSEHasGuidByte7, + MSEHasGuidByte3, + MSEHasGuidByte1, + MSEHasGuidByte4, + MSEHasGuidByte0, + MSEMovementFlags, + MSEHasPitch, + MSEHasGuidByte2, + MSEMovementFlags2, + MSEHasGuidByte6, + MSEHasFallData, + MSEHasFallDirection, + MSEHasSpline, MSEGuidByte4, MSEGuidByte0, - MSEFlags, - MSEHavePitch, - MSEGuidByte2, - MSEFlags2, + MSEOrientation, MSEGuidByte6, - MSEHaveFallData, - MSEHaveFallDirection, - MSEHaveSpline, - MSEGuidByte4_2, - MSEGuidByte0_2, - MSEPositionO, - MSEGuidByte6_2, - MSEGuidByte7_2, + MSEGuidByte7, MSESplineElev, - MSETransportGuidByte4_2, - MSETransportGuidByte2_2, - MSETransportPositionO, + MSETransportGuidByte4, + MSETransportGuidByte2, + MSETransportOrientation, MSETransportTime, MSETransportSeat, - MSETransportGuidByte3_2, + MSETransportGuidByte3, MSETransportPositionX, MSETransportPositionY, MSETransportPositionZ, - MSETransportGuidByte1_2, + MSETransportGuidByte1, MSETransportTime2, MSETransportTime3, - MSETransportGuidByte5_2, - MSETransportGuidByte0_2, - MSETransportGuidByte6_2, - MSETransportGuidByte7_2, - MSEGuidByte2_2, + MSETransportGuidByte5, + MSETransportGuidByte0, + MSETransportGuidByte6, + MSETransportGuidByte7, + MSEGuidByte2, MSETimestamp, - MSEGuidByte1_2, + MSEGuidByte1, MSEPitch, MSEPositionX, MSEPositionY, MSEPositionZ, - MSEGuidByte5_2, - MSEGuidByte3_2, + MSEGuidByte5, + MSEGuidByte3, MSEFallHorizontalSpeed, MSEFallCosAngle, MSEFallSinAngle, MSEFallVerticalSpeed, MSEFallTime, }; + //4.2.2 MovementStatusElements MovementFallLandSequence[] = { - MSEGuidByte4, - MSEGuidByte6, - MSEGuidByte3, - MSEHaveSpline, - MSEGuidByte2, - MSEFlags, - MSEGuidByte7, - MSEGuidByte1, - MSEFlags2, - MSEGuidByte5, - MSEGuidByte0, - MSEHaveFallData, - MSEHaveFallDirection, - MSEHavePitch, - MSEHaveTransportData, - MSETransportGuidByte0, - MSETransportGuidByte6, - MSETransportGuidByte2, - MSETransportGuidByte5, - MSETransportGuidByte4, - MSETransportGuidByte1, - MSETransportGuidByte3, - MSETransportGuidByte7, - MSETransportHaveTime2, - MSETransportHaveTime3, - MSEHaveSplineElev, - MSEPositionO, + MSEHasGuidByte4, + MSEHasGuidByte6, + MSEHasGuidByte3, + MSEHasSpline, + MSEHasGuidByte2, + MSEMovementFlags, + MSEHasGuidByte7, + MSEHasGuidByte1, + MSEMovementFlags2, + MSEHasGuidByte5, + MSEHasGuidByte0, + MSEHasFallData, + MSEHasFallDirection, + MSEHasPitch, + MSEHasTransportData, + MSEHasTransportGuidByte0, + MSEHasTransportGuidByte6, + MSEHasTransportGuidByte2, + MSEHasTransportGuidByte5, + MSEHasTransportGuidByte4, + MSEHasTransportGuidByte1, + MSEHasTransportGuidByte3, + MSEHasTransportGuidByte7, + MSEHasTransportTime2, + MSEHasTransportTime3, + MSEHasSplineElev, + MSEOrientation, MSEPositionX, MSEPositionY, MSEPositionZ, MSETimestamp, - MSEGuidByte7_2, - MSEGuidByte2_2, + MSEGuidByte7, + MSEGuidByte2, MSEFallTime, MSEFallVerticalSpeed, MSEFallHorizontalSpeed, MSEFallCosAngle, MSEFallSinAngle, - MSEGuidByte0_2, + MSEGuidByte0, MSEPitch, - MSEGuidByte4_2, - MSEGuidByte6_2, - MSEGuidByte5_2, - MSEGuidByte3_2, + MSEGuidByte4, + MSEGuidByte6, + MSEGuidByte5, + MSEGuidByte3, MSETransportSeat, - MSETransportPositionO, + MSETransportOrientation, MSETransportPositionX, MSETransportPositionY, MSETransportPositionZ, MSETransportTime, MSETransportTime2, - MSETransportGuidByte3_2, - MSETransportGuidByte6_2, + MSETransportGuidByte3, + MSETransportGuidByte6, MSETransportTime3, - MSETransportGuidByte7_2, - MSETransportGuidByte5_2, - MSETransportGuidByte2_2, - MSETransportGuidByte1_2, - MSETransportGuidByte0_2, - MSETransportGuidByte4_2, + MSETransportGuidByte7, + MSETransportGuidByte5, + MSETransportGuidByte2, + MSETransportGuidByte1, + MSETransportGuidByte0, + MSETransportGuidByte4, MSESplineElev, - MSEGuidByte1_2, + MSEGuidByte1, }; + //4.2.2 MovementStatusElements MovementHeartBeatSequence[] = { - MSEFlags, - MSEHaveSpline, - MSEGuidByte0, - MSEGuidByte6, - MSEGuidByte1, - MSEGuidByte7, - MSEGuidByte2, - MSEGuidByte4, - MSEGuidByte3, - MSEFlags2, - MSEGuidByte5, - MSEHaveSplineElev, - MSEHaveTransportData, - MSETransportGuidByte0, - MSETransportGuidByte6, - MSETransportGuidByte2, - MSETransportGuidByte5, - MSETransportGuidByte4, - MSETransportGuidByte1, - MSETransportGuidByte3, - MSETransportGuidByte7, - MSETransportHaveTime2, - MSETransportHaveTime3, - MSEHavePitch, - MSEHaveFallData, - MSEHaveFallDirection, + MSEMovementFlags, + MSEHasSpline, + MSEHasGuidByte0, + MSEHasGuidByte6, + MSEHasGuidByte1, + MSEHasGuidByte7, + MSEHasGuidByte2, + MSEHasGuidByte4, + MSEHasGuidByte3, + MSEMovementFlags2, + MSEHasGuidByte5, + MSEHasSplineElev, + MSEHasTransportData, + MSEHasTransportGuidByte0, + MSEHasTransportGuidByte6, + MSEHasTransportGuidByte2, + MSEHasTransportGuidByte5, + MSEHasTransportGuidByte4, + MSEHasTransportGuidByte1, + MSEHasTransportGuidByte3, + MSEHasTransportGuidByte7, + MSEHasTransportTime2, + MSEHasTransportTime3, + MSEHasPitch, + MSEHasFallData, + MSEHasFallDirection, MSETimestamp, MSEPositionX, MSEPositionY, MSEPositionZ, - MSEPositionO, - MSEGuidByte7_2, - MSEGuidByte5_2, + MSEOrientation, + MSEGuidByte7, + MSEGuidByte5, MSESplineElev, - MSEGuidByte1_2, - MSEGuidByte6_2, - MSEGuidByte4_2, - MSEGuidByte3_2, + MSEGuidByte1, + MSEGuidByte6, + MSEGuidByte4, + MSEGuidByte3, MSETransportSeat, - MSETransportPositionO, + MSETransportOrientation, MSETransportPositionX, MSETransportPositionY, MSETransportPositionZ, MSETransportTime, MSETransportTime2, - MSETransportGuidByte3_2, - MSETransportGuidByte6_2, + MSETransportGuidByte3, + MSETransportGuidByte6, MSETransportTime3, - MSETransportGuidByte7_2, - MSETransportGuidByte5_2, - MSETransportGuidByte2_2, - MSETransportGuidByte1_2, - MSETransportGuidByte0_2, - MSETransportGuidByte4_2, + MSETransportGuidByte7, + MSETransportGuidByte5, + MSETransportGuidByte2, + MSETransportGuidByte1, + MSETransportGuidByte0, + MSETransportGuidByte4, MSEPitch, MSEFallTime, MSEFallVerticalSpeed, MSEFallHorizontalSpeed, MSEFallCosAngle, MSEFallSinAngle, - MSEGuidByte2_2, - MSEGuidByte0_2, + MSEGuidByte2, + MSEGuidByte0, }; + //4.2.2 MovementStatusElements MovementJumpSequence[] = { - MSEHaveSpline, - MSEGuidByte0, - MSEGuidByte1, - MSEGuidByte4, - MSEFlags, - MSEGuidByte2, - MSEGuidByte5, - MSEGuidByte3, - MSEFlags2, - MSEGuidByte7, - MSEGuidByte6, - MSEHaveSplineElev, - MSEHaveTransportData, - MSETransportGuidByte0, - MSETransportGuidByte6, - MSETransportGuidByte2, - MSETransportGuidByte5, - MSETransportGuidByte4, - MSETransportGuidByte1, - MSETransportGuidByte3, - MSETransportGuidByte7, - MSETransportHaveTime2, - MSETransportHaveTime3, - MSEHaveFallData, - MSEHaveFallDirection, - MSEHavePitch, - MSEPositionO, + MSEHasSpline, + MSEHasGuidByte0, + MSEHasGuidByte1, + MSEHasGuidByte4, + MSEMovementFlags, + MSEHasGuidByte2, + MSEHasGuidByte5, + MSEHasGuidByte3, + MSEMovementFlags2, + MSEHasGuidByte7, + MSEHasGuidByte6, + MSEHasSplineElev, + MSEHasTransportData, + MSEHasTransportGuidByte0, + MSEHasTransportGuidByte6, + MSEHasTransportGuidByte2, + MSEHasTransportGuidByte5, + MSEHasTransportGuidByte4, + MSEHasTransportGuidByte1, + MSEHasTransportGuidByte3, + MSEHasTransportGuidByte7, + MSEHasTransportTime2, + MSEHasTransportTime3, + MSEHasFallData, + MSEHasFallDirection, + MSEHasPitch, + MSEOrientation, MSETimestamp, MSEPositionX, MSEPositionY, MSEPositionZ, MSESplineElev, - MSEGuidByte0_2, - MSEGuidByte5_2, - MSEGuidByte3_2, + MSEGuidByte0, + MSEGuidByte5, + MSEGuidByte3, MSETransportSeat, - MSETransportPositionO, + MSETransportOrientation, MSETransportPositionX, MSETransportPositionY, MSETransportPositionZ, MSETransportTime, MSETransportTime2, - MSETransportGuidByte3_2, - MSETransportGuidByte6_2, + MSETransportGuidByte3, + MSETransportGuidByte6, MSETransportTime3, - MSETransportGuidByte7_2, - MSETransportGuidByte5_2, - MSETransportGuidByte2_2, - MSETransportGuidByte1_2, - MSETransportGuidByte0_2, - MSETransportGuidByte4_2, - MSEGuidByte4_2, - MSEGuidByte1_2, + MSETransportGuidByte7, + MSETransportGuidByte5, + MSETransportGuidByte2, + MSETransportGuidByte1, + MSETransportGuidByte0, + MSETransportGuidByte4, + MSEGuidByte4, + MSEGuidByte1, MSEFallTime, MSEFallVerticalSpeed, MSEFallHorizontalSpeed, MSEFallCosAngle, MSEFallSinAngle, - MSEGuidByte2_2, - MSEGuidByte6_2, - MSEGuidByte7_2, + MSEGuidByte2, + MSEGuidByte6, + MSEGuidByte7, MSEPitch, }; + //4.2.2 MovementStatusElements MovementSetFacingSequence[] = { - MSEFlags, - MSEGuidByte4, - MSEGuidByte2, - MSEHaveSpline, - MSEGuidByte3, - MSEGuidByte5, - MSEFlags2, - MSEGuidByte0, - MSEGuidByte7, - MSEGuidByte6, - MSEGuidByte1, - MSEHaveSplineElev, - MSEHavePitch, - MSEHaveFallData, - MSEHaveFallDirection, - MSEHaveTransportData, - MSETransportGuidByte0, - MSETransportGuidByte6, - MSETransportGuidByte2, - MSETransportGuidByte5, - MSETransportGuidByte4, - MSETransportGuidByte1, - MSETransportGuidByte3, - MSETransportGuidByte7, - MSETransportHaveTime2, - MSETransportHaveTime3, - MSEPositionO, + MSEMovementFlags, + MSEHasGuidByte4, + MSEHasGuidByte2, + MSEHasSpline, + MSEHasGuidByte3, + MSEHasGuidByte5, + MSEMovementFlags2, + MSEHasGuidByte0, + MSEHasGuidByte7, + MSEHasGuidByte6, + MSEHasGuidByte1, + MSEHasSplineElev, + MSEHasPitch, + MSEHasFallData, + MSEHasFallDirection, + MSEHasTransportData, + MSEHasTransportGuidByte0, + MSEHasTransportGuidByte6, + MSEHasTransportGuidByte2, + MSEHasTransportGuidByte5, + MSEHasTransportGuidByte4, + MSEHasTransportGuidByte1, + MSEHasTransportGuidByte3, + MSEHasTransportGuidByte7, + MSEHasTransportTime2, + MSEHasTransportTime3, + MSEOrientation, MSETimestamp, MSEPositionX, MSEPositionY, MSEPositionZ, - MSEGuidByte7_2, - MSEGuidByte5_2, + MSEGuidByte7, + MSEGuidByte5, MSESplineElev, - MSEGuidByte4_2, - MSEGuidByte1_2, - MSEGuidByte2_2, + MSEGuidByte4, + MSEGuidByte1, + MSEGuidByte2, MSEPitch, MSEFallTime, MSEFallVerticalSpeed, MSEFallHorizontalSpeed, MSEFallCosAngle, MSEFallSinAngle, - MSEGuidByte6_2, - MSEGuidByte0_2, + MSEGuidByte6, + MSEGuidByte0, MSETransportSeat, - MSETransportPositionO, + MSETransportOrientation, MSETransportPositionX, MSETransportPositionY, MSETransportPositionZ, MSETransportTime, MSETransportTime2, - MSETransportGuidByte3_2, - MSETransportGuidByte6_2, + MSETransportGuidByte3, + MSETransportGuidByte6, MSETransportTime3, - MSETransportGuidByte7_2, - MSETransportGuidByte5_2, - MSETransportGuidByte2_2, - MSETransportGuidByte1_2, - MSETransportGuidByte0_2, - MSETransportGuidByte4_2, - MSEGuidByte3_2, + MSETransportGuidByte7, + MSETransportGuidByte5, + MSETransportGuidByte2, + MSETransportGuidByte1, + MSETransportGuidByte0, + MSETransportGuidByte4, + MSEGuidByte3, }; + //4.2.2 MovementStatusElements MovementSetPitchSequence[] = { - MSEGuidByte1, - MSEGuidByte6, - MSEGuidByte7, - MSEGuidByte3, - MSEFlags, - MSEGuidByte5, - MSEGuidByte2, - MSEGuidByte0, - MSEHaveSpline, - MSEGuidByte4, - MSEFlags2, - MSEHaveSplineElev, - MSEHaveTransportData, - MSETransportGuidByte0, - MSETransportGuidByte6, - MSETransportGuidByte2, - MSETransportGuidByte5, - MSETransportGuidByte4, - MSETransportGuidByte1, - MSETransportGuidByte3, - MSETransportGuidByte7, - MSETransportHaveTime2, - MSETransportHaveTime3, - MSEHavePitch, - MSEHaveFallData, - MSEHaveFallDirection, + MSEHasGuidByte1, + MSEHasGuidByte6, + MSEHasGuidByte7, + MSEHasGuidByte3, + MSEMovementFlags, + MSEHasGuidByte5, + MSEHasGuidByte2, + MSEHasGuidByte0, + MSEHasSpline, + MSEHasGuidByte4, + MSEMovementFlags2, + MSEHasSplineElev, + MSEHasTransportData, + MSEHasTransportGuidByte0, + MSEHasTransportGuidByte6, + MSEHasTransportGuidByte2, + MSEHasTransportGuidByte5, + MSEHasTransportGuidByte4, + MSEHasTransportGuidByte1, + MSEHasTransportGuidByte3, + MSEHasTransportGuidByte7, + MSEHasTransportTime2, + MSEHasTransportTime3, + MSEHasPitch, + MSEHasFallData, + MSEHasFallDirection, MSEPositionX, MSEPositionY, MSEPositionZ, MSETimestamp, - MSEPositionO, - MSEGuidByte1_2, - MSEGuidByte4_2, + MSEOrientation, + MSEGuidByte1, + MSEGuidByte4, MSESplineElev, MSETransportSeat, - MSETransportPositionO, + MSETransportOrientation, MSETransportPositionX, MSETransportPositionY, MSETransportPositionZ, MSETransportTime, MSETransportTime2, - MSETransportGuidByte3_2, - MSETransportGuidByte6_2, + MSETransportGuidByte3, + MSETransportGuidByte6, MSETransportTime3, - MSETransportGuidByte7_2, - MSETransportGuidByte5_2, - MSETransportGuidByte2_2, - MSETransportGuidByte1_2, - MSETransportGuidByte0_2, - MSETransportGuidByte4_2, + MSETransportGuidByte7, + MSETransportGuidByte5, + MSETransportGuidByte2, + MSETransportGuidByte1, + MSETransportGuidByte0, + MSETransportGuidByte4, MSEPitch, - MSEGuidByte5_2, + MSEGuidByte5, MSEFallTime, MSEFallVerticalSpeed, MSEFallHorizontalSpeed, MSEFallCosAngle, MSEFallSinAngle, - MSEGuidByte0_2, - MSEGuidByte3_2, - MSEGuidByte6_2, - MSEGuidByte7_2, - MSEGuidByte2_2, + MSEGuidByte0, + MSEGuidByte3, + MSEGuidByte6, + MSEGuidByte7, + MSEGuidByte2, }; + //4.2.2 MovementStatusElements MovementStartBackwardSequence[] = { - MSEGuidByte5, - MSEFlags2, - MSEGuidByte2, - MSEGuidByte7, - MSEHaveSpline, - MSEFlags, - MSEGuidByte1, - MSEGuidByte3, - MSEGuidByte4, - MSEGuidByte6, - MSEGuidByte0, - MSEHaveSplineElev, - MSEHavePitch, - MSEHaveTransportData, - MSETransportGuidByte0, - MSETransportGuidByte6, - MSETransportGuidByte2, - MSETransportGuidByte5, - MSETransportGuidByte4, - MSETransportGuidByte1, - MSETransportGuidByte3, - MSETransportGuidByte7, - MSETransportHaveTime2, - MSETransportHaveTime3, - MSEHaveFallData, - MSEHaveFallDirection, - MSEPositionO, + MSEHasGuidByte5, + MSEMovementFlags2, + MSEHasGuidByte2, + MSEHasGuidByte7, + MSEHasSpline, + MSEMovementFlags, + MSEHasGuidByte1, + MSEHasGuidByte3, + MSEHasGuidByte4, + MSEHasGuidByte6, + MSEHasGuidByte0, + MSEHasSplineElev, + MSEHasPitch, + MSEHasTransportData, + MSEHasTransportGuidByte0, + MSEHasTransportGuidByte6, + MSEHasTransportGuidByte2, + MSEHasTransportGuidByte5, + MSEHasTransportGuidByte4, + MSEHasTransportGuidByte1, + MSEHasTransportGuidByte3, + MSEHasTransportGuidByte7, + MSEHasTransportTime2, + MSEHasTransportTime3, + MSEHasFallData, + MSEHasFallDirection, + MSEOrientation, MSEPositionX, MSEPositionY, MSEPositionZ, MSETimestamp, - MSEGuidByte3_2, - MSEGuidByte0_2, - MSEGuidByte1_2, + MSEGuidByte3, + MSEGuidByte0, + MSEGuidByte1, MSESplineElev, - MSEGuidByte4_2, + MSEGuidByte4, MSEPitch, - MSEGuidByte7_2, - MSEGuidByte2_2, - MSEGuidByte6_2, + MSEGuidByte7, + MSEGuidByte2, + MSEGuidByte6, MSETransportSeat, - MSETransportPositionO, + MSETransportOrientation, MSETransportPositionX, MSETransportPositionY, MSETransportPositionZ, MSETransportTime, MSETransportTime2, - MSETransportGuidByte3_2, - MSETransportGuidByte6_2, + MSETransportGuidByte3, + MSETransportGuidByte6, MSETransportTime3, - MSETransportGuidByte7_2, - MSETransportGuidByte5_2, - MSETransportGuidByte2_2, - MSETransportGuidByte1_2, - MSETransportGuidByte0_2, - MSETransportGuidByte4_2, - MSEGuidByte5_2, + MSETransportGuidByte7, + MSETransportGuidByte5, + MSETransportGuidByte2, + MSETransportGuidByte1, + MSETransportGuidByte0, + MSETransportGuidByte4, + MSEGuidByte5, MSEFallTime, MSEFallVerticalSpeed, MSEFallHorizontalSpeed, MSEFallCosAngle, MSEFallSinAngle, }; -//4.2.2 -MovementStatusElements MovementStartForwardSequence[] = { - MSEFlags, + +//4.3.3 +MovementStatusElements MovementStartForwardSequence[] = +{ + MSEPositionY, + MSEPositionZ, + MSEPositionX, + MSEHasGuidByte5, + MSEHasGuidByte2, + MSEHasGuidByte0, + MSEZeroBit, + MSEHasMovementFlags, + MSEHasGuidByte7, + MSEHasGuidByte3, + MSEHasGuidByte1, + MSEHasOrientation, + MSEHasGuidByte6, + MSEHasSpline, + MSEHasSplineElev, + MSEHasGuidByte4, + MSEHasTransportData, + MSEHasTimestamp, + MSEHasPitch, + MSEHasMovementFlags2, + MSEHasFallData, + MSEMovementFlags, + MSEHasTransportGuidByte3, + MSEHasTransportGuidByte4, + MSEHasTransportGuidByte6, + MSEHasTransportGuidByte2, + MSEHasTransportGuidByte5, + MSEHasTransportGuidByte0, + MSEHasTransportGuidByte7, + MSEHasTransportGuidByte1, + MSEHasTransportTime3, + MSEHasTransportTime2, + MSEHasFallDirection, + MSEMovementFlags2, + MSEGuidByte2, + MSEGuidByte4, + MSEGuidByte6, MSEGuidByte1, MSEGuidByte7, - MSEFlags2, - MSEGuidByte6, + MSEGuidByte3, MSEGuidByte5, - MSEHaveSpline, MSEGuidByte0, - MSEGuidByte3, - MSEGuidByte4, - MSEGuidByte2, - MSEHaveFallData, - MSEHaveFallDirection, - MSEHaveSplineElev, - MSEHaveTransportData, - MSETransportGuidByte0, - MSETransportGuidByte6, - MSETransportGuidByte2, - MSETransportGuidByte5, - MSETransportGuidByte4, - MSETransportGuidByte1, - MSETransportGuidByte3, - MSETransportGuidByte7, - MSETransportHaveTime2, - MSETransportHaveTime3, - MSEHavePitch, - MSEPositionX, - MSEPositionY, - MSEPositionZ, - MSETimestamp, - MSEPositionO, - MSEGuidByte2_2, - MSEGuidByte3_2, - MSEFallTime, MSEFallVerticalSpeed, MSEFallHorizontalSpeed, MSEFallCosAngle, MSEFallSinAngle, - MSESplineElev, - MSEGuidByte6_2, - MSEGuidByte0_2, - MSEGuidByte1_2, - MSEGuidByte7_2, - MSETransportSeat, - MSETransportPositionO, - MSETransportPositionX, + MSEFallTime, + MSETransportGuidByte3, MSETransportPositionY, MSETransportPositionZ, + MSETransportGuidByte1, + MSETransportGuidByte4, + MSETransportGuidByte7, + MSETransportOrientation, + MSETransportGuidByte2, + MSETransportPositionX, + MSETransportGuidByte5, + MSETransportTime3, MSETransportTime, + MSETransportGuidByte6, + MSETransportGuidByte0, + MSETransportSeat, MSETransportTime2, - MSETransportGuidByte3_2, - MSETransportGuidByte6_2, - MSETransportTime3, - MSETransportGuidByte7_2, - MSETransportGuidByte5_2, - MSETransportGuidByte2_2, - MSETransportGuidByte1_2, - MSETransportGuidByte0_2, - MSETransportGuidByte4_2, - MSEGuidByte5_2, - MSEGuidByte4_2, + MSESplineElev, MSEPitch, + MSEOrientation, + MSETimestamp, + + MSEEnd, }; + //4.2.2 MovementStatusElements MovementStartStrafeLeftSequence[] = { - MSEGuidByte5, - MSEFlags, - MSEHaveSpline, - MSEGuidByte6, - MSEGuidByte1, - MSEGuidByte2, - MSEFlags2, - MSEGuidByte7, - MSEGuidByte0, - MSEGuidByte3, - MSEGuidByte4, - MSEHavePitch, - MSEHaveSplineElev, - MSEHaveFallData, - MSEHaveFallDirection, - MSEHaveTransportData, - MSETransportGuidByte0, - MSETransportGuidByte6, - MSETransportGuidByte2, - MSETransportGuidByte5, - MSETransportGuidByte4, - MSETransportGuidByte1, - MSETransportGuidByte3, - MSETransportGuidByte7, - MSETransportHaveTime2, - MSETransportHaveTime3, + MSEHasGuidByte5, + MSEMovementFlags, + MSEHasSpline, + MSEHasGuidByte6, + MSEHasGuidByte1, + MSEHasGuidByte2, + MSEMovementFlags2, + MSEHasGuidByte7, + MSEHasGuidByte0, + MSEHasGuidByte3, + MSEHasGuidByte4, + MSEHasPitch, + MSEHasSplineElev, + MSEHasFallData, + MSEHasFallDirection, + MSEHasTransportData, + MSEHasTransportGuidByte0, + MSEHasTransportGuidByte6, + MSEHasTransportGuidByte2, + MSEHasTransportGuidByte5, + MSEHasTransportGuidByte4, + MSEHasTransportGuidByte1, + MSEHasTransportGuidByte3, + MSEHasTransportGuidByte7, + MSEHasTransportTime2, + MSEHasTransportTime3, MSEPositionX, MSEPositionY, MSEPositionZ, - MSEPositionO, + MSEOrientation, MSETimestamp, MSEPitch, MSESplineElev, - MSEGuidByte7_2, - MSEGuidByte5_2, + MSEGuidByte7, + MSEGuidByte5, MSEFallTime, MSEFallVerticalSpeed, MSEFallHorizontalSpeed, MSEFallCosAngle, MSEFallSinAngle, - MSEGuidByte4_2, - MSEGuidByte3_2, - MSEGuidByte2_2, - MSEGuidByte6_2, - MSEGuidByte0_2, - MSEGuidByte1_2, + MSEGuidByte4, + MSEGuidByte3, + MSEGuidByte2, + MSEGuidByte6, + MSEGuidByte0, + MSEGuidByte1, MSETransportSeat, - MSETransportPositionO, + MSETransportOrientation, MSETransportPositionX, MSETransportPositionY, MSETransportPositionZ, MSETransportTime, MSETransportTime2, - MSETransportGuidByte3_2, - MSETransportGuidByte6_2, + MSETransportGuidByte3, + MSETransportGuidByte6, MSETransportTime3, - MSETransportGuidByte7_2, - MSETransportGuidByte5_2, - MSETransportGuidByte2_2, - MSETransportGuidByte1_2, - MSETransportGuidByte0_2, - MSETransportGuidByte4_2, + MSETransportGuidByte7, + MSETransportGuidByte5, + MSETransportGuidByte2, + MSETransportGuidByte1, + MSETransportGuidByte0, + MSETransportGuidByte4, }; + //4.2.2 MovementStatusElements MovementStartStrafeRightSequence[] = { - MSEGuidByte3, - MSEGuidByte2, - MSEGuidByte4, - MSEGuidByte5, - MSEGuidByte0, - MSEGuidByte6, - MSEHaveSpline, - MSEFlags2, - MSEGuidByte1, - MSEFlags, - MSEGuidByte7, - MSEHaveSplineElev, - MSEHavePitch, - MSEHaveTransportData, - MSETransportGuidByte0, - MSETransportGuidByte6, - MSETransportGuidByte2, - MSETransportGuidByte5, - MSETransportGuidByte4, - MSETransportGuidByte1, - MSETransportGuidByte3, - MSETransportGuidByte7, - MSETransportHaveTime2, - MSETransportHaveTime3, - MSEHaveFallData, - MSEHaveFallDirection, - MSEPositionO, + MSEHasGuidByte3, + MSEHasGuidByte2, + MSEHasGuidByte4, + MSEHasGuidByte5, + MSEHasGuidByte0, + MSEHasGuidByte6, + MSEHasSpline, + MSEMovementFlags2, + MSEHasGuidByte1, + MSEMovementFlags, + MSEHasGuidByte7, + MSEHasSplineElev, + MSEHasPitch, + MSEHasTransportData, + MSEHasTransportGuidByte0, + MSEHasTransportGuidByte6, + MSEHasTransportGuidByte2, + MSEHasTransportGuidByte5, + MSEHasTransportGuidByte4, + MSEHasTransportGuidByte1, + MSEHasTransportGuidByte3, + MSEHasTransportGuidByte7, + MSEHasTransportTime2, + MSEHasTransportTime3, + MSEHasFallData, + MSEHasFallDirection, + MSEOrientation, MSETimestamp, MSEPositionX, MSEPositionY, MSEPositionZ, - MSEGuidByte4_2, - MSEGuidByte1_2, - MSEGuidByte2_2, + MSEGuidByte4, + MSEGuidByte1, + MSEGuidByte2, MSESplineElev, - MSEGuidByte0_2, + MSEGuidByte0, MSEPitch, - MSEGuidByte6_2, - MSEGuidByte3_2, - MSEGuidByte7_2, - MSEGuidByte5_2, + MSEGuidByte6, + MSEGuidByte3, + MSEGuidByte7, + MSEGuidByte5, MSETransportSeat, - MSETransportPositionO, + MSETransportOrientation, MSETransportPositionX, MSETransportPositionY, MSETransportPositionZ, MSETransportTime, MSETransportTime2, - MSETransportGuidByte3_2, - MSETransportGuidByte6_2, + MSETransportGuidByte3, + MSETransportGuidByte6, MSETransportTime3, - MSETransportGuidByte7_2, - MSETransportGuidByte5_2, - MSETransportGuidByte2_2, - MSETransportGuidByte1_2, - MSETransportGuidByte0_2, - MSETransportGuidByte4_2, + MSETransportGuidByte7, + MSETransportGuidByte5, + MSETransportGuidByte2, + MSETransportGuidByte1, + MSETransportGuidByte0, + MSETransportGuidByte4, MSEFallTime, MSEFallVerticalSpeed, MSEFallHorizontalSpeed, MSEFallCosAngle, MSEFallSinAngle, }; + //4.2.2 MovementStatusElements MovementStartTurnLeftSequence[] = { - MSEGuidByte5, - MSEGuidByte4, - MSEGuidByte6, - MSEGuidByte0, - MSEGuidByte1, - MSEGuidByte7, - MSEGuidByte2, - MSEGuidByte3, - MSEFlags, - MSEFlags2, - MSEHaveSpline, - MSEHaveTransportData, - MSETransportGuidByte0, - MSETransportGuidByte6, - MSETransportGuidByte2, - MSETransportGuidByte5, - MSETransportGuidByte4, - MSETransportGuidByte1, - MSETransportGuidByte3, - MSETransportGuidByte7, - MSETransportHaveTime2, - MSETransportHaveTime3, - MSEHaveSplineElev, - MSEHaveFallData, - MSEHaveFallDirection, - MSEHavePitch, + MSEHasGuidByte5, + MSEHasGuidByte4, + MSEHasGuidByte6, + MSEHasGuidByte0, + MSEHasGuidByte1, + MSEHasGuidByte7, + MSEHasGuidByte2, + MSEHasGuidByte3, + MSEMovementFlags, + MSEMovementFlags2, + MSEHasSpline, + MSEHasTransportData, + MSEHasTransportGuidByte0, + MSEHasTransportGuidByte6, + MSEHasTransportGuidByte2, + MSEHasTransportGuidByte5, + MSEHasTransportGuidByte4, + MSEHasTransportGuidByte1, + MSEHasTransportGuidByte3, + MSEHasTransportGuidByte7, + MSEHasTransportTime2, + MSEHasTransportTime3, + MSEHasSplineElev, + MSEHasFallData, + MSEHasFallDirection, + MSEHasPitch, MSEPositionX, MSEPositionY, MSEPositionZ, MSETimestamp, - MSEPositionO, + MSEOrientation, MSETransportSeat, - MSETransportPositionO, + MSETransportOrientation, MSETransportPositionX, MSETransportPositionY, MSETransportPositionZ, MSETransportTime, MSETransportTime2, - MSETransportGuidByte3_2, - MSETransportGuidByte6_2, + MSETransportGuidByte3, + MSETransportGuidByte6, MSETransportTime3, - MSETransportGuidByte7_2, - MSETransportGuidByte5_2, - MSETransportGuidByte2_2, - MSETransportGuidByte1_2, - MSETransportGuidByte0_2, - MSETransportGuidByte4_2, - MSEGuidByte4_2, - MSEGuidByte0_2, - MSEGuidByte7_2, - MSEGuidByte1_2, - MSEGuidByte6_2, - MSEGuidByte5_2, - MSEGuidByte3_2, - MSESplineElev, - MSEFallTime, - MSEFallVerticalSpeed, - MSEFallHorizontalSpeed, - MSEFallCosAngle, - MSEFallSinAngle, - MSEGuidByte2_2, - MSEPitch, -}; -//4.2.2 -MovementStatusElements MovementStartTurnRightSequence[] = { + MSETransportGuidByte7, + MSETransportGuidByte5, + MSETransportGuidByte2, + MSETransportGuidByte1, + MSETransportGuidByte0, + MSETransportGuidByte4, MSEGuidByte4, + MSEGuidByte0, + MSEGuidByte7, MSEGuidByte1, MSEGuidByte6, - MSEGuidByte0, - MSEFlags, MSEGuidByte5, - MSEFlags2, - MSEHaveSpline, - MSEGuidByte2, MSEGuidByte3, - MSEGuidByte7, - MSEHaveTransportData, - MSETransportGuidByte0, - MSETransportGuidByte6, - MSETransportGuidByte2, - MSETransportGuidByte5, - MSETransportGuidByte4, - MSETransportGuidByte1, - MSETransportGuidByte3, - MSETransportGuidByte7, - MSETransportHaveTime2, - MSETransportHaveTime3, - MSEHaveFallData, - MSEHaveFallDirection, - MSEHavePitch, - MSEHaveSplineElev, + MSESplineElev, + MSEFallTime, + MSEFallVerticalSpeed, + MSEFallHorizontalSpeed, + MSEFallCosAngle, + MSEFallSinAngle, + MSEGuidByte2, + MSEPitch, +}; + +//4.2.2 +MovementStatusElements MovementStartTurnRightSequence[] = { + MSEHasGuidByte4, + MSEHasGuidByte1, + MSEHasGuidByte6, + MSEHasGuidByte0, + MSEMovementFlags, + MSEHasGuidByte5, + MSEMovementFlags2, + MSEHasSpline, + MSEHasGuidByte2, + MSEHasGuidByte3, + MSEHasGuidByte7, + MSEHasTransportData, + MSEHasTransportGuidByte0, + MSEHasTransportGuidByte6, + MSEHasTransportGuidByte2, + MSEHasTransportGuidByte5, + MSEHasTransportGuidByte4, + MSEHasTransportGuidByte1, + MSEHasTransportGuidByte3, + MSEHasTransportGuidByte7, + MSEHasTransportTime2, + MSEHasTransportTime3, + MSEHasFallData, + MSEHasFallDirection, + MSEHasPitch, + MSEHasSplineElev, MSEPositionX, MSEPositionY, MSEPositionZ, - MSEPositionO, + MSEOrientation, MSETimestamp, - MSEGuidByte6_2, + MSEGuidByte6, MSETransportSeat, - MSETransportPositionO, + MSETransportOrientation, MSETransportPositionX, MSETransportPositionY, MSETransportPositionZ, MSETransportTime, MSETransportTime2, - MSETransportGuidByte3_2, - MSETransportGuidByte6_2, + MSETransportGuidByte3, + MSETransportGuidByte6, MSETransportTime3, - MSETransportGuidByte7_2, - MSETransportGuidByte5_2, - MSETransportGuidByte2_2, - MSETransportGuidByte1_2, - MSETransportGuidByte0_2, - MSETransportGuidByte4_2, - MSEGuidByte2_2, - MSEGuidByte4_2, + MSETransportGuidByte7, + MSETransportGuidByte5, + MSETransportGuidByte2, + MSETransportGuidByte1, + MSETransportGuidByte0, + MSETransportGuidByte4, + MSEGuidByte2, + MSEGuidByte4, MSEFallTime, MSEFallVerticalSpeed, MSEFallHorizontalSpeed, MSEFallCosAngle, MSEFallSinAngle, MSEPitch, - MSEGuidByte7_2, - MSEGuidByte3_2, - MSEGuidByte1_2, - MSEGuidByte0_2, + MSEGuidByte7, + MSEGuidByte3, + MSEGuidByte1, + MSEGuidByte0, MSESplineElev, - MSEGuidByte5_2, + MSEGuidByte5, }; + //4.2.2 MovementStatusElements MovementStopSequence[] = { - MSEGuidByte2, - MSEGuidByte0, - MSEHaveSpline, - MSEFlags, - MSEGuidByte4, - MSEGuidByte6, - MSEGuidByte3, - MSEGuidByte5, - MSEGuidByte7, - MSEFlags2, - MSEGuidByte1, - MSEHavePitch, - MSEHaveFallData, - MSEHaveFallDirection, - MSEHaveTransportData, - MSETransportGuidByte0, - MSETransportGuidByte6, - MSETransportGuidByte2, - MSETransportGuidByte5, - MSETransportGuidByte4, - MSETransportGuidByte1, - MSETransportGuidByte3, - MSETransportGuidByte7, - MSETransportHaveTime2, - MSETransportHaveTime3, - MSEHaveSplineElev, - MSEPositionO, + MSEHasGuidByte2, + MSEHasGuidByte0, + MSEHasSpline, + MSEMovementFlags, + MSEHasGuidByte4, + MSEHasGuidByte6, + MSEHasGuidByte3, + MSEHasGuidByte5, + MSEHasGuidByte7, + MSEMovementFlags2, + MSEHasGuidByte1, + MSEHasPitch, + MSEHasFallData, + MSEHasFallDirection, + MSEHasTransportData, + MSEHasTransportGuidByte0, + MSEHasTransportGuidByte6, + MSEHasTransportGuidByte2, + MSEHasTransportGuidByte5, + MSEHasTransportGuidByte4, + MSEHasTransportGuidByte1, + MSEHasTransportGuidByte3, + MSEHasTransportGuidByte7, + MSEHasTransportTime2, + MSEHasTransportTime3, + MSEHasSplineElev, + MSEOrientation, MSETimestamp, MSEPositionX, MSEPositionY, MSEPositionZ, - MSEGuidByte2_2, - MSEGuidByte3_2, + MSEGuidByte2, + MSEGuidByte3, MSEPitch, MSEFallTime, MSEFallVerticalSpeed, MSEFallHorizontalSpeed, MSEFallCosAngle, MSEFallSinAngle, - MSEGuidByte5_2, - MSEGuidByte7_2, + MSEGuidByte5, + MSEGuidByte7, MSETransportSeat, - MSETransportPositionO, + MSETransportOrientation, MSETransportPositionX, MSETransportPositionY, MSETransportPositionZ, MSETransportTime, MSETransportTime2, - MSETransportGuidByte3_2, - MSETransportGuidByte6_2, + MSETransportGuidByte3, + MSETransportGuidByte6, MSETransportTime3, - MSETransportGuidByte7_2, - MSETransportGuidByte5_2, - MSETransportGuidByte2_2, - MSETransportGuidByte1_2, - MSETransportGuidByte0_2, - MSETransportGuidByte4_2, - MSEGuidByte1_2, - MSEGuidByte0_2, + MSETransportGuidByte7, + MSETransportGuidByte5, + MSETransportGuidByte2, + MSETransportGuidByte1, + MSETransportGuidByte0, + MSETransportGuidByte4, + MSEGuidByte1, + MSEGuidByte0, MSESplineElev, - MSEGuidByte6_2, - MSEGuidByte4_2, + MSEGuidByte6, + MSEGuidByte4, }; + //4.2.2 MovementStatusElements MovementStopStrafeSequence[] = { - MSEGuidByte4, - MSEFlags2, - MSEGuidByte3, - MSEGuidByte1, - MSEFlags, - MSEGuidByte5, - MSEHaveSpline, - MSEGuidByte2, - MSEGuidByte6, - MSEGuidByte0, - MSEGuidByte7, - MSEHaveFallData, - MSEHaveFallDirection, - MSEHavePitch, - MSEHaveSplineElev, - MSEHaveTransportData, - MSETransportGuidByte0, - MSETransportGuidByte6, - MSETransportGuidByte2, - MSETransportGuidByte5, - MSETransportGuidByte4, - MSETransportGuidByte1, - MSETransportGuidByte3, - MSETransportGuidByte7, - MSETransportHaveTime2, - MSETransportHaveTime3, - MSEPositionO, + MSEHasGuidByte4, + MSEMovementFlags2, + MSEHasGuidByte3, + MSEHasGuidByte1, + MSEMovementFlags, + MSEHasGuidByte5, + MSEHasSpline, + MSEHasGuidByte2, + MSEHasGuidByte6, + MSEHasGuidByte0, + MSEHasGuidByte7, + MSEHasFallData, + MSEHasFallDirection, + MSEHasPitch, + MSEHasSplineElev, + MSEHasTransportData, + MSEHasTransportGuidByte0, + MSEHasTransportGuidByte6, + MSEHasTransportGuidByte2, + MSEHasTransportGuidByte5, + MSEHasTransportGuidByte4, + MSEHasTransportGuidByte1, + MSEHasTransportGuidByte3, + MSEHasTransportGuidByte7, + MSEHasTransportTime2, + MSEHasTransportTime3, + MSEOrientation, MSETimestamp, MSEPositionX, MSEPositionY, MSEPositionZ, - MSEGuidByte1_2, - MSEGuidByte2_2, - MSEGuidByte6_2, - MSEGuidByte5_2, - MSEGuidByte7_2, - MSEGuidByte0_2, + MSEGuidByte1, + MSEGuidByte2, + MSEGuidByte6, + MSEGuidByte5, + MSEGuidByte7, + MSEGuidByte0, MSEFallTime, MSEFallVerticalSpeed, MSEFallHorizontalSpeed, MSEFallCosAngle, MSEFallSinAngle, - MSEGuidByte3_2, + MSEGuidByte3, MSEPitch, MSESplineElev, MSETransportSeat, - MSETransportPositionO, + MSETransportOrientation, MSETransportPositionX, MSETransportPositionY, MSETransportPositionZ, MSETransportTime, MSETransportTime2, - MSETransportGuidByte3_2, - MSETransportGuidByte6_2, + MSETransportGuidByte3, + MSETransportGuidByte6, MSETransportTime3, - MSETransportGuidByte7_2, - MSETransportGuidByte5_2, - MSETransportGuidByte2_2, - MSETransportGuidByte1_2, - MSETransportGuidByte0_2, - MSETransportGuidByte4_2, - MSEGuidByte4_2, + MSETransportGuidByte7, + MSETransportGuidByte5, + MSETransportGuidByte2, + MSETransportGuidByte1, + MSETransportGuidByte0, + MSETransportGuidByte4, + MSEGuidByte4, }; + //4.2.2 MovementStatusElements MovementStopTurnSequence[] = { - MSEGuidByte6, - MSEFlags, - MSEGuidByte2, - MSEGuidByte3, - MSEFlags2, - MSEGuidByte5, - MSEGuidByte7, - MSEGuidByte0, - MSEGuidByte4, - MSEGuidByte1, - MSEHaveSpline, - MSEHavePitch, - MSEHaveFallData, - MSEHaveFallDirection, - MSEHaveSplineElev, - MSEHaveTransportData, - MSETransportGuidByte0, - MSETransportGuidByte6, - MSETransportGuidByte2, - MSETransportGuidByte5, - MSETransportGuidByte4, - MSETransportGuidByte1, - MSETransportGuidByte3, - MSETransportGuidByte7, - MSETransportHaveTime2, - MSETransportHaveTime3, + MSEHasGuidByte6, + MSEMovementFlags, + MSEHasGuidByte2, + MSEHasGuidByte3, + MSEMovementFlags2, + MSEHasGuidByte5, + MSEHasGuidByte7, + MSEHasGuidByte0, + MSEHasGuidByte4, + MSEHasGuidByte1, + MSEHasSpline, + MSEHasPitch, + MSEHasFallData, + MSEHasFallDirection, + MSEHasSplineElev, + MSEHasTransportData, + MSEHasTransportGuidByte0, + MSEHasTransportGuidByte6, + MSEHasTransportGuidByte2, + MSEHasTransportGuidByte5, + MSEHasTransportGuidByte4, + MSEHasTransportGuidByte1, + MSEHasTransportGuidByte3, + MSEHasTransportGuidByte7, + MSEHasTransportTime2, + MSEHasTransportTime3, MSETimestamp, MSEPositionX, MSEPositionY, MSEPositionZ, - MSEPositionO, - MSEGuidByte4_2, - MSEGuidByte5_2, - MSEGuidByte7_2, - MSEGuidByte1_2, + MSEOrientation, + MSEGuidByte4, + MSEGuidByte5, + MSEGuidByte7, + MSEGuidByte1, MSEPitch, - MSEGuidByte3_2, - MSEGuidByte6_2, + MSEGuidByte3, + MSEGuidByte6, MSEFallTime, MSEFallVerticalSpeed, MSEFallHorizontalSpeed, MSEFallCosAngle, MSEFallSinAngle, MSESplineElev, - MSEGuidByte0_2, - MSEGuidByte2_2, + MSEGuidByte0, + MSEGuidByte2, MSETransportSeat, - MSETransportPositionO, + MSETransportOrientation, MSETransportPositionX, MSETransportPositionY, MSETransportPositionZ, MSETransportTime, MSETransportTime2, - MSETransportGuidByte3_2, - MSETransportGuidByte6_2, + MSETransportGuidByte3, + MSETransportGuidByte6, MSETransportTime3, - MSETransportGuidByte7_2, - MSETransportGuidByte5_2, - MSETransportGuidByte2_2, - MSETransportGuidByte1_2, - MSETransportGuidByte0_2, - MSETransportGuidByte4_2, + MSETransportGuidByte7, + MSETransportGuidByte5, + MSETransportGuidByte2, + MSETransportGuidByte1, + MSETransportGuidByte0, + MSETransportGuidByte4, }; + //4.2.2 MovementStatusElements MovementStartAscendSequence[] = { - MSEGuidByte3, - MSEGuidByte1, - MSEGuidByte5, - MSEFlags, - MSEGuidByte4, - MSEGuidByte6, - MSEGuidByte0, - MSEGuidByte7, - MSEFlags2, - MSEGuidByte2, - MSEHaveSpline, - MSEHaveFallData, - MSEHaveFallDirection, - MSEHavePitch, - MSEHaveSplineElev, - MSEHaveTransportData, - MSETransportGuidByte0, - MSETransportGuidByte6, - MSETransportGuidByte2, - MSETransportGuidByte5, - MSETransportGuidByte4, - MSETransportGuidByte1, - MSETransportGuidByte3, - MSETransportGuidByte7, - MSETransportHaveTime2, - MSETransportHaveTime3, + MSEHasGuidByte3, + MSEHasGuidByte1, + MSEHasGuidByte5, + MSEMovementFlags, + MSEHasGuidByte4, + MSEHasGuidByte6, + MSEHasGuidByte0, + MSEHasGuidByte7, + MSEMovementFlags2, + MSEHasGuidByte2, + MSEHasSpline, + MSEHasFallData, + MSEHasFallDirection, + MSEHasPitch, + MSEHasSplineElev, + MSEHasTransportData, + MSEHasTransportGuidByte0, + MSEHasTransportGuidByte6, + MSEHasTransportGuidByte2, + MSEHasTransportGuidByte5, + MSEHasTransportGuidByte4, + MSEHasTransportGuidByte1, + MSEHasTransportGuidByte3, + MSEHasTransportGuidByte7, + MSEHasTransportTime2, + MSEHasTransportTime3, MSEPositionX, MSEPositionY, MSEPositionZ, MSETimestamp, - MSEPositionO, - MSEGuidByte3_2, + MSEOrientation, + MSEGuidByte3, MSEFallTime, MSEFallVerticalSpeed, MSEFallHorizontalSpeed, MSEFallCosAngle, MSEFallSinAngle, MSEPitch, - MSEGuidByte0_2, - MSEGuidByte5_2, + MSEGuidByte0, + MSEGuidByte5, MSESplineElev, - MSEGuidByte1_2, + MSEGuidByte1, MSETransportSeat, - MSETransportPositionO, + MSETransportOrientation, MSETransportPositionX, MSETransportPositionY, MSETransportPositionZ, MSETransportTime, MSETransportTime2, - MSETransportGuidByte3_2, - MSETransportGuidByte6_2, + MSETransportGuidByte3, + MSETransportGuidByte6, MSETransportTime3, - MSETransportGuidByte7_2, - MSETransportGuidByte5_2, - MSETransportGuidByte2_2, - MSETransportGuidByte1_2, - MSETransportGuidByte0_2, - MSETransportGuidByte4_2, - MSEGuidByte4_2, - MSEGuidByte7_2, - MSEGuidByte2_2, - MSEGuidByte6_2, -}; -//4.2.2 -MovementStatusElements MovementStartDescendSequence[] = { - MSEGuidByte6, - MSEGuidByte1, - MSEGuidByte0, - MSEGuidByte3, - MSEFlags, + MSETransportGuidByte7, + MSETransportGuidByte5, + MSETransportGuidByte2, + MSETransportGuidByte1, + MSETransportGuidByte0, + MSETransportGuidByte4, MSEGuidByte4, MSEGuidByte7, - MSEHaveSpline, - MSEGuidByte5, - MSEFlags2, MSEGuidByte2, - MSEHaveSplineElev, - MSEHaveFallData, - MSEHaveFallDirection, - MSEHaveTransportData, - MSETransportGuidByte0, - MSETransportGuidByte6, - MSETransportGuidByte2, - MSETransportGuidByte5, - MSETransportGuidByte4, - MSETransportGuidByte1, - MSETransportGuidByte3, - MSETransportGuidByte7, - MSETransportHaveTime2, - MSETransportHaveTime3, - MSEHavePitch, + MSEGuidByte6, +}; + +//4.2.2 +MovementStatusElements MovementStartDescendSequence[] = { + MSEHasGuidByte6, + MSEHasGuidByte1, + MSEHasGuidByte0, + MSEHasGuidByte3, + MSEMovementFlags, + MSEHasGuidByte4, + MSEHasGuidByte7, + MSEHasSpline, + MSEHasGuidByte5, + MSEMovementFlags2, + MSEHasGuidByte2, + MSEHasSplineElev, + MSEHasFallData, + MSEHasFallDirection, + MSEHasTransportData, + MSEHasTransportGuidByte0, + MSEHasTransportGuidByte6, + MSEHasTransportGuidByte2, + MSEHasTransportGuidByte5, + MSEHasTransportGuidByte4, + MSEHasTransportGuidByte1, + MSEHasTransportGuidByte3, + MSEHasTransportGuidByte7, + MSEHasTransportTime2, + MSEHasTransportTime3, + MSEHasPitch, MSETimestamp, MSEPositionX, MSEPositionY, MSEPositionZ, - MSEPositionO, + MSEOrientation, MSESplineElev, - MSEGuidByte7_2, - MSEGuidByte4_2, - MSEGuidByte2_2, - MSEGuidByte5_2, + MSEGuidByte7, + MSEGuidByte4, + MSEGuidByte2, + MSEGuidByte5, MSEFallTime, MSEFallVerticalSpeed, MSEFallHorizontalSpeed, MSEFallCosAngle, MSEFallSinAngle, - MSEGuidByte6_2, + MSEGuidByte6, MSETransportSeat, - MSETransportPositionO, + MSETransportOrientation, MSETransportPositionX, MSETransportPositionY, MSETransportPositionZ, MSETransportTime, MSETransportTime2, - MSETransportGuidByte3_2, - MSETransportGuidByte6_2, + MSETransportGuidByte3, + MSETransportGuidByte6, MSETransportTime3, - MSETransportGuidByte7_2, - MSETransportGuidByte5_2, - MSETransportGuidByte2_2, - MSETransportGuidByte1_2, - MSETransportGuidByte0_2, - MSETransportGuidByte4_2, - MSEGuidByte0_2, - MSEGuidByte3_2, - MSEGuidByte1_2, + MSETransportGuidByte7, + MSETransportGuidByte5, + MSETransportGuidByte2, + MSETransportGuidByte1, + MSETransportGuidByte0, + MSETransportGuidByte4, + MSEGuidByte0, + MSEGuidByte3, + MSEGuidByte1, MSEPitch, }; + //4.2.2 MovementStatusElements MovementStartSwimSequence[] = { - MSEGuidByte2, - MSEHaveSpline, - MSEGuidByte1, - MSEFlags, - MSEGuidByte3, - MSEGuidByte5, - MSEGuidByte0, - MSEGuidByte6, - MSEGuidByte7, - MSEFlags2, - MSEGuidByte4, - MSEHavePitch, - MSEHaveSplineElev, - MSEHaveFallData, - MSEHaveFallDirection, - MSEHaveTransportData, - MSETransportGuidByte0, - MSETransportGuidByte6, - MSETransportGuidByte2, - MSETransportGuidByte5, - MSETransportGuidByte4, - MSETransportGuidByte1, - MSETransportGuidByte3, - MSETransportGuidByte7, - MSETransportHaveTime2, - MSETransportHaveTime3, + MSEHasGuidByte2, + MSEHasSpline, + MSEHasGuidByte1, + MSEMovementFlags, + MSEHasGuidByte3, + MSEHasGuidByte5, + MSEHasGuidByte0, + MSEHasGuidByte6, + MSEHasGuidByte7, + MSEMovementFlags2, + MSEHasGuidByte4, + MSEHasPitch, + MSEHasSplineElev, + MSEHasFallData, + MSEHasFallDirection, + MSEHasTransportData, + MSEHasTransportGuidByte0, + MSEHasTransportGuidByte6, + MSEHasTransportGuidByte2, + MSEHasTransportGuidByte5, + MSEHasTransportGuidByte4, + MSEHasTransportGuidByte1, + MSEHasTransportGuidByte3, + MSEHasTransportGuidByte7, + MSEHasTransportTime2, + MSEHasTransportTime3, MSEPositionX, MSEPositionY, MSEPositionZ, - MSEPositionO, + MSEOrientation, MSETimestamp, MSEPitch, MSESplineElev, - MSEGuidByte2_2, - MSEGuidByte0_2, - MSEGuidByte5_2, - MSEGuidByte4_2, - MSEGuidByte7_2, - MSEGuidByte1_2, + MSEGuidByte2, + MSEGuidByte0, + MSEGuidByte5, + MSEGuidByte4, + MSEGuidByte7, + MSEGuidByte1, MSEFallTime, MSEFallVerticalSpeed, MSEFallHorizontalSpeed, MSEFallCosAngle, MSEFallSinAngle, - MSEGuidByte3_2, + MSEGuidByte3, MSETransportSeat, - MSETransportPositionO, + MSETransportOrientation, MSETransportPositionX, MSETransportPositionY, MSETransportPositionZ, MSETransportTime, MSETransportTime2, - MSETransportGuidByte3_2, - MSETransportGuidByte6_2, + MSETransportGuidByte3, + MSETransportGuidByte6, MSETransportTime3, - MSETransportGuidByte7_2, - MSETransportGuidByte5_2, - MSETransportGuidByte2_2, - MSETransportGuidByte1_2, - MSETransportGuidByte0_2, - MSETransportGuidByte4_2, - MSEGuidByte6_2, + MSETransportGuidByte7, + MSETransportGuidByte5, + MSETransportGuidByte2, + MSETransportGuidByte1, + MSETransportGuidByte0, + MSETransportGuidByte4, + MSEGuidByte6, }; + //4.2.2 MovementStatusElements MovementStopAscendSequence[] = { - MSEGuidByte0, - MSEGuidByte3, - MSEFlags2, - MSEGuidByte1, - MSEGuidByte5, - MSEHaveSpline, - MSEGuidByte4, - MSEGuidByte2, - MSEFlags, - MSEGuidByte7, - MSEGuidByte6, - MSEHaveFallData, - MSEHaveFallDirection, - MSEHaveTransportData, - MSETransportGuidByte0, - MSETransportGuidByte6, - MSETransportGuidByte2, - MSETransportGuidByte5, - MSETransportGuidByte4, - MSETransportGuidByte1, - MSETransportGuidByte3, - MSETransportGuidByte7, - MSETransportHaveTime2, - MSETransportHaveTime3, - MSEHavePitch, - MSEHaveSplineElev, + MSEHasGuidByte0, + MSEHasGuidByte3, + MSEMovementFlags2, + MSEHasGuidByte1, + MSEHasGuidByte5, + MSEHasSpline, + MSEHasGuidByte4, + MSEHasGuidByte2, + MSEMovementFlags, + MSEHasGuidByte7, + MSEHasGuidByte6, + MSEHasFallData, + MSEHasFallDirection, + MSEHasTransportData, + MSEHasTransportGuidByte0, + MSEHasTransportGuidByte6, + MSEHasTransportGuidByte2, + MSEHasTransportGuidByte5, + MSEHasTransportGuidByte4, + MSEHasTransportGuidByte1, + MSEHasTransportGuidByte3, + MSEHasTransportGuidByte7, + MSEHasTransportTime2, + MSEHasTransportTime3, + MSEHasPitch, + MSEHasSplineElev, MSETimestamp, - MSEPositionO, + MSEOrientation, MSEPositionX, MSEPositionY, MSEPositionZ, - MSEGuidByte0_2, - MSEGuidByte1_2, - MSEGuidByte2_2, - MSEGuidByte7_2, + MSEGuidByte0, + MSEGuidByte1, + MSEGuidByte2, + MSEGuidByte7, MSEFallTime, MSEFallVerticalSpeed, MSEFallHorizontalSpeed, MSEFallCosAngle, MSEFallSinAngle, MSETransportSeat, - MSETransportPositionO, + MSETransportOrientation, MSETransportPositionX, MSETransportPositionY, MSETransportPositionZ, MSETransportTime, MSETransportTime2, - MSETransportGuidByte3_2, - MSETransportGuidByte6_2, + MSETransportGuidByte3, + MSETransportGuidByte6, MSETransportTime3, - MSETransportGuidByte7_2, - MSETransportGuidByte5_2, - MSETransportGuidByte2_2, - MSETransportGuidByte1_2, - MSETransportGuidByte0_2, - MSETransportGuidByte4_2, + MSETransportGuidByte7, + MSETransportGuidByte5, + MSETransportGuidByte2, + MSETransportGuidByte1, + MSETransportGuidByte0, + MSETransportGuidByte4, MSEPitch, - MSEGuidByte5_2, - MSEGuidByte4_2, - MSEGuidByte3_2, + MSEGuidByte5, + MSEGuidByte4, + MSEGuidByte3, MSESplineElev, - MSEGuidByte6_2, + MSEGuidByte6, }; MovementStatusElements* GetMovementStatusElementsSequence(Opcodes opcode) { - switch(opcode) + switch (opcode) { - case SMSG_PLAYER_MOVE: - return PlayerMoveSequence; - case MSG_MOVE_FALL_LAND: - return MovementFallLandSequence; + //case SMSG_PLAYER_MOVE: + // return PlayerMoveSequence; + //case MSG_MOVE_FALL_LAND: + // return MovementFallLandSequence; //case MSG_MOVE_HEARTBEAT: // return MovementHeartBeatSequence; - case MSG_MOVE_JUMP: - return MovementJumpSequence; + //case MSG_MOVE_JUMP: + // return MovementJumpSequence; //case MSG_MOVE_SET_FACING: // return MovementSetFacingSequence; //case MSG_MOVE_SET_PITCH: // return MovementSetPitchSequence; - case MSG_MOVE_START_BACKWARD: - return MovementStartBackwardSequence; + //case MSG_MOVE_START_BACKWARD: + // return MovementStartBackwardSequence; case MSG_MOVE_START_FORWARD: return MovementStartForwardSequence; - case MSG_MOVE_START_STRAFE_LEFT: - return MovementStartStrafeLeftSequence; - case MSG_MOVE_START_STRAFE_RIGHT: - return MovementStartStrafeRightSequence; - case MSG_MOVE_START_TURN_LEFT: - return MovementStartTurnLeftSequence; - case MSG_MOVE_START_TURN_RIGHT: - return MovementStartTurnRightSequence; - case MSG_MOVE_STOP: - return MovementStopSequence; - case MSG_MOVE_STOP_STRAFE: - return MovementStopStrafeSequence; - case MSG_MOVE_STOP_TURN: - return MovementStopTurnSequence; - case MSG_MOVE_START_ASCEND: - return MovementStartAscendSequence; - case MSG_MOVE_START_DESCEND: - return MovementStartDescendSequence; - case MSG_MOVE_START_SWIM: - return MovementStartSwimSequence; - case MSG_MOVE_STOP_ASCEND: - return MovementStopAscendSequence; + //case MSG_MOVE_START_STRAFE_LEFT: + // return MovementStartStrafeLeftSequence; + //case MSG_MOVE_START_STRAFE_RIGHT: + // return MovementStartStrafeRightSequence; + //case MSG_MOVE_START_TURN_LEFT: + // return MovementStartTurnLeftSequence; + //case MSG_MOVE_START_TURN_RIGHT: + // return MovementStartTurnRightSequence; + //case MSG_MOVE_STOP: + // return MovementStopSequence; + //case MSG_MOVE_STOP_STRAFE: + // return MovementStopStrafeSequence; + //case MSG_MOVE_STOP_TURN: + // return MovementStopTurnSequence; + //case MSG_MOVE_START_ASCEND: + // return MovementStartAscendSequence; + //case MSG_MOVE_START_DESCEND: + // return MovementStartDescendSequence; + //case MSG_MOVE_START_SWIM: + // return MovementStartSwimSequence; + //case MSG_MOVE_STOP_ASCEND: + // return MovementStopAscendSequence; default: break; } + return NULL; } diff --git a/src/server/game/Movement/Spline/MoveSplineInit.cpp b/src/server/game/Movement/Spline/MoveSplineInit.cpp index c539dd3cc39..ba5c59c1078 100644 --- a/src/server/game/Movement/Spline/MoveSplineInit.cpp +++ b/src/server/game/Movement/Spline/MoveSplineInit.cpp @@ -63,7 +63,7 @@ namespace Movement bool transport = false; Location real_position(unit.GetPositionX(), unit.GetPositionY(), unit.GetPositionZMinusOffset(), unit.GetOrientation()); // Elevators also use MOVEMENTFLAG_ONTRANSPORT but we do not keep track of their position changes - if (unit.HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) && unit.GetTransGUID()) + if (unit.GetTransGUID()) { transport = true; real_position.x = unit.GetTransOffsetX(); @@ -91,7 +91,7 @@ namespace Movement else moveFlags &= ~MOVEMENTFLAG_WALKING; - moveFlags |= (MOVEMENTFLAG_SPLINE_ENABLED|MOVEMENTFLAG_FORWARD); + moveFlags |= MOVEMENTFLAG_FORWARD; if (!args.HasVelocity) args.velocity = unit.GetSpeed(SelectSpeedType(moveFlags)); @@ -120,7 +120,7 @@ namespace Movement MoveSplineInit::MoveSplineInit(Unit& m) : unit(m) { // Elevators also use MOVEMENTFLAG_ONTRANSPORT but we do not keep track of their position changes - args.TransformForTransport = unit.HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) && unit.GetTransGUID(); + args.TransformForTransport = unit.GetTransGUID(); // mix existing state into new args.flags.walkmode = unit.m_movementInfo.HasMovementFlag(MOVEMENTFLAG_WALKING); args.flags.flying = unit.m_movementInfo.HasMovementFlag((MovementFlags)(MOVEMENTFLAG_CAN_FLY|MOVEMENTFLAG_DISABLE_GRAVITY)); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index b7fa07ad430..bdf8a23412d 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -735,7 +735,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_ASCEND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_BACKWARD, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_DESCEND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_FORWARD, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_START_FORWARD, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_PITCH_DOWN, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_PITCH_UP, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_STRAFE_LEFT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index f3ae9009572..d08f814c479 100755 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -166,8 +166,6 @@ void WorldSession::SendPacket(WorldPacket const* packet) if (packet->GetOpcode() == NULL_OPCODE || packet->GetOpcode() == UNKNOWN_OPCODE) { sLog->outError("Prevented sending of %s", packet->GetOpcode() == NULL_OPCODE ? "NULL_OPCODE" : "UNKNOWN_OPCODE"); - //ACE_Stack_Trace trace; - //sLog->outError("%s", trace.c_str()); return; } diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp index 813c43288d0..b777fe8d9dc 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp @@ -433,7 +433,7 @@ public: { me->SetVisible(false); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_DISABLE_GRAVITY); + me->AddUnitMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY); me->SetSpeed(MOVE_WALK, 5.0f, true); wp_reached = false; count = 0; @@ -466,7 +466,7 @@ public: instance->SetData(GAMEOBJECT_PUMPKIN_SHRINE, 0); //hide gameobject break; case 19: - me->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_DISABLE_GRAVITY); + me->RemoveUnitMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY); break; case 20: { diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp index 8a64d45abcb..be657761def 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp @@ -264,7 +264,7 @@ public: { OrbsEmpowered = 0; EmpowerCount = 0; - me->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_DISABLE_GRAVITY); + me->AddUnitMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->setActive(true); @@ -452,7 +452,7 @@ public: summoned->CastSpell(summoned, SPELL_SHADOW_CHANNELING, false); break; case CREATURE_ANVEENA: - summoned->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_DISABLE_GRAVITY); + summoned->AddUnitMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY); summoned->CastSpell(summoned, SPELL_ANVEENA_PRISON, true); summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); break; diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp index 18c972b966c..14713787164 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp @@ -130,9 +130,9 @@ bool GrandChampionsOutVehicle(Creature* me) if (pGrandChampion1 && pGrandChampion2 && pGrandChampion3) { - if (!pGrandChampion1->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) && - !pGrandChampion2->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) && - !pGrandChampion3->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT)) + if (!pGrandChampion1->m_movementInfo.t_guid && + !pGrandChampion2->m_movementInfo.t_guid && + !pGrandChampion3->m_movementInfo.t_guid) return true; } @@ -384,7 +384,7 @@ public: } }else uiPhaseTimer -= uiDiff; - if (!UpdateVictim() || me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT)) + if (!UpdateVictim() || me->m_movementInfo.t_guid) return; if (uiInterceptTimer <= uiDiff) @@ -528,7 +528,7 @@ public: uiFireBallTimer = 5000; } else uiFireBallTimer -= uiDiff; - if (!UpdateVictim() || me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT)) + if (!UpdateVictim() || me->m_movementInfo.t_guid) return; if (uiFireBallTimer <= uiDiff) @@ -666,7 +666,7 @@ public: } }else uiPhaseTimer -= uiDiff; - if (!UpdateVictim() || me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT)) + if (!UpdateVictim() || me->m_movementInfo.t_guid) return; if (uiChainLightningTimer <= uiDiff) @@ -812,7 +812,7 @@ public: } }else uiPhaseTimer -= uiDiff; - if (!UpdateVictim() || me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT)) + if (!UpdateVictim() || me->m_movementInfo.t_guid) return; if (uiLightningArrowsTimer <= uiDiff) @@ -960,7 +960,7 @@ public: } } else uiPhaseTimer -= uiDiff; - if (!UpdateVictim() || me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT)) + if (!UpdateVictim() || me->m_movementInfo.t_guid) return; if (uiEviscerateTimer <= uiDiff) -- cgit v1.2.3 From 973d6d4aea9d131b5f2f6391aa86f4e86c5a976d Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 14 Jul 2012 23:52:26 +0200 Subject: Core/Objects: Use standard 64bit integer literals that work on all compilers --- src/server/game/Entities/Object/Object.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index 8e1677991f4..1d4732b8153 100755 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -124,7 +124,7 @@ typedef UNORDERED_MAP UpdateDataMapType; struct ObjectGuid { public: - ObjectGuid() { _data.u64 = 0i64; } + ObjectGuid() { _data.u64 = 0LL; } ObjectGuid(uint64 guid) { _data.u64 = guid; } ObjectGuid(ObjectGuid const& other) { _data.u64 = other._data.u64; } -- cgit v1.2.3 From 52f7ca8693523fde1e0082a2b0180d9b83f94505 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 15 Jul 2012 00:45:06 +0200 Subject: Core/PacketIO: Updated and enabled SMSG_PLAYER_MOVE --- src/server/game/Handlers/MovementHandler.cpp | 6 +- src/server/game/Movement/MovementStructures.h | 145 ++++++++++++++------------ src/server/game/Server/Protocol/Opcodes.cpp | 2 +- 3 files changed, 81 insertions(+), 72 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp index df28e01d5c7..b719afb736f 100755 --- a/src/server/game/Handlers/MovementHandler.cpp +++ b/src/server/game/Handlers/MovementHandler.cpp @@ -776,7 +776,7 @@ void WorldSession::ReadMovementInfo(WorldPacket& data, MovementInfo* mi) if (hasFallDirection) data >> mi->j_xyspeed; break; - case MSESplineElev: + case MSESplineElevation: if (hasSplineElevation) data >> mi->splineElevation; break; @@ -898,6 +898,8 @@ void WorldSession::WriteMovementInfo(WorldPacket &data, MovementInfo* mi) for(uint32 i = 0; i < MSE_COUNT; ++i) { MovementStatusElements element = sequence[i]; + if (element == MSEEnd) + break; if (element >= MSEHasGuidByte0 && element <= MSEHasGuidByte7) { @@ -1049,7 +1051,7 @@ void WorldSession::WriteMovementInfo(WorldPacket &data, MovementInfo* mi) if (hasFallDirection) data << mi->j_xyspeed; break; - case MSESplineElev: + case MSESplineElevation: if (hasSplineElevation) data << mi->splineElevation; break; diff --git a/src/server/game/Movement/MovementStructures.h b/src/server/game/Movement/MovementStructures.h index 87439bbedbc..d87878ad26c 100644 --- a/src/server/game/Movement/MovementStructures.h +++ b/src/server/game/Movement/MovementStructures.h @@ -87,7 +87,7 @@ enum MovementStatusElements MSEFallCosAngle, MSEFallSinAngle, MSEFallHorizontalSpeed, - MSESplineElev, + MSESplineElevation, // Special MSEZeroBit, // writes bit value 1 or skips read bit @@ -96,70 +96,77 @@ enum MovementStatusElements MSE_COUNT }; -//4.2.2 -MovementStatusElements PlayerMoveSequence[] = { +//4.3.4 +MovementStatusElements PlayerMoveSequence[] = +{ + MSEHasFallData, + MSEHasGuidByte3, + MSEHasGuidByte6, + MSEHasMovementFlags2, + MSEHasSpline, + MSEHasTimestamp, + MSEHasGuidByte0, + MSEHasGuidByte1, + MSEMovementFlags2, + MSEHasGuidByte7, + MSEHasMovementFlags, + MSEHasOrientation, + MSEHasGuidByte2, MSEHasSplineElev, - MSEHasTransportData, + MSEZeroBit, + MSEHasGuidByte4, + MSEHasFallDirection, MSEHasGuidByte5, - MSEHasTransportGuidByte2, - MSEHasTransportGuidByte4, - MSEHasTransportGuidByte1, + MSEHasTransportData, + MSEMovementFlags, MSEHasTransportGuidByte3, - MSEHasTransportGuidByte0, - MSEHasTransportTime2, - MSEHasTransportGuidByte7, MSEHasTransportTime3, MSEHasTransportGuidByte6, + MSEHasTransportGuidByte1, + MSEHasTransportGuidByte7, + MSEHasTransportGuidByte0, + MSEHasTransportGuidByte4, + MSEHasTransportTime2, MSEHasTransportGuidByte5, - MSEHasGuidByte7, - MSEHasGuidByte3, - MSEHasGuidByte1, - MSEHasGuidByte4, - MSEHasGuidByte0, - MSEMovementFlags, + MSEHasTransportGuidByte2, MSEHasPitch, - MSEHasGuidByte2, - MSEMovementFlags2, - MSEHasGuidByte6, - MSEHasFallData, - MSEHasFallDirection, - MSEHasSpline, - MSEGuidByte4, - MSEGuidByte0, - MSEOrientation, - MSEGuidByte6, + MSEGuidByte5, + MSEFallHorizontalSpeed, + MSEFallCosAngle, + MSEFallSinAngle, + MSEFallVerticalSpeed, + MSEFallTime, + MSESplineElevation, MSEGuidByte7, - MSESplineElev, - MSETransportGuidByte4, - MSETransportGuidByte2, - MSETransportOrientation, - MSETransportTime, + MSEPositionY, + MSEGuidByte3, + MSETransportTime3, + MSETransportGuidByte6, MSETransportSeat, - MSETransportGuidByte3, + MSETransportGuidByte5, MSETransportPositionX, - MSETransportPositionY, - MSETransportPositionZ, MSETransportGuidByte1, + MSETransportOrientation, + MSETransportGuidByte2, MSETransportTime2, - MSETransportTime3, - MSETransportGuidByte5, MSETransportGuidByte0, - MSETransportGuidByte6, + MSETransportPositionZ, MSETransportGuidByte7, - MSEGuidByte2, - MSETimestamp, - MSEGuidByte1, - MSEPitch, + MSETransportGuidByte4, + MSETransportGuidByte3, + MSETransportPositionY, + MSETransportTime, + MSEGuidByte4, MSEPositionX, - MSEPositionY, + MSEGuidByte6, MSEPositionZ, - MSEGuidByte5, - MSEGuidByte3, - MSEFallHorizontalSpeed, - MSEFallCosAngle, - MSEFallSinAngle, - MSEFallVerticalSpeed, - MSEFallTime, + MSETimestamp, + MSEGuidByte2, + MSEPitch, + MSEGuidByte0, + MSEOrientation, + MSEGuidByte1, + MSEEnd, }; //4.2.2 @@ -224,7 +231,7 @@ MovementStatusElements MovementFallLandSequence[] = { MSETransportGuidByte1, MSETransportGuidByte0, MSETransportGuidByte4, - MSESplineElev, + MSESplineElevation, MSEGuidByte1, }; @@ -263,7 +270,7 @@ MovementStatusElements MovementHeartBeatSequence[] = { MSEOrientation, MSEGuidByte7, MSEGuidByte5, - MSESplineElev, + MSESplineElevation, MSEGuidByte1, MSEGuidByte6, MSEGuidByte4, @@ -327,7 +334,7 @@ MovementStatusElements MovementJumpSequence[] = { MSEPositionX, MSEPositionY, MSEPositionZ, - MSESplineElev, + MSESplineElevation, MSEGuidByte0, MSEGuidByte5, MSEGuidByte3, @@ -395,7 +402,7 @@ MovementStatusElements MovementSetFacingSequence[] = { MSEPositionZ, MSEGuidByte7, MSEGuidByte5, - MSESplineElev, + MSESplineElevation, MSEGuidByte4, MSEGuidByte1, MSEGuidByte2, @@ -461,7 +468,7 @@ MovementStatusElements MovementSetPitchSequence[] = { MSEOrientation, MSEGuidByte1, MSEGuidByte4, - MSESplineElev, + MSESplineElevation, MSETransportSeat, MSETransportOrientation, MSETransportPositionX, @@ -528,7 +535,7 @@ MovementStatusElements MovementStartBackwardSequence[] = { MSEGuidByte3, MSEGuidByte0, MSEGuidByte1, - MSESplineElev, + MSESplineElevation, MSEGuidByte4, MSEPitch, MSEGuidByte7, @@ -624,7 +631,7 @@ MovementStatusElements MovementStartForwardSequence[] = MSETransportGuidByte0, MSETransportSeat, MSETransportTime2, - MSESplineElev, + MSESplineElevation, MSEPitch, MSEOrientation, MSETimestamp, @@ -666,7 +673,7 @@ MovementStatusElements MovementStartStrafeLeftSequence[] = { MSEOrientation, MSETimestamp, MSEPitch, - MSESplineElev, + MSESplineElevation, MSEGuidByte7, MSEGuidByte5, MSEFallTime, @@ -734,7 +741,7 @@ MovementStatusElements MovementStartStrafeRightSequence[] = { MSEGuidByte4, MSEGuidByte1, MSEGuidByte2, - MSESplineElev, + MSESplineElevation, MSEGuidByte0, MSEPitch, MSEGuidByte6, @@ -820,7 +827,7 @@ MovementStatusElements MovementStartTurnLeftSequence[] = { MSEGuidByte6, MSEGuidByte5, MSEGuidByte3, - MSESplineElev, + MSESplineElevation, MSEFallTime, MSEFallVerticalSpeed, MSEFallHorizontalSpeed, @@ -892,7 +899,7 @@ MovementStatusElements MovementStartTurnRightSequence[] = { MSEGuidByte3, MSEGuidByte1, MSEGuidByte0, - MSESplineElev, + MSESplineElevation, MSEGuidByte5, }; @@ -957,7 +964,7 @@ MovementStatusElements MovementStopSequence[] = { MSETransportGuidByte4, MSEGuidByte1, MSEGuidByte0, - MSESplineElev, + MSESplineElevation, MSEGuidByte6, MSEGuidByte4, }; @@ -1008,7 +1015,7 @@ MovementStatusElements MovementStopStrafeSequence[] = { MSEFallSinAngle, MSEGuidByte3, MSEPitch, - MSESplineElev, + MSESplineElevation, MSETransportSeat, MSETransportOrientation, MSETransportPositionX, @@ -1073,7 +1080,7 @@ MovementStatusElements MovementStopTurnSequence[] = { MSEFallHorizontalSpeed, MSEFallCosAngle, MSEFallSinAngle, - MSESplineElev, + MSESplineElevation, MSEGuidByte0, MSEGuidByte2, MSETransportSeat, @@ -1136,7 +1143,7 @@ MovementStatusElements MovementStartAscendSequence[] = { MSEPitch, MSEGuidByte0, MSEGuidByte5, - MSESplineElev, + MSESplineElevation, MSEGuidByte1, MSETransportSeat, MSETransportOrientation, @@ -1193,7 +1200,7 @@ MovementStatusElements MovementStartDescendSequence[] = { MSEPositionY, MSEPositionZ, MSEOrientation, - MSESplineElev, + MSESplineElevation, MSEGuidByte7, MSEGuidByte4, MSEGuidByte2, @@ -1260,7 +1267,7 @@ MovementStatusElements MovementStartSwimSequence[] = { MSEOrientation, MSETimestamp, MSEPitch, - MSESplineElev, + MSESplineElevation, MSEGuidByte2, MSEGuidByte0, MSEGuidByte5, @@ -1354,7 +1361,7 @@ MovementStatusElements MovementStopAscendSequence[] = { MSEGuidByte5, MSEGuidByte4, MSEGuidByte3, - MSESplineElev, + MSESplineElevation, MSEGuidByte6, }; @@ -1362,8 +1369,8 @@ MovementStatusElements* GetMovementStatusElementsSequence(Opcodes opcode) { switch (opcode) { - //case SMSG_PLAYER_MOVE: - // return PlayerMoveSequence; + case SMSG_PLAYER_MOVE: + return PlayerMoveSequence; //case MSG_MOVE_FALL_LAND: // return MovementFallLandSequence; //case MSG_MOVE_HEARTBEAT: diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index bdf8a23412d..3919b1c6fd0 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -1172,7 +1172,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_PLAYED_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PLAYERBINDERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PLAYERBOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PLAYER_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PLAYER_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PLAYER_SKINNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PLAYER_VEHICLE_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PLAY_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From 93fb7c1a72b7dc1e1c439b7607f26e5450c518b2 Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 16 Jul 2012 19:17:16 +0200 Subject: Core/PacketIO: Updated and enabled most player movement client opcodes, huge thanks to Horn for doing half of the job --- src/server/game/Handlers/MovementHandler.cpp | 4 +- src/server/game/Movement/MovementStructures.h | 1957 +++++++++++++++---------- src/server/game/Server/Protocol/Opcodes.cpp | 38 +- src/server/game/Server/Protocol/Opcodes.h | 4 +- 4 files changed, 1204 insertions(+), 799 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp index b719afb736f..6461d31db55 100755 --- a/src/server/game/Handlers/MovementHandler.cpp +++ b/src/server/game/Handlers/MovementHandler.cpp @@ -689,7 +689,7 @@ void WorldSession::ReadMovementInfo(WorldPacket& data, MovementInfo* mi) if (hasFallData) hasFallDirection = data.ReadBit(); break; - case MSEHasSplineElev: + case MSEHasSplineElevation: hasSplineElevation = !data.ReadBit(); break; case MSEHasSpline: @@ -964,7 +964,7 @@ void WorldSession::WriteMovementInfo(WorldPacket &data, MovementInfo* mi) if (hasFallData) data.WriteBit(hasFallDirection); break; - case MSEHasSplineElev: + case MSEHasSplineElevation: data.WriteBit(!hasSplineElevation); break; case MSEHasSpline: diff --git a/src/server/game/Movement/MovementStructures.h b/src/server/game/Movement/MovementStructures.h index d87878ad26c..529467b98bc 100644 --- a/src/server/game/Movement/MovementStructures.h +++ b/src/server/game/Movement/MovementStructures.h @@ -1,5 +1,5 @@ /* -* Copyright (C) 2008-2011 TrinityCore +* Copyright (C) 2008-2012 TrinityCore * Copyright (C) 2005-2009 MaNGOS * * This program is free software; you can redistribute it and/or modify it @@ -47,7 +47,7 @@ enum MovementStatusElements MSEHasPitch, MSEHasFallData, MSEHasFallDirection, - MSEHasSplineElev, + MSEHasSplineElevation, MSEHasSpline, MSEGuidByte0, @@ -112,7 +112,7 @@ MovementStatusElements PlayerMoveSequence[] = MSEHasMovementFlags, MSEHasOrientation, MSEHasGuidByte2, - MSEHasSplineElev, + MSEHasSplineElevation, MSEZeroBit, MSEHasGuidByte4, MSEHasFallDirection, @@ -169,22 +169,242 @@ MovementStatusElements PlayerMoveSequence[] = MSEEnd, }; -//4.2.2 -MovementStatusElements MovementFallLandSequence[] = { - MSEHasGuidByte4, - MSEHasGuidByte6, +//4.3.4 +MovementStatusElements MovementFallLandSequence[] = +{ + MSEPositionX, + MSEPositionY, + MSEPositionZ, + MSEHasTransportData, + MSEHasGuidByte7, + MSEHasGuidByte1, + MSEHasMovementFlags2, MSEHasGuidByte3, + MSEHasSplineElevation, + MSEHasOrientation, + MSEHasGuidByte6, + MSEHasTimestamp, + MSEZeroBit, + MSEHasPitch, + MSEHasGuidByte4, MSEHasSpline, + MSEHasGuidByte5, + MSEHasMovementFlags, + MSEHasFallData, + MSEHasGuidByte0, MSEHasGuidByte2, + MSEHasTransportGuidByte0, + MSEHasTransportGuidByte5, + MSEHasTransportGuidByte3, + MSEHasTransportGuidByte2, + MSEHasTransportTime3, + MSEHasTransportTime2, + MSEHasTransportGuidByte6, + MSEHasTransportGuidByte4, + MSEHasTransportGuidByte1, + MSEHasTransportGuidByte7, + MSEMovementFlags2, MSEMovementFlags, + MSEHasFallDirection, + MSEGuidByte1, + MSEGuidByte7, + MSEGuidByte4, + MSEGuidByte3, + MSEGuidByte6, + MSEGuidByte0, + MSEGuidByte2, + MSEGuidByte5, + MSETransportTime, + MSETransportPositionZ, + MSETransportPositionY, + MSETransportPositionX, + MSETransportGuidByte5, + MSETransportTime3, + MSETransportGuidByte1, + MSETransportSeat, + MSETransportTime2, + MSETransportGuidByte4, + MSETransportOrientation, + MSETransportGuidByte0, + MSETransportGuidByte7, + MSETransportGuidByte3, + MSETransportGuidByte6, + MSETransportGuidByte2, + MSEFallVerticalSpeed, + MSEFallTime, + MSEFallCosAngle, + MSEFallHorizontalSpeed, + MSEFallSinAngle, + MSESplineElevation, + MSETimestamp, + MSEPitch, + MSEOrientation, + MSEEnd, +}; + +//4.3.4 +MovementStatusElements MovementHeartBeatSequence[] = +{ + MSEPositionZ, + MSEPositionX, + MSEPositionY, + MSEHasPitch, + MSEHasTimestamp, + MSEHasFallData, + MSEHasMovementFlags2, + MSEHasTransportData, MSEHasGuidByte7, MSEHasGuidByte1, + MSEHasGuidByte0, + MSEHasGuidByte4, + MSEHasGuidByte2, + MSEHasOrientation, + MSEHasGuidByte5, + MSEHasGuidByte3, + MSEHasSplineElevation, + MSEHasSpline, + MSEZeroBit, + MSEHasGuidByte6, + MSEHasMovementFlags, + MSEHasTransportTime3, + MSEHasTransportGuidByte4, + MSEHasTransportGuidByte2, + MSEHasTransportTime2, + MSEHasTransportGuidByte5, + MSEHasTransportGuidByte7, + MSEHasTransportGuidByte6, + MSEHasTransportGuidByte0, + MSEHasTransportGuidByte3, + MSEHasTransportGuidByte1, + MSEHasFallDirection, + MSEMovementFlags, MSEMovementFlags2, + MSEGuidByte3, + MSEGuidByte6, + MSEGuidByte1, + MSEGuidByte7, + MSEGuidByte2, + MSEGuidByte5, + MSEGuidByte0, + MSEGuidByte4, + MSETransportPositionZ, + MSETransportSeat, + MSETransportOrientation, + MSETransportGuidByte4, + MSETransportPositionY, + MSETransportTime, + MSETransportPositionX, + MSETransportGuidByte5, + MSETransportGuidByte1, + MSETransportGuidByte3, + MSETransportGuidByte7, + MSETransportTime3, + MSETransportTime2, + MSETransportGuidByte2, + MSETransportGuidByte0, + MSETransportGuidByte6, + MSEOrientation, + MSEFallVerticalSpeed, + MSEFallTime, + MSEFallHorizontalSpeed, + MSEFallSinAngle, + MSEFallCosAngle, + MSEPitch, + MSESplineElevation, + MSETimestamp, + MSEEnd, +}; + +//4.3.4 +MovementStatusElements MovementJumpSequence[] = +{ + MSEPositionY, + MSEPositionX, + MSEPositionZ, + MSEHasTimestamp, MSEHasGuidByte5, + MSEHasMovementFlags, + MSEHasGuidByte4, + MSEHasGuidByte6, + MSEHasMovementFlags2, MSEHasGuidByte0, + MSEHasTransportData, + MSEHasGuidByte3, + MSEHasPitch, + MSEHasGuidByte7, MSEHasFallData, + MSEHasSpline, + MSEHasOrientation, + MSEHasGuidByte1, + MSEHasSplineElevation, + MSEZeroBit, + MSEHasGuidByte2, + MSEHasTransportGuidByte3, + MSEHasTransportGuidByte7, + MSEHasTransportGuidByte6, + MSEHasTransportGuidByte0, + MSEHasTransportGuidByte5, + MSEHasTransportGuidByte1, + MSEHasTransportGuidByte4, + MSEHasTransportTime3, + MSEHasTransportTime2, + MSEHasTransportGuidByte2, MSEHasFallDirection, + MSEMovementFlags, + MSEMovementFlags2, + MSEGuidByte6, + MSEGuidByte5, + MSEGuidByte4, + MSEGuidByte0, + MSEGuidByte2, + MSEGuidByte3, + MSEGuidByte7, + MSEGuidByte1, + MSETransportGuidByte1, + MSETransportGuidByte7, + MSETransportPositionX, + MSETransportGuidByte4, + MSETransportTime3, + MSETransportGuidByte0, + MSETransportOrientation, + MSETransportTime2, + MSETransportTime, + MSETransportGuidByte6, + MSETransportPositionZ, + MSETransportSeat, + MSETransportPositionY, + MSETransportGuidByte3, + MSETransportGuidByte2, + MSETransportGuidByte5, + MSEPitch, + MSETimestamp, + MSEFallCosAngle, + MSEFallSinAngle, + MSEFallHorizontalSpeed, + MSEFallVerticalSpeed, + MSEFallTime, + MSESplineElevation, + MSEOrientation, + MSEEnd, +}; + +//4.2.2 +MovementStatusElements MovementSetFacingSequence[] = { + MSEMovementFlags, + MSEHasGuidByte4, + MSEHasGuidByte2, + MSEHasSpline, + MSEHasGuidByte3, + MSEHasGuidByte5, + MSEMovementFlags2, + MSEHasGuidByte0, + MSEHasGuidByte7, + MSEHasGuidByte6, + MSEHasGuidByte1, + MSEHasSplineElevation, MSEHasPitch, + MSEHasFallData, + MSEHasFallDirection, MSEHasTransportData, MSEHasTransportGuidByte0, MSEHasTransportGuidByte6, @@ -196,25 +416,25 @@ MovementStatusElements MovementFallLandSequence[] = { MSEHasTransportGuidByte7, MSEHasTransportTime2, MSEHasTransportTime3, - MSEHasSplineElev, MSEOrientation, + MSETimestamp, MSEPositionX, MSEPositionY, MSEPositionZ, - MSETimestamp, MSEGuidByte7, + MSEGuidByte5, + MSESplineElevation, + MSEGuidByte4, + MSEGuidByte1, MSEGuidByte2, + MSEPitch, MSEFallTime, MSEFallVerticalSpeed, MSEFallHorizontalSpeed, MSEFallCosAngle, MSEFallSinAngle, - MSEGuidByte0, - MSEPitch, - MSEGuidByte4, MSEGuidByte6, - MSEGuidByte5, - MSEGuidByte3, + MSEGuidByte0, MSETransportSeat, MSETransportOrientation, MSETransportPositionX, @@ -231,24 +451,23 @@ MovementStatusElements MovementFallLandSequence[] = { MSETransportGuidByte1, MSETransportGuidByte0, MSETransportGuidByte4, - MSESplineElevation, - MSEGuidByte1, + MSEGuidByte3, }; //4.2.2 -MovementStatusElements MovementHeartBeatSequence[] = { - MSEMovementFlags, - MSEHasSpline, - MSEHasGuidByte0, - MSEHasGuidByte6, +MovementStatusElements MovementSetPitchSequence[] = { MSEHasGuidByte1, + MSEHasGuidByte6, MSEHasGuidByte7, + MSEHasGuidByte3, + MSEMovementFlags, + MSEHasGuidByte5, MSEHasGuidByte2, + MSEHasGuidByte0, + MSEHasSpline, MSEHasGuidByte4, - MSEHasGuidByte3, MSEMovementFlags2, - MSEHasGuidByte5, - MSEHasSplineElev, + MSEHasSplineElevation, MSEHasTransportData, MSEHasTransportGuidByte0, MSEHasTransportGuidByte6, @@ -263,18 +482,14 @@ MovementStatusElements MovementHeartBeatSequence[] = { MSEHasPitch, MSEHasFallData, MSEHasFallDirection, - MSETimestamp, MSEPositionX, MSEPositionY, MSEPositionZ, + MSETimestamp, MSEOrientation, - MSEGuidByte7, - MSEGuidByte5, - MSESplineElevation, MSEGuidByte1, - MSEGuidByte6, MSEGuidByte4, - MSEGuidByte3, + MSESplineElevation, MSETransportSeat, MSETransportOrientation, MSETransportPositionX, @@ -292,1121 +507,1311 @@ MovementStatusElements MovementHeartBeatSequence[] = { MSETransportGuidByte0, MSETransportGuidByte4, MSEPitch, + MSEGuidByte5, MSEFallTime, MSEFallVerticalSpeed, MSEFallHorizontalSpeed, MSEFallCosAngle, MSEFallSinAngle, - MSEGuidByte2, MSEGuidByte0, + MSEGuidByte3, + MSEGuidByte6, + MSEGuidByte7, + MSEGuidByte2, }; -//4.2.2 -MovementStatusElements MovementJumpSequence[] = { - MSEHasSpline, +//4.3.4 +MovementStatusElements MovementStartBackwardSequence[] = +{ + MSEPositionX, + MSEPositionZ, + MSEPositionY, + MSEHasTransportData, + MSEHasGuidByte3, MSEHasGuidByte0, - MSEHasGuidByte1, - MSEHasGuidByte4, - MSEMovementFlags, MSEHasGuidByte2, - MSEHasGuidByte5, - MSEHasGuidByte3, - MSEMovementFlags2, + MSEHasTimestamp, MSEHasGuidByte7, + MSEHasPitch, + MSEZeroBit, + MSEHasMovementFlags, + MSEHasOrientation, + MSEHasSpline, + MSEHasMovementFlags2, + MSEHasFallData, + MSEHasGuidByte5, + MSEHasGuidByte1, + MSEHasGuidByte4, MSEHasGuidByte6, - MSEHasSplineElev, - MSEHasTransportData, + MSEHasSplineElevation, + MSEHasTransportGuidByte3, + MSEHasTransportGuidByte1, + MSEHasTransportTime2, + MSEHasTransportGuidByte2, + MSEHasTransportGuidByte7, MSEHasTransportGuidByte0, MSEHasTransportGuidByte6, - MSEHasTransportGuidByte2, MSEHasTransportGuidByte5, MSEHasTransportGuidByte4, - MSEHasTransportGuidByte1, - MSEHasTransportGuidByte3, - MSEHasTransportGuidByte7, - MSEHasTransportTime2, MSEHasTransportTime3, - MSEHasFallData, + MSEMovementFlags, + MSEMovementFlags2, MSEHasFallDirection, - MSEHasPitch, - MSEOrientation, - MSETimestamp, - MSEPositionX, - MSEPositionY, - MSEPositionZ, - MSESplineElevation, - MSEGuidByte0, + MSEGuidByte6, + MSEGuidByte7, + MSEGuidByte4, + MSEGuidByte1, MSEGuidByte5, + MSEGuidByte0, + MSEGuidByte2, MSEGuidByte3, - MSETransportSeat, - MSETransportOrientation, - MSETransportPositionX, - MSETransportPositionY, MSETransportPositionZ, - MSETransportTime, - MSETransportTime2, - MSETransportGuidByte3, - MSETransportGuidByte6, + MSETransportGuidByte2, MSETransportTime3, - MSETransportGuidByte7, + MSETransportGuidByte0, MSETransportGuidByte5, - MSETransportGuidByte2, + MSETransportPositionY, MSETransportGuidByte1, - MSETransportGuidByte0, + MSETransportPositionX, + MSETransportTime2, MSETransportGuidByte4, - MSEGuidByte4, - MSEGuidByte1, - MSEFallTime, - MSEFallVerticalSpeed, + MSETransportOrientation, + MSETransportSeat, + MSETransportGuidByte7, + MSETransportTime, + MSETransportGuidByte6, + MSETransportGuidByte3, + MSEPitch, + MSETimestamp, MSEFallHorizontalSpeed, - MSEFallCosAngle, MSEFallSinAngle, - MSEGuidByte2, - MSEGuidByte6, - MSEGuidByte7, - MSEPitch, + MSEFallCosAngle, + MSEFallVerticalSpeed, + MSEFallTime, + MSEOrientation, + MSESplineElevation, + MSEEnd, }; -//4.2.2 -MovementStatusElements MovementSetFacingSequence[] = { - MSEMovementFlags, - MSEHasGuidByte4, - MSEHasGuidByte2, - MSEHasSpline, - MSEHasGuidByte3, +//4.3.4 +MovementStatusElements MovementStartForwardSequence[] = +{ + MSEPositionY, + MSEPositionZ, + MSEPositionX, MSEHasGuidByte5, - MSEMovementFlags2, + MSEHasGuidByte2, MSEHasGuidByte0, + MSEZeroBit, + MSEHasMovementFlags, MSEHasGuidByte7, - MSEHasGuidByte6, + MSEHasGuidByte3, MSEHasGuidByte1, - MSEHasSplineElev, + MSEHasOrientation, + MSEHasGuidByte6, + MSEHasSpline, + MSEHasSplineElevation, + MSEHasGuidByte4, + MSEHasTransportData, + MSEHasTimestamp, MSEHasPitch, + MSEHasMovementFlags2, MSEHasFallData, - MSEHasFallDirection, - MSEHasTransportData, - MSEHasTransportGuidByte0, + MSEMovementFlags, + MSEHasTransportGuidByte3, + MSEHasTransportGuidByte4, MSEHasTransportGuidByte6, MSEHasTransportGuidByte2, MSEHasTransportGuidByte5, - MSEHasTransportGuidByte4, - MSEHasTransportGuidByte1, - MSEHasTransportGuidByte3, + MSEHasTransportGuidByte0, MSEHasTransportGuidByte7, - MSEHasTransportTime2, + MSEHasTransportGuidByte1, MSEHasTransportTime3, - MSEOrientation, - MSETimestamp, - MSEPositionX, - MSEPositionY, - MSEPositionZ, - MSEGuidByte7, - MSEGuidByte5, - MSESplineElevation, + MSEHasTransportTime2, + MSEHasFallDirection, + MSEMovementFlags2, + MSEGuidByte2, MSEGuidByte4, + MSEGuidByte6, MSEGuidByte1, - MSEGuidByte2, - MSEPitch, - MSEFallTime, + MSEGuidByte7, + MSEGuidByte3, + MSEGuidByte5, + MSEGuidByte0, MSEFallVerticalSpeed, MSEFallHorizontalSpeed, MSEFallCosAngle, MSEFallSinAngle, - MSEGuidByte6, - MSEGuidByte0, - MSETransportSeat, - MSETransportOrientation, - MSETransportPositionX, + MSEFallTime, + MSETransportGuidByte3, MSETransportPositionY, MSETransportPositionZ, - MSETransportTime, - MSETransportTime2, - MSETransportGuidByte3, - MSETransportGuidByte6, - MSETransportTime3, + MSETransportGuidByte1, + MSETransportGuidByte4, MSETransportGuidByte7, - MSETransportGuidByte5, + MSETransportOrientation, MSETransportGuidByte2, - MSETransportGuidByte1, + MSETransportPositionX, + MSETransportGuidByte5, + MSETransportTime3, + MSETransportTime, + MSETransportGuidByte6, MSETransportGuidByte0, - MSETransportGuidByte4, - MSEGuidByte3, + MSETransportSeat, + MSETransportTime2, + MSESplineElevation, + MSEPitch, + MSEOrientation, + MSETimestamp, + + MSEEnd, }; -//4.2.2 -MovementStatusElements MovementSetPitchSequence[] = { - MSEHasGuidByte1, - MSEHasGuidByte6, - MSEHasGuidByte7, - MSEHasGuidByte3, - MSEMovementFlags, +//4.3.4 +MovementStatusElements MovementStartStrafeLeftSequence[] = +{ + MSEPositionZ, + MSEPositionX, + MSEPositionY, + MSEHasSplineElevation, MSEHasGuidByte5, - MSEHasGuidByte2, + MSEHasPitch, + MSEHasGuidByte6, + MSEHasTimestamp, + MSEHasGuidByte1, + MSEZeroBit, + MSEHasGuidByte4, MSEHasGuidByte0, + MSEHasGuidByte2, + MSEHasFallData, + MSEHasOrientation, + MSEHasGuidByte3, + MSEHasMovementFlags2, + MSEHasGuidByte7, MSEHasSpline, - MSEHasGuidByte4, - MSEMovementFlags2, - MSEHasSplineElev, + MSEHasMovementFlags, MSEHasTransportData, - MSEHasTransportGuidByte0, + MSEHasFallDirection, + MSEHasTransportTime2, + MSEHasTransportGuidByte7, + MSEHasTransportTime3, + MSEHasTransportGuidByte3, + MSEHasTransportGuidByte1, MSEHasTransportGuidByte6, - MSEHasTransportGuidByte2, MSEHasTransportGuidByte5, + MSEHasTransportGuidByte2, MSEHasTransportGuidByte4, - MSEHasTransportGuidByte1, - MSEHasTransportGuidByte3, - MSEHasTransportGuidByte7, - MSEHasTransportTime2, - MSEHasTransportTime3, - MSEHasPitch, - MSEHasFallData, - MSEHasFallDirection, - MSEPositionX, - MSEPositionY, - MSEPositionZ, - MSETimestamp, - MSEOrientation, + MSEHasTransportGuidByte0, + MSEMovementFlags, + MSEMovementFlags2, + MSEGuidByte2, + MSEGuidByte6, + MSEGuidByte3, MSEGuidByte1, + MSEGuidByte0, + MSEGuidByte7, MSEGuidByte4, - MSESplineElevation, + MSEGuidByte5, + MSEFallSinAngle, + MSEFallHorizontalSpeed, + MSEFallCosAngle, + MSEFallTime, + MSEFallVerticalSpeed, MSETransportSeat, - MSETransportOrientation, - MSETransportPositionX, - MSETransportPositionY, - MSETransportPositionZ, - MSETransportTime, + MSETransportGuidByte2, MSETransportTime2, MSETransportGuidByte3, - MSETransportGuidByte6, + MSETransportPositionZ, MSETransportTime3, + MSETransportGuidByte0, MSETransportGuidByte7, + MSETransportPositionY, MSETransportGuidByte5, - MSETransportGuidByte2, MSETransportGuidByte1, - MSETransportGuidByte0, + MSETransportOrientation, + MSETransportTime, + MSETransportGuidByte6, MSETransportGuidByte4, + MSETransportPositionX, + MSETimestamp, + MSEOrientation, MSEPitch, - MSEGuidByte5, - MSEFallTime, - MSEFallVerticalSpeed, - MSEFallHorizontalSpeed, - MSEFallCosAngle, - MSEFallSinAngle, - MSEGuidByte0, - MSEGuidByte3, - MSEGuidByte6, - MSEGuidByte7, - MSEGuidByte2, + MSESplineElevation, + MSEEnd, }; -//4.2.2 -MovementStatusElements MovementStartBackwardSequence[] = { +//4.3.4 +MovementStatusElements MovementStartStrafeRightSequence[] = +{ + MSEPositionY, + MSEPositionX, + MSEPositionZ, + MSEHasPitch, + MSEHasGuidByte1, + MSEHasOrientation, + MSEHasGuidByte4, + MSEHasSpline, + MSEZeroBit, MSEHasGuidByte5, - MSEMovementFlags2, + MSEHasFallData, + MSEHasSplineElevation, + MSEHasTimestamp, + MSEHasMovementFlags, MSEHasGuidByte2, MSEHasGuidByte7, - MSEHasSpline, - MSEMovementFlags, - MSEHasGuidByte1, - MSEHasGuidByte3, - MSEHasGuidByte4, MSEHasGuidByte6, - MSEHasGuidByte0, - MSEHasSplineElev, - MSEHasPitch, + MSEHasGuidByte3, + MSEHasMovementFlags2, MSEHasTransportData, - MSEHasTransportGuidByte0, - MSEHasTransportGuidByte6, + MSEHasGuidByte0, + MSEHasTransportGuidByte7, MSEHasTransportGuidByte2, - MSEHasTransportGuidByte5, - MSEHasTransportGuidByte4, - MSEHasTransportGuidByte1, MSEHasTransportGuidByte3, - MSEHasTransportGuidByte7, + MSEHasTransportGuidByte5, + MSEHasTransportGuidByte0, MSEHasTransportTime2, + MSEHasTransportGuidByte6, + MSEHasTransportGuidByte1, + MSEHasTransportGuidByte4, MSEHasTransportTime3, - MSEHasFallData, + MSEMovementFlags2, + MSEMovementFlags, MSEHasFallDirection, - MSEOrientation, - MSEPositionX, - MSEPositionY, - MSEPositionZ, - MSETimestamp, + MSEGuidByte7, + MSEGuidByte5, MSEGuidByte3, - MSEGuidByte0, MSEGuidByte1, - MSESplineElevation, - MSEGuidByte4, - MSEPitch, - MSEGuidByte7, MSEGuidByte2, + MSEGuidByte4, MSEGuidByte6, - MSETransportSeat, + MSEGuidByte0, + MSETransportGuidByte5, + MSETransportGuidByte1, + MSETransportGuidByte6, + MSETransportPositionY, MSETransportOrientation, + MSETransportGuidByte0, + MSETransportGuidByte2, + MSETransportSeat, MSETransportPositionX, - MSETransportPositionY, - MSETransportPositionZ, + MSETransportTime3, MSETransportTime, + MSETransportGuidByte4, + MSETransportGuidByte7, MSETransportTime2, + MSETransportPositionZ, MSETransportGuidByte3, - MSETransportGuidByte6, - MSETransportTime3, - MSETransportGuidByte7, - MSETransportGuidByte5, - MSETransportGuidByte2, - MSETransportGuidByte1, - MSETransportGuidByte0, - MSETransportGuidByte4, - MSEGuidByte5, - MSEFallTime, - MSEFallVerticalSpeed, - MSEFallHorizontalSpeed, + MSEPitch, + MSEOrientation, MSEFallCosAngle, MSEFallSinAngle, + MSEFallHorizontalSpeed, + MSEFallTime, + MSEFallVerticalSpeed, + MSETimestamp, + MSESplineElevation, + MSEEnd, }; -//4.3.3 -MovementStatusElements MovementStartForwardSequence[] = +//4.3.4 +MovementStatusElements MovementStartTurnLeftSequence[] = { MSEPositionY, - MSEPositionZ, MSEPositionX, - MSEHasGuidByte5, - MSEHasGuidByte2, - MSEHasGuidByte0, + MSEPositionZ, MSEZeroBit, - MSEHasMovementFlags, - MSEHasGuidByte7, - MSEHasGuidByte3, MSEHasGuidByte1, MSEHasOrientation, - MSEHasGuidByte6, MSEHasSpline, - MSEHasSplineElev, + MSEHasMovementFlags, MSEHasGuidByte4, + MSEHasGuidByte2, + MSEHasMovementFlags2, + MSEHasGuidByte5, + MSEHasGuidByte7, MSEHasTransportData, - MSEHasTimestamp, + MSEHasGuidByte6, + MSEHasSplineElevation, + MSEHasGuidByte0, + MSEHasGuidByte3, MSEHasPitch, - MSEHasMovementFlags2, + MSEHasTimestamp, MSEHasFallData, - MSEMovementFlags, + MSEMovementFlags2, MSEHasTransportGuidByte3, - MSEHasTransportGuidByte4, - MSEHasTransportGuidByte6, - MSEHasTransportGuidByte2, - MSEHasTransportGuidByte5, - MSEHasTransportGuidByte0, - MSEHasTransportGuidByte7, MSEHasTransportGuidByte1, - MSEHasTransportTime3, + MSEHasTransportGuidByte0, MSEHasTransportTime2, + MSEHasTransportGuidByte2, + MSEHasTransportTime3, + MSEHasTransportGuidByte4, + MSEHasTransportGuidByte7, + MSEHasTransportGuidByte5, + MSEHasTransportGuidByte6, MSEHasFallDirection, - MSEMovementFlags2, - MSEGuidByte2, + MSEMovementFlags, + MSEGuidByte0, MSEGuidByte4, - MSEGuidByte6, - MSEGuidByte1, MSEGuidByte7, - MSEGuidByte3, MSEGuidByte5, - MSEGuidByte0, - MSEFallVerticalSpeed, - MSEFallHorizontalSpeed, - MSEFallCosAngle, + MSEGuidByte6, + MSEGuidByte3, + MSEGuidByte2, + MSEGuidByte1, MSEFallSinAngle, + MSEFallCosAngle, + MSEFallHorizontalSpeed, + MSEFallVerticalSpeed, MSEFallTime, - MSETransportGuidByte3, - MSETransportPositionY, + MSETransportGuidByte0, + MSETransportPositionX, + MSETransportTime, + MSETransportSeat, MSETransportPositionZ, - MSETransportGuidByte1, MSETransportGuidByte4, - MSETransportGuidByte7, MSETransportOrientation, MSETransportGuidByte2, - MSETransportPositionX, - MSETransportGuidByte5, - MSETransportTime3, - MSETransportTime, MSETransportGuidByte6, - MSETransportGuidByte0, - MSETransportSeat, + MSETransportGuidByte1, + MSETransportGuidByte3, + MSETransportPositionY, + MSETransportTime3, MSETransportTime2, - MSESplineElevation, + MSETransportGuidByte5, + MSETransportGuidByte7, + MSETimestamp, MSEPitch, MSEOrientation, - MSETimestamp, - + MSESplineElevation, MSEEnd, }; -//4.2.2 -MovementStatusElements MovementStartStrafeLeftSequence[] = { +//4.3.4 +MovementStatusElements MovementStartTurnRightSequence[] = +{ + MSEPositionX, + MSEPositionZ, + MSEPositionY, + MSEHasGuidByte3, MSEHasGuidByte5, - MSEMovementFlags, + MSEHasMovementFlags, MSEHasSpline, - MSEHasGuidByte6, + MSEHasGuidByte0, + MSEHasOrientation, + MSEHasTransportData, + MSEHasGuidByte7, + MSEZeroBit, + MSEHasMovementFlags2, MSEHasGuidByte1, + MSEHasTimestamp, + MSEHasGuidByte6, MSEHasGuidByte2, - MSEMovementFlags2, - MSEHasGuidByte7, - MSEHasGuidByte0, - MSEHasGuidByte3, MSEHasGuidByte4, + MSEHasSplineElevation, MSEHasPitch, - MSEHasSplineElev, MSEHasFallData, - MSEHasFallDirection, - MSEHasTransportData, - MSEHasTransportGuidByte0, + MSEHasTransportGuidByte1, + MSEHasTransportTime2, MSEHasTransportGuidByte6, - MSEHasTransportGuidByte2, + MSEHasTransportGuidByte0, + MSEHasTransportGuidByte3, MSEHasTransportGuidByte5, + MSEHasTransportGuidByte2, MSEHasTransportGuidByte4, - MSEHasTransportGuidByte1, - MSEHasTransportGuidByte3, MSEHasTransportGuidByte7, - MSEHasTransportTime2, MSEHasTransportTime3, - MSEPositionX, - MSEPositionY, - MSEPositionZ, - MSEOrientation, - MSETimestamp, - MSEPitch, - MSESplineElevation, - MSEGuidByte7, + MSEMovementFlags2, + MSEMovementFlags, + MSEHasFallDirection, MSEGuidByte5, - MSEFallTime, - MSEFallVerticalSpeed, - MSEFallHorizontalSpeed, - MSEFallCosAngle, - MSEFallSinAngle, - MSEGuidByte4, + MSEGuidByte0, + MSEGuidByte7, MSEGuidByte3, MSEGuidByte2, - MSEGuidByte6, - MSEGuidByte0, MSEGuidByte1, - MSETransportSeat, - MSETransportOrientation, - MSETransportPositionX, + MSEGuidByte4, + MSEGuidByte6, MSETransportPositionY, - MSETransportPositionZ, - MSETransportTime, - MSETransportTime2, - MSETransportGuidByte3, + MSETransportGuidByte0, + MSETransportGuidByte4, + MSETransportGuidByte1, MSETransportGuidByte6, + MSETransportGuidByte2, + MSETransportSeat, + MSETransportOrientation, + MSETransportGuidByte5, MSETransportTime3, + MSETransportPositionZ, + MSETransportPositionX, + MSETransportTime, MSETransportGuidByte7, - MSETransportGuidByte5, - MSETransportGuidByte2, - MSETransportGuidByte1, - MSETransportGuidByte0, - MSETransportGuidByte4, + MSETransportGuidByte3, + MSETransportTime2, + MSEFallHorizontalSpeed, + MSEFallSinAngle, + MSEFallCosAngle, + MSEFallTime, + MSEFallVerticalSpeed, + MSEPitch, + MSEOrientation, + MSESplineElevation, + MSETimestamp, + MSEEnd, }; -//4.2.2 -MovementStatusElements MovementStartStrafeRightSequence[] = { +//4.3.4 +MovementStatusElements MovementStopSequence[] = +{ + MSEPositionX, + MSEPositionY, + MSEPositionZ, MSEHasGuidByte3, - MSEHasGuidByte2, - MSEHasGuidByte4, - MSEHasGuidByte5, - MSEHasGuidByte0, MSEHasGuidByte6, + MSEHasSplineElevation, MSEHasSpline, - MSEMovementFlags2, - MSEHasGuidByte1, - MSEMovementFlags, + MSEHasOrientation, MSEHasGuidByte7, - MSEHasSplineElev, - MSEHasPitch, + MSEHasMovementFlags, + MSEHasGuidByte5, + MSEHasFallData, + MSEHasMovementFlags2, MSEHasTransportData, - MSEHasTransportGuidByte0, - MSEHasTransportGuidByte6, - MSEHasTransportGuidByte2, - MSEHasTransportGuidByte5, + MSEHasTimestamp, + MSEHasGuidByte4, + MSEHasGuidByte1, + MSEZeroBit, + MSEHasGuidByte2, + MSEHasGuidByte0, + MSEHasPitch, + MSEHasTransportGuidByte7, MSEHasTransportGuidByte4, MSEHasTransportGuidByte1, - MSEHasTransportGuidByte3, - MSEHasTransportGuidByte7, + MSEHasTransportGuidByte5, MSEHasTransportTime2, MSEHasTransportTime3, - MSEHasFallData, + MSEHasTransportGuidByte3, + MSEHasTransportGuidByte6, + MSEHasTransportGuidByte0, + MSEHasTransportGuidByte2, + MSEMovementFlags, + MSEMovementFlags2, MSEHasFallDirection, - MSEOrientation, - MSETimestamp, - MSEPositionX, - MSEPositionY, - MSEPositionZ, - MSEGuidByte4, - MSEGuidByte1, - MSEGuidByte2, - MSESplineElevation, - MSEGuidByte0, - MSEPitch, MSEGuidByte6, MSEGuidByte3, - MSEGuidByte7, + MSEGuidByte0, + MSEGuidByte4, + MSEGuidByte2, + MSEGuidByte1, MSEGuidByte5, + MSEGuidByte7, + MSETransportGuidByte4, + MSETransportGuidByte7, + MSETransportTime, MSETransportSeat, - MSETransportOrientation, - MSETransportPositionX, - MSETransportPositionY, MSETransportPositionZ, - MSETransportTime, - MSETransportTime2, - MSETransportGuidByte3, - MSETransportGuidByte6, MSETransportTime3, - MSETransportGuidByte7, - MSETransportGuidByte5, MSETransportGuidByte2, - MSETransportGuidByte1, MSETransportGuidByte0, - MSETransportGuidByte4, - MSEFallTime, - MSEFallVerticalSpeed, - MSEFallHorizontalSpeed, + MSETransportPositionY, + MSETransportGuidByte1, + MSETransportGuidByte3, + MSETransportTime2, + MSETransportPositionX, + MSETransportOrientation, + MSETransportGuidByte5, + MSETransportGuidByte6, + MSETimestamp, + MSEOrientation, + MSEPitch, + MSESplineElevation, MSEFallCosAngle, MSEFallSinAngle, + MSEFallHorizontalSpeed, + MSEFallVerticalSpeed, + MSEFallTime, + MSEEnd, }; -//4.2.2 -MovementStatusElements MovementStartTurnLeftSequence[] = { - MSEHasGuidByte5, - MSEHasGuidByte4, - MSEHasGuidByte6, - MSEHasGuidByte0, - MSEHasGuidByte1, - MSEHasGuidByte7, +//4.3.4 +MovementStatusElements MovementStopStrafeSequence[] = +{ + MSEPositionY, + MSEPositionZ, + MSEPositionX, + MSEHasPitch, + MSEHasTimestamp, MSEHasGuidByte2, + MSEHasFallData, + MSEHasGuidByte7, + MSEHasSplineElevation, MSEHasGuidByte3, - MSEMovementFlags, - MSEMovementFlags2, - MSEHasSpline, + MSEHasOrientation, + MSEHasMovementFlags2, MSEHasTransportData, + MSEHasMovementFlags, + MSEHasSpline, + MSEHasGuidByte0, + MSEZeroBit, + MSEHasGuidByte6, + MSEHasGuidByte5, + MSEHasGuidByte1, + MSEHasGuidByte4, + MSEHasTransportGuidByte7, MSEHasTransportGuidByte0, - MSEHasTransportGuidByte6, + MSEHasTransportGuidByte4, MSEHasTransportGuidByte2, + MSEHasTransportGuidByte6, MSEHasTransportGuidByte5, - MSEHasTransportGuidByte4, + MSEHasTransportTime2, MSEHasTransportGuidByte1, MSEHasTransportGuidByte3, - MSEHasTransportGuidByte7, - MSEHasTransportTime2, MSEHasTransportTime3, - MSEHasSplineElev, - MSEHasFallData, + MSEMovementFlags, MSEHasFallDirection, - MSEHasPitch, - MSEPositionX, - MSEPositionY, - MSEPositionZ, - MSETimestamp, - MSEOrientation, + MSEMovementFlags2, + MSEGuidByte2, + MSEGuidByte7, + MSEGuidByte3, + MSEGuidByte4, + MSEGuidByte5, + MSEGuidByte6, + MSEGuidByte1, + MSEGuidByte0, MSETransportSeat, + MSETransportGuidByte6, + MSETransportPositionZ, + MSETransportTime3, + MSETransportGuidByte1, + MSETransportGuidByte3, + MSETransportGuidByte2, + MSETransportGuidByte4, + MSETransportGuidByte5, + MSETransportTime, MSETransportOrientation, MSETransportPositionX, + MSETransportGuidByte0, MSETransportPositionY, - MSETransportPositionZ, - MSETransportTime, MSETransportTime2, - MSETransportGuidByte3, - MSETransportGuidByte6, - MSETransportTime3, MSETransportGuidByte7, - MSETransportGuidByte5, - MSETransportGuidByte2, - MSETransportGuidByte1, - MSETransportGuidByte0, - MSETransportGuidByte4, - MSEGuidByte4, - MSEGuidByte0, - MSEGuidByte7, - MSEGuidByte1, - MSEGuidByte6, - MSEGuidByte5, - MSEGuidByte3, - MSESplineElevation, - MSEFallTime, - MSEFallVerticalSpeed, - MSEFallHorizontalSpeed, MSEFallCosAngle, + MSEFallHorizontalSpeed, MSEFallSinAngle, - MSEGuidByte2, + MSEFallTime, + MSEFallVerticalSpeed, + MSESplineElevation, + MSEOrientation, MSEPitch, + MSETimestamp, + MSEEnd, }; -//4.2.2 -MovementStatusElements MovementStartTurnRightSequence[] = { +//4.3.4 +MovementStatusElements MovementStopTurnSequence[] = +{ + MSEPositionZ, + MSEPositionX, + MSEPositionY, + MSEHasGuidByte5, MSEHasGuidByte4, + MSEHasFallData, + MSEZeroBit, MSEHasGuidByte1, - MSEHasGuidByte6, MSEHasGuidByte0, - MSEMovementFlags, - MSEHasGuidByte5, - MSEMovementFlags2, MSEHasSpline, + MSEHasMovementFlags, MSEHasGuidByte2, + MSEHasGuidByte6, + MSEHasPitch, + MSEHasTransportData, MSEHasGuidByte3, + MSEHasSplineElevation, + MSEHasTimestamp, + MSEHasMovementFlags2, + MSEHasOrientation, MSEHasGuidByte7, - MSEHasTransportData, - MSEHasTransportGuidByte0, - MSEHasTransportGuidByte6, MSEHasTransportGuidByte2, - MSEHasTransportGuidByte5, - MSEHasTransportGuidByte4, - MSEHasTransportGuidByte1, - MSEHasTransportGuidByte3, MSEHasTransportGuidByte7, - MSEHasTransportTime2, MSEHasTransportTime3, - MSEHasFallData, + MSEHasTransportGuidByte4, + MSEHasTransportTime2, + MSEHasTransportGuidByte5, + MSEHasTransportGuidByte0, + MSEHasTransportGuidByte3, + MSEHasTransportGuidByte6, + MSEHasTransportGuidByte1, MSEHasFallDirection, - MSEHasPitch, - MSEHasSplineElev, - MSEPositionX, - MSEPositionY, - MSEPositionZ, - MSEOrientation, - MSETimestamp, + MSEMovementFlags, + MSEMovementFlags2, + MSEGuidByte3, + MSEGuidByte2, MSEGuidByte6, + MSEGuidByte4, + MSEGuidByte0, + MSEGuidByte7, + MSEGuidByte1, + MSEGuidByte5, + MSESplineElevation, + MSETransportPositionX, + MSETransportGuidByte5, MSETransportSeat, + MSETransportGuidByte2, + MSETransportGuidByte3, MSETransportOrientation, - MSETransportPositionX, - MSETransportPositionY, - MSETransportPositionZ, - MSETransportTime, MSETransportTime2, - MSETransportGuidByte3, - MSETransportGuidByte6, MSETransportTime3, MSETransportGuidByte7, - MSETransportGuidByte5, - MSETransportGuidByte2, MSETransportGuidByte1, MSETransportGuidByte0, MSETransportGuidByte4, - MSEGuidByte2, - MSEGuidByte4, + MSETransportPositionY, + MSETransportPositionZ, + MSETransportTime, + MSETransportGuidByte6, MSEFallTime, - MSEFallVerticalSpeed, MSEFallHorizontalSpeed, MSEFallCosAngle, MSEFallSinAngle, + MSEFallVerticalSpeed, + MSETimestamp, MSEPitch, - MSEGuidByte7, - MSEGuidByte3, - MSEGuidByte1, - MSEGuidByte0, - MSESplineElevation, - MSEGuidByte5, + MSEOrientation, + MSEEnd, }; -//4.2.2 -MovementStatusElements MovementStopSequence[] = { - MSEHasGuidByte2, +//4.3.4 +MovementStatusElements MovementStartAscendSequence[] = +{ + MSEPositionX, + MSEPositionY, + MSEPositionZ, MSEHasGuidByte0, + MSEHasGuidByte1, + MSEHasGuidByte7, + MSEZeroBit, + MSEHasGuidByte5, + MSEHasTransportData, + MSEHasGuidByte2, + MSEHasSplineElevation, + MSEHasFallData, MSEHasSpline, - MSEMovementFlags, - MSEHasGuidByte4, - MSEHasGuidByte6, MSEHasGuidByte3, - MSEHasGuidByte5, - MSEHasGuidByte7, - MSEMovementFlags2, - MSEHasGuidByte1, + MSEHasMovementFlags2, + MSEHasGuidByte6, + MSEHasMovementFlags, MSEHasPitch, - MSEHasFallData, - MSEHasFallDirection, - MSEHasTransportData, + MSEHasTimestamp, + MSEHasOrientation, + MSEHasGuidByte4, + MSEMovementFlags, MSEHasTransportGuidByte0, - MSEHasTransportGuidByte6, MSEHasTransportGuidByte2, - MSEHasTransportGuidByte5, - MSEHasTransportGuidByte4, + MSEHasTransportTime3, + MSEHasTransportGuidByte6, MSEHasTransportGuidByte1, + MSEHasTransportGuidByte4, + MSEHasTransportTime2, + MSEHasTransportGuidByte5, MSEHasTransportGuidByte3, MSEHasTransportGuidByte7, - MSEHasTransportTime2, - MSEHasTransportTime3, - MSEHasSplineElev, - MSEOrientation, - MSETimestamp, - MSEPositionX, - MSEPositionY, - MSEPositionZ, - MSEGuidByte2, + MSEMovementFlags2, + MSEHasFallDirection, + MSEGuidByte6, MSEGuidByte3, - MSEPitch, - MSEFallTime, - MSEFallVerticalSpeed, - MSEFallHorizontalSpeed, - MSEFallCosAngle, - MSEFallSinAngle, + MSEGuidByte1, + MSEGuidByte4, + MSEGuidByte2, + MSEGuidByte0, MSEGuidByte5, MSEGuidByte7, + MSETransportGuidByte3, + MSETransportGuidByte5, + MSETransportGuidByte4, MSETransportSeat, + MSETransportGuidByte2, MSETransportOrientation, - MSETransportPositionX, MSETransportPositionY, - MSETransportPositionZ, - MSETransportTime, + MSETransportGuidByte7, MSETransportTime2, - MSETransportGuidByte3, - MSETransportGuidByte6, + MSETransportPositionZ, MSETransportTime3, - MSETransportGuidByte7, - MSETransportGuidByte5, - MSETransportGuidByte2, - MSETransportGuidByte1, + MSETransportGuidByte6, + MSETransportTime, MSETransportGuidByte0, - MSETransportGuidByte4, - MSEGuidByte1, - MSEGuidByte0, + MSETransportGuidByte1, + MSETransportPositionX, + MSEFallCosAngle, + MSEFallSinAngle, + MSEFallHorizontalSpeed, + MSEFallTime, + MSEFallVerticalSpeed, + MSEOrientation, + MSEPitch, + MSETimestamp, MSESplineElevation, - MSEGuidByte6, - MSEGuidByte4, + MSEEnd, }; -//4.2.2 -MovementStatusElements MovementStopStrafeSequence[] = { +//4.3.4 +MovementStatusElements MovementStartDescendSequence[] = +{ + MSEPositionY, + MSEPositionZ, + MSEPositionX, + MSEHasGuidByte0, + MSEHasPitch, + MSEHasFallData, MSEHasGuidByte4, - MSEMovementFlags2, - MSEHasGuidByte3, + MSEHasOrientation, + MSEHasTimestamp, + MSEHasMovementFlags2, + MSEHasMovementFlags, + MSEHasGuidByte6, + MSEZeroBit, MSEHasGuidByte1, - MSEMovementFlags, - MSEHasGuidByte5, + MSEHasTransportData, MSEHasSpline, - MSEHasGuidByte2, - MSEHasGuidByte6, - MSEHasGuidByte0, + MSEHasSplineElevation, + MSEHasGuidByte5, + MSEHasGuidByte3, MSEHasGuidByte7, - MSEHasFallData, - MSEHasFallDirection, - MSEHasPitch, - MSEHasSplineElev, - MSEHasTransportData, + MSEHasGuidByte2, MSEHasTransportGuidByte0, - MSEHasTransportGuidByte6, - MSEHasTransportGuidByte2, - MSEHasTransportGuidByte5, - MSEHasTransportGuidByte4, MSEHasTransportGuidByte1, - MSEHasTransportGuidByte3, + MSEHasTransportGuidByte2, + MSEHasTransportTime3, MSEHasTransportGuidByte7, + MSEHasTransportGuidByte4, + MSEHasTransportGuidByte6, MSEHasTransportTime2, - MSEHasTransportTime3, - MSEOrientation, - MSETimestamp, - MSEPositionX, - MSEPositionY, - MSEPositionZ, - MSEGuidByte1, + MSEHasTransportGuidByte3, + MSEHasTransportGuidByte5, + MSEMovementFlags2, + MSEMovementFlags, + MSEHasFallDirection, MSEGuidByte2, - MSEGuidByte6, - MSEGuidByte5, MSEGuidByte7, + MSEGuidByte6, MSEGuidByte0, - MSEFallTime, - MSEFallVerticalSpeed, - MSEFallHorizontalSpeed, - MSEFallCosAngle, - MSEFallSinAngle, + MSEGuidByte1, + MSEGuidByte5, + MSEGuidByte4, MSEGuidByte3, MSEPitch, - MSESplineElevation, - MSETransportSeat, - MSETransportOrientation, - MSETransportPositionX, - MSETransportPositionY, MSETransportPositionZ, - MSETransportTime, - MSETransportTime2, - MSETransportGuidByte3, - MSETransportGuidByte6, + MSETransportSeat, MSETransportTime3, + MSETransportGuidByte6, + MSETransportTime2, + MSETransportGuidByte1, + MSETransportTime, + MSETransportGuidByte4, + MSETransportPositionY, + MSETransportPositionX, MSETransportGuidByte7, + MSETransportGuidByte3, MSETransportGuidByte5, MSETransportGuidByte2, - MSETransportGuidByte1, + MSETransportOrientation, MSETransportGuidByte0, - MSETransportGuidByte4, - MSEGuidByte4, + MSEFallTime, + MSEFallSinAngle, + MSEFallCosAngle, + MSEFallHorizontalSpeed, + MSEFallVerticalSpeed, + MSETimestamp, + MSEOrientation, + MSESplineElevation, + MSEEnd, }; -//4.2.2 -MovementStatusElements MovementStopTurnSequence[] = { - MSEHasGuidByte6, - MSEMovementFlags, - MSEHasGuidByte2, +//4.3.4 +MovementStatusElements MovementStartSwimSequence[] = +{ + MSEPositionZ, + MSEPositionX, + MSEPositionY, MSEHasGuidByte3, - MSEMovementFlags2, - MSEHasGuidByte5, - MSEHasGuidByte7, - MSEHasGuidByte0, + MSEHasSplineElevation, MSEHasGuidByte4, - MSEHasGuidByte1, - MSEHasSpline, + MSEHasGuidByte7, + MSEZeroBit, MSEHasPitch, + MSEHasGuidByte0, + MSEHasOrientation, + MSEHasMovementFlags, MSEHasFallData, - MSEHasFallDirection, - MSEHasSplineElev, + MSEHasGuidByte5, MSEHasTransportData, - MSEHasTransportGuidByte0, - MSEHasTransportGuidByte6, - MSEHasTransportGuidByte2, - MSEHasTransportGuidByte5, - MSEHasTransportGuidByte4, - MSEHasTransportGuidByte1, + MSEHasMovementFlags2, + MSEHasTimestamp, + MSEHasGuidByte6, + MSEHasGuidByte1, + MSEHasSpline, + MSEHasGuidByte2, + MSEHasTransportGuidByte2, MSEHasTransportGuidByte3, MSEHasTransportGuidByte7, + MSEHasTransportGuidByte5, + MSEHasTransportGuidByte4, + MSEHasTransportGuidByte0, MSEHasTransportTime2, + MSEHasTransportGuidByte6, + MSEHasTransportGuidByte1, MSEHasTransportTime3, - MSETimestamp, - MSEPositionX, - MSEPositionY, - MSEPositionZ, - MSEOrientation, - MSEGuidByte4, + MSEMovementFlags, + MSEHasFallDirection, + MSEMovementFlags2, + MSEGuidByte0, + MSEGuidByte2, + MSEGuidByte1, MSEGuidByte5, + MSEGuidByte4, + MSEGuidByte6, + MSEGuidByte3, MSEGuidByte7, - MSEGuidByte1, MSEPitch, - MSEGuidByte3, - MSEGuidByte6, - MSEFallTime, - MSEFallVerticalSpeed, - MSEFallHorizontalSpeed, - MSEFallCosAngle, - MSEFallSinAngle, - MSESplineElevation, - MSEGuidByte0, - MSEGuidByte2, - MSETransportSeat, - MSETransportOrientation, - MSETransportPositionX, - MSETransportPositionY, - MSETransportPositionZ, - MSETransportTime, MSETransportTime2, + MSETransportGuidByte2, + MSETransportPositionY, MSETransportGuidByte3, - MSETransportGuidByte6, + MSETransportTime, + MSETransportPositionX, + MSETransportOrientation, MSETransportTime3, - MSETransportGuidByte7, + MSETransportGuidByte6, MSETransportGuidByte5, - MSETransportGuidByte2, + MSETransportGuidByte4, + MSETransportPositionZ, MSETransportGuidByte1, + MSETransportGuidByte7, MSETransportGuidByte0, - MSETransportGuidByte4, + MSETransportSeat, + MSEFallCosAngle, + MSEFallHorizontalSpeed, + MSEFallSinAngle, + MSEFallVerticalSpeed, + MSEFallTime, + MSEOrientation, + MSETimestamp, + MSESplineElevation, + MSEEnd, }; -//4.2.2 -MovementStatusElements MovementStartAscendSequence[] = { - MSEHasGuidByte3, - MSEHasGuidByte1, +//4.3.4 +MovementStatusElements MovementStopSwimSequence[] = +{ + MSEPositionX, + MSEPositionY, + MSEPositionZ, + MSEHasSpline, + MSEHasPitch, MSEHasGuidByte5, - MSEMovementFlags, + MSEHasGuidByte3, + MSEHasGuidByte7, + MSEHasSplineElevation, + MSEHasMovementFlags, MSEHasGuidByte4, + MSEHasMovementFlags2, + MSEHasGuidByte2, MSEHasGuidByte6, + MSEHasTransportData, + MSEHasOrientation, + MSEZeroBit, + MSEHasTimestamp, + MSEHasGuidByte1, MSEHasGuidByte0, - MSEHasGuidByte7, - MSEMovementFlags2, - MSEHasGuidByte2, - MSEHasSpline, MSEHasFallData, - MSEHasFallDirection, - MSEHasPitch, - MSEHasSplineElev, - MSEHasTransportData, - MSEHasTransportGuidByte0, - MSEHasTransportGuidByte6, - MSEHasTransportGuidByte2, - MSEHasTransportGuidByte5, + MSEHasTransportTime3, MSEHasTransportGuidByte4, - MSEHasTransportGuidByte1, + MSEHasTransportGuidByte6, MSEHasTransportGuidByte3, MSEHasTransportGuidByte7, + MSEHasTransportGuidByte1, + MSEHasTransportGuidByte0, MSEHasTransportTime2, - MSEHasTransportTime3, - MSEPositionX, - MSEPositionY, - MSEPositionZ, - MSETimestamp, - MSEOrientation, + MSEHasTransportGuidByte2, + MSEHasTransportGuidByte5, + MSEMovementFlags, + MSEMovementFlags2, + MSEHasFallDirection, + MSEGuidByte0, + MSEGuidByte4, MSEGuidByte3, - MSEFallTime, + MSEGuidByte6, + MSEGuidByte7, + MSEGuidByte1, + MSEGuidByte5, + MSEGuidByte2, + MSETransportTime3, + MSETransportGuidByte4, + MSETransportTime, + MSETransportPositionZ, + MSETransportSeat, + MSETransportGuidByte3, + MSETransportGuidByte2, + MSETransportPositionY, + MSETransportGuidByte7, + MSETransportGuidByte1, + MSETransportGuidByte6, + MSETransportGuidByte5, + MSETransportTime2, + MSETransportPositionX, + MSETransportGuidByte0, + MSETransportOrientation, MSEFallVerticalSpeed, - MSEFallHorizontalSpeed, MSEFallCosAngle, + MSEFallHorizontalSpeed, MSEFallSinAngle, + MSEFallTime, + MSETimestamp, MSEPitch, - MSEGuidByte0, - MSEGuidByte5, + MSEOrientation, MSESplineElevation, + MSEEnd, +}; + +//4.3.4 +MovementStatusElements MovementStopAscendSequence[] = +{ + MSEPositionZ, + MSEPositionY, + MSEPositionX, + MSEHasGuidByte3, + MSEHasGuidByte2, + MSEHasFallData, + MSEHasGuidByte7, + MSEHasOrientation, + MSEHasPitch, + MSEHasSpline, + MSEZeroBit, + MSEHasGuidByte1, + MSEHasGuidByte4, + MSEHasMovementFlags, + MSEHasGuidByte0, + MSEHasGuidByte6, + MSEHasSplineElevation, + MSEHasTransportData, + MSEHasMovementFlags2, + MSEHasTimestamp, + MSEHasGuidByte5, + MSEHasTransportTime2, + MSEHasTransportTime3, + MSEHasTransportGuidByte1, + MSEHasTransportGuidByte3, + MSEHasTransportGuidByte2, + MSEHasTransportGuidByte5, + MSEHasTransportGuidByte7, + MSEHasTransportGuidByte4, + MSEHasTransportGuidByte6, + MSEHasTransportGuidByte0, + MSEMovementFlags2, + MSEMovementFlags, + MSEHasFallDirection, + MSEGuidByte7, + MSEGuidByte5, + MSEGuidByte4, + MSEGuidByte3, + MSEGuidByte2, MSEGuidByte1, - MSETransportSeat, - MSETransportOrientation, - MSETransportPositionX, + MSEGuidByte0, + MSEGuidByte6, + MSETransportGuidByte5, MSETransportPositionY, - MSETransportPositionZ, - MSETransportTime, - MSETransportTime2, - MSETransportGuidByte3, - MSETransportGuidByte6, - MSETransportTime3, MSETransportGuidByte7, - MSETransportGuidByte5, MSETransportGuidByte2, + MSETransportGuidByte6, + MSETransportTime2, + MSETransportTime3, + MSETransportOrientation, + MSETransportGuidByte3, + MSETransportGuidByte4, + MSETransportSeat, MSETransportGuidByte1, + MSETransportTime, MSETransportGuidByte0, - MSETransportGuidByte4, - MSEGuidByte4, - MSEGuidByte7, - MSEGuidByte2, - MSEGuidByte6, + MSETransportPositionX, + MSETransportPositionZ, + MSEFallTime, + MSEFallVerticalSpeed, + MSEFallCosAngle, + MSEFallSinAngle, + MSEFallHorizontalSpeed, + MSEPitch, + MSESplineElevation, + MSETimestamp, + MSEOrientation, + MSEEnd, }; -//4.2.2 -MovementStatusElements MovementStartDescendSequence[] = { - MSEHasGuidByte6, +//4.3.4 +MovementStatusElements MovementStopPitchSequence[] = +{ + MSEPositionX, + MSEPositionZ, + MSEPositionY, + MSEHasFallData, + MSEHasMovementFlags, MSEHasGuidByte1, - MSEHasGuidByte0, + MSEHasOrientation, + MSEHasGuidByte7, MSEHasGuidByte3, - MSEMovementFlags, + MSEHasMovementFlags2, + MSEHasTransportData, + MSEHasSplineElevation, + MSEHasGuidByte6, + MSEHasPitch, MSEHasGuidByte4, - MSEHasGuidByte7, MSEHasSpline, - MSEHasGuidByte5, - MSEMovementFlags2, MSEHasGuidByte2, - MSEHasSplineElev, - MSEHasFallData, - MSEHasFallDirection, - MSEHasTransportData, - MSEHasTransportGuidByte0, + MSEZeroBit, + MSEHasTimestamp, + MSEHasGuidByte0, + MSEHasGuidByte5, + MSEHasTransportGuidByte3, MSEHasTransportGuidByte6, MSEHasTransportGuidByte2, - MSEHasTransportGuidByte5, MSEHasTransportGuidByte4, + MSEHasTransportGuidByte0, MSEHasTransportGuidByte1, - MSEHasTransportGuidByte3, - MSEHasTransportGuidByte7, - MSEHasTransportTime2, - MSEHasTransportTime3, - MSEHasPitch, - MSETimestamp, - MSEPositionX, - MSEPositionY, - MSEPositionZ, - MSEOrientation, - MSESplineElevation, + MSEHasTransportGuidByte5, + MSEHasTransportTime3, + MSEHasTransportGuidByte7, + MSEHasTransportTime2, + MSEMovementFlags2, + MSEMovementFlags, + MSEHasFallDirection, + MSEGuidByte3, MSEGuidByte7, - MSEGuidByte4, - MSEGuidByte2, - MSEGuidByte5, - MSEFallTime, - MSEFallVerticalSpeed, - MSEFallHorizontalSpeed, - MSEFallCosAngle, - MSEFallSinAngle, + MSEGuidByte1, MSEGuidByte6, - MSETransportSeat, - MSETransportOrientation, - MSETransportPositionX, - MSETransportPositionY, - MSETransportPositionZ, - MSETransportTime, - MSETransportTime2, + MSEGuidByte0, + MSEGuidByte5, + MSEGuidByte2, + MSEGuidByte4, + MSETransportGuidByte4, MSETransportGuidByte3, MSETransportGuidByte6, + MSETransportOrientation, + MSETransportGuidByte1, MSETransportTime3, - MSETransportGuidByte7, - MSETransportGuidByte5, + MSETransportTime, MSETransportGuidByte2, - MSETransportGuidByte1, + MSETransportPositionZ, MSETransportGuidByte0, - MSETransportGuidByte4, - MSEGuidByte0, - MSEGuidByte3, - MSEGuidByte1, + MSETransportTime2, + MSETransportPositionY, + MSETransportGuidByte5, + MSETransportSeat, + MSETransportGuidByte7, + MSETransportPositionX, + MSEFallVerticalSpeed, + MSEFallTime, + MSEFallHorizontalSpeed, + MSEFallCosAngle, + MSEFallSinAngle, MSEPitch, + MSESplineElevation, + MSETimestamp, + MSEOrientation, + MSEEnd, }; -//4.2.2 -MovementStatusElements MovementStartSwimSequence[] = { - MSEHasGuidByte2, - MSEHasSpline, - MSEHasGuidByte1, - MSEMovementFlags, - MSEHasGuidByte3, - MSEHasGuidByte5, - MSEHasGuidByte0, - MSEHasGuidByte6, +//4.3.4 +MovementStatusElements MovementStartPitchDownSequence[] = +{ + MSEPositionX, + MSEPositionZ, + MSEPositionY, + MSEHasMovementFlags, MSEHasGuidByte7, - MSEMovementFlags2, - MSEHasGuidByte4, + MSEHasGuidByte6, MSEHasPitch, - MSEHasSplineElev, - MSEHasFallData, - MSEHasFallDirection, + MSEZeroBit, + MSEHasGuidByte1, + MSEHasGuidByte4, + MSEHasTimestamp, + MSEHasSplineElevation, + MSEHasMovementFlags2, MSEHasTransportData, - MSEHasTransportGuidByte0, - MSEHasTransportGuidByte6, - MSEHasTransportGuidByte2, - MSEHasTransportGuidByte5, - MSEHasTransportGuidByte4, + MSEHasGuidByte0, + MSEHasGuidByte5, + MSEHasGuidByte3, + MSEHasSpline, + MSEHasOrientation, + MSEHasFallData, + MSEHasGuidByte2, MSEHasTransportGuidByte1, - MSEHasTransportGuidByte3, + MSEHasTransportGuidByte5, + MSEHasTransportTime3, MSEHasTransportGuidByte7, + MSEHasTransportGuidByte4, + MSEHasTransportGuidByte6, MSEHasTransportTime2, - MSEHasTransportTime3, - MSEPositionX, - MSEPositionY, - MSEPositionZ, - MSEOrientation, - MSETimestamp, - MSEPitch, - MSESplineElevation, - MSEGuidByte2, + MSEHasTransportGuidByte0, + MSEHasTransportGuidByte3, + MSEHasTransportGuidByte2, + MSEMovementFlags2, + MSEHasFallDirection, + MSEMovementFlags, + MSEGuidByte3, + MSEGuidByte7, MSEGuidByte0, MSEGuidByte5, + MSEGuidByte2, + MSEGuidByte6, MSEGuidByte4, - MSEGuidByte7, MSEGuidByte1, - MSEFallTime, - MSEFallVerticalSpeed, - MSEFallHorizontalSpeed, - MSEFallCosAngle, - MSEFallSinAngle, - MSEGuidByte3, - MSETransportSeat, - MSETransportOrientation, - MSETransportPositionX, - MSETransportPositionY, - MSETransportPositionZ, - MSETransportTime, - MSETransportTime2, - MSETransportGuidByte3, - MSETransportGuidByte6, MSETransportTime3, - MSETransportGuidByte7, + MSETransportGuidByte3, + MSETransportTime2, MSETransportGuidByte5, - MSETransportGuidByte2, MSETransportGuidByte1, - MSETransportGuidByte0, + MSETransportPositionY, + MSETransportGuidByte6, MSETransportGuidByte4, - MSEGuidByte6, + MSETransportTime, + MSETransportPositionZ, + MSETransportPositionX, + MSETransportGuidByte0, + MSETransportSeat, + MSETransportGuidByte2, + MSETransportGuidByte7, + MSETransportOrientation, + MSEFallSinAngle, + MSEFallHorizontalSpeed, + MSEFallCosAngle, + MSEFallVerticalSpeed, + MSEFallTime, + MSEPitch, + MSEOrientation, + MSESplineElevation, + MSETimestamp, + MSEEnd, }; -//4.2.2 -MovementStatusElements MovementStopAscendSequence[] = { - MSEHasGuidByte0, - MSEHasGuidByte3, - MSEMovementFlags2, - MSEHasGuidByte1, - MSEHasGuidByte5, - MSEHasSpline, +//4.3.4 +MovementStatusElements MovementStartPitchUpSequence[] = +{ + MSEPositionZ, + MSEPositionY, + MSEPositionX, MSEHasGuidByte4, + MSEHasMovementFlags, + MSEHasMovementFlags2, + MSEHasSpline, MSEHasGuidByte2, - MSEMovementFlags, - MSEHasGuidByte7, MSEHasGuidByte6, + MSEHasGuidByte3, + MSEZeroBit, + MSEHasSplineElevation, MSEHasFallData, - MSEHasFallDirection, + MSEHasGuidByte0, MSEHasTransportData, - MSEHasTransportGuidByte0, - MSEHasTransportGuidByte6, - MSEHasTransportGuidByte2, - MSEHasTransportGuidByte5, - MSEHasTransportGuidByte4, - MSEHasTransportGuidByte1, - MSEHasTransportGuidByte3, + MSEHasGuidByte1, + MSEHasGuidByte5, + MSEHasPitch, + MSEHasTimestamp, + MSEHasOrientation, + MSEHasGuidByte7, + MSEMovementFlags2, MSEHasTransportGuidByte7, + MSEHasTransportGuidByte3, + MSEHasTransportGuidByte1, MSEHasTransportTime2, + MSEHasTransportGuidByte4, MSEHasTransportTime3, - MSEHasPitch, - MSEHasSplineElev, - MSETimestamp, - MSEOrientation, - MSEPositionX, - MSEPositionY, - MSEPositionZ, + MSEHasTransportGuidByte0, + MSEHasTransportGuidByte6, + MSEHasTransportGuidByte5, + MSEHasTransportGuidByte2, + MSEMovementFlags, + MSEHasFallDirection, MSEGuidByte0, + MSEGuidByte3, + MSEGuidByte4, + MSEGuidByte6, + MSEGuidByte7, MSEGuidByte1, + MSEGuidByte5, MSEGuidByte2, - MSEGuidByte7, - MSEFallTime, - MSEFallVerticalSpeed, - MSEFallHorizontalSpeed, - MSEFallCosAngle, - MSEFallSinAngle, - MSETransportSeat, - MSETransportOrientation, MSETransportPositionX, - MSETransportPositionY, - MSETransportPositionZ, + MSETransportGuidByte1, + MSETransportGuidByte3, + MSETransportGuidByte2, + MSETransportGuidByte0, MSETransportTime, + MSETransportPositionZ, + MSETransportOrientation, + MSETransportGuidByte7, MSETransportTime2, - MSETransportGuidByte3, + MSETransportSeat, MSETransportGuidByte6, - MSETransportTime3, - MSETransportGuidByte7, MSETransportGuidByte5, - MSETransportGuidByte2, - MSETransportGuidByte1, - MSETransportGuidByte0, + MSETransportTime3, + MSETransportPositionY, MSETransportGuidByte4, - MSEPitch, - MSEGuidByte5, - MSEGuidByte4, - MSEGuidByte3, + MSEFallTime, + MSEFallCosAngle, + MSEFallSinAngle, + MSEFallHorizontalSpeed, + MSEFallVerticalSpeed, + MSEOrientation, MSESplineElevation, - MSEGuidByte6, + MSEPitch, + MSETimestamp, + MSEEnd, }; MovementStatusElements* GetMovementStatusElementsSequence(Opcodes opcode) { switch (opcode) { - case SMSG_PLAYER_MOVE: - return PlayerMoveSequence; - //case MSG_MOVE_FALL_LAND: - // return MovementFallLandSequence; - //case MSG_MOVE_HEARTBEAT: - // return MovementHeartBeatSequence; - //case MSG_MOVE_JUMP: - // return MovementJumpSequence; + case MSG_MOVE_FALL_LAND: + return MovementFallLandSequence; + case MSG_MOVE_HEARTBEAT: + return MovementHeartBeatSequence; + case MSG_MOVE_JUMP: + return MovementJumpSequence; //case MSG_MOVE_SET_FACING: // return MovementSetFacingSequence; //case MSG_MOVE_SET_PITCH: // return MovementSetPitchSequence; - //case MSG_MOVE_START_BACKWARD: - // return MovementStartBackwardSequence; + case MSG_MOVE_START_ASCEND: + return MovementStartAscendSequence; + case MSG_MOVE_START_BACKWARD: + return MovementStartBackwardSequence; + case MSG_MOVE_START_DESCEND: + return MovementStartDescendSequence; case MSG_MOVE_START_FORWARD: return MovementStartForwardSequence; - //case MSG_MOVE_START_STRAFE_LEFT: - // return MovementStartStrafeLeftSequence; - //case MSG_MOVE_START_STRAFE_RIGHT: - // return MovementStartStrafeRightSequence; - //case MSG_MOVE_START_TURN_LEFT: - // return MovementStartTurnLeftSequence; - //case MSG_MOVE_START_TURN_RIGHT: - // return MovementStartTurnRightSequence; - //case MSG_MOVE_STOP: - // return MovementStopSequence; - //case MSG_MOVE_STOP_STRAFE: - // return MovementStopStrafeSequence; - //case MSG_MOVE_STOP_TURN: - // return MovementStopTurnSequence; - //case MSG_MOVE_START_ASCEND: - // return MovementStartAscendSequence; - //case MSG_MOVE_START_DESCEND: - // return MovementStartDescendSequence; - //case MSG_MOVE_START_SWIM: - // return MovementStartSwimSequence; - //case MSG_MOVE_STOP_ASCEND: - // return MovementStopAscendSequence; + case MSG_MOVE_START_PITCH_DOWN: + return MovementStartPitchDownSequence; + case MSG_MOVE_START_PITCH_UP: + return MovementStartPitchUpSequence; + case MSG_MOVE_START_STRAFE_LEFT: + return MovementStartStrafeLeftSequence; + case MSG_MOVE_START_STRAFE_RIGHT: + return MovementStartStrafeRightSequence; + case MSG_MOVE_START_SWIM: + return MovementStartSwimSequence; + case MSG_MOVE_START_TURN_LEFT: + return MovementStartTurnLeftSequence; + case MSG_MOVE_START_TURN_RIGHT: + return MovementStartTurnRightSequence; + case MSG_MOVE_STOP: + return MovementStopSequence; + case MSG_MOVE_STOP_ASCEND: + return MovementStopAscendSequence; + case MSG_MOVE_STOP_PITCH: + return MovementStopPitchSequence; + case MSG_MOVE_STOP_STRAFE: + return MovementStopStrafeSequence; + case MSG_MOVE_STOP_SWIM: + return MovementStopSwimSequence; + case MSG_MOVE_STOP_TURN: + return MovementStopTurnSequence; + case SMSG_PLAYER_MOVE: + return PlayerMoveSequence; default: break; } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 3919b1c6fd0..56c99d76e99 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -712,11 +712,11 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(MSG_INSPECT_HONOR_STATS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectHonorStatsOpcode ); //DEFINE_OPCODE_HANDLER(MSG_LIST_STABLED_PETS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleListStabledPetsOpcode ); //DEFINE_OPCODE_HANDLER(MSG_MINIMAP_PING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMinimapPingOpcode ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_FALL_LAND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_FALL_LAND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_FEATHER_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_GRAVITY_CHNG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_HEARTBEAT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_JUMP, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_HEARTBEAT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_JUMP, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_ALL_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_COLLISION_HGT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -732,25 +732,25 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_SWIM_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_TURN_RATE_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_WALK_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_ASCEND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_BACKWARD, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_DESCEND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_START_ASCEND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_START_BACKWARD, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_START_DESCEND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); DEFINE_OPCODE_HANDLER(MSG_MOVE_START_FORWARD, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_PITCH_DOWN, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_PITCH_UP, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_STRAFE_LEFT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_STRAFE_RIGHT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_SWIM, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_START_PITCH_DOWN, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_START_PITCH_UP, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_START_STRAFE_LEFT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_START_STRAFE_RIGHT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_START_SWIM, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_SWIM_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_TURN_LEFT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_TURN_RIGHT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_ASCEND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_PITCH, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_STRAFE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_SWIM, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_START_TURN_LEFT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_START_TURN_RIGHT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_ASCEND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_PITCH, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_STRAFE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_SWIM, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_SWIM_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_TURN, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_TURN, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_TOGGLE_COLLISION_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_TOGGLE_FALL_LOGGING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_TOGGLE_LOGGING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index d02961e3a8c..3524f603ac8 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -487,7 +487,7 @@ enum Opcodes MSG_MOVE_FALL_LAND = 0x380A, MSG_MOVE_FEATHER_FALL = 0x0000, MSG_MOVE_GRAVITY_CHNG = 0x0000, - MSG_MOVE_HEARTBEAT = 0x0000, + MSG_MOVE_HEARTBEAT = 0x3914, MSG_MOVE_HOVER = 0x0000, MSG_MOVE_JUMP = 0x7A06, MSG_MOVE_SET_ALL_SPEED_CHEAT = 0x0000, @@ -515,7 +515,7 @@ enum Opcodes MSG_MOVE_START_TURN_RIGHT = 0x7000, MSG_MOVE_STOP = 0x320A, MSG_MOVE_STOP_ASCEND = 0x7B00, - MSG_MOVE_STOP_PITCH = 0x7312, + MSG_MOVE_STOP_PITCH = 0x7216, MSG_MOVE_STOP_STRAFE = 0x3002, MSG_MOVE_STOP_SWIM = 0x3802, MSG_MOVE_STOP_TURN = 0x331E, -- cgit v1.2.3 From 0c985ccc02b64d48c0db814dcc7eb66c40234fbe Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 16 Jul 2012 19:13:27 +0100 Subject: Core/PacketIO: 321 opcodes from WPP --- src/server/game/Server/Protocol/Opcodes.h | 546 ++++++++++++++++++------------ 1 file changed, 322 insertions(+), 224 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 3524f603ac8..6750ed87722 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -35,7 +35,8 @@ enum Opcodes CMSG_ACCEPT_LEVEL_GRANT = 0x0205, CMSG_ACCEPT_TRADE = 0x7110, CMSG_ACTIVATETAXI = 0x0000, - CMSG_ACTIVATETAXIEXPRESS = 0x0000, + CMSG_ACTIVATETAXIEXPRESS = 0x0515, + CMSG_ADDON_REGISTERED_PREFIXES = 0x0954, CMSG_ADD_FRIEND = 0x6C29, CMSG_ADD_IGNORE = 0x0000, CMSG_ADD_VOICE_IGNORE = 0x0F06, @@ -54,9 +55,10 @@ enum Opcodes CMSG_ARENA_TEAM_ROSTER = 0x0000, CMSG_ATTACKSTOP = 0x4106, CMSG_ATTACKSWING = 0x0926, - CMSG_AUCTION_LIST_BIDDER_ITEMS = 0x0000, + CMSG_AUCTION_LIST_BIDDER_ITEMS = 0x6937, CMSG_AUCTION_LIST_ITEMS = 0x0324, - CMSG_AUCTION_LIST_OWNER_ITEMS = 0x0000, + CMSG_AUCTION_LIST_OWNER_ITEMS = 0x0206, + CMSG_AUCTION_LIST_PENDING_SALES = 0x2C17, CMSG_AUCTION_PLACE_BID = 0x2306, CMSG_AUCTION_REMOVE_ITEM = 0x6426, CMSG_AUCTION_SELL_ITEM = 0x4A06, @@ -70,17 +72,17 @@ enum Opcodes CMSG_AUTOSTORE_GROUND_ITEM = 0x0000, CMSG_AUTOSTORE_LOOT_ITEM = 0x0E34, CMSG_AUTO_DECLINE_GUILD_INVITES = 0x2034, - CMSG_BANKER_ACTIVATE = 0x0000, + CMSG_BANKER_ACTIVATE = 0x0005, CMSG_BATTLEFIELD_JOIN = 0x0000, CMSG_BATTLEFIELD_LIST = 0x3814, CMSG_BATTLEFIELD_REQUEST_SCORE_DATA = 0x0000, CMSG_BATTLEFIELD_STATUS = 0x2500, CMSG_BATTLEMASTER_JOIN_ARENA = 0x0000, - CMSG_BEGIN_TRADE = 0x0000, + CMSG_BEGIN_TRADE = 0x721E, CMSG_BINDER_ACTIVATE = 0x4006, CMSG_BOT_DETECTED2 = 0x0000, CMSG_BUG = 0x4035, - CMSG_BUSY_TRADE = 0x0000, + CMSG_BUSY_TRADE = 0x331C, CMSG_BUYBACK_ITEM = 0x6C17, CMSG_BUY_BANK_SLOT = 0x0425, CMSG_BUY_ITEM = 0x0736, @@ -139,7 +141,7 @@ enum Opcodes CMSG_COMMENTATOR_GET_PLAYER_INFO = 0x0D14, CMSG_COMMENTATOR_INSTANCE_COMMAND = 0x0917, CMSG_COMMENTATOR_SKIRMISH_QUEUE_COMMAND = 0x0025, - CMSG_COMMENTATOR_START_WARGAME = 0x0000, + CMSG_COMMENTATOR_START_WARGAME = 0x25A0, CMSG_COMPLAIN = 0x0000, CMSG_COMPLETE_CINEMATIC = 0x0A16, CMSG_COMPLETE_MOVIE = 0x0000, @@ -155,17 +157,19 @@ enum Opcodes CMSG_DESTROY_ITEMS = 0x4A27, CMSG_DUEL_ACCEPTED = 0x0000, CMSG_DUEL_CANCELLED = 0x0000, + CMSG_DUNGEON_FINDER_GET_SYSTEM_INFO = 0x0412, CMSG_EJECT_PASSENGER = 0x0000, CMSG_EMOTE = 0x4C26, CMSG_ENABLE_NAGLE = 0x4449, // client CVar disableServerNagle set to 1 prevents sending this opcode CMSG_EQUIPMENT_SET_DELETE = 0x0000, CMSG_EQUIPMENT_SET_SAVE = 0x0000, CMSG_EQUIPMENT_SET_USE = 0x0000, - CMSG_FORCE_MOVE_ROOT_ACK = 0x0000, + CMSG_FORCE_MOVE_ROOT_ACK = 0x701E, CMSG_FORCE_MOVE_UNROOT_ACK = 0x7DB4, CMSG_GAMEOBJECT_QUERY = 0x4017, CMSG_GAMEOBJ_REPORT_USE = 0x0000, - CMSG_GAMEOBJ_USE = 0x0000, + CMSG_GAMEOBJ_REPORT_USE = 0x4827, + CMSG_GAMEOBJ_USE = 0x4E17, CMSG_GAMESPEED_SET = 0x0000, CMSG_GAMETIME_SET = 0x0000, CMSG_GETDEATHBINDZONE = 0x0000, @@ -174,7 +178,7 @@ enum Opcodes CMSG_GHOST = 0x0000, CMSG_GMRESPONSE_RESOLVE = 0x0000, CMSG_GMSURVEY_SUBMIT = 0x0000, - CMSG_GMTICKET_CREATE = 0x0000, + CMSG_GMTICKET_CREATE = 0x0137, CMSG_GMTICKET_DELETETICKET = 0x0000, CMSG_GMTICKET_GETTICKET = 0x0326, CMSG_GMTICKET_SYSTEMSTATUS = 0x0000, @@ -188,7 +192,7 @@ enum Opcodes CMSG_GRANT_LEVEL = 0x0000, CMSG_GROUP_ACCEPT = 0x0000, CMSG_GROUP_ASSISTANT_LEADER = 0x6025, - CMSG_GROUP_CANCEL = 0x0000, + CMSG_GROUP_CANCEL = 0x4D25, CMSG_GROUP_CHANGE_SUB_GROUP = 0x4124, CMSG_GROUP_DECLINE = 0x0000, CMSG_GROUP_DISBAND = 0x0000, @@ -206,34 +210,37 @@ enum Opcodes CMSG_GUILD_BANK_DEPOSIT_MONEY = 0x0000, CMSG_GUILD_BANK_NOTE = 0x0000, CMSG_GUILD_BANK_QUERY_TAB = 0x2E35, + CMSG_GUILD_BANK_REM_MONEY_WITHDRAW_QUERY = 0x5DB4, CMSG_GUILD_BANK_SWAP_ITEMS = 0x2315, CMSG_GUILD_BANK_UPDATE_TAB = 0x0106, - CMSG_GUILD_BANK_WITHDRAW_MONEY = 0x0000, + CMSG_GUILD_BANK_WITHDRAW_MONEY = 0x0037, CMSG_GUILD_CREATE = 0x0000, CMSG_GUILD_DECLINE = 0x0000, CMSG_GUILD_DEMOTE = 0x0000, CMSG_GUILD_DISBAND = 0x0000, CMSG_GUILD_INFO = 0x0000, + CMSG_GUILD_INFO_TEXT = 0x3227, CMSG_GUILD_INVITE = 0x0000, CMSG_GUILD_LEADER = 0x0000, CMSG_GUILD_LEAVE = 0x0000, CMSG_GUILD_MOTD = 0x1035, CMSG_GUILD_PROMOTE = 0x0000, CMSG_GUILD_QUERY = 0x4426, - CMSG_GUILD_RANK = 0x0000, + CMSG_GUILD_RANK = 0x1026, CMSG_GUILD_REMOVE = 0x0000, CMSG_GUILD_ROSTER = 0x1026, + CMSG_GUILD_SET_ACHIEVEMENT_TRACKING = 0x1027, CMSG_GUILD_SET_NOTE = 0x0000, CMSG_HEARTH_AND_RESURRECT = 0x4B34, - CMSG_IGNORE_TRADE = 0x0000, - CMSG_INITIATE_TRADE = 0x0000, + CMSG_IGNORE_TRADE = 0x7112, + CMSG_INITIATE_TRADE = 0x7916, CMSG_INSPECT = 0x0927, CMSG_INSTANCE_LOCK_WARNING_RESPONSE = 0x6234, CMSG_ITEM_REFUND = 0x6134, CMSG_ITEM_REFUND_INFO = 0x2206, CMSG_ITEM_TEXT_QUERY = 0x0000, CMSG_JOIN_CHANNEL = 0x0156, - CMSG_KEEP_ALIVE = 0x0000, + CMSG_KEEP_ALIVE = 0x0015, CMSG_LEARN_PREVIEW_TALENTS = 0x2415, CMSG_LEARN_PREVIEW_TALENTS_PET = 0x0000, CMSG_LEARN_TALENT = 0x6E24, @@ -247,7 +254,7 @@ enum Opcodes CMSG_LFG_PARTY_LOCK_INFO_REQUEST = 0x0000, CMSG_LFG_PROPOSAL_RESULT = 0x0000, CMSG_LFG_SET_ROLES = 0x25B1, - CMSG_LFG_TELEPORT = 0x0000, + CMSG_LFG_TELEPORT = 0x2482, CMSG_LIST_INVENTORY = 0x2806, CMSG_LOAD_SCREEN = 0x2422, CMSG_LOGOUT_CANCEL = 0x2324, @@ -259,35 +266,36 @@ enum Opcodes CMSG_LOOT_RELEASE = 0x2007, CMSG_LOOT_ROLL = 0x0000, CMSG_MAIL_CREATE_TEXT_ITEM = 0x0B14, - CMSG_MAIL_DELETE = 0x0000, + CMSG_MAIL_DELETE = 0x6104, CMSG_MAIL_MARK_AS_READ = 0x0000, CMSG_MAIL_RETURN_TO_SENDER = 0x0000, CMSG_MAIL_TAKE_ITEM = 0x2B06, CMSG_MAIL_TAKE_MONEY = 0x4034, CMSG_MEETINGSTONE_INFO = 0x0000, CMSG_MESSAGECHAT_ADDON_BATTLEGROUND = 0x0000, + CMSG_MESSAGECHAT_ADDON_BATTLEGROUND = 0x0D46, CMSG_MESSAGECHAT_ADDON_GUILD = 0x0544, CMSG_MESSAGECHAT_ADDON_PARTY = 0x0546, - CMSG_MESSAGECHAT_ADDON_RAID = 0x0000, - CMSG_MESSAGECHAT_ADDON_WHISPER = 0x0000, - CMSG_MESSAGECHAT_AFK = 0x0000, - CMSG_MESSAGECHAT_BATTLEGROUND = 0x0000, + CMSG_MESSAGECHAT_ADDON_RAID = 0x1D56, + CMSG_MESSAGECHAT_ADDON_WHISPER = 0x2146, + CMSG_MESSAGECHAT_AFK = 0x0D44, + CMSG_MESSAGECHAT_BATTLEGROUND = 0x2156, CMSG_MESSAGECHAT_BATTLEGROUND_LEADER = 0x0000, CMSG_MESSAGECHAT_CHANNEL = 0x1D44, - CMSG_MESSAGECHAT_DND = 0x0000, + CMSG_MESSAGECHAT_DND = 0x2946, CMSG_MESSAGECHAT_EMOTE = 0x0000, CMSG_MESSAGECHAT_GUILD = 0x3956, CMSG_MESSAGECHAT_OFFICER = 0x1946, - CMSG_MESSAGECHAT_PARTY = 0x0000, + CMSG_MESSAGECHAT_PARTY = 0x1D46, CMSG_MESSAGECHAT_PARTY_LEADER = 0x0000, - CMSG_MESSAGECHAT_RAID = 0x0000, + CMSG_MESSAGECHAT_RAID = 0x2D44, CMSG_MESSAGECHAT_RAID_LEADER = 0x0000, - CMSG_MESSAGECHAT_RAID_WARNING = 0x0000, + CMSG_MESSAGECHAT_RAID_WARNING = 0x0944, CMSG_MESSAGECHAT_SAY = 0x1154, CMSG_MESSAGECHAT_WHISPER = 0x0D56, CMSG_MESSAGECHAT_YELL = 0x3544, CMSG_MINIGAME_MOVE = 0x0000, - CMSG_MOUNTSPECIAL_ANIM = 0x0000, + CMSG_MOUNTSPECIAL_ANIM = 0x0217, CMSG_MOVE_CHARM_TELEPORT_CHEAT = 0x0000, CMSG_MOVE_ENABLE_SWIM_TO_FLY_TRANS_ACK = 0x0000, CMSG_MOVE_FEATHER_FALL_ACK = 0x0000, @@ -315,8 +323,9 @@ enum Opcodes CMSG_MOVE_WATER_WALK_ACK = 0x0000, CMSG_NAME_QUERY = 0x2224, CMSG_NEW_SPELL_SLOT = 0x0000, - CMSG_NEXT_CINEMATIC_CAMERA = 0x0000, + CMSG_NEXT_CINEMATIC_CAMERA = 0x2014, CMSG_NPC_TEXT_QUERY = 0x4E24, + CMSG_OBJECT_UPDATE_FAILED = 0x3808, CMSG_OFFER_PETITION = 0x4817, CMSG_OPENING_CINEMATIC = 0x0000, CMSG_OPEN_ITEM = 0x0000, @@ -332,6 +341,7 @@ enum Opcodes CMSG_PET_CANCEL_AURA = 0x0000, CMSG_PET_CAST_SPELL = 0x6337, CMSG_PET_LEARN_TALENT = 0x0000, + CMSG_PET_NAME_CACHE = 0x6F24, CMSG_PET_NAME_QUERY = 0x0000, CMSG_PET_RENAME = 0x0000, CMSG_PET_SET_ACTION = 0x0000, @@ -345,19 +355,20 @@ enum Opcodes CMSG_PLAYER_VEHICLE_ENTER = 0x0000, CMSG_PLAY_DANCE = 0x0000, CMSG_PUSHQUESTTOPARTY = 0x4B14, + CMSG_QUERY_BATTLEFIELD_STATE = 0x7202, CMSG_QUERY_GUILD_MAX_XP = 0x0000, CMSG_QUERY_GUILD_REWARDS = 0x0000, CMSG_QUERY_GUILD_XP = 0x0000, CMSG_QUERY_QUESTS_COMPLETED = 0x2317, CMSG_QUERY_TIME = 0x0A36, - CMSG_QUESTGIVER_ACCEPT_QUEST = 0x0000, + CMSG_QUESTGIVER_ACCEPT_QUEST = 0x6B37, CMSG_QUESTGIVER_CANCEL = 0x0000, - CMSG_QUESTGIVER_CHOOSE_REWARD = 0x0000, + CMSG_QUESTGIVER_CHOOSE_REWARD = 0x2125, CMSG_QUESTGIVER_COMPLETE_QUEST = 0x7302, CMSG_QUESTGIVER_HELLO = 0x0D17, - CMSG_QUESTGIVER_QUERY_QUEST = 0x0000, + CMSG_QUESTGIVER_QUERY_QUEST = 0x2F14, CMSG_QUESTGIVER_QUEST_AUTOLAUNCH = 0x0000, - CMSG_QUESTGIVER_REQUEST_REWARD = 0x0000, + CMSG_QUESTGIVER_REQUEST_REWARD = 0x2534, CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY = 0x6305, CMSG_QUESTGIVER_STATUS_QUERY = 0x4407, CMSG_QUESTLOG_REMOVE_QUEST = 0x0000, @@ -374,20 +385,23 @@ enum Opcodes CMSG_REDIRECTION_AUTH_PROOF = 0x044D, CMSG_REPAIR_ITEM = 0x2917, CMSG_REPLACE_ACCOUNT_DATA = 0x0000, - CMSG_REPOP_REQUEST = 0x0000, + CMSG_REPOP_REQUEST = 0x6B16, CMSG_REPORT_PVP_AFK = 0x0000, CMSG_REQUEST_ACCOUNT_DATA = 0x6505, CMSG_REQUEST_CATEGORY_COOLDOWNS = 0x7102, CMSG_REQUEST_CEMETERY_LIST = 0x720A, + CMSG_REQUEST_GUILD_PARTY_STATE = 0x3900, CMSG_REQUEST_HOTFIX = 0x2401, - CMSG_REQUEST_PARTY_MEMBER_STATS = 0x0000, + CMSG_REQUEST_INSPECT_RATED_BG_STATS = 0x3010, + CMSG_REQUEST_PARTY_MEMBER_STATS = 0x0C04, CMSG_REQUEST_PET_INFO = 0x4924, CMSG_REQUEST_RAID_INFO = 0x2F26, CMSG_REQUEST_RATED_BG_INFO = 0x34A1, CMSG_REQUEST_VEHICLE_EXIT = 0x0000, CMSG_REQUEST_VEHICLE_NEXT_SEAT = 0x0000, - CMSG_REQUEST_VEHICLE_PREV_SEAT = 0x0000, + CMSG_REQUEST_VEHICLE_PREV_SEAT = 0x4434, CMSG_REQUEST_VEHICLE_SWITCH_SEAT = 0x0000, + CMSG_RESET_FACTION_CHEAT = 0x4469, CMSG_RESET_INSTANCES = 0x6E14, CMSG_RESURRECT_RESPONSE = 0x6827, CMSG_RETURN_TO_GRAVEYARD = 0x0000, @@ -405,7 +419,7 @@ enum Opcodes CMSG_SET_ACTIVE_VOICE_CHANNEL = 0x4305, CMSG_SET_ALLOW_LOW_LEVEL_RAID1 = 0x4435, CMSG_SET_ALLOW_LOW_LEVEL_RAID2 = 0x0536, - CMSG_SET_CHANNEL_WATCH = 0x0000, + CMSG_SET_CHANNEL_WATCH = 0x4517, CMSG_SET_CONTACT_NOTES = 0x0000, CMSG_SET_FACTION_ATWAR = 0x0000, CMSG_SET_FACTION_CHEAT = 0x0000, @@ -418,23 +432,24 @@ enum Opcodes CMSG_SET_SKILL_CHEAT = 0x0000, CMSG_SET_TAXI_BENCHMARK_MODE = 0x4314, CMSG_SET_TITLE = 0x2117, - CMSG_SET_TRADE_GOLD = 0x0000, - CMSG_SET_TRADE_ITEM = 0x0000, + CMSG_SET_TRADE_GOLD = 0x3008, + CMSG_SET_TRADE_ITEM = 0x7B0C, CMSG_SET_WATCHED_FACTION = 0x0000, CMSG_SHOWING_CLOAK = 0x4135, CMSG_SHOWING_HELM = 0x0735, CMSG_SOCKET_GEMS = 0x2F04, - CMSG_SPELLCLICK = 0x0000, + CMSG_SPELLCLICK = 0x0805, CMSG_SPIRIT_HEALER_ACTIVATE = 0x2E26, CMSG_SPLIT_ITEM = 0x0000, CMSG_STANDSTATECHANGE = 0x0535, CMSG_START_QUEST = 0x0000, - CMSG_STOP_DANCE = 0x0000, + CMSG_STOP_DANCE = 0x4637, CMSG_STORE_LOOT_IN_SLOT = 0x0000, CMSG_SUMMON_RESPONSE = 0x0000, CMSG_SUSPEND_TOKEN = 0x046D, CMSG_SWAP_INV_ITEM = 0x2614, CMSG_SWAP_ITEM = 0x6326, + CMSG_SYNC_DANCE = 0x0036, CMSG_TAXICLEARALLNODES = 0x0000, CMSG_TAXIENABLEALLNODES = 0x0000, CMSG_TAXINODE_STATUS_QUERY = 0x2F25, @@ -444,7 +459,7 @@ enum Opcodes CMSG_TEXT_EMOTE = 0x2E24, CMSG_TIME_SYNC_RESP = 0x3B0C, CMSG_TOGGLE_PVP = 0x6815, - CMSG_TOTEM_DESTROYED = 0x0000, + CMSG_TOTEM_DESTROYED = 0x4207, CMSG_TRAINER_BUY_SPELL = 0x4415, CMSG_TRAINER_LIST = 0x2336, CMSG_TRIGGER_CINEMATIC_CHEAT = 0x0000, @@ -452,56 +467,101 @@ enum Opcodes CMSG_TUTORIAL_CLEAR = 0x0000, CMSG_TUTORIAL_FLAG = 0x0000, CMSG_TUTORIAL_RESET = 0x0000, - CMSG_UNACCEPT_TRADE = 0x0000, + CMSG_UNACCEPT_TRADE = 0x391A, CMSG_UNLEARN_SKILL = 0x0000, CMSG_UNREGISTER_ALL_ADDON_PREFIXES = 0x3D54, CMSG_UPDATE_ACCOUNT_DATA = 0x4736, CMSG_UPDATE_MISSILE_TRAJECTORY = 0x0000, CMSG_UPDATE_PROJECTILE_POSITION = 0x0000, - CMSG_USE_ITEM = 0x0000, + CMSG_USE_ITEM = 0x2C06, CMSG_VIOLENCE_LEVEL = 0x7816, CMSG_VOICE_SESSION_ENABLE = 0x2314, CMSG_WARDEN_DATA = 0x25A2, CMSG_WHO = 0x6C15, CMSG_WHOIS = 0x6B05, - CMSG_WORLD_PORT_RESPONSE = 0x0000, + CMSG_WORLD_PORT_RESPONSE = 0x2411, CMSG_WORLD_STATE_UI_TIMER_UPDATE = 0x4605, CMSG_WORLD_TELEPORT = 0x3330, CMSG_WRAP_ITEM = 0x0000, CMSG_ZONEUPDATE = 0x4F37, MSG_AUCTION_HELLO = 0x2307, MSG_BATTLEGROUND_PLAYER_POSITIONS = 0x0000, - MSG_CHANNEL_START = 0x0000, + MSG_CHANNEL_START = 0x0A15, MSG_CHANNEL_UPDATE = 0x0000, MSG_CORPSE_QUERY = 0x0000, + MSG_GET_CALENDAR = 0x2814, MSG_GM_BIND_OTHER = 0x0000, MSG_GM_SHOWLABEL = 0x0000, MSG_GM_SUMMON = 0x0000, MSG_GUILD_BANK_LOG_QUERY = 0x0000, MSG_GUILD_BANK_MONEY_WITHDRAWN = 0x0000, + MSG_GUILD_BANK_REM_MONEY_WITHDRAW_QUERY = 0x1225, MSG_GUILD_EVENT_LOG_QUERY = 0x0000, MSG_GUILD_PERMISSIONS = 0x3022, - MSG_INSPECT_ARENA_TEAMS = 0x0000, - MSG_LIST_STABLED_PETS = 0x0000, + MSG_INSPECT_ARENA_TEAMS = 0x2704, + MSG_LIST_STABLED_PETS = 0x0834, MSG_MINIMAP_PING = 0x6635, + MSG_MOVE_CHARM_TELEPORT_CHEAT = 0x7A08, + MSG_MOVE_ENABLE_TRANSITION_BETWEEN_SWIM_AND_FLY = 0x3014, MSG_MOVE_FALL_LAND = 0x380A, MSG_MOVE_FEATHER_FALL = 0x0000, + MSG_MOVE_FEATHER_FALL_ACK = 0x3110, + MSG_MOVE_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK = 0x310E, + MSG_MOVE_FORCE_FLIGHT_SPEED_CHANGE_ACK = 0x7314, + MSG_MOVE_FORCE_PITCH_RATE_CHANGE_ACK = 0x3100, + MSG_MOVE_FORCE_RUN_BACK_SPEED_CHANGE_ACK = 0x3216, + MSG_MOVE_FORCE_RUN_SPEED_CHANGE_ACK = 0x7818, + MSG_MOVE_FORCE_SWIM_BACK_SPEED_CHANGE_ACK = 0x7A16, + MSG_MOVE_FORCE_SWIM_SPEED_CHANGE_ACK = 0x7A10, + MSG_MOVE_FORCE_TURN_RATE_CHANGE_ACK = 0x7316, + MSG_MOVE_FORCE_WALK_SPEED_CHANGE_ACK = 0x7210, MSG_MOVE_GRAVITY_CHNG = 0x0000, MSG_MOVE_HEARTBEAT = 0x3914, MSG_MOVE_HOVER = 0x0000, + MSG_MOVE_HOVER_ACK = 0x3318, MSG_MOVE_JUMP = 0x7A06, + MSG_MOVE_KNOCK_BACK_ACK = 0x5CB4, + MSG_MOVE_ROOT = 0x7DA0, + MSG_MOVE_SET_ACTIVE_MOVER = 0x11B3, MSG_MOVE_SET_ALL_SPEED_CHEAT = 0x0000, - MSG_MOVE_SET_FACING = 0x0000, + MSG_MOVE_SET_CAN_FLY = 0x720E, + MSG_MOVE_SET_CAN_FLY_ACK = 0x790C, + MSG_MOVE_SET_COLLISION_HEIGHT = 0x59A3, + MSG_MOVE_SET_COLLISION_HEIGHT_ACK = 0x7114, + MSG_MOVE_SET_COMPOUND_STATE = 0x75A0, + MSG_MOVE_SET_FACING = 0x7914, + MSG_MOVE_SET_FEATHER_FALL = 0x79B0, + MSG_MOVE_SET_FLIGHT_BACK_SPEED = 0x30A2, MSG_MOVE_SET_FLIGHT_BACK_SPEED_CHEAT = 0x0000, + MSG_MOVE_SET_FLIGHT_SPEED = 0x71A6, MSG_MOVE_SET_FLIGHT_SPEED_CHEAT = 0x0000, - MSG_MOVE_SET_PITCH = 0x0000, + MSG_MOVE_SET_HOVERING = 0x5CB3, + MSG_MOVE_SET_LAND_WALK = 0x34B7, + MSG_MOVE_SET_NORMAL_FALL = 0x51B6, + MSG_MOVE_SET_PITCH = 0x7312, MSG_MOVE_SET_RAW_POSITION_ACK = 0x0000, + MSG_MOVE_SET_RUN_BACK_SPEED = 0x71B1, MSG_MOVE_SET_RUN_BACK_SPEED_CHEAT = 0x0000, + MSG_MOVE_SET_RUN_MODE = 0x791A, + MSG_MOVE_SET_RUN_SPEED = 0x3DB5, MSG_MOVE_SET_RUN_SPEED_CHEAT = 0x0000, + MSG_MOVE_SET_SWIM_BACK_SPEED = 0x5CA6, MSG_MOVE_SET_SWIM_BACK_SPEED_CHEAT = 0x0000, MSG_MOVE_SET_SWIM_SPEED_CHEAT = 0x0000, MSG_MOVE_SET_TURN_RATE_CHEAT = 0x0000, + MSG_MOVE_SET_WALK_MODE = 0x7002, + MSG_MOVE_SET_WALK_SPEED = 0x1DA4, MSG_MOVE_SET_WALK_SPEED_CHEAT = 0x0000, + MSG_MOVE_SET_WATER_WALK = 0x75B1, + MSG_MOVE_SKIP_TIME = 0x19B3, + MSG_MOVE_SPLINE_DONE = 0x790E, + MSG_MOVE_SPLINE_SET_FEATHER_FALL = 0x3DA5, + MSG_MOVE_SPLINE_SET_FLYING = 0x31B5, + MSG_MOVE_SPLINE_SET_LAND_WALK = 0x3DA7, + MSG_MOVE_SPLINE_SET_NORMAL_FALL = 0x38B2, + MSG_MOVE_SPLINE_SET_RUN_SPEED = 0x51B7, + MSG_MOVE_SPLINE_UNSET_FLYING = 0x58A6, + MSG_MOVE_SPLINE_UNSET_HOVER = 0x7DA5, MSG_MOVE_START_ASCEND = 0x390A, MSG_MOVE_START_BACKWARD = 0x330A, MSG_MOVE_START_DESCEND = 0x3800, @@ -519,10 +579,18 @@ enum Opcodes MSG_MOVE_STOP_STRAFE = 0x3002, MSG_MOVE_STOP_SWIM = 0x3802, MSG_MOVE_STOP_TURN = 0x331E, + MSG_MOVE_TELEPORT = 0x55A0, + MSG_MOVE_TELEPORT_ACK = 0x390C, + MSG_MOVE_TELEPORT_CHEAT = 0x3A10, MSG_MOVE_TOGGLE_COLLISION_CHEAT = 0x7B04, MSG_MOVE_TOGGLE_FALL_LOGGING = 0x0000, MSG_MOVE_TOGGLE_LOGGING = 0x0000, + MSG_MOVE_UNROOT = 0x7DB4, MSG_MOVE_UPDATE_CAN_FLY = 0x0000, + MSG_MOVE_UPDATE_FLIGHT_SPEED = 0x30B1, + MSG_MOVE_UPDATE_MOUSE = 0x7914, + MSG_MOVE_UPDATE_RUN_SPEED = 0x14A6, + MSG_MOVE_UPDATE_TELEPORT = 0x50B2, MSG_MOVE_WATER_WALK = 0x0000, MSG_NOTIFY_PARTY_SQUELCH = 0x0000, MSG_PARTY_ASSIGNMENT = 0x0000, @@ -531,15 +599,16 @@ enum Opcodes MSG_PVP_LOG_DATA = 0x5CB2, MSG_QUERY_GUILD_BANK_TEXT = 0x0000, MSG_QUERY_NEXT_MAIL_TIME = 0x0F04, - MSG_QUEST_PUSH_RESULT = 0x0000, - MSG_RAID_READY_CHECK = 0x0000, - MSG_RAID_READY_CHECK_CONFIRM = 0x0000, + MSG_QUEST_PUSH_RESULT = 0x4515, + MSG_RAID_READY_CHECK = 0x2304, + MSG_RAID_READY_CHECK_CONFIRM = 0x4F05, MSG_RAID_READY_CHECK_FINISHED = 0x0000, MSG_RAID_TARGET_UPDATE = 0x2C36, MSG_RANDOM_ROLL = 0x0905, MSG_SAVE_GUILD_EMBLEM = 0x2404, MSG_SET_DUNGEON_DIFFICULTY = 0x4925, MSG_SET_RAID_DIFFICULTY = 0x0614, + MSG_START_MOVE_FORWARD = 0x7814, MSG_TABARDVENDOR_ACTIVATE = 0x6926, MSG_TALENT_WIPE_CONFIRM = 0x0000, MSG_VERIFY_CONNECTIVITY = 0x4F57, @@ -547,22 +616,22 @@ enum Opcodes SMSG_ACHIEVEMENT_DELETED = 0x6A16, SMSG_ACHIEVEMENT_EARNED = 0x4405, SMSG_ACTION_BUTTONS = 0x38B5, - SMSG_ACTIVATETAXIREPLY = 0x0000, + SMSG_ACTIVATETAXIREPLY = 0x6A37, SMSG_ADDON_INFO = 0x2C14, SMSG_ADD_RUNE_POWER = 0x0000, SMSG_AI_REACTION = 0x0637, SMSG_ALL_ACHIEVEMENT_DATA = 0x58B1, SMSG_AREA_SPIRIT_HEALER_TIME = 0x0000, SMSG_AREA_TRIGGER_MESSAGE = 0x0000, - SMSG_ARENA_ERROR = 0x0000, - SMSG_ARENA_OPPONENT_UPDATE = 0x0000, + SMSG_ARENA_ERROR = 0x2D17, + SMSG_ARENA_OPPONENT_UPDATE = 0x2637, SMSG_ARENA_TEAM_CHANGE_FAILED_QUEUED = 0x0000, - SMSG_ARENA_TEAM_COMMAND_RESULT = 0x0000, - SMSG_ARENA_TEAM_EVENT = 0x0000, + SMSG_ARENA_TEAM_COMMAND_RESULT = 0x39B3, + SMSG_ARENA_TEAM_EVENT = 0x0617, SMSG_ARENA_TEAM_INVITE = 0x0000, SMSG_ARENA_TEAM_QUERY_RESPONSE = 0x6336, SMSG_ARENA_TEAM_ROSTER = 0x2717, - SMSG_ARENA_TEAM_STATS = 0x0000, + SMSG_ARENA_TEAM_STATS = 0x4425, SMSG_ATTACKERSTATEUPDATE = 0x0B25, SMSG_ATTACKSTART = 0x2D15, SMSG_ATTACKSTOP = 0x0934, @@ -570,51 +639,52 @@ enum Opcodes SMSG_ATTACKSWING_CANT_ATTACK = 0x0016, SMSG_ATTACKSWING_DEADTARGET = 0x0000, SMSG_ATTACKSWING_NOTINRANGE = 0x0000, - SMSG_AUCTION_BIDDER_LIST_RESULT = 0x0000, - SMSG_AUCTION_BIDDER_NOTIFICATION = 0x0000, - SMSG_AUCTION_COMMAND_RESULT = 0x0000, - SMSG_AUCTION_LIST_PENDING_SALES = 0x0000, - SMSG_AUCTION_LIST_RESULT = 0x0000, - SMSG_AUCTION_OWNER_LIST_RESULT = 0x0000, - SMSG_AUCTION_OWNER_NOTIFICATION = 0x0000, - SMSG_AUCTION_REMOVED_NOTIFICATION = 0x0000, + SMSG_AUCTION_BIDDER_LIST_RESULT = 0x6637, + SMSG_AUCTION_BIDDER_NOTIFICATION = 0x4E27, + SMSG_AUCTION_COMMAND_RESULT = 0x4C25, + SMSG_AUCTION_LIST_PENDING_SALES = 0x6A27, + SMSG_AUCTION_LIST_RESULT = 0x0027, + SMSG_AUCTION_OWNER_LIST_RESULT = 0x6C34, + SMSG_AUCTION_OWNER_NOTIFICATION = 0x4116, + SMSG_AUCTION_REMOVED_NOTIFICATION = 0x2334, SMSG_AURACASTLOG = 0x0000, SMSG_AURA_UPDATE = 0x4707, SMSG_AURA_UPDATE_ALL = 0x6916, SMSG_AUTH_CHALLENGE = 0x4542, SMSG_AUTH_RESPONSE = 0x5DB6, - SMSG_AVAILABLE_VOICE_CHANNEL = 0x0000, + SMSG_AVAILABLE_VOICE_CHANNEL = 0x2E16, SMSG_BARBER_SHOP_RESULT = 0x6125, SMSG_BATTLEFIELD_LIST = 0x71B5, - SMSG_BATTLEFIELD_MGR_EJECTED = 0x0000, - SMSG_BATTLEFIELD_MGR_EJECT_PENDING = 0x0000, - SMSG_BATTLEFIELD_MGR_ENTERED = 0x0000, - SMSG_BATTLEFIELD_MGR_ENTRY_INVITE = 0x0000, + SMSG_BATTLEFIELD_MGR_EJECTED = 0x7DB7, + SMSG_BATTLEFIELD_MGR_EJECT_PENDING = 0x15A6, + SMSG_BATTLEFIELD_MGR_ENTERED = 0x5CA0, + SMSG_BATTLEFIELD_MGR_ENTRY_INVITE = 0x34B3, SMSG_BATTLEFIELD_MGR_QUEUE_INVITE = 0x0000, - SMSG_BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE = 0x0000, - SMSG_BATTLEFIELD_MGR_STATE_CHANGE = 0x0000, + SMSG_BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE = 0x79B6, + SMSG_BATTLEFIELD_MGR_STATE_CHANGE = 0x35B4, + SMSG_BATTLEFIELD_PLAYER_POSITIONS = 0x58B4, SMSG_BATTLEFIELD_PORT_DENIED = 0x0000, SMSG_BATTLEFIELD_STATUS = 0x0000, SMSG_BATTLEFIELD_STATUS1 = 0x0000, - SMSG_BATTLEFIELD_STATUS2 = 0x0000, - SMSG_BATTLEFIELD_STATUS3 = 0x0000, - SMSG_BATTLEFIELD_STATUS4 = 0x0000, + SMSG_BATTLEFIELD_STATUS2 = 0x74A4, + SMSG_BATTLEFIELD_STATUS3 = 0x59A0, + SMSG_BATTLEFIELD_STATUS4 = 0x75A2, SMSG_BATTLEGROUND_INFO_THROTTLED = 0x0000, SMSG_BATTLEGROUND_PLAYER_JOINED = 0x0000, SMSG_BATTLEGROUND_PLAYER_LEFT = 0x0000, SMSG_BATTLEGROUND_PLAYER_POSITIONS = 0x0000, - SMSG_BINDER_CONFIRM = 0x0000, + SMSG_BINDER_CONFIRM = 0x2835, SMSG_BINDPOINTUPDATE = 0x0527, SMSG_BINDZONEREPLY = 0x0000, SMSG_BREAK_TARGET = 0x0000, SMSG_BUY_BANK_SLOT_RESULT = 0x0000, - SMSG_BUY_FAILED = 0x0000, + SMSG_BUY_FAILED = 0x6435, SMSG_BUY_ITEM = 0x0F26, SMSG_CALENDAR_ACTION_PENDING = 0x0000, SMSG_CALENDAR_ARENA_TEAM = 0x0000, SMSG_CALENDAR_CLEAR_PENDING_ACTION = 0x0000, SMSG_CALENDAR_COMMAND_RESULT = 0x6F36, - SMSG_CALENDAR_EVENT_INVITE = 0x0000, + SMSG_CALENDAR_EVENT_INVITE = 0x0725, SMSG_CALENDAR_EVENT_INVITE_ALERT = 0x0000, SMSG_CALENDAR_EVENT_INVITE_NOTES = 0x0000, SMSG_CALENDAR_EVENT_INVITE_NOTES_ALERT = 0x0000, @@ -624,20 +694,21 @@ enum Opcodes SMSG_CALENDAR_EVENT_MODERATOR_STATUS_ALERT = 0x0000, SMSG_CALENDAR_EVENT_REMOVED_ALERT = 0x0000, SMSG_CALENDAR_EVENT_STATUS = 0x0000, - SMSG_CALENDAR_EVENT_UPDATED_ALERT = 0x0000, + SMSG_CALENDAR_EVENT_UPDATED_ALERT = 0x0907, SMSG_CALENDAR_RAID_LOCKOUT_ADDED = 0x0000, SMSG_CALENDAR_RAID_LOCKOUT_REMOVED = 0x0000, SMSG_CALENDAR_RAID_LOCKOUT_UPDATED = 0x0000, - SMSG_CALENDAR_SEND_CALENDAR = 0x0000, + SMSG_CALENDAR_SEND_CALENDAR = 0x6805, SMSG_CALENDAR_SEND_EVENT = 0x0000, SMSG_CALENDAR_SEND_NUM_PENDING = 0x0C17, SMSG_CALENDAR_UPDATE_INVITE_LIST = 0x0000, - SMSG_CAMERA_SHAKE = 0x0000, + SMSG_CAMERA_SHAKE = 0x4214, SMSG_CANCEL_AUTO_REPEAT = 0x6436, - SMSG_CANCEL_COMBAT = 0x0000, - SMSG_CAST_FAILED = 0x0000, + SMSG_CANCEL_COMBAT = 0x4F04, + SMSG_CAST_FAILED = 0x4D16, + SMSG_CATEGORY_COOLDOWN = 0x71B6, SMSG_CHANNEL_LIST = 0x0000, - SMSG_CHANNEL_MEMBER_COUNT = 0x0000, + SMSG_CHANNEL_MEMBER_COUNT = 0x6414, SMSG_CHANNEL_NOTIFY = 0x0825, SMSG_CHARACTER_LOGIN_FAILED = 0x4417, SMSG_CHAR_CREATE = 0x2D05, @@ -654,20 +725,22 @@ enum Opcodes SMSG_CLEAR_COOLDOWN = 0x0000, SMSG_CLEAR_TARGET = 0x4B26, SMSG_CLIENTCACHE_VERSION = 0x2734, - SMSG_CLIENT_CONTROL_UPDATE = 0x0000, + SMSG_CLIENT_CONTROL_UPDATE = 0x2837, SMSG_COMBAT_LOG_MULTIPLE = 0x0000, - SMSG_COMMENTATOR_MAP_INFO = 0x0000, + SMSG_COMMENTATOR_MAP_INFO = 0x0327, SMSG_COMMENTATOR_PLAYER_INFO = 0x0000, - SMSG_COMMENTATOR_STATE_CHANGED = 0x0000, + SMSG_COMMENTATOR_STATE_CHANGED = 0x0737, SMSG_COMPLAIN_RESULT = 0x0000, + SMSG_COMPLETION_NPC_RESPONCE = 0x75A1, SMSG_COMPRESSED_ACHIEVEMENT_DATA = 0x0000, SMSG_COMPRESSED_CHAR_ENUM = 0x0000, SMSG_COMPRESSED_GUILD_ROSTER = 0x0000, - SMSG_COMPRESSED_MOVES = 0x0000, + SMSG_COMPRESSED_MOVES = 0x0517, SMSG_COMPRESSED_UPDATE_OBJECT = 0x0000, + SMSG_COMSAT_DISCONNECT = 0x0316, SMSG_CONTACT_LIST = 0x6017, SMSG_CONVERT_RUNE = 0x0000, - SMSG_COOLDOWN_CHEAT = 0x0000, + SMSG_COOLDOWN_CHEAT = 0x0627, SMSG_COOLDOWN_EVENT = 0x4F26, SMSG_CORPSE_MAP_POSITION_QUERY_RESPONSE = 0x0000, SMSG_CORPSE_NOT_IN_INSTANCE = 0x0000, @@ -675,26 +748,27 @@ enum Opcodes SMSG_CREATURE_QUERY_RESPONSE = 0x6024, SMSG_CRITERIA_DELETED = 0x2915, SMSG_CRITERIA_UPDATE = 0x6E37, - SMSG_CROSSED_INEBRIATION_THRESHOLD = 0x0000, + SMSG_CROSSED_INEBRIATION_THRESHOLD = 0x2036, SMSG_DAMAGE_CALC_LOG = 0x0000, + SMSG_DAMAGE_CALC_LOG = 0x2436, SMSG_DAMAGE_DONE_OBSOLETE = 0x0000, SMSG_DANCE_QUERY_RESPONSE = 0x2F06, SMSG_DB_REPLY = 0x38A4, - SMSG_DEATH_RELEASE_LOC = 0x0000, + SMSG_DEATH_RELEASE_LOC = 0x2F07, SMSG_DEFENSE_MESSAGE = 0x0314, SMSG_DESTROY_OBJECT = 0x4724, SMSG_DESTRUCTIBLE_BUILDING_DAMAGE = 0x0000, - SMSG_DISMOUNT = 0x0000, - SMSG_DISMOUNTRESULT = 0x0000, - SMSG_DISPEL_FAILED = 0x0000, - SMSG_DUEL_COMPLETE = 0x0000, - SMSG_DUEL_COUNTDOWN = 0x0000, + SMSG_DISMOUNT = 0x2135, + SMSG_DISMOUNTRESULT = 0x0D25, + SMSG_DISPEL_FAILED = 0x0307, + SMSG_DUEL_COMPLETE = 0x2527, + SMSG_DUEL_COUNTDOWN = 0x4836, SMSG_DUEL_INBOUNDS = 0x0000, SMSG_DUEL_OUTOFBOUNDS = 0x0000, SMSG_DUEL_REQUESTED = 0x4504, SMSG_DUEL_WINNER = 0x2527, SMSG_DURABILITY_DAMAGE_DEATH = 0x0000, - SMSG_ECHO_PARTY_SQUELCH = 0x0000, + SMSG_ECHO_PARTY_SQUELCH = 0x0814, SMSG_EMOTE = 0x0A34, SMSG_ENABLE_BARBER_SHOP = 0x0000, SMSG_ENCHANTMENTLOG = 0x6035, @@ -702,35 +776,37 @@ enum Opcodes SMSG_EQUIPMENT_SET_LIST = 0x2E04, SMSG_EQUIPMENT_SET_SAVED = 0x0000, SMSG_EQUIPMENT_SET_USE_RESULT = 0x0000, - SMSG_EXPECTED_SPAM_RECORDS = 0x0000, - SMSG_EXPLORATION_EXPERIENCE = 0x0000, + SMSG_EXPECTED_SPAM_RECORDS = 0x4D36, + SMSG_EXPLORATION_EXPERIENCE = 0x6716, + SMSG_FAILED_PLAYER_CONDITION = 0x19A4, SMSG_FEATURE_SYSTEM_STATUS = 0x3DB7, - SMSG_FISH_ESCAPED = 0x0000, - SMSG_FISH_NOT_HOOKED = 0x0000, + SMSG_FISH_ESCAPED = 0x2205, + SMSG_FISH_NOT_HOOKED = 0x0A17, SMSG_FLIGHT_SPLINE_SYNC = 0x0924, SMSG_FORCEACTIONSHOW = 0x0000, SMSG_FORCED_DEATH_UPDATE = 0x0000, SMSG_FORCE_DISPLAY_UPDATE = 0x0000, SMSG_FORCE_SEND_QUEUED_PACKETS = 0x0140, - SMSG_FRIEND_STATUS = 0x0000, - SMSG_GAMEOBJECT_CUSTOM_ANIM = 0x0000, - SMSG_GAMEOBJECT_DESPAWN_ANIM = 0x0000, + SMSG_FRIEND_STATUS = 0x0717, + SMSG_GAMEOBJECT_CUSTOM_ANIM = 0x4936, + SMSG_GAMEOBJECT_DESPAWN_ANIM = 0x6735, SMSG_GAMEOBJECT_PAGETEXT = 0x0000, SMSG_GAMEOBJECT_QUERY_RESPONSE = 0x0915, SMSG_GAMEOBJECT_RESET_STATE = 0x0000, - SMSG_GAMESPEED_SET = 0x0000, - SMSG_GAMETIME_SET = 0x0000, - SMSG_GAMETIME_UPDATE = 0x0000, - SMSG_GMRESPONSE_DB_ERROR = 0x0000, - SMSG_GMRESPONSE_RECEIVED = 0x0000, - SMSG_GMRESPONSE_STATUS_UPDATE = 0x0000, - SMSG_GMTICKET_CREATE = 0x0000, - SMSG_GMTICKET_DELETETICKET = 0x0000, + SMSG_GAMESPEED_SET = 0x4E34, + SMSG_GAMETIME_SET = 0x0014, + SMSG_GAMETIME_UPDATE = 0x4127, + SMSG_GMRESPONSE_DB_ERROR = 0x0006, + SMSG_GMRESPONSE_RECEIVED = 0x2E34, + SMSG_GMRESPONSE_STATUS_UPDATE = 0x0A04, + SMSG_GMTICKET_CREATE = 0x2107, + SMSG_GMTICKET_DELETETICKET = 0x6D17, SMSG_GMTICKET_GETTICKET = 0x2C15, - SMSG_GMTICKET_SYSTEMSTATUS = 0x0000, - SMSG_GMTICKET_UPDATETEXT = 0x0000, + SMSG_GMTICKET_SYSTEMSTATUS = 0x0D35, + SMSG_GMTICKET_UPDATETEXT = 0x6535, SMSG_GM_MESSAGECHAT = 0x6434, - SMSG_GODMODE = 0x0000, + SMSG_GM_TICKET_STATUS_UPDATE = 0x2C25, + SMSG_GODMODE = 0x0405, SMSG_GOSSIP_COMPLETE = 0x0806, SMSG_GOSSIP_MESSAGE = 0x2035, SMSG_GOSSIP_POI = 0x4316, @@ -738,76 +814,89 @@ enum Opcodes SMSG_GROUP_DECLINE = 0x0000, SMSG_GROUP_DESTROYED = 0x0000, SMSG_GROUP_INVITE = 0x0000, - SMSG_GROUP_JOINED_BATTLEGROUND = 0x0000, + SMSG_GROUP_INVITE = 0x31B2, + SMSG_GROUP_JOINED_BATTLEGROUND = 0x35A1, SMSG_GROUP_LIST = 0x4C24, SMSG_GROUP_SET_LEADER = 0x0526, + SMSG_GROUP_SET_ROLE = 0x39A6, SMSG_GROUP_UNINVITE = 0x0000, + SMSG_GUILDFINDER_POST_UPDATED = 0x35B7, + SMSG_GUILDFINDER_RECRUITS_UPDATED = 0x1CB2, SMSG_GUILDFINDER_SEARCH_RESULT = 0x0000, SMSG_GUILD_ACHIEVEMENT_DATA = 0x54B7, SMSG_GUILD_ACHIEVEMENT_DELETED = 0x35A0, SMSG_GUILD_ACHIEVEMENT_EARNED = 0x50B5, SMSG_GUILD_BANK_LIST = 0x78A5, SMSG_GUILD_CANCEL = 0x0000, - SMSG_GUILD_COMMAND_RESULT = 0x0000, + SMSG_GUILD_CHALLENGE_UPDATED = 0x18B1, + SMSG_GUILD_COMMAND_RESULT = 0x7DB3, SMSG_GUILD_CRITERIA_DATA = 0x14B4, SMSG_GUILD_CRITERIA_DELETED = 0x55B1, - SMSG_GUILD_DECLINE = 0x0000, + SMSG_GUILD_DECLINE = 0x2C07, SMSG_GUILD_EVENT = 0x0705, SMSG_GUILD_INFO = 0x0000, SMSG_GUILD_INVITE = 0x14A2, - SMSG_GUILD_MAX_DAILY_XP = 0x0000, - SMSG_GUILD_NEWS_UPDATE = 0x0000, + SMSG_GUILD_INVITE_CANCEL = 0x0606, + SMSG_GUILD_KNOWN_RECIPES = 0x10B3, + SMSG_GUILD_MAX_DAILY_XP = 0x79B5, + SMSG_GUILD_MEMBER_DAILY_RESET = 0x10A5, + SMSG_GUILD_NEWS_UPDATE = 0x35A7, + SMSG_GUILD_PARTY_STATE_RESPONSE = 0x50A6, + SMSG_GUILD_PERMISSIONS_QUERY_RESULTS = 0x34A3, SMSG_GUILD_QUERY_RESPONSE = 0x0E06, SMSG_GUILD_RANK = 0x30B4, SMSG_GUILD_RANKS_UPDATE = 0x0000, - SMSG_GUILD_REWARDS_LIST = 0x0000, + SMSG_GUILD_REPUTATION_WEEKLY_CAP = 0x30B7, + SMSG_GUILD_REWARDS_LIST = 0x1DB0, SMSG_GUILD_ROSTER = 0x3DA3, SMSG_GUILD_SET_NOTE = 0x0000, SMSG_GUILD_TRADESKILL_UPDATE = 0x0000, SMSG_GUILD_UPDATE_ROSTER = 0x18B0, - SMSG_GUILD_XP_UPDATE = 0x0000, - SMSG_HIGHEST_THREAT_UPDATE = 0x0000, + SMSG_GUILD_XP = 0x3DB0, + SMSG_GUILD_XP_UPDATE = 0x14A1, + SMSG_HEALTH_UPDATE = 0x4734, + SMSG_HIGHEST_THREAT_UPDATE = 0x4104, SMSG_HOTFIX_INFO = 0x19B5, SMSG_INITIALIZE_FACTIONS = 0x4634, SMSG_INITIAL_SPELLS = 0x0104, SMSG_INIT_CURRENCY = 0x15A5, SMSG_INIT_WORLD_STATES = 0x4C15, - SMSG_INSPECT = 0x0000, - SMSG_INSPECT_HONOR_STATS = 0x0000, - SMSG_INSPECT_TALENT = 0x0000, + SMSG_INSPECT = 0x0C14, + SMSG_INSPECT_HONOR_STATS = 0x79A5, + SMSG_INSPECT_TALENT = 0x4014, SMSG_INSTANCE_DIFFICULTY = 0x0000, SMSG_INSTANCE_LOCK_WARNING_QUERY = 0x0000, - SMSG_INSTANCE_RESET = 0x0000, - SMSG_INSTANCE_RESET_FAILED = 0x0000, - SMSG_INSTANCE_SAVE_CREATED = 0x0000, + SMSG_INSTANCE_RESET = 0x6F05, + SMSG_INSTANCE_RESET_FAILED = 0x4725, + SMSG_INSTANCE_SAVE_CREATED = 0x0124, SMSG_INVALIDATE_DANCE = 0x0E27, SMSG_INVALIDATE_PLAYER = 0x6325, SMSG_INVALID_PROMOTION_CODE = 0x0000, - SMSG_INVENTORY_CHANGE_FAILURE = 0x0000, + SMSG_INVENTORY_CHANGE_FAILURE = 0x2236, SMSG_ITEM_COOLDOWN = 0x0000, SMSG_ITEM_ENCHANT_TIME_UPDATE = 0x0F27, SMSG_ITEM_NAME_QUERY_RESPONSE = 0x0000, - SMSG_ITEM_PUSH_RESULT = 0x0000, - SMSG_ITEM_REFUND_INFO_RESPONSE = 0x0000, - SMSG_ITEM_REFUND_RESULT = 0x0000, + SMSG_ITEM_PUSH_RESULT = 0x0E15, + SMSG_ITEM_REFUND_INFO_RESPONSE = 0x15A3, + SMSG_ITEM_REFUND_RESULT = 0x5DB1, SMSG_ITEM_TEXT_QUERY_RESPONSE = 0x2725, SMSG_ITEM_TIME_UPDATE = 0x0000, SMSG_JOINED_BATTLEGROUND_QUEUE = 0x0000, SMSG_KICK_REASON = 0x0000, SMSG_LEARNED_DANCE_MOVES = 0x0E05, SMSG_LEARNED_SPELL = 0x58A2, - SMSG_LEVELUP_INFO = 0x0000, + SMSG_LEVELUP_INFO = 0x0435, SMSG_LFG_BOOT_PROPOSAL_UPDATE = 0x0000, - SMSG_LFG_DISABLED = 0x0000, + SMSG_LFG_DISABLED = 0x0815, SMSG_LFG_JOIN_RESULT = 0x0000, SMSG_LFG_OFFER_CONTINUE = 0x0000, SMSG_LFG_OPEN_FROM_GOSSIP = 0x0000, - SMSG_LFG_PARTY_INFO = 0x0000, + SMSG_LFG_PARTY_INFO = 0x2325, SMSG_LFG_PLAYER_INFO = 0x4B36, SMSG_LFG_PLAYER_REWARD = 0x0000, SMSG_LFG_PROPOSAL_UPDATE = 0x0000, SMSG_LFG_QUEUE_STATUS = 0x0000, - SMSG_LFG_ROLE_CHECK_UPDATE = 0x0000, + SMSG_LFG_ROLE_CHECK_UPDATE = 0x0336, SMSG_LFG_ROLE_CHOSEN = 0x0000, SMSG_LFG_TELEPORT_DENIED = 0x0000, SMSG_LFG_UPDATE_LIST = 0x0000, @@ -815,6 +904,7 @@ enum Opcodes SMSG_LFG_UPDATE_PLAYER = 0x0000, SMSG_LFG_UPDATE_SEARCH = 0x0000, SMSG_LIST_INVENTORY = 0x7CB0, + SMSG_LOAD_CUF_PROFILES = 0x50B1, SMSG_LOGIN_SETTIMESPEED = 0x4D15, SMSG_LOGIN_VERIFY_WORLD = 0x2005, SMSG_LOGOUT_CANCEL_ACK = 0x6514, @@ -824,28 +914,28 @@ enum Opcodes SMSG_LOOT_ALL_PASSED = 0x6237, SMSG_LOOT_CLEAR_MONEY = 0x0E15, SMSG_LOOT_ITEM_NOTIFY = 0x6D15, - SMSG_LOOT_LIST = 0x0000, - SMSG_LOOT_MASTER_LIST = 0x0000, - SMSG_LOOT_MONEY_NOTIFY = 0x0000, + SMSG_LOOT_LIST = 0x6807, + SMSG_LOOT_MASTER_LIST = 0x0325, + SMSG_LOOT_MONEY_NOTIFY = 0x2836, SMSG_LOOT_RELEASE_RESPONSE = 0x6D25, SMSG_LOOT_REMOVED = 0x6817, SMSG_LOOT_RESPONSE = 0x4C16, SMSG_LOOT_ROLL = 0x6507, SMSG_LOOT_ROLL_WON = 0x6617, - SMSG_LOOT_SLOT_CHANGED = 0x0000, - SMSG_LOOT_START_ROLL = 0x0000, + SMSG_LOOT_SLOT_CHANGED = 0x2935, + SMSG_LOOT_START_ROLL = 0x2227, SMSG_MAIL_LIST_RESULT = 0x4217, SMSG_MEETINGSTONE_COMPLETE = 0x0000, SMSG_MEETINGSTONE_IN_PROGRESS = 0x0000, SMSG_MEETINGSTONE_MEMBER_ADDED = 0x0000, SMSG_MEETINGSTONE_SETQUEUE = 0x0000, SMSG_MESSAGECHAT = 0x2026, - SMSG_MIRRORIMAGE_DATA = 0x0000, + SMSG_MIRRORIMAGE_DATA = 0x2634, SMSG_MODIFY_COOLDOWN = 0x0000, SMSG_MONSTER_MOVE = 0x6E17, SMSG_MONSTER_MOVE_TRANSPORT = 0x2004, SMSG_MOTD = 0x0A35, - SMSG_MOUNTRESULT = 0x0000, + SMSG_MOUNTRESULT = 0x2225, SMSG_MOUNTSPECIAL_ANIM = 0x0000, SMSG_MOVE_DISABLE_COLLISION = 0x0000, SMSG_MOVE_DISABLE_GRAVITY = 0x0000, @@ -883,143 +973,146 @@ enum Opcodes SMSG_MOVE_UPDATE_KNOCK_BACK = 0x0000, SMSG_MOVE_UPDATE_TELEPORT = 0x0000, SMSG_MOVE_WATER_WALK = 0x0000, - SMSG_MULTIPLE_PACKETS = 0x0000, + SMSG_MULTIPLE_PACKETS = 0x6736, SMSG_NAME_QUERY_RESPONSE = 0x6E04, SMSG_NEW_TAXI_PATH = 0x0000, SMSG_NEW_WORLD = 0x31A2, - SMSG_NOTIFICATION = 0x0000, - SMSG_NOTIFY_DANCE = 0x0000, + SMSG_NOTIFICATION = 0x14A0, + SMSG_NOTIFY_DANCE = 0x4904, SMSG_NOTIFY_DEST_LOC_SPELL_CAST = 0x0000, SMSG_NPC_TEXT_UPDATE = 0x4436, SMSG_NPC_WONT_TALK = 0x0000, - SMSG_OFFER_PETITION_ERROR = 0x0000, - SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA = 0x0000, + SMSG_OFFER_PETITION_ERROR = 0x2716, + SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA = 0x4D34, SMSG_OPEN_CONTAINER = 0x0000, SMSG_OVERRIDE_LIGHT = 0x0000, SMSG_PAGE_TEXT_QUERY_RESPONSE = 0x2B14, - SMSG_PARTYKILLLOG = 0x0000, - SMSG_PARTY_COMMAND_RESULT = 0x0000, - SMSG_PARTY_MEMBER_STATS = 0x0000, - SMSG_PARTY_MEMBER_STATS_FULL = 0x0000, + SMSG_PARTYKILLLOG = 0x4937, + SMSG_PARTY_COMMAND_RESULT = 0x0A07, + SMSG_PARTY_MEMBER_STATS = 0x2104, + SMSG_PARTY_MEMBER_STATS_FULL = 0x0215, SMSG_PAUSE_MIRROR_TIMER = 0x0000, SMSG_PERIODICAURALOG = 0x0416, SMSG_PETGODMODE = 0x0000, SMSG_PETITION_QUERY_RESPONSE = 0x4B37, SMSG_PETITION_SHOWLIST = 0x0000, - SMSG_PETITION_SHOW_SIGNATURES = 0x0000, + SMSG_PETITION_SHOW_SIGNATURES = 0x0716, SMSG_PETITION_SIGN_RESULTS = 0x0000, - SMSG_PET_ACTION_FEEDBACK = 0x0000, - SMSG_PET_ACTION_SOUND = 0x0000, - SMSG_PET_CAST_FAILED = 0x0000, - SMSG_PET_DISMISS_SOUND = 0x0000, + SMSG_PET_ACTION_FEEDBACK = 0x0807, + SMSG_PET_ACTION_SOUND = 0x4324, + SMSG_PET_ADDED = 0x3CA5, + SMSG_PET_CAST_FAILED = 0x2B15, + SMSG_PET_DISMISS_SOUND = 0x2B05, SMSG_PET_GUIDS = 0x2D26, - SMSG_PET_LEARNED_SPELL = 0x0000, + SMSG_PET_LEARNED_SPELL = 0x0507, SMSG_PET_MODE = 0x2235, SMSG_PET_NAME_INVALID = 0x0000, SMSG_PET_NAME_QUERY_RESPONSE = 0x4C37, - SMSG_PET_REMOVED_SPELL = 0x0000, + SMSG_PET_REMOVED_SPELL = 0x6A04, SMSG_PET_SPELLS = 0x4114, SMSG_PET_TAME_FAILURE = 0x0000, - SMSG_PET_UPDATE_COMBO_POINTS = 0x0000, + SMSG_PET_UPDATE_COMBO_POINTS = 0x4325, SMSG_PLAYED_TIME = 0x6037, SMSG_PLAYERBINDERROR = 0x0000, - SMSG_PLAYERBOUND = 0x0000, - SMSG_PLAYER_DIFFICULTY_CHANGE = 0x0000, + SMSG_PLAYERBOUND = 0x2516, + SMSG_PLAYER_DIFFICULTY_CHANGE = 0x2217, SMSG_PLAYER_MOVE = 0x79A2, - SMSG_PLAYER_SKINNED = 0x0000, + SMSG_PLAYER_SKINNED = 0x0116, SMSG_PLAYER_UNK_DEAD_ALIVE = 0x0000, - SMSG_PLAYER_VEHICLE_DATA = 0x0000, - SMSG_PLAY_DANCE = 0x0000, + SMSG_PLAYER_VEHICLE_DATA = 0x4115, + SMSG_PLAY_DANCE = 0x4704, SMSG_PLAY_MUSIC = 0x0000, - SMSG_PLAY_OBJECT_SOUND = 0x0000, + SMSG_PLAY_OBJECT_SOUND = 0x2635, SMSG_PLAY_SOUND = 0x2134, SMSG_PLAY_SPELL_IMPACT = 0x0000, SMSG_PLAY_SPELL_VISUAL = 0x55A5, - SMSG_PLAY_TIME_WARNING = 0x0000, + SMSG_PLAY_TIME_WARNING = 0x4814, SMSG_PONG = 0x4D42, SMSG_POWER_UPDATE = 0x4A07, - SMSG_PRE_RESURRECT = 0x0000, - SMSG_PROCRESIST = 0x0000, + SMSG_PRE_RESURRECT = 0x6C36, + SMSG_PROCRESIST = 0x0426, SMSG_PROPOSE_LEVEL_GRANT = 0x0000, SMSG_PUREMOUNT_CANCELLED_OBSOLETE = 0x0000, SMSG_PVP_CREDIT = 0x0000, + SMSG_PVP_LOG_DATA = 0x54A3, SMSG_QUERY_QUESTS_COMPLETED_RESPONSE = 0x6314, SMSG_QUERY_TIME_RESPONSE = 0x2124, SMSG_QUESTGIVER_OFFER_REWARD = 0x2427, SMSG_QUESTGIVER_QUEST_COMPLETE = 0x55A4, SMSG_QUESTGIVER_QUEST_DETAILS = 0x2425, - SMSG_QUESTGIVER_QUEST_FAILED = 0x0000, + SMSG_QUESTGIVER_QUEST_FAILED = 0x4236, SMSG_QUESTGIVER_QUEST_INVALID = 0x0000, - SMSG_QUESTGIVER_QUEST_LIST = 0x0000, - SMSG_QUESTGIVER_REQUEST_ITEMS = 0x0000, + SMSG_QUESTGIVER_QUEST_LIST = 0x0134, + SMSG_QUESTGIVER_REQUEST_ITEMS = 0x6236, SMSG_QUESTGIVER_STATUS = 0x2115, SMSG_QUESTGIVER_STATUS_MULTIPLE = 0x4F25, - SMSG_QUESTLOG_FULL = 0x0000, + SMSG_QUESTLOG_FULL = 0x0E36, SMSG_QUESTUPDATE_ADD_ITEM = 0x0000, SMSG_QUESTUPDATE_ADD_KILL = 0x0D27, - SMSG_QUESTUPDATE_ADD_PVP_KILL = 0x0000, - SMSG_QUESTUPDATE_COMPLETE = 0x0000, - SMSG_QUESTUPDATE_FAILED = 0x0000, + SMSG_QUESTUPDATE_ADD_PVP_KILL = 0x4416, + SMSG_QUESTUPDATE_COMPLETE = 0x2937, + SMSG_QUESTUPDATE_FAILED = 0x6324, SMSG_QUESTUPDATE_FAILEDTIMER = 0x0000, - SMSG_QUEST_CONFIRM_ACCEPT = 0x0000, - SMSG_QUEST_FORCE_REMOVED = 0x0000, - SMSG_QUEST_NPC_QUERY_RESPONSE = 0x0000, + SMSG_QUEST_CONFIRM_ACCEPT = 0x6F07, + SMSG_QUEST_FORCE_REMOVED = 0x6605, SMSG_QUEST_POI_QUERY_RESPONSE = 0x6304, SMSG_QUEST_QUERY_RESPONSE = 0x6936, - SMSG_RAID_GROUP_ONLY = 0x0000, + SMSG_RAID_GROUP_ONLY = 0x0837, SMSG_RAID_INSTANCE_INFO = 0x6626, - SMSG_RAID_INSTANCE_MESSAGE = 0x0000, + SMSG_RAID_INSTANCE_MESSAGE = 0x6E15, SMSG_RANDOMIZE_CHAR_NAME = 0x38B1, SMSG_READ_ITEM_FAILED = 0x0000, SMSG_READ_ITEM_OK = 0x0000, SMSG_REALM_SPLIT = 0x2714, - SMSG_REAL_GROUP_UPDATE = 0x0000, + SMSG_REAL_GROUP_UPDATE = 0x0F34, SMSG_RECEIVED_MAIL = 0x4927, SMSG_REDIRECT_CLIENT = 0x0942, SMSG_REFER_A_FRIEND_FAILURE = 0x0000, SMSG_REMOVED_SPELL = 0x4804, SMSG_REPORT_PVP_AFK_RESULT = 0x0000, - SMSG_REQUEST_CEMETERY_LIST_RESPONSE = 0x0000, + SMSG_REQUEST_CEMETERY_LIST_RESPONSE = 0x30A7, SMSG_RESET_FAILED_NOTIFY = 0x0000, SMSG_RESISTLOG = 0x0000, SMSG_RESPOND_INSPECT_ACHIEVEMENTS = 0x15B0, SMSG_RESURRECT_REQUEST = 0x0000, SMSG_RESYNC_RUNES = 0x0000, - SMSG_RWHOIS = 0x0000, + SMSG_RWHOIS = 0x2437, + SMSG_SAVE_CUF_PROFILES = 0x730E, SMSG_SELL_ITEM = 0x6105, - SMSG_SEND_MAIL_RESULT = 0x0000, + SMSG_SEND_MAIL_RESULT = 0x4927, SMSG_SEND_UNLEARN_SPELLS = 0x4E25, - SMSG_SERVERTIME = 0x0000, + SMSG_SERVERTIME = 0x6327, SMSG_SERVER_FIRST_ACHIEVEMENT = 0x6424, SMSG_SERVER_MESSAGE = 0x6C04, - SMSG_SET_FACTION_ATWAR = 0x0000, + SMSG_SETUP_RESEARCH_HISTORY = 0x10B6, + SMSG_SET_FACTION_ATWAR = 0x4216, SMSG_SET_FACTION_STANDING = 0x0126, - SMSG_SET_FACTION_VISIBLE = 0x0000, + SMSG_SET_FACTION_VISIBLE = 0x2525, SMSG_SET_FLAT_SPELL_MODIFIER = 0x2834, - SMSG_SET_FORCED_REACTIONS = 0x0000, + SMSG_SET_FORCED_REACTIONS = 0x4615, SMSG_SET_PCT_SPELL_MODIFIER = 0x0224, SMSG_SET_PHASE_SHIFT = 0x70A0, SMSG_SET_PLAYER_DECLINED_NAMES_RESULT = 0x2B25, - SMSG_SET_PLAY_HOVER_ANIM = 0x0000, + SMSG_SET_PLAY_HOVER_ANIM = 0x30A6, SMSG_SET_PROFICIENCY = 0x6207, SMSG_SET_PROJECTILE_POSITION = 0x0000, - SMSG_SHOWTAXINODES = 0x0000, - SMSG_SHOW_BANK = 0x0000, - SMSG_SPELLBREAKLOG = 0x0000, + SMSG_SHOWTAXINODES = 0x2A36, + SMSG_SHOW_BANK = 0x2627, + SMSG_SPELLBREAKLOG = 0x6B17, SMSG_SPELLDAMAGESHIELD = 0x2927, - SMSG_SPELLDISPELLOG = 0x0000, + SMSG_SPELLDISPELLOG = 0x4516, SMSG_SPELLENERGIZELOG = 0x0414, SMSG_SPELLHEALLOG = 0x2816, - SMSG_SPELLINSTAKILLLOG = 0x0000, + SMSG_SPELLINSTAKILLLOG = 0x6216, SMSG_SPELLLOGEXECUTE = 0x0626, SMSG_SPELLLOGMISS = 0x0625, SMSG_SPELLNONMELEEDAMAGELOG = 0x4315, SMSG_SPELLORDAMAGE_IMMUNE = 0x4507, - SMSG_SPELLSTEALLOG = 0x0000, + SMSG_SPELLSTEALLOG = 0x4E26, SMSG_SPELL_COOLDOWN = 0x4B16, - SMSG_SPELL_DELAYED = 0x0000, - SMSG_SPELL_FAILED_OTHER = 0x0000, - SMSG_SPELL_FAILURE = 0x0000, + SMSG_SPELL_DELAYED = 0x0715, + SMSG_SPELL_FAILED_OTHER = 0x0C34, + SMSG_SPELL_FAILURE = 0x4535, SMSG_SPELL_GO = 0x6E16, SMSG_SPELL_START = 0x6415, SMSG_SPELL_UPDATE_CHAIN_TARGETS = 0x0000, @@ -1051,64 +1144,69 @@ enum Opcodes SMSG_SPLINE_MOVE_UNROOT = 0x0000, SMSG_SPLINE_MOVE_UNSET_FLYING = 0x0000, SMSG_SPLINE_MOVE_UNSET_HOVER = 0x0000, - SMSG_STABLE_RESULT = 0x0000, + SMSG_STABLE_RESULT = 0x2204, SMSG_STANDSTATE_UPDATE = 0x6F04, SMSG_START_MIRROR_TIMER = 0x0000, SMSG_STOP_DANCE = 0x0000, SMSG_STOP_MIRROR_TIMER = 0x0000, SMSG_SUMMON_CANCEL = 0x0000, - SMSG_SUMMON_REQUEST = 0x0000, - SMSG_SUPERCEDED_SPELL = 0x0000, + SMSG_SUMMON_REQUEST = 0x2A07, + SMSG_SUPERCEDED_SPELL = 0x35B0, + SMSG_SUSPEND_COMMS = 0x4140, SMSG_SUSPEND_TOKEN_RESPONSE = 0x14B1, - SMSG_TALENTS_ERROR = 0x0000, + SMSG_TALENTS_ERROR = 0x093A, SMSG_TALENTS_INFO = 0x6F26, SMSG_TALENTS_INVOLUNTARILY_RESET = 0x0000, SMSG_TAXINODE_STATUS = 0x2936, + SMSG_TEST_DROP_RATE_RESULT = 0x6816, SMSG_TEXT_EMOTE = 0x0B05, - SMSG_THREAT_CLEAR = 0x0000, - SMSG_THREAT_REMOVE = 0x0000, + SMSG_THREAT_CLEAR = 0x6437, + SMSG_THREAT_REMOVE = 0x2E05, SMSG_THREAT_UPDATE = 0x4104, SMSG_TIME_SYNC_REQ = 0x3CA4, - SMSG_TITLE_EARNED = 0x0000, + SMSG_TITLE_EARNED = 0x2426, SMSG_TOGGLE_XP_GAIN = 0x0000, SMSG_TOTEM_CREATED = 0x0000, SMSG_TRADE_STATUS = 0x5CA3, - SMSG_TRADE_STATUS_EXTENDED = 0x0000, + SMSG_TRADE_STATUS_EXTENDED = 0x70A2, + SMSG_TRAINER_BUY_FAILED = 0x0004, SMSG_TRAINER_BUY_RESULT = 0x0000, SMSG_TRAINER_BUY_SUCCEEDED = 0x6A05, SMSG_TRAINER_LIST = 0x4414, - SMSG_TRANSFER_ABORTED = 0x0000, - SMSG_TRANSFER_PENDING = 0x0000, + SMSG_TRANSFER_ABORTED = 0x0537, + SMSG_TRANSFER_PENDING = 0x18A6, SMSG_TRIGGER_CINEMATIC = 0x6C27, SMSG_TRIGGER_MOVIE = 0x0000, SMSG_TURN_IN_PETITION_RESULTS = 0x0000, SMSG_TUTORIAL_FLAGS = 0x0B35, - SMSG_UNIT_SPELLCAST_START = 0x0000, + SMSG_UNIT_SPELLCAST_START = 0x2517, SMSG_UPDATE_ACCOUNT_DATA = 0x6837, SMSG_UPDATE_ACCOUNT_DATA_COMPLETE = 0x2015, SMSG_UPDATE_COMBO_POINTS = 0x0000, SMSG_UPDATE_CURRENCY = 0x0000, SMSG_UPDATE_CURRENCY_WEEK_LIMIT = 0x70A7, SMSG_UPDATE_INSTANCE_ENCOUNTER_UNIT = 0x0000, - SMSG_UPDATE_INSTANCE_OWNERSHIP = 0x0000, + SMSG_UPDATE_INSTANCE_OWNERSHIP = 0x4915, SMSG_UPDATE_ITEM_ENCHANTMENTS = 0x0000, - SMSG_UPDATE_LAST_INSTANCE = 0x0000, + SMSG_UPDATE_LAST_INSTANCE = 0x0437, SMSG_UPDATE_OBJECT = 0x4715, SMSG_UPDATE_WORLD_STATE = 0x4816, - SMSG_USERLIST_ADD = 0x0000, + SMSG_USERLIST_ADD = 0x0F37, SMSG_USERLIST_REMOVE = 0x2006, SMSG_USERLIST_UPDATE = 0x0135, - SMSG_VOICE_CHAT_STATUS = 0x0000, - SMSG_VOICE_PARENTAL_CONTROLS = 0x0000, - SMSG_VOICE_SESSION_LEAVE = 0x0000, - SMSG_VOICE_SESSION_ROSTER_UPDATE = 0x0000, - SMSG_VOICE_SET_TALKER_MUTED = 0x0000, + SMSG_VOICE_CHAT_STATUS = 0x0F15, + SMSG_VOICE_PARENTAL_CONTROLS = 0x0534, + SMSG_VOICE_SESSION_LEAVE = 0x2A24, + SMSG_VOICE_SESSION_ROSTER_UPDATE = 0x2A17, + SMSG_VOICE_SET_TALKER_MUTED = 0x6E35, SMSG_WARDEN_DATA = 0x31A0, - SMSG_WEATHER = 0x0000, + SMSG_WEATHER = 0x2904, + SMSG_WEEKLY_SPELL_USAGE = 0x39B7, SMSG_WHO = 0x6907, - SMSG_WHOIS = 0x0000, + SMSG_WHOIS = 0x6917, + SMSG_WORLD_SERVER_INFO = 0x09B1, SMSG_WORLD_STATE_UI_TIMER_UPDATE = 0x4A14, - SMSG_ZONE_UNDER_ATTACK = 0x0000, + SMSG_ZONE_UNDER_ATTACK = 0x0A06, }; /// Player state @@ -1160,4 +1258,4 @@ inline const char* LookupOpcodeName(Opcodes id) return "UNKNOWN OPCODE"; } #endif -/// @} +/// @} \ No newline at end of file -- cgit v1.2.3 From 35ba3f94058021acabd8a154d46a6462bfb913f9 Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 16 Jul 2012 20:55:43 +0200 Subject: Core/PacketIO: Removed many duplicate opcodes --- src/server/game/Server/Protocol/Opcodes.h | 124 ++++++++++-------------------- 1 file changed, 42 insertions(+), 82 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 6750ed87722..c94c58941d1 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -95,6 +95,7 @@ enum Opcodes CMSG_CALENDAR_EVENT_REMOVE_INVITE = 0x0000, CMSG_CALENDAR_EVENT_RSVP = 0x0000, CMSG_CALENDAR_EVENT_STATUS = 0x0000, + CMSG_CALENDAR_GET_CALENDAR = 0x2814, CMSG_CALENDAR_GET_EVENT = 0x0000, CMSG_CALENDAR_GET_NUM_PENDING = 0x4D05, CMSG_CALENDAR_GUILD_FILTER = 0x0000, @@ -298,24 +299,25 @@ enum Opcodes CMSG_MOUNTSPECIAL_ANIM = 0x0217, CMSG_MOVE_CHARM_TELEPORT_CHEAT = 0x0000, CMSG_MOVE_ENABLE_SWIM_TO_FLY_TRANS_ACK = 0x0000, - CMSG_MOVE_FEATHER_FALL_ACK = 0x0000, - CMSG_MOVE_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK = 0x0000, - CMSG_MOVE_FORCE_FLIGHT_SPEED_CHANGE_ACK = 0x0000, - CMSG_MOVE_FORCE_PITCH_RATE_CHANGE_ACK = 0x0000, - CMSG_MOVE_FORCE_RUN_BACK_SPEED_CHANGE_ACK = 0x0000, - CMSG_MOVE_FORCE_RUN_SPEED_CHANGE_ACK = 0x0000, - CMSG_MOVE_FORCE_SWIM_BACK_SPEED_CHANGE_ACK = 0x0000, - CMSG_MOVE_FORCE_SWIM_SPEED_CHANGE_ACK = 0x0000, - CMSG_MOVE_FORCE_TURN_RATE_CHANGE_ACK = 0x0000, - CMSG_MOVE_FORCE_WALK_SPEED_CHANGE_ACK = 0x0000, + CMSG_MOVE_FEATHER_FALL_ACK = 0x3110, + CMSG_MOVE_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK = 0x310E, + CMSG_MOVE_FORCE_FLIGHT_SPEED_CHANGE_ACK = 0x7314, + CMSG_MOVE_FORCE_PITCH_RATE_CHANGE_ACK = 0x3100, + CMSG_MOVE_FORCE_RUN_BACK_SPEED_CHANGE_ACK = 0x3216, + CMSG_MOVE_FORCE_RUN_SPEED_CHANGE_ACK = 0x7818, + CMSG_MOVE_FORCE_SWIM_BACK_SPEED_CHANGE_ACK = 0x7A16, + CMSG_MOVE_FORCE_SWIM_SPEED_CHANGE_ACK = 0x7A10, + CMSG_MOVE_FORCE_TURN_RATE_CHANGE_ACK = 0x7316, + CMSG_MOVE_FORCE_WALK_SPEED_CHANGE_ACK = 0x7210, CMSG_MOVE_GRAVITY_DISABLE_ACK = 0x0000, CMSG_MOVE_GRAVITY_ENABLE_ACK = 0x0000, - CMSG_MOVE_HOVER_ACK = 0x0000, + CMSG_MOVE_HOVER_ACK = 0x3318, CMSG_MOVE_KNOCK_BACK_ACK = 0x5CB4, - CMSG_MOVE_SET_CAN_FLY_ACK = 0x0000, - CMSG_MOVE_SET_COLLISION_HEIGHT_ACK = 0x0000, + CMSG_MOVE_SET_CAN_FLY_ACK = 0x790C, + CMSG_MOVE_SET_COLLISION_HEIGHT_ACK = 0x7114, CMSG_MOVE_SET_RELATIVE_POSITION = 0x0000, CMSG_MOVE_SET_VEHICLE_REC_ID_ACK = 0x0000, + CMSG_MOVE_SPLINE_DONE = 0x790E, CMSG_MOVE_TELEPORT_ACK = 0x0000, CMSG_MOVE_TELEPORT_CHEAT = 0x0000, CMSG_MOVE_TIME_SKIPPED = 0x7A0A, @@ -489,7 +491,6 @@ enum Opcodes MSG_CHANNEL_START = 0x0A15, MSG_CHANNEL_UPDATE = 0x0000, MSG_CORPSE_QUERY = 0x0000, - MSG_GET_CALENDAR = 0x2814, MSG_GM_BIND_OTHER = 0x0000, MSG_GM_SHOWLABEL = 0x0000, MSG_GM_SUMMON = 0x0000, @@ -502,66 +503,25 @@ enum Opcodes MSG_LIST_STABLED_PETS = 0x0834, MSG_MINIMAP_PING = 0x6635, MSG_MOVE_CHARM_TELEPORT_CHEAT = 0x7A08, - MSG_MOVE_ENABLE_TRANSITION_BETWEEN_SWIM_AND_FLY = 0x3014, MSG_MOVE_FALL_LAND = 0x380A, MSG_MOVE_FEATHER_FALL = 0x0000, - MSG_MOVE_FEATHER_FALL_ACK = 0x3110, - MSG_MOVE_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK = 0x310E, - MSG_MOVE_FORCE_FLIGHT_SPEED_CHANGE_ACK = 0x7314, - MSG_MOVE_FORCE_PITCH_RATE_CHANGE_ACK = 0x3100, - MSG_MOVE_FORCE_RUN_BACK_SPEED_CHANGE_ACK = 0x3216, - MSG_MOVE_FORCE_RUN_SPEED_CHANGE_ACK = 0x7818, - MSG_MOVE_FORCE_SWIM_BACK_SPEED_CHANGE_ACK = 0x7A16, - MSG_MOVE_FORCE_SWIM_SPEED_CHANGE_ACK = 0x7A10, - MSG_MOVE_FORCE_TURN_RATE_CHANGE_ACK = 0x7316, - MSG_MOVE_FORCE_WALK_SPEED_CHANGE_ACK = 0x7210, MSG_MOVE_GRAVITY_CHNG = 0x0000, MSG_MOVE_HEARTBEAT = 0x3914, MSG_MOVE_HOVER = 0x0000, - MSG_MOVE_HOVER_ACK = 0x3318, MSG_MOVE_JUMP = 0x7A06, - MSG_MOVE_KNOCK_BACK_ACK = 0x5CB4, - MSG_MOVE_ROOT = 0x7DA0, - MSG_MOVE_SET_ACTIVE_MOVER = 0x11B3, MSG_MOVE_SET_ALL_SPEED_CHEAT = 0x0000, - MSG_MOVE_SET_CAN_FLY = 0x720E, - MSG_MOVE_SET_CAN_FLY_ACK = 0x790C, - MSG_MOVE_SET_COLLISION_HEIGHT = 0x59A3, - MSG_MOVE_SET_COLLISION_HEIGHT_ACK = 0x7114, - MSG_MOVE_SET_COMPOUND_STATE = 0x75A0, MSG_MOVE_SET_FACING = 0x7914, - MSG_MOVE_SET_FEATHER_FALL = 0x79B0, - MSG_MOVE_SET_FLIGHT_BACK_SPEED = 0x30A2, - MSG_MOVE_SET_FLIGHT_BACK_SPEED_CHEAT = 0x0000, - MSG_MOVE_SET_FLIGHT_SPEED = 0x71A6, MSG_MOVE_SET_FLIGHT_SPEED_CHEAT = 0x0000, - MSG_MOVE_SET_HOVERING = 0x5CB3, - MSG_MOVE_SET_LAND_WALK = 0x34B7, - MSG_MOVE_SET_NORMAL_FALL = 0x51B6, MSG_MOVE_SET_PITCH = 0x7312, MSG_MOVE_SET_RAW_POSITION_ACK = 0x0000, - MSG_MOVE_SET_RUN_BACK_SPEED = 0x71B1, MSG_MOVE_SET_RUN_BACK_SPEED_CHEAT = 0x0000, MSG_MOVE_SET_RUN_MODE = 0x791A, - MSG_MOVE_SET_RUN_SPEED = 0x3DB5, MSG_MOVE_SET_RUN_SPEED_CHEAT = 0x0000, - MSG_MOVE_SET_SWIM_BACK_SPEED = 0x5CA6, MSG_MOVE_SET_SWIM_BACK_SPEED_CHEAT = 0x0000, MSG_MOVE_SET_SWIM_SPEED_CHEAT = 0x0000, MSG_MOVE_SET_TURN_RATE_CHEAT = 0x0000, MSG_MOVE_SET_WALK_MODE = 0x7002, - MSG_MOVE_SET_WALK_SPEED = 0x1DA4, MSG_MOVE_SET_WALK_SPEED_CHEAT = 0x0000, - MSG_MOVE_SET_WATER_WALK = 0x75B1, - MSG_MOVE_SKIP_TIME = 0x19B3, - MSG_MOVE_SPLINE_DONE = 0x790E, - MSG_MOVE_SPLINE_SET_FEATHER_FALL = 0x3DA5, - MSG_MOVE_SPLINE_SET_FLYING = 0x31B5, - MSG_MOVE_SPLINE_SET_LAND_WALK = 0x3DA7, - MSG_MOVE_SPLINE_SET_NORMAL_FALL = 0x38B2, - MSG_MOVE_SPLINE_SET_RUN_SPEED = 0x51B7, - MSG_MOVE_SPLINE_UNSET_FLYING = 0x58A6, - MSG_MOVE_SPLINE_UNSET_HOVER = 0x7DA5, MSG_MOVE_START_ASCEND = 0x390A, MSG_MOVE_START_BACKWARD = 0x330A, MSG_MOVE_START_DESCEND = 0x3800, @@ -582,6 +542,7 @@ enum Opcodes MSG_MOVE_TELEPORT = 0x55A0, MSG_MOVE_TELEPORT_ACK = 0x390C, MSG_MOVE_TELEPORT_CHEAT = 0x3A10, + MSG_MOVE_TIME_SKIPPED = 0x19B3, MSG_MOVE_TOGGLE_COLLISION_CHEAT = 0x7B04, MSG_MOVE_TOGGLE_FALL_LOGGING = 0x0000, MSG_MOVE_TOGGLE_LOGGING = 0x0000, @@ -706,7 +667,6 @@ enum Opcodes SMSG_CANCEL_AUTO_REPEAT = 0x6436, SMSG_CANCEL_COMBAT = 0x4F04, SMSG_CAST_FAILED = 0x4D16, - SMSG_CATEGORY_COOLDOWN = 0x71B6, SMSG_CHANNEL_LIST = 0x0000, SMSG_CHANNEL_MEMBER_COUNT = 0x6414, SMSG_CHANNEL_NOTIFY = 0x0825, @@ -941,29 +901,28 @@ enum Opcodes SMSG_MOVE_DISABLE_GRAVITY = 0x0000, SMSG_MOVE_ENABLE_COLLISION = 0x0000, SMSG_MOVE_ENABLE_GRAVITY = 0x0000, - SMSG_MOVE_FEATHER_FALL = 0x0000, + SMSG_MOVE_FEATHER_FALL = 0x79B0, SMSG_MOVE_KNOCK_BACK = 0x0000, - SMSG_MOVE_LAND_WALK = 0x0000, - SMSG_MOVE_NORMAL_FALL = 0x0000, - SMSG_MOVE_ROOT = 0x0000, - SMSG_MOVE_SET_ACTIVE_MOVER = 0x0000, - SMSG_MOVE_SET_CAN_FLY = 0x0000, - SMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY = 0x0000, - SMSG_MOVE_SET_COLLISION_HEIGHT = 0x0000, - SMSG_MOVE_SET_COMPOUND_STATE = 0x0000, - SMSG_MOVE_SET_FLIGHT_BACK_SPEED = 0x0000, - SMSG_MOVE_SET_FLIGHT_SPEED = 0x0000, - SMSG_MOVE_SET_HOVER = 0x0000, + SMSG_MOVE_LAND_WALK = 0x34B7, + SMSG_MOVE_NORMAL_FALL = 0x51B6, + SMSG_MOVE_ROOT = 0x7DA0, + SMSG_MOVE_SET_ACTIVE_MOVER = 0x11B3, + SMSG_MOVE_SET_CAN_FLY = 0x720E, + SMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY = 0x3014, + SMSG_MOVE_SET_COLLISION_HEIGHT = 0x59A3, + SMSG_MOVE_SET_COMPOUND_STATE = 0x75A0, + SMSG_MOVE_SET_FLIGHT_BACK_SPEED = 0x30A2, + SMSG_MOVE_SET_FLIGHT_SPEED = 0x71A6, + SMSG_MOVE_SET_HOVER = 0x5CB3, SMSG_MOVE_SET_PITCH_RATE = 0x0000, - SMSG_MOVE_SET_RUN_BACK_SPEED = 0x0000, - SMSG_MOVE_SET_RUN_SPEED = 0x0000, - SMSG_MOVE_SET_SWIM_BACK_SPEED = 0x0000, + SMSG_MOVE_SET_RUN_BACK_SPEED = 0x71B1, + SMSG_MOVE_SET_RUN_SPEED = 0x3DB5, + SMSG_MOVE_SET_SWIM_BACK_SPEED = 0x5CA6, SMSG_MOVE_SET_SWIM_SPEED = 0x0000, SMSG_MOVE_SET_TURN_RATE = 0x0000, SMSG_MOVE_SET_VEHICLE_REC_ID = 0x0000, SMSG_MOVE_SET_WALK_IN_AIR = 0x0000, - SMSG_MOVE_SET_WALK_SPEED = 0x0000, - SMSG_MOVE_SKIP_TIME = 0x0000, + SMSG_MOVE_SET_WALK_SPEED = 0x1DA4, SMSG_MOVE_TELEPORT = 0x0000, SMSG_MOVE_UNROOT = 0x0000, SMSG_MOVE_UNSET_CAN_FLY = 0x0000, @@ -972,7 +931,7 @@ enum Opcodes SMSG_MOVE_UNSET_WALK_IN_AIR = 0x0000, SMSG_MOVE_UPDATE_KNOCK_BACK = 0x0000, SMSG_MOVE_UPDATE_TELEPORT = 0x0000, - SMSG_MOVE_WATER_WALK = 0x0000, + SMSG_MOVE_WATER_WALK = 0x75B1, SMSG_MULTIPLE_PACKETS = 0x6736, SMSG_NAME_QUERY_RESPONSE = 0x6E04, SMSG_NEW_TAXI_PATH = 0x0000, @@ -1109,6 +1068,7 @@ enum Opcodes SMSG_SPELLNONMELEEDAMAGELOG = 0x4315, SMSG_SPELLORDAMAGE_IMMUNE = 0x4507, SMSG_SPELLSTEALLOG = 0x4E26, + SMSG_SPELL_CATEGORY_COOLDOWN = 0x71B6, SMSG_SPELL_COOLDOWN = 0x4B16, SMSG_SPELL_DELAYED = 0x0715, SMSG_SPELL_FAILED_OTHER = 0x0C34, @@ -1122,19 +1082,19 @@ enum Opcodes SMSG_SPLINE_MOVE_GRAVITY_DISABLE = 0x0000, SMSG_SPLINE_MOVE_GRAVITY_ENABLE = 0x0000, SMSG_SPLINE_MOVE_ROOT = 0x0000, - SMSG_SPLINE_MOVE_SET_FEATHER_FALL = 0x0000, + SMSG_SPLINE_MOVE_SET_FEATHER_FALL = 0x3DA5, SMSG_SPLINE_MOVE_SET_FLIGHT_BACK_SPEED = 0x0000, SMSG_SPLINE_MOVE_SET_FLIGHT_SPEED = 0x0000, - SMSG_SPLINE_MOVE_SET_FLYING = 0x0000, + SMSG_SPLINE_MOVE_SET_FLYING = 0x31B5, SMSG_SPLINE_MOVE_SET_HOVER = 0x0000, - SMSG_SPLINE_MOVE_SET_LAND_WALK = 0x0000, - SMSG_SPLINE_MOVE_SET_NORMAL_FALL = 0x0000, + SMSG_SPLINE_MOVE_SET_LAND_WALK = 0x3DA7, + SMSG_SPLINE_MOVE_SET_NORMAL_FALL = 0x38B2, SMSG_SPLINE_MOVE_SET_PITCH_RATE = 0x0000, SMSG_SPLINE_MOVE_SET_RUN_BACK_SPEED = 0x0000, SMSG_SPLINE_MOVE_SET_RUN_MODE = 0x0000, SMSG_SPLINE_MOVE_SET_RUN_SPEED = 0x0000, SMSG_SPLINE_MOVE_SET_SWIM_BACK_SPEED = 0x0000, - SMSG_SPLINE_MOVE_SET_SWIM_SPEED = 0x0000, + SMSG_SPLINE_MOVE_SET_SWIM_SPEED = 0x51B7, SMSG_SPLINE_MOVE_SET_TURN_RATE = 0x0000, SMSG_SPLINE_MOVE_SET_WALK_MODE = 0x0000, SMSG_SPLINE_MOVE_SET_WALK_SPEED = 0x0000, @@ -1142,8 +1102,8 @@ enum Opcodes SMSG_SPLINE_MOVE_START_SWIM = 0x0000, SMSG_SPLINE_MOVE_STOP_SWIM = 0x0000, SMSG_SPLINE_MOVE_UNROOT = 0x0000, - SMSG_SPLINE_MOVE_UNSET_FLYING = 0x0000, - SMSG_SPLINE_MOVE_UNSET_HOVER = 0x0000, + SMSG_SPLINE_MOVE_UNSET_FLYING = 0x58A6, + SMSG_SPLINE_MOVE_UNSET_HOVER = 0x7DA5, SMSG_STABLE_RESULT = 0x2204, SMSG_STANDSTATE_UPDATE = 0x6F04, SMSG_START_MIRROR_TIMER = 0x0000, @@ -1258,4 +1218,4 @@ inline const char* LookupOpcodeName(Opcodes id) return "UNKNOWN OPCODE"; } #endif -/// @} \ No newline at end of file +/// @} -- cgit v1.2.3 From 8773b08e99275b372db41a37c21d19687fd567b7 Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 16 Jul 2012 21:06:06 +0200 Subject: Core/PacketIO: Removed more duplicates, thanks Horn --- src/server/game/Server/Protocol/Opcodes.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index c94c58941d1..6c96b2eb0d0 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -168,7 +168,6 @@ enum Opcodes CMSG_FORCE_MOVE_ROOT_ACK = 0x701E, CMSG_FORCE_MOVE_UNROOT_ACK = 0x7DB4, CMSG_GAMEOBJECT_QUERY = 0x4017, - CMSG_GAMEOBJ_REPORT_USE = 0x0000, CMSG_GAMEOBJ_REPORT_USE = 0x4827, CMSG_GAMEOBJ_USE = 0x4E17, CMSG_GAMESPEED_SET = 0x0000, @@ -273,7 +272,6 @@ enum Opcodes CMSG_MAIL_TAKE_ITEM = 0x2B06, CMSG_MAIL_TAKE_MONEY = 0x4034, CMSG_MEETINGSTONE_INFO = 0x0000, - CMSG_MESSAGECHAT_ADDON_BATTLEGROUND = 0x0000, CMSG_MESSAGECHAT_ADDON_BATTLEGROUND = 0x0D46, CMSG_MESSAGECHAT_ADDON_GUILD = 0x0544, CMSG_MESSAGECHAT_ADDON_PARTY = 0x0546, @@ -709,7 +707,6 @@ enum Opcodes SMSG_CRITERIA_DELETED = 0x2915, SMSG_CRITERIA_UPDATE = 0x6E37, SMSG_CROSSED_INEBRIATION_THRESHOLD = 0x2036, - SMSG_DAMAGE_CALC_LOG = 0x0000, SMSG_DAMAGE_CALC_LOG = 0x2436, SMSG_DAMAGE_DONE_OBSOLETE = 0x0000, SMSG_DANCE_QUERY_RESPONSE = 0x2F06, @@ -773,7 +770,6 @@ enum Opcodes SMSG_GROUP_CANCEL = 0x0000, SMSG_GROUP_DECLINE = 0x0000, SMSG_GROUP_DESTROYED = 0x0000, - SMSG_GROUP_INVITE = 0x0000, SMSG_GROUP_INVITE = 0x31B2, SMSG_GROUP_JOINED_BATTLEGROUND = 0x35A1, SMSG_GROUP_LIST = 0x4C24, -- cgit v1.2.3 From b6510e1ffaba0a8edf91a170abdc4ef6747a3ef0 Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 16 Jul 2012 21:52:22 +0100 Subject: Core/PacketIO: Remove a wrong opcode, add one and correct an opcode name --- src/server/game/Server/Protocol/Opcodes.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 6c96b2eb0d0..38e9c75978f 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -487,7 +487,7 @@ enum Opcodes MSG_AUCTION_HELLO = 0x2307, MSG_BATTLEGROUND_PLAYER_POSITIONS = 0x0000, MSG_CHANNEL_START = 0x0A15, - MSG_CHANNEL_UPDATE = 0x0000, + MSG_CHANNEL_UPDATE = 0x2417, MSG_CORPSE_QUERY = 0x0000, MSG_GM_BIND_OTHER = 0x0000, MSG_GM_SHOWLABEL = 0x0000, @@ -547,7 +547,7 @@ enum Opcodes MSG_MOVE_UNROOT = 0x7DB4, MSG_MOVE_UPDATE_CAN_FLY = 0x0000, MSG_MOVE_UPDATE_FLIGHT_SPEED = 0x30B1, - MSG_MOVE_UPDATE_MOUSE = 0x7914, + MSG_MOVE_UPDATE_MOUSE = 0x0000, MSG_MOVE_UPDATE_RUN_SPEED = 0x14A6, MSG_MOVE_UPDATE_TELEPORT = 0x50B2, MSG_MOVE_WATER_WALK = 0x0000, @@ -1009,7 +1009,7 @@ enum Opcodes SMSG_QUESTUPDATE_FAILED = 0x6324, SMSG_QUESTUPDATE_FAILEDTIMER = 0x0000, SMSG_QUEST_CONFIRM_ACCEPT = 0x6F07, - SMSG_QUEST_FORCE_REMOVED = 0x6605, + SMSG_QUEST_FORCE_REMOVE = 0x6605, SMSG_QUEST_POI_QUERY_RESPONSE = 0x6304, SMSG_QUEST_QUERY_RESPONSE = 0x6936, SMSG_RAID_GROUP_ONLY = 0x0837, -- cgit v1.2.3 From 1be11fbe7552c87a9df5f35a1e76df65f755bdf1 Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 16 Jul 2012 22:23:52 +0100 Subject: Core/PacketIO: Fix some wrong opcodes, now in sync with WPP --- src/server/game/Server/Protocol/Opcodes.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 38e9c75978f..0fa5de228d5 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -226,7 +226,7 @@ enum Opcodes CMSG_GUILD_MOTD = 0x1035, CMSG_GUILD_PROMOTE = 0x0000, CMSG_GUILD_QUERY = 0x4426, - CMSG_GUILD_RANK = 0x1026, + CMSG_GUILD_RANK = 0x1226, CMSG_GUILD_REMOVE = 0x0000, CMSG_GUILD_ROSTER = 0x1026, CMSG_GUILD_SET_ACHIEVEMENT_TRACKING = 0x1027, @@ -364,7 +364,7 @@ enum Opcodes CMSG_QUESTGIVER_ACCEPT_QUEST = 0x6B37, CMSG_QUESTGIVER_CANCEL = 0x0000, CMSG_QUESTGIVER_CHOOSE_REWARD = 0x2125, - CMSG_QUESTGIVER_COMPLETE_QUEST = 0x7302, + CMSG_QUESTGIVER_COMPLETE_QUEST = 0x0114, CMSG_QUESTGIVER_HELLO = 0x0D17, CMSG_QUESTGIVER_QUERY_QUEST = 0x2F14, CMSG_QUESTGIVER_QUEST_AUTOLAUNCH = 0x0000, @@ -723,7 +723,7 @@ enum Opcodes SMSG_DUEL_INBOUNDS = 0x0000, SMSG_DUEL_OUTOFBOUNDS = 0x0000, SMSG_DUEL_REQUESTED = 0x4504, - SMSG_DUEL_WINNER = 0x2527, + SMSG_DUEL_WINNER = 0x2D36, SMSG_DURABILITY_DAMAGE_DEATH = 0x0000, SMSG_ECHO_PARTY_SQUELCH = 0x0814, SMSG_EMOTE = 0x0A34, @@ -868,7 +868,7 @@ enum Opcodes SMSG_LOGOUT_RESPONSE = 0x0524, SMSG_LOG_XPGAIN = 0x4514, SMSG_LOOT_ALL_PASSED = 0x6237, - SMSG_LOOT_CLEAR_MONEY = 0x0E15, + SMSG_LOOT_CLEAR_MONEY = 0x2B37, SMSG_LOOT_ITEM_NOTIFY = 0x6D15, SMSG_LOOT_LIST = 0x6807, SMSG_LOOT_MASTER_LIST = 0x0325, @@ -931,7 +931,7 @@ enum Opcodes SMSG_MULTIPLE_PACKETS = 0x6736, SMSG_NAME_QUERY_RESPONSE = 0x6E04, SMSG_NEW_TAXI_PATH = 0x0000, - SMSG_NEW_WORLD = 0x31A2, + SMSG_NEW_WORLD = 0x79B1, SMSG_NOTIFICATION = 0x14A0, SMSG_NOTIFY_DANCE = 0x4904, SMSG_NOTIFY_DEST_LOC_SPELL_CAST = 0x0000, @@ -1020,7 +1020,7 @@ enum Opcodes SMSG_READ_ITEM_OK = 0x0000, SMSG_REALM_SPLIT = 0x2714, SMSG_REAL_GROUP_UPDATE = 0x0F34, - SMSG_RECEIVED_MAIL = 0x4927, + SMSG_RECEIVED_MAIL = 0x2924, SMSG_REDIRECT_CLIENT = 0x0942, SMSG_REFER_A_FRIEND_FAILURE = 0x0000, SMSG_REMOVED_SPELL = 0x4804, @@ -1118,7 +1118,7 @@ enum Opcodes SMSG_TEXT_EMOTE = 0x0B05, SMSG_THREAT_CLEAR = 0x6437, SMSG_THREAT_REMOVE = 0x2E05, - SMSG_THREAT_UPDATE = 0x4104, + SMSG_THREAT_UPDATE = 0x4735, SMSG_TIME_SYNC_REQ = 0x3CA4, SMSG_TITLE_EARNED = 0x2426, SMSG_TOGGLE_XP_GAIN = 0x0000, -- cgit v1.2.3 From d0bd37ab2323537ab636693418241eb0a2698950 Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 16 Jul 2012 22:54:45 +0100 Subject: Core/PacketIO: Unset CMSG_GUILD_RANK and CMSG_GUILD_ROSTER --- src/server/game/Server/Protocol/Opcodes.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 0fa5de228d5..86374172003 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -226,9 +226,9 @@ enum Opcodes CMSG_GUILD_MOTD = 0x1035, CMSG_GUILD_PROMOTE = 0x0000, CMSG_GUILD_QUERY = 0x4426, - CMSG_GUILD_RANK = 0x1226, + CMSG_GUILD_RANK = 0x0000, CMSG_GUILD_REMOVE = 0x0000, - CMSG_GUILD_ROSTER = 0x1026, + CMSG_GUILD_ROSTER = 0x0000, CMSG_GUILD_SET_ACHIEVEMENT_TRACKING = 0x1027, CMSG_GUILD_SET_NOTE = 0x0000, CMSG_HEARTH_AND_RESURRECT = 0x4B34, -- cgit v1.2.3 From c34192cd3af8b008119092e3e7fcce02ea9db62c Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 17 Jul 2012 11:20:18 +0200 Subject: Core/PacketIO: Updated more movement packet structures --- src/server/game/Movement/MovementStructures.h | 282 ++++++++++++++------------ src/server/game/Server/Protocol/Opcodes.cpp | 5 +- src/server/game/Server/Protocol/Opcodes.h | 3 +- 3 files changed, 151 insertions(+), 139 deletions(-) (limited to 'src') diff --git a/src/server/game/Movement/MovementStructures.h b/src/server/game/Movement/MovementStructures.h index 529467b98bc..501f920003d 100644 --- a/src/server/game/Movement/MovementStructures.h +++ b/src/server/game/Movement/MovementStructures.h @@ -388,136 +388,150 @@ MovementStatusElements MovementJumpSequence[] = MSEEnd, }; -//4.2.2 -MovementStatusElements MovementSetFacingSequence[] = { - MSEMovementFlags, +//4.3.4 +MovementStatusElements MovementSetFacingSequence[] = +{ + MSEPositionX, + MSEPositionY, + MSEPositionZ, + MSEHasGuidByte6, + MSEHasTransportData, MSEHasGuidByte4, - MSEHasGuidByte2, MSEHasSpline, - MSEHasGuidByte3, - MSEHasGuidByte5, - MSEMovementFlags2, MSEHasGuidByte0, - MSEHasGuidByte7, - MSEHasGuidByte6, - MSEHasGuidByte1, - MSEHasSplineElevation, + MSEHasOrientation, + MSEHasTimestamp, MSEHasPitch, + MSEHasMovementFlags2, + MSEHasGuidByte5, + MSEHasGuidByte7, + MSEHasGuidByte2, MSEHasFallData, - MSEHasFallDirection, - MSEHasTransportData, - MSEHasTransportGuidByte0, - MSEHasTransportGuidByte6, - MSEHasTransportGuidByte2, - MSEHasTransportGuidByte5, - MSEHasTransportGuidByte4, - MSEHasTransportGuidByte1, + MSEHasSplineElevation, + MSEHasMovementFlags, + MSEHasGuidByte3, + MSEZeroBit, + MSEHasGuidByte1, + MSEHasTransportTime3, MSEHasTransportGuidByte3, MSEHasTransportGuidByte7, + MSEHasTransportGuidByte5, + MSEHasTransportGuidByte2, + MSEHasTransportGuidByte6, + MSEHasTransportGuidByte0, MSEHasTransportTime2, - MSEHasTransportTime3, - MSEOrientation, - MSETimestamp, - MSEPositionX, - MSEPositionY, - MSEPositionZ, + MSEHasTransportGuidByte4, + MSEHasTransportGuidByte1, + MSEHasFallDirection, + MSEMovementFlags2, + MSEMovementFlags, + MSEGuidByte6, MSEGuidByte7, - MSEGuidByte5, - MSESplineElevation, - MSEGuidByte4, - MSEGuidByte1, MSEGuidByte2, - MSEPitch, - MSEFallTime, - MSEFallVerticalSpeed, - MSEFallHorizontalSpeed, - MSEFallCosAngle, - MSEFallSinAngle, - MSEGuidByte6, MSEGuidByte0, - MSETransportSeat, - MSETransportOrientation, + MSEGuidByte4, + MSEGuidByte1, + MSEGuidByte5, + MSEGuidByte3, + MSETransportGuidByte0, MSETransportPositionX, - MSETransportPositionY, - MSETransportPositionZ, - MSETransportTime, + MSETransportGuidByte1, MSETransportTime2, + MSETransportGuidByte4, + MSETransportPositionZ, + MSETransportOrientation, + MSETransportGuidByte2, + MSETransportTime3, MSETransportGuidByte3, + MSETransportSeat, + MSETransportPositionY, + MSETransportGuidByte5, MSETransportGuidByte6, - MSETransportTime3, + MSETransportTime, MSETransportGuidByte7, - MSETransportGuidByte5, - MSETransportGuidByte2, - MSETransportGuidByte1, - MSETransportGuidByte0, - MSETransportGuidByte4, - MSEGuidByte3, + MSEFallHorizontalSpeed, + MSEFallSinAngle, + MSEFallCosAngle, + MSEFallTime, + MSEFallVerticalSpeed, + MSESplineElevation, + MSEOrientation, + MSETimestamp, + MSEPitch, + MSEEnd, }; -//4.2.2 -MovementStatusElements MovementSetPitchSequence[] = { +//4.3.4 +MovementStatusElements MovementSetPitchSequence[] = +{ + MSEPositionX, + MSEPositionZ, + MSEPositionY, + MSEHasFallData, + MSEHasMovementFlags, MSEHasGuidByte1, - MSEHasGuidByte6, + MSEHasOrientation, MSEHasGuidByte7, MSEHasGuidByte3, - MSEMovementFlags, - MSEHasGuidByte5, + MSEHasMovementFlags2, + MSEHasTransportData, + MSEHasSplineElevation, + MSEHasGuidByte6, + MSEHasPitch, + MSEHasGuidByte4, + MSEHasSpline, MSEHasGuidByte2, + MSEZeroBit, + MSEHasTimestamp, MSEHasGuidByte0, - MSEHasSpline, - MSEHasGuidByte4, - MSEMovementFlags2, - MSEHasSplineElevation, - MSEHasTransportData, - MSEHasTransportGuidByte0, + MSEHasGuidByte5, + MSEHasTransportGuidByte3, MSEHasTransportGuidByte6, MSEHasTransportGuidByte2, - MSEHasTransportGuidByte5, MSEHasTransportGuidByte4, + MSEHasTransportGuidByte0, MSEHasTransportGuidByte1, - MSEHasTransportGuidByte3, + MSEHasTransportGuidByte5, + MSEHasTransportTime3, MSEHasTransportGuidByte7, MSEHasTransportTime2, - MSEHasTransportTime3, - MSEHasPitch, - MSEHasFallData, + MSEMovementFlags2, + MSEMovementFlags, MSEHasFallDirection, - MSEPositionX, - MSEPositionY, - MSEPositionZ, - MSETimestamp, - MSEOrientation, + MSEGuidByte3, + MSEGuidByte7, MSEGuidByte1, + MSEGuidByte6, + MSEGuidByte0, + MSEGuidByte5, + MSEGuidByte2, MSEGuidByte4, - MSESplineElevation, - MSETransportSeat, - MSETransportOrientation, - MSETransportPositionX, - MSETransportPositionY, - MSETransportPositionZ, - MSETransportTime, - MSETransportTime2, + MSETransportGuidByte4, MSETransportGuidByte3, MSETransportGuidByte6, + MSETransportOrientation, + MSETransportGuidByte1, MSETransportTime3, - MSETransportGuidByte7, - MSETransportGuidByte5, + MSETransportTime, MSETransportGuidByte2, - MSETransportGuidByte1, + MSETransportPositionZ, MSETransportGuidByte0, - MSETransportGuidByte4, - MSEPitch, - MSEGuidByte5, - MSEFallTime, + MSETransportTime2, + MSETransportPositionY, + MSETransportGuidByte5, + MSETransportSeat, + MSETransportGuidByte7, + MSETransportPositionX, MSEFallVerticalSpeed, + MSEFallTime, MSEFallHorizontalSpeed, MSEFallCosAngle, MSEFallSinAngle, - MSEGuidByte0, - MSEGuidByte3, - MSEGuidByte6, - MSEGuidByte7, - MSEGuidByte2, + MSEPitch, + MSESplineElevation, + MSETimestamp, + MSEOrientation, + MSEEnd, }; //4.3.4 @@ -1108,8 +1122,8 @@ MovementStatusElements MovementStopStrafeSequence[] = //4.3.4 MovementStatusElements MovementStopTurnSequence[] = { - MSEPositionZ, MSEPositionX, + MSEPositionZ, MSEPositionY, MSEHasGuidByte5, MSEHasGuidByte4, @@ -1546,73 +1560,73 @@ MovementStatusElements MovementStopAscendSequence[] = //4.3.4 MovementStatusElements MovementStopPitchSequence[] = { + MSEPositionY, MSEPositionX, MSEPositionZ, - MSEPositionY, + MSEHasGuidByte0, + MSEHasGuidByte5, + MSEHasGuidByte3, MSEHasFallData, - MSEHasMovementFlags, - MSEHasGuidByte1, - MSEHasOrientation, + MSEHasGuidByte2, + MSEHasGuidByte4, MSEHasGuidByte7, - MSEHasGuidByte3, - MSEHasMovementFlags2, - MSEHasTransportData, - MSEHasSplineElevation, - MSEHasGuidByte6, MSEHasPitch, - MSEHasGuidByte4, MSEHasSpline, - MSEHasGuidByte2, + MSEHasOrientation, MSEZeroBit, + MSEHasMovementFlags2, + MSEHasSplineElevation, + MSEHasGuidByte6, + MSEHasGuidByte1, MSEHasTimestamp, - MSEHasGuidByte0, - MSEHasGuidByte5, - MSEHasTransportGuidByte3, - MSEHasTransportGuidByte6, - MSEHasTransportGuidByte2, - MSEHasTransportGuidByte4, + MSEHasTransportData, + MSEHasMovementFlags, + MSEHasTransportGuidByte7, MSEHasTransportGuidByte0, - MSEHasTransportGuidByte1, MSEHasTransportGuidByte5, + MSEHasTransportGuidByte2, MSEHasTransportTime3, - MSEHasTransportGuidByte7, + MSEHasTransportGuidByte6, + MSEHasTransportGuidByte3, MSEHasTransportTime2, + MSEHasTransportGuidByte4, + MSEHasTransportGuidByte1, + MSEHasFallDirection, MSEMovementFlags2, MSEMovementFlags, - MSEHasFallDirection, - MSEGuidByte3, - MSEGuidByte7, MSEGuidByte1, - MSEGuidByte6, + MSEGuidByte7, MSEGuidByte0, + MSEGuidByte6, + MSEGuidByte4, + MSEGuidByte3, MSEGuidByte5, MSEGuidByte2, - MSEGuidByte4, - MSETransportGuidByte4, - MSETransportGuidByte3, - MSETransportGuidByte6, + MSETimestamp, + MSEFallHorizontalSpeed, + MSEFallSinAngle, + MSEFallCosAngle, + MSEFallVerticalSpeed, + MSEFallTime, + MSETransportGuidByte5, + MSETransportGuidByte2, + MSETransportTime2, + MSETransportPositionX, MSETransportOrientation, + MSETransportGuidByte6, + MSETransportGuidByte3, MSETransportGuidByte1, - MSETransportTime3, - MSETransportTime, - MSETransportGuidByte2, MSETransportPositionZ, + MSETransportTime3, MSETransportGuidByte0, - MSETransportTime2, + MSETransportGuidByte4, + MSETransportTime, MSETransportPositionY, - MSETransportGuidByte5, MSETransportSeat, MSETransportGuidByte7, - MSETransportPositionX, - MSEFallVerticalSpeed, - MSEFallTime, - MSEFallHorizontalSpeed, - MSEFallCosAngle, - MSEFallSinAngle, - MSEPitch, MSESplineElevation, - MSETimestamp, MSEOrientation, + MSEPitch, MSEEnd, }; @@ -1772,10 +1786,10 @@ MovementStatusElements* GetMovementStatusElementsSequence(Opcodes opcode) return MovementHeartBeatSequence; case MSG_MOVE_JUMP: return MovementJumpSequence; - //case MSG_MOVE_SET_FACING: - // return MovementSetFacingSequence; - //case MSG_MOVE_SET_PITCH: - // return MovementSetPitchSequence; + case MSG_MOVE_SET_FACING: + return MovementSetFacingSequence; + case MSG_MOVE_SET_PITCH: + return MovementSetPitchSequence; case MSG_MOVE_START_ASCEND: return MovementStartAscendSequence; case MSG_MOVE_START_BACKWARD: diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 56c99d76e99..311ad97cbda 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -719,11 +719,10 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(MSG_MOVE_JUMP, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_ALL_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_COLLISION_HGT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_FACING, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_FACING, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_FLIGHT_BACK_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_FLIGHT_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_PITCH, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_PITCH, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_PITCH_RATE_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_BACK_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 86374172003..f35d9460dbd 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -544,7 +544,6 @@ enum Opcodes MSG_MOVE_TOGGLE_COLLISION_CHEAT = 0x7B04, MSG_MOVE_TOGGLE_FALL_LOGGING = 0x0000, MSG_MOVE_TOGGLE_LOGGING = 0x0000, - MSG_MOVE_UNROOT = 0x7DB4, MSG_MOVE_UPDATE_CAN_FLY = 0x0000, MSG_MOVE_UPDATE_FLIGHT_SPEED = 0x30B1, MSG_MOVE_UPDATE_MOUSE = 0x0000, @@ -920,7 +919,7 @@ enum Opcodes SMSG_MOVE_SET_WALK_IN_AIR = 0x0000, SMSG_MOVE_SET_WALK_SPEED = 0x1DA4, SMSG_MOVE_TELEPORT = 0x0000, - SMSG_MOVE_UNROOT = 0x0000, + SMSG_MOVE_UNROOT = 0x7DB4, SMSG_MOVE_UNSET_CAN_FLY = 0x0000, SMSG_MOVE_UNSET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY = 0x0000, SMSG_MOVE_UNSET_HOVER = 0x0000, -- cgit v1.2.3 From e832f1cd30655c86a76f1690e12d778d625fc14c Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 17 Jul 2012 11:21:12 +0200 Subject: Core/PacketIO: Enabled and update CMSG_ZONEUPDATE, SMSG_CANCEL_COMBAT, SMSG_NOTIFICATION, SMSG_QUERY_TIME_RESPONSE, SMSG_SET_FORCED_REACTIONS and SMSG_WEATHER --- src/server/game/Chat/Commands/Level1.cpp | 12 ++++++++---- src/server/game/Handlers/MiscHandler.cpp | 10 +++++----- src/server/game/Server/Protocol/Opcodes.cpp | 12 ++++++------ src/server/game/Server/WorldSession.cpp | 14 ++++++++++---- src/server/game/World/World.cpp | 12 ++++++++---- 5 files changed, 37 insertions(+), 23 deletions(-) (limited to 'src') diff --git a/src/server/game/Chat/Commands/Level1.cpp b/src/server/game/Chat/Commands/Level1.cpp index 1cf3d5c9b4e..0e5b17bbc06 100755 --- a/src/server/game/Chat/Commands/Level1.cpp +++ b/src/server/game/Chat/Commands/Level1.cpp @@ -97,8 +97,10 @@ bool ChatHandler::HandleNotifyCommand(const char* args) std::string str = GetTrinityString(LANG_GLOBAL_NOTIFY); str += args; - WorldPacket data(SMSG_NOTIFICATION, (str.size()+1)); - data << str; + WorldPacket data(SMSG_NOTIFICATION, 2 + str.length()); + data.WriteBits(str.length(), 13); + data.FlushBits(); + data.append(str.c_str(), str.length()); sWorld->SendGlobalMessage(&data); return true; @@ -113,8 +115,10 @@ bool ChatHandler::HandleGMNotifyCommand(const char* args) std::string str = GetTrinityString(LANG_GM_NOTIFY); str += args; - WorldPacket data(SMSG_NOTIFICATION, (str.size()+1)); - data << str; + WorldPacket data(SMSG_NOTIFICATION, 2 + str.length()); + data.WriteBits(str.length(), 13); + data.FlushBits(); + data.append(str.c_str(), str.length()); sWorld->SendGlobalGMMessage(&data); return true; diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 0468cffd28a..266c99749fd 100755 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -371,7 +371,7 @@ void WorldSession::HandleLogoutRequestOpcode(WorldPacket & /*recv_data*/) if (uint64 lguid = GetPlayer()->GetLootGUID()) DoLootRelease(lguid); - uint8 reason = 0; + uint32 reason = 0; if (GetPlayer()->isInCombat()) reason = 1; @@ -383,8 +383,8 @@ void WorldSession::HandleLogoutRequestOpcode(WorldPacket & /*recv_data*/) if (reason) { WorldPacket data(SMSG_LOGOUT_RESPONSE, 1+4); - data << uint32(0); - data << uint8(reason); + data << uint32(reason); + data << uint8(0); SendPacket(&data); LogoutRequest(0); return; @@ -395,8 +395,8 @@ void WorldSession::HandleLogoutRequestOpcode(WorldPacket & /*recv_data*/) GetSecurity() >= AccountTypes(sWorld->getIntConfig(CONFIG_INSTANT_LOGOUT))) { WorldPacket data(SMSG_LOGOUT_RESPONSE, 1+4); - data << uint32(16777216); - data << uint8(0); + data << uint32(reason); + data << uint8(1); // instant logout SendPacket(&data); LogoutPlayer(true); return; diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 311ad97cbda..de9d9487c6c 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -687,7 +687,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_WORLD_TELEPORT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWorldTeleportOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_WRAP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWrapItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_XP_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_ZONEUPDATE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleZoneUpdateOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_ZONEUPDATE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleZoneUpdateOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_ZONE_MAP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_AUCTION_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionHelloOpcode ); //DEFINE_OPCODE_HANDLER(MSG_BATTLEGROUND_PLAYER_POSITIONS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlegroundPlayerPositionsOpcode); @@ -864,7 +864,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_SEND_NUM_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CAMERA_SHAKE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CANCEL_AUTO_REPEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CANCEL_COMBAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CANCEL_COMBAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CAST_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHANGEPLAYER_DIFFICULTY_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHANNEL_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1130,7 +1130,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_NEW_TAXI_PATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_NEW_WORLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_NOTIFY_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_NOTIFY_DEST_LOC_SPELL_CAST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_NPC_TEXT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1192,7 +1192,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_QUERY_OBJECT_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_QUERY_OBJECT_ROTATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_QUERY_QUESTS_COMPLETED_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_QUERY_TIME_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUERY_TIME_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_OFFER_REWARD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_DETAILS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1256,7 +1256,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_SET_FACTION_STANDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SET_FACTION_VISIBLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SET_FLAT_SPELL_MODIFIER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SET_FORCED_REACTIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SET_FORCED_REACTIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SET_PCT_SPELL_MODIFIER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SET_PHASE_SHIFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1378,7 +1378,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_ROSTER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SET_TALKER_MUTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_WARDEN_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_WEATHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_WEATHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_WHO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_WHOIS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_WORLD_STATE_UI_TIMER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index d08f814c479..8687549644e 100755 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -584,8 +584,11 @@ void WorldSession::SendNotification(const char *format, ...) vsnprintf(szStr, 1024, format, ap); va_end(ap); - WorldPacket data(SMSG_NOTIFICATION, (strlen(szStr) + 1)); - data << szStr; + size_t len = strlen(szStr); + WorldPacket data(SMSG_NOTIFICATION, 2 + len); + data.WriteBits(len, 13); + data.FlushBits(); + data.append(szStr, len); SendPacket(&data); } } @@ -602,8 +605,11 @@ void WorldSession::SendNotification(uint32 string_id, ...) vsnprintf(szStr, 1024, format, ap); va_end(ap); - WorldPacket data(SMSG_NOTIFICATION, (strlen(szStr) + 1)); - data << szStr; + size_t len = strlen(szStr); + WorldPacket data(SMSG_NOTIFICATION, 2 + len); + data.WriteBits(len, 13); + data.FlushBits(); + data.append(szStr, len); SendPacket(&data); } } diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index fc46d8d2d60..5778e9deef3 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -2615,8 +2615,10 @@ void World::SendAutoBroadcast() else if (abcenter == 1) { - WorldPacket data(SMSG_NOTIFICATION, (msg.size()+1)); - data << msg; + WorldPacket data(SMSG_NOTIFICATION, 2 + msg.length()); + data.WriteBits(msg.length(), 13); + data.FlushBits(); + data.append(msg.c_str(), msg.length()); sWorld->SendGlobalMessage(&data); } @@ -2624,8 +2626,10 @@ void World::SendAutoBroadcast() { sWorld->SendWorldText(LANG_AUTO_BROADCAST, msg.c_str()); - WorldPacket data(SMSG_NOTIFICATION, (msg.size()+1)); - data << msg; + WorldPacket data(SMSG_NOTIFICATION, 2 + msg.length()); + data.WriteBits(msg.length(), 13); + data.FlushBits(); + data.append(msg.c_str(), msg.length()); sWorld->SendGlobalMessage(&data); } -- cgit v1.2.3 From 19759a139cdcfe4665bc8e397814b5fa81ed7635 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 17 Jul 2012 14:03:00 +0200 Subject: Core/PacketIO: Updated and enabled addon chat messages --- src/server/game/Handlers/ChatHandler.cpp | 26 ++++++++++++++++++-------- src/server/game/Server/Protocol/Opcodes.cpp | 10 +++++----- 2 files changed, 23 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cpp index 08d36328cf0..cfc7376a683 100755 --- a/src/server/game/Handlers/ChatHandler.cpp +++ b/src/server/game/Handlers/ChatHandler.cpp @@ -554,26 +554,36 @@ void WorldSession::HandleAddonMessagechatOpcode(WorldPacket& recvData) case CMSG_MESSAGECHAT_ADDON_PARTY: type = CHAT_MSG_PARTY; break; - //case CMSG_MESSAGECHAT_ADDON_RAID: - // type = CHAT_MSG_RAID; - // break; - //case CMSG_MESSAGECHAT_ADDON_WHISPER: - // type = CHAT_MSG_WHISPER; - // break; + case CMSG_MESSAGECHAT_ADDON_RAID: + type = CHAT_MSG_RAID; + break; + case CMSG_MESSAGECHAT_ADDON_WHISPER: + type = CHAT_MSG_WHISPER; + break; default: sLog->outDetail("HandleAddonMessagechatOpcode: Unknown addon chat opcode (%u)", recvData.GetOpcode()); recvData.hexlike(); return; } + uint32 msgLen = recvData.ReadBits(9); + uint32 prefixLen = recvData.ReadBits(5); std::string message = ""; std::string prefix = ""; std::string targetName = ""; if (type == CHAT_MSG_WHISPER) - recvData >> prefix >> targetName >> message; + { + uint32 targetLen = recvData.ReadBits(10); + message = recvData.ReadString(msgLen); + prefix = recvData.ReadString(prefixLen); + targetName = recvData.ReadString(targetLen); + } else - recvData >> message >> prefix; + { + message = recvData.ReadString(msgLen); + prefix = recvData.ReadString(prefixLen); + } // Logging enabled? if (sWorld->getBoolConfig(CONFIG_CHATLOG_ADDON)) diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index de9d9487c6c..165c57144c5 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -404,11 +404,11 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_MAIL_TAKE_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailTakeMoney ); //DEFINE_OPCODE_HANDLER(CMSG_MAKEMONSTERATTACKGUID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_MEETINGSTONE_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_BATTLEGROUND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_GUILD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_PARTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_RAID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_WHISPER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_BATTLEGROUND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_GUILD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_PARTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_RAID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_WHISPER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_AFK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_BATTLEGROUND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_BATTLEGROUND_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); -- cgit v1.2.3 From 953f0939203501f0182cb10f9c92246df2bee343 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 17 Jul 2012 19:29:18 +0200 Subject: Core/PacketIO: Updated and enabled MSG_MOVE_TELEPORT, MSG_MOVE_TELEPORT_ACK, MSG_MOVE_WORLDPORT_ACK, SMSG_NEW_WORLD and SMSG_TRANSFER_PENDING --- src/server/game/Entities/Player/Player.cpp | 155 +++++++++++---------------- src/server/game/Entities/Player/Player.h | 1 - src/server/game/Handlers/MovementHandler.cpp | 53 +++++---- src/server/game/Server/Protocol/Opcodes.cpp | 11 +- src/server/game/Server/Protocol/Opcodes.h | 4 +- src/server/scripts/Commands/cs_gm.cpp | 4 +- 6 files changed, 107 insertions(+), 121 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 88f2170fdfb..fbd3f4a12a9 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -2039,89 +2039,64 @@ uint8 Player::GetChatTag() const void Player::SendTeleportPacket(Position &oldPos) { - WorldPacket data(SMSG_MOVE_TELEPORT, 38); - - uint64 guid = GetGUID(); - uint8* bytes = (uint8*)&guid; - - data.WriteBit(GetTransGUID()); - data.WriteBit(bytes[0]); - data.WriteBit(bytes[2]); - data.WriteBit(bytes[6]); - data.WriteBit(bytes[7]); - data.WriteBit(bytes[4]); - data.WriteBit(bytes[5]); - data.WriteBit(bytes[3]); - data.WriteBit(bytes[1]); - data.WriteBit(0); //unk byte's bit - data << GetPositionX(); - data << GetPositionY(); - data << GetPositionZ(); - data.WriteByteSeq(bytes[5]); - data.WriteByteSeq(bytes[4]); - if (GetTransGUID()) data << GetTransGUID(); - data.WriteByteSeq(bytes[2]); - data.WriteByteSeq(bytes[7]); - data << uint32(0); //unk int - data.WriteByteSeq(bytes[1]); - data.WriteByteSeq(bytes[0]); - data.WriteByteSeq(bytes[6]); - data.WriteByteSeq(bytes[3]); - // unk byte, only if bit is set - data << GetOrientation(); + ObjectGuid guid = GetGUID(); + ObjectGuid transGuid = GetTransGUID(); + + WorldPacket data(MSG_MOVE_TELEPORT, 38); + data.WriteBit(guid[6]); + data.WriteBit(guid[0]); + data.WriteBit(guid[3]); + data.WriteBit(guid[2]); + data.WriteBit(0); // unknown + data.WriteBit(uint64(transGuid)); + data.WriteBit(guid[1]); + if (transGuid) + { + data.WriteBit(transGuid[1]); + data.WriteBit(transGuid[3]); + data.WriteBit(transGuid[2]); + data.WriteBit(transGuid[5]); + data.WriteBit(transGuid[0]); + data.WriteBit(transGuid[7]); + data.WriteBit(transGuid[6]); + data.WriteBit(transGuid[4]); + } + + data.WriteBit(guid[4]); + data.WriteBit(guid[7]); + data.WriteBit(guid[5]); + data.FlushBits(); + + if (transGuid) + { + data.WriteByteSeq(transGuid[6]); + data.WriteByteSeq(transGuid[5]); + data.WriteByteSeq(transGuid[1]); + data.WriteByteSeq(transGuid[7]); + data.WriteByteSeq(transGuid[0]); + data.WriteByteSeq(transGuid[2]); + data.WriteByteSeq(transGuid[4]); + data.WriteByteSeq(transGuid[3]); + } + + data << uint32(0); // counter + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[5]); + data << float(GetPositionX()); + data.WriteByteSeq(guid[4]); + data << float(GetOrientation()); + data.WriteByteSeq(guid[7]); + data << float(GetPositionZMinusOffset()); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[6]); + data << float(GetPositionY()); Relocate(&oldPos); SendDirectMessage(&data); } -void Player::SendSetFlyPacket(bool apply) -{ - WorldPacket data(apply ? SMSG_MOVE_SET_CAN_FLY : SMSG_MOVE_UNSET_CAN_FLY, 12); - uint64 guid = GetGUID(); - uint8* bytes = (uint8*)&guid; - if (apply) - { - data.WriteBit(bytes[4]); - data.WriteBit(bytes[3]); - data.WriteBit(bytes[6]); - data.WriteBit(bytes[0]); - data.WriteBit(bytes[1]); - data.WriteBit(bytes[2]); - data.WriteBit(bytes[7]); - data.WriteBit(bytes[5]); - data.WriteByteSeq(bytes[3]); - data.WriteByteSeq(bytes[7]); - data.WriteByteSeq(bytes[5]); - data.WriteByteSeq(bytes[0]); - data.WriteByteSeq(bytes[1]); - data.WriteByteSeq(bytes[4]); - data << uint32(sWorld->GetGameTime()); - data.WriteByteSeq(bytes[6]); - data.WriteByteSeq(bytes[2]); - } - else - { - data.WriteBit(bytes[1]); - data.WriteBit(bytes[6]); - data.WriteBit(bytes[0]); - data.WriteBit(bytes[2]); - data.WriteBit(bytes[4]); - data.WriteBit(bytes[5]); - data.WriteBit(bytes[7]); - data.WriteBit(bytes[3]); - data.WriteByteSeq(bytes[7]); - data.WriteByteSeq(bytes[6]); - data.WriteByteSeq(bytes[5]); - data.WriteByteSeq(bytes[0]); - data << uint32(sWorld->GetGameTime()); - data.WriteByteSeq(bytes[3]); - data.WriteByteSeq(bytes[1]); - data.WriteByteSeq(bytes[2]); - data.WriteByteSeq(bytes[4]); - } - SendDirectMessage(&data); -} - bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientation, uint32 options) { if (!MapManager::IsValidMapCoord(mapid, x, y, z, orientation)) @@ -2316,10 +2291,16 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati { // send transfer packets WorldPacket data(SMSG_TRANSFER_PENDING, 4 + 4 + 4); - data << uint32(mapid); + data.WriteBit(0); // unknown if (m_transport) - data << m_transport->GetEntry() << GetMapId(); + { + data.WriteBit(1); // has transport + data << GetMapId() << m_transport->GetEntry(); + } + else + data.WriteBit(0); // has transport + data << uint32(mapid); GetSession()->SendPacket(&data); } @@ -2349,17 +2330,11 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati if (!GetSession()->PlayerLogout()) { WorldPacket data(SMSG_NEW_WORLD, 4 + 4 + 4 + 4 + 4); - if (m_transport) - data << m_movementInfo.t_pos.PositionXYZStream(); - else - data << m_teleport_dest.PositionXYZStream(); - + data << float(m_teleport_dest.GetPositionX()); + data << float(m_teleport_dest.GetOrientation()); + data << float(m_teleport_dest.GetPositionZ()); data << uint32(mapid); - - if (m_transport) - data << m_movementInfo.t_pos.GetOrientation(); - else - data << m_teleport_dest.GetOrientation(); + data << float(m_teleport_dest.GetPositionY()); GetSession()->SendPacket(&data); SendSavedInstances(); diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index d6941406145..95f0650ee4f 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -2024,7 +2024,6 @@ class Player : public Unit, public GridObject void SendMessageToSet(WorldPacket* data, Player const* skipped_rcvr); void SendTeleportPacket(Position &oldPos); - void SendSetFlyPacket(bool apply); Corpse* GetCorpse() const; void SpawnCorpseBones(); diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp index 6461d31db55..51cb0385a90 100755 --- a/src/server/game/Handlers/MovementHandler.cpp +++ b/src/server/game/Handlers/MovementHandler.cpp @@ -32,9 +32,9 @@ #include "ObjectMgr.h" #include "MovementStructures.h" -void WorldSession::HandleMoveWorldportAckOpcode(WorldPacket & /*recv_data*/) +void WorldSession::HandleMoveWorldportAckOpcode(WorldPacket& /*recvPacket*/) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: got CMSG_WORLD_PORT_RESPONSE."); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: got MSG_MOVE_WORLDPORT_ACK."); HandleMoveWorldportAckOpcode(); } @@ -188,20 +188,33 @@ void WorldSession::HandleMoveWorldportAckOpcode() GetPlayer()->ProcessDelayedOperations(); } -void WorldSession::HandleMoveTeleportAck(WorldPacket& recv_data) +void WorldSession::HandleMoveTeleportAck(WorldPacket& recvPacket) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_MOVE_TELEPORT_ACK"); - - recv_data.rfinish(); - return; + sLog->outDebug(LOG_FILTER_NETWORKIO, "MSG_MOVE_TELEPORT_ACK"); + ObjectGuid guid; uint32 flags, time; - recv_data >> flags >> time; - - - uint64 guid = 0; - - sLog->outStaticDebug("Guid " UI64FMTD, guid); + recvPacket >> flags >> time; + + guid[5] = recvPacket.ReadBit(); + guid[0] = recvPacket.ReadBit(); + guid[1] = recvPacket.ReadBit(); + guid[6] = recvPacket.ReadBit(); + guid[3] = recvPacket.ReadBit(); + guid[7] = recvPacket.ReadBit(); + guid[2] = recvPacket.ReadBit(); + guid[4] = recvPacket.ReadBit(); + + recvPacket.ReadByteSeq(guid[4]); + recvPacket.ReadByteSeq(guid[2]); + recvPacket.ReadByteSeq(guid[7]); + recvPacket.ReadByteSeq(guid[6]); + recvPacket.ReadByteSeq(guid[5]); + recvPacket.ReadByteSeq(guid[1]); + recvPacket.ReadByteSeq(guid[3]); + recvPacket.ReadByteSeq(guid[0]); + + sLog->outStaticDebug("Guid " UI64FMTD, uint64(guid)); sLog->outStaticDebug("Flags %u, time %u", flags, time/IN_MILLISECONDS); Player* plMover = _player->m_mover->ToPlayer(); @@ -243,9 +256,9 @@ void WorldSession::HandleMoveTeleportAck(WorldPacket& recv_data) GetPlayer()->ProcessDelayedOperations(); } -void WorldSession::HandleMovementOpcodes(WorldPacket & recvData) +void WorldSession::HandleMovementOpcodes(WorldPacket& recvPacket) { - uint16 opcode = recvData.GetOpcode(); + uint16 opcode = recvPacket.GetOpcode(); Unit* mover = _player->m_mover; @@ -256,13 +269,13 @@ void WorldSession::HandleMovementOpcodes(WorldPacket & recvData) // ignore, waiting processing in WorldSession::HandleMoveWorldportAckOpcode and WorldSession::HandleMoveTeleportAck if (plrMover && plrMover->IsBeingTeleported()) { - recvData.rfinish(); // prevent warnings spam + recvPacket.rfinish(); // prevent warnings spam return; } /* extract packet */ MovementInfo movementInfo; - ReadMovementInfo(recvData, &movementInfo); + ReadMovementInfo(recvPacket, &movementInfo); // prevent tampered movement data if (movementInfo.guid != mover->GetGUID()) @@ -283,14 +296,14 @@ void WorldSession::HandleMovementOpcodes(WorldPacket & recvData) // (also received at zeppelin leave by some reason with t_* as absolute in continent coordinates, can be safely skipped) if (movementInfo.t_pos.GetPositionX() > 50 || movementInfo.t_pos.GetPositionY() > 50 || movementInfo.t_pos.GetPositionZ() > 50) { - recvData.rfinish(); // prevent warnings spam + recvPacket.rfinish(); // prevent warnings spam return; } if (!Trinity::IsValidMapCoord(movementInfo.pos.GetPositionX() + movementInfo.t_pos.GetPositionX(), movementInfo.pos.GetPositionY() + movementInfo.t_pos.GetPositionY(), movementInfo.pos.GetPositionZ() + movementInfo.t_pos.GetPositionZ(), movementInfo.pos.GetOrientation() + movementInfo.t_pos.GetOrientation())) { - recvData.rfinish(); // prevent warnings spam + recvPacket.rfinish(); // prevent warnings spam return; } @@ -364,7 +377,7 @@ void WorldSession::HandleMovementOpcodes(WorldPacket & recvData) /*----------------------*/ /* process position-change */ - WorldPacket data(SMSG_PLAYER_MOVE, recvData.size()); + WorldPacket data(SMSG_PLAYER_MOVE, recvPacket.size()); movementInfo.time = getMSTime(); movementInfo.guid = mover->GetGUID(); WriteMovementInfo(data, &movementInfo); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 165c57144c5..3fd11c4bd0e 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -455,8 +455,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SPLINE_DONE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveSplineDoneOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_START_SWIM_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_STOP_SWIM_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_TELEPORT_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveTeleportAck ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_TELEPORT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_TIME_SKIPPED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleMoveTimeSkippedOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_WATER_WALK_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveWaterWalkAck ); //DEFINE_OPCODE_HANDLER(CMSG_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNameQueryOpcode ); @@ -682,7 +680,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_WEATHER_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_WHO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWhoOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_WHOIS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWhoisOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_WORLD_PORT_RESPONSE, STATUS_TRANSFER, PROCESS_THREADUNSAFE, &WorldSession::HandleMoveWorldportAckOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_WORLD_STATE_UI_TIMER_UPDATE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleWorldStateUITimerUpdate ); //DEFINE_OPCODE_HANDLER(CMSG_WORLD_TELEPORT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWorldTeleportOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_WRAP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWrapItemOpcode ); @@ -750,6 +747,9 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_SWIM, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_SWIM_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_TURN, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_TELEPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_TELEPORT_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveTeleportAck ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_TELEPORT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_TOGGLE_COLLISION_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_TOGGLE_FALL_LOGGING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_TOGGLE_LOGGING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -757,6 +757,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_WORLDPORT_ACK, STATUS_TRANSFER, PROCESS_THREADUNSAFE, &WorldSession::HandleMoveWorldportAckOpcode ); //DEFINE_OPCODE_HANDLER(MSG_NOTIFY_PARTY_SQUELCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_NULL_ACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_PARTY_ASSIGNMENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePartyAssignmentOpcode ); @@ -1129,7 +1130,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_MULTIPLE_PACKETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_NEW_TAXI_PATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_NEW_WORLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_NEW_WORLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_NOTIFY_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_NOTIFY_DEST_LOC_SPELL_CAST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1352,7 +1353,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_SUCCEEDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TRANSFER_ABORTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_TRANSFER_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TRANSFER_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TRIGGER_CINEMATIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TRIGGER_MOVIE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TURN_IN_PETITION_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index f35d9460dbd..9483e53a11b 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -316,8 +316,6 @@ enum Opcodes CMSG_MOVE_SET_RELATIVE_POSITION = 0x0000, CMSG_MOVE_SET_VEHICLE_REC_ID_ACK = 0x0000, CMSG_MOVE_SPLINE_DONE = 0x790E, - CMSG_MOVE_TELEPORT_ACK = 0x0000, - CMSG_MOVE_TELEPORT_CHEAT = 0x0000, CMSG_MOVE_TIME_SKIPPED = 0x7A0A, CMSG_MOVE_TOGGLE_COLLISION_ACK = 0x0000, CMSG_MOVE_WATER_WALK_ACK = 0x0000, @@ -479,7 +477,6 @@ enum Opcodes CMSG_WARDEN_DATA = 0x25A2, CMSG_WHO = 0x6C15, CMSG_WHOIS = 0x6B05, - CMSG_WORLD_PORT_RESPONSE = 0x2411, CMSG_WORLD_STATE_UI_TIMER_UPDATE = 0x4605, CMSG_WORLD_TELEPORT = 0x3330, CMSG_WRAP_ITEM = 0x0000, @@ -550,6 +547,7 @@ enum Opcodes MSG_MOVE_UPDATE_RUN_SPEED = 0x14A6, MSG_MOVE_UPDATE_TELEPORT = 0x50B2, MSG_MOVE_WATER_WALK = 0x0000, + MSG_MOVE_WORLDPORT_ACK = 0x2411, MSG_NOTIFY_PARTY_SQUELCH = 0x0000, MSG_PARTY_ASSIGNMENT = 0x0000, MSG_PETITION_DECLINE = 0x31E0, diff --git a/src/server/scripts/Commands/cs_gm.cpp b/src/server/scripts/Commands/cs_gm.cpp index ba5a7f10d7d..75865d98d8b 100644 --- a/src/server/scripts/Commands/cs_gm.cpp +++ b/src/server/scripts/Commands/cs_gm.cpp @@ -98,9 +98,9 @@ public: WorldPacket data; if (strncmp(args, "on", 3) == 0) - target->SendSetFlyPacket(true); + target->SendMovementSetCanFly(true); else if (strncmp(args, "off", 4) == 0) - target->SendSetFlyPacket(false); + target->SendMovementSetCanFly(false); else { handler->SendSysMessage(LANG_USE_BOL); -- cgit v1.2.3 From 47357e58eac7052cde60afd7ec28b8057cc298f8 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 17 Jul 2012 21:36:40 +0200 Subject: Core/PacketIO: Updated and enabled CMSG_CAST_SPELL, SMSG_SPELL_START and SMSG_SPELL_GO --- src/server/game/Handlers/SpellHandler.cpp | 21 +++++++++++++++++ src/server/game/Server/Protocol/Opcodes.cpp | 7 +++--- src/server/game/Server/Protocol/Opcodes.h | 1 - src/server/game/Spells/Spell.cpp | 35 +++++++++++++++++++++++++++-- 4 files changed, 57 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp index 6aba8c82477..0d66776f273 100755 --- a/src/server/game/Handlers/SpellHandler.cpp +++ b/src/server/game/Handlers/SpellHandler.cpp @@ -62,6 +62,27 @@ void WorldSession::HandleClientCastFlags(WorldPacket& recvPacket, uint8 castFlag ReadMovementInfo(recvPacket, &movementInfo);*/ } } + else if (castFlags & 0x8) // Archaeology + { + uint32 count, entry, usedCount; + uint8 type; + recvPacket >> count; + for (uint32 i = 0; i < count; ++i) + { + recvPacket >> type; + switch (type) + { + case 2: // Keystones + recvPacket >> entry; // Item id + recvPacket >> usedCount; // Item count + break; + case 1: // Fragments + recvPacket >> entry; // Currency id + recvPacket >> usedCount; // Currency count + break; + } + } + } } void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket) diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 3fd11c4bd0e..48ea5651f1f 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -142,7 +142,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_MOUNT_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelMountAuraOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_TEMP_ENCHANTMENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelTempEnchantmentOpcode); //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_TRADE, STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelTradeOpcode); - //DEFINE_OPCODE_HANDLER(CMSG_CAST_SPELL, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleCastSpellOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_CAST_SPELL, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleCastSpellOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_CHANGEPLAYER_DIFFICULTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CHANGE_GDF_ARENA_RATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CHANGE_PERSONAL_ARENA_RATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -1121,7 +1121,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SKIP_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_TELEPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1283,8 +1282,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_SPELL_DELAYED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELL_FAILED_OTHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELL_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELL_GO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELL_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELL_GO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELL_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELL_UPDATE_CHAIN_TARGETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPIRIT_HEALER_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_COLLISION_DISABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 9483e53a11b..252e9370136 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -916,7 +916,6 @@ enum Opcodes SMSG_MOVE_SET_VEHICLE_REC_ID = 0x0000, SMSG_MOVE_SET_WALK_IN_AIR = 0x0000, SMSG_MOVE_SET_WALK_SPEED = 0x1DA4, - SMSG_MOVE_TELEPORT = 0x0000, SMSG_MOVE_UNROOT = 0x7DB4, SMSG_MOVE_UNSET_CAN_FLY = 0x0000, SMSG_MOVE_UNSET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY = 0x0000, diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 76cae551bbd..6ce3fc2c228 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3878,12 +3878,43 @@ void Spell::SendSpellStart() data << uint32(m_spellInfo->Id); // spellId data << uint32(castFlags); // cast flags data << int32(m_timer); // delay? + data << uint32(0); m_targets.Write(data); if (castFlags & CAST_FLAG_POWER_LEFT_SELF) data << uint32(m_caster->GetPower((Powers)m_spellInfo->PowerType)); + if (castFlags & CAST_FLAG_RUNE_LIST) // rune cooldowns list + { + //TODO: There is a crash caused by a spell with CAST_FLAG_RUNE_LIST casted by a creature + //The creature is the mover of a player, so HandleCastSpellOpcode uses it as the caster + if (Player* player = m_caster->ToPlayer()) + { + data << uint8(m_runesState); // runes state before + data << uint8(player->GetRunesState()); // runes state after + for (uint8 i = 0; i < MAX_RUNES; ++i) + { + // float casts ensure the division is performed on floats as we need float result + float baseCd = float(player->GetRuneBaseCooldown(i)); + data << uint8((baseCd - float(player->GetRuneCooldown(i))) / baseCd * 255); // rune cooldown passed + } + } + else + { + data << uint8(0); + data << uint8(0); + for (uint8 i = 0; i < MAX_RUNES; ++i) + data << uint8(0); + } + } + + if (castFlags & CAST_FLAG_PROJECTILE) + { + data << uint32(0); // Ammo display ID + data << uint32(0); // Inventory Type + } + if (castFlags & CAST_FLAG_IMMUNITY) { data << uint32(0); @@ -3896,7 +3927,6 @@ void Spell::SendSpellStart() data << uint8(0); // unkByte // if (unkByte == 2) // data.append(0); - } m_caster->SendMessageToSet(&data, true); @@ -3952,6 +3982,7 @@ void Spell::SendSpellGo() data << uint8(m_cast_count); // pending spell cast? data << uint32(m_spellInfo->Id); // spellId data << uint32(castFlags); // cast flags + data << uint32(m_timer); data << uint32(getMSTime()); // timestamp WriteSpellGoTargets(&data); @@ -4003,7 +4034,7 @@ void Spell::SendSpellGo() if (m_targets.GetTargetMask() & TARGET_FLAG_EXTRA_TARGETS) { - data << uint8(0); // Extra targets count + data << uint32(0); // Extra targets count /* for (uint8 i = 0; i < count; ++i) { -- cgit v1.2.3 From 52751a2c737665fd70d750becbb35307c4137568 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 17 Jul 2012 21:37:33 +0200 Subject: Core/Players: Update rune cooldown handling for cataclysm --- src/server/game/Entities/Player/Player.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index fbd3f4a12a9..0b2c68aab27 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -2484,9 +2484,23 @@ void Player::RegenerateAll() // Runes act as cooldowns, and they don't need to send any data if (getClass() == CLASS_DEATH_KNIGHT) - for (uint8 i = 0; i < MAX_RUNES; ++i) - if (uint32 cd = GetRuneCooldown(i)) - SetRuneCooldown(i, (cd > m_regenTimer) ? cd - m_regenTimer : 0); + { + for (uint8 i = 0; i < MAX_RUNES; i += 2) + { + uint8 runeToRegen = i; + uint32 cd = GetRuneCooldown(i); + uint32 secondRuneCd = GetRuneCooldown(i + 1); + // Regenerate second rune of the same type only after first rune is off the cooldown + if (secondRuneCd && (cd > secondRuneCd || !cd)) + { + runeToRegen = i + 1; + cd = secondRuneCd; + } + + if (cd) + SetRuneCooldown(runeToRegen, (cd > m_regenTimer) ? cd - m_regenTimer : 0); + } + } if (m_regenTimerCount >= 2000) { -- cgit v1.2.3 From e9e1fb10253956bea67fc197f0d8e1c055173034 Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 18 Jul 2012 14:43:55 +0200 Subject: Core/PacketIO: Implemented packet compression for any opcode. --- src/server/game/Achievements/AchievementMgr.cpp | 3 -- .../game/Entities/Object/Updates/UpdateData.cpp | 4 -- src/server/game/Maps/Map.cpp | 2 +- src/server/game/Maps/Map.h | 2 +- src/server/game/Server/Protocol/Opcodes.cpp | 20 +++---- src/server/game/Server/Protocol/Opcodes.h | 23 ++++---- src/server/game/Server/WorldPacket.cpp | 62 +++++----------------- src/server/game/Server/WorldPacket.h | 5 +- src/server/game/Server/WorldSession.cpp | 28 +++++++++- src/server/game/Server/WorldSession.h | 3 +- .../IcecrownCitadel/boss_the_lich_king.cpp | 2 +- 11 files changed, 73 insertions(+), 81 deletions(-) (limited to 'src') diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 0ff0ace60c3..d00ff14909f 100755 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -2422,9 +2422,6 @@ void AchievementMgr::SendAllAchievementData(Player* /*receiver*/) const data << uint32(secsToTimeBitFields(itr->second.date)); } - if (data.size() > 0x1000) - data.Compress(SMSG_COMPRESSED_ACHIEVEMENT_DATA); - SendPacket(&data); } diff --git a/src/server/game/Entities/Object/Updates/UpdateData.cpp b/src/server/game/Entities/Object/Updates/UpdateData.cpp index 1a1b0984f03..afe43ca245c 100755 --- a/src/server/game/Entities/Object/Updates/UpdateData.cpp +++ b/src/server/game/Entities/Object/Updates/UpdateData.cpp @@ -63,10 +63,6 @@ bool UpdateData::BuildPacket(WorldPacket* packet) } packet->append(m_data); - - if (packet->wpos() > 100) - packet->Compress(SMSG_COMPRESSED_UPDATE_OBJECT); - return true; } diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 8df8feb6cac..6462b721074 100755 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -2181,7 +2181,7 @@ uint32 Map::GetPlayersCountExceptGMs() const return count; } -void Map::SendToPlayers(WorldPacket const* data) const +void Map::SendToPlayers(WorldPacket* data) const { for (MapRefManager::const_iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr) itr->getSource()->GetSession()->SendPacket(data); diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h index 5eb11416fdd..2b135059ce4 100755 --- a/src/server/game/Maps/Map.h +++ b/src/server/game/Maps/Map.h @@ -395,7 +395,7 @@ class Map : public GridRefManager void AddWorldObject(WorldObject* obj) { i_worldObjects.insert(obj); } void RemoveWorldObject(WorldObject* obj) { i_worldObjects.erase(obj); } - void SendToPlayers(WorldPacket const* data) const; + void SendToPlayers(WorldPacket* data) const; typedef MapRefManager PlayerList; PlayerList const& GetPlayers() const { return m_mapRefManager; } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 48ea5651f1f..bbc3266cc99 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -27,16 +27,16 @@ OpcodeHandler* opcodeTable[NUM_OPCODE_HANDLERS] = { }; /// Correspondence between opcodes and their names void InitOpcodes() { -#define DEFINE_OPCODE_HANDLER(opcode, status, processing, handler) \ - if (opcode == 0) \ - sLog->outError("Opcode %s got value 0", #opcode); \ - if (opcode < NUM_OPCODE_HANDLERS) { \ - if (opcodeTable[opcode] != NULL) \ - { \ - sLog->outError("Tried to override handler of %s with %s (opcode %u)", \ - opcodeTable[opcode]->name, #opcode, opcode); \ - } \ - else opcodeTable[opcode] = new OpcodeHandler(#opcode, status, processing, handler); \ +#define DEFINE_OPCODE_HANDLER(opcode, status, processing, handler) \ + if (opcode == 0) \ + sLog->outError("Opcode %s got value 0", #opcode); \ + if (opcode < NUM_OPCODE_HANDLERS) { \ + if (opcodeTable[opcode] != NULL) \ + { \ + sLog->outError("Tried to override handler of %s with %s (opcode %u)", \ + opcodeTable[opcode]->name, #opcode, opcode); \ + } \ + else opcodeTable[opcode] = new OpcodeHandler(#opcode, #opcode##"_COMPRESSED", status, processing, handler); \ } memset(opcodeTable, 0, sizeof(opcodeTable)); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 252e9370136..0fd5569bcbd 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -28,9 +28,10 @@ /// List of Opcodes enum Opcodes { - NUM_OPCODE_HANDLERS = (0xFFFF+1), - UNKNOWN_OPCODE = NUM_OPCODE_HANDLERS, + NUM_OPCODE_HANDLERS = (0x7FFF+1), + UNKNOWN_OPCODE = (0xFFFF+1), NULL_OPCODE = 0, + COMPRESSED_OPCODE_MASK = 0x8000, CMSG_ACCEPT_LEVEL_GRANT = 0x0205, CMSG_ACCEPT_TRADE = 0x7110, @@ -1186,10 +1187,11 @@ typedef void(WorldSession::*pOpcodeHandler)(WorldPacket& recvPacket); struct OpcodeHandler { OpcodeHandler() {} - OpcodeHandler(const char* _name, SessionStatus _status, PacketProcessing _processing, pOpcodeHandler _handler) - : name(_name), status(_status), packetProcessing(_processing), handler(_handler) {} + OpcodeHandler(char const* _name, char const* _compressedName, SessionStatus _status, PacketProcessing _processing, pOpcodeHandler _handler) + : name(_name), compressedName(_compressedName), status(_status), packetProcessing(_processing), handler(_handler) {} char const* name; + char const* compressedName; SessionStatus status; PacketProcessing packetProcessing; pOpcodeHandler handler; @@ -1201,13 +1203,16 @@ void InitOpcodes(); /// Lookup opcode name for human understandable logging inline const char* LookupOpcodeName(Opcodes id) { - if (id < NUM_OPCODE_HANDLERS) + if (id < UNKNOWN_OPCODE) { - OpcodeHandler* handler = opcodeTable[uint32(id)]; - return handler ? handler->name : "UNKNOWN OPCODE"; - } - else + bool isCompressed = uint32(id) & COMPRESSED_OPCODE_MASK; + if (OpcodeHandler* handler = opcodeTable[uint32(id) & 0x7FFF]) + return isCompressed ? handler->compressedName : handler->name; + return "UNKNOWN OPCODE"; + } + + return "INVALID OPCODE"; } #endif /// @} diff --git a/src/server/game/Server/WorldPacket.cpp b/src/server/game/Server/WorldPacket.cpp index b6d037d6066..f5d6c8a211c 100644 --- a/src/server/game/Server/WorldPacket.cpp +++ b/src/server/game/Server/WorldPacket.cpp @@ -15,24 +15,20 @@ * with this program. If not, see . */ -#include "WorldPacket.h" #include +#include "WorldPacket.h" #include "World.h" -void WorldPacket::Compress(Opcodes opcode) +void WorldPacket::Compress(z_stream* compressionStream) { - if (opcode == UNKNOWN_OPCODE || opcode == NULL_OPCODE) - { - sLog->outError("Tried to compress packet with unknown opcode (%u)", uint32(opcode)); - return; - } - Opcodes uncompressedOpcode = GetOpcode(); + Opcodes opcode = Opcodes(uncompressedOpcode | COMPRESSED_OPCODE_MASK); uint32 size = wpos(); uint32 destsize = compressBound(size); std::vector storage(destsize); + _compressionStream = compressionStream; Compress(static_cast(&storage[0]), &destsize, static_cast(contents()), size); if (destsize == 0) return; @@ -43,62 +39,30 @@ void WorldPacket::Compress(Opcodes opcode) append(&storage[0], destsize); SetOpcode(opcode); - sLog->outStaticDebug("Successfully compressed opcode %u (len %u) to %u (len %u)", - uncompressedOpcode, size, opcode, destsize); + sLog->outStaticDebug("Successfully compressed opcode %u (len %u) to %u (len %u)", uncompressedOpcode, size, opcode, destsize); } void WorldPacket::Compress(void* dst, uint32 *dst_size, const void* src, int src_size) { - z_stream c_stream; - - c_stream.zalloc = (alloc_func)NULL; - c_stream.zfree = (free_func)NULL; - c_stream.opaque = (voidpf)NULL; + _compressionStream->next_out = (Bytef*)dst; + _compressionStream->avail_out = *dst_size; + _compressionStream->next_in = (Bytef*)src; + _compressionStream->avail_in = (uInt)src_size; - // default Z_BEST_SPEED (1) - int z_res = deflateInit(&c_stream, sWorld->getIntConfig(CONFIG_COMPRESSION)); + int32 z_res = deflate(_compressionStream, Z_SYNC_FLUSH); if (z_res != Z_OK) { - sLog->outError("Can't compress packet (zlib: deflateInit) Error code: %i (%s)",z_res,zError(z_res)); + sLog->outError("Can't compress packet (zlib: deflate) Error code: %i (%s, msg: %s)", z_res, zError(z_res), _compressionStream->msg); *dst_size = 0; return; } - c_stream.next_out = (Bytef*)dst; - c_stream.avail_out = *dst_size; - c_stream.next_in = (Bytef*)src; - c_stream.avail_in = (uInt)src_size; - - z_res = deflate(&c_stream, Z_NO_FLUSH); - if (z_res != Z_OK) - { - sLog->outError("Can't compress packet (zlib: deflate) Error code: %i (%s)",z_res,zError(z_res)); - *dst_size = 0; - return; - } - - if (c_stream.avail_in != 0) + if (_compressionStream->avail_in != 0) { sLog->outError("Can't compress packet (zlib: deflate not greedy)"); *dst_size = 0; return; } - z_res = deflate(&c_stream, Z_FINISH); - if (z_res != Z_STREAM_END) - { - sLog->outError("Can't compress packet (zlib: deflate should report Z_STREAM_END instead %i (%s)",z_res,zError(z_res)); - *dst_size = 0; - return; - } - - z_res = deflateEnd(&c_stream); - if (z_res != Z_OK) - { - sLog->outError("Can't compress packet (zlib: deflateEnd) Error code: %i (%s)",z_res,zError(z_res)); - *dst_size = 0; - return; - } - - *dst_size = c_stream.total_out; + *dst_size -= _compressionStream->avail_out; } diff --git a/src/server/game/Server/WorldPacket.h b/src/server/game/Server/WorldPacket.h index f648e905bf9..9f512924d1b 100644 --- a/src/server/game/Server/WorldPacket.h +++ b/src/server/game/Server/WorldPacket.h @@ -23,6 +23,8 @@ #include "Opcodes.h" #include "ByteBuffer.h" +struct z_stream_s; + class WorldPacket : public ByteBuffer { public: @@ -48,11 +50,12 @@ class WorldPacket : public ByteBuffer Opcodes GetOpcode() const { return m_opcode; } void SetOpcode(Opcodes opcode) { m_opcode = opcode; } - void Compress(Opcodes opcode); + void Compress(z_stream_s* compressionStream); protected: Opcodes m_opcode; void Compress(void* dst, uint32 *dst_size, const void* src, int src_size); + z_stream_s* _compressionStream; }; #endif diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index 8687549644e..17f1f9dbada 100755 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -21,6 +21,7 @@ */ #include "WorldSocket.h" // must be first to make ACE happy with ACE includes in it +#include #include "Common.h" #include "DatabaseEnv.h" #include "Log.h" @@ -111,6 +112,19 @@ isRecruiter(isARecruiter), timeLastWhoCommand(0) } InitializeQueryCallbackParameters(); + + _compressionStream = new z_stream(); + _compressionStream->zalloc = (alloc_func)NULL; + _compressionStream->zfree = (free_func)NULL; + _compressionStream->opaque = (voidpf)NULL; + _compressionStream->avail_in = 0; + _compressionStream->next_in = NULL; + int32 z_res = deflateInit(_compressionStream, sWorld->getIntConfig(CONFIG_COMPRESSION)); + if (z_res != Z_OK) + { + sLog->outError("Can't initialize packet compression (zlib: deflateInit) Error code: %i (%s)", z_res, zError(z_res)); + return; + } } /// WorldSession destructor @@ -137,6 +151,15 @@ WorldSession::~WorldSession() delete packet; LoginDatabase.PExecute("UPDATE account SET online = 0 WHERE id = %u;", GetAccountId()); // One-time query + + int32 z_res = deflateEnd(_compressionStream); + if (z_res != Z_OK && z_res != Z_DATA_ERROR) // Z_DATA_ERROR signals that internal state was BUSY + { + sLog->outError("Can't close packet compression stream (zlib: deflateEnd) Error code: %i (%s)", z_res, zError(z_res)); + return; + } + + delete _compressionStream; } void WorldSession::SizeError(WorldPacket const& packet, uint32 size) const @@ -158,7 +181,7 @@ uint32 WorldSession::GetGuidLow() const } /// Send a packet to the client -void WorldSession::SendPacket(WorldPacket const* packet) +void WorldSession::SendPacket(WorldPacket* packet) { if (!m_Socket) return; @@ -175,6 +198,9 @@ void WorldSession::SendPacket(WorldPacket const* packet) return; } + if (packet->size() > 0x400) + packet->Compress(_compressionStream); + #ifdef TRINITY_DEBUG // Code for network use statistic static uint64 sendPacketCount = 0; diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index baff1a6a690..990bb5c02b0 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -235,7 +235,7 @@ class WorldSession void ReadMovementInfo(WorldPacket& data, MovementInfo* mi); void WriteMovementInfo(WorldPacket &data, MovementInfo* mi); - void SendPacket(WorldPacket const* packet); + void SendPacket(WorldPacket* packet); void SendNotification(const char *format, ...) ATTR_PRINTF(2, 3); void SendNotification(uint32 string_id, ...); void SendPetNameInvalid(uint32 error, const std::string& name, DeclinedName *declinedName); @@ -994,6 +994,7 @@ class WorldSession bool isRecruiter; ACE_Based::LockedQueue _recvQueue; time_t timeLastWhoCommand; + z_stream_s* _compressionStream; }; #endif /// @} diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp index a8657925131..7d191341c6b 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -1146,7 +1146,7 @@ class boss_the_lich_king : public CreatureScript } // Send packet to all players in The Frozen Throne - void SendPacketToPlayers(WorldPacket const* data) const + void SendPacketToPlayers(WorldPacket* data) const { Map::PlayerList const& players = me->GetMap()->GetPlayers(); if (!players.isEmpty()) -- cgit v1.2.3 From 075e5d67515bec9650f4f3976880ea5862190b79 Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 18 Jul 2012 15:00:48 +0200 Subject: Core/Units: Some cleanup in movement packet related functions - try to keep only one function handling a packet, not have it scattered all over the place --- src/server/game/Chat/Commands/Level2.cpp | 8 ++-- src/server/game/Entities/Player/Player.cpp | 59 ++++++++++++++++----------- src/server/game/Entities/Player/Player.h | 11 +---- src/server/game/Entities/Unit/Unit.cpp | 16 ++------ src/server/game/Entities/Unit/Unit.h | 2 + src/server/game/Handlers/CharacterHandler.cpp | 2 +- src/server/game/Server/Protocol/Opcodes.cpp | 3 +- src/server/game/Server/Protocol/Opcodes.h | 3 +- 8 files changed, 50 insertions(+), 54 deletions(-) (limited to 'src') diff --git a/src/server/game/Chat/Commands/Level2.cpp b/src/server/game/Chat/Commands/Level2.cpp index 49c40e09538..8fe782a75c1 100755 --- a/src/server/game/Chat/Commands/Level2.cpp +++ b/src/server/game/Chat/Commands/Level2.cpp @@ -461,7 +461,7 @@ bool ChatHandler::HandlePInfoCommand(const char* args) bool ChatHandler::HandleCombatStopCommand(const char* args) { Player* target = NULL; - + if (args && strlen(args) > 0) { target = sObjectAccessor->FindPlayerByName(args); @@ -472,7 +472,7 @@ bool ChatHandler::HandleCombatStopCommand(const char* args) return false; } } - + if (!target) if (!extractPlayerTarget((char*)args, &target)) return false; @@ -525,9 +525,9 @@ bool ChatHandler::HandleWaterwalkCommand(const char* args) return false; if (strncmp(args, "on", 3) == 0) - player->SetMovement(MOVE_WATER_WALK); // ON + player->SendMovementSetWaterWalking(true); // ON else if (strncmp(args, "off", 4) == 0) - player->SetMovement(MOVE_LAND_WALK); // OFF + player->SendMovementSetWaterWalking(false); // OFF else { SendSysMessage(LANG_USE_BOL); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 0b2c68aab27..b22cbd5e3e2 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -5137,24 +5137,6 @@ void Player::DeleteOldCharacters(uint32 keepDays) } } -void Player::SetMovement(PlayerMovementType pType) -{ - WorldPacket data; - switch (pType) - { - case MOVE_ROOT: data.Initialize(SMSG_MOVE_ROOT, GetPackGUID().size()+4); break; - case MOVE_UNROOT: data.Initialize(SMSG_MOVE_UNROOT, GetPackGUID().size()+4); break; - case MOVE_WATER_WALK: data.Initialize(SMSG_SPLINE_MOVE_SET_WATER_WALK, GetPackGUID().size()+4); break; - case MOVE_LAND_WALK: data.Initialize(SMSG_SPLINE_MOVE_SET_LAND_WALK, GetPackGUID().size()+4); break; - default: - sLog->outError("Player::SetMovement: Unsupported move type (%d), data not sent to client.", pType); - return; - } - data.append(GetPackGUID()); - data << uint32(0); - GetSession()->SendPacket(&data); -} - /* Preconditions: - a resurrectable corpse must not be loaded for the player (only bones) - the player must be in world @@ -5193,9 +5175,9 @@ void Player::BuildPlayerRepop() // convert player body to ghost SetHealth(1); - SetMovement(MOVE_WATER_WALK); + SendMovementSetWaterWalking(true); if (!GetSession()->isLogingOut()) - SetMovement(MOVE_UNROOT); + SetRooted(false); // BG - remove insignia related RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); @@ -5235,8 +5217,8 @@ void Player::ResurrectPlayer(float restore_percent, bool applySickness) setDeathState(ALIVE); - SetMovement(MOVE_LAND_WALK); - SetMovement(MOVE_UNROOT); + SendMovementSetWaterWalking(false); + SetRooted(false); m_deathTimer = 0; @@ -5297,7 +5279,7 @@ void Player::KillPlayer() if (IsFlying() && !GetTransport()) i_motionMaster.MoveFall(); - SetMovement(MOVE_ROOT); + SetRooted(true); StopMirrorTimers(); //disable timers(bars) @@ -22299,7 +22281,7 @@ void Player::SendInitialPacketsAfterAddToMap() } if (HasAuraType(SPELL_AURA_MOD_STUN)) - SetMovement(MOVE_ROOT); + SetRooted(true); // manual send package (have code in HandleEffect(this, AURA_EFFECT_HANDLE_SEND_FOR_CLIENT, true); that must not be re-applied. if (HasAuraType(SPELL_AURA_MOD_ROOT)) @@ -25759,3 +25741,32 @@ void Player::SendMovementSetFeatherFall(bool apply) data << uint32(0); //! movement counter SendDirectMessage(&data); } + +void Player::SendMovementSetCollisionHeight(float height) +{ + ObjectGuid guid = GetGUID(); + WorldPacket data(SMSG_MOVE_SET_COLLISION_HEIGHT, 2 + 8 + 4 + 4); + data.WriteBits(0, 2); + data.WriteBit(guid[6]); + data.WriteBit(guid[1]); + data.WriteBit(guid[4]); + data.WriteBit(guid[7]); + data.WriteBit(guid[5]); + data.WriteBit(guid[2]); + data.WriteBit(guid[0]); + data.WriteBit(guid[3]); + data.FlushBits(); + + data.WriteByteSeq(guid[6]); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[5]); + data << uint32(sWorld->GetGameTime()); // Packet counter + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[7]); + data << float(height); + + SendDirectMessage(&data); +} diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 95f0650ee4f..858bd7c3d05 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -364,14 +364,6 @@ struct EnchantDuration typedef std::list EnchantDurationList; typedef std::list ItemDurationList; -enum PlayerMovementType -{ - MOVE_ROOT = 1, - MOVE_UNROOT = 2, - MOVE_WATER_WALK = 3, - MOVE_LAND_WALK = 4 -}; - enum DrunkenState { DRUNKEN_SOBER = 0, @@ -2051,8 +2043,6 @@ class Player : public Unit, public GridObject } bool IsMirrorTimerActive(MirrorTimerType type) { return m_MirrorTimer[type] == getMaxTimer(type); } - void SetMovement(PlayerMovementType pType); - bool CanJoinConstantChannelInZone(ChatChannelsEntry const* channel, AreaTableEntry const* zone); void JoinedChannel(Channel* c); @@ -2563,6 +2553,7 @@ class Player : public Unit, public GridObject void SendMovementSetHover(bool apply); void SendMovementSetWaterWalking(bool apply); void SendMovementSetFeatherFall(bool apply); + void SendMovementSetCollisionHeight(float height); bool CanFly() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_CAN_FLY); } diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 19a8ab32ac1..d2a2034d25f 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -11966,11 +11966,7 @@ void Unit::Mount(uint32 mount, uint32 VehicleId, uint32 creatureEntry) player->UnsummonPetTemporaryIfAny(); } - WorldPacket data(SMSG_MOVE_SET_COLLISION_HEIGHT, GetPackGUID().size() + 4 + 4); - data.append(GetPackGUID()); - data << uint32(sWorld->GetGameTime()); // Packet counter - data << player->GetCollisionHeight(true); - player->GetSession()->SendPacket(&data); + player->SendMovementSetCollisionHeight(player->GetCollisionHeight(true)); } RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_MOUNT); @@ -11984,14 +11980,8 @@ void Unit::Dismount() SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, 0); RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_MOUNT); - /*if (Player* thisPlayer = ToPlayer()) - { - WorldPacket data(SMSG_MOVE_SET_COLLISION_HEIGHT, GetPackGUID().size() + 4 + 4); - data.append(GetPackGUID()); - data << uint32(sWorld->GetGameTime()); // Packet counter - data << thisPlayer->GetCollisionHeight(false); - thisPlayer->GetSession()->SendPacket(&data); - }*/ + if (Player* thisPlayer = ToPlayer()) + thisPlayer->SendMovementSetCollisionHeight(thisPlayer->GetCollisionHeight(false)); WorldPacket data(SMSG_DISMOUNT, 8); data.appendPackGUID(GetGUID()); diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 7471ae603f6..82e9f4e8e56 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -2340,11 +2340,13 @@ class Unit : public WorldObject float GetCombatRatingReduction(CombatRating cr) const; uint32 GetCombatRatingDamageReduction(CombatRating cr, float rate, float cap, uint32 damage) const; + protected: void SetFeared(bool apply); void SetConfused(bool apply); void SetStunned(bool apply); void SetRooted(bool apply); + private: uint32 m_rootTimes; uint32 m_state; // Even derived shouldn't modify diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 7fc1660bc7d..37b3c3c2f0e 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -1031,7 +1031,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder) pCurrChar->CastSpell(pCurrChar, 20584, true, 0);// auras SPELL_AURA_INCREASE_SPEED(+speed in wisp form), SPELL_AURA_INCREASE_SWIM_SPEED(+swim speed in wisp form), SPELL_AURA_TRANSFORM (to wisp form) pCurrChar->CastSpell(pCurrChar, 8326, true, 0); // auras SPELL_AURA_GHOST, SPELL_AURA_INCREASE_SPEED(why?), SPELL_AURA_INCREASE_SWIM_SPEED(why?) - pCurrChar->SetMovement(MOVE_WATER_WALK); + pCurrChar->SendMovementSetWaterWalking(true); } pCurrChar->ContinueTaxiFlight(); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index bbc3266cc99..3133af8b59e 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -448,7 +448,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_MOVE_NOT_ACTIVE_MOVER, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveNotActiveMover ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_CAN_FLY_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveSetCanFlyAckOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_COLLISION_HGT_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_COLLISION_HEIGHT_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_FLY, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_RELATIVE_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -716,6 +716,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(MSG_MOVE_JUMP, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_ALL_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_COLLISION_HEIGHT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_FACING, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_FLIGHT_BACK_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_FLIGHT_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 0fd5569bcbd..6c63a781eb5 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -506,6 +506,7 @@ enum Opcodes MSG_MOVE_HOVER = 0x0000, MSG_MOVE_JUMP = 0x7A06, MSG_MOVE_SET_ALL_SPEED_CHEAT = 0x0000, + MSG_MOVE_SET_COLLISION_HEIGHT = 0x59A3, MSG_MOVE_SET_FACING = 0x7914, MSG_MOVE_SET_FLIGHT_SPEED_CHEAT = 0x0000, MSG_MOVE_SET_PITCH = 0x7312, @@ -903,7 +904,7 @@ enum Opcodes SMSG_MOVE_SET_ACTIVE_MOVER = 0x11B3, SMSG_MOVE_SET_CAN_FLY = 0x720E, SMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY = 0x3014, - SMSG_MOVE_SET_COLLISION_HEIGHT = 0x59A3, + SMSG_MOVE_SET_COLLISION_HEIGHT = 0x11B0, SMSG_MOVE_SET_COMPOUND_STATE = 0x75A0, SMSG_MOVE_SET_FLIGHT_BACK_SPEED = 0x30A2, SMSG_MOVE_SET_FLIGHT_SPEED = 0x71A6, -- cgit v1.2.3 From fa3a8363b19ee8417d143b616578544f699c7688 Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 18 Jul 2012 20:14:51 +0200 Subject: Core/PacketIO: Zlib compression stream structure is kept per session - compress packets individually for each receiver --- src/server/game/Maps/Map.cpp | 2 +- src/server/game/Maps/Map.h | 2 +- src/server/game/Server/WorldPacket.cpp | 39 ++++++++++++++++++++++ src/server/game/Server/WorldPacket.h | 1 + src/server/game/Server/WorldSession.cpp | 5 +-- src/server/game/Server/WorldSession.h | 4 ++- src/server/game/Server/WorldSocket.cpp | 31 +++++++++++------ .../IcecrownCitadel/boss_the_lich_king.cpp | 2 +- 8 files changed, 67 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 6462b721074..8df8feb6cac 100755 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -2181,7 +2181,7 @@ uint32 Map::GetPlayersCountExceptGMs() const return count; } -void Map::SendToPlayers(WorldPacket* data) const +void Map::SendToPlayers(WorldPacket const* data) const { for (MapRefManager::const_iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr) itr->getSource()->GetSession()->SendPacket(data); diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h index 2b135059ce4..5eb11416fdd 100755 --- a/src/server/game/Maps/Map.h +++ b/src/server/game/Maps/Map.h @@ -395,7 +395,7 @@ class Map : public GridRefManager void AddWorldObject(WorldObject* obj) { i_worldObjects.insert(obj); } void RemoveWorldObject(WorldObject* obj) { i_worldObjects.erase(obj); } - void SendToPlayers(WorldPacket* data) const; + void SendToPlayers(WorldPacket const* data) const; typedef MapRefManager PlayerList; PlayerList const& GetPlayers() const { return m_mapRefManager; } diff --git a/src/server/game/Server/WorldPacket.cpp b/src/server/game/Server/WorldPacket.cpp index f5d6c8a211c..f072602a5e6 100644 --- a/src/server/game/Server/WorldPacket.cpp +++ b/src/server/game/Server/WorldPacket.cpp @@ -19,9 +19,16 @@ #include "WorldPacket.h" #include "World.h" +//! Compresses packet in place void WorldPacket::Compress(z_stream* compressionStream) { Opcodes uncompressedOpcode = GetOpcode(); + if (uncompressedOpcode & COMPRESSED_OPCODE_MASK) + { + sLog->outError("Packet with opcode 0x%04X is already compressed!", uncompressedOpcode); + return; + } + Opcodes opcode = Opcodes(uncompressedOpcode | COMPRESSED_OPCODE_MASK); uint32 size = wpos(); uint32 destsize = compressBound(size); @@ -42,6 +49,38 @@ void WorldPacket::Compress(z_stream* compressionStream) sLog->outStaticDebug("Successfully compressed opcode %u (len %u) to %u (len %u)", uncompressedOpcode, size, opcode, destsize); } +//! Compresses another packet and stores it in self (source left intact) +void WorldPacket::Compress(z_stream* compressionStream, WorldPacket const* source) +{ + ASSERT(source != this); + + Opcodes uncompressedOpcode = source->GetOpcode(); + if (uncompressedOpcode & COMPRESSED_OPCODE_MASK) + { + sLog->outError("Packet with opcode 0x%04X is already compressed!", uncompressedOpcode); + return; + } + + Opcodes opcode = Opcodes(uncompressedOpcode | COMPRESSED_OPCODE_MASK); + uint32 size = source->size(); + uint32 destsize = compressBound(size); + + size_t sizePos = 0; + resize(destsize + sizeof(uint32)); + + _compressionStream = compressionStream; + Compress(static_cast(&_storage[0] + sizeof(uint32)), &destsize, static_cast(source->contents()), size); + if (destsize == 0) + return; + + put(sizePos, size); + resize(destsize + sizeof(uint32)); + + SetOpcode(opcode); + + sLog->outStaticDebug("Successfully compressed opcode %u (len %u) to %u (len %u)", uncompressedOpcode, size, opcode, destsize); +} + void WorldPacket::Compress(void* dst, uint32 *dst_size, const void* src, int src_size) { _compressionStream->next_out = (Bytef*)dst; diff --git a/src/server/game/Server/WorldPacket.h b/src/server/game/Server/WorldPacket.h index 9f512924d1b..c695c16ed3b 100644 --- a/src/server/game/Server/WorldPacket.h +++ b/src/server/game/Server/WorldPacket.h @@ -51,6 +51,7 @@ class WorldPacket : public ByteBuffer Opcodes GetOpcode() const { return m_opcode; } void SetOpcode(Opcodes opcode) { m_opcode = opcode; } void Compress(z_stream_s* compressionStream); + void Compress(z_stream_s* compressionStream, WorldPacket const* source); protected: Opcodes m_opcode; diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index 17f1f9dbada..518a3743d66 100755 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -181,7 +181,7 @@ uint32 WorldSession::GetGuidLow() const } /// Send a packet to the client -void WorldSession::SendPacket(WorldPacket* packet) +void WorldSession::SendPacket(WorldPacket const* packet) { if (!m_Socket) return; @@ -198,9 +198,6 @@ void WorldSession::SendPacket(WorldPacket* packet) return; } - if (packet->size() > 0x400) - packet->Compress(_compressionStream); - #ifdef TRINITY_DEBUG // Code for network use statistic static uint64 sendPacketCount = 0; diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 990bb5c02b0..65e8d018f96 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -235,7 +235,7 @@ class WorldSession void ReadMovementInfo(WorldPacket& data, MovementInfo* mi); void WriteMovementInfo(WorldPacket &data, MovementInfo* mi); - void SendPacket(WorldPacket* packet); + void SendPacket(WorldPacket const* packet); void SendNotification(const char *format, ...) ATTR_PRINTF(2, 3); void SendNotification(uint32 string_id, ...); void SendPetNameInvalid(uint32 error, const std::string& name, DeclinedName *declinedName); @@ -397,6 +397,8 @@ class WorldSession uint32 GetRecruiterId() const { return recruiterId; } bool IsARecruiter() const { return isRecruiter; } + z_stream_s* GetCompressionStream() { return _compressionStream; } + public: // opcodes handlers void Handle_NULL(WorldPacket& recvPacket); // not used diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index 59734364934..faff1468ad3 100755 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -159,26 +159,35 @@ int WorldSocket::SendPacket(WorldPacket const& pct) if (closing_) return -1; - // Dump outgoing packet. + // Dump outgoing packet - uncompressed, easier to parse if (sPacketLog->CanLogPacket()) sPacketLog->LogPacket(pct, SERVER_TO_CLIENT); - sLog->outOpCode(uint32(pct.GetOpcode()), LookupOpcodeName(pct.GetOpcode()), true); + WorldPacket const* pkt = &pct; - // Create a copy of the original packet; this is to avoid issues if a hook modifies it. - sScriptMgr->OnPacketSend(this, WorldPacket(pct)); + // Empty buffer used in case packet should be compressed + WorldPacket buff; + if (m_Session && pkt->size() > 0x400) + { + buff.Compress(m_Session->GetCompressionStream(), pkt); + pkt = &buff; + } + + sLog->outOpCode(uint32(pkt->GetOpcode()), LookupOpcodeName(pkt->GetOpcode()), true); + + sScriptMgr->OnPacketSend(this, *pkt); - ServerPktHeader header(pct.size()+2, pct.GetOpcode()); + ServerPktHeader header(pkt->size()+2, pkt->GetOpcode()); m_Crypt.EncryptSend ((uint8*)header.header, header.getHeaderLength()); - if (m_OutBuffer->space() >= pct.size() + header.getHeaderLength() && msg_queue()->is_empty()) + if (m_OutBuffer->space() >= pkt->size() + header.getHeaderLength() && msg_queue()->is_empty()) { // Put the packet on the buffer. if (m_OutBuffer->copy((char*) header.header, header.getHeaderLength()) == -1) ACE_ASSERT (false); - if (!pct.empty()) - if (m_OutBuffer->copy((char*) pct.contents(), pct.size()) == -1) + if (!pkt->empty()) + if (m_OutBuffer->copy((char*) pkt->contents(), pkt->size()) == -1) ACE_ASSERT (false); } else @@ -186,12 +195,12 @@ int WorldSocket::SendPacket(WorldPacket const& pct) // Enqueue the packet. ACE_Message_Block* mb; - ACE_NEW_RETURN(mb, ACE_Message_Block(pct.size() + header.getHeaderLength()), -1); + ACE_NEW_RETURN(mb, ACE_Message_Block(pkt->size() + header.getHeaderLength()), -1); mb->copy((char*) header.header, header.getHeaderLength()); - if (!pct.empty()) - mb->copy((const char*)pct.contents(), pct.size()); + if (!pkt->empty()) + mb->copy((const char*)pkt->contents(), pkt->size()); if (msg_queue()->enqueue_tail(mb, (ACE_Time_Value*)&ACE_Time_Value::zero) == -1) { diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp index 7d191341c6b..a8657925131 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -1146,7 +1146,7 @@ class boss_the_lich_king : public CreatureScript } // Send packet to all players in The Frozen Throne - void SendPacketToPlayers(WorldPacket* data) const + void SendPacketToPlayers(WorldPacket const* data) const { Map::PlayerList const& players = me->GetMap()->GetPlayers(); if (!players.isEmpty()) -- cgit v1.2.3 From 1a290f17f59943905bec7dd413c4879b4bbf6f8e Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 18 Jul 2012 22:04:06 +0200 Subject: Core/Player: Moved guild id storing back to updatefields --- .../2012_07_18_00_characters_characters_434.sql | 1 + src/server/game/Entities/Player/Player.cpp | 38 ++++++++++------------ src/server/game/Entities/Player/Player.h | 15 ++++----- .../Database/Implementation/CharacterDatabase.cpp | 5 +-- .../Database/Implementation/CharacterDatabase.h | 2 -- 5 files changed, 25 insertions(+), 36 deletions(-) create mode 100644 sql/updates/characters/2012_07_18_00_characters_characters_434.sql (limited to 'src') diff --git a/sql/updates/characters/2012_07_18_00_characters_characters_434.sql b/sql/updates/characters/2012_07_18_00_characters_characters_434.sql new file mode 100644 index 00000000000..159c3d85703 --- /dev/null +++ b/sql/updates/characters/2012_07_18_00_characters_characters_434.sql @@ -0,0 +1 @@ +ALTER TABLE `characters` DROP `guildId`; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index b22cbd5e3e2..2d210c981d3 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -694,7 +694,6 @@ Player::Player(WorldSession* session): Unit(true), m_achievementMgr(this), m_rep duel = NULL; m_GuildIdInvited = 0; - m_guildId = 0; m_ArenaTeamIdInvited = 0; m_atLoginFlags = AT_LOGIN_NONE; @@ -967,6 +966,7 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo) SetByteValue(PLAYER_BYTES_3, 0, createInfo->Gender); SetByteValue(PLAYER_BYTES_3, 3, 0); // BattlefieldArenaFaction (0 or 1) + SetUInt64Value(OBJECT_FIELD_DATA, 0); SetUInt32Value(PLAYER_GUILDRANK, 0); SetUInt32Value(PLAYER_GUILD_TIMESTAMP, 0); @@ -4534,6 +4534,9 @@ void Player::InitVisibleBits() updateVisualBits.SetCount(PLAYER_END); updateVisualBits.SetBit(OBJECT_FIELD_GUID); + updateVisualBits.SetBit(OBJECT_FIELD_GUID + 1); + updateVisualBits.SetBit(OBJECT_FIELD_DATA); + updateVisualBits.SetBit(OBJECT_FIELD_DATA + 1); updateVisualBits.SetBit(OBJECT_FIELD_TYPE); updateVisualBits.SetBit(OBJECT_FIELD_ENTRY); updateVisualBits.SetBit(OBJECT_FIELD_SCALE_X); @@ -5547,13 +5550,13 @@ uint32 Player::DurabilityRepair(uint16 pos, bool cost, float discountMod, bool g if (guildBank) { - if (m_guildId == 0) + if (GetGuildId() == 0) { sLog->outStaticDebug("You are not member of a guild"); return TotalCost; } - Guild* guild = sGuildMgr->GetGuildById(m_guildId); + Guild* guild = sGuildMgr->GetGuildById(GetGuildId()); if (!guild) return TotalCost; @@ -5633,7 +5636,7 @@ bool Player::CanJoinConstantChannelInZone(ChatChannelsEntry const* channel, Area if ((channel->flags & CHANNEL_DBC_FLAG_CITY_ONLY) && (!(zone->flags & AREA_FLAG_SLAVE_CAPITAL))) return false; - if ((channel->flags & CHANNEL_DBC_FLAG_GUILD_REQ) && m_guildId) + if ((channel->flags & CHANNEL_DBC_FLAG_GUILD_REQ) && GetGuildId()) return false; return true; @@ -7544,10 +7547,10 @@ uint32 Player::_GetCurrencyWeekCap(const CurrencyTypesEntry* currency) const uint32 Player::GetGuildIdFromDB(uint64 guid) { - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_GET_GUILD_ID); - stmt->setUInt64(0, guid); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_MEMBER); + stmt->setUInt32(0, GUID_LOPART(guid)); if (PreparedQueryResult result = CharacterDatabase.Query(stmt)) - return (*result)[0].GetUInt32(); + return result->Fetch()[0].GetUInt32(); return 0; } @@ -7556,15 +7559,10 @@ uint8 Player::GetRankFromDB(uint64 guid) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_MEMBER); stmt->setUInt32(0, GUID_LOPART(guid)); - PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (PreparedQueryResult result = CharacterDatabase.Query(stmt)) + return result->Fetch()[1].GetUInt8(); - if (result) - { - uint32 v = result->Fetch()[1].GetUInt8(); - return v; - } - else - return 0; + return 0; } uint32 Player::GetArenaTeamIdFromDB(uint64 guid, uint8 type) @@ -16792,8 +16790,8 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) //"conquestPoints, totalHonorPoints, totalKills, todayKills, yesterdayKills, chosenTitle, watchedFaction, drunk, " // 48 49 50 51 52 53 54 55 56 57 58 //"health, power1, power2, power3, power4, power5, instance_id, speccount, activespec, exploredZones, equipmentCache, " - // 59 60 61 62 - //"knownTitles, actionBars, grantableLevels, guildId FROM characters WHERE guid = '%u'", guid); + // 59 60 61 + //"knownTitles, actionBars, grantableLevels FROM characters WHERE guid = '%u'", guid); PreparedQueryResult result = holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADFROM); if (!result) @@ -17434,8 +17432,6 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) if (m_grantableLevels > 0) SetByteValue(PLAYER_FIELD_BYTES, 1, 0x01); - m_guildId = fields[62].GetUInt32(); - _LoadDeclinedNames(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADDECLINEDNAMES)); m_achievementMgr.CheckAllAchievementCriteria(this); @@ -24354,7 +24350,7 @@ void Player::UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 mis if (sAchievementMgr->IsGroupCriteriaType(type)) return; - if (Guild* guild = sGuildMgr->GetGuildById(m_guildId)) + if (Guild* guild = sGuildMgr->GetGuildById(GetGuildId())) guild->GetAchievementMgr().UpdateAchievementCriteria(type, miscValue1, miscValue2, unit, this); } @@ -25418,7 +25414,7 @@ uint32 Player::GetReputation(uint32 factionentry) std::string Player::GetGuildName() { - return sGuildMgr->GetGuildById(m_guildId)->GetName(); + return sGuildMgr->GetGuildById(GetGuildId())->GetName(); } void Player::SendDuelCountdown(uint32 counter) diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 858bd7c3d05..050e655fdca 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1874,18 +1874,17 @@ class Player : public Unit, public GridObject void SetInGuild(uint32 GuildId) { - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SET_GUILD_ID); - stmt->setUInt32(0, GuildId); - stmt->setUInt64(1, GetGUID()); - CharacterDatabase.Execute(stmt); - m_guildId = GuildId; + if (GuildId) + SetUInt64Value(OBJECT_FIELD_DATA, MAKE_NEW_GUID(GuildId, 0, HIGHGUID_GUILD)); + else + SetUInt64Value(OBJECT_FIELD_DATA, 0); } - uint32 GetGuildId() const { return m_guildId; } - static uint32 GetGuildIdFromDB(uint64 guid); void SetRank(uint8 rankId) { SetUInt32Value(PLAYER_GUILDRANK, rankId); } uint8 GetRank() { return uint8(GetUInt32Value(PLAYER_GUILDRANK)); } void SetGuildIdInvited(uint32 GuildId) { m_GuildIdInvited = GuildId; } + uint32 GetGuildId() const { return GetUInt32Value(OBJECT_FIELD_DATA); /* return only lower part */ } + static uint32 GetGuildIdFromDB(uint64 guid); static uint8 GetRankFromDB(uint64 guid); int GetGuildIdInvited() { return m_GuildIdInvited; } static void RemovePetitionsAndSigns(uint64 guid, uint32 type); @@ -2800,8 +2799,6 @@ class Player : public Unit, public GridObject uint32 m_restTime; - uint32 m_guildId; - uint32 m_WeaponProficiency; uint32 m_ArmorProficiency; bool m_canParry; diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index 880794d14d5..2f5d82b2fc3 100755 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -66,7 +66,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() "position_x, position_y, position_z, map, orientation, taximask, cinematic, totaltime, leveltime, rest_bonus, logout_time, is_logout_resting, resettalents_cost, " "resettalents_time, talentTree, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, online, death_expire_time, taxi_path, instance_mode_mask, " "conquestPoints, totalHonorPoints, totalKills, todayKills, yesterdayKills, chosenTitle, watchedFaction, drunk, " - "health, power1, power2, power3, power4, power5, instance_id, speccount, activespec, exploredZones, equipmentCache, knownTitles, actionBars, grantableLevels, guildId FROM characters WHERE guid = ?", CONNECTION_ASYNC) + "health, power1, power2, power3, power4, power5, instance_id, speccount, activespec, exploredZones, equipmentCache, knownTitles, actionBars, grantableLevels FROM characters WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_GROUP_MEMBER, "SELECT guid FROM group_member WHERE memberGuid = ?", CONNECTION_BOTH) PREPARE_STATEMENT(CHAR_SEL_CHARACTER_INSTANCE, "SELECT id, permanent, map, difficulty, resettime FROM character_instance LEFT JOIN instance ON instance = id WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_CHARACTER_AURAS, "SELECT caster_guid, spell, effect_mask, recalculate_mask, stackcount, amount0, amount1, amount2, " @@ -154,9 +154,6 @@ void CharacterDatabaseConnection::DoPrepareStatements() // 0: uint32, 1: string, 2: uint32, 3: string, 4: string, 5: uint64, 6-10: uint32, 11: uint64 PREPARE_STATEMENT(CHAR_INS_GUILD, "INSERT INTO guild (guildid, name, leaderguid, info, motd, createdate, EmblemStyle, EmblemColor, BorderStyle, BorderColor, BackgroundColor, BankMoney) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_GUILD, "DELETE FROM guild WHERE guildid = ?", CONNECTION_ASYNC) // 0: uint32 - // 0: uint32 - PREPARE_STATEMENT(CHAR_SET_GUILD_ID, "UPDATE characters SET guildId = ? WHERE guid = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_GET_GUILD_ID, "SELECT guildId FROM characters WHERE guid = ?", CONNECTION_SYNCH) // 0: uint32, 1: uint32, 2: uint8, 4: string, 5: string PREPARE_STATEMENT(CHAR_INS_GUILD_MEMBER, "INSERT INTO guild_member (guildid, guid, rank, pnote, offnote) VALUES (?, ?, ?, ?, ?)", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_GUILD_MEMBER, "DELETE FROM guild_member WHERE guid = ?", CONNECTION_ASYNC) // 0: uint32 diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.h b/src/server/shared/Database/Implementation/CharacterDatabase.h index adaa4acf7c5..c0ab078dfe3 100755 --- a/src/server/shared/Database/Implementation/CharacterDatabase.h +++ b/src/server/shared/Database/Implementation/CharacterDatabase.h @@ -161,8 +161,6 @@ enum CharacterDatabaseStatements CHAR_INS_GUILD, CHAR_DEL_GUILD, - CHAR_SET_GUILD_ID, - CHAR_GET_GUILD_ID, CHAR_INS_GUILD_MEMBER, CHAR_DEL_GUILD_MEMBER, CHAR_DEL_GUILD_MEMBERS, -- cgit v1.2.3 From 390d6b56d7abf8d139f90d0b13fba8c5e89e5c4c Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 19 Jul 2012 01:21:41 +0200 Subject: Core/PacketIO: Enabled and updated a bunch of opcodes --- src/server/game/Entities/Player/Player.cpp | 33 +++++++++++++++++--- src/server/game/Guilds/Guild.cpp | 10 +++--- src/server/game/Handlers/MailHandler.cpp | 18 +++++------ src/server/game/Handlers/MiscHandler.cpp | 44 ++++++++++++++------------ src/server/game/Handlers/MovementHandler.cpp | 23 ++++++++++++-- src/server/game/Mails/Mail.h | 2 +- src/server/game/Server/Protocol/Opcodes.cpp | 46 +++++++++++++++------------- src/server/game/Server/Protocol/Opcodes.h | 5 ++- 8 files changed, 114 insertions(+), 67 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 2d210c981d3..3ca3f0fe153 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -18494,6 +18494,7 @@ void Player::SendRaidInfo() } } } + data.put(p_counter, counter); GetSession()->SendPacket(&data); } @@ -25463,16 +25464,40 @@ void Player::SendRefundInfo(Item *item) return; } + ObjectGuid guid = item->GetGUID(); WorldPacket data(SMSG_ITEM_REFUND_INFO_RESPONSE, 8+4+4+4+4*4+4*4+4+4); - data << uint64(item->GetGUID()); // item guid - data << uint32(item->GetPaidMoney()); // money cost + data.WriteBit(guid[3]); + data.WriteBit(guid[5]); + data.WriteBit(guid[7]); + data.WriteBit(guid[6]); + data.WriteBit(guid[2]); + data.WriteBit(guid[4]); + data.WriteBit(guid[0]); + data.WriteBit(guid[1]); + data.FlushBits(); + data.WriteByteSeq(guid[7]); + data << uint32(GetTotalPlayedTime() - item->GetPlayedTime()); for (uint8 i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i) // item cost data { - data << uint32(iece->RequiredItem[i]); data << uint32(iece->RequiredItemCount[i]); + data << uint32(iece->RequiredItem[i]); + } + + data.WriteByteSeq(guid[6]); + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[2]); + for (uint8 i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i) // currency cost data + { + data << uint32(iece->RequiredCurrencyCount[i]); + data << uint32(iece->RequiredCurrency[i]); } + + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[5]); data << uint32(0); - data << uint32(GetTotalPlayedTime() - item->GetPlayedTime()); + data.WriteByteSeq(guid[0]); + data << uint32(item->GetPaidMoney()); // money cost GetSession()->SendPacket(&data); } diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 94a9aff18bc..a33512ddad8 100755 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -1814,24 +1814,26 @@ void Guild::SendPermissions(WorldSession* session) const { uint64 guid = session->GetPlayer()->GetGUID(); uint8 rankId = session->GetPlayer()->GetRank(); - WorldPacket data(MSG_GUILD_PERMISSIONS, 4 * 15 + 1); + WorldPacket data(SMSG_GUILD_PERMISSIONS_QUERY_RESULTS, 4 * 15 + 1); data << uint32(rankId); + data << uint32(_GetPurchasedTabsSize()); data << uint32(_GetRankRights(rankId)); data << uint32(_GetMemberRemainingMoney(guid)); - data << uint8(_GetPurchasedTabsSize()); + data.WriteBits(GUILD_BANK_MAX_TABS, 23); for (uint8 tabId = 0; tabId < GUILD_BANK_MAX_TABS; ++tabId) { data << uint32(_GetRankBankTabRights(rankId, tabId)); data << uint32(_GetMemberRemainingSlots(guid, tabId)); } + session->SendPacket(&data); sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Sent (MSG_GUILD_PERMISSIONS)"); } void Guild::SendMoneyInfo(WorldSession* session) const { - WorldPacket data(MSG_GUILD_BANK_MONEY_WITHDRAWN, 4); - data << uint32(_GetMemberRemainingMoney(session->GetPlayer()->GetGUID())); + WorldPacket data(SMSG_GUILD_BANK_MONEY_WITHDRAWN, 4); + data << uint64(_GetMemberRemainingMoney(session->GetPlayer()->GetGUID())); session->SendPacket(&data); sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Sent MSG_GUILD_BANK_MONEY_WITHDRAWN"); } diff --git a/src/server/game/Handlers/MailHandler.cpp b/src/server/game/Handlers/MailHandler.cpp index dd76c3a4c80..00579c2dc80 100755 --- a/src/server/game/Handlers/MailHandler.cpp +++ b/src/server/game/Handlers/MailHandler.cpp @@ -517,7 +517,7 @@ void WorldSession::HandleMailTakeMoney(WorldPacket& recv_data) uint64 mailbox; uint64 money; uint32 mailId; - + recv_data >> mailbox; recv_data >> mailId; recv_data >> money; @@ -747,7 +747,7 @@ void WorldSession::HandleQueryNextMailTime(WorldPacket & /*recv_data*/) if (_player->unReadMails > 0) { - data << uint32(0); // float + data << float(0); // float data << uint32(0); // count uint32 count = 0; @@ -763,10 +763,7 @@ void WorldSession::HandleQueryNextMailTime(WorldPacket & /*recv_data*/) if (now < m->deliver_time) continue; - if (m->messageType) - data << uint64(m->sender); // player guid - else - data << uint32(m->sender); // creature entry + data << uint64(m->sender); switch (m->messageType) { @@ -781,17 +778,18 @@ void WorldSession::HandleQueryNextMailTime(WorldPacket & /*recv_data*/) data << uint32(m->stationery); break; } - data << uint32(0xC6000000); // float unk, time or something - ++count; - if (count == 2) // do not display more than 2 mails + data << uint32(0xC6000000); // float unk, time or something + + if (++count >= 2) // do not display more than 2 mails break; } + data.put(4, count); } else { - data << uint32(0xC7A8C000); + data << float(-DAY); data << uint32(0x00000000); } SendPacket(&data); diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 266c99749fd..8b1448f8dd6 100755 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -1098,23 +1098,27 @@ void WorldSession::HandleMoveTimeSkippedOpcode(WorldPacket & recv_data) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_MOVE_TIME_SKIPPED"); - recv_data.rfinish(); - return; - + ObjectGuid guid; uint32 time; recv_data >> time; - //ByteBuffer bytes(8, true); - //recv_data.ReadXorByte(mask[0], bytes[1]); - //recv_data.ReadXorByte(mask[1], bytes[4]); - //recv_data.ReadXorByte(mask[7], bytes[2]); - //recv_data.ReadXorByte(mask[5], bytes[5]); - //recv_data.ReadXorByte(mask[3], bytes[0]); - //recv_data.ReadXorByte(mask[6], bytes[7]); - //recv_data.ReadXorByte(mask[2], bytes[6]); - //recv_data.ReadXorByte(mask[4], bytes[3]); - - //uint64 guid = BitConverter::ToUInt64(bytes); + guid[5] = recv_data.ReadBit(); + guid[1] = recv_data.ReadBit(); + guid[3] = recv_data.ReadBit(); + guid[7] = recv_data.ReadBit(); + guid[6] = recv_data.ReadBit(); + guid[0] = recv_data.ReadBit(); + guid[4] = recv_data.ReadBit(); + guid[2] = recv_data.ReadBit(); + + recv_data.ReadByteSeq(guid[7]); + recv_data.ReadByteSeq(guid[1]); + recv_data.ReadByteSeq(guid[2]); + recv_data.ReadByteSeq(guid[4]); + recv_data.ReadByteSeq(guid[3]); + recv_data.ReadByteSeq(guid[6]); + recv_data.ReadByteSeq(guid[0]); + recv_data.ReadByteSeq(guid[5]); //TODO! @@ -1191,20 +1195,20 @@ void WorldSession::HandleMoveRootAck(WorldPacket& recv_data) */ } -void WorldSession::HandleSetActionBarToggles(WorldPacket& recv_data) +void WorldSession::HandleSetActionBarToggles(WorldPacket& recvPacket) { - uint8 ActionBar; + uint8 actionBar; - recv_data >> ActionBar; + recvPacket >> actionBar; if (!GetPlayer()) // ignore until not logged (check needed because STATUS_AUTHED) { - if (ActionBar != 0) - sLog->outError("WorldSession::HandleSetActionBarToggles in not logged state with value: %u, ignored", uint32(ActionBar)); + if (actionBar != 0) + sLog->outError("WorldSession::HandleSetActionBarToggles in not logged state with value: %u, ignored", uint32(actionBar)); return; } - GetPlayer()->SetByteValue(PLAYER_FIELD_BYTES, 2, ActionBar); + GetPlayer()->SetByteValue(PLAYER_FIELD_BYTES, 2, actionBar); } void WorldSession::HandlePlayedTime(WorldPacket& recv_data) diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp index 51cb0385a90..5cdd7ffd99b 100755 --- a/src/server/game/Handlers/MovementHandler.cpp +++ b/src/server/game/Handlers/MovementHandler.cpp @@ -498,12 +498,29 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recv_data) } } -void WorldSession::HandleSetActiveMoverOpcode(WorldPacket &recv_data) +void WorldSession::HandleSetActiveMoverOpcode(WorldPacket& recvPacket) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_SET_ACTIVE_MOVER"); - uint64 guid; - recv_data >> guid; + ObjectGuid guid; + + guid[7] = recvPacket.ReadBit(); + guid[2] = recvPacket.ReadBit(); + guid[1] = recvPacket.ReadBit(); + guid[0] = recvPacket.ReadBit(); + guid[4] = recvPacket.ReadBit(); + guid[5] = recvPacket.ReadBit(); + guid[6] = recvPacket.ReadBit(); + guid[3] = recvPacket.ReadBit(); + + recvPacket.ReadByteSeq(guid[3]); + recvPacket.ReadByteSeq(guid[2]); + recvPacket.ReadByteSeq(guid[4]); + recvPacket.ReadByteSeq(guid[0]); + recvPacket.ReadByteSeq(guid[5]); + recvPacket.ReadByteSeq(guid[1]); + recvPacket.ReadByteSeq(guid[6]); + recvPacket.ReadByteSeq(guid[7]); if (GetPlayer()->IsInWorld()) { diff --git a/src/server/game/Mails/Mail.h b/src/server/game/Mails/Mail.h index dbd03bd96ee..8136398e55b 100755 --- a/src/server/game/Mails/Mail.h +++ b/src/server/game/Mails/Mail.h @@ -175,7 +175,7 @@ struct Mail uint8 messageType; uint8 stationery; uint16 mailTemplateId; - uint32 sender; + uint32 sender; // TODO: change to uint64 and store full guids uint32 receiver; std::string subject; std::string body; diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 3133af8b59e..5961d522633 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -130,7 +130,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_STATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventStatus ); //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_GET_CALENDAR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGetCalendar ); //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_GET_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGetEvent ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_GET_NUM_PENDING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGetNumPending ); + DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_GET_NUM_PENDING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGetNumPending ); //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_GUILD_FILTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGuildFilter ); //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_REMOVE_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarRemoveEvent ); //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_UPDATE_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarUpdateEvent ); @@ -325,6 +325,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANKER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankerActivate ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_BUY_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankBuyTab ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_DEPOSIT_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankDepositMoney ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_MONEY_WITHDRAWN_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankMoneyWithdrawn ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_QUERY_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankQueryTab ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_SWAP_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankSwapItems ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_UPDATE_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankUpdateTab ); @@ -341,7 +342,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_GUILD_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildLeaveOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_MOTD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildMOTDOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_PROMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildPromoteOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_QUERY, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildQueryOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_QUERY, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildQueryOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_RANK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildRankOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_REMOVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildRemoveOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_ROSTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildRosterOpcode ); @@ -357,7 +358,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_INSTANCE_LOCK_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInstanceLockResponse ); //DEFINE_OPCODE_HANDLER(CMSG_ITEM_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemNameQueryOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_ITEM_REFUND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemRefund ); - //DEFINE_OPCODE_HANDLER(CMSG_ITEM_REFUND_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemRefundInfoRequest ); + DEFINE_OPCODE_HANDLER(CMSG_ITEM_REFUND_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemRefundInfoRequest ); //DEFINE_OPCODE_HANDLER(CMSG_ITEM_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemTextQuery ); //DEFINE_OPCODE_HANDLER(CMSG_JOIN_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleJoinChannel ); //DEFINE_OPCODE_HANDLER(CMSG_KEEP_ALIVE, STATUS_NEVER, PROCESS_THREADUNSAFE, &WorldSession::Handle_EarlyProccess ); @@ -455,9 +456,9 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SPLINE_DONE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveSplineDoneOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_START_SWIM_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_STOP_SWIM_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_TIME_SKIPPED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleMoveTimeSkippedOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MOVE_TIME_SKIPPED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleMoveTimeSkippedOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_WATER_WALK_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveWaterWalkAck ); - //DEFINE_OPCODE_HANDLER(CMSG_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNameQueryOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNameQueryOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_NEW_SPELL_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_NEXT_CINEMATIC_CAMERA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNextCinematicCamera ); //DEFINE_OPCODE_HANDLER(CMSG_NO_SPELL_VARIANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -490,7 +491,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_PET_UNLEARN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_PET_UNLEARN_TALENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_PING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); - //DEFINE_OPCODE_HANDLER(CMSG_PLAYED_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayedTime ); + DEFINE_OPCODE_HANDLER(CMSG_PLAYED_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayedTime ); //DEFINE_OPCODE_HANDLER(CMSG_PLAYER_AI_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_PLAYER_LOGIN, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayerLoginOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_PLAYER_LOGOUT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayerLogoutOpcode ); @@ -505,7 +506,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_QUERY_OBJECT_ROTATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_QUERY_QUESTS_COMPLETED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryQuestsCompleted ); //DEFINE_OPCODE_HANDLER(CMSG_QUERY_SERVER_BUCK_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_QUERY_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryTimeOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_QUERY_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryTimeOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_QUERY_VEHICLE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_ACCEPT_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverAcceptQuestOpcode); //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_CANCEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverCancel ); @@ -539,7 +540,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_REQUEST_HOTFIX, STATUS_AUTHED, PROCESS_INPLACE, &WorldSession::HandleRequestHotfix ); //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PARTY_MEMBER_STATS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestPartyMemberStatsOpcode); //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PET_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestPetInfoOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RAID_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestRaidInfoOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RAID_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestRaidInfoOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_EXIT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestVehicleExit ); //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_NEXT_SEAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_PREV_SEAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); @@ -567,9 +568,9 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_SERVER_INFO_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SETDEATHBINDPOINT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SETSHEATHED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleSetSheathedOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIONBAR_TOGGLES, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActionBarToggles ); + DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIONBAR_TOGGLES, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActionBarToggles ); //DEFINE_OPCODE_HANDLER(CMSG_SET_ACTION_BUTTON, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActionButtonOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIVE_MOVER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActiveMoverOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIVE_MOVER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActiveMoverOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIVE_TALENT_GROUP_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIVE_VOICE_CHANNEL, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActiveVoiceChannel ); //DEFINE_OPCODE_HANDLER(CMSG_SET_ALLOW_LOW_LEVEL_RAID1, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -674,13 +675,13 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_USE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUseItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_USE_SKILL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_VIOLENCE_LEVEL, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleViolenceLevel ); - //DEFINE_OPCODE_HANDLER(CMSG_VOICE_SESSION_ENABLE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleVoiceSessionEnableOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_VOICE_SESSION_ENABLE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleVoiceSessionEnableOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_VOICE_SET_TALKER_MUTED_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_WARDEN_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleWardenDataOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_WEATHER_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_WHO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWhoOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_WHOIS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWhoisOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_WORLD_STATE_UI_TIMER_UPDATE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleWorldStateUITimerUpdate ); + DEFINE_OPCODE_HANDLER(CMSG_WORLD_STATE_UI_TIMER_UPDATE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleWorldStateUITimerUpdate ); //DEFINE_OPCODE_HANDLER(CMSG_WORLD_TELEPORT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWorldTeleportOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_WRAP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWrapItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_XP_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -702,9 +703,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(MSG_GM_SHOWLABEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_GM_SUMMON, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_GUILD_BANK_LOG_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankLogQuery ); - //DEFINE_OPCODE_HANDLER(MSG_GUILD_BANK_MONEY_WITHDRAWN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankMoneyWithdrawn ); //DEFINE_OPCODE_HANDLER(MSG_GUILD_EVENT_LOG_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildEventLogQueryOpcode ); - //DEFINE_OPCODE_HANDLER(MSG_GUILD_PERMISSIONS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildPermissions ); + DEFINE_OPCODE_HANDLER(MSG_GUILD_PERMISSIONS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildPermissions ); //DEFINE_OPCODE_HANDLER(MSG_INSPECT_ARENA_TEAMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectArenaTeamsOpcode ); //DEFINE_OPCODE_HANDLER(MSG_INSPECT_HONOR_STATS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectHonorStatsOpcode ); //DEFINE_OPCODE_HANDLER(MSG_LIST_STABLED_PETS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleListStabledPetsOpcode ); @@ -863,7 +863,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_RAID_LOCKOUT_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_SEND_CALENDAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_SEND_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_SEND_NUM_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_SEND_NUM_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CAMERA_SHAKE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CANCEL_AUTO_REPEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CANCEL_COMBAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1008,14 +1008,16 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_GUILD_ACHIEVEMENT_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_ACHIEVEMENT_EARNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_MONEY_WITHDRAWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_CRITERIA_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_CRITERIA_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_DECLINE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_PERMISSIONS_QUERY_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_ROSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_HEALTH_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_HIGHEST_THREAT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1042,7 +1044,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_ITEM_ENCHANT_TIME_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ITEM_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ITEM_PUSH_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ITEM_REFUND_INFO_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ITEM_REFUND_INFO_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ITEM_REFUND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ITEM_TEXT_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ITEM_TIME_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1128,7 +1130,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_KNOCK_BACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_MULTIPLE_PACKETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_NEW_TAXI_PATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_NEW_WORLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1169,7 +1171,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_PET_TAME_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_UNLEARN_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_UPDATE_COMBO_POINTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PLAYED_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PLAYED_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PLAYERBINDERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PLAYERBOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAYER_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1215,7 +1217,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_QUEST_POI_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_QUEST_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_RAID_GROUP_ONLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RAID_INSTANCE_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_RAID_INSTANCE_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_RAID_INSTANCE_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_RAID_READY_CHECK_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_RANDOMIZE_CHAR_NAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::Handle_ServerSide ); @@ -1382,7 +1384,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_WEATHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_WHO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_WHOIS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_WORLD_STATE_UI_TIMER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_WORLD_STATE_UI_TIMER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ZONE_MAP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ZONE_UNDER_ATTACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 6c63a781eb5..55a1a4871e8 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -211,7 +211,7 @@ enum Opcodes CMSG_GUILD_BANK_DEPOSIT_MONEY = 0x0000, CMSG_GUILD_BANK_NOTE = 0x0000, CMSG_GUILD_BANK_QUERY_TAB = 0x2E35, - CMSG_GUILD_BANK_REM_MONEY_WITHDRAW_QUERY = 0x5DB4, + CMSG_GUILD_BANK_MONEY_WITHDRAWN_QUERY = 0x1225, CMSG_GUILD_BANK_SWAP_ITEMS = 0x2315, CMSG_GUILD_BANK_UPDATE_TAB = 0x0106, CMSG_GUILD_BANK_WITHDRAW_MONEY = 0x0037, @@ -491,8 +491,6 @@ enum Opcodes MSG_GM_SHOWLABEL = 0x0000, MSG_GM_SUMMON = 0x0000, MSG_GUILD_BANK_LOG_QUERY = 0x0000, - MSG_GUILD_BANK_MONEY_WITHDRAWN = 0x0000, - MSG_GUILD_BANK_REM_MONEY_WITHDRAW_QUERY = 0x1225, MSG_GUILD_EVENT_LOG_QUERY = 0x0000, MSG_GUILD_PERMISSIONS = 0x3022, MSG_INSPECT_ARENA_TEAMS = 0x2704, @@ -782,6 +780,7 @@ enum Opcodes SMSG_GUILD_ACHIEVEMENT_DELETED = 0x35A0, SMSG_GUILD_ACHIEVEMENT_EARNED = 0x50B5, SMSG_GUILD_BANK_LIST = 0x78A5, + SMSG_GUILD_BANK_MONEY_WITHDRAWN = 0x5DB4, SMSG_GUILD_CANCEL = 0x0000, SMSG_GUILD_CHALLENGE_UPDATED = 0x18B1, SMSG_GUILD_COMMAND_RESULT = 0x7DB3, -- cgit v1.2.3 From fc1b3968a97dc98c4b2148b7715151946713e795 Mon Sep 17 00:00:00 2001 From: kaelima Date: Thu, 19 Jul 2012 14:40:38 +0200 Subject: Core/PacketIO: Enabled a couple of opcodes and renamed guildfinder ones --- src/server/game/Entities/Unit/Unit.cpp | 24 ++++++++++++++++++++++-- src/server/game/Server/Protocol/Opcodes.cpp | 22 +++++++++++----------- src/server/game/Server/Protocol/Opcodes.h | 12 +++++++----- 3 files changed, 40 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index d2a2034d25f..a90e470eb74 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -16808,9 +16808,29 @@ void Unit::SetAuraStack(uint32 spellId, Unit* target, uint32 stack) void Unit::SendPlaySpellVisual(uint32 id) { - WorldPacket data(SMSG_PLAY_SPELL_VISUAL, 8 + 4); - data << uint64(GetGUID()); + ObjectGuid guid = GetGUID(); + + WorldPacket data(SMSG_PLAY_SPELL_VISUAL, 4 * 3 + 8); + data << uint32(0); data << uint32(id); // SpellVisualKit.dbc index + data << uint32(0); + data.WriteBit(guid[4]); + data.WriteBit(guid[7]); + data.WriteBit(guid[5]); + data.WriteBit(guid[3]); + data.WriteBit(guid[1]); + data.WriteBit(guid[2]); + data.WriteBit(guid[0]); + data.WriteBit(guid[6]); + data.FlushBits(); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[6]); + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[5]); SendMessageToSet(&data, false); } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 5961d522633..c56480ec6c1 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -1170,24 +1170,24 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_PET_SPELLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_TAME_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_UNLEARN_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_UPDATE_COMBO_POINTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PET_UPDATE_COMBO_POINTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAYED_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PLAYERBINDERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PLAYERBOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PLAYERBOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAYER_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PLAYER_SKINNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PLAYER_VEHICLE_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PLAY_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PLAYER_SKINNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PLAYER_VEHICLE_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PLAY_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PLAY_MUSIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PLAY_OBJECT_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PLAY_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PLAY_OBJECT_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PLAY_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PLAY_SPELL_IMPACT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PLAY_SPELL_VISUAL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PLAY_SPELL_VISUAL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PLAY_TIME_WARNING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PONG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_POWER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PRE_RESURRECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PROCRESIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PRE_RESURRECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PROCRESIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PROFILEDATA_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PROPOSE_LEVEL_GRANT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PVP_CREDIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1264,7 +1264,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_SET_PHASE_SHIFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SET_PROFICIENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SET_PROJECTILE_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SET_PROJECTILE_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SHOWTAXINODES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SHOW_BANK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SHOW_MAILBOX, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 55a1a4871e8..7f6b9f6ca5d 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -203,7 +203,6 @@ enum Opcodes CMSG_GROUP_SWAP_SUB_GROUP = 0x0034, CMSG_GROUP_UNINVITE = 0x0000, CMSG_GROUP_UNINVITE_GUID = 0x0000, - CMSG_GUILDFINDER_JOIN = 0x0000, CMSG_GUILD_ACCEPT = 0x2531, CMSG_GUILD_ACHIEVEMENT_PROGRESS_QUERY = 0x3235, CMSG_GUILD_BANKER_ACTIVATE = 0x2E37, @@ -256,6 +255,7 @@ enum Opcodes CMSG_LFG_PROPOSAL_RESULT = 0x0000, CMSG_LFG_SET_ROLES = 0x25B1, CMSG_LFG_TELEPORT = 0x2482, + CMSG_LF_GUILD_JOIN, = 0x68C5, CMSG_LIST_INVENTORY = 0x2806, CMSG_LOAD_SCREEN = 0x2422, CMSG_LOGOUT_CANCEL = 0x2324, @@ -773,9 +773,6 @@ enum Opcodes SMSG_GROUP_SET_LEADER = 0x0526, SMSG_GROUP_SET_ROLE = 0x39A6, SMSG_GROUP_UNINVITE = 0x0000, - SMSG_GUILDFINDER_POST_UPDATED = 0x35B7, - SMSG_GUILDFINDER_RECRUITS_UPDATED = 0x1CB2, - SMSG_GUILDFINDER_SEARCH_RESULT = 0x0000, SMSG_GUILD_ACHIEVEMENT_DATA = 0x54B7, SMSG_GUILD_ACHIEVEMENT_DELETED = 0x35A0, SMSG_GUILD_ACHIEVEMENT_EARNED = 0x50B5, @@ -857,6 +854,11 @@ enum Opcodes SMSG_LFG_UPDATE_PARTY = 0x0000, SMSG_LFG_UPDATE_PLAYER = 0x0000, SMSG_LFG_UPDATE_SEARCH = 0x0000, + SMSG_LF_GUILD_BROWSE_UPDATED = 0x1DA3, + SMSG_LF_GUILD_MEMBERSHIP_LIST_UPDATED = 0x1CA5, + SMSG_LF_GUILD_POST_UPDATED = 0x35B7, + SMSG_LF_GUILD_RECRUIT_LIST_UPDATED = 0x1CB2, + SMSG_LF_GUILD_SEARCH_RESULT = 0x0000, SMSG_LIST_INVENTORY = 0x7CB0, SMSG_LOAD_CUF_PROFILES = 0x50B1, SMSG_LOGIN_SETTIMESPEED = 0x4D15, @@ -1047,7 +1049,7 @@ enum Opcodes SMSG_SET_PLAYER_DECLINED_NAMES_RESULT = 0x2B25, SMSG_SET_PLAY_HOVER_ANIM = 0x30A6, SMSG_SET_PROFICIENCY = 0x6207, - SMSG_SET_PROJECTILE_POSITION = 0x0000, + SMSG_SET_PROJECTILE_POSITION = 0x2616, SMSG_SHOWTAXINODES = 0x2A36, SMSG_SHOW_BANK = 0x2627, SMSG_SPELLBREAKLOG = 0x6B17, -- cgit v1.2.3 From 5cbafaabf4eac22e0a03ff3e03b3fbdb9216cfcf Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 19 Jul 2012 15:39:32 +0200 Subject: Core/PacketIO: Enabled channel join and notification opcodes --- src/server/game/Chat/Channels/Channel.h | 4 ++-- src/server/game/Server/Protocol/Opcodes.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/game/Chat/Channels/Channel.h b/src/server/game/Chat/Channels/Channel.h index 9564dbb381e..503bbc57c69 100755 --- a/src/server/game/Chat/Channels/Channel.h +++ b/src/server/game/Chat/Channels/Channel.h @@ -48,8 +48,8 @@ enum ChatNotify CHAT_MODE_CHANGE_NOTICE = 0x0C, //? CHAT_ANNOUNCEMENTS_ON_NOTICE = 0x0D, //+ "[%s] Channel announcements enabled by %s."; CHAT_ANNOUNCEMENTS_OFF_NOTICE = 0x0E, //+ "[%s] Channel announcements disabled by %s."; - // CHAT_MODERATION_ON_NOTICE = 0x0F, //+ "[%s] Channel moderation enabled by %s."; - // CHAT_MODERATION_OFF_NOTICE = 0x10, //+ "[%s] Channel moderation disabled by %s."; + CHAT_MODERATION_ON_NOTICE = 0x0F, //+ "[%s] Channel moderation enabled by %s."; + CHAT_MODERATION_OFF_NOTICE = 0x10, //+ "[%s] Channel moderation disabled by %s."; CHAT_MUTED_NOTICE = 0x11, //+ "[%s] You do not have permission to speak."; CHAT_PLAYER_KICKED_NOTICE = 0x12, //? "[%s] Player %s kicked by %s."; CHAT_BANNED_NOTICE = 0x13, //+ "[%s] You are banned from that channel."; diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index c56480ec6c1..f7637fffa07 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -360,7 +360,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_ITEM_REFUND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemRefund ); DEFINE_OPCODE_HANDLER(CMSG_ITEM_REFUND_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemRefundInfoRequest ); //DEFINE_OPCODE_HANDLER(CMSG_ITEM_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemTextQuery ); - //DEFINE_OPCODE_HANDLER(CMSG_JOIN_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleJoinChannel ); + DEFINE_OPCODE_HANDLER(CMSG_JOIN_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleJoinChannel ); //DEFINE_OPCODE_HANDLER(CMSG_KEEP_ALIVE, STATUS_NEVER, PROCESS_THREADUNSAFE, &WorldSession::Handle_EarlyProccess ); //DEFINE_OPCODE_HANDLER(CMSG_LEARN_DANCE_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_LEARN_PREVIEW_TALENTS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnPreviewTalents ); @@ -871,7 +871,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_CHANGEPLAYER_DIFFICULTY_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHANNEL_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHANNEL_MEMBER_COUNT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHANNEL_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CHANNEL_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHARACTER_LOGIN_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHARACTER_PROFILE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHARACTER_PROFILE_REALM_CONNECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From 1558b602f49f266532bb982a10084f44c286a865 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 19 Jul 2012 16:04:42 +0200 Subject: Core/Items: Renamed new currency related fields in item_template --- .../2012_07_19_00_world_item_template_434.sql | 3 ++ src/server/game/DataStores/DB2Structure.h | 4 +-- src/server/game/DataStores/DBCStructure.h | 2 +- src/server/game/DataStores/DBCfmt.h | 2 +- src/server/game/Entities/Item/ItemPrototype.h | 4 +-- src/server/game/Entities/Player/Player.cpp | 2 +- src/server/game/Globals/ObjectMgr.cpp | 32 ++++++++++++---------- src/server/game/Handlers/ItemHandler.cpp | 4 +-- src/server/game/Server/Protocol/Opcodes.h | 2 +- 9 files changed, 30 insertions(+), 25 deletions(-) create mode 100644 sql/updates/world/2012_07_19_00_world_item_template_434.sql (limited to 'src') diff --git a/sql/updates/world/2012_07_19_00_world_item_template_434.sql b/sql/updates/world/2012_07_19_00_world_item_template_434.sql new file mode 100644 index 00000000000..fc0540da182 --- /dev/null +++ b/sql/updates/world/2012_07_19_00_world_item_template_434.sql @@ -0,0 +1,3 @@ +ALTER TABLE `item_template` + CHANGE `Field130` `CurrencySubstitutionId` int(10) unsigned NOT NULL DEFAULT '0', + CHANGE `Field131` `CurrencySubstitutionCount` int(10) unsigned NOT NULL DEFAULT '0'; diff --git a/src/server/game/DataStores/DB2Structure.h b/src/server/game/DataStores/DB2Structure.h index 7f6eee0206c..a7b4fe4c07f 100644 --- a/src/server/game/DataStores/DB2Structure.h +++ b/src/server/game/DataStores/DB2Structure.h @@ -125,8 +125,8 @@ struct ItemSparseEntry uint32 ItemLimitCategory; // 126 uint32 HolidayId; // 127 float StatScalingFactor; // 128 - int32 Field130; // 129 - int32 Field131; // 130 + int32 CurrencySubstitutionId; // 129 + int32 CurrencySubstitutionCount; // 130 }; #define MAX_ITEM_EXT_COST_ITEMS 5 diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 1bf09ea4036..cde1aa51e0d 100755 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -852,7 +852,7 @@ struct CurrencyTypesEntry //char* iconName; // 3 //uint32 unk4; // 4 all 0 //uint32 unk5; // 5 archaeology-related (?) - //uint32 unk6; // 6 archaeology-related (?) + uint32 SubstitutionId; // 6 uint32 TotalCap; // 7 uint32 WeekCap; // 8 uint32 Flags; // 9 diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index 5ed2568e0d0..780a33685d6 100755 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -46,7 +46,7 @@ const char CreatureModelDatafmt[]="nxxxxxxxxxxxxxffxxxxxxxxxxxxxxx"; const char CreatureFamilyfmt[]="nfifiiiiixsx"; const char CreatureSpellDatafmt[]="niiiixxxx"; const char CreatureTypefmt[]="nxx"; -const char CurrencyTypesfmt[]="nxxxxxxiiix"; +const char CurrencyTypesfmt[]="nxxxxxiiiix"; const char DestructibleModelDatafmt[]="ixxixxxixxxixxxixxxxxxxx"; const char DungeonEncounterfmt[]="iiixisxx"; diff --git a/src/server/game/Entities/Item/ItemPrototype.h b/src/server/game/Entities/Item/ItemPrototype.h index 49695659868..9e14dcb7733 100755 --- a/src/server/game/Entities/Item/ItemPrototype.h +++ b/src/server/game/Entities/Item/ItemPrototype.h @@ -652,8 +652,8 @@ struct ItemTemplate uint32 ItemLimitCategory; // id from ItemLimitCategory.dbc uint32 HolidayId; // id from Holidays.dbc float StatScalingFactor; - int32 Field130; - int32 Field131; + uint32 CurrencySubstitutionId; // May be used instead of a currency + uint32 CurrencySubstitutionCount; // extra fields, not part of db2 files float DamageMin; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 3ca3f0fe153..79318ba6e4d 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -25477,7 +25477,7 @@ void Player::SendRefundInfo(Item *item) data.FlushBits(); data.WriteByteSeq(guid[7]); data << uint32(GetTotalPlayedTime() - item->GetPlayedTime()); - for (uint8 i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i) // item cost data + for (uint8 i = 0; i < MAX_ITEM_EXT_COST_ITEMS; ++i) // item cost data { data << uint32(iece->RequiredItemCount[i]); data << uint32(iece->RequiredItem[i]); diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 44be40401fd..e2ca53487e7 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -2355,8 +2355,8 @@ void ObjectMgr::LoadItemTemplates() itemTemplate.ItemLimitCategory = sparse->ItemLimitCategory; itemTemplate.HolidayId = sparse->HolidayId; itemTemplate.StatScalingFactor = sparse->StatScalingFactor; - itemTemplate.Field130 = sparse->Field130; - itemTemplate.Field131 = sparse->Field131; + itemTemplate.CurrencySubstitutionId = sparse->CurrencySubstitutionId; + itemTemplate.CurrencySubstitutionCount = sparse->CurrencySubstitutionCount; itemTemplate.ScriptId = 0; itemTemplate.FoodType = 0; itemTemplate.MinMoneyLoot = 0; @@ -2399,8 +2399,10 @@ void ObjectMgr::LoadItemTemplates() "Sheath, RandomProperty, RandomSuffix, ItemSet, Area, Map, BagFamily, TotemCategory, " // 119 120 121 122 123 124 125 "SocketColor_1, SocketContent_1, SocketColor_2, SocketContent_2, SocketColor_3, SocketContent_3, SocketBonus, " - // 126 127 128 129 130 131 132 133 - "GemProperties, ArmorDamageModifier, Duration, ItemLimitCategory, HolidayId, StatScalingFactor, Field130, Field131 " + // 126 127 128 129 130 131 + "GemProperties, ArmorDamageModifier, Duration, ItemLimitCategory, HolidayId, StatScalingFactor, " + // 132 133 + "CurrencySubstitutionId, CurrencySubstitutionCount " "FROM item_template"); if (result) @@ -2506,17 +2508,17 @@ void ObjectMgr::LoadItemTemplates() itemTemplate.GemProperties = fields[126].GetUInt32(); FillDisenchantFields(&itemTemplate.DisenchantID, &itemTemplate.RequiredDisenchantSkill, itemTemplate); - itemTemplate.ArmorDamageModifier = fields[127].GetFloat(); - itemTemplate.Duration = fields[128].GetUInt32(); - itemTemplate.ItemLimitCategory = uint32(fields[129].GetInt16()); - itemTemplate.HolidayId = fields[130].GetUInt32(); - itemTemplate.StatScalingFactor = fields[131].GetFloat(); - itemTemplate.Field130 = fields[132].GetInt32(); - itemTemplate.Field131 = fields[133].GetInt32(); - itemTemplate.ScriptId = 0; - itemTemplate.FoodType = 0; - itemTemplate.MinMoneyLoot = 0; - itemTemplate.MaxMoneyLoot = 0; + itemTemplate.ArmorDamageModifier = fields[127].GetFloat(); + itemTemplate.Duration = fields[128].GetUInt32(); + itemTemplate.ItemLimitCategory = uint32(fields[129].GetInt16()); + itemTemplate.HolidayId = fields[130].GetUInt32(); + itemTemplate.StatScalingFactor = fields[131].GetFloat(); + itemTemplate.CurrencySubstitutionId = fields[132].GetInt32(); + itemTemplate.CurrencySubstitutionCount = fields[133].GetInt32(); + itemTemplate.ScriptId = 0; + itemTemplate.FoodType = 0; + itemTemplate.MinMoneyLoot = 0; + itemTemplate.MaxMoneyLoot = 0; ++dbCount; } while (result->NextRow()); } diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 8128cf72e4a..edd0d396e2f 100755 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -433,8 +433,8 @@ void WorldSession::SendItemSparseDb2Reply(uint32 entry) buff << uint32(proto->ItemLimitCategory); buff << uint32(proto->HolidayId); buff << float(proto->StatScalingFactor); // StatScalingFactor - buff << uint32(proto->Field130); // archaeology unk - buff << uint32(proto->Field131); // archaeology findinds count + buff << uint32(proto->CurrencySubstitutionId); + buff << uint32(proto->CurrencySubstitutionCount); data << uint32(buff.size()); data.append(buff); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 7f6b9f6ca5d..de8830ac6e7 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -255,7 +255,7 @@ enum Opcodes CMSG_LFG_PROPOSAL_RESULT = 0x0000, CMSG_LFG_SET_ROLES = 0x25B1, CMSG_LFG_TELEPORT = 0x2482, - CMSG_LF_GUILD_JOIN, = 0x68C5, + CMSG_LF_GUILD_JOIN = 0x68C5, CMSG_LIST_INVENTORY = 0x2806, CMSG_LOAD_SCREEN = 0x2422, CMSG_LOGOUT_CANCEL = 0x2324, -- cgit v1.2.3 From e732b964197e18d73ac9b823f4afc0ab534a6d48 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 19 Jul 2012 16:07:37 +0200 Subject: Core/Guilds: Added level to guild class and moved sending motd after player is added to world --- src/server/game/Guilds/Guild.cpp | 2 +- src/server/game/Guilds/Guild.h | 4 ++++ src/server/game/Handlers/CharacterHandler.cpp | 26 ++++++++++++++------------ 3 files changed, 19 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index a33512ddad8..8cb0a397b8d 100755 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -1070,7 +1070,7 @@ InventoryResult Guild::BankMoveItemData::CanStore(Item* pItem, bool swap) /////////////////////////////////////////////////////////////////////////////// // Guild -Guild::Guild() : m_id(0), m_leaderGuid(0), m_createdDate(0), m_accountsNumber(0), m_bankMoney(0), m_eventLog(NULL), m_achievementMgr(this) +Guild::Guild() : m_id(0), m_leaderGuid(0), m_createdDate(0), m_accountsNumber(0), m_bankMoney(0), m_eventLog(NULL), m_achievementMgr(this), m_level(1) { memset(&m_bankEventLog, 0, (GUILD_BANK_MAX_TABS + 1) * sizeof(LogHolder*)); } diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h index 59552da2c41..6e71641a652 100755 --- a/src/server/game/Guilds/Guild.h +++ b/src/server/game/Guilds/Guild.h @@ -682,6 +682,8 @@ public: AchievementMgr& GetAchievementMgr() { return m_achievementMgr; } AchievementMgr const& GetAchievementMgr() const { return m_achievementMgr; } + uint32 GetLevel() const { return m_level; } + protected: uint32 m_id; std::string m_name; @@ -704,6 +706,8 @@ protected: AchievementMgr m_achievementMgr; + uint32 m_level; + private: inline uint8 _GetRanksSize() const { return uint8(m_ranks.size()); } inline const RankInfo* GetRankInfo(uint8 rankId) const { return rankId < _GetRanksSize() ? &m_ranks[rankId] : NULL; } diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 37b3c3c2f0e..9a77c3da55c 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -919,6 +919,8 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder) Field* fields = resultGuild->Fetch(); pCurrChar->SetInGuild(fields[0].GetUInt32()); pCurrChar->SetRank(fields[1].GetUInt8()); + if (Guild* guild = sGuildMgr->GetGuildById(pCurrChar->GetGuildId())) + pCurrChar->SetUInt32Value(PLAYER_GUILDLEVEL, guild->GetLevel()); } else if (pCurrChar->GetGuildId()) // clear guild related fields in case wrong data about non existed membership { @@ -926,18 +928,6 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder) pCurrChar->SetRank(0); } - if (pCurrChar->GetGuildId() != 0) - { - if (Guild* guild = sGuildMgr->GetGuildById(pCurrChar->GetGuildId())) - guild->SendLoginInfo(this); - else - { - // remove wrong guild data - sLog->outError("Player %s (GUID: %u) marked as member of not existing guild (id: %u), removing guild membership for player.", pCurrChar->GetName(), pCurrChar->GetGUIDLow(), pCurrChar->GetGuildId()); - pCurrChar->SetInGuild(0); - } - } - data.Initialize(SMSG_LEARNED_DANCE_MOVES, 4+4); data << uint64(0); SendPacket(&data); @@ -997,6 +987,18 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder) sObjectAccessor->AddObject(pCurrChar); //sLog->outDebug("Player %s added to Map.", pCurrChar->GetName()); + if (pCurrChar->GetGuildId() != 0) + { + if (Guild* guild = sGuildMgr->GetGuildById(pCurrChar->GetGuildId())) + guild->SendLoginInfo(this); + else + { + // remove wrong guild data + sLog->outError("Player %s (GUID: %u) marked as member of not existing guild (id: %u), removing guild membership for player.", pCurrChar->GetName(), pCurrChar->GetGUIDLow(), pCurrChar->GetGuildId()); + pCurrChar->SetInGuild(0); + } + } + pCurrChar->SendInitialPacketsAfterAddToMap(); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_ONLINE); -- cgit v1.2.3 From 890a92b330b46e4834a3bb586739ac4f232d5b89 Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 20 Jul 2012 15:21:16 +0200 Subject: Core/PacketIO: Enable questgiver status opcodes and CMSG_OBJECT_UPDATE_FAILED --- src/server/game/Entities/Unit/Unit.cpp | 2 +- src/server/game/Handlers/MiscHandler.cpp | 36 +++++++++++++++++++++-------- src/server/game/Server/Protocol/Opcodes.cpp | 9 ++++---- src/server/game/Server/WorldSession.h | 1 + 4 files changed, 34 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 4172090a261..7310ae58587 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -16279,7 +16279,7 @@ void Unit::SetRooted(bool apply) WorldPacket data(SMSG_SPLINE_MOVE_ROOT, 8); data.append(GetPackGUID()); SendMessageToSet(&data, true); - ToCreature()->StopMoving(); + StopMoving(); } } else diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 8b1448f8dd6..cfb865f8d09 100755 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -406,11 +406,7 @@ void WorldSession::HandleLogoutRequestOpcode(WorldPacket & /*recv_data*/) if (GetPlayer()->CanFreeMove()) { GetPlayer()->SetStandState(UNIT_STAND_STATE_SIT); - - WorldPacket data(SMSG_MOVE_ROOT, (8+4)); // guess size - data.append(GetPlayer()->GetPackGUID()); - data << (uint32)2; - SendPacket(&data); + GetPlayer()->SetRooted(true); GetPlayer()->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); } @@ -443,10 +439,7 @@ void WorldSession::HandleLogoutCancelOpcode(WorldPacket & /*recv_data*/) if (GetPlayer()->CanFreeMove()) { //!we can move again - data.Initialize(SMSG_MOVE_UNROOT, 8); // guess size - data.append(GetPlayer()->GetPackGUID()); - data << uint32(0); - SendPacket(&data); + GetPlayer()->SetRooted(false); //! Stand Up GetPlayer()->SetStandState(UNIT_STAND_STATE_STAND); @@ -1865,3 +1858,28 @@ void WorldSession::HandleUpdateMissileTrajectory(WorldPacket& recvPacket) // do something? } + + void WorldSession::HandleObjectUpdateFailedOpcode(WorldPacket& recvPacket) + { + ObjectGuid guid; + guid[6] = recvPacket.ReadBit(); + guid[7] = recvPacket.ReadBit(); + guid[4] = recvPacket.ReadBit(); + guid[0] = recvPacket.ReadBit(); + guid[1] = recvPacket.ReadBit(); + guid[5] = recvPacket.ReadBit(); + guid[3] = recvPacket.ReadBit(); + guid[2] = recvPacket.ReadBit(); + + recvPacket.ReadByteSeq(guid[6]); + recvPacket.ReadByteSeq(guid[7]); + recvPacket.ReadByteSeq(guid[2]); + recvPacket.ReadByteSeq(guid[3]); + recvPacket.ReadByteSeq(guid[1]); + recvPacket.ReadByteSeq(guid[4]); + recvPacket.ReadByteSeq(guid[0]); + recvPacket.ReadByteSeq(guid[5]); + + WorldObject* obj = ObjectAccessor::GetWorldObject(*GetPlayer(), guid); + sLog->outError("Object update failed for object "UI64FMTD" (%s) for player %s (%u)", uint64(guid), obj ? obj->GetName() : "object-not-found", GetPlayerName(), GetGuidLow()); + } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index f7637fffa07..66961504dcb 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -463,6 +463,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_NEXT_CINEMATIC_CAMERA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNextCinematicCamera ); //DEFINE_OPCODE_HANDLER(CMSG_NO_SPELL_VARIANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_NPC_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNpcTextQueryOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_OBJECT_UPDATE_FAILED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleObjectUpdateFailedOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_OFFER_PETITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleOfferPetitionOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_OPENING_CINEMATIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_OPEN_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleOpenItemOpcode ); @@ -516,8 +517,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_QUERY_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverQueryQuestOpcode); //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_QUEST_AUTOLAUNCH, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverQuestAutoLaunch ); //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_REQUEST_REWARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverRequestRewardOpcode); - //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverStatusMultipleQuery); - //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_STATUS_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleQuestgiverStatusQueryOpcode); + DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverStatusMultipleQuery); + DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_STATUS_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleQuestgiverStatusQueryOpcode); //DEFINE_OPCODE_HANDLER(CMSG_QUESTLOG_REMOVE_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestLogRemoveQuest ); //DEFINE_OPCODE_HANDLER(CMSG_QUESTLOG_SWAP_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestLogSwapQuest ); //DEFINE_OPCODE_HANDLER(CMSG_QUEST_CONFIRM_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestConfirmAccept ); @@ -1203,8 +1204,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_INVALID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_REQUEST_ITEMS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_STATUS_MULTIPLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_STATUS_MULTIPLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_QUESTLOG_FULL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_ADD_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_ADD_KILL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 65e8d018f96..80c532e7430 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -930,6 +930,7 @@ class WorldSession void HandleUpdateProjectilePosition(WorldPacket& recvPacket); void HandleRequestHotfix(WorldPacket& recvPacket); void HandleViolenceLevel(WorldPacket& recvPacket); + void HandleObjectUpdateFailedOpcode(WorldPacket& recvPacket); int32 HandleEnableNagleAlgorithm(); private: -- cgit v1.2.3 From 48f38f6da17cd10010539c3124994310af5a1c62 Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 20 Jul 2012 19:17:52 +0200 Subject: Core/PacketIO: Corrected copypaste mistake in spline create object facing guid, thx Zakamurite --- src/server/game/Movement/Spline/MovementPacketBuilder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Movement/Spline/MovementPacketBuilder.cpp b/src/server/game/Movement/Spline/MovementPacketBuilder.cpp index f35d9e1b64f..69f087a6b2a 100644 --- a/src/server/game/Movement/Spline/MovementPacketBuilder.cpp +++ b/src/server/game/Movement/Spline/MovementPacketBuilder.cpp @@ -194,7 +194,7 @@ namespace Movement data.WriteByteSeq(facingGuid[7]); data.WriteByteSeq(facingGuid[1]); data.WriteByteSeq(facingGuid[6]); - data.WriteByteSeq(facingGuid[5]); + data.WriteByteSeq(facingGuid[4]); data.WriteByteSeq(facingGuid[2]); data.WriteByteSeq(facingGuid[0]); } -- cgit v1.2.3 From 04671d2d99b79bb3a5fb0058de149bf98f714463 Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 23 Jul 2012 13:30:53 +0200 Subject: Core/PacketIO: Enabled and updated client chat packets --- src/server/game/Handlers/ChatHandler.cpp | 130 +++++++++++----------------- src/server/game/Server/Protocol/Opcodes.cpp | 32 ++++--- src/server/game/Server/Protocol/Opcodes.h | 6 +- 3 files changed, 68 insertions(+), 100 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cpp index cfc7376a683..41e9664b69f 100755 --- a/src/server/game/Handlers/ChatHandler.cpp +++ b/src/server/game/Handlers/ChatHandler.cpp @@ -85,39 +85,30 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) case CMSG_MESSAGECHAT_GUILD: type = CHAT_MSG_GUILD; break; - //case CMSG_MESSAGECHAT_OFFICER: - // type = CHAT_MSG_OFFICER; - // break; + case CMSG_MESSAGECHAT_OFFICER: + type = CHAT_MSG_OFFICER; + break; case CMSG_MESSAGECHAT_AFK: type = CHAT_MSG_AFK; break; - //case CMSG_MESSAGECHAT_DND: - // type = CHAT_MSG_DND; - // break; - //case CMSG_MESSAGECHAT_EMOTE: - // type = CHAT_MSG_EMOTE; - // break; - //case CMSG_MESSAGECHAT_PARTY: - // type = CHAT_MSG_PARTY; - // break; - //case CMSG_MESSAGECHAT_PARTY_LEADER: - // type = CHAT_MSG_PARTY_LEADER; - // break; - //case CMSG_MESSAGECHAT_RAID: - // type = CHAT_MSG_RAID; - // break; - //case CMSG_MESSAGECHAT_RAID_LEADER: - // type = CHAT_MSG_RAID_LEADER; - // break; - //case CMSG_MESSAGECHAT_BATTLEGROUND: - // type = CHAT_MSG_BATTLEGROUND; - // break; - //case CMSG_MESSAGECHAT_BATTLEGROUND_LEADER: - // type = CHAT_MSG_BATTLEGROUND_LEADER; - // break; - //case CMSG_MESSAGECHAT_RAID_WARNING: - // type = CHAT_MSG_RAID_WARNING; - // break; + case CMSG_MESSAGECHAT_DND: + type = CHAT_MSG_DND; + break; + case CMSG_MESSAGECHAT_EMOTE: + type = CHAT_MSG_EMOTE; + break; + case CMSG_MESSAGECHAT_PARTY: + type = CHAT_MSG_PARTY; + break; + case CMSG_MESSAGECHAT_RAID: + type = CHAT_MSG_RAID; + break; + case CMSG_MESSAGECHAT_BATTLEGROUND: + type = CHAT_MSG_BATTLEGROUND; + break; + case CMSG_MESSAGECHAT_RAID_WARNING: + type = CHAT_MSG_RAID_WARNING; + break; default: sLog->outDetail("HandleMessagechatOpcode : Unknown chat opcode (%u)", recvData.GetOpcode()); recvData.hexlike(); @@ -136,7 +127,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) //sLog->outDebug("CHAT: packet received. type %u, lang %u", type, lang); // no language sent with emote packet. - if (type != CHAT_MSG_EMOTE) + if (type != CHAT_MSG_EMOTE && type != CHAT_MSG_AFK && type != CHAT_MSG_DND) { recvData >> lang; @@ -232,21 +223,18 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) recvData.rfinish(); // Prevent warnings return; } - - if (type != CHAT_MSG_AFK && type != CHAT_MSG_DND) - sender->UpdateSpeakTime(); } } if (sender->HasAura(1852) && type != CHAT_MSG_WHISPER) { - std::string msg=""; - recvData >> msg; - + recvData.rfinish(); SendNotification(GetTrinityString(LANG_GM_SILENCE), sender->GetName()); return; } + uint32 textLength = 0; + uint32 receiverLength = 0; std::string to, channel, msg; bool ignoreChecks = false; switch (type) @@ -255,27 +243,30 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) case CHAT_MSG_EMOTE: case CHAT_MSG_YELL: case CHAT_MSG_PARTY: - case CHAT_MSG_PARTY_LEADER: case CHAT_MSG_GUILD: case CHAT_MSG_OFFICER: case CHAT_MSG_RAID: - case CHAT_MSG_RAID_LEADER: case CHAT_MSG_RAID_WARNING: case CHAT_MSG_BATTLEGROUND: - case CHAT_MSG_BATTLEGROUND_LEADER: - recvData >> msg; + textLength = recvData.ReadBits(9); + msg = recvData.ReadString(textLength); break; case CHAT_MSG_WHISPER: - recvData >> msg; - recvData >> to; + receiverLength = recvData.ReadBits(10); + textLength = recvData.ReadBits(9); + to = recvData.ReadString(receiverLength); + msg = recvData.ReadString(textLength); break; case CHAT_MSG_CHANNEL: - recvData >> msg; - recvData >> channel; + receiverLength = recvData.ReadBits(10); + textLength = recvData.ReadBits(9); + msg = recvData.ReadString(textLength); + channel = recvData.ReadString(receiverLength); break; case CHAT_MSG_AFK: case CHAT_MSG_DND: - recvData >> msg; + textLength = recvData.ReadBits(9); + msg = recvData.ReadString(textLength); ignoreChecks = true; break; } @@ -368,8 +359,8 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) return; } - if (type == CHAT_MSG_PARTY_LEADER && !group->IsLeader(_player->GetGUID())) - return; + if (group->IsLeader(GetPlayer()->GetGUID())) + type = CHAT_MSG_PARTY_LEADER; sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, group); @@ -402,6 +393,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) } } break; case CHAT_MSG_RAID: + case CHAT_MSG_RAID_LEADER: { // if player is in battleground, he cannot say to battleground members by /ra Group* group = GetPlayer()->GetOriginalGroup(); @@ -412,27 +404,13 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) return; } - sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, group); - - WorldPacket data; - ChatHandler::FillMessageData(&data, this, CHAT_MSG_RAID, lang, "", 0, msg.c_str(), NULL); - group->BroadcastPacket(&data, false); - } break; - case CHAT_MSG_RAID_LEADER: - { - // if player is in battleground, he cannot say to battleground members by /ra - Group* group = GetPlayer()->GetOriginalGroup(); - if (!group) - { - group = GetPlayer()->GetGroup(); - if (!group || group->isBGGroup() || !group->isRaidGroup() || !group->IsLeader(_player->GetGUID())) - return; - } + if (group->IsLeader(GetPlayer()->GetGUID())) + type = CHAT_MSG_RAID_LEADER; sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, group); WorldPacket data; - ChatHandler::FillMessageData(&data, this, CHAT_MSG_RAID_LEADER, lang, "", 0, msg.c_str(), NULL); + ChatHandler::FillMessageData(&data, this, uint8(type), lang, "", 0, msg.c_str(), NULL); group->BroadcastPacket(&data, false); } break; case CHAT_MSG_RAID_WARNING: @@ -449,29 +427,20 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) group->BroadcastPacket(&data, false); } break; case CHAT_MSG_BATTLEGROUND: - { - //battleground raid is always in Player->GetGroup(), never in GetOriginalGroup() - Group* group = GetPlayer()->GetGroup(); - if (!group || !group->isBGGroup()) - return; - - sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, group); - - WorldPacket data; - ChatHandler::FillMessageData(&data, this, CHAT_MSG_BATTLEGROUND, lang, "", 0, msg.c_str(), NULL); - group->BroadcastPacket(&data, false); - } break; case CHAT_MSG_BATTLEGROUND_LEADER: { // battleground raid is always in Player->GetGroup(), never in GetOriginalGroup() Group* group = GetPlayer()->GetGroup(); - if (!group || !group->isBGGroup() || !group->IsLeader(GetPlayer()->GetGUID())) + if (!group || !group->isBGGroup()) return; + if (group->IsLeader(GetPlayer()->GetGUID())) + type = CHAT_MSG_BATTLEGROUND_LEADER; + sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, group); WorldPacket data; - ChatHandler::FillMessageData(&data, this, CHAT_MSG_BATTLEGROUND_LEADER, lang, "", 0, msg.c_str(), NULL); + ChatHandler::FillMessageData(&data, this, uint8(type), lang, "", 0, msg.c_str(), NULL); group->BroadcastPacket(&data, false); } break; case CHAT_MSG_CHANNEL: @@ -551,6 +520,9 @@ void WorldSession::HandleAddonMessagechatOpcode(WorldPacket& recvData) case CMSG_MESSAGECHAT_ADDON_GUILD: type = CHAT_MSG_GUILD; break; + case CMSG_MESSAGECHAT_ADDON_OFFICER: + type = CHAT_MSG_OFFICER; + break; case CMSG_MESSAGECHAT_ADDON_PARTY: type = CHAT_MSG_PARTY; break; diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 66961504dcb..ab2b327ffcd 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -407,25 +407,23 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_MEETINGSTONE_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_BATTLEGROUND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_GUILD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_OFFICER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_PARTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_RAID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_WHISPER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_AFK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_BATTLEGROUND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_BATTLEGROUND_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_DND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_GUILD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_OFFICER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_PARTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_PARTY_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_RAID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_RAID_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_RAID_WARNING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_SAY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_WHISPER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_YELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_AFK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_BATTLEGROUND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_DND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_GUILD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_OFFICER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_PARTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_RAID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_RAID_WARNING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_SAY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_WHISPER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_YELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_MINIGAME_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_MOUNTSPECIAL_ANIM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMountSpecialAnimOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_CHARACTER_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -933,7 +931,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_DEBUG_LIST_TARGETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DEBUG_SERVER_GEO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DEFENSE_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DESTROY_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_DESTROY_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DESTRUCTIBLE_BUILDING_DAMAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DISMOUNT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DISMOUNTRESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index de8830ac6e7..12316532a10 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -275,21 +275,19 @@ enum Opcodes CMSG_MEETINGSTONE_INFO = 0x0000, CMSG_MESSAGECHAT_ADDON_BATTLEGROUND = 0x0D46, CMSG_MESSAGECHAT_ADDON_GUILD = 0x0544, + CMSG_MESSAGECHAT_ADDON_OFFICER = 0x3954, CMSG_MESSAGECHAT_ADDON_PARTY = 0x0546, CMSG_MESSAGECHAT_ADDON_RAID = 0x1D56, CMSG_MESSAGECHAT_ADDON_WHISPER = 0x2146, CMSG_MESSAGECHAT_AFK = 0x0D44, CMSG_MESSAGECHAT_BATTLEGROUND = 0x2156, - CMSG_MESSAGECHAT_BATTLEGROUND_LEADER = 0x0000, CMSG_MESSAGECHAT_CHANNEL = 0x1D44, CMSG_MESSAGECHAT_DND = 0x2946, - CMSG_MESSAGECHAT_EMOTE = 0x0000, + CMSG_MESSAGECHAT_EMOTE = 0x1156, CMSG_MESSAGECHAT_GUILD = 0x3956, CMSG_MESSAGECHAT_OFFICER = 0x1946, CMSG_MESSAGECHAT_PARTY = 0x1D46, - CMSG_MESSAGECHAT_PARTY_LEADER = 0x0000, CMSG_MESSAGECHAT_RAID = 0x2D44, - CMSG_MESSAGECHAT_RAID_LEADER = 0x0000, CMSG_MESSAGECHAT_RAID_WARNING = 0x0944, CMSG_MESSAGECHAT_SAY = 0x1154, CMSG_MESSAGECHAT_WHISPER = 0x0D56, -- cgit v1.2.3 From c1592405a319572fe9b6b9a2e5786407547151d8 Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 23 Jul 2012 13:43:32 +0200 Subject: Core/Players: Fixed displaying player guild ingame --- src/server/game/Entities/Player/Player.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 39b9f59ba95..b9261aaff64 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1869,12 +1869,14 @@ class Player : public Unit, public GridObject void RemoveFromGroup(RemoveMethod method = GROUP_REMOVEMETHOD_DEFAULT) { RemoveFromGroup(GetGroup(), GetGUID(), method); } void SendUpdateToOutOfRangeGroupMembers(); - void SetInGuild(uint32 GuildId) + void SetInGuild(uint32 guildId) { - if (GuildId) - SetUInt64Value(OBJECT_FIELD_DATA, MAKE_NEW_GUID(GuildId, 0, HIGHGUID_GUILD)); + if (guildId) + SetUInt64Value(OBJECT_FIELD_DATA, MAKE_NEW_GUID(guildId, 0, HIGHGUID_GUILD)); else SetUInt64Value(OBJECT_FIELD_DATA, 0); + + SetUInt16Value(OBJECT_FIELD_TYPE, 1, guildId != 0); } void SetRank(uint8 rankId) { SetUInt32Value(PLAYER_GUILDRANK, rankId); } -- cgit v1.2.3 From 15f9f14121111828d30bf0636610335572a03268 Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 23 Jul 2012 13:43:57 +0200 Subject: Core/Object: Minor cleanup --- src/server/game/Entities/Object/Object.cpp | 21 +++++---------------- src/server/game/Entities/Object/Object.h | 2 +- 2 files changed, 6 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 6271af99fcd..8b22a48522d 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -138,20 +138,7 @@ void Object::_Create(uint32 guidlow, uint32 entry, HighGuid guidhigh) uint64 guid = MAKE_NEW_GUID(guidlow, entry, guidhigh); SetUInt64Value(OBJECT_FIELD_GUID, guid); - uint32 type = 0; - switch (m_objectType) - { - //case TYPEID_ITEM: type = 3; break; - //case TYPEID_CONTAINER: type = 7; break; //+4 - //case TYPEID_UNIT: type = 9; break; //+2 - //case TYPEID_PLAYER: type = 25; break; //+16 - //case TYPEID_GAMEOBJECT: type = 33; break; //+8 - case TYPEID_DYNAMICOBJECT: type = 65; break; //+32 - //case TYPEID_CORPSE: type = 129; break; //+64 - default: type = m_objectType; break; - } - SetUInt32Value(OBJECT_FIELD_TYPE, type); - //SetUInt32Value(OBJECT_FIELD_TYPE, m_objectType); + SetUInt16Value(OBJECT_FIELD_TYPE, 0, m_objectType); m_PackGUID.wpos(0); m_PackGUID.appendPackGUID(GetGUID()); } @@ -324,7 +311,7 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const uint16 movementFlagsExtra = self->m_movementInfo.GetExtraMovementFlags(); data->WriteBit(!movementFlags); - data->WriteBit(0); // Has Orientation + data->WriteBit(G3D::fuzzyEq(self->GetOrientation(), 0.0f)); // Has Orientation data->WriteBit(guid[7]); data->WriteBit(guid[3]); data->WriteBit(guid[2]); @@ -491,7 +478,9 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const *data << self->GetSpeed(MOVE_FLIGHT_BACK); data->WriteByteSeq(guid[6]); *data << self->GetSpeed(MOVE_TURN_RATE); - *data << float(self->GetOrientation()); + if (!G3D::fuzzyEq(self->GetOrientation(), 0.0f)) + *data << float(self->GetOrientation()); + *data << self->GetSpeed(MOVE_RUN); if ((movementFlags & (MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING)) || (movementFlagsExtra & MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING)) diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index 3e00e775b4b..e417b3bdc2d 100755 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -935,7 +935,7 @@ class WorldObject : public Object, public WorldLocation virtual bool _IsWithinDist(WorldObject const* obj, float dist2compare, bool is3D) const; - bool CanNeverSee(WorldObject const* obj) const { return GetMap() != obj->GetMap() || !InSamePhase(obj); } + bool CanNeverSee(WorldObject const* obj) const { return !IsInMap(obj) || !InSamePhase(obj); } virtual bool CanAlwaysSee(WorldObject const* /*obj*/) const { return false; } bool CanDetect(WorldObject const* obj, bool ignoreStealth) const; bool CanDetectInvisibilityOf(WorldObject const* obj) const; -- cgit v1.2.3 From 370c982cc044dd970682a5fdd251d05b79fdb0c3 Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 23 Jul 2012 16:36:18 +0100 Subject: Tools/Map extractor: Use a standard format specifier when printing loaded area counts (like the map and liqtypes count) --- src/tools/map_extractor/System.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp index 076c5c126e2..c498026e401 100644 --- a/src/tools/map_extractor/System.cpp +++ b/src/tools/map_extractor/System.cpp @@ -294,7 +294,7 @@ void ReadAreaTableDBC() areas[dbc.getRecord(x).getUInt(0)] = dbc.getRecord(x).getUInt(3); SFileCloseFile(dbcFile); - printf("Done! (%zu areas loaded)\n", area_count); + printf("Done! (%u areas loaded)\n", area_count); } void ReadLiquidTypeTableDBC() -- cgit v1.2.3 From c4bb17e78d62e46da09d131466f25bd04c27758d Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 24 Jul 2012 00:06:49 +0100 Subject: Core/NPCs: Fix vendors Enable CMSG_LIST_INVENTORY and SMSG_LIST_INVENTORY Update and rewrite SMSG_LIST_INVENTORY --- src/server/game/Handlers/ItemHandler.cpp | 189 +++++++++++++++------------- src/server/game/Server/Protocol/Opcodes.cpp | 4 +- 2 files changed, 104 insertions(+), 89 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index edd0d396e2f..2b2526ef1fd 100755 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -27,6 +27,7 @@ #include "UpdateData.h" #include "ObjectAccessor.h" #include "SpellInfo.h" +#include void WorldSession::HandleSplitItemOpcode(WorldPacket & recv_data) { @@ -722,6 +723,19 @@ void WorldSession::HandleListInventoryOpcode(WorldPacket & recv_data) SendListInventory(guid); } +struct VendorItemHelper +{ + uint32 Slot; + uint32 Type; + uint32 Entry; + uint32 DisplayId; + uint32 Durability; + uint32 ExtendedCost; + uint32 Price; + int32 LeftInStock; + uint32 BuyCount; +}; + void WorldSession::SendListInventory(uint64 vendorGuid) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_LIST_INVENTORY"); @@ -742,111 +756,112 @@ void WorldSession::SendListInventory(uint64 vendorGuid) if (vendor->HasUnitState(UNIT_STATE_MOVING)) vendor->StopMoving(); - uint8* bytes = (uint8*)&vendorGuid; + // build list of available items + VendorItemData const* vendorItems = vendor->GetVendorItems(); + std::list items; + uint8 rawItemCount = vendorItems ? vendorItems->GetItemCount() : 0; - VendorItemData const* items = vendor->GetVendorItems(); - if (!items) - { - WorldPacket data(SMSG_LIST_INVENTORY, 8 + 1 + 1); - data.WriteBit(bytes[5]); - data.WriteBit(bytes[6]); - data.WriteBit(bytes[1]); - data.WriteBit(bytes[2]); - data.WriteBit(bytes[3]); - data.WriteBit(bytes[0]); - data.WriteBit(bytes[7]); - data.WriteBit(bytes[4]); - - data.WriteByteSeq(bytes[2]); - data.WriteByteSeq(bytes[3]); - - data << uint8(0); // count == 0, next will be error code - data << uint8(0xA0); // Only seen 0xA0 (160) so far ( should we send 0 here?) - - data.WriteByteSeq(bytes[4]); - data.WriteByteSeq(bytes[7]); - data.WriteByteSeq(bytes[6]); - SendPacket(&data); - return; - } + //if (rawItemCount > 300), + // rawItemCount = 300; // client cap but uint8 max value is 255 - uint8 itemCount = items->GetItemCount(); + const float discountMod = _player->GetReputationPriceDiscount(vendor); uint8 count = 0; + for (uint8 slot = 0; slot < rawItemCount; ++slot) + { + VendorItem const* vendorItem = vendorItems->GetItem(slot); + if (!vendorItem) continue; - WorldPacket data(SMSG_LIST_INVENTORY, 8 + 1 + itemCount * 8 * 4); + ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(vendorItem->item); + if (!itemTemplate) continue; - data.WriteBit(bytes[5]); - data.WriteBit(bytes[6]); - data.WriteBit(bytes[1]); - data.WriteBit(bytes[2]); - data.WriteBit(bytes[3]); - data.WriteBit(bytes[0]); - data.WriteBit(bytes[7]); - data.WriteBit(bytes[4]); + if (!_player->isGameMaster()) // ignore conditions if GM on + { + // Respect allowed class + if (!(itemTemplate->AllowableClass & _player->getClassMask())) + continue; + + // Do not sell BOP items + if (itemTemplate->Bonding == BIND_WHEN_PICKED_UP) + continue; + + // Only display items in vendor lists for the team the player is on + if ((itemTemplate->Flags2 & ITEM_FLAGS_EXTRA_HORDE_ONLY && _player->GetTeam() == ALLIANCE) || + (itemTemplate->Flags2 & ITEM_FLAGS_EXTRA_ALLIANCE_ONLY && _player->GetTeam() == HORDE)) + continue; + + // Items sold out are not displayed in list + uint32 leftInStock = !vendorItem->maxcount ? 0xFFFFFFFF : vendor->GetVendorItemCurrentCount(vendorItem); + if (leftInStock == 0) + continue; + } + + int32 price = vendorItem->IsGoldRequired(itemTemplate) ? uint32(floor(itemTemplate->BuyPrice * discountMod)) : 0; + uint32 leftInStock = !vendorItem->maxcount ? 0xFFFFFFFF : vendor->GetVendorItemCurrentCount(vendorItem); + + VendorItemHelper item; + item.Slot = count + 1; // client expects counting to start at 1 + item.Type = 1; // 1 is items, 2 is currency (FIXME: currency isn't implemented) + item.Entry = vendorItem->item; + item.DisplayId = itemTemplate->DisplayInfoID; + item.Durability = itemTemplate->MaxDurability; + item.ExtendedCost = vendorItem->ExtendedCost; + item.Price = price; + item.LeftInStock = leftInStock; + item.BuyCount = itemTemplate->BuyCount; + + items.push_back(item); + } - data.WriteByteSeq(bytes[2]); - data.WriteByteSeq(bytes[3]); + uint8* guidBytes = (uint8*)&vendorGuid; - size_t countPos = data.wpos(); - data << uint32(count); + WorldPacket data(SMSG_LIST_INVENTORY, 12 + 33 * items.size()); - data.WriteByteSeq(bytes[5]); - data.WriteByteSeq(bytes[0]); - data.WriteByteSeq(bytes[1]); + data.WriteBit(guidBytes[1]); + data.WriteBit(guidBytes[0]); - data << uint8(0xA0); // Only seen 0xA0 (160) so far + data.WriteBits(items.size(), 21); // item count - data.WriteByteSeq(bytes[4]); - data.WriteByteSeq(bytes[7]); - data.WriteByteSeq(bytes[6]); + data.WriteBit(guidBytes[3]); + data.WriteBit(guidBytes[6]); + data.WriteBit(guidBytes[5]); + data.WriteBit(guidBytes[2]); + data.WriteBit(guidBytes[7]); + for (std::list::const_iterator itr = items.begin(); itr != items.end(); ++itr) + { + data.WriteBit((*itr).ExtendedCost == 0); + data.WriteBit(1); // unk "enabler" + } - float discountMod = _player->GetReputationPriceDiscount(vendor); + data.WriteBit(guidBytes[4]); - for (uint8 slot = 0; slot < itemCount; ++slot) + for (std::list::const_iterator itr = items.begin(); itr != items.end(); ++itr) { - if (VendorItem const* item = items->GetItem(slot)) - { - if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(item->item)) - { - if (!(itemTemplate->AllowableClass & _player->getClassMask()) && itemTemplate->Bonding == BIND_WHEN_PICKED_UP && !_player->isGameMaster()) - continue; - // Only display items in vendor lists for the team the - // player is on. If GM on, display all items. - if (!_player->isGameMaster() && ((itemTemplate->Flags2 & ITEM_FLAGS_EXTRA_HORDE_ONLY && _player->GetTeam() == ALLIANCE) || (itemTemplate->Flags2 == ITEM_FLAGS_EXTRA_ALLIANCE_ONLY && _player->GetTeam() == HORDE))) - continue; + data << uint32((*itr).Slot); + data << uint32((*itr).Durability); + if ((*itr).ExtendedCost != 0) + data << uint32((*itr).ExtendedCost); + data << uint32((*itr).Entry); + data << uint32((*itr).Type); + data << uint32((*itr).Price); + data << uint32((*itr).DisplayId); + // if (!unk "enabler") data << uint32(something); + data << int32((*itr).LeftInStock); + data << uint32((*itr).BuyCount); + } - // Items sold out are not displayed in list - uint32 leftInStock = !item->maxcount ? 0xFFFFFFFF : vendor->GetVendorItemCurrentCount(item); - if (!_player->isGameMaster() && !leftInStock) - continue; + data.WriteByteSeq(guidBytes[5]); + data.WriteByteSeq(guidBytes[4]); + data.WriteByteSeq(guidBytes[1]); + data.WriteByteSeq(guidBytes[0]); + data.WriteByteSeq(guidBytes[6]); - ++count; - - // reputation discount - int32 price = item->IsGoldRequired(itemTemplate) ? uint32(floor(itemTemplate->BuyPrice * discountMod)) : 0; - - data << uint32(itemTemplate->MaxDurability); - data << uint32(slot + 1); // client expects counting to start at 1 - data << uint32(item->item); - data << uint32(0); // Always 0? - data << uint32(itemTemplate->DisplayInfoID); - data << int32(leftInStock); - data << uint32(itemTemplate->BuyCount); - data << uint32(item->ExtendedCost); - data << uint32(1); // Always 1? - data << uint32(price); - } - } - } + data << uint8(items.size() == 0); // unk byte, item count 0: 1, item count != 0: 0 or some "random" value below 300 - if (count == 0) - { - SendPacket(&data); - return; - } + data.WriteByteSeq(guidBytes[2]); + data.WriteByteSeq(guidBytes[3]); + data.WriteByteSeq(guidBytes[7]); - data.put(countPos, count); SendPacket(&data); } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index ab2b327ffcd..94568f00c6f 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -380,7 +380,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_NEEDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_ROLES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetRolesOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LFG_TELEPORT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgTeleportOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_LIST_INVENTORY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleListInventoryOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_LIST_INVENTORY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleListInventoryOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LOAD_DANCES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_LOAD_SCREEN, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleLoadScreenOpcode ); DEFINE_OPCODE_HANDLER(CMSG_LOGOUT_CANCEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLogoutCancelOpcode ); @@ -1068,7 +1068,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_PARTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_SEARCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LIST_INVENTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LIST_INVENTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LOGIN_SETTIMESPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LOGIN_VERIFY_WORLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LOGOUT_CANCEL_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From 3c7d11eb6e4208ba87cd7cd3639440df8ac45a4d Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 24 Jul 2012 00:59:55 +0100 Subject: Core/Misc: Optimize HandleListInventoryOpcode Thanks to Shauren for the tips --- src/server/game/Handlers/ItemHandler.cpp | 81 ++++++++++++-------------------- 1 file changed, 31 insertions(+), 50 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 2b2526ef1fd..6a33238e750 100755 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -27,7 +27,7 @@ #include "UpdateData.h" #include "ObjectAccessor.h" #include "SpellInfo.h" -#include +#include void WorldSession::HandleSplitItemOpcode(WorldPacket & recv_data) { @@ -723,19 +723,6 @@ void WorldSession::HandleListInventoryOpcode(WorldPacket & recv_data) SendListInventory(guid); } -struct VendorItemHelper -{ - uint32 Slot; - uint32 Type; - uint32 Entry; - uint32 DisplayId; - uint32 Durability; - uint32 ExtendedCost; - uint32 Price; - int32 LeftInStock; - uint32 BuyCount; -}; - void WorldSession::SendListInventory(uint64 vendorGuid) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_LIST_INVENTORY"); @@ -756,14 +743,16 @@ void WorldSession::SendListInventory(uint64 vendorGuid) if (vendor->HasUnitState(UNIT_STATE_MOVING)) vendor->StopMoving(); - // build list of available items VendorItemData const* vendorItems = vendor->GetVendorItems(); - std::list items; uint8 rawItemCount = vendorItems ? vendorItems->GetItemCount() : 0; //if (rawItemCount > 300), // rawItemCount = 300; // client cap but uint8 max value is 255 + ByteBuffer itemsData(32 * rawItemCount); + std::vector enablers; + enablers.reserve(2 * rawItemCount); + const float discountMod = _player->GetReputationPriceDiscount(vendor); uint8 count = 0; for (uint8 slot = 0; slot < rawItemCount; ++slot) @@ -798,28 +787,35 @@ void WorldSession::SendListInventory(uint64 vendorGuid) int32 price = vendorItem->IsGoldRequired(itemTemplate) ? uint32(floor(itemTemplate->BuyPrice * discountMod)) : 0; uint32 leftInStock = !vendorItem->maxcount ? 0xFFFFFFFF : vendor->GetVendorItemCurrentCount(vendorItem); - VendorItemHelper item; - item.Slot = count + 1; // client expects counting to start at 1 - item.Type = 1; // 1 is items, 2 is currency (FIXME: currency isn't implemented) - item.Entry = vendorItem->item; - item.DisplayId = itemTemplate->DisplayInfoID; - item.Durability = itemTemplate->MaxDurability; - item.ExtendedCost = vendorItem->ExtendedCost; - item.Price = price; - item.LeftInStock = leftInStock; - item.BuyCount = itemTemplate->BuyCount; - - items.push_back(item); + itemsData << uint32(count++ + 1); // client expects counting to start at 1 + itemsData << uint32(itemTemplate->MaxDurability); + + if (vendorItem->ExtendedCost != 0) + { + enablers.push_back(0); + itemsData << uint32(vendorItem->ExtendedCost); + } + else + enablers.push_back(1); + enablers.push_back(1); // unk bit + + itemsData << uint32(vendorItem->item); + itemsData << uint32(1); // 1 is items, 2 is currency (FIXME: currency isn't implemented) + itemsData << uint32(price); + itemsData << uint32(itemTemplate->DisplayInfoID); + // if (!unk "enabler") data << uint32(something); + itemsData << int32(leftInStock); + itemsData << uint32(itemTemplate->BuyCount); } uint8* guidBytes = (uint8*)&vendorGuid; - WorldPacket data(SMSG_LIST_INVENTORY, 12 + 33 * items.size()); + WorldPacket data(SMSG_LIST_INVENTORY, 12 + itemsData.size()); data.WriteBit(guidBytes[1]); data.WriteBit(guidBytes[0]); - data.WriteBits(items.size(), 21); // item count + data.WriteBits(count, 21); // item count data.WriteBit(guidBytes[3]); data.WriteBit(guidBytes[6]); @@ -827,28 +823,13 @@ void WorldSession::SendListInventory(uint64 vendorGuid) data.WriteBit(guidBytes[2]); data.WriteBit(guidBytes[7]); - for (std::list::const_iterator itr = items.begin(); itr != items.end(); ++itr) - { - data.WriteBit((*itr).ExtendedCost == 0); - data.WriteBit(1); // unk "enabler" - } + for (std::vector::const_iterator itr = enablers.begin(); itr != enablers.end(); ++itr) + data.WriteBit(*itr); data.WriteBit(guidBytes[4]); - for (std::list::const_iterator itr = items.begin(); itr != items.end(); ++itr) - { - data << uint32((*itr).Slot); - data << uint32((*itr).Durability); - if ((*itr).ExtendedCost != 0) - data << uint32((*itr).ExtendedCost); - data << uint32((*itr).Entry); - data << uint32((*itr).Type); - data << uint32((*itr).Price); - data << uint32((*itr).DisplayId); - // if (!unk "enabler") data << uint32(something); - data << int32((*itr).LeftInStock); - data << uint32((*itr).BuyCount); - } + data.FlushBits(); + data.append(itemsData); data.WriteByteSeq(guidBytes[5]); data.WriteByteSeq(guidBytes[4]); @@ -856,7 +837,7 @@ void WorldSession::SendListInventory(uint64 vendorGuid) data.WriteByteSeq(guidBytes[0]); data.WriteByteSeq(guidBytes[6]); - data << uint8(items.size() == 0); // unk byte, item count 0: 1, item count != 0: 0 or some "random" value below 300 + data << uint8(count == 0); // unk byte, item count 0: 1, item count != 0: 0 or some "random" value below 300 data.WriteByteSeq(guidBytes[2]); data.WriteByteSeq(guidBytes[3]); -- cgit v1.2.3 From 209f451e26559aa1e1cf618e0a4df4d4179a1b2e Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 24 Jul 2012 01:34:43 +0100 Subject: Core/PacketIO: Enable gossip related opcodes/handlers --- src/server/game/Server/Protocol/Opcodes.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 94568f00c6f..bade38e4054 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -304,8 +304,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_GM_VISION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GM_WHISPER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GODMODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GOSSIP_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGossipHelloOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GOSSIP_SELECT_OPTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGossipSelectOptionOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GOSSIP_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGossipHelloOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GOSSIP_SELECT_OPTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGossipSelectOptionOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GRANT_LEVEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGrantLevel ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupAcceptOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_ASSISTANT_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupAssistantLeaderOpcode); @@ -460,7 +460,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_NEW_SPELL_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_NEXT_CINEMATIC_CAMERA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNextCinematicCamera ); //DEFINE_OPCODE_HANDLER(CMSG_NO_SPELL_VARIANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_NPC_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNpcTextQueryOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_NPC_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNpcTextQueryOpcode ); DEFINE_OPCODE_HANDLER(CMSG_OBJECT_UPDATE_FAILED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleObjectUpdateFailedOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_OFFER_PETITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleOfferPetitionOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_OPENING_CINEMATIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -991,9 +991,9 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_GM_TICKET_STATUS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GODMODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GOGOGO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GOSSIP_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GOSSIP_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GOSSIP_POI, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GOSSIP_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GOSSIP_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GOSSIP_POI, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GROUPACTION_THROTTLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GROUP_CANCEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GROUP_DECLINE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1135,7 +1135,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_NOTIFY_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_NOTIFY_DEST_LOC_SPELL_CAST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_NPC_TEXT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_NPC_TEXT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_NPC_WONT_TALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_OFFER_PETITION_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From 9a8ca58cf5cb1a7f6556d6ddf257c7a268edf90d Mon Sep 17 00:00:00 2001 From: Yaki Khadafi Date: Tue, 24 Jul 2012 13:35:00 +0300 Subject: Fix movementInfo read/write Signed-off-by: Yaki Khadafi --- src/server/game/Handlers/MovementHandler.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp index 5cdd7ffd99b..e380ff4b110 100755 --- a/src/server/game/Handlers/MovementHandler.cpp +++ b/src/server/game/Handlers/MovementHandler.cpp @@ -795,15 +795,15 @@ void WorldSession::ReadMovementInfo(WorldPacket& data, MovementInfo* mi) data >> mi->j_zspeed; break; case MSEFallCosAngle: - if (hasFallDirection) + if (hasFallData && hasFallDirection) data >> mi->j_cosAngle; break; case MSEFallSinAngle: - if (hasFallDirection) + if (hasFallData && hasFallDirection) data >> mi->j_sinAngle; break; case MSEFallHorizontalSpeed: - if (hasFallDirection) + if (hasFallData && hasFallDirection) data >> mi->j_xyspeed; break; case MSESplineElevation: @@ -1070,15 +1070,15 @@ void WorldSession::WriteMovementInfo(WorldPacket &data, MovementInfo* mi) data << mi->j_zspeed; break; case MSEFallCosAngle: - if (hasFallDirection) + if (hasFallData && hasFallDirection) data << mi->j_cosAngle; break; case MSEFallSinAngle: - if (hasFallDirection) + if (hasFallData && hasFallDirection) data << mi->j_sinAngle; break; case MSEFallHorizontalSpeed: - if (hasFallDirection) + if (hasFallData && hasFallDirection) data << mi->j_xyspeed; break; case MSESplineElevation: -- cgit v1.2.3 From 04b30fd0351154974e4d848e30400ac63d9086a7 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 24 Jul 2012 15:28:41 +0200 Subject: Core/Objects: Minor fixes to creature/gameobject data --- src/server/game/Entities/Creature/Creature.cpp | 25 +++++++++++++++++----- src/server/game/Entities/GameObject/GameObject.cpp | 1 + src/server/game/Entities/Object/Object.cpp | 23 +++++++++++++++++++- 3 files changed, 43 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index c9d298c769f..9fd48bfc320 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -381,6 +381,7 @@ bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData* data) SetAttackTime(RANGED_ATTACK, cInfo->rangeattacktime); SetUInt32Value(UNIT_FIELD_FLAGS, unit_flags); + SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_REGENERATE_POWER); SetUInt32Value(UNIT_DYNAMIC_FLAGS, dynamicflags); @@ -440,7 +441,7 @@ bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData* data) */ // TODO: Shouldn't we check whether or not the creature is in water first? - if (cInfo->InhabitType & INHABIT_WATER) + if (cInfo->InhabitType & INHABIT_WATER && IsInWater()) AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING); return true; @@ -1160,12 +1161,26 @@ void Creature::SelectLevel(const CreatureTemplate* cinfo) // mana uint32 mana = stats->GenerateMana(cinfo); - SetCreateMana(mana); - SetMaxPower(POWER_MANA, mana); //MAX Mana - SetPower(POWER_MANA, mana); - // TODO: set UNIT_FIELD_POWER*, for some creature class case (energy, etc) + switch (getClass()) + { + case CLASS_WARRIOR: + setPowerType(POWER_RAGE); + SetMaxPower(POWER_RAGE, GetCreatePowers(POWER_RAGE)); + SetPower(POWER_RAGE, GetCreatePowers(POWER_RAGE)); + break; + case CLASS_ROGUE: + setPowerType(POWER_ENERGY); + SetMaxPower(POWER_ENERGY, GetCreatePowers(POWER_ENERGY)); + SetPower(POWER_ENERGY, GetCreatePowers(POWER_ENERGY)); + break; + default: + setPowerType(POWER_MANA); + SetMaxPower(POWER_MANA, mana); + SetPower(POWER_MANA, mana); + break; + } SetModifierValue(UNIT_MOD_HEALTH, BASE_VALUE, (float)health); SetModifierValue(UNIT_MOD_MANA, BASE_VALUE, (float)mana); diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index d20102e3081..cb35533484f 100755 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -230,6 +230,7 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map* map, uint32 phaseMa m_goValue->Building.Health = goinfo->building.intactNumHits + goinfo->building.damagedNumHits; m_goValue->Building.MaxHealth = m_goValue->Building.Health; SetGoAnimProgress(255); + SetUInt32Value(GAMEOBJECT_PARENTROTATION, m_goInfo->building.destructibleData); break; case GAMEOBJECT_TYPE_TRANSPORT: SetUInt32Value(GAMEOBJECT_LEVEL, goinfo->transport.pause); diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 8b22a48522d..492afc39dc6 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -299,7 +299,7 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const data->WriteBit(0); data->WriteBit(flags & UPDATEFLAG_GO_TRANSPORT_POSITION); data->WriteBit(flags & UPDATEFLAG_STATIONARY_POSITION); - data->WriteBit(0); + data->WriteBit(flags & UPDATEFLAG_UNK5); data->WriteBit(0); data->WriteBit(flags & UPDATEFLAG_TRANSPORT); @@ -525,6 +525,27 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const if (flags & UPDATEFLAG_ROTATION) *data << uint64(ToGameObject()->GetRotation()); + if (flags & UPDATEFLAG_UNK5) + { + *data << float(0.0f); + *data << float(0.0f); + *data << float(0.0f); + *data << float(0.0f); + *data << uint8(0); + *data << float(0.0f); + *data << float(0.0f); + *data << float(0.0f); + *data << float(0.0f); + *data << float(0.0f); + *data << float(0.0f); + *data << float(0.0f); + *data << float(0.0f); + *data << float(0.0f); + *data << float(0.0f); + *data << float(0.0f); + *data << float(0.0f); + } + if (flags & UPDATEFLAG_STATIONARY_POSITION) { WorldObject const* self = static_cast(this); -- cgit v1.2.3 From 9f945e015929a2991b4e5a403a15253989610ae2 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 24 Jul 2012 15:29:09 +0200 Subject: Core/PacketIO: Enabled CMSG_SET_SELECTION --- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index bade38e4054..c725b6214e0 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -602,7 +602,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_SET_RUNE_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_RUNE_COUNT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_SAVED_INSTANCE_EXTEND, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_SELECTION, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleSetSelectionOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_SET_SELECTION, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleSetSelectionOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SET_SKILL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_STAT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_TAXI_BENCHMARK_MODE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTaxiBenchmarkOpcode ); -- cgit v1.2.3 From 4364f80d37560ba50ef01bdcea147e1d7cba0067 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 24 Jul 2012 15:29:49 +0200 Subject: Core/Achievements: Fixed remaining crashes introduced with achievementmgr overhaul --- src/server/game/Achievements/AchievementMgr.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index d00ff14909f..4e25fa03a42 100755 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -2235,7 +2235,7 @@ void AchievementMgr::RemoveTimedAchievement(AchievementCriteriaTimedTypes typ } template -void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement, Player* /*referencePlayer*/) +void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement, Player* referencePlayer) { sLog->outDetail("AchievementMgr::CompletedAchievement(%u)", achievement->ID); @@ -2258,8 +2258,8 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement if (!(achievement->flags & ACHIEVEMENT_FLAG_REALM_FIRST_KILL)) sAchievementMgr->SetRealmCompleted(achievement); - UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT); - UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EARN_ACHIEVEMENT_POINTS, achievement->points); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT, 0, 0, NULL, referencePlayer); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EARN_ACHIEVEMENT_POINTS, achievement->points, 0, NULL, referencePlayer); // reward items and titles if any AchievementReward const* reward = sAchievementMgr->GetAchievementReward(achievement); @@ -2340,8 +2340,8 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achieve sAchievementMgr->SetRealmCompleted(achievement); - UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT); - UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EARN_ACHIEVEMENT_POINTS, achievement->points); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT, 0, 0, NULL, referencePlayer); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EARN_ACHIEVEMENT_POINTS, achievement->points, 0, NULL, referencePlayer); } struct VisibleAchievementPred -- cgit v1.2.3 From 0f04b2fc36593526cf1cc86667d37779691e1135 Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 24 Jul 2012 15:27:42 +0100 Subject: Core/Misc: Update money to 64 bits (from 32), increasing the maximum gold possible This got a bit messy and will be further fixed when all related packets are updated. (Also fixed a typo in atoll msvc macro) --- .../2012_07_24_00_characters_various_434.sql | 3 ++ src/server/game/Chat/Commands/Level2.cpp | 10 +++--- src/server/game/Chat/Commands/Level3.cpp | 3 +- src/server/game/Entities/Player/Player.cpp | 38 +++++++++++----------- src/server/game/Entities/Player/Player.h | 22 ++++++------- src/server/game/Guilds/Guild.cpp | 12 +++---- src/server/game/Handlers/AuctionHouseHandler.cpp | 18 +++++----- src/server/game/Handlers/CharacterHandler.cpp | 8 ++--- src/server/game/Handlers/GuildHandler.cpp | 8 ++--- src/server/game/Handlers/ItemHandler.cpp | 6 ++-- src/server/game/Handlers/MailHandler.cpp | 4 +-- src/server/game/Handlers/NPCHandler.cpp | 4 +-- src/server/game/Handlers/PetitionsHandler.cpp | 2 +- src/server/game/Handlers/TradeHandler.cpp | 6 ++-- src/server/game/Mails/Mail.h | 8 ++--- src/server/game/Scripting/ScriptMgr.cpp | 2 +- src/server/game/Scripting/ScriptMgr.h | 4 +-- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- src/server/game/World/World.cpp | 6 ++-- src/server/scripts/Commands/cs_modify.cpp | 7 ++-- src/server/scripts/World/npc_professions.cpp | 6 ++-- src/server/scripts/World/npcs_special.cpp | 8 ++--- src/server/shared/Common.h | 2 +- 23 files changed, 97 insertions(+), 92 deletions(-) create mode 100644 sql/updates/characters/2012_07_24_00_characters_various_434.sql (limited to 'src') diff --git a/sql/updates/characters/2012_07_24_00_characters_various_434.sql b/sql/updates/characters/2012_07_24_00_characters_various_434.sql new file mode 100644 index 00000000000..8b2bfd4f131 --- /dev/null +++ b/sql/updates/characters/2012_07_24_00_characters_various_434.sql @@ -0,0 +1,3 @@ +ALTER TABLE `characters` CHANGE `money` `money` bigint(20) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `mail` CHANGE `money` `money` bigint(20) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `mail` CHANGE `cod` `cod` bigint(20) unsigned NOT NULL DEFAULT '0'; diff --git a/src/server/game/Chat/Commands/Level2.cpp b/src/server/game/Chat/Commands/Level2.cpp index 8fe782a75c1..752ba6bc3ca 100755 --- a/src/server/game/Chat/Commands/Level2.cpp +++ b/src/server/game/Chat/Commands/Level2.cpp @@ -251,7 +251,7 @@ bool ChatHandler::HandlePInfoCommand(const char* args) return false; uint32 accId = 0; - uint32 money = 0; + uint64 money = 0; uint32 total_player_time = 0; uint8 level = 0; uint32 latency = 0; @@ -299,7 +299,7 @@ bool ChatHandler::HandlePInfoCommand(const char* args) Field* fields = result->Fetch(); total_player_time = fields[0].GetUInt32(); level = fields[1].GetUInt8(); - money = fields[2].GetUInt32(); + money = fields[2].GetUInt64(); accId = fields[3].GetUInt32(); race = fields[4].GetUInt8(); Class = fields[5].GetUInt8(); @@ -422,9 +422,9 @@ bool ChatHandler::HandlePInfoCommand(const char* args) } std::string timeStr = secsToTimeString(total_player_time, true, true); - uint32 gold = money /GOLD; - uint32 silv = (money % GOLD) / SILVER; - uint32 copp = (money % GOLD) % SILVER; + uint64 gold = money / GOLD; + uint64 silv = (money % GOLD) / SILVER; + uint64 copp = (money % GOLD) % SILVER; PSendSysMessage(LANG_PINFO_LEVEL, race_s.c_str(), Class_s.c_str(), timeStr.c_str(), level, gold, silv, copp); // Add map, zone, subzone and phase to output diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp index 5b93b899898..355789b565e 100755 --- a/src/server/game/Chat/Commands/Level3.cpp +++ b/src/server/game/Chat/Commands/Level3.cpp @@ -63,6 +63,7 @@ #include "SmartAI.h" #include "Group.h" #include "ChannelMgr.h" +#include bool ChatHandler::HandleMaxSkillCommand(const char* /*args*/) { @@ -1388,7 +1389,7 @@ bool ChatHandler::HandleSendMoneyCommand(const char *args) return false; char* money_str = strtok(NULL, ""); - int32 money = money_str ? atoi(money_str) : 0; + int64 money = money_str ? atoll(money_str) : 0; if (money <= 0) return false; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index b2808938b57..9847d22f84e 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -346,7 +346,7 @@ void TradeData::SetSpell(uint32 spell_id, Item* castItem /*= NULL*/) Update(false); // send spell info to caster self } -void TradeData::SetMoney(uint32 money) +void TradeData::SetMoney(uint64 money) { if (m_money == money) return; @@ -4412,7 +4412,7 @@ bool Player::ResetTalents(bool no_cost) { cost = GetNextResetTalentsCost(); - if (!HasEnoughMoney(cost)) + if (!HasEnoughMoney(uint64(cost))) { SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, 0, 0, 0); return false; @@ -5454,13 +5454,13 @@ uint32 Player::DurabilityRepair(uint16 pos, bool cost, float discountMod, bool g TotalCost = costs; } - else if (!HasEnoughMoney(costs)) + else if (!HasEnoughMoney(uint64(costs))) { sLog->outStaticDebug("You do not have enough money"); return TotalCost; } else - ModifyMoney(-int32(costs)); + ModifyMoney(-int64(costs)); } } @@ -14325,7 +14325,7 @@ void Player::OnGossipSelect(WorldObject* source, uint32 gossipListId, uint32 men return; int32 cost = int32(item->BoxMoney); - if (!HasEnoughMoney(cost)) + if (!HasEnoughMoney(int64(cost))) { SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, 0, 0, 0); PlayerTalkClass->SendCloseGossip(); @@ -14773,7 +14773,7 @@ bool Player::CanCompleteQuest(uint32 quest_id) if (qInfo->GetRewOrReqMoney() < 0) { - if (!HasEnoughMoney(-qInfo->GetRewOrReqMoney())) + if (!HasEnoughMoney(-int64(qInfo->GetRewOrReqMoney()))) return false; } @@ -14836,7 +14836,7 @@ bool Player::CanRewardQuest(Quest const* quest, bool msg) } // prevent receive reward with low money and GetRewOrReqMoney() < 0 - if (quest->GetRewOrReqMoney() < 0 && !HasEnoughMoney(-quest->GetRewOrReqMoney())) + if (quest->GetRewOrReqMoney() < 0 && !HasEnoughMoney(-int64(quest->GetRewOrReqMoney()))) return false; return true; @@ -16755,7 +16755,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) // load achievements before anything else to prevent multiple gains for the same achievement/criteria on every loading (as loading does call UpdateAchievementCriteria) m_achievementMgr.LoadFromDB(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADACHIEVEMENTS), holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADCRITERIAPROGRESS)); - uint32 money = fields[8].GetUInt32(); + uint64 money = fields[8].GetUInt64(); if (money > MAX_MONEY_AMOUNT) money = MAX_MONEY_AMOUNT; SetMoney(money); @@ -18647,7 +18647,7 @@ void Player::SaveToDB(bool create /*=false*/) stmt->setUInt8(index++, getGender()); stmt->setUInt8(index++, getLevel()); stmt->setUInt32(index++, GetUInt32Value(PLAYER_XP)); - stmt->setUInt32(index++, GetMoney()); + stmt->setUInt64(index++, GetMoney()); stmt->setUInt32(index++, GetUInt32Value(PLAYER_BYTES)); stmt->setUInt32(index++, GetUInt32Value(PLAYER_BYTES_2)); stmt->setUInt32(index++, GetUInt32Value(PLAYER_FLAGS)); @@ -18755,7 +18755,7 @@ void Player::SaveToDB(bool create /*=false*/) stmt->setUInt8(index++, getGender()); stmt->setUInt8(index++, getLevel()); stmt->setUInt32(index++, GetUInt32Value(PLAYER_XP)); - stmt->setUInt32(index++, GetMoney()); + stmt->setUInt64(index++, GetMoney()); stmt->setUInt32(index++, GetUInt32Value(PLAYER_BYTES)); stmt->setUInt32(index++, GetUInt32Value(PLAYER_BYTES_2)); stmt->setUInt32(index++, GetUInt32Value(PLAYER_FLAGS)); @@ -18921,7 +18921,7 @@ void Player::SaveInventoryAndGoldToDB(SQLTransaction& trans) void Player::SaveGoldToDB(SQLTransaction& trans) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UDP_CHAR_MONEY); - stmt->setUInt32(0, GetMoney()); + stmt->setUInt64(0, GetMoney()); stmt->setUInt32(1, GetGUIDLow()); trans->Append(stmt); } @@ -20772,7 +20772,7 @@ bool Player::ActivateTaxiPathTo(std::vector const& nodes, Creature* npc return false; } - uint32 money = GetMoney(); + uint64 money = GetMoney(); if (npc) totalcost = (uint32)ceil(totalcost*GetReputationPriceDiscount(npc)); @@ -20785,7 +20785,7 @@ bool Player::ActivateTaxiPathTo(std::vector const& nodes, Creature* npc } //Checks and preparations done, DO FLIGHT - ModifyMoney(-(int32)totalcost); + ModifyMoney(-int64(totalcost)); UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TRAVELLING, totalcost); UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_FLIGHT_PATHS_TAKEN, 1); @@ -21161,7 +21161,7 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32 // reputation discount price = uint32(floor(price * GetReputationPriceDiscount(creature))); - if (!HasEnoughMoney(price)) + if (!HasEnoughMoney(uint64(price))) { SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, creature, item, 0); return false; @@ -21949,16 +21949,16 @@ void Player::InitPrimaryProfessions() SetFreePrimaryProfessions(sWorld->getIntConfig(CONFIG_MAX_PRIMARY_TRADE_SKILL)); } -void Player::ModifyMoney(int32 d) +void Player::ModifyMoney(int64 d) { sScriptMgr->OnPlayerMoneyChanged(this, d); if (d < 0) - SetMoney (GetMoney() > uint32(-d) ? GetMoney() + d : 0); + SetMoney (GetMoney() > uint64(-d) ? GetMoney() + d : 0); else { - uint32 newAmount = 0; - if (GetMoney() < uint32(MAX_MONEY_AMOUNT - d)) + uint64 newAmount = 0; + if (GetMoney() < uint64(MAX_MONEY_AMOUNT - d)) newAmount = GetMoney() + d; else { @@ -21967,7 +21967,7 @@ void Player::ModifyMoney(int32 d) if (d) SendEquipError(EQUIP_ERR_TOO_MUCH_GOLD, NULL, NULL); } - SetMoney (newAmount); + SetMoney(newAmount); } } diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index b9261aaff64..ded63b024b8 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -832,7 +832,7 @@ enum PlayerDelayedOperations // Player summoning auto-decline time (in secs) #define MAX_PLAYER_SUMMON_DELAY (2*MINUTE) -#define MAX_MONEY_AMOUNT (0x7FFFFFFF-1) +#define MAX_MONEY_AMOUNT (UI64LIT(9999999999)) // TODO: Move this restriction to worldserver.conf, default to this value, hardcap at uint64.max struct InstancePlayerBind { @@ -1000,8 +1000,8 @@ class TradeData Item* GetSpellCastItem() const; bool HasSpellCastItem() const { return m_spellCastItem != 0; } - uint32 GetMoney() const { return m_money; } - void SetMoney(uint32 money); + uint64 GetMoney() const { return m_money; } + void SetMoney(uint64 money); bool IsAccepted() const { return m_accepted; } void SetAccepted(bool state, bool crosssend = false); @@ -1021,7 +1021,7 @@ class TradeData bool m_accepted; // m_player press accept for trade list bool m_acceptProccess; // one from player/trader press accept and this processed - uint32 m_money; // m_player place money to trade + uint64 m_money; // m_player place money to trade uint32 m_spell; // m_player apply spell to non-traded slot item uint64 m_spellCastItem; // applied spell casted by item use @@ -1590,19 +1590,19 @@ class Player : public Unit, public GridObject void setRegenTimerCount(uint32 time) {m_regenTimerCount = time;} void setWeaponChangeTimer(uint32 time) {m_weaponChangeTimer = time;} - uint32 GetMoney() const { return GetUInt32Value(PLAYER_FIELD_COINAGE); } - void ModifyMoney(int32 d); - bool HasEnoughMoney(uint32 amount) const { return (GetMoney() >= amount); } - bool HasEnoughMoney(int32 amount) const + uint64 GetMoney() const { return GetUInt64Value(PLAYER_FIELD_COINAGE); } + void ModifyMoney(int64 d); + bool HasEnoughMoney(uint64 amount) const { return GetMoney() >= amount; } + bool HasEnoughMoney(int64 amount) const { if (amount > 0) - return (GetMoney() >= (uint32) amount); + return (GetMoney() >= (uint64)amount); return true; } - void SetMoney(uint32 value) + void SetMoney(uint64 value) { - SetUInt32Value(PLAYER_FIELD_COINAGE, value); + SetUInt64Value(PLAYER_FIELD_COINAGE, value); MoneyChanged(value); UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_GOLD_VALUE_OWNED); } diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 8cb0a397b8d..ac4802a3091 100755 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -1322,12 +1322,12 @@ void Guild::HandleSetEmblem(WorldSession* session, const EmblemInfo& emblemInfo) if (!_IsLeader(player)) // "Only guild leaders can create emblems." SendSaveEmblemResult(session, ERR_GUILDEMBLEM_NOTGUILDMASTER); - else if (!player->HasEnoughMoney(EMBLEM_PRICE)) + else if (!player->HasEnoughMoney(uint64(EMBLEM_PRICE))) // "You can't afford to do that." SendSaveEmblemResult(session, ERR_GUILDEMBLEM_NOTENOUGHMONEY); else { - player->ModifyMoney(-int32(EMBLEM_PRICE)); + player->ModifyMoney(-int64(EMBLEM_PRICE)); m_emblemInfo = emblemInfo; m_emblemInfo.SaveToDB(m_id); @@ -1418,13 +1418,13 @@ void Guild::HandleBuyBankTab(WorldSession* session, uint8 tabId) return; Player* player = session->GetPlayer(); - if (!player->HasEnoughMoney(tabCost)) // Should not happen, this is checked by client + if (!player->HasEnoughMoney(uint64(tabCost))) // Should not happen, this is checked by client return; if (!_CreateNewBankTab()) return; - player->ModifyMoney(-int32(tabCost)); + player->ModifyMoney(-int64(tabCost)); _SetRankBankMoneyPerDay(player->GetRank(), uint32(GUILD_WITHDRAW_MONEY_UNLIMITED)); _SetRankBankTabRightsAndSlots(player->GetRank(), tabId, GuildBankRightsAndSlots(GUILD_BANK_RIGHT_FULL, uint32(GUILD_WITHDRAW_SLOT_UNLIMITED))); HandleRoster(); // Broadcast for tab rights update @@ -1652,13 +1652,13 @@ void Guild::HandleMemberDepositMoney(WorldSession* session, uint32 amount) // Add money to bank _ModifyBankMoney(trans, amount, true); // Remove money from player - player->ModifyMoney(-int32(amount)); + player->ModifyMoney(-int64(amount)); player->SaveGoldToDB(trans); // Log GM action (TODO: move to scripts) if (!AccountMgr::IsPlayerAccount(player->GetSession()->GetSecurity()) && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE)) { sLog->outCommand(player->GetSession()->GetAccountId(), - "GM %s (Account: %u) deposit money (Amount: %u) to guild bank (Guild ID %u)", + "GM %s (Account: %u) deposit money (Amount: " UI64FMTD ") to guild bank (Guild ID %u)", player->GetName(), player->GetSession()->GetAccountId(), amount, m_id); } // Log guild bank event diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp index c40d3d7964b..52f0793e73c 100755 --- a/src/server/game/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Handlers/AuctionHouseHandler.cpp @@ -225,7 +225,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data) AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction()); uint32 deposit = sAuctionMgr->GetAuctionDeposit(auctionHouseEntry, etime, item, finalCount); - if (!_player->HasEnoughMoney(deposit)) + if (!_player->HasEnoughMoney((uint64)deposit)) { SendAuctionCommandResult(0, AUCTION_SELL_ITEM, AUCTION_NOT_ENOUGHT_MONEY); return; @@ -412,7 +412,7 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket& recv_data) return; } - if (!player->HasEnoughMoney((uint32)price)) + if (!player->HasEnoughMoney(price)) { //you don't have enought money!, client tests! //SendAuctionCommandResult(auction->auctionId, AUCTION_PLACE_BID, ???); @@ -426,16 +426,16 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket& recv_data) if (auction->bidder > 0) { if (auction->bidder == player->GetGUIDLow()) - player->ModifyMoney(-int32(price - auction->bid)); + player->ModifyMoney(-int64(price - auction->bid)); else { // mail to last bidder and return money sAuctionMgr->SendAuctionOutbiddedMail(auction, price, GetPlayer(), trans); - player->ModifyMoney(-int32(price)); + player->ModifyMoney(-int64(price)); } } else - player->ModifyMoney(-int32(price)); + player->ModifyMoney(-int64(price)); auction->bidder = player->GetGUIDLow(); auction->bid = price; @@ -453,10 +453,10 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket& recv_data) { //buyout: if (player->GetGUIDLow() == auction->bidder) - player->ModifyMoney(-int32(auction->buyout - auction->bid)); + player->ModifyMoney(-int64(auction->buyout - auction->bid)); else { - player->ModifyMoney(-int32(auction->buyout)); + player->ModifyMoney(-int64(auction->buyout)); if (auction->bidder) //buyout for bidded auction .. sAuctionMgr->SendAuctionOutbiddedMail(auction, auction->buyout, GetPlayer(), trans); } @@ -516,11 +516,11 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recv_data) if (auction->bidder > 0) // If we have a bidder, we have to send him the money he paid { uint32 auctionCut = auction->GetAuctionCut(); - if (!player->HasEnoughMoney(auctionCut)) //player doesn't have enough money, maybe message needed + if (!player->HasEnoughMoney((uint64)auctionCut)) //player doesn't have enough money, maybe message needed return; //some auctionBidderNotification would be needed, but don't know that parts.. sAuctionMgr->SendAuctionCancelledToBidderMail(auction, trans); - player->ModifyMoney(-int32(auctionCut)); + player->ModifyMoney(-int64(auctionCut)); } // item will deleted or added to received mail list diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 9a77c3da55c..01668314c63 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -1387,12 +1387,12 @@ void WorldSession::HandleAlterAppearance(WorldPacket & recv_data) if (bs_skinColor && (bs_skinColor->type != 3 || bs_skinColor->race != _player->getRace() || bs_skinColor->gender != _player->getGender())) return; - uint32 Cost = _player->GetBarberShopCost(bs_hair->hair_id, Color, bs_facialHair->hair_id, bs_skinColor); + uint32 cost = _player->GetBarberShopCost(bs_hair->hair_id, Color, bs_facialHair->hair_id, bs_skinColor); // 0 - ok // 1, 3 - not enough money // 2 - you have to seat on barber chair - if (!_player->HasEnoughMoney(Cost)) + if (!_player->HasEnoughMoney((uint64)cost)) { WorldPacket data(SMSG_BARBER_SHOP_RESULT, 4); data << uint32(1); // no money @@ -1406,8 +1406,8 @@ void WorldSession::HandleAlterAppearance(WorldPacket & recv_data) SendPacket(&data); } - _player->ModifyMoney(-int32(Cost)); // it isn't free - _player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_AT_BARBER, Cost); + _player->ModifyMoney(-int64(cost)); // it isn't free + _player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_AT_BARBER, cost); _player->SetByteValue(PLAYER_BYTES, 2, uint8(bs_hair->hair_id)); _player->SetByteValue(PLAYER_BYTES, 3, uint8(Color)); diff --git a/src/server/game/Handlers/GuildHandler.cpp b/src/server/game/Handlers/GuildHandler.cpp index 9d91feabcf6..53862e99db9 100755 --- a/src/server/game/Handlers/GuildHandler.cpp +++ b/src/server/game/Handlers/GuildHandler.cpp @@ -396,13 +396,13 @@ void WorldSession::HandleGuildBankDepositMoney(WorldPacket & recv_data) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (CMSG_GUILD_BANK_DEPOSIT_MONEY)"); - uint64 GoGuid; - recv_data >> GoGuid; + uint64 goGuid; + recv_data >> goGuid; - uint32 money; + uint64 money; recv_data >> money; - if (GetPlayer()->GetGameObjectIfCanInteractWith(GoGuid, GAMEOBJECT_TYPE_GUILD_BANK)) + if (GetPlayer()->GetGameObjectIfCanInteractWith(goGuid, GAMEOBJECT_TYPE_GUILD_BANK)) if (money && GetPlayer()->HasEnoughMoney(money)) if (Guild* guild = _GetPlayerGuild(this)) guild->HandleMemberDepositMoney(this, money); diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 6a33238e750..bcb3601ee48 100755 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -624,7 +624,7 @@ void WorldSession::HandleBuybackItem(WorldPacket & recv_data) if (pItem) { uint32 price = _player->GetUInt32Value(PLAYER_FIELD_BUYBACK_PRICE_1 + slot - BUYBACK_SLOT_START); - if (!_player->HasEnoughMoney(price)) + if (!_player->HasEnoughMoney(uint64(price))) { _player->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, creature, pItem->GetEntry(), 0); return; @@ -934,7 +934,7 @@ void WorldSession::HandleBuyBankSlotOpcode(WorldPacket& recvPacket) uint32 price = slotEntry->price; - if (!_player->HasEnoughMoney(price)) + if (!_player->HasEnoughMoney(uint64(price))) { data << uint32(ERR_BANKSLOT_INSUFFICIENT_FUNDS); SendPacket(&data); @@ -942,7 +942,7 @@ void WorldSession::HandleBuyBankSlotOpcode(WorldPacket& recvPacket) } _player->SetBankBagSlotCount(slot); - _player->ModifyMoney(-int32(price)); + _player->ModifyMoney(-int64(price)); data << uint32(ERR_BANKSLOT_OK); SendPacket(&data); diff --git a/src/server/game/Handlers/MailHandler.cpp b/src/server/game/Handlers/MailHandler.cpp index 158fb9b8f55..ba6646a92f9 100755 --- a/src/server/game/Handlers/MailHandler.cpp +++ b/src/server/game/Handlers/MailHandler.cpp @@ -105,7 +105,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data) uint32 cost = items_count ? 30 * items_count : 30; // price hardcoded in client - uint32 reqmoney = cost + money; + uint64 reqmoney = cost + uint64(money); if (!player->HasEnoughMoney(reqmoney) && !player->isGameMaster()) { @@ -439,7 +439,7 @@ void WorldSession::HandleMailTakeItem(WorldPacket & recv_data) } // prevent cheating with skip client money check - if (!player->HasEnoughMoney(m->COD)) + if (!player->HasEnoughMoney(uint64(m->COD))) { player->SendMailResult(mailId, MAIL_ITEM_TAKEN, MAIL_ERR_NOT_ENOUGH_MONEY); return; diff --git a/src/server/game/Handlers/NPCHandler.cpp b/src/server/game/Handlers/NPCHandler.cpp index 4da8805614b..e9b070b2aa2 100755 --- a/src/server/game/Handlers/NPCHandler.cpp +++ b/src/server/game/Handlers/NPCHandler.cpp @@ -277,10 +277,10 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket & recv_data) uint32 nSpellCost = uint32(floor(trainer_spell->spellCost * _player->GetReputationPriceDiscount(unit))); // check money requirement - if (!_player->HasEnoughMoney(nSpellCost)) + if (!_player->HasEnoughMoney(uint64(nSpellCost))) return; - _player->ModifyMoney(-int32(nSpellCost)); + _player->ModifyMoney(-int64(nSpellCost)); unit->SendPlaySpellVisual(179); // 53 SpellCastDirected unit->SendPlaySpellImpact(_player->GetGUID(), 362); // 113 EmoteSalute diff --git a/src/server/game/Handlers/PetitionsHandler.cpp b/src/server/game/Handlers/PetitionsHandler.cpp index 0c2f8741b15..b8e275f2990 100755 --- a/src/server/game/Handlers/PetitionsHandler.cpp +++ b/src/server/game/Handlers/PetitionsHandler.cpp @@ -187,7 +187,7 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data) return; } - if (!_player->HasEnoughMoney(cost)) + if (!_player->HasEnoughMoney(uint64(cost))) { //player hasn't got enough money _player->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, creature, charterid, 0); return; diff --git a/src/server/game/Handlers/TradeHandler.cpp b/src/server/game/Handlers/TradeHandler.cpp index b2a89ed3021..c42ef3ef94a 100755 --- a/src/server/game/Handlers/TradeHandler.cpp +++ b/src/server/game/Handlers/TradeHandler.cpp @@ -477,9 +477,9 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/) } // update money - _player->ModifyMoney(-int32(my_trade->GetMoney())); + _player->ModifyMoney(-int64(my_trade->GetMoney())); _player->ModifyMoney(his_trade->GetMoney()); - trader->ModifyMoney(-int32(his_trade->GetMoney())); + trader->ModifyMoney(-int64(his_trade->GetMoney())); trader->ModifyMoney(my_trade->GetMoney()); if (my_spell) @@ -676,7 +676,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket) void WorldSession::HandleSetTradeGoldOpcode(WorldPacket& recvPacket) { - uint32 gold; + uint64 gold; recvPacket >> gold; TradeData* my_trade = _player->GetTradeData(); diff --git a/src/server/game/Mails/Mail.h b/src/server/game/Mails/Mail.h index 63676e20be9..b4e5b9ddf48 100755 --- a/src/server/game/Mails/Mail.h +++ b/src/server/game/Mails/Mail.h @@ -123,8 +123,8 @@ class MailDraft public: // Accessors uint16 GetMailTemplateId() const { return m_mailTemplateId; } std::string const& GetSubject() const { return m_subject; } - uint32 GetMoney() const { return m_money; } - uint32 GetCOD() const { return m_COD; } + uint64 GetMoney() const { return m_money; } + uint64 GetCOD() const { return m_COD; } std::string const& GetBody() const { return m_body; } public: // modifiers @@ -172,8 +172,8 @@ struct Mail std::vector removedItems; time_t expire_time; time_t deliver_time; - uint32 money; - uint32 COD; + uint64 money; + uint64 COD; uint32 checked; MailState state; diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index 23d18e12097..f567dd2963b 100755 --- a/src/server/game/Scripting/ScriptMgr.cpp +++ b/src/server/game/Scripting/ScriptMgr.cpp @@ -1224,7 +1224,7 @@ void ScriptMgr::OnPlayerTalentsReset(Player* player, bool noCost) FOREACH_SCRIPT(PlayerScript)->OnTalentsReset(player, noCost); } -void ScriptMgr::OnPlayerMoneyChanged(Player* player, int32& amount) +void ScriptMgr::OnPlayerMoneyChanged(Player* player, int64& amount) { FOREACH_SCRIPT(PlayerScript)->OnMoneyChanged(player, amount); } diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h index b3d445af0c6..37a26d6e5c2 100755 --- a/src/server/game/Scripting/ScriptMgr.h +++ b/src/server/game/Scripting/ScriptMgr.h @@ -684,7 +684,7 @@ class PlayerScript : public ScriptObject virtual void OnTalentsReset(Player* /*player*/, bool /*noCost*/) { } // Called when a player's money is modified (before the modification is done) - virtual void OnMoneyChanged(Player* /*player*/, int32& /*amount*/) { } + virtual void OnMoneyChanged(Player* /*player*/, int64& /*amount*/) { } // Called when a player gains XP (before anything is given) virtual void OnGiveXP(Player* /*player*/, uint32& /*amount*/, Unit* /*victim*/) { } @@ -990,7 +990,7 @@ class ScriptMgr void OnPlayerLevelChanged(Player* player, uint8 oldLevel); void OnPlayerFreeTalentPointsChanged(Player* player, uint32 newPoints); void OnPlayerTalentsReset(Player* player, bool noCost); - void OnPlayerMoneyChanged(Player* player, int32& amount); + void OnPlayerMoneyChanged(Player* player, int64& amount); void OnGivePlayerXP(Player* player, uint32& amount, Unit* victim); void OnPlayerReputationChange(Player* player, uint32 factionID, int32& standing, bool incremental); void OnPlayerDuelRequest(Player* target, Player* challenger); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index c725b6214e0..c2d7a96a397 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -1080,7 +1080,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_LOOT_ITEM_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOOT_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOOT_MASTER_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LOOT_MONEY_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOOT_MONEY_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOOT_RELEASE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOOT_REMOVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOOT_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 5b89abe3b24..183602b1124 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -774,11 +774,11 @@ void World::LoadConfigSettings(bool reload) sLog->outError("StartPlayerMoney (%i) must be in range 0..%u. Set to %u.", m_int_configs[CONFIG_START_PLAYER_MONEY], MAX_MONEY_AMOUNT, 0); m_int_configs[CONFIG_START_PLAYER_MONEY] = 0; } - else if (m_int_configs[CONFIG_START_PLAYER_MONEY] > MAX_MONEY_AMOUNT) + else if (m_int_configs[CONFIG_START_PLAYER_MONEY] > 0x7FFFFFFF-1) // TODO: (See MAX_MONEY_AMOUNT) { sLog->outError("StartPlayerMoney (%i) must be in range 0..%u. Set to %u.", - m_int_configs[CONFIG_START_PLAYER_MONEY], MAX_MONEY_AMOUNT, MAX_MONEY_AMOUNT); - m_int_configs[CONFIG_START_PLAYER_MONEY] = MAX_MONEY_AMOUNT; + m_int_configs[CONFIG_START_PLAYER_MONEY], 0x7FFFFFFF-1, 0x7FFFFFFF-1); + m_int_configs[CONFIG_START_PLAYER_MONEY] = 0x7FFFFFFF-1; } m_int_configs[CONFIG_MAX_HONOR_POINTS] = ConfigMgr::GetIntDefault("MaxHonorPoints", 75000); diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index 57d13fd2fa1..a227070895c 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -25,6 +25,7 @@ EndScriptData */ #include "ScriptMgr.h" #include "ObjectMgr.h" #include "Chat.h" +#include class modify_commandscript : public CommandScript { @@ -1002,13 +1003,13 @@ public: if (handler->HasLowerSecurity(target, 0)) return false; - int32 addmoney = atoi((char*)args); + int64 addmoney = atoll((char*)args); - uint32 moneyuser = target->GetMoney(); + uint64 moneyuser = target->GetMoney(); if (addmoney < 0) { - int32 newmoney = int32(moneyuser) + addmoney; + int64 newmoney = int32(moneyuser) + addmoney; sLog->outDetail(handler->GetTrinityString(LANG_CURRENT_MONEY), moneyuser, addmoney, newmoney); if (newmoney <= 0) diff --git a/src/server/scripts/World/npc_professions.cpp b/src/server/scripts/World/npc_professions.cpp index 2afa80dd42c..a55fe2c7ffa 100644 --- a/src/server/scripts/World/npc_professions.cpp +++ b/src/server/scripts/World/npc_professions.cpp @@ -209,7 +209,7 @@ int32 DoLowUnlearnCost(Player* player) //blacksmith void ProcessCastaction(Player* player, Creature* creature, uint32 spellId, uint32 triggeredSpellId, int32 cost) { - if (!(spellId && player->HasSpell(spellId)) && player->HasEnoughMoney(cost)) + if (!(spellId && player->HasSpell(spellId)) && player->HasEnoughMoney((int64)cost)) { player->CastSpell(player, triggeredSpellId, true); player->ModifyMoney(-cost); @@ -347,11 +347,11 @@ void ProcessUnlearnAction(Player* player, Creature* creature, uint32 spellId, ui { if (EquippedOk(player, spellId)) { - if (player->HasEnoughMoney(cost)) + if (player->HasEnoughMoney(int64(cost))) { player->CastSpell(player, spellId, true); ProfessionUnlearnSpells(player, spellId); - player->ModifyMoney(-cost); + player->ModifyMoney(-int64(cost)); if (alternativeSpellId) creature->CastSpell(player, alternativeSpellId, true); } diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index 57a65423b6f..04b74122955 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -1287,7 +1287,7 @@ public: case GOSSIP_OPTION_LEARNDUALSPEC: if (player->GetSpecsCount() == 1 && !(player->getLevel() < sWorld->getIntConfig(CONFIG_MIN_DUALSPEC_LEVEL))) { - if (!player->HasEnoughMoney(10000000)) + if (!player->HasEnoughMoney(UI64LIT(10000000))) { player->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, 0, 0, 0); player->PlayerTalkClass->SendCloseGossip(); @@ -1295,7 +1295,7 @@ public: } else { - player->ModifyMoney(-10000000); + player->ModifyMoney(SI64LIT(-10000000)); // Cast spells that teach dual spec // Both are also ImplicitTarget self and must be cast by player @@ -2600,11 +2600,11 @@ public: } if (doSwitch) { - if (!player->HasEnoughMoney(EXP_COST)) + if (!player->HasEnoughMoney(uint64(EXP_COST))) player->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, 0, 0, 0); else if (noXPGain) { - player->ModifyMoney(-EXP_COST); + player->ModifyMoney(-int64(EXP_COST)); player->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN); } else if (!noXPGain) diff --git a/src/server/shared/Common.h b/src/server/shared/Common.h index 259c60ade20..7a16f2a0eb3 100755 --- a/src/server/shared/Common.h +++ b/src/server/shared/Common.h @@ -116,7 +116,7 @@ #define I32FMT "%08I32X" #define I64FMT "%016I64X" #define snprintf _snprintf -#define atoll __atoi64 +#define atoll _atoi64 #define vsnprintf _vsnprintf #define finite(X) _finite(X) #define llabs _abs64 -- cgit v1.2.3 From 6dd20770af0681e6bfa9105e41b3b8edd1ff4712 Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 24 Jul 2012 15:47:47 +0100 Subject: Core/Misc: Few more missed chances related to money Expect more commits like this :/ --- src/server/game/Entities/Player/Player.cpp | 6 +++--- src/server/game/Globals/ObjectMgr.cpp | 2 +- src/server/game/Mails/Mail.h | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 9847d22f84e..56c3915bd65 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -4730,7 +4730,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC uint32 sender = mailFields[3].GetUInt32(); std::string subject = mailFields[4].GetString(); std::string body = mailFields[5].GetString(); - uint32 money = mailFields[6].GetUInt32(); + uint64 money = mailFields[6].GetUInt64(); bool has_items = mailFields[7].GetBool(); // We can return mail now @@ -17868,8 +17868,8 @@ void Player::_LoadMail() bool has_items = fields[6].GetBool(); m->expire_time = time_t(fields[7].GetUInt32()); m->deliver_time = time_t(fields[8].GetUInt32()); - m->money = fields[9].GetUInt32(); - m->COD = fields[10].GetUInt32(); + m->money = fields[9].GetUInt64(); + m->COD = fields[10].GetUInt64(); m->checked = fields[11].GetUInt8(); m->stationery = fields[12].GetUInt8(); m->mailTemplateId = fields[13].GetInt16(); diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index e2ca53487e7..79e29ff2761 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -5449,7 +5449,7 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp) bool has_items = fields[4].GetBool(); m->expire_time = time_t(fields[5].GetUInt32()); m->deliver_time = 0; - m->COD = fields[6].GetUInt32(); + m->COD = fields[6].GetUInt64(); m->checked = fields[7].GetUInt8(); m->mailTemplateId = fields[8].GetInt16(); diff --git a/src/server/game/Mails/Mail.h b/src/server/game/Mails/Mail.h index b4e5b9ddf48..445d95c5112 100755 --- a/src/server/game/Mails/Mail.h +++ b/src/server/game/Mails/Mail.h @@ -129,7 +129,7 @@ class MailDraft public: // modifiers MailDraft& AddItem(Item* item); - MailDraft& AddMoney(uint32 money) { m_money = money; return *this; } + MailDraft& AddMoney(uint64 money) { m_money = money; return *this; } MailDraft& AddCOD(uint32 COD) { m_COD = COD; return *this; } public: // finishers @@ -147,8 +147,8 @@ class MailDraft MailItemMap m_items; // Keep the items in a map to avoid duplicate guids (which can happen), store only low part of guid - uint32 m_money; - uint32 m_COD; + uint64 m_money; + uint64 m_COD; }; struct MailItemInfo -- cgit v1.2.3 From 62015f79a5980a21f2b10ad264ecd923fd62bd38 Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 24 Jul 2012 16:52:13 +0100 Subject: Core/PacketIO: Fix and enable few trade related opcs --- src/server/game/Handlers/TradeHandler.cpp | 47 ++++++++++++++--------------- src/server/game/Server/Protocol/Opcodes.cpp | 20 ++++++------ 2 files changed, 32 insertions(+), 35 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/TradeHandler.cpp b/src/server/game/Handlers/TradeHandler.cpp index c42ef3ef94a..318325b4e57 100755 --- a/src/server/game/Handlers/TradeHandler.cpp +++ b/src/server/game/Handlers/TradeHandler.cpp @@ -519,28 +519,8 @@ void WorldSession::HandleUnacceptTradeOpcode(WorldPacket& /*recvPacket*/) my_trade->SetAccepted(false, true); } -void WorldSession::HandleBeginTradeOpcode(WorldPacket& recvPacket) +void WorldSession::HandleBeginTradeOpcode(WorldPacket& /*recvPacket*/) { -/* - TODO: Need to verify - - BitStream mask = recvPacket.ReadBitStream(8); - - ByteBuffer bytes(8, true); - - recvPacket.ReadXorByte(mask[0], bytes[5]); - recvPacket.ReadXorByte(mask[4], bytes[2]); - recvPacket.ReadXorByte(mask[5], bytes[3]); - recvPacket.ReadXorByte(mask[2], bytes[4]); - recvPacket.ReadXorByte(mask[7], bytes[1]); - recvPacket.ReadXorByte(mask[3], bytes[0]); - recvPacket.ReadXorByte(mask[1], bytes[6]); - recvPacket.ReadXorByte(mask[6], bytes[7]); - - uint64 tradeGuid = BitConverter::ToUInt64(bytes); -*/ - recvPacket.rfinish(); - TradeData* my_trade = _player->m_trade; if (!my_trade) return; @@ -559,15 +539,32 @@ void WorldSession::SendCancelTrade() void WorldSession::HandleCancelTradeOpcode(WorldPacket& /*recvPacket*/) { - // sended also after LOGOUT COMPLETE + // sent also after LOGOUT COMPLETE if (_player) // needed because STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT _player->TradeCancel(true); } void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket) { - uint64 ID; - recvPacket >> ID; + ObjectGuid guid; + + guid[0] = recvPacket.ReadBit(); + guid[3] = recvPacket.ReadBit(); + guid[5] = recvPacket.ReadBit(); + guid[1] = recvPacket.ReadBit(); + guid[4] = recvPacket.ReadBit(); + guid[6] = recvPacket.ReadBit(); + guid[7] = recvPacket.ReadBit(); + guid[2] = recvPacket.ReadBit(); + + recvPacket.ReadByteSeq(guid[7]); + recvPacket.ReadByteSeq(guid[4]); + recvPacket.ReadByteSeq(guid[3]); + recvPacket.ReadByteSeq(guid[5]); + recvPacket.ReadByteSeq(guid[1]); + recvPacket.ReadByteSeq(guid[2]); + recvPacket.ReadByteSeq(guid[6]); + recvPacket.ReadByteSeq(guid[0]); if (GetPlayer()->m_trade) return; @@ -602,7 +599,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket) return; } - Player* pOther = ObjectAccessor::FindPlayer(ID); + Player* pOther = ObjectAccessor::FindPlayer(guid); if (!pOther) { diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index c2d7a96a397..d56bc0ff97e 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -42,7 +42,7 @@ void InitOpcodes() memset(opcodeTable, 0, sizeof(opcodeTable)); //DEFINE_OPCODE_HANDLER(CMSG_ACCEPT_LEVEL_GRANT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAcceptGrantLevel ); - //DEFINE_OPCODE_HANDLER(CMSG_ACCEPT_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAcceptTradeOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_ACCEPT_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAcceptTradeOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_ACTIVATETAXI, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleActivateTaxiOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_ACTIVATETAXIEXPRESS, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleActivateTaxiExpressOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_ACTIVE_PVP_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -104,13 +104,13 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_JOIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlemasterJoinOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_JOIN_ARENA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlemasterJoinArena ); //DEFINE_OPCODE_HANDLER(CMSG_BEASTMASTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_BEGIN_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBeginTradeOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_BEGIN_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBeginTradeOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_BINDER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBinderActivateOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_BOOTME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_BOT_DETECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_BOT_DETECTED2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_BUG, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBugOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_BUSY_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBusyTradeOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_BUSY_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBusyTradeOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_BUYBACK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuybackItem ); //DEFINE_OPCODE_HANDLER(CMSG_BUY_BANK_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyBankSlotOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_BUY_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyItemOpcode ); @@ -141,7 +141,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_GROWTH_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelGrowthAuraOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_MOUNT_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelMountAuraOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_TEMP_ENCHANTMENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelTempEnchantmentOpcode); - //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_TRADE, STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelTradeOpcode); + DEFINE_OPCODE_HANDLER(CMSG_CANCEL_TRADE, STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelTradeOpcode); DEFINE_OPCODE_HANDLER(CMSG_CAST_SPELL, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleCastSpellOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_CHANGEPLAYER_DIFFICULTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CHANGE_GDF_ARENA_RATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -191,7 +191,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_QUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_RANDOM_BG_WIN_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_SERVER_BUCK_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_TRADE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleClearTradeItemOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_CLEAR_TRADE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleClearTradeItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_ENTER_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_EXIT_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -324,7 +324,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_GUILD_ADD_RANK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildAddRankOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANKER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankerActivate ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_BUY_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankBuyTab ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_DEPOSIT_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankDepositMoney ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_DEPOSIT_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankDepositMoney ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_MONEY_WITHDRAWN_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankMoneyWithdrawn ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_QUERY_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankQueryTab ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_SWAP_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankSwapItems ); @@ -353,7 +353,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_KNOCKBACK_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_REQUIREMENTS_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleIgnoreTradeOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_INITIATE_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInitiateTradeOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_INITIATE_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInitiateTradeOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_INSPECT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_INSTANCE_LOCK_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInstanceLockResponse ); //DEFINE_OPCODE_HANDLER(CMSG_ITEM_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemNameQueryOpcode ); @@ -608,8 +608,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_SET_TAXI_BENCHMARK_MODE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTaxiBenchmarkOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SET_TITLE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTitleOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SET_TITLE_SUFFIX, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_TRADE_GOLD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTradeGoldOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_TRADE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTradeItemOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_SET_TRADE_GOLD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTradeGoldOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_SET_TRADE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTradeItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SET_VEHICLE_REC_ID_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_WATCHED_FACTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetWatchedFactionOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SET_WORLDSTATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -657,7 +657,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_CLEAR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialClear ); //DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_FLAG, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialFlag ); //DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_RESET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialReset ); - //DEFINE_OPCODE_HANDLER(CMSG_UNACCEPT_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnacceptTradeOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_UNACCEPT_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnacceptTradeOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_UNCLAIM_LICENSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_UNDRESSPLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_UNITANIMTIER_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); -- cgit v1.2.3 From 443f1e71d8660307ebf17f20abc954bf4b9eba74 Mon Sep 17 00:00:00 2001 From: kaelima Date: Wed, 25 Jul 2012 11:59:05 +0200 Subject: Core/PacketIO: Fix a couple of spline packets --- src/server/game/Entities/Creature/Creature.cpp | 147 +++++++++++++++++++++++-- src/server/game/Entities/Unit/Unit.cpp | 38 ++++++- src/server/game/Server/Protocol/Opcodes.cpp | 16 +-- src/server/game/Server/Protocol/Opcodes.h | 23 ++-- 4 files changed, 194 insertions(+), 30 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 9fd48bfc320..6d0dee92e38 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -2480,9 +2480,52 @@ bool Creature::SetWalk(bool enable) if (!Unit::SetWalk(enable)) return false; - WorldPacket data(enable ? SMSG_SPLINE_MOVE_SET_WALK_MODE : SMSG_SPLINE_MOVE_SET_RUN_MODE, 9); - data.append(GetPackGUID()); - SendMessageToSet(&data, false); + ObjectGuid guid = GetGUID(); + if (enable) + { + WorldPacket data(SMSG_SPLINE_MOVE_SET_WALK_MODE, 9); + data.WriteBit(guid[7]); + data.WriteBit(guid[6]); + data.WriteBit(guid[5]); + data.WriteBit(guid[1]); + data.WriteBit(guid[3]); + data.WriteBit(guid[4]); + data.WriteBit(guid[2]); + data.WriteBit(guid[0]); + data.FlushBits(); + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[6]); + data.WriteByteSeq(guid[5]); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[3]); + SendMessageToSet(&data, false); + } + else + { + WorldPacket data(SMSG_SPLINE_MOVE_SET_RUN_MODE, 9); + data.WriteBit(guid[5]); + data.WriteBit(guid[6]); + data.WriteBit(guid[3]); + data.WriteBit(guid[2]); + data.WriteBit(guid[0]); + data.WriteBit(guid[7]); + data.WriteBit(guid[4]); + data.WriteBit(guid[1]); + data.FlushBits(); + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[6]); + data.WriteByteSeq(guid[5]); + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[3]); + SendMessageToSet(&data, false); + } + return true; } @@ -2496,9 +2539,52 @@ bool Creature::SetDisableGravity(bool disable, bool packetOnly/*=false*/) if (!movespline->Initialized()) return true; - WorldPacket data(disable ? SMSG_SPLINE_MOVE_GRAVITY_DISABLE : SMSG_SPLINE_MOVE_GRAVITY_ENABLE, 9); - data.append(GetPackGUID()); - SendMessageToSet(&data, false); + ObjectGuid guid = GetGUID(); + if (disable) + { + WorldPacket data(SMSG_SPLINE_MOVE_GRAVITY_DISABLE, 9); + data.WriteBit(guid[7]); + data.WriteBit(guid[3]); + data.WriteBit(guid[4]); + data.WriteBit(guid[2]); + data.WriteBit(guid[5]); + data.WriteBit(guid[1]); + data.WriteBit(guid[0]); + data.WriteBit(guid[6]); + data.FlushBits(); + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[6]); + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[5]); + data.WriteByteSeq(guid[0]); + SendMessageToSet(&data, false); + } + else + { + WorldPacket data(SMSG_SPLINE_MOVE_GRAVITY_ENABLE, 9); + data.WriteBit(guid[5]); + data.WriteBit(guid[4]); + data.WriteBit(guid[7]); + data.WriteBit(guid[1]); + data.WriteBit(guid[3]); + data.WriteBit(guid[6]); + data.WriteBit(guid[2]); + data.WriteBit(guid[0]); + data.FlushBits(); + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[6]); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[5]); + SendMessageToSet(&data, false); + } + return true; } @@ -2517,8 +2603,51 @@ bool Creature::SetHover(bool enable) return true; //! Not always a packet is sent - WorldPacket data(enable ? SMSG_SPLINE_MOVE_SET_HOVER : SMSG_SPLINE_MOVE_UNSET_HOVER, 9); - data.append(GetPackGUID()); - SendMessageToSet(&data, false); + ObjectGuid guid = GetGUID(); + if (enable) + { + WorldPacket data(SMSG_SPLINE_MOVE_SET_HOVER, 9); + data.WriteBit(guid[3]); + data.WriteBit(guid[7]); + data.WriteBit(guid[0]); + data.WriteBit(guid[1]); + data.WriteBit(guid[4]); + data.WriteBit(guid[6]); + data.WriteBit(guid[2]); + data.WriteBit(guid[5]); + data.FlushBits(); + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[5]); + data.WriteByteSeq(guid[6]); + SendMessageToSet(&data, false); + } + else + { + WorldPacket data(SMSG_SPLINE_MOVE_UNSET_HOVER, 9); + data.WriteBit(guid[6]); + data.WriteBit(guid[7]); + data.WriteBit(guid[0]); + data.WriteBit(guid[3]); + data.WriteBit(guid[1]); + data.WriteBit(guid[4]); + data.WriteBit(guid[5]); + data.WriteBit(guid[2]); + data.FlushBits(); + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[5]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[6]); + data.WriteByteSeq(guid[1]); + SendMessageToSet(&data, false); + } + return true; } diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 5a5f5c358b2..ad8510a2775 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -16304,8 +16304,25 @@ void Unit::SetRooted(bool apply) } else { + ObjectGuid guid = GetGUID(); WorldPacket data(SMSG_SPLINE_MOVE_ROOT, 8); - data.append(GetPackGUID()); + data.WriteBit(guid[5]); + data.WriteBit(guid[4]); + data.WriteBit(guid[6]); + data.WriteBit(guid[1]); + data.WriteBit(guid[3]); + data.WriteBit(guid[7]); + data.WriteBit(guid[2]); + data.WriteBit(guid[0]); + data.FlushBits(); + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[5]); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[6]); + data.WriteByteSeq(guid[4]); SendMessageToSet(&data, true); StopMoving(); } @@ -16323,8 +16340,25 @@ void Unit::SetRooted(bool apply) } else { + ObjectGuid guid = GetGUID(); WorldPacket data(SMSG_SPLINE_MOVE_UNROOT, 8); - data.append(GetPackGUID()); + data.WriteBit(guid[0]); + data.WriteBit(guid[1]); + data.WriteBit(guid[6]); + data.WriteBit(guid[5]); + data.WriteBit(guid[3]); + data.WriteBit(guid[2]); + data.WriteBit(guid[7]); + data.WriteBit(guid[4]); + data.FlushBits(); + data.WriteByteSeq(guid[6]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[5]); + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[4]); SendMessageToSet(&data, true); } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index d56bc0ff97e..5a53b637a99 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -1290,32 +1290,32 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_SPIRIT_HEALER_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_COLLISION_DISABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_COLLISION_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_GRAVITY_DISABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_GRAVITY_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_GRAVITY_DISABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_GRAVITY_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_LAND_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_NORMAL_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FEATHER_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FLYING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_LAND_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_NORMAL_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_RUN_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_RUN_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_RUN_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_SWIM_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_SWIM_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_WALK_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_WALK_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_START_SWIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_STOP_SWIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_UNROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_UNROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_UNSET_FLYING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_UNSET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_UNSET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 12316532a10..4bbe2f70712 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -1070,33 +1070,34 @@ enum Opcodes SMSG_SPELL_START = 0x6415, SMSG_SPELL_UPDATE_CHAIN_TARGETS = 0x0000, SMSG_SPIRIT_HEALER_CONFIRM = 0x0000, - SMSG_SPLINE_MOVE_COLLISION_DISABLE = 0x0000, - SMSG_SPLINE_MOVE_COLLISION_ENABLE = 0x0000, - SMSG_SPLINE_MOVE_GRAVITY_DISABLE = 0x0000, - SMSG_SPLINE_MOVE_GRAVITY_ENABLE = 0x0000, - SMSG_SPLINE_MOVE_ROOT = 0x0000, + SMSG_SPLINE_MOVE_COLLISION_DISABLE = 0x35B1, + SMSG_SPLINE_MOVE_COLLISION_ENABLE = 0x3CB0, + SMSG_SPLINE_MOVE_GRAVITY_DISABLE = 0x5DB5, + SMSG_SPLINE_MOVE_GRAVITY_ENABLE = 0x3CA6, + SMSG_SPLINE_MOVE_ROOT = 0x51B4, SMSG_SPLINE_MOVE_SET_FEATHER_FALL = 0x3DA5, SMSG_SPLINE_MOVE_SET_FLIGHT_BACK_SPEED = 0x0000, SMSG_SPLINE_MOVE_SET_FLIGHT_SPEED = 0x0000, SMSG_SPLINE_MOVE_SET_FLYING = 0x31B5, - SMSG_SPLINE_MOVE_SET_HOVER = 0x0000, + SMSG_SPLINE_MOVE_SET_HOVER = 0x14B6, SMSG_SPLINE_MOVE_SET_LAND_WALK = 0x3DA7, SMSG_SPLINE_MOVE_SET_NORMAL_FALL = 0x38B2, SMSG_SPLINE_MOVE_SET_PITCH_RATE = 0x0000, SMSG_SPLINE_MOVE_SET_RUN_BACK_SPEED = 0x0000, - SMSG_SPLINE_MOVE_SET_RUN_MODE = 0x0000, + SMSG_SPLINE_MOVE_SET_RUN_MODE = 0x75A7, SMSG_SPLINE_MOVE_SET_RUN_SPEED = 0x0000, SMSG_SPLINE_MOVE_SET_SWIM_BACK_SPEED = 0x0000, SMSG_SPLINE_MOVE_SET_SWIM_SPEED = 0x51B7, SMSG_SPLINE_MOVE_SET_TURN_RATE = 0x0000, - SMSG_SPLINE_MOVE_SET_WALK_MODE = 0x0000, + SMSG_SPLINE_MOVE_SET_WALK_MODE = 0x54B6, SMSG_SPLINE_MOVE_SET_WALK_SPEED = 0x0000, SMSG_SPLINE_MOVE_SET_WATER_WALK = 0x0000, - SMSG_SPLINE_MOVE_START_SWIM = 0x0000, - SMSG_SPLINE_MOVE_STOP_SWIM = 0x0000, - SMSG_SPLINE_MOVE_UNROOT = 0x0000, + SMSG_SPLINE_MOVE_START_SWIM = 0x31A5, + SMSG_SPLINE_MOVE_STOP_SWIM = 0x1DA2, + SMSG_SPLINE_MOVE_UNROOT = 0x75B6, SMSG_SPLINE_MOVE_UNSET_FLYING = 0x58A6, SMSG_SPLINE_MOVE_UNSET_HOVER = 0x7DA5, + SMSG_SPLINE_MOVE_WATER_WALK = 0x50A2, SMSG_STABLE_RESULT = 0x2204, SMSG_STANDSTATE_UPDATE = 0x6F04, SMSG_START_MIRROR_TIMER = 0x0000, -- cgit v1.2.3 From 2b8ea938774f55cc6e7798a2f86ef9f937e48fae Mon Sep 17 00:00:00 2001 From: horn Date: Wed, 25 Jul 2012 15:39:53 +0200 Subject: Core/PacketIO: Fix and enable few speed changes related opcodes --- src/server/game/Entities/Creature/Creature.cpp | 4 +- src/server/game/Entities/Unit/Unit.cpp | 173 ++++++++++++------------- src/server/game/Server/Protocol/Opcodes.cpp | 15 ++- src/server/game/Server/Protocol/Opcodes.h | 16 +-- 4 files changed, 103 insertions(+), 105 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 6d0dee92e38..aa538437491 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -2509,9 +2509,9 @@ bool Creature::SetWalk(bool enable) data.WriteBit(guid[5]); data.WriteBit(guid[6]); data.WriteBit(guid[3]); + data.WriteBit(guid[7]); data.WriteBit(guid[2]); data.WriteBit(guid[0]); - data.WriteBit(guid[7]); data.WriteBit(guid[4]); data.WriteBit(guid[1]); data.FlushBits(); @@ -2631,10 +2631,10 @@ bool Creature::SetHover(bool enable) WorldPacket data(SMSG_SPLINE_MOVE_UNSET_HOVER, 9); data.WriteBit(guid[6]); data.WriteBit(guid[7]); + data.WriteBit(guid[4]); data.WriteBit(guid[0]); data.WriteBit(guid[3]); data.WriteBit(guid[1]); - data.WriteBit(guid[4]); data.WriteBit(guid[5]); data.WriteBit(guid[2]); data.FlushBits(); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index ad8510a2775..a41d5ddaa0c 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -12751,174 +12751,171 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) break; case MOVE_RUN: data.Initialize(SMSG_SPLINE_MOVE_SET_RUN_SPEED, 1 + 8 + 4); - data.WriteBit(bytes[7]); - data.WriteBit(bytes[2]); - data.WriteBit(bytes[1]); - data.WriteBit(bytes[3]); - data.WriteBit(bytes[5]); - data.WriteBit(bytes[6]); data.WriteBit(bytes[4]); data.WriteBit(bytes[0]); - - data.WriteByteSeq(bytes[6]); + data.WriteBit(bytes[5]); + data.WriteBit(bytes[7]); + data.WriteBit(bytes[6]); + data.WriteBit(bytes[3]); + data.WriteBit(bytes[1]); + data.WriteBit(bytes[2]); + data.FlushBits(); + data.WriteByteSeq(bytes[0]); data.WriteByteSeq(bytes[7]); - data.WriteByteSeq(bytes[4]); + data.WriteByteSeq(bytes[6]); + data.WriteByteSeq(bytes[5]); data.WriteByteSeq(bytes[3]); + data.WriteByteSeq(bytes[4]); + data << float(GetSpeed(mtype)); data.WriteByteSeq(bytes[2]); - data.WriteByteSeq(bytes[5]); - data.WriteByteSeq(bytes[0]); data.WriteByteSeq(bytes[1]); - - data << float(GetSpeed(mtype)); break; case MOVE_RUN_BACK: data.Initialize(SMSG_SPLINE_MOVE_SET_RUN_BACK_SPEED, 1 + 8 + 4); - data.WriteBit(bytes[4]); - data.WriteBit(bytes[0]); + data.WriteBit(bytes[1]); + data.WriteBit(bytes[2]); data.WriteBit(bytes[6]); + data.WriteBit(bytes[0]); data.WriteBit(bytes[3]); - data.WriteBit(bytes[5]); - data.WriteBit(bytes[1]); data.WriteBit(bytes[7]); - data.WriteBit(bytes[2]); - + data.WriteBit(bytes[5]); + data.WriteBit(bytes[4]); + data.FlushBits(); data.WriteByteSeq(bytes[1]); - data.WriteByteSeq(bytes[7]); - data.WriteByteSeq(bytes[5]); - data.WriteByteSeq(bytes[3]); - data.WriteByteSeq(bytes[6]); + data << float(GetSpeed(mtype)); + data.WriteByteSeq(bytes[2]); data.WriteByteSeq(bytes[4]); data.WriteByteSeq(bytes[0]); - data.WriteByteSeq(bytes[2]); - - data << float(GetSpeed(mtype)); + data.WriteByteSeq(bytes[3]); + data.WriteByteSeq(bytes[6]); + data.WriteByteSeq(bytes[5]); + data.WriteByteSeq(bytes[7]); break; case MOVE_SWIM: data.Initialize(SMSG_SPLINE_MOVE_SET_SWIM_SPEED, 1 + 8 + 4); - data.WriteBit(bytes[3]); - data.WriteBit(bytes[5]); - data.WriteBit(bytes[7]); data.WriteBit(bytes[4]); data.WriteBit(bytes[2]); + data.WriteBit(bytes[5]); data.WriteBit(bytes[0]); - data.WriteBit(bytes[1]); + data.WriteBit(bytes[7]); data.WriteBit(bytes[6]); - - data.WriteByteSeq(bytes[0]); - data.WriteByteSeq(bytes[3]); + data.WriteBit(bytes[3]); + data.WriteBit(bytes[1]); + data.FlushBits(); + data.WriteByteSeq(bytes[5]); data.WriteByteSeq(bytes[6]); - data.WriteByteSeq(bytes[4]); + data.WriteByteSeq(bytes[1]); + data.WriteByteSeq(bytes[0]); data.WriteByteSeq(bytes[2]); - data.WriteByteSeq(bytes[7]); + data.WriteByteSeq(bytes[4]); data << float(GetSpeed(mtype)); - data.WriteByteSeq(bytes[1]); - data.WriteByteSeq(bytes[5]); + data.WriteByteSeq(bytes[7]); + data.WriteByteSeq(bytes[3]); break; case MOVE_SWIM_BACK: data.Initialize(SMSG_SPLINE_MOVE_SET_SWIM_BACK_SPEED, 1 + 8 + 4); - data.WriteBit(bytes[3]); - data.WriteBit(bytes[5]); - data.WriteBit(bytes[4]); data.WriteBit(bytes[0]); - data.WriteBit(bytes[2]); data.WriteBit(bytes[1]); + data.WriteBit(bytes[3]); data.WriteBit(bytes[6]); + data.WriteBit(bytes[4]); + data.WriteBit(bytes[5]); data.WriteBit(bytes[7]); - + data.WriteBit(bytes[2]); + data.FlushBits(); + data.WriteByteSeq(bytes[5]); + data.WriteByteSeq(bytes[3]); data.WriteByteSeq(bytes[1]); data.WriteByteSeq(bytes[0]); - data.WriteByteSeq(bytes[2]); - data << float(GetSpeed(mtype)); data.WriteByteSeq(bytes[7]); - data.WriteByteSeq(bytes[3]); data.WriteByteSeq(bytes[6]); + data << float(GetSpeed(mtype)); data.WriteByteSeq(bytes[4]); - data.WriteByteSeq(bytes[5]); + data.WriteByteSeq(bytes[2]); break; case MOVE_TURN_RATE: data.Initialize(SMSG_SPLINE_MOVE_SET_TURN_RATE, 1 + 8 + 4); - data.WriteBit(bytes[0]); + data.WriteBit(bytes[2]); data.WriteBit(bytes[4]); - data.WriteBit(bytes[5]); - data.WriteBit(bytes[1]); data.WriteBit(bytes[6]); + data.WriteBit(bytes[1]); data.WriteBit(bytes[3]); + data.WriteBit(bytes[5]); data.WriteBit(bytes[7]); - data.WriteBit(bytes[2]); - - data.WriteByteSeq(bytes[2]); - data.WriteByteSeq(bytes[4]); - data.WriteByteSeq(bytes[7]); - data.WriteByteSeq(bytes[0]); + data.WriteBit(bytes[0]); + data.FlushBits(); data << float(GetSpeed(mtype)); - data.WriteByteSeq(bytes[5]); data.WriteByteSeq(bytes[1]); - data.WriteByteSeq(bytes[6]); + data.WriteByteSeq(bytes[5]); data.WriteByteSeq(bytes[3]); + data.WriteByteSeq(bytes[2]); + data.WriteByteSeq(bytes[7]); + data.WriteByteSeq(bytes[4]); + data.WriteByteSeq(bytes[6]); + data.WriteByteSeq(bytes[0]); break; case MOVE_FLIGHT: data.Initialize(SMSG_SPLINE_MOVE_SET_FLIGHT_SPEED, 1 + 8 + 4); - data.WriteBit(bytes[2]); - data.WriteBit(bytes[3]); - data.WriteBit(bytes[5]); - data.WriteBit(bytes[0]); data.WriteBit(bytes[7]); data.WriteBit(bytes[4]); - data.WriteBit(bytes[6]); + data.WriteBit(bytes[0]); data.WriteBit(bytes[1]); - - data << float(GetSpeed(mtype)); - - data.WriteByteSeq(bytes[1]); + data.WriteBit(bytes[3]); + data.WriteBit(bytes[6]); + data.WriteBit(bytes[5]); + data.WriteBit(bytes[2]); + data.FlushBits(); data.WriteByteSeq(bytes[0]); - data.WriteByteSeq(bytes[6]); + data.WriteByteSeq(bytes[5]); + data.WriteByteSeq(bytes[4]); data.WriteByteSeq(bytes[7]); data.WriteByteSeq(bytes[3]); data.WriteByteSeq(bytes[2]); - data.WriteByteSeq(bytes[5]); - data.WriteByteSeq(bytes[4]); + data.WriteByteSeq(bytes[1]); + data.WriteByteSeq(bytes[6]); + data << float(GetSpeed(mtype)); break; case MOVE_FLIGHT_BACK: data.Initialize(SMSG_SPLINE_MOVE_SET_FLIGHT_BACK_SPEED, 1 + 8 + 4); + data.WriteBit(bytes[2]); data.WriteBit(bytes[1]); data.WriteBit(bytes[6]); - data.WriteBit(bytes[0]); - data.WriteBit(bytes[2]); - data.WriteBit(bytes[7]); data.WriteBit(bytes[5]); - data.WriteBit(bytes[4]); + data.WriteBit(bytes[0]); data.WriteBit(bytes[3]); - + data.WriteBit(bytes[4]); + data.WriteBit(bytes[7]); + data.FlushBits(); data.WriteByteSeq(bytes[5]); + data << float(GetSpeed(mtype)); data.WriteByteSeq(bytes[6]); + data.WriteByteSeq(bytes[1]); data.WriteByteSeq(bytes[0]); - data.WriteByteSeq(bytes[4]); data.WriteByteSeq(bytes[2]); - data.WriteByteSeq(bytes[1]); - data.WriteByteSeq(bytes[7]); - data << float(GetSpeed(mtype)); data.WriteByteSeq(bytes[3]); + data.WriteByteSeq(bytes[7]); + data.WriteByteSeq(bytes[4]); break; case MOVE_PITCH_RATE: data.Initialize(SMSG_SPLINE_MOVE_SET_PITCH_RATE, 1 + 8 + 4); - data.WriteBit(bytes[7]); - data.WriteBit(bytes[2]); data.WriteBit(bytes[3]); data.WriteBit(bytes[5]); - data.WriteBit(bytes[4]); - data.WriteBit(bytes[0]); data.WriteBit(bytes[6]); data.WriteBit(bytes[1]); - - data.WriteByteSeq(bytes[0]); + data.WriteBit(bytes[0]); + data.WriteBit(bytes[4]); + data.WriteBit(bytes[7]); + data.WriteBit(bytes[2]); + data.FlushBits(); data.WriteByteSeq(bytes[1]); + data.WriteByteSeq(bytes[5]); data.WriteByteSeq(bytes[7]); - data.WriteByteSeq(bytes[2]); - data.WriteByteSeq(bytes[3]); + data.WriteByteSeq(bytes[0]); data.WriteByteSeq(bytes[6]); - data.WriteByteSeq(bytes[5]); - data.WriteByteSeq(bytes[4]); + data.WriteByteSeq(bytes[3]); + data.WriteByteSeq(bytes[2]); data << float(GetSpeed(mtype)); + data.WriteByteSeq(bytes[4]); break; default: sLog->outError("Unit::SetSpeed: Unsupported move type (%d), data not sent to client.", mtype); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 5a53b637a99..a8cf654d028 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -1296,18 +1296,19 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_NORMAL_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FEATHER_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FLYING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_LAND_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_NORMAL_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_RUN_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_RUN_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_RUN_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_SWIM_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_SWIM_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_SWIM_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_SWIM_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_WALK_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 4bbe2f70712..5b7cd63a2a7 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -1076,19 +1076,19 @@ enum Opcodes SMSG_SPLINE_MOVE_GRAVITY_ENABLE = 0x3CA6, SMSG_SPLINE_MOVE_ROOT = 0x51B4, SMSG_SPLINE_MOVE_SET_FEATHER_FALL = 0x3DA5, - SMSG_SPLINE_MOVE_SET_FLIGHT_BACK_SPEED = 0x0000, - SMSG_SPLINE_MOVE_SET_FLIGHT_SPEED = 0x0000, + SMSG_SPLINE_MOVE_SET_FLIGHT_BACK_SPEED = 0x38B3, + SMSG_SPLINE_MOVE_SET_FLIGHT_SPEED = 0x39A0, SMSG_SPLINE_MOVE_SET_FLYING = 0x31B5, SMSG_SPLINE_MOVE_SET_HOVER = 0x14B6, SMSG_SPLINE_MOVE_SET_LAND_WALK = 0x3DA7, SMSG_SPLINE_MOVE_SET_NORMAL_FALL = 0x38B2, - SMSG_SPLINE_MOVE_SET_PITCH_RATE = 0x0000, - SMSG_SPLINE_MOVE_SET_RUN_BACK_SPEED = 0x0000, + SMSG_SPLINE_MOVE_SET_PITCH_RATE = 0x14B0, + SMSG_SPLINE_MOVE_SET_RUN_BACK_SPEED = 0x3DB3, SMSG_SPLINE_MOVE_SET_RUN_MODE = 0x75A7, - SMSG_SPLINE_MOVE_SET_RUN_SPEED = 0x0000, - SMSG_SPLINE_MOVE_SET_SWIM_BACK_SPEED = 0x0000, - SMSG_SPLINE_MOVE_SET_SWIM_SPEED = 0x51B7, - SMSG_SPLINE_MOVE_SET_TURN_RATE = 0x0000, + SMSG_SPLINE_MOVE_SET_RUN_SPEED = 0x51B7, + SMSG_SPLINE_MOVE_SET_SWIM_BACK_SPEED = 0x59A1, + SMSG_SPLINE_MOVE_SET_SWIM_SPEED = 0x39A4, + SMSG_SPLINE_MOVE_SET_TURN_RATE = 0x78B5, SMSG_SPLINE_MOVE_SET_WALK_MODE = 0x54B6, SMSG_SPLINE_MOVE_SET_WALK_SPEED = 0x0000, SMSG_SPLINE_MOVE_SET_WATER_WALK = 0x0000, -- cgit v1.2.3 From 0d6e2d5e862b251a149ca094c2eb5c6b40227a5a Mon Sep 17 00:00:00 2001 From: kaelima Date: Wed, 25 Jul 2012 16:14:10 +0200 Subject: Core/PacketIO: Verified and enabled a couple of server messages --- src/server/game/Server/Protocol/Opcodes.cpp | 48 ++++++++++++++--------------- src/server/game/Server/Protocol/Opcodes.h | 6 ++-- 2 files changed, 27 insertions(+), 27 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index a8cf654d028..d2b18844242 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -710,7 +710,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(MSG_MINIMAP_PING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMinimapPingOpcode ); DEFINE_OPCODE_HANDLER(MSG_MOVE_FALL_LAND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_FEATHER_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_GRAVITY_CHNG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_GRAVITY_CHNG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_MOVE_HEARTBEAT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); DEFINE_OPCODE_HANDLER(MSG_MOVE_JUMP, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -838,7 +838,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_BINDER_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_BINDPOINTUPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BINDZONEREPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BREAK_TARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BREAK_TARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BUY_BANK_SLOT_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BUY_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BUY_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -864,7 +864,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_SEND_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_SEND_NUM_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CAMERA_SHAKE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CANCEL_AUTO_REPEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CANCEL_AUTO_REPEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CANCEL_COMBAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CAST_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHANGEPLAYER_DIFFICULTY_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -894,7 +894,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_FAR_SIGHT_IMMEDIATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_TARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CLIENTCACHE_VERSION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CLIENT_CONTROL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CLIENT_CONTROL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMBAT_EVENT_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_GET_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_MAP_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -987,7 +987,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_SYSTEMSTATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_UPDATETEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GM_MESSAGECHAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GM_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_GM_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GM_TICKET_STATUS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GODMODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GOGOGO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1039,7 +1039,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_INVALIDATE_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_INVALID_PROMOTION_CODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_INVENTORY_CHANGE_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ITEM_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ITEM_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ITEM_ENCHANT_TIME_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ITEM_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ITEM_PUSH_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1104,17 +1104,17 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_MOTD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOUNTRESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOUNTSPECIAL_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_CHARACTER_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_CHARACTER_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_GRAVITY_DISABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_GRAVITY_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_KNOCK_BACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_COLLISION_HEIGHT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_RUN_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1122,12 +1122,12 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_SWIM_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SKIP_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SKIP_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_KNOCK_BACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_KNOCK_BACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MULTIPLE_PACKETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_NEW_TAXI_PATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1177,7 +1177,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_PLAYER_SKINNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAYER_VEHICLE_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAY_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PLAY_MUSIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PLAY_MUSIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAY_OBJECT_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAY_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PLAY_SPELL_IMPACT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1217,7 +1217,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_QUEST_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_RAID_GROUP_ONLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_RAID_INSTANCE_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RAID_INSTANCE_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_RAID_INSTANCE_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_RAID_READY_CHECK_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_RANDOMIZE_CHAR_NAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_READ_ITEM_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1296,21 +1296,21 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_NORMAL_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FEATHER_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FLYING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_LAND_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_NORMAL_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_RUN_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_RUN_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_RUN_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_SWIM_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_SWIM_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_SWIM_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_SWIM_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_WALK_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_START_SWIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_STOP_SWIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1354,7 +1354,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_SUCCEEDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_TRANSFER_ABORTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TRANSFER_ABORTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TRANSFER_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TRIGGER_CINEMATIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TRIGGER_MOVIE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1376,7 +1376,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_VOICE_CHAT_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_VOICE_PARENTAL_CONTROLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_ADJUST_PRIORITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_LEAVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_ROSTER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SET_TALKER_MUTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 5b7cd63a2a7..59595e4e6f1 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -630,7 +630,7 @@ enum Opcodes SMSG_BINDER_CONFIRM = 0x2835, SMSG_BINDPOINTUPDATE = 0x0527, SMSG_BINDZONEREPLY = 0x0000, - SMSG_BREAK_TARGET = 0x0000, + SMSG_BREAK_TARGET = 0x0105, SMSG_BUY_BANK_SLOT_RESULT = 0x0000, SMSG_BUY_FAILED = 0x6435, SMSG_BUY_ITEM = 0x0F26, @@ -822,7 +822,7 @@ enum Opcodes SMSG_INVALIDATE_PLAYER = 0x6325, SMSG_INVALID_PROMOTION_CODE = 0x0000, SMSG_INVENTORY_CHANGE_FAILURE = 0x2236, - SMSG_ITEM_COOLDOWN = 0x0000, + SMSG_ITEM_COOLDOWN = 0x4D14, SMSG_ITEM_ENCHANT_TIME_UPDATE = 0x0F27, SMSG_ITEM_NAME_QUERY_RESPONSE = 0x0000, SMSG_ITEM_PUSH_RESULT = 0x0E15, @@ -973,7 +973,7 @@ enum Opcodes SMSG_PLAYER_UNK_DEAD_ALIVE = 0x0000, SMSG_PLAYER_VEHICLE_DATA = 0x4115, SMSG_PLAY_DANCE = 0x4704, - SMSG_PLAY_MUSIC = 0x0000, + SMSG_PLAY_MUSIC = 0x4B06, SMSG_PLAY_OBJECT_SOUND = 0x2635, SMSG_PLAY_SOUND = 0x2134, SMSG_PLAY_SPELL_IMPACT = 0x0000, -- cgit v1.2.3 From 3f137c74f9a8e09c149f19011fb109be7e570777 Mon Sep 17 00:00:00 2001 From: Nay Date: Wed, 25 Jul 2012 23:14:23 +0100 Subject: Core/PacketIO: Many opcodes from WPP --- src/server/game/Server/Protocol/Opcodes.h | 816 ++++++++++++++++++++---------- 1 file changed, 541 insertions(+), 275 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 59595e4e6f1..2e95945f1eb 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -35,25 +35,26 @@ enum Opcodes CMSG_ACCEPT_LEVEL_GRANT = 0x0205, CMSG_ACCEPT_TRADE = 0x7110, - CMSG_ACTIVATETAXI = 0x0000, + CMSG_ACTIVATETAXI = 0x6E06, CMSG_ACTIVATETAXIEXPRESS = 0x0515, CMSG_ADDON_REGISTERED_PREFIXES = 0x0954, - CMSG_ADD_FRIEND = 0x6C29, - CMSG_ADD_IGNORE = 0x0000, + CMSG_ADD_FRIEND = 0x6527, + CMSG_ADD_IGNORE = 0x4726, CMSG_ADD_VOICE_IGNORE = 0x0F06, CMSG_ALTER_APPEARANCE = 0x0914, CMSG_AREATRIGGER = 0x0937, CMSG_AREA_SPIRIT_HEALER_QUERY = 0x4907, - CMSG_AREA_SPIRIT_HEALER_QUEUE = 0x0000, - CMSG_ARENA_TEAM_ACCEPT = 0x0000, - CMSG_ARENA_TEAM_DECLINE = 0x0000, + CMSG_AREA_SPIRIT_HEALER_QUEUE = 0x4815, + CMSG_ARENA_TEAM_ACCEPT = 0x2A25, + CMSG_ARENA_TEAM_CREATE = 0x04A1, + CMSG_ARENA_TEAM_DECLINE = 0x6925, CMSG_ARENA_TEAM_DISBAND = 0x6504, CMSG_ARENA_TEAM_INVITE = 0x2F27, CMSG_ARENA_TEAM_LEADER = 0x4204, CMSG_ARENA_TEAM_LEAVE = 0x0E16, - CMSG_ARENA_TEAM_QUERY = 0x0000, + CMSG_ARENA_TEAM_QUERY = 0x0514, CMSG_ARENA_TEAM_REMOVE = 0x2F05, - CMSG_ARENA_TEAM_ROSTER = 0x0000, + CMSG_ARENA_TEAM_ROSTER = 0x6F37, CMSG_ATTACKSTOP = 0x4106, CMSG_ATTACKSWING = 0x0926, CMSG_AUCTION_LIST_BIDDER_ITEMS = 0x6937, @@ -64,21 +65,30 @@ enum Opcodes CMSG_AUCTION_REMOVE_ITEM = 0x6426, CMSG_AUCTION_SELL_ITEM = 0x4A06, CMSG_AUTH_SESSION = 0x0449, - CMSG_AUTOBANK_ITEM = 0x0000, + CMSG_AUTOBANK_ITEM = 0x2537, CMSG_AUTOEQUIP_GROUND_ITEM = 0x0000, CMSG_AUTOEQUIP_ITEM = 0x4304, - CMSG_AUTOEQUIP_ITEM_SLOT = 0x0000, - CMSG_AUTOSTORE_BAG_ITEM = 0x0000, - CMSG_AUTOSTORE_BANK_ITEM = 0x0000, + CMSG_AUTOEQUIP_ITEM_SLOT = 0x4A17, + CMSG_AUTOSTORE_BAG_ITEM = 0x0236, + CMSG_AUTOSTORE_BANK_ITEM = 0x0607, CMSG_AUTOSTORE_GROUND_ITEM = 0x0000, CMSG_AUTOSTORE_LOOT_ITEM = 0x0E34, - CMSG_AUTO_DECLINE_GUILD_INVITES = 0x2034, + CMSG_AUTO_DECLINE_GUILD_INVITES = 0x1234, CMSG_BANKER_ACTIVATE = 0x0005, CMSG_BATTLEFIELD_JOIN = 0x0000, + CMSG_BATTLEFIELD_LEAVE = 0x3018, CMSG_BATTLEFIELD_LIST = 0x3814, + CMSG_BATTLEFIELD_MGR_ENTRY_INVITE_RESPONSE = 0x05A3, + CMSG_BATTLEFIELD_MGR_EXIT_REQUEST = 0x2490, + CMSG_BATTLEFIELD_MGR_QUEUE_INVITE_RESPONSE = 0x0413, + CMSG_BATTLEFIELD_MGR_QUEUE_REQUEST = 0x710C, + CMSG_BATTLEFIELD_PORT = 0x711A, CMSG_BATTLEFIELD_REQUEST_SCORE_DATA = 0x0000, CMSG_BATTLEFIELD_STATUS = 0x2500, - CMSG_BATTLEMASTER_JOIN_ARENA = 0x0000, + CMSG_BATTLEGROUND_PLAYER_POSITIONS = 0x3902, + CMSG_BATTLEMASTER_JOIN = 0x7902, + CMSG_BATTLEMASTER_JOIN_ARENA = 0x701C, + CMSG_BATTLEMASTER_JOIN_RATED = 0x3B18, CMSG_BEGIN_TRADE = 0x721E, CMSG_BINDER_ACTIVATE = 0x4006, CMSG_BOT_DETECTED2 = 0x0000, @@ -87,46 +97,57 @@ enum Opcodes CMSG_BUYBACK_ITEM = 0x6C17, CMSG_BUY_BANK_SLOT = 0x0425, CMSG_BUY_ITEM = 0x0736, - CMSG_CALENDAR_ADD_EVENT = 0x0000, - CMSG_CALENDAR_ARENA_TEAM = 0x0000, + CMSG_CALENDAR_ADD_EVENT = 0x0726, + CMSG_CALENDAR_ARENA_TEAM = 0x0204, + CMSG_CALENDAR_COMPLAIN = 0x4C36, CMSG_CALENDAR_CONTEXT_EVENT_SIGNUP = 0x0000, CMSG_CALENDAR_COPY_EVENT = 0x0000, - CMSG_CALENDAR_EVENT_INVITE = 0x0227, - CMSG_CALENDAR_EVENT_MODERATOR_STATUS = 0x0000, - CMSG_CALENDAR_EVENT_REMOVE_INVITE = 0x0000, - CMSG_CALENDAR_EVENT_RSVP = 0x0000, - CMSG_CALENDAR_EVENT_STATUS = 0x0000, + CMSG_CALENDAR_EVENT_INVITE = 0x2435, + CMSG_CALENDAR_EVENT_MODERATOR_STATUS = 0x6B35, + CMSG_CALENDAR_EVENT_REMOVE_INVITE = 0x4337, + CMSG_CALENDAR_EVENT_RSVP = 0x0227, + CMSG_CALENDAR_EVENT_SIGNUP = 0x6606, + CMSG_CALENDAR_EVENT_STATUS = 0x2D24, CMSG_CALENDAR_GET_CALENDAR = 0x2814, - CMSG_CALENDAR_GET_EVENT = 0x0000, + CMSG_CALENDAR_GET_EVENT = 0x6416, CMSG_CALENDAR_GET_NUM_PENDING = 0x4D05, - CMSG_CALENDAR_GUILD_FILTER = 0x0000, - CMSG_CALENDAR_REMOVE_EVENT = 0x0000, - CMSG_CALENDAR_UPDATE_EVENT = 0x0000, + CMSG_CALENDAR_GUILD_FILTER = 0x4A16, + CMSG_CALENDAR_REMOVE_EVENT = 0x6636, + CMSG_CALENDAR_UPDATE_EVENT = 0x2114, CMSG_CANCEL_AURA = 0x0E26, CMSG_CANCEL_AUTO_REPEAT_SPELL = 0x6C35, CMSG_CANCEL_CAST = 0x0115, CMSG_CANCEL_CHANNELLING = 0x6C25, CMSG_CANCEL_GROWTH_AURA = 0x0000, CMSG_CANCEL_MOUNT_AURA = 0x0635, - CMSG_CANCEL_TEMP_ENCHANTMENT = 0x0000, + CMSG_CANCEL_QUEUED_SPELL = 0x7B1C, + CMSG_CANCEL_TEMP_ENCHANTMENT = 0x6C37, CMSG_CANCEL_TRADE = 0x731E, CMSG_CAST_SPELL = 0x4C07, - CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE = 0x0000, + CMSG_CHANGEPLAYER_DIFFICULTY = 0x6107, + CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE = 0x7310, CMSG_CHANNEL_ANNOUNCEMENTS = 0x1146, CMSG_CHANNEL_BAN = 0x3D56, CMSG_CHANNEL_DISPLAY_LIST = 0x2144, CMSG_CHANNEL_INVITE = 0x0144, CMSG_CHANNEL_KICK = 0x3156, CMSG_CHANNEL_LIST = 0x1556, - CMSG_CHANNEL_MODERATOR = 0x2944, + CMSG_CHANNEL_MODERATE = 0x2944, + CMSG_CHANNEL_MODERATOR = 0x0146, CMSG_CHANNEL_MUTE = 0x2554, CMSG_CHANNEL_OWNER = 0x3D44, - CMSG_CHANNEL_PASSWORD = 0x9558, + CMSG_CHANNEL_PASSWORD = 0x2556, CMSG_CHANNEL_ROSTER_INFO = 0x3546, CMSG_CHANNEL_SET_OWNER = 0x3556, + CMSG_CHANNEL_SILENCE_ALL = 0x2154, + CMSG_CHANNEL_SILENCE_VOICE = 0x2D54, CMSG_CHANNEL_UNBAN = 0x2D46, CMSG_CHANNEL_UNMODERATOR = 0x1954, CMSG_CHANNEL_UNMUTE = 0x3554, + CMSG_CHANNEL_UNSILENCE_ALL = 0x2546, + CMSG_CHANNEL_UNSILENCE_VOICE = 0x3146, + CMSG_CHANNEL_VOICE_OFF = 0x3144, + CMSG_CHANNEL_VOICE_ON = 0x1144, CMSG_CHAR_CREATE = 0x4A36, CMSG_CHAR_CUSTOMIZE = 0x2C34, CMSG_CHAR_DELETE = 0x6425, @@ -134,40 +155,50 @@ enum Opcodes CMSG_CHAR_FACTION_CHANGE = 0x2735, CMSG_CHAR_RACE_CHANGE = 0x0D24, CMSG_CHAR_RENAME = 0x2327, + CMSG_CHAT_FILTERED = 0x0946, + CMSG_CHAT_IGNORED = 0x0D54, CMSG_CLEAR_CHANNEL_WATCH = 0x2604, - CMSG_CLEAR_TRADE_ITEM = 0x0000, + CMSG_CLEAR_RAID_MARKER = 0x7300, + CMSG_CLEAR_TRADE_ITEM = 0x7018, CMSG_COMMENTATOR_ENABLE = 0x0B07, CMSG_COMMENTATOR_ENTER_INSTANCE = 0x4105, CMSG_COMMENTATOR_EXIT_INSTANCE = 0x6136, CMSG_COMMENTATOR_GET_MAP_INFO = 0x0026, + CMSG_COMMENTATOR_GET_PARTY_INFO = 0x2412, CMSG_COMMENTATOR_GET_PLAYER_INFO = 0x0D14, CMSG_COMMENTATOR_INSTANCE_COMMAND = 0x0917, CMSG_COMMENTATOR_SKIRMISH_QUEUE_COMMAND = 0x0025, CMSG_COMMENTATOR_START_WARGAME = 0x25A0, - CMSG_COMPLAIN = 0x0000, - CMSG_COMPLETE_CINEMATIC = 0x0A16, - CMSG_COMPLETE_MOVIE = 0x0000, + CMSG_COMPLAIN = 0x0427, + CMSG_COMPLETE_CINEMATIC = 0x2116, + CMSG_COMPLETE_MOVIE = 0x4136, + CMSG_CONNECT_TO_FAILED = 0x2533, CMSG_CONTACT_LIST = 0x4534, - CMSG_CORPSE_MAP_POSITION_QUERY = 0x0000, + CMSG_CORPSE_MAP_POSITION_QUERY = 0x6205, CMSG_CREATURE_QUERY = 0x2706, - CMSG_DANCE_QUERY = 0x0000, + CMSG_DANCE_QUERY = 0x4E07, CMSG_DECLINE_CHANNEL_INVITE = 0x0000, + CMSG_DELETEEQUIPMENT_SET = 0x4D07, CMSG_DEL_FRIEND = 0x6A15, CMSG_DEL_IGNORE = 0x4727, CMSG_DEL_VOICE_IGNORE = 0x0024, CMSG_DESTROYITEM = 0x0000, CMSG_DESTROY_ITEMS = 0x4A27, - CMSG_DUEL_ACCEPTED = 0x0000, - CMSG_DUEL_CANCELLED = 0x0000, + CMSG_DISMISS_CONTROLLED_VEHICLE = 0x3218, + CMSG_DISMISS_CRITTER = 0x4227, + CMSG_DUEL_ACCEPTED = 0x2136, + CMSG_DUEL_CANCELLED = 0x6624, CMSG_DUNGEON_FINDER_GET_SYSTEM_INFO = 0x0412, - CMSG_EJECT_PASSENGER = 0x0000, + CMSG_EJECT_PASSENGER = 0x6927, CMSG_EMOTE = 0x4C26, - CMSG_ENABLE_NAGLE = 0x4449, // client CVar disableServerNagle set to 1 prevents sending this opcode + CMSG_ENABLETAXI = 0x0C16, + CMSG_ENABLE_NAGLE = 0x4449, CMSG_EQUIPMENT_SET_DELETE = 0x0000, - CMSG_EQUIPMENT_SET_SAVE = 0x0000, - CMSG_EQUIPMENT_SET_USE = 0x0000, + CMSG_EQUIPMENT_SET_SAVE = 0x4F27, + CMSG_EQUIPMENT_SET_USE = 0x0417, + CMSG_FAR_SIGHT = 0x4835, CMSG_FORCE_MOVE_ROOT_ACK = 0x701E, - CMSG_FORCE_MOVE_UNROOT_ACK = 0x7DB4, + CMSG_FORCE_MOVE_UNROOT_ACK = 0x7808, CMSG_GAMEOBJECT_QUERY = 0x4017, CMSG_GAMEOBJ_REPORT_USE = 0x4827, CMSG_GAMEOBJ_USE = 0x4E17, @@ -177,60 +208,84 @@ enum Opcodes CMSG_GET_MAIL_LIST = 0x4D37, CMSG_GET_MIRRORIMAGE_DATA = 0x0C25, CMSG_GHOST = 0x0000, - CMSG_GMRESPONSE_RESOLVE = 0x0000, - CMSG_GMSURVEY_SUBMIT = 0x0000, + CMSG_GMRESPONSE_RESOLVE = 0x6506, + CMSG_GMSURVEY_SUBMIT = 0x2724, CMSG_GMTICKET_CREATE = 0x0137, - CMSG_GMTICKET_DELETETICKET = 0x0000, + CMSG_GMTICKET_DELETETICKET = 0x6B14, CMSG_GMTICKET_GETTICKET = 0x0326, - CMSG_GMTICKET_SYSTEMSTATUS = 0x0000, + CMSG_GMTICKET_SYSTEMSTATUS = 0x4205, CMSG_GMTICKET_UPDATETEXT = 0x0636, CMSG_GM_INVIS = 0x0000, CMSG_GM_NUKE = 0x0000, - CMSG_GM_REPORT_LAG = 0x0000, + CMSG_GM_REPORT_LAG = 0x6726, CMSG_GM_SET_SECURITY_GROUP = 0x0000, CMSG_GOSSIP_HELLO = 0x4525, CMSG_GOSSIP_SELECT_OPTION = 0x0216, - CMSG_GRANT_LEVEL = 0x0000, + CMSG_GRANT_LEVEL = 0x6D16, CMSG_GROUP_ACCEPT = 0x0000, CMSG_GROUP_ASSISTANT_LEADER = 0x6025, - CMSG_GROUP_CANCEL = 0x4D25, + CMSG_GROUP_CANCEL = 0x0000, CMSG_GROUP_CHANGE_SUB_GROUP = 0x4124, CMSG_GROUP_DECLINE = 0x0000, - CMSG_GROUP_DISBAND = 0x0000, - CMSG_GROUP_INVITE = 0x0000, + CMSG_GROUP_DISBAND = 0x2804, + CMSG_GROUP_INVITE = 0x0513, + CMSG_GROUP_INVITE_RESPONSE = 0x0410, CMSG_GROUP_RAID_CONVERT = 0x6E27, + CMSG_GROUP_REQUEST_JOIN_UPDATES = 0x2583, CMSG_GROUP_SET_LEADER = 0x4C17, + CMSG_GROUP_SET_ROLES = 0x25B1, CMSG_GROUP_SWAP_SUB_GROUP = 0x0034, CMSG_GROUP_UNINVITE = 0x0000, - CMSG_GROUP_UNINVITE_GUID = 0x0000, + CMSG_GROUP_UNINVITE_GUID = 0x2E07, CMSG_GUILD_ACCEPT = 0x2531, + CMSG_GUILD_ACHIEVEMENT_MEMBERS = 0x3025, CMSG_GUILD_ACHIEVEMENT_PROGRESS_QUERY = 0x3235, + CMSG_GUILD_ADD_RANK = 0x3030, + CMSG_GUILD_ASSIGN_MEMBER_RANK = 0x3032, CMSG_GUILD_BANKER_ACTIVATE = 0x2E37, - CMSG_GUILD_BANK_BUY_TAB = 0x0000, - CMSG_GUILD_BANK_DEPOSIT_MONEY = 0x0000, + CMSG_GUILD_BANK_BUY_TAB = 0x0C37, + CMSG_GUILD_BANK_DEPOSIT_MONEY = 0x0707, + CMSG_GUILD_BANK_LOG_QUERY = 0x3224, + CMSG_GUILD_BANK_MONEY_WITHDRAWN_QUERY = 0x0000, CMSG_GUILD_BANK_NOTE = 0x0000, CMSG_GUILD_BANK_QUERY_TAB = 0x2E35, - CMSG_GUILD_BANK_MONEY_WITHDRAWN_QUERY = 0x1225, + CMSG_GUILD_BANK_QUERY_TEXT = 0x3220, + CMSG_GUILD_BANK_REM_MONEY_WITHDRAW_QUERY = 0x1225, + CMSG_GUILD_BANK_SET_TAB_TEXT = 0x3023, CMSG_GUILD_BANK_SWAP_ITEMS = 0x2315, CMSG_GUILD_BANK_UPDATE_TAB = 0x0106, CMSG_GUILD_BANK_WITHDRAW_MONEY = 0x0037, + CMSG_GUILD_CHANGE_NAME_REQUEST = 0x1232, CMSG_GUILD_CREATE = 0x0000, - CMSG_GUILD_DECLINE = 0x0000, - CMSG_GUILD_DEMOTE = 0x0000, - CMSG_GUILD_DISBAND = 0x0000, + CMSG_GUILD_DECLINE = 0x3231, + CMSG_GUILD_DEL_RANK = 0x3234, + CMSG_GUILD_DEMOTE = 0x1020, + CMSG_GUILD_DISBAND = 0x3226, + CMSG_GUILD_EVENT_LOG_QUERY = 0x1220, CMSG_GUILD_INFO = 0x0000, CMSG_GUILD_INFO_TEXT = 0x3227, CMSG_GUILD_INVITE = 0x0000, + CMSG_GUILD_INVITE_BY_NAME = 0x24B0, CMSG_GUILD_LEADER = 0x0000, - CMSG_GUILD_LEAVE = 0x0000, + CMSG_GUILD_LEAVE = 0x1021, + CMSG_GUILD_MEMBER_SEND_SOR_REQUEST = 0x3225, CMSG_GUILD_MOTD = 0x1035, - CMSG_GUILD_PROMOTE = 0x0000, + CMSG_GUILD_NEWS_UPDATE_STICKY = 0x3223, + CMSG_GUILD_PROMOTE = 0x1030, CMSG_GUILD_QUERY = 0x4426, + CMSG_GUILD_QUERY_NEWS = 0x3020, CMSG_GUILD_RANK = 0x0000, - CMSG_GUILD_REMOVE = 0x0000, - CMSG_GUILD_ROSTER = 0x0000, + CMSG_GUILD_RANKS = 0x1026, + CMSG_GUILD_REMOVE = 0x1231, + CMSG_GUILD_REPLACE_GUILD_MASTER = 0x1034, + CMSG_GUILD_REQUEST_CHALLENGE_UPDATE = 0x1224, + CMSG_GUILD_REQUEST_MAX_DAILY_XP = 0x3232, + CMSG_GUILD_ROSTER = 0x1226, CMSG_GUILD_SET_ACHIEVEMENT_TRACKING = 0x1027, - CMSG_GUILD_SET_NOTE = 0x0000, + CMSG_GUILD_SET_GUILD_MASTER = 0x3034, + CMSG_GUILD_SET_NOTE = 0x1233, + CMSG_GUILD_SET_RANK_PERMISSIONS = 0x1024, + CMSG_GUILD_SWITCH_RANK = 0x1221, CMSG_HEARTH_AND_RESURRECT = 0x4B34, CMSG_IGNORE_TRADE = 0x7112, CMSG_INITIATE_TRADE = 0x7916, @@ -238,38 +293,51 @@ enum Opcodes CMSG_INSTANCE_LOCK_WARNING_RESPONSE = 0x6234, CMSG_ITEM_REFUND = 0x6134, CMSG_ITEM_REFUND_INFO = 0x2206, - CMSG_ITEM_TEXT_QUERY = 0x0000, + CMSG_ITEM_TEXT_QUERY = 0x2406, CMSG_JOIN_CHANNEL = 0x0156, CMSG_KEEP_ALIVE = 0x0015, CMSG_LEARN_PREVIEW_TALENTS = 0x2415, - CMSG_LEARN_PREVIEW_TALENTS_PET = 0x0000, - CMSG_LEARN_TALENT = 0x6E24, + CMSG_LEARN_PREVIEW_TALENTS_PET = 0x6E24, + CMSG_LEARN_TALENT = 0x0306, CMSG_LEAVE_BATTLEFIELD = 0x0000, - CMSG_LEAVE_CHANNEL = 0x0000, + CMSG_LEAVE_CHANNEL = 0x2D56, CMSG_LFG_GET_PLAYER_INFO = 0x0000, - CMSG_LFG_JOIN = 0x2581, - CMSG_LFG_LEAVE = 0x0000, - CMSG_LFG_LFR_JOIN = 0x0000, - CMSG_LFG_LFR_LEAVE = 0x0000, + CMSG_LFG_GET_STATUS = 0x2581, + CMSG_LFG_JOIN = 0x2430, + CMSG_LFG_LEAVE = 0x2433, + CMSG_LFG_LFR_JOIN = 0x0531, + CMSG_LFG_LFR_LEAVE = 0x0500, CMSG_LFG_PARTY_LOCK_INFO_REQUEST = 0x0000, - CMSG_LFG_PROPOSAL_RESULT = 0x0000, - CMSG_LFG_SET_ROLES = 0x25B1, + CMSG_LFG_PROPOSAL_RESULT = 0x0403, + CMSG_LFG_SET_BOOT_VOTE = 0x04B3, + CMSG_LFG_SET_COMMENT = 0x0530, + CMSG_LFG_SET_ROLES = 0x0480, CMSG_LFG_TELEPORT = 0x2482, - CMSG_LF_GUILD_JOIN = 0x68C5, + CMSG_LF_GUILD_ADD_RECRUIT = 0x4448, + CMSG_LF_GUILD_BROWSE = 0x0548, + CMSG_LF_GUILD_DECLINE_RECRUIT = 0x1031, + CMSG_LF_GUILD_GET_APPLICATIONS = 0x1230, + CMSG_LF_GUILD_GET_RECRUITS = 0x3230, + CMSG_LF_GUILD_JOIN = 0x0000, + CMSG_LF_GUILD_POST_REQUEST = 0x3237, + CMSG_LF_GUILD_REMOVE_RECRUIT = 0x3027, + CMSG_LF_GUILD_SET_GUILD_POST = 0x0448, CMSG_LIST_INVENTORY = 0x2806, CMSG_LOAD_SCREEN = 0x2422, CMSG_LOGOUT_CANCEL = 0x2324, CMSG_LOGOUT_REQUEST = 0x0A25, CMSG_LOG_DISCONNECT = 0x446D, CMSG_LOOT = 0x0127, + CMSG_LOOT_CURRENCY = 0x781C, + CMSG_LOOT_MASTER_GIVE = 0x4F35, CMSG_LOOT_METHOD = 0x2F24, CMSG_LOOT_MONEY = 0x6227, CMSG_LOOT_RELEASE = 0x2007, - CMSG_LOOT_ROLL = 0x0000, + CMSG_LOOT_ROLL = 0x6934, CMSG_MAIL_CREATE_TEXT_ITEM = 0x0B14, CMSG_MAIL_DELETE = 0x6104, - CMSG_MAIL_MARK_AS_READ = 0x0000, - CMSG_MAIL_RETURN_TO_SENDER = 0x0000, + CMSG_MAIL_MARK_AS_READ = 0x0C07, + CMSG_MAIL_RETURN_TO_SENDER = 0x0816, CMSG_MAIL_TAKE_ITEM = 0x2B06, CMSG_MAIL_TAKE_MONEY = 0x4034, CMSG_MEETINGSTONE_INFO = 0x0000, @@ -292,10 +360,12 @@ enum Opcodes CMSG_MESSAGECHAT_SAY = 0x1154, CMSG_MESSAGECHAT_WHISPER = 0x0D56, CMSG_MESSAGECHAT_YELL = 0x3544, - CMSG_MINIGAME_MOVE = 0x0000, - CMSG_MOUNTSPECIAL_ANIM = 0x0217, + CMSG_MINIGAME_MOVE = 0x2A34, + CMSG_MOUNTSPECIAL_ANIM = 0x2807, CMSG_MOVE_CHARM_TELEPORT_CHEAT = 0x0000, + CMSG_MOVE_CHNG_TRANSPORT = 0x3102, CMSG_MOVE_ENABLE_SWIM_TO_FLY_TRANS_ACK = 0x0000, + CMSG_MOVE_FALL_RESET = 0x310A, CMSG_MOVE_FEATHER_FALL_ACK = 0x3110, CMSG_MOVE_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK = 0x310E, CMSG_MOVE_FORCE_FLIGHT_SPEED_CHANGE_ACK = 0x7314, @@ -306,58 +376,71 @@ enum Opcodes CMSG_MOVE_FORCE_SWIM_SPEED_CHANGE_ACK = 0x7A10, CMSG_MOVE_FORCE_TURN_RATE_CHANGE_ACK = 0x7316, CMSG_MOVE_FORCE_WALK_SPEED_CHANGE_ACK = 0x7210, - CMSG_MOVE_GRAVITY_DISABLE_ACK = 0x0000, - CMSG_MOVE_GRAVITY_ENABLE_ACK = 0x0000, + CMSG_MOVE_GRAVITY_DISABLE_ACK = 0x3118, + CMSG_MOVE_GRAVITY_ENABLE_ACK = 0x700A, CMSG_MOVE_HOVER_ACK = 0x3318, - CMSG_MOVE_KNOCK_BACK_ACK = 0x5CB4, + CMSG_MOVE_KNOCK_BACK_ACK = 0x721C, + CMSG_MOVE_NOT_ACTIVE_MOVER = 0x7A1A, + CMSG_MOVE_SET_CAN_FLY = 0x720E, CMSG_MOVE_SET_CAN_FLY_ACK = 0x790C, + CMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY_= 0x3014, CMSG_MOVE_SET_COLLISION_HEIGHT_ACK = 0x7114, CMSG_MOVE_SET_RELATIVE_POSITION = 0x0000, CMSG_MOVE_SET_VEHICLE_REC_ID_ACK = 0x0000, CMSG_MOVE_SPLINE_DONE = 0x790E, CMSG_MOVE_TIME_SKIPPED = 0x7A0A, CMSG_MOVE_TOGGLE_COLLISION_ACK = 0x0000, - CMSG_MOVE_WATER_WALK_ACK = 0x0000, + CMSG_MOVE_WATER_WALK_ACK = 0x3B00, CMSG_NAME_QUERY = 0x2224, CMSG_NEW_SPELL_SLOT = 0x0000, CMSG_NEXT_CINEMATIC_CAMERA = 0x2014, CMSG_NPC_TEXT_QUERY = 0x4E24, CMSG_OBJECT_UPDATE_FAILED = 0x3808, + CMSG_OBJECT_UPDATE_RESCUED = 0x3906, CMSG_OFFER_PETITION = 0x4817, - CMSG_OPENING_CINEMATIC = 0x0000, - CMSG_OPEN_ITEM = 0x0000, - CMSG_OPT_OUT_OF_LOOT = 0x0000, - CMSG_PAGE_TEXT_QUERY = 0x0000, + CMSG_OPENING_CINEMATIC = 0x0A16, + CMSG_OPEN_ITEM = 0x6A34, + CMSG_OPT_OUT_OF_LOOT = 0x6B16, + CMSG_PAGE_TEXT_QUERY = 0x6614, + CMSG_PARTY_SILENCE = 0x6B26, + CMSG_PARTY_UNSILENCE = 0x4D24, CMSG_PETITION_BUY = 0x4E05, - CMSG_PETITION_QUERY = 0x0000, - CMSG_PETITION_SHOWLIST = 0x0000, + CMSG_PETITION_QUERY = 0x4424, + CMSG_PETITION_SHOWLIST = 0x4617, CMSG_PETITION_SHOW_SIGNATURES = 0x0000, CMSG_PETITION_SIGN = 0x0E04, - CMSG_PET_ABANDON = 0x0000, + CMSG_PET_ABANDON = 0x0C24, CMSG_PET_ACTION = 0x0226, - CMSG_PET_CANCEL_AURA = 0x0000, + CMSG_PET_CANCEL_AURA = 0x4B25, CMSG_PET_CAST_SPELL = 0x6337, - CMSG_PET_LEARN_TALENT = 0x0000, - CMSG_PET_NAME_CACHE = 0x6F24, - CMSG_PET_NAME_QUERY = 0x0000, - CMSG_PET_RENAME = 0x0000, - CMSG_PET_SET_ACTION = 0x0000, - CMSG_PET_SPELL_AUTOCAST = 0x0000, - CMSG_PET_STOP_ATTACK = 0x0000, + CMSG_PET_LEARN_TALENT = 0x6725, + CMSG_PET_NAME_CACHE = 0x0000, + CMSG_PET_NAME_QUERY = 0x6F24, + CMSG_PET_RENAME = 0x6406, + CMSG_PET_SET_ACTION = 0x6904, + CMSG_PET_SPELL_AUTOCAST = 0x2514, + CMSG_PET_STOP_ATTACK = 0x6C14, CMSG_PING = 0x444D, CMSG_PLAYED_TIME = 0x0804, CMSG_PLAYER_DIFFICULTY_CHANGE = 0x0000, CMSG_PLAYER_LOGIN = 0x05B1, CMSG_PLAYER_LOGOUT = 0x0000, - CMSG_PLAYER_VEHICLE_ENTER = 0x0000, - CMSG_PLAY_DANCE = 0x0000, + CMSG_PLAYER_VEHICLE_ENTER = 0x2705, + CMSG_PLAY_DANCE = 0x6914, CMSG_PUSHQUESTTOPARTY = 0x4B14, + CMSG_PVP_LOG_DATA = 0x7308, CMSG_QUERY_BATTLEFIELD_STATE = 0x7202, + CMSG_QUERY_COMPLETION_NPC_RESPONSE = 0x7302, CMSG_QUERY_GUILD_MAX_XP = 0x0000, - CMSG_QUERY_GUILD_REWARDS = 0x0000, - CMSG_QUERY_GUILD_XP = 0x0000, + CMSG_QUERY_GUILD_MEMBERS_FOR_RECIPE = 0x1036, + CMSG_QUERY_GUILD_MEMBER_RECIPES = 0x1037, + CMSG_QUERY_GUILD_RECIPES = 0x3033, + CMSG_QUERY_GUILD_REWARDS = 0x3012, + CMSG_QUERY_GUILD_XP = 0x1237, + CMSG_QUERY_INSPECT_ACHIEVEMENTS = 0x4D27, CMSG_QUERY_QUESTS_COMPLETED = 0x2317, CMSG_QUERY_TIME = 0x0A36, + CMSG_QUERY_VOID_STORAGE = 0x790A, CMSG_QUESTGIVER_ACCEPT_QUEST = 0x6B37, CMSG_QUESTGIVER_CANCEL = 0x0000, CMSG_QUESTGIVER_CHOOSE_REWARD = 0x2125, @@ -368,45 +451,57 @@ enum Opcodes CMSG_QUESTGIVER_REQUEST_REWARD = 0x2534, CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY = 0x6305, CMSG_QUESTGIVER_STATUS_QUERY = 0x4407, - CMSG_QUESTLOG_REMOVE_QUEST = 0x0000, + CMSG_QUESTLOG_REMOVE_QUEST = 0x0D16, CMSG_QUESTLOG_SWAP_QUEST = 0x0000, - CMSG_QUEST_CONFIRM_ACCEPT = 0x0000, + CMSG_QUEST_CONFIRM_ACCEPT = 0x0D15, CMSG_QUEST_NPC_QUERY = 0x0000, CMSG_QUEST_POI_QUERY = 0x4037, CMSG_QUEST_QUERY = 0x0D06, CMSG_RANDOMIZE_CHAR_NAME = 0x2413, CMSG_READY_FOR_ACCOUNT_DATA_TIMES = 0x2B16, - CMSG_READ_ITEM = 0x0000, + CMSG_READ_ITEM = 0x2F16, CMSG_REALM_SPLIT = 0x2906, CMSG_RECLAIM_CORPSE = 0x4036, CMSG_REDIRECTION_AUTH_PROOF = 0x044D, + CMSG_REFORGE_ITEM = 0x331A, + CMSG_REORDER_CHARACTERS = 0x0593, CMSG_REPAIR_ITEM = 0x2917, CMSG_REPLACE_ACCOUNT_DATA = 0x0000, - CMSG_REPOP_REQUEST = 0x6B16, - CMSG_REPORT_PVP_AFK = 0x0000, + CMSG_REPOP_REQUEST = 0x6235, + CMSG_REPORT_PVP_AFK = 0x6734, CMSG_REQUEST_ACCOUNT_DATA = 0x6505, CMSG_REQUEST_CATEGORY_COOLDOWNS = 0x7102, CMSG_REQUEST_CEMETERY_LIST = 0x720A, CMSG_REQUEST_GUILD_PARTY_STATE = 0x3900, + CMSG_REQUEST_HONOR_STATS = 0x791E, CMSG_REQUEST_HOTFIX = 0x2401, CMSG_REQUEST_INSPECT_RATED_BG_STATS = 0x3010, CMSG_REQUEST_PARTY_MEMBER_STATS = 0x0C04, CMSG_REQUEST_PET_INFO = 0x4924, + CMSG_REQUEST_PVP_OPTIONS_ENABLED = 0x24A1, + CMSG_REQUEST_PVP_REWARDS = 0x780C, CMSG_REQUEST_RAID_INFO = 0x2F26, - CMSG_REQUEST_RATED_BG_INFO = 0x34A1, - CMSG_REQUEST_VEHICLE_EXIT = 0x0000, - CMSG_REQUEST_VEHICLE_NEXT_SEAT = 0x0000, - CMSG_REQUEST_VEHICLE_PREV_SEAT = 0x4434, - CMSG_REQUEST_VEHICLE_SWITCH_SEAT = 0x0000, + CMSG_REQUEST_RATED_BG_INFO = 0x2423, + CMSG_REQUEST_RATED_BG_STATS = 0x05B3, + CMSG_REQUEST_RESEARCH_HISTORY = 0x3306, + CMSG_REQUEST_VEHICLE_EXIT = 0x2B35, + CMSG_REQUEST_VEHICLE_NEXT_SEAT = 0x4434, + CMSG_REQUEST_VEHICLE_PREV_SEAT = 0x4C04, + CMSG_REQUEST_VEHICLE_SWITCH_SEAT = 0x4C14, CMSG_RESET_FACTION_CHEAT = 0x4469, CMSG_RESET_INSTANCES = 0x6E14, CMSG_RESURRECT_RESPONSE = 0x6827, - CMSG_RETURN_TO_GRAVEYARD = 0x0000, + CMSG_RETURN_TO_GRAVEYARD = 0x301E, + CMSG_ROLE_POLL_BEGIN = 0x0430, + CMSG_SAVE_CUF_PROFILES = 0x730E, CMSG_SAVE_PLAYER = 0x0000, CMSG_SEARCH_LFG_JOIN = 0x0000, CMSG_SEARCH_LFG_LEAVE = 0x0000, CMSG_SELF_RES = 0x6115, CMSG_SELL_ITEM = 0x4E15, + CMSG_SEND_MAIL = 0x0523, + CMSG_SEND_SOR_REQUEST_VIA_ADDRESS = 0x0420, + CMSG_SEND_SOR_REQUEST_VIA_BNET_ACCOUNT_ID = 0x0482, CMSG_SERVERTIME = 0x0000, CMSG_SETDEATHBINDPOINT = 0x0000, CMSG_SETSHEATHED = 0x4326, @@ -417,74 +512,95 @@ enum Opcodes CMSG_SET_ALLOW_LOW_LEVEL_RAID1 = 0x4435, CMSG_SET_ALLOW_LOW_LEVEL_RAID2 = 0x0536, CMSG_SET_CHANNEL_WATCH = 0x4517, - CMSG_SET_CONTACT_NOTES = 0x0000, - CMSG_SET_FACTION_ATWAR = 0x0000, + CMSG_SET_CONTACT_NOTES = 0x6135, + CMSG_SET_CURRENCY_FLAGS = 0x7306, + CMSG_SET_EVERYONE_IS_ASSISTANT = 0x2530, + CMSG_SET_FACTION_ATWAR = 0x0706, CMSG_SET_FACTION_CHEAT = 0x0000, + CMSG_SET_FACTION_INACTIVE = 0x0E37, CMSG_SET_GUILD_BANK_TEXT = 0x0000, CMSG_SET_LFG_COMMENT = 0x0000, - CMSG_SET_PLAYER_DECLINED_NAMES = 0x0000, + CMSG_SET_PET_SLOT = 0x3A04, + CMSG_SET_PLAYER_DECLINED_NAMES = 0x6316, + CMSG_SET_PREFERED_CEMETERY = 0x311E, CMSG_SET_PRIMARY_TALENT_TREE = 0x4524, + CMSG_SET_RELATIVE_POSITION = 0x311A, CMSG_SET_SAVED_INSTANCE_EXTEND = 0x6706, CMSG_SET_SELECTION = 0x0506, CMSG_SET_SKILL_CHEAT = 0x0000, CMSG_SET_TAXI_BENCHMARK_MODE = 0x4314, CMSG_SET_TITLE = 0x2117, + CMSG_SET_TRADE_CURRENCY = 0x3312, CMSG_SET_TRADE_GOLD = 0x3008, CMSG_SET_TRADE_ITEM = 0x7B0C, - CMSG_SET_WATCHED_FACTION = 0x0000, + CMSG_SET_VEHICLE_REC_ID_ACK = 0x3108, + CMSG_SET_WATCHED_FACTION = 0x2434, CMSG_SHOWING_CLOAK = 0x4135, CMSG_SHOWING_HELM = 0x0735, CMSG_SOCKET_GEMS = 0x2F04, CMSG_SPELLCLICK = 0x0805, CMSG_SPIRIT_HEALER_ACTIVATE = 0x2E26, - CMSG_SPLIT_ITEM = 0x0000, + CMSG_SPLIT_ITEM = 0x0F17, CMSG_STANDSTATECHANGE = 0x0535, CMSG_START_QUEST = 0x0000, - CMSG_STOP_DANCE = 0x4637, + CMSG_STOP_DANCE = 0x2907, CMSG_STORE_LOOT_IN_SLOT = 0x0000, - CMSG_SUMMON_RESPONSE = 0x0000, + CMSG_SUBMIT_BUG = 0x2520, + CMSG_SUBMIT_COMPLAIN = 0x2501, + CMSG_SUGGESTION_SUBMIT = 0x2512, + CMSG_SUMMON_RESPONSE = 0x6F27, CMSG_SUSPEND_TOKEN = 0x046D, CMSG_SWAP_INV_ITEM = 0x2614, CMSG_SWAP_ITEM = 0x6326, + CMSG_SWAP_VOID_ITEM = 0x3204, CMSG_SYNC_DANCE = 0x0036, CMSG_TAXICLEARALLNODES = 0x0000, CMSG_TAXIENABLEALLNODES = 0x0000, CMSG_TAXINODE_STATUS_QUERY = 0x2F25, - CMSG_TAXIQUERYAVAILABLENODES = 0x0000, + CMSG_TAXIQUERYAVAILABLENODES = 0x6C06, CMSG_TAXISHOWNODES = 0x0000, - CMSG_TELEPORT_TO_UNIT = 0x0000, + CMSG_TELEPORT_TO_UNIT = 0x4206, CMSG_TEXT_EMOTE = 0x2E24, + CMSG_TIME_ADJUSTMENT_RESPONSE = 0x3818, CMSG_TIME_SYNC_RESP = 0x3B0C, + CMSG_TIME_SYNC_RESP_FAILED = 0x710A, CMSG_TOGGLE_PVP = 0x6815, CMSG_TOTEM_DESTROYED = 0x4207, CMSG_TRAINER_BUY_SPELL = 0x4415, CMSG_TRAINER_LIST = 0x2336, + CMSG_TRANSMOGRIFY_ITEMS = 0x3B0E, CMSG_TRIGGER_CINEMATIC_CHEAT = 0x0000, - CMSG_TURN_IN_PETITION = 0x0000, - CMSG_TUTORIAL_CLEAR = 0x0000, - CMSG_TUTORIAL_FLAG = 0x0000, - CMSG_TUTORIAL_RESET = 0x0000, + CMSG_TURN_IN_PETITION = 0x0B27, + CMSG_TUTORIAL_CLEAR = 0x6515, + CMSG_TUTORIAL_FLAG = 0x6C26, + CMSG_TUTORIAL_RESET = 0x2726, CMSG_UNACCEPT_TRADE = 0x391A, - CMSG_UNLEARN_SKILL = 0x0000, + CMSG_UNLEARN_SKILL = 0x6106, + CMSG_UNLEARN_SPECIALIZATION = 0x3210, + CMSG_UNLOCK_VOID_STORAGE = 0x7B14, CMSG_UNREGISTER_ALL_ADDON_PREFIXES = 0x3D54, CMSG_UPDATE_ACCOUNT_DATA = 0x4736, - CMSG_UPDATE_MISSILE_TRAJECTORY = 0x0000, - CMSG_UPDATE_PROJECTILE_POSITION = 0x0000, + CMSG_UPDATE_MISSILE_TRAJECTORY = 0x781E, + CMSG_UPDATE_PROJECTILE_POSITION = 0x0E24, + CMSG_USED_FOLLOW = 0x7912, CMSG_USE_ITEM = 0x2C06, CMSG_VIOLENCE_LEVEL = 0x7816, CMSG_VOICE_SESSION_ENABLE = 0x2314, + CMSG_VOID_STORAGE_TRANSFER = 0x380E, CMSG_WARDEN_DATA = 0x25A2, + CMSG_WARGAME_ACCEPT = 0x2410, + CMSG_WARGAME_START = 0x05A0, CMSG_WHO = 0x6C15, CMSG_WHOIS = 0x6B05, CMSG_WORLD_STATE_UI_TIMER_UPDATE = 0x4605, - CMSG_WORLD_TELEPORT = 0x3330, - CMSG_WRAP_ITEM = 0x0000, + CMSG_WORLD_TELEPORT = 0x24B2, + CMSG_WRAP_ITEM = 0x4F06, CMSG_ZONEUPDATE = 0x4F37, MSG_AUCTION_HELLO = 0x2307, MSG_BATTLEGROUND_PLAYER_POSITIONS = 0x0000, MSG_CHANNEL_START = 0x0A15, MSG_CHANNEL_UPDATE = 0x2417, - MSG_CORPSE_QUERY = 0x0000, + MSG_CORPSE_QUERY = 0x4336, MSG_GM_BIND_OTHER = 0x0000, MSG_GM_SHOWLABEL = 0x0000, MSG_GM_SUMMON = 0x0000, @@ -502,7 +618,7 @@ enum Opcodes MSG_MOVE_HOVER = 0x0000, MSG_MOVE_JUMP = 0x7A06, MSG_MOVE_SET_ALL_SPEED_CHEAT = 0x0000, - MSG_MOVE_SET_COLLISION_HEIGHT = 0x59A3, + MSG_MOVE_SET_COLLISION_HEIGHT = 0x0000, MSG_MOVE_SET_FACING = 0x7914, MSG_MOVE_SET_FLIGHT_SPEED_CHEAT = 0x0000, MSG_MOVE_SET_PITCH = 0x7312, @@ -539,6 +655,7 @@ enum Opcodes MSG_MOVE_TOGGLE_COLLISION_CHEAT = 0x7B04, MSG_MOVE_TOGGLE_FALL_LOGGING = 0x0000, MSG_MOVE_TOGGLE_LOGGING = 0x0000, + MSG_MOVE_UNROOT = 0x7DB4, MSG_MOVE_UPDATE_CAN_FLY = 0x0000, MSG_MOVE_UPDATE_FLIGHT_SPEED = 0x30B1, MSG_MOVE_UPDATE_MOUSE = 0x0000, @@ -546,43 +663,46 @@ enum Opcodes MSG_MOVE_UPDATE_TELEPORT = 0x50B2, MSG_MOVE_WATER_WALK = 0x0000, MSG_MOVE_WORLDPORT_ACK = 0x2411, - MSG_NOTIFY_PARTY_SQUELCH = 0x0000, + MSG_NOTIFY_PARTY_SQUELCH = 0x4D06, MSG_PARTY_ASSIGNMENT = 0x0000, - MSG_PETITION_DECLINE = 0x31E0, + MSG_PETITION_DECLINE = 0x4905, MSG_PETITION_RENAME = 0x4005, - MSG_PVP_LOG_DATA = 0x5CB2, + MSG_PVP_LOG_DATA = 0x0000, MSG_QUERY_GUILD_BANK_TEXT = 0x0000, MSG_QUERY_NEXT_MAIL_TIME = 0x0F04, MSG_QUEST_PUSH_RESULT = 0x4515, MSG_RAID_READY_CHECK = 0x2304, MSG_RAID_READY_CHECK_CONFIRM = 0x4F05, - MSG_RAID_READY_CHECK_FINISHED = 0x0000, + MSG_RAID_READY_CHECK_FINISHED = 0x2E15, MSG_RAID_TARGET_UPDATE = 0x2C36, MSG_RANDOM_ROLL = 0x0905, MSG_SAVE_GUILD_EMBLEM = 0x2404, MSG_SET_DUNGEON_DIFFICULTY = 0x4925, MSG_SET_RAID_DIFFICULTY = 0x0614, - MSG_START_MOVE_FORWARD = 0x7814, + MSG_START_MOVE_FORWARD = 0x0000, MSG_TABARDVENDOR_ACTIVATE = 0x6926, - MSG_TALENT_WIPE_CONFIRM = 0x0000, + MSG_TALENT_WIPE_CONFIRM = 0x0107, MSG_VERIFY_CONNECTIVITY = 0x4F57, SMSG_ACCOUNT_DATA_TIMES = 0x4B05, + SMSG_ACCOUNT_INFO_RESPONSE = 0x10A7, + SMSG_ACCOUNT_RESTRICTED_WARNING = 0x51A7, SMSG_ACHIEVEMENT_DELETED = 0x6A16, SMSG_ACHIEVEMENT_EARNED = 0x4405, SMSG_ACTION_BUTTONS = 0x38B5, SMSG_ACTIVATETAXIREPLY = 0x6A37, SMSG_ADDON_INFO = 0x2C14, - SMSG_ADD_RUNE_POWER = 0x0000, + SMSG_ADD_RUNE_POWER = 0x6915, SMSG_AI_REACTION = 0x0637, SMSG_ALL_ACHIEVEMENT_DATA = 0x58B1, - SMSG_AREA_SPIRIT_HEALER_TIME = 0x0000, - SMSG_AREA_TRIGGER_MESSAGE = 0x0000, + SMSG_AREA_SPIRIT_HEALER_TIME = 0x0734, + SMSG_AREA_TRIGGER_MESSAGE = 0x4505, + SMSG_AREA_TRIGGER_MOVEMENT_UPDATE = 0x3DB1, SMSG_ARENA_ERROR = 0x2D17, SMSG_ARENA_OPPONENT_UPDATE = 0x2637, - SMSG_ARENA_TEAM_CHANGE_FAILED_QUEUED = 0x0000, + SMSG_ARENA_TEAM_CHANGE_FAILED_QUEUED = 0x6E34, SMSG_ARENA_TEAM_COMMAND_RESULT = 0x39B3, SMSG_ARENA_TEAM_EVENT = 0x0617, - SMSG_ARENA_TEAM_INVITE = 0x0000, + SMSG_ARENA_TEAM_INVITE = 0x0F36, SMSG_ARENA_TEAM_QUERY_RESPONSE = 0x6336, SMSG_ARENA_TEAM_ROSTER = 0x2717, SMSG_ARENA_TEAM_STATS = 0x4425, @@ -591,8 +711,8 @@ enum Opcodes SMSG_ATTACKSTOP = 0x0934, SMSG_ATTACKSWING_BADFACING = 0x0B36, SMSG_ATTACKSWING_CANT_ATTACK = 0x0016, - SMSG_ATTACKSWING_DEADTARGET = 0x0000, - SMSG_ATTACKSWING_NOTINRANGE = 0x0000, + SMSG_ATTACKSWING_DEADTARGET = 0x2B26, + SMSG_ATTACKSWING_NOTINRANGE = 0x6C07, SMSG_AUCTION_BIDDER_LIST_RESULT = 0x6637, SMSG_AUCTION_BIDDER_NOTIFICATION = 0x4E27, SMSG_AUCTION_COMMAND_RESULT = 0x4C25, @@ -602,30 +722,35 @@ enum Opcodes SMSG_AUCTION_OWNER_NOTIFICATION = 0x4116, SMSG_AUCTION_REMOVED_NOTIFICATION = 0x2334, SMSG_AURACASTLOG = 0x0000, + SMSG_AURA_POINTS_DEPLETED = 0x7CB7, SMSG_AURA_UPDATE = 0x4707, SMSG_AURA_UPDATE_ALL = 0x6916, SMSG_AUTH_CHALLENGE = 0x4542, SMSG_AUTH_RESPONSE = 0x5DB6, SMSG_AVAILABLE_VOICE_CHANNEL = 0x2E16, + SMSG_AVERAGE_ITEM_LEVEL_INFORM = 0x5DA7, SMSG_BARBER_SHOP_RESULT = 0x6125, SMSG_BATTLEFIELD_LIST = 0x71B5, SMSG_BATTLEFIELD_MGR_EJECTED = 0x7DB7, - SMSG_BATTLEFIELD_MGR_EJECT_PENDING = 0x15A6, + SMSG_BATTLEFIELD_MGR_EJECT_PENDING = 0x34A2, SMSG_BATTLEFIELD_MGR_ENTERED = 0x5CA0, SMSG_BATTLEFIELD_MGR_ENTRY_INVITE = 0x34B3, - SMSG_BATTLEFIELD_MGR_QUEUE_INVITE = 0x0000, + SMSG_BATTLEFIELD_MGR_EXIT_REQUEST = 0x51B1, + SMSG_BATTLEFIELD_MGR_QUEUE_INVITE = 0x15A6, SMSG_BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE = 0x79B6, SMSG_BATTLEFIELD_MGR_STATE_CHANGE = 0x35B4, SMSG_BATTLEFIELD_PLAYER_POSITIONS = 0x58B4, - SMSG_BATTLEFIELD_PORT_DENIED = 0x0000, - SMSG_BATTLEFIELD_STATUS = 0x0000, + SMSG_BATTLEFIELD_PORT_DENIED = 0x35A3, + SMSG_BATTLEFIELD_RATED_INFO = 0x54A3, + SMSG_BATTLEFIELD_STATUS = 0x7DA1, SMSG_BATTLEFIELD_STATUS1 = 0x0000, SMSG_BATTLEFIELD_STATUS2 = 0x74A4, SMSG_BATTLEFIELD_STATUS3 = 0x59A0, SMSG_BATTLEFIELD_STATUS4 = 0x75A2, - SMSG_BATTLEGROUND_INFO_THROTTLED = 0x0000, - SMSG_BATTLEGROUND_PLAYER_JOINED = 0x0000, - SMSG_BATTLEGROUND_PLAYER_LEFT = 0x0000, + SMSG_BATTLEFIELD_STATUS_FAILED = 0x71A7, + SMSG_BATTLEGROUND_INFO_THROTTLED = 0x34B2, + SMSG_BATTLEGROUND_PLAYER_JOINED = 0x50B0, + SMSG_BATTLEGROUND_PLAYER_LEFT = 0x59A6, SMSG_BATTLEGROUND_PLAYER_POSITIONS = 0x0000, SMSG_BINDER_CONFIRM = 0x2835, SMSG_BINDPOINTUPDATE = 0x0527, @@ -635,32 +760,33 @@ enum Opcodes SMSG_BUY_FAILED = 0x6435, SMSG_BUY_ITEM = 0x0F26, SMSG_CALENDAR_ACTION_PENDING = 0x0000, - SMSG_CALENDAR_ARENA_TEAM = 0x0000, - SMSG_CALENDAR_CLEAR_PENDING_ACTION = 0x0000, + SMSG_CALENDAR_ARENA_TEAM = 0x0615, + SMSG_CALENDAR_CLEAR_PENDING_ACTION = 0x2106, SMSG_CALENDAR_COMMAND_RESULT = 0x6F36, - SMSG_CALENDAR_EVENT_INVITE = 0x0725, - SMSG_CALENDAR_EVENT_INVITE_ALERT = 0x0000, - SMSG_CALENDAR_EVENT_INVITE_NOTES = 0x0000, - SMSG_CALENDAR_EVENT_INVITE_NOTES_ALERT = 0x0000, - SMSG_CALENDAR_EVENT_INVITE_REMOVED = 0x0000, - SMSG_CALENDAR_EVENT_INVITE_REMOVED_ALERT = 0x0000, - SMSG_CALENDAR_EVENT_INVITE_STATUS_ALERT = 0x0000, - SMSG_CALENDAR_EVENT_MODERATOR_STATUS_ALERT = 0x0000, - SMSG_CALENDAR_EVENT_REMOVED_ALERT = 0x0000, - SMSG_CALENDAR_EVENT_STATUS = 0x0000, + SMSG_CALENDAR_EVENT_INVITE = 0x4E16, + SMSG_CALENDAR_EVENT_INVITE_ALERT = 0x2A05, + SMSG_CALENDAR_EVENT_INVITE_NOTES = 0x0E17, + SMSG_CALENDAR_EVENT_INVITE_NOTES_ALERT = 0x2535, + SMSG_CALENDAR_EVENT_INVITE_REMOVED = 0x0725, + SMSG_CALENDAR_EVENT_INVITE_REMOVED_ALERT = 0x2617, + SMSG_CALENDAR_EVENT_INVITE_STATUS_ALERT = 0x6625, + SMSG_CALENDAR_EVENT_MODERATOR_STATUS_ALERT = 0x6B06, + SMSG_CALENDAR_EVENT_REMOVED_ALERT = 0x6D35, + SMSG_CALENDAR_EVENT_STATUS = 0x2A27, SMSG_CALENDAR_EVENT_UPDATED_ALERT = 0x0907, - SMSG_CALENDAR_RAID_LOCKOUT_ADDED = 0x0000, - SMSG_CALENDAR_RAID_LOCKOUT_REMOVED = 0x0000, - SMSG_CALENDAR_RAID_LOCKOUT_UPDATED = 0x0000, + SMSG_CALENDAR_FILTER_GUILD = 0x4A26, + SMSG_CALENDAR_RAID_LOCKOUT_ADDED = 0x2305, + SMSG_CALENDAR_RAID_LOCKOUT_REMOVED = 0x2E25, + SMSG_CALENDAR_RAID_LOCKOUT_UPDATED = 0x4636, SMSG_CALENDAR_SEND_CALENDAR = 0x6805, - SMSG_CALENDAR_SEND_EVENT = 0x0000, + SMSG_CALENDAR_SEND_EVENT = 0x0C35, SMSG_CALENDAR_SEND_NUM_PENDING = 0x0C17, SMSG_CALENDAR_UPDATE_INVITE_LIST = 0x0000, SMSG_CAMERA_SHAKE = 0x4214, SMSG_CANCEL_AUTO_REPEAT = 0x6436, SMSG_CANCEL_COMBAT = 0x4F04, SMSG_CAST_FAILED = 0x4D16, - SMSG_CHANNEL_LIST = 0x0000, + SMSG_CHANNEL_LIST = 0x2214, SMSG_CHANNEL_MEMBER_COUNT = 0x6414, SMSG_CHANNEL_NOTIFY = 0x0825, SMSG_CHARACTER_LOGIN_FAILED = 0x4417, @@ -670,84 +796,114 @@ enum Opcodes SMSG_CHAR_ENUM = 0x10B0, SMSG_CHAR_FACTION_CHANGE = 0x4C06, SMSG_CHAR_RENAME = 0x2024, - SMSG_CHAT_PLAYER_AMBIGUOUS = 0x0000, - SMSG_CHAT_PLAYER_NOT_FOUND = 0x0000, - SMSG_CHAT_RESTRICTED = 0x0000, - SMSG_CHAT_WRONG_FACTION = 0x0000, + SMSG_CHAT_IGNORED_ACCOUNT_MUTED = 0x15A4, + SMSG_CHAT_NOT_IN_PARTY = 0x6A14, + SMSG_CHAT_PLAYER_AMBIGUOUS = 0x2F34, + SMSG_CHAT_PLAYER_NOT_FOUND = 0x2526, + SMSG_CHAT_RESTRICTED = 0x6536, + SMSG_CHAT_SERVER_DISCONNECTED = 0x6D34, + SMSG_CHAT_SERVER_RECONNECTED = 0x6905, + SMSG_CHAT_WRONG_FACTION = 0x6724, SMSG_CHECK_FOR_BOTS = 0x0000, + SMSG_CLEAR_BOSS_EMOTES = 0x19A3, SMSG_CLEAR_COOLDOWN = 0x0000, + SMSG_CLEAR_COOLDOWNS = 0x59B4, + SMSG_CLEAR_FAR_SIGHT_IMMEDIATE = 0x2A04, SMSG_CLEAR_TARGET = 0x4B26, SMSG_CLIENTCACHE_VERSION = 0x2734, SMSG_CLIENT_CONTROL_UPDATE = 0x2837, + SMSG_COMBAT_EVENT_FAILED = 0x2B07, SMSG_COMBAT_LOG_MULTIPLE = 0x0000, SMSG_COMMENTATOR_MAP_INFO = 0x0327, - SMSG_COMMENTATOR_PLAYER_INFO = 0x0000, + SMSG_COMMENTATOR_PARTY_INFO = 0x38B0, + SMSG_COMMENTATOR_PLAYER_INFO = 0x2F36, + SMSG_COMMENTATOR_SKIRMISH_QUEUE_RESULT1 = 0x2126, + SMSG_COMMENTATOR_SKIRMISH_QUEUE_RESULT2 = 0x6814, SMSG_COMMENTATOR_STATE_CHANGED = 0x0737, - SMSG_COMPLAIN_RESULT = 0x0000, - SMSG_COMPLETION_NPC_RESPONCE = 0x75A1, + SMSG_COMPLAIN_RESULT = 0x6D24, + SMSG_COMPLETION_NPC_RESPONCE = 0x0000, + SMSG_COMPLETION_NPC_RESPONSE = 0x75A1, SMSG_COMPRESSED_ACHIEVEMENT_DATA = 0x0000, SMSG_COMPRESSED_CHAR_ENUM = 0x0000, SMSG_COMPRESSED_GUILD_ROSTER = 0x0000, SMSG_COMPRESSED_MOVES = 0x0517, SMSG_COMPRESSED_UPDATE_OBJECT = 0x0000, + SMSG_COMSAT_CONNECT_FAIL = 0x6317, SMSG_COMSAT_DISCONNECT = 0x0316, + SMSG_COMSAT_RECONNECT_TRY = 0x4D35, SMSG_CONTACT_LIST = 0x6017, - SMSG_CONVERT_RUNE = 0x0000, + SMSG_CONVERT_RUNE = 0x4F14, SMSG_COOLDOWN_CHEAT = 0x0627, SMSG_COOLDOWN_EVENT = 0x4F26, - SMSG_CORPSE_MAP_POSITION_QUERY_RESPONSE = 0x0000, - SMSG_CORPSE_NOT_IN_INSTANCE = 0x0000, + SMSG_CORPSE_MAP_POSITION_QUERY_RESPONSE = 0x0E35, + SMSG_CORPSE_NOT_IN_INSTANCE = 0x2A14, SMSG_CORPSE_RECLAIM_DELAY = 0x0D34, SMSG_CREATURE_QUERY_RESPONSE = 0x6024, SMSG_CRITERIA_DELETED = 0x2915, SMSG_CRITERIA_UPDATE = 0x6E37, SMSG_CROSSED_INEBRIATION_THRESHOLD = 0x2036, + SMSG_CURRENCY_LOOT_REMOVED = 0x1DB4, + SMSG_CURRENCY_LOOT_RESTORED = 0x30A0, + SMSG_CUSTOM_LOAD_SCREEN = 0x1DB6, SMSG_DAMAGE_CALC_LOG = 0x2436, SMSG_DAMAGE_DONE_OBSOLETE = 0x0000, SMSG_DANCE_QUERY_RESPONSE = 0x2F06, SMSG_DB_REPLY = 0x38A4, SMSG_DEATH_RELEASE_LOC = 0x2F07, + SMSG_DEBUG_RUNE_REGEN = 0x31B3, SMSG_DEFENSE_MESSAGE = 0x0314, SMSG_DESTROY_OBJECT = 0x4724, - SMSG_DESTRUCTIBLE_BUILDING_DAMAGE = 0x0000, + SMSG_DESTRUCTIBLE_BUILDING_DAMAGE = 0x4825, + SMSG_DIFFERENT_INSTANCE_FROM_PARTY = 0x15B1, + SMSG_DISENCHANT_CREDIT = 0x55A2, SMSG_DISMOUNT = 0x2135, SMSG_DISMOUNTRESULT = 0x0D25, SMSG_DISPEL_FAILED = 0x0307, + SMSG_DISPLAY_GAME_ERROR = 0x31A6, + SMSG_DONT_AUTO_PUSH_SPELLS_TO_ACTION_BAR = 0x38A2, + SMSG_DROP_NEW_CONNECTION = 0x4D40, SMSG_DUEL_COMPLETE = 0x2527, SMSG_DUEL_COUNTDOWN = 0x4836, - SMSG_DUEL_INBOUNDS = 0x0000, - SMSG_DUEL_OUTOFBOUNDS = 0x0000, + SMSG_DUEL_INBOUNDS = 0x0A27, + SMSG_DUEL_OUTOFBOUNDS = 0x0C26, SMSG_DUEL_REQUESTED = 0x4504, SMSG_DUEL_WINNER = 0x2D36, - SMSG_DURABILITY_DAMAGE_DEATH = 0x0000, + SMSG_DUMP_RIDE_TICKETS_RESPONSE = 0x11A3, + SMSG_DURABILITY_DAMAGE_DEATH = 0x4C27, SMSG_ECHO_PARTY_SQUELCH = 0x0814, SMSG_EMOTE = 0x0A34, - SMSG_ENABLE_BARBER_SHOP = 0x0000, + SMSG_ENABLE_BARBER_SHOP = 0x2D16, SMSG_ENCHANTMENTLOG = 0x6035, - SMSG_ENVIRONMENTALDAMAGELOG = 0x0000, + SMSG_ENVIRONMENTALDAMAGELOG = 0x6C05, SMSG_EQUIPMENT_SET_LIST = 0x2E04, - SMSG_EQUIPMENT_SET_SAVED = 0x0000, - SMSG_EQUIPMENT_SET_USE_RESULT = 0x0000, + SMSG_EQUIPMENT_SET_SAVED = 0x2216, + SMSG_EQUIPMENT_SET_USE_RESULT = 0x2424, SMSG_EXPECTED_SPAM_RECORDS = 0x4D36, SMSG_EXPLORATION_EXPERIENCE = 0x6716, SMSG_FAILED_PLAYER_CONDITION = 0x19A4, SMSG_FEATURE_SYSTEM_STATUS = 0x3DB7, + SMSG_FEIGN_DEATH_RESISTED = 0x0D05, SMSG_FISH_ESCAPED = 0x2205, SMSG_FISH_NOT_HOOKED = 0x0A17, SMSG_FLIGHT_SPLINE_SYNC = 0x0924, + SMSG_FLOOD_DETECTED = 0x0542, SMSG_FORCEACTIONSHOW = 0x0000, - SMSG_FORCED_DEATH_UPDATE = 0x0000, + SMSG_FORCED_DEATH_UPDATE = 0x2606, SMSG_FORCE_DISPLAY_UPDATE = 0x0000, SMSG_FORCE_SEND_QUEUED_PACKETS = 0x0140, + SMSG_FORCE_SET_VEHICLE_REC_ID = 0x70A1, + SMSG_FORGE_MASTER_SET = 0x70B7, SMSG_FRIEND_STATUS = 0x0717, SMSG_GAMEOBJECT_CUSTOM_ANIM = 0x4936, SMSG_GAMEOBJECT_DESPAWN_ANIM = 0x6735, - SMSG_GAMEOBJECT_PAGETEXT = 0x0000, + SMSG_GAMEOBJECT_PAGETEXT = 0x2925, SMSG_GAMEOBJECT_QUERY_RESPONSE = 0x0915, - SMSG_GAMEOBJECT_RESET_STATE = 0x0000, + SMSG_GAMEOBJECT_RESET_STATE = 0x2A16, SMSG_GAMESPEED_SET = 0x4E34, SMSG_GAMETIME_SET = 0x0014, SMSG_GAMETIME_UPDATE = 0x4127, + SMSG_GAME_EVENT_DEBUG_LOG = 0x31A7, + SMSG_GAME_OBJECT_ACTIVATE_ANIM_KIT = 0x14A3, SMSG_GMRESPONSE_DB_ERROR = 0x0006, SMSG_GMRESPONSE_RECEIVED = 0x2E34, SMSG_GMRESPONSE_STATUS_UPDATE = 0x0A04, @@ -757,13 +913,15 @@ enum Opcodes SMSG_GMTICKET_SYSTEMSTATUS = 0x0D35, SMSG_GMTICKET_UPDATETEXT = 0x6535, SMSG_GM_MESSAGECHAT = 0x6434, + SMSG_GM_PLAYER_INFO = 0x4A15, SMSG_GM_TICKET_STATUS_UPDATE = 0x2C25, SMSG_GODMODE = 0x0405, SMSG_GOSSIP_COMPLETE = 0x0806, SMSG_GOSSIP_MESSAGE = 0x2035, SMSG_GOSSIP_POI = 0x4316, - SMSG_GROUP_CANCEL = 0x0000, - SMSG_GROUP_DECLINE = 0x0000, + SMSG_GROUPACTION_THROTTLED = 0x6524, + SMSG_GROUP_CANCEL = 0x4D25, + SMSG_GROUP_DECLINE = 0x6835, SMSG_GROUP_DESTROYED = 0x0000, SMSG_GROUP_INVITE = 0x31B2, SMSG_GROUP_JOINED_BATTLEGROUND = 0x35A1, @@ -774,85 +932,118 @@ enum Opcodes SMSG_GUILD_ACHIEVEMENT_DATA = 0x54B7, SMSG_GUILD_ACHIEVEMENT_DELETED = 0x35A0, SMSG_GUILD_ACHIEVEMENT_EARNED = 0x50B5, + SMSG_GUILD_ACHIEVEMENT_MEMBERS = 0x38A5, SMSG_GUILD_BANK_LIST = 0x78A5, - SMSG_GUILD_BANK_MONEY_WITHDRAWN = 0x5DB4, + SMSG_GUILD_BANK_LOG_QUERY_RESULTS = 0x30B2, + SMSG_GUILD_BANK_MONEY_WITHDRAWN = 0x0000, + SMSG_GUILD_BANK_QUERY_TEXT_RESULTS = 0x75A3, + SMSG_GUILD_BANK_REM_MONEY_WITHDRAW_QUERY = 0x5DB4, SMSG_GUILD_CANCEL = 0x0000, + SMSG_GUILD_CHALLENGE_COMPLETED = 0x39A3, SMSG_GUILD_CHALLENGE_UPDATED = 0x18B1, + SMSG_GUILD_CHANGE_NAME_RESULT = 0x3CB1, SMSG_GUILD_COMMAND_RESULT = 0x7DB3, + SMSG_GUILD_COMMAND_RESULT_2 = 0x2707, SMSG_GUILD_CRITERIA_DATA = 0x14B4, SMSG_GUILD_CRITERIA_DELETED = 0x55B1, SMSG_GUILD_DECLINE = 0x2C07, SMSG_GUILD_EVENT = 0x0705, + SMSG_GUILD_EVENT_LOG_QUERY = 0x10B2, + SMSG_GUILD_FLAGGED_FOR_RENAME = 0x30B6, SMSG_GUILD_INFO = 0x0000, SMSG_GUILD_INVITE = 0x14A2, SMSG_GUILD_INVITE_CANCEL = 0x0606, - SMSG_GUILD_KNOWN_RECIPES = 0x10B3, + SMSG_GUILD_KNOWN_RECIPES = 0x0000, SMSG_GUILD_MAX_DAILY_XP = 0x79B5, + SMSG_GUILD_MEMBERS_FOR_RECIPE = 0x1CB7, SMSG_GUILD_MEMBER_DAILY_RESET = 0x10A5, + SMSG_GUILD_MEMBER_RECIPES = 0x1CB0, + SMSG_GUILD_MEMBER_UPDATE_NOTE = 0x7CA0, + SMSG_GUILD_MOVE_COMPLETE = 0x11B2, + SMSG_GUILD_MOVE_STARTING = 0x70A4, + SMSG_GUILD_NEWS_DELETED = 0x74A7, SMSG_GUILD_NEWS_UPDATE = 0x35A7, SMSG_GUILD_PARTY_STATE_RESPONSE = 0x50A6, SMSG_GUILD_PERMISSIONS_QUERY_RESULTS = 0x34A3, SMSG_GUILD_QUERY_RESPONSE = 0x0E06, SMSG_GUILD_RANK = 0x30B4, - SMSG_GUILD_RANKS_UPDATE = 0x0000, + SMSG_GUILD_RANKS_UPDATE = 0x5DA0, + SMSG_GUILD_RECIPES = 0x10B3, + SMSG_GUILD_RENAMED = 0x74A6, + SMSG_GUILD_REPUTATION_REACTION_CHANGED = 0x74B0, SMSG_GUILD_REPUTATION_WEEKLY_CAP = 0x30B7, + SMSG_GUILD_RESET = 0x1CB5, SMSG_GUILD_REWARDS_LIST = 0x1DB0, SMSG_GUILD_ROSTER = 0x3DA3, SMSG_GUILD_SET_NOTE = 0x0000, SMSG_GUILD_TRADESKILL_UPDATE = 0x0000, SMSG_GUILD_UPDATE_ROSTER = 0x18B0, SMSG_GUILD_XP = 0x3DB0, - SMSG_GUILD_XP_UPDATE = 0x14A1, + SMSG_GUILD_XP_GAIN = 0x14A1, + SMSG_GUILD_XP_UPDATE = 0x0000, SMSG_HEALTH_UPDATE = 0x4734, SMSG_HIGHEST_THREAT_UPDATE = 0x4104, SMSG_HOTFIX_INFO = 0x19B5, + SMSG_HOTFIX_NOTIFY = 0x55A7, SMSG_INITIALIZE_FACTIONS = 0x4634, SMSG_INITIAL_SPELLS = 0x0104, SMSG_INIT_CURRENCY = 0x15A5, SMSG_INIT_WORLD_STATES = 0x4C15, - SMSG_INSPECT = 0x0C14, + SMSG_INSPECT = 0x0000, SMSG_INSPECT_HONOR_STATS = 0x79A5, + SMSG_INSPECT_RATED_BG_STATS = 0x19A5, + SMSG_INSPECT_RESULTS_UPDATE = 0x0C14, SMSG_INSPECT_TALENT = 0x4014, SMSG_INSTANCE_DIFFICULTY = 0x0000, - SMSG_INSTANCE_LOCK_WARNING_QUERY = 0x0000, + SMSG_INSTANCE_LOCK_WARNING_QUERY = 0x4F17, SMSG_INSTANCE_RESET = 0x6F05, SMSG_INSTANCE_RESET_FAILED = 0x4725, SMSG_INSTANCE_SAVE_CREATED = 0x0124, SMSG_INVALIDATE_DANCE = 0x0E27, SMSG_INVALIDATE_PLAYER = 0x6325, - SMSG_INVALID_PROMOTION_CODE = 0x0000, + SMSG_INVALID_PROMOTION_CODE = 0x6F25, SMSG_INVENTORY_CHANGE_FAILURE = 0x2236, + SMSG_ITEM_ADD_PASSIVE = 0x7CB4, SMSG_ITEM_COOLDOWN = 0x4D14, SMSG_ITEM_ENCHANT_TIME_UPDATE = 0x0F27, + SMSG_ITEM_EXPIRE_PURCHASE_REFUND = 0x1CA0, SMSG_ITEM_NAME_QUERY_RESPONSE = 0x0000, SMSG_ITEM_PUSH_RESULT = 0x0E15, SMSG_ITEM_REFUND_INFO_RESPONSE = 0x15A3, SMSG_ITEM_REFUND_RESULT = 0x5DB1, + SMSG_ITEM_REMOVE_PASSIVE = 0x39A1, + SMSG_ITEM_SEND_PASSIVE = 0x70B1, SMSG_ITEM_TEXT_QUERY_RESPONSE = 0x2725, - SMSG_ITEM_TIME_UPDATE = 0x0000, + SMSG_ITEM_TIME_UPDATE = 0x2407, SMSG_JOINED_BATTLEGROUND_QUEUE = 0x0000, SMSG_KICK_REASON = 0x0000, SMSG_LEARNED_DANCE_MOVES = 0x0E05, SMSG_LEARNED_SPELL = 0x58A2, SMSG_LEVELUP_INFO = 0x0435, - SMSG_LFG_BOOT_PROPOSAL_UPDATE = 0x0000, + SMSG_LFG_BOOT_PROPOSAL_UPDATE = 0x0F05, SMSG_LFG_DISABLED = 0x0815, - SMSG_LFG_JOIN_RESULT = 0x0000, - SMSG_LFG_OFFER_CONTINUE = 0x0000, + SMSG_LFG_JOIN_RESULT = 0x38B6, + SMSG_LFG_OFFER_CONTINUE = 0x6B27, SMSG_LFG_OPEN_FROM_GOSSIP = 0x0000, SMSG_LFG_PARTY_INFO = 0x2325, SMSG_LFG_PLAYER_INFO = 0x4B36, - SMSG_LFG_PLAYER_REWARD = 0x0000, - SMSG_LFG_PROPOSAL_UPDATE = 0x0000, - SMSG_LFG_QUEUE_STATUS = 0x0000, + SMSG_LFG_PLAYER_REWARD = 0x6834, + SMSG_LFG_PROPOSAL_UPDATE = 0x7DA6, + SMSG_LFG_QUEUE_STATUS = 0x78B4, SMSG_LFG_ROLE_CHECK_UPDATE = 0x0336, - SMSG_LFG_ROLE_CHOSEN = 0x0000, - SMSG_LFG_TELEPORT_DENIED = 0x0000, + SMSG_LFG_ROLE_CHOSEN = 0x6A26, + SMSG_LFG_SLOT_INVALID = 0x54B5, + SMSG_LFG_TELEPORT_DENIED = 0x0E14, SMSG_LFG_UPDATE_LIST = 0x0000, SMSG_LFG_UPDATE_PARTY = 0x0000, SMSG_LFG_UPDATE_PLAYER = 0x0000, - SMSG_LFG_UPDATE_SEARCH = 0x0000, + SMSG_LFG_UPDATE_SEARCH = 0x54A1, + SMSG_LFG_UPDATE_STATUS = 0x31A4, + SMSG_LFG_UPDATE_STATUS_NONE = 0x7CA1, + SMSG_LF_GUILD_APPLICANT_LIST_UPDATED = 0x10A4, + SMSG_LF_GUILD_APPLICATIONS_LIST_CHANGED = 0x71A5, SMSG_LF_GUILD_BROWSE_UPDATED = 0x1DA3, + SMSG_LF_GUILD_COMMAND_RESULT = 0x54A6, SMSG_LF_GUILD_MEMBERSHIP_LIST_UPDATED = 0x1CA5, SMSG_LF_GUILD_POST_UPDATED = 0x35B7, SMSG_LF_GUILD_RECRUIT_LIST_UPDATED = 0x1CB2, @@ -867,6 +1058,7 @@ enum Opcodes SMSG_LOG_XPGAIN = 0x4514, SMSG_LOOT_ALL_PASSED = 0x6237, SMSG_LOOT_CLEAR_MONEY = 0x2B37, + SMSG_LOOT_CONTENTS = 0x11B1, SMSG_LOOT_ITEM_NOTIFY = 0x6D15, SMSG_LOOT_LIST = 0x6807, SMSG_LOOT_MASTER_LIST = 0x0325, @@ -879,93 +1071,117 @@ enum Opcodes SMSG_LOOT_SLOT_CHANGED = 0x2935, SMSG_LOOT_START_ROLL = 0x2227, SMSG_MAIL_LIST_RESULT = 0x4217, - SMSG_MEETINGSTONE_COMPLETE = 0x0000, - SMSG_MEETINGSTONE_IN_PROGRESS = 0x0000, + SMSG_MAP_OBJ_EVENTS = 0x54B2, + SMSG_MEETINGSTONE_COMPLETE = 0x2524, + SMSG_MEETINGSTONE_IN_PROGRESS = 0x2D35, SMSG_MEETINGSTONE_MEMBER_ADDED = 0x0000, SMSG_MEETINGSTONE_SETQUEUE = 0x0000, SMSG_MESSAGECHAT = 0x2026, + SMSG_MESSAGE_BOX = 0x30A1, + SMSG_MINIGAME_SETUP = 0x6727, + SMSG_MINIGAME_STATE = 0x2E17, SMSG_MIRRORIMAGE_DATA = 0x2634, - SMSG_MODIFY_COOLDOWN = 0x0000, + SMSG_MISSILE_CANCEL = 0x3DB4, + SMSG_MODIFY_COOLDOWN = 0x6016, + SMSG_MONEY_NOTIFY = 0x55B6, SMSG_MONSTER_MOVE = 0x6E17, SMSG_MONSTER_MOVE_TRANSPORT = 0x2004, SMSG_MOTD = 0x0A35, SMSG_MOUNTRESULT = 0x2225, - SMSG_MOUNTSPECIAL_ANIM = 0x0000, + SMSG_MOUNTSPECIAL_ANIM = 0x0217, + SMSG_MOVE_COLLISION_DISABLE = 0x31B0, + SMSG_MOVE_COLLISION_ENABLE = 0x11A7, SMSG_MOVE_DISABLE_COLLISION = 0x0000, SMSG_MOVE_DISABLE_GRAVITY = 0x0000, SMSG_MOVE_ENABLE_COLLISION = 0x0000, SMSG_MOVE_ENABLE_GRAVITY = 0x0000, SMSG_MOVE_FEATHER_FALL = 0x79B0, - SMSG_MOVE_KNOCK_BACK = 0x0000, + SMSG_MOVE_GRAVITY_DISABLE = 0x75B2, + SMSG_MOVE_GRAVITY_ENABLE = 0x30B3, + SMSG_MOVE_KNOCK_BACK = 0x5CB4, SMSG_MOVE_LAND_WALK = 0x34B7, SMSG_MOVE_NORMAL_FALL = 0x51B6, SMSG_MOVE_ROOT = 0x7DA0, SMSG_MOVE_SET_ACTIVE_MOVER = 0x11B3, - SMSG_MOVE_SET_CAN_FLY = 0x720E, - SMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY = 0x3014, + SMSG_MOVE_SET_CAN_FLY = 0x3DA1, + SMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY = 0x59A2, SMSG_MOVE_SET_COLLISION_HEIGHT = 0x11B0, SMSG_MOVE_SET_COMPOUND_STATE = 0x75A0, SMSG_MOVE_SET_FLIGHT_BACK_SPEED = 0x30A2, SMSG_MOVE_SET_FLIGHT_SPEED = 0x71A6, SMSG_MOVE_SET_HOVER = 0x5CB3, - SMSG_MOVE_SET_PITCH_RATE = 0x0000, + SMSG_MOVE_SET_PITCH_RATE = 0x75B0, SMSG_MOVE_SET_RUN_BACK_SPEED = 0x71B1, SMSG_MOVE_SET_RUN_SPEED = 0x3DB5, SMSG_MOVE_SET_SWIM_BACK_SPEED = 0x5CA6, - SMSG_MOVE_SET_SWIM_SPEED = 0x0000, - SMSG_MOVE_SET_TURN_RATE = 0x0000, + SMSG_MOVE_SET_SWIM_SPEED = 0x15A7, + SMSG_MOVE_SET_TURN_RATE = 0x30A5, SMSG_MOVE_SET_VEHICLE_REC_ID = 0x0000, SMSG_MOVE_SET_WALK_IN_AIR = 0x0000, SMSG_MOVE_SET_WALK_SPEED = 0x1DA4, - SMSG_MOVE_UNROOT = 0x7DB4, - SMSG_MOVE_UNSET_CAN_FLY = 0x0000, - SMSG_MOVE_UNSET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY = 0x0000, - SMSG_MOVE_UNSET_HOVER = 0x0000, + SMSG_MOVE_UNROOT = 0x0000, + SMSG_MOVE_UNSET_CAN_FLY = 0x15A2, + SMSG_MOVE_UNSET_CAN_TRANSITION_BETWEEN_SWIM_AND_FL= 0x7DB2, + SMSG_MOVE_UNSET_HOVER = 0x51B3, SMSG_MOVE_UNSET_WALK_IN_AIR = 0x0000, - SMSG_MOVE_UPDATE_KNOCK_BACK = 0x0000, + SMSG_MOVE_UPDATE_COLLISION_HEIGHT = 0x59A3, + SMSG_MOVE_UPDATE_FLIGHT_BACK_SPEED = 0x74A0, + SMSG_MOVE_UPDATE_KNOCK_BACK = 0x3DB2, + SMSG_MOVE_UPDATE_PITCH_RATE = 0x1DB5, + SMSG_MOVE_UPDATE_RUN_BACK_SPEED = 0x3DA6, + SMSG_MOVE_UPDATE_SWIM_BACK_SPEED = 0x30B5, + SMSG_MOVE_UPDATE_SWIM_SPEED = 0x59B5, SMSG_MOVE_UPDATE_TELEPORT = 0x0000, + SMSG_MOVE_UPDATE_TURN_RATE = 0x5DA1, + SMSG_MOVE_UPDATE_WALK_SPEED = 0x54A2, SMSG_MOVE_WATER_WALK = 0x75B1, SMSG_MULTIPLE_PACKETS = 0x6736, SMSG_NAME_QUERY_RESPONSE = 0x6E04, - SMSG_NEW_TAXI_PATH = 0x0000, + SMSG_NEW_TAXI_PATH = 0x4B35, SMSG_NEW_WORLD = 0x79B1, + SMSG_NEW_WORLD_ABORT = 0x14B7, SMSG_NOTIFICATION = 0x14A0, SMSG_NOTIFY_DANCE = 0x4904, - SMSG_NOTIFY_DEST_LOC_SPELL_CAST = 0x0000, + SMSG_NOTIFY_DEST_LOC_SPELL_CAST = 0x6204, SMSG_NPC_TEXT_UPDATE = 0x4436, SMSG_NPC_WONT_TALK = 0x0000, SMSG_OFFER_PETITION_ERROR = 0x2716, SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA = 0x4D34, - SMSG_OPEN_CONTAINER = 0x0000, - SMSG_OVERRIDE_LIGHT = 0x0000, + SMSG_OPEN_CONTAINER = 0x4714, + SMSG_OPEN_LFG_DUNGEON_FINDER = 0x2C37, + SMSG_OVERRIDE_LIGHT = 0x4225, SMSG_PAGE_TEXT_QUERY_RESPONSE = 0x2B14, SMSG_PARTYKILLLOG = 0x4937, - SMSG_PARTY_COMMAND_RESULT = 0x0A07, + SMSG_PARTY_COMMAND_RESULT = 0x6E07, SMSG_PARTY_MEMBER_STATS = 0x2104, SMSG_PARTY_MEMBER_STATS_FULL = 0x0215, - SMSG_PAUSE_MIRROR_TIMER = 0x0000, + SMSG_PAUSE_MIRROR_TIMER = 0x4015, SMSG_PERIODICAURALOG = 0x0416, - SMSG_PETGODMODE = 0x0000, + SMSG_PETGODMODE = 0x2E36, + SMSG_PETITION_ALREADY_SIGNED = 0x5DA3, SMSG_PETITION_QUERY_RESPONSE = 0x4B37, - SMSG_PETITION_SHOWLIST = 0x0000, + SMSG_PETITION_SHOWLIST = 0x6405, SMSG_PETITION_SHOW_SIGNATURES = 0x0716, - SMSG_PETITION_SIGN_RESULTS = 0x0000, + SMSG_PETITION_SIGN_RESULTS = 0x6217, SMSG_PET_ACTION_FEEDBACK = 0x0807, SMSG_PET_ACTION_SOUND = 0x4324, SMSG_PET_ADDED = 0x3CA5, + SMSG_PET_BROKEN = 0x2E27, SMSG_PET_CAST_FAILED = 0x2B15, SMSG_PET_DISMISS_SOUND = 0x2B05, SMSG_PET_GUIDS = 0x2D26, SMSG_PET_LEARNED_SPELL = 0x0507, SMSG_PET_MODE = 0x2235, - SMSG_PET_NAME_INVALID = 0x0000, + SMSG_PET_NAME_INVALID = 0x6007, SMSG_PET_NAME_QUERY_RESPONSE = 0x4C37, SMSG_PET_REMOVED_SPELL = 0x6A04, + SMSG_PET_RENAMEABLE = 0x2B27, + SMSG_PET_SLOT_UPDATED = 0x51A3, SMSG_PET_SPELLS = 0x4114, - SMSG_PET_TAME_FAILURE = 0x0000, + SMSG_PET_TAME_FAILURE = 0x6B24, SMSG_PET_UPDATE_COMBO_POINTS = 0x4325, SMSG_PLAYED_TIME = 0x6037, - SMSG_PLAYERBINDERROR = 0x0000, + SMSG_PLAYERBINDERROR = 0x6A24, SMSG_PLAYERBOUND = 0x2516, SMSG_PLAYER_DIFFICULTY_CHANGE = 0x2217, SMSG_PLAYER_MOVE = 0x79A2, @@ -977,23 +1193,25 @@ enum Opcodes SMSG_PLAY_OBJECT_SOUND = 0x2635, SMSG_PLAY_SOUND = 0x2134, SMSG_PLAY_SPELL_IMPACT = 0x0000, - SMSG_PLAY_SPELL_VISUAL = 0x55A5, + SMSG_PLAY_SPELL_VISUAL = 0x10B1, + SMSG_PLAY_SPELL_VISUAL_KIT = 0x55A5, SMSG_PLAY_TIME_WARNING = 0x4814, SMSG_PONG = 0x4D42, SMSG_POWER_UPDATE = 0x4A07, SMSG_PRE_RESURRECT = 0x6C36, SMSG_PROCRESIST = 0x0426, - SMSG_PROPOSE_LEVEL_GRANT = 0x0000, + SMSG_PROPOSE_LEVEL_GRANT = 0x6114, SMSG_PUREMOUNT_CANCELLED_OBSOLETE = 0x0000, - SMSG_PVP_CREDIT = 0x0000, - SMSG_PVP_LOG_DATA = 0x54A3, + SMSG_PVP_CREDIT = 0x6015, + SMSG_PVP_LOG_DATA = 0x5CB2, + SMSG_PVP_OPTIONS_ENABLED = 0x50A1, SMSG_QUERY_QUESTS_COMPLETED_RESPONSE = 0x6314, SMSG_QUERY_TIME_RESPONSE = 0x2124, SMSG_QUESTGIVER_OFFER_REWARD = 0x2427, SMSG_QUESTGIVER_QUEST_COMPLETE = 0x55A4, SMSG_QUESTGIVER_QUEST_DETAILS = 0x2425, SMSG_QUESTGIVER_QUEST_FAILED = 0x4236, - SMSG_QUESTGIVER_QUEST_INVALID = 0x0000, + SMSG_QUESTGIVER_QUEST_INVALID = 0x4016, SMSG_QUESTGIVER_QUEST_LIST = 0x0134, SMSG_QUESTGIVER_REQUEST_ITEMS = 0x6236, SMSG_QUESTGIVER_STATUS = 0x2115, @@ -1004,7 +1222,7 @@ enum Opcodes SMSG_QUESTUPDATE_ADD_PVP_KILL = 0x4416, SMSG_QUESTUPDATE_COMPLETE = 0x2937, SMSG_QUESTUPDATE_FAILED = 0x6324, - SMSG_QUESTUPDATE_FAILEDTIMER = 0x0000, + SMSG_QUESTUPDATE_FAILEDTIMER = 0x6427, SMSG_QUEST_CONFIRM_ACCEPT = 0x6F07, SMSG_QUEST_FORCE_REMOVE = 0x6605, SMSG_QUEST_POI_QUERY_RESPONSE = 0x6304, @@ -1012,31 +1230,46 @@ enum Opcodes SMSG_RAID_GROUP_ONLY = 0x0837, SMSG_RAID_INSTANCE_INFO = 0x6626, SMSG_RAID_INSTANCE_MESSAGE = 0x6E15, + SMSG_RAID_MARKERS_CHANGED = 0x10A1, + SMSG_RAID_READY_CHECK_THROTTLED_ERROR = 0x2607, + SMSG_RAID_SUMMON_FAILED = 0x18B6, SMSG_RANDOMIZE_CHAR_NAME = 0x38B1, - SMSG_READ_ITEM_FAILED = 0x0000, - SMSG_READ_ITEM_OK = 0x0000, + SMSG_RATED_BG_RATING = 0x15A1, + SMSG_RATED_BG_STATS = 0x34A1, + SMSG_READ_ITEM_FAILED = 0x0F16, + SMSG_READ_ITEM_OK = 0x2605, SMSG_REALM_SPLIT = 0x2714, SMSG_REAL_GROUP_UPDATE = 0x0F34, SMSG_RECEIVED_MAIL = 0x2924, SMSG_REDIRECT_CLIENT = 0x0942, - SMSG_REFER_A_FRIEND_FAILURE = 0x0000, + SMSG_REFER_A_FRIEND_EXPIRED = 0x4934, + SMSG_REFER_A_FRIEND_FAILURE = 0x2037, + SMSG_REFORGE_RESULT = 0x58A4, SMSG_REMOVED_SPELL = 0x4804, - SMSG_REPORT_PVP_AFK_RESULT = 0x0000, + SMSG_REPORT_PVP_AFK_RESULT = 0x2D06, SMSG_REQUEST_CEMETERY_LIST_RESPONSE = 0x30A7, + SMSG_REQUEST_PVP_REWARDS_RESPONSE = 0x5DA4, + SMSG_RESEARCH_COMPLETE = 0x35A6, + SMSG_RESEARCH_SETUP_HISTORY = 0x10B6, + SMSG_RESET_COMPRESSION_CONTEXT = 0x0142, SMSG_RESET_FAILED_NOTIFY = 0x0000, SMSG_RESISTLOG = 0x0000, SMSG_RESPOND_INSPECT_ACHIEVEMENTS = 0x15B0, - SMSG_RESURRECT_REQUEST = 0x0000, - SMSG_RESYNC_RUNES = 0x0000, + SMSG_RESURRECT_REQUEST = 0x2905, + SMSG_RESYNC_RUNES = 0x6224, + SMSG_ROLE_POLL_BEGIN = 0x70B0, SMSG_RWHOIS = 0x2437, - SMSG_SAVE_CUF_PROFILES = 0x730E, + SMSG_SAVE_CUF_PROFILES = 0x0000, SMSG_SELL_ITEM = 0x6105, SMSG_SEND_MAIL_RESULT = 0x4927, SMSG_SEND_UNLEARN_SPELLS = 0x4E25, SMSG_SERVERTIME = 0x6327, SMSG_SERVER_FIRST_ACHIEVEMENT = 0x6424, + SMSG_SERVER_INFO_RESPONSE = 0x74B5, SMSG_SERVER_MESSAGE = 0x6C04, - SMSG_SETUP_RESEARCH_HISTORY = 0x10B6, + SMSG_SERVER_PERF = 0x74B6, + SMSG_SETUP_RESEARCH_HISTORY = 0x0000, + SMSG_SET_DF_FAST_LAUNCH_RESULT = 0x35B6, SMSG_SET_FACTION_ATWAR = 0x4216, SMSG_SET_FACTION_STANDING = 0x0126, SMSG_SET_FACTION_VISIBLE = 0x2525, @@ -1050,12 +1283,15 @@ enum Opcodes SMSG_SET_PROJECTILE_POSITION = 0x2616, SMSG_SHOWTAXINODES = 0x2A36, SMSG_SHOW_BANK = 0x2627, + SMSG_SHOW_RATINGS = 0x11B4, + SMSG_SOR_START_EXPERIENCE_INCOMPLETE = 0x7CA7, SMSG_SPELLBREAKLOG = 0x6B17, SMSG_SPELLDAMAGESHIELD = 0x2927, SMSG_SPELLDISPELLOG = 0x4516, SMSG_SPELLENERGIZELOG = 0x0414, SMSG_SPELLHEALLOG = 0x2816, SMSG_SPELLINSTAKILLLOG = 0x6216, + SMSG_SPELLINTERRUPTLOG = 0x1DA7, SMSG_SPELLLOGEXECUTE = 0x0626, SMSG_SPELLLOGMISS = 0x0625, SMSG_SPELLNONMELEEDAMAGELOG = 0x4315, @@ -1068,27 +1304,27 @@ enum Opcodes SMSG_SPELL_FAILURE = 0x4535, SMSG_SPELL_GO = 0x6E16, SMSG_SPELL_START = 0x6415, - SMSG_SPELL_UPDATE_CHAIN_TARGETS = 0x0000, - SMSG_SPIRIT_HEALER_CONFIRM = 0x0000, + SMSG_SPELL_UPDATE_CHAIN_TARGETS = 0x6006, + SMSG_SPIRIT_HEALER_CONFIRM = 0x4917, SMSG_SPLINE_MOVE_COLLISION_DISABLE = 0x35B1, SMSG_SPLINE_MOVE_COLLISION_ENABLE = 0x3CB0, SMSG_SPLINE_MOVE_GRAVITY_DISABLE = 0x5DB5, SMSG_SPLINE_MOVE_GRAVITY_ENABLE = 0x3CA6, SMSG_SPLINE_MOVE_ROOT = 0x51B4, SMSG_SPLINE_MOVE_SET_FEATHER_FALL = 0x3DA5, - SMSG_SPLINE_MOVE_SET_FLIGHT_BACK_SPEED = 0x38B3, - SMSG_SPLINE_MOVE_SET_FLIGHT_SPEED = 0x39A0, + SMSG_SPLINE_MOVE_SET_FLIGHT_BACK_SPEED = 0x0000, + SMSG_SPLINE_MOVE_SET_FLIGHT_SPEED = 0x0000, SMSG_SPLINE_MOVE_SET_FLYING = 0x31B5, SMSG_SPLINE_MOVE_SET_HOVER = 0x14B6, SMSG_SPLINE_MOVE_SET_LAND_WALK = 0x3DA7, SMSG_SPLINE_MOVE_SET_NORMAL_FALL = 0x38B2, - SMSG_SPLINE_MOVE_SET_PITCH_RATE = 0x14B0, - SMSG_SPLINE_MOVE_SET_RUN_BACK_SPEED = 0x3DB3, + SMSG_SPLINE_MOVE_SET_PITCH_RATE = 0x0000, + SMSG_SPLINE_MOVE_SET_RUN_BACK_SPEED = 0x0000, SMSG_SPLINE_MOVE_SET_RUN_MODE = 0x75A7, - SMSG_SPLINE_MOVE_SET_RUN_SPEED = 0x51B7, - SMSG_SPLINE_MOVE_SET_SWIM_BACK_SPEED = 0x59A1, - SMSG_SPLINE_MOVE_SET_SWIM_SPEED = 0x39A4, - SMSG_SPLINE_MOVE_SET_TURN_RATE = 0x78B5, + SMSG_SPLINE_MOVE_SET_RUN_SPEED = 0x0000, + SMSG_SPLINE_MOVE_SET_SWIM_BACK_SPEED = 0x0000, + SMSG_SPLINE_MOVE_SET_SWIM_SPEED = 0x0000, + SMSG_SPLINE_MOVE_SET_TURN_RATE = 0x0000, SMSG_SPLINE_MOVE_SET_WALK_MODE = 0x54B6, SMSG_SPLINE_MOVE_SET_WALK_SPEED = 0x0000, SMSG_SPLINE_MOVE_SET_WATER_WALK = 0x0000, @@ -1098,29 +1334,42 @@ enum Opcodes SMSG_SPLINE_MOVE_UNSET_FLYING = 0x58A6, SMSG_SPLINE_MOVE_UNSET_HOVER = 0x7DA5, SMSG_SPLINE_MOVE_WATER_WALK = 0x50A2, + SMSG_SPLINE_SET_FLIGHT_BACK_SPEED = 0x38B3, + SMSG_SPLINE_SET_FLIGHT_SPEED = 0x39A0, + SMSG_SPLINE_SET_PITCH_RATE = 0x14B0, + SMSG_SPLINE_SET_RUN_BACK_SPEED = 0x3DB3, + SMSG_SPLINE_SET_RUN_SPEED = 0x51B7, + SMSG_SPLINE_SET_SWIM_BACK_SPEED = 0x59A1, + SMSG_SPLINE_SET_SWIM_SPEED = 0x39A4, + SMSG_SPLINE_SET_TURN_RATE = 0x78B5, + SMSG_SPLINE_SET_WALK_BACK_SPEED = 0x34A5, SMSG_STABLE_RESULT = 0x2204, SMSG_STANDSTATE_UPDATE = 0x6F04, - SMSG_START_MIRROR_TIMER = 0x0000, - SMSG_STOP_DANCE = 0x0000, - SMSG_STOP_MIRROR_TIMER = 0x0000, - SMSG_SUMMON_CANCEL = 0x0000, + SMSG_START_MIRROR_TIMER = 0x6824, + SMSG_START_TIMER = 0x59A5, + SMSG_STOP_DANCE = 0x4637, + SMSG_STOP_MIRROR_TIMER = 0x0B06, + SMSG_STREAMING_MOVIE = 0x15B7, + SMSG_SUMMON_CANCEL = 0x0B34, SMSG_SUMMON_REQUEST = 0x2A07, SMSG_SUPERCEDED_SPELL = 0x35B0, + SMSG_SUPPRESS_NPC_GREETINGS = 0x74B1, SMSG_SUSPEND_COMMS = 0x4140, SMSG_SUSPEND_TOKEN_RESPONSE = 0x14B1, - SMSG_TALENTS_ERROR = 0x093A, + SMSG_TALENTS_ERROR = 0x0916, SMSG_TALENTS_INFO = 0x6F26, - SMSG_TALENTS_INVOLUNTARILY_RESET = 0x0000, + SMSG_TALENTS_INVOLUNTARILY_RESET = 0x2C27, SMSG_TAXINODE_STATUS = 0x2936, SMSG_TEST_DROP_RATE_RESULT = 0x6816, SMSG_TEXT_EMOTE = 0x0B05, SMSG_THREAT_CLEAR = 0x6437, SMSG_THREAT_REMOVE = 0x2E05, SMSG_THREAT_UPDATE = 0x4735, + SMSG_TIME_ADJUSTMENT = 0x79B7, SMSG_TIME_SYNC_REQ = 0x3CA4, SMSG_TITLE_EARNED = 0x2426, - SMSG_TOGGLE_XP_GAIN = 0x0000, - SMSG_TOTEM_CREATED = 0x0000, + SMSG_TOGGLE_XP_GAIN = 0x6704, + SMSG_TOTEM_CREATED = 0x2414, SMSG_TRADE_STATUS = 0x5CA3, SMSG_TRADE_STATUS_EXTENDED = 0x70A2, SMSG_TRAINER_BUY_FAILED = 0x0004, @@ -1131,35 +1380,52 @@ enum Opcodes SMSG_TRANSFER_PENDING = 0x18A6, SMSG_TRIGGER_CINEMATIC = 0x6C27, SMSG_TRIGGER_MOVIE = 0x0000, - SMSG_TURN_IN_PETITION_RESULTS = 0x0000, + SMSG_TURN_IN_PETITION_RESULTS = 0x0F07, SMSG_TUTORIAL_FLAGS = 0x0B35, + SMSG_UNIT_HEALTH_FREQUENT = 0x2C26, SMSG_UNIT_SPELLCAST_START = 0x2517, SMSG_UPDATE_ACCOUNT_DATA = 0x6837, SMSG_UPDATE_ACCOUNT_DATA_COMPLETE = 0x2015, - SMSG_UPDATE_COMBO_POINTS = 0x0000, - SMSG_UPDATE_CURRENCY = 0x0000, + SMSG_UPDATE_COMBO_POINTS = 0x6B34, + SMSG_UPDATE_CURRENCY = 0x59B0, SMSG_UPDATE_CURRENCY_WEEK_LIMIT = 0x70A7, - SMSG_UPDATE_INSTANCE_ENCOUNTER_UNIT = 0x0000, + SMSG_UPDATE_DUNGEON_ENCOUNTER_FOR_LOOT = 0x3CB5, + SMSG_UPDATE_INSTANCE_ENCOUNTER_UNIT = 0x4007, SMSG_UPDATE_INSTANCE_OWNERSHIP = 0x4915, - SMSG_UPDATE_ITEM_ENCHANTMENTS = 0x0000, + SMSG_UPDATE_ITEM_ENCHANTMENTS = 0x6014, SMSG_UPDATE_LAST_INSTANCE = 0x0437, SMSG_UPDATE_OBJECT = 0x4715, + SMSG_UPDATE_SERVER_PLAYER_POSITION = 0x74A3, SMSG_UPDATE_WORLD_STATE = 0x4816, SMSG_USERLIST_ADD = 0x0F37, SMSG_USERLIST_REMOVE = 0x2006, SMSG_USERLIST_UPDATE = 0x0135, + SMSG_VOICESESSION_FULL = 0x6225, SMSG_VOICE_CHAT_STATUS = 0x0F15, SMSG_VOICE_PARENTAL_CONTROLS = 0x0534, SMSG_VOICE_SESSION_LEAVE = 0x2A24, SMSG_VOICE_SESSION_ROSTER_UPDATE = 0x2A17, SMSG_VOICE_SET_TALKER_MUTED = 0x6E35, + SMSG_VOID_ITEM_SWAP_RESPONSE = 0x78A2, + SMSG_VOID_STORAGE_CONTENTS = 0x75B4, + SMSG_VOID_STORAGE_FAILED = 0x18A7, + SMSG_VOID_STORAGE_TRANSFER_CHANGES = 0x51A6, + SMSG_VOID_TRANSFER_RESULT = 0x1DA6, + SMSG_WAIT_QUEUE_FINISH = 0x75B7, + SMSG_WAIT_QUEUE_UPDATE = 0x58A1, SMSG_WARDEN_DATA = 0x31A0, + SMSG_WARGAME_CHECK_ENTRY = 0x3DA4, + SMSG_WARGAME_REQUEST_SENT = 0x59B2, SMSG_WEATHER = 0x2904, + SMSG_WEEKLY_LAST_RESET = 0x50A5, + SMSG_WEEKLY_RESET_CURRENCY = 0x3CA1, SMSG_WEEKLY_SPELL_USAGE = 0x39B7, + SMSG_WEEKLY_SPELL_USAGE_UPDATE = 0x11B5, SMSG_WHO = 0x6907, SMSG_WHOIS = 0x6917, - SMSG_WORLD_SERVER_INFO = 0x09B1, + SMSG_WORLD_SERVER_INFO = 0x31A2, SMSG_WORLD_STATE_UI_TIMER_UPDATE = 0x4A14, + SMSG_XP_GAIN_ABORTED = 0x50B4, SMSG_ZONE_UNDER_ATTACK = 0x0A06, }; -- cgit v1.2.3 From 32d17722d8be90f1e1f8addddd2d568df69ca9df Mon Sep 17 00:00:00 2001 From: Nay Date: Wed, 25 Jul 2012 23:25:33 +0100 Subject: Core/PacketIO: Fix some failures introduced in previous commit --- src/server/game/Server/Protocol/Opcodes.h | 32 +++++++++++-------------------- 1 file changed, 11 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 2e95945f1eb..c1fb3f940be 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -383,7 +383,7 @@ enum Opcodes CMSG_MOVE_NOT_ACTIVE_MOVER = 0x7A1A, CMSG_MOVE_SET_CAN_FLY = 0x720E, CMSG_MOVE_SET_CAN_FLY_ACK = 0x790C, - CMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY_= 0x3014, + CMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY_ACK = 0x3014, CMSG_MOVE_SET_COLLISION_HEIGHT_ACK = 0x7114, CMSG_MOVE_SET_RELATIVE_POSITION = 0x0000, CMSG_MOVE_SET_VEHICLE_REC_ID_ACK = 0x0000, @@ -1121,7 +1121,7 @@ enum Opcodes SMSG_MOVE_SET_WALK_SPEED = 0x1DA4, SMSG_MOVE_UNROOT = 0x0000, SMSG_MOVE_UNSET_CAN_FLY = 0x15A2, - SMSG_MOVE_UNSET_CAN_TRANSITION_BETWEEN_SWIM_AND_FL= 0x7DB2, + SMSG_MOVE_UNSET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY = 0x7DB2, SMSG_MOVE_UNSET_HOVER = 0x51B3, SMSG_MOVE_UNSET_WALK_IN_AIR = 0x0000, SMSG_MOVE_UPDATE_COLLISION_HEIGHT = 0x59A3, @@ -1259,7 +1259,6 @@ enum Opcodes SMSG_RESYNC_RUNES = 0x6224, SMSG_ROLE_POLL_BEGIN = 0x70B0, SMSG_RWHOIS = 0x2437, - SMSG_SAVE_CUF_PROFILES = 0x0000, SMSG_SELL_ITEM = 0x6105, SMSG_SEND_MAIL_RESULT = 0x4927, SMSG_SEND_UNLEARN_SPELLS = 0x4E25, @@ -1312,21 +1311,21 @@ enum Opcodes SMSG_SPLINE_MOVE_GRAVITY_ENABLE = 0x3CA6, SMSG_SPLINE_MOVE_ROOT = 0x51B4, SMSG_SPLINE_MOVE_SET_FEATHER_FALL = 0x3DA5, - SMSG_SPLINE_MOVE_SET_FLIGHT_BACK_SPEED = 0x0000, - SMSG_SPLINE_MOVE_SET_FLIGHT_SPEED = 0x0000, + SMSG_SPLINE_MOVE_SET_FLIGHT_BACK_SPEED = 0x38B3, + SMSG_SPLINE_MOVE_SET_FLIGHT_SPEED = 0x39A0, SMSG_SPLINE_MOVE_SET_FLYING = 0x31B5, SMSG_SPLINE_MOVE_SET_HOVER = 0x14B6, SMSG_SPLINE_MOVE_SET_LAND_WALK = 0x3DA7, SMSG_SPLINE_MOVE_SET_NORMAL_FALL = 0x38B2, - SMSG_SPLINE_MOVE_SET_PITCH_RATE = 0x0000, - SMSG_SPLINE_MOVE_SET_RUN_BACK_SPEED = 0x0000, + SMSG_SPLINE_MOVE_SET_PITCH_RATE = 0x14B0, + SMSG_SPLINE_MOVE_SET_RUN_BACK_SPEED = 0x3DB3, SMSG_SPLINE_MOVE_SET_RUN_MODE = 0x75A7, - SMSG_SPLINE_MOVE_SET_RUN_SPEED = 0x0000, - SMSG_SPLINE_MOVE_SET_SWIM_BACK_SPEED = 0x0000, - SMSG_SPLINE_MOVE_SET_SWIM_SPEED = 0x0000, - SMSG_SPLINE_MOVE_SET_TURN_RATE = 0x0000, + SMSG_SPLINE_MOVE_SET_RUN_SPEED = 0x51B7, + SMSG_SPLINE_MOVE_SET_SWIM_BACK_SPEED = 0x59A1, + SMSG_SPLINE_MOVE_SET_SWIM_SPEED = 0x39A4, + SMSG_SPLINE_MOVE_SET_TURN_RATE = 0x78B5, SMSG_SPLINE_MOVE_SET_WALK_MODE = 0x54B6, - SMSG_SPLINE_MOVE_SET_WALK_SPEED = 0x0000, + SMSG_SPLINE_MOVE_SET_WALK_SPEED = 0x34A5, SMSG_SPLINE_MOVE_SET_WATER_WALK = 0x0000, SMSG_SPLINE_MOVE_START_SWIM = 0x31A5, SMSG_SPLINE_MOVE_STOP_SWIM = 0x1DA2, @@ -1334,15 +1333,6 @@ enum Opcodes SMSG_SPLINE_MOVE_UNSET_FLYING = 0x58A6, SMSG_SPLINE_MOVE_UNSET_HOVER = 0x7DA5, SMSG_SPLINE_MOVE_WATER_WALK = 0x50A2, - SMSG_SPLINE_SET_FLIGHT_BACK_SPEED = 0x38B3, - SMSG_SPLINE_SET_FLIGHT_SPEED = 0x39A0, - SMSG_SPLINE_SET_PITCH_RATE = 0x14B0, - SMSG_SPLINE_SET_RUN_BACK_SPEED = 0x3DB3, - SMSG_SPLINE_SET_RUN_SPEED = 0x51B7, - SMSG_SPLINE_SET_SWIM_BACK_SPEED = 0x59A1, - SMSG_SPLINE_SET_SWIM_SPEED = 0x39A4, - SMSG_SPLINE_SET_TURN_RATE = 0x78B5, - SMSG_SPLINE_SET_WALK_BACK_SPEED = 0x34A5, SMSG_STABLE_RESULT = 0x2204, SMSG_STANDSTATE_UPDATE = 0x6F04, SMSG_START_MIRROR_TIMER = 0x6824, -- cgit v1.2.3 From c6352171d7fce7908739e7d2b007d618126c840d Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 26 Jul 2012 01:56:30 +0100 Subject: Core/Player&PacketIO: Fix trading Update some trade related packet structures Enable missing trade opcode Update TradeStatus enum --- src/server/game/Entities/Player/Player.h | 2 +- src/server/game/Handlers/TradeHandler.cpp | 181 ++++++++++++++++++-------- src/server/game/Miscellaneous/SharedDefines.h | 56 ++++---- src/server/game/Server/Protocol/Opcodes.cpp | 6 +- 4 files changed, 165 insertions(+), 80 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index ded63b024b8..aba570c1d37 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1026,7 +1026,7 @@ class TradeData uint32 m_spell; // m_player apply spell to non-traded slot item uint64 m_spellCastItem; // applied spell casted by item use - uint64 m_items[TRADE_SLOT_COUNT]; // traded itmes from m_player side including non-traded slot + uint64 m_items[TRADE_SLOT_COUNT]; // traded items from m_player side including non-traded slot }; class KillRewarder diff --git a/src/server/game/Handlers/TradeHandler.cpp b/src/server/game/Handlers/TradeHandler.cpp index 318325b4e57..b20b7e1730a 100755 --- a/src/server/game/Handlers/TradeHandler.cpp +++ b/src/server/game/Handlers/TradeHandler.cpp @@ -36,32 +36,30 @@ void WorldSession::SendTradeStatus(TradeStatus status) switch (status) { + data.Initialize(SMSG_TRADE_STATUS, 1+4+4); + data.WriteBit(0); // unk bit, usually 0 + data.WriteBits(status, 5); + case TRADE_STATUS_BEGIN_TRADE: - data.Initialize(SMSG_TRADE_STATUS, 4+8); - data << uint32(status); - data << uint64(0); + data.WriteBits(0, 8); // zero guid break; case TRADE_STATUS_OPEN_WINDOW: - data.Initialize(SMSG_TRADE_STATUS, 4+4); - data << uint32(status); - data << uint32(0); // added in 2.4.0 + data << uint32(0); // unk break; case TRADE_STATUS_CLOSE_WINDOW: - data.Initialize(SMSG_TRADE_STATUS, 4+4+1+4); - data << uint32(status); - data << uint32(0); - data << uint8(0); - data << uint32(0); + data.WriteBit(0); // unk + data << uint32(0); // unk + data << uint32(0); // unk break; case TRADE_STATUS_ONLY_CONJURED: case TRADE_STATUS_NOT_ELIGIBLE: - data.Initialize(SMSG_TRADE_STATUS, 4+1); - data << uint32(status); - data << uint8(0); + data << uint8(0); // unk break; + case TRADE_STATUS_CURRENCY: // Not implemented + case TRADE_STATUS_CURRENCY_NOT_TRADABLE: // Not implemented + data << uint32(0); // unk + data << uint32(0); // unk default: - data.Initialize(SMSG_TRADE_STATUS, 4); - data << uint32(status); break; } @@ -71,13 +69,11 @@ void WorldSession::SendTradeStatus(TradeStatus status) void WorldSession::HandleIgnoreTradeOpcode(WorldPacket& /*recvPacket*/) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Ignore Trade %u", _player->GetGUIDLow()); - // recvPacket.print_storage(); } void WorldSession::HandleBusyTradeOpcode(WorldPacket& /*recvPacket*/) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Busy Trade %u", _player->GetGUIDLow()); - // recvPacket.print_storage(); } void WorldSession::SendUpdateTrade(bool trader_data /*= true*/) @@ -85,46 +81,106 @@ void WorldSession::SendUpdateTrade(bool trader_data /*= true*/) TradeData* view_trade = trader_data ? _player->GetTradeData()->GetTraderData() : _player->GetTradeData(); WorldPacket data(SMSG_TRADE_STATUS_EXTENDED, 1+4+4+4+4+4+7*(1+4+4+4+4+8+4+4+4+4+8+4+4+4+4+4+4)); - data << uint8(trader_data); // 1 means traders data, 0 means own - data << uint32(0); // added in 2.4.0, this value must be equal to value from TRADE_STATUS_OPEN_WINDOW status packet (different value for different players to block multiple trades?) - data << uint32(TRADE_SLOT_COUNT); // trade slots count/number?, = next field in most cases - data << uint32(TRADE_SLOT_COUNT); // trade slots count/number?, = prev field in most cases + + data << uint32(0); // this value must be equal to value from TRADE_STATUS_OPEN_WINDOW status packet (different value for different players to block multiple trades?) + data << uint32(0); // unk 2 data << uint32(view_trade->GetMoney()); // trader gold data << uint32(view_trade->GetSpell()); // spell casted on lowest slot item + data << uint32(TRADE_SLOT_COUNT); // trade slots count/number?, = next field in most cases + data << uint32(0); // unk 5 + data << uint8(trader_data); // 1 means traders data, 0 means own + data << uint32(TRADE_SLOT_COUNT); // trade slots count/number?, = prev field in most cases + + ByteBuffer itemData; + ByteBuffer bitData; + uint8 count = 0; for (uint8 i = 0; i < TRADE_SLOT_COUNT; ++i) { - data << uint8(i); // trade slot number, if not specified, then end of packet + Item* item = view_trade->GetItem(TradeSlots(i)); + if (!item) + continue; + ++count; - if (Item* item = view_trade->GetItem(TradeSlots(i))) - { - data << uint32(item->GetTemplate()->ItemId); // entry - data << uint32(item->GetTemplate()->DisplayInfoID);// display id - data << uint32(item->GetCount()); // stack count - // wrapped: hide stats but show giftcreator name - data << uint32(item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED) ? 1 : 0); - data << uint64(item->GetUInt64Value(ITEM_FIELD_GIFTCREATOR)); - // perm. enchantment and gems - data << uint32(item->GetEnchantmentId(PERM_ENCHANTMENT_SLOT)); - for (uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+MAX_GEM_SOCKETS; ++enchant_slot) - data << uint32(item->GetEnchantmentId(EnchantmentSlot(enchant_slot))); - // creator - data << uint64(item->GetUInt64Value(ITEM_FIELD_CREATOR)); - data << uint32(item->GetSpellCharges()); // charges - data << uint32(item->GetItemSuffixFactor()); // SuffixFactor - data << uint32(item->GetItemRandomPropertyId());// random properties id - data << uint32(item->GetTemplate()->LockID); // lock id - // max durability - data << uint32(item->GetUInt32Value(ITEM_FIELD_MAXDURABILITY)); - // durability - data << uint32(item->GetUInt32Value(ITEM_FIELD_DURABILITY)); - } - else + ObjectGuid giftCreatorGuid = item->GetUInt64Value(ITEM_FIELD_GIFTCREATOR); + ObjectGuid creatorGuid = item->GetUInt64Value(ITEM_FIELD_CREATOR); + + bitData.WriteBit(giftCreatorGuid[7]); + bitData.WriteBit(giftCreatorGuid[1]); + bool notWrapped = bitData.WriteBit(!item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED)); + bitData.WriteBit(giftCreatorGuid[3]); + + if (notWrapped) { - for (uint8 j = 0; j < 18; ++j) - data << uint32(0); + bitData.WriteBit(creatorGuid[7]); + bitData.WriteBit(creatorGuid[1]); + bitData.WriteBit(creatorGuid[4]); + bitData.WriteBit(creatorGuid[6]); + bitData.WriteBit(creatorGuid[2]); + bitData.WriteBit(creatorGuid[3]); + bitData.WriteBit(creatorGuid[5]); + bitData.WriteBit(item->GetTemplate()->LockID != 0); + bitData.WriteBit(creatorGuid[0]); + + itemData.WriteByteSeq(creatorGuid[1]); + + itemData << uint32(item->GetEnchantmentId(PERM_ENCHANTMENT_SLOT)); + for (uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+MAX_GEM_SOCKETS /*3*/; ++enchant_slot) + itemData << uint32(item->GetEnchantmentId(EnchantmentSlot(enchant_slot))); + itemData << uint32(item->GetUInt32Value(ITEM_FIELD_MAXDURABILITY)); + + itemData.WriteByteSeq(creatorGuid[6]); + itemData.WriteByteSeq(creatorGuid[2]); + itemData.WriteByteSeq(creatorGuid[7]); + itemData.WriteByteSeq(creatorGuid[4]); + + itemData << uint32(0); // reforge id, FIXME: not implemented + itemData << uint32(item->GetUInt32Value(ITEM_FIELD_DURABILITY)); + itemData << uint32(item->GetItemRandomPropertyId()); + + itemData.WriteByteSeq(creatorGuid[3]); + + itemData << uint32(0); // unk7 + + itemData.WriteByteSeq(creatorGuid[0]); + + itemData << uint32(item->GetSpellCharges()); + itemData << uint32(item->GetItemSuffixFactor()); + + itemData.WriteByteSeq(creatorGuid[5]); } + + bitData.WriteBit(giftCreatorGuid[6]); + bitData.WriteBit(giftCreatorGuid[4]); + bitData.WriteBit(giftCreatorGuid[2]); + bitData.WriteBit(giftCreatorGuid[0]); + bitData.WriteBit(giftCreatorGuid[5]); + + itemData.WriteByteSeq(giftCreatorGuid[6]); + itemData.WriteByteSeq(giftCreatorGuid[1]); + itemData.WriteByteSeq(giftCreatorGuid[7]); + itemData.WriteByteSeq(giftCreatorGuid[4]); + + itemData << uint32(item->GetTemplate()->ItemId); + + itemData.WriteByteSeq(giftCreatorGuid[0]); + + itemData << uint32(item->GetCount()); + + itemData.WriteByteSeq(giftCreatorGuid[5]); + + itemData << uint8(i); + + itemData.WriteByteSeq(giftCreatorGuid[2]); + itemData.WriteByteSeq(giftCreatorGuid[3]); } + + data.WriteBits(count, 22); + data.FlushBits(); + data.append(bitData); + data.FlushBits(); + data.append(itemData); + SendPacket(&data); } @@ -665,9 +721,30 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket) _player->m_trade = new TradeData(_player, pOther); pOther->m_trade = new TradeData(pOther, _player); - WorldPacket data(SMSG_TRADE_STATUS, 12); - data << uint32(TRADE_STATUS_BEGIN_TRADE); - data << uint64(_player->GetGUID()); + WorldPacket data(SMSG_TRADE_STATUS, 2+7); + data.WriteBit(0); // unk bit, usually 0 + data.WriteBits(TRADE_STATUS_BEGIN_TRADE, 5); + + ObjectGuid playerGuid = _player->GetGUID(); + // WTB StartBitStream... + data.WriteBit(playerGuid[2]); + data.WriteBit(playerGuid[4]); + data.WriteBit(playerGuid[6]); + data.WriteBit(playerGuid[0]); + data.WriteBit(playerGuid[1]); + data.WriteBit(playerGuid[3]); + data.WriteBit(playerGuid[7]); + data.WriteBit(playerGuid[5]); + + data.WriteByteSeq(playerGuid[4]); + data.WriteByteSeq(playerGuid[1]); + data.WriteByteSeq(playerGuid[2]); + data.WriteByteSeq(playerGuid[3]); + data.WriteByteSeq(playerGuid[0]); + data.WriteByteSeq(playerGuid[7]); + data.WriteByteSeq(playerGuid[6]); + data.WriteByteSeq(playerGuid[5]); + pOther->GetSession()->SendPacket(&data); } diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 987876dd5e5..0b3dc884a1a 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -3499,30 +3499,38 @@ enum SpellFamilyNames enum TradeStatus { - TRADE_STATUS_BUSY = 0, - TRADE_STATUS_BEGIN_TRADE = 1, - TRADE_STATUS_OPEN_WINDOW = 2, - TRADE_STATUS_TRADE_CANCELED = 3, - TRADE_STATUS_TRADE_ACCEPT = 4, - TRADE_STATUS_BUSY_2 = 5, - TRADE_STATUS_NO_TARGET = 6, - TRADE_STATUS_BACK_TO_TRADE = 7, - TRADE_STATUS_TRADE_COMPLETE = 8, - // 9? - TRADE_STATUS_TARGET_TO_FAR = 10, - TRADE_STATUS_WRONG_FACTION = 11, - TRADE_STATUS_CLOSE_WINDOW = 12, - // 13? - TRADE_STATUS_IGNORE_YOU = 14, - TRADE_STATUS_YOU_STUNNED = 15, - TRADE_STATUS_TARGET_STUNNED = 16, - TRADE_STATUS_YOU_DEAD = 17, - TRADE_STATUS_TARGET_DEAD = 18, - TRADE_STATUS_YOU_LOGOUT = 19, - TRADE_STATUS_TARGET_LOGOUT = 20, - TRADE_STATUS_TRIAL_ACCOUNT = 21, // Trial accounts can not perform that action - TRADE_STATUS_ONLY_CONJURED = 22, // You can only trade conjured items... (cross realm BG related). - TRADE_STATUS_NOT_ELIGIBLE = 23 // Related to trading soulbound loot items + TRADE_STATUS_OPEN_WINDOW = 0, + // 1 - Related to EVENT_PLAYER_MONEY + TRADE_STATUS_NOT_ELIGIBLE = 2, // Related to trading soulbound loot items + TRADE_STATUS_YOU_LOGOUT = 3, + TRADE_STATUS_IGNORE_YOU = 4, + TRADE_STATUS_TARGET_DEAD = 5, + TRADE_STATUS_TRADE_ACCEPT = 6, + TRADE_STATUS_TARGET_LOGOUT = 7, + // 8 - nonexistent + TRADE_STATUS_TRADE_COMPLETE = 9, + TRADE_STATUS_TRIAL_ACCOUNT = 10, // Trial accounts can not perform that action + // 11 - nonexistent + TRADE_STATUS_BEGIN_TRADE = 12, + TRADE_STATUS_YOU_DEAD = 13, + // 14 - nonexistent + // 15 - nonexistent + TRADE_STATUS_TARGET_TO_FAR = 16, + TRADE_STATUS_NO_TARGET = 17, + TRADE_STATUS_BUSY_2 = 18, + TRADE_STATUS_CURRENCY_NOT_TRADABLE = 19, // new 4.x + TRADE_STATUS_WRONG_FACTION = 20, + TRADE_STATUS_BUSY = 21, + // 22 - equivalent to 335 unk status 9 + TRADE_STATUS_TRADE_CANCELED = 23, + TRADE_STATUS_CURRENCY = 24, // new 4.x + TRADE_STATUS_BACK_TO_TRADE = 25, + TRADE_STATUS_ONLY_CONJURED = 26, // You can only trade conjured items... (cross realm BG related). + TRADE_STATUS_YOU_STUNNED = 27, + // 28 - nonexistent + TRADE_STATUS_TARGET_STUNNED = 29, + // 30 - nonexistent + TRADE_STATUS_CLOSE_WINDOW = 31, }; enum XPColorChar diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index d2b18844242..301ebb12221 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -352,7 +352,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_DIMINISHING_RETURNS_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_KNOCKBACK_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_REQUIREMENTS_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleIgnoreTradeOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_IGNORE_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleIgnoreTradeOpcode ); DEFINE_OPCODE_HANDLER(CMSG_INITIATE_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInitiateTradeOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_INSPECT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_INSTANCE_LOCK_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInstanceLockResponse ); @@ -1349,8 +1349,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_TITLE_EARNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TOGGLE_XP_GAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TOTEM_CREATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_TRADE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_TRADE_STATUS_EXTENDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TRADE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TRADE_STATUS_EXTENDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_SUCCEEDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From fc938ac21ea321aed3a6183bd6795bbd7f743f42 Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 26 Jul 2012 02:17:03 +0100 Subject: Core/PacketIO: Few updates and typo corrections for SendUpdateTrade --- src/server/game/Handlers/TradeHandler.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/TradeHandler.cpp b/src/server/game/Handlers/TradeHandler.cpp index b20b7e1730a..c3009507a28 100755 --- a/src/server/game/Handlers/TradeHandler.cpp +++ b/src/server/game/Handlers/TradeHandler.cpp @@ -80,19 +80,8 @@ void WorldSession::SendUpdateTrade(bool trader_data /*= true*/) { TradeData* view_trade = trader_data ? _player->GetTradeData()->GetTraderData() : _player->GetTradeData(); - WorldPacket data(SMSG_TRADE_STATUS_EXTENDED, 1+4+4+4+4+4+7*(1+4+4+4+4+8+4+4+4+4+8+4+4+4+4+4+4)); - - data << uint32(0); // this value must be equal to value from TRADE_STATUS_OPEN_WINDOW status packet (different value for different players to block multiple trades?) - data << uint32(0); // unk 2 - data << uint32(view_trade->GetMoney()); // trader gold - data << uint32(view_trade->GetSpell()); // spell casted on lowest slot item - data << uint32(TRADE_SLOT_COUNT); // trade slots count/number?, = next field in most cases - data << uint32(0); // unk 5 - data << uint8(trader_data); // 1 means traders data, 0 means own - data << uint32(TRADE_SLOT_COUNT); // trade slots count/number?, = prev field in most cases - - ByteBuffer itemData; - ByteBuffer bitData; + ByteBuffer itemData(7*2 + 7*4 + 3*4 + 3*4 + 1); + ByteBuffer bitData(3); uint8 count = 0; for (uint8 i = 0; i < TRADE_SLOT_COUNT; ++i) @@ -175,6 +164,17 @@ void WorldSession::SendUpdateTrade(bool trader_data /*= true*/) itemData.WriteByteSeq(giftCreatorGuid[3]); } + WorldPacket data(SMSG_TRADE_STATUS_EXTENDED, 4*6 + 8 + 1 + 3 + bitData.size() + itemData.size()); + + data << uint32(0); // this value must be equal to value from TRADE_STATUS_OPEN_WINDOW status packet (different value for different players to block multiple trades?) + data << uint32(0); // unk 2 + data << uint64(view_trade->GetMoney()); // trader gold + data << uint32(view_trade->GetSpell()); // spell casted on lowest slot item + data << uint32(TRADE_SLOT_COUNT); // trade slots count/number?, = next field in most cases + data << uint32(0); // unk 5 + data << uint8(trader_data); // 1 means traders data, 0 means own + data << uint32(TRADE_SLOT_COUNT); // trade slots count/number?, = prev field in most cases + data.WriteBits(count, 22); data.FlushBits(); data.append(bitData); -- cgit v1.2.3 From ee2e4ba02332561e44d02f0cf2a79571de37d9f4 Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 26 Jul 2012 03:31:46 +0100 Subject: Core/PacketIO: Fix a silly copy paste error in SendTradeStatus --- src/server/game/Handlers/TradeHandler.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/TradeHandler.cpp b/src/server/game/Handlers/TradeHandler.cpp index c3009507a28..86c3288c60c 100755 --- a/src/server/game/Handlers/TradeHandler.cpp +++ b/src/server/game/Handlers/TradeHandler.cpp @@ -34,12 +34,12 @@ void WorldSession::SendTradeStatus(TradeStatus status) { WorldPacket data; + data.Initialize(SMSG_TRADE_STATUS, 1+4+4); + data.WriteBit(0); // unk bit, usually 0 + data.WriteBits(status, 5); + switch (status) { - data.Initialize(SMSG_TRADE_STATUS, 1+4+4); - data.WriteBit(0); // unk bit, usually 0 - data.WriteBits(status, 5); - case TRADE_STATUS_BEGIN_TRADE: data.WriteBits(0, 8); // zero guid break; -- cgit v1.2.3 From f2c074d37ebb2a97cb9a0a10d5f9491e5abb4443 Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 26 Jul 2012 03:51:48 +0100 Subject: Core/PacketIO: Add a missing FlushBits to SendTradeStatus --- src/server/game/Handlers/TradeHandler.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/server/game/Handlers/TradeHandler.cpp b/src/server/game/Handlers/TradeHandler.cpp index 86c3288c60c..28c81069a8f 100755 --- a/src/server/game/Handlers/TradeHandler.cpp +++ b/src/server/game/Handlers/TradeHandler.cpp @@ -63,6 +63,8 @@ void WorldSession::SendTradeStatus(TradeStatus status) break; } + data.FlushBits(); + SendPacket(&data); } -- cgit v1.2.3 From 8a98ae2d48487ab3e08dd1f0c6ed3589ca141033 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 26 Jul 2012 11:05:48 +0200 Subject: Core/PacketIO: Fixed SMSG_TRADE_STATUS_EXTENDED --- src/server/game/Handlers/TradeHandler.cpp | 69 +++++++++++++++---------------- 1 file changed, 34 insertions(+), 35 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/TradeHandler.cpp b/src/server/game/Handlers/TradeHandler.cpp index 28c81069a8f..13cc4d34b88 100755 --- a/src/server/game/Handlers/TradeHandler.cpp +++ b/src/server/game/Handlers/TradeHandler.cpp @@ -83,35 +83,48 @@ void WorldSession::SendUpdateTrade(bool trader_data /*= true*/) TradeData* view_trade = trader_data ? _player->GetTradeData()->GetTraderData() : _player->GetTradeData(); ByteBuffer itemData(7*2 + 7*4 + 3*4 + 3*4 + 1); - ByteBuffer bitData(3); uint8 count = 0; + for (uint8 i = 0; i < TRADE_SLOT_COUNT; ++i) + if (view_trade->GetItem(TradeSlots(i))) + ++count; + + WorldPacket data(SMSG_TRADE_STATUS_EXTENDED, 4*6 + 8 + 1 + 3 + count * 70); + data << uint32(0); // this value must be equal to value from TRADE_STATUS_OPEN_WINDOW status packet (different value for different players to block multiple trades?) + data << uint32(0); // unk 2 + data << uint64(view_trade->GetMoney()); // trader gold + data << uint32(view_trade->GetSpell()); // spell casted on lowest slot item + data << uint32(TRADE_SLOT_COUNT); // trade slots count/number?, = next field in most cases + data << uint32(0); // unk 5 + data << uint8(trader_data); // 1 means traders data, 0 means own + data << uint32(TRADE_SLOT_COUNT); // trade slots count/number?, = prev field in most cases + data.WriteBits(count, 22); + for (uint8 i = 0; i < TRADE_SLOT_COUNT; ++i) { Item* item = view_trade->GetItem(TradeSlots(i)); if (!item) continue; - ++count; ObjectGuid giftCreatorGuid = item->GetUInt64Value(ITEM_FIELD_GIFTCREATOR); ObjectGuid creatorGuid = item->GetUInt64Value(ITEM_FIELD_CREATOR); - bitData.WriteBit(giftCreatorGuid[7]); - bitData.WriteBit(giftCreatorGuid[1]); - bool notWrapped = bitData.WriteBit(!item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED)); - bitData.WriteBit(giftCreatorGuid[3]); + data.WriteBit(giftCreatorGuid[7]); + data.WriteBit(giftCreatorGuid[1]); + bool notWrapped = data.WriteBit(!item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED)); + data.WriteBit(giftCreatorGuid[3]); if (notWrapped) { - bitData.WriteBit(creatorGuid[7]); - bitData.WriteBit(creatorGuid[1]); - bitData.WriteBit(creatorGuid[4]); - bitData.WriteBit(creatorGuid[6]); - bitData.WriteBit(creatorGuid[2]); - bitData.WriteBit(creatorGuid[3]); - bitData.WriteBit(creatorGuid[5]); - bitData.WriteBit(item->GetTemplate()->LockID != 0); - bitData.WriteBit(creatorGuid[0]); + data.WriteBit(creatorGuid[7]); + data.WriteBit(creatorGuid[1]); + data.WriteBit(creatorGuid[4]); + data.WriteBit(creatorGuid[6]); + data.WriteBit(creatorGuid[2]); + data.WriteBit(creatorGuid[3]); + data.WriteBit(creatorGuid[5]); + data.WriteBit(item->GetTemplate()->LockID != 0); + data.WriteBit(creatorGuid[0]); itemData.WriteByteSeq(creatorGuid[1]); @@ -122,7 +135,7 @@ void WorldSession::SendUpdateTrade(bool trader_data /*= true*/) itemData.WriteByteSeq(creatorGuid[6]); itemData.WriteByteSeq(creatorGuid[2]); - itemData.WriteByteSeq(creatorGuid[7]); + itemData.WriteByteSeq(creatorGuid[7]); itemData.WriteByteSeq(creatorGuid[4]); itemData << uint32(0); // reforge id, FIXME: not implemented @@ -141,11 +154,11 @@ void WorldSession::SendUpdateTrade(bool trader_data /*= true*/) itemData.WriteByteSeq(creatorGuid[5]); } - bitData.WriteBit(giftCreatorGuid[6]); - bitData.WriteBit(giftCreatorGuid[4]); - bitData.WriteBit(giftCreatorGuid[2]); - bitData.WriteBit(giftCreatorGuid[0]); - bitData.WriteBit(giftCreatorGuid[5]); + data.WriteBit(giftCreatorGuid[6]); + data.WriteBit(giftCreatorGuid[4]); + data.WriteBit(giftCreatorGuid[2]); + data.WriteBit(giftCreatorGuid[0]); + data.WriteBit(giftCreatorGuid[5]); itemData.WriteByteSeq(giftCreatorGuid[6]); itemData.WriteByteSeq(giftCreatorGuid[1]); @@ -166,20 +179,6 @@ void WorldSession::SendUpdateTrade(bool trader_data /*= true*/) itemData.WriteByteSeq(giftCreatorGuid[3]); } - WorldPacket data(SMSG_TRADE_STATUS_EXTENDED, 4*6 + 8 + 1 + 3 + bitData.size() + itemData.size()); - - data << uint32(0); // this value must be equal to value from TRADE_STATUS_OPEN_WINDOW status packet (different value for different players to block multiple trades?) - data << uint32(0); // unk 2 - data << uint64(view_trade->GetMoney()); // trader gold - data << uint32(view_trade->GetSpell()); // spell casted on lowest slot item - data << uint32(TRADE_SLOT_COUNT); // trade slots count/number?, = next field in most cases - data << uint32(0); // unk 5 - data << uint8(trader_data); // 1 means traders data, 0 means own - data << uint32(TRADE_SLOT_COUNT); // trade slots count/number?, = prev field in most cases - - data.WriteBits(count, 22); - data.FlushBits(); - data.append(bitData); data.FlushBits(); data.append(itemData); -- cgit v1.2.3 From 868c6e853b2bdcc2d22748c41f590a66d0ee2ffd Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 26 Jul 2012 18:36:26 +0200 Subject: Core/PacketIO: Fixed CMSG_PING (and pong) --- src/server/game/Server/WorldSocket.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index faff1468ad3..5eeb18550c5 100755 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -1051,8 +1051,8 @@ int WorldSocket::HandlePing (WorldPacket& recvPacket) uint32 latency; // Get the ping packet content - recvPacket >> ping; recvPacket >> latency; + recvPacket >> ping; if (m_LastPingTime == ACE_Time_Value::zero) m_LastPingTime = ACE_OS::gettimeofday(); // for 1st ping -- cgit v1.2.3 From 790ef5add5ef453d223621c1e56ac7a194e16bd9 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 28 Jul 2012 19:11:47 +0200 Subject: Core/Channels: Updated channel join structure --- src/server/game/Handlers/ChannelHandler.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/ChannelHandler.cpp b/src/server/game/Handlers/ChannelHandler.cpp index efa2d54a65d..06ee4207d3a 100755 --- a/src/server/game/Handlers/ChannelHandler.cpp +++ b/src/server/game/Handlers/ChannelHandler.cpp @@ -24,14 +24,17 @@ void WorldSession::HandleJoinChannel(WorldPacket& recvPacket) sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); uint32 channelId; - uint8 unknown1, unknown2; + uint32 channelLength, passLength; std::string channelName, pass; recvPacket >> channelId; - recvPacket >> unknown1 >> unknown2; - recvPacket >> pass; - recvPacket >> channelName; - + recvPacket.ReadBit(); // unknowns + recvPacket.ReadBit(); + channelLength = recvPacket.ReadBits(8); + passLength = recvPacket.ReadBits(8); + channelName = recvPacket.ReadString(channelLength); + pass = recvPacket.ReadString(passLength); + if (channelId) { ChatChannelsEntry const* channel = sChatChannelsStore.LookupEntry(channelId); -- cgit v1.2.3 From 3b19f42da2b4ba04b7cd6cede830fd0adf07f6e1 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 28 Jul 2012 19:18:47 +0200 Subject: Core/PacketIO: Limited number of update fields sent to other players --- src/server/game/Entities/Object/Object.cpp | 46 ++++++++++++++++------ src/server/game/Entities/Object/Object.h | 2 +- src/server/game/Entities/Object/ObjectDefines.h | 2 +- .../game/Entities/Object/Updates/UpdateFields.h | 2 + 4 files changed, 37 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 492afc39dc6..5f3afb34a83 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -183,9 +183,13 @@ void Object::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) c uint8 updatetype = UPDATETYPE_CREATE_OBJECT; uint16 flags = m_updateFlag; + uint32 valCount = m_valuesCount; + /** lower flag1 **/ if (target == this) // building packet for yourself flags |= UPDATEFLAG_SELF; + else if (GetTypeId() == TYPEID_PLAYER) + valCount = PLAYER_END_NOT_SELF; if (flags & UPDATEFLAG_STATIONARY_POSITION) { @@ -226,14 +230,14 @@ void Object::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) c //sLog->outDebug("BuildCreateUpdate: update-type: %u, object-type: %u got flags: %X, flags2: %X", updatetype, m_objectTypeId, flags, flags2); ByteBuffer buf(500); - buf << (uint8)updatetype; + buf << uint8(updatetype); buf.append(GetPackGUID()); - buf << (uint8)m_objectTypeId; + buf << uint8(m_objectTypeId); _BuildMovementUpdate(&buf, flags); UpdateMask updateMask; - updateMask.SetCount(m_valuesCount); + updateMask.SetCount(valCount); _SetCreateBits(&updateMask, target); _BuildValuesUpdate(updatetype, &buf, &updateMask, target); data->AddUpdateBlock(buf); @@ -254,11 +258,15 @@ void Object::BuildValuesUpdateBlockForPlayer(UpdateData* data, Player* target) c { ByteBuffer buf(500); - buf << (uint8) UPDATETYPE_VALUES; + buf << uint8(UPDATETYPE_VALUES); buf.append(GetPackGUID()); UpdateMask updateMask; - updateMask.SetCount(m_valuesCount); + uint32 valCount = m_valuesCount; + if (GetTypeId() == TYPEID_PLAYER && target != this) + valCount = PLAYER_END_NOT_SELF; + + updateMask.SetCount(valCount); _SetUpdateBits(&updateMask, target); _BuildValuesUpdate(UPDATETYPE_VALUES, &buf, &updateMask, target); @@ -332,7 +340,7 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const ObjectGuid transGuid = self->m_movementInfo.t_guid; data->WriteBit(transGuid[1]); - data->WriteBit(movementFlagsExtra & MOVEMENTFLAG2_INTERPOLATED_MOVEMENT); + data->WriteBit(0); // Has transport time 2 data->WriteBit(transGuid[4]); data->WriteBit(transGuid[0]); data->WriteBit(transGuid[6]); @@ -443,8 +451,8 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const data->WriteByteSeq(transGuid[7]); *data << uint32(self->GetTransTime()); *data << float(self->GetTransOffsetO()); - if (movementFlagsExtra & MOVEMENTFLAG2_INTERPOLATED_MOVEMENT) - *data << uint32(0); + //if (hasTransportTime2) + // *data << uint32(0); *data << float(self->GetTransOffsetY()); *data << float(self->GetTransOffsetX()); @@ -561,6 +569,7 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const if (flags & UPDATEFLAG_HAS_TARGET) { ObjectGuid victimGuid = ToUnit()->getVictim()->GetGUID(); // checked in BuildCreateUpdateBlockForPlayer + data->WriteByteSeq(victimGuid[4]); data->WriteByteSeq(victimGuid[0]); data->WriteByteSeq(victimGuid[3]); data->WriteByteSeq(victimGuid[5]); @@ -568,7 +577,6 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const data->WriteByteSeq(victimGuid[6]); data->WriteByteSeq(victimGuid[2]); data->WriteByteSeq(victimGuid[1]); - data->WriteByteSeq(victimGuid[4]); } //if (flags & UPDATEFLAG_ANIMKITS) @@ -585,7 +593,7 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const *data << uint32(getMSTime()); // Unknown - getMSTime is wrong. } -void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask* updateMask, Player* target) const +void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer* data, UpdateMask* updateMask, Player* target) const { if (!target) return; @@ -627,7 +635,11 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask* } } - WPAssert(updateMask && updateMask->GetCount() == m_valuesCount); + uint32 valCount = m_valuesCount; + if (GetTypeId() == TYPEID_PLAYER && target != this) + valCount = PLAYER_END_NOT_SELF; + + WPAssert(updateMask && updateMask->GetCount() == valCount); *data << (uint8)updateMask->GetBlockCount(); data->append(updateMask->GetMask(), updateMask->GetLength()); @@ -985,7 +997,11 @@ void Object::_SetUpdateBits(UpdateMask* updateMask, Player* target) const GetUpdateFieldData(target, flags, isOwner, isItemOwner, hasSpecialInfo, isPartyMember); - for (uint16 index = 0; index < m_valuesCount; ++index, ++indexes) + uint32 valCount = m_valuesCount; + if (GetTypeId() == TYPEID_PLAYER && target != this) + valCount = PLAYER_END_NOT_SELF; + + for (uint16 index = 0; index < valCount; ++index, ++indexes) if (_fieldNotifyFlags & flags[index] || (flags[index] & UF_FLAG_SPECIAL_INFO && hasSpecialInfo) || (*indexes && IsUpdateFieldVisible(flags[index], isSelf, isOwner, isItemOwner, isPartyMember))) updateMask->SetBit(index); } @@ -1002,7 +1018,11 @@ void Object::_SetCreateBits(UpdateMask* updateMask, Player* target) const GetUpdateFieldData(target, flags, isOwner, isItemOwner, hasSpecialInfo, isPartyMember); - for (uint16 index = 0; index < m_valuesCount; ++index, ++value) + uint32 valCount = m_valuesCount; + if (GetTypeId() == TYPEID_PLAYER && target != this) + valCount = PLAYER_END_NOT_SELF; + + for (uint16 index = 0; index < valCount; ++index, ++value) if (_fieldNotifyFlags & flags[index] || (flags[index] & UF_FLAG_SPECIAL_INFO && hasSpecialInfo) || (*value && IsUpdateFieldVisible(flags[index], isSelf, isOwner, isItemOwner, isPartyMember))) updateMask->SetBit(index); } diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index e417b3bdc2d..3e00e775b4b 100755 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -935,7 +935,7 @@ class WorldObject : public Object, public WorldLocation virtual bool _IsWithinDist(WorldObject const* obj, float dist2compare, bool is3D) const; - bool CanNeverSee(WorldObject const* obj) const { return !IsInMap(obj) || !InSamePhase(obj); } + bool CanNeverSee(WorldObject const* obj) const { return GetMap() != obj->GetMap() || !InSamePhase(obj); } virtual bool CanAlwaysSee(WorldObject const* /*obj*/) const { return false; } bool CanDetect(WorldObject const* obj, bool ignoreStealth) const; bool CanDetectInvisibilityOf(WorldObject const* obj) const; diff --git a/src/server/game/Entities/Object/ObjectDefines.h b/src/server/game/Entities/Object/ObjectDefines.h index ef1eeb237b7..2e74a3b4ee4 100755 --- a/src/server/game/Entities/Object/ObjectDefines.h +++ b/src/server/game/Entities/Object/ObjectDefines.h @@ -81,7 +81,7 @@ inline uint32 GUID_HIPART(uint64 guid) // We have different low and middle part size for different guid types #define _GUID_ENPART_2(x) 0 -#define _GUID_ENPART_3(x) (uint32)((uint64(x) >> 32) & UI64LIT(0x0000000000FFFFFF)) +#define _GUID_ENPART_3(x) (uint32)((uint64(x) >> 32) & UI64LIT(0x00000000000FFFFF)) #define _GUID_LOPART_2(x) (uint32)(uint64(x) & UI64LIT(0x00000000FFFFFFFF)) #define _GUID_LOPART_3(x) (uint32)(uint64(x) & UI64LIT(0x00000000FFFFFFFF)) diff --git a/src/server/game/Entities/Object/Updates/UpdateFields.h b/src/server/game/Entities/Object/Updates/UpdateFields.h index 023ccfd44d1..3602cbea648 100755 --- a/src/server/game/Entities/Object/Updates/UpdateFields.h +++ b/src/server/game/Entities/Object/Updates/UpdateFields.h @@ -435,6 +435,8 @@ enum EPlayerFields PLAYER_CHOSEN_TITLE = UNIT_END + 0x012B, // Size: 1, Type: INT, Flags: PUBLIC PLAYER_FAKE_INEBRIATION = UNIT_END + 0x012C, // Size: 1, Type: INT, Flags: PUBLIC PLAYER_FIELD_PAD_0 = UNIT_END + 0x012D, // Size: 1, Type: INT, Flags: NONE + PLAYER_END_NOT_SELF = UNIT_END + 0x012E, + PLAYER_FIELD_INV_SLOT_HEAD = UNIT_END + 0x012E, // Size: 46, Type: LONG, Flags: PRIVATE PLAYER_FIELD_PACK_SLOT_1 = UNIT_END + 0x015C, // Size: 32, Type: LONG, Flags: PRIVATE PLAYER_FIELD_BANK_SLOT_1 = UNIT_END + 0x017C, // Size: 56, Type: LONG, Flags: PRIVATE -- cgit v1.2.3 From 42ad1b83346c03790b6403179a8945614afff739 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 29 Jul 2012 23:44:30 +0200 Subject: Core/Objects: Added missed changes, thanks cyberbrest for noticing Closes #7224 --- .../game/Entities/Creature/TemporarySummon.h | 2 +- src/server/game/Entities/Object/Object.cpp | 31 +++++++--------------- 2 files changed, 11 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Creature/TemporarySummon.h b/src/server/game/Entities/Creature/TemporarySummon.h index 537bbd9c099..f82dfa53f4d 100755 --- a/src/server/game/Entities/Creature/TemporarySummon.h +++ b/src/server/game/Entities/Creature/TemporarySummon.h @@ -34,7 +34,7 @@ class TempSummon : public Creature void SetTempSummonType(TempSummonType type); void SaveToDB(uint32 /*mapid*/, uint8 /*spawnMask*/, uint32 /*phaseMask*/) {} Unit* GetSummoner() const; - uint64 GetSummonerGUID() { return m_summonerGUID; } + uint64 GetSummonerGUID() const { return m_summonerGUID; } TempSummonType const& GetSummonType() { return m_type; } uint32 GetTimer() { return m_timer; } diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 5f3afb34a83..326bf616f57 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -139,7 +139,7 @@ void Object::_Create(uint32 guidlow, uint32 entry, HighGuid guidhigh) uint64 guid = MAKE_NEW_GUID(guidlow, entry, guidhigh); SetUInt64Value(OBJECT_FIELD_GUID, guid); SetUInt16Value(OBJECT_FIELD_TYPE, 0, m_objectType); - m_PackGUID.wpos(0); + m_PackGUID.clear(); m_PackGUID.appendPackGUID(GetGUID()); } @@ -220,14 +220,10 @@ void Object::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) c } } - if (isType(TYPEMASK_UNIT)) - { - if (((Unit*)this)->getVictim()) - flags |= UPDATEFLAG_HAS_TARGET; - } } - //sLog->outDebug("BuildCreateUpdate: update-type: %u, object-type: %u got flags: %X, flags2: %X", updatetype, m_objectTypeId, flags, flags2); + if (ToUnit() && ToUnit()->getVictim()) + flags |= UPDATEFLAG_HAS_TARGET; ByteBuffer buf(500); buf << uint8(updatetype); @@ -647,7 +643,7 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer* data, UpdateMask* // 2 specialized loops for speed optimization in non-unit case if (isType(TYPEMASK_UNIT)) // unit (creature/player) case { - for (uint16 index = 0; index < m_valuesCount; ++index) + for (uint16 index = 0; index < valCount; ++index) { if (updateMask->GetBit(index)) { @@ -811,7 +807,7 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer* data, UpdateMask* } else if (isType(TYPEMASK_GAMEOBJECT)) // gameobject case { - for (uint16 index = 0; index < m_valuesCount; ++index) + for (uint16 index = 0; index < valCount; ++index) { if (updateMask->GetBit(index)) { @@ -827,35 +823,28 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer* data, UpdateMask* *data << uint16(GO_DYNFLAG_LO_ACTIVATE); else *data << uint16(GO_DYNFLAG_LO_ACTIVATE | GO_DYNFLAG_LO_SPARKLE); - *data << uint16(-1); break; case GAMEOBJECT_TYPE_GENERIC: if (target->isGameMaster()) *data << uint16(0); else *data << uint16(GO_DYNFLAG_LO_SPARKLE); - *data << uint16(-1); break; case GAMEOBJECT_TYPE_GOOBER: if (target->isGameMaster()) *data << uint16(GO_DYNFLAG_LO_ACTIVATE); else *data << uint16(GO_DYNFLAG_LO_ACTIVATE | GO_DYNFLAG_LO_SPARKLE); - *data << uint16(-1); break; default: - // unknown, not happen. - *data << uint16(0); - *data << uint16(-1); + *data << uint16(0); // unknown, not happen. break; } } else - { - // disable quest object - *data << uint16(0); - *data << uint16(-1); - } + *data << uint16(0); // disable quest object + + *data << uint16(-1); } else if (index == GAMEOBJECT_FLAGS) { @@ -873,7 +862,7 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer* data, UpdateMask* } else // other objects case (no special index checks) { - for (uint16 index = 0; index < m_valuesCount; ++index) + for (uint16 index = 0; index < valCount; ++index) { if (updateMask->GetBit(index)) { -- cgit v1.2.3 From 195e0369cff80fb89afb267ce479bdd2e9a4e31b Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 30 Jul 2012 01:15:41 +0100 Subject: Core/PacketIO: Fix structure of CMSG_SET_TRADE_ITEM Thanks Subv and Shauren --- src/server/game/Handlers/TradeHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Handlers/TradeHandler.cpp b/src/server/game/Handlers/TradeHandler.cpp index 13cc4d34b88..5c01bc7ea64 100755 --- a/src/server/game/Handlers/TradeHandler.cpp +++ b/src/server/game/Handlers/TradeHandler.cpp @@ -769,9 +769,9 @@ void WorldSession::HandleSetTradeItemOpcode(WorldPacket& recvPacket) uint8 bag; uint8 slot; + recvPacket >> slot; recvPacket >> tradeSlot; recvPacket >> bag; - recvPacket >> slot; TradeData* my_trade = _player->GetTradeData(); if (!my_trade) -- cgit v1.2.3 From c24de2c6d8883a9c4541003c259196c830de2add Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 30 Jul 2012 16:39:46 +0100 Subject: Core: Implement Void Storage --- sql/base/characters_database.sql | 30 +- .../2012_07_30_00_characters_void_storage_434.sql | 11 + src/server/game/Entities/Player/Player.cpp | 190 ++++++- src/server/game/Entities/Player/Player.h | 41 +- src/server/game/Entities/Unit/Unit.h | 2 + src/server/game/Globals/ObjectMgr.cpp | 11 +- src/server/game/Globals/ObjectMgr.h | 2 + src/server/game/Handlers/CharacterHandler.cpp | 4 + src/server/game/Handlers/VoidStorageHandler.cpp | 618 +++++++++++++++++++++ src/server/game/Miscellaneous/SharedDefines.h | 20 + src/server/game/Server/Protocol/Opcodes.cpp | 21 +- src/server/game/Server/Protocol/Opcodes.h | 6 +- src/server/game/Server/WorldSession.h | 7 + .../Database/Implementation/CharacterDatabase.cpp | 4 + .../Database/Implementation/CharacterDatabase.h | 4 + 15 files changed, 956 insertions(+), 15 deletions(-) create mode 100644 sql/updates/characters/2012_07_30_00_characters_void_storage_434.sql create mode 100644 src/server/game/Handlers/VoidStorageHandler.cpp (limited to 'src') diff --git a/sql/base/characters_database.sql b/sql/base/characters_database.sql index 8c3913bda73..f42c8f2e6ad 100644 --- a/sql/base/characters_database.sql +++ b/sql/base/characters_database.sql @@ -2265,6 +2265,34 @@ LOCK TABLES `reserved_name` WRITE; /*!40000 ALTER TABLE `reserved_name` ENABLE KEYS */; UNLOCK TABLES; +-- +-- Table structure for table `void_storage` +-- + +DROP TABLE IF EXISTS `void_storage`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `void_storage` ( + `itemId` bigint(20) unsigned NOT NULL, + `playerGuid` int(10) unsigned NOT NULL, + `itemEntry` mediumint(8) unsigned NOT NULL, + `slot` tinyint(3) unsigned NOT NULL, + `creatorGuid` int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`itemId`), + UNIQUE KEY `idx_player_slot` (`playerGuid`,`slot`), + KEY `idx_player` (`playerGuid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `void_storage` +-- + +LOCK TABLES `void_storage` WRITE; +/*!40000 ALTER TABLE `void_storage` DISABLE KEYS */; +/*!40000 ALTER TABLE `void_storage` ENABLE KEYS */; +UNLOCK TABLES; + -- -- Table structure for table `warden_action` -- @@ -2322,4 +2350,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2012-05-30 12:56:18 +-- Dump completed on 2012-07-30 16:34:12 diff --git a/sql/updates/characters/2012_07_30_00_characters_void_storage_434.sql b/sql/updates/characters/2012_07_30_00_characters_void_storage_434.sql new file mode 100644 index 00000000000..e8a47c5f91c --- /dev/null +++ b/sql/updates/characters/2012_07_30_00_characters_void_storage_434.sql @@ -0,0 +1,11 @@ +DROP TABLE IF EXISTS `void_storage`; +CREATE TABLE IF NOT EXISTS `void_storage` ( + `itemId` bigint(20) unsigned NOT NULL, + `playerGuid` int(10) unsigned NOT NULL, + `itemEntry` mediumint(8) unsigned NOT NULL, + `slot` tinyint(3) unsigned NOT NULL, + `creatorGuid` int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`itemId`), + UNIQUE KEY `idx_player_slot` (`playerGuid`,`slot`), + KEY `idx_player` (`playerGuid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 56c3915bd65..6cdea51bfb3 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -714,7 +714,7 @@ Player::Player(WorldSession* session): Unit(true), m_achievementMgr(this), m_rep m_DailyQuestChanged = false; m_lastDailyQuestTime = 0; - for (uint8 i=0; iDecreasePlayerCount(); } @@ -17195,6 +17200,9 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) _LoadInventory(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADINVENTORY), time_diff); + if (IsVoidStorageUnlocked()) + _LoadVoidStorage(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADVOIDSTORAGE)); + // update items with duration and realtime UpdateItemDuration(time_diff, true); @@ -17654,6 +17662,50 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timeDiff) _ApplyAllItemMods(); } +void Player::_LoadVoidStorage(PreparedQueryResult result) +{ + if (!result) + return; + + do + { + // SELECT itemid, itemEntry, slot, creatorGuid FROM void_storage WHERE playerGuid = ? + Field* fields = result->Fetch(); + + uint64 itemId = fields[0].GetUInt64(); + uint32 itemEntry = fields[1].GetUInt32(); + uint8 slot = fields[2].GetUInt8(); + uint32 creatorGuid = fields[3].GetUInt32(); + + if (!itemId) + { + sLog->outError("Player::_LoadVoidStorage - Player (GUID: %u, name: %s) has an item with an invalid id (item id: %u, entry: %u).", GetGUIDLow(), GetName(), itemId, itemEntry); + continue; + } + + if (!sObjectMgr->GetItemTemplate(itemEntry)) + { + sLog->outError("Player::_LoadVoidStorage - Player (GUID: %u, name: %s) has an item with an invalid entry (item id: %u, entry: %u).", GetGUIDLow(), GetName(), itemId, itemEntry); + continue; + } + + if (slot < 0 || slot > VOID_STORAGE_MAX_SLOT) + { + sLog->outError("Player::_LoadVoidStorage - Player (GUID: %u, name: %s) has an item with an invalid slot (item id: %u, entry: %u, slot: %u).", GetGUIDLow(), GetName(), itemId, itemEntry, slot); + continue; + } + + if (!sObjectMgr->GetPlayerByLowGUID(creatorGuid)) + { + sLog->outError("Player::_LoadVoidStorage - Player (GUID: %u, name: %s) has an item with an invalid creator guid, set to 0 (item id: %u, entry: %u, creatorGuid: %u).", GetGUIDLow(), GetName(), itemId, itemEntry, creatorGuid); + creatorGuid = 0; + } + + _voidStorageItems[slot] = new VoidStorageItem(itemId, itemEntry, creatorGuid); + } + while (result->NextRow()); +} + Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, Field* fields) { PreparedStatement* stmt = NULL; @@ -18882,6 +18934,7 @@ void Player::SaveToDB(bool create /*=false*/) _SaveBGData(trans); _SaveInventory(trans); + _SaveVoidStorage(trans); _SaveQuestStatus(trans); _SaveDailyQuestStatus(trans); _SaveWeeklyQuestStatus(trans); @@ -19121,7 +19174,7 @@ void Player::_SaveInventory(SQLTransaction& trans) // save all changes to the item... if (item->GetState() != ITEM_NEW) // only for existing items, no dupes item->SaveToDB(trans); - // ...but do not save position in invntory + // ...but do not save position in inventory continue; } } @@ -19151,6 +19204,35 @@ void Player::_SaveInventory(SQLTransaction& trans) m_itemUpdateQueue.clear(); } +void Player::_SaveVoidStorage(SQLTransaction& trans) +{ + PreparedStatement* stmt = NULL; + uint32 lowGuid = GetGUIDLow(); + + for (uint8 i = 0; i < VOID_STORAGE_MAX_SLOT; ++i) + { + if (!_voidStorageItems[i]) // unused item + { + // DELETE FROM void_Storage WHERE slot = ? AND playerGuid = ? + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_VOID_STORAGE_ITEM_BY_SLOT); + stmt->setUInt8(0, i); + stmt->setUInt32(1, lowGuid); + } + else + { + // REPLACE INTO character_inventory (itemId, playerGuid, itemEntry, slot, creatorGuid) VALUES (?, ?, ?, ?, ?) + stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_VOID_STORAGE_ITEM); + stmt->setUInt64(0, _voidStorageItems[i]->ItemId); + stmt->setUInt32(1, lowGuid); + stmt->setUInt32(2, _voidStorageItems[i]->ItemEntry); + stmt->setUInt8(3, i); + stmt->setUInt32(4, _voidStorageItems[i]->CreatorGuid); + } + + trans->Append(stmt); + } +} + void Player::_SaveMail(SQLTransaction& trans) { if (!m_mailsLoaded) @@ -25602,6 +25684,108 @@ bool Player::IsInWhisperWhiteList(uint64 guid) return false; } +uint8 Player::GetNextVoidStorageFreeSlot() const +{ + for (uint8 i = 0; i < VOID_STORAGE_MAX_SLOT; ++i) + if (!_voidStorageItems[i]) // unused item + return i; + + return -1; +} + +uint8 Player::GetNumOfVoidStorageFreeSlots() const +{ + uint8 count = 0; + + for (uint8 i = 0; i < VOID_STORAGE_MAX_SLOT; ++i) + if (!_voidStorageItems[i]) + count++; + + return count; +} + +uint8 Player::AddVoidStorageItem(const VoidStorageItem& item) +{ + uint8 slot = GetNextVoidStorageFreeSlot(); + + if (slot < 0 || slot > VOID_STORAGE_MAX_SLOT) + { + GetSession()->SendVoidStorageTransferResult(VOID_TRANSFER_ERROR_FULL); + return -1; + } + + _voidStorageItems[slot] = new VoidStorageItem(item.ItemId, item.ItemEntry, item.CreatorGuid); + return slot; +} + +void Player::AddVoidStorageItemAtSlot(uint8 slot, const VoidStorageItem& item) +{ + if (slot < 0 || slot > VOID_STORAGE_MAX_SLOT) + { + GetSession()->SendVoidStorageTransferResult(VOID_TRANSFER_ERROR_FULL); + return; + } + + if (_voidStorageItems[slot]) + { + sLog->outError("Player::AddVoidStorageItemAtSlot - Player (GUID: %u, name: %s) tried to add an item to an used slot (item id: %u, entry: %u, slot: %u).", GetGUIDLow(), GetName(), _voidStorageItems[slot]->ItemId, _voidStorageItems[slot]->ItemEntry, slot); + GetSession()->SendVoidStorageTransferResult(VOID_TRANSFER_ERROR_INTERNAL_ERROR_1); + return; + } + + _voidStorageItems[slot] = new VoidStorageItem(item.ItemId, item.ItemId, item.CreatorGuid); +} + +void Player::DeleteVoidStorageItem(uint8 slot) +{ + if (slot < 0 || slot > VOID_STORAGE_MAX_SLOT) + { + GetSession()->SendVoidStorageTransferResult(VOID_TRANSFER_ERROR_INTERNAL_ERROR_1); + return; + } + + delete _voidStorageItems[slot]; + _voidStorageItems[slot] = NULL; +} + +bool Player::SwapVoidStorageItem(uint8 oldSlot, uint8 newSlot) +{ + if (oldSlot < 0 || oldSlot > VOID_STORAGE_MAX_SLOT || newSlot < 0 || newSlot > VOID_STORAGE_MAX_SLOT || oldSlot == newSlot) + { + + return false; + } + + // verify + std::swap(_voidStorageItems[newSlot], _voidStorageItems[oldSlot]); + return true; +} + +VoidStorageItem* Player::GetVoidStorageItem(uint8 slot) const +{ + if (slot < 0 || slot > VOID_STORAGE_MAX_SLOT) + { + GetSession()->SendVoidStorageTransferResult(VOID_TRANSFER_ERROR_INTERNAL_ERROR_1); + return NULL; + } + + return _voidStorageItems[slot]; +} + +VoidStorageItem* Player::GetVoidStorageItem(uint64 id, uint8& slot) const +{ + for (uint8 i = 0; i < VOID_STORAGE_MAX_SLOT; ++i) + { + if (_voidStorageItems[i] && _voidStorageItems[i]->ItemId == id) + { + slot = i; + return _voidStorageItems[i]; + } + } + + return NULL; +} + bool Player::SetHover(bool enable) { if (!Unit::SetHover(enable)) diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index aba570c1d37..6b8686a7c0e 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -405,7 +405,7 @@ enum PlayerFlags PLAYER_FLAGS_UNK26 = 0x04000000, PLAYER_FLAGS_UNK27 = 0x08000000, PLAYER_FLAGS_UNK28 = 0x10000000, - PLAYER_FLAGS_UNK29 = 0x20000000, + PLAYER_FLAGS_VOID_UNLOCKED = 0x20000000, // void storage PLAYER_FLAGS_UNK30 = 0x40000000, PLAYER_FLAGS_UNK31 = 0x80000000, }; @@ -816,6 +816,7 @@ enum PlayerLoginQueryIndex PLAYER_LOGIN_QUERY_LOADQUESTSTATUSREW = 29, PLAYER_LOGIN_QUERY_LOADINSTANCELOCKTIMES = 30, PLAYER_LOGIN_QUERY_LOADSEASONALQUESTSTATUS = 31, + PLAYER_LOGIN_QUERY_LOADVOIDSTORAGE = 32, MAX_PLAYER_LOGIN_QUERY, }; @@ -979,6 +980,27 @@ struct BGData bool HasTaxiPath() const { return taxiPath[0] && taxiPath[1]; } }; +struct VoidStorageItem +{ + VoidStorageItem() + { + ItemId = 0; + ItemEntry = 0; + CreatorGuid = 0; + } + + VoidStorageItem(uint64 id, uint32 entry, uint32 creator) + { + ItemId = id; + ItemEntry = entry; + CreatorGuid = creator; + } + + uint64 ItemId; + uint32 ItemEntry; + uint32 CreatorGuid; +}; + class TradeData { public: // constructors @@ -2589,6 +2611,19 @@ class Player : public Unit, public GridObject } } + // Void Storage + bool IsVoidStorageUnlocked() const { return HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_VOID_UNLOCKED); } + void UnlockVoidStorage() { SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_VOID_UNLOCKED); } + void LockVoidStorage() { RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_VOID_UNLOCKED); } + uint8 GetNextVoidStorageFreeSlot() const; + uint8 GetNumOfVoidStorageFreeSlots() const; + uint8 AddVoidStorageItem(const VoidStorageItem& item); + void AddVoidStorageItemAtSlot(uint8 slot, const VoidStorageItem& item); + void DeleteVoidStorageItem(uint8 slot); + bool SwapVoidStorageItem(uint8 oldSlot, uint8 newSlot); + VoidStorageItem* GetVoidStorageItem(uint8 slot) const; + VoidStorageItem* GetVoidStorageItem(uint64 id, uint8& slot) const; + protected: // Gamemaster whisper whitelist WhisperListContainer WhisperList; @@ -2638,6 +2673,7 @@ class Player : public Unit, public GridObject void _LoadGlyphAuras(); void _LoadBoundInstances(PreparedQueryResult result); void _LoadInventory(PreparedQueryResult result, uint32 timeDiff); + void _LoadVoidStorage(PreparedQueryResult result); void _LoadMailInit(PreparedQueryResult resultUnread, PreparedQueryResult resultDelivery); void _LoadMail(); void _LoadMailedItems(Mail* mail); @@ -2667,6 +2703,7 @@ class Player : public Unit, public GridObject void _SaveActions(SQLTransaction& trans); void _SaveAuras(SQLTransaction& trans); void _SaveInventory(SQLTransaction& trans); + void _SaveVoidStorage(SQLTransaction& trans); void _SaveMail(SQLTransaction& trans); void _SaveQuestStatus(SQLTransaction& trans); void _SaveDailyQuestStatus(SQLTransaction& trans); @@ -2714,6 +2751,8 @@ class Player : public Unit, public GridObject PlayerCurrenciesMap m_currencies; uint32 _GetCurrencyWeekCap(const CurrencyTypesEntry* currency) const; + VoidStorageItem* _voidStorageItems[VOID_STORAGE_MAX_SLOT]; + std::vector m_itemUpdateQueue; bool m_itemUpdateQueueBlocked; diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 7984c91bbd3..a010a119017 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -661,6 +661,8 @@ enum NPCFlags UNIT_NPC_FLAG_GUILD_BANKER = 0x00800000, // cause client to send 997 opcode UNIT_NPC_FLAG_SPELLCLICK = 0x01000000, // cause client to send 1015 opcode (spell click) UNIT_NPC_FLAG_PLAYER_VEHICLE = 0x02000000, // players with mounts that have vehicle data should have it set + UNIT_NPC_FLAG_REFORGER = 0x08000000, // reforging + UNIT_NPC_FLAG_VAULTKEEPER = 0x20000000, // void storage }; enum MovementFlags diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 79e29ff2761..258e5d3ec25 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -233,7 +233,7 @@ bool SpellClickInfo::IsFitToRequirements(Unit const* clicker, Unit const* clicke ObjectMgr::ObjectMgr(): _auctionId(1), _equipmentSetGuid(1), _itemTextId(1), _mailId(1), _hiPetNumber(1), _hiCharGuid(1), _hiCreatureGuid(1), _hiPetGuid(1), _hiVehicleGuid(1), _hiItemGuid(1), - _hiGoGuid(1), _hiDoGuid(1), _hiCorpseGuid(1), _hiMoTransGuid(1) + _hiGoGuid(1), _hiDoGuid(1), _hiCorpseGuid(1), _hiMoTransGuid(1), _voidItemId(1) {} ObjectMgr::~ObjectMgr() @@ -6315,6 +6315,10 @@ void ObjectMgr::SetHighestGuids() result = CharacterDatabase.Query("SELECT MAX(guid) FROM groups"); if (result) sGroupMgr->SetGroupDbStoreSize((*result)[0].GetUInt32()+1); + + result = CharacterDatabase.Query("SELECT MAX(itemId) from void_storage"); + if (result) + _voidItemId = (*result)[0].GetUInt64()+1; } uint32 ObjectMgr::GenerateAuctionID() @@ -6797,6 +6801,11 @@ uint32 ObjectMgr::GeneratePetNumber() return ++_hiPetNumber; } +uint64 ObjectMgr::GenerateVoidStorageItemId() +{ + return ++_voidItemId; +} + void ObjectMgr::LoadCorpses() { // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index b1ee342a0e7..a13108bd7f3 100755 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -941,6 +941,7 @@ class ObjectMgr uint64 GenerateEquipmentSetGuid(); uint32 GenerateMailID(); uint32 GeneratePetNumber(); + uint64 GenerateVoidStorageItemId(); typedef std::multimap ExclusiveQuestGroups; ExclusiveQuestGroups mExclusiveQuestGroups; @@ -1176,6 +1177,7 @@ class ObjectMgr uint32 _itemTextId; uint32 _mailId; uint32 _hiPetNumber; + uint64 _voidItemId; // first free low guid for selected guid type uint32 _hiCharGuid; diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 01668314c63..d75d25b00e2 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -110,6 +110,10 @@ bool LoginQueryHolder::Initialize() stmt->setUInt32(0, lowGuid); res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADINVENTORY, stmt); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_VOID_STORAGE); + stmt->setUInt32(0, lowGuid); + res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADVOIDSTORAGE, stmt); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_ACTIONS); stmt->setUInt32(0, lowGuid); res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADACTIONS, stmt); diff --git a/src/server/game/Handlers/VoidStorageHandler.cpp b/src/server/game/Handlers/VoidStorageHandler.cpp new file mode 100644 index 00000000000..0a0cc32e535 --- /dev/null +++ b/src/server/game/Handlers/VoidStorageHandler.cpp @@ -0,0 +1,618 @@ +/* + * Copyright (C) 2008-2012 TrinityCore + * + * 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; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; 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, see . + */ + +#include "Common.h" +#include "WorldPacket.h" +#include "WorldSession.h" +#include "World.h" +#include "ObjectAccessor.h" +#include "Log.h" +#include "Opcodes.h" +#include "Player.h" +#include +#include +#include + +void WorldSession::SendVoidStorageTransferResult(VoidTransferError result) +{ + WorldPacket data(SMSG_VOID_TRANSFER_RESULT, 4); + data << uint32(result); + SendPacket(&data); +} + +void WorldSession::HandleVoidStorageUnlock(WorldPacket& recvData) +{ + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_VOID_STORAGE_UNLOCK"); + Player* player = GetPlayer(); + + ObjectGuid npcGuid; + npcGuid[4] = recvData.ReadBit(); + npcGuid[5] = recvData.ReadBit(); + npcGuid[3] = recvData.ReadBit(); + npcGuid[0] = recvData.ReadBit(); + npcGuid[2] = recvData.ReadBit(); + npcGuid[1] = recvData.ReadBit(); + npcGuid[7] = recvData.ReadBit(); + npcGuid[6] = recvData.ReadBit(); + + recvData.ReadByteSeq(npcGuid[7]); + recvData.ReadByteSeq(npcGuid[1]); + recvData.ReadByteSeq(npcGuid[2]); + recvData.ReadByteSeq(npcGuid[3]); + recvData.ReadByteSeq(npcGuid[5]); + recvData.ReadByteSeq(npcGuid[0]); + recvData.ReadByteSeq(npcGuid[6]); + recvData.ReadByteSeq(npcGuid[4]); + + Creature* unit = player->GetNPCIfCanInteractWith(npcGuid, UNIT_NPC_FLAG_VAULTKEEPER); + if (!unit) + { + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleVoidStorageUnlock - Unit (GUID: %u) not found or player can't interact with it.", GUID_LOPART(npcGuid)); + return; + } + + if (player->IsVoidStorageUnlocked()) + { + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleVoidStorageUnlock - Player (GUID: %u, name: %s) tried to unlock void storage a 2nd time.", player->GetGUIDLow(), player->GetName()); + return; + } + + player->ModifyMoney(-int64(VOID_STORAGE_UNLOCK)); + player->UnlockVoidStorage(); +} + +void WorldSession::HandleVoidStorageQuery(WorldPacket& recvData) +{ + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_VOID_STORAGE_QUERY"); + Player* player = GetPlayer(); + + ObjectGuid npcGuid; + npcGuid[4] = recvData.ReadBit(); + npcGuid[0] = recvData.ReadBit(); + npcGuid[5] = recvData.ReadBit(); + npcGuid[7] = recvData.ReadBit(); + npcGuid[6] = recvData.ReadBit(); + npcGuid[3] = recvData.ReadBit(); + npcGuid[1] = recvData.ReadBit(); + npcGuid[2] = recvData.ReadBit(); + + recvData.ReadByteSeq(npcGuid[5]); + recvData.ReadByteSeq(npcGuid[6]); + recvData.ReadByteSeq(npcGuid[3]); + recvData.ReadByteSeq(npcGuid[7]); + recvData.ReadByteSeq(npcGuid[1]); + recvData.ReadByteSeq(npcGuid[0]); + recvData.ReadByteSeq(npcGuid[4]); + recvData.ReadByteSeq(npcGuid[2]); + + Creature* unit = player->GetNPCIfCanInteractWith(npcGuid, UNIT_NPC_FLAG_VAULTKEEPER); + if (!unit) + { + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleVoidStorageQuery - Unit (GUID: %u) not found or player can't interact with it.", GUID_LOPART(npcGuid)); + return; + } + + if (!player->IsVoidStorageUnlocked()) + { + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleVoidStorageQuery - Player (GUID: %u, name: %s) queried void storage without unlocking it.", player->GetGUIDLow(), player->GetName()); + return; + } + + uint8 count = 0; + for (uint8 i = 0; i < VOID_STORAGE_MAX_SLOT; ++i) + if (player->GetVoidStorageItem(i)) + ++count; + + WorldPacket data(SMSG_VOID_STORAGE_CONTENTS, 2 * count + (14 + 4 + 4 + 4 + 4) * count); + + data.WriteBits(count, 8); + + ByteBuffer itemData((14 + 4 + 4 + 4 + 4) * count); + + for (uint8 i = 0; i < VOID_STORAGE_MAX_SLOT; ++i) + { + VoidStorageItem* item = player->GetVoidStorageItem(i); + if (!item) + continue; + + ObjectGuid itemId = item->ItemId; + ObjectGuid creatorGuid = item->CreatorGuid; + + data.WriteBit(creatorGuid[3]); + data.WriteBit(itemId[5]); + data.WriteBit(creatorGuid[6]); + data.WriteBit(creatorGuid[1]); + data.WriteBit(itemId[1]); + data.WriteBit(itemId[3]); + data.WriteBit(itemId[6]); + data.WriteBit(creatorGuid[5]); + data.WriteBit(creatorGuid[2]); + data.WriteBit(itemId[2]); + data.WriteBit(creatorGuid[4]); + data.WriteBit(itemId[0]); + data.WriteBit(itemId[4]); + data.WriteBit(itemId[7]); + data.WriteBit(creatorGuid[0]); + data.WriteBit(creatorGuid[7]); + + itemData.WriteByteSeq(creatorGuid[3]); + + itemData << int32(0); // unk, SuffixFactor? large ints, both positive and negative appear here + + itemData.WriteByteSeq(creatorGuid[4]); + + itemData << uint32(i); + + itemData.WriteByteSeq(itemId[0]); + itemData.WriteByteSeq(itemId[6]); + itemData.WriteByteSeq(creatorGuid[0]); + + itemData << int32(0); // unk, usually 0, not always + + itemData.WriteByteSeq(itemId[4]); + itemData.WriteByteSeq(itemId[5]); + itemData.WriteByteSeq(itemId[2]); + itemData.WriteByteSeq(creatorGuid[2]); + itemData.WriteByteSeq(creatorGuid[6]); + itemData.WriteByteSeq(itemId[1]); + itemData.WriteByteSeq(itemId[3]); + itemData.WriteByteSeq(creatorGuid[5]); + itemData.WriteByteSeq(creatorGuid[7]); + + itemData << uint32(item->ItemEntry); + + itemData.WriteByteSeq(itemId[7]); + } + + data.FlushBits(); + data.append(itemData); + + SendPacket(&data); +} + +void WorldSession::HandleVoidStorageTransfer(WorldPacket& recvData) +{ + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_VOID_STORAGE_TRANSFER"); + Player* player = GetPlayer(); + + // Read everything + + ObjectGuid npcGuid; + npcGuid[1] = recvData.ReadBit(); + + uint32 countDeposit = recvData.ReadBits(26); + + if (countDeposit > 9) + { + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleVoidStorageTransfer - Player (GUID: %u, name: %s) wants to deposit more than 9 items (%u).", player->GetGUIDLow(), player->GetName(), countDeposit); + return; + } + + std::vector itemGuids(countDeposit); + for (uint32 i = 0; i < countDeposit; ++i) + { + itemGuids[i][4] = recvData.ReadBit(); + itemGuids[i][6] = recvData.ReadBit(); + itemGuids[i][7] = recvData.ReadBit(); + itemGuids[i][0] = recvData.ReadBit(); + itemGuids[i][1] = recvData.ReadBit(); + itemGuids[i][5] = recvData.ReadBit(); + itemGuids[i][3] = recvData.ReadBit(); + itemGuids[i][2] = recvData.ReadBit(); + } + + npcGuid[2] = recvData.ReadBit(); + npcGuid[0] = recvData.ReadBit(); + npcGuid[3] = recvData.ReadBit(); + npcGuid[5] = recvData.ReadBit(); + npcGuid[6] = recvData.ReadBit(); + npcGuid[4] = recvData.ReadBit(); + + uint32 countWithdraw = recvData.ReadBits(26); + + if (countWithdraw > 9) + { + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleVoidStorageTransfer - Player (GUID: %u, name: %s) wants to withdraw more than 9 items (%u).", player->GetGUIDLow(), player->GetName(), countWithdraw); + return; + } + + std::vector itemIds(countWithdraw); + for (uint32 i = 0; i < countWithdraw; ++i) + { + itemIds[i][4] = recvData.ReadBit(); + itemIds[i][7] = recvData.ReadBit(); + itemIds[i][1] = recvData.ReadBit(); + itemIds[i][0] = recvData.ReadBit(); + itemIds[i][2] = recvData.ReadBit(); + itemIds[i][3] = recvData.ReadBit(); + itemIds[i][5] = recvData.ReadBit(); + itemIds[i][6] = recvData.ReadBit(); + } + + npcGuid[7] = recvData.ReadBit(); + + recvData.FlushBits(); + + for (uint32 i = 0; i < countDeposit; ++i) + { + recvData.ReadByteSeq(itemGuids[i][6]); + recvData.ReadByteSeq(itemGuids[i][1]); + recvData.ReadByteSeq(itemGuids[i][0]); + recvData.ReadByteSeq(itemGuids[i][2]); + recvData.ReadByteSeq(itemGuids[i][4]); + recvData.ReadByteSeq(itemGuids[i][5]); + recvData.ReadByteSeq(itemGuids[i][3]); + recvData.ReadByteSeq(itemGuids[i][7]); + } + + recvData.ReadByteSeq(npcGuid[5]); + recvData.ReadByteSeq(npcGuid[6]); + + for (uint32 i = 0; i < countWithdraw; ++i) + { + recvData.ReadByteSeq(itemIds[i][3]); + recvData.ReadByteSeq(itemIds[i][1]); + recvData.ReadByteSeq(itemIds[i][0]); + recvData.ReadByteSeq(itemIds[i][6]); + recvData.ReadByteSeq(itemIds[i][2]); + recvData.ReadByteSeq(itemIds[i][7]); + recvData.ReadByteSeq(itemIds[i][5]); + recvData.ReadByteSeq(itemIds[i][4]); + } + + recvData.ReadByteSeq(npcGuid[1]); + recvData.ReadByteSeq(npcGuid[4]); + recvData.ReadByteSeq(npcGuid[7]); + recvData.ReadByteSeq(npcGuid[3]); + recvData.ReadByteSeq(npcGuid[2]); + recvData.ReadByteSeq(npcGuid[0]); + + Creature* unit = player->GetNPCIfCanInteractWith(npcGuid, UNIT_NPC_FLAG_VAULTKEEPER); + if (!unit) + { + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleVoidStorageTransfer - Unit (GUID: %u) not found or player can't interact with it.", GUID_LOPART(npcGuid)); + return; + } + + if (!player->IsVoidStorageUnlocked()) + { + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleVoidStorageTransfer - Player (GUID: %u, name: %s) queried void storage without unlocking it.", player->GetGUIDLow(), player->GetName()); + return; + } + + if (itemGuids.size() > player->GetNumOfVoidStorageFreeSlots()) + { + SendVoidStorageTransferResult(VOID_TRANSFER_ERROR_FULL); + return; + } + + uint32 freeBagSlots = 0; + if (itemIds.size() != 0) + { + // make this a Player function + for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) + if (Bag* bag = player->GetBagByPos(i)) + freeBagSlots += bag->GetFreeSlots(); + for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++) + if (!player->GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + ++freeBagSlots; + } + + if (itemIds.size() > freeBagSlots) + { + SendVoidStorageTransferResult(VOID_TRANSFER_ERROR_INVENTORY_FULL); + return; + } + + if (!player->HasEnoughMoney(uint64(itemGuids.size() * VOID_STORAGE_STORE_ITEM))) + { + SendVoidStorageTransferResult(VOID_TRANSFER_ERROR_NOT_ENOUGH_MONEY); + return; + } + + std::pair depositItems[VOID_STORAGE_MAX_DEPOSIT]; + uint8 depositCount = 0; + for (std::vector::iterator itr = itemGuids.begin(); itr != itemGuids.end(); ++itr) + { + Item* item = player->GetItemByGuid(*itr); + if (!item) + { + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleVoidStorageTransfer - Player (GUID: %u, name: %s) wants to deposit an invalid item (item guid: %u).", player->GetGUIDLow(), player->GetName(), *itr); + continue; + } + + VoidStorageItem itemVS(sObjectMgr->GenerateVoidStorageItemId(), item->GetEntry(), item->GetUInt64Value(ITEM_FIELD_CREATOR)); + + uint8 slot = player->AddVoidStorageItem(itemVS); + + depositItems[depositCount++] = std::make_pair(itemVS, slot); + + player->DestroyItem(item->GetBagSlot(), item->GetSlot(), true); + } + + int64 cost = depositCount * VOID_STORAGE_STORE_ITEM; + + player->ModifyMoney(-cost); + + VoidStorageItem withdrawItems[VOID_STORAGE_MAX_WITHDRAW]; + uint8 withdrawCount = 0; + for (std::vector::iterator itr = itemIds.begin(); itr != itemIds.end(); ++itr) + { + uint8 slot; + VoidStorageItem* itemVS = player->GetVoidStorageItem(*itr, slot); + if (!itemVS) + { + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleVoidStorageTransfer - Player (GUID: %u, name: %s) tried to withdraw an invalid item (id: %u)", player->GetGUIDLow(), player->GetName(), *itr); + continue; + } + + ItemPosCountVec dest; + InventoryResult msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemVS->ItemEntry, 1); + if (msg != EQUIP_ERR_OK) + { + SendVoidStorageTransferResult(VOID_TRANSFER_ERROR_INVENTORY_FULL); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleVoidStorageTransfer - Player (GUID: %u, name: %s) couldn't withdraw item id %u because inventory was full.", player->GetGUIDLow(), player->GetName(), *itr); + return; + } + + Item* item = player->StoreNewItem(dest, itemVS->ItemEntry, true); + item->SetUInt64Value(ITEM_FIELD_CREATOR, uint64(itemVS->CreatorGuid)); + player->SendNewItem(item, 1, true, false, false); + + withdrawItems[withdrawCount++] = *itemVS; + + player->DeleteVoidStorageItem(slot); + } + + WorldPacket data(SMSG_VOID_STORAGE_TRANSFER_CHANGES, ((5 + 5 + (7 + 7) * depositCount + + 7 * withdrawCount) / 8) + 7 * withdrawCount + (7 + 7 + 4 * 4) * depositCount); + + data.WriteBits(depositCount, 5); + data.WriteBits(withdrawCount, 5); + + for (uint8 i = 0; i < depositCount; ++i) + { + ObjectGuid itemId = depositItems[i].first.ItemId; + ObjectGuid creatorGuid = depositItems[i].first.CreatorGuid; + data.WriteBit(creatorGuid[7]); + data.WriteBit(itemId[7]); + data.WriteBit(itemId[4]); + data.WriteBit(creatorGuid[6]); + data.WriteBit(creatorGuid[5]); + data.WriteBit(itemId[3]); + data.WriteBit(itemId[5]); + data.WriteBit(creatorGuid[4]); + data.WriteBit(creatorGuid[2]); + data.WriteBit(creatorGuid[0]); + data.WriteBit(creatorGuid[3]); + data.WriteBit(creatorGuid[1]); + data.WriteBit(itemId[2]); + data.WriteBit(itemId[0]); + data.WriteBit(itemId[1]); + data.WriteBit(itemId[6]); + } + + for (uint8 i = 0; i < withdrawCount; ++i) + { + ObjectGuid itemId = withdrawItems[i].ItemId; + data.WriteBit(itemId[1]); + data.WriteBit(itemId[7]); + data.WriteBit(itemId[3]); + data.WriteBit(itemId[5]); + data.WriteBit(itemId[6]); + data.WriteBit(itemId[2]); + data.WriteBit(itemId[4]); + data.WriteBit(itemId[0]); + } + + data.FlushBits(); + + for (uint8 i = 0; i < withdrawCount; ++i) + { + ObjectGuid itemId = withdrawItems[i].ItemId; + data.WriteByteSeq(itemId[3]); + data.WriteByteSeq(itemId[1]); + data.WriteByteSeq(itemId[0]); + data.WriteByteSeq(itemId[2]); + data.WriteByteSeq(itemId[7]); + data.WriteByteSeq(itemId[5]); + data.WriteByteSeq(itemId[6]); + data.WriteByteSeq(itemId[4]); + } + + for (uint8 i = 0; i < depositCount; ++i) + { + ObjectGuid itemId = depositItems[i].first.ItemId; + ObjectGuid creatorGuid = depositItems[i].first.CreatorGuid; + + data << int32(0); // unk + + data.WriteByteSeq(itemId[6]); + data.WriteByteSeq(itemId[4]); + data.WriteByteSeq(creatorGuid[4]); + data.WriteByteSeq(itemId[2]); + data.WriteByteSeq(creatorGuid[1]); + data.WriteByteSeq(creatorGuid[3]); + data.WriteByteSeq(itemId[3]); + data.WriteByteSeq(creatorGuid[0]); + data.WriteByteSeq(itemId[0]); + data.WriteByteSeq(creatorGuid[6]); + data.WriteByteSeq(itemId[5]); + data.WriteByteSeq(creatorGuid[5]); + data.WriteByteSeq(creatorGuid[7]); + + data << uint32(depositItems[i].first.ItemEntry); + + data.WriteByteSeq(itemId[1]); + + data << uint32(depositItems[i].second); // slot + + data.WriteByteSeq(creatorGuid[2]); + data.WriteByteSeq(itemId[7]); + + data << int32(0); // unk + } + + SendPacket(&data); + + SendVoidStorageTransferResult(VOID_TRANSFER_ERROR_NO_ERROR); +} + +void WorldSession::HandleVoidSwapItem(WorldPacket& recvData) +{ + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_VOID_SWAP_ITEM"); + + Player* player = GetPlayer(); + uint32 newSlot; + ObjectGuid npcGuid; + ObjectGuid itemId; + + recvData >> uint32(newSlot); + + npcGuid[2] = recvData.ReadBit(); + npcGuid[4] = recvData.ReadBit(); + npcGuid[0] = recvData.ReadBit(); + itemId[2] = recvData.ReadBit(); + itemId[6] = recvData.ReadBit(); + itemId[5] = recvData.ReadBit(); + npcGuid[1] = recvData.ReadBit(); + npcGuid[7] = recvData.ReadBit(); + itemId[3] = recvData.ReadBit(); + itemId[7] = recvData.ReadBit(); + itemId[0] = recvData.ReadBit(); + npcGuid[6] = recvData.ReadBit(); + npcGuid[5] = recvData.ReadBit(); + npcGuid[3] = recvData.ReadBit(); + itemId[1] = recvData.ReadBit(); + itemId[4] = recvData.ReadBit(); + + recvData.ReadByteSeq(npcGuid[1]); + recvData.ReadByteSeq(itemId[3]); + recvData.ReadByteSeq(itemId[2]); + recvData.ReadByteSeq(itemId[4]); + recvData.ReadByteSeq(npcGuid[3]); + recvData.ReadByteSeq(npcGuid[0]); + recvData.ReadByteSeq(itemId[6]); + recvData.ReadByteSeq(itemId[1]); + recvData.ReadByteSeq(npcGuid[5]); + recvData.ReadByteSeq(itemId[5]); + recvData.ReadByteSeq(npcGuid[6]); + recvData.ReadByteSeq(itemId[0]); + recvData.ReadByteSeq(npcGuid[2]); + recvData.ReadByteSeq(npcGuid[7]); + recvData.ReadByteSeq(npcGuid[4]); + recvData.ReadByteSeq(itemId[7]); + + Creature* unit = player->GetNPCIfCanInteractWith(npcGuid, UNIT_NPC_FLAG_VAULTKEEPER); + if (!unit) + { + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleVoidSwapItem - Unit (GUID: %u) not found or player can't interact with it.", GUID_LOPART(npcGuid)); + return; + } + + if (!player->IsVoidStorageUnlocked()) + { + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleVoidSwapItem - Player (GUID: %u, name: %s) queried void storage without unlocking it.", player->GetGUIDLow(), player->GetName()); + return; + } + + uint8 oldSlot; + if (!player->GetVoidStorageItem(itemId, oldSlot)) + { + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleVoidSwapItem - Player (GUID: %u, name: %s) requested swapping an invalid item (slot: %u, itemid: %u).", player->GetGUIDLow(), player->GetName(), newSlot, itemId); + return; + } + + bool usedSrcSlot = player->GetVoidStorageItem(oldSlot) != NULL; // should be always true + bool usedDestSlot = player->GetVoidStorageItem(newSlot) != NULL; + ObjectGuid itemIdDest; + if (usedDestSlot) + itemIdDest = player->GetVoidStorageItem(newSlot)->ItemId; + + if (!player->SwapVoidStorageItem(oldSlot, newSlot)) + { + SendVoidStorageTransferResult(VOID_TRANSFER_ERROR_INTERNAL_ERROR_1); + return; + } + + WorldPacket data(SMSG_VOID_ITEM_SWAP_RESPONSE, 1 + (usedSrcSlot + usedDestSlot) * (1 + 7 + 4)); + + data.WriteBit(!usedDestSlot); + data.WriteBit(!usedSrcSlot); + + if (usedSrcSlot) + { + data.WriteBit(itemId[5]); + data.WriteBit(itemId[2]); + data.WriteBit(itemId[1]); + data.WriteBit(itemId[4]); + data.WriteBit(itemId[0]); + data.WriteBit(itemId[6]); + data.WriteBit(itemId[7]); + data.WriteBit(itemId[3]); + } + + data.WriteBit(!usedDestSlot); // unk + + if (usedDestSlot) + { + data.WriteBit(itemIdDest[7]); + data.WriteBit(itemIdDest[3]); + data.WriteBit(itemIdDest[4]); + data.WriteBit(itemIdDest[0]); + data.WriteBit(itemIdDest[5]); + data.WriteBit(itemIdDest[1]); + data.WriteBit(itemIdDest[2]); + data.WriteBit(itemIdDest[6]); + } + + data.WriteBit(!usedSrcSlot); // unk + + data.FlushBits(); + + if (usedDestSlot) + { + data.WriteByteSeq(itemIdDest[4]); + data.WriteByteSeq(itemIdDest[6]); + data.WriteByteSeq(itemIdDest[5]); + data.WriteByteSeq(itemIdDest[2]); + data.WriteByteSeq(itemIdDest[3]); + data.WriteByteSeq(itemIdDest[1]); + data.WriteByteSeq(itemIdDest[7]); + data.WriteByteSeq(itemIdDest[0]); + } + + if (usedSrcSlot) + { + data.WriteByteSeq(itemId[6]); + data.WriteByteSeq(itemId[3]); + data.WriteByteSeq(itemId[5]); + data.WriteByteSeq(itemId[0]); + data.WriteByteSeq(itemId[1]); + data.WriteByteSeq(itemId[2]); + data.WriteByteSeq(itemId[4]); + data.WriteByteSeq(itemId[7]); + } + + if (usedSrcSlot) + data << uint32(newSlot); + + if (usedDestSlot) + data << uint32(oldSlot); + + SendPacket(&data); +} diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 0b3dc884a1a..e17bbc0729f 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -3667,4 +3667,24 @@ enum CalendarError // Calendar - end +#define VOID_STORAGE_UNLOCK 100*GOLD +#define VOID_STORAGE_STORE_ITEM 25*GOLD +#define VOID_STORAGE_MAX_DEPOSIT 9 +#define VOID_STORAGE_MAX_WITHDRAW 9 +#define VOID_STORAGE_MAX_SLOT 80 + +enum VoidTransferError +{ + VOID_TRANSFER_ERROR_NO_ERROR = 0, + VOID_TRANSFER_ERROR_INTERNAL_ERROR_1 = 1, + VOID_TRANSFER_ERROR_INTERNAL_ERROR_2 = 2, + VOID_TRANSFER_ERROR_FULL = 3, + VOID_TRANSFER_ERROR_INTERNAL_ERROR_3 = 4, + VOID_TRANSFER_ERROR_INTERNAL_ERROR_4 = 5, + VOID_TRANSFER_ERROR_NOT_ENOUGH_MONEY = 6, + VOID_TRANSFER_ERROR_INVENTORY_FULL = 7, + VOID_TRANSFER_ERROR_INTERNAL_ERROR_5 = 8, + VOID_TRANSFER_ERROR_TRANSFER_UNKNOWN = 9, +}; + #endif diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 301ebb12221..9fe345b9c5f 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -82,12 +82,12 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_AUTH_SRP6_RECODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_AUTOBANK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoBankItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_AUTOEQUIP_GROUND_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_AUTOEQUIP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoEquipItemOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_AUTOEQUIP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoEquipItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_AUTOEQUIP_ITEM_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoEquipItemSlotOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_BAG_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoStoreBagItemOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_BANK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoStoreBankItemOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_BANK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoStoreBankItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_GROUND_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_LOOT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutostoreLootItemOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_LOOT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutostoreLootItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_BANKER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBankerActivateOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_JOIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlefieldListOpcode ); @@ -631,7 +631,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_STORE_LOOT_IN_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SUMMON_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSummonResponseOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SUSPEND_COMMS_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SWAP_INV_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSwapInvItemOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_SWAP_INV_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSwapInvItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SWAP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSwapItem ); //DEFINE_OPCODE_HANDLER(CMSG_SYNC_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_TARGET_CAST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -655,7 +655,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_TRIGGER_CINEMATIC_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_TURN_IN_PETITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTurnInPetitionOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_CLEAR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialClear ); - //DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_FLAG, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialFlag ); + DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_FLAG, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialFlag ); //DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_RESET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialReset ); DEFINE_OPCODE_HANDLER(CMSG_UNACCEPT_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnacceptTradeOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_UNCLAIM_LICENSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -676,6 +676,10 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_VIOLENCE_LEVEL, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleViolenceLevel ); DEFINE_OPCODE_HANDLER(CMSG_VOICE_SESSION_ENABLE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleVoiceSessionEnableOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_VOICE_SET_TALKER_MUTED_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_VOID_STORAGE_UNLOCK, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleVoidStorageUnlock ); + DEFINE_OPCODE_HANDLER(CMSG_VOID_STORAGE_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleVoidStorageQuery ); + DEFINE_OPCODE_HANDLER(CMSG_VOID_STORAGE_TRANSFER, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleVoidStorageTransfer ); + DEFINE_OPCODE_HANDLER(CMSG_VOID_SWAP_ITEM, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleVoidSwapItem ); //DEFINE_OPCODE_HANDLER(CMSG_WARDEN_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleWardenDataOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_WEATHER_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_WHO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWhoOpcode ); @@ -1042,7 +1046,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_ITEM_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ITEM_ENCHANT_TIME_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ITEM_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ITEM_PUSH_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ITEM_PUSH_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ITEM_REFUND_INFO_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ITEM_REFUND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ITEM_TEXT_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1380,6 +1384,11 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_LEAVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_ROSTER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SET_TALKER_MUTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_VOID_ITEM_SWAP_RESPONSE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_VOID_STORAGE_CONTENTS, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_VOID_STORAGE_TRANSFER_CHANGES, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_VOID_TRANSFER_RESULT, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_VOID_STORAGE_FAILED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_WARDEN_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_WEATHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_WHO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index c1fb3f940be..d286e33fcbb 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -440,7 +440,6 @@ enum Opcodes CMSG_QUERY_INSPECT_ACHIEVEMENTS = 0x4D27, CMSG_QUERY_QUESTS_COMPLETED = 0x2317, CMSG_QUERY_TIME = 0x0A36, - CMSG_QUERY_VOID_STORAGE = 0x790A, CMSG_QUESTGIVER_ACCEPT_QUEST = 0x6B37, CMSG_QUESTGIVER_CANCEL = 0x0000, CMSG_QUESTGIVER_CHOOSE_REWARD = 0x2125, @@ -552,7 +551,6 @@ enum Opcodes CMSG_SUSPEND_TOKEN = 0x046D, CMSG_SWAP_INV_ITEM = 0x2614, CMSG_SWAP_ITEM = 0x6326, - CMSG_SWAP_VOID_ITEM = 0x3204, CMSG_SYNC_DANCE = 0x0036, CMSG_TAXICLEARALLNODES = 0x0000, CMSG_TAXIENABLEALLNODES = 0x0000, @@ -577,7 +575,6 @@ enum Opcodes CMSG_UNACCEPT_TRADE = 0x391A, CMSG_UNLEARN_SKILL = 0x6106, CMSG_UNLEARN_SPECIALIZATION = 0x3210, - CMSG_UNLOCK_VOID_STORAGE = 0x7B14, CMSG_UNREGISTER_ALL_ADDON_PREFIXES = 0x3D54, CMSG_UPDATE_ACCOUNT_DATA = 0x4736, CMSG_UPDATE_MISSILE_TRAJECTORY = 0x781E, @@ -586,7 +583,10 @@ enum Opcodes CMSG_USE_ITEM = 0x2C06, CMSG_VIOLENCE_LEVEL = 0x7816, CMSG_VOICE_SESSION_ENABLE = 0x2314, + CMSG_VOID_STORAGE_QUERY = 0x790A, CMSG_VOID_STORAGE_TRANSFER = 0x380E, + CMSG_VOID_STORAGE_UNLOCK = 0x7B14, + CMSG_VOID_SWAP_ITEM = 0x3204, CMSG_WARDEN_DATA = 0x25A2, CMSG_WARGAME_ACCEPT = 0x2410, CMSG_WARGAME_START = 0x05A0, diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 80c532e7430..c215063fefa 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -911,6 +911,13 @@ class WorldSession void SendCalendarRaidLockoutUpdated(InstanceSave const* save); void SendCalendarCommandResult(CalendarError err, char const* param = NULL); + // Void Storage + void HandleVoidStorageUnlock(WorldPacket& recvData); + void HandleVoidStorageQuery(WorldPacket& recvData); + void HandleVoidStorageTransfer(WorldPacket& recvData); + void HandleVoidSwapItem(WorldPacket& recvData); + void SendVoidStorageTransferResult(VoidTransferError result); + void HandleSpellClick(WorldPacket& recv_data); void HandleMirrorImageDataRequest(WorldPacket& recv_data); void HandleAlterAppearance(WorldPacket& recv_data); diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index 75fbdbf78f8..d1544d43232 100755 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -555,4 +555,8 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_INS_CHAR_TALENT, "INSERT INTO character_talent (guid, spell, spec) VALUES (?, ?, ?)", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_DEL_CHAR_ACTION_EXCEPT_SPEC, "DELETE FROM character_action WHERE spec<>? AND guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_SEL_CHAR_PET_BY_ENTRY_AND_SLOT, "SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, abdata, savetime, CreatedBySpell, PetType FROM character_pet WHERE owner = ? AND slot = ?", CONNECTION_SYNCH); + + PREPARE_STATEMENT(CHAR_SEL_VOID_STORAGE, "SELECT itemid, itemEntry, slot, creatorGuid FROM void_storage WHERE playerGuid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_REP_VOID_STORAGE_ITEM, "REPLACE INTO void_Storage (itemId, playerGuid, itemEntry, slot, creatorGuid) VALUES (?, ?, ?, ?, ?)", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_DEL_VOID_STORAGE_ITEM_BY_SLOT, "DELETE FROM void_Storage WHERE slot = ? AND playerGuid = ?", CONNECTION_ASYNC); } diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.h b/src/server/shared/Database/Implementation/CharacterDatabase.h index c0ab078dfe3..5dac60d6ba8 100755 --- a/src/server/shared/Database/Implementation/CharacterDatabase.h +++ b/src/server/shared/Database/Implementation/CharacterDatabase.h @@ -519,6 +519,10 @@ enum CharacterDatabaseStatements CHAR_DEL_CHAR_ACTION_EXCEPT_SPEC, CHAR_SEL_CHAR_PET_BY_ENTRY_AND_SLOT, + CHAR_SEL_VOID_STORAGE, + CHAR_REP_VOID_STORAGE_ITEM, + CHAR_DEL_VOID_STORAGE_ITEM_BY_SLOT, + MAX_CHARACTERDATABASE_STATEMENTS, }; -- cgit v1.2.3 From 3df10d8273dda4a2cf98f5b300f6c4132730dd7f Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 30 Jul 2012 16:41:48 +0100 Subject: Core/DBLayer: Fix a typo in void_storage table name --- src/server/game/Entities/Player/Player.cpp | 2 +- src/server/shared/Database/Implementation/CharacterDatabase.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 6cdea51bfb3..509585fb5f1 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -19213,7 +19213,7 @@ void Player::_SaveVoidStorage(SQLTransaction& trans) { if (!_voidStorageItems[i]) // unused item { - // DELETE FROM void_Storage WHERE slot = ? AND playerGuid = ? + // DELETE FROM void_storage WHERE slot = ? AND playerGuid = ? stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_VOID_STORAGE_ITEM_BY_SLOT); stmt->setUInt8(0, i); stmt->setUInt32(1, lowGuid); diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index d1544d43232..dc5548ccfb7 100755 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -557,6 +557,6 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_SEL_CHAR_PET_BY_ENTRY_AND_SLOT, "SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, abdata, savetime, CreatedBySpell, PetType FROM character_pet WHERE owner = ? AND slot = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_SEL_VOID_STORAGE, "SELECT itemid, itemEntry, slot, creatorGuid FROM void_storage WHERE playerGuid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_REP_VOID_STORAGE_ITEM, "REPLACE INTO void_Storage (itemId, playerGuid, itemEntry, slot, creatorGuid) VALUES (?, ?, ?, ?, ?)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_VOID_STORAGE_ITEM_BY_SLOT, "DELETE FROM void_Storage WHERE slot = ? AND playerGuid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_REP_VOID_STORAGE_ITEM, "REPLACE INTO void_storage (itemId, playerGuid, itemEntry, slot, creatorGuid) VALUES (?, ?, ?, ?, ?)", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_DEL_VOID_STORAGE_ITEM_BY_SLOT, "DELETE FROM void_storage WHERE slot = ? AND playerGuid = ?", CONNECTION_ASYNC); } -- cgit v1.2.3 From 940f655a3c61c80e9823855df1fbc4630a698926 Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 30 Jul 2012 18:34:39 +0100 Subject: Core/VS: Allow to store/retrive random stats items in void storage Also set items to soulbound on withdraw --- sql/base/characters_database.sql | 4 +++- .../characters/2012_07_30_01_world_void_storage_434.sql | 2 ++ src/server/game/Entities/Player/Player.cpp | 12 +++++++++--- src/server/game/Entities/Player/Player.h | 8 +++++++- src/server/game/Handlers/VoidStorageHandler.cpp | 15 ++++++++------- .../shared/Database/Implementation/CharacterDatabase.cpp | 4 ++-- 6 files changed, 31 insertions(+), 14 deletions(-) create mode 100644 sql/updates/characters/2012_07_30_01_world_void_storage_434.sql (limited to 'src') diff --git a/sql/base/characters_database.sql b/sql/base/characters_database.sql index f42c8f2e6ad..fdddd8c982b 100644 --- a/sql/base/characters_database.sql +++ b/sql/base/characters_database.sql @@ -2278,6 +2278,8 @@ CREATE TABLE `void_storage` ( `itemEntry` mediumint(8) unsigned NOT NULL, `slot` tinyint(3) unsigned NOT NULL, `creatorGuid` int(10) unsigned NOT NULL DEFAULT '0', + `randomProperty` int(10) unsigned NOT NULL DEFAULT '0', + `suffixFactor` int(10) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`itemId`), UNIQUE KEY `idx_player_slot` (`playerGuid`,`slot`), KEY `idx_player` (`playerGuid`) @@ -2350,4 +2352,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2012-07-30 16:34:12 +-- Dump completed on 2012-07-30 17:01:47 diff --git a/sql/updates/characters/2012_07_30_01_world_void_storage_434.sql b/sql/updates/characters/2012_07_30_01_world_void_storage_434.sql new file mode 100644 index 00000000000..cd2cb0f0b9e --- /dev/null +++ b/sql/updates/characters/2012_07_30_01_world_void_storage_434.sql @@ -0,0 +1,2 @@ +ALTER TABLE `void_storage` ADD `randomProperty` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `void_storage` ADD `suffixFactor` int(10) unsigned NOT NULL DEFAULT '0'; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 509585fb5f1..19c61b7013d 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -17676,6 +17676,8 @@ void Player::_LoadVoidStorage(PreparedQueryResult result) uint32 itemEntry = fields[1].GetUInt32(); uint8 slot = fields[2].GetUInt8(); uint32 creatorGuid = fields[3].GetUInt32(); + uint32 randomProperty = fields[4].GetUInt32(); + uint32 suffixFactor = fields[5].GetUInt32(); if (!itemId) { @@ -17701,7 +17703,7 @@ void Player::_LoadVoidStorage(PreparedQueryResult result) creatorGuid = 0; } - _voidStorageItems[slot] = new VoidStorageItem(itemId, itemEntry, creatorGuid); + _voidStorageItems[slot] = new VoidStorageItem(itemId, itemEntry, creatorGuid, randomProperty, suffixFactor); } while (result->NextRow()); } @@ -19227,6 +19229,8 @@ void Player::_SaveVoidStorage(SQLTransaction& trans) stmt->setUInt32(2, _voidStorageItems[i]->ItemEntry); stmt->setUInt8(3, i); stmt->setUInt32(4, _voidStorageItems[i]->CreatorGuid); + stmt->setUInt32(5, _voidStorageItems[i]->ItemRandomPropertyId); + stmt->setUInt32(6, _voidStorageItems[i]->ItemSuffixFactor); } trans->Append(stmt); @@ -25714,7 +25718,8 @@ uint8 Player::AddVoidStorageItem(const VoidStorageItem& item) return -1; } - _voidStorageItems[slot] = new VoidStorageItem(item.ItemId, item.ItemEntry, item.CreatorGuid); + _voidStorageItems[slot] = new VoidStorageItem(item.ItemId, item.ItemEntry, + item.CreatorGuid, item.ItemRandomPropertyId, item.ItemSuffixFactor); return slot; } @@ -25733,7 +25738,8 @@ void Player::AddVoidStorageItemAtSlot(uint8 slot, const VoidStorageItem& item) return; } - _voidStorageItems[slot] = new VoidStorageItem(item.ItemId, item.ItemId, item.CreatorGuid); + _voidStorageItems[slot] = new VoidStorageItem(item.ItemId, item.ItemId, + item.CreatorGuid, item.ItemRandomPropertyId, item.ItemSuffixFactor); } void Player::DeleteVoidStorageItem(uint8 slot) diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 6b8686a7c0e..d29d03e9df7 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -987,18 +987,24 @@ struct VoidStorageItem ItemId = 0; ItemEntry = 0; CreatorGuid = 0; + ItemRandomPropertyId = 0; + ItemSuffixFactor = 0; } - VoidStorageItem(uint64 id, uint32 entry, uint32 creator) + VoidStorageItem(uint64 id, uint32 entry, uint32 creator, uint32 randomPropertyId, uint32 suffixFactor) { ItemId = id; ItemEntry = entry; CreatorGuid = creator; + ItemRandomPropertyId = randomPropertyId; + ItemSuffixFactor = suffixFactor; } uint64 ItemId; uint32 ItemEntry; uint32 CreatorGuid; + uint32 ItemRandomPropertyId; + uint32 ItemSuffixFactor; }; class TradeData diff --git a/src/server/game/Handlers/VoidStorageHandler.cpp b/src/server/game/Handlers/VoidStorageHandler.cpp index 0a0cc32e535..cc89bddb289 100644 --- a/src/server/game/Handlers/VoidStorageHandler.cpp +++ b/src/server/game/Handlers/VoidStorageHandler.cpp @@ -151,7 +151,7 @@ void WorldSession::HandleVoidStorageQuery(WorldPacket& recvData) itemData.WriteByteSeq(creatorGuid[3]); - itemData << int32(0); // unk, SuffixFactor? large ints, both positive and negative appear here + itemData << uint32(item->ItemSuffixFactor); itemData.WriteByteSeq(creatorGuid[4]); @@ -161,7 +161,7 @@ void WorldSession::HandleVoidStorageQuery(WorldPacket& recvData) itemData.WriteByteSeq(itemId[6]); itemData.WriteByteSeq(creatorGuid[0]); - itemData << int32(0); // unk, usually 0, not always + itemData << uint32(item->ItemRandomPropertyId); itemData.WriteByteSeq(itemId[4]); itemData.WriteByteSeq(itemId[5]); @@ -335,7 +335,7 @@ void WorldSession::HandleVoidStorageTransfer(WorldPacket& recvData) continue; } - VoidStorageItem itemVS(sObjectMgr->GenerateVoidStorageItemId(), item->GetEntry(), item->GetUInt64Value(ITEM_FIELD_CREATOR)); + VoidStorageItem itemVS(sObjectMgr->GenerateVoidStorageItemId(), item->GetEntry(), item->GetUInt64Value(ITEM_FIELD_CREATOR), item->GetItemRandomPropertyId(), item->GetItemSuffixFactor()); uint8 slot = player->AddVoidStorageItem(itemVS); @@ -369,9 +369,10 @@ void WorldSession::HandleVoidStorageTransfer(WorldPacket& recvData) return; } - Item* item = player->StoreNewItem(dest, itemVS->ItemEntry, true); + Item* item = player->StoreNewItem(dest, itemVS->ItemEntry, true, itemVS->ItemRandomPropertyId); item->SetUInt64Value(ITEM_FIELD_CREATOR, uint64(itemVS->CreatorGuid)); - player->SendNewItem(item, 1, true, false, false); + item->SetBinding(true); + player->SendNewItem(item, 1, false, false, false); withdrawItems[withdrawCount++] = *itemVS; @@ -439,7 +440,7 @@ void WorldSession::HandleVoidStorageTransfer(WorldPacket& recvData) ObjectGuid itemId = depositItems[i].first.ItemId; ObjectGuid creatorGuid = depositItems[i].first.CreatorGuid; - data << int32(0); // unk + data << uint32(depositItems[i].first.ItemSuffixFactor); data.WriteByteSeq(itemId[6]); data.WriteByteSeq(itemId[4]); @@ -464,7 +465,7 @@ void WorldSession::HandleVoidStorageTransfer(WorldPacket& recvData) data.WriteByteSeq(creatorGuid[2]); data.WriteByteSeq(itemId[7]); - data << int32(0); // unk + data << uint32(depositItems[i].first.ItemRandomPropertyId); } SendPacket(&data); diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index dc5548ccfb7..1d6d9be4a33 100755 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -556,7 +556,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_DEL_CHAR_ACTION_EXCEPT_SPEC, "DELETE FROM character_action WHERE spec<>? AND guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_SEL_CHAR_PET_BY_ENTRY_AND_SLOT, "SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, abdata, savetime, CreatedBySpell, PetType FROM character_pet WHERE owner = ? AND slot = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_SEL_VOID_STORAGE, "SELECT itemid, itemEntry, slot, creatorGuid FROM void_storage WHERE playerGuid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_REP_VOID_STORAGE_ITEM, "REPLACE INTO void_storage (itemId, playerGuid, itemEntry, slot, creatorGuid) VALUES (?, ?, ?, ?, ?)", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_SEL_VOID_STORAGE, "SELECT itemId, itemEntry, slot, creatorGuid, randomProperty, suffixFactor FROM void_storage WHERE playerGuid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_REP_VOID_STORAGE_ITEM, "REPLACE INTO void_storage (itemId, playerGuid, itemEntry, slot, creatorGuid, randomProperty, suffixFactor) VALUES (?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_VOID_STORAGE_ITEM_BY_SLOT, "DELETE FROM void_storage WHERE slot = ? AND playerGuid = ?", CONNECTION_ASYNC); } -- cgit v1.2.3 From ce1391840f6d8f92b65ed15094f4dab77137347e Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 30 Jul 2012 21:51:21 +0100 Subject: Core/VS: Finally fix item swapping, correct a file name --- .../characters/2012_07_30_01_characters_void_storage_434.sql | 2 ++ sql/updates/characters/2012_07_30_01_world_void_storage_434.sql | 2 -- src/server/game/Entities/Player/Player.cpp | 4 ---- src/server/game/Handlers/VoidStorageHandler.cpp | 6 +++--- 4 files changed, 5 insertions(+), 9 deletions(-) create mode 100644 sql/updates/characters/2012_07_30_01_characters_void_storage_434.sql delete mode 100644 sql/updates/characters/2012_07_30_01_world_void_storage_434.sql (limited to 'src') diff --git a/sql/updates/characters/2012_07_30_01_characters_void_storage_434.sql b/sql/updates/characters/2012_07_30_01_characters_void_storage_434.sql new file mode 100644 index 00000000000..cd2cb0f0b9e --- /dev/null +++ b/sql/updates/characters/2012_07_30_01_characters_void_storage_434.sql @@ -0,0 +1,2 @@ +ALTER TABLE `void_storage` ADD `randomProperty` int(10) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `void_storage` ADD `suffixFactor` int(10) unsigned NOT NULL DEFAULT '0'; diff --git a/sql/updates/characters/2012_07_30_01_world_void_storage_434.sql b/sql/updates/characters/2012_07_30_01_world_void_storage_434.sql deleted file mode 100644 index cd2cb0f0b9e..00000000000 --- a/sql/updates/characters/2012_07_30_01_world_void_storage_434.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE `void_storage` ADD `randomProperty` int(10) unsigned NOT NULL DEFAULT '0'; -ALTER TABLE `void_storage` ADD `suffixFactor` int(10) unsigned NOT NULL DEFAULT '0'; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 19c61b7013d..f3375fb115e 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -25757,12 +25757,8 @@ void Player::DeleteVoidStorageItem(uint8 slot) bool Player::SwapVoidStorageItem(uint8 oldSlot, uint8 newSlot) { if (oldSlot < 0 || oldSlot > VOID_STORAGE_MAX_SLOT || newSlot < 0 || newSlot > VOID_STORAGE_MAX_SLOT || oldSlot == newSlot) - { - return false; - } - // verify std::swap(_voidStorageItems[newSlot], _voidStorageItems[oldSlot]); return true; } diff --git a/src/server/game/Handlers/VoidStorageHandler.cpp b/src/server/game/Handlers/VoidStorageHandler.cpp index cc89bddb289..3938def0cc7 100644 --- a/src/server/game/Handlers/VoidStorageHandler.cpp +++ b/src/server/game/Handlers/VoidStorageHandler.cpp @@ -609,11 +609,11 @@ void WorldSession::HandleVoidSwapItem(WorldPacket& recvData) data.WriteByteSeq(itemId[7]); } - if (usedSrcSlot) - data << uint32(newSlot); - if (usedDestSlot) data << uint32(oldSlot); + if (usedSrcSlot) + data << uint32(newSlot); + SendPacket(&data); } -- cgit v1.2.3 From 53ba7b8b1429d28ab000a0d88fe9acd388691338 Mon Sep 17 00:00:00 2001 From: Nay Date: Wed, 1 Aug 2012 02:42:33 +0100 Subject: Core/ByteBuffer: Fix a subscript out of range exception (in debug mode) when ReadString is used with length 0 --- src/server/shared/Packets/ByteBuffer.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h index c08f794c5fa..a86a3524cbc 100755 --- a/src/server/shared/Packets/ByteBuffer.h +++ b/src/server/shared/Packets/ByteBuffer.h @@ -438,6 +438,8 @@ class ByteBuffer std::string ReadString(uint32 length) { + if (!length) + return std::string(); char* buffer = new char[length + 1]; memset(buffer, 0, length + 1); read((uint8*)buffer, length); -- cgit v1.2.3 From ac252899dedfb2e0f9bb0b6ad68f04ca3bddda06 Mon Sep 17 00:00:00 2001 From: Nay Date: Wed, 1 Aug 2012 02:43:47 +0100 Subject: Core/PacketIO:: Change status of CMSG_VIOLENCE_LEVEL to STATUS_AUTHED since it's now sent at the loading screen We still don't do anything with that packet... --- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 9fe345b9c5f..aa959a7666a 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -673,7 +673,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_UPDATE_PROJECTILE_POSITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateProjectilePosition ); //DEFINE_OPCODE_HANDLER(CMSG_USE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUseItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_USE_SKILL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_VIOLENCE_LEVEL, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleViolenceLevel ); + DEFINE_OPCODE_HANDLER(CMSG_VIOLENCE_LEVEL, STATUS_AUTHED, PROCESS_INPLACE, &WorldSession::HandleViolenceLevel ); DEFINE_OPCODE_HANDLER(CMSG_VOICE_SESSION_ENABLE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleVoiceSessionEnableOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_VOICE_SET_TALKER_MUTED_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_VOID_STORAGE_UNLOCK, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleVoidStorageUnlock ); -- cgit v1.2.3 From cecde87c325547f8bc6f71a4aea8d9b50746c1b5 Mon Sep 17 00:00:00 2001 From: Nay Date: Wed, 1 Aug 2012 02:46:32 +0100 Subject: Core/Misc: Basic implemention of Transmogrification TODO: charge money and fix some quirks and bugs Thanks to Shauren for finding item flags and proper validation --- src/server/game/Entities/Item/Item.cpp | 111 +++++++++++++++++ src/server/game/Entities/Item/Item.h | 7 ++ src/server/game/Entities/Item/ItemPrototype.h | 3 + src/server/game/Entities/Unit/Unit.h | 1 + src/server/game/Handlers/ItemHandler.cpp | 169 +++++++++++++++++++++++++- src/server/game/Server/Protocol/Opcodes.cpp | 3 +- src/server/game/Server/Protocol/Opcodes.h | 4 +- src/server/game/Server/WorldSession.h | 4 + 8 files changed, 298 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index 248b080bfdd..130aac50935 100755 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -1196,3 +1196,114 @@ bool Item::CheckSoulboundTradeExpire() return false; } + +bool Item::CanBeTransmogrified() const +{ + ItemTemplate const* proto = GetTemplate(); + + if (!proto) + return false; + + if (proto->Quality == ITEM_QUALITY_LEGENDARY) + return false; + + if (proto->Class != ITEM_CLASS_ARMOR && + proto->Class != ITEM_CLASS_WEAPON) + return false; + + if (proto->Class == ITEM_CLASS_WEAPON && proto->SubClass == ITEM_SUBCLASS_WEAPON_FISHING_POLE) + return false; + + if (proto->Flags2 & ITEM_FLAGS_EXTRA_CANNOT_BE_TRANSMOG) + return false; + + if (!HasStats()) + return false; + + return true; +} + +bool Item::CanTransmogrify() const +{ + ItemTemplate const* proto = GetTemplate(); + + if (!proto) + return false; + + if (proto->Flags2 & ITEM_FLAGS_EXTRA_CANNOT_TRANSMOG) + return false; + + if (proto->Quality == ITEM_QUALITY_LEGENDARY) + return false; + + if (proto->Class != ITEM_CLASS_ARMOR && + proto->Class != ITEM_CLASS_WEAPON) + return false; + + if (proto->Class == ITEM_CLASS_WEAPON && proto->SubClass == ITEM_SUBCLASS_WEAPON_FISHING_POLE) + return false; + + if (proto->Flags2 & ITEM_FLAGS_EXTRA_CAN_TRANSMOG) + return true; + + if (!HasStats()) + return false; + + return true; +} + +bool Item::CanTransmogrifyItemWithItem(Item const* transmogrified, Item const* transmogrifier) +{ + if (!transmogrifier || !transmogrified) + return false; + + ItemTemplate const* proto1 = transmogrifier->GetTemplate(); // source + ItemTemplate const* proto2 = transmogrified->GetTemplate(); // dest + + if (proto1->ItemId == proto2->ItemId) + return false; + + if (!transmogrified->CanTransmogrify() || !transmogrifier->CanBeTransmogrified()) + return false; + + if (proto1->InventoryType == INVTYPE_BAG || + proto1->InventoryType == INVTYPE_RELIC || + proto1->InventoryType == INVTYPE_BODY || + proto1->InventoryType == INVTYPE_FINGER || + proto1->InventoryType == INVTYPE_TRINKET || + proto1->InventoryType == INVTYPE_AMMO || + proto1->InventoryType == INVTYPE_QUIVER) + return false; + + if (proto1->SubClass != proto2->SubClass && (proto1->Class != ITEM_CLASS_WEAPON || !transmogrified->IsRangedWeapon() || !transmogrifier->IsRangedWeapon())) + return false; + + if (proto1->InventoryType != proto2->InventoryType && + (proto1->Class != ITEM_CLASS_WEAPON || (proto2->InventoryType != INVTYPE_WEAPONMAINHAND && proto2->InventoryType != INVTYPE_WEAPONOFFHAND))) + return false; + + return true; +} + +bool Item::HasStats() const +{ + if (GetItemRandomPropertyId() != 0) + return true; + + for (uint8 i = 0; i < MAX_ITEM_PROTO_STATS; ++i) + if (GetTemplate()->ItemStat[i].ItemStatValue != 0) + return true; + + return false; +} + +bool Item::IsRangedWeapon() const +{ + ItemTemplate const* proto = GetTemplate(); + if (proto && proto->Class == ITEM_CLASS_WEAPON) + return proto->SubClass == ITEM_SUBCLASS_WEAPON_BOW || + proto->SubClass == ITEM_SUBCLASS_WEAPON_GUN || + proto->SubClass == ITEM_SUBCLASS_WEAPON_CROSSBOW; + + return false; +} diff --git a/src/server/game/Entities/Item/Item.h b/src/server/game/Entities/Item/Item.h index d38e8c32e30..2f9d10bb9d5 100755 --- a/src/server/game/Entities/Item/Item.h +++ b/src/server/game/Entities/Item/Item.h @@ -317,10 +317,12 @@ class Item : public Object bool hasQuest(uint32 quest_id) const { return GetTemplate()->StartQuest == quest_id; } bool hasInvolvedQuest(uint32 /*quest_id*/) const { return false; } + bool HasStats() const; bool IsPotion() const { return GetTemplate()->IsPotion(); } bool IsWeaponVellum() const { return GetTemplate()->IsWeaponVellum(); } bool IsArmorVellum() const { return GetTemplate()->IsArmorVellum(); } bool IsConjuredConsumable() const { return GetTemplate()->IsConjuredConsumable(); } + bool IsRangedWeapon() const; // Item Refund system void SetNotRefundable(Player* owner, bool changestate = true, SQLTransaction* trans = NULL); @@ -343,6 +345,11 @@ class Item : public Object void BuildUpdate(UpdateDataMapType&); uint32 GetScriptId() const { return GetTemplate()->ScriptId; } + + bool CanBeTransmogrified() const; + bool CanTransmogrify() const; + static bool CanTransmogrifyItemWithItem(Item const* transmogrified, Item const* transmogrifier); + private: std::string m_text; uint8 m_slot; diff --git a/src/server/game/Entities/Item/ItemPrototype.h b/src/server/game/Entities/Item/ItemPrototype.h index 9e14dcb7733..7bfe43e0691 100755 --- a/src/server/game/Entities/Item/ItemPrototype.h +++ b/src/server/game/Entities/Item/ItemPrototype.h @@ -197,6 +197,9 @@ enum ItemFlagsExtra ITEM_FLAGS_EXTRA_NEED_ROLL_DISABLED = 0x00000100, ITEM_FLAGS_EXTRA_CASTER_WEAPON = 0x00000200, ITEM_FLAGS_EXTRA_BNET_ACCOUNT_BOUND = 0x00020000, + ITEM_FLAGS_EXTRA_CANNOT_BE_TRANSMOG = 0x00200000, + ITEM_FLAGS_EXTRA_CANNOT_TRANSMOG = 0x00400000, + ITEM_FLAGS_EXTRA_CAN_TRANSMOG = 0x00800000, }; enum ItemFlagsCustom diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index a010a119017..3133d75fa07 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -662,6 +662,7 @@ enum NPCFlags UNIT_NPC_FLAG_SPELLCLICK = 0x01000000, // cause client to send 1015 opcode (spell click) UNIT_NPC_FLAG_PLAYER_VEHICLE = 0x02000000, // players with mounts that have vehicle data should have it set UNIT_NPC_FLAG_REFORGER = 0x08000000, // reforging + UNIT_NPC_FLAG_TRANSMOGRIFIER = 0x10000000, // transmogrification UNIT_NPC_FLAG_VAULTKEEPER = 0x20000000, // void storage }; diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index bcb3601ee48..0b21363a783 100755 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -237,7 +237,7 @@ void WorldSession::HandleAutoEquipItemOpcode(WorldPacket & recv_data) void WorldSession::HandleDestroyItemOpcode(WorldPacket & recv_data) { - //sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_DESTROYITEM"); + //sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_DESTROY_ITEM"); uint8 bag, slot, count, data1, data2, data3; recv_data >> bag >> slot >> count >> data1 >> data2 >> data3; @@ -1457,3 +1457,170 @@ void WorldSession::HandleItemTextQuery(WorldPacket & recv_data ) SendPacket(&data); } + +void WorldSession::HandleTransmogrifyItems(WorldPacket& recvData) +{ + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_TRANSMOGRIFY_ITEMS"); + Player* player = GetPlayer(); + + // Read data + + uint32 count = recvData.ReadBits(22); + + if (count < EQUIPMENT_SLOT_START || count >= EQUIPMENT_SLOT_END) + { + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleTransmogrifyItems - Player (GUID: %u, name: %s) sent a wrong count (%u) when transmogrifying items.", player->GetGUIDLow(), player->GetName(), count); + recvData.rfinish(); + return; + } + + ObjectGuid* itemGuids = new ObjectGuid[count]; + uint32* newEntries = new uint32[count]; + uint32* slots = new uint32[count]; + + for (uint8 i = 0; i < count; ++i) + { + itemGuids[i][0] = recvData.ReadBit(); + itemGuids[i][5] = recvData.ReadBit(); + itemGuids[i][6] = recvData.ReadBit(); + itemGuids[i][2] = recvData.ReadBit(); + itemGuids[i][3] = recvData.ReadBit(); + itemGuids[i][7] = recvData.ReadBit(); + itemGuids[i][4] = recvData.ReadBit(); + itemGuids[i][1] = recvData.ReadBit(); + } + + ObjectGuid npcGuid; + npcGuid[7] = recvData.ReadBit(); + npcGuid[3] = recvData.ReadBit(); + npcGuid[5] = recvData.ReadBit(); + npcGuid[6] = recvData.ReadBit(); + npcGuid[1] = recvData.ReadBit(); + npcGuid[4] = recvData.ReadBit(); + npcGuid[0] = recvData.ReadBit(); + npcGuid[2] = recvData.ReadBit(); + + recvData.FlushBits(); + + for (uint32 i = 0; i < count; ++i) + { + recvData >> uint32(newEntries[i]); + + recvData.ReadByteSeq(itemGuids[i][1]); + recvData.ReadByteSeq(itemGuids[i][5]); + recvData.ReadByteSeq(itemGuids[i][0]); + recvData.ReadByteSeq(itemGuids[i][4]); + recvData.ReadByteSeq(itemGuids[i][6]); + recvData.ReadByteSeq(itemGuids[i][7]); + recvData.ReadByteSeq(itemGuids[i][3]); + recvData.ReadByteSeq(itemGuids[i][2]); + + recvData >> uint32(slots[i]); + } + + recvData.ReadByteSeq(npcGuid[7]); + recvData.ReadByteSeq(npcGuid[2]); + recvData.ReadByteSeq(npcGuid[5]); + recvData.ReadByteSeq(npcGuid[4]); + recvData.ReadByteSeq(npcGuid[3]); + recvData.ReadByteSeq(npcGuid[1]); + recvData.ReadByteSeq(npcGuid[6]); + recvData.ReadByteSeq(npcGuid[0]); + + // Validate + + if (!player->GetNPCIfCanInteractWith(npcGuid, UNIT_NPC_FLAG_TRANSMOGRIFIER)) + { + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleTransmogrifyItems - Unit (GUID: %u) not found or player can't interact with it.", GUID_LOPART(npcGuid)); + return; + } + + for (uint8 i = 0; i < count; ++i) + { + // slot of the transmogrified item + if (slots[i] < EQUIPMENT_SLOT_START || slots[i] >= EQUIPMENT_SLOT_END) + { + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleTransmogrifyItems - Player (GUID: %u, name: %s) tried to transmogrify an item (lowguid: %u) with a wrong slot (%u) when transmogrifying items.", player->GetGUIDLow(), player->GetName(), GUID_LOPART(itemGuids[i]), slots[i]); + return; + } + + // entry of the transmogrifier item, if it's not 0 + if (newEntries[i]) + { + ItemTemplate const* proto = sObjectMgr->GetItemTemplate(newEntries[i]); + if (!proto) + { + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleTransmogrifyItems - Player (GUID: %u, name: %s) tried to transmogrify to an invalid item (entry: %u).", player->GetGUIDLow(), player->GetName(), newEntries[i]); + return; + } + } + + Item* itemTransmogrifier = NULL; + // guid of the transmogrifier item, if it's not 0 + if (itemGuids[i]) + { + itemTransmogrifier = player->GetItemByGuid(itemGuids[i]); + if (!itemTransmogrifier) + { + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleTransmogrifyItems - Player (GUID: %u, name: %s) tried to transmogrify with an invalid item (guid: "UI64FMTD").", player->GetGUIDLow(), player->GetName(), itemGuids[i]); + return; + } + } + + // transmogrified item + Item* itemTransmogrified = player->GetItemByPos(INVENTORY_SLOT_BAG_0, slots[i]); + if (!itemTransmogrified) + { + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleTransmogrifyItems - Player (GUID: %u, name: %s) tried to transmogrify an invalid item in a valid slot (slot: %u).", player->GetGUIDLow(), player->GetName(), slots[i]); + return; + } + + // uint16 tempDest; + //// has to be able to equip item transmogrified item + //if (!player->CanEquipItem(slots[i], tempDest, itemTransmogrified, true, true)) + //{ + // sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleTransmogrifyItems - Player (GUID: %u, name: %s) can't equip the item to be transmogrified (slot: %u, entry: %u).", player->GetGUIDLow(), player->GetName(), slots[i], itemTransmogrified->GetEntry()); + // return; + //} + // + //// has to be able to equip item transmogrifier item + //if (!player->CanEquipItem(slots[i], tempDest, itemTransmogrifier, true, true)) + //{ + // sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleTransmogrifyItems - Player (GUID: %u, name: %s) can't equip the transmogrifier item (slot: %u, entry: %u).", player->GetGUIDLow(), player->GetName(), slots[i], itemTransmogrifier->GetEntry()); + // return; + //} + + if (!newEntries[i]) // reset look + { + player->SetUInt32Value(PLAYER_VISIBLE_ITEM_1_ENTRYID + (slots[i] * 2), itemTransmogrified->GetEntry()); + itemTransmogrified->SetUInt32Value(ITEM_FIELD_ENCHANTMENT_10_1, 0); + } + else + { + if (!Item::CanTransmogrifyItemWithItem(itemTransmogrified, itemTransmogrifier)) + { + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleTransmogrifyItems - Player (GUID: %u, name: %s) failed CanTransmogrifyItemWithItem (%u with %u).", player->GetGUIDLow(), player->GetName(), itemTransmogrified->GetEntry(), itemTransmogrifier->GetEntry()); + return; + } + + // All okay, proceed + + player->SetUInt32Value(PLAYER_VISIBLE_ITEM_1_ENTRYID + (slots[i] * 2), newEntries[i]); + itemTransmogrified->SetUInt32Value(ITEM_FIELD_ENCHANTMENT_10_1, newEntries[i]); + + itemTransmogrified->UpdatePlayedTime(player); + + itemTransmogrified->SetOwnerGUID(player->GetGUID()); + itemTransmogrified->SetNotRefundable(player); + itemTransmogrified->ClearSoulboundTradeable(player); + + itemTransmogrifier->SetOwnerGUID(player->GetGUID()); + itemTransmogrifier->SetNotRefundable(player); + itemTransmogrifier->ClearSoulboundTradeable(player); + } + } + + delete[] itemGuids; + delete[] newEntries; + delete[] slots; +} diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index aa959a7666a..166a9ad5601 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -227,7 +227,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_DEL_IGNORE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDelIgnoreOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_DEL_PVP_MEDAL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_DEL_VOICE_IGNORE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_DESTROYITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDestroyItemOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_DESTROY_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDestroyItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_DESTROYMONSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_DESTROY_ITEMS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_DISABLE_PVP_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -650,6 +650,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_TOGGLE_PVP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTogglePvP ); //DEFINE_OPCODE_HANDLER(CMSG_TOGGLE_XP_GAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_TOTEM_DESTROYED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTotemDestroyed ); + DEFINE_OPCODE_HANDLER(CMSG_TRANSMOGRIFY_ITEMS, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleTransmogrifyItems ); //DEFINE_OPCODE_HANDLER(CMSG_TRAINER_BUY_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerBuySpellOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_TRAINER_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerListOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_TRIGGER_CINEMATIC_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index d286e33fcbb..b1790d096b8 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -182,8 +182,8 @@ enum Opcodes CMSG_DEL_FRIEND = 0x6A15, CMSG_DEL_IGNORE = 0x4727, CMSG_DEL_VOICE_IGNORE = 0x0024, - CMSG_DESTROYITEM = 0x0000, - CMSG_DESTROY_ITEMS = 0x4A27, + CMSG_DESTROY_ITEM = 0x4A27, + CMSG_DESTROY_ITEMS = 0x0000, CMSG_DISMISS_CONTROLLED_VEHICLE = 0x3218, CMSG_DISMISS_CRITTER = 0x4227, CMSG_DUEL_ACCEPTED = 0x2136, diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index c215063fefa..38351e8340b 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -918,6 +918,10 @@ class WorldSession void HandleVoidSwapItem(WorldPacket& recvData); void SendVoidStorageTransferResult(VoidTransferError result); + // Transmogrification + void HandleTransmogrifyItems(WorldPacket& recvData); + + // Miscellaneous void HandleSpellClick(WorldPacket& recv_data); void HandleMirrorImageDataRequest(WorldPacket& recv_data); void HandleAlterAppearance(WorldPacket& recv_data); -- cgit v1.2.3 From 5f22d081aa297edce8b5a6d8a2551727f8c2de8b Mon Sep 17 00:00:00 2001 From: cyberbrest Date: Tue, 31 Jul 2012 17:59:33 +0300 Subject: [PacketIO] mistake in transport guid. --- src/server/game/Entities/Object/Object.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 326bf616f57..9f386a54246 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -467,8 +467,8 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const *data << float(self->GetPositionX()); *data << self->GetSpeed(MOVE_PITCH_RATE); - data->WriteByteSeq(guid[0]); data->WriteByteSeq(guid[3]); + data->WriteByteSeq(guid[0]); *data << self->GetSpeed(MOVE_SWIM); *data << float(self->GetPositionY()); data->WriteByteSeq(guid[7]); -- cgit v1.2.3 From 69bbe1fded8e2c74eb68e07fed463f8d20f283b2 Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 1 Aug 2012 14:31:09 +0200 Subject: Core/Items: Added loading and saving transmogrification. --- .../2012_08_01_00_characters_item_instance_434.sql | 11 ++++++++++ src/server/game/Entities/Item/Item.h | 24 ++++++++++++++-------- src/server/game/Entities/Player/Player.cpp | 4 ++-- src/server/game/Handlers/ItemHandler.cpp | 16 +++++++-------- 4 files changed, 36 insertions(+), 19 deletions(-) create mode 100644 sql/updates/characters/2012_08_01_00_characters_item_instance_434.sql (limited to 'src') diff --git a/sql/updates/characters/2012_08_01_00_characters_item_instance_434.sql b/sql/updates/characters/2012_08_01_00_characters_item_instance_434.sql new file mode 100644 index 00000000000..b87b781e293 --- /dev/null +++ b/sql/updates/characters/2012_08_01_00_characters_item_instance_434.sql @@ -0,0 +1,11 @@ +UPDATE `item_instance` SET `enchantments` = REPLACE(`enchantments`,' ',' '); +UPDATE `item_instance` SET `enchantments` = CONCAT(TRIM(`enchantments`),' '); + +UPDATE `item_instance` SET `enchantments` = CONCAT( + SUBSTRING_INDEX(`enchantments`, ' ', 7*3), + ' 0 0 0 0 0 0 0 0 0 ', + SUBSTRING_INDEX(`enchantments`, ' ', -(12-7)*3 - 1)) +WHERE (LENGTH(`enchantments`) - LENGTH(REPLACE(`enchantments`, ' ', ''))) = 12*3; + +UPDATE `item_instance` SET `enchantments` = REPLACE(`enchantments`,' ',' '); +UPDATE `item_instance` SET `enchantments` = CONCAT(TRIM(`enchantments`),' '); diff --git a/src/server/game/Entities/Item/Item.h b/src/server/game/Entities/Item/Item.h index 2f9d10bb9d5..64b74539727 100755 --- a/src/server/game/Entities/Item/Item.h +++ b/src/server/game/Entities/Item/Item.h @@ -164,14 +164,15 @@ enum EnchantmentSlot PRISMATIC_ENCHANTMENT_SLOT = 6, // added at apply special permanent enchantment //TODO: 7, //TODO: 8, - MAX_INSPECTED_ENCHANTMENT_SLOT = 9, - - PROP_ENCHANTMENT_SLOT_0 = 7, // used with RandomSuffix - PROP_ENCHANTMENT_SLOT_1 = 8, // used with RandomSuffix - PROP_ENCHANTMENT_SLOT_2 = 9, // used with RandomSuffix and RandomProperty - PROP_ENCHANTMENT_SLOT_3 = 10, // used with RandomProperty - PROP_ENCHANTMENT_SLOT_4 = 11, // used with RandomProperty - MAX_ENCHANTMENT_SLOT = 12 + TRANSMOGRIFY_ENCHANTMENT_SLOT = 9, + MAX_INSPECTED_ENCHANTMENT_SLOT = 10, + + PROP_ENCHANTMENT_SLOT_0 = 10, // used with RandomSuffix + PROP_ENCHANTMENT_SLOT_1 = 11, // used with RandomSuffix + PROP_ENCHANTMENT_SLOT_2 = 12, // used with RandomSuffix and RandomProperty + PROP_ENCHANTMENT_SLOT_3 = 13, // used with RandomProperty + PROP_ENCHANTMENT_SLOT_4 = 14, // used with RandomProperty + MAX_ENCHANTMENT_SLOT = 15 }; #define MAX_VISIBLE_ITEM_OFFSET 2 // 2 fields per visible item (entry+enchantment) @@ -350,6 +351,13 @@ class Item : public Object bool CanTransmogrify() const; static bool CanTransmogrifyItemWithItem(Item const* transmogrified, Item const* transmogrifier); + uint32 GetVisibleEntry() const + { + if (uint32 transmogrification = GetEnchantmentId(TRANSMOGRIFY_ENCHANTMENT_SLOT)) + return transmogrification; + return GetEntry(); + } + private: std::string m_text; uint8 m_slot; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index f3375fb115e..f729fe1502f 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -12357,7 +12357,7 @@ void Player::SetVisibleItemSlot(uint8 slot, Item* pItem) { if (pItem) { - SetUInt32Value(PLAYER_VISIBLE_ITEM_1_ENTRYID + (slot * 2), pItem->GetEntry()); + SetUInt32Value(PLAYER_VISIBLE_ITEM_1_ENTRYID + (slot * 2), pItem->GetVisibleEntry()); SetUInt16Value(PLAYER_VISIBLE_ITEM_1_ENCHANTMENT + (slot * 2), 0, pItem->GetEnchantmentId(PERM_ENCHANTMENT_SLOT)); SetUInt16Value(PLAYER_VISIBLE_ITEM_1_ENCHANTMENT + (slot * 2), 1, pItem->GetEnchantmentId(TEMP_ENCHANTMENT_SLOT)); } @@ -25717,7 +25717,7 @@ uint8 Player::AddVoidStorageItem(const VoidStorageItem& item) GetSession()->SendVoidStorageTransferResult(VOID_TRANSFER_ERROR_FULL); return -1; } - + _voidStorageItems[slot] = new VoidStorageItem(item.ItemId, item.ItemEntry, item.CreatorGuid, item.ItemRandomPropertyId, item.ItemSuffixFactor); return slot; diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 0b21363a783..b36ca5853cf 100755 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -746,7 +746,7 @@ void WorldSession::SendListInventory(uint64 vendorGuid) VendorItemData const* vendorItems = vendor->GetVendorItems(); uint8 rawItemCount = vendorItems ? vendorItems->GetItemCount() : 0; - //if (rawItemCount > 300), + //if (rawItemCount > 300), // rawItemCount = 300; // client cap but uint8 max value is 255 ByteBuffer itemsData(32 * rawItemCount); @@ -783,7 +783,7 @@ void WorldSession::SendListInventory(uint64 vendorGuid) if (leftInStock == 0) continue; } - + int32 price = vendorItem->IsGoldRequired(itemTemplate) ? uint32(floor(itemTemplate->BuyPrice * discountMod)) : 0; uint32 leftInStock = !vendorItem->maxcount ? 0xFFFFFFFF : vendor->GetVendorItemCurrentCount(vendorItem); @@ -1464,7 +1464,6 @@ void WorldSession::HandleTransmogrifyItems(WorldPacket& recvData) Player* player = GetPlayer(); // Read data - uint32 count = recvData.ReadBits(22); if (count < EQUIPMENT_SLOT_START || count >= EQUIPMENT_SLOT_END) @@ -1477,7 +1476,7 @@ void WorldSession::HandleTransmogrifyItems(WorldPacket& recvData) ObjectGuid* itemGuids = new ObjectGuid[count]; uint32* newEntries = new uint32[count]; uint32* slots = new uint32[count]; - + for (uint8 i = 0; i < count; ++i) { itemGuids[i][0] = recvData.ReadBit(); @@ -1592,8 +1591,8 @@ void WorldSession::HandleTransmogrifyItems(WorldPacket& recvData) if (!newEntries[i]) // reset look { - player->SetUInt32Value(PLAYER_VISIBLE_ITEM_1_ENTRYID + (slots[i] * 2), itemTransmogrified->GetEntry()); - itemTransmogrified->SetUInt32Value(ITEM_FIELD_ENCHANTMENT_10_1, 0); + itemTransmogrified->ClearEnchantment(TRANSMOGRIFY_ENCHANTMENT_SLOT); + player->SetVisibleItemSlot(slots[i], itemTransmogrified); } else { @@ -1604,9 +1603,8 @@ void WorldSession::HandleTransmogrifyItems(WorldPacket& recvData) } // All okay, proceed - - player->SetUInt32Value(PLAYER_VISIBLE_ITEM_1_ENTRYID + (slots[i] * 2), newEntries[i]); - itemTransmogrified->SetUInt32Value(ITEM_FIELD_ENCHANTMENT_10_1, newEntries[i]); + itemTransmogrified->SetEnchantment(TRANSMOGRIFY_ENCHANTMENT_SLOT, newEntries[i], 0, 0); + player->SetVisibleItemSlot(slots[i], itemTransmogrified); itemTransmogrified->UpdatePlayedTime(player); -- cgit v1.2.3 From b90bc1960f051b0362a8f0469e5072143d3314bf Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 1 Aug 2012 21:58:28 +0200 Subject: Core/PacketIO: Send better values for SMSG_FEATURE_SYSTEM_STATUS --- src/server/game/Handlers/CharacterHandler.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index d75d25b00e2..996e0e97ea6 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -850,26 +850,27 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder) LoadAccountData(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADACCOUNTDATA), PER_CHARACTER_CACHE_MASK); SendAccountDataTimes(PER_CHARACTER_CACHE_MASK); + bool featureBit4 = true; data.Initialize(SMSG_FEATURE_SYSTEM_STATUS, 7); // checked in 4.2.2 data << uint8(2); // unknown value + data << uint32(1); + data << uint32(1); + data << uint32(2); data << uint32(0); - data << uint32(0); - data << uint32(0); - data << uint32(0); - data.WriteBit(0); - data.WriteBit(0); - data.WriteBit(0); + data.WriteBit(1); + data.WriteBit(1); data.WriteBit(0); + data.WriteBit(featureBit4); data.WriteBit(0); data.WriteBit(0); data.FlushBits(); - //if (featureBit4) - //{ - // data << uint32(0); - // data << uint32(0); - // data << uint32(0); - // data << uint32(0); - //} + if (featureBit4) + { + data << uint32(1); + data << uint32(0); + data << uint32(10); + data << uint32(60); + } //if (featureBit5) //{ -- cgit v1.2.3 From 0b0501173f5a92573e16f78ae6074676f7b35346 Mon Sep 17 00:00:00 2001 From: Nay Date: Wed, 1 Aug 2012 23:36:41 +0100 Subject: Core/Build: Fix non pch build (MSVC) --- src/server/game/DataStores/DB2Structure.h | 1 + src/server/game/DataStores/DBCStores.cpp | 1 + src/server/game/Handlers/VoidStorageHandler.cpp | 1 + src/server/game/Movement/Spline/MovementPacketBuilder.cpp | 1 + src/server/game/Quests/QuestDef.cpp | 1 + src/server/game/Quests/QuestDef.h | 1 + src/server/game/Server/Protocol/Opcodes.cpp | 1 + src/server/game/Server/WorldSession.h | 1 + 8 files changed, 8 insertions(+) (limited to 'src') diff --git a/src/server/game/DataStores/DB2Structure.h b/src/server/game/DataStores/DB2Structure.h index a7b4fe4c07f..386e8546236 100644 --- a/src/server/game/DataStores/DB2Structure.h +++ b/src/server/game/DataStores/DB2Structure.h @@ -25,6 +25,7 @@ #include "Util.h" #include "Vehicle.h" #include "SharedDefines.h" +#include "ItemPrototype.h" #include #include diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 80f62d9cedb..f7f38021daf 100755 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -21,6 +21,7 @@ #include "SharedDefines.h" #include "SpellMgr.h" #include "DBCfmt.h" +#include "ItemPrototype.h" #include diff --git a/src/server/game/Handlers/VoidStorageHandler.cpp b/src/server/game/Handlers/VoidStorageHandler.cpp index 3938def0cc7..5e3ecc89e21 100644 --- a/src/server/game/Handlers/VoidStorageHandler.cpp +++ b/src/server/game/Handlers/VoidStorageHandler.cpp @@ -20,6 +20,7 @@ #include "WorldSession.h" #include "World.h" #include "ObjectAccessor.h" +#include "ObjectMgr.h" #include "Log.h" #include "Opcodes.h" #include "Player.h" diff --git a/src/server/game/Movement/Spline/MovementPacketBuilder.cpp b/src/server/game/Movement/Spline/MovementPacketBuilder.cpp index 69f087a6b2a..6a3c2ba8eea 100644 --- a/src/server/game/Movement/Spline/MovementPacketBuilder.cpp +++ b/src/server/game/Movement/Spline/MovementPacketBuilder.cpp @@ -19,6 +19,7 @@ #include "MovementPacketBuilder.h" #include "MoveSpline.h" #include "WorldPacket.h" +#include "Object.h" namespace Movement { diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index ff351f90f74..32dc58e582b 100755 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -19,6 +19,7 @@ #include "QuestDef.h" #include "Player.h" #include "World.h" +#include "ObjectMgr.h" Quest::Quest(Field* questRecord) { diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h index 1c8afd2a90b..b72956ce313 100755 --- a/src/server/game/Quests/QuestDef.h +++ b/src/server/game/Quests/QuestDef.h @@ -22,6 +22,7 @@ #include "Define.h" #include "DatabaseEnv.h" #include "SharedDefines.h" +#include "WorldPacket.h" #include #include diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 166a9ad5601..5177d452832 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -21,6 +21,7 @@ */ #include "Opcodes.h" +#include "WorldSession.h" OpcodeHandler* opcodeTable[NUM_OPCODE_HANDLERS] = { }; diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 38351e8340b..fb9c90e94b8 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -30,6 +30,7 @@ #include "World.h" #include "WorldPacket.h" #include "Cryptography/BigNumber.h" +#include "Opcodes.h" class CalendarEvent; class CalendarInvite; -- cgit v1.2.3 From e909fd036b39b5f53e60421d2eb6213497189cc6 Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 2 Aug 2012 00:30:22 +0100 Subject: One last missed change to fix non PCH build --- src/server/game/Server/Protocol/Opcodes.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index b1790d096b8..6ee5ade502a 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -1438,6 +1438,7 @@ enum PacketProcessing }; class WorldPacket; +class WorldSession; typedef void(WorldSession::*pOpcodeHandler)(WorldPacket& recvPacket); -- cgit v1.2.3 From edee3732c59f1c238131acea7e1fb73f466b4b99 Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 2 Aug 2012 01:16:45 +0100 Subject: Core/Transmog: Charge money for transmogrification --- src/server/game/DataStores/DBCStores.cpp | 6 + src/server/game/DataStores/DBCStores.h | 6 + src/server/game/DataStores/DBCStructure.h | 49 ++++++++ src/server/game/DataStores/DBCfmt.h | 10 +- src/server/game/Entities/Item/Item.cpp | 167 ++++++++++++++++++++++++-- src/server/game/Entities/Item/Item.h | 5 +- src/server/game/Entities/Item/ItemPrototype.h | 9 ++ src/server/game/Handlers/ItemHandler.cpp | 8 ++ 8 files changed, 250 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index f7f38021daf..fb2e0806d99 100755 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -110,9 +110,15 @@ DBCStorage sGtRegenMPPerSptStore(GtRegenMPPerSptf DBCStorage sHolidaysStore(Holidaysfmt); +DBCStorage sImportPriceArmorStore(ImportPriceArmorfmt); +DBCStorage sImportPriceQualityStore(ImportPriceQualityfmt); +DBCStorage sImportPriceShieldStore(ImportPriceShieldfmt); +DBCStorage sImportPriceWeaponStore(ImportPriceWeaponfmt); +DBCStorage sItemPriceBaseStore(ItemPriceBasefmt); DBCStorage sItemArmorQualityStore(ItemArmorQualityfmt); DBCStorage sItemArmorShieldStore(ItemArmorShieldfmt); DBCStorage sItemArmorTotalStore(ItemArmorTotalfmt); +DBCStorage sItemClassStore(ItemClassfmt); DBCStorage sItemBagFamilyStore(ItemBagFamilyfmt); DBCStorage sItemDamageAmmoStore(ItemDamagefmt); DBCStorage sItemDamageOneHandStore(ItemDamagefmt); diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h index d94b60c1384..252d8c53d92 100755 --- a/src/server/game/DataStores/DBCStores.h +++ b/src/server/game/DataStores/DBCStores.h @@ -121,9 +121,15 @@ extern DBCStorage sGtRegenHPPerSptStore; extern DBCStorage sGtOCTHpPerStaminaStore; extern DBCStorage sGtRegenMPPerSptStore; extern DBCStorage sHolidaysStore; +extern DBCStorage sImportPriceArmorStore; +extern DBCStorage sImportPriceQualityStore; +extern DBCStorage sImportPriceShieldStore; +extern DBCStorage sImportPriceWeaponStore; +extern DBCStorage sItemPriceBaseStore; extern DBCStorage sItemArmorQualityStore; extern DBCStorage sItemArmorShieldStore; extern DBCStorage sItemArmorTotalStore; +extern DBCStorage sItemClassStore; extern DBCStorage sItemBagFamilyStore; extern DBCStorage sItemDamageAmmoStore; extern DBCStorage sItemDamageOneHandStore; diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index cde1aa51e0d..1a9c7b16398 100755 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -1153,6 +1153,45 @@ struct HolidaysEntry //uint32 flags; // 54 m_flags (0 = Darkmoon Faire, Fishing Contest and Wotlk Launch, rest is 1) }; +// ImportPriceArmor.dbc +struct ImportPriceArmorEntry +{ + uint32 InventoryType; // 1 Id/InventoryType + float ClothFactor; // 2 Price factor cloth + float LeatherFactor; // 3 Price factor leather + float MailFactor; // 4 Price factor mail + float PlateFactor; // 5 Price factor plate +}; + +// ImportPriceQuality.dbc +struct ImportPriceQualityEntry +{ + uint32 QualityId; // 1 Quality Id (+1?) + float Factor; // 2 Price factor +}; + +// ImportPriceShield.dbc +struct ImportPriceShieldEntry +{ + uint32 Id; // 1 Unk id (only 1 and 2) + float Factor; // 2 Price factor +}; + +// ImportPriceWeapon.dbc +struct ImportPriceWeaponEntry +{ + uint32 Id; // 1 Unk id (mainhand - 0, offhand - 1, weapon - 2, 2hweapon - 3, ranged/rangedright/relic - 4) + float Factor; // 2 Price factor +}; + +// ItemPriceBase.dbc +struct ItemPriceBaseEntry +{ + uint32 ItemLevel; // 2 Item level (1 - 1000) + float ArmorFactor; // 3 Price factor for armor + float WeaponFactor; // 4 Price factor for weapons +}; + // common struct for: // ItemDamageAmmo.dbc // ItemDamageOneHand.dbc @@ -1190,6 +1229,16 @@ struct ItemArmorTotalEntry float Value[4]; // 2-5 multiplier for armor types (cloth...plate) }; +// ItemClass.dbc +struct ItemClassEntry +{ + uint32 Class; // 1 item class id + //uint32 Unk; // 2 unk + //uint32 IsWeapon; // 3 1 for weapon, 0 for everything else + float PriceFactor; // 4 used to calculate certain prices + //char* Name; // class name +}; + struct ItemBagFamilyEntry { uint32 ID; // 0 diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index 780a33685d6..3c2900f60e9 100755 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -19,6 +19,9 @@ #ifndef TRINITY_DBCSFRM_H #define TRINITY_DBCSFRM_H +// x - skip, X - skip, s - char*, f - float, i - uint32, b - uint8, d - index (not included) +// n - index (included), l - bool, p - field present in sql dbc, a - field absent in sql dbc + const char Achievementfmt[]="niixsxiixixxii"; //const std::string CustomAchievementfmt="pppaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaapapaaaaaaaaaaaaaaaaaapp"; //const std::string CustomAchievementIndex = "ID"; @@ -74,12 +77,17 @@ const char GtOCTRegenHPfmt[]="f"; //const char GtOCTRegenMPfmt[]="f"; const char GtRegenHPPerSptfmt[]="f"; const char GtRegenMPPerSptfmt[]="xf"; - const char Holidaysfmt[]="niiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiixxsiix"; +const char ImportPriceArmorfmt[]="nffff"; +const char ImportPriceQualityfmt[]="nf"; +const char ImportPriceShieldfmt[]="nf"; +const char ImportPriceWeaponfmt[]="nf"; +const char ItemPriceBasefmt[]="diff"; const char ItemBagFamilyfmt[]="nx"; const char ItemArmorQualityfmt[]="nfffffffi"; const char ItemArmorShieldfmt[]="nifffffff"; const char ItemArmorTotalfmt[]="niffff"; +const char ItemClassfmt[]="dixxfs"; const char ItemDamagefmt[]="nfffffffi"; const char ItemDisenchantLootfmt[]="niiiiii"; //const char ItemDisplayTemplateEntryfmt[]="nxxxxxxxxxxixxxxxxxxxxx"; diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index 130aac50935..59c23ec5176 100755 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -1275,7 +1275,7 @@ bool Item::CanTransmogrifyItemWithItem(Item const* transmogrified, Item const* t proto1->InventoryType == INVTYPE_QUIVER) return false; - if (proto1->SubClass != proto2->SubClass && (proto1->Class != ITEM_CLASS_WEAPON || !transmogrified->IsRangedWeapon() || !transmogrifier->IsRangedWeapon())) + if (proto1->SubClass != proto2->SubClass && (proto1->Class != ITEM_CLASS_WEAPON || !proto2->IsRangedWeapon() || !proto1->IsRangedWeapon())) return false; if (proto1->InventoryType != proto2->InventoryType && @@ -1290,20 +1290,171 @@ bool Item::HasStats() const if (GetItemRandomPropertyId() != 0) return true; + ItemTemplate const* proto = GetTemplate(); for (uint8 i = 0; i < MAX_ITEM_PROTO_STATS; ++i) - if (GetTemplate()->ItemStat[i].ItemStatValue != 0) + if (proto->ItemStat[i].ItemStatValue != 0) return true; return false; } -bool Item::IsRangedWeapon() const +// used by mail items, transmog cost, stationeryinfo and others +uint32 Item::GetSellPrice(bool& normalSellPrice) const { ItemTemplate const* proto = GetTemplate(); - if (proto && proto->Class == ITEM_CLASS_WEAPON) - return proto->SubClass == ITEM_SUBCLASS_WEAPON_BOW || - proto->SubClass == ITEM_SUBCLASS_WEAPON_GUN || - proto->SubClass == ITEM_SUBCLASS_WEAPON_CROSSBOW; + normalSellPrice = true; - return false; + if (proto->Flags2 & ITEM_FLAGS_EXTRA_HAS_NORMAL_PRICE) + { + return proto->BuyPrice; + } + else + { + ImportPriceQualityEntry const* qualityPrice = sImportPriceQualityStore.LookupEntry(proto->Quality + 1); + ItemPriceBaseEntry const* basePrice = sItemPriceBaseStore.LookupEntry(proto->ItemLevel); + + if (!qualityPrice || !basePrice) + return 0; + + float qualityFactor = qualityPrice->Factor; + float baseFactor = 0.0f; + + uint32 inventoryType = proto->InventoryType; + + if (inventoryType == INVTYPE_WEAPON || + inventoryType == INVTYPE_2HWEAPON || + inventoryType == INVTYPE_WEAPONMAINHAND || + inventoryType == INVTYPE_WEAPONOFFHAND || + inventoryType == INVTYPE_RANGED || + inventoryType == INVTYPE_THROWN || + inventoryType == INVTYPE_RANGEDRIGHT) + baseFactor = basePrice->WeaponFactor; + else + baseFactor = basePrice->ArmorFactor; + + if (inventoryType == INVTYPE_ROBE) + inventoryType = INVTYPE_CHEST; + + float typeFactor = 0.0f; + uint8 wepType = -1; + + switch (inventoryType) + { + case INVTYPE_HEAD: + case INVTYPE_SHOULDERS: + case INVTYPE_CHEST: + case INVTYPE_WAIST: + case INVTYPE_LEGS: + case INVTYPE_FEET: + case INVTYPE_WRISTS: + case INVTYPE_HANDS: + case INVTYPE_CLOAK: + { + ImportPriceArmorEntry const* armorPrice = sImportPriceArmorStore.LookupEntry(inventoryType); + if (!armorPrice) + return 0; + + switch (proto->SubClass) + { + case ITEM_SUBCLASS_ARMOR_MISCELLANEOUS: + case ITEM_SUBCLASS_ARMOR_CLOTH: + { + typeFactor = armorPrice->ClothFactor; + break; + } + case ITEM_SUBCLASS_ARMOR_LEATHER: + { + typeFactor = armorPrice->ClothFactor; + break; + } + case ITEM_SUBCLASS_ARMOR_MAIL: + { + typeFactor = armorPrice->ClothFactor; + break; + } + case ITEM_SUBCLASS_ARMOR_PLATE: + { + typeFactor = armorPrice->ClothFactor; + break; + } + default: + { + return 0; + } + } + + break; + } + case INVTYPE_SHIELD: + { + ImportPriceShieldEntry const* shieldPrice = sImportPriceShieldStore.LookupEntry(1); // it only has two rows, it's unclear which is the one used + if (!shieldPrice) + return 0; + + typeFactor = shieldPrice->Factor; + break; + } + case INVTYPE_WEAPONMAINHAND: + wepType = 0; // unk enum, fall back + case INVTYPE_WEAPONOFFHAND: + wepType = 1; // unk enum, fall back + case INVTYPE_WEAPON: + wepType = 2; // unk enum, fall back + case INVTYPE_2HWEAPON: + wepType = 3; // unk enum, fall back + case INVTYPE_RANGED: + case INVTYPE_RANGEDRIGHT: + case INVTYPE_RELIC: + { + wepType = 4; // unk enum + + ImportPriceWeaponEntry const* weaponPrice = sImportPriceWeaponStore.LookupEntry(wepType + 1); // it only has two rows, it's unclear which is the one used + if (!weaponPrice) + return 0; + + typeFactor = weaponPrice->Factor; + break; + } + default: + return proto->BuyPrice; + } + + normalSellPrice = false; + return (uint32)(qualityFactor * proto->Unk430_2 * proto->Unk430_1 * typeFactor * baseFactor); + } +} + +uint32 Item::GetTransmogrifyCost() const +{ + ItemTemplate const* proto = GetTemplate(); + uint32 cost = 0; + + if (proto->Flags2 & ITEM_FLAGS_EXTRA_HAS_NORMAL_PRICE) + cost = proto->SellPrice; + else + { + bool normalPrice; + cost = GetSellPrice(normalPrice); + + if (!normalPrice) + { + if (proto->BuyCount <= 1) + { + ItemClassEntry const* classEntry = sItemClassStore.LookupEntry(proto->Class); + if (classEntry) + cost *= classEntry->PriceFactor; + else + cost = 0; + } + else + cost /= 4 * proto->BuyCount; + } + else + cost = proto->SellPrice; + } + + if (cost < 10000) + cost = 10000; + + return cost; } diff --git a/src/server/game/Entities/Item/Item.h b/src/server/game/Entities/Item/Item.h index 64b74539727..2d5ebaa555f 100755 --- a/src/server/game/Entities/Item/Item.h +++ b/src/server/game/Entities/Item/Item.h @@ -323,7 +323,7 @@ class Item : public Object bool IsWeaponVellum() const { return GetTemplate()->IsWeaponVellum(); } bool IsArmorVellum() const { return GetTemplate()->IsArmorVellum(); } bool IsConjuredConsumable() const { return GetTemplate()->IsConjuredConsumable(); } - bool IsRangedWeapon() const; + bool IsRangedWeapon() const { return GetTemplate()->IsRangedWeapon(); } // Item Refund system void SetNotRefundable(Player* owner, bool changestate = true, SQLTransaction* trans = NULL); @@ -350,6 +350,7 @@ class Item : public Object bool CanBeTransmogrified() const; bool CanTransmogrify() const; static bool CanTransmogrifyItemWithItem(Item const* transmogrified, Item const* transmogrifier); + uint32 GetTransmogrifyCost() const; uint32 GetVisibleEntry() const { @@ -358,6 +359,8 @@ class Item : public Object return GetEntry(); } + uint32 GetSellPrice(bool& success) const; + private: std::string m_text; uint8 m_slot; diff --git a/src/server/game/Entities/Item/ItemPrototype.h b/src/server/game/Entities/Item/ItemPrototype.h index 7bfe43e0691..cfc65292507 100755 --- a/src/server/game/Entities/Item/ItemPrototype.h +++ b/src/server/game/Entities/Item/ItemPrototype.h @@ -196,6 +196,7 @@ enum ItemFlagsExtra ITEM_FLAGS_EXTRA_EXT_COST_REQUIRES_GOLD = 0x00000004, // when item uses extended cost, gold is also required ITEM_FLAGS_EXTRA_NEED_ROLL_DISABLED = 0x00000100, ITEM_FLAGS_EXTRA_CASTER_WEAPON = 0x00000200, + ITEM_FLAGS_EXTRA_HAS_NORMAL_PRICE = 0x00004000, ITEM_FLAGS_EXTRA_BNET_ACCOUNT_BOUND = 0x00020000, ITEM_FLAGS_EXTRA_CANNOT_BE_TRANSMOG = 0x00200000, ITEM_FLAGS_EXTRA_CANNOT_TRANSMOG = 0x00400000, @@ -740,6 +741,14 @@ struct ItemTemplate bool IsWeaponVellum() const { return Class == ITEM_CLASS_TRADE_GOODS && SubClass == ITEM_SUBCLASS_WEAPON_ENCHANTMENT; } bool IsArmorVellum() const { return Class == ITEM_CLASS_TRADE_GOODS && SubClass == ITEM_SUBCLASS_ITEM_ENCHANTMENT; } bool IsConjuredConsumable() const { return Class == ITEM_CLASS_CONSUMABLE && (Flags & ITEM_PROTO_FLAG_CONJURED); } + + bool IsRangedWeapon() const + { + return Class == ITEM_CLASS_WEAPON || + SubClass == ITEM_SUBCLASS_WEAPON_BOW || + SubClass == ITEM_SUBCLASS_WEAPON_GUN || + SubClass == ITEM_SUBCLASS_WEAPON_CROSSBOW; + } }; // Benchmarked: Faster than std::map (insert/find) diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index b36ca5853cf..18859e766d1 100755 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -1534,6 +1534,7 @@ void WorldSession::HandleTransmogrifyItems(WorldPacket& recvData) return; } + int32 cost = 0; for (uint8 i = 0; i < count; ++i) { // slot of the transmogrified item @@ -1615,7 +1616,14 @@ void WorldSession::HandleTransmogrifyItems(WorldPacket& recvData) itemTransmogrifier->SetOwnerGUID(player->GetGUID()); itemTransmogrifier->SetNotRefundable(player); itemTransmogrifier->ClearSoulboundTradeable(player); + + cost += itemTransmogrified->GetTransmogrifyCost(); } + + // trusting the client, if it got here it has to have enough money + // ... unless client was modified + if (cost) // 0 cost if reverting look + player->ModifyMoney(-cost); } delete[] itemGuids; -- cgit v1.2.3 From 23ccadbe2af1c846a4a7767f9e255100daeb79fe Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 2 Aug 2012 01:20:36 +0100 Subject: Remove a wrong copy paste comment (related to prev commit) --- src/server/game/Entities/Item/Item.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index 59c23ec5176..9c5d03f5440 100755 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -1408,7 +1408,7 @@ uint32 Item::GetSellPrice(bool& normalSellPrice) const { wepType = 4; // unk enum - ImportPriceWeaponEntry const* weaponPrice = sImportPriceWeaponStore.LookupEntry(wepType + 1); // it only has two rows, it's unclear which is the one used + ImportPriceWeaponEntry const* weaponPrice = sImportPriceWeaponStore.LookupEntry(wepType + 1); if (!weaponPrice) return 0; -- cgit v1.2.3 From 2070039638d7fd8bcd66db8ef88e730d9ea50d5b Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 2 Aug 2012 12:40:59 +0100 Subject: Core/DataStores: Add missing LoadDBCs Thanks to Venugh for noticing --- src/server/game/DataStores/DBCStores.cpp | 6 ++++++ src/server/game/DataStores/DBCfmt.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index fb2e0806d99..a9de83d3f80 100755 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -397,7 +397,13 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sGtRegenMPPerSptStore, dbcPath, "gtRegenMPPerSpt.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sHolidaysStore, dbcPath, "Holidays.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sImportPriceArmorStore, dbcPath, "ImportPriceArmor.dbc"); // 15595 + LoadDBC(availableDbcLocales, bad_dbc_files, sImportPriceQualityStore, dbcPath, "ImportPriceQuality.dbc"); // 15595 + LoadDBC(availableDbcLocales, bad_dbc_files, sImportPriceShieldStore, dbcPath, "ImportPriceShield.dbc"); // 15595 + LoadDBC(availableDbcLocales, bad_dbc_files, sImportPriceWeaponStore, dbcPath, "ImportPriceWeapon.dbc"); // 15595 + LoadDBC(availableDbcLocales, bad_dbc_files, sItemPriceBaseStore, dbcPath, "ItemPriceBase.dbc"); // 15595 LoadDBC(availableDbcLocales, bad_dbc_files, sItemBagFamilyStore, dbcPath, "ItemBagFamily.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sItemClassStore, dbcPath, "ItemClass.dbc"); // 15595 //LoadDBC(dbcCount, availableDbcLocales, bad_dbc_files, sItemDisplayInfoStore, dbcPath, "ItemDisplayInfo.dbc"); -- not used currently LoadDBC(availableDbcLocales, bad_dbc_files, sItemLimitCategoryStore, dbcPath, "ItemLimitCategory.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sItemRandomPropertiesStore, dbcPath, "ItemRandomProperties.dbc");//14545 diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index 3c2900f60e9..03521512c99 100755 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -87,7 +87,7 @@ const char ItemBagFamilyfmt[]="nx"; const char ItemArmorQualityfmt[]="nfffffffi"; const char ItemArmorShieldfmt[]="nifffffff"; const char ItemArmorTotalfmt[]="niffff"; -const char ItemClassfmt[]="dixxfs"; +const char ItemClassfmt[]="dixxfx"; const char ItemDamagefmt[]="nfffffffi"; const char ItemDisenchantLootfmt[]="niiiiii"; //const char ItemDisplayTemplateEntryfmt[]="nxxxxxxxxxxixxxxxxxxxxx"; -- cgit v1.2.3 From 6b666d77d98d6991734d7f52ddd08948eadbf243 Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 2 Aug 2012 18:18:32 +0100 Subject: Core/PacketIO: Update and enable handler for CMSG_GROUP_INVITE --- src/server/game/Handlers/GroupHandler.cpp | 78 +++++++++++++++-------------- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- 2 files changed, 42 insertions(+), 38 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp index 60b698d79b8..8ffb41ddc87 100755 --- a/src/server/game/Handlers/GroupHandler.cpp +++ b/src/server/game/Handlers/GroupHandler.cpp @@ -59,86 +59,90 @@ void WorldSession::SendPartyResult(PartyOperation operation, const std::string& SendPacket(&data); } -void WorldSession::HandleGroupInviteOpcode(WorldPacket & recv_data) +void WorldSession::HandleGroupInviteOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_INVITE"); - //BytesGuid guid; - //guid.guid = 0; + ObjectGuid crossRealmGuid; // unused - //recv_data.ReadByteMask(guid.bytes[6]); - //recv_data.ReadByteMask(guid.bytes[5]); - //recv_data.ReadByteMask(guid.bytes[0]); - //recv_data.ReadByteMask(guid.bytes[3]); - //recv_data.ReadByteMask(guid.bytes[4]); - //recv_data.ReadByteMask(guid.bytes[7]); - //recv_data.ReadByteMask(guid.bytes[1]); - //recv_data.ReadByteMask(guid.bytes[2]); + recvData.read_skip(); // Non-zero in cross realm invites + recvData.read_skip(); // Always 0 - recv_data.read_skip(); - recv_data.read_skip(); + crossRealmGuid[2] = recvData.ReadBit(); + crossRealmGuid[7] = recvData.ReadBit(); - std::string membername; - recv_data >> membername; - recv_data.read_skip(); + uint8 realmLen = recvData.ReadBits(9); + + crossRealmGuid[3] = recvData.ReadBit(); - //recv_data.ReadByteSeq(guid.bytes[0]); - //recv_data.ReadByteSeq(guid.bytes[7]); - //recv_data.ReadByteSeq(guid.bytes[4]); - //recv_data.ReadByteSeq(guid.bytes[1]); - //recv_data.ReadByteSeq(guid.bytes[2]); - //recv_data.ReadByteSeq(guid.bytes[6]); - //recv_data.ReadByteSeq(guid.bytes[5]); - std::string string0; - recv_data >> string0; - //recv_data.ReadByteSeq(guid.bytes[3]); + uint8 nameLen = recvData.ReadBits(10); + + crossRealmGuid[5] = recvData.ReadBit(); + crossRealmGuid[4] = recvData.ReadBit(); + crossRealmGuid[6] = recvData.ReadBit(); + crossRealmGuid[0] = recvData.ReadBit(); + crossRealmGuid[1] = recvData.ReadBit(); + + recvData.ReadByteSeq(crossRealmGuid[4]); + recvData.ReadByteSeq(crossRealmGuid[7]); + recvData.ReadByteSeq(crossRealmGuid[6]); + + std::string memberName, realmName; + memberName = recvData.ReadString(nameLen); + realmName = recvData.ReadString(realmLen); // unused + + recvData.ReadByteSeq(crossRealmGuid[1]); + recvData.ReadByteSeq(crossRealmGuid[0]); + recvData.ReadByteSeq(crossRealmGuid[5]); + recvData.ReadByteSeq(crossRealmGuid[3]); + recvData.ReadByteSeq(crossRealmGuid[2]); // attempt add selected player // cheating - if (!normalizePlayerName(membername)) + if (!normalizePlayerName(memberName)) { - SendPartyResult(PARTY_OP_INVITE, membername, ERR_BAD_PLAYER_NAME_S); + SendPartyResult(PARTY_OP_INVITE, memberName, ERR_BAD_PLAYER_NAME_S); return; } - Player* player = sObjectAccessor->FindPlayerByName(membername.c_str()); + Player* player = sObjectAccessor->FindPlayerByName(memberName.c_str()); // no player if (!player) { - SendPartyResult(PARTY_OP_INVITE, membername, ERR_BAD_PLAYER_NAME_S); + SendPartyResult(PARTY_OP_INVITE, memberName, ERR_BAD_PLAYER_NAME_S); return; } // restrict invite to GMs if (!sWorld->getBoolConfig(CONFIG_ALLOW_GM_GROUP) && !GetPlayer()->isGameMaster() && player->isGameMaster()) { - SendPartyResult(PARTY_OP_INVITE, membername, ERR_BAD_PLAYER_NAME_S); + SendPartyResult(PARTY_OP_INVITE, memberName, ERR_BAD_PLAYER_NAME_S); return; } // can't group with if (!GetPlayer()->isGameMaster() && !sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP) && GetPlayer()->GetTeam() != player->GetTeam()) { - SendPartyResult(PARTY_OP_INVITE, membername, ERR_PLAYER_WRONG_FACTION); + SendPartyResult(PARTY_OP_INVITE, memberName, ERR_PLAYER_WRONG_FACTION); return; } if (GetPlayer()->GetInstanceId() != 0 && player->GetInstanceId() != 0 && GetPlayer()->GetInstanceId() != player->GetInstanceId() && GetPlayer()->GetMapId() == player->GetMapId()) { - SendPartyResult(PARTY_OP_INVITE, membername, ERR_TARGET_NOT_IN_INSTANCE_S); + SendPartyResult(PARTY_OP_INVITE, memberName, ERR_TARGET_NOT_IN_INSTANCE_S); return; } // just ignore us if (player->GetInstanceId() != 0 && player->GetDungeonDifficulty() != GetPlayer()->GetDungeonDifficulty()) { - SendPartyResult(PARTY_OP_INVITE, membername, ERR_IGNORING_YOU_S); + SendPartyResult(PARTY_OP_INVITE, memberName, ERR_IGNORING_YOU_S); return; } if (player->GetSocial()->HasIgnore(GetPlayer()->GetGUIDLow())) { - SendPartyResult(PARTY_OP_INVITE, membername, ERR_IGNORING_YOU_S); + SendPartyResult(PARTY_OP_INVITE, memberName, ERR_IGNORING_YOU_S); return; } @@ -152,7 +156,7 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket & recv_data) // player already in another group or invited if (group2 || player->GetGroupInvite()) { - SendPartyResult(PARTY_OP_INVITE, membername, ERR_ALREADY_IN_GROUP_S); + SendPartyResult(PARTY_OP_INVITE, memberName, ERR_ALREADY_IN_GROUP_S); if (group2) { @@ -221,7 +225,7 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket & recv_data) data << uint32(0); // unk player->GetSession()->SendPacket(&data); - SendPartyResult(PARTY_OP_INVITE, membername, ERR_PARTY_RESULT_OK); + SendPartyResult(PARTY_OP_INVITE, memberName, ERR_PARTY_RESULT_OK); } void WorldSession::HandleGroupAcceptOpcode(WorldPacket& recv_data) diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 5177d452832..3948228ffbb 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -314,7 +314,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_GROUP_CHANGE_SUB_GROUP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupChangeSubGroupOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupDeclineOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_DISBAND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupDisbandOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GROUP_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupInviteOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GROUP_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupInviteOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_RAID_CONVERT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupRaidConvertOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_SET_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupSetLeaderOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_SWAP_SUB_GROUP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupSwapSubGroupOpcode ); -- cgit v1.2.3 From 048cfd754e783fe7c13df8b7bc89f5b76b4c04b9 Mon Sep 17 00:00:00 2001 From: Kandera Date: Thu, 2 Aug 2012 17:20:44 -0400 Subject: Enable who opcode --- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 3948228ffbb..cce26917555 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -684,7 +684,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_VOID_SWAP_ITEM, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleVoidSwapItem ); //DEFINE_OPCODE_HANDLER(CMSG_WARDEN_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleWardenDataOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_WEATHER_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_WHO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWhoOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_WHO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWhoOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_WHOIS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWhoisOpcode ); DEFINE_OPCODE_HANDLER(CMSG_WORLD_STATE_UI_TIMER_UPDATE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleWorldStateUITimerUpdate ); //DEFINE_OPCODE_HANDLER(CMSG_WORLD_TELEPORT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWorldTeleportOpcode ); -- cgit v1.2.3 From f6f16d243cc9ad3df47d2a76a8847a041ee42107 Mon Sep 17 00:00:00 2001 From: Kandera Date: Thu, 2 Aug 2012 17:22:51 -0400 Subject: enable smsg_who --- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index cce26917555..05f1bbbaf8e 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -1393,7 +1393,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_VOID_STORAGE_FAILED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_WARDEN_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_WEATHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_WHO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_WHO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_WHOIS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_WORLD_STATE_UI_TIMER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ZONE_MAP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From 1bad9d1f15e016cd5b86541f1d3c3ede951b5157 Mon Sep 17 00:00:00 2001 From: Kandera Date: Thu, 2 Aug 2012 17:29:47 -0400 Subject: Core/PacketIO: enable cmsg_whois and smsg_whois --- src/server/game/Server/Protocol/Opcodes.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 05f1bbbaf8e..47ca9d86e31 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -685,7 +685,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_WARDEN_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleWardenDataOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_WEATHER_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_WHO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWhoOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_WHOIS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWhoisOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_WHOIS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWhoisOpcode ); DEFINE_OPCODE_HANDLER(CMSG_WORLD_STATE_UI_TIMER_UPDATE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleWorldStateUITimerUpdate ); //DEFINE_OPCODE_HANDLER(CMSG_WORLD_TELEPORT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWorldTeleportOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_WRAP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWrapItemOpcode ); @@ -1394,7 +1394,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_WARDEN_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_WEATHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_WHO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_WHOIS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_WHOIS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_WORLD_STATE_UI_TIMER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ZONE_MAP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ZONE_UNDER_ATTACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From 8f07d0cc522695f2cd4a8038af449e7158b2f523 Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 2 Aug 2012 23:02:41 +0100 Subject: Core/Loading: Fix some wrong sql types in ObjectMgr loading code --- src/server/game/Globals/ObjectMgr.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 258e5d3ec25..1c56c64c985 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -2448,25 +2448,25 @@ void ObjectMgr::LoadItemTemplates() itemTemplate.ContainerSlots = uint32(fields[28].GetUInt8()); for (uint32 i = 0; i < MAX_ITEM_PROTO_STATS; ++i) { - itemTemplate.ItemStat[i].ItemStatType = uint32(fields[28 + i * 4 + 0].GetUInt8()); - itemTemplate.ItemStat[i].ItemStatValue = int32(fields[28 + i * 4 + 1].GetInt16()); - itemTemplate.ItemStat[i].ItemStatUnk1 = fields[28 + i * 4 + 2].GetInt32(); - itemTemplate.ItemStat[i].ItemStatUnk2 = fields[28 + i * 4 + 3].GetInt32(); + itemTemplate.ItemStat[i].ItemStatType = uint32(fields[29 + i * 4 + 0].GetUInt8()); + itemTemplate.ItemStat[i].ItemStatValue = int32(fields[29 + i * 4 + 1].GetInt16()); + itemTemplate.ItemStat[i].ItemStatUnk1 = fields[29 + i * 4 + 2].GetInt32(); + itemTemplate.ItemStat[i].ItemStatUnk2 = fields[29 + i * 4 + 3].GetInt32(); } itemTemplate.ScalingStatDistribution = uint32(fields[69].GetUInt16()); // cache item damage FillItemDamageFields(&itemTemplate.DamageMin, &itemTemplate.DamageMax, &itemTemplate.DPS, itemTemplate.ItemLevel, - itemTemplate.Class, itemTemplate.SubClass, itemTemplate.Quality, fields[71].GetUInt32(), + itemTemplate.Class, itemTemplate.SubClass, itemTemplate.Quality, fields[71].GetUInt16(), fields[131].GetFloat(), itemTemplate.InventoryType, itemTemplate.Flags2); - itemTemplate.DamageType = fields[70].GetUInt32(); + itemTemplate.DamageType = fields[70].GetUInt8(); itemTemplate.Armor = FillItemArmor(itemTemplate.ItemLevel, itemTemplate.Class, itemTemplate.SubClass, itemTemplate.Quality, itemTemplate.InventoryType); - itemTemplate.Delay = fields[71].GetUInt32(); + itemTemplate.Delay = fields[71].GetUInt16(); itemTemplate.RangedModRange = fields[72].GetFloat(); for (uint32 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i) { @@ -8906,7 +8906,7 @@ void ObjectMgr::LoadHotfixData() HotfixInfo info; info.Entry = fields[0].GetUInt32(); info.Type = fields[1].GetUInt32(); - info.Timestamp = fields[2].GetUInt32(); + info.Timestamp = fields[2].GetUInt64(); _hotfixData.push_back(info); ++count; -- cgit v1.2.3 From 891a31ef5c1c258c0a41af3969552231e24c4029 Mon Sep 17 00:00:00 2001 From: cyberbrest Date: Fri, 3 Aug 2012 17:42:54 +0300 Subject: [Misc]: Fix loading quest locales. --- src/server/game/Globals/ObjectMgr.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 1c56c64c985..a1a8eadd5de 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -4484,20 +4484,21 @@ void ObjectMgr::LoadQuestLocales() { LocaleConstant locale = (LocaleConstant) i; - AddLocaleString(fields[1 + 11 * (i - 1)].GetString(), locale, data.Title); - AddLocaleString(fields[1 + 11 * (i - 1) + 1].GetString(), locale, data.Details); - AddLocaleString(fields[1 + 11 * (i - 1) + 2].GetString(), locale, data.Objectives); - AddLocaleString(fields[1 + 11 * (i - 1) + 3].GetString(), locale, data.OfferRewardText); - AddLocaleString(fields[1 + 11 * (i - 1) + 4].GetString(), locale, data.RequestItemsText); - AddLocaleString(fields[1 + 11 * (i - 1) + 5].GetString(), locale, data.EndText); - AddLocaleString(fields[1 + 11 * (i - 1) + 6].GetString(), locale, data.CompletedText); - AddLocaleString(fields[1 + 11 * (i - 1) + 7].GetString(), locale, data.QuestGiverTextWindow); - AddLocaleString(fields[1 + 11 * (i - 1) + 8].GetString(), locale, data.QuestGiverTargetName); - AddLocaleString(fields[1 + 11 * (i - 1) + 9].GetString(), locale, data.QuestTurnTextWindow); - AddLocaleString(fields[1 + 11 * (i - 1) + 10].GetString(), locale, data.QuestTurnTargetName); + AddLocaleString(fields[1 + 15 * (i - 1)].GetString(), locale, data.Title); + AddLocaleString(fields[1 + 15 * (i - 1) + 1].GetString(), locale, data.Details); + AddLocaleString(fields[1 + 15 * (i - 1) + 2].GetString(), locale, data.Objectives); + AddLocaleString(fields[1 + 15 * (i - 1) + 3].GetString(), locale, data.OfferRewardText); + AddLocaleString(fields[1 + 15 * (i - 1) + 4].GetString(), locale, data.RequestItemsText); + AddLocaleString(fields[1 + 15 * (i - 1) + 5].GetString(), locale, data.EndText); + AddLocaleString(fields[1 + 15 * (i - 1) + 6].GetString(), locale, data.CompletedText); for (uint8 k = 0; k < 4; ++k) - AddLocaleString(fields[1 + 11 * (i - 1) + 7 + k].GetString(), locale, data.ObjectiveText[k]); + AddLocaleString(fields[1 + 15 * (i - 1) + 7 + k].GetString(), locale, data.ObjectiveText[k]); + + AddLocaleString(fields[1 + 15 * (i - 1) + 11].GetString(), locale, data.QuestGiverTextWindow); + AddLocaleString(fields[1 + 15 * (i - 1) + 12].GetString(), locale, data.QuestGiverTargetName); + AddLocaleString(fields[1 + 15 * (i - 1) + 13].GetString(), locale, data.QuestTurnTextWindow); + AddLocaleString(fields[1 + 15 * (i - 1) + 14].GetString(), locale, data.QuestTurnTargetName); } } while (result->NextRow()); -- cgit v1.2.3 From b0803d7e37b23cf62d7771303737eb376ad39485 Mon Sep 17 00:00:00 2001 From: horn Date: Fri, 3 Aug 2012 16:48:40 +0200 Subject: Core/PacketIO: Enabled CMSG_GUILD_LEAVE, MSG_TABARDVENDOR_ACTIVATE and some petitions releated opcodes --- src/server/game/Guilds/Guild.h | 15 +++++++++----- src/server/game/Handlers/PetitionsHandler.cpp | 12 ++++------- src/server/game/Server/Protocol/Opcodes.cpp | 30 +++++++++++++-------------- src/server/game/Server/Protocol/Opcodes.h | 2 +- src/server/game/Server/WorldSession.h | 4 ++-- src/server/worldserver/worldserver.conf.dist | 6 +++--- 6 files changed, 35 insertions(+), 34 deletions(-) (limited to 'src') diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h index 6e71641a652..446eede5dc8 100755 --- a/src/server/game/Guilds/Guild.h +++ b/src/server/game/Guilds/Guild.h @@ -149,15 +149,20 @@ enum PetitionTurns PETITION_TURN_OK = 0, PETITION_TURN_ALREADY_IN_GUILD = 2, PETITION_TURN_NEED_MORE_SIGNATURES = 4, + PETITION_TURN_GUILD_PERMISSIONS = 11, + PETITION_TURN_GUILD_NAME_INVALID = 12, }; enum PetitionSigns { - PETITION_SIGN_OK = 0, - PETITION_SIGN_ALREADY_SIGNED = 1, - PETITION_SIGN_ALREADY_IN_GUILD = 2, - PETITION_SIGN_CANT_SIGN_OWN = 3, - PETITION_SIGN_NOT_SERVER = 4, + PETITION_SIGN_OK = 0, + PETITION_SIGN_ALREADY_SIGNED = 1, + PETITION_SIGN_ALREADY_IN_GUILD = 2, + PETITION_SIGN_CANT_SIGN_OWN = 3, + PETITION_SIGN_NOT_SERVER = 4, + PETITION_SIGN_FULL = 5, + PETITION_SIGN_ALREADY_SIGNED_OTHER = 6, + PETITION_SIGN_RESTRICTED_ACCOUNT = 7, }; enum GuildBankRights diff --git a/src/server/game/Handlers/PetitionsHandler.cpp b/src/server/game/Handlers/PetitionsHandler.cpp index b8e275f2990..06dc82315bc 100755 --- a/src/server/game/Handlers/PetitionsHandler.cpp +++ b/src/server/game/Handlers/PetitionsHandler.cpp @@ -355,8 +355,8 @@ void WorldSession::SendPetitionQueryOpcode(uint64 petitionguid) data << uint8(0); // some string if (type == GUILD_CHARTER_TYPE) { - data << uint32(9); - data << uint32(9); + data << uint32(4); + data << uint32(4); data << uint32(0); // bypass client - side limitation, a different value is needed here for each petition } else @@ -557,14 +557,10 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data) WorldPacket data(SMSG_PETITION_SIGN_RESULTS, (8+8+4)); data << uint64(petitionGuid); data << uint64(_player->GetGUID()); - data << (uint32)PETITION_SIGN_ALREADY_SIGNED; + data << uint32(PETITION_SIGN_ALREADY_SIGNED); // close at signer side SendPacket(&data); - - // update for owner if online - if (Player* owner = ObjectAccessor::FindPlayer(ownerGuid)) - owner->GetSession()->SendPacket(&data); return; } @@ -954,7 +950,7 @@ void WorldSession::SendPetitionShowList(uint64 guid) data << uint32(CHARTER_DISPLAY_ID); // charter display id data << uint32(GUILD_CHARTER_COST); // charter cost data << uint32(0); // unknown - data << uint32(9); // required signs? + data << uint32(4); // required signs? } else { diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 47ca9d86e31..2e3ccf00e60 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -340,7 +340,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_GUILD_INFO_TEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildChangeInfoTextOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildInviteOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildLeaderOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildLeaveOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildLeaveOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_MOTD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildMOTDOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_PROMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildPromoteOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_QUERY, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildQueryOpcode ); @@ -463,7 +463,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_NO_SPELL_VARIANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_NPC_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNpcTextQueryOpcode ); DEFINE_OPCODE_HANDLER(CMSG_OBJECT_UPDATE_FAILED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleObjectUpdateFailedOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_OFFER_PETITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleOfferPetitionOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_OFFER_PETITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleOfferPetitionOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_OPENING_CINEMATIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_OPEN_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleOpenItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_OPT_OUT_OF_LOOT, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleOptOutOfLootOpcode ); @@ -472,11 +472,11 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_PARTY_UNSILENCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_PERFORM_ACTION_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_PETGODMODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_PETITION_BUY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionBuyOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_PETITION_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionQueryOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_PETITION_BUY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionBuyOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_PETITION_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionQueryOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_PETITION_SHOWLIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionShowListOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_PETITION_SHOW_SIGNATURES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionShowSignOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_PETITION_SIGN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionSignOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_PETITION_SHOW_SIGNATURES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionShowSignOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_PETITION_SIGN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionSignOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_PET_ABANDON, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetAbandon ); //DEFINE_OPCODE_HANDLER(CMSG_PET_ACTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetAction ); //DEFINE_OPCODE_HANDLER(CMSG_PET_CANCEL_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetCancelAuraOpcode ); @@ -655,7 +655,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_TRAINER_BUY_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerBuySpellOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_TRAINER_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerListOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_TRIGGER_CINEMATIC_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_TURN_IN_PETITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTurnInPetitionOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_TURN_IN_PETITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTurnInPetitionOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_CLEAR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialClear ); DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_FLAG, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialFlag ); //DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_RESET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialReset ); @@ -767,8 +767,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(MSG_NOTIFY_PARTY_SQUELCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_NULL_ACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_PARTY_ASSIGNMENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePartyAssignmentOpcode ); - //DEFINE_OPCODE_HANDLER(MSG_PETITION_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionDeclineOpcode ); - //DEFINE_OPCODE_HANDLER(MSG_PETITION_RENAME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionRenameOpcode ); + DEFINE_OPCODE_HANDLER(MSG_PETITION_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionDeclineOpcode ); + DEFINE_OPCODE_HANDLER(MSG_PETITION_RENAME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionRenameOpcode ); //DEFINE_OPCODE_HANDLER(MSG_PVP_LOG_DATA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePVPLogDataOpcode ); //DEFINE_OPCODE_HANDLER(MSG_QUERY_GUILD_BANK_TEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryGuildBankTabText ); //DEFINE_OPCODE_HANDLER(MSG_QUERY_NEXT_MAIL_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryNextMailTime ); @@ -781,7 +781,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(MSG_SAVE_GUILD_EMBLEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSaveGuildEmblemOpcode ); DEFINE_OPCODE_HANDLER(MSG_SET_DUNGEON_DIFFICULTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetDungeonDifficultyOpcode); DEFINE_OPCODE_HANDLER(MSG_SET_RAID_DIFFICULTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetRaidDifficultyOpcode ); - //DEFINE_OPCODE_HANDLER(MSG_TABARDVENDOR_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTabardVendorActivateOpcode); + DEFINE_OPCODE_HANDLER(MSG_TABARDVENDOR_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTabardVendorActivateOpcode); //DEFINE_OPCODE_HANDLER(MSG_TALENT_WIPE_CONFIRM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTalentWipeConfirmOpcode ); DEFINE_OPCODE_HANDLER(MSG_VERIFY_CONNECTIVITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); //DEFINE_OPCODE_HANDLER(MSG_VIEW_PHASE_SHIFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -1156,10 +1156,10 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_PAUSE_MIRROR_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PERIODICAURALOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PETGODMODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PETITION_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PETITION_SHOWLIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PETITION_SHOW_SIGNATURES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PETITION_SIGN_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PETITION_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PETITION_SHOWLIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PETITION_SHOW_SIGNATURES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PETITION_SIGN_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_ACTION_FEEDBACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_ACTION_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_BROKEN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1364,7 +1364,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_TRANSFER_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TRIGGER_CINEMATIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TRIGGER_MOVIE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_TURN_IN_PETITION_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TURN_IN_PETITION_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TUTORIAL_FLAGS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ACCOUNT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ACCOUNT_DATA_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 6ee5ade502a..5bf515da064 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -407,7 +407,7 @@ enum Opcodes CMSG_PETITION_BUY = 0x4E05, CMSG_PETITION_QUERY = 0x4424, CMSG_PETITION_SHOWLIST = 0x4617, - CMSG_PETITION_SHOW_SIGNATURES = 0x0000, + CMSG_PETITION_SHOW_SIGNATURES = 0x4F15, CMSG_PETITION_SIGN = 0x0E04, CMSG_PET_ABANDON = 0x0C24, CMSG_PET_ACTION = 0x0226, diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index fb9c90e94b8..5a8a8da04aa 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -136,10 +136,10 @@ enum ChatRestrictionType enum CharterTypes { - GUILD_CHARTER_TYPE = 9, + GUILD_CHARTER_TYPE = 4, ARENA_TEAM_CHARTER_2v2_TYPE = 2, ARENA_TEAM_CHARTER_3v3_TYPE = 3, - ARENA_TEAM_CHARTER_5v5_TYPE = 5 + ARENA_TEAM_CHARTER_5v5_TYPE = 5, }; #define DB2_REPLY_SPARSE 2442913102 diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index 110b7744b94..65ba2350775 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -1298,10 +1298,10 @@ MaxPrimaryTradeSkill = 2 # # MinPetitionSigns # Description: Number of required signatures on charters to create a guild. -# Range: 0-9 -# Default: 9 +# Range: 0-4 +# Default: 4 -MinPetitionSigns = 9 +MinPetitionSigns = 4 # # MaxGroupXPDistance -- cgit v1.2.3 From b2f42fef4437617dc8ba9ce9a9920c8092aa39e0 Mon Sep 17 00:00:00 2001 From: cyberbrest Date: Fri, 3 Aug 2012 22:18:59 +0300 Subject: [Item] remove support KeyRing Slots and CurrencyTokenSlots. ToDo: on rewarding currency items no need create item, just set curency count. --- src/server/game/Entities/Player/Player.cpp | 339 +---------------------------- src/server/game/Entities/Player/Player.h | 15 +- 2 files changed, 5 insertions(+), 349 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index f729fe1502f..28a559d80f1 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -4530,13 +4530,6 @@ void Player::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) c m_items[i]->BuildCreateUpdateBlockForPlayer(data, target); } - for (uint8 i = KEYRING_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i) - { - if (m_items[i] == NULL) - continue; - - m_items[i]->BuildCreateUpdateBlockForPlayer(data, target); - } } Unit::BuildCreateUpdateBlockForPlayer(data, target); @@ -4563,13 +4556,6 @@ void Player::DestroyForPlayer(Player* target, bool onDeath) const m_items[i]->DestroyForPlayer(target); } - for (uint8 i = KEYRING_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i) - { - if (m_items[i] == NULL) - continue; - - m_items[i]->DestroyForPlayer(target); - } } } @@ -5292,9 +5278,6 @@ void Player::DurabilityLossAll(double percent, bool inventory) if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) DurabilityLoss(pItem, percent); - // keys not have durability - //for (int i = KEYRING_SLOT_START; i < KEYRING_SLOT_END; i++) - for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) if (Bag* pBag = GetBagByPos(i)) for (uint32 j = 0; j < pBag->GetBagSize(); j++) @@ -5338,9 +5321,6 @@ void Player::DurabilityPointsLossAll(int32 points, bool inventory) if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) DurabilityPointsLoss(pItem, points); - // keys not have durability - //for (int i = KEYRING_SLOT_START; i < KEYRING_SLOT_END; i++) - for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) if (Bag* pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, i)) for (uint32 j = 0; j < pBag->GetBagSize(); j++) @@ -10043,14 +10023,6 @@ InventoryResult Player::CanUnequipItems(uint32 item, uint32 count) const return EQUIP_ERR_OK; } - for (uint8 i = KEYRING_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pItem->GetEntry() == item) - { - tempcount += pItem->GetCount(); - if (tempcount >= count) - return EQUIP_ERR_OK; - } for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) if (Bag* pBag = GetBagByPos(i)) @@ -10075,11 +10047,6 @@ uint32 Player::GetItemCount(uint32 item, bool inBankAlso, Item* skipItem) const if (pItem != skipItem && pItem->GetEntry() == item) count += pItem->GetCount(); - for (uint8 i = KEYRING_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pItem != skipItem && pItem->GetEntry() == item) - count += pItem->GetCount(); - for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) if (Bag* pBag = GetBagByPos(i)) count += pBag->GetItemCount(item, skipItem); @@ -10122,13 +10089,6 @@ uint32 Player::GetItemCountWithLimitCategory(uint32 limitCategory, Item* skipIte if (pProto->ItemLimitCategory == limitCategory) count += pItem->GetCount(); - for (int i = KEYRING_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pItem != skipItem) - if (ItemTemplate const* pProto = pItem->GetTemplate()) - if (pProto->ItemLimitCategory == limitCategory) - count += pItem->GetCount(); - for (int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) if (Bag* pBag = GetBagByPos(i)) count += pBag->GetItemCountWithLimitCategory(limitCategory, skipItem); @@ -10154,11 +10114,6 @@ Item* Player::GetItemByGuid(uint64 guid) const if (pItem->GetGUID() == guid) return pItem; - for (uint8 i = KEYRING_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pItem->GetGUID() == guid) - return pItem; - for (int i = BANK_SLOT_ITEM_START; i < BANK_SLOT_BAG_END; ++i) if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) if (pItem->GetGUID() == guid) @@ -10190,7 +10145,7 @@ Item* Player::GetItemByPos(uint16 pos) const Item* Player::GetItemByPos(uint8 bag, uint8 slot) const { - if (bag == INVENTORY_SLOT_BAG_0 && (slot < BANK_SLOT_BAG_END || (slot >= KEYRING_SLOT_START && slot < CURRENCYTOKEN_SLOT_END))) + if (bag == INVENTORY_SLOT_BAG_0 && slot < BANK_SLOT_BAG_END) return m_items[slot]; else if (Bag* pBag = GetBagByPos(bag)) return pBag->GetItemByPos(slot); @@ -10272,8 +10227,6 @@ bool Player::IsInventoryPos(uint8 bag, uint8 slot) return true; if (bag >= INVENTORY_SLOT_BAG_START && bag < INVENTORY_SLOT_BAG_END) return true; - if (bag == INVENTORY_SLOT_BAG_0 && (slot >= KEYRING_SLOT_START && slot < CURRENCYTOKEN_SLOT_END)) - return true; return false; } @@ -10332,10 +10285,6 @@ bool Player::IsValidPos(uint8 bag, uint8 slot, bool explicit_pos) if (slot >= INVENTORY_SLOT_ITEM_START && slot < INVENTORY_SLOT_ITEM_END) return true; - // keyring slots - if (slot >= KEYRING_SLOT_START && slot < KEYRING_SLOT_END) - return true; - // bank main slots if (slot >= BANK_SLOT_ITEM_START && slot < BANK_SLOT_ITEM_END) return true; @@ -10375,16 +10324,7 @@ bool Player::HasItemCount(uint32 item, uint32 count, bool inBankAlso) const return true; } } - for (uint8 i = KEYRING_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i) - { - Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i); - if (pItem && pItem->GetEntry() == item && !pItem->IsInTrade()) - { - tempcount += pItem->GetCount(); - if (tempcount >= count) - return true; - } - } + for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) { if (Bag* pBag = GetBagByPos(i)) @@ -10570,12 +10510,7 @@ bool Player::HasItemTotemCategory(uint32 TotemCategory) const if (pItem && IsTotemCategoryCompatiableWith(pItem->GetTemplate()->TotemCategory, TotemCategory)) return true; } - for (uint8 i = KEYRING_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i) - { - pItem = GetUseableItemByPos(INVENTORY_SLOT_BAG_0, i); - if (pItem && IsTotemCategoryCompatiableWith(pItem->GetTemplate()->TotemCategory, TotemCategory)) - return true; - } + for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) { if (Bag* pBag = GetBagByPos(i)) @@ -10609,14 +10544,6 @@ InventoryResult Player::CanStoreItem_InSpecificSlot(uint8 bag, uint8 slot, ItemP { if (bag == INVENTORY_SLOT_BAG_0) { - // keyring case - if (slot >= KEYRING_SLOT_START && slot < KEYRING_SLOT_START+GetMaxKeyringSize() && !(pProto->BagFamily & BAG_FAMILY_MASK_KEYS)) - return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG; - - // currencytoken case - if (slot >= CURRENCYTOKEN_SLOT_START && slot < CURRENCYTOKEN_SLOT_END && !(pProto->IsCurrencyToken())) - return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG; - // prevent cheating if ((slot >= BUYBACK_SLOT_START && slot < BUYBACK_SLOT_END) || slot >= PLAYER_SLOT_END) return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG; @@ -10862,24 +10789,6 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des { if (bag == INVENTORY_SLOT_BAG_0) // inventory { - res = CanStoreItem_InInventorySlots(KEYRING_SLOT_START, CURRENCYTOKEN_SLOT_END, dest, pProto, count, true, pItem, bag, slot); - if (res != EQUIP_ERR_OK) - { - if (no_space_count) - *no_space_count = count + no_similar_count; - return res; - } - - if (count == 0) - { - if (no_similar_count == 0) - return EQUIP_ERR_OK; - - if (no_space_count) - *no_space_count = count + no_similar_count; - return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS; - } - res = CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START, INVENTORY_SLOT_ITEM_END, dest, pProto, count, true, pItem, bag, slot); if (res != EQUIP_ERR_OK) { @@ -10927,67 +10836,6 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des // search free slot in bag for place to if (bag == INVENTORY_SLOT_BAG_0) // inventory { - // search free slot - keyring case - if (pProto->BagFamily & BAG_FAMILY_MASK_KEYS) - { - uint32 keyringSize = GetMaxKeyringSize(); - res = CanStoreItem_InInventorySlots(KEYRING_SLOT_START, KEYRING_SLOT_START+keyringSize, dest, pProto, count, false, pItem, bag, slot); - if (res != EQUIP_ERR_OK) - { - if (no_space_count) - *no_space_count = count + no_similar_count; - return res; - } - - if (count == 0) - { - if (no_similar_count == 0) - return EQUIP_ERR_OK; - - if (no_space_count) - *no_space_count = count + no_similar_count; - return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS; - } - - res = CanStoreItem_InInventorySlots(CURRENCYTOKEN_SLOT_START, CURRENCYTOKEN_SLOT_END, dest, pProto, count, false, pItem, bag, slot); - if (res != EQUIP_ERR_OK) - { - if (no_space_count) - *no_space_count = count + no_similar_count; - return res; - } - - if (count == 0) - { - if (no_similar_count == 0) - return EQUIP_ERR_OK; - - if (no_space_count) - *no_space_count = count + no_similar_count; - return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS; - } - } - else if (pProto->IsCurrencyToken()) - { - res = CanStoreItem_InInventorySlots(CURRENCYTOKEN_SLOT_START, CURRENCYTOKEN_SLOT_END, dest, pProto, count, false, pItem, bag, slot); - if (res != EQUIP_ERR_OK) - { - if (no_space_count) - *no_space_count = count + no_similar_count; - return res; - } - - if (count == 0) - { - if (no_similar_count == 0) - return EQUIP_ERR_OK; - - if (no_space_count) - *no_space_count = count + no_similar_count; - return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS; - } - } - res = CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START, INVENTORY_SLOT_ITEM_END, dest, pProto, count, false, pItem, bag, slot); if (res != EQUIP_ERR_OK) { @@ -11036,24 +10884,6 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des // search stack for merge to if (pProto->Stackable != 1) { - res = CanStoreItem_InInventorySlots(KEYRING_SLOT_START, CURRENCYTOKEN_SLOT_END, dest, pProto, count, true, pItem, bag, slot); - if (res != EQUIP_ERR_OK) - { - if (no_space_count) - *no_space_count = count + no_similar_count; - return res; - } - - if (count == 0) - { - if (no_similar_count == 0) - return EQUIP_ERR_OK; - - if (no_space_count) - *no_space_count = count + no_similar_count; - return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS; - } - res = CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START, INVENTORY_SLOT_ITEM_END, dest, pProto, count, true, pItem, bag, slot); if (res != EQUIP_ERR_OK) { @@ -11113,48 +10943,6 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des // search free slot - special bag case if (pProto->BagFamily) { - if (pProto->BagFamily & BAG_FAMILY_MASK_KEYS) - { - uint32 keyringSize = GetMaxKeyringSize(); - res = CanStoreItem_InInventorySlots(KEYRING_SLOT_START, KEYRING_SLOT_START+keyringSize, dest, pProto, count, false, pItem, bag, slot); - if (res != EQUIP_ERR_OK) - { - if (no_space_count) - *no_space_count = count + no_similar_count; - return res; - } - - if (count == 0) - { - if (no_similar_count == 0) - return EQUIP_ERR_OK; - - if (no_space_count) - *no_space_count = count + no_similar_count; - return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS; - } - } - else if (pProto->IsCurrencyToken()) - { - res = CanStoreItem_InInventorySlots(CURRENCYTOKEN_SLOT_START, CURRENCYTOKEN_SLOT_END, dest, pProto, count, false, pItem, bag, slot); - if (res != EQUIP_ERR_OK) - { - if (no_space_count) - *no_space_count = count + no_similar_count; - return res; - } - - if (count == 0) - { - if (no_similar_count == 0) - return EQUIP_ERR_OK; - - if (no_space_count) - *no_space_count = count + no_similar_count; - return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS; - } - } - for (uint32 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) { res = CanStoreItem_InBag(i, dest, pProto, count, false, false, pItem, bag, slot); @@ -11226,13 +11014,9 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const // fill space table int inv_slot_items[INVENTORY_SLOT_ITEM_END - INVENTORY_SLOT_ITEM_START]; int inv_bags[INVENTORY_SLOT_BAG_END - INVENTORY_SLOT_BAG_START][MAX_BAG_SIZE]; - int inv_keys[KEYRING_SLOT_END - KEYRING_SLOT_START]; - int inv_tokens[CURRENCYTOKEN_SLOT_END - CURRENCYTOKEN_SLOT_START]; memset(inv_slot_items, 0, sizeof(int) * (INVENTORY_SLOT_ITEM_END - INVENTORY_SLOT_ITEM_START)); memset(inv_bags, 0, sizeof(int) * (INVENTORY_SLOT_BAG_END - INVENTORY_SLOT_BAG_START) * MAX_BAG_SIZE); - memset(inv_keys, 0, sizeof(int) * (KEYRING_SLOT_END - KEYRING_SLOT_START)); - memset(inv_tokens, 0, sizeof(int) * (CURRENCYTOKEN_SLOT_END - CURRENCYTOKEN_SLOT_START)); for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++) { @@ -11241,20 +11025,6 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const inv_slot_items[i - INVENTORY_SLOT_ITEM_START] = pItem2->GetCount(); } - for (uint8 i = KEYRING_SLOT_START; i < KEYRING_SLOT_END; i++) - { - pItem2 = GetItemByPos(INVENTORY_SLOT_BAG_0, i); - if (pItem2 && !pItem2->IsInTrade()) - inv_keys[i - KEYRING_SLOT_START] = pItem2->GetCount(); - } - - for (uint8 i = CURRENCYTOKEN_SLOT_START; i < CURRENCYTOKEN_SLOT_END; i++) - { - pItem2 = GetItemByPos(INVENTORY_SLOT_BAG_0, i); - if (pItem2 && !pItem2->IsInTrade()) - inv_tokens[i - CURRENCYTOKEN_SLOT_START] = pItem2->GetCount(); - } - for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) if (Bag* pBag = GetBagByPos(i)) for (uint32 j = 0; j < pBag->GetBagSize(); j++) @@ -11300,32 +11070,6 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const { bool b_found = false; - for (uint8 t = KEYRING_SLOT_START; t < KEYRING_SLOT_END; ++t) - { - pItem2 = GetItemByPos(INVENTORY_SLOT_BAG_0, t); - if (pItem2 && pItem2->CanBeMergedPartlyWith(pProto) == EQUIP_ERR_OK && inv_keys[t-KEYRING_SLOT_START] + pItem->GetCount() <= pProto->GetMaxStackSize()) - { - inv_keys[t-KEYRING_SLOT_START] += pItem->GetCount(); - b_found = true; - break; - } - } - if (b_found) - continue; - - for (int t = CURRENCYTOKEN_SLOT_START; t < CURRENCYTOKEN_SLOT_END; ++t) - { - pItem2 = GetItemByPos(INVENTORY_SLOT_BAG_0, t); - if (pItem2 && pItem2->CanBeMergedPartlyWith(pProto) == EQUIP_ERR_OK && inv_tokens[t-CURRENCYTOKEN_SLOT_START] + pItem->GetCount() <= pProto->GetMaxStackSize()) - { - inv_tokens[t-CURRENCYTOKEN_SLOT_START] += pItem->GetCount(); - b_found = true; - break; - } - } - if (b_found) - continue; - for (int t = INVENTORY_SLOT_ITEM_START; t < INVENTORY_SLOT_ITEM_END; ++t) { pItem2 = GetItemByPos(INVENTORY_SLOT_BAG_0, t); @@ -11366,38 +11110,6 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const if (pProto->BagFamily) { bool b_found = false; - if (pProto->BagFamily & BAG_FAMILY_MASK_KEYS) - { - uint32 keyringSize = GetMaxKeyringSize(); - for (uint32 t = KEYRING_SLOT_START; t < KEYRING_SLOT_START+keyringSize; ++t) - { - if (inv_keys[t-KEYRING_SLOT_START] == 0) - { - inv_keys[t-KEYRING_SLOT_START] = 1; - b_found = true; - break; - } - } - } - - if (b_found) - continue; - - if (pProto->IsCurrencyToken()) - { - for (uint32 t = CURRENCYTOKEN_SLOT_START; t < CURRENCYTOKEN_SLOT_END; ++t) - { - if (inv_tokens[t-CURRENCYTOKEN_SLOT_START] == 0) - { - inv_tokens[t-CURRENCYTOKEN_SLOT_START] = 1; - b_found = true; - break; - } - } - } - - if (b_found) - continue; for (int t = INVENTORY_SLOT_BAG_START; !b_found && t < INVENTORY_SLOT_BAG_END; ++t) { @@ -11676,8 +11388,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest return EQUIP_ERR_DONT_OWN_THAT_ITEM; // Currency tokens are not supposed to be swapped out of their hidden bag - uint8 pItemslot = pItem->GetSlot(); - if (pItemslot >= CURRENCYTOKEN_SLOT_START && pItemslot < CURRENCYTOKEN_SLOT_END) + if(pItem->IsCurrencyToken()) { sLog->outError("Possible hacking attempt: Player %s [guid: %u] tried to move token [guid: %u, entry: %u] out of the currency bag!", GetName(), GetGUIDLow(), pItem->GetGUIDLow(), pProto->ItemId); @@ -12135,10 +11846,6 @@ Item* Player::_StoreItem(uint16 pos, Item* pItem, uint32 count, bool clone, bool pItem->SetSlot(slot); pItem->SetContainer(NULL); - - // need update known currency - if (slot >= CURRENCYTOKEN_SLOT_START && slot < CURRENCYTOKEN_SLOT_END) - AddKnownCurrency(pItem->GetEntry()); } else pBag->StoreItem(slot, pItem, update); @@ -12644,34 +12351,6 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ } } - for (uint8 i = KEYRING_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i) - { - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - { - if (pItem->GetEntry() == item && !pItem->IsInTrade()) - { - if (pItem->GetCount() + remcount <= count) - { - // all keys can be unequipped - remcount += pItem->GetCount(); - DestroyItem(INVENTORY_SLOT_BAG_0, i, update); - - if (remcount >= count) - return; - } - else - { - ItemRemovedQuestCheck(pItem->GetEntry(), count - remcount); - pItem->SetCount(pItem->GetCount() - count + remcount); - if (IsInWorld() && update) - pItem->SendUpdateToPlayer(this); - pItem->SetState(ITEM_CHANGED, this); - return; - } - } - } - } - // in inventory bags for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) { @@ -12749,11 +12428,6 @@ void Player::DestroyZoneLimitedItem(bool update, uint32 new_zone) if (pItem->IsLimitedToAnotherMapOrZone(GetMapId(), new_zone)) DestroyItem(INVENTORY_SLOT_BAG_0, i, update); - for (uint8 i = KEYRING_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pItem->IsLimitedToAnotherMapOrZone(GetMapId(), new_zone)) - DestroyItem(INVENTORY_SLOT_BAG_0, i, update); - // in inventory bags for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) if (Bag* pBag = GetBagByPos(i)) @@ -12804,11 +12478,6 @@ Item* Player::GetItemByEntry(uint32 entry) const if (pItem->GetEntry() == entry) return pItem; - for (uint8 i = KEYRING_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i) - if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - if (pItem->GetEntry() == entry) - return pItem; - for (int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) if (Bag* pBag = GetBagByPos(i)) for (uint32 j = 0; j < pBag->GetBagSize(); ++j) diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index d29d03e9df7..06ec352c6fa 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -563,7 +563,7 @@ enum PlayerSlots // first slot for item stored (in any way in player m_items data) PLAYER_SLOT_START = 0, // last+1 slot for item stored (in any way in player m_items data) - PLAYER_SLOT_END = 150, + PLAYER_SLOT_END = 86, PLAYER_SLOTS_COUNT = (PLAYER_SLOT_END - PLAYER_SLOT_START) }; @@ -625,18 +625,6 @@ enum BuyBackSlots // 12 slots BUYBACK_SLOT_END = 86 }; -enum KeyRingSlots // 32 slots -{ - KEYRING_SLOT_START = 86, - KEYRING_SLOT_END = 118 -}; - -enum CurrencyTokenSlots // 32 slots -{ - CURRENCYTOKEN_SLOT_START = 118, - CURRENCYTOKEN_SLOT_END = 150 -}; - enum EquipmentSetUpdateState { EQUIPMENT_SET_UNCHANGED = 0, @@ -1380,7 +1368,6 @@ class Player : public Unit, public GridObject void AddItemToBuyBackSlot(Item* pItem); Item* GetItemFromBuyBackSlot(uint32 slot); void RemoveItemFromBuyBackSlot(uint32 slot, bool del); - uint32 GetMaxKeyringSize() const { return KEYRING_SLOT_END-KEYRING_SLOT_START; } void SendEquipError(InventoryResult msg, Item* pItem, Item* pItem2 = NULL, uint32 itemid = 0); void SendBuyError(BuyResult msg, Creature* creature, uint32 item, uint32 param); void SendSellError(SellResult msg, Creature* creature, uint64 guid, uint32 param); -- cgit v1.2.3 From 3577afcfaf32985ec2cd433d16056db4d2a546b2 Mon Sep 17 00:00:00 2001 From: Nay Date: Fri, 3 Aug 2012 18:54:37 +0100 Subject: Core/WorldSession: Bypass assigned handler restriction if .debug send opcode command is used --- src/server/game/Server/WorldSession.cpp | 11 +++++++---- src/server/game/Server/WorldSession.h | 2 +- src/server/scripts/Commands/cs_debug.cpp | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index 518a3743d66..7e7d75b0428 100755 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -181,7 +181,7 @@ uint32 WorldSession::GetGuidLow() const } /// Send a packet to the client -void WorldSession::SendPacket(WorldPacket const* packet) +void WorldSession::SendPacket(WorldPacket const* packet, bool forced /*= false*/) { if (!m_Socket) return; @@ -192,10 +192,13 @@ void WorldSession::SendPacket(WorldPacket const* packet) return; } - if (!opcodeTable[packet->GetOpcode()]) + if (!forced) { - sLog->outError("Prevented sending disabled opcode %d (hex 0x%04X)", packet->GetOpcode(), packet->GetOpcode()); - return; + if (!opcodeTable[packet->GetOpcode()]) + { + sLog->outError("Prevented sending disabled opcode %d (hex 0x%04X)", packet->GetOpcode(), packet->GetOpcode()); + return; + } } #ifdef TRINITY_DEBUG diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 5a8a8da04aa..c0b2fb7e12b 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -236,7 +236,7 @@ class WorldSession void ReadMovementInfo(WorldPacket& data, MovementInfo* mi); void WriteMovementInfo(WorldPacket &data, MovementInfo* mi); - void SendPacket(WorldPacket const* packet); + void SendPacket(WorldPacket const* packet, bool forced = false); void SendNotification(const char *format, ...) ATTR_PRINTF(2, 3); void SendNotification(uint32 string_id, ...); void SendPetNameInvalid(uint32 error, const std::string& name, DeclinedName *declinedName); diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index 6accc96260b..874c7ab81b0 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -416,7 +416,7 @@ public: } sLog->outDebug(LOG_FILTER_NETWORKIO, "Sending opcode %u", data.GetOpcode()); data.hexlike(); - player->GetSession()->SendPacket(&data); + player->GetSession()->SendPacket(&data, true); handler->PSendSysMessage(LANG_COMMAND_OPCODESENT, data.GetOpcode(), unit->GetName()); return true; } -- cgit v1.2.3 From 12307c7d06011b3d64271af4bd4dfc08c348d7d2 Mon Sep 17 00:00:00 2001 From: Nay Date: Fri, 3 Aug 2012 22:39:04 +0100 Subject: Whitespace is the root of all evil --- src/server/authserver/Server/AuthSocket.cpp | 4 ++-- src/server/game/AI/EventAI/CreatureEventAIMgr.cpp | 2 +- src/server/game/Battlegrounds/BattlegroundMgr.cpp | 2 +- .../game/Battlegrounds/Zones/BattlegroundRV.cpp | 2 +- src/server/game/Chat/Chat.h | 2 +- src/server/game/Entities/Creature/GossipDef.cpp | 2 +- src/server/game/Entities/Item/Item.cpp | 6 +++--- src/server/game/Handlers/VoidStorageHandler.cpp | 8 ++++---- src/server/game/Miscellaneous/SharedDefines.h | 2 +- src/server/game/Scripting/ScriptSystem.cpp | 2 +- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- src/server/scripts/Commands/cs_cast.cpp | 2 +- src/server/scripts/Commands/cs_guild.cpp | 2 +- .../MagistersTerrace/instance_magisters_terrace.cpp | 20 ++++++++++---------- src/server/scripts/EasternKingdoms/undercity.cpp | 10 +++++----- .../BattleForMountHyjal/hyjal_trash.cpp | 2 +- src/server/scripts/Kalimdor/ashenvale.cpp | 2 +- src/server/scripts/Kalimdor/azshara.cpp | 6 +++--- src/server/scripts/Kalimdor/azuremyst_isle.cpp | 4 ++-- src/server/scripts/Kalimdor/felwood.cpp | 4 ++-- .../SerpentShrine/boss_lady_vashj.cpp | 4 ++-- src/server/shared/AutoPtr.h | 2 +- src/server/worldserver/worldserver.conf.dist | 8 ++++---- 23 files changed, 50 insertions(+), 50 deletions(-) (limited to 'src') diff --git a/src/server/authserver/Server/AuthSocket.cpp b/src/server/authserver/Server/AuthSocket.cpp index 2537a93fe43..4e4965c526f 100755 --- a/src/server/authserver/Server/AuthSocket.cpp +++ b/src/server/authserver/Server/AuthSocket.cpp @@ -868,10 +868,10 @@ bool AuthSocket::_HandleRealmList() ++RealmListSize; } - + pkt << uint8(0x10); pkt << uint8(0x00); - + // make a ByteBuffer which stores the RealmList's size ByteBuffer RealmListSizeBuffer; diff --git a/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp b/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp index a863f2f89cf..d95074d9052 100755 --- a/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp +++ b/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp @@ -211,7 +211,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() sLog->outErrorDb("CreatureEventAI: Event %u has script for non-existing creature entry (%u), skipping.", i, creature_id); continue; } - + // Only on the first script if (cInfo->AIName != "EventAI" && m_CreatureEventAI_Event_Map[creature_id].empty()) sLog->outErrorDb("Creature entry %u has EventAI scripts, but its AIName is not 'EventAI' - possible AI-mismatch?", temp.creature_id); diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index 0d4fc458faa..8205c30dd1e 100755 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -772,7 +772,7 @@ void BattlegroundMgr::CreateInitialBattlegrounds() } data.StartMaxDist = fields[9].GetFloat(); - + selectionWeight = fields[10].GetUInt8(); data.scriptId = sObjectMgr->GetScriptId(fields[11].GetCString()); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp index 6869a899305..2b8f5925265 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp @@ -245,6 +245,6 @@ void BattlegroundRV::TogglePillarCollision() gob->SendUpdateToPlayer(player); } } - + SetPillarCollision(!apply); } \ No newline at end of file diff --git a/src/server/game/Chat/Chat.h b/src/server/game/Chat/Chat.h index af06b4f760a..95f14bc2a3a 100755 --- a/src/server/game/Chat/Chat.h +++ b/src/server/game/Chat/Chat.h @@ -123,7 +123,7 @@ class ChatHandler void SetSentErrorMessage(bool val){ sentErrorMessage = val; } static bool LoadCommandTable() { return load_command_table; } static void SetLoadCommandTable(bool val) { load_command_table = val; } - + // cs_character void HandleCharacterLevel(Player* player, uint64 playerGuid, uint32 oldLevel, uint32 newLevel); diff --git a/src/server/game/Entities/Creature/GossipDef.cpp b/src/server/game/Entities/Creature/GossipDef.cpp index 21c5aa38a19..e2f5ad99b78 100755 --- a/src/server/game/Entities/Creature/GossipDef.cpp +++ b/src/server/game/Entities/Creature/GossipDef.cpp @@ -339,7 +339,7 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, uint64 npcGUID, data << uint32(quest->GetRequiredSpell()); // 4.x quest->BuildExtraQuestInfo(data, _session->GetPlayer()); - + data << uint32(QUEST_EMOTE_COUNT); for (uint8 i = 0; i < QUEST_EMOTE_COUNT; ++i) { diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index 9c5d03f5440..4dff83ec4a5 100755 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -1435,7 +1435,7 @@ uint32 Item::GetTransmogrifyCost() const { bool normalPrice; cost = GetSellPrice(normalPrice); - + if (!normalPrice) { if (proto->BuyCount <= 1) @@ -1452,9 +1452,9 @@ uint32 Item::GetTransmogrifyCost() const else cost = proto->SellPrice; } - + if (cost < 10000) cost = 10000; - + return cost; } diff --git a/src/server/game/Handlers/VoidStorageHandler.cpp b/src/server/game/Handlers/VoidStorageHandler.cpp index 5e3ecc89e21..d937656cf31 100644 --- a/src/server/game/Handlers/VoidStorageHandler.cpp +++ b/src/server/game/Handlers/VoidStorageHandler.cpp @@ -161,7 +161,7 @@ void WorldSession::HandleVoidStorageQuery(WorldPacket& recvData) itemData.WriteByteSeq(itemId[0]); itemData.WriteByteSeq(itemId[6]); itemData.WriteByteSeq(creatorGuid[0]); - + itemData << uint32(item->ItemRandomPropertyId); itemData.WriteByteSeq(itemId[4]); @@ -196,7 +196,7 @@ void WorldSession::HandleVoidStorageTransfer(WorldPacket& recvData) npcGuid[1] = recvData.ReadBit(); uint32 countDeposit = recvData.ReadBits(26); - + if (countDeposit > 9) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleVoidStorageTransfer - Player (GUID: %u, name: %s) wants to deposit more than 9 items (%u).", player->GetGUIDLow(), player->GetName(), countDeposit); @@ -462,7 +462,7 @@ void WorldSession::HandleVoidStorageTransfer(WorldPacket& recvData) data.WriteByteSeq(itemId[1]); data << uint32(depositItems[i].second); // slot - + data.WriteByteSeq(creatorGuid[2]); data.WriteByteSeq(itemId[7]); @@ -518,7 +518,7 @@ void WorldSession::HandleVoidSwapItem(WorldPacket& recvData) recvData.ReadByteSeq(npcGuid[7]); recvData.ReadByteSeq(npcGuid[4]); recvData.ReadByteSeq(itemId[7]); - + Creature* unit = player->GetNPCIfCanInteractWith(npcGuid, UNIT_NPC_FLAG_VAULTKEEPER); if (!unit) { diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index e17bbc0729f..bd3fffe47e4 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -3530,7 +3530,7 @@ enum TradeStatus // 28 - nonexistent TRADE_STATUS_TARGET_STUNNED = 29, // 30 - nonexistent - TRADE_STATUS_CLOSE_WINDOW = 31, + TRADE_STATUS_CLOSE_WINDOW = 31, }; enum XPColorChar diff --git a/src/server/game/Scripting/ScriptSystem.cpp b/src/server/game/Scripting/ScriptSystem.cpp index c38d559372f..e48404b0643 100755 --- a/src/server/game/Scripting/ScriptSystem.cpp +++ b/src/server/game/Scripting/ScriptSystem.cpp @@ -30,7 +30,7 @@ void SystemMgr::LoadScriptTexts() sLog->outString("TSCR: Loading Script Texts additional data..."); uint32 oldMSTime = getMSTime(); - + // 0 1 2 3 QueryResult result = WorldDatabase.Query("SELECT entry, sound, type, language, emote FROM script_texts"); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 2e3ccf00e60..b280a59d1b4 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -1098,7 +1098,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_LOTTERY_RESULT_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MAIL_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_MEMBER_ADDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_SETQUEUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_SETQUEUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MESSAGECHAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MINIGAME_MOVE_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MINIGAME_SETUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/scripts/Commands/cs_cast.cpp b/src/server/scripts/Commands/cs_cast.cpp index 33983411427..70cfb8cb830 100644 --- a/src/server/scripts/Commands/cs_cast.cpp +++ b/src/server/scripts/Commands/cs_cast.cpp @@ -33,7 +33,7 @@ public: ChatCommand* GetCommands() const { static ChatCommand castCommandTable[] = - { + { { "back", SEC_ADMINISTRATOR, false, &HandleCastBackCommand, "", NULL }, { "dist", SEC_ADMINISTRATOR, false, &HandleCastDistCommand, "", NULL }, { "self", SEC_ADMINISTRATOR, false, &HandleCastSelfCommand, "", NULL }, diff --git a/src/server/scripts/Commands/cs_guild.cpp b/src/server/scripts/Commands/cs_guild.cpp index 65e3daaaebc..a453122aef6 100644 --- a/src/server/scripts/Commands/cs_guild.cpp +++ b/src/server/scripts/Commands/cs_guild.cpp @@ -51,7 +51,7 @@ public: }; return commandTable; } - + /** \brief GM command level 3 - Create a guild. * * This command allows a GM (level 3) to create a guild. diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp index aa43cb3702f..6545509c0f1 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp @@ -218,25 +218,25 @@ public: { switch (identifier) { - case DATA_SELIN: + case DATA_SELIN: return SelinGUID; - case DATA_DELRISSA: + case DATA_DELRISSA: return DelrissaGUID; - case DATA_VEXALLUS_DOOR: + case DATA_VEXALLUS_DOOR: return VexallusDoorGUID; - case DATA_SELIN_DOOR: + case DATA_SELIN_DOOR: return SelinDoorGUID; - case DATA_SELIN_ENCOUNTER_DOOR: + case DATA_SELIN_ENCOUNTER_DOOR: return SelinEncounterDoorGUID; - case DATA_DELRISSA_DOOR: + case DATA_DELRISSA_DOOR: return DelrissaDoorGUID; - case DATA_KAEL_DOOR: + case DATA_KAEL_DOOR: return KaelDoorGUID; - case DATA_KAEL_STATUE_LEFT: + case DATA_KAEL_STATUE_LEFT: return KaelStatue[0]; - case DATA_KAEL_STATUE_RIGHT: + case DATA_KAEL_STATUE_RIGHT: return KaelStatue[1]; - case DATA_ESCAPE_ORB: + case DATA_ESCAPE_ORB: return EscapeOrbGUID; case DATA_FEL_CRYSTAL: diff --git a/src/server/scripts/EasternKingdoms/undercity.cpp b/src/server/scripts/EasternKingdoms/undercity.cpp index a9b627ded34..7649be59e40 100644 --- a/src/server/scripts/EasternKingdoms/undercity.cpp +++ b/src/server/scripts/EasternKingdoms/undercity.cpp @@ -173,13 +173,13 @@ public: if (me->GetDistance(victim) > 10.0f) DoCast(victim, SPELL_MULTI_SHOT); } else FadeTimer -= diff; - + if (SummonSkeletonTimer <= diff) { DoCast(me, SPELL_SUMMON_SKELETON); SummonSkeletonTimer = 20000 + rand()%10000; } else SummonSkeletonTimer -= diff; - + if (BlackArrowTimer <= diff) { if (Unit* victim = me->getVictim()) @@ -188,7 +188,7 @@ public: BlackArrowTimer = 15000 + rand()%5000; } } else BlackArrowTimer -= diff; - + if (ShotTimer <= diff) { if (Unit* victim = me->getVictim()) @@ -197,7 +197,7 @@ public: ShotTimer = 8000 + rand()%2000; } } else ShotTimer -= diff; - + if (MultiShotTimer <= diff) { if (Unit* victim = me->getVictim()) @@ -205,7 +205,7 @@ public: DoCast(victim, SPELL_MULTI_SHOT); MultiShotTimer = 10000 + rand()%3000; } - } else MultiShotTimer -= diff; + } else MultiShotTimer -= diff; DoMeleeAttackIfReady(); } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp index d3218e1729e..01c1617aba4 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp @@ -38,7 +38,7 @@ enum Spells SPELL_BANSHEE_CURSE = 31651, SPELL_BANSHEE_WAIL = 38183, SPELL_ANTI_MAGIC_SHELL = 31662, - SPELL_WEB = 28991, + SPELL_WEB = 28991, SPELL_MANA_BURN = 31729, SPELL_FROST_BREATH = 31688, SPELL_GARGOYLE_STRIKE = 31664, diff --git a/src/server/scripts/Kalimdor/ashenvale.cpp b/src/server/scripts/Kalimdor/ashenvale.cpp index 9e8cdaa8b92..248932ecbb6 100644 --- a/src/server/scripts/Kalimdor/ashenvale.cpp +++ b/src/server/scripts/Kalimdor/ashenvale.cpp @@ -174,7 +174,7 @@ enum RuulSnowhoof NPC_THISTLEFUR_URSA = 3921, NPC_THISTLEFUR_TOTEMIC = 3922, NPC_THISTLEFUR_PATHFINDER = 3926, - + QUEST_FREEDOM_TO_RUUL = 6482, GO_CAGE = 178147 diff --git a/src/server/scripts/Kalimdor/azshara.cpp b/src/server/scripts/Kalimdor/azshara.cpp index eae5baa8db2..8d08c26f0a7 100644 --- a/src/server/scripts/Kalimdor/azshara.cpp +++ b/src/server/scripts/Kalimdor/azshara.cpp @@ -182,9 +182,9 @@ public: enum RizzleSprysprocketData { QUEST_CHASING_THE_MOONSTONE = 10994, - + MOB_DEPTH_CHARGE = 23025, - + SPELL_RIZZLE_BLACKJACK = 39865, SPELL_RIZZLE_ESCAPE = 39871, SPELL_RIZZLE_FROST_GRENADE = 40525, @@ -490,7 +490,7 @@ public: { if (WeMustDieTimer <= diff) me->DespawnOrUnsummon(); - else + else WeMustDieTimer -= diff; } return; diff --git a/src/server/scripts/Kalimdor/azuremyst_isle.cpp b/src/server/scripts/Kalimdor/azuremyst_isle.cpp index 608117ca9af..22686cac4b2 100644 --- a/src/server/scripts/Kalimdor/azuremyst_isle.cpp +++ b/src/server/scripts/Kalimdor/azuremyst_isle.cpp @@ -549,7 +549,7 @@ public: (*itr)->Respawn(); } } - else + else sLog->outError("SD2 ERROR: FlagList is empty!"); } @@ -560,7 +560,7 @@ public: if (EventStarted) SayTimer = NextStep(Step++); } - else + else SayTimer -= diff; } }; diff --git a/src/server/scripts/Kalimdor/felwood.cpp b/src/server/scripts/Kalimdor/felwood.cpp index 9243ea0017e..1a0aa7b21c0 100644 --- a/src/server/scripts/Kalimdor/felwood.cpp +++ b/src/server/scripts/Kalimdor/felwood.cpp @@ -40,10 +40,10 @@ EndContentData */ enum RiverbreezeAndSilversky { SPELL_CENARION_BEACON = 15120, - + NPC_ARATHANDRIS_SILVERSKY = 9528, NPC_MAYBESS_RIVERBREEZE = 9529, - + QUEST_CLEASING_FELWOOD_A = 4101, QUEST_CLEASING_FELWOOD_H = 4102 }; diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp index 18d8b2b5a1e..e70157e5e4f 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp @@ -199,7 +199,7 @@ public: JustCreated = false; } else CanAttack = true; - + for (uint8 i = 0; i < 4; ++i) if (Unit* remo = Unit::GetUnit(*me, ShieldGeneratorChannel[i])) remo->setDeathState(JUST_DIED); @@ -353,7 +353,7 @@ public: // Static Charge // Used on random people (only 1 person at any given time) in Phases 1 and 3, it's a debuff doing 2775 to 3225 Nature damage to the target and everybody in about 5 yards around it, every 1 seconds for 30 seconds. It can be removed by Cloak of Shadows, Iceblock, Divine Shield, etc, but not by Cleanse or Dispel Magic. Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 200, true); - if (target && !target->HasAura(SPELL_STATIC_CHARGE_TRIGGER)) + if (target && !target->HasAura(SPELL_STATIC_CHARGE_TRIGGER)) DoCast(target, SPELL_STATIC_CHARGE_TRIGGER); // cast Static Charge every 2 seconds for 20 seconds StaticChargeTimer = 10000+rand()%20000; diff --git a/src/server/shared/AutoPtr.h b/src/server/shared/AutoPtr.h index 988c46cc5a2..19f0680c267 100644 --- a/src/server/shared/AutoPtr.h +++ b/src/server/shared/AutoPtr.h @@ -27,7 +27,7 @@ namespace Trinity { public: AutoPtr() : ACE_Strong_Bound_Ptr() {} - + AutoPtr(Pointer* x) { ACE_Strong_Bound_Ptr::reset(x); diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index 65ba2350775..71ec75ea678 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -1490,7 +1490,7 @@ Warden.ClientCheckHoldOff = 30 # # Warden.ClientCheckFailAction # Description: Default action being taken if a client check failed. Actions can be -# overwritten for each single check via warden_action table in characters +# overwritten for each single check via warden_action table in characters # database. # Default: 0 - (Disabled, Logging only) # 1 - (Kick) @@ -2253,9 +2253,9 @@ Rate.MoveSpeed = 1 # # Rate.InstanceResetTime -# Description: Multiplier for the rate between global raid/heroic instance resets -# (dbc value). Higher value increases the time between resets, -# lower value lowers the time, you need clean instance_reset in +# Description: Multiplier for the rate between global raid/heroic instance resets +# (dbc value). Higher value increases the time between resets, +# lower value lowers the time, you need clean instance_reset in # characters db in order to let new values work. # Default: 1 -- cgit v1.2.3 From 48db4b2b7da984258fede9cfa13ea8c0ea2dc788 Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 4 Aug 2012 01:39:18 +0100 Subject: Core/PacketIO: Fix and enable SMSG_MESSAGECHAT TODO: - Send addon prefix in this packet when language is Addon - Cleanup uses of SMSG_MESSAGECHAT (17 different "handlers" for it is not okay) (long term) - Missing a CMSG_MESSAGECHAT_ADDON_x or two --- src/server/game/Battlegrounds/Battleground.cpp | 2 ++ src/server/game/Chat/Chat.cpp | 7 +++++++ src/server/game/Entities/Object/Object.cpp | 2 ++ src/server/game/Entities/Player/Player.cpp | 2 +- src/server/game/Handlers/ItemHandler.cpp | 11 ++++++----- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- 6 files changed, 19 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index b8f4d7de3c0..4444f1860e4 100755 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -1721,6 +1721,8 @@ void Battleground::SendWarningToAll(int32 entry, ...) data << (uint32)(msg.length() + 1); data << msg.c_str(); data << (uint8)0; + data << (float)0.0f; // added in 4.2.0, unk + data << (uint8)0; // added in 4.2.0, unk for (BattlegroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr) if (Player* player = ObjectAccessor::FindPlayer(MAKE_NEW_GUID(itr->first, 0, HIGHGUID_PLAYER))) if (player->GetSession()) diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index 65cdca70aba..8a6b668b7f2 100755 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -801,6 +801,13 @@ void ChatHandler::FillMessageData(WorldPacket* data, WorldSession* session, uint *data << uint32(messageLength); *data << message; *data << uint8(0); + + if (type == CHAT_MSG_RAID_BOSS_WHISPER || type == CHAT_MSG_RAID_BOSS_EMOTE) + { + *data << float(0.0f); // Added in 4.2.0, unk + *data << uint8(0); // Added in 4.2.0, unk + } + return; } default: diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 9f386a54246..0baec0c2e95 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -2279,6 +2279,8 @@ void WorldObject::BuildMonsterChat(WorldPacket* data, uint8 msgtype, char const* *data << (uint32)(strlen(text)+1); *data << text; *data << (uint8)0; // ChatTag + *data << (float)0.0f; // added in 4.2.0, unk + *data << (uint8)0; // added in 4.2.0, unk } void Unit::BuildHeartBeatMsg(WorldPacket* data) const diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index f729fe1502f..2b08ffb38d8 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -20051,7 +20051,7 @@ inline void Player::BuildPlayerChat(WorldPacket* data, uint8 msgtype, const std: *data << uint8(msgtype); *data << uint32(language); *data << uint64(GetGUID()); - *data << uint32(language); //language 2.1.0 ? + *data << uint32(0); // constant unknown time *data << uint64(GetGUID()); *data << uint32(text.length() + 1); *data << text; diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 18859e766d1..ce5729a7b40 100755 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -1619,13 +1619,14 @@ void WorldSession::HandleTransmogrifyItems(WorldPacket& recvData) cost += itemTransmogrified->GetTransmogrifyCost(); } - - // trusting the client, if it got here it has to have enough money - // ... unless client was modified - if (cost) // 0 cost if reverting look - player->ModifyMoney(-cost); } + // trusting the client, if it got here it has to have enough money + // ... unless client was modified + if (cost) // 0 cost if reverting look + player->ModifyMoney(-cost); + + delete[] itemGuids; delete[] newEntries; delete[] slots; diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index b280a59d1b4..3173142c96a 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -1099,7 +1099,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_MAIL_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_MEMBER_ADDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_SETQUEUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MESSAGECHAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MESSAGECHAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MINIGAME_MOVE_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MINIGAME_SETUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MINIGAME_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From 17e852d9b3c7a28a66934e7ec9d7ab00a770d06d Mon Sep 17 00:00:00 2001 From: Subv Date: Fri, 3 Aug 2012 20:47:09 -0500 Subject: Items/Reforge: Partially implemented reforge, still ToDo: Apply real stat modifiers to the player --- src/server/game/DataStores/DBCStores.cpp | 2 + src/server/game/DataStores/DBCStores.h | 1 + src/server/game/DataStores/DBCStructure.h | 9 ++++ src/server/game/DataStores/DBCfmt.h | 1 + src/server/game/Entities/Item/Item.cpp | 6 +-- src/server/game/Entities/Item/Item.h | 4 +- src/server/game/Handlers/ItemHandler.cpp | 82 ++++++++++++++++++++++++++++- src/server/game/Server/Protocol/Opcodes.cpp | 2 + src/server/game/Server/WorldSession.h | 4 ++ 9 files changed, 105 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index a9de83d3f80..35ed42f73a9 100755 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -115,6 +115,7 @@ DBCStorage sImportPriceQualityStore(ImportPriceQu DBCStorage sImportPriceShieldStore(ImportPriceShieldfmt); DBCStorage sImportPriceWeaponStore(ImportPriceWeaponfmt); DBCStorage sItemPriceBaseStore(ItemPriceBasefmt); +DBCStorage sItemReforgeStore(ItemReforgefmt); DBCStorage sItemArmorQualityStore(ItemArmorQualityfmt); DBCStorage sItemArmorShieldStore(ItemArmorShieldfmt); DBCStorage sItemArmorTotalStore(ItemArmorTotalfmt); @@ -402,6 +403,7 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sImportPriceShieldStore, dbcPath, "ImportPriceShield.dbc"); // 15595 LoadDBC(availableDbcLocales, bad_dbc_files, sImportPriceWeaponStore, dbcPath, "ImportPriceWeapon.dbc"); // 15595 LoadDBC(availableDbcLocales, bad_dbc_files, sItemPriceBaseStore, dbcPath, "ItemPriceBase.dbc"); // 15595 + LoadDBC(availableDbcLocales, bad_dbc_files, sItemReforgeStore, dbcPath, "ItemReforge.dbc"); // 15595 LoadDBC(availableDbcLocales, bad_dbc_files, sItemBagFamilyStore, dbcPath, "ItemBagFamily.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sItemClassStore, dbcPath, "ItemClass.dbc"); // 15595 //LoadDBC(dbcCount, availableDbcLocales, bad_dbc_files, sItemDisplayInfoStore, dbcPath, "ItemDisplayInfo.dbc"); -- not used currently diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h index 252d8c53d92..7cc97f16b18 100755 --- a/src/server/game/DataStores/DBCStores.h +++ b/src/server/game/DataStores/DBCStores.h @@ -126,6 +126,7 @@ extern DBCStorage sImportPriceQualityStore; extern DBCStorage sImportPriceShieldStore; extern DBCStorage sImportPriceWeaponStore; extern DBCStorage sItemPriceBaseStore; +extern DBCStorage sItemReforgeStore; extern DBCStorage sItemArmorQualityStore; extern DBCStorage sItemArmorShieldStore; extern DBCStorage sItemArmorTotalStore; diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 1a9c7b16398..ce25b54ce0d 100755 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -1192,6 +1192,15 @@ struct ItemPriceBaseEntry float WeaponFactor; // 4 Price factor for weapons }; +struct ItemReforgeEntry +{ + uint32 Id; + uint32 FinalStat; + float FinalMultiplier; + uint32 SourceStat; + float SourceMultiplier; +}; + // common struct for: // ItemDamageAmmo.dbc // ItemDamageOneHand.dbc diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index 03521512c99..3c68066c97b 100755 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -83,6 +83,7 @@ const char ImportPriceQualityfmt[]="nf"; const char ImportPriceShieldfmt[]="nf"; const char ImportPriceWeaponfmt[]="nf"; const char ItemPriceBasefmt[]="diff"; +const char ItemReforgefmt[]="nifif"; const char ItemBagFamilyfmt[]="nx"; const char ItemArmorQualityfmt[]="nfffffffi"; const char ItemArmorShieldfmt[]="nifffffff"; diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index 4dff83ec4a5..f0cd629b5e3 100755 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -1424,7 +1424,7 @@ uint32 Item::GetSellPrice(bool& normalSellPrice) const } } -uint32 Item::GetTransmogrifyCost() const +uint32 Item::GetSpecialPrice(uint32 minimumPrice) const { ItemTemplate const* proto = GetTemplate(); uint32 cost = 0; @@ -1453,8 +1453,8 @@ uint32 Item::GetTransmogrifyCost() const cost = proto->SellPrice; } - if (cost < 10000) - cost = 10000; + if (cost < minimumPrice) + cost = minimumPrice; return cost; } diff --git a/src/server/game/Entities/Item/Item.h b/src/server/game/Entities/Item/Item.h index 2d5ebaa555f..e8bf234c591 100755 --- a/src/server/game/Entities/Item/Item.h +++ b/src/server/game/Entities/Item/Item.h @@ -163,7 +163,7 @@ enum EnchantmentSlot BONUS_ENCHANTMENT_SLOT = 5, PRISMATIC_ENCHANTMENT_SLOT = 6, // added at apply special permanent enchantment //TODO: 7, - //TODO: 8, + REFORGE_ENCHANTMENT_SLOT = 8, TRANSMOGRIFY_ENCHANTMENT_SLOT = 9, MAX_INSPECTED_ENCHANTMENT_SLOT = 10, @@ -350,7 +350,7 @@ class Item : public Object bool CanBeTransmogrified() const; bool CanTransmogrify() const; static bool CanTransmogrifyItemWithItem(Item const* transmogrified, Item const* transmogrifier); - uint32 GetTransmogrifyCost() const; + uint32 GetSpecialPrice(uint32 minimumPrice = 10000) const; uint32 GetVisibleEntry() const { diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index ce5729a7b40..4b349857c96 100755 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -1617,7 +1617,7 @@ void WorldSession::HandleTransmogrifyItems(WorldPacket& recvData) itemTransmogrifier->SetNotRefundable(player); itemTransmogrifier->ClearSoulboundTradeable(player); - cost += itemTransmogrified->GetTransmogrifyCost(); + cost += itemTransmogrified->GetSpecialPrice(); } } @@ -1631,3 +1631,83 @@ void WorldSession::HandleTransmogrifyItems(WorldPacket& recvData) delete[] newEntries; delete[] slots; } + +void WorldSession::SendReforgeResult(bool success) +{ + WorldPacket data(SMSG_REFORGE_RESULT, 1); + data.WriteBit(success); + SendPacket(&data); +} + +void WorldSession::HandleReforgeItemOpcode(WorldPacket& recvData) +{ + uint32 slot, reforgeEntry; + ObjectGuid guid; + uint32 bag; + Player* player = GetPlayer(); + + recvData >> reforgeEntry >> slot >> bag; + + guid[2] = recvData.ReadBit(); + guid[6] = recvData.ReadBit(); + guid[3] = recvData.ReadBit(); + guid[4] = recvData.ReadBit(); + guid[1] = recvData.ReadBit(); + guid[0] = recvData.ReadBit(); + guid[7] = recvData.ReadBit(); + guid[5] = recvData.ReadBit(); + + recvData.ReadByteSeq(guid[2]); + recvData.ReadByteSeq(guid[3]); + recvData.ReadByteSeq(guid[6]); + recvData.ReadByteSeq(guid[4]); + recvData.ReadByteSeq(guid[1]); + recvData.ReadByteSeq(guid[0]); + recvData.ReadByteSeq(guid[7]); + recvData.ReadByteSeq(guid[5]); + + if (!player->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_REFORGER)) + { + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleReforgeItemOpcode - Unit (GUID: %u) not found or player can't interact with it.", GUID_LOPART(guid)); + SendReforgeResult(false); + return; + } + + Item* item = player->GetItemByPos(bag, slot); + + if (!item) + { + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleReforgeItemOpcode - Player (Guid: %u Name: %s) tried to reforge an invalid/non-existant item.", player->GetGUIDLow(), player->GetName()); + SendReforgeResult(false); + return; + } + + if (!reforgeEntry) + { + // Reset the item + item->ClearEnchantment(REFORGE_ENCHANTMENT_SLOT); + SendReforgeResult(true); + return; + } + + if (!sItemReforgeStore.LookupEntry(reforgeEntry)) + { + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleReforgeItemOpcode - Player (Guid: %u Name: %s) tried to reforge an item with invalid reforge entry (%u).", player->GetGUIDLow(), player->GetName(), reforgeEntry); + SendReforgeResult(false); + return; + } + + if (player->HasEnoughMoney(item->GetSpecialPrice())) // cheating + { + SendReforgeResult(false); + return; + } + + player->ModifyMoney(-int64(item->GetSpecialPrice())); + + item->SetEnchantment(REFORGE_ENCHANTMENT_SLOT, reforgeEntry, 0, 0); + + SendReforgeResult(true); + + // ToDo: Apply and remove the destination/source stats to the player +} diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 3173142c96a..f4ed1b1df0b 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -532,6 +532,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_REDIRECTION_AUTH_PROOF, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_REDIRECTION_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_REFER_A_FRIEND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_REFORGE_ITEM, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleReforgeItemOpcode ); + DEFINE_OPCODE_HANDLER(SMSG_REFORGE_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_REMOVE_GLYPH, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRemoveGlyph ); //DEFINE_OPCODE_HANDLER(CMSG_REPAIR_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepairItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_REPOP_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepopRequestOpcode ); diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index c0b2fb7e12b..d957d9ec8db 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -921,6 +921,10 @@ class WorldSession // Transmogrification void HandleTransmogrifyItems(WorldPacket& recvData); + + // Reforge + void HandleReforgeItemOpcode(WorldPacket& recvData); + void SendReforgeResult(bool success); // Miscellaneous void HandleSpellClick(WorldPacket& recv_data); -- cgit v1.2.3 From fb7015d0dc137baeef3a64c43e536e06365f29db Mon Sep 17 00:00:00 2001 From: cyberbrest Date: Sat, 4 Aug 2012 13:19:22 +0300 Subject: [PacketIO] castbar. --- src/server/game/Spells/Spell.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 6ce3fc2c228..cbc59e8f740 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3877,8 +3877,8 @@ void Spell::SendSpellStart() data << uint8(m_cast_count); // pending spell cast? data << uint32(m_spellInfo->Id); // spellId data << uint32(castFlags); // cast flags - data << int32(m_timer); // delay? - data << uint32(0); + data << uint32(m_timer); // delay? + data << uint32(m_casttime); m_targets.Write(data); -- cgit v1.2.3 From 5518daa74b6db8852ca000ee4e3a3fee0418596b Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 4 Aug 2012 15:58:09 +0100 Subject: Core/Chat: Send addon prefix in addon messages Correct structure of some CMSG_MESSAGECHAT_ADDON_x opcodes Fix a compile error in HandleReforgeItemOpcode --- src/server/game/Chat/Chat.cpp | 11 ++++-- src/server/game/Chat/Chat.h | 2 +- src/server/game/Entities/Player/Player.cpp | 39 ++++++++++---------- src/server/game/Entities/Player/Player.h | 3 +- src/server/game/Guilds/Guild.cpp | 14 ++++++++ src/server/game/Guilds/Guild.h | 1 + src/server/game/Handlers/ChatHandler.cpp | 57 ++++++++++++++++++++---------- src/server/game/Handlers/ItemHandler.cpp | 2 +- 8 files changed, 86 insertions(+), 43 deletions(-) (limited to 'src') diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index 8a6b668b7f2..b95b5f41921 100755 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -747,7 +747,7 @@ bool ChatHandler::ShowHelpForCommand(ChatCommand* table, const char* cmd) } //Note: target_guid used only in CHAT_MSG_WHISPER_INFORM mode (in this case channelName ignored) -void ChatHandler::FillMessageData(WorldPacket* data, WorldSession* session, uint8 type, uint32 language, const char *channelName, uint64 target_guid, const char *message, Unit* speaker) +void ChatHandler::FillMessageData(WorldPacket* data, WorldSession* session, uint8 type, uint32 language, const char *channelName, uint64 target_guid, const char *message, Unit* speaker, const char* addonPrefix /*= NULL*/) { uint32 messageLength = (message ? strlen(message) : 0) + 1; @@ -823,9 +823,16 @@ void ChatHandler::FillMessageData(WorldPacket* data, WorldSession* session, uint { ASSERT(channelName); *data << channelName; + *data << uint64(target_guid); } + else if (type == CHAT_MSG_ADDON) + { + ASSERT(addonPrefix); + *data << addonPrefix; + } + else + *data << uint64(target_guid); - *data << uint64(target_guid); *data << uint32(messageLength); *data << message; if (session != 0 && type != CHAT_MSG_WHISPER_INFORM && type != CHAT_MSG_DND && type != CHAT_MSG_AFK) diff --git a/src/server/game/Chat/Chat.h b/src/server/game/Chat/Chat.h index 95f14bc2a3a..84a2b601472 100755 --- a/src/server/game/Chat/Chat.h +++ b/src/server/game/Chat/Chat.h @@ -51,7 +51,7 @@ class ChatHandler explicit ChatHandler(Player* player) : m_session(player->GetSession()) {} virtual ~ChatHandler() {} - static void FillMessageData(WorldPacket* data, WorldSession* session, uint8 type, uint32 language, const char *channelName, uint64 target_guid, const char *message, Unit* speaker); + static void FillMessageData(WorldPacket* data, WorldSession* session, uint8 type, uint32 language, const char *channelName, uint64 target_guid, const char *message, Unit* speaker, const char* addonPrefix = NULL); void FillMessageData(WorldPacket* data, uint8 type, uint32 language, uint64 target_guid, const char* message) { diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 2b08ffb38d8..6b786b79985 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -20046,13 +20046,16 @@ void Player::StopCastingCharm() } } -inline void Player::BuildPlayerChat(WorldPacket* data, uint8 msgtype, const std::string& text, uint32 language) const +inline void Player::BuildPlayerChat(WorldPacket* data, uint8 msgtype, const std::string& text, uint32 language, const char* addonPrefix /*= NULL*/) const { *data << uint8(msgtype); *data << uint32(language); *data << uint64(GetGUID()); *data << uint32(0); // constant unknown time - *data << uint64(GetGUID()); + if (addonPrefix) + *data << addonPrefix; + else + *data << uint64(GetGUID()); *data << uint32(text.length() + 1); *data << text; *data << uint8(GetChatTag()); @@ -20088,13 +20091,20 @@ void Player::TextEmote(const std::string& text) SendMessageToSetInRange(&data, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), true, !sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT)); } -void Player::Whisper(const std::string& text, uint32 language, uint64 receiver) +void Player::WhisperAddon(const std::string& text, const std::string& prefix, uint64 receiver) { - bool isAddonMessage = language == LANG_ADDON; + Player* rPlayer = ObjectAccessor::FindPlayer(receiver); - if (!isAddonMessage) // if not addon data - language = LANG_UNIVERSAL; // whispers should always be readable + std::string _text(text); + sScriptMgr->OnPlayerChat(this, CHAT_MSG_WHISPER, LANG_UNIVERSAL, _text, rPlayer); + + WorldPacket data(SMSG_MESSAGECHAT, 200); + BuildPlayerChat(&data, CHAT_MSG_WHISPER, _text, LANG_UNIVERSAL, prefix.c_str()); + rPlayer->GetSession()->SendPacket(&data); +} +void Player::Whisper(const std::string& text, uint32 language, uint64 receiver) +{ Player* rPlayer = ObjectAccessor::FindPlayer(receiver); std::string _text(text); @@ -20107,22 +20117,13 @@ void Player::Whisper(const std::string& text, uint32 language, uint64 receiver) BuildPlayerChat(&data, CHAT_MSG_WHISPER, _text, language); rPlayer->GetSession()->SendPacket(&data); - // not send confirmation for addon messages - if (!isAddonMessage) - { - data.Initialize(SMSG_MESSAGECHAT, 200); - rPlayer->BuildPlayerChat(&data, CHAT_MSG_WHISPER_INFORM, _text, language); - GetSession()->SendPacket(&data); - } + data.Initialize(SMSG_MESSAGECHAT, 200); + rPlayer->BuildPlayerChat(&data, CHAT_MSG_WHISPER_INFORM, _text, language); + GetSession()->SendPacket(&data); } - else if (!isAddonMessage) - // announce to player that player he is whispering to is dnd and cannot receive his message + else // announce to player that player he is whispering to is dnd and cannot receive his message ChatHandler(this).PSendSysMessage(LANG_PLAYER_DND, rPlayer->GetName(), rPlayer->dndMsg.c_str()); - // rest stuff shouldn't happen in case of addon message - if (isAddonMessage) - return; - if (!isAcceptWhispers() && !isGameMaster() && !rPlayer->isGameMaster()) { SetAcceptWhispers(true); diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index d29d03e9df7..48249a56c60 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1262,7 +1262,8 @@ class Player : public Unit, public GridObject void Yell(const std::string& text, const uint32 language); void TextEmote(const std::string& text); void Whisper(const std::string& text, const uint32 language, uint64 receiver); - void BuildPlayerChat(WorldPacket* data, uint8 msgtype, const std::string& text, uint32 language) const; + void WhisperAddon(const std::string& text, const std::string& prefix, uint64 receiver); + void BuildPlayerChat(WorldPacket* data, uint8 msgtype, const std::string& text, uint32 language, const char* addonPrefix = NULL) const; /*********************************************************/ /*** STORAGE SYSTEM ***/ diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index ac4802a3091..fc73da04f12 100755 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -2069,6 +2069,20 @@ void Guild::BroadcastToGuild(WorldSession* session, bool officerOnly, const std: } } +void Guild::BroadcastAddonToGuild(WorldSession* session, bool officerOnly, const std::string& msg, const std::string& prefix) const +{ + if (session && session->GetPlayer() && _HasRankRight(session->GetPlayer(), officerOnly ? GR_RIGHT_OFFCHATSPEAK : GR_RIGHT_GCHATSPEAK)) + { + WorldPacket data; + ChatHandler::FillMessageData(&data, session, officerOnly ? CHAT_MSG_OFFICER : CHAT_MSG_GUILD, CHAT_MSG_ADDON, NULL, 0, msg.c_str(), NULL, prefix.c_str()); + for (Members::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr) + if (Player* player = itr->second->FindPlayer()) + if (player->GetSession() && _HasRankRight(player, officerOnly ? GR_RIGHT_OFFCHATLISTEN : GR_RIGHT_GCHATLISTEN) && + !player->GetSocial()->HasIgnore(session->GetPlayer()->GetGUIDLow())) + player->GetSession()->SendPacket(&data); + } +} + void Guild::BroadcastPacketToRank(WorldPacket* packet, uint8 rankId) const { for (Members::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr) diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h index 446eede5dc8..036d61144e5 100755 --- a/src/server/game/Guilds/Guild.h +++ b/src/server/game/Guilds/Guild.h @@ -658,6 +658,7 @@ public: // Broadcasts void BroadcastToGuild(WorldSession* session, bool officerOnly, const std::string& msg, uint32 language = LANG_UNIVERSAL) const; + void BroadcastAddonToGuild(WorldSession* session, bool officerOnly, const std::string& msg, const std::string& prefix) const; void BroadcastPacketToRank(WorldPacket* packet, uint8 rankId) const; void BroadcastPacket(WorldPacket* packet) const; diff --git a/src/server/game/Handlers/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cpp index 41e9664b69f..2cbab68266e 100755 --- a/src/server/game/Handlers/ChatHandler.cpp +++ b/src/server/game/Handlers/ChatHandler.cpp @@ -180,7 +180,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) // LANG_ADDON should not be changed nor be affected by flood control else { - // send in universal language if player in .gmon mode (ignore spell effects) + // send in universal language if player in .gm on mode (ignore spell effects) if (sender->isGameMaster()) lang = LANG_UNIVERSAL; else @@ -538,23 +538,41 @@ void WorldSession::HandleAddonMessagechatOpcode(WorldPacket& recvData) return; } - uint32 msgLen = recvData.ReadBits(9); - uint32 prefixLen = recvData.ReadBits(5); - std::string message = ""; - std::string prefix = ""; - std::string targetName = ""; + std::string message; + std::string prefix; + std::string targetName; - if (type == CHAT_MSG_WHISPER) - { - uint32 targetLen = recvData.ReadBits(10); - message = recvData.ReadString(msgLen); - prefix = recvData.ReadString(prefixLen); - targetName = recvData.ReadString(targetLen); - } - else + switch (type) { - message = recvData.ReadString(msgLen); - prefix = recvData.ReadString(prefixLen); + case CHAT_MSG_WHISPER: + { + uint32 msgLen = recvData.ReadBits(9); + uint32 prefixLen = recvData.ReadBits(5); + uint32 targetLen = recvData.ReadBits(10); + message = recvData.ReadString(msgLen); + prefix = recvData.ReadString(prefixLen); + targetName = recvData.ReadString(targetLen); + break; + } + case CHAT_MSG_PARTY: + case CHAT_MSG_RAID: + case CHAT_MSG_OFFICER: + { + uint32 prefixLen = recvData.ReadBits(5); + uint32 msgLen = recvData.ReadBits(9); + prefix = recvData.ReadString(prefixLen); + message = recvData.ReadString(msgLen); + break; + } + case CHAT_MSG_GUILD: + case CHAT_MSG_BATTLEGROUND: + { + uint32 msgLen = recvData.ReadBits(9); + uint32 prefixLen = recvData.ReadBits(5); + message = recvData.ReadString(msgLen); + prefix = recvData.ReadString(prefixLen); + break; + } } // Logging enabled? @@ -585,10 +603,11 @@ void WorldSession::HandleAddonMessagechatOpcode(WorldPacket& recvData) break; } case CHAT_MSG_GUILD: + case CHAT_MSG_OFFICER: { if (sender->GetGuildId()) if (Guild* guild = sGuildMgr->GetGuildById(sender->GetGuildId())) - guild->BroadcastToGuild(this, false, message, LANG_ADDON); + guild->BroadcastAddonToGuild(this, type == CHAT_MSG_OFFICER, message, prefix); break; } case CHAT_MSG_WHISPER: @@ -599,7 +618,7 @@ void WorldSession::HandleAddonMessagechatOpcode(WorldPacket& recvData) if (!receiver) break; - sender->Whisper(message, LANG_ADDON, receiver->GetGUID()); + sender->WhisperAddon(message, prefix, receiver->GetGUID()); break; } // Messages sent to "RAID" while in a party will get delivered to "PARTY" @@ -612,7 +631,7 @@ void WorldSession::HandleAddonMessagechatOpcode(WorldPacket& recvData) break; WorldPacket data; - ChatHandler::FillMessageData(&data, this, type, LANG_ADDON, "", 0, message.c_str(), NULL); + ChatHandler::FillMessageData(&data, this, type, LANG_ADDON, "", 0, message.c_str(), NULL, prefix.c_str()); group->BroadcastPacket(&data, true, -1, group->GetMemberGroup(sender->GetGUID())); break; } diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 4b349857c96..354a8e92cb1 100755 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -1697,7 +1697,7 @@ void WorldSession::HandleReforgeItemOpcode(WorldPacket& recvData) return; } - if (player->HasEnoughMoney(item->GetSpecialPrice())) // cheating + if (player->HasEnoughMoney(uint64(item->GetSpecialPrice()))) // cheating { SendReforgeResult(false); return; -- cgit v1.2.3 From d9da2e8e50f32601247641b921fa693f33d93033 Mon Sep 17 00:00:00 2001 From: Subv Date: Sat, 4 Aug 2012 11:33:49 -0500 Subject: Core/Player: Use DBC data to set the correct amount of hp and mana based on player level and class --- ...12_08_04_01_world_player_classlevelstats_4x.sql | 1 + src/server/game/DataStores/DBCStores.cpp | 4 + src/server/game/DataStores/DBCStores.h | 2 + src/server/game/DataStores/DBCStructure.h | 9 ++ src/server/game/DataStores/DBCfmt.h | 2 + src/server/game/Entities/Player/Player.cpp | 22 ++--- src/server/game/Entities/Player/Player.h | 14 --- src/server/game/Globals/ObjectMgr.cpp | 103 +++------------------ src/server/game/Globals/ObjectMgr.h | 10 +- src/server/game/Handlers/ItemHandler.cpp | 1 + 10 files changed, 44 insertions(+), 124 deletions(-) create mode 100644 sql/updates/world/2012_08_04_01_world_player_classlevelstats_4x.sql (limited to 'src') diff --git a/sql/updates/world/2012_08_04_01_world_player_classlevelstats_4x.sql b/sql/updates/world/2012_08_04_01_world_player_classlevelstats_4x.sql new file mode 100644 index 00000000000..9b2bcb6d6ca --- /dev/null +++ b/sql/updates/world/2012_08_04_01_world_player_classlevelstats_4x.sql @@ -0,0 +1 @@ +DROP TABLE IF EXISTS `player_classlevelstats`; \ No newline at end of file diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 35ed42f73a9..098b61c6306 100755 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -107,6 +107,8 @@ DBCStorage sGtOCTRegenHPStore(GtOCTRegenHPfmt); DBCStorage sGtRegenHPPerSptStore(GtRegenHPPerSptfmt); DBCStorage sGtOCTHpPerStaminaStore(GtOCTHpPerStaminafmt); DBCStorage sGtRegenMPPerSptStore(GtRegenMPPerSptfmt); +DBCStorage sGtOCTBaseHPByClassStore(GtOCTBaseHPByClassfmt); +DBCStorage sGtOCTBaseMPByClassStore(GtOCTBaseMPByClassfmt); DBCStorage sHolidaysStore(Holidaysfmt); @@ -396,6 +398,8 @@ void LoadDBCStores(const std::string& dataPath) //LoadDBC(dbcCount, availableDbcLocales, bad_dbc_files, sGtOCTRegenMPStore, dbcPath, "gtOCTRegenMP.dbc"); -- not used currently //LoadDBC(availableDbcLocales, bad_dbc_files, sGtRegenHPPerSptStore, dbcPath, "gtRegenHPPerSpt.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sGtRegenMPPerSptStore, dbcPath, "gtRegenMPPerSpt.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sGtOCTBaseHPByClassStore, dbcPath, "gtOCTBaseHPByClass.dbc");//15595 + LoadDBC(availableDbcLocales, bad_dbc_files, sGtOCTBaseMPByClassStore, dbcPath, "gtOCTBaseMPByClass.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sHolidaysStore, dbcPath, "Holidays.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sImportPriceArmorStore, dbcPath, "ImportPriceArmor.dbc"); // 15595 diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h index 7cc97f16b18..94615d8c435 100755 --- a/src/server/game/DataStores/DBCStores.h +++ b/src/server/game/DataStores/DBCStores.h @@ -120,6 +120,8 @@ extern DBCStorage sGtOCTClassCombatRatingSca extern DBCStorage sGtRegenHPPerSptStore; extern DBCStorage sGtOCTHpPerStaminaStore; extern DBCStorage sGtRegenMPPerSptStore; +extern DBCStorage sGtOCTBaseHPByClassStore; +extern DBCStorage sGtOCTBaseMPByClassStore; extern DBCStorage sHolidaysStore; extern DBCStorage sImportPriceArmorStore; extern DBCStorage sImportPriceQualityStore; diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index ce25b54ce0d..6cb013bec50 100755 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -1117,6 +1117,15 @@ struct GtRegenMPPerSptEntry float ratio; }; +struct GtOCTBaseHPByClassEntry +{ + float ratio; +}; + +struct GtOCTBaseMPByClassEntry +{ + float ratio; +}; /* no used struct HolidayDescriptionsEntry { diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index 3c68066c97b..6561fd9029c 100755 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -77,6 +77,8 @@ const char GtOCTRegenHPfmt[]="f"; //const char GtOCTRegenMPfmt[]="f"; const char GtRegenHPPerSptfmt[]="f"; const char GtRegenMPPerSptfmt[]="xf"; +const char GtOCTBaseHPByClassfmt[]="df"; +const char GtOCTBaseMPByClassfmt[]="df"; const char Holidaysfmt[]="niiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiixxsiix"; const char ImportPriceArmorfmt[]="nffff"; const char ImportPriceQualityfmt[]="nf"; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 6b786b79985..d9f0935633a 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -3062,15 +3062,15 @@ void Player::GiveLevel(uint8 level) PlayerLevelInfo info; sObjectMgr->GetPlayerLevelInfo(getRace(), getClass(), level, &info); - PlayerClassLevelInfo classInfo; - sObjectMgr->GetPlayerClassLevelInfo(getClass(), level, &classInfo); + uint32 basehp = 0, basemana = 0; + sObjectMgr->GetPlayerClassLevelInfo(getClass(), level, basehp, basemana); // send levelup info to client WorldPacket data(SMSG_LEVELUP_INFO, (4+4+MAX_STORED_POWERS*4+MAX_STATS*4)); data << uint32(level); - data << uint32(int32(classInfo.basehealth) - int32(GetCreateHealth())); + data << uint32(int32(basehp) - int32(GetCreateHealth())); // for (int i = 0; i < MAX_STORED_POWERS; ++i) // Powers loop (0-10) - data << uint32(int32(classInfo.basemana) - int32(GetCreateMana())); + data << uint32(int32(basemana) - int32(GetCreateMana())); data << uint32(0); data << uint32(0); data << uint32(0); @@ -3096,8 +3096,8 @@ void Player::GiveLevel(uint8 level) for (uint8 i = STAT_STRENGTH; i < MAX_STATS; ++i) SetCreateStat(Stats(i), info.stats[i]); - SetCreateHealth(classInfo.basehealth); - SetCreateMana(classInfo.basemana); + SetCreateHealth(basehp); + SetCreateMana(basemana); InitTalentForLevel(); InitTaxiNodesForLevel(); @@ -3191,8 +3191,8 @@ void Player::InitStatsForLevel(bool reapplyMods) if (reapplyMods) //reapply stats values only on .reset stats (level) command _RemoveAllStatBonuses(); - PlayerClassLevelInfo classInfo; - sObjectMgr->GetPlayerClassLevelInfo(getClass(), getLevel(), &classInfo); + uint32 basehp = 0, basemana = 0; + sObjectMgr->GetPlayerClassLevelInfo(getClass(), getLevel(), basehp, basemana); PlayerLevelInfo info; sObjectMgr->GetPlayerLevelInfo(getRace(), getClass(), getLevel(), &info); @@ -3219,10 +3219,10 @@ void Player::InitStatsForLevel(bool reapplyMods) for (uint8 i = STAT_STRENGTH; i < MAX_STATS; ++i) SetStat(Stats(i), info.stats[i]); - SetCreateHealth(classInfo.basehealth); + SetCreateHealth(basehp); //set create powers - SetCreateMana(classInfo.basemana); + SetCreateMana(basemana); SetArmor(int32(m_createStats[STAT_AGILITY]*2)); @@ -3302,7 +3302,7 @@ void Player::InitStatsForLevel(bool reapplyMods) for (uint8 i = POWER_MANA; i < MAX_POWERS; ++i) SetMaxPower(Powers(i), GetCreatePowers(Powers(i))); - SetMaxHealth(classInfo.basehealth); // stamina bonus will applied later + SetMaxHealth(basehp); // stamina bonus will applied later // cleanup mounted state (it will set correctly at aura loading if player saved at mount. SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, 0); diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 48249a56c60..87b459f0642 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -221,20 +221,6 @@ struct PlayerCreateInfoItem typedef std::list PlayerCreateInfoItems; -struct PlayerClassLevelInfo -{ - PlayerClassLevelInfo() : basehealth(0), basemana(0) {} - uint16 basehealth; - uint16 basemana; -}; - -struct PlayerClassInfo -{ - PlayerClassInfo() : levelInfo(NULL) { } - - PlayerClassLevelInfo* levelInfo; //[level-1] 0..MaxPlayerLevel-1 -}; - struct PlayerLevelInfo { PlayerLevelInfo() { for (uint8 i=0; i < MAX_STATS; ++i) stats[i] = 0; } diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index a1a8eadd5de..6d8c828ac58 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -244,10 +244,6 @@ ObjectMgr::~ObjectMgr() for (PetLevelInfoContainer::iterator i = _petInfoStore.begin(); i != _petInfoStore.end(); ++i) delete[] i->second; - // free only if loaded - for (int class_ = 0; class_ < MAX_CLASSES; ++class_) - delete[] _playerClassInfo[class_].levelInfo; - for (int race = 0; race < MAX_RACES; ++race) for (int class_ = 0; class_ < MAX_CLASSES; ++class_) delete[] _playerInfo[race][class_].levelInfo; @@ -3252,87 +3248,6 @@ void ObjectMgr::LoadPlayerInfo() } } - // Loading levels data (class only dependent) - sLog->outString("Loading Player Create Level HP/Mana Data..."); - { - uint32 oldMSTime = getMSTime(); - - // 0 1 2 3 - QueryResult result = WorldDatabase.Query("SELECT class, level, basehp, basemana FROM player_classlevelstats"); - - if (!result) - { - sLog->outErrorDb(">> Loaded 0 level health/mana definitions. DB table `game_event_condition` is empty."); - sLog->outString(); - exit(1); - } - - uint32 count = 0; - - do - { - Field* fields = result->Fetch(); - - uint32 current_class = fields[0].GetUInt8(); - if (current_class >= MAX_CLASSES) - { - sLog->outErrorDb("Wrong class %u in `player_classlevelstats` table, ignoring.", current_class); - continue; - } - - uint8 current_level = fields[1].GetUInt8(); // Can't be > than STRONG_MAX_LEVEL (hardcoded level maximum) due to var type - if (current_level > sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) - { - sLog->outDetail("Unused (> MaxPlayerLevel in worldserver.conf) level %u in `player_classlevelstats` table, ignoring.", current_level); - ++count; // make result loading percent "expected" correct in case disabled detail mode for example. - continue; - } - - PlayerClassInfo* pClassInfo = &_playerClassInfo[current_class]; - - if (!pClassInfo->levelInfo) - pClassInfo->levelInfo = new PlayerClassLevelInfo[sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)]; - - PlayerClassLevelInfo* pClassLevelInfo = &pClassInfo->levelInfo[current_level-1]; - - pClassLevelInfo->basehealth = fields[2].GetUInt16(); - pClassLevelInfo->basemana = fields[3].GetUInt16(); - - ++count; - } - while (result->NextRow()); - - // Fill gaps and check integrity - for (int class_ = 0; class_ < MAX_CLASSES; ++class_) - { - // skip non existed classes - if (!sChrClassesStore.LookupEntry(class_)) - continue; - - PlayerClassInfo* pClassInfo = &_playerClassInfo[class_]; - - // fatal error if no level 1 data - if (!pClassInfo->levelInfo || pClassInfo->levelInfo[0].basehealth == 0) - { - sLog->outErrorDb("Class %i Level 1 does not have health/mana data!", class_); - exit(1); - } - - // fill level gaps - for (uint8 level = 1; level < sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL); ++level) - { - if (pClassInfo->levelInfo[level].basehealth == 0) - { - sLog->outErrorDb("Class %i Level %i does not have health/mana data. Using stats data of level %i.", class_, level+1, level); - pClassInfo->levelInfo[level] = pClassInfo->levelInfo[level-1]; - } - } - } - - sLog->outString(">> Loaded %u level health/mana definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); - } - // Loading levels data (class/race dependent) sLog->outString("Loading Player Create Level Stats Data..."); { @@ -3507,17 +3422,25 @@ void ObjectMgr::LoadPlayerInfo() } } -void ObjectMgr::GetPlayerClassLevelInfo(uint32 class_, uint8 level, PlayerClassLevelInfo* info) const +void ObjectMgr::GetPlayerClassLevelInfo(uint32 class_, uint8 level, uint32& baseHP, uint32& baseMana) const { if (level < 1 || class_ >= MAX_CLASSES) return; - PlayerClassInfo const* pInfo = &_playerClassInfo[class_]; - if (level > sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) level = sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL); - - *info = pInfo->levelInfo[level-1]; + + GtOCTBaseHPByClassEntry const* hp = sGtOCTBaseHPByClassStore.LookupEntry((class_-1) * GT_MAX_LEVEL + level-1); + GtOCTBaseMPByClassEntry const* mp = sGtOCTBaseMPByClassStore.LookupEntry((class_-1) * GT_MAX_LEVEL + level-1); + + if (!hp || !mp) + { + sLog->outError("Tried to get non-existant Class-Level combination data for base hp/mp. Class %u Level %u", class_, level); + return; + } + + baseHP = uint32(hp->ratio); + baseMana = uint32(mp->ratio); } void ObjectMgr::GetPlayerLevelInfo(uint32 race, uint32 class_, uint8 level, PlayerLevelInfo* info) const diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index a13108bd7f3..0350d519aff 100755 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -652,13 +652,7 @@ class ObjectMgr PetLevelInfo const* GetPetLevelInfo(uint32 creature_id, uint8 level) const; - PlayerClassInfo const* GetPlayerClassInfo(uint32 class_) const - { - if (class_ >= MAX_CLASSES) - return NULL; - return &_playerClassInfo[class_]; - } - void GetPlayerClassLevelInfo(uint32 class_, uint8 level, PlayerClassLevelInfo* info) const; + void GetPlayerClassLevelInfo(uint32 class_, uint8 level, uint32& baseHP, uint32& baseMana) const; PlayerInfo const* GetPlayerInfo(uint32 race, uint32 class_) const { @@ -1255,8 +1249,6 @@ class ObjectMgr // PetLevelInfoContainer[creature_id][level] PetLevelInfoContainer _petInfoStore; // [creature_id][level] - PlayerClassInfo _playerClassInfo[MAX_CLASSES]; - void BuildPlayerLevelInfo(uint8 race, uint8 class_, uint8 level, PlayerLevelInfo* plinfo) const; PlayerInfo _playerInfo[MAX_RACES][MAX_CLASSES]; diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 354a8e92cb1..b446fdadee7 100755 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -1636,6 +1636,7 @@ void WorldSession::SendReforgeResult(bool success) { WorldPacket data(SMSG_REFORGE_RESULT, 1); data.WriteBit(success); + data.FlushBits(); SendPacket(&data); } -- cgit v1.2.3 From f5d19939bfbc9704620a6fa2aebbe146aac646ab Mon Sep 17 00:00:00 2001 From: kaelima Date: Sat, 4 Aug 2012 18:40:56 +0200 Subject: Core/Guilds: Implemented some guild packets, some basic guild functions is working, though most are still WIP/TODO --- src/server/game/Entities/Player/Player.cpp | 3 +- src/server/game/Entities/Player/Player.h | 2 +- src/server/game/Guilds/Guild.cpp | 455 +++++++++++++++------ src/server/game/Guilds/Guild.h | 121 ++++-- src/server/game/Handlers/GuildHandler.cpp | 355 +++++++++++----- src/server/game/Handlers/PetitionsHandler.cpp | 22 +- src/server/game/Server/Protocol/Opcodes.cpp | 63 +-- src/server/game/Server/Protocol/Opcodes.h | 8 +- src/server/game/Server/WorldSession.h | 7 +- .../Database/Implementation/CharacterDatabase.cpp | 2 +- .../Database/Implementation/CharacterDatabase.h | 2 +- 11 files changed, 714 insertions(+), 326 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index d9f0935633a..ab1f76bccd6 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -25384,6 +25384,7 @@ void Player::SetReputation(uint32 factionentry, uint32 value) { GetReputationMgr().SetReputation(sFactionStore.LookupEntry(factionentry), value); } + uint32 Player::GetReputation(uint32 factionentry) { return GetReputationMgr().GetReputation(sFactionStore.LookupEntry(factionentry)); @@ -25391,7 +25392,7 @@ uint32 Player::GetReputation(uint32 factionentry) std::string Player::GetGuildName() { - return sGuildMgr->GetGuildById(GetGuildId())->GetName(); + return GetGuildId() ? sGuildMgr->GetGuildById(GetGuildId())->GetName() : ""; } void Player::SendDuelCountdown(uint32 counter) diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 87b459f0642..8ea17eff033 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1895,7 +1895,7 @@ class Player : public Unit, public GridObject } void SetRank(uint8 rankId) { SetUInt32Value(PLAYER_GUILDRANK, rankId); } - uint8 GetRank() { return uint8(GetUInt32Value(PLAYER_GUILDRANK)); } + uint32 GetRank() { return GetUInt32Value(PLAYER_GUILDRANK); } void SetGuildIdInvited(uint32 GuildId) { m_GuildIdInvited = GuildId; } uint32 GetGuildId() const { return GetUInt32Value(OBJECT_FIELD_DATA); /* return only lower part */ } static uint32 GetGuildIdFromDB(uint64 guid); diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index fc73da04f12..d4e461f3f57 100755 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -220,17 +220,6 @@ void Guild::RankInfo::SaveToDB(SQLTransaction& trans) const CharacterDatabase.ExecuteOrAppend(trans, stmt); } -void Guild::RankInfo::WritePacket(WorldPacket& data) const -{ - data << uint32(m_rights); - data << uint32(m_bankMoneyPerDay); // In game set in gold, in packet set in bronze. - for (uint8 i = 0; i < GUILD_BANK_MAX_TABS; ++i) - { - data << uint32(m_bankTabRightsAndSlots[i].rights); - data << uint32(m_bankTabRightsAndSlots[i].slots); - } -} - void Guild::RankInfo::SetName(const std::string& name) { if (m_name == name) @@ -621,35 +610,6 @@ bool Guild::Member::CheckStats() const return true; } -void Guild::Member::WritePacket(WorldPacket& data) const -{ - if (Player* player = FindPlayer()) - { - data << uint64(player->GetGUID()); - data << uint8(1); - data << player->GetName(); - data << uint32(m_rankId); - data << uint8(player->getLevel()); - data << uint8(player->getClass()); - data << uint8(0); // new 2.4.0 - data << uint32(player->GetZoneId()); - } - else - { - data << m_guid; - data << uint8(0); - data << m_name; - data << uint32(m_rankId); - data << uint8(m_level); - data << uint8(m_class); - data << uint8(0); // new 2.4.0 - data << uint32(m_zoneId); - data << float(float(::time(NULL) - m_logoutTime) / DAY); - } - data << m_publicNote; - data << m_officerNote; -} - // Decreases amount of money/slots left for today. // If (tabId == GUILD_BANK_MAX_TABS) decrease money amount. // Otherwise decrease remaining items amount for specified tab. @@ -1145,6 +1105,8 @@ bool Guild::Create(Player* pLeader, const std::string& name) // Call scripts on successful create sScriptMgr->OnGuildCreate(this, pLeader, name); + _BroadcastEvent(GE_FOUNDER, m_leaderGuid); + return ret; } @@ -1203,18 +1165,95 @@ void Guild::Disband() // HANDLE CLIENT COMMANDS void Guild::HandleRoster(WorldSession* session /*= NULL*/) { + ByteBuffer memberData(100); // Guess size - WorldPacket data(SMSG_GUILD_ROSTER, (4 + m_motd.length() + 1 + m_info.length() + 1 + 4 + _GetRanksSize() * (4 + 4 + GUILD_BANK_MAX_TABS * (4 + 4)) + m_members.size() * 50)); - data << uint32(m_members.size()); - data << m_motd; - data << m_info; - - data << uint32(_GetRanksSize()); - for (Ranks::const_iterator ritr = m_ranks.begin(); ritr != m_ranks.end(); ++ritr) - ritr->WritePacket(data); + WorldPacket data(SMSG_GUILD_ROSTER, 100); + data.WriteBits(m_motd.length(), 11); + data.WriteBits(m_members.size(), 18); for (Members::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr) - itr->second->WritePacket(data); + { + Member* member = itr->second; + Player* player = member->FindPlayer(); + size_t pubNoteLength = member->GetPublicNote().length(); + size_t offNoteLength = member->GetOfficerNote().length(); + + ObjectGuid guid = member->GetGUID(); + data.WriteBit(guid[3]); + data.WriteBit(guid[4]); + data.WriteBit(0); // unk + data.WriteBit(0); // unk + data.WriteBits(pubNoteLength, 8); + data.WriteBits(offNoteLength, 8); + data.WriteBit(guid[0]); + data.WriteBits(member->GetName().length(), 7); + data.WriteBit(guid[1]); + data.WriteBit(guid[2]); + data.WriteBit(guid[6]); + data.WriteBit(guid[5]); + data.WriteBit(guid[7]); + + uint8 flags = GUILDMEMBER_STATUS_NONE; + if (player) + { + flags |= GUILDMEMBER_STATUS_ONLINE; + if (player->isAFK()) + flags |= GUILDMEMBER_STATUS_AFK; + if (player->isDND()) + flags |= GUILDMEMBER_STATUS_DND; + } + + memberData << uint8(member->GetClass()); + memberData << int32(0); // unk + memberData.WriteByteSeq(guid[0]); + memberData << uint64(0); // weekly activity + memberData << uint32(member->GetRankId()); + memberData << uint32(0); // player->GetAchievementMgr().GetCompletedAchievementsAmount() + + // for (2 professions) + memberData << uint32(0) << uint32(0) << uint32(0); + memberData << uint32(0) << uint32(0) << uint32(0); + + memberData.WriteByteSeq(guid[2]); + memberData << uint8(flags); + memberData << uint32(player ? player->GetZoneId() : member->GetZone()); + memberData << uint64(0); // Total activity + memberData.WriteByteSeq(guid[7]); + memberData << uint32(0); // Remaining guild week Rep + + if (pubNoteLength) + memberData.append(member->GetPublicNote().c_str(), pubNoteLength); + + memberData.WriteByteSeq(guid[3]); + memberData << uint8(player ? player->getLevel() : member->GetLevel()); + memberData << int32(0); // unk + memberData.WriteByteSeq(guid[5]); + memberData.WriteByteSeq(guid[4]); + memberData << uint8(0); // unk + memberData.WriteByteSeq(guid[1]); + memberData << float(player ? 0.0f : float(::time(NULL) - member->GetLogoutTime()) / DAY); + + if (offNoteLength) + memberData.append(member->GetOfficerNote().c_str(), offNoteLength); + + memberData.WriteByteSeq(guid[6]); + memberData.append(member->GetName().c_str(), member->GetName().length()); + } + + size_t infoLength = m_info.length(); + data.WriteBits(infoLength, 12); + + data.FlushBits(); + data.append(memberData); + + if (infoLength) + data.append(m_info.c_str(), infoLength); + + data.append(m_motd.c_str(), m_motd.length()); + data << uint32(0); + data << uint32(0); + data << uint32(0); + data << uint32(0); if (session) session->SendPacket(&data); @@ -1249,16 +1288,11 @@ void Guild::HandleQuery(WorldSession* session) } // Rank order of "importance" (sorting by rights) - Ranks ranks = m_ranks; - std::sort(ranks.begin(), ranks.end()); - Ranks::iterator it; - for (uint8 i = 0; i < GUILD_RANKS_MAX_COUNT; ++i) { if (i < _GetRanksSize()) { - it = std::find(ranks.begin(), ranks.end(), m_ranks[i]); - data << std::distance(ranks.begin(), it); + data << uint32(m_ranks[i].GetId()); } else data << uint32(0); @@ -1272,6 +1306,44 @@ void Guild::HandleQuery(WorldSession* session) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (SMSG_GUILD_QUERY_RESPONSE)"); } +void Guild::HandleGuildRanks(WorldSession* session) +{ + // perhaps move to guild.cpp..... + ByteBuffer rankData(100); + WorldPacket data(SMSG_GUILD_RANK, 100); + + data.WriteBits(_GetRanksSize(), 18); + + for (uint8 i = 0; i < _GetRanksSize(); i++) + { + RankInfo* rankInfo = GetRankInfo(i); + if (!rankInfo) + continue; + + data.WriteBits(rankInfo->GetName().length(), 7); + + rankData << uint32(i); + + for (uint8 j = 0; j < GUILD_BANK_MAX_TABS; ++j) + { + rankData << uint32(rankInfo->GetBankTabSlotsPerDay(j)); + rankData << uint32(rankInfo->GetBankTabRights(j)); + } + + rankData << uint32(rankInfo->GetBankMoneyPerDay()); + rankData << uint32(rankInfo->GetRights()); + + if (rankInfo->GetName().length()) + rankData.append(rankInfo->GetName().c_str(), rankInfo->GetName().length()); + + rankData << uint32(rankInfo->GetId()); + } + + data.FlushBits(); + data.append(rankData); + session->SendPacket(&data); +} + void Guild::HandleSetMOTD(WorldSession* session, const std::string& motd) { if (m_motd == motd) @@ -1279,7 +1351,7 @@ void Guild::HandleSetMOTD(WorldSession* session, const std::string& motd) // Player must have rights to set MOTD if (!_HasRankRight(session->GetPlayer(), GR_RIGHT_SETMOTD)) - SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_PERMISSIONS); + SendCommandResult(session, GUILD_INVITE, ERR_GUILD_PERMISSIONS); else { m_motd = motd; @@ -1302,7 +1374,7 @@ void Guild::HandleSetInfo(WorldSession* session, const std::string& info) // Player must have rights to set guild's info if (!_HasRankRight(session->GetPlayer(), GR_RIGHT_MODIFY_GUILD_INFO)) - SendCommandResult(session, GUILD_CREATE_S, ERR_GUILD_PERMISSIONS); + SendCommandResult(session, GUILD_CREATE, ERR_GUILD_PERMISSIONS); else { m_info = info; @@ -1344,7 +1416,7 @@ void Guild::HandleSetLeader(WorldSession* session, const std::string& name) Player* player = session->GetPlayer(); // Only leader can assign new leader if (!_IsLeader(player)) - SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_PERMISSIONS); + SendCommandResult(session, GUILD_INVITE, ERR_GUILD_PERMISSIONS); // Old leader must be a member of guild else if (Member* pOldLeader = GetMember(player->GetGUID())) { @@ -1357,7 +1429,7 @@ void Guild::HandleSetLeader(WorldSession* session, const std::string& name) } } else - SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_PERMISSIONS); + SendCommandResult(session, GUILD_INVITE, ERR_GUILD_PERMISSIONS); } void Guild::HandleSetBankTabInfo(WorldSession* session, uint8 tabId, const std::string& name, const std::string& icon) @@ -1370,27 +1442,26 @@ void Guild::HandleSetBankTabInfo(WorldSession* session, uint8 tabId, const std:: } } -void Guild::HandleSetMemberNote(WorldSession* session, const std::string& name, const std::string& note, bool officer) +void Guild::HandleSetMemberNote(WorldSession* session, std::string const& note, uint64 guid, bool isPublic) { // Player must have rights to set public/officer note - if (!_HasRankRight(session->GetPlayer(), officer ? GR_RIGHT_EOFFNOTE : GR_RIGHT_EPNOTE)) - SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_PERMISSIONS); - // Noted player must be a member of guild - else if (Member* member = GetMember(session, name)) + if (!_HasRankRight(session->GetPlayer(), isPublic ? GR_RIGHT_EPNOTE : GR_RIGHT_EOFFNOTE)) + SendCommandResult(session, GUILD_INVITE, ERR_GUILD_PERMISSIONS); + else if (Member* member = GetMember(guid)) { - if (officer) - member->SetOfficerNote(note); - else + if (isPublic) member->SetPublicNote(note); + else + member->SetOfficerNote(note); HandleRoster(session); } } -void Guild::HandleSetRankInfo(WorldSession* session, uint8 rankId, const std::string& name, uint32 rights, uint32 moneyPerDay, GuildBankRightsAndSlotsVec rightsAndSlots) +void Guild::HandleSetRankInfo(WorldSession* session, uint32 rankId, const std::string& name, uint32 rights, uint32 moneyPerDay, GuildBankRightsAndSlotsVec rightsAndSlots) { // Only leader can modify ranks if (!_IsLeader(session->GetPlayer())) - SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_PERMISSIONS); + SendCommandResult(session, GUILD_INVITE, ERR_GUILD_PERMISSIONS); else if (RankInfo* rankInfo = GetRankInfo(rankId)) { sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Changed RankName to '%s', rights to 0x%08X", name.c_str(), rights); @@ -1436,7 +1507,7 @@ void Guild::HandleInviteMember(WorldSession* session, const std::string& name) Player* pInvitee = sObjectAccessor->FindPlayerByName(name.c_str()); if (!pInvitee) { - SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_PLAYER_NOT_FOUND_S, name); + SendCommandResult(session, GUILD_INVITE, ERR_GUILD_PLAYER_NOT_FOUND_S, name); return; } @@ -1446,25 +1517,25 @@ void Guild::HandleInviteMember(WorldSession* session, const std::string& name) return; if (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && pInvitee->GetTeam() != player->GetTeam()) { - SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_NOT_ALLIED, name); + SendCommandResult(session, GUILD_INVITE, ERR_GUILD_NOT_ALLIED, name); return; } // Invited player cannot be in another guild - if (pInvitee->GetGuildId()) + /*if (pInvitee->GetGuildId()) { - SendCommandResult(session, GUILD_INVITE_S, ERR_ALREADY_IN_GUILD_S, name); + SendCommandResult(session, GUILD_INVITE, ERR_ALREADY_IN_GUILD_S, name); return; - } + }*/ // Invited player cannot be invited if (pInvitee->GetGuildIdInvited()) { - SendCommandResult(session, GUILD_INVITE_S, ERR_ALREADY_INVITED_TO_GUILD_S, name); + SendCommandResult(session, GUILD_INVITE, ERR_ALREADY_INVITED_TO_GUILD_S, name); return; } // Inviting player must have rights to invite if (!_HasRankRight(player, GR_RIGHT_INVITE)) { - SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_PERMISSIONS); + SendCommandResult(session, GUILD_INVITE, ERR_GUILD_PERMISSIONS); return; } @@ -1473,9 +1544,65 @@ void Guild::HandleInviteMember(WorldSession* session, const std::string& name) pInvitee->SetGuildIdInvited(m_id); _LogEvent(GUILD_EVENT_LOG_INVITE_PLAYER, player->GetGUIDLow(), pInvitee->GetGUIDLow()); - WorldPacket data(SMSG_GUILD_INVITE, 8 + 10); // Guess size - data << player->GetName(); - data << m_name; + WorldPacket data(SMSG_GUILD_INVITE, 100); + data << uint32(1); // Guild Level + data << uint32(m_emblemInfo.GetStyle()); + data << uint32(m_emblemInfo.GetBorderColor()); + data << uint32(m_emblemInfo.GetBorderStyle()); + data << uint32(m_emblemInfo.GetBackgroundColor()); + data << uint32(m_emblemInfo.GetColor()); + + ObjectGuid oldGuildGuid = MAKE_NEW_GUID(pInvitee->GetGuildId(), 0, pInvitee->GetGuildId() ? HIGHGUID_GUILD : 0); + ObjectGuid newGuildGuid = GetGUID(); + + data.WriteBit(newGuildGuid[3]); + data.WriteBit(newGuildGuid[2]); + data.WriteBits(pInvitee->GetGuildName().length(), 8); + data.WriteBit(newGuildGuid[1]); + data.WriteBit(oldGuildGuid[6]); + data.WriteBit(oldGuildGuid[4]); + data.WriteBit(oldGuildGuid[1]); + data.WriteBit(oldGuildGuid[5]); + data.WriteBit(oldGuildGuid[7]); + data.WriteBit(oldGuildGuid[2]); + data.WriteBit(newGuildGuid[7]); + data.WriteBit(newGuildGuid[0]); + data.WriteBit(newGuildGuid[6]); + data.WriteBits(m_name.length(), 8); + data.WriteBit(oldGuildGuid[3]); + data.WriteBit(oldGuildGuid[0]); + data.WriteBit(newGuildGuid[5]); + data.WriteBits(strlen(player->GetName()), 7); + data.WriteBit(newGuildGuid[4]); + + data.FlushBits(); + + data.WriteByteSeq(newGuildGuid[1]); + data.WriteByteSeq(oldGuildGuid[3]); + data.WriteByteSeq(newGuildGuid[6]); + data.WriteByteSeq(oldGuildGuid[2]); + data.WriteByteSeq(oldGuildGuid[1]); + data.WriteByteSeq(newGuildGuid[0]); + + if (!pInvitee->GetGuildName().empty()) + data.append(pInvitee->GetGuildName().c_str(), pInvitee->GetGuildName().length()); + + data.WriteByteSeq(newGuildGuid[7]); + data.WriteByteSeq(newGuildGuid[2]); + + data.append(player->GetName(), strlen(player->GetName())); + + data.WriteByteSeq(oldGuildGuid[7]); + data.WriteByteSeq(oldGuildGuid[6]); + data.WriteByteSeq(oldGuildGuid[5]); + data.WriteByteSeq(oldGuildGuid[0]); + data.WriteByteSeq(newGuildGuid[4]); + + data.append(m_name.c_str(), m_name.length()); + + data.WriteByteSeq(newGuildGuid[5]); + data.WriteByteSeq(newGuildGuid[3]); + data.WriteByteSeq(oldGuildGuid[4]); pInvitee->GetSession()->SendPacket(&data); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (SMSG_GUILD_INVITE)"); @@ -1503,7 +1630,7 @@ void Guild::HandleLeaveMember(WorldSession* session) { if (m_members.size() > 1) // Leader cannot leave if he is not the last member - SendCommandResult(session, GUILD_QUIT_S, ERR_GUILD_LEADER_LEAVE); + SendCommandResult(session, GUILD_QUIT, ERR_GUILD_LEADER_LEAVE); else // Guild is disbanded if leader leaves. Disband(); @@ -1515,49 +1642,57 @@ void Guild::HandleLeaveMember(WorldSession* session) _LogEvent(GUILD_EVENT_LOG_LEAVE_GUILD, player->GetGUIDLow()); _BroadcastEvent(GE_LEFT, player->GetGUID(), player->GetName()); - SendCommandResult(session, GUILD_QUIT_S, ERR_PLAYER_NO_MORE_IN_GUILD, m_name); + SendCommandResult(session, GUILD_QUIT, ERR_PLAYER_NO_MORE_IN_GUILD, m_name); } } -void Guild::HandleRemoveMember(WorldSession* session, const std::string& name) +void Guild::HandleRemoveMember(WorldSession* session, uint64 guid) { Player* player = session->GetPlayer(); + Player* removedPlayer = ObjectAccessor::FindPlayer(guid); + Member* member = GetMember(guid); + // Player must have rights to remove members if (!_HasRankRight(player, GR_RIGHT_REMOVE)) - SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_PERMISSIONS); - // Removed player must be a member of guild - else if (Member* member = GetMember(session, name)) + SendCommandResult(session, GUILD_INVITE, ERR_GUILD_PERMISSIONS); + // Removed player must be a member of the guild + else if (member && removedPlayer) { - // Leader cannot be removed + // Guild masters cannot be removed if (member->IsRank(GR_GUILDMASTER)) - SendCommandResult(session, GUILD_QUIT_S, ERR_GUILD_LEADER_LEAVE); + SendCommandResult(session, GUILD_QUIT, ERR_GUILD_LEADER_LEAVE); // Do not allow to remove player with the same rank or higher else if (member->IsRankNotLower(player->GetRank())) - SendCommandResult(session, GUILD_QUIT_S, ERR_GUILD_RANK_TOO_HIGH_S, name); + SendCommandResult(session, GUILD_QUIT, ERR_GUILD_RANK_TOO_HIGH_S, removedPlayer->GetName()); else { - uint64 guid = member->GetGUID(); // After call to DeleteMember pointer to member becomes invalid DeleteMember(guid, false, true); _LogEvent(GUILD_EVENT_LOG_UNINVITE_PLAYER, player->GetGUIDLow(), GUID_LOPART(guid)); - _BroadcastEvent(GE_REMOVED, 0, name.c_str(), player->GetName()); + _BroadcastEvent(GE_REMOVED, 0, removedPlayer->GetName(), player->GetName()); } } + else if (removedPlayer) + SendCommandResult(session, GUILD_QUIT, ERR_PLAYER_NO_MORE_IN_GUILD, removedPlayer->GetName()); } -void Guild::HandleUpdateMemberRank(WorldSession* session, const std::string& name, bool demote) +void Guild::HandleUpdateMemberRank(WorldSession* session, uint64 targetGuid, bool demote) { Player* player = session->GetPlayer(); - // Player must have rights to promote - if (!_HasRankRight(player, demote ? GR_RIGHT_DEMOTE : GR_RIGHT_PROMOTE)) - SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_PERMISSIONS); + // Promoted player must be a member of guild - else if (Member* member = GetMember(session, name)) + if (Member* member = GetMember(targetGuid)) { + if (!_HasRankRight(player, demote ? GR_RIGHT_DEMOTE : GR_RIGHT_PROMOTE)) + { + SendCommandResult(session, GUILD_INVITE, ERR_GUILD_PERMISSIONS); + return; + } + // Player cannot promote himself if (member->IsSamePlayer(player->GetGUID())) { - SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_NAME_INVALID); + SendCommandResult(session, GUILD_INVITE, ERR_GUILD_NAME_INVALID); return; } @@ -1566,13 +1701,13 @@ void Guild::HandleUpdateMemberRank(WorldSession* session, const std::string& nam // Player can demote only lower rank members if (member->IsRankNotLower(player->GetRank())) { - SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_RANK_TOO_HIGH_S, name); + SendCommandResult(session, GUILD_INVITE, ERR_GUILD_RANK_TOO_HIGH_S, member->GetName()); return; } // Lowest rank cannot be demoted if (member->GetRankId() >= _GetLowestRankId()) { - SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_RANK_TOO_LOW_S, name); + SendCommandResult(session, GUILD_INVITE, ERR_GUILD_RANK_TOO_LOW_S, member->GetName()); return; } } @@ -1582,27 +1717,50 @@ void Guild::HandleUpdateMemberRank(WorldSession* session, const std::string& nam // member->GetRank() + 1 is the highest rank that current player can promote to if (member->IsRankNotLower(player->GetRank() + 1)) { - SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_RANK_TOO_HIGH_S, name); + SendCommandResult(session, GUILD_INVITE, ERR_GUILD_RANK_TOO_HIGH_S, member->GetName()); return; } } - // When promoting player, rank is decreased, when demoting - increased uint32 newRankId = member->GetRankId() + (demote ? 1 : -1); member->ChangeRank(newRankId); _LogEvent(demote ? GUILD_EVENT_LOG_DEMOTE_PLAYER : GUILD_EVENT_LOG_PROMOTE_PLAYER, player->GetGUIDLow(), GUID_LOPART(member->GetGUID()), newRankId); - _BroadcastEvent(demote ? GE_DEMOTION : GE_PROMOTION, 0, player->GetName(), name.c_str(), _GetRankName(newRankId).c_str()); + _BroadcastEvent(demote ? GE_DEMOTION : GE_PROMOTION, 0, player->GetName(), member->GetName().c_str(), _GetRankName(newRankId).c_str()); + } +} + +void Guild::HandleSetMemberRank(WorldSession* session, uint64 targetGuid, uint64 setterGuid, uint32 rank) +{ + Player* player = session->GetPlayer(); + + // Promoted player must be a member of guild + if (Member* member = GetMember(targetGuid)) + { + if (!_HasRankRight(player, rank > member->GetRankId() ? GR_RIGHT_DEMOTE : GR_RIGHT_PROMOTE)) + { + SendCommandResult(session, GUILD_INVITE, ERR_GUILD_PERMISSIONS); + return; + } + + // Player cannot promote himself + if (member->IsSamePlayer(player->GetGUID())) + { + SendCommandResult(session, GUILD_INVITE, ERR_GUILD_NAME_INVALID); + return; + } + + SendGuildRanksUpdate(setterGuid, targetGuid, rank); } } -void Guild::HandleAddNewRank(WorldSession* session, const std::string& name) +void Guild::HandleAddNewRank(WorldSession* session, std::string const& name) //, uint32 rankId) { if (_GetRanksSize() >= GUILD_RANKS_MAX_COUNT) return; // Only leader can add new rank if (!_IsLeader(session->GetPlayer())) - SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_PERMISSIONS); + SendCommandResult(session, GUILD_INVITE, ERR_GUILD_PERMISSIONS); else { _CreateRank(name, GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK); @@ -1611,7 +1769,7 @@ void Guild::HandleAddNewRank(WorldSession* session, const std::string& name) } } -void Guild::HandleRemoveLowestRank(WorldSession* session) +void Guild::HandleRemoveRank(WorldSession* session, uint32 rankId) { // Cannot remove rank if total count is minimum allowed by the client if (_GetRanksSize() <= GUILD_RANKS_MIN_COUNT) @@ -1619,22 +1777,21 @@ void Guild::HandleRemoveLowestRank(WorldSession* session) // Only leader can delete ranks if (!_IsLeader(session->GetPlayer())) - SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_PERMISSIONS); + SendCommandResult(session, GUILD_INVITE, ERR_GUILD_PERMISSIONS); else { - uint8 rankId = _GetLowestRankId(); // Delete bank rights for rank PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_BANK_RIGHTS_FOR_RANK); stmt->setUInt32(0, m_id); - stmt->setUInt8 (1, rankId); + stmt->setUInt8(1, rankId); CharacterDatabase.Execute(stmt); // Delete rank - stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_LOWEST_RANK); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_RANK); stmt->setUInt32(0, m_id); - stmt->setUInt8 (1, rankId); + stmt->setUInt8(1, rankId); CharacterDatabase.Execute(stmt); - m_ranks.pop_back(); + m_ranks.erase(m_ranks.begin() + rankId-1); HandleQuery(session); HandleRoster(); // Broadcast for tab rights update @@ -1732,7 +1889,7 @@ void Guild::HandleDisband(WorldSession* session) { // Only leader can disband guild if (!_IsLeader(session->GetPlayer())) - Guild::SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_PERMISSIONS); + Guild::SendCommandResult(session, GUILD_INVITE, ERR_GUILD_PERMISSIONS); else { Disband(); @@ -1787,6 +1944,7 @@ void Guild::SendBankTabData(WorldSession* session, uint8 tabId) const void Guild::SendBankTabsInfo(WorldSession* session) const { + // TODO WorldPacket data(SMSG_GUILD_BANK_LIST, 500); data << uint64(m_bankMoney); @@ -1813,7 +1971,7 @@ void Guild::SendBankTabText(WorldSession* session, uint8 tabId) const void Guild::SendPermissions(WorldSession* session) const { uint64 guid = session->GetPlayer()->GetGUID(); - uint8 rankId = session->GetPlayer()->GetRank(); + uint32 rankId = session->GetPlayer()->GetRank(); WorldPacket data(SMSG_GUILD_PERMISSIONS_QUERY_RESULTS, 4 * 15 + 1); data << uint32(rankId); data << uint32(_GetPurchasedTabsSize()); @@ -1827,7 +1985,7 @@ void Guild::SendPermissions(WorldSession* session) const } session->SendPacket(&data); - sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Sent (MSG_GUILD_PERMISSIONS)"); + sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Sent (SMSG_GUILD_PERMISSIONS_QUERY_RESULTS)"); } void Guild::SendMoneyInfo(WorldSession* session) const @@ -1835,7 +1993,7 @@ void Guild::SendMoneyInfo(WorldSession* session) const WorldPacket data(SMSG_GUILD_BANK_MONEY_WITHDRAWN, 4); data << uint64(_GetMemberRemainingMoney(session->GetPlayer()->GetGUID())); session->SendPacket(&data); - sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Sent MSG_GUILD_BANK_MONEY_WITHDRAWN"); + sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Sent SMSG_GUILD_BANK_MONEY_WITHDRAWN"); } void Guild::SendLoginInfo(WorldSession* session) const @@ -2341,7 +2499,7 @@ void Guild::_CreateRank(const std::string& name, uint32 rights) return; // Ranks represent sequence 0, 1, 2, ... where 0 means guildmaster - uint8 newRankId = _GetRanksSize(); + uint32 newRankId = _GetRanksSize(); RankInfo info(m_id, newRankId, name, rights, 0); m_ranks.push_back(info); @@ -2428,7 +2586,7 @@ void Guild::_SetLeaderGUID(Member* pLeader) CharacterDatabase.Execute(stmt); } -void Guild::_SetRankBankMoneyPerDay(uint8 rankId, uint32 moneyPerDay) +void Guild::_SetRankBankMoneyPerDay(uint32 rankId, uint32 moneyPerDay) { if (RankInfo* rankInfo = GetRankInfo(rankId)) { @@ -2440,7 +2598,7 @@ void Guild::_SetRankBankMoneyPerDay(uint8 rankId, uint32 moneyPerDay) } } -void Guild::_SetRankBankTabRightsAndSlots(uint8 rankId, uint8 tabId, GuildBankRightsAndSlots rightsAndSlots, bool saveToDB) +void Guild::_SetRankBankTabRightsAndSlots(uint32 rankId, uint8 tabId, GuildBankRightsAndSlots rightsAndSlots, bool saveToDB) { if (tabId >= _GetPurchasedTabsSize()) return; @@ -2455,28 +2613,28 @@ void Guild::_SetRankBankTabRightsAndSlots(uint8 rankId, uint8 tabId, GuildBankRi } } -inline std::string Guild::_GetRankName(uint8 rankId) const +inline std::string Guild::_GetRankName(uint32 rankId) const { if (const RankInfo* rankInfo = GetRankInfo(rankId)) return rankInfo->GetName(); return ""; } -inline uint32 Guild::_GetRankRights(uint8 rankId) const +inline uint32 Guild::_GetRankRights(uint32 rankId) const { if (const RankInfo* rankInfo = GetRankInfo(rankId)) return rankInfo->GetRights(); return 0; } -inline uint32 Guild::_GetRankBankMoneyPerDay(uint8 rankId) const +inline uint32 Guild::_GetRankBankMoneyPerDay(uint32 rankId) const { if (const RankInfo* rankInfo = GetRankInfo(rankId)) return rankInfo->GetBankMoneyPerDay(); return 0; } -inline uint32 Guild::_GetRankBankTabSlotsPerDay(uint8 rankId, uint8 tabId) const +inline uint32 Guild::_GetRankBankTabSlotsPerDay(uint32 rankId, uint8 tabId) const { if (tabId < _GetPurchasedTabsSize()) if (const RankInfo* rankInfo = GetRankInfo(rankId)) @@ -2484,7 +2642,7 @@ inline uint32 Guild::_GetRankBankTabSlotsPerDay(uint8 rankId, uint8 tabId) const return 0; } -inline uint8 Guild::_GetRankBankTabRights(uint8 rankId, uint8 tabId) const +inline uint32 Guild::_GetRankBankTabRights(uint32 rankId, uint8 tabId) const { if (const RankInfo* rankInfo = GetRankInfo(rankId)) return rankInfo->GetBankTabRights(tabId); @@ -2791,3 +2949,56 @@ void Guild::_BroadcastEvent(GuildEvents guildEvent, uint64 guid, const char* par sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_GUILD_EVENT"); } + +void Guild::SendGuildRanksUpdate(uint64 setterGuid, uint64 targetGuid, uint32 rank) +{ + ObjectGuid tarGuid = targetGuid; + ObjectGuid setGuid = setterGuid; + + Member* member = GetMember(targetGuid); + ASSERT(member); + + WorldPacket data(SMSG_GUILD_RANKS_UPDATE, 100); + data.WriteBit(setGuid[7]); + data.WriteBit(setGuid[2]); + data.WriteBit(tarGuid[2]); + data.WriteBit(setGuid[1]); + data.WriteBit(tarGuid[1]); + data.WriteBit(tarGuid[7]); + data.WriteBit(tarGuid[0]); + data.WriteBit(tarGuid[5]); + data.WriteBit(tarGuid[4]); + data.WriteBit(rank < member->GetRankId()); // 1 == higher, 0 = lower? + data.WriteBit(setGuid[5]); + data.WriteBit(setGuid[0]); + data.WriteBit(tarGuid[6]); + data.WriteBit(setGuid[3]); + data.WriteBit(setGuid[6]); + data.WriteBit(tarGuid[3]); + data.WriteBit(setGuid[4]); + + data.FlushBits(); + + data << uint32(rank); + data.WriteByteSeq(setGuid[3]); + data.WriteByteSeq(tarGuid[7]); + data.WriteByteSeq(setGuid[6]); + data.WriteByteSeq(setGuid[2]); + data.WriteByteSeq(tarGuid[5]); + data.WriteByteSeq(tarGuid[0]); + data.WriteByteSeq(setGuid[7]); + data.WriteByteSeq(setGuid[5]); + data.WriteByteSeq(tarGuid[2]); + data.WriteByteSeq(tarGuid[1]); + data.WriteByteSeq(setGuid[0]); + data.WriteByteSeq(setGuid[4]); + data.WriteByteSeq(setGuid[1]); + data.WriteByteSeq(tarGuid[3]); + data.WriteByteSeq(tarGuid[6]); + data.WriteByteSeq(tarGuid[4]); + BroadcastPacket(&data); + + member->ChangeRank(rank); + + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_GUILD_RANKS_UPDATE"); +} diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h index 036d61144e5..3d88083a67e 100755 --- a/src/server/game/Guilds/Guild.h +++ b/src/server/game/Guilds/Guild.h @@ -77,12 +77,23 @@ enum GuildRankRights enum GuildCommandType { - GUILD_CREATE_S = 0x00, - GUILD_INVITE_S = 0x01, - GUILD_QUIT_S = 0x03, - GUILD_FOUNDER_S = 0x0E, - GUILD_UNK1 = 0x13, - GUILD_UNK2 = 0x14 + GUILD_CREATE = 0x00, + GUILD_INVITE = 0x01, + GUILD_QUIT = 0x03, + GUILD_ROSTER = 0x05, + GUILD_PROMOTE = 0x06, + GUILD_DEMOTE = 0x07, + GUILD_KICK = 0x08, + GUILD_LEADER = 0x0A, + GUILD_MOTD = 0x0B, + GUILD_GUILDCHAT = 0x0D, + GUILD_FOUNDER = 0x0E, + GUILD_CHANGE_RANK = 0x10, + GUILD_EDIT_PUB_NOTE = 0x13, + GUILD_UNK = 0x14, + GUILD_VIEW_TAB = 0x15, + GUILD_MOVE_ITEM = 0x16, + GUILD_REPAIR = 0x19, }; enum GuildCommandError @@ -110,12 +121,15 @@ enum GuildCommandError ERR_GUILD_WITHDRAW_LIMIT = 0x19, ERR_GUILD_NOT_ENOUGH_MONEY = 0x1A, ERR_GUILD_BANK_FULL = 0x1C, - ERR_GUILD_ITEM_NOT_FOUND = 0x1D + ERR_GUILD_ITEM_NOT_FOUND = 0x1D, + ERR_GUILD_TOO_MUCH_MONEY = 0x1F, + ERR_GUILD_WRONG_TAB = 0x20, + ERR_GUILD_REQ_AUTHENTICATOR = 0x22, + ERR_GUILD_BANK_VOUCHER_FAILED = 0x23, }; enum GuildEvents { - // TODO Verify this enum, it changed in 4.x GE_PROMOTION = 1, GE_DEMOTION = 2, GE_MOTD = 3, @@ -130,18 +144,18 @@ enum GuildEvents GE_RANK_CREATED = 12, GE_RANK_DELETED = 13, GE_RANK_ORDER_CHANGED = 14, - // Unk15 = 15, // At guild creation - Set founder + GE_FOUNDER = 15, // At guild creation - Set founder GE_SIGNED_ON = 16, GE_SIGNED_OFF = 17, GE_GUILDBANKBAGSLOTS_CHANGED = 18, GE_BANK_TAB_PURCHASED = 19, GE_BANK_TAB_UPDATED = 20, - GE_BANK_UPDATE_MONEY = 21, - - // To be found: - // GE_BANK_MONEY_WITHDRAWN = 19, - // GE_BANK_TEXT_CHANGED = 20, - // GE_UPDATE_ROSTER = 12, + GE_BANK_MONEY_UPDATED = 21, + GE_BANK_MONEY_WITHDRAWN = 22, + GE_BANK_TEXT_CHANGED = 23, + // 24 - error 795 + GE_SIGNED_ON_MOBILE = 25, + GE_SIGNED_Off_MOBILE = 26, }; enum PetitionTurns @@ -185,7 +199,7 @@ enum GuildBankEventLogTypes GUILD_BANK_LOG_REPAIR_MONEY = 6, GUILD_BANK_LOG_MOVE_ITEM2 = 7, GUILD_BANK_LOG_UNK1 = 8, - GUILD_BANK_LOG_UNK2 = 9, + GUILD_BANK_LOG_BUY_SLOT = 9, }; enum GuildEventLogTypes @@ -208,6 +222,15 @@ enum GuildEmblemError ERR_GUILDEMBLEM_INVALIDVENDOR = 5 }; +enum GuildMemberFlags +{ + GUILDMEMBER_STATUS_NONE = 0x0000, + GUILDMEMBER_STATUS_ONLINE = 0x0001, + GUILDMEMBER_STATUS_AFK = 0x0002, + GUILDMEMBER_STATUS_DND = 0x0004, + GUILDMEMBER_STATUS_MOBILE = 0x0008, // remote chat from mobile app +}; + //////////////////////////////////////////////////////////////////////////////////////////// // Emblem info class EmblemInfo @@ -238,7 +261,7 @@ private: struct GuildBankRightsAndSlots { GuildBankRightsAndSlots() : rights(0), slots(0) { } - GuildBankRightsAndSlots(uint8 _rights, uint32 _slots) : rights(_rights), slots(_slots) { } + GuildBankRightsAndSlots(uint32 _rights, uint32 _slots) : rights(_rights), slots(_slots) { } inline bool IsEqual(GuildBankRightsAndSlots const& rhs) const { return rights == rhs.rights && slots == rhs.slots; } void SetGuildMasterValues() @@ -247,7 +270,7 @@ struct GuildBankRightsAndSlots slots = uint32(GUILD_WITHDRAW_SLOT_UNLIMITED); } - uint8 rights; + uint32 rights; uint32 slots; }; typedef std::vector GuildBankRightsAndSlotsVec; @@ -269,7 +292,7 @@ private: }; public: - Member(uint32 guildId, uint64 guid, uint8 rankId) : m_guildId(guildId), m_guid(guid), m_logoutTime(::time(NULL)), m_rankId(rankId) { } + Member(uint32 guildId, uint64 guid, uint32 rankId) : m_guildId(guildId), m_guid(guid), m_logoutTime(::time(NULL)), m_rankId(rankId) { } void SetStats(Player* player); void SetStats(const std::string& name, uint8 level, uint8 _class, uint32 zoneId, uint32 accountId); @@ -278,14 +301,20 @@ private: void SetPublicNote(const std::string& publicNote); void SetOfficerNote(const std::string& officerNote); + std::string GetPublicNote() { return m_publicNote; }; + std::string GetOfficerNote() { return m_officerNote; }; + bool LoadFromDB(Field* fields); void SaveToDB(SQLTransaction& trans) const; - void WritePacket(WorldPacket& data) const; uint64 GetGUID() const { return m_guid; } std::string GetName() const { return m_name; } uint32 GetAccountId() const { return m_accountId; } - uint8 GetRankId() const { return m_rankId; } + uint32 GetRankId() const { return m_rankId; } + uint8 GetClass() const { return m_class; } + uint8 GetLevel() const { return m_level; } + uint8 GetZone() const { return m_zoneId; } + uint64 GetLogoutTime() const { return m_logoutTime; } void ChangeRank(uint8 newRank); @@ -313,7 +342,7 @@ private: uint64 m_logoutTime; uint32 m_accountId; // Fields from guild_member table - uint8 m_rankId; + uint32 m_rankId; std::string m_publicNote; std::string m_officerNote; @@ -426,14 +455,13 @@ private: { public: RankInfo(uint32 guildId) : m_guildId(guildId), m_rankId(GUILD_RANK_NONE), m_rights(GR_RIGHT_EMPTY), m_bankMoneyPerDay(0) { } - RankInfo(uint32 guildId, uint8 rankId, const std::string& name, uint32 rights, uint32 money) : + RankInfo(uint32 guildId, uint32 rankId, const std::string& name, uint32 rights, uint32 money) : m_guildId(guildId), m_rankId(rankId), m_name(name), m_rights(rights), m_bankMoneyPerDay(money) { } void LoadFromDB(Field* fields); void SaveToDB(SQLTransaction& trans) const; - void WritePacket(WorldPacket& data) const; - uint8 GetId() const { return m_rankId; } + uint32 GetId() const { return m_rankId; } std::string GetName() const { return m_name; } void SetName(const std::string& name); @@ -447,7 +475,7 @@ private: uint32 GetBankMoneyPerDay() const { return m_rankId == GR_GUILDMASTER ? GUILD_WITHDRAW_MONEY_UNLIMITED : m_bankMoneyPerDay; } void SetBankMoneyPerDay(uint32 money); - inline uint8 GetBankTabRights(uint8 tabId) const { return tabId < GUILD_BANK_MAX_TABS ? m_bankTabRightsAndSlots[tabId].rights : 0; } + inline uint32 GetBankTabRights(uint8 tabId) const { return tabId < GUILD_BANK_MAX_TABS ? m_bankTabRightsAndSlots[tabId].rights : 0; } inline uint32 GetBankTabSlotsPerDay(uint8 tabId) const { if (tabId < GUILD_BANK_MAX_TABS) @@ -458,8 +486,7 @@ private: private: uint32 m_guildId; - - uint8 m_rankId; + uint32 m_rankId; std::string m_name; uint32 m_rights; uint32 m_bankMoneyPerDay; @@ -614,21 +641,23 @@ public: // Handle client commands void HandleRoster(WorldSession* session = NULL); // NULL = broadcast void HandleQuery(WorldSession* session); + void HandleGuildRanks(WorldSession* session); void HandleSetMOTD(WorldSession* session, const std::string& motd); void HandleSetInfo(WorldSession* session, const std::string& info); void HandleSetEmblem(WorldSession* session, const EmblemInfo& emblemInfo); void HandleSetLeader(WorldSession* session, const std::string& name); void HandleSetBankTabInfo(WorldSession* session, uint8 tabId, const std::string& name, const std::string& icon); - void HandleSetMemberNote(WorldSession* session, const std::string& name, const std::string& note, bool officer); - void HandleSetRankInfo(WorldSession* session, uint8 rankId, const std::string& name, uint32 rights, uint32 moneyPerDay, GuildBankRightsAndSlotsVec rightsAndSlots); + void HandleSetMemberNote(WorldSession* session, std::string const& note, uint64 guid, bool isPublic); + void HandleSetRankInfo(WorldSession* session, uint32 rankId, const std::string& name, uint32 rights, uint32 moneyPerDay, GuildBankRightsAndSlotsVec rightsAndSlots); void HandleBuyBankTab(WorldSession* session, uint8 tabId); void HandleInviteMember(WorldSession* session, const std::string& name); void HandleAcceptMember(WorldSession* session); void HandleLeaveMember(WorldSession* session); - void HandleRemoveMember(WorldSession* session, const std::string& name); - void HandleUpdateMemberRank(WorldSession* session, const std::string& name, bool demote); + void HandleRemoveMember(WorldSession* session, uint64 guid); + void HandleUpdateMemberRank(WorldSession* session, uint64 targetGuid, bool demote); + void HandleSetMemberRank(WorldSession* session, uint64 targetGuid, uint64 setterGuid, uint32 rank); void HandleAddNewRank(WorldSession* session, const std::string& name); - void HandleRemoveLowestRank(WorldSession* session); + void HandleRemoveRank(WorldSession* session, uint32 rankId); void HandleMemberDepositMoney(WorldSession* session, uint32 amount); bool HandleMemberWithdrawMoney(WorldSession* session, uint32 amount, bool repair = false); void HandleMemberLogout(WorldSession* session); @@ -715,11 +744,11 @@ protected: uint32 m_level; private: - inline uint8 _GetRanksSize() const { return uint8(m_ranks.size()); } - inline const RankInfo* GetRankInfo(uint8 rankId) const { return rankId < _GetRanksSize() ? &m_ranks[rankId] : NULL; } - inline RankInfo* GetRankInfo(uint8 rankId) { return rankId < _GetRanksSize() ? &m_ranks[rankId] : NULL; } + inline uint32 _GetRanksSize() const { return uint32(m_ranks.size()); } + inline const RankInfo* GetRankInfo(uint32 rankId) const { return rankId < _GetRanksSize() ? &m_ranks[rankId] : NULL; } + inline RankInfo* GetRankInfo(uint32 rankId) { return rankId < _GetRanksSize() ? &m_ranks[rankId] : NULL; } inline bool _HasRankRight(Player* player, uint32 right) const { return (_GetRankRights(player->GetRank()) & right) != GR_RIGHT_EMPTY; } - inline uint8 _GetLowestRankId() const { return uint8(m_ranks.size() - 1); } + inline uint32 _GetLowestRankId() const { return uint32(m_ranks.size() - 1); } inline uint8 _GetPurchasedTabsSize() const { return uint8(m_bankTabs.size()); } inline BankTab* GetBankTab(uint8 tabId) { return tabId < m_bankTabs.size() ? m_bankTabs[tabId] : NULL; } @@ -741,7 +770,7 @@ private: if (itr->second->GetName() == name) return itr->second; - SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_PLAYER_NOT_IN_GUILD_S, name); + SendCommandResult(session, GUILD_INVITE, ERR_GUILD_PLAYER_NOT_IN_GUILD_S, name); return NULL; } inline void _DeleteMemberFromDB(uint32 lowguid) const @@ -766,13 +795,13 @@ private: bool _ModifyBankMoney(SQLTransaction& trans, uint64 amount, bool add); void _SetLeaderGUID(Member* pLeader); - void _SetRankBankMoneyPerDay(uint8 rankId, uint32 moneyPerDay); - void _SetRankBankTabRightsAndSlots(uint8 rankId, uint8 tabId, GuildBankRightsAndSlots rightsAndSlots, bool saveToDB = true); - uint8 _GetRankBankTabRights(uint8 rankId, uint8 tabId) const; - uint32 _GetRankRights(uint8 rankId) const; - uint32 _GetRankBankMoneyPerDay(uint8 rankId) const; - uint32 _GetRankBankTabSlotsPerDay(uint8 rankId, uint8 tabId) const; - std::string _GetRankName(uint8 rankId) const; + void _SetRankBankMoneyPerDay(uint32 rankId, uint32 moneyPerDay); + void _SetRankBankTabRightsAndSlots(uint32 rankId, uint8 tabId, GuildBankRightsAndSlots rightsAndSlots, bool saveToDB = true); + uint32 _GetRankBankTabRights(uint32 rankId, uint8 tabId) const; + uint32 _GetRankRights(uint32 rankId) const; + uint32 _GetRankBankMoneyPerDay(uint32 rankId) const; + uint32 _GetRankBankTabSlotsPerDay(uint32 rankId, uint8 tabId) const; + std::string _GetRankName(uint32 rankId) const; uint32 _GetMemberRemainingSlots(uint64 guid, uint8 tabId) const; uint32 _GetMemberRemainingMoney(uint64 guid) const; @@ -791,6 +820,8 @@ private: void _SendBankMoneyUpdate(WorldSession* session) const; void _SendBankContentUpdate(MoveItemData* pSrc, MoveItemData* pDest) const; void _SendBankContentUpdate(uint8 tabId, SlotIds slots) const; + + void SendGuildRanksUpdate(uint64 setterGuid, uint64 targetGuid, uint32 rank); void _BroadcastEvent(GuildEvents guildEvent, uint64 guid, const char* param1 = NULL, const char* param2 = NULL, const char* param3 = NULL) const; }; diff --git a/src/server/game/Handlers/GuildHandler.cpp b/src/server/game/Handlers/GuildHandler.cpp index 53862e99db9..5ed44b61333 100755 --- a/src/server/game/Handlers/GuildHandler.cpp +++ b/src/server/game/Handlers/GuildHandler.cpp @@ -36,7 +36,7 @@ inline Guild* _GetPlayerGuild(WorldSession* session, bool sendError = false) if (Guild* guild = sGuildMgr->GetGuildById(guildId)) // Find guild by id return guild; if (sendError) - Guild::SendCommandResult(session, GUILD_CREATE_S, ERR_GUILD_PLAYER_NOT_IN_GUILD); + Guild::SendCommandResult(session, GUILD_CREATE, ERR_GUILD_PLAYER_NOT_IN_GUILD); return NULL; } @@ -55,7 +55,7 @@ void WorldSession::HandleGuildQueryOpcode(WorldPacket& recvPacket) return; } - Guild::SendCommandResult(this, GUILD_CREATE_S, ERR_GUILD_PLAYER_NOT_IN_GUILD); + Guild::SendCommandResult(this, GUILD_CREATE, ERR_GUILD_PLAYER_NOT_IN_GUILD); } void WorldSession::HandleGuildCreateOpcode(WorldPacket& recvPacket) @@ -79,8 +79,8 @@ void WorldSession::HandleGuildInviteOpcode(WorldPacket& recvPacket) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_INVITE"); - std::string invitedName; - recvPacket >> invitedName; + uint32 nameLength = recvPacket.ReadBits(7); + std::string invitedName = recvPacket.ReadString(nameLength); if (normalizePlayerName(invitedName)) if (Guild* guild = _GetPlayerGuild(this, true)) @@ -91,12 +91,28 @@ void WorldSession::HandleGuildRemoveOpcode(WorldPacket& recvPacket) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_REMOVE"); - std::string playerName; - recvPacket >> playerName; + ObjectGuid playerGuid; + + playerGuid[6] = recvPacket.ReadBit(); + playerGuid[5] = recvPacket.ReadBit(); + playerGuid[4] = recvPacket.ReadBit(); + playerGuid[0] = recvPacket.ReadBit(); + playerGuid[1] = recvPacket.ReadBit(); + playerGuid[3] = recvPacket.ReadBit(); + playerGuid[7] = recvPacket.ReadBit(); + playerGuid[2] = recvPacket.ReadBit(); + + recvPacket.ReadByteSeq(playerGuid[2]); + recvPacket.ReadByteSeq(playerGuid[6]); + recvPacket.ReadByteSeq(playerGuid[5]); + recvPacket.ReadByteSeq(playerGuid[7]); + recvPacket.ReadByteSeq(playerGuid[1]); + recvPacket.ReadByteSeq(playerGuid[4]); + recvPacket.ReadByteSeq(playerGuid[3]); + recvPacket.ReadByteSeq(playerGuid[0]); - if (normalizePlayerName(playerName)) - if (Guild* guild = _GetPlayerGuild(this, true)) - guild->HandleRemoveMember(this, playerName); + if (Guild* guild = _GetPlayerGuild(this, true)) + guild->HandleRemoveMember(this, playerGuid); } void WorldSession::HandleGuildAcceptOpcode(WorldPacket& /*recvPacket*/) @@ -129,36 +145,114 @@ void WorldSession::HandleGuildRosterOpcode(WorldPacket& recvPacket) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_ROSTER"); + recvPacket.rfinish(); - uint64 guildGuid = 0; - - if (Guild* guild = sGuildMgr->GetGuildByGuid(guildGuid)) - if (guild->IsMember(GetPlayer()->GetGUID())) - guild->HandleRoster(this); + if (Guild* guild = _GetPlayerGuild(this, true)) + guild->HandleRoster(this); } void WorldSession::HandleGuildPromoteOpcode(WorldPacket& recvPacket) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_PROMOTE"); - std::string playerName; - recvPacket >> playerName; + ObjectGuid targetGuid; + + targetGuid[7] = recvPacket.ReadBit(); + targetGuid[2] = recvPacket.ReadBit(); + targetGuid[5] = recvPacket.ReadBit(); + targetGuid[6] = recvPacket.ReadBit(); + targetGuid[1] = recvPacket.ReadBit(); + targetGuid[0] = recvPacket.ReadBit(); + targetGuid[3] = recvPacket.ReadBit(); + targetGuid[4] = recvPacket.ReadBit(); + + recvPacket.ReadByteSeq(targetGuid[0]); + recvPacket.ReadByteSeq(targetGuid[5]); + recvPacket.ReadByteSeq(targetGuid[2]); + recvPacket.ReadByteSeq(targetGuid[3]); + recvPacket.ReadByteSeq(targetGuid[6]); + recvPacket.ReadByteSeq(targetGuid[4]); + recvPacket.ReadByteSeq(targetGuid[1]); + recvPacket.ReadByteSeq(targetGuid[7]); - if (normalizePlayerName(playerName)) - if (Guild* guild = _GetPlayerGuild(this, true)) - guild->HandleUpdateMemberRank(this, playerName, false); + if (Guild* guild = _GetPlayerGuild(this, true)) + guild->HandleUpdateMemberRank(this, targetGuid, false); } void WorldSession::HandleGuildDemoteOpcode(WorldPacket& recvPacket) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_DEMOTE"); - std::string playerName; - recvPacket >> playerName; + ObjectGuid targetGuid; + + targetGuid[7] = recvPacket.ReadBit(); + targetGuid[1] = recvPacket.ReadBit(); + targetGuid[5] = recvPacket.ReadBit(); + targetGuid[6] = recvPacket.ReadBit(); + targetGuid[2] = recvPacket.ReadBit(); + targetGuid[3] = recvPacket.ReadBit(); + targetGuid[0] = recvPacket.ReadBit(); + targetGuid[4] = recvPacket.ReadBit(); + + recvPacket.ReadByteSeq(targetGuid[1]); + recvPacket.ReadByteSeq(targetGuid[2]); + recvPacket.ReadByteSeq(targetGuid[7]); + recvPacket.ReadByteSeq(targetGuid[5]); + recvPacket.ReadByteSeq(targetGuid[6]); + recvPacket.ReadByteSeq(targetGuid[0]); + recvPacket.ReadByteSeq(targetGuid[4]); + recvPacket.ReadByteSeq(targetGuid[3]); - if (normalizePlayerName(playerName)) - if (Guild* guild = _GetPlayerGuild(this, true)) - guild->HandleUpdateMemberRank(this, playerName, true); + if (Guild* guild = _GetPlayerGuild(this, true)) + guild->HandleUpdateMemberRank(this, targetGuid, true); +} + +void WorldSession::HandleGuildAssignRankOpcode(WorldPacket& recvPacket) +{ + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_ASSIGN_MEMBER_RANK"); + + ObjectGuid targetGuid; + ObjectGuid setterGuid; + + uint32 rankId; + recvPacket >> rankId; + + targetGuid[1] = recvPacket.ReadBit(); + targetGuid[7] = recvPacket.ReadBit(); + setterGuid[4] = recvPacket.ReadBit(); + setterGuid[2] = recvPacket.ReadBit(); + targetGuid[4] = recvPacket.ReadBit(); + targetGuid[5] = recvPacket.ReadBit(); + targetGuid[6] = recvPacket.ReadBit(); + setterGuid[1] = recvPacket.ReadBit(); + setterGuid[7] = recvPacket.ReadBit(); + targetGuid[2] = recvPacket.ReadBit(); + targetGuid[3] = recvPacket.ReadBit(); + targetGuid[0] = recvPacket.ReadBit(); + setterGuid[6] = recvPacket.ReadBit(); + setterGuid[3] = recvPacket.ReadBit(); + setterGuid[0] = recvPacket.ReadBit(); + setterGuid[5] = recvPacket.ReadBit(); + + recvPacket.ReadByteSeq(targetGuid[0]); + recvPacket.ReadByteSeq(setterGuid[1]); + recvPacket.ReadByteSeq(setterGuid[3]); + recvPacket.ReadByteSeq(setterGuid[5]); + recvPacket.ReadByteSeq(targetGuid[7]); + recvPacket.ReadByteSeq(targetGuid[3]); + recvPacket.ReadByteSeq(setterGuid[0]); + recvPacket.ReadByteSeq(targetGuid[1]); + recvPacket.ReadByteSeq(setterGuid[6]); + recvPacket.ReadByteSeq(targetGuid[2]); + recvPacket.ReadByteSeq(targetGuid[5]); + recvPacket.ReadByteSeq(targetGuid[4]); + recvPacket.ReadByteSeq(setterGuid[2]); + recvPacket.ReadByteSeq(setterGuid[4]); + recvPacket.ReadByteSeq(targetGuid[6]); + recvPacket.ReadByteSeq(setterGuid[7]); + + if (Guild* guild = _GetPlayerGuild(this, true)) + guild->HandleSetMemberRank(this, targetGuid, setterGuid, rankId); } void WorldSession::HandleGuildLeaveOpcode(WorldPacket& /*recvPacket*/) @@ -193,107 +287,104 @@ void WorldSession::HandleGuildMOTDOpcode(WorldPacket& recvPacket) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_MOTD"); - std::string motd; // Empty by default - if (!recvPacket.empty()) - recvPacket >> motd; + uint32 motdLength = recvPacket.ReadBits(11); + std::string motd = recvPacket.ReadString(motdLength); if (Guild* guild = _GetPlayerGuild(this, true)) guild->HandleSetMOTD(this, motd); } -void WorldSession::HandleGuildSetPublicNoteOpcode(WorldPacket& recvPacket) +void WorldSession::HandleGuildSetNoteOpcode(WorldPacket& recvPacket) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_SET_PUBLIC_NOTE"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_SET_NOTE"); - std::string playerName; - recvPacket >> playerName; + ObjectGuid playerGuid; - std::string publicNote; - recvPacket >> publicNote; + playerGuid[1] = recvPacket.ReadBit(); + playerGuid[4] = recvPacket.ReadBit(); + playerGuid[5] = recvPacket.ReadBit(); + playerGuid[3] = recvPacket.ReadBit(); + playerGuid[0] = recvPacket.ReadBit(); + playerGuid[7] = recvPacket.ReadBit(); + bool type = recvPacket.ReadBit(); // 0 == Officer, 1 == Public + playerGuid[6] = recvPacket.ReadBit(); + uint32 noteLength = recvPacket.ReadBits(8); + playerGuid[2] = recvPacket.ReadBit(); - if (normalizePlayerName(playerName)) - if (Guild* guild = _GetPlayerGuild(this, true)) - guild->HandleSetMemberNote(this, playerName, publicNote, false); -} + recvPacket.ReadByteSeq(playerGuid[4]); + recvPacket.ReadByteSeq(playerGuid[5]); + recvPacket.ReadByteSeq(playerGuid[0]); + recvPacket.ReadByteSeq(playerGuid[3]); + recvPacket.ReadByteSeq(playerGuid[1]); + recvPacket.ReadByteSeq(playerGuid[6]); + recvPacket.ReadByteSeq(playerGuid[7]); + std::string note = recvPacket.ReadString(noteLength); + recvPacket.ReadByteSeq(playerGuid[2]); -void WorldSession::HandleGuildSetOfficerNoteOpcode(WorldPacket& recvPacket) -{ - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_SET_OFFICER_NOTE"); - - std::string playerName; - recvPacket >> playerName; - - std::string officerNote; - recvPacket >> officerNote; - - if (normalizePlayerName(playerName)) - if (Guild* guild = _GetPlayerGuild(this, true)) - guild->HandleSetMemberNote(this, playerName, officerNote, true); + if (Guild* guild = _GetPlayerGuild(this, true)) + guild->HandleSetMemberNote(this, note, playerGuid, type); } -void WorldSession::HandleGuildRankOpcode(WorldPacket& recvPacket) +void WorldSession::HandleGuildQueryRanksOpcode(WorldPacket& recvData) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_RANK"); - - Guild* guild = _GetPlayerGuild(this, true); - if (!guild) - { - recvPacket.rpos(recvPacket.wpos()); - return; - } + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_QUERY_RANKS"); - uint32 rankId; - recvPacket >> rankId; - - uint32 rights; - recvPacket >> rights; - - std::string rankName; - recvPacket >> rankName; - - uint32 money; - recvPacket >> money; - - GuildBankRightsAndSlotsVec rightsAndSlots(GUILD_BANK_MAX_TABS); - for (uint8 tabId = 0; tabId < GUILD_BANK_MAX_TABS; ++tabId) - { - uint32 bankRights; - uint32 slots; + ObjectGuid guildGuid; - recvPacket >> bankRights; - recvPacket >> slots; + guildGuid[2] = recvData.ReadBit(); + guildGuid[3] = recvData.ReadBit(); + guildGuid[0] = recvData.ReadBit(); + guildGuid[6] = recvData.ReadBit(); + guildGuid[4] = recvData.ReadBit(); + guildGuid[7] = recvData.ReadBit(); + guildGuid[5] = recvData.ReadBit(); + guildGuid[1] = recvData.ReadBit(); - rightsAndSlots[tabId] = GuildBankRightsAndSlots(uint8(bankRights), slots); - } + recvData.ReadByteSeq(guildGuid[3]); + recvData.ReadByteSeq(guildGuid[4]); + recvData.ReadByteSeq(guildGuid[5]); + recvData.ReadByteSeq(guildGuid[7]); + recvData.ReadByteSeq(guildGuid[1]); + recvData.ReadByteSeq(guildGuid[0]); + recvData.ReadByteSeq(guildGuid[6]); + recvData.ReadByteSeq(guildGuid[2]); - guild->HandleSetRankInfo(this, rankId, rankName, rights, money, rightsAndSlots); + if (Guild* guild = sGuildMgr->GetGuildByGuid(guildGuid)) + if (guild->IsMember(_player->GetGUID())) + guild->HandleGuildRanks(this); } void WorldSession::HandleGuildAddRankOpcode(WorldPacket& recvPacket) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_ADD_RANK"); - std::string rankName; - recvPacket >> rankName; + uint32 rankId; + recvPacket >> rankId; + + uint32 length = recvPacket.ReadBits(7); + std::string rankName = recvPacket.ReadString(length); if (Guild* guild = _GetPlayerGuild(this, true)) - guild->HandleAddNewRank(this, rankName); + guild->HandleAddNewRank(this, rankName); //, rankId); } -void WorldSession::HandleGuildDelRankOpcode(WorldPacket& /*recvPacket*/) +void WorldSession::HandleGuildDelRankOpcode(WorldPacket& recvPacket) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_DEL_RANK"); + uint32 rankId; + recvPacket >> rankId; + if (Guild* guild = _GetPlayerGuild(this, true)) - guild->HandleRemoveLowestRank(this); + guild->HandleRemoveRank(this, rankId); } void WorldSession::HandleGuildChangeInfoTextOpcode(WorldPacket& recvPacket) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_INFO_TEXT"); - std::string info; - recvPacket >> info; + uint32 length = recvPacket.ReadBits(12); + std::string info = recvPacket.ReadString(length); if (Guild* guild = _GetPlayerGuild(this, true)) guild->HandleSetInfo(this, info); @@ -347,7 +438,7 @@ void WorldSession::HandleGuildBankMoneyWithdrawn(WorldPacket & /* recv_data */) void WorldSession::HandleGuildPermissions(WorldPacket& /* recv_data */) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (MSG_GUILD_PERMISSIONS)"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (CMSG_GUILD_PERMISSIONS)"); if (Guild* guild = _GetPlayerGuild(this)) guild->SendPermissions(this); @@ -369,7 +460,7 @@ void WorldSession::HandleGuildBankerActivate(WorldPacket & recv_data) if (Guild* guild = _GetPlayerGuild(this)) guild->SendBankTabsInfo(this); else - Guild::SendCommandResult(this, GUILD_UNK1, ERR_GUILD_PLAYER_NOT_IN_GUILD); + Guild::SendCommandResult(this, GUILD_VIEW_TAB, ERR_GUILD_PLAYER_NOT_IN_GUILD); } } @@ -459,13 +550,14 @@ void WorldSession::HandleGuildBankSwapItems(WorldPacket & recv_data) uint8 destSlotId; recv_data >> destSlotId; - recv_data.read_skip(); // Always 0 + + uint32 destItemEntry; + recv_data >> destItemEntry; recv_data >> tabId; recv_data >> slotId; recv_data >> itemEntry; recv_data.read_skip(); // Always 0 - recv_data >> splitedAmount; guild->SwapItems(GetPlayer(), tabId, slotId, destTabId, destSlotId, splitedAmount); @@ -515,7 +607,7 @@ void WorldSession::HandleGuildBankBuyTab(WorldPacket & recv_data) uint8 tabId; recv_data >> tabId; - if (GetPlayer()->GetGameObjectIfCanInteractWith(GoGuid, GAMEOBJECT_TYPE_GUILD_BANK)) + if (!GoGuid || GetPlayer()->GetGameObjectIfCanInteractWith(GoGuid, GAMEOBJECT_TYPE_GUILD_BANK)) if (Guild* guild = _GetPlayerGuild(this)) guild->HandleBuyBankTab(this, tabId); } @@ -578,26 +670,71 @@ void WorldSession::HandleSetGuildBankTabText(WorldPacket& recv_data) guild->SetBankTabText(tabId, text); } -void WorldSession::HandleGuildQueryXPOpcode(WorldPacket& recv_data) +void WorldSession::HandleGuildQueryXPOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUERY_GUILD_XP"); - /* - Bitstream is correct, it just needs a proper guild implementation - uint64 playerGuid = 0; - BitStream mask = recv_data.ReadBitStream(8); + ObjectGuid guildGuid; + + guildGuid[2] = recvData.ReadBit(); + guildGuid[1] = recvData.ReadBit(); + guildGuid[0] = recvData.ReadBit(); + guildGuid[5] = recvData.ReadBit(); + guildGuid[4] = recvData.ReadBit(); + guildGuid[7] = recvData.ReadBit(); + guildGuid[6] = recvData.ReadBit(); + guildGuid[3] = recvData.ReadBit(); - ByteBuffer bytes(8, true); + recvData.ReadByteSeq(guildGuid[7]); + recvData.ReadByteSeq(guildGuid[2]); + recvData.ReadByteSeq(guildGuid[3]); + recvData.ReadByteSeq(guildGuid[6]); + recvData.ReadByteSeq(guildGuid[1]); + recvData.ReadByteSeq(guildGuid[5]); + recvData.ReadByteSeq(guildGuid[0]); + recvData.ReadByteSeq(guildGuid[4]); - recv_data.ReadXorByte(mask[5], bytes[6]); - recv_data.ReadXorByte(mask[1], bytes[2]); - recv_data.ReadXorByte(mask[7], bytes[1]); - recv_data.ReadXorByte(mask[4], bytes[4]); - recv_data.ReadXorByte(mask[0], bytes[0]); - recv_data.ReadXorByte(mask[6], bytes[3]); - recv_data.ReadXorByte(mask[3], bytes[5]); - recv_data.ReadXorByte(mask[2], bytes[7]); + //if (Guild* guild = sGuildMgr->GetGuildByGuid(guildGuid)) + // guild->Send SMSG_GUILD_XP +} + +void WorldSession::HandleGuildSetRankPermissionsOpcode(WorldPacket& recvPacket) +{ + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_SET_RANK_PERMISSIONS"); + + Guild* guild = _GetPlayerGuild(this, true); + if (!guild) + { + recvPacket.rfinish(); + return; + } + + uint32 unk; + uint32 rankId; + uint32 oldRights; + uint32 newRights; + uint32 moneyPerDay; + + recvPacket >> unk; + recvPacket >> oldRights; + recvPacket >> newRights; + + GuildBankRightsAndSlotsVec rightsAndSlots(GUILD_BANK_MAX_TABS); + for (uint8 tabId = 0; tabId < GUILD_BANK_MAX_TABS; ++tabId) + { + uint32 bankRights; + uint32 slots; + + recvPacket >> bankRights; + recvPacket >> slots; + + rightsAndSlots[tabId] = GuildBankRightsAndSlots(uint8(bankRights), slots); + } + + recvPacket >> moneyPerDay; + recvPacket >> rankId; + uint32 nameLength = recvPacket.ReadBits(7); + std::string rankName = recvPacket.ReadString(nameLength); - playerGuid = BitConverter::ToUInt64(bytes); - */ + guild->HandleSetRankInfo(this, rankId, rankName, newRights, moneyPerDay, rightsAndSlots); } diff --git a/src/server/game/Handlers/PetitionsHandler.cpp b/src/server/game/Handlers/PetitionsHandler.cpp index 06dc82315bc..f2aa66d4e66 100755 --- a/src/server/game/Handlers/PetitionsHandler.cpp +++ b/src/server/game/Handlers/PetitionsHandler.cpp @@ -157,12 +157,12 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data) { if (sGuildMgr->GetGuildByName(name)) { - Guild::SendCommandResult(this, GUILD_CREATE_S, ERR_GUILD_NAME_EXISTS_S, name); + Guild::SendCommandResult(this, GUILD_CREATE, ERR_GUILD_NAME_EXISTS_S, name); return; } if (sObjectMgr->IsReservedName(name) || !ObjectMgr::IsValidCharterName(name)) { - Guild::SendCommandResult(this, GUILD_CREATE_S, ERR_GUILD_NAME_INVALID, name); + Guild::SendCommandResult(this, GUILD_CREATE, ERR_GUILD_NAME_INVALID, name); return; } } @@ -423,12 +423,12 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket & recv_data) { if (sGuildMgr->GetGuildByName(newName)) { - Guild::SendCommandResult(this, GUILD_CREATE_S, ERR_GUILD_NAME_EXISTS_S, newName); + Guild::SendCommandResult(this, GUILD_CREATE, ERR_GUILD_NAME_EXISTS_S, newName); return; } if (sObjectMgr->IsReservedName(newName) || !ObjectMgr::IsValidCharterName(newName)) { - Guild::SendCommandResult(this, GUILD_CREATE_S, ERR_GUILD_NAME_INVALID, newName); + Guild::SendCommandResult(this, GUILD_CREATE, ERR_GUILD_NAME_INVALID, newName); return; } } @@ -498,7 +498,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data) if (type != GUILD_CHARTER_TYPE) SendArenaTeamCommandResult(ERR_ARENA_TEAM_INVITE_SS, "", "", ERR_ARENA_TEAM_NOT_ALLIED); else - Guild::SendCommandResult(this, GUILD_CREATE_S, ERR_GUILD_NOT_ALLIED); + Guild::SendCommandResult(this, GUILD_CREATE, ERR_GUILD_NOT_ALLIED); return; } @@ -530,12 +530,12 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data) { if (_player->GetGuildId()) { - Guild::SendCommandResult(this, GUILD_INVITE_S, ERR_ALREADY_IN_GUILD_S, _player->GetName()); + Guild::SendCommandResult(this, GUILD_INVITE, ERR_ALREADY_IN_GUILD_S, _player->GetName()); return; } if (_player->GetGuildIdInvited()) { - Guild::SendCommandResult(this, GUILD_INVITE_S, ERR_ALREADY_INVITED_TO_GUILD_S, _player->GetName()); + Guild::SendCommandResult(this, GUILD_INVITE, ERR_ALREADY_INVITED_TO_GUILD_S, _player->GetName()); return; } } @@ -658,7 +658,7 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recv_data) if (type != GUILD_CHARTER_TYPE) SendArenaTeamCommandResult(ERR_ARENA_TEAM_INVITE_SS, "", "", ERR_ARENA_TEAM_NOT_ALLIED); else - Guild::SendCommandResult(this, GUILD_CREATE_S, ERR_GUILD_NOT_ALLIED); + Guild::SendCommandResult(this, GUILD_CREATE, ERR_GUILD_NOT_ALLIED); return; } @@ -692,13 +692,13 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recv_data) { if (player->GetGuildId()) { - Guild::SendCommandResult(this, GUILD_INVITE_S, ERR_ALREADY_IN_GUILD_S, _player->GetName()); + Guild::SendCommandResult(this, GUILD_INVITE, ERR_ALREADY_IN_GUILD_S, _player->GetName()); return; } if (player->GetGuildIdInvited()) { - Guild::SendCommandResult(this, GUILD_INVITE_S, ERR_ALREADY_INVITED_TO_GUILD_S, _player->GetName()); + Guild::SendCommandResult(this, GUILD_INVITE, ERR_ALREADY_INVITED_TO_GUILD_S, _player->GetName()); return; } } @@ -790,7 +790,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data) // Check if guild name is already taken if (sGuildMgr->GetGuildByName(name)) { - Guild::SendCommandResult(this, GUILD_CREATE_S, ERR_GUILD_NAME_EXISTS_S, name); + Guild::SendCommandResult(this, GUILD_CREATE, ERR_GUILD_NAME_EXISTS_S, name); return; } } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index f4ed1b1df0b..6fcd9b0ab3b 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -314,41 +314,44 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_GROUP_CHANGE_SUB_GROUP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupChangeSubGroupOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupDeclineOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_DISBAND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupDisbandOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_GROUP_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupInviteOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GROUP_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupInviteOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_RAID_CONVERT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupRaidConvertOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_SET_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupSetLeaderOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_SWAP_SUB_GROUP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupSwapSubGroupOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_UNINVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupUninviteOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_UNINVITE_GUID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupUninviteGuidOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildAcceptOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildAcceptOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_ACHIEVEMENT_PROGRESS_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildAchievementProgressQuery); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_ADD_RANK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildAddRankOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_ADD_RANK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildAddRankOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_ASSIGN_MEMBER_RANK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildAssignRankOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANKER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankerActivate ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_BUY_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankBuyTab ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_BUY_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankBuyTab ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_DEPOSIT_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankDepositMoney ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_MONEY_WITHDRAWN_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankMoneyWithdrawn ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_QUERY_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankQueryTab ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_SWAP_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankSwapItems ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_UPDATE_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankUpdateTab ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_QUERY_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankQueryTab ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_SWAP_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankSwapItems ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_UPDATE_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankUpdateTab ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_WITHDRAW_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankWithdrawMoney ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_CREATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildCreateOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDeclineOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_DEL_RANK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDelRankOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_DEMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDemoteOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDeclineOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_DEL_RANK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDelRankOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_DEMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDemoteOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_DISBAND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDisbandOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildInfoOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_INFO_TEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildChangeInfoTextOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildInviteOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_INFO_TEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildChangeInfoTextOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildInviteOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildLeaderOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildLeaveOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_MOTD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildMOTDOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_PROMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildPromoteOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_MOTD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildMOTDOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_PERMISSIONS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildPermissions ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_PROMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildPromoteOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_QUERY, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildQueryOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_RANK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildRankOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_REMOVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildRemoveOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_ROSTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildRosterOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_SET_OFFICER_NOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildSetOfficerNoteOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_SET_PUBLIC_NOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildSetPublicNoteOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_QUERY_RANKS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildQueryRanksOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_REMOVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildRemoveOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_ROSTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildRosterOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_SET_ACHIEVEMENT_TRACKING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_SET_NOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildSetNoteOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_SET_RANK_PERMISSIONS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildSetRankPermissionsOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_HEARTH_AND_RESURRECT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleHearthAndResurrect ); //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_DIMINISHING_RETURNS_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_KNOCKBACK_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -474,7 +477,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_PETGODMODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_PETITION_BUY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionBuyOpcode ); DEFINE_OPCODE_HANDLER(CMSG_PETITION_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionQueryOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_PETITION_SHOWLIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionShowListOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_PETITION_SHOWLIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionShowListOpcode ); DEFINE_OPCODE_HANDLER(CMSG_PETITION_SHOW_SIGNATURES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionShowSignOpcode ); DEFINE_OPCODE_HANDLER(CMSG_PETITION_SIGN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionSignOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_PET_ABANDON, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetAbandon ); @@ -500,6 +503,11 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_PROFILEDATA_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_PUSHQUESTTOPARTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePushQuestToParty ); //DEFINE_OPCODE_HANDLER(CMSG_PVP_QUEUE_STATS_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_MAX_XP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_MEMBERS_FOR_RECIPE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_MEMBER_RECIPES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_RECIPES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_REWARDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_XP, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildQueryXPOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_QUERY_INSPECT_ACHIEVEMENTS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryInspectAchievements ); //DEFINE_OPCODE_HANDLER(CMSG_QUERY_OBJECT_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -711,7 +719,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(MSG_GM_SUMMON, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_GUILD_BANK_LOG_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankLogQuery ); //DEFINE_OPCODE_HANDLER(MSG_GUILD_EVENT_LOG_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildEventLogQueryOpcode ); - DEFINE_OPCODE_HANDLER(MSG_GUILD_PERMISSIONS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildPermissions ); //DEFINE_OPCODE_HANDLER(MSG_INSPECT_ARENA_TEAMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectArenaTeamsOpcode ); //DEFINE_OPCODE_HANDLER(MSG_INSPECT_HONOR_STATS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectHonorStatsOpcode ); //DEFINE_OPCODE_HANDLER(MSG_LIST_STABLED_PETS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleListStabledPetsOpcode ); @@ -932,7 +939,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_DAMAGE_CALC_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DANCE_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DBLOOKUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DB_REPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_DB_REPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DEATH_RELEASE_LOC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DEBUGAURAPROC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DEBUG_AISTATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1016,16 +1023,18 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_GUILD_ACHIEVEMENT_EARNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_MONEY_WITHDRAWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_CRITERIA_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_CRITERIA_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_DECLINE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_DECLINE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_PERMISSIONS_QUERY_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_ROSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_RANK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_RANKS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_ROSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_HEALTH_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_HIGHEST_THREAT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_HOTFIX_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 5bf515da064..7acaedfaa93 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -264,18 +264,17 @@ enum Opcodes CMSG_GUILD_EVENT_LOG_QUERY = 0x1220, CMSG_GUILD_INFO = 0x0000, CMSG_GUILD_INFO_TEXT = 0x3227, - CMSG_GUILD_INVITE = 0x0000, - CMSG_GUILD_INVITE_BY_NAME = 0x24B0, + CMSG_GUILD_INVITE = 0x24B0, CMSG_GUILD_LEADER = 0x0000, CMSG_GUILD_LEAVE = 0x1021, CMSG_GUILD_MEMBER_SEND_SOR_REQUEST = 0x3225, CMSG_GUILD_MOTD = 0x1035, CMSG_GUILD_NEWS_UPDATE_STICKY = 0x3223, + CMSG_GUILD_PERMISSIONS = 0x3022, CMSG_GUILD_PROMOTE = 0x1030, CMSG_GUILD_QUERY = 0x4426, CMSG_GUILD_QUERY_NEWS = 0x3020, - CMSG_GUILD_RANK = 0x0000, - CMSG_GUILD_RANKS = 0x1026, + CMSG_GUILD_QUERY_RANKS = 0x1026, CMSG_GUILD_REMOVE = 0x1231, CMSG_GUILD_REPLACE_GUILD_MASTER = 0x1034, CMSG_GUILD_REQUEST_CHALLENGE_UPDATE = 0x1224, @@ -606,7 +605,6 @@ enum Opcodes MSG_GM_SUMMON = 0x0000, MSG_GUILD_BANK_LOG_QUERY = 0x0000, MSG_GUILD_EVENT_LOG_QUERY = 0x0000, - MSG_GUILD_PERMISSIONS = 0x3022, MSG_INSPECT_ARENA_TEAMS = 0x2704, MSG_LIST_STABLED_PETS = 0x0834, MSG_MINIMAP_PING = 0x6635, diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index d957d9ec8db..abf3e5934b8 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -574,13 +574,14 @@ class WorldSession void HandleGuildRosterOpcode(WorldPacket& recvPacket); void HandleGuildPromoteOpcode(WorldPacket& recvPacket); void HandleGuildDemoteOpcode(WorldPacket& recvPacket); + void HandleGuildAssignRankOpcode(WorldPacket& recvPacket); void HandleGuildLeaveOpcode(WorldPacket& recvPacket); void HandleGuildDisbandOpcode(WorldPacket& recvPacket); void HandleGuildLeaderOpcode(WorldPacket& recvPacket); void HandleGuildMOTDOpcode(WorldPacket& recvPacket); - void HandleGuildSetPublicNoteOpcode(WorldPacket& recvPacket); - void HandleGuildSetOfficerNoteOpcode(WorldPacket& recvPacket); - void HandleGuildRankOpcode(WorldPacket& recvPacket); + void HandleGuildSetNoteOpcode(WorldPacket& recvPacket); + void HandleGuildQueryRanksOpcode(WorldPacket& recvPacket); + void HandleGuildSetRankPermissionsOpcode(WorldPacket& recvPacket); void HandleGuildAddRankOpcode(WorldPacket& recvPacket); void HandleGuildDelRankOpcode(WorldPacket& recvPacket); void HandleGuildChangeInfoTextOpcode(WorldPacket& recvPacket); diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index 1d6d9be4a33..222e212a08f 100755 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -161,7 +161,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() // 0: uint32, 1: uint8, 3: string, 4: uint32 PREPARE_STATEMENT(CHAR_INS_GUILD_RANK, "INSERT INTO guild_rank (guildid, rid, rname, rights) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_GUILD_RANKS, "DELETE FROM guild_rank WHERE guildid = ?", CONNECTION_ASYNC) // 0: uint32 - PREPARE_STATEMENT(CHAR_DEL_GUILD_LOWEST_RANK, "DELETE FROM guild_rank WHERE guildid = ? AND rid >= ?", CONNECTION_ASYNC) // 0: uint32, 1: uint8 + PREPARE_STATEMENT(CHAR_DEL_GUILD_RANK, "DELETE FROM guild_rank WHERE guildid = ? AND rid = ?", CONNECTION_ASYNC) // 0: uint32, 1: uint8 PREPARE_STATEMENT(CHAR_INS_GUILD_BANK_TAB, "INSERT INTO guild_bank_tab (guildid, TabId) VALUES (?, ?)", CONNECTION_ASYNC) // 0: uint32, 1: uint8 PREPARE_STATEMENT(CHAR_DEL_GUILD_BANK_TAB, "DELETE FROM guild_bank_tab WHERE guildid = ? AND TabId = ?", CONNECTION_ASYNC) // 0: uint32, 1: uint8 PREPARE_STATEMENT(CHAR_DEL_GUILD_BANK_TABS, "DELETE FROM guild_bank_tab WHERE guildid = ?", CONNECTION_ASYNC) // 0: uint32 diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.h b/src/server/shared/Database/Implementation/CharacterDatabase.h index 5dac60d6ba8..01db91320f5 100755 --- a/src/server/shared/Database/Implementation/CharacterDatabase.h +++ b/src/server/shared/Database/Implementation/CharacterDatabase.h @@ -166,7 +166,7 @@ enum CharacterDatabaseStatements CHAR_DEL_GUILD_MEMBERS, CHAR_INS_GUILD_RANK, CHAR_DEL_GUILD_RANKS, - CHAR_DEL_GUILD_LOWEST_RANK, + CHAR_DEL_GUILD_RANK, CHAR_INS_GUILD_BANK_TAB, CHAR_DEL_GUILD_BANK_TAB, CHAR_DEL_GUILD_BANK_TABS, -- cgit v1.2.3 From 45910ab6383b4971cb66dca81a195565ff0122e2 Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 4 Aug 2012 17:55:45 +0100 Subject: Core/Chat: Fix unitialized lang variable (set to LANG_UNIVERSAL) when text type is emote, afk or dnd --- src/server/game/Handlers/ChatHandler.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/server/game/Handlers/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cpp index 2cbab68266e..707d985cd3f 100755 --- a/src/server/game/Handlers/ChatHandler.cpp +++ b/src/server/game/Handlers/ChatHandler.cpp @@ -225,6 +225,8 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) } } } + else + lang = LANG_UNIVERSAL; if (sender->HasAura(1852) && type != CHAT_MSG_WHISPER) { -- cgit v1.2.3 From fc318a2da7f83468461896ae072ed36b736dc8e0 Mon Sep 17 00:00:00 2001 From: Subv Date: Sat, 4 Aug 2012 13:01:29 -0500 Subject: Core/Protocol: Enabled CMSG_BUY_ITEM --- src/server/game/Handlers/ItemHandler.cpp | 38 +++++++++++++---------------- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- 2 files changed, 18 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index b446fdadee7..a273857f081 100755 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -664,24 +664,15 @@ void WorldSession::HandleBuyItemInSlotOpcode(WorldPacket & recv_data) return; // cheating uint8 bag = NULL_BAG; // init for case invalid bagGUID - + Item* bagItem = NULL; // find bag slot by bag guid if (bagguid == _player->GetGUID()) bag = INVENTORY_SLOT_BAG_0; else - { - for (int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) - { - if (Bag* pBag = _player->GetBagByPos(i)) - { - if (bagguid == pBag->GetGUID()) - { - bag = i; - break; - } - } - } - } + bagItem = _player->GetItemByGuid(bagguid); + + if (bagItem && bagItem->IsBag()) + bag = bagItem->GetSlot(); // bag not found, cheating? if (bag == NULL_BAG) @@ -690,23 +681,28 @@ void WorldSession::HandleBuyItemInSlotOpcode(WorldPacket & recv_data) GetPlayer()->BuyItemFromVendorSlot(vendorguid, slot, item, count, bag, bagslot); } -void WorldSession::HandleBuyItemOpcode(WorldPacket & recv_data) +void WorldSession::HandleBuyItemOpcode(WorldPacket& recv_data) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_BUY_ITEM"); - uint64 vendorguid, unk2; // unk2 can be 0? + uint64 vendorguid, bagGuid; uint32 item, slot, count; - uint8 unk1; // if this is == 2 then the count might be multiplied by 100 - int8 unk3; // only known value = -1, according to the client it can take more values + uint8 itemType; // 1 = item, 2 = currency + int8 bagSlot; - recv_data >> vendorguid >> unk1 >> item >> slot >> count >> unk2 >> unk3; + recv_data >> vendorguid >> itemType >> item >> slot >> count >> bagGuid >> bagSlot; // client expects count starting at 1, and we send vendorslot+1 to client already if (slot > 0) --slot; else return; // cheating - - GetPlayer()->BuyItemFromVendorSlot(vendorguid, slot, item, count, NULL_BAG, NULL_SLOT); + + Item* bagItem = _player->GetItemByGuid(bagGuid); + + if (bagItem && bagItem->IsBag()) + bag = bagItem->GetSlot(); + + GetPlayer()->BuyItemFromVendorSlot(vendorguid, slot, item, count, bag, bagSlot); } void WorldSession::HandleListInventoryOpcode(WorldPacket & recv_data) diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 6fcd9b0ab3b..6172a8bc9b0 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -114,7 +114,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_BUSY_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBusyTradeOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_BUYBACK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuybackItem ); //DEFINE_OPCODE_HANDLER(CMSG_BUY_BANK_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyBankSlotOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_BUY_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyItemOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_BUY_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_BUY_ITEM_IN_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyItemInSlotOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_BUY_LOTTERY_TICKET_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_BUY_STABLE_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyStableSlot ); -- cgit v1.2.3 From da2db28cab50d5d9d4f1864b6bfd7b47aaf648b9 Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 4 Aug 2012 19:11:13 +0100 Subject: Core/PacketIO: Add some (possible) missing FlushBits --- src/server/game/Achievements/AchievementMgr.cpp | 2 ++ src/server/game/Globals/ObjectMgr.cpp | 6 ++-- src/server/game/Guilds/Guild.cpp | 8 ++--- src/server/game/Guilds/Guild.h | 2 +- src/server/game/Handlers/AuthHandler.cpp | 2 ++ src/server/game/Handlers/ItemHandler.cpp | 40 +++++++++++++------------ src/server/game/Handlers/TradeHandler.cpp | 8 +++-- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- src/server/game/Server/WorldSession.cpp | 2 ++ src/server/game/Server/WorldSession.h | 2 +- 10 files changed, 43 insertions(+), 31 deletions(-) (limited to 'src') diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 4e25fa03a42..a0e3b923406 100755 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -1013,6 +1013,8 @@ void AchievementMgr::SendCriteriaUpdate(AchievementCriteriaEntry const* e data.WriteBit(counter[7]); data.WriteBit(guid[4]); + data.FlushBits(); + data.WriteByteSeq(guid[5]); data << uint32(progress->date); // unknown date data.WriteByteSeq(counter[3]); diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 6d8c828ac58..b1d84ddda39 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -3429,16 +3429,16 @@ void ObjectMgr::GetPlayerClassLevelInfo(uint32 class_, uint8 level, uint32& base if (level > sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) level = sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL); - + GtOCTBaseHPByClassEntry const* hp = sGtOCTBaseHPByClassStore.LookupEntry((class_-1) * GT_MAX_LEVEL + level-1); GtOCTBaseMPByClassEntry const* mp = sGtOCTBaseMPByClassStore.LookupEntry((class_-1) * GT_MAX_LEVEL + level-1); - + if (!hp || !mp) { sLog->outError("Tried to get non-existant Class-Level combination data for base hp/mp. Class %u Level %u", class_, level); return; } - + baseHP = uint32(hp->ratio); baseMana = uint32(mp->ratio); } diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index d4e461f3f57..e2e2f31c30c 100755 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -1311,7 +1311,7 @@ void Guild::HandleGuildRanks(WorldSession* session) // perhaps move to guild.cpp..... ByteBuffer rankData(100); WorldPacket data(SMSG_GUILD_RANK, 100); - + data.WriteBits(_GetRanksSize(), 18); for (uint8 i = 0; i < _GetRanksSize(); i++) @@ -1599,7 +1599,7 @@ void Guild::HandleInviteMember(WorldSession* session, const std::string& name) data.WriteByteSeq(newGuildGuid[4]); data.append(m_name.c_str(), m_name.length()); - + data.WriteByteSeq(newGuildGuid[5]); data.WriteByteSeq(newGuildGuid[3]); data.WriteByteSeq(oldGuildGuid[4]); @@ -1688,7 +1688,7 @@ void Guild::HandleUpdateMemberRank(WorldSession* session, uint64 targetGuid, boo SendCommandResult(session, GUILD_INVITE, ERR_GUILD_PERMISSIONS); return; } - + // Player cannot promote himself if (member->IsSamePlayer(player->GetGUID())) { @@ -1741,7 +1741,7 @@ void Guild::HandleSetMemberRank(WorldSession* session, uint64 targetGuid, uint64 SendCommandResult(session, GUILD_INVITE, ERR_GUILD_PERMISSIONS); return; } - + // Player cannot promote himself if (member->IsSamePlayer(player->GetGUID())) { diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h index 3d88083a67e..5e02e88a224 100755 --- a/src/server/game/Guilds/Guild.h +++ b/src/server/game/Guilds/Guild.h @@ -820,7 +820,7 @@ private: void _SendBankMoneyUpdate(WorldSession* session) const; void _SendBankContentUpdate(MoveItemData* pSrc, MoveItemData* pDest) const; void _SendBankContentUpdate(uint8 tabId, SlotIds slots) const; - + void SendGuildRanksUpdate(uint64 setterGuid, uint64 targetGuid, uint32 rank); void _BroadcastEvent(GuildEvents guildEvent, uint64 guid, const char* param1 = NULL, const char* param2 = NULL, const char* param3 = NULL) const; diff --git a/src/server/game/Handlers/AuthHandler.cpp b/src/server/game/Handlers/AuthHandler.cpp index 4a3f8d55fdc..5085bb15584 100755 --- a/src/server/game/Handlers/AuthHandler.cpp +++ b/src/server/game/Handlers/AuthHandler.cpp @@ -28,6 +28,8 @@ void WorldSession::SendAuthResponse(uint8 code, bool queued, uint32 queuePos) packet.WriteBit(1); // has account info + packet.FlushBits(); + // account info packet << uint32(0); // BillingTimeRemaining packet << uint8(Expansion()); // 0 - normal, 1 - TBC, 2 - WOTLK, 3 - CATA; must be set in database manually for each account diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index a273857f081..bd799a7a2fa 100755 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -670,7 +670,7 @@ void WorldSession::HandleBuyItemInSlotOpcode(WorldPacket & recv_data) bag = INVENTORY_SLOT_BAG_0; else bagItem = _player->GetItemByGuid(bagguid); - + if (bagItem && bagItem->IsBag()) bag = bagItem->GetSlot(); @@ -684,10 +684,10 @@ void WorldSession::HandleBuyItemInSlotOpcode(WorldPacket & recv_data) void WorldSession::HandleBuyItemOpcode(WorldPacket& recv_data) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_BUY_ITEM"); - uint64 vendorguid, bagGuid; + uint64 vendorguid, bagGuid; uint32 item, slot, count; uint8 itemType; // 1 = item, 2 = currency - int8 bagSlot; + int8 bagSlot; recv_data >> vendorguid >> itemType >> item >> slot >> count >> bagGuid >> bagSlot; @@ -696,12 +696,12 @@ void WorldSession::HandleBuyItemOpcode(WorldPacket& recv_data) --slot; else return; // cheating - + Item* bagItem = _player->GetItemByGuid(bagGuid); - + if (bagItem && bagItem->IsBag()) bag = bagItem->GetSlot(); - + GetPlayer()->BuyItemFromVendorSlot(vendorguid, slot, item, count, bag, bagSlot); } @@ -1642,9 +1642,9 @@ void WorldSession::HandleReforgeItemOpcode(WorldPacket& recvData) ObjectGuid guid; uint32 bag; Player* player = GetPlayer(); - + recvData >> reforgeEntry >> slot >> bag; - + guid[2] = recvData.ReadBit(); guid[6] = recvData.ReadBit(); guid[3] = recvData.ReadBit(); @@ -1653,7 +1653,9 @@ void WorldSession::HandleReforgeItemOpcode(WorldPacket& recvData) guid[0] = recvData.ReadBit(); guid[7] = recvData.ReadBit(); guid[5] = recvData.ReadBit(); - + + recvData.FlushBits(); + recvData.ReadByteSeq(guid[2]); recvData.ReadByteSeq(guid[3]); recvData.ReadByteSeq(guid[6]); @@ -1669,16 +1671,16 @@ void WorldSession::HandleReforgeItemOpcode(WorldPacket& recvData) SendReforgeResult(false); return; } - - Item* item = player->GetItemByPos(bag, slot); - + + Item* item = player->GetItemByPos(bag, slot); + if (!item) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleReforgeItemOpcode - Player (Guid: %u Name: %s) tried to reforge an invalid/non-existant item.", player->GetGUIDLow(), player->GetName()); SendReforgeResult(false); return; } - + if (!reforgeEntry) { // Reset the item @@ -1686,25 +1688,25 @@ void WorldSession::HandleReforgeItemOpcode(WorldPacket& recvData) SendReforgeResult(true); return; } - + if (!sItemReforgeStore.LookupEntry(reforgeEntry)) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleReforgeItemOpcode - Player (Guid: %u Name: %s) tried to reforge an item with invalid reforge entry (%u).", player->GetGUIDLow(), player->GetName(), reforgeEntry); SendReforgeResult(false); return; } - + if (player->HasEnoughMoney(uint64(item->GetSpecialPrice()))) // cheating { SendReforgeResult(false); return; } - + player->ModifyMoney(-int64(item->GetSpecialPrice())); - + item->SetEnchantment(REFORGE_ENCHANTMENT_SLOT, reforgeEntry, 0, 0); - + SendReforgeResult(true); - + // ToDo: Apply and remove the destination/source stats to the player } diff --git a/src/server/game/Handlers/TradeHandler.cpp b/src/server/game/Handlers/TradeHandler.cpp index 5c01bc7ea64..8e06ca88dd1 100755 --- a/src/server/game/Handlers/TradeHandler.cpp +++ b/src/server/game/Handlers/TradeHandler.cpp @@ -42,29 +42,33 @@ void WorldSession::SendTradeStatus(TradeStatus status) { case TRADE_STATUS_BEGIN_TRADE: data.WriteBits(0, 8); // zero guid + data.FlushBits(); break; case TRADE_STATUS_OPEN_WINDOW: + data.FlushBits(); data << uint32(0); // unk break; case TRADE_STATUS_CLOSE_WINDOW: data.WriteBit(0); // unk + data.FlushBits(); data << uint32(0); // unk data << uint32(0); // unk break; case TRADE_STATUS_ONLY_CONJURED: case TRADE_STATUS_NOT_ELIGIBLE: + data.FlushBits(); data << uint8(0); // unk break; case TRADE_STATUS_CURRENCY: // Not implemented case TRADE_STATUS_CURRENCY_NOT_TRADABLE: // Not implemented + data.FlushBits(); data << uint32(0); // unk data << uint32(0); // unk default: + data.FlushBits(); break; } - data.FlushBits(); - SendPacket(&data); } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 6172a8bc9b0..10dece5490a 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -314,7 +314,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_GROUP_CHANGE_SUB_GROUP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupChangeSubGroupOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupDeclineOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_DISBAND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupDisbandOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GROUP_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupInviteOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GROUP_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupInviteOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_RAID_CONVERT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupRaidConvertOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_SET_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupSetLeaderOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_SWAP_SUB_GROUP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupSwapSubGroupOpcode ); diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index 7e7d75b0428..0f7a63076e3 100755 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -672,6 +672,7 @@ void WorldSession::SendAuthWaitQue(uint32 position) WorldPacket packet(SMSG_AUTH_RESPONSE, 1); packet.WriteBit(0); // has queue info packet.WriteBit(0); // has account info + packet.FlushBits(); packet << uint8(AUTH_OK); SendPacket(&packet); } @@ -681,6 +682,7 @@ void WorldSession::SendAuthWaitQue(uint32 position) packet.WriteBit(1); // has queue info packet.WriteBit(0); // unk queue bool packet.WriteBit(0); // has account info + packet.FlushBits(); packet << uint8(AUTH_WAIT_QUEUE); packet << uint32(position); SendPacket(&packet); diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index abf3e5934b8..0433ef5581d 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -922,7 +922,7 @@ class WorldSession // Transmogrification void HandleTransmogrifyItems(WorldPacket& recvData); - + // Reforge void HandleReforgeItemOpcode(WorldPacket& recvData); void SendReforgeResult(bool success); -- cgit v1.2.3 From 297aed81e23fd4a423aa266c303862deb1d7cd2a Mon Sep 17 00:00:00 2001 From: Subv Date: Sat, 4 Aug 2012 13:19:06 -0500 Subject: Core/PacketIO: Enabled some more opcodes --- src/server/game/Handlers/ItemHandler.cpp | 2 -- src/server/game/Handlers/MiscHandler.cpp | 9 ++++----- src/server/game/Handlers/NPCHandler.cpp | 2 +- src/server/game/Handlers/TradeHandler.cpp | 2 +- src/server/game/Server/Protocol/Opcodes.cpp | 6 +++--- 5 files changed, 9 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index bd799a7a2fa..c44cef555db 100755 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -1654,8 +1654,6 @@ void WorldSession::HandleReforgeItemOpcode(WorldPacket& recvData) guid[7] = recvData.ReadBit(); guid[5] = recvData.ReadBit(); - recvData.FlushBits(); - recvData.ReadByteSeq(guid[2]); recvData.ReadByteSeq(guid[3]); recvData.ReadByteSeq(guid[6]); diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index cfb865f8d09..4e708553ee0 100755 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -520,11 +520,10 @@ void WorldSession::HandleStandStateChangeOpcode(WorldPacket & recv_data) _player->SetStandState(animstate); } -void WorldSession::HandleContactListOpcode(WorldPacket & recv_data) +void WorldSession::HandleContactListOpcode(WorldPacket& recvData) { - uint32 unk; - recv_data >> unk; - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_CONTACT_LIST - Unk: %d", unk); + recvData.read_skip(); // always 1 + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_CONTACT_LIST"); _player->GetSocial()->SendSocialList(_player); } @@ -606,7 +605,7 @@ void WorldSession::HandleAddFriendOpcodeCallBack(PreparedQueryResult result, std sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (SMSG_FRIEND_STATUS)"); } -void WorldSession::HandleDelFriendOpcode(WorldPacket & recv_data) +void WorldSession::HandleDelFriendOpcode(WorldPacket& recv_data) { uint64 FriendGUID; diff --git a/src/server/game/Handlers/NPCHandler.cpp b/src/server/game/Handlers/NPCHandler.cpp index e9b070b2aa2..bc3a22cdf05 100755 --- a/src/server/game/Handlers/NPCHandler.cpp +++ b/src/server/game/Handlers/NPCHandler.cpp @@ -881,7 +881,7 @@ void WorldSession::HandleStableSwapPetCallback(PreparedQueryResult result, uint3 SendStableResult(STABLE_SUCCESS_UNSTABLE); } -void WorldSession::HandleRepairItemOpcode(WorldPacket & recv_data) +void WorldSession::HandleRepairItemOpcode(WorldPacket& recv_data) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_REPAIR_ITEM"); diff --git a/src/server/game/Handlers/TradeHandler.cpp b/src/server/game/Handlers/TradeHandler.cpp index 8e06ca88dd1..f510e7eca73 100755 --- a/src/server/game/Handlers/TradeHandler.cpp +++ b/src/server/game/Handlers/TradeHandler.cpp @@ -65,7 +65,7 @@ void WorldSession::SendTradeStatus(TradeStatus status) data << uint32(0); // unk data << uint32(0); // unk default: - data.FlushBits(); + data.FlushBits(); break; } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 10dece5490a..046a7b0076f 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -204,7 +204,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_COMPLETE_ACHIEVEMENT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_COMPLETE_CINEMATIC, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCompleteCinematic ); //DEFINE_OPCODE_HANDLER(CMSG_COMPLETE_MOVIE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CONTACT_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleContactListOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_CONTACT_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleContactListOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_CONTROLLER_EJECT_PASSENGER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEjectPassenger ); //DEFINE_OPCODE_HANDLER(CMSG_COOLDOWN_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CORPSE_MAP_POSITION_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCorpseMapPositionQuery ); @@ -224,7 +224,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_DECHARGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_DECLINE_CHANNEL_INVITE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleChannelDeclineInvite ); //DEFINE_OPCODE_HANDLER(CMSG_DELETE_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_DEL_FRIEND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDelFriendOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_DEL_FRIEND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDelFriendOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_DEL_IGNORE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDelIgnoreOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_DEL_PVP_MEDAL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_DEL_VOICE_IGNORE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -543,7 +543,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_REFORGE_ITEM, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleReforgeItemOpcode ); DEFINE_OPCODE_HANDLER(SMSG_REFORGE_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_REMOVE_GLYPH, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRemoveGlyph ); - //DEFINE_OPCODE_HANDLER(CMSG_REPAIR_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepairItemOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_REPAIR_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepairItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_REPOP_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepopRequestOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_REPORT_PVP_AFK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReportPvPAFK ); DEFINE_OPCODE_HANDLER(CMSG_REQUEST_ACCOUNT_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestAccountData ); -- cgit v1.2.3 From 880e708658b1c8b180dbe7841214a7a79870698a Mon Sep 17 00:00:00 2001 From: LordJZ Date: Sat, 4 Aug 2012 19:47:45 +0100 Subject: Tools: Proper default target build output Ref #7022 --- src/tools/map_extractor/System.cpp | 4 ++-- src/tools/vmap4_extractor/vmapexport.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp index c498026e401..681013da18b 100644 --- a/src/tools/map_extractor/System.cpp +++ b/src/tools/map_extractor/System.cpp @@ -132,8 +132,8 @@ void Usage(char* prg) "-o set output path\n"\ "-e extract only MAP(1)/DBC(2) - standard: both(3)\n"\ "-f height stored as int (less map size but lost some accuracy) 1 by default\n"\ - "-b target build (default 14545)"\ - "Example: %s -f 0 -i \"c:\\games\\game\"", prg, prg); + "-b target build (default %u)"\ + "Example: %s -f 0 -i \"c:\\games\\game\"", prg, CONF_TargetBuild, prg); exit(1); } diff --git a/src/tools/vmap4_extractor/vmapexport.cpp b/src/tools/vmap4_extractor/vmapexport.cpp index c82932e4339..d7b2f30d349 100644 --- a/src/tools/vmap4_extractor/vmapexport.cpp +++ b/src/tools/vmap4_extractor/vmapexport.cpp @@ -525,7 +525,7 @@ bool processArgv(int argc, char ** argv, const char *versionString) printf(" -s : (default) small size (data size optimization), ~500MB less vmap data.\n"); printf(" -l : large size, ~500MB more vmap data. (might contain more details)\n"); printf(" -d : Path to the vector data source folder.\n"); - printf(" -b : target build (default 14545)"); + printf(" -b : target build (default %u)", CONF_TargetBuild); printf(" -? : This message.\n"); } -- cgit v1.2.3 From e8f08be901bb77a0c01255a88888c73bc224e4c6 Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 4 Aug 2012 20:03:15 +0100 Subject: Core/Items: Fix compile --- src/server/game/Handlers/ItemHandler.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index c44cef555db..81b8a98414f 100755 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -686,9 +686,9 @@ void WorldSession::HandleBuyItemOpcode(WorldPacket& recv_data) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_BUY_ITEM"); uint64 vendorguid, bagGuid; uint32 item, slot, count; - uint8 itemType; // 1 = item, 2 = currency - int8 bagSlot; - + uint8 itemType; // 1 = item, 2 = currency (not implemented) + uint8 bagSlot; + recv_data >> vendorguid >> itemType >> item >> slot >> count >> bagGuid >> bagSlot; // client expects count starting at 1, and we send vendorslot+1 to client already @@ -699,6 +699,7 @@ void WorldSession::HandleBuyItemOpcode(WorldPacket& recv_data) Item* bagItem = _player->GetItemByGuid(bagGuid); + uint8 bag = NULL_BAG; if (bagItem && bagItem->IsBag()) bag = bagItem->GetSlot(); -- cgit v1.2.3 From 0e581b7991294bf23f2af587d73e3a2f4d5bbdfe Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 5 Aug 2012 10:09:56 -0500 Subject: Core/Items: Removed no longer needed code for item set names and item set names locales --- .../2012_08_05_01_world_item_set_names_4x.sql | 2 + src/server/game/Entities/Item/ItemPrototype.h | 11 -- src/server/game/Globals/ObjectMgr.cpp | 112 --------------------- src/server/game/Globals/ObjectMgr.h | 20 ---- src/server/game/Handlers/ItemHandler.cpp | 24 ----- src/server/game/Server/Protocol/Opcodes.cpp | 1 - src/server/game/Server/WorldSession.h | 1 - src/server/game/World/World.cpp | 4 - 8 files changed, 2 insertions(+), 173 deletions(-) create mode 100644 sql/updates/world/2012_08_05_01_world_item_set_names_4x.sql (limited to 'src') diff --git a/sql/updates/world/2012_08_05_01_world_item_set_names_4x.sql b/sql/updates/world/2012_08_05_01_world_item_set_names_4x.sql new file mode 100644 index 00000000000..b49641e35f5 --- /dev/null +++ b/sql/updates/world/2012_08_05_01_world_item_set_names_4x.sql @@ -0,0 +1,2 @@ +DROP TABLE IF EXISTS `locales_item_set_names`; +DROP TABLE IF EXISTS `item_set_names`; \ No newline at end of file diff --git a/src/server/game/Entities/Item/ItemPrototype.h b/src/server/game/Entities/Item/ItemPrototype.h index cfc65292507..5e052c588cc 100755 --- a/src/server/game/Entities/Item/ItemPrototype.h +++ b/src/server/game/Entities/Item/ItemPrototype.h @@ -760,17 +760,6 @@ struct ItemLocale StringVector Description; }; -struct ItemSetNameEntry -{ - std::string name; - uint32 InventoryType; -}; - -struct ItemSetNameLocale -{ - StringVector Name; -}; - // GCC have alternative #pragma pack() syntax and old gcc version not support pack(pop), also any gcc version not support it at some platform #if defined(__GNUC__) #pragma pack() diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index b1d84ddda39..7c337f22ca0 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -2622,118 +2622,6 @@ ItemTemplate const* ObjectMgr::GetItemTemplate(uint32 entry) return NULL; } -void ObjectMgr::LoadItemSetNameLocales() -{ - uint32 oldMSTime = getMSTime(); - - _itemSetNameLocaleStore.clear(); // need for reload case - - QueryResult result = WorldDatabase.Query("SELECT `entry`, `name_loc1`, `name_loc2`, `name_loc3`, `name_loc4`, `name_loc5`, `name_loc6`, `name_loc7`, `name_loc8` FROM `locales_item_set_names`"); - - if (!result) - return; - - do - { - Field* fields = result->Fetch(); - - uint32 entry = fields[0].GetUInt32(); - - ItemSetNameLocale& data = _itemSetNameLocaleStore[entry]; - - for (uint8 i = 1; i < TOTAL_LOCALES; ++i) - AddLocaleString(fields[i].GetString(), LocaleConstant(i), data.Name); - } while (result->NextRow()); - - sLog->outString(">> Loaded " UI64FMTD " Item set name locale strings in %u ms", uint64(_itemSetNameLocaleStore.size()), GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); -} - -void ObjectMgr::LoadItemSetNames() -{ - uint32 oldMSTime = getMSTime(); - - _itemSetNameStore.clear(); // needed for reload case - - std::set itemSetItems; - - // fill item set member ids - for (uint32 entryId = 0; entryId < sItemSetStore.GetNumRows(); ++entryId) - { - ItemSetEntry const* setEntry = sItemSetStore.LookupEntry(entryId); - if (!setEntry) - continue; - - for (uint32 i = 0; i < MAX_ITEM_SET_ITEMS; ++i) - if (setEntry->itemId[i]) - itemSetItems.insert(setEntry->itemId[i]); - } - - // 0 1 2 - // 0 1 2 - QueryResult result = WorldDatabase.Query("SELECT `entry`, `name`, `InventoryType` FROM `item_set_names`"); - - if (!result) - { - sLog->outString(">> Loaded 0 item set names. DB table `item_set_names` is empty."); - sLog->outString(); - return; - } - - _itemSetNameStore.rehash(result->GetRowCount()); - uint32 count = 0; - - do - { - Field* fields = result->Fetch(); - - uint32 entry = fields[0].GetUInt32(); - if (itemSetItems.find(entry) == itemSetItems.end()) - { - sLog->outErrorDb("Item set name (Entry: %u) not found in ItemSet.dbc, data useless.", entry); - continue; - } - - ItemSetNameEntry &data = _itemSetNameStore[entry]; - data.name = fields[1].GetString(); - - uint32 invType = fields[2].GetUInt8(); - if (invType >= MAX_INVTYPE) - { - sLog->outErrorDb("Item set name (Entry: %u) has wrong InventoryType value (%u)", entry, invType); - invType = INVTYPE_NON_EQUIP; - } - - data.InventoryType = invType; - itemSetItems.erase(entry); - ++count; - } while (result->NextRow()); - - if (!itemSetItems.empty()) - { - ItemTemplate const* pProto; - for (std::set::iterator itr = itemSetItems.begin(); itr != itemSetItems.end(); ++itr) - { - uint32 entry = *itr; - // add data from item_template if available - pProto = sObjectMgr->GetItemTemplate(entry); - if (pProto) - { - sLog->outErrorDb("Item set part (Entry: %u) does not have entry in `item_set_names`, adding data from `item_template`.", entry); - ItemSetNameEntry &data = _itemSetNameStore[entry]; - data.name = pProto->Name1; - data.InventoryType = pProto->InventoryType; - ++count; - } - else - sLog->outErrorDb("Item set part (Entry: %u) does not have entry in `item_set_names`, set will not display properly.", entry); - } - } - - sLog->outString(">> Loaded %u item set names in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); -} - void ObjectMgr::LoadVehicleTemplateAccessories() { uint32 oldMSTime = getMSTime(); diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index 0350d519aff..6714400596b 100755 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -640,14 +640,6 @@ class ObjectMgr ItemTemplate const* GetItemTemplate(uint32 entry); ItemTemplateContainer const* GetItemTemplateStore() const { return &_itemTemplateStore; } - ItemSetNameEntry const* GetItemSetNameEntry(uint32 itemId) - { - ItemSetNameContainer::iterator itr = _itemSetNameStore.find(itemId); - if (itr != _itemSetNameStore.end()) - return &itr->second; - return NULL; - } - InstanceTemplate const* GetInstanceTemplate(uint32 mapId); PetLevelInfo const* GetPetLevelInfo(uint32 creature_id, uint8 level) const; @@ -864,8 +856,6 @@ class ObjectMgr void LoadItemTemplateAddon(); void LoadItemScriptNames(); void LoadItemLocales(); - void LoadItemSetNames(); - void LoadItemSetNameLocales(); void LoadQuestLocales(); void LoadNpcTextLocales(); void LoadPageTextLocales(); @@ -990,12 +980,6 @@ class ObjectMgr if (itr == _itemLocaleStore.end()) return NULL; return &itr->second; } - ItemSetNameLocale const* GetItemSetNameLocale(uint32 entry) const - { - ItemSetNameLocaleContainer::const_iterator itr = _itemSetNameLocaleStore.find(entry); - if (itr == _itemSetNameLocaleStore.end())return NULL; - return &itr->second; - } QuestLocale const* GetQuestLocale(uint32 entry) const { QuestLocaleContainer::const_iterator itr = _questLocaleStore.find(entry); @@ -1266,9 +1250,6 @@ class ObjectMgr HalfNameContainer _petHalfName0; HalfNameContainer _petHalfName1; - typedef UNORDERED_MAP ItemSetNameContainer; - ItemSetNameContainer _itemSetNameStore; - MapObjectGuids _mapObjectGuidsStore; CreatureDataContainer _creatureDataStore; CreatureTemplateContainer _creatureTemplateStore; @@ -1284,7 +1265,6 @@ class ObjectMgr ItemTemplateContainer _itemTemplateStore; ItemLocaleContainer _itemLocaleStore; - ItemSetNameLocaleContainer _itemSetNameLocaleStore; QuestLocaleContainer _questLocaleStore; NpcTextLocaleContainer _npcTextLocaleStore; PageTextLocaleContainer _pageTextLocaleStore; diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 81b8a98414f..b1cf05595ff 100755 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -1041,30 +1041,6 @@ void WorldSession::SendItemEnchantTimeUpdate(uint64 Playerguid, uint64 Itemguid, SendPacket(&data); } -void WorldSession::HandleItemNameQueryOpcode(WorldPacket & recv_data) -{ - uint32 itemid; - recv_data >> itemid; - recv_data.read_skip(); // guid - - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_ITEM_NAME_QUERY %u", itemid); - ItemSetNameEntry const* pName = sObjectMgr->GetItemSetNameEntry(itemid); - if (pName) - { - std::string Name = pName->name; - int loc_idx = GetSessionDbLocaleIndex(); - if (loc_idx >= 0) - if (ItemSetNameLocale const* isnl = sObjectMgr->GetItemSetNameLocale(itemid)) - ObjectMgr::GetLocaleString(isnl->Name, loc_idx, Name); - - WorldPacket data(SMSG_ITEM_NAME_QUERY_RESPONSE, (4+Name.size()+1+4)); - data << uint32(itemid); - data << Name; - data << uint32(pName->InventoryType); - SendPacket(&data); - } -} - void WorldSession::HandleWrapItemOpcode(WorldPacket& recv_data) { sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_WRAP_ITEM"); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 046a7b0076f..5e3b7d3ee28 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -360,7 +360,6 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_INITIATE_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInitiateTradeOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_INSPECT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_INSTANCE_LOCK_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInstanceLockResponse ); - //DEFINE_OPCODE_HANDLER(CMSG_ITEM_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemNameQueryOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_ITEM_REFUND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemRefund ); DEFINE_OPCODE_HANDLER(CMSG_ITEM_REFUND_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemRefundInfoRequest ); //DEFINE_OPCODE_HANDLER(CMSG_ITEM_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemTextQuery ); diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 0433ef5581d..84e2eb68771 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -492,7 +492,6 @@ class WorldSession void HandleDelIgnoreOpcode(WorldPacket& recvPacket); void HandleSetContactNotesOpcode(WorldPacket& recvPacket); void HandleBugOpcode(WorldPacket& recvPacket); - void HandleItemNameQueryOpcode(WorldPacket& recvPacket); void HandleAreaTriggerOpcode(WorldPacket& recvPacket); diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 183602b1124..91faff774e2 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1304,7 +1304,6 @@ void World::SetInitialWorldSettings() sObjectMgr->LoadCreatureLocales(); sObjectMgr->LoadGameObjectLocales(); sObjectMgr->LoadItemLocales(); - sObjectMgr->LoadItemSetNameLocales(); sObjectMgr->LoadQuestLocales(); sObjectMgr->LoadNpcTextLocales(); sObjectMgr->LoadPageTextLocales(); @@ -1372,9 +1371,6 @@ void World::SetInitialWorldSettings() sLog->outString("Loading Item Scripts..."); // must be after LoadItemPrototypes sObjectMgr->LoadItemScriptNames(); - sLog->outString("Loading Item set names..."); // must be after LoadItemPrototypes - sObjectMgr->LoadItemSetNames(); - sLog->outString("Loading Creature Model Based Info Data..."); sObjectMgr->LoadCreatureModelInfo(); -- cgit v1.2.3 From 2c20cc98c99834fa4549fa1fc9a0b90b82cdcac9 Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 5 Aug 2012 10:13:48 -0500 Subject: Core/Protocol: Removed SMSG_ITEM_NAME_QUERY_RESPONSE, it no longer exists --- sql/updates/world/2012_08_05_01_world_item_set_names_4x.sql | 2 +- src/server/game/Server/Protocol/Opcodes.cpp | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/sql/updates/world/2012_08_05_01_world_item_set_names_4x.sql b/sql/updates/world/2012_08_05_01_world_item_set_names_4x.sql index b49641e35f5..6e7cd5dbc61 100644 --- a/sql/updates/world/2012_08_05_01_world_item_set_names_4x.sql +++ b/sql/updates/world/2012_08_05_01_world_item_set_names_4x.sql @@ -1,2 +1,2 @@ DROP TABLE IF EXISTS `locales_item_set_names`; -DROP TABLE IF EXISTS `item_set_names`; \ No newline at end of file +DROP TABLE IF EXISTS `item_set_names`; diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 5e3b7d3ee28..74897bc1ea9 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -1057,7 +1057,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_INVENTORY_CHANGE_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ITEM_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ITEM_ENCHANT_TIME_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ITEM_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ITEM_PUSH_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ITEM_REFUND_INFO_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ITEM_REFUND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From c96df759007618ac91ef0d1b95a7e2e721d01d96 Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 5 Aug 2012 19:38:24 +0100 Subject: Core/Items: Remove a few missing things --- src/server/game/Globals/ObjectMgr.h | 1 - src/server/game/Server/Protocol/Opcodes.h | 1 - 2 files changed, 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index 6714400596b..9ffb6019717 100755 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -389,7 +389,6 @@ typedef UNORDERED_MAP GameObjectDataContainer; typedef UNORDERED_MAP CreatureLocaleContainer; typedef UNORDERED_MAP GameObjectLocaleContainer; typedef UNORDERED_MAP ItemLocaleContainer; -typedef UNORDERED_MAP ItemSetNameLocaleContainer; typedef UNORDERED_MAP QuestLocaleContainer; typedef UNORDERED_MAP NpcTextLocaleContainer; typedef UNORDERED_MAP PageTextLocaleContainer; diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 7acaedfaa93..02be8f6b051 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -1005,7 +1005,6 @@ enum Opcodes SMSG_ITEM_COOLDOWN = 0x4D14, SMSG_ITEM_ENCHANT_TIME_UPDATE = 0x0F27, SMSG_ITEM_EXPIRE_PURCHASE_REFUND = 0x1CA0, - SMSG_ITEM_NAME_QUERY_RESPONSE = 0x0000, SMSG_ITEM_PUSH_RESULT = 0x0E15, SMSG_ITEM_REFUND_INFO_RESPONSE = 0x15A3, SMSG_ITEM_REFUND_RESULT = 0x5DB1, -- cgit v1.2.3 From c6c9f7b58fc93b496fc393351b04293c2607a709 Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 5 Aug 2012 19:49:59 +0100 Subject: Scripts/Commands: remove reload item_set_names and locales_item_set_name --- sql/updates/world/2012_08_05_02_world_command.sql | 2 ++ src/server/scripts/Commands/cs_reload.cpp | 18 ------------------ 2 files changed, 2 insertions(+), 18 deletions(-) create mode 100644 sql/updates/world/2012_08_05_02_world_command.sql (limited to 'src') diff --git a/sql/updates/world/2012_08_05_02_world_command.sql b/sql/updates/world/2012_08_05_02_world_command.sql new file mode 100644 index 00000000000..69fd621c457 --- /dev/null +++ b/sql/updates/world/2012_08_05_02_world_command.sql @@ -0,0 +1,2 @@ +DELETE FROM `command` WHERE `name` = 'reload locales_item_set_name'; +DELETE FROM `command` WHERE `name` = 'reload item_set_names'; diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp index 1c119fdef4c..db9a7bf7f53 100644 --- a/src/server/scripts/Commands/cs_reload.cpp +++ b/src/server/scripts/Commands/cs_reload.cpp @@ -102,7 +102,6 @@ public: { "gossip_menu_option", SEC_ADMINISTRATOR, true, &HandleReloadGossipMenuOptionCommand, "", NULL }, { "item_enchantment_template", SEC_ADMINISTRATOR, true, &HandleReloadItemEnchantementsCommand, "", NULL }, { "item_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesItemCommand, "", NULL }, - { "item_set_names", SEC_ADMINISTRATOR, true, &HandleReloadItemSetNamesCommand, "", NULL }, { "lfg_dungeon_rewards", SEC_ADMINISTRATOR, true, &HandleReloadLfgRewardsCommand, "", NULL }, { "locales_achievement_reward", SEC_ADMINISTRATOR, true, &HandleReloadLocalesAchievementRewardCommand, "", NULL }, { "locales_creature", SEC_ADMINISTRATOR, true, &HandleReloadLocalesCreatureCommand, "", NULL }, @@ -110,7 +109,6 @@ public: { "locales_gameobject", SEC_ADMINISTRATOR, true, &HandleReloadLocalesGameobjectCommand, "", NULL }, { "locales_gossip_menu_option", SEC_ADMINISTRATOR, true, &HandleReloadLocalesGossipMenuOptionCommand, "", NULL }, { "locales_item", SEC_ADMINISTRATOR, true, &HandleReloadLocalesItemCommand, "", NULL }, - { "locales_item_set_name", SEC_ADMINISTRATOR, true, &HandleReloadLocalesItemSetNameCommand, "", NULL }, { "locales_npc_text", SEC_ADMINISTRATOR, true, &HandleReloadLocalesNpcTextCommand, "", NULL }, { "locales_page_text", SEC_ADMINISTRATOR, true, &HandleReloadLocalesPageTextCommand, "", NULL }, { "locales_points_of_interest", SEC_ADMINISTRATOR, true, &HandleReloadLocalesPointsOfInterestCommand, "", NULL }, @@ -946,14 +944,6 @@ public: return true; } - static bool HandleReloadItemSetNamesCommand(ChatHandler* handler, const char* /*args*/) - { - sLog->outString("Re-Loading Item set names..."); - LoadRandomEnchantmentsTable(); - handler->SendGlobalGMSysMessage("DB table `item_set_names` reloaded."); - return true; - } - static bool HandleReloadGameObjectScriptsCommand(ChatHandler* handler, const char* args) { if (sScriptMgr->IsScriptScheduled()) @@ -1208,14 +1198,6 @@ public: return true; } - static bool HandleReloadLocalesItemSetNameCommand(ChatHandler* handler, const char* /*args*/) - { - sLog->outString("Re-Loading Locales Item set name... "); - sObjectMgr->LoadItemSetNameLocales(); - handler->SendGlobalGMSysMessage("DB table `locales_item_set_name` reloaded."); - return true; - } - static bool HandleReloadLocalesNpcTextCommand(ChatHandler* handler, const char* /*args*/) { sLog->outString("Re-Loading Locales NPC Text ... "); -- cgit v1.2.3 From 5921f463ef51e2f30f69ba9e5aace6a171a95a21 Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 5 Aug 2012 15:21:52 -0500 Subject: Protocol/PacketIO: Enabled more opcodes --- src/server/game/AuctionHouse/AuctionHouseMgr.cpp | 2 +- src/server/game/Handlers/ItemHandler.cpp | 8 ++++---- src/server/game/Handlers/MiscHandler.cpp | 6 +++--- src/server/game/Handlers/NPCHandler.cpp | 8 ++++---- src/server/game/Server/Protocol/Opcodes.cpp | 24 ++++++++++++------------ 5 files changed, 24 insertions(+), 24 deletions(-) (limited to 'src') diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp index 50e8af9bc13..b28ed3d06fb 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp @@ -611,7 +611,7 @@ bool AuctionEntry::BuildAuctionInfo(WorldPacket& data) const data << uint32(Id); data << uint32(item->GetEntry()); - for (uint8 i = 0; i < PROP_ENCHANTMENT_SLOT_2; ++i) // PROP_ENCHANTMENT_SLOT_2 = 9 + for (uint8 i = 0; i < PROP_ENCHANTMENT_SLOT_0; ++i) // PROP_ENCHANTMENT_SLOT_0 = 10 { data << uint32(item->GetEnchantmentId(EnchantmentSlot(i))); data << uint32(item->GetEnchantmentDuration(EnchantmentSlot(i))); diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index b1cf05595ff..7918b9e5672 100755 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -92,7 +92,7 @@ void WorldSession::HandleSwapInvItemOpcode(WorldPacket & recv_data) _player->SwapItem(src, dst); } -void WorldSession::HandleAutoEquipItemSlotOpcode(WorldPacket & recv_data) +void WorldSession::HandleAutoEquipItemSlotOpcode(WorldPacket& recv_data) { uint64 itemguid; uint8 dstslot; @@ -600,13 +600,13 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recv_data) return; } -void WorldSession::HandleBuybackItem(WorldPacket & recv_data) +void WorldSession::HandleBuybackItem(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_BUYBACK_ITEM"); uint64 vendorguid; uint32 slot; - recv_data >> vendorguid >> slot; + recvData >> vendorguid >> slot; Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(vendorguid, UNIT_NPC_FLAG_VENDOR); if (!creature) @@ -843,7 +843,7 @@ void WorldSession::SendListInventory(uint64 vendorGuid) SendPacket(&data); } -void WorldSession::HandleAutoStoreBagItemOpcode(WorldPacket & recv_data) +void WorldSession::HandleAutoStoreBagItemOpcode(WorldPacket& recv_data) { //sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_AUTOSTORE_BAG_ITEM"); uint8 srcbag, srcslot, dstbag; diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 4e708553ee0..733dd862cd1 100755 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -805,10 +805,10 @@ void WorldSession::SendAreaTriggerMessage(const char* Text, ...) SendPacket(&data); } -void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recv_data) +void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recvData) { uint32 triggerId; - recv_data >> triggerId; + recvData >> triggerId; sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_AREATRIGGER. Trigger ID: %u", triggerId); @@ -1076,7 +1076,7 @@ void WorldSession::HandleSetActionButtonOpcode(WorldPacket& recv_data) } } -void WorldSession::HandleCompleteCinematic(WorldPacket & /*recv_data*/) +void WorldSession::HandleCompleteCinematic(WorldPacket& /*recv_data*/) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_COMPLETE_CINEMATIC"); } diff --git a/src/server/game/Handlers/NPCHandler.cpp b/src/server/game/Handlers/NPCHandler.cpp index bc3a22cdf05..a77477ab6df 100755 --- a/src/server/game/Handlers/NPCHandler.cpp +++ b/src/server/game/Handlers/NPCHandler.cpp @@ -73,13 +73,13 @@ void WorldSession::SendTabardVendorActivate(uint64 guid) SendPacket(&data); } -void WorldSession::HandleBankerActivateOpcode(WorldPacket & recv_data) +void WorldSession::HandleBankerActivateOpcode(WorldPacket& recvData) { uint64 guid; sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_BANKER_ACTIVATE"); - recv_data >> guid; + recvData >> guid; Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_BANKER); if (!unit) @@ -443,10 +443,10 @@ void WorldSession::SendSpiritResurrect() _player->UpdateObjectVisibility(); } -void WorldSession::HandleBinderActivateOpcode(WorldPacket & recv_data) +void WorldSession::HandleBinderActivateOpcode(WorldPacket& recvData) { uint64 npcGUID; - recv_data >> npcGUID; + recvData >> npcGUID; if (!GetPlayer()->IsInWorld() || !GetPlayer()->isAlive()) return; diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 74897bc1ea9..e2e178e7f9d 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -55,7 +55,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_AFK_MONITOR_INFO_CLEAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_AFK_MONITOR_INFO_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_ALTER_APPEARANCE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAlterAppearance ); - //DEFINE_OPCODE_HANDLER(CMSG_AREATRIGGER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaTriggerOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_AREATRIGGER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaTriggerOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_AREA_SPIRIT_HEALER_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaSpiritHealerQueryOpcode); //DEFINE_OPCODE_HANDLER(CMSG_AREA_SPIRIT_HEALER_QUEUE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaSpiritHealerQueueOpcode); //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamAcceptOpcode ); @@ -84,12 +84,12 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_AUTOBANK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoBankItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_AUTOEQUIP_GROUND_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_AUTOEQUIP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoEquipItemOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_AUTOEQUIP_ITEM_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoEquipItemSlotOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_BAG_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoStoreBagItemOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_AUTOEQUIP_ITEM_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoEquipItemSlotOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_BAG_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoStoreBagItemOpcode ); DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_BANK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoStoreBankItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_GROUND_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_LOOT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutostoreLootItemOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_BANKER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBankerActivateOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_BANKER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBankerActivateOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_JOIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlefieldListOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MANAGER_ADVANCE_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -106,14 +106,14 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_JOIN_ARENA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlemasterJoinArena ); //DEFINE_OPCODE_HANDLER(CMSG_BEASTMASTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_BEGIN_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBeginTradeOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_BINDER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBinderActivateOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_BINDER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBinderActivateOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_BOOTME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_BOT_DETECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_BOT_DETECTED2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_BUG, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBugOpcode ); DEFINE_OPCODE_HANDLER(CMSG_BUSY_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBusyTradeOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_BUYBACK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuybackItem ); - //DEFINE_OPCODE_HANDLER(CMSG_BUY_BANK_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyBankSlotOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_BUYBACK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuybackItem ); + DEFINE_OPCODE_HANDLER(CMSG_BUY_BANK_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyBankSlotOpcode ); DEFINE_OPCODE_HANDLER(CMSG_BUY_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_BUY_ITEM_IN_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyItemInSlotOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_BUY_LOTTERY_TICKET_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -135,7 +135,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_GUILD_FILTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGuildFilter ); //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_REMOVE_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarRemoveEvent ); //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_UPDATE_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarUpdateEvent ); - //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelAuraOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_CANCEL_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelAuraOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_AUTO_REPEAT_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelAutoRepeatSpellOpcode); //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_CAST, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleCancelCastOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_CHANNELLING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelChanneling ); @@ -202,7 +202,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_SKIRMISH_QUEUE_COMMAND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_COMPLAIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleComplainOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_COMPLETE_ACHIEVEMENT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_COMPLETE_CINEMATIC, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCompleteCinematic ); + DEFINE_OPCODE_HANDLER(CMSG_COMPLETE_CINEMATIC, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCompleteCinematic ); //DEFINE_OPCODE_HANDLER(CMSG_COMPLETE_MOVIE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_CONTACT_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleContactListOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_CONTROLLER_EJECT_PASSENGER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEjectPassenger ); @@ -849,13 +849,13 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_INFO_THROTTLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_PLAYER_JOINED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_PLAYER_LEFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BINDER_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BINDER_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_BINDPOINTUPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BINDZONEREPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_BREAK_TARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BUY_BANK_SLOT_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BUY_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BUY_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BUY_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BUY_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_ARENA_TEAM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_CLEAR_PENDING_ACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From 74fe587b499d72649c527d0bcccf08aadcd0d191 Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 5 Aug 2012 16:15:38 -0500 Subject: Protocol/PacketIO: Enabled a few more opcodes --- src/server/game/Handlers/ItemHandler.cpp | 4 ++-- src/server/game/Handlers/MiscHandler.cpp | 8 ++++---- src/server/game/Server/Protocol/Opcodes.cpp | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 7918b9e5672..e961e285821 100755 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -443,10 +443,10 @@ void WorldSession::SendItemSparseDb2Reply(uint32 entry) SendPacket(&data); } -void WorldSession::HandleReadItem(WorldPacket & recv_data) +void WorldSession::HandleReadItem(WorldPacket& recvData) { uint8 bag, slot; - recv_data >> bag >> slot; + recvData >> bag >> slot; Item* pItem = _player->GetItemByPos(bag, slot); diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 733dd862cd1..97b6a9ed942 100755 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -53,11 +53,11 @@ #include "AccountMgr.h" #include "Spell.h" -void WorldSession::HandleRepopRequestOpcode(WorldPacket & recv_data) +void WorldSession::HandleRepopRequestOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_REPOP_REQUEST Message"); - recv_data.read_skip(); + recvData.read_skip(); // FromLua ? if (GetPlayer()->isAlive() || GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST)) return; @@ -727,12 +727,12 @@ void WorldSession::HandleBugOpcode(WorldPacket & recv_data) CharacterDatabase.Execute(stmt); } -void WorldSession::HandleReclaimCorpseOpcode(WorldPacket &recv_data) +void WorldSession::HandleReclaimCorpseOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_RECLAIM_CORPSE"); uint64 guid; - recv_data >> guid; + recvData >> guid; if (GetPlayer()->isAlive()) return; diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index e2e178e7f9d..c5ec124a856 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -364,7 +364,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_ITEM_REFUND_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemRefundInfoRequest ); //DEFINE_OPCODE_HANDLER(CMSG_ITEM_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemTextQuery ); DEFINE_OPCODE_HANDLER(CMSG_JOIN_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleJoinChannel ); - //DEFINE_OPCODE_HANDLER(CMSG_KEEP_ALIVE, STATUS_NEVER, PROCESS_THREADUNSAFE, &WorldSession::Handle_EarlyProccess ); + DEFINE_OPCODE_HANDLER(CMSG_KEEP_ALIVE, STATUS_NEVER, PROCESS_THREADUNSAFE, &WorldSession::Handle_EarlyProccess ); //DEFINE_OPCODE_HANDLER(CMSG_LEARN_DANCE_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_LEARN_PREVIEW_TALENTS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnPreviewTalents ); //DEFINE_OPCODE_HANDLER(CMSG_LEARN_PREVIEW_TALENTS_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnPreviewTalentsPet ); @@ -500,7 +500,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_PLAYER_VEHICLE_ENTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEnterPlayerVehicle ); //DEFINE_OPCODE_HANDLER(CMSG_PLAY_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_PROFILEDATA_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_PUSHQUESTTOPARTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePushQuestToParty ); + DEFINE_OPCODE_HANDLER(CMSG_PUSHQUESTTOPARTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePushQuestToParty ); //DEFINE_OPCODE_HANDLER(CMSG_PVP_QUEUE_STATS_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_MAX_XP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_MEMBERS_FOR_RECIPE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -532,10 +532,10 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_QUEST_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestQueryOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_RANDOMIZE_CHAR_NAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRandomizeCharNameOpcode ); DEFINE_OPCODE_HANDLER(CMSG_READY_FOR_ACCOUNT_DATA_TIMES, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleReadyForAccountDataTimes ); - //DEFINE_OPCODE_HANDLER(CMSG_READ_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReadItem ); + DEFINE_OPCODE_HANDLER(CMSG_READ_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReadItem ); DEFINE_OPCODE_HANDLER(CMSG_REALM_SPLIT, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRealmSplitOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_RECHARGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_RECLAIM_CORPSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReclaimCorpseOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_RECLAIM_CORPSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReclaimCorpseOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_REDIRECTION_AUTH_PROOF, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_REDIRECTION_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_REFER_A_FRIEND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -543,7 +543,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_REFORGE_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_REMOVE_GLYPH, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRemoveGlyph ); DEFINE_OPCODE_HANDLER(CMSG_REPAIR_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepairItemOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_REPOP_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepopRequestOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_REPOP_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepopRequestOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_REPORT_PVP_AFK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReportPvPAFK ); DEFINE_OPCODE_HANDLER(CMSG_REQUEST_ACCOUNT_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestAccountData ); DEFINE_OPCODE_HANDLER(CMSG_REQUEST_HOTFIX, STATUS_AUTHED, PROCESS_INPLACE, &WorldSession::HandleRequestHotfix ); -- cgit v1.2.3 From 5b7b6e121cb3d1b6ee6ba19409b709fd73e0d80a Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 5 Aug 2012 17:33:29 -0500 Subject: Core/Misc: Fixed a crash in .modify money command. Fixed a mistake in the reforge handler --- src/server/game/Handlers/ItemHandler.cpp | 2 +- src/server/scripts/Commands/cs_modify.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index e961e285821..b17cff78d7d 100755 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -1671,7 +1671,7 @@ void WorldSession::HandleReforgeItemOpcode(WorldPacket& recvData) return; } - if (player->HasEnoughMoney(uint64(item->GetSpecialPrice()))) // cheating + if (!player->HasEnoughMoney(uint64(item->GetSpecialPrice()))) // cheating { SendReforgeResult(false); return; diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index a227070895c..fba1a9835f5 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -1033,9 +1033,9 @@ public: } else { - handler->PSendSysMessage(LANG_YOU_GIVE_MONEY, addmoney, handler->GetNameLink(target).c_str()); + handler->PSendSysMessage(LANG_YOU_GIVE_MONEY, uint32(addmoney), handler->GetNameLink(target).c_str()); if (handler->needReportToTarget(target)) - (ChatHandler(target)).PSendSysMessage(LANG_YOURS_MONEY_GIVEN, handler->GetNameLink().c_str(), addmoney); + (ChatHandler(target)).PSendSysMessage(LANG_YOURS_MONEY_GIVEN, handler->GetNameLink().c_str(), uint32(addmoney)); if (addmoney >=MAX_MONEY_AMOUNT) target->SetMoney(MAX_MONEY_AMOUNT); @@ -1043,7 +1043,7 @@ public: target->ModifyMoney(addmoney); } - sLog->outDetail(handler->GetTrinityString(LANG_NEW_MONEY), moneyuser, addmoney, target->GetMoney()); + sLog->outDetail(handler->GetTrinityString(LANG_NEW_MONEY), moneyuser, uint32(addmoney), target->GetMoney()); return true; } -- cgit v1.2.3 From 19289644430636940a876369c14dd938d7343fef Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 5 Aug 2012 19:40:30 -0500 Subject: Core/Items: Implemented SOCKET_COLOR_COGWHEEL. Codestyle/Misc: Renamed recv_data to recvData --- src/server/game/Entities/Item/ItemPrototype.h | 6 +- src/server/game/Entities/Player/Player.cpp | 7 +- src/server/game/Handlers/ArenaTeamHandler.cpp | 4 +- src/server/game/Handlers/BattleGroundHandler.cpp | 54 ++-- src/server/game/Handlers/CharacterHandler.cpp | 122 ++++---- src/server/game/Handlers/ChatHandler.cpp | 18 +- src/server/game/Handlers/CombatHandler.cpp | 10 +- src/server/game/Handlers/GroupHandler.cpp | 92 +++---- src/server/game/Handlers/GuildHandler.cpp | 108 ++++---- src/server/game/Handlers/ItemHandler.cpp | 84 +++--- src/server/game/Handlers/LFGHandler.cpp | 54 ++-- src/server/game/Handlers/LootHandler.cpp | 14 +- src/server/game/Handlers/MailHandler.cpp | 78 +++--- src/server/game/Handlers/MiscHandler.cpp | 292 ++++++++++---------- src/server/game/Handlers/MovementHandler.cpp | 56 ++-- src/server/game/Handlers/NPCHandler.cpp | 52 ++-- src/server/game/Handlers/PetHandler.cpp | 64 ++--- src/server/game/Handlers/PetitionsHandler.cpp | 84 +++--- src/server/game/Handlers/QueryHandler.cpp | 44 +-- src/server/game/Handlers/QuestHandler.cpp | 42 +-- src/server/game/Handlers/ReferAFriendHandler.cpp | 8 +- src/server/game/Handlers/SkillHandler.cpp | 12 +- src/server/game/Handlers/SpellHandler.cpp | 18 +- src/server/game/Handlers/TaxiHandler.cpp | 26 +- src/server/game/Handlers/TicketHandler.cpp | 38 +-- src/server/game/Handlers/VehicleHandler.cpp | 32 +-- src/server/game/Handlers/VoiceChatHandler.cpp | 14 +- src/server/game/Server/Protocol/Opcodes.cpp | 14 +- src/server/game/Server/WorldSession.h | 336 +++++++++++------------ src/server/game/Tickets/TicketMgr.cpp | 24 +- src/server/game/Tickets/TicketMgr.h | 2 +- 31 files changed, 912 insertions(+), 897 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Item/ItemPrototype.h b/src/server/game/Entities/Item/ItemPrototype.h index 5e052c588cc..0d51c6e7e70 100755 --- a/src/server/game/Entities/Item/ItemPrototype.h +++ b/src/server/game/Entities/Item/ItemPrototype.h @@ -235,10 +235,12 @@ enum SocketColor SOCKET_COLOR_META = 1, SOCKET_COLOR_RED = 2, SOCKET_COLOR_YELLOW = 4, - SOCKET_COLOR_BLUE = 8 + SOCKET_COLOR_BLUE = 8, + // 16, Hydraulic, not used + SOCKET_COLOR_COGWHEEL = 32 }; -#define SOCKET_COLOR_ALL (SOCKET_COLOR_META | SOCKET_COLOR_RED | SOCKET_COLOR_YELLOW | SOCKET_COLOR_BLUE) +#define SOCKET_COLOR_ALL (SOCKET_COLOR_META | SOCKET_COLOR_RED | SOCKET_COLOR_YELLOW | SOCKET_COLOR_BLUE | SOCKET_COLOR_COGWHEEL) enum InventoryType { diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 258f139ef02..9a6a6405a55 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -13365,6 +13365,11 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool if (pEnchant->requiredSkill > 0 && pEnchant->requiredSkillValue > GetSkillValue(pEnchant->requiredSkill)) return; + // Cogwheel gems dont have requirement data set in SpellItemEnchantment.dbc, but they do have it in Item-sparse.db2 + if (ItemTemplate const* gem = sObjectMgr->GetItemTemplate(pEnchant->GemID)) + if (gem->RequiredSkill && GetSkillValue(gem->RequiredSkill) < gem->RequiredSkillRank) + return; + // If we're dealing with a gem inside a prismatic socket we need to check the prismatic socket requirements // rather than the gem requirements itself. If the socket has no color it is a prismatic socket. if ((slot == SOCK_ENCHANTMENT_SLOT || slot == SOCK_ENCHANTMENT_SLOT_2 || slot == SOCK_ENCHANTMENT_SLOT_3) @@ -21329,7 +21334,7 @@ void Player::ToggleMetaGemsActive(uint8 exceptslot, bool apply) //cycle all equipped items for (int slot = EQUIPMENT_SLOT_START; slot < EQUIPMENT_SLOT_END; ++slot) { - //enchants for the slot being socketed are handled by WorldSession::HandleSocketOpcode(WorldPacket& recv_data) + //enchants for the slot being socketed are handled by WorldSession::HandleSocketOpcode(WorldPacket& recvData) if (slot == exceptslot) continue; diff --git a/src/server/game/Handlers/ArenaTeamHandler.cpp b/src/server/game/Handlers/ArenaTeamHandler.cpp index 8fb820713ce..ce4e2a15ca9 100755 --- a/src/server/game/Handlers/ArenaTeamHandler.cpp +++ b/src/server/game/Handlers/ArenaTeamHandler.cpp @@ -152,7 +152,7 @@ void WorldSession::HandleArenaTeamInviteOpcode(WorldPacket & recvData) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_ARENA_TEAM_INVITE"); } -void WorldSession::HandleArenaTeamAcceptOpcode(WorldPacket & /*recv_data*/) +void WorldSession::HandleArenaTeamAcceptOpcode(WorldPacket & /*recvData*/) { sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ARENA_TEAM_ACCEPT"); // empty opcode @@ -185,7 +185,7 @@ void WorldSession::HandleArenaTeamAcceptOpcode(WorldPacket & /*recv_data*/) arenaTeam->BroadcastEvent(ERR_ARENA_TEAM_JOIN_SS, _player->GetGUID(), 2, _player->GetName(), arenaTeam->GetName(), ""); } -void WorldSession::HandleArenaTeamDeclineOpcode(WorldPacket & /*recv_data*/) +void WorldSession::HandleArenaTeamDeclineOpcode(WorldPacket & /*recvData*/) { sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ARENA_TEAM_DECLINE"); // empty opcode diff --git a/src/server/game/Handlers/BattleGroundHandler.cpp b/src/server/game/Handlers/BattleGroundHandler.cpp index 41188e1134e..db3c9b7675b 100755 --- a/src/server/game/Handlers/BattleGroundHandler.cpp +++ b/src/server/game/Handlers/BattleGroundHandler.cpp @@ -35,10 +35,10 @@ #include "DisableMgr.h" #include "Group.h" -void WorldSession::HandleBattlemasterHelloOpcode(WorldPacket & recv_data) +void WorldSession::HandleBattlemasterHelloOpcode(WorldPacket & recvData) { uint64 guid; - recv_data >> guid; + recvData >> guid; sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_BATTLEMASTER_HELLO Message from (GUID: %u TypeId:%u)", GUID_LOPART(guid), GuidHigh2TypeId(GUID_HIPART(guid))); Creature* unit = GetPlayer()->GetMap()->GetCreature(guid); @@ -70,7 +70,7 @@ void WorldSession::SendBattleGroundList(uint64 guid, BattlegroundTypeId bgTypeId SendPacket(&data); } -void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data) +void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recvData) { uint64 guid; uint32 bgTypeId_; @@ -79,10 +79,10 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data) bool isPremade = false; Group* grp = NULL; - recv_data >> guid; // battlemaster guid - recv_data >> bgTypeId_; // battleground type id (DBC id) - recv_data >> instanceId; // instance id, 0 if First Available selected - recv_data >> joinAsGroup; // join as group + recvData >> guid; // battlemaster guid + recvData >> bgTypeId_; // battleground type id (DBC id) + recvData >> instanceId; // instance id, 0 if First Available selected + recvData >> joinAsGroup; // join as group if (!sBattlemasterListStore.LookupEntry(bgTypeId_)) { @@ -244,7 +244,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data) sBattlegroundMgr->ScheduleQueueUpdate(0, 0, bgQueueTypeId, bgTypeId, bracketEntry->GetBracketId()); } -void WorldSession::HandleBattlegroundPlayerPositionsOpcode(WorldPacket & /*recv_data*/) +void WorldSession::HandleBattlegroundPlayerPositionsOpcode(WorldPacket & /*recvData*/) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd MSG_BATTLEGROUND_PLAYER_POSITIONS Message"); @@ -290,7 +290,7 @@ void WorldSession::HandleBattlegroundPlayerPositionsOpcode(WorldPacket & /*recv_ SendPacket(&data); } -void WorldSession::HandlePVPLogDataOpcode(WorldPacket & /*recv_data*/) +void WorldSession::HandlePVPLogDataOpcode(WorldPacket & /*recvData*/) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd MSG_PVP_LOG_DATA Message"); @@ -309,12 +309,12 @@ void WorldSession::HandlePVPLogDataOpcode(WorldPacket & /*recv_data*/) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent MSG_PVP_LOG_DATA Message"); } -void WorldSession::HandleBattlefieldListOpcode(WorldPacket& recv_data) +void WorldSession::HandleBattlefieldListOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_BATTLEFIELD_LIST Message"); uint32 bgTypeId; - recv_data >> bgTypeId; // id from DBC + recvData >> bgTypeId; // id from DBC BattlemasterListEntry const* bl = sBattlemasterListStore.LookupEntry(bgTypeId); if (!bl) @@ -328,7 +328,7 @@ void WorldSession::HandleBattlefieldListOpcode(WorldPacket& recv_data) SendPacket(&data); } -void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recv_data) +void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_BATTLEFIELD_PORT Message"); @@ -338,7 +338,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recv_data) uint16 unk; // 0x1F90 constant? uint8 action; // enter battle 0x1, leave queue 0x0 - recv_data >> type >> unk2 >> bgTypeId_ >> unk >> action; + recvData >> type >> unk2 >> bgTypeId_ >> unk >> action; if (!sBattlemasterListStore.LookupEntry(bgTypeId_)) { @@ -477,14 +477,14 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recv_data) } } -void WorldSession::HandleLeaveBattlefieldOpcode(WorldPacket& recv_data) +void WorldSession::HandleLeaveBattlefieldOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_LEAVE_BATTLEFIELD Message"); - recv_data.read_skip(); // unk1 - recv_data.read_skip(); // unk2 - recv_data.read_skip(); // BattlegroundTypeId - recv_data.read_skip(); // unk3 + recvData.read_skip(); // unk1 + recvData.read_skip(); // unk2 + recvData.read_skip(); // BattlegroundTypeId + recvData.read_skip(); // unk3 // not allow leave battleground in combat if (_player->isInCombat()) @@ -495,7 +495,7 @@ void WorldSession::HandleLeaveBattlefieldOpcode(WorldPacket& recv_data) _player->LeaveBattleground(); } -void WorldSession::HandleBattlefieldStatusOpcode(WorldPacket & /*recv_data*/) +void WorldSession::HandleBattlefieldStatusOpcode(WorldPacket & /*recvData*/) { // empty opcode sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Battleground status"); @@ -559,14 +559,14 @@ void WorldSession::HandleBattlefieldStatusOpcode(WorldPacket & /*recv_data*/) } } -void WorldSession::HandleAreaSpiritHealerQueryOpcode(WorldPacket & recv_data) +void WorldSession::HandleAreaSpiritHealerQueryOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AREA_SPIRIT_HEALER_QUERY"); Battleground* bg = _player->GetBattleground(); uint64 guid; - recv_data >> guid; + recvData >> guid; Creature* unit = GetPlayer()->GetMap()->GetCreature(guid); if (!unit) @@ -579,14 +579,14 @@ void WorldSession::HandleAreaSpiritHealerQueryOpcode(WorldPacket & recv_data) sBattlegroundMgr->SendAreaSpiritHealerQueryOpcode(_player, bg, guid); } -void WorldSession::HandleAreaSpiritHealerQueueOpcode(WorldPacket & recv_data) +void WorldSession::HandleAreaSpiritHealerQueueOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AREA_SPIRIT_HEALER_QUEUE"); Battleground* bg = _player->GetBattleground(); uint64 guid; - recv_data >> guid; + recvData >> guid; Creature* unit = GetPlayer()->GetMap()->GetCreature(guid); if (!unit) @@ -599,7 +599,7 @@ void WorldSession::HandleAreaSpiritHealerQueueOpcode(WorldPacket & recv_data) bg->AddPlayerToResurrectQueue(guid, _player->GetGUID()); } -void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recv_data) +void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_BATTLEMASTER_JOIN_ARENA"); @@ -609,7 +609,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recv_data) uint8 isRated; // isRated Group* grp = NULL; - recv_data >> guid >> arenaslot >> asGroup >> isRated; + recvData >> guid >> arenaslot >> asGroup >> isRated; // ignore if we already in BG or BG queue if (_player->InBattleground()) @@ -767,10 +767,10 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recv_data) sBattlegroundMgr->ScheduleQueueUpdate(matchmakerRating, arenatype, bgQueueTypeId, bgTypeId, bracketEntry->GetBracketId()); } -void WorldSession::HandleReportPvPAFK(WorldPacket & recv_data) +void WorldSession::HandleReportPvPAFK(WorldPacket & recvData) { uint64 playerGuid; - recv_data >> playerGuid; + recvData >> playerGuid; Player* reportedPlayer = ObjectAccessor::FindPlayer(playerGuid); if (!reportedPlayer) diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 996e0e97ea6..78388c661ef 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -247,7 +247,7 @@ void WorldSession::HandleCharEnum(PreparedQueryResult result) SendPacket(&data); } -void WorldSession::HandleCharEnumOpcode(WorldPacket & /*recv_data*/) +void WorldSession::HandleCharEnumOpcode(WorldPacket & /*recvData*/) { // remove expired bans PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_EXPIRED_BANS); @@ -266,20 +266,20 @@ void WorldSession::HandleCharEnumOpcode(WorldPacket & /*recv_data*/) _charEnumCallback = CharacterDatabase.AsyncQuery(stmt); } -void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data) +void WorldSession::HandleCharCreateOpcode(WorldPacket & recvData) { std::string name; uint8 race_, class_; - recv_data >> name; + recvData >> name; - recv_data >> race_; - recv_data >> class_; + recvData >> race_; + recvData >> class_; // extract other data required for player creating uint8 gender, skin, face, hairStyle, hairColor, facialHair, outfitId; - recv_data >> gender >> skin >> face; - recv_data >> hairStyle >> hairColor >> facialHair >> outfitId; + recvData >> gender >> skin >> face; + recvData >> hairStyle >> hairColor >> facialHair >> outfitId; WorldPacket data(SMSG_CHAR_CREATE, 1); // returned with diff.values in all cases @@ -404,7 +404,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data) } delete _charCreateCallback.GetParam(); // Delete existing if any, to make the callback chain reset to stage 0 - _charCreateCallback.SetParam(new CharacterCreateInfo(name, race_, class_, gender, skin, face, hairStyle, hairColor, facialHair, outfitId, recv_data)); + _charCreateCallback.SetParam(new CharacterCreateInfo(name, race_, class_, gender, skin, face, hairStyle, hairColor, facialHair, outfitId, recvData)); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHECK_NAME); stmt->setString(0, name); _charCreateCallback.SetFutureResult(CharacterDatabase.AsyncQuery(stmt)); @@ -688,10 +688,10 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte } } -void WorldSession::HandleCharDeleteOpcode(WorldPacket & recv_data) +void WorldSession::HandleCharDeleteOpcode(WorldPacket & recvData) { uint64 guid; - recv_data >> guid; + recvData >> guid; // can't delete loaded character if (ObjectAccessor::FindPlayer(guid)) @@ -1097,30 +1097,30 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder) delete holder; } -void WorldSession::HandleSetFactionAtWar(WorldPacket & recv_data) +void WorldSession::HandleSetFactionAtWar(WorldPacket & recvData) { sLog->outStaticDebug("WORLD: Received CMSG_SET_FACTION_ATWAR"); uint32 repListID; uint8 flag; - recv_data >> repListID; - recv_data >> flag; + recvData >> repListID; + recvData >> flag; GetPlayer()->GetReputationMgr().SetAtWar(repListID, flag); } //I think this function is never used :/ I dunno, but i guess this opcode not exists -void WorldSession::HandleSetFactionCheat(WorldPacket & /*recv_data*/) +void WorldSession::HandleSetFactionCheat(WorldPacket & /*recvData*/) { sLog->outError("WORLD SESSION: HandleSetFactionCheat, not expected call, please report."); GetPlayer()->GetReputationMgr().SendStates(); } -void WorldSession::HandleTutorialFlag(WorldPacket & recv_data) +void WorldSession::HandleTutorialFlag(WorldPacket & recvData) { uint32 data; - recv_data >> data; + recvData >> data; uint8 index = uint8(data / 32); if (index >= MAX_ACCOUNT_TUTORIAL_VALUES) @@ -1133,57 +1133,57 @@ void WorldSession::HandleTutorialFlag(WorldPacket & recv_data) SetTutorialInt(index, flag); } -void WorldSession::HandleTutorialClear(WorldPacket & /*recv_data*/) +void WorldSession::HandleTutorialClear(WorldPacket & /*recvData*/) { for (uint8 i = 0; i < MAX_ACCOUNT_TUTORIAL_VALUES; ++i) SetTutorialInt(i, 0xFFFFFFFF); } -void WorldSession::HandleTutorialReset(WorldPacket & /*recv_data*/) +void WorldSession::HandleTutorialReset(WorldPacket & /*recvData*/) { for (uint8 i = 0; i < MAX_ACCOUNT_TUTORIAL_VALUES; ++i) SetTutorialInt(i, 0x00000000); } -void WorldSession::HandleSetWatchedFactionOpcode(WorldPacket & recv_data) +void WorldSession::HandleSetWatchedFactionOpcode(WorldPacket & recvData) { sLog->outStaticDebug("WORLD: Received CMSG_SET_WATCHED_FACTION"); uint32 fact; - recv_data >> fact; + recvData >> fact; GetPlayer()->SetUInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, fact); } -void WorldSession::HandleSetFactionInactiveOpcode(WorldPacket & recv_data) +void WorldSession::HandleSetFactionInactiveOpcode(WorldPacket & recvData) { sLog->outStaticDebug("WORLD: Received CMSG_SET_FACTION_INACTIVE"); uint32 replistid; uint8 inactive; - recv_data >> replistid >> inactive; + recvData >> replistid >> inactive; _player->GetReputationMgr().SetInactive(replistid, inactive); } -void WorldSession::HandleShowingHelmOpcode(WorldPacket& recv_data) +void WorldSession::HandleShowingHelmOpcode(WorldPacket& recvData) { sLog->outStaticDebug("CMSG_SHOWING_HELM for %s", _player->GetName()); - recv_data.read_skip(); // unknown, bool? + recvData.read_skip(); // unknown, bool? _player->ToggleFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_HELM); } -void WorldSession::HandleShowingCloakOpcode(WorldPacket& recv_data) +void WorldSession::HandleShowingCloakOpcode(WorldPacket& recvData) { sLog->outStaticDebug("CMSG_SHOWING_CLOAK for %s", _player->GetName()); - recv_data.read_skip(); // unknown, bool? + recvData.read_skip(); // unknown, bool? _player->ToggleFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_CLOAK); } -void WorldSession::HandleCharRenameOpcode(WorldPacket& recv_data) +void WorldSession::HandleCharRenameOpcode(WorldPacket& recvData) { uint64 guid; std::string newName; - recv_data >> guid; - recv_data >> newName; + recvData >> guid; + recvData >> newName; // prevent character rename to invalid name if (!normalizePlayerName(newName)) @@ -1273,11 +1273,11 @@ void WorldSession::HandleChangePlayerNameOpcodeCallBack(PreparedQueryResult resu sWorld->UpdateCharacterNameData(guidLow, newName); } -void WorldSession::HandleSetPlayerDeclinedNames(WorldPacket& recv_data) +void WorldSession::HandleSetPlayerDeclinedNames(WorldPacket& recvData) { uint64 guid; - recv_data >> guid; + recvData >> guid; // not accept declined names for unsupported languages std::string name; @@ -1312,7 +1312,7 @@ void WorldSession::HandleSetPlayerDeclinedNames(WorldPacket& recv_data) std::string name2; DeclinedName declinedname; - recv_data >> name2; + recvData >> name2; if (name2 != name) // character have different name { @@ -1325,7 +1325,7 @@ void WorldSession::HandleSetPlayerDeclinedNames(WorldPacket& recv_data) for (int i = 0; i < MAX_DECLINED_NAME_CASES; ++i) { - recv_data >> declinedname.name[i]; + recvData >> declinedname.name[i]; if (!normalizePlayerName(declinedname.name[i])) { WorldPacket data(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, 4+8); @@ -1370,12 +1370,12 @@ void WorldSession::HandleSetPlayerDeclinedNames(WorldPacket& recv_data) SendPacket(&data); } -void WorldSession::HandleAlterAppearance(WorldPacket & recv_data) +void WorldSession::HandleAlterAppearance(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ALTER_APPEARANCE"); uint32 Hair, Color, FacialHair, SkinColor; - recv_data >> Hair >> Color >> FacialHair >> SkinColor; + recvData >> Hair >> Color >> FacialHair >> SkinColor; BarberShopStyleEntry const* bs_hair = sBarberShopStyleStore.LookupEntry(Hair); @@ -1425,10 +1425,10 @@ void WorldSession::HandleAlterAppearance(WorldPacket & recv_data) _player->SetStandState(0); // stand up } -void WorldSession::HandleRemoveGlyph(WorldPacket & recv_data) +void WorldSession::HandleRemoveGlyph(WorldPacket & recvData) { uint32 slot; - recv_data >> slot; + recvData >> slot; if (slot >= MAX_GLYPH_SLOT_INDEX) { @@ -1447,16 +1447,16 @@ void WorldSession::HandleRemoveGlyph(WorldPacket & recv_data) } } -void WorldSession::HandleCharCustomize(WorldPacket& recv_data) +void WorldSession::HandleCharCustomize(WorldPacket& recvData) { uint64 guid; std::string newName; - recv_data >> guid; - recv_data >> newName; + recvData >> guid; + recvData >> newName; uint8 gender, skin, face, hairStyle, hairColor, facialHair; - recv_data >> gender >> skin >> hairColor >> hairStyle >> facialHair >> face; + recvData >> gender >> skin >> hairColor >> hairStyle >> facialHair >> face; PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_AT_LOGIN); stmt->setUInt32(0, GUID_LOPART(guid)); @@ -1561,23 +1561,23 @@ void WorldSession::HandleCharCustomize(WorldPacket& recv_data) SendPacket(&data); } -void WorldSession::HandleEquipmentSetSave(WorldPacket &recv_data) +void WorldSession::HandleEquipmentSetSave(WorldPacket &recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_EQUIPMENT_SET_SAVE"); uint64 setGuid; - recv_data.readPackGUID(setGuid); + recvData.readPackGUID(setGuid); uint32 index; - recv_data >> index; + recvData >> index; if (index >= MAX_EQUIPMENT_SET_INDEX) // client set slots amount return; std::string name; - recv_data >> name; + recvData >> name; std::string iconName; - recv_data >> iconName; + recvData >> iconName; EquipmentSet eqSet; @@ -1589,7 +1589,7 @@ void WorldSession::HandleEquipmentSetSave(WorldPacket &recv_data) for (uint32 i = 0; i < EQUIPMENT_SLOT_END; ++i) { uint64 itemGuid; - recv_data.readPackGUID(itemGuid); + recvData.readPackGUID(itemGuid); // equipment manager sends "1" (as raw GUID) for slots set to "ignore" (don't touch slot at equip set) if (itemGuid == 1) @@ -1613,17 +1613,17 @@ void WorldSession::HandleEquipmentSetSave(WorldPacket &recv_data) _player->SetEquipmentSet(index, eqSet); } -void WorldSession::HandleEquipmentSetDelete(WorldPacket &recv_data) +void WorldSession::HandleEquipmentSetDelete(WorldPacket &recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_EQUIPMENT_SET_DELETE"); uint64 setGuid; - recv_data.readPackGUID(setGuid); + recvData.readPackGUID(setGuid); _player->DeleteEquipmentSet(setGuid); } -void WorldSession::HandleEquipmentSetUse(WorldPacket &recv_data) +void WorldSession::HandleEquipmentSetUse(WorldPacket &recvData) { if (_player->isInCombat()) return; @@ -1633,10 +1633,10 @@ void WorldSession::HandleEquipmentSetUse(WorldPacket &recv_data) for (uint32 i = 0; i < EQUIPMENT_SLOT_END; ++i) { uint64 itemGuid; - recv_data.readPackGUID(itemGuid); + recvData.readPackGUID(itemGuid); uint8 srcbag, srcslot; - recv_data >> srcbag >> srcslot; + recvData >> srcbag >> srcslot; sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item " UI64FMTD ": srcbag %u, srcslot %u", itemGuid, srcbag, srcslot); @@ -1678,15 +1678,15 @@ void WorldSession::HandleEquipmentSetUse(WorldPacket &recv_data) SendPacket(&data); } -void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) +void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) { // TODO: Move queries to prepared statements uint64 guid; std::string newname; uint8 gender, skin, face, hairStyle, hairColor, facialHair, race; - recv_data >> guid; - recv_data >> newname; - recv_data >> gender >> skin >> hairColor >> hairStyle >> facialHair >> face >> race; + recvData >> guid; + recvData >> newname; + recvData >> gender >> skin >> hairColor >> hairStyle >> facialHair >> face >> race; uint32 lowGuid = GUID_LOPART(guid); @@ -1708,7 +1708,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) uint32 playerClass = uint32(fields[0].GetUInt8()); uint32 level = uint32(fields[1].GetUInt8()); uint32 at_loginFlags = fields[2].GetUInt16(); - uint32 used_loginFlag = ((recv_data.GetOpcode() == CMSG_CHAR_RACE_CHANGE) ? AT_LOGIN_CHANGE_RACE : AT_LOGIN_CHANGE_FACTION); + uint32 used_loginFlag = ((recvData.GetOpcode() == CMSG_CHAR_RACE_CHANGE) ? AT_LOGIN_CHANGE_RACE : AT_LOGIN_CHANGE_FACTION); if (!sObjectMgr->GetPlayerInfo(race, playerClass)) { @@ -1872,7 +1872,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) trans->Append(stmt); } - if (recv_data.GetOpcode() == CMSG_CHAR_FACTION_CHANGE) + if (recvData.GetOpcode() == CMSG_CHAR_FACTION_CHANGE) { // Delete all Flypaths PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_TAXI_PATH); @@ -2107,12 +2107,12 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) SendPacket(&data); } -void WorldSession::HandleRandomizeCharNameOpcode(WorldPacket& recv_data) +void WorldSession::HandleRandomizeCharNameOpcode(WorldPacket& recvData) { uint8 gender, race; - recv_data >> gender; - recv_data >> race; + recvData >> gender; + recvData >> race; if (!Player::IsValidRace(race)) { diff --git a/src/server/game/Handlers/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cpp index 707d985cd3f..c8b94a8aa8b 100755 --- a/src/server/game/Handlers/ChatHandler.cpp +++ b/src/server/game/Handlers/ChatHandler.cpp @@ -645,13 +645,13 @@ void WorldSession::HandleAddonMessagechatOpcode(WorldPacket& recvData) } } -void WorldSession::HandleEmoteOpcode(WorldPacket & recv_data) +void WorldSession::HandleEmoteOpcode(WorldPacket & recvData) { if (!GetPlayer()->isAlive() || GetPlayer()->HasUnitState(UNIT_STATE_DIED)) return; uint32 emote; - recv_data >> emote; + recvData >> emote; sScriptMgr->OnPlayerEmote(GetPlayer(), emote); GetPlayer()->HandleEmoteCommand(emote); } @@ -688,7 +688,7 @@ namespace Trinity }; } // namespace Trinity -void WorldSession::HandleTextEmoteOpcode(WorldPacket & recv_data) +void WorldSession::HandleTextEmoteOpcode(WorldPacket & recvData) { if (!GetPlayer()->isAlive()) return; @@ -703,9 +703,9 @@ void WorldSession::HandleTextEmoteOpcode(WorldPacket & recv_data) uint32 text_emote, emoteNum; uint64 guid; - recv_data >> text_emote; - recv_data >> emoteNum; - recv_data >> guid; + recvData >> text_emote; + recvData >> emoteNum; + recvData >> guid; sScriptMgr->OnPlayerTextEmote(GetPlayer(), text_emote, emoteNum, guid); @@ -750,14 +750,14 @@ void WorldSession::HandleTextEmoteOpcode(WorldPacket & recv_data) ((Creature*)unit)->AI()->ReceiveEmote(GetPlayer(), text_emote); } -void WorldSession::HandleChatIgnoredOpcode(WorldPacket& recv_data) +void WorldSession::HandleChatIgnoredOpcode(WorldPacket& recvData) { uint64 iguid; uint8 unk; //sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: Received CMSG_CHAT_IGNORED"); - recv_data >> iguid; - recv_data >> unk; // probably related to spam reporting + recvData >> iguid; + recvData >> unk; // probably related to spam reporting Player* player = ObjectAccessor::FindPlayer(iguid); if (!player || !player->GetSession()) diff --git a/src/server/game/Handlers/CombatHandler.cpp b/src/server/game/Handlers/CombatHandler.cpp index 6693cdfca27..37fa684fffe 100755 --- a/src/server/game/Handlers/CombatHandler.cpp +++ b/src/server/game/Handlers/CombatHandler.cpp @@ -26,10 +26,10 @@ #include "Vehicle.h" #include "VehicleDefines.h" -void WorldSession::HandleAttackSwingOpcode(WorldPacket& recv_data) +void WorldSession::HandleAttackSwingOpcode(WorldPacket& recvData) { uint64 guid; - recv_data >> guid; + recvData >> guid; sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_ATTACKSWING Message guidlow:%u guidhigh:%u", GUID_LOPART(guid), GUID_HIPART(guid)); @@ -66,15 +66,15 @@ void WorldSession::HandleAttackSwingOpcode(WorldPacket& recv_data) _player->Attack(pEnemy, true); } -void WorldSession::HandleAttackStopOpcode(WorldPacket & /*recv_data*/) +void WorldSession::HandleAttackStopOpcode(WorldPacket & /*recvData*/) { GetPlayer()->AttackStop(); } -void WorldSession::HandleSetSheathedOpcode(WorldPacket& recv_data) +void WorldSession::HandleSetSheathedOpcode(WorldPacket& recvData) { uint32 sheathed; - recv_data >> sheathed; + recvData >> sheathed; //sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: Recvd CMSG_SETSHEATHED Message guidlow:%u value1:%u", GetPlayer()->GetGUIDLow(), sheathed); diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp index 8ffb41ddc87..1a2395605ed 100755 --- a/src/server/game/Handlers/GroupHandler.cpp +++ b/src/server/game/Handlers/GroupHandler.cpp @@ -228,11 +228,11 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket & recvData) SendPartyResult(PARTY_OP_INVITE, memberName, ERR_PARTY_RESULT_OK); } -void WorldSession::HandleGroupAcceptOpcode(WorldPacket& recv_data) +void WorldSession::HandleGroupAcceptOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_ACCEPT"); - recv_data.read_skip(); + recvData.read_skip(); Group* group = GetPlayer()->GetGroupInvite(); if (!group) @@ -280,7 +280,7 @@ void WorldSession::HandleGroupAcceptOpcode(WorldPacket& recv_data) group->BroadcastGroupUpdate(); } -void WorldSession::HandleGroupDeclineOpcode(WorldPacket & /*recv_data*/) +void WorldSession::HandleGroupDeclineOpcode(WorldPacket & /*recvData*/) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_DECLINE"); @@ -304,14 +304,14 @@ void WorldSession::HandleGroupDeclineOpcode(WorldPacket & /*recv_data*/) leader->GetSession()->SendPacket(&data); } -void WorldSession::HandleGroupUninviteGuidOpcode(WorldPacket & recv_data) +void WorldSession::HandleGroupUninviteGuidOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_UNINVITE_GUID"); uint64 guid; std::string reason; - recv_data >> guid; - recv_data >> reason; + recvData >> guid; + recvData >> reason; //can't uninvite yourself if (guid == GetPlayer()->GetGUID()) @@ -352,12 +352,12 @@ void WorldSession::HandleGroupUninviteGuidOpcode(WorldPacket & recv_data) SendPartyResult(PARTY_OP_UNINVITE, "", ERR_TARGET_NOT_IN_GROUP_S); } -void WorldSession::HandleGroupUninviteOpcode(WorldPacket & recv_data) +void WorldSession::HandleGroupUninviteOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_UNINVITE"); std::string membername; - recv_data >> membername; + recvData >> membername; // player not found if (!normalizePlayerName(membername)) @@ -396,12 +396,12 @@ void WorldSession::HandleGroupUninviteOpcode(WorldPacket & recv_data) SendPartyResult(PARTY_OP_UNINVITE, membername, ERR_TARGET_NOT_IN_GROUP_S); } -void WorldSession::HandleGroupSetLeaderOpcode(WorldPacket & recv_data) +void WorldSession::HandleGroupSetLeaderOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_SET_LEADER"); uint64 guid; - recv_data >> guid; + recvData >> guid; Player* player = ObjectAccessor::FindPlayer(guid); Group* group = GetPlayer()->GetGroup(); @@ -417,7 +417,7 @@ void WorldSession::HandleGroupSetLeaderOpcode(WorldPacket & recv_data) group->SendUpdate(); } -void WorldSession::HandleGroupDisbandOpcode(WorldPacket & /*recv_data*/) +void WorldSession::HandleGroupDisbandOpcode(WorldPacket & /*recvData*/) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_DISBAND"); @@ -440,14 +440,14 @@ void WorldSession::HandleGroupDisbandOpcode(WorldPacket & /*recv_data*/) GetPlayer()->RemoveFromGroup(GROUP_REMOVEMETHOD_LEAVE); } -void WorldSession::HandleLootMethodOpcode(WorldPacket & recv_data) +void WorldSession::HandleLootMethodOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_LOOT_METHOD"); uint32 lootMethod; uint64 lootMaster; uint32 lootThreshold; - recv_data >> lootMethod >> lootMaster >> lootThreshold; + recvData >> lootMethod >> lootMaster >> lootThreshold; Group* group = GetPlayer()->GetGroup(); if (!group) @@ -491,7 +491,7 @@ void WorldSession::HandleLootRoll(WorldPacket& recvData) } } -void WorldSession::HandleMinimapPingOpcode(WorldPacket& recv_data) +void WorldSession::HandleMinimapPingOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_MINIMAP_PING"); @@ -499,8 +499,8 @@ void WorldSession::HandleMinimapPingOpcode(WorldPacket& recv_data) return; float x, y; - recv_data >> x; - recv_data >> y; + recvData >> x; + recvData >> y; //sLog->outDebug("Received opcode MSG_MINIMAP_PING X: %f, Y: %f", x, y); @@ -515,13 +515,13 @@ void WorldSession::HandleMinimapPingOpcode(WorldPacket& recv_data) GetPlayer()->GetGroup()->BroadcastPacket(&data, true, -1, GetPlayer()->GetGUID()); } -void WorldSession::HandleRandomRollOpcode(WorldPacket& recv_data) +void WorldSession::HandleRandomRollOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_RANDOM_ROLL"); uint32 minimum, maximum, roll; - recv_data >> minimum; - recv_data >> maximum; + recvData >> minimum; + recvData >> maximum; /** error handling **/ if (minimum > maximum || maximum > 10000) // < 32768 for urand call @@ -544,7 +544,7 @@ void WorldSession::HandleRandomRollOpcode(WorldPacket& recv_data) SendPacket(&data); } -void WorldSession::HandleRaidTargetUpdateOpcode(WorldPacket & recv_data) +void WorldSession::HandleRaidTargetUpdateOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_RAID_TARGET_UPDATE"); @@ -553,7 +553,7 @@ void WorldSession::HandleRaidTargetUpdateOpcode(WorldPacket & recv_data) return; uint8 x; - recv_data >> x; + recvData >> x; /** error handling **/ /********************/ @@ -569,12 +569,12 @@ void WorldSession::HandleRaidTargetUpdateOpcode(WorldPacket & recv_data) return; uint64 guid; - recv_data >> guid; + recvData >> guid; group->SetTargetIcon(x, _player->GetGUID(), guid); } } -void WorldSession::HandleGroupRaidConvertOpcode(WorldPacket& recv_data) +void WorldSession::HandleGroupRaidConvertOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_RAID_CONVERT"); @@ -595,7 +595,7 @@ void WorldSession::HandleGroupRaidConvertOpcode(WorldPacket& recv_data) // New 4.x: it is now possible to convert a raid to a group if member count is 5 or less bool toRaid; - recv_data >> toRaid; + recvData >> toRaid; if (toRaid) group->ConvertToRaid(); @@ -603,7 +603,7 @@ void WorldSession::HandleGroupRaidConvertOpcode(WorldPacket& recv_data) group->ConvertToGroup(); } -void WorldSession::HandleGroupChangeSubGroupOpcode(WorldPacket & recv_data) +void WorldSession::HandleGroupChangeSubGroupOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_CHANGE_SUB_GROUP"); @@ -614,8 +614,8 @@ void WorldSession::HandleGroupChangeSubGroupOpcode(WorldPacket & recv_data) std::string name; uint8 groupNr; - recv_data >> name; - recv_data >> groupNr; + recvData >> name; + recvData >> groupNr; if (groupNr >= MAX_RAID_SUBGROUPS) return; @@ -642,17 +642,17 @@ void WorldSession::HandleGroupChangeSubGroupOpcode(WorldPacket & recv_data) group->ChangeMembersGroup(guid, groupNr); } -void WorldSession::HandleGroupSwapSubGroupOpcode(WorldPacket & recv_data) +void WorldSession::HandleGroupSwapSubGroupOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_SWAP_SUB_GROUP"); std::string unk1; std::string unk2; - recv_data >> unk1; - recv_data >> unk2; + recvData >> unk1; + recvData >> unk2; } -void WorldSession::HandleGroupAssistantLeaderOpcode(WorldPacket & recv_data) +void WorldSession::HandleGroupAssistantLeaderOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_ASSISTANT_LEADER"); @@ -665,15 +665,15 @@ void WorldSession::HandleGroupAssistantLeaderOpcode(WorldPacket & recv_data) uint64 guid; bool apply; - recv_data >> guid; - recv_data >> apply; + recvData >> guid; + recvData >> apply; group->SetGroupMemberFlag(guid, apply, MEMBER_FLAG_ASSISTANT); group->SendUpdate(); } -void WorldSession::HandlePartyAssignmentOpcode(WorldPacket & recv_data) +void WorldSession::HandlePartyAssignmentOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_PARTY_ASSIGNMENT"); @@ -688,8 +688,8 @@ void WorldSession::HandlePartyAssignmentOpcode(WorldPacket & recv_data) uint8 assignment; bool apply; uint64 guid; - recv_data >> assignment >> apply; - recv_data >> guid; + recvData >> assignment >> apply; + recvData >> guid; switch (assignment) { @@ -707,7 +707,7 @@ void WorldSession::HandlePartyAssignmentOpcode(WorldPacket & recv_data) group->SendUpdate(); } -void WorldSession::HandleRaidReadyCheckOpcode(WorldPacket & recv_data) +void WorldSession::HandleRaidReadyCheckOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_RAID_READY_CHECK"); @@ -715,7 +715,7 @@ void WorldSession::HandleRaidReadyCheckOpcode(WorldPacket & recv_data) if (!group) return; - if (recv_data.empty()) // request + if (recvData.empty()) // request { /** error handling **/ if (!group->IsLeader(GetPlayer()->GetGUID()) && !group->IsAssistant(GetPlayer()->GetGUID())) @@ -732,7 +732,7 @@ void WorldSession::HandleRaidReadyCheckOpcode(WorldPacket & recv_data) else // answer { uint8 state; - recv_data >> state; + recvData >> state; // everything's fine, do it WorldPacket data(MSG_RAID_READY_CHECK_CONFIRM, 9); @@ -742,7 +742,7 @@ void WorldSession::HandleRaidReadyCheckOpcode(WorldPacket & recv_data) } } -void WorldSession::HandleRaidReadyCheckFinishedOpcode(WorldPacket & /*recv_data*/) +void WorldSession::HandleRaidReadyCheckFinishedOpcode(WorldPacket & /*recvData*/) { //Group* group = GetPlayer()->GetGroup(); //if (!group) @@ -922,11 +922,11 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player* player, WorldPacke } /*this procedure handles clients CMSG_REQUEST_PARTY_MEMBER_STATS request*/ -void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket &recv_data) +void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket &recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_REQUEST_PARTY_MEMBER_STATS"); uint64 Guid; - recv_data >> Guid; + recvData >> Guid; Player* player = HashMapHolder::Find(Guid); if (!player) @@ -1012,23 +1012,23 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket &recv_data) SendPacket(&data); } -/*!*/void WorldSession::HandleRequestRaidInfoOpcode(WorldPacket & /*recv_data*/) +/*!*/void WorldSession::HandleRequestRaidInfoOpcode(WorldPacket & /*recvData*/) { // every time the player checks the character screen _player->SendRaidInfo(); } -/*void WorldSession::HandleGroupCancelOpcode(WorldPacket & recv_data) +/*void WorldSession::HandleGroupCancelOpcode(WorldPacket & recvData) { sLog->outDebug("WORLD: got CMSG_GROUP_CANCEL."); }*/ -void WorldSession::HandleOptOutOfLootOpcode(WorldPacket & recv_data) +void WorldSession::HandleOptOutOfLootOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_OPT_OUT_OF_LOOT"); uint32 passOnLoot; - recv_data >> passOnLoot; // 1 always pass, 0 do not pass + recvData >> passOnLoot; // 1 always pass, 0 do not pass // ignore if player not loaded if (!GetPlayer()) // needed because STATUS_AUTHED diff --git a/src/server/game/Handlers/GuildHandler.cpp b/src/server/game/Handlers/GuildHandler.cpp index 5ed44b61333..73631e2f003 100755 --- a/src/server/game/Handlers/GuildHandler.cpp +++ b/src/server/game/Handlers/GuildHandler.cpp @@ -428,7 +428,7 @@ void WorldSession::HandleGuildEventLogQueryOpcode(WorldPacket& /* recvPacket */) guild->SendEventLog(this); } -void WorldSession::HandleGuildBankMoneyWithdrawn(WorldPacket & /* recv_data */) +void WorldSession::HandleGuildBankMoneyWithdrawn(WorldPacket & /* recvData */) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (MSG_GUILD_BANK_MONEY_WITHDRAWN)"); @@ -436,7 +436,7 @@ void WorldSession::HandleGuildBankMoneyWithdrawn(WorldPacket & /* recv_data */) guild->SendMoneyInfo(this); } -void WorldSession::HandleGuildPermissions(WorldPacket& /* recv_data */) +void WorldSession::HandleGuildPermissions(WorldPacket& /* recvData */) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (CMSG_GUILD_PERMISSIONS)"); @@ -445,15 +445,15 @@ void WorldSession::HandleGuildPermissions(WorldPacket& /* recv_data */) } // Called when clicking on Guild bank gameobject -void WorldSession::HandleGuildBankerActivate(WorldPacket & recv_data) +void WorldSession::HandleGuildBankerActivate(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (CMSG_GUILD_BANKER_ACTIVATE)"); uint64 GoGuid; - recv_data >> GoGuid; + recvData >> GoGuid; uint8 fullSlotList; - recv_data >> fullSlotList; // 0 = only slots updated in last operation are shown. 1 = all slots updated + recvData >> fullSlotList; // 0 = only slots updated in last operation are shown. 1 = all slots updated if (GetPlayer()->GetGameObjectIfCanInteractWith(GoGuid, GAMEOBJECT_TYPE_GUILD_BANK)) { @@ -465,33 +465,33 @@ void WorldSession::HandleGuildBankerActivate(WorldPacket & recv_data) } // Called when opening guild bank tab only (first one) -void WorldSession::HandleGuildBankQueryTab(WorldPacket & recv_data) +void WorldSession::HandleGuildBankQueryTab(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (CMSG_GUILD_BANK_QUERY_TAB)"); uint64 GoGuid; - recv_data >> GoGuid; + recvData >> GoGuid; uint8 tabId; - recv_data >> tabId; + recvData >> tabId; uint8 fullSlotList; - recv_data >> fullSlotList; // 0 = only slots updated in last operation are shown. 1 = all slots updated + recvData >> fullSlotList; // 0 = only slots updated in last operation are shown. 1 = all slots updated if (GetPlayer()->GetGameObjectIfCanInteractWith(GoGuid, GAMEOBJECT_TYPE_GUILD_BANK)) if (Guild* guild = _GetPlayerGuild(this)) guild->SendBankTabData(this, tabId); } -void WorldSession::HandleGuildBankDepositMoney(WorldPacket & recv_data) +void WorldSession::HandleGuildBankDepositMoney(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (CMSG_GUILD_BANK_DEPOSIT_MONEY)"); uint64 goGuid; - recv_data >> goGuid; + recvData >> goGuid; uint64 money; - recv_data >> money; + recvData >> money; if (GetPlayer()->GetGameObjectIfCanInteractWith(goGuid, GAMEOBJECT_TYPE_GUILD_BANK)) if (money && GetPlayer()->HasEnoughMoney(money)) @@ -499,15 +499,15 @@ void WorldSession::HandleGuildBankDepositMoney(WorldPacket & recv_data) guild->HandleMemberDepositMoney(this, money); } -void WorldSession::HandleGuildBankWithdrawMoney(WorldPacket & recv_data) +void WorldSession::HandleGuildBankWithdrawMoney(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (CMSG_GUILD_BANK_WITHDRAW_MONEY)"); uint64 GoGuid; - recv_data >> GoGuid; + recvData >> GoGuid; uint32 money; - recv_data >> money; + recvData >> money; if (money) if (GetPlayer()->GetGameObjectIfCanInteractWith(GoGuid, GAMEOBJECT_TYPE_GUILD_BANK)) @@ -515,28 +515,28 @@ void WorldSession::HandleGuildBankWithdrawMoney(WorldPacket & recv_data) guild->HandleMemberWithdrawMoney(this, money); } -void WorldSession::HandleGuildBankSwapItems(WorldPacket & recv_data) +void WorldSession::HandleGuildBankSwapItems(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (CMSG_GUILD_BANK_SWAP_ITEMS)"); uint64 GoGuid; - recv_data >> GoGuid; + recvData >> GoGuid; if (!GetPlayer()->GetGameObjectIfCanInteractWith(GoGuid, GAMEOBJECT_TYPE_GUILD_BANK)) { - recv_data.rfinish(); // Prevent additional spam at rejected packet + recvData.rfinish(); // Prevent additional spam at rejected packet return; } Guild* guild = _GetPlayerGuild(this); if (!guild) { - recv_data.rfinish(); // Prevent additional spam at rejected packet + recvData.rfinish(); // Prevent additional spam at rejected packet return; } uint8 bankToBank; - recv_data >> bankToBank; + recvData >> bankToBank; uint8 tabId; uint8 slotId; @@ -546,19 +546,19 @@ void WorldSession::HandleGuildBankSwapItems(WorldPacket & recv_data) if (bankToBank) { uint8 destTabId; - recv_data >> destTabId; + recvData >> destTabId; uint8 destSlotId; - recv_data >> destSlotId; + recvData >> destSlotId; uint32 destItemEntry; - recv_data >> destItemEntry; + recvData >> destItemEntry; - recv_data >> tabId; - recv_data >> slotId; - recv_data >> itemEntry; - recv_data.read_skip(); // Always 0 - recv_data >> splitedAmount; + recvData >> tabId; + recvData >> slotId; + recvData >> itemEntry; + recvData.read_skip(); // Always 0 + recvData >> splitedAmount; guild->SwapItems(GetPlayer(), tabId, slotId, destTabId, destSlotId, splitedAmount); } @@ -568,24 +568,24 @@ void WorldSession::HandleGuildBankSwapItems(WorldPacket & recv_data) uint8 playerSlotId = NULL_SLOT; uint8 toChar = 1; - recv_data >> tabId; - recv_data >> slotId; - recv_data >> itemEntry; + recvData >> tabId; + recvData >> slotId; + recvData >> itemEntry; uint8 autoStore; - recv_data >> autoStore; + recvData >> autoStore; if (autoStore) { - recv_data.read_skip(); // autoStoreCount - recv_data.read_skip(); // ToChar (?), always and expected to be 1 (autostore only triggered in Bank -> Char) - recv_data.read_skip(); // Always 0 + recvData.read_skip(); // autoStoreCount + recvData.read_skip(); // ToChar (?), always and expected to be 1 (autostore only triggered in Bank -> Char) + recvData.read_skip(); // Always 0 } else { - recv_data >> playerBag; - recv_data >> playerSlotId; - recv_data >> toChar; - recv_data >> splitedAmount; + recvData >> playerBag; + recvData >> playerSlotId; + recvData >> toChar; + recvData >> splitedAmount; } // Player <-> Bank @@ -597,36 +597,36 @@ void WorldSession::HandleGuildBankSwapItems(WorldPacket & recv_data) } } -void WorldSession::HandleGuildBankBuyTab(WorldPacket & recv_data) +void WorldSession::HandleGuildBankBuyTab(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (CMSG_GUILD_BANK_BUY_TAB)"); uint64 GoGuid; - recv_data >> GoGuid; + recvData >> GoGuid; uint8 tabId; - recv_data >> tabId; + recvData >> tabId; if (!GoGuid || GetPlayer()->GetGameObjectIfCanInteractWith(GoGuid, GAMEOBJECT_TYPE_GUILD_BANK)) if (Guild* guild = _GetPlayerGuild(this)) guild->HandleBuyBankTab(this, tabId); } -void WorldSession::HandleGuildBankUpdateTab(WorldPacket & recv_data) +void WorldSession::HandleGuildBankUpdateTab(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (CMSG_GUILD_BANK_UPDATE_TAB)"); uint64 GoGuid; - recv_data >> GoGuid; + recvData >> GoGuid; uint8 tabId; - recv_data >> tabId; + recvData >> tabId; std::string name; - recv_data >> name; + recvData >> name; std::string icon; - recv_data >> icon; + recvData >> icon; if (!name.empty() && !icon.empty()) if (GetPlayer()->GetGameObjectIfCanInteractWith(GoGuid, GAMEOBJECT_TYPE_GUILD_BANK)) @@ -634,37 +634,37 @@ void WorldSession::HandleGuildBankUpdateTab(WorldPacket & recv_data) guild->HandleSetBankTabInfo(this, tabId, name, icon); } -void WorldSession::HandleGuildBankLogQuery(WorldPacket & recv_data) +void WorldSession::HandleGuildBankLogQuery(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (MSG_GUILD_BANK_LOG_QUERY)"); uint8 tabId; - recv_data >> tabId; + recvData >> tabId; if (Guild* guild = _GetPlayerGuild(this)) guild->SendBankLog(this, tabId); } -void WorldSession::HandleQueryGuildBankTabText(WorldPacket &recv_data) +void WorldSession::HandleQueryGuildBankTabText(WorldPacket &recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_QUERY_GUILD_BANK_TEXT"); uint8 tabId; - recv_data >> tabId; + recvData >> tabId; if (Guild* guild = _GetPlayerGuild(this)) guild->SendBankTabText(this, tabId); } -void WorldSession::HandleSetGuildBankTabText(WorldPacket& recv_data) +void WorldSession::HandleSetGuildBankTabText(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_SET_GUILD_BANK_TEXT"); uint8 tabId; - recv_data >> tabId; + recvData >> tabId; std::string text; - recv_data >> text; + recvData >> text; if (Guild* guild = _GetPlayerGuild(this)) guild->SetBankTabText(tabId, text); diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index b17cff78d7d..31720266ff0 100755 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -29,13 +29,13 @@ #include "SpellInfo.h" #include -void WorldSession::HandleSplitItemOpcode(WorldPacket & recv_data) +void WorldSession::HandleSplitItemOpcode(WorldPacket & recvData) { //sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_SPLIT_ITEM"); uint8 srcbag, srcslot, dstbag, dstslot; uint32 count; - recv_data >> srcbag >> srcslot >> dstbag >> dstslot >> count; + recvData >> srcbag >> srcslot >> dstbag >> dstslot >> count; //sLog->outDebug("STORAGE: receive srcbag = %u, srcslot = %u, dstbag = %u, dstslot = %u, count = %u", srcbag, srcslot, dstbag, dstslot, count); uint16 src = ((srcbag << 8) | srcslot); @@ -62,12 +62,12 @@ void WorldSession::HandleSplitItemOpcode(WorldPacket & recv_data) _player->SplitItem(src, dst, count); } -void WorldSession::HandleSwapInvItemOpcode(WorldPacket & recv_data) +void WorldSession::HandleSwapInvItemOpcode(WorldPacket & recvData) { //sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_SWAP_INV_ITEM"); uint8 srcslot, dstslot; - recv_data >> dstslot >> srcslot; + recvData >> dstslot >> srcslot; //sLog->outDebug("STORAGE: receive srcslot = %u, dstslot = %u", srcslot, dstslot); // prevent attempt swap same item to current position generated by client at special checting sequence @@ -92,11 +92,11 @@ void WorldSession::HandleSwapInvItemOpcode(WorldPacket & recv_data) _player->SwapItem(src, dst); } -void WorldSession::HandleAutoEquipItemSlotOpcode(WorldPacket& recv_data) +void WorldSession::HandleAutoEquipItemSlotOpcode(WorldPacket& recvData) { uint64 itemguid; uint8 dstslot; - recv_data >> itemguid >> dstslot; + recvData >> itemguid >> dstslot; // cheating attempt, client should never send opcode in that case if (!Player::IsEquipmentPos(INVENTORY_SLOT_BAG_0, dstslot)) @@ -111,12 +111,12 @@ void WorldSession::HandleAutoEquipItemSlotOpcode(WorldPacket& recv_data) _player->SwapItem(item->GetPos(), dstpos); } -void WorldSession::HandleSwapItem(WorldPacket & recv_data) +void WorldSession::HandleSwapItem(WorldPacket & recvData) { //sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_SWAP_ITEM"); uint8 dstbag, dstslot, srcbag, srcslot; - recv_data >> dstbag >> dstslot >> srcbag >> srcslot; + recvData >> dstbag >> dstslot >> srcbag >> srcslot; //sLog->outDebug("STORAGE: receive srcbag = %u, srcslot = %u, dstbag = %u, dstslot = %u", srcbag, srcslot, dstbag, dstslot); uint16 src = ((srcbag << 8) | srcslot); @@ -141,12 +141,12 @@ void WorldSession::HandleSwapItem(WorldPacket & recv_data) _player->SwapItem(src, dst); } -void WorldSession::HandleAutoEquipItemOpcode(WorldPacket & recv_data) +void WorldSession::HandleAutoEquipItemOpcode(WorldPacket & recvData) { //sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_AUTOEQUIP_ITEM"); uint8 srcbag, srcslot; - recv_data >> srcbag >> srcslot; + recvData >> srcbag >> srcslot; //sLog->outDebug("STORAGE: receive srcbag = %u, srcslot = %u", srcbag, srcslot); Item* pSrcItem = _player->GetItemByPos(srcbag, srcslot); @@ -235,12 +235,12 @@ void WorldSession::HandleAutoEquipItemOpcode(WorldPacket & recv_data) } } -void WorldSession::HandleDestroyItemOpcode(WorldPacket & recv_data) +void WorldSession::HandleDestroyItemOpcode(WorldPacket & recvData) { //sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_DESTROY_ITEM"); uint8 bag, slot, count, data1, data2, data3; - recv_data >> bag >> slot >> count >> data1 >> data2 >> data3; + recvData >> bag >> slot >> count >> data1 >> data2 >> data3; //sLog->outDebug("STORAGE: receive bag = %u, slot = %u, count = %u", bag, slot, count); uint16 pos = (bag << 8) | slot; @@ -473,26 +473,26 @@ void WorldSession::HandleReadItem(WorldPacket& recvData) _player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL); } -void WorldSession::HandlePageQuerySkippedOpcode(WorldPacket & recv_data) +void WorldSession::HandlePageQuerySkippedOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_PAGE_TEXT_QUERY"); uint32 itemid; uint64 guid; - recv_data >> itemid >> guid; + recvData >> itemid >> guid; sLog->outDetail("Packet Info: itemid: %u guidlow: %u guidentry: %u guidhigh: %u", itemid, GUID_LOPART(guid), GUID_ENPART(guid), GUID_HIPART(guid)); } -void WorldSession::HandleSellItemOpcode(WorldPacket & recv_data) +void WorldSession::HandleSellItemOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_SELL_ITEM"); uint64 vendorguid, itemguid; uint32 count; - recv_data >> vendorguid >> itemguid >> count; + recvData >> vendorguid >> itemguid >> count; if (!itemguid) return; @@ -648,14 +648,14 @@ void WorldSession::HandleBuybackItem(WorldPacket& recvData) _player->SendBuyError(BUY_ERR_CANT_FIND_ITEM, creature, 0, 0); } -void WorldSession::HandleBuyItemInSlotOpcode(WorldPacket & recv_data) +void WorldSession::HandleBuyItemInSlotOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_BUY_ITEM_IN_SLOT"); uint64 vendorguid, bagguid; uint32 item, slot, count; uint8 bagslot; - recv_data >> vendorguid >> item >> slot >> bagguid >> bagslot >> count; + recvData >> vendorguid >> item >> slot >> bagguid >> bagslot >> count; // client expects count starting at 1, and we send vendorslot+1 to client already if (slot > 0) @@ -681,7 +681,7 @@ void WorldSession::HandleBuyItemInSlotOpcode(WorldPacket & recv_data) GetPlayer()->BuyItemFromVendorSlot(vendorguid, slot, item, count, bag, bagslot); } -void WorldSession::HandleBuyItemOpcode(WorldPacket& recv_data) +void WorldSession::HandleBuyItemOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_BUY_ITEM"); uint64 vendorguid, bagGuid; @@ -689,7 +689,7 @@ void WorldSession::HandleBuyItemOpcode(WorldPacket& recv_data) uint8 itemType; // 1 = item, 2 = currency (not implemented) uint8 bagSlot; - recv_data >> vendorguid >> itemType >> item >> slot >> count >> bagGuid >> bagSlot; + recvData >> vendorguid >> itemType >> item >> slot >> count >> bagGuid >> bagSlot; // client expects count starting at 1, and we send vendorslot+1 to client already if (slot > 0) @@ -706,11 +706,11 @@ void WorldSession::HandleBuyItemOpcode(WorldPacket& recv_data) GetPlayer()->BuyItemFromVendorSlot(vendorguid, slot, item, count, bag, bagSlot); } -void WorldSession::HandleListInventoryOpcode(WorldPacket & recv_data) +void WorldSession::HandleListInventoryOpcode(WorldPacket & recvData) { uint64 guid; - recv_data >> guid; + recvData >> guid; if (!GetPlayer()->isAlive()) return; @@ -843,12 +843,12 @@ void WorldSession::SendListInventory(uint64 vendorGuid) SendPacket(&data); } -void WorldSession::HandleAutoStoreBagItemOpcode(WorldPacket& recv_data) +void WorldSession::HandleAutoStoreBagItemOpcode(WorldPacket& recvData) { //sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_AUTOSTORE_BAG_ITEM"); uint8 srcbag, srcslot, dstbag; - recv_data >> srcbag >> srcslot >> dstbag; + recvData >> srcbag >> srcslot >> dstbag; //sLog->outDebug("STORAGE: receive srcbag = %u, srcslot = %u, dstbag = %u", srcbag, srcslot, dstbag); Item* pItem = _player->GetItemByPos(srcbag, srcslot); @@ -1041,14 +1041,14 @@ void WorldSession::SendItemEnchantTimeUpdate(uint64 Playerguid, uint64 Itemguid, SendPacket(&data); } -void WorldSession::HandleWrapItemOpcode(WorldPacket& recv_data) +void WorldSession::HandleWrapItemOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_WRAP_ITEM"); uint8 gift_bag, gift_slot, item_bag, item_slot; - recv_data >> gift_bag >> gift_slot; // paper - recv_data >> item_bag >> item_slot; // item + recvData >> gift_bag >> gift_slot; // paper + recvData >> item_bag >> item_slot; // item sLog->outDebug(LOG_FILTER_NETWORKIO, "WRAP: receive gift_bag = %u, gift_slot = %u, item_bag = %u, item_slot = %u", gift_bag, gift_slot, item_bag, item_slot); @@ -1152,19 +1152,19 @@ void WorldSession::HandleWrapItemOpcode(WorldPacket& recv_data) _player->DestroyItemCount(gift, count, true); } -void WorldSession::HandleSocketOpcode(WorldPacket& recv_data) +void WorldSession::HandleSocketOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_SOCKET_GEMS"); uint64 item_guid; uint64 gem_guids[MAX_GEM_SOCKETS]; - recv_data >> item_guid; + recvData >> item_guid; if (!item_guid) return; for (int i = 0; i < MAX_GEM_SOCKETS; ++i) - recv_data >> gem_guids[i]; + recvData >> gem_guids[i]; //cheat -> tried to socket same gem multiple times if ((gem_guids[0] && (gem_guids[0] == gem_guids[1] || gem_guids[0] == gem_guids[2])) || @@ -1216,6 +1216,14 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data) // tried to put meta gem in normal socket if (itemProto->Socket[i].Color != SOCKET_COLOR_META && GemProps[i]->color == SOCKET_COLOR_META) return; + + // tried to put normal gem in cogwheel socket + if (itemProto->Socket[i].Color == SOCKET_COLOR_COGWHEEL && GemProps[i]->color != SOCKET_COLOR_COGWHEEL) + return; + + // tried to put cogwheel gem in normal socket + if (itemProto->Socket[i].Color != SOCKET_COLOR_COGWHEEL && GemProps[i]->color == SOCKET_COLOR_COGWHEEL) + return; } uint32 GemEnchants[MAX_GEM_SOCKETS]; @@ -1346,13 +1354,13 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data) itemTarget->ClearSoulboundTradeable(_player); // clear tradeable flag } -void WorldSession::HandleCancelTempEnchantmentOpcode(WorldPacket& recv_data) +void WorldSession::HandleCancelTempEnchantmentOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CANCEL_TEMP_ENCHANTMENT"); uint32 slot; - recv_data >> slot; + recvData >> slot; // apply only to equipped item if (!Player::IsEquipmentPos(INVENTORY_SLOT_BAG_0, slot)) @@ -1370,12 +1378,12 @@ void WorldSession::HandleCancelTempEnchantmentOpcode(WorldPacket& recv_data) item->ClearEnchantment(TEMP_ENCHANTMENT_SLOT); } -void WorldSession::HandleItemRefundInfoRequest(WorldPacket& recv_data) +void WorldSession::HandleItemRefundInfoRequest(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_ITEM_REFUND_INFO"); uint64 guid; - recv_data >> guid; // item guid + recvData >> guid; // item guid Item* item = _player->GetItemByGuid(guid); if (!item) @@ -1387,11 +1395,11 @@ void WorldSession::HandleItemRefundInfoRequest(WorldPacket& recv_data) GetPlayer()->SendRefundInfo(item); } -void WorldSession::HandleItemRefund(WorldPacket &recv_data) +void WorldSession::HandleItemRefund(WorldPacket &recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_ITEM_REFUND"); uint64 guid; - recv_data >> guid; // item guid + recvData >> guid; // item guid Item* item = _player->GetItemByGuid(guid); if (!item) @@ -1408,10 +1416,10 @@ void WorldSession::HandleItemRefund(WorldPacket &recv_data) * * This function is called when player clicks on item which has some flag set */ -void WorldSession::HandleItemTextQuery(WorldPacket & recv_data ) +void WorldSession::HandleItemTextQuery(WorldPacket & recvData ) { uint64 itemGuid; - recv_data >> itemGuid; + recvData >> itemGuid; sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ITEM_TEXT_QUERY item guid: %u", GUID_LOPART(itemGuid)); diff --git a/src/server/game/Handlers/LFGHandler.cpp b/src/server/game/Handlers/LFGHandler.cpp index 9c66ca44383..b4f74735568 100755 --- a/src/server/game/Handlers/LFGHandler.cpp +++ b/src/server/game/Handlers/LFGHandler.cpp @@ -47,13 +47,13 @@ void BuildPartyLockDungeonBlock(WorldPacket& data, const LfgLockPartyMap& lockMa } } -void WorldSession::HandleLfgJoinOpcode(WorldPacket& recv_data) +void WorldSession::HandleLfgJoinOpcode(WorldPacket& recvData) { if (!sWorld->getBoolConfig(CONFIG_DUNGEON_FINDER_ENABLE) || (GetPlayer()->GetGroup() && GetPlayer()->GetGroup()->GetLeaderGUID() != GetPlayer()->GetGUID() && (GetPlayer()->GetGroup()->GetMembersCount() == MAXGROUPSIZE || !GetPlayer()->GetGroup()->isLFGGroup()))) { - recv_data.rfinish(); + recvData.rfinish(); return; } @@ -61,32 +61,32 @@ void WorldSession::HandleLfgJoinOpcode(WorldPacket& recv_data) uint32 dungeon; uint32 roles; - recv_data >> roles; - recv_data.read_skip(); // uint8 (always 0) - uint8 (always 0) - recv_data >> numDungeons; + recvData >> roles; + recvData.read_skip(); // uint8 (always 0) - uint8 (always 0) + recvData >> numDungeons; if (!numDungeons) { sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_JOIN [" UI64FMTD "] no dungeons selected", GetPlayer()->GetGUID()); - recv_data.rfinish(); + recvData.rfinish(); return; } LfgDungeonSet newDungeons; for (int8 i = 0; i < numDungeons; ++i) { - recv_data >> dungeon; + recvData >> dungeon; newDungeons.insert((dungeon & 0x00FFFFFF)); // remove the type from the dungeon entry } - recv_data.read_skip(); // for 0..uint8 (always 3) { uint8 (always 0) } + recvData.read_skip(); // for 0..uint8 (always 3) { uint8 (always 0) } std::string comment; - recv_data >> comment; + recvData >> comment; sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_JOIN [" UI64FMTD "] roles: %u, Dungeons: %u, Comment: %s", GetPlayer()->GetGUID(), roles, uint8(newDungeons.size()), comment.c_str()); sLFGMgr->Join(GetPlayer(), uint8(roles), newDungeons, comment); } -void WorldSession::HandleLfgLeaveOpcode(WorldPacket& /*recv_data*/) +void WorldSession::HandleLfgLeaveOpcode(WorldPacket& /*recvData*/) { Group* grp = GetPlayer()->GetGroup(); @@ -97,21 +97,21 @@ void WorldSession::HandleLfgLeaveOpcode(WorldPacket& /*recv_data*/) sLFGMgr->Leave(GetPlayer(), grp); } -void WorldSession::HandleLfgProposalResultOpcode(WorldPacket& recv_data) +void WorldSession::HandleLfgProposalResultOpcode(WorldPacket& recvData) { uint32 lfgGroupID; // Internal lfgGroupID bool accept; // Accept to join? - recv_data >> lfgGroupID; - recv_data >> accept; + recvData >> lfgGroupID; + recvData >> accept; sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_PROPOSAL_RESULT [" UI64FMTD "] proposal: %u accept: %u", GetPlayer()->GetGUID(), lfgGroupID, accept ? 1 : 0); sLFGMgr->UpdateProposal(lfgGroupID, GetPlayer()->GetGUID(), accept); } -void WorldSession::HandleLfgSetRolesOpcode(WorldPacket& recv_data) +void WorldSession::HandleLfgSetRolesOpcode(WorldPacket& recvData) { uint8 roles; - recv_data >> roles; // Player Group Roles + recvData >> roles; // Player Group Roles uint64 guid = GetPlayer()->GetGUID(); Group* grp = GetPlayer()->GetGroup(); if (!grp) @@ -124,35 +124,35 @@ void WorldSession::HandleLfgSetRolesOpcode(WorldPacket& recv_data) sLFGMgr->UpdateRoleCheck(gguid, guid, roles); } -void WorldSession::HandleLfgSetCommentOpcode(WorldPacket& recv_data) +void WorldSession::HandleLfgSetCommentOpcode(WorldPacket& recvData) { std::string comment; - recv_data >> comment; + recvData >> comment; uint64 guid = GetPlayer()->GetGUID(); sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_SET_LFG_COMMENT [" UI64FMTD "] comment: %s", guid, comment.c_str()); sLFGMgr->SetComment(guid, comment); } -void WorldSession::HandleLfgSetBootVoteOpcode(WorldPacket& recv_data) +void WorldSession::HandleLfgSetBootVoteOpcode(WorldPacket& recvData) { bool agree; // Agree to kick player - recv_data >> agree; + recvData >> agree; sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_SET_BOOT_VOTE [" UI64FMTD "] agree: %u", GetPlayer()->GetGUID(), agree ? 1 : 0); sLFGMgr->UpdateBoot(GetPlayer(), agree); } -void WorldSession::HandleLfgTeleportOpcode(WorldPacket& recv_data) +void WorldSession::HandleLfgTeleportOpcode(WorldPacket& recvData) { bool out; - recv_data >> out; + recvData >> out; sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_TELEPORT [" UI64FMTD "] out: %u", GetPlayer()->GetGUID(), out ? 1 : 0); sLFGMgr->TeleportPlayer(GetPlayer(), out, true); } -void WorldSession::HandleLfgPlayerLockInfoRequestOpcode(WorldPacket& /*recv_data*/) +void WorldSession::HandleLfgPlayerLockInfoRequestOpcode(WorldPacket& /*recvData*/) { uint64 guid = GetPlayer()->GetGUID(); sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFD_PLAYER_LOCK_INFO_REQUEST [" UI64FMTD "]", guid); @@ -233,7 +233,7 @@ void WorldSession::HandleLfgPlayerLockInfoRequestOpcode(WorldPacket& /*recv_data SendPacket(&data); } -void WorldSession::HandleLfgPartyLockInfoRequestOpcode(WorldPacket& /*recv_data*/) +void WorldSession::HandleLfgPartyLockInfoRequestOpcode(WorldPacket& /*recvData*/) { uint64 guid = GetPlayer()->GetGUID(); sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFD_PARTY_LOCK_INFO_REQUEST [" UI64FMTD "]", guid); @@ -267,18 +267,18 @@ void WorldSession::HandleLfgPartyLockInfoRequestOpcode(WorldPacket& /*recv_data SendPacket(&data); } -void WorldSession::HandleLfrSearchOpcode(WorldPacket& recv_data) +void WorldSession::HandleLfrSearchOpcode(WorldPacket& recvData) { uint32 entry; // Raid id to search - recv_data >> entry; + recvData >> entry; sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_SEARCH_LFG_JOIN [" UI64FMTD "] dungeon entry: %u", GetPlayer()->GetGUID(), entry); //SendLfrUpdateListOpcode(entry); } -void WorldSession::HandleLfrLeaveOpcode(WorldPacket& recv_data) +void WorldSession::HandleLfrLeaveOpcode(WorldPacket& recvData) { uint32 dungeonId; // Raid id queue to leave - recv_data >> dungeonId; + recvData >> dungeonId; sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_SEARCH_LFG_LEAVE [" UI64FMTD "] dungeonId: %u", GetPlayer()->GetGUID(), dungeonId); //sLFGMgr->LeaveLfr(GetPlayer(), dungeonId); } diff --git a/src/server/game/Handlers/LootHandler.cpp b/src/server/game/Handlers/LootHandler.cpp index 73c8457eb66..cb06ae4d8be 100755 --- a/src/server/game/Handlers/LootHandler.cpp +++ b/src/server/game/Handlers/LootHandler.cpp @@ -30,7 +30,7 @@ #include "World.h" #include "Util.h" -void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket & recv_data) +void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AUTOSTORE_LOOT_ITEM"); Player* player = GetPlayer(); @@ -38,7 +38,7 @@ void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket & recv_data) Loot* loot = NULL; uint8 lootSlot = 0; - recv_data >> lootSlot; + recvData >> lootSlot; if (IS_GAMEOBJECT_GUID(lguid)) { @@ -94,7 +94,7 @@ void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket & recv_data) player->StoreLootItem(lootSlot, loot); } -void WorldSession::HandleLootMoneyOpcode(WorldPacket & /*recv_data*/) +void WorldSession::HandleLootMoneyOpcode(WorldPacket & /*recvData*/) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_LOOT_MONEY"); @@ -202,12 +202,12 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket & /*recv_data*/) } } -void WorldSession::HandleLootOpcode(WorldPacket & recv_data) +void WorldSession::HandleLootOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_LOOT"); uint64 guid; - recv_data >> guid; + recvData >> guid; // Check possible cheat if (!_player->isAlive()) @@ -428,12 +428,12 @@ void WorldSession::DoLootRelease(uint64 lguid) loot->RemoveLooter(player->GetGUID()); } -void WorldSession::HandleLootMasterGiveOpcode(WorldPacket & recv_data) +void WorldSession::HandleLootMasterGiveOpcode(WorldPacket & recvData) { uint8 slotid; uint64 lootguid, target_playerguid; - recv_data >> lootguid >> slotid >> target_playerguid; + recvData >> lootguid >> slotid >> target_playerguid; if (!_player->GetGroup() || _player->GetGroup()->GetLooterGuid() != _player->GetGUID()) { diff --git a/src/server/game/Handlers/MailHandler.cpp b/src/server/game/Handlers/MailHandler.cpp index ba6646a92f9..4cd8621e68e 100755 --- a/src/server/game/Handlers/MailHandler.cpp +++ b/src/server/game/Handlers/MailHandler.cpp @@ -29,29 +29,29 @@ #include "Item.h" #include "AccountMgr.h" -void WorldSession::HandleSendMail(WorldPacket & recv_data) +void WorldSession::HandleSendMail(WorldPacket & recvData) { uint64 mailbox, unk3; std::string receiver, subject, body; uint32 unk1, unk2, money, COD; uint8 unk4; - recv_data >> mailbox; - recv_data >> receiver; + recvData >> mailbox; + recvData >> receiver; - recv_data >> subject; + recvData >> subject; - recv_data >> body; + recvData >> body; - recv_data >> unk1; // stationery? - recv_data >> unk2; // 0x00000000 + recvData >> unk1; // stationery? + recvData >> unk2; // 0x00000000 uint8 items_count; - recv_data >> items_count; // attached items count + recvData >> items_count; // attached items count if (items_count > MAX_MAIL_ITEMS) // client limit { GetPlayer()->SendMailResult(0, MAIL_SEND, MAIL_ERR_TOO_MANY_ATTACHMENTS); - recv_data.rfinish(); // set to end to avoid warnings spam + recvData.rfinish(); // set to end to avoid warnings spam return; } @@ -59,13 +59,13 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data) for (uint8 i = 0; i < items_count; ++i) { - recv_data.read_skip(); // item slot in mail, not used - recv_data >> itemGUIDs[i]; + recvData.read_skip(); // item slot in mail, not used + recvData >> itemGUIDs[i]; } - recv_data >> money >> COD; // money and cod - recv_data >> unk3; // const 0 - recv_data >> unk4; // const 0 + recvData >> money >> COD; // money and cod + recvData >> unk3; // const 0 + recvData >> unk4; // const 0 // packet read complete, now do check @@ -302,12 +302,12 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data) } //called when mail is read -void WorldSession::HandleMailMarkAsRead(WorldPacket & recv_data) +void WorldSession::HandleMailMarkAsRead(WorldPacket & recvData) { uint64 mailbox; uint32 mailId; - recv_data >> mailbox; - recv_data >> mailId; + recvData >> mailbox; + recvData >> mailId; if (!GetPlayer()->GetGameObjectIfCanInteractWith(mailbox, GAMEOBJECT_TYPE_MAILBOX)) return; @@ -325,13 +325,13 @@ void WorldSession::HandleMailMarkAsRead(WorldPacket & recv_data) } //called when client deletes mail -void WorldSession::HandleMailDelete(WorldPacket & recv_data) +void WorldSession::HandleMailDelete(WorldPacket & recvData) { uint64 mailbox; uint32 mailId; - recv_data >> mailbox; - recv_data >> mailId; - recv_data.read_skip(); // mailTemplateId + recvData >> mailbox; + recvData >> mailId; + recvData.read_skip(); // mailTemplateId if (!GetPlayer()->GetGameObjectIfCanInteractWith(mailbox, GAMEOBJECT_TYPE_MAILBOX)) return; @@ -353,13 +353,13 @@ void WorldSession::HandleMailDelete(WorldPacket & recv_data) player->SendMailResult(mailId, MAIL_DELETED, MAIL_OK); } -void WorldSession::HandleMailReturnToSender(WorldPacket & recv_data) +void WorldSession::HandleMailReturnToSender(WorldPacket & recvData) { uint64 mailbox; uint32 mailId; - recv_data >> mailbox; - recv_data >> mailId; - recv_data.read_skip(); // original sender GUID for return to, not used + recvData >> mailbox; + recvData >> mailId; + recvData.read_skip(); // original sender GUID for return to, not used if (!GetPlayer()->GetGameObjectIfCanInteractWith(mailbox, GAMEOBJECT_TYPE_MAILBOX)) return; @@ -417,14 +417,14 @@ void WorldSession::HandleMailReturnToSender(WorldPacket & recv_data) } //called when player takes item attached in mail -void WorldSession::HandleMailTakeItem(WorldPacket & recv_data) +void WorldSession::HandleMailTakeItem(WorldPacket & recvData) { uint64 mailbox; uint32 mailId; uint32 itemId; - recv_data >> mailbox; - recv_data >> mailId; - recv_data >> itemId; // item guid low + recvData >> mailbox; + recvData >> mailId; + recvData >> itemId; // item guid low if (!GetPlayer()->GetGameObjectIfCanInteractWith(mailbox, GAMEOBJECT_TYPE_MAILBOX)) return; @@ -512,15 +512,15 @@ void WorldSession::HandleMailTakeItem(WorldPacket & recv_data) player->SendMailResult(mailId, MAIL_ITEM_TAKEN, MAIL_ERR_EQUIP_ERROR, msg); } -void WorldSession::HandleMailTakeMoney(WorldPacket& recv_data) +void WorldSession::HandleMailTakeMoney(WorldPacket& recvData) { uint64 mailbox; uint64 money; uint32 mailId; - recv_data >> mailbox; - recv_data >> mailId; - recv_data >> money; + recvData >> mailbox; + recvData >> mailId; + recvData >> money; if (!GetPlayer()->GetGameObjectIfCanInteractWith(mailbox, GAMEOBJECT_TYPE_MAILBOX)) return; @@ -550,10 +550,10 @@ void WorldSession::HandleMailTakeMoney(WorldPacket& recv_data) } //called when player lists his received mails -void WorldSession::HandleGetMailList(WorldPacket & recv_data) +void WorldSession::HandleGetMailList(WorldPacket & recvData) { uint64 mailbox; - recv_data >> mailbox; + recvData >> mailbox; if (!GetPlayer()->GetGameObjectIfCanInteractWith(mailbox, GAMEOBJECT_TYPE_MAILBOX)) return; @@ -672,13 +672,13 @@ void WorldSession::HandleGetMailList(WorldPacket & recv_data) } //used when player copies mail body to his inventory -void WorldSession::HandleMailCreateTextItem(WorldPacket & recv_data) +void WorldSession::HandleMailCreateTextItem(WorldPacket & recvData) { uint64 mailbox; uint32 mailId; - recv_data >> mailbox; - recv_data >> mailId; + recvData >> mailbox; + recvData >> mailId; if (!GetPlayer()->GetGameObjectIfCanInteractWith(mailbox, GAMEOBJECT_TYPE_MAILBOX)) return; @@ -738,7 +738,7 @@ void WorldSession::HandleMailCreateTextItem(WorldPacket & recv_data) } //TODO Fix me! ... this void has probably bad condition, but good data are sent -void WorldSession::HandleQueryNextMailTime(WorldPacket & /*recv_data*/) +void WorldSession::HandleQueryNextMailTime(WorldPacket & /*recvData*/) { WorldPacket data(MSG_QUERY_NEXT_MAIL_TIME, 8); diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 97b6a9ed942..e10a5bedc74 100755 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -82,7 +82,7 @@ void WorldSession::HandleRepopRequestOpcode(WorldPacket& recvData) GetPlayer()->RepopAtGraveyard(); } -void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data) +void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_GOSSIP_SELECT_OPTION"); @@ -91,10 +91,10 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data) uint64 guid; std::string code = ""; - recv_data >> guid >> menuId >> gossipListId; + recvData >> guid >> menuId >> gossipListId; if (_player->PlayerTalkClass->IsGossipOptionCoded(gossipListId)) - recv_data >> code; + recvData >> code; Creature* unit = NULL; GameObject* go = NULL; @@ -167,7 +167,7 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data) } } -void WorldSession::HandleWhoOpcode(WorldPacket & recv_data) +void WorldSession::HandleWhoOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_WHO Message"); @@ -182,15 +182,15 @@ void WorldSession::HandleWhoOpcode(WorldPacket & recv_data) uint32 zoneids[10]; // 10 is client limit std::string player_name, guild_name; - recv_data >> level_min; // maximal player level, default 0 - recv_data >> level_max; // minimal player level, default 100 (MAX_LEVEL) - recv_data >> player_name; // player name, case sensitive... + recvData >> level_min; // maximal player level, default 0 + recvData >> level_max; // minimal player level, default 100 (MAX_LEVEL) + recvData >> player_name; // player name, case sensitive... - recv_data >> guild_name; // guild name, case sensitive... + recvData >> guild_name; // guild name, case sensitive... - recv_data >> racemask; // race mask - recv_data >> classmask; // class mask - recv_data >> zones_count; // zones count, client limit = 10 (2.0.10) + recvData >> racemask; // race mask + recvData >> classmask; // class mask + recvData >> zones_count; // zones count, client limit = 10 (2.0.10) if (zones_count > 10) return; // can't be received from real client or broken packet @@ -198,12 +198,12 @@ void WorldSession::HandleWhoOpcode(WorldPacket & recv_data) for (uint32 i = 0; i < zones_count; ++i) { uint32 temp; - recv_data >> temp; // zone id, 0 if zone is unknown... + recvData >> temp; // zone id, 0 if zone is unknown... zoneids[i] = temp; sLog->outDebug(LOG_FILTER_NETWORKIO, "Zone %u: %u", i, zoneids[i]); } - recv_data >> str_count; // user entered strings count, client limit=4 (checked on 2.0.10) + recvData >> str_count; // user entered strings count, client limit=4 (checked on 2.0.10) if (str_count > 4) return; // can't be received from real client or broken packet @@ -214,7 +214,7 @@ void WorldSession::HandleWhoOpcode(WorldPacket & recv_data) for (uint32 i = 0; i < str_count; ++i) { std::string temp; - recv_data >> temp; // user entered string, it used as universal search pattern(guild+player name)? + recvData >> temp; // user entered string, it used as universal search pattern(guild+player name)? if (!Utf8toWStr(temp, str[i])) continue; @@ -364,7 +364,7 @@ void WorldSession::HandleWhoOpcode(WorldPacket & recv_data) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Send SMSG_WHO Message"); } -void WorldSession::HandleLogoutRequestOpcode(WorldPacket & /*recv_data*/) +void WorldSession::HandleLogoutRequestOpcode(WorldPacket & /*recvData*/) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_LOGOUT_REQUEST Message, security - %u", GetSecurity()); @@ -417,12 +417,12 @@ void WorldSession::HandleLogoutRequestOpcode(WorldPacket & /*recv_data*/) LogoutRequest(time(NULL)); } -void WorldSession::HandlePlayerLogoutOpcode(WorldPacket & /*recv_data*/) +void WorldSession::HandlePlayerLogoutOpcode(WorldPacket & /*recvData*/) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_PLAYER_LOGOUT Message"); } -void WorldSession::HandleLogoutCancelOpcode(WorldPacket & /*recv_data*/) +void WorldSession::HandleLogoutCancelOpcode(WorldPacket & /*recvData*/) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_LOGOUT_CANCEL Message"); @@ -451,13 +451,13 @@ void WorldSession::HandleLogoutCancelOpcode(WorldPacket & /*recv_data*/) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_LOGOUT_CANCEL_ACK Message"); } -void WorldSession::HandleTogglePvP(WorldPacket & recv_data) +void WorldSession::HandleTogglePvP(WorldPacket & recvData) { // this opcode can be used in two ways: Either set explicit new status or toggle old status - if (recv_data.size() == 1) + if (recvData.size() == 1) { bool newPvPStatus; - recv_data >> newPvPStatus; + recvData >> newPvPStatus; GetPlayer()->ApplyModFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP, newPvPStatus); GetPlayer()->ApplyModFlag(PLAYER_FLAGS, PLAYER_FLAGS_PVP_TIMER, !newPvPStatus); } @@ -482,10 +482,10 @@ void WorldSession::HandleTogglePvP(WorldPacket & recv_data) // pvp->HandlePlayerActivityChanged(_player); } -void WorldSession::HandleZoneUpdateOpcode(WorldPacket & recv_data) +void WorldSession::HandleZoneUpdateOpcode(WorldPacket & recvData) { uint32 newZone; - recv_data >> newZone; + recvData >> newZone; sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd ZONE_UPDATE: %u", newZone); @@ -503,19 +503,19 @@ void WorldSession::HandleReturnToGraveyard(WorldPacket& /*recvPacket*/) GetPlayer()->RepopAtGraveyard(); } -void WorldSession::HandleSetSelectionOpcode(WorldPacket & recv_data) +void WorldSession::HandleSetSelectionOpcode(WorldPacket & recvData) { uint64 guid; - recv_data >> guid; + recvData >> guid; _player->SetSelection(guid); } -void WorldSession::HandleStandStateChangeOpcode(WorldPacket & recv_data) +void WorldSession::HandleStandStateChangeOpcode(WorldPacket & recvData) { // sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: Received CMSG_STANDSTATECHANGE"); -- too many spam in log at lags/debug stop uint32 animstate; - recv_data >> animstate; + recvData >> animstate; _player->SetStandState(animstate); } @@ -527,16 +527,16 @@ void WorldSession::HandleContactListOpcode(WorldPacket& recvData) _player->GetSocial()->SendSocialList(_player); } -void WorldSession::HandleAddFriendOpcode(WorldPacket & recv_data) +void WorldSession::HandleAddFriendOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ADD_FRIEND"); std::string friendName = GetTrinityString(LANG_FRIEND_IGNORE_UNKNOWN); std::string friendNote; - recv_data >> friendName; + recvData >> friendName; - recv_data >> friendNote; + recvData >> friendNote; if (!normalizePlayerName(friendName)) return; @@ -605,13 +605,13 @@ void WorldSession::HandleAddFriendOpcodeCallBack(PreparedQueryResult result, std sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (SMSG_FRIEND_STATUS)"); } -void WorldSession::HandleDelFriendOpcode(WorldPacket& recv_data) +void WorldSession::HandleDelFriendOpcode(WorldPacket& recvData) { uint64 FriendGUID; sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_DEL_FRIEND"); - recv_data >> FriendGUID; + recvData >> FriendGUID; _player->GetSocial()->RemoveFromSocialList(GUID_LOPART(FriendGUID), false); @@ -620,13 +620,13 @@ void WorldSession::HandleDelFriendOpcode(WorldPacket& recv_data) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent motd (SMSG_FRIEND_STATUS)"); } -void WorldSession::HandleAddIgnoreOpcode(WorldPacket & recv_data) +void WorldSession::HandleAddIgnoreOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ADD_IGNORE"); std::string ignoreName = GetTrinityString(LANG_FRIEND_IGNORE_UNKNOWN); - recv_data >> ignoreName; + recvData >> ignoreName; if (!normalizePlayerName(ignoreName)) return; @@ -678,13 +678,13 @@ void WorldSession::HandleAddIgnoreOpcodeCallBack(PreparedQueryResult result) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (SMSG_FRIEND_STATUS)"); } -void WorldSession::HandleDelIgnoreOpcode(WorldPacket & recv_data) +void WorldSession::HandleDelIgnoreOpcode(WorldPacket & recvData) { uint64 IgnoreGUID; sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_DEL_IGNORE"); - recv_data >> IgnoreGUID; + recvData >> IgnoreGUID; _player->GetSocial()->RemoveFromSocialList(GUID_LOPART(IgnoreGUID), true); @@ -693,23 +693,23 @@ void WorldSession::HandleDelIgnoreOpcode(WorldPacket & recv_data) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent motd (SMSG_FRIEND_STATUS)"); } -void WorldSession::HandleSetContactNotesOpcode(WorldPacket & recv_data) +void WorldSession::HandleSetContactNotesOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_SET_CONTACT_NOTES"); uint64 guid; std::string note; - recv_data >> guid >> note; + recvData >> guid >> note; _player->GetSocial()->SetFriendNote(GUID_LOPART(guid), note); } -void WorldSession::HandleBugOpcode(WorldPacket & recv_data) +void WorldSession::HandleBugOpcode(WorldPacket & recvData) { uint32 suggestion, contentlen, typelen; std::string content, type; - recv_data >> suggestion >> contentlen >> content; + recvData >> suggestion >> contentlen >> content; - recv_data >> typelen >> type; + recvData >> typelen >> type; if (suggestion == 0) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_BUG [Bug Report]"); @@ -764,14 +764,14 @@ void WorldSession::HandleReclaimCorpseOpcode(WorldPacket& recvData) GetPlayer()->SpawnCorpseBones(); } -void WorldSession::HandleResurrectResponseOpcode(WorldPacket & recv_data) +void WorldSession::HandleResurrectResponseOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_RESURRECT_RESPONSE"); uint64 guid; uint8 status; - recv_data >> guid; - recv_data >> status; + recvData >> guid; + recvData >> status; if (GetPlayer()->isAlive()) return; @@ -935,12 +935,12 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recvData) player->TeleportTo(at->target_mapId, at->target_X, at->target_Y, at->target_Z, at->target_Orientation, TELE_TO_NOT_LEAVE_TRANSPORT); } -void WorldSession::HandleUpdateAccountData(WorldPacket &recv_data) +void WorldSession::HandleUpdateAccountData(WorldPacket &recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_UPDATE_ACCOUNT_DATA"); uint32 type, timestamp, decompressedSize; - recv_data >> type >> timestamp >> decompressedSize; + recvData >> type >> timestamp >> decompressedSize; sLog->outDebug(LOG_FILTER_NETWORKIO, "UAD: type %u, time %u, decompressedSize %u", type, timestamp, decompressedSize); @@ -961,7 +961,7 @@ void WorldSession::HandleUpdateAccountData(WorldPacket &recv_data) if (decompressedSize > 0xFFFF) { - recv_data.rfinish(); // unnneded warning spam in this case + recvData.rfinish(); // unnneded warning spam in this case sLog->outError("UAD: Account data packet too big, size %u", decompressedSize); return; } @@ -970,14 +970,14 @@ void WorldSession::HandleUpdateAccountData(WorldPacket &recv_data) dest.resize(decompressedSize); uLongf realSize = decompressedSize; - if (uncompress(const_cast(dest.contents()), &realSize, const_cast(recv_data.contents() + recv_data.rpos()), recv_data.size() - recv_data.rpos()) != Z_OK) + if (uncompress(const_cast(dest.contents()), &realSize, const_cast(recvData.contents() + recvData.rpos()), recvData.size() - recvData.rpos()) != Z_OK) { - recv_data.rfinish(); // unnneded warning spam in this case + recvData.rfinish(); // unnneded warning spam in this case sLog->outError("UAD: Failed to decompress account data"); return; } - recv_data.rfinish(); // uncompress read (recv_data.size() - recv_data.rpos()) + recvData.rfinish(); // uncompress read (recvData.size() - recvData.rpos()) std::string adata; dest >> adata; @@ -990,12 +990,12 @@ void WorldSession::HandleUpdateAccountData(WorldPacket &recv_data) SendPacket(&data); } -void WorldSession::HandleRequestAccountData(WorldPacket& recv_data) +void WorldSession::HandleRequestAccountData(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_REQUEST_ACCOUNT_DATA"); uint32 type; - recv_data >> type; + recvData >> type; sLog->outDebug(LOG_FILTER_NETWORKIO, "RAD: type %u", type); @@ -1035,12 +1035,12 @@ int32 WorldSession::HandleEnableNagleAlgorithm() return 0; } -void WorldSession::HandleSetActionButtonOpcode(WorldPacket& recv_data) +void WorldSession::HandleSetActionButtonOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_SET_ACTION_BUTTON"); uint8 button; uint32 packetData; - recv_data >> button >> packetData; + recvData >> button >> packetData; uint32 action = ACTION_BUTTON_ACTION(packetData); uint8 type = ACTION_BUTTON_TYPE(packetData); @@ -1076,49 +1076,49 @@ void WorldSession::HandleSetActionButtonOpcode(WorldPacket& recv_data) } } -void WorldSession::HandleCompleteCinematic(WorldPacket& /*recv_data*/) +void WorldSession::HandleCompleteCinematic(WorldPacket& /*recvData*/) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_COMPLETE_CINEMATIC"); } -void WorldSession::HandleNextCinematicCamera(WorldPacket & /*recv_data*/) +void WorldSession::HandleNextCinematicCamera(WorldPacket & /*recvData*/) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_NEXT_CINEMATIC_CAMERA"); } -void WorldSession::HandleMoveTimeSkippedOpcode(WorldPacket & recv_data) +void WorldSession::HandleMoveTimeSkippedOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_MOVE_TIME_SKIPPED"); ObjectGuid guid; uint32 time; - recv_data >> time; - - guid[5] = recv_data.ReadBit(); - guid[1] = recv_data.ReadBit(); - guid[3] = recv_data.ReadBit(); - guid[7] = recv_data.ReadBit(); - guid[6] = recv_data.ReadBit(); - guid[0] = recv_data.ReadBit(); - guid[4] = recv_data.ReadBit(); - guid[2] = recv_data.ReadBit(); - - recv_data.ReadByteSeq(guid[7]); - recv_data.ReadByteSeq(guid[1]); - recv_data.ReadByteSeq(guid[2]); - recv_data.ReadByteSeq(guid[4]); - recv_data.ReadByteSeq(guid[3]); - recv_data.ReadByteSeq(guid[6]); - recv_data.ReadByteSeq(guid[0]); - recv_data.ReadByteSeq(guid[5]); + recvData >> time; + + guid[5] = recvData.ReadBit(); + guid[1] = recvData.ReadBit(); + guid[3] = recvData.ReadBit(); + guid[7] = recvData.ReadBit(); + guid[6] = recvData.ReadBit(); + guid[0] = recvData.ReadBit(); + guid[4] = recvData.ReadBit(); + guid[2] = recvData.ReadBit(); + + recvData.ReadByteSeq(guid[7]); + recvData.ReadByteSeq(guid[1]); + recvData.ReadByteSeq(guid[2]); + recvData.ReadByteSeq(guid[4]); + recvData.ReadByteSeq(guid[3]); + recvData.ReadByteSeq(guid[6]); + recvData.ReadByteSeq(guid[0]); + recvData.ReadByteSeq(guid[5]); //TODO! /* uint64 guid; uint32 time_skipped; - recv_data >> guid; - recv_data >> time_skipped; + recvData >> guid; + recvData >> time_skipped; sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_MOVE_TIME_SKIPPED"); /// TODO @@ -1129,61 +1129,61 @@ void WorldSession::HandleMoveTimeSkippedOpcode(WorldPacket & recv_data) */ } -void WorldSession::HandleFeatherFallAck(WorldPacket &recv_data) +void WorldSession::HandleFeatherFallAck(WorldPacket &recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_MOVE_FEATHER_FALL_ACK"); // no used - recv_data.rfinish(); // prevent warnings spam + recvData.rfinish(); // prevent warnings spam } -void WorldSession::HandleMoveUnRootAck(WorldPacket& recv_data) +void WorldSession::HandleMoveUnRootAck(WorldPacket& recvData) { // no used - recv_data.rfinish(); // prevent warnings spam + recvData.rfinish(); // prevent warnings spam /* uint64 guid; - recv_data >> guid; + recvData >> guid; // now can skip not our packet if (_player->GetGUID() != guid) { - recv_data.rfinish(); // prevent warnings spam + recvData.rfinish(); // prevent warnings spam return; } sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_FORCE_MOVE_UNROOT_ACK"); - recv_data.read_skip(); // unk + recvData.read_skip(); // unk MovementInfo movementInfo; movementInfo.guid = guid; - ReadMovementInfo(recv_data, &movementInfo); - recv_data.read_skip(); // unk2 + ReadMovementInfo(recvData, &movementInfo); + recvData.read_skip(); // unk2 */ } -void WorldSession::HandleMoveRootAck(WorldPacket& recv_data) +void WorldSession::HandleMoveRootAck(WorldPacket& recvData) { // no used - recv_data.rfinish(); // prevent warnings spam + recvData.rfinish(); // prevent warnings spam /* uint64 guid; - recv_data >> guid; + recvData >> guid; // now can skip not our packet if (_player->GetGUID() != guid) { - recv_data.rfinish(); // prevent warnings spam + recvData.rfinish(); // prevent warnings spam return; } sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_FORCE_MOVE_ROOT_ACK"); - recv_data.read_skip(); // unk + recvData.read_skip(); // unk MovementInfo movementInfo; - ReadMovementInfo(recv_data, &movementInfo); + ReadMovementInfo(recvData, &movementInfo); */ } @@ -1203,10 +1203,10 @@ void WorldSession::HandleSetActionBarToggles(WorldPacket& recvPacket) GetPlayer()->SetByteValue(PLAYER_FIELD_BYTES, 2, actionBar); } -void WorldSession::HandlePlayedTime(WorldPacket& recv_data) +void WorldSession::HandlePlayedTime(WorldPacket& recvData) { uint8 unk1; - recv_data >> unk1; // 0 or 1 expected + recvData >> unk1; // 0 or 1 expected WorldPacket data(SMSG_PLAYED_TIME, 4 + 4 + 1); data << uint32(_player->GetTotalPlayedTime()); @@ -1215,10 +1215,10 @@ void WorldSession::HandlePlayedTime(WorldPacket& recv_data) SendPacket(&data); } -void WorldSession::HandleInspectOpcode(WorldPacket& recv_data) +void WorldSession::HandleInspectOpcode(WorldPacket& recvData) { uint64 guid; - recv_data >> guid; + recvData >> guid; sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_INSPECT"); @@ -1255,10 +1255,10 @@ void WorldSession::HandleInspectOpcode(WorldPacket& recv_data) SendPacket(&data); } -void WorldSession::HandleInspectHonorStatsOpcode(WorldPacket& recv_data) +void WorldSession::HandleInspectHonorStatsOpcode(WorldPacket& recvData) { uint64 guid; - recv_data >> guid; + recvData >> guid; Player* player = ObjectAccessor::FindPlayer(guid); @@ -1276,7 +1276,7 @@ void WorldSession::HandleInspectHonorStatsOpcode(WorldPacket& recv_data) SendPacket(&data); } -void WorldSession::HandleWorldTeleportOpcode(WorldPacket& recv_data) +void WorldSession::HandleWorldTeleportOpcode(WorldPacket& recvData) { uint32 time; uint32 mapid; @@ -1285,12 +1285,12 @@ void WorldSession::HandleWorldTeleportOpcode(WorldPacket& recv_data) float PositionZ; float Orientation; - recv_data >> time; // time in m.sec. - recv_data >> mapid; - recv_data >> PositionX; - recv_data >> PositionY; - recv_data >> PositionZ; - recv_data >> Orientation; // o (3.141593 = 180 degrees) + recvData >> time; // time in m.sec. + recvData >> mapid; + recvData >> PositionX; + recvData >> PositionY; + recvData >> PositionZ; + recvData >> Orientation; // o (3.141593 = 180 degrees) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_WORLD_TELEPORT"); @@ -1308,11 +1308,11 @@ void WorldSession::HandleWorldTeleportOpcode(WorldPacket& recv_data) SendNotification(LANG_YOU_NOT_HAVE_PERMISSION); } -void WorldSession::HandleWhoisOpcode(WorldPacket& recv_data) +void WorldSession::HandleWhoisOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_WHOIS"); std::string charname; - recv_data >> charname; + recvData >> charname; if (!AccountMgr::IsAdminAccount(GetSecurity())) { @@ -1368,7 +1368,7 @@ void WorldSession::HandleWhoisOpcode(WorldPacket& recv_data) sLog->outDebug(LOG_FILTER_NETWORKIO, "Received whois command from player %s for character %s", GetPlayer()->GetName(), charname.c_str()); } -void WorldSession::HandleComplainOpcode(WorldPacket & recv_data) +void WorldSession::HandleComplainOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_COMPLAIN"); @@ -1379,21 +1379,21 @@ void WorldSession::HandleComplainOpcode(WorldPacket & recv_data) uint32 unk3 = 0; uint32 unk4 = 0; std::string description = ""; - recv_data >> spam_type; // unk 0x01 const, may be spam type (mail/chat) - recv_data >> spammer_guid; // player guid + recvData >> spam_type; // unk 0x01 const, may be spam type (mail/chat) + recvData >> spammer_guid; // player guid switch (spam_type) { case 0: - recv_data >> unk1; // const 0 - recv_data >> unk2; // probably mail id - recv_data >> unk3; // const 0 + recvData >> unk1; // const 0 + recvData >> unk2; // probably mail id + recvData >> unk3; // const 0 break; case 1: - recv_data >> unk1; // probably language - recv_data >> unk2; // message type? - recv_data >> unk3; // probably channel id - recv_data >> unk4; // unk random value - recv_data >> description; // spam description string (messagetype, channel name, player name, message) + recvData >> unk1; // probably language + recvData >> unk2; // message type? + recvData >> unk3; // probably channel id + recvData >> unk4; // unk random value + recvData >> description; // spam description string (messagetype, channel name, player name, message) break; } @@ -1409,13 +1409,13 @@ void WorldSession::HandleComplainOpcode(WorldPacket & recv_data) sLog->outDebug(LOG_FILTER_NETWORKIO, "REPORT SPAM: type %u, guid %u, unk1 %u, unk2 %u, unk3 %u, unk4 %u, message %s", spam_type, GUID_LOPART(spammer_guid), unk1, unk2, unk3, unk4, description.c_str()); } -void WorldSession::HandleRealmSplitOpcode(WorldPacket & recv_data) +void WorldSession::HandleRealmSplitOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_REALM_SPLIT"); uint32 unk; std::string split_date = "01/01/01"; - recv_data >> unk; + recvData >> unk; WorldPacket data(SMSG_REALM_SPLIT, 4+4+split_date.size()+1); data << unk; @@ -1429,12 +1429,12 @@ void WorldSession::HandleRealmSplitOpcode(WorldPacket & recv_data) //sLog->outDebug("response sent %u", unk); } -void WorldSession::HandleFarSightOpcode(WorldPacket & recv_data) +void WorldSession::HandleFarSightOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_FAR_SIGHT"); uint8 apply; - recv_data >> apply; + recvData >> apply; switch (apply) { @@ -1457,12 +1457,12 @@ void WorldSession::HandleFarSightOpcode(WorldPacket & recv_data) GetPlayer()->UpdateVisibilityForPlayer(); } -void WorldSession::HandleSetTitleOpcode(WorldPacket & recv_data) +void WorldSession::HandleSetTitleOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_SET_TITLE"); int32 title; - recv_data >> title; + recvData >> title; // -1 at none if (title > 0 && title < MAX_TITLE_INDEX) @@ -1476,12 +1476,12 @@ void WorldSession::HandleSetTitleOpcode(WorldPacket & recv_data) GetPlayer()->SetUInt32Value(PLAYER_CHOSEN_TITLE, title); } -void WorldSession::HandleTimeSyncResp(WorldPacket & recv_data) +void WorldSession::HandleTimeSyncResp(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_TIME_SYNC_RESP"); uint32 counter, clientTicks; - recv_data >> clientTicks >> counter; + recvData >> clientTicks >> counter; if (counter != _player->m_timeSyncCounter - 1) sLog->outDebug(LOG_FILTER_NETWORKIO, "Wrong time sync counter from player %s (cheater?)", _player->GetName()); @@ -1496,7 +1496,7 @@ void WorldSession::HandleTimeSyncResp(WorldPacket & recv_data) _player->m_timeSyncClient = clientTicks; } -void WorldSession::HandleResetInstancesOpcode(WorldPacket & /*recv_data*/) +void WorldSession::HandleResetInstancesOpcode(WorldPacket & /*recvData*/) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_RESET_INSTANCES"); @@ -1509,12 +1509,12 @@ void WorldSession::HandleResetInstancesOpcode(WorldPacket & /*recv_data*/) _player->ResetInstances(INSTANCE_RESET_ALL, false); } -void WorldSession::HandleSetDungeonDifficultyOpcode(WorldPacket & recv_data) +void WorldSession::HandleSetDungeonDifficultyOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "MSG_SET_DUNGEON_DIFFICULTY"); uint32 mode; - recv_data >> mode; + recvData >> mode; if (mode >= MAX_DUNGEON_DIFFICULTY) { @@ -1566,12 +1566,12 @@ void WorldSession::HandleSetDungeonDifficultyOpcode(WorldPacket & recv_data) } } -void WorldSession::HandleSetRaidDifficultyOpcode(WorldPacket & recv_data) +void WorldSession::HandleSetRaidDifficultyOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "MSG_SET_RAID_DIFFICULTY"); uint32 mode; - recv_data >> mode; + recvData >> mode; if (mode >= MAX_RAID_DIFFICULTY) { @@ -1623,7 +1623,7 @@ void WorldSession::HandleSetRaidDifficultyOpcode(WorldPacket & recv_data) } } -void WorldSession::HandleCancelMountAuraOpcode(WorldPacket & /*recv_data*/) +void WorldSession::HandleCancelMountAuraOpcode(WorldPacket & /*recvData*/) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CANCEL_MOUNT_AURA"); @@ -1644,45 +1644,45 @@ void WorldSession::HandleCancelMountAuraOpcode(WorldPacket & /*recv_data*/) _player->RemoveAurasByType(SPELL_AURA_MOUNTED); } -void WorldSession::HandleMoveSetCanFlyAckOpcode(WorldPacket & recv_data) +void WorldSession::HandleMoveSetCanFlyAckOpcode(WorldPacket & recvData) { // fly mode on/off sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_MOVE_SET_CAN_FLY_ACK"); uint64 guid; // guid - unused - recv_data.readPackGUID(guid); + recvData.readPackGUID(guid); - recv_data.read_skip(); // unk + recvData.read_skip(); // unk MovementInfo movementInfo; movementInfo.guid = guid; - ReadMovementInfo(recv_data, &movementInfo); + ReadMovementInfo(recvData, &movementInfo); - recv_data.read_skip(); // unk2 + recvData.read_skip(); // unk2 _player->m_mover->m_movementInfo.flags = movementInfo.GetMovementFlags(); } -void WorldSession::HandleRequestPetInfoOpcode(WorldPacket & /*recv_data */) +void WorldSession::HandleRequestPetInfoOpcode(WorldPacket & /*recvData */) { /* sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_REQUEST_PET_INFO"); - recv_data.hexlike(); + recvData.hexlike(); */ } -void WorldSession::HandleSetTaxiBenchmarkOpcode(WorldPacket & recv_data) +void WorldSession::HandleSetTaxiBenchmarkOpcode(WorldPacket& recvData) { uint8 mode; - recv_data >> mode; + recvData >> mode; sLog->outDebug(LOG_FILTER_NETWORKIO, "Client used \"/timetest %d\" command", mode); } -void WorldSession::HandleQueryInspectAchievements(WorldPacket & recv_data) +void WorldSession::HandleQueryInspectAchievements(WorldPacket & recvData) { uint64 guid; - recv_data.readPackGUID(guid); + recvData.readPackGUID(guid); Player* player = ObjectAccessor::FindPlayer(guid); if (!player) @@ -1700,7 +1700,7 @@ void WorldSession::HandleGuildAchievementProgressQuery(WorldPacket& recvData) guild->GetAchievementMgr().SendAchievementInfo(_player, achievementId); } -void WorldSession::HandleWorldStateUITimerUpdate(WorldPacket& /*recv_data*/) +void WorldSession::HandleWorldStateUITimerUpdate(WorldPacket& /*recvData*/) { // empty opcode sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_WORLD_STATE_UI_TIMER_UPDATE"); @@ -1710,7 +1710,7 @@ void WorldSession::HandleWorldStateUITimerUpdate(WorldPacket& /*recv_data*/) SendPacket(&data); } -void WorldSession::HandleReadyForAccountDataTimes(WorldPacket& /*recv_data*/) +void WorldSession::HandleReadyForAccountDataTimes(WorldPacket& /*recvData*/) { // empty opcode sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_READY_FOR_ACCOUNT_DATA_TIMES"); @@ -1725,7 +1725,7 @@ void WorldSession::SendSetPhaseShift(uint32 PhaseShift) SendPacket(&data); } -void WorldSession::HandleHearthAndResurrect(WorldPacket& /*recv_data*/) +void WorldSession::HandleHearthAndResurrect(WorldPacket& /*recvData*/) { if (_player->isInFlight()) return; diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp index e380ff4b110..f892ecfeb13 100755 --- a/src/server/game/Handlers/MovementHandler.cpp +++ b/src/server/game/Handlers/MovementHandler.cpp @@ -419,9 +419,9 @@ void WorldSession::HandleMovementOpcodes(WorldPacket& recvPacket) } } -void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recv_data) +void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recvData) { - uint32 opcode = recv_data.GetOpcode(); + uint32 opcode = recvData.GetOpcode(); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd %s (%u, 0x%X) opcode", LookupOpcodeName(Opcodes(opcode)), opcode, opcode); /* extract packet */ @@ -429,24 +429,24 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recv_data) uint32 unk1; float newspeed; - recv_data.readPackGUID(guid); + recvData.readPackGUID(guid); // now can skip not our packet if (_player->GetGUID() != guid) { - recv_data.rfinish(); // prevent warnings spam + recvData.rfinish(); // prevent warnings spam return; } // continue parse packet - recv_data >> unk1; // counter or moveEvent + recvData >> unk1; // counter or moveEvent MovementInfo movementInfo; movementInfo.guid = guid; - ReadMovementInfo(recv_data, &movementInfo); + ReadMovementInfo(recvData, &movementInfo); - recv_data >> newspeed; + recvData >> newspeed; /*----------------*/ // client ACK send one packet for mounted/run case and need skip all except last from its @@ -529,22 +529,22 @@ void WorldSession::HandleSetActiveMoverOpcode(WorldPacket& recvPacket) } } -void WorldSession::HandleMoveNotActiveMover(WorldPacket &recv_data) +void WorldSession::HandleMoveNotActiveMover(WorldPacket &recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_MOVE_NOT_ACTIVE_MOVER"); uint64 old_mover_guid; - recv_data.readPackGUID(old_mover_guid); + recvData.readPackGUID(old_mover_guid); MovementInfo mi; - ReadMovementInfo(recv_data, &mi); + ReadMovementInfo(recvData, &mi); mi.guid = old_mover_guid; _player->m_movementInfo = mi; } -void WorldSession::HandleMountSpecialAnimOpcode(WorldPacket& /*recv_data*/) +void WorldSession::HandleMountSpecialAnimOpcode(WorldPacket& /*recvData*/) { WorldPacket data(SMSG_MOUNTSPECIAL_ANIM, 8); data << uint64(GetPlayer()->GetGUID()); @@ -552,20 +552,20 @@ void WorldSession::HandleMountSpecialAnimOpcode(WorldPacket& /*recv_data*/) GetPlayer()->SendMessageToSet(&data, false); } -void WorldSession::HandleMoveKnockBackAck(WorldPacket & recv_data) +void WorldSession::HandleMoveKnockBackAck(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_MOVE_KNOCK_BACK_ACK"); uint64 guid; - recv_data.readPackGUID(guid); + recvData.readPackGUID(guid); if (_player->m_mover->GetGUID() != guid) return; - recv_data.read_skip(); // unk + recvData.read_skip(); // unk MovementInfo movementInfo; - ReadMovementInfo(recv_data, &movementInfo); + ReadMovementInfo(recvData, &movementInfo); _player->m_movementInfo = movementInfo; @@ -582,45 +582,45 @@ void WorldSession::HandleMoveKnockBackAck(WorldPacket & recv_data) _player->SendMessageToSet(&data, false); } -void WorldSession::HandleMoveHoverAck(WorldPacket& recv_data) +void WorldSession::HandleMoveHoverAck(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_MOVE_HOVER_ACK"); uint64 guid; // guid - unused - recv_data.readPackGUID(guid); + recvData.readPackGUID(guid); - recv_data.read_skip(); // unk + recvData.read_skip(); // unk MovementInfo movementInfo; - ReadMovementInfo(recv_data, &movementInfo); + ReadMovementInfo(recvData, &movementInfo); - recv_data.read_skip(); // unk2 + recvData.read_skip(); // unk2 } -void WorldSession::HandleMoveWaterWalkAck(WorldPacket& recv_data) +void WorldSession::HandleMoveWaterWalkAck(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_MOVE_WATER_WALK_ACK"); uint64 guid; // guid - unused - recv_data.readPackGUID(guid); + recvData.readPackGUID(guid); - recv_data.read_skip(); // unk + recvData.read_skip(); // unk MovementInfo movementInfo; - ReadMovementInfo(recv_data, &movementInfo); + ReadMovementInfo(recvData, &movementInfo); - recv_data.read_skip(); // unk2 + recvData.read_skip(); // unk2 } -void WorldSession::HandleSummonResponseOpcode(WorldPacket& recv_data) +void WorldSession::HandleSummonResponseOpcode(WorldPacket& recvData) { if (!_player->isAlive() || _player->isInCombat()) return; uint64 summonerGuid; bool agree; - recv_data >> summonerGuid; - recv_data >> agree; + recvData >> summonerGuid; + recvData >> agree; _player->SummonIfPossible(agree); } diff --git a/src/server/game/Handlers/NPCHandler.cpp b/src/server/game/Handlers/NPCHandler.cpp index a77477ab6df..8c959f454ff 100755 --- a/src/server/game/Handlers/NPCHandler.cpp +++ b/src/server/game/Handlers/NPCHandler.cpp @@ -47,10 +47,10 @@ enum StableResultCode STABLE_ERR_EXOTIC = 0x0C, // "you are unable to control exotic creatures" }; -void WorldSession::HandleTabardVendorActivateOpcode(WorldPacket & recv_data) +void WorldSession::HandleTabardVendorActivateOpcode(WorldPacket & recvData) { uint64 guid; - recv_data >> guid; + recvData >> guid; Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TABARDDESIGNER); if (!unit) @@ -102,11 +102,11 @@ void WorldSession::SendShowBank(uint64 guid) SendPacket(&data); } -void WorldSession::HandleTrainerListOpcode(WorldPacket & recv_data) +void WorldSession::HandleTrainerListOpcode(WorldPacket & recvData) { uint64 guid; - recv_data >> guid; + recvData >> guid; SendTrainerList(guid); } @@ -236,13 +236,13 @@ void WorldSession::SendTrainerList(uint64 guid, const std::string& strTitle) SendPacket(&data); } -void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket & recv_data) +void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket & recvData) { uint64 guid; uint32 spellId = 0; int32 unkInt; - recv_data >> guid >> unkInt >> spellId; + recvData >> guid >> unkInt >> spellId; sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_TRAINER_BUY_SPELL NpcGUID=%u, learn spell id is: %u", uint32(GUID_LOPART(guid)), spellId); Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TRAINER); @@ -298,12 +298,12 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket & recv_data) SendPacket(&data); } -void WorldSession::HandleGossipHelloOpcode(WorldPacket & recv_data) +void WorldSession::HandleGossipHelloOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GOSSIP_HELLO"); uint64 guid; - recv_data >> guid; + recvData >> guid; Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_NONE); if (!unit) @@ -347,7 +347,7 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket & recv_data) unit->AI()->sGossipHello(_player); } -/*void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data) +/*void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_GOSSIP_SELECT_OPTION"); @@ -356,12 +356,12 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket & recv_data) uint64 guid; std::string code = ""; - recv_data >> guid >> unk >> option; + recvData >> guid >> unk >> option; if (_player->PlayerTalkClass->GossipOptionCoded(option)) { sLog->outDebug(LOG_FILTER_PACKETIO, "reading string"); - recv_data >> code; + recvData >> code; sLog->outDebug(LOG_FILTER_PACKETIO, "string read: %s", code.c_str()); } @@ -388,13 +388,13 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket & recv_data) } }*/ -void WorldSession::HandleSpiritHealerActivateOpcode(WorldPacket & recv_data) +void WorldSession::HandleSpiritHealerActivateOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_SPIRIT_HEALER_ACTIVATE"); uint64 guid; - recv_data >> guid; + recvData >> guid; Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_SPIRITHEALER); if (!unit) @@ -501,12 +501,12 @@ void WorldSession::SendBindPoint(Creature* npc) _player->PlayerTalkClass->SendCloseGossip(); } -void WorldSession::HandleListStabledPetsOpcode(WorldPacket & recv_data) +void WorldSession::HandleListStabledPetsOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv MSG_LIST_STABLED_PETS"); uint64 npcGUID; - recv_data >> npcGUID; + recvData >> npcGUID; if (!CheckStableMaster(npcGUID)) return; @@ -595,12 +595,12 @@ void WorldSession::SendStableResult(uint8 res) SendPacket(&data); } -void WorldSession::HandleStablePet(WorldPacket & recv_data) +void WorldSession::HandleStablePet(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv CMSG_STABLE_PET"); uint64 npcGUID; - recv_data >> npcGUID; + recvData >> npcGUID; if (!GetPlayer()->isAlive()) { @@ -670,13 +670,13 @@ void WorldSession::HandleStablePetCallback(PreparedQueryResult result) SendStableResult(STABLE_ERR_STABLE); } -void WorldSession::HandleUnstablePet(WorldPacket & recv_data) +void WorldSession::HandleUnstablePet(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv CMSG_UNSTABLE_PET."); uint64 npcGUID; uint32 petnumber; - recv_data >> npcGUID >> petnumber; + recvData >> npcGUID >> petnumber; if (!CheckStableMaster(npcGUID)) { @@ -751,12 +751,12 @@ void WorldSession::HandleUnstablePetCallback(PreparedQueryResult result, uint32 SendStableResult(STABLE_SUCCESS_UNSTABLE); } -void WorldSession::HandleBuyStableSlot(WorldPacket & recv_data) +void WorldSession::HandleBuyStableSlot(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv CMSG_BUY_STABLE_SLOT."); uint64 npcGUID; - recv_data >> npcGUID; + recvData >> npcGUID; if (!CheckStableMaster(npcGUID)) { @@ -784,18 +784,18 @@ void WorldSession::HandleBuyStableSlot(WorldPacket & recv_data) SendStableResult(STABLE_ERR_STABLE); } -void WorldSession::HandleStableRevivePet(WorldPacket &/* recv_data */) +void WorldSession::HandleStableRevivePet(WorldPacket &/* recvData */) { sLog->outDebug(LOG_FILTER_NETWORKIO, "HandleStableRevivePet: Not implemented"); } -void WorldSession::HandleStableSwapPet(WorldPacket & recv_data) +void WorldSession::HandleStableSwapPet(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv CMSG_STABLE_SWAP_PET."); uint64 npcGUID; uint32 petId; - recv_data >> npcGUID >> petId; + recvData >> npcGUID >> petId; if (!CheckStableMaster(npcGUID)) { @@ -881,14 +881,14 @@ void WorldSession::HandleStableSwapPetCallback(PreparedQueryResult result, uint3 SendStableResult(STABLE_SUCCESS_UNSTABLE); } -void WorldSession::HandleRepairItemOpcode(WorldPacket& recv_data) +void WorldSession::HandleRepairItemOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_REPAIR_ITEM"); uint64 npcGUID, itemGUID; uint8 guildBank; // new in 2.3.2, bool that means from guild bank money - recv_data >> npcGUID >> itemGUID >> guildBank; + recvData >> npcGUID >> itemGUID >> guildBank; Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(npcGUID, UNIT_NPC_FLAG_REPAIR); if (!unit) diff --git a/src/server/game/Handlers/PetHandler.cpp b/src/server/game/Handlers/PetHandler.cpp index 3660bfbfcc7..8091f8f0e71 100755 --- a/src/server/game/Handlers/PetHandler.cpp +++ b/src/server/game/Handlers/PetHandler.cpp @@ -32,10 +32,10 @@ #include "Group.h" #include "SpellInfo.h" -void WorldSession::HandleDismissCritter(WorldPacket &recv_data) +void WorldSession::HandleDismissCritter(WorldPacket &recvData) { uint64 guid; - recv_data >> guid; + recvData >> guid; sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_DISMISS_CRITTER for GUID " UI64FMTD, guid); @@ -55,19 +55,19 @@ void WorldSession::HandleDismissCritter(WorldPacket &recv_data) } } -void WorldSession::HandlePetAction(WorldPacket & recv_data) +void WorldSession::HandlePetAction(WorldPacket & recvData) { uint64 guid1; uint32 data; uint64 guid2; float x, y, z; - recv_data >> guid1; //pet guid - recv_data >> data; - recv_data >> guid2; //tag guid + recvData >> guid1; //pet guid + recvData >> data; + recvData >> guid2; //tag guid // Position - recv_data >> x; - recv_data >> y; - recv_data >> z; + recvData >> x; + recvData >> y; + recvData >> z; uint32 spellid = UNIT_ACTION_BUTTON_ACTION(data); uint8 flag = UNIT_ACTION_BUTTON_TYPE(data); //delete = 0x07 CastSpell = C1 @@ -115,10 +115,10 @@ void WorldSession::HandlePetAction(WorldPacket & recv_data) } } -void WorldSession::HandlePetStopAttack(WorldPacket &recv_data) +void WorldSession::HandlePetStopAttack(WorldPacket &recvData) { uint64 guid; - recv_data >> guid; + recvData >> guid; sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_PET_STOP_ATTACK for GUID " UI64FMTD "", guid); @@ -406,15 +406,15 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint16 spellid } } -void WorldSession::HandlePetNameQuery(WorldPacket & recv_data) +void WorldSession::HandlePetNameQuery(WorldPacket & recvData) { sLog->outDetail("HandlePetNameQuery. CMSG_PET_NAME_QUERY"); uint32 petnumber; uint64 petguid; - recv_data >> petnumber; - recv_data >> petguid; + recvData >> petnumber; + recvData >> petguid; SendPetNameQuery(petguid, petnumber); } @@ -475,14 +475,14 @@ bool WorldSession::CheckStableMaster(uint64 guid) return true; } -void WorldSession::HandlePetSetAction(WorldPacket & recv_data) +void WorldSession::HandlePetSetAction(WorldPacket & recvData) { sLog->outDetail("HandlePetSetAction. CMSG_PET_SET_ACTION"); uint64 petguid; uint8 count; - recv_data >> petguid; + recvData >> petguid; Unit* pet = ObjectAccessor::GetUnit(*_player, petguid); @@ -499,7 +499,7 @@ void WorldSession::HandlePetSetAction(WorldPacket & recv_data) return; } - count = (recv_data.size() == 24) ? 2 : 1; + count = (recvData.size() == 24) ? 2 : 1; uint32 position[2]; uint32 data[2]; @@ -507,8 +507,8 @@ void WorldSession::HandlePetSetAction(WorldPacket & recv_data) for (uint8 i = 0; i < count; ++i) { - recv_data >> position[i]; - recv_data >> data[i]; + recvData >> position[i]; + recvData >> data[i]; uint8 act_state = UNIT_ACTION_BUTTON_TYPE(data[i]); @@ -591,7 +591,7 @@ void WorldSession::HandlePetSetAction(WorldPacket & recv_data) } } -void WorldSession::HandlePetRename(WorldPacket & recv_data) +void WorldSession::HandlePetRename(WorldPacket & recvData) { sLog->outDetail("HandlePetRename. CMSG_PET_RENAME"); @@ -601,9 +601,9 @@ void WorldSession::HandlePetRename(WorldPacket & recv_data) std::string name; DeclinedName declinedname; - recv_data >> petguid; - recv_data >> name; - recv_data >> isdeclined; + recvData >> petguid; + recvData >> name; + recvData >> isdeclined; Pet* pet = ObjectAccessor::FindPet(petguid); // check it! @@ -637,7 +637,7 @@ void WorldSession::HandlePetRename(WorldPacket & recv_data) { for (uint8 i = 0; i < MAX_DECLINED_NAME_CASES; ++i) { - recv_data >> declinedname.name[i]; + recvData >> declinedname.name[i]; } std::wstring wname; @@ -676,10 +676,10 @@ void WorldSession::HandlePetRename(WorldPacket & recv_data) pet->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, uint32(time(NULL))); // cast can't be helped } -void WorldSession::HandlePetAbandon(WorldPacket & recv_data) +void WorldSession::HandlePetAbandon(WorldPacket & recvData) { uint64 guid; - recv_data >> guid; //pet guid + recvData >> guid; //pet guid sLog->outDetail("HandlePetAbandon. CMSG_PET_ABANDON pet guid is %u", GUID_LOPART(guid)); if (!_player->IsInWorld()) @@ -852,33 +852,33 @@ void WorldSession::SendPetNameInvalid(uint32 error, const std::string& name, Dec SendPacket(&data); } -void WorldSession::HandlePetLearnTalent(WorldPacket & recv_data) +void WorldSession::HandlePetLearnTalent(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_PET_LEARN_TALENT"); uint64 guid; uint32 talentId, requestedRank; - recv_data >> guid >> talentId >> requestedRank; + recvData >> guid >> talentId >> requestedRank; _player->LearnPetTalent(guid, talentId, requestedRank); _player->SendTalentsInfoData(true); } -void WorldSession::HandleLearnPreviewTalentsPet(WorldPacket & recv_data) +void WorldSession::HandleLearnPreviewTalentsPet(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LEARN_PREVIEW_TALENTS_PET"); uint64 guid; - recv_data >> guid; + recvData >> guid; uint32 talentsCount; - recv_data >> talentsCount; + recvData >> talentsCount; uint32 talentId, talentRank; for (uint32 i = 0; i < talentsCount; ++i) { - recv_data >> talentId >> talentRank; + recvData >> talentId >> talentRank; _player->LearnPetTalent(guid, talentId, talentRank); } diff --git a/src/server/game/Handlers/PetitionsHandler.cpp b/src/server/game/Handlers/PetitionsHandler.cpp index f2aa66d4e66..66632f5e7b5 100755 --- a/src/server/game/Handlers/PetitionsHandler.cpp +++ b/src/server/game/Handlers/PetitionsHandler.cpp @@ -56,7 +56,7 @@ enum CharterCosts ARENA_TEAM_CHARTER_5v5_COST = 2000000 }; -void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data) +void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_PETITION_BUY"); @@ -64,28 +64,28 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data) uint32 clientIndex; // 1 for guild and arenaslot+1 for arenas in client std::string name; - recv_data >> guidNPC; // NPC GUID - recv_data.read_skip(); // 0 - recv_data.read_skip(); // 0 - recv_data >> name; // name - recv_data.read_skip(); // some string - recv_data.read_skip(); // 0 - recv_data.read_skip(); // 0 - recv_data.read_skip(); // 0 - recv_data.read_skip(); // 0 - recv_data.read_skip(); // 0 - recv_data.read_skip(); // 0 - recv_data.read_skip(); // 0 - recv_data.read_skip(); // 0 - recv_data.read_skip(); // 0 - recv_data.read_skip(); // 0 - recv_data.read_skip(); // 0 + recvData >> guidNPC; // NPC GUID + recvData.read_skip(); // 0 + recvData.read_skip(); // 0 + recvData >> name; // name + recvData.read_skip(); // some string + recvData.read_skip(); // 0 + recvData.read_skip(); // 0 + recvData.read_skip(); // 0 + recvData.read_skip(); // 0 + recvData.read_skip(); // 0 + recvData.read_skip(); // 0 + recvData.read_skip(); // 0 + recvData.read_skip(); // 0 + recvData.read_skip(); // 0 + recvData.read_skip(); // 0 + recvData.read_skip(); // 0 for (int i = 0; i < 10; ++i) - recv_data.read_skip(); + recvData.read_skip(); - recv_data >> clientIndex; // index - recv_data.read_skip(); // 0 + recvData >> clientIndex; // index + recvData.read_skip(); // 0 sLog->outDebug(LOG_FILTER_NETWORKIO, "Petitioner with GUID %u tried sell petition: name %s", GUID_LOPART(guidNPC), name.c_str()); @@ -250,13 +250,13 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data) CharacterDatabase.CommitTransaction(trans); } -void WorldSession::HandlePetitionShowSignOpcode(WorldPacket& recv_data) +void WorldSession::HandlePetitionShowSignOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_PETITION_SHOW_SIGNATURES"); uint8 signs = 0; uint64 petitionguid; - recv_data >> petitionguid; // petition guid + recvData >> petitionguid; // petition guid // solve (possible) some strange compile problems with explicit use GUID_LOPART(petitionguid) at some GCC versions (wrong code optimization in compiler?) uint32 petitionGuidLow = GUID_LOPART(petitionguid); @@ -310,14 +310,14 @@ void WorldSession::HandlePetitionShowSignOpcode(WorldPacket& recv_data) SendPacket(&data); } -void WorldSession::HandlePetitionQueryOpcode(WorldPacket & recv_data) +void WorldSession::HandlePetitionQueryOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_PETITION_QUERY"); // ok uint32 guildguid; uint64 petitionguid; - recv_data >> guildguid; // in Trinity always same as GUID_LOPART(petitionguid) - recv_data >> petitionguid; // petition guid + recvData >> guildguid; // in Trinity always same as GUID_LOPART(petitionguid) + recvData >> petitionguid; // petition guid sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_PETITION_QUERY Petition GUID %u Guild GUID %u", GUID_LOPART(petitionguid), guildguid); SendPetitionQueryOpcode(petitionguid); @@ -387,7 +387,7 @@ void WorldSession::SendPetitionQueryOpcode(uint64 petitionguid) SendPacket(&data); } -void WorldSession::HandlePetitionRenameOpcode(WorldPacket & recv_data) +void WorldSession::HandlePetitionRenameOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode MSG_PETITION_RENAME"); @@ -395,8 +395,8 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket & recv_data) uint32 type; std::string newName; - recv_data >> petitionGuid; // guid - recv_data >> newName; // new name + recvData >> petitionGuid; // guid + recvData >> newName; // new name Item* item = _player->GetItemByGuid(petitionGuid); if (!item) @@ -460,15 +460,15 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket & recv_data) SendPacket(&data); } -void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data) +void WorldSession::HandlePetitionSignOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_PETITION_SIGN"); // ok Field* fields; uint64 petitionGuid; uint8 unk; - recv_data >> petitionGuid; // petition guid - recv_data >> unk; + recvData >> petitionGuid; // petition guid + recvData >> unk; PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_SIGNATURES); @@ -593,13 +593,13 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data) owner->GetSession()->SendPacket(&data); } -void WorldSession::HandlePetitionDeclineOpcode(WorldPacket & recv_data) +void WorldSession::HandlePetitionDeclineOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode MSG_PETITION_DECLINE"); // ok uint64 petitionguid; uint64 ownerguid; - recv_data >> petitionguid; // petition guid + recvData >> petitionguid; // petition guid sLog->outDebug(LOG_FILTER_NETWORKIO, "Petition %u declined by %u", GUID_LOPART(petitionguid), _player->GetGUIDLow()); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PETITION_OWNER_BY_GUID); @@ -623,7 +623,7 @@ void WorldSession::HandlePetitionDeclineOpcode(WorldPacket & recv_data) } } -void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recv_data) +void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_OFFER_PETITION"); // ok @@ -631,9 +631,9 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recv_data) uint64 petitionguid, plguid; uint32 type, junk; Player* player; - recv_data >> junk; // this is not petition type! - recv_data >> petitionguid; // petition guid - recv_data >> plguid; // player guid + recvData >> junk; // this is not petition type! + recvData >> petitionguid; // petition guid + recvData >> plguid; // player guid player = ObjectAccessor::FindPlayer(plguid); if (!player) @@ -732,7 +732,7 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recv_data) player->GetSession()->SendPacket(&data); } -void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data) +void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_TURN_IN_PETITION"); @@ -740,7 +740,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data) WorldPacket data; uint64 petitionGuid; - recv_data >> petitionGuid; + recvData >> petitionGuid; // Check if player really has the required petition charter Item* item = _player->GetItemByGuid(petitionGuid); @@ -874,7 +874,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data) { // Receive the rest of the packet in arena team creation case uint32 background, icon, iconcolor, border, bordercolor; - recv_data >> background >> icon >> iconcolor >> border >> bordercolor; + recvData >> background >> icon >> iconcolor >> border >> bordercolor; // Create arena team ArenaTeam* arenaTeam = new ArenaTeam(); @@ -920,12 +920,12 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data) SendPacket(&data); } -void WorldSession::HandlePetitionShowListOpcode(WorldPacket & recv_data) +void WorldSession::HandlePetitionShowListOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "Received CMSG_PETITION_SHOWLIST"); uint64 guid; - recv_data >> guid; + recvData >> guid; SendPetitionShowList(guid); } diff --git a/src/server/game/Handlers/QueryHandler.cpp b/src/server/game/Handlers/QueryHandler.cpp index c22fc309770..16fa39f1257 100755 --- a/src/server/game/Handlers/QueryHandler.cpp +++ b/src/server/game/Handlers/QueryHandler.cpp @@ -64,10 +64,10 @@ void WorldSession::SendNameQueryOpcode(uint64 guid) SendPacket(&data); } -void WorldSession::HandleNameQueryOpcode(WorldPacket& recv_data) +void WorldSession::HandleNameQueryOpcode(WorldPacket& recvData) { uint64 guid; - recv_data >> guid; + recvData >> guid; // This is disable by default to prevent lots of console spam // sLog->outString("HandleNameQueryOpcode %u", guid); @@ -75,7 +75,7 @@ void WorldSession::HandleNameQueryOpcode(WorldPacket& recv_data) SendNameQueryOpcode(guid); } -void WorldSession::HandleQueryTimeOpcode(WorldPacket & /*recv_data*/) +void WorldSession::HandleQueryTimeOpcode(WorldPacket & /*recvData*/) { SendQueryTimeResponse(); } @@ -89,12 +89,12 @@ void WorldSession::SendQueryTimeResponse() } /// Only _static_ data is sent in this packet !!! -void WorldSession::HandleCreatureQueryOpcode(WorldPacket & recv_data) +void WorldSession::HandleCreatureQueryOpcode(WorldPacket & recvData) { uint32 entry; - recv_data >> entry; + recvData >> entry; uint64 guid; - recv_data >> guid; + recvData >> guid; CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate(entry); if (ci) @@ -157,12 +157,12 @@ void WorldSession::HandleCreatureQueryOpcode(WorldPacket & recv_data) } /// Only _static_ data is sent in this packet !!! -void WorldSession::HandleGameObjectQueryOpcode(WorldPacket & recv_data) +void WorldSession::HandleGameObjectQueryOpcode(WorldPacket & recvData) { uint32 entry; - recv_data >> entry; + recvData >> entry; uint64 guid; - recv_data >> guid; + recvData >> guid; const GameObjectTemplate* info = sObjectMgr->GetGameObjectTemplate(entry); if (info) @@ -213,7 +213,7 @@ void WorldSession::HandleGameObjectQueryOpcode(WorldPacket & recv_data) } } -void WorldSession::HandleCorpseQueryOpcode(WorldPacket & /*recv_data*/) +void WorldSession::HandleCorpseQueryOpcode(WorldPacket & /*recvData*/) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_CORPSE_QUERY"); @@ -264,15 +264,15 @@ void WorldSession::HandleCorpseQueryOpcode(WorldPacket & /*recv_data*/) SendPacket(&data); } -void WorldSession::HandleNpcTextQueryOpcode(WorldPacket & recv_data) +void WorldSession::HandleNpcTextQueryOpcode(WorldPacket & recvData) { uint32 textID; uint64 guid; - recv_data >> textID; + recvData >> textID; sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_NPC_TEXT_QUERY ID '%u'", textID); - recv_data >> guid; + recvData >> guid; GetPlayer()->SetSelection(guid); GossipText const* pGossip = sObjectMgr->GetGossipText(textID); @@ -348,13 +348,13 @@ void WorldSession::HandleNpcTextQueryOpcode(WorldPacket & recv_data) } /// Only _static_ data is sent in this packet !!! -void WorldSession::HandlePageTextQueryOpcode(WorldPacket & recv_data) +void WorldSession::HandlePageTextQueryOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_PAGE_TEXT_QUERY"); uint32 pageID; - recv_data >> pageID; - recv_data.read_skip(); // guid + recvData >> pageID; + recvData.read_skip(); // guid while (pageID) { @@ -388,12 +388,12 @@ void WorldSession::HandlePageTextQueryOpcode(WorldPacket & recv_data) } } -void WorldSession::HandleCorpseMapPositionQuery(WorldPacket & recv_data) +void WorldSession::HandleCorpseMapPositionQuery(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv CMSG_CORPSE_MAP_POSITION_QUERY"); uint32 unk; - recv_data >> unk; + recvData >> unk; WorldPacket data(SMSG_CORPSE_MAP_POSITION_QUERY_RESPONSE, 4+4+4+4); data << float(0); @@ -403,15 +403,15 @@ void WorldSession::HandleCorpseMapPositionQuery(WorldPacket & recv_data) SendPacket(&data); } -void WorldSession::HandleQuestPOIQuery(WorldPacket& recv_data) +void WorldSession::HandleQuestPOIQuery(WorldPacket& recvData) { uint32 count; - recv_data >> count; // quest count, max=25 + recvData >> count; // quest count, max=25 // 4.3 struct: count, byte, byte, byte, questIds[] if (count >= MAX_QUEST_LOG_SIZE) { - recv_data.rfinish(); + recvData.rfinish(); return; } @@ -421,7 +421,7 @@ void WorldSession::HandleQuestPOIQuery(WorldPacket& recv_data) for (uint32 i = 0; i < count; ++i) { uint32 questId; - recv_data >> questId; // quest id + recvData >> questId; // quest id bool questOk = false; diff --git a/src/server/game/Handlers/QuestHandler.cpp b/src/server/game/Handlers/QuestHandler.cpp index 62924c6ef36..87863dc9561 100755 --- a/src/server/game/Handlers/QuestHandler.cpp +++ b/src/server/game/Handlers/QuestHandler.cpp @@ -33,10 +33,10 @@ #include "ScriptMgr.h" #include "GameObjectAI.h" -void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket & recv_data) +void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket & recvData) { uint64 guid; - recv_data >> guid; + recvData >> guid; uint32 questStatus = DIALOG_STATUS_NONE; uint32 defstatus = DIALOG_STATUS_NONE; @@ -79,10 +79,10 @@ void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket & recv_data) _player->PlayerTalkClass->SendQuestGiverStatus(questStatus, guid); } -void WorldSession::HandleQuestgiverHelloOpcode(WorldPacket & recv_data) +void WorldSession::HandleQuestgiverHelloOpcode(WorldPacket & recvData) { uint64 guid; - recv_data >> guid; + recvData >> guid; sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_HELLO npc = %u", GUID_LOPART(guid)); @@ -109,12 +109,12 @@ void WorldSession::HandleQuestgiverHelloOpcode(WorldPacket & recv_data) creature->AI()->sGossipHello(_player); } -void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket & recv_data) +void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket & recvData) { uint64 guid; uint32 questId; uint32 unk1; - recv_data >> guid >> questId >> unk1; + recvData >> guid >> questId >> unk1; sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_ACCEPT_QUEST npc = %u, quest = %u, unk1 = %u", uint32(GUID_LOPART(guid)), questId, unk1); @@ -230,12 +230,12 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket & recv_data) _player->PlayerTalkClass->SendCloseGossip(); } -void WorldSession::HandleQuestgiverQueryQuestOpcode(WorldPacket & recv_data) +void WorldSession::HandleQuestgiverQueryQuestOpcode(WorldPacket & recvData) { uint64 guid; uint32 questId; uint8 unk1; - recv_data >> guid >> questId >> unk1; + recvData >> guid >> questId >> unk1; sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_QUERY_QUEST npc = %u, quest = %u, unk1 = %u", uint32(GUID_LOPART(guid)), questId, unk1); // Verify that the guid is valid and is a questgiver or involved in the requested quest @@ -268,24 +268,24 @@ void WorldSession::HandleQuestgiverQueryQuestOpcode(WorldPacket & recv_data) } } -void WorldSession::HandleQuestQueryOpcode(WorldPacket & recv_data) +void WorldSession::HandleQuestQueryOpcode(WorldPacket & recvData) { if (!_player) return; uint32 questId; - recv_data >> questId; + recvData >> questId; sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUEST_QUERY quest = %u", questId); if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId)) _player->PlayerTalkClass->SendQuestQueryResponse(quest); } -void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket & recv_data) +void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket & recvData) { uint32 questId, reward; uint64 guid; - recv_data >> guid >> questId >> reward; + recvData >> guid >> questId >> reward; if (reward >= QUEST_REWARD_CHOICES_COUNT) { @@ -365,11 +365,11 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket & recv_data) } } -void WorldSession::HandleQuestgiverRequestRewardOpcode(WorldPacket & recv_data) +void WorldSession::HandleQuestgiverRequestRewardOpcode(WorldPacket & recvData) { uint32 questId; uint64 guid; - recv_data >> guid >> questId; + recvData >> guid >> questId; sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_REQUEST_REWARD npc = %u, quest = %u", uint32(GUID_LOPART(guid)), questId); @@ -391,17 +391,17 @@ void WorldSession::HandleQuestgiverRequestRewardOpcode(WorldPacket & recv_data) _player->PlayerTalkClass->SendQuestGiverOfferReward(quest, guid, true); } -void WorldSession::HandleQuestgiverCancel(WorldPacket& /*recv_data*/) +void WorldSession::HandleQuestgiverCancel(WorldPacket& /*recvData*/) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_CANCEL"); _player->PlayerTalkClass->SendCloseGossip(); } -void WorldSession::HandleQuestLogSwapQuest(WorldPacket& recv_data) +void WorldSession::HandleQuestLogSwapQuest(WorldPacket& recvData) { uint8 slot1, slot2; - recv_data >> slot1 >> slot2; + recvData >> slot1 >> slot2; if (slot1 == slot2 || slot1 >= MAX_QUEST_LOG_SIZE || slot2 >= MAX_QUEST_LOG_SIZE) return; @@ -411,10 +411,10 @@ void WorldSession::HandleQuestLogSwapQuest(WorldPacket& recv_data) GetPlayer()->SwapQuestSlot(slot1, slot2); } -void WorldSession::HandleQuestLogRemoveQuest(WorldPacket& recv_data) +void WorldSession::HandleQuestLogRemoveQuest(WorldPacket& recvData) { uint8 slot; - recv_data >> slot; + recvData >> slot; sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTLOG_REMOVE_QUEST slot = %u", slot); @@ -479,12 +479,12 @@ void WorldSession::HandleQuestConfirmAccept(WorldPacket& recvData) } } -void WorldSession::HandleQuestgiverCompleteQuest(WorldPacket& recv_data) +void WorldSession::HandleQuestgiverCompleteQuest(WorldPacket& recvData) { uint32 questId; uint64 playerGuid; int8 unkByte; - recv_data >> playerGuid >> questId >> unkByte; + recvData >> playerGuid >> questId >> unkByte; sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_COMPLETE_QUEST npc = %u, questId = %u", uint32(GUID_LOPART(playerGuid)), questId); diff --git a/src/server/game/Handlers/ReferAFriendHandler.cpp b/src/server/game/Handlers/ReferAFriendHandler.cpp index 58d425ddf98..7822c38d390 100644 --- a/src/server/game/Handlers/ReferAFriendHandler.cpp +++ b/src/server/game/Handlers/ReferAFriendHandler.cpp @@ -21,12 +21,12 @@ #include "Opcodes.h" #include "Log.h" -void WorldSession::HandleGrantLevel(WorldPacket& recv_data) +void WorldSession::HandleGrantLevel(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_GRANT_LEVEL"); uint64 guid; - recv_data.readPackGUID(guid); + recvData.readPackGUID(guid); Player* target = ObjectAccessor::GetObjectInWorld(guid, _player); @@ -63,12 +63,12 @@ void WorldSession::HandleGrantLevel(WorldPacket& recv_data) target->GetSession()->SendPacket(&data2); } -void WorldSession::HandleAcceptGrantLevel(WorldPacket& recv_data) +void WorldSession::HandleAcceptGrantLevel(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_ACCEPT_LEVEL_GRANT"); uint64 guid; - recv_data.readPackGUID(guid); + recvData.readPackGUID(guid); Player* other = ObjectAccessor::GetObjectInWorld(guid, _player); if (!(other && other->GetSession())) diff --git a/src/server/game/Handlers/SkillHandler.cpp b/src/server/game/Handlers/SkillHandler.cpp index cec5ea2bbda..bb5942adbbe 100755 --- a/src/server/game/Handlers/SkillHandler.cpp +++ b/src/server/game/Handlers/SkillHandler.cpp @@ -26,10 +26,10 @@ #include "ObjectAccessor.h" #include "UpdateMask.h" -void WorldSession::HandleLearnTalentOpcode(WorldPacket & recv_data) +void WorldSession::HandleLearnTalentOpcode(WorldPacket & recvData) { uint32 talentId, requestedRank; - recv_data >> talentId >> requestedRank; + recvData >> talentId >> requestedRank; if (_player->LearnTalent(talentId, requestedRank)) _player->SendTalentsInfoData(false); @@ -74,11 +74,11 @@ void WorldSession::HandleLearnPreviewTalents(WorldPacket& recvPacket) _player->SendTalentsInfoData(false); } -void WorldSession::HandleTalentWipeConfirmOpcode(WorldPacket & recv_data) +void WorldSession::HandleTalentWipeConfirmOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "MSG_TALENT_WIPE_CONFIRM"); uint64 guid; - recv_data >> guid; + recvData >> guid; Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TRAINER); if (!unit) @@ -104,9 +104,9 @@ void WorldSession::HandleTalentWipeConfirmOpcode(WorldPacket & recv_data) unit->CastSpell(_player, 14867, true); //spell: "Untalent Visual Effect" } -void WorldSession::HandleUnlearnSkillOpcode(WorldPacket& recv_data) +void WorldSession::HandleUnlearnSkillOpcode(WorldPacket& recvData) { uint32 skillId; - recv_data >> skillId; + recvData >> skillId; GetPlayer()->SetSkill(skillId, 0, 0, 0); } diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp index 0d66776f273..caf922b4ae3 100755 --- a/src/server/game/Handlers/SpellHandler.cpp +++ b/src/server/game/Handlers/SpellHandler.cpp @@ -291,11 +291,11 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket) pUser->SendLoot(item->GetGUID(), LOOT_CORPSE); } -void WorldSession::HandleGameObjectUseOpcode(WorldPacket & recv_data) +void WorldSession::HandleGameObjectUseOpcode(WorldPacket & recvData) { uint64 guid; - recv_data >> guid; + recvData >> guid; sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_GAMEOBJ_USE Message [guid=%u]", GUID_LOPART(guid)); @@ -511,9 +511,9 @@ void WorldSession::HandleCancelAutoRepeatSpellOpcode(WorldPacket& /*recvPacket*/ _player->InterruptSpell(CURRENT_AUTOREPEAT_SPELL); } -void WorldSession::HandleCancelChanneling(WorldPacket & recv_data) +void WorldSession::HandleCancelChanneling(WorldPacket & recvData) { - recv_data.read_skip(); // spellid, not used + recvData.read_skip(); // spellid, not used // ignore for remote control state (for player case) Unit* mover = _player->m_mover; @@ -546,7 +546,7 @@ void WorldSession::HandleTotemDestroyed(WorldPacket& recvPacket) totem->ToTotem()->UnSummon(); } -void WorldSession::HandleSelfResOpcode(WorldPacket & /*recv_data*/) +void WorldSession::HandleSelfResOpcode(WorldPacket & /*recvData*/) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_SELF_RES"); // empty opcode @@ -563,10 +563,10 @@ void WorldSession::HandleSelfResOpcode(WorldPacket & /*recv_data*/) } } -void WorldSession::HandleSpellClick(WorldPacket& recv_data) +void WorldSession::HandleSpellClick(WorldPacket& recvData) { uint64 guid; - recv_data >> guid; + recvData >> guid; // this will get something not in world. crash Creature* unit = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, guid); @@ -581,11 +581,11 @@ void WorldSession::HandleSpellClick(WorldPacket& recv_data) unit->HandleSpellClick(_player); } -void WorldSession::HandleMirrorImageDataRequest(WorldPacket & recv_data) +void WorldSession::HandleMirrorImageDataRequest(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_GET_MIRRORIMAGE_DATA"); uint64 guid; - recv_data >> guid; + recvData >> guid; // Get unit for which data is needed by client Unit* unit = ObjectAccessor::GetObjectInWorld(guid, (Unit*)NULL); diff --git a/src/server/game/Handlers/TaxiHandler.cpp b/src/server/game/Handlers/TaxiHandler.cpp index b774fbcba70..16ffdfbc440 100755 --- a/src/server/game/Handlers/TaxiHandler.cpp +++ b/src/server/game/Handlers/TaxiHandler.cpp @@ -28,13 +28,13 @@ #include "Path.h" #include "WaypointMovementGenerator.h" -void WorldSession::HandleTaxiNodeStatusQueryOpcode(WorldPacket & recv_data) +void WorldSession::HandleTaxiNodeStatusQueryOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_TAXINODE_STATUS_QUERY"); uint64 guid; - recv_data >> guid; + recvData >> guid; SendTaxiStatus(guid); } @@ -63,12 +63,12 @@ void WorldSession::SendTaxiStatus(uint64 guid) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_TAXINODE_STATUS"); } -void WorldSession::HandleTaxiQueryAvailableNodes(WorldPacket & recv_data) +void WorldSession::HandleTaxiQueryAvailableNodes(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_TAXIQUERYAVAILABLENODES"); uint64 guid; - recv_data >> guid; + recvData >> guid; // cheating checks Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_FLIGHTMASTER); @@ -163,14 +163,14 @@ void WorldSession::SendDiscoverNewTaxiNode(uint32 nodeid) } } -void WorldSession::HandleActivateTaxiExpressOpcode (WorldPacket & recv_data) +void WorldSession::HandleActivateTaxiExpressOpcode (WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ACTIVATETAXIEXPRESS"); uint64 guid; uint32 node_count; - recv_data >> guid >> node_count; + recvData >> guid >> node_count; Creature* npc = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_FLIGHTMASTER); if (!npc) @@ -183,7 +183,7 @@ void WorldSession::HandleActivateTaxiExpressOpcode (WorldPacket & recv_data) for (uint32 i = 0; i < node_count; ++i) { uint32 node; - recv_data >> node; + recvData >> node; nodes.push_back(node); } @@ -195,17 +195,17 @@ void WorldSession::HandleActivateTaxiExpressOpcode (WorldPacket & recv_data) GetPlayer()->ActivateTaxiPathTo(nodes, npc); } -void WorldSession::HandleMoveSplineDoneOpcode(WorldPacket& recv_data) +void WorldSession::HandleMoveSplineDoneOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_MOVE_SPLINE_DONE"); uint64 guid; // used only for proper packet read - recv_data.readPackGUID(guid); + recvData.readPackGUID(guid); MovementInfo movementInfo; // used only for proper packet read - ReadMovementInfo(recv_data, &movementInfo); + ReadMovementInfo(recvData, &movementInfo); - recv_data.read_skip(); // unk + recvData.read_skip(); // unk // in taxi flight packet received in 2 case: // 1) end taxi path in far (multi-node) flight @@ -273,7 +273,7 @@ void WorldSession::HandleMoveSplineDoneOpcode(WorldPacket& recv_data) GetPlayer()->CastSpell(GetPlayer(), 2479, true); } -void WorldSession::HandleActivateTaxiOpcode(WorldPacket & recv_data) +void WorldSession::HandleActivateTaxiOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ACTIVATETAXI"); @@ -281,7 +281,7 @@ void WorldSession::HandleActivateTaxiOpcode(WorldPacket & recv_data) std::vector nodes; nodes.resize(2); - recv_data >> guid >> nodes[0] >> nodes[1]; + recvData >> guid >> nodes[0] >> nodes[1]; sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ACTIVATETAXI from %d to %d", nodes[0], nodes[1]); Creature* npc = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_FLIGHTMASTER); if (!npc) diff --git a/src/server/game/Handlers/TicketHandler.cpp b/src/server/game/Handlers/TicketHandler.cpp index d6675188f6e..e5618420ac5 100755 --- a/src/server/game/Handlers/TicketHandler.cpp +++ b/src/server/game/Handlers/TicketHandler.cpp @@ -26,7 +26,7 @@ #include "WorldSession.h" #include "Util.h" -void WorldSession::HandleGMTicketCreateOpcode(WorldPacket & recv_data) +void WorldSession::HandleGMTicketCreateOpcode(WorldPacket & recvData) { // Don't accept tickets if the ticket queue is disabled. (Ticket UI is greyed out but not fully dependable) if (sTicketMgr->GetStatus() == GMTICKET_QUEUE_STATUS_DISABLED) @@ -42,7 +42,7 @@ void WorldSession::HandleGMTicketCreateOpcode(WorldPacket & recv_data) // Player must not have ticket if (!sTicketMgr->GetTicketByPlayer(GetPlayer()->GetGUID())) { - GmTicket* ticket = new GmTicket(GetPlayer(), recv_data); + GmTicket* ticket = new GmTicket(GetPlayer(), recvData); sTicketMgr->AddTicket(ticket); sTicketMgr->UpdateLastChange(); @@ -56,10 +56,10 @@ void WorldSession::HandleGMTicketCreateOpcode(WorldPacket & recv_data) SendPacket(&data); } -void WorldSession::HandleGMTicketUpdateOpcode(WorldPacket & recv_data) +void WorldSession::HandleGMTicketUpdateOpcode(WorldPacket & recvData) { std::string message; - recv_data >> message; + recvData >> message; GMTicketResponse response = GMTICKET_RESPONSE_UPDATE_ERROR; if (GmTicket* ticket = sTicketMgr->GetTicketByPlayer(GetPlayer()->GetGUID())) @@ -78,7 +78,7 @@ void WorldSession::HandleGMTicketUpdateOpcode(WorldPacket & recv_data) SendPacket(&data); } -void WorldSession::HandleGMTicketDeleteOpcode(WorldPacket & /*recv_data*/) +void WorldSession::HandleGMTicketDeleteOpcode(WorldPacket & /*recvData*/) { if (GmTicket* ticket = sTicketMgr->GetTicketByPlayer(GetPlayer()->GetGUID())) { @@ -93,7 +93,7 @@ void WorldSession::HandleGMTicketDeleteOpcode(WorldPacket & /*recv_data*/) } } -void WorldSession::HandleGMTicketGetTicketOpcode(WorldPacket & /*recv_data*/) +void WorldSession::HandleGMTicketGetTicketOpcode(WorldPacket & /*recvData*/) { SendQueryTimeResponse(); @@ -108,7 +108,7 @@ void WorldSession::HandleGMTicketGetTicketOpcode(WorldPacket & /*recv_data*/) sTicketMgr->SendTicket(this, NULL); } -void WorldSession::HandleGMTicketSystemStatusOpcode(WorldPacket & /*recv_data*/) +void WorldSession::HandleGMTicketSystemStatusOpcode(WorldPacket & /*recvData*/) { // Note: This only disables the ticket UI at client side and is not fully reliable // are we sure this is a uint32? Should ask Zor @@ -117,25 +117,25 @@ void WorldSession::HandleGMTicketSystemStatusOpcode(WorldPacket & /*recv_data*/) SendPacket(&data); } -void WorldSession::HandleGMSurveySubmit(WorldPacket& recv_data) +void WorldSession::HandleGMSurveySubmit(WorldPacket& recvData) { uint32 nextSurveyID = sTicketMgr->GetNextSurveyID(); // just put the survey into the database uint32 mainSurvey; // GMSurveyCurrentSurvey.dbc, column 1 (all 9) ref to GMSurveySurveys.dbc - recv_data >> mainSurvey; + recvData >> mainSurvey; // sub_survey1, r1, comment1, sub_survey2, r2, comment2, sub_survey3, r3, comment3, sub_survey4, r4, comment4, sub_survey5, r5, comment5, sub_survey6, r6, comment6, sub_survey7, r7, comment7, sub_survey8, r8, comment8, sub_survey9, r9, comment9, sub_survey10, r10, comment10, for (uint8 i = 0; i < 10; i++) { uint32 subSurveyId; // ref to i'th GMSurveySurveys.dbc field (all fields in that dbc point to fields in GMSurveyQuestions.dbc) - recv_data >> subSurveyId; + recvData >> subSurveyId; if (!subSurveyId) break; uint8 rank; // probably some sort of ref to GMSurveyAnswers.dbc - recv_data >> rank; + recvData >> rank; std::string comment; // comment ("Usage: GMSurveyAnswerSubmit(question, rank, comment)") - recv_data >> comment; + recvData >> comment; PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GM_SUBSURVEY); stmt->setUInt32(0, nextSurveyID); @@ -146,7 +146,7 @@ void WorldSession::HandleGMSurveySubmit(WorldPacket& recv_data) } std::string comment; // just a guess - recv_data >> comment; + recvData >> comment; PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GM_SURVEY); stmt->setUInt32(0, GUID_LOPART(GetPlayer()->GetGUID())); @@ -157,17 +157,17 @@ void WorldSession::HandleGMSurveySubmit(WorldPacket& recv_data) CharacterDatabase.Execute(stmt); } -void WorldSession::HandleReportLag(WorldPacket& recv_data) +void WorldSession::HandleReportLag(WorldPacket& recvData) { // just put the lag report into the database... // can't think of anything else to do with it uint32 lagType, mapId; - recv_data >> lagType; - recv_data >> mapId; + recvData >> lagType; + recvData >> mapId; float x, y, z; - recv_data >> x; - recv_data >> y; - recv_data >> z; + recvData >> x; + recvData >> y; + recvData >> z; PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_LAG_REPORT); stmt->setUInt32(0, GUID_LOPART(GetPlayer()->GetGUID())); diff --git a/src/server/game/Handlers/VehicleHandler.cpp b/src/server/game/Handlers/VehicleHandler.cpp index dd95b903497..5ce0a590900 100644 --- a/src/server/game/Handlers/VehicleHandler.cpp +++ b/src/server/game/Handlers/VehicleHandler.cpp @@ -23,7 +23,7 @@ #include "Log.h" #include "ObjectAccessor.h" -void WorldSession::HandleDismissControlledVehicle(WorldPacket &recv_data) +void WorldSession::HandleDismissControlledVehicle(WorldPacket &recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_DISMISS_CONTROLLED_VEHICLE"); @@ -31,44 +31,44 @@ void WorldSession::HandleDismissControlledVehicle(WorldPacket &recv_data) if (!vehicleGUID) // something wrong here... { - recv_data.rfinish(); // prevent warnings spam + recvData.rfinish(); // prevent warnings spam return; } uint64 guid; - recv_data.readPackGUID(guid); + recvData.readPackGUID(guid); MovementInfo mi; mi.guid = guid; - ReadMovementInfo(recv_data, &mi); + ReadMovementInfo(recvData, &mi); _player->m_movementInfo = mi; _player->ExitVehicle(); } -void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket &recv_data) +void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket &recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE"); Unit* vehicle_base = GetPlayer()->GetVehicleBase(); if (!vehicle_base) { - recv_data.rfinish(); // prevent warnings spam + recvData.rfinish(); // prevent warnings spam return; } VehicleSeatEntry const* seat = GetPlayer()->GetVehicle()->GetSeatForPassenger(GetPlayer()); if (!seat->CanSwitchFromSeat()) { - recv_data.rfinish(); // prevent warnings spam + recvData.rfinish(); // prevent warnings spam sLog->outError("HandleChangeSeatsOnControlledVehicle, Opcode: %u, Player %u tried to switch seats but current seatflags %u don't permit that.", - recv_data.GetOpcode(), GetPlayer()->GetGUIDLow(), seat->m_flags); + recvData.GetOpcode(), GetPlayer()->GetGUIDLow(), seat->m_flags); return; } /* - switch (recv_data.GetOpcode()) + switch (recvData.GetOpcode()) { case CMSG_REQUEST_VEHICLE_PREV_SEAT: GetPlayer()->ChangeSeat(-1, false); @@ -79,17 +79,17 @@ void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket &recv_data) case CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE: { uint64 guid; // current vehicle guid - recv_data.readPackGUID(guid); + recvData.readPackGUID(guid); MovementInfo movementInfo; - ReadMovementInfo(recv_data, &movementInfo); + ReadMovementInfo(recvData, &movementInfo); vehicle_base->m_movementInfo = movementInfo; uint64 accessory; // accessory guid - recv_data.readPackGUID(accessory); + recvData.readPackGUID(accessory); int8 seatId; - recv_data >> seatId; + recvData >> seatId; if (vehicle_base->GetGUID() != guid) return; @@ -107,10 +107,10 @@ void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket &recv_data) case CMSG_REQUEST_VEHICLE_SWITCH_SEAT: { uint64 guid; // current vehicle guid - recv_data.readPackGUID(guid); + recvData.readPackGUID(guid); int8 seatId; - recv_data >> seatId; + recvData >> seatId; if (vehicle_base->GetGUID() == guid) GetPlayer()->ChangeSeat(seatId); @@ -209,7 +209,7 @@ void WorldSession::HandleEjectPassenger(WorldPacket &data) sLog->outError("HandleEjectPassenger: Player %u tried to eject invalid GUID "UI64FMTD, GetPlayer()->GetGUIDLow(), guid); } -void WorldSession::HandleRequestVehicleExit(WorldPacket& /*recv_data*/) +void WorldSession::HandleRequestVehicleExit(WorldPacket& /*recvData*/) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_REQUEST_VEHICLE_EXIT"); diff --git a/src/server/game/Handlers/VoiceChatHandler.cpp b/src/server/game/Handlers/VoiceChatHandler.cpp index 34ad5ac3eae..785b4f8e5cd 100755 --- a/src/server/game/Handlers/VoiceChatHandler.cpp +++ b/src/server/game/Handlers/VoiceChatHandler.cpp @@ -22,24 +22,24 @@ #include "Opcodes.h" #include "Log.h" -void WorldSession::HandleVoiceSessionEnableOpcode(WorldPacket& recv_data) +void WorldSession::HandleVoiceSessionEnableOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_VOICE_SESSION_ENABLE"); // uint8 isVoiceEnabled, uint8 isMicrophoneEnabled - recv_data.read_skip(); - recv_data.read_skip(); + recvData.read_skip(); + recvData.read_skip(); } -void WorldSession::HandleChannelVoiceOnOpcode(WorldPacket& /*recv_data*/) +void WorldSession::HandleChannelVoiceOnOpcode(WorldPacket& /*recvData*/) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CHANNEL_VOICE_ON"); // Enable Voice button in channel context menu } -void WorldSession::HandleSetActiveVoiceChannel(WorldPacket& recv_data) +void WorldSession::HandleSetActiveVoiceChannel(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_SET_ACTIVE_VOICE_CHANNEL"); - recv_data.read_skip(); - recv_data.read_skip(); + recvData.read_skip(); + recvData.read_skip(); } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index c5ec124a856..86d04aa0285 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -615,20 +615,20 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_SET_SELECTION, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleSetSelectionOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SET_SKILL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_STAT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_TAXI_BENCHMARK_MODE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTaxiBenchmarkOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_TITLE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTitleOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_SET_TAXI_BENCHMARK_MODE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTaxiBenchmarkOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_SET_TITLE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTitleOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SET_TITLE_SUFFIX, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_SET_TRADE_GOLD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTradeGoldOpcode ); DEFINE_OPCODE_HANDLER(CMSG_SET_TRADE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTradeItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SET_VEHICLE_REC_ID_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_WATCHED_FACTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetWatchedFactionOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_SET_WATCHED_FACTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetWatchedFactionOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SET_WORLDSTATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SHOWING_CLOAK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleShowingCloakOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_SHOWING_HELM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleShowingHelmOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_SHOWING_CLOAK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleShowingCloakOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_SHOWING_HELM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleShowingHelmOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SKILL_BUY_RANK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SKILL_BUY_STEP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SOCKET_GEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSocketOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_SPELLCLICK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSpellClick ); + DEFINE_OPCODE_HANDLER(CMSG_SOCKET_GEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSocketOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_SPELLCLICK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSpellClick ); //DEFINE_OPCODE_HANDLER(CMSG_SPIRIT_HEALER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSpiritHealerActivateOpcode); //DEFINE_OPCODE_HANDLER(CMSG_SPLIT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSplitItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_STABLE_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStablePet ); diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 84e2eb68771..614b31576ae 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -415,8 +415,8 @@ class WorldSession void HandleLoadScreenOpcode(WorldPacket& recvPacket); void HandleCharEnum(PreparedQueryResult result); void HandlePlayerLogin(LoginQueryHolder * holder); - void HandleCharFactionOrRaceChange(WorldPacket& recv_data); - void HandleRandomizeCharNameOpcode(WorldPacket& recv_data); + void HandleCharFactionOrRaceChange(WorldPacket& recvData); + void HandleRandomizeCharNameOpcode(WorldPacket& recvData); // played time @@ -435,15 +435,15 @@ class WorldSession void HandleInspectHonorStatsOpcode(WorldPacket& recvPacket); void HandleMoveWaterWalkAck(WorldPacket& recvPacket); - void HandleFeatherFallAck(WorldPacket& recv_data); + void HandleFeatherFallAck(WorldPacket& recvData); - void HandleMoveHoverAck(WorldPacket& recv_data); + void HandleMoveHoverAck(WorldPacket& recvData); void HandleMountSpecialAnimOpcode(WorldPacket& recvdata); // character view - void HandleShowingHelmOpcode(WorldPacket& recv_data); - void HandleShowingCloakOpcode(WorldPacket& recv_data); + void HandleShowingHelmOpcode(WorldPacket& recvData); + void HandleShowingCloakOpcode(WorldPacket& recvData); // repair void HandleRepairItemOpcode(WorldPacket& recvPacket); @@ -452,7 +452,7 @@ class WorldSession void HandleMoveKnockBackAck(WorldPacket& recvPacket); void HandleMoveTeleportAck(WorldPacket& recvPacket); - void HandleForceSpeedChangeAck(WorldPacket& recv_data); + void HandleForceSpeedChangeAck(WorldPacket& recvData); void HandlePingOpcode(WorldPacket& recvPacket); void HandleAuthSessionOpcode(WorldPacket& recvPacket); @@ -495,10 +495,10 @@ class WorldSession void HandleAreaTriggerOpcode(WorldPacket& recvPacket); - void HandleSetFactionAtWar(WorldPacket& recv_data); - void HandleSetFactionCheat(WorldPacket& recv_data); - void HandleSetWatchedFactionOpcode(WorldPacket& recv_data); - void HandleSetFactionInactiveOpcode(WorldPacket& recv_data); + void HandleSetFactionAtWar(WorldPacket& recvData); + void HandleSetFactionCheat(WorldPacket& recvData); + void HandleSetWatchedFactionOpcode(WorldPacket& recvData); + void HandleSetFactionInactiveOpcode(WorldPacket& recvData); void HandleUpdateAccountData(WorldPacket& recvPacket); void HandleRequestAccountData(WorldPacket& recvPacket); @@ -520,17 +520,17 @@ class WorldSession void HandleMoveWorldportAckOpcode(); // for server-side calls void HandleMovementOpcodes(WorldPacket& recvPacket); - void HandleSetActiveMoverOpcode(WorldPacket& recv_data); - void HandleMoveNotActiveMover(WorldPacket& recv_data); - void HandleDismissControlledVehicle(WorldPacket& recv_data); - void HandleRequestVehicleExit(WorldPacket& recv_data); - void HandleChangeSeatsOnControlledVehicle(WorldPacket& recv_data); - void HandleMoveTimeSkippedOpcode(WorldPacket& recv_data); + void HandleSetActiveMoverOpcode(WorldPacket& recvData); + void HandleMoveNotActiveMover(WorldPacket& recvData); + void HandleDismissControlledVehicle(WorldPacket& recvData); + void HandleRequestVehicleExit(WorldPacket& recvData); + void HandleChangeSeatsOnControlledVehicle(WorldPacket& recvData); + void HandleMoveTimeSkippedOpcode(WorldPacket& recvData); - void HandleRequestRaidInfoOpcode(WorldPacket& recv_data); + void HandleRequestRaidInfoOpcode(WorldPacket& recvData); - void HandleBattlefieldStatusOpcode(WorldPacket& recv_data); - void HandleBattleMasterHelloOpcode(WorldPacket& recv_data); + void HandleBattlefieldStatusOpcode(WorldPacket& recvData); + void HandleBattleMasterHelloOpcode(WorldPacket& recvData); void HandleGroupInviteOpcode(WorldPacket& recvPacket); //void HandleGroupCancelOpcode(WorldPacket& recvPacket); @@ -540,27 +540,27 @@ class WorldSession void HandleGroupUninviteGuidOpcode(WorldPacket& recvPacket); void HandleGroupSetLeaderOpcode(WorldPacket& recvPacket); void HandleGroupDisbandOpcode(WorldPacket& recvPacket); - void HandleOptOutOfLootOpcode(WorldPacket& recv_data); + void HandleOptOutOfLootOpcode(WorldPacket& recvData); void HandleLootMethodOpcode(WorldPacket& recvPacket); - void HandleLootRoll(WorldPacket& recv_data); - void HandleRequestPartyMemberStatsOpcode(WorldPacket& recv_data); - void HandleRaidTargetUpdateOpcode(WorldPacket& recv_data); - void HandleRaidReadyCheckOpcode(WorldPacket& recv_data); - void HandleRaidReadyCheckFinishedOpcode(WorldPacket& recv_data); - void HandleGroupRaidConvertOpcode(WorldPacket& recv_data); - void HandleGroupChangeSubGroupOpcode(WorldPacket& recv_data); - void HandleGroupSwapSubGroupOpcode(WorldPacket& recv_data); - void HandleGroupAssistantLeaderOpcode(WorldPacket& recv_data); - void HandlePartyAssignmentOpcode(WorldPacket& recv_data); - - void HandlePetitionBuyOpcode(WorldPacket& recv_data); - void HandlePetitionShowSignOpcode(WorldPacket& recv_data); - void HandlePetitionQueryOpcode(WorldPacket& recv_data); - void HandlePetitionRenameOpcode(WorldPacket& recv_data); - void HandlePetitionSignOpcode(WorldPacket& recv_data); - void HandlePetitionDeclineOpcode(WorldPacket& recv_data); - void HandleOfferPetitionOpcode(WorldPacket& recv_data); - void HandleTurnInPetitionOpcode(WorldPacket& recv_data); + void HandleLootRoll(WorldPacket& recvData); + void HandleRequestPartyMemberStatsOpcode(WorldPacket& recvData); + void HandleRaidTargetUpdateOpcode(WorldPacket& recvData); + void HandleRaidReadyCheckOpcode(WorldPacket& recvData); + void HandleRaidReadyCheckFinishedOpcode(WorldPacket& recvData); + void HandleGroupRaidConvertOpcode(WorldPacket& recvData); + void HandleGroupChangeSubGroupOpcode(WorldPacket& recvData); + void HandleGroupSwapSubGroupOpcode(WorldPacket& recvData); + void HandleGroupAssistantLeaderOpcode(WorldPacket& recvData); + void HandlePartyAssignmentOpcode(WorldPacket& recvData); + + void HandlePetitionBuyOpcode(WorldPacket& recvData); + void HandlePetitionShowSignOpcode(WorldPacket& recvData); + void HandlePetitionQueryOpcode(WorldPacket& recvData); + void HandlePetitionRenameOpcode(WorldPacket& recvData); + void HandlePetitionSignOpcode(WorldPacket& recvData); + void HandlePetitionDeclineOpcode(WorldPacket& recvData); + void HandleOfferPetitionOpcode(WorldPacket& recvData); + void HandleTurnInPetitionOpcode(WorldPacket& recvData); void HandleGuildQueryOpcode(WorldPacket& recvPacket); void HandleGuildCreateOpcode(WorldPacket& recvPacket); @@ -629,25 +629,25 @@ class WorldSession void HandleUnacceptTradeOpcode(WorldPacket& recvPacket); void HandleAuctionHelloOpcode(WorldPacket& recvPacket); - void HandleAuctionListItems(WorldPacket& recv_data); - void HandleAuctionListBidderItems(WorldPacket& recv_data); - void HandleAuctionSellItem(WorldPacket& recv_data); - void HandleAuctionRemoveItem(WorldPacket& recv_data); - void HandleAuctionListOwnerItems(WorldPacket& recv_data); - void HandleAuctionPlaceBid(WorldPacket& recv_data); - void HandleAuctionListPendingSales(WorldPacket& recv_data); - - void HandleGetMailList(WorldPacket& recv_data); - void HandleSendMail(WorldPacket& recv_data); - void HandleMailTakeMoney(WorldPacket& recv_data); - void HandleMailTakeItem(WorldPacket& recv_data); - void HandleMailMarkAsRead(WorldPacket& recv_data); - void HandleMailReturnToSender(WorldPacket& recv_data); - void HandleMailDelete(WorldPacket& recv_data); - void HandleItemTextQuery(WorldPacket& recv_data); - void HandleMailCreateTextItem(WorldPacket& recv_data); - void HandleQueryNextMailTime(WorldPacket& recv_data); - void HandleCancelChanneling(WorldPacket& recv_data); + void HandleAuctionListItems(WorldPacket& recvData); + void HandleAuctionListBidderItems(WorldPacket& recvData); + void HandleAuctionSellItem(WorldPacket& recvData); + void HandleAuctionRemoveItem(WorldPacket& recvData); + void HandleAuctionListOwnerItems(WorldPacket& recvData); + void HandleAuctionPlaceBid(WorldPacket& recvData); + void HandleAuctionListPendingSales(WorldPacket& recvData); + + void HandleGetMailList(WorldPacket& recvData); + void HandleSendMail(WorldPacket& recvData); + void HandleMailTakeMoney(WorldPacket& recvData); + void HandleMailTakeItem(WorldPacket& recvData); + void HandleMailMarkAsRead(WorldPacket& recvData); + void HandleMailReturnToSender(WorldPacket& recvData); + void HandleMailDelete(WorldPacket& recvData); + void HandleItemTextQuery(WorldPacket& recvData); + void HandleMailCreateTextItem(WorldPacket& recvData); + void HandleQueryNextMailTime(WorldPacket& recvData); + void HandleCancelChanneling(WorldPacket& recvData); void SendItemPageInfo(ItemTemplate* itemProto); void HandleSplitItemOpcode(WorldPacket& recvPacket); @@ -694,11 +694,11 @@ class WorldSession void HandleQuestgiverChooseRewardOpcode(WorldPacket& recvPacket); void HandleQuestgiverRequestRewardOpcode(WorldPacket& recvPacket); void HandleQuestQueryOpcode(WorldPacket& recvPacket); - void HandleQuestgiverCancel(WorldPacket& recv_data); - void HandleQuestLogSwapQuest(WorldPacket& recv_data); - void HandleQuestLogRemoveQuest(WorldPacket& recv_data); - void HandleQuestConfirmAccept(WorldPacket& recv_data); - void HandleQuestgiverCompleteQuest(WorldPacket& recv_data); + void HandleQuestgiverCancel(WorldPacket& recvData); + void HandleQuestLogSwapQuest(WorldPacket& recvData); + void HandleQuestLogRemoveQuest(WorldPacket& recvData); + void HandleQuestConfirmAccept(WorldPacket& recvData); + void HandleQuestgiverCompleteQuest(WorldPacket& recvData); void HandleQuestgiverQuestAutoLaunch(WorldPacket& recvPacket); void HandlePushQuestToParty(WorldPacket& recvPacket); void HandleQuestPushResult(WorldPacket& recvPacket); @@ -717,7 +717,7 @@ class WorldSession void HandleCorpseQueryOpcode(WorldPacket& recvPacket); void HandleCorpseMapPositionQuery(WorldPacket& recvPacket); void HandleResurrectResponseOpcode(WorldPacket& recvPacket); - void HandleSummonResponseOpcode(WorldPacket& recv_data); + void HandleSummonResponseOpcode(WorldPacket& recvData); void HandleJoinChannel(WorldPacket& recvPacket); void HandleLeaveChannel(WorldPacket& recvPacket); @@ -746,73 +746,73 @@ class WorldSession void HandlePageQuerySkippedOpcode(WorldPacket& recvPacket); void HandlePageTextQueryOpcode(WorldPacket& recvPacket); - void HandleTutorialFlag (WorldPacket& recv_data); - void HandleTutorialClear(WorldPacket& recv_data); - void HandleTutorialReset(WorldPacket& recv_data); + void HandleTutorialFlag (WorldPacket& recvData); + void HandleTutorialClear(WorldPacket& recvData); + void HandleTutorialReset(WorldPacket& recvData); //Pet - void HandlePetAction(WorldPacket& recv_data); - void HandlePetStopAttack(WorldPacket& recv_data); + void HandlePetAction(WorldPacket& recvData); + void HandlePetStopAttack(WorldPacket& recvData); void HandlePetActionHelper(Unit* pet, uint64 guid1, uint16 spellid, uint16 flag, uint64 guid2); - void HandlePetNameQuery(WorldPacket& recv_data); - void HandlePetSetAction(WorldPacket& recv_data); - void HandlePetAbandon(WorldPacket& recv_data); - void HandlePetRename(WorldPacket& recv_data); + void HandlePetNameQuery(WorldPacket& recvData); + void HandlePetSetAction(WorldPacket& recvData); + void HandlePetAbandon(WorldPacket& recvData); + void HandlePetRename(WorldPacket& recvData); void HandlePetCancelAuraOpcode(WorldPacket& recvPacket); void HandlePetSpellAutocastOpcode(WorldPacket& recvPacket); void HandlePetCastSpellOpcode(WorldPacket& recvPacket); void HandlePetLearnTalent(WorldPacket& recvPacket); void HandleLearnPreviewTalentsPet(WorldPacket& recvPacket); - void HandleSetActionBarToggles(WorldPacket& recv_data); + void HandleSetActionBarToggles(WorldPacket& recvData); - void HandleCharRenameOpcode(WorldPacket& recv_data); + void HandleCharRenameOpcode(WorldPacket& recvData); void HandleChangePlayerNameOpcodeCallBack(PreparedQueryResult result, std::string newName); - void HandleSetPlayerDeclinedNames(WorldPacket& recv_data); + void HandleSetPlayerDeclinedNames(WorldPacket& recvData); - void HandleTotemDestroyed(WorldPacket& recv_data); - void HandleDismissCritter(WorldPacket& recv_data); + void HandleTotemDestroyed(WorldPacket& recvData); + void HandleDismissCritter(WorldPacket& recvData); //Battleground - void HandleBattlemasterHelloOpcode(WorldPacket& recv_data); - void HandleBattlemasterJoinOpcode(WorldPacket& recv_data); - void HandleBattlegroundPlayerPositionsOpcode(WorldPacket& recv_data); - void HandlePVPLogDataOpcode(WorldPacket& recv_data); - void HandleBattleFieldPortOpcode(WorldPacket& recv_data); - void HandleBattlefieldListOpcode(WorldPacket& recv_data); - void HandleLeaveBattlefieldOpcode(WorldPacket& recv_data); - void HandleBattlemasterJoinArena(WorldPacket& recv_data); - void HandleReportPvPAFK(WorldPacket& recv_data); - - void HandleWardenDataOpcode(WorldPacket& recv_data); - void HandleWorldTeleportOpcode(WorldPacket& recv_data); - void HandleMinimapPingOpcode(WorldPacket& recv_data); - void HandleRandomRollOpcode(WorldPacket& recv_data); - void HandleFarSightOpcode(WorldPacket& recv_data); - void HandleSetDungeonDifficultyOpcode(WorldPacket& recv_data); - void HandleSetRaidDifficultyOpcode(WorldPacket& recv_data); - void HandleMoveSetCanFlyAckOpcode(WorldPacket& recv_data); - void HandleSetTitleOpcode(WorldPacket& recv_data); - void HandleRealmSplitOpcode(WorldPacket& recv_data); - void HandleTimeSyncResp(WorldPacket& recv_data); - void HandleWhoisOpcode(WorldPacket& recv_data); - void HandleResetInstancesOpcode(WorldPacket& recv_data); - void HandleHearthAndResurrect(WorldPacket& recv_data); + void HandleBattlemasterHelloOpcode(WorldPacket& recvData); + void HandleBattlemasterJoinOpcode(WorldPacket& recvData); + void HandleBattlegroundPlayerPositionsOpcode(WorldPacket& recvData); + void HandlePVPLogDataOpcode(WorldPacket& recvData); + void HandleBattleFieldPortOpcode(WorldPacket& recvData); + void HandleBattlefieldListOpcode(WorldPacket& recvData); + void HandleLeaveBattlefieldOpcode(WorldPacket& recvData); + void HandleBattlemasterJoinArena(WorldPacket& recvData); + void HandleReportPvPAFK(WorldPacket& recvData); + + void HandleWardenDataOpcode(WorldPacket& recvData); + void HandleWorldTeleportOpcode(WorldPacket& recvData); + void HandleMinimapPingOpcode(WorldPacket& recvData); + void HandleRandomRollOpcode(WorldPacket& recvData); + void HandleFarSightOpcode(WorldPacket& recvData); + void HandleSetDungeonDifficultyOpcode(WorldPacket& recvData); + void HandleSetRaidDifficultyOpcode(WorldPacket& recvData); + void HandleMoveSetCanFlyAckOpcode(WorldPacket& recvData); + void HandleSetTitleOpcode(WorldPacket& recvData); + void HandleRealmSplitOpcode(WorldPacket& recvData); + void HandleTimeSyncResp(WorldPacket& recvData); + void HandleWhoisOpcode(WorldPacket& recvData); + void HandleResetInstancesOpcode(WorldPacket& recvData); + void HandleHearthAndResurrect(WorldPacket& recvData); void HandleInstanceLockResponse(WorldPacket& recvPacket); void HandleUpdateMissileTrajectory(WorldPacket& recvPacket); // Looking for Dungeon/Raid - void HandleLfgSetCommentOpcode(WorldPacket& recv_data); - void HandleLfgPlayerLockInfoRequestOpcode(WorldPacket& recv_data); - void HandleLfgPartyLockInfoRequestOpcode(WorldPacket& recv_data); - void HandleLfgJoinOpcode(WorldPacket& recv_data); - void HandleLfgLeaveOpcode(WorldPacket& recv_data); - void HandleLfgSetRolesOpcode(WorldPacket& recv_data); - void HandleLfgProposalResultOpcode(WorldPacket& recv_data); - void HandleLfgSetBootVoteOpcode(WorldPacket& recv_data); - void HandleLfgTeleportOpcode(WorldPacket& recv_data); - void HandleLfrSearchOpcode(WorldPacket& recv_data); - void HandleLfrLeaveOpcode(WorldPacket& recv_data); + void HandleLfgSetCommentOpcode(WorldPacket& recvData); + void HandleLfgPlayerLockInfoRequestOpcode(WorldPacket& recvData); + void HandleLfgPartyLockInfoRequestOpcode(WorldPacket& recvData); + void HandleLfgJoinOpcode(WorldPacket& recvData); + void HandleLfgLeaveOpcode(WorldPacket& recvData); + void HandleLfgSetRolesOpcode(WorldPacket& recvData); + void HandleLfgProposalResultOpcode(WorldPacket& recvData); + void HandleLfgSetBootVoteOpcode(WorldPacket& recvData); + void HandleLfgTeleportOpcode(WorldPacket& recvData); + void HandleLfrSearchOpcode(WorldPacket& recvData); + void HandleLfrLeaveOpcode(WorldPacket& recvData); void SendLfgUpdatePlayer(const LfgUpdateData& updateData); void SendLfgUpdateParty(const LfgUpdateData& updateData); @@ -829,56 +829,56 @@ class WorldSession void SendLfgTeleportError(uint8 err); // Arena Team - void HandleInspectArenaTeamsOpcode(WorldPacket& recv_data); - void HandleArenaTeamQueryOpcode(WorldPacket& recv_data); - void HandleArenaTeamRosterOpcode(WorldPacket& recv_data); - void HandleArenaTeamInviteOpcode(WorldPacket& recv_data); - void HandleArenaTeamAcceptOpcode(WorldPacket& recv_data); - void HandleArenaTeamDeclineOpcode(WorldPacket& recv_data); - void HandleArenaTeamLeaveOpcode(WorldPacket& recv_data); - void HandleArenaTeamRemoveOpcode(WorldPacket& recv_data); - void HandleArenaTeamDisbandOpcode(WorldPacket& recv_data); - void HandleArenaTeamLeaderOpcode(WorldPacket& recv_data); - - void HandleAreaSpiritHealerQueryOpcode(WorldPacket& recv_data); - void HandleAreaSpiritHealerQueueOpcode(WorldPacket& recv_data); - void HandleCancelMountAuraOpcode(WorldPacket& recv_data); - void HandleSelfResOpcode(WorldPacket& recv_data); - void HandleComplainOpcode(WorldPacket& recv_data); - void HandleRequestPetInfoOpcode(WorldPacket& recv_data); + void HandleInspectArenaTeamsOpcode(WorldPacket& recvData); + void HandleArenaTeamQueryOpcode(WorldPacket& recvData); + void HandleArenaTeamRosterOpcode(WorldPacket& recvData); + void HandleArenaTeamInviteOpcode(WorldPacket& recvData); + void HandleArenaTeamAcceptOpcode(WorldPacket& recvData); + void HandleArenaTeamDeclineOpcode(WorldPacket& recvData); + void HandleArenaTeamLeaveOpcode(WorldPacket& recvData); + void HandleArenaTeamRemoveOpcode(WorldPacket& recvData); + void HandleArenaTeamDisbandOpcode(WorldPacket& recvData); + void HandleArenaTeamLeaderOpcode(WorldPacket& recvData); + + void HandleAreaSpiritHealerQueryOpcode(WorldPacket& recvData); + void HandleAreaSpiritHealerQueueOpcode(WorldPacket& recvData); + void HandleCancelMountAuraOpcode(WorldPacket& recvData); + void HandleSelfResOpcode(WorldPacket& recvData); + void HandleComplainOpcode(WorldPacket& recvData); + void HandleRequestPetInfoOpcode(WorldPacket& recvData); // Socket gem - void HandleSocketOpcode(WorldPacket& recv_data); + void HandleSocketOpcode(WorldPacket& recvData); - void HandleCancelTempEnchantmentOpcode(WorldPacket& recv_data); + void HandleCancelTempEnchantmentOpcode(WorldPacket& recvData); - void HandleItemRefundInfoRequest(WorldPacket& recv_data); - void HandleItemRefund(WorldPacket& recv_data); + void HandleItemRefundInfoRequest(WorldPacket& recvData); + void HandleItemRefund(WorldPacket& recvData); - void HandleChannelVoiceOnOpcode(WorldPacket& recv_data); - void HandleVoiceSessionEnableOpcode(WorldPacket& recv_data); - void HandleSetActiveVoiceChannel(WorldPacket& recv_data); - void HandleSetTaxiBenchmarkOpcode(WorldPacket& recv_data); + void HandleChannelVoiceOnOpcode(WorldPacket& recvData); + void HandleVoiceSessionEnableOpcode(WorldPacket& recvData); + void HandleSetActiveVoiceChannel(WorldPacket& recvData); + void HandleSetTaxiBenchmarkOpcode(WorldPacket& recvData); // Guild Bank - void HandleGuildPermissions(WorldPacket& recv_data); - void HandleGuildBankMoneyWithdrawn(WorldPacket& recv_data); - void HandleGuildBankerActivate(WorldPacket& recv_data); - void HandleGuildBankQueryTab(WorldPacket& recv_data); - void HandleGuildBankLogQuery(WorldPacket& recv_data); - void HandleGuildBankDepositMoney(WorldPacket& recv_data); - void HandleGuildBankWithdrawMoney(WorldPacket& recv_data); - void HandleGuildBankSwapItems(WorldPacket& recv_data); - - void HandleGuildBankUpdateTab(WorldPacket& recv_data); - void HandleGuildBankBuyTab(WorldPacket& recv_data); - void HandleQueryGuildBankTabText(WorldPacket& recv_data); - void HandleSetGuildBankTabText(WorldPacket& recv_data); - void HandleGuildQueryXPOpcode(WorldPacket& recv_data); + void HandleGuildPermissions(WorldPacket& recvData); + void HandleGuildBankMoneyWithdrawn(WorldPacket& recvData); + void HandleGuildBankerActivate(WorldPacket& recvData); + void HandleGuildBankQueryTab(WorldPacket& recvData); + void HandleGuildBankLogQuery(WorldPacket& recvData); + void HandleGuildBankDepositMoney(WorldPacket& recvData); + void HandleGuildBankWithdrawMoney(WorldPacket& recvData); + void HandleGuildBankSwapItems(WorldPacket& recvData); + + void HandleGuildBankUpdateTab(WorldPacket& recvData); + void HandleGuildBankBuyTab(WorldPacket& recvData); + void HandleQueryGuildBankTabText(WorldPacket& recvData); + void HandleSetGuildBankTabText(WorldPacket& recvData); + void HandleGuildQueryXPOpcode(WorldPacket& recvData); // Refer-a-Friend - void HandleGrantLevel(WorldPacket& recv_data); - void HandleAcceptGrantLevel(WorldPacket& recv_data); + void HandleGrantLevel(WorldPacket& recvData); + void HandleAcceptGrantLevel(WorldPacket& recvData); // Calendar void HandleCalendarGetCalendar(WorldPacket& recvData); @@ -927,20 +927,20 @@ class WorldSession void SendReforgeResult(bool success); // Miscellaneous - void HandleSpellClick(WorldPacket& recv_data); - void HandleMirrorImageDataRequest(WorldPacket& recv_data); - void HandleAlterAppearance(WorldPacket& recv_data); - void HandleRemoveGlyph(WorldPacket& recv_data); - void HandleCharCustomize(WorldPacket& recv_data); - void HandleQueryInspectAchievements(WorldPacket& recv_data); + void HandleSpellClick(WorldPacket& recvData); + void HandleMirrorImageDataRequest(WorldPacket& recvData); + void HandleAlterAppearance(WorldPacket& recvData); + void HandleRemoveGlyph(WorldPacket& recvData); + void HandleCharCustomize(WorldPacket& recvData); + void HandleQueryInspectAchievements(WorldPacket& recvData); void HandleGuildAchievementProgressQuery(WorldPacket& recvData); - void HandleEquipmentSetSave(WorldPacket& recv_data); - void HandleEquipmentSetDelete(WorldPacket& recv_data); - void HandleEquipmentSetUse(WorldPacket& recv_data); - void HandleWorldStateUITimerUpdate(WorldPacket& recv_data); - void HandleReadyForAccountDataTimes(WorldPacket& recv_data); - void HandleQueryQuestsCompleted(WorldPacket& recv_data); - void HandleQuestPOIQuery(WorldPacket& recv_data); + void HandleEquipmentSetSave(WorldPacket& recvData); + void HandleEquipmentSetDelete(WorldPacket& recvData); + void HandleEquipmentSetUse(WorldPacket& recvData); + void HandleWorldStateUITimerUpdate(WorldPacket& recvData); + void HandleReadyForAccountDataTimes(WorldPacket& recvData); + void HandleQueryQuestsCompleted(WorldPacket& recvData); + void HandleQuestPOIQuery(WorldPacket& recvData); void HandleEjectPassenger(WorldPacket& data); void HandleEnterPlayerVehicle(WorldPacket& data); void HandleUpdateProjectilePosition(WorldPacket& recvPacket); diff --git a/src/server/game/Tickets/TicketMgr.cpp b/src/server/game/Tickets/TicketMgr.cpp index 12fa4cb7eba..d68bb18b9eb 100755 --- a/src/server/game/Tickets/TicketMgr.cpp +++ b/src/server/game/Tickets/TicketMgr.cpp @@ -31,34 +31,34 @@ inline float GetAge(uint64 t) { return float(time(NULL) - t) / DAY; } // GM ticket GmTicket::GmTicket() { } -GmTicket::GmTicket(Player* player, WorldPacket& recv_data) : _createTime(time(NULL)), _lastModifiedTime(time(NULL)), _closedBy(0), _assignedTo(0), _completed(false), _escalatedStatus(TICKET_UNASSIGNED) +GmTicket::GmTicket(Player* player, WorldPacket& recvData) : _createTime(time(NULL)), _lastModifiedTime(time(NULL)), _closedBy(0), _assignedTo(0), _completed(false), _escalatedStatus(TICKET_UNASSIGNED) { _id = sTicketMgr->GenerateTicketId(); _playerName = player->GetName(); _playerGuid = player->GetGUID(); uint32 mapId; - recv_data >> mapId; // Map is sent as UInt32! + recvData >> mapId; // Map is sent as UInt32! _mapId = mapId; - recv_data >> _posX; - recv_data >> _posY; - recv_data >> _posZ; - recv_data >> _message; + recvData >> _posX; + recvData >> _posY; + recvData >> _posZ; + recvData >> _message; uint32 needResponse; - recv_data >> needResponse; + recvData >> needResponse; _needResponse = (needResponse == 17); // Requires GM response. 17 = true, 1 = false (17 is default) uint8 unk1; - recv_data >> unk1; // Requests further GM interaction on a ticket to which a GM has already responded + recvData >> unk1; // Requests further GM interaction on a ticket to which a GM has already responded - recv_data.rfinish(); + recvData.rfinish(); /* - recv_data >> uint32(count); // text lines + recvData >> uint32(count); // text lines for (int i = 0; i < count; i++) - recv_data >> uint32(); + recvData >> uint32(); if (something) - recv_data >> uint32(); + recvData >> uint32(); else compressed uint32 + string; */ diff --git a/src/server/game/Tickets/TicketMgr.h b/src/server/game/Tickets/TicketMgr.h index be8b4063d84..0e78ac72692 100755 --- a/src/server/game/Tickets/TicketMgr.h +++ b/src/server/game/Tickets/TicketMgr.h @@ -82,7 +82,7 @@ class GmTicket { public: GmTicket(); - explicit GmTicket(Player* player, WorldPacket& recv_data); + explicit GmTicket(Player* player, WorldPacket& recvData); ~GmTicket(); bool IsClosed() const { return _closedBy; } -- cgit v1.2.3 From e2590a7341fd61d73bfeb560de113c559d668857 Mon Sep 17 00:00:00 2001 From: cyberbrest Date: Mon, 6 Aug 2012 03:52:41 +0300 Subject: [Movement/Spline]: set correct spline flags for taxi patching. --- .../game/Movement/MovementGenerators/WaypointMovementGenerator.cpp | 2 +- src/server/game/Movement/Spline/MoveSplineFlag.h | 3 ++- src/server/game/Movement/Spline/MoveSplineInit.h | 5 +++++ 3 files changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp index 25730f92161..1bf6bdde681 100755 --- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp @@ -236,7 +236,7 @@ void FlightPathMovementGenerator::Reset(Player & player) init.Path().push_back(vertice); } init.SetFirstPointId(GetCurrentNode()); - init.SetFly(); + init.EnableTaxiFlight(); init.SetVelocity(PLAYER_FLIGHT_SPEED); init.Launch(); } diff --git a/src/server/game/Movement/Spline/MoveSplineFlag.h b/src/server/game/Movement/Spline/MoveSplineFlag.h index b011efac5be..c096d93e268 100644 --- a/src/server/game/Movement/Spline/MoveSplineFlag.h +++ b/src/server/game/Movement/Spline/MoveSplineFlag.h @@ -72,7 +72,7 @@ namespace Movement // flags that shouldn't be appended into SMSG_MONSTER_MOVE\SMSG_MONSTER_MOVE_TRANSPORT packet, should be more probably Mask_No_Monster_Move = Mask_Final_Facing | Mask_Animations | Done, // CatmullRom interpolation mode used - Mask_CatmullRom = Catmullrom, + Mask_CatmullRom = Catmullrom | Flying, // Unused, not suported flags Mask_Unused = No_Spline|Enter_Cycle|Frozen|UncompressedPath|Unknown1|Unknown2|Unknown3|Unknown4|Unknown5|Unknown6|Unknown7|Unknown8|Unknown9, }; @@ -112,6 +112,7 @@ namespace Movement void EnableFacingTarget() { raw() = (raw() & ~Mask_Final_Facing) | Final_Target; } void EnableTransportEnter() { raw() = (raw() & ~TransportExit) | TransportEnter; } void EnableTransportExit() { raw() = (raw() & ~TransportEnter) | TransportExit; } + void EnableTaxiFlight() { raw() = raw() | Catmullrom | Flying | Walkmode | UncompressedPath; } //4.3.4 0x600A00 uint8 animId : 4; bool unknown1 : 1; diff --git a/src/server/game/Movement/Spline/MoveSplineInit.h b/src/server/game/Movement/Spline/MoveSplineInit.h index ef847809ac8..459bb851aa3 100644 --- a/src/server/game/Movement/Spline/MoveSplineInit.h +++ b/src/server/game/Movement/Spline/MoveSplineInit.h @@ -102,6 +102,10 @@ namespace Movement void SetFly(); /* Enables walk mode. Disabled by default */ + void EnableTaxiFlight(); + /* Flags used in taxi + */ + void SetWalk(bool enable); /* Makes movement cyclic. Disabled by default */ @@ -141,6 +145,7 @@ namespace Movement }; inline void MoveSplineInit::SetFly() { args.flags.EnableFlying(); } + inline void MoveSplineInit::EnableTaxiFlight() { args.flags.EnableTaxiFlight(); } inline void MoveSplineInit::SetWalk(bool enable) { args.flags.walkmode = enable;} inline void MoveSplineInit::SetSmooth() { args.flags.EnableCatmullRom();} inline void MoveSplineInit::SetCyclic() { args.flags.cyclic = true;} -- cgit v1.2.3 From 4c81231816092ca627e1b93f78298a81c2cf545f Mon Sep 17 00:00:00 2001 From: cyberbrest Date: Mon, 6 Aug 2012 02:50:25 +0300 Subject: [PacketIO] structure CMSG_MOVE_CHNG_TRANSPORT. --- src/server/game/Movement/MovementStructures.h | 80 +++++++++++++++++++++++++++ src/server/game/Server/Protocol/Opcodes.cpp | 2 +- 2 files changed, 81 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Movement/MovementStructures.h b/src/server/game/Movement/MovementStructures.h index 501f920003d..0241edc1706 100644 --- a/src/server/game/Movement/MovementStructures.h +++ b/src/server/game/Movement/MovementStructures.h @@ -1776,6 +1776,84 @@ MovementStatusElements MovementStartPitchUpSequence[] = MSEEnd, }; +MovementStatusElements MoveChngTransport[]= +{ + MSEPositionY, + MSEPositionX, + MSEPositionZ, + MSEHasGuidByte4, + MSEHasGuidByte0, + MSEHasGuidByte2, + MSEHasTransportData, + MSEHasSpline, + MSEHasOrientation, + MSEHasGuidByte6, + MSEHasTimestamp, + MSEHasGuidByte5, + MSEHasGuidByte7, + MSEHasPitch, + MSEZeroBit, + MSEHasGuidByte3, + MSEHasSplineElevation, + MSEHasGuidByte1, + MSEHasFallData, + MSEHasMovementFlags, + MSEHasMovementFlags2, + + MSEHasTransportGuidByte3, + MSEHasTransportTime3, + MSEHasTransportGuidByte4, + MSEHasTransportGuidByte1, + MSEHasTransportGuidByte6, + MSEHasTransportGuidByte2, + MSEHasTransportTime2, + MSEHasTransportGuidByte0, + MSEHasTransportGuidByte7, + MSEHasTransportGuidByte5, + + MSEMovementFlags, + MSEMovementFlags2, + MSEHasFallDirection, + + MSEGuidByte7, + MSEGuidByte5, + MSEGuidByte1, + MSEGuidByte2, + MSEGuidByte6, + MSEGuidByte4, + MSEGuidByte0, + MSEGuidByte3, + + MSETransportPositionY, + MSETransportSeat, + MSETransportGuidByte1, + MSETransportGuidByte0, + MSETransportGuidByte2, + MSETransportGuidByte3, + MSETransportGuidByte6, + MSETransportPositionZ, + MSETransportPositionX, + MSETransportTime3, + MSETransportTime, + MSETransportGuidByte7, + MSETransportGuidByte5, + MSETransportGuidByte4, + MSETransportOrientation, + MSETransportTime2, + + MSEFallTime, + MSEFallHorizontalSpeed, + MSEFallCosAngle, + MSEFallSinAngle, + MSEFallVerticalSpeed, + + MSEOrientation, + MSEPitch, + MSESplineElevation, + MSETimestamp, + MSEEnd, +}; + MovementStatusElements* GetMovementStatusElementsSequence(Opcodes opcode) { switch (opcode) @@ -1826,6 +1904,8 @@ MovementStatusElements* GetMovementStatusElementsSequence(Opcodes opcode) return MovementStopTurnSequence; case SMSG_PLAYER_MOVE: return PlayerMoveSequence; + case CMSG_MOVE_CHNG_TRANSPORT: + return MoveChngTransport; default: break; } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 86d04aa0285..a06296536ff 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -431,7 +431,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_MOUNTSPECIAL_ANIM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMountSpecialAnimOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_CHARACTER_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_CHARM_PORT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_CHNG_TRANSPORT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(CMSG_MOVE_CHNG_TRANSPORT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FALL_RESET, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FEATHER_FALL_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleFeatherFallAck ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); -- cgit v1.2.3 From 8b8fa24fec8b669b23ca060b2d5d968af341947e Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 5 Aug 2012 21:52:36 -0500 Subject: Core/PacketIO: Enabled another bunch of opcodes and made some misc fixes here and there --- src/server/game/Entities/Player/Player.cpp | 2 +- src/server/game/Entities/Unit/StatSystem.cpp | 2 - src/server/game/Guilds/Guild.cpp | 4 +- src/server/game/Handlers/AuctionHouseHandler.cpp | 82 ++++++++++---------- src/server/game/Handlers/CharacterHandler.cpp | 6 +- src/server/game/Handlers/MailHandler.cpp | 97 +++++++++++++++++------- src/server/game/Handlers/MiscHandler.cpp | 2 +- src/server/game/Handlers/QueryHandler.cpp | 1 - src/server/game/Handlers/QuestHandler.cpp | 10 +-- src/server/game/Server/Protocol/Opcodes.cpp | 34 ++++----- 10 files changed, 139 insertions(+), 101 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 9a6a6405a55..942403065ae 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -4483,7 +4483,7 @@ bool Player::ResetTalents(bool no_cost) if (!no_cost) { - ModifyMoney(-(int32)cost); + ModifyMoney(-(int64)cost); UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TALENTS, cost); UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_NUMBER_OF_TALENT_RESETS, 1); diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index c307324bead..4bc33dd10f1 100755 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -800,9 +800,7 @@ void Player::UpdateManaRegen() // Get bonus from SPELL_AURA_MOD_MANA_REGEN_FROM_STAT aura AuraEffectList const& regenAura = GetAuraEffectsByType(SPELL_AURA_MOD_MANA_REGEN_FROM_STAT); for (AuraEffectList::const_iterator i = regenAura.begin(); i != regenAura.end(); ++i) - { power_regen_mp5 += GetStat(Stats((*i)->GetMiscValue())) * (*i)->GetAmount() / 500.0f; - } // Set regen rate in cast state apply only on spirit based regen int32 modManaRegenInterrupt = GetTotalAuraModifier(SPELL_AURA_MOD_MANA_REGEN_INTERRUPT); diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index e2e2f31c30c..697156f5e1b 100755 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -1291,9 +1291,7 @@ void Guild::HandleQuery(WorldSession* session) for (uint8 i = 0; i < GUILD_RANKS_MAX_COUNT; ++i) { if (i < _GetRanksSize()) - { data << uint32(m_ranks[i].GetId()); - } else data << uint32(0); } @@ -1545,7 +1543,7 @@ void Guild::HandleInviteMember(WorldSession* session, const std::string& name) _LogEvent(GUILD_EVENT_LOG_INVITE_PLAYER, player->GetGUIDLow(), pInvitee->GetGUIDLow()); WorldPacket data(SMSG_GUILD_INVITE, 100); - data << uint32(1); // Guild Level + data << uint32(GetLevel()); data << uint32(m_emblemInfo.GetStyle()); data << uint32(m_emblemInfo.GetBorderColor()); data << uint32(m_emblemInfo.GetBorderStyle()); diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp index 52f0793e73c..33fed32aac9 100755 --- a/src/server/game/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Handlers/AuctionHouseHandler.cpp @@ -33,10 +33,10 @@ //post-incrementation is always slower than pre-incrementation ! //void called when player click on auctioneer npc -void WorldSession::HandleAuctionHelloOpcode(WorldPacket & recv_data) +void WorldSession::HandleAuctionHelloOpcode(WorldPacket & recvData) { uint64 guid; //NPC guid - recv_data >> guid; + recvData >> guid; Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_AUCTIONEER); if (!unit) @@ -113,12 +113,12 @@ void WorldSession::SendAuctionOwnerNotification(AuctionEntry* auction) } //this void creates new auction and adds auction to some auctionhouse -void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data) +void WorldSession::HandleAuctionSellItem(WorldPacket & recvData) { uint64 auctioneer; uint32 itemsCount, etime, bid, buyout; - recv_data >> auctioneer; - recv_data >> itemsCount; + recvData >> auctioneer; + recvData >> itemsCount; uint64 itemGUIDs[MAX_AUCTION_ITEMS]; // 160 slot = 4x 36 slot bag + backpack 16 slot uint32 count[MAX_AUCTION_ITEMS]; @@ -131,16 +131,16 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data) for (uint32 i = 0; i < itemsCount; ++i) { - recv_data >> itemGUIDs[i]; - recv_data >> count[i]; + recvData >> itemGUIDs[i]; + recvData >> count[i]; if (!itemGUIDs[i] || !count[i] || count[i] > 1000 ) return; } - recv_data >> bid; - recv_data >> buyout; - recv_data >> etime; + recvData >> bid; + recvData >> buyout; + recvData >> etime; if (!bid || !etime) return; @@ -354,16 +354,16 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data) } // this function is called when client bids or buys out auction -void WorldSession::HandleAuctionPlaceBid(WorldPacket& recv_data) +void WorldSession::HandleAuctionPlaceBid(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_AUCTION_PLACE_BID"); uint64 auctioneer; uint32 auctionId; uint64 price; - recv_data >> auctioneer; - recv_data >> auctionId; - recv_data >> price; + recvData >> auctioneer; + recvData >> auctionId; + recvData >> price; if (!auctionId || !price) return; // check for cheaters @@ -482,14 +482,14 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket& recv_data) } //this void is called when auction_owner cancels his auction -void WorldSession::HandleAuctionRemoveItem(WorldPacket & recv_data) +void WorldSession::HandleAuctionRemoveItem(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_AUCTION_REMOVE_ITEM"); uint64 auctioneer; uint32 auctionId; - recv_data >> auctioneer; - recv_data >> auctionId; + recvData >> auctioneer; + recvData >> auctionId; Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(auctioneer, UNIT_NPC_FLAG_AUCTIONEER); if (!creature) @@ -558,7 +558,7 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recv_data) } //called when player lists his bids -void WorldSession::HandleAuctionListBidderItems(WorldPacket & recv_data) +void WorldSession::HandleAuctionListBidderItems(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_AUCTION_LIST_BIDDER_ITEMS"); @@ -566,12 +566,12 @@ void WorldSession::HandleAuctionListBidderItems(WorldPacket & recv_data) uint32 listfrom; //page of auctions uint32 outbiddedCount; //count of outbidded auctions - recv_data >> guid; - recv_data >> listfrom; // not used in fact (this list not have page control in client) - recv_data >> outbiddedCount; - if (recv_data.size() != (16 + outbiddedCount * 4)) + recvData >> guid; + recvData >> listfrom; // not used in fact (this list not have page control in client) + recvData >> outbiddedCount; + if (recvData.size() != (16 + outbiddedCount * 4)) { - sLog->outError("Client sent bad opcode!!! with count: %u and size : %lu (must be: %u)", outbiddedCount, (unsigned long)recv_data.size(), (16 + outbiddedCount * 4)); + sLog->outError("Client sent bad opcode!!! with count: %u and size : %lu (must be: %u)", outbiddedCount, (unsigned long)recvData.size(), (16 + outbiddedCount * 4)); outbiddedCount = 0; } @@ -579,7 +579,7 @@ void WorldSession::HandleAuctionListBidderItems(WorldPacket & recv_data) if (!creature) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionListBidderItems - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); - recv_data.rfinish(); + recvData.rfinish(); return; } @@ -598,7 +598,7 @@ void WorldSession::HandleAuctionListBidderItems(WorldPacket & recv_data) { --outbiddedCount; uint32 outbiddedAuctionId; - recv_data >> outbiddedAuctionId; + recvData >> outbiddedAuctionId; AuctionEntry* auction = auctionHouse->GetAuction(outbiddedAuctionId); if (auction && auction->BuildAuctionInfo(data)) { @@ -615,15 +615,15 @@ void WorldSession::HandleAuctionListBidderItems(WorldPacket & recv_data) } //this void sends player info about his auctions -void WorldSession::HandleAuctionListOwnerItems(WorldPacket & recv_data) +void WorldSession::HandleAuctionListOwnerItems(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_AUCTION_LIST_OWNER_ITEMS"); uint32 listfrom; uint64 guid; - recv_data >> guid; - recv_data >> listfrom; // not used in fact (this list not have page control in client) + recvData >> guid; + recvData >> listfrom; // not used in fact (this list not have page control in client) Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_AUCTIONEER); if (!creature) @@ -652,7 +652,7 @@ void WorldSession::HandleAuctionListOwnerItems(WorldPacket & recv_data) } //this void is called when player clicks on search button -void WorldSession::HandleAuctionListItems(WorldPacket & recv_data) +void WorldSession::HandleAuctionListItems(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_AUCTION_LIST_ITEMS"); @@ -661,23 +661,23 @@ void WorldSession::HandleAuctionListItems(WorldPacket & recv_data) uint32 listfrom, auctionSlotID, auctionMainCategory, auctionSubCategory, quality; uint64 guid; - recv_data >> guid; - recv_data >> listfrom; // start, used for page control listing by 50 elements - recv_data >> searchedname; + recvData >> guid; + recvData >> listfrom; // start, used for page control listing by 50 elements + recvData >> searchedname; - recv_data >> levelmin >> levelmax; - recv_data >> auctionSlotID >> auctionMainCategory >> auctionSubCategory; - recv_data >> quality >> usable; + recvData >> levelmin >> levelmax; + recvData >> auctionSlotID >> auctionMainCategory >> auctionSubCategory; + recvData >> quality >> usable; - recv_data.read_skip(); // unk + recvData.read_skip(); // unk // this block looks like it uses some lame byte packing or similar... uint8 unkCnt; - recv_data >> unkCnt; + recvData >> unkCnt; for (uint8 i = 0; i < unkCnt; i++) { - recv_data.read_skip(); - recv_data.read_skip(); + recvData.read_skip(); + recvData.read_skip(); } Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_AUCTIONEER); @@ -719,11 +719,11 @@ void WorldSession::HandleAuctionListItems(WorldPacket & recv_data) SendPacket(&data); } -void WorldSession::HandleAuctionListPendingSales(WorldPacket & recv_data) +void WorldSession::HandleAuctionListPendingSales(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_AUCTION_LIST_PENDING_SALES"); - recv_data.read_skip(); + recvData.read_skip(); uint32 count = 0; diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 78388c661ef..2087c043845 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -2126,8 +2126,10 @@ void WorldSession::HandleRandomizeCharNameOpcode(WorldPacket& recvData) return; } + std::string* name = GetRandomCharacterName(race, gender); WorldPacket data(SMSG_RANDOMIZE_CHAR_NAME, 10); - data << uint8(128); // unk1 - data << *GetRandomCharacterName(race, gender); + data.WriteBit(0); // unk + data.WriteBits(name->size(), 7); + data << *name; SendPacket(&data); } diff --git a/src/server/game/Handlers/MailHandler.cpp b/src/server/game/Handlers/MailHandler.cpp index 4cd8621e68e..0d3ec76bc4e 100755 --- a/src/server/game/Handlers/MailHandler.cpp +++ b/src/server/game/Handlers/MailHandler.cpp @@ -29,44 +29,85 @@ #include "Item.h" #include "AccountMgr.h" -void WorldSession::HandleSendMail(WorldPacket & recvData) +void WorldSession::HandleSendMail(WorldPacket& recvData) { - uint64 mailbox, unk3; + ObjectGuid mailbox; + uint64 money, COD; std::string receiver, subject, body; - uint32 unk1, unk2, money, COD; - uint8 unk4; - recvData >> mailbox; - recvData >> receiver; - - recvData >> subject; - - recvData >> body; - - recvData >> unk1; // stationery? - recvData >> unk2; // 0x00000000 - - uint8 items_count; - recvData >> items_count; // attached items count + uint32 bodyLength, subjectLength, receiverLength; + uint32 unk1, unk2; + + recvData >> unk1; + recvData >> unk2; // Stationery? + + recvData >> money >> COD; // money and cod + bodyLength = recvData.ReadBits(12); + subjectLength = recvData.ReadBits(9); + uint8 items_count = recvData.ReadBits(5); // attached items count + if (items_count > MAX_MAIL_ITEMS) // client limit { GetPlayer()->SendMailResult(0, MAIL_SEND, MAIL_ERR_TOO_MANY_ATTACHMENTS); recvData.rfinish(); // set to end to avoid warnings spam return; } + + mailbox[0] = recvData.ReadBit(); - uint64 itemGUIDs[MAX_MAIL_ITEMS]; + ObjectGuid itemGUIDs[MAX_MAIL_ITEMS]; for (uint8 i = 0; i < items_count; ++i) { - recvData.read_skip(); // item slot in mail, not used - recvData >> itemGUIDs[i]; + itemGUIDs[i][2] = recvData.ReadBit(); + itemGUIDs[i][6] = recvData.ReadBit(); + itemGUIDs[i][3] = recvData.ReadBit(); + itemGUIDs[i][7] = recvData.ReadBit(); + itemGUIDs[i][1] = recvData.ReadBit(); + itemGUIDs[i][0] = recvData.ReadBit(); + itemGUIDs[i][4] = recvData.ReadBit(); + itemGUIDs[i][5] = recvData.ReadBit(); } - - recvData >> money >> COD; // money and cod - recvData >> unk3; // const 0 - recvData >> unk4; // const 0 - + + mailbox[3] = recvData.ReadBit(); + mailbox[4] = recvData.ReadBit(); + receiverLength = recvData.ReadBits(7); + mailbox[2] = recvData.ReadBit(); + mailbox[6] = recvData.ReadBit(); + mailbox[1] = recvData.ReadBit(); + mailbox[7] = recvData.ReadBit(); + mailbox[5] = recvData.ReadBit(); + + recvData.ReadByteSeq(mailbox[4]); + + for (uint8 i = 0; i < items_count; ++i) + { + recvData.ReadByteSeq(itemGUIDs[i][6]); + recvData.ReadByteSeq(itemGUIDs[i][1]); + recvData.ReadByteSeq(itemGUIDs[i][7]); + recvData.ReadByteSeq(itemGUIDs[i][2]); + recvData.read_skip(); // item slot in mail, not used + recvData.ReadByteSeq(itemGUIDs[i][3]); + recvData.ReadByteSeq(itemGUIDs[i][0]); + recvData.ReadByteSeq(itemGUIDs[i][4]); + recvData.ReadByteSeq(itemGUIDs[i][5]); + } + + recvData.ReadByteSeq(mailbox[7]); + recvData.ReadByteSeq(mailbox[3]); + recvData.ReadByteSeq(mailbox[6]); + recvData.ReadByteSeq(mailbox[5]); + + subject = recvData.ReadString(subjectLength); + receiver = recvData.ReadString(receiverLength); + + recvData.ReadByteSeq(mailbox[2]); + recvData.ReadByteSeq(mailbox[0]); + + body = recvData.ReadString(bodyLength); + + recvData.ReadByteSeq(mailbox[1]); + // packet read complete, now do check if (!GetPlayer()->GetGameObjectIfCanInteractWith(mailbox, GAMEOBJECT_TYPE_MAILBOX)) @@ -89,13 +130,13 @@ void WorldSession::HandleSendMail(WorldPacket & recvData) if (!rc) { - sLog->outDetail("Player %u is sending mail to %s (GUID: not existed!) with subject %s and body %s includes %u items, %u copper and %u COD copper with unk1 = %u, unk2 = %u", + sLog->outDetail("Player %u is sending mail to %s (GUID: not existed!) with subject %s and body %s includes %u items, " UI64FMTD " copper and " UI64FMTD " COD copper with unk1 = %u, unk2 = %u", player->GetGUIDLow(), receiver.c_str(), subject.c_str(), body.c_str(), items_count, money, COD, unk1, unk2); player->SendMailResult(0, MAIL_SEND, MAIL_ERR_RECIPIENT_NOT_FOUND); return; } - sLog->outDetail("Player %u is sending mail to %s (GUID: %u) with subject %s and body %s includes %u items, %u copper and %u COD copper with unk1 = %u, unk2 = %u", player->GetGUIDLow(), receiver.c_str(), GUID_LOPART(rc), subject.c_str(), body.c_str(), items_count, money, COD, unk1, unk2); + sLog->outDetail("Player %u is sending mail to %s (GUID: %u) with subject %s and body %s includes %u items, " UI64FMTD " copper and " UI64FMTD " COD copper with unk1 = %u, unk2 = %u", player->GetGUIDLow(), receiver.c_str(), GUID_LOPART(rc), subject.c_str(), body.c_str(), items_count, money, COD, unk1, unk2); if (player->GetGUID() == rc) { @@ -105,7 +146,7 @@ void WorldSession::HandleSendMail(WorldPacket & recvData) uint32 cost = items_count ? 30 * items_count : 30; // price hardcoded in client - uint64 reqmoney = cost + uint64(money); + uint64 reqmoney = cost + money; if (!player->HasEnoughMoney(reqmoney) && !player->isGameMaster()) { @@ -245,7 +286,7 @@ void WorldSession::HandleSendMail(WorldPacket & recvData) player->SendMailResult(0, MAIL_SEND, MAIL_OK); - player->ModifyMoney(-int32(reqmoney)); + player->ModifyMoney(-int64(reqmoney)); player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_MAIL, cost); bool needItemDelay = false; diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index e10a5bedc74..e2bd02d8d36 100755 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -1679,7 +1679,7 @@ void WorldSession::HandleSetTaxiBenchmarkOpcode(WorldPacket& recvData) sLog->outDebug(LOG_FILTER_NETWORKIO, "Client used \"/timetest %d\" command", mode); } -void WorldSession::HandleQueryInspectAchievements(WorldPacket & recvData) +void WorldSession::HandleQueryInspectAchievements(WorldPacket& recvData) { uint64 guid; recvData.readPackGUID(guid); diff --git a/src/server/game/Handlers/QueryHandler.cpp b/src/server/game/Handlers/QueryHandler.cpp index 16fa39f1257..183d697d45a 100755 --- a/src/server/game/Handlers/QueryHandler.cpp +++ b/src/server/game/Handlers/QueryHandler.cpp @@ -407,7 +407,6 @@ void WorldSession::HandleQuestPOIQuery(WorldPacket& recvData) { uint32 count; recvData >> count; // quest count, max=25 - // 4.3 struct: count, byte, byte, byte, questIds[] if (count >= MAX_QUEST_LOG_SIZE) { diff --git a/src/server/game/Handlers/QuestHandler.cpp b/src/server/game/Handlers/QuestHandler.cpp index 87863dc9561..0fb8f557f13 100755 --- a/src/server/game/Handlers/QuestHandler.cpp +++ b/src/server/game/Handlers/QuestHandler.cpp @@ -79,7 +79,7 @@ void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket & recvData) _player->PlayerTalkClass->SendQuestGiverStatus(questStatus, guid); } -void WorldSession::HandleQuestgiverHelloOpcode(WorldPacket & recvData) +void WorldSession::HandleQuestgiverHelloOpcode(WorldPacket& recvData) { uint64 guid; recvData >> guid; @@ -109,7 +109,7 @@ void WorldSession::HandleQuestgiverHelloOpcode(WorldPacket & recvData) creature->AI()->sGossipHello(_player); } -void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket & recvData) +void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket& recvData) { uint64 guid; uint32 questId; @@ -230,7 +230,7 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket & recvData) _player->PlayerTalkClass->SendCloseGossip(); } -void WorldSession::HandleQuestgiverQueryQuestOpcode(WorldPacket & recvData) +void WorldSession::HandleQuestgiverQueryQuestOpcode(WorldPacket& recvData) { uint64 guid; uint32 questId; @@ -281,7 +281,7 @@ void WorldSession::HandleQuestQueryOpcode(WorldPacket & recvData) _player->PlayerTalkClass->SendQuestQueryResponse(quest); } -void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket & recvData) +void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket& recvData) { uint32 questId, reward; uint64 guid; @@ -760,7 +760,7 @@ void WorldSession::HandleQuestgiverStatusMultipleQuery(WorldPacket& /*recvPacket SendPacket(&data); } -void WorldSession::HandleQueryQuestsCompleted(WorldPacket & /*recvData*/) +void WorldSession::HandleQueryQuestsCompleted(WorldPacket& /*recvData*/) { size_t rew_count = _player->GetRewardedQuestCount(); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index a06296536ff..0da9259cf4a 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -508,29 +508,29 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_RECIPES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_REWARDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_XP, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildQueryXPOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_QUERY_INSPECT_ACHIEVEMENTS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryInspectAchievements ); + DEFINE_OPCODE_HANDLER(CMSG_QUERY_INSPECT_ACHIEVEMENTS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryInspectAchievements ); //DEFINE_OPCODE_HANDLER(CMSG_QUERY_OBJECT_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_QUERY_OBJECT_ROTATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_QUERY_QUESTS_COMPLETED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryQuestsCompleted ); + DEFINE_OPCODE_HANDLER(CMSG_QUERY_QUESTS_COMPLETED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryQuestsCompleted ); //DEFINE_OPCODE_HANDLER(CMSG_QUERY_SERVER_BUCK_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_QUERY_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryTimeOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_QUERY_VEHICLE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_ACCEPT_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverAcceptQuestOpcode); + DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_ACCEPT_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverAcceptQuestOpcode); //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_CANCEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverCancel ); - //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_CHOOSE_REWARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverChooseRewardOpcode); - //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_COMPLETE_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverCompleteQuest ); - //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverHelloOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_QUERY_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverQueryQuestOpcode); + DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_CHOOSE_REWARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverChooseRewardOpcode); + DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_COMPLETE_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverCompleteQuest ); + DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverHelloOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_QUERY_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverQueryQuestOpcode); //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_QUEST_AUTOLAUNCH, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverQuestAutoLaunch ); - //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_REQUEST_REWARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverRequestRewardOpcode); + DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_REQUEST_REWARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverRequestRewardOpcode); DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverStatusMultipleQuery); DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_STATUS_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleQuestgiverStatusQueryOpcode); - //DEFINE_OPCODE_HANDLER(CMSG_QUESTLOG_REMOVE_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestLogRemoveQuest ); + DEFINE_OPCODE_HANDLER(CMSG_QUESTLOG_REMOVE_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestLogRemoveQuest ); //DEFINE_OPCODE_HANDLER(CMSG_QUESTLOG_SWAP_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestLogSwapQuest ); - //DEFINE_OPCODE_HANDLER(CMSG_QUEST_CONFIRM_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestConfirmAccept ); - //DEFINE_OPCODE_HANDLER(CMSG_QUEST_POI_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestPOIQuery ); + DEFINE_OPCODE_HANDLER(CMSG_QUEST_CONFIRM_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestConfirmAccept ); + DEFINE_OPCODE_HANDLER(CMSG_QUEST_POI_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestPOIQuery ); //DEFINE_OPCODE_HANDLER(CMSG_QUEST_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestQueryOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_RANDOMIZE_CHAR_NAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRandomizeCharNameOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_RANDOMIZE_CHAR_NAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRandomizeCharNameOpcode ); DEFINE_OPCODE_HANDLER(CMSG_READY_FOR_ACCOUNT_DATA_TIMES, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleReadyForAccountDataTimes ); DEFINE_OPCODE_HANDLER(CMSG_READ_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReadItem ); DEFINE_OPCODE_HANDLER(CMSG_REALM_SPLIT, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRealmSplitOpcode ); @@ -564,12 +564,12 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_SEARCH_LFG_JOIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfrSearchOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SEARCH_LFG_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfrLeaveOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SELF_RES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSelfResOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_SELL_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSellItemOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_SELL_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSellItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SEND_COMBAT_TRIGGER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SEND_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SEND_GENERAL_TRIGGER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SEND_LOCAL_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SEND_MAIL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSendMail ); + DEFINE_OPCODE_HANDLER(CMSG_SEND_MAIL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSendMail ); //DEFINE_OPCODE_HANDLER(CMSG_SERVERINFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SERVERTIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SERVER_BROADCAST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -1208,7 +1208,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_PVP_QUEUE_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_QUERY_OBJECT_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_QUERY_OBJECT_ROTATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_QUERY_QUESTS_COMPLETED_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUERY_QUESTS_COMPLETED_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_QUERY_TIME_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_OFFER_REWARD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1228,13 +1228,13 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_FAILEDTIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_QUEST_CONFIRM_ACCEPT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_QUEST_FORCE_REMOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_QUEST_POI_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUEST_POI_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_QUEST_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_RAID_GROUP_ONLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_RAID_INSTANCE_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_RAID_INSTANCE_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_RAID_READY_CHECK_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RANDOMIZE_CHAR_NAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_RANDOMIZE_CHAR_NAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_READ_ITEM_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_READ_ITEM_OK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_REALM_SPLIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From 20aad5598919fb703a21ffd42b3be3e2639f791c Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 5 Aug 2012 22:48:56 -0500 Subject: Fixed a compile error --- src/server/game/Handlers/CharacterHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 2087c043845..2edbe907ba7 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -2126,7 +2126,7 @@ void WorldSession::HandleRandomizeCharNameOpcode(WorldPacket& recvData) return; } - std::string* name = GetRandomCharacterName(race, gender); + std::string const* name = GetRandomCharacterName(race, gender); WorldPacket data(SMSG_RANDOMIZE_CHAR_NAME, 10); data.WriteBit(0); // unk data.WriteBits(name->size(), 7); -- cgit v1.2.3 From 8cbfba255decdcfeff9227104c62552662abea0a Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 6 Aug 2012 10:44:36 +0200 Subject: Core/Movement: Some cleanup in spline flags --- src/server/game/Entities/Object/Object.cpp | 8 +- src/server/game/Entities/Unit/Unit.cpp | 2 +- src/server/game/Movement/Spline/MoveSpline.cpp | 2 +- src/server/game/Movement/Spline/MoveSplineFlag.h | 16 ++- src/server/game/Movement/Spline/MoveSplineInit.cpp | 2 +- .../game/Movement/Spline/MovementPacketBuilder.cpp | 75 ++++++++------ .../game/Movement/Spline/MovementPacketBuilder.h | 4 +- src/server/game/Movement/Spline/MovementUtil.cpp | 114 ++++++++++----------- 8 files changed, 113 insertions(+), 110 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 0baec0c2e95..1f859a585e6 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -306,6 +306,7 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const data->WriteBit(flags & UPDATEFLAG_UNK5); data->WriteBit(0); data->WriteBit(flags & UPDATEFLAG_TRANSPORT); + bool fullSpline = false; if (flags & UPDATEFLAG_LIVING) { @@ -349,10 +350,7 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const data->WriteBit(guid[4]); if (self->IsSplineEnabled()) - { - data->WriteBit(1); // Has extended spline data - Movement::PacketBuilder::WriteCreateBits(*self->movespline, *data); - } + Movement::PacketBuilder::WriteCreateBits(*self->movespline, *data, fullSpline); data->WriteBit(guid[6]); if (movementFlagsExtra & MOVEMENTFLAG2_INTERPOLATED_TURNING) @@ -435,7 +433,7 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const *data << float(self->m_movementInfo.splineElevation); if (self->IsSplineEnabled()) - Movement::PacketBuilder::WriteCreateData(*self->movespline, *data); + Movement::PacketBuilder::WriteCreateData(*self->movespline, *data, fullSpline); *data << float(self->GetPositionZMinusOffset()); data->WriteByteSeq(guid[5]); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index a41d5ddaa0c..f8c0142c801 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -18252,5 +18252,5 @@ void Unit::SendMovementCanFlyChange() bool Unit::IsSplineEnabled() const { - return !movespline->Finalized(); + return movespline->Initialized(); } diff --git a/src/server/game/Movement/Spline/MoveSpline.cpp b/src/server/game/Movement/Spline/MoveSpline.cpp index b1c25aedfd7..443946a8376 100644 --- a/src/server/game/Movement/Spline/MoveSpline.cpp +++ b/src/server/game/Movement/Spline/MoveSpline.cpp @@ -214,7 +214,7 @@ bool MoveSplineInitArgs::Validate() const // each vertex offset packed into 11 bytes bool MoveSplineInitArgs::_checkPathBounds() const { - if (!(flags & MoveSplineFlag::Mask_CatmullRom) && path.size() > 2) + if (!(flags & MoveSplineFlag::Catmullrom) && path.size() > 2) { enum{ MAX_OFFSET = (1 << 11) / 2, diff --git a/src/server/game/Movement/Spline/MoveSplineFlag.h b/src/server/game/Movement/Spline/MoveSplineFlag.h index c096d93e268..e6967878167 100644 --- a/src/server/game/Movement/Spline/MoveSplineFlag.h +++ b/src/server/game/Movement/Spline/MoveSplineFlag.h @@ -71,10 +71,8 @@ namespace Movement Mask_Animations = 0xF, // flags that shouldn't be appended into SMSG_MONSTER_MOVE\SMSG_MONSTER_MOVE_TRANSPORT packet, should be more probably Mask_No_Monster_Move = Mask_Final_Facing | Mask_Animations | Done, - // CatmullRom interpolation mode used - Mask_CatmullRom = Catmullrom | Flying, // Unused, not suported flags - Mask_Unused = No_Spline|Enter_Cycle|Frozen|UncompressedPath|Unknown1|Unknown2|Unknown3|Unknown4|Unknown5|Unknown6|Unknown7|Unknown8|Unknown9, + Mask_Unused = No_Spline|Enter_Cycle|Frozen|Unknown1|Unknown2|Unknown3|Unknown4|Unknown5|Unknown6|Unknown7|Unknown8|Unknown9, }; inline uint32& raw() { return (uint32&)*this; } @@ -86,7 +84,7 @@ namespace Movement // Constant interface - bool isSmooth() const { return raw() & Mask_CatmullRom; } + bool isSmooth() const { return raw() & Catmullrom; } bool isLinear() const { return !isSmooth(); } bool isFacing() const { return raw() & Mask_Final_Facing; } @@ -99,14 +97,14 @@ namespace Movement // Not constant interface - void operator &= (uint32 f) { raw() &= f;} - void operator |= (uint32 f) { raw() |= f;} + void operator &= (uint32 f) { raw() &= f; } + void operator |= (uint32 f) { raw() |= f; } - void EnableAnimation(uint8 anim) { raw() = (raw() & ~(Mask_Animations | Falling | Parabolic)) | Animation | anim; } + void EnableAnimation(uint8 anim) { raw() = (raw() & ~(Mask_Animations | Falling | Parabolic)) | Animation | (anim & Mask_Animations); } void EnableParabolic() { raw() = (raw() & ~(Mask_Animations | Falling | Animation)) | Parabolic; } void EnableFalling() { raw() = (raw() & ~(Mask_Animations | Parabolic | Animation)) | Falling; } - void EnableFlying() { raw() = (raw() & ~Catmullrom) | Flying; } - void EnableCatmullRom() { raw() = (raw() & ~Flying) | Catmullrom; } + void EnableFlying() { raw() = Flying; } + void EnableCatmullRom() { raw() = Catmullrom | UncompressedPath; } void EnableFacingPoint() { raw() = (raw() & ~Mask_Final_Facing) | Final_Point; } void EnableFacingAngle() { raw() = (raw() & ~Mask_Final_Facing) | Final_Angle; } void EnableFacingTarget() { raw() = (raw() & ~Mask_Final_Facing) | Final_Target; } diff --git a/src/server/game/Movement/Spline/MoveSplineInit.cpp b/src/server/game/Movement/Spline/MoveSplineInit.cpp index ba5c59c1078..780b341f6f2 100644 --- a/src/server/game/Movement/Spline/MoveSplineInit.cpp +++ b/src/server/game/Movement/Spline/MoveSplineInit.cpp @@ -123,7 +123,7 @@ namespace Movement args.TransformForTransport = unit.GetTransGUID(); // mix existing state into new args.flags.walkmode = unit.m_movementInfo.HasMovementFlag(MOVEMENTFLAG_WALKING); - args.flags.flying = unit.m_movementInfo.HasMovementFlag((MovementFlags)(MOVEMENTFLAG_CAN_FLY|MOVEMENTFLAG_DISABLE_GRAVITY)); + args.flags.flying = unit.m_movementInfo.HasMovementFlag(MovementFlags(MOVEMENTFLAG_CAN_FLY | MOVEMENTFLAG_DISABLE_GRAVITY)); } void MoveSplineInit::SetFacing(const Unit * target) diff --git a/src/server/game/Movement/Spline/MovementPacketBuilder.cpp b/src/server/game/Movement/Spline/MovementPacketBuilder.cpp index 6a3c2ba8eea..19a250f7885 100644 --- a/src/server/game/Movement/Spline/MovementPacketBuilder.cpp +++ b/src/server/game/Movement/Spline/MovementPacketBuilder.cpp @@ -140,8 +140,12 @@ namespace Movement WriteLinearPath(spline, data); } - void PacketBuilder::WriteCreateBits(MoveSpline const& moveSpline, ByteBuffer& data) + void PacketBuilder::WriteCreateBits(MoveSpline const& moveSpline, ByteBuffer& data, bool& fullData) { + fullData = data.WriteBit(!moveSpline.Finalized()); + if (!fullData) + return; + data.WriteBits(uint8(moveSpline.spline.mode()), 2); data.WriteBit(moveSpline.splineflags & (MoveSplineFlag::Parabolic | MoveSplineFlag::Animation)); data.WriteBits(moveSpline.getPath().size(), 22); @@ -176,47 +180,50 @@ namespace Movement data.WriteBits(moveSpline.splineflags.raw(), 25); } - void PacketBuilder::WriteCreateData(MoveSpline const& moveSpline, ByteBuffer& data) + void PacketBuilder::WriteCreateData(MoveSpline const& moveSpline, ByteBuffer& data, bool fullData) { - MoveSplineFlag splineFlags = moveSpline.splineflags; + if (fullData) + { + MoveSplineFlag splineFlags = moveSpline.splineflags; - if ((splineFlags & MoveSplineFlag::Parabolic) && moveSpline.effect_start_time < moveSpline.Duration()) - data << moveSpline.vertical_acceleration; // added in 3.1 + if ((splineFlags & MoveSplineFlag::Parabolic) && moveSpline.effect_start_time < moveSpline.Duration()) + data << moveSpline.vertical_acceleration; // added in 3.1 - data << moveSpline.timePassed(); + data << moveSpline.timePassed(); - if (splineFlags.final_angle) - data << moveSpline.facing.angle; - else if (splineFlags.final_target) - { - ObjectGuid facingGuid = moveSpline.facing.target; - data.WriteByteSeq(facingGuid[5]); - data.WriteByteSeq(facingGuid[3]); - data.WriteByteSeq(facingGuid[7]); - data.WriteByteSeq(facingGuid[1]); - data.WriteByteSeq(facingGuid[6]); - data.WriteByteSeq(facingGuid[4]); - data.WriteByteSeq(facingGuid[2]); - data.WriteByteSeq(facingGuid[0]); - } + if (splineFlags.final_angle) + data << moveSpline.facing.angle; + else if (splineFlags.final_target) + { + ObjectGuid facingGuid = moveSpline.facing.target; + data.WriteByteSeq(facingGuid[5]); + data.WriteByteSeq(facingGuid[3]); + data.WriteByteSeq(facingGuid[7]); + data.WriteByteSeq(facingGuid[1]); + data.WriteByteSeq(facingGuid[6]); + data.WriteByteSeq(facingGuid[4]); + data.WriteByteSeq(facingGuid[2]); + data.WriteByteSeq(facingGuid[0]); + } - uint32 nodes = moveSpline.getPath().size(); - for (uint32 i = 0; i < nodes; ++i) - { - data << float(moveSpline.getPath()[i].z); - data << float(moveSpline.getPath()[i].x); - data << float(moveSpline.getPath()[i].y); - } + uint32 nodes = moveSpline.getPath().size(); + for (uint32 i = 0; i < nodes; ++i) + { + data << float(moveSpline.getPath()[i].z); + data << float(moveSpline.getPath()[i].x); + data << float(moveSpline.getPath()[i].y); + } - if (splineFlags.final_point) - data << moveSpline.facing.f.x << moveSpline.facing.f.z << moveSpline.facing.f.y; + if (splineFlags.final_point) + data << moveSpline.facing.f.x << moveSpline.facing.f.z << moveSpline.facing.f.y; - data << float(1.f); // splineInfo.duration_mod_next; added in 3.1 - data << moveSpline.Duration(); - if (splineFlags & (MoveSplineFlag::Parabolic | MoveSplineFlag::Animation)) - data << moveSpline.effect_start_time; // added in 3.1 + data << float(1.f); // splineInfo.duration_mod_next; added in 3.1 + data << moveSpline.Duration(); + if (splineFlags & (MoveSplineFlag::Parabolic | MoveSplineFlag::Animation)) + data << moveSpline.effect_start_time; // added in 3.1 - data << float(1.f); // splineInfo.duration_mod; added in 3.1 + data << float(1.f); // splineInfo.duration_mod; added in 3.1 + } if (!moveSpline.isCyclic()) { diff --git a/src/server/game/Movement/Spline/MovementPacketBuilder.h b/src/server/game/Movement/Spline/MovementPacketBuilder.h index a6e4e4d5d04..1b8506c5161 100644 --- a/src/server/game/Movement/Spline/MovementPacketBuilder.h +++ b/src/server/game/Movement/Spline/MovementPacketBuilder.h @@ -31,8 +31,8 @@ namespace Movement public: static void WriteMonsterMove(const MoveSpline& mov, WorldPacket& data); - static void WriteCreateBits(MoveSpline const& moveSpline, ByteBuffer& data); - static void WriteCreateData(MoveSpline const& moveSpline, ByteBuffer& data); + static void WriteCreateBits(MoveSpline const& moveSpline, ByteBuffer& data, bool& fullData); + static void WriteCreateData(MoveSpline const& moveSpline, ByteBuffer& data, bool fullData); }; } #endif // TRINITYSERVER_PACKET_BUILDER_H diff --git a/src/server/game/Movement/Spline/MovementUtil.cpp b/src/server/game/Movement/Spline/MovementUtil.cpp index f0ed01c4676..8684ed00627 100644 --- a/src/server/game/Movement/Spline/MovementUtil.cpp +++ b/src/server/game/Movement/Spline/MovementUtil.cpp @@ -100,7 +100,7 @@ namespace Movement #define STR(x) #x - const char * g_MovementFlag_names[]= + const char* g_MovementFlag_names[]= { STR(Forward ),// 0x00000001, STR(Backward ),// 0x00000002, @@ -112,29 +112,29 @@ namespace Movement STR(Pitch_Down ),// 0x00000080, STR(Walk ),// 0x00000100, // Walking - STR(Ontransport ),// 0x00000200, - STR(Levitation ),// 0x00000400, - STR(Root ),// 0x00000800, - STR(Falling ),// 0x00001000, - STR(Fallingfar ),// 0x00002000, - STR(Pendingstop ),// 0x00004000, - STR(PendingSTRafestop ),// 0x00008000, - STR(Pendingforward ),// 0x00010000, - STR(Pendingbackward ),// 0x00020000, - STR(PendingSTRafeleft ),// 0x00040000, - STR(PendingSTRaferight ),// 0x00080000, - STR(Pendingroot ),// 0x00100000, - STR(Swimming ),// 0x00200000, // Appears With Fly Flag Also - STR(Ascending ),// 0x00400000, // Swim Up Also - STR(Descending ),// 0x00800000, // Swim Down Also - STR(Can_Fly ),// 0x01000000, // Can Fly In 3.3? - STR(Flying ),// 0x02000000, // Actual Flying Mode - STR(Spline_Elevation ),// 0x04000000, // Used For Flight Paths - STR(Spline_Enabled ),// 0x08000000, // Used For Flight Paths - STR(Waterwalking ),// 0x10000000, // Prevent Unit From Falling Through Water - STR(Safe_Fall ),// 0x20000000, // Active Rogue Safe Fall Spell (Passive) - STR(Hover ),// 0x40000000 - STR(Unknown13 ),// 0x80000000 + STR(Levitation ),// 0x00000200, + STR(Root ),// 0x00000400, + STR(Falling ),// 0x00000800, + STR(Fallingfar ),// 0x00001000, + STR(Pendingstop ),// 0x00002000, + STR(PendingSTRafestop ),// 0x00004000, + STR(Pendingforward ),// 0x00008000, + STR(Pendingbackward ),// 0x00010000, + STR(PendingSTRafeleft ),// 0x00020000, + STR(PendingSTRaferight ),// 0x00040000, + STR(Pendingroot ),// 0x00080000, + STR(Swimming ),// 0x00100000, // Appears With Fly Flag Also + STR(Ascending ),// 0x00200000, // Swim Up Also + STR(Descending ),// 0x00400000, // Swim Down Also + STR(Can_Fly ),// 0x00800000, // Can Fly In 3.3? + STR(Flying ),// 0x01000000, // Actual Flying Mode + STR(Spline_Elevation ),// 0x02000000, // Used For Flight Paths + STR(Waterwalking ),// 0x04000000, // Prevent Unit From Falling Through Water + STR(Safe_Fall ),// 0x08000000, // Active Rogue Safe Fall Spell (Passive) + STR(Hover ),// 0x10000000 + STR(Local_Dirty ),// 0x20000000 + STR(None31 ),// 0x40000000 + STR(None32 ),// 0x80000000 STR(Unk1 ), STR(Unk2 ), STR(Unk3 ), @@ -155,38 +155,38 @@ namespace Movement const char * g_SplineFlag_names[32]= { - STR(AnimBit1 ),// 0x00000001, - STR(AnimBit2 ),// 0x00000002, - STR(AnimBit3 ),// 0x00000004, - STR(AnimBit4 ),// 0x00000008, - STR(AnimBit5 ),// 0x00000010, - STR(AnimBit6 ),// 0x00000020, - STR(AnimBit7 ),// 0x00000040, - STR(AnimBit8 ),// 0x00000080, - STR(Done ),// 0x00000100, - STR(Falling ),// 0x00000200, // Not Compartible With Trajectory Movement - STR(No_Spline ),// 0x00000400, - STR(Trajectory ),// 0x00000800, // Not Compartible With Fall Movement - STR(Walkmode ),// 0x00001000, - STR(Flying ),// 0x00002000, // Smooth Movement(Catmullrom Interpolation Mode), Flying Animation - STR(Knockback ),// 0x00004000, // Model Orientation Fixed - STR(Final_Point ),// 0x00008000, - STR(Final_Target ),// 0x00010000, - STR(Final_Angle ),// 0x00020000, - STR(Catmullrom ),// 0x00040000, // Used Catmullrom Interpolation Mode - STR(Cyclic ),// 0x00080000, // Movement By Cycled Spline - STR(Enter_Cycle ),// 0x00100000, // Everytime Appears With Cyclic Flag In Monster Move Packet - STR(Animation ),// 0x00200000, // Animationid (0...3), Uint32 Time, Not Compartible With Trajectory And Fall Movement - STR(Unknown4 ),// 0x00400000, // Disables Movement By Path - STR(Unknown5 ),// 0x00800000, - STR(Unknown6 ),// 0x01000000, - STR(Unknown7 ),// 0x02000000, - STR(Unknown8 ),// 0x04000000, - STR(OrientationInversed ),// 0x08000000, // Appears With Runmode Flag, Nodes ),// 1, Handles Orientation - STR(Unknown10 ),// 0x10000000, - STR(Unknown11 ),// 0x20000000, - STR(Unknown12 ),// 0x40000000, - STR(Unknown13 ),// 0x80000000, + STR(AnimBit1 ),// 0x00000001, + STR(AnimBit2 ),// 0x00000002, + STR(AnimBit3 ),// 0x00000004, + STR(AnimBit4 ),// 0x00000008, + STR(Unknown1 ),// 0x00000010, + STR(Done ),// 0x00000020, + STR(Falling ),// 0x00000040, // Not Compartible With Trajectory Movement + STR(No_Spline ),// 0x00000080, + STR(Unknown2 ),// 0x00000100, + STR(Flying ),// 0x00000200, // Smooth Movement(Catmullrom Interpolation Mode), Flying Animation + STR(OrientationFixed ),// 0x00000400, // Model Orientation Fixed + STR(Catmullrom ),// 0x00000800, // Used Catmullrom Interpolation Mode + STR(Cyclic ),// 0x00001000, // Movement By Cycled Spline + STR(Enter_Cycle ),// 0x00002000, // Everytime Appears With Cyclic Flag In Monster Move Packet + STR(Frozen ),// 0x00004000, + STR(TransportEnter ),// 0x00008000 + STR(TransportExit ),// 0x00010000 + STR(Unknown3 ),// 0x00020000, + STR(Unknown4 ),// 0x00040000, + STR(OrientationInversed),// 0x00080000, // Appears With Runmode Flag, Nodes ),// 1, Handles Orientation + STR(Unknown5 ),// 0x00100000, + STR(Walkmode ),// 0x00200000, + STR(UncompressedPath ),// 0x00400000, + STR(Unknown6 ),// 0x00800000, + STR(Animation ),// 0x01000000, // Animationid (0...3), Uint32 Time, Not Compartible With Trajectory And Fall Movement + STR(Parabolic ),// 0x02000000, // Not Compartible With Fall Movement + STR(Final_Point ),// 0x04000000, + STR(Final_Target ),// 0x08000000, + STR(Final_Angle ),// 0x10000000, + STR(Unknown7 ),// 0x20000000, + STR(Unknown8 ),// 0x40000000, + STR(Unknown9 ),// 0x80000000, }; template @@ -202,7 +202,7 @@ namespace Movement std::string MoveSplineFlag::ToString() const { std::string str; - print_flags(raw(),g_SplineFlag_names,str); + print_flags(raw(), g_SplineFlag_names, str); return str; } } -- cgit v1.2.3 From c7799e1694a5369fba3ddaceafc4ede26a8f1af7 Mon Sep 17 00:00:00 2001 From: Subv Date: Mon, 6 Aug 2012 07:05:40 -0500 Subject: Core/PacketIO: Fixed a mistake in SMSG_RANDOMIZE_CHAR_NAME (thk Shauren) --- src/server/game/Handlers/CharacterHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 2edbe907ba7..6ec50493cfc 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -2130,6 +2130,6 @@ void WorldSession::HandleRandomizeCharNameOpcode(WorldPacket& recvData) WorldPacket data(SMSG_RANDOMIZE_CHAR_NAME, 10); data.WriteBit(0); // unk data.WriteBits(name->size(), 7); - data << *name; + data.append(name->c_str(), str->size()); SendPacket(&data); } -- cgit v1.2.3 From 64ada0f560141d3c5643e53b1fcc0f13f91bc37c Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 6 Aug 2012 14:01:09 +0100 Subject: Core: Fix build --- src/server/game/Handlers/CharacterHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 6ec50493cfc..30faf3f569d 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -2130,6 +2130,6 @@ void WorldSession::HandleRandomizeCharNameOpcode(WorldPacket& recvData) WorldPacket data(SMSG_RANDOMIZE_CHAR_NAME, 10); data.WriteBit(0); // unk data.WriteBits(name->size(), 7); - data.append(name->c_str(), str->size()); + data.append(name->c_str(), name->size()); SendPacket(&data); } -- cgit v1.2.3 From 450a6a66c7dc27ea3c0ae1b13436f067adaf5924 Mon Sep 17 00:00:00 2001 From: Kandera Date: Mon, 6 Aug 2012 09:32:35 -0400 Subject: Core/Spells: add name for cast_flag_unknown_2 to cast_flag_has_trajectory --- src/server/game/Spells/Spell.cpp | 2 +- src/server/game/Spells/Spell.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index cbc59e8f740..6fdba447b17 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3854,7 +3854,7 @@ void Spell::SendSpellStart() //sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Sending SMSG_SPELL_START id=%u", m_spellInfo->Id); - uint32 castFlags = CAST_FLAG_UNKNOWN_2; + uint32 castFlags = CAST_FLAG_HAS_TRAJECTORY; if ((IsTriggered() && !m_spellInfo->IsAutoRepeatRangedSpell()) || m_triggeredByAuraSpell) castFlags |= CAST_FLAG_PENDING; diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h index 50510397056..cb9a5fdef4d 100755 --- a/src/server/game/Spells/Spell.h +++ b/src/server/game/Spells/Spell.h @@ -39,7 +39,7 @@ enum SpellCastFlags { CAST_FLAG_NONE = 0x00000000, CAST_FLAG_PENDING = 0x00000001, // aoe combat log? - CAST_FLAG_UNKNOWN_2 = 0x00000002, + CAST_FLAG_HAS_TRAJECTORY = 0x00000002, CAST_FLAG_UNKNOWN_3 = 0x00000004, CAST_FLAG_UNKNOWN_4 = 0x00000008, // ignore AOE visual CAST_FLAG_UNKNOWN_5 = 0x00000010, -- cgit v1.2.3 From 3a0ef1931becad251a3206e7e8525ac24fdb4f50 Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 6 Aug 2012 15:41:23 +0200 Subject: Core/Movement: Verified one more spline flag --- src/server/game/Movement/Spline/MoveSplineFlag.h | 14 ++++++++------ src/server/game/Movement/Spline/MovementUtil.cpp | 4 ++-- 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/server/game/Movement/Spline/MoveSplineFlag.h b/src/server/game/Movement/Spline/MoveSplineFlag.h index e6967878167..92c5b89daf8 100644 --- a/src/server/game/Movement/Spline/MoveSplineFlag.h +++ b/src/server/game/Movement/Spline/MoveSplineFlag.h @@ -35,7 +35,8 @@ namespace Movement public: enum eFlags{ None = 0x00000000, - // x00-xF(first byte) used as animation Ids storage in pair with Animation flag + // x00-x07 used as animation Ids storage in pair with Animation flag + Unknown0 = 0x00000008, // NOT VERIFIED Unknown1 = 0x00000010, // NOT VERIFIED Done = 0x00000020, Falling = 0x00000040, // Affects elevation computation, can't be combined with Parabolic flag @@ -52,7 +53,7 @@ namespace Movement Unknown3 = 0x00020000, // NOT VERIFIED Unknown4 = 0x00040000, // NOT VERIFIED OrientationInversed = 0x00080000, - Unknown5 = 0x00100000, // NOT VERIFIED + SmoothGroundPath = 0x00100000, Walkmode = 0x00200000, UncompressedPath = 0x00400000, Unknown6 = 0x00800000, // NOT VERIFIED @@ -68,11 +69,11 @@ namespace Movement // Masks Mask_Final_Facing = Final_Point | Final_Target | Final_Angle, // animation ids stored here, see AnimType enum, used with Animation flag - Mask_Animations = 0xF, + Mask_Animations = 0x7, // flags that shouldn't be appended into SMSG_MONSTER_MOVE\SMSG_MONSTER_MOVE_TRANSPORT packet, should be more probably Mask_No_Monster_Move = Mask_Final_Facing | Mask_Animations | Done, // Unused, not suported flags - Mask_Unused = No_Spline|Enter_Cycle|Frozen|Unknown1|Unknown2|Unknown3|Unknown4|Unknown5|Unknown6|Unknown7|Unknown8|Unknown9, + Mask_Unused = No_Spline|Enter_Cycle|Frozen|Unknown1|Unknown2|Unknown3|Unknown4|SmoothGroundPath|Unknown6|Unknown7|Unknown8|Unknown9, }; inline uint32& raw() { return (uint32&)*this; } @@ -112,7 +113,8 @@ namespace Movement void EnableTransportExit() { raw() = (raw() & ~TransportEnter) | TransportExit; } void EnableTaxiFlight() { raw() = raw() | Catmullrom | Flying | Walkmode | UncompressedPath; } //4.3.4 0x600A00 - uint8 animId : 4; + uint8 animId : 3; + bool unknown0 : 1; bool unknown1 : 1; bool done : 1; bool falling : 1; @@ -129,7 +131,7 @@ namespace Movement bool unknown3 : 1; bool unknown4 : 1; bool orientationInversed : 1; - bool unknown5 : 1; + bool smoothGroundPath : 1; bool walkmode : 1; bool uncompressedPath : 1; bool unknown6 : 1; diff --git a/src/server/game/Movement/Spline/MovementUtil.cpp b/src/server/game/Movement/Spline/MovementUtil.cpp index 8684ed00627..8343d5420f4 100644 --- a/src/server/game/Movement/Spline/MovementUtil.cpp +++ b/src/server/game/Movement/Spline/MovementUtil.cpp @@ -158,7 +158,7 @@ namespace Movement STR(AnimBit1 ),// 0x00000001, STR(AnimBit2 ),// 0x00000002, STR(AnimBit3 ),// 0x00000004, - STR(AnimBit4 ),// 0x00000008, + STR(Unknown0 ),// 0x00000008, STR(Unknown1 ),// 0x00000010, STR(Done ),// 0x00000020, STR(Falling ),// 0x00000040, // Not Compartible With Trajectory Movement @@ -175,7 +175,7 @@ namespace Movement STR(Unknown3 ),// 0x00020000, STR(Unknown4 ),// 0x00040000, STR(OrientationInversed),// 0x00080000, // Appears With Runmode Flag, Nodes ),// 1, Handles Orientation - STR(Unknown5 ),// 0x00100000, + STR(SmoothGroundPath ),// 0x00100000, STR(Walkmode ),// 0x00200000, STR(UncompressedPath ),// 0x00400000, STR(Unknown6 ),// 0x00800000, -- cgit v1.2.3 From 25e7e6dddd537f12352c493bb3a70e3c393f64a8 Mon Sep 17 00:00:00 2001 From: Subv Date: Mon, 6 Aug 2012 09:47:39 -0500 Subject: Protocol/PacketIO: Enabled more opcodes. --- src/server/game/Handlers/AuctionHouseHandler.cpp | 2 +- src/server/game/Handlers/GroupHandler.cpp | 4 ++-- src/server/game/Handlers/QueryHandler.cpp | 2 +- src/server/game/Handlers/SkillHandler.cpp | 2 +- src/server/game/Server/Protocol/Opcodes.cpp | 16 ++++++++-------- 5 files changed, 13 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp index 33fed32aac9..11b6067e929 100755 --- a/src/server/game/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Handlers/AuctionHouseHandler.cpp @@ -33,7 +33,7 @@ //post-incrementation is always slower than pre-incrementation ! //void called when player click on auctioneer npc -void WorldSession::HandleAuctionHelloOpcode(WorldPacket & recvData) +void WorldSession::HandleAuctionHelloOpcode(WorldPacket& recvData) { uint64 guid; //NPC guid recvData >> guid; diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp index 1a2395605ed..c6870bca98d 100755 --- a/src/server/game/Handlers/GroupHandler.cpp +++ b/src/server/game/Handlers/GroupHandler.cpp @@ -707,7 +707,7 @@ void WorldSession::HandlePartyAssignmentOpcode(WorldPacket & recvData) group->SendUpdate(); } -void WorldSession::HandleRaidReadyCheckOpcode(WorldPacket & recvData) +void WorldSession::HandleRaidReadyCheckOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_RAID_READY_CHECK"); @@ -742,7 +742,7 @@ void WorldSession::HandleRaidReadyCheckOpcode(WorldPacket & recvData) } } -void WorldSession::HandleRaidReadyCheckFinishedOpcode(WorldPacket & /*recvData*/) +void WorldSession::HandleRaidReadyCheckFinishedOpcode(WorldPacket& /*recvData*/) { //Group* group = GetPlayer()->GetGroup(); //if (!group) diff --git a/src/server/game/Handlers/QueryHandler.cpp b/src/server/game/Handlers/QueryHandler.cpp index 183d697d45a..8fac7aa88cc 100755 --- a/src/server/game/Handlers/QueryHandler.cpp +++ b/src/server/game/Handlers/QueryHandler.cpp @@ -213,7 +213,7 @@ void WorldSession::HandleGameObjectQueryOpcode(WorldPacket & recvData) } } -void WorldSession::HandleCorpseQueryOpcode(WorldPacket & /*recvData*/) +void WorldSession::HandleCorpseQueryOpcode(WorldPacket& /*recvData*/) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_CORPSE_QUERY"); diff --git a/src/server/game/Handlers/SkillHandler.cpp b/src/server/game/Handlers/SkillHandler.cpp index bb5942adbbe..bc02822c09d 100755 --- a/src/server/game/Handlers/SkillHandler.cpp +++ b/src/server/game/Handlers/SkillHandler.cpp @@ -74,7 +74,7 @@ void WorldSession::HandleLearnPreviewTalents(WorldPacket& recvPacket) _player->SendTalentsInfoData(false); } -void WorldSession::HandleTalentWipeConfirmOpcode(WorldPacket & recvData) +void WorldSession::HandleTalentWipeConfirmOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "MSG_TALENT_WIPE_CONFIRM"); uint64 guid; diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 0da9259cf4a..e70c8a818a3 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -682,7 +682,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_UPDATE_ACCOUNT_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateAccountData ); //DEFINE_OPCODE_HANDLER(CMSG_UPDATE_MISSILE_TRAJECTORY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateMissileTrajectory ); //DEFINE_OPCODE_HANDLER(CMSG_UPDATE_PROJECTILE_POSITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateProjectilePosition ); - //DEFINE_OPCODE_HANDLER(CMSG_USE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUseItemOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_USE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUseItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_USE_SKILL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_VIOLENCE_LEVEL, STATUS_AUTHED, PROCESS_INPLACE, &WorldSession::HandleViolenceLevel ); DEFINE_OPCODE_HANDLER(CMSG_VOICE_SESSION_ENABLE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleVoiceSessionEnableOpcode ); @@ -701,11 +701,11 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_XP_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_ZONEUPDATE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleZoneUpdateOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_ZONE_MAP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_AUCTION_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionHelloOpcode ); + DEFINE_OPCODE_HANDLER(MSG_AUCTION_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionHelloOpcode ); //DEFINE_OPCODE_HANDLER(MSG_BATTLEGROUND_PLAYER_POSITIONS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlegroundPlayerPositionsOpcode); //DEFINE_OPCODE_HANDLER(MSG_CHANNEL_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_CHANNEL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_CORPSE_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCorpseQueryOpcode ); + DEFINE_OPCODE_HANDLER(MSG_CORPSE_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCorpseQueryOpcode ); //DEFINE_OPCODE_HANDLER(MSG_DELAY_GHOST_TELEPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_DEV_SHOWLABEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_GM_ACCOUNT_ONLINE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -780,24 +780,24 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(MSG_PVP_LOG_DATA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePVPLogDataOpcode ); //DEFINE_OPCODE_HANDLER(MSG_QUERY_GUILD_BANK_TEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryGuildBankTabText ); //DEFINE_OPCODE_HANDLER(MSG_QUERY_NEXT_MAIL_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryNextMailTime ); - //DEFINE_OPCODE_HANDLER(MSG_QUEST_PUSH_RESULT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestPushResult ); - //DEFINE_OPCODE_HANDLER(MSG_RAID_READY_CHECK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidReadyCheckOpcode ); + DEFINE_OPCODE_HANDLER(MSG_QUEST_PUSH_RESULT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestPushResult ); + DEFINE_OPCODE_HANDLER(MSG_RAID_READY_CHECK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidReadyCheckOpcode ); //DEFINE_OPCODE_HANDLER(MSG_RAID_READY_CHECK_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_RAID_READY_CHECK_FINISHED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidReadyCheckFinishedOpcode); + DEFINE_OPCODE_HANDLER(MSG_RAID_READY_CHECK_FINISHED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidReadyCheckFinishedOpcode); //DEFINE_OPCODE_HANDLER(MSG_RAID_TARGET_UPDATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidTargetUpdateOpcode ); //DEFINE_OPCODE_HANDLER(MSG_RANDOM_ROLL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRandomRollOpcode ); //DEFINE_OPCODE_HANDLER(MSG_SAVE_GUILD_EMBLEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSaveGuildEmblemOpcode ); DEFINE_OPCODE_HANDLER(MSG_SET_DUNGEON_DIFFICULTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetDungeonDifficultyOpcode); DEFINE_OPCODE_HANDLER(MSG_SET_RAID_DIFFICULTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetRaidDifficultyOpcode ); DEFINE_OPCODE_HANDLER(MSG_TABARDVENDOR_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTabardVendorActivateOpcode); - //DEFINE_OPCODE_HANDLER(MSG_TALENT_WIPE_CONFIRM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTalentWipeConfirmOpcode ); + DEFINE_OPCODE_HANDLER(MSG_TALENT_WIPE_CONFIRM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTalentWipeConfirmOpcode ); DEFINE_OPCODE_HANDLER(MSG_VERIFY_CONNECTIVITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); //DEFINE_OPCODE_HANDLER(MSG_VIEW_PHASE_SHIFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(SMSG_ACCOUNT_DATA_TIMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ACHIEVEMENT_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ACHIEVEMENT_EARNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ACTION_BUTTONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ACTIVATETAXIREPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ACTIVATETAXIREPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ADDON_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ADD_RUNE_POWER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_AFK_MONITOR_INFO_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From f7d83c1ead360b9f88eb39ea03a4c4b1b9a53f9f Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 6 Aug 2012 15:51:34 +0100 Subject: Core/PacketIO: Enable some gameobject related opcodes --- src/server/game/Server/Protocol/Opcodes.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 0da9259cf4a..8903dc1a477 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -259,8 +259,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_FORCE_MOVE_UNROOT_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveUnRootAck ); //DEFINE_OPCODE_HANDLER(CMSG_FORCE_SAY_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJECT_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleGameObjectQueryOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJ_REPORT_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGameobjectReportUse ); - //DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJ_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGameObjectUseOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJ_REPORT_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGameobjectReportUse ); + DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJ_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGameObjectUseOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GAMESPEED_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GAMETIME_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GETDEATHBINDZONE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -981,11 +981,11 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_FORCE_SEND_QUEUED_PACKETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_FORCE_SET_VEHICLE_REC_ID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_FRIEND_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_CUSTOM_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_DESPAWN_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_PAGETEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_CUSTOM_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_DESPAWN_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_PAGETEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_RESET_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_RESET_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GAMESPEED_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GAMETIMEBIAS_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GAMETIME_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From 89482323b7985cd1e5531e2038fbf2c7524a2945 Mon Sep 17 00:00:00 2001 From: Subv Date: Mon, 6 Aug 2012 10:03:01 -0500 Subject: Protocol/PacketIO: Enabled more opcodes --- src/server/game/Entities/Player/Player.cpp | 6 +++--- src/server/game/Server/Protocol/Opcodes.cpp | 18 +++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 942403065ae..1c40a4f9e0a 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -18136,8 +18136,8 @@ void Player::SendSavedInstances() } } - //Send opcode 811. true or false means, whether you have current raid/heroic instances - data.Initialize(SMSG_UPDATE_INSTANCE_OWNERSHIP); + //Send opcode SMSG_UPDATE_INSTANCE_OWNERSHIP. true or false means, whether you have current raid/heroic instances + data.Initialize(SMSG_UPDATE_INSTANCE_OWNERSHIP, 4); data << uint32(hasBeenSaved); GetSession()->SendPacket(&data); @@ -18150,7 +18150,7 @@ void Player::SendSavedInstances() { if (itr->second.perm) { - data.Initialize(SMSG_UPDATE_LAST_INSTANCE); + data.Initialize(SMSG_UPDATE_LAST_INSTANCE, 4); data << uint32(itr->second.save->GetMapId()); GetSession()->SendPacket(&data); } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index e70c8a818a3..c1e355159d5 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -1361,27 +1361,27 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_THREAT_REMOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_THREAT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TIME_SYNC_REQ, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_TITLE_EARNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TITLE_EARNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TOGGLE_XP_GAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_TOTEM_CREATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TOTEM_CREATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TRADE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TRADE_STATUS_EXTENDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_SUCCEEDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TRAINER_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TRANSFER_ABORTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TRANSFER_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_TRIGGER_CINEMATIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TRIGGER_CINEMATIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TRIGGER_MOVIE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TURN_IN_PETITION_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TUTORIAL_FLAGS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ACCOUNT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ACCOUNT_DATA_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_COMBO_POINTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_INSTANCE_ENCOUNTER_UNIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_INSTANCE_OWNERSHIP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_UPDATE_COMBO_POINTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_UPDATE_INSTANCE_ENCOUNTER_UNIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_UPDATE_INSTANCE_OWNERSHIP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ITEM_ENCHANTMENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_LAST_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_UPDATE_LAST_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_WORLD_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_USERLIST_ADD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1406,7 +1406,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_WHOIS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_WORLD_STATE_UI_TIMER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ZONE_MAP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ZONE_UNDER_ATTACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ZONE_UNDER_ATTACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); #undef DEFINE_OPCODE_HANDLER }; -- cgit v1.2.3 From 0411ba31e0820cc770b0fe25e83cd2de1cd9d020 Mon Sep 17 00:00:00 2001 From: Kandera Date: Mon, 6 Aug 2012 11:24:22 -0400 Subject: Core/NetworkIO: enable more opcodes --- src/server/game/Server/Protocol/Opcodes.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index fdcd42d375a..efb24fe52b0 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -42,22 +42,22 @@ void InitOpcodes() memset(opcodeTable, 0, sizeof(opcodeTable)); - //DEFINE_OPCODE_HANDLER(CMSG_ACCEPT_LEVEL_GRANT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAcceptGrantLevel ); + DEFINE_OPCODE_HANDLER(CMSG_ACCEPT_LEVEL_GRANT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAcceptGrantLevel ); DEFINE_OPCODE_HANDLER(CMSG_ACCEPT_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAcceptTradeOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_ACTIVATETAXI, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleActivateTaxiOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_ACTIVATETAXIEXPRESS, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleActivateTaxiExpressOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_ACTIVATETAXI, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleActivateTaxiOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_ACTIVATETAXIEXPRESS, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleActivateTaxiExpressOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_ACTIVE_PVP_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_ADD_FRIEND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddFriendOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_ADD_IGNORE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddIgnoreOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_ADD_FRIEND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddFriendOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_ADD_IGNORE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddIgnoreOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_ADD_PVP_MEDAL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_ADD_VOICE_IGNORE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_ADVANCE_SPAWN_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_AFK_MONITOR_INFO_CLEAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_AFK_MONITOR_INFO_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_ALTER_APPEARANCE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAlterAppearance ); + DEFINE_OPCODE_HANDLER(CMSG_ALTER_APPEARANCE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAlterAppearance ); DEFINE_OPCODE_HANDLER(CMSG_AREATRIGGER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaTriggerOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_AREA_SPIRIT_HEALER_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaSpiritHealerQueryOpcode); - //DEFINE_OPCODE_HANDLER(CMSG_AREA_SPIRIT_HEALER_QUEUE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaSpiritHealerQueueOpcode); + DEFINE_OPCODE_HANDLER(CMSG_AREA_SPIRIT_HEALER_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaSpiritHealerQueryOpcode); + DEFINE_OPCODE_HANDLER(CMSG_AREA_SPIRIT_HEALER_QUEUE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaSpiritHealerQueueOpcode); //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamAcceptOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_CREATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamDeclineOpcode ); -- cgit v1.2.3 From a83c2ca60a5ce68f7db55faf941bc3a485e21359 Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 6 Aug 2012 17:42:12 +0200 Subject: Core/Movement: Added another researched spline flag --- src/server/game/Entities/Player/Player.cpp | 2 +- src/server/game/Movement/Spline/MoveSpline.cpp | 6 +++--- src/server/game/Movement/Spline/MoveSplineFlag.h | 10 +++++----- src/server/game/Movement/Spline/MoveSplineInit.h | 2 +- src/server/game/Movement/Spline/MovementUtil.cpp | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 1c40a4f9e0a..3f40b0b5346 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -13369,7 +13369,7 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool if (ItemTemplate const* gem = sObjectMgr->GetItemTemplate(pEnchant->GemID)) if (gem->RequiredSkill && GetSkillValue(gem->RequiredSkill) < gem->RequiredSkillRank) return; - + // If we're dealing with a gem inside a prismatic socket we need to check the prismatic socket requirements // rather than the gem requirements itself. If the socket has no color it is a prismatic socket. if ((slot == SOCK_ENCHANTMENT_SLOT || slot == SOCK_ENCHANTMENT_SLOT_2 || slot == SOCK_ENCHANTMENT_SLOT_3) diff --git a/src/server/game/Movement/Spline/MoveSpline.cpp b/src/server/game/Movement/Spline/MoveSpline.cpp index 443946a8376..358c9f406e4 100644 --- a/src/server/game/Movement/Spline/MoveSpline.cpp +++ b/src/server/game/Movement/Spline/MoveSpline.cpp @@ -50,15 +50,15 @@ Location MoveSpline::ComputePosition() const if (splineflags.final_angle) c.orientation = facing.angle; else if (splineflags.final_point) - c.orientation = atan2(facing.f.y-c.y, facing.f.x-c.x); + c.orientation = atan2(facing.f.y - c.y, facing.f.x - c.x); //nothing to do for MoveSplineFlag::Final_Target flag } else { - if (!splineflags.hasFlag(MoveSplineFlag::OrientationFixed|MoveSplineFlag::Falling)) + if (!splineflags.hasFlag(MoveSplineFlag::OrientationFixed | MoveSplineFlag::Falling | MoveSplineFlag::Unknown0)) { Vector3 hermite; - spline.evaluate_derivative(point_Idx,u,hermite); + spline.evaluate_derivative(point_Idx, u, hermite); c.orientation = atan2(hermite.y, hermite.x); } diff --git a/src/server/game/Movement/Spline/MoveSplineFlag.h b/src/server/game/Movement/Spline/MoveSplineFlag.h index 92c5b89daf8..911c43f663e 100644 --- a/src/server/game/Movement/Spline/MoveSplineFlag.h +++ b/src/server/game/Movement/Spline/MoveSplineFlag.h @@ -37,7 +37,7 @@ namespace Movement None = 0x00000000, // x00-x07 used as animation Ids storage in pair with Animation flag Unknown0 = 0x00000008, // NOT VERIFIED - Unknown1 = 0x00000010, // NOT VERIFIED + FallingSlow = 0x00000010, Done = 0x00000020, Falling = 0x00000040, // Affects elevation computation, can't be combined with Parabolic flag No_Spline = 0x00000080, @@ -73,7 +73,7 @@ namespace Movement // flags that shouldn't be appended into SMSG_MONSTER_MOVE\SMSG_MONSTER_MOVE_TRANSPORT packet, should be more probably Mask_No_Monster_Move = Mask_Final_Facing | Mask_Animations | Done, // Unused, not suported flags - Mask_Unused = No_Spline|Enter_Cycle|Frozen|Unknown1|Unknown2|Unknown3|Unknown4|SmoothGroundPath|Unknown6|Unknown7|Unknown8|Unknown9, + Mask_Unused = No_Spline|Enter_Cycle|Frozen|Unknown0|FallingSlow|Unknown2|Unknown3|Unknown4|SmoothGroundPath|Unknown6|Unknown7|Unknown8|Unknown9, }; inline uint32& raw() { return (uint32&)*this; } @@ -101,8 +101,8 @@ namespace Movement void operator &= (uint32 f) { raw() &= f; } void operator |= (uint32 f) { raw() |= f; } - void EnableAnimation(uint8 anim) { raw() = (raw() & ~(Mask_Animations | Falling | Parabolic)) | Animation | (anim & Mask_Animations); } - void EnableParabolic() { raw() = (raw() & ~(Mask_Animations | Falling | Animation)) | Parabolic; } + void EnableAnimation(uint8 anim) { raw() = (raw() & ~(Mask_Animations | Falling | Parabolic | FallingSlow)) | Animation | (anim & Mask_Animations); } + void EnableParabolic() { raw() = (raw() & ~(Mask_Animations | Falling | Animation | FallingSlow)) | Parabolic; } void EnableFalling() { raw() = (raw() & ~(Mask_Animations | Parabolic | Animation)) | Falling; } void EnableFlying() { raw() = Flying; } void EnableCatmullRom() { raw() = Catmullrom | UncompressedPath; } @@ -115,7 +115,7 @@ namespace Movement uint8 animId : 3; bool unknown0 : 1; - bool unknown1 : 1; + bool fallingSlow : 1; bool done : 1; bool falling : 1; bool no_spline : 1; diff --git a/src/server/game/Movement/Spline/MoveSplineInit.h b/src/server/game/Movement/Spline/MoveSplineInit.h index 459bb851aa3..ef60111ef30 100644 --- a/src/server/game/Movement/Spline/MoveSplineInit.h +++ b/src/server/game/Movement/Spline/MoveSplineInit.h @@ -154,7 +154,7 @@ namespace Movement inline void MoveSplineInit::SetOrientationInversed() { args.flags.orientationInversed = true;} inline void MoveSplineInit::SetTransportEnter() { args.flags.EnableTransportEnter(); } inline void MoveSplineInit::SetTransportExit() { args.flags.EnableTransportExit(); } - inline void MoveSplineInit::SetOrientationFixed(bool enable) { args.flags.orientationFixed = enable;} + inline void MoveSplineInit::SetOrientationFixed(bool enable) { args.flags.orientationFixed = enable; } inline void MoveSplineInit::MovebyPath(const PointsArray& controls, int32 path_offset) { diff --git a/src/server/game/Movement/Spline/MovementUtil.cpp b/src/server/game/Movement/Spline/MovementUtil.cpp index 8343d5420f4..d0582baa7f9 100644 --- a/src/server/game/Movement/Spline/MovementUtil.cpp +++ b/src/server/game/Movement/Spline/MovementUtil.cpp @@ -159,7 +159,7 @@ namespace Movement STR(AnimBit2 ),// 0x00000002, STR(AnimBit3 ),// 0x00000004, STR(Unknown0 ),// 0x00000008, - STR(Unknown1 ),// 0x00000010, + STR(FallingSlow ),// 0x00000010, STR(Done ),// 0x00000020, STR(Falling ),// 0x00000040, // Not Compartible With Trajectory Movement STR(No_Spline ),// 0x00000080, -- cgit v1.2.3 From b6206866417c83380a447c05221bc6d2796269af Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 6 Aug 2012 18:06:48 +0200 Subject: Compile fix for noob compilers --- src/server/scripts/Commands/cs_modify.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index fba1a9835f5..e602c490f8f 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -1027,7 +1027,7 @@ public: handler->PSendSysMessage(LANG_YOU_TAKE_MONEY, abs(addmoney), handler->GetNameLink(target).c_str()); if (handler->needReportToTarget(target)) - (ChatHandler(target)).PSendSysMessage(LANG_YOURS_MONEY_TAKEN, handler->GetNameLink().c_str(), abs(addmoney)); + (ChatHandler(target)).PSendSysMessage(LANG_YOURS_MONEY_TAKEN, handler->GetNameLink().c_str(), llabs(addmoney)); target->SetMoney(newmoney); } } -- cgit v1.2.3 From 81fc922b2ee239e88a4fb1a7ea16241937eb9d42 Mon Sep 17 00:00:00 2001 From: Kandera Date: Mon, 6 Aug 2012 12:20:00 -0400 Subject: Core/Commands: change .modify money to only use int32 --- src/server/scripts/Commands/cs_modify.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index e602c490f8f..44b73c30a1b 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -1003,7 +1003,7 @@ public: if (handler->HasLowerSecurity(target, 0)) return false; - int64 addmoney = atoll((char*)args); + int32 addmoney = atoi((char*)args); uint64 moneyuser = target->GetMoney(); @@ -1027,7 +1027,7 @@ public: handler->PSendSysMessage(LANG_YOU_TAKE_MONEY, abs(addmoney), handler->GetNameLink(target).c_str()); if (handler->needReportToTarget(target)) - (ChatHandler(target)).PSendSysMessage(LANG_YOURS_MONEY_TAKEN, handler->GetNameLink().c_str(), llabs(addmoney)); + (ChatHandler(target)).PSendSysMessage(LANG_YOURS_MONEY_TAKEN, handler->GetNameLink().c_str(), abs(addmoney)); target->SetMoney(newmoney); } } -- cgit v1.2.3 From 9795498488852cedd83b0378e85a80ece46aa72f Mon Sep 17 00:00:00 2001 From: Kandera Date: Mon, 6 Aug 2012 13:55:35 -0400 Subject: Core/Commands: missing change from previous commit --- src/server/scripts/Commands/cs_modify.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index 44b73c30a1b..d7b5484ed64 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -1040,7 +1040,7 @@ public: if (addmoney >=MAX_MONEY_AMOUNT) target->SetMoney(MAX_MONEY_AMOUNT); else - target->ModifyMoney(addmoney); + target->ModifyMoney(int64(addmoney)); } sLog->outDetail(handler->GetTrinityString(LANG_NEW_MONEY), moneyuser, uint32(addmoney), target->GetMoney()); -- cgit v1.2.3 From b72373f1ee45507c51e275cad185086be2d95655 Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 6 Aug 2012 19:11:30 +0100 Subject: Core/Creature: Add basehp3 to creature_classlevelstats --- sql/updates/world/2012_08_06_00_world_classlevelstats.sql | 7 +++++++ src/server/game/Entities/Creature/Creature.h | 4 ---- src/server/game/Globals/ObjectMgr.cpp | 6 +++--- src/server/game/Miscellaneous/SharedDefines.h | 2 +- src/server/scripts/Commands/cs_debug.cpp | 2 +- 5 files changed, 12 insertions(+), 9 deletions(-) create mode 100644 sql/updates/world/2012_08_06_00_world_classlevelstats.sql (limited to 'src') diff --git a/sql/updates/world/2012_08_06_00_world_classlevelstats.sql b/sql/updates/world/2012_08_06_00_world_classlevelstats.sql new file mode 100644 index 00000000000..e6038374508 --- /dev/null +++ b/sql/updates/world/2012_08_06_00_world_classlevelstats.sql @@ -0,0 +1,7 @@ +ALTER TABLE `creature_classlevelstats` ADD `basehp3` smallint(6) NOT NULL DEFAULT '1' AFTER `basehp2`; + +ALTER TABLE `creature_classlevelstats` CHANGE `basehp0` `basehp0` smallint(6) NOT NULL DEFAULT '1'; +ALTER TABLE `creature_classlevelstats` CHANGE `basehp1` `basehp1` smallint(6) NOT NULL DEFAULT '1'; +ALTER TABLE `creature_classlevelstats` CHANGE `basehp2` `basehp2` smallint(6) NOT NULL DEFAULT '1'; +ALTER TABLE `creature_classlevelstats` CHANGE `basemana` `basemana` smallint(6) NOT NULL DEFAULT '1'; +ALTER TABLE `creature_classlevelstats` CHANGE `basearmor` `basearmor` smallint(6) NOT NULL DEFAULT '1'; diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index 1824e2c1b44..dc1cee2e28f 100755 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -177,10 +177,6 @@ struct CreatureTemplate // Benchmarked: Faster than std::map (insert/find) typedef UNORDERED_MAP CreatureTemplateContainer; -// Represents max amount of expansions. -// TODO: Update to Cata, if required -#define MAX_CREATURE_BASE_HP MAX_EXPANSION - 1 - // Defines base stats for creatures (used to calculate HP/mana/armor). struct CreatureBaseStats { diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 7c337f22ca0..2bb0b509e93 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -859,13 +859,13 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo) const_cast(cInfo)->scale = 1.0f; } - if (cInfo->expansion > MAX_EXPANSION) + if (cInfo->expansion > MAX_CREATURE_BASE_HP) { sLog->outErrorDb("Table `creature_template` lists creature (Entry: %u) with `exp` %u. Ignored and set to 0.", cInfo->Entry, cInfo->expansion); const_cast(cInfo)->expansion = 0; } - if (cInfo->expansionUnknown > MAX_EXPANSION) + if (cInfo->expansionUnknown > MAX_CREATURE_BASE_HP) { sLog->outErrorDb("Table `creature_template` lists creature (Entry: %u) with `exp_unk` %u. Ignored and set to 0.", cInfo->Entry, cInfo->expansionUnknown); const_cast(cInfo)->expansionUnknown = 0; @@ -8489,7 +8489,7 @@ void ObjectMgr::LoadCreatureClassLevelStats() { uint32 oldMSTime = getMSTime(); - QueryResult result = WorldDatabase.Query("SELECT level, class, basehp0, basehp1, basehp2, basemana, basearmor FROM creature_classlevelstats"); + QueryResult result = WorldDatabase.Query("SELECT level, class, basehp0, basehp1, basehp2, basehp3, basemana, basearmor FROM creature_classlevelstats"); if (!result) { diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index bd3fffe47e4..13225985644 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -22,7 +22,7 @@ #include "Define.h" #include -#define MAX_EXPANSION 4 +#define MAX_CREATURE_BASE_HP 4 enum SpellEffIndex { diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index 874c7ab81b0..c6bbe883a0e 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -1325,7 +1325,7 @@ public: { Player* player = handler->GetSession()->GetPlayer(); - sLog->outSQLDev("(@PATH, XX, %.3f, %.3f, %.5f, 0,0, 0,100, 0),", player->GetPositionX(), player->GetPositionY(), player->GetPositionZ()); + sLog->outSQLDev("(@PATH, XX, %.3f, %.3f, %.5f, 0, 0, 0, 100, 0),", player->GetPositionX(), player->GetPositionY(), player->GetPositionZ()); handler->PSendSysMessage("Waypoint SQL written to SQL Developer log"); return true; -- cgit v1.2.3 From 4d8b06d0bdf691ed81e0ba417ab4d2486702f0dd Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 6 Aug 2012 19:21:04 +0100 Subject: DB/Schema: Change basehp/mana/armor in creature_classlevelstatus to unsigned mediumint There's no reason to be cheap... --- sql/updates/world/2012_08_06_01_world_classlevelstats.sql | 6 ++++++ src/server/game/Globals/ObjectMgr.cpp | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 sql/updates/world/2012_08_06_01_world_classlevelstats.sql (limited to 'src') diff --git a/sql/updates/world/2012_08_06_01_world_classlevelstats.sql b/sql/updates/world/2012_08_06_01_world_classlevelstats.sql new file mode 100644 index 00000000000..6fe7ad67994 --- /dev/null +++ b/sql/updates/world/2012_08_06_01_world_classlevelstats.sql @@ -0,0 +1,6 @@ +ALTER TABLE `creature_classlevelstats` CHANGE `basehp0` `basehp0` mediumint(8) unsigned NOT NULL DEFAULT '1'; +ALTER TABLE `creature_classlevelstats` CHANGE `basehp1` `basehp1` mediumint(8) unsigned NOT NULL DEFAULT '1'; +ALTER TABLE `creature_classlevelstats` CHANGE `basehp2` `basehp2` mediumint(8) unsigned NOT NULL DEFAULT '1'; +ALTER TABLE `creature_classlevelstats` CHANGE `basehp3` `basehp3` mediumint(8) unsigned NOT NULL DEFAULT '1'; +ALTER TABLE `creature_classlevelstats` CHANGE `basemana` `basemana` mediumint(8) unsigned NOT NULL DEFAULT '1'; +ALTER TABLE `creature_classlevelstats` CHANGE `basearmor` `basearmor` mediumint(8) unsigned NOT NULL DEFAULT '1'; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 2bb0b509e93..24e307482ff 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -8509,10 +8509,10 @@ void ObjectMgr::LoadCreatureClassLevelStats() CreatureBaseStats stats; for (uint8 i = 0; i < MAX_CREATURE_BASE_HP; ++i) - stats.BaseHealth[i] = fields[i + 2].GetInt16(); + stats.BaseHealth[i] = fields[i + 2].GetUInt32(); - stats.BaseMana = fields[5].GetInt16(); - stats.BaseArmor = fields[6].GetInt16(); + stats.BaseMana = fields[5].GetUInt32(); + stats.BaseArmor = fields[6].GetUInt32(); if (!Class || ((1 << (Class - 1)) & CLASSMASK_ALL_CREATURES) == 0) sLog->outErrorDb("Creature base stats for level %u has invalid class %u", Level, Class); -- cgit v1.2.3 From eb0d8f285427f87266d6d4869d3667137561f6c3 Mon Sep 17 00:00:00 2001 From: Kandera Date: Mon, 6 Aug 2012 14:29:31 -0400 Subject: Protocol/PacketIO: enable more opcodes and add one opcode number --- src/server/game/Server/Protocol/Opcodes.cpp | 39 ++++++++++++++--------------- src/server/game/Server/Protocol/Opcodes.h | 2 +- 2 files changed, 20 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index efb24fe52b0..fe72ee8174d 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -428,7 +428,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_WHISPER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_YELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_MINIGAME_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MOUNTSPECIAL_ANIM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMountSpecialAnimOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MOUNTSPECIAL_ANIM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMountSpecialAnimOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_CHARACTER_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_CHARM_PORT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_MOVE_CHNG_TRANSPORT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); @@ -1003,7 +1003,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_GM_MESSAGECHAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GM_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GM_TICKET_STATUS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GODMODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GODMODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GOGOGO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GOSSIP_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GOSSIP_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1118,7 +1118,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_MONSTER_MOVE_TRANSPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOTD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOUNTRESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOUNTSPECIAL_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOUNTSPECIAL_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_CHARACTER_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_GRAVITY_DISABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_GRAVITY_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1164,7 +1164,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_PARTY_MEMBER_STATS_FULL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PAUSE_MIRROR_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PERIODICAURALOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PETGODMODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PETGODMODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PETITION_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PETITION_SHOWLIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PETITION_SHOW_SIGNATURES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1239,7 +1239,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_READ_ITEM_OK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_REALM_SPLIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_REAL_GROUP_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RECEIVED_MAIL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_RECEIVED_MAIL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_REDIRECT_CLIENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_REFER_A_FRIEND_EXPIRED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_REFER_A_FRIEND_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1302,7 +1302,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_SPELL_GO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPELL_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELL_UPDATE_CHAIN_TARGETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPIRIT_HEALER_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPIRIT_HEALER_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_COLLISION_DISABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_COLLISION_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_GRAVITY_DISABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1343,23 +1343,22 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_STABLE_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_STANDSTATE_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_START_MIRROR_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_STOP_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_STOP_MIRROR_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SUMMON_CANCEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SUMMON_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SUPERCEDED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_STANDSTATE_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_START_MIRROR_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_STOP_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_STOP_MIRROR_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SUMMON_CANCEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SUMMON_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SUPERCEDED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SUSPEND_COMMS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TALENTS_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TALENTS_INVOLUNTARILY_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_TALENTS_INVOLUNTARILY_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_TAXINODE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TAXINODE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TEST_DROP_RATE_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_TEXT_EMOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_THREAT_CLEAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_THREAT_REMOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_THREAT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TEXT_EMOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_THREAT_CLEAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_THREAT_REMOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_THREAT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TIME_SYNC_REQ, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TITLE_EARNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TOGGLE_XP_GAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1372,7 +1371,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_TRANSFER_ABORTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TRANSFER_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TRIGGER_CINEMATIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_TRIGGER_MOVIE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TRIGGER_MOVIE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TURN_IN_PETITION_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TUTORIAL_FLAGS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ACCOUNT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 02be8f6b051..0dc53cc1c1c 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -1366,7 +1366,7 @@ enum Opcodes SMSG_TRANSFER_ABORTED = 0x0537, SMSG_TRANSFER_PENDING = 0x18A6, SMSG_TRIGGER_CINEMATIC = 0x6C27, - SMSG_TRIGGER_MOVIE = 0x0000, + SMSG_TRIGGER_MOVIE = 0x4625, SMSG_TURN_IN_PETITION_RESULTS = 0x0F07, SMSG_TUTORIAL_FLAGS = 0x0B35, SMSG_UNIT_HEALTH_FREQUENT = 0x2C26, -- cgit v1.2.3 From 7637481909f8d7fa4867f6eb55aa54e176ca4178 Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 6 Aug 2012 19:50:29 +0100 Subject: Core/PacketIO: Enable duel related opcodes --- src/server/game/Server/Protocol/Opcodes.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index fe72ee8174d..fa6a77bf6de 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -235,8 +235,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_DISMISS_CONTROLLED_VEHICLE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDismissControlledVehicle ); //DEFINE_OPCODE_HANDLER(CMSG_DISMISS_CRITTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDismissCritter ); //DEFINE_OPCODE_HANDLER(CMSG_DROP_NEW_CONNECTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_DUEL_ACCEPTED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDuelAcceptedOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_DUEL_CANCELLED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDuelCancelledOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_DUEL_ACCEPTED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDuelAcceptedOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_DUEL_CANCELLED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDuelCancelledOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_DUMP_OBJECTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEmoteOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_ENABLETAXI, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleTaxiQueryAvailableNodes ); @@ -950,12 +950,12 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_DISMOUNT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DISMOUNTRESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DISPEL_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DUEL_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DUEL_COUNTDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DUEL_INBOUNDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DUEL_OUTOFBOUNDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DUEL_REQUESTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DUEL_WINNER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_DUEL_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_DUEL_COUNTDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_DUEL_INBOUNDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_DUEL_OUTOFBOUNDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_DUEL_REQUESTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_DUEL_WINNER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DUMP_OBJECTS_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DURABILITY_DAMAGE_DEATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DYNAMIC_DROP_ROLL_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From f6fce43a646f1a14da4b1599e1761e07f0934d25 Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 6 Aug 2012 20:08:04 +0100 Subject: Core/PacketIO: Fix structure of CMSG_RANDOMIZE_CHAR_NAME --- src/server/game/Handlers/CharacterHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 30faf3f569d..41ae8659b07 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -2111,8 +2111,8 @@ void WorldSession::HandleRandomizeCharNameOpcode(WorldPacket& recvData) { uint8 gender, race; - recvData >> gender; recvData >> race; + recvData >> gender; if (!Player::IsValidRace(race)) { -- cgit v1.2.3 From 7770c820979ef1f49e8b5056efb780cd676e66c8 Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 6 Aug 2012 23:00:57 +0200 Subject: Core/Items: Finished reforging (mostly by subv) --- src/server/game/DataStores/DBCStructure.h | 4 +- src/server/game/Entities/Item/Item.cpp | 65 ++++++- src/server/game/Entities/Item/Item.h | 2 + src/server/game/Entities/Player/Player.cpp | 274 ++++++++++++++++++++++++++++- src/server/game/Entities/Player/Player.h | 1 + src/server/game/Handlers/ItemHandler.cpp | 18 +- src/server/scripts/Spells/spell_rogue.cpp | 3 + 7 files changed, 355 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 6cb013bec50..5e841a2f78b 100755 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -1204,10 +1204,10 @@ struct ItemPriceBaseEntry struct ItemReforgeEntry { uint32 Id; - uint32 FinalStat; - float FinalMultiplier; uint32 SourceStat; float SourceMultiplier; + uint32 FinalStat; + float FinalMultiplier; }; // common struct for: diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index f0cd629b5e3..3dae2aa581c 100755 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -644,8 +644,8 @@ void Item::SetItemRandomProperties(int32 randomPropId) SetInt32Value(ITEM_FIELD_RANDOM_PROPERTIES_ID, item_rand->ID); SetState(ITEM_CHANGED, GetOwner()); } - for (uint32 i = PROP_ENCHANTMENT_SLOT_2; i < PROP_ENCHANTMENT_SLOT_2 + 3; ++i) - SetEnchantment(EnchantmentSlot(i), item_rand->enchant_id[i - PROP_ENCHANTMENT_SLOT_2], 0, 0); + for (uint32 i = PROP_ENCHANTMENT_SLOT_1; i < PROP_ENCHANTMENT_SLOT_1 + 3; ++i) + SetEnchantment(EnchantmentSlot(i), item_rand->enchant_id[i - PROP_ENCHANTMENT_SLOT_1], 0, 0); } } else @@ -661,7 +661,7 @@ void Item::SetItemRandomProperties(int32 randomPropId) SetState(ITEM_CHANGED, GetOwner()); } - for (uint32 i = PROP_ENCHANTMENT_SLOT_0; i < PROP_ENCHANTMENT_SLOT_0 + 3; ++i) + for (uint32 i = PROP_ENCHANTMENT_SLOT_0; i <= PROP_ENCHANTMENT_SLOT_4; ++i) SetEnchantment(EnchantmentSlot(i), item_rand->enchant_id[i - PROP_ENCHANTMENT_SLOT_0], 0, 0); } } @@ -781,10 +781,15 @@ bool Item::HasEnchantRequiredSkill(const Player* player) const { // Check all enchants for required skill for (uint32 enchant_slot = PERM_ENCHANTMENT_SLOT; enchant_slot < MAX_ENCHANTMENT_SLOT; ++enchant_slot) + { + if (enchant_slot > PRISMATIC_ENCHANTMENT_SLOT || enchant_slot < PROP_ENCHANTMENT_SLOT_0) // not holding enchantment id + continue; + if (uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot))) if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id)) if (enchantEntry->requiredSkill && player->GetSkillValue(enchantEntry->requiredSkill) < enchantEntry->requiredSkillValue) return false; + } return true; } @@ -795,10 +800,15 @@ uint32 Item::GetEnchantRequiredLevel() const // Check all enchants for required level for (uint32 enchant_slot = PERM_ENCHANTMENT_SLOT; enchant_slot < MAX_ENCHANTMENT_SLOT; ++enchant_slot) + { + if (enchant_slot > PRISMATIC_ENCHANTMENT_SLOT || enchant_slot < PROP_ENCHANTMENT_SLOT_0) // not holding enchantment id + continue; + if (uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot))) if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id)) if (enchantEntry->requiredLevel > level) level = enchantEntry->requiredLevel; + } return level; } @@ -807,10 +817,16 @@ bool Item::IsBoundByEnchant() const { // Check all enchants for soulbound for (uint32 enchant_slot = PERM_ENCHANTMENT_SLOT; enchant_slot < MAX_ENCHANTMENT_SLOT; ++enchant_slot) + { + if (enchant_slot > PRISMATIC_ENCHANTMENT_SLOT || enchant_slot < PROP_ENCHANTMENT_SLOT_0) // not holding enchantment id + continue; + if (uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot))) if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id)) if (enchantEntry->slot & ENCHANTMENT_CAN_SOULBOUND) return true; + } + return false; } @@ -1458,3 +1474,46 @@ uint32 Item::GetSpecialPrice(uint32 minimumPrice) const return cost; } + +int32 Item::GetReforgableStat(ItemModType statType) const +{ + ItemTemplate const* proto = GetTemplate(); + for (uint32 i = 0; i < MAX_ITEM_PROTO_STATS; ++i) + if (proto->ItemStat[i].ItemStatType == statType) + return proto->ItemStat[i].ItemStatValue; + + int32 randomPropId = GetItemRandomPropertyId(); + if (!randomPropId) + return 0; + + if (randomPropId < 0) + { + ItemRandomSuffixEntry const* randomSuffix = sItemRandomSuffixStore.LookupEntry(-randomPropId); + if (!randomSuffix) + return 0; + + for (uint32 e = PROP_ENCHANTMENT_SLOT_0; e <= PROP_ENCHANTMENT_SLOT_4; ++e) + if (SpellItemEnchantmentEntry const* enchant = sSpellItemEnchantmentStore.LookupEntry(GetEnchantmentId(EnchantmentSlot(e)))) + for (uint32 f = 0; f < MAX_ITEM_ENCHANTMENT_EFFECTS; ++f) + if (enchant->type[f] == ITEM_ENCHANTMENT_TYPE_STAT && enchant->spellid[f] == statType) + for (int k = 0; k < 5; ++k) + if (randomSuffix->enchant_id[k] == enchant->ID) + return int32((randomSuffix->prefix[k] * GetItemSuffixFactor()) / 10000); + } + else + { + ItemRandomPropertiesEntry const* randomProp = sItemRandomPropertiesStore.LookupEntry(randomPropId); + if (!randomProp) + return 0; + + for (uint32 e = PROP_ENCHANTMENT_SLOT_0; e <= PROP_ENCHANTMENT_SLOT_4; ++e) + if (SpellItemEnchantmentEntry const* enchant = sSpellItemEnchantmentStore.LookupEntry(GetEnchantmentId(EnchantmentSlot(e)))) + for (uint32 f = 0; f < MAX_ITEM_ENCHANTMENT_EFFECTS; ++f) + if (enchant->type[f] == ITEM_ENCHANTMENT_TYPE_STAT && enchant->spellid[f] == statType) + for (int k = 0; k < MAX_ITEM_ENCHANTMENT_EFFECTS; ++k) + if (randomProp->enchant_id[k] == enchant->ID) + return int32(enchant->amount[k]); + } + + return 0; +} diff --git a/src/server/game/Entities/Item/Item.h b/src/server/game/Entities/Item/Item.h index e8bf234c591..5b86d55f170 100755 --- a/src/server/game/Entities/Item/Item.h +++ b/src/server/game/Entities/Item/Item.h @@ -361,6 +361,8 @@ class Item : public Object uint32 GetSellPrice(bool& success) const; + int32 GetReforgableStat(ItemModType statType) const; + private: std::string m_text; uint8 m_slot; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 3f40b0b5346..412e136d8d2 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -8423,6 +8423,9 @@ void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32 // item combat enchantments for (uint8 e_slot = 0; e_slot < MAX_ENCHANTMENT_SLOT; ++e_slot) { + if (e_slot > PRISMATIC_ENCHANTMENT_SLOT || e_slot < PROP_ENCHANTMENT_SLOT_0) // not holding enchantment id + continue; + uint32 enchant_id = item->GetEnchantmentId(EnchantmentSlot(e_slot)); SpellItemEnchantmentEntry const* pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id); if (!pEnchant) @@ -8545,6 +8548,9 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8 // Item enchantments spells casted at use for (uint8 e_slot = 0; e_slot < MAX_ENCHANTMENT_SLOT; ++e_slot) { + if (e_slot > PRISMATIC_ENCHANTMENT_SLOT || e_slot < PROP_ENCHANTMENT_SLOT_0) // not holding enchantment id + continue; + uint32 enchant_id = item->GetEnchantmentId(EnchantmentSlot(e_slot)); SpellItemEnchantmentEntry const* pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id); if (!pEnchant) @@ -13240,6 +13246,9 @@ void Player::AddEnchantmentDurations(Item* item) { for (int x = 0; x < MAX_ENCHANTMENT_SLOT; ++x) { + if (x > PRISMATIC_ENCHANTMENT_SLOT || x < PROP_ENCHANTMENT_SLOT_0) // not holding enchantment id + continue; + if (!item->GetEnchantmentId(EnchantmentSlot(x))) continue; @@ -13334,10 +13343,257 @@ void Player::AddEnchantmentDuration(Item* item, EnchantmentSlot slot, uint32 dur } } +void Player::ApplyReforgeEnchantment(Item* item, bool apply) +{ + if (!item) + return; + + ItemReforgeEntry const* reforge = sItemReforgeStore.LookupEntry(item->GetEnchantmentId(REFORGE_ENCHANTMENT_SLOT)); + if (!reforge) + return; + + ItemTemplate const* proto = item->GetTemplate(); + + float removeValue = item->GetReforgableStat(ItemModType(reforge->SourceStat)) * reforge->SourceMultiplier; + float addValue = removeValue * reforge->FinalMultiplier; + + switch (reforge->SourceStat) + { + case ITEM_MOD_MANA: + HandleStatModifier(UNIT_MOD_MANA, BASE_VALUE, -removeValue, apply); + break; + case ITEM_MOD_HEALTH: + HandleStatModifier(UNIT_MOD_HEALTH, BASE_VALUE, -removeValue, apply); + break; + case ITEM_MOD_AGILITY: + HandleStatModifier(UNIT_MOD_STAT_AGILITY, TOTAL_VALUE, -removeValue, apply); + ApplyStatBuffMod(STAT_AGILITY, -removeValue, apply); + break; + case ITEM_MOD_STRENGTH: + HandleStatModifier(UNIT_MOD_STAT_STRENGTH, TOTAL_VALUE, -removeValue, apply); + ApplyStatBuffMod(STAT_STRENGTH, -removeValue, apply); + break; + case ITEM_MOD_INTELLECT: + HandleStatModifier(UNIT_MOD_STAT_INTELLECT, TOTAL_VALUE, -removeValue, apply); + ApplyStatBuffMod(STAT_INTELLECT, -removeValue, apply); + break; + case ITEM_MOD_SPIRIT: + HandleStatModifier(UNIT_MOD_STAT_SPIRIT, TOTAL_VALUE, -removeValue, apply); + ApplyStatBuffMod(STAT_SPIRIT, -removeValue, apply); + break; + case ITEM_MOD_STAMINA: + HandleStatModifier(UNIT_MOD_STAT_STAMINA, TOTAL_VALUE, -removeValue, apply); + ApplyStatBuffMod(STAT_STAMINA, -removeValue, apply); + break; + case ITEM_MOD_DEFENSE_SKILL_RATING: + ApplyRatingMod(CR_DEFENSE_SKILL, -int32(removeValue), apply); + break; + case ITEM_MOD_DODGE_RATING: + ApplyRatingMod(CR_DODGE, -int32(removeValue), apply); + break; + case ITEM_MOD_PARRY_RATING: + ApplyRatingMod(CR_PARRY, -int32(removeValue), apply); + break; + case ITEM_MOD_BLOCK_RATING: + ApplyRatingMod(CR_BLOCK, -int32(removeValue), apply); + break; + case ITEM_MOD_HIT_MELEE_RATING: + ApplyRatingMod(CR_HIT_MELEE, -int32(removeValue), apply); + break; + case ITEM_MOD_HIT_RANGED_RATING: + ApplyRatingMod(CR_HIT_RANGED, -int32(removeValue), apply); + break; + case ITEM_MOD_HIT_SPELL_RATING: + ApplyRatingMod(CR_HIT_SPELL, -int32(removeValue), apply); + break; + case ITEM_MOD_CRIT_MELEE_RATING: + ApplyRatingMod(CR_CRIT_MELEE, -int32(removeValue), apply); + break; + case ITEM_MOD_CRIT_RANGED_RATING: + ApplyRatingMod(CR_CRIT_RANGED, -int32(removeValue), apply); + break; + case ITEM_MOD_CRIT_SPELL_RATING: + ApplyRatingMod(CR_CRIT_SPELL, -int32(removeValue), apply); + break; + case ITEM_MOD_HASTE_SPELL_RATING: + ApplyRatingMod(CR_HASTE_SPELL, -int32(removeValue), apply); + break; + case ITEM_MOD_HIT_RATING: + ApplyRatingMod(CR_HIT_MELEE, -int32(removeValue), apply); + ApplyRatingMod(CR_HIT_RANGED, -int32(removeValue), apply); + ApplyRatingMod(CR_HIT_SPELL, -int32(removeValue), apply); + break; + case ITEM_MOD_CRIT_RATING: + ApplyRatingMod(CR_CRIT_MELEE, -int32(removeValue), apply); + ApplyRatingMod(CR_CRIT_RANGED, -int32(removeValue), apply); + ApplyRatingMod(CR_CRIT_SPELL, -int32(removeValue), apply); + break; + case ITEM_MOD_RESILIENCE_RATING: + ApplyRatingMod(CR_CRIT_TAKEN_MELEE, -int32(removeValue), apply); + ApplyRatingMod(CR_CRIT_TAKEN_RANGED, -int32(removeValue), apply); + ApplyRatingMod(CR_CRIT_TAKEN_SPELL, -int32(removeValue), apply); + break; + case ITEM_MOD_HASTE_RATING: + ApplyRatingMod(CR_HASTE_MELEE, -int32(removeValue), apply); + ApplyRatingMod(CR_HASTE_RANGED, -int32(removeValue), apply); + ApplyRatingMod(CR_HASTE_SPELL, -int32(removeValue), apply); + break; + case ITEM_MOD_EXPERTISE_RATING: + ApplyRatingMod(CR_EXPERTISE, -int32(removeValue), apply); + break; + case ITEM_MOD_ATTACK_POWER: + HandleStatModifier(UNIT_MOD_ATTACK_POWER, TOTAL_VALUE, -removeValue, apply); + HandleStatModifier(UNIT_MOD_ATTACK_POWER_RANGED, TOTAL_VALUE, -removeValue, apply); + break; + case ITEM_MOD_RANGED_ATTACK_POWER: + HandleStatModifier(UNIT_MOD_ATTACK_POWER_RANGED, TOTAL_VALUE, -removeValue, apply); + break; + case ITEM_MOD_MANA_REGENERATION: + ApplyManaRegenBonus(-int32(removeValue), apply); + break; + case ITEM_MOD_ARMOR_PENETRATION_RATING: + ApplyRatingMod(CR_ARMOR_PENETRATION, -int32(removeValue), apply); + break; + case ITEM_MOD_SPELL_POWER: + ApplySpellPowerBonus(-int32(removeValue), apply); + break; + case ITEM_MOD_HEALTH_REGEN: + ApplyHealthRegenBonus(-int32(removeValue), apply); + break; + case ITEM_MOD_SPELL_PENETRATION: + ApplyModInt32Value(PLAYER_FIELD_MOD_TARGET_RESISTANCE, -int32(removeValue), apply); + m_spellPenetrationItemMod += apply ? -int32(removeValue) : int32(removeValue); + break; + case ITEM_MOD_BLOCK_VALUE: + HandleBaseModValue(SHIELD_BLOCK_VALUE, FLAT_MOD, -removeValue, apply); + break; + } + + switch (reforge->FinalStat) + { + case ITEM_MOD_MANA: + HandleStatModifier(UNIT_MOD_MANA, BASE_VALUE, addValue, apply); + break; + case ITEM_MOD_HEALTH: + HandleStatModifier(UNIT_MOD_HEALTH, BASE_VALUE, addValue, apply); + break; + case ITEM_MOD_AGILITY: + HandleStatModifier(UNIT_MOD_STAT_AGILITY, TOTAL_VALUE, addValue, apply); + ApplyStatBuffMod(STAT_AGILITY, addValue, apply); + break; + case ITEM_MOD_STRENGTH: + HandleStatModifier(UNIT_MOD_STAT_STRENGTH, TOTAL_VALUE, addValue, apply); + ApplyStatBuffMod(STAT_STRENGTH, addValue, apply); + break; + case ITEM_MOD_INTELLECT: + HandleStatModifier(UNIT_MOD_STAT_INTELLECT, TOTAL_VALUE, addValue, apply); + ApplyStatBuffMod(STAT_INTELLECT, addValue, apply); + break; + case ITEM_MOD_SPIRIT: + HandleStatModifier(UNIT_MOD_STAT_SPIRIT, TOTAL_VALUE, addValue, apply); + ApplyStatBuffMod(STAT_SPIRIT, addValue, apply); + break; + case ITEM_MOD_STAMINA: + HandleStatModifier(UNIT_MOD_STAT_STAMINA, TOTAL_VALUE, addValue, apply); + ApplyStatBuffMod(STAT_STAMINA, addValue, apply); + break; + case ITEM_MOD_DEFENSE_SKILL_RATING: + ApplyRatingMod(CR_DEFENSE_SKILL, int32(addValue), apply); + break; + case ITEM_MOD_DODGE_RATING: + ApplyRatingMod(CR_DODGE, int32(addValue), apply); + break; + case ITEM_MOD_PARRY_RATING: + ApplyRatingMod(CR_PARRY, int32(addValue), apply); + break; + case ITEM_MOD_BLOCK_RATING: + ApplyRatingMod(CR_BLOCK, int32(addValue), apply); + break; + case ITEM_MOD_HIT_MELEE_RATING: + ApplyRatingMod(CR_HIT_MELEE, int32(addValue), apply); + break; + case ITEM_MOD_HIT_RANGED_RATING: + ApplyRatingMod(CR_HIT_RANGED, int32(addValue), apply); + break; + case ITEM_MOD_HIT_SPELL_RATING: + ApplyRatingMod(CR_HIT_SPELL, int32(addValue), apply); + break; + case ITEM_MOD_CRIT_MELEE_RATING: + ApplyRatingMod(CR_CRIT_MELEE, int32(addValue), apply); + break; + case ITEM_MOD_CRIT_RANGED_RATING: + ApplyRatingMod(CR_CRIT_RANGED, int32(addValue), apply); + break; + case ITEM_MOD_CRIT_SPELL_RATING: + ApplyRatingMod(CR_CRIT_SPELL, int32(addValue), apply); + break; + case ITEM_MOD_HASTE_SPELL_RATING: + ApplyRatingMod(CR_HASTE_SPELL, int32(addValue), apply); + break; + case ITEM_MOD_HIT_RATING: + ApplyRatingMod(CR_HIT_MELEE, int32(addValue), apply); + ApplyRatingMod(CR_HIT_RANGED, int32(addValue), apply); + ApplyRatingMod(CR_HIT_SPELL, int32(addValue), apply); + break; + case ITEM_MOD_CRIT_RATING: + ApplyRatingMod(CR_CRIT_MELEE, int32(addValue), apply); + ApplyRatingMod(CR_CRIT_RANGED, int32(addValue), apply); + ApplyRatingMod(CR_CRIT_SPELL, int32(addValue), apply); + break; + case ITEM_MOD_RESILIENCE_RATING: + ApplyRatingMod(CR_CRIT_TAKEN_MELEE, int32(addValue), apply); + ApplyRatingMod(CR_CRIT_TAKEN_RANGED, int32(addValue), apply); + ApplyRatingMod(CR_CRIT_TAKEN_SPELL, int32(addValue), apply); + break; + case ITEM_MOD_HASTE_RATING: + ApplyRatingMod(CR_HASTE_MELEE, int32(addValue), apply); + ApplyRatingMod(CR_HASTE_RANGED, int32(addValue), apply); + ApplyRatingMod(CR_HASTE_SPELL, int32(addValue), apply); + break; + case ITEM_MOD_EXPERTISE_RATING: + ApplyRatingMod(CR_EXPERTISE, int32(addValue), apply); + break; + case ITEM_MOD_ATTACK_POWER: + HandleStatModifier(UNIT_MOD_ATTACK_POWER, TOTAL_VALUE, addValue, apply); + HandleStatModifier(UNIT_MOD_ATTACK_POWER_RANGED, TOTAL_VALUE, addValue, apply); + break; + case ITEM_MOD_RANGED_ATTACK_POWER: + HandleStatModifier(UNIT_MOD_ATTACK_POWER_RANGED, TOTAL_VALUE, addValue, apply); + break; + case ITEM_MOD_MANA_REGENERATION: + ApplyManaRegenBonus(int32(addValue), apply); + break; + case ITEM_MOD_ARMOR_PENETRATION_RATING: + ApplyRatingMod(CR_ARMOR_PENETRATION, int32(addValue), apply); + break; + case ITEM_MOD_SPELL_POWER: + ApplySpellPowerBonus(int32(addValue), apply); + break; + case ITEM_MOD_HEALTH_REGEN: + ApplyHealthRegenBonus(int32(addValue), apply); + break; + case ITEM_MOD_SPELL_PENETRATION: + ApplyModInt32Value(PLAYER_FIELD_MOD_TARGET_RESISTANCE, int32(addValue), apply); + m_spellPenetrationItemMod += apply ? int32(addValue) : -int32(addValue); + break; + case ITEM_MOD_BLOCK_VALUE: + HandleBaseModValue(SHIELD_BLOCK_VALUE, FLAT_MOD, addValue, apply); + break; + } +} + void Player::ApplyEnchantment(Item* item, bool apply) { for (uint32 slot = 0; slot < MAX_ENCHANTMENT_SLOT; ++slot) + { + // Apply reforge as last enchant + if (slot == REFORGE_ENCHANTMENT_SLOT) + continue; + ApplyEnchantment(item, EnchantmentSlot(slot), apply); + } + + ApplyEnchantment(item, REFORGE_ENCHANTMENT_SLOT, apply); } void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool apply_dur, bool ignore_condition) @@ -13348,6 +13604,15 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool if (slot >= MAX_ENCHANTMENT_SLOT) return; + if (slot == TRANSMOGRIFY_ENCHANTMENT_SLOT) + return; + + if (slot == REFORGE_ENCHANTMENT_SLOT) + { + ApplyReforgeEnchantment(item, apply); + return; + } + uint32 enchant_id = item->GetEnchantmentId(slot); if (!enchant_id) return; @@ -13411,13 +13676,13 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool { int32 basepoints = 0; // Random Property Exist - try found basepoints for spell (basepoints depends from item suffix factor) - if (item->GetItemRandomPropertyId()) + if (item->GetItemRandomPropertyId() < 0) { ItemRandomSuffixEntry const* item_rand = sItemRandomSuffixStore.LookupEntry(abs(item->GetItemRandomPropertyId())); if (item_rand) { // Search enchant_amount - for (int k = 0; k < MAX_ITEM_ENCHANTMENT_EFFECTS; ++k) + for (int k = 0; k < 5; ++k) { if (item_rand->enchant_id[k] == enchant_id) { @@ -13463,7 +13728,7 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool ItemRandomSuffixEntry const* item_rand_suffix = sItemRandomSuffixStore.LookupEntry(abs(item->GetItemRandomPropertyId())); if (item_rand_suffix) { - for (int k = 0; k < MAX_ITEM_ENCHANTMENT_EFFECTS; ++k) + for (int k = 0; k < 5; ++k) { if (item_rand_suffix->enchant_id[k] == enchant_id) { @@ -13720,6 +13985,9 @@ void Player::UpdateSkillEnchantments(uint16 skill_id, uint16 curr_value, uint16 { for (uint8 slot = 0; slot < MAX_ENCHANTMENT_SLOT; ++slot) { + if (slot > PRISMATIC_ENCHANTMENT_SLOT || slot < PROP_ENCHANTMENT_SLOT_0) // not holding enchantment id + continue; + uint32 ench_id = m_items[i]->GetEnchantmentId(EnchantmentSlot(slot)); if (!ench_id) continue; diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index e8dde100473..e192c88b2c2 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1393,6 +1393,7 @@ class Player : public Unit, public GridObject void AddEnchantmentDuration(Item* item, EnchantmentSlot slot, uint32 duration); void ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool apply_dur = true, bool ignore_condition = false); void ApplyEnchantment(Item* item, bool apply); + void ApplyReforgeEnchantment(Item* item, bool apply); void UpdateSkillEnchantments(uint16 skill_id, uint16 curr_value, uint16 new_value); void SendEnchantmentDurations(); void BuildEnchantmentsInfoData(WorldPacket* data); diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 31720266ff0..6a8cc5b1c5f 100755 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -688,7 +688,7 @@ void WorldSession::HandleBuyItemOpcode(WorldPacket& recvData) uint32 item, slot, count; uint8 itemType; // 1 = item, 2 = currency (not implemented) uint8 bagSlot; - + recvData >> vendorguid >> itemType >> item >> slot >> count >> bagGuid >> bagSlot; // client expects count starting at 1, and we send vendorslot+1 to client already @@ -1216,7 +1216,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recvData) // tried to put meta gem in normal socket if (itemProto->Socket[i].Color != SOCKET_COLOR_META && GemProps[i]->color == SOCKET_COLOR_META) return; - + // tried to put normal gem in cogwheel socket if (itemProto->Socket[i].Color == SOCKET_COLOR_COGWHEEL && GemProps[i]->color != SOCKET_COLOR_COGWHEEL) return; @@ -1667,18 +1667,27 @@ void WorldSession::HandleReforgeItemOpcode(WorldPacket& recvData) if (!reforgeEntry) { // Reset the item + if (item->IsEquipped()) + player->ApplyReforgeEnchantment(item, false); item->ClearEnchantment(REFORGE_ENCHANTMENT_SLOT); SendReforgeResult(true); return; } - if (!sItemReforgeStore.LookupEntry(reforgeEntry)) + ItemReforgeEntry const* stats = sItemReforgeStore.LookupEntry(reforgeEntry); + if (!stats) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleReforgeItemOpcode - Player (Guid: %u Name: %s) tried to reforge an item with invalid reforge entry (%u).", player->GetGUIDLow(), player->GetName(), reforgeEntry); SendReforgeResult(false); return; } + if (!item->GetReforgableStat(ItemModType(stats->SourceStat)) || item->GetReforgableStat(ItemModType(stats->FinalStat))) // Cheating, you cant reforge to a stat that the item already has, nor reforge from a stat that the item does not have + { + SendReforgeResult(false); + return; + } + if (!player->HasEnoughMoney(uint64(item->GetSpecialPrice()))) // cheating { SendReforgeResult(false); @@ -1691,5 +1700,6 @@ void WorldSession::HandleReforgeItemOpcode(WorldPacket& recvData) SendReforgeResult(true); - // ToDo: Apply and remove the destination/source stats to the player + if (item->IsEquipped()) + player->ApplyReforgeEnchantment(item, true); } diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp index 3a4132f62fe..0fc30420d35 100644 --- a/src/server/scripts/Spells/spell_rogue.cpp +++ b/src/server/scripts/Spells/spell_rogue.cpp @@ -338,6 +338,9 @@ class spell_rog_deadly_poison : public SpellScriptLoader // item combat enchantments for (uint8 slot = 0; slot < MAX_ENCHANTMENT_SLOT; ++slot) { + if (slot > PRISMATIC_ENCHANTMENT_SLOT || slot < PROP_ENCHANTMENT_SLOT_0) // not holding enchantment id + continue; + SpellItemEnchantmentEntry const* enchant = sSpellItemEnchantmentStore.LookupEntry(item->GetEnchantmentId(EnchantmentSlot(slot))); if (!enchant) continue; -- cgit v1.2.3 From bd36843a4cbc183647131ae7bb2ab41ab5dd0f0d Mon Sep 17 00:00:00 2001 From: horn Date: Mon, 6 Aug 2012 22:33:48 +0100 Subject: Core/Opcodes: Sync opcodes with WPP, add handlers placeholders for new opcs Signed-off-by: Nay --- src/server/game/Server/Protocol/Opcodes.cpp | 295 ++++++++++++++++++++++++++++ src/server/game/Server/Protocol/Opcodes.h | 14 +- 2 files changed, 302 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index fa6a77bf6de..43798dd24be 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -47,6 +47,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_ACTIVATETAXI, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleActivateTaxiOpcode ); DEFINE_OPCODE_HANDLER(CMSG_ACTIVATETAXIEXPRESS, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleActivateTaxiExpressOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_ACTIVE_PVP_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_ADDON_REGISTERED_PREFIXES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_ADD_FRIEND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddFriendOpcode ); DEFINE_OPCODE_HANDLER(CMSG_ADD_IGNORE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddIgnoreOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_ADD_PVP_MEDAL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -89,8 +90,10 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_BANK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoStoreBankItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_GROUND_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_LOOT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutostoreLootItemOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_AUTO_DECLINE_GUILD_INVITES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_BANKER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBankerActivateOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_JOIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_LEAVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlefieldListOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MANAGER_ADVANCE_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MANAGER_SET_NEXT_TRANSITION_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -101,9 +104,11 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_PORT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattleFieldPortOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_REQUEST_SCORE_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); Need to send the response //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_STATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlefieldStatusOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEGROUND_PLAYER_POSITIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlemasterHelloOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_JOIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlemasterJoinOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_JOIN_ARENA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlemasterJoinArena ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_JOIN_RATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_BEASTMASTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_BEGIN_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBeginTradeOpcode ); DEFINE_OPCODE_HANDLER(CMSG_BINDER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBinderActivateOpcode ); @@ -121,6 +126,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_ADD_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarAddEvent ); //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_ARENA_TEAM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarArenaTeam ); //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_COMPLAIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarComplain ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_CONTEXT_EVENT_SIGNUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_COPY_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarCopyEvent ); //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventInvite ); //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_INVITE_NOTES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -141,6 +147,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_CHANNELLING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelChanneling ); //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_GROWTH_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelGrowthAuraOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_MOUNT_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelMountAuraOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_QUEUED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_TEMP_ENCHANTMENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelTempEnchantmentOpcode); DEFINE_OPCODE_HANDLER(CMSG_CANCEL_TRADE, STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelTradeOpcode); DEFINE_OPCODE_HANDLER(CMSG_CAST_SPELL, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleCastSpellOpcode ); @@ -159,6 +166,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_MUTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelMute ); //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_OWNER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelOwner ); //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_PASSWORD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelPassword ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_ROSTER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_SET_OWNER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelSetOwner ); //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_SILENCE_ALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_SILENCE_VOICE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -187,6 +195,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_SET_HONOR_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CHECK_LOGIN_CRITERIA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_CHANNEL_WATCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_RAID_MARKER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_EXPLORATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_HOLIDAY_BG_WIN_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_QUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -197,13 +206,16 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_ENTER_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_EXIT_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_GET_MAP_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_GET_PARTY_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_GET_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_INSTANCE_COMMAND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_SKIRMISH_QUEUE_COMMAND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_START_WARGAME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_COMPLAIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleComplainOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_COMPLETE_ACHIEVEMENT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_COMPLETE_CINEMATIC, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCompleteCinematic ); //DEFINE_OPCODE_HANDLER(CMSG_COMPLETE_MOVIE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CONNECT_TO_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_CONTACT_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleContactListOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_CONTROLLER_EJECT_PASSENGER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEjectPassenger ); //DEFINE_OPCODE_HANDLER(CMSG_COOLDOWN_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -223,6 +235,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_SERVER_GEO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_DECHARGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_DECLINE_CHANNEL_INVITE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleChannelDeclineInvite ); + //DEFINE_OPCODE_HANDLER(CMSG_DELETEEQUIPMENT_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_DELETE_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_DEL_FRIEND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDelFriendOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_DEL_IGNORE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDelIgnoreOpcode ); @@ -237,6 +250,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_DROP_NEW_CONNECTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_DUEL_ACCEPTED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDuelAcceptedOpcode ); DEFINE_OPCODE_HANDLER(CMSG_DUEL_CANCELLED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDuelCancelledOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_DUNGEON_FINDER_GET_SYSTEM_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_EJECT_PASSENGER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_DUMP_OBJECTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEmoteOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_ENABLETAXI, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleTaxiQueryAvailableNodes ); @@ -315,43 +330,62 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_GROUP_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupDeclineOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_DISBAND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupDisbandOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GROUP_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupInviteOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GROUP_INVITE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_RAID_CONVERT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupRaidConvertOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GROUP_REQUEST_JOIN_UPDATES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_SET_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupSetLeaderOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GROUP_SET_ROLES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_SWAP_SUB_GROUP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupSwapSubGroupOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_UNINVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupUninviteOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_UNINVITE_GUID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupUninviteGuidOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildAcceptOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_ACHIEVEMENT_MEMBERS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_ACHIEVEMENT_PROGRESS_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildAchievementProgressQuery); DEFINE_OPCODE_HANDLER(CMSG_GUILD_ADD_RANK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildAddRankOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_ASSIGN_MEMBER_RANK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildAssignRankOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANKER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankerActivate ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_BUY_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankBuyTab ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_DEPOSIT_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankDepositMoney ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_LOG_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_MONEY_WITHDRAWN_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankMoneyWithdrawn ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_NOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_QUERY_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankQueryTab ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_QUERY_TEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_REM_MONEY_WITHDRAW_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_SET_TAB_TEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_SWAP_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankSwapItems ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_UPDATE_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankUpdateTab ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_WITHDRAW_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankWithdrawMoney ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_CHANGE_NAME_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_CREATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildCreateOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDeclineOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_DEL_RANK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDelRankOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_DEMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDemoteOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_DISBAND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDisbandOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_EVENT_LOG_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildInfoOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_INFO_TEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildChangeInfoTextOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildInviteOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildLeaderOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildLeaveOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_MEMBER_SEND_SOR_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_MOTD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildMOTDOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_NEWS_UPDATE_STICKY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_PERMISSIONS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildPermissions ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_PROMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildPromoteOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_QUERY, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildQueryOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_QUERY_NEWS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_QUERY_RANKS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildQueryRanksOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_REMOVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildRemoveOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_REPLACE_GUILD_MASTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_REQUEST_CHALLENGE_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_REQUEST_MAX_DAILY_XP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_ROSTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildRosterOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_SET_ACHIEVEMENT_TRACKING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_SET_GUILD_MASTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_SET_NOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildSetNoteOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_SET_RANK_PERMISSIONS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildSetRankPermissionsOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_SWITCH_RANK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_HEARTH_AND_RESURRECT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleHearthAndResurrect ); //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_DIMINISHING_RETURNS_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_KNOCKBACK_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -359,6 +393,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_IGNORE_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleIgnoreTradeOpcode ); DEFINE_OPCODE_HANDLER(CMSG_INITIATE_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInitiateTradeOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_INSPECT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_INSTANCE_LOCK_WARNING_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_INSTANCE_LOCK_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInstanceLockResponse ); //DEFINE_OPCODE_HANDLER(CMSG_ITEM_REFUND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemRefund ); DEFINE_OPCODE_HANDLER(CMSG_ITEM_REFUND_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemRefundInfoRequest ); @@ -372,17 +407,31 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_LEARN_TALENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnTalentOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LEAVE_BATTLEFIELD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLeaveBattlefieldOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LEAVE_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLeaveChannel ); + //DEFINE_OPCODE_HANDLER(CMSG_LFG_GET_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_LEVEL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_LFD_PARTY_LOCK_INFO_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgPartyLockInfoRequestOpcode); //DEFINE_OPCODE_HANDLER(CMSG_LFD_PLAYER_LOCK_INFO_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgPlayerLockInfoRequestOpcode); //DEFINE_OPCODE_HANDLER(CMSG_LFG_GET_STATUS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_LFG_JOIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgJoinOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LFG_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgLeaveOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_LFG_LFR_JOIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LFG_LFR_LEAVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LFG_PARTY_LOCK_INFO_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_LFG_PROPOSAL_RESULT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgProposalResultOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_BOOT_VOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetBootVoteOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_COMMENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_NEEDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_ROLES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetRolesOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LFG_TELEPORT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgTeleportOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_ADD_RECRUIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_BROWSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_DECLINE_RECRUIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_GET_APPLICATIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_GET_RECRUITS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_JOIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_POST_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_REMOVE_RECRUIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_SET_GUILD_POST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_LIST_INVENTORY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleListInventoryOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LOAD_DANCES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_LOAD_SCREEN, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleLoadScreenOpcode ); @@ -390,6 +439,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_LOGOUT_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLogoutRequestOpcode ); DEFINE_OPCODE_HANDLER(CMSG_LOG_DISCONNECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); //DEFINE_OPCODE_HANDLER(CMSG_LOOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_LOOT_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_LOOT_MASTER_GIVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMasterGiveOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LOOT_METHOD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMethodOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LOOT_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMoneyOpcode ); @@ -429,9 +479,11 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_YELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_MINIGAME_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_MOUNTSPECIAL_ANIM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMountSpecialAnimOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_CHARM_TELEPORT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_CHARACTER_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_CHARM_PORT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_MOVE_CHNG_TRANSPORT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_ENABLE_SWIM_TO_FLY_TRANS_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FALL_RESET, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FEATHER_FALL_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleFeatherFallAck ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); @@ -448,16 +500,19 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_MOVE_HOVER_ACK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMoveHoverAck ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_KNOCK_BACK_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveKnockBackAck ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_NOT_ACTIVE_MOVER, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveNotActiveMover ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_CAN_FLY_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveSetCanFlyAckOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_COLLISION_HEIGHT_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_FLY, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_RELATIVE_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_VEHICLE_REC_ID_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SPLINE_DONE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveSplineDoneOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_START_SWIM_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_STOP_SWIM_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_MOVE_TIME_SKIPPED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleMoveTimeSkippedOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_TOGGLE_COLLISION_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_WATER_WALK_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveWaterWalkAck ); DEFINE_OPCODE_HANDLER(CMSG_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNameQueryOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_NEW_SPELL_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -465,6 +520,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_NO_SPELL_VARIANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_NPC_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNpcTextQueryOpcode ); DEFINE_OPCODE_HANDLER(CMSG_OBJECT_UPDATE_FAILED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleObjectUpdateFailedOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_OBJECT_UPDATE_RESCUED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_OFFER_PETITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleOfferPetitionOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_OPENING_CINEMATIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_OPEN_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleOpenItemOpcode ); @@ -484,6 +540,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_PET_CANCEL_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetCancelAuraOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_PET_CAST_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetCastSpellOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_PET_LEARN_TALENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetLearnTalent ); + //DEFINE_OPCODE_HANDLER(CMSG_PET_NAME_CACHE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_PET_LEVEL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_PET_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetNameQuery ); //DEFINE_OPCODE_HANDLER(CMSG_PET_RENAME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetRename ); @@ -494,6 +551,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_PET_UNLEARN_TALENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_PING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); DEFINE_OPCODE_HANDLER(CMSG_PLAYED_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayedTime ); + //DEFINE_OPCODE_HANDLER(CMSG_PLAYER_DIFFICULTY_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_PLAYER_AI_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_PLAYER_LOGIN, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayerLoginOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_PLAYER_LOGOUT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayerLogoutOpcode ); @@ -501,6 +559,9 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_PLAY_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_PROFILEDATA_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_PUSHQUESTTOPARTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePushQuestToParty ); + //DEFINE_OPCODE_HANDLER(CMSG_PVP_LOG_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_QUERY_BATTLEFIELD_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_QUERY_COMPLETION_NPC_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_PVP_QUEUE_STATS_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_MAX_XP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_MEMBERS_FOR_RECIPE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -528,6 +589,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_QUESTLOG_REMOVE_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestLogRemoveQuest ); //DEFINE_OPCODE_HANDLER(CMSG_QUESTLOG_SWAP_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestLogSwapQuest ); DEFINE_OPCODE_HANDLER(CMSG_QUEST_CONFIRM_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestConfirmAccept ); + //DEFINE_OPCODE_HANDLER(CMSG_QUEST_NPC_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_QUEST_POI_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestPOIQuery ); //DEFINE_OPCODE_HANDLER(CMSG_QUEST_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestQueryOpcode ); DEFINE_OPCODE_HANDLER(CMSG_RANDOMIZE_CHAR_NAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRandomizeCharNameOpcode ); @@ -540,16 +602,28 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_REDIRECTION_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_REFER_A_FRIEND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_REFORGE_ITEM, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleReforgeItemOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_REORDER_CHARACTERS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(SMSG_REFORGE_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_REMOVE_GLYPH, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRemoveGlyph ); DEFINE_OPCODE_HANDLER(CMSG_REPAIR_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepairItemOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_REPLACE_ACCOUNT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_REPOP_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepopRequestOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_REPORT_PVP_AFK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReportPvPAFK ); DEFINE_OPCODE_HANDLER(CMSG_REQUEST_ACCOUNT_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestAccountData ); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_CATEGORY_COOLDOWNS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_CEMETERY_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_GUILD_PARTY_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_HONOR_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_REQUEST_HOTFIX, STATUS_AUTHED, PROCESS_INPLACE, &WorldSession::HandleRequestHotfix ); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_INSPECT_RATED_BG_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PARTY_MEMBER_STATS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestPartyMemberStatsOpcode); //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PET_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestPetInfoOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PVP_OPTIONS_ENABLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PVP_REWARDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RAID_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestRaidInfoOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RATED_BG_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RATED_BG_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RESEARCH_HISTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_EXIT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestVehicleExit ); //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_NEXT_SEAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_PREV_SEAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); @@ -558,6 +632,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_RESET_INSTANCES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleResetInstancesOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_RESURRECT_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleResurrectResponseOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_RETURN_TO_GRAVEYARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReturnToGraveyard ); + //DEFINE_OPCODE_HANDLER(CMSG_ROLE_POLL_BEGIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SAVE_CUF_PROFILES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_RUN_SCRIPT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SAVE_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SAVE_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -570,6 +646,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_SEND_GENERAL_TRIGGER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SEND_LOCAL_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_SEND_MAIL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSendMail ); + //DEFINE_OPCODE_HANDLER(CMSG_SEND_SOR_REQUEST_VIA_ADDRESS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SEND_SOR_REQUEST_VIA_BNET_ACCOUNT_ID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SERVERINFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SERVERTIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SERVER_BROADCAST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -593,6 +671,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_SET_CHANNEL_WATCH, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetChannelWatch ); //DEFINE_OPCODE_HANDLER(CMSG_SET_CHARACTER_MODEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_CONTACT_NOTES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetContactNotesOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_CURRENCY_FLAGS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_EVERYONE_IS_ASSISTANT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_CRITERIA_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_DURABILITY_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_EXPLORATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -605,8 +685,12 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_SET_GRANTABLE_LEVELS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_GUILD_BANK_TEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetGuildBankTabText ); //DEFINE_OPCODE_HANDLER(CMSG_SET_LFG_COMMENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetCommentOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_PET_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_PAID_SERVICE_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_PLAYER_DECLINED_NAMES, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetPlayerDeclinedNames ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_PREFERED_CEMETERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_PRIMARY_TALENT_TREE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_RELATIVE_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_PVP_RANK_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_PVP_TITLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_RUNE_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -617,6 +701,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_SET_STAT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_SET_TAXI_BENCHMARK_MODE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTaxiBenchmarkOpcode ); DEFINE_OPCODE_HANDLER(CMSG_SET_TITLE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTitleOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_TRADE_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_TITLE_SUFFIX, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_SET_TRADE_GOLD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTradeGoldOpcode ); DEFINE_OPCODE_HANDLER(CMSG_SET_TRADE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTradeItemOpcode ); @@ -639,7 +724,11 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_START_QUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_STOP_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_STORE_LOOT_IN_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SUBMIT_BUG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SUBMIT_COMPLAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SUGGESTION_SUBMIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SUMMON_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSummonResponseOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_SUSPEND_TOKEN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SUSPEND_COMMS_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_SWAP_INV_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSwapInvItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SWAP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSwapItem ); @@ -656,13 +745,16 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_TELEPORT_TO_UNIT, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_TEST_DROP_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_TEXT_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTextEmoteOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_TIME_ADJUSTMENT_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_TIME_SYNC_RESP, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleTimeSyncResp ); + //DEFINE_OPCODE_HANDLER(CMSG_TIME_SYNC_RESP_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_TOGGLE_PVP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTogglePvP ); //DEFINE_OPCODE_HANDLER(CMSG_TOGGLE_XP_GAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_TOTEM_DESTROYED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTotemDestroyed ); DEFINE_OPCODE_HANDLER(CMSG_TRANSMOGRIFY_ITEMS, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleTransmogrifyItems ); //DEFINE_OPCODE_HANDLER(CMSG_TRAINER_BUY_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerBuySpellOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_TRAINER_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerListOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_TRANSMOGRIFY_ITEMS, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleTransmogrifyItems ); //DEFINE_OPCODE_HANDLER(CMSG_TRIGGER_CINEMATIC_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_TURN_IN_PETITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTurnInPetitionOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_CLEAR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialClear ); @@ -674,6 +766,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_UNITANIMTIER_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_DANCE_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_SKILL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnlearnSkillOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_SPECIALIZATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_UNREGISTER_ALL_ADDON_PREFIXES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_TALENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_UNSTABLE_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnstablePet ); @@ -682,6 +776,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_UPDATE_ACCOUNT_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateAccountData ); //DEFINE_OPCODE_HANDLER(CMSG_UPDATE_MISSILE_TRAJECTORY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateMissileTrajectory ); //DEFINE_OPCODE_HANDLER(CMSG_UPDATE_PROJECTILE_POSITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateProjectilePosition ); + //DEFINE_OPCODE_HANDLER(CMSG_USED_FOLLOW, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_USE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUseItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_USE_SKILL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_VIOLENCE_LEVEL, STATUS_AUTHED, PROCESS_INPLACE, &WorldSession::HandleViolenceLevel ); @@ -690,8 +785,11 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_VOID_STORAGE_UNLOCK, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleVoidStorageUnlock ); DEFINE_OPCODE_HANDLER(CMSG_VOID_STORAGE_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleVoidStorageQuery ); DEFINE_OPCODE_HANDLER(CMSG_VOID_STORAGE_TRANSFER, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleVoidStorageTransfer ); + DEFINE_OPCODE_HANDLER(CMSG_VOID_STORAGE_UNLOCK, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleVoidStorageUnlock ); DEFINE_OPCODE_HANDLER(CMSG_VOID_SWAP_ITEM, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleVoidSwapItem ); //DEFINE_OPCODE_HANDLER(CMSG_WARDEN_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleWardenDataOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_WARGAME_ACCEPT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_WARGAME_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_WEATHER_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_WHO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWhoOpcode ); DEFINE_OPCODE_HANDLER(CMSG_WHOIS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWhoisOpcode ); @@ -722,10 +820,12 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(MSG_INSPECT_HONOR_STATS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectHonorStatsOpcode ); //DEFINE_OPCODE_HANDLER(MSG_LIST_STABLED_PETS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleListStabledPetsOpcode ); //DEFINE_OPCODE_HANDLER(MSG_MINIMAP_PING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMinimapPingOpcode ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_CHARM_TELEPORT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_MOVE_FALL_LAND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_FEATHER_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_GRAVITY_CHNG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_MOVE_HEARTBEAT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_MOVE_JUMP, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_ALL_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -734,13 +834,16 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_FLIGHT_BACK_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_FLIGHT_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_PITCH, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RAW_POSITION_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_PITCH_RATE_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_BACK_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_SWIM_BACK_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_SWIM_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_TURN_RATE_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_WALK_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_WALK_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_MOVE_START_ASCEND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); DEFINE_OPCODE_HANDLER(MSG_MOVE_START_BACKWARD, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); @@ -764,11 +867,16 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(MSG_MOVE_TELEPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_MOVE_TELEPORT_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveTeleportAck ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_TELEPORT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_TIME_SKIPPED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_TOGGLE_COLLISION_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_TOGGLE_FALL_LOGGING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_TOGGLE_LOGGING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_UNROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_MOUSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_TELEPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_MOVE_WORLDPORT_ACK, STATUS_TRANSFER, PROCESS_THREADUNSAFE, &WorldSession::HandleMoveWorldportAckOpcode ); @@ -789,11 +897,14 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(MSG_SAVE_GUILD_EMBLEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSaveGuildEmblemOpcode ); DEFINE_OPCODE_HANDLER(MSG_SET_DUNGEON_DIFFICULTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetDungeonDifficultyOpcode); DEFINE_OPCODE_HANDLER(MSG_SET_RAID_DIFFICULTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetRaidDifficultyOpcode ); + //DEFINE_OPCODE_HANDLER(MSG_START_MOVE_FORWARD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_TABARDVENDOR_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTabardVendorActivateOpcode); DEFINE_OPCODE_HANDLER(MSG_TALENT_WIPE_CONFIRM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTalentWipeConfirmOpcode ); DEFINE_OPCODE_HANDLER(MSG_VERIFY_CONNECTIVITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); //DEFINE_OPCODE_HANDLER(MSG_VIEW_PHASE_SHIFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(SMSG_ACCOUNT_DATA_TIMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ACCOUNT_INFO_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ACCOUNT_RESTRICTED_WARNING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ACHIEVEMENT_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ACHIEVEMENT_EARNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ACTION_BUTTONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -805,6 +916,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_ALL_ACHIEVEMENT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_AREA_SPIRIT_HEALER_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_AREA_TRIGGER_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_AREA_TRIGGER_MOVEMENT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ARENA_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ARENA_OPPONENT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_CHANGE_FAILED_QUEUED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -830,25 +942,36 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_OWNER_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_REMOVED_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_AURACASTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_AURA_POINTS_DEPLETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_AURA_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_AURA_UPDATE_ALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_AUTH_CHALLENGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_AUTH_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_AVAILABLE_VOICE_CHANNEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_AVERAGE_ITEM_LEVEL_INFORM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BARBER_SHOP_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_EJECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_EJECT_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_ENTERED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_ENTRY_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_EXIT_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_QUEUE_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_STATE_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_PLAYER_POSITIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_PORT_DENIED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_RATED_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS1, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS3, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS4, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_INFO_THROTTLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_PLAYER_JOINED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_PLAYER_LEFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_PLAYER_POSITIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_BINDER_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_BINDPOINTUPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BINDZONEREPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -856,6 +979,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_BUY_BANK_SLOT_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_BUY_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_BUY_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_ACTION_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_ARENA_TEAM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_CLEAR_PENDING_ACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -877,6 +1001,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_SEND_CALENDAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_SEND_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_SEND_NUM_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_UPDATE_INVITE_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CAMERA_SHAKE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CANCEL_AUTO_REPEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CANCEL_COMBAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -894,30 +1019,41 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_CHAR_ENUM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CHAR_FACTION_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CHAR_RENAME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHAT_IGNORED_ACCOUNT_MUTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHAT_NOT_IN_PARTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHAT_PLAYER_AMBIGUOUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHAT_PLAYER_NOT_FOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHAT_RESTRICTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHAT_SERVER_DISCONNECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHAT_SERVER_RECONNECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHAT_WRONG_FACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY_RESPONSE_WRITE_FILE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHEAT_PLAYER_LOOKUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHECK_FOR_BOTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_BOSS_EMOTES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_COOLDOWNS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_EXTRA_AURA_INFO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_FAR_SIGHT_IMMEDIATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_TARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CLIENTCACHE_VERSION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CLIENT_CONTROL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMBAT_EVENT_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMBAT_LOG_MULTIPLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_GET_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_MAP_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_PARTY_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_SKIRMISH_QUEUE_RESULT1, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_SKIRMISH_QUEUE_RESULT2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_STATE_CHANGED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMPLAIN_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMPLETION_NPC_RESPONCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMPLETION_NPC_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_ACHIEVEMENT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_CHAR_ENUM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_GUILD_ROSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_MOVES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_UNKNOWN_1310, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_UPDATE_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -930,16 +1066,22 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_COOLDOWN_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CORPSE_IS_NOT_IN_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CORPSE_MAP_POSITION_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CORPSE_NOT_IN_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CORPSE_RECLAIM_DELAY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CREATURE_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CRITERIA_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CRITERIA_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CROSSED_INEBRIATION_THRESHOLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CURRENCY_LOOT_REMOVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CURRENCY_LOOT_RESTORED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CUSTOM_LOAD_SCREEN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DAMAGE_CALC_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DAMAGE_DONE_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DANCE_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DBLOOKUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_DB_REPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DEATH_RELEASE_LOC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DEBUG_RUNE_REGEN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DEBUGAURAPROC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DEBUG_AISTATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DEBUG_LIST_TARGETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -947,15 +1089,21 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_DEFENSE_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_DESTROY_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DESTRUCTIBLE_BUILDING_DAMAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DIFFERENT_INSTANCE_FROM_PARTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DISENCHANT_CREDIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DISMOUNT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DISMOUNTRESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DISPEL_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DISPLAY_GAME_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DONT_AUTO_PUSH_SPELLS_TO_ACTION_BAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DROP_NEW_CONNECTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_DUEL_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_DUEL_COUNTDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_DUEL_INBOUNDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_DUEL_OUTOFBOUNDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_DUEL_REQUESTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_DUEL_WINNER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DUMP_RIDE_TICKETS_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DUMP_OBJECTS_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DURABILITY_DAMAGE_DEATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DYNAMIC_DROP_ROLL_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -969,17 +1117,20 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_EQUIPMENT_SET_USE_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_EXPECTED_SPAM_RECORDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_EXPLORATION_EXPERIENCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_FAILED_PLAYER_CONDITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_FEATURE_SYSTEM_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_FEIGN_DEATH_RESISTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_FISH_ESCAPED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_FISH_NOT_HOOKED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_FLIGHT_SPLINE_SYNC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_FLOOD_DETECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_FORCEACTIONSHOW, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_FORCED_DEATH_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_FORCE_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_FORCE_DISPLAY_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_FORCE_SEND_QUEUED_PACKETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_FORCE_SET_VEHICLE_REC_ID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_FORGE_MASTER_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_FRIEND_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_CUSTOM_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_DESPAWN_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -990,6 +1141,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_GAMETIMEBIAS_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GAMETIME_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GAMETIME_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GAME_EVENT_DEBUG_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GAME_OBJECT_ACTIVATE_ANIM_KIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GHOSTEE_GONE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GMRESPONSE_CREATE_TICKET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GMRESPONSE_DB_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1016,27 +1169,64 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_GROUP_JOINED_BATTLEGROUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GROUP_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GROUP_SET_LEADER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GROUP_SET_ROLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GROUP_UNINVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_ACHIEVEMENT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_ACHIEVEMENT_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_ACHIEVEMENT_EARNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_ACHIEVEMENT_MEMBERS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_LOG_QUERY_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_MONEY_WITHDRAWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_QUERY_TEXT_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_REM_MONEY_WITHDRAW_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_CANCEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_CHALLENGE_COMPLETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_CHALLENGE_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_CHANGE_NAME_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_COMMAND_RESULT_2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_CRITERIA_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_CRITERIA_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_DECLINE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_EVENT_LOG_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_FLAGGED_FOR_RENAME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_INVITE_CANCEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_KNOWN_RECIPES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_MAX_DAILY_XP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_MEMBERS_FOR_RECIPE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_MEMBER_DAILY_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_MEMBER_RECIPES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_MEMBER_UPDATE_NOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_MOVE_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_MOVE_STARTING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_NEWS_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_NEWS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_PARTY_STATE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_PERMISSIONS_QUERY_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_RANK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_RANKS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_RECIPES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_RENAMED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_REPUTATION_REACTION_CHANGED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_REPUTATION_WEEKLY_CAP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_REWARDS_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_ROSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_SET_NOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_TRADESKILL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_UPDATE_ROSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_XP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_XP_GAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_XP_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_HEALTH_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_HIGHEST_THREAT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_HOTFIX_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_HOTFIX_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_IGNORE_DIMINISHING_RETURNS_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_IGNORE_REQUIREMENTS_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_INITIALIZE_FACTIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1044,6 +1234,9 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_INIT_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_INIT_EXTRA_AURA_INFO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_INIT_WORLD_STATES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_INSPECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_INSPECT_HONOR_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_INSPECT_RATED_BG_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_INSPECT_RESULTS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_INSPECT_TALENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_DIFFICULTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1055,11 +1248,15 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_INVALIDATE_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_INVALID_PROMOTION_CODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_INVENTORY_CHANGE_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ITEM_ADD_PASSIVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ITEM_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ITEM_ENCHANT_TIME_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ITEM_EXPIRE_PURCHASE_REFUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ITEM_PUSH_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ITEM_REFUND_INFO_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ITEM_REFUND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ITEM_REMOVE_PASSIVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ITEM_SEND_PASSIVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ITEM_TEXT_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ITEM_TIME_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_JOINED_BATTLEGROUND_QUEUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1071,6 +1268,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_LFG_DISABLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_JOIN_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_OFFER_CONTINUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_OPEN_FROM_GOSSIP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_PARTY_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_PLAYER_REWARD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1078,12 +1276,24 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_LFG_QUEUE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_ROLE_CHECK_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_ROLE_CHOSEN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_SLOT_INVALID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_TELEPORT_DENIED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_PARTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_SEARCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_STATUS_NONE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_APPLICANT_LIST_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_APPLICATIONS_LIST_CHANGED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_BROWSE_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_MEMBERSHIP_LIST_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_POST_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_RECRUIT_LIST_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_SEARCH_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LIST_INVENTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LOAD_CUF_PROFILES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LOGIN_SETTIMESPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LOGIN_VERIFY_WORLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LOGOUT_CANCEL_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1092,6 +1302,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_LOG_XPGAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOOT_ALL_PASSED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOOT_CLEAR_MONEY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LOOT_CONTENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOOT_ITEM_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOOT_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOOT_MASTER_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1106,27 +1317,44 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_LOTTERY_QUERY_RESULT_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOTTERY_RESULT_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MAIL_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MAP_OBJ_EVENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_IN_PROGRESS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_MEMBER_ADDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_SETQUEUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MESSAGECHAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MESSAGE_BOX, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MINIGAME_MOVE_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MINIGAME_SETUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MINIGAME_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MIRRORIMAGE_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MISSILE_CANCEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MODIFY_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MONEY_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MONSTER_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MONSTER_MOVE_TRANSPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOTD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOUNTRESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOUNTSPECIAL_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_COLLISION_DISABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_COLLISION_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_DISABLE_COLLISION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_DISABLE_GRAVITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_ENABLE_COLLISION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_ENABLE_GRAVITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_FEATHER_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_CHARACTER_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_GRAVITY_DISABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_GRAVITY_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_KNOCK_BACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_LAND_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_NORMAL_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_ACTIVE_MOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_COLLISION_HEIGHT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_COMPOUND_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1136,17 +1364,31 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_SWIM_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_SWIM_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_VEHICLE_REC_ID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_WALK_IN_AIR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SKIP_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_WALK_IN_AIR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_COLLISION_HEIGHT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_KNOCK_BACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_RUN_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_SWIM_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_SWIM_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_TELEPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MULTIPLE_PACKETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_NEW_TAXI_PATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_NEW_WORLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_NEW_WORLD_ABORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_NOTIFY_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_NOTIFY_DEST_LOC_SPELL_CAST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1165,12 +1407,14 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_PAUSE_MIRROR_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PERIODICAURALOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PETGODMODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PETITION_ALREADY_SIGNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PETITION_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PETITION_SHOWLIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PETITION_SHOW_SIGNATURES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PETITION_SIGN_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_ACTION_FEEDBACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_ACTION_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_ADDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_BROKEN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_CAST_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_DISMISS_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1181,6 +1425,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_PET_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_REMOVED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_RENAMEABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_SLOT_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_SPELLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_TAME_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_UNLEARN_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1188,8 +1433,10 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_PLAYED_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PLAYERBINDERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAYERBOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PLAYER_DIFFICULTY_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAYER_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAYER_SKINNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PLAYER_UNK_DEAD_ALIVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAYER_VEHICLE_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAY_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAY_MUSIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1197,6 +1444,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_PLAY_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PLAY_SPELL_IMPACT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAY_SPELL_VISUAL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PLAY_SPELL_VISUAL_KIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PLAY_TIME_WARNING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PONG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_POWER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1204,7 +1452,10 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_PROCRESIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PROFILEDATA_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PROPOSE_LEVEL_GRANT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PUREMOUNT_CANCELLED_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PVP_CREDIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PVP_LOG_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PVP_OPTIONS_ENABLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PVP_QUEUE_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_QUERY_OBJECT_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_QUERY_OBJECT_ROTATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1233,8 +1484,13 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_RAID_GROUP_ONLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_RAID_INSTANCE_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_RAID_INSTANCE_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RAID_MARKERS_CHANGED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RAID_READY_CHECK_THROTTLED_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RAID_SUMMON_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_RAID_READY_CHECK_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_RANDOMIZE_CHAR_NAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RATED_BG_RATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RATED_BG_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_READ_ITEM_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_READ_ITEM_OK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_REALM_SPLIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1243,9 +1499,15 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_REDIRECT_CLIENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_REFER_A_FRIEND_EXPIRED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_REFER_A_FRIEND_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_REFORGE_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_REMOVED_FROM_PVP_QUEUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_REMOVED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_REPORT_PVP_AFK_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_REQUEST_CEMETERY_LIST_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_REQUEST_PVP_REWARDS_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RESEARCH_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RESEARCH_SETUP_HISTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RESET_COMPRESSION_CONTEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_RESET_FAILED_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_RESET_RANGED_COMBAT_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_RESISTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1254,6 +1516,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_RESURRECT_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_RESURRECT_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_RESYNC_RUNES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ROLE_POLL_BEGIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_RWHOIS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SCRIPT_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SELL_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1267,6 +1530,9 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_SERVER_FIRST_ACHIEVEMENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SERVER_INFO_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SERVER_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SERVER_PERF, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SETUP_RESEARCH_HISTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SET_DF_FAST_LAUNCH_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SET_EXTRA_AURA_INFO_NEED_UPDATE_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SET_EXTRA_AURA_INFO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SET_FACTION_ATWAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1277,10 +1543,13 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_SET_PCT_SPELL_MODIFIER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SET_PHASE_SHIFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SET_PLAY_HOVER_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SET_PROFICIENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SET_PROJECTILE_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SHOWTAXINODES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SHOW_BANK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SHOW_RATINGS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SOR_START_EXPERIENCE_INCOMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SHOW_MAILBOX, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELLBREAKLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELLDAMAGESHIELD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1288,11 +1557,13 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_SPELLENERGIZELOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELLHEALLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELLINSTAKILLLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELLINTERRUPTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELLLOGEXECUTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELLLOGMISS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELLNONMELEEDAMAGELOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELLORDAMAGE_IMMUNE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELLSTEALLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELL_CATEGORY_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELL_CHANCE_PROC_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELL_CHANCE_RESIST_PUSHBACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELL_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1345,12 +1616,17 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_STABLE_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_STANDSTATE_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_START_MIRROR_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_START_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_STOP_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_STOP_MIRROR_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_STREAMING_MOVIE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SUMMON_CANCEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SUMMON_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SUPERCEDED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SUPPRESS_NPC_GREETINGS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SUSPEND_COMMS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SUSPEND_TOKEN_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_TALENTS_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TALENTS_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TALENTS_INVOLUNTARILY_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TAXINODE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1359,6 +1635,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_THREAT_CLEAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_THREAT_REMOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_THREAT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_TIME_ADJUSTMENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TIME_SYNC_REQ, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TITLE_EARNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TOGGLE_XP_GAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1366,6 +1643,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_TRADE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TRADE_STATUS_EXTENDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_SUCCEEDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TRAINER_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TRANSFER_ABORTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1374,14 +1652,20 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_TRIGGER_MOVIE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TURN_IN_PETITION_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TUTORIAL_FLAGS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_UNIT_HEALTH_FREQUENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_UNIT_SPELLCAST_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ACCOUNT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ACCOUNT_DATA_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_COMBO_POINTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_CURRENCY_WEEK_LIMIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_DUNGEON_ENCOUNTER_FOR_LOOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_INSTANCE_ENCOUNTER_UNIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_INSTANCE_OWNERSHIP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ITEM_ENCHANTMENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_LAST_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_SERVER_PLAYER_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_WORLD_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_USERLIST_ADD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_USERLIST_REMOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1396,14 +1680,25 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SET_TALKER_MUTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_VOID_ITEM_SWAP_RESPONSE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_VOID_STORAGE_CONTENTS, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_VOID_STORAGE_FAILED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_VOID_STORAGE_TRANSFER_CHANGES, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_VOID_TRANSFER_RESULT, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_WAIT_QUEUE_FINISH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_WAIT_QUEUE_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_VOID_STORAGE_FAILED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_WARDEN_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_WARGAME_CHECK_ENTRY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_WARGAME_REQUEST_SENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_WEATHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_WEEKLY_LAST_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_WEEKLY_RESET_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_WEEKLY_SPELL_USAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_WEEKLY_SPELL_USAGE_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_WHO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_WHOIS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_WORLD_SERVER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_WORLD_STATE_UI_TIMER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_XP_GAIN_ABORTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ZONE_MAP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ZONE_UNDER_ATTACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 0dc53cc1c1c..77718da0cf4 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -73,7 +73,7 @@ enum Opcodes CMSG_AUTOSTORE_BANK_ITEM = 0x0607, CMSG_AUTOSTORE_GROUND_ITEM = 0x0000, CMSG_AUTOSTORE_LOOT_ITEM = 0x0E34, - CMSG_AUTO_DECLINE_GUILD_INVITES = 0x1234, + CMSG_AUTO_DECLINE_GUILD_INVITES = 0x2034, CMSG_BANKER_ACTIVATE = 0x0005, CMSG_BATTLEFIELD_JOIN = 0x0000, CMSG_BATTLEFIELD_LEAVE = 0x3018, @@ -101,7 +101,7 @@ enum Opcodes CMSG_CALENDAR_ARENA_TEAM = 0x0204, CMSG_CALENDAR_COMPLAIN = 0x4C36, CMSG_CALENDAR_CONTEXT_EVENT_SIGNUP = 0x0000, - CMSG_CALENDAR_COPY_EVENT = 0x0000, + CMSG_CALENDAR_COPY_EVENT = 0x0207, CMSG_CALENDAR_EVENT_INVITE = 0x2435, CMSG_CALENDAR_EVENT_MODERATOR_STATUS = 0x6B35, CMSG_CALENDAR_EVENT_REMOVE_INVITE = 0x4337, @@ -662,7 +662,7 @@ enum Opcodes MSG_MOVE_WATER_WALK = 0x0000, MSG_MOVE_WORLDPORT_ACK = 0x2411, MSG_NOTIFY_PARTY_SQUELCH = 0x4D06, - MSG_PARTY_ASSIGNMENT = 0x0000, + MSG_PARTY_ASSIGNMENT = 0x0424, MSG_PETITION_DECLINE = 0x4905, MSG_PETITION_RENAME = 0x4005, MSG_PVP_LOG_DATA = 0x0000, @@ -920,13 +920,13 @@ enum Opcodes SMSG_GROUPACTION_THROTTLED = 0x6524, SMSG_GROUP_CANCEL = 0x4D25, SMSG_GROUP_DECLINE = 0x6835, - SMSG_GROUP_DESTROYED = 0x0000, + SMSG_GROUP_DESTROYED = 0x2207, SMSG_GROUP_INVITE = 0x31B2, SMSG_GROUP_JOINED_BATTLEGROUND = 0x35A1, SMSG_GROUP_LIST = 0x4C24, SMSG_GROUP_SET_LEADER = 0x0526, SMSG_GROUP_SET_ROLE = 0x39A6, - SMSG_GROUP_UNINVITE = 0x0000, + SMSG_GROUP_UNINVITE = 0x0A07, SMSG_GUILD_ACHIEVEMENT_DATA = 0x54B7, SMSG_GUILD_ACHIEVEMENT_DELETED = 0x35A0, SMSG_GUILD_ACHIEVEMENT_EARNED = 0x50B5, @@ -1116,7 +1116,7 @@ enum Opcodes SMSG_MOVE_SET_VEHICLE_REC_ID = 0x0000, SMSG_MOVE_SET_WALK_IN_AIR = 0x0000, SMSG_MOVE_SET_WALK_SPEED = 0x1DA4, - SMSG_MOVE_UNROOT = 0x0000, + SMSG_MOVE_UNROOT = 0x7DB4, SMSG_MOVE_UNSET_CAN_FLY = 0x15A2, SMSG_MOVE_UNSET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY = 0x7DB2, SMSG_MOVE_UNSET_HOVER = 0x51B3, @@ -1249,7 +1249,7 @@ enum Opcodes SMSG_RESEARCH_COMPLETE = 0x35A6, SMSG_RESEARCH_SETUP_HISTORY = 0x10B6, SMSG_RESET_COMPRESSION_CONTEXT = 0x0142, - SMSG_RESET_FAILED_NOTIFY = 0x0000, + SMSG_RESET_FAILED_NOTIFY = 0x4616, SMSG_RESISTLOG = 0x0000, SMSG_RESPOND_INSPECT_ACHIEVEMENTS = 0x15B0, SMSG_RESURRECT_REQUEST = 0x2905, -- cgit v1.2.3 From 638dc3ddbea5b9caeac4de35aac5c911d01aa683 Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 6 Aug 2012 23:27:29 +0100 Subject: Core/Opcodes: Fix some wrong handler assigments/dupes --- src/server/game/Server/Protocol/Opcodes.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 43798dd24be..e6c414570ed 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -503,7 +503,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_CAN_FLY_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveSetCanFlyAckOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_COLLISION_HEIGHT_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_COLLISION_HEIGHT_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_FLY, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_RELATIVE_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_VEHICLE_REC_ID_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -603,7 +603,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_REFER_A_FRIEND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_REFORGE_ITEM, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleReforgeItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_REORDER_CHARACTERS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(SMSG_REFORGE_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(CMSG_REMOVE_GLYPH, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRemoveGlyph ); DEFINE_OPCODE_HANDLER(CMSG_REPAIR_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepairItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_REPLACE_ACCOUNT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -751,7 +750,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_TOGGLE_PVP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTogglePvP ); //DEFINE_OPCODE_HANDLER(CMSG_TOGGLE_XP_GAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_TOTEM_DESTROYED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTotemDestroyed ); - DEFINE_OPCODE_HANDLER(CMSG_TRANSMOGRIFY_ITEMS, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleTransmogrifyItems ); //DEFINE_OPCODE_HANDLER(CMSG_TRAINER_BUY_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerBuySpellOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_TRAINER_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerListOpcode ); DEFINE_OPCODE_HANDLER(CMSG_TRANSMOGRIFY_ITEMS, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleTransmogrifyItems ); @@ -782,7 +780,6 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_VIOLENCE_LEVEL, STATUS_AUTHED, PROCESS_INPLACE, &WorldSession::HandleViolenceLevel ); DEFINE_OPCODE_HANDLER(CMSG_VOICE_SESSION_ENABLE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleVoiceSessionEnableOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_VOICE_SET_TALKER_MUTED_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_VOID_STORAGE_UNLOCK, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleVoidStorageUnlock ); DEFINE_OPCODE_HANDLER(CMSG_VOID_STORAGE_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleVoidStorageQuery ); DEFINE_OPCODE_HANDLER(CMSG_VOID_STORAGE_TRANSFER, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleVoidStorageTransfer ); DEFINE_OPCODE_HANDLER(CMSG_VOID_STORAGE_UNLOCK, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleVoidStorageUnlock ); @@ -829,7 +826,6 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(MSG_MOVE_JUMP, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_ALL_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_COLLISION_HEIGHT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_FACING, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_FLIGHT_BACK_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_FLIGHT_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -1192,7 +1188,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_GUILD_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_EVENT_LOG_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_FLAGGED_FOR_RENAME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GUILD_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_INVITE_CANCEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_KNOWN_RECIPES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1353,7 +1349,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_ACTIVE_MOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_COLLISION_HEIGHT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_COLLISION_HEIGHT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_COMPOUND_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1685,7 +1681,6 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_VOID_TRANSFER_RESULT, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_WAIT_QUEUE_FINISH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_WAIT_QUEUE_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_VOID_STORAGE_FAILED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_WARDEN_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_WARGAME_CHECK_ENTRY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_WARGAME_REQUEST_SENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From 892d88c89a86adf865ccfec1033d0d7ba5eba07c Mon Sep 17 00:00:00 2001 From: Kaldorei Date: Tue, 7 Aug 2012 02:17:01 +0300 Subject: Fixed SMSG_GROUP_INVITE --- src/server/game/Handlers/GroupHandler.cpp | 100 ++++++++++++++++++++++++++---- 1 file changed, 88 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp index c6870bca98d..433930bd7c6 100755 --- a/src/server/game/Handlers/GroupHandler.cpp +++ b/src/server/game/Handlers/GroupHandler.cpp @@ -96,6 +96,8 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket & recvData) recvData.ReadByteSeq(crossRealmGuid[5]); recvData.ReadByteSeq(crossRealmGuid[3]); recvData.ReadByteSeq(crossRealmGuid[2]); + + ObjectGuid inviterGuid = GetPlayer()->GetGUID(); // attempt add selected player @@ -161,12 +163,49 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket & recvData) if (group2) { // tell the player that they were invited but it failed as they were already in a group - WorldPacket data(SMSG_GROUP_INVITE, 10); // guess size - data << uint8(0); // invited/already in group flag - data << GetPlayer()->GetName(); // max len 48 - data << uint32(0); // unk - data << uint8(0); // count - data << uint32(0); // unk + WorldPacket data(SMSG_GROUP_INVITE, 10); + data.WriteBit(0); + data.WriteBit(inviterGuid[0]); + data.WriteBit(inviterGuid[3]); + data.WriteBit(inviterGuid[2]); + data.WriteBit(0); // Already in group byte + data.WriteBit(inviterGuid[6]); + data.WriteBit(inviterGuid[5]); + + data.WriteBits(0, 9); // Cross realm name or invited name size + data.WriteBit(inviterGuid[4]); + data.WriteBits(strlen(GetPlayer()->GetName()), 7); + data.WriteBits(0, 24); // Count 2 + + data.WriteBit(0); + + data.WriteBit(inviterGuid[1]); + data.WriteBit(inviterGuid[7]); + + data.WriteByteSeq(inviterGuid[1]); + data.WriteByteSeq(inviterGuid[4]); + + data << int32(getMSTime()); + data << int32(0); + data << int32(0); + + data.WriteByteSeq(inviterGuid[6]); + data.WriteByteSeq(inviterGuid[0]); + data.WriteByteSeq(inviterGuid[2]); + data.WriteByteSeq(inviterGuid[3]); + + // for count2 { int32(0) } + + data.WriteByteSeq(inviterGuid[5]); + + // If it's cross realm here is Realm Name, if it's normal case place here Player Name + data.append((uint8 const*)GetPlayer()->GetName(), strlen(GetPlayer()->GetName())); + + data.WriteByteSeq(inviterGuid[7]); + + // Player name in Cross Realm case + + data << int32(0); player->GetSession()->SendPacket(&data); } @@ -217,12 +256,49 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket & recvData) } // ok, we do it - WorldPacket data(SMSG_GROUP_INVITE, 10); // guess size - data << uint8(1); // invited/already in group flag - data << GetPlayer()->GetName(); // max len 48 - data << uint32(0); // unk - data << uint8(0); // count - data << uint32(0); // unk + WorldPacket data(SMSG_GROUP_INVITE, 10); + data.WriteBit(0); + data.WriteBit(inviterGuid[0]); + data.WriteBit(inviterGuid[3]); + data.WriteBit(inviterGuid[2]); + data.WriteBit(1); // Already in group byte + data.WriteBit(inviterGuid[6]); + data.WriteBit(inviterGuid[5]); + + data.WriteBits(0, 9); // Cross realm name or invited name size + data.WriteBit(inviterGuid[4]); + data.WriteBits(strlen(GetPlayer()->GetName()), 7); + data.WriteBits(0, 24); // Count 2 + + data.WriteBit(0); + + data.WriteBit(inviterGuid[1]); + data.WriteBit(inviterGuid[7]); + + data.WriteByteSeq(inviterGuid[1]); + data.WriteByteSeq(inviterGuid[4]); + + data << int32(getMSTime()); + data << int32(0); + data << int32(0); + + data.WriteByteSeq(inviterGuid[6]); + data.WriteByteSeq(inviterGuid[0]); + data.WriteByteSeq(inviterGuid[2]); + data.WriteByteSeq(inviterGuid[3]); + + // for count2 { int32(0) } + + data.WriteByteSeq(inviterGuid[5]); + + // If it's cross realm here is Realm Name, if it's normal case place here Player Name + data.append((uint8 const*)GetPlayer()->GetName(), strlen(GetPlayer()->GetName())); + + data.WriteByteSeq(inviterGuid[7]); + + // Player name in Cross Realm case + + data << int32(0); player->GetSession()->SendPacket(&data); SendPartyResult(PARTY_OP_INVITE, memberName, ERR_PARTY_RESULT_OK); -- cgit v1.2.3 From 7c9f8660c5a81da3e9e132316687cefe92ae2f2d Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 7 Aug 2012 00:56:59 +0100 Subject: Cleanup and fix commit 96765f81b6d8980262c0c8c6fcffa49c7e1439bc --- src/server/game/Handlers/GroupHandler.cpp | 130 +++++++++++++++++------------- 1 file changed, 74 insertions(+), 56 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp index 433930bd7c6..17a4d19e689 100755 --- a/src/server/game/Handlers/GroupHandler.cpp +++ b/src/server/game/Handlers/GroupHandler.cpp @@ -97,8 +97,6 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket & recvData) recvData.ReadByteSeq(crossRealmGuid[3]); recvData.ReadByteSeq(crossRealmGuid[2]); - ObjectGuid inviterGuid = GetPlayer()->GetGUID(); - // attempt add selected player // cheating @@ -148,6 +146,8 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket & recvData) return; } + ObjectGuid invitedGuid = player->GetGUID(); + Group* group = GetPlayer()->GetGroup(); if (group && group->isBGGroup()) group = GetPlayer()->GetOriginalGroup(); @@ -163,49 +163,58 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket & recvData) if (group2) { // tell the player that they were invited but it failed as they were already in a group - WorldPacket data(SMSG_GROUP_INVITE, 10); - data.WriteBit(0); - data.WriteBit(inviterGuid[0]); - data.WriteBit(inviterGuid[3]); - data.WriteBit(inviterGuid[2]); - data.WriteBit(0); // Already in group byte - data.WriteBit(inviterGuid[6]); - data.WriteBit(inviterGuid[5]); - - data.WriteBits(0, 9); // Cross realm name or invited name size - data.WriteBit(inviterGuid[4]); - data.WriteBits(strlen(GetPlayer()->GetName()), 7); + WorldPacket data(SMSG_GROUP_INVITE, 50); + + data.WriteBit(0); + + data.WriteBit(invitedGuid[0]); + data.WriteBit(invitedGuid[3]); + data.WriteBit(invitedGuid[2]); + + data.WriteBit(0); // Inverse already in group + + data.WriteBit(invitedGuid[6]); + data.WriteBit(invitedGuid[5]); + + data.WriteBits(strlen(GetPlayer()->GetName()), 9); // Inviter name length + + data.WriteBit(invitedGuid[4]); + + data.WriteBits(strlen(player->GetName()), 7); // Invited name length + data.WriteBits(0, 24); // Count 2 - + data.WriteBit(0); - data.WriteBit(inviterGuid[1]); - data.WriteBit(inviterGuid[7]); + data.WriteBit(invitedGuid[1]); + data.WriteBit(invitedGuid[7]); + + data.FlushBits(); - data.WriteByteSeq(inviterGuid[1]); - data.WriteByteSeq(inviterGuid[4]); + data.WriteByteSeq(invitedGuid[1]); + data.WriteByteSeq(invitedGuid[4]); data << int32(getMSTime()); data << int32(0); data << int32(0); - data.WriteByteSeq(inviterGuid[6]); - data.WriteByteSeq(inviterGuid[0]); - data.WriteByteSeq(inviterGuid[2]); - data.WriteByteSeq(inviterGuid[3]); + data.WriteByteSeq(invitedGuid[6]); + data.WriteByteSeq(invitedGuid[0]); + data.WriteByteSeq(invitedGuid[2]); + data.WriteByteSeq(invitedGuid[3]); // for count2 { int32(0) } - data.WriteByteSeq(inviterGuid[5]); + data.WriteByteSeq(invitedGuid[5]); - // If it's cross realm here is Realm Name, if it's normal case place here Player Name - data.append((uint8 const*)GetPlayer()->GetName(), strlen(GetPlayer()->GetName())); + data.append((uint8 const*)GetPlayer()->GetName(), strlen(GetPlayer()->GetName())); // inviter name - data.WriteByteSeq(inviterGuid[7]); + data.WriteByteSeq(invitedGuid[7]); - // Player name in Cross Realm case + data.append((uint8 const*)player->GetName(), strlen(player->GetName())); // invited name data << int32(0); + player->GetSession()->SendPacket(&data); } @@ -256,49 +265,58 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket & recvData) } // ok, we do it - WorldPacket data(SMSG_GROUP_INVITE, 10); + WorldPacket data(SMSG_GROUP_INVITE, 50); + data.WriteBit(0); - data.WriteBit(inviterGuid[0]); - data.WriteBit(inviterGuid[3]); - data.WriteBit(inviterGuid[2]); - data.WriteBit(1); // Already in group byte - data.WriteBit(inviterGuid[6]); - data.WriteBit(inviterGuid[5]); - - data.WriteBits(0, 9); // Cross realm name or invited name size - data.WriteBit(inviterGuid[4]); - data.WriteBits(strlen(GetPlayer()->GetName()), 7); + + data.WriteBit(invitedGuid[0]); + data.WriteBit(invitedGuid[3]); + data.WriteBit(invitedGuid[2]); + + data.WriteBit(1); // Inverse already in group + + data.WriteBit(invitedGuid[6]); + data.WriteBit(invitedGuid[5]); + + data.WriteBits(strlen(GetPlayer()->GetName()), 9); // Inviter name length + + data.WriteBit(invitedGuid[4]); + + data.WriteBits(strlen(player->GetName()), 7); // Invited name length + data.WriteBits(0, 24); // Count 2 - + data.WriteBit(0); - data.WriteBit(inviterGuid[1]); - data.WriteBit(inviterGuid[7]); - - data.WriteByteSeq(inviterGuid[1]); - data.WriteByteSeq(inviterGuid[4]); - + data.WriteBit(invitedGuid[1]); + data.WriteBit(invitedGuid[7]); + + data.FlushBits(); + + data.WriteByteSeq(invitedGuid[1]); + data.WriteByteSeq(invitedGuid[4]); + data << int32(getMSTime()); data << int32(0); data << int32(0); - data.WriteByteSeq(inviterGuid[6]); - data.WriteByteSeq(inviterGuid[0]); - data.WriteByteSeq(inviterGuid[2]); - data.WriteByteSeq(inviterGuid[3]); + data.WriteByteSeq(invitedGuid[6]); + data.WriteByteSeq(invitedGuid[0]); + data.WriteByteSeq(invitedGuid[2]); + data.WriteByteSeq(invitedGuid[3]); // for count2 { int32(0) } - data.WriteByteSeq(inviterGuid[5]); + data.WriteByteSeq(invitedGuid[5]); - // If it's cross realm here is Realm Name, if it's normal case place here Player Name - data.append((uint8 const*)GetPlayer()->GetName(), strlen(GetPlayer()->GetName())); + data.append((uint8 const*)GetPlayer()->GetName(), strlen(GetPlayer()->GetName())); // inviter name - data.WriteByteSeq(inviterGuid[7]); + data.WriteByteSeq(invitedGuid[7]); + + data.append((uint8 const*)player->GetName(), strlen(player->GetName())); // invited name - // Player name in Cross Realm case - data << int32(0); + player->GetSession()->SendPacket(&data); SendPartyResult(PARTY_OP_INVITE, memberName, ERR_PARTY_RESULT_OK); -- cgit v1.2.3 From 32e0c36112fb7fefbe3ecd6b886255bf6cff1d1a Mon Sep 17 00:00:00 2001 From: horn Date: Tue, 7 Aug 2012 01:03:37 +0100 Subject: Cleanup, remove whitespace and move placeholders for opcodes that are not in WPP (not found) --- src/server/game/Server/Protocol/Opcodes.cpp | 1166 ++++++++++++++------------- 1 file changed, 585 insertions(+), 581 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index e6c414570ed..2cef8fc6d19 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -46,15 +46,10 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_ACCEPT_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAcceptTradeOpcode ); DEFINE_OPCODE_HANDLER(CMSG_ACTIVATETAXI, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleActivateTaxiOpcode ); DEFINE_OPCODE_HANDLER(CMSG_ACTIVATETAXIEXPRESS, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleActivateTaxiExpressOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_ACTIVE_PVP_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_ADDON_REGISTERED_PREFIXES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_ADDON_REGISTERED_PREFIXES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_ADD_FRIEND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddFriendOpcode ); DEFINE_OPCODE_HANDLER(CMSG_ADD_IGNORE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddIgnoreOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_ADD_PVP_MEDAL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_ADD_VOICE_IGNORE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_ADVANCE_SPAWN_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_AFK_MONITOR_INFO_CLEAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_AFK_MONITOR_INFO_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_ALTER_APPEARANCE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAlterAppearance ); DEFINE_OPCODE_HANDLER(CMSG_AREATRIGGER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaTriggerOpcode ); DEFINE_OPCODE_HANDLER(CMSG_AREA_SPIRIT_HEALER_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaSpiritHealerQueryOpcode); @@ -79,9 +74,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_REMOVE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionRemoveItem ); //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_SELL_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionSellItem ); DEFINE_OPCODE_HANDLER(CMSG_AUTH_SESSION, STATUS_NEVER, PROCESS_THREADUNSAFE, &WorldSession::Handle_EarlyProccess ); - //DEFINE_OPCODE_HANDLER(CMSG_AUTH_SRP6_BEGIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_AUTH_SRP6_PROOF, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_AUTH_SRP6_RECODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_AUTOBANK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoBankItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_AUTOEQUIP_GROUND_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_AUTOEQUIP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoEquipItemOpcode ); @@ -90,46 +82,36 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_BANK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoStoreBankItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_GROUND_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_LOOT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutostoreLootItemOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_AUTO_DECLINE_GUILD_INVITES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_AUTO_DECLINE_GUILD_INVITES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_BANKER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBankerActivateOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_JOIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_LEAVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_LEAVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlefieldListOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MANAGER_ADVANCE_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MANAGER_SET_NEXT_TRANSITION_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_ENTRY_INVITE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_EXIT_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_QUEUE_INVITE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_QUEUE_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_PORT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattleFieldPortOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_REQUEST_SCORE_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); Need to send the response + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_REQUEST_SCORE_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); Need to send the response //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_STATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlefieldStatusOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEGROUND_PLAYER_POSITIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlemasterHelloOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEGROUND_PLAYER_POSITIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_JOIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlemasterJoinOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_JOIN_ARENA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlemasterJoinArena ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_JOIN_RATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_BEASTMASTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_JOIN_RATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_BEGIN_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBeginTradeOpcode ); DEFINE_OPCODE_HANDLER(CMSG_BINDER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBinderActivateOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_BOOTME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_BOT_DETECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_BOT_DETECTED2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_BUG, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBugOpcode ); DEFINE_OPCODE_HANDLER(CMSG_BUSY_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBusyTradeOpcode ); DEFINE_OPCODE_HANDLER(CMSG_BUYBACK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuybackItem ); DEFINE_OPCODE_HANDLER(CMSG_BUY_BANK_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyBankSlotOpcode ); DEFINE_OPCODE_HANDLER(CMSG_BUY_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyItemOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_BUY_ITEM_IN_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyItemInSlotOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_BUY_LOTTERY_TICKET_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_BUY_STABLE_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyStableSlot ); //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_ADD_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarAddEvent ); //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_ARENA_TEAM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarArenaTeam ); //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_COMPLAIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarComplain ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_CONTEXT_EVENT_SIGNUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_CONTEXT_EVENT_SIGNUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_COPY_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarCopyEvent ); //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventInvite ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_INVITE_NOTES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_MODERATOR_STATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventModeratorStatus); //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_REMOVE_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventRemoveInvite ); //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_RSVP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventRsvp ); @@ -147,13 +129,11 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_CHANNELLING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelChanneling ); //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_GROWTH_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelGrowthAuraOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_MOUNT_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelMountAuraOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_QUEUED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_QUEUED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_TEMP_ENCHANTMENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelTempEnchantmentOpcode); DEFINE_OPCODE_HANDLER(CMSG_CANCEL_TRADE, STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelTradeOpcode); DEFINE_OPCODE_HANDLER(CMSG_CAST_SPELL, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleCastSpellOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_CHANGEPLAYER_DIFFICULTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANGE_GDF_ARENA_RATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANGE_PERSONAL_ARENA_RATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_ANNOUNCEMENTS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelAnnouncements ); //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_BAN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelBan ); @@ -166,7 +146,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_MUTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelMute ); //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_OWNER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelOwner ); //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_PASSWORD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelPassword ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_ROSTER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_ROSTER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_SET_OWNER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelSetOwner ); //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_SILENCE_ALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_SILENCE_VOICE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -177,7 +157,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNSILENCE_VOICE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_VOICE_OFF, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_VOICE_ON, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelVoiceOnOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_CHARACTER_POINT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_CHAR_CREATE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharCreateOpcode ); DEFINE_OPCODE_HANDLER(CMSG_CHAR_CUSTOMIZE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharCustomize ); DEFINE_OPCODE_HANDLER(CMSG_CHAR_DELETE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharDeleteOpcode ); @@ -187,103 +166,57 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_CHAR_RENAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharRenameOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_CHAT_FILTERED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CHAT_IGNORED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChatIgnoredOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_PLAYER_LOGIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_PLAYER_LOOKUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_SETMONEY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_SET_ARENA_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_SET_HONOR_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CHECK_LOGIN_CRITERIA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_CHANNEL_WATCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_RAID_MARKER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_EXPLORATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_HOLIDAY_BG_WIN_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_QUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_RANDOM_BG_WIN_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_SERVER_BUCK_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_RAID_MARKER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_CLEAR_TRADE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleClearTradeItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_ENTER_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_EXIT_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_GET_MAP_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_GET_PARTY_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_GET_PARTY_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_GET_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_INSTANCE_COMMAND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_SKIRMISH_QUEUE_COMMAND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_START_WARGAME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_START_WARGAME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_COMPLAIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleComplainOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_COMPLETE_ACHIEVEMENT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_COMPLETE_CINEMATIC, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCompleteCinematic ); //DEFINE_OPCODE_HANDLER(CMSG_COMPLETE_MOVIE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CONNECT_TO_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CONNECT_TO_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_CONTACT_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleContactListOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_CONTROLLER_EJECT_PASSENGER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEjectPassenger ); - //DEFINE_OPCODE_HANDLER(CMSG_COOLDOWN_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CORPSE_MAP_POSITION_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCorpseMapPositionQuery ); - //DEFINE_OPCODE_HANDLER(CMSG_CREATEGAMEOBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CREATEITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CREATEMONSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_CREATURE_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleCreatureQueryOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_DANCE_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_DBLOOKUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_ACTIONS_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_ACTIONS_STOP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_AISTATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_CHANGECELLZONE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_LIST_TARGETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_PASSIVE_AURA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_SERVER_GEO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_DECHARGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_DECLINE_CHANNEL_INVITE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleChannelDeclineInvite ); - //DEFINE_OPCODE_HANDLER(CMSG_DELETEEQUIPMENT_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_DELETE_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_DEL_FRIEND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDelFriendOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_DELETEEQUIPMENT_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_DEL_FRIEND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDelFriendOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_DEL_IGNORE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDelIgnoreOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_DEL_PVP_MEDAL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_DEL_VOICE_IGNORE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_DESTROY_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDestroyItemOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_DESTROYMONSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_DESTROY_ITEMS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_DISABLE_PVP_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_DISMISS_CONTROLLED_VEHICLE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDismissControlledVehicle ); //DEFINE_OPCODE_HANDLER(CMSG_DISMISS_CRITTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDismissCritter ); - //DEFINE_OPCODE_HANDLER(CMSG_DROP_NEW_CONNECTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_DUEL_ACCEPTED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDuelAcceptedOpcode ); DEFINE_OPCODE_HANDLER(CMSG_DUEL_CANCELLED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDuelCancelledOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_DUNGEON_FINDER_GET_SYSTEM_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_EJECT_PASSENGER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_DUMP_OBJECTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DUNGEON_FINDER_GET_SYSTEM_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_EJECT_PASSENGER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEmoteOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_ENABLETAXI, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleTaxiQueryAvailableNodes ); - //DEFINE_OPCODE_HANDLER(CMSG_ENABLE_DAMAGE_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_ENABLE_NAGLE, STATUS_NEVER , PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); - //DEFINE_OPCODE_HANDLER(CMSG_END_BATTLEFIELD_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_EQUIPMENT_SET_DELETE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetDelete ); //DEFINE_OPCODE_HANDLER(CMSG_EQUIPMENT_SET_SAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetSave ); //DEFINE_OPCODE_HANDLER(CMSG_EQUIPMENT_SET_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetUse ); - //DEFINE_OPCODE_HANDLER(CMSG_EXPIRE_RAID_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_FAR_SIGHT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleFarSightOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_FLAG_QUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_FLAG_QUEST_FINISH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_FLOOD_GRACE_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_FORCEACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_FORCEACTIONONOTHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_FORCEACTIONSHOW, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_FORCE_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_FORCE_MOVE_ROOT_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveRootAck ); //DEFINE_OPCODE_HANDLER(CMSG_FORCE_MOVE_UNROOT_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveUnRootAck ); - //DEFINE_OPCODE_HANDLER(CMSG_FORCE_SAY_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJECT_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleGameObjectQueryOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJ_REPORT_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGameobjectReportUse ); DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJ_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGameObjectUseOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GAMESPEED_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GAMETIME_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GETDEATHBINDZONE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GET_CHANNEL_MEMBER_COUNT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGetChannelMemberCount ); //DEFINE_OPCODE_HANDLER(CMSG_GET_MAIL_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGetMailList ); //DEFINE_OPCODE_HANDLER(CMSG_GET_MIRRORIMAGE_DATA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMirrorImageDataRequest ); //DEFINE_OPCODE_HANDLER(CMSG_GHOST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GMRESPONSE_CREATE_TICKET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GMRESPONSE_RESOLVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMResponseResolve ); //DEFINE_OPCODE_HANDLER(CMSG_GMSURVEY_SUBMIT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMSurveySubmit ); //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_CREATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketCreateOpcode ); @@ -291,35 +224,10 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_GETTICKET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketGetTicketOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_SYSTEMSTATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketSystemStatusOpcode); //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_UPDATETEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketUpdateOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_CHARACTER_RESTORE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_CHARACTER_SAVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_CREATE_ITEM_TARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_DESTROY_ONLINE_CORPSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_FREEZE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_GRANT_ACHIEVEMENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GM_INVIS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_MOVECORPSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GM_NUKE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_NUKE_ACCOUNT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_NUKE_CHARACTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_REMOVE_ACHIEVEMENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GM_REPORT_LAG, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReportLag ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_REQUEST_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_RESURRECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_REVEALTO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_SET_CRITERIA_FOR_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GM_SET_SECURITY_GROUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_SHOW_COMPLAINTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_SILENCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_SUMMONMOB, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_TEACH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_UBERINVIS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_UNSQUELCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_UNTEACH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_UPDATE_TICKET_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_VISION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_WHISPER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GODMODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GOSSIP_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGossipHelloOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GOSSIP_SELECT_OPTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGossipSelectOptionOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GRANT_LEVEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGrantLevel ); @@ -330,134 +238,117 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_GROUP_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupDeclineOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_DISBAND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupDisbandOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GROUP_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupInviteOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GROUP_INVITE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GROUP_INVITE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_RAID_CONVERT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupRaidConvertOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GROUP_REQUEST_JOIN_UPDATES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GROUP_REQUEST_JOIN_UPDATES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_SET_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupSetLeaderOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GROUP_SET_ROLES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GROUP_SET_ROLES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_SWAP_SUB_GROUP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupSwapSubGroupOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_UNINVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupUninviteOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_UNINVITE_GUID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupUninviteGuidOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildAcceptOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_ACHIEVEMENT_MEMBERS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_ACHIEVEMENT_MEMBERS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_ACHIEVEMENT_PROGRESS_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildAchievementProgressQuery); DEFINE_OPCODE_HANDLER(CMSG_GUILD_ADD_RANK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildAddRankOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_ASSIGN_MEMBER_RANK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildAssignRankOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANKER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankerActivate ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_BUY_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankBuyTab ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_DEPOSIT_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankDepositMoney ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_LOG_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_LOG_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_MONEY_WITHDRAWN_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankMoneyWithdrawn ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_NOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_NOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_QUERY_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankQueryTab ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_QUERY_TEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_REM_MONEY_WITHDRAW_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_SET_TAB_TEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_QUERY_TEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_REM_MONEY_WITHDRAW_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_SET_TAB_TEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_SWAP_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankSwapItems ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_UPDATE_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankUpdateTab ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_WITHDRAW_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankWithdrawMoney ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_CHANGE_NAME_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_CHANGE_NAME_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_CREATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildCreateOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDeclineOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_DEL_RANK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDelRankOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_DEMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDemoteOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_DISBAND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDisbandOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_EVENT_LOG_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_EVENT_LOG_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildInfoOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_INFO_TEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildChangeInfoTextOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildInviteOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildLeaderOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildLeaveOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_MEMBER_SEND_SOR_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_MEMBER_SEND_SOR_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_MOTD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildMOTDOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_NEWS_UPDATE_STICKY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_NEWS_UPDATE_STICKY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_PERMISSIONS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildPermissions ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_PROMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildPromoteOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_QUERY, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildQueryOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_QUERY_NEWS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_QUERY_NEWS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_QUERY_RANKS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildQueryRanksOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_REMOVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildRemoveOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_REPLACE_GUILD_MASTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_REQUEST_CHALLENGE_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_REQUEST_MAX_DAILY_XP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_REPLACE_GUILD_MASTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_REQUEST_CHALLENGE_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_REQUEST_MAX_DAILY_XP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_ROSTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildRosterOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_SET_ACHIEVEMENT_TRACKING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_SET_GUILD_MASTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_SET_GUILD_MASTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_SET_NOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildSetNoteOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_SET_RANK_PERMISSIONS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildSetRankPermissionsOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_SWITCH_RANK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_SET_RANK_PERMISSIONS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildSetRankPermissionsOpcode); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_SWITCH_RANK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_HEARTH_AND_RESURRECT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleHearthAndResurrect ); - //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_DIMINISHING_RETURNS_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_KNOCKBACK_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_REQUIREMENTS_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_IGNORE_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleIgnoreTradeOpcode ); DEFINE_OPCODE_HANDLER(CMSG_INITIATE_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInitiateTradeOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_INSPECT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_INSTANCE_LOCK_WARNING_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_INSTANCE_LOCK_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInstanceLockResponse ); + //DEFINE_OPCODE_HANDLER(CMSG_INSTANCE_LOCK_WARNING_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_ITEM_REFUND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemRefund ); DEFINE_OPCODE_HANDLER(CMSG_ITEM_REFUND_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemRefundInfoRequest ); //DEFINE_OPCODE_HANDLER(CMSG_ITEM_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemTextQuery ); DEFINE_OPCODE_HANDLER(CMSG_JOIN_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleJoinChannel ); DEFINE_OPCODE_HANDLER(CMSG_KEEP_ALIVE, STATUS_NEVER, PROCESS_THREADUNSAFE, &WorldSession::Handle_EarlyProccess ); - //DEFINE_OPCODE_HANDLER(CMSG_LEARN_DANCE_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_LEARN_PREVIEW_TALENTS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnPreviewTalents ); //DEFINE_OPCODE_HANDLER(CMSG_LEARN_PREVIEW_TALENTS_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnPreviewTalentsPet ); - //DEFINE_OPCODE_HANDLER(CMSG_LEARN_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_LEARN_TALENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnTalentOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LEAVE_BATTLEFIELD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLeaveBattlefieldOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LEAVE_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLeaveChannel ); - //DEFINE_OPCODE_HANDLER(CMSG_LFG_GET_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LEVEL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LFD_PARTY_LOCK_INFO_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgPartyLockInfoRequestOpcode); - //DEFINE_OPCODE_HANDLER(CMSG_LFD_PLAYER_LOCK_INFO_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgPlayerLockInfoRequestOpcode); + //DEFINE_OPCODE_HANDLER(CMSG_LFG_GET_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_LFG_GET_STATUS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_LFG_JOIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgJoinOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LFG_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgLeaveOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_LFG_LFR_JOIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LFG_LFR_LEAVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LFG_PARTY_LOCK_INFO_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LFG_LFR_JOIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LFG_LFR_LEAVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LFG_PARTY_LOCK_INFO_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_LFG_PROPOSAL_RESULT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgProposalResultOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_BOOT_VOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetBootVoteOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_COMMENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_NEEDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_COMMENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_ROLES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetRolesOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LFG_TELEPORT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgTeleportOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_ADD_RECRUIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_BROWSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_DECLINE_RECRUIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_GET_APPLICATIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_GET_RECRUITS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_JOIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_POST_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_REMOVE_RECRUIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_SET_GUILD_POST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_ADD_RECRUIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_BROWSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_DECLINE_RECRUIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_GET_APPLICATIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_GET_RECRUITS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_JOIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_POST_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_REMOVE_RECRUIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_SET_GUILD_POST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_LIST_INVENTORY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleListInventoryOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_LOAD_DANCES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_LOAD_SCREEN, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleLoadScreenOpcode ); DEFINE_OPCODE_HANDLER(CMSG_LOGOUT_CANCEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLogoutCancelOpcode ); DEFINE_OPCODE_HANDLER(CMSG_LOGOUT_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLogoutRequestOpcode ); DEFINE_OPCODE_HANDLER(CMSG_LOG_DISCONNECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); //DEFINE_OPCODE_HANDLER(CMSG_LOOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_LOOT_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LOOT_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_LOOT_MASTER_GIVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMasterGiveOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LOOT_METHOD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMethodOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LOOT_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMoneyOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LOOT_RELEASE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootReleaseOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LOOT_ROLL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootRoll ); - //DEFINE_OPCODE_HANDLER(CMSG_LOTTERY_QUERY_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LUA_USAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MAELSTROM_GM_SENT_MAIL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MAELSTROM_INVALIDATE_CACHE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MAELSTROM_RENAME_GUILD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_MAIL_CREATE_TEXT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailCreateTextItem ); //DEFINE_OPCODE_HANDLER(CMSG_MAIL_DELETE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailDelete ); //DEFINE_OPCODE_HANDLER(CMSG_MAIL_MARK_AS_READ, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailMarkAsRead ); //DEFINE_OPCODE_HANDLER(CMSG_MAIL_RETURN_TO_SENDER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailReturnToSender ); //DEFINE_OPCODE_HANDLER(CMSG_MAIL_TAKE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailTakeItem ); //DEFINE_OPCODE_HANDLER(CMSG_MAIL_TAKE_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailTakeMoney ); - //DEFINE_OPCODE_HANDLER(CMSG_MAKEMONSTERATTACKGUID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MEETINGSTONE_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MEETINGSTONE_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_BATTLEGROUND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_GUILD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_OFFICER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); @@ -479,16 +370,14 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_YELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_MINIGAME_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_MOUNTSPECIAL_ANIM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMountSpecialAnimOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_CHARM_TELEPORT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_CHARACTER_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_CHARM_PORT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_CHARM_TELEPORT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_MOVE_CHNG_TRANSPORT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_ENABLE_SWIM_TO_FLY_TRANS_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_ENABLE_SWIM_TO_FLY_TRANS_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FALL_RESET, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FEATHER_FALL_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleFeatherFallAck ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_FLIGHT_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_PITCH_RATE_CHANGE_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_FLIGHT_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_PITCH_RATE_CHANGE_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_RUN_BACK_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_RUN_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_SWIM_BACK_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); @@ -500,27 +389,22 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_MOVE_HOVER_ACK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMoveHoverAck ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_KNOCK_BACK_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveKnockBackAck ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_NOT_ACTIVE_MOVER, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveNotActiveMover ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_CAN_FLY_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveSetCanFlyAckOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_COLLISION_HEIGHT_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_FLY, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_RELATIVE_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_VEHICLE_REC_ID_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_VEHICLE_REC_ID_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SPLINE_DONE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveSplineDoneOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_START_SWIM_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_STOP_SWIM_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_MOVE_TIME_SKIPPED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleMoveTimeSkippedOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_TOGGLE_COLLISION_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_TOGGLE_COLLISION_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_WATER_WALK_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveWaterWalkAck ); DEFINE_OPCODE_HANDLER(CMSG_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNameQueryOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_NEW_SPELL_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_NEXT_CINEMATIC_CAMERA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNextCinematicCamera ); - //DEFINE_OPCODE_HANDLER(CMSG_NO_SPELL_VARIANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_NPC_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNpcTextQueryOpcode ); DEFINE_OPCODE_HANDLER(CMSG_OBJECT_UPDATE_FAILED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleObjectUpdateFailedOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_OBJECT_UPDATE_RESCUED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_OBJECT_UPDATE_RESCUED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_OFFER_PETITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleOfferPetitionOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_OPENING_CINEMATIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_OPEN_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleOpenItemOpcode ); @@ -528,8 +412,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_PAGE_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePageTextQueryOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_PARTY_SILENCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_PARTY_UNSILENCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_PERFORM_ACTION_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_PETGODMODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_PETITION_BUY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionBuyOpcode ); DEFINE_OPCODE_HANDLER(CMSG_PETITION_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionQueryOpcode ); DEFINE_OPCODE_HANDLER(CMSG_PETITION_SHOWLIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionShowListOpcode ); @@ -540,29 +422,23 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_PET_CANCEL_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetCancelAuraOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_PET_CAST_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetCastSpellOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_PET_LEARN_TALENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetLearnTalent ); - //DEFINE_OPCODE_HANDLER(CMSG_PET_NAME_CACHE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_PET_LEVEL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_PET_NAME_CACHE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_PET_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetNameQuery ); //DEFINE_OPCODE_HANDLER(CMSG_PET_RENAME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetRename ); //DEFINE_OPCODE_HANDLER(CMSG_PET_SET_ACTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetSetAction ); //DEFINE_OPCODE_HANDLER(CMSG_PET_SPELL_AUTOCAST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetSpellAutocastOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_PET_STOP_ATTACK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetStopAttack ); - //DEFINE_OPCODE_HANDLER(CMSG_PET_UNLEARN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_PET_UNLEARN_TALENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_PING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); DEFINE_OPCODE_HANDLER(CMSG_PLAYED_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayedTime ); - //DEFINE_OPCODE_HANDLER(CMSG_PLAYER_DIFFICULTY_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_PLAYER_AI_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_PLAYER_DIFFICULTY_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_PLAYER_LOGIN, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayerLoginOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_PLAYER_LOGOUT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayerLogoutOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_PLAYER_VEHICLE_ENTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEnterPlayerVehicle ); //DEFINE_OPCODE_HANDLER(CMSG_PLAY_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_PROFILEDATA_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_PUSHQUESTTOPARTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePushQuestToParty ); - //DEFINE_OPCODE_HANDLER(CMSG_PVP_LOG_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_QUERY_BATTLEFIELD_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_QUERY_COMPLETION_NPC_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_PVP_QUEUE_STATS_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_PVP_LOG_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_QUERY_BATTLEFIELD_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_QUERY_COMPLETION_NPC_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_MAX_XP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_MEMBERS_FOR_RECIPE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_MEMBER_RECIPES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -570,12 +446,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_REWARDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_XP, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildQueryXPOpcode ); DEFINE_OPCODE_HANDLER(CMSG_QUERY_INSPECT_ACHIEVEMENTS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryInspectAchievements ); - //DEFINE_OPCODE_HANDLER(CMSG_QUERY_OBJECT_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_QUERY_OBJECT_ROTATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_QUERY_QUESTS_COMPLETED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryQuestsCompleted ); - //DEFINE_OPCODE_HANDLER(CMSG_QUERY_SERVER_BUCK_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_QUERY_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryTimeOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_QUERY_VEHICLE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_ACCEPT_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverAcceptQuestOpcode); //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_CANCEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverCancel ); DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_CHOOSE_REWARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverChooseRewardOpcode); @@ -589,40 +461,36 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_QUESTLOG_REMOVE_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestLogRemoveQuest ); //DEFINE_OPCODE_HANDLER(CMSG_QUESTLOG_SWAP_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestLogSwapQuest ); DEFINE_OPCODE_HANDLER(CMSG_QUEST_CONFIRM_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestConfirmAccept ); - //DEFINE_OPCODE_HANDLER(CMSG_QUEST_NPC_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_QUEST_NPC_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_QUEST_POI_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestPOIQuery ); //DEFINE_OPCODE_HANDLER(CMSG_QUEST_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestQueryOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_RANDOMIZE_CHAR_NAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRandomizeCharNameOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_RANDOMIZE_CHAR_NAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRandomizeCharNameOpcode ); DEFINE_OPCODE_HANDLER(CMSG_READY_FOR_ACCOUNT_DATA_TIMES, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleReadyForAccountDataTimes ); DEFINE_OPCODE_HANDLER(CMSG_READ_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReadItem ); DEFINE_OPCODE_HANDLER(CMSG_REALM_SPLIT, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRealmSplitOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_RECHARGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_RECLAIM_CORPSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReclaimCorpseOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_REDIRECTION_AUTH_PROOF, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_REDIRECTION_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_REFER_A_FRIEND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_REFORGE_ITEM, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleReforgeItemOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_REORDER_CHARACTERS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_REMOVE_GLYPH, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRemoveGlyph ); + DEFINE_OPCODE_HANDLER(CMSG_REFORGE_ITEM, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleReforgeItemOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_REORDER_CHARACTERS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_REPAIR_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepairItemOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_REPLACE_ACCOUNT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_REPLACE_ACCOUNT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_REPOP_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepopRequestOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_REPORT_PVP_AFK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReportPvPAFK ); DEFINE_OPCODE_HANDLER(CMSG_REQUEST_ACCOUNT_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestAccountData ); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_CATEGORY_COOLDOWNS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_CEMETERY_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_GUILD_PARTY_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_HONOR_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_CATEGORY_COOLDOWNS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_CEMETERY_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_GUILD_PARTY_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_HONOR_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_REQUEST_HOTFIX, STATUS_AUTHED, PROCESS_INPLACE, &WorldSession::HandleRequestHotfix ); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_INSPECT_RATED_BG_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_INSPECT_RATED_BG_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PARTY_MEMBER_STATS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestPartyMemberStatsOpcode); //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PET_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestPetInfoOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PVP_OPTIONS_ENABLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PVP_REWARDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PVP_OPTIONS_ENABLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PVP_REWARDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RAID_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestRaidInfoOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RATED_BG_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RATED_BG_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RESEARCH_HISTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RATED_BG_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RATED_BG_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RESEARCH_HISTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_EXIT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestVehicleExit ); //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_NEXT_SEAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_PREV_SEAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); @@ -630,125 +498,79 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_RESET_FACTION_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_RESET_INSTANCES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleResetInstancesOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_RESURRECT_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleResurrectResponseOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_RETURN_TO_GRAVEYARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReturnToGraveyard ); - //DEFINE_OPCODE_HANDLER(CMSG_ROLE_POLL_BEGIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SAVE_CUF_PROFILES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_RUN_SCRIPT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SAVE_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_RETURN_TO_GRAVEYARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReturnToGraveyard ); + //DEFINE_OPCODE_HANDLER(CMSG_ROLE_POLL_BEGIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SAVE_CUF_PROFILES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SAVE_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SEARCH_LFG_JOIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfrSearchOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SEARCH_LFG_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfrLeaveOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SELF_RES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSelfResOpcode ); DEFINE_OPCODE_HANDLER(CMSG_SELL_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSellItemOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_SEND_COMBAT_TRIGGER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SEND_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SEND_GENERAL_TRIGGER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SEND_LOCAL_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_SEND_MAIL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSendMail ); - //DEFINE_OPCODE_HANDLER(CMSG_SEND_SOR_REQUEST_VIA_ADDRESS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SEND_SOR_REQUEST_VIA_BNET_ACCOUNT_ID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SERVERINFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SEND_SOR_REQUEST_VIA_ADDRESS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SEND_SOR_REQUEST_VIA_BNET_ACCOUNT_ID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SERVERTIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SERVER_BROADCAST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SERVER_COMMAND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SERVER_INFO_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SETDEATHBINDPOINT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SETSHEATHED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleSetSheathedOpcode ); DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIONBAR_TOGGLES, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActionBarToggles ); //DEFINE_OPCODE_HANDLER(CMSG_SET_ACTION_BUTTON, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActionButtonOpcode ); DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIVE_MOVER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActiveMoverOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIVE_TALENT_GROUP_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIVE_VOICE_CHANNEL, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActiveVoiceChannel ); //DEFINE_OPCODE_HANDLER(CMSG_SET_ALLOW_LOW_LEVEL_RAID1, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_ALLOW_LOW_LEVEL_RAID2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_ARENA_MEMBER_SEASON_GAMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_ARENA_MEMBER_WEEKLY_GAMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_ARENA_TEAM_RATING_BY_INDEX, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_ARENA_TEAM_SEASON_GAMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_ARENA_TEAM_WEEKLY_GAMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_BREATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_CHANNEL_WATCH, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetChannelWatch ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_CHARACTER_MODEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_CONTACT_NOTES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetContactNotesOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_CURRENCY_FLAGS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_EVERYONE_IS_ASSISTANT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_CRITERIA_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_DURABILITY_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_EXPLORATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_EXPLORATION_ALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_CURRENCY_FLAGS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_EVERYONE_IS_ASSISTANT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_FACTION_ATWAR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetFactionAtWar ); //DEFINE_OPCODE_HANDLER(CMSG_SET_FACTION_CHEAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetFactionCheat ); //DEFINE_OPCODE_HANDLER(CMSG_SET_FACTION_INACTIVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetFactionInactiveOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_GLYPH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_GLYPH_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_GRANTABLE_LEVELS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_GUILD_BANK_TEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetGuildBankTabText ); //DEFINE_OPCODE_HANDLER(CMSG_SET_LFG_COMMENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetCommentOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_PET_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_PAID_SERVICE_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_PET_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_PLAYER_DECLINED_NAMES, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetPlayerDeclinedNames ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_PREFERED_CEMETERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_PRIMARY_TALENT_TREE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_RELATIVE_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_PVP_RANK_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_PVP_TITLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_RUNE_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_RUNE_COUNT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_PREFERED_CEMETERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_PRIMARY_TALENT_TREE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_RELATIVE_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_SAVED_INSTANCE_EXTEND, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_SET_SELECTION, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleSetSelectionOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SET_SKILL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_STAT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_SET_TAXI_BENCHMARK_MODE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTaxiBenchmarkOpcode ); DEFINE_OPCODE_HANDLER(CMSG_SET_TITLE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTitleOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_TRADE_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_TITLE_SUFFIX, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_TRADE_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_SET_TRADE_GOLD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTradeGoldOpcode ); DEFINE_OPCODE_HANDLER(CMSG_SET_TRADE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTradeItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SET_VEHICLE_REC_ID_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_SET_WATCHED_FACTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetWatchedFactionOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_WORLDSTATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_SHOWING_CLOAK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleShowingCloakOpcode ); DEFINE_OPCODE_HANDLER(CMSG_SHOWING_HELM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleShowingHelmOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_SKILL_BUY_RANK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SKILL_BUY_STEP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_SOCKET_GEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSocketOpcode ); DEFINE_OPCODE_HANDLER(CMSG_SPELLCLICK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSpellClick ); //DEFINE_OPCODE_HANDLER(CMSG_SPIRIT_HEALER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSpiritHealerActivateOpcode); //DEFINE_OPCODE_HANDLER(CMSG_SPLIT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSplitItemOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_STABLE_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStablePet ); - //DEFINE_OPCODE_HANDLER(CMSG_STABLE_REVIVE_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStableRevivePet ); - //DEFINE_OPCODE_HANDLER(CMSG_STABLE_SWAP_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStableSwapPet ); //DEFINE_OPCODE_HANDLER(CMSG_STANDSTATECHANGE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStandStateChangeOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_START_BATTLEFIELD_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_START_QUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_STOP_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_STORE_LOOT_IN_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SUBMIT_BUG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SUBMIT_COMPLAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SUGGESTION_SUBMIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SUBMIT_BUG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SUBMIT_COMPLAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SUGGESTION_SUBMIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SUMMON_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSummonResponseOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_SUSPEND_TOKEN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SUSPEND_COMMS_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SUSPEND_TOKEN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_SWAP_INV_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSwapInvItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SWAP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSwapItem ); //DEFINE_OPCODE_HANDLER(CMSG_SYNC_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_TARGET_CAST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_TARGET_SCRIPT_CAST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_TAXICLEARALLNODES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_TAXICLEARNODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_TAXIENABLEALLNODES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_TAXIENABLENODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_TAXINODE_STATUS_QUERY, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleTaxiNodeStatusQueryOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_TAXIQUERYAVAILABLENODES, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleTaxiQueryAvailableNodes ); //DEFINE_OPCODE_HANDLER(CMSG_TAXISHOWNODES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_TELEPORT_TO_UNIT, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_TEST_DROP_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_TEXT_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTextEmoteOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_TIME_ADJUSTMENT_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_TIME_ADJUSTMENT_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_TIME_SYNC_RESP, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleTimeSyncResp ); - //DEFINE_OPCODE_HANDLER(CMSG_TIME_SYNC_RESP_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_TIME_SYNC_RESP_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_TOGGLE_PVP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTogglePvP ); - //DEFINE_OPCODE_HANDLER(CMSG_TOGGLE_XP_GAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_TOTEM_DESTROYED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTotemDestroyed ); //DEFINE_OPCODE_HANDLER(CMSG_TRAINER_BUY_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerBuySpellOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_TRAINER_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerListOpcode ); @@ -759,87 +581,62 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_FLAG, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialFlag ); //DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_RESET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialReset ); DEFINE_OPCODE_HANDLER(CMSG_UNACCEPT_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnacceptTradeOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_UNCLAIM_LICENSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_UNDRESSPLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_UNITANIMTIER_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_DANCE_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_SKILL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnlearnSkillOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_SPECIALIZATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_UNREGISTER_ALL_ADDON_PREFIXES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_TALENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_UNSTABLE_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnstablePet ); - //DEFINE_OPCODE_HANDLER(CMSG_UNUSED5, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_UNUSED6, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_SPECIALIZATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_UNREGISTER_ALL_ADDON_PREFIXES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_UPDATE_ACCOUNT_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateAccountData ); //DEFINE_OPCODE_HANDLER(CMSG_UPDATE_MISSILE_TRAJECTORY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateMissileTrajectory ); //DEFINE_OPCODE_HANDLER(CMSG_UPDATE_PROJECTILE_POSITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateProjectilePosition ); - //DEFINE_OPCODE_HANDLER(CMSG_USED_FOLLOW, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_USED_FOLLOW, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_USE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUseItemOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_USE_SKILL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_VIOLENCE_LEVEL, STATUS_AUTHED, PROCESS_INPLACE, &WorldSession::HandleViolenceLevel ); DEFINE_OPCODE_HANDLER(CMSG_VOICE_SESSION_ENABLE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleVoiceSessionEnableOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_VOICE_SET_TALKER_MUTED_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_VOID_STORAGE_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleVoidStorageQuery ); DEFINE_OPCODE_HANDLER(CMSG_VOID_STORAGE_TRANSFER, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleVoidStorageTransfer ); DEFINE_OPCODE_HANDLER(CMSG_VOID_STORAGE_UNLOCK, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleVoidStorageUnlock ); DEFINE_OPCODE_HANDLER(CMSG_VOID_SWAP_ITEM, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleVoidSwapItem ); //DEFINE_OPCODE_HANDLER(CMSG_WARDEN_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleWardenDataOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_WARGAME_ACCEPT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_WARGAME_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_WEATHER_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_WARGAME_ACCEPT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_WARGAME_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_WHO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWhoOpcode ); DEFINE_OPCODE_HANDLER(CMSG_WHOIS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWhoisOpcode ); DEFINE_OPCODE_HANDLER(CMSG_WORLD_STATE_UI_TIMER_UPDATE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleWorldStateUITimerUpdate ); //DEFINE_OPCODE_HANDLER(CMSG_WORLD_TELEPORT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWorldTeleportOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_WRAP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWrapItemOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_XP_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_ZONEUPDATE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleZoneUpdateOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_ZONE_MAP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_AUCTION_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionHelloOpcode ); //DEFINE_OPCODE_HANDLER(MSG_BATTLEGROUND_PLAYER_POSITIONS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlegroundPlayerPositionsOpcode); //DEFINE_OPCODE_HANDLER(MSG_CHANNEL_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_CHANNEL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_CORPSE_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCorpseQueryOpcode ); - //DEFINE_OPCODE_HANDLER(MSG_DELAY_GHOST_TELEPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_DEV_SHOWLABEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_GM_ACCOUNT_ONLINE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_GM_BIND_OTHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_GM_CHANGE_ARENA_RATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_GM_DESTROY_CORPSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_GM_GEARRATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_GM_RESETINSTANCELIMIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_GM_SHOWLABEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_GM_SUMMON, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_GUILD_BANK_LOG_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankLogQuery ); //DEFINE_OPCODE_HANDLER(MSG_GUILD_EVENT_LOG_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildEventLogQueryOpcode ); //DEFINE_OPCODE_HANDLER(MSG_INSPECT_ARENA_TEAMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectArenaTeamsOpcode ); - //DEFINE_OPCODE_HANDLER(MSG_INSPECT_HONOR_STATS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectHonorStatsOpcode ); //DEFINE_OPCODE_HANDLER(MSG_LIST_STABLED_PETS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleListStabledPetsOpcode ); //DEFINE_OPCODE_HANDLER(MSG_MINIMAP_PING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMinimapPingOpcode ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_CHARM_TELEPORT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_CHARM_TELEPORT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_MOVE_FALL_LAND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_FEATHER_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_GRAVITY_CHNG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_MOVE_HEARTBEAT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_MOVE_JUMP, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_ALL_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_COLLISION_HEIGHT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_FACING, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_FLIGHT_BACK_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_FLIGHT_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_PITCH, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RAW_POSITION_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_PITCH_RATE_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RAW_POSITION_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_BACK_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_SWIM_BACK_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_SWIM_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_TURN_RATE_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_WALK_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_WALK_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_WALK_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_MOVE_START_ASCEND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); DEFINE_OPCODE_HANDLER(MSG_MOVE_START_BACKWARD, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); @@ -850,7 +647,6 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(MSG_MOVE_START_STRAFE_LEFT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); DEFINE_OPCODE_HANDLER(MSG_MOVE_START_STRAFE_RIGHT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); DEFINE_OPCODE_HANDLER(MSG_MOVE_START_SWIM, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_SWIM_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_MOVE_START_TURN_LEFT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); DEFINE_OPCODE_HANDLER(MSG_MOVE_START_TURN_RIGHT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); @@ -858,26 +654,23 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_PITCH, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_STRAFE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_SWIM, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_SWIM_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_TURN, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); DEFINE_OPCODE_HANDLER(MSG_MOVE_TELEPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_MOVE_TELEPORT_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveTeleportAck ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_TELEPORT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_TIME_SKIPPED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_TELEPORT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_TIME_SKIPPED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_TOGGLE_COLLISION_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_TOGGLE_FALL_LOGGING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_TOGGLE_LOGGING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_UNROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_MOUSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_TELEPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_MOUSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_TELEPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_MOVE_WORLDPORT_ACK, STATUS_TRANSFER, PROCESS_THREADUNSAFE, &WorldSession::HandleMoveWorldportAckOpcode ); //DEFINE_OPCODE_HANDLER(MSG_NOTIFY_PARTY_SQUELCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_NULL_ACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_PARTY_ASSIGNMENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePartyAssignmentOpcode ); DEFINE_OPCODE_HANDLER(MSG_PETITION_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionDeclineOpcode ); DEFINE_OPCODE_HANDLER(MSG_PETITION_RENAME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionRenameOpcode ); @@ -893,26 +686,24 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(MSG_SAVE_GUILD_EMBLEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSaveGuildEmblemOpcode ); DEFINE_OPCODE_HANDLER(MSG_SET_DUNGEON_DIFFICULTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetDungeonDifficultyOpcode); DEFINE_OPCODE_HANDLER(MSG_SET_RAID_DIFFICULTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetRaidDifficultyOpcode ); - //DEFINE_OPCODE_HANDLER(MSG_START_MOVE_FORWARD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_START_MOVE_FORWARD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_TABARDVENDOR_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTabardVendorActivateOpcode); DEFINE_OPCODE_HANDLER(MSG_TALENT_WIPE_CONFIRM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTalentWipeConfirmOpcode ); DEFINE_OPCODE_HANDLER(MSG_VERIFY_CONNECTIVITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); - //DEFINE_OPCODE_HANDLER(MSG_VIEW_PHASE_SHIFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(SMSG_ACCOUNT_DATA_TIMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ACCOUNT_INFO_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ACCOUNT_RESTRICTED_WARNING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ACCOUNT_INFO_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ACCOUNT_RESTRICTED_WARNING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ACHIEVEMENT_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ACHIEVEMENT_EARNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ACTION_BUTTONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ACTIVATETAXIREPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ADDON_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ADD_RUNE_POWER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_AFK_MONITOR_INFO_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_AI_REACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ALL_ACHIEVEMENT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_AREA_SPIRIT_HEALER_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_AREA_TRIGGER_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_AREA_TRIGGER_MOVEMENT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_AREA_TRIGGER_MOVEMENT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ARENA_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ARENA_OPPONENT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_CHANGE_FAILED_QUEUED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -938,36 +729,36 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_OWNER_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_REMOVED_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_AURACASTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_AURA_POINTS_DEPLETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_AURA_POINTS_DEPLETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_AURA_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_AURA_UPDATE_ALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_AUTH_CHALLENGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_AUTH_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_AVAILABLE_VOICE_CHANNEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_AVERAGE_ITEM_LEVEL_INFORM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_AVERAGE_ITEM_LEVEL_INFORM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BARBER_SHOP_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_EJECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_EJECT_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_ENTERED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_ENTRY_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_EXIT_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_EXIT_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_QUEUE_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_STATE_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_PLAYER_POSITIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_PLAYER_POSITIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_PORT_DENIED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_RATED_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_RATED_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS1, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS3, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS4, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS1, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS3, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS4, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_INFO_THROTTLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_PLAYER_JOINED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_PLAYER_LEFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_PLAYER_POSITIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_PLAYER_POSITIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_BINDER_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_BINDPOINTUPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BINDZONEREPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -975,7 +766,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_BUY_BANK_SLOT_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_BUY_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_BUY_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_ACTION_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_ACTION_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_ARENA_TEAM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_CLEAR_PENDING_ACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -997,61 +788,52 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_SEND_CALENDAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_SEND_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_SEND_NUM_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_UPDATE_INVITE_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_UPDATE_INVITE_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CAMERA_SHAKE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CANCEL_AUTO_REPEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CANCEL_COMBAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CAST_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHANGEPLAYER_DIFFICULTY_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHANNEL_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHANNEL_MEMBER_COUNT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CHANNEL_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHARACTER_LOGIN_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHARACTER_PROFILE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHARACTER_PROFILE_REALM_CONNECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CHAR_CREATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CHAR_CUSTOMIZE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CHAR_DELETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CHAR_ENUM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CHAR_FACTION_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CHAR_RENAME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHAT_IGNORED_ACCOUNT_MUTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHAT_IGNORED_ACCOUNT_MUTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHAT_NOT_IN_PARTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHAT_PLAYER_AMBIGUOUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHAT_PLAYER_NOT_FOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHAT_RESTRICTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHAT_SERVER_DISCONNECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHAT_SERVER_RECONNECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHAT_SERVER_DISCONNECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHAT_SERVER_RECONNECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHAT_WRONG_FACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY_RESPONSE_WRITE_FILE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHEAT_PLAYER_LOOKUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHECK_FOR_BOTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_BOSS_EMOTES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_BOSS_EMOTES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_COOLDOWNS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_EXTRA_AURA_INFO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_COOLDOWNS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_FAR_SIGHT_IMMEDIATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_TARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CLIENTCACHE_VERSION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CLIENT_CONTROL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMBAT_EVENT_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMBAT_LOG_MULTIPLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_GET_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMBAT_LOG_MULTIPLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_MAP_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_PARTY_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_PARTY_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_SKIRMISH_QUEUE_RESULT1, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_SKIRMISH_QUEUE_RESULT2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_STATE_CHANGED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMPLAIN_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMPLETION_NPC_RESPONCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMPLETION_NPC_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMPLETION_NPC_RESPONCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMPLETION_NPC_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_ACHIEVEMENT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_CHAR_ENUM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_GUILD_ROSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_CHAR_ENUM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_GUILD_ROSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_MOVES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_UNKNOWN_1310, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_UPDATE_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMSAT_CONNECT_FAIL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMSAT_DISCONNECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1060,49 +842,41 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_CONVERT_RUNE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COOLDOWN_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COOLDOWN_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CORPSE_IS_NOT_IN_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CORPSE_MAP_POSITION_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CORPSE_NOT_IN_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CORPSE_NOT_IN_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CORPSE_RECLAIM_DELAY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CREATURE_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CRITERIA_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CRITERIA_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CROSSED_INEBRIATION_THRESHOLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CURRENCY_LOOT_REMOVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CURRENCY_LOOT_RESTORED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CUSTOM_LOAD_SCREEN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CURRENCY_LOOT_REMOVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CURRENCY_LOOT_RESTORED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CUSTOM_LOAD_SCREEN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DAMAGE_CALC_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DAMAGE_DONE_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DAMAGE_DONE_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DANCE_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DBLOOKUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_DB_REPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DEATH_RELEASE_LOC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DEBUG_RUNE_REGEN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DEBUGAURAPROC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DEBUG_AISTATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DEBUG_LIST_TARGETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DEBUG_SERVER_GEO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DEBUG_RUNE_REGEN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DEFENSE_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_DESTROY_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DESTRUCTIBLE_BUILDING_DAMAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DIFFERENT_INSTANCE_FROM_PARTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DISENCHANT_CREDIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DIFFERENT_INSTANCE_FROM_PARTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DISENCHANT_CREDIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DISMOUNT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DISMOUNTRESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DISPEL_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DISPLAY_GAME_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DONT_AUTO_PUSH_SPELLS_TO_ACTION_BAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DROP_NEW_CONNECTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DISPLAY_GAME_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DONT_AUTO_PUSH_SPELLS_TO_ACTION_BAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DROP_NEW_CONNECTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_DUEL_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_DUEL_COUNTDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_DUEL_INBOUNDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_DUEL_OUTOFBOUNDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_DUEL_REQUESTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_DUEL_WINNER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DUMP_RIDE_TICKETS_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DUMP_OBJECTS_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DUMP_RIDE_TICKETS_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DURABILITY_DAMAGE_DEATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DYNAMIC_DROP_ROLL_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ECHO_PARTY_SQUELCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_EMOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ENABLE_BARBER_SHOP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1113,20 +887,19 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_EQUIPMENT_SET_USE_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_EXPECTED_SPAM_RECORDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_EXPLORATION_EXPERIENCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_FAILED_PLAYER_CONDITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_FAILED_PLAYER_CONDITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_FEATURE_SYSTEM_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_FEIGN_DEATH_RESISTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_FISH_ESCAPED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_FISH_NOT_HOOKED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_FLIGHT_SPLINE_SYNC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_FLOOD_DETECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_FLOOD_DETECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_FORCEACTIONSHOW, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_FORCED_DEATH_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_FORCE_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_FORCE_DISPLAY_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_FORCE_SEND_QUEUED_PACKETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_FORCE_SET_VEHICLE_REC_ID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_FORGE_MASTER_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_FORGE_MASTER_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_FRIEND_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_CUSTOM_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_DESPAWN_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1134,13 +907,10 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_RESET_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GAMESPEED_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GAMETIMEBIAS_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GAMETIME_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GAMETIME_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GAME_EVENT_DEBUG_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GAME_OBJECT_ACTIVATE_ANIM_KIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GHOSTEE_GONE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GMRESPONSE_CREATE_TICKET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GAME_EVENT_DEBUG_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GAME_OBJECT_ACTIVATE_ANIM_KIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GMRESPONSE_DB_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GMRESPONSE_RECEIVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GMRESPONSE_STATUS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1153,7 +923,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_GM_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GM_TICKET_STATUS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GODMODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GOGOGO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GOSSIP_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GOSSIP_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GOSSIP_POI, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1165,74 +934,71 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_GROUP_JOINED_BATTLEGROUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GROUP_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GROUP_SET_LEADER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GROUP_SET_ROLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GROUP_SET_ROLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GROUP_UNINVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_ACHIEVEMENT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_ACHIEVEMENT_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_ACHIEVEMENT_EARNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_ACHIEVEMENT_MEMBERS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_ACHIEVEMENT_MEMBERS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_LOG_QUERY_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_LOG_QUERY_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_MONEY_WITHDRAWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_QUERY_TEXT_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_REM_MONEY_WITHDRAW_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_CANCEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_CHALLENGE_COMPLETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_CHALLENGE_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_CHANGE_NAME_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_QUERY_TEXT_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_REM_MONEY_WITHDRAW_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_CANCEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_CHALLENGE_COMPLETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_CHALLENGE_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_CHANGE_NAME_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_COMMAND_RESULT_2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_COMMAND_RESULT_2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_CRITERIA_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_CRITERIA_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_DECLINE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_EVENT_LOG_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_FLAGGED_FOR_RENAME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_EVENT_LOG_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_FLAGGED_FOR_RENAME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_INVITE_CANCEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_KNOWN_RECIPES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_MAX_DAILY_XP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_MEMBERS_FOR_RECIPE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_MEMBER_DAILY_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_MEMBER_RECIPES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_MEMBER_UPDATE_NOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_MOVE_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_MOVE_STARTING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_NEWS_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_NEWS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_PARTY_STATE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_INVITE_CANCEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_KNOWN_RECIPES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_MAX_DAILY_XP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_MEMBERS_FOR_RECIPE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_MEMBER_DAILY_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_MEMBER_RECIPES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_MEMBER_UPDATE_NOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_MOVE_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_MOVE_STARTING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_NEWS_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_NEWS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_PARTY_STATE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_PERMISSIONS_QUERY_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_RANK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_RANKS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_RECIPES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_RENAMED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_REPUTATION_REACTION_CHANGED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_REPUTATION_WEEKLY_CAP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_REWARDS_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_RECIPES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_RENAMED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_REPUTATION_REACTION_CHANGED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_REPUTATION_WEEKLY_CAP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_REWARDS_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_ROSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_SET_NOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_TRADESKILL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_UPDATE_ROSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_XP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_XP_GAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_XP_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_SET_NOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_TRADESKILL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_UPDATE_ROSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_XP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_XP_GAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_XP_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_HEALTH_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_HIGHEST_THREAT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_HOTFIX_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_HOTFIX_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_IGNORE_DIMINISHING_RETURNS_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_IGNORE_REQUIREMENTS_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_HOTFIX_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_HOTFIX_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_INITIALIZE_FACTIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_INITIAL_SPELLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_INIT_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_INIT_EXTRA_AURA_INFO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_INIT_WORLD_STATES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_INSPECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_INSPECT_HONOR_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_INSPECT_RATED_BG_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_INSPECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_INSPECT_HONOR_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_INSPECT_RATED_BG_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_INSPECT_RESULTS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_INSPECT_TALENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_DIFFICULTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1244,15 +1010,15 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_INVALIDATE_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_INVALID_PROMOTION_CODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_INVENTORY_CHANGE_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ITEM_ADD_PASSIVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ITEM_ADD_PASSIVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ITEM_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ITEM_ENCHANT_TIME_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ITEM_EXPIRE_PURCHASE_REFUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ITEM_EXPIRE_PURCHASE_REFUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ITEM_PUSH_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ITEM_REFUND_INFO_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ITEM_REFUND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ITEM_REMOVE_PASSIVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ITEM_SEND_PASSIVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ITEM_REMOVE_PASSIVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ITEM_SEND_PASSIVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ITEM_TEXT_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ITEM_TIME_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_JOINED_BATTLEGROUND_QUEUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1264,7 +1030,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_LFG_DISABLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_JOIN_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_OFFER_CONTINUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_OPEN_FROM_GOSSIP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_OPEN_FROM_GOSSIP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_PARTY_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_PLAYER_REWARD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1272,24 +1038,24 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_LFG_QUEUE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_ROLE_CHECK_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_ROLE_CHOSEN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_SLOT_INVALID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_SLOT_INVALID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_TELEPORT_DENIED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_PARTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_SEARCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_STATUS_NONE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_APPLICANT_LIST_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_APPLICATIONS_LIST_CHANGED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_BROWSE_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_MEMBERSHIP_LIST_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_POST_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_RECRUIT_LIST_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_SEARCH_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_STATUS_NONE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_APPLICANT_LIST_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_APPLICATIONS_LIST_CHANGED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_BROWSE_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_MEMBERSHIP_LIST_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_POST_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_RECRUIT_LIST_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_SEARCH_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LIST_INVENTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LOAD_CUF_PROFILES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LOAD_CUF_PROFILES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LOGIN_SETTIMESPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LOGIN_VERIFY_WORLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LOGOUT_CANCEL_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1298,7 +1064,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_LOG_XPGAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOOT_ALL_PASSED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOOT_CLEAR_MONEY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LOOT_CONTENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LOOT_CONTENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOOT_ITEM_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOOT_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOOT_MASTER_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1310,47 +1076,43 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_LOOT_ROLL_WON, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOOT_SLOT_CHANGED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOOT_START_ROLL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LOTTERY_QUERY_RESULT_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LOTTERY_RESULT_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MAIL_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MAP_OBJ_EVENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_IN_PROGRESS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MAP_OBJ_EVENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_IN_PROGRESS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_MEMBER_ADDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_SETQUEUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MESSAGECHAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MESSAGE_BOX, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MINIGAME_MOVE_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MESSAGE_BOX, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MINIGAME_SETUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MINIGAME_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MIRRORIMAGE_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MISSILE_CANCEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MISSILE_CANCEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MODIFY_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MONEY_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MONEY_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MONSTER_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MONSTER_MOVE_TRANSPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOTD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOUNTRESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOUNTSPECIAL_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_COLLISION_DISABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_COLLISION_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_DISABLE_COLLISION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_DISABLE_GRAVITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_ENABLE_COLLISION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_ENABLE_GRAVITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_FEATHER_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_CHARACTER_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_COLLISION_DISABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_COLLISION_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_DISABLE_COLLISION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_DISABLE_GRAVITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_ENABLE_COLLISION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_ENABLE_GRAVITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_FEATHER_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_GRAVITY_DISABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_GRAVITY_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_KNOCK_BACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_LAND_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_NORMAL_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_LAND_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_NORMAL_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_ACTIVE_MOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_ACTIVE_MOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_COLLISION_HEIGHT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_COMPOUND_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_COMPOUND_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1360,31 +1122,30 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_SWIM_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_SWIM_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_VEHICLE_REC_ID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_WALK_IN_AIR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_VEHICLE_REC_ID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_WALK_IN_AIR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SKIP_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_WALK_IN_AIR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_COLLISION_HEIGHT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_WALK_IN_AIR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_COLLISION_HEIGHT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_KNOCK_BACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_RUN_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_SWIM_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_SWIM_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_TELEPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_RUN_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_SWIM_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_SWIM_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_TELEPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MULTIPLE_PACKETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_NEW_TAXI_PATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_NEW_WORLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_NEW_WORLD_ABORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_NEW_WORLD_ABORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_NOTIFY_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_NOTIFY_DEST_LOC_SPELL_CAST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1403,14 +1164,14 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_PAUSE_MIRROR_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PERIODICAURALOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PETGODMODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PETITION_ALREADY_SIGNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PETITION_ALREADY_SIGNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PETITION_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PETITION_SHOWLIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PETITION_SHOW_SIGNATURES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PETITION_SIGN_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_ACTION_FEEDBACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_ACTION_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_ADDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_ADDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_BROKEN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_CAST_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_DISMISS_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1421,18 +1182,17 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_PET_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_REMOVED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_RENAMEABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_SLOT_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_SLOT_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_SPELLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_TAME_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_UNLEARN_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PET_UPDATE_COMBO_POINTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAYED_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PLAYERBINDERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAYERBOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PLAYER_DIFFICULTY_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PLAYER_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PLAYER_DIFFICULTY_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PLAYER_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAYER_SKINNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PLAYER_UNK_DEAD_ALIVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PLAYER_UNK_DEAD_ALIVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAYER_VEHICLE_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAY_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAY_MUSIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1440,21 +1200,17 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_PLAY_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PLAY_SPELL_IMPACT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAY_SPELL_VISUAL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PLAY_SPELL_VISUAL_KIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PLAY_SPELL_VISUAL_KIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PLAY_TIME_WARNING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PONG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_POWER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PRE_RESURRECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PROCRESIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PROFILEDATA_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PROPOSE_LEVEL_GRANT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PUREMOUNT_CANCELLED_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PUREMOUNT_CANCELLED_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PVP_CREDIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PVP_LOG_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PVP_OPTIONS_ENABLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PVP_QUEUE_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_QUERY_OBJECT_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_QUERY_OBJECT_ROTATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PVP_LOG_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PVP_OPTIONS_ENABLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_QUERY_QUESTS_COMPLETED_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_QUERY_TIME_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_OFFER_REWARD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1480,13 +1236,12 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_RAID_GROUP_ONLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_RAID_INSTANCE_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_RAID_INSTANCE_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RAID_MARKERS_CHANGED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RAID_READY_CHECK_THROTTLED_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RAID_SUMMON_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RAID_READY_CHECK_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RAID_MARKERS_CHANGED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RAID_READY_CHECK_THROTTLED_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RAID_SUMMON_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_RANDOMIZE_CHAR_NAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RATED_BG_RATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RATED_BG_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RATED_BG_RATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RATED_BG_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_READ_ITEM_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_READ_ITEM_OK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_REALM_SPLIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1496,41 +1251,30 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_REFER_A_FRIEND_EXPIRED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_REFER_A_FRIEND_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_REFORGE_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_REMOVED_FROM_PVP_QUEUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_REMOVED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_REPORT_PVP_AFK_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_REQUEST_CEMETERY_LIST_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_REQUEST_PVP_REWARDS_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RESEARCH_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RESEARCH_SETUP_HISTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RESET_COMPRESSION_CONTEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_REQUEST_CEMETERY_LIST_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_REQUEST_PVP_REWARDS_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RESEARCH_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RESEARCH_SETUP_HISTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RESET_COMPRESSION_CONTEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_RESET_FAILED_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RESET_RANGED_COMBAT_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_RESISTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_RESPOND_INSPECT_ACHIEVEMENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RESUME_CAST_BAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RESURRECT_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_RESURRECT_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_RESYNC_RUNES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ROLE_POLL_BEGIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ROLE_POLL_BEGIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_RWHOIS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SCRIPT_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SELL_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SEND_ALL_COMBAT_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SEND_MAIL_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SEND_UNLEARN_SPELLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SERVERINFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SERVERTIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SERVER_BUCK_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SERVER_BUCK_DATA_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SERVER_FIRST_ACHIEVEMENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SERVER_INFO_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SERVER_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SERVER_PERF, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SETUP_RESEARCH_HISTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SET_DF_FAST_LAUNCH_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SET_EXTRA_AURA_INFO_NEED_UPDATE_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SET_EXTRA_AURA_INFO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SERVER_PERF, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SETUP_RESEARCH_HISTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SET_DF_FAST_LAUNCH_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SET_FACTION_ATWAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SET_FACTION_STANDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SET_FACTION_VISIBLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1539,29 +1283,26 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_SET_PCT_SPELL_MODIFIER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SET_PHASE_SHIFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SET_PLAY_HOVER_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SET_PLAY_HOVER_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SET_PROFICIENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SET_PROJECTILE_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SHOWTAXINODES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SHOW_BANK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SHOW_RATINGS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SOR_START_EXPERIENCE_INCOMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SHOW_MAILBOX, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SHOW_RATINGS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SOR_START_EXPERIENCE_INCOMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELLBREAKLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELLDAMAGESHIELD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELLDISPELLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELLENERGIZELOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELLHEALLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELLINSTAKILLLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELLINTERRUPTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELLINTERRUPTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELLLOGEXECUTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELLLOGMISS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELLNONMELEEDAMAGELOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELLORDAMAGE_IMMUNE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELLSTEALLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELL_CATEGORY_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELL_CHANCE_PROC_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELL_CHANCE_RESIST_PUSHBACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELL_CATEGORY_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELL_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELL_DELAYED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELL_FAILED_OTHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1574,8 +1315,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_COLLISION_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_GRAVITY_DISABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_GRAVITY_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_LAND_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_NORMAL_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FEATHER_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1600,29 +1339,20 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_UNSET_FLYING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_UNSET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_RUN_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_SWIM_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_SWIM_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_STABLE_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_STANDSTATE_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_START_MIRROR_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_START_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_START_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_STOP_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_STOP_MIRROR_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_STREAMING_MOVIE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_STREAMING_MOVIE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SUMMON_CANCEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SUMMON_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SUPERCEDED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SUPPRESS_NPC_GREETINGS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SUPPRESS_NPC_GREETINGS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SUSPEND_COMMS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SUSPEND_TOKEN_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_TALENTS_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SUSPEND_TOKEN_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_TALENTS_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TALENTS_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TALENTS_INVOLUNTARILY_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TAXINODE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1631,7 +1361,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_THREAT_CLEAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_THREAT_REMOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_THREAT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_TIME_ADJUSTMENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_TIME_ADJUSTMENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TIME_SYNC_REQ, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TITLE_EARNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TOGGLE_XP_GAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1639,7 +1369,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_TRADE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TRADE_STATUS_EXTENDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_SUCCEEDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TRAINER_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TRANSFER_ABORTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1648,20 +1378,20 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_TRIGGER_MOVIE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TURN_IN_PETITION_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TUTORIAL_FLAGS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_UNIT_HEALTH_FREQUENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_UNIT_SPELLCAST_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_UNIT_HEALTH_FREQUENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_UNIT_SPELLCAST_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ACCOUNT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ACCOUNT_DATA_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_COMBO_POINTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_CURRENCY_WEEK_LIMIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_DUNGEON_ENCOUNTER_FOR_LOOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_CURRENCY_WEEK_LIMIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_DUNGEON_ENCOUNTER_FOR_LOOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_INSTANCE_ENCOUNTER_UNIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_INSTANCE_OWNERSHIP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ITEM_ENCHANTMENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_LAST_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_SERVER_PLAYER_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_SERVER_PLAYER_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_WORLD_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_USERLIST_ADD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_USERLIST_REMOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1669,8 +1399,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_VOICESESSION_FULL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_VOICE_CHAT_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_VOICE_PARENTAL_CONTROLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_ADJUST_PRIORITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_LEAVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_ROSTER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SET_TALKER_MUTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1679,23 +1407,299 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_VOID_STORAGE_FAILED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_VOID_STORAGE_TRANSFER_CHANGES, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_VOID_TRANSFER_RESULT, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_WAIT_QUEUE_FINISH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_WAIT_QUEUE_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_WAIT_QUEUE_FINISH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_WAIT_QUEUE_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_WARDEN_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_WARGAME_CHECK_ENTRY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_WARGAME_REQUEST_SENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_WARGAME_CHECK_ENTRY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_WARGAME_REQUEST_SENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_WEATHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_WEEKLY_LAST_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_WEEKLY_RESET_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_WEEKLY_SPELL_USAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_WEEKLY_SPELL_USAGE_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_WEEKLY_LAST_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_WEEKLY_RESET_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_WEEKLY_SPELL_USAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_WEEKLY_SPELL_USAGE_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_WHO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_WHOIS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_WORLD_SERVER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_WORLD_SERVER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_WORLD_STATE_UI_TIMER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_XP_GAIN_ABORTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ZONE_MAP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_XP_GAIN_ABORTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ZONE_UNDER_ATTACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + // These opcodes are not in WPP + + //DEFINE_OPCODE_HANDLER(CMSG_ACTIVE_PVP_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_ADD_PVP_MEDAL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_ADVANCE_SPAWN_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_AFK_MONITOR_INFO_CLEAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_AFK_MONITOR_INFO_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_AUTH_SRP6_BEGIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_AUTH_SRP6_PROOF, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_AUTH_SRP6_RECODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MANAGER_ADVANCE_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MANAGER_SET_NEXT_TRANSITION_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlemasterHelloOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_BEASTMASTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_BOOTME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_BOT_DETECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_BUY_ITEM_IN_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyItemInSlotOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_BUY_LOTTERY_TICKET_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_BUY_STABLE_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyStableSlot ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_INVITE_NOTES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANGE_GDF_ARENA_RATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANGE_PERSONAL_ARENA_RATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHARACTER_POINT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_PLAYER_LOGIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_PLAYER_LOOKUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_SETMONEY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_SET_ARENA_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_SET_HONOR_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHECK_LOGIN_CRITERIA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_EXPLORATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_HOLIDAY_BG_WIN_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_QUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_RANDOM_BG_WIN_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_SERVER_BUCK_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_COMPLETE_ACHIEVEMENT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CONTROLLER_EJECT_PASSENGER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEjectPassenger ); + //DEFINE_OPCODE_HANDLER(CMSG_COOLDOWN_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CREATEGAMEOBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CREATEITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CREATEMONSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DBLOOKUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_ACTIONS_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_ACTIONS_STOP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_AISTATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_CHANGECELLZONE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_LIST_TARGETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_PASSIVE_AURA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_SERVER_GEO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DECHARGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DELETE_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DEL_PVP_MEDAL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DESTROYMONSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DISABLE_PVP_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DROP_NEW_CONNECTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DUMP_OBJECTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_ENABLE_DAMAGE_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_END_BATTLEFIELD_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_EXPIRE_RAID_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_FLAG_QUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_FLAG_QUEST_FINISH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_FLOOD_GRACE_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_FORCEACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_FORCEACTIONONOTHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_FORCEACTIONSHOW, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_FORCE_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_FORCE_SAY_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GET_CHANNEL_MEMBER_COUNT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGetChannelMemberCount ); + //DEFINE_OPCODE_HANDLER(CMSG_GMRESPONSE_CREATE_TICKET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_CHARACTER_RESTORE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_CHARACTER_SAVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_CREATE_ITEM_TARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_DESTROY_ONLINE_CORPSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_FREEZE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_GRANT_ACHIEVEMENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_MOVECORPSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_NUKE_ACCOUNT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_NUKE_CHARACTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_REMOVE_ACHIEVEMENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_REQUEST_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_RESURRECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_REVEALTO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_SET_CRITERIA_FOR_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_SHOW_COMPLAINTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_SILENCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_SUMMONMOB, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_TEACH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_UBERINVIS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_UNSQUELCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_UNTEACH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_UPDATE_TICKET_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_VISION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_WHISPER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GODMODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_DIMINISHING_RETURNS_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_KNOCKBACK_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_REQUIREMENTS_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_INSTANCE_LOCK_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInstanceLockResponse ); + //DEFINE_OPCODE_HANDLER(CMSG_LEARN_DANCE_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LEARN_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LEVEL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LFD_PARTY_LOCK_INFO_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgPartyLockInfoRequestOpcode); + //DEFINE_OPCODE_HANDLER(CMSG_LFD_PLAYER_LOCK_INFO_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgPlayerLockInfoRequestOpcode); + //DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_NEEDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LOAD_DANCES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LOTTERY_QUERY_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LUA_USAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MAELSTROM_GM_SENT_MAIL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MAELSTROM_INVALIDATE_CACHE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MAELSTROM_RENAME_GUILD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MAKEMONSTERATTACKGUID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_CHARACTER_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_CHARM_PORT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_FLY, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_START_SWIM_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_STOP_SWIM_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_NO_SPELL_VARIANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_PERFORM_ACTION_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_PETGODMODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_PET_LEVEL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_PET_UNLEARN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_PET_UNLEARN_TALENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_PLAYER_AI_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_PROFILEDATA_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_PVP_QUEUE_STATS_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_QUERY_OBJECT_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_QUERY_OBJECT_ROTATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_QUERY_SERVER_BUCK_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_QUERY_VEHICLE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_RECHARGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_REDIRECTION_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_REFER_A_FRIEND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_REMOVE_GLYPH, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRemoveGlyph ); + //DEFINE_OPCODE_HANDLER(CMSG_RUN_SCRIPT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SAVE_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SEND_COMBAT_TRIGGER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SEND_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SEND_GENERAL_TRIGGER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SEND_LOCAL_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SERVERINFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SERVER_BROADCAST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SERVER_COMMAND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SERVER_INFO_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIVE_TALENT_GROUP_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_ARENA_MEMBER_SEASON_GAMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_ARENA_MEMBER_WEEKLY_GAMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_ARENA_TEAM_RATING_BY_INDEX, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_ARENA_TEAM_SEASON_GAMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_ARENA_TEAM_WEEKLY_GAMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_BREATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_CHARACTER_MODEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_CRITERIA_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_DURABILITY_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_EXPLORATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_EXPLORATION_ALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_GLYPH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_GLYPH_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_GRANTABLE_LEVELS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_PAID_SERVICE_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_PVP_RANK_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_PVP_TITLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_RUNE_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_RUNE_COUNT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_STAT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_TITLE_SUFFIX, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_WORLDSTATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SKILL_BUY_RANK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SKILL_BUY_STEP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_STABLE_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStablePet ); + //DEFINE_OPCODE_HANDLER(CMSG_STABLE_REVIVE_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStableRevivePet ); + //DEFINE_OPCODE_HANDLER(CMSG_STABLE_SWAP_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStableSwapPet ); + //DEFINE_OPCODE_HANDLER(CMSG_START_BATTLEFIELD_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SUSPEND_COMMS_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_TARGET_CAST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_TARGET_SCRIPT_CAST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_TAXICLEARNODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_TAXIENABLENODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_TEST_DROP_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_TOGGLE_XP_GAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_UNCLAIM_LICENSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_UNDRESSPLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_UNITANIMTIER_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_DANCE_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_TALENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_UNSTABLE_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnstablePet ); + //DEFINE_OPCODE_HANDLER(CMSG_UNUSED5, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_UNUSED6, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_USE_SKILL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_VOICE_SET_TALKER_MUTED_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_WEATHER_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_XP_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_ZONE_MAP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_DELAY_GHOST_TELEPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_DEV_SHOWLABEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_GM_ACCOUNT_ONLINE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_GM_CHANGE_ARENA_RATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_GM_DESTROY_CORPSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_GM_GEARRATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_GM_RESETINSTANCELIMIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_INSPECT_HONOR_STATS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectHonorStatsOpcode ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_FLIGHT_BACK_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_PITCH_RATE_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_SWIM_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_SWIM_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_NULL_ACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_VIEW_PHASE_SHIFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_AFK_MONITOR_INFO_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHANGEPLAYER_DIFFICULTY_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHARACTER_PROFILE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHARACTER_PROFILE_REALM_CONNECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY_RESPONSE_WRITE_FILE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHEAT_PLAYER_LOOKUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_EXTRA_AURA_INFO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_GET_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_UNKNOWN_1310, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CORPSE_IS_NOT_IN_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DBLOOKUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DEBUGAURAPROC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DEBUG_AISTATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DEBUG_LIST_TARGETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DEBUG_SERVER_GEO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DUMP_OBJECTS_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DYNAMIC_DROP_ROLL_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_FORCE_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GAMETIMEBIAS_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GHOSTEE_GONE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GMRESPONSE_CREATE_TICKET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GOGOGO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_IGNORE_DIMINISHING_RETURNS_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_IGNORE_REQUIREMENTS_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_INIT_EXTRA_AURA_INFO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LOTTERY_QUERY_RESULT_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LOTTERY_RESULT_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MINIGAME_MOVE_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_CHARACTER_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SKIP_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_UNLEARN_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PROFILEDATA_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PVP_QUEUE_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_QUERY_OBJECT_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_QUERY_OBJECT_ROTATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RAID_READY_CHECK_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_REMOVED_FROM_PVP_QUEUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RESET_RANGED_COMBAT_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RESUME_CAST_BAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RESURRECT_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SCRIPT_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SEND_ALL_COMBAT_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SERVERINFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SERVER_BUCK_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SERVER_BUCK_DATA_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SET_EXTRA_AURA_INFO_NEED_UPDATE_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SET_EXTRA_AURA_INFO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SHOW_MAILBOX, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELL_CHANCE_PROC_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELL_CHANCE_RESIST_PUSHBACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_LAND_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_NORMAL_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_RUN_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_SWIM_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_SWIM_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_ADJUST_PRIORITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ZONE_MAP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + #undef DEFINE_OPCODE_HANDLER }; -- cgit v1.2.3 From f9d25b3a25684f65b0b5c78adec4147884c01a48 Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 7 Aug 2012 01:06:01 +0100 Subject: Core/PacketIO: Fix and enable some loot related opcodes --- src/server/game/Groups/Group.cpp | 9 +++++---- src/server/game/Server/Protocol/Opcodes.cpp | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index 1b5aeb5d785..9866f2a06ad 100755 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -843,6 +843,7 @@ void Group::SendLootStartRollToPlayer(uint32 countDown, uint32 mapId, Player* p, if (!canNeed) voteMask &= ~ROLL_FLAG_TYPE_NEED; data << uint8(voteMask); // roll type mask + data << uint8(r.totalPlayersRolling); // maybe the number of players rolling for it??? p->GetSession()->SendPacket(&data); } @@ -856,7 +857,7 @@ void Group::SendLootRoll(uint64 sourceGuid, uint64 targetGuid, uint8 rollNumber, data << uint32(roll.itemid); // the itemEntryId for the item that shall be rolled for data << uint32(roll.itemRandomSuffix); // randomSuffix data << uint32(roll.itemRandomPropId); // Item random property ID - data << uint8(rollNumber); // 0: "Need for: [item name]" > 127: "you passed on: [item name]" Roll number + data << uint32(rollNumber); // 0: "Need for: [item name]" > 127: "you passed on: [item name]" Roll number data << uint8(rollType); // 0: "Need for: [item name]" 0: "You have selected need for [item name] 1: need roll 2: greed roll data << uint8(0); // 1: "You automatically passed on: %s because you cannot loot that item." - Possibly used in need befor greed @@ -880,7 +881,7 @@ void Group::SendLootRollWon(uint64 sourceGuid, uint64 targetGuid, uint8 rollNumb data << uint32(roll.itemRandomSuffix); // randomSuffix data << uint32(roll.itemRandomPropId); // Item random property data << uint64(targetGuid); // guid of the player who won. - data << uint8(rollNumber); // rollnumber realted to SMSG_LOOT_ROLL + data << uint32(rollNumber); // rollnumber realted to SMSG_LOOT_ROLL data << uint8(rollType); // rollType related to SMSG_LOOT_ROLL for (Roll::PlayerVote::const_iterator itr = roll.playerVote.begin(); itr != roll.playerVote.end(); ++itr) @@ -1229,11 +1230,11 @@ void Group::NeedBeforeGreed(Loot* loot, WorldObject* lootedObject) void Group::MasterLoot(Loot* /*loot*/, WorldObject* pLootedObject) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "Group::MasterLoot (SMSG_LOOT_MASTER_LIST, 330)"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Group::MasterLoot (SMSG_LOOT_MASTER_LIST)"); uint32 real_count = 0; - WorldPacket data(SMSG_LOOT_MASTER_LIST, 330); + WorldPacket data(SMSG_LOOT_MASTER_LIST, GetMembersCount()*8); data << (uint8)GetMembersCount(); for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next()) diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 2cef8fc6d19..80cf11f5d0f 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -930,7 +930,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_GROUP_CANCEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GROUP_DECLINE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GROUP_DESTROYED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GROUP_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GROUP_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GROUP_JOINED_BATTLEGROUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GROUP_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GROUP_SET_LEADER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1061,21 +1061,21 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_LOGOUT_CANCEL_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LOGOUT_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LOGOUT_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LOG_XPGAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOG_XPGAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOOT_ALL_PASSED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOOT_CLEAR_MONEY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOOT_CONTENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOOT_ITEM_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LOOT_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LOOT_MASTER_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOOT_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOOT_MASTER_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LOOT_MONEY_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LOOT_RELEASE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LOOT_REMOVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOOT_RELEASE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOOT_REMOVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOOT_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LOOT_ROLL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LOOT_ROLL_WON, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LOOT_SLOT_CHANGED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LOOT_START_ROLL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOOT_ROLL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOOT_ROLL_WON, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOOT_SLOT_CHANGED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOOT_START_ROLL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MAIL_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MAP_OBJ_EVENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From 170f1471af8a900745d99047fe54b401120562f4 Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 7 Aug 2012 03:35:52 +0100 Subject: Core/Groups: Implement CMSG_GROUP_INVITE_RESPONSE (old CMSG_GROUP_DECLINE and CMSG_GROUP_ACCEPT) Closes #7313 (thanks to Kaldorei for the idea..) --- src/server/game/Handlers/GroupHandler.cpp | 105 ++++++++++++++-------------- src/server/game/Server/Protocol/Opcodes.cpp | 3 +- src/server/game/Server/WorldSession.h | 3 +- 3 files changed, 54 insertions(+), 57 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp index 17a4d19e689..e69f63c2b91 100755 --- a/src/server/game/Handlers/GroupHandler.cpp +++ b/src/server/game/Handlers/GroupHandler.cpp @@ -322,80 +322,79 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket & recvData) SendPartyResult(PARTY_OP_INVITE, memberName, ERR_PARTY_RESULT_OK); } -void WorldSession::HandleGroupAcceptOpcode(WorldPacket& recvData) +void WorldSession::HandleGroupInviteResponseOpcode(WorldPacket& recvData) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_ACCEPT"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_INVITE_RESPONSE"); + + bool accept = !recvData.ReadBit(); + if (!accept) + recvData.read_skip(); // unk - recvData.read_skip(); Group* group = GetPlayer()->GetGroupInvite(); if (!group) return; - // Remove player from invitees in any case - group->RemoveInvite(GetPlayer()); - - if (group->GetLeaderGUID() == GetPlayer()->GetGUID()) + if (accept) { - sLog->outError("HandleGroupAcceptOpcode: player %s(%d) tried to accept an invite to his own group", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow()); - return; - } - - // Group is full - if (group->IsFull()) - { - SendPartyResult(PARTY_OP_INVITE, "", ERR_GROUP_FULL); - return; - } - - Player* leader = ObjectAccessor::FindPlayer(group->GetLeaderGUID()); + // Remove player from invitees in any case + group->RemoveInvite(GetPlayer()); - // Forming a new group, create it - if (!group->IsCreated()) - { - // This can happen if the leader is zoning. To be removed once delayed actions for zoning are implemented - if (!leader) + if (group->GetLeaderGUID() == GetPlayer()->GetGUID()) { - group->RemoveAllInvites(); + sLog->outError("HandleGroupAcceptOpcode: player %s(%d) tried to accept an invite to his own group", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow()); return; } - // If we're about to create a group there really should be a leader present - ASSERT(leader); - group->RemoveInvite(leader); - group->Create(leader); - sGroupMgr->AddGroup(group); - } + // Group is full + if (group->IsFull()) + { + SendPartyResult(PARTY_OP_INVITE, "", ERR_GROUP_FULL); + return; + } - // Everything is fine, do it, PLAYER'S GROUP IS SET IN ADDMEMBER!!! - if (!group->AddMember(GetPlayer())) - return; + Player* leader = ObjectAccessor::FindPlayer(group->GetLeaderGUID()); - group->BroadcastGroupUpdate(); -} + // Forming a new group, create it + if (!group->IsCreated()) + { + // This can happen if the leader is zoning. To be removed once delayed actions for zoning are implemented + if (!leader) + { + group->RemoveAllInvites(); + return; + } -void WorldSession::HandleGroupDeclineOpcode(WorldPacket & /*recvData*/) -{ - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_DECLINE"); + // If we're about to create a group there really should be a leader present + ASSERT(leader); + group->RemoveInvite(leader); + group->Create(leader); + sGroupMgr->AddGroup(group); + } - Group* group = GetPlayer()->GetGroupInvite(); - if (!group) - return; + // Everything is fine, do it, PLAYER'S GROUP IS SET IN ADDMEMBER!!! + if (!group->AddMember(GetPlayer())) + return; - // Remember leader if online (group pointer will be invalid if group gets disbanded) - Player* leader = ObjectAccessor::FindPlayer(group->GetLeaderGUID()); + group->BroadcastGroupUpdate(); + } + else + { + // Remember leader if online (group pointer will be invalid if group gets disbanded) + Player* leader = ObjectAccessor::FindPlayer(group->GetLeaderGUID()); - // uninvite, group can be deleted - GetPlayer()->UninviteFromGroup(); + // uninvite, group can be deleted + GetPlayer()->UninviteFromGroup(); - if (!leader || !leader->GetSession()) - return; + if (!leader || !leader->GetSession()) + return; - // report - std::string name = std::string(GetPlayer()->GetName()); - WorldPacket data(SMSG_GROUP_DECLINE, name.length()); - data << name.c_str(); - leader->GetSession()->SendPacket(&data); + // report + std::string name = std::string(GetPlayer()->GetName()); + WorldPacket data(SMSG_GROUP_DECLINE, name.length()); + data << name.c_str(); + leader->GetSession()->SendPacket(&data); + } } void WorldSession::HandleGroupUninviteGuidOpcode(WorldPacket & recvData) diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 80cf11f5d0f..d818bade84a 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -231,11 +231,10 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_GOSSIP_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGossipHelloOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GOSSIP_SELECT_OPTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGossipSelectOptionOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GRANT_LEVEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGrantLevel ); - //DEFINE_OPCODE_HANDLER(CMSG_GROUP_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupAcceptOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GROUP_INVITE_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupInviteResponseOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_ASSISTANT_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupAssistantLeaderOpcode); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_CANCEL, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_CHANGE_SUB_GROUP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupChangeSubGroupOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GROUP_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupDeclineOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_DISBAND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupDisbandOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GROUP_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupInviteOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_INVITE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 614b31576ae..58ad4287ee8 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -534,8 +534,7 @@ class WorldSession void HandleGroupInviteOpcode(WorldPacket& recvPacket); //void HandleGroupCancelOpcode(WorldPacket& recvPacket); - void HandleGroupAcceptOpcode(WorldPacket& recvPacket); - void HandleGroupDeclineOpcode(WorldPacket& recvPacket); + void HandleGroupInviteResponseOpcode(WorldPacket& recvPacket); void HandleGroupUninviteOpcode(WorldPacket& recvPacket); void HandleGroupUninviteGuidOpcode(WorldPacket& recvPacket); void HandleGroupSetLeaderOpcode(WorldPacket& recvPacket); -- cgit v1.2.3 From f110f318f1ec1b79bb8567b510e0c22e614791d4 Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 7 Aug 2012 03:41:28 +0100 Subject: Core/PacketIO: Re-fix SMSG_GROUP_INVITE --- src/server/game/Handlers/GroupHandler.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp index e69f63c2b91..692158fc609 100755 --- a/src/server/game/Handlers/GroupHandler.cpp +++ b/src/server/game/Handlers/GroupHandler.cpp @@ -163,7 +163,7 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket & recvData) if (group2) { // tell the player that they were invited but it failed as they were already in a group - WorldPacket data(SMSG_GROUP_INVITE, 50); + WorldPacket data(SMSG_GROUP_INVITE, 45); data.WriteBit(0); @@ -176,7 +176,7 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket & recvData) data.WriteBit(invitedGuid[6]); data.WriteBit(invitedGuid[5]); - data.WriteBits(strlen(GetPlayer()->GetName()), 9); // Inviter name length + data.WriteBits(0, 9); // Realm name data.WriteBit(invitedGuid[4]); @@ -207,7 +207,7 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket & recvData) data.WriteByteSeq(invitedGuid[5]); - data.append((uint8 const*)GetPlayer()->GetName(), strlen(GetPlayer()->GetName())); // inviter name + // data.append(realm name); data.WriteByteSeq(invitedGuid[7]); @@ -265,7 +265,7 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket & recvData) } // ok, we do it - WorldPacket data(SMSG_GROUP_INVITE, 50); + WorldPacket data(SMSG_GROUP_INVITE, 45); data.WriteBit(0); @@ -278,7 +278,7 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket & recvData) data.WriteBit(invitedGuid[6]); data.WriteBit(invitedGuid[5]); - data.WriteBits(strlen(GetPlayer()->GetName()), 9); // Inviter name length + data.WriteBits(0, 9); // Realm name data.WriteBit(invitedGuid[4]); @@ -309,7 +309,7 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket & recvData) data.WriteByteSeq(invitedGuid[5]); - data.append((uint8 const*)GetPlayer()->GetName(), strlen(GetPlayer()->GetName())); // inviter name + // data.append(realm name); data.WriteByteSeq(invitedGuid[7]); -- cgit v1.2.3 From 5cfb52997ee7a568003d4e4d1ca42fd40c6f87c9 Mon Sep 17 00:00:00 2001 From: kaelima Date: Tue, 7 Aug 2012 13:21:43 +0200 Subject: Core/DBC: Corrected highest lookup entries for 434 and added cataclysm to GetContentLevelsForMapAndZone --- src/server/game/Battlegrounds/ArenaTeam.h | 3 ++- src/server/game/DataStores/DB2Stores.cpp | 6 +++--- src/server/game/DataStores/DBCStores.cpp | 19 +++++++------------ src/server/game/DataStores/DBCStores.h | 9 +++++---- src/server/game/Handlers/MiscHandler.cpp | 2 ++ 5 files changed, 19 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/server/game/Battlegrounds/ArenaTeam.h b/src/server/game/Battlegrounds/ArenaTeam.h index d8ad2c09e59..2528ab27141 100755 --- a/src/server/game/Battlegrounds/ArenaTeam.h +++ b/src/server/game/Battlegrounds/ArenaTeam.h @@ -57,7 +57,8 @@ enum ArenaTeamCommandErrors ERR_ARENA_TEAM_TARGET_TOO_HIGH_S = 0x16, ERR_ARENA_TEAM_TOO_MANY_MEMBERS_S = 0x17, ERR_ARENA_TEAM_NOT_FOUND = 0x1B, - ERR_ARENA_TEAMS_LOCKED = 0x1E + ERR_ARENA_TEAMS_LOCKED = 0x1E, + ERR_ARENA_TEAM_TOO_MANY_CREATE = 0x21, }; enum ArenaTeamEvents diff --git a/src/server/game/DataStores/DB2Stores.cpp b/src/server/game/DataStores/DB2Stores.cpp index dbbcf1ef279..edc97d6b517 100644 --- a/src/server/game/DataStores/DB2Stores.cpp +++ b/src/server/game/DataStores/DB2Stores.cpp @@ -101,11 +101,11 @@ void LoadDB2Stores(const std::string& dataPath) } // Check loaded DB2 files proper version - if (!sItemStore.LookupEntry(72068) || // last item added in 4.2.2 (14545) - !sItemExtendedCostStore.LookupEntry(3652) ) // last item extended cost added in 4.2.2 (14545) + if (!sItemStore.LookupEntry(83086) || // last item added in 4.3.4 (15595) + !sItemExtendedCostStore.LookupEntry(3872) ) // last item extended cost added in 4.3.4 (15595) { sLog->outString(); - sLog->outError("Please extract correct db2 files from client 4.2.2 14545."); + sLog->outError("Please extract correct db2 files from client 4.3.4 15595."); exit(1); } diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 098b61c6306..8c2ba721319 100755 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -741,11 +741,11 @@ void LoadDBCStores(const std::string& dataPath) } // Check loaded DBC files proper version - if (!sAreaStore.LookupEntry(4559) || // last area (areaflag) added in 4.2.2 (14545) - !sCharTitlesStore.LookupEntry(279) || // last char title added in 4.2.2 (14545) - !sGemPropertiesStore.LookupEntry(1860) || // last gem property added in 4.2.2 (14545) - !sMapStore.LookupEntry(968) || // last map added in 4.2.2 (14545) - !sSpellStore.LookupEntry(102129) ) // last spell added in 4.2.2 (14545) + if (!sAreaStore.LookupEntry(4713) || // last area (areaflag) added in 4.3.4 (15595) + !sCharTitlesStore.LookupEntry(287) || // last char title added in 4.3.4 (15595) + !sGemPropertiesStore.LookupEntry(2250) || // last gem property added in 4.3.4 (15595) + !sMapStore.LookupEntry(980) || // last map added in 4.3.4 (15595) + !sSpellStore.LookupEntry(121820) ) // last spell added in 4.3.4 (15595) { sLog->outError("You have _outdated_ DBC files. Please extract correct versions from current using client."); exit(1); @@ -874,7 +874,7 @@ uint32 GetAreaFlagByMapId(uint32 mapid) uint32 GetVirtualMapForMapAndZone(uint32 mapid, uint32 zoneId) { - if (mapid != 530 && mapid != 571) // speed for most cases + if (mapid != 530 && mapid != 571 && mapid != 732) // speed for most cases return mapid; if (WorldMapAreaEntry const* wma = sWorldMapAreaStore.LookupEntry(zoneId)) @@ -893,12 +893,7 @@ ContentLevels GetContentLevelsForMapAndZone(uint32 mapid, uint32 zoneId) if (!mapEntry) return CONTENT_1_60; - switch (mapEntry->Expansion()) - { - default: return CONTENT_1_60; - case 1: return CONTENT_61_70; - case 2: return CONTENT_71_80; - } + return ContentLevels(mapEntry->Expansion()); } bool IsTotemCategoryCompatiableWith(uint32 itemTotemCategoryId, uint32 requiredTotemCategoryId) diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h index 94615d8c435..b8ecb9398fb 100755 --- a/src/server/game/DataStores/DBCStores.h +++ b/src/server/game/DataStores/DBCStores.h @@ -48,11 +48,12 @@ const std::string* GetRandomCharacterName(uint8 race, uint8 gender); enum ContentLevels { - CONTENT_1_60 = 0, - CONTENT_61_70, - CONTENT_71_80, - CONTENT_81_85 + CONTENT_1_60 = 0, + CONTENT_61_70 = 1, + CONTENT_71_80 = 2, + CONTENT_81_85 = 3 }; + ContentLevels GetContentLevelsForMapAndZone(uint32 mapid, uint32 zoneId); bool IsTotemCategoryCompatiableWith(uint32 itemTotemCategoryId, uint32 requiredTotemCategoryId); diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index e2bd02d8d36..4a1bd53bd3d 100755 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -1800,6 +1800,8 @@ void WorldSession::HandleRequestHotfix(WorldPacket& recvPacket) SendItemSparseDb2Reply(entry); break; default: + sLog->outError("CMSG_REQUEST_HOTFIX: Received unknown hotfix type: %u", type); + recvPacket.rfinish(); break; } } -- cgit v1.2.3 From 533517baabdfeec322caa096afc344c6fe71769e Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 7 Aug 2012 13:27:33 +0200 Subject: Core/Entities: * Corrected create object type after changing updateflags * Updated MovementFlags2 * Minor cleanup in spline flag methods --- src/server/game/Entities/Object/Object.cpp | 35 ++++++++++++++-------- src/server/game/Entities/Object/Object.h | 19 +++++++----- src/server/game/Entities/Object/ObjectDefines.h | 4 +-- src/server/game/Entities/Unit/Unit.h | 24 +++++++-------- .../WaypointMovementGenerator.cpp | 4 ++- src/server/game/Movement/Spline/MoveSplineFlag.h | 4 +-- src/server/game/Movement/Spline/MoveSplineInit.h | 11 ++++--- 7 files changed, 55 insertions(+), 46 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 1f859a585e6..ec1cb8d7728 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -180,7 +180,7 @@ void Object::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) c if (!target) return; - uint8 updatetype = UPDATETYPE_CREATE_OBJECT; + uint8 updateType = UPDATETYPE_CREATE_OBJECT; uint16 flags = m_updateFlag; uint32 valCount = m_valuesCount; @@ -191,16 +191,26 @@ void Object::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) c else if (GetTypeId() == TYPEID_PLAYER) valCount = PLAYER_END_NOT_SELF; - if (flags & UPDATEFLAG_STATIONARY_POSITION) + switch (GetGUIDHigh()) { - // UPDATETYPE_CREATE_OBJECT2 dynamic objects, corpses... - if (isType(TYPEMASK_DYNAMICOBJECT) || isType(TYPEMASK_CORPSE) || isType(TYPEMASK_PLAYER)) - updatetype = UPDATETYPE_CREATE_OBJECT2; - - // UPDATETYPE_CREATE_OBJECT2 for pets... - if (target->GetPetGUID() == GetGUID()) - updatetype = UPDATETYPE_CREATE_OBJECT2; + case HIGHGUID_PLAYER: + case HIGHGUID_PET: + case HIGHGUID_CORPSE: + case HIGHGUID_DYNAMICOBJECT: + updateType = UPDATETYPE_CREATE_OBJECT2; + break; + case HIGHGUID_UNIT: + if (ToUnit()->ToTempSummon() && IS_PLAYER_GUID(ToUnit()->ToTempSummon()->GetSummonerGUID())) + updateType = UPDATETYPE_CREATE_OBJECT2; + break; + case HIGHGUID_GAMEOBJECT: + if (IS_PLAYER_GUID(ToGameObject()->GetOwnerGUID())) + updateType = UPDATETYPE_CREATE_OBJECT2; + break; + } + if (flags & UPDATEFLAG_STATIONARY_POSITION) + { // UPDATETYPE_CREATE_OBJECT2 for some gameobject types... if (isType(TYPEMASK_GAMEOBJECT)) { @@ -210,7 +220,7 @@ void Object::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) c case GAMEOBJECT_TYPE_DUEL_ARBITER: case GAMEOBJECT_TYPE_FLAGSTAND: case GAMEOBJECT_TYPE_FLAGDROP: - updatetype = UPDATETYPE_CREATE_OBJECT2; + updateType = UPDATETYPE_CREATE_OBJECT2; break; case GAMEOBJECT_TYPE_TRANSPORT: flags |= UPDATEFLAG_TRANSPORT; @@ -219,14 +229,13 @@ void Object::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) c break; } } - } if (ToUnit() && ToUnit()->getVictim()) flags |= UPDATEFLAG_HAS_TARGET; ByteBuffer buf(500); - buf << uint8(updatetype); + buf << uint8(updateType); buf.append(GetPackGUID()); buf << uint8(m_objectTypeId); @@ -235,7 +244,7 @@ void Object::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) c UpdateMask updateMask; updateMask.SetCount(valCount); _SetCreateBits(&updateMask, target); - _BuildValuesUpdate(updatetype, &buf, &updateMask, target); + _BuildValuesUpdate(updateType, &buf, &updateMask, target); data->AddUpdateBlock(buf); } diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index 3e00e775b4b..3829e2f75f2 100755 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -362,19 +362,24 @@ class Object void ForceValuesUpdateAtIndex(uint32); Player* ToPlayer() { if (GetTypeId() == TYPEID_PLAYER) return reinterpret_cast(this); else return NULL; } - Player const* ToPlayer() const { if (GetTypeId() == TYPEID_PLAYER) return (Player const*)((Player*)this); else return NULL; } + Player const* ToPlayer() const { if (GetTypeId() == TYPEID_PLAYER) return reinterpret_cast(this); else return NULL; } + Creature* ToCreature() { if (GetTypeId() == TYPEID_UNIT) return reinterpret_cast(this); else return NULL; } - Creature const* ToCreature() const { if (GetTypeId() == TYPEID_UNIT) return (Creature const*)((Creature*)this); else return NULL; } + Creature const* ToCreature() const { if (GetTypeId() == TYPEID_UNIT) return reinterpret_cast(this); else return NULL; } + + Unit* ToUnit() { if (isType(TYPEMASK_UNIT)) return reinterpret_cast(this); else return NULL; } + Unit const* ToUnit() const { if (isType(TYPEMASK_UNIT)) return reinterpret_cast(this); else return NULL; } - Unit* ToUnit() { if (GetTypeId() == TYPEID_UNIT || GetTypeId() == TYPEID_PLAYER) return reinterpret_cast(this); else return NULL; } - Unit const* ToUnit() const { if (GetTypeId() == TYPEID_UNIT || GetTypeId() == TYPEID_PLAYER) return (const Unit*)((Unit*)this); else return NULL; } GameObject* ToGameObject() { if (GetTypeId() == TYPEID_GAMEOBJECT) return reinterpret_cast(this); else return NULL; } - GameObject const* ToGameObject() const { if (GetTypeId() == TYPEID_GAMEOBJECT) return (const GameObject*)((GameObject*)this); else return NULL; } + GameObject const* ToGameObject() const { if (GetTypeId() == TYPEID_GAMEOBJECT) return reinterpret_cast(this); else return NULL; } Corpse* ToCorpse() { if (GetTypeId() == TYPEID_CORPSE) return reinterpret_cast(this); else return NULL; } - Corpse const* ToCorpse() const { if (GetTypeId() == TYPEID_CORPSE) return (const Corpse*)((Corpse*)this); else return NULL; } - protected: + Corpse const* ToCorpse() const { if (GetTypeId() == TYPEID_CORPSE) return reinterpret_cast(this); else return NULL; } + DynamicObject* ToDynObject() { if (GetTypeId() == TYPEID_DYNAMICOBJECT) return reinterpret_cast(this); else return NULL; } + DynamicObject const* ToDynObject() const { if (GetTypeId() == TYPEID_DYNAMICOBJECT) return reinterpret_cast(this); else return NULL; } + + protected: Object(); void _InitValues(); diff --git a/src/server/game/Entities/Object/ObjectDefines.h b/src/server/game/Entities/Object/ObjectDefines.h index 2e74a3b4ee4..9fd4279a79c 100755 --- a/src/server/game/Entities/Object/ObjectDefines.h +++ b/src/server/game/Entities/Object/ObjectDefines.h @@ -42,10 +42,10 @@ enum HighGuid HIGHGUID_PET = 0xF14, // blizz F140 HIGHGUID_VEHICLE = 0xF15, // blizz F550 HIGHGUID_DYNAMICOBJECT = 0xF10, // blizz F100 - HIGHGUID_CORPSE = 0xF101, // blizz F100 + HIGHGUID_CORPSE = 0xF101, // blizz F100 HIGHGUID_MO_TRANSPORT = 0x1FC, // blizz 1FC0 (for GAMEOBJECT_TYPE_MO_TRANSPORT) HIGHGUID_GROUP = 0x1F5, - HIGHGUID_GUILD = 0x1FF5, // new 4.x + HIGHGUID_GUILD = 0x1FF5, // new 4.x }; #define IS_EMPTY_GUID(Guid) (Guid == 0) diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 3133d75fa07..8fee3ed74e0 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -720,20 +720,16 @@ enum MovementFlags2 MOVEMENTFLAG2_NONE = 0x00000000, MOVEMENTFLAG2_NO_STRAFE = 0x00000001, MOVEMENTFLAG2_NO_JUMPING = 0x00000002, - MOVEMENTFLAG2_UNK3 = 0x00000004, // Overrides various clientside checks - MOVEMENTFLAG2_FULL_SPEED_TURNING = 0x00000008, - MOVEMENTFLAG2_FULL_SPEED_PITCHING = 0x00000010, - MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING = 0x00000020, - MOVEMENTFLAG2_UNK7 = 0x00000040, - MOVEMENTFLAG2_UNK8 = 0x00000080, - MOVEMENTFLAG2_UNK9 = 0x00000100, - MOVEMENTFLAG2_UNK10 = 0x00000200, - MOVEMENTFLAG2_INTERPOLATED_MOVEMENT = 0x00000400, - MOVEMENTFLAG2_INTERPOLATED_TURNING = 0x00000800, - MOVEMENTFLAG2_INTERPOLATED_PITCHING = 0x00001000, - MOVEMENTFLAG2_UNK14 = 0x00002000, - MOVEMENTFLAG2_UNK15 = 0x00004000, - MOVEMENTFLAG2_UNK16 = 0x00008000, + MOVEMENTFLAG2_FULL_SPEED_TURNING = 0x00000004, + MOVEMENTFLAG2_FULL_SPEED_PITCHING = 0x00000008, + MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING = 0x00000010, + MOVEMENTFLAG2_UNK7 = 0x00000020, + MOVEMENTFLAG2_UNK8 = 0x00000040, + MOVEMENTFLAG2_UNK9 = 0x00000080, + MOVEMENTFLAG2_UNK10 = 0x00000100, + MOVEMENTFLAG2_INTERPOLATED_MOVEMENT = 0x00000200, + MOVEMENTFLAG2_INTERPOLATED_TURNING = 0x00000400, + MOVEMENTFLAG2_INTERPOLATED_PITCHING = 0x00000800, }; enum UnitTypeMask diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp index 1bf6bdde681..02c685de483 100755 --- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp @@ -236,7 +236,9 @@ void FlightPathMovementGenerator::Reset(Player & player) init.Path().push_back(vertice); } init.SetFirstPointId(GetCurrentNode()); - init.EnableTaxiFlight(); + init.SetFly(); + init.SetSmooth(); + init.SetWalk(true); init.SetVelocity(PLAYER_FLIGHT_SPEED); init.Launch(); } diff --git a/src/server/game/Movement/Spline/MoveSplineFlag.h b/src/server/game/Movement/Spline/MoveSplineFlag.h index 911c43f663e..40c07f14440 100644 --- a/src/server/game/Movement/Spline/MoveSplineFlag.h +++ b/src/server/game/Movement/Spline/MoveSplineFlag.h @@ -104,14 +104,12 @@ namespace Movement void EnableAnimation(uint8 anim) { raw() = (raw() & ~(Mask_Animations | Falling | Parabolic | FallingSlow)) | Animation | (anim & Mask_Animations); } void EnableParabolic() { raw() = (raw() & ~(Mask_Animations | Falling | Animation | FallingSlow)) | Parabolic; } void EnableFalling() { raw() = (raw() & ~(Mask_Animations | Parabolic | Animation)) | Falling; } - void EnableFlying() { raw() = Flying; } - void EnableCatmullRom() { raw() = Catmullrom | UncompressedPath; } + void EnableCatmullRom() { raw() = (raw() & ~SmoothGroundPath) | Catmullrom | UncompressedPath; } void EnableFacingPoint() { raw() = (raw() & ~Mask_Final_Facing) | Final_Point; } void EnableFacingAngle() { raw() = (raw() & ~Mask_Final_Facing) | Final_Angle; } void EnableFacingTarget() { raw() = (raw() & ~Mask_Final_Facing) | Final_Target; } void EnableTransportEnter() { raw() = (raw() & ~TransportExit) | TransportEnter; } void EnableTransportExit() { raw() = (raw() & ~TransportEnter) | TransportExit; } - void EnableTaxiFlight() { raw() = raw() | Catmullrom | Flying | Walkmode | UncompressedPath; } //4.3.4 0x600A00 uint8 animId : 3; bool unknown0 : 1; diff --git a/src/server/game/Movement/Spline/MoveSplineInit.h b/src/server/game/Movement/Spline/MoveSplineInit.h index ef60111ef30..2350bdc5207 100644 --- a/src/server/game/Movement/Spline/MoveSplineInit.h +++ b/src/server/game/Movement/Spline/MoveSplineInit.h @@ -144,12 +144,11 @@ namespace Movement Unit& unit; }; - inline void MoveSplineInit::SetFly() { args.flags.EnableFlying(); } - inline void MoveSplineInit::EnableTaxiFlight() { args.flags.EnableTaxiFlight(); } - inline void MoveSplineInit::SetWalk(bool enable) { args.flags.walkmode = enable;} - inline void MoveSplineInit::SetSmooth() { args.flags.EnableCatmullRom();} - inline void MoveSplineInit::SetCyclic() { args.flags.cyclic = true;} - inline void MoveSplineInit::SetFall() { args.flags.EnableFalling();} + inline void MoveSplineInit::SetFly() { args.flags.flying = true; } + inline void MoveSplineInit::SetWalk(bool enable) { args.flags.walkmode = enable; } + inline void MoveSplineInit::SetSmooth() { args.flags.EnableCatmullRom(); } + inline void MoveSplineInit::SetCyclic() { args.flags.cyclic = true; } + inline void MoveSplineInit::SetFall() { args.flags.EnableFalling(); } inline void MoveSplineInit::SetVelocity(float vel) { args.velocity = vel; args.HasVelocity = true; } inline void MoveSplineInit::SetOrientationInversed() { args.flags.orientationInversed = true;} inline void MoveSplineInit::SetTransportEnter() { args.flags.EnableTransportEnter(); } -- cgit v1.2.3 From 488fdadbed0d077184e32765704bff9147340084 Mon Sep 17 00:00:00 2001 From: Subv Date: Tue, 7 Aug 2012 07:44:16 -0500 Subject: Core/PacketIO: Enabled more opcodes --- src/server/game/Handlers/LootHandler.cpp | 4 +-- src/server/game/Handlers/MailHandler.cpp | 4 +-- src/server/game/Handlers/MiscHandler.cpp | 6 ++--- src/server/game/Handlers/PetHandler.cpp | 2 +- src/server/game/Handlers/SpellHandler.cpp | 3 ++- src/server/game/Server/Protocol/Opcodes.cpp | 40 ++++++++++++++--------------- 6 files changed, 30 insertions(+), 29 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/LootHandler.cpp b/src/server/game/Handlers/LootHandler.cpp index cb06ae4d8be..8641880db59 100755 --- a/src/server/game/Handlers/LootHandler.cpp +++ b/src/server/game/Handlers/LootHandler.cpp @@ -94,7 +94,7 @@ void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket & recvData) player->StoreLootItem(lootSlot, loot); } -void WorldSession::HandleLootMoneyOpcode(WorldPacket & /*recvData*/) +void WorldSession::HandleLootMoneyOpcode(WorldPacket& /*recvData*/) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_LOOT_MONEY"); @@ -428,7 +428,7 @@ void WorldSession::DoLootRelease(uint64 lguid) loot->RemoveLooter(player->GetGUID()); } -void WorldSession::HandleLootMasterGiveOpcode(WorldPacket & recvData) +void WorldSession::HandleLootMasterGiveOpcode(WorldPacket& recvData) { uint8 slotid; uint64 lootguid, target_playerguid; diff --git a/src/server/game/Handlers/MailHandler.cpp b/src/server/game/Handlers/MailHandler.cpp index 0d3ec76bc4e..33ebbeb2fcd 100755 --- a/src/server/game/Handlers/MailHandler.cpp +++ b/src/server/game/Handlers/MailHandler.cpp @@ -458,7 +458,7 @@ void WorldSession::HandleMailReturnToSender(WorldPacket & recvData) } //called when player takes item attached in mail -void WorldSession::HandleMailTakeItem(WorldPacket & recvData) +void WorldSession::HandleMailTakeItem(WorldPacket& recvData) { uint64 mailbox; uint32 mailId; @@ -713,7 +713,7 @@ void WorldSession::HandleGetMailList(WorldPacket & recvData) } //used when player copies mail body to his inventory -void WorldSession::HandleMailCreateTextItem(WorldPacket & recvData) +void WorldSession::HandleMailCreateTextItem(WorldPacket& recvData) { uint64 mailbox; uint32 mailId; diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 4a1bd53bd3d..79895e59622 100755 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -1247,9 +1247,9 @@ void WorldSession::HandleInspectOpcode(WorldPacket& recvData) player->BuildEnchantmentsInfoData(&data); if (Guild* guild = sGuildMgr->GetGuildById(player->GetGuildId())) { - data << uint64(MAKE_NEW_GUID(guild->GetId(), 0, HIGHGUID_GUILD)); - data << uint32(0 /*guild->GetLevel()*/); // guild level - data << uint64(player->GetGUID()); // not sure + data << uint64(guild->GetGUID()); + data << uint32(guild->GetLevel()); + data << uint64(0/*guild->GetXP()*/); data << uint32(0/*guild->GetMembersCount()*/); // number of members } SendPacket(&data); diff --git a/src/server/game/Handlers/PetHandler.cpp b/src/server/game/Handlers/PetHandler.cpp index 8091f8f0e71..09c4c817ef3 100755 --- a/src/server/game/Handlers/PetHandler.cpp +++ b/src/server/game/Handlers/PetHandler.cpp @@ -852,7 +852,7 @@ void WorldSession::SendPetNameInvalid(uint32 error, const std::string& name, Dec SendPacket(&data); } -void WorldSession::HandlePetLearnTalent(WorldPacket & recvData) +void WorldSession::HandlePetLearnTalent(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_PET_LEARN_TALENT"); diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp index caf922b4ae3..161b93cce4b 100755 --- a/src/server/game/Handlers/SpellHandler.cpp +++ b/src/server/game/Handlers/SpellHandler.cpp @@ -581,11 +581,12 @@ void WorldSession::HandleSpellClick(WorldPacket& recvData) unit->HandleSpellClick(_player); } -void WorldSession::HandleMirrorImageDataRequest(WorldPacket & recvData) +void WorldSession::HandleMirrorImageDataRequest(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_GET_MIRRORIMAGE_DATA"); uint64 guid; recvData >> guid; + recvData.read_skip(); // DisplayId ? // Get unit for which data is needed by client Unit* unit = ObjectAccessor::GetObjectInWorld(guid, (Unit*)NULL); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index d818bade84a..04feb5ab598 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -215,7 +215,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_GAMETIME_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GETDEATHBINDZONE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GET_MAIL_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGetMailList ); - //DEFINE_OPCODE_HANDLER(CMSG_GET_MIRRORIMAGE_DATA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMirrorImageDataRequest ); + DEFINE_OPCODE_HANDLER(CMSG_GET_MIRRORIMAGE_DATA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMirrorImageDataRequest ); //DEFINE_OPCODE_HANDLER(CMSG_GHOST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GMRESPONSE_RESOLVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMResponseResolve ); //DEFINE_OPCODE_HANDLER(CMSG_GMSURVEY_SUBMIT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMSurveySubmit ); @@ -296,16 +296,16 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_HEARTH_AND_RESURRECT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleHearthAndResurrect ); DEFINE_OPCODE_HANDLER(CMSG_IGNORE_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleIgnoreTradeOpcode ); DEFINE_OPCODE_HANDLER(CMSG_INITIATE_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInitiateTradeOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_INSPECT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_INSPECT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_INSTANCE_LOCK_WARNING_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_ITEM_REFUND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemRefund ); + DEFINE_OPCODE_HANDLER(CMSG_ITEM_REFUND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemRefund ); DEFINE_OPCODE_HANDLER(CMSG_ITEM_REFUND_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemRefundInfoRequest ); //DEFINE_OPCODE_HANDLER(CMSG_ITEM_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemTextQuery ); DEFINE_OPCODE_HANDLER(CMSG_JOIN_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleJoinChannel ); DEFINE_OPCODE_HANDLER(CMSG_KEEP_ALIVE, STATUS_NEVER, PROCESS_THREADUNSAFE, &WorldSession::Handle_EarlyProccess ); - //DEFINE_OPCODE_HANDLER(CMSG_LEARN_PREVIEW_TALENTS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnPreviewTalents ); - //DEFINE_OPCODE_HANDLER(CMSG_LEARN_PREVIEW_TALENTS_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnPreviewTalentsPet ); - //DEFINE_OPCODE_HANDLER(CMSG_LEARN_TALENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnTalentOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_LEARN_PREVIEW_TALENTS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnPreviewTalents ); + DEFINE_OPCODE_HANDLER(CMSG_LEARN_PREVIEW_TALENTS_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnPreviewTalentsPet ); + DEFINE_OPCODE_HANDLER(CMSG_LEARN_TALENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnTalentOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LEAVE_BATTLEFIELD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLeaveBattlefieldOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LEAVE_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLeaveChannel ); //DEFINE_OPCODE_HANDLER(CMSG_LFG_GET_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -334,19 +334,19 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_LOGOUT_CANCEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLogoutCancelOpcode ); DEFINE_OPCODE_HANDLER(CMSG_LOGOUT_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLogoutRequestOpcode ); DEFINE_OPCODE_HANDLER(CMSG_LOG_DISCONNECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); - //DEFINE_OPCODE_HANDLER(CMSG_LOOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_LOOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LOOT_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LOOT_MASTER_GIVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMasterGiveOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_LOOT_METHOD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMethodOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_LOOT_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMoneyOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_LOOT_RELEASE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootReleaseOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_LOOT_ROLL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootRoll ); - //DEFINE_OPCODE_HANDLER(CMSG_MAIL_CREATE_TEXT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailCreateTextItem ); - //DEFINE_OPCODE_HANDLER(CMSG_MAIL_DELETE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailDelete ); - //DEFINE_OPCODE_HANDLER(CMSG_MAIL_MARK_AS_READ, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailMarkAsRead ); - //DEFINE_OPCODE_HANDLER(CMSG_MAIL_RETURN_TO_SENDER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailReturnToSender ); - //DEFINE_OPCODE_HANDLER(CMSG_MAIL_TAKE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailTakeItem ); - //DEFINE_OPCODE_HANDLER(CMSG_MAIL_TAKE_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailTakeMoney ); + DEFINE_OPCODE_HANDLER(CMSG_LOOT_MASTER_GIVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMasterGiveOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_LOOT_METHOD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMethodOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_LOOT_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMoneyOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_LOOT_RELEASE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootReleaseOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_LOOT_ROLL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootRoll ); + DEFINE_OPCODE_HANDLER(CMSG_MAIL_CREATE_TEXT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailCreateTextItem ); + DEFINE_OPCODE_HANDLER(CMSG_MAIL_DELETE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailDelete ); + DEFINE_OPCODE_HANDLER(CMSG_MAIL_MARK_AS_READ, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailMarkAsRead ); + DEFINE_OPCODE_HANDLER(CMSG_MAIL_RETURN_TO_SENDER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailReturnToSender ); + DEFINE_OPCODE_HANDLER(CMSG_MAIL_TAKE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailTakeItem ); + DEFINE_OPCODE_HANDLER(CMSG_MAIL_TAKE_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailTakeMoney ); //DEFINE_OPCODE_HANDLER(CMSG_MEETINGSTONE_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_BATTLEGROUND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_GUILD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); @@ -420,7 +420,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_PET_ACTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetAction ); //DEFINE_OPCODE_HANDLER(CMSG_PET_CANCEL_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetCancelAuraOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_PET_CAST_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetCastSpellOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_PET_LEARN_TALENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetLearnTalent ); + DEFINE_OPCODE_HANDLER(CMSG_PET_LEARN_TALENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetLearnTalent ); //DEFINE_OPCODE_HANDLER(CMSG_PET_NAME_CACHE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_PET_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetNameQuery ); //DEFINE_OPCODE_HANDLER(CMSG_PET_RENAME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetRename ); @@ -1085,7 +1085,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_MESSAGE_BOX, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MINIGAME_SETUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MINIGAME_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MIRRORIMAGE_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MIRRORIMAGE_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MISSILE_CANCEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MODIFY_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MONEY_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From 7944a7e09546bb77811d53fe3f99dda3c548867c Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 7 Aug 2012 14:23:56 +0100 Subject: Core/PacketIO: Enable 3 loot related opcodes (fix structure of one) --- src/server/game/Handlers/GroupHandler.cpp | 4 ++-- src/server/game/Server/Protocol/Opcodes.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp index 692158fc609..c6a3224348d 100755 --- a/src/server/game/Handlers/GroupHandler.cpp +++ b/src/server/game/Handlers/GroupHandler.cpp @@ -1120,13 +1120,13 @@ void WorldSession::HandleOptOutOfLootOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_OPT_OUT_OF_LOOT"); - uint32 passOnLoot; + bool passOnLoot; recvData >> passOnLoot; // 1 always pass, 0 do not pass // ignore if player not loaded if (!GetPlayer()) // needed because STATUS_AUTHED { - if (passOnLoot != 0) + if (passOnLoot) sLog->outError("CMSG_OPT_OUT_OF_LOOT value<>0 for not-loaded character!"); return; } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 04feb5ab598..177475c5332 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -407,7 +407,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_OFFER_PETITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleOfferPetitionOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_OPENING_CINEMATIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_OPEN_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleOpenItemOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_OPT_OUT_OF_LOOT, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleOptOutOfLootOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_OPT_OUT_OF_LOOT, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleOptOutOfLootOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_PAGE_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePageTextQueryOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_PARTY_SILENCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_PARTY_UNSILENCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -1061,8 +1061,8 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_LOGOUT_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LOGOUT_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LOG_XPGAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LOOT_ALL_PASSED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LOOT_CLEAR_MONEY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOOT_ALL_PASSED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOOT_CLEAR_MONEY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOOT_CONTENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOOT_ITEM_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LOOT_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From bffb35c54ae3992b95be1446af6cf663c3ef1824 Mon Sep 17 00:00:00 2001 From: Subv Date: Tue, 7 Aug 2012 10:56:55 -0500 Subject: Core/PacketIO: Fixed some channel packet structures and enabled more opcodes --- src/server/game/Handlers/ChannelHandler.cpp | 113 +++++++++++++++----------- src/server/game/Handlers/VehicleHandler.cpp | 2 +- src/server/game/Handlers/VoiceChatHandler.cpp | 4 + src/server/game/Server/Protocol/Opcodes.cpp | 28 +++---- 4 files changed, 86 insertions(+), 61 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/ChannelHandler.cpp b/src/server/game/Handlers/ChannelHandler.cpp index 06ee4207d3a..82e46844a2c 100755 --- a/src/server/game/Handlers/ChannelHandler.cpp +++ b/src/server/game/Handlers/ChannelHandler.cpp @@ -83,8 +83,9 @@ void WorldSession::HandleLeaveChannel(WorldPacket& recvPacket) void WorldSession::HandleChannelList(WorldPacket& recvPacket) { sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); - std::string channelname; - recvPacket >> channelname; + + uint32 length = recvPacket.ReadBits(8); + std::string channelname = recvPacket.ReadString(length); if (ChannelMgr* cMgr = channelMgr(_player->GetTeam())) if (Channel* chn = cMgr->GetChannel(channelname, _player)) @@ -94,10 +95,11 @@ void WorldSession::HandleChannelList(WorldPacket& recvPacket) void WorldSession::HandleChannelPassword(WorldPacket& recvPacket) { sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); - std::string channelname, pass; - recvPacket >> channelname; - - recvPacket >> pass; + uint32 passLength = recvPacket.ReadBits(8); + uint32 nameLength = recvPacket.ReadBits(7); + + std::string pass = recvPacket.ReadString(passLength); + std::string channelname = recvPacket.ReadString(nameLength); if (ChannelMgr* cMgr = channelMgr(_player->GetTeam())) if (Channel* chn = cMgr->GetChannel(channelname, _player)) @@ -107,11 +109,13 @@ void WorldSession::HandleChannelPassword(WorldPacket& recvPacket) void WorldSession::HandleChannelSetOwner(WorldPacket& recvPacket) { sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); - std::string channelname, newp; - recvPacket >> channelname; - - recvPacket >> newp; + + uint32 channelLength = recvPacket.ReadBits(8); + uint32 nameLength = recvPacket.ReadBits(7); + std::string newp = recvPacket.ReadString(nameLength); + std::string channelname = recvPacket.ReadString(channelLength); + if (!normalizePlayerName(newp)) return; @@ -123,8 +127,9 @@ void WorldSession::HandleChannelSetOwner(WorldPacket& recvPacket) void WorldSession::HandleChannelOwner(WorldPacket& recvPacket) { sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); - std::string channelname; - recvPacket >> channelname; + uint32 length = recvPacket.ReadBits(8); + std::string channelname = recvPacket.ReadString(length); + if (ChannelMgr* cMgr = channelMgr(_player->GetTeam())) if (Channel* chn = cMgr->GetChannel(channelname, _player)) chn->SendWhoOwner(_player->GetGUID()); @@ -133,11 +138,13 @@ void WorldSession::HandleChannelOwner(WorldPacket& recvPacket) void WorldSession::HandleChannelModerator(WorldPacket& recvPacket) { sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); - std::string channelname, otp; - recvPacket >> channelname; - - recvPacket >> otp; - + + uint32 channelLength = recvPacket.ReadBits(8); + uint32 nameLength = recvPacket.ReadBits(7); + + std::string otp = recvPacket.ReadString(nameLength); + std::string channelname = recvPacket.ReadString(channelLength); + if (!normalizePlayerName(otp)) return; @@ -149,10 +156,12 @@ void WorldSession::HandleChannelModerator(WorldPacket& recvPacket) void WorldSession::HandleChannelUnmoderator(WorldPacket& recvPacket) { sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); - std::string channelname, otp; - recvPacket >> channelname; - - recvPacket >> otp; + + uint32 nameLength = recvPacket.ReadBits(7); + uint32 channelLength = recvPacket.ReadBits(8); + + std::string channelname = recvPacket.ReadString(channelLength); + std::string otp = recvPacket.ReadString(nameLength); if (!normalizePlayerName(otp)) return; @@ -165,10 +174,11 @@ void WorldSession::HandleChannelUnmoderator(WorldPacket& recvPacket) void WorldSession::HandleChannelMute(WorldPacket& recvPacket) { sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); - std::string channelname, otp; - recvPacket >> channelname; - - recvPacket >> otp; + uint32 channelLength = recvPacket.ReadBits(8); + uint32 nameLength = recvPacket.ReadBits(7); + + std::string channelname = recvPacket.ReadString(channelLength); + std::string otp = recvPacket.ReadString(nameLength); if (!normalizePlayerName(otp)) return; @@ -182,11 +192,12 @@ void WorldSession::HandleChannelUnmute(WorldPacket& recvPacket) { sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); - std::string channelname, otp; - recvPacket >> channelname; - - recvPacket >> otp; + uint32 nameLength = recvPacket.ReadBits(8); + uint32 channelLength = recvPacket.ReadBits(7); + std::string otp = recvPacket.ReadString(nameLength); + std::string channelname = recvPacket.ReadString(channelLength); + if (!normalizePlayerName(otp)) return; @@ -198,11 +209,12 @@ void WorldSession::HandleChannelUnmute(WorldPacket& recvPacket) void WorldSession::HandleChannelInvite(WorldPacket& recvPacket) { sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); - std::string channelname, otp; - recvPacket >> channelname; - - recvPacket >> otp; - + uint32 channelLength = recvPacket.ReadBits(7); + uint32 nameLength = recvPacket.ReadBits(8); + + std::string channelname = recvPacket.ReadString(channelLength); + std::string otp = recvPacket.ReadString(nameLength); + if (!normalizePlayerName(otp)) return; @@ -214,10 +226,12 @@ void WorldSession::HandleChannelInvite(WorldPacket& recvPacket) void WorldSession::HandleChannelKick(WorldPacket& recvPacket) { sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); - std::string channelname, otp; - recvPacket >> channelname; + uint32 channelLength = recvPacket.ReadBits(8); + uint32 nameLength = recvPacket.ReadBits(7); + + std::string channelname = recvPacket.ReadString(channelLength); + std::string otp = recvPacket.ReadString(nameLength); - recvPacket >> otp; if (!normalizePlayerName(otp)) return; @@ -229,10 +243,14 @@ void WorldSession::HandleChannelKick(WorldPacket& recvPacket) void WorldSession::HandleChannelBan(WorldPacket& recvPacket) { sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); + uint32 channelLength, nameLength; std::string channelname, otp; - recvPacket >> channelname; + + channelLength = recvPacket.ReadBits(8); + nameLength = recvPacket.ReadBits(7); - recvPacket >> otp; + otp = recvPacket.ReadString(nameLength); + channelname = recvPacket.ReadString(channelLength); if (!normalizePlayerName(otp)) return; @@ -246,11 +264,12 @@ void WorldSession::HandleChannelUnban(WorldPacket& recvPacket) { sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); - std::string channelname, otp; - recvPacket >> channelname; - - recvPacket >> otp; - + uint32 channelLength = recvPacket.ReadBits(7); + uint32 nameLength = recvPacket.ReadBits(8); + + std::string otp = recvPacket.ReadString(nameLength); + std::string channelname = recvPacket.ReadString(channelLength) + if (!normalizePlayerName(otp)) return; @@ -262,8 +281,10 @@ void WorldSession::HandleChannelUnban(WorldPacket& recvPacket) void WorldSession::HandleChannelAnnouncements(WorldPacket& recvPacket) { sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); - std::string channelname; - recvPacket >> channelname; + + uint32 length = recvPacket.ReadBits(8); + std::string channelname = recvPacket.ReadString(length); + if (ChannelMgr* cMgr = channelMgr(_player->GetTeam())) if (Channel* chn = cMgr->GetChannel(channelname, _player)) chn->Announce(_player->GetGUID()); diff --git a/src/server/game/Handlers/VehicleHandler.cpp b/src/server/game/Handlers/VehicleHandler.cpp index 5ce0a590900..937ede6c8a9 100644 --- a/src/server/game/Handlers/VehicleHandler.cpp +++ b/src/server/game/Handlers/VehicleHandler.cpp @@ -48,7 +48,7 @@ void WorldSession::HandleDismissControlledVehicle(WorldPacket &recvData) _player->ExitVehicle(); } -void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket &recvData) +void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE"); diff --git a/src/server/game/Handlers/VoiceChatHandler.cpp b/src/server/game/Handlers/VoiceChatHandler.cpp index 785b4f8e5cd..92e6b45d225 100755 --- a/src/server/game/Handlers/VoiceChatHandler.cpp +++ b/src/server/game/Handlers/VoiceChatHandler.cpp @@ -34,6 +34,10 @@ void WorldSession::HandleChannelVoiceOnOpcode(WorldPacket& /*recvData*/) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CHANNEL_VOICE_ON"); // Enable Voice button in channel context menu + /* structure: + 8 bits -> channel name length + string -> channel name + */ } void WorldSession::HandleSetActiveVoiceChannel(WorldPacket& recvData) diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 177475c5332..2f70f7024a1 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -135,24 +135,24 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_CAST_SPELL, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleCastSpellOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_CHANGEPLAYER_DIFFICULTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_ANNOUNCEMENTS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelAnnouncements ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_BAN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelBan ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_DISPLAY_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelDisplayListQuery ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelInvite ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_KICK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelKick ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelList ); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_ANNOUNCEMENTS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelAnnouncements ); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_BAN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelBan ); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_DISPLAY_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelDisplayListQuery ); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelInvite ); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_KICK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelKick ); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelList ); //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_MODERATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_MODERATOR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelModerator ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_MUTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelMute ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_OWNER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelOwner ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_PASSWORD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelPassword ); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_MODERATOR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelModerator ); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_MUTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelMute ); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_OWNER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelOwner ); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_PASSWORD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelPassword ); //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_ROSTER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_SET_OWNER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelSetOwner ); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_SET_OWNER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelSetOwner ); //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_SILENCE_ALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_SILENCE_VOICE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNBAN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelUnban ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNMODERATOR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelUnmoderator ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNMUTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelUnmute ); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNBAN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelUnban ); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNMODERATOR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelUnmoderator ); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNMUTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelUnmute ); //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNSILENCE_ALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNSILENCE_VOICE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_VOICE_OFF, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); -- cgit v1.2.3 From 16035a9eff3628fbd284ded0f1843cf1444211d2 Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 7 Aug 2012 17:10:13 +0100 Subject: Core/PacketIO: Enable many verified opcode handlers --- src/server/game/Entities/Player/Player.cpp | 4 +- src/server/game/Server/Protocol/Opcodes.cpp | 66 ++++++++++++++--------------- src/server/game/Server/Protocol/Opcodes.h | 4 +- src/server/game/Spells/Spell.cpp | 1 + 4 files changed, 38 insertions(+), 37 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 412e136d8d2..487ae4a34cf 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -3974,9 +3974,9 @@ void Player::learnSpell(uint32 spell_id, bool dependent) // prevent duplicated entires in spell book, also not send if not in world (loading) if (learning && IsInWorld()) { - WorldPacket data(SMSG_LEARNED_SPELL, 6); + WorldPacket data(SMSG_LEARNED_SPELL, 8); data << uint32(spell_id); - data << uint16(0); + data << uint32(0); GetSession()->SendPacket(&data); } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 2f70f7024a1..b856d7c53d7 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -64,8 +64,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamQueryOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_REMOVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamRemoveOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_ROSTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamRosterOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_ATTACKSTOP, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleAttackStopOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_ATTACKSWING, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleAttackSwingOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_ATTACKSTOP, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleAttackStopOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_ATTACKSWING, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleAttackSwingOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_BIDDER_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListBidderItems ); //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListItems ); //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_OWNER_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListOwnerItems ); @@ -93,7 +93,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_QUEUE_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_PORT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattleFieldPortOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_REQUEST_SCORE_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); Need to send the response - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_STATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlefieldStatusOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_STATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlefieldStatusOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEGROUND_PLAYER_POSITIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_JOIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlemasterJoinOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_JOIN_ARENA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlemasterJoinArena ); @@ -125,10 +125,10 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_UPDATE_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarUpdateEvent ); DEFINE_OPCODE_HANDLER(CMSG_CANCEL_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelAuraOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_AUTO_REPEAT_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelAutoRepeatSpellOpcode); - //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_CAST, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleCancelCastOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_CANCEL_CAST, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleCancelCastOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_CHANNELLING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelChanneling ); //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_GROWTH_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelGrowthAuraOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_MOUNT_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelMountAuraOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_CANCEL_MOUNT_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelMountAuraOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_QUEUED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_TEMP_ENCHANTMENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelTempEnchantmentOpcode); DEFINE_OPCODE_HANDLER(CMSG_CANCEL_TRADE, STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelTradeOpcode); @@ -510,9 +510,9 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_SEND_SOR_REQUEST_VIA_BNET_ACCOUNT_ID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SERVERTIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SETDEATHBINDPOINT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SETSHEATHED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleSetSheathedOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_SETSHEATHED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleSetSheathedOpcode ); DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIONBAR_TOGGLES, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActionBarToggles ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_ACTION_BUTTON, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActionButtonOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_SET_ACTION_BUTTON, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActionButtonOpcode ); DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIVE_MOVER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActiveMoverOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIVE_VOICE_CHANNEL, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActiveVoiceChannel ); //DEFINE_OPCODE_HANDLER(CMSG_SET_ALLOW_LOW_LEVEL_RAID1, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -605,8 +605,8 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_ZONEUPDATE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleZoneUpdateOpcode ); DEFINE_OPCODE_HANDLER(MSG_AUCTION_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionHelloOpcode ); //DEFINE_OPCODE_HANDLER(MSG_BATTLEGROUND_PLAYER_POSITIONS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlegroundPlayerPositionsOpcode); - //DEFINE_OPCODE_HANDLER(MSG_CHANNEL_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_CHANNEL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(MSG_CHANNEL_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(MSG_CHANNEL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_CORPSE_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCorpseQueryOpcode ); //DEFINE_OPCODE_HANDLER(MSG_GM_BIND_OTHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_GM_SHOWLABEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -675,7 +675,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(MSG_PETITION_RENAME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionRenameOpcode ); //DEFINE_OPCODE_HANDLER(MSG_PVP_LOG_DATA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePVPLogDataOpcode ); //DEFINE_OPCODE_HANDLER(MSG_QUERY_GUILD_BANK_TEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryGuildBankTabText ); - //DEFINE_OPCODE_HANDLER(MSG_QUERY_NEXT_MAIL_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryNextMailTime ); + DEFINE_OPCODE_HANDLER(MSG_QUERY_NEXT_MAIL_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryNextMailTime ); DEFINE_OPCODE_HANDLER(MSG_QUEST_PUSH_RESULT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestPushResult ); DEFINE_OPCODE_HANDLER(MSG_RAID_READY_CHECK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidReadyCheckOpcode ); //DEFINE_OPCODE_HANDLER(MSG_RAID_READY_CHECK_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -698,7 +698,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_ACTIVATETAXIREPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ADDON_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ADD_RUNE_POWER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_AI_REACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_AI_REACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ALL_ACHIEVEMENT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_AREA_SPIRIT_HEALER_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_AREA_TRIGGER_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -713,12 +713,12 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_ROSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ATTACKERSTATEUPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ATTACKSTART, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ATTACKSTOP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ATTACKSWING_BADFACING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ATTACKSWING_CANT_ATTACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ATTACKSWING_DEADTARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ATTACKSWING_NOTINRANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ATTACKSTART, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ATTACKSTOP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ATTACKSWING_BADFACING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ATTACKSWING_CANT_ATTACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ATTACKSWING_DEADTARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ATTACKSWING_NOTINRANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_BIDDER_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_BIDDER_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -748,7 +748,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_PLAYER_POSITIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_PORT_DENIED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_RATED_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS1, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS3, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -791,7 +791,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_CAMERA_SHAKE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CANCEL_AUTO_REPEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CANCEL_COMBAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CAST_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CAST_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHANNEL_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHANNEL_MEMBER_COUNT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CHANNEL_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -818,7 +818,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_TARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CLIENTCACHE_VERSION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CLIENT_CONTROL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMBAT_EVENT_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_COMBAT_EVENT_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMBAT_LOG_MULTIPLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_MAP_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_PARTY_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -862,8 +862,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_DESTRUCTIBLE_BUILDING_DAMAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DIFFERENT_INSTANCE_FROM_PARTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DISENCHANT_CREDIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DISMOUNT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DISMOUNTRESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_DISMOUNT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_DISMOUNTRESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DISPEL_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DISPLAY_GAME_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DONT_AUTO_PUSH_SPELLS_TO_ACTION_BAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -988,7 +988,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_GUILD_XP_GAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_XP_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_HEALTH_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_HIGHEST_THREAT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_HIGHEST_THREAT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_HOTFIX_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_HOTFIX_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_INITIALIZE_FACTIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1008,7 +1008,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_INVALIDATE_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_INVALIDATE_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_INVALID_PROMOTION_CODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_INVENTORY_CHANGE_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_INVENTORY_CHANGE_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ITEM_ADD_PASSIVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ITEM_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ITEM_ENCHANT_TIME_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1023,7 +1023,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_JOINED_BATTLEGROUND_QUEUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_KICK_REASON, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LEARNED_DANCE_MOVES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LEARNED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LEARNED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LEVELUP_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_BOOT_PROPOSAL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_DISABLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1042,7 +1042,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_PARTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_SEARCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_SEARCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_STATUS_NONE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_APPLICANT_LIST_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1175,14 +1175,14 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_PET_CAST_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_DISMISS_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_GUIDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_LEARNED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PET_LEARNED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_NAME_INVALID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_REMOVED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PET_REMOVED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_RENAMEABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_SLOT_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_SPELLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PET_SPELLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_TAME_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PET_UPDATE_COMBO_POINTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAYED_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1250,7 +1250,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_REFER_A_FRIEND_EXPIRED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_REFER_A_FRIEND_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_REFORGE_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_REMOVED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_REMOVED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_REPORT_PVP_AFK_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_REQUEST_CEMETERY_LIST_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_REQUEST_PVP_REWARDS_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1303,9 +1303,9 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_SPELLSTEALLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELL_CATEGORY_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELL_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELL_DELAYED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELL_FAILED_OTHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELL_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELL_DELAYED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELL_FAILED_OTHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELL_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPELL_GO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPELL_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELL_UPDATE_CHAIN_TARGETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 77718da0cf4..4a07e4752a8 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -597,8 +597,8 @@ enum Opcodes CMSG_ZONEUPDATE = 0x4F37, MSG_AUCTION_HELLO = 0x2307, MSG_BATTLEGROUND_PLAYER_POSITIONS = 0x0000, - MSG_CHANNEL_START = 0x0A15, - MSG_CHANNEL_UPDATE = 0x2417, + MSG_CHANNEL_START = 0x0A15, // SMSG only? + MSG_CHANNEL_UPDATE = 0x2417, // SMSG only? MSG_CORPSE_QUERY = 0x4336, MSG_GM_BIND_OTHER = 0x0000, MSG_GM_SHOWLABEL = 0x0000, diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 6fdba447b17..740ac97978d 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3841,6 +3841,7 @@ void Spell::SendCastResult(Player* caster, SpellInfo const* spellInfo, uint8 cas data << uint32(missingItem); // first missing item break; } + // TODO: SPELL_FAILED_NOT_STANDING default: break; } -- cgit v1.2.3 From 224cf663e2af8b355b4bdca4069080636321b0ba Mon Sep 17 00:00:00 2001 From: Subv Date: Tue, 7 Aug 2012 11:25:30 -0500 Subject: Fixed a compile error --- src/server/game/Handlers/ChannelHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Handlers/ChannelHandler.cpp b/src/server/game/Handlers/ChannelHandler.cpp index 82e46844a2c..dba4645e2b5 100755 --- a/src/server/game/Handlers/ChannelHandler.cpp +++ b/src/server/game/Handlers/ChannelHandler.cpp @@ -268,7 +268,7 @@ void WorldSession::HandleChannelUnban(WorldPacket& recvPacket) uint32 nameLength = recvPacket.ReadBits(8); std::string otp = recvPacket.ReadString(nameLength); - std::string channelname = recvPacket.ReadString(channelLength) + std::string channelname = recvPacket.ReadString(channelLength); if (!normalizePlayerName(otp)) return; -- cgit v1.2.3 From f79a6fc009d5338dd939b9be9bfc3d8e3523ea79 Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 7 Aug 2012 18:35:59 +0100 Subject: Core/PacketIO: Enable spelllog related opcodes; missing interruptlog because that wasn't used in 335 --- src/server/game/Entities/Unit/Unit.cpp | 2 +- src/server/game/Server/Protocol/Opcodes.cpp | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index f8c0142c801..fa3f02924fa 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -1381,7 +1381,7 @@ void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss) int32 overkill = int32(damage) - int32(GetHealth()); data << uint32(overkill > 0 ? overkill : 0); // Overkill data << uint32(i_spellProto->SchoolMask); - data << uint32(0); // Unknown 4.x + data << uint32(0); // FIX ME: Send resisted damage, both fully resisted and partly resisted victim->SendMessageToSet(&data, true); victim->DealDamage(this, damage, 0, SPELL_DIRECT_DAMAGE, i_spellProto->GetSchoolMask(), i_spellProto, true); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index b856d7c53d7..7846159fa92 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -1289,20 +1289,20 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_SHOW_BANK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SHOW_RATINGS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SOR_START_EXPERIENCE_INCOMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELLBREAKLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELLDAMAGESHIELD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELLDISPELLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELLENERGIZELOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELLHEALLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELLINSTAKILLLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELLBREAKLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELLDAMAGESHIELD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELLDISPELLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELLENERGIZELOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELLHEALLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELLINSTAKILLLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELLINTERRUPTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELLLOGEXECUTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELLLOGMISS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELLNONMELEEDAMAGELOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELLORDAMAGE_IMMUNE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELLSTEALLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELLLOGEXECUTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELLLOGMISS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELLNONMELEEDAMAGELOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELLORDAMAGE_IMMUNE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELLSTEALLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELL_CATEGORY_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELL_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELL_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPELL_DELAYED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPELL_FAILED_OTHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPELL_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From 44557b57ffec34c4cad94469d629da06173981a7 Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 7 Aug 2012 19:41:36 +0100 Subject: Core/PacketIO: Enable few more opcode handlers... --- src/server/game/Server/Protocol/Opcodes.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 7846159fa92..995dbf1d6bf 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -300,7 +300,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_INSTANCE_LOCK_WARNING_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_ITEM_REFUND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemRefund ); DEFINE_OPCODE_HANDLER(CMSG_ITEM_REFUND_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemRefundInfoRequest ); - //DEFINE_OPCODE_HANDLER(CMSG_ITEM_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemTextQuery ); + DEFINE_OPCODE_HANDLER(CMSG_ITEM_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemTextQuery ); DEFINE_OPCODE_HANDLER(CMSG_JOIN_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleJoinChannel ); DEFINE_OPCODE_HANDLER(CMSG_KEEP_ALIVE, STATUS_NEVER, PROCESS_THREADUNSAFE, &WorldSession::Handle_EarlyProccess ); DEFINE_OPCODE_HANDLER(CMSG_LEARN_PREVIEW_TALENTS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnPreviewTalents ); @@ -422,7 +422,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_PET_CAST_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetCastSpellOpcode ); DEFINE_OPCODE_HANDLER(CMSG_PET_LEARN_TALENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetLearnTalent ); //DEFINE_OPCODE_HANDLER(CMSG_PET_NAME_CACHE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_PET_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetNameQuery ); + DEFINE_OPCODE_HANDLER(CMSG_PET_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetNameQuery ); //DEFINE_OPCODE_HANDLER(CMSG_PET_RENAME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetRename ); //DEFINE_OPCODE_HANDLER(CMSG_PET_SET_ACTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetSetAction ); //DEFINE_OPCODE_HANDLER(CMSG_PET_SPELL_AUTOCAST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetSpellAutocastOpcode ); @@ -1018,7 +1018,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_ITEM_REFUND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ITEM_REMOVE_PASSIVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ITEM_SEND_PASSIVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ITEM_TEXT_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ITEM_TEXT_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ITEM_TIME_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_JOINED_BATTLEGROUND_QUEUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_KICK_REASON, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1155,13 +1155,13 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_OPEN_CONTAINER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_OPEN_LFG_DUNGEON_FINDER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_OVERRIDE_LIGHT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PAGE_TEXT_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PARTYKILLLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PAGE_TEXT_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PARTYKILLLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PARTY_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PARTY_MEMBER_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PARTY_MEMBER_STATS_FULL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PAUSE_MIRROR_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PERIODICAURALOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PERIODICAURALOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PETGODMODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PETITION_ALREADY_SIGNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PETITION_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1178,7 +1178,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_PET_LEARNED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_NAME_INVALID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PET_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PET_REMOVED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_RENAMEABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_SLOT_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From 46cf08684d8ec4166b4b917726437abbc703f4a4 Mon Sep 17 00:00:00 2001 From: Subv Date: Tue, 7 Aug 2012 18:24:10 -0500 Subject: Core/PacketIO: Fixed and enabled SMSG_ITEM_REFUND_RESULT --- src/server/game/Entities/Player/Player.cpp | 70 ++++++++++++++++++++--------- src/server/game/Entities/Player/Player.h | 1 + src/server/game/Handlers/GroupHandler.cpp | 2 +- src/server/game/Server/Protocol/Opcodes.cpp | 8 ++-- 4 files changed, 56 insertions(+), 25 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 7250feefc21..9c0cbae7c11 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -19797,7 +19797,7 @@ void Player::SendResetInstanceFailed(uint32 reason, uint32 MapId) // 1: There are players offline in your party. // 2>: There are players in your party attempting to zone into an instance. */ - WorldPacket data(SMSG_INSTANCE_RESET_FAILED, 4); + WorldPacket data(SMSG_INSTANCE_RESET_FAILED, 8); data << uint32(reason); data << uint32(MapId); GetSession()->SendPacket(&data); @@ -25354,7 +25354,7 @@ void Player::DeleteRefundReference(uint32 it) } } -void Player::SendRefundInfo(Item *item) +void Player::SendRefundInfo(Item* item) { // This function call unsets ITEM_FLAGS_REFUNDABLE if played time is over 2 hours. item->UpdatePlayedTime(this); @@ -25439,6 +25439,51 @@ bool Player::AddItem(uint32 itemId, uint32 count) return true; } +void Player::SendItemRefundResult(Item* item, ItemExtendedCostEntry const* iece, uint8 error) +{ + ObjectGuid guid = item->GetGUID(); + WorldPacket data(SMSG_ITEM_REFUND_RESULT, 1 + 1 + 8 + 4*8 + 4 + 4*8 + 1); + data.WriteBit(guid[4]); + data.WriteBit(guid[5]); + data.WriteBit(guid[1]); + data.WriteBit(guid[6]); + data.WriteBit(guid[7]); + data.WriteBit(guid[0]); + data.WriteBit(guid[3]); + data.WriteBit(guid[2]); + data.WriteBit(!error); + data.WriteBit(item->GetPaidMoney() > 0); + data.FlushBits(); + if (!error) + { + for (uint8 i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i) + { + data << uint32(iece->RequiredCurrencyCount[i]); + data << uint32(iece->RequiredCurrency[i]); + } + + data << uint32(item->GetPaidMoney()); // money cost + + for (uint8 i = 0; i < MAX_ITEM_EXT_COST_ITEMS; ++i) // item cost data + { + data << uint32(iece->RequiredItemCount[i]); + data << uint32(iece->RequiredItem[i]); + } + } + + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[6]); + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[5]); + + data << uint8(error); // error code + GetSession()->SendPacket(&data); +} + void Player::RefundItem(Item* item) { if (!item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE)) @@ -25450,10 +25495,7 @@ void Player::RefundItem(Item* item) if (item->IsRefundExpired()) // item refund has expired { item->SetNotRefundable(this); - WorldPacket data(SMSG_ITEM_REFUND_RESULT, 8+4); - data << uint64(item->GetGUID()); // Guid - data << uint32(10); // Error! - GetSession()->SendPacket(&data); + SendItemRefundResult(item, NULL, 10); return; } @@ -25491,23 +25533,11 @@ void Player::RefundItem(Item* item) if (store_error) { - WorldPacket data(SMSG_ITEM_REFUND_RESULT, 8+4); - data << uint64(item->GetGUID()); // Guid - data << uint32(10); // Error! - GetSession()->SendPacket(&data); + SendItemRefundResult(item, iece, 10); return; } - WorldPacket data(SMSG_ITEM_REFUND_RESULT, 8+4+4+4+4+4*4+4*4); - data << uint64(item->GetGUID()); // item guid - data << uint32(0); // 0, or error code - data << uint32(item->GetPaidMoney()); // money cost - for (uint8 i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i) // item cost data - { - data << uint32(iece->RequiredItem[i]); - data << uint32(iece->RequiredItemCount[i]); - } - GetSession()->SendPacket(&data); + SendItemRefundResult(item, iece, 0); uint32 moneyRefund = item->GetPaidMoney(); // item-> will be invalidated in DestroyItem diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index cea45d06936..374c761910e 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -2873,6 +2873,7 @@ class Player : public Unit, public GridObject std::set m_refundableItems; void SendRefundInfo(Item* item); void RefundItem(Item* item); + void SendItemRefundResult(Item* item, ItemExtendedCostEntry const* iece, uint8 error); // know currencies are not removed at any point (0 displayed) void AddKnownCurrency(uint32 itemId); diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp index 4e492c6626d..a07fcd7e24d 100644 --- a/src/server/game/Handlers/GroupHandler.cpp +++ b/src/server/game/Handlers/GroupHandler.cpp @@ -1015,7 +1015,7 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player* player, WorldPacke } /*this procedure handles clients CMSG_REQUEST_PARTY_MEMBER_STATS request*/ -void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket &recvData) +void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_REQUEST_PARTY_MEMBER_STATS"); uint64 Guid; diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 219dd120178..1f4093519a9 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -1002,9 +1002,9 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_INSPECT_TALENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_DIFFICULTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_LOCK_WARNING_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_RESET_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_SAVE_CREATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_RESET_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_SAVE_CREATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_INVALIDATE_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_INVALIDATE_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_INVALID_PROMOTION_CODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1015,7 +1015,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_ITEM_EXPIRE_PURCHASE_REFUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ITEM_PUSH_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ITEM_REFUND_INFO_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ITEM_REFUND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ITEM_REFUND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ITEM_REMOVE_PASSIVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ITEM_SEND_PASSIVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ITEM_TEXT_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From cb5b85d9e0cf483be814e03f02fe145fa32ff451 Mon Sep 17 00:00:00 2001 From: Subv Date: Tue, 7 Aug 2012 19:54:42 -0500 Subject: Core/PacketIO: Enabled/Fixed more opcodes --- src/server/game/Entities/Player/Player.cpp | 124 ++++++++++++++++++++++++---- src/server/game/Entities/Player/Player.h | 2 +- src/server/game/Handlers/ItemHandler.cpp | 20 ++--- src/server/game/Loot/LootMgr.cpp | 2 +- src/server/game/Server/Protocol/Opcodes.cpp | 32 +++---- 5 files changed, 137 insertions(+), 43 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 9c0cbae7c11..a337caadd73 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -192,15 +192,16 @@ void PlayerTaxi::LoadTaxiMask(const char* data) void PlayerTaxi::AppendTaximaskTo(ByteBuffer& data, bool all) { + data << uint32(TaxiMaskSize); if (all) { - for (uint8 i=0; iSendPacket(&data); } -void Player::SendSellError(SellResult msg, Creature* creature, uint64 guid, uint32 param) +void Player::SendSellError(SellResult msg, Creature* creature, uint64 guid) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_SELL_ITEM"); - WorldPacket data(SMSG_SELL_ITEM, (8+8+(param?4:0)+1)); // last check 2.0.10 + WorldPacket data(SMSG_SELL_ITEM, (8+8+(param?4:0)+1)); // last check 4.3.4 data << uint64(creature ? creature->GetGUID() : 0); data << uint64(guid); - if (param > 0) - data << uint32(param); data << uint8(msg); GetSession()->SendPacket(&data); } @@ -16269,7 +16268,7 @@ void Player::SendQuestComplete(Quest const* quest) } WorldPacket data(SMSG_QUESTUPDATE_COMPLETE, 4); - data << uint64(this->GetGUID()); + data << uint64(GetGUID()); data << uint32(quest->GetQuestId()); data << title; data << completedText; @@ -25794,17 +25793,112 @@ void Player::SendMovementSetHover(bool apply) void Player::SendMovementSetWaterWalking(bool apply) { - WorldPacket data(apply ? SMSG_MOVE_WATER_WALK : SMSG_MOVE_LAND_WALK, 12); - data.append(GetPackGUID()); - data << uint32(0); //! movement counter + ObjectGuid guid = GetGUID(); + WorldPacket data; + if (apply) + { + data.Initialize(SMSG_MOVE_WATER_WALK, 1 + 4 + 8); + data.WriteBit(guid[4]); + data.WriteBit(guid[7]); + data.WriteBit(guid[6]); + data.WriteBit(guid[0]); + data.WriteBit(guid[1]); + data.WriteBit(guid[3]); + data.WriteBit(guid[5]); + data.WriteBit(guid[2]); + + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[5]); + data.WriteByteSeq(guid[2]); + + data << uint32(0); //! movement counter + + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[6]); + } + else + { + data.Initialize(SMSG_MOVE_LAND_WALK, 1 + 4 + 8); + data.WriteBit(guid[5]); + data.WriteBit(guid[1]); + data.WriteBit(guid[6]); + data.WriteBit(guid[2]); + data.WriteBit(guid[3]); + data.WriteBit(guid[4]); + data.WriteBit(guid[0]); + data.WriteBit(guid[7]); + + data.WriteByteSeq(guid[6]); + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[5]); + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[2]); + + data << uint32(0); //! movement counter + } SendDirectMessage(&data); } void Player::SendMovementSetFeatherFall(bool apply) { - WorldPacket data(apply ? SMSG_MOVE_FEATHER_FALL : SMSG_MOVE_NORMAL_FALL, 12); - data.append(GetPackGUID()); - data << uint32(0); //! movement counter + ObjectGuid guid = GetGUID(); + WorldPacket data; + + if (apply) + { + data.Initialize(SMSG_MOVE_FEATHER_FALL, 1 + 4 + 8); + data.WriteBit(guid[3]); + data.WriteBit(guid[1]); + data.WriteBit(guid[7]); + data.WriteBit(guid[0]); + data.WriteBit(guid[4]); + data.WriteBit(guid[2]); + data.WriteBit(guid[5]); + data.WriteBit(guid[6]); + + data.WriteByteSeq(guid[5]); + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[2]); + + data << uint32(0); //! movement counter + + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[6]); + } + else + { + data.Initialize(SMSG_MOVE_NORMAL_FALL, 1 + 4 + 8); + + data << uint32(0); //! movement counter + + data.WriteBit(guid[3]); + data.WriteBit(guid[0]); + data.WriteBit(guid[1]); + data.WriteBit(guid[5]); + data.WriteBit(guid[7]); + data.WriteBit(guid[4]); + data.WriteBit(guid[6]); + data.WriteBit(guid[2]); + + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[5]); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[6]); + } + SendDirectMessage(&data); } diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 374c761910e..7a5418e8645 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1357,7 +1357,7 @@ class Player : public Unit, public GridObject void RemoveItemFromBuyBackSlot(uint32 slot, bool del); void SendEquipError(InventoryResult msg, Item* pItem, Item* pItem2 = NULL, uint32 itemid = 0); void SendBuyError(BuyResult msg, Creature* creature, uint32 item, uint32 param); - void SendSellError(SellResult msg, Creature* creature, uint64 guid, uint32 param); + void SendSellError(SellResult msg, Creature* creature, uint64 guid); void AddWeaponProficiency(uint32 newflag) { m_WeaponProficiency |= newflag; } void AddArmorProficiency(uint32 newflag) { m_ArmorProficiency |= newflag; } uint32 GetWeaponProficiency() const { return m_WeaponProficiency; } diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 73c90498eaa..ce85a0b1ef7 100644 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -501,7 +501,7 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recvData) if (!creature) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleSellItemOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(vendorguid))); - _player->SendSellError(SELL_ERR_CANT_FIND_VENDOR, NULL, itemguid, 0); + _player->SendSellError(SELL_ERR_CANT_FIND_VENDOR, NULL, itemguid); return; } @@ -515,21 +515,21 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recvData) // prevent sell not owner item if (_player->GetGUID() != pItem->GetOwnerGUID()) { - _player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid, 0); + _player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid); return; } // prevent sell non empty bag by drag-and-drop at vendor's item list if (pItem->IsNotEmptyBag()) { - _player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid, 0); + _player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid); return; } // prevent sell currently looted item if (_player->GetLootGUID() == pItem->GetGUID()) { - _player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid, 0); + _player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid); return; } @@ -549,7 +549,7 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recvData) // prevent sell more items that exist in stack (possible only not from client) if (count > pItem->GetCount()) { - _player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid, 0); + _player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid); return; } } @@ -565,7 +565,7 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recvData) if (!pNewItem) { sLog->outError(LOG_FILTER_NETWORKIO, "WORLD: HandleSellItemOpcode - could not create clone of item %u; count = %u", pItem->GetEntry(), count); - _player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid, 0); + _player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid); return; } @@ -592,11 +592,11 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recvData) _player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_VENDORS, money); } else - _player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid, 0); + _player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, itemguid); return; } } - _player->SendSellError(SELL_ERR_CANT_FIND_ITEM, creature, itemguid, 0); + _player->SendSellError(SELL_ERR_CANT_FIND_ITEM, creature, itemguid); return; } @@ -612,7 +612,7 @@ void WorldSession::HandleBuybackItem(WorldPacket& recvData) if (!creature) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleBuybackItem - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(vendorguid))); - _player->SendSellError(SELL_ERR_CANT_FIND_VENDOR, NULL, 0, 0); + _player->SendSellError(SELL_ERR_CANT_FIND_VENDOR, NULL, 0); return; } @@ -728,7 +728,7 @@ void WorldSession::SendListInventory(uint64 vendorGuid) if (!vendor) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: SendListInventory - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(vendorGuid))); - _player->SendSellError(SELL_ERR_CANT_FIND_VENDOR, NULL, 0, 0); + _player->SendSellError(SELL_ERR_CANT_FIND_VENDOR, NULL, 0); return; } diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index 275e8f93d8b..bd331fcc22b 100755 --- a/src/server/game/Loot/LootMgr.cpp +++ b/src/server/game/Loot/LootMgr.cpp @@ -808,7 +808,7 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv) size_t count_pos = b.wpos(); // pos of item count byte b << uint8(0); // item count placeholder - b << uint8(0); // 4.x unknown + b << uint8(0); // Currency count switch (lv.permission) { diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 1f4093519a9..fdd5c952ad9 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -1024,7 +1024,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_KICK_REASON, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LEARNED_DANCE_MOVES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LEARNED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LEVELUP_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LEVELUP_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_BOOT_PROPOSAL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_DISABLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_JOIN_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1100,12 +1100,12 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_MOVE_DISABLE_GRAVITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_ENABLE_COLLISION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_ENABLE_GRAVITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_FEATHER_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_FEATHER_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_GRAVITY_DISABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_GRAVITY_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_KNOCK_BACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_LAND_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_NORMAL_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_LAND_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_NORMAL_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_ACTIVE_MOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1139,7 +1139,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_TELEPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MULTIPLE_PACKETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_NEW_TAXI_PATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1157,7 +1157,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_OVERRIDE_LIGHT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PAGE_TEXT_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PARTYKILLLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PARTY_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PARTY_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PARTY_MEMBER_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PARTY_MEMBER_STATS_FULL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PAUSE_MIRROR_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1205,7 +1205,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_POWER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PRE_RESURRECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PROCRESIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PROPOSE_LEVEL_GRANT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PROPOSE_LEVEL_GRANT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PUREMOUNT_CANCELLED_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PVP_CREDIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PVP_LOG_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1221,7 +1221,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_REQUEST_ITEMS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_STATUS_MULTIPLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_QUESTLOG_FULL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUESTLOG_FULL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_ADD_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_ADD_KILL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_ADD_PVP_KILL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1242,7 +1242,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_RATED_BG_RATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_RATED_BG_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_READ_ITEM_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_READ_ITEM_OK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_READ_ITEM_OK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_REALM_SPLIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_REAL_GROUP_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_RECEIVED_MAIL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1264,19 +1264,19 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_RESYNC_RUNES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ROLE_POLL_BEGIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_RWHOIS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SELL_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SEND_MAIL_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SELL_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SEND_MAIL_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SEND_UNLEARN_SPELLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SERVERTIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SERVER_FIRST_ACHIEVEMENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SERVER_INFO_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SERVER_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SERVER_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SERVER_PERF, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SETUP_RESEARCH_HISTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SET_DF_FAST_LAUNCH_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SET_FACTION_ATWAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SET_FACTION_STANDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SET_FACTION_VISIBLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SET_FACTION_STANDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SET_FACTION_VISIBLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SET_FLAT_SPELL_MODIFIER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SET_FORCED_REACTIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SET_PCT_SPELL_MODIFIER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1285,8 +1285,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_SET_PLAY_HOVER_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SET_PROFICIENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SET_PROJECTILE_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SHOWTAXINODES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SHOW_BANK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SHOWTAXINODES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SHOW_BANK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SHOW_RATINGS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SOR_START_EXPERIENCE_INCOMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPELLBREAKLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From a781555f94623072bf61044ee444fbc7a464d12a Mon Sep 17 00:00:00 2001 From: Nay Date: Wed, 8 Aug 2012 03:11:10 +0100 Subject: Core&DB/NPCs: Add an extra field for mana_mod in creature_template (for proper mana calculations) This field is usually 2 for a small group of creatures with double mana --- .../2012_08_08_00_world_creature_template.sql | 1 + src/server/game/Entities/Creature/Creature.h | 3 ++- src/server/game/Globals/ObjectMgr.cpp | 27 ++++++++++---------- src/server/scripts/Commands/cs_reload.cpp | 29 +++++++++++----------- .../Database/Implementation/WorldDatabase.cpp | 2 +- 5 files changed, 33 insertions(+), 29 deletions(-) create mode 100644 sql/updates/world/2012_08_08_00_world_creature_template.sql (limited to 'src') diff --git a/sql/updates/world/2012_08_08_00_world_creature_template.sql b/sql/updates/world/2012_08_08_00_world_creature_template.sql new file mode 100644 index 00000000000..1e934b9f612 --- /dev/null +++ b/sql/updates/world/2012_08_08_00_world_creature_template.sql @@ -0,0 +1 @@ +ALTER TABLE `creature_template` ADD `Mana_mod_extra` float NOT NULL DEFAULT '1' AFTER `Mana_mod`; diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index dc1cee2e28f..f58e49b9e14 100755 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -139,6 +139,7 @@ struct CreatureTemplate float HoverHeight; float ModHealth; float ModMana; + float ModManaExtra; // Added in 4.x, this value is usually 2 for a small group of creatures with double mana float ModArmor; bool RacialLeader; uint32 questItems[MAX_CREATURE_QUEST_ITEMS]; @@ -197,7 +198,7 @@ struct CreatureBaseStats if (!BaseMana) return 0; - return uint32((BaseMana * info->ModMana) + 0.5f); + return uint32((BaseMana * info->ModMana * info->ModManaExtra) + 0.5f); } uint32 GenerateArmor(CreatureTemplate const* info) const diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 81fb8ad9646..c1fe89fa86b 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -380,9 +380,9 @@ void ObjectMgr::LoadCreatureTemplates() "type_flags, type_flags2, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, " // 55 56 57 58 59 60 61 62 63 64 65 66 67 68 "spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, PetSpellDataId, VehicleId, mingold, maxgold, AIName, MovementType, " - // 69 70 71 72 73 74 75 76 77 78 79 - "InhabitType, HoverHeight, Health_mod, Mana_mod, Armor_mod, RacialLeader, questItem1, questItem2, questItem3, questItem4, questItem5, " - // 80 81 82 83 84 85 86 + // 69 70 71 72 73 74 75 76 77 78 79 80 + "InhabitType, HoverHeight, Health_mod, Mana_mod, Mana_mod_extra, Armor_mod, RacialLeader, questItem1, questItem2, questItem3, questItem4, questItem5, " + // 81 82 83 84 85 86 87 " questItem6, movementId, RegenHealth, equipment_id, mechanic_immune_mask, flags_extra, ScriptName " "FROM creature_template;"); @@ -472,18 +472,19 @@ void ObjectMgr::LoadCreatureTemplates() creatureTemplate.HoverHeight = fields[70].GetFloat(); creatureTemplate.ModHealth = fields[71].GetFloat(); creatureTemplate.ModMana = fields[72].GetFloat(); - creatureTemplate.ModArmor = fields[73].GetFloat(); - creatureTemplate.RacialLeader = fields[74].GetBool(); + creatureTemplate.ModManaExtra = fields[73].GetFloat(); + creatureTemplate.ModArmor = fields[74].GetFloat(); + creatureTemplate.RacialLeader = fields[75].GetBool(); for (uint8 i = 0; i < MAX_CREATURE_QUEST_ITEMS; ++i) - creatureTemplate.questItems[i] = fields[75 + i].GetUInt32(); - - creatureTemplate.movementId = fields[81].GetUInt32(); - creatureTemplate.RegenHealth = fields[82].GetBool(); - creatureTemplate.equipmentId = fields[83].GetUInt32(); - creatureTemplate.MechanicImmuneMask = fields[84].GetUInt32(); - creatureTemplate.flags_extra = fields[85].GetUInt32(); - creatureTemplate.ScriptID = GetScriptId(fields[86].GetCString()); + creatureTemplate.questItems[i] = fields[76 + i].GetUInt32(); + + creatureTemplate.movementId = fields[82].GetUInt32(); + creatureTemplate.RegenHealth = fields[83].GetBool(); + creatureTemplate.equipmentId = fields[84].GetUInt32(); + creatureTemplate.MechanicImmuneMask = fields[85].GetUInt32(); + creatureTemplate.flags_extra = fields[86].GetUInt32(); + creatureTemplate.ScriptID = GetScriptId(fields[87].GetCString()); ++count; } diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp index 93b450bab0f..40b36fb8d52 100644 --- a/src/server/scripts/Commands/cs_reload.cpp +++ b/src/server/scripts/Commands/cs_reload.cpp @@ -501,20 +501,21 @@ public: cInfo->HoverHeight = fields[67].GetFloat(); cInfo->ModHealth = fields[68].GetFloat(); cInfo->ModMana = fields[69].GetFloat(); - cInfo->ModArmor = fields[70].GetFloat(); - cInfo->RacialLeader = fields[71].GetBool(); - cInfo->questItems[0] = fields[72].GetUInt32(); - cInfo->questItems[1] = fields[73].GetUInt32(); - cInfo->questItems[2] = fields[74].GetUInt32(); - cInfo->questItems[3] = fields[75].GetUInt32(); - cInfo->questItems[4] = fields[76].GetUInt32(); - cInfo->questItems[5] = fields[77].GetUInt32(); - cInfo->movementId = fields[78].GetUInt32(); - cInfo->RegenHealth = fields[79].GetBool(); - cInfo->equipmentId = fields[80].GetUInt32(); - cInfo->MechanicImmuneMask = fields[81].GetUInt32(); - cInfo->flags_extra = fields[82].GetUInt32(); - cInfo->ScriptID = sObjectMgr->GetScriptId(fields[83].GetCString()); + cInfo->ModManaExtra = fields[70].GetFloat(); + cInfo->ModArmor = fields[71].GetFloat(); + cInfo->RacialLeader = fields[72].GetBool(); + cInfo->questItems[0] = fields[73].GetUInt32(); + cInfo->questItems[1] = fields[74].GetUInt32(); + cInfo->questItems[2] = fields[75].GetUInt32(); + cInfo->questItems[3] = fields[76].GetUInt32(); + cInfo->questItems[4] = fields[77].GetUInt32(); + cInfo->questItems[5] = fields[78].GetUInt32(); + cInfo->movementId = fields[79].GetUInt32(); + cInfo->RegenHealth = fields[80].GetBool(); + cInfo->equipmentId = fields[81].GetUInt32(); + cInfo->MechanicImmuneMask = fields[82].GetUInt32(); + cInfo->flags_extra = fields[83].GetUInt32(); + cInfo->ScriptID = sObjectMgr->GetScriptId(fields[84].GetCString()); sObjectMgr->CheckCreatureTemplate(cInfo); } diff --git a/src/server/shared/Database/Implementation/WorldDatabase.cpp b/src/server/shared/Database/Implementation/WorldDatabase.cpp index 872d9ec415c..fe2a9f7906c 100755 --- a/src/server/shared/Database/Implementation/WorldDatabase.cpp +++ b/src/server/shared/Database/Implementation/WorldDatabase.cpp @@ -78,7 +78,7 @@ void WorldDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(WORLD_INS_CREATURE_TRANSPORT, "INSERT INTO creature_transport (guid, npc_entry, transport_entry, TransOffsetX, TransOffsetY, TransOffsetZ, TransOffsetO) values (?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); PREPARE_STATEMENT(WORLD_UPD_CREATURE_TRANSPORT_EMOTE, "UPDATE creature_transport SET emote = ? WHERE transport_entry = ? AND guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(WORLD_SEL_COMMANDS, "SELECT name, security, help FROM command", CONNECTION_SYNCH); - PREPARE_STATEMENT(WORLD_SEL_CREATURE_TEMPLATE, "SELECT difficulty_entry_1, difficulty_entry_2, difficulty_entry_3, KillCredit1, KillCredit2, modelid1, modelid2, modelid3, modelid4, name, subname, IconName, gossip_menu_id, minlevel, maxlevel, exp, faction_A, faction_H, npcflag, speed_walk, speed_run, scale, rank, mindmg, maxdmg, dmgschool, attackpower, dmg_multiplier, baseattacktime, rangeattacktime, unit_class, unit_flags, dynamicflags, family, trainer_type, trainer_spell, trainer_class, trainer_race, minrangedmg, maxrangedmg, rangedattackpower, type, type_flags, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, PetSpellDataId, VehicleId, mingold, maxgold, AIName, MovementType, InhabitType, HoverHeight, Health_mod, Mana_mod, Armor_mod, RacialLeader, questItem1, questItem2, questItem3, questItem4, questItem5, questItem6, movementId, RegenHealth, equipment_id, mechanic_immune_mask, flags_extra, ScriptName FROM creature_template WHERE entry = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(WORLD_SEL_CREATURE_TEMPLATE, "SELECT difficulty_entry_1, difficulty_entry_2, difficulty_entry_3, KillCredit1, KillCredit2, modelid1, modelid2, modelid3, modelid4, name, subname, IconName, gossip_menu_id, minlevel, maxlevel, exp, faction_A, faction_H, npcflag, speed_walk, speed_run, scale, rank, mindmg, maxdmg, dmgschool, attackpower, dmg_multiplier, baseattacktime, rangeattacktime, unit_class, unit_flags, dynamicflags, family, trainer_type, trainer_spell, trainer_class, trainer_race, minrangedmg, maxrangedmg, rangedattackpower, type, type_flags, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, PetSpellDataId, VehicleId, mingold, maxgold, AIName, MovementType, InhabitType, HoverHeight, Health_mod, Mana_mod, Mana_mod_extra, Armor_mod, RacialLeader, questItem1, questItem2, questItem3, questItem4, questItem5, questItem6, movementId, RegenHealth, equipment_id, mechanic_immune_mask, flags_extra, ScriptName FROM creature_template WHERE entry = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(WORLD_SEL_WAYPOINT_SCRIPT_BY_ID, "SELECT guid, delay, command, datalong, datalong2, dataint, x, y, z, o FROM waypoint_scripts WHERE id = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(WORLD_SEL_IP2NATION_COUNTRY, "SELECT c.country FROM ip2nationCountries c, ip2nation i WHERE i.ip < ? AND c.code = i.country ORDER BY i.ip DESC LIMIT 0,1", CONNECTION_SYNCH); PREPARE_STATEMENT(WORLD_SEL_ITEM_TEMPLATE_BY_NAME, "SELECT entry FROM item_template WHERE name = ?", CONNECTION_SYNCH); -- cgit v1.2.3 From 7249992e28c6bf322bdfca9c4f037a22a06a3827 Mon Sep 17 00:00:00 2001 From: Nay Date: Wed, 8 Aug 2012 03:42:48 +0100 Subject: DB: Rename characters' void_storage to character_void_storage Core: Fix build (/slap subv) Also proper names for sql files --- sql/base/characters_database.sql | 60 +++++++++++----------- .../2012_07_10_00_characters_character_glyphs.sql | 4 -- ...12_07_10_00_characters_character_glyphs_434.sql | 4 ++ .../2012_08_07_00_characters_characters.sql | 2 - .../2012_08_07_00_characters_characters_434.sql | 2 + .../2012_08_07_01_characters_void_storage_434.sql | 1 + sql/updates/world/2012_08_05_02_world_command.sql | 2 - .../world/2012_08_05_02_world_command_434.sql | 2 + .../world/2012_08_06_00_world_classlevelstats.sql | 7 --- .../2012_08_06_00_world_classlevelstats_434.sql | 7 +++ sql/updates/world/2012_08_06_00_world_command.sql | 4 -- .../world/2012_08_06_00_world_command_434.sql | 4 ++ .../world/2012_08_06_01_world_classlevelstats.sql | 6 --- .../2012_08_06_01_world_classlevelstats_434.sql | 6 +++ .../2012_08_08_00_world_creature_template.sql | 1 - .../2012_08_08_00_world_creature_template_434.sql | 1 + src/server/game/Entities/Player/Player.cpp | 6 +-- src/server/game/Entities/Player/Player.h | 1 + src/server/game/Globals/ObjectMgr.cpp | 2 +- src/server/scripts/Commands/cs_debug.cpp | 2 +- .../Database/Implementation/CharacterDatabase.cpp | 6 +-- 21 files changed, 66 insertions(+), 64 deletions(-) delete mode 100644 sql/updates/characters/2012_07_10_00_characters_character_glyphs.sql create mode 100644 sql/updates/characters/2012_07_10_00_characters_character_glyphs_434.sql delete mode 100644 sql/updates/characters/2012_08_07_00_characters_characters.sql create mode 100644 sql/updates/characters/2012_08_07_00_characters_characters_434.sql create mode 100644 sql/updates/characters/2012_08_07_01_characters_void_storage_434.sql delete mode 100644 sql/updates/world/2012_08_05_02_world_command.sql create mode 100644 sql/updates/world/2012_08_05_02_world_command_434.sql delete mode 100644 sql/updates/world/2012_08_06_00_world_classlevelstats.sql create mode 100644 sql/updates/world/2012_08_06_00_world_classlevelstats_434.sql delete mode 100644 sql/updates/world/2012_08_06_00_world_command.sql create mode 100644 sql/updates/world/2012_08_06_00_world_command_434.sql delete mode 100644 sql/updates/world/2012_08_06_01_world_classlevelstats.sql create mode 100644 sql/updates/world/2012_08_06_01_world_classlevelstats_434.sql delete mode 100644 sql/updates/world/2012_08_08_00_world_creature_template.sql create mode 100644 sql/updates/world/2012_08_08_00_world_creature_template_434.sql (limited to 'src') diff --git a/sql/base/characters_database.sql b/sql/base/characters_database.sql index e7e68407156..addebff5aa5 100644 --- a/sql/base/characters_database.sql +++ b/sql/base/characters_database.sql @@ -1119,6 +1119,36 @@ LOCK TABLES `character_talent` WRITE; /*!40000 ALTER TABLE `character_talent` ENABLE KEYS */; UNLOCK TABLES; +-- +-- Table structure for table `character_void_storage` +-- + +DROP TABLE IF EXISTS `character_void_storage`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `character_void_storage` ( + `itemId` bigint(20) unsigned NOT NULL, + `playerGuid` int(10) unsigned NOT NULL, + `itemEntry` mediumint(8) unsigned NOT NULL, + `slot` tinyint(3) unsigned NOT NULL, + `creatorGuid` int(10) unsigned NOT NULL DEFAULT '0', + `randomProperty` int(10) unsigned NOT NULL DEFAULT '0', + `suffixFactor` int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`itemId`), + UNIQUE KEY `idx_player_slot` (`playerGuid`,`slot`), + KEY `idx_player` (`playerGuid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `character_void_storage` +-- + +LOCK TABLES `void_storage` WRITE; +/*!40000 ALTER TABLE `character_void_storage` DISABLE KEYS */; +/*!40000 ALTER TABLE `character_void_storage` ENABLE KEYS */; +UNLOCK TABLES; + -- -- Table structure for table `characters` -- @@ -2265,36 +2295,6 @@ LOCK TABLES `reserved_name` WRITE; /*!40000 ALTER TABLE `reserved_name` ENABLE KEYS */; UNLOCK TABLES; --- --- Table structure for table `void_storage` --- - -DROP TABLE IF EXISTS `void_storage`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `void_storage` ( - `itemId` bigint(20) unsigned NOT NULL, - `playerGuid` int(10) unsigned NOT NULL, - `itemEntry` mediumint(8) unsigned NOT NULL, - `slot` tinyint(3) unsigned NOT NULL, - `creatorGuid` int(10) unsigned NOT NULL DEFAULT '0', - `randomProperty` int(10) unsigned NOT NULL DEFAULT '0', - `suffixFactor` int(10) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`itemId`), - UNIQUE KEY `idx_player_slot` (`playerGuid`,`slot`), - KEY `idx_player` (`playerGuid`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `void_storage` --- - -LOCK TABLES `void_storage` WRITE; -/*!40000 ALTER TABLE `void_storage` DISABLE KEYS */; -/*!40000 ALTER TABLE `void_storage` ENABLE KEYS */; -UNLOCK TABLES; - -- -- Table structure for table `warden_action` -- diff --git a/sql/updates/characters/2012_07_10_00_characters_character_glyphs.sql b/sql/updates/characters/2012_07_10_00_characters_character_glyphs.sql deleted file mode 100644 index b8aba4d7798..00000000000 --- a/sql/updates/characters/2012_07_10_00_characters_character_glyphs.sql +++ /dev/null @@ -1,4 +0,0 @@ -ALTER TABLE `character_glyphs` - ADD `glyph7` smallint(5) unsigned DEFAULT '0' AFTER `glyph6`, - ADD `glyph8` smallint(5) unsigned DEFAULT '0' AFTER `glyph7`, - ADD `glyph9` smallint(5) unsigned DEFAULT '0' AFTER `glyph8`; diff --git a/sql/updates/characters/2012_07_10_00_characters_character_glyphs_434.sql b/sql/updates/characters/2012_07_10_00_characters_character_glyphs_434.sql new file mode 100644 index 00000000000..b8aba4d7798 --- /dev/null +++ b/sql/updates/characters/2012_07_10_00_characters_character_glyphs_434.sql @@ -0,0 +1,4 @@ +ALTER TABLE `character_glyphs` + ADD `glyph7` smallint(5) unsigned DEFAULT '0' AFTER `glyph6`, + ADD `glyph8` smallint(5) unsigned DEFAULT '0' AFTER `glyph7`, + ADD `glyph9` smallint(5) unsigned DEFAULT '0' AFTER `glyph8`; diff --git a/sql/updates/characters/2012_08_07_00_characters_characters.sql b/sql/updates/characters/2012_08_07_00_characters_characters.sql deleted file mode 100644 index e9bea82ad4b..00000000000 --- a/sql/updates/characters/2012_08_07_00_characters_characters.sql +++ /dev/null @@ -1,2 +0,0 @@ -UPDATE characters SET drunk = (drunk / 256) & 0xFF; -ALTER TABLE characters CHANGE drunk drunk tinyint(3) unsigned NOT NULL DEFAULT '0'; diff --git a/sql/updates/characters/2012_08_07_00_characters_characters_434.sql b/sql/updates/characters/2012_08_07_00_characters_characters_434.sql new file mode 100644 index 00000000000..e9bea82ad4b --- /dev/null +++ b/sql/updates/characters/2012_08_07_00_characters_characters_434.sql @@ -0,0 +1,2 @@ +UPDATE characters SET drunk = (drunk / 256) & 0xFF; +ALTER TABLE characters CHANGE drunk drunk tinyint(3) unsigned NOT NULL DEFAULT '0'; diff --git a/sql/updates/characters/2012_08_07_01_characters_void_storage_434.sql b/sql/updates/characters/2012_08_07_01_characters_void_storage_434.sql new file mode 100644 index 00000000000..8a68ba3740d --- /dev/null +++ b/sql/updates/characters/2012_08_07_01_characters_void_storage_434.sql @@ -0,0 +1 @@ +RENAME TABLE `void_storage` TO `character_void_storage`; diff --git a/sql/updates/world/2012_08_05_02_world_command.sql b/sql/updates/world/2012_08_05_02_world_command.sql deleted file mode 100644 index 69fd621c457..00000000000 --- a/sql/updates/world/2012_08_05_02_world_command.sql +++ /dev/null @@ -1,2 +0,0 @@ -DELETE FROM `command` WHERE `name` = 'reload locales_item_set_name'; -DELETE FROM `command` WHERE `name` = 'reload item_set_names'; diff --git a/sql/updates/world/2012_08_05_02_world_command_434.sql b/sql/updates/world/2012_08_05_02_world_command_434.sql new file mode 100644 index 00000000000..69fd621c457 --- /dev/null +++ b/sql/updates/world/2012_08_05_02_world_command_434.sql @@ -0,0 +1,2 @@ +DELETE FROM `command` WHERE `name` = 'reload locales_item_set_name'; +DELETE FROM `command` WHERE `name` = 'reload item_set_names'; diff --git a/sql/updates/world/2012_08_06_00_world_classlevelstats.sql b/sql/updates/world/2012_08_06_00_world_classlevelstats.sql deleted file mode 100644 index e6038374508..00000000000 --- a/sql/updates/world/2012_08_06_00_world_classlevelstats.sql +++ /dev/null @@ -1,7 +0,0 @@ -ALTER TABLE `creature_classlevelstats` ADD `basehp3` smallint(6) NOT NULL DEFAULT '1' AFTER `basehp2`; - -ALTER TABLE `creature_classlevelstats` CHANGE `basehp0` `basehp0` smallint(6) NOT NULL DEFAULT '1'; -ALTER TABLE `creature_classlevelstats` CHANGE `basehp1` `basehp1` smallint(6) NOT NULL DEFAULT '1'; -ALTER TABLE `creature_classlevelstats` CHANGE `basehp2` `basehp2` smallint(6) NOT NULL DEFAULT '1'; -ALTER TABLE `creature_classlevelstats` CHANGE `basemana` `basemana` smallint(6) NOT NULL DEFAULT '1'; -ALTER TABLE `creature_classlevelstats` CHANGE `basearmor` `basearmor` smallint(6) NOT NULL DEFAULT '1'; diff --git a/sql/updates/world/2012_08_06_00_world_classlevelstats_434.sql b/sql/updates/world/2012_08_06_00_world_classlevelstats_434.sql new file mode 100644 index 00000000000..e6038374508 --- /dev/null +++ b/sql/updates/world/2012_08_06_00_world_classlevelstats_434.sql @@ -0,0 +1,7 @@ +ALTER TABLE `creature_classlevelstats` ADD `basehp3` smallint(6) NOT NULL DEFAULT '1' AFTER `basehp2`; + +ALTER TABLE `creature_classlevelstats` CHANGE `basehp0` `basehp0` smallint(6) NOT NULL DEFAULT '1'; +ALTER TABLE `creature_classlevelstats` CHANGE `basehp1` `basehp1` smallint(6) NOT NULL DEFAULT '1'; +ALTER TABLE `creature_classlevelstats` CHANGE `basehp2` `basehp2` smallint(6) NOT NULL DEFAULT '1'; +ALTER TABLE `creature_classlevelstats` CHANGE `basemana` `basemana` smallint(6) NOT NULL DEFAULT '1'; +ALTER TABLE `creature_classlevelstats` CHANGE `basearmor` `basearmor` smallint(6) NOT NULL DEFAULT '1'; diff --git a/sql/updates/world/2012_08_06_00_world_command.sql b/sql/updates/world/2012_08_06_00_world_command.sql deleted file mode 100644 index 50628aaa589..00000000000 --- a/sql/updates/world/2012_08_06_00_world_command.sql +++ /dev/null @@ -1,4 +0,0 @@ -DELETE FROM `command` WHERE `name` IN ('server togglequerylog', 'server set loglevel'); - -INSERT INTO `command` (`name`,`security`,`help`) VALUES -('server set loglevel',4,'Syntax: .server set loglevel $facility $name $loglevel. $facility can take the values: appender (a) or logger (l). $loglevel can take the values: disabled (0), trace (1), debug (2), info (3), warn (4), error (5) or fatal (6)'); diff --git a/sql/updates/world/2012_08_06_00_world_command_434.sql b/sql/updates/world/2012_08_06_00_world_command_434.sql new file mode 100644 index 00000000000..50628aaa589 --- /dev/null +++ b/sql/updates/world/2012_08_06_00_world_command_434.sql @@ -0,0 +1,4 @@ +DELETE FROM `command` WHERE `name` IN ('server togglequerylog', 'server set loglevel'); + +INSERT INTO `command` (`name`,`security`,`help`) VALUES +('server set loglevel',4,'Syntax: .server set loglevel $facility $name $loglevel. $facility can take the values: appender (a) or logger (l). $loglevel can take the values: disabled (0), trace (1), debug (2), info (3), warn (4), error (5) or fatal (6)'); diff --git a/sql/updates/world/2012_08_06_01_world_classlevelstats.sql b/sql/updates/world/2012_08_06_01_world_classlevelstats.sql deleted file mode 100644 index 6fe7ad67994..00000000000 --- a/sql/updates/world/2012_08_06_01_world_classlevelstats.sql +++ /dev/null @@ -1,6 +0,0 @@ -ALTER TABLE `creature_classlevelstats` CHANGE `basehp0` `basehp0` mediumint(8) unsigned NOT NULL DEFAULT '1'; -ALTER TABLE `creature_classlevelstats` CHANGE `basehp1` `basehp1` mediumint(8) unsigned NOT NULL DEFAULT '1'; -ALTER TABLE `creature_classlevelstats` CHANGE `basehp2` `basehp2` mediumint(8) unsigned NOT NULL DEFAULT '1'; -ALTER TABLE `creature_classlevelstats` CHANGE `basehp3` `basehp3` mediumint(8) unsigned NOT NULL DEFAULT '1'; -ALTER TABLE `creature_classlevelstats` CHANGE `basemana` `basemana` mediumint(8) unsigned NOT NULL DEFAULT '1'; -ALTER TABLE `creature_classlevelstats` CHANGE `basearmor` `basearmor` mediumint(8) unsigned NOT NULL DEFAULT '1'; diff --git a/sql/updates/world/2012_08_06_01_world_classlevelstats_434.sql b/sql/updates/world/2012_08_06_01_world_classlevelstats_434.sql new file mode 100644 index 00000000000..6fe7ad67994 --- /dev/null +++ b/sql/updates/world/2012_08_06_01_world_classlevelstats_434.sql @@ -0,0 +1,6 @@ +ALTER TABLE `creature_classlevelstats` CHANGE `basehp0` `basehp0` mediumint(8) unsigned NOT NULL DEFAULT '1'; +ALTER TABLE `creature_classlevelstats` CHANGE `basehp1` `basehp1` mediumint(8) unsigned NOT NULL DEFAULT '1'; +ALTER TABLE `creature_classlevelstats` CHANGE `basehp2` `basehp2` mediumint(8) unsigned NOT NULL DEFAULT '1'; +ALTER TABLE `creature_classlevelstats` CHANGE `basehp3` `basehp3` mediumint(8) unsigned NOT NULL DEFAULT '1'; +ALTER TABLE `creature_classlevelstats` CHANGE `basemana` `basemana` mediumint(8) unsigned NOT NULL DEFAULT '1'; +ALTER TABLE `creature_classlevelstats` CHANGE `basearmor` `basearmor` mediumint(8) unsigned NOT NULL DEFAULT '1'; diff --git a/sql/updates/world/2012_08_08_00_world_creature_template.sql b/sql/updates/world/2012_08_08_00_world_creature_template.sql deleted file mode 100644 index 1e934b9f612..00000000000 --- a/sql/updates/world/2012_08_08_00_world_creature_template.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE `creature_template` ADD `Mana_mod_extra` float NOT NULL DEFAULT '1' AFTER `Mana_mod`; diff --git a/sql/updates/world/2012_08_08_00_world_creature_template_434.sql b/sql/updates/world/2012_08_08_00_world_creature_template_434.sql new file mode 100644 index 00000000000..1e934b9f612 --- /dev/null +++ b/sql/updates/world/2012_08_08_00_world_creature_template_434.sql @@ -0,0 +1 @@ +ALTER TABLE `creature_template` ADD `Mana_mod_extra` float NOT NULL DEFAULT '1' AFTER `Mana_mod`; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index a337caadd73..bdfb997a1af 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -13136,7 +13136,7 @@ void Player::SendBuyError(BuyResult msg, Creature* creature, uint32 item, uint32 void Player::SendSellError(SellResult msg, Creature* creature, uint64 guid) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_SELL_ITEM"); - WorldPacket data(SMSG_SELL_ITEM, (8+8+(param?4:0)+1)); // last check 4.3.4 + WorldPacket data(SMSG_SELL_ITEM, (8+8+1)); // last check 4.3.4 data << uint64(creature ? creature->GetGUID() : 0); data << uint64(guid); data << uint8(msg); @@ -17010,7 +17010,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) // set value, including drunk invisibility detection // calculate sobering. after 15 minutes logged out, the player will be sober again uint8 newDrunkValue = 0; - if (time_diff < GetDrunkValue() * 9) + if (time_diff < uint32(GetDrunkValue()) * 9) newDrunkValue = GetDrunkValue() - time_diff / 9; SetDrunkValue(newDrunkValue); @@ -17606,7 +17606,7 @@ void Player::_LoadVoidStorage(PreparedQueryResult result) do { - // SELECT itemid, itemEntry, slot, creatorGuid FROM void_storage WHERE playerGuid = ? + // SELECT itemid, itemEntry, slot, creatorGuid FROM character_void_storage WHERE playerGuid = ? Field* fields = result->Fetch(); uint64 itemId = fields[0].GetUInt64(); diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 7a5418e8645..50a2de70d33 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -44,6 +44,7 @@ #include struct Mail; +struct ItemExtendedCostEntry; class Channel; class Creature; class DynamicObject; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index c1fe89fa86b..1843a68f095 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -6126,7 +6126,7 @@ void ObjectMgr::SetHighestGuids() if (result) sGroupMgr->SetGroupDbStoreSize((*result)[0].GetUInt32()+1); - result = CharacterDatabase.Query("SELECT MAX(itemId) from void_storage"); + result = CharacterDatabase.Query("SELECT MAX(itemId) from character_void_storage"); if (result) _voidItemId = (*result)[0].GetUInt64()+1; } diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index c7b766cacd0..67b4d780942 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -236,7 +236,7 @@ public: return false; SellResult msg = SellResult(atoi(args)); - handler->GetSession()->GetPlayer()->SendSellError(msg, 0, 0, 0); + handler->GetSession()->GetPlayer()->SendSellError(msg, 0, 0); return true; } diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index 222e212a08f..6c58ee28838 100755 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -556,7 +556,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_DEL_CHAR_ACTION_EXCEPT_SPEC, "DELETE FROM character_action WHERE spec<>? AND guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_SEL_CHAR_PET_BY_ENTRY_AND_SLOT, "SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, abdata, savetime, CreatedBySpell, PetType FROM character_pet WHERE owner = ? AND slot = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_SEL_VOID_STORAGE, "SELECT itemId, itemEntry, slot, creatorGuid, randomProperty, suffixFactor FROM void_storage WHERE playerGuid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_REP_VOID_STORAGE_ITEM, "REPLACE INTO void_storage (itemId, playerGuid, itemEntry, slot, creatorGuid, randomProperty, suffixFactor) VALUES (?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_VOID_STORAGE_ITEM_BY_SLOT, "DELETE FROM void_storage WHERE slot = ? AND playerGuid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_SEL_VOID_STORAGE, "SELECT itemId, itemEntry, slot, creatorGuid, randomProperty, suffixFactor FROM character_void_storage WHERE playerGuid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_REP_VOID_STORAGE_ITEM, "REPLACE INTO character_void_storage (itemId, playerGuid, itemEntry, slot, creatorGuid, randomProperty, suffixFactor) VALUES (?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_DEL_VOID_STORAGE_ITEM_BY_SLOT, "DELETE FROM character_void_storage WHERE slot = ? AND playerGuid = ?", CONNECTION_ASYNC); } -- cgit v1.2.3 From dc0b904bb47b1320473618e47a93ca5ae987ae39 Mon Sep 17 00:00:00 2001 From: horn Date: Wed, 8 Aug 2012 13:49:25 +0200 Subject: Finished Opcodes.cpp cleanup (moved some missed handlers that are not in WPP) and removed CMSG_GROUP_ACCEPT and CMSG_GROUP_DECLINE from opcode list --- src/server/game/Server/Protocol/Opcodes.cpp | 281 ++++++++++++++-------------- src/server/game/Server/Protocol/Opcodes.h | 2 - 2 files changed, 140 insertions(+), 143 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index fdd5c952ad9..b9de8cc5765 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -75,16 +75,13 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_SELL_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionSellItem ); DEFINE_OPCODE_HANDLER(CMSG_AUTH_SESSION, STATUS_NEVER, PROCESS_THREADUNSAFE, &WorldSession::Handle_EarlyProccess ); //DEFINE_OPCODE_HANDLER(CMSG_AUTOBANK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoBankItemOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_AUTOEQUIP_GROUND_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_AUTOEQUIP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoEquipItemOpcode ); DEFINE_OPCODE_HANDLER(CMSG_AUTOEQUIP_ITEM_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoEquipItemSlotOpcode ); DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_BAG_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoStoreBagItemOpcode ); DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_BANK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoStoreBankItemOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_GROUND_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_LOOT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutostoreLootItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_AUTO_DECLINE_GUILD_INVITES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_BANKER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBankerActivateOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_JOIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_LEAVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlefieldListOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_ENTRY_INVITE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -92,7 +89,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_QUEUE_INVITE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_QUEUE_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_PORT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattleFieldPortOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_REQUEST_SCORE_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); Need to send the response DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_STATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlefieldStatusOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEGROUND_PLAYER_POSITIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_JOIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlemasterJoinOpcode ); @@ -100,7 +96,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_JOIN_RATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_BEGIN_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBeginTradeOpcode ); DEFINE_OPCODE_HANDLER(CMSG_BINDER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBinderActivateOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_BOT_DETECTED2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_BUG, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBugOpcode ); DEFINE_OPCODE_HANDLER(CMSG_BUSY_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBusyTradeOpcode ); DEFINE_OPCODE_HANDLER(CMSG_BUYBACK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuybackItem ); @@ -109,7 +104,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_ADD_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarAddEvent ); //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_ARENA_TEAM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarArenaTeam ); //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_COMPLAIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarComplain ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_CONTEXT_EVENT_SIGNUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_COPY_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarCopyEvent ); //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventInvite ); //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_MODERATOR_STATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventModeratorStatus); @@ -127,7 +121,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_AUTO_REPEAT_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelAutoRepeatSpellOpcode); DEFINE_OPCODE_HANDLER(CMSG_CANCEL_CAST, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleCancelCastOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_CHANNELLING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelChanneling ); - //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_GROWTH_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelGrowthAuraOpcode ); DEFINE_OPCODE_HANDLER(CMSG_CANCEL_MOUNT_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelMountAuraOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_QUEUED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_TEMP_ENCHANTMENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelTempEnchantmentOpcode); @@ -186,13 +179,11 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_CORPSE_MAP_POSITION_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCorpseMapPositionQuery ); DEFINE_OPCODE_HANDLER(CMSG_CREATURE_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleCreatureQueryOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_DANCE_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_DECLINE_CHANNEL_INVITE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleChannelDeclineInvite ); //DEFINE_OPCODE_HANDLER(CMSG_DELETEEQUIPMENT_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_DEL_FRIEND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDelFriendOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_DEL_IGNORE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDelIgnoreOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_DEL_VOICE_IGNORE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_DESTROY_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDestroyItemOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_DESTROY_ITEMS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_DISMISS_CONTROLLED_VEHICLE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDismissControlledVehicle ); //DEFINE_OPCODE_HANDLER(CMSG_DISMISS_CRITTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDismissCritter ); DEFINE_OPCODE_HANDLER(CMSG_DUEL_ACCEPTED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDuelAcceptedOpcode ); @@ -202,7 +193,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEmoteOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_ENABLETAXI, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleTaxiQueryAvailableNodes ); DEFINE_OPCODE_HANDLER(CMSG_ENABLE_NAGLE, STATUS_NEVER , PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); - //DEFINE_OPCODE_HANDLER(CMSG_EQUIPMENT_SET_DELETE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetDelete ); //DEFINE_OPCODE_HANDLER(CMSG_EQUIPMENT_SET_SAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetSave ); //DEFINE_OPCODE_HANDLER(CMSG_EQUIPMENT_SET_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetUse ); //DEFINE_OPCODE_HANDLER(CMSG_FAR_SIGHT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleFarSightOpcode ); @@ -211,12 +201,8 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJECT_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleGameObjectQueryOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJ_REPORT_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGameobjectReportUse ); DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJ_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGameObjectUseOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GAMESPEED_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GAMETIME_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GETDEATHBINDZONE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GET_MAIL_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGetMailList ); DEFINE_OPCODE_HANDLER(CMSG_GET_MIRRORIMAGE_DATA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMirrorImageDataRequest ); - //DEFINE_OPCODE_HANDLER(CMSG_GHOST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GMRESPONSE_RESOLVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMResponseResolve ); //DEFINE_OPCODE_HANDLER(CMSG_GMSURVEY_SUBMIT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMSurveySubmit ); //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_CREATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketCreateOpcode ); @@ -224,26 +210,20 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_GETTICKET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketGetTicketOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_SYSTEMSTATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketSystemStatusOpcode); //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_UPDATETEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketUpdateOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_INVIS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_NUKE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GM_REPORT_LAG, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReportLag ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_SET_SECURITY_GROUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GOSSIP_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGossipHelloOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GOSSIP_SELECT_OPTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGossipSelectOptionOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GRANT_LEVEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGrantLevel ); - DEFINE_OPCODE_HANDLER(CMSG_GROUP_INVITE_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupInviteResponseOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_ASSISTANT_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupAssistantLeaderOpcode); - //DEFINE_OPCODE_HANDLER(CMSG_GROUP_CANCEL, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_CHANGE_SUB_GROUP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupChangeSubGroupOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_DISBAND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupDisbandOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GROUP_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupInviteOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GROUP_INVITE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_GROUP_INVITE_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupInviteResponseOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_RAID_CONVERT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupRaidConvertOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_REQUEST_JOIN_UPDATES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_SET_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupSetLeaderOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_SET_ROLES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_SWAP_SUB_GROUP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupSwapSubGroupOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GROUP_UNINVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupUninviteOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_UNINVITE_GUID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupUninviteGuidOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildAcceptOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_ACHIEVEMENT_MEMBERS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -254,8 +234,6 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_BUY_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankBuyTab ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_DEPOSIT_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankDepositMoney ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_LOG_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_MONEY_WITHDRAWN_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankMoneyWithdrawn ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_NOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_QUERY_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankQueryTab ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_QUERY_TEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_REM_MONEY_WITHDRAW_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -264,16 +242,13 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_UPDATE_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankUpdateTab ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_WITHDRAW_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankWithdrawMoney ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_CHANGE_NAME_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_CREATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildCreateOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDeclineOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_DEL_RANK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDelRankOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_DEMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDemoteOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_DISBAND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDisbandOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_EVENT_LOG_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildInfoOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_INFO_TEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildChangeInfoTextOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildInviteOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildLeaderOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildLeaveOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_MEMBER_SEND_SOR_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_MOTD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildMOTDOpcode ); @@ -306,15 +281,12 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_LEARN_PREVIEW_TALENTS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnPreviewTalents ); DEFINE_OPCODE_HANDLER(CMSG_LEARN_PREVIEW_TALENTS_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnPreviewTalentsPet ); DEFINE_OPCODE_HANDLER(CMSG_LEARN_TALENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnTalentOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_LEAVE_BATTLEFIELD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLeaveBattlefieldOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LEAVE_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLeaveChannel ); - //DEFINE_OPCODE_HANDLER(CMSG_LFG_GET_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_LFG_GET_STATUS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_LFG_JOIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgJoinOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LFG_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgLeaveOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LFG_LFR_JOIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_LFG_LFR_LEAVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LFG_PARTY_LOCK_INFO_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_LFG_PROPOSAL_RESULT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgProposalResultOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_BOOT_VOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetBootVoteOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_COMMENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -325,7 +297,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_DECLINE_RECRUIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_GET_APPLICATIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_GET_RECRUITS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_JOIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_POST_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_REMOVE_RECRUIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_SET_GUILD_POST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -347,7 +318,6 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_MAIL_RETURN_TO_SENDER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailReturnToSender ); DEFINE_OPCODE_HANDLER(CMSG_MAIL_TAKE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailTakeItem ); DEFINE_OPCODE_HANDLER(CMSG_MAIL_TAKE_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailTakeMoney ); - //DEFINE_OPCODE_HANDLER(CMSG_MEETINGSTONE_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_BATTLEGROUND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_GUILD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_OFFICER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); @@ -369,9 +339,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_YELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_MINIGAME_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_MOUNTSPECIAL_ANIM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMountSpecialAnimOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_CHARM_TELEPORT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_MOVE_CHNG_TRANSPORT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_ENABLE_SWIM_TO_FLY_TRANS_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FALL_RESET, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FEATHER_FALL_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleFeatherFallAck ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); @@ -392,14 +360,10 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_CAN_FLY_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveSetCanFlyAckOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_COLLISION_HEIGHT_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_RELATIVE_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_VEHICLE_REC_ID_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SPLINE_DONE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveSplineDoneOpcode ); DEFINE_OPCODE_HANDLER(CMSG_MOVE_TIME_SKIPPED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleMoveTimeSkippedOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_TOGGLE_COLLISION_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_WATER_WALK_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveWaterWalkAck ); DEFINE_OPCODE_HANDLER(CMSG_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNameQueryOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_NEW_SPELL_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_NEXT_CINEMATIC_CAMERA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNextCinematicCamera ); DEFINE_OPCODE_HANDLER(CMSG_NPC_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNpcTextQueryOpcode ); DEFINE_OPCODE_HANDLER(CMSG_OBJECT_UPDATE_FAILED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleObjectUpdateFailedOpcode ); @@ -421,7 +385,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_PET_CANCEL_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetCancelAuraOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_PET_CAST_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetCastSpellOpcode ); DEFINE_OPCODE_HANDLER(CMSG_PET_LEARN_TALENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetLearnTalent ); - //DEFINE_OPCODE_HANDLER(CMSG_PET_NAME_CACHE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_PET_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetNameQuery ); //DEFINE_OPCODE_HANDLER(CMSG_PET_RENAME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetRename ); //DEFINE_OPCODE_HANDLER(CMSG_PET_SET_ACTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetSetAction ); @@ -429,16 +392,13 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_PET_STOP_ATTACK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetStopAttack ); DEFINE_OPCODE_HANDLER(CMSG_PING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); DEFINE_OPCODE_HANDLER(CMSG_PLAYED_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayedTime ); - //DEFINE_OPCODE_HANDLER(CMSG_PLAYER_DIFFICULTY_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_PLAYER_LOGIN, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayerLoginOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_PLAYER_LOGOUT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayerLogoutOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_PLAYER_VEHICLE_ENTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEnterPlayerVehicle ); //DEFINE_OPCODE_HANDLER(CMSG_PLAY_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_PUSHQUESTTOPARTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePushQuestToParty ); //DEFINE_OPCODE_HANDLER(CMSG_PVP_LOG_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_QUERY_BATTLEFIELD_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_QUERY_COMPLETION_NPC_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_MAX_XP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_MEMBERS_FOR_RECIPE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_MEMBER_RECIPES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_RECIPES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -448,19 +408,15 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_QUERY_QUESTS_COMPLETED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryQuestsCompleted ); DEFINE_OPCODE_HANDLER(CMSG_QUERY_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryTimeOpcode ); DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_ACCEPT_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverAcceptQuestOpcode); - //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_CANCEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverCancel ); DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_CHOOSE_REWARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverChooseRewardOpcode); DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_COMPLETE_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverCompleteQuest ); DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverHelloOpcode ); DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_QUERY_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverQueryQuestOpcode); - //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_QUEST_AUTOLAUNCH, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverQuestAutoLaunch ); DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_REQUEST_REWARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverRequestRewardOpcode); DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverStatusMultipleQuery); DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_STATUS_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleQuestgiverStatusQueryOpcode); DEFINE_OPCODE_HANDLER(CMSG_QUESTLOG_REMOVE_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestLogRemoveQuest ); - //DEFINE_OPCODE_HANDLER(CMSG_QUESTLOG_SWAP_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestLogSwapQuest ); DEFINE_OPCODE_HANDLER(CMSG_QUEST_CONFIRM_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestConfirmAccept ); - //DEFINE_OPCODE_HANDLER(CMSG_QUEST_NPC_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_QUEST_POI_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestPOIQuery ); //DEFINE_OPCODE_HANDLER(CMSG_QUEST_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestQueryOpcode ); DEFINE_OPCODE_HANDLER(CMSG_RANDOMIZE_CHAR_NAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRandomizeCharNameOpcode ); @@ -472,7 +428,6 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_REFORGE_ITEM, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleReforgeItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_REORDER_CHARACTERS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_REPAIR_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepairItemOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_REPLACE_ACCOUNT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_REPOP_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepopRequestOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_REPORT_PVP_AFK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReportPvPAFK ); DEFINE_OPCODE_HANDLER(CMSG_REQUEST_ACCOUNT_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestAccountData ); @@ -500,16 +455,11 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_RETURN_TO_GRAVEYARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReturnToGraveyard ); //DEFINE_OPCODE_HANDLER(CMSG_ROLE_POLL_BEGIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SAVE_CUF_PROFILES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SAVE_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SEARCH_LFG_JOIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfrSearchOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_SEARCH_LFG_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfrLeaveOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SELF_RES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSelfResOpcode ); DEFINE_OPCODE_HANDLER(CMSG_SELL_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSellItemOpcode ); DEFINE_OPCODE_HANDLER(CMSG_SEND_MAIL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSendMail ); //DEFINE_OPCODE_HANDLER(CMSG_SEND_SOR_REQUEST_VIA_ADDRESS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SEND_SOR_REQUEST_VIA_BNET_ACCOUNT_ID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SERVERTIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SETDEATHBINDPOINT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_SETSHEATHED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleSetSheathedOpcode ); DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIONBAR_TOGGLES, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActionBarToggles ); DEFINE_OPCODE_HANDLER(CMSG_SET_ACTION_BUTTON, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActionButtonOpcode ); @@ -522,10 +472,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_SET_CURRENCY_FLAGS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_EVERYONE_IS_ASSISTANT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_FACTION_ATWAR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetFactionAtWar ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_FACTION_CHEAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetFactionCheat ); //DEFINE_OPCODE_HANDLER(CMSG_SET_FACTION_INACTIVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetFactionInactiveOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_GUILD_BANK_TEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetGuildBankTabText ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_LFG_COMMENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetCommentOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SET_PET_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_PLAYER_DECLINED_NAMES, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetPlayerDeclinedNames ); //DEFINE_OPCODE_HANDLER(CMSG_SET_PREFERED_CEMETERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -533,7 +480,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_SET_RELATIVE_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_SAVED_INSTANCE_EXTEND, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_SET_SELECTION, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleSetSelectionOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_SKILL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_SET_TAXI_BENCHMARK_MODE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTaxiBenchmarkOpcode ); DEFINE_OPCODE_HANDLER(CMSG_SET_TITLE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTitleOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SET_TRADE_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -548,9 +494,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_SPIRIT_HEALER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSpiritHealerActivateOpcode); //DEFINE_OPCODE_HANDLER(CMSG_SPLIT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSplitItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_STANDSTATECHANGE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStandStateChangeOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_START_QUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_STOP_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_STORE_LOOT_IN_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SUBMIT_BUG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SUBMIT_COMPLAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SUGGESTION_SUBMIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -559,11 +503,8 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_SWAP_INV_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSwapInvItemOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SWAP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSwapItem ); //DEFINE_OPCODE_HANDLER(CMSG_SYNC_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_TAXICLEARALLNODES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_TAXIENABLEALLNODES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_TAXINODE_STATUS_QUERY, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleTaxiNodeStatusQueryOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_TAXIQUERYAVAILABLENODES, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleTaxiQueryAvailableNodes ); - //DEFINE_OPCODE_HANDLER(CMSG_TAXISHOWNODES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_TELEPORT_TO_UNIT, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_TEXT_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTextEmoteOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_TIME_ADJUSTMENT_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -574,7 +515,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_TRAINER_BUY_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerBuySpellOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_TRAINER_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerListOpcode ); DEFINE_OPCODE_HANDLER(CMSG_TRANSMOGRIFY_ITEMS, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleTransmogrifyItems ); - //DEFINE_OPCODE_HANDLER(CMSG_TRIGGER_CINEMATIC_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_TURN_IN_PETITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTurnInPetitionOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_CLEAR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialClear ); DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_FLAG, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialFlag ); @@ -604,39 +544,20 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_WRAP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWrapItemOpcode ); DEFINE_OPCODE_HANDLER(CMSG_ZONEUPDATE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleZoneUpdateOpcode ); DEFINE_OPCODE_HANDLER(MSG_AUCTION_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionHelloOpcode ); - //DEFINE_OPCODE_HANDLER(MSG_BATTLEGROUND_PLAYER_POSITIONS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlegroundPlayerPositionsOpcode); DEFINE_OPCODE_HANDLER(MSG_CHANNEL_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_CHANNEL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_CORPSE_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCorpseQueryOpcode ); - //DEFINE_OPCODE_HANDLER(MSG_GM_BIND_OTHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_GM_SHOWLABEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_GM_SUMMON, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_GUILD_BANK_LOG_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankLogQuery ); - //DEFINE_OPCODE_HANDLER(MSG_GUILD_EVENT_LOG_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildEventLogQueryOpcode ); //DEFINE_OPCODE_HANDLER(MSG_INSPECT_ARENA_TEAMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectArenaTeamsOpcode ); //DEFINE_OPCODE_HANDLER(MSG_LIST_STABLED_PETS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleListStabledPetsOpcode ); //DEFINE_OPCODE_HANDLER(MSG_MINIMAP_PING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMinimapPingOpcode ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_CHARM_TELEPORT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_MOVE_FALL_LAND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_FEATHER_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_GRAVITY_CHNG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_MOVE_HEARTBEAT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_MOVE_JUMP, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_ALL_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_COLLISION_HEIGHT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_FACING, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_FLIGHT_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_PITCH, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RAW_POSITION_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_BACK_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_SWIM_BACK_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_SWIM_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_TURN_RATE_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_WALK_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_WALK_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_MOVE_START_ASCEND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); DEFINE_OPCODE_HANDLER(MSG_MOVE_START_BACKWARD, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); DEFINE_OPCODE_HANDLER(MSG_MOVE_START_DESCEND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); @@ -659,22 +580,15 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(MSG_MOVE_TELEPORT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_TIME_SKIPPED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_TOGGLE_COLLISION_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_TOGGLE_FALL_LOGGING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_TOGGLE_LOGGING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_UNROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_MOUSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_TELEPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_MOVE_WORLDPORT_ACK, STATUS_TRANSFER, PROCESS_THREADUNSAFE, &WorldSession::HandleMoveWorldportAckOpcode ); //DEFINE_OPCODE_HANDLER(MSG_NOTIFY_PARTY_SQUELCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_PARTY_ASSIGNMENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePartyAssignmentOpcode ); DEFINE_OPCODE_HANDLER(MSG_PETITION_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionDeclineOpcode ); DEFINE_OPCODE_HANDLER(MSG_PETITION_RENAME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionRenameOpcode ); - //DEFINE_OPCODE_HANDLER(MSG_PVP_LOG_DATA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePVPLogDataOpcode ); - //DEFINE_OPCODE_HANDLER(MSG_QUERY_GUILD_BANK_TEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryGuildBankTabText ); DEFINE_OPCODE_HANDLER(MSG_QUERY_NEXT_MAIL_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryNextMailTime ); DEFINE_OPCODE_HANDLER(MSG_QUEST_PUSH_RESULT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestPushResult ); DEFINE_OPCODE_HANDLER(MSG_RAID_READY_CHECK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidReadyCheckOpcode ); @@ -685,7 +599,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(MSG_SAVE_GUILD_EMBLEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSaveGuildEmblemOpcode ); DEFINE_OPCODE_HANDLER(MSG_SET_DUNGEON_DIFFICULTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetDungeonDifficultyOpcode); DEFINE_OPCODE_HANDLER(MSG_SET_RAID_DIFFICULTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetRaidDifficultyOpcode ); - //DEFINE_OPCODE_HANDLER(MSG_START_MOVE_FORWARD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_TABARDVENDOR_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTabardVendorActivateOpcode); DEFINE_OPCODE_HANDLER(MSG_TALENT_WIPE_CONFIRM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTalentWipeConfirmOpcode ); DEFINE_OPCODE_HANDLER(MSG_VERIFY_CONNECTIVITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); @@ -727,7 +640,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_OWNER_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_OWNER_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_REMOVED_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_AURACASTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_AURA_POINTS_DEPLETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_AURA_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_AURA_UPDATE_ALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -749,7 +661,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_PORT_DENIED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_RATED_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS1, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS3, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS4, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -757,15 +668,11 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_INFO_THROTTLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_PLAYER_JOINED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_PLAYER_LEFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_PLAYER_POSITIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_BINDER_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_BINDPOINTUPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BINDZONEREPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_BREAK_TARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BUY_BANK_SLOT_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_BUY_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_BUY_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_ACTION_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_ARENA_TEAM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_CLEAR_PENDING_ACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -787,7 +694,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_SEND_CALENDAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_SEND_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_SEND_NUM_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_UPDATE_INVITE_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CAMERA_SHAKE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CANCEL_AUTO_REPEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CANCEL_COMBAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -810,16 +716,13 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_CHAT_SERVER_DISCONNECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHAT_SERVER_RECONNECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHAT_WRONG_FACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHECK_FOR_BOTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_BOSS_EMOTES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_COOLDOWNS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_FAR_SIGHT_IMMEDIATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_TARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CLIENTCACHE_VERSION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CLIENT_CONTROL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_COMBAT_EVENT_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMBAT_LOG_MULTIPLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_MAP_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_PARTY_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -827,13 +730,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_SKIRMISH_QUEUE_RESULT2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_STATE_CHANGED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMPLAIN_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMPLETION_NPC_RESPONCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMPLETION_NPC_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_ACHIEVEMENT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_CHAR_ENUM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_GUILD_ROSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_MOVES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_UPDATE_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMSAT_CONNECT_FAIL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMSAT_DISCONNECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMSAT_RECONNECT_TRY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -852,7 +750,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_CURRENCY_LOOT_RESTORED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CUSTOM_LOAD_SCREEN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DAMAGE_CALC_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DAMAGE_DONE_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DANCE_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_DB_REPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DEATH_RELEASE_LOC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -893,9 +790,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_FISH_NOT_HOOKED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_FLIGHT_SPLINE_SYNC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_FLOOD_DETECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_FORCEACTIONSHOW, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_FORCED_DEATH_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_FORCE_DISPLAY_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_FORCE_SEND_QUEUED_PACKETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_FORCE_SET_VEHICLE_REC_ID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_FORGE_MASTER_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -941,10 +836,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_GUILD_ACHIEVEMENT_MEMBERS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_LOG_QUERY_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_MONEY_WITHDRAWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_QUERY_TEXT_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_REM_MONEY_WITHDRAW_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_CANCEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_CHALLENGE_COMPLETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_CHALLENGE_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_CHANGE_NAME_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -956,10 +849,8 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_GUILD_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_EVENT_LOG_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_FLAGGED_FOR_RENAME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_INVITE_CANCEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_KNOWN_RECIPES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_MAX_DAILY_XP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_MEMBERS_FOR_RECIPE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_MEMBER_DAILY_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -981,12 +872,9 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_GUILD_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_REWARDS_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_ROSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_SET_NOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_TRADESKILL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_UPDATE_ROSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_XP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_XP_GAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_XP_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_HEALTH_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_HIGHEST_THREAT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_HOTFIX_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -995,12 +883,10 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_INITIAL_SPELLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_INIT_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_INIT_WORLD_STATES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_INSPECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_INSPECT_HONOR_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_INSPECT_RATED_BG_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_INSPECT_RESULTS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_INSPECT_TALENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_DIFFICULTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_LOCK_WARNING_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_RESET_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1020,8 +906,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_ITEM_SEND_PASSIVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ITEM_TEXT_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ITEM_TIME_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_JOINED_BATTLEGROUND_QUEUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_KICK_REASON, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LEARNED_DANCE_MOVES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LEARNED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LEVELUP_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1029,7 +913,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_LFG_DISABLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_JOIN_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_OFFER_CONTINUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_OPEN_FROM_GOSSIP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_PARTY_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_PLAYER_REWARD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1039,9 +922,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_LFG_ROLE_CHOSEN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_SLOT_INVALID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_TELEPORT_DENIED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_PARTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_SEARCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_STATUS_NONE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1052,7 +932,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_MEMBERSHIP_LIST_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_POST_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_RECRUIT_LIST_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_SEARCH_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LIST_INVENTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOAD_CUF_PROFILES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LOGIN_SETTIMESPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1079,8 +958,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_MAP_OBJ_EVENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_IN_PROGRESS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_MEMBER_ADDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_SETQUEUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MESSAGECHAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MESSAGE_BOX, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MINIGAME_SETUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1096,10 +973,6 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_MOUNTSPECIAL_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_COLLISION_DISABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_COLLISION_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_DISABLE_COLLISION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_DISABLE_GRAVITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_ENABLE_COLLISION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_ENABLE_GRAVITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_FEATHER_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_GRAVITY_DISABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_GRAVITY_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1121,14 +994,11 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_SWIM_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_SWIM_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_VEHICLE_REC_ID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_WALK_IN_AIR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_WALK_IN_AIR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_COLLISION_HEIGHT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_KNOCK_BACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1136,7 +1006,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_RUN_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_SWIM_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_SWIM_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_TELEPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1149,7 +1018,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_NOTIFY_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_NOTIFY_DEST_LOC_SPELL_CAST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_NPC_TEXT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_NPC_WONT_TALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_OFFER_PETITION_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_OPEN_CONTAINER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1191,13 +1059,11 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_PLAYER_DIFFICULTY_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAYER_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAYER_SKINNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PLAYER_UNK_DEAD_ALIVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAYER_VEHICLE_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAY_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAY_MUSIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAY_OBJECT_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAY_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PLAY_SPELL_IMPACT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAY_SPELL_VISUAL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PLAY_SPELL_VISUAL_KIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PLAY_TIME_WARNING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1206,7 +1072,6 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_PRE_RESURRECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PROCRESIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PROPOSE_LEVEL_GRANT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PUREMOUNT_CANCELLED_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PVP_CREDIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PVP_LOG_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PVP_OPTIONS_ENABLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1222,7 +1087,6 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_STATUS_MULTIPLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_QUESTLOG_FULL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_ADD_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_ADD_KILL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_ADD_PVP_KILL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1258,7 +1122,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_RESEARCH_SETUP_HISTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_RESET_COMPRESSION_CONTEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_RESET_FAILED_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RESISTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_RESPOND_INSPECT_ACHIEVEMENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_RESURRECT_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_RESYNC_RUNES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1272,7 +1135,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_SERVER_INFO_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SERVER_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SERVER_PERF, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SETUP_RESEARCH_HISTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SET_DF_FAST_LAUNCH_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SET_FACTION_ATWAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SET_FACTION_STANDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1331,7 +1193,6 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_WALK_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_START_SWIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_STOP_SWIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_UNROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1368,7 +1229,6 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_TRADE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TRADE_STATUS_EXTENDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_SUCCEEDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TRAINER_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TRANSFER_ABORTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1433,16 +1293,23 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_AUTH_SRP6_BEGIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_AUTH_SRP6_PROOF, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_AUTH_SRP6_RECODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_AUTOEQUIP_GROUND_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_GROUND_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_JOIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MANAGER_ADVANCE_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MANAGER_SET_NEXT_TRANSITION_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_REQUEST_SCORE_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); Need to send the response //DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlemasterHelloOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_BEASTMASTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_BOOTME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_BOT_DETECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_BOT_DETECTED2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_BUY_ITEM_IN_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyItemInSlotOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_BUY_LOTTERY_TICKET_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_BUY_STABLE_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyStableSlot ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_CONTEXT_EVENT_SIGNUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_INVITE_NOTES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_GROWTH_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelGrowthAuraOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_CHANGE_GDF_ARENA_RATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CHANGE_PERSONAL_ARENA_RATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_CHARACTER_POINT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -1473,14 +1340,17 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_PASSIVE_AURA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_SERVER_GEO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_DECHARGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DECLINE_CHANNEL_INVITE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleChannelDeclineInvite ); //DEFINE_OPCODE_HANDLER(CMSG_DELETE_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_DEL_PVP_MEDAL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_DESTROYMONSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DESTROY_ITEMS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_DISABLE_PVP_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_DROP_NEW_CONNECTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_DUMP_OBJECTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_ENABLE_DAMAGE_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_END_BATTLEFIELD_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_EQUIPMENT_SET_DELETE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetDelete ); //DEFINE_OPCODE_HANDLER(CMSG_EXPIRE_RAID_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_FLAG_QUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_FLAG_QUEST_FINISH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -1490,7 +1360,11 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_FORCEACTIONSHOW, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_FORCE_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_FORCE_SAY_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GAMESPEED_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GAMETIME_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GETDEATHBINDZONE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GET_CHANNEL_MEMBER_COUNT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGetChannelMemberCount ); + //DEFINE_OPCODE_HANDLER(CMSG_GHOST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GMRESPONSE_CREATE_TICKET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GM_CHARACTER_RESTORE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GM_CHARACTER_SAVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -1498,7 +1372,9 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_GM_DESTROY_ONLINE_CORPSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GM_FREEZE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GM_GRANT_ACHIEVEMENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_INVIS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GM_MOVECORPSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_NUKE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GM_NUKE_ACCOUNT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GM_NUKE_CHARACTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GM_REMOVE_ACHIEVEMENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -1506,6 +1382,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_GM_RESURRECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GM_REVEALTO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GM_SET_CRITERIA_FOR_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_SET_SECURITY_GROUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GM_SHOW_COMPLAINTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GM_SILENCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GM_SUMMONMOB, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -1517,16 +1394,27 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_GM_VISION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GM_WHISPER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GODMODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GROUP_CANCEL, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GROUP_UNINVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupUninviteOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_MONEY_WITHDRAWN_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankMoneyWithdrawn ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_NOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_CREATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildCreateOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildInfoOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildLeaderOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_DIMINISHING_RETURNS_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_KNOCKBACK_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_REQUIREMENTS_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_INSTANCE_LOCK_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInstanceLockResponse ); //DEFINE_OPCODE_HANDLER(CMSG_LEARN_DANCE_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_LEARN_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LEAVE_BATTLEFIELD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLeaveBattlefieldOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LEVEL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_LFD_PARTY_LOCK_INFO_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgPartyLockInfoRequestOpcode); //DEFINE_OPCODE_HANDLER(CMSG_LFD_PLAYER_LOCK_INFO_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgPlayerLockInfoRequestOpcode); + //DEFINE_OPCODE_HANDLER(CMSG_LFG_GET_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LFG_PARTY_LOCK_INFO_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_NEEDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_JOIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_LOAD_DANCES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_LOTTERY_QUERY_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_LUA_USAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -1534,39 +1422,60 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_MAELSTROM_INVALIDATE_CACHE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_MAELSTROM_RENAME_GUILD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_MAKEMONSTERATTACKGUID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MEETINGSTONE_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_CHARACTER_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_CHARM_PORT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_CHARM_TELEPORT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_ENABLE_SWIM_TO_FLY_TRANS_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_FLY, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_RELATIVE_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_VEHICLE_REC_ID_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_START_SWIM_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_STOP_SWIM_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_TOGGLE_COLLISION_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_NEW_SPELL_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_NO_SPELL_VARIANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_PERFORM_ACTION_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_PETGODMODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_PET_LEVEL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_PET_NAME_CACHE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_PET_UNLEARN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_PET_UNLEARN_TALENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_PLAYER_AI_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_PLAYER_DIFFICULTY_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_PLAYER_LOGOUT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayerLogoutOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_PROFILEDATA_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_PVP_QUEUE_STATS_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_MAX_XP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_QUERY_OBJECT_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_QUERY_OBJECT_ROTATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_QUERY_SERVER_BUCK_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_QUERY_VEHICLE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_CANCEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverCancel ); + //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_QUEST_AUTOLAUNCH, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverQuestAutoLaunch ); + //DEFINE_OPCODE_HANDLER(CMSG_QUESTLOG_SWAP_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestLogSwapQuest ); + //DEFINE_OPCODE_HANDLER(CMSG_QUEST_NPC_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_RECHARGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_REDIRECTION_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_REFER_A_FRIEND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_REMOVE_GLYPH, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRemoveGlyph ); + //DEFINE_OPCODE_HANDLER(CMSG_REPLACE_ACCOUNT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_RUN_SCRIPT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SAVE_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SAVE_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SEARCH_LFG_JOIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfrSearchOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_SEARCH_LFG_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfrLeaveOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SEND_COMBAT_TRIGGER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SEND_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SEND_GENERAL_TRIGGER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SEND_LOCAL_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SERVERINFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SERVERTIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SERVER_BROADCAST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SERVER_COMMAND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SERVER_INFO_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SETDEATHBINDPOINT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIVE_TALENT_GROUP_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_ARENA_MEMBER_SEASON_GAMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_ARENA_MEMBER_WEEKLY_GAMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -1579,14 +1488,18 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_SET_DURABILITY_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_EXPLORATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_EXPLORATION_ALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_FACTION_CHEAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetFactionCheat ); //DEFINE_OPCODE_HANDLER(CMSG_SET_GLYPH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_GLYPH_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_GRANTABLE_LEVELS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_GUILD_BANK_TEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetGuildBankTabText ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_LFG_COMMENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetCommentOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SET_PAID_SERVICE_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_PVP_RANK_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_PVP_TITLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_RUNE_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_RUNE_COUNT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_SKILL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_STAT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_TITLE_SUFFIX, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_WORLDSTATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -1596,13 +1509,19 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_STABLE_REVIVE_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStableRevivePet ); //DEFINE_OPCODE_HANDLER(CMSG_STABLE_SWAP_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStableSwapPet ); //DEFINE_OPCODE_HANDLER(CMSG_START_BATTLEFIELD_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_START_QUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_STORE_LOOT_IN_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SUSPEND_COMMS_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_TARGET_CAST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_TARGET_SCRIPT_CAST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_TAXICLEARALLNODES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_TAXICLEARNODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_TAXIENABLEALLNODES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_TAXIENABLENODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_TAXISHOWNODES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_TEST_DROP_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_TOGGLE_XP_GAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_TRIGGER_CINEMATIC_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_UNCLAIM_LICENSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_UNDRESSPLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_UNITANIMTIER_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -1617,34 +1536,77 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_WEATHER_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_XP_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_ZONE_MAP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_BATTLEGROUND_PLAYER_POSITIONS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlegroundPlayerPositionsOpcode); //DEFINE_OPCODE_HANDLER(MSG_DELAY_GHOST_TELEPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_DEV_SHOWLABEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_GM_ACCOUNT_ONLINE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_GM_BIND_OTHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_GM_CHANGE_ARENA_RATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_GM_DESTROY_CORPSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_GM_GEARRATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_GM_RESETINSTANCELIMIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_GM_SHOWLABEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_GM_SUMMON, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_GUILD_BANK_LOG_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankLogQuery ); + //DEFINE_OPCODE_HANDLER(MSG_GUILD_EVENT_LOG_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildEventLogQueryOpcode ); //DEFINE_OPCODE_HANDLER(MSG_INSPECT_HONOR_STATS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectHonorStatsOpcode ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_FEATHER_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_GRAVITY_CHNG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_ALL_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_COLLISION_HEIGHT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_FLIGHT_BACK_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_FLIGHT_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_PITCH_RATE_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RAW_POSITION_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_BACK_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_SWIM_BACK_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_SWIM_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_TURN_RATE_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_WALK_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_SWIM_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_SWIM_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_TOGGLE_FALL_LOGGING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_TOGGLE_LOGGING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_MOUSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_NULL_ACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_PVP_LOG_DATA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePVPLogDataOpcode ); + //DEFINE_OPCODE_HANDLER(MSG_QUERY_GUILD_BANK_TEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryGuildBankTabText ); + //DEFINE_OPCODE_HANDLER(MSG_START_MOVE_FORWARD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_VIEW_PHASE_SHIFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_AFK_MONITOR_INFO_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_AURACASTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS1, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_PLAYER_POSITIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BINDZONEREPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BUY_BANK_SLOT_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_ACTION_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_UPDATE_INVITE_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHANGEPLAYER_DIFFICULTY_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHARACTER_PROFILE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHARACTER_PROFILE_REALM_CONNECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY_RESPONSE_WRITE_FILE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHEAT_PLAYER_LOOKUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHECK_FOR_BOTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_EXTRA_AURA_INFO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMBAT_LOG_MULTIPLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_GET_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMPLETION_NPC_RESPONCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_ACHIEVEMENT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_CHAR_ENUM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_GUILD_ROSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_UNKNOWN_1310, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_UPDATE_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CORPSE_IS_NOT_IN_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DAMAGE_DONE_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DBLOOKUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DEBUGAURAPROC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DEBUG_AISTATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1652,27 +1614,61 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_DEBUG_SERVER_GEO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DUMP_OBJECTS_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DYNAMIC_DROP_ROLL_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_FORCEACTIONSHOW, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_FORCE_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_FORCE_DISPLAY_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GAMETIMEBIAS_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GHOSTEE_GONE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GMRESPONSE_CREATE_TICKET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GOGOGO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_MONEY_WITHDRAWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_CANCEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_KNOWN_RECIPES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_SET_NOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_TRADESKILL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_XP_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_IGNORE_DIMINISHING_RETURNS_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_IGNORE_REQUIREMENTS_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_INIT_EXTRA_AURA_INFO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_INSPECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_DIFFICULTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_JOINED_BATTLEGROUND_QUEUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_KICK_REASON, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_OPEN_FROM_GOSSIP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_PARTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_SEARCH_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOTTERY_QUERY_RESULT_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_LOTTERY_RESULT_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_MEMBER_ADDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_SETQUEUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MINIGAME_MOVE_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_CHARACTER_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_DISABLE_COLLISION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_DISABLE_GRAVITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_ENABLE_COLLISION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_ENABLE_GRAVITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_VEHICLE_REC_ID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_WALK_IN_AIR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SKIP_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_WALK_IN_AIR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_TELEPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_NPC_WONT_TALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_UNLEARN_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PLAYER_UNK_DEAD_ALIVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PLAY_SPELL_IMPACT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PROFILEDATA_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PUREMOUNT_CANCELLED_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PVP_QUEUE_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_QUERY_OBJECT_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_QUERY_OBJECT_ROTATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_ADD_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_RAID_READY_CHECK_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_REMOVED_FROM_PVP_QUEUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_RESET_RANGED_COMBAT_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RESISTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_RESUME_CAST_BAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_RESURRECT_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SCRIPT_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1680,6 +1676,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_SERVERINFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SERVER_BUCK_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SERVER_BUCK_DATA_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SETUP_RESEARCH_HISTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SET_EXTRA_AURA_INFO_NEED_UPDATE_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SET_EXTRA_AURA_INFO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SHOW_MAILBOX, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1687,6 +1684,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_SPELL_CHANCE_RESIST_PUSHBACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_LAND_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_NORMAL_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1696,6 +1694,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_SWIM_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_ADJUST_PRIORITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ZONE_MAP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 4a07e4752a8..c54e77890f1 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -222,11 +222,9 @@ enum Opcodes CMSG_GOSSIP_HELLO = 0x4525, CMSG_GOSSIP_SELECT_OPTION = 0x0216, CMSG_GRANT_LEVEL = 0x6D16, - CMSG_GROUP_ACCEPT = 0x0000, CMSG_GROUP_ASSISTANT_LEADER = 0x6025, CMSG_GROUP_CANCEL = 0x0000, CMSG_GROUP_CHANGE_SUB_GROUP = 0x4124, - CMSG_GROUP_DECLINE = 0x0000, CMSG_GROUP_DISBAND = 0x2804, CMSG_GROUP_INVITE = 0x0513, CMSG_GROUP_INVITE_RESPONSE = 0x0410, -- cgit v1.2.3 From 16f47e8a4e06f36d58de6343c1d5553013d906fb Mon Sep 17 00:00:00 2001 From: Nay Date: Wed, 8 Aug 2012 15:41:32 +0100 Subject: Core/Chat: Correct HandleChannelPassword and HandleChannelInvite --- src/server/game/Handlers/ChannelHandler.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/ChannelHandler.cpp b/src/server/game/Handlers/ChannelHandler.cpp index dba4645e2b5..4a5169a91bd 100755 --- a/src/server/game/Handlers/ChannelHandler.cpp +++ b/src/server/game/Handlers/ChannelHandler.cpp @@ -95,11 +95,11 @@ void WorldSession::HandleChannelList(WorldPacket& recvPacket) void WorldSession::HandleChannelPassword(WorldPacket& recvPacket) { sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); - uint32 passLength = recvPacket.ReadBits(8); - uint32 nameLength = recvPacket.ReadBits(7); - - std::string pass = recvPacket.ReadString(passLength); + uint32 nameLength = recvPacket.ReadBits(8); + uint32 passLength = recvPacket.ReadBits(7); + std::string channelname = recvPacket.ReadString(nameLength); + std::string pass = recvPacket.ReadString(passLength); if (ChannelMgr* cMgr = channelMgr(_player->GetTeam())) if (Channel* chn = cMgr->GetChannel(channelname, _player)) @@ -209,12 +209,12 @@ void WorldSession::HandleChannelUnmute(WorldPacket& recvPacket) void WorldSession::HandleChannelInvite(WorldPacket& recvPacket) { sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); - uint32 channelLength = recvPacket.ReadBits(7); - uint32 nameLength = recvPacket.ReadBits(8); - - std::string channelname = recvPacket.ReadString(channelLength); + uint32 nameLength = recvPacket.ReadBits(7); + uint32 channelLength = recvPacket.ReadBits(8); + std::string otp = recvPacket.ReadString(nameLength); - + std::string channelname = recvPacket.ReadString(channelLength); + if (!normalizePlayerName(otp)) return; -- cgit v1.2.3 From 10c9c557003dd6862295c2e9c792d72d4b7cd9c3 Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 9 Aug 2012 00:58:04 +0100 Subject: Core/Quests: Fix and enable all quest related opcodes --- src/server/game/Entities/Creature/GossipDef.cpp | 114 +++++++++------------ src/server/game/Entities/Player/Player.cpp | 84 ++++------------ src/server/game/Entities/Player/Player.h | 1 - src/server/game/Quests/QuestDef.cpp | 127 ++++++++++-------------- src/server/game/Quests/QuestDef.h | 4 +- src/server/game/Server/Protocol/Opcodes.cpp | 39 ++++---- 6 files changed, 139 insertions(+), 230 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Creature/GossipDef.cpp b/src/server/game/Entities/Creature/GossipDef.cpp index 4e5762b87c8..05ec6f6920d 100755 --- a/src/server/game/Entities/Creature/GossipDef.cpp +++ b/src/server/game/Entities/Creature/GossipDef.cpp @@ -293,14 +293,14 @@ void PlayerMenu::SendQuestGiverStatus(uint32 questStatus, uint64 npcGUID) const void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, uint64 npcGUID, bool activateAccept) const { - std::string questTitle = quest->GetTitle(); - std::string questDetails = quest->GetDetails(); - std::string questObjectives = quest->GetObjectives(); - std::string questEndText = quest->GetEndText(); + std::string questTitle = quest->GetTitle(); + std::string questDetails = quest->GetDetails(); + std::string questObjectives = quest->GetObjectives(); + std::string questEndText = quest->GetEndText(); std::string questGiverTextWindow = quest->GetQuestGiverTextWindow(); std::string questGiverTargetName = quest->GetQuestGiverTargetName(); - std::string questTurnTextWindow = quest->GetQuestTurnTextWindow(); - std::string questTurnTargetName = quest->GetQuestTurnTargetName(); + std::string questTurnTextWindow = quest->GetQuestTurnTextWindow(); + std::string questTurnTargetName = quest->GetQuestTurnTargetName(); int32 locale = _session->GetSessionDbLocaleIndex(); if (locale >= 0) @@ -335,7 +335,7 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, uint64 npcGUID, data << uint32(quest->GetFlags()); // 3.3.3 questFlags data << uint32(quest->GetSuggestedPlayers()); data << uint8(0); // IsFinished? value is sent back to server in quest accept packet - data << uint8(0); // 4.x StartType, unknown enum + data << uint8(0); // 4.x FIXME: Starts at AreaTrigger data << uint32(quest->GetRequiredSpell()); // 4.x quest->BuildExtraQuestInfo(data, _session->GetPlayer()); @@ -353,8 +353,6 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, uint64 npcGUID, void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const { - // SMSG_QUEST_QUERY_RESPONSE - Updated to 422 - std::string questTitle = quest->GetTitle(); std::string questDetails = quest->GetDetails(); std::string questObjectives = quest->GetObjectives(); @@ -427,7 +425,7 @@ void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const data << uint32(quest->GetCharTitleId()); // CharTitleId, new 2.4.0, player gets this title (id from CharTitles) data << uint32(quest->GetPlayersSlain()); // players slain data << uint32(quest->GetBonusTalents()); // bonus talents - data << uint32(quest->GetRewArenaPoints()); // bonus arena points + data << uint32(quest->GetRewArenaPoints()); // bonus arena points FIXME: arena points were removed, right? data << uint32(quest->GetRewardSkillId()); // reward skill id data << uint32(quest->GetRewardSkillPoints()); // reward skill points data << uint32(quest->GetRewardReputationMask()); // rep mask (unsure on what it does) @@ -525,6 +523,10 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* quest, uint64 npcGUID, b { std::string questTitle = quest->GetTitle(); std::string questOfferRewardText = quest->GetOfferRewardText(); + std::string questGiverTextWindow = quest->GetQuestGiverTextWindow(); + std::string questGiverTargetName = quest->GetQuestGiverTargetName(); + std::string questTurnTextWindow = quest->GetQuestTurnTextWindow(); + std::string questTurnTargetName = quest->GetQuestTurnTargetName(); int locale = _session->GetSessionDbLocaleIndex(); if (locale >= 0) @@ -533,6 +535,10 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* quest, uint64 npcGUID, b { ObjectMgr::GetLocaleString(localeData->Title, locale, questTitle); ObjectMgr::GetLocaleString(localeData->OfferRewardText, locale, questOfferRewardText); + ObjectMgr::GetLocaleString(localeData->QuestGiverTextWindow, locale, questGiverTextWindow); + ObjectMgr::GetLocaleString(localeData->QuestGiverTargetName, locale, questGiverTargetName); + ObjectMgr::GetLocaleString(localeData->QuestTurnTextWindow, locale, questTurnTextWindow); + ObjectMgr::GetLocaleString(localeData->QuestTurnTargetName, locale, questTurnTargetName); } } @@ -542,12 +548,19 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* quest, uint64 npcGUID, b data << questTitle; data << questOfferRewardText; + data << questGiverTextWindow; + data << questGiverTargetName; + data << questTurnTextWindow; + data << questTurnTargetName; + data << uint32(quest->GetQuestGiverPortrait()); + data << uint32(quest->GetQuestTurnInPortrait()); + data << uint8(enableNext ? 1 : 0); // Auto Finish data << uint32(quest->GetFlags()); // 3.3.3 questFlags data << uint32(quest->GetSuggestedPlayers()); // SuggestedGroupNum uint32 emoteCount = 0; - for (uint32 i = 0; i < QUEST_EMOTE_COUNT; ++i) + for (uint8 i = 0; i < QUEST_EMOTE_COUNT; ++i) { if (quest->OfferRewardEmote[i] <= 0) break; @@ -555,58 +568,13 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* quest, uint64 npcGUID, b } data << emoteCount; // Emote Count - for (uint32 i = 0; i < emoteCount; ++i) + for (uint8 i = 0; i < emoteCount; ++i) { data << uint32(quest->OfferRewardEmoteDelay[i]); // Delay Emote data << uint32(quest->OfferRewardEmote[i]); } - data << uint32(quest->GetRewChoiceItemsCount()); - for (uint32 i=0; i < quest->GetRewChoiceItemsCount(); ++i) - { - data << uint32(quest->RewardChoiceItemId[i]); - data << uint32(quest->RewardChoiceItemCount[i]); - - if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->RewardChoiceItemId[i])) - data << uint32(itemTemplate->DisplayInfoID); - else - data << uint32(0); - } - - data << uint32(quest->GetRewItemsCount()); - for (uint32 i = 0; i < quest->GetRewItemsCount(); ++i) - { - data << uint32(quest->RewardItemId[i]); - data << uint32(quest->RewardItemIdCount[i]); - - if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->RewardItemId[i])) - data << uint32(itemTemplate->DisplayInfoID); - else - data << uint32(0); - } - - data << uint32(quest->GetRewOrReqMoney()); - data << uint32(quest->XPValue(_session->GetPlayer()) * sWorld->getRate(RATE_XP_QUEST)); - - // rewarded honor points. Multiply with 10 to satisfy client - data << 10 * Trinity::Honor::hk_honor_at_level(_session->GetPlayer()->getLevel(), quest->GetRewHonorMultiplier()); - data << float(0); // unk, honor multiplier? - data << uint32(0x08); // unused by client? - data << uint32(quest->GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast == 0) - data << int32(quest->GetRewSpellCast()); // casted spell - data << uint32(0); // unknown - data << uint32(quest->GetBonusTalents()); // bonus talents - data << uint32(quest->GetRewArenaPoints()); // arena points - data << uint32(0); - - for (uint32 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) // reward factions ids - data << uint32(quest->RewardFactionId[i]); - - for (uint32 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) // columnid in QuestFactionReward.dbc (zero based)? - data << int32(quest->RewardFactionValueId[i]); - - for (uint32 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) // reward reputation override? - data << uint32(quest->RewardFactionValueIdOverride[i]); + quest->BuildExtraQuestInfo(data, _session->GetPlayer()); _session->SendPacket(&data); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_OFFER_REWARD NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), quest->GetQuestId()); @@ -673,17 +641,25 @@ void PlayerMenu::SendQuestGiverRequestItems(Quest const* quest, uint64 npcGUID, data << uint32(0); } - // if (!canComplete) - // data << uint32(0x00); - // else - // data << uint32(0x03); - - data << uint32(0x00); // Unk flags - data << uint32(0x00); // Unk flags - data << uint32(0x04); // Unk flags - data << uint32(0x08); // Unk flags - data << uint32(0x10); // Unk flags 4.x - data << uint32(0x40); // Unk flags 4.x + data << uint32(quest->GetReqCurrencyCount()); + for (int i = 0; i < QUEST_REQUIRED_CURRENCY_COUNT; ++i) + { + if (!quest->RequiredCurrencyId[i]) + continue; + + data << uint32(quest->RequiredCurrencyId[i]); + data << uint32(quest->RequiredCurrencyCount[i]); + } + + if (!canComplete) // Experimental; there are 6 similar flags, if any of them + data << uint32(0x00); // of them is 0 player can't complete quest (still unknown meaning) + else + data << uint32(0x02); + + data << uint32(0x04); + data << uint32(0x08); + data << uint32(0x10); + data << uint32(0x40); _session->SendPacket(&data); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_REQUEST_ITEMS NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), quest->GetQuestId()); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index bdfb997a1af..c9f17e8e485 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -15794,7 +15794,8 @@ void Player::ItemAddedQuestCheck(uint32 entry, uint32 count) m_QuestStatusSave[questid] = true; - SendQuestUpdateAddItem(qInfo, j, additemcount); + //SendQuestUpdateAddItem(qInfo, j, additemcount); + // FIXME: verify if there's any packet sent updating item } if (CanCompleteQuest(questid)) CompleteQuest(questid); @@ -16244,54 +16245,13 @@ bool Player::HasQuestForItem(uint32 itemid) const void Player::SendQuestComplete(Quest const* quest) { - // SMSG_QUESTUPDATE_COMPLETE - whole new structure in 4.x - - std::string title = quest->GetTitle(); - std::string completedText = quest->GetCompletedText(); - std::string questGiverTextWindow = quest->GetQuestGiverTextWindow(); - std::string questGiverTargetName = quest->GetQuestGiverTargetName(); - std::string questTurnTextWindow = quest->GetQuestTurnTextWindow(); - std::string questTurnTargetName = quest->GetQuestTurnTargetName(); - - int32 locale = GetSession()->GetSessionDbLocaleIndex(); - if (locale >= 0) + if (quest) { - if (QuestLocale const* localeData = sObjectMgr->GetQuestLocale(quest->GetQuestId())) - { - ObjectMgr::GetLocaleString(localeData->Title, locale, title); - ObjectMgr::GetLocaleString(localeData->CompletedText, locale, completedText); - ObjectMgr::GetLocaleString(localeData->QuestGiverTextWindow, locale, questGiverTextWindow); - ObjectMgr::GetLocaleString(localeData->QuestGiverTargetName, locale, questGiverTargetName); - ObjectMgr::GetLocaleString(localeData->QuestTurnTextWindow, locale, questTurnTextWindow); - ObjectMgr::GetLocaleString(localeData->QuestTurnTargetName, locale, questTurnTargetName); - } + WorldPacket data(SMSG_QUESTUPDATE_COMPLETE, 4); + data << uint32(quest->GetQuestId()); + GetSession()->SendPacket(&data); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTUPDATE_COMPLETE quest = %u", quest->GetQuestId()); } - - WorldPacket data(SMSG_QUESTUPDATE_COMPLETE, 4); - data << uint64(GetGUID()); - data << uint32(quest->GetQuestId()); - data << title; - data << completedText; - data << questGiverTextWindow; - data << questGiverTargetName; - data << questTurnTextWindow; - data << questTurnTargetName; - data << uint32(quest->GetQuestGiverPortrait()); - data << uint32(quest->GetQuestTurnInPortrait()); - data << int8(0); // Unk - data << uint32(quest->GetFlags()); - data << int32(0); // Unk - data << uint32(QUEST_EMOTE_COUNT); - for (uint8 i = 0; i < QUEST_EMOTE_COUNT; ++i) - { - data << uint32(quest->DetailsEmote[i]); - data << uint32(quest->DetailsEmoteDelay[i]); // DetailsEmoteDelay (in ms) - } - - quest->BuildExtraQuestInfo(data, this); - - GetSession()->SendPacket(&data); - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTUPDATE_COMPLETE quest = %u", quest->GetQuestId()); } void Player::SendQuestReward(Quest const* quest, uint32 XP, Object* questGiver) @@ -16299,26 +16259,33 @@ void Player::SendQuestReward(Quest const* quest, uint32 XP, Object* questGiver) uint32 questId = quest->GetQuestId(); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_QUEST_COMPLETE quest = %u", questId); sGameEventMgr->HandleQuestComplete(questId); - WorldPacket data(SMSG_QUESTGIVER_QUEST_COMPLETE, (4+4+4+4+4)); - data << uint8(0x80); // 4.x unknown flag, most common value is 0x80 (it might be a single bit) + uint32 xp; + uint32 moneyReward; if (getLevel() < sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) { - data << uint32(XP); - data << uint32(quest->GetRewOrReqMoney()); + xp = XP; + moneyReward = quest->GetRewOrReqMoney(); } else // At max level, increase gold reward { - data << uint32(0); - data << uint32(quest->GetRewOrReqMoney() + int32(quest->GetRewMoneyMaxLevel() * sWorld->getRate(RATE_DROP_MONEY))); + xp = 0; + moneyReward = uint32(quest->GetRewOrReqMoney() + int32(quest->GetRewMoneyMaxLevel() * sWorld->getRate(RATE_DROP_MONEY))); } + WorldPacket data(SMSG_QUESTGIVER_QUEST_COMPLETE, (4+4+4+4+4)); + + data << uint32(quest->GetBonusTalents()); // bonus talents (not verified for 4.x) data << uint32(quest->GetRewardSkillPoints()); // 4.x bonus skill points + data << uint32(moneyReward); + data << uint32(xp); data << uint32(questId); data << uint32(quest->GetRewardSkillId()); // 4.x bonus skill id - data << uint32(quest->GetBonusTalents()); // bonus talents (not verified for 4.x) + data.WriteBit(0); // FIXME: unknown bits, common values sent + data.WriteBit(1); + GetSession()->SendPacket(&data); if (quest->GetQuestCompleteScript() != 0) @@ -16389,15 +16356,6 @@ void Player::SendPushToPartyResponse(Player* player, uint32 msg) } } -void Player::SendQuestUpdateAddItem(Quest const* /*quest*/, uint32 /*item_idx*/, uint16 /*count*/) -{ - WorldPacket data(SMSG_QUESTUPDATE_ADD_ITEM, 0); - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTUPDATE_ADD_ITEM"); - //data << quest->RequiredItemId[item_idx]; - //data << count; - GetSession()->SendPacket(&data); -} - void Player::SendQuestUpdateAddCreatureOrGo(Quest const* quest, uint64 guid, uint32 creatureOrGO_idx, uint16 old_count, uint16 add_count) { ASSERT(old_count + add_count < 65536 && "mob/GO count store in 16 bits 2^16 = 65536 (0..65536)"); diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 50a2de70d33..e785a7aa537 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1532,7 +1532,6 @@ class Player : public Unit, public GridObject void SendCanTakeQuestResponse(uint32 msg) const; void SendQuestConfirmAccept(Quest const* quest, Player* pReceiver); void SendPushToPartyResponse(Player* player, uint32 msg); - void SendQuestUpdateAddItem(Quest const* quest, uint32 item_idx, uint16 count); void SendQuestUpdateAddCreatureOrGo(Quest const* quest, uint64 guid, uint32 creatureOrGO_idx, uint16 old_count, uint16 add_count); void SendQuestUpdateAddPlayer(Quest const* quest, uint16 old_count, uint16 add_count); diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index 32dc58e582b..15db40a8063 100755 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -247,100 +247,77 @@ int32 Quest::GetRewOrReqMoney() const return int32(RewardOrRequiredMoney * sWorld->getRate(RATE_DROP_MONEY)); } -uint32 Quest::GetRewChoiceItemsEffectiveCount() const -{ - uint32 count = 0; - for (uint8 i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) - if (RewardChoiceItemId[i] > 0) - count++; - - return count; -} - -uint32 Quest::GetRewItemsEffectiveCount() const -{ - uint32 count = 0; - for (uint8 i = 0; i < QUEST_REWARDS_COUNT; ++i) - if (RewardItemId[i] > 0) - count++; - - return count; -} - void Quest::BuildExtraQuestInfo(WorldPacket& data, Player* player) const { - if (HasFlag(QUEST_FLAGS_HIDDEN_REWARDS)) + data << uint32(GetRewChoiceItemsCount()); + for (uint8 i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) + data << uint32(RewardChoiceItemId[i]); + for (uint8 i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) + data << uint32(RewardChoiceItemCount[i]); + for (uint8 i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) { - data << uint32(0); // Rewarded chosen items hidden - data << uint32(0); // Rewarded items hidden - data << uint32(0); // Rewarded money hidden - data << uint32(0); // Rewarded XP hidden + if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(RewardChoiceItemId[i])) + data << uint32(itemTemplate->DisplayInfoID); + else + data << uint32(0); } - else + + data << uint32(GetReqItemsCount()); + for (uint8 i = 0; i < QUEST_REWARDS_COUNT; ++i) + data << uint32(RewardItemId[i]); + for (uint8 i = 0; i < QUEST_REWARDS_COUNT; ++i) + data << uint32(RewardItemIdCount[i]); + for (uint8 i = 0; i < QUEST_REWARDS_COUNT; ++i) { - data << uint32(GetRewChoiceItemsEffectiveCount()); - for (uint8 i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) - data << uint32(RewardChoiceItemId[i]); - for (uint8 i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) - data << uint32(RewardChoiceItemCount[i]); - for (uint8 i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) - { - if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(RewardChoiceItemId[i])) - data << uint32(itemTemplate->DisplayInfoID); - else - data << uint32(0); - } - - data << uint32(GetRewChoiceItemsEffectiveCount()); - for (uint8 i = 0; i < QUEST_REWARDS_COUNT; ++i) - data << uint32(RewardItemId[i]); - for (uint8 i = 0; i < QUEST_REWARDS_COUNT; ++i) - data << uint32(RewardItemIdCount[i]); - for (uint8 i = 0; i < QUEST_REWARDS_COUNT; ++i) - { - if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(RewardItemId[i])) - data << uint32(itemTemplate->DisplayInfoID); - else - data << uint32(0); - } - - data << uint32(GetRewOrReqMoney()); - data << uint32(XPValue(player) * sWorld->getRate(RATE_XP_QUEST)); + if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(RewardItemId[i])) + data << uint32(itemTemplate->DisplayInfoID); + else + data << uint32(0); } - data << uint32(GetCharTitleId()); // CharTitleId, new 2.4.0, player gets this title (id from CharTitles) - data << uint32(0); // 4.x Unk - data << float(0); // 4.x Unk - data << uint32(GetBonusTalents()); // bonus talents - data << uint32(0); // 4.x Unk - data << uint32(0); // 4.x Unk + data << uint32(GetRewOrReqMoney()); + data << uint32(XPValue(player) * sWorld->getRate(RATE_XP_QUEST)); - /* These are probably some of the unks above + data << uint32(GetCharTitleId()); + data << uint32(0); // unk + data << float(0.0f); // unk + data << uint32(GetBonusTalents()); + data << uint32(0); // unk + data << uint32(GetRewardReputationMask()); + + /* Pre cata struct, some of these unks might be the missing values in cata: // rewarded honor points. Multiply with 10 to satisfy client data << 10 * Trinity::Honor::hk_honor_at_level(_session->GetPlayer()->getLevel(), quest->GetRewHonorMultiplier()); - data << float(0.0f); // new 3.3.0, honor multiplier? - data << uint32(quest->GetCharTitleId()); // CharTitleId, new 2.4.0, player gets this title (id from CharTitles) // unk + data << float(0); // unk, honor multiplier? + data << uint32(0x08); // unused by client? + data << uint32(quest->GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast == 0) + data << int32(quest->GetRewSpellCast()); // casted spell + data << uint32(0); // unknown + data << uint32(quest->GetBonusTalents()); // bonus talents + data << uint32(quest->GetRewArenaPoints()); // arena points + data << uint32(0); */ - for (uint8 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) + for (uint8 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) // reward factions ids data << uint32(RewardFactionId[i]); - for (uint8 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) + for (uint8 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) // columnid in QuestFactionReward.dbc (zero based)? data << int32(RewardFactionValueId[i]); - for (uint8 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) - data << int32(RewardFactionValueIdOverride[i]); + for (uint8 i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) // reward reputation override? + data << uint32(RewardFactionValueIdOverride[i]); + + data << uint32(GetRewSpell()); + data << uint32(GetRewSpellCast()); - data << uint32(GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast == 0) - data << int32(GetRewSpellCast()); // casted spell + for (uint8 i = 0; i < QUEST_REWARD_CURRENCY_COUNT; ++i) + data << uint32(RewardCurrencyId[i]); - for (uint8 i = 0; i < QUEST_REWARD_CURRENCY_COUNT; i++) - data << uint32(RewardCurrencyId[i]); // 4.x Unk - for (uint8 i = 0; i < QUEST_REWARD_CURRENCY_COUNT; i++) - data << uint32(RewardCurrencyCount[i]); // 4.x Unk + for (uint8 i = 0; i < QUEST_REWARD_CURRENCY_COUNT; ++i) + data << uint32(RewardCurrencyCount[i]); - data << uint32(0); // 4.x Unk - data << uint32(0); // 4.x Unk + data << uint32(GetRewardSkillId()); + data << uint32(GetRewardSkillPoints()); } bool Quest::IsAutoAccept() const diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h index b72956ce313..d0441879041 100755 --- a/src/server/game/Quests/QuestDef.h +++ b/src/server/game/Quests/QuestDef.h @@ -307,11 +307,11 @@ class Quest uint32 RequiredCurrencyCount[QUEST_REQUIRED_CURRENCY_COUNT]; uint32 GetReqItemsCount() const { return m_reqItemsCount; } - uint32 GetRewItemsEffectiveCount() const; uint32 GetReqCreatureOrGOcount() const { return m_reqNpcOrGoCount; } uint32 GetRewChoiceItemsCount() const { return m_rewChoiceItemsCount; } - uint32 GetRewChoiceItemsEffectiveCount() const; uint32 GetRewItemsCount() const { return m_rewItemsCount; } + uint32 GetRewCurrencyCount() const { return m_rewCurrencyCount; } + uint32 GetReqCurrencyCount() const { return m_reqCurrencyCount; } void BuildExtraQuestInfo(WorldPacket& data, Player* player) const; diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index b9de8cc5765..56632edd4fb 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -190,7 +190,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_DUEL_CANCELLED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDuelCancelledOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_DUNGEON_FINDER_GET_SYSTEM_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_EJECT_PASSENGER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEmoteOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEmoteOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_ENABLETAXI, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleTaxiQueryAvailableNodes ); DEFINE_OPCODE_HANDLER(CMSG_ENABLE_NAGLE, STATUS_NEVER , PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); //DEFINE_OPCODE_HANDLER(CMSG_EQUIPMENT_SET_SAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetSave ); @@ -418,7 +418,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_QUESTLOG_REMOVE_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestLogRemoveQuest ); DEFINE_OPCODE_HANDLER(CMSG_QUEST_CONFIRM_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestConfirmAccept ); DEFINE_OPCODE_HANDLER(CMSG_QUEST_POI_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestPOIQuery ); - //DEFINE_OPCODE_HANDLER(CMSG_QUEST_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestQueryOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_QUEST_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestQueryOpcode ); DEFINE_OPCODE_HANDLER(CMSG_RANDOMIZE_CHAR_NAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRandomizeCharNameOpcode ); DEFINE_OPCODE_HANDLER(CMSG_READY_FOR_ACCOUNT_DATA_TIMES, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleReadyForAccountDataTimes ); DEFINE_OPCODE_HANDLER(CMSG_READ_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReadItem ); @@ -439,7 +439,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_INSPECT_RATED_BG_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PARTY_MEMBER_STATS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestPartyMemberStatsOpcode); //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PET_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestPetInfoOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PVP_OPTIONS_ENABLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PVP_OPTIONS_ENABLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PVP_REWARDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RAID_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestRaidInfoOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RATED_BG_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -506,7 +506,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_TAXINODE_STATUS_QUERY, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleTaxiNodeStatusQueryOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_TAXIQUERYAVAILABLENODES, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleTaxiQueryAvailableNodes ); //DEFINE_OPCODE_HANDLER(CMSG_TELEPORT_TO_UNIT, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_TEXT_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTextEmoteOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_TEXT_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTextEmoteOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_TIME_ADJUSTMENT_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_TIME_SYNC_RESP, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleTimeSyncResp ); //DEFINE_OPCODE_HANDLER(CMSG_TIME_SYNC_RESP_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -1077,25 +1077,25 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_PVP_OPTIONS_ENABLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_QUERY_QUESTS_COMPLETED_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_QUERY_TIME_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_OFFER_REWARD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_DETAILS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_INVALID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_REQUEST_ITEMS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_OFFER_REWARD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_DETAILS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_INVALID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_REQUEST_ITEMS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_STATUS_MULTIPLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_QUESTLOG_FULL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_ADD_KILL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_ADD_PVP_KILL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_FAILEDTIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_QUEST_CONFIRM_ACCEPT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_QUEST_FORCE_REMOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_ADD_KILL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_ADD_PVP_KILL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_FAILEDTIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUEST_CONFIRM_ACCEPT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUEST_FORCE_REMOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_QUEST_POI_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_QUEST_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUEST_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_RAID_GROUP_ONLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_RAID_INSTANCE_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_RAID_INSTANCE_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1664,7 +1664,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_PVP_QUEUE_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_QUERY_OBJECT_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_QUERY_OBJECT_ROTATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_ADD_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_RAID_READY_CHECK_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_REMOVED_FROM_PVP_QUEUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_RESET_RANGED_COMBAT_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From 59d32edf02434bf92bc3a24d5c55c7023467c08e Mon Sep 17 00:00:00 2001 From: Subv Date: Wed, 8 Aug 2012 19:00:14 -0500 Subject: Core/PacketIO: Enabled more opcodes --- src/server/game/Handlers/ArenaTeamHandler.cpp | 6 ++-- src/server/game/Handlers/ChannelHandler.cpp | 3 +- src/server/game/Handlers/CharacterHandler.cpp | 6 ++-- src/server/game/Handlers/GroupHandler.cpp | 19 +++++------- src/server/game/Handlers/MailHandler.cpp | 2 +- src/server/game/Handlers/MiscHandler.cpp | 2 +- src/server/game/Server/Protocol/Opcodes.cpp | 42 +++++++++++++-------------- 7 files changed, 39 insertions(+), 41 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/ArenaTeamHandler.cpp b/src/server/game/Handlers/ArenaTeamHandler.cpp index ce4e2a15ca9..3d1bfe20ced 100755 --- a/src/server/game/Handlers/ArenaTeamHandler.cpp +++ b/src/server/game/Handlers/ArenaTeamHandler.cpp @@ -359,9 +359,9 @@ void WorldSession::SendArenaTeamCommandResult(uint32 teamAction, const std::stri void WorldSession::SendNotInArenaTeamPacket(uint8 type) { WorldPacket data(SMSG_ARENA_ERROR, 4+1); // 886 - You are not in a %uv%u arena team - uint32 unk = 0; - data << uint32(unk); // unk(0) - if (!unk) + uint32 error = 0; + data << uint32(error); // 0 = ERR_ARENA_NO_TEAM_II, 1 = ERR_ARENA_EXPIRED_CAIS, 2 = ERR_LFG_CANT_USE_BATTLEGROUND + if (!error) data << uint8(type); // team type (2=2v2, 3=3v3, 5=5v5), can be used for custom types... SendPacket(&data); } diff --git a/src/server/game/Handlers/ChannelHandler.cpp b/src/server/game/Handlers/ChannelHandler.cpp index 4a5169a91bd..f940d658530 100755 --- a/src/server/game/Handlers/ChannelHandler.cpp +++ b/src/server/game/Handlers/ChannelHandler.cpp @@ -67,7 +67,8 @@ void WorldSession::HandleLeaveChannel(WorldPacket& recvPacket) uint32 unk; std::string channelname; recvPacket >> unk; // channel id? - recvPacket >> channelname; + uint32 length = recvPacket.ReadBits(8); + channelname = recvPacket.ReadString(length); if (channelname.empty()) return; diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 7a728ac1dd0..b73901c29a5 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -1391,7 +1391,7 @@ void WorldSession::HandleAlterAppearance(WorldPacket & recvData) // 0 - ok // 1, 3 - not enough money - // 2 - you have to seat on barber chair + // 2 - you have to sit on barber chair if (!_player->HasEnoughMoney((uint64)cost)) { WorldPacket data(SMSG_BARBER_SHOP_RESULT, 4); @@ -1556,7 +1556,7 @@ void WorldSession::HandleCharCustomize(WorldPacket& recvData) SendPacket(&data); } -void WorldSession::HandleEquipmentSetSave(WorldPacket &recvData) +void WorldSession::HandleEquipmentSetSave(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_EQUIPMENT_SET_SAVE"); @@ -1618,7 +1618,7 @@ void WorldSession::HandleEquipmentSetDelete(WorldPacket &recvData) _player->DeleteEquipmentSet(setGuid); } -void WorldSession::HandleEquipmentSetUse(WorldPacket &recvData) +void WorldSession::HandleEquipmentSetUse(WorldPacket& recvData) { if (_player->isInCombat()) return; diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp index a07fcd7e24d..7bdd51baf8f 100644 --- a/src/server/game/Handlers/GroupHandler.cpp +++ b/src/server/game/Handlers/GroupHandler.cpp @@ -489,7 +489,7 @@ void WorldSession::HandleGroupUninviteOpcode(WorldPacket & recvData) SendPartyResult(PARTY_OP_UNINVITE, membername, ERR_TARGET_NOT_IN_GROUP_S); } -void WorldSession::HandleGroupSetLeaderOpcode(WorldPacket & recvData) +void WorldSession::HandleGroupSetLeaderOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_SET_LEADER"); @@ -510,7 +510,7 @@ void WorldSession::HandleGroupSetLeaderOpcode(WorldPacket & recvData) group->SendUpdate(); } -void WorldSession::HandleGroupDisbandOpcode(WorldPacket & /*recvData*/) +void WorldSession::HandleGroupDisbandOpcode(WorldPacket& /*recvData*/) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_DISBAND"); @@ -637,7 +637,7 @@ void WorldSession::HandleRandomRollOpcode(WorldPacket& recvData) SendPacket(&data); } -void WorldSession::HandleRaidTargetUpdateOpcode(WorldPacket & recvData) +void WorldSession::HandleRaidTargetUpdateOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_RAID_TARGET_UPDATE"); @@ -645,7 +645,7 @@ void WorldSession::HandleRaidTargetUpdateOpcode(WorldPacket & recvData) if (!group) return; - uint8 x; + uint8 x; recvData >> x; /** error handling **/ @@ -653,9 +653,7 @@ void WorldSession::HandleRaidTargetUpdateOpcode(WorldPacket & recvData) // everything's fine, do it if (x == 0xFF) // target icon request - { group->SendTargetIconList(this); - } else // target icon update { if (!group->IsLeader(GetPlayer()->GetGUID()) && !group->IsAssistant(GetPlayer()->GetGUID())) @@ -696,7 +694,7 @@ void WorldSession::HandleGroupRaidConvertOpcode(WorldPacket& recvData) group->ConvertToGroup(); } -void WorldSession::HandleGroupChangeSubGroupOpcode(WorldPacket & recvData) +void WorldSession::HandleGroupChangeSubGroupOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_CHANGE_SUB_GROUP"); @@ -722,10 +720,9 @@ void WorldSession::HandleGroupChangeSubGroupOpcode(WorldPacket & recvData) Player* movedPlayer = sObjectAccessor->FindPlayerByName(name.c_str()); uint64 guid; + if (movedPlayer) - { guid = movedPlayer->GetGUID(); - } else { CharacterDatabase.EscapeString(name); @@ -735,7 +732,7 @@ void WorldSession::HandleGroupChangeSubGroupOpcode(WorldPacket & recvData) group->ChangeMembersGroup(guid, groupNr); } -void WorldSession::HandleGroupSwapSubGroupOpcode(WorldPacket & recvData) +void WorldSession::HandleGroupSwapSubGroupOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_SWAP_SUB_GROUP"); std::string unk1; @@ -766,7 +763,7 @@ void WorldSession::HandleGroupAssistantLeaderOpcode(WorldPacket & recvData) group->SendUpdate(); } -void WorldSession::HandlePartyAssignmentOpcode(WorldPacket & recvData) +void WorldSession::HandlePartyAssignmentOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_PARTY_ASSIGNMENT"); diff --git a/src/server/game/Handlers/MailHandler.cpp b/src/server/game/Handlers/MailHandler.cpp index c3c61d126da..d54a3712377 100644 --- a/src/server/game/Handlers/MailHandler.cpp +++ b/src/server/game/Handlers/MailHandler.cpp @@ -591,7 +591,7 @@ void WorldSession::HandleMailTakeMoney(WorldPacket& recvData) } //called when player lists his received mails -void WorldSession::HandleGetMailList(WorldPacket & recvData) +void WorldSession::HandleGetMailList(WorldPacket& recvData) { uint64 mailbox; recvData >> mailbox; diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 34ed6a8ef15..75c46b57077 100644 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -1429,7 +1429,7 @@ void WorldSession::HandleRealmSplitOpcode(WorldPacket & recvData) //sLog->outDebug("response sent %u", unk); } -void WorldSession::HandleFarSightOpcode(WorldPacket & recvData) +void WorldSession::HandleFarSightOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_FAR_SIGHT"); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 56632edd4fb..77ff0c639b9 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -193,15 +193,15 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEmoteOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_ENABLETAXI, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleTaxiQueryAvailableNodes ); DEFINE_OPCODE_HANDLER(CMSG_ENABLE_NAGLE, STATUS_NEVER , PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); - //DEFINE_OPCODE_HANDLER(CMSG_EQUIPMENT_SET_SAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetSave ); - //DEFINE_OPCODE_HANDLER(CMSG_EQUIPMENT_SET_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetUse ); - //DEFINE_OPCODE_HANDLER(CMSG_FAR_SIGHT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleFarSightOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_EQUIPMENT_SET_SAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetSave ); + DEFINE_OPCODE_HANDLER(CMSG_EQUIPMENT_SET_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetUse ); + DEFINE_OPCODE_HANDLER(CMSG_FAR_SIGHT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleFarSightOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_FORCE_MOVE_ROOT_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveRootAck ); //DEFINE_OPCODE_HANDLER(CMSG_FORCE_MOVE_UNROOT_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveUnRootAck ); DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJECT_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleGameObjectQueryOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJ_REPORT_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGameobjectReportUse ); DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJ_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGameObjectUseOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GET_MAIL_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGetMailList ); + DEFINE_OPCODE_HANDLER(CMSG_GET_MAIL_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGetMailList ); DEFINE_OPCODE_HANDLER(CMSG_GET_MIRRORIMAGE_DATA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMirrorImageDataRequest ); //DEFINE_OPCODE_HANDLER(CMSG_GMRESPONSE_RESOLVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMResponseResolve ); //DEFINE_OPCODE_HANDLER(CMSG_GMSURVEY_SUBMIT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMSurveySubmit ); @@ -213,15 +213,15 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_GM_REPORT_LAG, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReportLag ); DEFINE_OPCODE_HANDLER(CMSG_GOSSIP_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGossipHelloOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GOSSIP_SELECT_OPTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGossipSelectOptionOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GRANT_LEVEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGrantLevel ); - //DEFINE_OPCODE_HANDLER(CMSG_GROUP_ASSISTANT_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupAssistantLeaderOpcode); - //DEFINE_OPCODE_HANDLER(CMSG_GROUP_CHANGE_SUB_GROUP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupChangeSubGroupOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GROUP_DISBAND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupDisbandOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GRANT_LEVEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGrantLevel ); + DEFINE_OPCODE_HANDLER(CMSG_GROUP_ASSISTANT_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupAssistantLeaderOpcode); + DEFINE_OPCODE_HANDLER(CMSG_GROUP_CHANGE_SUB_GROUP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupChangeSubGroupOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GROUP_DISBAND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupDisbandOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GROUP_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupInviteOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GROUP_INVITE_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupInviteResponseOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_RAID_CONVERT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupRaidConvertOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_REQUEST_JOIN_UPDATES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GROUP_SET_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupSetLeaderOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GROUP_SET_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupSetLeaderOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_SET_ROLES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_SWAP_SUB_GROUP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupSwapSubGroupOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_UNINVITE_GUID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupUninviteGuidOpcode ); @@ -281,7 +281,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_LEARN_PREVIEW_TALENTS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnPreviewTalents ); DEFINE_OPCODE_HANDLER(CMSG_LEARN_PREVIEW_TALENTS_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnPreviewTalentsPet ); DEFINE_OPCODE_HANDLER(CMSG_LEARN_TALENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnTalentOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_LEAVE_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLeaveChannel ); + DEFINE_OPCODE_HANDLER(CMSG_LEAVE_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLeaveChannel ); //DEFINE_OPCODE_HANDLER(CMSG_LFG_GET_STATUS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_LFG_JOIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgJoinOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LFG_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgLeaveOpcode ); @@ -549,7 +549,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(MSG_CORPSE_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCorpseQueryOpcode ); //DEFINE_OPCODE_HANDLER(MSG_INSPECT_ARENA_TEAMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectArenaTeamsOpcode ); //DEFINE_OPCODE_HANDLER(MSG_LIST_STABLED_PETS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleListStabledPetsOpcode ); - //DEFINE_OPCODE_HANDLER(MSG_MINIMAP_PING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMinimapPingOpcode ); + DEFINE_OPCODE_HANDLER(MSG_MINIMAP_PING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMinimapPingOpcode ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_CHARM_TELEPORT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_MOVE_FALL_LAND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); DEFINE_OPCODE_HANDLER(MSG_MOVE_HEARTBEAT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); @@ -594,7 +594,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(MSG_RAID_READY_CHECK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidReadyCheckOpcode ); //DEFINE_OPCODE_HANDLER(MSG_RAID_READY_CHECK_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_RAID_READY_CHECK_FINISHED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidReadyCheckFinishedOpcode); - //DEFINE_OPCODE_HANDLER(MSG_RAID_TARGET_UPDATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidTargetUpdateOpcode ); + DEFINE_OPCODE_HANDLER(MSG_RAID_TARGET_UPDATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidTargetUpdateOpcode ); //DEFINE_OPCODE_HANDLER(MSG_RANDOM_ROLL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRandomRollOpcode ); //DEFINE_OPCODE_HANDLER(MSG_SAVE_GUILD_EMBLEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSaveGuildEmblemOpcode ); DEFINE_OPCODE_HANDLER(MSG_SET_DUNGEON_DIFFICULTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetDungeonDifficultyOpcode); @@ -610,14 +610,14 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_ACTION_BUTTONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ACTIVATETAXIREPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ADDON_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ADD_RUNE_POWER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ADD_RUNE_POWER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_AI_REACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ALL_ACHIEVEMENT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_AREA_SPIRIT_HEALER_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_AREA_TRIGGER_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_AREA_SPIRIT_HEALER_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_AREA_TRIGGER_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_AREA_TRIGGER_MOVEMENT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ARENA_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ARENA_OPPONENT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ARENA_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ARENA_OPPONENT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_CHANGE_FAILED_QUEUED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -647,7 +647,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_AUTH_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_AVAILABLE_VOICE_CHANNEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_AVERAGE_ITEM_LEVEL_INFORM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BARBER_SHOP_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BARBER_SHOP_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_EJECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_EJECT_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -698,8 +698,8 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_CANCEL_AUTO_REPEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CANCEL_COMBAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CAST_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHANNEL_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHANNEL_MEMBER_COUNT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CHANNEL_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CHANNEL_MEMBER_COUNT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CHANNEL_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHARACTER_LOGIN_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CHAR_CREATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -711,7 +711,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_CHAT_IGNORED_ACCOUNT_MUTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHAT_NOT_IN_PARTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHAT_PLAYER_AMBIGUOUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHAT_PLAYER_NOT_FOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CHAT_PLAYER_NOT_FOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHAT_RESTRICTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHAT_SERVER_DISCONNECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHAT_SERVER_RECONNECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From f56c98b2f536569be3402d88c626834d2676b520 Mon Sep 17 00:00:00 2001 From: Subv Date: Wed, 8 Aug 2012 19:37:36 -0500 Subject: Core/PacketIO: Enabled SMSG_ATTACKERSTATEUPDATE --- src/server/game/Entities/Unit/Unit.cpp | 7 +++++-- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 3da56bbef89..19d5ef5b3cd 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -4875,8 +4875,11 @@ void Unit::SendAttackStateUpdate(CalcDamageInfo* damageInfo) data << float(0); data << float(0); data << float(0); - data << float(0); // Found in a loop with 1 iteration - data << float(0); // ditto ^ + for (uint8 i = 0; i < 2; ++i) + { + data << float(0); + data << float(0); + } data << uint32(0); } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 77ff0c639b9..c3a4fbc79fb 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -625,7 +625,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_ROSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ATTACKERSTATEUPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ATTACKERSTATEUPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ATTACKSTART, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ATTACKSTOP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ATTACKSWING_BADFACING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From d904fd54b04aa687c8e6e1653547a36a23b63abd Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 9 Aug 2012 02:58:31 +0100 Subject: Core/PacketIO: Enable few more opcode handlers --- src/server/game/Handlers/NPCHandler.cpp | 2 +- src/server/game/Server/Protocol/Opcodes.cpp | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/NPCHandler.cpp b/src/server/game/Handlers/NPCHandler.cpp index 8c959f454ff..651d616a15f 100755 --- a/src/server/game/Handlers/NPCHandler.cpp +++ b/src/server/game/Handlers/NPCHandler.cpp @@ -154,7 +154,7 @@ void WorldSession::SendTrainerList(uint64 guid, const std::string& strTitle) WorldPacket data(SMSG_TRAINER_LIST, 8+4+4+trainer_spells->spellList.size()*38 + strTitle.size()+1); data << guid; data << uint32(trainer_spells->trainerType); - data << uint32(0); + data << uint32(1); // different value for each trainer, also found in CMSG_TRAINER_BUY_SPELL size_t count_pos = data.wpos(); data << uint32(trainer_spells->spellList.size()); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index c3a4fbc79fb..38340e61f10 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -364,7 +364,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_MOVE_TIME_SKIPPED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleMoveTimeSkippedOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_WATER_WALK_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveWaterWalkAck ); DEFINE_OPCODE_HANDLER(CMSG_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNameQueryOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_NEXT_CINEMATIC_CAMERA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNextCinematicCamera ); + DEFINE_OPCODE_HANDLER(CMSG_NEXT_CINEMATIC_CAMERA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNextCinematicCamera ); DEFINE_OPCODE_HANDLER(CMSG_NPC_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNpcTextQueryOpcode ); DEFINE_OPCODE_HANDLER(CMSG_OBJECT_UPDATE_FAILED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleObjectUpdateFailedOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_OBJECT_UPDATE_RESCUED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -452,7 +452,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_RESET_FACTION_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_RESET_INSTANCES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleResetInstancesOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_RESURRECT_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleResurrectResponseOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_RETURN_TO_GRAVEYARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReturnToGraveyard ); + DEFINE_OPCODE_HANDLER(CMSG_RETURN_TO_GRAVEYARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReturnToGraveyard ); //DEFINE_OPCODE_HANDLER(CMSG_ROLE_POLL_BEGIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SAVE_CUF_PROFILES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SELF_RES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSelfResOpcode ); @@ -471,8 +471,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_SET_CONTACT_NOTES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetContactNotesOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SET_CURRENCY_FLAGS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_EVERYONE_IS_ASSISTANT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_FACTION_ATWAR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetFactionAtWar ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_FACTION_INACTIVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetFactionInactiveOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_SET_FACTION_ATWAR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetFactionAtWar ); + DEFINE_OPCODE_HANDLER(CMSG_SET_FACTION_INACTIVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetFactionInactiveOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SET_PET_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_PLAYER_DECLINED_NAMES, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetPlayerDeclinedNames ); //DEFINE_OPCODE_HANDLER(CMSG_SET_PREFERED_CEMETERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -491,9 +491,9 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_SHOWING_HELM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleShowingHelmOpcode ); DEFINE_OPCODE_HANDLER(CMSG_SOCKET_GEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSocketOpcode ); DEFINE_OPCODE_HANDLER(CMSG_SPELLCLICK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSpellClick ); - //DEFINE_OPCODE_HANDLER(CMSG_SPIRIT_HEALER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSpiritHealerActivateOpcode); + DEFINE_OPCODE_HANDLER(CMSG_SPIRIT_HEALER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSpiritHealerActivateOpcode); //DEFINE_OPCODE_HANDLER(CMSG_SPLIT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSplitItemOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_STANDSTATECHANGE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStandStateChangeOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_STANDSTATECHANGE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStandStateChangeOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_STOP_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SUBMIT_BUG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SUBMIT_COMPLAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -512,8 +512,8 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_TIME_SYNC_RESP_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_TOGGLE_PVP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTogglePvP ); //DEFINE_OPCODE_HANDLER(CMSG_TOTEM_DESTROYED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTotemDestroyed ); - //DEFINE_OPCODE_HANDLER(CMSG_TRAINER_BUY_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerBuySpellOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_TRAINER_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerListOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_TRAINER_BUY_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerBuySpellOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_TRAINER_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerListOpcode ); DEFINE_OPCODE_HANDLER(CMSG_TRANSMOGRIFY_ITEMS, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleTransmogrifyItems ); DEFINE_OPCODE_HANDLER(CMSG_TURN_IN_PETITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTurnInPetitionOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_CLEAR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialClear ); -- cgit v1.2.3 From 0434d3ab6960e1ca0945e8bb33b7c72088954aa5 Mon Sep 17 00:00:00 2001 From: Subv Date: Wed, 8 Aug 2012 20:59:30 -0500 Subject: Core/PacketIO: Enabled/Fixed more opcodes --- src/server/game/Entities/Player/Player.cpp | 10 +- src/server/game/Entities/Unit/Unit.cpp | 141 +++++++++++++++------- src/server/game/Entities/Unit/Unit.h | 4 + src/server/game/Server/Protocol/Opcodes.cpp | 17 ++- src/server/game/Server/Protocol/Opcodes.h | 1 - src/server/game/Spells/Auras/SpellAuraEffects.cpp | 2 +- 6 files changed, 110 insertions(+), 65 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index c9f17e8e485..3d4250d5a44 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -1274,8 +1274,7 @@ uint32 Player::EnvironmentalDamage(EnviromentalDamage type, uint32 damage) sLog->outDebug(LOG_FILTER_PLAYER, "We are fall to death, loosing 10 percents durability"); DurabilityLossAll(0.10f, false); // durability lost message - WorldPacket data2(SMSG_DURABILITY_DAMAGE_DEATH, 0); - GetSession()->SendPacket(&data2); + SendDurabilityLoss(this, 10); } UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DEATHS_FROM, 1, type); @@ -22153,12 +22152,7 @@ void Player::SendInitialPacketsAfterAddToMap() // manual send package (have code in HandleEffect(this, AURA_EFFECT_HANDLE_SEND_FOR_CLIENT, true); that must not be re-applied. if (HasAuraType(SPELL_AURA_MOD_ROOT)) - { - WorldPacket data2(SMSG_MOVE_ROOT, 10); - data2.append(GetPackGUID()); - data2 << (uint32)2; - SendMessageToSet(&data2, true); - } + SendMoveRoot(2); SendAurasForTarget(this); SendEnchantmentDurations(); // must be after add to map diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 19d5ef5b3cd..7efe90a392d 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -12979,27 +12979,27 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) break; case MOVE_RUN: data.Initialize(SMSG_MOVE_SET_RUN_SPEED, 1 + 8 + 4 + 4 ); + data.WriteBit(bytes[6]); data.WriteBit(bytes[1]); - data.WriteBit(bytes[0]); - data.WriteBit(bytes[7]); data.WriteBit(bytes[5]); data.WriteBit(bytes[2]); - data.WriteBit(bytes[4]); + data.WriteBit(bytes[7]); + data.WriteBit(bytes[0]); data.WriteBit(bytes[3]); - data.WriteBit(bytes[6]); + data.WriteBit(bytes[4]); + data.WriteByteSeq(bytes[5]); + data.WriteByteSeq(bytes[3]); data.WriteByteSeq(bytes[1]); + data.WriteByteSeq(bytes[4]); + data << uint32(0); data << float(GetSpeed(mtype)); data.WriteByteSeq(bytes[6]); - data.WriteByteSeq(bytes[2]); - data.WriteByteSeq(bytes[3]); - data.WriteByteSeq(bytes[7]); - data.WriteByteSeq(bytes[4]); data.WriteByteSeq(bytes[0]); - data.WriteByteSeq(bytes[5]); - data << uint32(0); + data.WriteByteSeq(bytes[7]); + data.WriteByteSeq(bytes[2]); break; case MOVE_RUN_BACK: data.Initialize(SMSG_MOVE_SET_RUN_BACK_SPEED, 1 + 8 + 4 + 4 ); @@ -13026,25 +13026,25 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) break; case MOVE_SWIM: data.Initialize(SMSG_MOVE_SET_SWIM_SPEED, 1 + 8 + 4 + 4 ); + data.WriteBit(bytes[5]); + data.WriteBit(bytes[4]); data.WriteBit(bytes[7]); - data.WriteBit(bytes[2]); data.WriteBit(bytes[3]); - data.WriteBit(bytes[4]); - data.WriteBit(bytes[5]); - data.WriteBit(bytes[6]); - data.WriteBit(bytes[1]); + data.WriteBit(bytes[2]); data.WriteBit(bytes[0]); + data.WriteBit(bytes[1]); + data.WriteBit(bytes[6]); - data.WriteByteSeq(bytes[6]); - data.WriteByteSeq(bytes[4]); - data.WriteByteSeq(bytes[7]); data.WriteByteSeq(bytes[0]); - data << float(GetSpeed(mtype)); + data << uint32(0); + data.WriteByteSeq(bytes[6]); data.WriteByteSeq(bytes[3]); - data.WriteByteSeq(bytes[1]); data.WriteByteSeq(bytes[5]); data.WriteByteSeq(bytes[2]); - data << uint32(0); + data << float(GetSpeed(mtype)); + data.WriteByteSeq(bytes[1]); + data.WriteByteSeq(bytes[7]); + data.WriteByteSeq(bytes[4]); break; case MOVE_SWIM_BACK: data.Initialize(SMSG_MOVE_SET_SWIM_BACK_SPEED, 1 + 8 + 4 + 4 ); @@ -15892,6 +15892,13 @@ bool Unit::HandleAuraRaidProcFromCharge(AuraEffect* triggeredByAura) return true; } +void Unit::SendDurabilityLoss(Player* receiver, uint32 percent) +{ + WorldPacket data(SMSG_DURABILITY_DAMAGE_DEATH, 4); + data << uint32(percent); + receiver->GetSession()->SendPacket(percent); +} + void Unit::Kill(Unit* victim, bool durabilityLoss) { // Prevent killing unit twice (and giving reward from kill twice) @@ -16047,11 +16054,13 @@ void Unit::Kill(Unit* victim, bool durabilityLoss) // only if not player and not controlled by player pet. And not at BG if ((durabilityLoss && !player && !victim->ToPlayer()->InBattleground()) || (player && sWorld->getBoolConfig(CONFIG_DURABILITY_LOSS_IN_PVP))) { - sLog->outDebug(LOG_FILTER_UNITS, "We are dead, losing %f percent durability", sWorld->getRate(RATE_DURABILITY_LOSS_ON_DEATH)); - plrVictim->DurabilityLossAll(sWorld->getRate(RATE_DURABILITY_LOSS_ON_DEATH), false); + double baseLoss = sWorld->getRate(RATE_DURABILITY_LOSS_ON_DEATH); + uint32 loss = uint32(baseLoss - (baseLoss * plrVictim->GetTotalAuraMultiplier(MSPELL_AURA_MOD_DURABILITY_LOSS))); + sLog->outDebug(LOG_FILTER_UNITS, "We are dead, losing %u percent durability", loss); + // Durability loss is calculated more accurately again for each item in Player::DurabilityLoss + plrVictim->DurabilityLossAll(baseLoss, false); // durability lost message - WorldPacket data(SMSG_DURABILITY_DAMAGE_DEATH, 0); - plrVictim->GetSession()->SendPacket(&data); + SendDurabilityLoss(plrVictim, loss); } // Call KilledUnit for creatures if (GetTypeId() == TYPEID_UNIT && IsAIEnabled) @@ -16236,6 +16245,63 @@ void Unit::SetControlled(bool apply, UnitState state) } } +void Unit::SendMoveRoot(uint32 value) +{ + ObjectGuid guid = GetGUID(); + WorldPacket data(SMSG_MOVE_ROOT, 1 + 8 + 4); + data.WriteBit(guid[2]); + data.WriteBit(guid[7]); + data.WriteBit(guid[6]); + data.WriteBit(guid[0]); + data.WriteBit(guid[5]); + data.WriteBit(guid[4]); + data.WriteBit(guid[1]); + data.WriteBit(guid[3]); + + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[5]); + + data << uint32(value); + + + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[6]); + + SendMessageToSet(&data, true); +} + +void Unit::SendMoveUnroot(uint32 value) +{ + ObjectGuid guid = GetGUID(); + WorldPacket data(SMSG_MOVE_UNROOT, 1 + 8 + 4); + data.WriteBit(guid[0]); + data.WriteBit(guid[1]); + data.WriteBit(guid[3]); + data.WriteBit(guid[7]); + data.WriteBit(guid[5]); + data.WriteBit(guid[2]); + data.WriteBit(guid[4]); + data.WriteBit(guid[6]); + + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[6]); + data.WriteByteSeq(guid[1]); + + data << uint32(value); + + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[5]); + + SendMessageToSet(&data, true); +} + void Unit::SetStunned(bool apply) { if (apply) @@ -16255,10 +16321,7 @@ void Unit::SetStunned(bool apply) else SetStandState(UNIT_STAND_STATE_STAND); - WorldPacket data(SMSG_MOVE_ROOT, 8); - data.append(GetPackGUID()); - data << uint32(0); - SendMessageToSet(&data, true); + SendMoveRoot(0); CastStop(); } @@ -16274,11 +16337,7 @@ void Unit::SetStunned(bool apply) if (!HasUnitState(UNIT_STATE_ROOT)) // prevent moving if it also has root effect { - WorldPacket data(SMSG_MOVE_UNROOT, 8+4); - data.append(GetPackGUID()); - data << uint32(0); - SendMessageToSet(&data, true); - + SendMoveUnroot(0); RemoveUnitMovementFlag(MOVEMENTFLAG_ROOT); } } @@ -16298,12 +16357,7 @@ void Unit::SetRooted(bool apply) AddUnitMovementFlag(MOVEMENTFLAG_ROOT); if (GetTypeId() == TYPEID_PLAYER) - { - WorldPacket data(SMSG_MOVE_ROOT, 10); - data.append(GetPackGUID()); - data << m_rootTimes; - SendMessageToSet(&data, true); - } + SendMoveRoot(m_rootTimes); else { ObjectGuid guid = GetGUID(); @@ -16334,12 +16388,7 @@ void Unit::SetRooted(bool apply) if (!HasUnitState(UNIT_STATE_STUNNED)) // prevent moving if it also has stun effect { if (GetTypeId() == TYPEID_PLAYER) - { - WorldPacket data(SMSG_MOVE_UNROOT, 10); - data.append(GetPackGUID()); - data << ++m_rootTimes; - SendMessageToSet(&data, true); - } + SendMoveUnroot(++m_rootTimes); else { ObjectGuid guid = GetGUID(); diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 8fee3ed74e0..cf2f25898b6 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1406,6 +1406,8 @@ class Unit : public WorldObject void Dismount(); MountCapabilityEntry const* GetMountCapability(uint32 mountType) const; + void SendDurabilityLoss(Player* receiver, uint32 percent); + uint16 GetMaxSkillValueForLevel(Unit const* target = NULL) const { return (target ? getLevelForTarget(target) : getLevel()) * 5; } void DealDamageMods(Unit* victim, uint32 &damage, uint32* absorb); uint32 DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDamage = NULL, DamageEffectType damagetype = DIRECT_DAMAGE, SpellSchoolMask damageSchoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellInfo const* spellProto = NULL, bool durabilityLoss = true); @@ -2323,6 +2325,8 @@ class Unit : public WorldObject uint32 GetCombatRatingDamageReduction(CombatRating cr, float rate, float cap, uint32 damage) const; protected: + void SendMoveRoot(uint32 value); + void SendMoveUnroot(uint32 value); void SetFeared(bool apply); void SetConfused(bool apply); void SetStunned(bool apply); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 38340e61f10..4e7b7647a1f 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -580,7 +580,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(MSG_MOVE_TELEPORT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_TIME_SKIPPED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_TOGGLE_COLLISION_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_UNROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_TELEPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -752,7 +751,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_DAMAGE_CALC_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DANCE_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_DB_REPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DEATH_RELEASE_LOC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_DEATH_RELEASE_LOC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DEBUG_RUNE_REGEN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DEFENSE_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_DESTROY_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -772,12 +771,12 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_DUEL_REQUESTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_DUEL_WINNER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DUMP_RIDE_TICKETS_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DURABILITY_DAMAGE_DEATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_DURABILITY_DAMAGE_DEATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ECHO_PARTY_SQUELCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_EMOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_EMOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ENABLE_BARBER_SHOP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ENCHANTMENTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ENVIRONMENTALDAMAGELOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ENVIRONMENTALDAMAGELOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_EQUIPMENT_SET_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_EQUIPMENT_SET_SAVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_EQUIPMENT_SET_USE_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -979,7 +978,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_MOVE_KNOCK_BACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_LAND_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_NORMAL_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_ACTIVE_MOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -990,12 +989,12 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_RUN_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_SWIM_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_SWIM_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_SWIM_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index c54e77890f1..6184cf9b788 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -651,7 +651,6 @@ enum Opcodes MSG_MOVE_TOGGLE_COLLISION_CHEAT = 0x7B04, MSG_MOVE_TOGGLE_FALL_LOGGING = 0x0000, MSG_MOVE_TOGGLE_LOGGING = 0x0000, - MSG_MOVE_UNROOT = 0x7DB4, MSG_MOVE_UPDATE_CAN_FLY = 0x0000, MSG_MOVE_UPDATE_FLIGHT_SPEED = 0x30B1, MSG_MOVE_UPDATE_MOUSE = 0x0000, diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index eb81e1f7412..f7afab7ceb0 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -391,7 +391,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleNULL, //335 SPELL_AURA_335 &AuraEffect::HandleNULL, //336 SPELL_AURA_MOD_FLYING_RESTRICTIONS &AuraEffect::HandleNULL, //337 SPELL_AURA_MOD_VENDOR_ITEMS_PRICES - &AuraEffect::HandleNULL, //338 SPELL_AURA_MOD_DURABILITY_LOSS + &AuraEffect::HandleNoImmediateEffect, //338 SPELL_AURA_MOD_DURABILITY_LOSS &AuraEffect::HandleNULL, //339 SPELL_AURA_INCREASE_SKILL_GAIN_CHANCE &AuraEffect::HandleNULL, //340 SPELL_AURA_340 &AuraEffect::HandleNULL, //341 SPELL_AURA_341 -- cgit v1.2.3 From 4d465f78dab55c31bf2f2211d07595cf756509c3 Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 9 Aug 2012 12:57:55 +0100 Subject: Core: Add missing FlushBits and fix some typos (/slap subv) --- src/server/game/Entities/Player/Player.cpp | 1 + src/server/game/Entities/Unit/Unit.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 3d4250d5a44..29d12953193 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -16284,6 +16284,7 @@ void Player::SendQuestReward(Quest const* quest, uint32 XP, Object* questGiver) data.WriteBit(0); // FIXME: unknown bits, common values sent data.WriteBit(1); + data.FlushBits(); GetSession()->SendPacket(&data); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 7efe90a392d..7e19a97ac5b 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -15896,7 +15896,7 @@ void Unit::SendDurabilityLoss(Player* receiver, uint32 percent) { WorldPacket data(SMSG_DURABILITY_DAMAGE_DEATH, 4); data << uint32(percent); - receiver->GetSession()->SendPacket(percent); + receiver->GetSession()->SendPacket(&data); } void Unit::Kill(Unit* victim, bool durabilityLoss) @@ -16055,7 +16055,7 @@ void Unit::Kill(Unit* victim, bool durabilityLoss) if ((durabilityLoss && !player && !victim->ToPlayer()->InBattleground()) || (player && sWorld->getBoolConfig(CONFIG_DURABILITY_LOSS_IN_PVP))) { double baseLoss = sWorld->getRate(RATE_DURABILITY_LOSS_ON_DEATH); - uint32 loss = uint32(baseLoss - (baseLoss * plrVictim->GetTotalAuraMultiplier(MSPELL_AURA_MOD_DURABILITY_LOSS))); + uint32 loss = uint32(baseLoss - (baseLoss * plrVictim->GetTotalAuraMultiplier(SPELL_AURA_MOD_DURABILITY_LOSS))); sLog->outDebug(LOG_FILTER_UNITS, "We are dead, losing %u percent durability", loss); // Durability loss is calculated more accurately again for each item in Player::DurabilityLoss plrVictim->DurabilityLossAll(baseLoss, false); -- cgit v1.2.3 From 34ae09f3a81e5504723a72704fac081b390318c4 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 9 Aug 2012 18:07:12 +0200 Subject: Core/Spells: Implemented SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS --- src/server/game/Entities/Player/Player.h | 15 ++++++++ src/server/game/Handlers/SpellHandler.cpp | 6 ++- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 47 ++++++++++++++++++++++- src/server/game/Spells/Auras/SpellAuraEffects.h | 1 + src/server/game/Spells/Auras/SpellAuras.cpp | 11 +----- src/server/game/Spells/SpellInfo.h | 2 +- src/server/game/Spells/SpellMgr.cpp | 7 +++- 7 files changed, 74 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index e785a7aa537..ccdea8654e8 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -2605,6 +2605,19 @@ class Player : public Unit, public GridObject VoidStorageItem* GetVoidStorageItem(uint8 slot) const; VoidStorageItem* GetVoidStorageItem(uint64 id, uint8& slot) const; + // SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS handling + void AddSpellSwap(uint32 oldSpell, uint32 newSpell) { _spellSwaps[oldSpell] = newSpell; } + void RemoveSpellSwap(uint32 originalSpell) { _spellSwaps.erase(originalSpell); } + + uint32 GetSpellForCast(uint32 spellId) const + { + std::map::const_iterator itr = _spellSwaps.find(spellId); + if (itr != _spellSwaps.end()) + return itr->second; + + return spellId; + } + protected: // Gamemaster whisper whitelist WhisperListContainer WhisperList; @@ -2933,6 +2946,8 @@ class Player : public Unit, public GridObject InstanceTimeMap _instanceResetTimes; uint32 _pendingBindId; uint32 _pendingBindTimer; + + std::map _spellSwaps; }; void AddItemsSetItem(Player*player, Item* item); diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp index 31cce5b7239..b772db626f0 100755 --- a/src/server/game/Handlers/SpellHandler.cpp +++ b/src/server/game/Handlers/SpellHandler.cpp @@ -350,8 +350,10 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket) return; } - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId); + if (Player* plrMover = mover->ToPlayer()) + spellId = plrMover->GetSpellForCast(spellId); + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId); if (!spellInfo) { sLog->outError(LOG_FILTER_NETWORKIO, "WORLD: unknown spell id %u", spellId); @@ -362,7 +364,7 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket) if (mover->GetTypeId() == TYPEID_PLAYER) { // not have spell in spellbook or spell passive and not casted by client - if (!mover->ToPlayer()->HasActiveSpell (spellId) || spellInfo->IsPassive()) + if (!mover->ToPlayer()->HasActiveSpell(spellId) || spellInfo->IsPassive()) { //cheater? kick? ban? recvPacket.rfinish(); // prevent spam at ignore packet diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index f7afab7ceb0..4ce914cfdc5 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -385,8 +385,8 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleNULL, //329 SPELL_AURA_MOD_RUNE_REGEN_SPEED &AuraEffect::HandleNULL, //330 SPELL_AURA_CAST_WHILE_WALKING &AuraEffect::HandleNULL, //331 SPELL_AURA_331 - &AuraEffect::HandleNULL, //332 SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS - &AuraEffect::HandleNULL, //333 SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS_2 + &AuraEffect::HandleOverrideActionbar, //332 SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS + &AuraEffect::HandleOverrideActionbar, //333 SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS_2 &AuraEffect::HandleNULL, //334 SPELL_AURA_334 &AuraEffect::HandleNULL, //335 SPELL_AURA_335 &AuraEffect::HandleNULL, //336 SPELL_AURA_MOD_FLYING_RESTRICTIONS @@ -5675,6 +5675,49 @@ void AuraEffect::HandlePreventResurrection(AuraApplication const* aurApp, uint8 aurApp->GetTarget()->SetByteFlag(PLAYER_FIELD_BYTES, 0, PLAYER_FIELD_BYTE_RELEASE_TIMER); } +void AuraEffect::HandleOverrideActionbar(AuraApplication const* aurApp, uint8 mode, bool apply) const +{ + if (!(mode & AURA_EFFECT_HANDLE_REAL)) + return; + + Player* target = aurApp->GetTarget()->ToPlayer(); + if (!target) + return; + + uint32 newSpellId = uint32(GetAmount()); + if (!sSpellMgr->GetSpellInfo(newSpellId)) + return; + + bool foundAny = false; + PlayerSpellMap const& spells = target->GetSpellMap(); + for (PlayerSpellMap::const_iterator itr = spells.begin(); itr != spells.end(); ++itr) + { + if (itr->second->state == PLAYERSPELL_REMOVED) + continue; + + if (!itr->second->active || itr->second->disabled) + continue; + + SpellInfo const* info = sSpellMgr->GetSpellInfo(itr->first); + if (!IsAffectingSpell(info)) + continue; + + foundAny = true; + if (apply) + target->AddSpellSwap(itr->first, newSpellId); + else + target->RemoveSpellSwap(itr->first); + } + + if (foundAny) + { + if (apply) + target->AddTemporarySpell(newSpellId); + else + target->RemoveTemporarySpell(newSpellId); + } +} + void AuraEffect::HandlePeriodicDummyAuraTick(Unit* target, Unit* caster) const { switch (GetSpellInfo()->SpellFamilyName) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.h b/src/server/game/Spells/Auras/SpellAuraEffects.h index 28a5beafa2c..5a85012f857 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.h +++ b/src/server/game/Spells/Auras/SpellAuraEffects.h @@ -280,6 +280,7 @@ class AuraEffect void HandleAuraOverrideSpells(AuraApplication const* aurApp, uint8 mode, bool apply) const; void HandleAuraSetVehicle(AuraApplication const* aurApp, uint8 mode, bool apply) const; void HandlePreventResurrection(AuraApplication const* aurApp, uint8 mode, bool apply) const; + void HandleOverrideActionbar(AuraApplication const* aurApp, uint8 mode, bool apply) const; // aura effect periodic tick handlers void HandlePeriodicDummyAuraTick(Unit* target, Unit* caster) const; diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 3394d46fadf..be3f33bb5f1 100755 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -148,15 +148,8 @@ void AuraApplication::_InitFlags(Unit* caster, uint8 effMask) _flags |= positiveFound ? AFLAG_POSITIVE : AFLAG_NEGATIVE; } - // there are more auras that require this flag, this is just the beginning - for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) - { - if (((1 << i) & effMask) && GetBase()->GetSpellInfo()->Effects[i].ApplyAuraName == SPELL_AURA_MOUNTED) - { - _flags |= AFLAG_ANY_EFFECT_AMOUNT_SENT; - break; - } - } + if (GetBase()->GetSpellInfo()->AttributesCu & SPELL_ATTR0_CU_SCALABLE) + _flags |= AFLAG_ANY_EFFECT_AMOUNT_SENT; } void AuraApplication::_HandleEffect(uint8 effIndex, bool apply) diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h index a338b8d627f..46f9906c4de 100644 --- a/src/server/game/Spells/SpellInfo.h +++ b/src/server/game/Spells/SpellInfo.h @@ -175,7 +175,7 @@ enum SpellCustomAttributes SPELL_ATTR0_CU_CONE_LINE = 0x00000004, SPELL_ATTR0_CU_SHARE_DAMAGE = 0x00000008, SPELL_ATTR0_CU_NO_INITIAL_THREAT = 0x00000010, - SPELL_ATTR0_CU_NONE2 = 0x00000020, // UNUSED + SPELL_ATTR0_CU_SCALABLE = 0x00000020, SPELL_ATTR0_CU_AURA_CC = 0x00000040, SPELL_ATTR0_CU_DIRECT_DAMAGE = 0x00000100, SPELL_ATTR0_CU_CHARGE = 0x00000200, diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index e887f8caa22..a1df9b997ef 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -2612,7 +2612,7 @@ void SpellMgr::LoadSpellInfoStore() mSpellInfoMap[i] = new SpellInfo(spellEntry); } - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded spell custom attributes in %u ms", GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded spell info store in %u ms", GetMSTimeDiffToNow(oldMSTime)); } @@ -2670,6 +2670,11 @@ void SpellMgr::LoadSpellCustomAttr() case SPELL_AURA_POWER_BURN: spellInfo->AttributesCu |= SPELL_ATTR0_CU_NO_INITIAL_THREAT; break; + case SPELL_AURA_MOUNTED: + case SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS: + case SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS_2: + spellInfo->AttributesCu |= SPELL_ATTR0_CU_SCALABLE; + break; } switch (spellInfo->Effects[j].Effect) -- cgit v1.2.3 From bb838307ea1961af634b0dc70aaf437a2e0a7230 Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 9 Aug 2012 18:53:56 +0100 Subject: Core/PacketIO: Enable SMSG_LOOT_RESPONSE TODO: Implement currency looting (on it) --- src/server/game/Loot/LootMgr.cpp | 17 ++++++++++------- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index bd331fcc22b..3259cdbadbf 100755 --- a/src/server/game/Loot/LootMgr.cpp +++ b/src/server/game/Loot/LootMgr.cpp @@ -794,21 +794,23 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv) { if (lv.permission == NONE_PERMISSION) { - b << uint32(0); //gold + b << uint32(0); // gold b << uint8(0); // item count - return b; // nothing output more + b << uint8(0); // currency count + return b; } Loot &l = lv.loot; uint8 itemsShown = 0; + uint8 currenciesShown = 0; - //gold - b << uint32(l.gold); + b << uint32(l.gold); //gold size_t count_pos = b.wpos(); // pos of item count byte b << uint8(0); // item count placeholder - b << uint8(0); // Currency count + size_t currency_count_pos = b.wpos(); // pos of currency count byte + b << uint8(0); // currency count placeholder switch (lv.permission) { @@ -888,7 +890,7 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv) break; } default: - return b; // nothing output more + return b; } LootSlotType slotType = lv.permission == OWNER_PERMISSION ? LOOT_SLOT_TYPE_OWNER : LOOT_SLOT_TYPE_ALLOW_LOOT; @@ -986,8 +988,9 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv) } } - //update number of items shown + //update number of items and currencies shown b.put(count_pos, itemsShown); + b.put(currency_count_pos, currenciesShown); return b; } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 4e7b7647a1f..068ebf832c3 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -948,7 +948,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_LOOT_MONEY_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LOOT_RELEASE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LOOT_REMOVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LOOT_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOOT_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LOOT_ROLL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LOOT_ROLL_WON, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LOOT_SLOT_CHANGED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From 0b10cc40c2546c156756fff76d11e72e25f5d261 Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 9 Aug 2012 21:20:05 +0100 Subject: Core: Fix some bad casts when reading bytebuffer data --- src/server/game/Handlers/ItemHandler.cpp | 4 ++-- src/server/game/Handlers/VoidStorageHandler.cpp | 2 +- src/server/game/Tickets/TicketMgr.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index ce85a0b1ef7..a5092f1e370 100644 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -1484,7 +1484,7 @@ void WorldSession::HandleTransmogrifyItems(WorldPacket& recvData) for (uint32 i = 0; i < count; ++i) { - recvData >> uint32(newEntries[i]); + recvData >> newEntries[i]; recvData.ReadByteSeq(itemGuids[i][1]); recvData.ReadByteSeq(itemGuids[i][5]); @@ -1495,7 +1495,7 @@ void WorldSession::HandleTransmogrifyItems(WorldPacket& recvData) recvData.ReadByteSeq(itemGuids[i][3]); recvData.ReadByteSeq(itemGuids[i][2]); - recvData >> uint32(slots[i]); + recvData >> slots[i]; } recvData.ReadByteSeq(npcGuid[7]); diff --git a/src/server/game/Handlers/VoidStorageHandler.cpp b/src/server/game/Handlers/VoidStorageHandler.cpp index d937656cf31..f89bcf6e0d0 100644 --- a/src/server/game/Handlers/VoidStorageHandler.cpp +++ b/src/server/game/Handlers/VoidStorageHandler.cpp @@ -483,7 +483,7 @@ void WorldSession::HandleVoidSwapItem(WorldPacket& recvData) ObjectGuid npcGuid; ObjectGuid itemId; - recvData >> uint32(newSlot); + recvData >> newSlot; npcGuid[2] = recvData.ReadBit(); npcGuid[4] = recvData.ReadBit(); diff --git a/src/server/game/Tickets/TicketMgr.cpp b/src/server/game/Tickets/TicketMgr.cpp index fc64a4b8b52..0956a950814 100755 --- a/src/server/game/Tickets/TicketMgr.cpp +++ b/src/server/game/Tickets/TicketMgr.cpp @@ -53,7 +53,7 @@ GmTicket::GmTicket(Player* player, WorldPacket& recvData) : _createTime(time(NUL recvData.rfinish(); /* - recvData >> uint32(count); // text lines + recvData >> count; // text lines for (int i = 0; i < count; i++) recvData >> uint32(); -- cgit v1.2.3 From 99d4a1093b712d8e6a1c82b2170b921f4f66b571 Mon Sep 17 00:00:00 2001 From: Subv Date: Thu, 9 Aug 2012 18:46:59 -0500 Subject: Core/PacketIO: Enabled/Fixed more opcodes --- src/server/game/Handlers/CharacterHandler.cpp | 6 +- src/server/game/Handlers/GroupHandler.cpp | 2 +- src/server/game/Handlers/GuildHandler.cpp | 2 +- src/server/game/Handlers/ItemHandler.cpp | 2 +- src/server/game/Handlers/MiscHandler.cpp | 10 ++-- src/server/game/Handlers/QueryHandler.cpp | 2 +- src/server/game/Handlers/SpellHandler.cpp | 2 +- src/server/game/Handlers/TaxiHandler.cpp | 11 ++-- src/server/game/Handlers/VehicleHandler.cpp | 12 ++-- src/server/game/Movement/MovementStructures.h | 82 +++++++++++++++++++++++++++ src/server/game/Server/Protocol/Opcodes.cpp | 44 +++++++------- 11 files changed, 127 insertions(+), 48 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index b73901c29a5..17da692c305 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -1128,13 +1128,13 @@ void WorldSession::HandleTutorialFlag(WorldPacket & recvData) SetTutorialInt(index, flag); } -void WorldSession::HandleTutorialClear(WorldPacket & /*recvData*/) +void WorldSession::HandleTutorialClear(WorldPacket& /*recvData*/) { for (uint8 i = 0; i < MAX_ACCOUNT_TUTORIAL_VALUES; ++i) SetTutorialInt(i, 0xFFFFFFFF); } -void WorldSession::HandleTutorialReset(WorldPacket & /*recvData*/) +void WorldSession::HandleTutorialReset(WorldPacket& /*recvData*/) { for (uint8 i = 0; i < MAX_ACCOUNT_TUTORIAL_VALUES; ++i) SetTutorialInt(i, 0x00000000); @@ -1365,7 +1365,7 @@ void WorldSession::HandleSetPlayerDeclinedNames(WorldPacket& recvData) SendPacket(&data); } -void WorldSession::HandleAlterAppearance(WorldPacket & recvData) +void WorldSession::HandleAlterAppearance(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ALTER_APPEARANCE"); diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp index 7bdd51baf8f..5b3c82a6f16 100644 --- a/src/server/game/Handlers/GroupHandler.cpp +++ b/src/server/game/Handlers/GroupHandler.cpp @@ -397,7 +397,7 @@ void WorldSession::HandleGroupInviteResponseOpcode(WorldPacket& recvData) } } -void WorldSession::HandleGroupUninviteGuidOpcode(WorldPacket & recvData) +void WorldSession::HandleGroupUninviteGuidOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_UNINVITE_GUID"); diff --git a/src/server/game/Handlers/GuildHandler.cpp b/src/server/game/Handlers/GuildHandler.cpp index 73631e2f003..2eb95dbba87 100755 --- a/src/server/game/Handlers/GuildHandler.cpp +++ b/src/server/game/Handlers/GuildHandler.cpp @@ -445,7 +445,7 @@ void WorldSession::HandleGuildPermissions(WorldPacket& /* recvData */) } // Called when clicking on Guild bank gameobject -void WorldSession::HandleGuildBankerActivate(WorldPacket & recvData) +void WorldSession::HandleGuildBankerActivate(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (CMSG_GUILD_BANKER_ACTIVATE)"); diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index a5092f1e370..9a8ab497d88 100644 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -111,7 +111,7 @@ void WorldSession::HandleAutoEquipItemSlotOpcode(WorldPacket& recvData) _player->SwapItem(item->GetPos(), dstpos); } -void WorldSession::HandleSwapItem(WorldPacket & recvData) +void WorldSession::HandleSwapItem(WorldPacket& recvData) { //sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_SWAP_ITEM"); uint8 dstbag, dstslot, srcbag, srcslot; diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 75c46b57077..7803a69587f 100644 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -451,7 +451,7 @@ void WorldSession::HandleLogoutCancelOpcode(WorldPacket & /*recvData*/) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_LOGOUT_CANCEL_ACK Message"); } -void WorldSession::HandleTogglePvP(WorldPacket & recvData) +void WorldSession::HandleTogglePvP(WorldPacket& recvData) { // this opcode can be used in two ways: Either set explicit new status or toggle old status if (recvData.size() == 1) @@ -693,7 +693,7 @@ void WorldSession::HandleDelIgnoreOpcode(WorldPacket & recvData) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent motd (SMSG_FRIEND_STATUS)"); } -void WorldSession::HandleSetContactNotesOpcode(WorldPacket & recvData) +void WorldSession::HandleSetContactNotesOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_SET_CONTACT_NOTES"); uint64 guid; @@ -764,7 +764,7 @@ void WorldSession::HandleReclaimCorpseOpcode(WorldPacket& recvData) GetPlayer()->SpawnCorpseBones(); } -void WorldSession::HandleResurrectResponseOpcode(WorldPacket & recvData) +void WorldSession::HandleResurrectResponseOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_RESURRECT_RESPONSE"); @@ -1496,7 +1496,7 @@ void WorldSession::HandleTimeSyncResp(WorldPacket& recvData) _player->m_timeSyncClient = clientTicks; } -void WorldSession::HandleResetInstancesOpcode(WorldPacket & /*recvData*/) +void WorldSession::HandleResetInstancesOpcode(WorldPacket& /*recvData*/) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_RESET_INSTANCES"); @@ -1663,7 +1663,7 @@ void WorldSession::HandleMoveSetCanFlyAckOpcode(WorldPacket & recvData) _player->m_mover->m_movementInfo.flags = movementInfo.GetMovementFlags(); } -void WorldSession::HandleRequestPetInfoOpcode(WorldPacket & /*recvData */) +void WorldSession::HandleRequestPetInfoOpcode(WorldPacket& /*recvData */) { /* sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_REQUEST_PET_INFO"); diff --git a/src/server/game/Handlers/QueryHandler.cpp b/src/server/game/Handlers/QueryHandler.cpp index 63035a5095f..6ee11e4936d 100755 --- a/src/server/game/Handlers/QueryHandler.cpp +++ b/src/server/game/Handlers/QueryHandler.cpp @@ -348,7 +348,7 @@ void WorldSession::HandleNpcTextQueryOpcode(WorldPacket & recvData) } /// Only _static_ data is sent in this packet !!! -void WorldSession::HandlePageTextQueryOpcode(WorldPacket & recvData) +void WorldSession::HandlePageTextQueryOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_PAGE_TEXT_QUERY"); diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp index b772db626f0..8369fcde064 100755 --- a/src/server/game/Handlers/SpellHandler.cpp +++ b/src/server/game/Handlers/SpellHandler.cpp @@ -548,7 +548,7 @@ void WorldSession::HandleTotemDestroyed(WorldPacket& recvPacket) totem->ToTotem()->UnSummon(); } -void WorldSession::HandleSelfResOpcode(WorldPacket & /*recvData*/) +void WorldSession::HandleSelfResOpcode(WorldPacket& /*recvData*/) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_SELF_RES"); // empty opcode diff --git a/src/server/game/Handlers/TaxiHandler.cpp b/src/server/game/Handlers/TaxiHandler.cpp index 16ffdfbc440..175ea28a424 100755 --- a/src/server/game/Handlers/TaxiHandler.cpp +++ b/src/server/game/Handlers/TaxiHandler.cpp @@ -28,7 +28,7 @@ #include "Path.h" #include "WaypointMovementGenerator.h" -void WorldSession::HandleTaxiNodeStatusQueryOpcode(WorldPacket & recvData) +void WorldSession::HandleTaxiNodeStatusQueryOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_TAXINODE_STATUS_QUERY"); @@ -63,7 +63,7 @@ void WorldSession::SendTaxiStatus(uint64 guid) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_TAXINODE_STATUS"); } -void WorldSession::HandleTaxiQueryAvailableNodes(WorldPacket & recvData) +void WorldSession::HandleTaxiQueryAvailableNodes(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_TAXIQUERYAVAILABLENODES"); @@ -199,14 +199,11 @@ void WorldSession::HandleMoveSplineDoneOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_MOVE_SPLINE_DONE"); - uint64 guid; // used only for proper packet read - recvData.readPackGUID(guid); - + recvData.read_skip(); // unk + MovementInfo movementInfo; // used only for proper packet read ReadMovementInfo(recvData, &movementInfo); - recvData.read_skip(); // unk - // in taxi flight packet received in 2 case: // 1) end taxi path in far (multi-node) flight // 2) switch from one map to other in case multim-map taxi path diff --git a/src/server/game/Handlers/VehicleHandler.cpp b/src/server/game/Handlers/VehicleHandler.cpp index c8fca388478..464af1d03d7 100644 --- a/src/server/game/Handlers/VehicleHandler.cpp +++ b/src/server/game/Handlers/VehicleHandler.cpp @@ -67,7 +67,7 @@ void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket& recvData) recvData.GetOpcode(), GetPlayer()->GetGUIDLow(), seat->m_flags); return; } - /* + switch (recvData.GetOpcode()) { case CMSG_REQUEST_VEHICLE_PREV_SEAT: @@ -76,7 +76,7 @@ void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket& recvData) case CMSG_REQUEST_VEHICLE_NEXT_SEAT: GetPlayer()->ChangeSeat(-1, true); break; - case CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE: + /*case CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE: { uint64 guid; // current vehicle guid recvData.readPackGUID(guid); @@ -103,7 +103,7 @@ void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket& recvData) vehUnit->HandleSpellClick(GetPlayer(), seatId); } break; - } + }*/ case CMSG_REQUEST_VEHICLE_SWITCH_SEAT: { uint64 guid; // current vehicle guid @@ -122,10 +122,10 @@ void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket& recvData) } default: break; - }*/ + } } -void WorldSession::HandleEnterPlayerVehicle(WorldPacket &data) +void WorldSession::HandleEnterPlayerVehicle(WorldPacket& data) { // Read guid uint64 guid; @@ -144,7 +144,7 @@ void WorldSession::HandleEnterPlayerVehicle(WorldPacket &data) } } -void WorldSession::HandleEjectPassenger(WorldPacket &data) +void WorldSession::HandleEjectPassenger(WorldPacket& data) { Vehicle* vehicle = _player->GetVehicleKit(); if (!vehicle) diff --git a/src/server/game/Movement/MovementStructures.h b/src/server/game/Movement/MovementStructures.h index 0241edc1706..c75229c75be 100644 --- a/src/server/game/Movement/MovementStructures.h +++ b/src/server/game/Movement/MovementStructures.h @@ -1854,6 +1854,86 @@ MovementStatusElements MoveChngTransport[]= MSEEnd, }; +// 4.3.4 +MovementStatusElements MoveSplineDone[] = +{ + MSEPositionY, + MSEPositionX, + MSEPositionZ, + MSEHasGuidByte6, + MSEHasOrientation, + MSEHasFallData, + MSEHasTimestamp, + MSEHasGuidByte2, + MSEHasSplineElevation, + MSEHasGuidByte4, + MSEHasTransportData, + MSEHasGuidByte3, + MSEHasMovementFlags, + MSEHasGuidByte0, + MSEZeroBit, + MSEHasGuidByte1, + MSEHasGuidByte5, + MSEHasPitch, + MSEHasSpline, + MSEHasMovementFlags2, + MSEHasGuidByte7, + + MSEHasTransportGuidByte1, + MSEHasTransportGuidByte7, + MSEHasTransportGuidByte5, + MSEHasTransportGuidByte3, + MSEHasTransportGuidByte4, + MSEHasTransportGuidByte6, + MSEHasTransportTime2, + MSEHasTransportGuidByte2, + MSEHasTransportTime3, + MSEHasTransportGuidByte0, + + MSEHasFallDirection, + MSEMovementFlags2, + MSEMovementFlags, + + MSEGuidByte7, + MSEGuidByte4, + MSEGuidByte5, + MSEGuidByte6, + MSEGuidByte0, + MSEGuidByte1, + MSEGuidByte2, + MSEGuidByte3, + + MSEFallVerticalSpeed, + MSEFallSinAngle, + MSEFallCosAngle, + MSEFallHorizontalSpeed, + MSEFallTime, + + MSEPitch, + MSEOrientation, + + MSETransportGuidByte1, + MSETransportTime3, + MSETransportGuidByte7, + MSETransportTime, + MSETransportPositionY, + MSETransportPositionX, + MSETransportPositionZ, + MSETransportSeat, + MSETransportOrientation, + MSETransportGuidByte0, + MSETransportTime2, + MSETransportGuidByte2, + MSETransportGuidByte3, + MSETransportGuidByte5, + MSETransportGuidByte6, + MSETransportGuidByte4, + + MSETimestamp, + MSESplineElevation, + MSEEnd, +}; + MovementStatusElements* GetMovementStatusElementsSequence(Opcodes opcode) { switch (opcode) @@ -1906,6 +1986,8 @@ MovementStatusElements* GetMovementStatusElementsSequence(Opcodes opcode) return PlayerMoveSequence; case CMSG_MOVE_CHNG_TRANSPORT: return MoveChngTransport; + case CMSG_MOVE_SPLINE_DONE: + return MoveSplineDone; default: break; } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 068ebf832c3..3880809e5c0 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -191,7 +191,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_DUNGEON_FINDER_GET_SYSTEM_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_EJECT_PASSENGER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEmoteOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_ENABLETAXI, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleTaxiQueryAvailableNodes ); + DEFINE_OPCODE_HANDLER(CMSG_ENABLETAXI, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleTaxiQueryAvailableNodes ); DEFINE_OPCODE_HANDLER(CMSG_ENABLE_NAGLE, STATUS_NEVER , PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); DEFINE_OPCODE_HANDLER(CMSG_EQUIPMENT_SET_SAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetSave ); DEFINE_OPCODE_HANDLER(CMSG_EQUIPMENT_SET_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetUse ); @@ -203,7 +203,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJ_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGameObjectUseOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GET_MAIL_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGetMailList ); DEFINE_OPCODE_HANDLER(CMSG_GET_MIRRORIMAGE_DATA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMirrorImageDataRequest ); - //DEFINE_OPCODE_HANDLER(CMSG_GMRESPONSE_RESOLVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMResponseResolve ); + DEFINE_OPCODE_HANDLER(CMSG_GMRESPONSE_RESOLVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMResponseResolve ); //DEFINE_OPCODE_HANDLER(CMSG_GMSURVEY_SUBMIT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMSurveySubmit ); //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_CREATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketCreateOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_DELETETICKET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketDeleteOpcode ); @@ -224,13 +224,13 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_GROUP_SET_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupSetLeaderOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_SET_ROLES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_SWAP_SUB_GROUP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupSwapSubGroupOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GROUP_UNINVITE_GUID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupUninviteGuidOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GROUP_UNINVITE_GUID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupUninviteGuidOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildAcceptOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_ACHIEVEMENT_MEMBERS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_ACHIEVEMENT_PROGRESS_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildAchievementProgressQuery); DEFINE_OPCODE_HANDLER(CMSG_GUILD_ADD_RANK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildAddRankOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_ASSIGN_MEMBER_RANK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildAssignRankOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANKER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankerActivate ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANKER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankerActivate ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_BUY_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankBuyTab ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_DEPOSIT_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankDepositMoney ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_LOG_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -360,7 +360,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_CAN_FLY_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveSetCanFlyAckOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_COLLISION_HEIGHT_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SPLINE_DONE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveSplineDoneOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MOVE_SPLINE_DONE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveSplineDoneOpcode ); DEFINE_OPCODE_HANDLER(CMSG_MOVE_TIME_SKIPPED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleMoveTimeSkippedOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_MOVE_WATER_WALK_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveWaterWalkAck ); DEFINE_OPCODE_HANDLER(CMSG_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNameQueryOpcode ); @@ -370,7 +370,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_OBJECT_UPDATE_RESCUED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_OFFER_PETITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleOfferPetitionOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_OPENING_CINEMATIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_OPEN_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleOpenItemOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_OPEN_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleOpenItemOpcode ); DEFINE_OPCODE_HANDLER(CMSG_OPT_OUT_OF_LOOT, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleOptOutOfLootOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_PAGE_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePageTextQueryOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_PARTY_SILENCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -393,7 +393,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_PING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); DEFINE_OPCODE_HANDLER(CMSG_PLAYED_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayedTime ); DEFINE_OPCODE_HANDLER(CMSG_PLAYER_LOGIN, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayerLoginOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_PLAYER_VEHICLE_ENTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEnterPlayerVehicle ); + DEFINE_OPCODE_HANDLER(CMSG_PLAYER_VEHICLE_ENTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEnterPlayerVehicle ); //DEFINE_OPCODE_HANDLER(CMSG_PLAY_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_PUSHQUESTTOPARTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePushQuestToParty ); //DEFINE_OPCODE_HANDLER(CMSG_PVP_LOG_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -446,16 +446,16 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RATED_BG_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RESEARCH_HISTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_EXIT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestVehicleExit ); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_NEXT_SEAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_PREV_SEAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); + DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_NEXT_SEAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); + DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_PREV_SEAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_SWITCH_SEAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); - //DEFINE_OPCODE_HANDLER(CMSG_RESET_FACTION_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_RESET_INSTANCES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleResetInstancesOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_RESURRECT_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleResurrectResponseOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_RESET_FACTION_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_RESET_INSTANCES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleResetInstancesOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_RESURRECT_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleResurrectResponseOpcode ); DEFINE_OPCODE_HANDLER(CMSG_RETURN_TO_GRAVEYARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReturnToGraveyard ); //DEFINE_OPCODE_HANDLER(CMSG_ROLE_POLL_BEGIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SAVE_CUF_PROFILES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SELF_RES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSelfResOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_SELF_RES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSelfResOpcode ); DEFINE_OPCODE_HANDLER(CMSG_SELL_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSellItemOpcode ); DEFINE_OPCODE_HANDLER(CMSG_SEND_MAIL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSendMail ); //DEFINE_OPCODE_HANDLER(CMSG_SEND_SOR_REQUEST_VIA_ADDRESS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -468,13 +468,13 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_SET_ALLOW_LOW_LEVEL_RAID1, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_ALLOW_LOW_LEVEL_RAID2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_CHANNEL_WATCH, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetChannelWatch ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_CONTACT_NOTES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetContactNotesOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_SET_CONTACT_NOTES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetContactNotesOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SET_CURRENCY_FLAGS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_EVERYONE_IS_ASSISTANT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_SET_FACTION_ATWAR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetFactionAtWar ); DEFINE_OPCODE_HANDLER(CMSG_SET_FACTION_INACTIVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetFactionInactiveOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SET_PET_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_PLAYER_DECLINED_NAMES, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetPlayerDeclinedNames ); + DEFINE_OPCODE_HANDLER(CMSG_SET_PLAYER_DECLINED_NAMES, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetPlayerDeclinedNames ); //DEFINE_OPCODE_HANDLER(CMSG_SET_PREFERED_CEMETERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_PRIMARY_TALENT_TREE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_RELATIVE_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -498,27 +498,27 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_SUBMIT_BUG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SUBMIT_COMPLAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SUGGESTION_SUBMIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SUMMON_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSummonResponseOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_SUMMON_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSummonResponseOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SUSPEND_TOKEN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_SWAP_INV_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSwapInvItemOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_SWAP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSwapItem ); + DEFINE_OPCODE_HANDLER(CMSG_SWAP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSwapItem ); //DEFINE_OPCODE_HANDLER(CMSG_SYNC_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_TAXINODE_STATUS_QUERY, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleTaxiNodeStatusQueryOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_TAXIQUERYAVAILABLENODES, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleTaxiQueryAvailableNodes ); + DEFINE_OPCODE_HANDLER(CMSG_TAXINODE_STATUS_QUERY, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleTaxiNodeStatusQueryOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_TAXIQUERYAVAILABLENODES, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleTaxiQueryAvailableNodes ); //DEFINE_OPCODE_HANDLER(CMSG_TELEPORT_TO_UNIT, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_TEXT_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTextEmoteOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_TIME_ADJUSTMENT_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_TIME_SYNC_RESP, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleTimeSyncResp ); //DEFINE_OPCODE_HANDLER(CMSG_TIME_SYNC_RESP_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_TOGGLE_PVP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTogglePvP ); + DEFINE_OPCODE_HANDLER(CMSG_TOGGLE_PVP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTogglePvP ); //DEFINE_OPCODE_HANDLER(CMSG_TOTEM_DESTROYED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTotemDestroyed ); DEFINE_OPCODE_HANDLER(CMSG_TRAINER_BUY_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerBuySpellOpcode ); DEFINE_OPCODE_HANDLER(CMSG_TRAINER_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerListOpcode ); DEFINE_OPCODE_HANDLER(CMSG_TRANSMOGRIFY_ITEMS, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleTransmogrifyItems ); DEFINE_OPCODE_HANDLER(CMSG_TURN_IN_PETITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTurnInPetitionOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_CLEAR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialClear ); + DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_CLEAR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialClear ); DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_FLAG, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialFlag ); - //DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_RESET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialReset ); + DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_RESET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialReset ); DEFINE_OPCODE_HANDLER(CMSG_UNACCEPT_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnacceptTradeOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_SKILL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnlearnSkillOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_SPECIALIZATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); -- cgit v1.2.3 From ab771aef1fd290dbf5010ea5dce85f5fe3553e09 Mon Sep 17 00:00:00 2001 From: Subv Date: Thu, 9 Aug 2012 19:18:31 -0500 Subject: Core/PacketIO: Fixed a few more opcodes --- src/server/game/Entities/Player/Player.cpp | 53 ++++++++++++++- src/server/game/Entities/Unit/Unit.cpp | 101 +++++++++++----------------- src/server/game/Entities/Unit/Unit.h | 1 + src/server/game/Server/Protocol/Opcodes.cpp | 6 +- 4 files changed, 93 insertions(+), 68 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 29d12953193..c12c3d60184 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -25720,9 +25720,56 @@ bool Player::SetHover(bool enable) void Player::SendMovementSetCanFly(bool apply) { - WorldPacket data(apply ? SMSG_MOVE_SET_CAN_FLY : SMSG_MOVE_UNSET_CAN_FLY, 12); - data.append(GetPackGUID()); - data << uint32(0); //! movement counter + ObjectGuid guid = GetGUID(); + WorldPacket data; + if (apply) + { + data.Initialize(SMSG_MOVE_SET_CAN_FLY, 1 + 8 + 4); + data.WriteBit(guid[1]); + data.WriteBit(guid[6]); + data.WriteBit(guid[5]); + data.WriteBit(guid[0]); + data.WriteBit(guid[7]); + data.WriteBit(guid[4]); + data.WriteBit(guid[2]); + data.WriteBit(guid[3]); + + data.WriteByteSeq(guid[6]); + data.WriteByteSeq(guid[3]); + + data << uint32(0); //! movement counter + + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[5]); + } + else + { + data.Initialize(SMSG_MOVE_UNSET_CAN_FLY, 1 + 8 + 4); + data.WriteBit(guid[1]); + data.WriteBit(guid[4]); + data.WriteBit(guid[2]); + data.WriteBit(guid[5]); + data.WriteBit(guid[0]); + data.WriteBit(guid[3]); + data.WriteBit(guid[6]); + data.WriteBit(guid[7]); + + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[6]); + + data << uint32(0); //! movement counter + + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[5]); + data.WriteByteSeq(guid[7]); + } SendDirectMessage(&data); } diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 7e19a97ac5b..7daeb97f5d9 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -17129,11 +17129,47 @@ void Unit::UpdateObjectVisibility(bool forced) } } +void Unit::SendMoveKnockBack(Player* player, float speedXY, float speedZ, float vcos, float vsin) +{ + ObjectGuid guid = GetGUID(); + WorldPacket data(SMSG_MOVE_KNOCK_BACK, (1+8+4+4+4+4+4)); + data.WriteBit(guid[0]); + data.WriteBit(guid[3]); + data.WriteBit(guid[6]); + data.WriteBit(guid[7]); + data.WriteBit(guid[2]); + data.WriteBit(guid[5]); + data.WriteBit(guid[1]); + data.WriteBit(guid[4]); + + data.WriteByteSeq(guid[1]); + + data << float(vsin); + data << uint32(0); + + data.WriteByteSeq(bytes[6]); + data.WriteByteSeq(bytes[7]); + + data << float(speedXY); + + data.WriteByteSeq(bytes[4]); + data.WriteByteSeq(bytes[5]); + data.WriteByteSeq(bytes[3]); + + data << float(speedZ); + data << float(vcos); + + data.WriteByteSeq(bytes[2]); + data.WriteByteSeq(bytes[0]); + + player->GetSession()->SendPacket(&data); +} + void Unit::KnockbackFrom(float x, float y, float speedXY, float speedZ) { Player* player = NULL; if (GetTypeId() == TYPEID_PLAYER) - player = (Player*)this; + player = ToPlayer(); else if (Unit* charmer = GetCharmer()) { player = charmer->ToPlayer(); @@ -17142,43 +17178,12 @@ void Unit::KnockbackFrom(float x, float y, float speedXY, float speedZ) } if (!player) - { GetMotionMaster()->MoveKnockbackFrom(x, y, speedXY, speedZ); - } else { float vcos, vsin; GetSinCos(x, y, vsin, vcos); - - WorldPacket data(SMSG_MOVE_KNOCK_BACK, (1+8+4+4+4+4+4)); - uint64 guid = GetGUID(); - uint8* bytes = (uint8*)&guid; - - data.WriteBit(bytes[5]); - data.WriteBit(bytes[2]); - data.WriteBit(bytes[6]); - data.WriteBit(bytes[3]); - data.WriteBit(bytes[1]); - data.WriteBit(bytes[4]); - data.WriteBit(bytes[0]); - data.WriteBit(bytes[7]); - - data.WriteByteSeq(bytes[0]); - data << float(speedXY); - data << uint32(0); - data << float(-speedZ); - data.WriteByteSeq(bytes[6]); - data << float(vcos); - data << float(vsin); - data.WriteByteSeq(bytes[3]); - data.WriteByteSeq(bytes[1]); - data.WriteByteSeq(bytes[2]); - data.WriteByteSeq(bytes[4]); - data.WriteByteSeq(bytes[7]); - data.WriteByteSeq(bytes[5]); - data.WriteByteSeq(bytes[5]); - - player->GetSession()->SendPacket(&data); + SendMoveKnockBack(player, speedXY, -speedZ, vcos, vsin); } } @@ -17489,35 +17494,7 @@ void Unit::JumpTo(float speedXY, float speedZ, bool forward) { float vcos = cos(angle+GetOrientation()); float vsin = sin(angle+GetOrientation()); - - WorldPacket data(SMSG_MOVE_KNOCK_BACK, (1+8+4+4+4+4+4)); - uint64 guid = GetGUID(); - uint8* bytes = (uint8*)&guid; - - data.WriteBit(bytes[5]); - data.WriteBit(bytes[2]); - data.WriteBit(bytes[6]); - data.WriteBit(bytes[3]); - data.WriteBit(bytes[1]); - data.WriteBit(bytes[4]); - data.WriteBit(bytes[0]); - data.WriteBit(bytes[7]); - - data.WriteByteSeq(bytes[0]); - data << float(speedXY); - data << uint32(0); - data << float(-speedZ); - data.WriteByteSeq(bytes[6]); - data << float(vcos); - data << float(vsin); - data.WriteByteSeq(bytes[3]); - data.WriteByteSeq(bytes[1]); - data.WriteByteSeq(bytes[2]); - data.WriteByteSeq(bytes[4]); - data.WriteByteSeq(bytes[7]); - data.WriteByteSeq(bytes[5]); - - ToPlayer()->GetSession()->SendPacket(&data); + SendMoveKnockBack(ToPlayer(), speedXY, -speedZ, vcos, vsin); } } diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index cf2f25898b6..de95b7d9842 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1594,6 +1594,7 @@ class Unit : public WorldObject void UpdateOrientation(float orientation); void UpdateHeight(float newZ); + void SendMoveKnockBack(Player* player, float speedXY, float speedZ, float vcos, float vsin); void KnockbackFrom(float x, float y, float speedXY, float speedZ); void JumpTo(float speedXY, float speedZ, bool forward = true); void JumpTo(WorldObject* obj, float speedZ); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 3880809e5c0..89177ff269a 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -975,12 +975,12 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_MOVE_FEATHER_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_GRAVITY_DISABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_GRAVITY_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_KNOCK_BACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_KNOCK_BACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_LAND_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_NORMAL_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_ACTIVE_MOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_COLLISION_HEIGHT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_COMPOUND_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -995,7 +995,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_COLLISION_HEIGHT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From 260782f316e5c15dcbee93174886120ae34d85f5 Mon Sep 17 00:00:00 2001 From: Nay Date: Fri, 10 Aug 2012 02:01:25 +0100 Subject: Core/ChatAddon: Implement server side addon communication filtering --- src/server/game/Entities/Player/Player.cpp | 11 +++---- src/server/game/Entities/Player/Player.h | 2 +- src/server/game/Groups/Group.cpp | 15 ++++++++++ src/server/game/Groups/Group.h | 3 +- src/server/game/Guilds/Guild.cpp | 5 ++-- src/server/game/Handlers/ChatHandler.cpp | 46 +++++++++++++++++++++++++++-- src/server/game/Server/Protocol/Opcodes.cpp | 4 +-- src/server/game/Server/WorldSession.cpp | 17 +++++++++++ src/server/game/Server/WorldSession.h | 18 ++++++----- 9 files changed, 99 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index c12c3d60184..0c5ccd85a09 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -19986,16 +19986,17 @@ void Player::TextEmote(const std::string& text) SendMessageToSetInRange(&data, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), true, !sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT)); } -void Player::WhisperAddon(const std::string& text, const std::string& prefix, uint64 receiver) +void Player::WhisperAddon(const std::string& text, const std::string& prefix, Player* receiver) { - Player* rPlayer = ObjectAccessor::FindPlayer(receiver); - std::string _text(text); - sScriptMgr->OnPlayerChat(this, CHAT_MSG_WHISPER, LANG_UNIVERSAL, _text, rPlayer); + sScriptMgr->OnPlayerChat(this, CHAT_MSG_WHISPER, LANG_UNIVERSAL, _text, receiver); + + if (!receiver->GetSession()->IsAddonRegistered(prefix)) + return; WorldPacket data(SMSG_MESSAGECHAT, 200); BuildPlayerChat(&data, CHAT_MSG_WHISPER, _text, LANG_UNIVERSAL, prefix.c_str()); - rPlayer->GetSession()->SendPacket(&data); + receiver->GetSession()->SendPacket(&data); } void Player::Whisper(const std::string& text, uint32 language, uint64 receiver) diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index ccdea8654e8..d32b9e5b23f 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1237,7 +1237,7 @@ class Player : public Unit, public GridObject void Yell(const std::string& text, const uint32 language); void TextEmote(const std::string& text); void Whisper(const std::string& text, const uint32 language, uint64 receiver); - void WhisperAddon(const std::string& text, const std::string& prefix, uint64 receiver); + void WhisperAddon(const std::string& text, const std::string& prefix, Player* receiver); void BuildPlayerChat(WorldPacket* data, uint8 msgtype, const std::string& text, uint32 language, const char* addonPrefix = NULL) const; /*********************************************************/ diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index 34fa9f300ab..a6b63ac37da 100755 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -1581,6 +1581,21 @@ void Group::UpdatePlayerOutOfRange(Player* player) } } +void Group::BroadcastAddonMessagePacket(WorldPacket* packet, const std::string& prefix, bool ignorePlayersInBGRaid, int group, uint64 ignore) +{ + for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next()) + { + Player* player = itr->getSource(); + if (!player || (ignore != 0 && player->GetGUID() == ignore) || (ignorePlayersInBGRaid && player->GetGroup() != this)) + continue; + + if (WorldSession* session = player->GetSession()) + if (session && (group == -1 || itr->getSubGroup() == group)) + if (session->IsAddonRegistered(prefix)) + session->SendPacket(packet); + } +} + void Group::BroadcastPacket(WorldPacket* packet, bool ignorePlayersInBGRaid, int group, uint64 ignore) { for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next()) diff --git a/src/server/game/Groups/Group.h b/src/server/game/Groups/Group.h index f909b755829..8676f2d81b1 100755 --- a/src/server/game/Groups/Group.h +++ b/src/server/game/Groups/Group.h @@ -268,7 +268,8 @@ class Group void SendUpdateToPlayer(uint64 playerGUID, MemberSlot* slot = NULL); void UpdatePlayerOutOfRange(Player* player); // ignore: GUID of player that will be ignored - void BroadcastPacket(WorldPacket* packet, bool ignorePlayersInBGRaid, int group=-1, uint64 ignore=0); + void BroadcastPacket(WorldPacket* packet, bool ignorePlayersInBGRaid, int group = -1, uint64 ignore = 0); + void BroadcastAddonMessagePacket(WorldPacket* packet, const std::string& prefix, bool ignorePlayersInBGRaid, int group, uint64 ignore); void BroadcastReadyCheck(WorldPacket* packet); void OfflineReadyCheck(); diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 66e0c968d2c..6e74180ae13 100644 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -2234,8 +2234,9 @@ void Guild::BroadcastAddonToGuild(WorldSession* session, bool officerOnly, const for (Members::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr) if (Player* player = itr->second->FindPlayer()) if (player->GetSession() && _HasRankRight(player, officerOnly ? GR_RIGHT_OFFCHATLISTEN : GR_RIGHT_GCHATLISTEN) && - !player->GetSocial()->HasIgnore(session->GetPlayer()->GetGUIDLow())) - player->GetSession()->SendPacket(&data); + !player->GetSocial()->HasIgnore(session->GetPlayer()->GetGUIDLow()) && + player->GetSession()->IsAddonRegistered(prefix)) + player->GetSession()->SendPacket(&data); } } diff --git a/src/server/game/Handlers/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cpp index 8b994c2fedc..2b6f7b89b02 100644 --- a/src/server/game/Handlers/ChatHandler.cpp +++ b/src/server/game/Handlers/ChatHandler.cpp @@ -509,6 +509,46 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) } } +void WorldSession::HandleUnregisterAddonPrefixesOpcode(WorldPacket& /*recvPacket*/) // empty packet +{ + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_UNREGISTER_ALL_ADDON_PREFIXES"); + + _registeredAddonPrefixes.clear(); +} + +void WorldSession::HandleAddonRegisteredPrefixesOpcode(WorldPacket& recvPacket) +{ + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ADDON_REGISTERED_PREFIXES"); + + // This is always sent after CMSG_UNREGISTER_ALL_ADDON_PREFIXES + + uint32 count = recvPacket.ReadBits(25); + + if (count > REGISTERED_ADDON_PREFIX_SOFTCAP) + { + // if we have hit the softcap (64) nothing should be filtered + _filterAddonMessages = false; + recvPacket.rfinish(); + return; + } + + std::vector lengths(count); + for (uint32 i = 0; i < count; ++i) + lengths.push_back(recvPacket.ReadBits(5)); + + std::vector prefixes(count); + for (uint32 i = 0; i < count; ++i) + _registeredAddonPrefixes.push_back(recvPacket.ReadString(lengths[i])); + + if (_registeredAddonPrefixes.size() > REGISTERED_ADDON_PREFIX_SOFTCAP) // shouldn't happen + { + _filterAddonMessages = false; + return; + } + + _filterAddonMessages = true; +} + void WorldSession::HandleAddonMessagechatOpcode(WorldPacket& recvData) { Player* sender = GetPlayer(); @@ -601,7 +641,7 @@ void WorldSession::HandleAddonMessagechatOpcode(WorldPacket& recvData) WorldPacket data; ChatHandler::FillMessageData(&data, this, type, LANG_ADDON, "", 0, message.c_str(), NULL); - group->BroadcastPacket(&data, false); + group->BroadcastAddonMessagePacket(&data, prefix, false); break; } case CHAT_MSG_GUILD: @@ -620,7 +660,7 @@ void WorldSession::HandleAddonMessagechatOpcode(WorldPacket& recvData) if (!receiver) break; - sender->WhisperAddon(message, prefix, receiver->GetGUID()); + sender->WhisperAddon(message, prefix, receiver); break; } // Messages sent to "RAID" while in a party will get delivered to "PARTY" @@ -634,7 +674,7 @@ void WorldSession::HandleAddonMessagechatOpcode(WorldPacket& recvData) WorldPacket data; ChatHandler::FillMessageData(&data, this, type, LANG_ADDON, "", 0, message.c_str(), NULL, prefix.c_str()); - group->BroadcastPacket(&data, true, -1, group->GetMemberGroup(sender->GetGUID())); + group->BroadcastAddonMessagePacket(&data, true, prefix, -1, group->GetMemberGroup(sender->GetGUID())); break; } default: diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 89177ff269a..ff4f093463e 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -46,7 +46,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_ACCEPT_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAcceptTradeOpcode ); DEFINE_OPCODE_HANDLER(CMSG_ACTIVATETAXI, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleActivateTaxiOpcode ); DEFINE_OPCODE_HANDLER(CMSG_ACTIVATETAXIEXPRESS, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleActivateTaxiExpressOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_ADDON_REGISTERED_PREFIXES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_ADDON_REGISTERED_PREFIXES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::HandleAddonRegisteredPrefixesOpcode); DEFINE_OPCODE_HANDLER(CMSG_ADD_FRIEND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddFriendOpcode ); DEFINE_OPCODE_HANDLER(CMSG_ADD_IGNORE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddIgnoreOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_ADD_VOICE_IGNORE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -522,7 +522,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_UNACCEPT_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnacceptTradeOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_SKILL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnlearnSkillOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_SPECIALIZATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_UNREGISTER_ALL_ADDON_PREFIXES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_UNREGISTER_ALL_ADDON_PREFIXES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::HandleUnregisterAddonPrefixesOpcode); DEFINE_OPCODE_HANDLER(CMSG_UPDATE_ACCOUNT_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateAccountData ); //DEFINE_OPCODE_HANDLER(CMSG_UPDATE_MISSILE_TRAJECTORY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateMissileTrajectory ); //DEFINE_OPCODE_HANDLER(CMSG_UPDATE_PROJECTILE_POSITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateProjectilePosition ); diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index 87cd026c244..40726e0ab92 100644 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -45,6 +45,9 @@ #include "Transport.h" #include "WardenWin.h" #include "WardenMac.h" +#include +#include +#include bool MapSessionFilter::Process(WorldPacket* packet) { @@ -102,6 +105,7 @@ m_latency(0), m_TutorialsChanged(false), recruiterId(recruiter), isRecruiter(isARecruiter), timeLastWhoCommand(0) { _warden = NULL; + _filterAddonMessages = false; if (sock) { @@ -961,6 +965,19 @@ void WorldSession::SendAddonsInfo() SendPacket(&data); } +bool WorldSession::IsAddonRegistered(const std::string& prefix) const +{ + if (!_filterAddonMessages) // if we have hit the softcap (64) nothing should be filtered + return true; + + if (_registeredAddonPrefixes.empty()) + return false; + + std::vector::iterator itr = std::find(_registeredAddonPrefixes.begin(), _registeredAddonPrefixes.end(), prefix); + return itr != _registeredAddonPrefixes.end(); +} + + void WorldSession::SetPlayer(Player* player) { _player = player; diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 58ad4287ee8..96e7d4918d6 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -77,6 +77,8 @@ enum AccountDataType #define GLOBAL_CACHE_MASK 0x15 #define PER_CHARACTER_CACHE_MASK 0xEA +#define REGISTERED_ADDON_PREFIX_SOFTCAP 64 + struct AccountData { AccountData() : Time(0), Data("") {} @@ -232,6 +234,7 @@ class WorldSession void ReadAddonsInfo(WorldPacket& data); void SendAddonsInfo(); + bool IsAddonRegistered(const std::string& prefix) const; void ReadMovementInfo(WorldPacket& data, MovementInfo* mi); void WriteMovementInfo(WorldPacket &data, MovementInfo* mi); @@ -385,14 +388,8 @@ class WorldSession else m_timeOutTime -= diff; } - void ResetTimeOutTime() - { - m_timeOutTime = sWorld->getIntConfig(CONFIG_SOCKET_TIMEOUTTIME); - } - bool IsConnectionIdle() const - { - return (m_timeOutTime <= 0 && !m_inQueue); - } + void ResetTimeOutTime() { m_timeOutTime = sWorld->getIntConfig(CONFIG_SOCKET_TIMEOUTTIME); } + bool IsConnectionIdle() const { return (m_timeOutTime <= 0 && !m_inQueue); } // Recruit-A-Friend Handling uint32 GetRecruiterId() const { return recruiterId; } @@ -712,6 +709,9 @@ class WorldSession void HandleTextEmoteOpcode(WorldPacket& recvPacket); void HandleChatIgnoredOpcode(WorldPacket& recvPacket); + void HandleUnregisterAddonPrefixesOpcode(WorldPacket& recvPacket); + void HandleAddonRegisteredPrefixesOpcode(WorldPacket& recvPacket); + void HandleReclaimCorpseOpcode(WorldPacket& recvPacket); void HandleCorpseQueryOpcode(WorldPacket& recvPacket); void HandleCorpseMapPositionQuery(WorldPacket& recvPacket); @@ -1008,6 +1008,8 @@ class WorldSession uint32 m_Tutorials[MAX_ACCOUNT_TUTORIAL_VALUES]; bool m_TutorialsChanged; AddonsList m_addonsList; + std::vector _registeredAddonPrefixes; + bool _filterAddonMessages; uint32 recruiterId; bool isRecruiter; ACE_Based::LockedQueue _recvQueue; -- cgit v1.2.3 From 5e1e9bb4dd10979c3bdf8debafc4e669355d4586 Mon Sep 17 00:00:00 2001 From: Nay Date: Fri, 10 Aug 2012 02:57:16 +0100 Subject: Core: Fix build and proper deinitialization in HandleTransmogrifyItems (by using vectors instead of new/delete) --- src/server/game/Entities/Unit/Unit.cpp | 14 +++++----- src/server/game/Groups/Group.h | 2 +- src/server/game/Handlers/ChatHandler.cpp | 42 +--------------------------- src/server/game/Handlers/ItemHandler.cpp | 11 ++------ src/server/game/Server/Protocol/Opcodes.cpp | 6 ++-- src/server/game/Server/WorldSession.cpp | 43 ++++++++++++++++++++++++++--- 6 files changed, 54 insertions(+), 64 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 7daeb97f5d9..cedf38cb676 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -17147,20 +17147,20 @@ void Unit::SendMoveKnockBack(Player* player, float speedXY, float speedZ, float data << float(vsin); data << uint32(0); - data.WriteByteSeq(bytes[6]); - data.WriteByteSeq(bytes[7]); + data.WriteByteSeq(guid[6]); + data.WriteByteSeq(guid[7]); data << float(speedXY); - data.WriteByteSeq(bytes[4]); - data.WriteByteSeq(bytes[5]); - data.WriteByteSeq(bytes[3]); + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[5]); + data.WriteByteSeq(guid[3]); data << float(speedZ); data << float(vcos); - data.WriteByteSeq(bytes[2]); - data.WriteByteSeq(bytes[0]); + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[0]); player->GetSession()->SendPacket(&data); } diff --git a/src/server/game/Groups/Group.h b/src/server/game/Groups/Group.h index 8676f2d81b1..b0543359a6b 100755 --- a/src/server/game/Groups/Group.h +++ b/src/server/game/Groups/Group.h @@ -269,7 +269,7 @@ class Group void UpdatePlayerOutOfRange(Player* player); // ignore: GUID of player that will be ignored void BroadcastPacket(WorldPacket* packet, bool ignorePlayersInBGRaid, int group = -1, uint64 ignore = 0); - void BroadcastAddonMessagePacket(WorldPacket* packet, const std::string& prefix, bool ignorePlayersInBGRaid, int group, uint64 ignore); + void BroadcastAddonMessagePacket(WorldPacket* packet, const std::string& prefix, bool ignorePlayersInBGRaid, int group = -1, uint64 ignore = 0); void BroadcastReadyCheck(WorldPacket* packet); void OfflineReadyCheck(); diff --git a/src/server/game/Handlers/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cpp index 2b6f7b89b02..837e074044a 100644 --- a/src/server/game/Handlers/ChatHandler.cpp +++ b/src/server/game/Handlers/ChatHandler.cpp @@ -509,46 +509,6 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) } } -void WorldSession::HandleUnregisterAddonPrefixesOpcode(WorldPacket& /*recvPacket*/) // empty packet -{ - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_UNREGISTER_ALL_ADDON_PREFIXES"); - - _registeredAddonPrefixes.clear(); -} - -void WorldSession::HandleAddonRegisteredPrefixesOpcode(WorldPacket& recvPacket) -{ - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ADDON_REGISTERED_PREFIXES"); - - // This is always sent after CMSG_UNREGISTER_ALL_ADDON_PREFIXES - - uint32 count = recvPacket.ReadBits(25); - - if (count > REGISTERED_ADDON_PREFIX_SOFTCAP) - { - // if we have hit the softcap (64) nothing should be filtered - _filterAddonMessages = false; - recvPacket.rfinish(); - return; - } - - std::vector lengths(count); - for (uint32 i = 0; i < count; ++i) - lengths.push_back(recvPacket.ReadBits(5)); - - std::vector prefixes(count); - for (uint32 i = 0; i < count; ++i) - _registeredAddonPrefixes.push_back(recvPacket.ReadString(lengths[i])); - - if (_registeredAddonPrefixes.size() > REGISTERED_ADDON_PREFIX_SOFTCAP) // shouldn't happen - { - _filterAddonMessages = false; - return; - } - - _filterAddonMessages = true; -} - void WorldSession::HandleAddonMessagechatOpcode(WorldPacket& recvData) { Player* sender = GetPlayer(); @@ -674,7 +634,7 @@ void WorldSession::HandleAddonMessagechatOpcode(WorldPacket& recvData) WorldPacket data; ChatHandler::FillMessageData(&data, this, type, LANG_ADDON, "", 0, message.c_str(), NULL, prefix.c_str()); - group->BroadcastAddonMessagePacket(&data, true, prefix, -1, group->GetMemberGroup(sender->GetGUID())); + group->BroadcastAddonMessagePacket(&data, prefix, true, -1, group->GetMemberGroup(sender->GetGUID())); break; } default: diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 9a8ab497d88..3b2d40f9000 100644 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -1454,9 +1454,9 @@ void WorldSession::HandleTransmogrifyItems(WorldPacket& recvData) return; } - ObjectGuid* itemGuids = new ObjectGuid[count]; - uint32* newEntries = new uint32[count]; - uint32* slots = new uint32[count]; + std::vector itemGuids(count, ObjectGuid(0)); + std::vector newEntries(count, 0); + std::vector slots(count, 0); for (uint8 i = 0; i < count; ++i) { @@ -1606,11 +1606,6 @@ void WorldSession::HandleTransmogrifyItems(WorldPacket& recvData) // ... unless client was modified if (cost) // 0 cost if reverting look player->ModifyMoney(-cost); - - - delete[] itemGuids; - delete[] newEntries; - delete[] slots; } void WorldSession::SendReforgeResult(bool success) diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index ff4f093463e..af9a1a704da 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -46,7 +46,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_ACCEPT_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAcceptTradeOpcode ); DEFINE_OPCODE_HANDLER(CMSG_ACTIVATETAXI, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleActivateTaxiOpcode ); DEFINE_OPCODE_HANDLER(CMSG_ACTIVATETAXIEXPRESS, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleActivateTaxiExpressOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_ADDON_REGISTERED_PREFIXES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::HandleAddonRegisteredPrefixesOpcode); + DEFINE_OPCODE_HANDLER(CMSG_ADDON_REGISTERED_PREFIXES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonRegisteredPrefixesOpcode); DEFINE_OPCODE_HANDLER(CMSG_ADD_FRIEND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddFriendOpcode ); DEFINE_OPCODE_HANDLER(CMSG_ADD_IGNORE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddIgnoreOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_ADD_VOICE_IGNORE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -514,7 +514,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_TOTEM_DESTROYED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTotemDestroyed ); DEFINE_OPCODE_HANDLER(CMSG_TRAINER_BUY_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerBuySpellOpcode ); DEFINE_OPCODE_HANDLER(CMSG_TRAINER_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerListOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_TRANSMOGRIFY_ITEMS, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleTransmogrifyItems ); + DEFINE_OPCODE_HANDLER(CMSG_TRANSMOGRIFY_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTransmogrifyItems ); DEFINE_OPCODE_HANDLER(CMSG_TURN_IN_PETITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTurnInPetitionOpcode ); DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_CLEAR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialClear ); DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_FLAG, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialFlag ); @@ -522,7 +522,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_UNACCEPT_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnacceptTradeOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_SKILL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnlearnSkillOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_SPECIALIZATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_UNREGISTER_ALL_ADDON_PREFIXES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::HandleUnregisterAddonPrefixesOpcode); + DEFINE_OPCODE_HANDLER(CMSG_UNREGISTER_ALL_ADDON_PREFIXES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnregisterAddonPrefixesOpcode); DEFINE_OPCODE_HANDLER(CMSG_UPDATE_ACCOUNT_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateAccountData ); //DEFINE_OPCODE_HANDLER(CMSG_UPDATE_MISSILE_TRAJECTORY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateMissileTrajectory ); //DEFINE_OPCODE_HANDLER(CMSG_UPDATE_PROJECTILE_POSITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateProjectilePosition ); diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index 40726e0ab92..92db86c2a35 100644 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -45,9 +45,6 @@ #include "Transport.h" #include "WardenWin.h" #include "WardenMac.h" -#include -#include -#include bool MapSessionFilter::Process(WorldPacket* packet) { @@ -973,10 +970,48 @@ bool WorldSession::IsAddonRegistered(const std::string& prefix) const if (_registeredAddonPrefixes.empty()) return false; - std::vector::iterator itr = std::find(_registeredAddonPrefixes.begin(), _registeredAddonPrefixes.end(), prefix); + std::vector::const_iterator itr = std::find(_registeredAddonPrefixes.begin(), _registeredAddonPrefixes.end(), prefix); return itr != _registeredAddonPrefixes.end(); } +void WorldSession::HandleUnregisterAddonPrefixesOpcode(WorldPacket& /*recvPacket*/) // empty packet +{ + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_UNREGISTER_ALL_ADDON_PREFIXES"); + + _registeredAddonPrefixes.clear(); +} + +void WorldSession::HandleAddonRegisteredPrefixesOpcode(WorldPacket& recvPacket) +{ + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ADDON_REGISTERED_PREFIXES"); + + // This is always sent after CMSG_UNREGISTER_ALL_ADDON_PREFIXES + + uint32 count = recvPacket.ReadBits(25); + + if (count > REGISTERED_ADDON_PREFIX_SOFTCAP) + { + // if we have hit the softcap (64) nothing should be filtered + _filterAddonMessages = false; + recvPacket.rfinish(); + return; + } + + std::vector lengths(count); + for (uint32 i = 0; i < count; ++i) + lengths[i] = recvPacket.ReadBits(5); + + for (uint32 i = 0; i < count; ++i) + _registeredAddonPrefixes.push_back(recvPacket.ReadString(lengths[i])); + + if (_registeredAddonPrefixes.size() > REGISTERED_ADDON_PREFIX_SOFTCAP) // shouldn't happen + { + _filterAddonMessages = false; + return; + } + + _filterAddonMessages = true; +} void WorldSession::SetPlayer(Player* player) { -- cgit v1.2.3 From 9538fb6d5a508adbebc9dd94ce25cbca6bd48789 Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 10 Aug 2012 14:10:57 +0200 Subject: Core/Movement: Ensured object orientation is always within 0-2pi range, this fixes movement. --- src/server/game/Entities/Creature/Creature.cpp | 2 ++ src/server/game/Entities/Creature/Creature.h | 4 ++-- src/server/game/Entities/GameObject/GameObject.cpp | 1 + src/server/game/Entities/Object/Object.cpp | 9 ++++++--- src/server/game/Entities/Transport/Transport.cpp | 4 ++-- src/server/game/Entities/Unit/Unit.cpp | 19 ++++++++++--------- src/server/game/Entities/Unit/Unit.h | 8 +++++++- src/server/game/Movement/Spline/MoveSplineInit.cpp | 5 +++-- .../game/Movement/Spline/MovementPacketBuilder.cpp | 9 ++++----- .../game/Movement/Spline/MovementPacketBuilder.h | 4 ++-- .../Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp | 2 +- 11 files changed, 40 insertions(+), 27 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index c46fc0d91d5..de5d0a0303c 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -249,6 +249,7 @@ void Creature::RemoveCorpse(bool setSpawnTime) float x, y, z, o; GetRespawnPosition(x, y, z, &o); + o = MapManager::NormalizeOrientation(o); SetHomePosition(x, y, z, o); GetMap()->CreatureRelocation(this, x, y, z, o); } @@ -2464,6 +2465,7 @@ void Creature::SetPosition(float x, float y, float z, float o) return; } + o = MapManager::NormalizeOrientation(o); GetMap()->CreatureRelocation(ToCreature(), x, y, z, o); if (IsVehicle()) GetVehicleKit()->RelocatePassengers(x, y, z, o); diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index f58e49b9e14..5f933bc6ca1 100755 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -673,8 +673,8 @@ class Creature : public Unit, public GridObject, public MapCreature void SetHomePosition(float x, float y, float z, float o) { m_homePosition.Relocate(x, y, z, o); } void SetHomePosition(const Position &pos) { m_homePosition.Relocate(pos); } - void GetHomePosition(float &x, float &y, float &z, float &ori) { m_homePosition.GetPosition(x, y, z, ori); } - Position GetHomePosition() { return m_homePosition; } + void GetHomePosition(float &x, float &y, float &z, float &ori) const { m_homePosition.GetPosition(x, y, z, ori); } + Position GetHomePosition() const { return m_homePosition; } void SetTransportHomePosition(float x, float y, float z, float o) { m_transportHomePosition.Relocate(x, y, z, o); } void SetTransportHomePosition(const Position &pos) { m_transportHomePosition.Relocate(pos); } diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 00b98ce2cc1..a59dcd7d950 100755 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -167,6 +167,7 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map* map, uint32 phaseMa ASSERT(map); SetMap(map); + ang = MapManager::NormalizeOrientation(ang); Relocate(x, y, z, ang); if (!IsPositionValid()) { diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 264672fc5c9..153dad8e447 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -315,7 +315,6 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const data->WriteBit(flags & UPDATEFLAG_UNK5); data->WriteBit(0); data->WriteBit(flags & UPDATEFLAG_TRANSPORT); - bool fullSpline = false; if (flags & UPDATEFLAG_LIVING) { @@ -323,6 +322,8 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const ObjectGuid guid = GetGUID(); uint32 movementFlags = self->m_movementInfo.GetMovementFlags(); uint16 movementFlagsExtra = self->m_movementInfo.GetExtraMovementFlags(); + if (GetTypeId() == TYPEID_UNIT) + movementFlags &= MOVEMENTFLAG_MASK_CREATURE_ALLOWED; data->WriteBit(!movementFlags); data->WriteBit(G3D::fuzzyEq(self->GetOrientation(), 0.0f)); // Has Orientation @@ -359,7 +360,7 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const data->WriteBit(guid[4]); if (self->IsSplineEnabled()) - Movement::PacketBuilder::WriteCreateBits(*self->movespline, *data, fullSpline); + Movement::PacketBuilder::WriteCreateBits(*self->movespline, *data); data->WriteBit(guid[6]); if (movementFlagsExtra & MOVEMENTFLAG2_INTERPOLATED_TURNING) @@ -421,6 +422,8 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const ObjectGuid guid = GetGUID(); uint32 movementFlags = self->m_movementInfo.GetMovementFlags(); uint16 movementFlagsExtra = self->m_movementInfo.GetExtraMovementFlags(); + if (GetTypeId() == TYPEID_UNIT) + movementFlags &= MOVEMENTFLAG_MASK_CREATURE_ALLOWED; data->WriteByteSeq(guid[4]); *data << self->GetSpeed(MOVE_RUN_BACK); @@ -442,7 +445,7 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const *data << float(self->m_movementInfo.splineElevation); if (self->IsSplineEnabled()) - Movement::PacketBuilder::WriteCreateData(*self->movespline, *data, fullSpline); + Movement::PacketBuilder::WriteCreateData(*self->movespline, *data); *data << float(self->GetPositionZMinusOffset()); data->WriteByteSeq(guid[5]); diff --git a/src/server/game/Entities/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp index aa5c33d8c67..02a6f261e98 100755 --- a/src/server/game/Entities/Transport/Transport.cpp +++ b/src/server/game/Entities/Transport/Transport.cpp @@ -711,7 +711,7 @@ void Transport::UpdateNPCPositions() void Transport::CalculatePassengerPosition(float& x, float& y, float& z, float& o) { float inx = x, iny = y, inz = z, ino = o; - o = GetOrientation() + ino; + o = MapManager::NormalizeOrientation(GetOrientation() + ino); x = GetPositionX() + (inx * cos(GetOrientation()) + iny * sin(GetOrientation() + M_PI)); y = GetPositionY() + (iny * cos(GetOrientation()) + inx * sin(GetOrientation())); z = GetPositionZ() + inz; @@ -720,7 +720,7 @@ void Transport::CalculatePassengerPosition(float& x, float& y, float& z, float& //! This method transforms supplied global coordinates into local offsets void Transport::CalculatePassengerOffset(float& x, float& y, float& z, float& o) { - o -= GetOrientation(); + o = MapManager::NormalizeOrientation(o - GetOrientation()); z -= GetPositionZ(); y -= GetPositionY(); // y = searchedY * cos(o) + searchedX * sin(o) x -= GetPositionX(); // x = searchedX * cos(o) + searchedY * sin(o + pi) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index cedf38cb676..9ca0d23006c 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -16257,20 +16257,20 @@ void Unit::SendMoveRoot(uint32 value) data.WriteBit(guid[4]); data.WriteBit(guid[1]); data.WriteBit(guid[3]); - + data.WriteByteSeq(guid[1]); data.WriteByteSeq(guid[0]); data.WriteByteSeq(guid[2]); data.WriteByteSeq(guid[5]); - + data << uint32(value); - - + + data.WriteByteSeq(guid[3]); data.WriteByteSeq(guid[4]); data.WriteByteSeq(guid[7]); data.WriteByteSeq(guid[6]); - + SendMessageToSet(&data, true); } @@ -16286,19 +16286,19 @@ void Unit::SendMoveUnroot(uint32 value) data.WriteBit(guid[2]); data.WriteBit(guid[4]); data.WriteBit(guid[6]); - + data.WriteByteSeq(guid[3]); data.WriteByteSeq(guid[6]); data.WriteByteSeq(guid[1]); - + data << uint32(value); - + data.WriteByteSeq(guid[2]); data.WriteByteSeq(guid[0]); data.WriteByteSeq(guid[7]); data.WriteByteSeq(guid[4]); data.WriteByteSeq(guid[5]); - + SendMessageToSet(&data, true); } @@ -17849,6 +17849,7 @@ bool Unit::UpdatePosition(float x, float y, float z, float orientation, bool tel return false; } + orientation = MapManager::NormalizeOrientation(orientation); bool turn = (GetOrientation() != orientation); bool relocated = (teleport || GetPositionX() != x || GetPositionY() != y || GetPositionZ() != z); diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index de95b7d9842..7a0b97b90ef 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -711,6 +711,12 @@ enum MovementFlags MOVEMENTFLAG_MASK_MOVING_FLY = MOVEMENTFLAG_FLYING | MOVEMENTFLAG_ASCENDING | MOVEMENTFLAG_DESCENDING, + // Movement flags allowed for creature in CreateObject - we need to keep all other enabled serverside + // to properly calculate all movement + MOVEMENTFLAG_MASK_CREATURE_ALLOWED = + MOVEMENTFLAG_FORWARD | MOVEMENTFLAG_DISABLE_GRAVITY | MOVEMENTFLAG_ROOT | MOVEMENTFLAG_SWIMMING | + MOVEMENTFLAG_CAN_FLY | MOVEMENTFLAG_WATERWALKING | MOVEMENTFLAG_FALLING_SLOW | MOVEMENTFLAG_HOVER, + //! TODO if needed: add more flags to this masks that are exclusive to players MOVEMENTFLAG_MASK_PLAYER_ONLY = MOVEMENTFLAG_FLYING, @@ -1407,7 +1413,7 @@ class Unit : public WorldObject MountCapabilityEntry const* GetMountCapability(uint32 mountType) const; void SendDurabilityLoss(Player* receiver, uint32 percent); - + uint16 GetMaxSkillValueForLevel(Unit const* target = NULL) const { return (target ? getLevelForTarget(target) : getLevel()) * 5; } void DealDamageMods(Unit* victim, uint32 &damage, uint32* absorb); uint32 DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDamage = NULL, DamageEffectType damagetype = DIRECT_DAMAGE, SpellSchoolMask damageSchoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellInfo const* spellProto = NULL, bool durabilityLoss = true); diff --git a/src/server/game/Movement/Spline/MoveSplineInit.cpp b/src/server/game/Movement/Spline/MoveSplineInit.cpp index 780b341f6f2..5b87d9c01b9 100644 --- a/src/server/game/Movement/Spline/MoveSplineInit.cpp +++ b/src/server/game/Movement/Spline/MoveSplineInit.cpp @@ -81,7 +81,7 @@ namespace Movement if (args.path.empty()) return; - // corrent first vertex + // correct first vertex args.path[0] = real_position; args.initialOrientation = real_position.orientation; @@ -114,7 +114,7 @@ namespace Movement } PacketBuilder::WriteMonsterMove(move_spline, data); - unit.SendMessageToSet(&data,true); + unit.SendMessageToSet(&data, true); } MoveSplineInit::MoveSplineInit(Unit& m) : unit(m) @@ -124,6 +124,7 @@ namespace Movement // mix existing state into new args.flags.walkmode = unit.m_movementInfo.HasMovementFlag(MOVEMENTFLAG_WALKING); args.flags.flying = unit.m_movementInfo.HasMovementFlag(MovementFlags(MOVEMENTFLAG_CAN_FLY | MOVEMENTFLAG_DISABLE_GRAVITY)); + args.flags.smoothGroundPath = true; // enabled by default, CatmullRom mode or client config "pathSmoothing" will disable this } void MoveSplineInit::SetFacing(const Unit * target) diff --git a/src/server/game/Movement/Spline/MovementPacketBuilder.cpp b/src/server/game/Movement/Spline/MovementPacketBuilder.cpp index 19a250f7885..aab96a630fa 100644 --- a/src/server/game/Movement/Spline/MovementPacketBuilder.cpp +++ b/src/server/game/Movement/Spline/MovementPacketBuilder.cpp @@ -140,10 +140,9 @@ namespace Movement WriteLinearPath(spline, data); } - void PacketBuilder::WriteCreateBits(MoveSpline const& moveSpline, ByteBuffer& data, bool& fullData) + void PacketBuilder::WriteCreateBits(MoveSpline const& moveSpline, ByteBuffer& data) { - fullData = data.WriteBit(!moveSpline.Finalized()); - if (!fullData) + if (!data.WriteBit(!moveSpline.Finalized())) return; data.WriteBits(uint8(moveSpline.spline.mode()), 2); @@ -180,9 +179,9 @@ namespace Movement data.WriteBits(moveSpline.splineflags.raw(), 25); } - void PacketBuilder::WriteCreateData(MoveSpline const& moveSpline, ByteBuffer& data, bool fullData) + void PacketBuilder::WriteCreateData(MoveSpline const& moveSpline, ByteBuffer& data) { - if (fullData) + if (!moveSpline.Finalized()) { MoveSplineFlag splineFlags = moveSpline.splineflags; diff --git a/src/server/game/Movement/Spline/MovementPacketBuilder.h b/src/server/game/Movement/Spline/MovementPacketBuilder.h index 1b8506c5161..a6e4e4d5d04 100644 --- a/src/server/game/Movement/Spline/MovementPacketBuilder.h +++ b/src/server/game/Movement/Spline/MovementPacketBuilder.h @@ -31,8 +31,8 @@ namespace Movement public: static void WriteMonsterMove(const MoveSpline& mov, WorldPacket& data); - static void WriteCreateBits(MoveSpline const& moveSpline, ByteBuffer& data, bool& fullData); - static void WriteCreateData(MoveSpline const& moveSpline, ByteBuffer& data, bool fullData); + static void WriteCreateBits(MoveSpline const& moveSpline, ByteBuffer& data); + static void WriteCreateData(MoveSpline const& moveSpline, ByteBuffer& data); }; } #endif // TRINITYSERVER_PACKET_BUILDER_H diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp index 0c5cb0aba52..479d234e27c 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp @@ -303,7 +303,7 @@ class npc_coldflame : public CreatureScript { Position const* ownerPos = marrowgarAI->GetLastColdflamePosition(); float ang = me->GetAngle(ownerPos) - static_cast(M_PI); - MapManager::NormalizeOrientation(ang); + ang = MapManager::NormalizeOrientation(ang); me->SetOrientation(ang); owner->GetNearPosition(pos, 2.5f, 0.0f); } -- cgit v1.2.3 From 878f88b25062f97553274aa3d3448e99bdcc1a0a Mon Sep 17 00:00:00 2001 From: kaelima Date: Fri, 10 Aug 2012 14:25:04 +0200 Subject: Core/PacketIO: - Enable a bunch of spline packets. - Correct emblems written in SMSG_GUILD_INVITE - Revert changes in GuildCommandType and add more errors to GuildCommandError - Rename Powers to match names in Lua code from client --- src/server/game/Entities/Player/Player.cpp | 9 +- src/server/game/Entities/Player/Player.h | 2 + src/server/game/Entities/Unit/Unit.cpp | 154 +++++++++++----------- src/server/game/Guilds/Guild.cpp | 87 +++++++----- src/server/game/Guilds/Guild.h | 86 ++++++------ src/server/game/Handlers/ArenaTeamHandler.cpp | 2 +- src/server/game/Handlers/GuildHandler.cpp | 34 ++++- src/server/game/Handlers/PetitionsHandler.cpp | 22 ++-- src/server/game/Handlers/ReferAFriendHandler.cpp | 2 +- src/server/game/Miscellaneous/SharedDefines.h | 11 +- src/server/game/Server/Protocol/Opcodes.cpp | 19 +-- src/server/game/Server/Protocol/Opcodes.h | 2 +- src/server/game/Server/WorldPacket.cpp | 2 +- src/server/game/Server/WorldSession.h | 1 + src/server/game/Spells/Auras/SpellAuraEffects.cpp | 2 +- src/server/game/Spells/Spell.cpp | 14 +- src/server/game/Spells/SpellInfo.cpp | 2 +- src/server/shared/Packets/ByteBuffer.h | 4 +- 18 files changed, 254 insertions(+), 201 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 0c5ccd85a09..f1c3299a92f 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -972,6 +972,7 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo) SetUInt64Value(OBJECT_FIELD_DATA, 0); SetUInt32Value(PLAYER_GUILDRANK, 0); + SetUInt32Value(PLAYER_GUILDLEVEL, 0); SetUInt32Value(PLAYER_GUILD_TIMESTAMP, 0); for (int i = 0; i < KNOWN_TITLES_SIZE; ++i) @@ -1074,8 +1075,8 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo) if (getPowerType() == POWER_RUNIC_POWER) { - SetPower(POWER_RUNE, 8); - SetMaxPower(POWER_RUNE, 8); + SetPower(POWER_RUNES, 8); + SetMaxPower(POWER_RUNES, 8); SetPower(POWER_RUNIC_POWER, 0); SetMaxPower(POWER_RUNIC_POWER, 1000); } @@ -2579,7 +2580,7 @@ void Player::Regenerate(Powers power) case POWER_FOCUS: addvalue += 4.0f * m_modAttackSpeedPct[RANGED_ATTACK] * sWorld->getRate(RATE_POWER_FOCUS); break; - case POWER_RUNE: + case POWER_RUNES: case POWER_HEALTH: break; default: @@ -23699,7 +23700,7 @@ uint32 Player::GetRuneBaseCooldown(uint8 index) AuraEffectList const& regenAura = GetAuraEffectsByType(SPELL_AURA_MOD_POWER_REGEN_PERCENT); for (AuraEffectList::const_iterator i = regenAura.begin();i != regenAura.end(); ++i) { - if ((*i)->GetMiscValue() == POWER_RUNE && (*i)->GetMiscValueB() == rune) + if ((*i)->GetMiscValue() == POWER_RUNES && (*i)->GetMiscValueB() == rune) cooldown = cooldown*(100-(*i)->GetAmount())/100; } diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index d32b9e5b23f..a0bb5513028 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1884,6 +1884,8 @@ class Player : public Unit, public GridObject void SetRank(uint8 rankId) { SetUInt32Value(PLAYER_GUILDRANK, rankId); } uint32 GetRank() { return GetUInt32Value(PLAYER_GUILDRANK); } + void SetGuildLevel(uint32 level) { SetUInt32Value(PLAYER_GUILDLEVEL, level); } + uint32 GetGuildLevel() { return GetUInt32Value(PLAYER_GUILDLEVEL); } void SetGuildIdInvited(uint32 GuildId) { m_GuildIdInvited = GuildId; } uint32 GetGuildId() const { return GetUInt32Value(OBJECT_FIELD_DATA); /* return only lower part */ } static uint32 GetGuildIdFromDB(uint64 guid); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 9ca0d23006c..71a277c9f99 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -12753,6 +12753,24 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) { case MOVE_WALK: data.Initialize(SMSG_SPLINE_MOVE_SET_WALK_SPEED, 8+4+2+4+4+4+4+4+4+4); + data.WriteBit(bytes[0]); + data.WriteBit(bytes[6]); + data.WriteBit(bytes[7]); + data.WriteBit(bytes[3]); + data.WriteBit(bytes[5]); + data.WriteBit(bytes[1]); + data.WriteBit(bytes[2]); + data.WriteBit(bytes[4]); + data.FlushBits(); + data.WriteByteSeq(bytes[0]); + data.WriteByteSeq(bytes[4]); + data.WriteByteSeq(bytes[7]); + data.WriteByteSeq(bytes[1]); + data.WriteByteSeq(bytes[5]); + data.WriteByteSeq(bytes[3]); + data << float(GetSpeed(mtype)); + data.WriteByteSeq(bytes[9]); + data.WriteByteSeq(bytes[5]); break; case MOVE_RUN: data.Initialize(SMSG_SPLINE_MOVE_SET_RUN_SPEED, 1 + 8 + 4); @@ -12927,17 +12945,6 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) return; } - /*data.append(GetPackGUID()); - data << uint32(0); // movement flags - data << uint16(0); // unk flags - data << uint32(getMSTime()); - data << float(GetPositionX()); - data << float(GetPositionY()); - data << float(GetPositionZ()); - data << float(GetOrientation()); - data << uint32(0); // fall time - data << float(GetSpeed(mtype));*/ - SendMessageToSet(&data, true); } else @@ -12956,7 +12963,7 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) switch (mtype) { case MOVE_WALK: - data.Initialize(SMSG_MOVE_SET_WALK_SPEED, 1 + 8 + 4 + 4 ); + data.Initialize(SMSG_MOVE_SET_WALK_SPEED, 1 + 8 + 4 + 4); data.WriteBit(bytes[6]); data.WriteBit(bytes[5]); data.WriteBit(bytes[7]); @@ -12978,7 +12985,7 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) data.WriteByteSeq(bytes[0]); break; case MOVE_RUN: - data.Initialize(SMSG_MOVE_SET_RUN_SPEED, 1 + 8 + 4 + 4 ); + data.Initialize(SMSG_MOVE_SET_RUN_SPEED, 1 + 8 + 4 + 4); data.WriteBit(bytes[6]); data.WriteBit(bytes[1]); data.WriteBit(bytes[5]); @@ -13002,30 +13009,29 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) data.WriteByteSeq(bytes[2]); break; case MOVE_RUN_BACK: - data.Initialize(SMSG_MOVE_SET_RUN_BACK_SPEED, 1 + 8 + 4 + 4 ); - data.WriteBit(bytes[3]); + data.Initialize(SMSG_MOVE_SET_RUN_BACK_SPEED, 1 + 8 + 4 + 4); data.WriteBit(bytes[0]); data.WriteBit(bytes[6]); data.WriteBit(bytes[2]); - data.WriteBit(bytes[7]); data.WriteBit(bytes[1]); + data.WriteBit(bytes[3]); data.WriteBit(bytes[4]); data.WriteBit(bytes[5]); + data.WriteBit(bytes[7]); + data.WriteByteSeq(bytes[5]); + data << uint32(0); data << float(GetSpeed(mtype)); - + data.WriteByteSeq(bytes[0]); data.WriteByteSeq(bytes[4]); - data.WriteByteSeq(bytes[1]); - data << uint32(0); - data.WriteByteSeq(bytes[5]); - data.WriteByteSeq(bytes[3]); data.WriteByteSeq(bytes[7]); - data.WriteByteSeq(bytes[6]); + data.WriteByteSeq(bytes[3]); + data.WriteByteSeq(bytes[1]); data.WriteByteSeq(bytes[2]); - data.WriteByteSeq(bytes[0]); + data.WriteByteSeq(bytes[6]); break; case MOVE_SWIM: - data.Initialize(SMSG_MOVE_SET_SWIM_SPEED, 1 + 8 + 4 + 4 ); + data.Initialize(SMSG_MOVE_SET_SWIM_SPEED, 1 + 8 + 4 + 4); data.WriteBit(bytes[5]); data.WriteBit(bytes[4]); data.WriteBit(bytes[7]); @@ -13047,75 +13053,73 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) data.WriteByteSeq(bytes[4]); break; case MOVE_SWIM_BACK: - data.Initialize(SMSG_MOVE_SET_SWIM_BACK_SPEED, 1 + 8 + 4 + 4 ); - data.WriteBit(bytes[3]); - data.WriteBit(bytes[1]); + data.Initialize(SMSG_MOVE_SET_SWIM_BACK_SPEED, 1 + 8 + 4 + 4); data.WriteBit(bytes[4]); data.WriteBit(bytes[2]); - data.WriteBit(bytes[7]); + data.WriteBit(bytes[3]); data.WriteBit(bytes[6]); data.WriteBit(bytes[5]); + data.WriteBit(bytes[1]); data.WriteBit(bytes[0]); + data.WriteBit(bytes[7]); - data.WriteByteSeq(bytes[6]); - data.WriteByteSeq(bytes[3]); - data.WriteByteSeq(bytes[7]); - data.WriteByteSeq(bytes[0]); data << uint32(0); + data.WriteByteSeq(bytes[0]); + data.WriteByteSeq(bytes[3]); data.WriteByteSeq(bytes[4]); + data.WriteByteSeq(bytes[6]); + data.WriteByteSeq(bytes[5]); data.WriteByteSeq(bytes[1]); - data.WriteByteSeq(bytes[2]); data << float(GetSpeed(mtype)); - data.WriteByteSeq(bytes[5]); + data.WriteByteSeq(bytes[0]); + data.WriteByteSeq(bytes[7]); break; case MOVE_TURN_RATE: - data.Initialize(SMSG_MOVE_SET_TURN_RATE, 1 + 8 + 4 + 4 ); - data.WriteBit(bytes[0]); + data.Initialize(SMSG_MOVE_SET_TURN_RATE, 1 + 8 + 4 + 4); + data.WriteBit(bytes[7]); data.WriteBit(bytes[2]); data.WriteBit(bytes[1]); + data.WriteBit(bytes[0]); + data.WriteBit(bytes[4]); data.WriteBit(bytes[5]); - data.WriteBit(bytes[3]); - data.WriteBit(bytes[7]); data.WriteBit(bytes[6]); - data.WriteBit(bytes[4]); + data.WriteBit(bytes[3]); + data.WriteByteSeq(bytes[5]); + data.WriteByteSeq(bytes[7]); + data.WriteByteSeq(bytes[2]); data << float(GetSpeed(mtype)); - + data.WriteByteSeq(bytes[3]); data.WriteByteSeq(bytes[1]); - data.WriteByteSeq(bytes[4]); - data.WriteByteSeq(bytes[5]); + data.WriteByteSeq(bytes[0]); data << uint32(0); - data.WriteByteSeq(bytes[3]); data.WriteByteSeq(bytes[6]); - data.WriteByteSeq(bytes[2]); - data.WriteByteSeq(bytes[0]); - data.WriteByteSeq(bytes[7]); + data.WriteByteSeq(bytes[4]); break; case MOVE_FLIGHT: - data.Initialize(SMSG_MOVE_SET_FLIGHT_SPEED, 1 + 8 + 4 + 4 ); - data.WriteBit(bytes[0]); - data.WriteBit(bytes[7]); - data.WriteBit(bytes[4]); - data.WriteBit(bytes[5]); - data.WriteBit(bytes[6]); + data.Initialize(SMSG_MOVE_SET_FLIGHT_SPEED, 1 + 8 + 4 + 4); data.WriteBit(bytes[1]); data.WriteBit(bytes[2]); + data.WriteBit(bytes[6]); + data.WriteBit(bytes[4]); + data.WriteBit(bytes[7]); data.WriteBit(bytes[3]); + data.WriteBit(bytes[0]); + data.WriteBit(bytes[5]); + data.WriteByteSeq(bytes[3]); + data << uint32(0); + data.WriteByteSeq(bytes[6]); data << float(GetSpeed(mtype)); - - data.WriteByteSeq(bytes[5]); data.WriteByteSeq(bytes[1]); - data.WriteByteSeq(bytes[7]); - data.WriteByteSeq(bytes[0]); data.WriteByteSeq(bytes[2]); - data << uint32(0); - data.WriteByteSeq(bytes[6]); - data.WriteByteSeq(bytes[3]); data.WriteByteSeq(bytes[4]); + data.WriteByteSeq(bytes[0]); + data.WriteByteSeq(bytes[5]); + data.WriteByteSeq(bytes[7]); break; case MOVE_FLIGHT_BACK: - data.Initialize(SMSG_MOVE_SET_FLIGHT_BACK_SPEED, 1 + 8 + 4 + 4 ); + data.Initialize(SMSG_MOVE_SET_FLIGHT_BACK_SPEED, 1 + 8 + 4 + 4); data.WriteBit(bytes[3]); data.WriteBit(bytes[4]); data.WriteBit(bytes[5]); @@ -13137,26 +13141,26 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) data.WriteByteSeq(bytes[5]); break; case MOVE_PITCH_RATE: - data.Initialize(SMSG_MOVE_SET_PITCH_RATE, 1 + 8 + 4 + 4 ); - data.WriteBit(bytes[7]); - data.WriteBit(bytes[5]); - data.WriteBit(bytes[6]); + data.Initialize(SMSG_MOVE_SET_PITCH_RATE, 1 + 8 + 4 + 4); + data.WriteBit(bytes[1]); data.WriteBit(bytes[2]); - data.WriteBit(bytes[4]); + data.WriteBit(bytes[6]); + data.WriteBit(bytes[7]); data.WriteBit(bytes[0]); data.WriteBit(bytes[3]); - data.WriteBit(bytes[1]); + data.WriteBit(bytes[5]); + data.WriteBit(bytes[4]); + data << float(GetSpeed(mtype)); + data.WriteByteSeq(bytes[6]); + data.WriteByteSeq(bytes[4]); data.WriteByteSeq(bytes[0]); data << uint32(0); - data.WriteByteSeq(bytes[3]); - data << float(GetSpeed(mtype)); - data.WriteByteSeq(bytes[5]); data.WriteByteSeq(bytes[1]); - data.WriteByteSeq(bytes[6]); - data.WriteByteSeq(bytes[7]); data.WriteByteSeq(bytes[2]); - data.WriteByteSeq(bytes[4]); + data.WriteByteSeq(bytes[7]); + data.WriteByteSeq(bytes[3]); + data.WriteByteSeq(bytes[5]); break; default: sLog->outError(LOG_FILTER_UNITS, "Unit::SetSpeed: Unsupported move type (%d), data not sent to client.", mtype); @@ -13967,7 +13971,7 @@ Powers Unit::GetPowerTypeByAuraGroup(UnitMods unitMod) const case UNIT_MOD_RAGE: return POWER_RAGE; case UNIT_MOD_FOCUS: return POWER_FOCUS; case UNIT_MOD_ENERGY: return POWER_ENERGY; - case UNIT_MOD_RUNE: return POWER_RUNE; + case UNIT_MOD_RUNE: return POWER_RUNES; case UNIT_MOD_RUNIC_POWER: return POWER_RUNIC_POWER; default: case UNIT_MOD_MANA: return POWER_MANA; @@ -14194,9 +14198,9 @@ int32 Unit::GetCreatePowers(Powers power) const return 100; case POWER_RUNIC_POWER: return 1000; - case POWER_RUNE: + case POWER_RUNES: return 0; - case POWER_SOULSHARD: + case POWER_SOUL_SHARDS: return 3; case POWER_ECLIPSE: return 0; diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 6e74180ae13..c2e88f2d4d0 100644 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -1067,6 +1067,7 @@ bool Guild::Create(Player* pLeader, const std::string& name) m_motd = "No message set."; m_bankMoney = 0; m_createdDate = ::time(NULL); + m_level = 1; _CreateLogHolders(); sLog->outDebug(LOG_FILTER_GUILD, "GUILD: creating guild [%s] for leader %s (%u)", @@ -1180,8 +1181,8 @@ void Guild::HandleRoster(WorldSession* session /*= NULL*/) ObjectGuid guid = member->GetGUID(); data.WriteBit(guid[3]); data.WriteBit(guid[4]); - data.WriteBit(0); // unk - data.WriteBit(0); // unk + data.WriteBit(0); // Has Authenticator + data.WriteBit(0); // Can Scroll of Ressurect data.WriteBits(pubNoteLength, 8); data.WriteBits(offNoteLength, 8); data.WriteBit(guid[0]); @@ -1349,7 +1350,7 @@ void Guild::HandleSetMOTD(WorldSession* session, const std::string& motd) // Player must have rights to set MOTD if (!_HasRankRight(session->GetPlayer(), GR_RIGHT_SETMOTD)) - SendCommandResult(session, GUILD_INVITE, ERR_GUILD_PERMISSIONS); + SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_PERMISSIONS); else { m_motd = motd; @@ -1372,7 +1373,7 @@ void Guild::HandleSetInfo(WorldSession* session, const std::string& info) // Player must have rights to set guild's info if (!_HasRankRight(session->GetPlayer(), GR_RIGHT_MODIFY_GUILD_INFO)) - SendCommandResult(session, GUILD_CREATE, ERR_GUILD_PERMISSIONS); + SendCommandResult(session, GUILD_CREATE_S, ERR_GUILD_PERMISSIONS); else { m_info = info; @@ -1414,7 +1415,7 @@ void Guild::HandleSetLeader(WorldSession* session, const std::string& name) Player* player = session->GetPlayer(); // Only leader can assign new leader if (!_IsLeader(player)) - SendCommandResult(session, GUILD_INVITE, ERR_GUILD_PERMISSIONS); + SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_PERMISSIONS); // Old leader must be a member of guild else if (Member* pOldLeader = GetMember(player->GetGUID())) { @@ -1427,7 +1428,7 @@ void Guild::HandleSetLeader(WorldSession* session, const std::string& name) } } else - SendCommandResult(session, GUILD_INVITE, ERR_GUILD_PERMISSIONS); + SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_PERMISSIONS); } void Guild::HandleSetBankTabInfo(WorldSession* session, uint8 tabId, const std::string& name, const std::string& icon) @@ -1444,7 +1445,7 @@ void Guild::HandleSetMemberNote(WorldSession* session, std::string const& note, { // Player must have rights to set public/officer note if (!_HasRankRight(session->GetPlayer(), isPublic ? GR_RIGHT_EPNOTE : GR_RIGHT_EOFFNOTE)) - SendCommandResult(session, GUILD_INVITE, ERR_GUILD_PERMISSIONS); + SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_PERMISSIONS); else if (Member* member = GetMember(guid)) { if (isPublic) @@ -1459,7 +1460,7 @@ void Guild::HandleSetRankInfo(WorldSession* session, uint32 rankId, const std::s { // Only leader can modify ranks if (!_IsLeader(session->GetPlayer())) - SendCommandResult(session, GUILD_INVITE, ERR_GUILD_PERMISSIONS); + SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_PERMISSIONS); else if (RankInfo* rankInfo = GetRankInfo(rankId)) { sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Changed RankName to '%s', rights to 0x%08X", name.c_str(), rights); @@ -1505,7 +1506,7 @@ void Guild::HandleInviteMember(WorldSession* session, const std::string& name) Player* pInvitee = sObjectAccessor->FindPlayerByName(name.c_str()); if (!pInvitee) { - SendCommandResult(session, GUILD_INVITE, ERR_GUILD_PLAYER_NOT_FOUND_S, name); + SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_PLAYER_NOT_FOUND_S, name); return; } @@ -1515,7 +1516,7 @@ void Guild::HandleInviteMember(WorldSession* session, const std::string& name) return; if (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && pInvitee->GetTeam() != player->GetTeam()) { - SendCommandResult(session, GUILD_INVITE, ERR_GUILD_NOT_ALLIED, name); + SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_NOT_ALLIED, name); return; } // Invited player cannot be in another guild @@ -1527,13 +1528,13 @@ void Guild::HandleInviteMember(WorldSession* session, const std::string& name) // Invited player cannot be invited if (pInvitee->GetGuildIdInvited()) { - SendCommandResult(session, GUILD_INVITE, ERR_ALREADY_INVITED_TO_GUILD_S, name); + SendCommandResult(session, GUILD_INVITE_S, ERR_ALREADY_INVITED_TO_GUILD_S, name); return; } // Inviting player must have rights to invite if (!_HasRankRight(player, GR_RIGHT_INVITE)) { - SendCommandResult(session, GUILD_INVITE, ERR_GUILD_PERMISSIONS); + SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_PERMISSIONS); return; } @@ -1544,9 +1545,9 @@ void Guild::HandleInviteMember(WorldSession* session, const std::string& name) WorldPacket data(SMSG_GUILD_INVITE, 100); data << uint32(GetLevel()); - data << uint32(m_emblemInfo.GetStyle()); - data << uint32(m_emblemInfo.GetBorderColor()); data << uint32(m_emblemInfo.GetBorderStyle()); + data << uint32(m_emblemInfo.GetBorderColor()); + data << uint32(m_emblemInfo.GetStyle()); data << uint32(m_emblemInfo.GetBackgroundColor()); data << uint32(m_emblemInfo.GetColor()); @@ -1628,7 +1629,7 @@ void Guild::HandleLeaveMember(WorldSession* session) { if (m_members.size() > 1) // Leader cannot leave if he is not the last member - SendCommandResult(session, GUILD_QUIT, ERR_GUILD_LEADER_LEAVE); + SendCommandResult(session, GUILD_QUIT_S, ERR_GUILD_LEADER_LEAVE); else // Guild is disbanded if leader leaves. Disband(); @@ -1640,7 +1641,7 @@ void Guild::HandleLeaveMember(WorldSession* session) _LogEvent(GUILD_EVENT_LOG_LEAVE_GUILD, player->GetGUIDLow()); _BroadcastEvent(GE_LEFT, player->GetGUID(), player->GetName()); - SendCommandResult(session, GUILD_QUIT, ERR_PLAYER_NO_MORE_IN_GUILD, m_name); + SendCommandResult(session, GUILD_QUIT_S, ERR_PLAYER_NO_MORE_IN_GUILD, m_name); } } @@ -1652,16 +1653,16 @@ void Guild::HandleRemoveMember(WorldSession* session, uint64 guid) // Player must have rights to remove members if (!_HasRankRight(player, GR_RIGHT_REMOVE)) - SendCommandResult(session, GUILD_INVITE, ERR_GUILD_PERMISSIONS); + SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_PERMISSIONS); // Removed player must be a member of the guild else if (member && removedPlayer) { // Guild masters cannot be removed if (member->IsRank(GR_GUILDMASTER)) - SendCommandResult(session, GUILD_QUIT, ERR_GUILD_LEADER_LEAVE); + SendCommandResult(session, GUILD_QUIT_S, ERR_GUILD_LEADER_LEAVE); // Do not allow to remove player with the same rank or higher else if (member->IsRankNotLower(player->GetRank())) - SendCommandResult(session, GUILD_QUIT, ERR_GUILD_RANK_TOO_HIGH_S, removedPlayer->GetName()); + SendCommandResult(session, GUILD_QUIT_S, ERR_GUILD_RANK_TOO_HIGH_S, removedPlayer->GetName()); else { // After call to DeleteMember pointer to member becomes invalid @@ -1671,7 +1672,7 @@ void Guild::HandleRemoveMember(WorldSession* session, uint64 guid) } } else if (removedPlayer) - SendCommandResult(session, GUILD_QUIT, ERR_PLAYER_NO_MORE_IN_GUILD, removedPlayer->GetName()); + SendCommandResult(session, GUILD_QUIT_S, ERR_PLAYER_NO_MORE_IN_GUILD, removedPlayer->GetName()); } void Guild::HandleUpdateMemberRank(WorldSession* session, uint64 targetGuid, bool demote) @@ -1683,14 +1684,14 @@ void Guild::HandleUpdateMemberRank(WorldSession* session, uint64 targetGuid, boo { if (!_HasRankRight(player, demote ? GR_RIGHT_DEMOTE : GR_RIGHT_PROMOTE)) { - SendCommandResult(session, GUILD_INVITE, ERR_GUILD_PERMISSIONS); + SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_PERMISSIONS); return; } // Player cannot promote himself if (member->IsSamePlayer(player->GetGUID())) { - SendCommandResult(session, GUILD_INVITE, ERR_GUILD_NAME_INVALID); + SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_NAME_INVALID); return; } @@ -1699,13 +1700,13 @@ void Guild::HandleUpdateMemberRank(WorldSession* session, uint64 targetGuid, boo // Player can demote only lower rank members if (member->IsRankNotLower(player->GetRank())) { - SendCommandResult(session, GUILD_INVITE, ERR_GUILD_RANK_TOO_HIGH_S, member->GetName()); + SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_RANK_TOO_HIGH_S, member->GetName()); return; } // Lowest rank cannot be demoted if (member->GetRankId() >= _GetLowestRankId()) { - SendCommandResult(session, GUILD_INVITE, ERR_GUILD_RANK_TOO_LOW_S, member->GetName()); + SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_RANK_TOO_LOW_S, member->GetName()); return; } } @@ -1715,7 +1716,7 @@ void Guild::HandleUpdateMemberRank(WorldSession* session, uint64 targetGuid, boo // member->GetRank() + 1 is the highest rank that current player can promote to if (member->IsRankNotLower(player->GetRank() + 1)) { - SendCommandResult(session, GUILD_INVITE, ERR_GUILD_RANK_TOO_HIGH_S, member->GetName()); + SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_RANK_TOO_HIGH_S, member->GetName()); return; } } @@ -1736,14 +1737,14 @@ void Guild::HandleSetMemberRank(WorldSession* session, uint64 targetGuid, uint64 { if (!_HasRankRight(player, rank > member->GetRankId() ? GR_RIGHT_DEMOTE : GR_RIGHT_PROMOTE)) { - SendCommandResult(session, GUILD_INVITE, ERR_GUILD_PERMISSIONS); + SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_PERMISSIONS); return; } // Player cannot promote himself if (member->IsSamePlayer(player->GetGUID())) { - SendCommandResult(session, GUILD_INVITE, ERR_GUILD_NAME_INVALID); + SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_NAME_INVALID); return; } @@ -1758,7 +1759,7 @@ void Guild::HandleAddNewRank(WorldSession* session, std::string const& name) //, // Only leader can add new rank if (!_IsLeader(session->GetPlayer())) - SendCommandResult(session, GUILD_INVITE, ERR_GUILD_PERMISSIONS); + SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_PERMISSIONS); else { _CreateRank(name, GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK); @@ -1775,7 +1776,7 @@ void Guild::HandleRemoveRank(WorldSession* session, uint32 rankId) // Only leader can delete ranks if (!_IsLeader(session->GetPlayer())) - SendCommandResult(session, GUILD_INVITE, ERR_GUILD_PERMISSIONS); + SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_PERMISSIONS); else { // Delete bank rights for rank @@ -1887,7 +1888,7 @@ void Guild::HandleDisband(WorldSession* session) { // Only leader can disband guild if (!_IsLeader(session->GetPlayer())) - Guild::SendCommandResult(session, GUILD_INVITE, ERR_GUILD_PERMISSIONS); + Guild::SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_PERMISSIONS); else { Disband(); @@ -1895,6 +1896,26 @@ void Guild::HandleDisband(WorldSession* session) } } +void Guild::HandleGuildPartyRequest(WorldSession* session) +{ + Player* player = session->GetPlayer(); + Group* group = player->GetGroup(); + + // Make sure player is a member of the guild and that he is in a group. + if (!IsMember(player->GetGUID()) || !group) + return; + + WorldPacket data(SMSG_GUILD_PARTY_STATE_RESPONSE, 13); + data.WriteBit(0); // Is guild group + data.FlushBits(); + data << float(0.f); // Guild XP multiplier + data << uint32(0); // Current guild members + data << uint32(0); // Needed guild members + + session->SendPacket(&data); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (SMSG_GUILD_PARTY_STATE_RESPONSE)"); +} + /////////////////////////////////////////////////////////////////////////////// // Send data to client void Guild::SendInfo(WorldSession* session) const @@ -1942,7 +1963,6 @@ void Guild::SendBankTabData(WorldSession* session, uint8 tabId) const void Guild::SendBankTabsInfo(WorldSession* session) const { - // TODO WorldPacket data(SMSG_GUILD_BANK_LIST, 500); data << uint64(m_bankMoney); @@ -2315,6 +2335,7 @@ bool Guild::AddMember(uint64 guid, uint8 rankId) { player->SetInGuild(m_id); player->SetRank(rankId); + player->SetGuildLevel(m_level); player->SetGuildIdInvited(0); } @@ -2898,7 +2919,7 @@ void Guild::_SendBankContentUpdate(MoveItemData* pSrc, MoveItemData* pDest) cons void Guild::_SendBankContentUpdate(uint8 tabId, SlotIds slots) const { - if (const BankTab* pTab = GetBankTab(tabId)) + if (BankTab const* tab = GetBankTab(tabId)) { WorldPacket data(SMSG_GUILD_BANK_LIST, 1200); @@ -2912,7 +2933,7 @@ void Guild::_SendBankContentUpdate(uint8 tabId, SlotIds slots) const data << uint8(slots.size()); for (uint8 slotId = 0; slotId < GUILD_BANK_MAX_SLOTS; ++slotId) if (slots.find(slotId) != slots.end()) - pTab->WriteSlotPacket(data, slotId); + tab->WriteSlotPacket(data, slotId); for (Members::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr) if (_MemberHasTabRights(itr->second->GetGUID(), tabId, GUILD_BANK_RIGHT_VIEW_TAB)) diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h index 5e02e88a224..94d161cd34f 100755 --- a/src/server/game/Guilds/Guild.h +++ b/src/server/game/Guilds/Guild.h @@ -77,55 +77,48 @@ enum GuildRankRights enum GuildCommandType { - GUILD_CREATE = 0x00, - GUILD_INVITE = 0x01, - GUILD_QUIT = 0x03, - GUILD_ROSTER = 0x05, - GUILD_PROMOTE = 0x06, - GUILD_DEMOTE = 0x07, - GUILD_KICK = 0x08, - GUILD_LEADER = 0x0A, - GUILD_MOTD = 0x0B, - GUILD_GUILDCHAT = 0x0D, - GUILD_FOUNDER = 0x0E, - GUILD_CHANGE_RANK = 0x10, - GUILD_EDIT_PUB_NOTE = 0x13, - GUILD_UNK = 0x14, - GUILD_VIEW_TAB = 0x15, - GUILD_MOVE_ITEM = 0x16, - GUILD_REPAIR = 0x19, + GUILD_CREATE_S = 0x00, + GUILD_INVITE_S = 0x01, + GUILD_QUIT_S = 0x03, + GUILD_FOUNDER_S = 0x0E, + GUILD_UNK1 = 0x13, + GUILD_UNK2 = 0x14 }; enum GuildCommandError { - ERR_PLAYER_NO_MORE_IN_GUILD = 0x00, - ERR_GUILD_INTERNAL = 0x01, - ERR_ALREADY_IN_GUILD = 0x02, - ERR_ALREADY_IN_GUILD_S = 0x03, - ERR_INVITED_TO_GUILD = 0x04, - ERR_ALREADY_INVITED_TO_GUILD_S = 0x05, - ERR_GUILD_NAME_INVALID = 0x06, - ERR_GUILD_NAME_EXISTS_S = 0x07, - ERR_GUILD_LEADER_LEAVE = 0x08, - ERR_GUILD_PERMISSIONS = 0x08, - ERR_GUILD_PLAYER_NOT_IN_GUILD = 0x09, - ERR_GUILD_PLAYER_NOT_IN_GUILD_S = 0x0A, - ERR_GUILD_PLAYER_NOT_FOUND_S = 0x0B, - ERR_GUILD_NOT_ALLIED = 0x0C, - ERR_GUILD_RANK_TOO_HIGH_S = 0x0D, - ERR_GUILD_RANK_TOO_LOW_S = 0x0E, - ERR_GUILD_RANKS_LOCKED = 0x11, - ERR_GUILD_RANK_IN_USE = 0x12, - ERR_GUILD_IGNORING_YOU_S = 0x13, - ERR_GUILD_UNK1 = 0x14, - ERR_GUILD_WITHDRAW_LIMIT = 0x19, - ERR_GUILD_NOT_ENOUGH_MONEY = 0x1A, - ERR_GUILD_BANK_FULL = 0x1C, - ERR_GUILD_ITEM_NOT_FOUND = 0x1D, - ERR_GUILD_TOO_MUCH_MONEY = 0x1F, - ERR_GUILD_WRONG_TAB = 0x20, - ERR_GUILD_REQ_AUTHENTICATOR = 0x22, - ERR_GUILD_BANK_VOUCHER_FAILED = 0x23, + ERR_PLAYER_NO_MORE_IN_GUILD = 0x00, + ERR_GUILD_INTERNAL = 0x01, + ERR_ALREADY_IN_GUILD = 0x02, + ERR_ALREADY_IN_GUILD_S = 0x03, + ERR_INVITED_TO_GUILD = 0x04, + ERR_ALREADY_INVITED_TO_GUILD_S = 0x05, + ERR_GUILD_NAME_INVALID = 0x06, + ERR_GUILD_NAME_EXISTS_S = 0x07, + ERR_GUILD_LEADER_LEAVE = 0x08, + ERR_GUILD_PERMISSIONS = 0x08, + ERR_GUILD_PLAYER_NOT_IN_GUILD = 0x09, + ERR_GUILD_PLAYER_NOT_IN_GUILD_S = 0x0A, + ERR_GUILD_PLAYER_NOT_FOUND_S = 0x0B, + ERR_GUILD_NOT_ALLIED = 0x0C, + ERR_GUILD_RANK_TOO_HIGH_S = 0x0D, + ERR_GUILD_RANK_TOO_LOW_S = 0x0E, + ERR_GUILD_RANKS_LOCKED = 0x11, + ERR_GUILD_RANK_IN_USE = 0x12, + ERR_GUILD_IGNORING_YOU_S = 0x13, + ERR_GUILD_UNK1 = 0x14, + ERR_GUILD_WITHDRAW_LIMIT = 0x19, + ERR_GUILD_NOT_ENOUGH_MONEY = 0x1A, + ERR_GUILD_BANK_FULL = 0x1C, + ERR_GUILD_ITEM_NOT_FOUND = 0x1D, + ERR_GUILD_TOO_MUCH_MONEY = 0x1F, + ERR_GUILD_BANK_WRONG_TAB = 0x20, + ERR_RANK_REQUIRES_AUTHENTICATOR = 0x22, + ERR_GUILD_BANK_VOUCHER_FAILED = 0x23, + ERR_GUILD_TRIAL_ACCOUNT = 0x24, + ERR_GUILD_UNDELETABLE_DUE_TO_LEVEL = 0x25, + ERR_GUILD_MOVE_STARTING = 0x26, + ERR_GUILD_REP_TOO_LOW = 0x27, }; enum GuildEvents @@ -662,6 +655,7 @@ public: bool HandleMemberWithdrawMoney(WorldSession* session, uint32 amount, bool repair = false); void HandleMemberLogout(WorldSession* session); void HandleDisband(WorldSession* session); + void HandleGuildPartyRequest(WorldSession* session); // Send info to client void SendInfo(WorldSession* session) const; @@ -770,7 +764,7 @@ private: if (itr->second->GetName() == name) return itr->second; - SendCommandResult(session, GUILD_INVITE, ERR_GUILD_PLAYER_NOT_IN_GUILD_S, name); + SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_PLAYER_NOT_IN_GUILD_S, name); return NULL; } inline void _DeleteMemberFromDB(uint32 lowguid) const diff --git a/src/server/game/Handlers/ArenaTeamHandler.cpp b/src/server/game/Handlers/ArenaTeamHandler.cpp index 3d1bfe20ced..95d8901044e 100755 --- a/src/server/game/Handlers/ArenaTeamHandler.cpp +++ b/src/server/game/Handlers/ArenaTeamHandler.cpp @@ -358,7 +358,7 @@ void WorldSession::SendArenaTeamCommandResult(uint32 teamAction, const std::stri void WorldSession::SendNotInArenaTeamPacket(uint8 type) { - WorldPacket data(SMSG_ARENA_ERROR, 4+1); // 886 - You are not in a %uv%u arena team + WorldPacket data(SMSG_ARENA_ERROR, 4+1); uint32 error = 0; data << uint32(error); // 0 = ERR_ARENA_NO_TEAM_II, 1 = ERR_ARENA_EXPIRED_CAIS, 2 = ERR_LFG_CANT_USE_BATTLEGROUND if (!error) diff --git a/src/server/game/Handlers/GuildHandler.cpp b/src/server/game/Handlers/GuildHandler.cpp index 2eb95dbba87..5bb7259a1cf 100755 --- a/src/server/game/Handlers/GuildHandler.cpp +++ b/src/server/game/Handlers/GuildHandler.cpp @@ -36,7 +36,7 @@ inline Guild* _GetPlayerGuild(WorldSession* session, bool sendError = false) if (Guild* guild = sGuildMgr->GetGuildById(guildId)) // Find guild by id return guild; if (sendError) - Guild::SendCommandResult(session, GUILD_CREATE, ERR_GUILD_PLAYER_NOT_IN_GUILD); + Guild::SendCommandResult(session, GUILD_CREATE_S, ERR_GUILD_PLAYER_NOT_IN_GUILD); return NULL; } @@ -55,7 +55,7 @@ void WorldSession::HandleGuildQueryOpcode(WorldPacket& recvPacket) return; } - Guild::SendCommandResult(this, GUILD_CREATE, ERR_GUILD_PLAYER_NOT_IN_GUILD); + Guild::SendCommandResult(this, GUILD_CREATE_S, ERR_GUILD_PLAYER_NOT_IN_GUILD); } void WorldSession::HandleGuildCreateOpcode(WorldPacket& recvPacket) @@ -460,7 +460,7 @@ void WorldSession::HandleGuildBankerActivate(WorldPacket& recvData) if (Guild* guild = _GetPlayerGuild(this)) guild->SendBankTabsInfo(this); else - Guild::SendCommandResult(this, GUILD_VIEW_TAB, ERR_GUILD_PLAYER_NOT_IN_GUILD); + Guild::SendCommandResult(this, GUILD_UNK1, ERR_GUILD_PLAYER_NOT_IN_GUILD); } } @@ -738,3 +738,31 @@ void WorldSession::HandleGuildSetRankPermissionsOpcode(WorldPacket& recvPacket) guild->HandleSetRankInfo(this, rankId, rankName, newRights, moneyPerDay, rightsAndSlots); } + +void WorldSession::HandleGuildRequestPartyState(WorldPacket& recvData) +{ + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_REQUEST_PARTY_STATE"); + + ObjectGuid guildGuid; + + guildGuid[0] = recvData.ReadBit(); + guildGuid[6] = recvData.ReadBit(); + guildGuid[7] = recvData.ReadBit(); + guildGuid[3] = recvData.ReadBit(); + guildGuid[5] = recvData.ReadBit(); + guildGuid[1] = recvData.ReadBit(); + guildGuid[2] = recvData.ReadBit(); + guildGuid[4] = recvData.ReadBit(); + + recvData.ReadByteSeq(guildGuid[6]); + recvData.ReadByteSeq(guildGuid[3]); + recvData.ReadByteSeq(guildGuid[2]); + recvData.ReadByteSeq(guildGuid[1]); + recvData.ReadByteSeq(guildGuid[5]); + recvData.ReadByteSeq(guildGuid[0]); + recvData.ReadByteSeq(guildGuid[7]); + recvData.ReadByteSeq(guildGuid[4]); + + if (Guild* guild = sGuildMgr->GetGuildByGuid(guildGuid)) + guild->HandleGuildPartyRequest(this); +} diff --git a/src/server/game/Handlers/PetitionsHandler.cpp b/src/server/game/Handlers/PetitionsHandler.cpp index c8b79a9da10..263aa8846ee 100755 --- a/src/server/game/Handlers/PetitionsHandler.cpp +++ b/src/server/game/Handlers/PetitionsHandler.cpp @@ -157,12 +157,12 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recvData) { if (sGuildMgr->GetGuildByName(name)) { - Guild::SendCommandResult(this, GUILD_CREATE, ERR_GUILD_NAME_EXISTS_S, name); + Guild::SendCommandResult(this, GUILD_CREATE_S, ERR_GUILD_NAME_EXISTS_S, name); return; } if (sObjectMgr->IsReservedName(name) || !ObjectMgr::IsValidCharterName(name)) { - Guild::SendCommandResult(this, GUILD_CREATE, ERR_GUILD_NAME_INVALID, name); + Guild::SendCommandResult(this, GUILD_CREATE_S, ERR_GUILD_NAME_INVALID, name); return; } } @@ -423,12 +423,12 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket & recvData) { if (sGuildMgr->GetGuildByName(newName)) { - Guild::SendCommandResult(this, GUILD_CREATE, ERR_GUILD_NAME_EXISTS_S, newName); + Guild::SendCommandResult(this, GUILD_CREATE_S, ERR_GUILD_NAME_EXISTS_S, newName); return; } if (sObjectMgr->IsReservedName(newName) || !ObjectMgr::IsValidCharterName(newName)) { - Guild::SendCommandResult(this, GUILD_CREATE, ERR_GUILD_NAME_INVALID, newName); + Guild::SendCommandResult(this, GUILD_CREATE_S, ERR_GUILD_NAME_INVALID, newName); return; } } @@ -498,7 +498,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recvData) if (type != GUILD_CHARTER_TYPE) SendArenaTeamCommandResult(ERR_ARENA_TEAM_INVITE_SS, "", "", ERR_ARENA_TEAM_NOT_ALLIED); else - Guild::SendCommandResult(this, GUILD_CREATE, ERR_GUILD_NOT_ALLIED); + Guild::SendCommandResult(this, GUILD_CREATE_S, ERR_GUILD_NOT_ALLIED); return; } @@ -530,12 +530,12 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recvData) { if (_player->GetGuildId()) { - Guild::SendCommandResult(this, GUILD_INVITE, ERR_ALREADY_IN_GUILD_S, _player->GetName()); + Guild::SendCommandResult(this, GUILD_INVITE_S, ERR_ALREADY_IN_GUILD_S, _player->GetName()); return; } if (_player->GetGuildIdInvited()) { - Guild::SendCommandResult(this, GUILD_INVITE, ERR_ALREADY_INVITED_TO_GUILD_S, _player->GetName()); + Guild::SendCommandResult(this, GUILD_INVITE_S, ERR_ALREADY_INVITED_TO_GUILD_S, _player->GetName()); return; } } @@ -658,7 +658,7 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recvData) if (type != GUILD_CHARTER_TYPE) SendArenaTeamCommandResult(ERR_ARENA_TEAM_INVITE_SS, "", "", ERR_ARENA_TEAM_NOT_ALLIED); else - Guild::SendCommandResult(this, GUILD_CREATE, ERR_GUILD_NOT_ALLIED); + Guild::SendCommandResult(this, GUILD_CREATE_S, ERR_GUILD_NOT_ALLIED); return; } @@ -692,13 +692,13 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recvData) { if (player->GetGuildId()) { - Guild::SendCommandResult(this, GUILD_INVITE, ERR_ALREADY_IN_GUILD_S, _player->GetName()); + Guild::SendCommandResult(this, GUILD_INVITE_S, ERR_ALREADY_IN_GUILD_S, _player->GetName()); return; } if (player->GetGuildIdInvited()) { - Guild::SendCommandResult(this, GUILD_INVITE, ERR_ALREADY_INVITED_TO_GUILD_S, _player->GetName()); + Guild::SendCommandResult(this, GUILD_INVITE_S, ERR_ALREADY_INVITED_TO_GUILD_S, _player->GetName()); return; } } @@ -790,7 +790,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recvData) // Check if guild name is already taken if (sGuildMgr->GetGuildByName(name)) { - Guild::SendCommandResult(this, GUILD_CREATE, ERR_GUILD_NAME_EXISTS_S, name); + Guild::SendCommandResult(this, GUILD_CREATE_S, ERR_GUILD_NAME_EXISTS_S, name); return; } } diff --git a/src/server/game/Handlers/ReferAFriendHandler.cpp b/src/server/game/Handlers/ReferAFriendHandler.cpp index 7822c38d390..90fbe068984 100644 --- a/src/server/game/Handlers/ReferAFriendHandler.cpp +++ b/src/server/game/Handlers/ReferAFriendHandler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 TrinityCore + * Copyright (C) 2012 TrinityCore * * 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 diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 13225985644..a41070fa1e1 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -179,12 +179,13 @@ enum Powers POWER_RAGE = 1, POWER_FOCUS = 2, POWER_ENERGY = 3, - POWER_RUNE = 5, + POWER_UNUSED = 4, + POWER_RUNES = 5, POWER_RUNIC_POWER = 6, - POWER_SOULSHARD = 7, + POWER_SOUL_SHARDS = 7, POWER_ECLIPSE = 8, POWER_HOLY_POWER = 9, - POWER_ALTERNATIVE = 10, // Used in some quests + POWER_ALTERNATE_POWER = 10, // Used in some quests MAX_POWERS = 11, POWER_ALL = 127, // default for class? POWER_HEALTH = 0xFFFFFFFE // (-2 as signed value) @@ -834,7 +835,7 @@ enum SpellEffects SPELL_EFFECT_160 = 160, SPELL_EFFECT_TALENT_SPEC_COUNT = 161, SPELL_EFFECT_TALENT_SPEC_SELECT = 162, - SPELL_EFFECT_163 = 163, // Unused (4.2.2) + SPELL_EFFECT_163 = 163, // Unused (4.2.2) SPELL_EFFECT_REMOVE_AURA = 164, SPELL_EFFECT_165 = 165, SPELL_EFFECT_166 = 166, @@ -844,7 +845,7 @@ enum SpellEffects SPELL_EFFECT_170 = 170, SPELL_EFFECT_171 = 171, // Summons gamebject SPELL_EFFECT_172 = 172, // Aoe ressurection - SPELL_EFFECT_173 = 173, // Guild tab unlocked (guild perk) + SPELL_EFFECT_UNLOCK_GUILD_VAULT_TAB = 173, // Guild tab unlocked (guild perk) SPELL_EFFECT_174 = 174, // SPELL_EFFECT_175 = 175, // Unused (4.2.2) SPELL_EFFECT_176 = 176, // Some kind of sanctuary effect (Vanish) diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index af9a1a704da..90f9d5b2514 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -262,6 +262,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_GUILD_REPLACE_GUILD_MASTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_REQUEST_CHALLENGE_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_REQUEST_MAX_DAILY_XP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_REQUEST_PARTY_STATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildRequestPartyState ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_ROSTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildRosterOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_SET_ACHIEVEMENT_TRACKING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_SET_GUILD_MASTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -595,7 +596,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(MSG_RAID_READY_CHECK_FINISHED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidReadyCheckFinishedOpcode); DEFINE_OPCODE_HANDLER(MSG_RAID_TARGET_UPDATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidTargetUpdateOpcode ); //DEFINE_OPCODE_HANDLER(MSG_RANDOM_ROLL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRandomRollOpcode ); - //DEFINE_OPCODE_HANDLER(MSG_SAVE_GUILD_EMBLEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSaveGuildEmblemOpcode ); + DEFINE_OPCODE_HANDLER(MSG_SAVE_GUILD_EMBLEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSaveGuildEmblemOpcode ); DEFINE_OPCODE_HANDLER(MSG_SET_DUNGEON_DIFFICULTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetDungeonDifficultyOpcode); DEFINE_OPCODE_HANDLER(MSG_SET_RAID_DIFFICULTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetRaidDifficultyOpcode ); DEFINE_OPCODE_HANDLER(MSG_TABARDVENDOR_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTabardVendorActivateOpcode); @@ -841,7 +842,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_GUILD_CHALLENGE_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_CHANGE_NAME_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_COMMAND_RESULT_2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_COMMAND_RESULT_2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_CRITERIA_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_CRITERIA_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_DECLINE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -859,7 +860,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_GUILD_MOVE_STARTING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_NEWS_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_NEWS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_PARTY_STATE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_PARTY_STATE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_PERMISSIONS_QUERY_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_RANK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -985,14 +986,14 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_COLLISION_HEIGHT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_COMPOUND_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_RUN_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_RUN_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_SWIM_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_SWIM_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_SWIM_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1191,7 +1192,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_SWIM_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_WALK_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_START_SWIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_STOP_SWIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_UNROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 6184cf9b788..6c27c49bf79 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -277,6 +277,7 @@ enum Opcodes CMSG_GUILD_REPLACE_GUILD_MASTER = 0x1034, CMSG_GUILD_REQUEST_CHALLENGE_UPDATE = 0x1224, CMSG_GUILD_REQUEST_MAX_DAILY_XP = 0x3232, + CMSG_GUILD_REQUEST_PARTY_STATE = 0x3900, CMSG_GUILD_ROSTER = 0x1226, CMSG_GUILD_SET_ACHIEVEMENT_TRACKING = 0x1027, CMSG_GUILD_SET_GUILD_MASTER = 0x3034, @@ -468,7 +469,6 @@ enum Opcodes CMSG_REQUEST_ACCOUNT_DATA = 0x6505, CMSG_REQUEST_CATEGORY_COOLDOWNS = 0x7102, CMSG_REQUEST_CEMETERY_LIST = 0x720A, - CMSG_REQUEST_GUILD_PARTY_STATE = 0x3900, CMSG_REQUEST_HONOR_STATS = 0x791E, CMSG_REQUEST_HOTFIX = 0x2401, CMSG_REQUEST_INSPECT_RATED_BG_STATS = 0x3010, diff --git a/src/server/game/Server/WorldPacket.cpp b/src/server/game/Server/WorldPacket.cpp index c8a971743af..266f5e74e1d 100644 --- a/src/server/game/Server/WorldPacket.cpp +++ b/src/server/game/Server/WorldPacket.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 TrinityCore + * Copyright (C) 2008-2012 TrinityCore * * 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 diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 96e7d4918d6..e8d565a5459 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -581,6 +581,7 @@ class WorldSession void HandleGuildDelRankOpcode(WorldPacket& recvPacket); void HandleGuildChangeInfoTextOpcode(WorldPacket& recvPacket); void HandleSaveGuildEmblemOpcode(WorldPacket& recvPacket); + void HandleGuildRequestPartyState(WorldPacket& recvPacket); void HandleTaxiNodeStatusQueryOpcode(WorldPacket& recvPacket); void HandleTaxiQueryAvailableNodes(WorldPacket& recvPacket); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 4ce914cfdc5..c2b74a6efad 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -4142,7 +4142,7 @@ void AuraEffect::HandleModPowerRegen(AuraApplication const* aurApp, uint8 mode, // Update manaregen value if (GetMiscValue() == POWER_MANA) target->ToPlayer()->UpdateManaRegen(); - else if (GetMiscValue() == POWER_RUNE) + else if (GetMiscValue() == POWER_RUNES) target->ToPlayer()->UpdateRuneRegen(RuneType(GetMiscValueB())); // other powers are not immediate effects - implemented in Player::Regenerate, Creature::Regenerate } diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 391a52b8aa5..5439007702c 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3868,7 +3868,7 @@ void Spell::SendSpellStart() && m_spellInfo->PowerType != POWER_HEALTH) castFlags |= CAST_FLAG_POWER_LEFT_SELF; - if (m_spellInfo->RuneCostID && m_spellInfo->PowerType == POWER_RUNE) + if (m_spellInfo->RuneCostID && m_spellInfo->PowerType == POWER_RUNES) castFlags |= CAST_FLAG_UNKNOWN_19; WorldPacket data(SMSG_SPELL_START, (8+8+4+4+2)); @@ -3960,7 +3960,7 @@ void Spell::SendSpellGo() if ((m_caster->GetTypeId() == TYPEID_PLAYER) && (m_caster->getClass() == CLASS_DEATH_KNIGHT) && m_spellInfo->RuneCostID - && m_spellInfo->PowerType == POWER_RUNE) + && m_spellInfo->PowerType == POWER_RUNES) { castFlags |= CAST_FLAG_UNKNOWN_19; // same as in SMSG_SPELL_START castFlags |= CAST_FLAG_RUNE_LIST; // rune cooldowns list @@ -4362,7 +4362,7 @@ void Spell::TakePower() bool hit = true; if (m_caster->GetTypeId() == TYPEID_PLAYER) { - if (powerType == POWER_RAGE || powerType == POWER_ENERGY || powerType == POWER_RUNE) + if (powerType == POWER_RAGE || powerType == POWER_ENERGY || powerType == POWER_RUNES) if (uint64 targetGUID = m_targets.GetUnitTargetGUID()) for (std::list::iterator ihit= m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit) if (ihit->targetGUID == targetGUID) @@ -4378,7 +4378,7 @@ void Spell::TakePower() } } - if (powerType == POWER_RUNE) + if (powerType == POWER_RUNES) { TakeRunePower(hit); return; @@ -4439,7 +4439,7 @@ void Spell::TakeAmmo() SpellCastResult Spell::CheckRuneCost(uint32 runeCostID) { - if (m_spellInfo->PowerType != POWER_RUNE || !runeCostID) + if (m_spellInfo->PowerType != POWER_RUNES || !runeCostID) return SPELL_CAST_OK; if (m_caster->GetTypeId() != TYPEID_PLAYER) @@ -5799,8 +5799,8 @@ SpellCastResult Spell::CheckPower() return SPELL_FAILED_UNKNOWN; } - //check rune cost only if a spell has PowerType == POWER_RUNE - if (m_spellInfo->PowerType == POWER_RUNE) + //check rune cost only if a spell has PowerType == POWER_RUNES + if (m_spellInfo->PowerType == POWER_RUNES) { SpellCastResult failReason = CheckRuneCost(m_spellInfo->RuneCostID); if (failReason != SPELL_CAST_OK) diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index e2c17dfe28a..b2543432ded 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -2115,7 +2115,7 @@ uint32 SpellInfo::CalcPowerCost(Unit const* caster, SpellSchoolMask schoolMask) case POWER_ENERGY: powerCost += int32(CalculatePctU(caster->GetMaxPower(Powers(PowerType)), ManaCostPercentage)); break; - case POWER_RUNE: + case POWER_RUNES: case POWER_RUNIC_POWER: sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "CalculateManaCost: Not implemented yet!"); break; diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h index 51c253057d2..5b7d335d0fa 100755 --- a/src/server/shared/Packets/ByteBuffer.h +++ b/src/server/shared/Packets/ByteBuffer.h @@ -54,7 +54,7 @@ class ByteBufferPositionException : public ByteBufferException { ACE_Stack_Trace trace; - sLog->outError(LOG_FILTER_GENERAL, "Attempted to %s value with size: "SIZEFMTD" in ByteBuffer (pos: " SIZEFMTD " size: "SIZEFMTD")\n[Stacktrace: %s]" , + sLog->outError(LOG_FILTER_GENERAL, "Attempted to %s value with size: "SIZEFMTD" in ByteBuffer (pos: " SIZEFMTD " size: "SIZEFMTD")\n[Stack trace: %s]" , (_add ? "put" : "get"), ValueSize, Pos, Size, trace.c_str()); } @@ -76,7 +76,7 @@ class ByteBufferSourceException : public ByteBufferException { ACE_Stack_Trace trace; - sLog->outError(LOG_FILTER_GENERAL, "Attempted to put a %s in ByteBuffer (pos: "SIZEFMTD" size: "SIZEFMTD")\n[Stacktrace: %s]", + sLog->outError(LOG_FILTER_GENERAL, "Attempted to put a %s in ByteBuffer (pos: "SIZEFMTD" size: "SIZEFMTD")\n[Stack trace: %s]", (ValueSize > 0 ? "NULL-pointer" : "zero-sized value"), Pos, Size, trace.c_str()); } }; -- cgit v1.2.3 From d2dc60dc058d1cfc76873895009e02ff4413e680 Mon Sep 17 00:00:00 2001 From: Nay Date: Fri, 10 Aug 2012 14:03:02 +0100 Subject: Core: Add missing include --- src/server/game/Entities/GameObject/GameObject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index a59dcd7d950..16151d0c79d 100755 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -29,7 +29,7 @@ #include "ScriptMgr.h" #include "CreatureAISelector.h" #include "Group.h" - +#include "MapManager.h" #include "GameObjectModel.h" #include "DynamicTree.h" -- cgit v1.2.3 From e0410e21c24cba79c678e4b73907f23911b0ef1a Mon Sep 17 00:00:00 2001 From: Nay Date: Fri, 10 Aug 2012 15:13:34 +0100 Subject: Core/PacketIO: Enable few more opcode handler (fixes mailing and others) --- src/server/game/Handlers/MailHandler.cpp | 4 ++-- src/server/game/Server/Protocol/Opcodes.cpp | 30 ++++++++++++++--------------- 2 files changed, 17 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/MailHandler.cpp b/src/server/game/Handlers/MailHandler.cpp index d54a3712377..8762613fc3b 100644 --- a/src/server/game/Handlers/MailHandler.cpp +++ b/src/server/game/Handlers/MailHandler.cpp @@ -611,7 +611,7 @@ void WorldSession::HandleGetMailList(WorldPacket& recvData) uint32 mailsCount = 0; // real send to client mails amount uint32 realCount = 0; // real mails amount - WorldPacket data(SMSG_MAIL_LIST_RESULT, (200)); // guess size + WorldPacket data(SMSG_MAIL_LIST_RESULT, 200); // guess size data << uint32(0); // real mail's count data << uint8(0); // mail's count time_t cur_time = time(NULL); @@ -659,7 +659,7 @@ void WorldSession::HandleGetMailList(WorldPacket& recvData) } data << uint64((*itr)->COD); // COD - data << uint32(0); // probably changed in 3.3.3 + data << uint32(0); // Package.dbc ID ? data << uint32((*itr)->stationery); // stationery (Stationery.dbc) data << uint64((*itr)->money); // Gold data << uint32((*itr)->checked); // flags diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 90f9d5b2514..c0aebea79ce 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -83,7 +83,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_AUTO_DECLINE_GUILD_INVITES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_BANKER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBankerActivateOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_LEAVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlefieldListOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlefieldListOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_ENTRY_INVITE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_EXIT_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_QUEUE_INVITE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -381,16 +381,16 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_PETITION_SHOWLIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionShowListOpcode ); DEFINE_OPCODE_HANDLER(CMSG_PETITION_SHOW_SIGNATURES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionShowSignOpcode ); DEFINE_OPCODE_HANDLER(CMSG_PETITION_SIGN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionSignOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_PET_ABANDON, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetAbandon ); - //DEFINE_OPCODE_HANDLER(CMSG_PET_ACTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetAction ); - //DEFINE_OPCODE_HANDLER(CMSG_PET_CANCEL_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetCancelAuraOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_PET_CAST_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetCastSpellOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_PET_ABANDON, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetAbandon ); + DEFINE_OPCODE_HANDLER(CMSG_PET_ACTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetAction ); + DEFINE_OPCODE_HANDLER(CMSG_PET_CANCEL_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetCancelAuraOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_PET_CAST_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetCastSpellOpcode ); DEFINE_OPCODE_HANDLER(CMSG_PET_LEARN_TALENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetLearnTalent ); DEFINE_OPCODE_HANDLER(CMSG_PET_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetNameQuery ); - //DEFINE_OPCODE_HANDLER(CMSG_PET_RENAME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetRename ); - //DEFINE_OPCODE_HANDLER(CMSG_PET_SET_ACTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetSetAction ); - //DEFINE_OPCODE_HANDLER(CMSG_PET_SPELL_AUTOCAST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetSpellAutocastOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_PET_STOP_ATTACK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetStopAttack ); + DEFINE_OPCODE_HANDLER(CMSG_PET_RENAME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetRename ); + DEFINE_OPCODE_HANDLER(CMSG_PET_SET_ACTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetSetAction ); + DEFINE_OPCODE_HANDLER(CMSG_PET_SPELL_AUTOCAST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetSpellAutocastOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_PET_STOP_ATTACK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetStopAttack ); DEFINE_OPCODE_HANDLER(CMSG_PING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); DEFINE_OPCODE_HANDLER(CMSG_PLAYED_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayedTime ); DEFINE_OPCODE_HANDLER(CMSG_PLAYER_LOGIN, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayerLoginOpcode ); @@ -430,7 +430,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_REORDER_CHARACTERS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_REPAIR_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepairItemOpcode ); DEFINE_OPCODE_HANDLER(CMSG_REPOP_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepopRequestOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_REPORT_PVP_AFK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReportPvPAFK ); + DEFINE_OPCODE_HANDLER(CMSG_REPORT_PVP_AFK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReportPvPAFK ); DEFINE_OPCODE_HANDLER(CMSG_REQUEST_ACCOUNT_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestAccountData ); //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_CATEGORY_COOLDOWNS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_CEMETERY_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -782,19 +782,19 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_EQUIPMENT_SET_SAVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_EQUIPMENT_SET_USE_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_EXPECTED_SPAM_RECORDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_EXPLORATION_EXPERIENCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_EXPLORATION_EXPERIENCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_FAILED_PLAYER_CONDITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_FEATURE_SYSTEM_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_FEIGN_DEATH_RESISTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_FISH_ESCAPED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_FISH_NOT_HOOKED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_FISH_ESCAPED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_FISH_NOT_HOOKED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_FLIGHT_SPLINE_SYNC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_FLOOD_DETECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_FORCED_DEATH_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_FORCE_SEND_QUEUED_PACKETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_FORCE_SET_VEHICLE_REC_ID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_FORGE_MASTER_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_FRIEND_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_FRIEND_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_CUSTOM_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_DESPAWN_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_PAGETEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -954,7 +954,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_LOOT_ROLL_WON, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LOOT_SLOT_CHANGED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LOOT_START_ROLL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MAIL_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MAIL_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MAP_OBJ_EVENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_IN_PROGRESS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From 7bb72745d1b1f081c8927554dba87bd8a399da80 Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 10 Aug 2012 16:31:14 +0200 Subject: Core/Movement: Implemented creature slow fall movement --- src/server/game/Movement/Spline/MoveSplineInit.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Movement/Spline/MoveSplineInit.h b/src/server/game/Movement/Spline/MoveSplineInit.h index 2350bdc5207..823966f6407 100644 --- a/src/server/game/Movement/Spline/MoveSplineInit.h +++ b/src/server/game/Movement/Spline/MoveSplineInit.h @@ -148,12 +148,17 @@ namespace Movement inline void MoveSplineInit::SetWalk(bool enable) { args.flags.walkmode = enable; } inline void MoveSplineInit::SetSmooth() { args.flags.EnableCatmullRom(); } inline void MoveSplineInit::SetCyclic() { args.flags.cyclic = true; } - inline void MoveSplineInit::SetFall() { args.flags.EnableFalling(); } inline void MoveSplineInit::SetVelocity(float vel) { args.velocity = vel; args.HasVelocity = true; } inline void MoveSplineInit::SetOrientationInversed() { args.flags.orientationInversed = true;} inline void MoveSplineInit::SetTransportEnter() { args.flags.EnableTransportEnter(); } inline void MoveSplineInit::SetTransportExit() { args.flags.EnableTransportExit(); } + inline void MoveSplineInit::SetOrientationFixed(bool enable) { args.flags.orientationFixed = enable; } + inline void MoveSplineInit::SetFall() + { + args.flags.EnableFalling(); + args.flags.fallingSlow = unit.HasUnitMovementFlag(MOVEMENTFLAG_FALLING_SLOW); + } inline void MoveSplineInit::MovebyPath(const PointsArray& controls, int32 path_offset) { -- cgit v1.2.3 From 55171001ee76f5d0aae2d3675c87296da0e95684 Mon Sep 17 00:00:00 2001 From: Nay Date: Fri, 10 Aug 2012 15:41:33 +0100 Subject: Core/PacketIO: Enable most arena related opcodes --- src/server/game/Handlers/ArenaTeamHandler.cpp | 11 ++++++--- src/server/game/Server/Protocol/Opcodes.cpp | 32 +++++++++++++-------------- 2 files changed, 24 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/ArenaTeamHandler.cpp b/src/server/game/Handlers/ArenaTeamHandler.cpp index 95d8901044e..c2cd470a7ac 100755 --- a/src/server/game/Handlers/ArenaTeamHandler.cpp +++ b/src/server/game/Handlers/ArenaTeamHandler.cpp @@ -348,11 +348,16 @@ void WorldSession::HandleArenaTeamLeaderOpcode(WorldPacket & recvData) void WorldSession::SendArenaTeamCommandResult(uint32 teamAction, const std::string& team, const std::string& player, uint32 errorId) { - WorldPacket data(SMSG_ARENA_TEAM_COMMAND_RESULT, 4+team.length()+1+player.length()+1+4); - data << uint32(teamAction); - data << team; + WorldPacket data(SMSG_ARENA_TEAM_COMMAND_RESULT, 2 + team.length() + player.length() + 4 + 4); + + data.WriteBits(player.length(), 7); + data.WriteBits(team.length(), 8); + data.FlushBits(); + data << player; + data << uint32(teamAction); data << uint32(errorId); + data << team; SendPacket(&data); } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index c0aebea79ce..0350f8ef49f 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -54,16 +54,16 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_AREATRIGGER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaTriggerOpcode ); DEFINE_OPCODE_HANDLER(CMSG_AREA_SPIRIT_HEALER_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaSpiritHealerQueryOpcode); DEFINE_OPCODE_HANDLER(CMSG_AREA_SPIRIT_HEALER_QUEUE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaSpiritHealerQueueOpcode); - //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamAcceptOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamAcceptOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_CREATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamDeclineOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_DISBAND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamDisbandOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamInviteOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamLeaderOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamLeaveOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamQueryOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_REMOVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamRemoveOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_ROSTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamRosterOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamDeclineOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_DISBAND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamDisbandOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamInviteOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamLeaderOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamLeaveOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamQueryOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_REMOVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamRemoveOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_ROSTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamRosterOpcode ); DEFINE_OPCODE_HANDLER(CMSG_ATTACKSTOP, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleAttackStopOpcode ); DEFINE_OPCODE_HANDLER(CMSG_ATTACKSWING, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleAttackSwingOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_BIDDER_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListBidderItems ); @@ -548,7 +548,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(MSG_CHANNEL_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_CHANNEL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_CORPSE_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCorpseQueryOpcode ); - //DEFINE_OPCODE_HANDLER(MSG_INSPECT_ARENA_TEAMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectArenaTeamsOpcode ); + DEFINE_OPCODE_HANDLER(MSG_INSPECT_ARENA_TEAMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectArenaTeamsOpcode ); //DEFINE_OPCODE_HANDLER(MSG_LIST_STABLED_PETS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleListStabledPetsOpcode ); DEFINE_OPCODE_HANDLER(MSG_MINIMAP_PING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMinimapPingOpcode ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_CHARM_TELEPORT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -619,12 +619,12 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_ARENA_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ARENA_OPPONENT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_CHANGE_FAILED_QUEUED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_ROSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_ROSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ATTACKERSTATEUPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ATTACKSTART, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ATTACKSTOP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From 348807794600d92d326ec6b7eaf544aac8eb2fc1 Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 10 Aug 2012 16:55:06 +0200 Subject: Core/PacketIO: Added WriteString method to ByteBuffer allowing to write strings without null-terminating them --- src/server/game/Movement/Spline/MoveSplineInit.h | 2 +- src/server/shared/Packets/ByteBuffer.h | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Movement/Spline/MoveSplineInit.h b/src/server/game/Movement/Spline/MoveSplineInit.h index 823966f6407..38da7cbbc48 100644 --- a/src/server/game/Movement/Spline/MoveSplineInit.h +++ b/src/server/game/Movement/Spline/MoveSplineInit.h @@ -152,8 +152,8 @@ namespace Movement inline void MoveSplineInit::SetOrientationInversed() { args.flags.orientationInversed = true;} inline void MoveSplineInit::SetTransportEnter() { args.flags.EnableTransportEnter(); } inline void MoveSplineInit::SetTransportExit() { args.flags.EnableTransportExit(); } - inline void MoveSplineInit::SetOrientationFixed(bool enable) { args.flags.orientationFixed = enable; } + inline void MoveSplineInit::SetFall() { args.flags.EnableFalling(); diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h index 5b7d335d0fa..4386ce03d42 100755 --- a/src/server/shared/Packets/ByteBuffer.h +++ b/src/server/shared/Packets/ByteBuffer.h @@ -452,6 +452,13 @@ class ByteBuffer return retval; } + //! Method for writing strings that have their length sent separately in packet + //! without null-terminating the string + void WriteString(std::string const& str) + { + append(str.c_str(), str.length()); + } + const uint8 *contents() const { return &_storage[0]; } size_t size() const { return _storage.size(); } -- cgit v1.2.3 From 90d7620adc378f97742a37f7df18ac4b5a312a91 Mon Sep 17 00:00:00 2001 From: Nay Date: Fri, 10 Aug 2012 16:06:13 +0100 Subject: Core/Misc: Use ByteBuffer's WriteString where possible/needed --- src/server/game/Guilds/Guild.cpp | 18 +++++++++--------- src/server/game/Handlers/ArenaTeamHandler.cpp | 4 ++-- src/server/game/Handlers/CharacterHandler.cpp | 2 +- src/server/game/Handlers/GroupHandler.cpp | 4 ++-- src/server/game/World/World.cpp | 4 ++-- 5 files changed, 16 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index c2e88f2d4d0..c589480a517 100644 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -1222,7 +1222,7 @@ void Guild::HandleRoster(WorldSession* session /*= NULL*/) memberData << uint32(0); // Remaining guild week Rep if (pubNoteLength) - memberData.append(member->GetPublicNote().c_str(), pubNoteLength); + memberData.WriteString(member->GetPublicNote()); memberData.WriteByteSeq(guid[3]); memberData << uint8(player ? player->getLevel() : member->GetLevel()); @@ -1234,10 +1234,10 @@ void Guild::HandleRoster(WorldSession* session /*= NULL*/) memberData << float(player ? 0.0f : float(::time(NULL) - member->GetLogoutTime()) / DAY); if (offNoteLength) - memberData.append(member->GetOfficerNote().c_str(), offNoteLength); + memberData.WriteString(member->GetOfficerNote()); memberData.WriteByteSeq(guid[6]); - memberData.append(member->GetName().c_str(), member->GetName().length()); + memberData.WriteString(member->GetName()); } size_t infoLength = m_info.length(); @@ -1247,9 +1247,9 @@ void Guild::HandleRoster(WorldSession* session /*= NULL*/) data.append(memberData); if (infoLength) - data.append(m_info.c_str(), infoLength); + data.WriteString(m_info); - data.append(m_motd.c_str(), m_motd.length()); + data.WriteString(m_motd); data << uint32(0); data << uint32(0); data << uint32(0); @@ -1333,7 +1333,7 @@ void Guild::HandleGuildRanks(WorldSession* session) rankData << uint32(rankInfo->GetRights()); if (rankInfo->GetName().length()) - rankData.append(rankInfo->GetName().c_str(), rankInfo->GetName().length()); + rankData.WriteString(rankInfo->GetName()); rankData << uint32(rankInfo->GetId()); } @@ -1584,12 +1584,12 @@ void Guild::HandleInviteMember(WorldSession* session, const std::string& name) data.WriteByteSeq(newGuildGuid[0]); if (!pInvitee->GetGuildName().empty()) - data.append(pInvitee->GetGuildName().c_str(), pInvitee->GetGuildName().length()); + data.WriteString(pInvitee->GetGuildName()); data.WriteByteSeq(newGuildGuid[7]); data.WriteByteSeq(newGuildGuid[2]); - data.append(player->GetName(), strlen(player->GetName())); + data.WriteString(player->GetName()); data.WriteByteSeq(oldGuildGuid[7]); data.WriteByteSeq(oldGuildGuid[6]); @@ -1597,7 +1597,7 @@ void Guild::HandleInviteMember(WorldSession* session, const std::string& name) data.WriteByteSeq(oldGuildGuid[0]); data.WriteByteSeq(newGuildGuid[4]); - data.append(m_name.c_str(), m_name.length()); + data.WriteString(m_name); data.WriteByteSeq(newGuildGuid[5]); data.WriteByteSeq(newGuildGuid[3]); diff --git a/src/server/game/Handlers/ArenaTeamHandler.cpp b/src/server/game/Handlers/ArenaTeamHandler.cpp index c2cd470a7ac..27ec8433fe1 100755 --- a/src/server/game/Handlers/ArenaTeamHandler.cpp +++ b/src/server/game/Handlers/ArenaTeamHandler.cpp @@ -354,10 +354,10 @@ void WorldSession::SendArenaTeamCommandResult(uint32 teamAction, const std::stri data.WriteBits(team.length(), 8); data.FlushBits(); - data << player; + data.WriteString(player); data << uint32(teamAction); data << uint32(errorId); - data << team; + data.WriteString(team); SendPacket(&data); } diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 17da692c305..7c83139f6f5 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -2125,6 +2125,6 @@ void WorldSession::HandleRandomizeCharNameOpcode(WorldPacket& recvData) WorldPacket data(SMSG_RANDOMIZE_CHAR_NAME, 10); data.WriteBit(0); // unk data.WriteBits(name->size(), 7); - data.append(name->c_str(), name->size()); + data.WriteString(*name); SendPacket(&data); } diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp index 5b3c82a6f16..3953550e972 100644 --- a/src/server/game/Handlers/GroupHandler.cpp +++ b/src/server/game/Handlers/GroupHandler.cpp @@ -211,7 +211,7 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket & recvData) data.WriteByteSeq(invitedGuid[7]); - data.append((uint8 const*)player->GetName(), strlen(player->GetName())); // invited name + data.WriteString(player->GetName()); // invited name data << int32(0); @@ -313,7 +313,7 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket & recvData) data.WriteByteSeq(invitedGuid[7]); - data.append((uint8 const*)player->GetName(), strlen(player->GetName())); // invited name + data.WriteString(player->GetName()); data << int32(0); diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index f8a08200c42..aa48dcca787 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -2601,7 +2601,7 @@ void World::SendAutoBroadcast() WorldPacket data(SMSG_NOTIFICATION, 2 + msg.length()); data.WriteBits(msg.length(), 13); data.FlushBits(); - data.append(msg.c_str(), msg.length()); + data.WriteString(msg); sWorld->SendGlobalMessage(&data); } @@ -2612,7 +2612,7 @@ void World::SendAutoBroadcast() WorldPacket data(SMSG_NOTIFICATION, 2 + msg.length()); data.WriteBits(msg.length(), 13); data.FlushBits(); - data.append(msg.c_str(), msg.length()); + data.WriteString(msg); sWorld->SendGlobalMessage(&data); } -- cgit v1.2.3 From cf2d235c72f7459acccb344eacbbbc87da9af11b Mon Sep 17 00:00:00 2001 From: Nay Date: Fri, 10 Aug 2012 16:09:32 +0100 Subject: Core/PacketIO: Enable 2 opcode handlers, remove legacy HandlePageQuerySkippedOpcode --- src/server/game/Handlers/ItemHandler.cpp | 13 ------------- src/server/game/Server/Protocol/Opcodes.cpp | 4 ++-- src/server/game/Server/WorldSession.h | 1 - 3 files changed, 2 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 3b2d40f9000..b25acee1589 100644 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -473,19 +473,6 @@ void WorldSession::HandleReadItem(WorldPacket& recvData) _player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL); } -void WorldSession::HandlePageQuerySkippedOpcode(WorldPacket & recvData) -{ - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_PAGE_TEXT_QUERY"); - - uint32 itemid; - uint64 guid; - - recvData >> itemid >> guid; - - sLog->outInfo(LOG_FILTER_NETWORKIO, "Packet Info: itemid: %u guidlow: %u guidentry: %u guidhigh: %u", - itemid, GUID_LOPART(guid), GUID_ENPART(guid), GUID_HIPART(guid)); -} - void WorldSession::HandleSellItemOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_SELL_ITEM"); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 0350f8ef49f..8c34db04978 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -373,7 +373,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_OPENING_CINEMATIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_OPEN_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleOpenItemOpcode ); DEFINE_OPCODE_HANDLER(CMSG_OPT_OUT_OF_LOOT, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleOptOutOfLootOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_PAGE_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePageTextQueryOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_PAGE_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePageTextQueryOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_PARTY_SILENCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_PARTY_UNSILENCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_PETITION_BUY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionBuyOpcode ); @@ -1105,7 +1105,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_RANDOMIZE_CHAR_NAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_RATED_BG_RATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_RATED_BG_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_READ_ITEM_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_READ_ITEM_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_READ_ITEM_OK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_REALM_SPLIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_REAL_GROUP_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index e8d565a5459..6cb38a7e12a 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -743,7 +743,6 @@ class WorldSession void HandleCompleteCinematic(WorldPacket& recvPacket); void HandleNextCinematicCamera(WorldPacket& recvPacket); - void HandlePageQuerySkippedOpcode(WorldPacket& recvPacket); void HandlePageTextQueryOpcode(WorldPacket& recvPacket); void HandleTutorialFlag (WorldPacket& recvData); -- cgit v1.2.3 From 274a54c1529e9cf22778866cf5ddb0e9b919fdb3 Mon Sep 17 00:00:00 2001 From: Nay Date: Fri, 10 Aug 2012 16:58:39 +0100 Subject: Core: Cleanup whitespace, fix build and enable 1 opcode --- src/server/game/Entities/Player/Player.cpp | 46 +++++++++++----------- src/server/game/Entities/Unit/Unit.cpp | 8 ++-- src/server/game/Handlers/ChannelHandler.cpp | 32 +++++++-------- src/server/game/Handlers/GroupHandler.cpp | 10 ++--- src/server/game/Handlers/MailHandler.cpp | 26 ++++++------ src/server/game/Handlers/TaxiHandler.cpp | 2 +- src/server/game/Handlers/VehicleHandler.cpp | 2 +- src/server/game/Movement/MovementStructures.h | 8 ++-- src/server/game/Movement/Spline/MoveSplineInit.cpp | 6 +++ src/server/game/Movement/Spline/MoveSplineInit.h | 6 --- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- src/server/scripts/Commands/cs_disable.cpp | 14 +++---- src/server/shared/Logging/AppenderDB.cpp | 2 +- src/server/shared/Logging/Log.cpp | 4 +- 14 files changed, 84 insertions(+), 84 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index f1c3299a92f..5178d62bfdf 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -25415,16 +25415,16 @@ void Player::SendItemRefundResult(Item* item, ItemExtendedCostEntry const* iece, data << uint32(iece->RequiredCurrencyCount[i]); data << uint32(iece->RequiredCurrency[i]); } - + data << uint32(item->GetPaidMoney()); // money cost - + for (uint8 i = 0; i < MAX_ITEM_EXT_COST_ITEMS; ++i) // item cost data { data << uint32(iece->RequiredItemCount[i]); data << uint32(iece->RequiredItem[i]); } } - + data.WriteByteSeq(guid[0]); data.WriteByteSeq(guid[3]); data.WriteByteSeq(guid[1]); @@ -25433,7 +25433,7 @@ void Player::SendItemRefundResult(Item* item, ItemExtendedCostEntry const* iece, data.WriteByteSeq(guid[2]); data.WriteByteSeq(guid[7]); data.WriteByteSeq(guid[5]); - + data << uint8(error); // error code GetSession()->SendPacket(&data); } @@ -25735,12 +25735,12 @@ void Player::SendMovementSetCanFly(bool apply) data.WriteBit(guid[4]); data.WriteBit(guid[2]); data.WriteBit(guid[3]); - + data.WriteByteSeq(guid[6]); data.WriteByteSeq(guid[3]); - + data << uint32(0); //! movement counter - + data.WriteByteSeq(guid[2]); data.WriteByteSeq(guid[1]); data.WriteByteSeq(guid[4]); @@ -25759,12 +25759,12 @@ void Player::SendMovementSetCanFly(bool apply) data.WriteBit(guid[3]); data.WriteBit(guid[6]); data.WriteBit(guid[7]); - + data.WriteByteSeq(guid[4]); data.WriteByteSeq(guid[6]); - + data << uint32(0); //! movement counter - + data.WriteByteSeq(guid[1]); data.WriteByteSeq(guid[0]); data.WriteByteSeq(guid[2]); @@ -25808,13 +25808,13 @@ void Player::SendMovementSetWaterWalking(bool apply) data.WriteBit(guid[3]); data.WriteBit(guid[5]); data.WriteBit(guid[2]); - + data.WriteByteSeq(guid[0]); data.WriteByteSeq(guid[5]); data.WriteByteSeq(guid[2]); - + data << uint32(0); //! movement counter - + data.WriteByteSeq(guid[7]); data.WriteByteSeq(guid[3]); data.WriteByteSeq(guid[4]); @@ -25832,7 +25832,7 @@ void Player::SendMovementSetWaterWalking(bool apply) data.WriteBit(guid[4]); data.WriteBit(guid[0]); data.WriteBit(guid[7]); - + data.WriteByteSeq(guid[6]); data.WriteByteSeq(guid[1]); data.WriteByteSeq(guid[7]); @@ -25841,7 +25841,7 @@ void Player::SendMovementSetWaterWalking(bool apply) data.WriteByteSeq(guid[0]); data.WriteByteSeq(guid[3]); data.WriteByteSeq(guid[2]); - + data << uint32(0); //! movement counter } SendDirectMessage(&data); @@ -25851,7 +25851,7 @@ void Player::SendMovementSetFeatherFall(bool apply) { ObjectGuid guid = GetGUID(); WorldPacket data; - + if (apply) { data.Initialize(SMSG_MOVE_FEATHER_FALL, 1 + 4 + 8); @@ -25863,13 +25863,13 @@ void Player::SendMovementSetFeatherFall(bool apply) data.WriteBit(guid[2]); data.WriteBit(guid[5]); data.WriteBit(guid[6]); - + data.WriteByteSeq(guid[5]); data.WriteByteSeq(guid[7]); data.WriteByteSeq(guid[2]); - + data << uint32(0); //! movement counter - + data.WriteByteSeq(guid[0]); data.WriteByteSeq(guid[3]); data.WriteByteSeq(guid[4]); @@ -25879,9 +25879,9 @@ void Player::SendMovementSetFeatherFall(bool apply) else { data.Initialize(SMSG_MOVE_NORMAL_FALL, 1 + 4 + 8); - + data << uint32(0); //! movement counter - + data.WriteBit(guid[3]); data.WriteBit(guid[0]); data.WriteBit(guid[1]); @@ -25890,7 +25890,7 @@ void Player::SendMovementSetFeatherFall(bool apply) data.WriteBit(guid[4]); data.WriteBit(guid[6]); data.WriteBit(guid[2]); - + data.WriteByteSeq(guid[2]); data.WriteByteSeq(guid[7]); data.WriteByteSeq(guid[1]); @@ -25900,7 +25900,7 @@ void Player::SendMovementSetFeatherFall(bool apply) data.WriteByteSeq(guid[3]); data.WriteByteSeq(guid[6]); } - + SendDirectMessage(&data); } diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 71a277c9f99..984c1899564 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -17147,22 +17147,22 @@ void Unit::SendMoveKnockBack(Player* player, float speedXY, float speedZ, float data.WriteBit(guid[4]); data.WriteByteSeq(guid[1]); - + data << float(vsin); data << uint32(0); - + data.WriteByteSeq(guid[6]); data.WriteByteSeq(guid[7]); data << float(speedXY); - + data.WriteByteSeq(guid[4]); data.WriteByteSeq(guid[5]); data.WriteByteSeq(guid[3]); data << float(speedZ); data << float(vcos); - + data.WriteByteSeq(guid[2]); data.WriteByteSeq(guid[0]); diff --git a/src/server/game/Handlers/ChannelHandler.cpp b/src/server/game/Handlers/ChannelHandler.cpp index f940d658530..21f455c4fc8 100755 --- a/src/server/game/Handlers/ChannelHandler.cpp +++ b/src/server/game/Handlers/ChannelHandler.cpp @@ -84,7 +84,7 @@ void WorldSession::HandleLeaveChannel(WorldPacket& recvPacket) void WorldSession::HandleChannelList(WorldPacket& recvPacket) { sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); - + uint32 length = recvPacket.ReadBits(8); std::string channelname = recvPacket.ReadString(length); @@ -110,13 +110,13 @@ void WorldSession::HandleChannelPassword(WorldPacket& recvPacket) void WorldSession::HandleChannelSetOwner(WorldPacket& recvPacket) { sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); - + uint32 channelLength = recvPacket.ReadBits(8); uint32 nameLength = recvPacket.ReadBits(7); std::string newp = recvPacket.ReadString(nameLength); std::string channelname = recvPacket.ReadString(channelLength); - + if (!normalizePlayerName(newp)) return; @@ -139,13 +139,13 @@ void WorldSession::HandleChannelOwner(WorldPacket& recvPacket) void WorldSession::HandleChannelModerator(WorldPacket& recvPacket) { sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); - + uint32 channelLength = recvPacket.ReadBits(8); uint32 nameLength = recvPacket.ReadBits(7); - + std::string otp = recvPacket.ReadString(nameLength); std::string channelname = recvPacket.ReadString(channelLength); - + if (!normalizePlayerName(otp)) return; @@ -157,10 +157,10 @@ void WorldSession::HandleChannelModerator(WorldPacket& recvPacket) void WorldSession::HandleChannelUnmoderator(WorldPacket& recvPacket) { sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); - + uint32 nameLength = recvPacket.ReadBits(7); uint32 channelLength = recvPacket.ReadBits(8); - + std::string channelname = recvPacket.ReadString(channelLength); std::string otp = recvPacket.ReadString(nameLength); @@ -177,7 +177,7 @@ void WorldSession::HandleChannelMute(WorldPacket& recvPacket) sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); uint32 channelLength = recvPacket.ReadBits(8); uint32 nameLength = recvPacket.ReadBits(7); - + std::string channelname = recvPacket.ReadString(channelLength); std::string otp = recvPacket.ReadString(nameLength); @@ -198,7 +198,7 @@ void WorldSession::HandleChannelUnmute(WorldPacket& recvPacket) std::string otp = recvPacket.ReadString(nameLength); std::string channelname = recvPacket.ReadString(channelLength); - + if (!normalizePlayerName(otp)) return; @@ -229,7 +229,7 @@ void WorldSession::HandleChannelKick(WorldPacket& recvPacket) sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); uint32 channelLength = recvPacket.ReadBits(8); uint32 nameLength = recvPacket.ReadBits(7); - + std::string channelname = recvPacket.ReadString(channelLength); std::string otp = recvPacket.ReadString(nameLength); @@ -246,7 +246,7 @@ void WorldSession::HandleChannelBan(WorldPacket& recvPacket) sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); uint32 channelLength, nameLength; std::string channelname, otp; - + channelLength = recvPacket.ReadBits(8); nameLength = recvPacket.ReadBits(7); @@ -267,10 +267,10 @@ void WorldSession::HandleChannelUnban(WorldPacket& recvPacket) uint32 channelLength = recvPacket.ReadBits(7); uint32 nameLength = recvPacket.ReadBits(8); - + std::string otp = recvPacket.ReadString(nameLength); std::string channelname = recvPacket.ReadString(channelLength); - + if (!normalizePlayerName(otp)) return; @@ -282,10 +282,10 @@ void WorldSession::HandleChannelUnban(WorldPacket& recvPacket) void WorldSession::HandleChannelAnnouncements(WorldPacket& recvPacket) { sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); - + uint32 length = recvPacket.ReadBits(8); std::string channelname = recvPacket.ReadString(length); - + if (ChannelMgr* cMgr = channelMgr(_player->GetTeam())) if (Channel* chn = cMgr->GetChannel(channelname, _player)) chn->Announce(_player->GetGUID()); diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp index 3953550e972..ae549d76b33 100644 --- a/src/server/game/Handlers/GroupHandler.cpp +++ b/src/server/game/Handlers/GroupHandler.cpp @@ -96,7 +96,7 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket & recvData) recvData.ReadByteSeq(crossRealmGuid[5]); recvData.ReadByteSeq(crossRealmGuid[3]); recvData.ReadByteSeq(crossRealmGuid[2]); - + // attempt add selected player // cheating @@ -190,10 +190,10 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket & recvData) data.WriteBit(invitedGuid[7]); data.FlushBits(); - + data.WriteByteSeq(invitedGuid[1]); data.WriteByteSeq(invitedGuid[4]); - + data << int32(getMSTime()); data << int32(0); data << int32(0); @@ -212,7 +212,7 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket & recvData) data.WriteByteSeq(invitedGuid[7]); data.WriteString(player->GetName()); // invited name - + data << int32(0); player->GetSession()->SendPacket(&data); @@ -720,7 +720,7 @@ void WorldSession::HandleGroupChangeSubGroupOpcode(WorldPacket& recvData) Player* movedPlayer = sObjectAccessor->FindPlayerByName(name.c_str()); uint64 guid; - + if (movedPlayer) guid = movedPlayer->GetGUID(); else diff --git a/src/server/game/Handlers/MailHandler.cpp b/src/server/game/Handlers/MailHandler.cpp index 8762613fc3b..9ee962f4a3d 100644 --- a/src/server/game/Handlers/MailHandler.cpp +++ b/src/server/game/Handlers/MailHandler.cpp @@ -36,23 +36,23 @@ void WorldSession::HandleSendMail(WorldPacket& recvData) std::string receiver, subject, body; uint32 bodyLength, subjectLength, receiverLength; uint32 unk1, unk2; - + recvData >> unk1; recvData >> unk2; // Stationery? - + recvData >> money >> COD; // money and cod bodyLength = recvData.ReadBits(12); subjectLength = recvData.ReadBits(9); uint8 items_count = recvData.ReadBits(5); // attached items count - + if (items_count > MAX_MAIL_ITEMS) // client limit { GetPlayer()->SendMailResult(0, MAIL_SEND, MAIL_ERR_TOO_MANY_ATTACHMENTS); recvData.rfinish(); // set to end to avoid warnings spam return; } - + mailbox[0] = recvData.ReadBit(); ObjectGuid itemGUIDs[MAX_MAIL_ITEMS]; @@ -68,7 +68,7 @@ void WorldSession::HandleSendMail(WorldPacket& recvData) itemGUIDs[i][4] = recvData.ReadBit(); itemGUIDs[i][5] = recvData.ReadBit(); } - + mailbox[3] = recvData.ReadBit(); mailbox[4] = recvData.ReadBit(); receiverLength = recvData.ReadBits(7); @@ -77,9 +77,9 @@ void WorldSession::HandleSendMail(WorldPacket& recvData) mailbox[1] = recvData.ReadBit(); mailbox[7] = recvData.ReadBit(); mailbox[5] = recvData.ReadBit(); - + recvData.ReadByteSeq(mailbox[4]); - + for (uint8 i = 0; i < items_count; ++i) { recvData.ReadByteSeq(itemGUIDs[i][6]); @@ -92,22 +92,22 @@ void WorldSession::HandleSendMail(WorldPacket& recvData) recvData.ReadByteSeq(itemGUIDs[i][4]); recvData.ReadByteSeq(itemGUIDs[i][5]); } - + recvData.ReadByteSeq(mailbox[7]); recvData.ReadByteSeq(mailbox[3]); recvData.ReadByteSeq(mailbox[6]); recvData.ReadByteSeq(mailbox[5]); - + subject = recvData.ReadString(subjectLength); receiver = recvData.ReadString(receiverLength); - + recvData.ReadByteSeq(mailbox[2]); recvData.ReadByteSeq(mailbox[0]); - + body = recvData.ReadString(bodyLength); - + recvData.ReadByteSeq(mailbox[1]); - + // packet read complete, now do check if (!GetPlayer()->GetGameObjectIfCanInteractWith(mailbox, GAMEOBJECT_TYPE_MAILBOX)) diff --git a/src/server/game/Handlers/TaxiHandler.cpp b/src/server/game/Handlers/TaxiHandler.cpp index 175ea28a424..2a16efaf88b 100755 --- a/src/server/game/Handlers/TaxiHandler.cpp +++ b/src/server/game/Handlers/TaxiHandler.cpp @@ -200,7 +200,7 @@ void WorldSession::HandleMoveSplineDoneOpcode(WorldPacket& recvData) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_MOVE_SPLINE_DONE"); recvData.read_skip(); // unk - + MovementInfo movementInfo; // used only for proper packet read ReadMovementInfo(recvData, &movementInfo); diff --git a/src/server/game/Handlers/VehicleHandler.cpp b/src/server/game/Handlers/VehicleHandler.cpp index 464af1d03d7..b9603cc7822 100644 --- a/src/server/game/Handlers/VehicleHandler.cpp +++ b/src/server/game/Handlers/VehicleHandler.cpp @@ -67,7 +67,7 @@ void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket& recvData) recvData.GetOpcode(), GetPlayer()->GetGUIDLow(), seat->m_flags); return; } - + switch (recvData.GetOpcode()) { case CMSG_REQUEST_VEHICLE_PREV_SEAT: diff --git a/src/server/game/Movement/MovementStructures.h b/src/server/game/Movement/MovementStructures.h index c75229c75be..8f609e8d076 100644 --- a/src/server/game/Movement/MovementStructures.h +++ b/src/server/game/Movement/MovementStructures.h @@ -1855,7 +1855,7 @@ MovementStatusElements MoveChngTransport[]= }; // 4.3.4 -MovementStatusElements MoveSplineDone[] = +MovementStatusElements MoveSplineDone[] = { MSEPositionY, MSEPositionX, @@ -1889,11 +1889,11 @@ MovementStatusElements MoveSplineDone[] = MSEHasTransportGuidByte2, MSEHasTransportTime3, MSEHasTransportGuidByte0, - + MSEHasFallDirection, MSEMovementFlags2, MSEMovementFlags, - + MSEGuidByte7, MSEGuidByte4, MSEGuidByte5, @@ -1908,7 +1908,7 @@ MovementStatusElements MoveSplineDone[] = MSEFallCosAngle, MSEFallHorizontalSpeed, MSEFallTime, - + MSEPitch, MSEOrientation, diff --git a/src/server/game/Movement/Spline/MoveSplineInit.cpp b/src/server/game/Movement/Spline/MoveSplineInit.cpp index 5b87d9c01b9..96b925928a4 100644 --- a/src/server/game/Movement/Spline/MoveSplineInit.cpp +++ b/src/server/game/Movement/Spline/MoveSplineInit.cpp @@ -155,6 +155,12 @@ namespace Movement args.path[1] = transform(dest); } + void MoveSplineInit::SetFall() + { + args.flags.EnableFalling(); + args.flags.fallingSlow = unit.HasUnitMovementFlag(MOVEMENTFLAG_FALLING_SLOW); + } + Vector3 TransportPathTransform::operator()(Vector3 input) { if (_transformForTransport) diff --git a/src/server/game/Movement/Spline/MoveSplineInit.h b/src/server/game/Movement/Spline/MoveSplineInit.h index 38da7cbbc48..053be4e334a 100644 --- a/src/server/game/Movement/Spline/MoveSplineInit.h +++ b/src/server/game/Movement/Spline/MoveSplineInit.h @@ -154,12 +154,6 @@ namespace Movement inline void MoveSplineInit::SetTransportExit() { args.flags.EnableTransportExit(); } inline void MoveSplineInit::SetOrientationFixed(bool enable) { args.flags.orientationFixed = enable; } - inline void MoveSplineInit::SetFall() - { - args.flags.EnableFalling(); - args.flags.fallingSlow = unit.HasUnitMovementFlag(MOVEMENTFLAG_FALLING_SLOW); - } - inline void MoveSplineInit::MovebyPath(const PointsArray& controls, int32 path_offset) { args.path_Idx_offset = path_offset; diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 8c34db04978..d26389249c6 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -74,7 +74,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_REMOVE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionRemoveItem ); //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_SELL_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionSellItem ); DEFINE_OPCODE_HANDLER(CMSG_AUTH_SESSION, STATUS_NEVER, PROCESS_THREADUNSAFE, &WorldSession::Handle_EarlyProccess ); - //DEFINE_OPCODE_HANDLER(CMSG_AUTOBANK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoBankItemOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_AUTOBANK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoBankItemOpcode ); DEFINE_OPCODE_HANDLER(CMSG_AUTOEQUIP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoEquipItemOpcode ); DEFINE_OPCODE_HANDLER(CMSG_AUTOEQUIP_ITEM_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoEquipItemSlotOpcode ); DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_BAG_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoStoreBagItemOpcode ); diff --git a/src/server/scripts/Commands/cs_disable.cpp b/src/server/scripts/Commands/cs_disable.cpp index a2a80edd43b..0bb376b08dd 100644 --- a/src/server/scripts/Commands/cs_disable.cpp +++ b/src/server/scripts/Commands/cs_disable.cpp @@ -62,7 +62,7 @@ public: { "add", SEC_ADMINISTRATOR, true, NULL, "", addDisableCommandTable }, { "remove", SEC_ADMINISTRATOR, true, NULL, "", removeDisableCommandTable }, { NULL, 0, false, NULL, "", NULL } - }; + }; static ChatCommand commandTable[] = { { "disable", SEC_ADMINISTRATOR, false, NULL, "", disableCommandTable }, @@ -88,7 +88,7 @@ public: uint32 entry = uint32(atoi(entryStr)); std::string disableTypeStr = ""; - + switch (disableType) { case DISABLE_TYPE_SPELL: @@ -171,12 +171,12 @@ public: default: break; } - + PreparedStatement* stmt = NULL; stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_DISABLES); stmt->setUInt32(0, entry); - stmt->setUInt8(1, disableType); - PreparedQueryResult result = WorldDatabase.Query(stmt); + stmt->setUInt8(1, disableType); + PreparedQueryResult result = WorldDatabase.Query(stmt); if (result) { handler->PSendSysMessage("This %s (Id: %u) is already disabled.", disableTypeStr.c_str(), entry); @@ -290,8 +290,8 @@ public: PreparedStatement* stmt = NULL; stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_DISABLES); stmt->setUInt32(0, entry); - stmt->setUInt8(1, disableType); - PreparedQueryResult result = WorldDatabase.Query(stmt); + stmt->setUInt8(1, disableType); + PreparedQueryResult result = WorldDatabase.Query(stmt); if (!result) { handler->PSendSysMessage("This %s (Id: %u) is not disabled.", disableTypeStr.c_str(), entry); diff --git a/src/server/shared/Logging/AppenderDB.cpp b/src/server/shared/Logging/AppenderDB.cpp index 76abfca2d85..d85a4db9f7a 100644 --- a/src/server/shared/Logging/AppenderDB.cpp +++ b/src/server/shared/Logging/AppenderDB.cpp @@ -37,7 +37,7 @@ void AppenderDB::_write(LogMessage& message) case LOG_FILTER_SQL_DRIVER: case LOG_FILTER_SQL_DEV: break; // Avoid infinite loop, PExecute triggers Logging with LOG_FILTER_SQL type - default: + default: PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_LOG); stmt->setUInt64(0, message.mtime); stmt->setUInt32(1, realm); diff --git a/src/server/shared/Logging/Log.cpp b/src/server/shared/Logging/Log.cpp index 14234dfb155..d68c1c6170c 100644 --- a/src/server/shared/Logging/Log.cpp +++ b/src/server/shared/Logging/Log.cpp @@ -109,7 +109,7 @@ void Log::CreateAppenderFromConfig(const char* name) if (++iter != tokens.end()) flags = AppenderFlags(atoi(*iter)); - + switch (type) { case APPENDER_CONSOLE: @@ -464,7 +464,7 @@ void Log::outOpCode(uint32 op, const char* name, bool smsg) { if (!ShouldLog(LOG_FILTER_OPCODES, LOG_LEVEL_DEBUG)) return; - + outInfo(LOG_FILTER_OPCODES, "%s: %s 0x%.4X (%u)", smsg ? "S->C" : "C->S", name, op, op); } -- cgit v1.2.3 From d3c5065293cadcb2dc2a6f9f444a04aabae1d43c Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 10 Aug 2012 18:48:34 +0200 Subject: Core/PacketIO: Cleaned up manual shifting for account name length reads in CMSG_AUTH_SESSION --- src/server/game/Server/WorldSocket.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index 213206083bc..f73e36f3fbd 100644 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -870,11 +870,9 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) addonsData.resize(addonSize); recvPacket.read((uint8*)addonsData.contents(), addonSize); - uint8 highBitsAccountLen; - uint8 lowBitsAccountLen; - recvPacket >> highBitsAccountLen; - recvPacket >> lowBitsAccountLen; - account = recvPacket.ReadString(((highBitsAccountLen << 5) & 0xFF) | (lowBitsAccountLen >> 3)); + recvPacket.ReadBit(); + uint32 accountNameLength = recvPacket.ReadBits(12); + account = recvPacket.ReadString(accountNameLength); if (sWorld->IsClosed()) { -- cgit v1.2.3 From fcbc45ec231d77458040fa539abebc5a3e9f3083 Mon Sep 17 00:00:00 2001 From: cyberbrest Date: Sat, 11 Aug 2012 00:27:47 +0300 Subject: [Object]: at teleportaion transform orientation to 0-2pi range. As we cat set bad orientation to plr by transport teleportation or bad db data. + additionally check orientation at loading, for priventing loading bad orientation (Fix Freeze at loading in some cases) --- src/server/game/Entities/Player/Player.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 5178d62bfdf..37612880f39 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -2103,6 +2103,8 @@ void Player::SendTeleportPacket(Position &oldPos) bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientation, uint32 options) { + orientation = MapManager::NormalizeOrientation(orientation); + if (!MapManager::IsValidMapCoord(mapid, x, y, z, orientation)) { sLog->outError(LOG_FILTER_MAPS, "TeleportTo: invalid map (%d) or invalid coordinates (X: %f, Y: %f, Z: %f, O: %f) given when teleporting player (GUID: %u, name: %s, map: %d, X: %f, Y: %f, Z: %f, O: %f).", @@ -16699,7 +16701,11 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) // init saved position, and fix it later if problematic uint32 transGUID = uint32(fields[31].GetUInt32()); - Relocate(fields[12].GetFloat(), fields[13].GetFloat(), fields[14].GetFloat(), fields[16].GetFloat()); + + // used orientation 0-2pi range. Check for safe. + float orientation = MapManager::NormalizeOrientation(fields[16].GetFloat()); + Relocate(fields[12].GetFloat(), fields[13].GetFloat(), fields[14].GetFloat(), orientation); + uint32 mapId = fields[15].GetUInt16(); uint32 instanceId = fields[54].GetUInt32(); -- cgit v1.2.3 From c843479a5013b28ac4dfff149de57157dd4d6691 Mon Sep 17 00:00:00 2001 From: Subv Date: Fri, 10 Aug 2012 18:56:06 -0500 Subject: Core/PacketIO: Enabled more opcodes --- src/server/game/Handlers/ChannelHandler.cpp | 2 +- src/server/game/Handlers/ItemHandler.cpp | 9 +++-- src/server/game/Server/Protocol/Opcodes.cpp | 40 +++++++++++------------ src/server/game/Spells/Auras/SpellAuraEffects.cpp | 8 ++--- 4 files changed, 27 insertions(+), 32 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/ChannelHandler.cpp b/src/server/game/Handlers/ChannelHandler.cpp index 21f455c4fc8..1fb0f8a2f32 100755 --- a/src/server/game/Handlers/ChannelHandler.cpp +++ b/src/server/game/Handlers/ChannelHandler.cpp @@ -315,7 +315,7 @@ void WorldSession::HandleGetChannelMemberCount(WorldPacket &recvPacket) } } -void WorldSession::HandleSetChannelWatch(WorldPacket &recvPacket) +void WorldSession::HandleSetChannelWatch(WorldPacket& recvPacket) { sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); std::string channelname; diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index b25acee1589..616309c49a0 100644 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -29,7 +29,7 @@ #include "SpellInfo.h" #include -void WorldSession::HandleSplitItemOpcode(WorldPacket & recvData) +void WorldSession::HandleSplitItemOpcode(WorldPacket& recvData) { //sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_SPLIT_ITEM"); uint8 srcbag, srcslot, dstbag, dstslot; @@ -1008,12 +1008,11 @@ void WorldSession::HandleAutoStoreBankItemOpcode(WorldPacket& recvPacket) void WorldSession::SendEnchantmentLog(uint64 Target, uint64 Caster, uint32 ItemID, uint32 SpellID) { - WorldPacket data(SMSG_ENCHANTMENTLOG, (8+8+4+4+1)); // last check 2.0.10 - data << uint64(Target); - data << uint64(Caster); + WorldPacket data(SMSG_ENCHANTMENTLOG, (8+8+4+4+1)); // last check 4.3.4 + data.appendPackGUID(Target); + data.appendPackGUID(Caster); data << uint32(ItemID); data << uint32(SpellID); - data << uint8(0); SendPacket(&data); } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index d26389249c6..f64dbd0dc27 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -446,7 +446,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RATED_BG_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RATED_BG_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RESEARCH_HISTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_EXIT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestVehicleExit ); + DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_EXIT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestVehicleExit ); DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_NEXT_SEAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_PREV_SEAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_SWITCH_SEAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); @@ -468,7 +468,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIVE_VOICE_CHANNEL, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActiveVoiceChannel ); //DEFINE_OPCODE_HANDLER(CMSG_SET_ALLOW_LOW_LEVEL_RAID1, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_ALLOW_LOW_LEVEL_RAID2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_CHANNEL_WATCH, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetChannelWatch ); + DEFINE_OPCODE_HANDLER(CMSG_SET_CHANNEL_WATCH, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetChannelWatch ); DEFINE_OPCODE_HANDLER(CMSG_SET_CONTACT_NOTES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetContactNotesOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SET_CURRENCY_FLAGS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_EVERYONE_IS_ASSISTANT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -493,7 +493,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_SOCKET_GEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSocketOpcode ); DEFINE_OPCODE_HANDLER(CMSG_SPELLCLICK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSpellClick ); DEFINE_OPCODE_HANDLER(CMSG_SPIRIT_HEALER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSpiritHealerActivateOpcode); - //DEFINE_OPCODE_HANDLER(CMSG_SPLIT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSplitItemOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_SPLIT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSplitItemOpcode ); DEFINE_OPCODE_HANDLER(CMSG_STANDSTATECHANGE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStandStateChangeOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_STOP_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SUBMIT_BUG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -521,7 +521,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_FLAG, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialFlag ); DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_RESET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialReset ); DEFINE_OPCODE_HANDLER(CMSG_UNACCEPT_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnacceptTradeOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_SKILL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnlearnSkillOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_SKILL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnlearnSkillOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_SPECIALIZATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_UNREGISTER_ALL_ADDON_PREFIXES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnregisterAddonPrefixesOpcode); DEFINE_OPCODE_HANDLER(CMSG_UPDATE_ACCOUNT_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateAccountData ); @@ -595,7 +595,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(MSG_RAID_READY_CHECK_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_RAID_READY_CHECK_FINISHED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidReadyCheckFinishedOpcode); DEFINE_OPCODE_HANDLER(MSG_RAID_TARGET_UPDATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidTargetUpdateOpcode ); - //DEFINE_OPCODE_HANDLER(MSG_RANDOM_ROLL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRandomRollOpcode ); + DEFINE_OPCODE_HANDLER(MSG_RANDOM_ROLL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRandomRollOpcode ); DEFINE_OPCODE_HANDLER(MSG_SAVE_GUILD_EMBLEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSaveGuildEmblemOpcode ); DEFINE_OPCODE_HANDLER(MSG_SET_DUNGEON_DIFFICULTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetDungeonDifficultyOpcode); DEFINE_OPCODE_HANDLER(MSG_SET_RAID_DIFFICULTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetRaidDifficultyOpcode ); @@ -712,14 +712,14 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_CHAT_NOT_IN_PARTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHAT_PLAYER_AMBIGUOUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CHAT_PLAYER_NOT_FOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHAT_RESTRICTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CHAT_RESTRICTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHAT_SERVER_DISCONNECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHAT_SERVER_RECONNECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHAT_WRONG_FACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CHAT_WRONG_FACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_BOSS_EMOTES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_COOLDOWNS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_FAR_SIGHT_IMMEDIATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_TARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CLEAR_TARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CLIENTCACHE_VERSION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CLIENT_CONTROL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_COMBAT_EVENT_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -729,23 +729,23 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_SKIRMISH_QUEUE_RESULT1, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_SKIRMISH_QUEUE_RESULT2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_STATE_CHANGED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMPLAIN_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_COMPLAIN_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMPLETION_NPC_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_MOVES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMSAT_CONNECT_FAIL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMSAT_DISCONNECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMSAT_RECONNECT_TRY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CONTACT_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CONVERT_RUNE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CONVERT_RUNE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COOLDOWN_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COOLDOWN_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_COOLDOWN_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CORPSE_MAP_POSITION_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CORPSE_NOT_IN_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CORPSE_RECLAIM_DELAY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CREATURE_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CRITERIA_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CRITERIA_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CROSSED_INEBRIATION_THRESHOLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CROSSED_INEBRIATION_THRESHOLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CURRENCY_LOOT_REMOVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CURRENCY_LOOT_RESTORED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CUSTOM_LOAD_SCREEN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -761,7 +761,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_DISENCHANT_CREDIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_DISMOUNT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_DISMOUNTRESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DISPEL_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_DISPEL_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DISPLAY_GAME_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DONT_AUTO_PUSH_SPELLS_TO_ACTION_BAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_DROP_NEW_CONNECTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -775,12 +775,12 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_DURABILITY_DAMAGE_DEATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ECHO_PARTY_SQUELCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_EMOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ENABLE_BARBER_SHOP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ENCHANTMENTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ENABLE_BARBER_SHOP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ENCHANTMENTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ENVIRONMENTALDAMAGELOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_EQUIPMENT_SET_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_EQUIPMENT_SET_SAVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_EQUIPMENT_SET_USE_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_EQUIPMENT_SET_SAVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_EQUIPMENT_SET_USE_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_EXPECTED_SPAM_RECORDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_EXPLORATION_EXPERIENCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_FAILED_PLAYER_CONDITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -822,12 +822,12 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_GOSSIP_POI, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GROUPACTION_THROTTLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GROUP_CANCEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GROUP_DECLINE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GROUP_DECLINE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GROUP_DESTROYED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GROUP_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GROUP_JOINED_BATTLEGROUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GROUP_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GROUP_SET_LEADER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GROUP_SET_LEADER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GROUP_SET_ROLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GROUP_UNINVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_ACHIEVEMENT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -964,7 +964,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_MINIGAME_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MIRRORIMAGE_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MISSILE_CANCEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MODIFY_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MODIFY_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MONEY_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MONSTER_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MONSTER_MOVE_TRANSPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index c2b74a6efad..a815c3e805c 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -2467,9 +2467,7 @@ void AuraEffect::HandleFeignDeath(AuraApplication const* aurApp, uint8 mode, boo if (apply) { /* - WorldPacket data(SMSG_FEIGN_DEATH_RESISTED, 9); - data<GetGUID(); - data<SendMessageToSet(&data, true); */ @@ -2515,9 +2513,7 @@ void AuraEffect::HandleFeignDeath(AuraApplication const* aurApp, uint8 mode, boo else { /* - WorldPacket data(SMSG_FEIGN_DEATH_RESISTED, 9); - data<GetGUID(); - data<SendMessageToSet(&data, true); */ // blizz like 2.0.x -- cgit v1.2.3 From d5694f520ba255ec0fb2ed882d32676f8c8151e0 Mon Sep 17 00:00:00 2001 From: Subv Date: Fri, 10 Aug 2012 19:20:20 -0500 Subject: Core/PacketIO: Enabled one more opcode --- src/server/game/Entities/Player/Player.cpp | 6 +++--- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 5178d62bfdf..197fc7ddc1e 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -7204,9 +7204,9 @@ bool Player::RewardHonor(Unit* victim, uint32 groupsize, int32 honor, bool pvpto // victim_rank [5..19] HK: // victim_rank [0, 20+] HK: <> WorldPacket data(SMSG_PVP_CREDIT, 4+8+4); - data << honor; - data << victim_guid; - data << victim_rank; + data << uint32(honor); + data << uint64(victim_guid); + data << uint32(victim_rank); GetSession()->SendPacket(&data); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index f64dbd0dc27..24c4f9bfb09 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -1072,7 +1072,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_PRE_RESURRECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PROCRESIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PROPOSE_LEVEL_GRANT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PVP_CREDIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PVP_CREDIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PVP_LOG_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PVP_OPTIONS_ENABLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_QUERY_QUESTS_COMPLETED_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From edf05569b1a39100119c82cb45cc1211a0eeab42 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 11 Aug 2012 17:01:46 +0200 Subject: Core/Achievements: Compile fix by o0Loco0o --- src/server/game/Achievements/AchievementMgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 68467fe4423..723e8b1dbbc 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -1065,7 +1065,7 @@ static const uint32 achievIdForDungeon[][4] = // Helper function to avoid having to specialize template for a 800 line long function template static bool IsGuild() { return false; } -template<> static bool IsGuild() { return true; } +template<> bool IsGuild() { return true; } /** * this function will be called whenever the user might have done a criteria relevant action -- cgit v1.2.3 From 98909c049b874ab324d708083c0984d2626513c2 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 11 Aug 2012 17:02:05 +0200 Subject: Compile fix for gcc 4.5 and newer --- src/server/game/Handlers/MovementHandler.cpp | 2 +- src/server/game/Server/Protocol/Opcodes.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp index da2e7e5bfd2..dbdc4ac04fe 100644 --- a/src/server/game/Handlers/MovementHandler.cpp +++ b/src/server/game/Handlers/MovementHandler.cpp @@ -525,7 +525,7 @@ void WorldSession::HandleSetActiveMoverOpcode(WorldPacket& recvPacket) if (GetPlayer()->IsInWorld()) { if (_player->m_mover->GetGUID() != guid) - sLog->outError(LOG_FILTER_NETWORKIO, "HandleSetActiveMoverOpcode: incorrect mover guid: mover is " UI64FMTD " (%s - Entry: %u) and should be " UI64FMTD, guid, GetLogNameForGuid(guid), GUID_ENPART(guid), _player->m_mover->GetGUID()); + sLog->outError(LOG_FILTER_NETWORKIO, "HandleSetActiveMoverOpcode: incorrect mover guid: mover is " UI64FMTD " (%s - Entry: %u) and should be " UI64FMTD, uint64(guid), GetLogNameForGuid(guid), GUID_ENPART(guid), _player->m_mover->GetGUID()); } } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 24c4f9bfb09..160e1f520bb 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -30,11 +30,11 @@ void InitOpcodes() { #define DEFINE_OPCODE_HANDLER(opcode, status, processing, handler) \ if (opcode == 0) \ - sLog->outError(LOG_FILTER_NETWORKIO, "Opcode %s got value 0", #opcode); \ + sLog->outError(LOG_FILTER_NETWORKIO, "Opcode %s got value 0", #opcode); \ if (opcode < NUM_OPCODE_HANDLERS) { \ if (opcodeTable[opcode] != NULL) \ { \ - sLog->outError(LOG_FILTER_NETWORKIO, "Tried to override handler of %s with %s (opcode %u)", \ + sLog->outError(LOG_FILTER_NETWORKIO, "Tried to override handler of %s with %s (opcode %u)", \ opcodeTable[opcode]->name, #opcode, opcode); \ } \ else opcodeTable[opcode] = new OpcodeHandler(#opcode, #opcode##"_COMPRESSED", status, processing, handler); \ -- cgit v1.2.3 From 7c728f7b394485a2f0f2844ce16d4a2ba248714a Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 11 Aug 2012 20:15:02 +0200 Subject: Core/PacketIO: Updated player move speed change packet structures --- src/server/game/Entities/Unit/Unit.cpp | 594 ++++++++++++++-------------- src/server/game/Server/Protocol/Opcodes.cpp | 4 +- 2 files changed, 293 insertions(+), 305 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 984c1899564..9d924230a76 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -12745,200 +12745,199 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) propagateSpeedChange(); WorldPacket data; - uint64 guid = GetGUID(); - uint8* bytes = (uint8*)&guid; + ObjectGuid guid = GetGUID(); if (!forced) { switch (mtype) { case MOVE_WALK: data.Initialize(SMSG_SPLINE_MOVE_SET_WALK_SPEED, 8+4+2+4+4+4+4+4+4+4); - data.WriteBit(bytes[0]); - data.WriteBit(bytes[6]); - data.WriteBit(bytes[7]); - data.WriteBit(bytes[3]); - data.WriteBit(bytes[5]); - data.WriteBit(bytes[1]); - data.WriteBit(bytes[2]); - data.WriteBit(bytes[4]); + data.WriteBit(guid[0]); + data.WriteBit(guid[6]); + data.WriteBit(guid[7]); + data.WriteBit(guid[3]); + data.WriteBit(guid[5]); + data.WriteBit(guid[1]); + data.WriteBit(guid[2]); + data.WriteBit(guid[4]); data.FlushBits(); - data.WriteByteSeq(bytes[0]); - data.WriteByteSeq(bytes[4]); - data.WriteByteSeq(bytes[7]); - data.WriteByteSeq(bytes[1]); - data.WriteByteSeq(bytes[5]); - data.WriteByteSeq(bytes[3]); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[5]); + data.WriteByteSeq(guid[3]); data << float(GetSpeed(mtype)); - data.WriteByteSeq(bytes[9]); - data.WriteByteSeq(bytes[5]); + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[5]); break; case MOVE_RUN: data.Initialize(SMSG_SPLINE_MOVE_SET_RUN_SPEED, 1 + 8 + 4); - data.WriteBit(bytes[4]); - data.WriteBit(bytes[0]); - data.WriteBit(bytes[5]); - data.WriteBit(bytes[7]); - data.WriteBit(bytes[6]); - data.WriteBit(bytes[3]); - data.WriteBit(bytes[1]); - data.WriteBit(bytes[2]); + data.WriteBit(guid[4]); + data.WriteBit(guid[0]); + data.WriteBit(guid[5]); + data.WriteBit(guid[7]); + data.WriteBit(guid[6]); + data.WriteBit(guid[3]); + data.WriteBit(guid[1]); + data.WriteBit(guid[2]); data.FlushBits(); - data.WriteByteSeq(bytes[0]); - data.WriteByteSeq(bytes[7]); - data.WriteByteSeq(bytes[6]); - data.WriteByteSeq(bytes[5]); - data.WriteByteSeq(bytes[3]); - data.WriteByteSeq(bytes[4]); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[6]); + data.WriteByteSeq(guid[5]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[4]); data << float(GetSpeed(mtype)); - data.WriteByteSeq(bytes[2]); - data.WriteByteSeq(bytes[1]); + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[1]); break; case MOVE_RUN_BACK: data.Initialize(SMSG_SPLINE_MOVE_SET_RUN_BACK_SPEED, 1 + 8 + 4); - data.WriteBit(bytes[1]); - data.WriteBit(bytes[2]); - data.WriteBit(bytes[6]); - data.WriteBit(bytes[0]); - data.WriteBit(bytes[3]); - data.WriteBit(bytes[7]); - data.WriteBit(bytes[5]); - data.WriteBit(bytes[4]); + data.WriteBit(guid[1]); + data.WriteBit(guid[2]); + data.WriteBit(guid[6]); + data.WriteBit(guid[0]); + data.WriteBit(guid[3]); + data.WriteBit(guid[7]); + data.WriteBit(guid[5]); + data.WriteBit(guid[4]); data.FlushBits(); - data.WriteByteSeq(bytes[1]); + data.WriteByteSeq(guid[1]); data << float(GetSpeed(mtype)); - data.WriteByteSeq(bytes[2]); - data.WriteByteSeq(bytes[4]); - data.WriteByteSeq(bytes[0]); - data.WriteByteSeq(bytes[3]); - data.WriteByteSeq(bytes[6]); - data.WriteByteSeq(bytes[5]); - data.WriteByteSeq(bytes[7]); + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[6]); + data.WriteByteSeq(guid[5]); + data.WriteByteSeq(guid[7]); break; case MOVE_SWIM: data.Initialize(SMSG_SPLINE_MOVE_SET_SWIM_SPEED, 1 + 8 + 4); - data.WriteBit(bytes[4]); - data.WriteBit(bytes[2]); - data.WriteBit(bytes[5]); - data.WriteBit(bytes[0]); - data.WriteBit(bytes[7]); - data.WriteBit(bytes[6]); - data.WriteBit(bytes[3]); - data.WriteBit(bytes[1]); + data.WriteBit(guid[4]); + data.WriteBit(guid[2]); + data.WriteBit(guid[5]); + data.WriteBit(guid[0]); + data.WriteBit(guid[7]); + data.WriteBit(guid[6]); + data.WriteBit(guid[3]); + data.WriteBit(guid[1]); data.FlushBits(); - data.WriteByteSeq(bytes[5]); - data.WriteByteSeq(bytes[6]); - data.WriteByteSeq(bytes[1]); - data.WriteByteSeq(bytes[0]); - data.WriteByteSeq(bytes[2]); - data.WriteByteSeq(bytes[4]); + data.WriteByteSeq(guid[5]); + data.WriteByteSeq(guid[6]); + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[4]); data << float(GetSpeed(mtype)); - data.WriteByteSeq(bytes[7]); - data.WriteByteSeq(bytes[3]); + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[3]); break; case MOVE_SWIM_BACK: data.Initialize(SMSG_SPLINE_MOVE_SET_SWIM_BACK_SPEED, 1 + 8 + 4); - data.WriteBit(bytes[0]); - data.WriteBit(bytes[1]); - data.WriteBit(bytes[3]); - data.WriteBit(bytes[6]); - data.WriteBit(bytes[4]); - data.WriteBit(bytes[5]); - data.WriteBit(bytes[7]); - data.WriteBit(bytes[2]); + data.WriteBit(guid[0]); + data.WriteBit(guid[1]); + data.WriteBit(guid[3]); + data.WriteBit(guid[6]); + data.WriteBit(guid[4]); + data.WriteBit(guid[5]); + data.WriteBit(guid[7]); + data.WriteBit(guid[2]); data.FlushBits(); - data.WriteByteSeq(bytes[5]); - data.WriteByteSeq(bytes[3]); - data.WriteByteSeq(bytes[1]); - data.WriteByteSeq(bytes[0]); - data.WriteByteSeq(bytes[7]); - data.WriteByteSeq(bytes[6]); + data.WriteByteSeq(guid[5]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[6]); data << float(GetSpeed(mtype)); - data.WriteByteSeq(bytes[4]); - data.WriteByteSeq(bytes[2]); + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[2]); break; case MOVE_TURN_RATE: data.Initialize(SMSG_SPLINE_MOVE_SET_TURN_RATE, 1 + 8 + 4); - data.WriteBit(bytes[2]); - data.WriteBit(bytes[4]); - data.WriteBit(bytes[6]); - data.WriteBit(bytes[1]); - data.WriteBit(bytes[3]); - data.WriteBit(bytes[5]); - data.WriteBit(bytes[7]); - data.WriteBit(bytes[0]); + data.WriteBit(guid[2]); + data.WriteBit(guid[4]); + data.WriteBit(guid[6]); + data.WriteBit(guid[1]); + data.WriteBit(guid[3]); + data.WriteBit(guid[5]); + data.WriteBit(guid[7]); + data.WriteBit(guid[0]); data.FlushBits(); data << float(GetSpeed(mtype)); - data.WriteByteSeq(bytes[1]); - data.WriteByteSeq(bytes[5]); - data.WriteByteSeq(bytes[3]); - data.WriteByteSeq(bytes[2]); - data.WriteByteSeq(bytes[7]); - data.WriteByteSeq(bytes[4]); - data.WriteByteSeq(bytes[6]); - data.WriteByteSeq(bytes[0]); + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[5]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[6]); + data.WriteByteSeq(guid[0]); break; case MOVE_FLIGHT: data.Initialize(SMSG_SPLINE_MOVE_SET_FLIGHT_SPEED, 1 + 8 + 4); - data.WriteBit(bytes[7]); - data.WriteBit(bytes[4]); - data.WriteBit(bytes[0]); - data.WriteBit(bytes[1]); - data.WriteBit(bytes[3]); - data.WriteBit(bytes[6]); - data.WriteBit(bytes[5]); - data.WriteBit(bytes[2]); + data.WriteBit(guid[7]); + data.WriteBit(guid[4]); + data.WriteBit(guid[0]); + data.WriteBit(guid[1]); + data.WriteBit(guid[3]); + data.WriteBit(guid[6]); + data.WriteBit(guid[5]); + data.WriteBit(guid[2]); data.FlushBits(); - data.WriteByteSeq(bytes[0]); - data.WriteByteSeq(bytes[5]); - data.WriteByteSeq(bytes[4]); - data.WriteByteSeq(bytes[7]); - data.WriteByteSeq(bytes[3]); - data.WriteByteSeq(bytes[2]); - data.WriteByteSeq(bytes[1]); - data.WriteByteSeq(bytes[6]); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[5]); + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[6]); data << float(GetSpeed(mtype)); break; case MOVE_FLIGHT_BACK: data.Initialize(SMSG_SPLINE_MOVE_SET_FLIGHT_BACK_SPEED, 1 + 8 + 4); - data.WriteBit(bytes[2]); - data.WriteBit(bytes[1]); - data.WriteBit(bytes[6]); - data.WriteBit(bytes[5]); - data.WriteBit(bytes[0]); - data.WriteBit(bytes[3]); - data.WriteBit(bytes[4]); - data.WriteBit(bytes[7]); + data.WriteBit(guid[2]); + data.WriteBit(guid[1]); + data.WriteBit(guid[6]); + data.WriteBit(guid[5]); + data.WriteBit(guid[0]); + data.WriteBit(guid[3]); + data.WriteBit(guid[4]); + data.WriteBit(guid[7]); data.FlushBits(); - data.WriteByteSeq(bytes[5]); + data.WriteByteSeq(guid[5]); data << float(GetSpeed(mtype)); - data.WriteByteSeq(bytes[6]); - data.WriteByteSeq(bytes[1]); - data.WriteByteSeq(bytes[0]); - data.WriteByteSeq(bytes[2]); - data.WriteByteSeq(bytes[3]); - data.WriteByteSeq(bytes[7]); - data.WriteByteSeq(bytes[4]); + data.WriteByteSeq(guid[6]); + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[4]); break; case MOVE_PITCH_RATE: data.Initialize(SMSG_SPLINE_MOVE_SET_PITCH_RATE, 1 + 8 + 4); - data.WriteBit(bytes[3]); - data.WriteBit(bytes[5]); - data.WriteBit(bytes[6]); - data.WriteBit(bytes[1]); - data.WriteBit(bytes[0]); - data.WriteBit(bytes[4]); - data.WriteBit(bytes[7]); - data.WriteBit(bytes[2]); + data.WriteBit(guid[3]); + data.WriteBit(guid[5]); + data.WriteBit(guid[6]); + data.WriteBit(guid[1]); + data.WriteBit(guid[0]); + data.WriteBit(guid[4]); + data.WriteBit(guid[7]); + data.WriteBit(guid[2]); data.FlushBits(); - data.WriteByteSeq(bytes[1]); - data.WriteByteSeq(bytes[5]); - data.WriteByteSeq(bytes[7]); - data.WriteByteSeq(bytes[0]); - data.WriteByteSeq(bytes[6]); - data.WriteByteSeq(bytes[3]); - data.WriteByteSeq(bytes[2]); + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[5]); + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[6]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[2]); data << float(GetSpeed(mtype)); - data.WriteByteSeq(bytes[4]); + data.WriteByteSeq(guid[4]); break; default: sLog->outError(LOG_FILTER_UNITS, "Unit::SetSpeed: Unsupported move type (%d), data not sent to client.", mtype); @@ -12964,203 +12963,192 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) { case MOVE_WALK: data.Initialize(SMSG_MOVE_SET_WALK_SPEED, 1 + 8 + 4 + 4); - data.WriteBit(bytes[6]); - data.WriteBit(bytes[5]); - data.WriteBit(bytes[7]); - data.WriteBit(bytes[0]); - data.WriteBit(bytes[2]); - data.WriteBit(bytes[4]); - data.WriteBit(bytes[1]); - data.WriteBit(bytes[3]); - - data.WriteByteSeq(bytes[3]); - data.WriteByteSeq(bytes[1]); + data.WriteBit(guid[0]); + data.WriteBit(guid[4]); + data.WriteBit(guid[5]); + data.WriteBit(guid[2]); + data.WriteBit(guid[3]); + data.WriteBit(guid[1]); + data.WriteBit(guid[6]); + data.WriteBit(guid[7]); + data.WriteByteSeq(guid[6]); + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[5]); data << float(GetSpeed(mtype)); - data.WriteByteSeq(bytes[6]); - data.WriteByteSeq(bytes[4]); - data.WriteByteSeq(bytes[7]); - data.WriteByteSeq(bytes[2]); - data.WriteByteSeq(bytes[5]); + data.WriteByteSeq(guid[2]); data << uint32(0); - data.WriteByteSeq(bytes[0]); + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[3]); break; case MOVE_RUN: data.Initialize(SMSG_MOVE_SET_RUN_SPEED, 1 + 8 + 4 + 4); - data.WriteBit(bytes[6]); - data.WriteBit(bytes[1]); - data.WriteBit(bytes[5]); - data.WriteBit(bytes[2]); - data.WriteBit(bytes[7]); - data.WriteBit(bytes[0]); - data.WriteBit(bytes[3]); - data.WriteBit(bytes[4]); - - data.WriteByteSeq(bytes[5]); - data.WriteByteSeq(bytes[3]); - data.WriteByteSeq(bytes[1]); - data.WriteByteSeq(bytes[4]); - + data.WriteBit(guid[6]); + data.WriteBit(guid[1]); + data.WriteBit(guid[5]); + data.WriteBit(guid[2]); + data.WriteBit(guid[7]); + data.WriteBit(guid[0]); + data.WriteBit(guid[3]); + data.WriteBit(guid[4]); + data.WriteByteSeq(guid[5]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[4]); data << uint32(0); data << float(GetSpeed(mtype)); - - data.WriteByteSeq(bytes[6]); - data.WriteByteSeq(bytes[0]); - data.WriteByteSeq(bytes[7]); - data.WriteByteSeq(bytes[2]); + data.WriteByteSeq(guid[6]); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[2]); break; case MOVE_RUN_BACK: data.Initialize(SMSG_MOVE_SET_RUN_BACK_SPEED, 1 + 8 + 4 + 4); - data.WriteBit(bytes[0]); - data.WriteBit(bytes[6]); - data.WriteBit(bytes[2]); - data.WriteBit(bytes[1]); - data.WriteBit(bytes[3]); - data.WriteBit(bytes[4]); - data.WriteBit(bytes[5]); - data.WriteBit(bytes[7]); - - data.WriteByteSeq(bytes[5]); + data.WriteBit(guid[0]); + data.WriteBit(guid[6]); + data.WriteBit(guid[2]); + data.WriteBit(guid[1]); + data.WriteBit(guid[3]); + data.WriteBit(guid[4]); + data.WriteBit(guid[5]); + data.WriteBit(guid[7]); + data.WriteByteSeq(guid[5]); data << uint32(0); data << float(GetSpeed(mtype)); - data.WriteByteSeq(bytes[0]); - data.WriteByteSeq(bytes[4]); - data.WriteByteSeq(bytes[7]); - data.WriteByteSeq(bytes[3]); - data.WriteByteSeq(bytes[1]); - data.WriteByteSeq(bytes[2]); - data.WriteByteSeq(bytes[6]); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[6]); break; case MOVE_SWIM: data.Initialize(SMSG_MOVE_SET_SWIM_SPEED, 1 + 8 + 4 + 4); - data.WriteBit(bytes[5]); - data.WriteBit(bytes[4]); - data.WriteBit(bytes[7]); - data.WriteBit(bytes[3]); - data.WriteBit(bytes[2]); - data.WriteBit(bytes[0]); - data.WriteBit(bytes[1]); - data.WriteBit(bytes[6]); - - data.WriteByteSeq(bytes[0]); + data.WriteBit(guid[5]); + data.WriteBit(guid[4]); + data.WriteBit(guid[7]); + data.WriteBit(guid[3]); + data.WriteBit(guid[2]); + data.WriteBit(guid[0]); + data.WriteBit(guid[1]); + data.WriteBit(guid[6]); + data.WriteByteSeq(guid[0]); data << uint32(0); - data.WriteByteSeq(bytes[6]); - data.WriteByteSeq(bytes[3]); - data.WriteByteSeq(bytes[5]); - data.WriteByteSeq(bytes[2]); + data.WriteByteSeq(guid[6]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[5]); + data.WriteByteSeq(guid[2]); data << float(GetSpeed(mtype)); - data.WriteByteSeq(bytes[1]); - data.WriteByteSeq(bytes[7]); - data.WriteByteSeq(bytes[4]); + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[4]); break; case MOVE_SWIM_BACK: data.Initialize(SMSG_MOVE_SET_SWIM_BACK_SPEED, 1 + 8 + 4 + 4); - data.WriteBit(bytes[4]); - data.WriteBit(bytes[2]); - data.WriteBit(bytes[3]); - data.WriteBit(bytes[6]); - data.WriteBit(bytes[5]); - data.WriteBit(bytes[1]); - data.WriteBit(bytes[0]); - data.WriteBit(bytes[7]); - + data.WriteBit(guid[4]); + data.WriteBit(guid[2]); + data.WriteBit(guid[3]); + data.WriteBit(guid[6]); + data.WriteBit(guid[5]); + data.WriteBit(guid[1]); + data.WriteBit(guid[0]); + data.WriteBit(guid[7]); data << uint32(0); - data.WriteByteSeq(bytes[0]); - data.WriteByteSeq(bytes[3]); - data.WriteByteSeq(bytes[4]); - data.WriteByteSeq(bytes[6]); - data.WriteByteSeq(bytes[5]); - data.WriteByteSeq(bytes[1]); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[6]); + data.WriteByteSeq(guid[5]); + data.WriteByteSeq(guid[1]); data << float(GetSpeed(mtype)); - data.WriteByteSeq(bytes[0]); - data.WriteByteSeq(bytes[7]); + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[2]); break; case MOVE_TURN_RATE: data.Initialize(SMSG_MOVE_SET_TURN_RATE, 1 + 8 + 4 + 4); - data.WriteBit(bytes[7]); - data.WriteBit(bytes[2]); - data.WriteBit(bytes[1]); - data.WriteBit(bytes[0]); - data.WriteBit(bytes[4]); - data.WriteBit(bytes[5]); - data.WriteBit(bytes[6]); - data.WriteBit(bytes[3]); - - data.WriteByteSeq(bytes[5]); - data.WriteByteSeq(bytes[7]); - data.WriteByteSeq(bytes[2]); + data.WriteBit(guid[7]); + data.WriteBit(guid[2]); + data.WriteBit(guid[1]); + data.WriteBit(guid[0]); + data.WriteBit(guid[4]); + data.WriteBit(guid[5]); + data.WriteBit(guid[6]); + data.WriteBit(guid[3]); + data.WriteByteSeq(guid[5]); + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[2]); data << float(GetSpeed(mtype)); - data.WriteByteSeq(bytes[3]); - data.WriteByteSeq(bytes[1]); - data.WriteByteSeq(bytes[0]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[0]); data << uint32(0); - data.WriteByteSeq(bytes[6]); - data.WriteByteSeq(bytes[4]); + data.WriteByteSeq(guid[6]); + data.WriteByteSeq(guid[4]); break; case MOVE_FLIGHT: data.Initialize(SMSG_MOVE_SET_FLIGHT_SPEED, 1 + 8 + 4 + 4); - data.WriteBit(bytes[1]); - data.WriteBit(bytes[2]); - data.WriteBit(bytes[6]); - data.WriteBit(bytes[4]); - data.WriteBit(bytes[7]); - data.WriteBit(bytes[3]); - data.WriteBit(bytes[0]); - data.WriteBit(bytes[5]); - - data.WriteByteSeq(bytes[3]); - data << uint32(0); - data.WriteByteSeq(bytes[6]); + data.WriteBit(guid[0]); + data.WriteBit(guid[5]); + data.WriteBit(guid[1]); + data.WriteBit(guid[6]); + data.WriteBit(guid[3]); + data.WriteBit(guid[2]); + data.WriteBit(guid[7]); + data.WriteBit(guid[4]); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[5]); data << float(GetSpeed(mtype)); - data.WriteByteSeq(bytes[1]); - data.WriteByteSeq(bytes[2]); - data.WriteByteSeq(bytes[4]); - data.WriteByteSeq(bytes[0]); - data.WriteByteSeq(bytes[5]); - data.WriteByteSeq(bytes[7]); + data << uint32(0); + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[6]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[4]); break; case MOVE_FLIGHT_BACK: data.Initialize(SMSG_MOVE_SET_FLIGHT_BACK_SPEED, 1 + 8 + 4 + 4); - data.WriteBit(bytes[3]); - data.WriteBit(bytes[4]); - data.WriteBit(bytes[5]); - data.WriteBit(bytes[6]); - data.WriteBit(bytes[1]); - data.WriteBit(bytes[0]); - data.WriteBit(bytes[2]); - data.WriteBit(bytes[7]); - - data.WriteByteSeq(bytes[0]); - data << float(GetSpeed(mtype)); - data.WriteByteSeq(bytes[2]); - data.WriteByteSeq(bytes[7]); + data.WriteBit(guid[1]); + data.WriteBit(guid[2]); + data.WriteBit(guid[6]); + data.WriteBit(guid[4]); + data.WriteBit(guid[7]); + data.WriteBit(guid[3]); + data.WriteBit(guid[0]); + data.WriteBit(guid[5]); + data.WriteByteSeq(guid[3]); data << uint32(0); - data.WriteByteSeq(bytes[1]); - data.WriteByteSeq(bytes[3]); - data.WriteByteSeq(bytes[6]); - data.WriteByteSeq(bytes[4]); - data.WriteByteSeq(bytes[5]); + data.WriteByteSeq(guid[6]); + data << float(GetSpeed(mtype)); + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[5]); + data.WriteByteSeq(guid[7]); break; case MOVE_PITCH_RATE: data.Initialize(SMSG_MOVE_SET_PITCH_RATE, 1 + 8 + 4 + 4); - data.WriteBit(bytes[1]); - data.WriteBit(bytes[2]); - data.WriteBit(bytes[6]); - data.WriteBit(bytes[7]); - data.WriteBit(bytes[0]); - data.WriteBit(bytes[3]); - data.WriteBit(bytes[5]); - data.WriteBit(bytes[4]); - + data.WriteBit(guid[1]); + data.WriteBit(guid[2]); + data.WriteBit(guid[6]); + data.WriteBit(guid[7]); + data.WriteBit(guid[0]); + data.WriteBit(guid[3]); + data.WriteBit(guid[5]); + data.WriteBit(guid[4]); data << float(GetSpeed(mtype)); - data.WriteByteSeq(bytes[6]); - data.WriteByteSeq(bytes[4]); - data.WriteByteSeq(bytes[0]); + data.WriteByteSeq(guid[6]); + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[0]); data << uint32(0); - data.WriteByteSeq(bytes[1]); - data.WriteByteSeq(bytes[2]); - data.WriteByteSeq(bytes[7]); - data.WriteByteSeq(bytes[3]); - data.WriteByteSeq(bytes[5]); + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[5]); break; default: sLog->outError(LOG_FILTER_UNITS, "Unit::SetSpeed: Unsupported move type (%d), data not sent to client.", mtype); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 160e1f520bb..a9a45a21e9d 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -985,7 +985,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_COLLISION_HEIGHT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_COMPOUND_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -994,7 +994,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_SWIM_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_SWIM_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From c3e1443a13340efe7a1ffe99f72b1e7edb9ae7b0 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 11 Aug 2012 20:16:58 +0200 Subject: Core/Movement: Use spline id generator --- src/server/game/Movement/Spline/MoveSplineInit.cpp | 1 + src/server/game/Movement/Spline/MovementTypedefs.h | 7 ++++--- src/server/game/Movement/Spline/MovementUtil.cpp | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Movement/Spline/MoveSplineInit.cpp b/src/server/game/Movement/Spline/MoveSplineInit.cpp index 96b925928a4..8d0e67b769f 100644 --- a/src/server/game/Movement/Spline/MoveSplineInit.cpp +++ b/src/server/game/Movement/Spline/MoveSplineInit.cpp @@ -119,6 +119,7 @@ namespace Movement MoveSplineInit::MoveSplineInit(Unit& m) : unit(m) { + args.splineId = splineIdGen.NewId(); // Elevators also use MOVEMENTFLAG_ONTRANSPORT but we do not keep track of their position changes args.TransformForTransport = unit.GetTransGUID(); // mix existing state into new diff --git a/src/server/game/Movement/Spline/MovementTypedefs.h b/src/server/game/Movement/Spline/MovementTypedefs.h index 01c8a5b7e7b..51679260ebb 100644 --- a/src/server/game/Movement/Spline/MovementTypedefs.h +++ b/src/server/game/Movement/Spline/MovementTypedefs.h @@ -54,7 +54,7 @@ namespace Movement class counter { public: - counter() { init();} + counter() { init(); } void Increase() { @@ -64,8 +64,8 @@ namespace Movement ++m_counter; } - T NewId() { Increase(); return m_counter;} - T getCurrent() const { return m_counter;} + T NewId() { Increase(); return m_counter; } + T getCurrent() const { return m_counter; } private: void init() { m_counter = 0; } @@ -76,6 +76,7 @@ namespace Movement extern double gravity; extern float computeFallElevation(float t_passed, bool isSafeFall, float start_velocity); + extern UInt32Counter splineIdGen; } #endif // TRINITYSERVER_TYPEDEFS_H diff --git a/src/server/game/Movement/Spline/MovementUtil.cpp b/src/server/game/Movement/Spline/MovementUtil.cpp index d0582baa7f9..63790c8c83f 100644 --- a/src/server/game/Movement/Spline/MovementUtil.cpp +++ b/src/server/game/Movement/Spline/MovementUtil.cpp @@ -23,6 +23,7 @@ namespace Movement { double gravity = 19.29110527038574; + UInt32Counter splineIdGen; /// Velocity bounds that makes fall speed limited float terminalVelocity = 60.148003f; -- cgit v1.2.3 From e7590abce7ac42a3bb21fd353e4338f64253d792 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 11 Aug 2012 20:18:00 +0200 Subject: Core/Movement: Use MonsterMoveStop spline type to stop movement instead of sending movement to current position --- src/server/game/Entities/Unit/Unit.cpp | 62 ++++++++--------- src/server/game/Entities/Unit/Unit.h | 1 + src/server/game/Handlers/NPCHandler.cpp | 2 - src/server/game/Movement/Spline/MoveSpline.cpp | 9 ++- src/server/game/Movement/Spline/MoveSpline.h | 29 ++++---- src/server/game/Movement/Spline/MoveSplineFlag.h | 5 +- src/server/game/Movement/Spline/MoveSplineInit.cpp | 35 ++++++++-- src/server/game/Movement/Spline/MoveSplineInit.h | 4 ++ .../game/Movement/Spline/MovementPacketBuilder.cpp | 8 +++ .../game/Movement/Spline/MovementPacketBuilder.h | 1 + src/server/game/Movement/Spline/MovementUtil.cpp | 77 +++++++++++----------- 11 files changed, 141 insertions(+), 92 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 9d924230a76..06b082de155 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -376,12 +376,13 @@ void Unit::MonsterMoveWithSpeed(float x, float y, float z, float speed) init.Launch(); } -void Unit::UpdateSplineMovement(uint32 t_diff) +enum MovementIntervals { - enum{ - POSITION_UPDATE_DELAY = 400, - }; + POSITION_UPDATE_DELAY = 400, +}; +void Unit::UpdateSplineMovement(uint32 t_diff) +{ if (movespline->Finalized()) return; @@ -393,30 +394,32 @@ void Unit::UpdateSplineMovement(uint32 t_diff) m_movesplineTimer.Update(t_diff); if (m_movesplineTimer.Passed() || arrived) - { - m_movesplineTimer.Reset(POSITION_UPDATE_DELAY); - Movement::Location loc = movespline->ComputePosition(); + UpdateSplinePosition(); +} - if (GetTransGUID()) +void Unit::UpdateSplinePosition() +{ + m_movesplineTimer.Reset(POSITION_UPDATE_DELAY); + Movement::Location loc = movespline->ComputePosition(); + if (GetTransGUID()) + { + Position& pos = m_movementInfo.t_pos; + pos.m_positionX = loc.x; + pos.m_positionY = loc.y; + pos.m_positionZ = loc.z; + pos.m_orientation = loc.orientation; + if (Unit* vehicle = GetVehicleBase()) { - Position& pos = m_movementInfo.t_pos; - pos.m_positionX = loc.x; - pos.m_positionY = loc.y; - pos.m_positionZ = loc.z; - pos.m_orientation = loc.orientation; - if (Unit* vehicle = GetVehicleBase()) - { - loc.x += vehicle->GetPositionX(); - loc.y += vehicle->GetPositionY(); - loc.z += vehicle->GetPositionZMinusOffset(); - loc.orientation = vehicle->GetOrientation(); - } - else if (Transport* trans = GetTransport()) - trans->CalculatePassengerPosition(loc.x, loc.y, loc.z, loc.orientation); + loc.x += vehicle->GetPositionX(); + loc.y += vehicle->GetPositionY(); + loc.z += vehicle->GetPositionZMinusOffset(); + loc.orientation = vehicle->GetOrientation(); } - - UpdatePosition(loc.x, loc.y, loc.z, loc.orientation); + else if (Transport* trans = GetTransport()) + trans->CalculatePassengerPosition(loc.x, loc.y, loc.z, loc.orientation); } + + UpdatePosition(loc.x, loc.y, loc.z, loc.orientation); } void Unit::DisableSpline() @@ -15180,14 +15183,13 @@ void Unit::StopMoving() { ClearUnitState(UNIT_STATE_MOVING); - // not need send any packets if not in world - if (!IsInWorld()) + // not need send any packets if not in world or not moving + if (!IsInWorld() || movespline->Finalized()) return; - Movement::MoveSplineInit init(*this); - init.MoveTo(GetPositionX(), GetPositionY(), GetPositionZMinusOffset()); - init.SetFacing(GetOrientation()); - init.Launch(); + // Update position using old spline + UpdateSplinePosition(); + Movement::MoveSplineInit(*this).Stop(); } void Unit::SendMovementFlagUpdate() diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 7a0b97b90ef..96ee32274ef 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -2326,6 +2326,7 @@ class Unit : public WorldObject bool HandleAuraRaidProcFromCharge(AuraEffect* triggeredByAura); void UpdateSplineMovement(uint32 t_diff); + void UpdateSplinePosition(); // player or player's pet float GetCombatRatingReduction(CombatRating cr) const; diff --git a/src/server/game/Handlers/NPCHandler.cpp b/src/server/game/Handlers/NPCHandler.cpp index 651d616a15f..32636d51f49 100755 --- a/src/server/game/Handlers/NPCHandler.cpp +++ b/src/server/game/Handlers/NPCHandler.cpp @@ -322,9 +322,7 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket & recvData) // GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); if (unit->isArmorer() || unit->isCivilian() || unit->isQuestGiver() || unit->isServiceProvider() || unit->isGuard()) - { unit->StopMoving(); - } // If spiritguide, no need for gossip menu, just put player into resurrect queue if (unit->isSpiritGuide()) diff --git a/src/server/game/Movement/Spline/MoveSpline.cpp b/src/server/game/Movement/Spline/MoveSpline.cpp index c020dc2a653..164b65c067d 100644 --- a/src/server/game/Movement/Spline/MoveSpline.cpp +++ b/src/server/game/Movement/Spline/MoveSpline.cpp @@ -171,6 +171,13 @@ void MoveSpline::Initialize(const MoveSplineInitArgs& args) vertical_acceleration = 0.f; effect_start_time = 0; + // Check if its a stop spline + if (args.flags.done) + { + spline.clear(); + return; + } + init_spline(args); // init parabolic / animation @@ -264,7 +271,7 @@ MoveSpline::UpdateResult MoveSpline::_updateState(int32& ms_time_diff) { point_Idx = spline.first(); time_passed = time_passed % Duration(); - result = Result_NextSegment; + result = Result_NextCycle; } else { diff --git a/src/server/game/Movement/Spline/MoveSpline.h b/src/server/game/Movement/Spline/MoveSpline.h index d4b19b21634..56f2670a04b 100644 --- a/src/server/game/Movement/Spline/MoveSpline.h +++ b/src/server/game/Movement/Spline/MoveSpline.h @@ -41,7 +41,8 @@ namespace Movement { public: typedef Spline MySpline; - enum UpdateResult{ + enum UpdateResult + { Result_None = 0x01, Result_Arrived = 0x02, Result_NextCycle = 0x04, @@ -70,27 +71,27 @@ namespace Movement void init_spline(const MoveSplineInitArgs& args); protected: - const MySpline::ControlArray& getPath() const { return spline.getPoints();} + const MySpline::ControlArray& getPath() const { return spline.getPoints(); } void computeParabolicElevation(float& el) const; void computeFallElevation(float& el) const; UpdateResult _updateState(int32& ms_time_diff); - int32 next_timestamp() const { return spline.length(point_Idx+1);} - int32 segment_time_elapsed() const { return next_timestamp()-time_passed;} - int32 Duration() const { return spline.length();} - int32 timeElapsed() const { return Duration() - time_passed;} - int32 timePassed() const { return time_passed;} + int32 next_timestamp() const { return spline.length(point_Idx+1); } + int32 segment_time_elapsed() const { return next_timestamp()-time_passed; } + int32 Duration() const { return spline.length(); } + int32 timeElapsed() const { return Duration() - time_passed; } + int32 timePassed() const { return time_passed; } public: - const MySpline& _Spline() const { return spline;} - int32 _currentSplineIdx() const { return point_Idx;} + const MySpline& _Spline() const { return spline; } + int32 _currentSplineIdx() const { return point_Idx; } void _Finalize(); void _Interrupt() { splineflags.done = true;} public: void Initialize(const MoveSplineInitArgs&); - bool Initialized() const { return !spline.empty();} + bool Initialized() const { return !spline.empty(); } explicit MoveSpline(); @@ -112,11 +113,11 @@ namespace Movement Location ComputePosition() const; - uint32 GetId() const { return m_Id;} + uint32 GetId() const { return m_Id; } bool Finalized() const { return splineflags.done; } - bool isCyclic() const { return splineflags.cyclic;} - const Vector3 FinalDestination() const { return Initialized() ? spline.getPoint(spline.last()) : Vector3();} - const Vector3 CurrentDestination() const { return Initialized() ? spline.getPoint(point_Idx+1) : Vector3();} + bool isCyclic() const { return splineflags.cyclic; } + const Vector3 FinalDestination() const { return Initialized() ? spline.getPoint(spline.last()) : Vector3(); } + const Vector3 CurrentDestination() const { return Initialized() ? spline.getPoint(point_Idx+1) : Vector3(); } int32 currentPathIdx() const; std::string ToString() const; diff --git a/src/server/game/Movement/Spline/MoveSplineFlag.h b/src/server/game/Movement/Spline/MoveSplineFlag.h index 40c07f14440..89e76faeea3 100644 --- a/src/server/game/Movement/Spline/MoveSplineFlag.h +++ b/src/server/game/Movement/Spline/MoveSplineFlag.h @@ -33,7 +33,8 @@ namespace Movement class MoveSplineFlag { public: - enum eFlags{ + enum eFlags + { None = 0x00000000, // x00-x07 used as animation Ids storage in pair with Animation flag Unknown0 = 0x00000008, // NOT VERIFIED @@ -73,7 +74,7 @@ namespace Movement // flags that shouldn't be appended into SMSG_MONSTER_MOVE\SMSG_MONSTER_MOVE_TRANSPORT packet, should be more probably Mask_No_Monster_Move = Mask_Final_Facing | Mask_Animations | Done, // Unused, not suported flags - Mask_Unused = No_Spline|Enter_Cycle|Frozen|Unknown0|FallingSlow|Unknown2|Unknown3|Unknown4|SmoothGroundPath|Unknown6|Unknown7|Unknown8|Unknown9, + Mask_Unused = No_Spline|Enter_Cycle|Frozen|Unknown0|Unknown2|Unknown3|Unknown4|Unknown6|Unknown7|Unknown8|Unknown9, }; inline uint32& raw() { return (uint32&)*this; } diff --git a/src/server/game/Movement/Spline/MoveSplineInit.cpp b/src/server/game/Movement/Spline/MoveSplineInit.cpp index 8d0e67b769f..7d91e82096e 100644 --- a/src/server/game/Movement/Spline/MoveSplineInit.cpp +++ b/src/server/game/Movement/Spline/MoveSplineInit.cpp @@ -60,12 +60,10 @@ namespace Movement { MoveSpline& move_spline = *unit.movespline; - bool transport = false; Location real_position(unit.GetPositionX(), unit.GetPositionY(), unit.GetPositionZMinusOffset(), unit.GetOrientation()); // Elevators also use MOVEMENTFLAG_ONTRANSPORT but we do not keep track of their position changes if (unit.GetTransGUID()) { - transport = true; real_position.x = unit.GetTransOffsetX(); real_position.y = unit.GetTransOffsetY(); real_position.z = unit.GetTransOffsetZ(); @@ -102,13 +100,14 @@ namespace Movement if (moveFlags & MOVEMENTFLAG_ROOT) moveFlags &= ~MOVEMENTFLAG_MASK_MOVING; - unit.m_movementInfo.SetMovementFlags((MovementFlags)moveFlags); + unit.m_movementInfo.SetMovementFlags(moveFlags); move_spline.Initialize(args); - WorldPacket data(!transport ? SMSG_MONSTER_MOVE : SMSG_MONSTER_MOVE_TRANSPORT, 64); + WorldPacket data(SMSG_MONSTER_MOVE, 64); data.append(unit.GetPackGUID()); - if (transport) + if (unit.GetTransGUID()) { + data.SetOpcode(SMSG_MONSTER_MOVE_TRANSPORT); data.appendPackGUID(unit.GetTransGUID()); data << int8(unit.GetTransSeat()); } @@ -117,6 +116,32 @@ namespace Movement unit.SendMessageToSet(&data, true); } + void MoveSplineInit::Stop() + { + MoveSpline& move_spline = *unit.movespline; + + // No need to stop if we are not moving + if (move_spline.Finalized()) + return; + + Location loc = move_spline.ComputePosition(); + args.flags = MoveSplineFlag::Done; + unit.m_movementInfo.RemoveMovementFlag(MOVEMENTFLAG_FORWARD); + move_spline.Initialize(args); + + WorldPacket data(SMSG_MONSTER_MOVE, 64); + data.append(unit.GetPackGUID()); + if (unit.GetTransGUID()) + { + data.SetOpcode(SMSG_MONSTER_MOVE_TRANSPORT); + data.appendPackGUID(unit.GetTransGUID()); + data << int8(unit.GetTransSeat()); + } + + PacketBuilder::WriteStopMovement(loc, args.splineId, data); + unit.SendMessageToSet(&data, true); + } + MoveSplineInit::MoveSplineInit(Unit& m) : unit(m) { args.splineId = splineIdGen.NewId(); diff --git a/src/server/game/Movement/Spline/MoveSplineInit.h b/src/server/game/Movement/Spline/MoveSplineInit.h index 053be4e334a..77e34c22b5b 100644 --- a/src/server/game/Movement/Spline/MoveSplineInit.h +++ b/src/server/game/Movement/Spline/MoveSplineInit.h @@ -58,6 +58,10 @@ namespace Movement */ void Launch(); + /* Final pass of initialization that stops movement. + */ + void Stop(); + /* Adds movement by parabolic trajectory * @param amplitude - the maximum height of parabola, value could be negative and positive * @param start_time - delay between movement starting time and beginning to move by parabolic trajectory diff --git a/src/server/game/Movement/Spline/MovementPacketBuilder.cpp b/src/server/game/Movement/Spline/MovementPacketBuilder.cpp index aab96a630fa..4e16b2a6801 100644 --- a/src/server/game/Movement/Spline/MovementPacketBuilder.cpp +++ b/src/server/game/Movement/Spline/MovementPacketBuilder.cpp @@ -88,6 +88,14 @@ namespace Movement } } + void PacketBuilder::WriteStopMovement(Vector3 const& pos, uint32 splineId, ByteBuffer& data) + { + data << uint8(0); // sets/unsets MOVEMENTFLAG2_UNK7 (0x40) + data << pos; + data << splineId; + data << uint8(MonsterMoveStop); + } + void WriteLinearPath(const Spline& spline, ByteBuffer& data) { uint32 last_idx = spline.getPointCount() - 3; diff --git a/src/server/game/Movement/Spline/MovementPacketBuilder.h b/src/server/game/Movement/Spline/MovementPacketBuilder.h index a6e4e4d5d04..87a25dd0fdf 100644 --- a/src/server/game/Movement/Spline/MovementPacketBuilder.h +++ b/src/server/game/Movement/Spline/MovementPacketBuilder.h @@ -31,6 +31,7 @@ namespace Movement public: static void WriteMonsterMove(const MoveSpline& mov, WorldPacket& data); + static void WriteStopMovement(Vector3 const& loc, uint32 splineId, ByteBuffer& data); static void WriteCreateBits(MoveSpline const& moveSpline, ByteBuffer& data); static void WriteCreateData(MoveSpline const& moveSpline, ByteBuffer& data); }; diff --git a/src/server/game/Movement/Spline/MovementUtil.cpp b/src/server/game/Movement/Spline/MovementUtil.cpp index 63790c8c83f..86fcd26fad7 100644 --- a/src/server/game/Movement/Spline/MovementUtil.cpp +++ b/src/server/game/Movement/Spline/MovementUtil.cpp @@ -27,31 +27,31 @@ namespace Movement /// Velocity bounds that makes fall speed limited float terminalVelocity = 60.148003f; - float terminalSavefallVelocity = 7.f; + float terminalSafefallVelocity = 7.f; - const float terminal_length = float(terminalVelocity * terminalVelocity) / (2.f * gravity); - const float terminal_savefall_length = (terminalSavefallVelocity * terminalSavefallVelocity) / (2.f * gravity); - const float terminalFallTime = float(terminalVelocity/gravity); // the time that needed to reach terminalVelocity + const float terminal_length = float(terminalVelocity * terminalVelocity) / (2.0f * gravity); + const float terminal_safefall_length = (terminalSafefallVelocity * terminalSafefallVelocity) / (2.0f * gravity); + const float terminalFallTime = float(terminalVelocity / gravity); // the time that needed to reach terminalVelocity float computeFallTime(float path_length, bool isSafeFall) { - if (path_length < 0.f) - return 0.f; + if (path_length < 0.0f) + return 0.0f; float time; - if ( isSafeFall ) + if (isSafeFall) { - if (path_length >= terminal_savefall_length) - time = (path_length - terminal_savefall_length)/terminalSavefallVelocity + terminalSavefallVelocity/gravity; + if (path_length >= terminal_safefall_length) + time = (path_length - terminal_safefall_length) / terminalSafefallVelocity + terminalSafefallVelocity / gravity; else - time = sqrtf(2.f * path_length/gravity); + time = sqrtf(2.0f * path_length / gravity); } else { if (path_length >= terminal_length) - time = (path_length - terminal_length)/terminalVelocity + terminalFallTime; + time = (path_length - terminal_length) / terminalVelocity + terminalFallTime; else - time = sqrtf(2.f * path_length/gravity); + time = sqrtf(2.0f * path_length / gravity); } return time; @@ -62,20 +62,21 @@ namespace Movement float termVel; float result; - if ( isSafeFall ) - termVel = terminalSavefallVelocity; + if (isSafeFall) + termVel = terminalSafefallVelocity; else termVel = terminalVelocity; - if ( start_velocity > termVel ) + if (start_velocity > termVel) start_velocity = termVel; float terminal_time = terminalFallTime - start_velocity / gravity; // the time that needed to reach terminalVelocity - if ( t_passed > terminal_time ) + if (t_passed > terminal_time) { - result = terminalVelocity*(t_passed - terminal_time) + - start_velocity*terminal_time + gravity*terminal_time*terminal_time*0.5f; + result = terminalVelocity * (t_passed - terminal_time) + + start_velocity * terminal_time + + gravity * terminal_time * terminal_time*0.5f; } else result = t_passed * (start_velocity + t_passed * gravity * 0.5f); @@ -101,7 +102,7 @@ namespace Movement #define STR(x) #x - const char* g_MovementFlag_names[]= + char const* g_MovementFlag_names[] = { STR(Forward ),// 0x00000001, STR(Backward ),// 0x00000002, @@ -136,25 +137,25 @@ namespace Movement STR(Local_Dirty ),// 0x20000000 STR(None31 ),// 0x40000000 STR(None32 ),// 0x80000000 - STR(Unk1 ), - STR(Unk2 ), - STR(Unk3 ), - STR(Fullspeedturning ), - STR(Fullspeedpitching ), - STR(Allow_Pitching ), - STR(Unk4 ), - STR(Unk5 ), - STR(Unk6 ), - STR(Unk7 ), - STR(Interp_Move ), - STR(Interp_Turning ), - STR(Interp_Pitching ), - STR(Unk8 ), - STR(Unk9 ), - STR(Unk10 ), + STR(Unk1 ), + STR(Unk2 ), + STR(Unk3 ), + STR(Fullspeedturning ), + STR(Fullspeedpitching ), + STR(Allow_Pitching ), + STR(Unk4 ), + STR(Unk5 ), + STR(Unk6 ), + STR(Unk7 ), + STR(Interp_Move ), + STR(Interp_Turning ), + STR(Interp_Pitching ), + STR(None8 ), + STR(None9 ), + STR(None10 ), }; - const char * g_SplineFlag_names[32]= + char const* g_SplineFlag_names[32] = { STR(AnimBit1 ),// 0x00000001, STR(AnimBit2 ),// 0x00000002, @@ -191,11 +192,11 @@ namespace Movement }; template - void print_flags(Flags t, const char* (&names)[N], std::string& str) + void print_flags(Flags t, char const* (&names)[N], std::string& str) { for (int i = 0; i < N; ++i) { - if ((t & (Flags)(1 << i)) && names[i] != NULL) + if ((t & Flags(1 << i)) && names[i] != NULL) str.append(" ").append(names[i]); } } -- cgit v1.2.3 From 46c20c8399ee7d1b77ba00ccd53a56c0195e9973 Mon Sep 17 00:00:00 2001 From: zorix Date: Sun, 12 Aug 2012 00:33:55 +0200 Subject: Core/Spells: Implemented Spell attributesEx8 Remove custom flag spell scalable and apply flag SPELL_ATTR8_AURA_SEND_AMOUNT --- src/server/game/Miscellaneous/SharedDefines.h | 36 +++++++++++++++++++++++++++ src/server/game/Spells/Auras/SpellAuras.cpp | 2 +- src/server/game/Spells/SpellInfo.h | 2 +- src/server/game/Spells/SpellMgr.cpp | 5 ---- 4 files changed, 38 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index a41070fa1e1..654f9d6da3e 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -563,6 +563,42 @@ enum SpellAttr7 SPELL_ATTR7_UNK31 = 0x80000000 // 31 only 70769 }; +enum SpellAttr8 +{ + SPELL_ATTR8_UNK0 = 0x00000001, // 0 + SPELL_ATTR8_UNK1 = 0x00000002, // 1 + SPELL_ATTR8_UNK2 = 0x00000004, // 2 + SPELL_ATTR8_UNK3 = 0x00000008, // 3 + SPELL_ATTR8_UNK4 = 0x00000010, // 4 + SPELL_ATTR8_UNK5 = 0x00000020, // 5 + SPELL_ATTR8_UNK6 = 0x00000040, // 6 + SPELL_ATTR8_UNK7 = 0x00000080, // 7 + SPELL_ATTR8_UNK8 = 0x00000100, // 8 + SPELL_ATTR8_UNK9 = 0x00000200, // 9 + SPELL_ATTR8_UNK10 = 0x00000400, // 10 + SPELL_ATTR8_UNK11 = 0x00000800, // 11 + SPELL_ATTR8_AURA_SEND_AMOUNT = 0x00001000, // 12 Aura must have flag AFLAG_ANY_EFFECT_AMOUNT_SENT to send amount + SPELL_ATTR8_UNK13 = 0x00002000, // 13 + SPELL_ATTR8_UNK14 = 0x00004000, // 14 + SPELL_ATTR8_UNK15 = 0x00008000, // 15 + SPELL_ATTR8_UNK16 = 0x00010000, // 16 + SPELL_ATTR8_UNK17 = 0x00020000, // 17 + SPELL_ATTR8_UNK18 = 0x00040000, // 18 + SPELL_ATTR8_UNK19 = 0x00080000, // 19 + SPELL_ATTR8_ARMOR_SPECIALIZATION = 0x00100000, // 20 + SPELL_ATTR8_UNK21 = 0x00200000, // 21 + SPELL_ATTR8_UNK22 = 0x00400000, // 22 + SPELL_ATTR8_UNK23 = 0x00800000, // 23 + SPELL_ATTR8_UNK24 = 0x01000000, // 24 + SPELL_ATTR8_UNK25 = 0x02000000, // 25 + SPELL_ATTR8_RAID_MARKER = 0x04000000, // 26 probably spell no need learn to cast + SPELL_ATTR8_UNK27 = 0x08000000, // 27 + SPELL_ATTR8_GUILD_PERKS = 0x10000000, // 28 + SPELL_ATTR8_MASTERY = 0x20000000, // 29 + SPELL_ATTR8_UNK30 = 0x40000000, // 30 + SPELL_ATTR8_UNK31 = 0x80000000 // 31 +}; + #define MIN_TALENT_SPEC 0 #define MAX_TALENT_SPEC 1 #define MIN_TALENT_SPECS 1 diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index be3f33bb5f1..f5b9c5b2cf2 100755 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -148,7 +148,7 @@ void AuraApplication::_InitFlags(Unit* caster, uint8 effMask) _flags |= positiveFound ? AFLAG_POSITIVE : AFLAG_NEGATIVE; } - if (GetBase()->GetSpellInfo()->AttributesCu & SPELL_ATTR0_CU_SCALABLE) + if (GetBase()->GetSpellInfo()->AttributesEx8 & SPELL_ATTR8_AURA_SEND_AMOUNT) _flags |= AFLAG_ANY_EFFECT_AMOUNT_SENT; } diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h index 46f9906c4de..a338b8d627f 100644 --- a/src/server/game/Spells/SpellInfo.h +++ b/src/server/game/Spells/SpellInfo.h @@ -175,7 +175,7 @@ enum SpellCustomAttributes SPELL_ATTR0_CU_CONE_LINE = 0x00000004, SPELL_ATTR0_CU_SHARE_DAMAGE = 0x00000008, SPELL_ATTR0_CU_NO_INITIAL_THREAT = 0x00000010, - SPELL_ATTR0_CU_SCALABLE = 0x00000020, + SPELL_ATTR0_CU_NONE2 = 0x00000020, // UNUSED SPELL_ATTR0_CU_AURA_CC = 0x00000040, SPELL_ATTR0_CU_DIRECT_DAMAGE = 0x00000100, SPELL_ATTR0_CU_CHARGE = 0x00000200, diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index a1df9b997ef..fda59f27e0e 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -2670,11 +2670,6 @@ void SpellMgr::LoadSpellCustomAttr() case SPELL_AURA_POWER_BURN: spellInfo->AttributesCu |= SPELL_ATTR0_CU_NO_INITIAL_THREAT; break; - case SPELL_AURA_MOUNTED: - case SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS: - case SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS_2: - spellInfo->AttributesCu |= SPELL_ATTR0_CU_SCALABLE; - break; } switch (spellInfo->Effects[j].Effect) -- cgit v1.2.3 From 613b4b5208503ac21cf283f98ba61fdd32dca61a Mon Sep 17 00:00:00 2001 From: zorix Date: Sun, 12 Aug 2012 01:49:09 +0200 Subject: Core/Misc: Code style --- src/server/game/Miscellaneous/SharedDefines.h | 64 +++++++++++++-------------- 1 file changed, 32 insertions(+), 32 deletions(-) (limited to 'src') diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 654f9d6da3e..d7de72aee1f 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -565,38 +565,38 @@ enum SpellAttr7 enum SpellAttr8 { - SPELL_ATTR8_UNK0 = 0x00000001, // 0 - SPELL_ATTR8_UNK1 = 0x00000002, // 1 - SPELL_ATTR8_UNK2 = 0x00000004, // 2 - SPELL_ATTR8_UNK3 = 0x00000008, // 3 - SPELL_ATTR8_UNK4 = 0x00000010, // 4 - SPELL_ATTR8_UNK5 = 0x00000020, // 5 - SPELL_ATTR8_UNK6 = 0x00000040, // 6 - SPELL_ATTR8_UNK7 = 0x00000080, // 7 - SPELL_ATTR8_UNK8 = 0x00000100, // 8 - SPELL_ATTR8_UNK9 = 0x00000200, // 9 - SPELL_ATTR8_UNK10 = 0x00000400, // 10 - SPELL_ATTR8_UNK11 = 0x00000800, // 11 - SPELL_ATTR8_AURA_SEND_AMOUNT = 0x00001000, // 12 Aura must have flag AFLAG_ANY_EFFECT_AMOUNT_SENT to send amount - SPELL_ATTR8_UNK13 = 0x00002000, // 13 - SPELL_ATTR8_UNK14 = 0x00004000, // 14 - SPELL_ATTR8_UNK15 = 0x00008000, // 15 - SPELL_ATTR8_UNK16 = 0x00010000, // 16 - SPELL_ATTR8_UNK17 = 0x00020000, // 17 - SPELL_ATTR8_UNK18 = 0x00040000, // 18 - SPELL_ATTR8_UNK19 = 0x00080000, // 19 - SPELL_ATTR8_ARMOR_SPECIALIZATION = 0x00100000, // 20 - SPELL_ATTR8_UNK21 = 0x00200000, // 21 - SPELL_ATTR8_UNK22 = 0x00400000, // 22 - SPELL_ATTR8_UNK23 = 0x00800000, // 23 - SPELL_ATTR8_UNK24 = 0x01000000, // 24 - SPELL_ATTR8_UNK25 = 0x02000000, // 25 - SPELL_ATTR8_RAID_MARKER = 0x04000000, // 26 probably spell no need learn to cast - SPELL_ATTR8_UNK27 = 0x08000000, // 27 - SPELL_ATTR8_GUILD_PERKS = 0x10000000, // 28 - SPELL_ATTR8_MASTERY = 0x20000000, // 29 - SPELL_ATTR8_UNK30 = 0x40000000, // 30 - SPELL_ATTR8_UNK31 = 0x80000000 // 31 + SPELL_ATTR8_UNK0 = 0x00000001, // 0 + SPELL_ATTR8_UNK1 = 0x00000002, // 1 + SPELL_ATTR8_UNK2 = 0x00000004, // 2 + SPELL_ATTR8_UNK3 = 0x00000008, // 3 + SPELL_ATTR8_UNK4 = 0x00000010, // 4 + SPELL_ATTR8_UNK5 = 0x00000020, // 5 + SPELL_ATTR8_UNK6 = 0x00000040, // 6 + SPELL_ATTR8_UNK7 = 0x00000080, // 7 + SPELL_ATTR8_UNK8 = 0x00000100, // 8 + SPELL_ATTR8_UNK9 = 0x00000200, // 9 + SPELL_ATTR8_UNK10 = 0x00000400, // 10 + SPELL_ATTR8_UNK11 = 0x00000800, // 11 + SPELL_ATTR8_AURA_SEND_AMOUNT = 0x00001000, // 12 Aura must have flag AFLAG_ANY_EFFECT_AMOUNT_SENT to send amount + SPELL_ATTR8_UNK13 = 0x00002000, // 13 + SPELL_ATTR8_UNK14 = 0x00004000, // 14 + SPELL_ATTR8_UNK15 = 0x00008000, // 15 + SPELL_ATTR8_UNK16 = 0x00010000, // 16 + SPELL_ATTR8_UNK17 = 0x00020000, // 17 + SPELL_ATTR8_UNK18 = 0x00040000, // 18 + SPELL_ATTR8_UNK19 = 0x00080000, // 19 + SPELL_ATTR8_ARMOR_SPECIALIZATION = 0x00100000, // 20 + SPELL_ATTR8_UNK21 = 0x00200000, // 21 + SPELL_ATTR8_UNK22 = 0x00400000, // 22 + SPELL_ATTR8_UNK23 = 0x00800000, // 23 + SPELL_ATTR8_UNK24 = 0x01000000, // 24 + SPELL_ATTR8_UNK25 = 0x02000000, // 25 + SPELL_ATTR8_RAID_MARKER = 0x04000000, // 26 probably spell no need learn to cast + SPELL_ATTR8_UNK27 = 0x08000000, // 27 + SPELL_ATTR8_GUILD_PERKS = 0x10000000, // 28 + SPELL_ATTR8_MASTERY = 0x20000000, // 29 + SPELL_ATTR8_UNK30 = 0x40000000, // 30 + SPELL_ATTR8_UNK31 = 0x80000000 // 31 }; #define MIN_TALENT_SPEC 0 -- cgit v1.2.3 From c6d4ae43c3b9b8df34a0f651fc5f0cb404d4773f Mon Sep 17 00:00:00 2001 From: cyberbrest Date: Sun, 12 Aug 2012 10:54:08 +0300 Subject: [Spell]: add new effects and auras. privent crash with casting it. --- src/server/game/Miscellaneous/SharedDefines.h | 7 ++++++- src/server/game/Spells/Auras/SpellAuraDefines.h | 10 +++++++++- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 8 ++++++++ src/server/game/Spells/SpellEffects.cpp | 5 +++++ 4 files changed, 28 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index a41070fa1e1..f094178abe6 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -850,7 +850,12 @@ enum SpellEffects SPELL_EFFECT_175 = 175, // Unused (4.2.2) SPELL_EFFECT_176 = 176, // Some kind of sanctuary effect (Vanish) SPELL_EFFECT_177 = 177, - TOTAL_SPELL_EFFECTS = 178, + SPELL_EFFECT_178 = 178, + SPELL_EFFECT_179 = 179, + SPELL_EFFECT_180 = 180, + SPELL_EFFECT_181 = 181, + SPELL_EFFECT_182 = 182, + TOTAL_SPELL_EFFECTS = 183, }; enum SpellCastResult diff --git a/src/server/game/Spells/Auras/SpellAuraDefines.h b/src/server/game/Spells/Auras/SpellAuraDefines.h index c8e41d1fcfa..04809277eb4 100755 --- a/src/server/game/Spells/Auras/SpellAuraDefines.h +++ b/src/server/game/Spells/Auras/SpellAuraDefines.h @@ -422,7 +422,15 @@ enum AuraType SPELL_AURA_360 = 360, SPELL_AURA_361 = 361, SPELL_AURA_362 = 362, - TOTAL_AURAS = 363 // 4.2.2 + SPELL_AURA_363 = 363, + SPELL_AURA_364 = 364, + SPELL_AURA_365 = 365, + SPELL_AURA_366 = 366, + SPELL_AURA_367 = 367, + SPELL_AURA_368 = 368, + SPELL_AURA_369 = 369, + SPELL_AURA_370 = 370, + TOTAL_AURAS = 371 // 4.3.4 }; enum AuraObjectType diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index a815c3e805c..097ec0b2e8e 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -416,6 +416,14 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleNULL, //360 SPELL_AURA_360 &AuraEffect::HandleNULL, //361 SPELL_AURA_361 &AuraEffect::HandleNULL, //362 SPELL_AURA_362 + &AuraEffect::HandleNULL, //363 SPELL_AURA_363 + &AuraEffect::HandleNULL, //364 SPELL_AURA_364 + &AuraEffect::HandleNULL, //365 SPELL_AURA_365 + &AuraEffect::HandleNULL, //366 SPELL_AURA_366 + &AuraEffect::HandleNULL, //367 SPELL_AURA_367 + &AuraEffect::HandleNULL, //368 SPELL_AURA_368 + &AuraEffect::HandleNULL, //369 SPELL_AURA_369 + &AuraEffect::HandleNULL, //370 SPELL_AURA_370 }; AuraEffect::AuraEffect(Aura* base, uint8 effIndex, int32 *baseAmount, Unit* caster): diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 8b620e1e9ea..909d47c4b92 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -244,6 +244,11 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]= &Spell::EffectUnused, //175 SPELL_EFFECT_175 unused &Spell::EffectNULL, //176 SPELL_EFFECT_176 &Spell::EffectNULL, //177 SPELL_EFFECT_177 + &Spell::EffectNULL, //178 SPELL_EFFECT_178 + &Spell::EffectNULL, //179 SPELL_EFFECT_179 + &Spell::EffectNULL, //180 SPELL_EFFECT_180 + &Spell::EffectNULL, //181 SPELL_EFFECT_181 + &Spell::EffectNULL, //182 SPELL_EFFECT_182 }; void Spell::EffectNULL(SpellEffIndex /*effIndex*/) -- cgit v1.2.3 From f61df4d2238d866511ee6caded66ac12091e802f Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Sun, 12 Aug 2012 17:22:45 +0200 Subject: Scripts/Some: Cleanup for old scripts, not exist Quest and etc. in Cata. --- sql/updates/world/2012_08_12_00_world_misc_434.sql | 59 ++ src/server/game/Scripting/ScriptLoader.cpp | 2 - src/server/scripts/Kalimdor/CMakeLists.txt | 1 - src/server/scripts/Kalimdor/azshara.cpp | 493 +---------- src/server/scripts/Kalimdor/azuremyst_isle.cpp | 164 +--- src/server/scripts/Kalimdor/boss_azuregos.cpp | 167 ---- src/server/scripts/Kalimdor/darkshore.cpp | 370 +------- src/server/scripts/Kalimdor/desolace.cpp | 104 +-- src/server/scripts/Kalimdor/durotar.cpp | 451 +--------- src/server/scripts/Kalimdor/dustwallow_marsh.cpp | 452 +--------- src/server/scripts/Kalimdor/felwood.cpp | 72 +- src/server/scripts/Kalimdor/feralas.cpp | 185 +--- src/server/scripts/Kalimdor/moonglade.cpp | 545 +----------- src/server/scripts/Kalimdor/mulgore.cpp | 122 +-- src/server/scripts/Kalimdor/orgrimmar.cpp | 222 +---- src/server/scripts/Kalimdor/silithus.cpp | 932 +-------------------- .../scripts/Kalimdor/stonetalon_mountains.cpp | 146 +--- src/server/scripts/Kalimdor/tanaris.cpp | 375 +-------- src/server/scripts/Kalimdor/the_barrens.cpp | 497 +---------- src/server/scripts/Kalimdor/thousand_needles.cpp | 428 +--------- src/server/scripts/Kalimdor/thunder_bluff.cpp | 24 - src/server/scripts/Kalimdor/ungoro_crater.cpp | 321 +------ 22 files changed, 97 insertions(+), 6035 deletions(-) create mode 100644 sql/updates/world/2012_08_12_00_world_misc_434.sql delete mode 100644 src/server/scripts/Kalimdor/boss_azuregos.cpp (limited to 'src') diff --git a/sql/updates/world/2012_08_12_00_world_misc_434.sql b/sql/updates/world/2012_08_12_00_world_misc_434.sql new file mode 100644 index 00000000000..740b9c3582c --- /dev/null +++ b/sql/updates/world/2012_08_12_00_world_misc_434.sql @@ -0,0 +1,59 @@ +UPDATE `creature_template` SET `ScriptName`='' WHERE `ScriptName` IN ( +'mobs_spitelashes', +'npc_loramus_thalipedes', +'mob_rizzle_sprysprocket', +'mob_depth_charge', +'npc_geezle', +'boss_azuregos', +'npc_kerlonian', +'npc_prospector_remtravel', +'npc_threshwackonator', +'go_iruxos', +'npc_dalinda', +'npc_tiger_matriarch_credit', +'npc_tiger_matriarch', +'npc_troll_volunteer', +'mobs_risen_husk_spirit', +'npc_lady_jaina_proudmoore', +'npc_nat_pagle', +'npc_private_hendel', +'npc_zelfrax', +'npc_theramore_guard', +'npcs_riverbreeze_and_silversky', +'npc_gregan_brewspewer', +'npc_oox22fe', +'npc_screecher_spirit', +'npc_bunthen_plainswind', +'npc_great_bear_spirit', +'npc_silva_filnaveth', +'npc_clintar_dreamwalker', +'npc_clintar_spirit', +'npc_plains_vision', +'npc_shenthul', +'npc_thrall_warchief', +'go_crystalline_tear', +'npc_anachronos_quest_trigger', +'npc_anachronos_the_ancient', +'mob_qiraj_war_spawn', +'npc_braug_dimspirit', +'npc_kaya_flathoof', +'mob_aquementas', +'npc_marin_noggenfogger', +'npc_stone_watcher_of_norgannon', +'npc_tooga', +'npc_beaten_corpse', +'npc_gilthares', +'npc_sputtervalve', +'npc_taskmaster_fizzule', +'npc_twiggy_flathead', +'npc_kanati', +'npc_lakota_windsong', +'npc_paoka_swiftmountain', +'npc_plucky', +'npc_enraged_panther', +'go_panther_cage', +'npc_ame', +'npc_ringo' +); + +DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_mount_check','spell_voljin_war_drums'); diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index 319fd1eb702..128d28a9954 100755 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -334,7 +334,6 @@ void AddSC_ashenvale(); void AddSC_azshara(); void AddSC_azuremyst_isle(); void AddSC_bloodmyst_isle(); -void AddSC_boss_azuregos(); void AddSC_darkshore(); void AddSC_desolace(); void AddSC_durotar(); @@ -959,7 +958,6 @@ void AddKalimdorScripts() AddSC_azshara(); AddSC_azuremyst_isle(); AddSC_bloodmyst_isle(); - AddSC_boss_azuregos(); AddSC_darkshore(); AddSC_desolace(); AddSC_durotar(); diff --git a/src/server/scripts/Kalimdor/CMakeLists.txt b/src/server/scripts/Kalimdor/CMakeLists.txt index 7f63c521594..f54c23afb3c 100644 --- a/src/server/scripts/Kalimdor/CMakeLists.txt +++ b/src/server/scripts/Kalimdor/CMakeLists.txt @@ -101,7 +101,6 @@ set(scripts_STAT_SRCS Kalimdor/WailingCaverns/wailing_caverns.cpp Kalimdor/durotar.cpp Kalimdor/felwood.cpp - Kalimdor/boss_azuregos.cpp Kalimdor/tanaris.cpp Kalimdor/dustwallow_marsh.cpp Kalimdor/winterspring.cpp diff --git a/src/server/scripts/Kalimdor/azshara.cpp b/src/server/scripts/Kalimdor/azshara.cpp index 8d08c26f0a7..740f3d5c7e2 100644 --- a/src/server/scripts/Kalimdor/azshara.cpp +++ b/src/server/scripts/Kalimdor/azshara.cpp @@ -18,507 +18,18 @@ /* ScriptData SDName: Azshara -SD%Complete: 90 -SDComment: Quest support: 2744, 3141, 9364, 10994 +SD%Complete: 0 +SDComment: Quest support: SDCategory: Azshara EndScriptData */ /* ContentData -mobs_spitelashes -npc_loramus_thalipedes -mob_rizzle_sprysprocket -mob_depth_charge EndContentData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "ScriptedGossip.h" -/*###### -## mobs_spitelashes -######*/ - -class mobs_spitelashes : public CreatureScript -{ -public: - mobs_spitelashes() : CreatureScript("mobs_spitelashes") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new mobs_spitelashesAI (creature); - } - - struct mobs_spitelashesAI : public ScriptedAI - { - mobs_spitelashesAI(Creature* creature) : ScriptedAI(creature) {} - - uint32 morphtimer; - bool spellhit; - - void Reset() - { - morphtimer = 0; - spellhit = false; - } - - void EnterCombat(Unit* /*who*/) { } - - void SpellHit(Unit* Hitter, const SpellInfo* Spellkind) - { - if (!spellhit && - Hitter->GetTypeId() == TYPEID_PLAYER && - CAST_PLR(Hitter)->GetQuestStatus(9364) == QUEST_STATUS_INCOMPLETE && - (Spellkind->Id == 118 || Spellkind->Id == 12824 || Spellkind->Id == 12825 || Spellkind->Id == 12826)) - { - spellhit=true; - DoCast(me, 29124); //become a sheep - } - } - - void UpdateAI(const uint32 diff) - { - // we mustn't remove the Creature in the same round in which we cast the summon spell, otherwise there will be no summons - if (spellhit && morphtimer >= 5000) - { - me->DespawnOrUnsummon(); - return; - } - // walk 5 seconds before summoning - if (spellhit && morphtimer<5000) - { - morphtimer+=diff; - if (morphtimer >= 5000) - { - DoCast(me, 28406); //summon copies - DoCast(me, 6924); //visual explosion - } - } - if (!UpdateVictim()) - return; - - //TODO: add abilities for the different creatures - DoMeleeAttackIfReady(); - } - }; - -}; - -/*###### -## npc_loramus_thalipedes -######*/ - -#define GOSSIP_HELLO_LT1 "Can you help me?" -#define GOSSIP_HELLO_LT2 "Tell me your story" -#define GOSSIP_SELECT_LT1 "Please continue" -#define GOSSIP_SELECT_LT2 "I do not understand" -#define GOSSIP_SELECT_LT3 "Indeed" -#define GOSSIP_SELECT_LT4 "I will do this with or your help, Loramus" -#define GOSSIP_SELECT_LT5 "Yes" - -class npc_loramus_thalipedes : public CreatureScript -{ -public: - npc_loramus_thalipedes() : CreatureScript("npc_loramus_thalipedes") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - switch (action) - { - case GOSSIP_ACTION_INFO_DEF+1: - player->CLOSE_GOSSIP_MENU(); - player->AreaExploredOrEventHappens(2744); - break; - - case GOSSIP_ACTION_INFO_DEF+2: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_LT1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 21); - player->SEND_GOSSIP_MENU(1813, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+21: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_LT2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 22); - player->SEND_GOSSIP_MENU(1814, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+22: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_LT3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 23); - player->SEND_GOSSIP_MENU(1815, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+23: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_LT4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 24); - player->SEND_GOSSIP_MENU(1816, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+24: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_LT5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 25); - player->SEND_GOSSIP_MENU(1817, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+25: - player->CLOSE_GOSSIP_MENU(); - player->AreaExploredOrEventHappens(3141); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(2744) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_LT1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - if (player->GetQuestStatus(3141) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_LT2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - - return true; - } -}; - -/*#### -# mob_rizzle_sprysprocket -####*/ - -enum RizzleSprysprocketData -{ - QUEST_CHASING_THE_MOONSTONE = 10994, - - MOB_DEPTH_CHARGE = 23025, - - SPELL_RIZZLE_BLACKJACK = 39865, - SPELL_RIZZLE_ESCAPE = 39871, - SPELL_RIZZLE_FROST_GRENADE = 40525, - SPELL_DEPTH_CHARGE_TRAP = 38576, - SPELL_PERIODIC_DEPTH_CHARGE = 39912, - SPELL_GIVE_SOUTHFURY_MOONSTONE = 39886, - - SAY_RIZZLE_START = -1000351, - MSG_ESCAPE_NOTICE = -1000352, - SAY_RIZZLE_GRENADE = -1000353, - SAY_RIZZLE_GRENADE_BACKFIRE = -1000354, // Not used - SAY_RIZZLE_FINAL = -1000355, - SAY_RIZZLE_FINAL2 = -1000356, // Not used -}; - -#define GOSSIP_GET_MOONSTONE "Hand over the Southfury moonstone and I'll let you go." - -Position const WPs[58] = -{ - {3691.97f, -3962.41f, 35.9118f, 3.67f}, - {3675.02f, -3960.49f, 35.9118f, 3.67f}, - {3653.19f, -3958.33f, 33.9118f, 3.59f}, - {3621.12f, -3958.51f, 29.9118f, 3.48f}, - {3604.86f, -3963, 29.9118f, 3.48f}, - {3569.94f, -3970.25f, 29.9118f, 3.44f}, - {3541.03f, -3975.64f, 29.9118f, 3.41f}, - {3510.84f, -3978.71f, 29.9118f, 3.41f}, - {3472.7f, -3997.07f, 29.9118f, 3.35f}, - {3439.15f, -4014.55f, 29.9118f, 3.29f}, - {3412.8f, -4025.87f, 29.9118f, 3.25f}, - {3384.95f, -4038.04f, 29.9118f, 3.24f}, - {3346.77f, -4052.93f, 29.9118f, 3.22f}, - {3299.56f, -4071.59f, 29.9118f, 3.20f}, - {3261.22f, -4080.38f, 30.9118f, 3.19f}, - {3220.68f, -4083.09f, 31.9118f, 3.18f}, - {3187.11f, -4070.45f, 33.9118f, 3.16f}, - {3162.78f, -4062.75f, 33.9118f, 3.15f}, - {3136.09f, -4050.32f, 33.9118f, 3.07f}, - {3119.47f, -4044.51f, 36.0363f, 3.07f}, - {3098.95f, -4019.8f, 33.9118f, 3.07f}, - {3073.07f, -4011.42f, 33.9118f, 3.07f}, - {3051.71f, -3993.37f, 33.9118f, 3.02f}, - {3027.52f, -3978.6f, 33.9118f, 3.00f}, - {3003.78f, -3960.14f, 33.9118f, 2.98f}, - {2977.99f, -3941.98f, 31.9118f, 2.96f}, - {2964.57f, -3932.07f, 30.9118f, 2.96f}, - {2947.9f, -3921.31f, 29.9118f, 2.96f}, - {2924.91f, -3910.8f, 29.9118f, 2.94f}, - {2903.04f, -3896.42f, 29.9118f, 2.93f}, - {2884.75f, -3874.03f, 29.9118f, 2.90f}, - {2868.19f, -3851.48f, 29.9118f, 2.82f}, - {2854.62f, -3819.72f, 29.9118f, 2.80f}, - {2825.53f, -3790.4f, 29.9118f, 2.744f}, - {2804.31f, -3773.05f, 29.9118f, 2.71f}, - {2769.78f, -3763.57f, 29.9118f, 2.70f}, - {2727.23f, -3745.92f, 30.9118f, 2.69f}, - {2680.12f, -3737.49f, 30.9118f, 2.67f}, - {2647.62f, -3739.94f, 30.9118f, 2.66f}, - {2616.6f, -3745.75f, 30.9118f, 2.64f}, - {2589.38f, -3731.97f, 30.9118f, 2.61f}, - {2562.94f, -3722.35f, 31.9118f, 2.56f}, - {2521.05f, -3716.6f, 31.9118f, 2.55f}, - {2485.26f, -3706.67f, 31.9118f, 2.51f}, - {2458.93f, -3696.67f, 31.9118f, 2.51f}, - {2432, -3692.03f, 31.9118f, 2.46f}, - {2399.59f, -3681.97f, 31.9118f, 2.45f}, - {2357.75f, -3666.6f, 31.9118f, 2.44f}, - {2311.99f, -3656.88f, 31.9118f, 2.94f}, - {2263.41f, -3649.55f, 31.9118f, 3.02f}, - {2209.05f, -3641.76f, 31.9118f, 2.99f}, - {2164.83f, -3637.64f, 31.9118f, 3.15f}, - {2122.42f, -3639, 31.9118f, 3.21f}, - {2075.73f, -3643.59f, 31.9118f, 3.22f}, - {2033.59f, -3649.52f, 31.9118f, 3.42f}, - {1985.22f, -3662.99f, 31.9118f, 3.42f}, - {1927.09f, -3679.56f, 33.9118f, 3.42f}, - {1873.57f, -3695.32f, 33.9118f, 3.44f} -}; - -class mob_rizzle_sprysprocket : public CreatureScript -{ -public: - mob_rizzle_sprysprocket() : CreatureScript("mob_rizzle_sprysprocket") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_INFO_DEF + 1 && player->GetQuestStatus(QUEST_CHASING_THE_MOONSTONE) == QUEST_STATUS_INCOMPLETE) - { - player->CLOSE_GOSSIP_MENU(); - creature->CastSpell(player, SPELL_GIVE_SOUTHFURY_MOONSTONE, true); - CAST_AI(mob_rizzle_sprysprocket::mob_rizzle_sprysprocketAI, creature->AI())->MustDieTimer = 3000; - CAST_AI(mob_rizzle_sprysprocket::mob_rizzle_sprysprocketAI, creature->AI())->MustDie = true; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (player->GetQuestStatus(QUEST_CHASING_THE_MOONSTONE) != QUEST_STATUS_INCOMPLETE) - return true; - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_GET_MOONSTONE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - player->SEND_GOSSIP_MENU(10811, creature->GetGUID()); - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_rizzle_sprysprocketAI (creature); - } - - struct mob_rizzle_sprysprocketAI : public ScriptedAI - { - mob_rizzle_sprysprocketAI(Creature* creature) : ScriptedAI(creature) {} - - uint32 SpellEscapeTimer; - uint32 TeleportTimer; - uint32 CheckTimer; - uint32 GrenadeTimer; - uint32 MustDieTimer; - uint32 CurrWP; - - uint64 PlayerGUID; - - bool MustDie; - bool Escape; - bool ContinueWP; - bool Reached; - - void Reset() - { - SpellEscapeTimer = 1300; - TeleportTimer = 3500; - CheckTimer = 10000; - GrenadeTimer = 30000; - MustDieTimer = 3000; - CurrWP = 0; - - PlayerGUID = 0; - - MustDie = false; - Escape = false; - ContinueWP = false; - Reached = false; - } - - void UpdateAI(const uint32 diff) - { - if (MustDie) - { - if (MustDieTimer <= diff) - { - me->DespawnOrUnsummon(); - return; - } else MustDieTimer -= diff; - } - - if (!Escape) - { - if (!PlayerGUID) - return; - - if (SpellEscapeTimer <= diff) - { - DoCast(me, SPELL_RIZZLE_ESCAPE, false); - SpellEscapeTimer = 10000; - } else SpellEscapeTimer -= diff; - - if (TeleportTimer <= diff) - { - //temp solution - unit can't be teleported by core using spelleffect 5, only players - if (me->GetMap()) - { - me->SetPosition(3706.39f, -3969.15f, 35.9118f, 0); - me->AI_SendMoveToPacket(3706.39f, -3969.15f, 35.9118f, 0, 0, 0); - } - //begin swimming and summon depth charges - Player* player = Unit::GetPlayer(*me, PlayerGUID); - SendText(MSG_ESCAPE_NOTICE, player); - DoCast(me, SPELL_PERIODIC_DEPTH_CHARGE); - me->SetUnitMovementFlags(MOVEMENTFLAG_HOVER | MOVEMENTFLAG_SWIMMING); - me->SetSpeed(MOVE_RUN, 0.85f, true); - me->GetMotionMaster()->MovementExpired(); - me->GetMotionMaster()->MovePoint(CurrWP, WPs[CurrWP]); - Escape = true; - } else TeleportTimer -= diff; - - return; - } - - if (ContinueWP) - { - me->GetMotionMaster()->MovePoint(CurrWP, WPs[CurrWP]); - ContinueWP = false; - } - - if (GrenadeTimer <= diff) - { - Player* player = Unit::GetPlayer(*me, PlayerGUID); - if (player) - { - DoScriptText(SAY_RIZZLE_GRENADE, me, player); - DoCast(player, SPELL_RIZZLE_FROST_GRENADE, true); - } - GrenadeTimer = 30000; - } else GrenadeTimer -= diff; - - if (CheckTimer <= diff) - { - Player* player = Unit::GetPlayer(*me, PlayerGUID); - if (!player) - { - me->DespawnOrUnsummon(); - return; - } - - if (me->IsWithinDist(player, 10) && me->GetPositionX() > player->GetPositionX() && !Reached) - { - DoScriptText(SAY_RIZZLE_FINAL, me); - me->SetUInt32Value(UNIT_NPC_FLAGS, 1); - me->setFaction(35); - me->GetMotionMaster()->MoveIdle(); - me->RemoveAurasDueToSpell(SPELL_PERIODIC_DEPTH_CHARGE); - Reached = true; - } - - CheckTimer = 1000; - } else CheckTimer -= diff; - - } - - void SendText(int32 iTextEntry, Player* player) - { - LocaleConstant loc_idx = player->GetSession()->GetSessionDbLocaleIndex(); - const char* text = sObjectMgr->GetTrinityString(iTextEntry, loc_idx); - sWorld->SendServerMessage(SERVER_MSG_STRING, text, player); - } - - void AttackStart(Unit* who) - { - if (!who || PlayerGUID) - return; - - if (who->GetTypeId() == TYPEID_PLAYER && CAST_PLR(who)->GetQuestStatus(QUEST_CHASING_THE_MOONSTONE) == QUEST_STATUS_INCOMPLETE) - { - PlayerGUID = who->GetGUID(); - DoScriptText(SAY_RIZZLE_START, me); - DoCast(who, SPELL_RIZZLE_BLACKJACK, false); - return; - } - } - - void EnterCombat(Unit* /*who*/) {} - - void MovementInform(uint32 type, uint32 id) - { - if (type != POINT_MOTION_TYPE) - return; - - if (id == 57) - { - me->DespawnOrUnsummon(); - return; - } - - ++CurrWP; - ContinueWP = true; - } - }; -}; - -/*#### -# mob_depth_charge -####*/ -class mob_depth_charge : public CreatureScript -{ -public: - mob_depth_charge() : CreatureScript("mob_depth_charge") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_depth_chargeAI (creature); - } - - struct mob_depth_chargeAI : public ScriptedAI - { - mob_depth_chargeAI(Creature* creature) : ScriptedAI(creature) {} - - bool WeMustDie; - uint32 WeMustDieTimer; - - void Reset() - { - me->SetUnitMovementFlags(MOVEMENTFLAG_HOVER | MOVEMENTFLAG_SWIMMING); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - WeMustDie = false; - WeMustDieTimer = 1000; - } - - void UpdateAI(const uint32 diff) - { - if (WeMustDie) - { - if (WeMustDieTimer <= diff) - me->DespawnOrUnsummon(); - else - WeMustDieTimer -= diff; - } - return; - } - - void MoveInLineOfSight(Unit* who) - { - if (!who) - return; - - if (who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 5)) - { - DoCast(who, SPELL_DEPTH_CHARGE_TRAP); - WeMustDie = true; - return; - } - } - - void AttackStart(Unit* /*who*/) {} - - void EnterCombat(Unit* /*who*/) {} - }; -}; - void AddSC_azshara() { - new mobs_spitelashes(); - new npc_loramus_thalipedes(); - new mob_rizzle_sprysprocket(); - new mob_depth_charge(); } diff --git a/src/server/scripts/Kalimdor/azuremyst_isle.cpp b/src/server/scripts/Kalimdor/azuremyst_isle.cpp index 96e67c8de47..6a109cded3b 100644 --- a/src/server/scripts/Kalimdor/azuremyst_isle.cpp +++ b/src/server/scripts/Kalimdor/azuremyst_isle.cpp @@ -19,7 +19,7 @@ /* ScriptData SDName: Azuremyst_Isle SD%Complete: 75 -SDComment: Quest support: 9283, 9537, 9582, 9554, 9531, ? (special flight path, proper model for mount missing). Injured Draenei cosmetic only, 9582. +SDComment: Quest support: 9283, 9537, 9582, 9554, ? (special flight path, proper model for mount missing). Injured Draenei cosmetic only, 9582. SDCategory: Azuremyst Isle EndScriptData */ @@ -28,7 +28,6 @@ npc_draenei_survivor npc_engineer_spark_overgrind npc_injured_draenei npc_magwin -npc_geezle go_ravager_cage npc_death_ravager EndContentData */ @@ -407,166 +406,6 @@ public: }; -/*###### -## npc_geezle -######*/ - -enum Geezle -{ - QUEST_TREES_COMPANY = 9531, - - SPELL_TREE_DISGUISE = 30298, - - GEEZLE_SAY_1 = -1000629, - SPARK_SAY_2 = -1000630, - SPARK_SAY_3 = -1000631, - GEEZLE_SAY_4 = -1000632, - SPARK_SAY_5 = -1000633, - SPARK_SAY_6 = -1000634, - GEEZLE_SAY_7 = -1000635, - - EMOTE_SPARK = -1000636, - - MOB_SPARK = 17243, - GO_NAGA_FLAG = 181694 -}; - -Position const SparkPos = {-5029.91f, -11291.79f, 8.096f, 0.0f}; - -class npc_geezle : public CreatureScript -{ -public: - npc_geezle() : CreatureScript("npc_geezle") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_geezleAI(creature); - } - - struct npc_geezleAI : public ScriptedAI - { - npc_geezleAI(Creature* creature) : ScriptedAI(creature) {} - - uint64 SparkGUID; - - uint8 Step; - uint32 SayTimer; - - bool EventStarted; - - void Reset() - { - SparkGUID = 0; - Step = 0; - StartEvent(); - } - - void EnterCombat(Unit* /*who*/){} - - void StartEvent() - { - Step = 0; - EventStarted = true; - if (Creature* Spark = me->SummonCreature(MOB_SPARK, SparkPos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1000)) - { - SparkGUID = Spark->GetGUID(); - Spark->setActive(true); - Spark->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - } - SayTimer = 8000; - } - - uint32 NextStep(uint8 Step) - { - Creature* Spark = Unit::GetCreature(*me, SparkGUID); - - switch (Step) - { - case 0: - if (Spark) - Spark->GetMotionMaster()->MovePoint(0, -5080.70f, -11253.61f, 0.56f); - me->GetMotionMaster()->MovePoint(0, -5092.26f, -11252, 0.71f); - return 9000; // NPCs are walking up to fire - case 1: - DespawnNagaFlag(true); - DoScriptText(EMOTE_SPARK, Spark); - return 1000; - case 2: - DoScriptText(GEEZLE_SAY_1, me, Spark); - if (Spark) - { - Spark->SetInFront(me); - me->SetInFront(Spark); - } - return 5000; - case 3: DoScriptText(SPARK_SAY_2, Spark); return 7000; - case 4: DoScriptText(SPARK_SAY_3, Spark); return 8000; - case 5: DoScriptText(GEEZLE_SAY_4, me, Spark); return 8000; - case 6: DoScriptText(SPARK_SAY_5, Spark); return 9000; - case 7: DoScriptText(SPARK_SAY_6, Spark); return 8000; - case 8: DoScriptText(GEEZLE_SAY_7, me, Spark); return 2000; - case 9: - me->GetMotionMaster()->MoveTargetedHome(); - if (Spark) - Spark->GetMotionMaster()->MovePoint(0, SparkPos); - CompleteQuest(); - return 9000; - case 10: - if (Spark) - Spark->DisappearAndDie(); - DespawnNagaFlag(false); - me->DisappearAndDie(); - default: return 99999999; - } - } - - // will complete Tree's company quest for all nearby players that are disguised as trees - void CompleteQuest() - { - float radius = 50.0f; - std::list players; - Trinity::AnyPlayerInObjectRangeCheck checker(me, radius); - Trinity::PlayerListSearcher searcher(me, players, checker); - me->VisitNearbyWorldObject(radius, searcher); - - for (std::list::const_iterator itr = players.begin(); itr != players.end(); ++itr) - if ((*itr)->GetQuestStatus(QUEST_TREES_COMPANY) == QUEST_STATUS_INCOMPLETE && (*itr)->HasAura(SPELL_TREE_DISGUISE)) - (*itr)->KilledMonsterCredit(MOB_SPARK, 0); - } - - void DespawnNagaFlag(bool despawn) - { - std::list FlagList; - me->GetGameObjectListWithEntryInGrid(FlagList, GO_NAGA_FLAG, 100.0f); - - if (!FlagList.empty()) - { - for (std::list::const_iterator itr = FlagList.begin(); itr != FlagList.end(); ++itr) - { - if (despawn) - (*itr)->SetLootState(GO_JUST_DEACTIVATED); - else - (*itr)->Respawn(); - } - } - else - sLog->outError(LOG_FILTER_TSCR, "SD2 ERROR: FlagList is empty!"); - } - - void UpdateAI(const uint32 diff) - { - if (SayTimer <= diff) - { - if (EventStarted) - SayTimer = NextStep(Step++); - } - else - SayTimer -= diff; - } - }; - -}; - enum RavegerCage { NPC_DEATH_RAVAGER = 17556, @@ -762,7 +601,6 @@ void AddSC_azuremyst_isle() new npc_engineer_spark_overgrind(); new npc_injured_draenei(); new npc_magwin(); - new npc_geezle(); new npc_death_ravager(); new go_ravager_cage(); new npc_stillpine_capitive(); diff --git a/src/server/scripts/Kalimdor/boss_azuregos.cpp b/src/server/scripts/Kalimdor/boss_azuregos.cpp deleted file mode 100644 index ec098951c03..00000000000 --- a/src/server/scripts/Kalimdor/boss_azuregos.cpp +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Copyright (C) 2008-2012 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 - * - * 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; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; 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, see . - */ - -/* ScriptData -SDName: Boss_Azuregos -SD%Complete: 90 -SDComment: Teleport not included, spell reflect not effecting dots (Core problem) -SDCategory: Azshara -EndScriptData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" - -enum Say -{ - SAY_TELEPORT = -1000100 -}; - -enum Spells -{ - SPELL_MARKOFFROST = 23182, - SPELL_MANASTORM = 21097, - SPELL_CHILL = 21098, - SPELL_FROSTBREATH = 21099, - SPELL_REFLECT = 22067, - SPELL_CLEAVE = 8255, //Perhaps not right ID - SPELL_ENRAGE = 23537 -}; - -class boss_azuregos : public CreatureScript -{ -public: - boss_azuregos() : CreatureScript("boss_azuregos") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new boss_azuregosAI (creature); - } - - struct boss_azuregosAI : public ScriptedAI - { - boss_azuregosAI(Creature* creature) : ScriptedAI(creature) {} - - uint32 MarkOfFrostTimer; - uint32 ManaStormTimer; - uint32 ChillTimer; - uint32 BreathTimer; - uint32 TeleportTimer; - uint32 ReflectTimer; - uint32 CleaveTimer; - uint32 EnrageTimer; - bool Enraged; - - void Reset() - { - MarkOfFrostTimer = 35000; - ManaStormTimer = urand(5000, 17000); - ChillTimer = urand(10000, 30000); - BreathTimer = urand(2000, 8000); - TeleportTimer = 30000; - ReflectTimer = urand(15000, 30000); - CleaveTimer = 7000; - EnrageTimer = 0; - Enraged = false; - } - - void EnterCombat(Unit* /*who*/) {} - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (TeleportTimer <= diff) - { - DoScriptText(SAY_TELEPORT, me); - std::list& threatlist = me->getThreatManager().getThreatList(); - std::list::const_iterator i = threatlist.begin(); - for (i = threatlist.begin(); i!= threatlist.end(); ++i) - { - Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid()); - if (unit && (unit->GetTypeId() == TYPEID_PLAYER)) - { - DoTeleportPlayer(unit, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()+3, unit->GetOrientation()); - } - } - - DoResetThreat(); - TeleportTimer = 30000; - } else TeleportTimer -= diff; - - // //MarkOfFrostTimer - // if (MarkOfFrostTimer <= diff) - // { - // DoCast(me->getVictim(), SPELL_MARKOFFROST); - // MarkOfFrostTimer = 25000; - // } else MarkOfFrostTimer -= diff; - - //ChillTimer - if (ChillTimer <= diff) - { - DoCast(me->getVictim(), SPELL_CHILL); - ChillTimer = urand(13000, 25000); - } else ChillTimer -= diff; - - //BreathTimer - if (BreathTimer <= diff) - { - DoCast(me->getVictim(), SPELL_FROSTBREATH); - BreathTimer = urand(10000, 15000); - } else BreathTimer -= diff; - - //ManaStormTimer - if (ManaStormTimer <= diff) - { - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_MANASTORM); - ManaStormTimer = urand(7500, 12500); - } else ManaStormTimer -= diff; - - //ReflectTimer - if (ReflectTimer <= diff) - { - DoCast(me, SPELL_REFLECT); - ReflectTimer = urand(20000, 35000); - } else ReflectTimer -= diff; - - //CleaveTimer - if (CleaveTimer <= diff) - { - DoCast(me->getVictim(), SPELL_CLEAVE); - CleaveTimer = 7000; - } else CleaveTimer -= diff; - - //EnrageTimer - if (HealthBelowPct(26) && !Enraged) - { - DoCast(me, SPELL_ENRAGE); - Enraged = true; - } - - DoMeleeAttackIfReady(); - } - }; - -}; - -void AddSC_boss_azuregos() -{ - new boss_azuregos(); -} diff --git a/src/server/scripts/Kalimdor/darkshore.cpp b/src/server/scripts/Kalimdor/darkshore.cpp index 0e02a77169e..3330898ebe4 100644 --- a/src/server/scripts/Kalimdor/darkshore.cpp +++ b/src/server/scripts/Kalimdor/darkshore.cpp @@ -18,15 +18,12 @@ /* ScriptData SDName: Darkshore -SD%Complete: 100 -SDComment: Quest support: 731, 2078, 5321 +SD%Complete: 0 +SDComment: Quest support: SDCategory: Darkshore EndScriptData */ /* ContentData -npc_kerlonian -npc_prospector_remtravel -npc_threshwackonator EndContentData */ #include "ScriptMgr.h" @@ -35,369 +32,6 @@ EndContentData */ #include "ScriptedEscortAI.h" #include "ScriptedFollowerAI.h" -/*#### -# npc_kerlonian -####*/ - -enum Kerlonian -{ - SAY_KER_START = -1000434, - - EMOTE_KER_SLEEP_1 = -1000435, - EMOTE_KER_SLEEP_2 = -1000436, - EMOTE_KER_SLEEP_3 = -1000437, - - SAY_KER_SLEEP_1 = -1000438, - SAY_KER_SLEEP_2 = -1000439, - SAY_KER_SLEEP_3 = -1000440, - SAY_KER_SLEEP_4 = -1000441, - - EMOTE_KER_AWAKEN = -1000445, - - SAY_KER_ALERT_1 = -1000442, - SAY_KER_ALERT_2 = -1000443, - - SAY_KER_END = -1000444, - - SPELL_SLEEP_VISUAL = 25148, - SPELL_AWAKEN = 17536, - QUEST_SLEEPER_AWAKENED = 5321, - NPC_LILADRIS = 11219, //attackers entries unknown - FACTION_KER_ESCORTEE = 113 -}; - -//TODO: make concept similar as "ringo" -escort. Find a way to run the scripted attacks, _if_ player are choosing road. -class npc_kerlonian : public CreatureScript -{ -public: - npc_kerlonian() : CreatureScript("npc_kerlonian") { } - - bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) - { - if (quest->GetQuestId() == QUEST_SLEEPER_AWAKENED) - { - if (npc_kerlonianAI* pKerlonianAI = CAST_AI(npc_kerlonian::npc_kerlonianAI, creature->AI())) - { - creature->SetStandState(UNIT_STAND_STATE_STAND); - DoScriptText(SAY_KER_START, creature, player); - pKerlonianAI->StartFollow(player, FACTION_KER_ESCORTEE, quest); - } - } - - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_kerlonianAI(creature); - } - - struct npc_kerlonianAI : public FollowerAI - { - npc_kerlonianAI(Creature* creature) : FollowerAI(creature) { } - - uint32 FallAsleepTimer; - - void Reset() - { - FallAsleepTimer = urand(10000, 45000); - } - - void MoveInLineOfSight(Unit* who) - { - FollowerAI::MoveInLineOfSight(who); - - if (!me->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE) && who->GetEntry() == NPC_LILADRIS) - { - if (me->IsWithinDistInMap(who, INTERACTION_DISTANCE*5)) - { - if (Player* player = GetLeaderForFollower()) - { - if (player->GetQuestStatus(QUEST_SLEEPER_AWAKENED) == QUEST_STATUS_INCOMPLETE) - player->GroupEventHappens(QUEST_SLEEPER_AWAKENED, me); - - DoScriptText(SAY_KER_END, me); - } - - SetFollowComplete(); - } - } - } - - void SpellHit(Unit* /*pCaster*/, const SpellInfo* pSpell) - { - if (HasFollowState(STATE_FOLLOW_INPROGRESS | STATE_FOLLOW_PAUSED) && pSpell->Id == SPELL_AWAKEN) - ClearSleeping(); - } - - void SetSleeping() - { - SetFollowPaused(true); - - DoScriptText(RAND(EMOTE_KER_SLEEP_1, EMOTE_KER_SLEEP_2, EMOTE_KER_SLEEP_3), me); - - DoScriptText(RAND(SAY_KER_SLEEP_1, SAY_KER_SLEEP_2, SAY_KER_SLEEP_3, SAY_KER_SLEEP_4), me); - - me->SetStandState(UNIT_STAND_STATE_SLEEP); - DoCast(me, SPELL_SLEEP_VISUAL, false); - } - - void ClearSleeping() - { - me->RemoveAurasDueToSpell(SPELL_SLEEP_VISUAL); - me->SetStandState(UNIT_STAND_STATE_STAND); - - DoScriptText(EMOTE_KER_AWAKEN, me); - - SetFollowPaused(false); - } - - void UpdateFollowerAI(const uint32 Diff) - { - if (!UpdateVictim()) - { - if (!HasFollowState(STATE_FOLLOW_INPROGRESS)) - return; - - if (!HasFollowState(STATE_FOLLOW_PAUSED)) - { - if (FallAsleepTimer <= Diff) - { - SetSleeping(); - FallAsleepTimer = urand(25000, 90000); - } - else - FallAsleepTimer -= Diff; - } - - return; - } - - DoMeleeAttackIfReady(); - } - }; - -}; - -/*#### -# npc_prospector_remtravel -####*/ - -enum Remtravel -{ - SAY_REM_START = -1000327, - SAY_REM_AGGRO = -1000328, - SAY_REM_RAMP1_1 = -1000329, - SAY_REM_RAMP1_2 = -1000330, - SAY_REM_BOOK = -1000331, - SAY_REM_TENT1_1 = -1000332, - SAY_REM_TENT1_2 = -1000333, - SAY_REM_MOSS = -1000334, - EMOTE_REM_MOSS = -1000335, - SAY_REM_MOSS_PROGRESS = -1000336, - SAY_REM_PROGRESS = -1000337, - SAY_REM_REMEMBER = -1000338, - EMOTE_REM_END = -1000339, - - FACTION_ESCORTEE = 10, - QUEST_ABSENT_MINDED_PT2 = 731, - NPC_GRAVEL_SCOUT = 2158, - NPC_GRAVEL_BONE = 2159, - NPC_GRAVEL_GEO = 2160 -}; - -class npc_prospector_remtravel : public CreatureScript -{ -public: - npc_prospector_remtravel() : CreatureScript("npc_prospector_remtravel") { } - - bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) - { - if (quest->GetQuestId() == QUEST_ABSENT_MINDED_PT2) - { - if (npc_escortAI* pEscortAI = CAST_AI(npc_prospector_remtravel::npc_prospector_remtravelAI, creature->AI())) - pEscortAI->Start(false, false, player->GetGUID()); - - creature->setFaction(FACTION_ESCORTEE); - } - - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_prospector_remtravelAI(creature); - } - - struct npc_prospector_remtravelAI : public npc_escortAI - { - npc_prospector_remtravelAI(Creature* creature) : npc_escortAI(creature) {} - - void WaypointReached(uint32 waypointId) - { - if (Player* player = GetPlayerForEscort()) - { - switch (waypointId) - { - case 0: - DoScriptText(SAY_REM_START, me, player); - break; - case 5: - DoScriptText(SAY_REM_RAMP1_1, me, player); - break; - case 6: - DoSpawnCreature(NPC_GRAVEL_SCOUT, -10.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - DoSpawnCreature(NPC_GRAVEL_BONE, -10.0f, 7.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - break; - case 9: - DoScriptText(SAY_REM_RAMP1_2, me, player); - break; - case 14: - //depend quest rewarded? - DoScriptText(SAY_REM_BOOK, me, player); - break; - case 15: - DoScriptText(SAY_REM_TENT1_1, me, player); - break; - case 16: - DoSpawnCreature(NPC_GRAVEL_SCOUT, -10.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - DoSpawnCreature(NPC_GRAVEL_BONE, -10.0f, 7.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - break; - case 17: - DoScriptText(SAY_REM_TENT1_2, me, player); - break; - case 26: - DoScriptText(SAY_REM_MOSS, me, player); - break; - case 27: - DoScriptText(EMOTE_REM_MOSS, me, player); - break; - case 28: - DoScriptText(SAY_REM_MOSS_PROGRESS, me, player); - break; - case 29: - DoSpawnCreature(NPC_GRAVEL_SCOUT, -15.0f, 3.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - DoSpawnCreature(NPC_GRAVEL_BONE, -15.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - DoSpawnCreature(NPC_GRAVEL_GEO, -15.0f, 7.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - break; - case 31: - DoScriptText(SAY_REM_PROGRESS, me, player); - break; - case 41: - DoScriptText(SAY_REM_REMEMBER, me, player); - break; - case 42: - DoScriptText(EMOTE_REM_END, me, player); - player->GroupEventHappens(QUEST_ABSENT_MINDED_PT2, me); - break; - } - } - } - - void Reset() {} - - void EnterCombat(Unit* who) - { - if (urand(0, 1)) - DoScriptText(SAY_REM_AGGRO, me, who); - } - - void JustSummoned(Creature* /*pSummoned*/) - { - //unsure if it should be any - //pSummoned->AI()->AttackStart(me); - } - }; - -}; - -/*#### -# npc_threshwackonator -####*/ - -enum Threshwackonator -{ - EMOTE_START = -1000325, //signed for 4966 - SAY_AT_CLOSE = -1000326, //signed for 4966 - QUEST_GYROMAST_REV = 2078, - NPC_GELKAK = 6667, - FACTION_HOSTILE = 14 -}; - -#define GOSSIP_ITEM_INSERT_KEY "[PH] Insert key" - -class npc_threshwackonator : public CreatureScript -{ -public: - npc_threshwackonator() : CreatureScript("npc_threshwackonator") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_INFO_DEF+1) - { - player->CLOSE_GOSSIP_MENU(); - - if (npc_threshwackonatorAI* pThreshAI = CAST_AI(npc_threshwackonator::npc_threshwackonatorAI, creature->AI())) - { - DoScriptText(EMOTE_START, creature); - pThreshAI->StartFollow(player); - } - } - - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (player->GetQuestStatus(QUEST_GYROMAST_REV) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_INSERT_KEY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_threshwackonatorAI(creature); - } - - struct npc_threshwackonatorAI : public FollowerAI - { - npc_threshwackonatorAI(Creature* creature) : FollowerAI(creature) { } - - void Reset() { } - - void MoveInLineOfSight(Unit* who) - { - FollowerAI::MoveInLineOfSight(who); - - if (!me->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE) && who->GetEntry() == NPC_GELKAK) - { - if (me->IsWithinDistInMap(who, 10.0f)) - { - DoScriptText(SAY_AT_CLOSE, who); - DoAtEnd(); - } - } - } - - void DoAtEnd() - { - me->setFaction(FACTION_HOSTILE); - - if (Player* pHolder = GetLeaderForFollower()) - me->AI()->AttackStart(pHolder); - - SetFollowComplete(); - } - }; - -}; - void AddSC_darkshore() { - new npc_kerlonian(); - new npc_prospector_remtravel(); - new npc_threshwackonator(); } diff --git a/src/server/scripts/Kalimdor/desolace.cpp b/src/server/scripts/Kalimdor/desolace.cpp index e196c71f681..a3da0019a8b 100644 --- a/src/server/scripts/Kalimdor/desolace.cpp +++ b/src/server/scripts/Kalimdor/desolace.cpp @@ -19,14 +19,12 @@ /* ScriptData SDName: Desolace SD%Complete: 100 -SDComment: Quest support: 5561 +SDComment: Quest support: 5561, 5581 SDCategory: Desolace EndScriptData */ /* ContentData npc_aged_dying_ancient_kodo -go_iruxos -npc_dalinda_malem go_demon_portal EndContentData */ @@ -172,104 +170,6 @@ public: }; -/*###### -## go_iruxos -## Hand of Iruxos -######*/ - -enum Iruxos -{ - QUEST_HAND_IRUXOS = 5381, - NPC_DEMON_SPIRIT = 11876, -}; - -class go_iruxos : public GameObjectScript -{ - public: - go_iruxos() : GameObjectScript("go_iruxos") { } - - bool OnGossipHello(Player* player, GameObject* go) - { - if (player->GetQuestStatus(QUEST_HAND_IRUXOS) == QUEST_STATUS_INCOMPLETE && !go->FindNearestCreature(NPC_DEMON_SPIRIT, 25.0f, true)) - player->SummonCreature(NPC_DEMON_SPIRIT, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); - - return true; - } -}; - -/*###### -## npc_dalinda_malem. Quest 1440 -######*/ - -enum Dalinda -{ - QUEST_RETURN_TO_VAHLARRIEL = 1440 -}; - -class npc_dalinda : public CreatureScript -{ -public: - npc_dalinda() : CreatureScript("npc_dalinda") { } - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - if (quest->GetQuestId() == QUEST_RETURN_TO_VAHLARRIEL) - { - if (npc_escortAI* pEscortAI = CAST_AI(npc_dalinda::npc_dalindaAI, creature->AI())) - { - pEscortAI->Start(true, false, player->GetGUID()); - creature->setFaction(113); - } - } - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_dalindaAI(creature); - } - - struct npc_dalindaAI : public npc_escortAI - { - npc_dalindaAI(Creature* creature) : npc_escortAI(creature) { } - - void WaypointReached(uint32 waypointId) - { - Player* player = GetPlayerForEscort(); - - switch (waypointId) - { - case 1: - me->IsStandState(); - break; - case 15: - if (player) - player->GroupEventHappens(QUEST_RETURN_TO_VAHLARRIEL, me); - break; - } - } - - void EnterCombat(Unit* /*who*/) { } - - void Reset() {} - - void JustDied(Unit* /*killer*/) - { - if (Player* player = GetPlayerForEscort()) - player->FailQuest(QUEST_RETURN_TO_VAHLARRIEL); - return; - } - - void UpdateAI(const uint32 Diff) - { - npc_escortAI::UpdateAI(Diff); - if (!UpdateVictim()) - return; - DoMeleeAttackIfReady(); - } - }; -}; - /*###### ## go_demon_portal ######*/ @@ -301,7 +201,5 @@ class go_demon_portal : public GameObjectScript void AddSC_desolace() { new npc_aged_dying_ancient_kodo(); - new go_iruxos(); - new npc_dalinda(); new go_demon_portal(); } diff --git a/src/server/scripts/Kalimdor/durotar.cpp b/src/server/scripts/Kalimdor/durotar.cpp index ec06a542b6f..3c66da1917e 100644 --- a/src/server/scripts/Kalimdor/durotar.cpp +++ b/src/server/scripts/Kalimdor/durotar.cpp @@ -17,25 +17,24 @@ #include "ScriptMgr.h" #include "ScriptedCreature.h" -#include "Vehicle.h" #include "SpellScript.h" /*###### -##Quest 5441: Lazy Peons -##npc_lazy_peon +## Quest 25134: Lazy Peons +## npc_lazy_peon ######*/ enum LazyPeonYells { - SAY_SPELL_HIT = -1000600 //Ow! OK, I''ll get back to work, $N!' + SAY_SPELL_HIT = -1000600 // Ow! OK, I''ll get back to work, $N!' }; enum LazyPeon { - QUEST_LAZY_PEONS = 5441, - GO_LUMBERPILE = 175784, - SPELL_BUFF_SLEEP = 17743, - SPELL_AWAKEN_PEON = 19938 + QUEST_LAZY_PEONS = 25134, + GO_LUMBERPILE = 175784, + SPELL_BUFF_SLEEP = 17743, + SPELL_AWAKEN_PEON = 19938 }; class npc_lazy_peon : public CreatureScript @@ -90,7 +89,7 @@ public: if (RebuffTimer <= Diff) { DoCast(me, SPELL_BUFF_SLEEP); - RebuffTimer = 300000; //Rebuff agian in 5 minutes + RebuffTimer = 300000; //Rebuff agian in 5 minutes } else RebuffTimer -= Diff; @@ -101,431 +100,6 @@ public: }; }; -enum Texts -{ - // Tiger Matriarch Credit - SAY_MATRIARCH_AGGRO = 0, - - // Troll Volunteer - SAY_VOLUNTEER_START = 0, - SAY_VOLUNTEER_END = 1, -}; - -enum Spells -{ - // Tiger Matriarch Credit - SPELL_SUMMON_MATRIARCH = 75187, - SPELL_NO_SUMMON_AURA = 75213, - SPELL_DETECT_INVIS = 75180, - SPELL_SUMMON_ZENTABRA_TRIGGER = 75212, - - // Tiger Matriarch - SPELL_POUNCE = 61184, - SPELL_FURIOUS_BITE = 75164, - SPELL_SUMMON_ZENTABRA = 75181, - SPELL_SPIRIT_OF_THE_TIGER_RIDER = 75166, - SPELL_EJECT_PASSENGERS = 50630, - - // Troll Volunteer - SPELL_VOLUNTEER_AURA = 75076, - SPELL_PETACT_AURA = 74071, - SPELL_QUEST_CREDIT = 75106, - SPELL_MOUNTING_CHECK = 75420, - SPELL_TURNIN = 73953, - SPELL_AOE_TURNIN = 75107, - - // Vol'jin War Drums - SPELL_MOTIVATE_1 = 75088, - SPELL_MOTIVATE_2 = 75086, -}; - -enum Creatures -{ - // Tiger Matriarch Credit - NPC_TIGER_VEHICLE = 40305, - - // Troll Volunteer - NPC_URUZIN = 40253, - NPC_VOLUNTEER_1 = 40264, - NPC_VOLUNTEER_2 = 40260, - - // Vol'jin War Drums - NPC_CITIZEN_1 = 40256, - NPC_CITIZEN_2 = 40257, -}; - -enum Events -{ - // Tiger Matriarch Credit - EVENT_CHECK_SUMMON_AURA = 1, - - // Tiger Matriarch - EVENT_POUNCE = 2, - EVENT_NOSUMMON = 3, -}; - -enum Points -{ - POINT_URUZIN = 4026400, -}; - -class npc_tiger_matriarch_credit : public CreatureScript -{ - public: - npc_tiger_matriarch_credit() : CreatureScript("npc_tiger_matriarch_credit") { } - - struct npc_tiger_matriarch_creditAI : public Scripted_NoMovementAI - { - npc_tiger_matriarch_creditAI(Creature* creature) : Scripted_NoMovementAI(creature) - { - events.ScheduleEvent(EVENT_CHECK_SUMMON_AURA, 2000); - } - - void UpdateAI(uint32 const diff) - { - events.Update(diff); - - if (events.ExecuteEvent() == EVENT_CHECK_SUMMON_AURA) - { - std::list tigers; - GetCreatureListWithEntryInGrid(tigers, me, NPC_TIGER_VEHICLE, 15.0f); - if (!tigers.empty()) - { - for (std::list::iterator itr = tigers.begin(); itr != tigers.end(); ++itr) - { - if (!(*itr)->isSummon()) - continue; - - if (Unit* summoner = (*itr)->ToTempSummon()->GetSummoner()) - if (!summoner->HasAura(SPELL_NO_SUMMON_AURA) && !summoner->HasAura(SPELL_SUMMON_ZENTABRA_TRIGGER) - && !summoner->isInCombat()) - { - me->AddAura(SPELL_NO_SUMMON_AURA, summoner); - me->AddAura(SPELL_DETECT_INVIS, summoner); - summoner->CastSpell(summoner, SPELL_SUMMON_MATRIARCH, true); - Talk(SAY_MATRIARCH_AGGRO, summoner->GetGUID()); - } - } - } - - events.ScheduleEvent(EVENT_CHECK_SUMMON_AURA, 5000); - } - } - - private: - EventMap events; - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_tiger_matriarch_creditAI(creature); - } -}; - -class npc_tiger_matriarch : public CreatureScript -{ - public: - npc_tiger_matriarch() : CreatureScript("npc_tiger_matriarch") {} - - struct npc_tiger_matriarchAI : public ScriptedAI - { - npc_tiger_matriarchAI(Creature* creature) : ScriptedAI(creature), - _tigerGuid(0) - { - } - - void EnterCombat(Unit* /*target*/) - { - _events.Reset(); - _events.ScheduleEvent(EVENT_POUNCE, 100); - _events.ScheduleEvent(EVENT_NOSUMMON, 50000); - } - - void IsSummonedBy(Unit* summoner) - { - if (summoner->GetTypeId() != TYPEID_PLAYER || !summoner->GetVehicle()) - return; - - _tigerGuid = summoner->GetVehicle()->GetBase()->GetGUID(); - if (Unit* tiger = ObjectAccessor::GetUnit(*me, _tigerGuid)) - { - me->AddThreat(tiger, 500000.0f); - DoCast(me, SPELL_FURIOUS_BITE); - } - } - - void KilledUnit(Unit* victim) - { - if (victim->GetTypeId() != TYPEID_UNIT || !victim->isSummon()) - return; - - if (Unit* vehSummoner = victim->ToTempSummon()->GetSummoner()) - { - vehSummoner->RemoveAurasDueToSpell(SPELL_NO_SUMMON_AURA); - vehSummoner->RemoveAurasDueToSpell(SPELL_DETECT_INVIS); - vehSummoner->RemoveAurasDueToSpell(SPELL_SPIRIT_OF_THE_TIGER_RIDER); - vehSummoner->RemoveAurasDueToSpell(SPELL_SUMMON_ZENTABRA_TRIGGER); - } - me->DespawnOrUnsummon(); - } - - void DamageTaken(Unit* attacker, uint32& damage) - { - if (!attacker->isSummon()) - return; - - if (HealthBelowPct(20)) - { - damage = 0; - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - if (Unit* vehSummoner = attacker->ToTempSummon()->GetSummoner()) - { - vehSummoner->AddAura(SPELL_SUMMON_ZENTABRA_TRIGGER, vehSummoner); - vehSummoner->CastSpell(vehSummoner, SPELL_SUMMON_ZENTABRA, true); - attacker->CastSpell(attacker, SPELL_EJECT_PASSENGERS, true); - vehSummoner->RemoveAurasDueToSpell(SPELL_NO_SUMMON_AURA); - vehSummoner->RemoveAurasDueToSpell(SPELL_DETECT_INVIS); - vehSummoner->RemoveAurasDueToSpell(SPELL_SPIRIT_OF_THE_TIGER_RIDER); - vehSummoner->RemoveAurasDueToSpell(SPELL_SUMMON_ZENTABRA_TRIGGER); - } - - me->DespawnOrUnsummon(); - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (!_tigerGuid) - return; - - _events.Update(diff); - - while (uint32 eventId = _events.ExecuteEvent()) - { - switch (eventId) - { - case EVENT_POUNCE: - DoCastVictim(SPELL_POUNCE); - _events.ScheduleEvent(EVENT_POUNCE, 30000); - break; - case EVENT_NOSUMMON: // Reapply SPELL_NO_SUMMON_AURA - if (Unit* tiger = ObjectAccessor::GetUnit(*me, _tigerGuid)) - { - if (tiger->isSummon()) - if (Unit* vehSummoner = tiger->ToTempSummon()->GetSummoner()) - me->AddAura(SPELL_NO_SUMMON_AURA, vehSummoner); - } - _events.ScheduleEvent(EVENT_NOSUMMON, 50000); - break; - default: - break; - } - } - - DoMeleeAttackIfReady(); - } - - private: - EventMap _events; - uint64 _tigerGuid; - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_tiger_matriarchAI(creature); - } -}; - -// These models was found in sniff. -// TODO: generalize these models with race from dbc -uint32 const trollmodel[] = -{11665, 11734, 11750, 12037, 12038, 12042, 12049, 12849, 13529, 14759, 15570, 15701, -15702, 1882, 1897, 1976, 2025, 27286, 2734, 2735, 4084, 4085, 4087, 4089, 4231, 4357, -4358, 4360, 4361, 4362, 4363, 4370, 4532, 4537, 4540, 4610, 6839, 7037, 9767, 9768}; - -class npc_troll_volunteer : public CreatureScript -{ - public: - npc_troll_volunteer() : CreatureScript("npc_troll_volunteer") { } - - struct npc_troll_volunteerAI : public ScriptedAI - { - npc_troll_volunteerAI(Creature* creature) : ScriptedAI(creature) - { - } - - void InitializeAI() - { - if (me->isDead() || !me->GetOwner()) - return; - - Reset(); - - switch (urand(0, 3)) - { - case 0: - _mountModel = 6471; - break; - case 1: - _mountModel = 6473; - break; - case 2: - _mountModel = 6469; - break; - default: - _mountModel = 6472; - break; - } - me->SetDisplayId(trollmodel[urand(0, 39)]); - if (Player* player = me->GetOwner()->ToPlayer()) - me->GetMotionMaster()->MoveFollow(player, 5.0f, float(rand_norm() + 1.0f) * M_PI / 3.0f * 4.0f); - } - - void Reset() - { - _complete = false; - me->AddAura(SPELL_VOLUNTEER_AURA, me); - me->AddAura(SPELL_MOUNTING_CHECK, me); - DoCast(me, SPELL_PETACT_AURA); - me->SetReactState(REACT_PASSIVE); - Talk(SAY_VOLUNTEER_START); - } - - // This is needed for mount check aura to know what mountmodel the npc got stored - uint32 GetMountId() - { - return _mountModel; - } - - void MovementInform(uint32 type, uint32 id) - { - if (type != POINT_MOTION_TYPE) - return; - if (id == POINT_URUZIN) - me->DespawnOrUnsummon(); - } - - void SpellHit(Unit* caster, SpellInfo const* spell) - { - if (spell->Id == SPELL_AOE_TURNIN && caster->GetEntry() == NPC_URUZIN && !_complete) - { - _complete = true; // Preventing from giving credit twice - DoCast(me, SPELL_TURNIN); - DoCast(me, SPELL_QUEST_CREDIT); - me->RemoveAurasDueToSpell(SPELL_MOUNTING_CHECK); - me->Dismount(); - Talk(SAY_VOLUNTEER_END); - me->GetMotionMaster()->MovePoint(POINT_URUZIN, caster->GetPositionX(), caster->GetPositionY(), caster->GetPositionZ()); - } - } - - private: - uint32 _mountModel; - bool _complete; - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_troll_volunteerAI(creature); - } -}; - -typedef npc_troll_volunteer::npc_troll_volunteerAI VolunteerAI; - -class spell_mount_check : public SpellScriptLoader -{ - public: - spell_mount_check() : SpellScriptLoader("spell_mount_check") {} - - class spell_mount_check_AuraScript : public AuraScript - { - PrepareAuraScript(spell_mount_check_AuraScript) - bool Validate(SpellInfo const* /*spellEntry*/) - { - if (!sSpellMgr->GetSpellInfo(SPELL_MOUNTING_CHECK)) - return false; - return true; - } - - void HandleEffectPeriodic(AuraEffect const* /*aurEff*/) - { - Unit* target = GetTarget(); - Unit* owner = target->GetOwner(); - - if (!owner) - return; - - if (owner->IsMounted() && !target->IsMounted()) - { - if (VolunteerAI* volunteerAI = CAST_AI(VolunteerAI, target->GetAI())) - target->Mount(volunteerAI->GetMountId()); - } - else if (!owner->IsMounted() && target->IsMounted()) - target->Dismount(); - - target->SetSpeed(MOVE_RUN, owner->GetSpeedRate(MOVE_RUN)); - target->SetSpeed(MOVE_WALK, owner->GetSpeedRate(MOVE_WALK)); - } - - void Register() - { - OnEffectPeriodic += AuraEffectPeriodicFn(spell_mount_check_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); - } - }; - - AuraScript* GetAuraScript() const - { - return new spell_mount_check_AuraScript(); - } -}; - -class spell_voljin_war_drums : public SpellScriptLoader -{ - public: - spell_voljin_war_drums() : SpellScriptLoader("spell_voljin_war_drums") {} - - class spell_voljin_war_drums_SpellScript : public SpellScript - { - PrepareSpellScript(spell_voljin_war_drums_SpellScript) - bool Validate(SpellInfo const* /*spellEntry*/) - { - if (!sSpellMgr->GetSpellInfo(SPELL_MOTIVATE_1)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_MOTIVATE_2)) - return false; - return true; - } - - void HandleDummy(SpellEffIndex /*effIndex*/) - { - Unit* caster = GetCaster(); - if (Unit* target = GetHitUnit()) - { - uint32 motivate = 0; - if (target->GetEntry() == NPC_CITIZEN_1) - motivate = SPELL_MOTIVATE_1; - else if (target->GetEntry() == NPC_CITIZEN_2) - motivate = SPELL_MOTIVATE_2; - if (motivate) - caster->CastSpell(target, motivate, false); - } - } - - void Register() - { - OnEffectHitTarget += SpellEffectFn(spell_voljin_war_drums_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; - - SpellScript* GetSpellScript() const - { - return new spell_voljin_war_drums_SpellScript(); - } -}; - enum VoodooSpells { SPELL_BREW = 16712, // Special Brew @@ -545,9 +119,9 @@ class spell_voodoo : public SpellScriptLoader class spell_voodoo_SpellScript : public SpellScript { - PrepareSpellScript(spell_voodoo_SpellScript) + PrepareSpellScript(spell_voodoo_SpellScript); - bool Validate(SpellInfo const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spell*/) { if (!sSpellMgr->GetSpellInfo(SPELL_BREW) || !sSpellMgr->GetSpellInfo(SPELL_GHOSTLY) || !sSpellMgr->GetSpellInfo(SPELL_HEX1) || !sSpellMgr->GetSpellInfo(SPELL_HEX2) || @@ -579,10 +153,5 @@ class spell_voodoo : public SpellScriptLoader void AddSC_durotar() { new npc_lazy_peon(); - new npc_tiger_matriarch_credit(); - new npc_tiger_matriarch(); - new npc_troll_volunteer(); - new spell_mount_check(); - new spell_voljin_war_drums(); new spell_voodoo(); } diff --git a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp index 5800a6a58a0..c2953ba38ef 100644 --- a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp +++ b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp @@ -19,16 +19,13 @@ /* ScriptData SDName: Dustwallow_Marsh SD%Complete: 95 -SDComment: Quest support: 11180, 558, 11126, 11142, 11174, Vendor Nat Pagle +SDComment: Quest support: 1270, 1222, 27245 SDCategory: Dustwallow Marsh EndScriptData */ /* ContentData -mobs_risen_husk_spirit -npc_lady_jaina_proudmoore -npc_nat_pagle -npc_private_hendel -npc_cassa_crimsonwing - handled by npc_taxi +npc_stinky +go_blackhoof_cage EndContentData */ #include "ScriptMgr.h" @@ -37,443 +34,6 @@ EndContentData */ #include "ScriptedGossip.h" #include "SpellScript.h" -/*###### -## mobs_risen_husk_spirit -######*/ - -enum HauntingWitchHill -{ - // Quest - QUEST_WHATS_HAUNTING_WITCH_HILL = 11180, - - // General spells - SPELL_SUMMON_RESTLESS_APPARITION = 42511, - SPELL_WITCH_HILL_INFORMATION_CREDIT = 42512, - - // Risen Husk specific - SPELL_CONSUME_FLESH = 37933, - NPC_RISEN_HUSK = 23555, - - // Risen Spirit specific - SPELL_INTANGIBLE_PRESENCE = 43127, - NPC_RISEN_SPIRIT = 23554, - - // Events - EVENT_CONSUME_FLESH = 0, - EVENT_INTANGIBLE_PRESENCE = 1, -}; - -class mobs_risen_husk_spirit : public CreatureScript -{ - public: - mobs_risen_husk_spirit() : CreatureScript("mobs_risen_husk_spirit") { } - - struct mobs_risen_husk_spiritAI : public ScriptedAI - { - mobs_risen_husk_spiritAI(Creature* creature) : ScriptedAI(creature) { } - - void Reset() - { - events.Reset(); - if (me->GetEntry() == NPC_RISEN_HUSK) - events.ScheduleEvent(EVENT_CONSUME_FLESH, 5000); - else if (me->GetEntry() == NPC_RISEN_SPIRIT) - events.ScheduleEvent(EVENT_INTANGIBLE_PRESENCE, 5000); - } - - void JustDied(Unit* killer) - { - if (killer->GetTypeId() == TYPEID_PLAYER) - { - if (killer->ToPlayer()->GetQuestStatus(QUEST_WHATS_HAUNTING_WITCH_HILL) == QUEST_STATUS_INCOMPLETE) - { - DoCast(me, SPELL_SUMMON_RESTLESS_APPARITION, true); - DoCast(killer, SPELL_WITCH_HILL_INFORMATION_CREDIT, true); - } - } - } - - void UpdateAI(uint32 const diff) - { - if (!UpdateVictim()) - return; - - events.Update(diff); - - while (uint32 eventId = events.ExecuteEvent()) - { - switch (eventId) - { - case EVENT_CONSUME_FLESH: - DoCastVictim(SPELL_CONSUME_FLESH); - events.ScheduleEvent(EVENT_CONSUME_FLESH, 15000); - break; - case EVENT_INTANGIBLE_PRESENCE: - DoCastVictim(SPELL_INTANGIBLE_PRESENCE); - events.ScheduleEvent(EVENT_INTANGIBLE_PRESENCE, 15000); - break; - default: - break; - } - } - - DoMeleeAttackIfReady(); - } - - private: - EventMap events; - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new mobs_risen_husk_spiritAI (creature); - } -}; - -/*###### -## npc_theramor_guard -######*/ - -enum TheramoreGuard -{ - SAY_QUEST1 = -1000641, - SAY_QUEST2 = -1000642, - SAY_QUEST3 = -1000643, - SAY_QUEST4 = -1000644, - SAY_QUEST5 = -1000645, - SAY_QUEST6 = -1000646, - SAY_QUEST7 = -1000647, - SAY_QUEST8 = -1000648, - SAY_QUEST9 = -1000649, - - QUEST_DISCREDITING_THE_DESERTERS = 11133, - - NPC_THERAMORE_GUARD = 4979, - - SPELL_DOCTORED_LEAFLET = 42725, - SPELL_PROPAGANDIZED = 42246, -}; - -#define GOSSIP_ITEM_THERAMORE_GUARD "You look like an intelligent person. Why don't you read one of these leaflets and give it some thought?" - -class npc_theramore_guard : public CreatureScript -{ -public: - npc_theramore_guard() : CreatureScript("npc_theramore_guard") { } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (player->GetQuestStatus(QUEST_DISCREDITING_THE_DESERTERS) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_THERAMORE_GUARD, GOSSIP_SENDER_MAIN, GOSSIP_SENDER_INFO); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - - return true; - } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - - if (action == GOSSIP_SENDER_INFO) - { - player->CLOSE_GOSSIP_MENU(); - player->KilledMonsterCredit(NPC_THERAMORE_GUARD, 0); - DoScriptText(SAY_QUEST1, creature); - creature->CastSpell(creature, SPELL_DOCTORED_LEAFLET, false); - creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - CAST_AI(npc_theramore_guard::npc_theramore_guardAI, creature->AI())->YellTimer = 4000; - CAST_AI(npc_theramore_guard::npc_theramore_guardAI, creature->AI())->bYellTimer = true; - } - - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_theramore_guardAI(creature); - } - - struct npc_theramore_guardAI : public ScriptedAI - { - npc_theramore_guardAI(Creature* creature) : ScriptedAI(creature) { } - - uint32 YellTimer; - uint32 Step; - bool bYellTimer; - - void Reset() - { - bYellTimer = false; - Step = 0; - } - - void UpdateAI(const uint32 Diff) - { - if (!me->HasAura(SPELL_PROPAGANDIZED)) - me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - - if (bYellTimer && YellTimer <= Diff) - { - switch (Step) - { - case 0: - DoScriptText(RAND(SAY_QUEST2, SAY_QUEST3, SAY_QUEST4, SAY_QUEST5, SAY_QUEST6), me); - YellTimer = 3000; - ++Step; - break; - case 1: - DoScriptText(RAND(SAY_QUEST7, SAY_QUEST8, SAY_QUEST9), me); - me->HandleEmoteCommand(EMOTE_ONESHOT_LAUGH); - Step = 0; - bYellTimer = false; - break; - } - } - else - YellTimer -= Diff; - } - }; -}; - -/*###### -## npc_lady_jaina_proudmoore -######*/ - -enum LadyJaina -{ - QUEST_JAINAS_AUTOGRAPH = 558, - SPELL_JAINAS_AUTOGRAPH = 23122 -}; - -#define GOSSIP_ITEM_JAINA "I know this is rather silly but i have a young ward who is a bit shy and would like your autograph." - -class npc_lady_jaina_proudmoore : public CreatureScript -{ -public: - npc_lady_jaina_proudmoore() : CreatureScript("npc_lady_jaina_proudmoore") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_SENDER_INFO) - { - player->SEND_GOSSIP_MENU(7012, creature->GetGUID()); - player->CastSpell(player, SPELL_JAINAS_AUTOGRAPH, false); - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(QUEST_JAINAS_AUTOGRAPH) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_JAINA, GOSSIP_SENDER_MAIN, GOSSIP_SENDER_INFO); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - - return true; - } - -}; - -/*###### -## npc_nat_pagle -######*/ - -enum NatPagle -{ - QUEST_NATS_MEASURING_TAPE = 8227 -}; - -class npc_nat_pagle : public CreatureScript -{ -public: - npc_nat_pagle() : CreatureScript("npc_nat_pagle") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_TRADE) - player->GetSession()->SendListInventory(creature->GetGUID()); - - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (creature->isVendor() && player->GetQuestRewardStatus(QUEST_NATS_MEASURING_TAPE)) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); - player->SEND_GOSSIP_MENU(7640, creature->GetGUID()); - } - else - player->SEND_GOSSIP_MENU(7638, creature->GetGUID()); - - return true; - } - -}; - -/*###### -## npc_private_hendel -######*/ - -enum Hendel -{ - // looks like all this text ids are wrong. - SAY_PROGRESS_1_TER = -1000411, // signed for 3568 - SAY_PROGRESS_2_HEN = -1000412, // signed for 3568 - SAY_PROGRESS_3_TER = -1000413, - SAY_PROGRESS_4_TER = -1000414, - EMOTE_SURRENDER = -1000415, - - QUEST_MISSING_DIPLO_PT16 = 1324, - FACTION_HOSTILE = 168, //guessed, may be different - - NPC_SENTRY = 5184, //helps hendel - NPC_JAINA = 4968, //appears once hendel gives up - NPC_TERVOSH = 4967 -}; - -//TODO: develop this further, end event not created -class npc_private_hendel : public CreatureScript -{ -public: - npc_private_hendel() : CreatureScript("npc_private_hendel") { } - - bool OnQuestAccept(Player* /*player*/, Creature* creature, const Quest* quest) - { - if (quest->GetQuestId() == QUEST_MISSING_DIPLO_PT16) - creature->setFaction(FACTION_HOSTILE); - - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_private_hendelAI(creature); - } - - struct npc_private_hendelAI : public ScriptedAI - { - npc_private_hendelAI(Creature* creature) : ScriptedAI(creature) { } - - void Reset() - { - me->RestoreFaction(); - } - - void AttackedBy(Unit* pAttacker) - { - if (me->getVictim()) - return; - - if (me->IsFriendlyTo(pAttacker)) - return; - - AttackStart(pAttacker); - } - - void DamageTaken(Unit* pDoneBy, uint32 &Damage) - { - if (Damage > me->GetHealth() || me->HealthBelowPctDamaged(20, Damage)) - { - Damage = 0; - - if (Player* player = pDoneBy->GetCharmerOrOwnerPlayerOrPlayerItself()) - player->GroupEventHappens(QUEST_MISSING_DIPLO_PT16, me); - - DoScriptText(EMOTE_SURRENDER, me); - EnterEvadeMode(); - } - } - }; - -}; - -/*###### -## npc_zelfrax -######*/ - -Position const MovePosition = {-2967.030f, -3872.1799f, 35.620f, 0.0f}; - -enum Zelfrax -{ - SAY_ZELFRAX = -1000472, - SAY_ZELFRAX_2 = -1000473 -}; - -class npc_zelfrax : public CreatureScript -{ -public: - npc_zelfrax() : CreatureScript("npc_zelfrax") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_zelfraxAI(creature); - } - - struct npc_zelfraxAI : public ScriptedAI - { - npc_zelfraxAI(Creature* creature) : ScriptedAI(creature) - { - MoveToDock(); - } - - void AttackStart(Unit* who) - { - if (!who) - return; - - if (me->Attack(who, true)) - { - me->SetInCombatWith(who); - who->SetInCombatWith(me); - - if (IsCombatMovementAllowed()) - me->GetMotionMaster()->MoveChase(who); - } - } - - void MovementInform(uint32 Type, uint32 /*Id*/) - { - if (Type != POINT_MOTION_TYPE) - return; - - me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation()); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); - SetCombatMovement(true); - - if (me->isInCombat()) - if (Unit* unit = me->getVictim()) - me->GetMotionMaster()->MoveChase(unit); - } - - void MoveToDock() - { - SetCombatMovement(false); - me->GetMotionMaster()->MovePoint(0, MovePosition); - DoScriptText(SAY_ZELFRAX, me); - DoScriptText(SAY_ZELFRAX_2, me); - } - - void UpdateAI(uint32 const /*Diff*/) - { - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - }; - -}; - /*###### ## npc_stinky ######*/ @@ -771,13 +331,7 @@ public: void AddSC_dustwallow_marsh() { - new mobs_risen_husk_spirit(); - new npc_lady_jaina_proudmoore(); - new npc_nat_pagle(); - new npc_private_hendel(); - new npc_zelfrax(); new npc_stinky(); - new npc_theramore_guard(); new spell_ooze_zap(); new spell_ooze_zap_channel_end(); new spell_energize_aoe(); diff --git a/src/server/scripts/Kalimdor/felwood.cpp b/src/server/scripts/Kalimdor/felwood.cpp index 1a0aa7b21c0..1d504c02149 100644 --- a/src/server/scripts/Kalimdor/felwood.cpp +++ b/src/server/scripts/Kalimdor/felwood.cpp @@ -19,87 +19,17 @@ /* ScriptData SDName: Felwood SD%Complete: 95 -SDComment: Quest support: 4101, 4102 +SDComment: Quest support: SDCategory: Felwood EndScriptData */ /* ContentData -npcs_riverbreeze_and_silversky EndContentData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "ScriptedGossip.h" -/*###### -## npcs_riverbreeze_and_silversky -######*/ - -#define GOSSIP_ITEM_BEACON "Please make me a Cenarion Beacon" - -enum RiverbreezeAndSilversky -{ - SPELL_CENARION_BEACON = 15120, - - NPC_ARATHANDRIS_SILVERSKY = 9528, - NPC_MAYBESS_RIVERBREEZE = 9529, - - QUEST_CLEASING_FELWOOD_A = 4101, - QUEST_CLEASING_FELWOOD_H = 4102 -}; - -class npcs_riverbreeze_and_silversky : public CreatureScript -{ -public: - npcs_riverbreeze_and_silversky() : CreatureScript("npcs_riverbreeze_and_silversky") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_INFO_DEF+1) - { - player->CLOSE_GOSSIP_MENU(); - creature->CastSpell(player, SPELL_CENARION_BEACON, false); - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - uint32 creatureId = creature->GetEntry(); - - if (creatureId == NPC_ARATHANDRIS_SILVERSKY) - { - if (player->GetQuestRewardStatus(QUEST_CLEASING_FELWOOD_A)) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEACON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - player->SEND_GOSSIP_MENU(2848, creature->GetGUID()); - } else if (player->GetTeam() == HORDE) - player->SEND_GOSSIP_MENU(2845, creature->GetGUID()); - else - player->SEND_GOSSIP_MENU(2844, creature->GetGUID()); - } - - if (creatureId == NPC_MAYBESS_RIVERBREEZE) - { - if (player->GetQuestRewardStatus(QUEST_CLEASING_FELWOOD_H)) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEACON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - player->SEND_GOSSIP_MENU(2849, creature->GetGUID()); - } else if (player->GetTeam() == ALLIANCE) - player->SEND_GOSSIP_MENU(2843, creature->GetGUID()); - else - player->SEND_GOSSIP_MENU(2842, creature->GetGUID()); - } - - return true; - } -}; - void AddSC_felwood() { - new npcs_riverbreeze_and_silversky(); } diff --git a/src/server/scripts/Kalimdor/feralas.cpp b/src/server/scripts/Kalimdor/feralas.cpp index 4fcd20951c9..79aa25cea71 100644 --- a/src/server/scripts/Kalimdor/feralas.cpp +++ b/src/server/scripts/Kalimdor/feralas.cpp @@ -18,8 +18,8 @@ /* ScriptData SDName: Feralas -SD%Complete: 100 -SDComment: Quest support: 3520, 2767, Special vendor Gregan Brewspewer +SD%Complete: 0 +SDComment: Quest support: SDCategory: Feralas EndScriptData */ @@ -28,187 +28,6 @@ EndScriptData */ #include "ScriptedEscortAI.h" #include "ScriptedGossip.h" -/*###### -## npc_gregan_brewspewer -######*/ - -#define GOSSIP_HELLO "Buy somethin', will ya?" - -class npc_gregan_brewspewer : public CreatureScript -{ -public: - npc_gregan_brewspewer() : CreatureScript("npc_gregan_brewspewer") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_INFO_DEF+1) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); - player->SEND_GOSSIP_MENU(2434, creature->GetGUID()); - } - if (action == GOSSIP_ACTION_TRADE) - player->GetSession()->SendListInventory(creature->GetGUID()); - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (creature->isVendor() && player->GetQuestStatus(3909) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - player->SEND_GOSSIP_MENU(2433, creature->GetGUID()); - return true; - } - -}; - -/*###### -## npc_oox22fe -######*/ - -enum OOX -{ - //signed for 7806 - SAY_OOX_START = -1000287, - SAY_OOX_AGGRO1 = -1000288, - SAY_OOX_AGGRO2 = -1000289, - SAY_OOX_AMBUSH = -1000290, - SAY_OOX_END = -1000292, - - NPC_YETI = 7848, - NPC_GORILLA = 5260, - NPC_WOODPAW_REAVER = 5255, - NPC_WOODPAW_BRUTE = 5253, - NPC_WOODPAW_ALPHA = 5258, - NPC_WOODPAW_MYSTIC = 5254, - - QUEST_RESCUE_OOX22FE = 2767, - FACTION_ESCORTEE_A = 774, - FACTION_ESCORTEE_H = 775 -}; - -class npc_oox22fe : public CreatureScript -{ -public: - npc_oox22fe() : CreatureScript("npc_oox22fe") { } - - bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) - { - if (quest->GetQuestId() == QUEST_RESCUE_OOX22FE) - { - DoScriptText(SAY_OOX_START, creature); - //change that the npc is not lying dead on the ground - creature->SetStandState(UNIT_STAND_STATE_STAND); - - if (player->GetTeam() == ALLIANCE) - creature->setFaction(FACTION_ESCORTEE_A); - - if (player->GetTeam() == HORDE) - creature->setFaction(FACTION_ESCORTEE_H); - - if (npc_escortAI* pEscortAI = CAST_AI(npc_oox22fe::npc_oox22feAI, creature->AI())) - pEscortAI->Start(true, false, player->GetGUID()); - - } - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_oox22feAI(creature); - } - - struct npc_oox22feAI : public npc_escortAI - { - npc_oox22feAI(Creature* creature) : npc_escortAI(creature) { } - - void WaypointReached(uint32 waypointId) - { - switch (waypointId) - { - // First Ambush(3 Yetis) - case 11: - DoScriptText(SAY_OOX_AMBUSH, me); - me->SummonCreature(NPC_YETI, -4841.01f, 1593.91f, 73.42f, 3.98f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - me->SummonCreature(NPC_YETI, -4837.61f, 1568.58f, 78.21f, 3.13f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - me->SummonCreature(NPC_YETI, -4841.89f, 1569.95f, 76.53f, 0.68f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - break; - //Second Ambush(3 Gorillas) - case 21: - DoScriptText(SAY_OOX_AMBUSH, me); - me->SummonCreature(NPC_GORILLA, -4595.81f, 2005.99f, 53.08f, 3.74f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - me->SummonCreature(NPC_GORILLA, -4597.53f, 2008.31f, 52.70f, 3.78f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - me->SummonCreature(NPC_GORILLA, -4599.37f, 2010.59f, 52.77f, 3.84f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - break; - //Third Ambush(4 Gnolls) - case 30: - DoScriptText(SAY_OOX_AMBUSH, me); - me->SummonCreature(NPC_WOODPAW_REAVER, -4425.14f, 2075.87f, 47.77f, 3.77f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - me->SummonCreature(NPC_WOODPAW_BRUTE, -4426.68f, 2077.98f, 47.57f, 3.77f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - me->SummonCreature(NPC_WOODPAW_MYSTIC, -4428.33f, 2080.24f, 47.43f, 3.87f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - me->SummonCreature(NPC_WOODPAW_ALPHA, -4430.04f, 2075.54f, 46.83f, 3.81f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - break; - case 37: - DoScriptText(SAY_OOX_END, me); - // Award quest credit - if (Player* player = GetPlayerForEscort()) - player->GroupEventHappens(QUEST_RESCUE_OOX22FE, me); - break; - } - } - - void Reset() - { - if (!HasEscortState(STATE_ESCORT_ESCORTING)) - me->SetStandState(UNIT_STAND_STATE_DEAD); - } - - void EnterCombat(Unit* /*who*/) - { - //For an small probability the npc says something when he get aggro - if (urand(0, 9) > 7) - DoScriptText(RAND(SAY_OOX_AGGRO1, SAY_OOX_AGGRO2), me); - } - - void JustSummoned(Creature* summoned) - { - summoned->AI()->AttackStart(me); - } - }; - -}; - -/*###### -## npc_screecher_spirit -######*/ - -class npc_screecher_spirit : public CreatureScript -{ -public: - npc_screecher_spirit() : CreatureScript("npc_screecher_spirit") { } - - bool OnGossipHello(Player* player, Creature* creature) - { - player->SEND_GOSSIP_MENU(2039, creature->GetGUID()); - player->TalkedToCreature(creature->GetEntry(), creature->GetGUID()); - creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - - return true; - } - -}; - -/*###### -## AddSC -######*/ - void AddSC_feralas() { - new npc_gregan_brewspewer(); - new npc_oox22fe(); - new npc_screecher_spirit(); } diff --git a/src/server/scripts/Kalimdor/moonglade.cpp b/src/server/scripts/Kalimdor/moonglade.cpp index 9df208d2578..3afed715c09 100644 --- a/src/server/scripts/Kalimdor/moonglade.cpp +++ b/src/server/scripts/Kalimdor/moonglade.cpp @@ -18,17 +18,13 @@ /* ScriptData SDName: Moonglade -SD%Complete: 100 -SDComment: Quest support: 30, 272, 5929, 5930, 10965. Special Flight Paths for Druid class. +SD%Complete: 0 +SDComment: Quest support: SDCategory: Moonglade EndScriptData */ /* ContentData -npc_bunthen_plainswind -npc_great_bear_spirit -npc_silva_filnaveth -npc_clintar_spirit -npc_clintar_dreamwalker +npc_omen EndContentData */ #include "ScriptMgr.h" @@ -36,536 +32,6 @@ EndContentData */ #include "ScriptedEscortAI.h" #include "ScriptedGossip.h" -/*###### -## npc_bunthen_plainswind -######*/ - -enum Bunthen -{ - QUEST_SEA_LION_HORDE = 30, - QUEST_SEA_LION_ALLY = 272, - TAXI_PATH_ID_ALLY = 315, - TAXI_PATH_ID_HORDE = 316 -}; - -#define GOSSIP_ITEM_THUNDER "I'd like to fly to Thunder Bluff." -#define GOSSIP_ITEM_AQ_END "Do you know where I can find Half Pendant of Aquatic Endurance?" - -class npc_bunthen_plainswind : public CreatureScript -{ -public: - npc_bunthen_plainswind() : CreatureScript("npc_bunthen_plainswind") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - switch (action) - { - case GOSSIP_ACTION_INFO_DEF + 1: - player->CLOSE_GOSSIP_MENU(); - if (player->getClass() == CLASS_DRUID && player->GetTeam() == HORDE) - player->ActivateTaxiPathTo(TAXI_PATH_ID_HORDE); - break; - case GOSSIP_ACTION_INFO_DEF + 2: - player->SEND_GOSSIP_MENU(5373, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 3: - player->SEND_GOSSIP_MENU(5376, creature->GetGUID()); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (player->getClass() != CLASS_DRUID) - player->SEND_GOSSIP_MENU(4916, creature->GetGUID()); - else if (player->GetTeam() != HORDE) - { - if (player->GetQuestStatus(QUEST_SEA_LION_ALLY) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_AQ_END, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - - player->SEND_GOSSIP_MENU(4917, creature->GetGUID()); - } - else if (player->getClass() == CLASS_DRUID && player->GetTeam() == HORDE) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_THUNDER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - - if (player->GetQuestStatus(QUEST_SEA_LION_HORDE) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_AQ_END, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - - player->SEND_GOSSIP_MENU(4918, creature->GetGUID()); - } - return true; - } - -}; - -/*###### -## npc_great_bear_spirit -######*/ - -#define GOSSIP_BEAR1 "What do you represent, spirit?" -#define GOSSIP_BEAR2 "I seek to understand the importance of strength of the body." -#define GOSSIP_BEAR3 "I seek to understand the importance of strength of the heart." -#define GOSSIP_BEAR4 "I have heard your words, Great Bear Spirit, and I understand. I now seek your blessings to fully learn the way of the Claw." - -class npc_great_bear_spirit : public CreatureScript -{ -public: - npc_great_bear_spirit() : CreatureScript("npc_great_bear_spirit") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - switch (action) - { - case GOSSIP_ACTION_INFO_DEF: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BEAR2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - player->SEND_GOSSIP_MENU(4721, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 1: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BEAR3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - player->SEND_GOSSIP_MENU(4733, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 2: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BEAR4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - player->SEND_GOSSIP_MENU(4734, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 3: - player->SEND_GOSSIP_MENU(4735, creature->GetGUID()); - if (player->GetQuestStatus(5929) == QUEST_STATUS_INCOMPLETE) - player->AreaExploredOrEventHappens(5929); - if (player->GetQuestStatus(5930) == QUEST_STATUS_INCOMPLETE) - player->AreaExploredOrEventHappens(5930); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - //ally or horde quest - if (player->GetQuestStatus(5929) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(5930) == QUEST_STATUS_INCOMPLETE) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BEAR1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - player->SEND_GOSSIP_MENU(4719, creature->GetGUID()); - } - else - player->SEND_GOSSIP_MENU(4718, creature->GetGUID()); - - return true; - } - -}; - -/*###### -## npc_silva_filnaveth -######*/ - -#define GOSSIP_ITEM_RUTHERAN "I'd like to fly to Rut'theran Village." -#define GOSSIP_ITEM_AQ_AGI "Do you know where I can find Half Pendant of Aquatic Agility?" - -class npc_silva_filnaveth : public CreatureScript -{ -public: - npc_silva_filnaveth() : CreatureScript("npc_silva_filnaveth") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - switch (action) - { - case GOSSIP_ACTION_INFO_DEF + 1: - player->CLOSE_GOSSIP_MENU(); - if (player->getClass() == CLASS_DRUID && player->GetTeam() == ALLIANCE) - player->ActivateTaxiPathTo(TAXI_PATH_ID_ALLY); - break; - case GOSSIP_ACTION_INFO_DEF + 2: - player->SEND_GOSSIP_MENU(5374, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 3: - player->SEND_GOSSIP_MENU(5375, creature->GetGUID()); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (player->getClass() != CLASS_DRUID) - player->SEND_GOSSIP_MENU(4913, creature->GetGUID()); - else if (player->GetTeam() != ALLIANCE) - { - if (player->GetQuestStatus(QUEST_SEA_LION_HORDE) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_AQ_AGI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - - player->SEND_GOSSIP_MENU(4915, creature->GetGUID()); - } - else if (player->getClass() == CLASS_DRUID && player->GetTeam() == ALLIANCE) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_RUTHERAN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - - if (player->GetQuestStatus(QUEST_SEA_LION_ALLY) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_AQ_AGI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - - player->SEND_GOSSIP_MENU(4914, creature->GetGUID()); - } - return true; - } - -}; - -/*###### -## npc_clintar_spirit -######*/ - -float const Clintar_spirit_WP[41][5] = -{ - //pos_x pos_y pos_z orien waitTime - {7465.28f, -3115.46f, 439.327f, 0.83f, 4000}, - {7476.49f, -3101, 443.457f, 0.89f, 0}, - {7486.57f, -3085.59f, 439.478f, 1.07f, 0}, - {7472.19f, -3085.06f, 443.142f, 3.07f, 0}, - {7456.92f, -3085.91f, 438.862f, 3.24f, 0}, - {7446.68f, -3083.43f, 438.245f, 2.40f, 0}, - {7446.17f, -3080.21f, 439.826f, 1.10f, 6000}, - {7452.41f, -3085.8f, 438.984f, 5.78f, 0}, - {7469.11f, -3084.94f, 443.048f, 6.25f, 0}, - {7483.79f, -3085.44f, 439.607f, 6.25f, 0}, - {7491.14f, -3090.96f, 439.983f, 5.44f, 0}, - {7497.62f, -3098.22f, 436.854f, 5.44f, 0}, - {7498.72f, -3113.41f, 434.596f, 4.84f, 0}, - {7500.06f, -3122.51f, 434.749f, 5.17f, 0}, - {7504.96f, -3131.53f, 434.475f, 4.74f, 0}, - {7504.31f, -3133.53f, 435.693f, 3.84f, 6000}, - {7504.55f, -3133.27f, 435.476f, 0.68f, 15000}, - {7501.99f, -3126.01f, 434.93f, 1.83f, 0}, - {7490.76f, -3114.97f, 434.431f, 2.51f, 0}, - {7479.64f, -3105.51f, 431.123f, 1.83f, 0}, - {7474.63f, -3086.59f, 428.994f, 1.83f, 2000}, - {7472.96f, -3074.18f, 427.566f, 1.57f, 0}, - {7472.25f, -3063, 428.268f, 1.55f, 0}, - {7473.46f, -3054.22f, 427.588f, 0.36f, 0}, - {7475.08f, -3053.6f, 428.653f, 0.36f, 6000}, - {7474.66f, -3053.56f, 428.433f, 3.19f, 4000}, - {7471.81f, -3058.84f, 427.073f, 4.29f, 0}, - {7472.16f, -3064.91f, 427.772f, 4.95f, 0}, - {7471.56f, -3085.36f, 428.924f, 4.72f, 0}, - {7473.56f, -3093.48f, 429.294f, 5.04f, 0}, - {7478.94f, -3104.29f, 430.638f, 5.23f, 0}, - {7484.46f, -3109.61f, 432.769f, 5.79f, 0}, - {7490.23f, -3111.08f, 434.431f, 0.02f, 0}, - {7496.29f, -3108, 434.783f, 1.15f, 0}, - {7497.46f, -3100.66f, 436.191f, 1.50f, 0}, - {7495.64f, -3093.39f, 438.349f, 2.10f, 0}, - {7492.44f, -3086.01f, 440.267f, 1.38f, 0}, - {7498.26f, -3076.44f, 440.808f, 0.71f, 0}, - {7506.4f, -3067.35f, 443.64f, 0.77f, 0}, - {7518.37f, -3057.42f, 445.584f, 0.74f, 0}, - {7517.51f, -3056.3f, 444.568f, 2.49f, 4500} -}; - -Position const AspectRavenSummon = {7472.96f, -3074.18f, 427.566f, 0.0f}; -Position const ClintarSpiritSummon = {7459.2275f, -3122.5632f, 438.9842f, 0.8594f}; - -enum ClintarSpirit -{ - ASPECT_RAVEN = 22915, - - //from -1000292 to -1000287 are signed for 7806. but all this texts ids wrong. - CLINTAR_SPIRIT_SAY_START = -1000286, - CLINTAR_SPIRIT_SAY_UNDER_ATTACK_1 = -1000287, - CLINTAR_SPIRIT_SAY_UNDER_ATTACK_2 = -1000288, - CLINTAR_SPIRIT_SAY_GET_ONE = -1000289, - CLINTAR_SPIRIT_SAY_GET_TWO = -1000290, - CLINTAR_SPIRIT_SAY_GET_THREE = -1000291, - CLINTAR_SPIRIT_SAY_GET_FINAL = -1000292 -}; - -class npc_clintar_spirit : public CreatureScript -{ -public: - npc_clintar_spirit() : CreatureScript("npc_clintar_spirit") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_clintar_spiritAI (creature); - } - - struct npc_clintar_spiritAI : public npc_escortAI - { - public: - npc_clintar_spiritAI(Creature* creature) : npc_escortAI(creature) {} - - uint8 Step; - uint32 CurrWP; - uint32 EventTimer; - uint32 checkPlayerTimer; - - uint64 PlayerGUID; - - bool EventOnWait; - - void Reset() - { - if (!PlayerGUID) - { - Step = 0; - CurrWP = 0; - EventTimer = 0; - PlayerGUID = 0; - checkPlayerTimer = 1000; - EventOnWait = false; - } - } - - void JustDied(Unit* /*killer*/) - { - if (!PlayerGUID) - return; - - Player* player = Unit::GetPlayer(*me, PlayerGUID); - if (player && player->GetQuestStatus(10965) == QUEST_STATUS_INCOMPLETE) - { - player->FailQuest(10965); - PlayerGUID = 0; - Reset(); - } - } - - void EnterEvadeMode() - { - Player* player = Unit::GetPlayer(*me, PlayerGUID); - if (player && player->isInCombat() && player->getAttackerForHelper()) - { - AttackStart(player->getAttackerForHelper()); - return; - } - npc_escortAI::EnterEvadeMode(); - } - - void EnterCombat(Unit* who) - { - switch (urand(0, 1)) - { - case 0: DoScriptText(CLINTAR_SPIRIT_SAY_UNDER_ATTACK_1, me, who); break; - case 1: DoScriptText(CLINTAR_SPIRIT_SAY_UNDER_ATTACK_2, me, who); break; - } - } - - void StartEvent(Player* player) - { - if (player && player->GetQuestStatus(10965) == QUEST_STATUS_INCOMPLETE) - { - for (uint8 i = 0; i < 41; ++i) - { - AddWaypoint(i, Clintar_spirit_WP[i][0], Clintar_spirit_WP[i][1], Clintar_spirit_WP[i][2], (uint32)Clintar_spirit_WP[i][4]); - } - PlayerGUID = player->GetGUID(); - Start(true, false, PlayerGUID); - } - return; - } - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - - if (!PlayerGUID) - { - me->setDeathState(JUST_DIED); - return; - } - - if (!me->isInCombat() && !EventOnWait) - { - if (checkPlayerTimer <= diff) - { - Player* player = Unit::GetPlayer(*me, PlayerGUID); - if (player && player->isInCombat() && player->getAttackerForHelper()) - AttackStart(player->getAttackerForHelper()); - checkPlayerTimer = 1000; - } else checkPlayerTimer -= diff; - } - - if (EventOnWait && EventTimer <= diff) - { - - Player* player = Unit::GetPlayer(*me, PlayerGUID); - if (!player || (player && player->GetQuestStatus(10965) == QUEST_STATUS_NONE)) - { - me->setDeathState(JUST_DIED); - return; - } - - switch (CurrWP) - { - case 0: - switch (Step) - { - case 0: - me->Say(CLINTAR_SPIRIT_SAY_START, 0, PlayerGUID); - EventTimer = 8000; - Step = 1; - break; - case 1: - EventOnWait = false; - break; - } - break; - case 6: - switch (Step) - { - case 0: - me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 133); - EventTimer = 5000; - Step = 1; - break; - case 1: - me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); - DoScriptText(CLINTAR_SPIRIT_SAY_GET_ONE, me, player); - EventOnWait = false; - break; - } - break; - case 15: - switch (Step) - { - case 0: - me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 133); - EventTimer = 5000; - Step = 1; - break; - case 1: - me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); - EventOnWait = false; - break; - } - break; - case 16: - switch (Step) - { - case 0: - DoScriptText(CLINTAR_SPIRIT_SAY_GET_TWO, me, player); - EventTimer = 15000; - Step = 1; - break; - case 1: - EventOnWait = false; - break; - } - break; - case 20: - switch (Step) - { - case 0: - if (Creature* mob = me->SummonCreature(ASPECT_RAVEN, AspectRavenSummon, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000)) - { - mob->AddThreat(me, 10000.0f); - mob->AI()->AttackStart(me); - } - EventTimer = 2000; - Step = 1; - break; - case 1: - EventOnWait = false; - break; - } - break; - case 24: - switch (Step) - { - case 0: - me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 133); - EventTimer = 5000; - Step = 1; - break; - case 1: - me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); - EventOnWait = false; - break; - } - break; - case 25: - switch (Step) - { - case 0: - DoScriptText(CLINTAR_SPIRIT_SAY_GET_THREE, me, player); - EventTimer = 4000; - Step = 1; - break; - case 1: - EventOnWait = false; - break; - } - break; - case 40: - switch (Step) - { - case 0: - me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 2); - DoScriptText(CLINTAR_SPIRIT_SAY_GET_FINAL, me, player); - player->CompleteQuest(10965); - EventTimer = 1500; - Step = 1; - break; - case 1: - me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); - EventTimer = 3000; - Step = 2; - break; - case 2: - player->TalkedToCreature(me->GetEntry(), me->GetGUID()); - PlayerGUID = 0; - Reset(); - me->setDeathState(JUST_DIED); - break; - } - break; - default: - EventOnWait = false; - break; - } - - } else if (EventOnWait) EventTimer -= diff; - } - - void WaypointReached(uint32 waypointId) - { - CurrWP = waypointId; - EventTimer = 0; - Step = 0; - EventOnWait = true; - } - }; - -}; - -/*#### -# npc_clintar_dreamwalker -####*/ - -enum Clintar -{ - CLINTAR_SPIRIT = 22916 -}; - -class npc_clintar_dreamwalker : public CreatureScript -{ -public: - npc_clintar_dreamwalker() : CreatureScript("npc_clintar_dreamwalker") { } - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - if (quest->GetQuestId() == 10965) - if (Creature* clintar_spirit = creature->SummonCreature(CLINTAR_SPIRIT, ClintarSpiritSummon, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 100000)) - CAST_AI(npc_clintar_spirit::npc_clintar_spiritAI, clintar_spirit->AI())->StartEvent(player); - return true; - } - -}; - /*#### # npc_omen ####*/ @@ -714,11 +180,6 @@ public: void AddSC_moonglade() { - new npc_bunthen_plainswind(); - new npc_great_bear_spirit(); - new npc_silva_filnaveth(); - new npc_clintar_dreamwalker(); - new npc_clintar_spirit(); new npc_omen(); new npc_giant_spotlight(); } diff --git a/src/server/scripts/Kalimdor/mulgore.cpp b/src/server/scripts/Kalimdor/mulgore.cpp index 5b35688c2b8..9aea03de09d 100644 --- a/src/server/scripts/Kalimdor/mulgore.cpp +++ b/src/server/scripts/Kalimdor/mulgore.cpp @@ -19,14 +19,13 @@ /* ScriptData SDName: Mulgore SD%Complete: 100 -SDComment: Support for quest: 11129, 772 +SDComment: Support for quest: 11129, 861 SDCategory: Mulgore EndScriptData */ /* ContentData npc_skorn_whitecloud npc_kyle_frenzied -npc_plains_vision EndContentData */ #include "ScriptMgr.h" @@ -200,127 +199,8 @@ public: }; -/*##### -# npc_plains_vision -######*/ - -Position const wpPlainVision[50] = -{ - {-2226.32f, -408.095f, -9.36235f, 0.0f}, - {-2203.04f, -437.212f, -5.72498f, 0.0f}, - {-2163.91f, -457.851f, -7.09049f, 0.0f}, - {-2123.87f, -448.137f, -9.29591f, 0.0f}, - {-2104.66f, -427.166f, -6.49513f, 0.0f}, - {-2101.48f, -422.826f, -5.3567f, 0.0f}, - {-2097.56f, -417.083f, -7.16716f, 0.0f}, - {-2084.87f, -398.626f, -9.88973f, 0.0f}, - {-2072.71f, -382.324f, -10.2488f, 0.0f}, - {-2054.05f, -356.728f, -6.22468f, 0.0f}, - {-2051.8f, -353.645f, -5.35791f, 0.0f}, - {-2049.08f, -349.912f, -6.15723f, 0.0f}, - {-2030.6f, -310.724f, -9.59302f, 0.0f}, - {-2002.15f, -249.308f, -10.8124f, 0.0f}, - {-1972.85f, -195.811f, -10.6316f, 0.0f}, - {-1940.93f, -147.652f, -11.7055f, 0.0f}, - {-1888.06f, -81.943f, -11.4404f, 0.0f}, - {-1837.05f, -34.0109f, -12.258f, 0.0f}, - {-1796.12f, -14.6462f, -10.3581f, 0.0f}, - {-1732.61f, -4.27746f, -10.0213f, 0.0f}, - {-1688.94f, -0.829945f, -11.7103f, 0.0f}, - {-1681.32f, 13.0313f, -9.48056f, 0.0f}, - {-1677.04f, 36.8349f, -7.10318f, 0.0f}, - {-1675.2f, 68.559f, -8.95384f, 0.0f}, - {-1676.57f, 89.023f, -9.65104f, 0.0f}, - {-1678.16f, 110.939f, -10.1782f, 0.0f}, - {-1677.86f, 128.681f, -5.73869f, 0.0f}, - {-1675.27f, 144.324f, -3.47916f, 0.0f}, - {-1671.7f, 163.169f, -1.23098f, 0.0f}, - {-1666.61f, 181.584f, 5.26145f, 0.0f}, - {-1661.51f, 196.154f, 8.95252f, 0.0f}, - {-1655.47f, 210.811f, 8.38727f, 0.0f}, - {-1647.07f, 226.947f, 5.27755f, 0.0f}, - {-1621.65f, 232.91f, 2.69579f, 0.0f}, - {-1600.23f, 237.641f, 2.98539f, 0.0f}, - {-1576.07f, 242.546f, 4.66541f, 0.0f}, - {-1554.57f, 248.494f, 6.60377f, 0.0f}, - {-1547.53f, 259.302f, 10.6741f, 0.0f}, - {-1541.7f, 269.847f, 16.4418f, 0.0f}, - {-1539.83f, 278.989f, 21.0597f, 0.0f}, - {-1540.16f, 290.219f, 27.8247f, 0.0f}, - {-1538.99f, 298.983f, 34.0032f, 0.0f}, - {-1540.38f, 307.337f, 41.3557f, 0.0f}, - {-1536.61f, 314.884f, 48.0179f, 0.0f}, - {-1532.42f, 323.277f, 55.6667f, 0.0f}, - {-1528.77f, 329.774f, 61.1525f, 0.0f}, - {-1525.65f, 333.18f, 63.2161f, 0.0f}, - {-1517.01f, 350.713f, 62.4286f, 0.0f}, - {-1511.39f, 362.537f, 62.4539f, 0.0f}, - {-1508.68f, 366.822f, 62.733f, 0.0f} -}; - -class npc_plains_vision : public CreatureScript -{ -public: - npc_plains_vision() : CreatureScript("npc_plains_vision") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_plains_visionAI (creature); - } - - struct npc_plains_visionAI : public ScriptedAI - { - npc_plains_visionAI(Creature* creature) : ScriptedAI(creature) {} - - bool newWaypoint; - uint8 WayPointId; - uint8 amountWP; - - void Reset() - { - WayPointId = 0; - newWaypoint = true; - amountWP = 49; - } - - void EnterCombat(Unit* /*who*/){} - - void MovementInform(uint32 type, uint32 id) - { - if (type != POINT_MOTION_TYPE) - return; - - if (id < amountWP) - { - ++WayPointId; - newWaypoint = true; - } - else - { - me->setDeathState(JUST_DIED); - me->RemoveCorpse(); - } - } - - void UpdateAI(const uint32 /*diff*/) - { - if (newWaypoint) - { - me->GetMotionMaster()->MovePoint(WayPointId, wpPlainVision[WayPointId]); - newWaypoint = false; - } - } - }; - -}; - -/*##### -# -######*/ - void AddSC_mulgore() { new npc_skorn_whitecloud(); new npc_kyle_frenzied(); - new npc_plains_vision(); } diff --git a/src/server/scripts/Kalimdor/orgrimmar.cpp b/src/server/scripts/Kalimdor/orgrimmar.cpp index fca8d0f5fc5..48f0396c5fb 100644 --- a/src/server/scripts/Kalimdor/orgrimmar.cpp +++ b/src/server/scripts/Kalimdor/orgrimmar.cpp @@ -18,236 +18,18 @@ /* ScriptData SDName: Orgrimmar -SD%Complete: 100 -SDComment: Quest support: 2460, 6566 +SD%Complete: 0 +SDComment: Quest support: SDCategory: Orgrimmar EndScriptData */ /* ContentData -npc_shenthul -npc_thrall_warchief EndContentData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "ScriptedGossip.h" -/*###### -## npc_shenthul -######*/ - -enum Shenthul -{ - QUEST_SHATTERED_SALUTE = 2460 -}; - -class npc_shenthul : public CreatureScript -{ -public: - npc_shenthul() : CreatureScript("npc_shenthul") { } - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - if (quest->GetQuestId() == QUEST_SHATTERED_SALUTE) - { - CAST_AI(npc_shenthul::npc_shenthulAI, creature->AI())->CanTalk = true; - CAST_AI(npc_shenthul::npc_shenthulAI, creature->AI())->PlayerGUID = player->GetGUID(); - } - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_shenthulAI (creature); - } - - struct npc_shenthulAI : public ScriptedAI - { - npc_shenthulAI(Creature* creature) : ScriptedAI(creature) {} - - bool CanTalk; - bool CanEmote; - uint32 SaluteTimer; - uint32 ResetTimer; - uint64 PlayerGUID; - - void Reset() - { - CanTalk = false; - CanEmote = false; - SaluteTimer = 6000; - ResetTimer = 0; - PlayerGUID = 0; - } - - void EnterCombat(Unit* /*who*/) {} - - void UpdateAI(const uint32 diff) - { - if (CanEmote) - { - if (ResetTimer <= diff) - { - if (Player* player = Unit::GetPlayer(*me, PlayerGUID)) - { - if (player->GetTypeId() == TYPEID_PLAYER && player->GetQuestStatus(QUEST_SHATTERED_SALUTE) == QUEST_STATUS_INCOMPLETE) - player->FailQuest(QUEST_SHATTERED_SALUTE); - } - Reset(); - } else ResetTimer -= diff; - } - - if (CanTalk && !CanEmote) - { - if (SaluteTimer <= diff) - { - me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); - CanEmote = true; - ResetTimer = 60000; - } else SaluteTimer -= diff; - } - - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - - void ReceiveEmote(Player* player, uint32 emote) - { - if (emote == TEXT_EMOTE_SALUTE && player->GetQuestStatus(QUEST_SHATTERED_SALUTE) == QUEST_STATUS_INCOMPLETE) - { - if (CanEmote) - { - player->AreaExploredOrEventHappens(QUEST_SHATTERED_SALUTE); - Reset(); - } - } - } - }; - -}; - -/*###### -## npc_thrall_warchief -######*/ - -enum ThrallWarchief -{ - QUEST_6566 = 6566, - - SPELL_CHAIN_LIGHTNING = 16033, - SPELL_SHOCK = 16034 -}; - -#define GOSSIP_HTW "Please share your wisdom with me, Warchief." -#define GOSSIP_STW1 "What discoveries?" -#define GOSSIP_STW2 "Usurper?" -#define GOSSIP_STW3 "With all due respect, Warchief - why not allow them to be destroyed? Does this not strengthen our position?" -#define GOSSIP_STW4 "I... I did not think of it that way, Warchief." -#define GOSSIP_STW5 "I live only to serve, Warchief! My life is empty and meaningless without your guidance." -#define GOSSIP_STW6 "Of course, Warchief!" - -//TODO: verify abilities/timers -class npc_thrall_warchief : public CreatureScript -{ -public: - npc_thrall_warchief() : CreatureScript("npc_thrall_warchief") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - switch (action) - { - case GOSSIP_ACTION_INFO_DEF+1: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - player->SEND_GOSSIP_MENU(5733, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); - player->SEND_GOSSIP_MENU(5734, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); - player->SEND_GOSSIP_MENU(5735, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); - player->SEND_GOSSIP_MENU(5736, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+5: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6); - player->SEND_GOSSIP_MENU(5737, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+6: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+7); - player->SEND_GOSSIP_MENU(5738, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+7: - player->CLOSE_GOSSIP_MENU(); - player->AreaExploredOrEventHappens(QUEST_6566); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(QUEST_6566) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HTW, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_thrall_warchiefAI (creature); - } - - struct npc_thrall_warchiefAI : public ScriptedAI - { - npc_thrall_warchiefAI(Creature* creature) : ScriptedAI(creature) {} - - uint32 ChainLightningTimer; - uint32 ShockTimer; - - void Reset() - { - ChainLightningTimer = 2000; - ShockTimer = 8000; - } - - void EnterCombat(Unit* /*who*/) {} - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (ChainLightningTimer <= diff) - { - DoCast(me->getVictim(), SPELL_CHAIN_LIGHTNING); - ChainLightningTimer = 9000; - } else ChainLightningTimer -= diff; - - if (ShockTimer <= diff) - { - DoCast(me->getVictim(), SPELL_SHOCK); - ShockTimer = 15000; - } else ShockTimer -= diff; - - DoMeleeAttackIfReady(); - } - }; - -}; - void AddSC_orgrimmar() { - new npc_shenthul(); - new npc_thrall_warchief(); } diff --git a/src/server/scripts/Kalimdor/silithus.cpp b/src/server/scripts/Kalimdor/silithus.cpp index 639de3dc3b2..1636c867b30 100644 --- a/src/server/scripts/Kalimdor/silithus.cpp +++ b/src/server/scripts/Kalimdor/silithus.cpp @@ -19,14 +19,14 @@ /* ScriptData SDName: Silithus SD%Complete: 100 -SDComment: Quest support: 7785, 8304, 8507. +SDComment: Quest support: 7785, 8304. SDCategory: Silithus EndScriptData */ /* ContentData npc_highlord_demitrian npcs_rutgar_and_frankal -quest_a_pawn_on_the_eternal_pawn +go_wind_stone EndContentData */ #include "ScriptMgr.h" @@ -224,930 +224,6 @@ public: }; -/*#### -# quest_a_pawn_on_the_eternal_board (Defines) -####*/ -enum EternalBoard -{ - QUEST_A_PAWN_ON_THE_ETERNAL_BOARD = 8519, - - FACTION_HOSTILE = 14, - FACTION_FRIENDLY = 35, - - C_ANACHRONOS = 15381, - C_FANDRAL_STAGHELM = 15382, - C_ARYGOS = 15380, - C_MERITHRA = 15378, - C_CAELESTRASZ = 15379, - - ANACHRONOS_SAY_1 = -1350000, - ANACHRONOS_SAY_2 = -1350001, - ANACHRONOS_SAY_3 = -1350002, - ANACHRONOS_SAY_4 = -1350003, - ANACHRONOS_SAY_5 = -1350004, - ANACHRONOS_SAY_6 = -1350005, - ANACHRONOS_SAY_7 = -1350006, - ANACHRONOS_SAY_8 = -1350007, - ANACHRONOS_SAY_9 = -1350008, - ANACHRONOS_SAY_10 = -1350009, - ANACHRONOS_EMOTE_1 = -1350010, - ANACHRONOS_EMOTE_2 = -1350011, - ANACHRONOS_EMOTE_3 = -1350012, - - FANDRAL_SAY_1 = -1350013, - FANDRAL_SAY_2 = -1350014, - FANDRAL_SAY_3 = -1350015, - FANDRAL_SAY_4 = -1350016, - FANDRAL_SAY_5 = -1350017, - FANDRAL_SAY_6 = -1350018, - FANDRAL_EMOTE_1 = -1350019, - FANDRAL_EMOTE_2 = -1350020, - - CAELESTRASZ_SAY_1 = -1350021, - CAELESTRASZ_SAY_2 = -1350022, - CAELESTRASZ_YELL_1 = -1350023, - - ARYGOS_SAY_1 = -1350024, - ARYGOS_YELL_1 = -1350025, - ARYGOS_EMOTE_1 = -1350026, - - MERITHRA_SAY_1 = -1350027, - MERITHRA_SAY_2 = -1350028, - MERITHRA_YELL_1 = -1350029, - MERITHRA_EMOTE_1 = -1350030, - - GO_GATE_OF_AHN_QIRAJ = 176146, - GO_GLYPH_OF_AHN_QIRAJ = 176148, - GO_ROOTS_OF_AHN_QIRAJ = 176147 -}; -/*##### -# Quest: A Pawn on the Eternal Board -#####*/ - -/* ContentData -A Pawn on the Eternal Board - creatures, gameobjects and defines -mob_qiraj_war_spawn : Adds that are summoned in the Qiraj gates battle. -npc_anachronos_the_ancient : Creature that controls the event. -npc_anachronos_quest_trigger: controls the spawning of the BG War mobs. -go_crystalline_tear : GameObject that begins the event and hands out quest -TO DO: get correct spell IDs and timings for spells cast upon dragon transformations -TO DO: Dragons should use the HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF) after transformation, but for some unknown reason it doesnt work. -EndContentData */ - -#define EVENT_AREA_RADIUS 65 //65yds -#define EVENT_COOLDOWN 500000 //in ms. appear after event completed or failed (should be = Adds despawn time) - -struct QuestCinematic -{ - int32 TextId; - uint32 Creature, Timer; -}; - -// Creature 0 - Anachronos, 1 - Fandral, 2 - Arygos, 3 - Merithra, 4 - Caelestrasz -static QuestCinematic EventAnim[]= -{ - {ANACHRONOS_SAY_1, 0, 2000}, - {FANDRAL_SAY_1, 1, 4000}, - {MERITHRA_EMOTE_1, 3, 500}, - {MERITHRA_SAY_1, 3, 500}, - {ARYGOS_EMOTE_1, 2, 2000}, - {CAELESTRASZ_SAY_1, 4, 8000}, - {MERITHRA_SAY_2, 3, 6000}, - {0, 3, 2000}, - {MERITHRA_YELL_1, 3, 2500}, - {0, 3, 3000}, //Morph - {0, 3, 4000}, //EmoteLiftoff - {0, 3, 4000}, // spell - {0, 3, 1250}, //fly - {0, 3, 250}, //remove flags - {ARYGOS_SAY_1, 2, 3000}, - {0, 3, 2000}, - {ARYGOS_YELL_1, 2, 3000}, - {0, 3, 3000}, //Morph - {0, 3, 4000}, //EmoteLiftoff - {0, 3, 4000}, // spell - {0, 3, 1000}, //fly - {0, 3, 1000}, //remove flags - {CAELESTRASZ_SAY_2, 4, 5000}, - {0, 3, 3000}, - {CAELESTRASZ_YELL_1, 4, 3000}, - {0, 3, 3000}, //Morph - {0, 3, 4000}, //EmoteLiftoff - {0, 3, 2500}, // spell - {ANACHRONOS_SAY_2, 0, 2000}, - {0, 3, 250}, //fly - {0, 3, 25}, //remove flags - {FANDRAL_SAY_2, 1, 3000}, - {ANACHRONOS_SAY_3, 0, 10000}, //Both run through the armies - {0, 3, 2000}, // Sands will stop - {0, 3, 8000}, // Summon Gate - {ANACHRONOS_SAY_4, 0, 4000}, - {0, 0, 2000}, //spell 1-> Arcane cosmetic (Mobs freeze) - {0, 0, 5000}, //Spell 2-> Arcane long cosmetic (barrier appears) (Barrier -> Glyphs) - {0, 0, 7000}, //BarrieR - {0, 0, 4000}, //Glyphs - {ANACHRONOS_SAY_5, 0, 2000}, - {0, 0, 4000}, // Roots - {FANDRAL_SAY_3, 1, 3000}, //Root Text - {FANDRAL_EMOTE_1, 1, 3000}, //falls knee - {ANACHRONOS_SAY_6, 0, 3000}, - {ANACHRONOS_SAY_7, 0, 3000}, - {ANACHRONOS_SAY_8, 0, 8000}, - {ANACHRONOS_EMOTE_1, 0, 1000}, //Give Scepter - {FANDRAL_SAY_4, 1, 3000}, - {FANDRAL_SAY_5, 1, 3000}, //->Equip hammer~Scepter, throw it at door - {FANDRAL_EMOTE_2, 1, 3000}, //Throw hammer at door. - {ANACHRONOS_SAY_9, 0, 3000}, - {FANDRAL_SAY_6, 1, 3000}, //fandral goes away - {ANACHRONOS_EMOTE_2, 0, 3000}, - {ANACHRONOS_EMOTE_3, 0, 3000}, - {0, 0, 2000}, - {0, 0, 2000}, - {0, 0, 4000}, - {ANACHRONOS_SAY_10, 0, 3000}, - {0, 0, 2000}, - {0, 0, 3000}, - {0, 0, 15000}, - {0, 0, 5000}, - {0, 0, 3500}, - {0, 0, 5000}, - {0, 0, 3500}, - {0, 0, 5000}, - {0, 0, 0} -}; - -//Cordinates for Spawns -Position const SpawnLocation[] = -{ - {-8085.0f, 1528.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8080.0f, 1526.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8085.0f, 1524.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8080.0f, 1522.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8085.0f, 1520.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - - {-8085.0f, 1524.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8080.0f, 1522.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8085.0f, 1520.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8080.0f, 1518.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8085.0f, 1516.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - - {-8085.0f, 1518.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8080.0f, 1516.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8080.0f, 1520.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8080.0f, 1424.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8085.0f, 1422.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - // 2 waves of warriors - {-8082.0f, 1528.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8078.0f, 1525.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8082.0f, 1524.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8078.0f, 1526.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8082.0f, 1527.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - - {-8082.0f, 1524.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8078.0f, 1522.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8082.0f, 1520.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8078.0f, 1518.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8082.0f, 1516.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - - {-8082.0f, 1523.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8078.0f, 1521.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8082.0f, 1528.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8078.0f, 1519.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8082.0f, 1526.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - - {-8082.0f, 1524.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8078.0f, 1522.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8082.0f, 1520.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8078.0f, 1518.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8082.0f, 1516.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - - {-8088.0f, 1510.0f, 2.61f, 0.0f}, //Anubisath Conqueror - {-8084.0f, 1520.0f, 2.61f, 0.0f}, //Anubisath Conqueror - {-8088.0f, 1530.0f, 2.61f, 0.0f}, //Anubisath Conqueror - - {-8080.0f, 1513.0f, 2.61f, 0.0f}, //Qiraj Wasp - {-8082.0f, 1523.0f, 2.61f, 0.0f}, //Qiraj Wasp - {-8085.0f, 1518.0f, 2.61f, 0.0f}, //Qiraj Wasp - {-8082.0f, 1516.0f, 2.61f, 0.0f}, //Qiraj Wasp - {-8085.0f, 1520.0f, 2.61f, 0.0f}, //Qiraj Wasp - {-8080.0f, 1528.0f, 2.61f, 0.0f}, //Qiraj Wasp - - {-8082.0f, 1513.0f, 2.61f, 0.0f}, //Qiraj Wasp - {-8079.0f, 1523.0f, 2.61f, 0.0f}, //Qiraj Wasp - {-8080.0f, 1531.0f, 2.61f, 0.0f}, //Qiraj Wasp - {-8079.0f, 1516.0f, 2.61f, 0.0f}, //Qiraj Wasp - {-8082.0f, 1520.0f, 2.61f, 0.0f}, //Qiraj Wasp - {-8080.0f, 1518.0f, 2.61f, 0.0f}, //Qiraj Wasp - - {-8081.0f, 1514.0f, 2.61f, 0.0f}, //Qiraj Tank - {-8081.0f, 1520.0f, 2.61f, 0.0f}, //Qiraj Tank - {-8081.0f, 1526.0f, 2.61f, 0.0f}, //Qiraj Tank - {-8081.0f, 1512.0f, 2.61f, 0.0f}, //Qiraj Tank - {-8082.0f, 1520.0f, 2.61f, 0.0f}, //Qiraj Tank - {-8081.0f, 1528.0f, 2.61f, 0.0f}, //Qiraj Tank - - {-8082.0f, 1513.0f, 2.61f, 3.141592f}, //Anubisath Conqueror - {-8082.0f, 1520.0f, 2.61f, 3.141592f}, //Anubisath Conqueror - {-8082.0f, 1527.0f, 2.61f, 3.141592f}, //Anubisath Conqueror -}; - -struct WaveData -{ - uint8 SpawnCount, UsedSpawnPoint; - uint32 CreatureId, SpawnTimer, YellTimer, DespTimer; - int32 WaveTextId; -}; - -static WaveData WavesInfo[5] = -{ - {30, 0, 15423, 0, 0, 24000, 0}, // Kaldorei Soldier - { 3, 35, 15424, 0, 0, 24000, 0}, // Anubisath Conqueror - {12, 38, 15414, 0, 0, 24000, 0}, // Qiraji Wasps - { 6, 50, 15422, 0, 0, 24000, 0}, // Qiraji Tanks - {15, 15, 15423, 0, 0, 24000, 0} // Kaldorei Soldier - -}; - -struct SpawnSpells -{ - uint32 Timer1, Timer2, SpellId; -}; - -static SpawnSpells SpawnCast[4] = -{ - {100000, 2000, 33652}, // Stop Time - {38500, 300000, 28528}, // Poison Cloud - {58000, 300000, 35871}, // Frost Debuff (need correct spell) - {80950, 300000, 42075}, // Fire Explosion (need correct spell however this one looks cool) -}; -/*##### -# npc_anachronos_the_ancient -######*/ -class npc_anachronos_the_ancient : public CreatureScript -{ -public: - npc_anachronos_the_ancient() : CreatureScript("npc_anachronos_the_ancient") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_anachronos_the_ancientAI(creature); - } - - struct npc_anachronos_the_ancientAI : public ScriptedAI - { - npc_anachronos_the_ancientAI(Creature* creature) : ScriptedAI(creature) {} - - uint32 AnimationTimer; - uint8 AnimationCount; - - uint64 AnachronosQuestTriggerGUID; - uint64 MerithraGUID; - uint64 ArygosGUID; - uint64 CaelestraszGUID; - uint64 FandralGUID; - uint64 PlayerGUID; - bool eventEnd; - - void Reset() - { - AnimationTimer = 1500; - AnimationCount = 0; - AnachronosQuestTriggerGUID = 0; - MerithraGUID = 0; - ArygosGUID = 0; - CaelestraszGUID = 0; - FandralGUID = 0; - PlayerGUID = 0; - eventEnd = false; - - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - - void HandleAnimation() - { - Player* player = Unit::GetPlayer(*me, PlayerGUID); - if (!player) - return; - - Unit* Fandral = player->FindNearestCreature(C_FANDRAL_STAGHELM, 100.0f, me); - Unit* Arygos = player->FindNearestCreature(C_ARYGOS, 100.0f, me); - Unit* Caelestrasz = player->FindNearestCreature(C_CAELESTRASZ, 100.0f, me); - Unit* Merithra = player->FindNearestCreature(C_MERITHRA, 100.0f, me); - - if (!Fandral || !Arygos || !Caelestrasz || !Merithra) - return; - - Unit* mob = NULL; - AnimationTimer = EventAnim[AnimationCount].Timer; - if (eventEnd == false) - { - switch (AnimationCount) - { - case 0: - DoScriptText(ANACHRONOS_SAY_1, me, Fandral); - break; - case 1: - Fandral->SetTarget(me->GetGUID()); - DoScriptText(FANDRAL_SAY_1, Fandral, me); - break; - case 2: - Fandral->SetTarget(0); - DoScriptText(MERITHRA_EMOTE_1, Merithra); - break; - case 3: - DoScriptText(MERITHRA_SAY_1, Merithra); - break; - case 4: - DoScriptText(ARYGOS_EMOTE_1, Arygos); - break; - case 5: - Caelestrasz->SetTarget(Fandral->GetGUID()); - DoScriptText(CAELESTRASZ_SAY_1, Caelestrasz); - break; - case 6: - DoScriptText(MERITHRA_SAY_2, Merithra); - break; - case 7: - Caelestrasz->SetTarget(0); - Merithra->GetMotionMaster()->MoveCharge(-8065, 1530, 2.61f, 10); - break; - case 8: - DoScriptText(MERITHRA_YELL_1, Merithra); - break; - case 9: - Merithra->CastSpell(Merithra, 25105, true); - break; - case 10: - Merithra->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); - Merithra->SetDisableGravity(true); - Merithra->GetMotionMaster()->MoveCharge(-8065, 1530, 6.61f, 3); - break; - case 11: - Merithra->CastSpell(Merithra, 24818, false); - break; - case 12: - Merithra->GetMotionMaster()->MoveCharge(-8100, 1530, 50, 42); - break; - case 13: - break; - case 14: - DoScriptText(ARYGOS_SAY_1, Arygos); - Merithra->SetVisible(false); - break; - case 15: - Arygos->GetMotionMaster()->MoveCharge(-8065, 1530, 2.61f, 10); - Merithra->GetMotionMaster()->MoveCharge(-8034.535f, 1535.14f, 2.61f, 42); - break; - case 16: - DoScriptText(ARYGOS_YELL_1, Arygos); - break; - case 17: - Arygos->CastSpell(Arygos, 25107, true); - break; - case 18: - Arygos->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); - Arygos->SetDisableGravity(true); - Arygos->GetMotionMaster()->MoveCharge(-8065, 1530, 6.61f, 42); - break; - case 19: - Arygos->CastSpell(Arygos, 50505, false); - break; - case 20: - Arygos->GetMotionMaster()->MoveCharge(-8095, 1530, 50, 42); - break; - case 21: - break; - case 22: - DoScriptText(CAELESTRASZ_SAY_2, Caelestrasz, Fandral); - break; - case 23: - Caelestrasz->GetMotionMaster()->MoveCharge(-8065, 1530, 2.61f, 10); - Arygos->SetVisible(false); - Arygos->GetMotionMaster()->MoveCharge(-8034.535f, 1535.14f, 2.61f, 10); - break; - case 24: - DoScriptText(CAELESTRASZ_YELL_1, Caelestrasz); - break; - case 25: - Caelestrasz->CastSpell(Caelestrasz, 25106, true); - break; - case 26: - Caelestrasz->HandleEmoteCommand(254); - Caelestrasz->SetDisableGravity(true); - Caelestrasz->GetMotionMaster()->MoveCharge(-8065, 1530, 7.61f, 4); - break; - case 27: - Caelestrasz->CastSpell(Caelestrasz, 54293, false); - break; - case 28: - DoScriptText(ANACHRONOS_SAY_2, me, Fandral); - break; - case 29: - Caelestrasz->GetMotionMaster()->MoveCharge(-8095, 1530, 50, 42); - DoScriptText(FANDRAL_SAY_2, Fandral, me); - break; - case 30: - break; - case 31: - DoScriptText(ANACHRONOS_SAY_3, me, Fandral); - break; - case 32: - Caelestrasz->SetVisible(false); - Caelestrasz->GetMotionMaster()->MoveCharge(-8034.535f, 1535.14f, 2.61f, 42); - Fandral->GetMotionMaster()->MoveCharge(-8108, 1529, 2.77f, 8); - me->GetMotionMaster()->MoveCharge(-8113, 1525, 2.77f, 8); - break;//both run to the gate - case 33: - DoScriptText(ANACHRONOS_SAY_4, me); - Caelestrasz->GetMotionMaster()->MoveCharge(-8050, 1473, 65, 15); - break; //Text: sands will stop - case 34: - DoCast(player, 23017, true);//Arcane Channeling - break; - case 35: - me->CastSpell(-8088, 1520.43f, 2.67f, 25158, true); - break; - case 36: - DoCast(player, 25159, true); - break; - case 37: - me->SummonGameObject(GO_GATE_OF_AHN_QIRAJ, -8130, 1525, 17.5f, 0, 0, 0, 0, 0, 0); - break; - case 38: - DoCast(player, 25166, true); - me->SummonGameObject(GO_GLYPH_OF_AHN_QIRAJ, -8130, 1525, 17.5f, 0, 0, 0, 0, 0, 0); - break; - case 39: - DoScriptText(ANACHRONOS_SAY_5, me, Fandral); - break; - case 40: - Fandral->CastSpell(me, 25167, true); - break; - case 41: - Fandral->SummonGameObject(GO_ROOTS_OF_AHN_QIRAJ, -8130, 1525, 17.5f, 0, 0, 0, 0, 0, 0); - DoScriptText(FANDRAL_SAY_3, Fandral); - break; - case 42: - me->CastStop(); - DoScriptText(FANDRAL_EMOTE_1, Fandral); - break; - case 43: - Fandral->CastStop(); - break; - case 44: - DoScriptText(ANACHRONOS_SAY_6, me); - break; - case 45: - DoScriptText(ANACHRONOS_SAY_7, me); - break; - case 46: - DoScriptText(ANACHRONOS_SAY_8, me); - me->GetMotionMaster()->MoveCharge(-8110, 1527, 2.77f, 4); - break; - case 47: - DoScriptText(ANACHRONOS_EMOTE_1, me); - break; - case 48: - DoScriptText(FANDRAL_SAY_4, Fandral, me); - break; - case 49: - DoScriptText(FANDRAL_SAY_5, Fandral, me); - break; - case 50: - DoScriptText(FANDRAL_EMOTE_2, Fandral); - Fandral->CastSpell(-8127, 1525, 17.5f, 33806, true); - break; - case 51: - { - uint32 entries[4] = { 15423, 15424, 15414, 15422 }; - for (uint8 i = 0; i < 4; ++i) - { - mob = player->FindNearestCreature(entries[i], 50, me); - while (mob) - { - mob->RemoveFromWorld(); - mob = player->FindNearestCreature(15423, 50, me); - } - } - break; - } - case 52: - Fandral->GetMotionMaster()->MoveCharge(-8028.75f, 1538.795f, 2.61f, 4); - DoScriptText(ANACHRONOS_SAY_9, me, Fandral); - break; - case 53: - DoScriptText(FANDRAL_SAY_6, Fandral); - break; - case 54: - DoScriptText(ANACHRONOS_EMOTE_2, me); - break; - case 55: - Fandral->SetVisible(false); - break; - case 56: - DoScriptText(ANACHRONOS_EMOTE_3, me); - me->GetMotionMaster()->MoveCharge(-8116, 1522, 3.65f, 4); - break; - case 57: - me->GetMotionMaster()->MoveCharge(-8116.7f, 1527, 3.7f, 4); - break; - case 58: - me->GetMotionMaster()->MoveCharge(-8112.67f, 1529.9f, 2.86f, 4); - break; - case 59: - me->GetMotionMaster()->MoveCharge(-8117.99f, 1532.24f, 3.94f, 4); - break; - case 60: - if (player) - DoScriptText(ANACHRONOS_SAY_10, me, player); - me->GetMotionMaster()->MoveCharge(-8113.46f, 1524.16f, 2.89f, 4); - break; - case 61: - me->GetMotionMaster()->MoveCharge(-8057.1f, 1470.32f, 2.61f, 6); - if (player->IsInRange(me, 0, 15)) - player->GroupEventHappens(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD, me); - break; - case 62: - me->SetDisplayId(15500); - break; - case 63: - me->HandleEmoteCommand(254); - me->SetDisableGravity(true); - break; - case 64: - me->GetMotionMaster()->MoveCharge(-8000, 1400, 150, 9); - break; - case 65: - me->SetVisible(false); - if (Creature* AnachronosQuestTrigger = (Unit::GetCreature(*me, AnachronosQuestTriggerGUID))) - { - DoScriptText(ARYGOS_YELL_1, me); - AnachronosQuestTrigger->AI()->EnterEvadeMode(); - eventEnd=true; - } - break; - } - } - ++AnimationCount; - } - void UpdateAI(const uint32 diff) - { - if (AnimationTimer) - { - if (AnimationTimer <= diff) - HandleAnimation(); - else AnimationTimer -= diff; - } - if (AnimationCount < 65) - me->CombatStop(); - if (AnimationCount == 65 || eventEnd) - me->AI()->EnterEvadeMode(); - } - }; - -}; - -/*###### -# mob_qiraj_war_spawn -######*/ - -class mob_qiraj_war_spawn : public CreatureScript -{ -public: - mob_qiraj_war_spawn() : CreatureScript("mob_qiraj_war_spawn") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_qiraj_war_spawnAI(creature); - } - - struct mob_qiraj_war_spawnAI : public ScriptedAI - { - mob_qiraj_war_spawnAI(Creature* creature) : ScriptedAI(creature) {} - - uint64 MobGUID; - uint64 PlayerGUID; - uint32 SpellTimer1, SpellTimer2, SpellTimer3, SpellTimer4; - bool Timers; - bool hasTarget; - - void Reset() - { - MobGUID = 0; - PlayerGUID = 0; - Timers = false; - hasTarget = false; - } - - void EnterCombat(Unit* /*who*/) {} - void JustDied(Unit* /*slayer*/); - - void UpdateAI(const uint32 diff) - { - Unit* target = NULL; - //Player* player = me->GetPlayer(PlayerGUID); - - if (!Timers) - { - if (me->GetEntry() == 15424 || me->GetEntry() == 15422 || me->GetEntry() == 15414) //all but Kaldorei Soldiers - { - SpellTimer1 = SpawnCast[1].Timer1; - SpellTimer2 = SpawnCast[2].Timer1; - SpellTimer3 = SpawnCast[3].Timer1; - } - if (me->GetEntry() == 15423 || me->GetEntry() == 15424 || me->GetEntry() == 15422 || me->GetEntry() == 15414) - SpellTimer4 = SpawnCast[0].Timer1; - Timers = true; - } - if (me->GetEntry() == 15424 || me->GetEntry() == 15422|| me->GetEntry() == 15414) - { - if (SpellTimer1 <= diff) - { - DoCast(me, SpawnCast[1].SpellId); - DoCast(me, 24319); - SpellTimer1 = SpawnCast[1].Timer2; - } else SpellTimer1 -= diff; - if (SpellTimer2 <= diff) - { - DoCast(me, SpawnCast[2].SpellId); - SpellTimer2 = SpawnCast[2].Timer2; - } else SpellTimer2 -= diff; - if (SpellTimer3 <= diff) - { - DoCast(me, SpawnCast[3].SpellId); - SpellTimer3 = SpawnCast[3].Timer2; - } else SpellTimer3 -= diff; - } - if (me->GetEntry() == 15423 || me->GetEntry() == 15424 || me->GetEntry() == 15422 || me->GetEntry() == 15414) - { - if (SpellTimer4 <= diff) - { - me->RemoveAllAttackers(); - me->AttackStop(); - DoCast(me, 15533); - SpellTimer4 = SpawnCast[0].Timer2; - } else SpellTimer4 -= diff; - } - if (!hasTarget) - { - if (me->GetEntry() == 15424 || me->GetEntry() == 15422 || me->GetEntry() == 15414) - target = me->FindNearestCreature(15423, 20, true); - if (me->GetEntry() == 15423) - { - uint8 tar = urand(0, 2); - - if (tar == 0) - target = me->FindNearestCreature(15422, 20, true); - else if (tar == 1) - target = me->FindNearestCreature(15424, 20, true); - else if (tar == 2) - target = me->FindNearestCreature(15414, 20, true); - } - hasTarget = true; - if (target) - me->AI()->AttackStart(target); - } - if (!(me->FindNearestCreature(15379, 60))) - DoCast(me, 33652); - - if (!UpdateVictim()) - { - hasTarget = false; - return; - } - - DoMeleeAttackIfReady(); - } - }; - -}; - -/*##### -# npc_anachronos_quest_trigger -#####*/ - -class npc_anachronos_quest_trigger : public CreatureScript -{ -public: - npc_anachronos_quest_trigger() : CreatureScript("npc_anachronos_quest_trigger") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_anachronos_quest_triggerAI(creature); - } - - struct npc_anachronos_quest_triggerAI : public ScriptedAI - { - npc_anachronos_quest_triggerAI(Creature* creature) : ScriptedAI(creature) {} - - uint64 PlayerGUID; - - uint32 WaveTimer; - uint32 AnnounceTimer; - - int8 LiveCount; - uint8 WaveCount; - - bool EventStarted; - bool Announced; - bool Failed; - - void Reset() - { - PlayerGUID = 0; - - WaveTimer = 2000; - AnnounceTimer = 1000; - LiveCount = 0; - WaveCount = 0; - - EventStarted = false; - Announced = false; - Failed = false; - - me->SetVisible(false); - } - - void SummonNextWave() - { - uint8 locIndex = WavesInfo[WaveCount].UsedSpawnPoint; - uint8 count = locIndex + WavesInfo[WaveCount].SpawnCount; - - for (uint8 i = locIndex; i <= count; ++i) - { - uint32 desptimer = WavesInfo[WaveCount].DespTimer; - - if (Creature* spawn = me->SummonCreature(WavesInfo[WaveCount].CreatureId, SpawnLocation[i], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, desptimer)) - { - if (spawn->GetEntry() == 15423) - spawn->SetUInt32Value(UNIT_FIELD_DISPLAYID, 15427+rand()%4); - if (i >= 30) WaveCount = 1; - if (i >= 33) WaveCount = 2; - if (i >= 45) WaveCount = 3; - if (i >= 51) WaveCount = 4; - - if (WaveCount < 5) //1-4 Wave - { - if (mob_qiraj_war_spawn::mob_qiraj_war_spawnAI* spawnAI = CAST_AI(mob_qiraj_war_spawn::mob_qiraj_war_spawnAI, spawn->AI())) - { - spawnAI->MobGUID = me->GetGUID(); - spawnAI->PlayerGUID = PlayerGUID; - } - } - } - } - - WaveTimer = WavesInfo[WaveCount].SpawnTimer; - AnnounceTimer = WavesInfo[WaveCount].YellTimer; - } - - void CheckEventFail() - { - Player* player = Unit::GetPlayer(*me, PlayerGUID); - - if (!player) - return; - - if (Group* EventGroup = player->GetGroup()) - { - Player* groupMember; - - uint8 GroupMemberCount = 0; - uint8 DeadMemberCount = 0; - uint8 FailedMemberCount = 0; - - Group::MemberSlotList const members = EventGroup->GetMemberSlots(); - - for (Group::member_citerator itr = members.begin(); itr!= members.end(); ++itr) - { - groupMember = (Unit::GetPlayer(*me, itr->guid)); - if (!groupMember) - continue; - if (!groupMember->IsWithinDistInMap(me, EVENT_AREA_RADIUS) && groupMember->GetQuestStatus(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD) == QUEST_STATUS_INCOMPLETE) - { - groupMember->FailQuest(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD); - ++FailedMemberCount; - } - ++GroupMemberCount; - - if (groupMember->isDead()) - ++DeadMemberCount; - } - - if (GroupMemberCount == FailedMemberCount || !player->IsWithinDistInMap(me, EVENT_AREA_RADIUS)) - Failed = true; //only so event can restart - } - } - - void LiveCounter() - { - --LiveCount; - if (!LiveCount) - Announced = false; - } - - void UpdateAI(const uint32 diff) - { - if (!PlayerGUID || !EventStarted) - return; - - if (WaveCount < 4) - { - if (!Announced && AnnounceTimer <= diff) - { - DoScriptText(WavesInfo[WaveCount].WaveTextId, me); - Announced = true; - } else AnnounceTimer -= diff; - - if (WaveTimer <= diff) - SummonNextWave(); - else WaveTimer -= diff; - } - CheckEventFail(); - if (WaveCount == 4 || Failed) - EnterEvadeMode(); - }; - }; - -}; - -void mob_qiraj_war_spawn::mob_qiraj_war_spawnAI::JustDied(Unit* /*slayer*/) -{ - me->RemoveCorpse(); - - if (!MobGUID) - return; - - if (Creature* mob = Unit::GetCreature(*me, MobGUID)) - if (npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI* triggerAI = CAST_AI(npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI, mob->AI())) - triggerAI->LiveCounter(); - -}; - -/*##### -# go_crystalline_tear -######*/ - -class go_crystalline_tear : public GameObjectScript -{ -public: - go_crystalline_tear() : GameObjectScript("go_crystalline_tear") { } - - bool OnQuestAccept(Player* player, GameObject* go, Quest const* quest) - { - if (quest->GetQuestId() == QUEST_A_PAWN_ON_THE_ETERNAL_BOARD) - { - if (Creature* trigger = go->FindNearestCreature(15454, 100, player)) - { - Unit* Merithra = trigger->SummonCreature(15378, -8034.535f, 1535.14f, 2.61f, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000); - Unit* Caelestrasz = trigger->SummonCreature(15379, -8032.767f, 1533.148f, 2.61f, 1.5f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000); - Unit* Arygos = trigger->SummonCreature(15380, -8034.52f, 1537.843f, 2.61f, 5.7f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000); - /* Unit* Fandral = */ trigger->SummonCreature(15382, -8028.462f, 1535.843f, 2.61f, 3.141592f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000); - Creature* Anachronos = trigger->SummonCreature(15381, -8028.75f, 1538.795f, 2.61f, 4, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000); - - if (Merithra) - { - Merithra->SetUInt32Value(UNIT_NPC_FLAGS, 0); - Merithra->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - Merithra->SetUInt32Value(UNIT_FIELD_DISPLAYID, 15420); - Merithra->setFaction(35); - } - - if (Caelestrasz) - { - Caelestrasz->SetUInt32Value(UNIT_NPC_FLAGS, 0); - Caelestrasz->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - Caelestrasz->SetUInt32Value(UNIT_FIELD_DISPLAYID, 15419); - Caelestrasz->setFaction(35); - } - - if (Arygos) - { - Arygos->SetUInt32Value(UNIT_NPC_FLAGS, 0); - Arygos->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - Arygos->SetUInt32Value(UNIT_FIELD_DISPLAYID, 15418); - Arygos->setFaction(35); - } - - if (Anachronos) - { - if (npc_anachronos_the_ancient::npc_anachronos_the_ancientAI* anachronosAI = CAST_AI(npc_anachronos_the_ancient::npc_anachronos_the_ancientAI, Anachronos->AI())) - anachronosAI->PlayerGUID = player->GetGUID(); - - if (npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI* triggerAI = CAST_AI(npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI, trigger->AI())) - { - triggerAI->Failed = false; - triggerAI->PlayerGUID = player->GetGUID(); - triggerAI->EventStarted = true; - triggerAI->Announced = true; - } - } - } - } - return true; - } - -}; /*### ## go_wind_stone @@ -1506,10 +582,6 @@ class go_wind_stone : public GameObjectScript void AddSC_silithus() { - new go_crystalline_tear(); - new npc_anachronos_quest_trigger(); - new npc_anachronos_the_ancient(); - new mob_qiraj_war_spawn(); new npc_highlord_demitrian(); new npcs_rutgar_and_frankal(); new go_wind_stone(); diff --git a/src/server/scripts/Kalimdor/stonetalon_mountains.cpp b/src/server/scripts/Kalimdor/stonetalon_mountains.cpp index d38395c7b37..2ac9903aa18 100644 --- a/src/server/scripts/Kalimdor/stonetalon_mountains.cpp +++ b/src/server/scripts/Kalimdor/stonetalon_mountains.cpp @@ -18,14 +18,12 @@ /* ScriptData SDName: Stonetalon_Mountains -SD%Complete: 95 -SDComment: Quest support: 6627, 6523 +SD%Complete: 0 +SDComment: Quest support: SDCategory: Stonetalon Mountains EndScriptData */ /* ContentData -npc_braug_dimspirit -npc_kaya_flathoof EndContentData */ #include "ScriptMgr.h" @@ -33,146 +31,6 @@ EndContentData */ #include "ScriptedGossip.h" #include "ScriptedEscortAI.h" -/*###### -## npc_braug_dimspirit -######*/ - -#define GOSSIP_HBD1 "Ysera" -#define GOSSIP_HBD2 "Neltharion" -#define GOSSIP_HBD3 "Nozdormu" -#define GOSSIP_HBD4 "Alexstrasza" -#define GOSSIP_HBD5 "Malygos" - -class npc_braug_dimspirit : public CreatureScript -{ -public: - npc_braug_dimspirit() : CreatureScript("npc_braug_dimspirit") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_INFO_DEF+1) - { - player->CLOSE_GOSSIP_MENU(); - creature->CastSpell(player, 6766, false); - - } - if (action == GOSSIP_ACTION_INFO_DEF+2) - { - player->CLOSE_GOSSIP_MENU(); - player->AreaExploredOrEventHappens(6627); - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(6627) == QUEST_STATUS_INCOMPLETE) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HBD1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HBD2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HBD3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HBD4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HBD5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - player->SEND_GOSSIP_MENU(5820, creature->GetGUID()); - } - else - player->SEND_GOSSIP_MENU(5819, creature->GetGUID()); - - return true; - } - -}; - -/*###### -## npc_kaya_flathoof -######*/ - -enum Kaya -{ - FACTION_ESCORTEE_H = 775, - - NPC_GRIMTOTEM_RUFFIAN = 11910, - NPC_GRIMTOTEM_BRUTE = 11912, - NPC_GRIMTOTEM_SORCERER = 11913, - - SAY_START = -1000357, - SAY_AMBUSH = -1000358, - SAY_END = -1000359, - - QUEST_PROTECT_KAYA = 6523 -}; - -class npc_kaya_flathoof : public CreatureScript -{ -public: - npc_kaya_flathoof() : CreatureScript("npc_kaya_flathoof") { } - - struct npc_kaya_flathoofAI : public npc_escortAI - { - npc_kaya_flathoofAI(Creature* creature) : npc_escortAI(creature) {} - - void WaypointReached(uint32 waypointId) - { - Player* player = GetPlayerForEscort(); - if (!player) - return; - - switch (waypointId) - { - case 16: - DoScriptText(SAY_AMBUSH, me); - me->SummonCreature(NPC_GRIMTOTEM_BRUTE, -48.53f, -503.34f, -46.31f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - me->SummonCreature(NPC_GRIMTOTEM_RUFFIAN, -38.85f, -503.77f, -45.90f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - me->SummonCreature(NPC_GRIMTOTEM_SORCERER, -36.37f, -496.23f, -45.71f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - break; - case 18: - me->SetInFront(player); - DoScriptText(SAY_END, me, player); - player->GroupEventHappens(QUEST_PROTECT_KAYA, me); - break; - } - } - - void JustSummoned(Creature* summoned) - { - summoned->AI()->AttackStart(me); - } - - void Reset(){} - }; - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - if (quest->GetQuestId() == QUEST_PROTECT_KAYA) - { - if (npc_escortAI* pEscortAI = CAST_AI(npc_kaya_flathoof::npc_kaya_flathoofAI, creature->AI())) - pEscortAI->Start(true, false, player->GetGUID()); - - DoScriptText(SAY_START, creature); - creature->setFaction(113); - creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); - } - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_kaya_flathoofAI(creature); - } - -}; - -/*###### -## AddSC -######*/ - void AddSC_stonetalon_mountains() { - new npc_braug_dimspirit(); - new npc_kaya_flathoof(); } diff --git a/src/server/scripts/Kalimdor/tanaris.cpp b/src/server/scripts/Kalimdor/tanaris.cpp index 9b742b495bb..45fbb15e582 100644 --- a/src/server/scripts/Kalimdor/tanaris.cpp +++ b/src/server/scripts/Kalimdor/tanaris.cpp @@ -19,18 +19,14 @@ /* ScriptData SDName: Tanaris SD%Complete: 80 -SDComment: Quest support: 648, 1560, 2954, 4005, 10277, 10279(Special flight path). Noggenfogger vendor +SDComment: Quest support: 648, 10277, 10279(Special flight path). SDCategory: Tanaris EndScriptData */ /* ContentData -mob_aquementas npc_custodian_of_time -npc_marin_noggenfogger npc_steward_of_time -npc_stone_watcher_of_norgannon npc_OOX17 -npc_tooga EndContentData */ #include "ScriptMgr.h" @@ -39,111 +35,6 @@ EndContentData */ #include "ScriptedEscortAI.h" #include "ScriptedFollowerAI.h" -/*###### -## mob_aquementas -######*/ - -enum Aquementas -{ - AGGRO_YELL_AQUE = -1000350, - - SPELL_AQUA_JET = 13586, - SPELL_FROST_SHOCK = 15089 -}; - -class mob_aquementas : public CreatureScript -{ -public: - mob_aquementas() : CreatureScript("mob_aquementas") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_aquementasAI (creature); - } - - struct mob_aquementasAI : public ScriptedAI - { - mob_aquementasAI(Creature* creature) : ScriptedAI(creature) {} - - uint32 SendItemTimer; - uint32 SwitchFactionTimer; - bool isFriendly; - - uint32 FrostShockTimer; - uint32 AquaJetTimer; - - void Reset() - { - SendItemTimer = 0; - SwitchFactionTimer = 10000; - me->setFaction(35); - isFriendly = true; - - AquaJetTimer = 5000; - FrostShockTimer = 1000; - } - - void SendItem(Unit* receiver) - { - if (CAST_PLR(receiver)->HasItemCount(11169, 1, false) && - CAST_PLR(receiver)->HasItemCount(11172, 11, false) && - CAST_PLR(receiver)->HasItemCount(11173, 1, false) && - !CAST_PLR(receiver)->HasItemCount(11522, 1, true)) - { - ItemPosCountVec dest; - uint8 msg = CAST_PLR(receiver)->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 11522, 1, NULL); - if (msg == EQUIP_ERR_OK) - CAST_PLR(receiver)->StoreNewItem(dest, 11522, 1, true); - } - } - - void EnterCombat(Unit* who) - { - DoScriptText(AGGRO_YELL_AQUE, me, who); - } - - void UpdateAI(const uint32 diff) - { - if (isFriendly) - { - if (SwitchFactionTimer <= diff) - { - me->setFaction(91); - isFriendly = false; - } else SwitchFactionTimer -= diff; - } - - if (!UpdateVictim()) - return; - - if (!isFriendly) - { - if (SendItemTimer <= diff) - { - if (me->getVictim()->GetTypeId() == TYPEID_PLAYER) - SendItem(me->getVictim()); - SendItemTimer = 5000; - } else SendItemTimer -= diff; - } - - if (FrostShockTimer <= diff) - { - DoCast(me->getVictim(), SPELL_FROST_SHOCK); - FrostShockTimer = 15000; - } else FrostShockTimer -= diff; - - if (AquaJetTimer <= diff) - { - DoCast(me, SPELL_AQUA_JET); - AquaJetTimer = 15000; - } else AquaJetTimer -= diff; - - DoMeleeAttackIfReady(); - } - }; - -}; - /*###### ## npc_custodian_of_time ######*/ @@ -276,39 +167,6 @@ public: }; -/*###### -## npc_marin_noggenfogger -######*/ - -class npc_marin_noggenfogger : public CreatureScript -{ -public: - npc_marin_noggenfogger() : CreatureScript("npc_marin_noggenfogger") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_TRADE) - player->GetSession()->SendListInventory(creature->GetGUID()); - - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (creature->isVendor() && player->GetQuestRewardStatus(2662)) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - - return true; - } - -}; - /*###### ## npc_steward_of_time ######*/ @@ -355,70 +213,6 @@ public: }; -/*###### -## npc_stone_watcher_of_norgannon -######*/ - -#define GOSSIP_ITEM_NORGANNON_1 "What function do you serve?" -#define GOSSIP_ITEM_NORGANNON_2 "What are the Plates of Uldum?" -#define GOSSIP_ITEM_NORGANNON_3 "Where are the Plates of Uldum?" -#define GOSSIP_ITEM_NORGANNON_4 "Excuse me? We've been \"reschedueled for visitations\"? What does that mean?!" -#define GOSSIP_ITEM_NORGANNON_5 "So, what's inside Uldum?" -#define GOSSIP_ITEM_NORGANNON_6 "I will return when i have the Plates of Uldum." - -class npc_stone_watcher_of_norgannon : public CreatureScript -{ -public: - npc_stone_watcher_of_norgannon() : CreatureScript("npc_stone_watcher_of_norgannon") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - switch (action) - { - case GOSSIP_ACTION_INFO_DEF: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - player->SEND_GOSSIP_MENU(1675, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+1: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - player->SEND_GOSSIP_MENU(1676, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); - player->SEND_GOSSIP_MENU(1677, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); - player->SEND_GOSSIP_MENU(1678, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); - player->SEND_GOSSIP_MENU(1679, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+5: - player->CLOSE_GOSSIP_MENU(); - player->AreaExploredOrEventHappens(2954); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(2954) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - player->SEND_GOSSIP_MENU(1674, creature->GetGUID()); - - return true; - } - -}; - /*###### ## npc_OOX17 ######*/ @@ -511,176 +305,9 @@ public: }; }; -/*#### -# npc_tooga -####*/ - -enum Tooga -{ - SAY_TOOG_THIRST = -1000391, - SAY_TOOG_WORRIED = -1000392, - SAY_TOOG_POST_1 = -1000393, - SAY_TORT_POST_2 = -1000394, - SAY_TOOG_POST_3 = -1000395, - SAY_TORT_POST_4 = -1000396, - SAY_TOOG_POST_5 = -1000397, - SAY_TORT_POST_6 = -1000398, - - QUEST_TOOGA = 1560, - NPC_TORTA = 6015, - - POINT_ID_TO_WATER = 1, - FACTION_TOOG_ESCORTEE = 113 -}; - -Position const ToWaterLoc = {-7032.664551f, -4906.199219f, -1.606446f, 0.0f}; - -class npc_tooga : public CreatureScript -{ -public: - npc_tooga() : CreatureScript("npc_tooga") { } - - bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) - { - if (quest->GetQuestId() == QUEST_TOOGA) - { - if (npc_toogaAI* pToogaAI = CAST_AI(npc_tooga::npc_toogaAI, creature->AI())) - pToogaAI->StartFollow(player, FACTION_TOOG_ESCORTEE, quest); - } - - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_toogaAI(creature); - } - - struct npc_toogaAI : public FollowerAI - { - npc_toogaAI(Creature* creature) : FollowerAI(creature) { } - - uint32 CheckSpeechTimer; - uint32 PostEventTimer; - uint32 PhasePostEvent; - - uint64 TortaGUID; - - void Reset() - { - CheckSpeechTimer = 2500; - PostEventTimer = 1000; - PhasePostEvent = 0; - - TortaGUID = 0; - } - - void MoveInLineOfSight(Unit* who) - { - FollowerAI::MoveInLineOfSight(who); - - if (!me->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE | STATE_FOLLOW_POSTEVENT) && who->GetEntry() == NPC_TORTA) - { - if (me->IsWithinDistInMap(who, INTERACTION_DISTANCE)) - { - Player* player = GetLeaderForFollower(); - if (player && player->GetQuestStatus(QUEST_TOOGA) == QUEST_STATUS_INCOMPLETE) - player->GroupEventHappens(QUEST_TOOGA, me); - - TortaGUID = who->GetGUID(); - SetFollowComplete(true); - } - } - } - - void MovementInform(uint32 MotionType, uint32 PointId) - { - FollowerAI::MovementInform(MotionType, PointId); - - if (MotionType != POINT_MOTION_TYPE) - return; - - if (PointId == POINT_ID_TO_WATER) - SetFollowComplete(); - } - - void UpdateFollowerAI(const uint32 Diff) - { - if (!UpdateVictim()) - { - //we are doing the post-event, or... - if (HasFollowState(STATE_FOLLOW_POSTEVENT)) - { - if (PostEventTimer <= Diff) - { - PostEventTimer = 5000; - - Unit* pTorta = Unit::GetUnit(*me, TortaGUID); - if (!pTorta || !pTorta->isAlive()) - { - //something happened, so just complete - SetFollowComplete(); - return; - } - - switch (PhasePostEvent) - { - case 1: - DoScriptText(SAY_TOOG_POST_1, me); - break; - case 2: - DoScriptText(SAY_TORT_POST_2, pTorta); - break; - case 3: - DoScriptText(SAY_TOOG_POST_3, me); - break; - case 4: - DoScriptText(SAY_TORT_POST_4, pTorta); - break; - case 5: - DoScriptText(SAY_TOOG_POST_5, me); - break; - case 6: - DoScriptText(SAY_TORT_POST_6, pTorta); - me->GetMotionMaster()->MovePoint(POINT_ID_TO_WATER, ToWaterLoc); - break; - } - - ++PhasePostEvent; - } - else - PostEventTimer -= Diff; - } - //...we are doing regular speech check - else if (HasFollowState(STATE_FOLLOW_INPROGRESS)) - { - if (CheckSpeechTimer <= Diff) - { - CheckSpeechTimer = 5000; - - if (urand(0, 9) > 8) - DoScriptText(RAND(SAY_TOOG_THIRST, SAY_TOOG_WORRIED), me); - } - else - CheckSpeechTimer -= Diff; - } - - return; - } - - DoMeleeAttackIfReady(); - } - }; - -}; - void AddSC_tanaris() { - new mob_aquementas(); new npc_custodian_of_time(); - new npc_marin_noggenfogger(); new npc_steward_of_time(); - new npc_stone_watcher_of_norgannon(); new npc_OOX17(); - new npc_tooga(); } diff --git a/src/server/scripts/Kalimdor/the_barrens.cpp b/src/server/scripts/Kalimdor/the_barrens.cpp index f4983558b67..5b13fe9591f 100644 --- a/src/server/scripts/Kalimdor/the_barrens.cpp +++ b/src/server/scripts/Kalimdor/the_barrens.cpp @@ -19,16 +19,11 @@ /* ScriptData SDName: The_Barrens SD%Complete: 90 -SDComment: Quest support: 863, 898, 1719, 2458, 4921, 6981, +SDComment: Quest support: 863 SDCategory: Barrens EndScriptData */ /* ContentData -npc_beaten_corpse -npc_gilthares -npc_sputtervalve -npc_taskmaster_fizzule -npc_twiggy_flathead npc_wizzlecrank_shredder EndContentData */ @@ -37,491 +32,6 @@ EndContentData */ #include "ScriptedGossip.h" #include "ScriptedEscortAI.h" -/*###### -## npc_beaten_corpse -######*/ - -#define GOSSIP_CORPSE "Examine corpse in detail..." - -enum BeatenCorpse -{ - QUEST_LOST_IN_BATTLE = 4921 -}; - -class npc_beaten_corpse : public CreatureScript -{ -public: - npc_beaten_corpse() : CreatureScript("npc_beaten_corpse") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_INFO_DEF +1) - { - player->SEND_GOSSIP_MENU(3558, creature->GetGUID()); - player->TalkedToCreature(creature->GetEntry(), creature->GetGUID()); - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (player->GetQuestStatus(QUEST_LOST_IN_BATTLE) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(QUEST_LOST_IN_BATTLE) == QUEST_STATUS_COMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_CORPSE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - player->SEND_GOSSIP_MENU(3557, creature->GetGUID()); - return true; - } - -}; - -/*###### -# npc_gilthares -######*/ - -enum Gilthares -{ - SAY_GIL_START = -1000370, - SAY_GIL_AT_LAST = -1000371, - SAY_GIL_PROCEED = -1000372, - SAY_GIL_FREEBOOTERS = -1000373, - SAY_GIL_AGGRO_1 = -1000374, - SAY_GIL_AGGRO_2 = -1000375, - SAY_GIL_AGGRO_3 = -1000376, - SAY_GIL_AGGRO_4 = -1000377, - SAY_GIL_ALMOST = -1000378, - SAY_GIL_SWEET = -1000379, - SAY_GIL_FREED = -1000380, - - QUEST_FREE_FROM_HOLD = 898, - AREA_MERCHANT_COAST = 391, - FACTION_ESCORTEE = 232 //guessed, possible not needed for this quest -}; - -class npc_gilthares : public CreatureScript -{ -public: - npc_gilthares() : CreatureScript("npc_gilthares") { } - - bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) - { - if (quest->GetQuestId() == QUEST_FREE_FROM_HOLD) - { - creature->setFaction(FACTION_ESCORTEE); - creature->SetStandState(UNIT_STAND_STATE_STAND); - - DoScriptText(SAY_GIL_START, creature, player); - - if (npc_giltharesAI* pEscortAI = CAST_AI(npc_gilthares::npc_giltharesAI, creature->AI())) - pEscortAI->Start(false, false, player->GetGUID(), quest); - } - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_giltharesAI(creature); - } - - struct npc_giltharesAI : public npc_escortAI - { - npc_giltharesAI(Creature* creature) : npc_escortAI(creature) { } - - void Reset() { } - - void WaypointReached(uint32 waypointId) - { - Player* player = GetPlayerForEscort(); - if (!player) - return; - - switch (waypointId) - { - case 16: - DoScriptText(SAY_GIL_AT_LAST, me, player); - break; - case 17: - DoScriptText(SAY_GIL_PROCEED, me, player); - break; - case 18: - DoScriptText(SAY_GIL_FREEBOOTERS, me, player); - break; - case 37: - DoScriptText(SAY_GIL_ALMOST, me, player); - break; - case 47: - DoScriptText(SAY_GIL_SWEET, me, player); - break; - case 53: - DoScriptText(SAY_GIL_FREED, me, player); - player->GroupEventHappens(QUEST_FREE_FROM_HOLD, me); - break; - } - } - - void EnterCombat(Unit* who) - { - //not always use - if (rand()%4) - return; - - //only aggro text if not player and only in this area - if (who->GetTypeId() != TYPEID_PLAYER && me->GetAreaId() == AREA_MERCHANT_COAST) - { - //appears to be pretty much random (possible only if escorter not in combat with who yet?) - DoScriptText(RAND(SAY_GIL_AGGRO_1, SAY_GIL_AGGRO_2, SAY_GIL_AGGRO_3, SAY_GIL_AGGRO_4), me, who); - } - } - }; - -}; - -/*###### -## npc_sputtervalve -######*/ - -#define GOSSIP_SPUTTERVALVE "Can you tell me about this shard?" - -class npc_sputtervalve : public CreatureScript -{ -public: - npc_sputtervalve() : CreatureScript("npc_sputtervalve") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_INFO_DEF) - { - player->SEND_GOSSIP_MENU(2013, creature->GetGUID()); - player->AreaExploredOrEventHappens(6981); - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(6981) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SPUTTERVALVE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - return true; - } - -}; - -/*###### -## npc_taskmaster_fizzule -######*/ - -enum TaskmasterFizzule -{ - FACTION_FRIENDLY_F = 35, - SPELL_FLARE = 10113, - SPELL_FOLLY = 10137, -}; - -class npc_taskmaster_fizzule : public CreatureScript -{ -public: - npc_taskmaster_fizzule() : CreatureScript("npc_taskmaster_fizzule") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_taskmaster_fizzuleAI(creature); - } - - struct npc_taskmaster_fizzuleAI : public ScriptedAI - { - npc_taskmaster_fizzuleAI(Creature* creature) : ScriptedAI(creature) - { - factionNorm = creature->getFaction(); - } - - uint32 factionNorm; - bool IsFriend; - uint32 ResetTimer; - uint8 FlareCount; - - void Reset() - { - IsFriend = false; - ResetTimer = 120000; - FlareCount = 0; - me->setFaction(factionNorm); - } - - void DoFriend() - { - me->RemoveAllAuras(); - me->DeleteThreatList(); - me->CombatStop(true); - - me->StopMoving(); - me->GetMotionMaster()->MoveIdle(); - - me->setFaction(FACTION_FRIENDLY_F); - me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); - } - - void SpellHit(Unit* /*caster*/, const SpellInfo* spell) - { - if (spell->Id == SPELL_FLARE || spell->Id == SPELL_FOLLY) - { - ++FlareCount; - - if (FlareCount >= 2) - IsFriend = true; - } - } - - void EnterCombat(Unit* /*who*/) {} - - void UpdateAI(const uint32 diff) - { - if (IsFriend) - { - if (ResetTimer <= diff) - { - EnterEvadeMode(); - return; - } else ResetTimer -= diff; - } - - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - - void ReceiveEmote(Player* /*player*/, uint32 emote) - { - if (emote == TEXT_EMOTE_SALUTE) - { - if (FlareCount >= 2) - { - if (me->getFaction() == FACTION_FRIENDLY_F) - return; - - DoFriend(); - } - } - } - }; - -}; - -/*##### -## npc_twiggy_flathead -#####*/ - -enum TwiggyFlathead -{ - NPC_BIG_WILL = 6238, - NPC_AFFRAY_CHALLENGER = 6240, - - SAY_BIG_WILL_READY = -1000123, - SAY_TWIGGY_FLATHEAD_BEGIN = -1000124, - SAY_TWIGGY_FLATHEAD_FRAY = -1000125, - SAY_TWIGGY_FLATHEAD_DOWN = -1000126, - SAY_TWIGGY_FLATHEAD_OVER = -1000127, -}; - -Position const AffrayChallengerLoc[6] = -{ - {-1683.0f, -4326.0f, 2.79f, 0.0f}, - {-1682.0f, -4329.0f, 2.79f, 0.0f}, - {-1683.0f, -4330.0f, 2.79f, 0.0f}, - {-1680.0f, -4334.0f, 2.79f, 1.49f}, - {-1674.0f, -4326.0f, 2.79f, 3.49f}, - {-1677.0f, -4334.0f, 2.79f, 1.66f} -}; - -class npc_twiggy_flathead : public CreatureScript -{ -public: - npc_twiggy_flathead() : CreatureScript("npc_twiggy_flathead") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_twiggy_flatheadAI (creature); - } - - struct npc_twiggy_flatheadAI : public ScriptedAI - { - npc_twiggy_flatheadAI(Creature* creature) : ScriptedAI(creature) {} - - bool EventInProgress; - bool EventGrate; - bool EventBigWill; - bool ChallengerDown[6]; - uint8 Wave; - uint32 WaveTimer; - uint32 ChallengerChecker; - uint64 PlayerGUID; - uint64 AffrayChallenger[6]; - uint64 BigWill; - - void Reset() - { - EventInProgress = false; - EventGrate = false; - EventBigWill = false; - WaveTimer = 600000; - ChallengerChecker = 0; - Wave = 0; - PlayerGUID = 0; - - for (uint8 i = 0; i < 6; ++i) - { - AffrayChallenger[i] = 0; - ChallengerDown[i] = false; - } - BigWill = 0; - } - - void EnterCombat(Unit* /*who*/) { } - - void MoveInLineOfSight(Unit* who) - { - if (!who || (!who->isAlive())) - return; - - if (me->IsWithinDistInMap(who, 10.0f) && (who->GetTypeId() == TYPEID_PLAYER) && CAST_PLR(who)->GetQuestStatus(1719) == QUEST_STATUS_INCOMPLETE && !EventInProgress) - { - PlayerGUID = who->GetGUID(); - EventInProgress = true; - } - } - - void KilledUnit(Unit* /*victim*/) { } - - void UpdateAI(const uint32 diff) - { - if (EventInProgress) { - Player* pWarrior = NULL; - - if (PlayerGUID) - pWarrior = Unit::GetPlayer(*me, PlayerGUID); - - if (!pWarrior) - return; - - if (!pWarrior->isAlive() && pWarrior->GetQuestStatus(1719) == QUEST_STATUS_INCOMPLETE) { - DoScriptText(SAY_TWIGGY_FLATHEAD_DOWN, me); - pWarrior->FailQuest(1719); - - for (uint8 i = 0; i < 6; ++i) // unsummon challengers - { - if (AffrayChallenger[i]) - { - Creature* creature = Unit::GetCreature((*me), AffrayChallenger[i]); - if (creature && creature->isAlive()) - creature->DisappearAndDie(); - } - } - - if (BigWill) // unsummon bigWill - { - Creature* creature = Unit::GetCreature((*me), BigWill); - if (creature && creature->isAlive()) - creature->DisappearAndDie(); - } - Reset(); - } - - if (!EventGrate && EventInProgress) - { - float x, y, z; - pWarrior->GetPosition(x, y, z); - - if (x >= -1684 && x <= -1674 && y >= -4334 && y <= -4324) { - pWarrior->AreaExploredOrEventHappens(1719); - DoScriptText(SAY_TWIGGY_FLATHEAD_BEGIN, me, pWarrior); - - for (uint8 i = 0; i < 6; ++i) - { - Creature* creature = me->SummonCreature(NPC_AFFRAY_CHALLENGER, AffrayChallengerLoc[i], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); - if (!creature) - continue; - creature->setFaction(35); - creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - creature->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); - AffrayChallenger[i] = creature->GetGUID(); - } - WaveTimer = 5000; - ChallengerChecker = 1000; - EventGrate = true; - } - } - else if (EventInProgress) - { - if (ChallengerChecker <= diff) - { - for (uint8 i = 0; i < 6; ++i) - { - if (AffrayChallenger[i]) - { - Creature* creature = Unit::GetCreature((*me), AffrayChallenger[i]); - if ((!creature || (!creature->isAlive())) && !ChallengerDown[i]) - { - DoScriptText(SAY_TWIGGY_FLATHEAD_DOWN, me); - ChallengerDown[i] = true; - } - } - } - ChallengerChecker = 1000; - } else ChallengerChecker -= diff; - - if (WaveTimer <= diff) - { - if (Wave < 6 && AffrayChallenger[Wave] && !EventBigWill) - { - DoScriptText(SAY_TWIGGY_FLATHEAD_FRAY, me); - Creature* creature = Unit::GetCreature((*me), AffrayChallenger[Wave]); - if (creature && (creature->isAlive())) - { - creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - creature->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); - creature->setFaction(14); - creature->AI()->AttackStart(pWarrior); - ++Wave; - WaveTimer = 20000; - } - } - else if (Wave >= 6 && !EventBigWill) { - if (Creature* creature = me->SummonCreature(NPC_BIG_WILL, -1722, -4341, 6.12f, 6.26f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 480000)) - { - BigWill = creature->GetGUID(); - //creature->GetMotionMaster()->MovePoint(0, -1693, -4343, 4.32f); - //creature->GetMotionMaster()->MovePoint(1, -1684, -4333, 2.78f); - creature->GetMotionMaster()->MovePoint(2, -1682, -4329, 2.79f); - creature->HandleEmoteCommand(EMOTE_STATE_READY_UNARMED); - EventBigWill = true; - WaveTimer = 1000; - } - } - else if (Wave >= 6 && EventBigWill && BigWill) - { - Creature* creature = Unit::GetCreature((*me), BigWill); - if (!creature || !creature->isAlive()) - { - DoScriptText(SAY_TWIGGY_FLATHEAD_OVER, me); - Reset(); - } - } - } else WaveTimer -= diff; - } - } - } - }; - -}; - /*##### ## npc_wizzlecrank_shredder #####*/ @@ -687,10 +197,5 @@ public: void AddSC_the_barrens() { - new npc_beaten_corpse(); - new npc_gilthares(); - new npc_sputtervalve(); - new npc_taskmaster_fizzule(); - new npc_twiggy_flathead(); new npc_wizzlecrank_shredder(); } diff --git a/src/server/scripts/Kalimdor/thousand_needles.cpp b/src/server/scripts/Kalimdor/thousand_needles.cpp index b9ae356ddf1..2abef548a94 100644 --- a/src/server/scripts/Kalimdor/thousand_needles.cpp +++ b/src/server/scripts/Kalimdor/thousand_needles.cpp @@ -18,18 +18,12 @@ /* ScriptData SDName: Thousand Needles -SD%Complete: 100 -SDComment: Support for Quest: 1950, 4770, 4904, 4966, 5151. +SD%Complete: 0 +SDComment: Support for Quest: SDCategory: Thousand Needles EndScriptData */ /* ContentData -npc_kanati -npc_lakota_windsong -npc_swiftmountain -npc_plucky -npc_enraged_panther -go_panther_cage EndContentData */ #include "ScriptMgr.h" @@ -37,425 +31,7 @@ EndContentData */ #include "ScriptedGossip.h" #include "ScriptedEscortAI.h" -/*##### -# npc_kanati -######*/ - -enum Kanati -{ - SAY_KAN_START = -1000410, - - QUEST_PROTECT_KANATI = 4966, - NPC_GALAK_ASS = 10720 -}; - -Position const GalakLoc = {-4867.387695f, -1357.353760f, -48.226f, 0.0f}; - -class npc_kanati : public CreatureScript -{ -public: - npc_kanati() : CreatureScript("npc_kanati") { } - - bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) - { - if (quest->GetQuestId() == QUEST_PROTECT_KANATI) - if (npc_kanatiAI* pEscortAI = CAST_AI(npc_kanati::npc_kanatiAI, creature->AI())) - pEscortAI->Start(false, false, player->GetGUID(), quest, true); - - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_kanatiAI(creature); - } - - struct npc_kanatiAI : public npc_escortAI - { - npc_kanatiAI(Creature* creature) : npc_escortAI(creature) { } - - void Reset() {} - - void WaypointReached(uint32 waypointId) - { - switch (waypointId) - { - case 0: - DoScriptText(SAY_KAN_START, me); - DoSpawnGalak(); - break; - case 1: - if (Player* player = GetPlayerForEscort()) - player->GroupEventHappens(QUEST_PROTECT_KANATI, me); - break; - } - } - - void DoSpawnGalak() - { - for (int i = 0; i < 3; ++i) - me->SummonCreature(NPC_GALAK_ASS, GalakLoc, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - } - - void JustSummoned(Creature* summoned) - { - summoned->AI()->AttackStart(me); - } - }; - -}; - -/*###### -# npc_lakota_windsong -######*/ - -enum Lakota -{ - SAY_LAKO_START = -1000365, - SAY_LAKO_LOOK_OUT = -1000366, - SAY_LAKO_HERE_COME = -1000367, - SAY_LAKO_MORE = -1000368, - SAY_LAKO_END = -1000369, - - QUEST_FREE_AT_LAST = 4904, - NPC_GRIM_BANDIT = 10758, - FACTION_ESCORTEE_LAKO = 232, //guessed - - ID_AMBUSH_1 = 0, - ID_AMBUSH_2 = 2, - ID_AMBUSH_3 = 4 -}; - -Position const BanditLoc[6] = -{ - {-4905.479492f, -2062.732666f, 84.352f, 0.0f}, - {-4915.201172f, -2073.528320f, 84.733f, 0.0f}, - {-4878.883301f, -1986.947876f, 91.966f, 0.0f}, - {-4877.503906f, -1966.113403f, 91.859f, 0.0f}, - {-4767.985352f, -1873.169189f, 90.192f, 0.0f}, - {-4788.861328f, -1888.007813f, 89.888f, 0.0f} -}; - -class npc_lakota_windsong : public CreatureScript -{ -public: - npc_lakota_windsong() : CreatureScript("npc_lakota_windsong") { } - - bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) - { - if (quest->GetQuestId() == QUEST_FREE_AT_LAST) - { - DoScriptText(SAY_LAKO_START, creature, player); - creature->setFaction(FACTION_ESCORTEE_LAKO); - - if (npc_lakota_windsongAI* pEscortAI = CAST_AI(npc_lakota_windsong::npc_lakota_windsongAI, creature->AI())) - pEscortAI->Start(false, false, player->GetGUID(), quest); - } - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_lakota_windsongAI(creature); - } - - struct npc_lakota_windsongAI : public npc_escortAI - { - npc_lakota_windsongAI(Creature* creature) : npc_escortAI(creature) { } - - void Reset() {} - - void WaypointReached(uint32 waypointId) - { - switch (waypointId) - { - case 8: - DoScriptText(SAY_LAKO_LOOK_OUT, me); - DoSpawnBandits(ID_AMBUSH_1); - break; - case 14: - DoScriptText(SAY_LAKO_HERE_COME, me); - DoSpawnBandits(ID_AMBUSH_2); - break; - case 21: - DoScriptText(SAY_LAKO_MORE, me); - DoSpawnBandits(ID_AMBUSH_3); - break; - case 45: - if (Player* player = GetPlayerForEscort()) - player->GroupEventHappens(QUEST_FREE_AT_LAST, me); - break; - } - } - - void DoSpawnBandits(int AmbushId) - { - for (int i = 0; i < 2; ++i) - me->SummonCreature(NPC_GRIM_BANDIT, BanditLoc[i+AmbushId], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); - } - }; - -}; - -/*###### -# npc_paoka_swiftmountain -######*/ - -enum Packa -{ - SAY_START = -1000362, - SAY_WYVERN = -1000363, - SAY_COMPLETE = -1000364, - - QUEST_HOMEWARD = 4770, - NPC_WYVERN = 4107, - FACTION_ESCORTEE = 232 //guessed -}; - -Position const WyvernLoc[3] = -{ - {-4990.606f, -906.057f, -5.343f, 0.0f}, - {-4970.241f, -927.378f, -4.951f, 0.0f}, - {-4985.364f, -952.528f, -5.199f, 0.0f} -}; - -class npc_paoka_swiftmountain : public CreatureScript -{ -public: - npc_paoka_swiftmountain() : CreatureScript("npc_paoka_swiftmountain") { } - - bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) - { - if (quest->GetQuestId() == QUEST_HOMEWARD) - { - DoScriptText(SAY_START, creature, player); - creature->setFaction(FACTION_ESCORTEE); - - if (npc_paoka_swiftmountainAI* pEscortAI = CAST_AI(npc_paoka_swiftmountain::npc_paoka_swiftmountainAI, creature->AI())) - pEscortAI->Start(false, false, player->GetGUID(), quest); - } - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_paoka_swiftmountainAI(creature); - } - - struct npc_paoka_swiftmountainAI : public npc_escortAI - { - npc_paoka_swiftmountainAI(Creature* creature) : npc_escortAI(creature) { } - - void Reset() {} - - void WaypointReached(uint32 waypointId) - { - switch (waypointId) - { - case 15: - DoScriptText(SAY_WYVERN, me); - DoSpawnWyvern(); - break; - case 26: - DoScriptText(SAY_COMPLETE, me); - break; - case 27: - if (Player* player = GetPlayerForEscort()) - player->GroupEventHappens(QUEST_HOMEWARD, me); - break; - } - } - - void DoSpawnWyvern() - { - for (int i = 0; i < 3; ++i) - me->SummonCreature(NPC_WYVERN, WyvernLoc[i], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); - } - }; -}; - -/*##### -# npc_plucky -######*/ - -#define GOSSIP_P "Please tell me the Phrase.." - -enum Plucky -{ - FACTION_FRIENDLY = 35, - QUEST_SCOOP = 1950, - SPELL_PLUCKY_HUMAN = 9192, - SPELL_PLUCKY_CHICKEN = 9220 -}; - -class npc_plucky : public CreatureScript -{ -public: - npc_plucky() : CreatureScript("npc_plucky") { } - - bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - switch (action) - { - case GOSSIP_ACTION_INFO_DEF+1: - player->CLOSE_GOSSIP_MENU(); - player->CompleteQuest(QUEST_SCOOP); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (player->GetQuestStatus(QUEST_SCOOP) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_P, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - player->SEND_GOSSIP_MENU(738, creature->GetGUID()); - - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_pluckyAI(creature); - } - - struct npc_pluckyAI : public ScriptedAI - { - npc_pluckyAI(Creature* creature) : ScriptedAI(creature) { NormFaction = creature->getFaction(); } - - uint32 NormFaction; - uint32 ResetTimer; - - void Reset() - { - ResetTimer = 120000; - - if (me->getFaction() != NormFaction) - me->setFaction(NormFaction); - - if (me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) - me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - - DoCast(me, SPELL_PLUCKY_CHICKEN, false); - } - - void ReceiveEmote(Player* player, uint32 TextEmote) - { - if (player->GetQuestStatus(QUEST_SCOOP) == QUEST_STATUS_INCOMPLETE) - { - if (TextEmote == TEXT_EMOTE_BECKON) - { - me->setFaction(FACTION_FRIENDLY); - me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - DoCast(me, SPELL_PLUCKY_HUMAN, false); - } - } - - if (TextEmote == TEXT_EMOTE_CHICKEN) - { - if (me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) - return; - else - { - me->setFaction(FACTION_FRIENDLY); - me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - DoCast(me, SPELL_PLUCKY_HUMAN, false); - me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); - } - } - } - - void UpdateAI(const uint32 Diff) - { - if (me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) - { - if (ResetTimer <= Diff) - { - if (!me->getVictim()) - EnterEvadeMode(); - else - me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - - return; - } - else - ResetTimer -= Diff; - } - - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - }; - -}; - -enum PantherCage -{ - ENRAGED_PANTHER = 10992 -}; - -class go_panther_cage : public GameObjectScript -{ -public: - go_panther_cage() : GameObjectScript("go_panther_cage") { } - - bool OnGossipHello(Player* player, GameObject* go) - { - if (player->GetQuestStatus(5151) == QUEST_STATUS_INCOMPLETE) - { - if (Creature* panther = go->FindNearestCreature(ENRAGED_PANTHER, 5, true)) - { - panther->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - panther->SetReactState(REACT_AGGRESSIVE); - panther->AI()->AttackStart(player); - } - } - - return true; - } -}; - -class npc_enraged_panther : public CreatureScript -{ -public: - npc_enraged_panther() : CreatureScript("npc_enraged_panther") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_enraged_pantherAI(creature); - } - - struct npc_enraged_pantherAI : public ScriptedAI - { - npc_enraged_pantherAI(Creature* creature) : ScriptedAI(creature) {} - - void Reset() - { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->SetReactState(REACT_PASSIVE); - } - - void UpdateAI(const uint32 /*diff*/) - { - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - }; - -}; void AddSC_thousand_needles() { - new npc_kanati(); - new npc_lakota_windsong(); - new npc_paoka_swiftmountain(); - new npc_plucky(); - new npc_enraged_panther(); - new go_panther_cage(); } diff --git a/src/server/scripts/Kalimdor/thunder_bluff.cpp b/src/server/scripts/Kalimdor/thunder_bluff.cpp index b8b05b9692f..4feca5929b5 100644 --- a/src/server/scripts/Kalimdor/thunder_bluff.cpp +++ b/src/server/scripts/Kalimdor/thunder_bluff.cpp @@ -47,30 +47,6 @@ class npc_cairne_bloodhoof : public CreatureScript public: npc_cairne_bloodhoof() : CreatureScript("npc_cairne_bloodhoof") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_SENDER_INFO) - { - player->CastSpell(player, 23123, false); - player->SEND_GOSSIP_MENU(7014, creature->GetGUID()); - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(925) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HCB, GOSSIP_SENDER_MAIN, GOSSIP_SENDER_INFO); - - player->SEND_GOSSIP_MENU(7013, creature->GetGUID()); - - return true; - } - CreatureAI* GetAI(Creature* creature) const { return new npc_cairne_bloodhoofAI (creature); diff --git a/src/server/scripts/Kalimdor/ungoro_crater.cpp b/src/server/scripts/Kalimdor/ungoro_crater.cpp index 786d2fc0cd3..d8d6acf3605 100644 --- a/src/server/scripts/Kalimdor/ungoro_crater.cpp +++ b/src/server/scripts/Kalimdor/ungoro_crater.cpp @@ -18,14 +18,12 @@ /* ScriptData SDName: Ungoro Crater -SD%Complete: 100 -SDComment: Support for Quest: 4245, 4491 +SD%Complete: 0 +SDComment: Support for Quest: SDCategory: Ungoro Crater EndScriptData */ /* ContentData -npc_a-me -npc_ringo EndContentData */ #include "ScriptMgr.h" @@ -33,321 +31,6 @@ EndContentData */ #include "ScriptedEscortAI.h" #include "ScriptedFollowerAI.h" -enum AmeData -{ - SAY_READY = -1000517, - SAY_AGGRO1 = -1000518, - SAY_SEARCH = -1000519, - SAY_AGGRO2 = -1000520, - SAY_AGGRO3 = -1000521, - SAY_FINISH = -1000522, - - SPELL_DEMORALIZINGSHOUT = 13730, - - QUEST_CHASING_AME = 4245, - ENTRY_TARLORD = 6519, - ENTRY_TARLORD1 = 6519, - ENTRY_STOMPER = 6513, -}; - -class npc_ame : public CreatureScript -{ -public: - npc_ame() : CreatureScript("npc_ame") { } - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - if (quest->GetQuestId() == QUEST_CHASING_AME) - { - CAST_AI(npc_escortAI, (creature->AI()))->Start(false, false, player->GetGUID()); - DoScriptText(SAY_READY, creature, player); - creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - // Change faction so mobs attack - creature->setFaction(113); - } - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_ameAI(creature); - } - - struct npc_ameAI : public npc_escortAI - { - npc_ameAI(Creature* creature) : npc_escortAI(creature) {} - - uint32 DemoralizingShoutTimer; - - void WaypointReached(uint32 waypointId) - { - if (Player* player = GetPlayerForEscort()) - { - switch (waypointId) - { - case 19: - me->SummonCreature(ENTRY_STOMPER, -6391.69f, -1730.49f, -272.83f, 4.96f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - DoScriptText(SAY_AGGRO1, me, player); - break; - case 28: - DoScriptText(SAY_SEARCH, me, player); - break; - case 38: - me->SummonCreature(ENTRY_TARLORD, -6370.75f, -1382.84f, -270.51f, 6.06f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - DoScriptText(SAY_AGGRO2, me, player); - break; - case 49: - me->SummonCreature(ENTRY_TARLORD1, -6324.44f, -1181.05f, -270.17f, 4.34f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - DoScriptText(SAY_AGGRO3, me, player); - break; - case 55: - DoScriptText(SAY_FINISH, me, player); - player->GroupEventHappens(QUEST_CHASING_AME, me); - break; - } - } - } - - void Reset() - { - DemoralizingShoutTimer = 5000; - } - - void JustSummoned(Creature* summoned) - { - summoned->AI()->AttackStart(me); - } - - void JustDied(Unit* /*killer*/) - { - if (Player* player = GetPlayerForEscort()) - player->FailQuest(QUEST_CHASING_AME); - } - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - if (!UpdateVictim()) - return; - - if (DemoralizingShoutTimer <= diff) - { - DoCast(me->getVictim(), SPELL_DEMORALIZINGSHOUT); - DemoralizingShoutTimer = 70000; - } else DemoralizingShoutTimer -= diff; - } - }; -}; - -/*#### -# npc_ringo -####*/ - -enum Ringo -{ - SAY_RIN_START_1 = -1000416, - SAY_RIN_START_2 = -1000417, - - SAY_FAINT_1 = -1000418, - SAY_FAINT_2 = -1000419, - SAY_FAINT_3 = -1000420, - SAY_FAINT_4 = -1000421, - - SAY_WAKE_1 = -1000422, - SAY_WAKE_2 = -1000423, - SAY_WAKE_3 = -1000424, - SAY_WAKE_4 = -1000425, - - SAY_RIN_END_1 = -1000426, - SAY_SPR_END_2 = -1000427, - SAY_RIN_END_3 = -1000428, - EMOTE_RIN_END_4 = -1000429, - EMOTE_RIN_END_5 = -1000430, - SAY_RIN_END_6 = -1000431, // signed for 6784 - SAY_SPR_END_7 = -1000432, - EMOTE_RIN_END_8 = -1000433, - - SPELL_REVIVE_RINGO = 15591, - QUEST_A_LITTLE_HELP = 4491, - NPC_SPRAGGLE = 9997, - FACTION_ESCORTEE = 113 -}; - -class npc_ringo : public CreatureScript -{ -public: - npc_ringo() : CreatureScript("npc_ringo") { } - - bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) - { - if (quest->GetQuestId() == QUEST_A_LITTLE_HELP) - { - if (npc_ringoAI* pRingoAI = CAST_AI(npc_ringo::npc_ringoAI, creature->AI())) - { - creature->SetStandState(UNIT_STAND_STATE_STAND); - pRingoAI->StartFollow(player, FACTION_ESCORTEE, quest); - } - } - - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_ringoAI(creature); - } - - struct npc_ringoAI : public FollowerAI - { - npc_ringoAI(Creature* creature) : FollowerAI(creature) { } - - uint32 FaintTimer; - uint32 EndEventProgress; - uint32 EndEventTimer; - - uint64 SpraggleGUID; - - void Reset() - { - FaintTimer = urand(30000, 60000); - EndEventProgress = 0; - EndEventTimer = 1000; - SpraggleGUID = 0; - } - - void MoveInLineOfSight(Unit* who) - { - FollowerAI::MoveInLineOfSight(who); - - if (!me->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE) && who->GetEntry() == NPC_SPRAGGLE) - { - if (me->IsWithinDistInMap(who, INTERACTION_DISTANCE)) - { - if (Player* player = GetLeaderForFollower()) - { - if (player->GetQuestStatus(QUEST_A_LITTLE_HELP) == QUEST_STATUS_INCOMPLETE) - player->GroupEventHappens(QUEST_A_LITTLE_HELP, me); - } - - SpraggleGUID = who->GetGUID(); - SetFollowComplete(true); - } - } - } - - void SpellHit(Unit* /*pCaster*/, const SpellInfo* pSpell) - { - if (HasFollowState(STATE_FOLLOW_INPROGRESS | STATE_FOLLOW_PAUSED) && pSpell->Id == SPELL_REVIVE_RINGO) - ClearFaint(); - } - - void SetFaint() - { - if (!HasFollowState(STATE_FOLLOW_POSTEVENT)) - { - SetFollowPaused(true); - - DoScriptText(RAND(SAY_FAINT_1, SAY_FAINT_2, SAY_FAINT_3, SAY_FAINT_4), me); - } - - //what does actually happen here? Emote? Aura? - me->SetStandState(UNIT_STAND_STATE_SLEEP); - } - - void ClearFaint() - { - me->SetStandState(UNIT_STAND_STATE_STAND); - - if (HasFollowState(STATE_FOLLOW_POSTEVENT)) - return; - - DoScriptText(RAND(SAY_WAKE_1, SAY_WAKE_2, SAY_WAKE_3, SAY_WAKE_4), me); - - SetFollowPaused(false); - } - - void UpdateFollowerAI(const uint32 Diff) - { - if (!UpdateVictim()) - { - if (HasFollowState(STATE_FOLLOW_POSTEVENT)) - { - if (EndEventTimer <= Diff) - { - Unit* pSpraggle = Unit::GetUnit(*me, SpraggleGUID); - if (!pSpraggle || !pSpraggle->isAlive()) - { - SetFollowComplete(); - return; - } - - switch (EndEventProgress) - { - case 1: - DoScriptText(SAY_RIN_END_1, me); - EndEventTimer = 3000; - break; - case 2: - DoScriptText(SAY_SPR_END_2, pSpraggle); - EndEventTimer = 5000; - break; - case 3: - DoScriptText(SAY_RIN_END_3, me); - EndEventTimer = 1000; - break; - case 4: - DoScriptText(EMOTE_RIN_END_4, me); - SetFaint(); - EndEventTimer = 9000; - break; - case 5: - DoScriptText(EMOTE_RIN_END_5, me); - ClearFaint(); - EndEventTimer = 1000; - break; - case 6: - DoScriptText(SAY_RIN_END_6, me); - EndEventTimer = 3000; - break; - case 7: - DoScriptText(SAY_SPR_END_7, pSpraggle); - EndEventTimer = 10000; - break; - case 8: - DoScriptText(EMOTE_RIN_END_8, me); - EndEventTimer = 5000; - break; - case 9: - SetFollowComplete(); - break; - } - - ++EndEventProgress; - } - else - EndEventTimer -= Diff; - } - else if (HasFollowState(STATE_FOLLOW_INPROGRESS) && !HasFollowState(STATE_FOLLOW_PAUSED)) - { - if (FaintTimer <= Diff) - { - SetFaint(); - FaintTimer = urand(60000, 120000); - } - else - FaintTimer -= Diff; - } - - return; - } - - DoMeleeAttackIfReady(); - } - }; -}; - void AddSC_ungoro_crater() { - new npc_ame(); - new npc_ringo(); } -- cgit v1.2.3 From 7d75c2818df5545e1633d20403be1c640fcde410 Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 12 Aug 2012 12:18:02 -0500 Subject: Scripts/Quests: Removed some deprecated scripts and fixed quest 26050 --- sql/updates/world/2012_08_17_00_world_misc_434.sql | 38 +++++ src/server/game/Scripting/ScriptLoader.cpp | 2 - src/server/scripts/EasternKingdoms/CMakeLists.txt | 1 - .../scripts/EasternKingdoms/arathi_highlands.cpp | 63 +++++--- src/server/scripts/EasternKingdoms/boss_kruul.cpp | 160 --------------------- .../scripts/EasternKingdoms/burning_steppes.cpp | 128 +---------------- 6 files changed, 82 insertions(+), 310 deletions(-) create mode 100644 sql/updates/world/2012_08_17_00_world_misc_434.sql delete mode 100644 src/server/scripts/EasternKingdoms/boss_kruul.cpp (limited to 'src') diff --git a/sql/updates/world/2012_08_17_00_world_misc_434.sql b/sql/updates/world/2012_08_17_00_world_misc_434.sql new file mode 100644 index 00000000000..aa6c11ee1f8 --- /dev/null +++ b/sql/updates/world/2012_08_17_00_world_misc_434.sql @@ -0,0 +1,38 @@ +DELETE FROM `creature_text` WHERE `entry`=2768; +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES +(2768,0,0,'Ok, $N. Follow me to the cave where I''ll attempt to harness the power of the rune stone into these goggles.',12,0,100,0,0,0,'Professor Phizzlethorpe - SAY_PROGRESS_1'), +(2768,1,0,'I discovered this cave on our first day here. I believe the energy in the stone can be used to our advantage.',12,0,100,0,0,0,'Professor Phizzlethorpe - SAY_PROGRESS_2'), +(2768,2,0,'I''ll begin drawing energy from the stone. Your job, $N, is to defend me. This place is cursed... trust me.',12,0,100,0,0,0,'Professor Phizzlethorpe - SAY_PROGRESS_3'), +(2768,3,0,'%s begins tinkering with the goggles before the stone.',16,0,100,0,0,0,'Professor Phizzlethorpe - EMOTE_PROGRESS_4'), +(2768,4,0,'Help!!! Get these things off me so I can get my work done!',12,0,100,0,0,0,'Professor Phizzlethorpe - SAY_AGGRO'), +(2768,5,0,'Almost done! Just a little longer!',12,0,100,0,0,0,'Professor Phizzlethorpe - SAY_PROGRESS_5'), +(2768,6,0,'I''ve done it! I have harnessed the power of the stone into the goggles! Let''s get out of here!',12,0,100,0,0,0,'Professor Phizzlethorpe - SAY_PROGRESS_6'), +(2768,7,0,'Phew! Glad to be back from that creepy cave.',12,0,100,0,0,0,'Professor Phizzlethorpe - SAY_PROGRESS_7'), +(2768,8,0,'%s hands one glowing goggles over to Doctor Draxlegauge.',16,0,100,0,0,0,'Professor Phizzlethorpe - EMOTE_PROGRESS_8'), +(2768,9,0,'Doctor Draxlegauge will give you further instructions, $N. Many thanks for your help!',12,0,100,0,0,0,'Professor Phizzlethorpe - SAY_PROGRESS_9'); + +DELETE FROM `script_waypoint` WHERE `entry`=2768; +INSERT INTO `script_waypoint` (`entry`, `pointid`, `location_x`, `location_y`, `location_z`, `waittime`, `point_comment`) VALUES +(2768,1,-2072.32,-2089.59,9.14603,0,''), +(2768,2,-2078.18,-2096.31,10.8916,0,''), +(2768,3,-2079.21,-2105.22,13.3174,0,''), +(2768,4,-2074.81,-2108.72,14.1485,0,''), +(2768,5,-2076,-2116.21,16.3934,0,''), +(2768,6,-2073.31,-2123.92,18.6202,4000,''), +(2768,7,-2064.41,-2133.33,21.5776,0,''), +(2768,8,-2044.08,-2153.12,20.121,18000,''), +(2768,9,-2044.08,-2153.12,20.121,3000,''), +(2768,10,-2044.08,-2153.12,20.121,0,''), +(2768,11,-2044.08,-2153.12,20.121,14000,''), +(2768,12,-2063.89,-2133.33,21.5648,0,''), +(2768,13,-2075,-2121.98,17.8443,0,''), +(2768,14,-2074.83,-2108.53,14.1036,0,''), +(2768,15,-2079.59,-2091.61,9.80862,0,''), +(2768,16,-2071.29,-2086.44,8.5181,0,''), +(2768,17,-2066.46,-2085.97,8.9241,7000,''); + +DELETE FROM `creature_questrelation` WHERE `id`=2768 AND `quest`=26050; +INSERT INTO `creature_questrelation` (`id`, `quest`) +VALUES (2768, 26050); + +UPDATE `creature_template` SET `ScriptName`='npc_professor_phizzlethorpe' WHERE `entry`=2768; \ No newline at end of file diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index 128d28a9954..2db840bf39a 100755 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -245,7 +245,6 @@ void AddSC_instance_zulgurub(); //void AddSC_alterac_mountains(); void AddSC_arathi_highlands(); void AddSC_blasted_lands(); -void AddSC_boss_kruul(); void AddSC_burning_steppes(); void AddSC_duskwood(); void AddSC_eastern_plaguelands(); @@ -865,7 +864,6 @@ void AddEasternKingdomsScripts() //AddSC_alterac_mountains(); AddSC_arathi_highlands(); AddSC_blasted_lands(); - AddSC_boss_kruul(); AddSC_burning_steppes(); AddSC_duskwood(); AddSC_eastern_plaguelands(); diff --git a/src/server/scripts/EasternKingdoms/CMakeLists.txt b/src/server/scripts/EasternKingdoms/CMakeLists.txt index 5dc3b52dec1..de3e6ae32a6 100644 --- a/src/server/scripts/EasternKingdoms/CMakeLists.txt +++ b/src/server/scripts/EasternKingdoms/CMakeLists.txt @@ -32,7 +32,6 @@ set(scripts_STAT_SRCS EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp EasternKingdoms/isle_of_queldanas.cpp - EasternKingdoms/boss_kruul.cpp EasternKingdoms/ZulGurub/boss_hakkar.cpp EasternKingdoms/ZulGurub/boss_mandokir.cpp EasternKingdoms/ZulGurub/boss_marli.cpp diff --git a/src/server/scripts/EasternKingdoms/arathi_highlands.cpp b/src/server/scripts/EasternKingdoms/arathi_highlands.cpp index b0d59fe8b5a..9db03971756 100644 --- a/src/server/scripts/EasternKingdoms/arathi_highlands.cpp +++ b/src/server/scripts/EasternKingdoms/arathi_highlands.cpp @@ -47,8 +47,12 @@ enum eEnums SAY_PROGRESS_7 = 7, EMOTE_PROGRESS_8 = 8, SAY_PROGRESS_9 = 9, + + EVENT_SAY_3 = 1, + EVENT_SAY_6 = 2, + EVENT_SAY_8 = 3, - QUEST_SUNKEN_TREASURE = 665, + QUEST_GOGGLE_BOGGLE = 26050, MOB_VENGEFUL_SURGE = 2776 }; @@ -73,33 +77,22 @@ class npc_professor_phizzlethorpe : public CreatureScript switch (waypointId) { - case 4: + case 6: Talk(SAY_PROGRESS_2, player->GetGUID()); - break; - case 5: - Talk(SAY_PROGRESS_3, player->GetGUID()); + events.ScheduleEvent(EVENT_SAY_3, 3000); break; case 8: Talk(EMOTE_PROGRESS_4); - break; - case 9: - me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96f, -2142.49f, 20.15f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); - me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96f, -2142.49f, 20.15f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); - break; - case 10: - Talk(SAY_PROGRESS_5, player->GetGUID()); + me->SummonCreature(MOB_VENGEFUL_SURGE, -2065.505f, -2136.88f, 22.20362f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); + me->SummonCreature(MOB_VENGEFUL_SURGE, -2059.249f, -2134.88f, 21.51582f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); break; case 11: - Talk(SAY_PROGRESS_6, player->GetGUID()); - SetRun(); + Talk(SAY_PROGRESS_5, player->GetGUID()); + events.ScheduleEvent(EVENT_SAY_6, 11000); break; - case 19: + case 17: Talk(SAY_PROGRESS_7, player->GetGUID()); - break; - case 20: - Talk(EMOTE_PROGRESS_8); - Talk(SAY_PROGRESS_9, player->GetGUID()); - player->GroupEventHappens(QUEST_SUNKEN_TREASURE, me); + events.ScheduleEvent(EVENT_SAY_8, 6000); break; } } @@ -116,8 +109,34 @@ class npc_professor_phizzlethorpe : public CreatureScript void UpdateAI(const uint32 diff) { + Player* player = GetPlayerForEscort(); + if (!player) + return; + + events.Update(diff); + + while (uint32 event = events.ExecuteEvent()) + { + switch (event) + { + case EVENT_SAY_3: + Talk(SAY_PROGRESS_3, player->GetGUID()); + break; + case EVENT_SAY_6: + Talk(SAY_PROGRESS_6, player->GetGUID()); + SetRun(); + break; + case EVENT_SAY_8: + Talk(EMOTE_PROGRESS_8); + Talk(SAY_PROGRESS_9, player->GetGUID()); + player->GroupEventHappens(QUEST_GOGGLE_BOGGLE, me); + break; + } + } npc_escortAI::UpdateAI(diff); } + + EventMap events; }; CreatureAI* GetAI(Creature* creature) const @@ -127,13 +146,13 @@ class npc_professor_phizzlethorpe : public CreatureScript bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) { - if (quest->GetQuestId() == QUEST_SUNKEN_TREASURE) + if (quest->GetQuestId() == QUEST_GOGGLE_BOGGLE) { creature->AI()->Talk(SAY_PROGRESS_1, player->GetGUID()); if (npc_escortAI* pEscortAI = CAST_AI(npc_professor_phizzlethorpeAI, (creature->AI()))) pEscortAI->Start(false, false, player->GetGUID(), quest); - creature->setFaction(113); + creature->setFaction(42); } return true; } diff --git a/src/server/scripts/EasternKingdoms/boss_kruul.cpp b/src/server/scripts/EasternKingdoms/boss_kruul.cpp deleted file mode 100644 index 6a1ba633660..00000000000 --- a/src/server/scripts/EasternKingdoms/boss_kruul.cpp +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright (C) 2008-2012 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 - * - * 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; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; 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, see . - */ - -/* ScriptData -SDName: Boss_Kruul -SD%Complete: 100 -SDComment: Highlord Kruul are presumably no longer in-game on regular bases, however future events could bring him back. -SDCategory: Bosses -EndScriptData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" - -#define SPELL_SHADOWVOLLEY 21341 -#define SPELL_CLEAVE 20677 -#define SPELL_THUNDERCLAP 23931 -#define SPELL_TWISTEDREFLECTION 21063 -#define SPELL_VOIDBOLT 21066 -#define SPELL_RAGE 21340 -#define SPELL_CAPTURESOUL 21054 - -class boss_kruul : public CreatureScript -{ -public: - boss_kruul() : CreatureScript("boss_kruul") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new boss_kruulAI (creature); - } - - struct boss_kruulAI : public ScriptedAI - { - boss_kruulAI(Creature* creature) : ScriptedAI(creature) {} - - uint32 ShadowVolley_Timer; - uint32 Cleave_Timer; - uint32 ThunderClap_Timer; - uint32 TwistedReflection_Timer; - uint32 VoidBolt_Timer; - uint32 Rage_Timer; - uint32 Hound_Timer; - - void Reset() - { - ShadowVolley_Timer = 10000; - Cleave_Timer = 14000; - ThunderClap_Timer = 20000; - TwistedReflection_Timer = 25000; - VoidBolt_Timer = 30000; - Rage_Timer = 60000; //Cast rage after 1 minute - Hound_Timer = 8000; - } - - void EnterCombat(Unit* /*who*/) - { - } - - void KilledUnit(Unit* /*victim*/) - { - // When a player, pet or totem gets killed, Lord Kazzak casts this spell to instantly regenerate 70, 000 health. - DoCast(me, SPELL_CAPTURESOUL); - } - - void SummonHounds(Unit* victim) - { - if (Creature* Hound = DoSpawnCreature(19207, float(irand(-9, 9)), float(irand(-9, 9)), 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000)) - Hound->AI()->AttackStart(victim); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //ShadowVolley_Timer - if (ShadowVolley_Timer <= diff) - { - if (urand(0, 99) < 45) - DoCast(me->getVictim(), SPELL_SHADOWVOLLEY); - - ShadowVolley_Timer = 5000; - } else ShadowVolley_Timer -= diff; - - //Cleave_Timer - if (Cleave_Timer <= diff) - { - if (urand(0, 1)) - DoCast(me->getVictim(), SPELL_CLEAVE); - - Cleave_Timer = 10000; - } else Cleave_Timer -= diff; - - //ThunderClap_Timer - if (ThunderClap_Timer <= diff) - { - if (urand(0, 9) < 2) - DoCast(me->getVictim(), SPELL_THUNDERCLAP); - - ThunderClap_Timer = 12000; - } else ThunderClap_Timer -= diff; - - //TwistedReflection_Timer - if (TwistedReflection_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_TWISTEDREFLECTION); - TwistedReflection_Timer = 30000; - } else TwistedReflection_Timer -= diff; - - //VoidBolt_Timer - if (VoidBolt_Timer <= diff) - { - if (urand(0, 9) < 4) - DoCast(me->getVictim(), SPELL_VOIDBOLT); - - VoidBolt_Timer = 18000; - } else VoidBolt_Timer -= diff; - - //Rage_Timer - if (Rage_Timer <= diff) - { - DoCast(me, SPELL_RAGE); - Rage_Timer = 70000; - } else Rage_Timer -= diff; - - //Hound_Timer - if (Hound_Timer <= diff) - { - SummonHounds(me->getVictim()); - SummonHounds(me->getVictim()); - SummonHounds(me->getVictim()); - - Hound_Timer = 45000; - } else Hound_Timer -= diff; - - DoMeleeAttackIfReady(); - } - }; -}; - -void AddSC_boss_kruul() -{ - new boss_kruul(); -} diff --git a/src/server/scripts/EasternKingdoms/burning_steppes.cpp b/src/server/scripts/EasternKingdoms/burning_steppes.cpp index eec747d6d73..3f8e86753dd 100644 --- a/src/server/scripts/EasternKingdoms/burning_steppes.cpp +++ b/src/server/scripts/EasternKingdoms/burning_steppes.cpp @@ -18,140 +18,18 @@ /* ScriptData SDName: Burning_Steppes -SD%Complete: 100 -SDComment: Quest support: 4224, 4866 +SD%Complete: 0 +SDComment: SDCategory: Burning Steppes EndScriptData */ -/* ContentData -npc_ragged_john -EndContentData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "ScriptedGossip.h" -/*###### -## npc_ragged_john -######*/ - -#define GOSSIP_HELLO "Official buisness, John. I need some information about Marsha Windsor. Tell me about the last time you saw him." -#define GOSSIP_SELECT1 "So what did you do?" -#define GOSSIP_SELECT2 "Start making sense, dwarf. I don't want to have anything to do with your cracker, your pappy, or any sort of 'discreditin'." -#define GOSSIP_SELECT3 "Ironfoe?" -#define GOSSIP_SELECT4 "Interesting... continue John." -#define GOSSIP_SELECT5 "So that's how Windsor died..." -#define GOSSIP_SELECT6 "So how did he die?" -#define GOSSIP_SELECT7 "Ok so where the hell is he? Wait a minute! Are you drunk?" -#define GOSSIP_SELECT8 "WHY is he in Blackrock Depths?" -#define GOSSIP_SELECT9 "300? So the Dark Irons killed him and dragged him into the Depths?" -#define GOSSIP_SELECT10 "Ahh... Ironfoe" -#define GOSSIP_SELECT11 "Thanks, Ragged John. Your story was very uplifting and informative" - -class npc_ragged_john : public CreatureScript -{ -public: - npc_ragged_john() : CreatureScript("npc_ragged_john") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - switch (action) - { - case GOSSIP_ACTION_INFO_DEF: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - player->SEND_GOSSIP_MENU(2714, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+1: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - player->SEND_GOSSIP_MENU(2715, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - player->SEND_GOSSIP_MENU(2716, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); - player->SEND_GOSSIP_MENU(2717, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); - player->SEND_GOSSIP_MENU(2718, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+5: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); - player->SEND_GOSSIP_MENU(2719, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+6: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7); - player->SEND_GOSSIP_MENU(2720, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+7: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT8, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8); - player->SEND_GOSSIP_MENU(2721, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+8: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT9, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9); - player->SEND_GOSSIP_MENU(2722, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+9: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT10, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10); - player->SEND_GOSSIP_MENU(2723, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+10: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT11, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11); - player->SEND_GOSSIP_MENU(2725, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+11: - player->CLOSE_GOSSIP_MENU(); - player->AreaExploredOrEventHappens(4224); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(4224) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - player->SEND_GOSSIP_MENU(2713, creature->GetGUID()); - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_ragged_johnAI (creature); - } - - struct npc_ragged_johnAI : public ScriptedAI - { - npc_ragged_johnAI(Creature* creature) : ScriptedAI(creature) {} - - void Reset() {} - - void MoveInLineOfSight(Unit* who) - { - if (who->HasAura(16468)) - { - if (who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 15) && who->isInAccessiblePlaceFor(me)) - { - DoCast(who, 16472); - CAST_PLR(who)->AreaExploredOrEventHappens(4866); - } - } - - ScriptedAI::MoveInLineOfSight(who); - } - - void EnterCombat(Unit* /*who*/) {} - }; -}; void AddSC_burning_steppes() { - new npc_ragged_john(); + } -- cgit v1.2.3 From 75af5ac3535e8726a03f9575357f44f3981989a0 Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 12 Aug 2012 13:14:54 -0500 Subject: Scripts/Quests: Removed more deprecated quest scripts in Eastern Kingdoms --- src/server/scripts/EasternKingdoms/ghostlands.cpp | 40 +- src/server/scripts/EasternKingdoms/hinterlands.cpp | 201 +------ src/server/scripts/EasternKingdoms/ironforge.cpp | 67 +-- src/server/scripts/EasternKingdoms/loch_modan.cpp | 74 +-- .../scripts/EasternKingdoms/redridge_mountains.cpp | 146 +---- .../scripts/EasternKingdoms/silverpine_forest.cpp | 189 +------ .../scripts/EasternKingdoms/stormwind_city.cpp | 613 +-------------------- .../scripts/EasternKingdoms/swamp_of_sorrows.cpp | 130 ----- .../scripts/EasternKingdoms/tirisfal_glades.cpp | 185 +------ 9 files changed, 13 insertions(+), 1632 deletions(-) (limited to 'src') diff --git a/src/server/scripts/EasternKingdoms/ghostlands.cpp b/src/server/scripts/EasternKingdoms/ghostlands.cpp index 9793c6fd31c..dcc938f35fe 100644 --- a/src/server/scripts/EasternKingdoms/ghostlands.cpp +++ b/src/server/scripts/EasternKingdoms/ghostlands.cpp @@ -19,13 +19,11 @@ /* ScriptData SDName: Ghostlands SD%Complete: 100 -SDComment: Quest support: 9692, 9212. Obtain Budd's Guise of Zul'aman. Vendor Rathis Tomber +SDComment: SDCategory: Ghostlands EndScriptData */ /* ContentData -npc_blood_knight_dawnstar -npc_budd_nedreck npc_rathis_tomber npc_ranger_lilatha EndContentData */ @@ -35,41 +33,6 @@ EndContentData */ #include "ScriptedGossip.h" #include "ScriptedEscortAI.h" -/*###### -## npc_budd_nedreck -######*/ - -#define GOSSIP_HBN "You gave the crew disguises?" - -class npc_budd_nedreck : public CreatureScript -{ -public: - npc_budd_nedreck() : CreatureScript("npc_budd_nedreck") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_INFO_DEF) - { - player->CLOSE_GOSSIP_MENU(); - creature->CastSpell(player, 42540, false); - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(11166) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HBN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - return true; - } -}; - /*###### ## npc_rathis_tomber ######*/ @@ -218,7 +181,6 @@ public: void AddSC_ghostlands() { - new npc_budd_nedreck(); new npc_rathis_tomber(); new npc_ranger_lilatha(); } diff --git a/src/server/scripts/EasternKingdoms/hinterlands.cpp b/src/server/scripts/EasternKingdoms/hinterlands.cpp index a6d01f0ca93..096c0f2e2a6 100644 --- a/src/server/scripts/EasternKingdoms/hinterlands.cpp +++ b/src/server/scripts/EasternKingdoms/hinterlands.cpp @@ -19,13 +19,12 @@ /* ScriptData SDName: Hinterlands SD%Complete: 100 -SDComment: Quest support: 863, 2742 +SDComment: Quest support: 836 SDCategory: The Hinterlands EndScriptData */ /* ContentData npc_00x09hl -npc_rinji EndContentData */ #include "ScriptMgr.h" @@ -149,205 +148,7 @@ public: }; }; -/*###### -## npc_rinji -######*/ - -enum eRinji -{ - SAY_RIN_FREE = -1000403, //from here - SAY_RIN_BY_OUTRUNNER = -1000404, - SAY_RIN_HELP_1 = -1000405, - SAY_RIN_HELP_2 = -1000406, //to here, are used also by 6182 but this is wrong... - SAY_RIN_COMPLETE = -1000407, - SAY_RIN_PROGRESS_1 = -1000408, - SAY_RIN_PROGRESS_2 = -1000409, - - QUEST_RINJI_TRAPPED = 2742, - NPC_RANGER = 2694, - NPC_OUTRUNNER = 2691, - GO_RINJI_CAGE = 142036 -}; - -struct Location -{ - float m_fX, m_fY, m_fZ; -}; - -Location m_afAmbushSpawn[] = -{ - {191.296204f, -2839.329346f, 107.388f}, - {70.972466f, -2848.674805f, 109.459f} -}; - -Location m_afAmbushMoveTo[] = -{ - {166.630386f, -2824.780273f, 108.153f}, - {70.886589f, -2874.335449f, 116.675f} -}; - -class npc_rinji : public CreatureScript -{ -public: - npc_rinji() : CreatureScript("npc_rinji") { } - - bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) - { - if (quest->GetQuestId() == QUEST_RINJI_TRAPPED) - { - if (GameObject* go = creature->FindNearestGameObject(GO_RINJI_CAGE, INTERACTION_DISTANCE)) - go->UseDoorOrButton(); - - if (npc_rinjiAI* pEscortAI = CAST_AI(npc_rinji::npc_rinjiAI, creature->AI())) - pEscortAI->Start(false, false, player->GetGUID(), quest); - } - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_rinjiAI(creature); - } - - struct npc_rinjiAI : public npc_escortAI - { - npc_rinjiAI(Creature* creature) : npc_escortAI(creature) - { - m_bIsByOutrunner = false; - m_iSpawnId = 0; - } - - bool m_bIsByOutrunner; - uint32 m_uiPostEventCount; - uint32 m_uiPostEventTimer; - int m_iSpawnId; - - void Reset() - { - m_uiPostEventCount = 0; - m_uiPostEventTimer = 3000; - } - - void JustRespawned() - { - m_bIsByOutrunner = false; - m_iSpawnId = 0; - - npc_escortAI::JustRespawned(); - } - - void EnterCombat(Unit* who) - { - if (HasEscortState(STATE_ESCORT_ESCORTING)) - { - if (who->GetEntry() == NPC_OUTRUNNER && !m_bIsByOutrunner) - { - DoScriptText(SAY_RIN_BY_OUTRUNNER, who); - m_bIsByOutrunner = true; - } - - if (rand()%4) - return; - - //only if attacked and escorter is not in combat? - DoScriptText(RAND(SAY_RIN_HELP_1, SAY_RIN_HELP_2), me); - } - } - - void DoSpawnAmbush(bool bFirst) - { - if (!bFirst) - m_iSpawnId = 1; - - me->SummonCreature(NPC_RANGER, - m_afAmbushSpawn[m_iSpawnId].m_fX, m_afAmbushSpawn[m_iSpawnId].m_fY, m_afAmbushSpawn[m_iSpawnId].m_fZ, 0.0f, - TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000); - - for (int i = 0; i < 2; ++i) - { - me->SummonCreature(NPC_OUTRUNNER, - m_afAmbushSpawn[m_iSpawnId].m_fX, m_afAmbushSpawn[m_iSpawnId].m_fY, m_afAmbushSpawn[m_iSpawnId].m_fZ, 0.0f, - TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000); - } - } - - void JustSummoned(Creature* summoned) - { - summoned->SetWalk(false); - summoned->GetMotionMaster()->MovePoint(0, m_afAmbushMoveTo[m_iSpawnId].m_fX, m_afAmbushMoveTo[m_iSpawnId].m_fY, m_afAmbushMoveTo[m_iSpawnId].m_fZ); - } - - void WaypointReached(uint32 waypointId) - { - Player* player = GetPlayerForEscort(); - if (!player) - return; - - switch (waypointId) - { - case 1: - DoScriptText(SAY_RIN_FREE, me, player); - break; - case 7: - DoSpawnAmbush(true); - break; - case 13: - DoSpawnAmbush(false); - break; - case 17: - DoScriptText(SAY_RIN_COMPLETE, me, player); - player->GroupEventHappens(QUEST_RINJI_TRAPPED, me); - SetRun(); - m_uiPostEventCount = 1; - break; - } - } - - void UpdateEscortAI(const uint32 uiDiff) - { - //Check if we have a current target - if (!UpdateVictim()) - { - if (HasEscortState(STATE_ESCORT_ESCORTING) && m_uiPostEventCount) - { - if (m_uiPostEventTimer <= uiDiff) - { - m_uiPostEventTimer = 3000; - - if (Player* player = GetPlayerForEscort()) - { - switch (m_uiPostEventCount) - { - case 1: - DoScriptText(SAY_RIN_PROGRESS_1, me, player); - ++m_uiPostEventCount; - break; - case 2: - DoScriptText(SAY_RIN_PROGRESS_2, me, player); - m_uiPostEventCount = 0; - break; - } - } - else - { - me->DespawnOrUnsummon(); - return; - } - } - else - m_uiPostEventTimer -= uiDiff; - } - - return; - } - - DoMeleeAttackIfReady(); - } - }; -}; - void AddSC_hinterlands() { new npc_00x09hl(); - new npc_rinji(); } diff --git a/src/server/scripts/EasternKingdoms/ironforge.cpp b/src/server/scripts/EasternKingdoms/ironforge.cpp index 2915ee1f3cb..98a4d780058 100644 --- a/src/server/scripts/EasternKingdoms/ironforge.cpp +++ b/src/server/scripts/EasternKingdoms/ironforge.cpp @@ -18,81 +18,18 @@ /* ScriptData SDName: Ironforge -SD%Complete: 100 -SDComment: Quest support: 3702 +SD%Complete: 0 +SDComment: SDCategory: Ironforge EndScriptData */ /* ContentData -npc_royal_historian_archesonus EndContentData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "ScriptedGossip.h" -/*###### -## npc_royal_historian_archesonus -######*/ - -#define GOSSIP_ITEM_ROYAL "I am ready to listen" -#define GOSSIP_ITEM_ROYAL_1 "That is tragic. How did this happen?" -#define GOSSIP_ITEM_ROYAL_2 "Interesting, continue please." -#define GOSSIP_ITEM_ROYAL_3 "Unbelievable! How dare they??" -#define GOSSIP_ITEM_ROYAL_4 "Of course I will help!" - -class npc_royal_historian_archesonus : public CreatureScript -{ -public: - npc_royal_historian_archesonus() : CreatureScript("npc_royal_historian_archesonus") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - switch (action) - { - case GOSSIP_ACTION_INFO_DEF: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ROYAL_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - player->SEND_GOSSIP_MENU(2236, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+1: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ROYAL_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - player->SEND_GOSSIP_MENU(2237, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ROYAL_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - player->SEND_GOSSIP_MENU(2238, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ROYAL_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); - player->SEND_GOSSIP_MENU(2239, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - player->CLOSE_GOSSIP_MENU(); - player->AreaExploredOrEventHappens(3702); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(3702) == QUEST_STATUS_INCOMPLETE) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ROYAL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - player->SEND_GOSSIP_MENU(2235, creature->GetGUID()); - } - else - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - - return true; - } -}; - void AddSC_ironforge() { - new npc_royal_historian_archesonus(); } diff --git a/src/server/scripts/EasternKingdoms/loch_modan.cpp b/src/server/scripts/EasternKingdoms/loch_modan.cpp index 4e3aaae71a1..32862a2d7b0 100644 --- a/src/server/scripts/EasternKingdoms/loch_modan.cpp +++ b/src/server/scripts/EasternKingdoms/loch_modan.cpp @@ -18,88 +18,18 @@ /* ScriptData SDName: Loch_Modan -SD%Complete: 100 -SDComment: Quest support: 3181 +SD%Complete: 0 +SDComment: SDCategory: Loch Modan EndScriptData */ /* ContentData -npc_mountaineer_pebblebitty EndContentData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "ScriptedGossip.h" -/*###### -## npc_mountaineer_pebblebitty -######*/ - -#define GOSSIP_MP "Open the gate please, i need to get to Searing Gorge" - -#define GOSSIP_MP1 "But i need to get there, now open the gate!" -#define GOSSIP_MP2 "Ok, so what is this other way?" -#define GOSSIP_MP3 "Doesn't matter, i'm invulnerable." -#define GOSSIP_MP4 "Yes..." -#define GOSSIP_MP5 "Ok, i'll try to remember that." -#define GOSSIP_MP6 "A key? Ok!" - -class npc_mountaineer_pebblebitty : public CreatureScript -{ -public: - npc_mountaineer_pebblebitty() : CreatureScript("npc_mountaineer_pebblebitty") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - switch (action) - { - case GOSSIP_ACTION_INFO_DEF+1: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - player->SEND_GOSSIP_MENU(1833, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - player->SEND_GOSSIP_MENU(1834, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); - player->SEND_GOSSIP_MENU(1835, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); - player->SEND_GOSSIP_MENU(1836, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+5: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); - player->SEND_GOSSIP_MENU(1837, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+6: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7); - player->SEND_GOSSIP_MENU(1838, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+7: - player->CLOSE_GOSSIP_MENU(); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (!player->GetQuestRewardStatus(3181) == 1) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - - return true; - } -}; - void AddSC_loch_modan() { - new npc_mountaineer_pebblebitty(); } diff --git a/src/server/scripts/EasternKingdoms/redridge_mountains.cpp b/src/server/scripts/EasternKingdoms/redridge_mountains.cpp index 2473fec899a..81223dad1d3 100644 --- a/src/server/scripts/EasternKingdoms/redridge_mountains.cpp +++ b/src/server/scripts/EasternKingdoms/redridge_mountains.cpp @@ -17,156 +17,14 @@ /* Script Data Start SDName: Redridge Mountains -SD%Complete: 100% -SDComment: Support for quest 219. +SD%Complete: 0 +SDComment: Script Data End */ #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "ScriptedEscortAI.h" -enum eCorporalKeeshan -{ - QUEST_MISSING_IN_ACTION = 219, - - SAY_CORPORAL_1 = -1000464, - SAY_CORPORAL_2 = -1000465, - SAY_CORPORAL_3 = -1000466, - SAY_CORPORAL_4 = -1000467, - SAY_CORPORAL_5 = -1000468, - - SPELL_MOCKING_BLOW = 21008, - SPELL_SHIELD_BASH = 11972, -}; - -class npc_corporal_keeshan : public CreatureScript -{ -public: - npc_corporal_keeshan() : CreatureScript("npc_corporal_keeshan") { } - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - if (quest->GetQuestId() == QUEST_MISSING_IN_ACTION) - { - CAST_AI(npc_corporal_keeshan::npc_corporal_keeshanAI, creature->AI())->Start(true, false, player->GetGUID(), quest); - DoScriptText(SAY_CORPORAL_1, creature); - } - - return false; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_corporal_keeshanAI(creature); - } - - struct npc_corporal_keeshanAI : public npc_escortAI - { - npc_corporal_keeshanAI(Creature* creature) : npc_escortAI(creature) {} - - uint32 uiPhase; - uint32 uiTimer; - uint32 uiMockingBlowTimer; - uint32 uiShieldBashTimer; - - void Reset() - { - uiTimer = 0; - uiPhase = 0; - uiMockingBlowTimer = 5000; - uiShieldBashTimer = 8000; - } - - void WaypointReached(uint32 waypointId) - { - Player* player = GetPlayerForEscort(); - if (!player) - return; - - if (waypointId >= 65 && me->GetUnitMovementFlags() == MOVEMENTFLAG_WALKING) - me->SetWalk(false); - - switch (waypointId) - { - case 39: - SetEscortPaused(true); - uiTimer = 2000; - uiPhase = 1; - break; - case 65: - me->SetWalk(false); - break; - case 115: - player->AreaExploredOrEventHappens(QUEST_MISSING_IN_ACTION); - uiTimer = 2000; - uiPhase = 4; - break; - } - } - - void UpdateAI(const uint32 uiDiff) - { - if (HasEscortState(STATE_ESCORT_NONE)) - return; - - npc_escortAI::UpdateAI(uiDiff); - - if (uiPhase) - { - if (uiTimer <= uiDiff) - { - switch (uiPhase) - { - case 1: - me->SetStandState(UNIT_STAND_STATE_SIT); - uiTimer = 1000; - uiPhase = 2; - break; - case 2: - DoScriptText(SAY_CORPORAL_2, me); - uiTimer = 15000; - uiPhase = 3; - break; - case 3: - DoScriptText(SAY_CORPORAL_3, me); - me->SetStandState(UNIT_STAND_STATE_STAND); - SetEscortPaused(false); - uiTimer = 0; - uiPhase = 0; - break; - case 4: - DoScriptText(SAY_CORPORAL_4, me); - uiTimer = 2500; - uiPhase = 5; - case 5: - DoScriptText(SAY_CORPORAL_5, me); - uiTimer = 0; - uiPhase = 0; - } - } else uiTimer -= uiDiff; - } - - if (!UpdateVictim()) - return; - - if (uiMockingBlowTimer <= uiDiff) - { - DoCast(me->getVictim(), SPELL_MOCKING_BLOW); - uiMockingBlowTimer = 5000; - } else uiMockingBlowTimer -= uiDiff; - - if (uiShieldBashTimer <= uiDiff) - { - DoCast(me->getVictim(), SPELL_MOCKING_BLOW); - uiShieldBashTimer = 8000; - } else uiShieldBashTimer -= uiDiff; - - DoMeleeAttackIfReady(); - } - }; -}; - void AddSC_redridge_mountains() { - new npc_corporal_keeshan(); } diff --git a/src/server/scripts/EasternKingdoms/silverpine_forest.cpp b/src/server/scripts/EasternKingdoms/silverpine_forest.cpp index 870cb29c28d..8f5925405ec 100644 --- a/src/server/scripts/EasternKingdoms/silverpine_forest.cpp +++ b/src/server/scripts/EasternKingdoms/silverpine_forest.cpp @@ -19,13 +19,12 @@ /* ScriptData SDName: Silverpine_Forest SD%Complete: 100 -SDComment: Quest support: 435, 452 +SDComment: Quest support: 435 SDCategory: Silverpine Forest EndScriptData */ /* ContentData npc_deathstalker_erland -pyrewood_ambush EndContentData */ #include "ScriptMgr.h" @@ -135,191 +134,6 @@ public: } }; -/*###### -## pyrewood_ambush -#######*/ - -#define QUEST_PYREWOOD_AMBUSH 452 - -#define NPCSAY_INIT "Get ready, they'll be arriving any minute..." //not blizzlike -#define NPCSAY_END "Thanks for your help!" //not blizzlike - -static float PyrewoodSpawnPoints[3][4] = -{ - //pos_x pos_y pos_z orien - //outside - /* - {-400.85f, 1513.64f, 18.67f, 0}, - {-397.32f, 1514.12f, 18.67f, 0}, - {-397.44f, 1511.09f, 18.67f, 0}, - */ - //door - {-396.17f, 1505.86f, 19.77f, 0}, - {-396.91f, 1505.77f, 19.77f, 0}, - {-397.94f, 1504.74f, 19.77f, 0}, -}; - -#define WAIT_SECS 6000 - -class pyrewood_ambush : public CreatureScript -{ -public: - pyrewood_ambush() : CreatureScript("pyrewood_ambush") { } - - bool OnQuestAccept(Player* player, Creature* creature, const Quest *quest) - { - if (quest->GetQuestId() == QUEST_PYREWOOD_AMBUSH && !CAST_AI(pyrewood_ambush::pyrewood_ambushAI, creature->AI())->QuestInProgress) - { - CAST_AI(pyrewood_ambush::pyrewood_ambushAI, creature->AI())->QuestInProgress = true; - CAST_AI(pyrewood_ambush::pyrewood_ambushAI, creature->AI())->Phase = 0; - CAST_AI(pyrewood_ambush::pyrewood_ambushAI, creature->AI())->KillCount = 0; - CAST_AI(pyrewood_ambush::pyrewood_ambushAI, creature->AI())->PlayerGUID = player->GetGUID(); - } - - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new pyrewood_ambushAI (creature); - } - - struct pyrewood_ambushAI : public ScriptedAI - { - pyrewood_ambushAI(Creature* creature) : ScriptedAI(creature), Summons(me) - { - QuestInProgress = false; - } - - uint32 Phase; - int8 KillCount; - uint32 WaitTimer; - uint64 PlayerGUID; - SummonList Summons; - - bool QuestInProgress; - - void Reset() - { - WaitTimer = WAIT_SECS; - - if (!QuestInProgress) //fix reset values (see UpdateVictim) - { - Phase = 0; - KillCount = 0; - PlayerGUID = 0; - Summons.DespawnAll(); - } - } - - void EnterCombat(Unit* /*who*/){} - - void JustSummoned(Creature* summoned) - { - Summons.Summon(summoned); - ++KillCount; - } - - void SummonedCreatureDespawn(Creature* summoned) - { - Summons.Despawn(summoned); - --KillCount; - } - - void SummonCreatureWithRandomTarget(uint32 creatureId, int position) - { - if (Creature* summoned = me->SummonCreature(creatureId, PyrewoodSpawnPoints[position][0], PyrewoodSpawnPoints[position][1], PyrewoodSpawnPoints[position][2], PyrewoodSpawnPoints[position][3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000)) - { - Player* player = NULL; - Unit* target = NULL; - if (PlayerGUID) - { - player = Unit::GetPlayer(*me, PlayerGUID); - if (player) - target = RAND((Unit*)me, (Unit*)player); - } else - target = me; - - if (target) - { - summoned->setFaction(168); - summoned->AddThreat(target, 32.0f); - summoned->AI()->AttackStart(target); - } - } - } - - void JustDied(Unit* /*killer*/) - { - if (PlayerGUID) - if (Player* player = Unit::GetPlayer(*me, PlayerGUID)) - if (player->GetQuestStatus(QUEST_PYREWOOD_AMBUSH) == QUEST_STATUS_INCOMPLETE) - player->FailQuest(QUEST_PYREWOOD_AMBUSH); - } - - void UpdateAI(const uint32 diff) - { - //sLog->outInfo(LOG_FILTER_TSCR, "DEBUG: p(%i) k(%i) d(%u) W(%i)", Phase, KillCount, diff, WaitTimer); - - if (!QuestInProgress) - return; - - if (KillCount && Phase < 6) - { - if (!UpdateVictim()) //reset() on target Despawn... - return; - - DoMeleeAttackIfReady(); - return; - } - - switch (Phase) - { - case 0: - if (WaitTimer == WAIT_SECS) - me->MonsterSay(NPCSAY_INIT, LANG_UNIVERSAL, 0); //no blizzlike - - if (WaitTimer <= diff) - { - WaitTimer -= diff; - return; - } - break; - case 1: - SummonCreatureWithRandomTarget(2060, 1); - break; - case 2: - SummonCreatureWithRandomTarget(2061, 2); - SummonCreatureWithRandomTarget(2062, 0); - break; - case 3: - SummonCreatureWithRandomTarget(2063, 1); - SummonCreatureWithRandomTarget(2064, 2); - SummonCreatureWithRandomTarget(2065, 0); - break; - case 4: - SummonCreatureWithRandomTarget(2066, 1); - SummonCreatureWithRandomTarget(2067, 0); - SummonCreatureWithRandomTarget(2068, 2); - break; - case 5: //end - if (PlayerGUID) - { - if (Player* player = Unit::GetPlayer(*me, PlayerGUID)) - { - me->MonsterSay(NPCSAY_END, LANG_UNIVERSAL, 0); //not blizzlike - player->GroupEventHappens(QUEST_PYREWOOD_AMBUSH, me); - } - } - QuestInProgress = false; - Reset(); - break; - } - ++Phase; //prepare next phase - } - }; -}; - /*###### ## AddSC ######*/ @@ -327,5 +141,4 @@ public: void AddSC_silverpine_forest() { new npc_deathstalker_erland(); - new pyrewood_ambush(); } diff --git a/src/server/scripts/EasternKingdoms/stormwind_city.cpp b/src/server/scripts/EasternKingdoms/stormwind_city.cpp index 560214d4085..f5ade53202a 100644 --- a/src/server/scripts/EasternKingdoms/stormwind_city.cpp +++ b/src/server/scripts/EasternKingdoms/stormwind_city.cpp @@ -18,19 +18,12 @@ /* ScriptData SDName: Stormwind_City -SD%Complete: 100 -SDComment: Quest support: 1640, 1447, 4185, 11223, 434. +SD%Complete: 0 +SDComment: SDCategory: Stormwind City EndScriptData */ /* ContentData -npc_archmage_malin -npc_bartleby -npc_lady_katrana_prestor -npc_tyrion -npc_tyrion_spybot -npc_marzon_silent_blade -npc_lord_gregor_lescovar EndContentData */ #include "ScriptMgr.h" @@ -38,609 +31,7 @@ EndContentData */ #include "ScriptedGossip.h" #include "ScriptedEscortAI.h" -/*###### -## npc_archmage_malin -######*/ - -#define GOSSIP_ITEM_MALIN "Can you send me to Theramore? I have an urgent message for Lady Jaina from Highlord Bolvar." - -class npc_archmage_malin : public CreatureScript -{ -public: - npc_archmage_malin() : CreatureScript("npc_archmage_malin") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_INFO_DEF) - { - player->CLOSE_GOSSIP_MENU(); - creature->CastSpell(player, 42711, true); - } - - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(11223) == QUEST_STATUS_COMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_MALIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - - return true; - } -}; - -/*###### -## npc_bartleby -######*/ - -enum eBartleby -{ - FACTION_ENEMY = 168, - QUEST_BEAT = 1640 -}; - -class npc_bartleby : public CreatureScript -{ -public: - npc_bartleby() : CreatureScript("npc_bartleby") { } - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - if (quest->GetQuestId() == QUEST_BEAT) - { - creature->setFaction(FACTION_ENEMY); - creature->AI()->AttackStart(player); - } - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_bartlebyAI(creature); - } - - struct npc_bartlebyAI : public ScriptedAI - { - npc_bartlebyAI(Creature* creature) : ScriptedAI(creature) - { - m_uiNormalFaction = creature->getFaction(); - } - - uint32 m_uiNormalFaction; - - void Reset() - { - if (me->getFaction() != m_uiNormalFaction) - me->setFaction(m_uiNormalFaction); - } - - void AttackedBy(Unit* pAttacker) - { - if (me->getVictim()) - return; - - if (me->IsFriendlyTo(pAttacker)) - return; - - AttackStart(pAttacker); - } - - void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) - { - if (uiDamage > me->GetHealth() || me->HealthBelowPctDamaged(15, uiDamage)) - { - //Take 0 damage - uiDamage = 0; - - if (pDoneBy->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(pDoneBy)->AreaExploredOrEventHappens(QUEST_BEAT); - EnterEvadeMode(); - } - } - }; -}; - -/*###### -## npc_lady_katrana_prestor -######*/ - -#define GOSSIP_ITEM_KAT_1 "Pardon the intrusion, Lady Prestor, but Highlord Bolvar suggested that I seek your advice." -#define GOSSIP_ITEM_KAT_2 "My apologies, Lady Prestor." -#define GOSSIP_ITEM_KAT_3 "Begging your pardon, Lady Prestor. That was not my intent." -#define GOSSIP_ITEM_KAT_4 "Thank you for your time, Lady Prestor." - -class npc_lady_katrana_prestor : public CreatureScript -{ -public: - npc_lady_katrana_prestor() : CreatureScript("npc_lady_katrana_prestor") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - switch (action) - { - case GOSSIP_ACTION_INFO_DEF: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAT_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - player->SEND_GOSSIP_MENU(2694, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+1: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAT_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - player->SEND_GOSSIP_MENU(2695, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAT_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - player->SEND_GOSSIP_MENU(2696, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - player->CLOSE_GOSSIP_MENU(); - player->AreaExploredOrEventHappens(4185); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(4185) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAT_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - player->SEND_GOSSIP_MENU(2693, creature->GetGUID()); - - return true; - } -}; - -/*###### -## npc_lord_gregor_lescovar -######*/ - -enum eLordGregorLescovar -{ - SAY_LESCOVAR_2 = -1000457, - SAY_GUARD_2 = -1000458, - SAY_LESCOVAR_3 = -1000459, - SAY_MARZON_1 = -1000460, - SAY_LESCOVAR_4 = -1000461, - SAY_TYRION_2 = -1000462, - SAY_MARZON_2 = -1000463, - - NPC_STORMWIND_ROYAL = 1756, - NPC_MARZON_BLADE = 1755, - NPC_TYRION = 7766, - - QUEST_THE_ATTACK = 434 -}; - -class npc_lord_gregor_lescovar : public CreatureScript -{ -public: - npc_lord_gregor_lescovar() : CreatureScript("npc_lord_gregor_lescovar") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_lord_gregor_lescovarAI(creature); - } - - struct npc_lord_gregor_lescovarAI : public npc_escortAI - { - npc_lord_gregor_lescovarAI(Creature* creature) : npc_escortAI(creature) - { - creature->RestoreFaction(); - } - - uint32 uiTimer; - uint32 uiPhase; - - uint64 MarzonGUID; - - void Reset() - { - uiTimer = 0; - uiPhase = 0; - - MarzonGUID = 0; - } - - void EnterEvadeMode() - { - me->DisappearAndDie(); - - if (Creature* pMarzon = Unit::GetCreature(*me, MarzonGUID)) - { - if (pMarzon->isAlive()) - pMarzon->DisappearAndDie(); - } - } - - void EnterCombat(Unit* who) - { - if (Creature* pMarzon = Unit::GetCreature(*me, MarzonGUID)) - { - if (pMarzon->isAlive() && !pMarzon->isInCombat()) - pMarzon->AI()->AttackStart(who); - } - } - - void WaypointReached(uint32 waypointId) - { - switch (waypointId) - { - case 14: - SetEscortPaused(true); - DoScriptText(SAY_LESCOVAR_2, me); - uiTimer = 3000; - uiPhase = 1; - break; - case 16: - SetEscortPaused(true); - if (Creature* pMarzon = me->SummonCreature(NPC_MARZON_BLADE, -8411.360352f, 480.069733f, 123.760895f, 4.941504f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1000)) - { - pMarzon->GetMotionMaster()->MovePoint(0, -8408.000977f, 468.611450f, 123.759903f); - MarzonGUID = pMarzon->GetGUID(); - } - uiTimer = 2000; - uiPhase = 4; - break; - } - } - //TO-DO: We don't have movemaps, also we can't make 2 npcs walks to one point propperly (and we can not use escort ai, because they are 2 different spawns and with same entry), because of it we make them, disappear. - void DoGuardsDisappearAndDie() - { - std::list GuardList; - me->GetCreatureListWithEntryInGrid(GuardList, NPC_STORMWIND_ROYAL, 8.0f); - if (!GuardList.empty()) - { - for (std::list::const_iterator itr = GuardList.begin(); itr != GuardList.end(); ++itr) - { - if (Creature* pGuard = *itr) - pGuard->DisappearAndDie(); - } - } - } - - void UpdateAI(const uint32 uiDiff) - { - if (uiPhase) - { - if (uiTimer <= uiDiff) - { - switch (uiPhase) - { - case 1: - if (Creature* pGuard = me->FindNearestCreature(NPC_STORMWIND_ROYAL, 8.0f, true)) - DoScriptText(SAY_GUARD_2, pGuard); - uiTimer = 3000; - uiPhase = 2; - break; - case 2: - DoGuardsDisappearAndDie(); - uiTimer = 2000; - uiPhase = 3; - break; - case 3: - SetEscortPaused(false); - uiTimer = 0; - uiPhase = 0; - break; - case 4: - DoScriptText(SAY_LESCOVAR_3, me); - uiTimer = 0; - uiPhase = 0; - break; - case 5: - if (Creature* pMarzon = Unit::GetCreature(*me, MarzonGUID)) - DoScriptText(SAY_MARZON_1, pMarzon); - uiTimer = 3000; - uiPhase = 6; - break; - case 6: - DoScriptText(SAY_LESCOVAR_4, me); - if (Player* player = GetPlayerForEscort()) - player->AreaExploredOrEventHappens(QUEST_THE_ATTACK); - uiTimer = 2000; - uiPhase = 7; - break; - case 7: - if (Creature* pTyrion = me->FindNearestCreature(NPC_TYRION, 20.0f, true)) - DoScriptText(SAY_TYRION_2, pTyrion); - if (Creature* pMarzon = Unit::GetCreature(*me, MarzonGUID)) - pMarzon->setFaction(14); - me->setFaction(14); - uiTimer = 0; - uiPhase = 0; - break; - } - } else uiTimer -= uiDiff; - } - npc_escortAI::UpdateAI(uiDiff); - - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - }; -}; - -/*###### -## npc_marzon_silent_blade -######*/ - -class npc_marzon_silent_blade : public CreatureScript -{ -public: - npc_marzon_silent_blade() : CreatureScript("npc_marzon_silent_blade") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_marzon_silent_bladeAI(creature); - } - - struct npc_marzon_silent_bladeAI : public ScriptedAI - { - npc_marzon_silent_bladeAI(Creature* creature) : ScriptedAI(creature) - { - me->SetWalk(true); - } - - void Reset() - { - me->RestoreFaction(); - } - - void EnterCombat(Unit* who) - { - DoScriptText(SAY_MARZON_2, me); - - if (me->isSummon()) - { - if (Unit* summoner = me->ToTempSummon()->GetSummoner()) - { - if (summoner->GetTypeId() == TYPEID_UNIT && summoner->isAlive() && !summoner->isInCombat()) - summoner->ToCreature()->AI()->AttackStart(who); - } - } - } - - void EnterEvadeMode() - { - me->DisappearAndDie(); - - if (me->isSummon()) - { - if (Unit* summoner = me->ToTempSummon()->GetSummoner()) - { - if (summoner->GetTypeId() == TYPEID_UNIT && summoner->isAlive()) - summoner->ToCreature()->DisappearAndDie(); - } - } - } - - void MovementInform(uint32 uiType, uint32 /*uiId*/) - { - if (uiType != POINT_MOTION_TYPE) - return; - - if (me->isSummon()) - { - Unit* summoner = me->ToTempSummon()->GetSummoner(); - if (summoner && summoner->GetTypeId() == TYPEID_UNIT && summoner->IsAIEnabled) - { - npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI* ai = - CAST_AI(npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI, summoner->GetAI()); - if (ai) - { - ai->uiTimer = 2000; - ai->uiPhase = 5; - } - //me->ChangeOrient(0.0f, summoner); - } - } - } - - void UpdateAI(const uint32 /*diff*/) - { - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - }; -}; - -/*###### -## npc_tyrion_spybot -######*/ - -enum eTyrionSpybot -{ - SAY_QUEST_ACCEPT_ATTACK = -1000499, - SAY_TYRION_1 = -1000450, - SAY_SPYBOT_1 = -1000451, - SAY_GUARD_1 = -1000452, - SAY_SPYBOT_2 = -1000453, - SAY_SPYBOT_3 = -1000454, - SAY_LESCOVAR_1 = -1000455, - SAY_SPYBOT_4 = -1000456, - - NPC_PRIESTESS_TYRIONA = 7779, - NPC_LORD_GREGOR_LESCOVAR = 1754, -}; - -class npc_tyrion_spybot : public CreatureScript -{ -public: - npc_tyrion_spybot() : CreatureScript("npc_tyrion_spybot") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_tyrion_spybotAI(creature); - } - - struct npc_tyrion_spybotAI : public npc_escortAI - { - npc_tyrion_spybotAI(Creature* creature) : npc_escortAI(creature) {} - - uint32 uiTimer; - uint32 uiPhase; - - void Reset() - { - uiTimer = 0; - uiPhase = 0; - } - - void WaypointReached(uint32 waypointId) - { - switch (waypointId) - { - case 1: - SetEscortPaused(true); - uiTimer = 2000; - uiPhase = 1; - break; - case 5: - SetEscortPaused(true); - DoScriptText(SAY_SPYBOT_1, me); - uiTimer = 2000; - uiPhase = 5; - break; - case 17: - SetEscortPaused(true); - DoScriptText(SAY_SPYBOT_3, me); - uiTimer = 3000; - uiPhase = 8; - break; - } - } - - void UpdateAI(const uint32 uiDiff) - { - if (uiPhase) - { - if (uiTimer <= uiDiff) - { - switch (uiPhase) - { - case 1: - DoScriptText(SAY_QUEST_ACCEPT_ATTACK, me); - uiTimer = 3000; - uiPhase = 2; - break; - case 2: - if (Creature* pTyrion = me->FindNearestCreature(NPC_TYRION, 10.0f)) - DoScriptText(SAY_TYRION_1, pTyrion); - uiTimer = 3000; - uiPhase = 3; - break; - case 3: - me->UpdateEntry(NPC_PRIESTESS_TYRIONA, ALLIANCE); - uiTimer = 2000; - uiPhase = 4; - break; - case 4: - SetEscortPaused(false); - uiPhase = 0; - uiTimer = 0; - break; - case 5: - if (Creature* pGuard = me->FindNearestCreature(NPC_STORMWIND_ROYAL, 10.0f, true)) - DoScriptText(SAY_GUARD_1, pGuard); - uiTimer = 3000; - uiPhase = 6; - break; - case 6: - DoScriptText(SAY_SPYBOT_2, me); - uiTimer = 3000; - uiPhase = 7; - break; - case 7: - SetEscortPaused(false); - uiTimer = 0; - uiPhase = 0; - break; - case 8: - if (Creature* pLescovar = me->FindNearestCreature(NPC_LORD_GREGOR_LESCOVAR, 10.0f)) - DoScriptText(SAY_LESCOVAR_1, pLescovar); - uiTimer = 3000; - uiPhase = 9; - break; - case 9: - DoScriptText(SAY_SPYBOT_4, me); - uiTimer = 3000; - uiPhase = 10; - break; - case 10: - if (Creature* pLescovar = me->FindNearestCreature(NPC_LORD_GREGOR_LESCOVAR, 10.0f)) - { - if (Player* player = GetPlayerForEscort()) - { - CAST_AI(npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI, pLescovar->AI())->Start(false, false, player->GetGUID()); - CAST_AI(npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI, pLescovar->AI())->SetMaxPlayerDistance(200.0f); - } - } - me->DisappearAndDie(); - uiTimer = 0; - uiPhase = 0; - break; - } - } else uiTimer -= uiDiff; - } - npc_escortAI::UpdateAI(uiDiff); - - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - }; -}; - -/*###### -## npc_tyrion -######*/ - -enum eTyrion -{ - NPC_TYRION_SPYBOT = 8856 -}; - -class npc_tyrion : public CreatureScript -{ -public: - npc_tyrion() : CreatureScript("npc_tyrion") { } - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - if (quest->GetQuestId() == QUEST_THE_ATTACK) - { - if (Creature* pSpybot = creature->FindNearestCreature(NPC_TYRION_SPYBOT, 5.0f, true)) - { - CAST_AI(npc_tyrion_spybot::npc_tyrion_spybotAI, pSpybot->AI())->Start(false, false, player->GetGUID()); - CAST_AI(npc_tyrion_spybot::npc_tyrion_spybotAI, pSpybot->AI())->SetMaxPlayerDistance(200.0f); - } - return true; - } - return false; - } -}; void AddSC_stormwind_city() { - new npc_archmage_malin(); - new npc_bartleby(); - new npc_lady_katrana_prestor(); - new npc_tyrion(); - new npc_tyrion_spybot(); - new npc_lord_gregor_lescovar(); - new npc_marzon_silent_blade(); } diff --git a/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp b/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp index 4c81380fb60..9724588039f 100644 --- a/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp +++ b/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp @@ -20,136 +20,6 @@ #include "ScriptedCreature.h" #include "ScriptedEscortAI.h" -/*###### -## npc_galen_goodward -######*/ - -enum Galen -{ - QUEST_GALENS_ESCAPE = 1393, - - GO_GALENS_CAGE = 37118, - - SAY_PERIODIC = -1000500, - SAY_QUEST_ACCEPTED = -1000501, - SAY_ATTACKED_1 = -1000502, - SAY_ATTACKED_2 = -1000503, - SAY_QUEST_COMPLETE = -1000504, - EMOTE_WHISPER = -1000505, - EMOTE_DISAPPEAR = -1000506 -}; - -class npc_galen_goodward : public CreatureScript -{ -public: - - npc_galen_goodward() : CreatureScript("npc_galen_goodward") { } - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - if (quest->GetQuestId() == QUEST_GALENS_ESCAPE) - { - CAST_AI(npc_galen_goodward::npc_galen_goodwardAI, creature->AI())->Start(false, false, player->GetGUID()); - creature->setFaction(FACTION_ESCORT_N_NEUTRAL_ACTIVE); - DoScriptText(SAY_QUEST_ACCEPTED, creature); - } - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_galen_goodwardAI(creature); - } - - struct npc_galen_goodwardAI : public npc_escortAI - { - npc_galen_goodwardAI(Creature* creature) : npc_escortAI(creature) - { - m_uiGalensCageGUID = 0; - Reset(); - } - - uint64 m_uiGalensCageGUID; - uint32 m_uiPeriodicSay; - - void Reset() - { - m_uiPeriodicSay = 6000; - } - - void EnterCombat(Unit* who) - { - if (HasEscortState(STATE_ESCORT_ESCORTING)) - DoScriptText(RAND(SAY_ATTACKED_1, SAY_ATTACKED_2), me, who); - } - - void WaypointStart(uint32 uiPointId) - { - switch (uiPointId) - { - case 0: - { - GameObject* pCage = NULL; - if (m_uiGalensCageGUID) - pCage = me->GetMap()->GetGameObject(m_uiGalensCageGUID); - else - pCage = GetClosestGameObjectWithEntry(me, GO_GALENS_CAGE, INTERACTION_DISTANCE); - if (pCage) - { - pCage->UseDoorOrButton(); - m_uiGalensCageGUID = pCage->GetGUID(); - } - break; - } - case 21: - DoScriptText(EMOTE_DISAPPEAR, me); - break; - } - } - - void WaypointReached(uint32 waypointId) - { - switch (waypointId) - { - case 0: - if (GameObject* pCage = me->GetMap()->GetGameObject(m_uiGalensCageGUID)) - pCage->ResetDoorOrButton(); - break; - case 20: - if (Player* player = GetPlayerForEscort()) - { - me->SetFacingToObject(player); - DoScriptText(SAY_QUEST_COMPLETE, me, player); - DoScriptText(EMOTE_WHISPER, me, player); - player->GroupEventHappens(QUEST_GALENS_ESCAPE, me); - } - SetRun(true); - break; - } - } - - void UpdateAI(const uint32 uiDiff) - { - npc_escortAI::UpdateAI(uiDiff); - - if (HasEscortState(STATE_ESCORT_NONE)) - return; - - if (m_uiPeriodicSay < uiDiff) - { - if (!HasEscortState(STATE_ESCORT_ESCORTING)) - DoScriptText(SAY_PERIODIC, me); - m_uiPeriodicSay = 15000; - } - else - m_uiPeriodicSay -= uiDiff; - - DoMeleeAttackIfReady(); - } - }; -}; - void AddSC_swamp_of_sorrows() { - new npc_galen_goodward(); } diff --git a/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp b/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp index 70f9f93c7a7..cbefd115739 100644 --- a/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp +++ b/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp @@ -18,199 +18,18 @@ /* ScriptData SDName: Tirisfal_Glades -SD%Complete: 100 -SDComment: Quest support: 590, 1819 +SD%Complete: 0 +SDComment: SDCategory: Tirisfal Glades EndScriptData */ /* ContentData -npc_calvin_montague -go_mausoleum_door -go_mausoleum_trigger EndContentData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" -/*###### -## npc_calvin_montague -######*/ - -enum eCalvin -{ - SAY_COMPLETE = -1000431, - SPELL_DRINK = 2639, // possibly not correct spell (but iconId is correct) - QUEST_590 = 590, - FACTION_HOSTILE = 168 -}; - -class npc_calvin_montague : public CreatureScript -{ -public: - npc_calvin_montague() : CreatureScript("npc_calvin_montague") { } - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - if (quest->GetQuestId() == QUEST_590) - { - creature->setFaction(FACTION_HOSTILE); - creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); - CAST_AI(npc_calvin_montague::npc_calvin_montagueAI, creature->AI())->AttackStart(player); - } - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_calvin_montagueAI (creature); - } - - struct npc_calvin_montagueAI : public ScriptedAI - { - npc_calvin_montagueAI(Creature* creature) : ScriptedAI(creature) { } - - uint32 m_uiPhase; - uint32 m_uiPhaseTimer; - uint64 m_uiPlayerGUID; - - void Reset() - { - m_uiPhase = 0; - m_uiPhaseTimer = 5000; - m_uiPlayerGUID = 0; - - me->RestoreFaction(); - - if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC)) - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); - } - - void EnterCombat(Unit* /*who*/) {} - - void AttackedBy(Unit* pAttacker) - { - if (me->getVictim() || me->IsFriendlyTo(pAttacker)) - return; - - AttackStart(pAttacker); - } - - void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) - { - if (uiDamage > me->GetHealth() || me->HealthBelowPctDamaged(15, uiDamage)) - { - uiDamage = 0; - - me->RestoreFaction(); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); - me->CombatStop(true); - - m_uiPhase = 1; - - if (pDoneBy->GetTypeId() == TYPEID_PLAYER) - m_uiPlayerGUID = pDoneBy->GetGUID(); - } - } - - void UpdateAI(const uint32 uiDiff) - { - if (m_uiPhase) - { - if (m_uiPhaseTimer <= uiDiff) - m_uiPhaseTimer = 7500; - else - { - m_uiPhaseTimer -= uiDiff; - return; - } - - switch (m_uiPhase) - { - case 1: - DoScriptText(SAY_COMPLETE, me); - ++m_uiPhase; - break; - case 2: - if (Player* player = Unit::GetPlayer(*me, m_uiPlayerGUID)) - player->AreaExploredOrEventHappens(QUEST_590); - - DoCast(me, SPELL_DRINK, true); - ++m_uiPhase; - break; - case 3: - EnterEvadeMode(); - break; - } - - return; - } - - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - }; -}; - -/*###### -## go_mausoleum_door -## go_mausoleum_trigger -######*/ - -enum eMausoleum -{ - QUEST_ULAG = 1819, - NPC_ULAG = 6390, - GO_TRIGGER = 104593, - GO_DOOR = 176594 -}; - -class go_mausoleum_door : public GameObjectScript -{ -public: - go_mausoleum_door() : GameObjectScript("go_mausoleum_door") { } - - bool OnGossipHello(Player* player, GameObject* /*go*/) - { - if (player->GetQuestStatus(QUEST_ULAG) != QUEST_STATUS_INCOMPLETE) - return false; - - if (GameObject* pTrigger = player->FindNearestGameObject(GO_TRIGGER, 30.0f)) - { - pTrigger->SetGoState(GO_STATE_READY); - player->SummonCreature(NPC_ULAG, 2390.26f, 336.47f, 40.01f, 2.26f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 300000); - return false; - } - - return false; - } -}; - -class go_mausoleum_trigger : public GameObjectScript -{ -public: - go_mausoleum_trigger() : GameObjectScript("go_mausoleum_trigger") { } - - bool OnGossipHello(Player* player, GameObject* go) - { - if (player->GetQuestStatus(QUEST_ULAG) != QUEST_STATUS_INCOMPLETE) - return false; - - if (GameObject* pDoor = player->FindNearestGameObject(GO_DOOR, 30.0f)) - { - go->SetGoState(GO_STATE_ACTIVE); - pDoor->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_INTERACT_COND); - return true; - } - - return false; - } -}; void AddSC_tirisfal_glades() { - new npc_calvin_montague(); - new go_mausoleum_door(); - new go_mausoleum_trigger(); } -- cgit v1.2.3 From a3940f53102ae2bd0260480f4177eed47902c4ff Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 12 Aug 2012 21:16:31 +0100 Subject: Core/Spline: Add missing includes --- src/server/game/Movement/Spline/MovementPacketBuilder.cpp | 1 + src/server/game/Movement/Spline/MovementPacketBuilder.h | 5 +++++ 2 files changed, 6 insertions(+) (limited to 'src') diff --git a/src/server/game/Movement/Spline/MovementPacketBuilder.cpp b/src/server/game/Movement/Spline/MovementPacketBuilder.cpp index 4e16b2a6801..027c85cef36 100644 --- a/src/server/game/Movement/Spline/MovementPacketBuilder.cpp +++ b/src/server/game/Movement/Spline/MovementPacketBuilder.cpp @@ -1,4 +1,5 @@ /* + * Copyright (C) 2008-2012 TrinityCore * Copyright (C) 2005-2011 MaNGOS * * This program is free software; you can redistribute it and/or modify diff --git a/src/server/game/Movement/Spline/MovementPacketBuilder.h b/src/server/game/Movement/Spline/MovementPacketBuilder.h index 87a25dd0fdf..24b355924c8 100644 --- a/src/server/game/Movement/Spline/MovementPacketBuilder.h +++ b/src/server/game/Movement/Spline/MovementPacketBuilder.h @@ -1,4 +1,5 @@ /* + * Copyright (C) 2008-2012 TrinityCore * Copyright (C) 2005-2011 MaNGOS * * This program is free software; you can redistribute it and/or modify @@ -19,6 +20,10 @@ #ifndef TRINITYSERVER_PACKET_BUILDER_H #define TRINITYSERVER_PACKET_BUILDER_H +#include "Define.h" // for uint32 +#include "G3D/Vector3.h" +using G3D::Vector3; + class ByteBuffer; class WorldPacket; -- cgit v1.2.3 From 24b1a279858f912da85ef7146aafedb4e997f38c Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 12 Aug 2012 15:43:24 -0500 Subject: Core/Entities: Fixed block for Cataclysm --- src/server/game/Entities/Creature/Creature.h | 5 --- src/server/game/Entities/Player/Player.cpp | 14 ++---- src/server/game/Entities/Player/Player.h | 3 +- src/server/game/Entities/Unit/StatSystem.cpp | 11 ----- src/server/game/Entities/Unit/Unit.cpp | 65 ++++++---------------------- src/server/game/Entities/Unit/Unit.h | 19 ++------ src/server/game/Spells/SpellEffects.cpp | 17 +------- 7 files changed, 21 insertions(+), 113 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index 5f933bc6ca1..4b2582ec558 100755 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -525,11 +525,6 @@ class Creature : public Unit, public GridObject, public MapCreature bool SetDisableGravity(bool disable, bool packetOnly = false); bool SetHover(bool enable); - uint32 GetShieldBlockValue() const //dunno mob block value - { - return (getLevel()/2 + uint32(GetStat(STAT_STRENGTH)/20)); - } - SpellSchoolMask GetMeleeDamageSchoolMask() const { return m_meleeDamageSchoolMask; } void SetMeleeDamageSchool(SpellSchools school) { m_meleeDamageSchoolMask = SpellSchoolMask(1 << school); } diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index fb26bbc7b37..618ed545822 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -3270,7 +3270,9 @@ void Player::InitStatsForLevel(bool reapplyMods) SetFloatValue(PLAYER_PARRY_PERCENTAGE, 0.0f); SetFloatValue(PLAYER_BLOCK_PERCENTAGE, 0.0f); - SetUInt32Value(PLAYER_SHIELD_BLOCK, 0); + + // Static 30% damage blocked + SetUInt32Value(PLAYER_SHIELD_BLOCK, 30); // Dodge percentage SetFloatValue(PLAYER_DODGE_PERCENTAGE, 0.0f); @@ -5673,7 +5675,6 @@ void Player::HandleBaseModValue(BaseModGroup modGroup, BaseModType modType, floa case CRIT_PERCENTAGE: UpdateCritPercentage(BASE_ATTACK); break; case RANGED_CRIT_PERCENTAGE: UpdateCritPercentage(RANGED_ATTACK); break; case OFFHAND_CRIT_PERCENTAGE: UpdateCritPercentage(OFF_ATTACK); break; - case SHIELD_BLOCK_VALUE: UpdateShieldBlockValue(); break; default: break; } } @@ -5706,15 +5707,6 @@ float Player::GetTotalBaseModValue(BaseModGroup modGroup) const return m_auraBaseMod[modGroup][FLAT_MOD] * m_auraBaseMod[modGroup][PCT_MOD]; } -uint32 Player::GetShieldBlockValue() const -{ - float value = (m_auraBaseMod[SHIELD_BLOCK_VALUE][FLAT_MOD] + GetStat(STAT_STRENGTH) * 0.5f - 10)*m_auraBaseMod[SHIELD_BLOCK_VALUE][PCT_MOD]; - - value = (value < 0) ? 0 : value; - - return uint32(value); -} - float Player::GetMeleeCritFromAgility() { uint8 level = getLevel(); diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index a0bb5513028..ab4c738f119 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1940,7 +1940,6 @@ class Player : public Unit, public GridObject void UpdateMaxHealth(); void UpdateMaxPower(Powers power); void UpdateAttackPowerAndDamage(bool ranged = false); - void UpdateShieldBlockValue(); void UpdateDamagePhysical(WeaponAttackType attType); void ApplySpellPowerBonus(int32 amount, bool apply); void UpdateSpellDamageAndHealingBonus(); @@ -2128,7 +2127,7 @@ class Player : public Unit, public GridObject void UpdateCorpseReclaimDelay(); void SendCorpseReclaimDelay(bool load = false); - uint32 GetShieldBlockValue() const; // overwrite Unit version (virtual) + uint32 GetBlockPercent() { return GetUInt32Value(PLAYER_SHIELD_BLOCK); } bool CanParry() const { return m_canParry; } void SetCanParry(bool value); bool CanBlock() const { return m_canBlock; } diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index 4bc33dd10f1..18fa16488ea 100755 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -70,9 +70,6 @@ bool Player::UpdateStats(Stats stat) switch (stat) { - case STAT_STRENGTH: - UpdateShieldBlockValue(); - break; case STAT_AGILITY: UpdateArmor(); UpdateAllCritPercentages(); @@ -171,7 +168,6 @@ bool Player::UpdateAllStats() UpdateAllCritPercentages(); UpdateAllSpellCritChances(); UpdateDefenseBonusesMod(); - UpdateShieldBlockValue(); UpdateSpellDamageAndHealingBonus(); UpdateManaRegen(); UpdateExpertise(BASE_ATTACK); @@ -413,11 +409,6 @@ void Player::UpdateAttackPowerAndDamage(bool ranged) } } -void Player::UpdateShieldBlockValue() -{ - SetUInt32Value(PLAYER_SHIELD_BLOCK, GetShieldBlockValue()); -} - void Player::CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bool addTotalPct, float& min_damage, float& max_damage) { UnitMods unitMod; @@ -519,8 +510,6 @@ void Player::UpdateBlockPercentage() { // Base value value = 5.0f; - // Modify value from defense skill - value += (int32(GetDefenseSkillValue()) - int32(GetMaxSkillValueForLevel())) * 0.04f; // Increase from SPELL_AURA_MOD_BLOCK_PERCENT aura value += GetTotalAuraModifier(SPELL_AURA_MOD_BLOCK_PERCENT); // Increase from rating diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 06b082de155..a987b7b072f 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -988,12 +988,11 @@ void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage* damageInfo, int32 dama // Spell weapon based damage CAN BE crit & blocked at same time if (blocked) { - damageInfo->blocked = victim->GetShieldBlockValue(); // double blocked amount if block is critical + uint32 value = victim->GetBlockPercent(); if (victim->isBlockCritical()) - damageInfo->blocked += damageInfo->blocked; - if (damage < int32(damageInfo->blocked)) - damageInfo->blocked = uint32(damage); + value *= 2; // double blocked percent + damageInfo->blocked = CalculatePctN(damage, value); damage -= damageInfo->blocked; } @@ -1189,19 +1188,9 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam case MELEE_HIT_BLOCK: damageInfo->TargetState = VICTIMSTATE_HIT; damageInfo->HitInfo |= HITINFO_BLOCK; - damageInfo->procEx |= PROC_EX_BLOCK; - damageInfo->blocked_amount = damageInfo->target->GetShieldBlockValue(); - // double blocked amount if block is critical - if (damageInfo->target->isBlockCritical()) - damageInfo->blocked_amount+=damageInfo->blocked_amount; - if (damageInfo->blocked_amount >= damageInfo->damage) - { - damageInfo->TargetState = VICTIMSTATE_BLOCKS; - damageInfo->blocked_amount = damageInfo->damage; - damageInfo->procEx |= PROC_EX_FULL_BLOCK; - } - else - damageInfo->procEx |= PROC_EX_NORMAL_HIT; + damageInfo->procEx |= PROC_EX_BLOCK | PROC_EX_NORMAL_HIT; + // 30% damage blocked, double blocked amount if block is critical + damageInfo->blocked_amount = CalculatePctN(damageInfo->damage, damageInfo->target->isBlockCritical() ? damageInfo->target->GetBlockPercent() * 2 : damageInfo->target->GetBlockPercent()); damageInfo->damage -= damageInfo->blocked_amount; damageInfo->cleanDamage += damageInfo->blocked_amount; break; @@ -1916,7 +1905,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* victim, WeaponAttackTy // Miss chance based on melee //float miss_chance = MeleeMissChanceCalc(victim, attType); - float miss_chance = MeleeSpellMissChance(victim, attType, int32(GetWeaponSkillValue(attType, victim)) - int32(GetMaxSkillValueForLevel(this)), 0); + float miss_chance = MeleeSpellMissChance(victim, attType, 0); // Critical hit chance float crit_chance = GetUnitCriticalChance(attType, victim); @@ -2187,9 +2176,7 @@ bool Unit::isSpellBlocked(Unit* victim, SpellInfo const* spellProto, WeaponAttac victim->ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_BLOCK) return false; - float blockChance = victim->GetUnitBlockChance(); - blockChance += (int32(GetWeaponSkillValue(attackType)) - int32(victim->GetMaxSkillValueForLevel())) * 0.04f; - if (roll_chance_f(blockChance)) + if (roll_chance_f(victim->GetUnitBlockChance())) return true; } return false; @@ -2237,19 +2224,9 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit* victim, SpellInfo const* spell) if (spell->DmgClass == SPELL_DAMAGE_CLASS_RANGED) attType = RANGED_ATTACK; - int32 attackerWeaponSkill; - // skill value for these spells (for example judgements) is 5* level - if (spell->DmgClass == SPELL_DAMAGE_CLASS_RANGED && !spell->IsRangedWeaponSpell()) - attackerWeaponSkill = getLevel() * 5; - // bonus from skills is 0.04% per skill Diff - else - attackerWeaponSkill = int32(GetWeaponSkillValue(attType, victim)); - - int32 skillDiff = attackerWeaponSkill - int32(victim->GetMaxSkillValueForLevel(this)); - uint32 roll = urand (0, 10000); - uint32 missChance = uint32(MeleeSpellMissChance(victim, attType, skillDiff, spell->Id) * 100.0f); + uint32 missChance = uint32(MeleeSpellMissChance(victim, attType, spell->Id) * 100.0f); // Roll miss uint32 tmp = missChance; if (roll < tmp) @@ -2349,7 +2326,7 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit* victim, SpellInfo const* spell) if (canDodge) { // Roll dodge - int32 dodgeChance = int32(victim->GetUnitDodgeChance() * 100.0f) - skillDiff * 4; + int32 dodgeChance = int32(victim->GetUnitDodgeChance() * 100.0f); // Reduce enemy dodge chance by SPELL_AURA_MOD_COMBAT_RESULT_CHANCE dodgeChance += GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_COMBAT_RESULT_CHANCE, VICTIMSTATE_DODGE) * 100; dodgeChance = int32(float(dodgeChance) * GetTotalAuraMultiplier(SPELL_AURA_MOD_ENEMY_DODGE)); @@ -2368,7 +2345,7 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit* victim, SpellInfo const* spell) if (canParry) { // Roll parry - int32 parryChance = int32(victim->GetUnitParryChance() * 100.0f) - skillDiff * 4; + int32 parryChance = int32(victim->GetUnitParryChance() * 100.0f); // Reduce parry chance by attacker expertise rating if (GetTypeId() == TYPEID_PLAYER) parryChance -= int32(ToPlayer()->GetExpertiseDodgeOrParryReduction(attType) * 100.0f); @@ -2384,7 +2361,7 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit* victim, SpellInfo const* spell) if (canBlock) { - int32 blockChance = int32(victim->GetUnitBlockChance() * 100.0f) - skillDiff * 4; + int32 blockChance = int32(victim->GetUnitBlockChance() * 100.0f); if (blockChance < 0) blockChance = 0; tmp += blockChance; @@ -5856,14 +5833,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere target = this; break; } - // Damage Shield - if (dummySpell->SpellIconID == 3214) - { - triggered_spell_id = 59653; - // % of amount blocked - basepoints0 = CalculatePctN(int32(GetShieldBlockValue()), triggerAmount); - break; - } // Glyph of Blocking if (dummySpell->Id == 58375) { @@ -17012,7 +16981,7 @@ void Unit::ApplyResilience(Unit const* victim, float* crit, int32* damage, bool // Melee based spells can be miss, parry or dodge on this step // Crit or block - determined on damage calculation phase! (and can be both in some time) -float Unit::MeleeSpellMissChance(const Unit* victim, WeaponAttackType attType, int32 skillDiff, uint32 spellId) const +float Unit::MeleeSpellMissChance(const Unit* victim, WeaponAttackType attType, uint32 spellId) const { //calculate miss chance float missChance = victim->GetUnitMissChance(attType); @@ -17020,14 +16989,6 @@ float Unit::MeleeSpellMissChance(const Unit* victim, WeaponAttackType attType, i if (!spellId && haveOffhandWeapon()) missChance += 19; - // bonus from skills is 0.04% - //miss_chance -= skillDiff * 0.04f; - int32 diff = -skillDiff; - if (victim->GetTypeId() == TYPEID_PLAYER) - missChance += diff > 0 ? diff * 0.04f : diff * 0.02f; - else - missChance += diff > 10 ? 1 + (diff - 10) * 0.4f : diff * 0.1f; - // Calculate hit chance float hitChance = 100.0f; diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 96ee32274ef..00a1017daf6 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1455,7 +1455,7 @@ class Unit : public WorldObject void ApplyResilience(const Unit* victim, float * crit, int32 * damage, bool isCrit, CombatRating type) const; - float MeleeSpellMissChance(const Unit* victim, WeaponAttackType attType, int32 skillDiff, uint32 spellId) const; + float MeleeSpellMissChance(const Unit* victim, WeaponAttackType attType, uint32 spellId) const; SpellMissInfo MeleeSpellHitResult(Unit* victim, SpellInfo const* spell); SpellMissInfo MagicSpellHitResult(Unit* victim, SpellInfo const* spell); SpellMissInfo SpellHitResult(Unit* victim, SpellInfo const* spell, bool canReflect = false); @@ -1477,21 +1477,8 @@ class Unit : public WorldObject return true; } - virtual uint32 GetShieldBlockValue() const =0; - uint32 GetShieldBlockValue(uint32 soft_cap, uint32 hard_cap) const - { - uint32 value = GetShieldBlockValue(); - if (value >= hard_cap) - { - value = (soft_cap + hard_cap) / 2; - } - else if (value > soft_cap) - { - value = soft_cap + ((value - soft_cap) / 2); - } - - return value; - } + virtual uint32 GetBlockPercent() { return 30; } + uint32 GetUnitMeleeSkill(Unit const* target = NULL) const { return (target ? getLevelForTarget(target) : getLevel()) * 5; } uint32 GetDefenseSkillValue(Unit const* target = NULL) const; uint32 GetWeaponSkillValue(WeaponAttackType attType, Unit const* target = NULL) const; diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 909d47c4b92..058a7b5564c 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -383,15 +383,8 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex) } case SPELLFAMILY_WARRIOR: { - // Shield Slam - if (m_spellInfo->SpellFamilyFlags[1] & 0x200 && m_spellInfo->Category == 1209) - { - uint8 level = m_caster->getLevel(); - uint32 block_value = m_caster->GetShieldBlockValue(uint32(float(level) * 24.5f), uint32(float(level) * 34.5f)); - damage += int32(m_caster->ApplyEffectModifiers(m_spellInfo, effIndex, float(block_value))); - } // Victory Rush - else if (m_spellInfo->SpellFamilyFlags[1] & 0x100) + if (m_spellInfo->SpellFamilyFlags[1] & 0x100) ApplyPctF(damage, m_caster->GetTotalAttackPowerValue(BASE_ATTACK)); // Shockwave else if (m_spellInfo->Id == 46968) @@ -646,14 +639,6 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex) damage += count * int32(average * IN_MILLISECONDS) / m_caster->GetAttackTime(BASE_ATTACK); break; } - // Shield of Righteousness - if (m_spellInfo->SpellFamilyFlags[EFFECT_1] & 0x100000) - { - uint8 level = m_caster->getLevel(); - uint32 block_value = m_caster->GetShieldBlockValue(uint32(float(level) * 29.5f), uint32(float(level) * 39.5f)); - damage += CalculatePctN(block_value, m_spellInfo->Effects[EFFECT_1].CalcValue()); - break; - } break; } case SPELLFAMILY_DEATHKNIGHT: -- cgit v1.2.3 From 5cc8bc200b2419b552a478b3a3cea3a78463a3ab Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 12 Aug 2012 17:49:06 -0500 Subject: Core/Entities: Updated rage to Cataclysm --- src/server/game/Entities/Player/Player.cpp | 2 +- src/server/game/Entities/Unit/Unit.cpp | 50 +++++++----------------------- src/server/game/Entities/Unit/Unit.h | 2 +- 3 files changed, 14 insertions(+), 40 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 618ed545822..267d3dc6f7c 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -2563,7 +2563,7 @@ void Player::Regenerate(Powers power) if (!isInCombat() && !HasAuraType(SPELL_AURA_INTERRUPT_REGEN)) { float RageDecreaseRate = sWorld->getRate(RATE_POWER_RAGE_LOSS); - addvalue += -20 * RageDecreaseRate; // 2 rage by tick (= 2 seconds => 1 rage/sec) + addvalue += -25 * RageDecreaseRate; // 2.5 rage by tick (= 2 seconds => 1.25 rage/sec) } } break; diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index a987b7b072f..46614339775 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -591,34 +591,13 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam // Rage from Damage made (only from direct weapon damage) if (cleanDamage && damagetype == DIRECT_DAMAGE && this != victim && getPowerType() == POWER_RAGE) { - uint32 weaponSpeedHitFactor; - uint32 rage_damage = damage + cleanDamage->absorbed_damage; - + uint32 rage = uint32(GetAttackTime(cleanDamage->attackType) / 1000 * 8.125f); switch (cleanDamage->attackType) { - case BASE_ATTACK: - { - weaponSpeedHitFactor = uint32(GetAttackTime(cleanDamage->attackType) / 1000.0f * 3.5f); - if (cleanDamage->hitOutCome == MELEE_HIT_CRIT) - weaponSpeedHitFactor *= 2; - - RewardRage(rage_damage, weaponSpeedHitFactor, true); - - break; - } case OFF_ATTACK: - { - weaponSpeedHitFactor = uint32(GetAttackTime(cleanDamage->attackType) / 1000.0f * 1.75f); - if (cleanDamage->hitOutCome == MELEE_HIT_CRIT) - weaponSpeedHitFactor *= 2; - - RewardRage(rage_damage, weaponSpeedHitFactor, true); - - break; - } - case RANGED_ATTACK: - break; - default: + rage /= 2; + case BASE_ATTACK: + RewardRage(rage, true); break; } } @@ -627,7 +606,7 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam { // Rage from absorbed damage if (cleanDamage && cleanDamage->absorbed_damage && victim->getPowerType() == POWER_RAGE) - victim->RewardRage(cleanDamage->absorbed_damage, 0, false); + victim->RewardRage(cleanDamage->absorbed_damage, false); return 0; } @@ -730,7 +709,7 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam if (this != victim && victim->getPowerType() == POWER_RAGE) { uint32 rage_damage = damage + (cleanDamage ? cleanDamage->absorbed_damage : 0); - victim->RewardRage(rage_damage, 0, false); + victim->RewardRage(rage_damage, false); } if (GetTypeId() == TYPEID_PLAYER) @@ -17904,27 +17883,22 @@ void Unit::SendRemoveFromThreatListOpcode(HostileReference* pHostileReference) SendMessageToSet(&data, false); } -void Unit::RewardRage(uint32 damage, uint32 weaponSpeedHitFactor, bool attacker) +// baseRage means damage taken when attacker = false +void Unit::RewardRage(uint32 baseRage, bool attacker) { float addRage; - float rageconversion = ((0.0091107836f * getLevel() * getLevel()) + 3.225598133f * getLevel()) + 4.2652911f; - - // Unknown if correct, but lineary adjust rage conversion above level 70 - if (getLevel() > 70) - rageconversion += 13.27f * (getLevel() - 70); - if (attacker) { - addRage = (damage / rageconversion * 7.5f + weaponSpeedHitFactor) / 2; - + addRage = baseRage; // talent who gave more rage on attack AddPctN(addRage, GetTotalAuraModifier(SPELL_AURA_MOD_RAGE_FROM_DAMAGE_DEALT)); } else { - addRage = damage / rageconversion * 2.5f; - + // Calculate rage from health and damage taken + //! ToDo: Check formula + addRage = floor(0.5f + (25.7f * baseRage / GetMaxHealth())); // Berserker Rage effect if (HasAura(18499)) addRage *= 2.0f; diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 00a1017daf6..c5d411190dc 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -2178,7 +2178,7 @@ class Unit : public WorldObject bool IsFlying() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_FLYING | MOVEMENTFLAG_DISABLE_GRAVITY); } void SetCanFly(bool apply); - void RewardRage(uint32 damage, uint32 weaponSpeedHitFactor, bool attacker); + void RewardRage(uint32 baseRage, bool attacker); virtual float GetFollowAngle() const { return static_cast(M_PI/2); } -- cgit v1.2.3 From 29f8c1781bc711fa209113962aea58770474366c Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 12 Aug 2012 20:04:47 -0500 Subject: Core/Spells: Fixed: * Hot Streak * Improved Hot Streak * Ignite * And more * Removed some old scripts, and updated some more --- src/server/game/Entities/Unit/Unit.cpp | 195 ++++++--------------------------- src/server/game/Spells/Spell.cpp | 5 +- 2 files changed, 36 insertions(+), 164 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 46614339775..16d05608a4a 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -5556,6 +5556,19 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere triggered_spell_id = 69384; break; } + case 47020: // Enter vehicle XT-002 (Scrapbot) + { + if (GetTypeId() != TYPEID_UNIT) + return false; + + Unit* vehicleBase = GetVehicleBase(); + if (!vehicleBase) + return false; + + // Todo: Check if this amount is blizzlike + vehicleBase->ModifyHealth(int32(vehicleBase->CountPctFromMaxHealth(1))); + break; + } } break; } @@ -5607,7 +5620,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere break; } - // Hot Streak + // Hot Streak & Improved Hot Streak if (dummySpell->SpellIconID == 2999) { if (effIndex != 0) @@ -5615,12 +5628,12 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere AuraEffect* counter = triggeredByAura->GetBase()->GetEffect(EFFECT_1); if (!counter) return true; - + // Count spell criticals in a row in second aura if (procEx & PROC_EX_CRITICAL_HIT) { counter->SetAmount(counter->GetAmount() * 2); - if (counter->GetAmount() < 100) // not enough + if (counter->GetAmount() < 100 && dummySpell->Id != 44445) // not enough or Hot Streak spell return true; // Crititcal counted -> roll chance if (roll_chance_i(triggerAmount)) @@ -5629,20 +5642,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere counter->SetAmount(25); return true; } - // Burnout - if (dummySpell->SpellIconID == 2998) - { - if (!procSpell) - return false; - - int32 cost = int32(procSpell->ManaCost + CalculatePctU(GetCreateMana(), procSpell->ManaCostPercentage)); - basepoints0 = CalculatePctN(cost, triggerAmount); - if (basepoints0 <= 0) - return false; - triggered_spell_id = 44450; - target = this; - break; - } // Incanter's Regalia set (add trigger chance to Mana Shield) if (dummySpell->SpellFamilyFlags[0] & 0x8000) { @@ -5676,21 +5675,8 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere case 11119: case 11120: case 12846: - case 12847: - case 12848: { - switch (dummySpell->Id) - { - case 11119: basepoints0 = int32(0.04f * damage); break; - case 11120: basepoints0 = int32(0.08f * damage); break; - case 12846: basepoints0 = int32(0.12f * damage); break; - case 12847: basepoints0 = int32(0.16f * damage); break; - case 12848: basepoints0 = int32(0.20f * damage); break; - default: - sLog->outError(LOG_FILTER_UNITS, "Unit::HandleDummyAuraProc: non handled spell id: %u (IG)", dummySpell->Id); - return false; - } - + basepoints0 = CalculatePctN(damage, triggerAmount); triggered_spell_id = 12654; basepoints0 += victim->GetRemainingPeriodicAmount(GetGUID(), triggered_spell_id, SPELL_AURA_PERIODIC_DAMAGE); break; @@ -5733,19 +5719,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere triggered_spell_id = 64413; break; } - case 47020: // Enter vehicle XT-002 (Scrapbot) - { - if (GetTypeId() != TYPEID_UNIT) - return false; - - Unit* vehicleBase = GetVehicleBase(); - if (!vehicleBase) - return false; - - // Todo: Check if this amount is blizzlike - vehicleBase->ModifyHealth(int32(vehicleBase->CountPctFromMaxHealth(1))); - break; - } } break; } @@ -5769,14 +5742,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere RemoveAura(dummySpell->Id); return false; } - // Improved Spell Reflection - case 59088: - case 59089: - { - triggered_spell_id = 59725; - target = this; - break; - } } // Retaliation @@ -5812,12 +5777,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere target = this; break; } - // Glyph of Blocking - if (dummySpell->Id == 58375) - { - triggered_spell_id = 58374; - break; - } // Glyph of Sunder Armor if (dummySpell->Id == 58387) { @@ -5894,19 +5853,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere } switch (dummySpell->Id) { - // Siphon Life - case 63108: - { - if (!damage) - break; - // Glyph of Siphon Life - if (HasAura(56216)) - triggerAmount += triggerAmount / 4; - triggered_spell_id = 63106; - target = this; - basepoints0 = CalculatePctN(int32(damage), triggerAmount); - break; - } // Glyph of Shadowflame case 63310: { @@ -5926,41 +5872,12 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere // Soul Leech case 30293: case 30295: - case 30296: { - // Improved Soul Leech - AuraEffectList const& SoulLeechAuras = GetAuraEffectsByType(SPELL_AURA_DUMMY); - for (Unit::AuraEffectList::const_iterator i = SoulLeechAuras.begin(); i != SoulLeechAuras.end(); ++i) - { - if ((*i)->GetId() == 54117 || (*i)->GetId() == 54118) - { - if ((*i)->GetEffIndex() != 0) - continue; - basepoints0 = int32((*i)->GetAmount()); - target = GetGuardianPet(); - if (target) - { - // regen mana for pet - CastCustomSpell(target, 54607, &basepoints0, NULL, NULL, true, castItem, triggeredByAura); - } - // regen mana for caster - CastCustomSpell(this, 59117, &basepoints0, NULL, NULL, true, castItem, triggeredByAura); - // Get second aura of spell for replenishment effect on party - if (AuraEffect const* aurEff = (*i)->GetBase()->GetEffect(EFFECT_1)) - { - // Replenishment - roll chance - if (roll_chance_i(aurEff->GetAmount())) - { - CastSpell(this, 57669, true, castItem, triggeredByAura); - } - } - break; - } - } - // health basepoints0 = CalculatePctN(int32(damage), triggerAmount); target = this; triggered_spell_id = 30294; + // Replenishment + CastSpell(this, 57669, true, castItem, triggeredByAura); break; } // Shadowflame (Voidheart Raiment set bonus) @@ -6015,7 +5932,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere if (triggeredByAura->GetCasterGUID() != victim->GetGUID()) return false; - // Energize 0.25% of max. mana + // Energize 1% of max. mana victim->CastSpell(victim, 57669, true, castItem, triggeredByAura); return true; // no hidden cooldown } @@ -6040,8 +5957,8 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere // Body and Soul if (dummySpell->SpellIconID == 2218) { - // Proc only from Abolish desease on self cast - if (procSpell->Id != 552 || victim != this || !roll_chance_i(triggerAmount)) + // Proc only from Cure Disease on self cast + if (procSpell->Id != 528 || victim != this || !roll_chance_i(triggerAmount)) return false; triggered_spell_id = 64136; target = this; @@ -6056,9 +5973,8 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere return false; // heal amount - int32 total = CalculatePctN(int32(damage), triggerAmount); - int32 team = total / 5; - int32 self = total - team; + int32 self = CalculatePctN(int32(damage), triggerAmount); + int32 team = CalculatePctN(int32(damage), triggerAmount / 2); CastCustomSpell(this, 15290, &team, &self, NULL, true, castItem, triggeredByAura); return true; // no hidden cooldown } @@ -6086,25 +6002,13 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere if (!GoPoH) return false; - int EffIndex = 0; - for (uint8 i = 0; i < MAX_SPELL_EFFECTS; i++) - { - if (GoPoH->Effects[i].Effect == SPELL_EFFECT_APPLY_AURA) - { - EffIndex = i; - break; - } - } - int32 tickcount = GoPoH->GetMaxDuration() / GoPoH->Effects[EffIndex].Amplitude; - if (!tickcount) - return false; - + int32 tickcount = GoPoH->GetMaxDuration() / GoPoH->Effects[EFFECT_0].Amplitude; basepoints0 = CalculatePctN(int32(damage), triggerAmount) / tickcount; break; } - // Improved Shadowform - case 47570: + // Phantasm case 47569: + case 47570: { if (!roll_chance_i(triggerAmount)) return false; @@ -6115,9 +6019,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere // Glyph of Dispel Magic case 55677: { - // Dispel Magic shares spellfamilyflag with abolish disease - if (procSpell->SpellIconID != 74) - return false; if (!target || !target->IsFriendlyTo(this)) return false; @@ -6177,8 +6078,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere if (procSpell->SpellIconID != 62) return false; - int32 mana_perc = triggeredByAura->GetSpellInfo()->Effects[triggeredByAura->GetEffIndex()].CalcValue(); - basepoints0 = int32(CalculatePctN(GetCreatePowers(POWER_MANA), mana_perc) / 10); + basepoints0 = int32(CalculatePctN(GetCreatePowers(POWER_MANA), triggerAmount) / 10); triggered_spell_id = 54833; target = this; break; @@ -6189,7 +6089,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere triggered_spell_id = 54846; break; } - // Glyph of Shred + // Glyph of Bloodletting case 54815: { if (!target) @@ -6198,15 +6098,14 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere // try to find spell Rip on the target if (AuraEffect const* AurEff = target->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DRUID, 0x00800000, 0x0, 0x0, GetGUID())) { - // Rip's max duration, note: spells which modifies Rip's duration also counted like Glyph of Rip + // Rip's max duration, note: spells which modifies Rip's duration also counted uint32 CountMin = AurEff->GetBase()->GetMaxDuration(); // just Rip's max duration without other spells uint32 CountMax = AurEff->GetSpellInfo()->GetMaxDuration(); // add possible auras' and Glyph of Shred's max duration - CountMax += 3 * triggerAmount * IN_MILLISECONDS; // Glyph of Shred -> +6 seconds - CountMax += HasAura(54818) ? 4 * IN_MILLISECONDS : 0; // Glyph of Rip -> +4 seconds + CountMax += 3 * triggerAmount * IN_MILLISECONDS; // Glyph of Bloodletting -> +6 seconds CountMax += HasAura(60141) ? 4 * IN_MILLISECONDS : 0; // Rip Duration/Lacerate Damage -> +4 seconds // if min < max -> that means caster didn't cast 3 shred yet @@ -6221,19 +6120,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere // if not found Rip return false; } - // Glyph of Rake - case 54821: - { - if (procSpell->SpellVisual[0] == 750 && procSpell->Effects[1].ApplyAuraName == 3) - { - if (target && target->GetTypeId() == TYPEID_UNIT) - { - triggered_spell_id = 54820; - break; - } - } - return false; - } // Leader of the Pack case 24932: { @@ -6242,13 +6128,9 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere basepoints0 = int32(CountPctFromMaxHealth(triggerAmount)); target = this; triggered_spell_id = 34299; - if (triggeredByAura->GetCasterGUID() != GetGUID()) - break; - int32 basepoints1 = triggerAmount * 2; - // Improved Leader of the Pack - // Check cooldown of heal spell cooldown - if (GetTypeId() == TYPEID_PLAYER && !ToPlayer()->HasSpellCooldown(34299)) - CastCustomSpell(this, 60889, &basepoints1, 0, 0, true, 0, triggeredByAura); + // Regenerate 4% mana + int32 mana = CalculatePctN(GetCreateMana(), triggerAmount); + CastCustomSpell(this, 68285, &mana, NULL, NULL, true, castItem, triggeredByAura); break; } // Healing Touch (Dreamwalker Raiment set) @@ -6260,15 +6142,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere triggered_spell_id = 28742; break; } - // Glyph of Rejuvenation - case 54754: - { - if (!victim || !victim->HealthBelowPct(uint32(triggerAmount))) - return false; - basepoints0 = CalculatePctN(int32(damage), triggerAmount); - triggered_spell_id = 54755; - break; - } // Healing Touch Refund (Idol of Longevity trinket) case 28847: { diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 5439007702c..fba3384b17b 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3368,7 +3368,7 @@ void Spell::handle_immediate() // Remove used for cast item if need (it can be already NULL after TakeReagents call TakeCastItem(); - // handle ammo consumption for Hunter's volley spell + // handle ammo consumption for thrown weapons if (m_spellInfo->IsRangedWeaponSpell() && m_spellInfo->IsChanneled()) TakeAmmo(); @@ -4430,8 +4430,7 @@ void Spell::TakeAmmo() else { // decrease items amount for stackable throw weapon - uint32 count = 1; - m_caster->ToPlayer()->DestroyItemCount(pItem, count, true); + m_caster->ToPlayer()->DestroyItemCount(pItem, 1, true); } } } -- cgit v1.2.3 From 9dcae03a0460b5b3b933ca560418325184b855f7 Mon Sep 17 00:00:00 2001 From: cyberbrest Date: Mon, 13 Aug 2012 13:06:43 +0300 Subject: Fix xp getting fog Gilneas and LostIslands. This corect content lvl for Trinity::XP::Gain function. Closes #7374 --- src/server/game/DataStores/DBCStores.cpp | 17 ++++++++++++++++- src/server/game/DataStores/DBCStructure.h | 2 +- src/server/game/DataStores/DBCfmt.h | 2 +- 3 files changed, 18 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index e2fce5491a9..c3fc1275468 100644 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -882,6 +882,10 @@ uint32 GetVirtualMapForMapAndZone(uint32 mapid, uint32 zoneId) return mapid; } +/* +Used only for calculate xp gain by content lvl. +Calculation on Gilneas and group maps of LostIslands calculated as CONTENT_1_60. +*/ ContentLevels GetContentLevelsForMapAndZone(uint32 mapid, uint32 zoneId) { mapid = GetVirtualMapForMapAndZone(mapid, zoneId); @@ -892,7 +896,18 @@ ContentLevels GetContentLevelsForMapAndZone(uint32 mapid, uint32 zoneId) if (!mapEntry) return CONTENT_1_60; - return ContentLevels(mapEntry->Expansion()); + // no need enum all maps from phasing + if (mapEntry->rootPhaseMap >= 0) + mapid = mapEntry->rootPhaseMap; + + switch (mapid) + { + case 648: //LostIslands + case 654: //Gilneas + return CONTENT_1_60; + default: + return ContentLevels(mapEntry->Expansion()); + } } bool IsTotemCategoryCompatiableWith(uint32 itemTotemCategoryId, uint32 requiredTotemCategoryId) diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 38cc9fe29e7..b62f86e6799 100644 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -1425,7 +1425,7 @@ struct MapEntry uint32 addon; // 16 m_expansionID uint32 unk_time; // 17 m_raidOffset //uint32 maxPlayers; // 18 m_maxPlayers - //uint32 unk400; // 19 new 4.0.0, mapid, related to phasing + int32 rootPhaseMap; // 19 new 4.0.0, mapid, related to phasing // Helpers uint32 Expansion() const { return addon; } diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index 6561fd9029c..a19dfd0b803 100755 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -103,7 +103,7 @@ const char LiquidTypefmt[]="nxxixixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; const char LockEntryfmt[]="niiiiiiiiiiiiiiiiiiiiiiiixxxxxxxx"; const char PhaseEntryfmt[]="nsi"; const char MailTemplateEntryfmt[]="nxs"; -const char MapEntryfmt[]="nxixxxsixxixiffxiixx"; +const char MapEntryfmt[]="nxixxxsixxixiffxiixi"; const char MapDifficultyEntryfmt[]="diisiix"; const char MovieEntryfmt[]="nxxx"; const char MountCapabilityfmt[]="niiiiiii"; -- cgit v1.2.3 From 03144920d3c33c3b7ebab227a46a02c30eb95404 Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 13 Aug 2012 14:55:55 +0200 Subject: Compile fix --- src/server/game/Spells/Spell.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index fba3384b17b..01a2802f48a 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -4430,7 +4430,8 @@ void Spell::TakeAmmo() else { // decrease items amount for stackable throw weapon - m_caster->ToPlayer()->DestroyItemCount(pItem, 1, true); + uint32 count = 1; + m_caster->ToPlayer()->DestroyItemCount(pItem, count, true); } } } -- cgit v1.2.3 From 3ad20d6bbdbefa29bca81b3399cb63d0968599cd Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 13 Aug 2012 14:56:20 +0200 Subject: Core/Units: Updated unit power mods --- src/server/game/Entities/Unit/Unit.cpp | 15 +++++++++------ src/server/game/Entities/Unit/Unit.h | 7 ++++++- 2 files changed, 15 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 16d05608a4a..a02bb7a4cb6 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -13941,12 +13941,15 @@ void Unit::SetPower(Powers power, int32 val) SetStatInt32Value(UNIT_FIELD_POWER1 + powerIndex, val); - WorldPacket data(SMSG_POWER_UPDATE, 8 + 4 + 1 + 4); - data.append(GetPackGUID()); - data << uint32(1);//unk - data << uint8(powerIndex); - data << int32(val); - SendMessageToSet(&data, GetTypeId() == TYPEID_PLAYER ? true : false); + if (IsInWorld()) + { + WorldPacket data(SMSG_POWER_UPDATE, 8 + 4 + 1 + 4); + data.append(GetPackGUID()); + data << uint32(1); //power count + data << uint8(powerIndex); + data << int32(val); + SendMessageToSet(&data, GetTypeId() == TYPEID_PLAYER ? true : false); + } // group update if (Player* player = ToPlayer()) diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index c5d411190dc..57b56ff6e55 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -418,8 +418,13 @@ enum UnitMods UNIT_MOD_RAGE, UNIT_MOD_FOCUS, UNIT_MOD_ENERGY, + UNIT_MOD_UNUSED, // Old UNIT_MOD_HAPPINESS UNIT_MOD_RUNE, UNIT_MOD_RUNIC_POWER, + UNIT_MOD_SOUL_SHARDS, + UNIT_MOD_ECLIPSE, + UNIT_MOD_HOLY_POWER, + UNIT_MOD_ALTERNATIVE, UNIT_MOD_ARMOR, // UNIT_MOD_ARMOR..UNIT_MOD_RESISTANCE_ARCANE must be in existed order, it's accessed by index values of SpellSchools enum. UNIT_MOD_RESISTANCE_HOLY, UNIT_MOD_RESISTANCE_FIRE, @@ -439,7 +444,7 @@ enum UnitMods UNIT_MOD_RESISTANCE_START = UNIT_MOD_ARMOR, UNIT_MOD_RESISTANCE_END = UNIT_MOD_RESISTANCE_ARCANE + 1, UNIT_MOD_POWER_START = UNIT_MOD_MANA, - UNIT_MOD_POWER_END = UNIT_MOD_RUNIC_POWER + 1 + UNIT_MOD_POWER_END = UNIT_MOD_ALTERNATIVE + 1 }; enum BaseModGroup -- cgit v1.2.3 From 8819f30a12e12075f3008aefe2ae61c5d99b49eb Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 13 Aug 2012 14:56:56 +0200 Subject: Core/Auras: Simplified SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS handling --- src/server/game/Entities/Player/Player.h | 15 -------- src/server/game/Handlers/SpellHandler.cpp | 23 ++++++++++- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 47 +---------------------- src/server/game/Spells/Auras/SpellAuraEffects.h | 1 - 4 files changed, 23 insertions(+), 63 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index ab4c738f119..c8c132b56f3 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -2606,19 +2606,6 @@ class Player : public Unit, public GridObject VoidStorageItem* GetVoidStorageItem(uint8 slot) const; VoidStorageItem* GetVoidStorageItem(uint64 id, uint8& slot) const; - // SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS handling - void AddSpellSwap(uint32 oldSpell, uint32 newSpell) { _spellSwaps[oldSpell] = newSpell; } - void RemoveSpellSwap(uint32 originalSpell) { _spellSwaps.erase(originalSpell); } - - uint32 GetSpellForCast(uint32 spellId) const - { - std::map::const_iterator itr = _spellSwaps.find(spellId); - if (itr != _spellSwaps.end()) - return itr->second; - - return spellId; - } - protected: // Gamemaster whisper whitelist WhisperListContainer WhisperList; @@ -2947,8 +2934,6 @@ class Player : public Unit, public GridObject InstanceTimeMap _instanceResetTimes; uint32 _pendingBindId; uint32 _pendingBindTimer; - - std::map _spellSwaps; }; void AddItemsSetItem(Player*player, Item* item); diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp index 8369fcde064..079a4e2422d 100755 --- a/src/server/game/Handlers/SpellHandler.cpp +++ b/src/server/game/Handlers/SpellHandler.cpp @@ -350,8 +350,6 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket) return; } - if (Player* plrMover = mover->ToPlayer()) - spellId = plrMover->GetSpellForCast(spellId); SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId); if (!spellInfo) @@ -382,6 +380,27 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket) } } + Unit::AuraEffectList swaps = mover->GetAuraEffectsByType(SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS); + Unit::AuraEffectList const& swaps2 = mover->GetAuraEffectsByType(SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS_2); + if (!swaps2.empty()) + swaps.insert(swaps.end(), swaps2.begin(), swaps2.end()); + + if (!swaps.empty()) + { + for (Unit::AuraEffectList::const_iterator itr = swaps.begin(); itr != swaps.end(); ++itr) + { + if ((*itr)->IsAffectingSpell(spellInfo)) + { + if (SpellInfo const* newInfo = sSpellMgr->GetSpellInfo((*itr)->GetAmount())) + { + spellInfo = newInfo; + spellId = newInfo->Id; + } + break; + } + } + } + // Client is resending autoshot cast opcode when other spell is casted during shoot rotation // Skip it to prevent "interrupt" message if (spellInfo->IsAutoRepeatRangedSpell() && _player->GetCurrentSpell(CURRENT_AUTOREPEAT_SPELL) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 097ec0b2e8e..e81d465b664 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -385,8 +385,8 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleNULL, //329 SPELL_AURA_MOD_RUNE_REGEN_SPEED &AuraEffect::HandleNULL, //330 SPELL_AURA_CAST_WHILE_WALKING &AuraEffect::HandleNULL, //331 SPELL_AURA_331 - &AuraEffect::HandleOverrideActionbar, //332 SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS - &AuraEffect::HandleOverrideActionbar, //333 SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS_2 + &AuraEffect::HandleNoImmediateEffect, //332 SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS implemented in WorldSession::HandleCastSpellOpcode + &AuraEffect::HandleNoImmediateEffect, //333 SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS_2 implemented in WorldSession::HandleCastSpellOpcode &AuraEffect::HandleNULL, //334 SPELL_AURA_334 &AuraEffect::HandleNULL, //335 SPELL_AURA_335 &AuraEffect::HandleNULL, //336 SPELL_AURA_MOD_FLYING_RESTRICTIONS @@ -5679,49 +5679,6 @@ void AuraEffect::HandlePreventResurrection(AuraApplication const* aurApp, uint8 aurApp->GetTarget()->SetByteFlag(PLAYER_FIELD_BYTES, 0, PLAYER_FIELD_BYTE_RELEASE_TIMER); } -void AuraEffect::HandleOverrideActionbar(AuraApplication const* aurApp, uint8 mode, bool apply) const -{ - if (!(mode & AURA_EFFECT_HANDLE_REAL)) - return; - - Player* target = aurApp->GetTarget()->ToPlayer(); - if (!target) - return; - - uint32 newSpellId = uint32(GetAmount()); - if (!sSpellMgr->GetSpellInfo(newSpellId)) - return; - - bool foundAny = false; - PlayerSpellMap const& spells = target->GetSpellMap(); - for (PlayerSpellMap::const_iterator itr = spells.begin(); itr != spells.end(); ++itr) - { - if (itr->second->state == PLAYERSPELL_REMOVED) - continue; - - if (!itr->second->active || itr->second->disabled) - continue; - - SpellInfo const* info = sSpellMgr->GetSpellInfo(itr->first); - if (!IsAffectingSpell(info)) - continue; - - foundAny = true; - if (apply) - target->AddSpellSwap(itr->first, newSpellId); - else - target->RemoveSpellSwap(itr->first); - } - - if (foundAny) - { - if (apply) - target->AddTemporarySpell(newSpellId); - else - target->RemoveTemporarySpell(newSpellId); - } -} - void AuraEffect::HandlePeriodicDummyAuraTick(Unit* target, Unit* caster) const { switch (GetSpellInfo()->SpellFamilyName) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.h b/src/server/game/Spells/Auras/SpellAuraEffects.h index 5a85012f857..28a5beafa2c 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.h +++ b/src/server/game/Spells/Auras/SpellAuraEffects.h @@ -280,7 +280,6 @@ class AuraEffect void HandleAuraOverrideSpells(AuraApplication const* aurApp, uint8 mode, bool apply) const; void HandleAuraSetVehicle(AuraApplication const* aurApp, uint8 mode, bool apply) const; void HandlePreventResurrection(AuraApplication const* aurApp, uint8 mode, bool apply) const; - void HandleOverrideActionbar(AuraApplication const* aurApp, uint8 mode, bool apply) const; // aura effect periodic tick handlers void HandlePeriodicDummyAuraTick(Unit* target, Unit* caster) const; -- cgit v1.2.3 From f7fd5da96353f73c57ef295998fcdf9f7ca8dd41 Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 13 Aug 2012 14:46:37 +0100 Subject: Core: Fix a few compile errors with some "weird" compilers --- src/server/game/Handlers/ItemHandler.cpp | 2 +- src/server/game/Handlers/VoidStorageHandler.cpp | 8 ++++---- src/server/scripts/World/npcs_special.cpp | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 616309c49a0..765adbda101 100644 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -1529,7 +1529,7 @@ void WorldSession::HandleTransmogrifyItems(WorldPacket& recvData) itemTransmogrifier = player->GetItemByGuid(itemGuids[i]); if (!itemTransmogrifier) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleTransmogrifyItems - Player (GUID: %u, name: %s) tried to transmogrify with an invalid item (guid: "UI64FMTD").", player->GetGUIDLow(), player->GetName(), itemGuids[i]); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleTransmogrifyItems - Player (GUID: %u, name: %s) tried to transmogrify with an invalid item (lowguid: %u).", player->GetGUIDLow(), player->GetName(), GUID_LOPART(itemGuids[i])); return; } } diff --git a/src/server/game/Handlers/VoidStorageHandler.cpp b/src/server/game/Handlers/VoidStorageHandler.cpp index f89bcf6e0d0..0e40b0faf15 100644 --- a/src/server/game/Handlers/VoidStorageHandler.cpp +++ b/src/server/game/Handlers/VoidStorageHandler.cpp @@ -332,7 +332,7 @@ void WorldSession::HandleVoidStorageTransfer(WorldPacket& recvData) Item* item = player->GetItemByGuid(*itr); if (!item) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleVoidStorageTransfer - Player (GUID: %u, name: %s) wants to deposit an invalid item (item guid: %u).", player->GetGUIDLow(), player->GetName(), *itr); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleVoidStorageTransfer - Player (GUID: %u, name: %s) wants to deposit an invalid item (item guid: %u).", player->GetGUIDLow(), player->GetName(), uint64(*itr)); continue; } @@ -357,7 +357,7 @@ void WorldSession::HandleVoidStorageTransfer(WorldPacket& recvData) VoidStorageItem* itemVS = player->GetVoidStorageItem(*itr, slot); if (!itemVS) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleVoidStorageTransfer - Player (GUID: %u, name: %s) tried to withdraw an invalid item (id: %u)", player->GetGUIDLow(), player->GetName(), *itr); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleVoidStorageTransfer - Player (GUID: %u, name: %s) tried to withdraw an invalid item (id: %u)", player->GetGUIDLow(), player->GetName(), uint64(*itr)); continue; } @@ -366,7 +366,7 @@ void WorldSession::HandleVoidStorageTransfer(WorldPacket& recvData) if (msg != EQUIP_ERR_OK) { SendVoidStorageTransferResult(VOID_TRANSFER_ERROR_INVENTORY_FULL); - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleVoidStorageTransfer - Player (GUID: %u, name: %s) couldn't withdraw item id %u because inventory was full.", player->GetGUIDLow(), player->GetName(), *itr); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleVoidStorageTransfer - Player (GUID: %u, name: %s) couldn't withdraw item id %u because inventory was full.", player->GetGUIDLow(), player->GetName(), uint64(*itr)); return; } @@ -535,7 +535,7 @@ void WorldSession::HandleVoidSwapItem(WorldPacket& recvData) uint8 oldSlot; if (!player->GetVoidStorageItem(itemId, oldSlot)) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleVoidSwapItem - Player (GUID: %u, name: %s) requested swapping an invalid item (slot: %u, itemid: %u).", player->GetGUIDLow(), player->GetName(), newSlot, itemId); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleVoidSwapItem - Player (GUID: %u, name: %s) requested swapping an invalid item (slot: %u, itemid: %u).", player->GetGUIDLow(), player->GetName(), newSlot, uint64(itemId)); return; } diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index 2d0198bfb0e..2830a050d42 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -1297,7 +1297,7 @@ public: case GOSSIP_OPTION_LEARNDUALSPEC: if (player->GetSpecsCount() == 1 && !(player->getLevel() < sWorld->getIntConfig(CONFIG_MIN_DUALSPEC_LEVEL))) { - if (!player->HasEnoughMoney(UI64LIT(10000000))) + if (!player->HasEnoughMoney(uint64(10000000))) { player->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, 0, 0, 0); player->PlayerTalkClass->SendCloseGossip(); @@ -1305,7 +1305,7 @@ public: } else { - player->ModifyMoney(SI64LIT(-10000000)); + player->ModifyMoney(int64(-10000000)); // Cast spells that teach dual spec // Both are also ImplicitTarget self and must be cast by player -- cgit v1.2.3 From 292cbbf06878c8eaf4ec5144f818dccf5c1c6a7d Mon Sep 17 00:00:00 2001 From: Sovak Date: Mon, 13 Aug 2012 15:56:01 +0200 Subject: Core/Spells: Updated critical heal to Cataclysm Signed-off-by: Sovak Signed-off-by: Nay --- src/server/game/Entities/Unit/Unit.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index a02bb7a4cb6..4b202205858 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -10924,18 +10924,7 @@ uint32 Unit::SpellCriticalDamageBonus(SpellInfo const* spellProto, uint32 damage uint32 Unit::SpellCriticalHealingBonus(SpellInfo const* spellProto, uint32 damage, Unit* victim) { // Calculate critical bonus - int32 crit_bonus; - switch (spellProto->DmgClass) - { - case SPELL_DAMAGE_CLASS_MELEE: // for melee based spells is 100% - case SPELL_DAMAGE_CLASS_RANGED: - // TODO: write here full calculation for melee/ranged spells - crit_bonus = damage; - break; - default: - crit_bonus = damage / 2; // for spells is 50% - break; - } + int32 crit_bonus = damage; if (victim) { -- cgit v1.2.3 From 45e0cae7beedd84a6e71cf99d356e836476c1e4a Mon Sep 17 00:00:00 2001 From: Sovak Date: Tue, 14 Aug 2012 00:17:06 +0200 Subject: Core/Totems: In cata totem items are no longer needed Signed-off-by: Sovak --- src/server/game/Entities/Player/Player.cpp | 25 ------------------------- src/server/game/Spells/Spell.cpp | 20 +------------------- 2 files changed, 1 insertion(+), 44 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 267d3dc6f7c..188fdb5e9f4 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -10499,31 +10499,6 @@ InventoryResult Player::CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item return EQUIP_ERR_OK; } -bool Player::HasItemTotemCategory(uint32 TotemCategory) const -{ - Item* pItem; - for (uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; ++i) - { - pItem = GetUseableItemByPos(INVENTORY_SLOT_BAG_0, i); - if (pItem && IsTotemCategoryCompatiableWith(pItem->GetTemplate()->TotemCategory, TotemCategory)) - return true; - } - - for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) - { - if (Bag* pBag = GetBagByPos(i)) - { - for (uint32 j = 0; j < pBag->GetBagSize(); ++j) - { - pItem = GetUseableItemByPos(i, j); - if (pItem && IsTotemCategoryCompatiableWith(pItem->GetTemplate()->TotemCategory, TotemCategory)) - return true; - } - } - } - return false; -} - InventoryResult Player::CanStoreItem_InSpecificSlot(uint8 bag, uint8 slot, ItemPosCountVec &dest, ItemTemplate const* pProto, uint32& count, bool swap, Item* pSrcItem) const { Item* pItem2 = GetItemByPos(bag, slot); diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 01a2802f48a..54d9387d0c1 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -5991,25 +5991,7 @@ SpellCastResult Spell::CheckItems() totems -= 1; } if (totems != 0) - return SPELL_FAILED_TOTEMS; //0x7C - - // Check items for TotemCategory (items presence in inventory) - uint32 TotemCategory = 2; - for (int i= 0; i < 2; ++i) - { - if (m_spellInfo->TotemCategory[i] != 0) - { - if (p_caster->HasItemTotemCategory(m_spellInfo->TotemCategory[i])) - { - TotemCategory -= 1; - continue; - } - } - else - TotemCategory -= 1; - } - if (TotemCategory != 0) - return SPELL_FAILED_TOTEM_CATEGORY; //0x7B + return SPELL_FAILED_TOTEMS; } // special checks for spell effects -- cgit v1.2.3 From aa25336602ff12d94625c24733ff74a834969aef Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 13 Aug 2012 23:30:42 +0100 Subject: Core/Loading: Re-enable validation for quest_template currency loading --- src/server/game/Globals/ObjectMgr.cpp | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 1843a68f095..5d974db1d3a 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -4039,23 +4039,21 @@ void ObjectMgr::LoadQuests() for (uint8 j = 0; j < QUEST_REWARD_CURRENCY_COUNT; ++j) { - uint32 currency = qinfo->RewardCurrencyId[j]; - if (currency) + if (qinfo->RewardCurrencyId[j]) { if (qinfo->RewardCurrencyCount[j] == 0) { sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardCurrencyId%d` = %u but `RewardCurrencyCount%d` = 0, quest can't be done.", - qinfo->GetQuestId(), j+1, currency, j+1); + qinfo->GetQuestId(), j+1, qinfo->RewardCurrencyId[j], j+1); // no changes, quest can't be done for this requirement } - /* TODO: Re-enable once currency dbc getters are implemented - if (!sObjectMgr->GetCurrency(currency)) + if (!sCurrencyTypesStore.LookupEntry(qinfo->RewardCurrencyId[j])) { sLog->outError(LOG_FILTER_SQL, "Quest %u has `RewardCurrencyId%d` = %u but currency with entry %u does not exist, quest can't be done.", - qinfo->GetQuestId(), j+1, currency, currency); + qinfo->GetQuestId(), j+1, qinfo->RewardCurrencyId[j], qinfo->RewardCurrencyId[j]); qinfo->RewardCurrencyCount[j] = 0; // prevent incorrect work of quest - }*/ + } } else if (qinfo->RewardCurrencyCount[j] > 0) { @@ -4067,23 +4065,21 @@ void ObjectMgr::LoadQuests() for (uint8 j = 0; j < QUEST_REQUIRED_CURRENCY_COUNT; ++j) { - uint32 currency = qinfo->RequiredCurrencyId[j]; - if (currency) + if (qinfo->RequiredCurrencyId[j]) { if (qinfo->RequiredCurrencyCount[j] == 0) { sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredCurrencyId%d` = %u but `RequiredCurrencyCount%d` = 0, quest can't be done.", - qinfo->GetQuestId(), j+1, currency, j+1); + qinfo->GetQuestId(), j+1, qinfo->RequiredCurrencyId[j], j+1); // no changes, quest can't be done for this requirement } - /* TODO: Re-enable once currency dbc getters are implemented - if (!sObjectMgr->GetCurrency(currency)) + if (!sCurrencyTypesStore.LookupEntry(qinfo->RequiredCurrencyId[j])) { sLog->outError(LOG_FILTER_SQL, "Quest %u has `RequiredCurrencyId%d` = %u but currency with entry %u does not exist, quest can't be done.", - qinfo->GetQuestId(), j+1, currency, currency); + qinfo->GetQuestId(), j+1, qinfo->RequiredCurrencyId[j], qinfo->RequiredCurrencyId[j]); qinfo->RequiredCurrencyCount[j] = 0; // prevent incorrect work of quest - }*/ + } } else if (qinfo->RequiredCurrencyCount[j] > 0) { -- cgit v1.2.3 From 1f4b69908b905087f7900a9ba5f85358be33ba67 Mon Sep 17 00:00:00 2001 From: Subv Date: Mon, 13 Aug 2012 17:41:31 -0500 Subject: Core/Spells: Removed more deprecated spells code for Cataclysm --- src/server/game/Entities/Unit/Unit.cpp | 295 ++++----------------------------- 1 file changed, 32 insertions(+), 263 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 4b202205858..e3d316ca23e 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -5688,16 +5688,8 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere if (!player) return false; - SpellCooldowns const cooldowns = player->GetSpellCooldowns(); - // remove cooldowns on all ranks of Frost Nova - for (SpellCooldowns::const_iterator itr = cooldowns.begin(); itr != cooldowns.end(); ++itr) - { - SpellInfo const* cdSpell = sSpellMgr->GetSpellInfo(itr->first); - // Frost Nova - if (cdSpell && cdSpell->SpellFamilyName == SPELLFAMILY_MAGE - && cdSpell->SpellFamilyFlags[0] & 0x00000040) - player->RemoveSpellCooldown(cdSpell->Id, true); - } + // Remove Frost Nova cooldown + player->RemoveSpellCooldown(122, true); break; } // Blessing of Ancient Kings (Val'anyr, Hammer of Ancient Kings) @@ -6078,7 +6070,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere if (procSpell->SpellIconID != 62) return false; - basepoints0 = int32(CalculatePctN(GetCreatePowers(POWER_MANA), triggerAmount) / 10); + basepoints0 = int32(CalculatePctN(GetCreatePowers(POWER_MANA), triggerAmount) / 5); triggered_spell_id = 54833; target = this; break; @@ -6284,11 +6276,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere { switch (dummySpell->Id) { - case 56800: // Glyph of Backstab - { - triggered_spell_id = 63975; - break; - } case 32748: // Deadly Throw Interrupt { // Prevent cast Deadly Throw Interrupt on self from last effect (apply dummy) of Deadly Throw @@ -6312,27 +6299,13 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere switch (dummySpell->SpellIconID) { - case 2116: // Quick Recovery - { - if (!procSpell) - return false; - - // energy cost save - basepoints0 = CalculatePctN(int32(procSpell->ManaCost), triggerAmount); - if (basepoints0 <= 0) - return false; - - target = this; - triggered_spell_id = 31663; - break; - } case 2909: // Cut to the Chase { // "refresh your Slice and Dice duration to its 5 combo point maximum" // lookup Slice and Dice - if (AuraEffect const* aur = GetAuraEffect(SPELL_AURA_MOD_MELEE_HASTE, SPELLFAMILY_ROGUE, 0x40000, 0, 0)) + if (Aura const* aur = GetAura(5171)) { - aur->GetBase()->SetDuration(aur->GetSpellInfo()->GetMaxDuration(), true); + aur->SetDuration(aur->GetSpellInfo()->GetMaxDuration(), true); return true; } return false; @@ -6351,8 +6324,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere { case 267: // Improved Mend Pet { - int32 chance = triggeredByAura->GetSpellInfo()->Effects[triggeredByAura->GetEffIndex()].CalcValue(); - if (!roll_chance_i(chance)) + if (!roll_chance_i(triggerAmount)) return false; triggered_spell_id = 24406; @@ -6363,23 +6335,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere if (!procSpell) return false; - Spell* spell = ToPlayer()->m_spellModTakingSpell; - - // Disable charge drop because of Lock and Load - ToPlayer()->SetSpellModTakingSpell(spell, false); - - // Explosive Shot - if (procSpell->SpellFamilyFlags[2] & 0x200) - { - if (!victim) - return false; - if (AuraEffect const* pEff = victim->GetAuraEffect(SPELL_AURA_PERIODIC_DUMMY, SPELLFAMILY_HUNTER, 0x0, 0x80000000, 0x0, GetGUID())) - basepoints0 = pEff->GetSpellInfo()->CalcPowerCost(this, SpellSchoolMask(pEff->GetSpellInfo()->SchoolMask)) * 4/10/3; - } - else - basepoints0 = procSpell->CalcPowerCost(this, SpellSchoolMask(procSpell->SchoolMask)) * 4/10; - - ToPlayer()->SetSpellModTakingSpell(spell, true); + basepoints0 = CalculatePctN(procSpell->CalcPowerCost(this, SpellSchoolMask(procSpell->SchoolMask)), triggerAmount); if (basepoints0 <= 0) return false; @@ -6388,38 +6344,15 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere triggered_spell_id = 34720; break; } - case 3406: // Hunting Party - { - triggered_spell_id = 57669; - target = this; - break; - } case 3560: // Rapid Recuperation { - // This effect only from Rapid Killing (mana regen) + // This effect only from Rapid Killing (focus regen) if (!(procSpell->SpellFamilyFlags[1] & 0x01000000)) return false; target = this; - - switch (dummySpell->Id) - { - case 53228: // Rank 1 - triggered_spell_id = 56654; - break; - case 53232: // Rank 2 - triggered_spell_id = 58882; - break; - } - break; - } - case 3579: // Lock and Load - { - // Proc only from periodic (from trap activation proc another aura of this spell) - if (!(procFlag & PROC_FLAG_DONE_PERIODIC) || !roll_chance_i(triggerAmount)) - return false; - triggered_spell_id = 56453; - target = this; + triggered_spell_id = 58883; + basepoints0 = CalculatePctN(GetMaxPower(POWER_FOCUS), triggerAmount); break; } } @@ -6434,17 +6367,12 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere target = this; break; } - case 57870: // Glyph of Mend Pet - { - victim->CastSpell(victim, 57894, true, NULL, NULL, GetGUID()); - return true; - } } break; } case SPELLFAMILY_PALADIN: { - // Seal of Righteousness - melee proc dummy (addition ${$MWS*(0.022*$AP+0.044*$SPH)} damage) + // Seal of Righteousness - melee proc dummy (addition (MWS * (0.011 * AP.022 * holy spell power) * 100 / 100) damage) if (dummySpell->SpellFamilyFlags[0] & 0x8000000) { if (effIndex != 0) @@ -6453,7 +6381,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere float ap = GetTotalAttackPowerValue(BASE_ATTACK); int32 holy = SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_HOLY) + victim->SpellBaseDamageBonusTaken(SPELL_SCHOOL_MASK_HOLY); - basepoints0 = (int32)GetAttackTime(BASE_ATTACK) * int32(ap * 0.022f + 0.044f * holy) / 1000; + basepoints0 = (int32)GetAttackTime(BASE_ATTACK) * int32(ap * 0.011f + 0.022f * holy) / 1000; break; } // Light's Beacon - Beacon of Light @@ -6470,8 +6398,22 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere { if (beaconTarget->IsWithinLOSInMap(victim)) { - basepoints0 = damage; - victim->CastCustomSpell(beaconTarget, 53654, &basepoints0, NULL, NULL, true); + int32 percent = 0; + switch (procSpell->Id) + { + case 85673: // Word of Glory + case 20473: // Holy Shock + case 19750: // Flash of Light + case 82326: // Divine Light + case 85222: // Light of Dawn + percent = triggerAmount; // 50% heal from these spells + break; + case 635: // Holy Light + percent = triggerAmount * 2; // 100% heal from Holy Light + break; + } + basepoints0 = CalculatePctN(damage, percent); + victim->CastCustomSpell(beaconTarget, 53652, &basepoints0, NULL, NULL, true); return true; } } @@ -6483,96 +6425,10 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere { target = this; triggered_spell_id = 31930; - // replenishment - CastSpell(this, 57669, true, castItem, triggeredByAura); - break; - } - // Sanctified Wrath - if (dummySpell->SpellIconID == 3029) - { - triggered_spell_id = 57318; - target = this; - basepoints0 = triggerAmount; - CastCustomSpell(target, triggered_spell_id, &basepoints0, &basepoints0, NULL, true, castItem, triggeredByAura); - return true; - } - // Sacred Shield - if (dummySpell->SpellFamilyFlags[1] & 0x80000) - { - if (procFlag & PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_POS) - { - if (procSpell->SpellFamilyName == SPELLFAMILY_PALADIN && (procSpell->SpellFamilyFlags[0] & 0x40000000)) - { - basepoints0 = damage / 12; - - if (basepoints0) - CastCustomSpell(this, 66922, &basepoints0, NULL, NULL, true, 0, triggeredByAura, victim->GetGUID()); - - return true; - } - else - return false; - } - else if (damage > 0) - triggered_spell_id = 58597; - - // Item - Paladin T8 Holy 4P Bonus - if (Unit* caster = triggeredByAura->GetCaster()) - if (AuraEffect const* aurEff = caster->GetAuraEffect(64895, 0)) - cooldown = aurEff->GetAmount(); - - target = this; - break; - } - // Righteous Vengeance - if (dummySpell->SpellIconID == 3025) - { - // 4 damage tick - basepoints0 = triggerAmount * damage / 400; - triggered_spell_id = 61840; - // Add remaining ticks to damage done - basepoints0 += victim->GetRemainingPeriodicAmount(GetGUID(), triggered_spell_id, SPELL_AURA_PERIODIC_DAMAGE); - break; - } - // Sheath of Light - if (dummySpell->SpellIconID == 3030) - { - // 4 healing tick - basepoints0 = triggerAmount * damage / 400; - triggered_spell_id = 54203; break; } switch (dummySpell->Id) { - // Heart of the Crusader - case 20335: // rank 1 - triggered_spell_id = 21183; - break; - case 20336: // rank 2 - triggered_spell_id = 54498; - break; - case 20337: // rank 3 - triggered_spell_id = 54499; - break; - // Judgement of Light - case 20185: - { - // 2% of base mana - basepoints0 = int32(victim->CountPctFromMaxHealth(2)); - victim->CastCustomSpell(victim, 20267, &basepoints0, 0, 0, true, 0, triggeredByAura); - return true; - } - // Judgement of Wisdom - case 20186: - { - if (victim && victim->isAlive() && victim->getPowerType() == POWER_MANA) - { - // 2% of base mana - basepoints0 = int32(CalculatePctN(victim->GetCreateMana(), 2)); - victim->CastCustomSpell(victim, 20268, &basepoints0, NULL, NULL, true, 0, triggeredByAura); - } - return true; - } // Holy Power (Redemption Armor set) case 28789: { @@ -6604,24 +6460,10 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere } break; } - case 25899: // Greater Blessing of Sanctuary - case 20911: // Blessing of Sanctuary - { - target = this; - switch (target->getPowerType()) - { - case POWER_MANA: - triggered_spell_id = 57319; - break; - default: - return false; - } - break; - } - // Seal of Vengeance (damage calc on apply aura) + // Seal of Truth (damage calc on apply aura) case 31801: { - if (effIndex != 0) // effect 1, 2 used by seal unleashing code + if (effIndex != 0) // effect 2 used by seal unleashing code return false; // At melee attack or Hammer of the Righteous spell damage considered as melee attack @@ -6634,7 +6476,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere triggered_spell_id = 31803; - // On target with 5 stacks of Holy Vengeance direct damage is done + // On target with 5 stacks of Censure direct damage is done if (Aura* aur = victim->GetAura(triggered_spell_id, GetGUID())) { if (aur->GetStackAmount() == 5) @@ -6650,61 +6492,13 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere return false; break; } - // Seal of Corruption - case 53736: - { - if (effIndex != 0) // effect 1, 2 used by seal unleashing code - return false; - - // At melee attack or Hammer of the Righteous spell damage considered as melee attack - bool stacker = !procSpell || procSpell->Id == 53595; - // spells with SPELL_DAMAGE_CLASS_MELEE excluding Judgements - bool damager = procSpell && procSpell->EquippedItemClass != -1; - - if (!stacker && !damager) - return false; - - triggered_spell_id = 53742; - - // On target with 5 stacks of Blood Corruption direct damage is done - if (Aura* aur = victim->GetAura(triggered_spell_id, GetGUID())) - { - if (aur->GetStackAmount() == 5) - { - if (stacker) - aur->RefreshDuration(); - CastSpell(victim, 53739, true); - return true; - } - } - - if (!stacker) - return false; - break; - } - // Spiritual Attunement - case 31785: - case 33776: - { - // if healed by another unit (victim) - if (this == victim) - return false; - - // heal amount - basepoints0 = int32(CalculatePctN(std::min(damage, GetMaxHealth() - GetHealth()), triggerAmount)); - target = this; - - if (basepoints0) - triggered_spell_id = 31786; - break; - } // Paladin Tier 6 Trinket (Ashtongue Talisman of Zeal) case 40470: { if (!procSpell) return false; - float chance; + float chance; // Flash of light/Holy light if (procSpell->SpellFamilyFlags[0] & 0xC0000000) @@ -6726,13 +6520,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere break; } - // Glyph of Holy Light - case 54937: - { - triggered_spell_id = 54968; - basepoints0 = CalculatePctN(int32(damage), triggerAmount); - break; - } // Item - Paladin T8 Holy 2P Bonus case 64890: { @@ -10366,24 +10153,6 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin AddPctN(DoneTotalMod, aurEff->GetAmount()); } break; - case SPELLFAMILY_PALADIN: - // Judgement of Vengeance/Judgement of Corruption - if ((spellProto->SpellFamilyFlags[1] & 0x400000) && spellProto->SpellIconID == 2292) - { - // Get stack of Holy Vengeance/Blood Corruption on the target added by caster - uint32 stacks = 0; - Unit::AuraEffectList const& auras = victim->GetAuraEffectsByType(SPELL_AURA_PERIODIC_DAMAGE); - for (Unit::AuraEffectList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr) - if (((*itr)->GetId() == 31803 || (*itr)->GetId() == 53742) && (*itr)->GetCasterGUID() == GetGUID()) - { - stacks = (*itr)->GetBase()->GetStackAmount(); - break; - } - // + 10% for each application of Holy Vengeance/Blood Corruption on the target - if (stacks) - AddPctU(DoneTotalMod, 10 * stacks); - } - break; case SPELLFAMILY_DRUID: // Thorns if (spellProto->SpellFamilyFlags[0] & 0x100) -- cgit v1.2.3 From 424d86045429dbb0d1d43be354331c0ee70a063c Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 13 Aug 2012 23:58:52 +0100 Subject: DB&Core/Quests: Change `MinLevel` to signed since -1 is a valid value for deprecated quests --- sql/updates/2012_08_13_00_world_quest_template.sql | 1 + src/server/game/Globals/ObjectMgr.cpp | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 sql/updates/2012_08_13_00_world_quest_template.sql (limited to 'src') diff --git a/sql/updates/2012_08_13_00_world_quest_template.sql b/sql/updates/2012_08_13_00_world_quest_template.sql new file mode 100644 index 00000000000..b3c5a45a668 --- /dev/null +++ b/sql/updates/2012_08_13_00_world_quest_template.sql @@ -0,0 +1 @@ +ALTER TABLE `quest_template` CHANGE `MinLevel` `MinLevel` tinyint(4) NOT NULL DEFAULT '0'; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 5d974db1d3a..897446a73f9 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -3550,6 +3550,12 @@ void ObjectMgr::LoadQuests() } } + if (qinfo->MinLevel == uint32(-1)) + { + sLog->outError(LOG_FILTER_SQL, "Quest %u should be disabled because `MinLevel` = -1", qinfo->GetQuestId()); + // no changes needed, sending -1 in SMSG_QUEST_QUERY_RESPONSE is valid + } + // client quest log visual (area case) if (qinfo->ZoneOrSort > 0) { -- cgit v1.2.3 From db00a9fd2c7dbf4b73f070dafac0af4e2cf96c1e Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 14 Aug 2012 00:03:18 +0100 Subject: Missing changes to previous commit --- src/server/game/Quests/QuestDef.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index 15db40a8063..2240fa471a0 100755 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -26,7 +26,7 @@ Quest::Quest(Field* questRecord) Id = questRecord[0].GetUInt32(); Method = questRecord[1].GetUInt8(); Level = questRecord[2].GetInt16(); - MinLevel = questRecord[3].GetUInt8(); + MinLevel = uint32(questRecord[3].GetInt8()); MaxLevel = questRecord[4].GetUInt8(); ZoneOrSort = questRecord[5].GetInt16(); Type = questRecord[6].GetUInt16(); -- cgit v1.2.3 From 2dbb194c7d058df6f262144f58446724185c0380 Mon Sep 17 00:00:00 2001 From: Subv Date: Mon, 13 Aug 2012 18:18:00 -0500 Subject: Core/DBCs: Implement loading of gtSpellScaling.dbc --- src/server/game/DataStores/DBCStores.cpp | 4 ++-- src/server/game/DataStores/DBCStores.h | 2 +- src/server/game/DataStores/DBCStructure.h | 5 +++++ src/server/game/DataStores/DBCfmt.h | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index c3fc1275468..a42c7257eb6 100644 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -104,9 +104,9 @@ DBCStorage sGtChanceToSpellCritStore(GtChanceToSp DBCStorage sGtOCTClassCombatRatingScalarStore(GtOCTClassCombatRatingScalarfmt); DBCStorage sGtOCTRegenHPStore(GtOCTRegenHPfmt); //DBCStorage sGtOCTRegenMPStore(GtOCTRegenMPfmt); -- not used currently -DBCStorage sGtRegenHPPerSptStore(GtRegenHPPerSptfmt); DBCStorage sGtOCTHpPerStaminaStore(GtOCTHpPerStaminafmt); DBCStorage sGtRegenMPPerSptStore(GtRegenMPPerSptfmt); +DBCStorage sGtSpellScalingStore(GtSpellScalingfmt); DBCStorage sGtOCTBaseHPByClassStore(GtOCTBaseHPByClassfmt); DBCStorage sGtOCTBaseMPByClassStore(GtOCTBaseMPByClassfmt); @@ -396,8 +396,8 @@ void LoadDBCStores(const std::string& dataPath) //LoadDBC(availableDbcLocales, bad_dbc_files, sGtOCTRegenHPStore, dbcPath, "gtOCTRegenHP.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sGtOCTHpPerStaminaStore, dbcPath, "gtOCTHpPerStamina.dbc");//14545 //LoadDBC(dbcCount, availableDbcLocales, bad_dbc_files, sGtOCTRegenMPStore, dbcPath, "gtOCTRegenMP.dbc"); -- not used currently - //LoadDBC(availableDbcLocales, bad_dbc_files, sGtRegenHPPerSptStore, dbcPath, "gtRegenHPPerSpt.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sGtRegenMPPerSptStore, dbcPath, "gtRegenMPPerSpt.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sGtSpellScalingStore, dbcPath, "gtSpellScaling.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sGtOCTBaseHPByClassStore, dbcPath, "gtOCTBaseHPByClass.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sGtOCTBaseMPByClassStore, dbcPath, "gtOCTBaseMPByClass.dbc");//15595 diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h index b8ecb9398fb..0c19a64f12c 100755 --- a/src/server/game/DataStores/DBCStores.h +++ b/src/server/game/DataStores/DBCStores.h @@ -118,9 +118,9 @@ extern DBCStorage sGtChanceToSpellCritBaseStore; extern DBCStorage sGtChanceToSpellCritStore; extern DBCStorage sGtOCTClassCombatRatingScalarStore; //extern DBCStorage sGtOCTRegenMPStore; -- not used currently -extern DBCStorage sGtRegenHPPerSptStore; extern DBCStorage sGtOCTHpPerStaminaStore; extern DBCStorage sGtRegenMPPerSptStore; +extern DBCStorage sGtSpellScalingStore; extern DBCStorage sGtOCTBaseHPByClassStore; extern DBCStorage sGtOCTBaseMPByClassStore; extern DBCStorage sHolidaysStore; diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index b62f86e6799..56f422faf9d 100644 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -1117,6 +1117,11 @@ struct GtRegenMPPerSptEntry float ratio; }; +struct GtSpellScalingEntry +{ + float value; +} + struct GtOCTBaseHPByClassEntry { float ratio; diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index a19dfd0b803..9c82497b15d 100755 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -75,8 +75,8 @@ const char GtChanceToSpellCritfmt[]="xf"; const char GtOCTClassCombatRatingScalarfmt[]="df"; const char GtOCTRegenHPfmt[]="f"; //const char GtOCTRegenMPfmt[]="f"; -const char GtRegenHPPerSptfmt[]="f"; const char GtRegenMPPerSptfmt[]="xf"; +const char GtSpellScalingfmt[]="df"; const char GtOCTBaseHPByClassfmt[]="df"; const char GtOCTBaseMPByClassfmt[]="df"; const char Holidaysfmt[]="niiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiixxsiix"; -- cgit v1.2.3 From 0b157c90662b03a9cc25f03f326accb6bda350eb Mon Sep 17 00:00:00 2001 From: kiper Date: Tue, 14 Aug 2012 01:49:18 +0200 Subject: Core/Globals: Add 5th field in reputation_spillover_template for Bilgewater Cartel/Gilneas spillover reputation. --- sql/updates/world/2012_08_12_03_world_misc_434.sql | 38 ++++++++++++++++++++++ ...2012_08_14_00_reputation_spillover_template.sql | 12 +++++++ sql/updates/world/2012_08_17_00_world_misc_434.sql | 38 ---------------------- src/server/game/Globals/ObjectMgr.cpp | 13 ++++++-- src/server/game/Miscellaneous/SharedDefines.h | 2 +- 5 files changed, 62 insertions(+), 41 deletions(-) create mode 100644 sql/updates/world/2012_08_12_03_world_misc_434.sql create mode 100644 sql/updates/world/2012_08_14_00_reputation_spillover_template.sql delete mode 100644 sql/updates/world/2012_08_17_00_world_misc_434.sql (limited to 'src') diff --git a/sql/updates/world/2012_08_12_03_world_misc_434.sql b/sql/updates/world/2012_08_12_03_world_misc_434.sql new file mode 100644 index 00000000000..aa6c11ee1f8 --- /dev/null +++ b/sql/updates/world/2012_08_12_03_world_misc_434.sql @@ -0,0 +1,38 @@ +DELETE FROM `creature_text` WHERE `entry`=2768; +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES +(2768,0,0,'Ok, $N. Follow me to the cave where I''ll attempt to harness the power of the rune stone into these goggles.',12,0,100,0,0,0,'Professor Phizzlethorpe - SAY_PROGRESS_1'), +(2768,1,0,'I discovered this cave on our first day here. I believe the energy in the stone can be used to our advantage.',12,0,100,0,0,0,'Professor Phizzlethorpe - SAY_PROGRESS_2'), +(2768,2,0,'I''ll begin drawing energy from the stone. Your job, $N, is to defend me. This place is cursed... trust me.',12,0,100,0,0,0,'Professor Phizzlethorpe - SAY_PROGRESS_3'), +(2768,3,0,'%s begins tinkering with the goggles before the stone.',16,0,100,0,0,0,'Professor Phizzlethorpe - EMOTE_PROGRESS_4'), +(2768,4,0,'Help!!! Get these things off me so I can get my work done!',12,0,100,0,0,0,'Professor Phizzlethorpe - SAY_AGGRO'), +(2768,5,0,'Almost done! Just a little longer!',12,0,100,0,0,0,'Professor Phizzlethorpe - SAY_PROGRESS_5'), +(2768,6,0,'I''ve done it! I have harnessed the power of the stone into the goggles! Let''s get out of here!',12,0,100,0,0,0,'Professor Phizzlethorpe - SAY_PROGRESS_6'), +(2768,7,0,'Phew! Glad to be back from that creepy cave.',12,0,100,0,0,0,'Professor Phizzlethorpe - SAY_PROGRESS_7'), +(2768,8,0,'%s hands one glowing goggles over to Doctor Draxlegauge.',16,0,100,0,0,0,'Professor Phizzlethorpe - EMOTE_PROGRESS_8'), +(2768,9,0,'Doctor Draxlegauge will give you further instructions, $N. Many thanks for your help!',12,0,100,0,0,0,'Professor Phizzlethorpe - SAY_PROGRESS_9'); + +DELETE FROM `script_waypoint` WHERE `entry`=2768; +INSERT INTO `script_waypoint` (`entry`, `pointid`, `location_x`, `location_y`, `location_z`, `waittime`, `point_comment`) VALUES +(2768,1,-2072.32,-2089.59,9.14603,0,''), +(2768,2,-2078.18,-2096.31,10.8916,0,''), +(2768,3,-2079.21,-2105.22,13.3174,0,''), +(2768,4,-2074.81,-2108.72,14.1485,0,''), +(2768,5,-2076,-2116.21,16.3934,0,''), +(2768,6,-2073.31,-2123.92,18.6202,4000,''), +(2768,7,-2064.41,-2133.33,21.5776,0,''), +(2768,8,-2044.08,-2153.12,20.121,18000,''), +(2768,9,-2044.08,-2153.12,20.121,3000,''), +(2768,10,-2044.08,-2153.12,20.121,0,''), +(2768,11,-2044.08,-2153.12,20.121,14000,''), +(2768,12,-2063.89,-2133.33,21.5648,0,''), +(2768,13,-2075,-2121.98,17.8443,0,''), +(2768,14,-2074.83,-2108.53,14.1036,0,''), +(2768,15,-2079.59,-2091.61,9.80862,0,''), +(2768,16,-2071.29,-2086.44,8.5181,0,''), +(2768,17,-2066.46,-2085.97,8.9241,7000,''); + +DELETE FROM `creature_questrelation` WHERE `id`=2768 AND `quest`=26050; +INSERT INTO `creature_questrelation` (`id`, `quest`) +VALUES (2768, 26050); + +UPDATE `creature_template` SET `ScriptName`='npc_professor_phizzlethorpe' WHERE `entry`=2768; \ No newline at end of file diff --git a/sql/updates/world/2012_08_14_00_reputation_spillover_template.sql b/sql/updates/world/2012_08_14_00_reputation_spillover_template.sql new file mode 100644 index 00000000000..cc7e011ca43 --- /dev/null +++ b/sql/updates/world/2012_08_14_00_reputation_spillover_template.sql @@ -0,0 +1,12 @@ +ALTER TABLE `reputation_spillover_template` +ADD COLUMN `faction5` SMALLINT(6) UNSIGNED DEFAULT '0' NOT NULL AFTER `rank_4`, +ADD COLUMN `rate_5` FLOAT DEFAULT '0' NOT NULL AFTER `faction5`, +ADD COLUMN `rank_5` TINYINT(3) UNSIGNED DEFAULT '0' NOT NULL AFTER `rate_5`; + +UPDATE `reputation_spillover_template` SET `faction5`=1134,`rate_5`=0.25,`rank_5`=7 WHERE `faction` IN (72,47,54,930,69); +UPDATE `reputation_spillover_template` SET `faction5`=1133,`rate_5`=0.25,`rank_5`=7 WHERE `faction` IN (76,530,911,81,68); + +DELETE FROM `reputation_spillover_template` WHERE `faction` IN (1134,1133); +INSERT INTO `reputation_spillover_template`(`faction`,`faction1`,`rate_1`,`rank_1`,`faction2`,`rate_2`,`rank_2`,`faction3`,`rate_3`,`rank_3`,`faction4`,`rate_4`,`rank_4`,`faction5`,`rate_5`,`rank_5`) VALUES +(1134,72,0.25,7,47,0.27,7,54,0.25,7,930,0.25,7,69,0.25,7), +(1133,76,0.25,7,530,0.27,7,911,0.25,7,81,0.25,7,68,0.25,7), \ No newline at end of file diff --git a/sql/updates/world/2012_08_17_00_world_misc_434.sql b/sql/updates/world/2012_08_17_00_world_misc_434.sql deleted file mode 100644 index aa6c11ee1f8..00000000000 --- a/sql/updates/world/2012_08_17_00_world_misc_434.sql +++ /dev/null @@ -1,38 +0,0 @@ -DELETE FROM `creature_text` WHERE `entry`=2768; -INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES -(2768,0,0,'Ok, $N. Follow me to the cave where I''ll attempt to harness the power of the rune stone into these goggles.',12,0,100,0,0,0,'Professor Phizzlethorpe - SAY_PROGRESS_1'), -(2768,1,0,'I discovered this cave on our first day here. I believe the energy in the stone can be used to our advantage.',12,0,100,0,0,0,'Professor Phizzlethorpe - SAY_PROGRESS_2'), -(2768,2,0,'I''ll begin drawing energy from the stone. Your job, $N, is to defend me. This place is cursed... trust me.',12,0,100,0,0,0,'Professor Phizzlethorpe - SAY_PROGRESS_3'), -(2768,3,0,'%s begins tinkering with the goggles before the stone.',16,0,100,0,0,0,'Professor Phizzlethorpe - EMOTE_PROGRESS_4'), -(2768,4,0,'Help!!! Get these things off me so I can get my work done!',12,0,100,0,0,0,'Professor Phizzlethorpe - SAY_AGGRO'), -(2768,5,0,'Almost done! Just a little longer!',12,0,100,0,0,0,'Professor Phizzlethorpe - SAY_PROGRESS_5'), -(2768,6,0,'I''ve done it! I have harnessed the power of the stone into the goggles! Let''s get out of here!',12,0,100,0,0,0,'Professor Phizzlethorpe - SAY_PROGRESS_6'), -(2768,7,0,'Phew! Glad to be back from that creepy cave.',12,0,100,0,0,0,'Professor Phizzlethorpe - SAY_PROGRESS_7'), -(2768,8,0,'%s hands one glowing goggles over to Doctor Draxlegauge.',16,0,100,0,0,0,'Professor Phizzlethorpe - EMOTE_PROGRESS_8'), -(2768,9,0,'Doctor Draxlegauge will give you further instructions, $N. Many thanks for your help!',12,0,100,0,0,0,'Professor Phizzlethorpe - SAY_PROGRESS_9'); - -DELETE FROM `script_waypoint` WHERE `entry`=2768; -INSERT INTO `script_waypoint` (`entry`, `pointid`, `location_x`, `location_y`, `location_z`, `waittime`, `point_comment`) VALUES -(2768,1,-2072.32,-2089.59,9.14603,0,''), -(2768,2,-2078.18,-2096.31,10.8916,0,''), -(2768,3,-2079.21,-2105.22,13.3174,0,''), -(2768,4,-2074.81,-2108.72,14.1485,0,''), -(2768,5,-2076,-2116.21,16.3934,0,''), -(2768,6,-2073.31,-2123.92,18.6202,4000,''), -(2768,7,-2064.41,-2133.33,21.5776,0,''), -(2768,8,-2044.08,-2153.12,20.121,18000,''), -(2768,9,-2044.08,-2153.12,20.121,3000,''), -(2768,10,-2044.08,-2153.12,20.121,0,''), -(2768,11,-2044.08,-2153.12,20.121,14000,''), -(2768,12,-2063.89,-2133.33,21.5648,0,''), -(2768,13,-2075,-2121.98,17.8443,0,''), -(2768,14,-2074.83,-2108.53,14.1036,0,''), -(2768,15,-2079.59,-2091.61,9.80862,0,''), -(2768,16,-2071.29,-2086.44,8.5181,0,''), -(2768,17,-2066.46,-2085.97,8.9241,7000,''); - -DELETE FROM `creature_questrelation` WHERE `id`=2768 AND `quest`=26050; -INSERT INTO `creature_questrelation` (`id`, `quest`) -VALUES (2768, 26050); - -UPDATE `creature_template` SET `ScriptName`='npc_professor_phizzlethorpe' WHERE `entry`=2768; \ No newline at end of file diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 897446a73f9..c63f599cd45 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -6804,8 +6804,8 @@ void ObjectMgr::LoadReputationSpilloverTemplate() _repSpilloverTemplateStore.clear(); // for reload case - uint32 count = 0; // 0 1 2 3 4 5 6 7 8 9 10 11 12 - QueryResult result = WorldDatabase.Query("SELECT faction, faction1, rate_1, rank_1, faction2, rate_2, rank_2, faction3, rate_3, rank_3, faction4, rate_4, rank_4 FROM reputation_spillover_template"); + uint32 count = 0; // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 + QueryResult result = WorldDatabase.Query("SELECT faction, faction1, rate_1, rank_1, faction2, rate_2, rank_2, faction3, rate_3, rank_3, faction4, rate_4, rank_4, faction5, rate_5, rank_5 FROM reputation_spillover_template"); if (!result) { @@ -6834,6 +6834,9 @@ void ObjectMgr::LoadReputationSpilloverTemplate() repTemplate.faction[3] = fields[10].GetUInt16(); repTemplate.faction_rate[3] = fields[11].GetFloat(); repTemplate.faction_rank[3] = fields[12].GetUInt8(); + repTemplate.faction[4] = fields[13].GetUInt16(); + repTemplate.faction_rate[4] = fields[14].GetFloat(); + repTemplate.faction_rank[4] = fields[15].GetUInt16(); FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionId); @@ -6899,6 +6902,12 @@ void ObjectMgr::LoadReputationSpilloverTemplate() sLog->outError(LOG_FILTER_SQL, "Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", repTemplate.faction[3]); continue; } + FactionEntry const* factionEntry4 = sFactionStore.LookupEntry(repTemplate.faction[4]); + if (repTemplate.faction[4] && !factionEntry4) + { + sLog->outError(LOG_FILTER_SQL, "Faction (faction.dbc) %u does not exist but is used in `reputation_spillover_template`", repTemplate.faction[4]); + continue; + } _repSpilloverTemplateStore[factionId] = repTemplate; diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index cd44c362258..1774facf874 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -153,7 +153,7 @@ enum ReputationRank #define MIN_REPUTATION_RANK (REP_HATED) #define MAX_REPUTATION_RANK 8 -#define MAX_SPILLOVER_FACTIONS 4 +#define MAX_SPILLOVER_FACTIONS 5 enum MoneyConstants { -- cgit v1.2.3 From c8eeb1f9e6d804c2b87843436fb132f9ebd75c8d Mon Sep 17 00:00:00 2001 From: Venugh Date: Tue, 14 Aug 2012 01:57:42 +0200 Subject: Core/AI: Removed EventAI handling. is not needed more for cataclysm... move a sql to correct place. --- sql/updates/2012_08_13_00_world_quest_template.sql | 1 - .../world/2012_08_13_00_world_quest_template.sql | 1 + sql/updates/world/2012_08_14_00_world_event_ai.sql | 3 + sql/updates/world/2012_08_14_01_world_commands.sql | 1 + src/server/game/AI/CreatureAIRegistry.cpp | 2 - src/server/game/AI/EventAI/CreatureEventAI.cpp | 1386 -------------------- src/server/game/AI/EventAI/CreatureEventAI.h | 645 --------- src/server/game/AI/EventAI/CreatureEventAIMgr.cpp | 743 ----------- src/server/game/AI/EventAI/CreatureEventAIMgr.h | 49 - src/server/game/CMakeLists.txt | 1 - src/server/game/Conditions/ConditionMgr.cpp | 2 +- src/server/game/World/World.cpp | 10 - src/server/scripts/CMakeLists.txt | 1 - src/server/scripts/Commands/cs_reload.cpp | 39 - src/server/shared/Logging/Appender.h | 2 +- src/server/worldserver/CMakeLists.txt | 1 - 16 files changed, 7 insertions(+), 2880 deletions(-) delete mode 100644 sql/updates/2012_08_13_00_world_quest_template.sql create mode 100644 sql/updates/world/2012_08_13_00_world_quest_template.sql create mode 100644 sql/updates/world/2012_08_14_00_world_event_ai.sql create mode 100644 sql/updates/world/2012_08_14_01_world_commands.sql delete mode 100755 src/server/game/AI/EventAI/CreatureEventAI.cpp delete mode 100755 src/server/game/AI/EventAI/CreatureEventAI.h delete mode 100755 src/server/game/AI/EventAI/CreatureEventAIMgr.cpp delete mode 100755 src/server/game/AI/EventAI/CreatureEventAIMgr.h (limited to 'src') diff --git a/sql/updates/2012_08_13_00_world_quest_template.sql b/sql/updates/2012_08_13_00_world_quest_template.sql deleted file mode 100644 index b3c5a45a668..00000000000 --- a/sql/updates/2012_08_13_00_world_quest_template.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE `quest_template` CHANGE `MinLevel` `MinLevel` tinyint(4) NOT NULL DEFAULT '0'; diff --git a/sql/updates/world/2012_08_13_00_world_quest_template.sql b/sql/updates/world/2012_08_13_00_world_quest_template.sql new file mode 100644 index 00000000000..b3c5a45a668 --- /dev/null +++ b/sql/updates/world/2012_08_13_00_world_quest_template.sql @@ -0,0 +1 @@ +ALTER TABLE `quest_template` CHANGE `MinLevel` `MinLevel` tinyint(4) NOT NULL DEFAULT '0'; diff --git a/sql/updates/world/2012_08_14_00_world_event_ai.sql b/sql/updates/world/2012_08_14_00_world_event_ai.sql new file mode 100644 index 00000000000..3fe49aa4059 --- /dev/null +++ b/sql/updates/world/2012_08_14_00_world_event_ai.sql @@ -0,0 +1,3 @@ +DROP TABLE `creature_ai_scripts`; +DROP TABLE `creature_ai_summons`; +DROP TABLE `creature_ai_texts`; diff --git a/sql/updates/world/2012_08_14_01_world_commands.sql b/sql/updates/world/2012_08_14_01_world_commands.sql new file mode 100644 index 00000000000..aa030e01adb --- /dev/null +++ b/sql/updates/world/2012_08_14_01_world_commands.sql @@ -0,0 +1 @@ +DELETE FROM `command` WHERE `name`='reload all eventai'; diff --git a/src/server/game/AI/CreatureAIRegistry.cpp b/src/server/game/AI/CreatureAIRegistry.cpp index e5c689da339..564eb7209f1 100755 --- a/src/server/game/AI/CreatureAIRegistry.cpp +++ b/src/server/game/AI/CreatureAIRegistry.cpp @@ -22,7 +22,6 @@ #include "GuardAI.h" #include "PetAI.h" #include "TotemAI.h" -#include "CreatureEventAI.h" #include "RandomMovementGenerator.h" #include "MovementGeneratorImpl.h" #include "CreatureAIRegistry.h" @@ -46,7 +45,6 @@ namespace AIRegistry (new CreatureAIFactory("CombatAI"))->RegisterSelf(); (new CreatureAIFactory("ArcherAI"))->RegisterSelf(); (new CreatureAIFactory("TurretAI"))->RegisterSelf(); - (new CreatureAIFactory("EventAI"))->RegisterSelf(); (new CreatureAIFactory("VehicleAI"))->RegisterSelf(); (new CreatureAIFactory("SmartAI"))->RegisterSelf(); diff --git a/src/server/game/AI/EventAI/CreatureEventAI.cpp b/src/server/game/AI/EventAI/CreatureEventAI.cpp deleted file mode 100755 index 82abfc0454c..00000000000 --- a/src/server/game/AI/EventAI/CreatureEventAI.cpp +++ /dev/null @@ -1,1386 +0,0 @@ -/* - * Copyright (C) 2008-2012 TrinityCore - * Copyright (C) 2005-2009 MaNGOS - * - * 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; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; 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, see . - */ - -#include "Common.h" -#include "CreatureEventAI.h" -#include "CreatureEventAIMgr.h" -#include "ObjectMgr.h" -#include "Spell.h" -#include "World.h" -#include "Cell.h" -#include "CellImpl.h" -#include "GameEventMgr.h" -#include "GridNotifiers.h" -#include "GridNotifiersImpl.h" -#include "InstanceScript.h" -#include "SpellMgr.h" -#include "CreatureAIImpl.h" -#include "ConditionMgr.h" - -bool CreatureEventAIHolder::UpdateRepeatTimer(Creature* creature, uint32 repeatMin, uint32 repeatMax) -{ - if (repeatMin == repeatMax) - Time = repeatMin; - else if (repeatMax > repeatMin) - Time = urand(repeatMin, repeatMax); - else - { - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u using Event %u (Type = %u) has RandomMax < RandomMin. Event repeating disabled.", creature->GetEntry(), Event.event_id, Event.event_type); - Enabled = false; - return false; - } - - return true; -} - -int CreatureEventAI::Permissible(const Creature* creature) -{ - if (creature->GetAIName() == "EventAI") - return PERMIT_BASE_SPECIAL; - return PERMIT_BASE_NO; -} - -CreatureEventAI::CreatureEventAI(Creature* c) : CreatureAI(c) -{ - // Need make copy for filter unneeded steps and safe in case table reload - CreatureEventAI_Event_Map::const_iterator CreatureEvents = sEventAIMgr->GetCreatureEventAIMap().find(me->GetEntry()); - if (CreatureEvents != sEventAIMgr->GetCreatureEventAIMap().end()) - { - std::vector::const_iterator i; - for (i = (*CreatureEvents).second.begin(); i != (*CreatureEvents).second.end(); ++i) - { - //Debug check - #ifndef TRINITY_DEBUG - if ((*i).event_flags & EFLAG_DEBUG_ONLY) - continue; - #endif - if (me->GetMap()->IsDungeon()) - { - if ((1 << (me->GetMap()->GetSpawnMode()+1)) & (*i).event_flags) - { - //event flagged for instance mode - m_CreatureEventAIList.push_back(CreatureEventAIHolder(*i)); - } - continue; - } - m_CreatureEventAIList.push_back(CreatureEventAIHolder(*i)); - } - //EventMap had events but they were not added because they must be for instance - if (m_CreatureEventAIList.empty()) - sLog->outError(LOG_FILTER_GENERAL, "CreatureEventAI: Creature %u has events but no events added to list because of instance flags.", me->GetEntry()); - } - else - sLog->outError(LOG_FILTER_GENERAL, "CreatureEventAI: EventMap for Creature %u is empty but creature is using CreatureEventAI.", me->GetEntry()); - - m_bEmptyList = m_CreatureEventAIList.empty(); - m_Phase = 0; - m_CombatMovementEnabled = true; - m_MeleeEnabled = true; - m_AttackDistance = 0.0f; - m_AttackAngle = 0.0f; - - m_InvincibilityHpLevel = 0; - - //Handle Spawned Events - if (!m_bEmptyList) - { - for (CreatureEventAIList::iterator i = m_CreatureEventAIList.begin(); i != m_CreatureEventAIList.end(); ++i) - if (SpawnedEventConditionsCheck((*i).Event)) - ProcessEvent(*i); - } -} - -bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& holder, Unit* actionInvoker /*=NULL*/) -{ - if (!holder.Enabled || holder.Time) - return false; - - //Check the inverse phase mask (event doesn't trigger if current phase bit is set in mask) - if (holder.Event.event_inverse_phase_mask & (1 << m_Phase)) - return false; - - CreatureEventAI_Event const& event = holder.Event; - - //Check event conditions based on the event type, also reset events - switch (event.event_type) - { - case EVENT_T_TIMER: - if (!me->isInCombat()) - return false; - - //Repeat Timers - holder.UpdateRepeatTimer(me, event.timer.repeatMin, event.timer.repeatMax); - break; - case EVENT_T_TIMER_OOC: - if (me->isInCombat()) - return false; - - //Repeat Timers - holder.UpdateRepeatTimer(me, event.timer.repeatMin, event.timer.repeatMax); - break; - case EVENT_T_HP: - { - if (!me->isInCombat() || !me->GetMaxHealth()) - return false; - - uint32 perc = uint32(me->GetHealthPct()); - - if (perc > event.percent_range.percentMax || perc < event.percent_range.percentMin) - return false; - - //Repeat Timers - holder.UpdateRepeatTimer(me, event.percent_range.repeatMin, event.percent_range.repeatMax); - break; - } - case EVENT_T_MANA: - { - if (!me->isInCombat() || !me->GetMaxPower(POWER_MANA)) - return false; - - uint32 perc = (me->GetPower(POWER_MANA)*100) / me->GetMaxPower(POWER_MANA); - - if (perc > event.percent_range.percentMax || perc < event.percent_range.percentMin) - return false; - - //Repeat Timers - holder.UpdateRepeatTimer(me, event.percent_range.repeatMin, event.percent_range.repeatMax); - break; - } - case EVENT_T_AGGRO: - break; - case EVENT_T_KILL: - //Repeat Timers - holder.UpdateRepeatTimer(me, event.kill.repeatMin, event.kill.repeatMax); - break; - case EVENT_T_DEATH: - case EVENT_T_EVADE: - break; - case EVENT_T_SPELLHIT: - //Spell hit is special case, param1 and param2 handled within CreatureEventAI::SpellHit - - //Repeat Timers - holder.UpdateRepeatTimer(me, event.spell_hit.repeatMin, event.spell_hit.repeatMax); - break; - case EVENT_T_RANGE: - //Repeat Timers - holder.UpdateRepeatTimer(me, event.range.repeatMin, event.range.repeatMax); - break; - case EVENT_T_OOC_LOS: - //Repeat Timers - holder.UpdateRepeatTimer(me, event.ooc_los.repeatMin, event.ooc_los.repeatMax); - break; - case EVENT_T_RESET: - case EVENT_T_SPAWNED: - break; - case EVENT_T_TARGET_HP: - { - if (!me->isInCombat() || !me->getVictim() || !me->getVictim()->GetMaxHealth()) - return false; - - uint32 perc = uint32(me->getVictim()->GetHealthPct()); - - if (perc > event.percent_range.percentMax || perc < event.percent_range.percentMin) - return false; - - //Repeat Timers - holder.UpdateRepeatTimer(me, event.percent_range.repeatMin, event.percent_range.repeatMax); - break; - } - case EVENT_T_TARGET_CASTING: - if (!me->isInCombat() || !me->getVictim() || !me->getVictim()->IsNonMeleeSpellCasted(false, false, true)) - return false; - - //Repeat Timers - holder.UpdateRepeatTimer(me, event.target_casting.repeatMin, event.target_casting.repeatMax); - break; - case EVENT_T_FRIENDLY_HP: - { - if (!me->isInCombat()) - return false; - - Unit* unit = DoSelectLowestHpFriendly((float)event.friendly_hp.radius, event.friendly_hp.hpDeficit); - if (!unit) - return false; - - actionInvoker = unit; - - //Repeat Timers - holder.UpdateRepeatTimer(me, event.friendly_hp.repeatMin, event.friendly_hp.repeatMax); - break; - } - case EVENT_T_FRIENDLY_IS_CC: - { - if (!me->isInCombat()) - return false; - - std::list pList; - DoFindFriendlyCC(pList, (float)event.friendly_is_cc.radius); - - //List is empty - if (pList.empty()) - return false; - - //We don't really care about the whole list, just return first available - actionInvoker = *(pList.begin()); - - //Repeat Timers - holder.UpdateRepeatTimer(me, event.friendly_is_cc.repeatMin, event.friendly_is_cc.repeatMax); - break; - } - case EVENT_T_FRIENDLY_MISSING_BUFF: - { - std::list pList; - DoFindFriendlyMissingBuff(pList, (float)event.friendly_buff.radius, event.friendly_buff.spellId); - - //List is empty - if (pList.empty()) - return false; - - //We don't really care about the whole list, just return first available - actionInvoker = *(pList.begin()); - - //Repeat Timers - holder.UpdateRepeatTimer(me, event.friendly_buff.repeatMin, event.friendly_buff.repeatMax); - break; - } - case EVENT_T_SUMMONED_UNIT: - { - //Prevent event from occuring on no unit or non creatures - if (!actionInvoker || actionInvoker->GetTypeId() != TYPEID_UNIT) - return false; - - //Creature id doesn't match up - if (actionInvoker->ToCreature()->GetEntry() != event.summon_unit.creatureId) - return false; - - //Repeat Timers - holder.UpdateRepeatTimer(me, event.summon_unit.repeatMin, event.summon_unit.repeatMax); - break; - } - case EVENT_T_TARGET_MANA: - { - if (!me->isInCombat() || !me->getVictim() || !me->getVictim()->GetMaxPower(POWER_MANA)) - return false; - - uint32 perc = (me->getVictim()->GetPower(POWER_MANA)*100) / me->getVictim()->GetMaxPower(POWER_MANA); - - if (perc > event.percent_range.percentMax || perc < event.percent_range.percentMin) - return false; - - //Repeat Timers - holder.UpdateRepeatTimer(me, event.percent_range.repeatMin, event.percent_range.repeatMax); - break; - } - case EVENT_T_REACHED_HOME: - case EVENT_T_RECEIVE_EMOTE: - break; - case EVENT_T_BUFFED: - { - //Note: checked only aura for effect 0, if need check aura for effect 1/2 then - // possible way: pack in event.buffed.amount 2 uint16 (ammount+effectIdx) - Aura const* aura = me->GetAura(event.buffed.spellId); - if (!aura || aura->GetStackAmount() < event.buffed.amount) - return false; - - //Repeat Timers - holder.UpdateRepeatTimer(me, event.buffed.repeatMin, event.buffed.repeatMax); - break; - } - case EVENT_T_TARGET_BUFFED: - { - //Prevent event from occuring on no unit - if (!actionInvoker) - return false; - - //Note: checked only aura for effect 0, if need check aura for effect 1/2 then - // possible way: pack in event.buffed.amount 2 uint16 (ammount+effectIdx) - Aura const* aura = actionInvoker->GetAura(event.buffed.spellId); - if (!aura || aura->GetStackAmount() < event.buffed.amount) - return false; - - //Repeat Timers - holder.UpdateRepeatTimer(me, event.buffed.repeatMin, event.buffed.repeatMax); - break; - } - default: - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u using Event %u has invalid Event Type(%u), missing from ProcessEvent() Switch.", me->GetEntry(), holder.Event.event_id, holder.Event.event_type); - break; - } - - //Disable non-repeatable events - if (!(holder.Event.event_flags & EFLAG_REPEATABLE)) - holder.Enabled = false; - - //Store random here so that all random actions match up - uint32 rnd = rand(); - - //Return if chance for event is not met - if (holder.Event.event_chance <= rnd % 100) - return false; - - //Process actions - for (uint8 j = 0; j < MAX_ACTIONS; ++j) - ProcessAction(holder.Event.action[j], rnd, holder.Event.event_id, actionInvoker); - - return true; -} - -void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 rnd, uint32 eventId, Unit* actionInvoker) -{ - switch (action.type) - { - case ACTION_T_TEXT: - { - if (!action.text.TextId1) - return; - - int32 temp = action.text.TextId1; - - if (action.text.TextId2 && action.text.TextId3) - temp = RAND(action.text.TextId1, action.text.TextId2, action.text.TextId3); - else if (action.text.TextId2 && urand(0, 1)) - temp = action.text.TextId2; - - if (temp) - { - Unit* target = NULL; - - if (actionInvoker) - { - if (actionInvoker->GetTypeId() == TYPEID_PLAYER) - target = actionInvoker; - else if (Unit* owner = actionInvoker->GetOwner()) - { - if (owner->GetTypeId() == TYPEID_PLAYER) - target = owner; - } - } - else - { - target = me->getVictim(); - if (target && target->GetTypeId() != TYPEID_PLAYER) - if (Unit* owner = target->GetOwner()) - if (owner->GetTypeId() == TYPEID_PLAYER) - target = owner; - } - - DoScriptText(temp, me, target); - } - break; - } - case ACTION_T_SET_FACTION: - { - if (action.set_faction.factionId) - me->setFaction(action.set_faction.factionId); - else - { - if (CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate(me->GetEntry())) - { - //if no id provided, assume reset and then use default - if (me->getFaction() != ci->faction_A) - me->setFaction(ci->faction_A); - } - } - break; - } - case ACTION_T_MORPH_TO_ENTRY_OR_MODEL: - { - if (action.morph.creatureId || action.morph.modelId) - { - //set model based on entry from creature_template - if (action.morph.creatureId) - { - if (CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate(action.morph.creatureId)) - { - uint32 display_id = sObjectMgr->ChooseDisplayId(0, ci); - me->SetDisplayId(display_id); - } - } - //if no param1, then use value from param2 (modelId) - else - me->SetDisplayId(action.morph.modelId); - } - else - me->DeMorph(); - break; - } - case ACTION_T_SOUND: - me->PlayDirectSound(action.sound.soundId); - break; - case ACTION_T_EMOTE: - me->HandleEmoteCommand(action.emote.emoteId); - break; - case ACTION_T_RANDOM_SOUND: - { - int32 temp = GetRandActionParam(rnd, action.random_sound.soundId1, action.random_sound.soundId2, action.random_sound.soundId3); - if (temp >= 0) - me->PlayDirectSound(temp); - break; - } - case ACTION_T_RANDOM_EMOTE: - { - int32 temp = GetRandActionParam(rnd, action.random_emote.emoteId1, action.random_emote.emoteId2, action.random_emote.emoteId3); - if (temp >= 0) - me->HandleEmoteCommand(temp); - break; - } - case ACTION_T_CAST: - { - Unit* target = GetTargetByType(action.cast.target, actionInvoker); - Unit* caster = me; - - if (!target) - return; - - if (action.cast.castFlags & CAST_FORCE_TARGET_SELF) - caster = target; - - //Allowed to cast only if not casting (unless we interrupt ourself) or if spell is triggered - bool canCast = !caster->IsNonMeleeSpellCasted(false) || (action.cast.castFlags & (CAST_TRIGGERED | CAST_INTERRUPT_PREVIOUS)); - - // If cast flag CAST_AURA_NOT_PRESENT is active, check if target already has aura on them - if (action.cast.castFlags & CAST_AURA_NOT_PRESENT) - { - if (target->HasAura(action.cast.spellId)) - return; - } - - if (canCast) - { - const SpellInfo* tSpell = sSpellMgr->GetSpellInfo(action.cast.spellId); - - //Verify that spell exists - if (tSpell) - { - //Check if cannot cast spell - if (!(action.cast.castFlags & (CAST_FORCE_TARGET_SELF | CAST_FORCE_CAST)) && - !CanCast(target, tSpell, (action.cast.castFlags & CAST_TRIGGERED))) - { - //Melee current victim if flag not set - if (!(action.cast.castFlags & CAST_NO_MELEE_IF_OOM)) - { - if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE) - { - m_AttackDistance = 0.0f; - m_AttackAngle = 0.0f; - - me->GetMotionMaster()->MoveChase(me->getVictim(), m_AttackDistance, m_AttackAngle); - } - } - } - else - { - //Interrupt any previous spell - if (caster->IsNonMeleeSpellCasted(false) && action.cast.castFlags & CAST_INTERRUPT_PREVIOUS) - caster->InterruptNonMeleeSpells(false); - - caster->CastSpell(target, action.cast.spellId, (action.cast.castFlags & CAST_TRIGGERED)); - } - } - else - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: event %d creature %d attempt to cast spell that doesn't exist %d", eventId, me->GetEntry(), action.cast.spellId); - } - break; - } - case ACTION_T_SUMMON: - { - Unit* target = GetTargetByType(action.summon.target, actionInvoker); - - Creature* creature = NULL; - - if (action.summon.duration) - creature = me->SummonCreature(action.summon.creatureId, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, action.summon.duration); - else - creature = me->SummonCreature(action.summon.creatureId, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0); - - if (!creature) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: failed to spawn creature %u. Spawn event %d is on creature %d", action.summon.creatureId, eventId, me->GetEntry()); - else if (action.summon.target != TARGET_T_SELF && target) - creature->AI()->AttackStart(target); - break; - } - case ACTION_T_THREAT_SINGLE_PCT: - if (Unit* target = GetTargetByType(action.threat_single_pct.target, actionInvoker)) - me->getThreatManager().modifyThreatPercent(target, action.threat_single_pct.percent); - break; - case ACTION_T_THREAT_ALL_PCT: - { - std::list& threatList = me->getThreatManager().getThreatList(); - for (std::list::iterator i = threatList.begin(); i != threatList.end(); ++i) - if (Unit* Temp = Unit::GetUnit(*me, (*i)->getUnitGuid())) - me->getThreatManager().modifyThreatPercent(Temp, action.threat_all_pct.percent); - break; - } - case ACTION_T_QUEST_EVENT: - if (Unit* target = GetTargetByType(action.quest_event.target, actionInvoker)) - if (target->GetTypeId() == TYPEID_PLAYER) - target->ToPlayer()->AreaExploredOrEventHappens(action.quest_event.questId); - break; - case ACTION_T_CAST_EVENT: - if (Unit* target = GetTargetByType(action.cast_event.target, actionInvoker)) - if (target->GetTypeId() == TYPEID_PLAYER) - target->ToPlayer()->CastedCreatureOrGO(action.cast_event.creatureId, me->GetGUID(), action.cast_event.spellId); - break; - case ACTION_T_SET_UNIT_FIELD: - { - Unit* target = GetTargetByType(action.set_unit_field.target, actionInvoker); - - // not allow modify important for integrity object fields - if (action.set_unit_field.field < OBJECT_END || action.set_unit_field.field >= UNIT_END) - return; - - if (target) - target->SetUInt32Value(action.set_unit_field.field, action.set_unit_field.value); - - break; - } - case ACTION_T_SET_UNIT_FLAG: - if (Unit* target = GetTargetByType(action.unit_flag.target, actionInvoker)) - target->SetFlag(UNIT_FIELD_FLAGS, action.unit_flag.value); - break; - case ACTION_T_REMOVE_UNIT_FLAG: - if (Unit* target = GetTargetByType(action.unit_flag.target, actionInvoker)) - target->RemoveFlag(UNIT_FIELD_FLAGS, action.unit_flag.value); - break; - case ACTION_T_AUTO_ATTACK: - m_MeleeEnabled = action.auto_attack.state != 0; - break; - case ACTION_T_COMBAT_MOVEMENT: - // ignore no affect case - if (m_CombatMovementEnabled == (action.combat_movement.state != 0)) - return; - - m_CombatMovementEnabled = action.combat_movement.state != 0; - - //Allow movement (create new targeted movement gen only if idle) - if (m_CombatMovementEnabled) - { - Unit* victim = me->getVictim(); - if (me->isInCombat() && victim) - { - if (action.combat_movement.melee) - { - me->AddUnitState(UNIT_STATE_MELEE_ATTACKING); - me->SendMeleeAttackStart(victim); - } - if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == IDLE_MOTION_TYPE) - me->GetMotionMaster()->MoveChase(victim, m_AttackDistance, m_AttackAngle); // Targeted movement generator will start melee automatically, no need to send it explicitly - } - } - else - { - if (me->isInCombat()) - { - Unit* victim = me->getVictim(); - if (action.combat_movement.melee && victim) - { - me->ClearUnitState(UNIT_STATE_MELEE_ATTACKING); - me->SendMeleeAttackStop(victim); - } - if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE) - me->GetMotionMaster()->MoveIdle(); - } - } - break; - case ACTION_T_SET_PHASE: - m_Phase = action.set_phase.phase; - break; - case ACTION_T_INC_PHASE: - { - int32 new_phase = int32(m_Phase)+action.set_inc_phase.step; - if (new_phase < 0) - { - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %d decrease m_Phase under 0. CreatureEntry = %d", eventId, me->GetEntry()); - m_Phase = 0; - } - else if (new_phase >= MAX_PHASE) - { - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %d incremented m_Phase above %u. m_Phase mask cannot be used with phases past %u. CreatureEntry = %d", eventId, MAX_PHASE-1, MAX_PHASE-1, me->GetEntry()); - m_Phase = MAX_PHASE-1; - } - else - m_Phase = new_phase; - - break; - } - case ACTION_T_EVADE: - EnterEvadeMode(); - break; - case ACTION_T_FLEE_FOR_ASSIST: - me->DoFleeToGetAssistance(); - break; - case ACTION_T_QUEST_EVENT_ALL: - if (actionInvoker && actionInvoker->GetTypeId() == TYPEID_PLAYER) - { - if (Unit* Temp = Unit::GetUnit(*me, actionInvoker->GetGUID())) - if (Temp->GetTypeId() == TYPEID_PLAYER) - Temp->ToPlayer()->GroupEventHappens(action.quest_event_all.questId, me); - } - break; - case ACTION_T_CAST_EVENT_ALL: - { - std::list& threatList = me->getThreatManager().getThreatList(); - for (std::list::iterator i = threatList.begin(); i != threatList.end(); ++i) - if (Unit* Temp = Unit::GetUnit(*me, (*i)->getUnitGuid())) - if (Temp->GetTypeId() == TYPEID_PLAYER) - Temp->ToPlayer()->CastedCreatureOrGO(action.cast_event_all.creatureId, me->GetGUID(), action.cast_event_all.spellId); - break; - } - case ACTION_T_REMOVEAURASFROMSPELL: - if (Unit* target = GetTargetByType(action.remove_aura.target, actionInvoker)) - target->RemoveAurasDueToSpell(action.remove_aura.spellId); - break; - case ACTION_T_RANGED_MOVEMENT: - m_AttackDistance = (float)action.ranged_movement.distance; - m_AttackAngle = action.ranged_movement.angle/180.0f*M_PI; - - if (m_CombatMovementEnabled) - { - me->GetMotionMaster()->MoveChase(me->getVictim(), m_AttackDistance, m_AttackAngle); - } - break; - case ACTION_T_RANDOM_PHASE: - m_Phase = GetRandActionParam(rnd, action.random_phase.phase1, action.random_phase.phase2, action.random_phase.phase3); - break; - case ACTION_T_RANDOM_PHASE_RANGE: - if (action.random_phase_range.phaseMin <= action.random_phase_range.phaseMax) - m_Phase = urand(action.random_phase_range.phaseMin, action.random_phase_range.phaseMax); - else - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: ACTION_T_RANDOM_PHASE_RANGE cannot have Param2 < Param1. Event = %d. CreatureEntry = %d", eventId, me->GetEntry()); - break; - case ACTION_T_SUMMON_ID: - { - Unit* target = GetTargetByType(action.summon_id.target, actionInvoker); - - CreatureEventAI_Summon_Map::const_iterator i = sEventAIMgr->GetCreatureEventAISummonMap().find(action.summon_id.spawnId); - if (i == sEventAIMgr->GetCreatureEventAISummonMap().end()) - { - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: failed to spawn creature %u. Summon map index %u does not exist. EventID %d. CreatureID %d", action.summon_id.creatureId, action.summon_id.spawnId, eventId, me->GetEntry()); - return; - } - - Creature* creature = NULL; - if ((*i).second.SpawnTimeSecs) - creature = me->SummonCreature(action.summon_id.creatureId, (*i).second.position_x, (*i).second.position_y, (*i).second.position_z, (*i).second.orientation, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, (*i).second.SpawnTimeSecs); - else - creature = me->SummonCreature(action.summon_id.creatureId, (*i).second.position_x, (*i).second.position_y, (*i).second.position_z, (*i).second.orientation, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0); - - if (!creature) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: failed to spawn creature %u. EventId %d.Creature %d", action.summon_id.creatureId, eventId, me->GetEntry()); - else if (action.summon_id.target != TARGET_T_SELF && target) - creature->AI()->AttackStart(target); - - break; - } - case ACTION_T_KILLED_MONSTER: - //first attempt player who tapped creature - if (Player* player = me->GetLootRecipient()) - player->RewardPlayerAndGroupAtEvent(action.killed_monster.creatureId, player); // player as param is a hacky solution not to use GUID - else - { - //if not available, use actionInvoker - if (Unit* target = GetTargetByType(action.killed_monster.target, actionInvoker)) - if (Player* player2 = target->GetCharmerOrOwnerPlayerOrPlayerItself()) - player2->RewardPlayerAndGroupAtEvent(action.killed_monster.creatureId, player2); - } - break; - case ACTION_T_SET_INST_DATA: - { - InstanceScript* instance = me->GetInstanceScript(); - if (!instance) - { - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %d attempt to set instance data without instance script. Creature %d", eventId, me->GetEntry()); - return; - } - - instance->SetData(action.set_inst_data.field, action.set_inst_data.value); - break; - } - case ACTION_T_SET_INST_DATA64: - { - Unit* target = GetTargetByType(action.set_inst_data64.target, actionInvoker); - if (!target) - { - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %d attempt to set instance data64 but Target == NULL. Creature %d", eventId, me->GetEntry()); - return; - } - - InstanceScript* instance = me->GetInstanceScript(); - if (!instance) - { - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %d attempt to set instance data64 without instance script. Creature %d", eventId, me->GetEntry()); - return; - } - - instance->SetData64(action.set_inst_data64.field, target->GetGUID()); - break; - } - case ACTION_T_UPDATE_TEMPLATE: - if (me->GetEntry() == action.update_template.creatureId) - { - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %d ACTION_T_UPDATE_TEMPLATE call with param1 == current entry. Creature %d", eventId, me->GetEntry()); - return; - } - - me->UpdateEntry(action.update_template.creatureId, action.update_template.team ? HORDE : ALLIANCE); - break; - case ACTION_T_DIE: - if (me->isDead()) - { - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %d ACTION_T_DIE on dead creature. Creature %d", eventId, me->GetEntry()); - return; - } - me->Kill(me); - break; - case ACTION_T_ZONE_COMBAT_PULSE: - { - me->SetInCombatWithZone(); - break; - } - case ACTION_T_CALL_FOR_HELP: - { - me->CallForHelp((float)action.call_for_help.radius); - break; - } - break; - - // TRINITY ONLY - case ACTION_T_MOVE_RANDOM_POINT: //dosen't work in combat - { - float x, y, z; - me->GetClosePoint(x, y, z, me->GetObjectSize() / 3, (float)action.raw.param1); - me->GetMotionMaster()->MovePoint(0, x, y, z); - break; - } - case ACTION_T_SET_STAND_STATE: - me->SetStandState(UnitStandStateType(action.raw.param1)); - break; - case ACTION_T_SET_PHASE_MASK: - me->SetPhaseMask(action.raw.param1, true); - break; - case ACTION_T_SET_VISIBILITY: - me->SetVisible(bool(action.raw.param1)); - break; - case ACTION_T_SET_ACTIVE: - me->setActive(action.raw.param1 ? true : false); - break; - case ACTION_T_SET_AGGRESSIVE: - me->SetReactState(ReactStates(action.raw.param1)); - break; - case ACTION_T_ATTACK_START_PULSE: - AttackStart(me->SelectNearestTarget((float)action.raw.param1)); - break; - case ACTION_T_SUMMON_GO: - { - GameObject* object = NULL; - - float x, y, z; - me->GetPosition(x, y, z); - object = me->SummonGameObject(action.raw.param1, x, y, z, 0, 0, 0, 0, 0, action.raw.param2); - if (!object) - { - sLog->outError(LOG_FILTER_TSCR, "EventAI failed to spawn object %u. Spawn event %d is on creature %d", action.raw.param1, eventId, me->GetEntry()); - } - break; - } - - case ACTION_T_SET_SHEATH: - { - me->SetSheath(SheathState(action.set_sheath.sheath)); - break; - } - case ACTION_T_FORCE_DESPAWN: - { - me->DespawnOrUnsummon(action.forced_despawn.msDelay); - break; - } - case ACTION_T_SET_INVINCIBILITY_HP_LEVEL: - { - if (action.invincibility_hp_level.is_percent) - m_InvincibilityHpLevel = me->CountPctFromMaxHealth(action.invincibility_hp_level.hp_level); - else - m_InvincibilityHpLevel = action.invincibility_hp_level.hp_level; - break; - } - case ACTION_T_MOUNT_TO_ENTRY_OR_MODEL: - { - if (action.mount.creatureId || action.mount.modelId) - { - // set model based on entry from creature_template - if (action.mount.creatureId) - { - if (CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(action.mount.creatureId)) - { - uint32 display_id = sObjectMgr->ChooseDisplayId(0, cInfo); - me->Mount(display_id); - } - } - //if no param1, then use value from param2 (modelId) - else - me->Mount(action.mount.modelId); - } - else - me->Dismount(); - - break; - } - default: - break; - } -} - -void CreatureEventAI::JustRespawned() -{ - Reset(); - - if (m_bEmptyList) - return; - - //Handle Spawned Events - for (CreatureEventAIList::iterator i = m_CreatureEventAIList.begin(); i != m_CreatureEventAIList.end(); ++i) - if (SpawnedEventConditionsCheck((*i).Event)) - ProcessEvent(*i); -} - -void CreatureEventAI::Reset() -{ - m_EventUpdateTime = EVENT_UPDATE_TIME; - m_EventDiff = 0; - - if (m_bEmptyList) - return; - - for (CreatureEventAIList::iterator i = m_CreatureEventAIList.begin(); i != m_CreatureEventAIList.end(); ++i) - { - if ((*i).Event.event_type == EVENT_T_RESET) - ProcessEvent(*i); - } - - //Reset all events to enabled - for (CreatureEventAIList::iterator i = m_CreatureEventAIList.begin(); i != m_CreatureEventAIList.end(); ++i) - { - CreatureEventAI_Event const& event = (*i).Event; - switch (event.event_type) - { - //Reset all out of combat timers - case EVENT_T_TIMER_OOC: - { - if ((*i).UpdateRepeatTimer(me, event.timer.initialMin, event.timer.initialMax)) - (*i).Enabled = true; - break; - } - //default: - //TODO: enable below code line / verify this is correct to enable events previously disabled (ex. aggro yell), instead of enable this in void EnterCombat() - //(*i).Enabled = true; - //(*i).Time = 0; - //break; - } - } -} - -void CreatureEventAI::JustReachedHome() -{ - if (!m_bEmptyList) - { - for (CreatureEventAIList::iterator i = m_CreatureEventAIList.begin(); i != m_CreatureEventAIList.end(); ++i) - { - if ((*i).Event.event_type == EVENT_T_REACHED_HOME) - ProcessEvent(*i); - } - } - - Reset(); -} - -void CreatureEventAI::EnterEvadeMode() -{ - CreatureAI::EnterEvadeMode(); - - if (m_bEmptyList) - return; - - //Handle Evade events - for (CreatureEventAIList::iterator i = m_CreatureEventAIList.begin(); i != m_CreatureEventAIList.end(); ++i) - { - if ((*i).Event.event_type == EVENT_T_EVADE) - ProcessEvent(*i); - } -} - -void CreatureEventAI::JustDied(Unit* killer) -{ - Reset(); - - if (m_bEmptyList) - return; - - //Handle Evade events - for (CreatureEventAIList::iterator i = m_CreatureEventAIList.begin(); i != m_CreatureEventAIList.end(); ++i) - { - if ((*i).Event.event_type == EVENT_T_DEATH) - ProcessEvent(*i, killer); - } - - // reset phase after any death state events - m_Phase = 0; -} - -void CreatureEventAI::KilledUnit(Unit* victim) -{ - if (m_bEmptyList || victim->GetTypeId() != TYPEID_PLAYER) - return; - - for (CreatureEventAIList::iterator i = m_CreatureEventAIList.begin(); i != m_CreatureEventAIList.end(); ++i) - { - if ((*i).Event.event_type == EVENT_T_KILL) - ProcessEvent(*i, victim); - } -} - -void CreatureEventAI::JustSummoned(Creature* unit) -{ - if (m_bEmptyList || !unit) - return; - - for (CreatureEventAIList::iterator i = m_CreatureEventAIList.begin(); i != m_CreatureEventAIList.end(); ++i) - { - if ((*i).Event.event_type == EVENT_T_SUMMONED_UNIT) - ProcessEvent(*i, unit); - } -} - -void CreatureEventAI::EnterCombat(Unit* enemy) -{ - //Check for on combat start events - if (!m_bEmptyList) - { - for (CreatureEventAIList::iterator i = m_CreatureEventAIList.begin(); i != m_CreatureEventAIList.end(); ++i) - { - CreatureEventAI_Event const& event = (*i).Event; - switch (event.event_type) - { - case EVENT_T_AGGRO: - (*i).Enabled = true; - ProcessEvent(*i, enemy); - break; - //Reset all in combat timers - case EVENT_T_TIMER: - if ((*i).UpdateRepeatTimer(me, event.timer.initialMin, event.timer.initialMax)) - (*i).Enabled = true; - break; - //All normal events need to be re-enabled and their time set to 0 - default: - (*i).Enabled = true; - (*i).Time = 0; - break; - } - } - } - - m_EventUpdateTime = EVENT_UPDATE_TIME; - m_EventDiff = 0; -} - -void CreatureEventAI::AttackStart(Unit* who) -{ - if (!who) - return; - - if (me->Attack(who, m_MeleeEnabled)) - { - if (m_CombatMovementEnabled) - { - me->GetMotionMaster()->MoveChase(who, m_AttackDistance, m_AttackAngle); - } - else - { - me->GetMotionMaster()->MoveIdle(); - } - } -} - -void CreatureEventAI::MoveInLineOfSight(Unit* who) -{ - if (me->getVictim()) - return; - - //Check for OOC LOS Event - if (!m_bEmptyList) - { - for (CreatureEventAIList::iterator itr = m_CreatureEventAIList.begin(); itr != m_CreatureEventAIList.end(); ++itr) - { - if ((*itr).Event.event_type == EVENT_T_OOC_LOS) - { - //can trigger if closer than fMaxAllowedRange - float fMaxAllowedRange = (float)((*itr).Event.ooc_los.maxRange); - - //if range is ok and we are actually in LOS - if (me->IsWithinDistInMap(who, fMaxAllowedRange) && me->IsWithinLOSInMap(who)) - { - //if friendly event&&who is not hostile OR hostile event&&who is hostile - if (((*itr).Event.ooc_los.noHostile && !me->IsHostileTo(who)) || - ((!(*itr).Event.ooc_los.noHostile) && me->IsHostileTo(who))) - ProcessEvent(*itr, who); - } - } - } - } - - CreatureAI::MoveInLineOfSight(who); -} - -void CreatureEventAI::SpellHit(Unit* unit, const SpellInfo* spell) -{ - if (m_bEmptyList) - return; - - for (CreatureEventAIList::iterator i = m_CreatureEventAIList.begin(); i != m_CreatureEventAIList.end(); ++i) - if ((*i).Event.event_type == EVENT_T_SPELLHIT) - //If spell id matches (or no spell id) & if spell school matches (or no spell school) - if (!(*i).Event.spell_hit.spellId || spell->Id == (*i).Event.spell_hit.spellId) - if (spell->SchoolMask & (*i).Event.spell_hit.schoolMask) - ProcessEvent(*i, unit); -} - -void CreatureEventAI::UpdateAI(const uint32 diff) -{ - //Check if we are in combat (also updates calls threat update code) - bool Combat = UpdateVictim(); - - if (!m_bEmptyList) - { - //Events are only updated once every EVENT_UPDATE_TIME ms to prevent lag with large amount of events - if (m_EventUpdateTime <= diff) - { - m_EventDiff += diff; - - //Check for time based events - for (CreatureEventAIList::iterator i = m_CreatureEventAIList.begin(); i != m_CreatureEventAIList.end(); ++i) - { - //Decrement Timers - if ((*i).Time) - { - if (m_EventDiff <= (*i).Time) - { - //Do not decrement timers if event cannot trigger in this phase - if (!((*i).Event.event_inverse_phase_mask & (1 << m_Phase))) - (*i).Time -= m_EventDiff; - - //Skip processing of events that have time remaining - continue; - } - else (*i).Time = 0; - } - - //Events that are updated every EVENT_UPDATE_TIME - switch ((*i).Event.event_type) - { - case EVENT_T_TIMER_OOC: - ProcessEvent(*i); - break; - case EVENT_T_TIMER: - case EVENT_T_MANA: - case EVENT_T_HP: - case EVENT_T_TARGET_HP: - case EVENT_T_TARGET_CASTING: - case EVENT_T_FRIENDLY_HP: - if (me->getVictim()) - ProcessEvent(*i); - break; - case EVENT_T_RANGE: - if (me->getVictim()) - if (me->IsInMap(me->getVictim()) && me->InSamePhase(me->getVictim())) - if (me->IsInRange(me->getVictim(), (float)(*i).Event.range.minDist, (float)(*i).Event.range.maxDist)) - ProcessEvent(*i); - break; - default: - break; - } - } - - m_EventDiff = 0; - m_EventUpdateTime = EVENT_UPDATE_TIME; - } - else - { - m_EventDiff += diff; - m_EventUpdateTime -= diff; - } - } - - //Melee Auto-Attack - if (Combat && m_MeleeEnabled) - DoMeleeAttackIfReady(); -} - -inline uint32 CreatureEventAI::GetRandActionParam(uint32 rnd, uint32 param1, uint32 param2, uint32 param3) -{ - switch (rnd % 3) - { - case 0: return param1; - case 1: return param2; - case 2: return param3; - } - return 0; -} - -inline int32 CreatureEventAI::GetRandActionParam(uint32 rnd, int32 param1, int32 param2, int32 param3) -{ - switch (rnd % 3) - { - case 0: return param1; - case 1: return param2; - case 2: return param3; - } - return 0; -} - -inline Unit* CreatureEventAI::GetTargetByType(uint32 target, Unit* actionInvoker) -{ - switch (target) - { - case TARGET_T_SELF: - return me; - case TARGET_T_HOSTILE: - return me->getVictim(); - case TARGET_T_HOSTILE_SECOND_AGGRO: - return SelectTarget(SELECT_TARGET_TOPAGGRO, 1); - case TARGET_T_HOSTILE_LAST_AGGRO: - return SelectTarget(SELECT_TARGET_BOTTOMAGGRO, 0); - case TARGET_T_HOSTILE_RANDOM: - return SelectTarget(SELECT_TARGET_RANDOM, 0); - case TARGET_T_HOSTILE_RANDOM_NOT_TOP: - return SelectTarget(SELECT_TARGET_RANDOM, 1); - case TARGET_T_ACTION_INVOKER: - return actionInvoker; - default: - return NULL; - }; -} - -Unit* CreatureEventAI::DoSelectLowestHpFriendly(float range, uint32 minHPDiff) -{ - CellCoord p(Trinity::ComputeCellCoord(me->GetPositionX(), me->GetPositionY())); - Cell cell(p); - cell.SetNoCreate(); - - Unit* unit = NULL; - - Trinity::MostHPMissingInRange u_check(me, range, minHPDiff); - Trinity::UnitLastSearcher searcher(me, unit, u_check); - - /* - typedef TYPELIST_4(GameObject, Creature*except pets*, DynamicObject, Corpse*Bones*) AllGridObjectTypes; - This means that if we only search grid then we cannot possibly return pets or players so this is safe - */ - TypeContainerVisitor, GridTypeMapContainer > grid_unit_searcher(searcher); - - cell.Visit(p, grid_unit_searcher, *me->GetMap(), *me, range); - return unit; -} - -void CreatureEventAI::DoFindFriendlyCC(std::list& _list, float range) -{ - CellCoord p(Trinity::ComputeCellCoord(me->GetPositionX(), me->GetPositionY())); - Cell cell(p); - cell.SetNoCreate(); - - Trinity::FriendlyCCedInRange u_check(me, range); - Trinity::CreatureListSearcher searcher(me, _list, u_check); - - TypeContainerVisitor, GridTypeMapContainer > grid_creature_searcher(searcher); - - cell.Visit(p, grid_creature_searcher, *me->GetMap(), *me, range); -} - -void CreatureEventAI::DoFindFriendlyMissingBuff(std::list& _list, float range, uint32 spellid) -{ - CellCoord p(Trinity::ComputeCellCoord(me->GetPositionX(), me->GetPositionY())); - Cell cell(p); - cell.SetNoCreate(); - - Trinity::FriendlyMissingBuffInRange u_check(me, range, spellid); - Trinity::CreatureListSearcher searcher(me, _list, u_check); - - TypeContainerVisitor, GridTypeMapContainer > grid_creature_searcher(searcher); - - cell.Visit(p, grid_creature_searcher, *me->GetMap(), *me, range); -} - -// ********************************* -// *** Functions used globally *** - -void CreatureEventAI::DoScriptText(int32 textEntry, WorldObject* source, Unit* target) -{ - if (!source) - { - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: DoScriptText entry %i, invalid Source pointer.", textEntry); - return; - } - - if (textEntry >= 0) - { - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: DoScriptText with source entry %u (TypeId=%u, guid=%u) attempts to process text entry %i, but text entry must be negative.", source->GetEntry(), source->GetTypeId(), source->GetGUIDLow(), textEntry); - return; - } - - CreatureEventAI_TextMap::const_iterator i = sEventAIMgr->GetCreatureEventAITextMap().find(textEntry); - - if (i == sEventAIMgr->GetCreatureEventAITextMap().end()) - { - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: DoScriptText with source entry %u (TypeId=%u, guid=%u) could not find text entry %i.", source->GetEntry(), source->GetTypeId(), source->GetGUIDLow(), textEntry); - return; - } - - sLog->outDebug(LOG_FILTER_DATABASE_AI, "CreatureEventAI: DoScriptText: text entry=%i, Sound=%u, Type=%u, Language=%u, Emote=%u", textEntry, (*i).second.SoundId, (*i).second.Type, (*i).second.Language, (*i).second.Emote); - - if ((*i).second.SoundId) - { - if (sSoundEntriesStore.LookupEntry((*i).second.SoundId)) - source->PlayDirectSound((*i).second.SoundId); - else - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: DoScriptText entry %i tried to process invalid sound id %u.", textEntry, (*i).second.SoundId); - } - - if ((*i).second.Emote) - { - if (source->GetTypeId() == TYPEID_UNIT || source->GetTypeId() == TYPEID_PLAYER) - { - ((Unit*)source)->HandleEmoteCommand((*i).second.Emote); - } - else - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: DoScriptText entry %i tried to process emote for invalid TypeId (%u).", textEntry, source->GetTypeId()); - } - - switch ((*i).second.Type) - { - case CHAT_TYPE_SAY: - source->MonsterSay(textEntry, (*i).second.Language, target ? target->GetGUID() : 0); - break; - case CHAT_TYPE_YELL: - source->MonsterYell(textEntry, (*i).second.Language, target ? target->GetGUID() : 0); - break; - case CHAT_TYPE_TEXT_EMOTE: - source->MonsterTextEmote(textEntry, target ? target->GetGUID() : 0); - break; - case CHAT_TYPE_BOSS_EMOTE: - source->MonsterTextEmote(textEntry, target ? target->GetGUID() : 0, true); - break; - case CHAT_TYPE_WHISPER: - { - if (target && target->GetTypeId() == TYPEID_PLAYER) - source->MonsterWhisper(textEntry, target->GetGUID()); - else sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", textEntry); - }break; - case CHAT_TYPE_BOSS_WHISPER: - { - if (target && target->GetTypeId() == TYPEID_PLAYER) - source->MonsterWhisper(textEntry, target->GetGUID(), true); - else sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", textEntry); - }break; - case CHAT_TYPE_ZONE_YELL: - source->MonsterYellToZone(textEntry, (*i).second.Language, target ? target->GetGUID() : 0); - break; - } -} - -bool CreatureEventAI::CanCast(Unit* target, SpellInfo const* spell, bool triggered) -{ - //No target so we can't cast - if (!target || !spell) - return false; - - //Silenced so we can't cast - if (!triggered && me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED)) - return false; - - //Check for power - if (!triggered && (uint32)me->GetPower((Powers)spell->PowerType) < spell->CalcPowerCost(me, spell->GetSchoolMask())) - return false; - - //Unit is out of range of this spell - if (!me->IsInRange(target, spell->GetMinRange(false), spell->GetMaxRange(false))) - return false; - - return true; -} - -void CreatureEventAI::ReceiveEmote(Player* player, uint32 textEmote) -{ - if (m_bEmptyList) - return; - - for (CreatureEventAIList::iterator itr = m_CreatureEventAIList.begin(); itr != m_CreatureEventAIList.end(); ++itr) - { - if ((*itr).Event.event_type == EVENT_T_RECEIVE_EMOTE) - { - if ((*itr).Event.receive_emote.emoteId != textEmote) - return; - - Condition cond; - cond.ConditionType = ConditionTypes((*itr).Event.receive_emote.condition); - cond.ConditionValue1 = (*itr).Event.receive_emote.conditionValue1; - cond.ConditionValue2 = (*itr).Event.receive_emote.conditionValue2; - - ConditionSourceInfo srcInfo = ConditionSourceInfo(player); - if (cond.Meets(srcInfo)) - { - sLog->outDebug(LOG_FILTER_DATABASE_AI, "CreatureEventAI: ReceiveEmote CreatureEventAI: Condition ok, processing"); - ProcessEvent(*itr, player); - } - } - } -} - -void CreatureEventAI::DamageTaken(Unit* /*done_by*/, uint32& damage) -{ - if (m_InvincibilityHpLevel > 0 && me->GetHealth() < m_InvincibilityHpLevel+damage) - { - if (me->GetHealth() <= m_InvincibilityHpLevel) - damage = 0; - else - damage = me->GetHealth() - m_InvincibilityHpLevel; - } -} - -bool CreatureEventAI::SpawnedEventConditionsCheck(CreatureEventAI_Event const& event) -{ - if (event.event_type != EVENT_T_SPAWNED) - return false; - - switch (event.spawned.condition) - { - case SPAWNED_EVENT_ALWAY: - // always - return true; - case SPAWNED_EVENT_MAP: - // map ID check - return me->GetMapId() == event.spawned.conditionValue1; - case SPAWNED_EVENT_ZONE: - { - // zone ID check - uint32 zone, area; - me->GetZoneAndAreaId(zone, area); - return zone == event.spawned.conditionValue1 || area == event.spawned.conditionValue1; - } - default: - break; - } - - return false; -} diff --git a/src/server/game/AI/EventAI/CreatureEventAI.h b/src/server/game/AI/EventAI/CreatureEventAI.h deleted file mode 100755 index b9e1ae32be4..00000000000 --- a/src/server/game/AI/EventAI/CreatureEventAI.h +++ /dev/null @@ -1,645 +0,0 @@ -/* - * Copyright (C) 2008-2012 TrinityCore - * Copyright (C) 2005-2009 MaNGOS - * - * 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; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; 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, see . - */ - -#ifndef TRINITY_CREATURE_EAI_H -#define TRINITY_CREATURE_EAI_H - -#include "Common.h" -#include "Creature.h" -#include "CreatureAI.h" -#include "Unit.h" - -class Player; -class WorldObject; - -#define EVENT_UPDATE_TIME 500 -#define MAX_ACTIONS 3 -#define MAX_PHASE 32 - -enum EventAI_Type -{ - EVENT_T_TIMER = 0, // InitialMin, InitialMax, RepeatMin, RepeatMax - EVENT_T_TIMER_OOC = 1, // InitialMin, InitialMax, RepeatMin, RepeatMax - EVENT_T_HP = 2, // HPMax%, HPMin%, RepeatMin, RepeatMax - EVENT_T_MANA = 3, // ManaMax%, ManaMin% RepeatMin, RepeatMax - EVENT_T_AGGRO = 4, // NONE - EVENT_T_KILL = 5, // RepeatMin, RepeatMax - EVENT_T_DEATH = 6, // NONE - EVENT_T_EVADE = 7, // NONE - EVENT_T_SPELLHIT = 8, // SpellID, School, RepeatMin, RepeatMax - EVENT_T_RANGE = 9, // MinDist, MaxDist, RepeatMin, RepeatMax - EVENT_T_OOC_LOS = 10, // NoHostile, MaxRnage, RepeatMin, RepeatMax - EVENT_T_SPAWNED = 11, // Condition, CondValue1 - EVENT_T_TARGET_HP = 12, // HPMax%, HPMin%, RepeatMin, RepeatMax - EVENT_T_TARGET_CASTING = 13, // RepeatMin, RepeatMax - EVENT_T_FRIENDLY_HP = 14, // HPDeficit, Radius, RepeatMin, RepeatMax - EVENT_T_FRIENDLY_IS_CC = 15, // DispelType, Radius, RepeatMin, RepeatMax - EVENT_T_FRIENDLY_MISSING_BUFF = 16, // SpellId, Radius, RepeatMin, RepeatMax - EVENT_T_SUMMONED_UNIT = 17, // CreatureId, RepeatMin, RepeatMax - EVENT_T_TARGET_MANA = 18, // ManaMax%, ManaMin%, RepeatMin, RepeatMax - EVENT_T_QUEST_ACCEPT = 19, // QuestID - EVENT_T_QUEST_COMPLETE = 20, // - EVENT_T_REACHED_HOME = 21, // NONE - EVENT_T_RECEIVE_EMOTE = 22, // EmoteId, Condition, CondValue1, CondValue2 - EVENT_T_BUFFED = 23, // Param1 = SpellID, Param2 = Number of Time STacked, Param3/4 Repeat Min/Max - EVENT_T_TARGET_BUFFED = 24, // Param1 = SpellID, Param2 = Number of Time STacked, Param3/4 Repeat Min/Max - EVENT_T_RESET = 35, // Is it called after combat, when the creature respawn and spawn. -- TRINITY ONLY - - EVENT_T_END, -}; - -enum EventAI_ActionType -{ - ACTION_T_NONE = 0, // No action - ACTION_T_TEXT = 1, // TextId1, optionally -TextId2, optionally -TextId3(if -TextId2 exist). If more than just -TextId1 is defined, randomize. Negative values. - ACTION_T_SET_FACTION = 2, // FactionId (or 0 for default) - ACTION_T_MORPH_TO_ENTRY_OR_MODEL = 3, // Creature_template entry(param1) OR ModelId (param2) (or 0 for both to demorph) - ACTION_T_SOUND = 4, // SoundId - ACTION_T_EMOTE = 5, // EmoteId - ACTION_T_RANDOM_SAY = 6, // UNUSED - ACTION_T_RANDOM_YELL = 7, // UNUSED - ACTION_T_RANDOM_TEXTEMOTE = 8, // UNUSED - ACTION_T_RANDOM_SOUND = 9, // SoundId1, SoundId2, SoundId3 (-1 in any field means no output if randomed that field) - ACTION_T_RANDOM_EMOTE = 10, // EmoteId1, EmoteId2, EmoteId3 (-1 in any field means no output if randomed that field) - ACTION_T_CAST = 11, // SpellId, Target, CastFlags - ACTION_T_SUMMON = 12, // CreatureID, Target, Duration in ms - ACTION_T_THREAT_SINGLE_PCT = 13, // Threat%, Target - ACTION_T_THREAT_ALL_PCT = 14, // Threat% - ACTION_T_QUEST_EVENT = 15, // QuestID, Target - ACTION_T_CAST_EVENT = 16, // QuestID, SpellId, Target - must be removed as hack? - ACTION_T_SET_UNIT_FIELD = 17, // Field_Number, Value, Target - ACTION_T_SET_UNIT_FLAG = 18, // Flags (may be more than one field OR'd together), Target - ACTION_T_REMOVE_UNIT_FLAG = 19, // Flags (may be more than one field OR'd together), Target - ACTION_T_AUTO_ATTACK = 20, // AllowAttackState (0 = stop attack, anything else means continue attacking) - ACTION_T_COMBAT_MOVEMENT = 21, // AllowCombatMovement (0 = stop combat based movement, anything else continue attacking) - ACTION_T_SET_PHASE = 22, // Phase - ACTION_T_INC_PHASE = 23, // Value (may be negative to decrement phase, should not be 0) - ACTION_T_EVADE = 24, // No Params - ACTION_T_FLEE_FOR_ASSIST = 25, // No Params - ACTION_T_QUEST_EVENT_ALL = 26, // QuestID - ACTION_T_CAST_EVENT_ALL = 27, // CreatureId, SpellId - ACTION_T_REMOVEAURASFROMSPELL = 28, // Target, Spellid - ACTION_T_RANGED_MOVEMENT = 29, // Distance, Angle - ACTION_T_RANDOM_PHASE = 30, // PhaseId1, PhaseId2, PhaseId3 - ACTION_T_RANDOM_PHASE_RANGE = 31, // PhaseMin, PhaseMax - ACTION_T_SUMMON_ID = 32, // CreatureId, Target, SpawnId - ACTION_T_KILLED_MONSTER = 33, // CreatureId, Target - ACTION_T_SET_INST_DATA = 34, // Field, Data - ACTION_T_SET_INST_DATA64 = 35, // Field, Target - ACTION_T_UPDATE_TEMPLATE = 36, // Entry, Team - ACTION_T_DIE = 37, // No Params - ACTION_T_ZONE_COMBAT_PULSE = 38, // No Params - ACTION_T_CALL_FOR_HELP = 39, // Radius - ACTION_T_SET_SHEATH = 40, // Sheath (0-passive, 1-melee, 2-ranged) - ACTION_T_FORCE_DESPAWN = 41, // No Params - ACTION_T_SET_INVINCIBILITY_HP_LEVEL = 42, // MinHpValue, format(0-flat, 1-percent from max health) - ACTION_T_MOUNT_TO_ENTRY_OR_MODEL = 43, // Creature_template entry(param1) OR ModelId (param2) (or 0 for both to dismount) - - ACTION_T_SET_PHASE_MASK = 97, - ACTION_T_SET_STAND_STATE = 98, - ACTION_T_MOVE_RANDOM_POINT = 99, - ACTION_T_SET_VISIBILITY = 100, - ACTION_T_SET_ACTIVE = 101, //Apply - ACTION_T_SET_AGGRESSIVE = 102, //Apply - ACTION_T_ATTACK_START_PULSE = 103, //Distance - ACTION_T_SUMMON_GO = 104, //GameObjectID, DespawnTime in ms - - ACTION_T_END = 105, -}; - -enum Target -{ - //Self (me) - TARGET_T_SELF = 0, //Self cast - - //Hostile targets (if pet then returns pet owner) - TARGET_T_HOSTILE, //Our current target (ie: highest aggro) - TARGET_T_HOSTILE_SECOND_AGGRO, //Second highest aggro (generaly used for cleaves and some special attacks) - TARGET_T_HOSTILE_LAST_AGGRO, //Dead last on aggro (no idea what this could be used for) - TARGET_T_HOSTILE_RANDOM, //Just any random target on our threat list - TARGET_T_HOSTILE_RANDOM_NOT_TOP, //Any random target except top threat - - //Invoker targets (if pet then returns pet owner) - TARGET_T_ACTION_INVOKER, //Unit who caused this Event to occur (only works for EVENT_T_AGGRO, EVENT_T_KILL, EVENT_T_DEATH, EVENT_T_SPELLHIT, EVENT_T_OOC_LOS, EVENT_T_FRIENDLY_HP, EVENT_T_FRIENDLY_IS_CC, EVENT_T_FRIENDLY_MISSING_BUFF) - - //Hostile targets (including pets) - TARGET_T_HOSTILE_WPET, //Current target (can be a pet) - TARGET_T_HOSTILE_WPET_SECOND_AGGRO, //Second highest aggro (generaly used for cleaves and some special attacks) - TARGET_T_HOSTILE_WPET_LAST_AGGRO, //Dead last on aggro (no idea what this could be used for) - TARGET_T_HOSTILE_WPET_RANDOM, //Just any random target on our threat list - TARGET_T_HOSTILE_WPET_RANDOM_NOT_TOP, //Any random target except top threat - - TARGET_T_ACTION_INVOKER_WPET, - - TARGET_T_END -}; - -enum CastFlags -{ - CAST_INTERRUPT_PREVIOUS = 0x01, //Interrupt any spell casting - CAST_TRIGGERED = 0x02, //Triggered (this makes spell cost zero mana and have no cast time) - CAST_FORCE_CAST = 0x04, //Forces cast even if creature is out of mana or out of range - CAST_NO_MELEE_IF_OOM = 0x08, //Prevents creature from entering melee if out of mana or out of range - CAST_FORCE_TARGET_SELF = 0x10, //Forces the target to cast this spell on itself - CAST_AURA_NOT_PRESENT = 0x20, //Only casts the spell if the target does not have an aura from the spell -}; - -enum EventFlags -{ - EFLAG_REPEATABLE = 0x01, //Event repeats - EFLAG_DIFFICULTY_0 = 0x02, //Event only occurs in instance difficulty 0 - EFLAG_DIFFICULTY_1 = 0x04, //Event only occurs in instance difficulty 1 - EFLAG_DIFFICULTY_2 = 0x08, //Event only occurs in instance difficulty 2 - EFLAG_DIFFICULTY_3 = 0x10, //Event only occurs in instance difficulty 3 - EFLAG_RESERVED_5 = 0x20, - EFLAG_RESERVED_6 = 0x40, - EFLAG_DEBUG_ONLY = 0x80, //Event only occurs in debug build - - EFLAG_DIFFICULTY_ALL = (EFLAG_DIFFICULTY_0|EFLAG_DIFFICULTY_1|EFLAG_DIFFICULTY_2|EFLAG_DIFFICULTY_3) -}; - -enum SpawnedEventMode -{ - SPAWNED_EVENT_ALWAY = 0, - SPAWNED_EVENT_MAP = 1, - SPAWNED_EVENT_ZONE = 2 -}; - -// String text additional data, used in (CreatureEventAI) -struct StringTextData -{ - uint32 SoundId; - uint8 Type; - uint32 Language; - uint32 Emote; -}; -// Text Maps -typedef UNORDERED_MAP CreatureEventAI_TextMap; - -struct CreatureEventAI_Action -{ - EventAI_ActionType type: 16; - union - { - // ACTION_T_TEXT = 1 - struct - { - int32 TextId1; - int32 TextId2; - int32 TextId3; - } text; - // ACTION_T_SET_FACTION = 2 - struct - { - uint32 factionId; // faction or 0 for default) - } set_faction; - // ACTION_T_MORPH_TO_ENTRY_OR_MODEL = 3 - struct - { - uint32 creatureId; // set one from fields (or 0 for both to demorph) - uint32 modelId; - } morph; - // ACTION_T_SOUND = 4 - struct - { - uint32 soundId; - } sound; - // ACTION_T_EMOTE = 5 - struct - { - uint32 emoteId; - } emote; - // ACTION_T_RANDOM_SOUND = 9 - struct - { - int32 soundId1; // (-1 in any field means no output if randomed that field) - int32 soundId2; - int32 soundId3; - } random_sound; - // ACTION_T_RANDOM_EMOTE = 10 - struct - { - int32 emoteId1; // (-1 in any field means no output if randomed that field) - int32 emoteId2; - int32 emoteId3; - } random_emote; - // ACTION_T_CAST = 11 - struct - { - uint32 spellId; - uint32 target; - uint32 castFlags; - } cast; - // ACTION_T_SUMMON = 12 - struct - { - uint32 creatureId; - uint32 target; - uint32 duration; - } summon; - // ACTION_T_THREAT_SINGLE_PCT = 13 - struct - { - int32 percent; - uint32 target; - } threat_single_pct; - // ACTION_T_THREAT_ALL_PCT = 14 - struct - { - int32 percent; - } threat_all_pct; - // ACTION_T_QUEST_EVENT = 15 - struct - { - uint32 questId; - uint32 target; - } quest_event; - // ACTION_T_CAST_EVENT = 16 - struct - { - uint32 creatureId; - uint32 spellId; - uint32 target; - } cast_event; - // ACTION_T_SET_UNIT_FIELD = 17 - struct - { - uint32 field; - uint32 value; - uint32 target; - } set_unit_field; - // ACTION_T_SET_UNIT_FLAG = 18, // value provided mask bits that will be set - // ACTION_T_REMOVE_UNIT_FLAG = 19, // value provided mask bits that will be clear - struct - { - uint32 value; - uint32 target; - } unit_flag; - // ACTION_T_AUTO_ATTACK = 20 - struct - { - uint32 state; // 0 = stop attack, anything else means continue attacking - } auto_attack; - // ACTION_T_COMBAT_MOVEMENT = 21 - struct - { - uint32 state; // 0 = stop combat based movement, anything else continue attacking - uint32 melee; // if set: at stop send melee combat stop if in combat, use for terminate melee fighting state for switch to ranged - } combat_movement; - // ACTION_T_SET_PHASE = 22 - struct - { - uint32 phase; - } set_phase; - // ACTION_T_INC_PHASE = 23 - struct - { - int32 step; - } set_inc_phase; - // ACTION_T_QUEST_EVENT_ALL = 26 - struct - { - uint32 questId; - } quest_event_all; - // ACTION_T_CAST_EVENT_ALL = 27 - struct - { - uint32 creatureId; - uint32 spellId; - } cast_event_all; - // ACTION_T_REMOVEAURASFROMSPELL = 28 - struct - { - uint32 target; - uint32 spellId; - } remove_aura; - // ACTION_T_RANGED_MOVEMENT = 29 - struct - { - uint32 distance; - int32 angle; - } ranged_movement; - // ACTION_T_RANDOM_PHASE = 30 - struct - { - uint32 phase1; - uint32 phase2; - uint32 phase3; - } random_phase; - // ACTION_T_RANDOM_PHASE_RANGE = 31 - struct - { - uint32 phaseMin; - uint32 phaseMax; - } random_phase_range; - // ACTION_T_SUMMON_ID = 32 - struct - { - uint32 creatureId; - uint32 target; - uint32 spawnId; - } summon_id; - // ACTION_T_KILLED_MONSTER = 33 - struct - { - uint32 creatureId; - uint32 target; - } killed_monster; - // ACTION_T_SET_INST_DATA = 34 - struct - { - uint32 field; - uint32 value; - } set_inst_data; - // ACTION_T_SET_INST_DATA64 = 35 - struct - { - uint32 field; - uint32 target; - } set_inst_data64; - // ACTION_T_UPDATE_TEMPLATE = 36 - struct - { - uint32 creatureId; - uint32 team; - } update_template; - // ACTION_T_CALL_FOR_HELP = 39 - struct - { - uint32 radius; - } call_for_help; - // ACTION_T_SET_SHEATH = 40 - struct - { - uint32 sheath; - } set_sheath; - // ACTION_T_FORCE_DESPAWN = 41 - struct - { - uint32 msDelay; - } forced_despawn; - // ACTION_T_SET_INVINCIBILITY_HP_LEVEL = 42 - struct - { - uint32 hp_level; - uint32 is_percent; - } invincibility_hp_level; - // ACTION_T_MOUNT_TO_ENTRY_OR_MODEL = 43 - struct - { - uint32 creatureId; // set one from fields (or 0 for both to dismount) - uint32 modelId; - } mount; - // RAW - struct - { - uint32 param1; - uint32 param2; - uint32 param3; - } raw; - }; -}; - -struct CreatureEventAI_Event -{ - uint32 event_id; - - uint32 creature_id; - - uint32 event_inverse_phase_mask; - - EventAI_Type event_type : 16; - uint8 event_chance : 8; - uint8 event_flags : 8; - - union - { - // EVENT_T_TIMER = 0 - // EVENT_T_TIMER_OOC = 1 - struct - { - uint32 initialMin; - uint32 initialMax; - uint32 repeatMin; - uint32 repeatMax; - } timer; - // EVENT_T_HP = 2 - // EVENT_T_MANA = 3 - // EVENT_T_TARGET_HP = 12 - // EVENT_T_TARGET_MANA = 18 - struct - { - uint32 percentMax; - uint32 percentMin; - uint32 repeatMin; - uint32 repeatMax; - } percent_range; - // EVENT_T_KILL = 5 - struct - { - uint32 repeatMin; - uint32 repeatMax; - } kill; - // EVENT_T_SPELLHIT = 8 - struct - { - uint32 spellId; - uint32 schoolMask; // -1 ( == 0xffffffff) is ok value for full mask, or must be more limited mask like (0 < 1) = 1 for normal/physical school - uint32 repeatMin; - uint32 repeatMax; - } spell_hit; - // EVENT_T_RANGE = 9 - struct - { - uint32 minDist; - uint32 maxDist; - uint32 repeatMin; - uint32 repeatMax; - } range; - // EVENT_T_OOC_LOS = 10 - struct - { - uint32 noHostile; - uint32 maxRange; - uint32 repeatMin; - uint32 repeatMax; - } ooc_los; - // EVENT_T_SPAWNED = 11 - struct - { - uint32 condition; - uint32 conditionValue1; - } spawned; - // EVENT_T_TARGET_CASTING = 13 - struct - { - uint32 repeatMin; - uint32 repeatMax; - } target_casting; - // EVENT_T_FRIENDLY_HP = 14 - struct - { - uint32 hpDeficit; - uint32 radius; - uint32 repeatMin; - uint32 repeatMax; - } friendly_hp; - // EVENT_T_FRIENDLY_IS_CC = 15 - struct - { - uint32 dispelType; // unused ? - uint32 radius; - uint32 repeatMin; - uint32 repeatMax; - } friendly_is_cc; - // EVENT_T_FRIENDLY_MISSING_BUFF = 16 - struct - { - uint32 spellId; - uint32 radius; - uint32 repeatMin; - uint32 repeatMax; - } friendly_buff; - // EVENT_T_SUMMONED_UNIT = 17 - struct - { - uint32 creatureId; - uint32 repeatMin; - uint32 repeatMax; - } summon_unit; - // EVENT_T_QUEST_ACCEPT = 19 - // EVENT_T_QUEST_COMPLETE = 20 - struct - { - uint32 questId; - } quest; - // EVENT_T_RECEIVE_EMOTE = 22 - struct - { - uint32 emoteId; - uint32 condition; - uint32 conditionValue1; - uint32 conditionValue2; - } receive_emote; - // EVENT_T_BUFFED = 23 - // EVENT_T_TARGET_BUFFED = 24 - struct - { - uint32 spellId; - uint32 amount; - uint32 repeatMin; - uint32 repeatMax; - } buffed; - - // RAW - struct - { - uint32 param1; - uint32 param2; - uint32 param3; - uint32 param4; - } raw; - }; - - CreatureEventAI_Action action[MAX_ACTIONS]; -}; -//Event_Map -typedef UNORDERED_MAP > CreatureEventAI_Event_Map; - -struct CreatureEventAI_Summon -{ - //uint32 id; - - float position_x; - float position_y; - float position_z; - float orientation; - uint32 SpawnTimeSecs; -}; - -//EventSummon_Map -typedef UNORDERED_MAP CreatureEventAI_Summon_Map; - -struct CreatureEventAIHolder -{ - CreatureEventAIHolder(CreatureEventAI_Event const& p) : Event(p), Time(0), Enabled(true){} - - CreatureEventAI_Event Event; - uint32 Time; - bool Enabled; - - // helper - bool UpdateRepeatTimer(Creature* creature, uint32 repeatMin, uint32 repeatMax); -}; - -class CreatureEventAI : public CreatureAI -{ - public: - explicit CreatureEventAI(Creature* c); - ~CreatureEventAI() - { - m_CreatureEventAIList.clear(); - } - void JustRespawned(); - void Reset(); - void JustReachedHome(); - void EnterCombat(Unit* enemy); - void EnterEvadeMode(); - void JustDied(Unit* /*killer*/); - void KilledUnit(Unit* victim); - void JustSummoned(Creature* unit); - void AttackStart(Unit* who); - void MoveInLineOfSight(Unit* who); - void SpellHit(Unit* unit, const SpellInfo* spell); - void DamageTaken(Unit* done_by, uint32& damage); - void HealReceived(Unit* /*done_by*/, uint32& /*addhealth*/) {} - void UpdateAI(const uint32 diff); - void ReceiveEmote(Player* player, uint32 textEmote); - static int Permissible(const Creature*); - - bool ProcessEvent(CreatureEventAIHolder& holder, Unit* actionInvoker = NULL); - void ProcessAction(CreatureEventAI_Action const& action, uint32 rnd, uint32 eventId, Unit* actionInvoker); - inline uint32 GetRandActionParam(uint32 rnd, uint32 param1, uint32 param2, uint32 param3); - inline int32 GetRandActionParam(uint32 rnd, int32 param1, int32 param2, int32 param3); - inline Unit* GetTargetByType(uint32 target, Unit* actionInvoker); - - void DoScriptText(int32 textEntry, WorldObject* source, Unit* target); - bool CanCast(Unit* target, SpellInfo const* spell, bool triggered); - - bool SpawnedEventConditionsCheck(CreatureEventAI_Event const& event); - - Unit* DoSelectLowestHpFriendly(float range, uint32 minHPDiff); - void DoFindFriendlyMissingBuff(std::list& _list, float range, uint32 spellid); - void DoFindFriendlyCC(std::list& _list, float range); - - protected: - uint32 m_EventUpdateTime; // Time between event updates - uint32 m_EventDiff; // Time between the last event call - bool m_bEmptyList; - - typedef std::vector CreatureEventAIList; - CreatureEventAIList m_CreatureEventAIList; // Holder for events (stores enabled, time, and eventid) - // Variables used by Events themselves - uint8 m_Phase; // Current phase, max 32 phases - bool m_CombatMovementEnabled; // If we allow targeted movment gen (movement twoards top threat) - bool m_MeleeEnabled; // If we allow melee auto attack - float m_AttackDistance; // Distance to attack from - float m_AttackAngle; // Angle of attack - uint32 m_InvincibilityHpLevel; // Minimal health level allowed at damage apply -}; -#endif diff --git a/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp b/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp deleted file mode 100755 index af25ba6af1d..00000000000 --- a/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp +++ /dev/null @@ -1,743 +0,0 @@ -/* - * Copyright (C) 2008-2012 TrinityCore - * Copyright (C) 2005-2009 MaNGOS - * - * 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; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; 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, see . - */ - -#include "Common.h" -#include "DatabaseEnv.h" -#include "CreatureEventAI.h" -#include "CreatureEventAIMgr.h" -#include "ObjectMgr.h" -#include "ObjectDefines.h" -#include "GridDefines.h" -#include "ConditionMgr.h" -#include "SpellMgr.h" -#include "SpellInfo.h" - -// ------------------- -void CreatureEventAIMgr::LoadCreatureEventAI_Texts() -{ - uint32 oldMSTime = getMSTime(); - - // Drop Existing Text Map, only done once and we are ready to add data from multiple sources. - m_CreatureEventAI_TextMap.clear(); - - // Load EventAI Text - sObjectMgr->LoadTrinityStrings("creature_ai_texts", MIN_CREATURE_AI_TEXT_STRING_ID, MAX_CREATURE_AI_TEXT_STRING_ID); - - // Gather Additional data from EventAI Texts 0 1 2 3 4 - QueryResult result = WorldDatabase.Query("SELECT entry, sound, type, language, emote FROM creature_ai_texts"); - - if (!result) - { - sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded 0 additional CreatureEventAI Texts data. DB table `creature_ai_texts` is empty."); - - return; - } - - uint32 count = 0; - - do - { - Field* fields = result->Fetch(); - StringTextData temp; - - int32 i = fields[0].GetInt32(); - temp.SoundId = fields[1].GetUInt32(); - temp.Type = fields[2].GetUInt8(); - temp.Language = fields[3].GetUInt8(); - temp.Emote = fields[4].GetUInt16(); - - // range negative - if (i > MIN_CREATURE_AI_TEXT_STRING_ID || i <= MAX_CREATURE_AI_TEXT_STRING_ID) - { - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Entry %i in table `creature_ai_texts` is not in valid range(%d-%d)", i, MIN_CREATURE_AI_TEXT_STRING_ID, MAX_CREATURE_AI_TEXT_STRING_ID); - continue; - } - - // range negative (must not happen, loaded from same table) - if (!sObjectMgr->GetTrinityStringLocale(i)) - { - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Entry %i in table `creature_ai_texts` not found", i); - continue; - } - - if (temp.SoundId) - { - if (!sSoundEntriesStore.LookupEntry(temp.SoundId)) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Entry %i in table `creature_ai_texts` has Sound %u but sound does not exist.", i, temp.SoundId); - } - - if (!GetLanguageDescByID(temp.Language)) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Entry %i in table `creature_ai_texts` using Language %u but Language does not exist.", i, temp.Language); - - if (temp.Type > CHAT_TYPE_ZONE_YELL) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Entry %i in table `creature_ai_texts` has Type %u but this Chat Type does not exist.", i, temp.Type); - - if (temp.Emote) - { - if (!sEmotesStore.LookupEntry(temp.Emote)) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Entry %i in table `creature_ai_texts` has Emote %u but emote does not exist.", i, temp.Emote); - } - - m_CreatureEventAI_TextMap[i] = temp; - ++count; - } - while (result->NextRow()); - - sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u additional CreatureEventAI Texts data in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - -} - -void CreatureEventAIMgr::LoadCreatureEventAI_Summons() -{ - uint32 oldMSTime = getMSTime(); - - //Drop Existing EventSummon Map - m_CreatureEventAI_Summon_Map.clear(); - - // Gather additional data for EventAI - QueryResult result = WorldDatabase.Query("SELECT id, position_x, position_y, position_z, orientation, spawntimesecs FROM creature_ai_summons"); - - if (!result) - { - sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded 0 CreatureEventAI Summon definitions. DB table `creature_ai_summons` is empty."); - - return; - } - - uint32 count = 0; - - do - { - Field* fields = result->Fetch(); - - CreatureEventAI_Summon temp; - - uint32 i = fields[0].GetUInt32(); - temp.position_x = fields[1].GetFloat(); - temp.position_y = fields[2].GetFloat(); - temp.position_z = fields[3].GetFloat(); - temp.orientation = fields[4].GetFloat(); - temp.SpawnTimeSecs = fields[5].GetUInt32(); - - if (!Trinity::IsValidMapCoord(temp.position_x, temp.position_y, temp.position_z, temp.orientation)) - { - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Summon id %u have wrong coordinates (%f, %f, %f, %f), skipping.", i, temp.position_x, temp.position_y, temp.position_z, temp.orientation); - continue; - } - - //Add to map - m_CreatureEventAI_Summon_Map[i] = temp; - ++count; - } - while (result->NextRow()); - - sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u CreatureEventAI summon definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - -} - -void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() -{ - uint32 oldMSTime = getMSTime(); - - //Drop Existing EventAI List - m_CreatureEventAI_Event_Map.clear(); - - // Gather event data - QueryResult result = WorldDatabase.Query("SELECT id, creature_id, event_type, event_inverse_phase_mask, event_chance, event_flags, " - "event_param1, event_param2, event_param3, event_param4, " - "action1_type, action1_param1, action1_param2, action1_param3, " - "action2_type, action2_param1, action2_param2, action2_param3, " - "action3_type, action3_param1, action3_param2, action3_param3 " - "FROM creature_ai_scripts"); - - if (!result) - { - sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded 0 CreatureEventAI scripts. DB table `creature_ai_scripts` is empty."); - - return; - } - - uint32 count = 0; - - do - { - Field* fields = result->Fetch(); - - CreatureEventAI_Event temp; - temp.event_id = EventAI_Type(fields[0].GetUInt32()); - uint32 i = temp.event_id; - - temp.creature_id = fields[1].GetUInt32(); - uint32 creature_id = temp.creature_id; - - uint32 e_type = fields[2].GetUInt8(); - //Report any errors in event - if (e_type >= EVENT_T_END) - { - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u have wrong type (%u), skipping.", i, e_type); - continue; - } - temp.event_type = EventAI_Type(e_type); - - temp.event_inverse_phase_mask = fields[3].GetInt32(); - temp.event_chance = fields[4].GetUInt32(); - temp.event_flags = fields[5].GetUInt32(); - temp.raw.param1 = fields[6].GetInt32(); - temp.raw.param2 = fields[7].GetInt32(); - temp.raw.param3 = fields[8].GetInt32(); - temp.raw.param4 = fields[9].GetInt32(); - - CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(creature_id); - //Creature does not exist in database - if (!cInfo) - { - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u has script for non-existing creature entry (%u), skipping.", i, creature_id); - continue; - } - - // Only on the first script - if (cInfo->AIName != "EventAI" && m_CreatureEventAI_Event_Map[creature_id].empty()) - sLog->outError(LOG_FILTER_SQL, "Creature entry %u has EventAI scripts, but its AIName is not 'EventAI' - possible AI-mismatch?", temp.creature_id); - - //No chance of this event occuring - if (temp.event_chance == 0) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u has 0 percent chance. Event will never trigger!", i); - //Chance above 100, force it to be 100 - else if (temp.event_chance > 100) - { - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using event %u with more than 100 percent chance. Adjusting to 100 percent.", temp.creature_id, i); - temp.event_chance = 100; - } - - //Individual event checks - switch (temp.event_type) - { - case EVENT_T_TIMER: - case EVENT_T_TIMER_OOC: - if (temp.timer.initialMax < temp.timer.initialMin) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using timed event(%u) with param2 < param1 (InitialMax < InitialMin). Event will never repeat.", temp.creature_id, i); - if (temp.timer.repeatMax < temp.timer.repeatMin) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i); - break; - case EVENT_T_HP: - case EVENT_T_MANA: - case EVENT_T_TARGET_HP: - case EVENT_T_TARGET_MANA: - if (temp.percent_range.percentMax > 100) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using percentage event(%u) with param2 (MinPercent) > 100. Event will never trigger! ", temp.creature_id, i); - - if (temp.percent_range.percentMax <= temp.percent_range.percentMin) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using percentage event(%u) with param1 <= param2 (MaxPercent <= MinPercent). Event will never trigger! ", temp.creature_id, i); - - if (temp.event_flags & EFLAG_REPEATABLE && !temp.percent_range.repeatMin && !temp.percent_range.repeatMax) - { - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u has param3 and param4=0 (RepeatMin/RepeatMax) but cannot be repeatable without timers. Removing EFLAG_REPEATABLE for event %u.", temp.creature_id, i); - temp.event_flags &= ~EFLAG_REPEATABLE; - } - break; - case EVENT_T_SPELLHIT: - if (temp.spell_hit.spellId) - { - SpellInfo const* spell = sSpellMgr->GetSpellInfo(temp.spell_hit.spellId); - if (!spell) - { - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u has non-existant SpellID(%u) defined in event %u.", temp.creature_id, temp.spell_hit.spellId, i); - continue; - } - - if ((temp.spell_hit.schoolMask & spell->SchoolMask) != spell->SchoolMask) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u has param1(spellId %u) but param2 is not -1 and not equal to spell's school mask. Event %u can never trigger.", temp.creature_id, temp.spell_hit.schoolMask, i); - } - - if (!temp.spell_hit.schoolMask) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u is using invalid SpellSchoolMask(%u) defined in event %u.", temp.creature_id, temp.spell_hit.schoolMask, i); - - if (temp.spell_hit.repeatMax < temp.spell_hit.repeatMin) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i); - break; - case EVENT_T_RANGE: - if (temp.range.maxDist < temp.range.minDist) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using event(%u) with param2 < param1 (MaxDist < MinDist). Event will never repeat.", temp.creature_id, i); - if (temp.range.repeatMax < temp.range.repeatMin) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i); - break; - case EVENT_T_OOC_LOS: - if (temp.ooc_los.repeatMax < temp.ooc_los.repeatMin) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i); - break; - case EVENT_T_SPAWNED: - switch (temp.spawned.condition) - { - case SPAWNED_EVENT_ALWAY: - break; - case SPAWNED_EVENT_MAP: - if (!sMapStore.LookupEntry(temp.spawned.conditionValue1)) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using spawned event(%u) with param1 = %u 'map specific' but with not existed map (%u) in param2. Event will never repeat.", temp.creature_id, i, temp.spawned.condition, temp.spawned.conditionValue1); - break; - case SPAWNED_EVENT_ZONE: - if (!GetAreaEntryByAreaID(temp.spawned.conditionValue1)) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using spawned event(%u) with param1 = %u 'area specific' but with not existed area (%u) in param2. Event will never repeat.", temp.creature_id, i, temp.spawned.condition, temp.spawned.conditionValue1); - default: - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using invalid spawned event %u mode (%u) in param1", temp.creature_id, i, temp.spawned.condition); - break; - } - break; - case EVENT_T_FRIENDLY_HP: - if (temp.friendly_hp.repeatMax < temp.friendly_hp.repeatMin) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i); - break; - case EVENT_T_FRIENDLY_IS_CC: - if (temp.friendly_is_cc.repeatMax < temp.friendly_is_cc.repeatMin) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i); - break; - case EVENT_T_FRIENDLY_MISSING_BUFF: - { - SpellInfo const* spell = sSpellMgr->GetSpellInfo(temp.spell_hit.spellId); - if (!spell) - { - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u has non-existant SpellID(%u) defined in event %u.", temp.creature_id, temp.spell_hit.spellId, i); - continue; - } - if (temp.friendly_buff.repeatMax < temp.friendly_buff.repeatMin) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i); - break; - } - case EVENT_T_KILL: - if (temp.kill.repeatMax < temp.kill.repeatMin) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using event(%u) with param2 < param1 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i); - break; - case EVENT_T_TARGET_CASTING: - if (temp.target_casting.repeatMax < temp.target_casting.repeatMin) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using event(%u) with param2 < param1 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i); - break; - case EVENT_T_SUMMONED_UNIT: - if (!sObjectMgr->GetCreatureTemplate(temp.summon_unit.creatureId)) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using event(%u) with not existed creature template id (%u) in param1, skipped.", temp.creature_id, i, temp.summon_unit.creatureId); - if (temp.summon_unit.repeatMax < temp.summon_unit.repeatMin) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using event(%u) with param2 < param1 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i); - break; - case EVENT_T_QUEST_ACCEPT: - case EVENT_T_QUEST_COMPLETE: - if (!sObjectMgr->GetQuestTemplate(temp.quest.questId)) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using event(%u) with not existed qyest id (%u) in param1, skipped.", temp.creature_id, i, temp.quest.questId); - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u using not implemented event (%u) in event %u.", temp.creature_id, temp.event_id, i); - continue; - - case EVENT_T_AGGRO: - case EVENT_T_DEATH: - case EVENT_T_EVADE: - case EVENT_T_REACHED_HOME: - { - if (temp.event_flags & EFLAG_REPEATABLE) - { - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u has EFLAG_REPEATABLE set. Event can never be repeatable. Removing flag for event %u.", temp.creature_id, i); - temp.event_flags &= ~EFLAG_REPEATABLE; - } - - break; - } - - case EVENT_T_RECEIVE_EMOTE: - { - if (!sEmotesTextStore.LookupEntry(temp.receive_emote.emoteId)) - { - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u using event %u: param1 (EmoteTextId: %u) are not valid.", temp.creature_id, i, temp.receive_emote.emoteId); - continue; - } - if (temp.receive_emote.condition) - { - Condition cond; - cond.ConditionType = ConditionTypes(temp.receive_emote.condition); - cond.ConditionValue1 = temp.receive_emote.conditionValue1; - cond.ConditionValue2 = temp.receive_emote.conditionValue2; - if (!sConditionMgr->isConditionTypeValid(&cond)) - { - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u using event %u: param2 (Condition: %u) are not valid.", temp.creature_id, i, temp.receive_emote.condition); - continue; - } - } - - if (!(temp.event_flags & EFLAG_REPEATABLE)) - { - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u using event %u: EFLAG_REPEATABLE not set. Event must always be repeatable. Flag applied.", temp.creature_id, i); - temp.event_flags |= EFLAG_REPEATABLE; - } - - break; - } - - case EVENT_T_BUFFED: - case EVENT_T_TARGET_BUFFED: - { - SpellInfo const* spell = sSpellMgr->GetSpellInfo(temp.buffed.spellId); - if (!spell) - { - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u has non-existant SpellID(%u) defined in event %u.", temp.creature_id, temp.spell_hit.spellId, i); - continue; - } - if (temp.buffed.repeatMax < temp.buffed.repeatMin) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i); - break; - } - - default: - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Creature %u using not checked at load event (%u) in event %u. Need check code update?", temp.creature_id, temp.event_id, i); - break; - } - - for (uint32 j = 0; j < MAX_ACTIONS; j++) - { - uint16 action_type = fields[10+(j*4)].GetUInt8(); - if (action_type >= ACTION_T_END) - { - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u has incorrect action type (%u), replace by ACTION_T_NONE.", i, j+1, action_type); - temp.action[j].type = ACTION_T_NONE; - continue; - } - - CreatureEventAI_Action& action = temp.action[j]; - - action.type = EventAI_ActionType(action_type); - action.raw.param1 = fields[11+(j*4)].GetInt32(); - action.raw.param2 = fields[12+(j*4)].GetInt32(); - action.raw.param3 = fields[13+(j*4)].GetInt32(); - - //Report any errors in actions - switch (action.type) - { - case ACTION_T_NONE: - break; - case ACTION_T_TEXT: - { - if (action.text.TextId1 < 0) - { - if (m_CreatureEventAI_TextMap.find(action.text.TextId1) == m_CreatureEventAI_TextMap.end()) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u param1 refrences non-existing entry in texts table.", i, j+1); - } - if (action.text.TextId2 < 0) - { - if (m_CreatureEventAI_TextMap.find(action.text.TextId2) == m_CreatureEventAI_TextMap.end()) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u param2 refrences non-existing entry in texts table.", i, j+1); - - if (!action.text.TextId1) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u has param2, but param1 is not set. Required for randomized text.", i, j+1); - } - if (action.text.TextId3 < 0) - { - if (m_CreatureEventAI_TextMap.find(action.text.TextId3) == m_CreatureEventAI_TextMap.end()) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u param3 refrences non-existing entry in texts table.", i, j+1); - - if (!action.text.TextId1 || !action.text.TextId2) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u has param3, but param1 and/or param2 is not set. Required for randomized text.", i, j+1); - } - break; - } - case ACTION_T_SET_FACTION: - if (action.set_faction.factionId !=0 && !sFactionStore.LookupEntry(action.set_faction.factionId)) - { - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existent FactionId %u.", i, j+1, action.set_faction.factionId); - action.set_faction.factionId = 0; - } - break; - case ACTION_T_MORPH_TO_ENTRY_OR_MODEL: - if (action.morph.creatureId !=0 || action.morph.modelId !=0) - { - if (action.morph.creatureId && !sObjectMgr->GetCreatureTemplate(action.morph.creatureId)) - { - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existant Creature entry %u.", i, j+1, action.morph.creatureId); - action.morph.creatureId = 0; - } - - if (action.morph.modelId) - { - if (action.morph.creatureId) - { - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u have unused ModelId %u with also set creature id %u.", i, j+1, action.morph.modelId, action.morph.creatureId); - action.morph.modelId = 0; - } - else if (!sCreatureDisplayInfoStore.LookupEntry(action.morph.modelId)) - { - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existant ModelId %u.", i, j+1, action.morph.modelId); - action.morph.modelId = 0; - } - } - } - break; - case ACTION_T_SOUND: - if (!sSoundEntriesStore.LookupEntry(action.sound.soundId)) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existant SoundID %u.", i, j+1, action.sound.soundId); - break; - case ACTION_T_EMOTE: - if (!sEmotesStore.LookupEntry(action.emote.emoteId)) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u param1 (EmoteId: %u) are not valid.", i, j+1, action.emote.emoteId); - break; - case ACTION_T_RANDOM_SOUND: - if (!sSoundEntriesStore.LookupEntry(action.random_sound.soundId1)) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u param1 uses non-existant SoundID %u.", i, j+1, action.random_sound.soundId1); - if (action.random_sound.soundId2 >= 0 && !sSoundEntriesStore.LookupEntry(action.random_sound.soundId2)) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u param2 uses non-existant SoundID %u.", i, j+1, action.random_sound.soundId2); - if (action.random_sound.soundId3 >= 0 && !sSoundEntriesStore.LookupEntry(action.random_sound.soundId3)) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u param3 uses non-existant SoundID %u.", i, j+1, action.random_sound.soundId3); - break; - case ACTION_T_RANDOM_EMOTE: - if (!sEmotesStore.LookupEntry(action.random_emote.emoteId1)) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u param1 (EmoteId: %u) are not valid.", i, j+1, action.random_emote.emoteId1); - if (action.random_emote.emoteId2 >= 0 && !sEmotesStore.LookupEntry(action.random_emote.emoteId2)) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u param2 (EmoteId: %u) are not valid.", i, j+1, action.random_emote.emoteId2); - if (action.random_emote.emoteId3 >= 0 && !sEmotesStore.LookupEntry(action.random_emote.emoteId3)) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u param3 (EmoteId: %u) are not valid.", i, j+1, action.random_emote.emoteId3); - break; - case ACTION_T_CAST: - { - const SpellInfo* spell = sSpellMgr->GetSpellInfo(action.cast.spellId); - if (!spell) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existent SpellID %u.", i, j+1, action.cast.spellId); - /* FIXME: temp.raw.param3 not have event tipes with recovery time in it.... - else - { - if (spell->RecoveryTime > 0 && temp.event_flags & EFLAG_REPEATABLE) - { - //output as debug for now, also because there's no general rule all spells have RecoveryTime - if (temp.event_param3 < spell->RecoveryTime) - sLog->outDebug(LOG_FILTER_NETWORKIO, "CreatureEventAI: Event %u Action %u uses SpellID %u but cooldown is longer(%u) than minumum defined in event param3(%u).", i, j+1, action.cast.spellId, spell->RecoveryTime, temp.event_param3); - } - } - */ - - //Cast is always triggered if target is forced to cast on self - if (action.cast.castFlags & CAST_FORCE_TARGET_SELF) - action.cast.castFlags |= CAST_TRIGGERED; - - if (action.cast.target >= TARGET_T_END) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1); - break; - } - case ACTION_T_SUMMON: - if (!sObjectMgr->GetCreatureTemplate(action.summon.creatureId)) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existent creature entry %u.", i, j+1, action.summon.creatureId); - - if (action.summon.target >= TARGET_T_END) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1); - break; - case ACTION_T_THREAT_SINGLE_PCT: - if (std::abs(action.threat_single_pct.percent) > 100) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses invalid percent value %u.", i, j+1, action.threat_single_pct.percent); - if (action.threat_single_pct.target >= TARGET_T_END) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1); - break; - case ACTION_T_THREAT_ALL_PCT: - if (std::abs(action.threat_all_pct.percent) > 100) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses invalid percent value %u.", i, j+1, action.threat_all_pct.percent); - break; - case ACTION_T_QUEST_EVENT: - if (Quest const* qid = sObjectMgr->GetQuestTemplate(action.quest_event.questId)) - { - if (!qid->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT)) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u. SpecialFlags for quest entry %u does not include |2, Action will not have any effect.", i, j+1, action.quest_event.questId); - } - else - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existent Quest entry %u.", i, j+1, action.quest_event.questId); - - if (action.quest_event.target >= TARGET_T_END) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1); - - break; - case ACTION_T_CAST_EVENT: - if (!sObjectMgr->GetCreatureTemplate(action.cast_event.creatureId)) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existent creature entry %u.", i, j+1, action.cast_event.creatureId); - if (!sSpellMgr->GetSpellInfo(action.cast_event.spellId)) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existent SpellID %u.", i, j+1, action.cast_event.spellId); - if (action.cast_event.target >= TARGET_T_END) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1); - break; - case ACTION_T_SET_UNIT_FIELD: - if (action.set_unit_field.field < OBJECT_END || action.set_unit_field.field >= UNIT_END) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u param1 (UNIT_FIELD*). Index out of range for intended use.", i, j+1); - if (action.set_unit_field.target >= TARGET_T_END) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1); - break; - case ACTION_T_SET_UNIT_FLAG: - case ACTION_T_REMOVE_UNIT_FLAG: - if (action.unit_flag.target >= TARGET_T_END) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1); - break; - case ACTION_T_SET_PHASE: - if (action.set_phase.phase >= MAX_PHASE) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u attempts to set phase >= %u. Phase mask cannot be used past phase %u.", i, j+1, MAX_PHASE, MAX_PHASE-1); - break; - case ACTION_T_INC_PHASE: - if (action.set_inc_phase.step == 0) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u is incrementing phase by 0. Was this intended?", i, j+1); - else if (std::abs(action.set_inc_phase.step) > MAX_PHASE-1) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u is change phase by too large for any use %i.", i, j+1, action.set_inc_phase.step); - break; - case ACTION_T_QUEST_EVENT_ALL: - if (Quest const* qid = sObjectMgr->GetQuestTemplate(action.quest_event_all.questId)) - { - if (!qid->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT)) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u. SpecialFlags for quest entry %u does not include |2, Action will not have any effect.", i, j+1, action.quest_event_all.questId); - } - else - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existent Quest entry %u.", i, j+1, action.quest_event_all.questId); - break; - case ACTION_T_CAST_EVENT_ALL: - if (!sObjectMgr->GetCreatureTemplate(action.cast_event_all.creatureId)) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existent creature entry %u.", i, j+1, action.cast_event_all.creatureId); - if (!sSpellMgr->GetSpellInfo(action.cast_event_all.spellId)) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existent SpellID %u.", i, j+1, action.cast_event_all.spellId); - break; - case ACTION_T_REMOVEAURASFROMSPELL: - if (!sSpellMgr->GetSpellInfo(action.remove_aura.spellId)) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existent SpellID %u.", i, j+1, action.remove_aura.spellId); - if (action.remove_aura.target >= TARGET_T_END) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1); - break; - case ACTION_T_RANDOM_PHASE: //PhaseId1, PhaseId2, PhaseId3 - if (action.random_phase.phase1 >= MAX_PHASE) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u attempts to set phase1 >= %u. Phase mask cannot be used past phase %u.", i, j+1, MAX_PHASE, MAX_PHASE-1); - if (action.random_phase.phase2 >= MAX_PHASE) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u attempts to set phase2 >= %u. Phase mask cannot be used past phase %u.", i, j+1, MAX_PHASE, MAX_PHASE-1); - if (action.random_phase.phase3 >= MAX_PHASE) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u attempts to set phase3 >= %u. Phase mask cannot be used past phase %u.", i, j+1, MAX_PHASE, MAX_PHASE-1); - break; - case ACTION_T_RANDOM_PHASE_RANGE: //PhaseMin, PhaseMax - if (action.random_phase_range.phaseMin >= MAX_PHASE) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u attempts to set phaseMin >= %u. Phase mask cannot be used past phase %u.", i, j+1, MAX_PHASE, MAX_PHASE-1); - if (action.random_phase_range.phaseMin >= MAX_PHASE) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u attempts to set phaseMax >= %u. Phase mask cannot be used past phase %u.", i, j+1, MAX_PHASE, MAX_PHASE-1); - if (action.random_phase_range.phaseMin >= action.random_phase_range.phaseMax) - { - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u attempts to set phaseMax <= phaseMin.", i, j+1); - std::swap(action.random_phase_range.phaseMin, action.random_phase_range.phaseMax); - // equal case processed at call - } - break; - case ACTION_T_SUMMON_ID: - if (!sObjectMgr->GetCreatureTemplate(action.summon_id.creatureId)) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existant creature entry %u.", i, j+1, action.summon_id.creatureId); - if (action.summon_id.target >= TARGET_T_END) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1); - if (m_CreatureEventAI_Summon_Map.find(action.summon_id.spawnId) == m_CreatureEventAI_Summon_Map.end()) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u summons missing CreatureEventAI_Summon %u", i, j+1, action.summon_id.spawnId); - break; - case ACTION_T_KILLED_MONSTER: - if (!sObjectMgr->GetCreatureTemplate(action.killed_monster.creatureId)) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existant creature entry %u.", i, j+1, action.killed_monster.creatureId); - if (action.killed_monster.target >= TARGET_T_END) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1); - break; - case ACTION_T_SET_INST_DATA: - if (!(temp.event_flags & EFLAG_DIFFICULTY_ALL)) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u. Cannot set instance data without difficulty event flags.", i, j+1); - if (action.set_inst_data.value > 4/*SPECIAL*/) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u attempts to set instance data above encounter state 4. Custom case?", i, j+1); - break; - case ACTION_T_SET_INST_DATA64: - if (!(temp.event_flags & EFLAG_DIFFICULTY_ALL)) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u. Cannot set instance data without difficulty event flags.", i, j+1); - if (action.set_inst_data64.target >= TARGET_T_END) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j+1); - break; - case ACTION_T_UPDATE_TEMPLATE: - if (!sObjectMgr->GetCreatureTemplate(action.update_template.creatureId)) - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses non-existant creature entry %u.", i, j+1, action.update_template.creatureId); - break; - case ACTION_T_SET_SHEATH: - if (action.set_sheath.sheath >= MAX_SHEATH_STATE) - { - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses wrong sheath state %u.", i, j+1, action.set_sheath.sheath); - action.set_sheath.sheath = SHEATH_STATE_UNARMED; - } - break; - case ACTION_T_SET_INVINCIBILITY_HP_LEVEL: - if (action.invincibility_hp_level.is_percent) - { - if (action.invincibility_hp_level.hp_level > 100) - { - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses wrong percent value %u.", i, j+1, action.invincibility_hp_level.hp_level); - action.invincibility_hp_level.hp_level = 100; - } - } - break; - case ACTION_T_MOUNT_TO_ENTRY_OR_MODEL: - if (action.mount.creatureId != 0 || action.mount.modelId != 0) - { - if (action.mount.creatureId && !sObjectMgr->GetCreatureTemplate(action.mount.creatureId)) - { - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses nonexistent Creature entry %u.", i, j+1, action.mount.creatureId); - action.morph.creatureId = 0; - } - - if (action.mount.modelId) - { - if (action.mount.creatureId) - { - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u have unused ModelId %u with also set creature id %u.", i, j+1, action.mount.modelId, action.mount.creatureId); - action.mount.modelId = 0; - } - else if (!sCreatureDisplayInfoStore.LookupEntry(action.mount.modelId)) - { - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u uses nonexistent ModelId %u.", i, j+1, action.mount.modelId); - action.mount.modelId = 0; - } - } - } - break; - case ACTION_T_EVADE: //No Params - case ACTION_T_FLEE_FOR_ASSIST: //No Params - case ACTION_T_DIE: //No Params - case ACTION_T_ZONE_COMBAT_PULSE: //No Params - case ACTION_T_FORCE_DESPAWN: //No Params - case ACTION_T_AUTO_ATTACK: //AllowAttackState (0 = stop attack, anything else means continue attacking) - case ACTION_T_COMBAT_MOVEMENT: //AllowCombatMovement (0 = stop combat based movement, anything else continue attacking) - case ACTION_T_RANGED_MOVEMENT: //Distance, Angle - case ACTION_T_CALL_FOR_HELP: //Distance - break; - - case ACTION_T_RANDOM_SAY: - case ACTION_T_RANDOM_YELL: - case ACTION_T_RANDOM_TEXTEMOTE: - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u currently unused ACTION type. Did you forget to update database?", i, j+1); - break; - - case ACTION_T_MOVE_RANDOM_POINT: - case ACTION_T_SET_STAND_STATE: - case ACTION_T_SET_PHASE_MASK: - case ACTION_T_SET_VISIBILITY: - case ACTION_T_SET_ACTIVE: - case ACTION_T_SET_AGGRESSIVE: - case ACTION_T_ATTACK_START_PULSE: - case ACTION_T_SUMMON_GO: - break; - - default: - sLog->outError(LOG_FILTER_SQL, "CreatureEventAI: Event %u Action %u have currently not checked at load action type (%u). Need check code update?", i, j+1, action.type); - break; - } - } - - //Add to list - m_CreatureEventAI_Event_Map[creature_id].push_back(temp); - ++count; - - } - while (result->NextRow()); - - sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u CreatureEventAI scripts in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - -} diff --git a/src/server/game/AI/EventAI/CreatureEventAIMgr.h b/src/server/game/AI/EventAI/CreatureEventAIMgr.h deleted file mode 100755 index 93e953681b6..00000000000 --- a/src/server/game/AI/EventAI/CreatureEventAIMgr.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2008-2012 TrinityCore - * Copyright (C) 2005-2009 MaNGOS - * - * 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; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; 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, see . - */ - -#ifndef TRINITY_CREATURE_EAI_MGR_H -#define TRINITY_CREATURE_EAI_MGR_H - -#include "Common.h" -#include "CreatureEventAI.h" - -class CreatureEventAIMgr -{ - friend class ACE_Singleton; - - private: - CreatureEventAIMgr(){}; - ~CreatureEventAIMgr(){}; - - public: - void LoadCreatureEventAI_Texts(); - void LoadCreatureEventAI_Summons(); - void LoadCreatureEventAI_Scripts(); - - CreatureEventAI_Event_Map const& GetCreatureEventAIMap() const { return m_CreatureEventAI_Event_Map; } - CreatureEventAI_Summon_Map const& GetCreatureEventAISummonMap() const { return m_CreatureEventAI_Summon_Map; } - CreatureEventAI_TextMap const& GetCreatureEventAITextMap() const { return m_CreatureEventAI_TextMap; } - - private: - CreatureEventAI_Event_Map m_CreatureEventAI_Event_Map; - CreatureEventAI_Summon_Map m_CreatureEventAI_Summon_Map; - CreatureEventAI_TextMap m_CreatureEventAI_TextMap; -}; - -#define sEventAIMgr ACE_Singleton::instance() -#endif diff --git a/src/server/game/CMakeLists.txt b/src/server/game/CMakeLists.txt index a83e77e6632..f41cd75d127 100644 --- a/src/server/game/CMakeLists.txt +++ b/src/server/game/CMakeLists.txt @@ -132,7 +132,6 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/Addons ${CMAKE_CURRENT_SOURCE_DIR}/AI ${CMAKE_CURRENT_SOURCE_DIR}/AI/CoreAI - ${CMAKE_CURRENT_SOURCE_DIR}/AI/EventAI ${CMAKE_CURRENT_SOURCE_DIR}/AI/ScriptedAI ${CMAKE_CURRENT_SOURCE_DIR}/AI/SmartScripts ${CMAKE_CURRENT_SOURCE_DIR}/AuctionHouse diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 67ba643dd97..d4668142b3b 100755 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -28,7 +28,7 @@ #include "Spell.h" // Checks if object meets the condition -// Can have CONDITION_SOURCE_TYPE_NONE && !mReferenceId if called from a special event (ie: eventAI) +// Can have CONDITION_SOURCE_TYPE_NONE && !mReferenceId if called from a special event (ie: SmartAI) bool Condition::Meets(ConditionSourceInfo& sourceInfo) { ASSERT(ConditionTarget < MAX_CONDITION_TARGETS); diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index aa48dcca787..7cf02eea8df 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -40,7 +40,6 @@ #include "ArenaTeamMgr.h" #include "GuildMgr.h" #include "TicketMgr.h" -#include "CreatureEventAIMgr.h" #include "SpellMgr.h" #include "GroupMgr.h" #include "Chat.h" @@ -1628,15 +1627,6 @@ void World::SetInitialWorldSettings() sLog->outInfo(LOG_FILTER_GENERAL, "Loading Scripts text locales..."); // must be after Load*Scripts calls sObjectMgr->LoadDbScriptStrings(); - sLog->outInfo(LOG_FILTER_GENERAL, "Loading CreatureEventAI Texts..."); - sEventAIMgr->LoadCreatureEventAI_Texts(); - - sLog->outInfo(LOG_FILTER_GENERAL, "Loading CreatureEventAI Summons..."); - sEventAIMgr->LoadCreatureEventAI_Summons(); - - sLog->outInfo(LOG_FILTER_GENERAL, "Loading CreatureEventAI Scripts..."); - sEventAIMgr->LoadCreatureEventAI_Scripts(); - sLog->outInfo(LOG_FILTER_GENERAL, "Loading spell script names..."); sObjectMgr->LoadSpellScriptNames(); diff --git a/src/server/scripts/CMakeLists.txt b/src/server/scripts/CMakeLists.txt index 792fdeb3e7b..6d0d8ec8189 100644 --- a/src/server/scripts/CMakeLists.txt +++ b/src/server/scripts/CMakeLists.txt @@ -76,7 +76,6 @@ include_directories( ${CMAKE_SOURCE_DIR}/src/server/game/Addons ${CMAKE_SOURCE_DIR}/src/server/game/AI ${CMAKE_SOURCE_DIR}/src/server/game/AI/CoreAI - ${CMAKE_SOURCE_DIR}/src/server/game/AI/EventAI ${CMAKE_SOURCE_DIR}/src/server/game/AI/ScriptedAI ${CMAKE_SOURCE_DIR}/src/server/game/AI/SmartScripts ${CMAKE_SOURCE_DIR}/src/server/game/AuctionHouse diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp index 40b36fb8d52..77f6316c881 100644 --- a/src/server/scripts/Commands/cs_reload.cpp +++ b/src/server/scripts/Commands/cs_reload.cpp @@ -27,7 +27,6 @@ EndScriptData */ #include "SpellMgr.h" #include "TicketMgr.h" #include "MapManager.h" -#include "CreatureEventAIMgr.h" #include "DisableMgr.h" #include "LFGMgr.h" #include "AuctionHouseMgr.h" @@ -50,7 +49,6 @@ public: { { "achievement", SEC_ADMINISTRATOR, true, &HandleReloadAllAchievementCommand, "", NULL }, { "area", SEC_ADMINISTRATOR, true, &HandleReloadAllAreaCommand, "", NULL }, - { "eventai", SEC_ADMINISTRATOR, true, &HandleReloadAllEventAICommand, "", NULL }, { "gossips", SEC_ADMINISTRATOR, true, &HandleReloadAllGossipsCommand, "", NULL }, { "item", SEC_ADMINISTRATOR, true, &HandleReloadAllItemCommand, "", NULL }, { "locales", SEC_ADMINISTRATOR, true, &HandleReloadAllLocalesCommand, "", NULL }, @@ -77,9 +75,6 @@ public: { "conditions", SEC_ADMINISTRATOR, true, &HandleReloadConditions, "", NULL }, { "config", SEC_ADMINISTRATOR, true, &HandleReloadConfigCommand, "", NULL }, { "creature_text", SEC_ADMINISTRATOR, true, &HandleReloadCreatureText, "", NULL }, - { "creature_ai_scripts", SEC_ADMINISTRATOR, true, &HandleReloadEventAIScriptsCommand, "", NULL }, - { "creature_ai_summons", SEC_ADMINISTRATOR, true, &HandleReloadEventAISummonsCommand, "", NULL }, - { "creature_ai_texts", SEC_ADMINISTRATOR, true, &HandleReloadEventAITextsCommand, "", NULL }, { "creature_involvedrelation", SEC_ADMINISTRATOR, true, &HandleReloadCreatureQuestInvRelationsCommand, "", NULL }, { "creature_linked_respawn", SEC_GAMEMASTER, true, &HandleReloadLinkedRespawnCommand, "", NULL }, { "creature_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesCreatureCommand, "", NULL }, @@ -179,7 +174,6 @@ public: HandleReloadAllAchievementCommand(handler, ""); HandleReloadAllAreaCommand(handler, ""); - HandleReloadAllEventAICommand(handler, ""); HandleReloadAllLootCommand(handler, ""); HandleReloadAllNpcCommand(handler, ""); HandleReloadAllQuestCommand(handler, ""); @@ -271,14 +265,6 @@ public: return true; } - static bool HandleReloadAllEventAICommand(ChatHandler* handler, const char* /*args*/) - { - HandleReloadEventAITextsCommand(handler, "a"); - HandleReloadEventAISummonsCommand(handler, "a"); - HandleReloadEventAIScriptsCommand(handler, "a"); - return true; - } - static bool HandleReloadAllSpellCommand(ChatHandler* handler, const char* /*args*/) { HandleReloadSkillDiscoveryTemplateCommand(handler, "a"); @@ -1018,31 +1004,6 @@ public: return true; } - static bool HandleReloadEventAITextsCommand(ChatHandler* handler, const char* /*args*/) - { - - sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Texts from `creature_ai_texts`..."); - sEventAIMgr->LoadCreatureEventAI_Texts(); - handler->SendGlobalGMSysMessage("DB table `creature_ai_texts` reloaded."); - return true; - } - - static bool HandleReloadEventAISummonsCommand(ChatHandler* handler, const char* /*args*/) - { - sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Summons from `creature_ai_summons`..."); - sEventAIMgr->LoadCreatureEventAI_Summons(); - handler->SendGlobalGMSysMessage("DB table `creature_ai_summons` reloaded."); - return true; - } - - static bool HandleReloadEventAIScriptsCommand(ChatHandler* handler, const char* /*args*/) - { - sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Scripts from `creature_ai_scripts`..."); - sEventAIMgr->LoadCreatureEventAI_Scripts(); - handler->SendGlobalGMSysMessage("DB table `creature_ai_scripts` reloaded."); - return true; - } - static bool HandleReloadQuestEndScriptsCommand(ChatHandler* handler, const char* args) { if (sScriptMgr->IsScriptScheduled()) diff --git a/src/server/shared/Logging/Appender.h b/src/server/shared/Logging/Appender.h index 4b5b4edb0ac..b95a72c6713 100644 --- a/src/server/shared/Logging/Appender.h +++ b/src/server/shared/Logging/Appender.h @@ -30,7 +30,7 @@ enum LogFilterType LOG_FILTER_PETS, LOG_FILTER_VEHICLES, LOG_FILTER_TSCR, // C++ AI, instance scripts, etc. - LOG_FILTER_DATABASE_AI, // SmartAI, EventAI, Creature* * AI + LOG_FILTER_DATABASE_AI, // SmartAI, Creature* * AI LOG_FILTER_MAPSCRIPTS, LOG_FILTER_NETWORKIO, LOG_FILTER_SPELLS_AURAS, diff --git a/src/server/worldserver/CMakeLists.txt b/src/server/worldserver/CMakeLists.txt index eb5bb04d766..b23e15e50a1 100644 --- a/src/server/worldserver/CMakeLists.txt +++ b/src/server/worldserver/CMakeLists.txt @@ -70,7 +70,6 @@ include_directories( ${CMAKE_SOURCE_DIR}/src/server/game/Addons ${CMAKE_SOURCE_DIR}/src/server/game/AI ${CMAKE_SOURCE_DIR}/src/server/game/AI/CoreAI - ${CMAKE_SOURCE_DIR}/src/server/game/AI/EventAI ${CMAKE_SOURCE_DIR}/src/server/game/AI/ScriptedAI ${CMAKE_SOURCE_DIR}/src/server/game/AI/SmartScripts ${CMAKE_SOURCE_DIR}/src/server/game/AuctionHouse -- cgit v1.2.3 From cf30a0aaaf9aa6a41a851fa8ac361be38352ff59 Mon Sep 17 00:00:00 2001 From: kiper Date: Tue, 14 Aug 2012 01:59:20 +0200 Subject: Core/Player: Now players will able to equip all types of relics when meet requirements from items and have relic skill. --- ...2012_08_14_00_reputation_spillover_template.sql | 2 +- src/server/game/Entities/Player/Player.cpp | 27 +++------------------- 2 files changed, 4 insertions(+), 25 deletions(-) (limited to 'src') diff --git a/sql/updates/world/2012_08_14_00_reputation_spillover_template.sql b/sql/updates/world/2012_08_14_00_reputation_spillover_template.sql index cc7e011ca43..66dbf0e10e0 100644 --- a/sql/updates/world/2012_08_14_00_reputation_spillover_template.sql +++ b/sql/updates/world/2012_08_14_00_reputation_spillover_template.sql @@ -9,4 +9,4 @@ UPDATE `reputation_spillover_template` SET `faction5`=1133,`rate_5`=0.25,`rank_5 DELETE FROM `reputation_spillover_template` WHERE `faction` IN (1134,1133); INSERT INTO `reputation_spillover_template`(`faction`,`faction1`,`rate_1`,`rank_1`,`faction2`,`rate_2`,`rank_2`,`faction3`,`rate_3`,`rank_3`,`faction4`,`rate_4`,`rank_4`,`faction5`,`rate_5`,`rank_5`) VALUES (1134,72,0.25,7,47,0.27,7,54,0.25,7,930,0.25,7,69,0.25,7), -(1133,76,0.25,7,530,0.27,7,911,0.25,7,81,0.25,7,68,0.25,7), \ No newline at end of file +(1133,76,0.25,7,530,0.27,7,911,0.25,7,81,0.25,7,68,0.25,7); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 188fdb5e9f4..3236c5e5865 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -9936,30 +9936,9 @@ uint8 Player::FindEquipSlot(ItemTemplate const* proto, uint32 slot, bool swap) c break; case INVTYPE_RELIC: { - switch (proto->SubClass) - { - case ITEM_SUBCLASS_ARMOR_LIBRAM: - if (playerClass == CLASS_PALADIN) - slots[0] = EQUIPMENT_SLOT_RANGED; - break; - case ITEM_SUBCLASS_ARMOR_IDOL: - if (playerClass == CLASS_DRUID) - slots[0] = EQUIPMENT_SLOT_RANGED; - break; - case ITEM_SUBCLASS_ARMOR_TOTEM: - if (playerClass == CLASS_SHAMAN) - slots[0] = EQUIPMENT_SLOT_RANGED; - break; - case ITEM_SUBCLASS_ARMOR_MISCELLANEOUS: - if (playerClass == CLASS_WARLOCK) - slots[0] = EQUIPMENT_SLOT_RANGED; - break; - case ITEM_SUBCLASS_ARMOR_SIGIL: - if (playerClass == CLASS_DEATH_KNIGHT) - slots[0] = EQUIPMENT_SLOT_RANGED; - break; - } - break; + if(playerClass == CLASS_PALADIN || playerClass == CLASS_DRUID|| + playerClass == CLASS_SHAMAN || playerClass == CLASS_DEATH_KNIGHT) + slots[0] = EQUIPMENT_SLOT_RANGED; } default: return NULL_SLOT; -- cgit v1.2.3 From 12ad39c43cc9ee576289203b76dc8faa0bfde517 Mon Sep 17 00:00:00 2001 From: kiper Date: Tue, 14 Aug 2012 02:08:29 +0200 Subject: Fix code style. --- sql/updates/world/2012_08_14_00_reputation_spillover_template.sql | 1 + src/server/game/Entities/Player/Player.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/sql/updates/world/2012_08_14_00_reputation_spillover_template.sql b/sql/updates/world/2012_08_14_00_reputation_spillover_template.sql index 66dbf0e10e0..afce8209afa 100644 --- a/sql/updates/world/2012_08_14_00_reputation_spillover_template.sql +++ b/sql/updates/world/2012_08_14_00_reputation_spillover_template.sql @@ -10,3 +10,4 @@ DELETE FROM `reputation_spillover_template` WHERE `faction` IN (1134,1133); INSERT INTO `reputation_spillover_template`(`faction`,`faction1`,`rate_1`,`rank_1`,`faction2`,`rate_2`,`rank_2`,`faction3`,`rate_3`,`rank_3`,`faction4`,`rate_4`,`rank_4`,`faction5`,`rate_5`,`rank_5`) VALUES (1134,72,0.25,7,47,0.27,7,54,0.25,7,930,0.25,7,69,0.25,7), (1133,76,0.25,7,530,0.27,7,911,0.25,7,81,0.25,7,68,0.25,7); + diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 3236c5e5865..17cead41795 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -9936,9 +9936,10 @@ uint8 Player::FindEquipSlot(ItemTemplate const* proto, uint32 slot, bool swap) c break; case INVTYPE_RELIC: { - if(playerClass == CLASS_PALADIN || playerClass == CLASS_DRUID|| - playerClass == CLASS_SHAMAN || playerClass == CLASS_DEATH_KNIGHT) - slots[0] = EQUIPMENT_SLOT_RANGED; + if (playerClass == CLASS_PALADIN || playerClass == CLASS_DRUID || + playerClass == CLASS_SHAMAN || playerClass == CLASS_DEATH_KNIGHT) + slots[0] = EQUIPMENT_SLOT_RANGED; + break; } default: return NULL_SLOT; -- cgit v1.2.3 From df073d3d692905f1fc1c64ff42d73cff04c5738d Mon Sep 17 00:00:00 2001 From: Subv Date: Mon, 13 Aug 2012 19:15:15 -0500 Subject: Core/Spells: Finished cleanup in Unit::HandleDummyAuraProc --- src/server/game/Entities/Unit/Unit.cpp | 270 +--------------------- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 16 -- 2 files changed, 12 insertions(+), 274 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index e3d316ca23e..03de01795f7 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -6303,7 +6303,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere { // "refresh your Slice and Dice duration to its 5 combo point maximum" // lookup Slice and Dice - if (Aura const* aur = GetAura(5171)) + if (Aura* aur = GetAura(5171)) { aur->SetDuration(aur->GetSpellInfo()->GetMaxDuration(), true); return true; @@ -6599,14 +6599,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere { switch (dummySpell->Id) { - // Tidal Force - case 55198: - { - // Remove aura stack from caster - RemoveAuraFromStack(55166); - // drop charges - return false; - } // Totemic Power (The Earthshatterer set) case 28823: { @@ -6679,26 +6671,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere return false; // Now amount of extra power stored in 1 effect of Enchant spell - // Get it by item enchant id - uint32 spellId; - switch (castItem->GetEnchantmentId(EnchantmentSlot(TEMP_ENCHANTMENT_SLOT))) - { - case 283: spellId = 8232; break; // 1 Rank - case 284: spellId = 8235; break; // 2 Rank - case 525: spellId = 10486; break; // 3 Rank - case 1669:spellId = 16362; break; // 4 Rank - case 2636:spellId = 25505; break; // 5 Rank - case 3785:spellId = 58801; break; // 6 Rank - case 3786:spellId = 58803; break; // 7 Rank - case 3787:spellId = 58804; break; // 8 Rank - default: - { - sLog->outError(LOG_FILTER_UNITS, "Unit::HandleDummyAuraProc: non handled item enchantment (rank?) %u for spell id: %u (Windfury)", - castItem->GetEnchantmentId(EnchantmentSlot(TEMP_ENCHANTMENT_SLOT)), dummySpell->Id); - return false; - } - } - + uint32 spellId = 8232; SpellInfo const* windfurySpellInfo = sSpellMgr->GetSpellInfo(spellId); if (!windfurySpellInfo) { @@ -6866,23 +6839,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere // if not found Flame Shock return false; } - case 63280: // Glyph of Totem of Wrath - { - if (procSpell->SpellIconID != 2019) - return false; - - if (Creature* totem = GetMap()->GetCreature(m_SummonSlot[1])) // Fire totem summon slot - { - if (SpellInfo const* totemSpell = sSpellMgr->GetSpellInfo(totem->m_spells[0])) - { - int32 bp0 = CalculatePctN(totemSpell->Effects[EFFECT_0].CalcValue(), triggerAmount); - int32 bp1 = CalculatePctN(totemSpell->Effects[EFFECT_1].CalcValue(), triggerAmount); - CastCustomSpell(this, 63283, &bp0, &bp1, NULL, true); - return true; - } - } - return false; - } break; } // Frozen Power @@ -6908,7 +6864,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere break; } // Earth Shield - if (dummySpell->SpellFamilyFlags[1] & 0x00000400) + if (dummySpell->Id == 974) { // 3.0.8: Now correctly uses the Shaman's own spell critical strike chance to determine the chance of a critical heal. originalCaster = triggeredByAura->GetCasterGUID(); @@ -6968,109 +6924,19 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere CastCustomSpell(victim, triggered_spell_id, &basepoints0, NULL, NULL, true, castItem, triggeredByAura); return true; } - // Improved Water Shield - if (dummySpell->SpellIconID == 2287) - { - // Default chance for Healing Wave and Riptide - float chance = (float)triggeredByAura->GetAmount(); - - if (procSpell->SpellFamilyFlags[0] & 0x80) - // Lesser Healing Wave - 0.6 of default - chance *= 0.6f; - else if (procSpell->SpellFamilyFlags[0] & 0x100) - // Chain heal - 0.3 of default - chance *= 0.3f; - - if (!roll_chance_f(chance)) - return false; - - // Water Shield - if (AuraEffect const* aurEff = GetAuraEffect(SPELL_AURA_PROC_TRIGGER_SPELL, SPELLFAMILY_SHAMAN, 0, 0x00000020, 0)) - { - uint32 spell = aurEff->GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell; - CastSpell(this, spell, true, castItem, triggeredByAura); - return true; - } - return false; - } - // Lightning Overload - if (dummySpell->SpellIconID == 2018) // only this spell has SpellFamily Shaman SpellIconID == 2018 and dummy aura - { - if (!procSpell || GetTypeId() != TYPEID_PLAYER || !victim) - return false; - - // custom cooldown processing case - if (cooldown && GetTypeId() == TYPEID_PLAYER && ToPlayer()->HasSpellCooldown(dummySpell->Id)) - return false; - - uint32 spellId = 0; - // Every Lightning Bolt and Chain Lightning spell have duplicate vs half damage and zero cost - switch (procSpell->Id) - { - // Lightning Bolt - case 403: spellId = 45284; break; // Rank 1 - case 529: spellId = 45286; break; // Rank 2 - case 548: spellId = 45287; break; // Rank 3 - case 915: spellId = 45288; break; // Rank 4 - case 943: spellId = 45289; break; // Rank 5 - case 6041: spellId = 45290; break; // Rank 6 - case 10391: spellId = 45291; break; // Rank 7 - case 10392: spellId = 45292; break; // Rank 8 - case 15207: spellId = 45293; break; // Rank 9 - case 15208: spellId = 45294; break; // Rank 10 - case 25448: spellId = 45295; break; // Rank 11 - case 25449: spellId = 45296; break; // Rank 12 - case 49237: spellId = 49239; break; // Rank 13 - case 49238: spellId = 49240; break; // Rank 14 - // Chain Lightning - case 421: spellId = 45297; break; // Rank 1 - case 930: spellId = 45298; break; // Rank 2 - case 2860: spellId = 45299; break; // Rank 3 - case 10605: spellId = 45300; break; // Rank 4 - case 25439: spellId = 45301; break; // Rank 5 - case 25442: spellId = 45302; break; // Rank 6 - case 49270: spellId = 49268; break; // Rank 7 - case 49271: spellId = 49269; break; // Rank 8 - default: - sLog->outError(LOG_FILTER_UNITS, "Unit::HandleDummyAuraProc: non handled spell id: %u (LO)", procSpell->Id); - return false; - } - - // Chain Lightning - if (procSpell->SpellFamilyFlags[0] & 0x2) - { - // Chain lightning has [LightOverload_Proc_Chance] / [Max_Number_of_Targets] chance to proc of each individual target hit. - // A maxed LO would have a 33% / 3 = 11% chance to proc of each target. - // LO chance was already "accounted" at the proc chance roll, now need to divide the chance by [Max_Number_of_Targets] - float chance = 100.0f / procSpell->Effects[effIndex].ChainTarget; - if (!roll_chance_f(chance)) - return false; - - // Remove cooldown (Chain Lightning - has Category Recovery time) - ToPlayer()->RemoveSpellCooldown(spellId); - } - - CastSpell(victim, spellId, true, castItem, triggeredByAura); - - if (cooldown && GetTypeId() == TYPEID_PLAYER) - ToPlayer()->AddSpellCooldown(dummySpell->Id, 0, time(NULL) + cooldown); - - return true; - } // Static Shock if (dummySpell->SpellIconID == 3059) { // Lightning Shield if (AuraEffect const* aurEff = GetAuraEffect(SPELL_AURA_PROC_TRIGGER_SPELL, SPELLFAMILY_SHAMAN, 0x400, 0, 0)) { - uint32 spell = sSpellMgr->GetSpellWithRank(26364, aurEff->GetSpellInfo()->GetRank()); + uint32 spell = 26364; // custom cooldown processing case if (GetTypeId() == TYPEID_PLAYER && ToPlayer()->HasSpellCooldown(spell)) ToPlayer()->RemoveSpellCooldown(spell); - + CastSpell(target, spell, true, castItem, triggeredByAura); - aurEff->GetBase()->DropCharge(); return true; } return false; @@ -7079,7 +6945,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere } case SPELLFAMILY_DEATHKNIGHT: { - // Blood-Caked Strike - Blood-Caked Blade + // Blood-Caked Blade if (dummySpell->SpellIconID == 138) { if (!target || !target->isAlive()) @@ -7088,14 +6954,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere triggered_spell_id = dummySpell->Effects[effIndex].TriggerSpell; break; } - // Improved Blood Presence - if (dummySpell->SpellIconID == 2636) - { - if (GetTypeId() != TYPEID_PLAYER) - return false; - basepoints0 = CalculatePctN(int32(damage), triggerAmount); - break; - } // Butchery if (dummySpell->SpellIconID == 2664) { @@ -7129,40 +6987,14 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere else return false; } - // Mark of Blood - if (dummySpell->Id == 49005) - { - // TODO: need more info (cooldowns/PPM) - triggered_spell_id = 61607; - break; - } // Unholy Blight if (dummySpell->Id == 49194) { basepoints0 = CalculatePctN(int32(damage), triggerAmount); - // Glyph of Unholy Blight - if (AuraEffect* glyph=GetAuraEffect(63332, 0)) - AddPctN(basepoints0, glyph->GetAmount()); - triggered_spell_id = 50536; basepoints0 += victim->GetRemainingPeriodicAmount(GetGUID(), triggered_spell_id, SPELL_AURA_PERIODIC_DAMAGE); break; } - // Vendetta - if (dummySpell->SpellFamilyFlags[0] & 0x10000) - { - basepoints0 = int32(CountPctFromMaxHealth(triggerAmount)); - triggered_spell_id = 50181; - target = this; - break; - } - // Necrosis - if (dummySpell->SpellIconID == 2709) - { - basepoints0 = CalculatePctN(int32(damage), triggerAmount); - triggered_spell_id = 51460; - break; - } // Threat of Thassarian if (dummySpell->SpellIconID == 2023) { @@ -7175,45 +7007,12 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere switch (procSpell->Id) { - // Obliterate - case 49020: triggered_spell_id = 66198; break; // Rank 1 - case 51423: triggered_spell_id = 66972; break; // Rank 2 - case 51424: triggered_spell_id = 66973; break; // Rank 3 - case 51425: triggered_spell_id = 66974; break; // Rank 4 - - // Frost Strike - case 49143: triggered_spell_id = 66196; break; // Rank 1 - case 51416: triggered_spell_id = 66958; break; // Rank 2 - case 51417: triggered_spell_id = 66959; break; // Rank 3 - case 51418: triggered_spell_id = 66960; break; // Rank 4 - case 51419: triggered_spell_id = 66961; break; // Rank 5 - case 55268: triggered_spell_id = 66962; break; // Rank 6 - - // Plague Strike - case 45462: triggered_spell_id = 66216; break; // Rank 1 - case 49917: triggered_spell_id = 66988; break; // Rank 2 - case 49918: triggered_spell_id = 66989; break; // Rank 3 - case 49919: triggered_spell_id = 66990; break; // Rank 4 - case 49920: triggered_spell_id = 66991; break; // Rank 5 - case 49921: triggered_spell_id = 66992; break; // Rank 6 - - // Death Strike - case 49998: triggered_spell_id = 66188; break; // Rank 1 - case 49999: triggered_spell_id = 66950; break; // Rank 2 - case 45463: triggered_spell_id = 66951; break; // Rank 3 - case 49923: triggered_spell_id = 66952; break; // Rank 4 - case 49924: triggered_spell_id = 66953; break; // Rank 5 - - // Rune Strike - case 56815: triggered_spell_id = 66217; break; // Rank 1 - - // Blood Strike - case 45902: triggered_spell_id = 66215; break; // Rank 1 - case 49926: triggered_spell_id = 66975; break; // Rank 2 - case 49927: triggered_spell_id = 66976; break; // Rank 3 - case 49928: triggered_spell_id = 66977; break; // Rank 4 - case 49929: triggered_spell_id = 66978; break; // Rank 5 - case 49930: triggered_spell_id = 66979; break; // Rank 6 + case 49020: triggered_spell_id = 66198; break; // Obliterate + case 49143: triggered_spell_id = 66196; break; // Frost Strike + case 45462: triggered_spell_id = 66216; break; // Plague Strike + case 49998: triggered_spell_id = 66188; break; // Death Strike + case 56815: triggered_spell_id = 66217; break; // Rune Strike + case 45902: triggered_spell_id = 66215; break; // Blood Strike default: return false; } @@ -7232,51 +7031,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere target = this; break; } - // Wandering Plague - if (dummySpell->SpellIconID == 1614) - { - if (!roll_chance_f(GetUnitCriticalChance(BASE_ATTACK, victim))) - return false; - basepoints0 = CalculatePctN(int32(damage), triggerAmount); - triggered_spell_id = 50526; - break; - } - // Sudden Doom - if (dummySpell->SpellIconID == 1939 && GetTypeId() == TYPEID_PLAYER) - { - SpellChainNode const* chain = NULL; - // get highest rank of the Death Coil spell - PlayerSpellMap const& sp_list = ToPlayer()->GetSpellMap(); - for (PlayerSpellMap::const_iterator itr = sp_list.begin(); itr != sp_list.end(); ++itr) - { - // check if shown in spell book - if (!itr->second->active || itr->second->disabled || itr->second->state == PLAYERSPELL_REMOVED) - continue; - - SpellInfo const* spellProto = sSpellMgr->GetSpellInfo(itr->first); - if (!spellProto) - continue; - - if (spellProto->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT - && spellProto->SpellFamilyFlags[0] & 0x2000) - { - SpellChainNode const* newChain = sSpellMgr->GetSpellChainNode(itr->first); - - // No chain entry or entry lower than found entry - if (!chain || !newChain || (chain->rank < newChain->rank)) - { - triggered_spell_id = itr->first; - chain = newChain; - } - else - continue; - // Found spell is last in chain - do not need to look more - // Optimisation for most common case - if (chain && chain->last->Id == itr->first) - break; - } - } - } break; } case SPELLFAMILY_POTION: diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index e81d465b664..eef306e5616 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -4979,22 +4979,6 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool } break; } - case 55198: // Tidal Force - { - target->CastSpell(target, 55166, true, NULL, this); - // set 3 stacks and 3 charges (to make all auras not disappear at once) - Aura* owner_aura = target->GetAura(55166, GetCasterGUID()); - if (owner_aura) - { - // This aura lasts 2 sec, need this hack to properly proc spells - // TODO: drop aura charges for ApplySpellMod in ProcDamageAndSpell - GetBase()->SetDuration(owner_aura->GetDuration()); - // Make aura be not charged-this prevents removing charge on not crit spells - owner_aura->SetCharges(0); - owner_aura->SetStackAmount(owner_aura->GetSpellInfo()->StackAmount); - } - break; - } case 39850: // Rocket Blast if (roll_chance_i(20)) // backfire stun target->CastSpell(target, 51581, true, NULL, this); -- cgit v1.2.3 From a768bba3c67e8c663ba95851dfedf2b300dfdee3 Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 14 Aug 2012 02:56:45 +0100 Subject: Core: Add enum for currency flags, update MAX_VENDOR_ITEMS and fix build --- src/server/game/DataStores/DBCStructure.h | 2 +- src/server/game/Entities/Creature/Creature.h | 2 +- src/server/game/Entities/Item/ItemPrototype.h | 8 ++++++++ src/server/game/Entities/Player/Player.cpp | 4 ++-- 4 files changed, 12 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 56f422faf9d..c5344adbc8d 100644 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -1120,7 +1120,7 @@ struct GtRegenMPPerSptEntry struct GtSpellScalingEntry { float value; -} +}; struct GtOCTBaseHPByClassEntry { diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index 4b2582ec558..61982026933 100755 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -406,7 +406,7 @@ typedef std::map CreatureSpellCooldowns; // max different by z coordinate for creature aggro reaction #define CREATURE_Z_ATTACK_RANGE 3 -#define MAX_VENDOR_ITEMS 150 // Limitation in 3.x.x item count in SMSG_LIST_INVENTORY +#define MAX_VENDOR_ITEMS 300 // Limitation in 4.x.x item count in SMSG_LIST_INVENTORY enum CreatureCellMoveState { diff --git a/src/server/game/Entities/Item/ItemPrototype.h b/src/server/game/Entities/Item/ItemPrototype.h index 0d51c6e7e70..1fd46a2d879 100755 --- a/src/server/game/Entities/Item/ItemPrototype.h +++ b/src/server/game/Entities/Item/ItemPrototype.h @@ -210,6 +210,14 @@ enum ItemFlagsCustom ITEM_FLAGS_CU_FOLLOW_LOOT_RULES = 0x0004, // Item will always follow group/master/need before greed looting rules }; +enum CurrencyFlags +{ + CURRENCY_FLAG_TRADEABLE = 0x01, + // ... + CURRENCY_FLAG_HIGH_PRECISION = 0x08, + // ... +}; + enum BAG_FAMILY_MASK { BAG_FAMILY_MASK_NONE = 0x00000000, diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 17cead41795..108e4b05e08 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -7253,7 +7253,7 @@ void Player::SendCurrencies() const if (!entry) // should never happen continue; - uint32 precision = (entry->Flags & 0x8) ? 100 : 1; + uint32 precision = (entry->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? 100 : 1; uint32 weekCount = itr->second.weekCount / precision; uint32 weekCap = _GetCurrencyWeekCap(entry) / precision; @@ -7299,7 +7299,7 @@ void Player::ModifyCurrency(uint32 id, int32 count) CurrencyTypesEntry const* currency = sCurrencyTypesStore.LookupEntry(id); ASSERT(currency); - int32 precision = currency->Flags & 0x8 ? 100 : 1; + int32 precision = currency->Flags & CURRENCY_FLAG_HIGH_PRECISION ? 100 : 1; uint32 oldTotalCount = 0; uint32 oldWeekCount = 0; PlayerCurrenciesMap::iterator itr = m_currencies.find(id); -- cgit v1.2.3 From e761458b249b8f2a128867ea0bd7adf5eaec4769 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 14 Aug 2012 15:29:43 +0200 Subject: Core/Taxi: Updated taxi mask building --- src/server/game/DataStores/DBCStores.cpp | 6 +++--- src/server/game/DataStores/DBCStructure.h | 4 ++-- src/server/game/Entities/Player/Player.cpp | 8 ++++---- src/server/game/Entities/Player/Player.h | 8 ++++---- src/server/game/Globals/ObjectMgr.cpp | 6 +++--- src/server/game/Handlers/TaxiHandler.cpp | 6 +++--- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- 7 files changed, 20 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index a42c7257eb6..9a1702903d7 100644 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -689,10 +689,10 @@ void LoadDBCStores(const std::string& dataPath) } // valid taxi network node - uint8 field = (uint8)((i - 1) / 32); - uint32 submask = 1<<((i-1)%32); - sTaxiNodesMask[field] |= submask; + uint8 field = (uint8)((i - 1) / 8); + uint32 submask = 1 << ((i-1) % 8); + sTaxiNodesMask[field] |= submask; if (node->MountCreatureID[0] && node->MountCreatureID[0] != 32981) sHordeTaxiNodesMask[field] |= submask; if (node->MountCreatureID[1] && node->MountCreatureID[1] != 32981) diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index c5344adbc8d..948647dd6ab 100644 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -2429,6 +2429,6 @@ struct TaxiPathNodePtr typedef Path TaxiPathNodeList; typedef std::vector TaxiPathNodesByPath; -#define TaxiMaskSize 25 -typedef uint32 TaxiMask[TaxiMaskSize]; +#define TaxiMaskSize 114 +typedef uint8 TaxiMask[TaxiMaskSize]; #endif diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 108e4b05e08..bd835db1ca6 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -195,12 +195,12 @@ void PlayerTaxi::AppendTaximaskTo(ByteBuffer& data, bool all) data << uint32(TaxiMaskSize); if (all) { - for (uint8 i=0; i< TaxiMaskSize; i++) + for (uint8 i = 0; i < TaxiMaskSize; ++i) data << uint8(sTaxiNodesMask[i]); // all existed nodes } else { - for (uint8 i=0; i < TaxiMaskSize; i++) + for (uint8 i = 0; i < TaxiMaskSize; ++i) data << uint8(m_taximask[i]); // known nodes } } @@ -269,7 +269,7 @@ uint32 PlayerTaxi::GetCurrentTaxiPath() const std::ostringstream& operator<< (std::ostringstream& ss, PlayerTaxi const& taxi) { for (uint8 i = 0; i < TaxiMaskSize; ++i) - ss << taxi.m_taximask[i] << ' '; + ss << uint32(taxi.m_taximask[i]) << ' '; return ss; } @@ -3270,7 +3270,7 @@ void Player::InitStatsForLevel(bool reapplyMods) SetFloatValue(PLAYER_PARRY_PERCENTAGE, 0.0f); SetFloatValue(PLAYER_BLOCK_PERCENTAGE, 0.0f); - + // Static 30% damage blocked SetUInt32Value(PLAYER_SHIELD_BLOCK, 30); diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index c8c132b56f3..a8e9e5ed407 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -886,14 +886,14 @@ class PlayerTaxi bool IsTaximaskNodeKnown(uint32 nodeidx) const { - uint8 field = uint8((nodeidx - 1) / 32); - uint32 submask = 1<<((nodeidx-1)%32); + uint8 field = uint8((nodeidx - 1) / 8); + uint32 submask = 1 << ((nodeidx-1) % 8); return (m_taximask[field] & submask) == submask; } bool SetTaximaskNode(uint32 nodeidx) { - uint8 field = uint8((nodeidx - 1) / 32); - uint32 submask = 1<<((nodeidx-1)%32); + uint8 field = uint8((nodeidx - 1) / 8); + uint32 submask = 1 << ((nodeidx-1) % 8); if ((m_taximask[field] & submask) != submask) { m_taximask[field] |= submask; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index c63f599cd45..6dbe7574cd2 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -5484,8 +5484,8 @@ uint32 ObjectMgr::GetNearestTaxiNode(float x, float y, float z, uint32 mapid, ui if (!node || node->map_id != mapid || (!node->MountCreatureID[team == ALLIANCE ? 1 : 0] && node->MountCreatureID[0] != 32981)) // dk flight continue; - uint8 field = (uint8)((i - 1) / 32); - uint32 submask = 1<<((i-1)%32); + uint8 field = (uint8)((i - 1) / 8); + uint32 submask = 1 << ((i-1) % 8); // skip not taxi network nodes if ((sTaxiNodesMask[field] & submask) == 0) @@ -6804,7 +6804,7 @@ void ObjectMgr::LoadReputationSpilloverTemplate() _repSpilloverTemplateStore.clear(); // for reload case - uint32 count = 0; // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 + uint32 count = 0; // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 QueryResult result = WorldDatabase.Query("SELECT faction, faction1, rate_1, rank_1, faction2, rate_2, rank_2, faction3, rate_3, rank_3, faction4, rate_4, rank_4, faction5, rate_5, rank_5 FROM reputation_spillover_template"); if (!result) diff --git a/src/server/game/Handlers/TaxiHandler.cpp b/src/server/game/Handlers/TaxiHandler.cpp index 2a16efaf88b..a3e7959cdeb 100755 --- a/src/server/game/Handlers/TaxiHandler.cpp +++ b/src/server/game/Handlers/TaxiHandler.cpp @@ -94,12 +94,12 @@ void WorldSession::SendTaxiMenu(Creature* unit) { // find current node uint32 curloc = sObjectMgr->GetNearestTaxiNode(unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ(), unit->GetMapId(), GetPlayer()->GetTeam()); - - if (curloc == 0) + if (!curloc) return; bool lastTaxiCheaterState = GetPlayer()->isTaxiCheater(); - if (unit->GetEntry() == 29480) GetPlayer()->SetTaxiCheater(true); // Grimwing in Ebon Hold, special case. NOTE: Not perfect, Zul'Aman should not be included according to WoWhead, and I think taxicheat includes it. + if (unit->GetEntry() == 29480) + GetPlayer()->SetTaxiCheater(true); // Grimwing in Ebon Hold, special case. NOTE: Not perfect, Zul'Aman should not be included according to WoWhead, and I think taxicheat includes it. sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_TAXINODE_STATUS_QUERY %u ", curloc); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index a9a45a21e9d..0ceeb2db1ed 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -1011,7 +1011,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_MOVE_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_MULTIPLE_PACKETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_NEW_TAXI_PATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_NEW_TAXI_PATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_NEW_WORLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_NEW_WORLD_ABORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From c0adf370e5ac3166bb74abb6d824556fbae54f6f Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 14 Aug 2012 18:11:06 +0100 Subject: Core/Vendors: Add currencies to vendors npc_vendor table gets a new field, type (1 is item, 2 is currency) for type 1 fields still mean the same, for type 2 maxcount is buycount (without any "precision") changed structure of SMSG_UPDATE_CURRENCY(_WEEK_LIMIT) but not enabled, wrong values are being wrongly calculated --- .../world/2012_08_14_02_world_npc_vendor.sql | 6 + src/server/game/Entities/Creature/Creature.cpp | 8 +- src/server/game/Entities/Creature/Creature.h | 15 +- src/server/game/Entities/Item/ItemPrototype.h | 6 + src/server/game/Entities/Player/Player.cpp | 233 ++++++++++++++------- src/server/game/Entities/Player/Player.h | 5 +- src/server/game/Entities/Unit/Unit.cpp | 4 +- src/server/game/Entities/Unit/Unit.h | 2 +- src/server/game/Events/GameEventMgr.cpp | 14 +- src/server/game/Events/GameEventMgr.h | 1 + src/server/game/Globals/ObjectMgr.cpp | 83 ++++---- src/server/game/Globals/ObjectMgr.h | 10 +- src/server/game/Handlers/ItemHandler.cpp | 125 +++++++---- src/server/scripts/Commands/cs_npc.cpp | 10 +- .../Database/Implementation/WorldDatabase.cpp | 6 +- .../shared/Database/Implementation/WorldDatabase.h | 2 +- 16 files changed, 345 insertions(+), 185 deletions(-) create mode 100644 sql/updates/world/2012_08_14_02_world_npc_vendor.sql (limited to 'src') diff --git a/sql/updates/world/2012_08_14_02_world_npc_vendor.sql b/sql/updates/world/2012_08_14_02_world_npc_vendor.sql new file mode 100644 index 00000000000..de00be694fc --- /dev/null +++ b/sql/updates/world/2012_08_14_02_world_npc_vendor.sql @@ -0,0 +1,6 @@ +ALTER TABLE `npc_vendor` ADD `type` tinyint(3) unsigned NOT NULL DEFAULT '1'; +ALTER TABLE `game_event_npc_vendor` ADD `type` tinyint(3) unsigned NOT NULL DEFAULT '1'; +ALTER TABLE `npc_vendor` CHANGE `maxcount` `maxcount` mediumint(8) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `game_event_npc_vendor` CHANGE `maxcount` `maxcount` mediumint(8) unsigned NOT NULL DEFAULT '0'; +UPDATE `trinity_string` SET `content_default` = 'Item \'%u\' (type %u) not found in database.' WHERE `entry`=207; +UPDATE `trinity_string` SET `content_default` = 'Item \'%u\' (with extended cost %u, type %u) already in vendor list' WHERE `entry`=210; diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index de5d0a0303c..642c7e45a74 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -61,12 +61,12 @@ TrainerSpell const* TrainerSpellData::Find(uint32 spell_id) const return NULL; } -bool VendorItemData::RemoveItem(uint32 item_id) +bool VendorItemData::RemoveItem(uint32 item_id, uint8 type) { bool found = false; for (VendorItemList::iterator i = m_items.begin(); i != m_items.end();) { - if ((*i)->item == item_id) + if ((*i)->item == item_id && (*i)->Type == type) { i = m_items.erase(i++); found = true; @@ -77,10 +77,10 @@ bool VendorItemData::RemoveItem(uint32 item_id) return found; } -VendorItem const* VendorItemData::FindItemCostPair(uint32 item_id, uint32 extendedCost) const +VendorItem const* VendorItemData::FindItemCostPair(uint32 item_id, uint32 extendedCost, uint8 type) const { for (VendorItemList::const_iterator i = m_items.begin(); i != m_items.end(); ++i) - if ((*i)->item == item_id && (*i)->ExtendedCost == extendedCost) + if ((*i)->item == item_id && (*i)->ExtendedCost == extendedCost && (*i)->Type == type) return *i; return NULL; } diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index 61982026933..14a680d62d1 100755 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -317,13 +317,14 @@ enum ChatType // Vendors struct VendorItem { - VendorItem(uint32 _item, int32 _maxcount, uint32 _incrtime, uint32 _ExtendedCost) - : item(_item), maxcount(_maxcount), incrtime(_incrtime), ExtendedCost(_ExtendedCost) {} + VendorItem(uint32 _item, int32 _maxcount, uint32 _incrtime, uint32 _ExtendedCost, uint8 _Type) + : item(_item), maxcount(_maxcount), incrtime(_incrtime), ExtendedCost(_ExtendedCost), Type(_Type) {} uint32 item; - uint32 maxcount; // 0 for infinity item amount + uint32 maxcount; // 0 for infinity item amount uint32 incrtime; // time for restore items amount if maxcount != 0 uint32 ExtendedCost; + uint8 Type; //helpers bool IsGoldRequired(ItemTemplate const* pProto) const { return pProto->Flags2 & ITEM_FLAGS_EXTRA_EXT_COST_REQUIRES_GOLD || !ExtendedCost; } @@ -343,12 +344,12 @@ struct VendorItemData } bool Empty() const { return m_items.empty(); } uint8 GetItemCount() const { return m_items.size(); } - void AddItem(uint32 item, int32 maxcount, uint32 ptime, uint32 ExtendedCost) + void AddItem(uint32 item, int32 maxcount, uint32 ptime, uint32 ExtendedCost, uint8 type) { - m_items.push_back(new VendorItem(item, maxcount, ptime, ExtendedCost)); + m_items.push_back(new VendorItem(item, maxcount, ptime, ExtendedCost, type)); } - bool RemoveItem(uint32 item_id); - VendorItem const* FindItemCostPair(uint32 item_id, uint32 extendedCost) const; + bool RemoveItem(uint32 item_id, uint8 type); + VendorItem const* FindItemCostPair(uint32 item_id, uint32 extendedCost, uint8 type) const; void Clear() { for (VendorItemList::const_iterator itr = m_items.begin(); itr != m_items.end(); ++itr) diff --git a/src/server/game/Entities/Item/ItemPrototype.h b/src/server/game/Entities/Item/ItemPrototype.h index 1fd46a2d879..87647a36f70 100755 --- a/src/server/game/Entities/Item/ItemPrototype.h +++ b/src/server/game/Entities/Item/ItemPrototype.h @@ -218,6 +218,12 @@ enum CurrencyFlags // ... }; +enum ItemVendorType +{ + ITEM_VENDOR_TYPE_ITEM = 1, + ITEM_VENDOR_TYPE_CURRENCY = 2, +}; + enum BAG_FAMILY_MASK { BAG_FAMILY_MASK_NONE = 0x00000000, diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index bd835db1ca6..6f948c774fb 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -7281,96 +7281,105 @@ void Player::SendCurrencies() const uint32 Player::GetCurrency(uint32 id) const { - PlayerCurrenciesMap::const_iterator itr = m_currencies.find(id); - return itr != m_currencies.end() ? itr->second.totalCount : 0; + PlayerCurrenciesMap::const_iterator itr = m_currencies.find(id); + return itr != m_currencies.end() ? itr->second.totalCount : 0; } bool Player::HasCurrency(uint32 id, uint32 count) const { - PlayerCurrenciesMap::const_iterator itr = m_currencies.find(id); - return itr != m_currencies.end() && itr->second.totalCount >= count; + PlayerCurrenciesMap::const_iterator itr = m_currencies.find(id); + return itr != m_currencies.end() && itr->second.totalCount >= count; } -void Player::ModifyCurrency(uint32 id, int32 count) +void Player::ModifyCurrency(uint32 id, int32 count, bool printLog/* = true*/) { - if (!count) - return; + if (!count) + return; - CurrencyTypesEntry const* currency = sCurrencyTypesStore.LookupEntry(id); - ASSERT(currency); + CurrencyTypesEntry const* currency = sCurrencyTypesStore.LookupEntry(id); + ASSERT(currency); - int32 precision = currency->Flags & CURRENCY_FLAG_HIGH_PRECISION ? 100 : 1; - uint32 oldTotalCount = 0; - uint32 oldWeekCount = 0; - PlayerCurrenciesMap::iterator itr = m_currencies.find(id); - if (itr == m_currencies.end()) - { - PlayerCurrency cur; - cur.state = PLAYERCURRENCY_NEW; - cur.totalCount = 0; - cur.weekCount = 0; - m_currencies[id] = cur; - itr = m_currencies.find(id); - } - else - { - oldTotalCount = itr->second.totalCount; - oldWeekCount = itr->second.weekCount; - } + int32 precision = currency->Flags & CURRENCY_FLAG_HIGH_PRECISION ? 100 : 1; + uint32 oldTotalCount = 0; + uint32 oldWeekCount = 0; + PlayerCurrenciesMap::iterator itr = m_currencies.find(id); + if (itr == m_currencies.end()) + { + PlayerCurrency cur; + cur.state = PLAYERCURRENCY_NEW; + cur.totalCount = 0; + cur.weekCount = 0; + m_currencies[id] = cur; + itr = m_currencies.find(id); + } + else + { + oldTotalCount = itr->second.totalCount; + oldWeekCount = itr->second.weekCount; + } - int32 newTotalCount = int32(oldTotalCount) + count; - if (newTotalCount < 0) - newTotalCount = 0; + int32 newTotalCount = int32(oldTotalCount) + count; + if (newTotalCount < 0) + newTotalCount = 0; - int32 newWeekCount = int32(oldWeekCount) + (count > 0 ? count : 0); - if (newWeekCount < 0) - newWeekCount = 0; + int32 newWeekCount = int32(oldWeekCount) + (count > 0 ? count : 0); + if (newWeekCount < 0) + newWeekCount = 0; - if (currency->TotalCap && int32(currency->TotalCap) < newTotalCount) - { - int32 delta = newTotalCount - int32(currency->TotalCap); - newTotalCount = int32(currency->TotalCap); - newWeekCount -= delta; - } + if (currency->TotalCap && int32(currency->TotalCap) < newTotalCount) + { + int32 delta = newTotalCount - int32(currency->TotalCap); + newTotalCount = int32(currency->TotalCap); + newWeekCount -= delta; + } - // TODO: fix conquest points - uint32 weekCap = _GetCurrencyWeekCap(currency); - if (weekCap && int32(weekCap) < newTotalCount) - { - int32 delta = newWeekCount - int32(weekCap); - newWeekCount = int32(weekCap); - newTotalCount -= delta; - } + // TODO: fix conquest points + uint32 weekCap = _GetCurrencyWeekCap(currency); + if (weekCap && int32(weekCap) < newTotalCount) + { + int32 delta = newWeekCount - int32(weekCap); + newWeekCount = int32(weekCap); + newTotalCount -= delta; + } - // if we change total, we must change week - ASSERT(((newTotalCount-oldTotalCount) != 0) == ((newWeekCount-oldWeekCount) != 0)); + // if we change total, we must change week + ASSERT(((newTotalCount-oldTotalCount) != 0) == ((newWeekCount-oldWeekCount) != 0)); - if (newTotalCount != oldTotalCount) - { - if(itr->second.state != PLAYERCURRENCY_NEW) - itr->second.state = PLAYERCURRENCY_CHANGED; + if (newTotalCount != oldTotalCount) + { + if (itr->second.state != PLAYERCURRENCY_NEW) + itr->second.state = PLAYERCURRENCY_CHANGED; - itr->second.totalCount = newTotalCount; - itr->second.weekCount = newWeekCount; + itr->second.totalCount = newTotalCount; + itr->second.weekCount = newWeekCount; - // probably excessive checks - if (IsInWorld() && !GetSession()->PlayerLoading()) - { - if (count > 0) - UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CURRENCY, id, count); - - WorldPacket packet(SMSG_UPDATE_CURRENCY, 12); - packet << uint32(id); - packet << uint32(weekCap ? (newWeekCount / precision) : 0); - packet << uint32(newTotalCount / precision); - GetSession()->SendPacket(&packet); - } - } + // probably excessive checks + if (IsInWorld() && !GetSession()->PlayerLoading()) + { + if (count > 0) + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CURRENCY, id, count); + + WorldPacket packet(SMSG_UPDATE_CURRENCY, 12); + + packet.WriteBit(weekCap != 0); + packet.WriteBit(0); // hasSeasonCount + packet.WriteBit(printLog); // print in log + + // if hasSeasonCount packet << uint32(seasontotalearned); TODO: save this in character DB and use it + + packet << uint32(newTotalCount / precision); + packet << uint32(id); + if (weekCap) + packet << uint32(newWeekCount / precision); + + GetSession()->SendPacket(&packet); + } + } } -void Player::SetCurrency(uint32 id, uint32 count) +void Player::SetCurrency(uint32 id, uint32 count, bool printLog /*= true*/) { - ModifyCurrency(id, int32(count) - GetCurrency(id)); + ModifyCurrency(id, int32(count) - GetCurrency(id), printLog); } uint32 Player::_GetCurrencyWeekCap(const CurrencyTypesEntry* currency) const @@ -20991,6 +21000,90 @@ inline bool Player::_StoreOrEquipNewItem(uint32 vendorslot, uint32 item, uint8 c return true; } +bool Player::BuyCurrencyFromVendorSlot(uint64 vendorGuid, uint32 vendorSlot, uint32 currency, uint32 count) +{ + vendorSlot += 1; + + // cheating attempt + if (count < 1) count = 1; + + if (!isAlive()) + return false; + + CurrencyTypesEntry const* proto = sCurrencyTypesStore.LookupEntry(currency); + if (!proto) + { + SendBuyError(BUY_ERR_CANT_FIND_ITEM, NULL, currency, 0); + return false; + } + + Creature* creature = GetNPCIfCanInteractWith(vendorGuid, UNIT_NPC_FLAG_VENDOR); + if (!creature) + { + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: BuyCurrencyFromVendorSlot - Unit (GUID: %u) not found or you can't interact with him.", GUID_LOPART(vendorGuid)); + SendBuyError(BUY_ERR_DISTANCE_TOO_FAR, NULL, currency, 0); + return false; + } + + VendorItemData const* vItems = creature->GetVendorItems(); + if (!vItems || vItems->Empty()) + { + SendBuyError(BUY_ERR_CANT_FIND_ITEM, creature, currency, 0); + return false; + } + + if (vendorSlot >= vItems->GetItemCount()) + { + SendBuyError(BUY_ERR_CANT_FIND_ITEM, creature, currency, 0); + return false; + } + + VendorItem const* crItem = vItems->GetItem(vendorSlot); + // store diff item (cheating) + if (!crItem || crItem->item != currency || crItem->Type != 2) + { + SendBuyError(BUY_ERR_CANT_FIND_ITEM, creature, currency, 0); + return false; + } + + if (crItem->ExtendedCost) + { + ItemExtendedCostEntry const* iece = sItemExtendedCostStore.LookupEntry(crItem->ExtendedCost); + if (!iece) + { + sLog->outError(LOG_FILTER_PLAYER, "Currency %u have wrong ExtendedCost field value %u", currency, crItem->ExtendedCost); + return false; + } + + // item base price + for (uint8 i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i) + { + if (iece->RequiredItem[i] && !HasItemCount(iece->RequiredItem[i], (iece->RequiredItemCount[i] * count))) + { + SendEquipError(EQUIP_ERR_VENDOR_MISSING_TURNINS, NULL, NULL); + return false; + } + } + + // check for personal arena rating requirement + if (GetMaxPersonalArenaRatingRequirement(iece->RequiredArenaSlot) < iece->RequiredPersonalArenaRating) + { + // probably not the proper equip err + SendEquipError(EQUIP_ERR_CANT_EQUIP_RANK, NULL, NULL); + return false; + } + } + else // currencies have no price defined, can only be bought with ExtendedCost + { + SendBuyError(BUY_ERR_CANT_FIND_ITEM, NULL, currency, 0); + return false; + } + + ModifyCurrency(currency, crItem->maxcount); + + return true; +} + // Return true is the bought item has a max count to force refresh of window by caller bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32 item, uint8 count, uint8 bag, uint8 slot) { diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index a8e9e5ed407..933c702a5aa 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1328,8 +1328,8 @@ class Player : public Unit, public GridObject void SendCurrencies() const; uint32 GetCurrency(uint32 id) const; bool HasCurrency(uint32 id, uint32 count) const; - void SetCurrency(uint32 id, uint32 count); - void ModifyCurrency(uint32 id, int32 count); + void SetCurrency(uint32 id, uint32 count, bool printLog = true); + void ModifyCurrency(uint32 id, int32 count, bool printLog = true); void ApplyEquipCooldown(Item* pItem); void QuickEquipItem(uint16 pos, Item* pItem); @@ -1375,6 +1375,7 @@ class Player : public Unit, public GridObject } void SendNewItem(Item* item, uint32 count, bool received, bool created, bool broadcast = false); bool BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32 item, uint8 count, uint8 bag, uint8 slot); + bool BuyCurrencyFromVendorSlot(uint64 vendorGuid, uint32 vendorSlot, uint32 currency, uint32 count); bool _StoreOrEquipNewItem(uint32 vendorslot, uint32 item, uint8 count, uint8 bag, uint8 slot, int32 price, ItemTemplate const* pProto, Creature* pVendor, VendorItem const* crItem, bool bStore); float GetReputationPriceDiscount(Creature const* creature) const; diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 03de01795f7..eda39dcefd1 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -5628,7 +5628,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere AuraEffect* counter = triggeredByAura->GetBase()->GetEffect(EFFECT_1); if (!counter) return true; - + // Count spell criticals in a row in second aura if (procEx & PROC_EX_CRITICAL_HIT) { @@ -6935,7 +6935,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere // custom cooldown processing case if (GetTypeId() == TYPEID_PLAYER && ToPlayer()->HasSpellCooldown(spell)) ToPlayer()->RemoveSpellCooldown(spell); - + CastSpell(target, spell, true, castItem, triggeredByAura); return true; } diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 57b56ff6e55..addf99a03ac 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1483,7 +1483,7 @@ class Unit : public WorldObject } virtual uint32 GetBlockPercent() { return 30; } - + uint32 GetUnitMeleeSkill(Unit const* target = NULL) const { return (target ? getLevelForTarget(target) : getLevel()) * 5; } uint32 GetDefenseSkillValue(Unit const* target = NULL) const; uint32 GetWeaponSkillValue(WeaponAttackType attType, Unit const* target = NULL) const; diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp index 0936275e90c..6af90dd85eb 100755 --- a/src/server/game/Events/GameEventMgr.cpp +++ b/src/server/game/Events/GameEventMgr.cpp @@ -808,14 +808,11 @@ void GameEventMgr::LoadFromDB() { uint32 oldMSTime = getMSTime(); - // 0 1 2 3 4 5 - QueryResult result = WorldDatabase.Query("SELECT eventEntry, guid, item, maxcount, incrtime, ExtendedCost FROM game_event_npc_vendor ORDER BY guid, slot ASC"); + // 0 1 2 3 4 5 6 + QueryResult result = WorldDatabase.Query("SELECT eventEntry, guid, item, maxcount, incrtime, ExtendedCost, type FROM game_event_npc_vendor ORDER BY guid, slot ASC"); if (!result) - { sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 vendor additions in game events. DB table `game_event_npc_vendor` is empty."); - - } else { uint32 count = 0; @@ -838,6 +835,7 @@ void GameEventMgr::LoadFromDB() newEntry.maxcount = fields[3].GetUInt32(); newEntry.incrtime = fields[4].GetUInt32(); newEntry.ExtendedCost = fields[5].GetUInt32(); + newEntry.Type = fields[6].GetUInt8(); // get the event npc flag for checking if the npc will be vendor during the event or not uint32 event_npc_flag = 0; NPCFlagList& flist = mGameEventNPCFlags[event_id]; @@ -856,7 +854,7 @@ void GameEventMgr::LoadFromDB() newEntry.entry = data->id; // check validity with event's npcflag - if (!sObjectMgr->IsVendorItemValid(newEntry.entry, newEntry.item, newEntry.maxcount, newEntry.incrtime, newEntry.ExtendedCost, NULL, NULL, event_npc_flag)) + if (!sObjectMgr->IsVendorItemValid(newEntry.entry, newEntry.item, newEntry.maxcount, newEntry.incrtime, newEntry.ExtendedCost, newEntry.Type, NULL, NULL, event_npc_flag)) continue; vendors.push_back(newEntry); @@ -1199,9 +1197,9 @@ void GameEventMgr::UpdateEventNPCVendor(uint16 event_id, bool activate) for (NPCVendorList::iterator itr = mGameEventVendors[event_id].begin(); itr != mGameEventVendors[event_id].end(); ++itr) { if (activate) - sObjectMgr->AddVendorItem(itr->entry, itr->item, itr->maxcount, itr->incrtime, itr->ExtendedCost, false); + sObjectMgr->AddVendorItem(itr->entry, itr->item, itr->maxcount, itr->incrtime, itr->ExtendedCost, itr->Type, false); else - sObjectMgr->RemoveVendorItem(itr->entry, itr->item, false); + sObjectMgr->RemoveVendorItem(itr->entry, itr->item, itr->Type, false); } } diff --git a/src/server/game/Events/GameEventMgr.h b/src/server/game/Events/GameEventMgr.h index d9b5890bfe5..ce1d10e327a 100755 --- a/src/server/game/Events/GameEventMgr.h +++ b/src/server/game/Events/GameEventMgr.h @@ -85,6 +85,7 @@ struct NPCVendorEntry int32 maxcount; // 0 for infinite uint32 incrtime; // time for restore items amount if maxcount != 0 uint32 ExtendedCost; + uint8 Type; // 1 item, 2 currency }; class Player; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 6dbe7574cd2..ab78566ae0e 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -8026,11 +8026,12 @@ void ObjectMgr::LoadTrainerSpell() } -int ObjectMgr::LoadReferenceVendor(int32 vendor, int32 item, std::set *skip_vendors) +int ObjectMgr::LoadReferenceVendor(int32 vendor, int32 item, uint8 type, std::set *skip_vendors) { // find all items from the reference vendor PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_NPC_VENDOR_REF); stmt->setUInt32(0, uint32(item)); + stmt->setUInt8(1, type); PreparedQueryResult result = WorldDatabase.Query(stmt); if (!result) @@ -8045,19 +8046,20 @@ int ObjectMgr::LoadReferenceVendor(int32 vendor, int32 item, std::set *s // if item is a negative, its a reference if (item_id < 0) - count += LoadReferenceVendor(vendor, -item_id, skip_vendors); + count += LoadReferenceVendor(vendor, -item_id, type, skip_vendors); else { - int32 maxcount = fields[1].GetUInt8(); + int32 maxcount = fields[1].GetUInt32(); uint32 incrtime = fields[2].GetUInt32(); uint32 ExtendedCost = fields[3].GetUInt32(); + uint8 type = fields[4].GetUInt8(); - if (!IsVendorItemValid(vendor, item_id, maxcount, incrtime, ExtendedCost, NULL, skip_vendors)) + if (!IsVendorItemValid(vendor, item_id, maxcount, incrtime, ExtendedCost, type, NULL, skip_vendors)) continue; VendorItemData& vList = _cacheVendorItemStore[vendor]; - vList.AddItem(item_id, maxcount, incrtime, ExtendedCost); + vList.AddItem(item_id, maxcount, incrtime, ExtendedCost, type); ++count; } } while (result->NextRow()); @@ -8076,7 +8078,7 @@ void ObjectMgr::LoadVendors() std::set skip_vendors; - QueryResult result = WorldDatabase.Query("SELECT entry, item, maxcount, incrtime, ExtendedCost FROM npc_vendor ORDER BY entry, slot ASC"); + QueryResult result = WorldDatabase.Query("SELECT entry, item, maxcount, incrtime, ExtendedCost, type FROM npc_vendor ORDER BY entry, slot ASC"); if (!result) { @@ -8095,19 +8097,20 @@ void ObjectMgr::LoadVendors() // if item is a negative, its a reference if (item_id < 0) - count += LoadReferenceVendor(entry, -item_id, &skip_vendors); + count += LoadReferenceVendor(entry, -item_id, 0, &skip_vendors); else { - uint32 maxcount = fields[2].GetUInt8(); + uint32 maxcount = fields[2].GetUInt32(); uint32 incrtime = fields[3].GetUInt32(); uint32 ExtendedCost = fields[4].GetUInt32(); + uint8 type = fields[5].GetUInt8(); - if (!IsVendorItemValid(entry, item_id, maxcount, incrtime, ExtendedCost, NULL, &skip_vendors)) + if (!IsVendorItemValid(entry, item_id, maxcount, incrtime, ExtendedCost, type, NULL, &skip_vendors)) continue; VendorItemData& vList = _cacheVendorItemStore[entry]; - vList.AddItem(item_id, maxcount, incrtime, ExtendedCost); + vList.AddItem(item_id, maxcount, incrtime, ExtendedCost, type); ++count; } } @@ -8223,32 +8226,33 @@ void ObjectMgr::LoadGossipMenuItems() } -void ObjectMgr::AddVendorItem(uint32 entry, uint32 item, int32 maxcount, uint32 incrtime, uint32 extendedCost, bool persist /*= true*/) +void ObjectMgr::AddVendorItem(uint32 entry, uint32 item, int32 maxcount, uint32 incrtime, uint32 extendedCost, uint8 type, bool persist /*= true*/) { VendorItemData& vList = _cacheVendorItemStore[entry]; - vList.AddItem(item, maxcount, incrtime, extendedCost); + vList.AddItem(item, maxcount, incrtime, extendedCost, type); if (persist) { - PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_NPC_VENODR); + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_NPC_VENDOR); stmt->setUInt32(0, entry); stmt->setUInt32(1, item); stmt->setUInt8(2, maxcount); stmt->setUInt32(3, incrtime); stmt->setUInt32(4, extendedCost); + stmt->setUInt8(5, type); WorldDatabase.Execute(stmt); } } -bool ObjectMgr::RemoveVendorItem(uint32 entry, uint32 item, bool persist /*= true*/) +bool ObjectMgr::RemoveVendorItem(uint32 entry, uint32 item, uint8 type, bool persist /*= true*/) { CacheVendorItemContainer::iterator iter = _cacheVendorItemStore.find(entry); if (iter == _cacheVendorItemStore.end()) return false; - if (!iter->second.RemoveItem(item)) + if (!iter->second.RemoveItem(item, type)) return false; if (persist) @@ -8257,6 +8261,7 @@ bool ObjectMgr::RemoveVendorItem(uint32 entry, uint32 item, bool persist /*= tru stmt->setUInt32(0, entry); stmt->setUInt32(1, item); + stmt->setUInt8(2, type); WorldDatabase.Execute(stmt); } @@ -8264,7 +8269,7 @@ bool ObjectMgr::RemoveVendorItem(uint32 entry, uint32 item, bool persist /*= tru return true; } -bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 maxcount, uint32 incrtime, uint32 ExtendedCost, Player* player, std::set* skip_vendors, uint32 ORnpcflag) const +bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 id, int32 maxcount, uint32 incrtime, uint32 ExtendedCost, uint8 type, Player* player, std::set* skip_vendors, uint32 ORnpcflag) const { CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(vendor_entry); if (!cInfo) @@ -8291,12 +8296,13 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max return false; } - if (!sObjectMgr->GetItemTemplate(item_id)) + if ((type == ITEM_VENDOR_TYPE_ITEM && !sObjectMgr->GetItemTemplate(id)) || + (type == ITEM_VENDOR_TYPE_CURRENCY && !sCurrencyTypesStore.LookupEntry(id))) { if (player) - ChatHandler(player).PSendSysMessage(LANG_ITEM_NOT_FOUND, item_id); + ChatHandler(player).PSendSysMessage(LANG_ITEM_NOT_FOUND, id, type); else - sLog->outError(LOG_FILTER_SQL, "Table `(game_event_)npc_vendor` for Vendor (Entry: %u) have in item list non-existed item (%u), ignore", vendor_entry, item_id); + sLog->outError(LOG_FILTER_SQL, "Table `(game_event_)npc_vendor` for Vendor (Entry: %u) have in item list non-existed item (%u, type %u), ignore", vendor_entry, id, type); return false; } @@ -8305,37 +8311,40 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max if (player) ChatHandler(player).PSendSysMessage(LANG_EXTENDED_COST_NOT_EXIST, ExtendedCost); else - sLog->outError(LOG_FILTER_SQL, "Table `(game_event_)npc_vendor` have Item (Entry: %u) with wrong ExtendedCost (%u) for vendor (%u), ignore", item_id, ExtendedCost, vendor_entry); + sLog->outError(LOG_FILTER_SQL, "Table `(game_event_)npc_vendor` have Item (Entry: %u) with wrong ExtendedCost (%u) for vendor (%u), ignore", id, ExtendedCost, vendor_entry); return false; } - if (maxcount > 0 && incrtime == 0) + if (type == ITEM_VENDOR_TYPE_ITEM) // not applicable to currencies { - if (player) - ChatHandler(player).PSendSysMessage("MaxCount != 0 (%u) but IncrTime == 0", maxcount); - else - sLog->outError(LOG_FILTER_SQL, "Table `(game_event_)npc_vendor` has `maxcount` (%u) for item %u of vendor (Entry: %u) but `incrtime`=0, ignore", maxcount, item_id, vendor_entry); - return false; - } - else if (maxcount == 0 && incrtime > 0) - { - if (player) - ChatHandler(player).PSendSysMessage("MaxCount == 0 but IncrTime<>= 0"); - else - sLog->outError(LOG_FILTER_SQL, "Table `(game_event_)npc_vendor` has `maxcount`=0 for item %u of vendor (Entry: %u) but `incrtime`<>0, ignore", item_id, vendor_entry); - return false; + if (maxcount > 0 && incrtime == 0) + { + if (player) + ChatHandler(player).PSendSysMessage("MaxCount != 0 (%u) but IncrTime == 0", maxcount); + else + sLog->outError(LOG_FILTER_SQL, "Table `(game_event_)npc_vendor` has `maxcount` (%u) for item %u of vendor (Entry: %u) but `incrtime`=0, ignore", maxcount, id, vendor_entry); + return false; + } + else if (maxcount == 0 && incrtime > 0) + { + if (player) + ChatHandler(player).PSendSysMessage("MaxCount == 0 but IncrTime<>= 0"); + else + sLog->outError(LOG_FILTER_SQL, "Table `(game_event_)npc_vendor` has `maxcount`=0 for item %u of vendor (Entry: %u) but `incrtime`<>0, ignore", id, vendor_entry); + return false; + } } VendorItemData const* vItems = GetNpcVendorItemList(vendor_entry); if (!vItems) return true; // later checks for non-empty lists - if (vItems->FindItemCostPair(item_id, ExtendedCost)) + if (vItems->FindItemCostPair(id, ExtendedCost, type)) { if (player) - ChatHandler(player).PSendSysMessage(LANG_ITEM_ALREADY_IN_LIST, item_id, ExtendedCost); + ChatHandler(player).PSendSysMessage(LANG_ITEM_ALREADY_IN_LIST, id, ExtendedCost, type); else - sLog->outError(LOG_FILTER_SQL, "Table `npc_vendor` has duplicate items %u (with extended cost %u) for vendor (Entry: %u), ignoring", item_id, ExtendedCost, vendor_entry); + sLog->outError(LOG_FILTER_SQL, "Table `npc_vendor` has duplicate items %u (with extended cost %u, type %u) for vendor (Entry: %u), ignoring", id, ExtendedCost, type, vendor_entry); return false; } diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index 7850eda6c83..0456b800a29 100755 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -622,7 +622,7 @@ class ObjectMgr GameObjectTemplate const* GetGameObjectTemplate(uint32 entry); GameObjectTemplateContainer const* GetGameObjectTemplates() const { return &_gameObjectTemplateStore; } - int LoadReferenceVendor(int32 vendor, int32 item_id, std::set *skip_vendors); + int LoadReferenceVendor(int32 vendor, int32 item, uint8 type, std::set *skip_vendors); void LoadGameObjectTemplate(); void AddGameobjectInfo(GameObjectTemplate* goinfo); @@ -1075,15 +1075,15 @@ class ObjectMgr VendorItemData const* GetNpcVendorItemList(uint32 entry) const { - CacheVendorItemContainer::const_iterator iter = _cacheVendorItemStore.find(entry); + CacheVendorItemContainer::const_iterator iter = _cacheVendorItemStore.find(entry); if (iter == _cacheVendorItemStore.end()) return NULL; return &iter->second; } - void AddVendorItem(uint32 entry, uint32 item, int32 maxcount, uint32 incrtime, uint32 extendedCost, bool persist = true); // for event - bool RemoveVendorItem(uint32 entry, uint32 item, bool persist = true); // for event - bool IsVendorItemValid(uint32 vendor_entry, uint32 item, int32 maxcount, uint32 ptime, uint32 ExtendedCost, Player* player = NULL, std::set* skip_vendors = NULL, uint32 ORnpcflag = 0) const; + void AddVendorItem(uint32 entry, uint32 item, int32 maxcount, uint32 incrtime, uint32 extendedCost, uint8 type, bool persist = true); // for event + bool RemoveVendorItem(uint32 entry, uint32 item, uint8 type, bool persist = true); // for event + bool IsVendorItemValid(uint32 vendor_entry, uint32 id, int32 maxcount, uint32 ptime, uint32 ExtendedCost, uint8 type, Player* player = NULL, std::set* skip_vendors = NULL, uint32 ORnpcflag = 0) const; void LoadScriptNames(); ScriptNameContainer &GetScriptNames() { return _scriptNamesStore; } diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 765adbda101..640d6996bdf 100644 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -673,7 +673,7 @@ void WorldSession::HandleBuyItemOpcode(WorldPacket& recvData) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_BUY_ITEM"); uint64 vendorguid, bagGuid; uint32 item, slot, count; - uint8 itemType; // 1 = item, 2 = currency (not implemented) + uint8 itemType; // 1 = item, 2 = currency uint8 bagSlot; recvData >> vendorguid >> itemType >> item >> slot >> count >> bagGuid >> bagSlot; @@ -684,13 +684,20 @@ void WorldSession::HandleBuyItemOpcode(WorldPacket& recvData) else return; // cheating - Item* bagItem = _player->GetItemByGuid(bagGuid); + if (itemType == ITEM_VENDOR_TYPE_ITEM) + { + Item* bagItem = _player->GetItemByGuid(bagGuid); - uint8 bag = NULL_BAG; - if (bagItem && bagItem->IsBag()) - bag = bagItem->GetSlot(); + uint8 bag = NULL_BAG; + if (bagItem && bagItem->IsBag()) + bag = bagItem->GetSlot(); - GetPlayer()->BuyItemFromVendorSlot(vendorguid, slot, item, count, bag, bagSlot); + GetPlayer()->BuyItemFromVendorSlot(vendorguid, slot, item, count, bag, bagSlot); + } + else if (itemType == ITEM_VENDOR_TYPE_CURRENCY) + GetPlayer()->BuyCurrencyFromVendorSlot(vendorguid, slot, item, count); + else + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: received wrong itemType (%u) in HandleBuyItemOpcode", itemType); } void WorldSession::HandleListInventoryOpcode(WorldPacket & recvData) @@ -744,52 +751,86 @@ void WorldSession::SendListInventory(uint64 vendorGuid) VendorItem const* vendorItem = vendorItems->GetItem(slot); if (!vendorItem) continue; - ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(vendorItem->item); - if (!itemTemplate) continue; - - if (!_player->isGameMaster()) // ignore conditions if GM on + if (vendorItem->Type == ITEM_VENDOR_TYPE_ITEM) { - // Respect allowed class - if (!(itemTemplate->AllowableClass & _player->getClassMask())) - continue; + ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(vendorItem->item); + if (!itemTemplate) continue; + + if (!_player->isGameMaster()) // ignore conditions if GM on + { + // Respect allowed class + if (!(itemTemplate->AllowableClass & _player->getClassMask())) + continue; - // Do not sell BOP items - if (itemTemplate->Bonding == BIND_WHEN_PICKED_UP) - continue; + // Do not sell BOP items + if (itemTemplate->Bonding == BIND_WHEN_PICKED_UP) + continue; - // Only display items in vendor lists for the team the player is on - if ((itemTemplate->Flags2 & ITEM_FLAGS_EXTRA_HORDE_ONLY && _player->GetTeam() == ALLIANCE) || - (itemTemplate->Flags2 & ITEM_FLAGS_EXTRA_ALLIANCE_ONLY && _player->GetTeam() == HORDE)) - continue; + // Only display items in vendor lists for the team the player is on + if ((itemTemplate->Flags2 & ITEM_FLAGS_EXTRA_HORDE_ONLY && _player->GetTeam() == ALLIANCE) || + (itemTemplate->Flags2 & ITEM_FLAGS_EXTRA_ALLIANCE_ONLY && _player->GetTeam() == HORDE)) + continue; + + // Items sold out are not displayed in list + uint32 leftInStock = !vendorItem->maxcount ? 0xFFFFFFFF : vendor->GetVendorItemCurrentCount(vendorItem); + if (leftInStock == 0) + continue; + } - // Items sold out are not displayed in list + int32 price = vendorItem->IsGoldRequired(itemTemplate) ? uint32(floor(itemTemplate->BuyPrice * discountMod)) : 0; uint32 leftInStock = !vendorItem->maxcount ? 0xFFFFFFFF : vendor->GetVendorItemCurrentCount(vendorItem); - if (leftInStock == 0) - continue; + + itemsData << uint32(count++ + 1); // client expects counting to start at 1 + itemsData << uint32(itemTemplate->MaxDurability); + + if (vendorItem->ExtendedCost != 0) + { + enablers.push_back(0); + itemsData << uint32(vendorItem->ExtendedCost); + } + else + enablers.push_back(1); + enablers.push_back(1); // unk bit + + itemsData << uint32(vendorItem->item); + itemsData << uint32(vendorItem->Type); // 1 is items, 2 is currency + itemsData << uint32(price); + itemsData << uint32(itemTemplate->DisplayInfoID); + // if (!unk "enabler") data << uint32(something); + itemsData << int32(leftInStock); + itemsData << uint32(itemTemplate->BuyCount); } + else if (vendorItem->Type == ITEM_VENDOR_TYPE_CURRENCY) + { + CurrencyTypesEntry const* currencyTemplate = sCurrencyTypesStore.LookupEntry(vendorItem->item); - int32 price = vendorItem->IsGoldRequired(itemTemplate) ? uint32(floor(itemTemplate->BuyPrice * discountMod)) : 0; - uint32 leftInStock = !vendorItem->maxcount ? 0xFFFFFFFF : vendor->GetVendorItemCurrentCount(vendorItem); + if (!currencyTemplate) continue; - itemsData << uint32(count++ + 1); // client expects counting to start at 1 - itemsData << uint32(itemTemplate->MaxDurability); + if (vendorItem->ExtendedCost == 0) continue; // there's no price defined for currencies, only extendedcost is used - if (vendorItem->ExtendedCost != 0) - { - enablers.push_back(0); - itemsData << uint32(vendorItem->ExtendedCost); + uint32 precision = (currencyTemplate->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? 100 : 1; + + itemsData << uint32(count++ + 1); // client expects counting to start at 1 + itemsData << uint32(0); // max durability + + if (vendorItem->ExtendedCost != 0) + { + enablers.push_back(0); + itemsData << uint32(vendorItem->ExtendedCost); + } + else + enablers.push_back(1); + enablers.push_back(1); // unk bit + + itemsData << uint32(vendorItem->item); + itemsData << uint32(vendorItem->Type); // 1 is items, 2 is currency + itemsData << uint32(0); // price, only seen currency types that have Extended cost + itemsData << uint32(0); // displayId + // if (!unk "enabler") data << uint32(something); + itemsData << int32(-1); + itemsData << uint32(vendorItem->maxcount * precision); } - else - enablers.push_back(1); - enablers.push_back(1); // unk bit - - itemsData << uint32(vendorItem->item); - itemsData << uint32(1); // 1 is items, 2 is currency (FIXME: currency isn't implemented) - itemsData << uint32(price); - itemsData << uint32(itemTemplate->DisplayInfoID); - // if (!unk "enabler") data << uint32(something); - itemsData << int32(leftInStock); - itemsData << uint32(itemTemplate->BuyCount); + // else error } uint8* guidBytes = (uint8*)&vendorGuid; diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index 77fc2918e0b..e43760191df 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -178,6 +178,8 @@ public: if (!*args) return false; + const uint8 type = 1; // FIXME: make type (1 item, 2 currency) an argument + char* pitem = handler->extractKeyFromLink((char*)args, "Hitem"); if (!pitem) { @@ -214,13 +216,13 @@ public: uint32 vendor_entry = vendor ? vendor->GetEntry() : 0; - if (!sObjectMgr->IsVendorItemValid(vendor_entry, itemId, maxcount, incrtime, extendedcost, handler->GetSession()->GetPlayer())) + if (!sObjectMgr->IsVendorItemValid(vendor_entry, itemId, maxcount, incrtime, extendedcost, type, handler->GetSession()->GetPlayer())) { handler->SetSentErrorMessage(true); return false; } - sObjectMgr->AddVendorItem(vendor_entry, itemId, maxcount, incrtime, extendedcost); + sObjectMgr->AddVendorItem(vendor_entry, itemId, maxcount, incrtime, type, extendedcost); ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(itemId); @@ -435,7 +437,9 @@ public: } uint32 itemId = atol(pitem); - if (!sObjectMgr->RemoveVendorItem(vendor->GetEntry(), itemId)) + const uint8 type = 1; // FIXME: make type (1 item, 2 currency) an argument + + if (!sObjectMgr->RemoveVendorItem(vendor->GetEntry(), itemId, type)) { handler->PSendSysMessage(LANG_ITEM_NOT_IN_LIST, itemId); handler->SetSentErrorMessage(true); diff --git a/src/server/shared/Database/Implementation/WorldDatabase.cpp b/src/server/shared/Database/Implementation/WorldDatabase.cpp index fe2a9f7906c..74cd57f74c0 100755 --- a/src/server/shared/Database/Implementation/WorldDatabase.cpp +++ b/src/server/shared/Database/Implementation/WorldDatabase.cpp @@ -34,9 +34,9 @@ void WorldDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(WORLD_DEL_GRAVEYARD_ZONE, "DELETE FROM game_graveyard_zone WHERE id = ? AND ghost_zone = ? AND faction = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(WORLD_INS_GAME_TELE, "INSERT INTO game_tele (id, position_x, position_y, position_z, orientation, map, name) VALUES (?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); PREPARE_STATEMENT(WORLD_DEL_GAME_TELE, "DELETE FROM game_tele WHERE name = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(WORLD_INS_NPC_VENODR, "INSERT INTO npc_vendor (entry, item, maxcount, incrtime, extendedcost) VALUES(?, ?, ?, ?, ?)", CONNECTION_ASYNC); - PREPARE_STATEMENT(WORLD_DEL_NPC_VENDOR, "DELETE FROM npc_vendor WHERE entry = ? AND item = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(WORLD_SEL_NPC_VENDOR_REF, "SELECT item, maxcount, incrtime, ExtendedCost FROM npc_vendor WHERE entry = ? ORDER BY slot ASC", CONNECTION_SYNCH); + PREPARE_STATEMENT(WORLD_INS_NPC_VENDOR, "INSERT INTO npc_vendor (entry, item, maxcount, incrtime, extendedcost, type) VALUES(?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(WORLD_DEL_NPC_VENDOR, "DELETE FROM npc_vendor WHERE entry = ? AND item = ? AND type = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(WORLD_SEL_NPC_VENDOR_REF, "SELECT item, maxcount, incrtime, ExtendedCost, type FROM npc_vendor WHERE entry = ? AND type = ? ORDER BY slot ASC", CONNECTION_SYNCH); PREPARE_STATEMENT(WORLD_UPD_CREATURE_MOVEMENT_TYPE, "UPDATE creature SET MovementType = ? WHERE guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(WORLD_UPD_CREATURE_FACTION, "UPDATE creature_template SET faction_A = ?, faction_H = ? WHERE entry = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(WORLD_UPD_CREATURE_NPCFLAG, "UPDATE creature_template SET npcflag = ? WHERE entry = ?", CONNECTION_ASYNC); diff --git a/src/server/shared/Database/Implementation/WorldDatabase.h b/src/server/shared/Database/Implementation/WorldDatabase.h index 6d7df87cc80..ceaad6f68e3 100755 --- a/src/server/shared/Database/Implementation/WorldDatabase.h +++ b/src/server/shared/Database/Implementation/WorldDatabase.h @@ -54,7 +54,7 @@ enum WorldDatabaseStatements WORLD_DEL_GRAVEYARD_ZONE, WORLD_INS_GAME_TELE, WORLD_DEL_GAME_TELE, - WORLD_INS_NPC_VENODR, + WORLD_INS_NPC_VENDOR, WORLD_DEL_NPC_VENDOR, WORLD_SEL_NPC_VENDOR_REF, WORLD_UPD_CREATURE_MOVEMENT_TYPE, -- cgit v1.2.3 From b8bb828b039710bb737ef49df28aeb451cccd87a Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 14 Aug 2012 23:21:07 +0200 Subject: Core/Misc: Updated TOTAL_SPELL_TARGETS to 4.3.4 --- src/server/game/Miscellaneous/SharedDefines.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src') diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 1774facf874..be9bba3a5a1 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -1494,6 +1494,23 @@ enum Targets TARGET_UNK_DEST_AREA_UNK_107 = 107, // not enough info - only generic spells avalible TARGET_GAMEOBJECT_CONE = 108, TARGET_DEST_UNK_110 = 110, // 1 spell + TARGET_UNK_111 = 111, + TARGET_UNK_112 = 112, + TARGET_UNK_113 = 113, + TARGET_UNK_114 = 114, + TARGET_UNK_115 = 115, + TARGET_UNK_116 = 116, + TARGET_UNK_117 = 117, + TARGET_UNK_118 = 118, + TARGET_UNK_119 = 119, + TARGET_UNK_120 = 120, + TARGET_UNK_121 = 121, + TARGET_UNK_122 = 122, + TARGET_UNK_123 = 123, + TARGET_UNK_124 = 124, + TARGET_UNK_125 = 125, + TARGET_UNK_126 = 126, + TARGET_UNK_127 = 127, TOTAL_SPELL_TARGETS }; -- cgit v1.2.3 From d0923e6daeb5a0ef9b626e61be3936fb2d19c93e Mon Sep 17 00:00:00 2001 From: Tuxity Date: Wed, 15 Aug 2012 00:36:53 +0200 Subject: Core/Stats: Update AttackPower to cataclysm. --- src/server/game/Entities/Unit/StatSystem.cpp | 31 ++++++++-------------------- 1 file changed, 9 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index 18fa16488ea..5bb0c2e2701 100755 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -285,7 +285,7 @@ void Player::UpdateAttackPowerAndDamage(bool ranged) switch (getClass()) { case CLASS_HUNTER: - val2 = level * 2.0f + GetStat(STAT_AGILITY) - 10.0f; + val2 = level * 2.0f + GetStat(STAT_AGILITY) * 2.0f - 20.0f; break; case CLASS_ROGUE: val2 = level + GetStat(STAT_AGILITY) - 10.0f; @@ -293,18 +293,6 @@ void Player::UpdateAttackPowerAndDamage(bool ranged) case CLASS_WARRIOR: val2 = level + GetStat(STAT_AGILITY) - 10.0f; break; - case CLASS_DRUID: - switch (GetShapeshiftForm()) - { - case FORM_CAT: - case FORM_BEAR: - case FORM_DIREBEAR: - val2 = 0.0f; break; - default: - val2 = GetStat(STAT_AGILITY) - 10.0f; break; - } - break; - default: val2 = GetStat(STAT_AGILITY) - 10.0f; break; } } else @@ -321,40 +309,39 @@ void Player::UpdateAttackPowerAndDamage(bool ranged) val2 = level * 3.0f + GetStat(STAT_STRENGTH) * 2.0f - 20.0f; break; case CLASS_ROGUE: - val2 = level * 2.0f + GetStat(STAT_STRENGTH) + GetStat(STAT_AGILITY) - 20.0f; + val2 = level * 2.0f + GetStat(STAT_STRENGTH) + GetStat(STAT_AGILITY) * 2.0f - 30.0f; break; case CLASS_HUNTER: val2 = level * 2.0f + GetStat(STAT_STRENGTH) + GetStat(STAT_AGILITY) - 20.0f; break; case CLASS_SHAMAN: - val2 = level * 2.0f + GetStat(STAT_STRENGTH) + GetStat(STAT_AGILITY) - 20.0f; + val2 = level * 2.0f + GetStat(STAT_STRENGTH) + GetStat(STAT_AGILITY) * 2.0f - 30.0f; break; case CLASS_DRUID: { switch (GetShapeshiftForm()) { case FORM_CAT: - val2 = GetStat(STAT_STRENGTH) * 2.0f + GetStat(STAT_AGILITY) - 20.0f + m_baseFeralAP; + val2 = level * 3.0f + GetStat(STAT_STRENGTH) * 2.0f + GetStat(STAT_AGILITY) * 2.0f - 40.0f; break; case FORM_BEAR: case FORM_DIREBEAR: - case FORM_MOONKIN: - val2 = GetStat(STAT_STRENGTH) * 2.0f - 20.0f + m_baseFeralAP; + val2 = level * 3.0f + GetStat(STAT_STRENGTH) * 2.0f + GetStat(STAT_AGILITY) * 2.0f - 40.0f; break; default: - val2 = GetStat(STAT_STRENGTH) * 2.0f - 20.0f; + val2 = level * 3.0f + GetStat(STAT_STRENGTH) * 2.0f - 20.0f; break; } break; } case CLASS_MAGE: - val2 = GetStat(STAT_STRENGTH) - 10.0f; + val2 = GetStat(STAT_STRENGTH) * 2.0f - 20.0f; break; case CLASS_PRIEST: - val2 = GetStat(STAT_STRENGTH) - 10.0f; + val2 = GetStat(STAT_STRENGTH) * 2.0f - 20.0f; break; case CLASS_WARLOCK: - val2 = GetStat(STAT_STRENGTH) - 10.0f; + val2 = GetStat(STAT_STRENGTH) * 2.0f - 20.0f; break; } } -- cgit v1.2.3 From 9818406555999ffeadb42f40380fa8875dfbeb63 Mon Sep 17 00:00:00 2001 From: Tuxity Date: Wed, 15 Aug 2012 00:48:30 +0200 Subject: Core/Stats: Feral attack power doesn't exist since 4.0.1 --- src/server/game/Entities/Item/ItemPrototype.h | 13 ------------- src/server/game/Entities/Player/Player.cpp | 1 - src/server/game/Entities/Player/Player.h | 1 - 3 files changed, 15 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Item/ItemPrototype.h b/src/server/game/Entities/Item/ItemPrototype.h index 87647a36f70..793b8ecc354 100755 --- a/src/server/game/Entities/Item/ItemPrototype.h +++ b/src/server/game/Entities/Item/ItemPrototype.h @@ -717,19 +717,6 @@ struct ItemTemplate return (Stackable == 2147483647 || Stackable <= 0) ? uint32(0x7FFFFFFF-1) : uint32(Stackable); } - int32 getFeralBonus(int32 extraDPS = 0) const - { - // 0x02A5F3 - is mask for Melee weapon from ItemSubClassMask.dbc - if (Class == ITEM_CLASS_WEAPON && (1 << SubClass) & 0x02A5F3) - { - int32 bonus = int32((extraDPS + DPS) * 14.0f) - 767; - if (bonus < 0) - return 0; - return bonus; - } - return 0; - } - float GetItemLevelIncludingQuality() const { float itemLevel = (float)ItemLevel; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 6f948c774fb..a7166191c66 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -792,7 +792,6 @@ Player::Player(WorldSession* session): Unit(true), m_achievementMgr(this), m_rep m_baseRatingValue[i] = 0; m_baseSpellPower = 0; - m_baseFeralAP = 0; m_baseManaRegen = 0; m_baseHealthRegen = 0; m_spellPenetrationItemMod = 0; diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 933c702a5aa..81d3b112469 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -2769,7 +2769,6 @@ class Player : public Unit, public GridObject float m_auraBaseMod[BASEMOD_END][MOD_END]; int16 m_baseRatingValue[MAX_COMBAT_RATING]; uint32 m_baseSpellPower; - uint32 m_baseFeralAP; uint32 m_baseManaRegen; uint32 m_baseHealthRegen; int32 m_spellPenetrationItemMod; -- cgit v1.2.3 From 40f6e1dd1e96081c8f81234ea9a576bc40c3e372 Mon Sep 17 00:00:00 2001 From: Tuxity Date: Wed, 15 Aug 2012 00:58:31 +0200 Subject: Core/Stats: Update formula of min/max weapon damages in feral form. --- src/server/game/Entities/Unit/StatSystem.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index 5bb0c2e2701..a8813a02078 100755 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -426,12 +426,16 @@ void Player::CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bo if (IsInFeralForm()) //check if player is druid and in cat or bear forms { - uint8 lvl = getLevel(); - if (lvl > 60) - lvl = 60; - - weapon_mindamage = lvl*0.85f*att_speed; - weapon_maxdamage = lvl*1.25f*att_speed; + if (GetShapeshiftForm() == FORM_CAT) + { + weapon_mindamage = weapon_mindamage / att_speed; + weapon_maxdamage = weapon_maxdamage / att_speed; + } + else if (GetShapeshiftForm() == FORM_BEAR) + { + weapon_mindamage = weapon_mindamage / att_speed * 2.5f; + weapon_maxdamage = weapon_maxdamage / att_speed * 2.5f; + } } else if (!CanUseAttackType(attType)) //check if player not in form but still can't use (disarm case) { -- cgit v1.2.3 From 9fc75cffc9ebc8084ba7ffd49132fbbb70818f6a Mon Sep 17 00:00:00 2001 From: Tuxity Date: Wed, 15 Aug 2012 01:19:48 +0200 Subject: Core/Stats: - Update dodge base, parry cap and dodge cap values to cataclysm. - Remove useless function since defense skill was remove in 4.0.1 --- src/server/game/Entities/Player/Player.cpp | 18 ++++++------- src/server/game/Entities/Player/Player.h | 1 - src/server/game/Entities/Unit/StatSystem.cpp | 39 +++++----------------------- src/server/game/Entities/Unit/Unit.cpp | 3 --- 4 files changed, 15 insertions(+), 46 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index a7166191c66..880d75494b5 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -5728,17 +5728,17 @@ void Player::GetDodgeFromAgility(float &diminishing, float &nondiminishing) // Table for base dodge values const float dodge_base[MAX_CLASSES] = { - 0.036640f, // Warrior - 0.034943f, // Paladi - -0.040873f, // Hunter - 0.020957f, // Rogue - 0.034178f, // Priest + 0.037580f, // Warrior + 0.036520f, // Paladin + -0.054500f, // Hunter + -0.005900f, // Rogue + 0.031830f, // Priest 0.036640f, // DK - 0.021080f, // Shaman - 0.036587f, // Mage - 0.024211f, // Warlock + 0.016750f, // Shaman + 0.034575f, // Mage + 0.020350f, // Warlock 0.0f, // ?? - 0.056097f // Druid + 0.049510f // Druid }; // Crit/agility to dodge/agility coefficient multipliers; 3.2.0 increased required agility by 15% const float crit_to_dodge[MAX_CLASSES] = diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 81d3b112469..98f107fa541 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1954,7 +1954,6 @@ class Player : public Unit, public GridObject inline void RecalculateRating(CombatRating cr) { ApplyRatingMod(cr, 0, true);} float GetMeleeCritFromAgility(); void GetDodgeFromAgility(float &diminishing, float &nondiminishing); - float GetMissPercentageFromDefence() const; float GetSpellCritFromIntellect(); float OCTRegenHPPerSpirit(); float OCTRegenMPPerSpirit(); diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index a8813a02078..33e78851c71 100755 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -571,43 +571,16 @@ const float m_diminishing_k[MAX_CLASSES] = 0.9720f // Druid }; -float Player::GetMissPercentageFromDefence() const -{ - float const miss_cap[MAX_CLASSES] = - { - 16.00f, // Warrior //correct - 16.00f, // Paladin //correct - 16.00f, // Hunter //? - 16.00f, // Rogue //? - 16.00f, // Priest //? - 16.00f, // DK //correct - 16.00f, // Shaman //? - 16.00f, // Mage //? - 16.00f, // Warlock //? - 0.0f, // ?? - 16.00f // Druid //? - }; - - float diminishing = 0.0f, nondiminishing = 0.0f; - // Modify value from defense skill (only bonus from defense rating diminishes) - nondiminishing += (GetSkillValue(SKILL_DEFENSE) - GetMaxSkillValueForLevel()) * 0.04f; - diminishing += (int32(GetRatingBonusValue(CR_DEFENSE_SKILL))) * 0.04f; - - // apply diminishing formula to diminishing miss chance - uint32 pclass = getClass()-1; - return nondiminishing + (diminishing * miss_cap[pclass] / (diminishing + miss_cap[pclass] * m_diminishing_k[pclass])); -} - void Player::UpdateParryPercentage() { const float parry_cap[MAX_CLASSES] = { - 47.003525f, // Warrior - 47.003525f, // Paladin + 65.631440f, // Warrior + 65.631440f, // Paladin 145.560408f, // Hunter 145.560408f, // Rogue 0.0f, // Priest - 47.003525f, // DK + 65.631440f, // DK 145.560408f, // Shaman 0.0f, // Mage 0.0f, // Warlock @@ -639,12 +612,12 @@ void Player::UpdateDodgePercentage() { const float dodge_cap[MAX_CLASSES] = { - 88.129021f, // Warrior - 88.129021f, // Paladin + 65.631440f, // Warrior + 65.631440f, // Paladin 145.560408f, // Hunter 145.560408f, // Rogue 150.375940f, // Priest - 88.129021f, // DK + 65.631440f, // DK 145.560408f, // Shaman 150.375940f, // Mage 150.375940f, // Warlock diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index eda39dcefd1..7b2f3a49e18 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -2585,9 +2585,6 @@ float Unit::GetUnitMissChance(WeaponAttackType attType) const { float miss_chance = 5.00f; - if (Player const* player = ToPlayer()) - miss_chance += player->GetMissPercentageFromDefence(); - if (attType == RANGED_ATTACK) miss_chance -= GetTotalAuraModifier(SPELL_AURA_MOD_ATTACKER_RANGED_HIT_CHANCE); else -- cgit v1.2.3 From fcdadcd455708b48bbae17243ce5751592350ed1 Mon Sep 17 00:00:00 2001 From: Nay Date: Wed, 15 Aug 2012 00:48:37 +0100 Subject: Core/Opcodes: Fix compiler error in GCC Thanks Nevan Closes #7404 --- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 0ceeb2db1ed..bf5d7f21898 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -37,7 +37,7 @@ void InitOpcodes() sLog->outError(LOG_FILTER_NETWORKIO, "Tried to override handler of %s with %s (opcode %u)", \ opcodeTable[opcode]->name, #opcode, opcode); \ } \ - else opcodeTable[opcode] = new OpcodeHandler(#opcode, #opcode##"_COMPRESSED", status, processing, handler); \ + else opcodeTable[opcode] = new OpcodeHandler(#opcode, #opcode "_COMPRESSED", status, processing, handler); \ } memset(opcodeTable, 0, sizeof(opcodeTable)); -- cgit v1.2.3 From efdaf2a3004d7af9bf8308144b0c4a7bd3254a40 Mon Sep 17 00:00:00 2001 From: Nay Date: Wed, 15 Aug 2012 16:30:49 +0100 Subject: Core/Items: - Update some ItemPrototype enums - Merge armor and weapon vellum into a single subclass - Fix tackler bags --- src/server/game/Entities/Item/Item.cpp | 8 +++++-- src/server/game/Entities/Item/Item.h | 3 +-- src/server/game/Entities/Item/ItemPrototype.h | 31 +++++++++++++++------------ src/server/game/Server/Protocol/Opcodes.cpp | 6 +++--- src/server/game/Spells/Spell.cpp | 2 +- src/server/game/Spells/SpellEffects.cpp | 2 +- 6 files changed, 29 insertions(+), 23 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index 2b5cb1e359a..12c6861bb47 100755 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -211,6 +211,10 @@ bool ItemCanGoIntoBag(ItemTemplate const* pProto, ItemTemplate const* pBagProto) if (!(pProto->BagFamily & BAG_FAMILY_MASK_INSCRIPTION_SUPP)) return false; return true; + case ITEM_SUBCLASS_TACKLE_CONTAINER: + if (!(pProto->BagFamily & BAG_FAMILY_MASK_FISHING_SUPP)) + return false; + return true; default: return false; } @@ -854,8 +858,8 @@ bool Item::IsFitToSpellRequirements(SpellInfo const* spellInfo) const if (spellInfo->EquippedItemClass != -1) // -1 == any item class { // Special case - accept vellum for armor/weapon requirements - if ((spellInfo->EquippedItemClass == ITEM_CLASS_ARMOR && proto->IsArmorVellum()) - ||(spellInfo->EquippedItemClass == ITEM_CLASS_WEAPON && proto->IsWeaponVellum())) + if ((spellInfo->EquippedItemClass == ITEM_CLASS_ARMOR || + spellInfo->EquippedItemClass == ITEM_CLASS_WEAPON) && proto->IsVellum()) if (spellInfo->IsAbilityOfSkillType(SKILL_ENCHANTING)) // only for enchanting spells return true; diff --git a/src/server/game/Entities/Item/Item.h b/src/server/game/Entities/Item/Item.h index 5b86d55f170..0ae4ddac31e 100755 --- a/src/server/game/Entities/Item/Item.h +++ b/src/server/game/Entities/Item/Item.h @@ -320,8 +320,7 @@ class Item : public Object bool hasInvolvedQuest(uint32 /*quest_id*/) const { return false; } bool HasStats() const; bool IsPotion() const { return GetTemplate()->IsPotion(); } - bool IsWeaponVellum() const { return GetTemplate()->IsWeaponVellum(); } - bool IsArmorVellum() const { return GetTemplate()->IsArmorVellum(); } + bool IsVellum() const { return GetTemplate()->IsVellum(); } bool IsConjuredConsumable() const { return GetTemplate()->IsConjuredConsumable(); } bool IsRangedWeapon() const { return GetTemplate()->IsRangedWeapon(); } diff --git a/src/server/game/Entities/Item/ItemPrototype.h b/src/server/game/Entities/Item/ItemPrototype.h index 793b8ecc354..317e30b88f6 100755 --- a/src/server/game/Entities/Item/ItemPrototype.h +++ b/src/server/game/Entities/Item/ItemPrototype.h @@ -241,7 +241,8 @@ enum BAG_FAMILY_MASK BAG_FAMILY_MASK_SOULBOUND_EQUIPMENT = 0x00000800, BAG_FAMILY_MASK_VANITY_PETS = 0x00001000, BAG_FAMILY_MASK_CURRENCY_TOKENS = 0x00002000, - BAG_FAMILY_MASK_QUEST_ITEMS = 0x00004000 + BAG_FAMILY_MASK_QUEST_ITEMS = 0x00004000, + BAG_FAMILY_MASK_FISHING_SUPP = 0x00008000, }; enum SocketColor @@ -250,8 +251,8 @@ enum SocketColor SOCKET_COLOR_RED = 2, SOCKET_COLOR_YELLOW = 4, SOCKET_COLOR_BLUE = 8, - // 16, Hydraulic, not used - SOCKET_COLOR_COGWHEEL = 32 + SOCKET_COLOR_HYDRAULIC = 16, // not used + SOCKET_COLOR_COGWHEEL = 32, }; #define SOCKET_COLOR_ALL (SOCKET_COLOR_META | SOCKET_COLOR_RED | SOCKET_COLOR_YELLOW | SOCKET_COLOR_BLUE | SOCKET_COLOR_COGWHEEL) @@ -445,11 +446,10 @@ enum ItemSubclassTradeGoods ITEM_SUBCLASS_TRADE_GOODS_OTHER = 11, ITEM_SUBCLASS_ENCHANTING = 12, ITEM_SUBCLASS_MATERIAL = 13, - ITEM_SUBCLASS_ITEM_ENCHANTMENT = 14, - ITEM_SUBCLASS_WEAPON_ENCHANTMENT = 15 // OBSOLETE + ITEM_SUBCLASS_ENCHANTMENT = 14, }; -#define MAX_ITEM_SUBCLASS_TRADE_GOODS 16 +#define MAX_ITEM_SUBCLASS_TRADE_GOODS 15 enum ItemSubclassGeneric { @@ -478,10 +478,11 @@ enum ItemSubclassRecipe enum ItemSubclassMoney { - ITEM_SUBCLASS_MONEY = 0 // OBSOLETE + ITEM_SUBCLASS_MONEY = 0, // OBSOLETE + ITEM_SUBCLASS_MONEY_UNK_7 = 7, // OBSOLETE, 1 item (41749) }; -#define MAX_ITEM_SUBCLASS_MONEY 1 +#define MAX_ITEM_SUBCLASS_MONEY 8 enum ItemSubclassQuiver { @@ -495,10 +496,12 @@ enum ItemSubclassQuiver enum ItemSubclassQuest { - ITEM_SUBCLASS_QUEST = 0 + ITEM_SUBCLASS_QUEST = 0, + ITEM_SUBCLASS_QUEST_UNK3 = 3, // 1 item (33604) + ITEM_SUBCLASS_QUEST_UNK8 = 8, // 2 items (37445, 49700) }; -#define MAX_ITEM_SUBCLASS_QUEST 1 +#define MAX_ITEM_SUBCLASS_QUEST 9 enum ItemSubclassKey { @@ -522,10 +525,11 @@ enum ItemSubclassJunk ITEM_SUBCLASS_JUNK_PET = 2, ITEM_SUBCLASS_JUNK_HOLIDAY = 3, ITEM_SUBCLASS_JUNK_OTHER = 4, - ITEM_SUBCLASS_JUNK_MOUNT = 5 + ITEM_SUBCLASS_JUNK_MOUNT = 5, + ITEM_SUBCLASS_JUNK_UNK12 = 12, // 1 item (37677) }; -#define MAX_ITEM_SUBCLASS_JUNK 6 +#define MAX_ITEM_SUBCLASS_JUNK 13 enum ItemSubclassGlyph { @@ -741,8 +745,7 @@ struct ItemTemplate } bool IsPotion() const { return Class == ITEM_CLASS_CONSUMABLE && SubClass == ITEM_SUBCLASS_POTION; } - bool IsWeaponVellum() const { return Class == ITEM_CLASS_TRADE_GOODS && SubClass == ITEM_SUBCLASS_WEAPON_ENCHANTMENT; } - bool IsArmorVellum() const { return Class == ITEM_CLASS_TRADE_GOODS && SubClass == ITEM_SUBCLASS_ITEM_ENCHANTMENT; } + bool IsVellum() const { return Class == ITEM_CLASS_TRADE_GOODS && SubClass == ITEM_SUBCLASS_ENCHANTMENT; } bool IsConjuredConsumable() const { return Class == ITEM_CLASS_CONSUMABLE && (Flags & ITEM_PROTO_FLAG_CONJURED); } bool IsRangedWeapon() const diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index bf5d7f21898..dc3e1b88f39 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -37,7 +37,7 @@ void InitOpcodes() sLog->outError(LOG_FILTER_NETWORKIO, "Tried to override handler of %s with %s (opcode %u)", \ opcodeTable[opcode]->name, #opcode, opcode); \ } \ - else opcodeTable[opcode] = new OpcodeHandler(#opcode, #opcode "_COMPRESSED", status, processing, handler); \ + else opcodeTable[opcode] = new OpcodeHandler(#opcode, #opcode "_COMPRESSED", status, processing, handler); \ } memset(opcodeTable, 0, sizeof(opcodeTable)); @@ -1242,8 +1242,8 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ACCOUNT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ACCOUNT_DATA_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_COMBO_POINTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_CURRENCY_WEEK_LIMIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_UPDATE_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_UPDATE_CURRENCY_WEEK_LIMIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_DUNGEON_ENCOUNTER_FOR_LOOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_INSTANCE_ENCOUNTER_UNIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_INSTANCE_OWNERSHIP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 54d9387d0c1..ed06902178d 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -6031,7 +6031,7 @@ SpellCastResult Spell::CheckItems() } case SPELL_EFFECT_ENCHANT_ITEM: if (m_spellInfo->Effects[i].ItemType && m_targets.GetItemTarget() - && (m_targets.GetItemTarget()->IsWeaponVellum() || m_targets.GetItemTarget()->IsArmorVellum())) + && (m_targets.GetItemTarget()->IsVellum())) { // cannot enchant vellum for other player if (m_targets.GetItemTarget()->GetOwner() != m_caster) diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 058a7b5564c..4751584b650 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -2756,7 +2756,7 @@ void Spell::EffectEnchantItemPerm(SpellEffIndex effIndex) Player* p_caster = (Player*)m_caster; // Handle vellums - if (itemTarget->IsWeaponVellum() || itemTarget->IsArmorVellum()) + if (itemTarget->IsVellum()) { // destroy one vellum from stack uint32 count = 1; -- cgit v1.2.3 From 0e304fa98c8d3a9724ed7d908da2ba2bbeef5958 Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 15 Aug 2012 18:27:50 +0200 Subject: Core/Spells: Updated mount cast check --- src/server/game/Spells/SpellInfo.cpp | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index b2543432ded..16409b94ffe 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -363,7 +363,7 @@ bool SpellEffectInfo::IsAura() const bool SpellEffectInfo::IsAura(AuraType aura) const { - return IsAura() && ApplyAuraName == aura; + return IsAura() && AuraType(ApplyAuraName) == aura; } bool SpellEffectInfo::IsTargetingArea() const @@ -1486,17 +1486,27 @@ SpellCastResult SpellInfo::CheckLocation(uint32 map_id, uint32 zone_id, uint32 a } // aura limitations - for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) + if (player) { - if (!Effects[i].IsAura()) - continue; - switch (Effects[i].ApplyAuraName) + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { - case SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED: - case SPELL_AURA_FLY: + if (!Effects[i].IsAura()) + continue; + + switch (Effects[i].ApplyAuraName) { - if (player && !player->IsKnowHowFlyIn(map_id, zone_id)) - return SPELL_FAILED_INCORRECT_AREA; + case SPELL_AURA_FLY: + { + if (!player->IsKnowHowFlyIn(map_id, zone_id)) + return SPELL_FAILED_INCORRECT_AREA; + break; + } + case SPELL_AURA_MOUNTED: + { + if (Effects[i].MiscValueB && !player->GetMountCapability(Effects[i].MiscValueB)) + return SPELL_FAILED_NOT_HERE; + break; + } } } } -- cgit v1.2.3 From 53a2b8622812f365ca7d31fdbf75fe9a1707ac75 Mon Sep 17 00:00:00 2001 From: Nay Date: Wed, 15 Aug 2012 18:00:11 +0100 Subject: Core&DB: Increase the size of MinLevel and MaxLevel to int16 --- sql/updates/world/2012_08_13_00_world_quest_template.sql | 1 - .../world/2012_08_13_00_world_quest_template_434.sql | 1 + .../world/2012_08_14_00_reputation_spillover_template.sql | 13 ------------- .../2012_08_14_00_reputation_spillover_template_434.sql | 13 +++++++++++++ sql/updates/world/2012_08_14_00_world_event_ai.sql | 3 --- sql/updates/world/2012_08_14_00_world_event_ai_434.sql | 3 +++ sql/updates/world/2012_08_14_01_world_commands.sql | 1 - sql/updates/world/2012_08_14_01_world_commands_434.sql | 1 + sql/updates/world/2012_08_14_02_world_npc_vendor.sql | 6 ------ sql/updates/world/2012_08_14_02_world_npc_vendor_434.sql | 6 ++++++ .../world/2012_08_15_00_world_quest_template_434.sql | 2 ++ src/server/game/Globals/ObjectMgr.cpp | 4 ++-- src/server/game/Quests/QuestDef.cpp | 4 ++-- 13 files changed, 30 insertions(+), 28 deletions(-) delete mode 100644 sql/updates/world/2012_08_13_00_world_quest_template.sql create mode 100644 sql/updates/world/2012_08_13_00_world_quest_template_434.sql delete mode 100644 sql/updates/world/2012_08_14_00_reputation_spillover_template.sql create mode 100644 sql/updates/world/2012_08_14_00_reputation_spillover_template_434.sql delete mode 100644 sql/updates/world/2012_08_14_00_world_event_ai.sql create mode 100644 sql/updates/world/2012_08_14_00_world_event_ai_434.sql delete mode 100644 sql/updates/world/2012_08_14_01_world_commands.sql create mode 100644 sql/updates/world/2012_08_14_01_world_commands_434.sql delete mode 100644 sql/updates/world/2012_08_14_02_world_npc_vendor.sql create mode 100644 sql/updates/world/2012_08_14_02_world_npc_vendor_434.sql create mode 100644 sql/updates/world/2012_08_15_00_world_quest_template_434.sql (limited to 'src') diff --git a/sql/updates/world/2012_08_13_00_world_quest_template.sql b/sql/updates/world/2012_08_13_00_world_quest_template.sql deleted file mode 100644 index b3c5a45a668..00000000000 --- a/sql/updates/world/2012_08_13_00_world_quest_template.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE `quest_template` CHANGE `MinLevel` `MinLevel` tinyint(4) NOT NULL DEFAULT '0'; diff --git a/sql/updates/world/2012_08_13_00_world_quest_template_434.sql b/sql/updates/world/2012_08_13_00_world_quest_template_434.sql new file mode 100644 index 00000000000..b3c5a45a668 --- /dev/null +++ b/sql/updates/world/2012_08_13_00_world_quest_template_434.sql @@ -0,0 +1 @@ +ALTER TABLE `quest_template` CHANGE `MinLevel` `MinLevel` tinyint(4) NOT NULL DEFAULT '0'; diff --git a/sql/updates/world/2012_08_14_00_reputation_spillover_template.sql b/sql/updates/world/2012_08_14_00_reputation_spillover_template.sql deleted file mode 100644 index afce8209afa..00000000000 --- a/sql/updates/world/2012_08_14_00_reputation_spillover_template.sql +++ /dev/null @@ -1,13 +0,0 @@ -ALTER TABLE `reputation_spillover_template` -ADD COLUMN `faction5` SMALLINT(6) UNSIGNED DEFAULT '0' NOT NULL AFTER `rank_4`, -ADD COLUMN `rate_5` FLOAT DEFAULT '0' NOT NULL AFTER `faction5`, -ADD COLUMN `rank_5` TINYINT(3) UNSIGNED DEFAULT '0' NOT NULL AFTER `rate_5`; - -UPDATE `reputation_spillover_template` SET `faction5`=1134,`rate_5`=0.25,`rank_5`=7 WHERE `faction` IN (72,47,54,930,69); -UPDATE `reputation_spillover_template` SET `faction5`=1133,`rate_5`=0.25,`rank_5`=7 WHERE `faction` IN (76,530,911,81,68); - -DELETE FROM `reputation_spillover_template` WHERE `faction` IN (1134,1133); -INSERT INTO `reputation_spillover_template`(`faction`,`faction1`,`rate_1`,`rank_1`,`faction2`,`rate_2`,`rank_2`,`faction3`,`rate_3`,`rank_3`,`faction4`,`rate_4`,`rank_4`,`faction5`,`rate_5`,`rank_5`) VALUES -(1134,72,0.25,7,47,0.27,7,54,0.25,7,930,0.25,7,69,0.25,7), -(1133,76,0.25,7,530,0.27,7,911,0.25,7,81,0.25,7,68,0.25,7); - diff --git a/sql/updates/world/2012_08_14_00_reputation_spillover_template_434.sql b/sql/updates/world/2012_08_14_00_reputation_spillover_template_434.sql new file mode 100644 index 00000000000..afce8209afa --- /dev/null +++ b/sql/updates/world/2012_08_14_00_reputation_spillover_template_434.sql @@ -0,0 +1,13 @@ +ALTER TABLE `reputation_spillover_template` +ADD COLUMN `faction5` SMALLINT(6) UNSIGNED DEFAULT '0' NOT NULL AFTER `rank_4`, +ADD COLUMN `rate_5` FLOAT DEFAULT '0' NOT NULL AFTER `faction5`, +ADD COLUMN `rank_5` TINYINT(3) UNSIGNED DEFAULT '0' NOT NULL AFTER `rate_5`; + +UPDATE `reputation_spillover_template` SET `faction5`=1134,`rate_5`=0.25,`rank_5`=7 WHERE `faction` IN (72,47,54,930,69); +UPDATE `reputation_spillover_template` SET `faction5`=1133,`rate_5`=0.25,`rank_5`=7 WHERE `faction` IN (76,530,911,81,68); + +DELETE FROM `reputation_spillover_template` WHERE `faction` IN (1134,1133); +INSERT INTO `reputation_spillover_template`(`faction`,`faction1`,`rate_1`,`rank_1`,`faction2`,`rate_2`,`rank_2`,`faction3`,`rate_3`,`rank_3`,`faction4`,`rate_4`,`rank_4`,`faction5`,`rate_5`,`rank_5`) VALUES +(1134,72,0.25,7,47,0.27,7,54,0.25,7,930,0.25,7,69,0.25,7), +(1133,76,0.25,7,530,0.27,7,911,0.25,7,81,0.25,7,68,0.25,7); + diff --git a/sql/updates/world/2012_08_14_00_world_event_ai.sql b/sql/updates/world/2012_08_14_00_world_event_ai.sql deleted file mode 100644 index 3fe49aa4059..00000000000 --- a/sql/updates/world/2012_08_14_00_world_event_ai.sql +++ /dev/null @@ -1,3 +0,0 @@ -DROP TABLE `creature_ai_scripts`; -DROP TABLE `creature_ai_summons`; -DROP TABLE `creature_ai_texts`; diff --git a/sql/updates/world/2012_08_14_00_world_event_ai_434.sql b/sql/updates/world/2012_08_14_00_world_event_ai_434.sql new file mode 100644 index 00000000000..3fe49aa4059 --- /dev/null +++ b/sql/updates/world/2012_08_14_00_world_event_ai_434.sql @@ -0,0 +1,3 @@ +DROP TABLE `creature_ai_scripts`; +DROP TABLE `creature_ai_summons`; +DROP TABLE `creature_ai_texts`; diff --git a/sql/updates/world/2012_08_14_01_world_commands.sql b/sql/updates/world/2012_08_14_01_world_commands.sql deleted file mode 100644 index aa030e01adb..00000000000 --- a/sql/updates/world/2012_08_14_01_world_commands.sql +++ /dev/null @@ -1 +0,0 @@ -DELETE FROM `command` WHERE `name`='reload all eventai'; diff --git a/sql/updates/world/2012_08_14_01_world_commands_434.sql b/sql/updates/world/2012_08_14_01_world_commands_434.sql new file mode 100644 index 00000000000..aa030e01adb --- /dev/null +++ b/sql/updates/world/2012_08_14_01_world_commands_434.sql @@ -0,0 +1 @@ +DELETE FROM `command` WHERE `name`='reload all eventai'; diff --git a/sql/updates/world/2012_08_14_02_world_npc_vendor.sql b/sql/updates/world/2012_08_14_02_world_npc_vendor.sql deleted file mode 100644 index de00be694fc..00000000000 --- a/sql/updates/world/2012_08_14_02_world_npc_vendor.sql +++ /dev/null @@ -1,6 +0,0 @@ -ALTER TABLE `npc_vendor` ADD `type` tinyint(3) unsigned NOT NULL DEFAULT '1'; -ALTER TABLE `game_event_npc_vendor` ADD `type` tinyint(3) unsigned NOT NULL DEFAULT '1'; -ALTER TABLE `npc_vendor` CHANGE `maxcount` `maxcount` mediumint(8) unsigned NOT NULL DEFAULT '0'; -ALTER TABLE `game_event_npc_vendor` CHANGE `maxcount` `maxcount` mediumint(8) unsigned NOT NULL DEFAULT '0'; -UPDATE `trinity_string` SET `content_default` = 'Item \'%u\' (type %u) not found in database.' WHERE `entry`=207; -UPDATE `trinity_string` SET `content_default` = 'Item \'%u\' (with extended cost %u, type %u) already in vendor list' WHERE `entry`=210; diff --git a/sql/updates/world/2012_08_14_02_world_npc_vendor_434.sql b/sql/updates/world/2012_08_14_02_world_npc_vendor_434.sql new file mode 100644 index 00000000000..de00be694fc --- /dev/null +++ b/sql/updates/world/2012_08_14_02_world_npc_vendor_434.sql @@ -0,0 +1,6 @@ +ALTER TABLE `npc_vendor` ADD `type` tinyint(3) unsigned NOT NULL DEFAULT '1'; +ALTER TABLE `game_event_npc_vendor` ADD `type` tinyint(3) unsigned NOT NULL DEFAULT '1'; +ALTER TABLE `npc_vendor` CHANGE `maxcount` `maxcount` mediumint(8) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `game_event_npc_vendor` CHANGE `maxcount` `maxcount` mediumint(8) unsigned NOT NULL DEFAULT '0'; +UPDATE `trinity_string` SET `content_default` = 'Item \'%u\' (type %u) not found in database.' WHERE `entry`=207; +UPDATE `trinity_string` SET `content_default` = 'Item \'%u\' (with extended cost %u, type %u) already in vendor list' WHERE `entry`=210; diff --git a/sql/updates/world/2012_08_15_00_world_quest_template_434.sql b/sql/updates/world/2012_08_15_00_world_quest_template_434.sql new file mode 100644 index 00000000000..423edb1c77b --- /dev/null +++ b/sql/updates/world/2012_08_15_00_world_quest_template_434.sql @@ -0,0 +1,2 @@ +ALTER TABLE `quest_template` CHANGE `MinLevel` `MinLevel` smallint(6) NOT NULL DEFAULT '0'; +ALTER TABLE `quest_template` CHANGE `MaxLevel` `MaxLevel` smallint(6) NOT NULL DEFAULT '0'; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index ab78566ae0e..cf5de46a418 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -3550,9 +3550,9 @@ void ObjectMgr::LoadQuests() } } - if (qinfo->MinLevel == uint32(-1)) + if (qinfo->MinLevel == uint32(-1) || qinfo->MinLevel > DEFAULT_MAX_LEVEL) { - sLog->outError(LOG_FILTER_SQL, "Quest %u should be disabled because `MinLevel` = -1", qinfo->GetQuestId()); + sLog->outError(LOG_FILTER_SQL, "Quest %u should be disabled because `MinLevel` = %i", qinfo->GetQuestId(), int32(qinfo->MinLevel)); // no changes needed, sending -1 in SMSG_QUEST_QUERY_RESPONSE is valid } diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index 2240fa471a0..f259d57d839 100755 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -26,8 +26,8 @@ Quest::Quest(Field* questRecord) Id = questRecord[0].GetUInt32(); Method = questRecord[1].GetUInt8(); Level = questRecord[2].GetInt16(); - MinLevel = uint32(questRecord[3].GetInt8()); - MaxLevel = questRecord[4].GetUInt8(); + MinLevel = uint32(questRecord[3].GetInt16()); + MaxLevel = uint32(questRecord[4].GetInt16()); ZoneOrSort = questRecord[5].GetInt16(); Type = questRecord[6].GetUInt16(); SuggestedPlayers = questRecord[7].GetUInt8(); -- cgit v1.2.3 From ca879e96b08347076f539f74d0725f13322b5606 Mon Sep 17 00:00:00 2001 From: Nay Date: Wed, 15 Aug 2012 21:22:29 +0100 Subject: Core/Loading: Fix a field type when loading reputation_spillover_template Also whitespace cleanup --- .../2012_08_15_03_world_rep_spillover_template.sql | 1 + src/server/game/Globals/ObjectMgr.cpp | 2 +- src/server/scripts/Commands/cs_misc.cpp | 5758 ++++++++++---------- .../scripts/EasternKingdoms/arathi_highlands.cpp | 8 +- .../scripts/EasternKingdoms/burning_steppes.cpp | 4 +- src/server/scripts/EasternKingdoms/ghostlands.cpp | 2 +- src/server/scripts/EasternKingdoms/ironforge.cpp | 2 +- src/server/scripts/EasternKingdoms/loch_modan.cpp | 2 +- .../scripts/EasternKingdoms/redridge_mountains.cpp | 2 +- .../scripts/EasternKingdoms/stormwind_city.cpp | 2 +- src/server/scripts/Kalimdor/azshara.cpp | 2 +- src/server/worldserver/worldserver.conf.dist | 1 - 12 files changed, 2893 insertions(+), 2893 deletions(-) create mode 100644 sql/updates/world/2012_08_15_03_world_rep_spillover_template.sql (limited to 'src') diff --git a/sql/updates/world/2012_08_15_03_world_rep_spillover_template.sql b/sql/updates/world/2012_08_15_03_world_rep_spillover_template.sql new file mode 100644 index 00000000000..08469f1b59e --- /dev/null +++ b/sql/updates/world/2012_08_15_03_world_rep_spillover_template.sql @@ -0,0 +1 @@ +ALTER TABLE `reputation_spillover_template` CHANGE `faction5` `faction5` smallint(5) unsigned NOT NULL DEFAULT '0'; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index cf5de46a418..1ab4fb907c3 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -6836,7 +6836,7 @@ void ObjectMgr::LoadReputationSpilloverTemplate() repTemplate.faction_rank[3] = fields[12].GetUInt8(); repTemplate.faction[4] = fields[13].GetUInt16(); repTemplate.faction_rate[4] = fields[14].GetFloat(); - repTemplate.faction_rank[4] = fields[15].GetUInt16(); + repTemplate.faction_rank[4] = fields[15].GetUInt8(); FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionId); diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index d8026ccd10a..ba0dc5667db 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -1,2879 +1,2879 @@ -/* - * Copyright (C) 2008-2012 TrinityCore - * - * 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; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; 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, see . - */ - -#include "Chat.h" -#include "ScriptMgr.h" -#include "AccountMgr.h" -#include "ArenaTeamMgr.h" -#include "CellImpl.h" -#include "GridNotifiers.h" -#include "Group.h" -#include "InstanceSaveMgr.h" -#include "MovementGenerator.h" -#include "ObjectAccessor.h" -#include "SpellAuras.h" -#include "TargetedMovementGenerator.h" -#include "WeatherMgr.h" -#include "ace/INET_Addr.h" - -class misc_commandscript : public CommandScript -{ -public: - misc_commandscript() : CommandScript("misc_commandscript") { } - - ChatCommand* GetCommands() const - { - static ChatCommand groupCommandTable[] = - { - { "leader", SEC_ADMINISTRATOR, false, &HandleGroupLeaderCommand, "", NULL }, - { "disband", SEC_ADMINISTRATOR, false, &HandleGroupDisbandCommand, "", NULL }, - { "remove", SEC_ADMINISTRATOR, false, &HandleGroupRemoveCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } - }; - static ChatCommand petCommandTable[] = - { - { "create", SEC_GAMEMASTER, false, &HandleCreatePetCommand, "", NULL }, - { "learn", SEC_GAMEMASTER, false, &HandlePetLearnCommand, "", NULL }, - { "unlearn", SEC_GAMEMASTER, false, &HandlePetUnlearnCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } - }; - static ChatCommand sendCommandTable[] = - { - { "items", SEC_ADMINISTRATOR, true, &HandleSendItemsCommand, "", NULL }, - { "mail", SEC_MODERATOR, true, &HandleSendMailCommand, "", NULL }, - { "message", SEC_ADMINISTRATOR, true, &HandleSendMessageCommand, "", NULL }, - { "money", SEC_ADMINISTRATOR, true, &HandleSendMoneyCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } - }; - static ChatCommand commandTable[] = - { - { "dev", SEC_ADMINISTRATOR, false, &HandleDevCommand, "", NULL }, - { "gps", SEC_ADMINISTRATOR, false, &HandleGPSCommand, "", NULL }, - { "aura", SEC_ADMINISTRATOR, false, &HandleAuraCommand, "", NULL }, - { "unaura", SEC_ADMINISTRATOR, false, &HandleUnAuraCommand, "", NULL }, - { "appear", SEC_MODERATOR, false, &HandleAppearCommand, "", NULL }, - { "summon", SEC_MODERATOR, false, &HandleSummonCommand, "", NULL }, - { "groupsummon", SEC_MODERATOR, false, &HandleGroupSummonCommand, "", NULL }, - { "commands", SEC_PLAYER, true, &HandleCommandsCommand, "", NULL }, - { "die", SEC_ADMINISTRATOR, false, &HandleDieCommand, "", NULL }, - { "revive", SEC_ADMINISTRATOR, true, &HandleReviveCommand, "", NULL }, - { "dismount", SEC_PLAYER, false, &HandleDismountCommand, "", NULL }, - { "guid", SEC_GAMEMASTER, false, &HandleGUIDCommand, "", NULL }, - { "help", SEC_PLAYER, true, &HandleHelpCommand, "", NULL }, - { "itemmove", SEC_GAMEMASTER, false, &HandleItemMoveCommand, "", NULL }, - { "cooldown", SEC_ADMINISTRATOR, false, &HandleCooldownCommand, "", NULL }, - { "distance", SEC_ADMINISTRATOR, false, &HandleGetDistanceCommand, "", NULL }, - { "recall", SEC_MODERATOR, false, &HandleRecallCommand, "", NULL }, - { "save", SEC_PLAYER, false, &HandleSaveCommand, "", NULL }, - { "saveall", SEC_MODERATOR, true, &HandleSaveAllCommand, "", NULL }, - { "kick", SEC_GAMEMASTER, true, &HandleKickPlayerCommand, "", NULL }, - { "start", SEC_PLAYER, false, &HandleStartCommand, "", NULL }, - { "taxicheat", SEC_MODERATOR, false, &HandleTaxiCheatCommand, "", NULL }, - { "linkgrave", SEC_ADMINISTRATOR, false, &HandleLinkGraveCommand, "", NULL }, - { "neargrave", SEC_ADMINISTRATOR, false, &HandleNearGraveCommand, "", NULL }, - { "explorecheat", SEC_ADMINISTRATOR, false, &HandleExploreCheatCommand, "", NULL }, - { "showarea", SEC_ADMINISTRATOR, false, &HandleShowAreaCommand, "", NULL }, - { "hidearea", SEC_ADMINISTRATOR, false, &HandleHideAreaCommand, "", NULL }, - { "additem", SEC_ADMINISTRATOR, false, &HandleAddItemCommand, "", NULL }, - { "additemset", SEC_ADMINISTRATOR, false, &HandleAddItemSetCommand, "", NULL }, - { "bank", SEC_ADMINISTRATOR, false, &HandleBankCommand, "", NULL }, - { "wchange", SEC_ADMINISTRATOR, false, &HandleChangeWeather, "", NULL }, - { "maxskill", SEC_ADMINISTRATOR, false, &HandleMaxSkillCommand, "", NULL }, - { "setskill", SEC_ADMINISTRATOR, false, &HandleSetSkillCommand, "", NULL }, - { "pinfo", SEC_GAMEMASTER, true, &HandlePInfoCommand, "", NULL }, - { "respawn", SEC_ADMINISTRATOR, false, &HandleRespawnCommand, "", NULL }, - { "send", SEC_MODERATOR, true, NULL, "", sendCommandTable }, - { "pet", SEC_GAMEMASTER, false, NULL, "", petCommandTable }, - { "mute", SEC_MODERATOR, true, &HandleMuteCommand, "", NULL }, - { "unmute", SEC_MODERATOR, true, &HandleUnmuteCommand, "", NULL }, - { "movegens", SEC_ADMINISTRATOR, false, &HandleMovegensCommand, "", NULL }, - { "cometome", SEC_ADMINISTRATOR, false, &HandleComeToMeCommand, "", NULL }, - { "damage", SEC_ADMINISTRATOR, false, &HandleDamageCommand, "", NULL }, - { "combatstop", SEC_GAMEMASTER, true, &HandleCombatStopCommand, "", NULL }, - { "flusharenapoints", SEC_ADMINISTRATOR, false, &HandleFlushArenaPointsCommand, "", NULL }, - { "repairitems", SEC_GAMEMASTER, true, &HandleRepairitemsCommand, "", NULL }, - { "waterwalk", SEC_GAMEMASTER, false, &HandleWaterwalkCommand, "", NULL }, - { "freeze", SEC_MODERATOR, false, &HandleFreezeCommand, "", NULL }, - { "unfreeze", SEC_MODERATOR, false, &HandleUnFreezeCommand, "", NULL }, - { "listfreeze", SEC_MODERATOR, false, &HandleListFreezeCommand, "", NULL }, - { "group", SEC_ADMINISTRATOR, false, NULL, "", groupCommandTable }, - { "possess", SEC_ADMINISTRATOR, false, HandlePossessCommand, "", NULL }, - { "unpossess", SEC_ADMINISTRATOR, false, HandleUnPossessCommand, "", NULL }, - { "bindsight", SEC_ADMINISTRATOR, false, HandleBindSightCommand, "", NULL }, - { "unbindsight", SEC_ADMINISTRATOR, false, HandleUnbindSightCommand, "", NULL }, - { "playall", SEC_GAMEMASTER, false, HandlePlayAllCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } - }; - return commandTable; - } - - static bool HandleDevCommand(ChatHandler* handler, char const* args) - { - if (!*args) - { - if (handler->GetSession()->GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_DEVELOPER)) - handler->GetSession()->SendNotification(LANG_DEV_ON); - else - handler->GetSession()->SendNotification(LANG_DEV_OFF); - return true; - } - - std::string argstr = (char*)args; - - if (argstr == "on") - { - handler->GetSession()->GetPlayer()->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_DEVELOPER); - handler->GetSession()->SendNotification(LANG_DEV_ON); - return true; - } - - if (argstr == "off") - { - handler->GetSession()->GetPlayer()->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_DEVELOPER); - handler->GetSession()->SendNotification(LANG_DEV_OFF); - return true; - } - - handler->SendSysMessage(LANG_USE_BOL); - handler->SetSentErrorMessage(true); - return false; - } - - static bool HandleGPSCommand(ChatHandler* handler, char const* args) - { - WorldObject* object = NULL; - if (*args) - { - uint64 guid = handler->extractGuidFromLink((char*)args); - if (guid) - object = (WorldObject*)ObjectAccessor::GetObjectByTypeMask(*handler->GetSession()->GetPlayer(), guid, TYPEMASK_UNIT | TYPEMASK_GAMEOBJECT); - - if (!object) - { - handler->SendSysMessage(LANG_PLAYER_NOT_FOUND); - handler->SetSentErrorMessage(true); - return false; - } - } - else - { - object = handler->getSelectedUnit(); - - if (!object) - { - handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE); - handler->SetSentErrorMessage(true); - return false; - } - } - - CellCoord cellCoord = Trinity::ComputeCellCoord(object->GetPositionX(), object->GetPositionY()); - Cell cell(cellCoord); - - uint32 zoneId, areaId; - object->GetZoneAndAreaId(zoneId, areaId); - - MapEntry const* mapEntry = sMapStore.LookupEntry(object->GetMapId()); - AreaTableEntry const* zoneEntry = GetAreaEntryByAreaID(zoneId); - AreaTableEntry const* areaEntry = GetAreaEntryByAreaID(areaId); - - float zoneX = object->GetPositionX(); - float zoneY = object->GetPositionY(); - - Map2ZoneCoordinates(zoneX, zoneY, zoneId); - - Map const* map = object->GetMap(); - float groundZ = map->GetHeight(object->GetPhaseMask(), object->GetPositionX(), object->GetPositionY(), MAX_HEIGHT); - float floorZ = map->GetHeight(object->GetPhaseMask(), object->GetPositionX(), object->GetPositionY(), object->GetPositionZ()); - - GridCoord gridCoord = Trinity::ComputeGridCoord(object->GetPositionX(), object->GetPositionY()); - - // 63? WHY? - int gridX = 63 - gridCoord.x_coord; - int gridY = 63 - gridCoord.y_coord; - - uint32 haveMap = Map::ExistMap(object->GetMapId(), gridX, gridY) ? 1 : 0; - uint32 haveVMap = Map::ExistVMap(object->GetMapId(), gridX, gridY) ? 1 : 0; - - if (haveVMap) - { - if (map->IsOutdoors(object->GetPositionX(), object->GetPositionY(), object->GetPositionZ())) - handler->PSendSysMessage("You are outdoors"); - else - handler->PSendSysMessage("You are indoors"); - } - else - handler->PSendSysMessage("no VMAP available for area info"); - - handler->PSendSysMessage(LANG_MAP_POSITION, - object->GetMapId(), (mapEntry ? mapEntry->name : ""), - zoneId, (zoneEntry ? zoneEntry->area_name : ""), - areaId, (areaEntry ? areaEntry->area_name : ""), - object->GetPhaseMask(), - object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), object->GetOrientation(), - cell.GridX(), cell.GridY(), cell.CellX(), cell.CellY(), object->GetInstanceId(), - zoneX, zoneY, groundZ, floorZ, haveMap, haveVMap); - - LiquidData liquidStatus; - ZLiquidStatus status = map->getLiquidStatus(object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), MAP_ALL_LIQUIDS, &liquidStatus); - - if (status) - handler->PSendSysMessage(LANG_LIQUID_STATUS, liquidStatus.level, liquidStatus.depth_level, liquidStatus.entry, liquidStatus.type_flags, status); - - return true; - } - - static bool HandleAuraCommand(ChatHandler* handler, char const* args) - { - Unit* target = handler->getSelectedUnit(); - if (!target) - { - handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE); - handler->SetSentErrorMessage(true); - return false; - } - - // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form - uint32 spellId = handler->extractSpellIdFromLink((char*)args); - - if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId)) - Aura::TryRefreshStackOrCreate(spellInfo, MAX_EFFECT_MASK, target, target); - - return true; - } - - static bool HandleUnAuraCommand(ChatHandler* handler, char const* args) - { - Unit* target = handler->getSelectedUnit(); - if (!target) - { - handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE); - handler->SetSentErrorMessage(true); - return false; - } - - std::string argstr = args; - if (argstr == "all") - { - target->RemoveAllAuras(); - return true; - } - - // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form - uint32 spellId = handler->extractSpellIdFromLink((char*)args); - if (!spellId) - return false; - - target->RemoveAurasDueToSpell(spellId); - - return true; - } - // Teleport to Player - static bool HandleAppearCommand(ChatHandler* handler, char const* args) - { - Player* target; - uint64 targetGuid; - std::string targetName; - if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName)) - return false; - - Player* _player = handler->GetSession()->GetPlayer(); - if (target == _player || targetGuid == _player->GetGUID()) - { - handler->SendSysMessage(LANG_CANT_TELEPORT_SELF); - handler->SetSentErrorMessage(true); - return false; - } - - if (target) - { - // check online security - if (handler->HasLowerSecurity(target, 0)) - return false; - - std::string chrNameLink = handler->playerLink(targetName); - - Map* map = target->GetMap(); - if (map->IsBattlegroundOrArena()) - { - // only allow if gm mode is on - if (!_player->isGameMaster()) - { - handler->PSendSysMessage(LANG_CANNOT_GO_TO_BG_GM, chrNameLink.c_str()); - handler->SetSentErrorMessage(true); - return false; - } - // if both players are in different bgs - else if (_player->GetBattlegroundId() && _player->GetBattlegroundId() != target->GetBattlegroundId()) - _player->LeaveBattleground(false); // Note: should be changed so _player gets no Deserter debuff - - // all's well, set bg id - // when porting out from the bg, it will be reset to 0 - _player->SetBattlegroundId(target->GetBattlegroundId(), target->GetBattlegroundTypeId()); - // remember current position as entry point for return at bg end teleportation - if (!_player->GetMap()->IsBattlegroundOrArena()) - _player->SetBattlegroundEntryPoint(); - } - else if (map->IsDungeon()) - { - // we have to go to instance, and can go to player only if: - // 1) we are in his group (either as leader or as member) - // 2) we are not bound to any group and have GM mode on - if (_player->GetGroup()) - { - // we are in group, we can go only if we are in the player group - if (_player->GetGroup() != target->GetGroup()) - { - handler->PSendSysMessage(LANG_CANNOT_GO_TO_INST_PARTY, chrNameLink.c_str()); - handler->SetSentErrorMessage(true); - return false; - } - } - else - { - // we are not in group, let's verify our GM mode - if (!_player->isGameMaster()) - { - handler->PSendSysMessage(LANG_CANNOT_GO_TO_INST_GM, chrNameLink.c_str()); - handler->SetSentErrorMessage(true); - return false; - } - } - - // if the player or the player's group is bound to another instance - // the player will not be bound to another one - InstancePlayerBind* bind = _player->GetBoundInstance(target->GetMapId(), target->GetDifficulty(map->IsRaid())); - if (!bind) - { - Group* group = _player->GetGroup(); - // if no bind exists, create a solo bind - InstanceGroupBind* gBind = group ? group->GetBoundInstance(target) : NULL; // if no bind exists, create a solo bind - if (!gBind) - if (InstanceSave* save = sInstanceSaveMgr->GetInstanceSave(target->GetInstanceId())) - _player->BindToInstance(save, !save->CanReset()); - } - - if (map->IsRaid()) - _player->SetRaidDifficulty(target->GetRaidDifficulty()); - else - _player->SetDungeonDifficulty(target->GetDungeonDifficulty()); - } - - handler->PSendSysMessage(LANG_APPEARING_AT, chrNameLink.c_str()); - - // stop flight if need - if (_player->isInFlight()) - { - _player->GetMotionMaster()->MovementExpired(); - _player->CleanupAfterTaxiFlight(); - } - // save only in non-flight case - else - _player->SaveRecallPosition(); - - // to point to see at target with same orientation - float x, y, z; - target->GetContactPoint(_player, x, y, z); - - _player->TeleportTo(target->GetMapId(), x, y, z, _player->GetAngle(target), TELE_TO_GM_MODE); - _player->SetPhaseMask(target->GetPhaseMask(), true); - } - else - { - // check offline security - if (handler->HasLowerSecurity(NULL, targetGuid)) - return false; - - std::string nameLink = handler->playerLink(targetName); - - handler->PSendSysMessage(LANG_APPEARING_AT, nameLink.c_str()); - - // to point where player stay (if loaded) - float x, y, z, o; - uint32 map; - bool in_flight; - if (!Player::LoadPositionFromDB(map, x, y, z, o, in_flight, targetGuid)) - return false; - - // stop flight if need - if (_player->isInFlight()) - { - _player->GetMotionMaster()->MovementExpired(); - _player->CleanupAfterTaxiFlight(); - } - // save only in non-flight case - else - _player->SaveRecallPosition(); - - _player->TeleportTo(map, x, y, z, _player->GetOrientation()); - } - - return true; - } - // Summon Player - static bool HandleSummonCommand(ChatHandler* handler, char const* args) - { - Player* target; - uint64 targetGuid; - std::string targetName; - if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName)) - return false; - - Player* _player = handler->GetSession()->GetPlayer(); - if (target == _player || targetGuid == _player->GetGUID()) - { - handler->PSendSysMessage(LANG_CANT_TELEPORT_SELF); - handler->SetSentErrorMessage(true); - return false; - } - - if (target) - { - std::string nameLink = handler->playerLink(targetName); - // check online security - if (handler->HasLowerSecurity(target, 0)) - return false; - - if (target->IsBeingTeleported()) - { - handler->PSendSysMessage(LANG_IS_TELEPORTED, nameLink.c_str()); - handler->SetSentErrorMessage(true); - return false; - } - - Map* map = handler->GetSession()->GetPlayer()->GetMap(); - - if (map->IsBattlegroundOrArena()) - { - // only allow if gm mode is on - if (!_player->isGameMaster()) - { - handler->PSendSysMessage(LANG_CANNOT_GO_TO_BG_GM, nameLink.c_str()); - handler->SetSentErrorMessage(true); - return false; - } - // if both players are in different bgs - else if (target->GetBattlegroundId() && handler->GetSession()->GetPlayer()->GetBattlegroundId() != target->GetBattlegroundId()) - target->LeaveBattleground(false); // Note: should be changed so target gets no Deserter debuff - - // all's well, set bg id - // when porting out from the bg, it will be reset to 0 - target->SetBattlegroundId(handler->GetSession()->GetPlayer()->GetBattlegroundId(), handler->GetSession()->GetPlayer()->GetBattlegroundTypeId()); - // remember current position as entry point for return at bg end teleportation - if (!target->GetMap()->IsBattlegroundOrArena()) - target->SetBattlegroundEntryPoint(); - } - else if (map->IsDungeon()) - { - Map* map = target->GetMap(); - - if (map->Instanceable() && map->GetInstanceId() != map->GetInstanceId()) - target->UnbindInstance(map->GetInstanceId(), target->GetDungeonDifficulty(), true); - - // we are in instance, and can summon only player in our group with us as lead - if (!handler->GetSession()->GetPlayer()->GetGroup() || !target->GetGroup() || - (target->GetGroup()->GetLeaderGUID() != handler->GetSession()->GetPlayer()->GetGUID()) || - (handler->GetSession()->GetPlayer()->GetGroup()->GetLeaderGUID() != handler->GetSession()->GetPlayer()->GetGUID())) - // the last check is a bit excessive, but let it be, just in case - { - handler->PSendSysMessage(LANG_CANNOT_SUMMON_TO_INST, nameLink.c_str()); - handler->SetSentErrorMessage(true); - return false; - } - } - - handler->PSendSysMessage(LANG_SUMMONING, nameLink.c_str(), ""); - if (handler->needReportToTarget(target)) - ChatHandler(target).PSendSysMessage(LANG_SUMMONED_BY, handler->playerLink(_player->GetName()).c_str()); - - // stop flight if need - if (target->isInFlight()) - { - target->GetMotionMaster()->MovementExpired(); - target->CleanupAfterTaxiFlight(); - } - // save only in non-flight case - else - target->SaveRecallPosition(); - - // before GM - float x, y, z; - handler->GetSession()->GetPlayer()->GetClosePoint(x, y, z, target->GetObjectSize()); - target->TeleportTo(handler->GetSession()->GetPlayer()->GetMapId(), x, y, z, target->GetOrientation()); - target->SetPhaseMask(handler->GetSession()->GetPlayer()->GetPhaseMask(), true); - } - else - { - // check offline security - if (handler->HasLowerSecurity(NULL, targetGuid)) - return false; - - std::string nameLink = handler->playerLink(targetName); - - handler->PSendSysMessage(LANG_SUMMONING, nameLink.c_str(), handler->GetTrinityString(LANG_OFFLINE)); - - // in point where GM stay - Player::SavePositionInDB(handler->GetSession()->GetPlayer()->GetMapId(), - handler->GetSession()->GetPlayer()->GetPositionX(), - handler->GetSession()->GetPlayer()->GetPositionY(), - handler->GetSession()->GetPlayer()->GetPositionZ(), - handler->GetSession()->GetPlayer()->GetOrientation(), - handler->GetSession()->GetPlayer()->GetZoneId(), - targetGuid); - } - - return true; - } - // Summon group of player - static bool HandleGroupSummonCommand(ChatHandler* handler, char const* args) - { - Player* target; - if (!handler->extractPlayerTarget((char*)args, &target)) - return false; - - // check online security - if (handler->HasLowerSecurity(target, 0)) - return false; - - Group* group = target->GetGroup(); - - std::string nameLink = handler->GetNameLink(target); - - if (!group) - { - handler->PSendSysMessage(LANG_NOT_IN_GROUP, nameLink.c_str()); - handler->SetSentErrorMessage(true); - return false; - } - - Map* gmMap = handler->GetSession()->GetPlayer()->GetMap(); - bool toInstance = gmMap->Instanceable(); - - // we are in instance, and can summon only player in our group with us as lead - if (toInstance && ( - !handler->GetSession()->GetPlayer()->GetGroup() || (group->GetLeaderGUID() != handler->GetSession()->GetPlayer()->GetGUID()) || - (handler->GetSession()->GetPlayer()->GetGroup()->GetLeaderGUID() != handler->GetSession()->GetPlayer()->GetGUID()))) - // the last check is a bit excessive, but let it be, just in case - { - handler->SendSysMessage(LANG_CANNOT_SUMMON_TO_INST); - handler->SetSentErrorMessage(true); - return false; - } - - for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) - { - Player* player = itr->getSource(); - - if (!player || player == handler->GetSession()->GetPlayer() || !player->GetSession()) - continue; - - // check online security - if (handler->HasLowerSecurity(player, 0)) - return false; - - std::string plNameLink = handler->GetNameLink(player); - - if (player->IsBeingTeleported() == true) - { - handler->PSendSysMessage(LANG_IS_TELEPORTED, plNameLink.c_str()); - handler->SetSentErrorMessage(true); - return false; - } - - if (toInstance) - { - Map* playerMap = player->GetMap(); - - if (playerMap->Instanceable() && playerMap->GetInstanceId() != gmMap->GetInstanceId()) - { - // cannot summon from instance to instance - handler->PSendSysMessage(LANG_CANNOT_SUMMON_TO_INST, plNameLink.c_str()); - handler->SetSentErrorMessage(true); - return false; - } - } - - handler->PSendSysMessage(LANG_SUMMONING, plNameLink.c_str(), ""); - if (handler->needReportToTarget(player)) - ChatHandler(player).PSendSysMessage(LANG_SUMMONED_BY, handler->GetNameLink().c_str()); - - // stop flight if need - if (player->isInFlight()) - { - player->GetMotionMaster()->MovementExpired(); - player->CleanupAfterTaxiFlight(); - } - // save only in non-flight case - else - player->SaveRecallPosition(); - - // before GM - float x, y, z; - handler->GetSession()->GetPlayer()->GetClosePoint(x, y, z, player->GetObjectSize()); - player->TeleportTo(handler->GetSession()->GetPlayer()->GetMapId(), x, y, z, player->GetOrientation()); - } - - return true; - } - - static bool HandleCommandsCommand(ChatHandler* handler, char const* /*args*/) - { - handler->ShowHelpForCommand(handler->getCommandTable(), ""); - return true; - } - - static bool HandleDieCommand(ChatHandler* handler, char const* /*args*/) - { - Unit* target = handler->getSelectedUnit(); - - if (!target || !handler->GetSession()->GetPlayer()->GetSelection()) - { - handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE); - handler->SetSentErrorMessage(true); - return false; - } - - if (target->GetTypeId() == TYPEID_PLAYER) - { - if (handler->HasLowerSecurity((Player*)target, 0, false)) - return false; - } - - if (target->isAlive()) - { - if (sWorld->getBoolConfig(CONFIG_DIE_COMMAND_MODE)) - handler->GetSession()->GetPlayer()->Kill(target); - else - handler->GetSession()->GetPlayer()->DealDamage(target, target->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } - - return true; - } - - static bool HandleReviveCommand(ChatHandler* handler, char const* args) - { - Player* target; - uint64 targetGuid; - if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid)) - return false; - - if (target) - { - target->ResurrectPlayer(!AccountMgr::IsPlayerAccount(target->GetSession()->GetSecurity()) ? 1.0f : 0.5f); - target->SpawnCorpseBones(); - target->SaveToDB(); - } - else - // will resurrected at login without corpse - sObjectAccessor->ConvertCorpseForPlayer(targetGuid); - - return true; - } - - static bool HandleDismountCommand(ChatHandler* handler, char const* /*args*/) - { - Player* player = handler->GetSession()->GetPlayer(); - - // If player is not mounted, so go out :) - if (!player->IsMounted()) - { - handler->SendSysMessage(LANG_CHAR_NON_MOUNTED); - handler->SetSentErrorMessage(true); - return false; - } - - if (player->isInFlight()) - { - handler->SendSysMessage(LANG_YOU_IN_FLIGHT); - handler->SetSentErrorMessage(true); - return false; - } - - player->Dismount(); - player->RemoveAurasByType(SPELL_AURA_MOUNTED); - return true; - } - - static bool HandleGUIDCommand(ChatHandler* handler, char const* /*args*/) - { - uint64 guid = handler->GetSession()->GetPlayer()->GetSelection(); - - if (guid == 0) - { - handler->SendSysMessage(LANG_NO_SELECTION); - handler->SetSentErrorMessage(true); - return false; - } - - handler->PSendSysMessage(LANG_OBJECT_GUID, GUID_LOPART(guid), GUID_HIPART(guid)); - return true; - } - - static bool HandleHelpCommand(ChatHandler* handler, char const* args) - { - char const* cmd = strtok((char*)args, " "); - if (!cmd) - { - handler->ShowHelpForCommand(handler->getCommandTable(), "help"); - handler->ShowHelpForCommand(handler->getCommandTable(), ""); - } - else - { - if (!handler->ShowHelpForCommand(handler->getCommandTable(), cmd)) - handler->SendSysMessage(LANG_NO_HELP_CMD); - } - - return true; - } - // move item to other slot - static bool HandleItemMoveCommand(ChatHandler* handler, char const* args) - { - if (!*args) - return false; - - char const* param1 = strtok((char*)args, " "); - if (!param1) - return false; - - char const* param2 = strtok(NULL, " "); - if (!param2) - return false; - - uint8 srcSlot = uint8(atoi(param1)); - uint8 dstSlot = uint8(atoi(param2)); - - if (srcSlot == dstSlot) - return true; - - if (!handler->GetSession()->GetPlayer()->IsValidPos(INVENTORY_SLOT_BAG_0, srcSlot, true)) - return false; - - if (!handler->GetSession()->GetPlayer()->IsValidPos(INVENTORY_SLOT_BAG_0, dstSlot, false)) - return false; - - uint16 src = ((INVENTORY_SLOT_BAG_0 << 8) | srcSlot); - uint16 dst = ((INVENTORY_SLOT_BAG_0 << 8) | dstSlot); - - handler->GetSession()->GetPlayer()->SwapItem(src, dst); - - return true; - } - - static bool HandleCooldownCommand(ChatHandler* handler, char const* args) - { - Player* target = handler->getSelectedPlayer(); - if (!target) - { - handler->SendSysMessage(LANG_PLAYER_NOT_FOUND); - handler->SetSentErrorMessage(true); - return false; - } - - std::string nameLink = handler->GetNameLink(target); - - if (!*args) - { - target->RemoveAllSpellCooldown(); - handler->PSendSysMessage(LANG_REMOVEALL_COOLDOWN, nameLink.c_str()); - } - else - { - // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form - uint32 spellIid = handler->extractSpellIdFromLink((char*)args); - if (!spellIid) - return false; - - if (!sSpellMgr->GetSpellInfo(spellIid)) - { - handler->PSendSysMessage(LANG_UNKNOWN_SPELL, target == handler->GetSession()->GetPlayer() ? handler->GetTrinityString(LANG_YOU) : nameLink.c_str()); - handler->SetSentErrorMessage(true); - return false; - } - - target->RemoveSpellCooldown(spellIid, true); - handler->PSendSysMessage(LANG_REMOVE_COOLDOWN, spellIid, target == handler->GetSession()->GetPlayer() ? handler->GetTrinityString(LANG_YOU) : nameLink.c_str()); - } - return true; - } - - static bool HandleGetDistanceCommand(ChatHandler* handler, char const* args) - { - WorldObject* obj = NULL; - - if (*args) - { - uint64 guid = handler->extractGuidFromLink((char*)args); - if (guid) - obj = (WorldObject*)ObjectAccessor::GetObjectByTypeMask(*handler->GetSession()->GetPlayer(), guid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT); - - if (!obj) - { - handler->SendSysMessage(LANG_PLAYER_NOT_FOUND); - handler->SetSentErrorMessage(true); - return false; - } - } - else - { - obj = handler->getSelectedUnit(); - - if (!obj) - { - handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE); - handler->SetSentErrorMessage(true); - return false; - } - } - - handler->PSendSysMessage(LANG_DISTANCE, handler->GetSession()->GetPlayer()->GetDistance(obj), handler->GetSession()->GetPlayer()->GetDistance2d(obj), handler->GetSession()->GetPlayer()->GetExactDist(obj), handler->GetSession()->GetPlayer()->GetExactDist2d(obj)); - return true; - } - // Teleport player to last position - static bool HandleRecallCommand(ChatHandler* handler, char const* args) - { - Player* target; - if (!handler->extractPlayerTarget((char*)args, &target)) - return false; - - // check online security - if (handler->HasLowerSecurity(target, 0)) - return false; - - if (target->IsBeingTeleported()) - { - handler->PSendSysMessage(LANG_IS_TELEPORTED, handler->GetNameLink(target).c_str()); - handler->SetSentErrorMessage(true); - return false; - } - - // stop flight if need - if (target->isInFlight()) - { - target->GetMotionMaster()->MovementExpired(); - target->CleanupAfterTaxiFlight(); - } - - target->TeleportTo(target->m_recallMap, target->m_recallX, target->m_recallY, target->m_recallZ, target->m_recallO); - return true; - } - - static bool HandleSaveCommand(ChatHandler* handler, char const* /*args*/) - { - Player* player = handler->GetSession()->GetPlayer(); - - // save GM account without delay and output message - if (!AccountMgr::IsPlayerAccount(handler->GetSession()->GetSecurity())) - { - if (Player* target = handler->getSelectedPlayer()) - target->SaveToDB(); - else - player->SaveToDB(); - handler->SendSysMessage(LANG_PLAYER_SAVED); - return true; - } - - // save if the player has last been saved over 20 seconds ago - uint32 saveInterval = sWorld->getIntConfig(CONFIG_INTERVAL_SAVE); - if (saveInterval == 0 || (saveInterval > 20 * IN_MILLISECONDS && player->GetSaveTimer() <= saveInterval - 20 * IN_MILLISECONDS)) - player->SaveToDB(); - - return true; - } - - // Save all players in the world - static bool HandleSaveAllCommand(ChatHandler* handler, char const* /*args*/) - { - sObjectAccessor->SaveAllPlayers(); - handler->SendSysMessage(LANG_PLAYERS_SAVED); - return true; - } - - // kick player - static bool HandleKickPlayerCommand(ChatHandler* handler, char const* args) - { - Player* target = NULL; - std::string playerName; - if (!handler->extractPlayerTarget((char*)args, &target, NULL, &playerName)) - return false; - - if (handler->GetSession() && target == handler->GetSession()->GetPlayer()) - { - handler->SendSysMessage(LANG_COMMAND_KICKSELF); - handler->SetSentErrorMessage(true); - return false; - } - - // check online security - if (handler->HasLowerSecurity(target, 0)) - return false; - - if (sWorld->getBoolConfig(CONFIG_SHOW_KICK_IN_WORLD)) - sWorld->SendWorldText(LANG_COMMAND_KICKMESSAGE, playerName.c_str()); - else - handler->PSendSysMessage(LANG_COMMAND_KICKMESSAGE, playerName.c_str()); - - target->GetSession()->KickPlayer(); - - return true; - } - - static bool HandleStartCommand(ChatHandler* handler, char const* /*args*/) - { - Player* player = handler->GetSession()->GetPlayer(); - - if (player->isInFlight()) - { - handler->SendSysMessage(LANG_YOU_IN_FLIGHT); - handler->SetSentErrorMessage(true); - return false; - } - - if (player->isInCombat()) - { - handler->SendSysMessage(LANG_YOU_IN_COMBAT); - handler->SetSentErrorMessage(true); - return false; - } - - if (player->isDead() || player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST)) - { - // if player is dead and stuck, send ghost to graveyard - player->RepopAtGraveyard(); - return true; - } - - // cast spell Stuck - player->CastSpell(player, 7355, false); - return true; - } - // Enable on\off all taxi paths - static bool HandleTaxiCheatCommand(ChatHandler* handler, char const* args) - { - if (!*args) - { - handler->SendSysMessage(LANG_USE_BOL); - handler->SetSentErrorMessage(true); - return false; - } - - std::string argStr = (char*)args; - - Player* chr = handler->getSelectedPlayer(); - - if (!chr) - chr = handler->GetSession()->GetPlayer(); - else if (handler->HasLowerSecurity(chr, 0)) // check online security - return false; - - if (argStr == "on") - { - chr->SetTaxiCheater(true); - handler->PSendSysMessage(LANG_YOU_GIVE_TAXIS, handler->GetNameLink(chr).c_str()); - if (handler->needReportToTarget(chr)) - ChatHandler(chr).PSendSysMessage(LANG_YOURS_TAXIS_ADDED, handler->GetNameLink().c_str()); - return true; - } - - if (argStr == "off") - { - chr->SetTaxiCheater(false); - handler->PSendSysMessage(LANG_YOU_REMOVE_TAXIS, handler->GetNameLink(chr).c_str()); - if (handler->needReportToTarget(chr)) - ChatHandler(chr).PSendSysMessage(LANG_YOURS_TAXIS_REMOVED, handler->GetNameLink().c_str()); - - return true; - } - - handler->SendSysMessage(LANG_USE_BOL); - handler->SetSentErrorMessage(true); - - return false; - } - - static bool HandleLinkGraveCommand(ChatHandler* handler, char const* args) - { - if (!*args) - return false; - - char* px = strtok((char*)args, " "); - if (!px) - return false; - - uint32 graveyardId = uint32(atoi(px)); - - uint32 team; - - char* px2 = strtok(NULL, " "); - - if (!px2) - team = 0; - else if (strncmp(px2, "horde", 6) == 0) - team = HORDE; - else if (strncmp(px2, "alliance", 9) == 0) - team = ALLIANCE; - else - return false; - - WorldSafeLocsEntry const* graveyard = sWorldSafeLocsStore.LookupEntry(graveyardId); - - if (!graveyard) - { - handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDNOEXIST, graveyardId); - handler->SetSentErrorMessage(true); - return false; - } - - Player* player = handler->GetSession()->GetPlayer(); - - uint32 zoneId = player->GetZoneId(); - - AreaTableEntry const* areaEntry = GetAreaEntryByAreaID(zoneId); - if (!areaEntry || areaEntry->zone !=0) - { - handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDWRONGZONE, graveyardId, zoneId); - handler->SetSentErrorMessage(true); - return false; - } - - if (sObjectMgr->AddGraveYardLink(graveyardId, zoneId, team)) - handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDLINKED, graveyardId, zoneId); - else - handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDALRLINKED, graveyardId, zoneId); - - return true; - } - - static bool HandleNearGraveCommand(ChatHandler* handler, char const* args) - { - uint32 team; - - size_t argStr = strlen(args); - - if (!*args) - team = 0; - else if (strncmp((char*)args, "horde", argStr) == 0) - team = HORDE; - else if (strncmp((char*)args, "alliance", argStr) == 0) - team = ALLIANCE; - else - return false; - - Player* player = handler->GetSession()->GetPlayer(); - uint32 zone_id = player->GetZoneId(); - - WorldSafeLocsEntry const* graveyard = sObjectMgr->GetClosestGraveYard( - player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetMapId(), team); - - if (graveyard) - { - uint32 graveyardId = graveyard->ID; - - GraveYardData const* data = sObjectMgr->FindGraveYardData(graveyardId, zone_id); - if (!data) - { - handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDERROR, graveyardId); - handler->SetSentErrorMessage(true); - return false; - } - - team = data->team; - - std::string team_name = handler->GetTrinityString(LANG_COMMAND_GRAVEYARD_NOTEAM); - - if (team == 0) - team_name = handler->GetTrinityString(LANG_COMMAND_GRAVEYARD_ANY); - else if (team == HORDE) - team_name = handler->GetTrinityString(LANG_COMMAND_GRAVEYARD_HORDE); - else if (team == ALLIANCE) - team_name = handler->GetTrinityString(LANG_COMMAND_GRAVEYARD_ALLIANCE); - - handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDNEAREST, graveyardId, team_name.c_str(), zone_id); - } - else - { - std::string team_name; - - if (team == 0) - team_name = handler->GetTrinityString(LANG_COMMAND_GRAVEYARD_ANY); - else if (team == HORDE) - team_name = handler->GetTrinityString(LANG_COMMAND_GRAVEYARD_HORDE); - else if (team == ALLIANCE) - team_name = handler->GetTrinityString(LANG_COMMAND_GRAVEYARD_ALLIANCE); - - if (team == ~uint32(0)) - handler->PSendSysMessage(LANG_COMMAND_ZONENOGRAVEYARDS, zone_id); - else - handler->PSendSysMessage(LANG_COMMAND_ZONENOGRAFACTION, zone_id, team_name.c_str()); - } - - return true; - } - - static bool HandleExploreCheatCommand(ChatHandler* handler, char const* args) - { - if (!*args) - return false; - - int32 flag = int32(atoi((char*)args)); - - Player* playerTarget = handler->getSelectedPlayer(); - if (!playerTarget) - { - handler->SendSysMessage(LANG_NO_CHAR_SELECTED); - handler->SetSentErrorMessage(true); - return false; - } - - if (flag != 0) - { - handler->PSendSysMessage(LANG_YOU_SET_EXPLORE_ALL, handler->GetNameLink(playerTarget).c_str()); - if (handler->needReportToTarget(playerTarget)) - ChatHandler(playerTarget).PSendSysMessage(LANG_YOURS_EXPLORE_SET_ALL, handler->GetNameLink().c_str()); - } - else - { - handler->PSendSysMessage(LANG_YOU_SET_EXPLORE_NOTHING, handler->GetNameLink(playerTarget).c_str()); - if (handler->needReportToTarget(playerTarget)) - ChatHandler(playerTarget).PSendSysMessage(LANG_YOURS_EXPLORE_SET_NOTHING, handler->GetNameLink().c_str()); - } - - for (uint8 i = 0; i < PLAYER_EXPLORED_ZONES_SIZE; ++i) - { - if (flag != 0) - handler->GetSession()->GetPlayer()->SetFlag(PLAYER_EXPLORED_ZONES_1+i, 0xFFFFFFFF); - else - handler->GetSession()->GetPlayer()->SetFlag(PLAYER_EXPLORED_ZONES_1+i, 0); - } - - return true; - } - - static bool HandleShowAreaCommand(ChatHandler* handler, char const* args) - { - if (!*args) - return false; - - Player* playerTarget = handler->getSelectedPlayer(); - if (!playerTarget) - { - handler->SendSysMessage(LANG_NO_CHAR_SELECTED); - handler->SetSentErrorMessage(true); - return false; - } - - int32 area = GetAreaFlagByAreaID(atoi((char*)args)); - int32 offset = area / 32; - uint32 val = uint32((1 << (area % 32))); - - if (area<0 || offset >= PLAYER_EXPLORED_ZONES_SIZE) - { - handler->SendSysMessage(LANG_BAD_VALUE); - handler->SetSentErrorMessage(true); - return false; - } - - uint32 currFields = playerTarget->GetUInt32Value(PLAYER_EXPLORED_ZONES_1 + offset); - playerTarget->SetUInt32Value(PLAYER_EXPLORED_ZONES_1 + offset, uint32((currFields | val))); - - handler->SendSysMessage(LANG_EXPLORE_AREA); - return true; - } - - static bool HandleHideAreaCommand(ChatHandler* handler, char const* args) - { - if (!*args) - return false; - - Player* playerTarget = handler->getSelectedPlayer(); - if (!playerTarget) - { - handler->SendSysMessage(LANG_NO_CHAR_SELECTED); - handler->SetSentErrorMessage(true); - return false; - } - - int32 area = GetAreaFlagByAreaID(atoi((char*)args)); - int32 offset = area / 32; - uint32 val = uint32((1 << (area % 32))); - - if (area < 0 || offset >= PLAYER_EXPLORED_ZONES_SIZE) - { - handler->SendSysMessage(LANG_BAD_VALUE); - handler->SetSentErrorMessage(true); - return false; - } - - uint32 currFields = playerTarget->GetUInt32Value(PLAYER_EXPLORED_ZONES_1 + offset); - playerTarget->SetUInt32Value(PLAYER_EXPLORED_ZONES_1 + offset, uint32((currFields ^ val))); - - handler->SendSysMessage(LANG_UNEXPLORE_AREA); - return true; - } - - static bool HandleAddItemCommand(ChatHandler* handler, char const* args) - { - if (!*args) - return false; - - uint32 itemId = 0; - - if (args[0] == '[') // [name] manual form - { - char const* itemNameStr = strtok((char*)args, "]"); - - if (itemNameStr && itemNameStr[0]) - { - std::string itemName = itemNameStr+1; - WorldDatabase.EscapeString(itemName); - - PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_ITEM_TEMPLATE_BY_NAME); - stmt->setString(0, itemName); - PreparedQueryResult result = WorldDatabase.Query(stmt); - - if (!result) - { - handler->PSendSysMessage(LANG_COMMAND_COULDNOTFIND, itemNameStr+1); - handler->SetSentErrorMessage(true); - return false; - } - itemId = result->Fetch()->GetUInt32(); - } - else - return false; - } - else // item_id or [name] Shift-click form |color|Hitem:item_id:0:0:0|h[name]|h|r - { - char const* id = handler->extractKeyFromLink((char*)args, "Hitem"); - if (!id) - return false; - itemId = uint32(atol(id)); - } - - char const* ccount = strtok(NULL, " "); - - int32 count = 1; - - if (ccount) - count = strtol(ccount, NULL, 10); - - if (count == 0) - count = 1; - - Player* player = handler->GetSession()->GetPlayer(); - Player* playerTarget = handler->getSelectedPlayer(); - if (!playerTarget) - playerTarget = player; - - sLog->outDebug(LOG_FILTER_GENERAL, handler->GetTrinityString(LANG_ADDITEM), itemId, count); - - ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(itemId); - if (!itemTemplate) - { - handler->PSendSysMessage(LANG_COMMAND_ITEMIDINVALID, itemId); - handler->SetSentErrorMessage(true); - return false; - } - - // Subtract - if (count < 0) - { - playerTarget->DestroyItemCount(itemId, -count, true, false); - handler->PSendSysMessage(LANG_REMOVEITEM, itemId, -count, handler->GetNameLink(playerTarget).c_str()); - return true; - } - - // Adding items - uint32 noSpaceForCount = 0; - - // check space and find places - ItemPosCountVec dest; - InventoryResult msg = playerTarget->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemId, count, &noSpaceForCount); - if (msg != EQUIP_ERR_OK) // convert to possible store amount - count -= noSpaceForCount; - - if (count == 0 || dest.empty()) // can't add any - { - handler->PSendSysMessage(LANG_ITEM_CANNOT_CREATE, itemId, noSpaceForCount); - handler->SetSentErrorMessage(true); - return false; - } - - Item* item = playerTarget->StoreNewItem(dest, itemId, true, Item::GenerateItemRandomPropertyId(itemId)); - - // remove binding (let GM give it to another player later) - if (player == playerTarget) - for (ItemPosCountVec::const_iterator itr = dest.begin(); itr != dest.end(); ++itr) - if (Item* item1 = player->GetItemByPos(itr->pos)) - item1->SetBinding(false); - - if (count > 0 && item) - { - player->SendNewItem(item, count, false, true); - if (player != playerTarget) - playerTarget->SendNewItem(item, count, true, false); - } - - if (noSpaceForCount > 0) - handler->PSendSysMessage(LANG_ITEM_CANNOT_CREATE, itemId, noSpaceForCount); - - return true; - } - - static bool HandleAddItemSetCommand(ChatHandler* handler, char const* args) - { - if (!*args) - return false; - - char const* id = handler->extractKeyFromLink((char*)args, "Hitemset"); // number or [name] Shift-click form |color|Hitemset:itemset_id|h[name]|h|r - if (!id) - return false; - - uint32 itemSetId = atol(id); - - // prevent generation all items with itemset field value '0' - if (itemSetId == 0) - { - handler->PSendSysMessage(LANG_NO_ITEMS_FROM_ITEMSET_FOUND, itemSetId); - handler->SetSentErrorMessage(true); - return false; - } - - Player* player = handler->GetSession()->GetPlayer(); - Player* playerTarget = handler->getSelectedPlayer(); - if (!playerTarget) - playerTarget = player; - - sLog->outDebug(LOG_FILTER_GENERAL, handler->GetTrinityString(LANG_ADDITEMSET), itemSetId); - - bool found = false; - ItemTemplateContainer const* its = sObjectMgr->GetItemTemplateStore(); - for (ItemTemplateContainer::const_iterator itr = its->begin(); itr != its->end(); ++itr) - { - if (itr->second.ItemSet == itemSetId) - { - found = true; - ItemPosCountVec dest; - InventoryResult msg = playerTarget->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itr->second.ItemId, 1); - if (msg == EQUIP_ERR_OK) - { - Item* item = playerTarget->StoreNewItem(dest, itr->second.ItemId, true); - - // remove binding (let GM give it to another player later) - if (player == playerTarget) - item->SetBinding(false); - - player->SendNewItem(item, 1, false, true); - if (player != playerTarget) - playerTarget->SendNewItem(item, 1, true, false); - } - else - { - player->SendEquipError(msg, NULL, NULL, itr->second.ItemId); - handler->PSendSysMessage(LANG_ITEM_CANNOT_CREATE, itr->second.ItemId, 1); - } - } - } - - if (!found) - { - handler->PSendSysMessage(LANG_NO_ITEMS_FROM_ITEMSET_FOUND, itemSetId); - handler->SetSentErrorMessage(true); - return false; - } - - return true; - } - - static bool HandleBankCommand(ChatHandler* handler, char const* /*args*/) - { - handler->GetSession()->SendShowBank(handler->GetSession()->GetPlayer()->GetGUID()); - return true; - } - - static bool HandleChangeWeather(ChatHandler* handler, char const* args) - { - if (!*args) - return false; - - // Weather is OFF - if (!sWorld->getBoolConfig(CONFIG_WEATHER)) - { - handler->SendSysMessage(LANG_WEATHER_DISABLED); - handler->SetSentErrorMessage(true); - return false; - } - - // *Change the weather of a cell - char const* px = strtok((char*)args, " "); - char const* py = strtok(NULL, " "); - - if (!px || !py) - return false; - - uint32 type = uint32(atoi(px)); //0 to 3, 0: fine, 1: rain, 2: snow, 3: sand - float grade = float(atof(py)); //0 to 1, sending -1 is instand good weather - - Player* player = handler->GetSession()->GetPlayer(); - uint32 zoneid = player->GetZoneId(); - - Weather* weather = WeatherMgr::FindWeather(zoneid); - - if (!weather) - weather = WeatherMgr::AddWeather(zoneid); - if (!weather) - { - handler->SendSysMessage(LANG_NO_WEATHER); - handler->SetSentErrorMessage(true); - return false; - } - - weather->SetWeather(WeatherType(type), grade); - - return true; - } - - - static bool HandleMaxSkillCommand(ChatHandler* handler, char const* /*args*/) - { - Player* SelectedPlayer = handler->getSelectedPlayer(); - if (!SelectedPlayer) - { - handler->SendSysMessage(LANG_NO_CHAR_SELECTED); - handler->SetSentErrorMessage(true); - return false; - } - - // each skills that have max skill value dependent from level seted to current level max skill value - SelectedPlayer->UpdateSkillsToMaxSkillsForLevel(); - return true; - } - - static bool HandleSetSkillCommand(ChatHandler* handler, char const* args) - { - // number or [name] Shift-click form |color|Hskill:skill_id|h[name]|h|r - char const* skillStr = handler->extractKeyFromLink((char*)args, "Hskill"); - if (!skillStr) - return false; - - char const* levelStr = strtok(NULL, " "); - if (!levelStr) - return false; - - char const* maxPureSkill = strtok(NULL, " "); - - int32 skill = atoi(skillStr); - if (skill <= 0) - { - handler->PSendSysMessage(LANG_INVALID_SKILL_ID, skill); - handler->SetSentErrorMessage(true); - return false; - } - - int32 level = uint32(atol(levelStr)); - - Player* target = handler->getSelectedPlayer(); - if (!target) - { - handler->SendSysMessage(LANG_NO_CHAR_SELECTED); - handler->SetSentErrorMessage(true); - return false; - } - - SkillLineEntry const* skillLine = sSkillLineStore.LookupEntry(skill); - if (!skillLine) - { - handler->PSendSysMessage(LANG_INVALID_SKILL_ID, skill); - handler->SetSentErrorMessage(true); - return false; - } - - std::string tNameLink = handler->GetNameLink(target); - - if (!target->GetSkillValue(skill)) - { - handler->PSendSysMessage(LANG_SET_SKILL_ERROR, tNameLink.c_str(), skill, skillLine->name[handler->GetSessionDbcLocale()]); - handler->SetSentErrorMessage(true); - return false; - } - - uint16 max = maxPureSkill ? atol (maxPureSkill) : target->GetPureMaxSkillValue(skill); - - if (level <= 0 || level > max || max <= 0) - return false; - - target->SetSkill(skill, target->GetSkillStep(skill), level, max); - handler->PSendSysMessage(LANG_SET_SKILL, skill, skillLine->name[handler->GetSessionDbcLocale()], tNameLink.c_str(), level, max); - - return true; - } - // show info of player - static bool HandlePInfoCommand(ChatHandler* handler, char const* args) - { - Player* target; - uint64 targetGuid; - std::string targetName; - - uint32 parseGUID = MAKE_NEW_GUID(atol((char*)args), 0, HIGHGUID_PLAYER); - - if (sObjectMgr->GetPlayerNameByGUID(parseGUID, targetName)) - { - target = sObjectMgr->GetPlayerByLowGUID(parseGUID); - targetGuid = parseGUID; - } - else if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName)) - return false; - - uint32 accId = 0; - uint32 money = 0; - uint32 totalPlayerTime = 0; - uint8 level = 0; - uint32 latency = 0; - uint8 race; - uint8 Class; - int64 muteTime = 0; - int64 banTime = -1; - uint32 mapId; - uint32 areaId; - uint32 phase = 0; - - // get additional information from Player object - if (target) - { - // check online security - if (handler->HasLowerSecurity(target, 0)) - return false; - - accId = target->GetSession()->GetAccountId(); - money = target->GetMoney(); - totalPlayerTime = target->GetTotalPlayedTime(); - level = target->getLevel(); - latency = target->GetSession()->GetLatency(); - race = target->getRace(); - Class = target->getClass(); - muteTime = target->GetSession()->m_muteTime; - mapId = target->GetMapId(); - areaId = target->GetAreaId(); - phase = target->GetPhaseMask(); - } - // get additional information from DB - else - { - // check offline security - if (handler->HasLowerSecurity(NULL, targetGuid)) - return false; - - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_PINFO); - stmt->setUInt32(0, GUID_LOPART(targetGuid)); - PreparedQueryResult result = CharacterDatabase.Query(stmt); - - if (!result) - return false; - - Field* fields = result->Fetch(); - totalPlayerTime = fields[0].GetUInt32(); - level = fields[1].GetUInt8(); - money = fields[2].GetUInt32(); - accId = fields[3].GetUInt32(); - race = fields[4].GetUInt8(); - Class = fields[5].GetUInt8(); - mapId = fields[6].GetUInt16(); - areaId = fields[7].GetUInt16(); - } - - std::string userName = handler->GetTrinityString(LANG_ERROR); - std::string eMail = handler->GetTrinityString(LANG_ERROR); - std::string lastIp = handler->GetTrinityString(LANG_ERROR); - uint32 security = 0; - std::string lastLogin = handler->GetTrinityString(LANG_ERROR); - - PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_PINFO); - stmt->setInt32(0, int32(realmID)); - stmt->setUInt32(1, accId); - PreparedQueryResult result = LoginDatabase.Query(stmt); - - if (result) - { - Field* fields = result->Fetch(); - userName = fields[0].GetString(); - security = fields[1].GetUInt8(); - eMail = fields[2].GetString(); - muteTime = fields[5].GetUInt64(); - - if (eMail.empty()) - eMail = "-"; - - if (!handler->GetSession() || handler->GetSession()->GetSecurity() >= AccountTypes(security)) - { - lastIp = fields[3].GetString(); - lastLogin = fields[4].GetString(); - - uint32 ip = inet_addr(lastIp.c_str()); -#if TRINITY_ENDIAN == BIGENDIAN - EndianConvertReverse(ip); -#endif - - PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_IP2NATION_COUNTRY); - - stmt->setUInt32(0, ip); - - PreparedQueryResult result2 = WorldDatabase.Query(stmt); - - if (result2) - { - Field* fields2 = result2->Fetch(); - lastIp.append(" ("); - lastIp.append(fields2[0].GetString()); - lastIp.append(")"); - } - } - else - { - lastIp = "-"; - lastLogin = "-"; - } - } - - std::string nameLink = handler->playerLink(targetName); - - handler->PSendSysMessage(LANG_PINFO_ACCOUNT, (target ? "" : handler->GetTrinityString(LANG_OFFLINE)), nameLink.c_str(), GUID_LOPART(targetGuid), userName.c_str(), accId, eMail.c_str(), security, lastIp.c_str(), lastLogin.c_str(), latency); - - std::string bannedby = "unknown"; - std::string banreason = ""; - - stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_PINFO_BANS); - stmt->setUInt32(0, accId); - PreparedQueryResult result2 = LoginDatabase.Query(stmt); - if (!result2) - { - stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PINFO_BANS); - stmt->setUInt32(0, GUID_LOPART(targetGuid)); - result2 = CharacterDatabase.Query(stmt); - } - - if (result2) - { - Field* fields = result2->Fetch(); - banTime = int64(fields[1].GetBool() ? 0 : fields[0].GetUInt32()); - bannedby = fields[2].GetString(); - banreason = fields[3].GetString(); - } - - if (muteTime > 0) - handler->PSendSysMessage(LANG_PINFO_MUTE, secsToTimeString(muteTime - time(NULL), true).c_str()); - - if (banTime >= 0) - handler->PSendSysMessage(LANG_PINFO_BAN, banTime > 0 ? secsToTimeString(banTime - time(NULL), true).c_str() : "permanently", bannedby.c_str(), banreason.c_str()); - - std::string raceStr, ClassStr; - switch (race) - { - case RACE_HUMAN: - raceStr = "Human"; - break; - case RACE_ORC: - raceStr = "Orc"; - break; - case RACE_DWARF: - raceStr = "Dwarf"; - break; - case RACE_NIGHTELF: - raceStr = "Night Elf"; - break; - case RACE_UNDEAD_PLAYER: - raceStr = "Undead"; - break; - case RACE_TAUREN: - raceStr = "Tauren"; - break; - case RACE_GNOME: - raceStr = "Gnome"; - break; - case RACE_TROLL: - raceStr = "Troll"; - break; - case RACE_BLOODELF: - raceStr = "Blood Elf"; - break; - case RACE_DRAENEI: - raceStr = "Draenei"; - break; - } - - switch (Class) - { - case CLASS_WARRIOR: - ClassStr = "Warrior"; - break; - case CLASS_PALADIN: - ClassStr = "Paladin"; - break; - case CLASS_HUNTER: - ClassStr = "Hunter"; - break; - case CLASS_ROGUE: - ClassStr = "Rogue"; - break; - case CLASS_PRIEST: - ClassStr = "Priest"; - break; - case CLASS_DEATH_KNIGHT: - ClassStr = "Death Knight"; - break; - case CLASS_SHAMAN: - ClassStr = "Shaman"; - break; - case CLASS_MAGE: - ClassStr = "Mage"; - break; - case CLASS_WARLOCK: - ClassStr = "Warlock"; - break; - case CLASS_DRUID: - ClassStr = "Druid"; - break; - } - - std::string timeStr = secsToTimeString(totalPlayerTime, true, true); - uint32 gold = money /GOLD; - uint32 silv = (money % GOLD) / SILVER; - uint32 copp = (money % GOLD) % SILVER; - handler->PSendSysMessage(LANG_PINFO_LEVEL, raceStr.c_str(), ClassStr.c_str(), timeStr.c_str(), level, gold, silv, copp); - - // Add map, zone, subzone and phase to output - int locale = handler->GetSessionDbcLocale(); - std::string areaName = ""; - std::string zoneName = ""; - - MapEntry const* map = sMapStore.LookupEntry(mapId); - - AreaTableEntry const* area = GetAreaEntryByAreaID(areaId); - if (area) - { - areaName = area->area_name[locale]; - - AreaTableEntry const* zone = GetAreaEntryByAreaID(area->zone); - if (zone) - zoneName = zone->area_name[locale]; - } - - if (target) - { - if (!zoneName.empty()) - handler->PSendSysMessage(LANG_PINFO_MAP_ONLINE, map->name[locale], zoneName.c_str(), areaName.c_str(), phase); - else - handler->PSendSysMessage(LANG_PINFO_MAP_ONLINE, map->name[locale], areaName.c_str(), "", phase); - } - else - handler->PSendSysMessage(LANG_PINFO_MAP_OFFLINE, map->name[locale], areaName.c_str()); - - return true; - } - - static bool HandleRespawnCommand(ChatHandler* handler, char const* /*args*/) - { - Player* player = handler->GetSession()->GetPlayer(); - - // accept only explicitly selected target (not implicitly self targeting case) - Unit* target = handler->getSelectedUnit(); - if (player->GetSelection() && target) - { - if (target->GetTypeId() != TYPEID_UNIT || target->isPet()) - { - handler->SendSysMessage(LANG_SELECT_CREATURE); - handler->SetSentErrorMessage(true); - return false; - } - - if (target->isDead()) - target->ToCreature()->Respawn(); - return true; - } - - CellCoord p(Trinity::ComputeCellCoord(player->GetPositionX(), player->GetPositionY())); - Cell cell(p); - cell.SetNoCreate(); - - Trinity::RespawnDo u_do; - Trinity::WorldObjectWorker worker(player, u_do); - - TypeContainerVisitor, GridTypeMapContainer > obj_worker(worker); - cell.Visit(p, obj_worker, *player->GetMap(), *player, player->GetGridActivationRange()); - - return true; - } - // mute player for some times - static bool HandleMuteCommand(ChatHandler* handler, char const* args) - { - char* nameStr; - char* delayStr; - handler->extractOptFirstArg((char*)args, &nameStr, &delayStr); - if (!delayStr) - return false; - - char const* muteReason = strtok(NULL, "\r"); - std::string muteReasonStr = "No reason"; - if (muteReason != NULL) - muteReasonStr = muteReason; - - Player* target; - uint64 targetGuid; - std::string targetName; - if (!handler->extractPlayerTarget(nameStr, &target, &targetGuid, &targetName)) - return false; - - uint32 accountId = target ? target->GetSession()->GetAccountId() : sObjectMgr->GetPlayerAccountIdByGUID(targetGuid); - - // find only player from same account if any - if (!target) - if (WorldSession* session = sWorld->FindSession(accountId)) - target = session->GetPlayer(); - - uint32 notSpeakTime = uint32(atoi(delayStr)); - - // must have strong lesser security level - if (handler->HasLowerSecurity (target, targetGuid, true)) - return false; - - PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_MUTE_TIME); - - if (target) - { - // Target is online, mute will be in effect right away. - int64 muteTime = time(NULL) + notSpeakTime * MINUTE; - target->GetSession()->m_muteTime = muteTime; - stmt->setInt64(0, muteTime); - ChatHandler(target).PSendSysMessage(LANG_YOUR_CHAT_DISABLED, notSpeakTime, muteReasonStr.c_str()); - } - else - { - // Target is offline, mute will be in effect starting from the next login. - int32 muteTime = -int32(notSpeakTime * MINUTE); - stmt->setInt64(0, muteTime); - } - - stmt->setUInt32(1, accountId); - LoginDatabase.Execute(stmt); - std::string nameLink = handler->playerLink(targetName); - - handler->PSendSysMessage(target ? LANG_YOU_DISABLE_CHAT : LANG_COMMAND_DISABLE_CHAT_DELAYED, nameLink.c_str(), notSpeakTime, muteReasonStr.c_str()); - - return true; - } - - // unmute player - static bool HandleUnmuteCommand(ChatHandler* handler, char const* args) - { - Player* target; - uint64 targetGuid; - std::string targetName; - if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName)) - return false; - - uint32 accountId = target ? target->GetSession()->GetAccountId() : sObjectMgr->GetPlayerAccountIdByGUID(targetGuid); - - // find only player from same account if any - if (!target) - if (WorldSession* session = sWorld->FindSession(accountId)) - target = session->GetPlayer(); - - // must have strong lesser security level - if (handler->HasLowerSecurity (target, targetGuid, true)) - return false; - - if (target) - { - if (target->CanSpeak()) - { - handler->SendSysMessage(LANG_CHAT_ALREADY_ENABLED); - handler->SetSentErrorMessage(true); - return false; - } - - target->GetSession()->m_muteTime = 0; - } - - PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_MUTE_TIME); - stmt->setInt64(0, 0); - stmt->setUInt32(1, accountId); - LoginDatabase.Execute(stmt); - - if (target) - ChatHandler(target).PSendSysMessage(LANG_YOUR_CHAT_ENABLED); - - std::string nameLink = handler->playerLink(targetName); - - handler->PSendSysMessage(LANG_YOU_ENABLE_CHAT, nameLink.c_str()); - - return true; - } - - - static bool HandleMovegensCommand(ChatHandler* handler, char const* /*args*/) - { - Unit* unit = handler->getSelectedUnit(); - if (!unit) - { - handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE); - handler->SetSentErrorMessage(true); - return false; - } - - handler->PSendSysMessage(LANG_MOVEGENS_LIST, (unit->GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"), unit->GetGUIDLow()); - - MotionMaster* motionMaster = unit->GetMotionMaster(); - float x, y, z; - motionMaster->GetDestination(x, y, z); - - for (uint8 i = 0; i < MAX_MOTION_SLOT; ++i) - { - MovementGenerator* movementGenerator = motionMaster->GetMotionSlot(i); - if (!movementGenerator) - { - handler->SendSysMessage("Empty"); - continue; - } - - switch (movementGenerator->GetMovementGeneratorType()) - { - case IDLE_MOTION_TYPE: - handler->SendSysMessage(LANG_MOVEGENS_IDLE); - break; - case RANDOM_MOTION_TYPE: - handler->SendSysMessage(LANG_MOVEGENS_RANDOM); - break; - case WAYPOINT_MOTION_TYPE: - handler->SendSysMessage(LANG_MOVEGENS_WAYPOINT); - break; - case ANIMAL_RANDOM_MOTION_TYPE: - handler->SendSysMessage(LANG_MOVEGENS_ANIMAL_RANDOM); - break; - case CONFUSED_MOTION_TYPE: - handler->SendSysMessage(LANG_MOVEGENS_CONFUSED); - break; - case CHASE_MOTION_TYPE: - { - Unit* target = NULL; - if (unit->GetTypeId() == TYPEID_PLAYER) - target = static_cast const*>(movementGenerator)->GetTarget(); - else - target = static_cast const*>(movementGenerator)->GetTarget(); - - if (!target) - handler->SendSysMessage(LANG_MOVEGENS_CHASE_NULL); - else if (target->GetTypeId() == TYPEID_PLAYER) - handler->PSendSysMessage(LANG_MOVEGENS_CHASE_PLAYER, target->GetName(), target->GetGUIDLow()); - else - handler->PSendSysMessage(LANG_MOVEGENS_CHASE_CREATURE, target->GetName(), target->GetGUIDLow()); - break; - } - case FOLLOW_MOTION_TYPE: - { - Unit* target = NULL; - if (unit->GetTypeId() == TYPEID_PLAYER) - target = static_cast const*>(movementGenerator)->GetTarget(); - else - target = static_cast const*>(movementGenerator)->GetTarget(); - - if (!target) - handler->SendSysMessage(LANG_MOVEGENS_FOLLOW_NULL); - else if (target->GetTypeId() == TYPEID_PLAYER) - handler->PSendSysMessage(LANG_MOVEGENS_FOLLOW_PLAYER, target->GetName(), target->GetGUIDLow()); - else - handler->PSendSysMessage(LANG_MOVEGENS_FOLLOW_CREATURE, target->GetName(), target->GetGUIDLow()); - break; - } - case HOME_MOTION_TYPE: - { - if (unit->GetTypeId() == TYPEID_UNIT) - handler->PSendSysMessage(LANG_MOVEGENS_HOME_CREATURE, x, y, z); - else - handler->SendSysMessage(LANG_MOVEGENS_HOME_PLAYER); - break; - } - case FLIGHT_MOTION_TYPE: - handler->SendSysMessage(LANG_MOVEGENS_FLIGHT); - break; - case POINT_MOTION_TYPE: - { - handler->PSendSysMessage(LANG_MOVEGENS_POINT, x, y, z); - break; - } - case FLEEING_MOTION_TYPE: - handler->SendSysMessage(LANG_MOVEGENS_FEAR); - break; - case DISTRACT_MOTION_TYPE: - handler->SendSysMessage(LANG_MOVEGENS_DISTRACT); - break; - case EFFECT_MOTION_TYPE: - handler->SendSysMessage(LANG_MOVEGENS_EFFECT); - break; - default: - handler->PSendSysMessage(LANG_MOVEGENS_UNKNOWN, movementGenerator->GetMovementGeneratorType()); - break; - } - } - return true; - } - /* - ComeToMe command REQUIRED for 3rd party scripting library to have access to PointMovementGenerator - Without this function 3rd party scripting library will get linking errors (unresolved external) - when attempting to use the PointMovementGenerator - */ - static bool HandleComeToMeCommand(ChatHandler* handler, char const* args) - { - char const* newFlagStr = strtok((char*)args, " "); - if (!newFlagStr) - return false; - - Creature* caster = handler->getSelectedCreature(); - if (!caster) - { - handler->SendSysMessage(LANG_SELECT_CREATURE); - handler->SetSentErrorMessage(true); - return false; - } - - Player* player = handler->GetSession()->GetPlayer(); - - caster->GetMotionMaster()->MovePoint(0, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ()); - - return true; - } - - static bool HandleDamageCommand(ChatHandler* handler, char const* args) - { - if (!*args) - return false; - - Unit* target = handler->getSelectedUnit(); - if (!target || !handler->GetSession()->GetPlayer()->GetSelection()) - { - handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE); - handler->SetSentErrorMessage(true); - return false; - } - - if (target->GetTypeId() == TYPEID_PLAYER) - { - if (handler->HasLowerSecurity((Player*)target, 0, false)) - return false; - } - - if (!target->isAlive()) - return true; - - char* damageStr = strtok((char*)args, " "); - if (!damageStr) - return false; - - int32 damage_int = atoi((char*)damageStr); - if (damage_int <= 0) - return true; - - uint32 damage = damage_int; - - char* schoolStr = strtok((char*)NULL, " "); - - // flat melee damage without resistence/etc reduction - if (!schoolStr) - { - handler->GetSession()->GetPlayer()->DealDamage(target, damage, NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - if (target != handler->GetSession()->GetPlayer()) - handler->GetSession()->GetPlayer()->SendAttackStateUpdate (HITINFO_AFFECTS_VICTIM, target, 1, SPELL_SCHOOL_MASK_NORMAL, damage, 0, 0, VICTIMSTATE_HIT, 0); - return true; - } - - uint32 school = schoolStr ? atoi((char*)schoolStr) : SPELL_SCHOOL_NORMAL; - if (school >= MAX_SPELL_SCHOOL) - return false; - - SpellSchoolMask schoolmask = SpellSchoolMask(1 << school); - - if (Unit::IsDamageReducedByArmor(schoolmask)) - damage = handler->GetSession()->GetPlayer()->CalcArmorReducedDamage(target, damage, NULL, BASE_ATTACK); - - char* spellStr = strtok((char*)NULL, " "); - - // melee damage by specific school - if (!spellStr) - { - uint32 absorb = 0; - uint32 resist = 0; - - handler->GetSession()->GetPlayer()->CalcAbsorbResist(target, schoolmask, SPELL_DIRECT_DAMAGE, damage, &absorb, &resist); - - if (damage <= absorb + resist) - return true; - - damage -= absorb + resist; - - handler->GetSession()->GetPlayer()->DealDamageMods(target, damage, &absorb); - handler->GetSession()->GetPlayer()->DealDamage(target, damage, NULL, DIRECT_DAMAGE, schoolmask, NULL, false); - handler->GetSession()->GetPlayer()->SendAttackStateUpdate (HITINFO_AFFECTS_VICTIM, target, 1, schoolmask, damage, absorb, resist, VICTIMSTATE_HIT, 0); - return true; - } - - // non-melee damage - - // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form - uint32 spellid = handler->extractSpellIdFromLink((char*)args); - if (!spellid || !sSpellMgr->GetSpellInfo(spellid)) - return false; - - handler->GetSession()->GetPlayer()->SpellNonMeleeDamageLog(target, spellid, damage); - return true; - } - - static bool HandleCombatStopCommand(ChatHandler* handler, char const* args) - { - Player* target = NULL; - - if (args && strlen(args) > 0) - { - target = sObjectAccessor->FindPlayerByName(args); - if (!target) - { - handler->SendSysMessage(LANG_PLAYER_NOT_FOUND); - handler->SetSentErrorMessage(true); - return false; - } - } - - if (!target) - { - if (!handler->extractPlayerTarget((char*)args, &target)) - return false; - } - - // check online security - if (handler->HasLowerSecurity(target, 0)) - return false; - - target->CombatStop(); - target->getHostileRefManager().deleteReferences(); - return true; - } - - static bool HandleFlushArenaPointsCommand(ChatHandler* /*handler*/, char const* /*args*/) - { - sArenaTeamMgr->DistributeArenaPoints(); - return true; - } - - static bool HandleRepairitemsCommand(ChatHandler* handler, char const* args) - { - Player* target; - if (!handler->extractPlayerTarget((char*)args, &target)) - return false; - - // check online security - if (handler->HasLowerSecurity(target, 0)) - return false; - - // Repair items - target->DurabilityRepairAll(false, 0, false); - - handler->PSendSysMessage(LANG_YOU_REPAIR_ITEMS, handler->GetNameLink(target).c_str()); - if (handler->needReportToTarget(target)) - ChatHandler(target).PSendSysMessage(LANG_YOUR_ITEMS_REPAIRED, handler->GetNameLink().c_str()); - - return true; - } - - static bool HandleWaterwalkCommand(ChatHandler* handler, char const* args) - { - if (!*args) - return false; - - Player* player = handler->getSelectedPlayer(); - if (!player) - { - handler->PSendSysMessage(LANG_NO_CHAR_SELECTED); - handler->SetSentErrorMessage(true); - return false; - } - - // check online security - if (handler->HasLowerSecurity(player, 0)) - return false; - - if (strncmp(args, "on", 3) == 0) - player->SendMovementSetWaterWalking(true); - else if (strncmp(args, "off", 4) == 0) - player->SendMovementSetWaterWalking(false); - else - { - handler->SendSysMessage(LANG_USE_BOL); - return false; - } - - handler->PSendSysMessage(LANG_YOU_SET_WATERWALK, args, handler->GetNameLink(player).c_str()); - if (handler->needReportToTarget(player)) - ChatHandler(player).PSendSysMessage(LANG_YOUR_WATERWALK_SET, args, handler->GetNameLink().c_str()); - return true; - } - - // Send mail by command - static bool HandleSendMailCommand(ChatHandler* handler, char const* args) - { - // format: name "subject text" "mail text" - Player* target; - uint64 targetGuid; - std::string targetName; - if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName)) - return false; - - char* tail1 = strtok(NULL, ""); - if (!tail1) - return false; - - char const* msgSubject = handler->extractQuotedArg(tail1); - if (!msgSubject) - return false; - - char* tail2 = strtok(NULL, ""); - if (!tail2) - return false; - - char const* msgText = handler->extractQuotedArg(tail2); - if (!msgText) - return false; - - // msgSubject, msgText isn't NUL after prev. check - std::string subject = msgSubject; - std::string text = msgText; - - // from console show not existed sender - MailSender sender(MAIL_NORMAL, handler->GetSession() ? handler->GetSession()->GetPlayer()->GetGUIDLow() : 0, MAIL_STATIONERY_GM); - - //- TODO: Fix poor design - SQLTransaction trans = CharacterDatabase.BeginTransaction(); - MailDraft(subject, text) - .SendMailTo(trans, MailReceiver(target, GUID_LOPART(targetGuid)), sender); - - CharacterDatabase.CommitTransaction(trans); - - std::string nameLink = handler->playerLink(targetName); - handler->PSendSysMessage(LANG_MAIL_SENT, nameLink.c_str()); - return true; - } - // Send items by mail - static bool HandleSendItemsCommand(ChatHandler* handler, char const* args) - { - // format: name "subject text" "mail text" item1[:count1] item2[:count2] ... item12[:count12] - Player* receiver; - uint64 receiverGuid; - std::string receiverName; - if (!handler->extractPlayerTarget((char*)args, &receiver, &receiverGuid, &receiverName)) - return false; - - char* tail1 = strtok(NULL, ""); - if (!tail1) - return false; - - char const* msgSubject = handler->extractQuotedArg(tail1); - if (!msgSubject) - return false; - - char* tail2 = strtok(NULL, ""); - if (!tail2) - return false; - - char const* msgText = handler->extractQuotedArg(tail2); - if (!msgText) - return false; - - // msgSubject, msgText isn't NUL after prev. check - std::string subject = msgSubject; - std::string text = msgText; - - // extract items - typedef std::pair ItemPair; - typedef std::list< ItemPair > ItemPairs; - ItemPairs items; - - // get all tail string - char* tail = strtok(NULL, ""); - - // get from tail next item str - while (char* itemStr = strtok(tail, " ")) - { - // and get new tail - tail = strtok(NULL, ""); - - // parse item str - char const* itemIdStr = strtok(itemStr, ":"); - char const* itemCountStr = strtok(NULL, " "); - - uint32 itemId = atoi(itemIdStr); - if (!itemId) - return false; - - ItemTemplate const* item_proto = sObjectMgr->GetItemTemplate(itemId); - if (!item_proto) - { - handler->PSendSysMessage(LANG_COMMAND_ITEMIDINVALID, itemId); - handler->SetSentErrorMessage(true); - return false; - } - - uint32 itemCount = itemCountStr ? atoi(itemCountStr) : 1; - if (itemCount < 1 || (item_proto->MaxCount > 0 && itemCount > uint32(item_proto->MaxCount))) - { - handler->PSendSysMessage(LANG_COMMAND_INVALID_ITEM_COUNT, itemCount, itemId); - handler->SetSentErrorMessage(true); - return false; - } - - while (itemCount > item_proto->GetMaxStackSize()) - { - items.push_back(ItemPair(itemId, item_proto->GetMaxStackSize())); - itemCount -= item_proto->GetMaxStackSize(); - } - - items.push_back(ItemPair(itemId, itemCount)); - - if (items.size() > MAX_MAIL_ITEMS) - { - handler->PSendSysMessage(LANG_COMMAND_MAIL_ITEMS_LIMIT, MAX_MAIL_ITEMS); - handler->SetSentErrorMessage(true); - return false; - } - } - - // from console show not existed sender - MailSender sender(MAIL_NORMAL, handler->GetSession() ? handler->GetSession()->GetPlayer()->GetGUIDLow() : 0, MAIL_STATIONERY_GM); - - // fill mail - MailDraft draft(subject, text); - - SQLTransaction trans = CharacterDatabase.BeginTransaction(); - - for (ItemPairs::const_iterator itr = items.begin(); itr != items.end(); ++itr) - { - if (Item* item = Item::CreateItem(itr->first, itr->second, handler->GetSession() ? handler->GetSession()->GetPlayer() : 0)) - { - item->SaveToDB(trans); // save for prevent lost at next mail load, if send fail then item will deleted - draft.AddItem(item); - } - } - - draft.SendMailTo(trans, MailReceiver(receiver, GUID_LOPART(receiverGuid)), sender); - CharacterDatabase.CommitTransaction(trans); - - std::string nameLink = handler->playerLink(receiverName); - handler->PSendSysMessage(LANG_MAIL_SENT, nameLink.c_str()); - return true; - } - /// Send money by mail - static bool HandleSendMoneyCommand(ChatHandler* handler, char const* args) - { - /// format: name "subject text" "mail text" money - - Player* receiver; - uint64 receiverGuid; - std::string receiverName; - if (!handler->extractPlayerTarget((char*)args, &receiver, &receiverGuid, &receiverName)) - return false; - - char* tail1 = strtok(NULL, ""); - if (!tail1) - return false; - - char* msgSubject = handler->extractQuotedArg(tail1); - if (!msgSubject) - return false; - - char* tail2 = strtok(NULL, ""); - if (!tail2) - return false; - - char* msgText = handler->extractQuotedArg(tail2); - if (!msgText) - return false; - - char* moneyStr = strtok(NULL, ""); - int32 money = moneyStr ? atoi(moneyStr) : 0; - if (money <= 0) - return false; - - // msgSubject, msgText isn't NUL after prev. check - std::string subject = msgSubject; - std::string text = msgText; - - // from console show not existed sender - MailSender sender(MAIL_NORMAL, handler->GetSession() ? handler->GetSession()->GetPlayer()->GetGUIDLow() : 0, MAIL_STATIONERY_GM); - - SQLTransaction trans = CharacterDatabase.BeginTransaction(); - - MailDraft(subject, text) - .AddMoney(money) - .SendMailTo(trans, MailReceiver(receiver, GUID_LOPART(receiverGuid)), sender); - - CharacterDatabase.CommitTransaction(trans); - - std::string nameLink = handler->playerLink(receiverName); - handler->PSendSysMessage(LANG_MAIL_SENT, nameLink.c_str()); - return true; - } - /// Send a message to a player in game - static bool HandleSendMessageCommand(ChatHandler* handler, char const* args) - { - /// - Find the player - Player* player; - if (!handler->extractPlayerTarget((char*)args, &player)) - return false; - - char* msgStr = strtok(NULL, ""); - if (!msgStr) - return false; - - ///- Check that he is not logging out. - if (player->GetSession()->isLogingOut()) - { - handler->SendSysMessage(LANG_PLAYER_NOT_FOUND); - handler->SetSentErrorMessage(true); - return false; - } - - /// - Send the message - // Use SendAreaTriggerMessage for fastest delivery. - player->GetSession()->SendAreaTriggerMessage("%s", msgStr); - player->GetSession()->SendAreaTriggerMessage("|cffff0000[Message from administrator]:|r"); - - // Confirmation message - std::string nameLink = handler->GetNameLink(player); - handler->PSendSysMessage(LANG_SENDMESSAGE, nameLink.c_str(), msgStr); - - return true; - } - - static bool HandleCreatePetCommand(ChatHandler* handler, char const* /*args*/) - { - Player* player = handler->GetSession()->GetPlayer(); - Creature* creatureTarget = handler->getSelectedCreature(); - - if (!creatureTarget || creatureTarget->isPet() || creatureTarget->GetTypeId() == TYPEID_PLAYER) - { - handler->PSendSysMessage(LANG_SELECT_CREATURE); - handler->SetSentErrorMessage(true); - return false; - } - - CreatureTemplate const* creatrueTemplate = sObjectMgr->GetCreatureTemplate(creatureTarget->GetEntry()); - // Creatures with family 0 crashes the server - if (!creatrueTemplate->family) - { - handler->PSendSysMessage("This creature cannot be tamed. (family id: 0)."); - handler->SetSentErrorMessage(true); - return false; - } - - if (player->GetPetGUID()) - { - handler->PSendSysMessage("You already have a pet"); - handler->SetSentErrorMessage(true); - return false; - } - - // Everything looks OK, create new pet - Pet* pet = new Pet(player, HUNTER_PET); - if (!pet->CreateBaseAtCreature(creatureTarget)) - { - delete pet; - handler->PSendSysMessage("Error 1"); - return false; - } - - creatureTarget->setDeathState(JUST_DIED); - creatureTarget->RemoveCorpse(); - creatureTarget->SetHealth(0); // just for nice GM-mode view - - pet->SetUInt64Value(UNIT_FIELD_CREATEDBY, player->GetGUID()); - pet->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, player->getFaction()); - - if (!pet->InitStatsForLevel(creatureTarget->getLevel())) - { - sLog->outError(LOG_FILTER_GENERAL, "InitStatsForLevel() in EffectTameCreature failed! Pet deleted."); - handler->PSendSysMessage("Error 2"); - delete pet; - return false; - } - - // prepare visual effect for levelup - pet->SetUInt32Value(UNIT_FIELD_LEVEL, creatureTarget->getLevel()-1); - - pet->GetCharmInfo()->SetPetNumber(sObjectMgr->GeneratePetNumber(), true); - // this enables pet details window (Shift+P) - pet->InitPetCreateSpells(); - pet->SetFullHealth(); - - pet->GetMap()->AddToMap(pet->ToCreature()); - - // visual effect for levelup - pet->SetUInt32Value(UNIT_FIELD_LEVEL, creatureTarget->getLevel()); - - player->SetMinion(pet, true); - pet->SavePetToDB(PET_SAVE_AS_CURRENT); - player->PetSpellInitialize(); - - return true; - } - - static bool HandlePetLearnCommand(ChatHandler* handler, char const* args) - { - if (!*args) - return false; - - Player* player = handler->GetSession()->GetPlayer(); - Pet* pet = player->GetPet(); - - if (!pet) - { - handler->PSendSysMessage("You have no pet"); - handler->SetSentErrorMessage(true); - return false; - } - - uint32 spellId = handler->extractSpellIdFromLink((char*)args); - - if (!spellId || !sSpellMgr->GetSpellInfo(spellId)) - return false; - - // Check if pet already has it - if (pet->HasSpell(spellId)) - { - handler->PSendSysMessage("Pet already has spell: %u", spellId); - handler->SetSentErrorMessage(true); - return false; - } - - // Check if spell is valid - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId); - if (!spellInfo || !SpellMgr::IsSpellValid(spellInfo)) - { - handler->PSendSysMessage(LANG_COMMAND_SPELL_BROKEN, spellId); - handler->SetSentErrorMessage(true); - return false; - } - - pet->learnSpell(spellId); - - handler->PSendSysMessage("Pet has learned spell %u", spellId); - return true; - } - - static bool HandlePetUnlearnCommand(ChatHandler* handler, char const* args) - { - if (!*args) - return false; - - Player* player = handler->GetSession()->GetPlayer(); - Pet* pet = player->GetPet(); - if (!pet) - { - handler->PSendSysMessage("You have no pet"); - handler->SetSentErrorMessage(true); - return false; - } - - uint32 spellId = handler->extractSpellIdFromLink((char*)args); - - if (pet->HasSpell(spellId)) - pet->removeSpell(spellId, false); - else - handler->PSendSysMessage("Pet doesn't have that spell"); - - return true; - } - - static bool HandleFreezeCommand(ChatHandler* handler, char const* args) - { - std::string name; - Player* player; - char const* TargetName = strtok((char*)args, " "); // get entered name - if (!TargetName) // if no name entered use target - { - player = handler->getSelectedPlayer(); - if (player) //prevent crash with creature as target - { - name = player->GetName(); - normalizePlayerName(name); - } - } - else // if name entered - { - name = TargetName; - normalizePlayerName(name); - player = sObjectAccessor->FindPlayerByName(name.c_str()); - } - - if (!player) - { - handler->SendSysMessage(LANG_COMMAND_FREEZE_WRONG); - return true; - } - - if (player == handler->GetSession()->GetPlayer()) - { - handler->SendSysMessage(LANG_COMMAND_FREEZE_ERROR); - return true; - } - - // effect - if (player && (player != handler->GetSession()->GetPlayer())) - { - handler->PSendSysMessage(LANG_COMMAND_FREEZE, name.c_str()); - - // stop combat + make player unattackable + duel stop + stop some spells - player->setFaction(35); - player->CombatStop(); - if (player->IsNonMeleeSpellCasted(true)) - player->InterruptNonMeleeSpells(true); - player->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - - // if player class = hunter || warlock remove pet if alive - if ((player->getClass() == CLASS_HUNTER) || (player->getClass() == CLASS_WARLOCK)) - { - if (Pet* pet = player->GetPet()) - { - pet->SavePetToDB(PET_SAVE_AS_CURRENT); - // not let dismiss dead pet - if (pet && pet->isAlive()) - player->RemovePet(pet, PET_SAVE_NOT_IN_SLOT); - } - } - - if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(9454)) - Aura::TryRefreshStackOrCreate(spellInfo, MAX_EFFECT_MASK, player, player); - - // save player - player->SaveToDB(); - } - - return true; - } - - static bool HandleUnFreezeCommand(ChatHandler* handler, char const*args) - { - std::string name; - Player* player; - char* targetName = strtok((char*)args, " "); // Get entered name - - if (targetName) - { - name = targetName; - normalizePlayerName(name); - player = sObjectAccessor->FindPlayerByName(name.c_str()); - } - else // If no name was entered - use target - { - player = handler->getSelectedPlayer(); - if (player) - name = player->GetName(); - } - - if (player) - { - handler->PSendSysMessage(LANG_COMMAND_UNFREEZE, name.c_str()); - - // Reset player faction + allow combat + allow duels - player->setFactionForRace(player->getRace()); - player->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - - // Remove Freeze spell (allowing movement and spells) - player->RemoveAurasDueToSpell(9454); - - // Save player - player->SaveToDB(); - } - else - { - if (targetName) - { - // Check for offline players - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_GUID_BY_NAME); - stmt->setString(0, name); - PreparedQueryResult result = CharacterDatabase.Query(stmt); - - if (!result) - { - handler->SendSysMessage(LANG_COMMAND_FREEZE_WRONG); - return true; - } - - // If player found: delete his freeze aura - Field* fields = result->Fetch(); - uint32 lowGuid = fields[0].GetUInt32(); - - stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_AURA_FROZEN); - stmt->setUInt32(0, lowGuid); - CharacterDatabase.Execute(stmt); - - handler->PSendSysMessage(LANG_COMMAND_UNFREEZE, name.c_str()); - return true; - } - else - { - handler->SendSysMessage(LANG_COMMAND_FREEZE_WRONG); - return true; - } - } - - return true; - } - - static bool HandleListFreezeCommand(ChatHandler* handler, char const* /*args*/) - { - // Get names from DB - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_AURA_FROZEN); - PreparedQueryResult result = CharacterDatabase.Query(stmt); - if (!result) - { - handler->SendSysMessage(LANG_COMMAND_NO_FROZEN_PLAYERS); - return true; - } - - // Header of the names - handler->PSendSysMessage(LANG_COMMAND_LIST_FREEZE); - - // Output of the results - do - { - Field* fields = result->Fetch(); - std::string player = fields[0].GetString(); - handler->PSendSysMessage(LANG_COMMAND_FROZEN_PLAYERS, player.c_str()); - } - while (result->NextRow()); - - return true; - } - - static bool HandleGroupLeaderCommand(ChatHandler* handler, char const* args) - { - Player* player = NULL; - Group* group = NULL; - uint64 guid = 0; - char* nameStr = strtok((char*)args, " "); - - if (handler->GetPlayerGroupAndGUIDByName(nameStr, player, group, guid)) - if (group && group->GetLeaderGUID() != guid) - { - group->ChangeLeader(guid); - group->SendUpdate(); - } - - return true; - } - - static bool HandleGroupDisbandCommand(ChatHandler* handler, char const* args) - { - Player* player = NULL; - Group* group = NULL; - uint64 guid = 0; - char* nameStr = strtok((char*)args, " "); - - if (handler->GetPlayerGroupAndGUIDByName(nameStr, player, group, guid)) - if (group) - group->Disband(); - - return true; - } - - static bool HandleGroupRemoveCommand(ChatHandler* handler, char const* args) - { - Player* player = NULL; - Group* group = NULL; - uint64 guid = 0; - char* nameStr = strtok((char*)args, " "); - - if (handler->GetPlayerGroupAndGUIDByName(nameStr, player, group, guid, true)) - if (group) - group->RemoveMember(guid); - - return true; - } - - static bool HandlePlayAllCommand(ChatHandler* handler, char const* args) - { - if (!*args) - return false; - - uint32 soundId = atoi((char*)args); - - if (!sSoundEntriesStore.LookupEntry(soundId)) - { - handler->PSendSysMessage(LANG_SOUND_NOT_EXIST, soundId); - handler->SetSentErrorMessage(true); - return false; - } - - WorldPacket data(SMSG_PLAY_SOUND, 4); - data << uint32(soundId) << handler->GetSession()->GetPlayer()->GetGUID(); - sWorld->SendGlobalMessage(&data); - - handler->PSendSysMessage(LANG_COMMAND_PLAYED_TO_ALL, soundId); - return true; - } - - static bool HandlePossessCommand(ChatHandler* handler, char const* /*args*/) - { - Unit* unit = handler->getSelectedUnit(); - if (!unit) - return false; - - handler->GetSession()->GetPlayer()->CastSpell(unit, 530, true); - return true; - } - - static bool HandleUnPossessCommand(ChatHandler* handler, char const* /*args*/) - { - Unit* unit = handler->getSelectedUnit(); - if (!unit) - unit = handler->GetSession()->GetPlayer(); - - unit->RemoveCharmAuras(); - - return true; - } - - static bool HandleBindSightCommand(ChatHandler* handler, char const* /*args*/) - { - Unit* unit = handler->getSelectedUnit(); - if (!unit) - return false; - - handler->GetSession()->GetPlayer()->CastSpell(unit, 6277, true); - return true; - } - - static bool HandleUnbindSightCommand(ChatHandler* handler, char const* /*args*/) - { - Player* player = handler->GetSession()->GetPlayer(); - - if (player->isPossessing()) - return false; - - player->StopCastingBindSight(); - return true; - } -}; - -void AddSC_misc_commandscript() -{ - new misc_commandscript(); -} +/* + * Copyright (C) 2008-2012 TrinityCore + * + * 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; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; 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, see . + */ + +#include "Chat.h" +#include "ScriptMgr.h" +#include "AccountMgr.h" +#include "ArenaTeamMgr.h" +#include "CellImpl.h" +#include "GridNotifiers.h" +#include "Group.h" +#include "InstanceSaveMgr.h" +#include "MovementGenerator.h" +#include "ObjectAccessor.h" +#include "SpellAuras.h" +#include "TargetedMovementGenerator.h" +#include "WeatherMgr.h" +#include "ace/INET_Addr.h" + +class misc_commandscript : public CommandScript +{ +public: + misc_commandscript() : CommandScript("misc_commandscript") { } + + ChatCommand* GetCommands() const + { + static ChatCommand groupCommandTable[] = + { + { "leader", SEC_ADMINISTRATOR, false, &HandleGroupLeaderCommand, "", NULL }, + { "disband", SEC_ADMINISTRATOR, false, &HandleGroupDisbandCommand, "", NULL }, + { "remove", SEC_ADMINISTRATOR, false, &HandleGroupRemoveCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } + }; + static ChatCommand petCommandTable[] = + { + { "create", SEC_GAMEMASTER, false, &HandleCreatePetCommand, "", NULL }, + { "learn", SEC_GAMEMASTER, false, &HandlePetLearnCommand, "", NULL }, + { "unlearn", SEC_GAMEMASTER, false, &HandlePetUnlearnCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } + }; + static ChatCommand sendCommandTable[] = + { + { "items", SEC_ADMINISTRATOR, true, &HandleSendItemsCommand, "", NULL }, + { "mail", SEC_MODERATOR, true, &HandleSendMailCommand, "", NULL }, + { "message", SEC_ADMINISTRATOR, true, &HandleSendMessageCommand, "", NULL }, + { "money", SEC_ADMINISTRATOR, true, &HandleSendMoneyCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } + }; + static ChatCommand commandTable[] = + { + { "dev", SEC_ADMINISTRATOR, false, &HandleDevCommand, "", NULL }, + { "gps", SEC_ADMINISTRATOR, false, &HandleGPSCommand, "", NULL }, + { "aura", SEC_ADMINISTRATOR, false, &HandleAuraCommand, "", NULL }, + { "unaura", SEC_ADMINISTRATOR, false, &HandleUnAuraCommand, "", NULL }, + { "appear", SEC_MODERATOR, false, &HandleAppearCommand, "", NULL }, + { "summon", SEC_MODERATOR, false, &HandleSummonCommand, "", NULL }, + { "groupsummon", SEC_MODERATOR, false, &HandleGroupSummonCommand, "", NULL }, + { "commands", SEC_PLAYER, true, &HandleCommandsCommand, "", NULL }, + { "die", SEC_ADMINISTRATOR, false, &HandleDieCommand, "", NULL }, + { "revive", SEC_ADMINISTRATOR, true, &HandleReviveCommand, "", NULL }, + { "dismount", SEC_PLAYER, false, &HandleDismountCommand, "", NULL }, + { "guid", SEC_GAMEMASTER, false, &HandleGUIDCommand, "", NULL }, + { "help", SEC_PLAYER, true, &HandleHelpCommand, "", NULL }, + { "itemmove", SEC_GAMEMASTER, false, &HandleItemMoveCommand, "", NULL }, + { "cooldown", SEC_ADMINISTRATOR, false, &HandleCooldownCommand, "", NULL }, + { "distance", SEC_ADMINISTRATOR, false, &HandleGetDistanceCommand, "", NULL }, + { "recall", SEC_MODERATOR, false, &HandleRecallCommand, "", NULL }, + { "save", SEC_PLAYER, false, &HandleSaveCommand, "", NULL }, + { "saveall", SEC_MODERATOR, true, &HandleSaveAllCommand, "", NULL }, + { "kick", SEC_GAMEMASTER, true, &HandleKickPlayerCommand, "", NULL }, + { "start", SEC_PLAYER, false, &HandleStartCommand, "", NULL }, + { "taxicheat", SEC_MODERATOR, false, &HandleTaxiCheatCommand, "", NULL }, + { "linkgrave", SEC_ADMINISTRATOR, false, &HandleLinkGraveCommand, "", NULL }, + { "neargrave", SEC_ADMINISTRATOR, false, &HandleNearGraveCommand, "", NULL }, + { "explorecheat", SEC_ADMINISTRATOR, false, &HandleExploreCheatCommand, "", NULL }, + { "showarea", SEC_ADMINISTRATOR, false, &HandleShowAreaCommand, "", NULL }, + { "hidearea", SEC_ADMINISTRATOR, false, &HandleHideAreaCommand, "", NULL }, + { "additem", SEC_ADMINISTRATOR, false, &HandleAddItemCommand, "", NULL }, + { "additemset", SEC_ADMINISTRATOR, false, &HandleAddItemSetCommand, "", NULL }, + { "bank", SEC_ADMINISTRATOR, false, &HandleBankCommand, "", NULL }, + { "wchange", SEC_ADMINISTRATOR, false, &HandleChangeWeather, "", NULL }, + { "maxskill", SEC_ADMINISTRATOR, false, &HandleMaxSkillCommand, "", NULL }, + { "setskill", SEC_ADMINISTRATOR, false, &HandleSetSkillCommand, "", NULL }, + { "pinfo", SEC_GAMEMASTER, true, &HandlePInfoCommand, "", NULL }, + { "respawn", SEC_ADMINISTRATOR, false, &HandleRespawnCommand, "", NULL }, + { "send", SEC_MODERATOR, true, NULL, "", sendCommandTable }, + { "pet", SEC_GAMEMASTER, false, NULL, "", petCommandTable }, + { "mute", SEC_MODERATOR, true, &HandleMuteCommand, "", NULL }, + { "unmute", SEC_MODERATOR, true, &HandleUnmuteCommand, "", NULL }, + { "movegens", SEC_ADMINISTRATOR, false, &HandleMovegensCommand, "", NULL }, + { "cometome", SEC_ADMINISTRATOR, false, &HandleComeToMeCommand, "", NULL }, + { "damage", SEC_ADMINISTRATOR, false, &HandleDamageCommand, "", NULL }, + { "combatstop", SEC_GAMEMASTER, true, &HandleCombatStopCommand, "", NULL }, + { "flusharenapoints", SEC_ADMINISTRATOR, false, &HandleFlushArenaPointsCommand, "", NULL }, + { "repairitems", SEC_GAMEMASTER, true, &HandleRepairitemsCommand, "", NULL }, + { "waterwalk", SEC_GAMEMASTER, false, &HandleWaterwalkCommand, "", NULL }, + { "freeze", SEC_MODERATOR, false, &HandleFreezeCommand, "", NULL }, + { "unfreeze", SEC_MODERATOR, false, &HandleUnFreezeCommand, "", NULL }, + { "listfreeze", SEC_MODERATOR, false, &HandleListFreezeCommand, "", NULL }, + { "group", SEC_ADMINISTRATOR, false, NULL, "", groupCommandTable }, + { "possess", SEC_ADMINISTRATOR, false, HandlePossessCommand, "", NULL }, + { "unpossess", SEC_ADMINISTRATOR, false, HandleUnPossessCommand, "", NULL }, + { "bindsight", SEC_ADMINISTRATOR, false, HandleBindSightCommand, "", NULL }, + { "unbindsight", SEC_ADMINISTRATOR, false, HandleUnbindSightCommand, "", NULL }, + { "playall", SEC_GAMEMASTER, false, HandlePlayAllCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } + }; + return commandTable; + } + + static bool HandleDevCommand(ChatHandler* handler, char const* args) + { + if (!*args) + { + if (handler->GetSession()->GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_DEVELOPER)) + handler->GetSession()->SendNotification(LANG_DEV_ON); + else + handler->GetSession()->SendNotification(LANG_DEV_OFF); + return true; + } + + std::string argstr = (char*)args; + + if (argstr == "on") + { + handler->GetSession()->GetPlayer()->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_DEVELOPER); + handler->GetSession()->SendNotification(LANG_DEV_ON); + return true; + } + + if (argstr == "off") + { + handler->GetSession()->GetPlayer()->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_DEVELOPER); + handler->GetSession()->SendNotification(LANG_DEV_OFF); + return true; + } + + handler->SendSysMessage(LANG_USE_BOL); + handler->SetSentErrorMessage(true); + return false; + } + + static bool HandleGPSCommand(ChatHandler* handler, char const* args) + { + WorldObject* object = NULL; + if (*args) + { + uint64 guid = handler->extractGuidFromLink((char*)args); + if (guid) + object = (WorldObject*)ObjectAccessor::GetObjectByTypeMask(*handler->GetSession()->GetPlayer(), guid, TYPEMASK_UNIT | TYPEMASK_GAMEOBJECT); + + if (!object) + { + handler->SendSysMessage(LANG_PLAYER_NOT_FOUND); + handler->SetSentErrorMessage(true); + return false; + } + } + else + { + object = handler->getSelectedUnit(); + + if (!object) + { + handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE); + handler->SetSentErrorMessage(true); + return false; + } + } + + CellCoord cellCoord = Trinity::ComputeCellCoord(object->GetPositionX(), object->GetPositionY()); + Cell cell(cellCoord); + + uint32 zoneId, areaId; + object->GetZoneAndAreaId(zoneId, areaId); + + MapEntry const* mapEntry = sMapStore.LookupEntry(object->GetMapId()); + AreaTableEntry const* zoneEntry = GetAreaEntryByAreaID(zoneId); + AreaTableEntry const* areaEntry = GetAreaEntryByAreaID(areaId); + + float zoneX = object->GetPositionX(); + float zoneY = object->GetPositionY(); + + Map2ZoneCoordinates(zoneX, zoneY, zoneId); + + Map const* map = object->GetMap(); + float groundZ = map->GetHeight(object->GetPhaseMask(), object->GetPositionX(), object->GetPositionY(), MAX_HEIGHT); + float floorZ = map->GetHeight(object->GetPhaseMask(), object->GetPositionX(), object->GetPositionY(), object->GetPositionZ()); + + GridCoord gridCoord = Trinity::ComputeGridCoord(object->GetPositionX(), object->GetPositionY()); + + // 63? WHY? + int gridX = 63 - gridCoord.x_coord; + int gridY = 63 - gridCoord.y_coord; + + uint32 haveMap = Map::ExistMap(object->GetMapId(), gridX, gridY) ? 1 : 0; + uint32 haveVMap = Map::ExistVMap(object->GetMapId(), gridX, gridY) ? 1 : 0; + + if (haveVMap) + { + if (map->IsOutdoors(object->GetPositionX(), object->GetPositionY(), object->GetPositionZ())) + handler->PSendSysMessage("You are outdoors"); + else + handler->PSendSysMessage("You are indoors"); + } + else + handler->PSendSysMessage("no VMAP available for area info"); + + handler->PSendSysMessage(LANG_MAP_POSITION, + object->GetMapId(), (mapEntry ? mapEntry->name : ""), + zoneId, (zoneEntry ? zoneEntry->area_name : ""), + areaId, (areaEntry ? areaEntry->area_name : ""), + object->GetPhaseMask(), + object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), object->GetOrientation(), + cell.GridX(), cell.GridY(), cell.CellX(), cell.CellY(), object->GetInstanceId(), + zoneX, zoneY, groundZ, floorZ, haveMap, haveVMap); + + LiquidData liquidStatus; + ZLiquidStatus status = map->getLiquidStatus(object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), MAP_ALL_LIQUIDS, &liquidStatus); + + if (status) + handler->PSendSysMessage(LANG_LIQUID_STATUS, liquidStatus.level, liquidStatus.depth_level, liquidStatus.entry, liquidStatus.type_flags, status); + + return true; + } + + static bool HandleAuraCommand(ChatHandler* handler, char const* args) + { + Unit* target = handler->getSelectedUnit(); + if (!target) + { + handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE); + handler->SetSentErrorMessage(true); + return false; + } + + // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form + uint32 spellId = handler->extractSpellIdFromLink((char*)args); + + if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId)) + Aura::TryRefreshStackOrCreate(spellInfo, MAX_EFFECT_MASK, target, target); + + return true; + } + + static bool HandleUnAuraCommand(ChatHandler* handler, char const* args) + { + Unit* target = handler->getSelectedUnit(); + if (!target) + { + handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE); + handler->SetSentErrorMessage(true); + return false; + } + + std::string argstr = args; + if (argstr == "all") + { + target->RemoveAllAuras(); + return true; + } + + // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form + uint32 spellId = handler->extractSpellIdFromLink((char*)args); + if (!spellId) + return false; + + target->RemoveAurasDueToSpell(spellId); + + return true; + } + // Teleport to Player + static bool HandleAppearCommand(ChatHandler* handler, char const* args) + { + Player* target; + uint64 targetGuid; + std::string targetName; + if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName)) + return false; + + Player* _player = handler->GetSession()->GetPlayer(); + if (target == _player || targetGuid == _player->GetGUID()) + { + handler->SendSysMessage(LANG_CANT_TELEPORT_SELF); + handler->SetSentErrorMessage(true); + return false; + } + + if (target) + { + // check online security + if (handler->HasLowerSecurity(target, 0)) + return false; + + std::string chrNameLink = handler->playerLink(targetName); + + Map* map = target->GetMap(); + if (map->IsBattlegroundOrArena()) + { + // only allow if gm mode is on + if (!_player->isGameMaster()) + { + handler->PSendSysMessage(LANG_CANNOT_GO_TO_BG_GM, chrNameLink.c_str()); + handler->SetSentErrorMessage(true); + return false; + } + // if both players are in different bgs + else if (_player->GetBattlegroundId() && _player->GetBattlegroundId() != target->GetBattlegroundId()) + _player->LeaveBattleground(false); // Note: should be changed so _player gets no Deserter debuff + + // all's well, set bg id + // when porting out from the bg, it will be reset to 0 + _player->SetBattlegroundId(target->GetBattlegroundId(), target->GetBattlegroundTypeId()); + // remember current position as entry point for return at bg end teleportation + if (!_player->GetMap()->IsBattlegroundOrArena()) + _player->SetBattlegroundEntryPoint(); + } + else if (map->IsDungeon()) + { + // we have to go to instance, and can go to player only if: + // 1) we are in his group (either as leader or as member) + // 2) we are not bound to any group and have GM mode on + if (_player->GetGroup()) + { + // we are in group, we can go only if we are in the player group + if (_player->GetGroup() != target->GetGroup()) + { + handler->PSendSysMessage(LANG_CANNOT_GO_TO_INST_PARTY, chrNameLink.c_str()); + handler->SetSentErrorMessage(true); + return false; + } + } + else + { + // we are not in group, let's verify our GM mode + if (!_player->isGameMaster()) + { + handler->PSendSysMessage(LANG_CANNOT_GO_TO_INST_GM, chrNameLink.c_str()); + handler->SetSentErrorMessage(true); + return false; + } + } + + // if the player or the player's group is bound to another instance + // the player will not be bound to another one + InstancePlayerBind* bind = _player->GetBoundInstance(target->GetMapId(), target->GetDifficulty(map->IsRaid())); + if (!bind) + { + Group* group = _player->GetGroup(); + // if no bind exists, create a solo bind + InstanceGroupBind* gBind = group ? group->GetBoundInstance(target) : NULL; // if no bind exists, create a solo bind + if (!gBind) + if (InstanceSave* save = sInstanceSaveMgr->GetInstanceSave(target->GetInstanceId())) + _player->BindToInstance(save, !save->CanReset()); + } + + if (map->IsRaid()) + _player->SetRaidDifficulty(target->GetRaidDifficulty()); + else + _player->SetDungeonDifficulty(target->GetDungeonDifficulty()); + } + + handler->PSendSysMessage(LANG_APPEARING_AT, chrNameLink.c_str()); + + // stop flight if need + if (_player->isInFlight()) + { + _player->GetMotionMaster()->MovementExpired(); + _player->CleanupAfterTaxiFlight(); + } + // save only in non-flight case + else + _player->SaveRecallPosition(); + + // to point to see at target with same orientation + float x, y, z; + target->GetContactPoint(_player, x, y, z); + + _player->TeleportTo(target->GetMapId(), x, y, z, _player->GetAngle(target), TELE_TO_GM_MODE); + _player->SetPhaseMask(target->GetPhaseMask(), true); + } + else + { + // check offline security + if (handler->HasLowerSecurity(NULL, targetGuid)) + return false; + + std::string nameLink = handler->playerLink(targetName); + + handler->PSendSysMessage(LANG_APPEARING_AT, nameLink.c_str()); + + // to point where player stay (if loaded) + float x, y, z, o; + uint32 map; + bool in_flight; + if (!Player::LoadPositionFromDB(map, x, y, z, o, in_flight, targetGuid)) + return false; + + // stop flight if need + if (_player->isInFlight()) + { + _player->GetMotionMaster()->MovementExpired(); + _player->CleanupAfterTaxiFlight(); + } + // save only in non-flight case + else + _player->SaveRecallPosition(); + + _player->TeleportTo(map, x, y, z, _player->GetOrientation()); + } + + return true; + } + // Summon Player + static bool HandleSummonCommand(ChatHandler* handler, char const* args) + { + Player* target; + uint64 targetGuid; + std::string targetName; + if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName)) + return false; + + Player* _player = handler->GetSession()->GetPlayer(); + if (target == _player || targetGuid == _player->GetGUID()) + { + handler->PSendSysMessage(LANG_CANT_TELEPORT_SELF); + handler->SetSentErrorMessage(true); + return false; + } + + if (target) + { + std::string nameLink = handler->playerLink(targetName); + // check online security + if (handler->HasLowerSecurity(target, 0)) + return false; + + if (target->IsBeingTeleported()) + { + handler->PSendSysMessage(LANG_IS_TELEPORTED, nameLink.c_str()); + handler->SetSentErrorMessage(true); + return false; + } + + Map* map = handler->GetSession()->GetPlayer()->GetMap(); + + if (map->IsBattlegroundOrArena()) + { + // only allow if gm mode is on + if (!_player->isGameMaster()) + { + handler->PSendSysMessage(LANG_CANNOT_GO_TO_BG_GM, nameLink.c_str()); + handler->SetSentErrorMessage(true); + return false; + } + // if both players are in different bgs + else if (target->GetBattlegroundId() && handler->GetSession()->GetPlayer()->GetBattlegroundId() != target->GetBattlegroundId()) + target->LeaveBattleground(false); // Note: should be changed so target gets no Deserter debuff + + // all's well, set bg id + // when porting out from the bg, it will be reset to 0 + target->SetBattlegroundId(handler->GetSession()->GetPlayer()->GetBattlegroundId(), handler->GetSession()->GetPlayer()->GetBattlegroundTypeId()); + // remember current position as entry point for return at bg end teleportation + if (!target->GetMap()->IsBattlegroundOrArena()) + target->SetBattlegroundEntryPoint(); + } + else if (map->IsDungeon()) + { + Map* map = target->GetMap(); + + if (map->Instanceable() && map->GetInstanceId() != map->GetInstanceId()) + target->UnbindInstance(map->GetInstanceId(), target->GetDungeonDifficulty(), true); + + // we are in instance, and can summon only player in our group with us as lead + if (!handler->GetSession()->GetPlayer()->GetGroup() || !target->GetGroup() || + (target->GetGroup()->GetLeaderGUID() != handler->GetSession()->GetPlayer()->GetGUID()) || + (handler->GetSession()->GetPlayer()->GetGroup()->GetLeaderGUID() != handler->GetSession()->GetPlayer()->GetGUID())) + // the last check is a bit excessive, but let it be, just in case + { + handler->PSendSysMessage(LANG_CANNOT_SUMMON_TO_INST, nameLink.c_str()); + handler->SetSentErrorMessage(true); + return false; + } + } + + handler->PSendSysMessage(LANG_SUMMONING, nameLink.c_str(), ""); + if (handler->needReportToTarget(target)) + ChatHandler(target).PSendSysMessage(LANG_SUMMONED_BY, handler->playerLink(_player->GetName()).c_str()); + + // stop flight if need + if (target->isInFlight()) + { + target->GetMotionMaster()->MovementExpired(); + target->CleanupAfterTaxiFlight(); + } + // save only in non-flight case + else + target->SaveRecallPosition(); + + // before GM + float x, y, z; + handler->GetSession()->GetPlayer()->GetClosePoint(x, y, z, target->GetObjectSize()); + target->TeleportTo(handler->GetSession()->GetPlayer()->GetMapId(), x, y, z, target->GetOrientation()); + target->SetPhaseMask(handler->GetSession()->GetPlayer()->GetPhaseMask(), true); + } + else + { + // check offline security + if (handler->HasLowerSecurity(NULL, targetGuid)) + return false; + + std::string nameLink = handler->playerLink(targetName); + + handler->PSendSysMessage(LANG_SUMMONING, nameLink.c_str(), handler->GetTrinityString(LANG_OFFLINE)); + + // in point where GM stay + Player::SavePositionInDB(handler->GetSession()->GetPlayer()->GetMapId(), + handler->GetSession()->GetPlayer()->GetPositionX(), + handler->GetSession()->GetPlayer()->GetPositionY(), + handler->GetSession()->GetPlayer()->GetPositionZ(), + handler->GetSession()->GetPlayer()->GetOrientation(), + handler->GetSession()->GetPlayer()->GetZoneId(), + targetGuid); + } + + return true; + } + // Summon group of player + static bool HandleGroupSummonCommand(ChatHandler* handler, char const* args) + { + Player* target; + if (!handler->extractPlayerTarget((char*)args, &target)) + return false; + + // check online security + if (handler->HasLowerSecurity(target, 0)) + return false; + + Group* group = target->GetGroup(); + + std::string nameLink = handler->GetNameLink(target); + + if (!group) + { + handler->PSendSysMessage(LANG_NOT_IN_GROUP, nameLink.c_str()); + handler->SetSentErrorMessage(true); + return false; + } + + Map* gmMap = handler->GetSession()->GetPlayer()->GetMap(); + bool toInstance = gmMap->Instanceable(); + + // we are in instance, and can summon only player in our group with us as lead + if (toInstance && ( + !handler->GetSession()->GetPlayer()->GetGroup() || (group->GetLeaderGUID() != handler->GetSession()->GetPlayer()->GetGUID()) || + (handler->GetSession()->GetPlayer()->GetGroup()->GetLeaderGUID() != handler->GetSession()->GetPlayer()->GetGUID()))) + // the last check is a bit excessive, but let it be, just in case + { + handler->SendSysMessage(LANG_CANNOT_SUMMON_TO_INST); + handler->SetSentErrorMessage(true); + return false; + } + + for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) + { + Player* player = itr->getSource(); + + if (!player || player == handler->GetSession()->GetPlayer() || !player->GetSession()) + continue; + + // check online security + if (handler->HasLowerSecurity(player, 0)) + return false; + + std::string plNameLink = handler->GetNameLink(player); + + if (player->IsBeingTeleported() == true) + { + handler->PSendSysMessage(LANG_IS_TELEPORTED, plNameLink.c_str()); + handler->SetSentErrorMessage(true); + return false; + } + + if (toInstance) + { + Map* playerMap = player->GetMap(); + + if (playerMap->Instanceable() && playerMap->GetInstanceId() != gmMap->GetInstanceId()) + { + // cannot summon from instance to instance + handler->PSendSysMessage(LANG_CANNOT_SUMMON_TO_INST, plNameLink.c_str()); + handler->SetSentErrorMessage(true); + return false; + } + } + + handler->PSendSysMessage(LANG_SUMMONING, plNameLink.c_str(), ""); + if (handler->needReportToTarget(player)) + ChatHandler(player).PSendSysMessage(LANG_SUMMONED_BY, handler->GetNameLink().c_str()); + + // stop flight if need + if (player->isInFlight()) + { + player->GetMotionMaster()->MovementExpired(); + player->CleanupAfterTaxiFlight(); + } + // save only in non-flight case + else + player->SaveRecallPosition(); + + // before GM + float x, y, z; + handler->GetSession()->GetPlayer()->GetClosePoint(x, y, z, player->GetObjectSize()); + player->TeleportTo(handler->GetSession()->GetPlayer()->GetMapId(), x, y, z, player->GetOrientation()); + } + + return true; + } + + static bool HandleCommandsCommand(ChatHandler* handler, char const* /*args*/) + { + handler->ShowHelpForCommand(handler->getCommandTable(), ""); + return true; + } + + static bool HandleDieCommand(ChatHandler* handler, char const* /*args*/) + { + Unit* target = handler->getSelectedUnit(); + + if (!target || !handler->GetSession()->GetPlayer()->GetSelection()) + { + handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE); + handler->SetSentErrorMessage(true); + return false; + } + + if (target->GetTypeId() == TYPEID_PLAYER) + { + if (handler->HasLowerSecurity((Player*)target, 0, false)) + return false; + } + + if (target->isAlive()) + { + if (sWorld->getBoolConfig(CONFIG_DIE_COMMAND_MODE)) + handler->GetSession()->GetPlayer()->Kill(target); + else + handler->GetSession()->GetPlayer()->DealDamage(target, target->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + + return true; + } + + static bool HandleReviveCommand(ChatHandler* handler, char const* args) + { + Player* target; + uint64 targetGuid; + if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid)) + return false; + + if (target) + { + target->ResurrectPlayer(!AccountMgr::IsPlayerAccount(target->GetSession()->GetSecurity()) ? 1.0f : 0.5f); + target->SpawnCorpseBones(); + target->SaveToDB(); + } + else + // will resurrected at login without corpse + sObjectAccessor->ConvertCorpseForPlayer(targetGuid); + + return true; + } + + static bool HandleDismountCommand(ChatHandler* handler, char const* /*args*/) + { + Player* player = handler->GetSession()->GetPlayer(); + + // If player is not mounted, so go out :) + if (!player->IsMounted()) + { + handler->SendSysMessage(LANG_CHAR_NON_MOUNTED); + handler->SetSentErrorMessage(true); + return false; + } + + if (player->isInFlight()) + { + handler->SendSysMessage(LANG_YOU_IN_FLIGHT); + handler->SetSentErrorMessage(true); + return false; + } + + player->Dismount(); + player->RemoveAurasByType(SPELL_AURA_MOUNTED); + return true; + } + + static bool HandleGUIDCommand(ChatHandler* handler, char const* /*args*/) + { + uint64 guid = handler->GetSession()->GetPlayer()->GetSelection(); + + if (guid == 0) + { + handler->SendSysMessage(LANG_NO_SELECTION); + handler->SetSentErrorMessage(true); + return false; + } + + handler->PSendSysMessage(LANG_OBJECT_GUID, GUID_LOPART(guid), GUID_HIPART(guid)); + return true; + } + + static bool HandleHelpCommand(ChatHandler* handler, char const* args) + { + char const* cmd = strtok((char*)args, " "); + if (!cmd) + { + handler->ShowHelpForCommand(handler->getCommandTable(), "help"); + handler->ShowHelpForCommand(handler->getCommandTable(), ""); + } + else + { + if (!handler->ShowHelpForCommand(handler->getCommandTable(), cmd)) + handler->SendSysMessage(LANG_NO_HELP_CMD); + } + + return true; + } + // move item to other slot + static bool HandleItemMoveCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + char const* param1 = strtok((char*)args, " "); + if (!param1) + return false; + + char const* param2 = strtok(NULL, " "); + if (!param2) + return false; + + uint8 srcSlot = uint8(atoi(param1)); + uint8 dstSlot = uint8(atoi(param2)); + + if (srcSlot == dstSlot) + return true; + + if (!handler->GetSession()->GetPlayer()->IsValidPos(INVENTORY_SLOT_BAG_0, srcSlot, true)) + return false; + + if (!handler->GetSession()->GetPlayer()->IsValidPos(INVENTORY_SLOT_BAG_0, dstSlot, false)) + return false; + + uint16 src = ((INVENTORY_SLOT_BAG_0 << 8) | srcSlot); + uint16 dst = ((INVENTORY_SLOT_BAG_0 << 8) | dstSlot); + + handler->GetSession()->GetPlayer()->SwapItem(src, dst); + + return true; + } + + static bool HandleCooldownCommand(ChatHandler* handler, char const* args) + { + Player* target = handler->getSelectedPlayer(); + if (!target) + { + handler->SendSysMessage(LANG_PLAYER_NOT_FOUND); + handler->SetSentErrorMessage(true); + return false; + } + + std::string nameLink = handler->GetNameLink(target); + + if (!*args) + { + target->RemoveAllSpellCooldown(); + handler->PSendSysMessage(LANG_REMOVEALL_COOLDOWN, nameLink.c_str()); + } + else + { + // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form + uint32 spellIid = handler->extractSpellIdFromLink((char*)args); + if (!spellIid) + return false; + + if (!sSpellMgr->GetSpellInfo(spellIid)) + { + handler->PSendSysMessage(LANG_UNKNOWN_SPELL, target == handler->GetSession()->GetPlayer() ? handler->GetTrinityString(LANG_YOU) : nameLink.c_str()); + handler->SetSentErrorMessage(true); + return false; + } + + target->RemoveSpellCooldown(spellIid, true); + handler->PSendSysMessage(LANG_REMOVE_COOLDOWN, spellIid, target == handler->GetSession()->GetPlayer() ? handler->GetTrinityString(LANG_YOU) : nameLink.c_str()); + } + return true; + } + + static bool HandleGetDistanceCommand(ChatHandler* handler, char const* args) + { + WorldObject* obj = NULL; + + if (*args) + { + uint64 guid = handler->extractGuidFromLink((char*)args); + if (guid) + obj = (WorldObject*)ObjectAccessor::GetObjectByTypeMask(*handler->GetSession()->GetPlayer(), guid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT); + + if (!obj) + { + handler->SendSysMessage(LANG_PLAYER_NOT_FOUND); + handler->SetSentErrorMessage(true); + return false; + } + } + else + { + obj = handler->getSelectedUnit(); + + if (!obj) + { + handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE); + handler->SetSentErrorMessage(true); + return false; + } + } + + handler->PSendSysMessage(LANG_DISTANCE, handler->GetSession()->GetPlayer()->GetDistance(obj), handler->GetSession()->GetPlayer()->GetDistance2d(obj), handler->GetSession()->GetPlayer()->GetExactDist(obj), handler->GetSession()->GetPlayer()->GetExactDist2d(obj)); + return true; + } + // Teleport player to last position + static bool HandleRecallCommand(ChatHandler* handler, char const* args) + { + Player* target; + if (!handler->extractPlayerTarget((char*)args, &target)) + return false; + + // check online security + if (handler->HasLowerSecurity(target, 0)) + return false; + + if (target->IsBeingTeleported()) + { + handler->PSendSysMessage(LANG_IS_TELEPORTED, handler->GetNameLink(target).c_str()); + handler->SetSentErrorMessage(true); + return false; + } + + // stop flight if need + if (target->isInFlight()) + { + target->GetMotionMaster()->MovementExpired(); + target->CleanupAfterTaxiFlight(); + } + + target->TeleportTo(target->m_recallMap, target->m_recallX, target->m_recallY, target->m_recallZ, target->m_recallO); + return true; + } + + static bool HandleSaveCommand(ChatHandler* handler, char const* /*args*/) + { + Player* player = handler->GetSession()->GetPlayer(); + + // save GM account without delay and output message + if (!AccountMgr::IsPlayerAccount(handler->GetSession()->GetSecurity())) + { + if (Player* target = handler->getSelectedPlayer()) + target->SaveToDB(); + else + player->SaveToDB(); + handler->SendSysMessage(LANG_PLAYER_SAVED); + return true; + } + + // save if the player has last been saved over 20 seconds ago + uint32 saveInterval = sWorld->getIntConfig(CONFIG_INTERVAL_SAVE); + if (saveInterval == 0 || (saveInterval > 20 * IN_MILLISECONDS && player->GetSaveTimer() <= saveInterval - 20 * IN_MILLISECONDS)) + player->SaveToDB(); + + return true; + } + + // Save all players in the world + static bool HandleSaveAllCommand(ChatHandler* handler, char const* /*args*/) + { + sObjectAccessor->SaveAllPlayers(); + handler->SendSysMessage(LANG_PLAYERS_SAVED); + return true; + } + + // kick player + static bool HandleKickPlayerCommand(ChatHandler* handler, char const* args) + { + Player* target = NULL; + std::string playerName; + if (!handler->extractPlayerTarget((char*)args, &target, NULL, &playerName)) + return false; + + if (handler->GetSession() && target == handler->GetSession()->GetPlayer()) + { + handler->SendSysMessage(LANG_COMMAND_KICKSELF); + handler->SetSentErrorMessage(true); + return false; + } + + // check online security + if (handler->HasLowerSecurity(target, 0)) + return false; + + if (sWorld->getBoolConfig(CONFIG_SHOW_KICK_IN_WORLD)) + sWorld->SendWorldText(LANG_COMMAND_KICKMESSAGE, playerName.c_str()); + else + handler->PSendSysMessage(LANG_COMMAND_KICKMESSAGE, playerName.c_str()); + + target->GetSession()->KickPlayer(); + + return true; + } + + static bool HandleStartCommand(ChatHandler* handler, char const* /*args*/) + { + Player* player = handler->GetSession()->GetPlayer(); + + if (player->isInFlight()) + { + handler->SendSysMessage(LANG_YOU_IN_FLIGHT); + handler->SetSentErrorMessage(true); + return false; + } + + if (player->isInCombat()) + { + handler->SendSysMessage(LANG_YOU_IN_COMBAT); + handler->SetSentErrorMessage(true); + return false; + } + + if (player->isDead() || player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST)) + { + // if player is dead and stuck, send ghost to graveyard + player->RepopAtGraveyard(); + return true; + } + + // cast spell Stuck + player->CastSpell(player, 7355, false); + return true; + } + // Enable on\off all taxi paths + static bool HandleTaxiCheatCommand(ChatHandler* handler, char const* args) + { + if (!*args) + { + handler->SendSysMessage(LANG_USE_BOL); + handler->SetSentErrorMessage(true); + return false; + } + + std::string argStr = (char*)args; + + Player* chr = handler->getSelectedPlayer(); + + if (!chr) + chr = handler->GetSession()->GetPlayer(); + else if (handler->HasLowerSecurity(chr, 0)) // check online security + return false; + + if (argStr == "on") + { + chr->SetTaxiCheater(true); + handler->PSendSysMessage(LANG_YOU_GIVE_TAXIS, handler->GetNameLink(chr).c_str()); + if (handler->needReportToTarget(chr)) + ChatHandler(chr).PSendSysMessage(LANG_YOURS_TAXIS_ADDED, handler->GetNameLink().c_str()); + return true; + } + + if (argStr == "off") + { + chr->SetTaxiCheater(false); + handler->PSendSysMessage(LANG_YOU_REMOVE_TAXIS, handler->GetNameLink(chr).c_str()); + if (handler->needReportToTarget(chr)) + ChatHandler(chr).PSendSysMessage(LANG_YOURS_TAXIS_REMOVED, handler->GetNameLink().c_str()); + + return true; + } + + handler->SendSysMessage(LANG_USE_BOL); + handler->SetSentErrorMessage(true); + + return false; + } + + static bool HandleLinkGraveCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + char* px = strtok((char*)args, " "); + if (!px) + return false; + + uint32 graveyardId = uint32(atoi(px)); + + uint32 team; + + char* px2 = strtok(NULL, " "); + + if (!px2) + team = 0; + else if (strncmp(px2, "horde", 6) == 0) + team = HORDE; + else if (strncmp(px2, "alliance", 9) == 0) + team = ALLIANCE; + else + return false; + + WorldSafeLocsEntry const* graveyard = sWorldSafeLocsStore.LookupEntry(graveyardId); + + if (!graveyard) + { + handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDNOEXIST, graveyardId); + handler->SetSentErrorMessage(true); + return false; + } + + Player* player = handler->GetSession()->GetPlayer(); + + uint32 zoneId = player->GetZoneId(); + + AreaTableEntry const* areaEntry = GetAreaEntryByAreaID(zoneId); + if (!areaEntry || areaEntry->zone !=0) + { + handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDWRONGZONE, graveyardId, zoneId); + handler->SetSentErrorMessage(true); + return false; + } + + if (sObjectMgr->AddGraveYardLink(graveyardId, zoneId, team)) + handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDLINKED, graveyardId, zoneId); + else + handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDALRLINKED, graveyardId, zoneId); + + return true; + } + + static bool HandleNearGraveCommand(ChatHandler* handler, char const* args) + { + uint32 team; + + size_t argStr = strlen(args); + + if (!*args) + team = 0; + else if (strncmp((char*)args, "horde", argStr) == 0) + team = HORDE; + else if (strncmp((char*)args, "alliance", argStr) == 0) + team = ALLIANCE; + else + return false; + + Player* player = handler->GetSession()->GetPlayer(); + uint32 zone_id = player->GetZoneId(); + + WorldSafeLocsEntry const* graveyard = sObjectMgr->GetClosestGraveYard( + player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetMapId(), team); + + if (graveyard) + { + uint32 graveyardId = graveyard->ID; + + GraveYardData const* data = sObjectMgr->FindGraveYardData(graveyardId, zone_id); + if (!data) + { + handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDERROR, graveyardId); + handler->SetSentErrorMessage(true); + return false; + } + + team = data->team; + + std::string team_name = handler->GetTrinityString(LANG_COMMAND_GRAVEYARD_NOTEAM); + + if (team == 0) + team_name = handler->GetTrinityString(LANG_COMMAND_GRAVEYARD_ANY); + else if (team == HORDE) + team_name = handler->GetTrinityString(LANG_COMMAND_GRAVEYARD_HORDE); + else if (team == ALLIANCE) + team_name = handler->GetTrinityString(LANG_COMMAND_GRAVEYARD_ALLIANCE); + + handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDNEAREST, graveyardId, team_name.c_str(), zone_id); + } + else + { + std::string team_name; + + if (team == 0) + team_name = handler->GetTrinityString(LANG_COMMAND_GRAVEYARD_ANY); + else if (team == HORDE) + team_name = handler->GetTrinityString(LANG_COMMAND_GRAVEYARD_HORDE); + else if (team == ALLIANCE) + team_name = handler->GetTrinityString(LANG_COMMAND_GRAVEYARD_ALLIANCE); + + if (team == ~uint32(0)) + handler->PSendSysMessage(LANG_COMMAND_ZONENOGRAVEYARDS, zone_id); + else + handler->PSendSysMessage(LANG_COMMAND_ZONENOGRAFACTION, zone_id, team_name.c_str()); + } + + return true; + } + + static bool HandleExploreCheatCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + int32 flag = int32(atoi((char*)args)); + + Player* playerTarget = handler->getSelectedPlayer(); + if (!playerTarget) + { + handler->SendSysMessage(LANG_NO_CHAR_SELECTED); + handler->SetSentErrorMessage(true); + return false; + } + + if (flag != 0) + { + handler->PSendSysMessage(LANG_YOU_SET_EXPLORE_ALL, handler->GetNameLink(playerTarget).c_str()); + if (handler->needReportToTarget(playerTarget)) + ChatHandler(playerTarget).PSendSysMessage(LANG_YOURS_EXPLORE_SET_ALL, handler->GetNameLink().c_str()); + } + else + { + handler->PSendSysMessage(LANG_YOU_SET_EXPLORE_NOTHING, handler->GetNameLink(playerTarget).c_str()); + if (handler->needReportToTarget(playerTarget)) + ChatHandler(playerTarget).PSendSysMessage(LANG_YOURS_EXPLORE_SET_NOTHING, handler->GetNameLink().c_str()); + } + + for (uint8 i = 0; i < PLAYER_EXPLORED_ZONES_SIZE; ++i) + { + if (flag != 0) + handler->GetSession()->GetPlayer()->SetFlag(PLAYER_EXPLORED_ZONES_1+i, 0xFFFFFFFF); + else + handler->GetSession()->GetPlayer()->SetFlag(PLAYER_EXPLORED_ZONES_1+i, 0); + } + + return true; + } + + static bool HandleShowAreaCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + Player* playerTarget = handler->getSelectedPlayer(); + if (!playerTarget) + { + handler->SendSysMessage(LANG_NO_CHAR_SELECTED); + handler->SetSentErrorMessage(true); + return false; + } + + int32 area = GetAreaFlagByAreaID(atoi((char*)args)); + int32 offset = area / 32; + uint32 val = uint32((1 << (area % 32))); + + if (area<0 || offset >= PLAYER_EXPLORED_ZONES_SIZE) + { + handler->SendSysMessage(LANG_BAD_VALUE); + handler->SetSentErrorMessage(true); + return false; + } + + uint32 currFields = playerTarget->GetUInt32Value(PLAYER_EXPLORED_ZONES_1 + offset); + playerTarget->SetUInt32Value(PLAYER_EXPLORED_ZONES_1 + offset, uint32((currFields | val))); + + handler->SendSysMessage(LANG_EXPLORE_AREA); + return true; + } + + static bool HandleHideAreaCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + Player* playerTarget = handler->getSelectedPlayer(); + if (!playerTarget) + { + handler->SendSysMessage(LANG_NO_CHAR_SELECTED); + handler->SetSentErrorMessage(true); + return false; + } + + int32 area = GetAreaFlagByAreaID(atoi((char*)args)); + int32 offset = area / 32; + uint32 val = uint32((1 << (area % 32))); + + if (area < 0 || offset >= PLAYER_EXPLORED_ZONES_SIZE) + { + handler->SendSysMessage(LANG_BAD_VALUE); + handler->SetSentErrorMessage(true); + return false; + } + + uint32 currFields = playerTarget->GetUInt32Value(PLAYER_EXPLORED_ZONES_1 + offset); + playerTarget->SetUInt32Value(PLAYER_EXPLORED_ZONES_1 + offset, uint32((currFields ^ val))); + + handler->SendSysMessage(LANG_UNEXPLORE_AREA); + return true; + } + + static bool HandleAddItemCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + uint32 itemId = 0; + + if (args[0] == '[') // [name] manual form + { + char const* itemNameStr = strtok((char*)args, "]"); + + if (itemNameStr && itemNameStr[0]) + { + std::string itemName = itemNameStr+1; + WorldDatabase.EscapeString(itemName); + + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_ITEM_TEMPLATE_BY_NAME); + stmt->setString(0, itemName); + PreparedQueryResult result = WorldDatabase.Query(stmt); + + if (!result) + { + handler->PSendSysMessage(LANG_COMMAND_COULDNOTFIND, itemNameStr+1); + handler->SetSentErrorMessage(true); + return false; + } + itemId = result->Fetch()->GetUInt32(); + } + else + return false; + } + else // item_id or [name] Shift-click form |color|Hitem:item_id:0:0:0|h[name]|h|r + { + char const* id = handler->extractKeyFromLink((char*)args, "Hitem"); + if (!id) + return false; + itemId = uint32(atol(id)); + } + + char const* ccount = strtok(NULL, " "); + + int32 count = 1; + + if (ccount) + count = strtol(ccount, NULL, 10); + + if (count == 0) + count = 1; + + Player* player = handler->GetSession()->GetPlayer(); + Player* playerTarget = handler->getSelectedPlayer(); + if (!playerTarget) + playerTarget = player; + + sLog->outDebug(LOG_FILTER_GENERAL, handler->GetTrinityString(LANG_ADDITEM), itemId, count); + + ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(itemId); + if (!itemTemplate) + { + handler->PSendSysMessage(LANG_COMMAND_ITEMIDINVALID, itemId); + handler->SetSentErrorMessage(true); + return false; + } + + // Subtract + if (count < 0) + { + playerTarget->DestroyItemCount(itemId, -count, true, false); + handler->PSendSysMessage(LANG_REMOVEITEM, itemId, -count, handler->GetNameLink(playerTarget).c_str()); + return true; + } + + // Adding items + uint32 noSpaceForCount = 0; + + // check space and find places + ItemPosCountVec dest; + InventoryResult msg = playerTarget->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemId, count, &noSpaceForCount); + if (msg != EQUIP_ERR_OK) // convert to possible store amount + count -= noSpaceForCount; + + if (count == 0 || dest.empty()) // can't add any + { + handler->PSendSysMessage(LANG_ITEM_CANNOT_CREATE, itemId, noSpaceForCount); + handler->SetSentErrorMessage(true); + return false; + } + + Item* item = playerTarget->StoreNewItem(dest, itemId, true, Item::GenerateItemRandomPropertyId(itemId)); + + // remove binding (let GM give it to another player later) + if (player == playerTarget) + for (ItemPosCountVec::const_iterator itr = dest.begin(); itr != dest.end(); ++itr) + if (Item* item1 = player->GetItemByPos(itr->pos)) + item1->SetBinding(false); + + if (count > 0 && item) + { + player->SendNewItem(item, count, false, true); + if (player != playerTarget) + playerTarget->SendNewItem(item, count, true, false); + } + + if (noSpaceForCount > 0) + handler->PSendSysMessage(LANG_ITEM_CANNOT_CREATE, itemId, noSpaceForCount); + + return true; + } + + static bool HandleAddItemSetCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + char const* id = handler->extractKeyFromLink((char*)args, "Hitemset"); // number or [name] Shift-click form |color|Hitemset:itemset_id|h[name]|h|r + if (!id) + return false; + + uint32 itemSetId = atol(id); + + // prevent generation all items with itemset field value '0' + if (itemSetId == 0) + { + handler->PSendSysMessage(LANG_NO_ITEMS_FROM_ITEMSET_FOUND, itemSetId); + handler->SetSentErrorMessage(true); + return false; + } + + Player* player = handler->GetSession()->GetPlayer(); + Player* playerTarget = handler->getSelectedPlayer(); + if (!playerTarget) + playerTarget = player; + + sLog->outDebug(LOG_FILTER_GENERAL, handler->GetTrinityString(LANG_ADDITEMSET), itemSetId); + + bool found = false; + ItemTemplateContainer const* its = sObjectMgr->GetItemTemplateStore(); + for (ItemTemplateContainer::const_iterator itr = its->begin(); itr != its->end(); ++itr) + { + if (itr->second.ItemSet == itemSetId) + { + found = true; + ItemPosCountVec dest; + InventoryResult msg = playerTarget->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itr->second.ItemId, 1); + if (msg == EQUIP_ERR_OK) + { + Item* item = playerTarget->StoreNewItem(dest, itr->second.ItemId, true); + + // remove binding (let GM give it to another player later) + if (player == playerTarget) + item->SetBinding(false); + + player->SendNewItem(item, 1, false, true); + if (player != playerTarget) + playerTarget->SendNewItem(item, 1, true, false); + } + else + { + player->SendEquipError(msg, NULL, NULL, itr->second.ItemId); + handler->PSendSysMessage(LANG_ITEM_CANNOT_CREATE, itr->second.ItemId, 1); + } + } + } + + if (!found) + { + handler->PSendSysMessage(LANG_NO_ITEMS_FROM_ITEMSET_FOUND, itemSetId); + handler->SetSentErrorMessage(true); + return false; + } + + return true; + } + + static bool HandleBankCommand(ChatHandler* handler, char const* /*args*/) + { + handler->GetSession()->SendShowBank(handler->GetSession()->GetPlayer()->GetGUID()); + return true; + } + + static bool HandleChangeWeather(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + // Weather is OFF + if (!sWorld->getBoolConfig(CONFIG_WEATHER)) + { + handler->SendSysMessage(LANG_WEATHER_DISABLED); + handler->SetSentErrorMessage(true); + return false; + } + + // *Change the weather of a cell + char const* px = strtok((char*)args, " "); + char const* py = strtok(NULL, " "); + + if (!px || !py) + return false; + + uint32 type = uint32(atoi(px)); //0 to 3, 0: fine, 1: rain, 2: snow, 3: sand + float grade = float(atof(py)); //0 to 1, sending -1 is instand good weather + + Player* player = handler->GetSession()->GetPlayer(); + uint32 zoneid = player->GetZoneId(); + + Weather* weather = WeatherMgr::FindWeather(zoneid); + + if (!weather) + weather = WeatherMgr::AddWeather(zoneid); + if (!weather) + { + handler->SendSysMessage(LANG_NO_WEATHER); + handler->SetSentErrorMessage(true); + return false; + } + + weather->SetWeather(WeatherType(type), grade); + + return true; + } + + + static bool HandleMaxSkillCommand(ChatHandler* handler, char const* /*args*/) + { + Player* SelectedPlayer = handler->getSelectedPlayer(); + if (!SelectedPlayer) + { + handler->SendSysMessage(LANG_NO_CHAR_SELECTED); + handler->SetSentErrorMessage(true); + return false; + } + + // each skills that have max skill value dependent from level seted to current level max skill value + SelectedPlayer->UpdateSkillsToMaxSkillsForLevel(); + return true; + } + + static bool HandleSetSkillCommand(ChatHandler* handler, char const* args) + { + // number or [name] Shift-click form |color|Hskill:skill_id|h[name]|h|r + char const* skillStr = handler->extractKeyFromLink((char*)args, "Hskill"); + if (!skillStr) + return false; + + char const* levelStr = strtok(NULL, " "); + if (!levelStr) + return false; + + char const* maxPureSkill = strtok(NULL, " "); + + int32 skill = atoi(skillStr); + if (skill <= 0) + { + handler->PSendSysMessage(LANG_INVALID_SKILL_ID, skill); + handler->SetSentErrorMessage(true); + return false; + } + + int32 level = uint32(atol(levelStr)); + + Player* target = handler->getSelectedPlayer(); + if (!target) + { + handler->SendSysMessage(LANG_NO_CHAR_SELECTED); + handler->SetSentErrorMessage(true); + return false; + } + + SkillLineEntry const* skillLine = sSkillLineStore.LookupEntry(skill); + if (!skillLine) + { + handler->PSendSysMessage(LANG_INVALID_SKILL_ID, skill); + handler->SetSentErrorMessage(true); + return false; + } + + std::string tNameLink = handler->GetNameLink(target); + + if (!target->GetSkillValue(skill)) + { + handler->PSendSysMessage(LANG_SET_SKILL_ERROR, tNameLink.c_str(), skill, skillLine->name[handler->GetSessionDbcLocale()]); + handler->SetSentErrorMessage(true); + return false; + } + + uint16 max = maxPureSkill ? atol (maxPureSkill) : target->GetPureMaxSkillValue(skill); + + if (level <= 0 || level > max || max <= 0) + return false; + + target->SetSkill(skill, target->GetSkillStep(skill), level, max); + handler->PSendSysMessage(LANG_SET_SKILL, skill, skillLine->name[handler->GetSessionDbcLocale()], tNameLink.c_str(), level, max); + + return true; + } + // show info of player + static bool HandlePInfoCommand(ChatHandler* handler, char const* args) + { + Player* target; + uint64 targetGuid; + std::string targetName; + + uint32 parseGUID = MAKE_NEW_GUID(atol((char*)args), 0, HIGHGUID_PLAYER); + + if (sObjectMgr->GetPlayerNameByGUID(parseGUID, targetName)) + { + target = sObjectMgr->GetPlayerByLowGUID(parseGUID); + targetGuid = parseGUID; + } + else if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName)) + return false; + + uint32 accId = 0; + uint32 money = 0; + uint32 totalPlayerTime = 0; + uint8 level = 0; + uint32 latency = 0; + uint8 race; + uint8 Class; + int64 muteTime = 0; + int64 banTime = -1; + uint32 mapId; + uint32 areaId; + uint32 phase = 0; + + // get additional information from Player object + if (target) + { + // check online security + if (handler->HasLowerSecurity(target, 0)) + return false; + + accId = target->GetSession()->GetAccountId(); + money = target->GetMoney(); + totalPlayerTime = target->GetTotalPlayedTime(); + level = target->getLevel(); + latency = target->GetSession()->GetLatency(); + race = target->getRace(); + Class = target->getClass(); + muteTime = target->GetSession()->m_muteTime; + mapId = target->GetMapId(); + areaId = target->GetAreaId(); + phase = target->GetPhaseMask(); + } + // get additional information from DB + else + { + // check offline security + if (handler->HasLowerSecurity(NULL, targetGuid)) + return false; + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_PINFO); + stmt->setUInt32(0, GUID_LOPART(targetGuid)); + PreparedQueryResult result = CharacterDatabase.Query(stmt); + + if (!result) + return false; + + Field* fields = result->Fetch(); + totalPlayerTime = fields[0].GetUInt32(); + level = fields[1].GetUInt8(); + money = fields[2].GetUInt32(); + accId = fields[3].GetUInt32(); + race = fields[4].GetUInt8(); + Class = fields[5].GetUInt8(); + mapId = fields[6].GetUInt16(); + areaId = fields[7].GetUInt16(); + } + + std::string userName = handler->GetTrinityString(LANG_ERROR); + std::string eMail = handler->GetTrinityString(LANG_ERROR); + std::string lastIp = handler->GetTrinityString(LANG_ERROR); + uint32 security = 0; + std::string lastLogin = handler->GetTrinityString(LANG_ERROR); + + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_PINFO); + stmt->setInt32(0, int32(realmID)); + stmt->setUInt32(1, accId); + PreparedQueryResult result = LoginDatabase.Query(stmt); + + if (result) + { + Field* fields = result->Fetch(); + userName = fields[0].GetString(); + security = fields[1].GetUInt8(); + eMail = fields[2].GetString(); + muteTime = fields[5].GetUInt64(); + + if (eMail.empty()) + eMail = "-"; + + if (!handler->GetSession() || handler->GetSession()->GetSecurity() >= AccountTypes(security)) + { + lastIp = fields[3].GetString(); + lastLogin = fields[4].GetString(); + + uint32 ip = inet_addr(lastIp.c_str()); +#if TRINITY_ENDIAN == BIGENDIAN + EndianConvertReverse(ip); +#endif + + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_IP2NATION_COUNTRY); + + stmt->setUInt32(0, ip); + + PreparedQueryResult result2 = WorldDatabase.Query(stmt); + + if (result2) + { + Field* fields2 = result2->Fetch(); + lastIp.append(" ("); + lastIp.append(fields2[0].GetString()); + lastIp.append(")"); + } + } + else + { + lastIp = "-"; + lastLogin = "-"; + } + } + + std::string nameLink = handler->playerLink(targetName); + + handler->PSendSysMessage(LANG_PINFO_ACCOUNT, (target ? "" : handler->GetTrinityString(LANG_OFFLINE)), nameLink.c_str(), GUID_LOPART(targetGuid), userName.c_str(), accId, eMail.c_str(), security, lastIp.c_str(), lastLogin.c_str(), latency); + + std::string bannedby = "unknown"; + std::string banreason = ""; + + stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_PINFO_BANS); + stmt->setUInt32(0, accId); + PreparedQueryResult result2 = LoginDatabase.Query(stmt); + if (!result2) + { + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PINFO_BANS); + stmt->setUInt32(0, GUID_LOPART(targetGuid)); + result2 = CharacterDatabase.Query(stmt); + } + + if (result2) + { + Field* fields = result2->Fetch(); + banTime = int64(fields[1].GetBool() ? 0 : fields[0].GetUInt32()); + bannedby = fields[2].GetString(); + banreason = fields[3].GetString(); + } + + if (muteTime > 0) + handler->PSendSysMessage(LANG_PINFO_MUTE, secsToTimeString(muteTime - time(NULL), true).c_str()); + + if (banTime >= 0) + handler->PSendSysMessage(LANG_PINFO_BAN, banTime > 0 ? secsToTimeString(banTime - time(NULL), true).c_str() : "permanently", bannedby.c_str(), banreason.c_str()); + + std::string raceStr, ClassStr; + switch (race) + { + case RACE_HUMAN: + raceStr = "Human"; + break; + case RACE_ORC: + raceStr = "Orc"; + break; + case RACE_DWARF: + raceStr = "Dwarf"; + break; + case RACE_NIGHTELF: + raceStr = "Night Elf"; + break; + case RACE_UNDEAD_PLAYER: + raceStr = "Undead"; + break; + case RACE_TAUREN: + raceStr = "Tauren"; + break; + case RACE_GNOME: + raceStr = "Gnome"; + break; + case RACE_TROLL: + raceStr = "Troll"; + break; + case RACE_BLOODELF: + raceStr = "Blood Elf"; + break; + case RACE_DRAENEI: + raceStr = "Draenei"; + break; + } + + switch (Class) + { + case CLASS_WARRIOR: + ClassStr = "Warrior"; + break; + case CLASS_PALADIN: + ClassStr = "Paladin"; + break; + case CLASS_HUNTER: + ClassStr = "Hunter"; + break; + case CLASS_ROGUE: + ClassStr = "Rogue"; + break; + case CLASS_PRIEST: + ClassStr = "Priest"; + break; + case CLASS_DEATH_KNIGHT: + ClassStr = "Death Knight"; + break; + case CLASS_SHAMAN: + ClassStr = "Shaman"; + break; + case CLASS_MAGE: + ClassStr = "Mage"; + break; + case CLASS_WARLOCK: + ClassStr = "Warlock"; + break; + case CLASS_DRUID: + ClassStr = "Druid"; + break; + } + + std::string timeStr = secsToTimeString(totalPlayerTime, true, true); + uint32 gold = money /GOLD; + uint32 silv = (money % GOLD) / SILVER; + uint32 copp = (money % GOLD) % SILVER; + handler->PSendSysMessage(LANG_PINFO_LEVEL, raceStr.c_str(), ClassStr.c_str(), timeStr.c_str(), level, gold, silv, copp); + + // Add map, zone, subzone and phase to output + int locale = handler->GetSessionDbcLocale(); + std::string areaName = ""; + std::string zoneName = ""; + + MapEntry const* map = sMapStore.LookupEntry(mapId); + + AreaTableEntry const* area = GetAreaEntryByAreaID(areaId); + if (area) + { + areaName = area->area_name[locale]; + + AreaTableEntry const* zone = GetAreaEntryByAreaID(area->zone); + if (zone) + zoneName = zone->area_name[locale]; + } + + if (target) + { + if (!zoneName.empty()) + handler->PSendSysMessage(LANG_PINFO_MAP_ONLINE, map->name[locale], zoneName.c_str(), areaName.c_str(), phase); + else + handler->PSendSysMessage(LANG_PINFO_MAP_ONLINE, map->name[locale], areaName.c_str(), "", phase); + } + else + handler->PSendSysMessage(LANG_PINFO_MAP_OFFLINE, map->name[locale], areaName.c_str()); + + return true; + } + + static bool HandleRespawnCommand(ChatHandler* handler, char const* /*args*/) + { + Player* player = handler->GetSession()->GetPlayer(); + + // accept only explicitly selected target (not implicitly self targeting case) + Unit* target = handler->getSelectedUnit(); + if (player->GetSelection() && target) + { + if (target->GetTypeId() != TYPEID_UNIT || target->isPet()) + { + handler->SendSysMessage(LANG_SELECT_CREATURE); + handler->SetSentErrorMessage(true); + return false; + } + + if (target->isDead()) + target->ToCreature()->Respawn(); + return true; + } + + CellCoord p(Trinity::ComputeCellCoord(player->GetPositionX(), player->GetPositionY())); + Cell cell(p); + cell.SetNoCreate(); + + Trinity::RespawnDo u_do; + Trinity::WorldObjectWorker worker(player, u_do); + + TypeContainerVisitor, GridTypeMapContainer > obj_worker(worker); + cell.Visit(p, obj_worker, *player->GetMap(), *player, player->GetGridActivationRange()); + + return true; + } + // mute player for some times + static bool HandleMuteCommand(ChatHandler* handler, char const* args) + { + char* nameStr; + char* delayStr; + handler->extractOptFirstArg((char*)args, &nameStr, &delayStr); + if (!delayStr) + return false; + + char const* muteReason = strtok(NULL, "\r"); + std::string muteReasonStr = "No reason"; + if (muteReason != NULL) + muteReasonStr = muteReason; + + Player* target; + uint64 targetGuid; + std::string targetName; + if (!handler->extractPlayerTarget(nameStr, &target, &targetGuid, &targetName)) + return false; + + uint32 accountId = target ? target->GetSession()->GetAccountId() : sObjectMgr->GetPlayerAccountIdByGUID(targetGuid); + + // find only player from same account if any + if (!target) + if (WorldSession* session = sWorld->FindSession(accountId)) + target = session->GetPlayer(); + + uint32 notSpeakTime = uint32(atoi(delayStr)); + + // must have strong lesser security level + if (handler->HasLowerSecurity (target, targetGuid, true)) + return false; + + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_MUTE_TIME); + + if (target) + { + // Target is online, mute will be in effect right away. + int64 muteTime = time(NULL) + notSpeakTime * MINUTE; + target->GetSession()->m_muteTime = muteTime; + stmt->setInt64(0, muteTime); + ChatHandler(target).PSendSysMessage(LANG_YOUR_CHAT_DISABLED, notSpeakTime, muteReasonStr.c_str()); + } + else + { + // Target is offline, mute will be in effect starting from the next login. + int32 muteTime = -int32(notSpeakTime * MINUTE); + stmt->setInt64(0, muteTime); + } + + stmt->setUInt32(1, accountId); + LoginDatabase.Execute(stmt); + std::string nameLink = handler->playerLink(targetName); + + handler->PSendSysMessage(target ? LANG_YOU_DISABLE_CHAT : LANG_COMMAND_DISABLE_CHAT_DELAYED, nameLink.c_str(), notSpeakTime, muteReasonStr.c_str()); + + return true; + } + + // unmute player + static bool HandleUnmuteCommand(ChatHandler* handler, char const* args) + { + Player* target; + uint64 targetGuid; + std::string targetName; + if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName)) + return false; + + uint32 accountId = target ? target->GetSession()->GetAccountId() : sObjectMgr->GetPlayerAccountIdByGUID(targetGuid); + + // find only player from same account if any + if (!target) + if (WorldSession* session = sWorld->FindSession(accountId)) + target = session->GetPlayer(); + + // must have strong lesser security level + if (handler->HasLowerSecurity (target, targetGuid, true)) + return false; + + if (target) + { + if (target->CanSpeak()) + { + handler->SendSysMessage(LANG_CHAT_ALREADY_ENABLED); + handler->SetSentErrorMessage(true); + return false; + } + + target->GetSession()->m_muteTime = 0; + } + + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_MUTE_TIME); + stmt->setInt64(0, 0); + stmt->setUInt32(1, accountId); + LoginDatabase.Execute(stmt); + + if (target) + ChatHandler(target).PSendSysMessage(LANG_YOUR_CHAT_ENABLED); + + std::string nameLink = handler->playerLink(targetName); + + handler->PSendSysMessage(LANG_YOU_ENABLE_CHAT, nameLink.c_str()); + + return true; + } + + + static bool HandleMovegensCommand(ChatHandler* handler, char const* /*args*/) + { + Unit* unit = handler->getSelectedUnit(); + if (!unit) + { + handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE); + handler->SetSentErrorMessage(true); + return false; + } + + handler->PSendSysMessage(LANG_MOVEGENS_LIST, (unit->GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"), unit->GetGUIDLow()); + + MotionMaster* motionMaster = unit->GetMotionMaster(); + float x, y, z; + motionMaster->GetDestination(x, y, z); + + for (uint8 i = 0; i < MAX_MOTION_SLOT; ++i) + { + MovementGenerator* movementGenerator = motionMaster->GetMotionSlot(i); + if (!movementGenerator) + { + handler->SendSysMessage("Empty"); + continue; + } + + switch (movementGenerator->GetMovementGeneratorType()) + { + case IDLE_MOTION_TYPE: + handler->SendSysMessage(LANG_MOVEGENS_IDLE); + break; + case RANDOM_MOTION_TYPE: + handler->SendSysMessage(LANG_MOVEGENS_RANDOM); + break; + case WAYPOINT_MOTION_TYPE: + handler->SendSysMessage(LANG_MOVEGENS_WAYPOINT); + break; + case ANIMAL_RANDOM_MOTION_TYPE: + handler->SendSysMessage(LANG_MOVEGENS_ANIMAL_RANDOM); + break; + case CONFUSED_MOTION_TYPE: + handler->SendSysMessage(LANG_MOVEGENS_CONFUSED); + break; + case CHASE_MOTION_TYPE: + { + Unit* target = NULL; + if (unit->GetTypeId() == TYPEID_PLAYER) + target = static_cast const*>(movementGenerator)->GetTarget(); + else + target = static_cast const*>(movementGenerator)->GetTarget(); + + if (!target) + handler->SendSysMessage(LANG_MOVEGENS_CHASE_NULL); + else if (target->GetTypeId() == TYPEID_PLAYER) + handler->PSendSysMessage(LANG_MOVEGENS_CHASE_PLAYER, target->GetName(), target->GetGUIDLow()); + else + handler->PSendSysMessage(LANG_MOVEGENS_CHASE_CREATURE, target->GetName(), target->GetGUIDLow()); + break; + } + case FOLLOW_MOTION_TYPE: + { + Unit* target = NULL; + if (unit->GetTypeId() == TYPEID_PLAYER) + target = static_cast const*>(movementGenerator)->GetTarget(); + else + target = static_cast const*>(movementGenerator)->GetTarget(); + + if (!target) + handler->SendSysMessage(LANG_MOVEGENS_FOLLOW_NULL); + else if (target->GetTypeId() == TYPEID_PLAYER) + handler->PSendSysMessage(LANG_MOVEGENS_FOLLOW_PLAYER, target->GetName(), target->GetGUIDLow()); + else + handler->PSendSysMessage(LANG_MOVEGENS_FOLLOW_CREATURE, target->GetName(), target->GetGUIDLow()); + break; + } + case HOME_MOTION_TYPE: + { + if (unit->GetTypeId() == TYPEID_UNIT) + handler->PSendSysMessage(LANG_MOVEGENS_HOME_CREATURE, x, y, z); + else + handler->SendSysMessage(LANG_MOVEGENS_HOME_PLAYER); + break; + } + case FLIGHT_MOTION_TYPE: + handler->SendSysMessage(LANG_MOVEGENS_FLIGHT); + break; + case POINT_MOTION_TYPE: + { + handler->PSendSysMessage(LANG_MOVEGENS_POINT, x, y, z); + break; + } + case FLEEING_MOTION_TYPE: + handler->SendSysMessage(LANG_MOVEGENS_FEAR); + break; + case DISTRACT_MOTION_TYPE: + handler->SendSysMessage(LANG_MOVEGENS_DISTRACT); + break; + case EFFECT_MOTION_TYPE: + handler->SendSysMessage(LANG_MOVEGENS_EFFECT); + break; + default: + handler->PSendSysMessage(LANG_MOVEGENS_UNKNOWN, movementGenerator->GetMovementGeneratorType()); + break; + } + } + return true; + } + /* + ComeToMe command REQUIRED for 3rd party scripting library to have access to PointMovementGenerator + Without this function 3rd party scripting library will get linking errors (unresolved external) + when attempting to use the PointMovementGenerator + */ + static bool HandleComeToMeCommand(ChatHandler* handler, char const* args) + { + char const* newFlagStr = strtok((char*)args, " "); + if (!newFlagStr) + return false; + + Creature* caster = handler->getSelectedCreature(); + if (!caster) + { + handler->SendSysMessage(LANG_SELECT_CREATURE); + handler->SetSentErrorMessage(true); + return false; + } + + Player* player = handler->GetSession()->GetPlayer(); + + caster->GetMotionMaster()->MovePoint(0, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ()); + + return true; + } + + static bool HandleDamageCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + Unit* target = handler->getSelectedUnit(); + if (!target || !handler->GetSession()->GetPlayer()->GetSelection()) + { + handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE); + handler->SetSentErrorMessage(true); + return false; + } + + if (target->GetTypeId() == TYPEID_PLAYER) + { + if (handler->HasLowerSecurity((Player*)target, 0, false)) + return false; + } + + if (!target->isAlive()) + return true; + + char* damageStr = strtok((char*)args, " "); + if (!damageStr) + return false; + + int32 damage_int = atoi((char*)damageStr); + if (damage_int <= 0) + return true; + + uint32 damage = damage_int; + + char* schoolStr = strtok((char*)NULL, " "); + + // flat melee damage without resistence/etc reduction + if (!schoolStr) + { + handler->GetSession()->GetPlayer()->DealDamage(target, damage, NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + if (target != handler->GetSession()->GetPlayer()) + handler->GetSession()->GetPlayer()->SendAttackStateUpdate (HITINFO_AFFECTS_VICTIM, target, 1, SPELL_SCHOOL_MASK_NORMAL, damage, 0, 0, VICTIMSTATE_HIT, 0); + return true; + } + + uint32 school = schoolStr ? atoi((char*)schoolStr) : SPELL_SCHOOL_NORMAL; + if (school >= MAX_SPELL_SCHOOL) + return false; + + SpellSchoolMask schoolmask = SpellSchoolMask(1 << school); + + if (Unit::IsDamageReducedByArmor(schoolmask)) + damage = handler->GetSession()->GetPlayer()->CalcArmorReducedDamage(target, damage, NULL, BASE_ATTACK); + + char* spellStr = strtok((char*)NULL, " "); + + // melee damage by specific school + if (!spellStr) + { + uint32 absorb = 0; + uint32 resist = 0; + + handler->GetSession()->GetPlayer()->CalcAbsorbResist(target, schoolmask, SPELL_DIRECT_DAMAGE, damage, &absorb, &resist); + + if (damage <= absorb + resist) + return true; + + damage -= absorb + resist; + + handler->GetSession()->GetPlayer()->DealDamageMods(target, damage, &absorb); + handler->GetSession()->GetPlayer()->DealDamage(target, damage, NULL, DIRECT_DAMAGE, schoolmask, NULL, false); + handler->GetSession()->GetPlayer()->SendAttackStateUpdate (HITINFO_AFFECTS_VICTIM, target, 1, schoolmask, damage, absorb, resist, VICTIMSTATE_HIT, 0); + return true; + } + + // non-melee damage + + // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form + uint32 spellid = handler->extractSpellIdFromLink((char*)args); + if (!spellid || !sSpellMgr->GetSpellInfo(spellid)) + return false; + + handler->GetSession()->GetPlayer()->SpellNonMeleeDamageLog(target, spellid, damage); + return true; + } + + static bool HandleCombatStopCommand(ChatHandler* handler, char const* args) + { + Player* target = NULL; + + if (args && strlen(args) > 0) + { + target = sObjectAccessor->FindPlayerByName(args); + if (!target) + { + handler->SendSysMessage(LANG_PLAYER_NOT_FOUND); + handler->SetSentErrorMessage(true); + return false; + } + } + + if (!target) + { + if (!handler->extractPlayerTarget((char*)args, &target)) + return false; + } + + // check online security + if (handler->HasLowerSecurity(target, 0)) + return false; + + target->CombatStop(); + target->getHostileRefManager().deleteReferences(); + return true; + } + + static bool HandleFlushArenaPointsCommand(ChatHandler* /*handler*/, char const* /*args*/) + { + sArenaTeamMgr->DistributeArenaPoints(); + return true; + } + + static bool HandleRepairitemsCommand(ChatHandler* handler, char const* args) + { + Player* target; + if (!handler->extractPlayerTarget((char*)args, &target)) + return false; + + // check online security + if (handler->HasLowerSecurity(target, 0)) + return false; + + // Repair items + target->DurabilityRepairAll(false, 0, false); + + handler->PSendSysMessage(LANG_YOU_REPAIR_ITEMS, handler->GetNameLink(target).c_str()); + if (handler->needReportToTarget(target)) + ChatHandler(target).PSendSysMessage(LANG_YOUR_ITEMS_REPAIRED, handler->GetNameLink().c_str()); + + return true; + } + + static bool HandleWaterwalkCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + Player* player = handler->getSelectedPlayer(); + if (!player) + { + handler->PSendSysMessage(LANG_NO_CHAR_SELECTED); + handler->SetSentErrorMessage(true); + return false; + } + + // check online security + if (handler->HasLowerSecurity(player, 0)) + return false; + + if (strncmp(args, "on", 3) == 0) + player->SendMovementSetWaterWalking(true); + else if (strncmp(args, "off", 4) == 0) + player->SendMovementSetWaterWalking(false); + else + { + handler->SendSysMessage(LANG_USE_BOL); + return false; + } + + handler->PSendSysMessage(LANG_YOU_SET_WATERWALK, args, handler->GetNameLink(player).c_str()); + if (handler->needReportToTarget(player)) + ChatHandler(player).PSendSysMessage(LANG_YOUR_WATERWALK_SET, args, handler->GetNameLink().c_str()); + return true; + } + + // Send mail by command + static bool HandleSendMailCommand(ChatHandler* handler, char const* args) + { + // format: name "subject text" "mail text" + Player* target; + uint64 targetGuid; + std::string targetName; + if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName)) + return false; + + char* tail1 = strtok(NULL, ""); + if (!tail1) + return false; + + char const* msgSubject = handler->extractQuotedArg(tail1); + if (!msgSubject) + return false; + + char* tail2 = strtok(NULL, ""); + if (!tail2) + return false; + + char const* msgText = handler->extractQuotedArg(tail2); + if (!msgText) + return false; + + // msgSubject, msgText isn't NUL after prev. check + std::string subject = msgSubject; + std::string text = msgText; + + // from console show not existed sender + MailSender sender(MAIL_NORMAL, handler->GetSession() ? handler->GetSession()->GetPlayer()->GetGUIDLow() : 0, MAIL_STATIONERY_GM); + + //- TODO: Fix poor design + SQLTransaction trans = CharacterDatabase.BeginTransaction(); + MailDraft(subject, text) + .SendMailTo(trans, MailReceiver(target, GUID_LOPART(targetGuid)), sender); + + CharacterDatabase.CommitTransaction(trans); + + std::string nameLink = handler->playerLink(targetName); + handler->PSendSysMessage(LANG_MAIL_SENT, nameLink.c_str()); + return true; + } + // Send items by mail + static bool HandleSendItemsCommand(ChatHandler* handler, char const* args) + { + // format: name "subject text" "mail text" item1[:count1] item2[:count2] ... item12[:count12] + Player* receiver; + uint64 receiverGuid; + std::string receiverName; + if (!handler->extractPlayerTarget((char*)args, &receiver, &receiverGuid, &receiverName)) + return false; + + char* tail1 = strtok(NULL, ""); + if (!tail1) + return false; + + char const* msgSubject = handler->extractQuotedArg(tail1); + if (!msgSubject) + return false; + + char* tail2 = strtok(NULL, ""); + if (!tail2) + return false; + + char const* msgText = handler->extractQuotedArg(tail2); + if (!msgText) + return false; + + // msgSubject, msgText isn't NUL after prev. check + std::string subject = msgSubject; + std::string text = msgText; + + // extract items + typedef std::pair ItemPair; + typedef std::list< ItemPair > ItemPairs; + ItemPairs items; + + // get all tail string + char* tail = strtok(NULL, ""); + + // get from tail next item str + while (char* itemStr = strtok(tail, " ")) + { + // and get new tail + tail = strtok(NULL, ""); + + // parse item str + char const* itemIdStr = strtok(itemStr, ":"); + char const* itemCountStr = strtok(NULL, " "); + + uint32 itemId = atoi(itemIdStr); + if (!itemId) + return false; + + ItemTemplate const* item_proto = sObjectMgr->GetItemTemplate(itemId); + if (!item_proto) + { + handler->PSendSysMessage(LANG_COMMAND_ITEMIDINVALID, itemId); + handler->SetSentErrorMessage(true); + return false; + } + + uint32 itemCount = itemCountStr ? atoi(itemCountStr) : 1; + if (itemCount < 1 || (item_proto->MaxCount > 0 && itemCount > uint32(item_proto->MaxCount))) + { + handler->PSendSysMessage(LANG_COMMAND_INVALID_ITEM_COUNT, itemCount, itemId); + handler->SetSentErrorMessage(true); + return false; + } + + while (itemCount > item_proto->GetMaxStackSize()) + { + items.push_back(ItemPair(itemId, item_proto->GetMaxStackSize())); + itemCount -= item_proto->GetMaxStackSize(); + } + + items.push_back(ItemPair(itemId, itemCount)); + + if (items.size() > MAX_MAIL_ITEMS) + { + handler->PSendSysMessage(LANG_COMMAND_MAIL_ITEMS_LIMIT, MAX_MAIL_ITEMS); + handler->SetSentErrorMessage(true); + return false; + } + } + + // from console show not existed sender + MailSender sender(MAIL_NORMAL, handler->GetSession() ? handler->GetSession()->GetPlayer()->GetGUIDLow() : 0, MAIL_STATIONERY_GM); + + // fill mail + MailDraft draft(subject, text); + + SQLTransaction trans = CharacterDatabase.BeginTransaction(); + + for (ItemPairs::const_iterator itr = items.begin(); itr != items.end(); ++itr) + { + if (Item* item = Item::CreateItem(itr->first, itr->second, handler->GetSession() ? handler->GetSession()->GetPlayer() : 0)) + { + item->SaveToDB(trans); // save for prevent lost at next mail load, if send fail then item will deleted + draft.AddItem(item); + } + } + + draft.SendMailTo(trans, MailReceiver(receiver, GUID_LOPART(receiverGuid)), sender); + CharacterDatabase.CommitTransaction(trans); + + std::string nameLink = handler->playerLink(receiverName); + handler->PSendSysMessage(LANG_MAIL_SENT, nameLink.c_str()); + return true; + } + /// Send money by mail + static bool HandleSendMoneyCommand(ChatHandler* handler, char const* args) + { + /// format: name "subject text" "mail text" money + + Player* receiver; + uint64 receiverGuid; + std::string receiverName; + if (!handler->extractPlayerTarget((char*)args, &receiver, &receiverGuid, &receiverName)) + return false; + + char* tail1 = strtok(NULL, ""); + if (!tail1) + return false; + + char* msgSubject = handler->extractQuotedArg(tail1); + if (!msgSubject) + return false; + + char* tail2 = strtok(NULL, ""); + if (!tail2) + return false; + + char* msgText = handler->extractQuotedArg(tail2); + if (!msgText) + return false; + + char* moneyStr = strtok(NULL, ""); + int32 money = moneyStr ? atoi(moneyStr) : 0; + if (money <= 0) + return false; + + // msgSubject, msgText isn't NUL after prev. check + std::string subject = msgSubject; + std::string text = msgText; + + // from console show not existed sender + MailSender sender(MAIL_NORMAL, handler->GetSession() ? handler->GetSession()->GetPlayer()->GetGUIDLow() : 0, MAIL_STATIONERY_GM); + + SQLTransaction trans = CharacterDatabase.BeginTransaction(); + + MailDraft(subject, text) + .AddMoney(money) + .SendMailTo(trans, MailReceiver(receiver, GUID_LOPART(receiverGuid)), sender); + + CharacterDatabase.CommitTransaction(trans); + + std::string nameLink = handler->playerLink(receiverName); + handler->PSendSysMessage(LANG_MAIL_SENT, nameLink.c_str()); + return true; + } + /// Send a message to a player in game + static bool HandleSendMessageCommand(ChatHandler* handler, char const* args) + { + /// - Find the player + Player* player; + if (!handler->extractPlayerTarget((char*)args, &player)) + return false; + + char* msgStr = strtok(NULL, ""); + if (!msgStr) + return false; + + ///- Check that he is not logging out. + if (player->GetSession()->isLogingOut()) + { + handler->SendSysMessage(LANG_PLAYER_NOT_FOUND); + handler->SetSentErrorMessage(true); + return false; + } + + /// - Send the message + // Use SendAreaTriggerMessage for fastest delivery. + player->GetSession()->SendAreaTriggerMessage("%s", msgStr); + player->GetSession()->SendAreaTriggerMessage("|cffff0000[Message from administrator]:|r"); + + // Confirmation message + std::string nameLink = handler->GetNameLink(player); + handler->PSendSysMessage(LANG_SENDMESSAGE, nameLink.c_str(), msgStr); + + return true; + } + + static bool HandleCreatePetCommand(ChatHandler* handler, char const* /*args*/) + { + Player* player = handler->GetSession()->GetPlayer(); + Creature* creatureTarget = handler->getSelectedCreature(); + + if (!creatureTarget || creatureTarget->isPet() || creatureTarget->GetTypeId() == TYPEID_PLAYER) + { + handler->PSendSysMessage(LANG_SELECT_CREATURE); + handler->SetSentErrorMessage(true); + return false; + } + + CreatureTemplate const* creatrueTemplate = sObjectMgr->GetCreatureTemplate(creatureTarget->GetEntry()); + // Creatures with family 0 crashes the server + if (!creatrueTemplate->family) + { + handler->PSendSysMessage("This creature cannot be tamed. (family id: 0)."); + handler->SetSentErrorMessage(true); + return false; + } + + if (player->GetPetGUID()) + { + handler->PSendSysMessage("You already have a pet"); + handler->SetSentErrorMessage(true); + return false; + } + + // Everything looks OK, create new pet + Pet* pet = new Pet(player, HUNTER_PET); + if (!pet->CreateBaseAtCreature(creatureTarget)) + { + delete pet; + handler->PSendSysMessage("Error 1"); + return false; + } + + creatureTarget->setDeathState(JUST_DIED); + creatureTarget->RemoveCorpse(); + creatureTarget->SetHealth(0); // just for nice GM-mode view + + pet->SetUInt64Value(UNIT_FIELD_CREATEDBY, player->GetGUID()); + pet->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, player->getFaction()); + + if (!pet->InitStatsForLevel(creatureTarget->getLevel())) + { + sLog->outError(LOG_FILTER_GENERAL, "InitStatsForLevel() in EffectTameCreature failed! Pet deleted."); + handler->PSendSysMessage("Error 2"); + delete pet; + return false; + } + + // prepare visual effect for levelup + pet->SetUInt32Value(UNIT_FIELD_LEVEL, creatureTarget->getLevel()-1); + + pet->GetCharmInfo()->SetPetNumber(sObjectMgr->GeneratePetNumber(), true); + // this enables pet details window (Shift+P) + pet->InitPetCreateSpells(); + pet->SetFullHealth(); + + pet->GetMap()->AddToMap(pet->ToCreature()); + + // visual effect for levelup + pet->SetUInt32Value(UNIT_FIELD_LEVEL, creatureTarget->getLevel()); + + player->SetMinion(pet, true); + pet->SavePetToDB(PET_SAVE_AS_CURRENT); + player->PetSpellInitialize(); + + return true; + } + + static bool HandlePetLearnCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + Player* player = handler->GetSession()->GetPlayer(); + Pet* pet = player->GetPet(); + + if (!pet) + { + handler->PSendSysMessage("You have no pet"); + handler->SetSentErrorMessage(true); + return false; + } + + uint32 spellId = handler->extractSpellIdFromLink((char*)args); + + if (!spellId || !sSpellMgr->GetSpellInfo(spellId)) + return false; + + // Check if pet already has it + if (pet->HasSpell(spellId)) + { + handler->PSendSysMessage("Pet already has spell: %u", spellId); + handler->SetSentErrorMessage(true); + return false; + } + + // Check if spell is valid + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId); + if (!spellInfo || !SpellMgr::IsSpellValid(spellInfo)) + { + handler->PSendSysMessage(LANG_COMMAND_SPELL_BROKEN, spellId); + handler->SetSentErrorMessage(true); + return false; + } + + pet->learnSpell(spellId); + + handler->PSendSysMessage("Pet has learned spell %u", spellId); + return true; + } + + static bool HandlePetUnlearnCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + Player* player = handler->GetSession()->GetPlayer(); + Pet* pet = player->GetPet(); + if (!pet) + { + handler->PSendSysMessage("You have no pet"); + handler->SetSentErrorMessage(true); + return false; + } + + uint32 spellId = handler->extractSpellIdFromLink((char*)args); + + if (pet->HasSpell(spellId)) + pet->removeSpell(spellId, false); + else + handler->PSendSysMessage("Pet doesn't have that spell"); + + return true; + } + + static bool HandleFreezeCommand(ChatHandler* handler, char const* args) + { + std::string name; + Player* player; + char const* TargetName = strtok((char*)args, " "); // get entered name + if (!TargetName) // if no name entered use target + { + player = handler->getSelectedPlayer(); + if (player) //prevent crash with creature as target + { + name = player->GetName(); + normalizePlayerName(name); + } + } + else // if name entered + { + name = TargetName; + normalizePlayerName(name); + player = sObjectAccessor->FindPlayerByName(name.c_str()); + } + + if (!player) + { + handler->SendSysMessage(LANG_COMMAND_FREEZE_WRONG); + return true; + } + + if (player == handler->GetSession()->GetPlayer()) + { + handler->SendSysMessage(LANG_COMMAND_FREEZE_ERROR); + return true; + } + + // effect + if (player && (player != handler->GetSession()->GetPlayer())) + { + handler->PSendSysMessage(LANG_COMMAND_FREEZE, name.c_str()); + + // stop combat + make player unattackable + duel stop + stop some spells + player->setFaction(35); + player->CombatStop(); + if (player->IsNonMeleeSpellCasted(true)) + player->InterruptNonMeleeSpells(true); + player->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + // if player class = hunter || warlock remove pet if alive + if ((player->getClass() == CLASS_HUNTER) || (player->getClass() == CLASS_WARLOCK)) + { + if (Pet* pet = player->GetPet()) + { + pet->SavePetToDB(PET_SAVE_AS_CURRENT); + // not let dismiss dead pet + if (pet && pet->isAlive()) + player->RemovePet(pet, PET_SAVE_NOT_IN_SLOT); + } + } + + if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(9454)) + Aura::TryRefreshStackOrCreate(spellInfo, MAX_EFFECT_MASK, player, player); + + // save player + player->SaveToDB(); + } + + return true; + } + + static bool HandleUnFreezeCommand(ChatHandler* handler, char const*args) + { + std::string name; + Player* player; + char* targetName = strtok((char*)args, " "); // Get entered name + + if (targetName) + { + name = targetName; + normalizePlayerName(name); + player = sObjectAccessor->FindPlayerByName(name.c_str()); + } + else // If no name was entered - use target + { + player = handler->getSelectedPlayer(); + if (player) + name = player->GetName(); + } + + if (player) + { + handler->PSendSysMessage(LANG_COMMAND_UNFREEZE, name.c_str()); + + // Reset player faction + allow combat + allow duels + player->setFactionForRace(player->getRace()); + player->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + // Remove Freeze spell (allowing movement and spells) + player->RemoveAurasDueToSpell(9454); + + // Save player + player->SaveToDB(); + } + else + { + if (targetName) + { + // Check for offline players + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_GUID_BY_NAME); + stmt->setString(0, name); + PreparedQueryResult result = CharacterDatabase.Query(stmt); + + if (!result) + { + handler->SendSysMessage(LANG_COMMAND_FREEZE_WRONG); + return true; + } + + // If player found: delete his freeze aura + Field* fields = result->Fetch(); + uint32 lowGuid = fields[0].GetUInt32(); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_AURA_FROZEN); + stmt->setUInt32(0, lowGuid); + CharacterDatabase.Execute(stmt); + + handler->PSendSysMessage(LANG_COMMAND_UNFREEZE, name.c_str()); + return true; + } + else + { + handler->SendSysMessage(LANG_COMMAND_FREEZE_WRONG); + return true; + } + } + + return true; + } + + static bool HandleListFreezeCommand(ChatHandler* handler, char const* /*args*/) + { + // Get names from DB + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_AURA_FROZEN); + PreparedQueryResult result = CharacterDatabase.Query(stmt); + if (!result) + { + handler->SendSysMessage(LANG_COMMAND_NO_FROZEN_PLAYERS); + return true; + } + + // Header of the names + handler->PSendSysMessage(LANG_COMMAND_LIST_FREEZE); + + // Output of the results + do + { + Field* fields = result->Fetch(); + std::string player = fields[0].GetString(); + handler->PSendSysMessage(LANG_COMMAND_FROZEN_PLAYERS, player.c_str()); + } + while (result->NextRow()); + + return true; + } + + static bool HandleGroupLeaderCommand(ChatHandler* handler, char const* args) + { + Player* player = NULL; + Group* group = NULL; + uint64 guid = 0; + char* nameStr = strtok((char*)args, " "); + + if (handler->GetPlayerGroupAndGUIDByName(nameStr, player, group, guid)) + if (group && group->GetLeaderGUID() != guid) + { + group->ChangeLeader(guid); + group->SendUpdate(); + } + + return true; + } + + static bool HandleGroupDisbandCommand(ChatHandler* handler, char const* args) + { + Player* player = NULL; + Group* group = NULL; + uint64 guid = 0; + char* nameStr = strtok((char*)args, " "); + + if (handler->GetPlayerGroupAndGUIDByName(nameStr, player, group, guid)) + if (group) + group->Disband(); + + return true; + } + + static bool HandleGroupRemoveCommand(ChatHandler* handler, char const* args) + { + Player* player = NULL; + Group* group = NULL; + uint64 guid = 0; + char* nameStr = strtok((char*)args, " "); + + if (handler->GetPlayerGroupAndGUIDByName(nameStr, player, group, guid, true)) + if (group) + group->RemoveMember(guid); + + return true; + } + + static bool HandlePlayAllCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + uint32 soundId = atoi((char*)args); + + if (!sSoundEntriesStore.LookupEntry(soundId)) + { + handler->PSendSysMessage(LANG_SOUND_NOT_EXIST, soundId); + handler->SetSentErrorMessage(true); + return false; + } + + WorldPacket data(SMSG_PLAY_SOUND, 4); + data << uint32(soundId) << handler->GetSession()->GetPlayer()->GetGUID(); + sWorld->SendGlobalMessage(&data); + + handler->PSendSysMessage(LANG_COMMAND_PLAYED_TO_ALL, soundId); + return true; + } + + static bool HandlePossessCommand(ChatHandler* handler, char const* /*args*/) + { + Unit* unit = handler->getSelectedUnit(); + if (!unit) + return false; + + handler->GetSession()->GetPlayer()->CastSpell(unit, 530, true); + return true; + } + + static bool HandleUnPossessCommand(ChatHandler* handler, char const* /*args*/) + { + Unit* unit = handler->getSelectedUnit(); + if (!unit) + unit = handler->GetSession()->GetPlayer(); + + unit->RemoveCharmAuras(); + + return true; + } + + static bool HandleBindSightCommand(ChatHandler* handler, char const* /*args*/) + { + Unit* unit = handler->getSelectedUnit(); + if (!unit) + return false; + + handler->GetSession()->GetPlayer()->CastSpell(unit, 6277, true); + return true; + } + + static bool HandleUnbindSightCommand(ChatHandler* handler, char const* /*args*/) + { + Player* player = handler->GetSession()->GetPlayer(); + + if (player->isPossessing()) + return false; + + player->StopCastingBindSight(); + return true; + } +}; + +void AddSC_misc_commandscript() +{ + new misc_commandscript(); +} diff --git a/src/server/scripts/EasternKingdoms/arathi_highlands.cpp b/src/server/scripts/EasternKingdoms/arathi_highlands.cpp index 9db03971756..1847de91d14 100644 --- a/src/server/scripts/EasternKingdoms/arathi_highlands.cpp +++ b/src/server/scripts/EasternKingdoms/arathi_highlands.cpp @@ -47,7 +47,7 @@ enum eEnums SAY_PROGRESS_7 = 7, EMOTE_PROGRESS_8 = 8, SAY_PROGRESS_9 = 9, - + EVENT_SAY_3 = 1, EVENT_SAY_6 = 2, EVENT_SAY_8 = 3, @@ -112,9 +112,9 @@ class npc_professor_phizzlethorpe : public CreatureScript Player* player = GetPlayerForEscort(); if (!player) return; - + events.Update(diff); - + while (uint32 event = events.ExecuteEvent()) { switch (event) @@ -135,7 +135,7 @@ class npc_professor_phizzlethorpe : public CreatureScript } npc_escortAI::UpdateAI(diff); } - + EventMap events; }; diff --git a/src/server/scripts/EasternKingdoms/burning_steppes.cpp b/src/server/scripts/EasternKingdoms/burning_steppes.cpp index 3f8e86753dd..2ef43ee67ed 100644 --- a/src/server/scripts/EasternKingdoms/burning_steppes.cpp +++ b/src/server/scripts/EasternKingdoms/burning_steppes.cpp @@ -19,7 +19,7 @@ /* ScriptData SDName: Burning_Steppes SD%Complete: 0 -SDComment: +SDComment: SDCategory: Burning Steppes EndScriptData */ @@ -31,5 +31,5 @@ EndScriptData */ void AddSC_burning_steppes() { - + } diff --git a/src/server/scripts/EasternKingdoms/ghostlands.cpp b/src/server/scripts/EasternKingdoms/ghostlands.cpp index dcc938f35fe..93141f2d82c 100644 --- a/src/server/scripts/EasternKingdoms/ghostlands.cpp +++ b/src/server/scripts/EasternKingdoms/ghostlands.cpp @@ -19,7 +19,7 @@ /* ScriptData SDName: Ghostlands SD%Complete: 100 -SDComment: +SDComment: SDCategory: Ghostlands EndScriptData */ diff --git a/src/server/scripts/EasternKingdoms/ironforge.cpp b/src/server/scripts/EasternKingdoms/ironforge.cpp index 98a4d780058..9cb9ef63693 100644 --- a/src/server/scripts/EasternKingdoms/ironforge.cpp +++ b/src/server/scripts/EasternKingdoms/ironforge.cpp @@ -19,7 +19,7 @@ /* ScriptData SDName: Ironforge SD%Complete: 0 -SDComment: +SDComment: SDCategory: Ironforge EndScriptData */ diff --git a/src/server/scripts/EasternKingdoms/loch_modan.cpp b/src/server/scripts/EasternKingdoms/loch_modan.cpp index 32862a2d7b0..c5571560b54 100644 --- a/src/server/scripts/EasternKingdoms/loch_modan.cpp +++ b/src/server/scripts/EasternKingdoms/loch_modan.cpp @@ -19,7 +19,7 @@ /* ScriptData SDName: Loch_Modan SD%Complete: 0 -SDComment: +SDComment: SDCategory: Loch Modan EndScriptData */ diff --git a/src/server/scripts/EasternKingdoms/redridge_mountains.cpp b/src/server/scripts/EasternKingdoms/redridge_mountains.cpp index 81223dad1d3..3d47a8e8ed6 100644 --- a/src/server/scripts/EasternKingdoms/redridge_mountains.cpp +++ b/src/server/scripts/EasternKingdoms/redridge_mountains.cpp @@ -18,7 +18,7 @@ /* Script Data Start SDName: Redridge Mountains SD%Complete: 0 -SDComment: +SDComment: Script Data End */ #include "ScriptMgr.h" diff --git a/src/server/scripts/EasternKingdoms/stormwind_city.cpp b/src/server/scripts/EasternKingdoms/stormwind_city.cpp index f5ade53202a..f6afed67dff 100644 --- a/src/server/scripts/EasternKingdoms/stormwind_city.cpp +++ b/src/server/scripts/EasternKingdoms/stormwind_city.cpp @@ -19,7 +19,7 @@ /* ScriptData SDName: Stormwind_City SD%Complete: 0 -SDComment: +SDComment: SDCategory: Stormwind City EndScriptData */ diff --git a/src/server/scripts/Kalimdor/azshara.cpp b/src/server/scripts/Kalimdor/azshara.cpp index 740f3d5c7e2..fdc00e04a09 100644 --- a/src/server/scripts/Kalimdor/azshara.cpp +++ b/src/server/scripts/Kalimdor/azshara.cpp @@ -19,7 +19,7 @@ /* ScriptData SDName: Azshara SD%Complete: 0 -SDComment: Quest support: +SDComment: Quest support: SDCategory: Azshara EndScriptData */ diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index 376de2ac97c..2089b969e1a 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -2735,7 +2735,6 @@ Logger.CharDump=38,5,CharDump Logger.Battlefield=39,3,Console Server Logger.Opcodes=40,2,Console Server - # LogLevel # 0 - (Disabled) # 1 - (Trace) -- cgit v1.2.3 From f82851a3a8ff8dbebebe96a52b3148aa95768ca2 Mon Sep 17 00:00:00 2001 From: Tuxity Date: Wed, 15 Aug 2012 22:49:13 +0200 Subject: Core/Players: - Power regeneration is now affected by haste. Patch by @Greymane. - Ticks of DoT and HoT spells are now affected by haste. --- src/server/game/Entities/Player/Player.cpp | 57 +++++++++++++++++------ src/server/game/Entities/Player/Player.h | 2 + src/server/game/Spells/Auras/SpellAuraEffects.cpp | 11 +++-- src/server/game/Spells/Spell.cpp | 3 -- 4 files changed, 54 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 880d75494b5..6a4e4ff02ea 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -669,6 +669,8 @@ Player::Player(WorldSession* session): Unit(true), m_achievementMgr(this), m_rep m_regenTimer = 0; m_regenTimerCount = 0; + m_holyPowerRegenTimerCount = 0; + m_focusRegenTimerCount = 0; m_weaponChangeTimer = 0; m_zoneUpdateId = 0; @@ -956,6 +958,8 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo) SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_REGENERATE_POWER); SetFloatValue(UNIT_MOD_CAST_SPEED, 1.0f); // fix cast time showed in spell tooltip on client SetFloatValue(UNIT_MOD_CAST_HASTE, 1.0f); + SetFloatValue(PLAYER_FIELD_MOD_HASTE, 1.0f); + SetFloatValue(PLAYER_FIELD_MOD_RANGED_HASTE, 1.0f); SetFloatValue(UNIT_FIELD_HOVERHEIGHT, 1.0f); // default for players in 3.0.3 // -1 is default value @@ -2483,8 +2487,13 @@ void Player::RegenerateAll() m_regenTimerCount += m_regenTimer; + if (getClass() == CLASS_PALADIN) + m_holyPowerRegenTimerCount += m_regenTimer; + + if (getClass() == CLASS_HUNTER) + m_focusRegenTimerCount += m_regenTimer; + Regenerate(POWER_ENERGY); - Regenerate(POWER_FOCUS); Regenerate(POWER_MANA); // Runes act as cooldowns, and they don't need to send any data @@ -2507,6 +2516,12 @@ void Player::RegenerateAll() } } + if (m_focusRegenTimerCount >= 1000 && getClass() == CLASS_HUNTER) + { + Regenerate(POWER_FOCUS); + m_focusRegenTimerCount -= 1000; + } + if (m_regenTimerCount >= 2000) { // Not in combat or they have regeneration @@ -2523,6 +2538,12 @@ void Player::RegenerateAll() m_regenTimerCount -= 2000; } + + if (m_holyPowerRegenTimerCount >= 10000 && getClass() == CLASS_PALADIN) + { + Regenerate(POWER_HOLY_POWER); + m_holyPowerRegenTimerCount -= 10000; + } m_regenTimer = 0; } @@ -2541,6 +2562,11 @@ void Player::Regenerate(Powers power) float addvalue = 0.0f; + // Powers now benefit from haste. + float rangedHaste = GetFloatValue(PLAYER_FIELD_MOD_RANGED_HASTE); + float meleeHaste = GetFloatValue(PLAYER_FIELD_MOD_HASTE); + float spellHaste = GetFloatValue(UNIT_MOD_CAST_SPEED); + switch (power) { case POWER_MANA: @@ -2548,26 +2574,26 @@ void Player::Regenerate(Powers power) bool recentCast = IsUnderLastManaUseEffect(); float ManaIncreaseRate = sWorld->getRate(RATE_POWER_MANA); - if (getLevel() < 15) - ManaIncreaseRate = sWorld->getRate(RATE_POWER_MANA) * (2.066f - (getLevel() * 0.066f)); - if (recentCast) // Trinity Updates Mana in intervals of 2s, which is correct - addvalue += GetFloatValue(UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER) * ManaIncreaseRate * 0.001f * m_regenTimer; + addvalue += GetFloatValue(UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER) * ManaIncreaseRate * ((0.001f * m_regenTimer) + CalculatePctF(0.001f, spellHaste)); else - addvalue += GetFloatValue(UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER) * ManaIncreaseRate * 0.001f * m_regenTimer; + addvalue += GetFloatValue(UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER) * ManaIncreaseRate * ((0.001f * m_regenTimer) + CalculatePctF(0.001f, spellHaste)); } break; - case POWER_RAGE: // Regenerate rage + case POWER_RAGE: // Regenerate rage { if (!isInCombat() && !HasAuraType(SPELL_AURA_INTERRUPT_REGEN)) { float RageDecreaseRate = sWorld->getRate(RATE_POWER_RAGE_LOSS); - addvalue += -25 * RageDecreaseRate; // 2.5 rage by tick (= 2 seconds => 1.25 rage/sec) + addvalue += -25 * RageDecreaseRate / meleeHaste; // 2.5 rage by tick (= 2 seconds => 1.25 rage/sec) } } break; - case POWER_ENERGY: // Regenerate energy (rogue) - addvalue += 0.01f * m_regenTimer * sWorld->getRate(RATE_POWER_ENERGY); + case POWER_FOCUS: + addvalue += (6.0f + CalculatePctF(6.0f, rangedHaste)) * sWorld->getRate(RATE_POWER_FOCUS); + break; + case POWER_ENERGY: // Regenerate energy (rogue) + addvalue += ((0.01f * m_regenTimer) + CalculatePctF(0.01f, meleeHaste)) * sWorld->getRate(RATE_POWER_ENERGY); break; case POWER_RUNIC_POWER: { @@ -2578,9 +2604,12 @@ void Player::Regenerate(Powers power) } } break; - case POWER_FOCUS: - addvalue += 4.0f * m_modAttackSpeedPct[RANGED_ATTACK] * sWorld->getRate(RATE_POWER_FOCUS); - break; + case POWER_HOLY_POWER: // Regenerate holy power + { + if (!isInCombat()) + addvalue += -1.0f; // remove 1 each 10 sec + } + break; case POWER_RUNES: case POWER_HEALTH: break; @@ -3209,6 +3238,8 @@ void Player::InitStatsForLevel(bool reapplyMods) // set default cast time multiplier SetFloatValue(UNIT_MOD_CAST_SPEED, 1.0f); SetFloatValue(UNIT_MOD_CAST_HASTE, 1.0f); + SetFloatValue(PLAYER_FIELD_MOD_HASTE, 1.0f); + SetFloatValue(PLAYER_FIELD_MOD_RANGED_HASTE, 1.0f); // reset size before reapply auras SetObjectScale(1.0f); diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 98f107fa541..0237a976648 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -2610,6 +2610,8 @@ class Player : public Unit, public GridObject // Gamemaster whisper whitelist WhisperListContainer WhisperList; uint32 m_regenTimerCount; + uint32 m_holyPowerRegenTimerCount; + uint32 m_focusRegenTimerCount; float m_powerFraction[MAX_POWERS]; uint32 m_contestedPvPTimer; diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index eef306e5616..35ed65f2727 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -880,9 +880,14 @@ void AuraEffect::CalculatePeriodic(Unit* caster, bool create, bool load) if (m_spellInfo->AttributesEx5 & SPELL_ATTR5_HASTE_AFFECT_DURATION) caster->ModSpellCastTime(m_spellInfo, m_amplitude); } - // and periodic time of auras affected by SPELL_AURA_PERIODIC_HASTE - else if (caster->HasAuraTypeWithAffectMask(SPELL_AURA_PERIODIC_HASTE, m_spellInfo) || m_spellInfo->AttributesEx5 & SPELL_ATTR5_HASTE_AFFECT_DURATION) - m_amplitude = int32(m_amplitude * caster->GetFloatValue(UNIT_MOD_CAST_SPEED)); + // and periodic time of auras affected by SPELL_AURA_PERIODIC_HASTE on player who have haste + else if ((caster->HasAuraTypeWithAffectMask(SPELL_AURA_PERIODIC_HASTE, m_spellInfo) || m_spellInfo->AttributesEx5 & SPELL_ATTR5_HASTE_AFFECT_DURATION) && caster->GetFloatValue(UNIT_MOD_CAST_SPEED) != 1.0f) + { + // Calculate number of ticks we must have + float ticks = roundf(GetBase()->GetDuration() / (m_amplitude / (1.0f + (1.0f - caster->GetFloatValue(UNIT_MOD_CAST_SPEED))))); + + m_amplitude = GetBase()->GetDuration() / int32(ticks); + } } } diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index ed06902178d..771da8162f9 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -2735,9 +2735,6 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA if (m_spellInfo->AttributesEx5 & SPELL_ATTR5_HASTE_AFFECT_DURATION) m_originalCaster->ModSpellCastTime(aurSpellInfo, duration, this); } - // and duration of auras affected by SPELL_AURA_PERIODIC_HASTE - else if (m_originalCaster->HasAuraTypeWithAffectMask(SPELL_AURA_PERIODIC_HASTE, aurSpellInfo) || m_spellInfo->AttributesEx5 & SPELL_ATTR5_HASTE_AFFECT_DURATION) - duration = int32(duration * m_originalCaster->GetFloatValue(UNIT_MOD_CAST_SPEED)); if (duration != m_spellAura->GetMaxDuration()) { -- cgit v1.2.3 From e5d43b9c59d805ad5abeb69236c3a01851ede619 Mon Sep 17 00:00:00 2001 From: Tuxity Date: Wed, 15 Aug 2012 22:49:44 +0200 Subject: Core/Stats: Fix a damage bug when you go into a druid's form --- src/server/game/Entities/Player/Player.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 6a4e4ff02ea..1915e2094a7 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -8167,7 +8167,7 @@ void Player::_ApplyWeaponDamage(uint8 slot, ItemTemplate const* proto, ScalingSt SetBaseWeaponDamage(attType, MAXDAMAGE, damage); } - if (proto->Delay && !IsInFeralForm()) + if (proto->Delay) { if (slot == EQUIPMENT_SLOT_RANGED) SetAttackTime(RANGED_ATTACK, apply ? proto->Delay: BASE_ATTACK_TIME); @@ -8177,10 +8177,6 @@ void Player::_ApplyWeaponDamage(uint8 slot, ItemTemplate const* proto, ScalingSt SetAttackTime(OFF_ATTACK, apply ? proto->Delay: BASE_ATTACK_TIME); } - // No need to modify any physical damage for ferals as it is calculated from stats only - if (IsInFeralForm()) - return; - if (CanModifyStats() && (damage || proto->Delay)) UpdateDamagePhysical(attType); } -- cgit v1.2.3 From eb3ecac70ffc5271bc720c217a0935e3e5237ba6 Mon Sep 17 00:00:00 2001 From: Subv Date: Wed, 15 Aug 2012 17:22:58 -0500 Subject: Core/Spells: Cleaned up more deprecated spells code --- src/server/game/Entities/Unit/Unit.cpp | 191 +++++---------------------------- 1 file changed, 29 insertions(+), 162 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 7b2f3a49e18..5ce424738b2 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -9720,14 +9720,25 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin { case 4920: // Molten Fury case 4919: - case 6917: // Death's Embrace - case 6926: - case 6928: { if (victim->HasAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, spellProto, this)) AddPctN(DoneTotalMod, (*i)->GetAmount()); break; } + case 6917: // Death's Embrace damage effect + case 6926: + case 6928: + { + // Health at 25% or less (25% stored at effect 2 of the spell) + if (victim->HealthBelowPct(CalculateSpellDamage(this, (*i)->GetSpellInfo(), EFFECT_2))) + AddPctN(DoneTotalMod, (*i)->GetAmount()); + } + case 6916: // Death's Embrace heal effect + case 6925: + case 6927: + if (HealthBelowPct(CalculateSpellDamage(this, (*i)->GetSpellInfo(), EFFECT_2))) + AddPctN(DoneTotalMod, (*i)->GetAmount()); + break; // Soul Siphon case 4992: case 4993: @@ -9742,8 +9753,8 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin for (AuraApplicationMap::const_iterator itr = victimAuras.begin(); itr != victimAuras.end(); ++itr) { Aura const* aura = itr->second->GetBase(); - SpellInfo const* m_spell = aura->GetSpellInfo(); - if (m_spell->SpellFamilyName != SPELLFAMILY_WARLOCK || !(m_spell->SpellFamilyFlags[1] & 0x0004071B || m_spell->SpellFamilyFlags[0] & 0x8044C402)) + SpellInfo const* spell = aura->GetSpellInfo(); + if (spell->SpellFamilyName != SPELLFAMILY_WARLOCK || !(spell->SpellFamilyFlags[1] & 0x0004071B || spell->SpellFamilyFlags[0] & 0x8044C402)) continue; modPercent += stepPercent * aura->GetStackAmount(); if (modPercent >= maxPercent) @@ -9755,12 +9766,6 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin AddPctN(DoneTotalMod, modPercent); break; } - case 6916: // Death's Embrace - case 6925: - case 6927: - if (HasAuraState(AURA_STATE_HEALTHLESS_20_PERCENT, spellProto, this)) - AddPctN(DoneTotalMod, (*i)->GetAmount()); - break; case 5481: // Starfire Bonus { if (victim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DRUID, 0x200002, 0, 0)) @@ -9779,65 +9784,6 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin DoneTotal += (*i)->GetAmount(); break; } - // Tundra Stalker - // Merciless Combat - case 7277: - { - // Merciless Combat - if ((*i)->GetSpellInfo()->SpellIconID == 2656) - { - if (!victim->HealthAbovePct(35)) - AddPctN(DoneTotalMod, (*i)->GetAmount()); - } - // Tundra Stalker - else - { - // Frost Fever (target debuff) - if (victim->HasAura(55095)) - AddPctN(DoneTotalMod, (*i)->GetAmount()); - break; - } - break; - } - // Rage of Rivendare - case 7293: - { - if (victim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DEATHKNIGHT, 0, 0x02000000, 0)) - AddPctF(DoneTotalMod, (*i)->GetSpellInfo()->GetRank() * 2.0f); - break; - } - // Twisted Faith - case 7377: - { - if (victim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_PRIEST, 0x8000, 0, 0, GetGUID())) - AddPctN(DoneTotalMod, (*i)->GetAmount()); - break; - } - // Marked for Death - case 7598: - case 7599: - case 7600: - case 7601: - case 7602: - { - if (victim->GetAuraEffect(SPELL_AURA_MOD_STALKED, SPELLFAMILY_HUNTER, 0x400, 0, 0)) - AddPctN(DoneTotalMod, (*i)->GetAmount()); - break; - } - // Dirty Deeds - case 6427: - case 6428: - case 6579: - case 6580: - { - if (victim->HasAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, spellProto, this)) - { - // effect 0 has expected value but in negative state - int32 bonus = -(*i)->GetBase()->GetEffect(0)->GetAmount(); - AddPctN(DoneTotalMod, bonus); - } - break; - } } } @@ -9847,71 +9793,35 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin case SPELLFAMILY_MAGE: // Ice Lance if (spellProto->SpellIconID == 186) - { if (victim->HasAuraState(AURA_STATE_FROZEN, spellProto, this)) - { - // Glyph of Ice Lance - if (owner->HasAura(56377) && victim->getLevel() > owner->getLevel()) - DoneTotalMod *= 4.0f; - else - DoneTotalMod *= 3.0f; - } - } + DoneTotalMod *= 2.0f; // Torment the weak - if (spellProto->SpellFamilyFlags[0] & 0x20600021 || spellProto->SpellFamilyFlags[1] & 0x9000) + if (spellProto->GetSchoolMask() & SPELL_SCHOOL_MASK_ARCANE) + { if (victim->HasAuraWithMechanic((1<GetSpellInfo()->SpellIconID == 3263) + { + if ((*i)->GetSpellInfo()->SpellIconID == 2215) { AddPctN(DoneTotalMod, (*i)->GetAmount()); break; } + } } + } break; case SPELLFAMILY_PRIEST: - // Mind Flay - if (spellProto->SpellFamilyFlags[0] & 0x800000) - { - // Glyph of Shadow Word: Pain - if (AuraEffect* aurEff = GetAuraEffect(55687, 0)) - // Increase Mind Flay damage if Shadow Word: Pain present on target - if (victim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_PRIEST, 0x8000, 0, 0, GetGUID())) - AddPctN(DoneTotalMod, aurEff->GetAmount()); - - // Twisted Faith - Mind Flay part - if (AuraEffect* aurEff = GetAuraEffect(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS, SPELLFAMILY_PRIEST, 2848, 1)) - // Increase Mind Flay damage if Shadow Word: Pain present on target - if (victim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_PRIEST, 0x8000, 0, 0, GetGUID())) - AddPctN(DoneTotalMod, aurEff->GetAmount()); - } // Smite - else if (spellProto->SpellFamilyFlags[0] & 0x80) + if (spellProto->SpellFamilyFlags[0] & 0x80) { // Glyph of Smite if (AuraEffect* aurEff = GetAuraEffect(55692, 0)) if (victim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_PRIEST, 0x100000, 0, 0, GetGUID())) AddPctN(DoneTotalMod, aurEff->GetAmount()); } - // Shadow Word: Death - else if (spellProto->SpellFamilyFlags[1] & 0x2) - { - // Glyph of Shadow Word: Death - if (AuraEffect* aurEff = GetAuraEffect(55682, 1)) - if (victim->HasAuraState(AURA_STATE_HEALTHLESS_35_PERCENT)) - AddPctN(DoneTotalMod, aurEff->GetAmount()); - } - break; - case SPELLFAMILY_DRUID: - // Thorns - if (spellProto->SpellFamilyFlags[0] & 0x100) - { - // Brambles - if (AuraEffect* aurEff = GetAuraEffectOfRankedSpell(16836, 0)) - AddPctN(DoneTotalMod, aurEff->GetAmount()); - } break; case SPELLFAMILY_WARLOCK: // Fire and Brimstone @@ -9929,59 +9839,17 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin // Drain Soul - increased damage for targets under 25 % HP if (spellProto->SpellFamilyFlags[0] & 0x00004000) if (HasAura(100001)) - DoneTotalMod *= 4; - // Shadow Bite (15% increase from each dot) + DoneTotalMod *= 2; + // Shadow Bite (30% increase from each dot) if (spellProto->SpellFamilyFlags[1] & 0x00400000 && isPet()) if (uint8 count = victim->GetDoTsByCaster(GetOwnerGUID())) - AddPctN(DoneTotalMod, 15 * count); - break; - case SPELLFAMILY_HUNTER: - // Steady Shot - if (spellProto->SpellFamilyFlags[1] & 0x1) - if (AuraEffect* aurEff = GetAuraEffect(56826, 0)) // Glyph of Steady Shot - if (victim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_HUNTER, 0x00004000, 0, 0, GetGUID())) - AddPctN(DoneTotalMod, aurEff->GetAmount()); + AddPctN(DoneTotalMod, 30 * count); break; case SPELLFAMILY_DEATHKNIGHT: - // Improved Icy Touch - if (spellProto->SpellFamilyFlags[0] & 0x2) - if (AuraEffect* aurEff = GetDummyAuraEffect(SPELLFAMILY_DEATHKNIGHT, 2721, 0)) - AddPctN(DoneTotalMod, aurEff->GetAmount()); - // Sigil of the Vengeful Heart if (spellProto->SpellFamilyFlags[0] & 0x2000) if (AuraEffect* aurEff = GetAuraEffect(64962, EFFECT_1)) - AddPctN(DoneTotal, aurEff->GetAmount()); - - // Glacier Rot - if (spellProto->SpellFamilyFlags[0] & 0x2 || spellProto->SpellFamilyFlags[1] & 0x6) - if (AuraEffect* aurEff = GetDummyAuraEffect(SPELLFAMILY_DEATHKNIGHT, 196, 0)) - if (victim->GetDiseasesByCaster(owner->GetGUID()) > 0) - AddPctN(DoneTotalMod, aurEff->GetAmount()); - - // Impurity (dummy effect) - if (GetTypeId() == TYPEID_PLAYER) - { - PlayerSpellMap playerSpells = ToPlayer()->GetSpellMap(); - for (PlayerSpellMap::const_iterator itr = playerSpells.begin(); itr != playerSpells.end(); ++itr) - { - if (itr->second->state == PLAYERSPELL_REMOVED || itr->second->disabled) - continue; - switch (itr->first) - { - case 49220: - case 49633: - case 49635: - case 49636: - case 49638: - { - if (SpellInfo const* proto = sSpellMgr->GetSpellInfo(itr->first)) - AddPctN(ApCoeffMod, proto->Effects[0].CalcValue()); - } - break; - } - } - } + DoneTotal += aurEff->GetAmount(); break; } @@ -10085,8 +9953,7 @@ uint32 Unit::SpellDamageBonusTaken(Unit* caster, SpellInfo const* spellProto, ui { if (GetTypeId() != TYPEID_PLAYER) continue; - float mod = ToPlayer()->GetRatingBonusValue(CR_CRIT_TAKEN_MELEE) * (-8.0f); - AddPctF(TakenTotalMod, std::max(mod, float((*i)->GetAmount()))); + AddPctN(TakenTotalMod, (*i)->GetAmount()); } break; } -- cgit v1.2.3 From 50a271b81f807fc69d05401bbd6ce9c88b92aadf Mon Sep 17 00:00:00 2001 From: Spp Date: Thu, 16 Aug 2012 01:25:17 +0200 Subject: Core/Logging: Remove recently added "outOpCode" with outInfo(LOG_FILTER_OPCODE... (There is no need to create new function) Also, set config options to behave like old log system by default --- src/server/game/Server/WorldSocket.cpp | 4 +- src/server/shared/Logging/Appender.cpp | 18 ++++-- src/server/shared/Logging/Appender.h | 4 +- src/server/shared/Logging/Log.cpp | 8 --- src/server/worldserver/worldserver.conf.dist | 97 ++++++++++------------------ 5 files changed, 50 insertions(+), 81 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index f73e36f3fbd..a30702ded14 100644 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -194,7 +194,7 @@ int WorldSocket::SendPacket(WorldPacket const& pct) pkt = &buff; } - sLog->outOpCode(uint32(pkt->GetOpcode()), LookupOpcodeName(pkt->GetOpcode()), true); + sLog->outInfo(LOG_FILTER_OPCODES, "S->C: %s 0x%.4X (%u)", LookupOpcodeName(pkt->GetOpcode()), uint32(pkt->GetOpcode()), uint32(pkt->GetOpcode())); sScriptMgr->OnPacketSend(this, *pkt); @@ -719,7 +719,7 @@ int WorldSocket::ProcessIncoming(WorldPacket* new_pct) sLog->outTrace(LOG_FILTER_NETWORKIO, "%s", data.c_str()); } - sLog->outOpCode(uint32(Opcodes(opcode)), LookupOpcodeName(Opcodes(opcode)), false); + sLog->outInfo(LOG_FILTER_OPCODES, "C->S: %s 0x%.4X (%u)", LookupOpcodeName(Opcodes(opcode)), uint32(Opcodes(opcode)), uint32(Opcodes(opcode))); try { diff --git a/src/server/shared/Logging/Appender.cpp b/src/server/shared/Logging/Appender.cpp index 7950e045201..348ec4b3c7c 100644 --- a/src/server/shared/Logging/Appender.cpp +++ b/src/server/shared/Logging/Appender.cpp @@ -98,7 +98,7 @@ void Appender::write(LogMessage& message) message.prefix.push_back(' '); char text[MAX_QUERY_LEN]; - snprintf(text, MAX_QUERY_LEN, "[%-15s]", Appender::getLogFilterTypeString(message.type)); + snprintf(text, MAX_QUERY_LEN, "[%s]", Appender::getLogFilterTypeString(message.type)); message.prefix.append(text); } @@ -172,13 +172,13 @@ char const* Appender::getLogFilterTypeString(LogFilterType type) case LOG_FILTER_PLAYER: return "PLAYER"; case LOG_FILTER_PLAYER_LOADING: - return "PLAYER_LOADING"; + return "PLAYER LOADING"; case LOG_FILTER_PLAYER_ITEMS: - return "PLAYER_ITEMS"; + return "PLAYER ITEMS"; case LOG_FILTER_PLAYER_SKILLS: - return "PLAYER_SKILLS"; + return "PLAYER SKILLS"; case LOG_FILTER_PLAYER_CHATLOG: - return "PLAYER_CHATLOG"; + return "PLAYER CHATLOG"; case LOG_FILTER_LOOT: return "LOOT"; case LOG_FILTER_GUILD: @@ -209,8 +209,14 @@ char const* Appender::getLogFilterTypeString(LogFilterType type) return "SQL DRIVER"; case LOG_FILTER_SQL_DEV: return "SQL DEV"; + case LOG_FILTER_PLAYER_DUMP: + return "PLAYER DUMP"; + case LOG_FILTER_BATTLEFIELD: + return "BATTLEFIELD"; + case LOG_FILTER_SERVER_LOADING: + return "SERVER LOADING"; case LOG_FILTER_OPCODES: - return "OPCODES"; + return "OPCODE"; default: break; } diff --git a/src/server/shared/Logging/Appender.h b/src/server/shared/Logging/Appender.h index 56662bbee15..09ec8bfd081 100644 --- a/src/server/shared/Logging/Appender.h +++ b/src/server/shared/Logging/Appender.h @@ -65,12 +65,12 @@ enum LogFilterType LOG_FILTER_SQL_DEV, LOG_FILTER_PLAYER_DUMP, LOG_FILTER_BATTLEFIELD, - LOG_FILTER_OPCODES, + LOG_FILTER_SERVER_LOADING, + LOG_FILTER_OPCODES }; const uint8 MaxLogFilter = uint8(LOG_FILTER_OPCODES) + 1; - // Values assigned have their equivalent in enum ACE_Log_Priority enum LogLevel { diff --git a/src/server/shared/Logging/Log.cpp b/src/server/shared/Logging/Log.cpp index 82fb5b9461e..8e740ba83b8 100644 --- a/src/server/shared/Logging/Log.cpp +++ b/src/server/shared/Logging/Log.cpp @@ -486,14 +486,6 @@ void Log::outCommand(uint32 account, const char * str, ...) write(msg); } -void Log::outOpCode(uint32 op, const char* name, bool smsg) -{ - if (!ShouldLog(LOG_FILTER_OPCODES, LOG_LEVEL_DEBUG)) - return; - - outInfo(LOG_FILTER_OPCODES, "%s: %s 0x%.4X (%u)", smsg ? "S->C" : "C->S", name, op, op); -} - void Log::SetRealmID(uint32 id) { realm = id; diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index 2089b969e1a..61700de050b 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -2627,19 +2627,25 @@ PlayerDump.DisallowOverwrite = 1 # w - (Overwrite) # -Appender.Console=1,2,6 -Appender.Server=2,2,7,Server.log,w -Appender.GM=2,2,7,GM_%s.log -Appender.SQL=2,2,7,SQL.log -Appender.DBErrors=2,2,7,DBErrors.log -Appender.Char=2,2,7,Char.log,w -Appender.CharDump=2,2,0,chardumps/%s.log -Appender.RA=2,2,7,RA.log -Appender.Arenas=2,2,7,Arena.log +Appender.Console=1,5,0 +Appender.Server=2,2,0,Server.log,w +Appender.GM=2,2,0,GM.log +Appender.DBErrors=2,2,0,DBErrors.log +Appender.Char=2,2,0,Char.log,w +Appender.RA=2,2,0,RA.log +Appender.Warden=2,2,0,Warden.log +Appender.Chat=2,2,0,Chat.log +Appender.CharDump=2,2,0,%s.log +Appender.Arenas=2,2,0,Arena.log Appender.SQLDev=2,2,0,SQLDev.log -Appender.SQLDriver=2,2,7,SQLDriver.log -Appender.Warden=2,2,7,Warden.log -Appender.Chat=2,2,7,Chat.log +Appender.SQLDriver=2,2,0,SQLDriver.log + +# Appenders +# Description: List of Appenders to read from config +# (Using spaces as separator). +# Default: "Console Server GM DBErrors Char RA Warden Chat" + +Appenders=Console Server GM DBErrors Char RA Warden Chat # Logger config values: Given a logger "name" # Logger.name @@ -2691,50 +2697,8 @@ Appender.Chat=2,2,7,Chat.log # 37 - SQL Dev # 38 - Player Dump # 39 - Battlefield -# 40 - Opcodes - -Logger.Root=0,3,Console Server -Logger.Units=1,3,Console Server -Logger.Pets=2,3,Console Server -Logger.Vehicles=3,3,Console Server -Logger.TCSR=4,3,Console Server -Logger.AI=5,3,Console Server -Logger.MapScripts=6,3,Console Server -Logger.NetWork=7,3,Console Server -Logger.Spells=8,3,Console Server -Logger.Achievements=9,3,Console Server -Logger.Conditions=10,3,Console Server -Logger.Pool=11,3,Console Server -Logger.AuctionHouse=12,3,Console Server -Logger.Battlegrounds=13,3,Console Server -Logger.OutdoorPvP=14,3,Console Server -Logger.ChatSystem=15,3,Console Server -Logger.LFG=16,3,Console Server -Logger.Maps=17,3,Console Server -Logger.Player=18,3,Console Server -Logger.PlayerLoading=19,3,Console Server -Logger.PlayerItems=20,3,Console Server -Logger.PlayerSkills=21,3,Console Server -Logger.PlayerChat=22,3,Chat -Logger.Loot=23,3,Console Server -Logger.Guilds=24,3,Console Server -Logger.Transports=25,3,Console Server -Logger.SQL=26,2,Console Server DBErrors -Logger.GM=27,3,Console Server GM -Logger.RA=28,3,RA -Logger.Warden=29,3,Warden -Logger.Authserver=30,3,Console Server -Logger.Worldserver=31,3,Console Server -Logger.GameEvents=32,3,Console Server -Logger.Calendar=33,3,Console Server -Logger.Character=34,3,Char -Logger.Arenas=35,3,Arenas -Logger.SQLDriver=36,5,SQLDriver -Logger.SQLDev=37,3,SQLDev -Logger.CharDump=38,5,CharDump -Logger.Battlefield=39,3,Console Server -Logger.Opcodes=40,2,Console Server - +# 40 - Server Loading +# 41 - Opcodes (just id and name sent / received) # LogLevel # 0 - (Disabled) # 1 - (Trace) @@ -2747,17 +2711,24 @@ Logger.Opcodes=40,2,Console Server # AppenderList: List of appenders linked to logger # (Using spaces as separator). # -# Appenders -# Description: List of Appenders to read from config -# (Using spaces as separator). -# Default: "Console Server" -Appenders=Console Server GM Char Arenas Warden DBErrors CharDump +Logger.Root=0,3,Console Server +Logger.Chat=22,3,Chat +Logger.DBErrors=26,5,Console Server DBErrors +Logger.GM=27,3,Console Server GM +Logger.RA=28,3,RA +Logger.Warden=29,3,Warden +Logger.Character=34,3,Char +Logger.Arenas=35,3,Arenas +Logger.SQLDriver=36,5,SQLDriver +Logger.SQLDev=37,3,SQLDev +Logger.CharDump=38,3,CharDump +Logger.Load=40,3,Console Server # # Loggers # Description: List of Loggers to read from config # (Using spaces as separator). -# Default: "root" +# Default: "Root Chat DBErrors GM RA Warden Character Load" -Loggers=Root GM Character Arenas Warden SQL +Loggers=Root Chat DBErrors GM RA Warden Character Load -- cgit v1.2.3 From 60e608417eee5ad1822592d226c9b2e65096f98c Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 16 Aug 2012 00:29:05 +0100 Subject: Core/Spell: Update some comments in SpellEffect enum --- src/server/game/Miscellaneous/SharedDefines.h | 34 +++++++++++++-------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index be9bba3a5a1..e1799e36663 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -712,7 +712,7 @@ enum SpellEffects SPELL_EFFECT_INSTAKILL = 1, SPELL_EFFECT_SCHOOL_DAMAGE = 2, SPELL_EFFECT_DUMMY = 3, - SPELL_EFFECT_PORTAL_TELEPORT = 4, // Unused (4.2.2) + SPELL_EFFECT_PORTAL_TELEPORT = 4, // Unused (4.3.4) SPELL_EFFECT_TELEPORT_UNITS = 5, SPELL_EFFECT_APPLY_AURA = 6, SPELL_EFFECT_ENVIRONMENTAL_DAMAGE = 7, @@ -721,9 +721,9 @@ enum SpellEffects SPELL_EFFECT_HEAL = 10, SPELL_EFFECT_BIND = 11, SPELL_EFFECT_PORTAL = 12, - SPELL_EFFECT_RITUAL_BASE = 13, // Unused (4.2.2) - SPELL_EFFECT_RITUAL_SPECIALIZE = 14, // Unused (4.2.2) - SPELL_EFFECT_RITUAL_ACTIVATE_PORTAL = 15, // Unused (4.2.2) + SPELL_EFFECT_RITUAL_BASE = 13, // Unused (4.3.4) + SPELL_EFFECT_RITUAL_SPECIALIZE = 14, // Unused (4.3.4) + SPELL_EFFECT_RITUAL_ACTIVATE_PORTAL = 15, // Unused (4.3.4) SPELL_EFFECT_QUEST_COMPLETE = 16, SPELL_EFFECT_WEAPON_DAMAGE_NOSCHOOL = 17, SPELL_EFFECT_RESURRECT = 18, @@ -759,8 +759,8 @@ enum SpellEffects SPELL_EFFECT_STEALTH = 48, SPELL_EFFECT_DETECT = 49, SPELL_EFFECT_TRANS_DOOR = 50, - SPELL_EFFECT_FORCE_CRITICAL_HIT = 51, // Unused (4.2.2) - SPELL_EFFECT_GUARANTEE_HIT = 52, // Unused (4.2.2) + SPELL_EFFECT_FORCE_CRITICAL_HIT = 51, // Unused (4.3.4) + SPELL_EFFECT_GUARANTEE_HIT = 52, // Unused (4.3.4) SPELL_EFFECT_ENCHANT_ITEM = 53, SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY = 54, SPELL_EFFECT_TAMECREATURE = 55, @@ -830,7 +830,7 @@ enum SpellEffects SPELL_EFFECT_APPLY_AREA_AURA_PET = 119, SPELL_EFFECT_TELEPORT_GRAVEYARD = 120, SPELL_EFFECT_NORMALIZED_WEAPON_DMG = 121, - SPELL_EFFECT_122 = 122, // Unused (4.2.2) + SPELL_EFFECT_122 = 122, // Unused (4.3.4) SPELL_EFFECT_SEND_TAXI = 123, SPELL_EFFECT_PULL_TOWARDS = 124, SPELL_EFFECT_MODIFY_THREAT_PERCENT = 125, @@ -871,7 +871,7 @@ enum SpellEffects SPELL_EFFECT_160 = 160, SPELL_EFFECT_TALENT_SPEC_COUNT = 161, SPELL_EFFECT_TALENT_SPEC_SELECT = 162, - SPELL_EFFECT_163 = 163, // Unused (4.2.2) + SPELL_EFFECT_163 = 163, // Unused (4.3.4) SPELL_EFFECT_REMOVE_AURA = 164, SPELL_EFFECT_165 = 165, SPELL_EFFECT_166 = 166, @@ -879,17 +879,17 @@ enum SpellEffects SPELL_EFFECT_168 = 168, SPELL_EFFECT_169 = 169, SPELL_EFFECT_170 = 170, - SPELL_EFFECT_171 = 171, // Summons gamebject - SPELL_EFFECT_172 = 172, // Aoe ressurection - SPELL_EFFECT_UNLOCK_GUILD_VAULT_TAB = 173, // Guild tab unlocked (guild perk) - SPELL_EFFECT_174 = 174, // - SPELL_EFFECT_175 = 175, // Unused (4.2.2) - SPELL_EFFECT_176 = 176, // Some kind of sanctuary effect (Vanish) + SPELL_EFFECT_171 = 171, // Summons gamebject + SPELL_EFFECT_172 = 172, // Aoe ressurection + SPELL_EFFECT_UNLOCK_GUILD_VAULT_TAB = 173, // Guild tab unlocked (guild perk) + SPELL_EFFECT_174 = 174, + SPELL_EFFECT_175 = 175, // Unused (4.3.4) + SPELL_EFFECT_176 = 176, // Some kind of sanctuary effect (Vanish) SPELL_EFFECT_177 = 177, - SPELL_EFFECT_178 = 178, + SPELL_EFFECT_178 = 178, // Unused (4.3.4) SPELL_EFFECT_179 = 179, - SPELL_EFFECT_180 = 180, - SPELL_EFFECT_181 = 181, + SPELL_EFFECT_180 = 180, // Unused (4.3.4) + SPELL_EFFECT_181 = 181, // Unused (4.3.4) SPELL_EFFECT_182 = 182, TOTAL_SPELL_EFFECTS = 183, }; -- cgit v1.2.3 From 7dbacc278a8a98393bee47aadca07d3004d5ffec Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 16 Aug 2012 01:11:16 +0100 Subject: Core: Fix build --- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 3 ++- src/server/shared/Logging/Log.h | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 35ed65f2727..e1b152735b9 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -884,7 +884,8 @@ void AuraEffect::CalculatePeriodic(Unit* caster, bool create, bool load) else if ((caster->HasAuraTypeWithAffectMask(SPELL_AURA_PERIODIC_HASTE, m_spellInfo) || m_spellInfo->AttributesEx5 & SPELL_ATTR5_HASTE_AFFECT_DURATION) && caster->GetFloatValue(UNIT_MOD_CAST_SPEED) != 1.0f) { // Calculate number of ticks we must have - float ticks = roundf(GetBase()->GetDuration() / (m_amplitude / (1.0f + (1.0f - caster->GetFloatValue(UNIT_MOD_CAST_SPEED))))); + float ticks = GetBase()->GetDuration() / (m_amplitude / (1.0f + (1.0f - caster->GetFloatValue(UNIT_MOD_CAST_SPEED)))); + ticks = 0.5f + (float)(int)ticks; // round m_amplitude = GetBase()->GetDuration() / int32(ticks); } diff --git a/src/server/shared/Logging/Log.h b/src/server/shared/Logging/Log.h index 45e42aec1fc..cd1e9dc80df 100644 --- a/src/server/shared/Logging/Log.h +++ b/src/server/shared/Logging/Log.h @@ -53,7 +53,6 @@ class Log void outWarn(LogFilterType f, char const* str, ...) ATTR_PRINTF(3,4); void outError(LogFilterType f, char const* str, ...) ATTR_PRINTF(3,4); void outFatal(LogFilterType f, char const* str, ...) ATTR_PRINTF(3,4); - void outOpCode(uint32 op, const char* name, bool smsg); void EnableDBAppenders(); void outCommand(uint32 account, const char * str, ...) ATTR_PRINTF(3, 4); -- cgit v1.2.3 From 0187644a83f97f961c29c731ae1daacdc518f01f Mon Sep 17 00:00:00 2001 From: Tuxity Date: Thu, 16 Aug 2012 13:17:40 +0200 Subject: Core/Stats: Correct druid weapon damage formula, and fix a small mistake. Thx to @cocolino for the help. --- src/server/game/Entities/Player/Player.cpp | 2 +- src/server/game/Entities/Unit/StatSystem.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 1915e2094a7..ffa15d665be 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -8167,7 +8167,7 @@ void Player::_ApplyWeaponDamage(uint8 slot, ItemTemplate const* proto, ScalingSt SetBaseWeaponDamage(attType, MAXDAMAGE, damage); } - if (proto->Delay) + if (proto->Delay && !IsInFeralForm()) { if (slot == EQUIPMENT_SLOT_RANGED) SetAttackTime(RANGED_ATTACK, apply ? proto->Delay: BASE_ATTACK_TIME); diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index 33e78851c71..48aebc7d17e 100755 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -428,13 +428,13 @@ void Player::CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bo { if (GetShapeshiftForm() == FORM_CAT) { - weapon_mindamage = weapon_mindamage / att_speed; - weapon_maxdamage = weapon_maxdamage / att_speed; + weapon_mindamage = weapon_mindamage / GetWeaponForAttack(BASE_ATTACK, true)->GetTemplate()->Delay / 1000; + weapon_maxdamage = weapon_maxdamage / GetWeaponForAttack(BASE_ATTACK, true)->GetTemplate()->Delay / 1000; } else if (GetShapeshiftForm() == FORM_BEAR) { - weapon_mindamage = weapon_mindamage / att_speed * 2.5f; - weapon_maxdamage = weapon_maxdamage / att_speed * 2.5f; + weapon_mindamage = weapon_mindamage / GetWeaponForAttack(BASE_ATTACK, true)->GetTemplate()->Delay / 1000 + weapon_mindamage / 2.5; + weapon_maxdamage = weapon_mindamage / GetWeaponForAttack(BASE_ATTACK, true)->GetTemplate()->Delay / 1000 + weapon_maxdamage / 2.5; } } else if (!CanUseAttackType(attType)) //check if player not in form but still can't use (disarm case) -- cgit v1.2.3 From 21b1b72a6b0867d0ea5d1c9fbfeeac3240054b8d Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 16 Aug 2012 13:27:54 +0200 Subject: Scripts/Commands: Fixed remaining crashes caused by removal of dbc locales --- src/server/game/Entities/Player/Player.cpp | 6 ++---- src/server/scripts/Commands/cs_go.cpp | 2 +- src/server/scripts/Commands/cs_learn.cpp | 25 +++---------------------- src/server/scripts/Commands/cs_misc.cpp | 15 +++++++-------- src/server/scripts/Commands/cs_modify.cpp | 2 +- src/server/scripts/Commands/cs_titles.cpp | 2 +- 6 files changed, 15 insertions(+), 37 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index ffa15d665be..ff25ff3b7f6 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -2538,7 +2538,7 @@ void Player::RegenerateAll() m_regenTimerCount -= 2000; } - + if (m_holyPowerRegenTimerCount >= 10000 && getClass() == CLASS_PALADIN) { Regenerate(POWER_HOLY_POWER); @@ -13107,7 +13107,7 @@ void Player::SendEquipError(InventoryResult msg, Item* pItem, Item* pItem2, uint GetSession()->SendPacket(&data); } -void Player::SendBuyError(BuyResult msg, Creature* creature, uint32 item, uint32 param) +void Player::SendBuyError(BuyResult msg, Creature* creature, uint32 item, uint32 /*param*/) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_BUY_FAILED"); WorldPacket data(SMSG_BUY_FAILED, (8+4+4+1)); @@ -13332,8 +13332,6 @@ void Player::ApplyReforgeEnchantment(Item* item, bool apply) if (!reforge) return; - ItemTemplate const* proto = item->GetTemplate(); - float removeValue = item->GetReforgableStat(ItemModType(reforge->SourceStat)) * reforge->SourceMultiplier; float addValue = removeValue * reforge->FinalMultiplier; diff --git a/src/server/scripts/Commands/cs_go.cpp b/src/server/scripts/Commands/cs_go.cpp index f7371884da2..b0f1eed5d5c 100644 --- a/src/server/scripts/Commands/cs_go.cpp +++ b/src/server/scripts/Commands/cs_go.cpp @@ -444,7 +444,7 @@ public: if (map->Instanceable()) { - handler->PSendSysMessage(LANG_INVALID_ZONE_MAP, areaEntry->ID, areaEntry->area_name[handler->GetSessionDbcLocale()], map->GetId(), map->GetMapName()); + handler->PSendSysMessage(LANG_INVALID_ZONE_MAP, areaEntry->ID, areaEntry->area_name, map->GetId(), map->GetMapName()); handler->SetSentErrorMessage(true); return false; } diff --git a/src/server/scripts/Commands/cs_learn.cpp b/src/server/scripts/Commands/cs_learn.cpp index cfdfc66f991..dcfa6b6b04c 100644 --- a/src/server/scripts/Commands/cs_learn.cpp +++ b/src/server/scripts/Commands/cs_learn.cpp @@ -394,33 +394,14 @@ public: !skillInfo->canLink) // only prof with recipes have set continue; - int locale = handler->GetSessionDbcLocale(); - name = skillInfo->name[locale]; + name = skillInfo->name; if (name.empty()) continue; if (!Utf8FitTo(name, namePart)) - { - locale = 0; - for (; locale < TOTAL_LOCALES; ++locale) - { - if (locale == handler->GetSessionDbcLocale()) - continue; - - name = skillInfo->name[locale]; - if (name.empty()) - continue; - - if (Utf8FitTo(name, namePart)) - break; - } - } + continue; - if (locale < TOTAL_LOCALES) - { - targetSkillInfo = skillInfo; - break; - } + targetSkillInfo = skillInfo; } if (!targetSkillInfo) diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index ba0dc5667db..7ea681170b4 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -1505,7 +1505,7 @@ public: if (!target->GetSkillValue(skill)) { - handler->PSendSysMessage(LANG_SET_SKILL_ERROR, tNameLink.c_str(), skill, skillLine->name[handler->GetSessionDbcLocale()]); + handler->PSendSysMessage(LANG_SET_SKILL_ERROR, tNameLink.c_str(), skill, skillLine->name); handler->SetSentErrorMessage(true); return false; } @@ -1516,7 +1516,7 @@ public: return false; target->SetSkill(skill, target->GetSkillStep(skill), level, max); - handler->PSendSysMessage(LANG_SET_SKILL, skill, skillLine->name[handler->GetSessionDbcLocale()], tNameLink.c_str(), level, max); + handler->PSendSysMessage(LANG_SET_SKILL, skill, skillLine->name, tNameLink.c_str(), level, max); return true; } @@ -1754,7 +1754,6 @@ public: handler->PSendSysMessage(LANG_PINFO_LEVEL, raceStr.c_str(), ClassStr.c_str(), timeStr.c_str(), level, gold, silv, copp); // Add map, zone, subzone and phase to output - int locale = handler->GetSessionDbcLocale(); std::string areaName = ""; std::string zoneName = ""; @@ -1763,22 +1762,22 @@ public: AreaTableEntry const* area = GetAreaEntryByAreaID(areaId); if (area) { - areaName = area->area_name[locale]; + areaName = area->area_name; AreaTableEntry const* zone = GetAreaEntryByAreaID(area->zone); if (zone) - zoneName = zone->area_name[locale]; + zoneName = zone->area_name; } if (target) { if (!zoneName.empty()) - handler->PSendSysMessage(LANG_PINFO_MAP_ONLINE, map->name[locale], zoneName.c_str(), areaName.c_str(), phase); + handler->PSendSysMessage(LANG_PINFO_MAP_ONLINE, map->name, zoneName.c_str(), areaName.c_str(), phase); else - handler->PSendSysMessage(LANG_PINFO_MAP_ONLINE, map->name[locale], areaName.c_str(), "", phase); + handler->PSendSysMessage(LANG_PINFO_MAP_ONLINE, map->name, areaName.c_str(), "", phase); } else - handler->PSendSysMessage(LANG_PINFO_MAP_OFFLINE, map->name[locale], areaName.c_str()); + handler->PSendSysMessage(LANG_PINFO_MAP_OFFLINE, map->name, areaName.c_str()); return true; } diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index dee8a52debd..beb5db62dfa 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -1231,7 +1231,7 @@ public: if (factionEntry->reputationListID < 0) { - handler->PSendSysMessage(LANG_COMMAND_FACTION_NOREP_ERROR, factionEntry->name[handler->GetSessionDbcLocale()], factionId); + handler->PSendSysMessage(LANG_COMMAND_FACTION_NOREP_ERROR, factionEntry->name, factionId); handler->SetSentErrorMessage(true); return false; } diff --git a/src/server/scripts/Commands/cs_titles.cpp b/src/server/scripts/Commands/cs_titles.cpp index 0a3b430ab2c..cb52844c626 100644 --- a/src/server/scripts/Commands/cs_titles.cpp +++ b/src/server/scripts/Commands/cs_titles.cpp @@ -94,7 +94,7 @@ public: target->SetTitle(titleInfo); // to be sure that title now known target->SetUInt32Value(PLAYER_CHOSEN_TITLE, titleInfo->bit_index); - handler->PSendSysMessage(LANG_TITLE_CURRENT_RES, id, titleInfo->name[handler->GetSessionDbcLocale()], tNameLink.c_str()); + handler->PSendSysMessage(LANG_TITLE_CURRENT_RES, id, titleInfo->name, tNameLink.c_str()); return true; } -- cgit v1.2.3 From 7cf825ffce2f640d19f8c4d12391c379a224ddb9 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 16 Aug 2012 14:58:55 +0200 Subject: Core/Players: Updated size of exploration fields --- src/server/game/Entities/Player/Player.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 0237a976648..70cf835531b 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -60,7 +60,7 @@ typedef std::deque PlayerMails; #define PLAYER_MAX_SKILLS 128 #define PLAYER_MAX_DAILY_QUESTS 25 -#define PLAYER_EXPLORED_ZONES_SIZE 128 +#define PLAYER_EXPLORED_ZONES_SIZE 156 // Note: SPELLMOD_* values is aura types in fact enum SpellModType -- cgit v1.2.3 From c27dfa224d056b97dbd80df67d46bd191f212d65 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 16 Aug 2012 14:59:21 +0200 Subject: Core/Players: Set PLAYER_PROFESSION_SKILL_LINE_1 fields not only when loading from db --- src/server/game/Entities/Player/Player.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index ff25ff3b7f6..3d204eaec6a 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -6443,6 +6443,12 @@ void Player::SetSkill(uint16 id, uint16 step, uint16 newVal, uint16 maxVal) if (SkillLineAbilityEntry const* pAbility = sSkillLineAbilityStore.LookupEntry(j)) if (pAbility->skillId == id) removeSpell(sSpellMgr->GetFirstSpellInChain(pAbility->spellId)); + + // Clear profession lines + if (GetUInt32Value(PLAYER_PROFESSION_SKILL_LINE_1) == id) + SetUInt32Value(PLAYER_PROFESSION_SKILL_LINE_1, 0); + else if (GetUInt32Value(PLAYER_PROFESSION_SKILL_LINE_1 + 1) == id) + SetUInt32Value(PLAYER_PROFESSION_SKILL_LINE_1 + 1, 0); } } else if (newVal) //add @@ -6455,14 +6461,22 @@ void Player::SetSkill(uint16 id, uint16 step, uint16 newVal, uint16 maxVal) if (!GetUInt16Value(PLAYER_SKILL_LINEID_0 + field, offset)) { - SkillLineEntry const* pSkill = sSkillLineStore.LookupEntry(id); - if (!pSkill) + SkillLineEntry const* skillEntry = sSkillLineStore.LookupEntry(id); + if (!skillEntry) { sLog->outError(LOG_FILTER_GENERAL, "Skill not found in SkillLineStore: skill #%u", id); return; } SetUInt16Value(PLAYER_SKILL_LINEID_0 + field, offset, id); + if (skillEntry->categoryId == SKILL_CATEGORY_PROFESSION) + { + if (!GetUInt32Value(PLAYER_PROFESSION_SKILL_LINE_1)) + SetUInt32Value(PLAYER_PROFESSION_SKILL_LINE_1, id); + else if (!GetUInt32Value(PLAYER_PROFESSION_SKILL_LINE_1 + 1)) + SetUInt32Value(PLAYER_PROFESSION_SKILL_LINE_1 + 1, id); + } + SetUInt16Value(PLAYER_SKILL_STEP_0 + field, offset, step); SetUInt16Value(PLAYER_SKILL_RANK_0 + field, offset, newVal); SetUInt16Value(PLAYER_SKILL_MAX_RANK_0 + field, offset, maxVal); -- cgit v1.2.3 From 69469d52956dc8cf38c3b9827be087232f361009 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 16 Aug 2012 16:36:23 +0200 Subject: Core/Items: Fixed disenchanting --- src/server/game/DataStores/DBCStructure.h | 2 +- src/server/game/Entities/Item/Item.cpp | 8 +++----- src/server/game/Entities/Item/Item.h | 5 +++-- src/server/game/Globals/ObjectMgr.cpp | 13 +++++++------ 4 files changed, 14 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 948647dd6ab..1ca295fd7ba 100644 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -1288,7 +1288,7 @@ struct ItemDisenchantLootEntry { uint32 Id; uint32 ItemClass; - int32 Unk; + int32 ItemSubClass; uint32 ItemQuality; uint32 MinItemLevel; uint32 MaxItemLevel; diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index 12c6861bb47..fc8bcf0cbae 100755 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -1319,9 +1319,8 @@ bool Item::HasStats() const } // used by mail items, transmog cost, stationeryinfo and others -uint32 Item::GetSellPrice(bool& normalSellPrice) const +uint32 Item::GetSellPrice(ItemTemplate const* proto, bool& normalSellPrice) { - ItemTemplate const* proto = GetTemplate(); normalSellPrice = true; if (proto->Flags2 & ITEM_FLAGS_EXTRA_HAS_NORMAL_PRICE) @@ -1444,9 +1443,8 @@ uint32 Item::GetSellPrice(bool& normalSellPrice) const } } -uint32 Item::GetSpecialPrice(uint32 minimumPrice) const +uint32 Item::GetSpecialPrice(ItemTemplate const* proto, uint32 minimumPrice /*= 10000*/) { - ItemTemplate const* proto = GetTemplate(); uint32 cost = 0; if (proto->Flags2 & ITEM_FLAGS_EXTRA_HAS_NORMAL_PRICE) @@ -1454,7 +1452,7 @@ uint32 Item::GetSpecialPrice(uint32 minimumPrice) const else { bool normalPrice; - cost = GetSellPrice(normalPrice); + cost = Item::GetSellPrice(proto, normalPrice); if (!normalPrice) { diff --git a/src/server/game/Entities/Item/Item.h b/src/server/game/Entities/Item/Item.h index 0ae4ddac31e..f8d5428e6e8 100755 --- a/src/server/game/Entities/Item/Item.h +++ b/src/server/game/Entities/Item/Item.h @@ -349,7 +349,8 @@ class Item : public Object bool CanBeTransmogrified() const; bool CanTransmogrify() const; static bool CanTransmogrifyItemWithItem(Item const* transmogrified, Item const* transmogrifier); - uint32 GetSpecialPrice(uint32 minimumPrice = 10000) const; + static uint32 GetSpecialPrice(ItemTemplate const* proto, uint32 minimumPrice = 10000); + uint32 GetSpecialPrice(uint32 minimumPrice = 10000) const { return Item::GetSpecialPrice(GetTemplate(), minimumPrice); } uint32 GetVisibleEntry() const { @@ -358,7 +359,7 @@ class Item : public Object return GetEntry(); } - uint32 GetSellPrice(bool& success) const; + static uint32 GetSellPrice(ItemTemplate const* proto, bool& success); int32 GetReforgableStat(ItemModType statType) const; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index e83be462285..2317d89ae24 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -2213,7 +2213,9 @@ void FillDisenchantFields(uint32* disenchantID, uint32* requiredDisenchantSkill, if ((itemTemplate.Flags & (ITEM_PROTO_FLAG_CONJURED | ITEM_PROTO_FLAG_UNK6)) || itemTemplate.Bonding == BIND_QUEST_ITEM || itemTemplate.Area || itemTemplate.Map || itemTemplate.Stackable > 1 || - !(itemTemplate.SellPrice || sItemCurrencyCostStore.LookupEntry(itemTemplate.ItemId))) + itemTemplate.Quality < ITEM_QUALITY_UNCOMMON || itemTemplate.Quality > ITEM_QUALITY_EPIC || + !(itemTemplate.Class == ITEM_CLASS_ARMOR || itemTemplate.Class == ITEM_CLASS_WEAPON) || + !(Item::GetSpecialPrice(&itemTemplate) || sItemCurrencyCostStore.LookupEntry(itemTemplate.ItemId))) return; for (uint32 i = 0; i < sItemDisenchantLootStore.GetNumRows(); ++i) @@ -2227,15 +2229,14 @@ void FillDisenchantFields(uint32* disenchantID, uint32* requiredDisenchantSkill, disenchant->MinItemLevel <= itemTemplate.ItemLevel && disenchant->MaxItemLevel >= itemTemplate.ItemLevel) { - // extra check for epics in range 90 - 99 - if (disenchant->MinItemLevel < 90) + if (disenchant->Id == 60 || disenchant->Id == 61) // epic item disenchant ilvl range 66-99 (classic) { if (itemTemplate.RequiredLevel > 60 || itemTemplate.RequiredSkillRank > 300) - continue; + continue; // skip to epic item disenchant ilvl range 90-199 (TBC) } - else + else if (disenchant->Id == 66 || disenchant->Id == 67) // epic item disenchant ilvl range 90-199 (TBC) { - if (itemTemplate.RequiredLevel <= 60 || itemTemplate.RequiredSkillRank <= 300) + if (itemTemplate.RequiredLevel <= 60 || (itemTemplate.RequiredSkill && itemTemplate.RequiredSkillRank <= 300)) continue; } -- cgit v1.2.3 From 43bae31ff835fb0e880ff168acb0de716244d881 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 16 Aug 2012 20:11:30 +0200 Subject: Core/Items: Fixed transmogrifying chest pieces (robe/chest have different inventoryType) --- src/server/game/Entities/Item/Item.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index fc8bcf0cbae..4d50f9375f1 100755 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -1299,7 +1299,8 @@ bool Item::CanTransmogrifyItemWithItem(Item const* transmogrified, Item const* t return false; if (proto1->InventoryType != proto2->InventoryType && - (proto1->Class != ITEM_CLASS_WEAPON || (proto2->InventoryType != INVTYPE_WEAPONMAINHAND && proto2->InventoryType != INVTYPE_WEAPONOFFHAND))) + (proto1->Class != ITEM_CLASS_WEAPON || (proto2->InventoryType != INVTYPE_WEAPONMAINHAND && proto2->InventoryType != INVTYPE_WEAPONOFFHAND)) && + (proto1->Class != ITEM_CLASS_ARMOR || (proto1->InventoryType != INVTYPE_CHEST && proto2->InventoryType != INVTYPE_ROBE && proto1->InventoryType != INVTYPE_ROBE && proto2->InventoryType != INVTYPE_CHEST))) return false; return true; -- cgit v1.2.3 From 759e73c78f138094a28068286d2f44c9e1162bb6 Mon Sep 17 00:00:00 2001 From: Greymane Date: Thu, 16 Aug 2012 19:55:01 +0100 Subject: Core/Spells: * Implemented aura 328 SPELL_AURA_PROC_ON_POWER_AMOUNT. * Added eclipse power energize handling. Closes #7417 --- .../2012_08_15_01_world_spell_script_names_434.sql | 5 + src/server/game/Entities/Player/Player.cpp | 16 +++ src/server/game/Entities/Unit/Unit.cpp | 159 +++++++++++++++++---- src/server/game/Entities/Unit/Unit.h | 4 +- src/server/game/Spells/Auras/SpellAuraDefines.h | 2 +- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 2 +- src/server/game/Spells/Auras/SpellAuras.cpp | 4 + src/server/game/Spells/SpellMgr.cpp | 6 + src/server/scripts/Spells/spell_druid.cpp | 125 ++++++++++++++++ 9 files changed, 296 insertions(+), 27 deletions(-) create mode 100644 sql/updates/world/2012_08_15_01_world_spell_script_names_434.sql (limited to 'src') diff --git a/sql/updates/world/2012_08_15_01_world_spell_script_names_434.sql b/sql/updates/world/2012_08_15_01_world_spell_script_names_434.sql new file mode 100644 index 00000000000..b280367c811 --- /dev/null +++ b/sql/updates/world/2012_08_15_01_world_spell_script_names_434.sql @@ -0,0 +1,5 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` IN (2912,5176,78674); +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(2912, 'spell_dru_eclipse_energize'), +(5176, 'spell_dru_eclipse_energize'), +(78674, 'spell_dru_eclipse_energize'); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 3d204eaec6a..5fad57c3b0d 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -2391,6 +2391,7 @@ void Player::ProcessDelayedOperations() SetPower(POWER_RAGE, 0); SetPower(POWER_ENERGY, GetMaxPower(POWER_ENERGY)); + SetPower(POWER_ECLIPSE, 0); SpawnCorpseBones(); } @@ -2741,6 +2742,9 @@ void Player::ResetAllPowers() case POWER_RUNIC_POWER: SetPower(POWER_RUNIC_POWER, 0); break; + case POWER_ECLIPSE: + SetPower(POWER_ECLIPSE, 0); + break; default: break; } @@ -5147,6 +5151,7 @@ void Player::ResurrectPlayer(float restore_percent, bool applySickness) SetPower(POWER_RAGE, 0); SetPower(POWER_ENERGY, uint32(GetMaxPower(POWER_ENERGY)*restore_percent)); SetPower(POWER_FOCUS, uint32(GetMaxPower(POWER_FOCUS)*restore_percent)); + SetPower(POWER_ECLIPSE, 0); } // trigger update zone for alive state zone updates @@ -18652,7 +18657,12 @@ void Player::SaveToDB(bool create /*=false*/) { if (GetPowerIndexByClass(Powers(i), getClass()) != MAX_POWERS) { + // Eclipse Power isnt saved. + if (i == POWER_ECLIPSE) + continue; + stmt->setUInt32(index++, GetUInt32Value(UNIT_FIELD_POWER1 + storedPowers)); + if (++storedPowers >= MAX_STORED_POWERS) break; } @@ -18774,7 +18784,12 @@ void Player::SaveToDB(bool create /*=false*/) { if (GetPowerIndexByClass(Powers(i), getClass()) != MAX_POWERS) { + // Eclipse Power isnt saved. + if (i == POWER_ECLIPSE) + continue; + stmt->setUInt32(index++, GetUInt32Value(UNIT_FIELD_POWER1 + storedPowers)); + if (++storedPowers >= MAX_STORED_POWERS) break; } @@ -23175,6 +23190,7 @@ void Player::ResurectUsingRequestData() SetPower(POWER_RAGE, 0); SetPower(POWER_ENERGY, GetMaxPower(POWER_ENERGY)); SetPower(POWER_FOCUS, GetMaxPower(POWER_FOCUS)); + SetPower(POWER_ECLIPSE, 0); SpawnCorpseBones(); } diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 5ce424738b2..5a4cba9d58b 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -4978,6 +4978,127 @@ bool Unit::HandleSpellCritChanceAuraProc(Unit* victim, uint32 /*damage*/, AuraEf return true; } +bool Unit::HandleAuraProcOnPowerAmount(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown) +{ + // Get triggered aura spell info + SpellInfo const* auraSpellInfo = triggeredByAura->GetSpellInfo(); + + // Get effect index used for the proc + uint32 effIndex = triggeredByAura->GetEffIndex(); + + // Power amount required to proc the spell + int32 powerAmountRequired = triggeredByAura->GetAmount(); + // Power type required to proc + Powers powerRequired = Powers(auraSpellInfo->Effects[triggeredByAura->GetEffIndex()].MiscValue); + + // Set trigger spell id, target, custom basepoints + uint32 trigger_spell_id = auraSpellInfo->Effects[triggeredByAura->GetEffIndex()].TriggerSpell; + + Unit* target = NULL; + int32 basepoints0 = 0; + + Item* castItem = triggeredByAura->GetBase()->GetCastItemGUID() && GetTypeId() == TYPEID_PLAYER + ? ToPlayer()->GetItemByGuid(triggeredByAura->GetBase()->GetCastItemGUID()) : NULL; + + /* Try handle unknown trigger spells or with invalid power amount or misc value + if (sSpellMgr->GetSpellInfo(trigger_spell_id) == NULL || powerAmountRequired == NULL || powerRequired >= MAX_POWER) + { + switch (auraSpellInfo->SpellFamilyName) + { + case SPELLFAMILY_GENERIC: + { + break; + } + } + }*/ + + // All ok. Check current trigger spell + SpellInfo const* triggerEntry = sSpellMgr->GetSpellInfo(trigger_spell_id); + if (triggerEntry == NULL) + { + // Not cast unknown spell + // sLog->outError("Unit::HandleAuraProcOnPowerAmount: Spell %u have 0 in EffectTriggered[%d], not handled custom case?", auraSpellInfo->Id, triggeredByAura->GetEffIndex()); + return false; + } + + // not allow proc extra attack spell at extra attack + if (m_extraAttacks && triggerEntry->HasEffect(SPELL_EFFECT_ADD_EXTRA_ATTACKS)) + return false; + + if (powerRequired == NULL || powerAmountRequired == NULL) + { + sLog->outError(LOG_FILTER_SPELLS_AURAS, "Unit::HandleAuraProcOnPowerAmount: Spell %u have 0 powerAmountRequired in EffectAmount[%d] or 0 powerRequired in EffectMiscValue, not handled custom case?", auraSpellInfo->Id, triggeredByAura->GetEffIndex()); + return false; + } + + if (GetPower(powerRequired) != powerAmountRequired) + return false; + + // Custom requirements (not listed in procEx) Warning! damage dealing after this + // Custom triggered spells + switch (auraSpellInfo->SpellFamilyName) + { + case SPELLFAMILY_DRUID: + { + // Eclipse Mastery Driver Passive + if (auraSpellInfo->Id == 79577) + { + uint32 solarEclipseMarker = 67483; + uint32 lunarEclipseMarker = 67484; + + switch(effIndex) + { + case 0: + { + // Do not proc if proc spell isnt starfire and starsurge + if (procSpell->Id != 2912 && procSpell->Id != 78674) + return false; + + if (HasAura(solarEclipseMarker)) + { + RemoveAurasDueToSpell(solarEclipseMarker); + CastSpell(this,lunarEclipseMarker,true); + } + break; + } + case 1: + { + // Do not proc if proc spell isnt wrath and starsurge + if (procSpell->Id != 5176 && procSpell->Id != 78674) + return false; + + if (HasAura(lunarEclipseMarker)) + { + RemoveAurasDueToSpell(lunarEclipseMarker); + CastSpell(this,solarEclipseMarker,true); + } + + break; + } + } + } + break; + } + } + + if (cooldown && GetTypeId() == TYPEID_PLAYER && ToPlayer()->HasSpellCooldown(trigger_spell_id)) + return false; + + // try detect target manually if not set + if (target == NULL) + target = !(procFlag & (PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS | PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_POS)) && triggerEntry && triggerEntry->IsPositive() ? this : victim; + + if (basepoints0) + CastCustomSpell(target, trigger_spell_id, &basepoints0, NULL, NULL, true, castItem, triggeredByAura); + else + CastSpell(target, trigger_spell_id, true, castItem, triggeredByAura); + + if (cooldown && GetTypeId() == TYPEID_PLAYER) + ToPlayer()->AddSpellCooldown(trigger_spell_id, 0, time(NULL) + cooldown); + + return true; +} + //victim may be NULL bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown) { @@ -6218,26 +6339,8 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere return true; } } - // Eclipse - if (dummySpell->SpellIconID == 2856 && GetTypeId() == TYPEID_PLAYER) - { - if (!procSpell || effIndex != 0) - return false; - - bool isWrathSpell = (procSpell->SpellFamilyFlags[0] & 1); - - if (!roll_chance_f(dummySpell->ProcChance * (isWrathSpell ? 0.6f : 1.0f))) - return false; - - target = this; - if (target->HasAura(isWrathSpell ? 48517 : 48518)) - return false; - - triggered_spell_id = isWrathSpell ? 48518 : 48517; - break; - } // Living Seed - else if (dummySpell->SpellIconID == 2860) + if (dummySpell->SpellIconID == 2860) { triggered_spell_id = 48504; basepoints0 = CalculatePctN(int32(damage), triggerAmount); @@ -9639,7 +9742,7 @@ void Unit::SendEnergizeSpellLog(Unit* victim, uint32 spellID, uint32 damage, Pow SendMessageToSet(&data, true); } -void Unit::EnergizeBySpell(Unit* victim, uint32 spellID, uint32 damage, Powers powerType) +void Unit::EnergizeBySpell(Unit* victim, uint32 spellID, int32 damage, Powers powerType) { SendEnergizeSpellLog(victim, spellID, damage, powerType); // needs to be called after sending spell log @@ -11732,9 +11835,9 @@ int32 Unit::ModifyPower(Powers power, int32 dVal) int32 curPower = (int32)GetPower(power); int32 val = dVal + curPower; - if (val <= 0) + if (val <= GetMinPower(power)) { - SetPower(power, 0); + SetPower(power, GetMinPower(power)); return -curPower; } @@ -13315,7 +13418,7 @@ void Unit::SetPower(Powers power, int32 val) if (maxPower < val) val = maxPower; - SetStatInt32Value(UNIT_FIELD_POWER1 + powerIndex, val); + SetInt32Value(UNIT_FIELD_POWER1 + powerIndex, val); if (IsInWorld()) { @@ -13351,7 +13454,7 @@ void Unit::SetMaxPower(Powers power, int32 val) return; int32 cur_power = GetPower(power); - SetStatInt32Value(UNIT_FIELD_MAXPOWER1 + powerIndex, val); + SetInt32Value(UNIT_FIELD_MAXPOWER1 + powerIndex, val); // group update if (GetTypeId() == TYPEID_PLAYER) @@ -13808,6 +13911,7 @@ bool InitTriggerAuraData() isNonTriggerAura[i] = false; isAlwaysTriggeredAura[i] = false; } + isTriggerAura[SPELL_AURA_PROC_ON_POWER_AMOUNT] = true; isTriggerAura[SPELL_AURA_DUMMY] = true; isTriggerAura[SPELL_AURA_MOD_CONFUSE] = true; isTriggerAura[SPELL_AURA_MOD_THREAT] = true; @@ -14095,6 +14199,13 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u takeCharges = true; break; } + case SPELL_AURA_PROC_ON_POWER_AMOUNT: + { + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); + if (HandleAuraProcOnPowerAmount(target, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown)) + takeCharges = true; + break; + } case SPELL_AURA_OBS_MOD_POWER: sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); if (HandleObsModEnergyAuraProc(target, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown)) diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index addf99a03ac..cafbfaac5b1 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1344,6 +1344,7 @@ class Unit : public WorldObject Powers getPowerType() const { return Powers(GetByteValue(UNIT_FIELD_BYTES_0, 3)); } void setPowerType(Powers power); int32 GetPower(Powers power) const; + int32 GetMinPower(Powers power) const { return power == POWER_ECLIPSE ? -100 : 0; } uint32 GetMaxPower(Powers power) const; void SetPower(Powers power, int32 val); void SetMaxPower(Powers power, int32 val); @@ -1555,7 +1556,7 @@ class Unit : public WorldObject void SendHealSpellLog(Unit* victim, uint32 SpellID, uint32 Damage, uint32 OverHeal, uint32 Absorb, bool critical = false); int32 HealBySpell(Unit* victim, SpellInfo const* spellInfo, uint32 addHealth, bool critical = false); void SendEnergizeSpellLog(Unit* victim, uint32 SpellID, uint32 Damage, Powers powertype); - void EnergizeBySpell(Unit* victim, uint32 SpellID, uint32 Damage, Powers powertype); + void EnergizeBySpell(Unit* victim, uint32 SpellID, int32 Damage, Powers powertype); uint32 SpellNonMeleeDamageLog(Unit* victim, uint32 spellID, uint32 damage); void CastSpell(SpellCastTargets const& targets, SpellInfo const* spellInfo, CustomSpellValues const* value, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0); @@ -2306,6 +2307,7 @@ class Unit : public WorldObject void DisableSpline(); private: bool IsTriggeredAtSpellProcEvent(Unit* victim, Aura* aura, SpellInfo const* procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const* & spellProcEvent); + bool HandleAuraProcOnPowerAmount(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); bool HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); bool HandleHasteAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); bool HandleSpellCritChanceAuraProc(Unit* victim, uint32 damage, AuraEffect* triggredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); diff --git a/src/server/game/Spells/Auras/SpellAuraDefines.h b/src/server/game/Spells/Auras/SpellAuraDefines.h index 04809277eb4..c261636e5b6 100755 --- a/src/server/game/Spells/Auras/SpellAuraDefines.h +++ b/src/server/game/Spells/Auras/SpellAuraDefines.h @@ -387,7 +387,7 @@ enum AuraType SPELL_AURA_325 = 325, SPELL_AURA_326 = 326, // phase related SPELL_AURA_327 = 327, - SPELL_AURA_328 = 328, + SPELL_AURA_PROC_ON_POWER_AMOUNT = 328, SPELL_AURA_MOD_RUNE_REGEN_SPEED = 329, // NYI SPELL_AURA_CAST_WHILE_WALKING = 330, // NYI SPELL_AURA_331 = 331, diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index e1b152735b9..edfc55dec44 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -381,7 +381,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleNULL, //325 SPELL_AURA_325 &AuraEffect::HandleNULL, //326 SPELL_AURA_326 &AuraEffect::HandleNULL, //327 SPELL_AURA_327 - &AuraEffect::HandleNULL, //328 SPELL_AURA_328 + &AuraEffect::HandleNoImmediateEffect, //328 SPELL_AURA_PROC_ON_POWER_AMOUNT implemented in Unit::HandleAuraProcOnPowerAmount &AuraEffect::HandleNULL, //329 SPELL_AURA_MOD_RUNE_REGEN_SPEED &AuraEffect::HandleNULL, //330 SPELL_AURA_CAST_WHILE_WALKING &AuraEffect::HandleNULL, //331 SPELL_AURA_331 diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index f5b9c5b2cf2..3409d135849 100755 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -921,6 +921,10 @@ bool Aura::CanBeSaved() const if (GetId() == 44413) return false; + // When a druid logins, he doesnt have either eclipse power, nor the marker auras, nor the eclipse buffs. Dont save them. + if (GetId() == 67483 || GetId() == 67484 || GetId() == 48517 || GetId() == 48518) + return false; + // don't save auras removed by proc system if (IsUsingCharges() && !GetCharges()) return false; diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index fda59f27e0e..9f8e0943b1e 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -3226,6 +3226,12 @@ void SpellMgr::LoadDbcDataCorrections() case 53246: // Marked for Death (Rank 5) spellInfo->EffectSpellClassMask[0] = flag96(0x00067801, 0x10820001, 0x00000801); break; + case 5176: // Wrath + case 2912: // Starfire + case 78674: // Starsurge + spellInfo->Effects[1].Effect = SPELL_EFFECT_DUMMY; + spellInfo->Effects[1].TargetA = TARGET_UNIT_CASTER; + break; case 70728: // Exploit Weakness (needs target selection script) case 70840: // Devious Minds (needs target selection script) spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_CASTER; diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index 0bd7397f1d4..cdfb62bd55c 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -644,6 +644,130 @@ class spell_dru_insect_swarm : public SpellScriptLoader } }; +enum EclipseSpells +{ + SPELL_DRUID_WRATH = 5176, + SPELL_DRUID_STARFIRE = 2912, + SPELL_DRUID_STARSURGE = 78674, + SPELL_DRUID_ECLIPSE_GENERAL_ENERGIZE = 89265, + SPELL_DRUID_STARSURGE_ENERGIZE = 86605, + SPELL_DRUID_LUNAR_ECLIPSE_MARKER = 67484, // Will make the yellow arrow on eclipse bar point to the blue side (lunar) + SPELL_DRUID_SOLAR_ECLIPSE_MARKER = 67483, // Will make the yellow arrow on eclipse bar point to the yellow side (solar) + SPELL_DRUID_SOLAR_ECLIPSE = 48517, + SPELL_DRUID_LUNAR_ECLIPSE = 48518, + TALENT_TREE_BALANCE = 752, +}; + +// Wrath, Starfire, and Starsurge +class spell_dru_eclipse_energize : public SpellScriptLoader +{ +public: + spell_dru_eclipse_energize() : SpellScriptLoader("spell_dru_eclipse_energize") { } + + class spell_dru_eclipse_energize_SpellScript : public SpellScript + { + PrepareSpellScript(spell_dru_eclipse_energize_SpellScript); + + int32 energizeAmount; + + bool Load() + { + if (GetCaster()->GetTypeId() != TYPEID_PLAYER) + return false; + + if (GetCaster()->ToPlayer()->getClass() != CLASS_DRUID) + return false; + + energizeAmount = 0; + + return true; + } + + void HandleEnergize(SpellEffIndex effIndex) + { + Player* caster = GetCaster()->ToPlayer(); + + // No boomy, no deal. + if (caster->GetPrimaryTalentTree(caster->GetActiveSpec()) != TALENT_TREE_BALANCE) + return; + + switch(GetSpellInfo()->Id) + { + case SPELL_DRUID_WRATH: + { + energizeAmount = -GetSpellInfo()->Effects[effIndex].BasePoints; // -13 + // If we are set to fill the lunar side or we've just logged in with 0 power.. + if ((!caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE_MARKER) && caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE_MARKER)) + || caster->GetPower(POWER_ECLIPSE) == 0) + { + caster->CastCustomSpell(caster,SPELL_DRUID_ECLIPSE_GENERAL_ENERGIZE,&energizeAmount,0,0,true); + // If the energize was due to 0 power, cast the eclipse marker aura + if (!caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE_MARKER)) + caster->CastSpell(caster,SPELL_DRUID_LUNAR_ECLIPSE_MARKER,true); + } + // The energizing effect brought us out of the solar eclipse, remove the aura + if (caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE) && caster->GetPower(POWER_ECLIPSE) <= 0) + caster->RemoveAurasDueToSpell(SPELL_DRUID_SOLAR_ECLIPSE); + break; + } + case SPELL_DRUID_STARFIRE: + { + energizeAmount = GetSpellInfo()->Effects[effIndex].BasePoints; // 20 + // If we are set to fill the solar side or we've just logged in with 0 power.. + if ((!caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE_MARKER) && caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE_MARKER)) + || caster->GetPower(POWER_ECLIPSE) == 0) + { + caster->CastCustomSpell(caster,SPELL_DRUID_ECLIPSE_GENERAL_ENERGIZE,&energizeAmount,0,0,true); + // If the energize was due to 0 power, cast the eclipse marker aura + if (!caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE_MARKER)) + caster->CastSpell(caster,SPELL_DRUID_SOLAR_ECLIPSE_MARKER,true); + } + // The energizing effect brought us out of the lunar eclipse, remove the aura + if (caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE) && caster->GetPower(POWER_ECLIPSE) >= 0) + caster->RemoveAura(SPELL_DRUID_LUNAR_ECLIPSE); + break; + } + case SPELL_DRUID_STARSURGE: + { + // If we are set to fill the solar side or we've just logged in with 0 power (confirmed with sniffs) + if ((!caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE_MARKER) && caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE_MARKER)) + || caster->GetPower(POWER_ECLIPSE) == 0) + { + energizeAmount = GetSpellInfo()->Effects[effIndex].BasePoints; // 15 + caster->CastCustomSpell(caster,SPELL_DRUID_STARSURGE_ENERGIZE,&energizeAmount,0,0,true); + + // If the energize was due to 0 power, cast the eclipse marker aura + if (!caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE_MARKER)) + caster->CastSpell(caster,SPELL_DRUID_SOLAR_ECLIPSE_MARKER,true); + } + else if (!caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE_MARKER) && caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE_MARKER)) + { + energizeAmount = -GetSpellInfo()->Effects[effIndex].BasePoints; // -15 + caster->CastCustomSpell(caster,SPELL_DRUID_STARSURGE_ENERGIZE,&energizeAmount,0,0,true); + } + // The energizing effect brought us out of the lunar eclipse, remove the aura + if (caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE) && caster->GetPower(POWER_ECLIPSE) >= 0) + caster->RemoveAura(SPELL_DRUID_LUNAR_ECLIPSE); + // The energizing effect brought us out of the solar eclipse, remove the aura + else if (caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE) && caster->GetPower(POWER_ECLIPSE) <= 0) + caster->RemoveAura(SPELL_DRUID_SOLAR_ECLIPSE); + break; + } + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_dru_eclipse_energize_SpellScript::HandleEnergize, EFFECT_1, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_dru_eclipse_energize_SpellScript; + } +}; + void AddSC_druid_spell_scripts() { new spell_dru_glyph_of_starfire(); @@ -659,4 +783,5 @@ void AddSC_druid_spell_scripts() new spell_dru_savage_roar(); new spell_dru_survival_instincts(); new spell_dru_insect_swarm(); + new spell_dru_eclipse_energize(); } -- cgit v1.2.3 From 21fb427ffc41858edd8edc21280609ddca0d6b22 Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 16 Aug 2012 20:17:29 +0100 Subject: Merge remote-tracking branch 'origin/master' into 4.3.4 Conflicts: src/server/game/Achievements/AchievementMgr.cpp src/server/game/Events/GameEventMgr.cpp src/server/game/Globals/ObjectMgr.cpp src/server/game/Spells/SpellMgr.cpp src/server/worldserver/worldserver.conf.dist --- src/server/authserver/authserver.conf.dist | 28 ++--- src/server/game/Achievements/AchievementMgr.cpp | 35 +++---- src/server/game/Battlegrounds/ArenaTeamMgr.cpp | 6 +- src/server/game/Battlegrounds/BattlegroundMgr.cpp | 12 +-- .../game/Battlegrounds/Zones/BattlegroundWS.cpp | 54 ++++++---- src/server/game/DungeonFinding/LFGMgr.cpp | 6 +- .../game/Entities/Creature/CreatureGroups.cpp | 6 +- .../game/Entities/Item/ItemEnchantmentMgr.cpp | 6 +- src/server/game/Entities/Transport/Transport.cpp | 14 +-- src/server/game/Events/GameEventMgr.cpp | 114 +++++++++------------ src/server/game/Globals/ObjectMgr.cpp | 111 ++------------------ src/server/game/Globals/ObjectMgr.h | 8 +- src/server/game/Groups/GroupMgr.cpp | 10 +- src/server/game/Guilds/GuildMgr.cpp | 65 +++++------- src/server/game/Loot/LootMgr.cpp | 69 +++++-------- src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp | 6 +- src/server/game/Pools/PoolMgr.cpp | 32 +++--- src/server/game/Scripting/ScriptMgr.cpp | 5 +- src/server/game/Scripting/ScriptMgr.h | 2 +- src/server/game/Scripting/ScriptSystem.cpp | 28 ++--- src/server/game/Spells/SpellMgr.cpp | 108 +++++++------------ src/server/shared/Logging/Log.cpp | 6 -- src/server/worldserver/worldserver.conf.dist | 9 +- 23 files changed, 257 insertions(+), 483 deletions(-) (limited to 'src') diff --git a/src/server/authserver/authserver.conf.dist b/src/server/authserver/authserver.conf.dist index 15dd02d9052..9a4beca9bf6 100644 --- a/src/server/authserver/authserver.conf.dist +++ b/src/server/authserver/authserver.conf.dist @@ -198,7 +198,7 @@ LoginDatabase.WorkerThreads = 1 # Example: "13 11 9 5 3 1" # # File: Name of the file (read as optional1 if Type = File) -# Allows to use one "%u" to create dynamic files +# Allows to use one "%s" to create dynamic files # # Mode: Mode to open the file (read as optional2 if Type = File) # a - (Append) @@ -208,19 +208,6 @@ LoginDatabase.WorkerThreads = 1 Appender.Console=1,2,6 Appender.Auth=2,2,7,Auth.log,w -# Logger config values: Given a logger "name" -# Logger.name -# Description: Defines 'What to log' -# Format: Type,LogLevel,AppenderList -# Type -# 0 - Default. Each type that has no config will -# rely on this one. Core will create this logger -# (disabled) if it's not configured -# 7 - Network input/output, -# 30 - Authserver - -Logger.Root=0,3,Console Auth - # LogLevel # 0 - (Disabled) # 1 - (Trace) @@ -240,6 +227,19 @@ Logger.Root=0,3,Console Auth Appenders=Console Auth +# Logger config values: Given a logger "name" +# Logger.name +# Description: Defines 'What to log' +# Format: Type,LogLevel,AppenderList +# Type +# 0 - Default. Each type that has no config will +# rely on this one. Core will create this logger +# (disabled) if it's not configured +# 7 - Network input/output, +# 30 - Authserver + +Logger.Root=0,3,Console Auth + # # Loggers # Description: List of Loggers to read from config diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 723e8b1dbbc..14895ae3165 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -2800,8 +2800,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaList() if (sAchievementCriteriaStore.GetNumRows() == 0) { - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 achievement criteria."); - + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 achievement criteria."); return; } @@ -2826,7 +2825,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaList() m_AchievementCriteriasByTimedType[criteria->timedCriteriaStartType].push_back(criteria); } - sLog->outInfo(LOG_FILTER_ACHIEVEMENTSYS, ">> Loaded %u achievement criteria and %u guild achievement crieteria in %u ms", criterias, guildCriterias, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u achievement criteria and %u guild achievement crieteria in %u ms", criterias, guildCriterias, GetMSTimeDiffToNow(oldMSTime)); } void AchievementGlobalMgr::LoadAchievementReferenceList() @@ -2835,8 +2834,7 @@ void AchievementGlobalMgr::LoadAchievementReferenceList() if (sAchievementStore.GetNumRows() == 0) { - sLog->outInfo(LOG_FILTER_ACHIEVEMENTSYS, ">> Loaded 0 achievement references."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 achievement references."); return; } @@ -2856,8 +2854,7 @@ void AchievementGlobalMgr::LoadAchievementReferenceList() if (AchievementEntry const* achievement = sAchievementStore.LookupEntry(4539)) const_cast(achievement)->mapID = 631; // Correct map requirement (currently has Ulduar) - sLog->outInfo(LOG_FILTER_ACHIEVEMENTSYS, ">> Loaded %u achievement references in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u achievement references in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void AchievementGlobalMgr::LoadAchievementCriteriaData() @@ -2870,8 +2867,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaData() if (!result) { - sLog->outInfo(LOG_FILTER_ACHIEVEMENTSYS, ">> Loaded 0 additional achievement criteria data. DB table `achievement_criteria_data` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 additional achievement criteria data. DB table `achievement_criteria_data` is empty."); return; } @@ -3002,8 +2998,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaData() sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` does not have expected data for criteria (Entry: %u Type: %u) for achievement %u.", criteria->ID, criteria->requiredType, criteria->referredAchievement); } - sLog->outInfo(LOG_FILTER_ACHIEVEMENTSYS, ">> Loaded %u additional achievement criteria data in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u additional achievement criteria data in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void AchievementGlobalMgr::LoadCompletedAchievements() @@ -3014,8 +3009,7 @@ void AchievementGlobalMgr::LoadCompletedAchievements() if (!result) { - sLog->outInfo(LOG_FILTER_ACHIEVEMENTSYS, ">> Loaded 0 completed achievements. DB table `character_achievement` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 completed achievements. DB table `character_achievement` is empty."); return; } @@ -3042,8 +3036,7 @@ void AchievementGlobalMgr::LoadCompletedAchievements() m_allCompletedAchievements.insert(achievementId); } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_ACHIEVEMENTSYS, ">> Loaded %lu completed achievements in %u ms", (unsigned long)m_allCompletedAchievements.size(), GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu completed achievements in %u ms", (unsigned long)m_allCompletedAchievements.size(), GetMSTimeDiffToNow(oldMSTime)); } void AchievementGlobalMgr::LoadRewards() @@ -3057,8 +3050,7 @@ void AchievementGlobalMgr::LoadRewards() if (!result) { - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 achievement rewards. DB table `achievement_reward` is empty."); - + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 achievement rewards. DB table `achievement_reward` is empty."); return; } @@ -3149,8 +3141,7 @@ void AchievementGlobalMgr::LoadRewards() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_ACHIEVEMENTSYS, ">> Loaded %u achievement rewards in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u achievement rewards in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void AchievementGlobalMgr::LoadRewardLocales() @@ -3165,8 +3156,7 @@ void AchievementGlobalMgr::LoadRewardLocales() if (!result) { - sLog->outInfo(LOG_FILTER_ACHIEVEMENTSYS, ">> Loaded 0 achievement reward locale strings. DB table `locales_achievement_reward` is empty"); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 achievement reward locale strings. DB table `locales_achievement_reward` is empty"); return; } @@ -3192,6 +3182,5 @@ void AchievementGlobalMgr::LoadRewardLocales() } } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_ACHIEVEMENTSYS, ">> Loaded %lu achievement reward locale strings in %u ms", (unsigned long)m_achievementRewardLocales.size(), GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu achievement reward locale strings in %u ms", (unsigned long)m_achievementRewardLocales.size(), GetMSTimeDiffToNow(oldMSTime)); } diff --git a/src/server/game/Battlegrounds/ArenaTeamMgr.cpp b/src/server/game/Battlegrounds/ArenaTeamMgr.cpp index 416b54a5713..9365172a4ca 100644 --- a/src/server/game/Battlegrounds/ArenaTeamMgr.cpp +++ b/src/server/game/Battlegrounds/ArenaTeamMgr.cpp @@ -101,8 +101,7 @@ void ArenaTeamMgr::LoadArenaTeams() if (!result) { - sLog->outInfo(LOG_FILTER_BATTLEGROUND, ">> Loaded 0 arena teams. DB table `arena_team` is empty!"); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 arena teams. DB table `arena_team` is empty!"); return; } @@ -132,8 +131,7 @@ void ArenaTeamMgr::LoadArenaTeams() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_BATTLEGROUND, ">> Loaded %u arena teams in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u arena teams in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void ArenaTeamMgr::DistributeArenaPoints() diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index f9fb27f54bc..626ed04566b 100755 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -683,8 +683,7 @@ void BattlegroundMgr::CreateInitialBattlegrounds() if (!result) { - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 battlegrounds. DB table `battleground_template` is empty."); - + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 battlegrounds. DB table `battleground_template` is empty."); return; } @@ -793,8 +792,7 @@ void BattlegroundMgr::CreateInitialBattlegrounds() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_BATTLEGROUND, ">> Loaded %u battlegrounds in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u battlegrounds in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void BattlegroundMgr::InitAutomaticArenaPointDistribution() @@ -1078,8 +1076,7 @@ void BattlegroundMgr::LoadBattleMastersEntry() if (!result) { - sLog->outInfo(LOG_FILTER_BATTLEGROUND, ">> Loaded 0 battlemaster entries. DB table `battlemaster_entry` is empty!"); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 battlemaster entries. DB table `battlemaster_entry` is empty!"); return; } @@ -1103,8 +1100,7 @@ void BattlegroundMgr::LoadBattleMastersEntry() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_BATTLEGROUND, ">> Loaded %u battlemaster entries in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u battlemaster entries in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } HolidayIds BattlegroundMgr::BGTypeToWeekendHolidayId(BattlegroundTypeId bgTypeId) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp index c09285fd7ad..051234f1e4f 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp @@ -700,28 +700,40 @@ void BattlegroundWS::Reset() //call parent's class reset Battleground::Reset(); - m_FlagKeepers[BG_TEAM_ALLIANCE] = 0; - m_FlagKeepers[BG_TEAM_HORDE] = 0; + m_FlagKeepers[BG_TEAM_ALLIANCE] = 0; + m_FlagKeepers[BG_TEAM_HORDE] = 0; + m_DroppedFlagGUID[BG_TEAM_ALLIANCE] = 0; - m_DroppedFlagGUID[BG_TEAM_HORDE] = 0; - _flagState[BG_TEAM_ALLIANCE] = BG_WS_FLAG_STATE_ON_BASE; - _flagState[BG_TEAM_HORDE] = BG_WS_FLAG_STATE_ON_BASE; - m_TeamScores[BG_TEAM_ALLIANCE] = 0; - m_TeamScores[BG_TEAM_HORDE] = 0; - bool isBGWeekend = sBattlegroundMgr->IsBGWeekend(GetTypeID()); - m_ReputationCapture = (isBGWeekend) ? 45 : 35; - m_HonorWinKills = (isBGWeekend) ? 3 : 1; - m_HonorEndKills = (isBGWeekend) ? 4 : 2; - // For WorldState - _minutesElapsed = 0; - _lastFlagCaptureTeam = 0; - - /* Spirit nodes is static at this BG and then not required deleting at BG reset. - if (BgCreatures[WS_SPIRIT_MAIN_ALLIANCE]) - DelCreature(WS_SPIRIT_MAIN_ALLIANCE); - if (BgCreatures[WS_SPIRIT_MAIN_HORDE]) - DelCreature(WS_SPIRIT_MAIN_HORDE); - */ + m_DroppedFlagGUID[BG_TEAM_HORDE] = 0; + + _flagState[BG_TEAM_ALLIANCE] = BG_WS_FLAG_STATE_ON_BASE; + _flagState[BG_TEAM_HORDE] = BG_WS_FLAG_STATE_ON_BASE; + + m_TeamScores[BG_TEAM_ALLIANCE] = 0; + m_TeamScores[BG_TEAM_HORDE] = 0; + + if (sBattlegroundMgr->IsBGWeekend(GetTypeID())) + { + m_ReputationCapture = 45; + m_HonorWinKills = 3; + m_HonorEndKills = 4; + } + else + { + m_ReputationCapture = 35; + m_HonorWinKills = 1; + m_HonorEndKills = 2; + } + _minutesElapsed = 0; + _lastFlagCaptureTeam = 0; + _bothFlagsKept = false; + _flagDebuffState = 0; + _flagSpellForceTimer = 0; + _lastFlagCaptureTeam = 0; + _flagsDropTimer[BG_TEAM_ALLIANCE] = 0; + _flagsDropTimer[BG_TEAM_HORDE] = 0; + _flagsTimer[BG_TEAM_ALLIANCE] = 0; + _flagsTimer[BG_TEAM_HORDE] = 0; } void BattlegroundWS::EndBattleground(uint32 winner) diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index 18ba5926b07..52e4e4df9cd 100755 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -135,8 +135,7 @@ void LFGMgr::LoadRewards() if (!result) { - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 lfg dungeon rewards. DB table `lfg_dungeon_rewards` is empty!"); - + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 lfg dungeon rewards. DB table `lfg_dungeon_rewards` is empty!"); return; } @@ -183,8 +182,7 @@ void LFGMgr::LoadRewards() ++count; } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_LFG, ">> Loaded %u lfg dungeon rewards in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u lfg dungeon rewards in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void LFGMgr::Update(uint32 diff) diff --git a/src/server/game/Entities/Creature/CreatureGroups.cpp b/src/server/game/Entities/Creature/CreatureGroups.cpp index 21ed1a23828..8823a788555 100755 --- a/src/server/game/Entities/Creature/CreatureGroups.cpp +++ b/src/server/game/Entities/Creature/CreatureGroups.cpp @@ -84,8 +84,7 @@ void FormationMgr::LoadCreatureFormations() if (!result) { - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 creatures in formations. DB table `creature_formations` is empty!"); - + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 creatures in formations. DB table `creature_formations` is empty!"); return; } @@ -136,8 +135,7 @@ void FormationMgr::LoadCreatureFormations() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_UNITS, ">> Loaded %u creatures in formations in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u creatures in formations in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void CreatureGroup::AddMember(Creature* member) diff --git a/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp b/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp index 0478173b96e..f85bf80e145 100755 --- a/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp +++ b/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp @@ -70,14 +70,10 @@ void LoadRandomEnchantmentsTable() ++count; } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_PLAYER_ITEMS, ">> Loaded %u Item Enchantment definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u Item Enchantment definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } else - { sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 Item Enchantment definitions. DB table `item_enchantment_template` is empty."); - - } } uint32 GetItemEnchantMod(int32 entry) diff --git a/src/server/game/Entities/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp index 02a6f261e98..528784c018f 100755 --- a/src/server/game/Entities/Transport/Transport.cpp +++ b/src/server/game/Entities/Transport/Transport.cpp @@ -35,8 +35,7 @@ void MapManager::LoadTransports() if (!result) { - sLog->outInfo(LOG_FILTER_TRANSPORTS, ">> Loaded 0 transports. DB table `transports` is empty!"); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 transports. DB table `transports` is empty!"); return; } @@ -66,7 +65,7 @@ void MapManager::LoadTransports() continue; } - // sLog->outInfo(LOG_FILTER_TRANSPORTS, "Loading transport %d between %s, %s", entry, name.c_str(), goinfo->name); + // sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading transport %d between %s, %s", entry, name.c_str(), goinfo->name); std::set mapsUsed; @@ -121,8 +120,7 @@ void MapManager::LoadTransports() while (result->NextRow()); } - sLog->outInfo(LOG_FILTER_TRANSPORTS, ">> Loaded %u transports in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u transports in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void MapManager::LoadTransportNPCs() @@ -134,8 +132,7 @@ void MapManager::LoadTransportNPCs() if (!result) { - sLog->outInfo(LOG_FILTER_TRANSPORTS, ">> Loaded 0 transport NPCs. DB table `creature_transport` is empty!"); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 transport NPCs. DB table `creature_transport` is empty!"); return; } @@ -166,8 +163,7 @@ void MapManager::LoadTransportNPCs() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_TRANSPORTS, ">> Loaded %u transport npcs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u transport npcs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } Transport::Transport(uint32 period, uint32 script) : GameObject(), m_pathTime(0), m_timer(0), diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp index 6af90dd85eb..a8eec927854 100755 --- a/src/server/game/Events/GameEventMgr.cpp +++ b/src/server/game/Events/GameEventMgr.cpp @@ -260,11 +260,11 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } - sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Saves Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event Saves Data..."); { uint32 oldMSTime = getMSTime(); @@ -273,7 +273,7 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 game event saves in game events. DB table `game_event_save` is empty."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 game event saves in game events. DB table `game_event_save` is empty."); } else @@ -306,12 +306,12 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u game event saves in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u game event saves in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } - sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Prerequisite Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event Prerequisite Data..."); { uint32 oldMSTime = getMSTime(); @@ -319,7 +319,7 @@ void GameEventMgr::LoadFromDB() QueryResult result = WorldDatabase.Query("SELECT eventEntry, prerequisite_event FROM game_event_prerequisite"); if (!result) { - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 game event prerequisites in game events. DB table `game_event_prerequisite` is empty."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 game event prerequisites in game events. DB table `game_event_prerequisite` is empty."); } else @@ -357,12 +357,12 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u game event prerequisites in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u game event prerequisites in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } - sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Creature Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event Creature Data..."); { uint32 oldMSTime = getMSTime(); @@ -372,7 +372,7 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 creatures in game events. DB table `game_event_creature` is empty"); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 creatures in game events. DB table `game_event_creature` is empty"); } else @@ -400,12 +400,12 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u creatures in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u creatures in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } - sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event GO Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event GO Data..."); { uint32 oldMSTime = getMSTime(); @@ -415,7 +415,7 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 gameobjects in game events. DB table `game_event_gameobject` is empty."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 gameobjects in game events. DB table `game_event_gameobject` is empty."); } else @@ -443,12 +443,11 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u gameobjects in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u gameobjects in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } - sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Model/Equipment Change Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event Model/Equipment Change Data..."); { uint32 oldMSTime = getMSTime(); @@ -458,8 +457,7 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 model/equipment changes in game events. DB table `game_event_model_equip` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 model/equipment changes in game events. DB table `game_event_model_equip` is empty."); } else { @@ -500,12 +498,11 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u model/equipment changes in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u model/equipment changes in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } - sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Quest Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event Quest Data..."); { uint32 oldMSTime = getMSTime(); @@ -514,8 +511,7 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 quests additions in game events. DB table `game_event_creature_quest` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 quests additions in game events. DB table `game_event_creature_quest` is empty."); } else { @@ -541,12 +537,11 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } - sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event GO Quest Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event GO Quest Data..."); { uint32 oldMSTime = getMSTime(); @@ -555,8 +550,7 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 go quests additions in game events. DB table `game_event_gameobject_quest` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 go quests additions in game events. DB table `game_event_gameobject_quest` is empty."); } else { @@ -582,12 +576,11 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } - sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Quest Condition Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event Quest Condition Data..."); { uint32 oldMSTime = getMSTime(); @@ -596,8 +589,7 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 quest event conditions in game events. DB table `game_event_quest_condition` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 quest event conditions in game events. DB table `game_event_quest_condition` is empty."); } else { @@ -625,12 +617,11 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u quest event conditions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u quest event conditions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } - sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Condition Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event Condition Data..."); { uint32 oldMSTime = getMSTime(); @@ -639,8 +630,7 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 conditions in game events. DB table `game_event_condition` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 conditions in game events. DB table `game_event_condition` is empty."); } else { @@ -667,12 +657,11 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u conditions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u conditions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } - sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Condition Save Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event Condition Save Data..."); { uint32 oldMSTime = getMSTime(); @@ -681,8 +670,7 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 condition saves in game events. DB table `game_event_condition_save` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 condition saves in game events. DB table `game_event_condition_save` is empty."); } else { @@ -715,12 +703,11 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u condition saves in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u condition saves in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } - sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event NPCflag Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event NPCflag Data..."); { uint32 oldMSTime = getMSTime(); @@ -729,8 +716,7 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 npcflags in game events. DB table `game_event_npcflag` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 npcflags in game events. DB table `game_event_npcflag` is empty."); } else { @@ -755,12 +741,11 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u npcflags in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u npcflags in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } - sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Seasonal Quest Relations..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event Seasonal Quest Relations..."); { uint32 oldMSTime = getMSTime(); @@ -769,8 +754,7 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 seasonal quests additions in game events. DB table `game_event_seasonal_questrelation` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 seasonal quests additions in game events. DB table `game_event_seasonal_questrelation` is empty."); } else { @@ -799,12 +783,11 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } - sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Vendor Additions Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event Vendor Additions Data..."); { uint32 oldMSTime = getMSTime(); @@ -812,7 +795,7 @@ void GameEventMgr::LoadFromDB() QueryResult result = WorldDatabase.Query("SELECT eventEntry, guid, item, maxcount, incrtime, ExtendedCost, type FROM game_event_npc_vendor ORDER BY guid, slot ASC"); if (!result) - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 vendor additions in game events. DB table `game_event_npc_vendor` is empty."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 vendor additions in game events. DB table `game_event_npc_vendor` is empty."); else { uint32 count = 0; @@ -863,12 +846,11 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u vendor additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u vendor additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } - sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Battleground Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event Battleground Data..."); { uint32 oldMSTime = getMSTime(); @@ -877,8 +859,7 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 battleground holidays in game events. DB table `game_event_condition` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 battleground holidays in game events. DB table `game_event_condition` is empty."); } else { @@ -901,12 +882,11 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u battleground holidays in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u battleground holidays in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } - sLog->outInfo(LOG_FILTER_GAMEEVENTS, "Loading Game Event Pool Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Game Event Pool Data..."); { uint32 oldMSTime = getMSTime(); @@ -916,8 +896,7 @@ void GameEventMgr::LoadFromDB() if (!result) { - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded 0 pools for game events. DB table `game_event_pool` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 pools for game events. DB table `game_event_pool` is empty."); } else { @@ -950,8 +929,7 @@ void GameEventMgr::LoadFromDB() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GAMEEVENTS, ">> Loaded %u pools for game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u pools for game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } } diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 2317d89ae24..7a43a6d763a 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -297,7 +297,6 @@ void ObjectMgr::LoadCreatureLocales() } while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu creature locale strings in %u ms", (unsigned long)_creatureLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadGossipMenuItemsLocales() @@ -334,7 +333,6 @@ void ObjectMgr::LoadGossipMenuItemsLocales() } while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu gossip_menu_option locale strings in %u ms", (unsigned long)_gossipMenuItemsLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadPointOfInterestLocales() @@ -361,7 +359,6 @@ void ObjectMgr::LoadPointOfInterestLocales() } while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu points_of_interest locale strings in %u ms", (unsigned long)_pointOfInterestLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadCreatureTemplates() @@ -389,7 +386,6 @@ void ObjectMgr::LoadCreatureTemplates() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 creature template definitions. DB table `creature_template` is empty."); - return; } @@ -495,7 +491,6 @@ void ObjectMgr::LoadCreatureTemplates() CheckCreatureTemplate(&itr->second); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u creature definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadCreatureTemplateAddons() @@ -508,7 +503,6 @@ void ObjectMgr::LoadCreatureTemplateAddons() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 creature template addon definitions. DB table `creature_template_addon` is empty."); - return; } @@ -567,7 +561,6 @@ void ObjectMgr::LoadCreatureTemplateAddons() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u creature template addons in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo) @@ -891,7 +884,6 @@ void ObjectMgr::LoadCreatureAddons() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 creature addon definitions. DB table `creature_addon` is empty."); - return; } @@ -957,7 +949,6 @@ void ObjectMgr::LoadCreatureAddons() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u creature addons in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } CreatureAddon const* ObjectMgr::GetCreatureAddon(uint32 lowguid) @@ -996,7 +987,6 @@ void ObjectMgr::LoadEquipmentTemplates() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 creature equipment templates. DB table `creature_equip_template` is empty!"); - return; } @@ -1049,7 +1039,6 @@ void ObjectMgr::LoadEquipmentTemplates() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u equipment templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } CreatureModelInfo const* ObjectMgr::GetCreatureModelInfo(uint32 modelId) @@ -1127,7 +1116,6 @@ void ObjectMgr::LoadCreatureModelInfo() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 creature model definitions. DB table `creature_model_info` is empty."); - return; } @@ -1172,7 +1160,6 @@ void ObjectMgr::LoadCreatureModelInfo() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u creature model based info in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadLinkedRespawn() @@ -1358,7 +1345,6 @@ void ObjectMgr::LoadLinkedRespawn() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded " UI64FMTD " linked respawns in %u ms", uint64(_linkedRespawnStore.size()), GetMSTimeDiffToNow(oldMSTime)); - } bool ObjectMgr::SetCreatureLinkedRespawn(uint32 guidLow, uint32 linkedGuidLow) @@ -1545,7 +1531,6 @@ void ObjectMgr::LoadCreatures() } while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u creatures in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::AddCreatureToGrid(uint32 guid, CreatureData const* data) @@ -1850,7 +1835,6 @@ void ObjectMgr::LoadGameobjects() } while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu gameobjects in %u ms", (unsigned long)_gameObjectDataStore.size(), GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::AddGameobjectToGrid(uint32 guid, GameObjectData const* data) @@ -2019,7 +2003,6 @@ void ObjectMgr::LoadItemLocales() } while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu Item locale strings in %u ms", (unsigned long)_itemLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime)); - } void FillItemDamageFields(float* minDamage, float* maxDamage, float* dps, uint32 itemLevel, uint32 itemClass, uint32 itemSubClass, uint32 quality, uint32 delay, float statScalingFactor, uint32 inventoryType, uint32 flags2) @@ -2572,7 +2555,6 @@ void ObjectMgr::LoadItemTemplateAddon() sLog->outError(LOG_FILTER_SQL, "Minimum money loot specified in `item_template_addon` for item %u was greater than maximum amount, swapping.", itemId); std::swap(minMoneyLoot, maxMoneyLoot); } - ItemTemplate& itemTemplate = _itemTemplateStore[itemId]; itemTemplate.FlagsCu = fields[1].GetUInt32(); itemTemplate.FoodType = fields[2].GetUInt8(); @@ -2617,7 +2599,6 @@ ItemTemplate const* ObjectMgr::GetItemTemplate(uint32 entry) ItemTemplateContainer::const_iterator itr = _itemTemplateStore.find(entry); if (itr != _itemTemplateStore.end()) return &(itr->second); - return NULL; } @@ -2675,7 +2656,6 @@ void ObjectMgr::LoadVehicleTemplateAccessories() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u Vehicle Template Accessories in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadVehicleAccessories() @@ -2692,7 +2672,6 @@ void ObjectMgr::LoadVehicleAccessories() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 Vehicle Accessories in %u ms", GetMSTimeDiffToNow(oldMSTime)); - return; } @@ -2720,7 +2699,6 @@ void ObjectMgr::LoadVehicleAccessories() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u Vehicle Accessories in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadPetLevelInfo() @@ -2813,7 +2791,6 @@ void ObjectMgr::LoadPetLevelInfo() } sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u level pet stats definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } PetLevelInfo const* ObjectMgr::GetPetLevelInfo(uint32 creature_id, uint8 level) const @@ -2955,12 +2932,11 @@ void ObjectMgr::LoadPlayerInfo() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u player create definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } } // Load playercreate items - sLog->outInfo(LOG_FILTER_GENERAL, "Loading Player Create Items Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Player Create Items Data..."); { uint32 oldMSTime = getMSTime(); // 0 1 2 3 @@ -2969,7 +2945,6 @@ void ObjectMgr::LoadPlayerInfo() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 custom player create items. DB table `playercreateinfo_item` is empty."); - } else { @@ -3027,12 +3002,11 @@ void ObjectMgr::LoadPlayerInfo() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u custom player create items in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } } // Load playercreate spells - sLog->outInfo(LOG_FILTER_GENERAL, "Loading Player Create Spell Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Player Create Spell Data..."); { uint32 oldMSTime = getMSTime(); @@ -3084,12 +3058,11 @@ void ObjectMgr::LoadPlayerInfo() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u player create spells in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } } // Load playercreate actions - sLog->outInfo(LOG_FILTER_GENERAL, "Loading Player Create Action Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Player Create Action Data..."); { uint32 oldMSTime = getMSTime(); @@ -3131,12 +3104,11 @@ void ObjectMgr::LoadPlayerInfo() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u player create actions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } } // Loading levels data (class/race dependent) - sLog->outInfo(LOG_FILTER_GENERAL, "Loading Player Create Level Stats Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Player Create Level Stats Data..."); { uint32 oldMSTime = getMSTime(); @@ -3246,11 +3218,10 @@ void ObjectMgr::LoadPlayerInfo() } sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u level stats definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } // Loading xp per level data - sLog->outInfo(LOG_FILTER_GENERAL, "Loading Player Create XP Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Player Create XP Data..."); { uint32 oldMSTime = getMSTime(); @@ -3305,7 +3276,6 @@ void ObjectMgr::LoadPlayerInfo() } sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u xp for level definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } } @@ -4261,7 +4231,6 @@ void ObjectMgr::LoadQuests() } sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu quests definitions in %u ms", (unsigned long)_questTemplates.size(), GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadQuestLocales() @@ -4315,7 +4284,6 @@ void ObjectMgr::LoadQuestLocales() } while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu Quest locale strings in %u ms", (unsigned long)_questLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadScripts(ScriptsType type) @@ -4333,7 +4301,7 @@ void ObjectMgr::LoadScripts(ScriptsType type) if (sScriptMgr->IsScriptScheduled()) // function cannot be called when scripts are in use. return; - sLog->outInfo(LOG_FILTER_GENERAL, "Loading %s...", tableName.c_str()); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading %s...", tableName.c_str()); scripts->clear(); // need for reload support @@ -4344,7 +4312,6 @@ void ObjectMgr::LoadScripts(ScriptsType type) if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 script definitions. DB table `%s` is empty!", tableName.c_str()); - return; } @@ -4636,7 +4603,6 @@ void ObjectMgr::LoadScripts(ScriptsType type) while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u script definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadGameObjectScripts() @@ -4781,7 +4747,6 @@ void ObjectMgr::LoadSpellScriptNames() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 spell script names. DB table `spell_script_names` is empty!"); - return; } @@ -4829,7 +4794,6 @@ void ObjectMgr::LoadSpellScriptNames() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spell script names in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::ValidateSpellScripts() @@ -4839,7 +4803,6 @@ void ObjectMgr::ValidateSpellScripts() if (_spellScriptsStore.empty()) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Validated 0 scripts."); - return; } @@ -4887,7 +4850,6 @@ void ObjectMgr::ValidateSpellScripts() } sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Validated %u scripts in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadPageTexts() @@ -4900,7 +4862,6 @@ void ObjectMgr::LoadPageTexts() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 page texts. DB table `page_text` is empty!"); - return; } @@ -4930,7 +4891,6 @@ void ObjectMgr::LoadPageTexts() } sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u page texts in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } PageText const* ObjectMgr::GetPageText(uint32 pageEntry) @@ -4966,7 +4926,6 @@ void ObjectMgr::LoadPageTextLocales() } while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu PageText locale strings in %u ms", (unsigned long)_pageTextLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadInstanceTemplate() @@ -4979,7 +4938,6 @@ void ObjectMgr::LoadInstanceTemplate() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 instance templates. DB table `page_text` is empty!"); - return; } @@ -5009,7 +4967,6 @@ void ObjectMgr::LoadInstanceTemplate() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u instance templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } InstanceTemplate const* ObjectMgr::GetInstanceTemplate(uint32 mapID) @@ -5099,7 +5056,6 @@ void ObjectMgr::LoadInstanceEncounters() } while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u instance encounters in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } GossipText const* ObjectMgr::GetGossipText(uint32 Text_ID) const @@ -5120,7 +5076,6 @@ void ObjectMgr::LoadGossipText() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u npc texts", count); - return; } _gossipTextStore.rehash(result->GetRowCount()); @@ -5160,7 +5115,6 @@ void ObjectMgr::LoadGossipText() } while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u npc texts in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadNpcTextLocales() @@ -5203,7 +5157,6 @@ void ObjectMgr::LoadNpcTextLocales() } while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu NpcText locale strings in %u ms", (unsigned long)_npcTextLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime)); - } //not very fast function but it is called only once a day, or on starting-up @@ -5229,7 +5182,6 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp) if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> No expired mails found."); - return; // any mails need to be returned or deleted } @@ -5333,7 +5285,6 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp) while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Processed %u expired mails: %u deleted and %u returned in %u ms", deletedCount + returnedCount, deletedCount, returnedCount, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadQuestAreaTriggers() @@ -5347,7 +5298,6 @@ void ObjectMgr::LoadQuestAreaTriggers() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 quest trigger points. DB table `areatrigger_involvedrelation` is empty."); - return; } @@ -5392,7 +5342,6 @@ void ObjectMgr::LoadQuestAreaTriggers() } while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u quest trigger points in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadTavernAreaTriggers() @@ -5406,7 +5355,6 @@ void ObjectMgr::LoadTavernAreaTriggers() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 tavern triggers. DB table `areatrigger_tavern` is empty."); - return; } @@ -5431,7 +5379,6 @@ void ObjectMgr::LoadTavernAreaTriggers() } while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u tavern triggers in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadAreaTriggerScripts() @@ -5444,7 +5391,6 @@ void ObjectMgr::LoadAreaTriggerScripts() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 areatrigger scripts. DB table `areatrigger_scripts` is empty."); - return; } @@ -5469,7 +5415,6 @@ void ObjectMgr::LoadAreaTriggerScripts() } while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u areatrigger scripts in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } uint32 ObjectMgr::GetNearestTaxiNode(float x, float y, float z, uint32 mapid, uint32 team) @@ -5588,7 +5533,6 @@ void ObjectMgr::LoadGraveyardZones() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 graveyard-zone links. DB table `game_graveyard_zone` is empty."); - return; } @@ -5635,7 +5579,6 @@ void ObjectMgr::LoadGraveyardZones() } while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u graveyard-zone links in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } WorldSafeLocsEntry const* ObjectMgr::GetDefaultGraveYard(uint32 team) @@ -5881,7 +5824,6 @@ void ObjectMgr::LoadAreaTriggerTeleports() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 area trigger teleport definitions. DB table `areatrigger_teleport` is empty."); - return; } @@ -5928,7 +5870,6 @@ void ObjectMgr::LoadAreaTriggerTeleports() } while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u area trigger teleport definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadAccessRequirements() @@ -5942,7 +5883,6 @@ void ObjectMgr::LoadAccessRequirements() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 access requirement definitions. DB table `access_requirement` is empty."); - return; } @@ -6020,7 +5960,6 @@ void ObjectMgr::LoadAccessRequirements() } while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u access requirement definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } /* @@ -6249,7 +6188,6 @@ void ObjectMgr::LoadGameObjectLocales() } while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu gameobject locale strings in %u ms", (unsigned long)_gameObjectLocaleStore.size(), GetMSTimeDiffToNow(oldMSTime)); - } inline void CheckGOLockId(GameObjectTemplate const* goInfo, uint32 dataN, uint32 N) @@ -6328,7 +6266,6 @@ void ObjectMgr::LoadGameObjectTemplate() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 gameobject definitions. DB table `gameobject_template` is empty."); - return; } @@ -6499,7 +6436,6 @@ void ObjectMgr::LoadGameObjectTemplate() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u game object templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadExplorationBaseXP() @@ -6528,7 +6464,6 @@ void ObjectMgr::LoadExplorationBaseXP() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u BaseXP definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } uint32 ObjectMgr::GetBaseXP(uint8 level) @@ -6552,7 +6487,6 @@ void ObjectMgr::LoadPetNames() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 pet name parts. DB table `pet_name_generation` is empty!"); - return; } @@ -6573,7 +6507,6 @@ void ObjectMgr::LoadPetNames() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u pet name parts in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadPetNumber() @@ -6588,7 +6521,6 @@ void ObjectMgr::LoadPetNumber() } sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded the max pet number: %d in %u ms", _hiPetNumber-1, GetMSTimeDiffToNow(oldMSTime)); - } std::string ObjectMgr::GeneratePetName(uint32 entry) @@ -6630,7 +6562,6 @@ void ObjectMgr::LoadCorpses() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 corpses. DB table `corpse` is empty."); - return; } @@ -6659,7 +6590,6 @@ void ObjectMgr::LoadCorpses() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u corpses in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadReputationRewardRate() @@ -6722,7 +6652,6 @@ void ObjectMgr::LoadReputationRewardRate() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u reputation_reward_rate in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadReputationOnKill() @@ -6796,7 +6725,6 @@ void ObjectMgr::LoadReputationOnKill() } while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u creature award reputation definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadReputationSpilloverTemplate() @@ -6811,7 +6739,6 @@ void ObjectMgr::LoadReputationSpilloverTemplate() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded `reputation_spillover_template`, table is empty."); - return; } @@ -6917,7 +6844,6 @@ void ObjectMgr::LoadReputationSpilloverTemplate() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u reputation_spillover_template in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadPointsOfInterest() @@ -6964,7 +6890,6 @@ void ObjectMgr::LoadPointsOfInterest() } while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u Points of Interest definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadQuestPOI() @@ -7036,7 +6961,6 @@ void ObjectMgr::LoadQuestPOI() } while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u quest POI definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadNPCSpellClickSpells() @@ -7104,7 +7028,6 @@ void ObjectMgr::LoadNPCSpellClickSpells() } sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spellclick definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::DeleteCreatureData(uint32 guid) @@ -7183,7 +7106,6 @@ void ObjectMgr::LoadQuestRelationsHelper(QuestRelations& map, std::string table, } while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u quest relations from %s in %u ms", count, table.c_str(), GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadGameobjectQuestRelations() @@ -7253,7 +7175,6 @@ void ObjectMgr::LoadReservedPlayersNames() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 reserved player names. DB table `reserved_name` is empty!"); - return; } @@ -7280,7 +7201,6 @@ void ObjectMgr::LoadReservedPlayersNames() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u reserved player names in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } bool ObjectMgr::IsReservedName(const std::string& name) const @@ -7434,7 +7354,6 @@ void ObjectMgr::LoadGameObjectForQuests() if (sObjectMgr->GetGameObjectTemplates()->empty()) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 GameObjects for quests"); - return; } @@ -7483,7 +7402,6 @@ void ObjectMgr::LoadGameObjectForQuests() } sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u GameObjects for quests in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } bool ObjectMgr::LoadTrinityStrings(const char* table, int32 min_value, int32 max_value) @@ -7575,7 +7493,6 @@ bool ObjectMgr::LoadTrinityStrings(const char* table, int32 min_value, int32 max else sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u string templates from %s in %u ms", count, table, GetMSTimeDiffToNow(oldMSTime)); - return true; } @@ -7632,7 +7549,6 @@ void ObjectMgr::LoadFishingBaseSkillLevel() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u areas for fishing base skill level in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } bool ObjectMgr::CheckDeclinedNames(std::wstring w_ownname, DeclinedName const& names) @@ -7758,7 +7674,6 @@ void ObjectMgr::LoadGameTele() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u GameTeleports in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } GameTele const* ObjectMgr::GetGameTele(const std::string& name) const @@ -7903,7 +7818,6 @@ void ObjectMgr::LoadMailLevelRewards() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u level dependent mail rewards in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::AddSpellToTrainer(uint32 entry, uint32 spell, uint32 spellCost, uint32 reqSkill, uint32 reqSkillValue, uint32 reqLevel) @@ -8024,7 +7938,6 @@ void ObjectMgr::LoadTrainerSpell() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %d Trainers in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } int ObjectMgr::LoadReferenceVendor(int32 vendor, int32 item, uint8 type, std::set *skip_vendors) @@ -8118,7 +8031,6 @@ void ObjectMgr::LoadVendors() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %d Vendors in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadGossipMenu() @@ -8160,7 +8072,6 @@ void ObjectMgr::LoadGossipMenu() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u gossip_menu entries in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadGossipMenuItems() @@ -8224,7 +8135,6 @@ void ObjectMgr::LoadGossipMenuItems() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u gossip_menu_option entries in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::AddVendorItem(uint32 entry, uint32 item, int32 maxcount, uint32 incrtime, uint32 extendedCost, uint8 type, bool persist /*= true*/) @@ -8409,7 +8319,6 @@ void ObjectMgr::LoadScriptNames() std::sort(_scriptNamesStore.begin(), _scriptNamesStore.end()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %d Script Names in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } uint32 ObjectMgr::GetScriptId(const char *name) @@ -8513,7 +8422,6 @@ void ObjectMgr::LoadCreatureClassLevelStats() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 creature base stats. DB table `creature_classlevelstats` is empty."); - return; } @@ -8562,7 +8470,6 @@ void ObjectMgr::LoadCreatureClassLevelStats() } sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u creature base stats in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadFactionChangeAchievements() @@ -8599,7 +8506,6 @@ void ObjectMgr::LoadFactionChangeAchievements() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u faction change achievement pairs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadFactionChangeItems() @@ -8611,7 +8517,6 @@ void ObjectMgr::LoadFactionChangeItems() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 faction change item pairs. DB table `player_factionchange_items` is empty."); - return; } @@ -8636,7 +8541,6 @@ void ObjectMgr::LoadFactionChangeItems() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u faction change item pairs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadFactionChangeSpells() @@ -8673,7 +8577,6 @@ void ObjectMgr::LoadFactionChangeSpells() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u faction change spell pairs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadFactionChangeReputations() @@ -8685,7 +8588,6 @@ void ObjectMgr::LoadFactionChangeReputations() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 faction change reputation pairs. DB table `player_factionchange_reputations` is empty."); - return; } @@ -8710,7 +8612,6 @@ void ObjectMgr::LoadFactionChangeReputations() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u faction change reputation pairs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } void ObjectMgr::LoadHotfixData() diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index 0456b800a29..f80881dd7ac 100755 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -781,13 +781,13 @@ class ObjectMgr void LoadQuests(); void LoadQuestRelations() { - sLog->outInfo(LOG_FILTER_GENERAL, "Loading GO Start Quest Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading GO Start Quest Data..."); LoadGameobjectQuestRelations(); - sLog->outInfo(LOG_FILTER_GENERAL, "Loading GO End Quest Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading GO End Quest Data..."); LoadGameobjectInvolvedRelations(); - sLog->outInfo(LOG_FILTER_GENERAL, "Loading Creature Start Quest Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Creature Start Quest Data..."); LoadCreatureQuestRelations(); - sLog->outInfo(LOG_FILTER_GENERAL, "Loading Creature End Quest Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Creature End Quest Data..."); LoadCreatureInvolvedRelations(); } void LoadGameobjectQuestRelations(); diff --git a/src/server/game/Groups/GroupMgr.cpp b/src/server/game/Groups/GroupMgr.cpp index 7cb8a8ff7b1..77b3a304f6b 100644 --- a/src/server/game/Groups/GroupMgr.cpp +++ b/src/server/game/Groups/GroupMgr.cpp @@ -126,7 +126,6 @@ void GroupMgr::LoadGroups() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 group definitions. DB table `groups` is empty!"); - return; } @@ -152,10 +151,9 @@ void GroupMgr::LoadGroups() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u group definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } - sLog->outInfo(LOG_FILTER_GENERAL, "Loading Group members..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Group members..."); { uint32 oldMSTime = getMSTime(); @@ -170,7 +168,6 @@ void GroupMgr::LoadGroups() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 group members. DB table `group_member` is empty!"); - return; } @@ -191,10 +188,9 @@ void GroupMgr::LoadGroups() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u group members in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } - sLog->outInfo(LOG_FILTER_GENERAL, "Loading Group instance saves..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Group instance saves..."); { uint32 oldMSTime = getMSTime(); // 0 1 2 3 4 5 6 @@ -204,7 +200,6 @@ void GroupMgr::LoadGroups() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 group-instance saves. DB table `group_instance` is empty!"); - return; } @@ -236,6 +231,5 @@ void GroupMgr::LoadGroups() while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u group-instance saves in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - } } diff --git a/src/server/game/Guilds/GuildMgr.cpp b/src/server/game/Guilds/GuildMgr.cpp index 72c791e8a9f..584d32b12d5 100644 --- a/src/server/game/Guilds/GuildMgr.cpp +++ b/src/server/game/Guilds/GuildMgr.cpp @@ -104,7 +104,7 @@ Guild* GuildMgr::GetGuildByLeader(uint64 guid) const void GuildMgr::LoadGuilds() { // 1. Load all guilds - sLog->outInfo(LOG_FILTER_GUILD, "Loading guilds definitions..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading guilds definitions..."); { uint32 oldMSTime = getMSTime(); @@ -116,8 +116,7 @@ void GuildMgr::LoadGuilds() if (!result) { - sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded 0 guild definitions. DB table `guild` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 guild definitions. DB table `guild` is empty."); return; } else @@ -139,13 +138,12 @@ void GuildMgr::LoadGuilds() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded %u guild definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u guild definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } // 2. Load all guild ranks - sLog->outInfo(LOG_FILTER_GUILD, "Loading guild ranks..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading guild ranks..."); { uint32 oldMSTime = getMSTime(); @@ -157,8 +155,7 @@ void GuildMgr::LoadGuilds() if (!result) { - sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded 0 guild ranks. DB table `guild_rank` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 guild ranks. DB table `guild_rank` is empty."); } else { @@ -175,13 +172,12 @@ void GuildMgr::LoadGuilds() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded %u guild ranks in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u guild ranks in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } // 3. Load all guild members - sLog->outInfo(LOG_FILTER_GUILD, "Loading guild members..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading guild members..."); { uint32 oldMSTime = getMSTime(); @@ -200,8 +196,7 @@ void GuildMgr::LoadGuilds() if (!result) { - sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded 0 guild members. DB table `guild_member` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 guild members. DB table `guild_member` is empty."); } else { @@ -219,13 +214,12 @@ void GuildMgr::LoadGuilds() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded %u guild members int %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u guild members int %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } // 4. Load all guild bank tab rights - sLog->outInfo(LOG_FILTER_GUILD, "Loading bank tab rights..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading bank tab rights..."); { uint32 oldMSTime = getMSTime(); @@ -237,8 +231,7 @@ void GuildMgr::LoadGuilds() if (!result) { - sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded 0 guild bank tab rights. DB table `guild_bank_right` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 guild bank tab rights. DB table `guild_bank_right` is empty."); } else { @@ -255,13 +248,12 @@ void GuildMgr::LoadGuilds() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded %u bank tab rights in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u bank tab rights in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } // 5. Load all event logs - sLog->outInfo(LOG_FILTER_GUILD, "Loading guild event logs..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading guild event logs..."); { uint32 oldMSTime = getMSTime(); @@ -272,8 +264,7 @@ void GuildMgr::LoadGuilds() if (!result) { - sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded 0 guild event logs. DB table `guild_eventlog` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 guild event logs. DB table `guild_eventlog` is empty."); } else { @@ -290,13 +281,12 @@ void GuildMgr::LoadGuilds() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded %u guild event logs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u guild event logs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } // 6. Load all bank event logs - sLog->outInfo(LOG_FILTER_GUILD, "Loading guild bank event logs..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading guild bank event logs..."); { uint32 oldMSTime = getMSTime(); @@ -308,8 +298,7 @@ void GuildMgr::LoadGuilds() if (!result) { - sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded 0 guild bank event logs. DB table `guild_bank_eventlog` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 guild bank event logs. DB table `guild_bank_eventlog` is empty."); } else { @@ -326,13 +315,12 @@ void GuildMgr::LoadGuilds() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded %u guild bank event logs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u guild bank event logs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } // 7. Load all guild bank tabs - sLog->outInfo(LOG_FILTER_GUILD, "Loading guild bank tabs..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading guild bank tabs..."); { uint32 oldMSTime = getMSTime(); @@ -344,8 +332,7 @@ void GuildMgr::LoadGuilds() if (!result) { - sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded 0 guild bank tabs. DB table `guild_bank_tab` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 guild bank tabs. DB table `guild_bank_tab` is empty."); } else { @@ -362,8 +349,7 @@ void GuildMgr::LoadGuilds() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded %u guild bank tabs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u guild bank tabs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } @@ -382,8 +368,7 @@ void GuildMgr::LoadGuilds() if (!result) { - sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded 0 guild bank tab items. DB table `guild_bank_item` or `item_instance` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 guild bank tab items. DB table `guild_bank_item` or `item_instance` is empty."); } else { @@ -400,8 +385,7 @@ void GuildMgr::LoadGuilds() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GUILD, ">> Loaded %u guild bank tab items in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u guild bank tab items in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } @@ -441,7 +425,6 @@ void GuildMgr::LoadGuilds() } } - sLog->outInfo(LOG_FILTER_GUILD, ">> Validated data of loaded guilds in %u ms", GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Validated data of loaded guilds in %u ms", GetMSTimeDiffToNow(oldMSTime)); } } diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index 3259cdbadbf..4c25be6146b 100755 --- a/src/server/game/Loot/LootMgr.cpp +++ b/src/server/game/Loot/LootMgr.cpp @@ -1454,7 +1454,7 @@ bool LootTemplate::isReference(uint32 id) void LoadLootTemplates_Creature() { - sLog->outInfo(LOG_FILTER_LOOT, "Loading creature loot templates..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading creature loot templates..."); uint32 oldMSTime = getMSTime(); @@ -1481,16 +1481,14 @@ void LoadLootTemplates_Creature() LootTemplates_Creature.ReportUnusedIds(lootIdSet); if (count) - sLog->outInfo(LOG_FILTER_LOOT, ">> Loaded %u creature loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u creature loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); else sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 creature loot templates. DB table `creature_loot_template` is empty"); - - } void LoadLootTemplates_Disenchant() { - sLog->outInfo(LOG_FILTER_LOOT, "Loading disenchanting loot templates..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading disenchanting loot templates..."); uint32 oldMSTime = getMSTime(); @@ -1517,15 +1515,14 @@ void LoadLootTemplates_Disenchant() LootTemplates_Disenchant.ReportUnusedIds(lootIdSet); if (count) - sLog->outInfo(LOG_FILTER_LOOT, ">> Loaded %u disenchanting loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u disenchanting loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); else sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 disenchanting loot templates. DB table `disenchant_loot_template` is empty"); - } void LoadLootTemplates_Fishing() { - sLog->outInfo(LOG_FILTER_LOOT, "Loading fishing loot templates..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading fishing loot templates..."); uint32 oldMSTime = getMSTime(); @@ -1542,16 +1539,14 @@ void LoadLootTemplates_Fishing() LootTemplates_Fishing.ReportUnusedIds(lootIdSet); if (count) - sLog->outInfo(LOG_FILTER_LOOT, ">> Loaded %u fishing loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u fishing loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); else sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 fishing loot templates. DB table `fishing_loot_template` is empty"); - - } void LoadLootTemplates_Gameobject() { - sLog->outInfo(LOG_FILTER_LOOT, "Loading gameobject loot templates..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading gameobject loot templates..."); uint32 oldMSTime = getMSTime(); @@ -1578,16 +1573,14 @@ void LoadLootTemplates_Gameobject() LootTemplates_Gameobject.ReportUnusedIds(lootIdSet); if (count) - sLog->outInfo(LOG_FILTER_LOOT, ">> Loaded %u gameobject loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u gameobject loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); else sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 gameobject loot templates. DB table `gameobject_loot_template` is empty"); - - } void LoadLootTemplates_Item() { - sLog->outInfo(LOG_FILTER_LOOT, "Loading item loot templates..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading item loot templates..."); uint32 oldMSTime = getMSTime(); @@ -1604,16 +1597,14 @@ void LoadLootTemplates_Item() LootTemplates_Item.ReportUnusedIds(lootIdSet); if (count) - sLog->outInfo(LOG_FILTER_LOOT, ">> Loaded %u item loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u item loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); else sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 item loot templates. DB table `item_loot_template` is empty"); - - } void LoadLootTemplates_Milling() { - sLog->outInfo(LOG_FILTER_LOOT, "Loading milling loot templates..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading milling loot templates..."); uint32 oldMSTime = getMSTime(); @@ -1635,16 +1626,14 @@ void LoadLootTemplates_Milling() LootTemplates_Milling.ReportUnusedIds(lootIdSet); if (count) - sLog->outInfo(LOG_FILTER_LOOT, ">> Loaded %u milling loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u milling loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); else sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 milling loot templates. DB table `milling_loot_template` is empty"); - - } void LoadLootTemplates_Pickpocketing() { - sLog->outInfo(LOG_FILTER_LOOT, "Loading pickpocketing loot templates..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading pickpocketing loot templates..."); uint32 oldMSTime = getMSTime(); @@ -1671,16 +1660,14 @@ void LoadLootTemplates_Pickpocketing() LootTemplates_Pickpocketing.ReportUnusedIds(lootIdSet); if (count) - sLog->outInfo(LOG_FILTER_LOOT, ">> Loaded %u pickpocketing loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u pickpocketing loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); else sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 pickpocketing loot templates. DB table `pickpocketing_loot_template` is empty"); - - } void LoadLootTemplates_Prospecting() { - sLog->outInfo(LOG_FILTER_LOOT, "Loading prospecting loot templates..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading prospecting loot templates..."); uint32 oldMSTime = getMSTime(); @@ -1702,16 +1689,14 @@ void LoadLootTemplates_Prospecting() LootTemplates_Prospecting.ReportUnusedIds(lootIdSet); if (count) - sLog->outInfo(LOG_FILTER_LOOT, ">> Loaded %u prospecting loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u prospecting loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); else sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 prospecting loot templates. DB table `prospecting_loot_template` is empty"); - - } void LoadLootTemplates_Mail() { - sLog->outInfo(LOG_FILTER_LOOT, "Loading mail loot templates..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading mail loot templates..."); uint32 oldMSTime = getMSTime(); @@ -1728,16 +1713,14 @@ void LoadLootTemplates_Mail() LootTemplates_Mail.ReportUnusedIds(lootIdSet); if (count) - sLog->outInfo(LOG_FILTER_LOOT, ">> Loaded %u mail loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u mail loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); else sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 mail loot templates. DB table `mail_loot_template` is empty"); - - } void LoadLootTemplates_Skinning() { - sLog->outInfo(LOG_FILTER_LOOT, "Loading skinning loot templates..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading skinning loot templates..."); uint32 oldMSTime = getMSTime(); @@ -1764,16 +1747,14 @@ void LoadLootTemplates_Skinning() LootTemplates_Skinning.ReportUnusedIds(lootIdSet); if (count) - sLog->outInfo(LOG_FILTER_LOOT, ">> Loaded %u skinning loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u skinning loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); else sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 skinning loot templates. DB table `skinning_loot_template` is empty"); - - } void LoadLootTemplates_Spell() { - sLog->outInfo(LOG_FILTER_LOOT, "Loading spell loot templates..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading spell loot templates..."); uint32 oldMSTime = getMSTime(); @@ -1808,15 +1789,14 @@ void LoadLootTemplates_Spell() LootTemplates_Spell.ReportUnusedIds(lootIdSet); if (count) - sLog->outInfo(LOG_FILTER_LOOT, ">> Loaded %u spell loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spell loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); else sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 spell loot templates. DB table `spell_loot_template` is empty"); - } void LoadLootTemplates_Reference() { - sLog->outInfo(LOG_FILTER_LOOT, "Loading reference loot templates..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading reference loot templates..."); uint32 oldMSTime = getMSTime(); @@ -1839,6 +1819,5 @@ void LoadLootTemplates_Reference() // output error for any still listed ids (not referenced from any loot table) LootTemplates_Reference.ReportUnusedIds(lootIdSet); - sLog->outInfo(LOG_FILTER_LOOT, ">> Loaded refence loot templates in %u ms", GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded refence loot templates in %u ms", GetMSTimeDiffToNow(oldMSTime)); } diff --git a/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp b/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp index 5ada88cdf7a..ce987e25eed 100755 --- a/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp +++ b/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp @@ -46,8 +46,7 @@ void OutdoorPvPMgr::InitOutdoorPvP() if (!result) { - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 outdoor PvP definitions. DB table `outdoorpvp_template` is empty."); - + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 outdoor PvP definitions. DB table `outdoorpvp_template` is empty."); return; } @@ -106,8 +105,7 @@ void OutdoorPvPMgr::InitOutdoorPvP() m_OutdoorPvPSet.push_back(pvp); } - sLog->outInfo(LOG_FILTER_OUTDOORPVP, ">> Loaded %u outdoor PvP definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u outdoor PvP definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void OutdoorPvPMgr::AddZone(uint32 zoneid, OutdoorPvP* handle) diff --git a/src/server/game/Pools/PoolMgr.cpp b/src/server/game/Pools/PoolMgr.cpp index 6ee70101af7..79e8d47aa94 100755 --- a/src/server/game/Pools/PoolMgr.cpp +++ b/src/server/game/Pools/PoolMgr.cpp @@ -571,7 +571,7 @@ void PoolMgr::LoadFromDB() if (!result) { mPoolTemplate.clear(); - sLog->outInfo(LOG_FILTER_POOLSYS, ">> Loaded 0 object pools. DB table `pool_template` is empty."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 object pools. DB table `pool_template` is empty."); return; } @@ -589,12 +589,12 @@ void PoolMgr::LoadFromDB() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_POOLSYS, ">> Loaded %u objects pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u objects pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } // Creatures - sLog->outInfo(LOG_FILTER_POOLSYS, "Loading Creatures Pooling Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Creatures Pooling Data..."); { uint32 oldMSTime = getMSTime(); @@ -603,7 +603,7 @@ void PoolMgr::LoadFromDB() if (!result) { - sLog->outInfo(LOG_FILTER_POOLSYS, ">> Loaded 0 creatures in pools. DB table `pool_creature` is empty."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 creatures in pools. DB table `pool_creature` is empty."); } else { @@ -644,13 +644,13 @@ void PoolMgr::LoadFromDB() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_POOLSYS, ">> Loaded %u creatures in pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u creatures in pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } // Gameobjects - sLog->outInfo(LOG_FILTER_POOLSYS, "Loading Gameobject Pooling Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Gameobject Pooling Data..."); { uint32 oldMSTime = getMSTime(); @@ -659,7 +659,7 @@ void PoolMgr::LoadFromDB() if (!result) { - sLog->outInfo(LOG_FILTER_POOLSYS, ">> Loaded 0 gameobjects in pools. DB table `pool_gameobject` is empty."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 gameobjects in pools. DB table `pool_gameobject` is empty."); } else { @@ -712,13 +712,13 @@ void PoolMgr::LoadFromDB() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_POOLSYS, ">> Loaded %u gameobject in pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u gameobject in pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } // Pool of pools - sLog->outInfo(LOG_FILTER_POOLSYS, "Loading Mother Pooling Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Mother Pooling Data..."); { uint32 oldMSTime = getMSTime(); @@ -727,7 +727,7 @@ void PoolMgr::LoadFromDB() if (!result) { - sLog->outInfo(LOG_FILTER_POOLSYS, ">> Loaded 0 pools in pools"); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 pools in pools"); } else { @@ -796,11 +796,11 @@ void PoolMgr::LoadFromDB() } } - sLog->outInfo(LOG_FILTER_POOLSYS, ">> Loaded %u pools in mother pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u pools in mother pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } - sLog->outInfo(LOG_FILTER_POOLSYS, "Loading Quest Pooling Data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Quest Pooling Data..."); { uint32 oldMSTime = getMSTime(); @@ -809,7 +809,7 @@ void PoolMgr::LoadFromDB() if (!result) { - sLog->outInfo(LOG_FILTER_POOLSYS, ">> Loaded 0 quests in pools"); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 quests in pools"); } else { @@ -884,12 +884,12 @@ void PoolMgr::LoadFromDB() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_POOLSYS, ">> Loaded %u quests in pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u quests in pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } } // The initialize method will spawn all pools not in an event and not in another pool, this is why there is 2 left joins with 2 null checks - sLog->outInfo(LOG_FILTER_POOLSYS, "Starting objects pooling system..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Starting objects pooling system..."); { uint32 oldMSTime = getMSTime(); @@ -899,7 +899,7 @@ void PoolMgr::LoadFromDB() if (!result) { - sLog->outInfo(LOG_FILTER_POOLSYS, ">> Pool handling system initialized, 0 pools spawned."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Pool handling system initialized, 0 pools spawned."); } else { diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index 480ab8ef4ae..671cba2e2c2 100755 --- a/src/server/game/Scripting/ScriptMgr.cpp +++ b/src/server/game/Scripting/ScriptMgr.cpp @@ -251,13 +251,12 @@ void ScriptMgr::Initialize() LoadDatabase(); - sLog->outInfo(LOG_FILTER_TSCR, "Loading C++ scripts"); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading C++ scripts"); FillSpellSummary(); AddScripts(); - sLog->outInfo(LOG_FILTER_TSCR, ">> Loaded %u C++ scripts in %u ms", GetScriptCount(), GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u C++ scripts in %u ms", GetScriptCount(), GetMSTimeDiffToNow(oldMSTime)); } void ScriptMgr::Unload() diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h index b16b877eded..0dc357c366d 100755 --- a/src/server/game/Scripting/ScriptMgr.h +++ b/src/server/game/Scripting/ScriptMgr.h @@ -164,7 +164,7 @@ class ScriptObject protected: ScriptObject(const char* name) - : _name(std::string(name)) + : _name(name) { } diff --git a/src/server/game/Scripting/ScriptSystem.cpp b/src/server/game/Scripting/ScriptSystem.cpp index f24b01306c5..41b41b91808 100755 --- a/src/server/game/Scripting/ScriptSystem.cpp +++ b/src/server/game/Scripting/ScriptSystem.cpp @@ -25,10 +25,10 @@ ScriptPointVector const SystemMgr::_empty; void SystemMgr::LoadScriptTexts() { - sLog->outInfo(LOG_FILTER_TSCR, "TSCR: Loading Script Texts..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Script Texts..."); LoadTrinityStrings("script_texts", TEXT_SOURCE_RANGE, 1+(TEXT_SOURCE_RANGE*2)); - sLog->outInfo(LOG_FILTER_TSCR, "TSCR: Loading Script Texts additional data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Script Texts additional data..."); uint32 oldMSTime = getMSTime(); // 0 1 2 3 @@ -36,8 +36,7 @@ void SystemMgr::LoadScriptTexts() if (!result) { - sLog->outInfo(LOG_FILTER_TSCR, ">> Loaded 0 additional Script Texts data. DB table `script_texts` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 additional Script Texts data. DB table `script_texts` is empty."); return; } @@ -83,23 +82,21 @@ void SystemMgr::LoadScriptTexts() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_TSCR, ">> Loaded %u additional Script Texts data in %u ms", uiCount, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u additional Script Texts data in %u ms", uiCount, GetMSTimeDiffToNow(oldMSTime)); } void SystemMgr::LoadScriptTextsCustom() { - sLog->outInfo(LOG_FILTER_TSCR, "TSCR: Loading Custom Texts..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Custom Texts..."); LoadTrinityStrings("custom_texts", TEXT_SOURCE_RANGE*2, 1+(TEXT_SOURCE_RANGE*3)); - sLog->outInfo(LOG_FILTER_TSCR, "TSCR: Loading Custom Texts additional data..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Custom Texts additional data..."); QueryResult result = WorldDatabase.Query("SELECT entry, sound, type, language, emote FROM custom_texts"); if (!result) { - sLog->outInfo(LOG_FILTER_TSCR, ">> Loaded 0 additional Custom Texts data. DB table `custom_texts` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 additional Custom Texts data. DB table `custom_texts` is empty."); return; } @@ -145,8 +142,7 @@ void SystemMgr::LoadScriptTextsCustom() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_TSCR, ">> Loaded %u additional Custom Texts data.", uiCount); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u additional Custom Texts data.", uiCount); } void SystemMgr::LoadScriptWaypoints() @@ -163,15 +159,14 @@ void SystemMgr::LoadScriptWaypoints() if (result) uiCreatureCount = result->GetRowCount(); - sLog->outInfo(LOG_FILTER_TSCR, "TSCR: Loading Script Waypoints for " UI64FMTD " creature(s)...", uiCreatureCount); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Script Waypoints for " UI64FMTD " creature(s)...", uiCreatureCount); // 0 1 2 3 4 5 result = WorldDatabase.Query("SELECT entry, pointid, location_x, location_y, location_z, waittime FROM script_waypoint ORDER BY pointid"); if (!result) { - sLog->outInfo(LOG_FILTER_TSCR, ">> Loaded 0 Script Waypoints. DB table `script_waypoint` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 Script Waypoints. DB table `script_waypoint` is empty."); return; } @@ -206,6 +201,5 @@ void SystemMgr::LoadScriptWaypoints() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_TSCR, ">> Loaded %u Script Waypoint nodes in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u Script Waypoint nodes in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 9f8e0943b1e..c9f90bf9e1d 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -1155,7 +1155,7 @@ void SpellMgr::LoadSpellRanks() if (!result) { - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded 0 spell rank records. DB table `spell_ranks` is empty."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 spell rank records. DB table `spell_ranks` is empty."); return; } @@ -1251,7 +1251,7 @@ void SpellMgr::LoadSpellRanks() while (true); } while (!finished); - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u spell rank records in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spell rank records in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } @@ -1267,7 +1267,7 @@ void SpellMgr::LoadSpellRequired() if (!result) { - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded 0 spell required records. DB table `spell_required` is empty."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 spell required records. DB table `spell_required` is empty."); return; } @@ -1312,7 +1312,7 @@ void SpellMgr::LoadSpellRequired() ++count; } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u spell required records in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spell required records in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } @@ -1350,8 +1350,7 @@ void SpellMgr::LoadSpellLearnSkills() } } - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u Spell Learn Skills from DBC in %u ms", dbc_count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u Spell Learn Skills from DBC in %u ms", dbc_count, GetMSTimeDiffToNow(oldMSTime)); } void SpellMgr::LoadSpellLearnSpells() @@ -1364,8 +1363,7 @@ void SpellMgr::LoadSpellLearnSpells() QueryResult result = WorldDatabase.Query("SELECT entry, SpellID, Active FROM spell_learn_spell"); if (!result) { - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded 0 spell learn spells. DB table `spell_learn_spell` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 spell learn spells. DB table `spell_learn_spell` is empty."); return; } @@ -1453,8 +1451,7 @@ void SpellMgr::LoadSpellLearnSpells() } } - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u spell learn spells + %u found in DBC in %u ms", count, dbc_count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spell learn spells + %u found in DBC in %u ms", count, dbc_count, GetMSTimeDiffToNow(oldMSTime)); } void SpellMgr::LoadSpellTargetPositions() @@ -1467,8 +1464,7 @@ void SpellMgr::LoadSpellTargetPositions() QueryResult result = WorldDatabase.Query("SELECT id, target_map, target_position_x, target_position_y, target_position_z, target_orientation FROM spell_target_position"); if (!result) { - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded 0 spell target coordinates. DB table `spell_target_position` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 spell target coordinates. DB table `spell_target_position` is empty."); return; } @@ -1573,8 +1569,7 @@ void SpellMgr::LoadSpellTargetPositions() } }*/ - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u spell teleport coordinates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spell teleport coordinates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void SpellMgr::LoadSpellGroups() @@ -1588,8 +1583,7 @@ void SpellMgr::LoadSpellGroups() QueryResult result = WorldDatabase.Query("SELECT id, spell_id FROM spell_group"); if (!result) { - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded 0 spell group definitions. DB table `spell_group` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 spell group definitions. DB table `spell_group` is empty."); return; } @@ -1655,8 +1649,7 @@ void SpellMgr::LoadSpellGroups() } } - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u spell group definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spell group definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void SpellMgr::LoadSpellGroupStackRules() @@ -1669,8 +1662,7 @@ void SpellMgr::LoadSpellGroupStackRules() QueryResult result = WorldDatabase.Query("SELECT group_id, stack_rule FROM spell_group_stack_rules"); if (!result) { - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded 0 spell group stack rules. DB table `spell_group_stack_rules` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 spell group stack rules. DB table `spell_group_stack_rules` is empty."); return; } @@ -1700,8 +1692,7 @@ void SpellMgr::LoadSpellGroupStackRules() ++count; } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u spell group stack rules in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spell group stack rules in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void SpellMgr::LoadSpellProcEvents() @@ -1714,8 +1705,7 @@ void SpellMgr::LoadSpellProcEvents() QueryResult result = WorldDatabase.Query("SELECT entry, SchoolMask, SpellFamilyName, SpellFamilyMask0, SpellFamilyMask1, SpellFamilyMask2, procFlags, procEx, ppmRate, CustomChance, Cooldown FROM spell_proc_event"); if (!result) { - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded 0 spell proc event conditions. DB table `spell_proc_event` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 spell proc event conditions. DB table `spell_proc_event` is empty."); return; } @@ -1762,9 +1752,9 @@ void SpellMgr::LoadSpellProcEvents() } while (result->NextRow()); if (customProc) - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u extra and %u custom spell proc event conditions in %u ms", count, customProc, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u extra and %u custom spell proc event conditions in %u ms", count, customProc, GetMSTimeDiffToNow(oldMSTime)); else - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u extra spell proc event conditions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u extra spell proc event conditions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } @@ -1778,8 +1768,7 @@ void SpellMgr::LoadSpellProcs() QueryResult result = WorldDatabase.Query("SELECT spellId, schoolMask, spellFamilyName, spellFamilyMask0, spellFamilyMask1, spellFamilyMask2, typeMask, spellTypeMask, spellPhaseMask, hitMask, attributesMask, ratePerMinute, chance, cooldown, charges FROM spell_proc"); if (!result) { - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded 0 spell proc conditions and data. DB table `spell_proc` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 spell proc conditions and data. DB table `spell_proc` is empty."); return; } @@ -1905,8 +1894,7 @@ void SpellMgr::LoadSpellProcs() ++count; } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u spell proc conditions and data in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spell proc conditions and data in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void SpellMgr::LoadSpellBonusess() @@ -1919,8 +1907,7 @@ void SpellMgr::LoadSpellBonusess() QueryResult result = WorldDatabase.Query("SELECT entry, direct_bonus, dot_bonus, ap_bonus, ap_dot_bonus FROM spell_bonus_data"); if (!result) { - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded 0 spell bonus data. DB table `spell_bonus_data` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 spell bonus data. DB table `spell_bonus_data` is empty."); return; } @@ -1946,8 +1933,7 @@ void SpellMgr::LoadSpellBonusess() ++count; } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u extra spell bonus data in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u extra spell bonus data in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void SpellMgr::LoadSpellThreats() @@ -1960,8 +1946,7 @@ void SpellMgr::LoadSpellThreats() QueryResult result = WorldDatabase.Query("SELECT entry, flatMod, pctMod, apPctMod FROM spell_threat"); if (!result) { - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded 0 aggro generating spells. DB table `spell_threat` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 aggro generating spells. DB table `spell_threat` is empty."); return; } @@ -1987,8 +1972,7 @@ void SpellMgr::LoadSpellThreats() ++count; } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u SpellThreatEntries in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u SpellThreatEntries in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void SpellMgr::LoadSkillLineAbilityMap() @@ -2009,8 +1993,7 @@ void SpellMgr::LoadSkillLineAbilityMap() ++count; } - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u SkillLineAbility MultiMap Data in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u SkillLineAbility MultiMap Data in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void SpellMgr::LoadSpellPetAuras() @@ -2023,8 +2006,7 @@ void SpellMgr::LoadSpellPetAuras() QueryResult result = WorldDatabase.Query("SELECT spell, effectId, pet, aura FROM spell_pet_auras"); if (!result) { - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded 0 spell pet auras. DB table `spell_pet_auras` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 spell pet auras. DB table `spell_pet_auras` is empty."); return; } @@ -2071,8 +2053,7 @@ void SpellMgr::LoadSpellPetAuras() ++count; } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u spell pet auras in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spell pet auras in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } // Fill custom data about enchancments @@ -2112,8 +2093,7 @@ void SpellMgr::LoadEnchantCustomAttr() } } - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u custom enchant attributes in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u custom enchant attributes in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void SpellMgr::LoadSpellEnchantProcData() @@ -2126,8 +2106,7 @@ void SpellMgr::LoadSpellEnchantProcData() QueryResult result = WorldDatabase.Query("SELECT entry, customChance, PPMChance, procEx FROM spell_enchant_proc_data"); if (!result) { - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded 0 spell enchant proc event conditions. DB table `spell_enchant_proc_data` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 spell enchant proc event conditions. DB table `spell_enchant_proc_data` is empty."); return; } @@ -2156,8 +2135,7 @@ void SpellMgr::LoadSpellEnchantProcData() ++count; } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u enchant proc data definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u enchant proc data definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void SpellMgr::LoadSpellLinked() @@ -2170,8 +2148,7 @@ void SpellMgr::LoadSpellLinked() QueryResult result = WorldDatabase.Query("SELECT spell_trigger, spell_effect, type FROM spell_linked_spell"); if (!result) { - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded 0 linked spells. DB table `spell_linked_spell` is empty."); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 linked spells. DB table `spell_linked_spell` is empty."); return; } @@ -2209,8 +2186,7 @@ void SpellMgr::LoadSpellLinked() ++count; } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u linked spells in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u linked spells in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void SpellMgr::LoadPetLevelupSpellMap() @@ -2266,8 +2242,7 @@ void SpellMgr::LoadPetLevelupSpellMap() } } - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u pet levelup and default spells for %u families in %u ms", count, family_count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u pet levelup and default spells for %u families in %u ms", count, family_count, GetMSTimeDiffToNow(oldMSTime)); } bool LoadPetDefaultSpells_helper(CreatureTemplate const* cInfo, PetDefaultSpellsEntry& petDefSpells) @@ -2351,10 +2326,9 @@ void SpellMgr::LoadPetDefaultSpells() } } - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded addition spells for %u pet spell data entries in %u ms", countData, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded addition spells for %u pet spell data entries in %u ms", countData, GetMSTimeDiffToNow(oldMSTime)); - - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, "Loading summonable creature templates..."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading summonable creature templates..."); oldMSTime = getMSTime(); // different summon spells @@ -2395,8 +2369,7 @@ void SpellMgr::LoadPetDefaultSpells() } } - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u summonable creature templates in %u ms", countCreature, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u summonable creature templates in %u ms", countCreature, GetMSTimeDiffToNow(oldMSTime)); } void SpellMgr::LoadSpellAreas() @@ -2414,7 +2387,7 @@ void SpellMgr::LoadSpellAreas() if (!result) { - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded 0 spell area requirements. DB table `spell_area` is empty."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 spell area requirements. DB table `spell_area` is empty."); return; } @@ -2595,8 +2568,7 @@ void SpellMgr::LoadSpellAreas() ++count; } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded %u spell area requirements in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spell area requirements in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void SpellMgr::LoadSpellInfoStore() @@ -2612,8 +2584,7 @@ void SpellMgr::LoadSpellInfoStore() mSpellInfoMap[i] = new SpellInfo(spellEntry); } - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded spell info store in %u ms", GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded spell info store in %u ms", GetMSTimeDiffToNow(oldMSTime)); } void SpellMgr::UnloadSpellInfoStore() @@ -2925,8 +2896,7 @@ void SpellMgr::LoadSpellCustomAttr() CreatureAI::FillAISpellInfo(); - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loaded spell custom attributes in %u ms", GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded spell custom attributes in %u ms", GetMSTimeDiffToNow(oldMSTime)); } void SpellMgr::LoadDbcDataCorrections() @@ -3571,5 +3541,5 @@ void SpellMgr::LoadDbcDataCorrections() properties = const_cast(sSummonPropertiesStore.LookupEntry(647)); // 52893 properties->Type = SUMMON_TYPE_TOTEM; */ - sLog->outInfo(LOG_FILTER_SPELLS_AURAS, ">> Loading spell dbc data corrections in %u ms", GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loading spell dbc data corrections in %u ms", GetMSTimeDiffToNow(oldMSTime)); } diff --git a/src/server/shared/Logging/Log.cpp b/src/server/shared/Logging/Log.cpp index 8e740ba83b8..3a24190d8fa 100644 --- a/src/server/shared/Logging/Log.cpp +++ b/src/server/shared/Logging/Log.cpp @@ -114,9 +114,6 @@ void Log::CreateAppenderFromConfig(const char* name) { case APPENDER_CONSOLE: { - if (flags == APPENDER_FLAGS_NONE) - flags = AppenderFlags(APPENDER_FLAGS_PREFIX_LOGLEVEL | APPENDER_FLAGS_PREFIX_LOGFILTERTYPE); - AppenderConsole* appender = new AppenderConsole(NextAppenderId(), name, level, flags); appenders[appender->getId()] = appender; if (++iter != tokens.end()) @@ -135,9 +132,6 @@ void Log::CreateAppenderFromConfig(const char* name) return; } - if (flags == APPENDER_FLAGS_NONE) - flags = AppenderFlags(APPENDER_FLAGS_PREFIX_LOGLEVEL | APPENDER_FLAGS_PREFIX_LOGFILTERTYPE | APPENDER_FLAGS_PREFIX_TIMESTAMP); - filename = *iter; if (++iter != tokens.end()) diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index 61700de050b..cba2bb8b700 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -2620,14 +2620,14 @@ PlayerDump.DisallowOverwrite = 1 # Example: "13 11 9 5 3 1" # # File: Name of the file (read as optional1 if Type = File) -# Allows to use one "%u" to create dynamic files +# Allows to use one "%s" to create dynamic files # # Mode: Mode to open the file (read as optional2 if Type = File) # a - (Append) # w - (Overwrite) # -Appender.Console=1,5,0 +Appender.Console=1,3,0 Appender.Server=2,2,0,Server.log,w Appender.GM=2,2,0,GM.log Appender.DBErrors=2,2,0,DBErrors.log @@ -2712,12 +2712,13 @@ Appenders=Console Server GM DBErrors Char RA Warden Chat # (Using spaces as separator). # -Logger.Root=0,3,Console Server +Logger.Root=0,5,Console Server Logger.Chat=22,3,Chat Logger.DBErrors=26,5,Console Server DBErrors Logger.GM=27,3,Console Server GM Logger.RA=28,3,RA Logger.Warden=29,3,Warden +Logger.WorldServer=31,3,Console Server Logger.Character=34,3,Char Logger.Arenas=35,3,Arenas Logger.SQLDriver=36,5,SQLDriver @@ -2731,4 +2732,4 @@ Logger.Load=40,3,Console Server # (Using spaces as separator). # Default: "Root Chat DBErrors GM RA Warden Character Load" -Loggers=Root Chat DBErrors GM RA Warden Character Load +Loggers=Root Chat DBErrors GM RA Warden Character Load WorldServer -- cgit v1.2.3 From 69c74bb3c52682eaf4e26fbe8da832ddf1a94ff7 Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 16 Aug 2012 21:37:46 +0100 Subject: Core/Logging: Change a few more logging messages to LOG_FILTER_SERVER_LOADING consistency! --- src/server/game/Conditions/ConditionMgr.cpp | 2 +- .../game/Entities/Item/ItemEnchantmentMgr.cpp | 2 +- src/server/game/Events/GameEventMgr.cpp | 2 +- src/server/game/Globals/ObjectMgr.cpp | 64 +++++++++++----------- src/server/game/Loot/LootMgr.cpp | 22 ++++---- .../game/Movement/Waypoints/WaypointManager.cpp | 2 +- src/server/game/Skills/SkillDiscovery.cpp | 2 +- src/server/game/Skills/SkillExtraItems.cpp | 2 +- src/server/game/Warden/WardenCheckMgr.cpp | 4 +- src/server/game/Weather/WeatherMgr.cpp | 2 +- 10 files changed, 52 insertions(+), 52 deletions(-) (limited to 'src') diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 7024f995ce7..ab3c6aba791 100755 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -712,7 +712,7 @@ void ConditionMgr::LoadConditions(bool isReload) if (!result) { - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 conditions. DB table `conditions` is empty!"); + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 conditions. DB table `conditions` is empty!"); return; } diff --git a/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp b/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp index f85bf80e145..5b427c48a4b 100755 --- a/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp +++ b/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp @@ -73,7 +73,7 @@ void LoadRandomEnchantmentsTable() sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u Item Enchantment definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } else - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 Item Enchantment definitions. DB table `item_enchantment_template` is empty."); + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 Item Enchantment definitions. DB table `item_enchantment_template` is empty."); } uint32 GetItemEnchantMod(int32 entry) diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp index a8eec927854..be9bd7ecbf3 100755 --- a/src/server/game/Events/GameEventMgr.cpp +++ b/src/server/game/Events/GameEventMgr.cpp @@ -210,7 +210,7 @@ void GameEventMgr::LoadFromDB() if (!result) { mGameEvent.clear(); - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 game events. DB table `game_event` is empty."); + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 game events. DB table `game_event` is empty."); return; } diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 7a43a6d763a..f8c139ddfed 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -1172,7 +1172,7 @@ void ObjectMgr::LoadLinkedRespawn() if (!result) { - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 linked respawns. DB table `linked_respawn` is empty."); + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 linked respawns. DB table `linked_respawn` is empty."); return; } @@ -1403,7 +1403,7 @@ void ObjectMgr::LoadCreatures() if (!result) { - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 creatures. DB table `creature` is empty."); + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 creatures. DB table `creature` is empty."); return; } @@ -1712,7 +1712,7 @@ void ObjectMgr::LoadGameobjects() if (!result) { - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 gameobjects. DB table `gameobject` is empty."); + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 gameobjects. DB table `gameobject` is empty."); return; } @@ -2565,7 +2565,7 @@ void ObjectMgr::LoadItemTemplateAddon() } while (result->NextRow()); } - sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u item addon templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u item addon templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } void ObjectMgr::LoadItemScriptNames() @@ -2591,7 +2591,7 @@ void ObjectMgr::LoadItemScriptNames() } while (result->NextRow()); } - sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u item script names in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u item script names in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } ItemTemplate const* ObjectMgr::GetItemTemplate(uint32 entry) @@ -2615,7 +2615,7 @@ void ObjectMgr::LoadVehicleTemplateAccessories() if (!result) { - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 vehicle template accessories. DB table `vehicle_template_accessory` is empty."); + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 vehicle template accessories. DB table `vehicle_template_accessory` is empty."); return; } @@ -2710,7 +2710,7 @@ void ObjectMgr::LoadPetLevelInfo() if (!result) { - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 level pet stats definitions. DB table `pet_levelstats` is empty."); + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 level pet stats definitions. DB table `pet_levelstats` is empty."); return; } @@ -2857,7 +2857,7 @@ void ObjectMgr::LoadPlayerInfo() if (!result) { - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 player create definitions. DB table `playercreateinfo` is empty."); + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 player create definitions. DB table `playercreateinfo` is empty."); exit(1); } else @@ -3015,7 +3015,7 @@ void ObjectMgr::LoadPlayerInfo() if (!result) { - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 player create spells. DB table `%s` is empty.", sWorld->getBoolConfig(CONFIG_START_ALL_SPELLS) ? "playercreateinfo_spell_custom" : "playercreateinfo_spell"); + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 player create spells. DB table `%s` is empty.", sWorld->getBoolConfig(CONFIG_START_ALL_SPELLS) ? "playercreateinfo_spell_custom" : "playercreateinfo_spell"); } else @@ -3071,7 +3071,7 @@ void ObjectMgr::LoadPlayerInfo() if (!result) { - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 player create actions. DB table `playercreateinfo_action` is empty."); + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 player create actions. DB table `playercreateinfo_action` is empty."); } else @@ -3117,7 +3117,7 @@ void ObjectMgr::LoadPlayerInfo() if (!result) { - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 level stats definitions. DB table `player_levelstats` is empty."); + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 level stats definitions. DB table `player_levelstats` is empty."); exit(1); } @@ -3234,7 +3234,7 @@ void ObjectMgr::LoadPlayerInfo() if (!result) { - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 xp for level definitions. DB table `player_xp_for_level` is empty."); + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 xp for level definitions. DB table `player_xp_for_level` is empty."); exit(1); } @@ -3444,7 +3444,7 @@ void ObjectMgr::LoadQuests() " FROM quest_template"); if (!result) { - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 quests definitions. DB table `quest_template` is empty."); + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 quests definitions. DB table `quest_template` is empty."); return; } @@ -4986,7 +4986,7 @@ void ObjectMgr::LoadInstanceEncounters() QueryResult result = WorldDatabase.Query("SELECT entry, creditType, creditEntry, lastEncounterDungeon FROM instance_encounters"); if (!result) { - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 instance encounters, table is empty!"); + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 instance encounters, table is empty!"); return; } @@ -6446,7 +6446,7 @@ void ObjectMgr::LoadExplorationBaseXP() if (!result) { - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 BaseXP definitions. DB table `exploration_basexp` is empty."); + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 BaseXP definitions. DB table `exploration_basexp` is empty."); return; } @@ -6671,7 +6671,7 @@ void ObjectMgr::LoadReputationOnKill() if (!result) { - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 creature award reputation definitions. DB table `creature_onkill_reputation` is empty."); + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 creature award reputation definitions. DB table `creature_onkill_reputation` is empty."); return; } @@ -6859,7 +6859,7 @@ void ObjectMgr::LoadPointsOfInterest() if (!result) { - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 Points of Interest definitions. DB table `points_of_interest` is empty."); + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 Points of Interest definitions. DB table `points_of_interest` is empty."); return; } @@ -6905,7 +6905,7 @@ void ObjectMgr::LoadQuestPOI() if (!result) { - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 quest POI definitions. DB table `quest_poi` is empty."); + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 quest POI definitions. DB table `quest_poi` is empty."); return; } @@ -6973,7 +6973,7 @@ void ObjectMgr::LoadNPCSpellClickSpells() if (!result) { - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 spellclick spells. DB table `npc_spellclick_spells` is empty."); + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 spellclick spells. DB table `npc_spellclick_spells` is empty."); return; } @@ -7076,7 +7076,7 @@ void ObjectMgr::LoadQuestRelationsHelper(QuestRelations& map, std::string table, if (!result) { - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 quest relations from `%s`, table is empty.", table.c_str()); + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 quest relations from `%s`, table is empty.", table.c_str()); return; } @@ -7447,7 +7447,7 @@ bool ObjectMgr::LoadTrinityStrings(const char* table, int32 min_value, int32 max if (!result) { if (min_value == MIN_TRINITY_STRING_ID) // error only in case internal strings - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 trinity strings. DB table `%s` is empty. Cannot continue.", table); + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 trinity strings. DB table `%s` is empty. Cannot continue.", table); else sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 string templates. DB table `%s` is empty.", table); @@ -7523,7 +7523,7 @@ void ObjectMgr::LoadFishingBaseSkillLevel() if (!result) { - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 areas for fishing base skill level. DB table `skill_fishing_base_level` is empty."); + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 areas for fishing base skill level. DB table `skill_fishing_base_level` is empty."); return; } @@ -7631,7 +7631,7 @@ void ObjectMgr::LoadGameTele() if (!result) { - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 GameTeleports. DB table `game_tele` is empty!"); + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 GameTeleports. DB table `game_tele` is empty!"); return; } @@ -7771,7 +7771,7 @@ void ObjectMgr::LoadMailLevelRewards() if (!result) { - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 level dependent mail rewards. DB table `mail_level_reward` is empty."); + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 level dependent mail rewards. DB table `mail_level_reward` is empty."); return; } @@ -7913,7 +7913,7 @@ void ObjectMgr::LoadTrainerSpell() if (!result) { - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 Trainers. DB table `npc_trainer` is empty!"); + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 Trainers. DB table `npc_trainer` is empty!"); return; } @@ -7996,7 +7996,7 @@ void ObjectMgr::LoadVendors() if (!result) { - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 Vendors. DB table `npc_vendor` is empty!"); + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 Vendors. DB table `npc_vendor` is empty!"); return; } @@ -8043,7 +8043,7 @@ void ObjectMgr::LoadGossipMenu() if (!result) { - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 gossip_menu entries. DB table `gossip_menu` is empty!"); + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 gossip_menu entries. DB table `gossip_menu` is empty!"); return; } @@ -8089,7 +8089,7 @@ void ObjectMgr::LoadGossipMenuItems() if (!result) { - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 gossip_menu_option entries. DB table `gossip_menu_option` is empty!"); + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 gossip_menu_option entries. DB table `gossip_menu_option` is empty!"); return; } @@ -8480,7 +8480,7 @@ void ObjectMgr::LoadFactionChangeAchievements() if (!result) { - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 faction change achievement pairs. DB table `player_factionchange_achievement` is empty."); + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 faction change achievement pairs. DB table `player_factionchange_achievement` is empty."); return; } @@ -8551,7 +8551,7 @@ void ObjectMgr::LoadFactionChangeSpells() if (!result) { - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 faction change spell pairs. DB table `player_factionchange_spells` is empty."); + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 faction change spell pairs. DB table `player_factionchange_spells` is empty."); return; } @@ -8622,7 +8622,7 @@ void ObjectMgr::LoadHotfixData() if (!result) { - sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded 0 hotfix info entries. DB table `hotfix_data` is empty."); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 hotfix info entries. DB table `hotfix_data` is empty."); return; } @@ -8644,7 +8644,7 @@ void ObjectMgr::LoadHotfixData() } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_GENERAL, ">> Loaded %u hotfix info entries in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u hotfix info entries in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } GameObjectTemplate const* ObjectMgr::GetGameObjectTemplate(uint32 entry) diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index 4c25be6146b..186b54fd9e0 100755 --- a/src/server/game/Loot/LootMgr.cpp +++ b/src/server/game/Loot/LootMgr.cpp @@ -1483,7 +1483,7 @@ void LoadLootTemplates_Creature() if (count) sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u creature loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); else - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 creature loot templates. DB table `creature_loot_template` is empty"); + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 creature loot templates. DB table `creature_loot_template` is empty"); } void LoadLootTemplates_Disenchant() @@ -1517,7 +1517,7 @@ void LoadLootTemplates_Disenchant() if (count) sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u disenchanting loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); else - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 disenchanting loot templates. DB table `disenchant_loot_template` is empty"); + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 disenchanting loot templates. DB table `disenchant_loot_template` is empty"); } void LoadLootTemplates_Fishing() @@ -1541,7 +1541,7 @@ void LoadLootTemplates_Fishing() if (count) sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u fishing loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); else - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 fishing loot templates. DB table `fishing_loot_template` is empty"); + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 fishing loot templates. DB table `fishing_loot_template` is empty"); } void LoadLootTemplates_Gameobject() @@ -1575,7 +1575,7 @@ void LoadLootTemplates_Gameobject() if (count) sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u gameobject loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); else - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 gameobject loot templates. DB table `gameobject_loot_template` is empty"); + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 gameobject loot templates. DB table `gameobject_loot_template` is empty"); } void LoadLootTemplates_Item() @@ -1599,7 +1599,7 @@ void LoadLootTemplates_Item() if (count) sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u item loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); else - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 item loot templates. DB table `item_loot_template` is empty"); + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 item loot templates. DB table `item_loot_template` is empty"); } void LoadLootTemplates_Milling() @@ -1628,7 +1628,7 @@ void LoadLootTemplates_Milling() if (count) sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u milling loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); else - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 milling loot templates. DB table `milling_loot_template` is empty"); + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 milling loot templates. DB table `milling_loot_template` is empty"); } void LoadLootTemplates_Pickpocketing() @@ -1662,7 +1662,7 @@ void LoadLootTemplates_Pickpocketing() if (count) sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u pickpocketing loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); else - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 pickpocketing loot templates. DB table `pickpocketing_loot_template` is empty"); + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 pickpocketing loot templates. DB table `pickpocketing_loot_template` is empty"); } void LoadLootTemplates_Prospecting() @@ -1691,7 +1691,7 @@ void LoadLootTemplates_Prospecting() if (count) sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u prospecting loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); else - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 prospecting loot templates. DB table `prospecting_loot_template` is empty"); + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 prospecting loot templates. DB table `prospecting_loot_template` is empty"); } void LoadLootTemplates_Mail() @@ -1715,7 +1715,7 @@ void LoadLootTemplates_Mail() if (count) sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u mail loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); else - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 mail loot templates. DB table `mail_loot_template` is empty"); + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 mail loot templates. DB table `mail_loot_template` is empty"); } void LoadLootTemplates_Skinning() @@ -1749,7 +1749,7 @@ void LoadLootTemplates_Skinning() if (count) sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u skinning loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); else - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 skinning loot templates. DB table `skinning_loot_template` is empty"); + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 skinning loot templates. DB table `skinning_loot_template` is empty"); } void LoadLootTemplates_Spell() @@ -1791,7 +1791,7 @@ void LoadLootTemplates_Spell() if (count) sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spell loot templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); else - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 spell loot templates. DB table `spell_loot_template` is empty"); + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 spell loot templates. DB table `spell_loot_template` is empty"); } void LoadLootTemplates_Reference() diff --git a/src/server/game/Movement/Waypoints/WaypointManager.cpp b/src/server/game/Movement/Waypoints/WaypointManager.cpp index a01e18347f6..a03db6bd9f0 100755 --- a/src/server/game/Movement/Waypoints/WaypointManager.cpp +++ b/src/server/game/Movement/Waypoints/WaypointManager.cpp @@ -48,7 +48,7 @@ void WaypointMgr::Load() if (!result) { - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 waypoints. DB table `waypoint_data` is empty!"); + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 waypoints. DB table `waypoint_data` is empty!"); return; } diff --git a/src/server/game/Skills/SkillDiscovery.cpp b/src/server/game/Skills/SkillDiscovery.cpp index 3eac3d34fd2..55dc00c8524 100755 --- a/src/server/game/Skills/SkillDiscovery.cpp +++ b/src/server/game/Skills/SkillDiscovery.cpp @@ -55,7 +55,7 @@ void LoadSkillDiscoveryTable() if (!result) { - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 skill discovery definitions. DB table `skill_discovery_template` is empty."); + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 skill discovery definitions. DB table `skill_discovery_template` is empty."); return; } diff --git a/src/server/game/Skills/SkillExtraItems.cpp b/src/server/game/Skills/SkillExtraItems.cpp index 9e2648dc943..0c094479262 100755 --- a/src/server/game/Skills/SkillExtraItems.cpp +++ b/src/server/game/Skills/SkillExtraItems.cpp @@ -60,7 +60,7 @@ void LoadSkillExtraItemTable() if (!result) { - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 spell specialization definitions. DB table `skill_extra_item_template` is empty."); + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 spell specialization definitions. DB table `skill_extra_item_template` is empty."); return; } diff --git a/src/server/game/Warden/WardenCheckMgr.cpp b/src/server/game/Warden/WardenCheckMgr.cpp index f6daba76c1a..6eca93dc4b5 100644 --- a/src/server/game/Warden/WardenCheckMgr.cpp +++ b/src/server/game/Warden/WardenCheckMgr.cpp @@ -52,7 +52,7 @@ void WardenCheckMgr::LoadWardenChecks() if (!result) { - sLog->outInfo(LOG_FILTER_WARDEN, ">> Loaded 0 Warden checks. DB table `warden_checks` is empty!"); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 Warden checks. DB table `warden_checks` is empty!"); return; } @@ -164,7 +164,7 @@ void WardenCheckMgr::LoadWardenOverrides() if (!result) { - sLog->outInfo(LOG_FILTER_WARDEN, ">> Loaded 0 Warden action overrides. DB table `warden_action` is empty!"); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 Warden action overrides. DB table `warden_action` is empty!"); return; } diff --git a/src/server/game/Weather/WeatherMgr.cpp b/src/server/game/Weather/WeatherMgr.cpp index da62122d7a3..fce078a0a14 100755 --- a/src/server/game/Weather/WeatherMgr.cpp +++ b/src/server/game/Weather/WeatherMgr.cpp @@ -93,7 +93,7 @@ void LoadWeatherData() if (!result) { - sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 weather definitions. DB table `game_weather` is empty."); + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 weather definitions. DB table `game_weather` is empty."); return; } -- cgit v1.2.3 From f447403f6c570cdf3d8e0293d3dc53bd53d750bb Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 17 Aug 2012 00:10:19 +0200 Subject: Core/Spells: Implemented spell level scaling --- src/server/game/Combat/ThreatManager.cpp | 2 +- src/server/game/Entities/Unit/StatSystem.cpp | 2 +- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 2 +- src/server/game/Spells/SpellEffects.cpp | 12 +-- src/server/game/Spells/SpellInfo.cpp | 97 ++++++++++++++++------- src/server/game/Spells/SpellInfo.h | 3 + 6 files changed, 81 insertions(+), 37 deletions(-) (limited to 'src') diff --git a/src/server/game/Combat/ThreatManager.cpp b/src/server/game/Combat/ThreatManager.cpp index 87853a53b6c..ea2e8099aff 100755 --- a/src/server/game/Combat/ThreatManager.cpp +++ b/src/server/game/Combat/ThreatManager.cpp @@ -420,7 +420,7 @@ void ThreatManager::doAddThreat(Unit* victim, float threat) Unit* redirectTarget = victim->GetMisdirectionTarget(); if (redirectTarget) if (Aura* glyphAura = redirectTarget->GetAura(63326)) // Glyph of Vigilance - reducedThreadPercent += glyphAura->GetSpellInfo()->Effects[0].CalcValue(); + reducedThreadPercent += glyphAura->GetSpellInfo()->Effects[0].CalcValue(glyphAura->GetCaster()); float reducedThreat = threat * reducedThreadPercent / 100.0f; threat -= reducedThreat; diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index 48aebc7d17e..75e82235611 100755 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -997,7 +997,7 @@ bool Guardian::UpdateStats(Stats stat) if (aurEff) { SpellInfo const* spellInfo = aurEff->GetSpellInfo(); // Then get the SpellProto and add the dummy effect value - AddPctN(mod, spellInfo->Effects[EFFECT_1].CalcValue()); // Ravenous Dead edits the original scale + AddPctN(mod, spellInfo->Effects[EFFECT_1].CalcValue(owner)); // Ravenous Dead edits the original scale } // Glyph of the Ghoul aurEff = owner->GetAuraEffect(58686, 0); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index edfc55dec44..38afbc28417 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -1597,7 +1597,7 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const // Survival of the Fittest if (AuraEffect const* aurEff = target->GetAuraEffect(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE, SPELLFAMILY_DRUID, 961, 0)) { - int32 bp = aurEff->GetSpellInfo()->Effects[EFFECT_2].CalcValue(); + int32 bp = aurEff->GetSpellInfo()->Effects[EFFECT_2].CalcValue(GetCaster()); target->CastCustomSpell(target, 62069, &bp, NULL, NULL, true, 0, this); } break; diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 4751584b650..e2e758d8427 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -608,7 +608,7 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex) // TODO: should this be put on taken but not done? if (found) - damage += m_spellInfo->Effects[EFFECT_1].CalcValue(); + damage += m_spellInfo->Effects[EFFECT_1].CalcValue(m_caster); if (Player* caster = m_caster->ToPlayer()) { @@ -2566,7 +2566,7 @@ void Spell::EffectDispel(SpellEffIndex effIndex) // Devour Magic if (m_spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK && m_spellInfo->Category == SPELLCATEGORY_DEVOUR_MAGIC) { - int32 heal_amount = m_spellInfo->Effects[EFFECT_1].CalcValue(); + int32 heal_amount = m_spellInfo->Effects[EFFECT_1].CalcValue(m_caster); m_caster->CastCustomSpell(m_caster, 19658, &heal_amount, NULL, NULL, true); // Glyph of Felhunter if (Unit* owner = m_caster->GetOwner()) @@ -3324,7 +3324,7 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex) // Blood Strike if (m_spellInfo->SpellFamilyFlags[0] & 0x400000) { - float bonusPct = m_spellInfo->Effects[EFFECT_2].CalcValue() * unitTarget->GetDiseasesByCaster(m_caster->GetGUID()) / 2.0f; + float bonusPct = m_spellInfo->Effects[EFFECT_2].CalcValue(m_caster) * unitTarget->GetDiseasesByCaster(m_caster->GetGUID()) / 2.0f; // Death Knight T8 Melee 4P Bonus if (AuraEffect const* aurEff = m_caster->GetAuraEffect(64736, EFFECT_0)) AddPctF(bonusPct, aurEff->GetAmount()); @@ -3341,7 +3341,7 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex) { // Glyph of Death Strike if (AuraEffect const* aurEff = m_caster->GetAuraEffect(59336, EFFECT_0)) - if (uint32 runic = std::min(m_caster->GetPower(POWER_RUNIC_POWER), aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue())) + if (uint32 runic = std::min(m_caster->GetPower(POWER_RUNIC_POWER), aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue(m_caster))) AddPctN(totalDamagePercentMod, runic); break; } @@ -3355,7 +3355,7 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex) if (roll_chance_i(aurEff->GetAmount())) consumeDiseases = false; - float bonusPct = m_spellInfo->Effects[EFFECT_2].CalcValue() * unitTarget->GetDiseasesByCaster(m_caster->GetGUID(), consumeDiseases) / 2.0f; + float bonusPct = m_spellInfo->Effects[EFFECT_2].CalcValue(m_caster) * unitTarget->GetDiseasesByCaster(m_caster->GetGUID(), consumeDiseases) / 2.0f; // Death Knight T8 Melee 4P Bonus if (AuraEffect const* aurEff = m_caster->GetAuraEffect(64736, EFFECT_0)) AddPctF(bonusPct, aurEff->GetAmount()); @@ -3371,7 +3371,7 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex) // Heart Strike if (m_spellInfo->SpellFamilyFlags[0] & 0x1000000) { - float bonusPct = m_spellInfo->Effects[EFFECT_2].CalcValue() * unitTarget->GetDiseasesByCaster(m_caster->GetGUID()); + float bonusPct = m_spellInfo->Effects[EFFECT_2].CalcValue(m_caster) * unitTarget->GetDiseasesByCaster(m_caster->GetGUID()); // Death Knight T8 Melee 4P Bonus if (AuraEffect const* aurEff = m_caster->GetAuraEffect(64736, EFFECT_0)) AddPctF(bonusPct, aurEff->GetAmount()); diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 16409b94ffe..7eb1cab28d7 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -320,6 +320,7 @@ SpellImplicitTargetInfo::StaticData SpellImplicitTargetInfo::_data[TOTAL_SPELL_ SpellEffectInfo::SpellEffectInfo(SpellEntry const* spellEntry, SpellInfo const* spellInfo, uint8 effIndex) { SpellEffectEntry const* _effect = spellEntry->GetSpellEffect(effIndex); + SpellScalingEntry const* scaling = spellInfo->GetSpellScaling(); _spellInfo = spellInfo; _effIndex = effIndex; @@ -344,6 +345,9 @@ SpellEffectInfo::SpellEffectInfo(SpellEntry const* spellEntry, SpellInfo const* TriggerSpell = _effect ? _effect->EffectTriggerSpell : 0; SpellClassMask = _effect ? _effect->EffectSpellClassMask : flag96(0); ImplicitTargetConditions = NULL; + ScalingMultiplier = scaling ? scaling->Multiplier[effIndex] : 0.0f; + DeltaScalingMultiplier = scaling ? scaling->RandomMultiplier[effIndex] : 0.0f; + ComboScalingMultiplier = scaling ? scaling->OtherMultiplier[effIndex] : 0.0f; } bool SpellEffectInfo::IsEffect() const @@ -406,33 +410,58 @@ int32 SpellEffectInfo::CalcValue(Unit const* caster, int32 const* bp, Unit const { float basePointsPerLevel = RealPointsPerLevel; int32 basePoints = bp ? *bp : BasePoints; - int32 randomPoints = int32(DieSides); + float comboDamage = PointsPerComboPoint; + SpellScalingEntry const* scaling = _spellInfo->GetSpellScaling(); // base amount modification based on spell lvl vs caster lvl - if (caster) + if (scaling) { - int32 level = int32(caster->getLevel()); - if (level > int32(_spellInfo->MaxLevel) && _spellInfo->MaxLevel > 0) - level = int32(_spellInfo->MaxLevel); - else if (level < int32(_spellInfo->BaseLevel)) - level = int32(_spellInfo->BaseLevel); - level -= int32(_spellInfo->SpellLevel); - basePoints += int32(level * basePointsPerLevel); - } + if (caster) + { + if (GtSpellScalingEntry const* gtScaling = sGtSpellScalingStore.LookupEntry((scaling->playerClass != -1 ? caster->getClass() : 11) * 100 + caster->getLevel() - 1)) + { + float preciseBasePoints = ScalingMultiplier * gtScaling->value; + comboDamage = ComboScalingMultiplier * gtScaling->value; + if (DeltaScalingMultiplier) + { + float delta = DeltaScalingMultiplier * ScalingMultiplier * gtScaling->value * 0.5f; + preciseBasePoints += frand(-delta, delta); + } - // roll in a range <1;EffectDieSides> as of patch 3.3.3 - switch (randomPoints) + basePoints = int32(preciseBasePoints); + } + } + } + else { - case 0: break; - case 1: basePoints += 1; break; // range 1..1 - default: - // range can have positive (1..rand) and negative (rand..1) values, so order its for irand - int32 randvalue = (randomPoints >= 1) - ? irand(1, randomPoints) - : irand(randomPoints, 1); + if (caster) + { + int32 level = int32(caster->getLevel()); + if (level > int32(_spellInfo->MaxLevel) && _spellInfo->MaxLevel > 0) + level = int32(_spellInfo->MaxLevel); + else if (level < int32(_spellInfo->BaseLevel)) + level = int32(_spellInfo->BaseLevel); + level -= int32(_spellInfo->SpellLevel); + basePoints += int32(level * basePointsPerLevel); + } - basePoints += randvalue; - break; + // roll in a range <1;EffectDieSides> as of patch 3.3.3 + int32 randomPoints = int32(DieSides); + switch (randomPoints) + { + case 0: break; + case 1: basePoints += 1; break; // range 1..1 + default: + { + // range can have positive (1..rand) and negative (rand..1) values, so order its for irand + int32 randvalue = (randomPoints >= 1) + ? irand(1, randomPoints) + : irand(randomPoints, 1); + + basePoints += randvalue; + break; + } + } } float value = float(basePoints); @@ -441,15 +470,14 @@ int32 SpellEffectInfo::CalcValue(Unit const* caster, int32 const* bp, Unit const if (caster) { // bonus amount from combo points - if (caster->m_movedPlayer) + if (caster->m_movedPlayer && comboDamage) if (uint8 comboPoints = caster->m_movedPlayer->GetComboPoints()) - if (float comboDamage = PointsPerComboPoint) - value += comboDamage* comboPoints; + value += comboDamage * comboPoints; value = caster->ApplyEffectModifiers(_spellInfo, _effIndex, value); // amount multiplication based on caster's level - if (!basePointsPerLevel && (_spellInfo->Attributes & SPELL_ATTR0_LEVEL_DAMAGE_CALCULATION && _spellInfo->SpellLevel) && + if (!_spellInfo->GetSpellScaling() && !basePointsPerLevel && (_spellInfo->Attributes & SPELL_ATTR0_LEVEL_DAMAGE_CALCULATION && _spellInfo->SpellLevel) && Effect != SPELL_EFFECT_WEAPON_PERCENT_DAMAGE && Effect != SPELL_EFFECT_KNOCK_BACK && Effect != SPELL_EFFECT_ADD_EXTRA_ATTACKS && @@ -2044,11 +2072,24 @@ int32 SpellInfo::GetMaxDuration() const uint32 SpellInfo::CalcCastTime(Unit* caster, Spell* spell) const { + int32 castTime = 0; + // not all spells have cast time index and this is all is pasiive abilities - if (!CastTimeEntry) - return 0; + SpellScalingEntry const* scaling = GetSpellScaling(); + if (scaling && caster) + { + if (scaling->castTimeMax > 0) + { + castTime = scaling->castTimeMax; + if (scaling->castScalingMaxLevel > caster->getLevel()) + castTime = scaling->castTimeMin + (caster->getLevel() - 1) * (scaling->castTimeMax - scaling->castTimeMin) / (scaling->castScalingMaxLevel - 1); + } + } + else if (CastTimeEntry) + castTime = CastTimeEntry->CastTime; - int32 castTime = CastTimeEntry->CastTime; + if (!castTime) + return 0; if (caster) caster->ModSpellCastTime(this, castTime, spell); diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h index a338b8d627f..2fb0234997c 100644 --- a/src/server/game/Spells/SpellInfo.h +++ b/src/server/game/Spells/SpellInfo.h @@ -249,6 +249,9 @@ public: uint32 TriggerSpell; flag96 SpellClassMask; std::list* ImplicitTargetConditions; + float ScalingMultiplier; + float DeltaScalingMultiplier; + float ComboScalingMultiplier; SpellEffectInfo() {} SpellEffectInfo(SpellEntry const* spellEntry, SpellInfo const* spellInfo, uint8 effIndex); -- cgit v1.2.3 From 00e81cd98a2bd75fa0de58963c05c1c584225ca1 Mon Sep 17 00:00:00 2001 From: Greymane Date: Thu, 16 Aug 2012 16:18:22 -0300 Subject: Core/Player: Instead of not saving eclipse power, set it to 0 on player load (shauren's idea, blame him =D) Signed-off-by: Nay --- src/server/game/Entities/Player/Player.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 5fad57c3b0d..d0c0a887ddb 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -17157,6 +17157,8 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) for (; loadedPowers < MAX_STORED_POWERS; ++loadedPowers) SetUInt32Value(UNIT_FIELD_POWER1 + loadedPowers, 0); + SetPower(POWER_ECLIPSE, 0); + // must be after loading spells and talents Tokens talentTrees(fields[26].GetString(), ' ', MAX_TALENT_SPECS); for (uint8 i = 0; i < MAX_TALENT_SPECS; ++i) @@ -18657,12 +18659,7 @@ void Player::SaveToDB(bool create /*=false*/) { if (GetPowerIndexByClass(Powers(i), getClass()) != MAX_POWERS) { - // Eclipse Power isnt saved. - if (i == POWER_ECLIPSE) - continue; - stmt->setUInt32(index++, GetUInt32Value(UNIT_FIELD_POWER1 + storedPowers)); - if (++storedPowers >= MAX_STORED_POWERS) break; } @@ -18784,12 +18781,7 @@ void Player::SaveToDB(bool create /*=false*/) { if (GetPowerIndexByClass(Powers(i), getClass()) != MAX_POWERS) { - // Eclipse Power isnt saved. - if (i == POWER_ECLIPSE) - continue; - - stmt->setUInt32(index++, GetUInt32Value(UNIT_FIELD_POWER1 + storedPowers)); - + stmt->setUInt32(index++, GetUInt32Value(UNIT_FIELD_POWER1 + storedPowers)); if (++storedPowers >= MAX_STORED_POWERS) break; } -- cgit v1.2.3 From 1acb3b4f1d38a4b246c7b41c1d0f3df71033394b Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 17 Aug 2012 00:24:50 +0200 Subject: Core/Spells: Fixed a mistake in obtaining class for scaling, also fixed crash in feral damage calculations --- src/server/game/Entities/Unit/StatSystem.cpp | 14 +++++++++----- src/server/game/Spells/SpellInfo.cpp | 2 +- src/server/game/Tools/PlayerDump.cpp | 3 +++ 3 files changed, 13 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index 75e82235611..9021523db24 100755 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -416,7 +416,7 @@ void Player::CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bo float att_speed = GetAPMultiplier(attType, normalized); - float base_value = GetModifierValue(unitMod, BASE_VALUE) + GetTotalAttackPowerValue(attType)/ 14.0f * att_speed; + float base_value = GetModifierValue(unitMod, BASE_VALUE) + GetTotalAttackPowerValue(attType) / 14.0f * att_speed; float base_pct = GetModifierValue(unitMod, BASE_PCT); float total_value = GetModifierValue(unitMod, TOTAL_VALUE); float total_pct = addTotalPct ? GetModifierValue(unitMod, TOTAL_PCT) : 1.0f; @@ -426,15 +426,19 @@ void Player::CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bo if (IsInFeralForm()) //check if player is druid and in cat or bear forms { + float weaponSpeed = BASE_ATTACK_TIME / 1000.f; + if (Item* weapon = GetWeaponForAttack(BASE_ATTACK, true)) + weaponSpeed = weapon->GetTemplate()->Delay / 1000; + if (GetShapeshiftForm() == FORM_CAT) { - weapon_mindamage = weapon_mindamage / GetWeaponForAttack(BASE_ATTACK, true)->GetTemplate()->Delay / 1000; - weapon_maxdamage = weapon_maxdamage / GetWeaponForAttack(BASE_ATTACK, true)->GetTemplate()->Delay / 1000; + weapon_mindamage = weapon_mindamage / weaponSpeed; + weapon_maxdamage = weapon_maxdamage / weaponSpeed; } else if (GetShapeshiftForm() == FORM_BEAR) { - weapon_mindamage = weapon_mindamage / GetWeaponForAttack(BASE_ATTACK, true)->GetTemplate()->Delay / 1000 + weapon_mindamage / 2.5; - weapon_maxdamage = weapon_mindamage / GetWeaponForAttack(BASE_ATTACK, true)->GetTemplate()->Delay / 1000 + weapon_maxdamage / 2.5; + weapon_mindamage = weapon_mindamage / weaponSpeed + weapon_mindamage / 2.5; + weapon_maxdamage = weapon_mindamage / weaponSpeed + weapon_maxdamage / 2.5; } } else if (!CanUseAttackType(attType)) //check if player not in form but still can't use (disarm case) diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 7eb1cab28d7..165cc5cec42 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -418,7 +418,7 @@ int32 SpellEffectInfo::CalcValue(Unit const* caster, int32 const* bp, Unit const { if (caster) { - if (GtSpellScalingEntry const* gtScaling = sGtSpellScalingStore.LookupEntry((scaling->playerClass != -1 ? caster->getClass() : 11) * 100 + caster->getLevel() - 1)) + if (GtSpellScalingEntry const* gtScaling = sGtSpellScalingStore.LookupEntry((scaling->playerClass != -1 ? scaling->playerClass - 1 : 11) * 100 + caster->getLevel() - 1)) { float preciseBasePoints = ScalingMultiplier * gtScaling->value; comboDamage = ComboScalingMultiplier * gtScaling->value; diff --git a/src/server/game/Tools/PlayerDump.cpp b/src/server/game/Tools/PlayerDump.cpp index f6d0de28d28..2907292f5a6 100644 --- a/src/server/game/Tools/PlayerDump.cpp +++ b/src/server/game/Tools/PlayerDump.cpp @@ -320,7 +320,10 @@ bool PlayerDumpWriter::DumpTable(std::string& dump, uint32 guid, char const*tabl case DTT_CHARACTER: { if (result->GetFieldCount() <= 68) // avoid crashes on next check + { sLog->outFatal(LOG_FILTER_GENERAL, "PlayerDumpWriter::DumpTable - Trying to access non-existing or wrong positioned field (`deleteInfos_Account`) in `characters` table."); + return false; + } if (result->Fetch()[68].GetUInt32()) // characters.deleteInfos_Account - if filled error return false; -- cgit v1.2.3 From 9f989dbcdace35e0169e0eade3476f13bc3e1a57 Mon Sep 17 00:00:00 2001 From: Subv Date: Thu, 16 Aug 2012 20:09:15 -0500 Subject: Core/Spells: More cleanup of deprecated spells code --- src/server/game/Entities/Unit/Unit.cpp | 30 --- src/server/game/Spells/Auras/SpellAuras.cpp | 308 +--------------------------- 2 files changed, 7 insertions(+), 331 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 5a4cba9d58b..3735801e8cb 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -10469,12 +10469,6 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui if (victim->HealthBelowPct(50)) AddPctN(DoneTotalMod, (*i)->GetAmount()); break; - case 7798: // Glyph of Regrowth - { - if (victim->GetAuraEffect(SPELL_AURA_PERIODIC_HEAL, SPELLFAMILY_DRUID, 0x40, 0, 0)) - AddPctN(DoneTotalMod, (*i)->GetAmount()); - break; - } case 8477: // Nourish Heal Boost { int32 stepPercent = (*i)->GetAmount(); @@ -10494,12 +10488,6 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui AddPctN(DoneTotalMod, modPercent); break; } - case 7871: // Glyph of Lesser Healing Wave - { - if (victim->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, 0, 0x00000400, 0, GetGUID())) - AddPctN(DoneTotalMod, (*i)->GetAmount()); - break; - } default: break; } @@ -10551,23 +10539,9 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui coeff /= 100.0f; } - // Earthliving - 0.45% of normal hot coeff - if (spellProto->SpellFamilyName == SPELLFAMILY_SHAMAN && spellProto->SpellFamilyFlags[1] & 0x80000) - factorMod *= 0.45f; - DoneTotal += int32(DoneAdvertisedBenefit * coeff * factorMod); } - // Gift of the Naaru - if (spellProto->SpellFamilyFlags[2] & 0x80000000 && spellProto->SpellIconID == 329) - { - int32 apBonus = int32(std::max(GetTotalAttackPowerValue(BASE_ATTACK), GetTotalAttackPowerValue(RANGED_ATTACK))); - if (apBonus > DoneAdvertisedBenefit) - DoneTotal += int32(apBonus * 0.22f); // 22% of AP per tick - else - DoneTotal += int32(DoneAdvertisedBenefit * 0.377f); // 37.7% of BH per tick - } - for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { switch (spellProto->Effects[i].ApplyAuraName) @@ -10665,10 +10639,6 @@ uint32 Unit::SpellHealingBonusTaken(Unit* caster, SpellInfo const* spellProto, u coeff /= 100.0f; } - // Earthliving - 0.45% of normal hot coeff - if (spellProto->SpellFamilyName == SPELLFAMILY_SHAMAN && spellProto->SpellFamilyFlags[1] & 0x80000) - factorMod *= 0.45f; - TakenTotal += int32(TakenAdvertisedBenefit * coeff * factorMod); } diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 3409d135849..e8d1ddb8f03 100755 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -1154,20 +1154,8 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b case SPELLFAMILY_MAGE: if (!caster) break; - if (GetSpellInfo()->SpellFamilyFlags[0] & 0x00000001 && GetSpellInfo()->SpellFamilyFlags[2] & 0x00000008) - { - // Glyph of Fireball - if (caster->HasAura(56368)) - SetDuration(0); - } - else if (GetSpellInfo()->SpellFamilyFlags[0] & 0x00000020 && GetSpellInfo()->SpellVisual[0] == 13) - { - // Glyph of Frostbolt - if (caster->HasAura(56370)) - SetDuration(0); - } // Todo: This should be moved to similar function in spell::hit - else if (GetSpellInfo()->SpellFamilyFlags[0] & 0x01000000) + if (GetSpellInfo()->SpellFamilyFlags[0] & 0x01000000) { // Polymorph Sound - Sheep && Penguin if (GetSpellInfo()->SpellIconID == 82 && GetSpellInfo()->SpellVisual[0] == 12978) @@ -1199,18 +1187,6 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b caster->CastSpell(caster, spellId, true); } break; - case 44544: // Fingers of Frost - { - // See if we already have the indicator aura. If not, create one. - if (Aura* aur = target->GetAura(74396)) - { - // Aura already there. Refresh duration and set original charges - aur->SetCharges(2); - aur->RefreshDuration(); - } - else - target->AddAura(74396, target); - } default: break; } @@ -1222,7 +1198,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b if (GetSpellInfo()->SpellFamilyFlags[0] & 0x02000000 && GetEffect(0)) { // Improved Devouring Plague - if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_PRIEST, 3790, 1)) + if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_PRIEST, 3790, 0)) { uint32 damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), GetEffect(0)->GetAmount(), DOT); damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, DOT); @@ -1252,49 +1228,6 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b if (target->HasAura(58039)) // Glyph of Blurred Speed target->CastSpell(target, 61922, true); // Sprint (waterwalk) break; - case SPELLFAMILY_DEATHKNIGHT: - if (!caster) - break; - // Frost Fever and Blood Plague - if (GetSpellInfo()->SpellFamilyFlags[2] & 0x2) - { - // Can't proc on self - if (GetCasterGUID() == target->GetGUID()) - break; - - AuraEffect* aurEff = NULL; - // Ebon Plaguebringer / Crypt Fever - Unit::AuraEffectList const& TalentAuras = caster->GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS); - for (Unit::AuraEffectList::const_iterator itr = TalentAuras.begin(); itr != TalentAuras.end(); ++itr) - { - if ((*itr)->GetMiscValue() == 7282) - { - aurEff = *itr; - // Ebon Plaguebringer - end search if found - if ((*itr)->GetSpellInfo()->SpellIconID == 1766) - break; - } - } - if (aurEff) - { - uint32 spellId = 0; - switch (aurEff->GetId()) - { - // Ebon Plague - case 51161: spellId = 51735; break; - case 51160: spellId = 51734; break; - case 51099: spellId = 51726; break; - // Crypt Fever - case 49632: spellId = 50510; break; - case 49631: spellId = 50509; break; - case 49032: spellId = 50508; break; - default: - sLog->outError(LOG_FILTER_SPELLS_AURAS, "Aura::HandleAuraSpecificMods: Unknown rank of Crypt Fever/Ebon Plague (%d) found", aurEff->GetId()); - } - caster->CastSpell(target, spellId, true, 0, GetEffect(0)); - } - } - break; } } // mods at aura remove @@ -1333,18 +1266,6 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b target->CastSpell(target, 32612, true, NULL, GetEffect(1)); target->CombatStop(); break; - case 74396: // Fingers of Frost - // Remove the IGNORE_AURASTATE aura - target->RemoveAurasDueToSpell(44544); - break; - case 44401: //Missile Barrage - case 48108: //Hot Streak - case 57761: //Fireball! - if (removeMode != AURA_REMOVE_BY_EXPIRE || aurApp->GetBase()->IsExpired()) - break; - if (target->HasAura(70752)) //Item - Mage T10 2P Bonus - target->CastSpell(target, 70753, true); - break; default: break; } @@ -1354,34 +1275,11 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b if (removeMode == AURA_REMOVE_BY_ENEMY_SPELL && GetSpellInfo()->SpellFamilyFlags[1] & 0x1) { // Shattered Barrier - if (AuraEffect * dummy = caster->GetDummyAuraEffect(SPELLFAMILY_MAGE, 2945, 0)) + if (AuraEffect * dummy = caster->GetDummyAuraEffect(SPELLFAMILY_MAGE, 3260, 0)) if (roll_chance_i(dummy->GetSpellInfo()->ProcChance)) caster->CastSpell(target, 55080, true, NULL, GetEffect(0)); } break; - case SPELLFAMILY_WARRIOR: - if (!caster) - break; - // Spell Reflection - if (GetSpellInfo()->SpellFamilyFlags[1] & 0x2) - { - if (removeMode != AURA_REMOVE_BY_DEFAULT) - { - // Improved Spell Reflection - if (caster->GetDummyAuraEffect(SPELLFAMILY_WARRIOR, 1935, 1)) - { - // aura remove - remove auras from all party members - std::list PartyMembers; - target->GetPartyMembers(PartyMembers); - for (std::list::iterator itr = PartyMembers.begin(); itr != PartyMembers.end(); ++itr) - { - if ((*itr)!= target) - (*itr)->RemoveAurasWithFamily(SPELLFAMILY_WARRIOR, 0, 0x2, 0, GetCasterGUID()); - } - } - } - } - break; case SPELLFAMILY_WARLOCK: if (!caster) break; @@ -1406,18 +1304,8 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b case SPELLFAMILY_PRIEST: if (!caster) break; - // Shadow word: Pain // Vampiric Touch - if (removeMode == AURA_REMOVE_BY_ENEMY_SPELL && (GetSpellInfo()->SpellFamilyFlags[0] & 0x00008000 || GetSpellInfo()->SpellFamilyFlags[1] & 0x00000400)) - { - // Shadow Affinity - if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_PRIEST, 178, 1)) - { - int32 basepoints0 = aurEff->GetAmount() * caster->GetCreateMana() / 100; - caster->CastCustomSpell(caster, 64103, &basepoints0, NULL, NULL, true, NULL, GetEffect(0)); - } - } // Power word: shield - else if (removeMode == AURA_REMOVE_BY_ENEMY_SPELL && GetSpellInfo()->SpellFamilyFlags[0] & 0x00000001) + if (removeMode == AURA_REMOVE_BY_ENEMY_SPELL && GetSpellInfo()->SpellFamilyFlags[0] & 0x00000001) { // Rapture if (Aura const* aura = caster->GetAuraOfRankedSpell(47535)) @@ -1433,68 +1321,12 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b // effect on caster if (AuraEffect const* aurEff = aura->GetEffect(0)) { - float multiplier = (float)aurEff->GetAmount(); - if (aurEff->GetId() == 47535) - multiplier -= 0.5f; - else if (aurEff->GetId() == 47537) - multiplier += 0.5f; - + float multiplier = float(aurEff->GetAmount()); int32 basepoints0 = int32(CalculatePctF(caster->GetMaxPower(POWER_MANA), multiplier)); caster->CastCustomSpell(caster, 47755, &basepoints0, NULL, NULL, true); } - // effect on aura target - if (AuraEffect const* aurEff = aura->GetEffect(1)) - { - if (!roll_chance_i(aurEff->GetAmount())) - break; - - int32 triggeredSpellId = 0; - switch (target->getPowerType()) - { - case POWER_MANA: - { - int32 basepoints0 = int32(CalculatePctN(target->GetMaxPower(POWER_MANA), 2)); - caster->CastCustomSpell(target, 63654, &basepoints0, NULL, NULL, true); - break; - } - case POWER_RAGE: triggeredSpellId = 63653; break; - case POWER_ENERGY: triggeredSpellId = 63655; break; - case POWER_RUNIC_POWER: triggeredSpellId = 63652; break; - default: - break; - } - if (triggeredSpellId) - caster->CastSpell(target, triggeredSpellId, true); - } } } - switch (GetId()) - { - case 47788: // Guardian Spirit - if (removeMode != AURA_REMOVE_BY_EXPIRE) - break; - if (caster->GetTypeId() != TYPEID_PLAYER) - break; - - Player* player = caster->ToPlayer(); - // Glyph of Guardian Spirit - if (AuraEffect* aurEff = player->GetAuraEffect(63231, 0)) - { - if (!player->HasSpellCooldown(47788)) - break; - - player->RemoveSpellCooldown(GetSpellInfo()->Id, true); - player->AddSpellCooldown(GetSpellInfo()->Id, 0, uint32(time(NULL) + aurEff->GetAmount())); - - WorldPacket data(SMSG_SPELL_COOLDOWN, 8+1+4+4); - data << uint64(player->GetGUID()); - data << uint8(0x0); // flags (0x1, 0x2) - data << uint32(GetSpellInfo()->Id); - data << uint32(aurEff->GetAmount()*IN_MILLISECONDS); - player->SendDirectMessage(&data); - } - break; - } break; case SPELLFAMILY_ROGUE: // Remove Vanish on stealth remove @@ -1561,7 +1393,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b if (GetSpellInfo()->SpellFamilyFlags[0] & 0x00400000) { // Master of subtlety - if (AuraEffect const* aurEff = target->GetAuraEffectOfRankedSpell(31221, 0)) + if (AuraEffect const* aurEff = target->GetAuraEffect(31223, 0)) { if (!apply) target->CastSpell(target, 31666, true); @@ -1571,14 +1403,6 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b target->CastCustomSpell(target, 31665, &basepoints0, NULL, NULL, true); } } - // Overkill - if (target->HasAura(58426)) - { - if (!apply) - target->CastSpell(target, 58428, true); - else - target->CastSpell(target, 58427, true); - } break; } break; @@ -1604,15 +1428,6 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b case SPELLFAMILY_PALADIN: switch (GetId()) { - case 19746: - // Improved concentration aura - linked aura - if (caster->HasAura(20254) || caster->HasAura(20255) || caster->HasAura(20256)) - { - if (apply) - target->CastSpell(target, 63510, true); - else - target->RemoveAura(63510); - } case 31821: // Aura Mastery Triggered Spell Handler // If apply Concentration Aura -> trigger -> apply Aura Mastery Immunity @@ -1630,7 +1445,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b else target->RemoveAurasDueToSpell(64364, GetCasterGUID()); break; - case 31842: // Divine Illumination + case 31842: // Divine Favor // Item - Paladin T10 Holy 2P Bonus if (target->HasAura(70755)) { @@ -1641,115 +1456,6 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b } break; } - if (GetSpellInfo()->GetSpellSpecific() == SPELL_SPECIFIC_AURA) - { - // Improved devotion aura - if (caster->HasAura(20140) || caster->HasAura(20138) || caster->HasAura(20139)) - { - if (apply) - caster->CastSpell(target, 63514, true); - else - target->RemoveAura(63514); - } - // 63531 - linked aura for both Sanctified Retribution and Swift Retribution talents - // Not allow for Retribution Aura (prevent stacking) - if ((GetSpellInfo()->SpellIconID != 555) && (caster->HasAura(53648) || caster->HasAura(53484) || caster->HasAura(53379) || caster->HasAura(31869))) - { - if (apply) - caster->CastSpell(target, 63531, true); - else - target->RemoveAura(63531); - } - } - break; - case SPELLFAMILY_DEATHKNIGHT: - if (GetSpellInfo()->GetSpellSpecific() == SPELL_SPECIFIC_PRESENCE) - { - AuraEffect* bloodPresenceAura=0; // healing by damage done - AuraEffect* frostPresenceAura=0; // increased health - AuraEffect* unholyPresenceAura=0; // increased movement speed, faster rune recovery - - // Improved Presences - Unit::AuraEffectList const& vDummyAuras = target->GetAuraEffectsByType(SPELL_AURA_DUMMY); - for (Unit::AuraEffectList::const_iterator itr = vDummyAuras.begin(); itr != vDummyAuras.end(); ++itr) - { - switch ((*itr)->GetId()) - { - // Improved Blood Presence - case 50365: - case 50371: - { - bloodPresenceAura = (*itr); - break; - } - // Improved Frost Presence - case 50384: - case 50385: - { - frostPresenceAura = (*itr); - break; - } - // Improved Unholy Presence - case 50391: - case 50392: - { - unholyPresenceAura = (*itr); - break; - } - } - } - - uint32 presence = GetId(); - if (apply) - { - // Blood Presence bonus - if (presence == 48266) - target->CastSpell(target, 63611, true); - else if (bloodPresenceAura) - { - int32 basePoints1 = bloodPresenceAura->GetAmount(); - target->CastCustomSpell(target, 63611, NULL, &basePoints1, NULL, true, 0, bloodPresenceAura); - } - // Frost Presence bonus - if (presence == 48263) - target->CastSpell(target, 61261, true); - else if (frostPresenceAura) - { - int32 basePoints0 = frostPresenceAura->GetAmount(); - target->CastCustomSpell(target, 61261, &basePoints0, NULL, NULL, true, 0, frostPresenceAura); - } - // Unholy Presence bonus - if (presence == 48265) - { - if (unholyPresenceAura) - { - // Not listed as any effect, only base points set - int32 basePoints0 = unholyPresenceAura->GetSpellInfo()->Effects[EFFECT_1].CalcValue(); - target->CastCustomSpell(target, 63622, &basePoints0, &basePoints0, &basePoints0, true, 0, unholyPresenceAura); - } - target->CastSpell(target, 49772, true); - } - else if (unholyPresenceAura) - { - int32 basePoints0 = unholyPresenceAura->GetAmount(); - target->CastCustomSpell(target, 49772, &basePoints0, NULL, NULL, true, 0, unholyPresenceAura); - } - } - else - { - // Remove passive auras - if (presence == 48266 || bloodPresenceAura) - target->RemoveAurasDueToSpell(63611); - if (presence == 48263 || frostPresenceAura) - target->RemoveAurasDueToSpell(61261); - if (presence == 48265 || unholyPresenceAura) - { - if (presence == 48265 && unholyPresenceAura) - target->RemoveAurasDueToSpell(63622); - target->RemoveAurasDueToSpell(49772); - } - } - } break; case SPELLFAMILY_WARLOCK: // Drain Soul - If the target is at or below 25% health, Drain Soul causes four times the normal damage -- cgit v1.2.3 From 0499123f209c05e85af8f07402db03beb8cfd5c9 Mon Sep 17 00:00:00 2001 From: Subv Date: Thu, 16 Aug 2012 20:51:27 -0500 Subject: Core/Spells: Removed more deprecated spells code --- src/server/game/Entities/Unit/Unit.cpp | 410 ++------------------------------- 1 file changed, 23 insertions(+), 387 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 3735801e8cb..bffbfb665ef 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -7220,6 +7220,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere return true; } + bool Unit::HandleObsModEnergyAuraProc(Unit* victim, uint32 /*damage*/, AuraEffect* triggeredByAura, SpellInfo const* /*procSpell*/, uint32 /*procFlag*/, uint32 /*procEx*/, uint32 cooldown) { SpellInfo const* dummySpell = triggeredByAura->GetSpellInfo(); @@ -7233,22 +7234,12 @@ bool Unit::HandleObsModEnergyAuraProc(Unit* victim, uint32 /*damage*/, AuraEffec Unit* target = victim; int32 basepoints0 = 0; + /* switch (dummySpell->SpellFamilyName) { - case SPELLFAMILY_HUNTER: - { - // Aspect of the Viper - if (dummySpell->SpellFamilyFlags[1] & 0x40000) - { - uint32 maxmana = GetMaxPower(POWER_MANA); - basepoints0 = CalculatePctF(maxmana, GetAttackTime(RANGED_ATTACK) / 1000.0f); - target = this; - triggered_spell_id = 34075; - break; - } - break; - } + } + */ // processed charge only counting case if (!triggered_spell_id) return true; @@ -7286,23 +7277,13 @@ bool Unit::HandleModDamagePctTakenAuraProc(Unit* victim, uint32 /*damage*/, Aura Unit* target = victim; int32 basepoints0 = 0; + /* switch (dummySpell->SpellFamilyName) { - case SPELLFAMILY_PALADIN: - { - // Blessing of Sanctuary - if (dummySpell->SpellFamilyFlags[0] & 0x10000000) - { - switch (getPowerType()) - { - case POWER_MANA: triggered_spell_id = 57319; break; - default: - return false; - } - } - break; - } + } + */ + // processed charge only counting case if (!triggered_spell_id) return true; @@ -7389,30 +7370,8 @@ bool Unit::HandleAuraProc(Unit* victim, uint32 damage, Aura* triggeredByAura, Sp break; case SPELLFAMILY_PALADIN: { - // Infusion of Light - if (dummySpell->SpellIconID == 3021) - { - // Flash of Light HoT on Flash of Light when Sacred Shield active - if (procSpell->SpellFamilyFlags[0] & 0x40000000 && procSpell->SpellIconID == 242) - { - *handled = true; - if (victim && victim->HasAura(53601)) - { - int32 bp0 = CalculatePctN(int32(damage / 12), dummySpell->Effects[EFFECT_2].CalcValue()); - // Item - Paladin T9 Holy 4P Bonus - if (AuraEffect const* aurEff = GetAuraEffect(67191, 0)) - AddPctN(bp0, aurEff->GetAmount()); - CastCustomSpell(victim, 66922, &bp0, NULL, NULL, true); - return true; - } - } - // but should not proc on non-critical Holy Shocks - else if ((procSpell->SpellFamilyFlags[0] & 0x200000 || procSpell->SpellFamilyFlags[1] & 0x10000) && !(procEx & PROC_EX_CRITICAL_HIT)) - *handled = true; - break; - } // Judgements of the Just - else if (dummySpell->SpellIconID == 3015) + if (dummySpell->SpellIconID == 3015) { *handled = true; CastSpell(victim, 68055, true); @@ -7441,24 +7400,8 @@ bool Unit::HandleAuraProc(Unit* victim, uint32 damage, Aura* triggeredByAura, Sp } case SPELLFAMILY_MAGE: { - // Combustion switch (dummySpell->Id) { - case 11129: - { - *handled = true; - Unit* caster = triggeredByAura->GetCaster(); - if (!caster || !damage) - return false; - - // last charge and crit - if (triggeredByAura->GetCharges() <= 1 && (procEx & PROC_EX_CRITICAL_HIT)) - return true; // charge counting (will removed) - - CastSpell(this, 28682, true); - - return (procEx & PROC_EX_CRITICAL_HIT) ? true : false; - } // Empowered Fire case 31656: case 31657: @@ -7686,6 +7629,13 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg if (charge->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL)) RemoveAurasDueToSpell(50240); } + // Warrior - Vigilance, SPELLFAMILY_GENERIC + if (auraSpellInfo->Id == 50720) + { + target = triggeredByAura->GetCaster(); + if (!target) + return false; + } } break; case SPELLFAMILY_MAGE: @@ -7710,78 +7660,12 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg RemoveAuraFromStack(auraSpellInfo->Id); return false; } - if (auraSpellInfo->Id == 50720) - { - target = triggeredByAura->GetCaster(); - if (!target) - return false; - } - break; - case SPELLFAMILY_WARLOCK: - { - // Drain Soul - if (auraSpellInfo->SpellFamilyFlags[0] & 0x4000) - { - // Improved Drain Soul - Unit::AuraEffectList const& mAddFlatModifier = GetAuraEffectsByType(SPELL_AURA_DUMMY); - for (Unit::AuraEffectList::const_iterator i = mAddFlatModifier.begin(); i != mAddFlatModifier.end(); ++i) - { - if ((*i)->GetMiscValue() == SPELLMOD_CHANCE_OF_SUCCESS && (*i)->GetSpellInfo()->SpellIconID == 113) - { - int32 value2 = CalculateSpellDamage(this, (*i)->GetSpellInfo(), 2); - basepoints0 = int32(CalculatePctN(GetMaxPower(POWER_MANA), value2)); - // Drain Soul - CastCustomSpell(this, 18371, &basepoints0, NULL, NULL, true, castItem, triggeredByAura); - break; - } - } - // Not remove charge (aura removed on death in any cases) - // Need for correct work Drain Soul SPELL_AURA_CHANNEL_DEATH_ITEM aura - return false; - } - // Nether Protection - else if (auraSpellInfo->SpellIconID == 1985) - { - if (!procSpell) - return false; - switch (GetFirstSchoolInMask(procSpell->GetSchoolMask())) - { - case SPELL_SCHOOL_NORMAL: - return false; // ignore - case SPELL_SCHOOL_HOLY: trigger_spell_id = 54370; break; - case SPELL_SCHOOL_FIRE: trigger_spell_id = 54371; break; - case SPELL_SCHOOL_NATURE: trigger_spell_id = 54375; break; - case SPELL_SCHOOL_FROST: trigger_spell_id = 54372; break; - case SPELL_SCHOOL_SHADOW: trigger_spell_id = 54374; break; - case SPELL_SCHOOL_ARCANE: trigger_spell_id = 54373; break; - default: - return false; - } - } break; - } case SPELLFAMILY_PRIEST: { // Greater Heal Refund if (auraSpellInfo->Id == 37594) trigger_spell_id = 37595; - // Blessed Recovery - else if (auraSpellInfo->SpellIconID == 1875) - { - switch (auraSpellInfo->Id) - { - case 27811: trigger_spell_id = 27813; break; - case 27815: trigger_spell_id = 27817; break; - case 27816: trigger_spell_id = 27818; break; - default: - sLog->outError(LOG_FILTER_UNITS, "Unit::HandleProcTriggerSpell: Spell %u not handled in BR", auraSpellInfo->Id); - return false; - } - basepoints0 = CalculatePctN(int32(damage), triggerAmount) / 3; - target = this; - // Add remaining ticks to healing done - basepoints0 += GetRemainingPeriodicAmount(GetGUID(), trigger_spell_id, SPELL_AURA_PERIODIC_HEAL); - } break; } case SPELLFAMILY_DRUID: @@ -7927,42 +7811,6 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg break; } default: - // Illumination - if (auraSpellInfo->SpellIconID == 241) - { - if (!procSpell) - return false; - // procspell is triggered spell but we need mana cost of original casted spell - uint32 originalSpellId = procSpell->Id; - // Holy Shock heal - if (procSpell->SpellFamilyFlags[1] & 0x00010000) - { - switch (procSpell->Id) - { - case 25914: originalSpellId = 20473; break; - case 25913: originalSpellId = 20929; break; - case 25903: originalSpellId = 20930; break; - case 27175: originalSpellId = 27174; break; - case 33074: originalSpellId = 33072; break; - case 48820: originalSpellId = 48824; break; - case 48821: originalSpellId = 48825; break; - default: - sLog->outError(LOG_FILTER_UNITS, "Unit::HandleProcTriggerSpell: Spell %u not handled in HShock", procSpell->Id); - return false; - } - } - SpellInfo const* originalSpell = sSpellMgr->GetSpellInfo(originalSpellId); - if (!originalSpell) - { - sLog->outError(LOG_FILTER_UNITS, "Unit::HandleProcTriggerSpell: Spell %u unknown but selected as original in Illu", originalSpellId); - return false; - } - // percent stored in effect 1 (class scripts) base points - int32 cost = int32(originalSpell->ManaCost + CalculatePctU(GetCreateMana(), originalSpell->ManaCostPercentage)); - basepoints0 = CalculatePctN(cost, auraSpellInfo->Effects[1].CalcValue()); - trigger_spell_id = 20272; - target = this; - } break; } break; @@ -7997,75 +7845,24 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg case 30881: // Nature's Guardian Rank 1 case 30883: // Nature's Guardian Rank 2 case 30884: // Nature's Guardian Rank 3 - case 30885: // Nature's Guardian Rank 4 - case 30886: // Nature's Guardian Rank 5 { - if (HealthBelowPct(30)) + if (!HealthBelowPctDamaged(30, damage)) { - basepoints0 = int32(auraSpellInfo->Effects[EFFECT_0].CalcValue() * GetMaxHealth() / 100.0f); + basepoints0 = int32(CountPctFromMaxHealth(triggerAmount)); target = this; trigger_spell_id = 31616; - // TODO: Threat part + if (victim && victim->isAlive()) + victim->getThreatManager().modifyThreatPercent(this, -10); } else return false; break; } - default: - { - // Lightning Shield (overwrite non existing triggered spell call in spell.dbc - if (auraSpellInfo->SpellFamilyFlags[0] & 0x400) - { - trigger_spell_id = sSpellMgr->GetSpellWithRank(26364, auraSpellInfo->GetRank()); - } - // Nature's Guardian - else if (auraSpellInfo->SpellIconID == 2013) - { - // Check health condition - should drop to less 30% (damage deal after this!) - if (!HealthBelowPctDamaged(30, damage)) - return false; - - if (victim && victim->isAlive()) - victim->getThreatManager().modifyThreatPercent(this, -10); - - basepoints0 = int32(CountPctFromMaxHealth(triggerAmount)); - trigger_spell_id = 31616; - target = this; - } - } } break; } case SPELLFAMILY_DEATHKNIGHT: { - // Acclimation - if (auraSpellInfo->SpellIconID == 1930) - { - if (!procSpell) - return false; - switch (GetFirstSchoolInMask(procSpell->GetSchoolMask())) - { - case SPELL_SCHOOL_NORMAL: - return false; // ignore - case SPELL_SCHOOL_HOLY: trigger_spell_id = 50490; break; - case SPELL_SCHOOL_FIRE: trigger_spell_id = 50362; break; - case SPELL_SCHOOL_NATURE: trigger_spell_id = 50488; break; - case SPELL_SCHOOL_FROST: trigger_spell_id = 50485; break; - case SPELL_SCHOOL_SHADOW: trigger_spell_id = 50489; break; - case SPELL_SCHOOL_ARCANE: trigger_spell_id = 50486; break; - default: - return false; - } - } - // Blood Presence (Improved) - else if (auraSpellInfo->Id == 63611) - { - if (GetTypeId() != TYPEID_PLAYER) - return false; - - trigger_spell_id = 50475; - basepoints0 = CalculatePctN(int32(damage), triggerAmount); - } // Item - Death Knight T10 Melee 4P Bonus else if (auraSpellInfo->Id == 70656) { @@ -8166,7 +7963,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg // Deflection case 52420: { - if (!HealthBelowPct(35)) + if (!HealthBelowPctDamaged(35, damage)) return false; break; } @@ -8179,16 +7976,6 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg return false; break; } - // Deadly Swiftness (Rank 1) - case 31255: - { - // whenever you deal damage to a target who is below 20% health. - if (!victim || !victim->isAlive() || victim->HealthAbovePct(20)) - return false; - - target = this; - trigger_spell_id = 22588; - } // Greater Heal Refund (Avatar Raiment set) case 37594: { @@ -8223,24 +8010,14 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg // Decimation case 63156: case 63158: - // Can proc only if target has hp below 35% - if (!victim || !victim->HasAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, procSpell, this)) + // Can proc only if target has hp below 25% + if (!victim || !victim->HealthBelowPct(auraSpellInfo->Effects[EFFECT_1].CalcValue())) return false; break; // Deathbringer Saurfang - Blood Beast's Blood Link case 72176: basepoints0 = 3; break; - case 15337: // Improved Spirit Tap (Rank 1) - case 15338: // Improved Spirit Tap (Rank 2) - { - if (procSpell->SpellFamilyFlags[0] & 0x800000) - if ((procSpell->Id != 58381) || !roll_chance_i(50)) - return false; - - target = victim; - break; - } // Professor Putricide - Ooze Spell Tank Protection case 71770: if (victim) @@ -8261,52 +8038,11 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg break; } - // Blade Barrier - if (auraSpellInfo->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT && auraSpellInfo->SpellIconID == 85 && procSpell) - { - Player* player = ToPlayer(); - if (!player || player->getClass() != CLASS_DEATH_KNIGHT) - return false; - - if (!player->IsBaseRuneSlotsOnCooldown(RUNE_BLOOD)) - return false; - } - - // Rime - else if (auraSpellInfo->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT && auraSpellInfo->SpellIconID == 56) - { - if (GetTypeId() != TYPEID_PLAYER) - return false; - - // Howling Blast - ToPlayer()->RemoveSpellCategoryCooldown(1248, true); - } - // Custom basepoints/target for exist spell // dummy basepoints or other customs switch (trigger_spell_id) { // Auras which should proc on area aura source (caster in this case): - // Turn the Tables - case 52914: - case 52915: - case 52910: - // Honor Among Thieves - case 52916: - { - target = triggeredByAura->GetBase()->GetCaster(); - if (!target) - return false; - - if (cooldown && target->GetTypeId() == TYPEID_PLAYER && target->ToPlayer()->HasSpellCooldown(trigger_spell_id)) - return false; - - target->CastSpell(target, trigger_spell_id, true, castItem, triggeredByAura); - - if (cooldown && GetTypeId() == TYPEID_PLAYER) - ToPlayer()->AddSpellCooldown(trigger_spell_id, 0, time(NULL) + cooldown); - return true; - } // Cast positive spell on enemy target case 7099: // Curse of Mending case 39703: // Curse of Mending @@ -8316,14 +8052,6 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg target = victim; break; } - // Combo points add triggers (need add combopoint only for main target, and after possible combopoints reset) - case 15250: // Rogue Setup - { - // applied only for main target - if (!victim || (GetTypeId() == TYPEID_PLAYER && victim != ToPlayer()->GetSelectedUnit())) - return false; - break; // continue normal case - } // Finish movies that add combo case 14189: // Seal Fate (Netherblade set) case 14157: // Ruthlessness @@ -8340,12 +8068,6 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg CastSpell(this, 70721, true); break; } - // Shamanistic Rage triggered spell - case 30824: - { - basepoints0 = int32(CalculatePctN(GetTotalAttackPowerValue(BASE_ATTACK), triggerAmount)); - break; - } // Enlightenment (trigger only from mana cost spells) case 35095: { @@ -8353,22 +8075,6 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg return false; break; } - // Demonic Pact - case 48090: - { - // Get talent aura from owner - if (isPet()) - if (Unit* owner = GetOwner()) - { - if (AuraEffect* aurEff = owner->GetDummyAuraEffect(SPELLFAMILY_WARLOCK, 3220, 0)) - { - basepoints0 = int32((aurEff->GetAmount() * owner->SpellBaseDamageBonusDone(SpellSchoolMask(SPELL_SCHOOL_MASK_MAGIC)) + 100.0f) / 100.0f); // TODO: Is it right? - CastCustomSpell(this, trigger_spell_id, &basepoints0, &basepoints0, NULL, true, castItem, triggeredByAura); - return true; - } - } - break; - } case 46916: // Slam! (Bloodsurge proc) case 52437: // Sudden Death { @@ -8407,35 +8113,6 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg CastSpell(this, 70831, true, castItem, triggeredByAura); break; } - // Astral Shift - case 52179: - { - if (procSpell == 0 || !(procEx & (PROC_EX_NORMAL_HIT|PROC_EX_CRITICAL_HIT)) || this == victim) - return false; - - // Need stun, fear or silence mechanic - if (!(procSpell->GetAllEffectsMechanicMask() & ((1<GetAllEffectsMechanicMask() & ((1<SchoolMask & SPELL_SCHOOL_MASK_FROST) || !roll_chance_i(triggerAmount)) - return false; - break; - } // Glyph of Death's Embrace case 58679: { @@ -8544,27 +8221,6 @@ bool Unit::HandleOverrideClassScriptAuraProc(Unit* victim, uint32 /*damage*/, Au switch (scriptId) { - case 836: // Improved Blizzard (Rank 1) - { - if (!procSpell || procSpell->SpellVisual[0] != 9487) - return false; - triggered_spell_id = 12484; - break; - } - case 988: // Improved Blizzard (Rank 2) - { - if (!procSpell || procSpell->SpellVisual[0] != 9487) - return false; - triggered_spell_id = 12485; - break; - } - case 989: // Improved Blizzard (Rank 3) - { - if (!procSpell || procSpell->SpellVisual[0] != 9487) - return false; - triggered_spell_id = 12486; - break; - } case 4533: // Dreamwalker Raiment 2 pieces bonus { // Chance 50% @@ -8584,26 +8240,6 @@ bool Unit::HandleOverrideClassScriptAuraProc(Unit* victim, uint32 /*damage*/, Au case 4537: // Dreamwalker Raiment 6 pieces bonus triggered_spell_id = 28750; // Blessing of the Claw break; - case 5497: // Improved Mana Gems - triggered_spell_id = 37445; // Mana Surge - break; - case 7010: // Revitalize - can proc on full hp target - case 7011: - case 7012: - { - if (!roll_chance_i(triggeredByAura->GetAmount())) - return false; - switch (victim->getPowerType()) - { - case POWER_MANA: triggered_spell_id = 48542; break; - case POWER_RAGE: triggered_spell_id = 48541; break; - case POWER_ENERGY: triggered_spell_id = 48540; break; - case POWER_RUNIC_POWER: triggered_spell_id = 48543; break; - default: - break; - } - break; - } default: break; } -- cgit v1.2.3 From 8da0bbdbb3d841c4f2d22839b4dd819ee201e4d5 Mon Sep 17 00:00:00 2001 From: Spp Date: Fri, 17 Aug 2012 10:25:29 +0200 Subject: Core: Fix compile (Thanks to Sovak for reporting). Remove many warnings and Fix possible out of bounds access to Void storage --- src/server/game/Achievements/AchievementMgr.cpp | 20 +++++++++++++++ src/server/game/Achievements/AchievementMgr.h | 2 ++ src/server/game/Chat/Chat.cpp | 2 +- src/server/game/Entities/Player/Player.cpp | 30 +++++++++++----------- src/server/game/Entities/Unit/Unit.cpp | 18 +++++++------ src/server/game/Globals/ObjectMgr.cpp | 6 ++--- src/server/game/Guilds/Guild.cpp | 4 +-- src/server/game/Handlers/ChatHandler.cpp | 2 ++ src/server/game/Handlers/MailHandler.cpp | 4 +-- src/server/game/Handlers/SkillHandler.cpp | 2 +- src/server/game/Handlers/TradeHandler.cpp | 4 +-- src/server/game/Handlers/VoidStorageHandler.cpp | 8 +++--- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 4 +-- src/server/game/Spells/Spell.cpp | 2 +- src/server/game/World/World.cpp | 4 +-- .../scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp | 2 +- .../IcecrownCitadel/boss_deathbringer_saurfang.cpp | 8 +++--- 17 files changed, 74 insertions(+), 48 deletions(-) (limited to 'src') diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 14895ae3165..2118b4cf42c 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -1825,6 +1825,26 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUESTS_GUILD: case ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILLS_GUILD: case ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE_TYPE_GUILD: + case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ARCHAEOLOGY_PROJECTS: + case ACHIEVEMENT_CRITERIA_TYPE_UNK118: + case ACHIEVEMENT_CRITERIA_TYPE_UNK120: + case ACHIEVEMENT_CRITERIA_TYPE_UNK121: + case ACHIEVEMENT_CRITERIA_TYPE_UNK122: + case ACHIEVEMENT_CRITERIA_TYPE_UNK123: + case ACHIEVEMENT_CRITERIA_TYPE_UNK137: + case ACHIEVEMENT_CRITERIA_TYPE_UNK138: + case ACHIEVEMENT_CRITERIA_TYPE_UNK139: + case ACHIEVEMENT_CRITERIA_TYPE_UNK140: + case ACHIEVEMENT_CRITERIA_TYPE_UNK141: + case ACHIEVEMENT_CRITERIA_TYPE_UNK142: + case ACHIEVEMENT_CRITERIA_TYPE_UNK143: + case ACHIEVEMENT_CRITERIA_TYPE_UNK144: + case ACHIEVEMENT_CRITERIA_TYPE_UNK145: + case ACHIEVEMENT_CRITERIA_TYPE_UNK146: + case ACHIEVEMENT_CRITERIA_TYPE_UNK147: + case ACHIEVEMENT_CRITERIA_TYPE_UNK148: + case ACHIEVEMENT_CRITERIA_TYPE_UNK149: + case ACHIEVEMENT_CRITERIA_TYPE_UNK150: break; // Not implemented yet :( } diff --git a/src/server/game/Achievements/AchievementMgr.h b/src/server/game/Achievements/AchievementMgr.h index 1a1cc217c28..bcedbd09901 100755 --- a/src/server/game/Achievements/AchievementMgr.h +++ b/src/server/game/Achievements/AchievementMgr.h @@ -333,6 +333,8 @@ class AchievementGlobalMgr case ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2: // NYI case ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_BATTLEGROUND: // NYI return true; + default: + break; } return false; diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index b8d4234b2a0..c4ea71f7c4e 100755 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -699,7 +699,7 @@ void ChatHandler::FillMessageData(WorldPacket* data, WorldSession* session, uint *data << channelName; *data << uint64(target_guid); } - else if (type == CHAT_MSG_ADDON) + else if (type == uint8(CHAT_MSG_ADDON)) { ASSERT(addonPrefix); *data << addonPrefix; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index d0c0a887ddb..1db057ce4a8 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -1867,7 +1867,7 @@ bool Player::BuildEnumData(PreparedQueryResult result, ByteBuffer* dataBuffer, B float y = fields[11].GetFloat(); float z = fields[12].GetFloat(); uint32 guildId = fields[13].GetUInt32(); - ObjectGuid guildGuid = MAKE_NEW_GUID(guildId, 0, guildId ? HIGHGUID_GUILD : 0); + ObjectGuid guildGuid = MAKE_NEW_GUID(guildId, 0, guildId ? uint32(HIGHGUID_GUILD) : 0); uint32 playerFlags = fields[14].GetUInt32(); uint32 atLoginFlags = fields[15].GetUInt16(); Tokens equipment(fields[19].GetString(), ' '); @@ -7394,7 +7394,7 @@ void Player::ModifyCurrency(uint32 id, int32 count, bool printLog/* = true*/) // if we change total, we must change week ASSERT(((newTotalCount-oldTotalCount) != 0) == ((newWeekCount-oldWeekCount) != 0)); - if (newTotalCount != oldTotalCount) + if (uint32(newTotalCount) != oldTotalCount) { if (itr->second.state != PLAYERCURRENCY_NEW) itr->second.state = PLAYERCURRENCY_CHANGED; @@ -17584,25 +17584,25 @@ void Player::_LoadVoidStorage(PreparedQueryResult result) if (!itemId) { - sLog->outError(LOG_FILTER_GENERAL, "Player::_LoadVoidStorage - Player (GUID: %u, name: %s) has an item with an invalid id (item id: %u, entry: %u).", GetGUIDLow(), GetName(), itemId, itemEntry); + sLog->outError(LOG_FILTER_PLAYER, "Player::_LoadVoidStorage - Player (GUID: %u, name: %s) has an item with an invalid id (item id: " UI64FMTD ", entry: %u).", GetGUIDLow(), GetName(), itemId, itemEntry); continue; } if (!sObjectMgr->GetItemTemplate(itemEntry)) { - sLog->outError(LOG_FILTER_GENERAL, "Player::_LoadVoidStorage - Player (GUID: %u, name: %s) has an item with an invalid entry (item id: %u, entry: %u).", GetGUIDLow(), GetName(), itemId, itemEntry); + sLog->outError(LOG_FILTER_PLAYER, "Player::_LoadVoidStorage - Player (GUID: %u, name: %s) has an item with an invalid entry (item id: " UI64FMTD ", entry: %u).", GetGUIDLow(), GetName(), itemId, itemEntry); continue; } - if (slot < 0 || slot > VOID_STORAGE_MAX_SLOT) + if (slot >= VOID_STORAGE_MAX_SLOT) { - sLog->outError(LOG_FILTER_GENERAL, "Player::_LoadVoidStorage - Player (GUID: %u, name: %s) has an item with an invalid slot (item id: %u, entry: %u, slot: %u).", GetGUIDLow(), GetName(), itemId, itemEntry, slot); + sLog->outError(LOG_FILTER_PLAYER, "Player::_LoadVoidStorage - Player (GUID: %u, name: %s) has an item with an invalid slot (item id: " UI64FMTD ", entry: %u, slot: %u).", GetGUIDLow(), GetName(), itemId, itemEntry, slot); continue; } if (!sObjectMgr->GetPlayerByLowGUID(creatorGuid)) { - sLog->outError(LOG_FILTER_GENERAL, "Player::_LoadVoidStorage - Player (GUID: %u, name: %s) has an item with an invalid creator guid, set to 0 (item id: %u, entry: %u, creatorGuid: %u).", GetGUIDLow(), GetName(), itemId, itemEntry, creatorGuid); + sLog->outError(LOG_FILTER_PLAYER, "Player::_LoadVoidStorage - Player (GUID: %u, name: %s) has an item with an invalid creator guid, set to 0 (item id: " UI64FMTD ", entry: %u, creatorGuid: %u).", GetGUIDLow(), GetName(), itemId, itemEntry, creatorGuid); creatorGuid = 0; } @@ -25710,7 +25710,7 @@ uint8 Player::GetNextVoidStorageFreeSlot() const if (!_voidStorageItems[i]) // unused item return i; - return -1; + return VOID_STORAGE_MAX_SLOT; } uint8 Player::GetNumOfVoidStorageFreeSlots() const @@ -25726,9 +25726,9 @@ uint8 Player::GetNumOfVoidStorageFreeSlots() const uint8 Player::AddVoidStorageItem(const VoidStorageItem& item) { - uint8 slot = GetNextVoidStorageFreeSlot(); + int8 slot = GetNextVoidStorageFreeSlot(); - if (slot < 0 || slot > VOID_STORAGE_MAX_SLOT) + if (slot >= VOID_STORAGE_MAX_SLOT) { GetSession()->SendVoidStorageTransferResult(VOID_TRANSFER_ERROR_FULL); return -1; @@ -25741,7 +25741,7 @@ uint8 Player::AddVoidStorageItem(const VoidStorageItem& item) void Player::AddVoidStorageItemAtSlot(uint8 slot, const VoidStorageItem& item) { - if (slot < 0 || slot > VOID_STORAGE_MAX_SLOT) + if (slot >= VOID_STORAGE_MAX_SLOT) { GetSession()->SendVoidStorageTransferResult(VOID_TRANSFER_ERROR_FULL); return; @@ -25749,7 +25749,7 @@ void Player::AddVoidStorageItemAtSlot(uint8 slot, const VoidStorageItem& item) if (_voidStorageItems[slot]) { - sLog->outError(LOG_FILTER_GENERAL, "Player::AddVoidStorageItemAtSlot - Player (GUID: %u, name: %s) tried to add an item to an used slot (item id: %u, entry: %u, slot: %u).", GetGUIDLow(), GetName(), _voidStorageItems[slot]->ItemId, _voidStorageItems[slot]->ItemEntry, slot); + sLog->outError(LOG_FILTER_GENERAL, "Player::AddVoidStorageItemAtSlot - Player (GUID: %u, name: %s) tried to add an item to an used slot (item id: " UI64FMTD ", entry: %u, slot: %u).", GetGUIDLow(), GetName(), _voidStorageItems[slot]->ItemId, _voidStorageItems[slot]->ItemEntry, slot); GetSession()->SendVoidStorageTransferResult(VOID_TRANSFER_ERROR_INTERNAL_ERROR_1); return; } @@ -25760,7 +25760,7 @@ void Player::AddVoidStorageItemAtSlot(uint8 slot, const VoidStorageItem& item) void Player::DeleteVoidStorageItem(uint8 slot) { - if (slot < 0 || slot > VOID_STORAGE_MAX_SLOT) + if (slot >= VOID_STORAGE_MAX_SLOT) { GetSession()->SendVoidStorageTransferResult(VOID_TRANSFER_ERROR_INTERNAL_ERROR_1); return; @@ -25772,7 +25772,7 @@ void Player::DeleteVoidStorageItem(uint8 slot) bool Player::SwapVoidStorageItem(uint8 oldSlot, uint8 newSlot) { - if (oldSlot < 0 || oldSlot > VOID_STORAGE_MAX_SLOT || newSlot < 0 || newSlot > VOID_STORAGE_MAX_SLOT || oldSlot == newSlot) + if (oldSlot >= VOID_STORAGE_MAX_SLOT || newSlot >= VOID_STORAGE_MAX_SLOT || oldSlot == newSlot) return false; std::swap(_voidStorageItems[newSlot], _voidStorageItems[oldSlot]); @@ -25781,7 +25781,7 @@ bool Player::SwapVoidStorageItem(uint8 oldSlot, uint8 newSlot) VoidStorageItem* Player::GetVoidStorageItem(uint8 slot) const { - if (slot < 0 || slot > VOID_STORAGE_MAX_SLOT) + if (slot >= VOID_STORAGE_MAX_SLOT) { GetSession()->SendVoidStorageTransferResult(VOID_TRANSFER_ERROR_INTERNAL_ERROR_1); return NULL; diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index bffbfb665ef..beb02ede95c 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -599,6 +599,8 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam case BASE_ATTACK: RewardRage(rage, true); break; + default: + break; } } @@ -2142,7 +2144,7 @@ void Unit::SendMeleeAttackStop(Unit* victim) sLog->outInfo(LOG_FILTER_UNITS, "%s %u stopped attacking", (GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"), GetGUIDLow()); } -bool Unit::isSpellBlocked(Unit* victim, SpellInfo const* spellProto, WeaponAttackType attackType) +bool Unit::isSpellBlocked(Unit* victim, SpellInfo const* spellProto, WeaponAttackType /*attackType*/) { // These spells can't be blocked if (spellProto && spellProto->Attributes & SPELL_ATTR0_IMPOSSIBLE_DODGE_PARRY_BLOCK) @@ -4978,7 +4980,7 @@ bool Unit::HandleSpellCritChanceAuraProc(Unit* victim, uint32 /*damage*/, AuraEf return true; } -bool Unit::HandleAuraProcOnPowerAmount(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown) +bool Unit::HandleAuraProcOnPowerAmount(Unit* victim, uint32 /*damage*/, AuraEffect* triggeredByAura, SpellInfo const *procSpell, uint32 procFlag, uint32 /*procEx*/, uint32 cooldown) { // Get triggered aura spell info SpellInfo const* auraSpellInfo = triggeredByAura->GetSpellInfo(); @@ -5025,7 +5027,7 @@ bool Unit::HandleAuraProcOnPowerAmount(Unit* victim, uint32 damage, AuraEffect* if (m_extraAttacks && triggerEntry->HasEffect(SPELL_EFFECT_ADD_EXTRA_ATTACKS)) return false; - if (powerRequired == NULL || powerAmountRequired == NULL) + if (!powerRequired || !powerAmountRequired) { sLog->outError(LOG_FILTER_SPELLS_AURAS, "Unit::HandleAuraProcOnPowerAmount: Spell %u have 0 powerAmountRequired in EffectAmount[%d] or 0 powerRequired in EffectMiscValue, not handled custom case?", auraSpellInfo->Id, triggeredByAura->GetEffIndex()); return false; @@ -7028,7 +7030,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere if (dummySpell->SpellIconID == 3059) { // Lightning Shield - if (AuraEffect const* aurEff = GetAuraEffect(SPELL_AURA_PROC_TRIGGER_SPELL, SPELLFAMILY_SHAMAN, 0x400, 0, 0)) + if (GetAuraEffect(SPELL_AURA_PROC_TRIGGER_SPELL, SPELLFAMILY_SHAMAN, 0x400, 0, 0)) { uint32 spell = 26364; @@ -7312,7 +7314,7 @@ bool Unit::HandleModDamagePctTakenAuraProc(Unit* victim, uint32 /*damage*/, Aura // Used in case when access to whole aura is needed // All procs should be handled like this... -bool Unit::HandleAuraProc(Unit* victim, uint32 damage, Aura* triggeredByAura, SpellInfo const* procSpell, uint32 /*procFlag*/, uint32 procEx, uint32 cooldown, bool * handled) +bool Unit::HandleAuraProc(Unit* victim, uint32 /*damage*/, Aura* triggeredByAura, SpellInfo const* procSpell, uint32 /*procFlag*/, uint32 /*procEx*/, uint32 cooldown, bool * handled) { SpellInfo const* dummySpell = triggeredByAura->GetSpellInfo(); @@ -7864,7 +7866,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg case SPELLFAMILY_DEATHKNIGHT: { // Item - Death Knight T10 Melee 4P Bonus - else if (auraSpellInfo->Id == 70656) + if (auraSpellInfo->Id == 70656) { if (GetTypeId() != TYPEID_PLAYER || getClass() != CLASS_DEATH_KNIGHT) return false; @@ -8207,7 +8209,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg return true; } -bool Unit::HandleOverrideClassScriptAuraProc(Unit* victim, uint32 /*damage*/, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 cooldown) +bool Unit::HandleOverrideClassScriptAuraProc(Unit* victim, uint32 /*damage*/, AuraEffect* triggeredByAura, SpellInfo const* /*procSpell*/, uint32 cooldown) { int32 scriptId = triggeredByAura->GetMiscValue(); @@ -10047,7 +10049,7 @@ uint32 Unit::SpellCriticalDamageBonus(SpellInfo const* spellProto, uint32 damage return crit_bonus; } -uint32 Unit::SpellCriticalHealingBonus(SpellInfo const* spellProto, uint32 damage, Unit* victim) +uint32 Unit::SpellCriticalHealingBonus(SpellInfo const* /*spellProto*/, uint32 damage, Unit* victim) { // Calculate critical bonus int32 crit_bonus = damage; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index f8c139ddfed..a8319ee274f 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -231,9 +231,9 @@ bool SpellClickInfo::IsFitToRequirements(Unit const* clicker, Unit const* clicke } ObjectMgr::ObjectMgr(): _auctionId(1), _equipmentSetGuid(1), - _itemTextId(1), _mailId(1), _hiPetNumber(1), _hiCharGuid(1), + _itemTextId(1), _mailId(1), _hiPetNumber(1), _voidItemId(1), _hiCharGuid(1), _hiCreatureGuid(1), _hiPetGuid(1), _hiVehicleGuid(1), _hiItemGuid(1), - _hiGoGuid(1), _hiDoGuid(1), _hiCorpseGuid(1), _hiMoTransGuid(1), _voidItemId(1) + _hiGoGuid(1), _hiDoGuid(1), _hiCorpseGuid(1), _hiMoTransGuid(1) {} ObjectMgr::~ObjectMgr() @@ -8259,7 +8259,7 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 id, int32 maxcount return false; } - if (vItems->GetItemCount() >= MAX_VENDOR_ITEMS) + if (vItems->GetItemCount() >= MAX_VENDOR_ITEMS) // FIXME: GetItemCount range 0...255 MAX_VENDOR_ITEMS = 300 { if (player) ChatHandler(player).SendSysMessage(LANG_COMMAND_ADDVENDORITEMITEMS); diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index c589480a517..e843191832e 100644 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -1551,7 +1551,7 @@ void Guild::HandleInviteMember(WorldSession* session, const std::string& name) data << uint32(m_emblemInfo.GetBackgroundColor()); data << uint32(m_emblemInfo.GetColor()); - ObjectGuid oldGuildGuid = MAKE_NEW_GUID(pInvitee->GetGuildId(), 0, pInvitee->GetGuildId() ? HIGHGUID_GUILD : 0); + ObjectGuid oldGuildGuid = MAKE_NEW_GUID(pInvitee->GetGuildId(), 0, pInvitee->GetGuildId() ? uint32(HIGHGUID_GUILD) : 0); ObjectGuid newGuildGuid = GetGUID(); data.WriteBit(newGuildGuid[3]); @@ -1814,7 +1814,7 @@ void Guild::HandleMemberDepositMoney(WorldSession* session, uint32 amount) if (!AccountMgr::IsPlayerAccount(player->GetSession()->GetSecurity()) && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE)) { sLog->outCommand(player->GetSession()->GetAccountId(), - "GM %s (Account: %u) deposit money (Amount: " UI64FMTD ") to guild bank (Guild ID %u)", + "GM %s (Account: %u) deposit money (Amount: %u) to guild bank (Guild ID %u)", player->GetName(), player->GetSession()->GetAccountId(), amount, m_id); } // Log guild bank event diff --git a/src/server/game/Handlers/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cpp index 837e074044a..28f15a7377d 100644 --- a/src/server/game/Handlers/ChatHandler.cpp +++ b/src/server/game/Handlers/ChatHandler.cpp @@ -575,6 +575,8 @@ void WorldSession::HandleAddonMessagechatOpcode(WorldPacket& recvData) prefix = recvData.ReadString(prefixLen); break; } + default: + break; } // Logging enabled? diff --git a/src/server/game/Handlers/MailHandler.cpp b/src/server/game/Handlers/MailHandler.cpp index 9ee962f4a3d..0722a9c1e00 100644 --- a/src/server/game/Handlers/MailHandler.cpp +++ b/src/server/game/Handlers/MailHandler.cpp @@ -324,7 +324,7 @@ void WorldSession::HandleSendMail(WorldPacket& recvData) if (money > 0 && !AccountMgr::IsPlayerAccount(GetSecurity()) && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE)) { - sLog->outCommand(GetAccountId(), "GM %s (Account: %u) mail money: %u to player: %s (Account: %u)", + sLog->outCommand(GetAccountId(), "GM %s (Account: %u) mail money: " UI64FMTD " to player: %s (Account: %u)", GetPlayerName(), GetAccountId(), money, receiver.c_str(), rc_account); } } @@ -519,7 +519,7 @@ void WorldSession::HandleMailTakeItem(WorldPacket& recvData) if (!sObjectMgr->GetPlayerNameByGUID(sender_guid, sender_name)) sender_name = sObjectMgr->GetTrinityStringForDBCLocale(LANG_UNKNOWN); } - sLog->outCommand(GetAccountId(), "GM %s (Account: %u) receive mail item: %s (Entry: %u Count: %u) and send COD money: %u to player: %s (Account: %u)", + sLog->outCommand(GetAccountId(), "GM %s (Account: %u) receive mail item: %s (Entry: %u Count: %u) and send COD money: " UI64FMTD " to player: %s (Account: %u)", GetPlayerName(), GetAccountId(), it->GetTemplate()->Name1.c_str(), it->GetEntry(), it->GetCount(), m->COD, sender_name.c_str(), sender_accId); } else if (!receive) diff --git a/src/server/game/Handlers/SkillHandler.cpp b/src/server/game/Handlers/SkillHandler.cpp index bc02822c09d..f2199e26055 100755 --- a/src/server/game/Handlers/SkillHandler.cpp +++ b/src/server/game/Handlers/SkillHandler.cpp @@ -48,7 +48,7 @@ void WorldSession::HandleLearnPreviewTalents(WorldPacket& recvPacket) { if (TalentTabEntry const* talentTabEntry = sTalentTabStore.LookupEntry(_player->GetPrimaryTalentTree(_player->GetActiveSpec()))) { - if (talentTabEntry->tabpage != tabPage) + if (talentTabEntry->tabpage != uint32(tabPage)) { recvPacket.rfinish(); return; diff --git a/src/server/game/Handlers/TradeHandler.cpp b/src/server/game/Handlers/TradeHandler.cpp index 13881d919f7..13cddaff7ea 100755 --- a/src/server/game/Handlers/TradeHandler.cpp +++ b/src/server/game/Handlers/TradeHandler.cpp @@ -523,14 +523,14 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/) { if (!AccountMgr::IsPlayerAccount(_player->GetSession()->GetSecurity()) && my_trade->GetMoney() > 0) { - sLog->outCommand(_player->GetSession()->GetAccountId(), "GM %s (Account: %u) give money (Amount: %u) to player: %s (Account: %u)", + sLog->outCommand(_player->GetSession()->GetAccountId(), "GM %s (Account: %u) give money (Amount: " UI64FMTD ") to player: %s (Account: %u)", _player->GetName(), _player->GetSession()->GetAccountId(), my_trade->GetMoney(), trader->GetName(), trader->GetSession()->GetAccountId()); } if (!AccountMgr::IsPlayerAccount(trader->GetSession()->GetSecurity()) && his_trade->GetMoney() > 0) { - sLog->outCommand(trader->GetSession()->GetAccountId(), "GM %s (Account: %u) give money (Amount: %u) to player: %s (Account: %u)", + sLog->outCommand(trader->GetSession()->GetAccountId(), "GM %s (Account: %u) give money (Amount: " UI64FMTD ") to player: %s (Account: %u)", trader->GetName(), trader->GetSession()->GetAccountId(), his_trade->GetMoney(), _player->GetName(), _player->GetSession()->GetAccountId()); diff --git a/src/server/game/Handlers/VoidStorageHandler.cpp b/src/server/game/Handlers/VoidStorageHandler.cpp index 0e40b0faf15..8171a30cc3a 100644 --- a/src/server/game/Handlers/VoidStorageHandler.cpp +++ b/src/server/game/Handlers/VoidStorageHandler.cpp @@ -332,7 +332,7 @@ void WorldSession::HandleVoidStorageTransfer(WorldPacket& recvData) Item* item = player->GetItemByGuid(*itr); if (!item) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleVoidStorageTransfer - Player (GUID: %u, name: %s) wants to deposit an invalid item (item guid: %u).", player->GetGUIDLow(), player->GetName(), uint64(*itr)); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleVoidStorageTransfer - Player (GUID: %u, name: %s) wants to deposit an invalid item (item guid: " UI64FMTD ").", player->GetGUIDLow(), player->GetName(), uint64(*itr)); continue; } @@ -357,7 +357,7 @@ void WorldSession::HandleVoidStorageTransfer(WorldPacket& recvData) VoidStorageItem* itemVS = player->GetVoidStorageItem(*itr, slot); if (!itemVS) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleVoidStorageTransfer - Player (GUID: %u, name: %s) tried to withdraw an invalid item (id: %u)", player->GetGUIDLow(), player->GetName(), uint64(*itr)); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleVoidStorageTransfer - Player (GUID: %u, name: %s) tried to withdraw an invalid item (id: " UI64FMTD ")", player->GetGUIDLow(), player->GetName(), uint64(*itr)); continue; } @@ -366,7 +366,7 @@ void WorldSession::HandleVoidStorageTransfer(WorldPacket& recvData) if (msg != EQUIP_ERR_OK) { SendVoidStorageTransferResult(VOID_TRANSFER_ERROR_INVENTORY_FULL); - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleVoidStorageTransfer - Player (GUID: %u, name: %s) couldn't withdraw item id %u because inventory was full.", player->GetGUIDLow(), player->GetName(), uint64(*itr)); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleVoidStorageTransfer - Player (GUID: %u, name: %s) couldn't withdraw item id " UI64FMTD " because inventory was full.", player->GetGUIDLow(), player->GetName(), uint64(*itr)); return; } @@ -535,7 +535,7 @@ void WorldSession::HandleVoidSwapItem(WorldPacket& recvData) uint8 oldSlot; if (!player->GetVoidStorageItem(itemId, oldSlot)) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleVoidSwapItem - Player (GUID: %u, name: %s) requested swapping an invalid item (slot: %u, itemid: %u).", player->GetGUIDLow(), player->GetName(), newSlot, uint64(itemId)); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleVoidSwapItem - Player (GUID: %u, name: %s) requested swapping an invalid item (slot: %u, itemid: " UI64FMTD ").", player->GetGUIDLow(), player->GetName(), newSlot, uint64(itemId)); return; } diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 38afbc28417..e65a116373d 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -6613,7 +6613,7 @@ void AuraEffect::HandleObsModPowerAuraTick(Unit* target, Unit* caster) const } // don't regen when permanent aura target has full power - if (GetBase()->IsPermanent() && target->GetPower(powerType) == target->GetMaxPower(powerType)) + if (GetBase()->IsPermanent() && uint32(target->GetPower(powerType)) == target->GetMaxPower(powerType)) return; // ignore negative values (can be result apply spellmods to aura damage @@ -6644,7 +6644,7 @@ void AuraEffect::HandlePeriodicEnergizeAuraTick(Unit* target, Unit* caster) cons } // don't regen when permanent aura target has full power - if (GetBase()->IsPermanent() && target->GetPower(powerType) == target->GetMaxPower(powerType)) + if (GetBase()->IsPermanent() && uint32(target->GetPower(powerType)) == target->GetMaxPower(powerType)) return; // ignore negative values (can be result apply spellmods to aura damage diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 771da8162f9..58326fcf384 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -5874,7 +5874,7 @@ SpellCastResult Spell::CheckItems() } Powers power = Powers(m_spellInfo->Effects[i].MiscValue); - if (m_targets.GetUnitTarget()->GetPower(power) == m_targets.GetUnitTarget()->GetMaxPower(power)) + if (uint32(m_targets.GetUnitTarget()->GetPower(power)) == m_targets.GetUnitTarget()->GetMaxPower(power)) { failReason = SPELL_FAILED_ALREADY_AT_FULL_POWER; continue; diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 0c748204ad2..02bcd91b5ad 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -769,7 +769,7 @@ void World::LoadConfigSettings(bool reload) m_int_configs[CONFIG_START_PLAYER_MONEY] = ConfigMgr::GetIntDefault("StartPlayerMoney", 0); if (int32(m_int_configs[CONFIG_START_PLAYER_MONEY]) < 0) { - sLog->outError(LOG_FILTER_SERVER_LOADING, "StartPlayerMoney (%i) must be in range 0..%u. Set to %u.", m_int_configs[CONFIG_START_PLAYER_MONEY], MAX_MONEY_AMOUNT, 0); + sLog->outError(LOG_FILTER_SERVER_LOADING, "StartPlayerMoney (%i) must be in range 0.." UI64FMTD ". Set to %u.", m_int_configs[CONFIG_START_PLAYER_MONEY], MAX_MONEY_AMOUNT, 0); m_int_configs[CONFIG_START_PLAYER_MONEY] = 0; } else if (m_int_configs[CONFIG_START_PLAYER_MONEY] > 0x7FFFFFFF-1) // TODO: (See MAX_MONEY_AMOUNT) @@ -1256,7 +1256,7 @@ void World::SetInitialWorldSettings() //No SQL injection as values are treated as integers // not send custom type REALM_FFA_PVP to realm list - uint32 server_type = IsFFAPvPRealm() ? REALM_TYPE_PVP : getIntConfig(CONFIG_GAME_TYPE); + uint32 server_type = IsFFAPvPRealm() ? uint32(REALM_TYPE_PVP) : getIntConfig(CONFIG_GAME_TYPE); uint32 realm_zone = getIntConfig(CONFIG_REALM_ZONE); LoginDatabase.PExecute("UPDATE realmlist SET icon = %u, timezone = %u WHERE id = '%d'", server_type, realm_zone, realmID); // One-time query diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp index c05613d387f..4e95b3e981b 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp @@ -112,7 +112,7 @@ class boss_moam : public CreatureScript events.Update(diff); - if (me->GetPower(POWER_MANA) == me->GetMaxPower(POWER_MANA)) + if (uint32(me->GetPower(POWER_MANA)) == me->GetMaxPower(POWER_MANA)) { if (_isStonePhase) DoAction(ACTION_STONE_PHASE_END); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp index 9017509781f..2a65c241168 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp @@ -406,7 +406,7 @@ class boss_deathbringer_saurfang : public CreatureScript case 72444: case 72445: case 72446: - if (me->GetPower(POWER_ENERGY) != me->GetMaxPower(POWER_ENERGY)) + if (uint32(me->GetPower(POWER_ENERGY)) != me->GetMaxPower(POWER_ENERGY)) target->CastCustomSpell(SPELL_BLOOD_LINK_DUMMY, SPELLVALUE_BASE_POINT0, 1, me, true); break; default: @@ -1039,7 +1039,7 @@ class spell_deathbringer_blood_link_aura : public SpellScriptLoader void HandlePeriodicTick(AuraEffect const* /*aurEff*/) { PreventDefaultAction(); - if (GetUnitOwner()->getPowerType() == POWER_ENERGY && GetUnitOwner()->GetPower(POWER_ENERGY) == GetUnitOwner()->GetMaxPower(POWER_ENERGY)) + if (GetUnitOwner()->getPowerType() == POWER_ENERGY && uint32(GetUnitOwner()->GetPower(POWER_ENERGY)) == GetUnitOwner()->GetMaxPower(POWER_ENERGY)) if (Creature* saurfang = GetUnitOwner()->ToCreature()) saurfang->AI()->DoAction(ACTION_MARK_OF_THE_FALLEN_CHAMPION); } @@ -1131,7 +1131,7 @@ class spell_deathbringer_rune_of_blood : public SpellScriptLoader void HandleScript(SpellEffIndex effIndex) { PreventHitDefaultEffect(effIndex); // make this the default handler - if (GetCaster()->GetPower(POWER_ENERGY) != GetCaster()->GetMaxPower(POWER_ENERGY)) + if (uint32(GetCaster()->GetPower(POWER_ENERGY)) != GetCaster()->GetMaxPower(POWER_ENERGY)) GetHitUnit()->CastCustomSpell(SPELL_BLOOD_LINK_DUMMY, SPELLVALUE_BASE_POINT0, 1, GetCaster(), true); } @@ -1166,7 +1166,7 @@ class spell_deathbringer_blood_nova : public SpellScriptLoader void HandleScript(SpellEffIndex effIndex) { PreventHitDefaultEffect(effIndex); // make this the default handler - if (GetCaster()->GetPower(POWER_ENERGY) != GetCaster()->GetMaxPower(POWER_ENERGY)) + if (uint32(GetCaster()->GetPower(POWER_ENERGY)) != GetCaster()->GetMaxPower(POWER_ENERGY)) GetHitUnit()->CastCustomSpell(SPELL_BLOOD_LINK_DUMMY, SPELLVALUE_BASE_POINT0, 2, GetCaster(), true); } -- cgit v1.2.3 From 9749fe55f823503cb7ca8511a67deeddc247a414 Mon Sep 17 00:00:00 2001 From: Spp Date: Fri, 17 Aug 2012 14:30:10 +0200 Subject: Better way to fix some of the warnings of the previous commit --- src/server/game/Entities/Pet/Pet.cpp | 2 +- src/server/game/Entities/Player/Player.cpp | 4 ++-- src/server/game/Entities/Unit/Unit.cpp | 12 ++++++------ src/server/game/Entities/Unit/Unit.h | 2 +- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 4 ++-- src/server/game/Spells/Spell.cpp | 2 +- src/server/game/World/World.cpp | 2 +- src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp | 2 +- .../Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp | 8 ++++---- 9 files changed, 19 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index 8392fbb9e49..71a68fdba3c 100755 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -253,7 +253,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c else { SetHealth(savedhealth > GetMaxHealth() ? GetMaxHealth() : savedhealth); - SetPower(POWER_MANA, savedmana > GetMaxPower(POWER_MANA) ? GetMaxPower(POWER_MANA) : savedmana); + SetPower(POWER_MANA, savedmana > uint32(GetMaxPower(POWER_MANA)) ? GetMaxPower(POWER_MANA) : savedmana); } } diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 1db057ce4a8..e8333f8e2c2 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -2384,7 +2384,7 @@ void Player::ProcessDelayedOperations() else SetFullHealth(); - if (GetMaxPower(POWER_MANA) > m_resurrectMana) + if (uint32(GetMaxPower(POWER_MANA)) > m_resurrectMana) SetPower(POWER_MANA, m_resurrectMana); else SetPower(POWER_MANA, GetMaxPower(POWER_MANA)); @@ -23174,7 +23174,7 @@ void Player::ResurectUsingRequestData() else SetFullHealth(); - if (GetMaxPower(POWER_MANA) > m_resurrectMana) + if (uint32(GetMaxPower(POWER_MANA)) > m_resurrectMana) SetPower(POWER_MANA, m_resurrectMana); else SetPower(POWER_MANA, GetMaxPower(POWER_MANA)); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index beb02ede95c..25cac647666 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -5701,7 +5701,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere return false; // mana reward - basepoints0 = CalculatePctN(int32(GetMaxPower(POWER_MANA)), triggerAmount); + basepoints0 = CalculatePctN(GetMaxPower(POWER_MANA), triggerAmount); target = this; triggered_spell_id = 29442; break; @@ -11440,7 +11440,7 @@ int32 Unit::ModifyPower(Powers power, int32 dVal) if (dVal == 0) return 0; - int32 curPower = (int32)GetPower(power); + int32 curPower = GetPower(power); int32 val = dVal + curPower; if (val <= GetMinPower(power)) @@ -11449,7 +11449,7 @@ int32 Unit::ModifyPower(Powers power, int32 dVal) return -curPower; } - int32 maxPower = (int32)GetMaxPower(power); + int32 maxPower = GetMaxPower(power); if (val < maxPower) { @@ -11471,7 +11471,7 @@ int32 Unit::ModifyPowerPct(Powers power, float pct, bool apply) float amount = (float)GetMaxPower(power); ApplyPercentModFloatVar(amount, pct, apply); - return ModifyPower(power, (int32)amount - (int32)GetMaxPower(power)); + return ModifyPower(power, (int32)amount - GetMaxPower(power)); } bool Unit::IsAlwaysVisibleFor(WorldObject const* seer) const @@ -13007,13 +13007,13 @@ int32 Unit::GetPower(Powers power) const return GetUInt32Value(UNIT_FIELD_POWER1 + powerIndex); } -uint32 Unit::GetMaxPower(Powers power) const +int32 Unit::GetMaxPower(Powers power) const { uint32 powerIndex = GetPowerIndexByClass(power, getClass()); if (powerIndex == MAX_POWERS) return 0; - return GetUInt32Value(UNIT_FIELD_MAXPOWER1 + powerIndex); + return GetInt32Value(UNIT_FIELD_MAXPOWER1 + powerIndex); } void Unit::SetPower(Powers power, int32 val) diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index cafbfaac5b1..74212e0f309 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1345,7 +1345,7 @@ class Unit : public WorldObject void setPowerType(Powers power); int32 GetPower(Powers power) const; int32 GetMinPower(Powers power) const { return power == POWER_ECLIPSE ? -100 : 0; } - uint32 GetMaxPower(Powers power) const; + int32 GetMaxPower(Powers power) const; void SetPower(Powers power, int32 val); void SetMaxPower(Powers power, int32 val); // returns the change in power diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index e65a116373d..38afbc28417 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -6613,7 +6613,7 @@ void AuraEffect::HandleObsModPowerAuraTick(Unit* target, Unit* caster) const } // don't regen when permanent aura target has full power - if (GetBase()->IsPermanent() && uint32(target->GetPower(powerType)) == target->GetMaxPower(powerType)) + if (GetBase()->IsPermanent() && target->GetPower(powerType) == target->GetMaxPower(powerType)) return; // ignore negative values (can be result apply spellmods to aura damage @@ -6644,7 +6644,7 @@ void AuraEffect::HandlePeriodicEnergizeAuraTick(Unit* target, Unit* caster) cons } // don't regen when permanent aura target has full power - if (GetBase()->IsPermanent() && uint32(target->GetPower(powerType)) == target->GetMaxPower(powerType)) + if (GetBase()->IsPermanent() && target->GetPower(powerType) == target->GetMaxPower(powerType)) return; // ignore negative values (can be result apply spellmods to aura damage diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 58326fcf384..771da8162f9 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -5874,7 +5874,7 @@ SpellCastResult Spell::CheckItems() } Powers power = Powers(m_spellInfo->Effects[i].MiscValue); - if (uint32(m_targets.GetUnitTarget()->GetPower(power)) == m_targets.GetUnitTarget()->GetMaxPower(power)) + if (m_targets.GetUnitTarget()->GetPower(power) == m_targets.GetUnitTarget()->GetMaxPower(power)) { failReason = SPELL_FAILED_ALREADY_AT_FULL_POWER; continue; diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 02bcd91b5ad..05a67a2090e 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -770,7 +770,7 @@ void World::LoadConfigSettings(bool reload) if (int32(m_int_configs[CONFIG_START_PLAYER_MONEY]) < 0) { sLog->outError(LOG_FILTER_SERVER_LOADING, "StartPlayerMoney (%i) must be in range 0.." UI64FMTD ". Set to %u.", m_int_configs[CONFIG_START_PLAYER_MONEY], MAX_MONEY_AMOUNT, 0); - m_int_configs[CONFIG_START_PLAYER_MONEY] = 0; + m_int_configs[CONFIG_START_PLAYER_MONEY] = 0; } else if (m_int_configs[CONFIG_START_PLAYER_MONEY] > 0x7FFFFFFF-1) // TODO: (See MAX_MONEY_AMOUNT) { diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp index 4e95b3e981b..c05613d387f 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp @@ -112,7 +112,7 @@ class boss_moam : public CreatureScript events.Update(diff); - if (uint32(me->GetPower(POWER_MANA)) == me->GetMaxPower(POWER_MANA)) + if (me->GetPower(POWER_MANA) == me->GetMaxPower(POWER_MANA)) { if (_isStonePhase) DoAction(ACTION_STONE_PHASE_END); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp index 2a65c241168..9017509781f 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp @@ -406,7 +406,7 @@ class boss_deathbringer_saurfang : public CreatureScript case 72444: case 72445: case 72446: - if (uint32(me->GetPower(POWER_ENERGY)) != me->GetMaxPower(POWER_ENERGY)) + if (me->GetPower(POWER_ENERGY) != me->GetMaxPower(POWER_ENERGY)) target->CastCustomSpell(SPELL_BLOOD_LINK_DUMMY, SPELLVALUE_BASE_POINT0, 1, me, true); break; default: @@ -1039,7 +1039,7 @@ class spell_deathbringer_blood_link_aura : public SpellScriptLoader void HandlePeriodicTick(AuraEffect const* /*aurEff*/) { PreventDefaultAction(); - if (GetUnitOwner()->getPowerType() == POWER_ENERGY && uint32(GetUnitOwner()->GetPower(POWER_ENERGY)) == GetUnitOwner()->GetMaxPower(POWER_ENERGY)) + if (GetUnitOwner()->getPowerType() == POWER_ENERGY && GetUnitOwner()->GetPower(POWER_ENERGY) == GetUnitOwner()->GetMaxPower(POWER_ENERGY)) if (Creature* saurfang = GetUnitOwner()->ToCreature()) saurfang->AI()->DoAction(ACTION_MARK_OF_THE_FALLEN_CHAMPION); } @@ -1131,7 +1131,7 @@ class spell_deathbringer_rune_of_blood : public SpellScriptLoader void HandleScript(SpellEffIndex effIndex) { PreventHitDefaultEffect(effIndex); // make this the default handler - if (uint32(GetCaster()->GetPower(POWER_ENERGY)) != GetCaster()->GetMaxPower(POWER_ENERGY)) + if (GetCaster()->GetPower(POWER_ENERGY) != GetCaster()->GetMaxPower(POWER_ENERGY)) GetHitUnit()->CastCustomSpell(SPELL_BLOOD_LINK_DUMMY, SPELLVALUE_BASE_POINT0, 1, GetCaster(), true); } @@ -1166,7 +1166,7 @@ class spell_deathbringer_blood_nova : public SpellScriptLoader void HandleScript(SpellEffIndex effIndex) { PreventHitDefaultEffect(effIndex); // make this the default handler - if (uint32(GetCaster()->GetPower(POWER_ENERGY)) != GetCaster()->GetMaxPower(POWER_ENERGY)) + if (GetCaster()->GetPower(POWER_ENERGY) != GetCaster()->GetMaxPower(POWER_ENERGY)) GetHitUnit()->CastCustomSpell(SPELL_BLOOD_LINK_DUMMY, SPELLVALUE_BASE_POINT0, 2, GetCaster(), true); } -- cgit v1.2.3 From b3b10ccb5a37007b21837169a5f7515173cef2c5 Mon Sep 17 00:00:00 2001 From: Tuxity Date: Fri, 17 Aug 2012 14:48:45 +0200 Subject: Core/Players: Implemented rune regen scaling with haste. Closes #7413. --- src/server/game/Entities/Player/Player.cpp | 23 ++++++++++++++++++++--- src/server/game/Entities/Player/Player.h | 1 + src/server/game/Entities/Unit/StatSystem.cpp | 15 +++++++++++++++ 3 files changed, 36 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index e8333f8e2c2..ebaddea3b32 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -5915,6 +5915,8 @@ void Player::ApplyRatingMod(CombatRating cr, int32 value, bool apply) float RatingChange = value * GetRatingMultiplier(cr); ApplyAttackTimePercentMod(BASE_ATTACK, RatingChange, apply); ApplyAttackTimePercentMod(OFF_ATTACK, RatingChange, apply); + if (getClass() == CLASS_DEATH_KNIGHT) + UpdateAllRunesRegen(); break; } case CR_HASTE_RANGED: @@ -18781,7 +18783,7 @@ void Player::SaveToDB(bool create /*=false*/) { if (GetPowerIndexByClass(Powers(i), getClass()) != MAX_POWERS) { - stmt->setUInt32(index++, GetUInt32Value(UNIT_FIELD_POWER1 + storedPowers)); + stmt->setUInt32(index++, GetUInt32Value(UNIT_FIELD_POWER1 + storedPowers)); if (++storedPowers >= MAX_STORED_POWERS) break; } @@ -23788,6 +23790,7 @@ uint32 Player::GetRuneBaseCooldown(uint8 index) { uint8 rune = GetBaseRune(index); uint32 cooldown = RUNE_BASE_COOLDOWN; + float hastePct = 0.0f; AuraEffectList const& regenAura = GetAuraEffectsByType(SPELL_AURA_MOD_POWER_REGEN_PERCENT); for (AuraEffectList::const_iterator i = regenAura.begin();i != regenAura.end(); ++i) @@ -23796,6 +23799,20 @@ uint32 Player::GetRuneBaseCooldown(uint8 index) cooldown = cooldown*(100-(*i)->GetAmount())/100; } + // Runes cooldown are now affected by player's haste from equipment ... + hastePct = GetRatingBonusValue(CR_HASTE_MELEE); + + // ... and some auras. + AuraEffectList const& meleeHasteAura = GetAuraEffectsByType(SPELL_AURA_MOD_MELEE_HASTE); + for (AuraEffectList::const_iterator i = meleeHasteAura.begin();i != meleeHasteAura.end(); ++i) + hastePct += (*i)->GetAmount(); + + AuraEffectList const& meleeHasteAura2 = GetAuraEffectsByType(SPELL_AURA_319); + for (AuraEffectList::const_iterator i = meleeHasteAura2.begin();i != meleeHasteAura2.end(); ++i) + hastePct += (*i)->GetAmount(); + + cooldown *= 1.0f - (hastePct / 100.0f); + return cooldown; } @@ -23888,8 +23905,8 @@ void Player::InitRunes() m_runes->SetRuneState(i); } - for (uint8 i = 0; i < NUM_RUNE_TYPES; ++i) - SetFloatValue(PLAYER_RUNE_REGEN_1 + i, 0.1f); + for (uint8 i = 0; i < MAX_RUNES; ++i) + SetFloatValue(PLAYER_RUNE_REGEN_1 + i, 0.1f); // set a base regen timer equal to 10 sec } bool Player::IsBaseRuneSlotsOnCooldown(RuneType runeType) const diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 70cf835531b..b0e2a008f3f 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1980,6 +1980,7 @@ class Player : public Unit, public GridObject void ApplyHealthRegenBonus(int32 amount, bool apply); void UpdateManaRegen(); void UpdateRuneRegen(RuneType rune); + void UpdateAllRunesRegen(); uint64 GetLootGUID() const { return m_lootGuid; } void SetLootGUID(uint64 guid) { m_lootGuid = guid; } diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index 9021523db24..d44feeecd08 100755 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -789,6 +789,21 @@ void Player::UpdateRuneRegen(RuneType rune) SetFloatValue(PLAYER_RUNE_REGEN_1 + uint8(rune), regen); } +void Player::UpdateAllRunesRegen() +{ + uint32 cooldown = 0; + + for (uint8 i = 0; i < MAX_RUNES; ++i) + { + cooldown = GetRuneBaseCooldown(i); + if (cooldown) + { + float regen = float(1 * IN_MILLISECONDS) / float(cooldown); + SetFloatValue(PLAYER_RUNE_REGEN_1 + i, regen); + } + } +} + void Player::_ApplyAllStatBonuses() { SetCanModifyStats(false); -- cgit v1.2.3 From a96f695245a7adea6f7307e2dee360d547d26c18 Mon Sep 17 00:00:00 2001 From: Subv Date: Fri, 17 Aug 2012 09:01:48 -0500 Subject: Core/Spells: Removed some more deprecated spells code --- src/server/game/Spells/Spell.cpp | 3 +- src/server/game/Spells/SpellEffects.cpp | 144 ++------------------------------ 2 files changed, 8 insertions(+), 139 deletions(-) (limited to 'src') diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 771da8162f9..6a62b143abc 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -5579,8 +5579,9 @@ SpellCastResult Spell::CheckCasterAuras() const bool usableInStun = m_spellInfo->AttributesEx5 & SPELL_ATTR5_USABLE_WHILE_STUNNED; // Glyph of Pain Suppression + // Allow Pain Suppression and Guardian Spirit to be cast while stunned // there is no other way to handle it - if (m_spellInfo->Id == 33206 && !m_caster->HasAura(63248)) + if ((m_spellInfo->Id == 33206 || m_spellInfo->Id == 47788) && !m_caster->HasAura(63248)) usableInStun = false; // Check whether the cast should be prevented by any state you might have. diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index e2e758d8427..963f8c1e2f7 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -401,73 +401,12 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex) // Incinerate Rank 1 & 2 if ((m_spellInfo->SpellFamilyFlags[1] & 0x000040) && m_spellInfo->SpellIconID == 2128) { - // Incinerate does more dmg (dmg*0.25) if the target have Immolate debuff. + // Incinerate does more dmg (dmg/6) if the target have Immolate debuff. // Check aura state for speed but aura state set not only for Immolate spell if (unitTarget->HasAuraState(AURA_STATE_CONFLAGRATE)) { if (unitTarget->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_WARLOCK, 0x4, 0, 0)) - damage += damage/4; - } - } - // Conflagrate - consumes Immolate or Shadowflame - else if (m_spellInfo->TargetAuraState == AURA_STATE_CONFLAGRATE) - { - AuraEffect const* aura = NULL; // found req. aura for damage calculation - - Unit::AuraEffectList const &mPeriodic = unitTarget->GetAuraEffectsByType(SPELL_AURA_PERIODIC_DAMAGE); - for (Unit::AuraEffectList::const_iterator i = mPeriodic.begin(); i != mPeriodic.end(); ++i) - { - // for caster applied auras only - if ((*i)->GetSpellInfo()->SpellFamilyName != SPELLFAMILY_WARLOCK || - (*i)->GetCasterGUID() != m_caster->GetGUID()) - continue; - - // Immolate - if ((*i)->GetSpellInfo()->SpellFamilyFlags[0] & 0x4) - { - aura = *i; // it selected always if exist - break; - } - - // Shadowflame - if ((*i)->GetSpellInfo()->SpellFamilyFlags[2] & 0x00000002) - aura = *i; // remember but wait possible Immolate as primary priority - } - - // found Immolate or Shadowflame - if (aura) - { - uint32 pdamage = uint32(std::max(aura->GetAmount(), 0)); - pdamage = m_caster->SpellDamageBonusDone(unitTarget, aura->GetSpellInfo(), pdamage, DOT, aura->GetBase()->GetStackAmount()); - pdamage = unitTarget->SpellDamageBonusTaken(m_caster, aura->GetSpellInfo(), pdamage, DOT, aura->GetBase()->GetStackAmount()); - uint32 pct_dir = m_caster->CalculateSpellDamage(unitTarget, m_spellInfo, (effIndex + 1)); - uint8 baseTotalTicks = uint8(m_caster->CalcSpellDuration(aura->GetSpellInfo()) / aura->GetSpellInfo()->Effects[EFFECT_0].Amplitude); - damage += int32(CalculatePctU(pdamage * baseTotalTicks, pct_dir)); - - uint32 pct_dot = m_caster->CalculateSpellDamage(unitTarget, m_spellInfo, (effIndex + 2)) / 3; - m_spellValue->EffectBasePoints[1] = m_spellInfo->Effects[EFFECT_1].CalcBaseValue(int32(CalculatePctU(pdamage * baseTotalTicks, pct_dot))); - - apply_direct_bonus = false; - // Glyph of Conflagrate - if (!m_caster->HasAura(56235)) - unitTarget->RemoveAurasDueToSpell(aura->GetId(), m_caster->GetGUID()); - - break; - } - } - // Shadow Bite - else if (m_spellInfo->SpellFamilyFlags[1] & 0x400000) - { - if (m_caster->GetTypeId() == TYPEID_UNIT && m_caster->ToCreature()->isPet()) - { - if (Player* owner = m_caster->GetOwner()->ToPlayer()) - { - if (AuraEffect* aurEff = owner->GetAuraEffect(SPELL_AURA_ADD_FLAT_MODIFIER, SPELLFAMILY_WARLOCK, 214, 0)) - { - int32 bp0 = aurEff->GetId() == 54037 ? 4 : 8; - m_caster->CastCustomSpell(m_caster, 54425, &bp0, NULL, NULL, true); - } - } + damage += damage / 6; } } break; @@ -498,20 +437,10 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex) // Ferocious Bite if (m_caster->GetTypeId() == TYPEID_PLAYER && (m_spellInfo->SpellFamilyFlags[0] & 0x000800000) && m_spellInfo->SpellVisual[0] == 6587) { - // converts each extra point of energy into ($f1+$AP/410) additional damage - float ap = m_caster->GetTotalAttackPowerValue(BASE_ATTACK); - float multiple = ap / 410 + m_spellInfo->Effects[effIndex].DamageMultiplier; - int32 energy = -(m_caster->ModifyPower(POWER_ENERGY, -30)); - damage += int32(energy * multiple); - damage += int32(CalculatePctN(m_caster->ToPlayer()->GetComboPoints() * ap, 7)); - } - // Wrath - else if (m_spellInfo->SpellFamilyFlags[0] & 0x00000001) - { - // Improved Insect Swarm - if (AuraEffect const* aurEff = m_caster->GetDummyAuraEffect(SPELLFAMILY_DRUID, 1771, 0)) - if (unitTarget->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DRUID, 0x00200000, 0, 0)) - AddPctN(damage, aurEff->GetAmount()); + // converts each extra point of energy ( up to 25 energy ) into additional damage + int32 energy = -(m_caster->ModifyPower(POWER_ENERGY, -25)); + // 25 energy = 100% more damage + AddPctN(damage, energy * 4); } break; } @@ -591,54 +520,6 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex) if (m_caster->HasAura(57627)) // Charge 6 sec post-affect damage *= 2; } - // Steady Shot - else if (m_spellInfo->SpellFamilyFlags[1] & 0x1) - { - bool found = false; - // check dazed affect - Unit::AuraEffectList const& decSpeedList = unitTarget->GetAuraEffectsByType(SPELL_AURA_MOD_DECREASE_SPEED); - for (Unit::AuraEffectList::const_iterator iter = decSpeedList.begin(); iter != decSpeedList.end(); ++iter) - { - if ((*iter)->GetSpellInfo()->SpellIconID == 15 && (*iter)->GetSpellInfo()->Dispel == 0) - { - found = true; - break; - } - } - - // TODO: should this be put on taken but not done? - if (found) - damage += m_spellInfo->Effects[EFFECT_1].CalcValue(m_caster); - - if (Player* caster = m_caster->ToPlayer()) - { - // Add Ammo and Weapon damage plus RAP * 0.1 - if (Item* item = caster->GetWeaponForAttack(RANGED_ATTACK)) - { - ItemTemplate const* weaponTemplate = item->GetTemplate(); - float dmg_min = weaponTemplate->DamageMin; - float dmg_max = weaponTemplate->DamageMax; - if (dmg_max == 0.0f && dmg_min > dmg_max) - damage += int32(dmg_min); - else - damage += irand(int32(dmg_min), int32(dmg_max)); - damage += int32(weaponTemplate->Delay * 0.001f); - } - } - } - break; - } - case SPELLFAMILY_PALADIN: - { - // Hammer of the Righteous - if (m_spellInfo->SpellFamilyFlags[1]&0x00040000) - { - // Add main hand dps * effect[2] amount - float average = (m_caster->GetFloatValue(UNIT_FIELD_MINDAMAGE) + m_caster->GetFloatValue(UNIT_FIELD_MAXDAMAGE)) / 2; - int32 count = m_caster->CalculateSpellDamage(unitTarget, m_spellInfo, EFFECT_2); - damage += count * int32(average * IN_MILLISECONDS) / m_caster->GetAttackTime(BASE_ATTACK); - break; - } break; } case SPELLFAMILY_DEATHKNIGHT: @@ -813,15 +694,6 @@ void Spell::EffectTriggerSpell(SpellEffIndex effIndex) // special cases switch (triggered_spell_id) { - // Mirror Image - case 58832: - { - // Glyph of Mirror Image - if (m_caster->HasAura(63093)) - m_caster->CastSpell(m_caster, 65047, true); // Mirror Image - - break; - } // Vanish (not exist) case 18461: { @@ -854,10 +726,6 @@ void Spell::EffectTriggerSpell(SpellEffIndex effIndex) unitTarget->CastSpell(unitTarget, 7870, true); return; } - // just skip - case 23770: // Sayge's Dark Fortune of * - // not exist, common cooldown can be implemented in scripts if need. - return; // Brittle Armor - (need add max stack of 24575 Brittle Armor) case 29284: { -- cgit v1.2.3 From 8a27cf327b4433de47f1b1b63e5993482a18e548 Mon Sep 17 00:00:00 2001 From: Subv Date: Fri, 17 Aug 2012 09:48:53 -0500 Subject: Core/Spells: Removed more deprecated spells code --- src/server/game/Spells/SpellEffects.cpp | 35 ++------------------------------- 1 file changed, 2 insertions(+), 33 deletions(-) (limited to 'src') diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 963f8c1e2f7..57802dbe5be 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -1400,22 +1400,6 @@ void Spell::EffectHeal(SpellEffIndex /*effIndex*/) //addhealth += tickheal * tickcount; //addhealth = caster->SpellHealingBonus(m_spellInfo, addhealth, HEAL, unitTarget); } - // Nourish - else if (m_spellInfo->SpellFamilyName == SPELLFAMILY_DRUID && m_spellInfo->SpellFamilyFlags[1] & 0x2000000) - { - addhealth = caster->SpellHealingBonusDone(unitTarget, m_spellInfo, addhealth, HEAL); - - // Glyph of Nourish - if (AuraEffect const* aurEff = m_caster->GetAuraEffect(62971, 0)) - { - Unit::AuraEffectList const& Periodic = unitTarget->GetAuraEffectsByType(SPELL_AURA_PERIODIC_HEAL); - for (Unit::AuraEffectList::const_iterator i = Periodic.begin(); i != Periodic.end(); ++i) - { - if (m_caster->GetGUID() == (*i)->GetCasterGUID()) - AddPctN(addhealth, aurEff->GetAmount()); - } - } - } // Death Pact - return pct of max health to caster else if (m_spellInfo->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT && m_spellInfo->SpellFamilyFlags[0] & 0x00080000) addhealth = caster->SpellHealingBonusDone(unitTarget, m_spellInfo, int32(caster->CountPctFromMaxHealth(damage)), HEAL); @@ -1735,13 +1719,10 @@ void Spell::EffectEnergize(SpellEffIndex effIndex) level_multiplier = 4; break; case 31930: // Judgements of the Wise - case 63375: // Improved Stormstrike + case 63375: // Primal Wisdom case 68082: // Glyph of Seal of Command damage = int32(CalculatePctN(unitTarget->GetCreateMana(), damage)); break; - case 48542: // Revitalize - damage = int32(CalculatePctN(unitTarget->GetMaxPower(power), damage)); - break; case 67490: // Runic Mana Injector (mana gain increased by 25% for engineers - 3.2.0 patch change) { if (Player* player = m_caster->ToPlayer()) @@ -1749,9 +1730,6 @@ void Spell::EffectEnergize(SpellEffIndex effIndex) AddPctN(damage, 25); break; } - case 71132: // Glyph of Shadow Word: Pain - damage = int32(CalculatePctN(unitTarget->GetCreateMana(), 1)); // set 1 as value, missing in dbc - break; default: break; } @@ -3078,20 +3056,11 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex) if (Aura* aur = unitTarget->GetAura(58567, m_caster->GetGUID())) { - // 58388 - Glyph of Devastate dummy aura. - if (int32 num = (needCast ? 0 : 1) + (m_caster->HasAura(58388) ? 1 : 0)) + if (int32 num = (needCast ? 0 : 1)) aur->ModStackAmount(num); fixed_bonus += (aur->GetStackAmount() - 1) * CalculateDamage(2, unitTarget); } } - if (m_spellInfo->SpellFamilyFlags[0] & 0x8000000) // Mocking Blow - { - if (unitTarget->IsImmunedToSpellEffect(m_spellInfo,EFFECT_1) || unitTarget->GetTypeId() == TYPEID_PLAYER) - { - m_damage = 0; - return; - } - } break; } case SPELLFAMILY_ROGUE: -- cgit v1.2.3 From 19c67af6f533b544e0d752e6743098041410808c Mon Sep 17 00:00:00 2001 From: Subv Date: Fri, 17 Aug 2012 12:24:21 -0500 Subject: Core/Spells: More spells cleanup --- src/server/game/Spells/SpellEffects.cpp | 74 ++++----------------------------- 1 file changed, 8 insertions(+), 66 deletions(-) (limited to 'src') diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 57802dbe5be..acf6f5e3507 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -3065,56 +3065,17 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex) } case SPELLFAMILY_ROGUE: { - // Fan of Knives, Hemorrhage, Ghostly Strike - if ((m_spellInfo->SpellFamilyFlags[1] & 0x40000) - || (m_spellInfo->SpellFamilyFlags[0] & 0x6000000)) + // Hemorrhage + if (m_spellInfo->SpellFamilyFlags[0] & 0x2000000) { - // Hemorrhage - if (m_spellInfo->SpellFamilyFlags[0] & 0x2000000) - { - if (m_caster->GetTypeId() == TYPEID_PLAYER) - m_caster->ToPlayer()->AddComboPoints(unitTarget, 1, this); - } + if (m_caster->GetTypeId() == TYPEID_PLAYER) + m_caster->ToPlayer()->AddComboPoints(unitTarget, 1, this); // 50% more damage with daggers if (m_caster->GetTypeId() == TYPEID_PLAYER) if (Item* item = m_caster->ToPlayer()->GetWeaponForAttack(m_attackType, true)) if (item->GetTemplate()->SubClass == ITEM_SUBCLASS_WEAPON_DAGGER) totalDamagePercentMod *= 1.5f; } - // Mutilate (for each hand) - else if (m_spellInfo->SpellFamilyFlags[1] & 0x6) - { - bool found = false; - // fast check - if (unitTarget->HasAuraState(AURA_STATE_DEADLY_POISON, m_spellInfo, m_caster)) - found = true; - // full aura scan - else - { - Unit::AuraApplicationMap const& auras = unitTarget->GetAppliedAuras(); - for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr) - { - if (itr->second->GetBase()->GetSpellInfo()->Dispel == DISPEL_POISON) - { - found = true; - break; - } - } - } - - if (found) - totalDamagePercentMod *= 1.2f; // 120% if poisoned - } - break; - } - case SPELLFAMILY_PALADIN: - { - // Seal of Command Unleashed - if (m_spellInfo->Id == 20467) - { - spell_bonus += int32(0.08f * m_caster->GetTotalAttackPowerValue(BASE_ATTACK)); - spell_bonus += int32(0.13f * m_caster->SpellBaseDamageBonusDone(m_spellInfo->GetSchoolMask())); - } break; } case SPELLFAMILY_SHAMAN: @@ -3145,19 +3106,11 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex) { // Kill Shot - bonus damage from Ranged Attack Power if (m_spellInfo->SpellFamilyFlags[1] & 0x800000) - spell_bonus += int32(0.4f * m_caster->GetTotalAttackPowerValue(RANGED_ATTACK)); + spell_bonus += int32(0.45f * m_caster->GetTotalAttackPowerValue(RANGED_ATTACK)); break; } case SPELLFAMILY_DEATHKNIGHT: { - // Plague Strike - if (m_spellInfo->SpellFamilyFlags[0] & 0x1) - { - // Glyph of Plague Strike - if (AuraEffect const* aurEff = m_caster->GetAuraEffect(58657, EFFECT_0)) - AddPctN(totalDamagePercentMod, aurEff->GetAmount()); - break; - } // Blood Strike if (m_spellInfo->SpellFamilyFlags[0] & 0x400000) { @@ -3166,33 +3119,22 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex) if (AuraEffect const* aurEff = m_caster->GetAuraEffect(64736, EFFECT_0)) AddPctF(bonusPct, aurEff->GetAmount()); AddPctF(totalDamagePercentMod, bonusPct); - - // Glyph of Blood Strike - if (m_caster->GetAuraEffect(59332, EFFECT_0)) - if (unitTarget->HasAuraType(SPELL_AURA_MOD_DECREASE_SPEED)) - AddPctN(totalDamagePercentMod, 20); break; } // Death Strike if (m_spellInfo->SpellFamilyFlags[0] & 0x10) { // Glyph of Death Strike + // 2% more damage per 5 runic power, up to a maximum of 40% if (AuraEffect const* aurEff = m_caster->GetAuraEffect(59336, EFFECT_0)) - if (uint32 runic = std::min(m_caster->GetPower(POWER_RUNIC_POWER), aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue(m_caster))) + if (uint32 runic = std::min(uint32(m_caster->GetPower(POWER_RUNIC_POWER) / 2.5f), aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue(m_caster))) AddPctN(totalDamagePercentMod, runic); break; } // Obliterate (12.5% more damage per disease) if (m_spellInfo->SpellFamilyFlags[1] & 0x20000) { - bool consumeDiseases = true; - // Annihilation - if (AuraEffect const* aurEff = m_caster->GetDummyAuraEffect(SPELLFAMILY_DEATHKNIGHT, 2710, EFFECT_0)) - // Do not consume diseases if roll sucesses - if (roll_chance_i(aurEff->GetAmount())) - consumeDiseases = false; - - float bonusPct = m_spellInfo->Effects[EFFECT_2].CalcValue(m_caster) * unitTarget->GetDiseasesByCaster(m_caster->GetGUID(), consumeDiseases) / 2.0f; + float bonusPct = m_spellInfo->Effects[EFFECT_2].CalcValue(m_caster) * unitTarget->GetDiseasesByCaster(m_caster->GetGUID(), false) / 2.0f; // Death Knight T8 Melee 4P Bonus if (AuraEffect const* aurEff = m_caster->GetAuraEffect(64736, EFFECT_0)) AddPctF(bonusPct, aurEff->GetAmount()); -- cgit v1.2.3 From d278fc725fe3e1e3517f7e6eeeeba22f225d40dc Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 17 Aug 2012 20:09:31 +0200 Subject: Core/Spells: Fixed scaling spells for lower levels (when cast time scales as well) --- src/server/game/Spells/SpellInfo.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 165cc5cec42..1220601edd6 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -411,24 +411,32 @@ int32 SpellEffectInfo::CalcValue(Unit const* caster, int32 const* bp, Unit const float basePointsPerLevel = RealPointsPerLevel; int32 basePoints = bp ? *bp : BasePoints; float comboDamage = PointsPerComboPoint; - SpellScalingEntry const* scaling = _spellInfo->GetSpellScaling(); // base amount modification based on spell lvl vs caster lvl - if (scaling) + if (ScalingMultiplier != 0.0f) { if (caster) { - if (GtSpellScalingEntry const* gtScaling = sGtSpellScalingStore.LookupEntry((scaling->playerClass != -1 ? scaling->playerClass - 1 : 11) * 100 + caster->getLevel() - 1)) + SpellScalingEntry const* scaling = _spellInfo->GetSpellScaling(); // must exist, otherwise ScalingMultiplier == 0.0f + if (GtSpellScalingEntry const* gtScaling = sGtSpellScalingStore.LookupEntry((scaling->playerClass != -1 ? scaling->playerClass - 1 : MAX_CLASSES - 1) * 100 + caster->getLevel() - 1)) { - float preciseBasePoints = ScalingMultiplier * gtScaling->value; - comboDamage = ComboScalingMultiplier * gtScaling->value; + float multiplier = gtScaling->value; + if (scaling->castTimeMax > 0 && scaling->castScalingMaxLevel > caster->getLevel()) + multiplier *= float(scaling->castTimeMin + (caster->getLevel() - 1) * (scaling->castTimeMax - scaling->castTimeMin) / (scaling->castScalingMaxLevel - 1)) / float(scaling->castTimeMax); + if (scaling->CoefLevelBase > caster->getLevel()) + multiplier *= (1.0f - scaling->CoefBase) * (float)(caster->getLevel() - 1) / (float)(scaling->CoefLevelBase - 1) + scaling->CoefBase; + + float preciseBasePoints = ScalingMultiplier * multiplier; if (DeltaScalingMultiplier) { - float delta = DeltaScalingMultiplier * ScalingMultiplier * gtScaling->value * 0.5f; + float delta = DeltaScalingMultiplier * ScalingMultiplier * multiplier * 0.5f; preciseBasePoints += frand(-delta, delta); } basePoints = int32(preciseBasePoints); + + if (ComboScalingMultiplier) + comboDamage = ComboScalingMultiplier * multiplier; } } } -- cgit v1.2.3 From 40cfb0fa85f346aec5a4b7c679bc631c2baac55f Mon Sep 17 00:00:00 2001 From: Subv Date: Fri, 17 Aug 2012 18:06:29 -0500 Subject: Core/Spells: Implemented the haste modifying auras. --- src/server/game/Entities/Player/Player.cpp | 10 +++------- src/server/game/Entities/Unit/Unit.cpp | 2 ++ src/server/game/Spells/Auras/SpellAuraDefines.h | 6 +++--- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 8 +++++--- 4 files changed, 13 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index ebaddea3b32..947c8dab2c9 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -23803,13 +23803,9 @@ uint32 Player::GetRuneBaseCooldown(uint8 index) hastePct = GetRatingBonusValue(CR_HASTE_MELEE); // ... and some auras. - AuraEffectList const& meleeHasteAura = GetAuraEffectsByType(SPELL_AURA_MOD_MELEE_HASTE); - for (AuraEffectList::const_iterator i = meleeHasteAura.begin();i != meleeHasteAura.end(); ++i) - hastePct += (*i)->GetAmount(); - - AuraEffectList const& meleeHasteAura2 = GetAuraEffectsByType(SPELL_AURA_319); - for (AuraEffectList::const_iterator i = meleeHasteAura2.begin();i != meleeHasteAura2.end(); ++i) - hastePct += (*i)->GetAmount(); + hastePct += GetTotalAuraModifier(SPELL_AURA_MOD_MELEE_HASTE); + hastePct += GetTotalAuraModifier(SPELL_AURA_MOD_MELEE_HASTE_2); + hastePct += GetTotalAuraModifier(SPELL_AURA_MOD_MELEE_HASTE_3); cooldown *= 1.0f - (hastePct / 100.0f); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 25cac647666..7bb796cdb37 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -13549,6 +13549,7 @@ bool InitTriggerAuraData() isTriggerAura[SPELL_AURA_MOD_MECHANIC_RESISTANCE] = true; isTriggerAura[SPELL_AURA_RANGED_ATTACK_POWER_ATTACKER_BONUS] = true; isTriggerAura[SPELL_AURA_MOD_MELEE_HASTE] = true; + isTriggerAura[SPELL_AURA_MOD_MELEE_HASTE_3] = true; isTriggerAura[SPELL_AURA_MOD_ATTACKER_MELEE_HIT_CHANCE] = true; isTriggerAura[SPELL_AURA_RAID_PROC_FROM_CHARGE] = true; isTriggerAura[SPELL_AURA_RAID_PROC_FROM_CHARGE_WITH_VALUE] = true; @@ -13825,6 +13826,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u takeCharges = true; break; case SPELL_AURA_MOD_MELEE_HASTE: + case SPELL_AURA_MOD_MELEE_HASTE_3: { sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell id %u (triggered by %s haste aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); if (HandleHasteAuraProc(target, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown)) diff --git a/src/server/game/Spells/Auras/SpellAuraDefines.h b/src/server/game/Spells/Auras/SpellAuraDefines.h index c261636e5b6..4be9f7c807b 100755 --- a/src/server/game/Spells/Auras/SpellAuraDefines.h +++ b/src/server/game/Spells/Auras/SpellAuraDefines.h @@ -276,7 +276,7 @@ enum AuraType SPELL_AURA_214 = 214, SPELL_AURA_ARENA_PREPARATION = 215, SPELL_AURA_HASTE_SPELLS = 216, - SPELL_AURA_MOD_MELEE_HASTE_2 = 217, // NYI + SPELL_AURA_MOD_MELEE_HASTE_2 = 217, SPELL_AURA_HASTE_RANGED = 218, SPELL_AURA_MOD_MANA_REGEN_FROM_STAT = 219, SPELL_AURA_MOD_RATING_FROM_STAT = 220, @@ -378,7 +378,7 @@ enum AuraType SPELL_AURA_PERIODIC_HASTE = 316, SPELL_AURA_MOD_SPELL_POWER_PCT = 317, SPELL_AURA_MASTERY = 318, - SPELL_AURA_319 = 319, // (melee?) attack speed + SPELL_AURA_MOD_MELEE_HASTE_3 = 319, SPELL_AURA_MOD_RANGED_ATTACK_SPEED = 320, // NYI SPELL_AURA_321 = 321, SPELL_AURA_INTERFERE_TARGETTING = 322, // NYI @@ -401,7 +401,7 @@ enum AuraType SPELL_AURA_INCREASE_SKILL_GAIN_CHANCE = 339, // NYI SPELL_AURA_340 = 340, SPELL_AURA_341 = 341, // cooldown decrease - SPELL_AURA_MOD_TIME_BETWEEN_ATTACKS = 342, // (attack speed) NYI + SPELL_AURA_MOD_MELEE_RANGED_HASTE_2 = 342, SPELL_AURA_343 = 343, SPELL_AURA_MOD_AUTOATTACK_DAMAGE = 344, SPELL_AURA_BYPASS_ARMOR_FOR_CASTER = 345, diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 38afbc28417..3698e91e280 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -270,7 +270,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleNULL, //214 Tamed Pet Passive &AuraEffect::HandleArenaPreparation, //215 SPELL_AURA_ARENA_PREPARATION &AuraEffect::HandleModCastingSpeed, //216 SPELL_AURA_HASTE_SPELLS - &AuraEffect::HandleNULL, //217 69106 - killing spree helper - unknown use + &AuraEffect::HandleModMeleeSpeedPct, //217 SPELL_AURA_MOD_MELEE_HASTE_2 &AuraEffect::HandleAuraModRangedHaste, //218 SPELL_AURA_HASTE_RANGED &AuraEffect::HandleModManaRegen, //219 SPELL_AURA_MOD_MANA_REGEN_FROM_STAT &AuraEffect::HandleModRatingFromStat, //220 SPELL_AURA_MOD_RATING_FROM_STAT @@ -372,7 +372,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleNoImmediateEffect, //316 SPELL_AURA_PERIODIC_HASTE implemented in AuraEffect::CalculatePeriodic &AuraEffect::HandleNULL, //317 SPELL_AURA_MOD_SPELL_POWER_PCT &AuraEffect::HandleNULL, //318 SPELL_AURA_MASTERY - &AuraEffect::HandleNULL, //319 SPELL_AURA_319 + &AuraEffect::HandleModMeleeSpeedPct, //319 SPELL_AURA_MOD_MELEE_HASTE_3 &AuraEffect::HandleNULL, //320 SPELL_AURA_MOD_RANGED_ATTACK_SPEED &AuraEffect::HandleNULL, //321 SPELL_AURA_321 &AuraEffect::HandleNULL, //322 SPELL_AURA_INTERFERE_TARGETTING @@ -395,7 +395,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleNULL, //339 SPELL_AURA_INCREASE_SKILL_GAIN_CHANCE &AuraEffect::HandleNULL, //340 SPELL_AURA_340 &AuraEffect::HandleNULL, //341 SPELL_AURA_341 - &AuraEffect::HandleNULL, //342 SPELL_AURA_MOD_TIME_BETWEEN_ATTACKS + &AuraEffect::HandleModMeleeRangedSpeedPct, //342 SPELL_AURA_MOD_MELEE_RANGED_HASTE_2 &AuraEffect::HandleNULL, //343 SPELL_AURA_343 &AuraEffect::HandleNULL, //344 SPELL_AURA_MOD_AUTOATTACK_DAMAGE &AuraEffect::HandleNULL, //345 SPELL_AURA_BYPASS_ARMOR_FOR_CASTER @@ -4473,6 +4473,7 @@ void AuraEffect::HandleModMeleeRangedSpeedPct(AuraApplication const* aurApp, uin if (!(mode & (AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK | AURA_EFFECT_HANDLE_STAT))) return; + //! ToDo: Haste auras with the same handler _CAN'T_ stack together Unit* target = aurApp->GetTarget(); target->ApplyAttackTimePercentMod(BASE_ATTACK, (float)GetAmount(), apply); @@ -4509,6 +4510,7 @@ void AuraEffect::HandleModMeleeSpeedPct(AuraApplication const* aurApp, uint8 mod if (!(mode & (AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK | AURA_EFFECT_HANDLE_STAT))) return; + //! ToDo: Haste auras with the same handler _CAN'T_ stack together Unit* target = aurApp->GetTarget(); target->ApplyAttackTimePercentMod(BASE_ATTACK, (float)GetAmount(), apply); -- cgit v1.2.3 From 7e2c8f5ed9bb431211fa9850e6b62ee957b9167c Mon Sep 17 00:00:00 2001 From: Subv Date: Fri, 17 Aug 2012 20:57:39 -0500 Subject: Core/Spells: Fixed some auras --- src/server/game/Entities/Unit/Unit.cpp | 3 +++ src/server/game/Spells/Auras/SpellAuraDefines.h | 10 +++++----- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 3 ++- 3 files changed, 10 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 7bb796cdb37..34a0528f6ec 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -9449,6 +9449,9 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin if (victim->HasAuraState(AuraStateType((*i)->GetMiscValue()))) AddPctN(DoneTotalMod, (*i)->GetAmount()); + // Add SPELL_AURA_MOD_DAMAGE_DONE_FOR_MECHANIC percent bonus + AddPctN(DoneTotalMod, GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_DAMAGE_DONE_FOR_MECHANIC, spellProto->Mechanic)); + // done scripted mod (take it from owner) Unit* owner = GetOwner() ? GetOwner() : this; AuraEffectList const& mOverrideClassScript= owner->GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS); diff --git a/src/server/game/Spells/Auras/SpellAuraDefines.h b/src/server/game/Spells/Auras/SpellAuraDefines.h index 4be9f7c807b..b69f4b20b51 100755 --- a/src/server/game/Spells/Auras/SpellAuraDefines.h +++ b/src/server/game/Spells/Auras/SpellAuraDefines.h @@ -335,7 +335,7 @@ enum AuraType SPELL_AURA_X_RAY = 273, SPELL_AURA_ABILITY_CONSUME_NO_AMMO = 274, SPELL_AURA_MOD_IGNORE_SHAPESHIFT = 275, - SPELL_AURA_MOD_DAMAGE_DONE_FOR_MECHANIC = 276, // NYI + SPELL_AURA_MOD_DAMAGE_DONE_FOR_MECHANIC = 276, SPELL_AURA_MOD_MAX_AFFECTED_TARGETS = 277, SPELL_AURA_MOD_DISARM_RANGED = 278, SPELL_AURA_INITIALIZE_IMAGES = 279, @@ -371,7 +371,7 @@ enum AuraType SPELL_AURA_309 = 309, SPELL_AURA_MOD_CREATURE_AOE_DAMAGE_AVOIDANCE = 310, SPELL_AURA_311 = 311, - SPELL_AURA_312 = 312, + SPELL_AURA_312 = 312, // puts the caster in stealth? SPELL_AURA_313 = 313, SPELL_AURA_PREVENT_RESURRECTION = 314, SPELL_AURA_UNDERWATER_WALKING = 315, @@ -379,7 +379,7 @@ enum AuraType SPELL_AURA_MOD_SPELL_POWER_PCT = 317, SPELL_AURA_MASTERY = 318, SPELL_AURA_MOD_MELEE_HASTE_3 = 319, - SPELL_AURA_MOD_RANGED_ATTACK_SPEED = 320, // NYI + SPELL_AURA_MOD_RANGED_HASTE_2 = 320, SPELL_AURA_321 = 321, SPELL_AURA_INTERFERE_TARGETTING = 322, // NYI SPELL_AURA_323 = 323, @@ -391,8 +391,8 @@ enum AuraType SPELL_AURA_MOD_RUNE_REGEN_SPEED = 329, // NYI SPELL_AURA_CAST_WHILE_WALKING = 330, // NYI SPELL_AURA_331 = 331, - SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS = 332, // NYI - SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS_2 = 333, // NYI + SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS = 332, + SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS_2 = 333, SPELL_AURA_334 = 334, SPELL_AURA_335 = 335, SPELL_AURA_MOD_FLYING_RESTRICTIONS = 336, // NYI diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 3698e91e280..2c9f8773fd5 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -373,7 +373,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleNULL, //317 SPELL_AURA_MOD_SPELL_POWER_PCT &AuraEffect::HandleNULL, //318 SPELL_AURA_MASTERY &AuraEffect::HandleModMeleeSpeedPct, //319 SPELL_AURA_MOD_MELEE_HASTE_3 - &AuraEffect::HandleNULL, //320 SPELL_AURA_MOD_RANGED_ATTACK_SPEED + &AuraEffect::HandleAuraModRangedHaste, //320 SPELL_AURA_MOD_RANGED_HASTE_2 &AuraEffect::HandleNULL, //321 SPELL_AURA_321 &AuraEffect::HandleNULL, //322 SPELL_AURA_INTERFERE_TARGETTING &AuraEffect::HandleNULL, //323 SPELL_AURA_323 @@ -4522,6 +4522,7 @@ void AuraEffect::HandleAuraModRangedHaste(AuraApplication const* aurApp, uint8 m if (!(mode & (AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK | AURA_EFFECT_HANDLE_STAT))) return; + //! ToDo: Haste auras with the same handler _CAN'T_ stack together Unit* target = aurApp->GetTarget(); target->ApplyAttackTimePercentMod(RANGED_ATTACK, (float)GetAmount(), apply); -- cgit v1.2.3 From b55537e510d1d1a1363b4c1c87431523c6822a1e Mon Sep 17 00:00:00 2001 From: Subv Date: Fri, 17 Aug 2012 21:12:10 -0500 Subject: Core/Spells: Cleanup some old code --- src/server/game/Entities/Unit/Unit.cpp | 32 ------------------ src/server/game/Spells/Auras/SpellAuraDefines.h | 10 +++--- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 40 +++++------------------ src/server/game/Spells/Auras/SpellAuraEffects.h | 1 - src/server/game/Spells/Spell.cpp | 22 ------------- 5 files changed, 14 insertions(+), 91 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 34a0528f6ec..eb81c372705 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -2422,26 +2422,6 @@ SpellMissInfo Unit::MagicSpellHitResult(Unit* victim, SpellInfo const* spell) int32 resist_chance = victim->GetMechanicResistChance(spell) * 100; tmp += resist_chance; - // Chance resist debuff - if (!spell->IsPositive()) - { - bool bNegativeAura = true; - for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) - { - if (spell->Effects[i].ApplyAuraName == 0) - { - bNegativeAura = false; - break; - } - } - - if (bNegativeAura) - { - tmp += victim->GetMaxPositiveAuraModifierByMiscValue(SPELL_AURA_MOD_DEBUFF_RESISTANCE, int32(spell->Dispel)) * 100; - tmp += victim->GetMaxNegativeAuraModifierByMiscValue(SPELL_AURA_MOD_DEBUFF_RESISTANCE, int32(spell->Dispel)) * 100; - } - } - // Roll chance if (rand < tmp) return SPELL_MISS_RESIST; @@ -10238,18 +10218,6 @@ uint32 Unit::SpellHealingBonusTaken(Unit* caster, SpellInfo const* spellProto, u TakenTotalMod *= 1.2f; } - if (damagetype == DOT) - { - // Healing over time taken percent - float minval_hot = float(GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HOT_PCT)); - if (minval_hot) - AddPctF(TakenTotalMod, minval_hot); - - float maxval_hot = float(GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HOT_PCT)); - if (maxval_hot) - AddPctF(TakenTotalMod, maxval_hot); - } - // Check for table values SpellBonusEntry const* bonus = sSpellMgr->GetSpellBonusData(spellProto->Id); float coeff = 0; diff --git a/src/server/game/Spells/Auras/SpellAuraDefines.h b/src/server/game/Spells/Auras/SpellAuraDefines.h index b69f4b20b51..7cf22d196cc 100755 --- a/src/server/game/Spells/Auras/SpellAuraDefines.h +++ b/src/server/game/Spells/Auras/SpellAuraDefines.h @@ -200,7 +200,7 @@ enum AuraType SPELL_AURA_MOD_MELEE_HASTE = 138, SPELL_AURA_FORCE_REACTION = 139, SPELL_AURA_MOD_RANGED_HASTE = 140, - SPELL_AURA_MOD_RANGED_AMMO_HASTE = 141, + SPELL_AURA_141 = 141, // old SPELL_AURA_MOD_RANGED_AMMO_HASTE, unused now SPELL_AURA_MOD_BASE_RESISTANCE_PCT = 142, SPELL_AURA_MOD_RESISTANCE_EXCLUSIVE = 143, SPELL_AURA_SAFE_FALL = 144, @@ -237,7 +237,7 @@ enum AuraType SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT = 175, SPELL_AURA_SPIRIT_OF_REDEMPTION = 176, SPELL_AURA_AOE_CHARM = 177, - SPELL_AURA_MOD_DEBUFF_RESISTANCE = 178, + SPELL_AURA_178 = 178, // old SPELL_AURA_MOD_DEBUFF_RESISTANCE, unused SPELL_AURA_MOD_ATTACKER_SPELL_CRIT_CHANCE = 179, SPELL_AURA_MOD_FLAT_SPELL_DAMAGE_VERSUS = 180, SPELL_AURA_181 = 181, // old SPELL_AURA_MOD_FLAT_SPELL_CRIT_DAMAGE_VERSUS - possible flat spell crit damage versus @@ -296,7 +296,7 @@ enum AuraType SPELL_AURA_MECHANIC_DURATION_MOD_NOT_STACK = 234, SPELL_AURA_MOD_DISPEL_RESIST = 235, SPELL_AURA_CONTROL_VEHICLE = 236, - SPELL_AURA_MOD_SPELL_DAMAGE_OF_ATTACK_POWER = 237, + SPELL_AURA_MOD_SPELL_DAMAGE_OF_ATTACK_POWER = 237, SPELL_AURA_MOD_SPELL_HEALING_OF_ATTACK_POWER = 238, SPELL_AURA_MOD_SCALE_2 = 239, SPELL_AURA_MOD_EXPERTISE = 240, @@ -318,7 +318,7 @@ enum AuraType SPELL_AURA_NO_REAGENT_USE = 256, SPELL_AURA_MOD_TARGET_RESIST_BY_SPELL_CLASS = 257, SPELL_AURA_258 = 258, - SPELL_AURA_MOD_HOT_PCT = 259, + SPELL_AURA_259 = 259, // old SPELL_AURA_MOD_HOT_PCT, unused 4.3.4 SPELL_AURA_SCREEN_EFFECT = 260, SPELL_AURA_PHASE = 261, SPELL_AURA_ABILITY_IGNORE_AURASTATE = 262, @@ -333,7 +333,7 @@ enum AuraType SPELL_AURA_MOD_DAMAGE_FROM_CASTER = 271, SPELL_AURA_IGNORE_MELEE_RESET = 272, SPELL_AURA_X_RAY = 273, - SPELL_AURA_ABILITY_CONSUME_NO_AMMO = 274, + SPELL_AURA_274 = 274, // old SPELL_AURA_ABILITY_CONSUME_NO_AMMO, unused now SPELL_AURA_MOD_IGNORE_SHAPESHIFT = 275, SPELL_AURA_MOD_DAMAGE_DONE_FOR_MECHANIC = 276, SPELL_AURA_MOD_MAX_AFFECTED_TARGETS = 277, diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 2c9f8773fd5..c50c883dead 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -172,7 +172,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleNoImmediateEffect, //116 SPELL_AURA_MOD_REGEN_DURING_COMBAT &AuraEffect::HandleNoImmediateEffect, //117 SPELL_AURA_MOD_MECHANIC_RESISTANCE implemented in Unit::MagicSpellHitResult &AuraEffect::HandleNoImmediateEffect, //118 SPELL_AURA_MOD_HEALING_PCT implemented in Unit::SpellHealingBonus - &AuraEffect::HandleNULL, //119 unused (3.2.0) old SPELL_AURA_SHARE_PET_TRACKING + &AuraEffect::HandleUnused, //119 unused (3.2.0) old SPELL_AURA_SHARE_PET_TRACKING &AuraEffect::HandleAuraUntrackable, //120 SPELL_AURA_UNTRACKABLE &AuraEffect::HandleAuraEmpathy, //121 SPELL_AURA_EMPATHY &AuraEffect::HandleModOffhandDamagePercent, //122 SPELL_AURA_MOD_OFFHAND_DAMAGE_PCT @@ -194,7 +194,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleModMeleeSpeedPct, //138 SPELL_AURA_MOD_MELEE_HASTE &AuraEffect::HandleForceReaction, //139 SPELL_AURA_FORCE_REACTION &AuraEffect::HandleAuraModRangedHaste, //140 SPELL_AURA_MOD_RANGED_HASTE - &AuraEffect::HandleRangedAmmoHaste, //141 SPELL_AURA_MOD_RANGED_AMMO_HASTE + &AuraEffect::HandleUnused, //141 SPELL_AURA_141 &AuraEffect::HandleAuraModBaseResistancePCT, //142 SPELL_AURA_MOD_BASE_RESISTANCE_PCT &AuraEffect::HandleAuraModResistanceExclusive, //143 SPELL_AURA_MOD_RESISTANCE_EXCLUSIVE &AuraEffect::HandleNoImmediateEffect, //144 SPELL_AURA_SAFE_FALL implemented in WorldSession::HandleMovementOpcodes @@ -226,15 +226,15 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleNULL, //170 SPELL_AURA_DETECT_AMORE various spells that change visual of units for aura target (clientside?) &AuraEffect::HandleAuraModIncreaseSpeed, //171 SPELL_AURA_MOD_SPEED_NOT_STACK &AuraEffect::HandleAuraModIncreaseMountedSpeed, //172 SPELL_AURA_MOD_MOUNTED_SPEED_NOT_STACK - &AuraEffect::HandleNULL, //173 unused (3.2.0) no spells, old SPELL_AURA_ALLOW_CHAMPION_SPELLS only for Proclaim Champion spell + &AuraEffect::HandleUnused, //173 unused (3.2.0) no spells, old SPELL_AURA_ALLOW_CHAMPION_SPELLS only for Proclaim Champion spell &AuraEffect::HandleModSpellDamagePercentFromStat, //174 SPELL_AURA_MOD_SPELL_DAMAGE_OF_STAT_PERCENT implemented in Unit::SpellBaseDamageBonus &AuraEffect::HandleModSpellHealingPercentFromStat, //175 SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT implemented in Unit::SpellBaseHealingBonus &AuraEffect::HandleSpiritOfRedemption, //176 SPELL_AURA_SPIRIT_OF_REDEMPTION only for Spirit of Redemption spell, die at aura end &AuraEffect::HandleCharmConvert, //177 SPELL_AURA_AOE_CHARM - &AuraEffect::HandleNoImmediateEffect, //178 SPELL_AURA_MOD_DEBUFF_RESISTANCE implemented in Unit::MagicSpellHitResult + &AuraEffect::HandleUnused, //178 old SPELL_AURA_MOD_DEBUFF_RESISTANCE unused 4.3.4 &AuraEffect::HandleNoImmediateEffect, //179 SPELL_AURA_MOD_ATTACKER_SPELL_CRIT_CHANCE implemented in Unit::SpellCriticalBonus &AuraEffect::HandleNoImmediateEffect, //180 SPELL_AURA_MOD_FLAT_SPELL_DAMAGE_VERSUS implemented in Unit::SpellDamageBonus - &AuraEffect::HandleNULL, //181 unused (3.2.0) old SPELL_AURA_MOD_FLAT_SPELL_CRIT_DAMAGE_VERSUS + &AuraEffect::HandleUnused, //181 unused (3.2.0) old SPELL_AURA_MOD_FLAT_SPELL_CRIT_DAMAGE_VERSUS &AuraEffect::HandleAuraModResistenceOfStatPercent, //182 SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT &AuraEffect::HandleNULL, //183 SPELL_AURA_MOD_CRITICAL_THREAT only used in 28746 - miscvalue - spell school &AuraEffect::HandleNoImmediateEffect, //184 SPELL_AURA_MOD_ATTACKER_MELEE_HIT_CHANCE implemented in Unit::RollMeleeOutcomeAgainst @@ -251,7 +251,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleNoImmediateEffect, //195 SPELL_AURA_MOD_TARGET_ABILITY_ABSORB_SCHOOL implemented in Unit::CalcAbsorbResist &AuraEffect::HandleNULL, //196 SPELL_AURA_MOD_COOLDOWN - flat mod of spell cooldowns &AuraEffect::HandleNoImmediateEffect, //197 SPELL_AURA_MOD_ATTACKER_SPELL_AND_WEAPON_CRIT_CHANCE implemented in Unit::SpellCriticalBonus Unit::GetUnitCriticalChance - &AuraEffect::HandleNULL, //198 unused (3.2.0) old SPELL_AURA_MOD_ALL_WEAPON_SKILLS + &AuraEffect::HandleUnused, //198 unused (3.2.0) old SPELL_AURA_MOD_ALL_WEAPON_SKILLS &AuraEffect::HandleNoImmediateEffect, //199 SPELL_AURA_MOD_INCREASES_SPELL_PCT_TO_HIT implemented in Unit::MagicSpellHitResult &AuraEffect::HandleNoImmediateEffect, //200 SPELL_AURA_MOD_XP_PCT implemented in Player::RewardPlayerAndGroupAtKill &AuraEffect::HandleAuraAllowFlight, //201 SPELL_AURA_FLY this aura enable flight mode... @@ -277,7 +277,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleNULL, //221 SPELL_AURA_MOD_DETAUNT &AuraEffect::HandleUnused, //222 unused (3.2.0) only for spell 44586 that not used in real spell cast &AuraEffect::HandleNoImmediateEffect, //223 SPELL_AURA_RAID_PROC_FROM_CHARGE - &AuraEffect::HandleUnused, //224 unused (3.0.8a) + &AuraEffect::HandleUnused, //224 unused (4.3.4) &AuraEffect::HandleNoImmediateEffect, //225 SPELL_AURA_RAID_PROC_FROM_CHARGE_WITH_VALUE &AuraEffect::HandleNoImmediateEffect, //226 SPELL_AURA_PERIODIC_DUMMY implemented in AuraEffect::PeriodicTick &AuraEffect::HandleNoImmediateEffect, //227 SPELL_AURA_PERIODIC_TRIGGER_SPELL_WITH_VALUE implemented in AuraEffect::PeriodicTick @@ -312,7 +312,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleNoReagentUseAura, //256 SPELL_AURA_NO_REAGENT_USE Use SpellClassMask for spell select &AuraEffect::HandleNULL, //257 SPELL_AURA_MOD_TARGET_RESIST_BY_SPELL_CLASS Use SpellClassMask for spell select &AuraEffect::HandleNULL, //258 SPELL_AURA_MOD_SPELL_VISUAL - &AuraEffect::HandleNoImmediateEffect, //259 SPELL_AURA_MOD_HOT_PCT implemented in Unit::SpellHealingBonus + &AuraEffect::HandleUnused, //259 SPELL_AURA_MOD_HOT_PCT implemented in Unit::SpellHealingBonus &AuraEffect::HandleNoImmediateEffect, //260 SPELL_AURA_SCREEN_EFFECT (miscvalue = id in ScreenEffect.dbc) not required any code &AuraEffect::HandlePhase, //261 SPELL_AURA_PHASE &AuraEffect::HandleNoImmediateEffect, //262 SPELL_AURA_ABILITY_IGNORE_AURASTATE implemented in spell::cancast @@ -327,7 +327,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleNoImmediateEffect, //271 SPELL_AURA_MOD_DAMAGE_FROM_CASTER implemented in Unit::SpellDamageBonus &AuraEffect::HandleNoImmediateEffect, //272 SPELL_AURA_IGNORE_MELEE_RESET &AuraEffect::HandleUnused, //273 clientside - &AuraEffect::HandleNoImmediateEffect, //274 SPELL_AURA_CONSUME_NO_AMMO implemented in spell::CalculateDamageDoneForAllTargets + &AuraEffect::HandleUnused, //274 unused (4.3.4) &AuraEffect::HandleNoImmediateEffect, //275 SPELL_AURA_MOD_IGNORE_SHAPESHIFT Use SpellClassMask for spell select &AuraEffect::HandleNULL, //276 mod damage % mechanic? &AuraEffect::HandleNoImmediateEffect, //277 SPELL_AURA_MOD_ABILITY_AFFECTED_TARGETS implemented in spell::settargetmap @@ -4528,19 +4528,6 @@ void AuraEffect::HandleAuraModRangedHaste(AuraApplication const* aurApp, uint8 m target->ApplyAttackTimePercentMod(RANGED_ATTACK, (float)GetAmount(), apply); } -void AuraEffect::HandleRangedAmmoHaste(AuraApplication const* aurApp, uint8 mode, bool apply) const -{ - if (!(mode & (AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK | AURA_EFFECT_HANDLE_STAT))) - return; - - Unit* target = aurApp->GetTarget(); - - if (target->GetTypeId() != TYPEID_PLAYER) - return; - - target->ApplyAttackTimePercentMod(RANGED_ATTACK, (float)GetAmount(), apply); -} - /********************************/ /*** COMBAT RATING ***/ /********************************/ @@ -6454,15 +6441,6 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const if (maxval) AddPctF(TakenTotalMod, maxval); - // Healing over time taken percent - float minval_hot = (float)target->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HOT_PCT); - if (minval_hot) - AddPctF(TakenTotalMod, minval_hot); - - float maxval_hot = (float)target->GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HOT_PCT); - if (maxval_hot) - AddPctF(TakenTotalMod, maxval_hot); - TakenTotalMod = std::max(TakenTotalMod, 0.0f); damage = uint32(target->CountPctFromMaxHealth(damage)); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.h b/src/server/game/Spells/Auras/SpellAuraEffects.h index 28a5beafa2c..c85bfb7c9af 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.h +++ b/src/server/game/Spells/Auras/SpellAuraEffects.h @@ -242,7 +242,6 @@ class AuraEffect void HandleModAttackSpeed(AuraApplication const* aurApp, uint8 mode, bool apply) const; void HandleModMeleeSpeedPct(AuraApplication const* aurApp, uint8 mode, bool apply) const; void HandleAuraModRangedHaste(AuraApplication const* aurApp, uint8 mode, bool apply) const; - void HandleRangedAmmoHaste(AuraApplication const* aurApp, uint8 mode, bool apply) const; // combat rating void HandleModRating(AuraApplication const* aurApp, uint8 mode, bool apply) const; void HandleModRatingFromStat(AuraApplication const* aurApp, uint8 mode, bool apply) const; diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 6a62b143abc..534102cdf46 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -2576,25 +2576,9 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA // disable effects to which unit is immune SpellMissInfo returnVal = SPELL_MISS_IMMUNE; for (uint32 effectNumber = 0; effectNumber < MAX_SPELL_EFFECTS; ++effectNumber) - { if (effectMask & (1 << effectNumber)) - { if (unit->IsImmunedToSpellEffect(m_spellInfo, effectNumber)) effectMask &= ~(1 << effectNumber); - else if (m_spellInfo->Effects[effectNumber].IsAura() && !m_spellInfo->IsPositiveEffect(effectNumber)) - { - int32 debuff_resist_chance = unit->GetMaxPositiveAuraModifierByMiscValue(SPELL_AURA_MOD_DEBUFF_RESISTANCE, int32(m_spellInfo->Dispel)); - debuff_resist_chance += unit->GetMaxNegativeAuraModifierByMiscValue(SPELL_AURA_MOD_DEBUFF_RESISTANCE, int32(m_spellInfo->Dispel)); - - if (debuff_resist_chance > 0) - if (irand(0,10000) <= (debuff_resist_chance * 100)) - { - effectMask &= ~(1 << effectNumber); - returnVal = SPELL_MISS_RESIST; - } - } - } - } if (!effectMask) return returnVal; @@ -6647,12 +6631,6 @@ void Spell::HandleLaunchPhase() multiplier[i] = m_spellInfo->Effects[i].CalcDamageMultiplier(m_originalCaster, this); bool usesAmmo = m_spellInfo->AttributesCu & SPELL_ATTR0_CU_DIRECT_DAMAGE; - Unit::AuraEffectList const& Auras = m_caster->GetAuraEffectsByType(SPELL_AURA_ABILITY_CONSUME_NO_AMMO); - for (Unit::AuraEffectList::const_iterator j = Auras.begin(); j != Auras.end(); ++j) - { - if ((*j)->IsAffectingSpell(m_spellInfo)) - usesAmmo=false; - } for (std::list::iterator ihit= m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit) { -- cgit v1.2.3 From 60e28bbc3436e64b879f68e78a546ddda9697f9b Mon Sep 17 00:00:00 2001 From: Tuxity Date: Sat, 18 Aug 2012 12:04:52 +0200 Subject: Core/Spells: Fix warlock banes and curses. --- src/server/game/Spells/SpellInfo.cpp | 5 +++++ src/server/game/Spells/SpellInfo.h | 2 ++ 2 files changed, 7 insertions(+) (limited to 'src') diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 1220601edd6..df22b10e533 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -1341,6 +1341,7 @@ bool SpellInfo::IsAuraExclusiveBySpecificPerCasterWith(SpellInfo const* spellInf case SPELL_SPECIFIC_AURA: case SPELL_SPECIFIC_STING: case SPELL_SPECIFIC_CURSE: + case SPELL_SPECIFIC_BANE: case SPELL_SPECIFIC_ASPECT: case SPELL_SPECIFIC_JUDGEMENT: case SPELL_SPECIFIC_WARLOCK_CORRUPTION: @@ -1953,6 +1954,10 @@ SpellSpecificType SpellInfo::GetSpellSpecific() const if (Dispel == DISPEL_CURSE) return SPELL_SPECIFIC_CURSE; + // Warlock (Bane of Doom | Bane of Agony | Bane of Havoc) + if (Id == 603 || Id == 980 || Id == 80240) + return SPELL_SPECIFIC_BANE; + // Warlock (Demon Armor | Demon Skin | Fel Armor) if (SpellFamilyFlags[1] & 0x20000020 || SpellFamilyFlags[2] & 0x00000010) return SPELL_SPECIFIC_WARLOCK_ARMOR; diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h index 2fb0234997c..9387ad750a0 100644 --- a/src/server/game/Spells/SpellInfo.h +++ b/src/server/game/Spells/SpellInfo.h @@ -166,6 +166,8 @@ enum SpellSpecificType SPELL_SPECIFIC_WARRIOR_ENRAGE = 26, SPELL_SPECIFIC_PRIEST_DIVINE_SPIRIT = 27, SPELL_SPECIFIC_HAND = 28, + SPELL_SPECIFIC_PHASE = 29, + SPELL_SPECIFIC_BANE = 30, }; enum SpellCustomAttributes -- cgit v1.2.3 From 819d79075e733a89009f60771bde0c272b8fc512 Mon Sep 17 00:00:00 2001 From: zorix Date: Sat, 18 Aug 2012 15:43:05 +0200 Subject: Core/Spells: Check for Bane spells should be before check curse because Bane have dispel type Curse --- src/server/game/Spells/SpellInfo.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index df22b10e533..d71de9e94e0 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -1950,14 +1950,14 @@ SpellSpecificType SpellInfo::GetSpellSpecific() const } case SPELLFAMILY_WARLOCK: { - // only warlock curses have this - if (Dispel == DISPEL_CURSE) - return SPELL_SPECIFIC_CURSE; - // Warlock (Bane of Doom | Bane of Agony | Bane of Havoc) if (Id == 603 || Id == 980 || Id == 80240) return SPELL_SPECIFIC_BANE; + // only warlock curses have this + if (Dispel == DISPEL_CURSE) + return SPELL_SPECIFIC_CURSE; + // Warlock (Demon Armor | Demon Skin | Fel Armor) if (SpellFamilyFlags[1] & 0x20000020 || SpellFamilyFlags[2] & 0x00000010) return SPELL_SPECIFIC_WARLOCK_ARMOR; -- cgit v1.2.3 From c5929fa09137cab1f6b322b0aaef8fa148c00ed9 Mon Sep 17 00:00:00 2001 From: Subv Date: Sat, 18 Aug 2012 09:16:44 -0500 Subject: Core/Spells: Removed more deprecated spells code --- src/server/game/Entities/Unit/Unit.cpp | 77 +++------------------------------- 1 file changed, 5 insertions(+), 72 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index eb81c372705..3b94508b643 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -10552,80 +10552,13 @@ uint32 Unit::MeleeDamageBonusDone(Unit* victim, uint32 pdamage, WeaponAttackType if (victim->HasAuraState(AuraStateType((*i)->GetMiscValue()))) AddPctN(DoneTotalMod, (*i)->GetAmount()); + // Add SPELL_AURA_MOD_DAMAGE_DONE_FOR_MECHANIC percent bonus + if (spellProto) + AddPctN(DoneTotalMod, GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_DAMAGE_DONE_FOR_MECHANIC, spellProto->Mechanic)); + // done scripted mod (take it from owner) Unit* owner = GetOwner() ? GetOwner() : this; - AuraEffectList const& mOverrideClassScript = owner->GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS); - for (AuraEffectList::const_iterator i = mOverrideClassScript.begin(); i != mOverrideClassScript.end(); ++i) - { - if (!(*i)->IsAffectingSpell(spellProto)) - continue; - - switch ((*i)->GetMiscValue()) - { - // Tundra Stalker - // Merciless Combat - case 7277: - { - // Merciless Combat - if ((*i)->GetSpellInfo()->SpellIconID == 2656) - { - if (!victim->HealthAbovePct(35)) - AddPctN(DoneTotalMod, (*i)->GetAmount()); - } - // Tundra Stalker - else - { - // Frost Fever (target debuff) - if (victim->HasAura(55095)) - AddPctN(DoneTotalMod, (*i)->GetAmount()); - } - break; - } - // Rage of Rivendare - case 7293: - { - if (victim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DEATHKNIGHT, 0, 0x02000000, 0)) - AddPctF(DoneTotalMod, (*i)->GetSpellInfo()->GetRank() * 2.0f); - break; - } - // Marked for Death - case 7598: - case 7599: - case 7600: - case 7601: - case 7602: - { - if (victim->GetAuraEffect(SPELL_AURA_MOD_STALKED, SPELLFAMILY_HUNTER, 0x400, 0, 0)) - AddPctN(DoneTotalMod, (*i)->GetAmount()); - break; - } - // Dirty Deeds - case 6427: - case 6428: - { - if (victim->HasAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, spellProto, this)) - { - // effect 0 has expected value but in negative state - int32 bonus = -(*i)->GetBase()->GetEffect(0)->GetAmount(); - AddPctN(DoneTotalMod, bonus); - } - break; - } - } - } - - // Custom scripted damage - if (spellProto) - switch (spellProto->SpellFamilyName) - { - case SPELLFAMILY_DEATHKNIGHT: - // Glacier Rot - if (spellProto->SpellFamilyFlags[0] & 0x2 || spellProto->SpellFamilyFlags[1] & 0x6) - if (AuraEffect* aurEff = GetDummyAuraEffect(SPELLFAMILY_DEATHKNIGHT, 196, 0)) - if (victim->GetDiseasesByCaster(owner->GetGUID()) > 0) - AddPctN(DoneTotalMod, aurEff->GetAmount()); - break; - } + // AuraEffectList const& mOverrideClassScript = owner->GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS); float tmpDamage = float(int32(pdamage) + DoneFlatBenefit) * DoneTotalMod; -- cgit v1.2.3 From aa5949ff1a3ac9f4833535bfdbf1ab7d44711c12 Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 18 Aug 2012 15:18:35 +0100 Subject: Core/Loading: Do not validate fields QuestGiverPortrait nor QuestTurnInPortrait These fields do not have to exist server-side --- src/server/game/Globals/ObjectMgr.cpp | 28 ---------------------------- 1 file changed, 28 deletions(-) (limited to 'src') diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index a8319ee274f..b1566fd3fb1 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -4143,48 +4143,20 @@ void ObjectMgr::LoadQuests() } } - if (qinfo->QuestGiverPortrait) - { - if (!sObjectMgr->GetCreatureTemplate(qinfo->QuestGiverPortrait)) - { - sLog->outError(LOG_FILTER_SQL, "Quest %u has `QuestGiverPortrait` = %u but creature with entry %u does not exist, quest can't be done.", - qinfo->GetQuestId(), qinfo->QuestGiverPortrait, qinfo->QuestGiverPortrait); - qinfo->QuestGiverPortrait = 0; - } - } - - if (qinfo->QuestTurnInPortrait) - { - if (!sObjectMgr->GetCreatureTemplate(qinfo->QuestTurnInPortrait)) - { - sLog->outError(LOG_FILTER_SQL, "Quest %u has `QuestTurnInPortrait` = %u but creature with entry %u does not exist, quest can't be done.", - qinfo->GetQuestId(), qinfo->QuestTurnInPortrait, qinfo->QuestTurnInPortrait); - qinfo->QuestTurnInPortrait = 0; - } - } - - - // fill additional data stores if (qinfo->PrevQuestId) { if (_questTemplates.find(abs(qinfo->GetPrevQuestId())) == _questTemplates.end()) - { sLog->outError(LOG_FILTER_SQL, "Quest %d has PrevQuestId %i, but no such quest", qinfo->GetQuestId(), qinfo->GetPrevQuestId()); - } else - { qinfo->prevQuests.push_back(qinfo->PrevQuestId); - } } if (qinfo->NextQuestId) { QuestMap::iterator qNextItr = _questTemplates.find(abs(qinfo->GetNextQuestId())); if (qNextItr == _questTemplates.end()) - { sLog->outError(LOG_FILTER_SQL, "Quest %d has NextQuestId %i, but no such quest", qinfo->GetQuestId(), qinfo->GetNextQuestId()); - } else { int32 signedQuestId = qinfo->NextQuestId < 0 ? -int32(qinfo->GetQuestId()) : int32(qinfo->GetQuestId()); -- cgit v1.2.3 From 622f68fd33efcc7b75178cf41a492430b1b93d09 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 18 Aug 2012 16:50:37 +0200 Subject: Core/Auras: Reverted part of f82851a3a8ff8dbebebe96a52b3148aa95768ca2 - that calculation is incorrect --- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 10 ++-------- src/server/game/Spells/Spell.cpp | 3 +++ 2 files changed, 5 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index c50c883dead..783b1609958 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -881,14 +881,8 @@ void AuraEffect::CalculatePeriodic(Unit* caster, bool create, bool load) caster->ModSpellCastTime(m_spellInfo, m_amplitude); } // and periodic time of auras affected by SPELL_AURA_PERIODIC_HASTE on player who have haste - else if ((caster->HasAuraTypeWithAffectMask(SPELL_AURA_PERIODIC_HASTE, m_spellInfo) || m_spellInfo->AttributesEx5 & SPELL_ATTR5_HASTE_AFFECT_DURATION) && caster->GetFloatValue(UNIT_MOD_CAST_SPEED) != 1.0f) - { - // Calculate number of ticks we must have - float ticks = GetBase()->GetDuration() / (m_amplitude / (1.0f + (1.0f - caster->GetFloatValue(UNIT_MOD_CAST_SPEED)))); - ticks = 0.5f + (float)(int)ticks; // round - - m_amplitude = GetBase()->GetDuration() / int32(ticks); - } + else if (caster->HasAuraTypeWithAffectMask(SPELL_AURA_PERIODIC_HASTE, m_spellInfo) || m_spellInfo->AttributesEx5 & SPELL_ATTR5_HASTE_AFFECT_DURATION) + m_amplitude = int32(m_amplitude * caster->GetFloatValue(UNIT_MOD_CAST_SPEED)); } } diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 534102cdf46..d62e969a43c 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -2719,6 +2719,9 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA if (m_spellInfo->AttributesEx5 & SPELL_ATTR5_HASTE_AFFECT_DURATION) m_originalCaster->ModSpellCastTime(aurSpellInfo, duration, this); } + // and duration of auras affected by SPELL_AURA_PERIODIC_HASTE + else if (m_originalCaster->HasAuraTypeWithAffectMask(SPELL_AURA_PERIODIC_HASTE, aurSpellInfo) || m_spellInfo->AttributesEx5 & SPELL_ATTR5_HASTE_AFFECT_DURATION) + duration = int32(duration * m_originalCaster->GetFloatValue(UNIT_MOD_CAST_SPEED)); if (duration != m_spellAura->GetMaxDuration()) { -- cgit v1.2.3 From 74620494b902e18735a00e65bedb747b0781cc30 Mon Sep 17 00:00:00 2001 From: Subv Date: Sat, 18 Aug 2012 09:54:44 -0500 Subject: Core/Entities: Update health bonus from stamina to use DBC values --- src/server/game/DataStores/DBCfmt.h | 2 +- src/server/game/Entities/Unit/StatSystem.cpp | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index 9c82497b15d..9f4d20358da 100755 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -67,7 +67,7 @@ const char GlyphSlotfmt[]="nii"; const char GtBarberShopCostBasefmt[]="xf"; const char GtCombatRatingsfmt[]="xf"; -const char GtOCTHpPerStaminafmt[]="xf"; +const char GtOCTHpPerStaminafmt[]="df"; const char GtChanceToMeleeCritBasefmt[]="xf"; const char GtChanceToMeleeCritfmt[]="xf"; const char GtChanceToSpellCritBasefmt[]="xf"; diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index d44feeecd08..bee6ae39a35 100755 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -225,12 +225,8 @@ void Player::UpdateArmor() float Player::GetHealthBonusFromStamina() { - float stamina = GetStat(STAT_STAMINA); - - float baseStam = stamina < 20 ? stamina : 20; - float moreStam = stamina - baseStam; - - return baseStam + (moreStam*10.0f); + gtOCTHpPerStaminaEntry const* hpBase = sGtOCTHpPerStaminaStore.LookupEntry((getClass() - 1) * GT_MAX_LEVEL + getLevel() - 1); + return GetStat(STAT_STAMINA) * hpBase->ratio; } float Player::GetManaBonusFromIntellect() -- cgit v1.2.3 From ad01e563631a5c481c16818d4a63443a29888545 Mon Sep 17 00:00:00 2001 From: Subv Date: Sat, 18 Aug 2012 10:17:51 -0500 Subject: Core/Entities: A little update to the Hp per stamina formula --- src/server/game/Entities/Player/Player.cpp | 8 ++++---- src/server/game/Entities/Unit/StatSystem.cpp | 13 ++++++++++--- 2 files changed, 14 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 947c8dab2c9..d6f148104b2 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -5820,13 +5820,13 @@ float Player::GetSpellCritFromIntellect() if (level > GT_MAX_LEVEL) level = GT_MAX_LEVEL; - GtChanceToSpellCritBaseEntry const* critBase = sGtChanceToSpellCritBaseStore.LookupEntry(pclass-1); - GtChanceToSpellCritEntry const* critRatio = sGtChanceToSpellCritStore.LookupEntry((pclass-1)*GT_MAX_LEVEL + level-1); + GtChanceToSpellCritBaseEntry const* critBase = sGtChanceToSpellCritBaseStore.LookupEntry(pclass - 1); + GtChanceToSpellCritEntry const* critRatio = sGtChanceToSpellCritStore.LookupEntry((pclass - 1) * GT_MAX_LEVEL + level - 1); if (critBase == NULL || critRatio == NULL) return 0.0f; - float crit=critBase->base + GetStat(STAT_INTELLECT)*critRatio->ratio; - return crit*100.0f; + float crit = critBase->base + GetStat(STAT_INTELLECT) * critRatio->ratio; + return crit * 100.0f; } float Player::GetRatingMultiplier(CombatRating cr) const diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index bee6ae39a35..9fc0ce049e5 100755 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -225,18 +225,25 @@ void Player::UpdateArmor() float Player::GetHealthBonusFromStamina() { + // Taken from PaperDollFrame.lua - 4.3.4.15595 gtOCTHpPerStaminaEntry const* hpBase = sGtOCTHpPerStaminaStore.LookupEntry((getClass() - 1) * GT_MAX_LEVEL + getLevel() - 1); - return GetStat(STAT_STAMINA) * hpBase->ratio; + + float stamina = GetStat(STAT_STAMINA); + float baseStam = std::min(20, stamina); + float moreStam = stamina - baseStam; + + return baseStam + moreStam * hpBase->ratio; } float Player::GetManaBonusFromIntellect() { + // Taken from PaperDollFrame.lua - 4.3.4.15595 float intellect = GetStat(STAT_INTELLECT); - float baseInt = intellect < 20 ? intellect : 20; + float baseInt = std::min(20, intellect); float moreInt = intellect - baseInt; - return baseInt + (moreInt*15.0f); + return baseInt + (moreInt * 15.0f); } void Player::UpdateMaxHealth() -- cgit v1.2.3 From 0d7b5d07c843829da027ae9ed7b2bf2165882418 Mon Sep 17 00:00:00 2001 From: Subv Date: Sat, 18 Aug 2012 10:54:42 -0500 Subject: Core/Entities: Update attack power calculation based on what's found on the client. --- src/server/game/DataStores/DBCStructure.h | 4 +- src/server/game/DataStores/DBCfmt.h | 2 +- src/server/game/Entities/Unit/StatSystem.cpp | 57 +++++----------------------- 3 files changed, 13 insertions(+), 50 deletions(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 1ca295fd7ba..f743b051ce8 100644 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -705,8 +705,8 @@ struct ChrClassesEntry //uint32 flags2; // 8 m_flags (0x08 HasRelicSlot) uint32 CinematicSequence; // 9 m_cinematicSequenceID uint32 expansion; // 10 m_required_expansion - //uint32 // 11 - //uint32 // 12 + uint32 APPerStrenth; // 11 + uint32 APPerAgility; // 12 //uint32 // 13 }; diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index 9f4d20358da..bdef905acfd 100755 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -39,7 +39,7 @@ const char CharStartOutfitEntryfmt[]="diiiiiiiiiiiiiiiiiiiiiiiiixxxxxxxxxxxxxxxx const char CharTitlesEntryfmt[]="nxsxix"; const char ChatChannelsEntryfmt[]="nixsx"; -const char ChrClassesEntryfmt[]="nixsxxxixiixxx"; +const char ChrClassesEntryfmt[]="nixsxxxixiiiix"; const char ChrRacesEntryfmt[]="nxixiixixxxxixsxxxxxixxx"; const char ChrClassesXPowerTypesfmt[]="nii"; diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index 9fc0ce049e5..f89a0a6b2fe 100755 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -277,6 +277,7 @@ void Player::UpdateAttackPowerAndDamage(bool ranged) float val2 = 0.0f; float level = float(getLevel()); + ChrClassesEntry const* entry = sChrClassesStore.LookupEntry(getClass()); UnitMods unitMod = ranged ? UNIT_MOD_ATTACK_POWER_RANGED : UNIT_MOD_ATTACK_POWER; uint16 index = UNIT_FIELD_ATTACK_POWER; @@ -300,53 +301,15 @@ void Player::UpdateAttackPowerAndDamage(bool ranged) } else { - switch (getClass()) - { - case CLASS_WARRIOR: - val2 = level * 3.0f + GetStat(STAT_STRENGTH) * 2.0f - 20.0f; - break; - case CLASS_PALADIN: - val2 = level * 3.0f + GetStat(STAT_STRENGTH) * 2.0f - 20.0f; - break; - case CLASS_DEATH_KNIGHT: - val2 = level * 3.0f + GetStat(STAT_STRENGTH) * 2.0f - 20.0f; - break; - case CLASS_ROGUE: - val2 = level * 2.0f + GetStat(STAT_STRENGTH) + GetStat(STAT_AGILITY) * 2.0f - 30.0f; - break; - case CLASS_HUNTER: - val2 = level * 2.0f + GetStat(STAT_STRENGTH) + GetStat(STAT_AGILITY) - 20.0f; - break; - case CLASS_SHAMAN: - val2 = level * 2.0f + GetStat(STAT_STRENGTH) + GetStat(STAT_AGILITY) * 2.0f - 30.0f; - break; - case CLASS_DRUID: - { - switch (GetShapeshiftForm()) - { - case FORM_CAT: - val2 = level * 3.0f + GetStat(STAT_STRENGTH) * 2.0f + GetStat(STAT_AGILITY) * 2.0f - 40.0f; - break; - case FORM_BEAR: - case FORM_DIREBEAR: - val2 = level * 3.0f + GetStat(STAT_STRENGTH) * 2.0f + GetStat(STAT_AGILITY) * 2.0f - 40.0f; - break; - default: - val2 = level * 3.0f + GetStat(STAT_STRENGTH) * 2.0f - 20.0f; - break; - } - break; - } - case CLASS_MAGE: - val2 = GetStat(STAT_STRENGTH) * 2.0f - 20.0f; - break; - case CLASS_PRIEST: - val2 = GetStat(STAT_STRENGTH) * 2.0f - 20.0f; - break; - case CLASS_WARLOCK: - val2 = GetStat(STAT_STRENGTH) * 2.0f - 20.0f; - break; - } + float strengthValue = std::max((GetStat(STAT_STRENGTH) - 10.0f) * entry->APPerStrenth, 0.0f); + float agilityValue = std::max((GetStat(STAT_AGILITY) - 10.0f) * entry->APPerAgility, 0.0f); + + SpellShapeshiftFormEntry const* form = sSpellShapeshiftFormStore.LookupEntry(GetShapeshiftForm()); + // Directly taken from client, SHAPESHIFT_FLAG_AP_FROM_STRENGTH ? + if (form && form->flags1 & 0x20) + agilityValue += std::max((GetStat(STAT_AGILITY) - 10.0f) * entry->APPerStrenth, 0.0f);; + + val2 = strengthValue + agilityValue; } SetModifierValue(unitMod, BASE_VALUE, val2); -- cgit v1.2.3 From 19bafce5b81ca8918da9933546741cd5f9b7b177 Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 18 Aug 2012 17:47:27 +0100 Subject: Core/Vendor: Verify if the player has enough currency when buying items/currency with extendedcost --- src/server/game/Entities/Player/Player.cpp | 42 +++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index d6f148104b2..62d5af6a598 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -21102,8 +21102,7 @@ bool Player::BuyCurrencyFromVendorSlot(uint64 vendorGuid, uint32 vendorSlot, uin return false; } - // item base price - for (uint8 i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i) + for (uint8 i = 0; i < MAX_ITEM_EXT_COST_ITEMS; ++i) { if (iece->RequiredItem[i] && !HasItemCount(iece->RequiredItem[i], (iece->RequiredItemCount[i] * count))) { @@ -21112,6 +21111,24 @@ bool Player::BuyCurrencyFromVendorSlot(uint64 vendorGuid, uint32 vendorSlot, uin } } + for (uint8 i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i) + { + CurrencyTypesEntry const* entry = sCurrencyTypesStore.LookupEntry(iece->RequiredCurrency[i]); + if (!entry) + { + SendBuyError(BUY_ERR_CANT_FIND_ITEM, NULL, currency, 0); + return false; + } + + uint32 precision = (entry->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? 100 : 1; + + if (iece->RequiredCurrency[i] && HasCurrency(iece->RequiredCurrency[i], (iece->RequiredCurrencyCount[i] * count) / precision)) + { + SendEquipError(EQUIP_ERR_VENDOR_MISSING_TURNINS, NULL, NULL); // error not verified for currencies + return false; + } + } + // check for personal arena rating requirement if (GetMaxPersonalArenaRatingRequirement(iece->RequiredArenaSlot) < iece->RequiredPersonalArenaRating) { @@ -21205,8 +21222,7 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32 return false; } - // item base price - for (uint8 i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i) + for (uint8 i = 0; i < MAX_ITEM_EXT_COST_ITEMS; ++i) { if (iece->RequiredItem[i] && !HasItemCount(iece->RequiredItem[i], (iece->RequiredItemCount[i] * count))) { @@ -21215,6 +21231,24 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32 } } + for (uint8 i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i) + { + CurrencyTypesEntry const* entry = sCurrencyTypesStore.LookupEntry(iece->RequiredCurrency[i]); + if (!entry) + { + SendBuyError(BUY_ERR_CANT_FIND_ITEM, NULL, currency, 0); + return false; + } + + uint32 precision = (entry->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? 100 : 1; + + if (iece->RequiredCurrency[i] && HasCurrency(iece->RequiredCurrency[i], (iece->RequiredCurrencyCount[i] * count) / precision)) + { + SendEquipError(EQUIP_ERR_VENDOR_MISSING_TURNINS, NULL, NULL); // error not verified for currencies + return false; + } + } + // check for personal arena rating requirement if (GetMaxPersonalArenaRatingRequirement(iece->RequiredArenaSlot) < iece->RequiredPersonalArenaRating) { -- cgit v1.2.3 From c43bba98a3f674d81887ea9751c233e98c58326d Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 18 Aug 2012 17:56:09 +0100 Subject: Core: Fix build and cleanup whitespace and double semicolon --- src/server/game/Entities/Player/Player.cpp | 16 +++++++++++----- src/server/game/Entities/Unit/StatSystem.cpp | 14 +++++++------- src/server/game/Entities/Unit/Unit.cpp | 10 +++++----- src/server/game/Groups/Group.cpp | 2 +- src/server/game/Spells/Auras/SpellAuraDefines.h | 2 +- .../TrialOfTheCrusader/boss_northrend_beasts.cpp | 2 +- .../Ulduar/Ulduar/boss_algalon_the_observer.cpp | 2 +- src/server/scripts/Spells/spell_pet.cpp | 2 +- 8 files changed, 28 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 62d5af6a598..40f124812b8 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -21113,18 +21113,21 @@ bool Player::BuyCurrencyFromVendorSlot(uint64 vendorGuid, uint32 vendorSlot, uin for (uint8 i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i) { + if (!iece->RequiredCurrency[i]) + continue; + CurrencyTypesEntry const* entry = sCurrencyTypesStore.LookupEntry(iece->RequiredCurrency[i]); if (!entry) { - SendBuyError(BUY_ERR_CANT_FIND_ITEM, NULL, currency, 0); + SendBuyError(BUY_ERR_CANT_FIND_ITEM, creature, currency, 0); // Find correct error return false; } uint32 precision = (entry->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? 100 : 1; - if (iece->RequiredCurrency[i] && HasCurrency(iece->RequiredCurrency[i], (iece->RequiredCurrencyCount[i] * count) / precision)) + if (HasCurrency(iece->RequiredCurrency[i], (iece->RequiredCurrencyCount[i] * count) / precision)) { - SendEquipError(EQUIP_ERR_VENDOR_MISSING_TURNINS, NULL, NULL); // error not verified for currencies + SendEquipError(EQUIP_ERR_VENDOR_MISSING_TURNINS, NULL, NULL); // Find correct error return false; } } @@ -21233,16 +21236,19 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32 for (uint8 i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i) { + if (!iece->RequiredCurrency[i]) + continue; + CurrencyTypesEntry const* entry = sCurrencyTypesStore.LookupEntry(iece->RequiredCurrency[i]); if (!entry) { - SendBuyError(BUY_ERR_CANT_FIND_ITEM, NULL, currency, 0); + SendBuyError(BUY_ERR_CANT_FIND_ITEM, creature, item, 0); return false; } uint32 precision = (entry->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? 100 : 1; - if (iece->RequiredCurrency[i] && HasCurrency(iece->RequiredCurrency[i], (iece->RequiredCurrencyCount[i] * count) / precision)) + if (HasCurrency(iece->RequiredCurrency[i], (iece->RequiredCurrencyCount[i] * count) / precision)) { SendEquipError(EQUIP_ERR_VENDOR_MISSING_TURNINS, NULL, NULL); // error not verified for currencies return false; diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index f89a0a6b2fe..aa14d11d2f3 100755 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -227,11 +227,11 @@ float Player::GetHealthBonusFromStamina() { // Taken from PaperDollFrame.lua - 4.3.4.15595 gtOCTHpPerStaminaEntry const* hpBase = sGtOCTHpPerStaminaStore.LookupEntry((getClass() - 1) * GT_MAX_LEVEL + getLevel() - 1); - + float stamina = GetStat(STAT_STAMINA); - float baseStam = std::min(20, stamina); + float baseStam = std::min(20.0f, stamina); float moreStam = stamina - baseStam; - + return baseStam + moreStam * hpBase->ratio; } @@ -240,7 +240,7 @@ float Player::GetManaBonusFromIntellect() // Taken from PaperDollFrame.lua - 4.3.4.15595 float intellect = GetStat(STAT_INTELLECT); - float baseInt = std::min(20, intellect); + float baseInt = std::min(20.0f, intellect); float moreInt = intellect - baseInt; return baseInt + (moreInt * 15.0f); @@ -303,12 +303,12 @@ void Player::UpdateAttackPowerAndDamage(bool ranged) { float strengthValue = std::max((GetStat(STAT_STRENGTH) - 10.0f) * entry->APPerStrenth, 0.0f); float agilityValue = std::max((GetStat(STAT_AGILITY) - 10.0f) * entry->APPerAgility, 0.0f); - + SpellShapeshiftFormEntry const* form = sSpellShapeshiftFormStore.LookupEntry(GetShapeshiftForm()); // Directly taken from client, SHAPESHIFT_FLAG_AP_FROM_STRENGTH ? if (form && form->flags1 & 0x20) - agilityValue += std::max((GetStat(STAT_AGILITY) - 10.0f) * entry->APPerStrenth, 0.0f);; - + agilityValue += std::max((GetStat(STAT_AGILITY) - 10.0f) * entry->APPerStrenth, 0.0f); + val2 = strengthValue + agilityValue; } diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 3b94508b643..fff1722e9b2 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -7219,7 +7219,7 @@ bool Unit::HandleObsModEnergyAuraProc(Unit* victim, uint32 /*damage*/, AuraEffec /* switch (dummySpell->SpellFamilyName) { - + } */ // processed charge only counting case @@ -7262,10 +7262,10 @@ bool Unit::HandleModDamagePctTakenAuraProc(Unit* victim, uint32 /*damage*/, Aura /* switch (dummySpell->SpellFamilyName) { - + } */ - + // processed charge only counting case if (!triggered_spell_id) return true; @@ -9431,7 +9431,7 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin // Add SPELL_AURA_MOD_DAMAGE_DONE_FOR_MECHANIC percent bonus AddPctN(DoneTotalMod, GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_DAMAGE_DONE_FOR_MECHANIC, spellProto->Mechanic)); - + // done scripted mod (take it from owner) Unit* owner = GetOwner() ? GetOwner() : this; AuraEffectList const& mOverrideClassScript= owner->GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS); @@ -10555,7 +10555,7 @@ uint32 Unit::MeleeDamageBonusDone(Unit* victim, uint32 pdamage, WeaponAttackType // Add SPELL_AURA_MOD_DAMAGE_DONE_FOR_MECHANIC percent bonus if (spellProto) AddPctN(DoneTotalMod, GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_DAMAGE_DONE_FOR_MECHANIC, spellProto->Mechanic)); - + // done scripted mod (take it from owner) Unit* owner = GetOwner() ? GetOwner() : this; // AuraEffectList const& mOverrideClassScript = owner->GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS); diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index a6b63ac37da..120de2199c2 100755 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -279,7 +279,7 @@ void Group::ConvertToGroup() if (m_subGroupsCounts) { delete[] m_subGroupsCounts; - m_subGroupsCounts = NULL;; + m_subGroupsCounts = NULL; } if (!isBGGroup()) diff --git a/src/server/game/Spells/Auras/SpellAuraDefines.h b/src/server/game/Spells/Auras/SpellAuraDefines.h index 7cf22d196cc..bbe0435946b 100755 --- a/src/server/game/Spells/Auras/SpellAuraDefines.h +++ b/src/server/game/Spells/Auras/SpellAuraDefines.h @@ -296,7 +296,7 @@ enum AuraType SPELL_AURA_MECHANIC_DURATION_MOD_NOT_STACK = 234, SPELL_AURA_MOD_DISPEL_RESIST = 235, SPELL_AURA_CONTROL_VEHICLE = 236, - SPELL_AURA_MOD_SPELL_DAMAGE_OF_ATTACK_POWER = 237, + SPELL_AURA_MOD_SPELL_DAMAGE_OF_ATTACK_POWER = 237, SPELL_AURA_MOD_SPELL_HEALING_OF_ATTACK_POWER = 238, SPELL_AURA_MOD_SCALE_2 = 239, SPELL_AURA_MOD_EXPERTISE = 240, diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp index 8dd4f7dad3e..db9bc3581ea 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp @@ -139,7 +139,7 @@ public: { m_uiImpaleTimer = urand(8*IN_MILLISECONDS, 10*IN_MILLISECONDS); m_uiStaggeringStompTimer = 15*IN_MILLISECONDS; - m_uiSummonTimer = urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS);; + m_uiSummonTimer = urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS); if (GetDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL || GetDifficulty() == RAID_DIFFICULTY_25MAN_HEROIC) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp index 7ee67060f97..9a3c8985371 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp @@ -373,7 +373,7 @@ class boss_algalon_the_observer : public CreatureScript case ACTION_INIT_ALGALON: _firstPull = false; me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); - break;; + break; } } diff --git a/src/server/scripts/Spells/spell_pet.cpp b/src/server/scripts/Spells/spell_pet.cpp index 4928ec40abd..8dff17b1c30 100644 --- a/src/server/scripts/Spells/spell_pet.cpp +++ b/src/server/scripts/Spells/spell_pet.cpp @@ -1688,7 +1688,7 @@ public: if (pet->isGuardian()) ((Guardian*)pet)->SetBonusDamage(owner->GetTotalAttackPowerValue(BASE_ATTACK)); - amount += owner->CalculateDamage(BASE_ATTACK, true, true);; + amount += owner->CalculateDamage(BASE_ATTACK, true, true); } } -- cgit v1.2.3 From a511d6e1aae52ee78d390f1346766599a3722fba Mon Sep 17 00:00:00 2001 From: Subv Date: Sat, 18 Aug 2012 12:09:14 -0500 Subject: Core/Entities: Intellect no longer affects mana regen --- src/server/game/Entities/Unit/StatSystem.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index aa14d11d2f3..e763108cdaf 100755 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -711,9 +711,8 @@ void Player::ApplyHealthRegenBonus(int32 amount, bool apply) void Player::UpdateManaRegen() { - float Intellect = GetStat(STAT_INTELLECT); - // Mana regen from spirit and intellect - float power_regen = sqrt(Intellect) * OCTRegenMPPerSpirit(); + // Mana regen from spirit + float power_regen = OCTRegenMPPerSpirit(); // Apply PCT bonus from SPELL_AURA_MOD_POWER_REGEN_PERCENT aura on spirit base regen power_regen *= GetTotalAuraMultiplierByMiscValue(SPELL_AURA_MOD_POWER_REGEN_PERCENT, POWER_MANA); -- cgit v1.2.3 From 05aab73dfdbd2661fbb436c4ae3ac0a725627017 Mon Sep 17 00:00:00 2001 From: Subv Date: Sat, 18 Aug 2012 13:12:12 -0500 Subject: Core/Auras: Removed unused aura types --- src/server/game/Entities/Unit/StatSystem.cpp | 28 +------ src/server/game/Entities/Unit/Unit.cpp | 95 +---------------------- src/server/game/Spells/Auras/SpellAuraDefines.h | 22 +++--- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 88 +++++++++------------ src/server/game/Spells/Auras/SpellAuraEffects.h | 2 - src/server/game/Spells/Spell.cpp | 24 +----- 6 files changed, 51 insertions(+), 208 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index e763108cdaf..1f221b14713 100755 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -90,24 +90,12 @@ bool Player::UpdateStats(Stats stat) } if (stat == STAT_STRENGTH) - { UpdateAttackPowerAndDamage(false); - if (HasAuraTypeWithMiscvalue(SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT, stat)) - UpdateAttackPowerAndDamage(true); - } else if (stat == STAT_AGILITY) { UpdateAttackPowerAndDamage(false); UpdateAttackPowerAndDamage(true); } - else - { - // Need update (exist AP from stat auras) - if (HasAuraTypeWithMiscvalue(SPELL_AURA_MOD_ATTACK_POWER_OF_STAT_PERCENT, stat)) - UpdateAttackPowerAndDamage(false); - if (HasAuraTypeWithMiscvalue(SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT, stat)) - UpdateAttackPowerAndDamage(true); - } UpdateSpellDamageAndHealingBonus(); UpdateManaRegen(); @@ -201,7 +189,6 @@ void Player::UpdateArmor() value = GetModifierValue(unitMod, BASE_VALUE); // base armor (from items) value *= GetModifierValue(unitMod, BASE_PCT); // armor percent from items - value += GetStat(STAT_AGILITY) * 2.0f; // armor bonus from stats value += GetModifierValue(unitMod, TOTAL_VALUE); //add dynamic flat mods @@ -318,21 +305,8 @@ void Player::UpdateAttackPowerAndDamage(bool ranged) float attPowerMod = GetModifierValue(unitMod, TOTAL_VALUE); //add dynamic flat mods - if (ranged) + if (!ranged) { - if ((getClassMask() & CLASSMASK_WAND_USERS) == 0) - { - AuraEffectList const& mRAPbyStat = GetAuraEffectsByType(SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT); - for (AuraEffectList::const_iterator i = mRAPbyStat.begin(); i != mRAPbyStat.end(); ++i) - attPowerMod += CalculatePctN(GetStat(Stats((*i)->GetMiscValue())), (*i)->GetAmount()); - } - } - else - { - AuraEffectList const& mAPbyStat = GetAuraEffectsByType(SPELL_AURA_MOD_ATTACK_POWER_OF_STAT_PERCENT); - for (AuraEffectList::const_iterator i = mAPbyStat.begin(); i != mAPbyStat.end(); ++i) - attPowerMod += CalculatePctN(GetStat(Stats((*i)->GetMiscValue())), (*i)->GetAmount()); - AuraEffectList const& mAPbyArmor = GetAuraEffectsByType(SPELL_AURA_MOD_ATTACK_POWER_OF_ARMOR); for (AuraEffectList::const_iterator iter = mAPbyArmor.begin(); iter != mAPbyArmor.end(); ++iter) // always: ((*i)->GetModifier()->m_miscvalue == 1 == SPELL_SCHOOL_MASK_NORMAL) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index fff1722e9b2..28e933cfa6c 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -918,7 +918,6 @@ void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage* damageInfo, int32 dama return; SpellSchoolMask damageSchoolMask = SpellSchoolMask(damageInfo->schoolMask); - uint32 crTypeMask = victim->GetCreatureTypeMask(); if (IsDamageReducedByArmor(damageSchoolMask, spellInfo)) damage = CalcArmorReducedDamage(victim, damage, spellInfo, attackType); @@ -959,9 +958,6 @@ void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage* damageInfo, int32 dama // Increase crit damage from SPELL_AURA_MOD_CRIT_DAMAGE_BONUS critPctDamageMod += (GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_CRIT_DAMAGE_BONUS, spellInfo->GetSchoolMask()) - 1.0f) * 100; - // Increase crit damage from SPELL_AURA_MOD_CRIT_PERCENT_VERSUS - critPctDamageMod += GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_CRIT_PERCENT_VERSUS, crTypeMask); - if (critPctDamageMod != 0) AddPctF(damage, critPctDamageMod); } @@ -1146,10 +1142,6 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam // Increase crit damage from SPELL_AURA_MOD_CRIT_DAMAGE_BONUS mod += (GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_CRIT_DAMAGE_BONUS, damageInfo->damageSchoolMask) - 1.0f) * 100; - uint32 crTypeMask = damageInfo->target->GetCreatureTypeMask(); - - // Increase crit damage from SPELL_AURA_MOD_CRIT_PERCENT_VERSUS - mod += GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_CRIT_PERCENT_VERSUS, crTypeMask); if (mod != 0) AddPctF(damageInfo->damage, mod); break; @@ -1413,14 +1405,6 @@ uint32 Unit::CalcArmorReducedDamage(Unit* victim, const uint32 damage, SpellInfo if (Player* modOwner = GetSpellModOwner()) modOwner->ApplySpellMod(spellInfo->Id, SPELLMOD_IGNORE_ARMOR, armor); - AuraEffectList const& ResIgnoreAurasAb = GetAuraEffectsByType(SPELL_AURA_MOD_ABILITY_IGNORE_TARGET_RESIST); - for (AuraEffectList::const_iterator j = ResIgnoreAurasAb.begin(); j != ResIgnoreAurasAb.end(); ++j) - { - if ((*j)->GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL - && (*j)->IsAffectingSpell(spellInfo)) - armor = floor(AddPctN(armor, -(*j)->GetAmount())); - } - AuraEffectList const& ResIgnoreAuras = GetAuraEffectsByType(SPELL_AURA_MOD_IGNORE_TARGET_RESIST); for (AuraEffectList::const_iterator j = ResIgnoreAuras.begin(); j != ResIgnoreAuras.end(); ++j) { @@ -1428,27 +1412,9 @@ uint32 Unit::CalcArmorReducedDamage(Unit* victim, const uint32 damage, SpellInfo armor = floor(AddPctN(armor, -(*j)->GetAmount())); } - // Apply Player CR_ARMOR_PENETRATION rating and buffs from stances\specializations etc. + // Apply Player CR_ARMOR_PENETRATION rating if (GetTypeId() == TYPEID_PLAYER) { - float bonusPct = 0; - AuraEffectList const& armorPenAuras = GetAuraEffectsByType(SPELL_AURA_MOD_ARMOR_PENETRATION_PCT); - for (AuraEffectList::const_iterator itr = armorPenAuras.begin(); itr != armorPenAuras.end(); ++itr) - { - if ((*itr)->GetSpellInfo()->EquippedItemClass == -1) - { - if (!spellInfo || (*itr)->IsAffectingSpell(spellInfo) || (*itr)->GetMiscValue() & spellInfo->GetSchoolMask()) - bonusPct += (*itr)->GetAmount(); - else if (!(*itr)->GetMiscValue() && !(*itr)->HasSpellClassMask()) - bonusPct += (*itr)->GetAmount(); - } - else - { - if (ToPlayer()->HasItemFitToSpellRequirements((*itr)->GetSpellInfo())) - bonusPct += (*itr)->GetAmount(); - } - } - float maxArmorPen = 0; if (victim->getLevel() < 60) maxArmorPen = float(400 + 85 * victim->getLevel()); @@ -1458,7 +1424,7 @@ uint32 Unit::CalcArmorReducedDamage(Unit* victim, const uint32 damage, SpellInfo // Cap armor penetration to this number maxArmorPen = std::min((armor + maxArmorPen) / 3, armor); // Figure out how much armor do we ignore - float armorPen = CalculatePctF(maxArmorPen, bonusPct + ToPlayer()->GetRatingBonusValue(CR_ARMOR_PENETRATION)); + float armorPen = CalculatePctF(maxArmorPen, ToPlayer()->GetRatingBonusValue(CR_ARMOR_PENETRATION)); // Got the value, apply it armor -= std::min(armorPen, maxArmorPen); } @@ -1539,11 +1505,6 @@ void Unit::CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffe float damageResisted = float(damage * i / 10); - AuraEffectList const& ResIgnoreAurasAb = GetAuraEffectsByType(SPELL_AURA_MOD_ABILITY_IGNORE_TARGET_RESIST); - for (AuraEffectList::const_iterator j = ResIgnoreAurasAb.begin(); j != ResIgnoreAurasAb.end(); ++j) - if (((*j)->GetMiscValue() & schoolMask) && (*j)->IsAffectingSpell(spellInfo)) - AddPctN(damageResisted, -(*j)->GetAmount()); - AuraEffectList const& ResIgnoreAuras = GetAuraEffectsByType(SPELL_AURA_MOD_IGNORE_TARGET_RESIST); for (AuraEffectList::const_iterator j = ResIgnoreAuras.begin(); j != ResIgnoreAuras.end(); ++j) if ((*j)->GetMiscValue() & schoolMask) @@ -1691,40 +1652,6 @@ void Unit::CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffe // split damage auras - only when not damaging self if (victim != this) { - // We're going to call functions which can modify content of the list during iteration over it's elements - // Let's copy the list so we can prevent iterator invalidation - AuraEffectList vSplitDamageFlatCopy(victim->GetAuraEffectsByType(SPELL_AURA_SPLIT_DAMAGE_FLAT)); - for (AuraEffectList::iterator itr = vSplitDamageFlatCopy.begin(); (itr != vSplitDamageFlatCopy.end()) && (dmgInfo.GetDamage() > 0); ++itr) - { - // Check if aura was removed during iteration - we don't need to work on such auras - if (!((*itr)->GetBase()->IsAppliedOnTarget(victim->GetGUID()))) - continue; - // check damage school mask - if (!((*itr)->GetMiscValue() & schoolMask)) - continue; - - // Damage can be splitted only if aura has an alive caster - Unit* caster = (*itr)->GetCaster(); - if (!caster || (caster == victim) || !caster->IsInWorld() || !caster->isAlive()) - continue; - - int32 splitDamage = (*itr)->GetAmount(); - - // absorb must be smaller than the damage itself - splitDamage = RoundToInterval(splitDamage, 0, int32(dmgInfo.GetDamage())); - - dmgInfo.AbsorbDamage(splitDamage); - - uint32 splitted = splitDamage; - uint32 splitted_absorb = 0; - DealDamageMods(caster, splitted, &splitted_absorb); - - SendSpellNonMeleeDamageLog(caster, (*itr)->GetSpellInfo()->Id, splitted, schoolMask, splitted_absorb, 0, false, 0, false); - - CleanDamage cleanDamage = CleanDamage(splitted, 0, BASE_ATTACK, MELEE_HIT_NORMAL); - DealDamage(caster, splitted, &cleanDamage, DIRECT_DAMAGE, schoolMask, (*itr)->GetSpellInfo(), false); - } - // We're going to call functions which can modify content of the list during iteration over it's elements // Let's copy the list so we can prevent iterator invalidation AuraEffectList vSplitDamagePctCopy(victim->GetAuraEffectsByType(SPELL_AURA_SPLIT_DAMAGE_PCT)); @@ -2380,17 +2307,11 @@ SpellMissInfo Unit::MagicSpellHitResult(Unit* victim, SpellInfo const* spell) if (Player* modOwner = GetSpellModOwner()) modOwner->ApplySpellMod(spell->Id, SPELLMOD_RESIST_MISS_CHANCE, modHitChance); - // Increase from attacker SPELL_AURA_MOD_INCREASES_SPELL_PCT_TO_HIT auras - modHitChance += GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_INCREASES_SPELL_PCT_TO_HIT, schoolMask); - // Spells with SPELL_ATTR3_IGNORE_HIT_RESULT will ignore target's avoidance effects if (!(spell->AttributesEx3 & SPELL_ATTR3_IGNORE_HIT_RESULT)) { // Chance hit from victim SPELL_AURA_MOD_ATTACKER_SPELL_HIT_CHANCE auras modHitChance += victim->GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_ATTACKER_SPELL_HIT_CHANCE, schoolMask); - // Reduce spell hit chance for Area of effect spells from victim SPELL_AURA_MOD_AOE_AVOIDANCE aura - if (spell->IsTargetingArea()) - modHitChance -= victim->GetTotalAuraModifier(SPELL_AURA_MOD_AOE_AVOIDANCE); // Decrease hit chance from victim rating bonus if (victim->GetTypeId() == TYPEID_PLAYER) @@ -10015,9 +9936,6 @@ uint32 Unit::SpellCriticalDamageBonus(SpellInfo const* spellProto, uint32 damage crit_mod += (GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_CRIT_DAMAGE_BONUS, spellProto->GetSchoolMask()) - 1.0f) * 100; - if (victim) - crit_mod += GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_CRIT_PERCENT_VERSUS, victim->GetCreatureTypeMask()); - if (crit_bonus != 0) AddPctF(crit_bonus, crit_mod); @@ -10037,14 +9955,7 @@ uint32 Unit::SpellCriticalHealingBonus(SpellInfo const* /*spellProto*/, uint32 d // Calculate critical bonus int32 crit_bonus = damage; - if (victim) - { - uint32 creatureTypeMask = victim->GetCreatureTypeMask(); - crit_bonus = int32(crit_bonus * GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_CRIT_PERCENT_VERSUS, creatureTypeMask)); - } - - if (crit_bonus > 0) - damage += crit_bonus; + damage += crit_bonus; damage = int32(float(damage) * GetTotalAuraMultiplier(SPELL_AURA_MOD_CRITICAL_HEALING_AMOUNT)); diff --git a/src/server/game/Spells/Auras/SpellAuraDefines.h b/src/server/game/Spells/Auras/SpellAuraDefines.h index bbe0435946b..1482136f52e 100755 --- a/src/server/game/Spells/Auras/SpellAuraDefines.h +++ b/src/server/game/Spells/Auras/SpellAuraDefines.h @@ -212,14 +212,14 @@ enum AuraType SPELL_AURA_MOD_SHIELD_BLOCKVALUE_PCT = 150, SPELL_AURA_TRACK_STEALTHED = 151, // Track Stealthed SPELL_AURA_MOD_DETECTED_RANGE = 152, // Mod Detected Range - SPELL_AURA_SPLIT_DAMAGE_FLAT = 153, // Split Damage Flat + SPELL_AURA_153 = 153, // old SPELL_AURA_SPLIT_DAMAGE_FLAT. unused 4.3.4 SPELL_AURA_MOD_STEALTH_LEVEL = 154, // Stealth Level Modifier SPELL_AURA_MOD_WATER_BREATHING = 155, // Mod Water Breathing SPELL_AURA_MOD_REPUTATION_GAIN = 156, // Mod Reputation Gain SPELL_AURA_PET_DAMAGE_MULTI = 157, // Mod Pet Damage SPELL_AURA_MOD_SHIELD_BLOCKVALUE = 158, SPELL_AURA_NO_PVP_CREDIT = 159, - SPELL_AURA_MOD_AOE_AVOIDANCE = 160, + SPELL_AURA_160 = 160, // old SPELL_AURA_MOD_AOE_AVOIDANCE. Unused 4.3.4 SPELL_AURA_MOD_HEALTH_REGEN_IN_COMBAT = 161, SPELL_AURA_POWER_BURN = 162, SPELL_AURA_MOD_CRIT_DAMAGE_BONUS = 163, @@ -228,7 +228,7 @@ enum AuraType SPELL_AURA_MOD_ATTACK_POWER_PCT = 166, SPELL_AURA_MOD_RANGED_ATTACK_POWER_PCT = 167, SPELL_AURA_MOD_DAMAGE_DONE_VERSUS = 168, - SPELL_AURA_MOD_CRIT_PERCENT_VERSUS = 169, + SPELL_AURA_169 = 169, // old SPELL_AURA_MOD_CRIT_PERCENT_VERSUS. unused 4.3.4 SPELL_AURA_DETECT_AMORE = 170, SPELL_AURA_MOD_SPEED_NOT_STACK = 171, SPELL_AURA_MOD_MOUNTED_SPEED_NOT_STACK = 172, @@ -258,7 +258,7 @@ enum AuraType SPELL_AURA_MOD_COOLDOWN = 196, // only 24818 Noxious Breath SPELL_AURA_MOD_ATTACKER_SPELL_AND_WEAPON_CRIT_CHANCE = 197, SPELL_AURA_198 = 198, // old SPELL_AURA_MOD_ALL_WEAPON_SKILLS - SPELL_AURA_MOD_INCREASES_SPELL_PCT_TO_HIT = 199, + SPELL_AURA_199 = 199, // old SPELL_AURA_MOD_INCREASES_SPELL_PCT_TO_HIT. unused 4.3.4 SPELL_AURA_MOD_XP_PCT = 200, SPELL_AURA_FLY = 201, SPELL_AURA_IGNORE_COMBAT_RESULT = 202, @@ -271,7 +271,7 @@ enum AuraType SPELL_AURA_MOD_MOUNTED_FLIGHT_SPEED_ALWAYS = 209, SPELL_AURA_MOD_VEHICLE_SPEED_ALWAYS = 210, SPELL_AURA_MOD_FLIGHT_SPEED_NOT_STACK = 211, - SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT = 212, + SPELL_AURA_212 = 212, // old SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT. unused 4.3.4 SPELL_AURA_MOD_RAGE_FROM_DAMAGE_DEALT = 213, SPELL_AURA_214 = 214, SPELL_AURA_ARENA_PREPARATION = 215, @@ -327,19 +327,19 @@ enum AuraType SPELL_AURA_265 = 265, SPELL_AURA_266 = 266, SPELL_AURA_MOD_IMMUNE_AURA_APPLY_SCHOOL = 267, - SPELL_AURA_MOD_ATTACK_POWER_OF_STAT_PERCENT = 268, + SPELL_AURA_268 = 268, // old SPELL_AURA_MOD_ATTACK_POWER_OF_STAT_PERCENT. unused 4.3.4 SPELL_AURA_MOD_IGNORE_TARGET_RESIST = 269, - SPELL_AURA_MOD_ABILITY_IGNORE_TARGET_RESIST = 270, // Possibly need swap vs 195 aura used only in 1 spell Chaos Bolt Passive + SPELL_AURA_270 = 270, // old SPELL_AURA_MOD_ABILITY_IGNORE_TARGET_RESIST, unused 4.3.4 SPELL_AURA_MOD_DAMAGE_FROM_CASTER = 271, SPELL_AURA_IGNORE_MELEE_RESET = 272, SPELL_AURA_X_RAY = 273, - SPELL_AURA_274 = 274, // old SPELL_AURA_ABILITY_CONSUME_NO_AMMO, unused now + SPELL_AURA_274 = 274, // old SPELL_AURA_ABILITY_CONSUME_NO_AMMO, unused 4.3.4 SPELL_AURA_MOD_IGNORE_SHAPESHIFT = 275, SPELL_AURA_MOD_DAMAGE_DONE_FOR_MECHANIC = 276, - SPELL_AURA_MOD_MAX_AFFECTED_TARGETS = 277, + SPELL_AURA_277 = 277, // old SPELL_AURA_MOD_MAX_AFFECTED_TARGETS. unused 4.3.4 SPELL_AURA_MOD_DISARM_RANGED = 278, SPELL_AURA_INITIALIZE_IMAGES = 279, - SPELL_AURA_MOD_ARMOR_PENETRATION_PCT = 280, + SPELL_AURA_280 = 280, // old SPELL_AURA_MOD_ARMOR_PENETRATION_PCT unused 4.3.4 SPELL_AURA_MOD_HONOR_GAIN_PCT = 281, SPELL_AURA_MOD_BASE_HEALTH_PCT = 282, SPELL_AURA_MOD_HEALING_RECEIVED = 283, // Possibly only for some spell family class spells @@ -375,7 +375,7 @@ enum AuraType SPELL_AURA_313 = 313, SPELL_AURA_PREVENT_RESURRECTION = 314, SPELL_AURA_UNDERWATER_WALKING = 315, - SPELL_AURA_PERIODIC_HASTE = 316, + SPELL_AURA_316 = 316, // old SPELL_AURA_PERIODIC_HASTE. unused 4.3.4 SPELL_AURA_MOD_SPELL_POWER_PCT = 317, SPELL_AURA_MASTERY = 318, SPELL_AURA_MOD_MELEE_HASTE_3 = 319, diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 783b1609958..d0f4a93e35d 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -116,7 +116,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleAuraModPacifyAndSilence, // 60 SPELL_AURA_MOD_PACIFY_SILENCE &AuraEffect::HandleAuraModScale, // 61 SPELL_AURA_MOD_SCALE &AuraEffect::HandleNoImmediateEffect, // 62 SPELL_AURA_PERIODIC_HEALTH_FUNNEL implemented in AuraEffect::PeriodicTick - &AuraEffect::HandleNULL, // 63 unused (3.2.0) old SPELL_AURA_PERIODIC_MANA_FUNNEL + &AuraEffect::HandleUnused, // 63 unused (4.3.4) old SPELL_AURA_PERIODIC_MANA_FUNNEL &AuraEffect::HandleNoImmediateEffect, // 64 SPELL_AURA_PERIODIC_MANA_LEECH implemented in AuraEffect::PeriodicTick &AuraEffect::HandleModCastingSpeed, // 65 SPELL_AURA_MOD_CASTING_SPEED_NOT_STACK &AuraEffect::HandleFeignDeath, // 66 SPELL_AURA_FEIGN_DEATH @@ -143,7 +143,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleNoImmediateEffect, // 87 SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN implemented in Unit::MeleeDamageBonus and Unit::SpellDamageBonus &AuraEffect::HandleNoImmediateEffect, // 88 SPELL_AURA_MOD_HEALTH_REGEN_PERCENT implemented in Player::RegenerateHealth &AuraEffect::HandleNoImmediateEffect, // 89 SPELL_AURA_PERIODIC_DAMAGE_PERCENT - &AuraEffect::HandleNULL, // 90 unused (3.0.8a) old SPELL_AURA_MOD_RESIST_CHANCE + &AuraEffect::HandleUnused, // 90 unused (4.3.4) old SPELL_AURA_MOD_RESIST_CHANCE &AuraEffect::HandleNoImmediateEffect, // 91 SPELL_AURA_MOD_DETECT_RANGE implemented in Creature::GetAttackDistance &AuraEffect::HandlePreventFleeing, // 92 SPELL_AURA_PREVENTS_FLEEING &AuraEffect::HandleModUnattackable, // 93 SPELL_AURA_MOD_UNATTACKABLE @@ -172,7 +172,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleNoImmediateEffect, //116 SPELL_AURA_MOD_REGEN_DURING_COMBAT &AuraEffect::HandleNoImmediateEffect, //117 SPELL_AURA_MOD_MECHANIC_RESISTANCE implemented in Unit::MagicSpellHitResult &AuraEffect::HandleNoImmediateEffect, //118 SPELL_AURA_MOD_HEALING_PCT implemented in Unit::SpellHealingBonus - &AuraEffect::HandleUnused, //119 unused (3.2.0) old SPELL_AURA_SHARE_PET_TRACKING + &AuraEffect::HandleUnused, //119 unused (4.3.4) old SPELL_AURA_SHARE_PET_TRACKING &AuraEffect::HandleAuraUntrackable, //120 SPELL_AURA_UNTRACKABLE &AuraEffect::HandleAuraEmpathy, //121 SPELL_AURA_EMPATHY &AuraEffect::HandleModOffhandDamagePercent, //122 SPELL_AURA_MOD_OFFHAND_DAMAGE_PCT @@ -206,14 +206,14 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleShieldBlockValue, //150 SPELL_AURA_MOD_SHIELD_BLOCKVALUE_PCT &AuraEffect::HandleAuraTrackStealthed, //151 SPELL_AURA_TRACK_STEALTHED &AuraEffect::HandleNoImmediateEffect, //152 SPELL_AURA_MOD_DETECTED_RANGE implemented in Creature::GetAttackDistance - &AuraEffect::HandleNoImmediateEffect, //153 SPELL_AURA_SPLIT_DAMAGE_FLAT + &AuraEffect::HandleUnused, //153 Unused (4.3.4) old SPELL_AURA_SPLIT_DAMAGE_FLAT &AuraEffect::HandleModStealthLevel, //154 SPELL_AURA_MOD_STEALTH_LEVEL &AuraEffect::HandleNoImmediateEffect, //155 SPELL_AURA_MOD_WATER_BREATHING &AuraEffect::HandleNoImmediateEffect, //156 SPELL_AURA_MOD_REPUTATION_GAIN &AuraEffect::HandleNULL, //157 SPELL_AURA_PET_DAMAGE_MULTI &AuraEffect::HandleShieldBlockValue, //158 SPELL_AURA_MOD_SHIELD_BLOCKVALUE &AuraEffect::HandleNoImmediateEffect, //159 SPELL_AURA_NO_PVP_CREDIT only for Honorless Target spell - &AuraEffect::HandleNoImmediateEffect, //160 SPELL_AURA_MOD_AOE_AVOIDANCE implemented in Unit::MagicSpellHitResult + &AuraEffect::HandleUnused, //160 Unused (4.3.4) old SPELL_AURA_MOD_AOE_AVOIDANCE &AuraEffect::HandleNoImmediateEffect, //161 SPELL_AURA_MOD_HEALTH_REGEN_IN_COMBAT &AuraEffect::HandleNoImmediateEffect, //162 SPELL_AURA_POWER_BURN implemented in AuraEffect::PeriodicTick &AuraEffect::HandleNoImmediateEffect, //163 SPELL_AURA_MOD_CRIT_DAMAGE_BONUS @@ -222,11 +222,11 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleAuraModAttackPowerPercent, //166 SPELL_AURA_MOD_ATTACK_POWER_PCT &AuraEffect::HandleAuraModRangedAttackPowerPercent, //167 SPELL_AURA_MOD_RANGED_ATTACK_POWER_PCT &AuraEffect::HandleNoImmediateEffect, //168 SPELL_AURA_MOD_DAMAGE_DONE_VERSUS implemented in Unit::SpellDamageBonus, Unit::MeleeDamageBonus - &AuraEffect::HandleNoImmediateEffect, //169 SPELL_AURA_MOD_CRIT_PERCENT_VERSUS implemented in Unit::DealDamageBySchool, Unit::DoAttackDamage, Unit::SpellCriticalBonus + &AuraEffect::HandleUnused, //169 Unused (4.3.4) old SPELL_AURA_MOD_CRIT_PERCENT_VERSUS &AuraEffect::HandleNULL, //170 SPELL_AURA_DETECT_AMORE various spells that change visual of units for aura target (clientside?) &AuraEffect::HandleAuraModIncreaseSpeed, //171 SPELL_AURA_MOD_SPEED_NOT_STACK &AuraEffect::HandleAuraModIncreaseMountedSpeed, //172 SPELL_AURA_MOD_MOUNTED_SPEED_NOT_STACK - &AuraEffect::HandleUnused, //173 unused (3.2.0) no spells, old SPELL_AURA_ALLOW_CHAMPION_SPELLS only for Proclaim Champion spell + &AuraEffect::HandleUnused, //173 unused (4.3.4) no spells, old SPELL_AURA_ALLOW_CHAMPION_SPELLS only for Proclaim Champion spell &AuraEffect::HandleModSpellDamagePercentFromStat, //174 SPELL_AURA_MOD_SPELL_DAMAGE_OF_STAT_PERCENT implemented in Unit::SpellBaseDamageBonus &AuraEffect::HandleModSpellHealingPercentFromStat, //175 SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT implemented in Unit::SpellBaseHealingBonus &AuraEffect::HandleSpiritOfRedemption, //176 SPELL_AURA_SPIRIT_OF_REDEMPTION only for Spirit of Redemption spell, die at aura end @@ -234,7 +234,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleUnused, //178 old SPELL_AURA_MOD_DEBUFF_RESISTANCE unused 4.3.4 &AuraEffect::HandleNoImmediateEffect, //179 SPELL_AURA_MOD_ATTACKER_SPELL_CRIT_CHANCE implemented in Unit::SpellCriticalBonus &AuraEffect::HandleNoImmediateEffect, //180 SPELL_AURA_MOD_FLAT_SPELL_DAMAGE_VERSUS implemented in Unit::SpellDamageBonus - &AuraEffect::HandleUnused, //181 unused (3.2.0) old SPELL_AURA_MOD_FLAT_SPELL_CRIT_DAMAGE_VERSUS + &AuraEffect::HandleUnused, //181 unused (4.3.4) old SPELL_AURA_MOD_FLAT_SPELL_CRIT_DAMAGE_VERSUS &AuraEffect::HandleAuraModResistenceOfStatPercent, //182 SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT &AuraEffect::HandleNULL, //183 SPELL_AURA_MOD_CRITICAL_THREAT only used in 28746 - miscvalue - spell school &AuraEffect::HandleNoImmediateEffect, //184 SPELL_AURA_MOD_ATTACKER_MELEE_HIT_CHANCE implemented in Unit::RollMeleeOutcomeAgainst @@ -251,8 +251,8 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleNoImmediateEffect, //195 SPELL_AURA_MOD_TARGET_ABILITY_ABSORB_SCHOOL implemented in Unit::CalcAbsorbResist &AuraEffect::HandleNULL, //196 SPELL_AURA_MOD_COOLDOWN - flat mod of spell cooldowns &AuraEffect::HandleNoImmediateEffect, //197 SPELL_AURA_MOD_ATTACKER_SPELL_AND_WEAPON_CRIT_CHANCE implemented in Unit::SpellCriticalBonus Unit::GetUnitCriticalChance - &AuraEffect::HandleUnused, //198 unused (3.2.0) old SPELL_AURA_MOD_ALL_WEAPON_SKILLS - &AuraEffect::HandleNoImmediateEffect, //199 SPELL_AURA_MOD_INCREASES_SPELL_PCT_TO_HIT implemented in Unit::MagicSpellHitResult + &AuraEffect::HandleUnused, //198 unused (4.3.4) old SPELL_AURA_MOD_ALL_WEAPON_SKILLS + &AuraEffect::HandleUnused, //199 unused (4.3.4) old SPELL_AURA_MOD_INCREASES_SPELL_PCT_TO_HIT &AuraEffect::HandleNoImmediateEffect, //200 SPELL_AURA_MOD_XP_PCT implemented in Player::RewardPlayerAndGroupAtKill &AuraEffect::HandleAuraAllowFlight, //201 SPELL_AURA_FLY this aura enable flight mode... &AuraEffect::HandleNoImmediateEffect, //202 SPELL_AURA_CANNOT_BE_DODGED implemented in Unit::RollPhysicalOutcomeAgainst @@ -265,7 +265,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleAuraModIncreaseFlightSpeed, //209 SPELL_AURA_MOD_MOUNTED_FLIGHT_SPEED_ALWAYS &AuraEffect::HandleAuraModIncreaseFlightSpeed, //210 SPELL_AURA_MOD_VEHICLE_SPEED_ALWAYS &AuraEffect::HandleAuraModIncreaseFlightSpeed, //211 SPELL_AURA_MOD_FLIGHT_SPEED_NOT_STACK - &AuraEffect::HandleAuraModRangedAttackPowerOfStatPercent, //212 SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT + &AuraEffect::HandleUnused, //212 Unused (4.3.4) old SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT &AuraEffect::HandleNoImmediateEffect, //213 SPELL_AURA_MOD_RAGE_FROM_DAMAGE_DEALT implemented in Player::RewardRage &AuraEffect::HandleNULL, //214 Tamed Pet Passive &AuraEffect::HandleArenaPreparation, //215 SPELL_AURA_ARENA_PREPARATION @@ -312,28 +312,28 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleNoReagentUseAura, //256 SPELL_AURA_NO_REAGENT_USE Use SpellClassMask for spell select &AuraEffect::HandleNULL, //257 SPELL_AURA_MOD_TARGET_RESIST_BY_SPELL_CLASS Use SpellClassMask for spell select &AuraEffect::HandleNULL, //258 SPELL_AURA_MOD_SPELL_VISUAL - &AuraEffect::HandleUnused, //259 SPELL_AURA_MOD_HOT_PCT implemented in Unit::SpellHealingBonus + &AuraEffect::HandleUnused, //259 unused (4.3.4) old SPELL_AURA_MOD_HOT_PCT &AuraEffect::HandleNoImmediateEffect, //260 SPELL_AURA_SCREEN_EFFECT (miscvalue = id in ScreenEffect.dbc) not required any code &AuraEffect::HandlePhase, //261 SPELL_AURA_PHASE &AuraEffect::HandleNoImmediateEffect, //262 SPELL_AURA_ABILITY_IGNORE_AURASTATE implemented in spell::cancast &AuraEffect::HandleAuraAllowOnlyAbility, //263 SPELL_AURA_ALLOW_ONLY_ABILITY player can use only abilities set in SpellClassMask &AuraEffect::HandleUnused, //264 unused (3.2.0) - &AuraEffect::HandleUnused, //265 unused (3.2.0) - &AuraEffect::HandleUnused, //266 unused (3.2.0) + &AuraEffect::HandleUnused, //265 unused (4.3.4) + &AuraEffect::HandleUnused, //266 unused (4.3.4) &AuraEffect::HandleNoImmediateEffect, //267 SPELL_AURA_MOD_IMMUNE_AURA_APPLY_SCHOOL implemented in Unit::IsImmunedToSpellEffect - &AuraEffect::HandleAuraModAttackPowerOfStatPercent, //268 SPELL_AURA_MOD_ATTACK_POWER_OF_STAT_PERCENT + &AuraEffect::HandleUnused, //268 unused (4.3.4) old SPELL_AURA_MOD_ATTACK_POWER_OF_STAT_PERCENT. &AuraEffect::HandleNoImmediateEffect, //269 SPELL_AURA_MOD_IGNORE_TARGET_RESIST implemented in Unit::CalcAbsorbResist and CalcArmorReducedDamage - &AuraEffect::HandleNoImmediateEffect, //270 SPELL_AURA_MOD_ABILITY_IGNORE_TARGET_RESIST implemented in Unit::CalcAbsorbResist and CalcArmorReducedDamage + &AuraEffect::HandleUnused, //270 unused (4.3.4) old SPELL_AURA_MOD_ABILITY_IGNORE_TARGET_RESIST &AuraEffect::HandleNoImmediateEffect, //271 SPELL_AURA_MOD_DAMAGE_FROM_CASTER implemented in Unit::SpellDamageBonus &AuraEffect::HandleNoImmediateEffect, //272 SPELL_AURA_IGNORE_MELEE_RESET &AuraEffect::HandleUnused, //273 clientside &AuraEffect::HandleUnused, //274 unused (4.3.4) &AuraEffect::HandleNoImmediateEffect, //275 SPELL_AURA_MOD_IGNORE_SHAPESHIFT Use SpellClassMask for spell select &AuraEffect::HandleNULL, //276 mod damage % mechanic? - &AuraEffect::HandleNoImmediateEffect, //277 SPELL_AURA_MOD_ABILITY_AFFECTED_TARGETS implemented in spell::settargetmap + &AuraEffect::HandleUnused, //277 unused (4.3.4) old SPELL_AURA_MOD_MAX_AFFECTED_TARGETS &AuraEffect::HandleAuraModDisarm, //278 SPELL_AURA_MOD_DISARM_RANGED disarm ranged weapon &AuraEffect::HandleNoImmediateEffect, //279 SPELL_AURA_INITIALIZE_IMAGES - &AuraEffect::HandleNoImmediateEffect, //280 SPELL_AURA_MOD_TARGET_ARMOR_PCT + &AuraEffect::HandleUnused, //280 unused (4.3.4) old SPELL_AURA_MOD_ARMOR_PENETRATION_PCT &AuraEffect::HandleNoImmediateEffect, //281 SPELL_AURA_MOD_HONOR_GAIN_PCT implemented in Player::RewardHonor &AuraEffect::HandleAuraIncreaseBaseHealthPercent, //282 SPELL_AURA_INCREASE_BASE_HEALTH_PERCENT &AuraEffect::HandleNoImmediateEffect, //283 SPELL_AURA_MOD_HEALING_RECEIVED implemented in Unit::SpellHealingBonus @@ -348,39 +348,39 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleAuraOpenStable, //292 SPELL_AURA_OPEN_STABLE &AuraEffect::HandleAuraOverrideSpells, //293 auras which probably add set of abilities to their target based on it's miscvalue &AuraEffect::HandleNoImmediateEffect, //294 SPELL_AURA_PREVENT_REGENERATE_POWER implemented in Player::Regenerate(Powers power) - &AuraEffect::HandleNULL, //295 0 spells in 3.3.5 + &AuraEffect::HandleUnused, //295 unused (4.3.4) &AuraEffect::HandleAuraSetVehicle, //296 SPELL_AURA_SET_VEHICLE_ID sets vehicle on target &AuraEffect::HandleNULL, //297 Spirit Burst spells &AuraEffect::HandleNULL, //298 70569 - Strangulating, maybe prevents talk or cast - &AuraEffect::HandleNULL, //299 unused + &AuraEffect::HandleUnused, //299 unused (4.3.4) &AuraEffect::HandleNoImmediateEffect, //300 SPELL_AURA_SHARE_DAMAGE_PCT implemented in Unit::DealDamage &AuraEffect::HandleNoImmediateEffect, //301 SPELL_AURA_SCHOOL_HEAL_ABSORB implemented in Unit::CalcHealAbsorb - &AuraEffect::HandleNULL, //302 0 spells in 3.3.5 + &AuraEffect::HandleUnused, //302 unused (4.3.4) &AuraEffect::HandleNoImmediateEffect, //303 SPELL_AURA_MOD_DAMAGE_DONE_VERSUS_AURASTATE implemented in Unit::SpellDamageBonus, Unit::MeleeDamageBonus &AuraEffect::HandleAuraModFakeInebriation, //304 SPELL_AURA_MOD_DRUNK &AuraEffect::HandleAuraModIncreaseSpeed, //305 SPELL_AURA_MOD_MINIMUM_SPEED - &AuraEffect::HandleNULL, //306 0 spells in 3.3.5 - &AuraEffect::HandleNULL, //307 0 spells in 3.3.5 + &AuraEffect::HandleUnused, //306 unused (4.3.4) + &AuraEffect::HandleUnused, //307 unused (4.3.4) &AuraEffect::HandleNULL, //308 new aura for hunter traps - &AuraEffect::HandleNULL, //309 0 spells in 3.3.5 + &AuraEffect::HandleUnused, //309 unused (4.3.4) &AuraEffect::HandleNoImmediateEffect, //310 SPELL_AURA_MOD_CREATURE_AOE_DAMAGE_AVOIDANCE implemented in Spell::CalculateDamageDone &AuraEffect::HandleNULL, //311 0 spells in 3.3.5 &AuraEffect::HandleNULL, //312 0 spells in 3.3.5 - &AuraEffect::HandleNULL, //313 0 spells in 3.3.5 + &AuraEffect::HandleUnused, //313 unused (4.3.4) &AuraEffect::HandlePreventResurrection, //314 SPELL_AURA_PREVENT_RESURRECTION todo &AuraEffect::HandleNoImmediateEffect, //315 SPELL_AURA_UNDERWATER_WALKING todo - &AuraEffect::HandleNoImmediateEffect, //316 SPELL_AURA_PERIODIC_HASTE implemented in AuraEffect::CalculatePeriodic + &AuraEffect::HandleNoImmediateEffect, //316 unused (4.3.4) old SPELL_AURA_PERIODIC_HASTE &AuraEffect::HandleNULL, //317 SPELL_AURA_MOD_SPELL_POWER_PCT &AuraEffect::HandleNULL, //318 SPELL_AURA_MASTERY &AuraEffect::HandleModMeleeSpeedPct, //319 SPELL_AURA_MOD_MELEE_HASTE_3 &AuraEffect::HandleAuraModRangedHaste, //320 SPELL_AURA_MOD_RANGED_HASTE_2 &AuraEffect::HandleNULL, //321 SPELL_AURA_321 &AuraEffect::HandleNULL, //322 SPELL_AURA_INTERFERE_TARGETTING - &AuraEffect::HandleNULL, //323 SPELL_AURA_323 + &AuraEffect::HandleUnused, //323 unused (4.3.4) &AuraEffect::HandleNULL, //324 SPELL_AURA_324 - &AuraEffect::HandleNULL, //325 SPELL_AURA_325 + &AuraEffect::HandleUnused, //325 unused (4.3.4) &AuraEffect::HandleNULL, //326 SPELL_AURA_326 - &AuraEffect::HandleNULL, //327 SPELL_AURA_327 + &AuraEffect::HandleUnused, //327 unused (4.3.4) &AuraEffect::HandleNoImmediateEffect, //328 SPELL_AURA_PROC_ON_POWER_AMOUNT implemented in Unit::HandleAuraProcOnPowerAmount &AuraEffect::HandleNULL, //329 SPELL_AURA_MOD_RUNE_REGEN_SPEED &AuraEffect::HandleNULL, //330 SPELL_AURA_CAST_WHILE_WALKING @@ -407,21 +407,21 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleNULL, //351 SPELL_AURA_351 &AuraEffect::HandleNULL, //352 SPELL_AURA_352 &AuraEffect::HandleNULL, //353 SPELL_AURA_MOD_CAMOUFLAGE - &AuraEffect::HandleNULL, //353 SPELL_AURA_354 - &AuraEffect::HandleNULL, //354 SPELL_AURA_355 + &AuraEffect::HandleNULL, //354 SPELL_AURA_354 + &AuraEffect::HandleUnused, //355 unused (4.3.4) &AuraEffect::HandleNULL, //356 SPELL_AURA_356 &AuraEffect::HandleNULL, //357 SPELL_AURA_357 &AuraEffect::HandleNULL, //358 SPELL_AURA_358 &AuraEffect::HandleNULL, //359 SPELL_AURA_359 &AuraEffect::HandleNULL, //360 SPELL_AURA_360 &AuraEffect::HandleNULL, //361 SPELL_AURA_361 - &AuraEffect::HandleNULL, //362 SPELL_AURA_362 + &AuraEffect::HandleUnused, //362 unused (4.3.4) &AuraEffect::HandleNULL, //363 SPELL_AURA_363 - &AuraEffect::HandleNULL, //364 SPELL_AURA_364 + &AuraEffect::HandleUnused, //364 unused (4.3.4) &AuraEffect::HandleNULL, //365 SPELL_AURA_365 &AuraEffect::HandleNULL, //366 SPELL_AURA_366 &AuraEffect::HandleNULL, //367 SPELL_AURA_367 - &AuraEffect::HandleNULL, //368 SPELL_AURA_368 + &AuraEffect::HandleUnused, //368 unused (4.3.4) &AuraEffect::HandleNULL, //369 SPELL_AURA_369 &AuraEffect::HandleNULL, //370 SPELL_AURA_370 }; @@ -880,8 +880,7 @@ void AuraEffect::CalculatePeriodic(Unit* caster, bool create, bool load) if (m_spellInfo->AttributesEx5 & SPELL_ATTR5_HASTE_AFFECT_DURATION) caster->ModSpellCastTime(m_spellInfo, m_amplitude); } - // and periodic time of auras affected by SPELL_AURA_PERIODIC_HASTE on player who have haste - else if (caster->HasAuraTypeWithAffectMask(SPELL_AURA_PERIODIC_HASTE, m_spellInfo) || m_spellInfo->AttributesEx5 & SPELL_ATTR5_HASTE_AFFECT_DURATION) + else if (m_spellInfo->AttributesEx5 & SPELL_ATTR5_HASTE_AFFECT_DURATION) m_amplitude = int32(m_amplitude * caster->GetFloatValue(UNIT_MOD_CAST_SPEED)); } } @@ -4609,23 +4608,6 @@ void AuraEffect::HandleAuraModRangedAttackPowerPercent(AuraApplication const* au target->HandleStatModifier(UNIT_MOD_ATTACK_POWER_RANGED, TOTAL_PCT, float(GetAmount()), apply); } -void AuraEffect::HandleAuraModRangedAttackPowerOfStatPercent(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const -{ - if (!(mode & (AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK | AURA_EFFECT_HANDLE_STAT))) - return; - - Unit* target = aurApp->GetTarget(); - - // Recalculate bonus - if (target->GetTypeId() == TYPEID_PLAYER && !(target->getClassMask() & CLASSMASK_WAND_USERS)) - target->ToPlayer()->UpdateAttackPowerAndDamage(true); -} - -void AuraEffect::HandleAuraModAttackPowerOfStatPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const -{ - HandleAuraModAttackPowerOfArmor(aurApp, mode, apply); -} - void AuraEffect::HandleAuraModAttackPowerOfArmor(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const { if (!(mode & (AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK | AURA_EFFECT_HANDLE_STAT))) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.h b/src/server/game/Spells/Auras/SpellAuraEffects.h index c85bfb7c9af..f4aad8d16ca 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.h +++ b/src/server/game/Spells/Auras/SpellAuraEffects.h @@ -250,8 +250,6 @@ class AuraEffect void HandleAuraModRangedAttackPower(AuraApplication const* aurApp, uint8 mode, bool apply) const; void HandleAuraModAttackPowerPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const; void HandleAuraModRangedAttackPowerPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const; - void HandleAuraModRangedAttackPowerOfStatPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const; - void HandleAuraModAttackPowerOfStatPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const; void HandleAuraModAttackPowerOfArmor(AuraApplication const* aurApp, uint8 mode, bool apply) const; // damage bonus void HandleModDamageDone(AuraApplication const* aurApp, uint8 mode, bool apply) const; diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index d62e969a43c..d1cd1a9bae5 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -1060,14 +1060,7 @@ void Spell::SelectImplicitConeTargets(SpellEffIndex effIndex, SpellImplicitTarge { // Other special target selection goes here if (uint32 maxTargets = m_spellValue->MaxAffectedTargets) - { - Unit::AuraEffectList const& Auras = m_caster->GetAuraEffectsByType(SPELL_AURA_MOD_MAX_AFFECTED_TARGETS); - for (Unit::AuraEffectList::const_iterator j = Auras.begin(); j != Auras.end(); ++j) - if ((*j)->IsAffectingSpell(m_spellInfo)) - maxTargets += (*j)->GetAmount(); - Trinity::Containers::RandomResizeList(targets, maxTargets); - } // for compability with older code - add only unit and go targets // TODO: remove this @@ -1347,14 +1340,7 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge // Other special target selection goes here if (uint32 maxTargets = m_spellValue->MaxAffectedTargets) - { - Unit::AuraEffectList const& Auras = m_caster->GetAuraEffectsByType(SPELL_AURA_MOD_MAX_AFFECTED_TARGETS); - for (Unit::AuraEffectList::const_iterator j = Auras.begin(); j != Auras.end(); ++j) - if ((*j)->IsAffectingSpell(m_spellInfo)) - maxTargets += (*j)->GetAmount(); - Trinity::Containers::RandomResizeList(unitTargets, maxTargets); - } for (std::list::iterator itr = unitTargets.begin(); itr != unitTargets.end(); ++itr) AddUnitTarget(*itr, effMask, false); @@ -1363,14 +1349,7 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge if (!gObjTargets.empty()) { if (uint32 maxTargets = m_spellValue->MaxAffectedTargets) - { - Unit::AuraEffectList const& Auras = m_caster->GetAuraEffectsByType(SPELL_AURA_MOD_MAX_AFFECTED_TARGETS); - for (Unit::AuraEffectList::const_iterator j = Auras.begin(); j != Auras.end(); ++j) - if ((*j)->IsAffectingSpell(m_spellInfo)) - maxTargets += (*j)->GetAmount(); - Trinity::Containers::RandomResizeList(gObjTargets, maxTargets); - } for (std::list::iterator itr = gObjTargets.begin(); itr != gObjTargets.end(); ++itr) AddGOTarget(*itr, effMask); @@ -2719,8 +2698,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA if (m_spellInfo->AttributesEx5 & SPELL_ATTR5_HASTE_AFFECT_DURATION) m_originalCaster->ModSpellCastTime(aurSpellInfo, duration, this); } - // and duration of auras affected by SPELL_AURA_PERIODIC_HASTE - else if (m_originalCaster->HasAuraTypeWithAffectMask(SPELL_AURA_PERIODIC_HASTE, aurSpellInfo) || m_spellInfo->AttributesEx5 & SPELL_ATTR5_HASTE_AFFECT_DURATION) + else if (m_spellInfo->AttributesEx5 & SPELL_ATTR5_HASTE_AFFECT_DURATION) duration = int32(duration * m_originalCaster->GetFloatValue(UNIT_MOD_CAST_SPEED)); if (duration != m_spellAura->GetMaxDuration()) -- cgit v1.2.3 From bbe13bd12641d86e9b2e11d057d944fcf8939bd0 Mon Sep 17 00:00:00 2001 From: Subv Date: Sat, 18 Aug 2012 13:39:41 -0500 Subject: Core/Misc: Use the proper EffectUnused handler for unused spell effects --- src/server/game/Spells/SpellEffects.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index acf6f5e3507..ce41a776826 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -244,10 +244,10 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]= &Spell::EffectUnused, //175 SPELL_EFFECT_175 unused &Spell::EffectNULL, //176 SPELL_EFFECT_176 &Spell::EffectNULL, //177 SPELL_EFFECT_177 - &Spell::EffectNULL, //178 SPELL_EFFECT_178 + &Spell::EffectUnused, //178 SPELL_EFFECT_178 unused &Spell::EffectNULL, //179 SPELL_EFFECT_179 - &Spell::EffectNULL, //180 SPELL_EFFECT_180 - &Spell::EffectNULL, //181 SPELL_EFFECT_181 + &Spell::EffectUnused, //180 SPELL_EFFECT_180 unused + &Spell::EffectUnused, //181 SPELL_EFFECT_181 unused &Spell::EffectNULL, //182 SPELL_EFFECT_182 }; -- cgit v1.2.3 From c7aa77bcc07611eedd6bbcb4cafeabd14749bf28 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 18 Aug 2012 21:02:39 +0200 Subject: Core/Spells: Fixed adding extra periodic ticks from haste --- src/server/game/Spells/Spell.cpp | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index d1cd1a9bae5..697be0e48c9 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -2692,14 +2692,28 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA duration = m_originalCaster->ModSpellDuration(aurSpellInfo, unit, duration, positive, effectMask); - // Haste modifies duration of channeled spells - if (m_spellInfo->IsChanneled()) + if (duration > 0) { - if (m_spellInfo->AttributesEx5 & SPELL_ATTR5_HASTE_AFFECT_DURATION) - m_originalCaster->ModSpellCastTime(aurSpellInfo, duration, this); + // Haste modifies duration of channeled spells + if (m_spellInfo->IsChanneled()) + { + if (m_spellInfo->AttributesEx5 & SPELL_ATTR5_HASTE_AFFECT_DURATION) + m_originalCaster->ModSpellCastTime(aurSpellInfo, duration, this); + } + else if (m_spellInfo->AttributesEx5 & SPELL_ATTR5_HASTE_AFFECT_DURATION) + { + int32 origDuration = duration; + duration = 0; + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) + if (AuraEffect const* eff = m_spellAura->GetEffect(i)) + if (int32 amplitude = eff->GetAmplitude()) // amplitude is hastened by UNIT_MOD_CAST_SPEED + duration = std::max(std::max(origDuration / amplitude, 1) * amplitude, duration); + + // if there is no periodic effect + if (!duration) + duration = int32(origDuration * m_originalCaster->GetFloatValue(UNIT_MOD_CAST_SPEED)); + } } - else if (m_spellInfo->AttributesEx5 & SPELL_ATTR5_HASTE_AFFECT_DURATION) - duration = int32(duration * m_originalCaster->GetFloatValue(UNIT_MOD_CAST_SPEED)); if (duration != m_spellAura->GetMaxDuration()) { -- cgit v1.2.3 From bb3e2d6804c5f273435f7d49eb606fb401799232 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 18 Aug 2012 21:03:01 +0200 Subject: Core/Player: Fixed loading glyphs --- src/server/game/Entities/Player/Player.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 40f124812b8..06b4e69009b 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -25113,7 +25113,7 @@ void Player::_LoadGlyphs(PreparedQueryResult result) if (spec >= GetSpecsCount()) continue; - for (uint8 i = 0; i < 6; ++i) + for (uint8 i = 0; i < MAX_GLYPH_SLOT_INDEX; ++i) _talentMgr->SpecInfo[spec].Glyphs[i] = fields[i + 1].GetUInt16(); } while (result->NextRow()); -- cgit v1.2.3 From 1939f6d4485b33e669753519d58b0070f3447af8 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 18 Aug 2012 21:05:30 +0200 Subject: Core/Misc: Corrected date sent for db reply when there are no hotfixes --- src/server/game/Globals/ObjectMgr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index f80881dd7ac..c176cf42e1a 100755 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -1144,7 +1144,7 @@ class ObjectMgr if (itr->Timestamp > ret) ret = itr->Timestamp; - return ret; + return ret ? ret : time(NULL); } private: -- cgit v1.2.3 From 6c14a51fe4e44c0ef3eedeba655fa854a8469bfa Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 18 Aug 2012 21:08:21 +0100 Subject: Core/Quests: Split Flags and SpecialFlags --- src/server/game/AI/SmartScripts/SmartScriptMgr.cpp | 2 +- src/server/game/Entities/Player/Player.cpp | 42 +++++++++---------- src/server/game/Globals/ObjectMgr.cpp | 48 +++++++++++----------- src/server/game/Handlers/QuestHandler.cpp | 2 +- src/server/game/Quests/QuestDef.cpp | 17 ++++---- src/server/game/Quests/QuestDef.h | 43 ++++++++++++------- 6 files changed, 83 insertions(+), 71 deletions(-) (limited to 'src') diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index 3b69408354e..a40024a81cd 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -676,7 +676,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) case SMART_ACTION_CALL_GROUPEVENTHAPPENS: if (Quest const* qid = sObjectMgr->GetQuestTemplate(e.action.quest.quest)) { - if (!qid->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT)) + if (!qid->HasSpecialFlag(QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT)) { sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u SpecialFlags for Quest entry %u does not include FLAGS_EXPLORATION_OR_EVENT(2), skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.quest.quest); return false; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 06b4e69009b..1fc9aaf7322 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -14686,7 +14686,7 @@ bool Player::CanCompleteQuest(uint32 quest_id) if (q_status.Status == QUEST_STATUS_INCOMPLETE) { - if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_DELIVER)) + if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_DELIVER)) { for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; i++) { @@ -14695,7 +14695,7 @@ bool Player::CanCompleteQuest(uint32 quest_id) } } - if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_KILL_OR_CAST | QUEST_TRINITY_FLAGS_SPEAKTO)) + if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_KILL_OR_CAST | QUEST_SPECIAL_FLAGS_SPEAKTO)) { for (uint8 i = 0; i < QUEST_OBJECTIVES_COUNT; i++) { @@ -14707,14 +14707,14 @@ bool Player::CanCompleteQuest(uint32 quest_id) } } - if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_PLAYER_KILL)) + if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_PLAYER_KILL)) if (qInfo->GetPlayersSlain() != 0 && q_status.PlayerCount < qInfo->GetPlayersSlain()) return false; - if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT) && !q_status.Explored) + if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT) && !q_status.Explored) return false; - if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_TIMED) && q_status.Timer == 0) + if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_TIMED) && q_status.Timer == 0) return false; if (qInfo->GetRewOrReqMoney() < 0) @@ -14741,7 +14741,7 @@ bool Player::CanCompleteRepeatableQuest(Quest const* quest) if (!CanTakeQuest(quest, false)) return false; - if (quest->HasFlag(QUEST_TRINITY_FLAGS_DELIVER)) + if (quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_DELIVER)) for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; i++) if (quest->RequiredItemId[i] && quest->RequiredItemCount[i] && !HasItemCount(quest->RequiredItemId[i], quest->RequiredItemCount[i])) return false; @@ -14767,7 +14767,7 @@ bool Player::CanRewardQuest(Quest const* quest, bool msg) return false; // prevent receive reward with quest items in bank - if (quest->HasFlag(QUEST_TRINITY_FLAGS_DELIVER)) + if (quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_DELIVER)) { for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; i++) { @@ -14844,19 +14844,19 @@ void Player::AddQuest(Quest const* quest, Object* questGiver) questStatusData.Status = QUEST_STATUS_INCOMPLETE; questStatusData.Explored = false; - if (quest->HasFlag(QUEST_TRINITY_FLAGS_DELIVER)) + if (quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_DELIVER)) { for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) questStatusData.ItemCount[i] = 0; } - if (quest->HasFlag(QUEST_TRINITY_FLAGS_KILL_OR_CAST | QUEST_TRINITY_FLAGS_SPEAKTO)) + if (quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_KILL_OR_CAST | QUEST_SPECIAL_FLAGS_SPEAKTO)) { for (uint8 i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) questStatusData.CreatureOrGOCount[i] = 0; } - if (quest->HasFlag(QUEST_TRINITY_FLAGS_PLAYER_KILL)) + if (quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_PLAYER_KILL)) questStatusData.PlayerCount = 0; GiveQuestSourceItem(quest); @@ -14871,7 +14871,7 @@ void Player::AddQuest(Quest const* quest, Object* questGiver) GetReputationMgr().SetVisible(factionEntry); uint32 qtime = 0; - if (quest->HasFlag(QUEST_TRINITY_FLAGS_TIMED)) + if (quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_TIMED)) { uint32 limittime = quest->GetLimitTime(); @@ -15139,7 +15139,7 @@ void Player::FailQuest(uint32 questId) SetQuestSlotState(log_slot, QUEST_STATE_FAIL); } - if (quest->HasFlag(QUEST_TRINITY_FLAGS_TIMED)) + if (quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_TIMED)) { QuestStatusData& q_status = m_QuestStatus[questId]; @@ -15394,7 +15394,7 @@ bool Player::SatisfyQuestConditions(Quest const* qInfo, bool msg) bool Player::SatisfyQuestTimed(Quest const* qInfo, bool msg) { - if (!m_timedquests.empty() && qInfo->HasFlag(QUEST_TRINITY_FLAGS_TIMED)) + if (!m_timedquests.empty() && qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_TIMED)) { if (msg) SendCanTakeQuestResponse(INVALIDREASON_QUEST_ONLY_ONE_TIMED); @@ -15703,7 +15703,7 @@ uint16 Player::GetReqKillOrCastCurrentCount(uint32 quest_id, int32 entry) void Player::AdjustQuestReqItemCount(Quest const* quest, QuestStatusData& questStatusData) { - if (quest->HasFlag(QUEST_TRINITY_FLAGS_DELIVER)) + if (quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_DELIVER)) { for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) { @@ -15780,7 +15780,7 @@ void Player::ItemAddedQuestCheck(uint32 entry, uint32 count) continue; Quest const* qInfo = sObjectMgr->GetQuestTemplate(questid); - if (!qInfo || !qInfo->HasFlag(QUEST_TRINITY_FLAGS_DELIVER)) + if (!qInfo || !qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_DELIVER)) continue; for (uint8 j = 0; j < QUEST_ITEM_OBJECTIVES_COUNT; ++j) @@ -15819,7 +15819,7 @@ void Player::ItemRemovedQuestCheck(uint32 entry, uint32 count) Quest const* qInfo = sObjectMgr->GetQuestTemplate(questid); if (!qInfo) continue; - if (!qInfo->HasFlag(QUEST_TRINITY_FLAGS_DELIVER)) + if (!qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_DELIVER)) continue; for (uint8 j = 0; j < QUEST_ITEM_OBJECTIVES_COUNT; ++j) @@ -15888,7 +15888,7 @@ void Player::KilledMonsterCredit(uint32 entry, uint64 guid) QuestStatusData& q_status = m_QuestStatus[questid]; if (q_status.Status == QUEST_STATUS_INCOMPLETE && (!GetGroup() || !GetGroup()->isRaidGroup() || qInfo->IsAllowedInRaid())) { - if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_KILL_OR_CAST)) + if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_KILL_OR_CAST)) { for (uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j) { @@ -15943,7 +15943,7 @@ void Player::KilledPlayerCredit() QuestStatusData& q_status = m_QuestStatus[questid]; if (q_status.Status == QUEST_STATUS_INCOMPLETE && (!GetGroup() || !GetGroup()->isRaidGroup() || qInfo->IsAllowedInRaid())) { - if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_PLAYER_KILL)) + if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_PLAYER_KILL)) { uint32 reqkill = qInfo->GetPlayersSlain(); uint16 curkill = q_status.PlayerCount; @@ -15985,7 +15985,7 @@ void Player::CastedCreatureOrGO(uint32 entry, uint64 guid, uint32 spell_id) if (q_status.Status == QUEST_STATUS_INCOMPLETE) { - if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_KILL_OR_CAST)) + if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_KILL_OR_CAST)) { for (uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j) { @@ -16062,7 +16062,7 @@ void Player::TalkedToCreature(uint32 entry, uint64 guid) if (q_status.Status == QUEST_STATUS_INCOMPLETE) { - if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_KILL_OR_CAST | QUEST_TRINITY_FLAGS_SPEAKTO)) + if (qInfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_KILL_OR_CAST | QUEST_SPECIAL_FLAGS_SPEAKTO)) { for (uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j) { @@ -17900,7 +17900,7 @@ void Player::_LoadQuestStatus(PreparedQueryResult result) time_t quest_time = time_t(fields[3].GetUInt32()); - if (quest->HasFlag(QUEST_TRINITY_FLAGS_TIMED) && !GetQuestRewardStatus(quest_id)) + if (quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_TIMED) && !GetQuestRewardStatus(quest_id)) { AddTimedQuest(quest_id); diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index cd3cca4ac5e..b87cb2d7fbf 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -3474,11 +3474,11 @@ void ObjectMgr::LoadQuests() if (qinfo->GetQuestMethod() >= 3) sLog->outError(LOG_FILTER_SQL, "Quest %u has `Method` = %u, expected values are 0, 1 or 2.", qinfo->GetQuestId(), qinfo->GetQuestMethod()); - if (qinfo->Flags & ~QUEST_TRINITY_FLAGS_DB_ALLOWED) + if (qinfo->SpecialFlags & ~QUEST_SPECIAL_FLAGS_DB_ALLOWED) { sLog->outError(LOG_FILTER_SQL, "Quest %u has `SpecialFlags` = %u > max allowed value. Correct `SpecialFlags` to value <= %u", - qinfo->GetQuestId(), qinfo->Flags >> 20, QUEST_TRINITY_FLAGS_DB_ALLOWED >> 20); - qinfo->Flags &= QUEST_TRINITY_FLAGS_DB_ALLOWED; + qinfo->GetQuestId(), qinfo->SpecialFlags, QUEST_SPECIAL_FLAGS_DB_ALLOWED); + qinfo->SpecialFlags &= QUEST_SPECIAL_FLAGS_DB_ALLOWED; } if (qinfo->Flags & QUEST_FLAGS_DAILY && qinfo->Flags & QUEST_FLAGS_WEEKLY) @@ -3489,19 +3489,19 @@ void ObjectMgr::LoadQuests() if (qinfo->Flags & QUEST_FLAGS_DAILY) { - if (!(qinfo->Flags & QUEST_TRINITY_FLAGS_REPEATABLE)) + if (!(qinfo->SpecialFlags & QUEST_SPECIAL_FLAGS_REPEATABLE)) { sLog->outError(LOG_FILTER_SQL, "Daily Quest %u not marked as repeatable in `SpecialFlags`, added.", qinfo->GetQuestId()); - qinfo->Flags |= QUEST_TRINITY_FLAGS_REPEATABLE; + qinfo->SpecialFlags |= QUEST_SPECIAL_FLAGS_REPEATABLE; } } if (qinfo->Flags & QUEST_FLAGS_WEEKLY) { - if (!(qinfo->Flags & QUEST_TRINITY_FLAGS_REPEATABLE)) + if (!(qinfo->SpecialFlags & QUEST_SPECIAL_FLAGS_REPEATABLE)) { sLog->outError(LOG_FILTER_SQL, "Weekly Quest %u not marked as repeatable in `SpecialFlags`, added.", qinfo->GetQuestId()); - qinfo->Flags |= QUEST_TRINITY_FLAGS_REPEATABLE; + qinfo->SpecialFlags |= QUEST_SPECIAL_FLAGS_REPEATABLE; } } @@ -3725,7 +3725,7 @@ void ObjectMgr::LoadQuests() // no changes, quest can't be done for this requirement } - qinfo->SetFlag(QUEST_TRINITY_FLAGS_DELIVER); + qinfo->SetSpecialFlag(QUEST_SPECIAL_FLAGS_DELIVER); if (!sObjectMgr->GetItemTemplate(id)) { @@ -3793,12 +3793,12 @@ void ObjectMgr::LoadQuests() if (found) { - if (!qinfo->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT)) + if (!qinfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT)) { - sLog->outError(LOG_FILTER_SQL, "Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE or SPELL_EFFECT_SEND_EVENT for quest %u and RequiredNpcOrGo%d = 0, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Quest flags or RequiredNpcOrGo%d must be fixed, quest modified to enable objective.", spellInfo->Id, qinfo->Id, j+1, j+1); + sLog->outError(LOG_FILTER_SQL, "Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE or SPELL_EFFECT_SEND_EVENT for quest %u and RequiredNpcOrGo%d = 0, but quest not have flag QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT. Quest flags or RequiredNpcOrGo%d must be fixed, quest modified to enable objective.", spellInfo->Id, qinfo->Id, j+1, j+1); // this will prevent quest completing without objective - const_cast(qinfo)->SetFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT); + const_cast(qinfo)->SetSpecialFlag(QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT); } } else @@ -3832,7 +3832,7 @@ void ObjectMgr::LoadQuests() { // In fact SpeakTo and Kill are quite same: either you can speak to mob:SpeakTo or you can't:Kill/Cast - qinfo->SetFlag(QUEST_TRINITY_FLAGS_KILL_OR_CAST | QUEST_TRINITY_FLAGS_SPEAKTO); + qinfo->SetSpecialFlag(QUEST_SPECIAL_FLAGS_KILL_OR_CAST | QUEST_SPECIAL_FLAGS_SPEAKTO); if (!qinfo->RequiredNpcOrGoCount[j]) { @@ -4165,12 +4165,12 @@ void ObjectMgr::LoadQuests() if (qinfo->ExclusiveGroup) mExclusiveQuestGroups.insert(std::pair(qinfo->ExclusiveGroup, qinfo->GetQuestId())); if (qinfo->LimitTime) - qinfo->SetFlag(QUEST_TRINITY_FLAGS_TIMED); + qinfo->SetSpecialFlag(QUEST_SPECIAL_FLAGS_TIMED); if (qinfo->RequiredPlayerKills) - qinfo->SetFlag(QUEST_TRINITY_FLAGS_PLAYER_KILL); + qinfo->SetSpecialFlag(QUEST_SPECIAL_FLAGS_PLAYER_KILL); } - // check QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT for spell with SPELL_EFFECT_QUEST_COMPLETE + // check QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT for spell with SPELL_EFFECT_QUEST_COMPLETE for (uint32 i = 0; i < sSpellMgr->GetSpellInfoStoreSize(); ++i) { SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(i); @@ -4190,12 +4190,12 @@ void ObjectMgr::LoadQuests() if (!quest) continue; - if (!quest->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT)) + if (!quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT)) { - sLog->outError(LOG_FILTER_SQL, "Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE for quest %u, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Quest flags must be fixed, quest modified to enable objective.", spellInfo->Id, quest_id); + sLog->outError(LOG_FILTER_SQL, "Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE for quest %u, but quest not have flag QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT. Quest flags must be fixed, quest modified to enable objective.", spellInfo->Id, quest_id); // this will prevent quest completing without objective - const_cast(quest)->SetFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT); + const_cast(quest)->SetSpecialFlag(QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT); } } } @@ -4371,13 +4371,13 @@ void ObjectMgr::LoadScripts(ScriptsType type) continue; } - if (!quest->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT)) + if (!quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT)) { - sLog->outError(LOG_FILTER_SQL, "Table `%s` has quest (ID: %u) in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT in quest flags. Script command or quest flags wrong. Quest modified to require objective.", + sLog->outError(LOG_FILTER_SQL, "Table `%s` has quest (ID: %u) in SCRIPT_COMMAND_QUEST_EXPLORED in `datalong` for script id %u, but quest not have flag QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT in quest flags. Script command or quest flags wrong. Quest modified to require objective.", tableName.c_str(), tmp.QuestExplored.QuestID, tmp.id); // this will prevent quest completing without objective - const_cast(quest)->SetFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT); + const_cast(quest)->SetSpecialFlag(QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT); // continue; - quest objective requirement set and command can be allowed } @@ -5297,12 +5297,12 @@ void ObjectMgr::LoadQuestAreaTriggers() continue; } - if (!quest->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT)) + if (!quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT)) { - sLog->outError(LOG_FILTER_SQL, "Table `areatrigger_involvedrelation` has record (id: %u) for not quest %u, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Trigger or quest flags must be fixed, quest modified to require objective.", trigger_ID, quest_ID); + sLog->outError(LOG_FILTER_SQL, "Table `areatrigger_involvedrelation` has record (id: %u) for not quest %u, but quest not have flag QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT. Trigger or quest flags must be fixed, quest modified to require objective.", trigger_ID, quest_ID); // this will prevent quest completing without objective - const_cast(quest)->SetFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT); + const_cast(quest)->SetSpecialFlag(QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT); // continue; - quest modified to required objective and trigger can be allowed. } diff --git a/src/server/game/Handlers/QuestHandler.cpp b/src/server/game/Handlers/QuestHandler.cpp index 8b7319b760b..4c44427cf14 100644 --- a/src/server/game/Handlers/QuestHandler.cpp +++ b/src/server/game/Handlers/QuestHandler.cpp @@ -427,7 +427,7 @@ void WorldSession::HandleQuestLogRemoveQuest(WorldPacket& recvData) if (const Quest *quest = sObjectMgr->GetQuestTemplate(questId)) { - if (quest->HasFlag(QUEST_TRINITY_FLAGS_TIMED)) + if (quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_TIMED)) _player->RemoveTimedQuest(questId); } diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index f259d57d839..c694e964e20 100755 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -61,7 +61,7 @@ Quest::Quest(Field* questRecord) SourceItemIdCount = questRecord[35].GetUInt8(); SourceSpellid = questRecord[36].GetUInt32(); Flags = questRecord[37].GetUInt32(); - uint32 SpecialFlags = questRecord[38].GetUInt8(); + SpecialFlags = questRecord[38].GetUInt8(); MinimapTargetMark = questRecord[39].GetUInt8(); RewardTitleId = questRecord[40].GetUInt8(); RequiredPlayerKills = questRecord[41].GetUInt8(); @@ -171,8 +171,7 @@ Quest::Quest(Field* questRecord) // int32 WDBVerified = questRecord[174].GetInt32(); - Flags |= SpecialFlags << 20; - if (Flags & QUEST_TRINITY_FLAGS_AUTO_ACCEPT) + if (SpecialFlags & QUEST_SPECIAL_FLAGS_AUTO_ACCEPT) Flags |= QUEST_FLAGS_AUTO_ACCEPT; m_reqItemsCount = 0; @@ -182,27 +181,27 @@ Quest::Quest(Field* questRecord) m_rewCurrencyCount = 0; m_reqCurrencyCount = 0; - for (int i=0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) + for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i) if (RequiredItemId[i]) ++m_reqItemsCount; - for (int i=0; i < QUEST_OBJECTIVES_COUNT; ++i) + for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) if (RequiredNpcOrGo[i]) ++m_reqNpcOrGoCount; - for (int i=0; i < QUEST_REWARDS_COUNT; ++i) + for (int i = 0; i < QUEST_REWARDS_COUNT; ++i) if (RewardItemId[i]) ++m_rewItemsCount; - for (int i=0; i < QUEST_REWARD_CHOICES_COUNT; ++i) + for (int i = 0; i < QUEST_REWARD_CHOICES_COUNT; ++i) if (RewardChoiceItemId[i]) ++m_rewChoiceItemsCount; - for (int i=0; i < QUEST_REWARD_CURRENCY_COUNT; ++i) + for (int i = 0; i < QUEST_REWARD_CURRENCY_COUNT; ++i) if (RewardCurrencyId[i]) ++m_rewCurrencyCount; - for (int i=0; i < QUEST_REQUIRED_CURRENCY_COUNT; ++i) + for (int i = 0; i < QUEST_REQUIRED_CURRENCY_COUNT; ++i) if (RequiredCurrencyId[i]) ++m_reqCurrencyCount; diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h index d0441879041..c51ba3248a6 100755 --- a/src/server/game/Quests/QuestDef.h +++ b/src/server/game/Quests/QuestDef.h @@ -149,20 +149,27 @@ enum __QuestFlags QUEST_FLAGS_OBJ_TEXT = 0x00040000, // use Objective text as Complete text QUEST_FLAGS_AUTO_ACCEPT = 0x00080000, // The client recognizes this flag as auto-accept. However, NONE of the current quests (3.3.5a) have this flag. Maybe blizz used to use it, or will use it in the future. + // ... 4.x added flags up to 0x80000000 - all unknown for now +}; + +enum __QuestSpecialFlags +{ + QUEST_SPECIAL_FLAGS_NONE = 0x000, // Trinity flags for set SpecialFlags in DB if required but used only at server - QUEST_TRINITY_FLAGS_REPEATABLE = 0x00100000, // Set by 1 in SpecialFlags from DB - QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT = 0x00200000, // Set by 2 in SpecialFlags from DB (if reequired area explore, spell SPELL_EFFECT_QUEST_COMPLETE casting, table `*_script` command SCRIPT_COMMAND_QUEST_EXPLORED use, set from script) - QUEST_TRINITY_FLAGS_AUTO_ACCEPT = 0x00400000, // Set by 4 in SpecialFlags in DB if the quest is to be auto-accepted. - QUEST_TRINITY_FLAGS_DF_QUEST = 0x00800000, // Set by 8 in SpecialFlags in DB if the quest is used by Dungeon Finder. - - QUEST_TRINITY_FLAGS_DB_ALLOWED = 0xFFFFF | QUEST_TRINITY_FLAGS_REPEATABLE | QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT | QUEST_TRINITY_FLAGS_AUTO_ACCEPT | QUEST_TRINITY_FLAGS_DF_QUEST, - - // Trinity flags for internal use only - QUEST_TRINITY_FLAGS_DELIVER = 0x04000000, // Internal flag computed only - QUEST_TRINITY_FLAGS_SPEAKTO = 0x08000000, // Internal flag computed only - QUEST_TRINITY_FLAGS_KILL_OR_CAST = 0x10000000, // Internal flag computed only - QUEST_TRINITY_FLAGS_TIMED = 0x20000000, // Internal flag computed only - QUEST_TRINITY_FLAGS_PLAYER_KILL = 0x40000000, // Internal flag computed only + QUEST_SPECIAL_FLAGS_REPEATABLE = 0x001, + QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT = 0x002, // if required area explore, spell SPELL_EFFECT_QUEST_COMPLETE casting, table `*_script` command SCRIPT_COMMAND_QUEST_EXPLORED use, set from script) + QUEST_SPECIAL_FLAGS_AUTO_ACCEPT = 0x004, // quest is to be auto-accepted. + QUEST_SPECIAL_FLAGS_DF_QUEST = 0x008, // quest is used by Dungeon Finder. + + // room for more custom flags + + QUEST_SPECIAL_FLAGS_DB_ALLOWED = QUEST_SPECIAL_FLAGS_REPEATABLE | QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT | QUEST_SPECIAL_FLAGS_AUTO_ACCEPT | QUEST_SPECIAL_FLAGS_DF_QUEST, + + QUEST_SPECIAL_FLAGS_DELIVER = 0x080, // Internal flag computed only + QUEST_SPECIAL_FLAGS_SPEAKTO = 0x100, // Internal flag computed only + QUEST_SPECIAL_FLAGS_KILL_OR_CAST = 0x200, // Internal flag computed only + QUEST_SPECIAL_FLAGS_TIMED = 0x400, // Internal flag computed only + QUEST_SPECIAL_FLAGS_PLAYER_KILL = 0x800, // Internal flag computed only }; struct QuestLocale @@ -197,6 +204,9 @@ class Quest bool HasFlag(uint32 flag) const { return (Flags & flag) != 0; } void SetFlag(uint32 flag) { Flags |= flag; } + bool HasSpecialFlag(uint32 flag) const { return (SpecialFlags & flag) != 0; } + void SetSpecialFlag(uint32 flag) { Flags |= flag; } + // table data accessors: uint32 GetQuestId() const { return Id; } uint32 GetQuestMethod() const { return Method; } @@ -261,10 +271,11 @@ class Quest uint32 GetCompleteEmote() const { return EmoteOnComplete; } uint32 GetQuestStartScript() const { return StartScript; } uint32 GetQuestCompleteScript() const { return CompleteScript; } - bool IsRepeatable() const { return Flags & QUEST_TRINITY_FLAGS_REPEATABLE; } + bool IsRepeatable() const { return SpecialFlags & QUEST_SPECIAL_FLAGS_REPEATABLE; } bool IsAutoAccept() const; bool IsAutoComplete() const; uint32 GetFlags() const { return Flags; } + uint32 GetSpecialFlags() const { return SpecialFlags; } uint32 GetMinimapTargetMark() const { return MinimapTargetMark; } uint32 GetRewardSkillId() const { return RewardSkillId; } uint32 GetRewardSkillPoints() const { return RewardSkillPoints; } @@ -277,7 +288,7 @@ class Quest bool IsDailyOrWeekly() const { return Flags & (QUEST_FLAGS_DAILY | QUEST_FLAGS_WEEKLY); } bool IsRaidQuest() const { return Type == QUEST_TYPE_RAID || Type == QUEST_TYPE_RAID_10 || Type == QUEST_TYPE_RAID_25; } bool IsAllowedInRaid() const; - bool IsDFQuest() const { return Flags & QUEST_TRINITY_FLAGS_DF_QUEST; } + bool IsDFQuest() const { return SpecialFlags & QUEST_SPECIAL_FLAGS_DF_QUEST; } uint32 CalculateHonorGain(uint8 level) const; // multiple values @@ -402,6 +413,8 @@ class Quest std::string QuestTurnTargetName; uint32 SoundAccept; uint32 SoundTurnIn; + + uint32 SpecialFlags; // custom flags, not sniffed/WDB }; struct QuestStatusData -- cgit v1.2.3 From f1f33ff09b7bf2d826a47a5d8cbbb04eb16db293 Mon Sep 17 00:00:00 2001 From: Subv Date: Sat, 18 Aug 2012 15:02:03 -0500 Subject: Core/Entities: Spirit no longer affects HP regen --- src/server/game/Entities/Player/Player.cpp | 22 +--------------------- src/server/game/Entities/Player/Player.h | 1 - 2 files changed, 1 insertion(+), 22 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 1fc9aaf7322..23af34ddeee 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -2699,7 +2699,7 @@ void Player::RegenerateHealth() // normal regen case (maybe partly in combat case) else if (!isInCombat() || HasAuraType(SPELL_AURA_MOD_REGEN_DURING_COMBAT)) { - addvalue = OCTRegenHPPerSpirit() * HealthIncreaseRate; + addvalue = HealthIncreaseRate; if (!isInCombat()) { AuraEffectList const& mModHealthRegenPct = GetAuraEffectsByType(SPELL_AURA_MOD_HEALTH_REGEN_PERCENT); @@ -5864,26 +5864,6 @@ float Player::GetExpertiseDodgeOrParryReduction(WeaponAttackType attType) const return 0.0f; } -float Player::OCTRegenHPPerSpirit() -{ - /* - uint8 level = getLevel(); - uint32 pclass = getClass(); - - if (level > GT_MAX_LEVEL) - level = GT_MAX_LEVEL; - */ - - // Formula from PaperDollFrame script - float spirit = GetStat(STAT_SPIRIT); - float baseSpirit = spirit; - if (baseSpirit > 50) - baseSpirit = 50; - float moreSpirit = spirit - baseSpirit; - float regen = baseSpirit + moreSpirit; - return regen; -} - float Player::OCTRegenMPPerSpirit() { uint8 level = getLevel(); diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index b0e2a008f3f..a57c1fe908c 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1955,7 +1955,6 @@ class Player : public Unit, public GridObject float GetMeleeCritFromAgility(); void GetDodgeFromAgility(float &diminishing, float &nondiminishing); float GetSpellCritFromIntellect(); - float OCTRegenHPPerSpirit(); float OCTRegenMPPerSpirit(); float GetRatingMultiplier(CombatRating cr) const; float GetRatingBonusValue(CombatRating cr) const; -- cgit v1.2.3 From 1be45d1a0a759dbdb817ff3812015ecc1ea916ca Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Sat, 18 Aug 2012 22:16:41 +0200 Subject: Scripts/Zul Gurub: cleanup for cata --- src/server/game/Scripting/ScriptLoader.cpp | 41 +- src/server/scripts/EasternKingdoms/CMakeLists.txt | 18 +- .../EasternKingdoms/ZulGurub/boss_arlokk.cpp | 293 ---------- .../EasternKingdoms/ZulGurub/boss_gahzranka.cpp | 99 ---- .../EasternKingdoms/ZulGurub/boss_grilek.cpp | 74 ++- .../EasternKingdoms/ZulGurub/boss_hakkar.cpp | 259 --------- .../EasternKingdoms/ZulGurub/boss_hazzarah.cpp | 87 ++- .../EasternKingdoms/ZulGurub/boss_jeklik.cpp | 306 ----------- .../EasternKingdoms/ZulGurub/boss_jindo.cpp | 283 ---------- .../ZulGurub/boss_jindo_the_godbreaker.cpp | 91 ++++ .../EasternKingdoms/ZulGurub/boss_kilnara.cpp | 92 ++++ .../EasternKingdoms/ZulGurub/boss_mandokir.cpp | 307 +---------- .../EasternKingdoms/ZulGurub/boss_marli.cpp | 275 ---------- .../EasternKingdoms/ZulGurub/boss_renataki.cpp | 134 ++--- .../EasternKingdoms/ZulGurub/boss_thekal.cpp | 588 --------------------- .../EasternKingdoms/ZulGurub/boss_venoxis.cpp | 205 +------ .../EasternKingdoms/ZulGurub/boss_wushoolay.cpp | 72 ++- .../EasternKingdoms/ZulGurub/boss_zanzil.cpp | 91 ++++ .../EasternKingdoms/ZulGurub/instance_zulgurub.cpp | 239 +++++---- .../scripts/EasternKingdoms/ZulGurub/zulgurub.h | 51 +- 20 files changed, 644 insertions(+), 2961 deletions(-) delete mode 100644 src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp delete mode 100644 src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp delete mode 100644 src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp delete mode 100644 src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp delete mode 100644 src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp create mode 100644 src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo_the_godbreaker.cpp create mode 100644 src/server/scripts/EasternKingdoms/ZulGurub/boss_kilnara.cpp delete mode 100644 src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp delete mode 100644 src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp create mode 100644 src/server/scripts/EasternKingdoms/ZulGurub/boss_zanzil.cpp (limited to 'src') diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index 2db840bf39a..47e09222211 100755 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -227,21 +227,16 @@ void AddSC_boss_nalorakk(); void AddSC_boss_zuljin(); void AddSC_instance_zulaman(); void AddSC_zulaman(); -void AddSC_boss_jeklik(); //Zul'Gurub -void AddSC_boss_venoxis(); -void AddSC_boss_marli(); -void AddSC_boss_mandokir(); -void AddSC_boss_gahzranka(); -void AddSC_boss_thekal(); -void AddSC_boss_arlokk(); -void AddSC_boss_jindo(); -void AddSC_boss_hakkar(); -void AddSC_boss_grilek(); +void AddSC_boss_grilek(); // Zul'Gurub void AddSC_boss_hazzarah(); +void AddSC_boss_jindo_the_godbreaker(); +void AddSC_boss_kilnara(); +void AddSC_boss_mandokir(); void AddSC_boss_renataki(); +void AddSC_boss_venoxis(); void AddSC_boss_wushoolay(); +void AddSC_boss_zanzil(); void AddSC_instance_zulgurub(); - //void AddSC_alterac_mountains(); void AddSC_arathi_highlands(); void AddSC_blasted_lands(); @@ -846,20 +841,16 @@ void AddEasternKingdomsScripts() AddSC_boss_zuljin(); AddSC_instance_zulaman(); AddSC_zulaman(); - AddSC_boss_jeklik(); //Zul'Gurub - AddSC_boss_venoxis(); - AddSC_boss_marli(); - AddSC_boss_mandokir(); - AddSC_boss_gahzranka(); - AddSC_boss_thekal(); - AddSC_boss_arlokk(); - AddSC_boss_jindo(); - AddSC_boss_hakkar(); - AddSC_boss_grilek(); - AddSC_boss_hazzarah(); - AddSC_boss_renataki(); - AddSC_boss_wushoolay(); - AddSC_instance_zulgurub(); + AddSC_boss_grilek(); // Zul'Gurub + AddSC_boss_hazzarah(); + AddSC_boss_jindo_the_godbreaker(); + AddSC_boss_kilnara(); + AddSC_boss_mandokir(); + AddSC_boss_renataki(); + AddSC_boss_venoxis(); + AddSC_boss_wushoolay(); + AddSC_boss_zanzil(); + AddSC_instance_zulgurub(); //AddSC_alterac_mountains(); AddSC_arathi_highlands(); diff --git a/src/server/scripts/EasternKingdoms/CMakeLists.txt b/src/server/scripts/EasternKingdoms/CMakeLists.txt index de3e6ae32a6..3db2545e2c1 100644 --- a/src/server/scripts/EasternKingdoms/CMakeLists.txt +++ b/src/server/scripts/EasternKingdoms/CMakeLists.txt @@ -32,21 +32,17 @@ set(scripts_STAT_SRCS EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp EasternKingdoms/isle_of_queldanas.cpp - EasternKingdoms/ZulGurub/boss_hakkar.cpp - EasternKingdoms/ZulGurub/boss_mandokir.cpp - EasternKingdoms/ZulGurub/boss_marli.cpp - EasternKingdoms/ZulGurub/boss_hazzarah.cpp - EasternKingdoms/ZulGurub/boss_jeklik.cpp EasternKingdoms/ZulGurub/boss_grilek.cpp - EasternKingdoms/ZulGurub/zulgurub.h + EasternKingdoms/ZulGurub/boss_hazzarah.cpp + EasternKingdoms/ZulGurub/boss_jindo_the_godbreaker.cpp + EasternKingdoms/ZulGurub/boss_kilnara.cpp + EasternKingdoms/ZulGurub/boss_mandokir.cpp EasternKingdoms/ZulGurub/boss_renataki.cpp - EasternKingdoms/ZulGurub/boss_arlokk.cpp - EasternKingdoms/ZulGurub/boss_gahzranka.cpp EasternKingdoms/ZulGurub/boss_venoxis.cpp - EasternKingdoms/ZulGurub/instance_zulgurub.cpp - EasternKingdoms/ZulGurub/boss_jindo.cpp EasternKingdoms/ZulGurub/boss_wushoolay.cpp - EasternKingdoms/ZulGurub/boss_thekal.cpp + EasternKingdoms/ZulGurub/boss_zanzil.cpp + EasternKingdoms/ZulGurub/instance_zulgurub.cpp + EasternKingdoms/ZulGurub/zulgurub.h EasternKingdoms/wetlands.cpp EasternKingdoms/arathi_highlands.cpp EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp deleted file mode 100644 index 17c3f5e8ff4..00000000000 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp +++ /dev/null @@ -1,293 +0,0 @@ -/* - * Copyright (C) 2008-2012 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 - * - * 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; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; 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, see . - */ - -/* ScriptData -SDName: Boss_Arlokk -SD%Complete: 95 -SDComment: Wrong cleave and red aura is missing. -SDCategory: Zul'Gurub -EndScriptData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "zulgurub.h" - -enum eYells -{ - SAY_AGGRO = -1309011, - SAY_FEAST_PANTHER = -1309012, - SAY_DEATH = -1309013, -}; - -enum eSpells -{ - SPELL_SHADOWWORDPAIN = 23952, - SPELL_GOUGE = 24698, - SPELL_MARK = 24210, - SPELL_CLEAVE = 26350, //Perhaps not right. Not a red aura... - SPELL_PANTHER_TRANSFORM = 24190, - - MODEL_ID_NORMAL = 15218, - MODEL_ID_PANTHER = 15215, - MODEL_ID_BLANK = 11686, - - NPC_ZULIAN_PROWLER = 15101 -}; - -class boss_arlokk : public CreatureScript -{ - public: - - boss_arlokk() - : CreatureScript("boss_arlokk") - { - } - - struct boss_arlokkAI : public ScriptedAI - { - boss_arlokkAI(Creature* creature) : ScriptedAI(creature) - { - instance = creature->GetInstanceScript(); - } - - InstanceScript* instance; - - uint32 m_uiShadowWordPain_Timer; - uint32 m_uiGouge_Timer; - uint32 m_uiMark_Timer; - uint32 m_uiCleave_Timer; - uint32 m_uiVanish_Timer; - uint32 m_uiVisible_Timer; - - uint32 m_uiSummon_Timer; - uint32 m_uiSummonCount; - - Unit* m_pMarkedTarget; - uint64 MarkedTargetGUID; - - bool m_bIsPhaseTwo; - bool m_bIsVanished; - - void Reset() - { - m_uiShadowWordPain_Timer = 8000; - m_uiGouge_Timer = 14000; - m_uiMark_Timer = 35000; - m_uiCleave_Timer = 4000; - m_uiVanish_Timer = 60000; - m_uiVisible_Timer = 6000; - - m_uiSummon_Timer = 5000; - m_uiSummonCount = 0; - - m_bIsPhaseTwo = false; - m_bIsVanished = false; - - MarkedTargetGUID = 0; - - me->SetDisplayId(MODEL_ID_NORMAL); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - - void EnterCombat(Unit* /*who*/) - { - DoScriptText(SAY_AGGRO, me); - } - - void JustReachedHome() - { - if (instance) - instance->SetData(DATA_ARLOKK, NOT_STARTED); - - //we should be summoned, so despawn - me->DespawnOrUnsummon(); - } - - void JustDied(Unit* /*killer*/) - { - DoScriptText(SAY_DEATH, me); - - me->SetDisplayId(MODEL_ID_NORMAL); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - - if (instance) - instance->SetData(DATA_ARLOKK, DONE); - } - - void DoSummonPhanters() - { - if (Unit* pMarkedTarget = Unit::GetUnit(*me, MarkedTargetGUID)) - DoScriptText(SAY_FEAST_PANTHER, me, pMarkedTarget); - - me->SummonCreature(NPC_ZULIAN_PROWLER, -11532.7998f, -1649.6734f, 41.4800f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - me->SummonCreature(NPC_ZULIAN_PROWLER, -11532.9970f, -1606.4840f, 41.2979f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - } - - void JustSummoned(Creature* summoned) - { - if (Unit* pMarkedTarget = Unit::GetUnit(*me, MarkedTargetGUID)) - summoned->AI()->AttackStart(pMarkedTarget); - - ++m_uiSummonCount; - } - - void UpdateAI(const uint32 uiDiff) - { - if (!UpdateVictim()) - return; - - if (!m_bIsPhaseTwo) - { - if (m_uiShadowWordPain_Timer <= uiDiff) - { - DoCast(me->getVictim(), SPELL_SHADOWWORDPAIN); - m_uiShadowWordPain_Timer = 15000; - } - else - m_uiShadowWordPain_Timer -= uiDiff; - - if (m_uiMark_Timer <= uiDiff) - { - Unit* pMarkedTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); - - if (pMarkedTarget) - { - DoCast(pMarkedTarget, SPELL_MARK); - MarkedTargetGUID = pMarkedTarget->GetGUID(); - } - else - sLog->outError(LOG_FILTER_TSCR, "boss_arlokk could not accuire pMarkedTarget."); - - m_uiMark_Timer = 15000; - } - else - m_uiMark_Timer -= uiDiff; - } - else - { - //Cleave_Timer - if (m_uiCleave_Timer <= uiDiff) - { - DoCast(me->getVictim(), SPELL_CLEAVE); - m_uiCleave_Timer = 16000; - } - else - m_uiCleave_Timer -= uiDiff; - - //Gouge_Timer - if (m_uiGouge_Timer <= uiDiff) - { - DoCast(me->getVictim(), SPELL_GOUGE); - - DoModifyThreatPercent(me->getVictim(), -80); - - m_uiGouge_Timer = 17000+rand()%10000; - } - else - m_uiGouge_Timer -= uiDiff; - } - - if (m_uiSummonCount <= 30) - { - if (m_uiSummon_Timer <= uiDiff) - { - DoSummonPhanters(); - m_uiSummon_Timer = 5000; - } - else - m_uiSummon_Timer -= uiDiff; - } - - if (m_uiVanish_Timer <= uiDiff) - { - //Invisble Model - me->SetDisplayId(MODEL_ID_BLANK); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - - me->AttackStop(); - DoResetThreat(); - - m_bIsVanished = true; - - m_uiVanish_Timer = 45000; - m_uiVisible_Timer = 6000; - } - else - m_uiVanish_Timer -= uiDiff; - - if (m_bIsVanished) - { - if (m_uiVisible_Timer <= uiDiff) - { - //The Panther Model - me->SetDisplayId(MODEL_ID_PANTHER); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - - const CreatureTemplate* cinfo = me->GetCreatureTemplate(); - me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35))); - me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35))); - me->UpdateDamagePhysical(BASE_ATTACK); - - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) - AttackStart(target); - - m_bIsPhaseTwo = true; - m_bIsVanished = false; - } - else - m_uiVisible_Timer -= uiDiff; - } - else - DoMeleeAttackIfReady(); - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new boss_arlokkAI(creature); - } -}; - -class go_gong_of_bethekk : public GameObjectScript -{ - public: - go_gong_of_bethekk() : GameObjectScript("go_gong_of_bethekk") - { - } - - bool OnGossipHello(Player* /*player*/, GameObject* go) - { - if (InstanceScript* instance = go->GetInstanceScript()) - { - if (instance->GetData(DATA_ARLOKK) == DONE || instance->GetData(DATA_ARLOKK) == IN_PROGRESS) - return true; - - instance->SetData(DATA_ARLOKK, IN_PROGRESS); - return true; - } - - return true; - } -}; - -void AddSC_boss_arlokk() -{ - new boss_arlokk(); - new go_gong_of_bethekk(); -} - diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp deleted file mode 100644 index 5e553c7396f..00000000000 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (C) 2008-2012 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 - * - * 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; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; 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, see . - */ - -/* ScriptData -SDName: Boss_Gahz'ranka -SD%Complete: 85 -SDComment: Massive Geyser with knockback not working. Spell buggy. -SDCategory: Zul'Gurub -EndScriptData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" - -#define SPELL_FROSTBREATH 16099 -#define SPELL_MASSIVEGEYSER 22421 //Not working. Cause its a summon... -#define SPELL_SLAM 24326 - -class boss_gahzranka : public CreatureScript -{ - public: - boss_gahzranka() : CreatureScript("boss_gahzranka") { } - - struct boss_gahzrankaAI : public ScriptedAI - { - boss_gahzrankaAI(Creature* creature) : ScriptedAI(creature) { } - uint32 Frostbreath_Timer; - uint32 MassiveGeyser_Timer; - uint32 Slam_Timer; - - void Reset() - { - Frostbreath_Timer = 8000; - MassiveGeyser_Timer = 25000; - Slam_Timer = 17000; - } - - void EnterCombat(Unit* /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //Frostbreath_Timer - if (Frostbreath_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_FROSTBREATH); - Frostbreath_Timer = urand(7000, 11000); - } else Frostbreath_Timer -= diff; - - //MassiveGeyser_Timer - if (MassiveGeyser_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_MASSIVEGEYSER); - DoResetThreat(); - - MassiveGeyser_Timer = urand(22000, 32000); - } else MassiveGeyser_Timer -= diff; - - //Slam_Timer - if (Slam_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SLAM); - Slam_Timer = urand(12000, 20000); - } else Slam_Timer -= diff; - - DoMeleeAttackIfReady(); - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new boss_gahzrankaAI(creature); - } -}; - -void AddSC_boss_gahzranka() -{ - new boss_gahzranka(); -} - diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp index 8c71ea6d48d..f015f08f082 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp @@ -1,6 +1,5 @@ /* * Copyright (C) 2008-2012 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 * * 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 @@ -16,71 +15,65 @@ * with this program. If not, see . */ -/* ScriptData -SDName: Boss_Grilek -SD%Complete: 100 -SDComment: -SDCategory: Zul'Gurub -EndScriptData */ - +#include "ObjectMgr.h" #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "zulgurub.h" -#define SPELL_AVARTAR 24646 //The Enrage Spell -#define SPELL_GROUNDTREMOR 6524 +enum Yells +{ +}; + +enum Spells +{ +}; + +enum Events +{ +}; class boss_grilek : public CreatureScript { public: boss_grilek() : CreatureScript("boss_grilek") { } - struct boss_grilekAI : public ScriptedAI + struct boss_grilekAI : public BossAI { - boss_grilekAI(Creature* creature) : ScriptedAI(creature) { } - - uint32 Avartar_Timer; - uint32 GroundTremor_Timer; + boss_grilekAI(Creature* creature) : BossAI(creature, DATA_GRILEK) + { + } void Reset() { - Avartar_Timer = urand(15000, 25000); - GroundTremor_Timer = urand(8000, 16000); } void EnterCombat(Unit* /*who*/) { } - void UpdateAI(const uint32 diff) + void JustDied(Unit* /*killer*/) + { + } + + void UpdateAI(uint32 const diff) { - //Return since we have no target if (!UpdateVictim()) return; - //Avartar_Timer - if (Avartar_Timer <= diff) - { - - DoCast(me, SPELL_AVARTAR); - Unit* target = NULL; + events.Update(diff); - target = SelectTarget(SELECT_TARGET_RANDOM, 1); - - if (DoGetThreat(me->getVictim())) - DoModifyThreatPercent(me->getVictim(), -50); - if (target) - AttackStart(target); - - Avartar_Timer = urand(25000, 35000); - } else Avartar_Timer -= diff; - - //GroundTremor_Timer - if (GroundTremor_Timer <= diff) + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + /* + while (uint32 eventId = events.ExecuteEvent()) { - DoCast(me->getVictim(), SPELL_GROUNDTREMOR); - GroundTremor_Timer = urand(12000, 16000); - } else GroundTremor_Timer -= diff; + switch (eventId) + { + default: + break; + } + } + */ DoMeleeAttackIfReady(); } @@ -96,4 +89,3 @@ void AddSC_boss_grilek() { new boss_grilek(); } - diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp deleted file mode 100644 index 6cb657f4cff..00000000000 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp +++ /dev/null @@ -1,259 +0,0 @@ -/* - * Copyright (C) 2008-2012 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 - * - * 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; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; 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, see . - */ - -/* ScriptData -SDName: Boss_Hakkar -SD%Complete: 95 -SDComment: Blood siphon spell buggy cause of Core Issue. -SDCategory: Zul'Gurub -EndScriptData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "zulgurub.h" - -#define SAY_AGGRO -1309020 -#define SAY_FLEEING -1309021 -#define SAY_MINION_DESTROY -1309022 //where does it belong? -#define SAY_PROTECT_ALTAR -1309023 //where does it belong? - -#define SPELL_BLOODSIPHON 24322 -#define SPELL_CORRUPTEDBLOOD 24328 -#define SPELL_CAUSEINSANITY 24327 //Not working disabled. -#define SPELL_WILLOFHAKKAR 24178 -#define SPELL_ENRAGE 24318 - -// The Aspects of all High Priests -#define SPELL_ASPECT_OF_JEKLIK 24687 -#define SPELL_ASPECT_OF_VENOXIS 24688 -#define SPELL_ASPECT_OF_MARLI 24686 -#define SPELL_ASPECT_OF_THEKAL 24689 -#define SPELL_ASPECT_OF_ARLOKK 24690 - -class boss_hakkar : public CreatureScript -{ - public: - - boss_hakkar() - : CreatureScript("boss_hakkar") - { - } - - struct boss_hakkarAI : public ScriptedAI - { - boss_hakkarAI(Creature* creature) : ScriptedAI(creature) - { - instance = creature->GetInstanceScript(); - } - - InstanceScript* instance; - - uint32 BloodSiphon_Timer; - uint32 CorruptedBlood_Timer; - uint32 CauseInsanity_Timer; - uint32 WillOfHakkar_Timer; - uint32 Enrage_Timer; - - uint32 CheckJeklik_Timer; - uint32 CheckVenoxis_Timer; - uint32 CheckMarli_Timer; - uint32 CheckThekal_Timer; - uint32 CheckArlokk_Timer; - - uint32 AspectOfJeklik_Timer; - uint32 AspectOfVenoxis_Timer; - uint32 AspectOfMarli_Timer; - uint32 AspectOfThekal_Timer; - uint32 AspectOfArlokk_Timer; - - bool Enraged; - - void Reset() - { - BloodSiphon_Timer = 90000; - CorruptedBlood_Timer = 25000; - CauseInsanity_Timer = 17000; - WillOfHakkar_Timer = 17000; - Enrage_Timer = 600000; - - CheckJeklik_Timer = 1000; - CheckVenoxis_Timer = 2000; - CheckMarli_Timer = 3000; - CheckThekal_Timer = 4000; - CheckArlokk_Timer = 5000; - - AspectOfJeklik_Timer = 4000; - AspectOfVenoxis_Timer = 7000; - AspectOfMarli_Timer = 12000; - AspectOfThekal_Timer = 8000; - AspectOfArlokk_Timer = 18000; - - Enraged = false; - } - - void EnterCombat(Unit* /*who*/) - { - DoScriptText(SAY_AGGRO, me); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //BloodSiphon_Timer - if (BloodSiphon_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_BLOODSIPHON); - BloodSiphon_Timer = 90000; - } else BloodSiphon_Timer -= diff; - - //CorruptedBlood_Timer - if (CorruptedBlood_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CORRUPTEDBLOOD); - CorruptedBlood_Timer = urand(30000, 45000); - } else CorruptedBlood_Timer -= diff; - - //CauseInsanity_Timer - /*if (CauseInsanity_Timer <= diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_CAUSEINSANITY); - - CauseInsanity_Timer = urand(35000, 43000); - } else CauseInsanity_Timer -= diff;*/ - - //WillOfHakkar_Timer - if (WillOfHakkar_Timer <= diff) - { - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_WILLOFHAKKAR); - - WillOfHakkar_Timer = urand(25000, 35000); - } else WillOfHakkar_Timer -= diff; - - if (!Enraged && Enrage_Timer <= diff) - { - DoCast(me, SPELL_ENRAGE); - Enraged = true; - } else Enrage_Timer -= diff; - - //Checking if Jeklik is dead. If not we cast her Aspect - if (CheckJeklik_Timer <= diff) - { - if (instance) - { - if (instance->GetData(DATA_JEKLIK) != DONE) - { - if (AspectOfJeklik_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_ASPECT_OF_JEKLIK); - AspectOfJeklik_Timer = urand(10000, 14000); - } else AspectOfJeklik_Timer -= diff; - } - } - CheckJeklik_Timer = 1000; - } else CheckJeklik_Timer -= diff; - - //Checking if Venoxis is dead. If not we cast his Aspect - if (CheckVenoxis_Timer <= diff) - { - if (instance) - { - if (instance->GetData(DATA_VENOXIS) != DONE) - { - if (AspectOfVenoxis_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_ASPECT_OF_VENOXIS); - AspectOfVenoxis_Timer = 8000; - } else AspectOfVenoxis_Timer -= diff; - } - } - CheckVenoxis_Timer = 1000; - } else CheckVenoxis_Timer -= diff; - - //Checking if Marli is dead. If not we cast her Aspect - if (CheckMarli_Timer <= diff) - { - if (instance) - { - if (instance->GetData(DATA_MARLI) != DONE) - { - if (AspectOfMarli_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_ASPECT_OF_MARLI); - AspectOfMarli_Timer = 10000; - } else AspectOfMarli_Timer -= diff; - - } - } - CheckMarli_Timer = 1000; - } else CheckMarli_Timer -= diff; - - //Checking if Thekal is dead. If not we cast his Aspect - if (CheckThekal_Timer <= diff) - { - if (instance) - { - if (instance->GetData(DATA_THEKAL) != DONE) - { - if (AspectOfThekal_Timer <= diff) - { - DoCast(me, SPELL_ASPECT_OF_THEKAL); - AspectOfThekal_Timer = 15000; - } else AspectOfThekal_Timer -= diff; - } - } - CheckThekal_Timer = 1000; - } else CheckThekal_Timer -= diff; - - //Checking if Arlokk is dead. If yes we cast her Aspect - if (CheckArlokk_Timer <= diff) - { - if (instance) - { - if (instance->GetData(DATA_ARLOKK) != DONE) - { - if (AspectOfArlokk_Timer <= diff) - { - DoCast(me, SPELL_ASPECT_OF_ARLOKK); - DoResetThreat(); - - AspectOfArlokk_Timer = urand(10000, 15000); - } else AspectOfArlokk_Timer -= diff; - } - } - CheckArlokk_Timer = 1000; - } else CheckArlokk_Timer -= diff; - - DoMeleeAttackIfReady(); - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new boss_hakkarAI(creature); - } -}; - -void AddSC_boss_hakkar() -{ - new boss_hakkar(); -} - diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp index bb3e0b14e0e..12bc4289a7d 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp @@ -1,6 +1,5 @@ /* * Copyright (C) 2008-2012 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 * * 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 @@ -16,86 +15,65 @@ * with this program. If not, see . */ -/* ScriptData -SDName: Boss_Hazzarah -SD%Complete: 100 -SDComment: -SDCategory: Zul'Gurub -EndScriptData */ - +#include "ObjectMgr.h" #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "zulgurub.h" -#define SPELL_MANABURN 26046 -#define SPELL_SLEEP 24664 +enum Yells +{ +}; + +enum Spells +{ +}; + +enum Events +{ +}; class boss_hazzarah : public CreatureScript { public: + boss_hazzarah() : CreatureScript("boss_hazzarah") { } - boss_hazzarah() - : CreatureScript("boss_hazzarah") - { - } - - struct boss_hazzarahAI : public ScriptedAI + struct boss_hazzarahAI : public BossAI { - boss_hazzarahAI(Creature* creature) : ScriptedAI(creature) {} - - uint32 ManaBurn_Timer; - uint32 Sleep_Timer; - uint32 Illusions_Timer; + boss_hazzarahAI(Creature* creature) : BossAI(creature, DATA_HAZZARAH) + { + } void Reset() { - ManaBurn_Timer = urand(4000, 10000); - Sleep_Timer = urand(10000, 18000); - Illusions_Timer = urand(10000, 18000); } void EnterCombat(Unit* /*who*/) { } - void UpdateAI(const uint32 diff) + void JustDied(Unit* /*killer*/) + { + } + + void UpdateAI(uint32 const diff) { if (!UpdateVictim()) return; - //ManaBurn_Timer - if (ManaBurn_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_MANABURN); - ManaBurn_Timer = urand(8000, 16000); - } else ManaBurn_Timer -= diff; - - //Sleep_Timer - if (Sleep_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SLEEP); - Sleep_Timer = urand(12000, 20000); - } else Sleep_Timer -= diff; + events.Update(diff); - //Illusions_Timer - if (Illusions_Timer <= diff) + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + /* + while (uint32 eventId = events.ExecuteEvent()) { - //We will summon 3 illusions that will spawn on a random gamer and attack this gamer - //We will just use one model for the beginning - Unit* target = NULL; - for (uint8 i = 0; i < 3; ++i) + switch (eventId) { - target = SelectTarget(SELECT_TARGET_RANDOM, 0); - if (!target) - return; - - Creature* Illusion = me->SummonCreature(15163, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000); - if (Illusion) - Illusion->AI()->AttackStart(target); + default: + break; } - - Illusions_Timer = urand(15000, 25000); - } else Illusions_Timer -= diff; + } + */ DoMeleeAttackIfReady(); } @@ -111,4 +89,3 @@ void AddSC_boss_hazzarah() { new boss_hazzarah(); } - diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp deleted file mode 100644 index 156ccab5eae..00000000000 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp +++ /dev/null @@ -1,306 +0,0 @@ -/* - * Copyright (C) 2008-2012 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 - * - * 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; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; 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, see . - */ - -/* ScriptData -SDName: Boss_Jeklik -SD%Complete: 85 -SDComment: Problem in finding the right flying batriders for spawning and making them fly. -SDCategory: Zul'Gurub -EndScriptData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "zulgurub.h" - -#define SAY_AGGRO -1309002 -#define SAY_RAIN_FIRE -1309003 -#define SAY_DEATH -1309004 - -#define SPELL_CHARGE 22911 -#define SPELL_SONICBURST 23918 -#define SPELL_SCREECH 6605 -#define SPELL_SHADOW_WORD_PAIN 23952 -#define SPELL_MIND_FLAY 23953 -#define SPELL_CHAIN_MIND_FLAY 26044 //Right ID unknown. So disabled -#define SPELL_GREATERHEAL 23954 -#define SPELL_BAT_FORM 23966 - -// Batriders Spell - -#define SPELL_BOMB 40332 //Wrong ID but Magmadars bomb is not working... - -class boss_jeklik : public CreatureScript -{ - public: - - boss_jeklik() - : CreatureScript("boss_jeklik") - { - } - - struct boss_jeklikAI : public ScriptedAI - { - boss_jeklikAI(Creature* creature) : ScriptedAI(creature) - { - instance = creature->GetInstanceScript(); - } - - InstanceScript* instance; - - uint32 Charge_Timer; - uint32 SonicBurst_Timer; - uint32 Screech_Timer; - uint32 SpawnBats_Timer; - uint32 ShadowWordPain_Timer; - uint32 MindFlay_Timer; - uint32 ChainMindFlay_Timer; - uint32 GreaterHeal_Timer; - uint32 SpawnFlyingBats_Timer; - - bool PhaseTwo; - - void Reset() - { - Charge_Timer = 20000; - SonicBurst_Timer = 8000; - Screech_Timer = 13000; - SpawnBats_Timer = 60000; - ShadowWordPain_Timer = 6000; - MindFlay_Timer = 11000; - ChainMindFlay_Timer = 26000; - GreaterHeal_Timer = 50000; - SpawnFlyingBats_Timer = 10000; - - PhaseTwo = false; - } - - void EnterCombat(Unit* /*who*/) - { - DoScriptText(SAY_AGGRO, me); - DoCast(me, SPELL_BAT_FORM); - } - - void JustDied(Unit* /*killer*/) - { - DoScriptText(SAY_DEATH, me); - - if (instance) - instance->SetData(DATA_JEKLIK, DONE); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (me->getVictim() && me->isAlive()) - { - if (HealthAbovePct(50)) - { - if (Charge_Timer <= diff) - { - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) - { - DoCast(target, SPELL_CHARGE); - AttackStart(target); - } - - Charge_Timer = urand(15000, 30000); - } else Charge_Timer -= diff; - - if (SonicBurst_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SONICBURST); - SonicBurst_Timer = urand(8000, 13000); - } else SonicBurst_Timer -= diff; - - if (Screech_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SCREECH); - Screech_Timer = urand(18000, 26000); - } else Screech_Timer -= diff; - - if (SpawnBats_Timer <= diff) - { - Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0); - - Creature* Bat = NULL; - Bat = me->SummonCreature(11368, -12291.6220f, -1380.2640f, 144.8304f, 5.483f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (target && Bat) Bat ->AI()->AttackStart(target); - - Bat = me->SummonCreature(11368, -12289.6220f, -1380.2640f, 144.8304f, 5.483f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (target && Bat) Bat ->AI()->AttackStart(target); - - Bat = me->SummonCreature(11368, -12293.6220f, -1380.2640f, 144.8304f, 5.483f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (target && Bat) Bat ->AI()->AttackStart(target); - - Bat = me->SummonCreature(11368, -12291.6220f, -1380.2640f, 144.8304f, 5.483f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (target && Bat) Bat ->AI()->AttackStart(target); - - Bat = me->SummonCreature(11368, -12289.6220f, -1380.2640f, 144.8304f, 5.483f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (target && Bat) Bat ->AI()->AttackStart(target); - Bat = me->SummonCreature(11368, -12293.6220f, -1380.2640f, 144.8304f, 5.483f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (target && Bat) Bat ->AI()->AttackStart(target); - - SpawnBats_Timer = 60000; - } else SpawnBats_Timer -= diff; - } - else - { - if (PhaseTwo) - { - if (PhaseTwo && ShadowWordPain_Timer <= diff) - { - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) - { - DoCast(target, SPELL_SHADOW_WORD_PAIN); - ShadowWordPain_Timer = urand(12000, 18000); - } - }ShadowWordPain_Timer -=diff; - - if (MindFlay_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_MIND_FLAY); - MindFlay_Timer = 16000; - }MindFlay_Timer -=diff; - - if (ChainMindFlay_Timer <= diff) - { - me->InterruptNonMeleeSpells(false); - DoCast(me->getVictim(), SPELL_CHAIN_MIND_FLAY); - ChainMindFlay_Timer = urand(15000, 30000); - }ChainMindFlay_Timer -=diff; - - if (GreaterHeal_Timer <= diff) - { - me->InterruptNonMeleeSpells(false); - DoCast(me, SPELL_GREATERHEAL); - GreaterHeal_Timer = urand(25000, 35000); - }GreaterHeal_Timer -=diff; - - if (SpawnFlyingBats_Timer <= diff) - { - Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0); - if (!target) - return; - - Creature* FlyingBat = me->SummonCreature(14965, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ()+15, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (FlyingBat) - FlyingBat->AI()->AttackStart(target); - - SpawnFlyingBats_Timer = urand(10000, 15000); - } else SpawnFlyingBats_Timer -=diff; - } - else - { - me->SetDisplayId(15219); - DoResetThreat(); - PhaseTwo = true; - } - } - - DoMeleeAttackIfReady(); - } - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new boss_jeklikAI(creature); - } -}; - -//Flying Bat -class mob_batrider : public CreatureScript -{ - public: - - mob_batrider() - : CreatureScript("mob_batrider") - { - } - - struct mob_batriderAI : public ScriptedAI - { - mob_batriderAI(Creature* creature) : ScriptedAI(creature) - { - instance = creature->GetInstanceScript(); - } - - InstanceScript* instance; - - uint32 Bomb_Timer; - uint32 Check_Timer; - - void Reset() - { - Bomb_Timer = 2000; - Check_Timer = 1000; - - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - - void EnterCombat(Unit* /*who*/) {} - - void UpdateAI (const uint32 diff) - { - if (!UpdateVictim()) - return; - - //Bomb_Timer - if (Bomb_Timer <= diff) - { - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) - { - DoCast(target, SPELL_BOMB); - Bomb_Timer = 5000; - } - } else Bomb_Timer -= diff; - - //Check_Timer - if (Check_Timer <= diff) - { - if (instance) - { - if (instance->GetData(DATA_JEKLIK) == DONE) - { - me->setDeathState(JUST_DIED); - me->RemoveCorpse(); - return; - } - } - - Check_Timer = 1000; - } else Check_Timer -= diff; - - DoMeleeAttackIfReady(); - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_batriderAI(creature); - } -}; - -void AddSC_boss_jeklik() -{ - new boss_jeklik(); - new mob_batrider(); -} - diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp deleted file mode 100644 index f8d23947e9c..00000000000 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp +++ /dev/null @@ -1,283 +0,0 @@ -/* - * Copyright (C) 2008-2012 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 - * - * 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; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; 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, see . - */ - -/* ScriptData -SDName: Boss_Jin'do the Hexxer -SD%Complete: 85 -SDComment: Mind Control not working because of core bug. Shades visible for all. -SDCategory: Zul'Gurub -EndScriptData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "zulgurub.h" - -#define SAY_AGGRO -1309014 - -#define SPELL_BRAINWASHTOTEM 24262 -#define SPELL_POWERFULLHEALINGWARD 24309 //We will not use this spell. We will summon a totem by script cause the spell totems will not cast. -#define SPELL_HEX 24053 -#define SPELL_DELUSIONSOFJINDO 24306 -#define SPELL_SHADEOFJINDO 24308 //We will not use this spell. We will summon a shade by script. - -//Healing Ward Spell -#define SPELL_HEAL 38588 //Totems are not working right. Right heal spell ID is 24311 but this spell is not casting... - -//Shade of Jindo Spell -#define SPELL_SHADOWSHOCK 19460 -#define SPELL_INVISIBLE 24699 - -class boss_jindo : public CreatureScript -{ - public: - - boss_jindo() - : CreatureScript("boss_jindo") - { - } - - struct boss_jindoAI : public ScriptedAI - { - boss_jindoAI(Creature* creature) : ScriptedAI(creature) {} - - uint32 BrainWashTotem_Timer; - uint32 HealingWard_Timer; - uint32 Hex_Timer; - uint32 Delusions_Timer; - uint32 Teleport_Timer; - - void Reset() - { - BrainWashTotem_Timer = 20000; - HealingWard_Timer = 16000; - Hex_Timer = 8000; - Delusions_Timer = 10000; - Teleport_Timer = 5000; - } - - void EnterCombat(Unit* /*who*/) - { - DoScriptText(SAY_AGGRO, me); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //BrainWashTotem_Timer - if (BrainWashTotem_Timer <= diff) - { - DoCast(me, SPELL_BRAINWASHTOTEM); - BrainWashTotem_Timer = urand(18000, 26000); - } else BrainWashTotem_Timer -= diff; - - //HealingWard_Timer - if (HealingWard_Timer <= diff) - { - //DoCast(me, SPELL_POWERFULLHEALINGWARD); - me->SummonCreature(14987, me->GetPositionX()+3, me->GetPositionY()-2, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000); - HealingWard_Timer = urand(14000, 20000); - } else HealingWard_Timer -= diff; - - //Hex_Timer - if (Hex_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_HEX); - - if (DoGetThreat(me->getVictim())) - DoModifyThreatPercent(me->getVictim(), -80); - - Hex_Timer = urand(12000, 20000); - } else Hex_Timer -= diff; - - //Casting the delusion curse with a shade. So shade will attack the same target with the curse. - if (Delusions_Timer <= diff) - { - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) - { - DoCast(target, SPELL_DELUSIONSOFJINDO); - - Creature* Shade = me->SummonCreature(14986, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Shade) - Shade->AI()->AttackStart(target); - } - - Delusions_Timer = urand(4000, 12000); - } else Delusions_Timer -= diff; - - //Teleporting a random gamer and spawning 9 skeletons that will attack this gamer - if (Teleport_Timer <= diff) - { - Unit* target = NULL; - target = SelectTarget(SELECT_TARGET_RANDOM, 0); - if (target && target->GetTypeId() == TYPEID_PLAYER) - { - DoTeleportPlayer(target, -11583.7783f, -1249.4278f, 77.5471f, 4.745f); - - if (DoGetThreat(me->getVictim())) - DoModifyThreatPercent(target, -100); - - Creature* Skeletons; - Skeletons = me->SummonCreature(14826, target->GetPositionX()+2, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Skeletons) - Skeletons->AI()->AttackStart(target); - Skeletons = me->SummonCreature(14826, target->GetPositionX()-2, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Skeletons) - Skeletons->AI()->AttackStart(target); - Skeletons = me->SummonCreature(14826, target->GetPositionX()+4, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Skeletons) - Skeletons->AI()->AttackStart(target); - Skeletons = me->SummonCreature(14826, target->GetPositionX()-4, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Skeletons) - Skeletons->AI()->AttackStart(target); - Skeletons = me->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()+2, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Skeletons) - Skeletons->AI()->AttackStart(target); - Skeletons = me->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()-2, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Skeletons) - Skeletons->AI()->AttackStart(target); - Skeletons = me->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()+4, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Skeletons) - Skeletons->AI()->AttackStart(target); - Skeletons = me->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()-4, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Skeletons) - Skeletons->AI()->AttackStart(target); - Skeletons = me->SummonCreature(14826, target->GetPositionX()+3, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Skeletons) - Skeletons->AI()->AttackStart(target); - } - - Teleport_Timer = urand(15000, 23000); - } else Teleport_Timer -= diff; - - DoMeleeAttackIfReady(); - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new boss_jindoAI(creature); - } -}; - -//Healing Ward -class mob_healing_ward : public CreatureScript -{ - public: - - mob_healing_ward() - : CreatureScript("mob_healing_ward") - { - } - - struct mob_healing_wardAI : public ScriptedAI - { - mob_healing_wardAI(Creature* creature) : ScriptedAI(creature) - { - instance = creature->GetInstanceScript(); - } - - uint32 Heal_Timer; - - InstanceScript* instance; - - void Reset() - { - Heal_Timer = 2000; - } - - void EnterCombat(Unit* /*who*/) - { - } - - void UpdateAI (const uint32 diff) - { - //Heal_Timer - if (Heal_Timer <= diff) - { - if (instance) - { - Unit* pJindo = Unit::GetUnit(*me, instance->GetData64(DATA_JINDO)); - if (pJindo) - DoCast(pJindo, SPELL_HEAL); - } - Heal_Timer = 3000; - } else Heal_Timer -= diff; - - DoMeleeAttackIfReady(); - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_healing_wardAI(creature); - } -}; - -//Shade of Jindo -class mob_shade_of_jindo : public CreatureScript -{ - public: - - mob_shade_of_jindo() - : CreatureScript("mob_shade_of_jindo") - { - } - - struct mob_shade_of_jindoAI : public ScriptedAI - { - mob_shade_of_jindoAI(Creature* creature) : ScriptedAI(creature) {} - - uint32 ShadowShock_Timer; - - void Reset() - { - ShadowShock_Timer = 1000; - DoCast(me, SPELL_INVISIBLE, true); - } - - void EnterCombat(Unit* /*who*/){} - - void UpdateAI (const uint32 diff) - { - - //ShadowShock_Timer - if (ShadowShock_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SHADOWSHOCK); - ShadowShock_Timer = 2000; - } else ShadowShock_Timer -= diff; - - DoMeleeAttackIfReady(); - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_shade_of_jindoAI(creature); - } -}; - -void AddSC_boss_jindo() -{ - new boss_jindo(); - new mob_healing_ward(); - new mob_shade_of_jindo(); -} - diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo_the_godbreaker.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo_the_godbreaker.cpp new file mode 100644 index 00000000000..204db428bf0 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo_the_godbreaker.cpp @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2008-2012 TrinityCore + * + * 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; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; 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, see . + */ + +#include "ObjectMgr.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "zulgurub.h" + +enum Yells +{ +}; + +enum Spells +{ +}; + +enum Events +{ +}; + +class boss_jindo_the_godbreaker : public CreatureScript +{ + public: + boss_jindo_the_godbreaker() : CreatureScript("boss_jindo_the_godbreaker") { } + + struct boss_jindo_the_godbreakerAI : public BossAI + { + boss_jindo_the_godbreakerAI(Creature* creature) : BossAI(creature, DATA_JINDO) + { + } + + void Reset() + { + } + + void EnterCombat(Unit* /*who*/) + { + } + + void JustDied(Unit* /*killer*/) + { + } + + void UpdateAI(uint32 const diff) + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + /* + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + default: + break; + } + } + */ + + DoMeleeAttackIfReady(); + } + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new boss_jindo_the_godbreakerAI(creature); + } +}; + +void AddSC_boss_jindo_the_godbreaker() +{ + new boss_jindo_the_godbreaker(); +} diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_kilnara.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_kilnara.cpp new file mode 100644 index 00000000000..17c73ae96bd --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_kilnara.cpp @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2008-2012 TrinityCore + * + * 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; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; 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, see . + */ + +#include "ObjectMgr.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "Spell.h" +#include "zulgurub.h" + +enum Yells +{ +}; + +enum Spells +{ +}; + +enum Events +{ +}; + +class boss_kilnara : public CreatureScript +{ + public: + boss_kilnara() : CreatureScript("boss_kilnara") { } + + struct boss_kilnaraAI : public BossAI + { + boss_kilnaraAI(Creature* creature) : BossAI(creature, DATA_KILNARA) + { + } + + void Reset() + { + } + + void EnterCombat(Unit* /*who*/) + { + } + + void JustDied(Unit* /*killer*/) + { + } + + void UpdateAI(uint32 const diff) + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + /* + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + default: + break; + } + } + */ + + DoMeleeAttackIfReady(); + } + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new boss_kilnaraAI(creature); + } +}; + +void AddSC_boss_kilnara() +{ + new boss_kilnara(); +} diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp index 83cd0b46fb8..108d2118a25 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp @@ -16,318 +16,67 @@ * with this program. If not, see . */ -/* ScriptData -SDName: Boss_Mandokir -SD%Complete: 90 -SDComment: Ohgan function needs improvements. -SDCategory: Zul'Gurub -EndScriptData */ - #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "zulgurub.h" -#define SAY_AGGRO -1309015 -#define SAY_DING_KILL -1309016 -#define SAY_GRATS_JINDO -1309017 -#define SAY_WATCH -1309018 -#define SAY_WATCH_WHISPER -1309019 //is this text for real? easter egg? +enum Yells +{ +}; -#define SPELL_CHARGE 24408 -#define SPELL_CLEAVE 7160 -#define SPELL_FEAR 29321 -#define SPELL_WHIRLWIND 15589 -#define SPELL_MORTAL_STRIKE 16856 -#define SPELL_ENRAGE 24318 -#define SPELL_WATCH 24314 -#define SPELL_LEVEL_UP 24312 +enum Spells +{ +}; -//Ohgans Spells -#define SPELL_SUNDERARMOR 24317 +enum Events +{ +}; class boss_mandokir : public CreatureScript { public: - boss_mandokir() - : CreatureScript("boss_mandokir") - { - } + boss_mandokir() : CreatureScript("boss_mandokir") { } - struct boss_mandokirAI : public ScriptedAI + struct boss_mandokirAI : public BossAI { - boss_mandokirAI(Creature* creature) : ScriptedAI(creature) - { - instance = creature->GetInstanceScript(); - } - - uint32 KillCount; - uint32 Watch_Timer; - uint32 TargetInRange; - uint32 Cleave_Timer; - uint32 Whirlwind_Timer; - uint32 Fear_Timer; - uint32 MortalStrike_Timer; - uint32 Check_Timer; - float targetX; - float targetY; - float targetZ; - - InstanceScript* instance; - - bool endWatch; - bool someWatched; - bool RaptorDead; - bool CombatStart; - - uint64 WatchTarget; + boss_mandokirAI(Creature* creature) : BossAI(creature, DATA_MANDOKIR) { } void Reset() { - KillCount = 0; - Watch_Timer = 33000; - Cleave_Timer = 7000; - Whirlwind_Timer = 20000; - Fear_Timer = 1000; - MortalStrike_Timer = 1000; - Check_Timer = 1000; - - targetX = 0.0f; - targetY = 0.0f; - targetZ = 0.0f; - TargetInRange = 0; - - WatchTarget = 0; - - someWatched = false; - endWatch = false; - RaptorDead = false; - CombatStart = false; - - DoCast(me, 23243); } void KilledUnit(Unit* victim) { - if (victim->GetTypeId() == TYPEID_PLAYER) - { - ++KillCount; - - if (KillCount == 3) - { - DoScriptText(SAY_DING_KILL, me); - - if (instance) - { - uint64 JindoGUID = instance->GetData64(DATA_JINDO); - if (JindoGUID) - { - if (Unit* jTemp = Unit::GetUnit(*me, JindoGUID)) - { - if (jTemp->isAlive()) - DoScriptText(SAY_GRATS_JINDO, jTemp); - } - } - } - DoCast(me, SPELL_LEVEL_UP, true); - KillCount = 0; - } - } } void EnterCombat(Unit* /*who*/) { - DoScriptText(SAY_AGGRO, me); } - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (me->getVictim() && me->isAlive()) - { - if (!CombatStart) - { - //At combat Start Mandokir is mounted so we must unmount it first - me->Dismount(); - - //And summon his raptor - me->SummonCreature(14988, me->getVictim()->GetPositionX(), me->getVictim()->GetPositionY(), me->getVictim()->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 35000); - CombatStart = true; - } - - if (Watch_Timer <= diff) //Every 20 Sec Mandokir will check this - { - if (WatchTarget) //If someone is watched and If the Position of the watched target is different from the one stored, or are attacking, mandokir will charge him - { - Unit* unit = Unit::GetUnit(*me, WatchTarget); - - if (unit && ( - targetX != unit->GetPositionX() || - targetY != unit->GetPositionY() || - targetZ != unit->GetPositionZ() || - unit->isInCombat())) - { - if (me->IsWithinMeleeRange(unit)) - { - DoCast(unit, 24316); - } - else - { - DoCast(unit, SPELL_CHARGE); - //me->SendMonsterMove(unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ(), 0, true, 1); - AttackStart(unit); - } - } - } - someWatched = false; - Watch_Timer = 20000; - } else Watch_Timer -= diff; - - if ((Watch_Timer < 8000) && !someWatched) //8 sec(cast time + expire time) before the check for the watch effect mandokir will cast watch debuff on a random target - { - if (Unit* p = SelectTarget(SELECT_TARGET_RANDOM, 0)) - { - DoScriptText(SAY_WATCH, me, p); - DoCast(p, SPELL_WATCH); - WatchTarget = p->GetGUID(); - someWatched = true; - endWatch = true; - } - } - - if ((Watch_Timer < 1000) && endWatch) //1 sec before the debuf expire, store the target position - { - Unit* unit = Unit::GetUnit(*me, WatchTarget); - if (unit) - { - targetX = unit->GetPositionX(); - targetY = unit->GetPositionY(); - targetZ = unit->GetPositionZ(); - } - endWatch = false; - } - - if (!someWatched) - { - //Cleave - if (Cleave_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CLEAVE); - Cleave_Timer = 7000; - } else Cleave_Timer -= diff; - - //Whirlwind - if (Whirlwind_Timer <= diff) - { - DoCast(me, SPELL_WHIRLWIND); - Whirlwind_Timer = 18000; - } else Whirlwind_Timer -= diff; - - //If more then 3 targets in melee range mandokir will cast fear - if (Fear_Timer <= diff) - { - TargetInRange = 0; - - std::list::const_iterator i = me->getThreatManager().getThreatList().begin(); - for (; i != me->getThreatManager().getThreatList().end(); ++i) - { - Unit* unit = Unit::GetUnit(*me, (*i)->getUnitGuid()); - if (unit && me->IsWithinMeleeRange(unit)) - ++TargetInRange; - } - - if (TargetInRange > 3) - DoCast(me->getVictim(), SPELL_FEAR); - - Fear_Timer = 4000; - } else Fear_Timer -=diff; - - //Mortal Strike if target below 50% hp - if (me->getVictim() && me->getVictim()->HealthBelowPct(50)) - { - if (MortalStrike_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_MORTAL_STRIKE); - MortalStrike_Timer = 15000; - } else MortalStrike_Timer -= diff; - } - } - //Checking if Ohgan is dead. If yes Mandokir will enrage. - if (Check_Timer <= diff) - { - if (instance) - { - if (instance->GetData(DATA_OHGAN) == DONE) - { - if (!RaptorDead) - { - DoCast(me, SPELL_ENRAGE); - RaptorDead = true; - } - } - } - - Check_Timer = 1000; - } else Check_Timer -= diff; - - DoMeleeAttackIfReady(); - } - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new boss_mandokirAI(creature); - } -}; - -//Ohgan -class mob_ohgan : public CreatureScript -{ - public: - - mob_ohgan() - : CreatureScript("mob_ohgan") - { - } - - struct mob_ohganAI : public ScriptedAI - { - mob_ohganAI(Creature* creature) : ScriptedAI(creature) - { - instance = creature->GetInstanceScript(); - } - - uint32 SunderArmor_Timer; - InstanceScript* instance; - - void Reset() - { - SunderArmor_Timer = 5000; - } - - void EnterCombat(Unit* /*who*/) {} - void JustDied(Unit* /*killer*/) { - if (instance) - instance->SetData(DATA_OHGAN, DONE); } - void UpdateAI (const uint32 diff) + void UpdateAI(uint32 const diff) { - //Return since we have no target if (!UpdateVictim()) return; - //SunderArmor_Timer - if (SunderArmor_Timer <= diff) + events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + /* + while (uint32 eventId = events.ExecuteEvent()) { - DoCast(me->getVictim(), SPELL_SUNDERARMOR); - SunderArmor_Timer = urand(10000, 15000); - } else SunderArmor_Timer -= diff; + switch (eventId) + { + default: + break; + } + } + */ DoMeleeAttackIfReady(); } @@ -335,13 +84,11 @@ class mob_ohgan : public CreatureScript CreatureAI* GetAI(Creature* creature) const { - return new mob_ohganAI(creature); + return new boss_mandokirAI(creature); } }; void AddSC_boss_mandokir() { new boss_mandokir(); - new mob_ohgan(); } - diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp deleted file mode 100644 index 8e0deda1d0b..00000000000 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Copyright (C) 2008-2012 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 - * - * 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; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; 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, see . - */ - -/* ScriptData -SDName: Boss_Marli -SD%Complete: 80 -SDComment: Charging healers and casters not working. Perhaps wrong Spell Timers. -SDCategory: Zul'Gurub -EndScriptData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "zulgurub.h" - -#define SAY_AGGRO -1309005 -#define SAY_TRANSFORM -1309006 -#define SAY_SPIDER_SPAWN -1309007 -#define SAY_DEATH -1309008 - -#define SPELL_CHARGE 22911 -#define SPELL_ASPECT_OF_MARLI 24686 // A stun spell -#define SPELL_ENVOLWINGWEB 24110 -#define SPELL_POISONVOLLEY 24099 -#define SPELL_SPIDER_FORM 24084 - -//The Spider Spells -#define SPELL_LEVELUP 24312 //Not right Spell. - -class boss_marli : public CreatureScript -{ - public: - - boss_marli() - : CreatureScript("boss_marli") - { - } - - struct boss_marliAI : public ScriptedAI - { - boss_marliAI(Creature* creature) : ScriptedAI(creature) - { - instance = creature->GetInstanceScript(); - } - - InstanceScript* instance; - - uint32 SpawnStartSpiders_Timer; - uint32 PoisonVolley_Timer; - uint32 SpawnSpider_Timer; - uint32 Charge_Timer; - uint32 Aspect_Timer; - uint32 Transform_Timer; - uint32 TransformBack_Timer; - - bool Spawned; - bool PhaseTwo; - - void Reset() - { - SpawnStartSpiders_Timer = 1000; - PoisonVolley_Timer = 15000; - SpawnSpider_Timer = 30000; - Charge_Timer = 1500; - Aspect_Timer = 12000; - Transform_Timer = 45000; - TransformBack_Timer = 25000; - - Spawned = false; - PhaseTwo = false; - } - - void EnterCombat(Unit* /*who*/) - { - DoScriptText(SAY_AGGRO, me); - } - - void JustDied(Unit* /*killer*/) - { - DoScriptText(SAY_DEATH, me); - if (instance) - instance->SetData(DATA_MARLI, DONE); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (me->getVictim() && me->isAlive()) - { - if (PoisonVolley_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_POISONVOLLEY); - PoisonVolley_Timer = urand(10000, 20000); - } else PoisonVolley_Timer -= diff; - - if (!PhaseTwo && Aspect_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_ASPECT_OF_MARLI); - Aspect_Timer = urand(13000, 18000); - } else Aspect_Timer -= diff; - - if (!Spawned && SpawnStartSpiders_Timer <= diff) - { - DoScriptText(SAY_SPIDER_SPAWN, me); - - Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0); - if (!target) - return; - - Creature* Spider = NULL; - - Spider = me->SummonCreature(15041, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Spider) - Spider->AI()->AttackStart(target); - Spider = me->SummonCreature(15041, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Spider) - Spider->AI()->AttackStart(target); - Spider = me->SummonCreature(15041, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Spider) - Spider->AI()->AttackStart(target); - Spider = me->SummonCreature(15041, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Spider) - Spider->AI()->AttackStart(target); - - Spawned = true; - } else SpawnStartSpiders_Timer -= diff; - - if (SpawnSpider_Timer <= diff) - { - Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0); - if (!target) - return; - - Creature* Spider = me->SummonCreature(15041, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Spider) - Spider->AI()->AttackStart(target); - SpawnSpider_Timer = urand(12000, 17000); - } else SpawnSpider_Timer -= diff; - - if (!PhaseTwo && Transform_Timer <= diff) - { - DoScriptText(SAY_TRANSFORM, me); - DoCast(me, SPELL_SPIDER_FORM); - const CreatureTemplate* cinfo = me->GetCreatureTemplate(); - me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35))); - me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35))); - me->UpdateDamagePhysical(BASE_ATTACK); - DoCast(me->getVictim(), SPELL_ENVOLWINGWEB); - - if (DoGetThreat(me->getVictim())) - DoModifyThreatPercent(me->getVictim(), -100); - - PhaseTwo = true; - Transform_Timer = urand(35000, 60000); - } else Transform_Timer -= diff; - - if (PhaseTwo) - { - if (Charge_Timer <= diff) - { - Unit* target = NULL; - int i = 0; - while (i < 3) // max 3 tries to get a random target with power_mana - { - ++i; - target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true); // not aggro leader - if (target && target->getPowerType() == POWER_MANA) - i = 3; - } - if (target) - { - DoCast(target, SPELL_CHARGE); - //me->SetPosition(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0); - //me->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, true, 1); - AttackStart(target); - } - - Charge_Timer = 8000; - } else Charge_Timer -= diff; - - if (TransformBack_Timer <= diff) - { - me->SetDisplayId(15220); - const CreatureTemplate* cinfo = me->GetCreatureTemplate(); - me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 1))); - me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 1))); - me->UpdateDamagePhysical(BASE_ATTACK); - - PhaseTwo = false; - TransformBack_Timer = urand(25000, 40000); - } else TransformBack_Timer -= diff; - - } - - DoMeleeAttackIfReady(); - } - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new boss_marliAI(creature); - } -}; - -//Spawn of Marli -class mob_spawn_of_marli : public CreatureScript -{ - public: - - mob_spawn_of_marli() - : CreatureScript("mob_spawn_of_marli") - { - } - - struct mob_spawn_of_marliAI : public ScriptedAI - { - mob_spawn_of_marliAI(Creature* creature) : ScriptedAI(creature) {} - - uint32 LevelUp_Timer; - - void Reset() - { - LevelUp_Timer = 3000; - } - - void EnterCombat(Unit* /*who*/) - { - } - - void UpdateAI (const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //LevelUp_Timer - if (LevelUp_Timer <= diff) - { - DoCast(me, SPELL_LEVELUP); - LevelUp_Timer = 3000; - } else LevelUp_Timer -= diff; - - DoMeleeAttackIfReady(); - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_spawn_of_marliAI(creature); - } -}; - -void AddSC_boss_marli() -{ - new boss_marli(); - new mob_spawn_of_marli(); -} - diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp index 32a8f209917..4b4cfa1bd45 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp @@ -1,6 +1,5 @@ /* * Copyright (C) 2008-2012 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 * * 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 @@ -16,135 +15,65 @@ * with this program. If not, see . */ -/* ScriptData -SDName: Boss_Renataki -SD%Complete: 100 -SDComment: -SDCategory: Zul'Gurub -EndScriptData */ - +#include "ObjectMgr.h" #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "zulgurub.h" -#define SPELL_AMBUSH 24337 -#define SPELL_THOUSANDBLADES 24649 +enum Yells +{ +}; -#define EQUIP_ID_MAIN_HAND 0 //was item display id 31818, but this id does not exist +enum Spells +{ +}; + +enum Events +{ +}; class boss_renataki : public CreatureScript { public: + boss_renataki() : CreatureScript("boss_renataki") { } - boss_renataki() - : CreatureScript("boss_renataki") - { - } - - struct boss_renatakiAI : public ScriptedAI + struct boss_renatakiAI : public BossAI { - boss_renatakiAI(Creature* creature) : ScriptedAI(creature) {} - - uint32 Invisible_Timer; - uint32 Ambush_Timer; - uint32 Visible_Timer; - uint32 Aggro_Timer; - uint32 ThousandBlades_Timer; - - bool Invisible; - bool Ambushed; + boss_renatakiAI(Creature* creature) : BossAI(creature, DATA_RENATAKI) + { + } void Reset() { - Invisible_Timer = urand(8000, 18000); - Ambush_Timer = 3000; - Visible_Timer = 4000; - Aggro_Timer = urand(15000, 25000); - ThousandBlades_Timer = urand(4000, 8000); - - Invisible = false; - Ambushed = false; } void EnterCombat(Unit* /*who*/) { } - void UpdateAI(const uint32 diff) + void JustDied(Unit* /*killer*/) + { + } + + void UpdateAI(uint32 const diff) { if (!UpdateVictim()) return; - //Invisible_Timer - if (Invisible_Timer <= diff) - { - me->InterruptSpell(CURRENT_GENERIC_SPELL); - - SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE); - me->SetDisplayId(11686); + events.Update(diff); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - Invisible = true; - - Invisible_Timer = urand(15000, 30000); - } else Invisible_Timer -= diff; - - if (Invisible) - { - if (Ambush_Timer <= diff) - { - Unit* target = NULL; - target = SelectTarget(SELECT_TARGET_RANDOM, 0); - if (target) - { - DoTeleportTo(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ()); - DoCast(target, SPELL_AMBUSH); - } - - Ambushed = true; - Ambush_Timer = 3000; - } else Ambush_Timer -= diff; - } - - if (Ambushed) - { - if (Visible_Timer <= diff) - { - me->InterruptSpell(CURRENT_GENERIC_SPELL); - - me->SetDisplayId(15268); - SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE); - - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - Invisible = false; - - Visible_Timer = 4000; - } else Visible_Timer -= diff; - } - - //Resetting some aggro so he attacks other gamers - if (!Invisible) + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + /* + while (uint32 eventId = events.ExecuteEvent()) { - if (Aggro_Timer <= diff) - { - Unit* target = NULL; - target = SelectTarget(SELECT_TARGET_RANDOM, 1); - - if (DoGetThreat(me->getVictim())) - DoModifyThreatPercent(me->getVictim(), -50); - - if (target) - AttackStart(target); - - Aggro_Timer = urand(7000, 20000); - } else Aggro_Timer -= diff; - - if (ThousandBlades_Timer <= diff) + switch (eventId) { - DoCast(me->getVictim(), SPELL_THOUSANDBLADES); - ThousandBlades_Timer = urand(7000, 12000); - } else ThousandBlades_Timer -= diff; + default: + break; + } } + */ DoMeleeAttackIfReady(); } @@ -160,4 +89,3 @@ void AddSC_boss_renataki() { new boss_renataki(); } - diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp deleted file mode 100644 index 29495f77f2a..00000000000 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp +++ /dev/null @@ -1,588 +0,0 @@ -/* - * Copyright (C) 2008-2012 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 - * - * 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; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; 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, see . - */ - -/* ScriptData -SDName: Boss_Thekal -SD%Complete: 95 -SDComment: Almost finished. -SDCategory: Zul'Gurub -EndScriptData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "zulgurub.h" - -#define SAY_AGGRO -1309009 -#define SAY_DEATH -1309010 - -enum eSpells -{ - SPELL_MORTALCLEAVE = 22859, - SPELL_SILENCE = 22666, - SPELL_FRENZY = 8269, - SPELL_FORCEPUNCH = 24189, - SPELL_CHARGE = 24193, - SPELL_ENRAGE = 8269, - SPELL_SUMMONTIGERS = 24183, - SPELL_TIGER_FORM = 24169, - SPELL_RESURRECT = 24173, //We will not use this spell. - -//Zealot Lor'Khan Spells - SPELL_SHIELD = 20545, - SPELL_BLOODLUST = 24185, - SPELL_GREATERHEAL = 24208, - SPELL_DISARM = 6713, - -//Zealot Zath Spells - SPELL_SWEEPINGSTRIKES = 18765, - SPELL_SINISTERSTRIKE = 15581, - SPELL_GOUGE = 12540, - SPELL_KICK = 15614, - SPELL_BLIND = 21060, -}; - -class boss_thekal : public CreatureScript -{ - public: - - boss_thekal() - : CreatureScript("boss_thekal") - { - } - - struct boss_thekalAI : public ScriptedAI - { - boss_thekalAI(Creature* creature) : ScriptedAI(creature) - { - instance = creature->GetInstanceScript(); - } - - uint32 MortalCleave_Timer; - uint32 Silence_Timer; - uint32 Frenzy_Timer; - uint32 ForcePunch_Timer; - uint32 Charge_Timer; - uint32 Enrage_Timer; - uint32 SummonTigers_Timer; - uint32 Check_Timer; - uint32 Resurrect_Timer; - - InstanceScript* instance; - bool Enraged; - bool PhaseTwo; - bool WasDead; - - void Reset() - { - MortalCleave_Timer = 4000; - Silence_Timer = 9000; - Frenzy_Timer = 30000; - ForcePunch_Timer = 4000; - Charge_Timer = 12000; - Enrage_Timer = 32000; - SummonTigers_Timer = 25000; - Check_Timer = 10000; - Resurrect_Timer = 10000; - - Enraged = false; - PhaseTwo = false; - WasDead = false; - } - - void EnterCombat(Unit* /*who*/) - { - DoScriptText(SAY_AGGRO, me); - } - - void JustDied(Unit* /*killer*/) - { - DoScriptText(SAY_DEATH, me); - if (instance) - instance->SetData(DATA_THEKAL, DONE); - } - - void JustReachedHome() - { - if (instance) - instance->SetData(DATA_THEKAL, NOT_STARTED); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //Check_Timer for the death of LorKhan and Zath. - if (!WasDead && Check_Timer <= diff) - { - if (instance) - { - if (instance->GetData(DATA_LORKHAN) == SPECIAL) - { - //Resurrect LorKhan - if (Unit* pLorKhan = Unit::GetUnit(*me, instance->GetData64(DATA_LORKHAN))) - { - pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - pLorKhan->setFaction(14); - pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - pLorKhan->SetFullHealth(); - - instance->SetData(DATA_LORKHAN, DONE); - } - } - - if (instance->GetData(DATA_ZATH) == SPECIAL) - { - //Resurrect Zath - Unit* pZath = Unit::GetUnit(*me, instance->GetData64(DATA_ZATH)); - if (pZath) - { - pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - pZath->setFaction(14); - pZath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - pZath->SetFullHealth(); - - instance->SetData(DATA_ZATH, DONE); - } - } - } - - Check_Timer = 5000; - } else Check_Timer -= diff; - - if (!PhaseTwo && MortalCleave_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_MORTALCLEAVE); - MortalCleave_Timer = urand(15000, 20000); - } else MortalCleave_Timer -= diff; - - if (!PhaseTwo && Silence_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SILENCE); - Silence_Timer = urand(20000, 25000); - } else Silence_Timer -= diff; - - if (!PhaseTwo && !WasDead && !HealthAbovePct(5)) - { - me->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE_PERCENT); - me->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE); - me->RemoveAurasByType(SPELL_AURA_PERIODIC_LEECH); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetStandState(UNIT_STAND_STATE_SLEEP); - me->AttackStop(); - - if (instance) - instance->SetData(DATA_THEKAL, SPECIAL); - - WasDead=true; - } - - //Thekal will transform to Tiger if he died and was not resurrected after 10 seconds. - if (!PhaseTwo && WasDead) - { - if (Resurrect_Timer <= diff) - { - DoCast(me, SPELL_TIGER_FORM); - me->SetObjectScale(2.00f); - me->SetStandState(UNIT_STAND_STATE_STAND); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetFullHealth(); - const CreatureTemplate* cinfo = me->GetCreatureTemplate(); - me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 40))); - me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 40))); - me->UpdateDamagePhysical(BASE_ATTACK); - DoResetThreat(); - PhaseTwo = true; - } else Resurrect_Timer -= diff; - } - - if (me->IsFullHealth() && WasDead) - { - WasDead = false; - } - - if (PhaseTwo) - { - if (Charge_Timer <= diff) - { - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) - { - DoCast(target, SPELL_CHARGE); - DoResetThreat(); - AttackStart(target); - } - - Charge_Timer = urand(15000, 22000); - } else Charge_Timer -= diff; - - if (Frenzy_Timer <= diff) - { - DoCast(me, SPELL_FRENZY); - Frenzy_Timer = 30000; - } else Frenzy_Timer -= diff; - - if (ForcePunch_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SILENCE); - ForcePunch_Timer = urand(16000, 21000); - } else ForcePunch_Timer -= diff; - - if (SummonTigers_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SUMMONTIGERS); - SummonTigers_Timer = urand(10000, 14000); - } else SummonTigers_Timer -= diff; - - if (HealthBelowPct(11) && !Enraged) - { - DoCast(me, SPELL_ENRAGE); - Enraged = true; - } - } - - DoMeleeAttackIfReady(); - - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new boss_thekalAI(creature); - } -}; - -//Zealot Lor'Khan -class mob_zealot_lorkhan : public CreatureScript -{ - public: - - mob_zealot_lorkhan() - : CreatureScript("mob_zealot_lorkhan") - { - } - - struct mob_zealot_lorkhanAI : public ScriptedAI - { - mob_zealot_lorkhanAI(Creature* creature) : ScriptedAI(creature) - { - instance = creature->GetInstanceScript(); - } - - uint32 Shield_Timer; - uint32 BloodLust_Timer; - uint32 GreaterHeal_Timer; - uint32 Disarm_Timer; - uint32 Check_Timer; - - bool FakeDeath; - - InstanceScript* instance; - - void Reset() - { - Shield_Timer = 1000; - BloodLust_Timer = 16000; - GreaterHeal_Timer = 32000; - Disarm_Timer = 6000; - Check_Timer = 10000; - - FakeDeath = false; - - if (instance) - instance->SetData(DATA_LORKHAN, NOT_STARTED); - - me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - - void EnterCombat(Unit* /*who*/) - { - } - - void UpdateAI (const uint32 diff) - { - if (!UpdateVictim()) - return; - - //Shield_Timer - if (Shield_Timer <= diff) - { - DoCast(me, SPELL_SHIELD); - Shield_Timer = 61000; - } else Shield_Timer -= diff; - - //BloodLust_Timer - if (BloodLust_Timer <= diff) - { - DoCast(me, SPELL_BLOODLUST); - BloodLust_Timer = 20000+rand()%8000; - } else BloodLust_Timer -= diff; - - //Casting Greaterheal to Thekal or Zath if they are in meele range. - if (GreaterHeal_Timer <= diff) - { - if (instance) - { - Unit* pThekal = Unit::GetUnit(*me, instance->GetData64(DATA_THEKAL)); - Unit* pZath = Unit::GetUnit(*me, instance->GetData64(DATA_ZATH)); - - if (!pThekal || !pZath) - return; - - switch (urand(0, 1)) - { - case 0: - if (me->IsWithinMeleeRange(pThekal)) - DoCast(pThekal, SPELL_GREATERHEAL); - break; - case 1: - if (me->IsWithinMeleeRange(pZath)) - DoCast(pZath, SPELL_GREATERHEAL); - break; - } - } - - GreaterHeal_Timer = 15000+rand()%5000; - } else GreaterHeal_Timer -= diff; - - //Disarm_Timer - if (Disarm_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_DISARM); - Disarm_Timer = 15000+rand()%10000; - } else Disarm_Timer -= diff; - - //Check_Timer for the death of LorKhan and Zath. - if (!FakeDeath && Check_Timer <= diff) - { - if (instance) - { - if (instance->GetData(DATA_THEKAL) == SPECIAL) - { - //Resurrect Thekal - if (Unit* pThekal = Unit::GetUnit(*me, instance->GetData64(DATA_THEKAL))) - { - pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - pThekal->setFaction(14); - pThekal->SetFullHealth(); - } - } - - if (instance->GetData(DATA_ZATH) == SPECIAL) - { - //Resurrect Zath - if (Unit* pZath = Unit::GetUnit(*me, instance->GetData64(DATA_ZATH))) - { - pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - pZath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - pZath->setFaction(14); - pZath->SetFullHealth(); - } - } - } - - Check_Timer = 5000; - } else Check_Timer -= diff; - - if (!HealthAbovePct(5)) - { - me->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE_PERCENT); - me->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE); - me->RemoveAurasByType(SPELL_AURA_PERIODIC_LEECH); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetStandState(UNIT_STAND_STATE_SLEEP); - me->setFaction(35); - me->AttackStop(); - - if (instance) - instance->SetData(DATA_LORKHAN, SPECIAL); - - FakeDeath = true; - } - - DoMeleeAttackIfReady(); - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_zealot_lorkhanAI(creature); - } -}; - -//Zealot Zath -class mob_zealot_zath : public CreatureScript -{ - public: - - mob_zealot_zath() - : CreatureScript("mob_zealot_zath") - { - } - - struct mob_zealot_zathAI : public ScriptedAI - { - mob_zealot_zathAI(Creature* creature) : ScriptedAI(creature) - { - instance = creature->GetInstanceScript(); - } - - uint32 SweepingStrikes_Timer; - uint32 SinisterStrike_Timer; - uint32 Gouge_Timer; - uint32 Kick_Timer; - uint32 Blind_Timer; - uint32 Check_Timer; - - bool FakeDeath; - - InstanceScript* instance; - - void Reset() - { - SweepingStrikes_Timer = 13000; - SinisterStrike_Timer = 8000; - Gouge_Timer = 25000; - Kick_Timer = 18000; - Blind_Timer = 5000; - Check_Timer = 10000; - - FakeDeath = false; - - if (instance) - instance->SetData(DATA_ZATH, NOT_STARTED); - - me->SetStandState(UNIT_STAND_STATE_STAND); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - - void EnterCombat(Unit* /*who*/) - { - } - - void UpdateAI (const uint32 diff) - { - if (!UpdateVictim()) - return; - - //SweepingStrikes_Timer - if (SweepingStrikes_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SWEEPINGSTRIKES); - SweepingStrikes_Timer = 22000+rand()%4000; - } else SweepingStrikes_Timer -= diff; - - //SinisterStrike_Timer - if (SinisterStrike_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SINISTERSTRIKE); - SinisterStrike_Timer = 8000+rand()%8000; - } else SinisterStrike_Timer -= diff; - - //Gouge_Timer - if (Gouge_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_GOUGE); - - if (DoGetThreat(me->getVictim())) - DoModifyThreatPercent(me->getVictim(), -100); - - Gouge_Timer = 17000+rand()%10000; - } else Gouge_Timer -= diff; - - //Kick_Timer - if (Kick_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_KICK); - Kick_Timer = 15000+rand()%10000; - } else Kick_Timer -= diff; - - //Blind_Timer - if (Blind_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_BLIND); - Blind_Timer = 10000+rand()%10000; - } else Blind_Timer -= diff; - - //Check_Timer for the death of LorKhan and Zath. - if (!FakeDeath && Check_Timer <= diff) - { - if (instance) - { - if (instance->GetData(DATA_LORKHAN) == SPECIAL) - { - //Resurrect LorKhan - if (Unit* pLorKhan = Unit::GetUnit(*me, instance->GetData64(DATA_LORKHAN))) - { - pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - pLorKhan->setFaction(14); - pLorKhan->SetFullHealth(); - } - } - - if (instance->GetData(DATA_THEKAL) == SPECIAL) - { - //Resurrect Thekal - if (Unit* pThekal = Unit::GetUnit(*me, instance->GetData64(DATA_THEKAL))) - { - pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - pThekal->setFaction(14); - pThekal->SetFullHealth(); - } - } - } - - Check_Timer = 5000; - } else Check_Timer -= diff; - - if (!HealthAbovePct(5)) - { - me->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE_PERCENT); - me->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE); - me->RemoveAurasByType(SPELL_AURA_PERIODIC_LEECH); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetStandState(UNIT_STAND_STATE_SLEEP); - me->setFaction(35); - me->AttackStop(); - - if (instance) - instance->SetData(DATA_ZATH, SPECIAL); - - FakeDeath = true; - } - - DoMeleeAttackIfReady(); - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_zealot_zathAI(creature); - } -}; - -void AddSC_boss_thekal() -{ - new boss_thekal(); - new mob_zealot_lorkhan(); - new mob_zealot_zath(); -} - diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp index 06448032dff..83815d17d2e 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp @@ -22,75 +22,22 @@ #include "Spell.h" #include "zulgurub.h" -/* - * TODO: - * - Fix timers (research some more) - */ - -enum Texts +enum Yells { - SAY_VENOXIS_TRANSFORM = 1, // Let the coils of hate unfurl! - SAY_VENOXIS_DEATH = 2, // Ssserenity.. at lassst! }; enum Spells { - // troll form - SPELL_THRASH = 3391, - SPELL_DISPEL_MAGIC = 23859, - SPELL_RENEW = 23895, - SPELL_HOLY_NOVA = 23858, - SPELL_HOLY_FIRE = 23860, - SPELL_HOLY_WRATH = 23979, - - // snake form - SPELL_POISON_CLOUD = 23861, - SPELL_VENOM_SPIT = 23862, - - SPELL_PARASITIC_SERPENT = 23865, - SPELL_SUMMON_PARASITIC_SERPENT = 23866, - SPELL_PARASITIC_SERPENT_TRIGGER = 23867, - - // used when swapping event-stages - SPELL_VENOXIS_TRANSFORM = 23849, // 50% health - shapechange to cobra - SPELL_FRENZY = 8269, // 20% health - frenzy -}; - -enum NPCs -{ - NPC_PARASITIC_SERPENT = 14884, }; enum Events { - // troll form - EVENT_THRASH = 1, - EVENT_DISPEL_MAGIC = 2, - EVENT_RENEW = 3, - EVENT_HOLY_NOVA = 4, - EVENT_HOLY_FIRE = 5, - EVENT_HOLY_WRATH = 6, - - // phase-changing - EVENT_TRANSFORM = 7, - - // snake form events - EVENT_POISON_CLOUD = 8, - EVENT_VENOM_SPIT = 9, - EVENT_PARASITIC_SERPENT = 10, - EVENT_FRENZY = 11, -}; - -enum Phases -{ - PHASE_ONE = 1, // troll form - PHASE_TWO = 2, // snake form }; class boss_venoxis : public CreatureScript { public: - boss_venoxis() : CreatureScript("boss_venoxis") {} + boss_venoxis() : CreatureScript("boss_venoxis") { } struct boss_venoxisAI : public BossAI { @@ -100,184 +47,42 @@ class boss_venoxis : public CreatureScript void Reset() { - events.Reset(); - summons.DespawnAll(); - - // make sure this boss is properly reset - instance->SetBossState(DATA_VENOXIS, NOT_STARTED); - - // remove all spells and auras from previous attempts - me->RemoveAllAuras(); - me->SetReactState(REACT_PASSIVE); - - // set some internally used variables to their defaults - _inMeleeRange = 0; - _transformed = false; - _frenzied = false; - - events.SetPhase(PHASE_ONE); } void EnterCombat(Unit* /*who*/) { - me->SetReactState(REACT_AGGRESSIVE); - - instance->SetBossState(DATA_VENOXIS, IN_PROGRESS); - - // Always running events - events.ScheduleEvent(EVENT_THRASH, 5000); - - // Phase one events (regular form) - events.ScheduleEvent(EVENT_HOLY_NOVA, 5000, 0, PHASE_ONE); - events.ScheduleEvent(EVENT_DISPEL_MAGIC, 35000, 0, PHASE_ONE); - events.ScheduleEvent(EVENT_HOLY_FIRE, 10000, 0, PHASE_ONE); - events.ScheduleEvent(EVENT_RENEW, 30000, 0, PHASE_ONE); - events.ScheduleEvent(EVENT_HOLY_WRATH, 60000, 0, PHASE_ONE); - - events.SetPhase(PHASE_ONE); - - // Set zone in combat - DoZoneInCombat(); } void DamageTaken(Unit* /*attacker*/, uint32& /*damage*/) { - // check if venoxis is ready to transform - if (!_transformed && !HealthAbovePct(50)) - { - _transformed = true; - // schedule the event that changes our phase - events.ScheduleEvent(EVENT_TRANSFORM, 100); - } - // we're losing health, bad, go frenzy - else if (!_frenzied && !HealthAbovePct(20)) - { - _frenzied = true; - events.ScheduleEvent(EVENT_FRENZY, 100); - } } void JustDied(Unit* /*killer*/) { - Talk(SAY_VENOXIS_DEATH); - // venoxis is dead, mark him as such for the instance - instance->SetBossState(DATA_VENOXIS, DONE); - me->RemoveAllAuras(); } - void UpdateAI(const uint32 diff) + void UpdateAI(uint32 const diff) { if (!UpdateVictim()) return; events.Update(diff); - // return back to main code if we're still casting if (me->HasUnitState(UNIT_STATE_CASTING)) return; - + /* while (uint32 eventId = events.ExecuteEvent()) { switch (eventId) { - // thrash is available in all phases - case EVENT_THRASH: - DoCast(me, SPELL_THRASH, true); - events.ScheduleEvent(EVENT_THRASH, urand(10000, 20000)); - break; - - // troll form spells and Actions (first part) - case EVENT_DISPEL_MAGIC: - DoCast(me, SPELL_DISPEL_MAGIC); - events.ScheduleEvent(EVENT_DISPEL_MAGIC, urand(15000, 20000), 0, PHASE_ONE); - break; - case EVENT_RENEW: - DoCast(me, SPELL_RENEW); - events.ScheduleEvent(EVENT_RENEW, urand(25000, 30000), 0, PHASE_ONE); - break; - case EVENT_HOLY_NOVA: - _inMeleeRange = 0; - - for (uint8 i = 0; i < 10; ++i) - { - if (Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, i)) - // check if target is within melee-distance - if (me->IsWithinMeleeRange(target)) - ++_inMeleeRange; - } - - // trigger spellcast only if we have 3 or more targets to affect - if (_inMeleeRange >= 3) - DoCast(me->getVictim(), SPELL_HOLY_NOVA); - - events.ScheduleEvent(EVENT_HOLY_NOVA, urand(45000, 75000), 0, PHASE_ONE); - break; - case EVENT_HOLY_FIRE: - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM)) - DoCast(target, SPELL_HOLY_FIRE); - events.ScheduleEvent(EVENT_HOLY_FIRE, urand(45000, 60000), 0, PHASE_ONE); - break; - case EVENT_HOLY_WRATH: - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM)) - DoCast(target, SPELL_HOLY_WRATH); - events.ScheduleEvent(EVENT_HOLY_WRATH, urand(45000, 60000), 0, PHASE_ONE); - break; - - // - // snake form spells and Actions - // - - case EVENT_VENOM_SPIT: - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM)) - DoCast(target, SPELL_VENOM_SPIT); - events.ScheduleEvent(EVENT_VENOM_SPIT, urand(5000, 15000), 0, PHASE_TWO); - break; - case EVENT_POISON_CLOUD: - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM)) - DoCast(target, SPELL_POISON_CLOUD); - events.ScheduleEvent(EVENT_POISON_CLOUD, urand(15000, 20000), 0, PHASE_TWO); - break; - case EVENT_PARASITIC_SERPENT: - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM)) - DoCast(target, SPELL_SUMMON_PARASITIC_SERPENT); - events.ScheduleEvent(EVENT_PARASITIC_SERPENT, 15000, 0, PHASE_TWO); - break; - case EVENT_FRENZY: - // frenzy at 20% health - DoCast(me, SPELL_FRENZY, true); - break; - - // - // shape and phase-changing - // - - case EVENT_TRANSFORM: - // shapeshift at 50% health - DoCast(me, SPELL_VENOXIS_TRANSFORM); - Talk(SAY_VENOXIS_TRANSFORM); - DoResetThreat(); - - // phase two events (snakeform) - events.ScheduleEvent(EVENT_VENOM_SPIT, 5000, 0, PHASE_TWO); - events.ScheduleEvent(EVENT_POISON_CLOUD, 10000, 0, PHASE_TWO); - events.ScheduleEvent(EVENT_PARASITIC_SERPENT, 30000, 0, PHASE_TWO); - - // transformed, start phase two - events.SetPhase(PHASE_TWO); - - break; default: break; } } + */ DoMeleeAttackIfReady(); } - - private: - uint8 _inMeleeRange; - bool _transformed; - bool _frenzied; }; CreatureAI* GetAI(Creature* creature) const diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp index 6cdb00236df..be6dd137b67 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp @@ -1,6 +1,5 @@ /* * Copyright (C) 2008-2012 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 * * 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 @@ -16,67 +15,65 @@ * with this program. If not, see . */ -/* ScriptData -SDName: Boss_Wushoolay -SD%Complete: 100 -SDComment: -SDCategory: Zul'Gurub -EndScriptData */ - +#include "ObjectMgr.h" #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "zulgurub.h" -#define SPELL_LIGHTNINGCLOUD 25033 -#define SPELL_LIGHTNINGWAVE 24819 +enum Yells +{ +}; + +enum Spells +{ +}; + +enum Events +{ +}; class boss_wushoolay : public CreatureScript { public: + boss_wushoolay() : CreatureScript("boss_wushoolay") { } - boss_wushoolay() - : CreatureScript("boss_wushoolay") - { - } - - struct boss_wushoolayAI : public ScriptedAI + struct boss_wushoolayAI : public BossAI { - boss_wushoolayAI(Creature* creature) : ScriptedAI(creature) {} - - uint32 LightningCloud_Timer; - uint32 LightningWave_Timer; + boss_wushoolayAI(Creature* creature) : BossAI(creature, DATA_HAZZARAH) + { + } void Reset() { - LightningCloud_Timer = urand(5000, 10000); - LightningWave_Timer = urand(8000, 16000); } void EnterCombat(Unit* /*who*/) { } - void UpdateAI(const uint32 diff) + void JustDied(Unit* /*killer*/) + { + } + + void UpdateAI(uint32 const diff) { if (!UpdateVictim()) return; - //LightningCloud_Timer - if (LightningCloud_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_LIGHTNINGCLOUD); - LightningCloud_Timer = urand(15000, 20000); - } else LightningCloud_Timer -= diff; + events.Update(diff); - //LightningWave_Timer - if (LightningWave_Timer <= diff) + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + /* + while (uint32 eventId = events.ExecuteEvent()) { - Unit* target = NULL; - target = SelectTarget(SELECT_TARGET_RANDOM, 0); - if (target) DoCast(target, SPELL_LIGHTNINGWAVE); - - LightningWave_Timer = urand(12000, 16000); - } else LightningWave_Timer -= diff; + switch (eventId) + { + default: + break; + } + } + */ DoMeleeAttackIfReady(); } @@ -92,4 +89,3 @@ void AddSC_boss_wushoolay() { new boss_wushoolay(); } - diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_zanzil.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_zanzil.cpp new file mode 100644 index 00000000000..2d5fae00550 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_zanzil.cpp @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2008-2012 TrinityCore + * + * 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; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; 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, see . + */ + +#include "ObjectMgr.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "zulgurub.h" + +enum Yells +{ +}; + +enum Spells +{ +}; + +enum Events +{ +}; + +class boss_zanzil : public CreatureScript +{ + public: + boss_zanzil() : CreatureScript("boss_zanzil") { } + + struct boss_zanzilAI : public BossAI + { + boss_zanzilAI(Creature* creature) : BossAI(creature, DATA_ZANZIL) + { + } + + void Reset() + { + } + + void EnterCombat(Unit* /*who*/) + { + } + + void JustDied(Unit* /*killer*/) + { + } + + void UpdateAI(uint32 const diff) + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + /* + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + default: + break; + } + } + */ + + DoMeleeAttackIfReady(); + } + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new boss_zanzilAI(creature); + } +}; + +void AddSC_boss_zanzil() +{ + new boss_zanzil(); +} diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp index 104d479383b..2ebec27129f 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp @@ -16,13 +16,6 @@ * with this program. If not, see . */ -/* ScriptData -SDName: Instance_ZulGurub -SD%Complete: 80 -SDComment: Missing reset function after killing a boss for Ohgan, Thekal. -SDCategory: Zul'Gurub -EndScriptData */ - #include "ScriptMgr.h" #include "InstanceScript.h" #include "zulgurub.h" @@ -30,128 +23,186 @@ EndScriptData */ class instance_zulgurub : public InstanceMapScript { public: - instance_zulgurub() - : InstanceMapScript("instance_zulgurub", 309) - { - } + instance_zulgurub() : InstanceMapScript(ZGScriptName, 309) { } struct instance_zulgurub_InstanceMapScript : public InstanceScript { - instance_zulgurub_InstanceMapScript(Map* map) : InstanceScript(map) {} - - //If all High Priest bosses were killed. Lorkhan, Zath and Ohgan are added too. - uint32 m_auiEncounter[MAX_ENCOUNTERS]; - - //Storing Lorkhan, Zath and Thekal because we need to cast on them later. Jindo is needed for healfunction too. - uint64 m_uiLorKhanGUID; - uint64 m_uiZathGUID; - uint64 m_uiThekalGUID; - uint64 m_uiJindoGUID; - - void Initialize() + instance_zulgurub_InstanceMapScript(Map* map) : InstanceScript(map) { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + SetBossNumber(EncounterCount); + venoxisGUID = 0; + mandokirGUID = 0; + kilnaraGUID = 0; + zanzilGUID = 0; + jindoGUID = 0; + hazzarahGUID = 0; + renatakiGUID = 0; + wushoolayGUID = 0; + grilekGUID = 0; + } - m_uiLorKhanGUID = 0; - m_uiZathGUID = 0; - m_uiThekalGUID = 0; - m_uiJindoGUID = 0; + void OnCreatureCreate(Creature* creature) + { + switch (creature->GetEntry()) + { + case NPC_VENOXIS: + venoxisGUID = creature->GetGUID(); + break; + case NPC_MANDOKIR: + mandokirGUID = creature->GetGUID(); + break; + case NPC_KILNARA: + kilnaraGUID = creature->GetGUID(); + break; + case NPC_ZANZIL: + zanzilGUID = creature->GetGUID(); + break; + case NPC_JINDO: + jindoGUID = creature->GetGUID(); + break; + case NPC_HAZZARAH: + hazzarahGUID = creature->GetGUID(); + break; + case NPC_RENATAKI: + renatakiGUID = creature->GetGUID(); + break; + case NPC_WUSHOOLAY: + wushoolayGUID = creature->GetGUID(); + break; + case NPC_GRILEK: + grilekGUID = creature->GetGUID(); + break; + default: + break; + } } - bool IsEncounterInProgress() const + bool SetBossState(uint32 type, EncounterState state) { - //not active in Zul'Gurub - return false; + if (!InstanceScript::SetBossState(type, state)) + return false; + + switch (type) + { + case DATA_VENOXIS: + case DATA_MANDOKIR: + case DATA_KILNARA: + case DATA_ZANZIL: + case DATA_JINDO: + case DATA_HAZZARAH: + case DATA_RENATAKI: + case DATA_WUSHOOLAY: + case DATA_GRILEK: + break; + default: + break; + } + + return true; } - void OnCreatureCreate(Creature* creature) + /* + void SetData(uint32 type, uint32 data) { - switch (creature->GetEntry()) + switch (type) { - case 11347: m_uiLorKhanGUID = creature->GetGUID(); break; - case 11348: m_uiZathGUID = creature->GetGUID(); break; - case 14509: m_uiThekalGUID = creature->GetGUID(); break; - case 11380: m_uiJindoGUID = creature->GetGUID(); break; } } - void SetData(uint32 uiType, uint32 uiData) + uint32 GetData(uint32 type) { - switch (uiType) + switch (type) { - case DATA_ARLOKK: - m_auiEncounter[0] = uiData; - break; + } - case DATA_JEKLIK: - m_auiEncounter[1] = uiData; - break; + return 0; + } + */ + uint64 GetData64(uint32 type) + { + switch (type) + { case DATA_VENOXIS: - m_auiEncounter[2] = uiData; + return venoxisGUID; + case DATA_MANDOKIR: + return mandokirGUID; + case DATA_KILNARA: + return kilnaraGUID; + case DATA_ZANZIL: + return zanzilGUID; + case DATA_JINDO: + return jindoGUID; + case DATA_HAZZARAH: + return hazzarahGUID; + case DATA_RENATAKI: + return renatakiGUID; + case DATA_WUSHOOLAY: + return wushoolayGUID; + case DATA_GRILEK: + return grilekGUID; + default: break; - case DATA_MARLI: - m_auiEncounter[3] = uiData; - break; + } - case DATA_THEKAL: - m_auiEncounter[4] = uiData; - break; + return 0; + } - case DATA_LORKHAN: - m_auiEncounter[5] = uiData; - break; + std::string GetSaveData() + { + OUT_SAVE_INST_DATA; - case DATA_ZATH: - m_auiEncounter[6] = uiData; - break; + std::ostringstream saveStream; + saveStream << "Z G " << GetBossSaveData(); - case DATA_OHGAN: - m_auiEncounter[7] = uiData; - break; - } + OUT_SAVE_INST_DATA_COMPLETE; + return saveStream.str(); } - uint32 GetData(uint32 uiType) + void Load(char const* str) { - switch (uiType) + if (!str) { - case DATA_ARLOKK: - return m_auiEncounter[0]; - case DATA_JEKLIK: - return m_auiEncounter[1]; - case DATA_VENOXIS: - return m_auiEncounter[2]; - case DATA_MARLI: - return m_auiEncounter[3]; - case DATA_THEKAL: - return m_auiEncounter[4]; - case DATA_LORKHAN: - return m_auiEncounter[5]; - case DATA_ZATH: - return m_auiEncounter[6]; - case DATA_OHGAN: - return m_auiEncounter[7]; + OUT_LOAD_INST_DATA_FAIL; + return; } - return 0; - } - uint64 GetData64(uint32 uiData) - { - switch (uiData) + OUT_LOAD_INST_DATA(str); + + char dataHead1, dataHead2; + + std::istringstream loadStream(str); + loadStream >> dataHead1 >> dataHead2; + + if (dataHead1 == 'Z' && dataHead2 == 'G') { - case DATA_LORKHAN: - return m_uiLorKhanGUID; - case DATA_ZATH: - return m_uiZathGUID; - case DATA_THEKAL: - return m_uiThekalGUID; - case DATA_JINDO: - return m_uiJindoGUID; + for (uint8 i = 0; i < EncounterCount; ++i) + { + uint32 tmpState; + loadStream >> tmpState; + if (tmpState == IN_PROGRESS || tmpState > SPECIAL) + tmpState = NOT_STARTED; + + SetBossState(i, EncounterState(tmpState)); + } } - return 0; + else + OUT_LOAD_INST_DATA_FAIL; + + OUT_LOAD_INST_DATA_COMPLETE; } + + protected: + uint64 venoxisGUID; + uint64 mandokirGUID; + uint64 kilnaraGUID; + uint64 zanzilGUID; + uint64 jindoGUID; + uint64 hazzarahGUID; + uint64 renatakiGUID; + uint64 wushoolayGUID; + uint64 grilekGUID; }; InstanceScript* GetInstanceScript(InstanceMap* map) const diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h b/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h index d127680cec5..0deeb1c974d 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h +++ b/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h @@ -19,20 +19,49 @@ #ifndef DEF_ZULGURUB_H #define DEF_ZULGURUB_H +#define ZGScriptName "instance_zulgurub" + +uint32 const EncounterCount = 5; + enum DataTypes { - MAX_ENCOUNTERS = 8, - - DATA_ARLOKK = 1, - DATA_JEKLIK = 2, - DATA_VENOXIS = 3, - DATA_MARLI = 4, - DATA_OHGAN = 5, - DATA_THEKAL = 6, - DATA_ZATH = 7, - DATA_LORKHAN = 8, - DATA_JINDO = 10, + DATA_VENOXIS = 0, + DATA_MANDOKIR = 1, + DATA_KILNARA = 2, + DATA_ZANZIL = 3, + DATA_JINDO = 4, + + // Cache of Madness + DATA_HAZZARAH = 5, + DATA_RENATAKI = 6, + DATA_WUSHOOLAY = 7, + DATA_GRILEK = 8, }; +enum CreatureIds +{ + NPC_VENOXIS = 52155, + NPC_MANDOKIR = 52151, + NPC_KILNARA = 52059, + NPC_ZANZIL = 52053, + NPC_JINDO = 52148, + + // Cache of Madness + NPC_HAZZARAH = 52271, + NPC_RENATAKI = 52269, + NPC_WUSHOOLAY = 52286, + NPC_GRILEK = 52258, +}; + +template +CreatureAI* GetZulGurubCitadelAI(Creature* creature) +{ + if (InstanceMap* instance = creature->GetMap()->ToInstanceMap()) + if (instance->GetInstanceScript()) + if (instance->GetScriptId() == sObjectMgr->GetScriptId(ZGScriptName)) + return new AI(creature); + return NULL; +} + #endif -- cgit v1.2.3 From ae52fe08c423fc1291dc739e34ba5cc8fe66c184 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Sat, 18 Aug 2012 22:37:14 +0200 Subject: Core/Misc: * Fix warning * Fix codestyle in 1be45d1a0a759dbdb817ff3812015ecc1ea916ca# --- src/server/game/Entities/Player/Player.cpp | 4 ++-- src/server/game/Scripting/ScriptLoader.cpp | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 23af34ddeee..02de9a16729 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -3146,7 +3146,7 @@ void Player::GiveLevel(uint8 level) SetFullHealth(); SetPower(POWER_MANA, GetMaxPower(POWER_MANA)); SetPower(POWER_ENERGY, GetMaxPower(POWER_ENERGY)); - if ((uint32)GetPower(POWER_RAGE) > GetMaxPower(POWER_RAGE)) + if (GetPower(POWER_RAGE) > GetMaxPower(POWER_RAGE)) SetPower(POWER_RAGE, GetMaxPower(POWER_RAGE)); SetPower(POWER_FOCUS, 0); @@ -3373,7 +3373,7 @@ void Player::InitStatsForLevel(bool reapplyMods) SetFullHealth(); SetPower(POWER_MANA, GetMaxPower(POWER_MANA)); SetPower(POWER_ENERGY, GetMaxPower(POWER_ENERGY)); - if ((uint32)GetPower(POWER_RAGE) > GetMaxPower(POWER_RAGE)) + if (GetPower(POWER_RAGE) > GetMaxPower(POWER_RAGE)) SetPower(POWER_RAGE, GetMaxPower(POWER_RAGE)); SetPower(POWER_FOCUS, GetMaxPower(POWER_FOCUS)); SetPower(POWER_RUNIC_POWER, 0); diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index 47e09222211..a8767382e03 100755 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -841,16 +841,16 @@ void AddEasternKingdomsScripts() AddSC_boss_zuljin(); AddSC_instance_zulaman(); AddSC_zulaman(); - AddSC_boss_grilek(); // Zul'Gurub - AddSC_boss_hazzarah(); - AddSC_boss_jindo_the_godbreaker(); - AddSC_boss_kilnara(); - AddSC_boss_mandokir(); - AddSC_boss_renataki(); - AddSC_boss_venoxis(); - AddSC_boss_wushoolay(); - AddSC_boss_zanzil(); - AddSC_instance_zulgurub(); + AddSC_boss_grilek(); // Zul'Gurub + AddSC_boss_hazzarah(); + AddSC_boss_jindo_the_godbreaker(); + AddSC_boss_kilnara(); + AddSC_boss_mandokir(); + AddSC_boss_renataki(); + AddSC_boss_venoxis(); + AddSC_boss_wushoolay(); + AddSC_boss_zanzil(); + AddSC_instance_zulgurub(); //AddSC_alterac_mountains(); AddSC_arathi_highlands(); -- cgit v1.2.3 From 17e0f640245e1a40d3c6b69e1ae9ce0d19f7d871 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 18 Aug 2012 23:08:23 +0200 Subject: Core/Misc: Added research notes for one spell attribute --- src/server/game/Miscellaneous/SharedDefines.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index e1799e36663..4d5019c1076 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -574,7 +574,7 @@ enum SpellAttr8 SPELL_ATTR8_UNK6 = 0x00000040, // 6 SPELL_ATTR8_UNK7 = 0x00000080, // 7 SPELL_ATTR8_UNK8 = 0x00000100, // 8 - SPELL_ATTR8_UNK9 = 0x00000200, // 9 + SPELL_ATTR8_UNK9 = 0x00000200, // 9 Periodic auras with this flag keep old periodic timer when refreshing at close to one tick remaining (kind of anti DoT clipping) SPELL_ATTR8_UNK10 = 0x00000400, // 10 SPELL_ATTR8_UNK11 = 0x00000800, // 11 SPELL_ATTR8_AURA_SEND_AMOUNT = 0x00001000, // 12 Aura must have flag AFLAG_ANY_EFFECT_AMOUNT_SENT to send amount -- cgit v1.2.3 From 8ca6538f6d13f1d7f7b9c1765191a203d09d5851 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Sun, 19 Aug 2012 01:02:57 +0200 Subject: Scripts/Zul Gurub: Fix map id in instance script for cata --- src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp index 2ebec27129f..b0c1c7ecddd 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp @@ -23,7 +23,7 @@ class instance_zulgurub : public InstanceMapScript { public: - instance_zulgurub() : InstanceMapScript(ZGScriptName, 309) { } + instance_zulgurub() : InstanceMapScript(ZGScriptName, 859) { } struct instance_zulgurub_InstanceMapScript : public InstanceScript { -- cgit v1.2.3 From 68a130dc925970432558418e710cef44cb999eb5 Mon Sep 17 00:00:00 2001 From: Subv Date: Sat, 18 Aug 2012 18:38:02 -0500 Subject: Core/Spells: Removed more spell obsolete code --- src/server/game/Achievements/AchievementMgr.cpp | 83 -------------- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 127 +++------------------- 2 files changed, 14 insertions(+), 196 deletions(-) (limited to 'src') diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 2118b4cf42c..30b6de3fc4d 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -2935,89 +2935,6 @@ void AchievementGlobalMgr::LoadAchievementCriteriaData() } while (result->NextRow()); - // post loading checks - for (uint32 entryId = 0; entryId < sAchievementCriteriaStore.GetNumRows(); ++entryId) - { - AchievementCriteriaEntry const* criteria = sAchievementCriteriaStore.LookupEntry(entryId); - if (!criteria) - continue; - - switch (criteria->requiredType) - { - case ACHIEVEMENT_CRITERIA_TYPE_WIN_BG: // any cases - break; - case ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE: - break; // any cases - case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST: - { - AchievementEntry const* achievement = sAchievementStore.LookupEntry(criteria->referredAchievement); - if (!achievement) - continue; - - // exist many achievements with this criteria, use at this moment hardcoded check to skil simple case - if (achievement->ID == 1282) - break; - - continue; - } - case ACHIEVEMENT_CRITERIA_TYPE_FALL_WITHOUT_DYING: - break; // any cases - case ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET: // any cases - break; - case ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL: // any cases - break; - case ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA: // need skip generic cases - if (criteria->additionalRequirements[0].additionalRequirement_type != ACHIEVEMENT_CRITERIA_CONDITION_NO_LOSE) - continue; - break; - case ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM: // any cases - break; - case ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED_ON_LOOT: - break; // any cases - case ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED_ON_LOOT: - break; // any cases - case ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE: // need skip generic cases - if (criteria->do_emote.count == 0) - continue; - break; - case ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2: - break; // any cases - case ACHIEVEMENT_CRITERIA_TYPE_WIN_DUEL: // skip statistics - if (criteria->win_duel.duelCount == 0) - continue; - break; - case ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL2: // any cases - break; - case ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE: // need skip generic cases - if (criteria->loot_type.lootTypeCount != 1) - continue; - break; - case ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE: - break; // any cases - case ACHIEVEMENT_CRITERIA_TYPE_SPECIAL_PVP_KILL: - break; // any cases - case ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL: // any cases - break; - case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST: - case ACHIEVEMENT_CRITERIA_TYPE_USE_ITEM: // only Children's Week achievements - { - AchievementEntry const* achievement = sAchievementStore.LookupEntry(criteria->referredAchievement); - if (!achievement) - continue; - if (achievement->categoryId != CATEGORY_CHILDRENS_WEEK) - continue; - break; - } - case ACHIEVEMENT_CRITERIA_TYPE_GET_KILLING_BLOWS: - break; - default: // type not use DB data, ignore - continue; - } - - if (!GetCriteriaDataSet(criteria) && !DisableMgr::IsDisabledFor(DISABLE_TYPE_ACHIEVEMENT_CRITERIA, entryId, NULL)) - sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` does not have expected data for criteria (Entry: %u Type: %u) for achievement %u.", criteria->ID, criteria->requiredType, criteria->referredAchievement); - } - sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u additional achievement criteria data in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index d0f4a93e35d..027ab164ad8 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -523,7 +523,7 @@ int32 AuraEffect::CalculateAmount(Unit* caster) { if ((*itr)->IsAffectingSpell(m_spellInfo)) { - // Glyph of Fear, Glyph of Frost nova and similar auras + // Glyph of Frost nova and similar auras if ((*itr)->GetMiscValue() == 7801) { AddPctN(amount, (*itr)->GetAmount()); @@ -543,28 +543,19 @@ int32 AuraEffect::CalculateAmount(Unit* caster) // Ice Barrier if (GetSpellInfo()->SpellFamilyFlags[1] & 0x1 && GetSpellInfo()->SpellFamilyFlags[2] & 0x8) { - // +80.68% from sp bonus - DoneActualBenefit += caster->SpellBaseDamageBonusDone(m_spellInfo->GetSchoolMask()) * 0.8068f; - // Glyph of Ice Barrier: its weird having a SPELLMOD_ALL_EFFECTS here but its blizzards doing :) - // Glyph of Ice Barrier is only applied at the spell damage bonus because it was already applied to the base value in CalculateSpellDamage - DoneActualBenefit = caster->ApplyEffectModifiers(GetSpellInfo(), m_effIndex, DoneActualBenefit); + // +87% from sp bonus + DoneActualBenefit += caster->SpellBaseDamageBonusDone(m_spellInfo->GetSchoolMask()) * 0.87f; } - // Fire Ward + // Mage Ward else if (GetSpellInfo()->SpellFamilyFlags[0] & 0x8 && GetSpellInfo()->SpellFamilyFlags[2] & 0x8) { // +80.68% from sp bonus DoneActualBenefit += caster->SpellBaseDamageBonusDone(m_spellInfo->GetSchoolMask()) * 0.8068f; } - // Frost Ward - else if (GetSpellInfo()->SpellFamilyFlags[0] & 0x100 && GetSpellInfo()->SpellFamilyFlags[2] & 0x8) - { - // +80.68% from sp bonus - DoneActualBenefit += caster->SpellBaseDamageBonusDone(m_spellInfo->GetSchoolMask()) * 0.8068f; - } break; case SPELLFAMILY_WARLOCK: // Shadow Ward - if (m_spellInfo->SpellFamilyFlags[2] & 0x40) + if (m_spellInfo->SpellFamilyFlags[2] & 0x80000000) { // +80.68% from sp bonus DoneActualBenefit += caster->SpellBaseDamageBonusDone(m_spellInfo->GetSchoolMask()) * 0.8068f; @@ -572,28 +563,18 @@ int32 AuraEffect::CalculateAmount(Unit* caster) break; case SPELLFAMILY_PRIEST: // Power Word: Shield - if (GetSpellInfo()->SpellFamilyFlags[0] & 0x1 && GetSpellInfo()->SpellFamilyFlags[2] & 0x400) + if (GetSpellInfo()->SpellFamilyFlags[0] & 0x1) { // +80.68% from sp bonus - float bonus = 0.8068f; - - // Borrowed Time - if (AuraEffect const* pAurEff = caster->GetDummyAuraEffect(SPELLFAMILY_PRIEST, 2899, 1)) - bonus += CalculatePctN(1.0f, pAurEff->GetAmount()); - - DoneActualBenefit += caster->SpellBaseHealingBonusDone(m_spellInfo->GetSchoolMask()) * bonus; - // Improved PW: Shield: its weird having a SPELLMOD_ALL_EFFECTS here but its blizzards doing :) - // Improved PW: Shield is only applied at the spell healing bonus because it was already applied to the base value in CalculateSpellDamage - DoneActualBenefit = caster->ApplyEffectModifiers(GetSpellInfo(), m_effIndex, DoneActualBenefit); + DoneActualBenefit += caster->SpellBaseHealingBonusDone(m_spellInfo->GetSchoolMask()) * 0.8068f; DoneActualBenefit *= caster->CalculateLevelPenalty(GetSpellInfo()); amount += int32(DoneActualBenefit); // Twin Disciplines - if (AuraEffect const* pAurEff = caster->GetAuraEffect(SPELL_AURA_ADD_PCT_MODIFIER, SPELLFAMILY_PRIEST, 0x400000, 0, 0, caster->GetGUID())) + if (AuraEffect const* pAurEff = caster->GetAuraEffect(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE, SPELLFAMILY_PRIEST, 2292, 0)) AddPctN(amount, pAurEff->GetAmount()); - // Focused Power // Reuse variable, not sure if this code below can be moved before Twin Disciplines DoneActualBenefit = float(amount); DoneActualBenefit *= caster->GetTotalAuraMultiplier(SPELL_AURA_MOD_HEALING_DONE_PERCENT); @@ -602,30 +583,6 @@ int32 AuraEffect::CalculateAmount(Unit* caster) return amount; } break; - case SPELLFAMILY_PALADIN: - // Sacred Shield - if (m_spellInfo->SpellFamilyFlags[1] & 0x80000) - { - //+75.00% from sp bonus - float bonus = 0.75f; - - DoneActualBenefit += caster->SpellBaseHealingBonusDone(m_spellInfo->GetSchoolMask()) * bonus; - // Divine Guardian is only applied at the spell healing bonus because it was already applied to the base value in CalculateSpellDamage - DoneActualBenefit = caster->ApplyEffectModifiers(GetSpellInfo(), m_effIndex, DoneActualBenefit); - DoneActualBenefit *= caster->CalculateLevelPenalty(GetSpellInfo()); - - amount += (int32)DoneActualBenefit; - - // Arena - Dampening - AuraEffect const* pAurEff = caster->GetAuraEffect(74410, 0); - if (!pAurEff) - pAurEff = caster->GetAuraEffect(74411, 0); // Battleground - Dampening - if (pAurEff) - AddPctN(amount, pAurEff->GetAmount()); - - return amount; - } - break; default: break; } @@ -637,8 +594,8 @@ int32 AuraEffect::CalculateAmount(Unit* caster) // Mana Shield if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_MAGE && GetSpellInfo()->SpellFamilyFlags[0] & 0x8000 && m_spellInfo->SpellFamilyFlags[2] & 0x8) { - // +80.53% from +spd bonus - DoneActualBenefit += caster->SpellBaseDamageBonusDone(m_spellInfo->GetSchoolMask()) * 0.8053f; + // +80.7% from +spd bonus + DoneActualBenefit += caster->SpellBaseDamageBonusDone(m_spellInfo->GetSchoolMask()) * 0.807f; } break; case SPELL_AURA_DUMMY: @@ -654,24 +611,8 @@ int32 AuraEffect::CalculateAmount(Unit* caster) case SPELL_AURA_PERIODIC_DAMAGE: if (!caster) break; - // Rupture - if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_ROGUE && m_spellInfo->SpellFamilyFlags[0] & 0x100000) - { - m_canBeRecalculated = false; - if (caster->GetTypeId() != TYPEID_PLAYER) - break; - //1 point : ${($m1+$b1*1+0.015*$AP)*4} damage over 8 secs - //2 points: ${($m1+$b1*2+0.024*$AP)*5} damage over 10 secs - //3 points: ${($m1+$b1*3+0.03*$AP)*6} damage over 12 secs - //4 points: ${($m1+$b1*4+0.03428571*$AP)*7} damage over 14 secs - //5 points: ${($m1+$b1*5+0.0375*$AP)*8} damage over 16 secs - float AP_per_combo[6] = {0.0f, 0.015f, 0.024f, 0.03f, 0.03428571f, 0.0375f}; - uint8 cp = caster->ToPlayer()->GetComboPoints(); - if (cp > 5) cp = 5; - amount += int32(caster->GetTotalAttackPowerValue(BASE_ATTACK) * AP_per_combo[cp]); - } // Rip - else if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_DRUID && m_spellInfo->SpellFamilyFlags[0] & 0x00800000 && GetAuraType() == SPELL_AURA_PERIODIC_DAMAGE) + if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_DRUID && m_spellInfo->SpellFamilyFlags[0] & 0x00800000) { m_canBeRecalculated = false; // 0.01*$AP*cp @@ -693,20 +634,13 @@ int32 AuraEffect::CalculateAmount(Unit* caster) else if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_WARRIOR && GetSpellInfo()->SpellFamilyFlags[0] & 0x20) { m_canBeRecalculated = false; - // $0.2 * (($MWB + $mwb) / 2 + $AP / 14 * $MWS) bonus per tick + // ${0.25 * 6 * (($MWB + $mwb) / 2 + $AP / 14 * $MWS)} bonus per tick float ap = caster->GetTotalAttackPowerValue(BASE_ATTACK); int32 mws = caster->GetAttackTime(BASE_ATTACK); float mwb_min = caster->GetWeaponDamageRange(BASE_ATTACK, MINDAMAGE); float mwb_max = caster->GetWeaponDamageRange(BASE_ATTACK, MAXDAMAGE); - float mwb = ((mwb_min + mwb_max) / 2 + ap * mws / 14000) * 0.2f; + float mwb = ((mwb_min + mwb_max) / 2 + ap * mws / 14000) * 0.25f * 6.0f; amount += int32(caster->ApplyEffectModifiers(m_spellInfo, m_effIndex, mwb)); - // "If used while your target is above 75% health, Rend does 35% more damage." - // as for 3.1.3 only ranks above 9 (wrong tooltip?) - if (m_spellInfo->GetRank() >= 9) - { - if (GetBase()->GetUnitOwner()->HasAuraState(AURA_STATE_HEALTH_ABOVE_75_PERCENT, m_spellInfo, caster)) - AddPctN(amount, m_spellInfo->Effects[EFFECT_2].CalcValue(caster)); - } } // Unholy Blight damage over time effect else if (GetId() == 50536) @@ -720,7 +654,7 @@ int32 AuraEffect::CalculateAmount(Unit* caster) switch (m_spellInfo->Id) { case 57669: // Replenishment (0.2% from max) - amount = GetBase()->GetUnitOwner()->GetMaxPower(POWER_MANA) * 0.002f; + amount = CalculatePctN(GetBase()->GetUnitOwner()->GetMaxPower(POWER_MANA), amount); break; case 61782: // Infinite Replenishment amount = GetBase()->GetUnitOwner()->GetMaxPower(POWER_MANA) * 0.0025f; @@ -747,39 +681,6 @@ int32 AuraEffect::CalculateAmount(Unit* caster) AddPctN(amount, modHealing->GetAmount()); } break; - case SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN: - if (!caster) - break; - // Icebound Fortitude - if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT && m_spellInfo->SpellFamilyFlags[0] & 0x00100000) - { - if (caster->GetTypeId() == TYPEID_PLAYER) - { - int32 value = (-1 * amount) - 10; - uint32 defva = uint32(caster->ToPlayer()->GetSkillValue(SKILL_DEFENSE) + caster->ToPlayer()->GetRatingBonusValue(CR_DEFENSE_SKILL)); - - if (defva > 400) - value += int32((defva - 400) * 0.15); - - // Glyph of Icebound Fortitude - if (AuraEffect const* aurEff = caster->GetAuraEffect(58625, 0)) - { - int32 valMax = aurEff->GetAmount(); - if (value < valMax) - value = valMax; - } - amount = -value; - } - } - // Hand of Salvation - else if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_PALADIN && GetSpellInfo()->SpellFamilyFlags[0] & 0x00000100) - { - //Glyph of Salvation - if (caster->GetGUID() == GetBase()->GetUnitOwner()->GetGUID()) - if (AuraEffect const* aurEff = caster->GetAuraEffect(63225, 0)) - amount = -aurEff->GetAmount(); - } - break; case SPELL_AURA_MOD_THREAT: { uint8 level_diff = 0; -- cgit v1.2.3 From 7296f928358dc08525daa1338fdab63fb5740ba5 Mon Sep 17 00:00:00 2001 From: Subv Date: Sat, 18 Aug 2012 18:51:59 -0500 Subject: Core/Loading: Fixed a crash at char login --- src/server/game/Entities/Player/Player.cpp | 2 +- src/server/shared/Database/Implementation/CharacterDatabase.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 02de9a16729..482d2b484a3 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -25081,7 +25081,7 @@ void Player::SetMap(Map* map) void Player::_LoadGlyphs(PreparedQueryResult result) { - // SELECT spec, glyph1, glyph2, glyph3, glyph4, glyph5, glyph6 from character_glyphs WHERE guid = '%u' + // SELECT spec, glyph1, glyph2, glyph3, glyph4, glyph5, glyph6, glyph7, glyph8, glyph9 FROM character_glyphs WHERE guid = '%u' if (!result) return; diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index 6c58ee28838..06cc5754b68 100755 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -97,7 +97,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_SEL_CHARACTER_EQUIPMENTSETS, "SELECT setguid, setindex, name, iconname, ignore_mask, item0, item1, item2, item3, item4, item5, item6, item7, item8, " "item9, item10, item11, item12, item13, item14, item15, item16, item17, item18 FROM character_equipmentsets WHERE guid = ? ORDER BY setindex", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_CHARACTER_BGDATA, "SELECT instanceId, team, joinX, joinY, joinZ, joinO, joinMapId, taxiStart, taxiEnd, mountSpell FROM character_battleground_data WHERE guid = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_SEL_CHARACTER_GLYPHS, "SELECT spec, glyph1, glyph2, glyph3, glyph4, glyph5, glyph6 FROM character_glyphs WHERE guid = ?", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_SEL_CHARACTER_GLYPHS, "SELECT spec, glyph1, glyph2, glyph3, glyph4, glyph5, glyph6, glyph7, glyph8, glyph9 FROM character_glyphs WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_CHARACTER_TALENTS, "SELECT spell, spec FROM character_talent WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_CHARACTER_SKILLS, "SELECT skill, value, max FROM character_skills WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_CHARACTER_RANDOMBG, "SELECT guid FROM character_battleground_random WHERE guid = ?", CONNECTION_ASYNC) -- cgit v1.2.3 From 38dbff8c38f9556d8813b3594a08558dbfefd526 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Sun, 19 Aug 2012 04:46:04 +0200 Subject: Core/Spells: Add totem models for goblin --- src/server/game/Entities/Unit/Unit.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 28e933cfa6c..baa69cbe0ee 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -16203,6 +16203,21 @@ uint32 Unit::GetModelForTotem(PlayerTotemType totemType) } break; } + case RACE_GOBLIN: + { + switch (totemType) + { + case SUMMON_TYPE_TOTEM_FIRE: // fire + return 30783; + case SUMMON_TYPE_TOTEM_EARTH: // earth + return 30782; + case SUMMON_TYPE_TOTEM_WATER: // water + return 30784; + case SUMMON_TYPE_TOTEM_AIR: // air + return 30781; + } + break; + } } return 0; } -- cgit v1.2.3 From 2986f3342c7d78a3ed7ec1b196a4cc12f1c8856d Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 19 Aug 2012 13:32:07 +0200 Subject: Core/Quests: Fixed copy paste mistake --- src/server/game/Quests/QuestDef.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h index c51ba3248a6..2b4ad24e78f 100755 --- a/src/server/game/Quests/QuestDef.h +++ b/src/server/game/Quests/QuestDef.h @@ -205,7 +205,7 @@ class Quest void SetFlag(uint32 flag) { Flags |= flag; } bool HasSpecialFlag(uint32 flag) const { return (SpecialFlags & flag) != 0; } - void SetSpecialFlag(uint32 flag) { Flags |= flag; } + void SetSpecialFlag(uint32 flag) { SpecialFlags |= flag; } // table data accessors: uint32 GetQuestId() const { return Id; } -- cgit v1.2.3 From 1b27565e10748f5987da23268731a310c337d8a4 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 19 Aug 2012 15:07:54 +0200 Subject: Core/Auras: Refreshing a damage over time spell with one tick remaining will now cause it to join the new aura (SPELL_ATTR8_DONT_RESET_PERIODIC_TIMER) --- src/server/game/Miscellaneous/SharedDefines.h | 2 +- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 5 +---- src/server/game/Spells/Auras/SpellAuraEffects.h | 2 +- src/server/game/Spells/Auras/SpellAuras.cpp | 19 ++++++++++++++++++- src/server/game/Spells/Spell.cpp | 2 -- 5 files changed, 21 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 4d5019c1076..c129310a91a 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -574,7 +574,7 @@ enum SpellAttr8 SPELL_ATTR8_UNK6 = 0x00000040, // 6 SPELL_ATTR8_UNK7 = 0x00000080, // 7 SPELL_ATTR8_UNK8 = 0x00000100, // 8 - SPELL_ATTR8_UNK9 = 0x00000200, // 9 Periodic auras with this flag keep old periodic timer when refreshing at close to one tick remaining (kind of anti DoT clipping) + SPELL_ATTR8_DONT_RESET_PERIODIC_TIMER = 0x00000200, // 9 Periodic auras with this flag keep old periodic timer when refreshing at close to one tick remaining (kind of anti DoT clipping) SPELL_ATTR8_UNK10 = 0x00000400, // 10 SPELL_ATTR8_UNK11 = 0x00000800, // 11 SPELL_ATTR8_AURA_SEND_AMOUNT = 0x00001000, // 12 Aura must have flag AFLAG_ANY_EFFECT_AMOUNT_SENT to send amount diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 027ab164ad8..d394d83adea 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -730,7 +730,7 @@ int32 AuraEffect::CalculateAmount(Unit* caster) return amount; } -void AuraEffect::CalculatePeriodic(Unit* caster, bool create, bool load) +void AuraEffect::CalculatePeriodic(Unit* caster, bool resetPeriodicTimer /*= true*/, bool load /*= false*/) { m_amplitude = m_spellInfo->Effects[m_effIndex].Amplitude; @@ -799,9 +799,6 @@ void AuraEffect::CalculatePeriodic(Unit* caster, bool create, bool load) // reset periodic timer on aura create or on reapply when aura isn't dot // possibly we should not reset periodic timers only when aura is triggered by proc // or maybe there's a spell attribute somewhere - bool resetPeriodicTimer = create - || ((GetAuraType() != SPELL_AURA_PERIODIC_DAMAGE) && (GetAuraType() != SPELL_AURA_PERIODIC_DAMAGE_PERCENT)); - if (resetPeriodicTimer) { m_periodicTimer = 0; diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.h b/src/server/game/Spells/Auras/SpellAuraEffects.h index f4aad8d16ca..6d29035b9e3 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.h +++ b/src/server/game/Spells/Auras/SpellAuraEffects.h @@ -59,7 +59,7 @@ class AuraEffect void SetPeriodicTimer(int32 periodicTimer) { m_periodicTimer = periodicTimer; } int32 CalculateAmount(Unit* caster); - void CalculatePeriodic(Unit* caster, bool create = false, bool load = false); + void CalculatePeriodic(Unit* caster, bool resetPeriodicTimer = true, bool load = false); void CalculateSpellMod(); void ChangeAmount(int32 newAmount, bool mark = true, bool onStackOrReapply = false); void RecalculateAmount() { if (!CanBeRecalculated()) return; ChangeAmount(CalculateAmount(GetCaster()), false); } diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index e8d1ddb8f03..406fc78a3ee 100755 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -756,11 +756,28 @@ void Aura::RefreshDuration() void Aura::RefreshTimers() { m_maxDuration = CalcMaxDuration(); + bool resetPeriodic = true; + if (m_spellInfo->AttributesEx8 & SPELL_ATTR8_DONT_RESET_PERIODIC_TIMER) + { + int32 minAmplitude = m_maxDuration; + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) + if (AuraEffect const* eff = GetEffect(i)) + if (int32 ampl = eff->GetAmplitude()) + minAmplitude = std::min(ampl, minAmplitude); + + // If only one tick remaining, roll it over into new duration + if (GetDuration() <= minAmplitude) + { + m_maxDuration += GetDuration(); + resetPeriodic = false; + } + } + RefreshDuration(); Unit* caster = GetCaster(); for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) if (HasEffect(i)) - GetEffect(i)->CalculatePeriodic(caster, false, false); + GetEffect(i)->CalculatePeriodic(caster, resetPeriodic, false); } void Aura::SetCharges(uint8 charges) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 697be0e48c9..448c9dd2176 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3926,8 +3926,6 @@ void Spell::SendSpellGo() if ((IsTriggered() && !m_spellInfo->IsAutoRepeatRangedSpell()) || m_triggeredByAuraSpell) castFlags |= CAST_FLAG_PENDING; - - if ((m_caster->GetTypeId() == TYPEID_PLAYER || (m_caster->GetTypeId() == TYPEID_UNIT && m_caster->ToCreature()->isPet())) && m_spellInfo->PowerType != POWER_HEALTH) -- cgit v1.2.3 From 3c2598d6cf3a6888e6cd1196f4398152c4ddec17 Mon Sep 17 00:00:00 2001 From: Tuxity Date: Sun, 19 Aug 2012 15:19:20 +0200 Subject: Core/Players: Dire Bear Form was removed in 4.0.1 --- src/server/game/Entities/Player/Player.cpp | 1 - src/server/game/Entities/Unit/Unit.cpp | 7 ++----- src/server/game/Entities/Unit/Unit.h | 4 ++-- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 11 ----------- 4 files changed, 4 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 482d2b484a3..b56a58e0744 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -20916,7 +20916,6 @@ void Player::InitDataForForm(bool reapplyMods) break; } case FORM_BEAR: - case FORM_DIREBEAR: { if (getPowerType() != POWER_RAGE) setPowerType(POWER_RAGE); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index baa69cbe0ee..950a73d50a5 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -7582,8 +7582,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg { case FORM_NONE: trigger_spell_id = 37344; break; case FORM_CAT: trigger_spell_id = 37341; break; - case FORM_BEAR: - case FORM_DIREBEAR: trigger_spell_id = 37340; break; + case FORM_BEAR: trigger_spell_id = 37340; break; case FORM_TREE: trigger_spell_id = 37342; break; case FORM_MOONKIN: trigger_spell_id = 37343; break; default: @@ -7597,8 +7596,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg switch (GetShapeshiftForm()) { case FORM_CAT: trigger_spell_id = 67355; break; - case FORM_BEAR: - case FORM_DIREBEAR: trigger_spell_id = 67354; break; + case FORM_BEAR: trigger_spell_id = 67354; break; default: return false; } @@ -16010,7 +16008,6 @@ uint32 Unit::GetModelForForm(ShapeshiftForm form) return 892; else return 8571; - case FORM_DIREBEAR: case FORM_BEAR: // Based on Hair color if (getRace() == RACE_NIGHTELF) diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 74212e0f309..9dcb981c95a 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -202,7 +202,7 @@ enum ShapeshiftForm FORM_BEAR = 0x05, FORM_AMBIENT = 0x06, FORM_GHOUL = 0x07, - FORM_DIREBEAR = 0x08, + FORM_DIREBEAR = 0x08, // Removed in 4.0.1 FORM_STEVES_GHOUL = 0x09, FORM_THARONJA_SKELETON = 0x0A, FORM_TEST_OF_STRENGTH = 0x0B, @@ -1890,7 +1890,7 @@ class Unit : public WorldObject inline bool IsInFeralForm() const { ShapeshiftForm form = GetShapeshiftForm(); - return form == FORM_CAT || form == FORM_BEAR || form == FORM_DIREBEAR; + return form == FORM_CAT || form == FORM_BEAR; } inline bool IsInDisallowedMountForm() const diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index d394d83adea..62472652423 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -1311,11 +1311,6 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const spellId2 = 21178; HotWSpellId = 24899; break; - case FORM_DIREBEAR: - spellId = 9635; - spellId2 = 21178; - HotWSpellId = 24899; - break; case FORM_BATTLESTANCE: spellId = 21156; break; @@ -1477,7 +1472,6 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const target->CastCustomSpell(target, 48420, &bp, NULL, NULL, true); } break; - case FORM_DIREBEAR: case FORM_BEAR: // Master Shapeshifter - Bear if (AuraEffect const* aurEff = target->GetDummyAuraEffect(SPELLFAMILY_GENERIC, 2851, 0)) @@ -1858,7 +1852,6 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mo break; case FORM_BEAR: // 0x05 - case FORM_DIREBEAR: // 0x08 case FORM_BATTLESTANCE: // 0x11 case FORM_DEFENSIVESTANCE: // 0x12 @@ -1908,7 +1901,6 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mo case FORM_TRAVEL: case FORM_AQUA: case FORM_BEAR: - case FORM_DIREBEAR: case FORM_FLIGHT_EPIC: case FORM_FLIGHT: case FORM_MOONKIN: @@ -1946,7 +1938,6 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mo { case FORM_CAT: case FORM_BEAR: - case FORM_DIREBEAR: { // get furor proc chance int32 FurorChance = 0; @@ -1963,7 +1954,6 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mo } break; case FORM_BEAR: - case FORM_DIREBEAR: if (irand(0, 99) < FurorChance) target->CastSpell(target, 17057, true); default: @@ -2007,7 +1997,6 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mo { // Nordrassil Harness - bonus case FORM_BEAR: - case FORM_DIREBEAR: case FORM_CAT: if (AuraEffect* dummy = target->GetAuraEffect(37315, 0)) target->CastSpell(target, 37316, true, NULL, dummy); -- cgit v1.2.3 From 1f22bafe6ec865546272c19e2c24759a55ef87ee Mon Sep 17 00:00:00 2001 From: Tuxity Date: Sun, 19 Aug 2012 15:21:42 +0200 Subject: Core/Players: Add new druid forms for trolls and worgens. --- src/server/game/Entities/Unit/Unit.cpp | 203 +++++++++++++++++++++++++++------ 1 file changed, 171 insertions(+), 32 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index baa69cbe0ee..35f86417fb1 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -15953,6 +15953,72 @@ uint32 Unit::GetModelForForm(ShapeshiftForm form) return 892; } } + else if (getRace() == RACE_TROLL) + { + uint8 hairColor = GetByteValue(PLAYER_BYTES, 3); + switch (hairColor) + { + case 0: // Red + case 1: + return 33668; + case 2: // Yellow + case 3: + return 33667; + case 4: // Blue + case 5: + case 6: + return 33666; + case 7: // Purple + case 10: + return 33665; + default: // original - white + return 33669; + } + } + else if (getRace() == RACE_WORGEN) + { + // Based on Skin color + uint8 skinColor = GetByteValue(PLAYER_BYTES, 0); + // Male + if (getGender() == GENDER_MALE) + { + switch (skinColor) + { + case 1: // Brown + return 33662; + case 2: // Black + case 7: + return 33661; + case 4: // yellow + return 33664; + case 3: // White + case 5: + return 33663; + default: // original - Gray + return 33660; + } + } + // Female + else + { + switch (skinColor) + { + case 5: // Brown + case 6: + return 33662; + case 7: // Black + case 8: + return 33661; + case 3: // yellow + case 4: + return 33664; + case 2: // White + return 33663; + default: // original - Gray + return 33660; + } + } + } // Based on Skin color else if (getRace() == RACE_TAUREN) { @@ -15987,23 +16053,26 @@ uint32 Unit::GetModelForForm(ShapeshiftForm form) } } // Female - else switch (skinColor) + else { - case 10: // White - return 29409; - case 6: // Light Brown - case 7: - return 29410; - case 4: // Brown - case 5: - return 29411; - case 0: // Dark - case 1: - case 2: - case 3: - return 29412; - default: // original - Grey - return 8571; + switch (skinColor) + { + case 10: // White + return 29409; + case 6: // Light Brown + case 7: + return 29410; + case 4: // Brown + case 5: + return 29411; + case 0: // Dark + case 1: + case 2: + case 3: + return 29412; + default: // original - Grey + return 8571; + } } } else if (Player::TeamForRace(getRace()) == ALLIANCE) @@ -16032,6 +16101,73 @@ uint32 Unit::GetModelForForm(ShapeshiftForm form) return 2281; } } + else if (getRace() == RACE_TROLL) + { + uint8 hairColor = GetByteValue(PLAYER_BYTES, 3); + switch (hairColor) + { + case 0: // Red + case 1: + return 33657; + case 2: // Yellow + case 3: + return 33659; + case 7: // Purple + case 10: + return 33656; + case 8: // White + case 9: + case 11: + case 12: + return 33658; + default: // original - Blue + return 33655; + } + } + else if (getRace() == RACE_WORGEN) + { + // Based on Skin color + uint8 skinColor = GetByteValue(PLAYER_BYTES, 0); + // Male + if (getGender() == GENDER_MALE) + { + switch (skinColor) + { + case 1: // Brown + return 33652; + case 2: // Black + case 7: + return 33651; + case 4: // Yellow + return 33653; + case 3: // White + case 5: + return 33654; + default: // original - Gray + return 33650; + } + } + // Female + else + { + switch (skinColor) + { + case 5: // Brown + case 6: + return 33652; + case 7: // Black + case 8: + return 33651; + case 3: // yellow + case 4: + return 33654; + case 2: // White + return 33653; + default: // original - Gray + return 33650; + } + } + } // Based on Skin color else if (getRace() == RACE_TAUREN) { @@ -16066,23 +16202,26 @@ uint32 Unit::GetModelForForm(ShapeshiftForm form) } } // Female - else switch (skinColor) + else { - case 0: // Dark (Black) - case 1: - return 29418; - case 2: // White - case 3: - return 29419; - case 6: // Light Brown/Grey - case 7: - case 8: - case 9: - return 29420; - case 10: // Completly White - return 29421; - default: // original - Brown - return 2289; + switch (skinColor) + { + case 0: // Dark (Black) + case 1: + return 29418; + case 2: // White + case 3: + return 29419; + case 6: // Light Brown/Grey + case 7: + case 8: + case 9: + return 29420; + case 10: // Completly White + return 29421; + default: // original - Brown + return 2289; + } } } else if (Player::TeamForRace(getRace()) == ALLIANCE) -- cgit v1.2.3 From 69cfc0f7bfc927f209d326534e9ad35291f67ff0 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 19 Aug 2012 15:42:05 +0200 Subject: Core/Players: Fixed setting rune regen fields, thanks Lordron for noticing --- src/server/game/Entities/Player/Player.cpp | 13 +++++-------- src/server/game/Entities/Player/Player.h | 3 ++- src/server/game/Entities/Unit/StatSystem.cpp | 14 +++----------- 3 files changed, 10 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index b56a58e0744..1e85afd47b1 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -23805,18 +23805,15 @@ void Player::UpdateCharmedAI() } } -uint32 Player::GetRuneBaseCooldown(uint8 index) +uint32 Player::GetRuneTypeBaseCooldown(RuneType runeType) const { - uint8 rune = GetBaseRune(index); - uint32 cooldown = RUNE_BASE_COOLDOWN; + float cooldown = RUNE_BASE_COOLDOWN; float hastePct = 0.0f; AuraEffectList const& regenAura = GetAuraEffectsByType(SPELL_AURA_MOD_POWER_REGEN_PERCENT); for (AuraEffectList::const_iterator i = regenAura.begin();i != regenAura.end(); ++i) - { - if ((*i)->GetMiscValue() == POWER_RUNES && (*i)->GetMiscValueB() == rune) - cooldown = cooldown*(100-(*i)->GetAmount())/100; - } + if ((*i)->GetMiscValue() == POWER_RUNES && (*i)->GetMiscValueB() == runeType) + cooldown *= 1.0f - (*i)->GetAmount() / 100.0f; // Runes cooldown are now affected by player's haste from equipment ... hastePct = GetRatingBonusValue(CR_HASTE_MELEE); @@ -23920,7 +23917,7 @@ void Player::InitRunes() m_runes->SetRuneState(i); } - for (uint8 i = 0; i < MAX_RUNES; ++i) + for (uint8 i = 0; i < NUM_RUNE_TYPES; ++i) SetFloatValue(PLAYER_RUNE_REGEN_1 + i, 0.1f); // set a base regen timer equal to 10 sec } diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index a57c1fe908c..d4da03d3b53 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -2508,7 +2508,8 @@ class Player : public Unit, public GridObject RuneType GetBaseRune(uint8 index) const { return RuneType(m_runes->runes[index].BaseRune); } RuneType GetCurrentRune(uint8 index) const { return RuneType(m_runes->runes[index].CurrentRune); } uint32 GetRuneCooldown(uint8 index) const { return m_runes->runes[index].Cooldown; } - uint32 GetRuneBaseCooldown(uint8 index); + uint32 GetRuneBaseCooldown(uint8 index) const { return GetRuneTypeBaseCooldown(GetBaseRune(index)); } + uint32 GetRuneTypeBaseCooldown(RuneType runeType) const; bool IsBaseRuneSlotsOnCooldown(RuneType runeType) const; RuneType GetLastUsedRune() { return m_runes->lastUsedRune; } void SetLastUsedRune(RuneType type) { m_runes->lastUsedRune = type; } diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index 1f221b14713..f5b313987e3 100755 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -730,17 +730,9 @@ void Player::UpdateRuneRegen(RuneType rune) void Player::UpdateAllRunesRegen() { - uint32 cooldown = 0; - - for (uint8 i = 0; i < MAX_RUNES; ++i) - { - cooldown = GetRuneBaseCooldown(i); - if (cooldown) - { - float regen = float(1 * IN_MILLISECONDS) / float(cooldown); - SetFloatValue(PLAYER_RUNE_REGEN_1 + i, regen); - } - } + for (uint8 i = 0; i < NUM_RUNE_TYPES; ++i) + if (uint32 cooldown = GetRuneTypeBaseCooldown(RuneType(i))) + SetFloatValue(PLAYER_RUNE_REGEN_1 + i, float(1 * IN_MILLISECONDS) / float(cooldown)); } void Player::_ApplyAllStatBonuses() -- cgit v1.2.3 From 23560b13acf12365ebd0acf5e835dab42958ed12 Mon Sep 17 00:00:00 2001 From: Tuxity Date: Sun, 19 Aug 2012 16:45:37 +0200 Subject: Core/Battlegrounds: Implement basic structure and code for Battle for Gilneas and Twin Peaks. --- src/server/game/Battlegrounds/Battleground.h | 10 +++--- src/server/game/Battlegrounds/BattlegroundMgr.cpp | 40 ++++++++++++++++++++++ .../game/Battlegrounds/Zones/BattlegroundBFG.cpp | 36 +++++++++++++++++++ .../game/Battlegrounds/Zones/BattlegroundBFG.h | 40 ++++++++++++++++++++++ .../game/Battlegrounds/Zones/BattlegroundTP.cpp | 36 +++++++++++++++++++ .../game/Battlegrounds/Zones/BattlegroundTP.h | 40 ++++++++++++++++++++++ 6 files changed, 198 insertions(+), 4 deletions(-) create mode 100644 src/server/game/Battlegrounds/Zones/BattlegroundBFG.cpp create mode 100644 src/server/game/Battlegrounds/Zones/BattlegroundBFG.h create mode 100644 src/server/game/Battlegrounds/Zones/BattlegroundTP.cpp create mode 100644 src/server/game/Battlegrounds/Zones/BattlegroundTP.h (limited to 'src') diff --git a/src/server/game/Battlegrounds/Battleground.h b/src/server/game/Battlegrounds/Battleground.h index 01dfbb23033..234cda4105c 100755 --- a/src/server/game/Battlegrounds/Battleground.h +++ b/src/server/game/Battlegrounds/Battleground.h @@ -177,10 +177,12 @@ enum BattlegroundQueueTypeId BATTLEGROUND_QUEUE_EY = 4, BATTLEGROUND_QUEUE_SA = 5, BATTLEGROUND_QUEUE_IC = 6, - BATTLEGROUND_QUEUE_RB = 7, - BATTLEGROUND_QUEUE_2v2 = 8, - BATTLEGROUND_QUEUE_3v3 = 9, - BATTLEGROUND_QUEUE_5v5 = 10, + BATTLEGROUND_QUEUE_TP = 7, + BATTLEGROUND_QUEUE_BFG = 8, + BATTLEGROUND_QUEUE_RB = 9, + BATTLEGROUND_QUEUE_2v2 = 10, + BATTLEGROUND_QUEUE_3v3 = 11, + BATTLEGROUND_QUEUE_5v5 = 12, MAX_BATTLEGROUND_QUEUE_TYPES }; diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index 626ed04566b..86b06de2cec 100755 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -37,6 +37,8 @@ #include "BattlegroundRV.h" #include "BattlegroundIC.h" #include "BattlegroundRB.h" +#include "BattlegroundTP.h" +#include "BattlegroundBFG.h" #include "Chat.h" #include "Map.h" #include "MapInstanced.h" @@ -339,6 +341,16 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg) *data << uint32(0x00000002); // count of next fields *data << uint32(((BattlegroundICScore*)itr2->second)->BasesAssaulted); // bases asssulted *data << uint32(((BattlegroundICScore*)itr2->second)->BasesDefended); // bases defended + case 726: + *data << uint32(0x00000002); // count of next fields + *data << uint32(((BattlegroundTPScore*)itr2->second)->FlagCaptures); // flag captures + *data << uint32(((BattlegroundTPScore*)itr2->second)->FlagReturns); // flag returns + break; + case 761: + *data << uint32(0x00000002); // count of next fields + *data << uint32(((BattlegroundBFGScore*)itr2->second)->BasesAssaulted); // bases asssulted + *data << uint32(((BattlegroundBFGScore*)itr2->second)->BasesDefended); // bases defended + break; default: *data << uint32(0); break; @@ -375,6 +387,14 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg) *data << uint32(((BattlegroundICScore*)itr2->second)->BasesAssaulted); // bases asssulted *data << uint32(((BattlegroundICScore*)itr2->second)->BasesDefended); // bases defended break; + case BATTLEGROUND_TP: + *data << uint32(0x00000002); // count of next fields + *data << uint32(((BattlegroundTPScore*)itr2->second)->FlagCaptures); // flag captures + *data << uint32(((BattlegroundTPScore*)itr2->second)->FlagReturns); // flag returns + case BATTLEGROUND_BFG: + *data << uint32(0x00000002); // count of next fields + *data << uint32(((BattlegroundBFGScore*)itr2->second)->BasesAssaulted); // bases asssulted + *data << uint32(((BattlegroundBFGScore*)itr2->second)->BasesDefended); // bases defended case BATTLEGROUND_NA: case BATTLEGROUND_BE: case BATTLEGROUND_AA: @@ -595,6 +615,12 @@ Battleground* BattlegroundMgr::CreateNewBattleground(BattlegroundTypeId bgTypeId case BATTLEGROUND_IC: bg = new BattlegroundIC(*(BattlegroundIC*)bg_template); break; + case BATTLEGROUND_TP: + bg = new BattlegroundTP(*(BattlegroundTP*)bg_template); + break; + case BATTLEGROUND_BFG: + bg = new BattlegroundBFG(*(BattlegroundBFG*)bg_template); + break; case BATTLEGROUND_RB: bg = new BattlegroundRB(*(BattlegroundRB*)bg_template); break; @@ -643,6 +669,8 @@ uint32 BattlegroundMgr::CreateBattleground(CreateBattlegroundData& data) case BATTLEGROUND_DS: bg = new BattlegroundDS; break; case BATTLEGROUND_RV: bg = new BattlegroundRV; break; case BATTLEGROUND_IC: bg = new BattlegroundIC; break; + case BATTLEGROUND_TP: bg = new BattlegroundTP; break; + case BATTLEGROUND_BFG: bg = new BattlegroundBFG; break; case BATTLEGROUND_RB: bg = new BattlegroundRB; break; default: bg = new Battleground; @@ -934,6 +962,10 @@ BattlegroundQueueTypeId BattlegroundMgr::BGQueueTypeId(BattlegroundTypeId bgType return BATTLEGROUND_QUEUE_SA; case BATTLEGROUND_IC: return BATTLEGROUND_QUEUE_IC; + case BATTLEGROUND_TP: + return BATTLEGROUND_QUEUE_TP; + case BATTLEGROUND_BFG: + return BATTLEGROUND_QUEUE_BFG; case BATTLEGROUND_RB: return BATTLEGROUND_QUEUE_RB; case BATTLEGROUND_AA: @@ -974,6 +1006,10 @@ BattlegroundTypeId BattlegroundMgr::BGTemplateId(BattlegroundQueueTypeId bgQueue return BATTLEGROUND_SA; case BATTLEGROUND_QUEUE_IC: return BATTLEGROUND_IC; + case BATTLEGROUND_QUEUE_TP: + return BATTLEGROUND_TP; + case BATTLEGROUND_QUEUE_BFG: + return BATTLEGROUND_BFG; case BATTLEGROUND_QUEUE_RB: return BATTLEGROUND_RB; case BATTLEGROUND_QUEUE_2v2: @@ -1113,6 +1149,8 @@ HolidayIds BattlegroundMgr::BGTypeToWeekendHolidayId(BattlegroundTypeId bgTypeId case BATTLEGROUND_SA: return HOLIDAY_CALL_TO_ARMS_SA; case BATTLEGROUND_AB: return HOLIDAY_CALL_TO_ARMS_AB; case BATTLEGROUND_IC: return HOLIDAY_CALL_TO_ARMS_IC; + case BATTLEGROUND_TP: return HOLIDAY_CALL_TO_ARMS_TP; + case BATTLEGROUND_BFG: return HOLIDAY_CALL_TO_ARMS_BFG; default: return HOLIDAY_NONE; } } @@ -1127,6 +1165,8 @@ BattlegroundTypeId BattlegroundMgr::WeekendHolidayIdToBGType(HolidayIds holiday) case HOLIDAY_CALL_TO_ARMS_SA: return BATTLEGROUND_SA; case HOLIDAY_CALL_TO_ARMS_AB: return BATTLEGROUND_AB; case HOLIDAY_CALL_TO_ARMS_IC: return BATTLEGROUND_IC; + case HOLIDAY_CALL_TO_ARMS_TP: return BATTLEGROUND_TP; + case HOLIDAY_CALL_TO_ARMS_BFG: return BATTLEGROUND_BFG; default: return BATTLEGROUND_TYPE_NONE; } } diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundBFG.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundBFG.cpp new file mode 100644 index 00000000000..52af3e23e11 --- /dev/null +++ b/src/server/game/Battlegrounds/Zones/BattlegroundBFG.cpp @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2008-2012 TrinityCore + * + * 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; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; 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, see . + */ + +#include "Battleground.h" +#include "BattlegroundBFG.h" +#include "Creature.h" +#include "GameObject.h" +#include "Language.h" +#include "Object.h" +#include "ObjectMgr.h" +#include "BattlegroundMgr.h" +#include "Player.h" +#include "World.h" +#include "WorldPacket.h" + +BattlegroundBFG::BattlegroundBFG() +{ +} + +BattlegroundBFG::~BattlegroundBFG() +{ +} diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundBFG.h b/src/server/game/Battlegrounds/Zones/BattlegroundBFG.h new file mode 100644 index 00000000000..35c9bef8b17 --- /dev/null +++ b/src/server/game/Battlegrounds/Zones/BattlegroundBFG.h @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2008-2012 TrinityCore + * + * 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; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; 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, see . + */ + +#ifndef __BATTLEGROUNDBFG_H +#define __BATTLEGROUNDBFG_H + +#include "Battleground.h" + +class BattlegroundBFGScore : public BattlegroundScore +{ + public: + BattlegroundBFGScore(): BasesAssaulted(0), BasesDefended(0) {}; + virtual ~BattlegroundBFGScore() {}; + + uint32 BasesAssaulted; + uint32 BasesDefended; +}; + +class BattlegroundBFG : public Battleground +{ + public: + BattlegroundBFG(); + ~BattlegroundBFG(); +}; + +#endif diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundTP.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundTP.cpp new file mode 100644 index 00000000000..5a19dff589f --- /dev/null +++ b/src/server/game/Battlegrounds/Zones/BattlegroundTP.cpp @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2008-2012 TrinityCore + * + * 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; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; 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, see . + */ + +#include "Battleground.h" +#include "BattlegroundTP.h" +#include "Creature.h" +#include "GameObject.h" +#include "Language.h" +#include "Object.h" +#include "ObjectMgr.h" +#include "BattlegroundMgr.h" +#include "Player.h" +#include "World.h" +#include "WorldPacket.h" + +BattlegroundTP::BattlegroundTP() +{ +} + +BattlegroundTP::~BattlegroundTP() +{ +} diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundTP.h b/src/server/game/Battlegrounds/Zones/BattlegroundTP.h new file mode 100644 index 00000000000..45be413e5cf --- /dev/null +++ b/src/server/game/Battlegrounds/Zones/BattlegroundTP.h @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2008-2012 TrinityCore + * + * 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; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; 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, see . + */ + +#ifndef __BATTLEGROUNDTP_H +#define __BATTLEGROUNDTP_H + +#include "Battleground.h" + +class BattlegroundTPScore : public BattlegroundScore +{ + public: + BattlegroundTPScore() : FlagCaptures(0), FlagReturns(0) {}; + virtual ~BattlegroundTPScore() {}; + + uint32 FlagCaptures; + uint32 FlagReturns; +}; + +class BattlegroundTP : public Battleground +{ + public: + BattlegroundTP(); + ~BattlegroundTP(); +}; + +#endif -- cgit v1.2.3 From 6cea446f22f5e1c52ffde23912019f8d88830a59 Mon Sep 17 00:00:00 2001 From: teyrnon Date: Mon, 20 Aug 2012 10:44:14 +0200 Subject: Core/Objects: Encapsulated Postion::m_orientation field to ensure it is always normalized to 0-2pi range Closes #7400. --- src/server/game/Entities/Creature/Creature.cpp | 2 -- src/server/game/Entities/GameObject/GameObject.cpp | 1 - src/server/game/Entities/Object/Object.cpp | 16 ++++++------- src/server/game/Entities/Object/Object.h | 26 ++++++++++++++++++---- src/server/game/Entities/Player/Player.cpp | 10 +++------ src/server/game/Entities/Transport/Transport.cpp | 6 ++--- src/server/game/Entities/Unit/Unit.cpp | 3 +-- src/server/game/Entities/Vehicle/Vehicle.cpp | 4 ++-- src/server/game/Handlers/MovementHandler.cpp | 8 +++---- src/server/game/Maps/MapManager.h | 15 ------------- src/server/game/Spells/SpellEffects.cpp | 2 +- .../IcecrownCitadel/boss_lord_marrowgar.cpp | 1 - .../scripts/Northrend/Nexus/Oculus/boss_varos.cpp | 2 +- .../Northrend/Ulduar/Ulduar/boss_kologarn.cpp | 2 +- 14 files changed, 46 insertions(+), 52 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 642c7e45a74..6e2fc197a5f 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -249,7 +249,6 @@ void Creature::RemoveCorpse(bool setSpawnTime) float x, y, z, o; GetRespawnPosition(x, y, z, &o); - o = MapManager::NormalizeOrientation(o); SetHomePosition(x, y, z, o); GetMap()->CreatureRelocation(this, x, y, z, o); } @@ -2465,7 +2464,6 @@ void Creature::SetPosition(float x, float y, float z, float o) return; } - o = MapManager::NormalizeOrientation(o); GetMap()->CreatureRelocation(ToCreature(), x, y, z, o); if (IsVehicle()) GetVehicleKit()->RelocatePassengers(x, y, z, o); diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 2e9780fb87e..d11795b1ae8 100755 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -166,7 +166,6 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map* map, uint32 phaseMa ASSERT(map); SetMap(map); - ang = MapManager::NormalizeOrientation(ang); Relocate(x, y, z, ang); if (!IsPositionValid()) { diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 153dad8e447..edbc40767f9 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -1664,7 +1664,7 @@ void Position::RelocateOffset(const Position & offset) m_positionX = GetPositionX() + (offset.GetPositionX() * cos(GetOrientation()) + offset.GetPositionY() * sin(GetOrientation() + M_PI)); m_positionY = GetPositionY() + (offset.GetPositionY() * cos(GetOrientation()) + offset.GetPositionX() * sin(GetOrientation())); m_positionZ = GetPositionZ() + offset.GetPositionZ(); - m_orientation = GetOrientation() + offset.GetOrientation(); + SetOrientation(GetOrientation() + offset.GetOrientation()); } void Position::GetPositionOffsetTo(const Position & endPos, Position & retOffset) const @@ -1675,7 +1675,7 @@ void Position::GetPositionOffsetTo(const Position & endPos, Position & retOffset retOffset.m_positionX = dx * cos(GetOrientation()) + dy * sin(GetOrientation()); retOffset.m_positionY = dy * cos(GetOrientation()) - dx * sin(GetOrientation()); retOffset.m_positionZ = endPos.GetPositionZ() - GetPositionZ(); - retOffset.m_orientation = endPos.GetOrientation() - GetOrientation(); + retOffset.SetOrientation(endPos.GetOrientation() - GetOrientation()); } float Position::GetAngle(const Position* obj) const @@ -1723,13 +1723,13 @@ bool Position::HasInArc(float arc, const Position* obj) const return true; // move arc to range 0.. 2*pi - arc = MapManager::NormalizeOrientation(arc); + arc = NormalizeOrientation(arc); float angle = GetAngle(obj); angle -= m_orientation; // move angle to range -pi ... +pi - angle = MapManager::NormalizeOrientation(angle); + angle = NormalizeOrientation(angle); if (angle > M_PI) angle -= 2.0f*M_PI; @@ -2916,7 +2916,7 @@ void WorldObject::GetNearPoint(WorldObject const* /*searcher*/, float &x, float void WorldObject::MovePosition(Position &pos, float dist, float angle) { - angle += m_orientation; + angle += GetOrientation(); float destx, desty, destz, ground, floor; destx = pos.m_positionX + dist * cos(angle); desty = pos.m_positionY + dist * sin(angle); @@ -2956,12 +2956,12 @@ void WorldObject::MovePosition(Position &pos, float dist, float angle) Trinity::NormalizeMapCoord(pos.m_positionX); Trinity::NormalizeMapCoord(pos.m_positionY); UpdateGroundPositionZ(pos.m_positionX, pos.m_positionY, pos.m_positionZ); - pos.m_orientation = m_orientation; + pos.SetOrientation(GetOrientation()); } void WorldObject::MovePositionToFirstCollision(Position &pos, float dist, float angle) { - angle += m_orientation; + angle += GetOrientation(); float destx, desty, destz, ground, floor; pos.m_positionZ += 2.0f; destx = pos.m_positionX + dist * cos(angle); @@ -3024,7 +3024,7 @@ void WorldObject::MovePositionToFirstCollision(Position &pos, float dist, float Trinity::NormalizeMapCoord(pos.m_positionX); Trinity::NormalizeMapCoord(pos.m_positionY); UpdateAllowedPositionZ(pos.m_positionX, pos.m_positionY, pos.m_positionZ); - pos.m_orientation = m_orientation; + pos.SetOrientation(GetOrientation()); } void WorldObject::SetPhaseMask(uint32 newPhaseMask, bool update) diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index 3829e2f75f2..e3d940360f2 100755 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -444,21 +444,24 @@ struct Position float m_positionX; float m_positionY; float m_positionZ; +// Better to limit access to m_orientation field, but this will be hard to achieve with many scripts using array initialization for this structure +//private: float m_orientation; +//public: void Relocate(float x, float y) { m_positionX = x; m_positionY = y;} void Relocate(float x, float y, float z) { m_positionX = x; m_positionY = y; m_positionZ = z; } void Relocate(float x, float y, float z, float orientation) - { m_positionX = x; m_positionY = y; m_positionZ = z; m_orientation = orientation; } + { m_positionX = x; m_positionY = y; m_positionZ = z; SetOrientation(orientation); } void Relocate(const Position &pos) - { m_positionX = pos.m_positionX; m_positionY = pos.m_positionY; m_positionZ = pos.m_positionZ; m_orientation = pos.m_orientation; } + { m_positionX = pos.m_positionX; m_positionY = pos.m_positionY; m_positionZ = pos.m_positionZ; SetOrientation(pos.m_orientation); } void Relocate(const Position* pos) - { m_positionX = pos->m_positionX; m_positionY = pos->m_positionY; m_positionZ = pos->m_positionZ; m_orientation = pos->m_orientation; } + { m_positionX = pos->m_positionX; m_positionY = pos->m_positionY; m_positionZ = pos->m_positionZ; SetOrientation(pos->m_orientation); } void RelocateOffset(const Position &offset); void SetOrientation(float orientation) - { m_orientation = orientation; } + { m_orientation = NormalizeOrientation(orientation); } float GetPositionX() const { return m_positionX; } float GetPositionY() const { return m_positionY; } @@ -525,6 +528,21 @@ struct Position bool HasInArc(float arcangle, const Position* pos) const; bool HasInLine(WorldObject const* target, float width) const; std::string ToString() const; + + // modulos a radian orientation to the range of 0..2PI + static float NormalizeOrientation(float o) + { + // fmod only supports positive numbers. Thus we have + // to emulate negative numbers + if (o < 0) + { + float mod = o *-1; + mod = fmod(mod, 2.0f * static_cast(M_PI)); + mod = -mod + 2.0f * static_cast(M_PI); + return mod; + } + return fmod(o, 2.0f * static_cast(M_PI)); + } }; ByteBuffer& operator>>(ByteBuffer& buf, Position::PositionXYZOStreamer const& streamer); ByteBuffer& operator<<(ByteBuffer& buf, Position::PositionXYZStreamer const& streamer); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 1e85afd47b1..1c164fffe3c 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -2106,8 +2106,6 @@ void Player::SendTeleportPacket(Position &oldPos) bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientation, uint32 options) { - orientation = MapManager::NormalizeOrientation(orientation); - if (!MapManager::IsValidMapCoord(mapid, x, y, z, orientation)) { sLog->outError(LOG_FILTER_MAPS, "TeleportTo: invalid map (%d) or invalid coordinates (X: %f, Y: %f, Z: %f, O: %f) given when teleporting player (GUID: %u, name: %s, map: %d, X: %f, Y: %f, Z: %f, O: %f).", @@ -16683,9 +16681,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) // init saved position, and fix it later if problematic uint32 transGUID = uint32(fields[31].GetUInt32()); - // used orientation 0-2pi range. Check for safe. - float orientation = MapManager::NormalizeOrientation(fields[16].GetFloat()); - Relocate(fields[12].GetFloat(), fields[13].GetFloat(), fields[14].GetFloat(), orientation); + Relocate(fields[12].GetFloat(), fields[13].GetFloat(), fields[14].GetFloat(), fields[16].GetFloat()); uint32 mapId = fields[15].GetUInt16(); uint32 instanceId = fields[54].GetUInt32(); @@ -16793,13 +16789,13 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) if (!Trinity::IsValidMapCoord( GetPositionX()+m_movementInfo.t_pos.m_positionX, GetPositionY()+m_movementInfo.t_pos.m_positionY, - GetPositionZ()+m_movementInfo.t_pos.m_positionZ, GetOrientation()+m_movementInfo.t_pos.m_orientation) || + GetPositionZ()+m_movementInfo.t_pos.m_positionZ, GetOrientation()+m_movementInfo.t_pos.GetOrientation()) || // transport size limited m_movementInfo.t_pos.m_positionX > 250 || m_movementInfo.t_pos.m_positionY > 250 || m_movementInfo.t_pos.m_positionZ > 250) { sLog->outError(LOG_FILTER_PLAYER, "Player (guidlow %d) have invalid transport coordinates (X: %f Y: %f Z: %f O: %f). Teleport to bind location.", guid, GetPositionX()+m_movementInfo.t_pos.m_positionX, GetPositionY()+m_movementInfo.t_pos.m_positionY, - GetPositionZ()+m_movementInfo.t_pos.m_positionZ, GetOrientation()+m_movementInfo.t_pos.m_orientation); + GetPositionZ()+m_movementInfo.t_pos.m_positionZ, GetOrientation()+m_movementInfo.t_pos.GetOrientation()); RelocateToHomebind(); } diff --git a/src/server/game/Entities/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp index 528784c018f..d5163d04297 100755 --- a/src/server/game/Entities/Transport/Transport.cpp +++ b/src/server/game/Entities/Transport/Transport.cpp @@ -678,7 +678,7 @@ uint32 Transport::AddNPCPassenger(uint32 tguid, uint32 entry, float x, float y, void Transport::UpdatePosition(MovementInfo* mi) { - float transport_o = mi->pos.m_orientation - mi->t_pos.m_orientation; + float transport_o = mi->pos.GetOrientation() - mi->t_pos.GetOrientation(); float transport_x = mi->pos.m_positionX - (mi->t_pos.m_positionX * cos(transport_o) - mi->t_pos.m_positionY*sin(transport_o)); float transport_y = mi->pos.m_positionY - (mi->t_pos.m_positionY * cos(transport_o) + mi->t_pos.m_positionX*sin(transport_o)); float transport_z = mi->pos.m_positionZ - mi->t_pos.m_positionZ; @@ -707,7 +707,7 @@ void Transport::UpdateNPCPositions() void Transport::CalculatePassengerPosition(float& x, float& y, float& z, float& o) { float inx = x, iny = y, inz = z, ino = o; - o = MapManager::NormalizeOrientation(GetOrientation() + ino); + o = GetOrientation() + ino; x = GetPositionX() + (inx * cos(GetOrientation()) + iny * sin(GetOrientation() + M_PI)); y = GetPositionY() + (iny * cos(GetOrientation()) + inx * sin(GetOrientation())); z = GetPositionZ() + inz; @@ -716,7 +716,7 @@ void Transport::CalculatePassengerPosition(float& x, float& y, float& z, float& //! This method transforms supplied global coordinates into local offsets void Transport::CalculatePassengerOffset(float& x, float& y, float& z, float& o) { - o = MapManager::NormalizeOrientation(o - GetOrientation()); + o = o - GetOrientation(); z -= GetPositionZ(); y -= GetPositionY(); // y = searchedY * cos(o) + searchedX * sin(o) x -= GetPositionX(); // x = searchedX * cos(o) + searchedY * sin(o + pi) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 2319438c14a..727262d2e17 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -407,7 +407,7 @@ void Unit::UpdateSplinePosition() pos.m_positionX = loc.x; pos.m_positionY = loc.y; pos.m_positionZ = loc.z; - pos.m_orientation = loc.orientation; + pos.SetOrientation(loc.orientation); if (Unit* vehicle = GetVehicleBase()) { loc.x += vehicle->GetPositionX(); @@ -16722,7 +16722,6 @@ bool Unit::UpdatePosition(float x, float y, float z, float orientation, bool tel return false; } - orientation = MapManager::NormalizeOrientation(orientation); bool turn = (GetOrientation() != orientation); bool relocated = (teleport || GetPositionX() != x || GetPositionY() != y || GetPositionZ() != z); diff --git a/src/server/game/Entities/Vehicle/Vehicle.cpp b/src/server/game/Entities/Vehicle/Vehicle.cpp index 3d36f6ccda5..50370ba48de 100755 --- a/src/server/game/Entities/Vehicle/Vehicle.cpp +++ b/src/server/game/Entities/Vehicle/Vehicle.cpp @@ -346,7 +346,7 @@ bool Vehicle::AddPassenger(Unit* unit, int8 seatId) unit->m_movementInfo.t_pos.m_positionX = veSeat->m_attachmentOffsetX; unit->m_movementInfo.t_pos.m_positionY = veSeat->m_attachmentOffsetY; unit->m_movementInfo.t_pos.m_positionZ = veSeat->m_attachmentOffsetZ; - unit->m_movementInfo.t_pos.m_orientation = 0; + unit->m_movementInfo.t_pos.SetOrientation(0); unit->m_movementInfo.t_time = 0; // 1 for player unit->m_movementInfo.t_seat = seat->first; unit->m_movementInfo.t_guid = _me->GetGUID(); @@ -448,7 +448,7 @@ void Vehicle::RelocatePassengers(float x, float y, float z, float ang) float px = x + passenger->m_movementInfo.t_pos.m_positionX; float py = y + passenger->m_movementInfo.t_pos.m_positionY; float pz = z + passenger->m_movementInfo.t_pos.m_positionZ; - float po = ang + passenger->m_movementInfo.t_pos.m_orientation; + float po = ang + passenger->m_movementInfo.t_pos.GetOrientation(); passenger->UpdatePosition(px, py, pz, po); } diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp index dbdc4ac04fe..193135c5067 100644 --- a/src/server/game/Handlers/MovementHandler.cpp +++ b/src/server/game/Handlers/MovementHandler.cpp @@ -748,7 +748,7 @@ void WorldSession::ReadMovementInfo(WorldPacket& data, MovementInfo* mi) break; case MSEOrientation: if (hasOrientation) - data >> mi->pos.m_orientation; + mi->pos.SetOrientation(data.read()); break; case MSETransportPositionX: if (hasTransportData) @@ -764,7 +764,7 @@ void WorldSession::ReadMovementInfo(WorldPacket& data, MovementInfo* mi) break; case MSETransportOrientation: if (hasTransportData) - data >> mi->t_pos.m_orientation; + mi->pos.SetOrientation(data.read()); break; case MSETransportSeat: if (hasTransportData) @@ -1023,7 +1023,7 @@ void WorldSession::WriteMovementInfo(WorldPacket &data, MovementInfo* mi) break; case MSEOrientation: if (hasOrientation) - data << mi->pos.m_orientation; + data << mi->pos.GetOrientation(); break; case MSETransportPositionX: if (hasTransportData) @@ -1039,7 +1039,7 @@ void WorldSession::WriteMovementInfo(WorldPacket &data, MovementInfo* mi) break; case MSETransportOrientation: if (hasTransportData) - data << mi->t_pos.m_orientation; + data << mi->t_pos.GetOrientation(); break; case MSETransportSeat: if (hasTransportData) diff --git a/src/server/game/Maps/MapManager.h b/src/server/game/Maps/MapManager.h index aa07eef2204..8f5c3799161 100755 --- a/src/server/game/Maps/MapManager.h +++ b/src/server/game/Maps/MapManager.h @@ -104,21 +104,6 @@ class MapManager return IsValidMapCoord(loc.GetMapId(), loc.GetPositionX(), loc.GetPositionY(), loc.GetPositionZ(), loc.GetOrientation()); } - // modulos a radian orientation to the range of 0..2PI - static float NormalizeOrientation(float o) - { - // fmod only supports positive numbers. Thus we have - // to emulate negative numbers - if (o < 0) - { - float mod = o *-1; - mod = fmod(mod, 2.0f * static_cast(M_PI)); - mod = -mod + 2.0f * static_cast(M_PI); - return mod; - } - return fmod(o, 2.0f * static_cast(M_PI)); - } - void DoDelayedMovesAndRemoves(); void LoadTransports(); diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index ce41a776826..cbbc96b99d7 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -6053,7 +6053,7 @@ void Spell::EffectBind(SpellEffIndex effIndex) loc.m_positionX = st->target_X; loc.m_positionY = st->target_Y; loc.m_positionZ = st->target_Z; - loc.m_orientation = st->target_Orientation; + loc.SetOrientation(st->target_Orientation); area_id = player->GetAreaId(); } else diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp index 479d234e27c..89a26bde6ff 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp @@ -303,7 +303,6 @@ class npc_coldflame : public CreatureScript { Position const* ownerPos = marrowgarAI->GetLastColdflamePosition(); float ang = me->GetAngle(ownerPos) - static_cast(M_PI); - ang = MapManager::NormalizeOrientation(ang); me->SetOrientation(ang); owner->GetNearPosition(pos, 2.5f, 0.0f); } diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp index 6d9450daf21..aab54785213 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp @@ -121,7 +121,7 @@ public: coreEnergizeOrientation = me->GetOrientation(); firstCoreEnergize = true; } else - coreEnergizeOrientation = MapManager::NormalizeOrientation(coreEnergizeOrientation - 2.0f); + coreEnergizeOrientation = Position::NormalizeOrientation(coreEnergizeOrientation - 2.0f); DoCast(me, SPELL_ENERGIZE_CORES_VISUAL); events.ScheduleEvent(EVENT_ENERGIZE_CORES_VISUAL, 5000); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp index 24a9171e29f..b414a3fcdcb 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp @@ -488,7 +488,7 @@ class spell_ulduar_squeezed_lifeless : public SpellScriptLoader pos.m_positionX = 1756.25f + irand(-3, 3); pos.m_positionY = -8.3f + irand(-3, 3); pos.m_positionZ = 448.8f; - pos.m_orientation = M_PI; + pos.SetOrientation(M_PI); GetHitPlayer()->DestroyForNearbyPlayers(); GetHitPlayer()->ExitVehicle(&pos); GetHitPlayer()->UpdateObjectVisibility(false); -- cgit v1.2.3 From a300ecb7881b5530dbf0e7af8b3f061d56c8a76b Mon Sep 17 00:00:00 2001 From: Tuxity Date: Mon, 20 Aug 2012 11:36:09 +0200 Subject: Core/Battlegrounds: Add missing worldstate datas for TP and BFG. --- src/server/game/Entities/Player/Player.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 1e85afd47b1..88545329262 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -9723,6 +9723,27 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid) data << uint32(4131) << uint32(0); // 10 WORLDSTATE_CRATES_REVEALED } break; + // Twin Peaks + case 5031: + if (bg && bg->GetTypeID(true) == BATTLEGROUND_TP) + bg->FillInitialWorldStates(data); + else + { + data << uint32(0x62d) << uint32(0x0); // 7 1581 alliance flag captures + data << uint32(0x62e) << uint32(0x0); // 8 1582 horde flag captures + data << uint32(0x609) << uint32(0x0); // 9 1545 unk + data << uint32(0x60a) << uint32(0x0); // 10 1546 unk + data << uint32(0x60b) << uint32(0x2); // 11 1547 unk + data << uint32(0x641) << uint32(0x3); // 12 1601 unk + data << uint32(0x922) << uint32(0x1); // 13 2338 horde (0 - hide, 1 - flag ok, 2 - flag picked up (flashing), 3 - flag picked up (not flashing) + data << uint32(0x923) << uint32(0x1); // 14 2339 alliance (0 - hide, 1 - flag ok, 2 - flag picked up (flashing), 3 - flag picked up (not flashing) + } + break; + // Battle for Gilneas + case 5449: + if (bg && bg->GetTypeID(true) == BATTLEGROUND_BFG) + bg->FillInitialWorldStates(data); + break; default: data << uint32(0x914) << uint32(0x0); // 7 data << uint32(0x913) << uint32(0x0); // 8 -- cgit v1.2.3 From 9c3c3cd9ec392be5c29086b1ed6ec47fbbeb0eb9 Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 20 Aug 2012 15:54:55 +0200 Subject: Core/Items: Updated InventoryResult enum --- src/server/game/Entities/Item/Item.cpp | 6 +- src/server/game/Entities/Item/Item.h | 182 +++++++++++----------- src/server/game/Entities/Player/Player.cpp | 220 +++++++++++++-------------- src/server/game/Guilds/Guild.cpp | 10 +- src/server/game/Handlers/GuildHandler.cpp | 2 +- src/server/game/Handlers/ItemHandler.cpp | 30 ++-- src/server/game/Handlers/LootHandler.cpp | 2 +- src/server/game/Handlers/MailHandler.cpp | 4 +- src/server/game/Handlers/SpellHandler.cpp | 2 +- src/server/game/Spells/Auras/SpellAuras.cpp | 4 +- src/server/game/Spells/SpellEffects.cpp | 6 +- src/server/scripts/World/item_scripts.cpp | 12 +- src/server/scripts/World/npc_professions.cpp | 2 +- 13 files changed, 242 insertions(+), 240 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index 4d50f9375f1..3eb9aabab14 100755 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -838,15 +838,15 @@ InventoryResult Item::CanBeMergedPartlyWith(ItemTemplate const* proto) const { // not allow merge looting currently items if (m_lootGenerated) - return EQUIP_ERR_ALREADY_LOOTED; + return EQUIP_ERR_LOOT_GONE; // check item type if (GetEntry() != proto->ItemId) - return EQUIP_ERR_ITEM_CANT_STACK; + return EQUIP_ERR_CANT_STACK; // check free space (full stacks can't be target of merge if (GetCount() >= proto->GetMaxStackSize()) - return EQUIP_ERR_ITEM_CANT_STACK; + return EQUIP_ERR_CANT_STACK; return EQUIP_ERR_OK; } diff --git a/src/server/game/Entities/Item/Item.h b/src/server/game/Entities/Item/Item.h index f8d5428e6e8..b5ee171e6b1 100755 --- a/src/server/game/Entities/Item/Item.h +++ b/src/server/game/Entities/Item/Item.h @@ -38,95 +38,99 @@ struct ItemSetEffect enum InventoryResult { - EQUIP_ERR_OK = 0, - EQUIP_ERR_CANT_EQUIP_LEVEL_I = 1, - EQUIP_ERR_CANT_EQUIP_SKILL = 2, - EQUIP_ERR_ITEM_DOESNT_GO_TO_SLOT = 3, - EQUIP_ERR_BAG_FULL = 4, - EQUIP_ERR_NONEMPTY_BAG_OVER_OTHER_BAG = 5, - EQUIP_ERR_CANT_TRADE_EQUIP_BAGS = 6, - EQUIP_ERR_ONLY_AMMO_CAN_GO_HERE = 7, - EQUIP_ERR_NO_REQUIRED_PROFICIENCY = 8, - EQUIP_ERR_NO_EQUIPMENT_SLOT_AVAILABLE = 9, - EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM = 10, - EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM2 = 11, - EQUIP_ERR_NO_EQUIPMENT_SLOT_AVAILABLE2 = 12, - EQUIP_ERR_CANT_EQUIP_WITH_TWOHANDED = 13, - EQUIP_ERR_CANT_DUAL_WIELD = 14, - EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG = 15, - EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG2 = 16, - EQUIP_ERR_CANT_CARRY_MORE_OF_THIS = 17, - EQUIP_ERR_NO_EQUIPMENT_SLOT_AVAILABLE3 = 18, - EQUIP_ERR_ITEM_CANT_STACK = 19, - EQUIP_ERR_ITEM_CANT_BE_EQUIPPED = 20, - EQUIP_ERR_ITEMS_CANT_BE_SWAPPED = 21, - EQUIP_ERR_SLOT_IS_EMPTY = 22, - EQUIP_ERR_ITEM_NOT_FOUND = 23, - EQUIP_ERR_CANT_DROP_SOULBOUND = 24, - EQUIP_ERR_OUT_OF_RANGE = 25, - EQUIP_ERR_TRIED_TO_SPLIT_MORE_THAN_COUNT = 26, - EQUIP_ERR_COULDNT_SPLIT_ITEMS = 27, - EQUIP_ERR_MISSING_REAGENT = 28, - EQUIP_ERR_NOT_ENOUGH_MONEY = 29, - EQUIP_ERR_NOT_A_BAG = 30, - EQUIP_ERR_CAN_ONLY_DO_WITH_EMPTY_BAGS = 31, - EQUIP_ERR_DONT_OWN_THAT_ITEM = 32, - EQUIP_ERR_CAN_EQUIP_ONLY1_QUIVER = 33, - EQUIP_ERR_MUST_PURCHASE_THAT_BAG_SLOT = 34, - EQUIP_ERR_TOO_FAR_AWAY_FROM_BANK = 35, - EQUIP_ERR_ITEM_LOCKED = 36, - EQUIP_ERR_YOU_ARE_STUNNED = 37, - EQUIP_ERR_YOU_ARE_DEAD = 38, - EQUIP_ERR_CANT_DO_RIGHT_NOW = 39, - EQUIP_ERR_INT_BAG_ERROR = 40, - EQUIP_ERR_CAN_EQUIP_ONLY1_BOLT = 41, - EQUIP_ERR_CAN_EQUIP_ONLY1_AMMOPOUCH = 42, - EQUIP_ERR_STACKABLE_CANT_BE_WRAPPED = 43, - EQUIP_ERR_EQUIPPED_CANT_BE_WRAPPED = 44, - EQUIP_ERR_WRAPPED_CANT_BE_WRAPPED = 45, - EQUIP_ERR_BOUND_CANT_BE_WRAPPED = 46, - EQUIP_ERR_UNIQUE_CANT_BE_WRAPPED = 47, - EQUIP_ERR_BAGS_CANT_BE_WRAPPED = 48, - EQUIP_ERR_ALREADY_LOOTED = 49, - EQUIP_ERR_INVENTORY_FULL = 50, - EQUIP_ERR_BANK_FULL = 51, - EQUIP_ERR_ITEM_IS_CURRENTLY_SOLD_OUT = 52, - EQUIP_ERR_BAG_FULL3 = 53, - EQUIP_ERR_ITEM_NOT_FOUND2 = 54, - EQUIP_ERR_ITEM_CANT_STACK2 = 55, - EQUIP_ERR_BAG_FULL4 = 56, - EQUIP_ERR_ITEM_SOLD_OUT = 57, - EQUIP_ERR_OBJECT_IS_BUSY = 58, - EQUIP_ERR_NONE = 59, - EQUIP_ERR_NOT_IN_COMBAT = 60, - EQUIP_ERR_NOT_WHILE_DISARMED = 61, - EQUIP_ERR_BAG_FULL6 = 62, - EQUIP_ERR_CANT_EQUIP_RANK = 63, - EQUIP_ERR_CANT_EQUIP_REPUTATION = 64, - EQUIP_ERR_TOO_MANY_SPECIAL_BAGS = 65, - EQUIP_ERR_LOOT_CANT_LOOT_THAT_NOW = 66, - EQUIP_ERR_ITEM_UNIQUE_EQUIPABLE = 67, - EQUIP_ERR_VENDOR_MISSING_TURNINS = 68, - EQUIP_ERR_NOT_ENOUGH_HONOR_POINTS = 69, - EQUIP_ERR_NOT_ENOUGH_ARENA_POINTS = 70, - EQUIP_ERR_ITEM_MAX_COUNT_SOCKETED = 71, - EQUIP_ERR_MAIL_BOUND_ITEM = 72, - EQUIP_ERR_NO_SPLIT_WHILE_PROSPECTING = 73, - EQUIP_ERR_ITEM_MAX_COUNT_EQUIPPED_SOCKETED = 75, - EQUIP_ERR_ITEM_UNIQUE_EQUIPPABLE_SOCKETED = 76, - EQUIP_ERR_TOO_MUCH_GOLD = 77, - EQUIP_ERR_NOT_DURING_ARENA_MATCH = 78, - EQUIP_ERR_CANNOT_TRADE_THAT = 79, - EQUIP_ERR_PERSONAL_ARENA_RATING_TOO_LOW = 80, - EQUIP_ERR_EVENT_AUTOEQUIP_BIND_CONFIRM = 81, - EQUIP_ERR_ARTEFACTS_ONLY_FOR_OWN_CHARACTERS = 82, - // no output = 83, - EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_COUNT_EXCEEDED = 84, - EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_SOCKETED_EXCEEDED = 85, - EQUIP_ERR_SCALING_STAT_ITEM_LEVEL_EXCEEDED = 86, - EQUIP_ERR_PURCHASE_LEVEL_TOO_LOW = 87, - EQUIP_ERR_CANT_EQUIP_NEED_TALENT = 88, - EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_EQUIPPED_EXCEEDED = 89 + EQUIP_ERR_OK = 0, + EQUIP_ERR_CANT_EQUIP_LEVEL_I = 1, // You must reach level %d to use that item. + EQUIP_ERR_CANT_EQUIP_SKILL = 2, // You aren't skilled enough to use that item. + EQUIP_ERR_WRONG_SLOT = 3, // That item does not go in that slot. + EQUIP_ERR_BAG_FULL = 4, // That bag is full. + EQUIP_ERR_BAG_IN_BAG = 5, // Can't put non-empty bags in other bags. + EQUIP_ERR_TRADE_EQUIPPED_BAG = 6, // You can't trade equipped bags. + EQUIP_ERR_AMMO_ONLY = 7, // Only ammo can go there. + EQUIP_ERR_PROFICIENCY_NEEDED = 8, // You do not have the required proficiency for that item. + EQUIP_ERR_NO_SLOT_AVAILABLE = 9, // No equipment slot is available for that item. + EQUIP_ERR_CANT_EQUIP_EVER = 10, // You can never use that item. + EQUIP_ERR_CANT_EQUIP_EVER_2 = 11, // You can never use that item. + EQUIP_ERR_NO_SLOT_AVAILABLE_2 = 12, // No equipment slot is available for that item. + EQUIP_ERR_2HANDED_EQUIPPED = 13, // Cannot equip that with a two-handed weapon. + EQUIP_ERR_2HSKILLNOTFOUND = 14, // You cannot dual-wield + EQUIP_ERR_WRONG_BAG_TYPE = 15, // That item doesn't go in that container. + EQUIP_ERR_WRONG_BAG_TYPE_2 = 16, // That item doesn't go in that container. + EQUIP_ERR_ITEM_MAX_COUNT = 17, // You can't carry any more of those items. + EQUIP_ERR_NO_SLOT_AVAILABLE_3 = 18, // No equipment slot is available for that item. + EQUIP_ERR_CANT_STACK = 19, // This item cannot stack. + EQUIP_ERR_NOT_EQUIPPABLE = 20, // This item cannot be equipped. + EQUIP_ERR_CANT_SWAP = 21, // These items can't be swapped. + EQUIP_ERR_SLOT_EMPTY = 22, // That slot is empty. + EQUIP_ERR_ITEM_NOT_FOUND = 23, // The item was not found. + EQUIP_ERR_DROP_BOUND_ITEM = 24, // You can't drop a soulbound item. + EQUIP_ERR_OUT_OF_RANGE = 25, // Out of range. + EQUIP_ERR_TOO_FEW_TO_SPLIT = 26, // Tried to split more than number in stack. + EQUIP_ERR_SPLIT_FAILED = 27, // Couldn't split those items. + EQUIP_ERR_SPELL_FAILED_REAGENTS_GENERIC = 28, // Missing reagent + EQUIP_ERR_NOT_ENOUGH_MONEY = 29, // You don't have enough money. + EQUIP_ERR_NOT_A_BAG = 30, // Not a bag. + EQUIP_ERR_DESTROY_NONEMPTY_BAG = 31, // You can only do that with empty bags. + EQUIP_ERR_NOT_OWNER = 32, // You don't own that item. + EQUIP_ERR_ONLY_ONE_QUIVER = 33, // You can only equip one quiver. + EQUIP_ERR_NO_BANK_SLOT = 34, // You must purchase that bag slot first + EQUIP_ERR_NO_BANK_HERE = 35, // You are too far away from a bank. + EQUIP_ERR_ITEM_LOCKED = 36, // Item is locked. + EQUIP_ERR_GENERIC_STUNNED = 37, // You are stunned + EQUIP_ERR_PLAYER_DEAD = 38, // You can't do that when you're dead. + EQUIP_ERR_CLIENT_LOCKED_OUT = 39, // You can't do that right now. + EQUIP_ERR_INTERNAL_BAG_ERROR = 40, // Internal Bag Error + EQUIP_ERR_ONLY_ONE_BOLT = 41, // You can only equip one quiver. + EQUIP_ERR_ONLY_ONE_AMMO = 42, // You can only equip one ammo pouch. + EQUIP_ERR_CANT_WRAP_STACKABLE = 43, // Stackable items can't be wrapped. + EQUIP_ERR_CANT_WRAP_EQUIPPED = 44, // Equipped items can't be wrapped. + EQUIP_ERR_CANT_WRAP_WRAPPED = 45, // Wrapped items can't be wrapped. + EQUIP_ERR_CANT_WRAP_BOUND = 46, // Bound items can't be wrapped. + EQUIP_ERR_CANT_WRAP_UNIQUE = 47, // Unique items can't be wrapped. + EQUIP_ERR_CANT_WRAP_BAGS = 48, // Bags can't be wrapped. + EQUIP_ERR_LOOT_GONE = 49, // Already looted + EQUIP_ERR_INV_FULL = 50, // Inventory is full. + EQUIP_ERR_BANK_FULL = 51, // Your bank is full + EQUIP_ERR_VENDOR_SOLD_OUT = 52, // That item is currently sold out. + EQUIP_ERR_BAG_FULL_2 = 53, // That bag is full. + EQUIP_ERR_ITEM_NOT_FOUND_2 = 54, // The item was not found. + EQUIP_ERR_CANT_STACK_2 = 55, // This item cannot stack. + EQUIP_ERR_BAG_FULL_3 = 56, // That bag is full. + EQUIP_ERR_VENDOR_SOLD_OUT_2 = 57, // That item is currently sold out. + EQUIP_ERR_OBJECT_IS_BUSY = 58, // That object is busy. + EQUIP_ERR_CANT_BE_DISENCHANTED = 59, + EQUIP_ERR_NOT_IN_COMBAT = 60, // You can't do that while in combat + EQUIP_ERR_NOT_WHILE_DISARMED = 61, // You can't do that while disarmed + EQUIP_ERR_BAG_FULL_4 = 62, // That bag is full. + EQUIP_ERR_CANT_EQUIP_RANK = 63, // You don't have the required rank for that item + EQUIP_ERR_CANT_EQUIP_REPUTATION = 64, // You don't have the required reputation for that item + EQUIP_ERR_TOO_MANY_SPECIAL_BAGS = 65, // You cannot equip another bag of that type + EQUIP_ERR_LOOT_CANT_LOOT_THAT_NOW = 66, // You can't loot that item now. + EQUIP_ERR_ITEM_UNIQUE_EQUIPPABLE = 67, // You cannot equip more than one of those. + EQUIP_ERR_VENDOR_MISSING_TURNINS = 68, // You do not have the required items for that purchase + EQUIP_ERR_NOT_ENOUGH_HONOR_POINTS = 69, // You don't have enough honor points + EQUIP_ERR_NOT_ENOUGH_ARENA_POINTS = 70, // You don't have enough arena points + EQUIP_ERR_ITEM_MAX_COUNT_SOCKETED = 71, // You have the maximum number of those gems in your inventory or socketed into items. + EQUIP_ERR_MAIL_BOUND_ITEM = 72, // You can't mail soulbound items. + EQUIP_ERR_INTERNAL_BAG_ERROR_2 = 73, // Internal Bag Error + EQUIP_ERR_BAG_FULL_5 = 74, // That bag is full. + EQUIP_ERR_ITEM_MAX_COUNT_EQUIPPED_SOCKETED = 75, // You have the maximum number of those gems socketed into equipped items. + EQUIP_ERR_ITEM_UNIQUE_EQUIPPABLE_SOCKETED = 76, // You cannot socket more than one of those gems into a single item. + EQUIP_ERR_TOO_MUCH_GOLD = 77, // At gold limit + EQUIP_ERR_NOT_DURING_ARENA_MATCH = 78, // You can't do that while in an arena match + EQUIP_ERR_TRADE_BOUND_ITEM = 79, // You can't trade a soulbound item. + EQUIP_ERR_CANT_EQUIP_RATING = 80, // You don't have the personal, team, or battleground rating required to buy that item + EQUIP_ERR_NO_OUTPUT = 81, + EQUIP_ERR_NOT_SAME_ACCOUNT = 82, // Account-bound items can only be given to your own characters. + EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_COUNT_EXCEEDED_IS = 84, // You can only carry %d %s + EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_SOCKETED_EXCEEDED_IS = 85, // You can only equip %d |4item:items in the %s category + EQUIP_ERR_SCALING_STAT_ITEM_LEVEL_EXCEEDED = 86, // Your level is too high to use that item + EQUIP_ERR_PURCHASE_LEVEL_TOO_LOW = 87, // You must reach level %d to purchase that item. + EQUIP_ERR_CANT_EQUIP_NEED_TALENT = 88, // You do not have the required talent to equip that. + EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_EQUIPPED_EXCEEDED_IS = 89, // You can only equip %d |4item:items in the %s category + EQUIP_ERR_SHAPESHIFT_FORM_CANNOT_EQUIP = 90, // Cannot equip item in this form + EQUIP_ERR_ITEM_INVENTORY_FULL_SATCHEL = 91, // Your inventory is full. Your satchel has been delivered to your mailbox. + EQUIP_ERR_SCALING_STAT_ITEM_LEVEL_TOO_LOW = 92, // Your level is too low to use that item + EQUIP_ERR_CANT_BUY_QUANTITY = 93, // You can't buy the specified quantity of that item. }; enum BuyResult diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 1c164fffe3c..a46e7806961 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -8527,7 +8527,7 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8 if (!spellInfo) { sLog->outError(LOG_FILTER_PLAYER, "Player::CastItemUseSpell: Item (Entry: %u) in have wrong spell id %u, ignoring ", proto->ItemId, learn_spell_id); - SendEquipError(EQUIP_ERR_NONE, item, NULL); + SendEquipError(EQUIP_ERR_INTERNAL_BAG_ERROR, item, NULL); return; } @@ -10466,11 +10466,11 @@ InventoryResult Player::CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item { if (no_space_count) *no_space_count = count; - return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS; + return EQUIP_ERR_ITEM_MAX_COUNT; } if (pItem && pItem->m_lootGenerated) - return EQUIP_ERR_ALREADY_LOOTED; + return EQUIP_ERR_LOOT_GONE; // no maximum if ((pProto->MaxCount <= 0 && pProto->ItemLimitCategory == 0) || pProto->MaxCount == 2147483647) @@ -10483,7 +10483,7 @@ InventoryResult Player::CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item { if (no_space_count) *no_space_count = count + curcount - pProto->MaxCount; - return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS; + return EQUIP_ERR_ITEM_MAX_COUNT; } } @@ -10495,7 +10495,7 @@ InventoryResult Player::CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item { if (no_space_count) *no_space_count = count; - return EQUIP_ERR_ITEM_CANT_BE_EQUIPPED; + return EQUIP_ERR_NOT_EQUIPPABLE; } if (limitEntry->mode == ITEM_LIMIT_CATEGORY_MODE_HAVE) @@ -10505,7 +10505,7 @@ InventoryResult Player::CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item { if (no_space_count) *no_space_count = count + curcount - limitEntry->maxCount; - return EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_COUNT_EXCEEDED; + return EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_COUNT_EXCEEDED_IS; } } } @@ -10524,7 +10524,7 @@ InventoryResult Player::CanStoreItem_InSpecificSlot(uint8 bag, uint8 slot, ItemP uint32 need_space; if (pSrcItem && pSrcItem->IsNotEmptyBag() && !IsBagPos(uint16(bag) << 8 | slot)) - return EQUIP_ERR_CAN_ONLY_DO_WITH_EMPTY_BAGS; + return EQUIP_ERR_DESTROY_NONEMPTY_BAG; // empty specific slot - check item fit to slot if (!pItem2 || swap) @@ -10533,23 +10533,23 @@ InventoryResult Player::CanStoreItem_InSpecificSlot(uint8 bag, uint8 slot, ItemP { // prevent cheating if ((slot >= BUYBACK_SLOT_START && slot < BUYBACK_SLOT_END) || slot >= PLAYER_SLOT_END) - return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG; + return EQUIP_ERR_WRONG_BAG_TYPE; } else { Bag* pBag = GetBagByPos(bag); if (!pBag) - return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG; + return EQUIP_ERR_WRONG_BAG_TYPE; ItemTemplate const* pBagProto = pBag->GetTemplate(); if (!pBagProto) - return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG; + return EQUIP_ERR_WRONG_BAG_TYPE; if (slot >= pBagProto->ContainerSlots) - return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG; + return EQUIP_ERR_WRONG_BAG_TYPE; if (!ItemCanGoIntoBag(pProto, pBagProto)) - return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG; + return EQUIP_ERR_WRONG_BAG_TYPE; } // non empty stack with space @@ -10583,26 +10583,26 @@ InventoryResult Player::CanStoreItem_InBag(uint8 bag, ItemPosCountVec &dest, Ite { // skip specific bag already processed in first called CanStoreItem_InBag if (bag == skip_bag) - return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG; + return EQUIP_ERR_WRONG_BAG_TYPE; // skip not existed bag or self targeted bag Bag* pBag = GetBagByPos(bag); if (!pBag || pBag == pSrcItem) - return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG; + return EQUIP_ERR_WRONG_BAG_TYPE; if (pSrcItem && pSrcItem->IsNotEmptyBag()) - return EQUIP_ERR_CAN_ONLY_DO_WITH_EMPTY_BAGS; + return EQUIP_ERR_DESTROY_NONEMPTY_BAG; ItemTemplate const* pBagProto = pBag->GetTemplate(); if (!pBagProto) - return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG; + return EQUIP_ERR_WRONG_BAG_TYPE; // specialized bag mode or non-specilized if (non_specialized != (pBagProto->Class == ITEM_CLASS_CONTAINER && pBagProto->SubClass == ITEM_SUBCLASS_CONTAINER)) - return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG; + return EQUIP_ERR_WRONG_BAG_TYPE; if (!ItemCanGoIntoBag(pProto, pBagProto)) - return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG; + return EQUIP_ERR_WRONG_BAG_TYPE; for (uint32 j = 0; j < pBag->GetBagSize(); j++) { @@ -10653,7 +10653,7 @@ InventoryResult Player::CanStoreItem_InInventorySlots(uint8 slot_begin, uint8 sl { //this is never called for non-bag slots so we can do this if (pSrcItem && pSrcItem->IsNotEmptyBag()) - return EQUIP_ERR_CAN_ONLY_DO_WITH_EMPTY_BAGS; + return EQUIP_ERR_DESTROY_NONEMPTY_BAG; for (uint32 j = slot_begin; j < slot_end; j++) { @@ -10709,7 +10709,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des { if (no_space_count) *no_space_count = count; - return swap ? EQUIP_ERR_ITEMS_CANT_BE_SWAPPED :EQUIP_ERR_ITEM_NOT_FOUND; + return swap ? EQUIP_ERR_CANT_SWAP :EQUIP_ERR_ITEM_NOT_FOUND; } if (pItem) @@ -10719,14 +10719,14 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des { if (no_space_count) *no_space_count = count; - return EQUIP_ERR_ALREADY_LOOTED; + return EQUIP_ERR_LOOT_GONE; } if (pItem->IsBindedNotWith(this)) { if (no_space_count) *no_space_count = count; - return EQUIP_ERR_DONT_OWN_THAT_ITEM; + return EQUIP_ERR_NOT_OWNER; } } @@ -10762,7 +10762,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des if (no_space_count) *no_space_count = count + no_similar_count; - return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS; + return EQUIP_ERR_ITEM_MAX_COUNT; } } @@ -10791,7 +10791,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des if (no_space_count) *no_space_count = count + no_similar_count; - return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS; + return EQUIP_ERR_ITEM_MAX_COUNT; } } else // equipped bag @@ -10815,7 +10815,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des if (no_space_count) *no_space_count = count + no_similar_count; - return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS; + return EQUIP_ERR_ITEM_MAX_COUNT; } } } @@ -10838,7 +10838,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des if (no_space_count) *no_space_count = count + no_similar_count; - return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS; + return EQUIP_ERR_ITEM_MAX_COUNT; } } else // equipped bag @@ -10861,7 +10861,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des if (no_space_count) *no_space_count = count + no_similar_count; - return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS; + return EQUIP_ERR_ITEM_MAX_COUNT; } } } @@ -10886,7 +10886,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des if (no_space_count) *no_space_count = count + no_similar_count; - return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS; + return EQUIP_ERR_ITEM_MAX_COUNT; } if (pProto->BagFamily) @@ -10904,7 +10904,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des if (no_space_count) *no_space_count = count + no_similar_count; - return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS; + return EQUIP_ERR_ITEM_MAX_COUNT; } } } @@ -10922,7 +10922,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des if (no_space_count) *no_space_count = count + no_similar_count; - return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS; + return EQUIP_ERR_ITEM_MAX_COUNT; } } } @@ -10943,13 +10943,13 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des if (no_space_count) *no_space_count = count + no_similar_count; - return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS; + return EQUIP_ERR_ITEM_MAX_COUNT; } } } if (pItem && pItem->IsNotEmptyBag()) - return EQUIP_ERR_NONEMPTY_BAG_OVER_OTHER_BAG; + return EQUIP_ERR_BAG_IN_BAG; // search free slot res = CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START, INVENTORY_SLOT_ITEM_END, dest, pProto, count, false, pItem, bag, slot); @@ -10967,7 +10967,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des if (no_space_count) *no_space_count = count + no_similar_count; - return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS; + return EQUIP_ERR_ITEM_MAX_COUNT; } for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) @@ -10983,14 +10983,14 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des if (no_space_count) *no_space_count = count + no_similar_count; - return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS; + return EQUIP_ERR_ITEM_MAX_COUNT; } } if (no_space_count) *no_space_count = count + no_similar_count; - return EQUIP_ERR_INVENTORY_FULL; + return EQUIP_ERR_INV_FULL; } ////////////////////////////////////////////////////////////////////////// @@ -11039,11 +11039,11 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const // item used if (pItem->m_lootGenerated) - return EQUIP_ERR_ALREADY_LOOTED; + return EQUIP_ERR_LOOT_GONE; // item it 'bind' if (pItem->IsBindedNotWith(this)) - return EQUIP_ERR_DONT_OWN_THAT_ITEM; + return EQUIP_ERR_NOT_OWNER; ItemTemplate const* pBagProto; @@ -11163,7 +11163,7 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const // no free slot found? if (!b_found) - return EQUIP_ERR_INVENTORY_FULL; + return EQUIP_ERR_INV_FULL; } return EQUIP_ERR_OK; @@ -11195,10 +11195,10 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool { // item used if (pItem->m_lootGenerated) - return EQUIP_ERR_ALREADY_LOOTED; + return EQUIP_ERR_LOOT_GONE; if (pItem->IsBindedNotWith(this)) - return EQUIP_ERR_DONT_OWN_THAT_ITEM; + return EQUIP_ERR_NOT_OWNER; // check count of items (skip for auto move for same player from bank) InventoryResult res = CanTakeMoreSimilarItems(pItem); @@ -11211,7 +11211,7 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool // May be here should be more stronger checks; STUNNED checked // ROOT, CONFUSED, DISTRACTED, FLEEING this needs to be checked. if (HasUnitState(UNIT_STATE_STUNNED)) - return EQUIP_ERR_YOU_ARE_STUNNED; + return EQUIP_ERR_GENERIC_STUNNED; // do not allow equipping gear except weapons, offhands, projectiles, relics in // - combat @@ -11227,27 +11227,27 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool } if (isInCombat()&& (pProto->Class == ITEM_CLASS_WEAPON || pProto->InventoryType == INVTYPE_RELIC) && m_weaponChangeTimer != 0) - return EQUIP_ERR_CANT_DO_RIGHT_NOW; // maybe exist better err + return EQUIP_ERR_CLIENT_LOCKED_OUT; // maybe exist better err if (IsNonMeleeSpellCasted(false)) - return EQUIP_ERR_CANT_DO_RIGHT_NOW; + return EQUIP_ERR_CLIENT_LOCKED_OUT; } ScalingStatDistributionEntry const* ssd = pProto->ScalingStatDistribution ? sScalingStatDistributionStore.LookupEntry(pProto->ScalingStatDistribution) : 0; // check allowed level (extend range to upper values if MaxLevel more or equal max player level, this let GM set high level with 1...max range items) if (ssd && ssd->MaxLevel < DEFAULT_MAX_LEVEL && ssd->MaxLevel < getLevel()) - return EQUIP_ERR_ITEM_CANT_BE_EQUIPPED; + return EQUIP_ERR_NOT_EQUIPPABLE; uint8 eslot = FindEquipSlot(pProto, slot, swap); if (eslot == NULL_SLOT) - return EQUIP_ERR_ITEM_CANT_BE_EQUIPPED; + return EQUIP_ERR_NOT_EQUIPPABLE; res = CanUseItem(pItem, not_loading); if (res != EQUIP_ERR_OK) return res; if (!swap && GetItemByPos(INVENTORY_SLOT_BAG_0, eslot)) - return EQUIP_ERR_NO_EQUIPMENT_SLOT_AVAILABLE; + return EQUIP_ERR_NO_SLOT_AVAILABLE; // if swap ignore item (equipped also) InventoryResult res2 = CanEquipUniqueItem(pItem, swap ? eslot : uint8(NULL_SLOT)); @@ -11262,8 +11262,8 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool if (ItemTemplate const* pBagProto = pBag->GetTemplate()) if (pBagProto->Class == pProto->Class && (!swap || pBag->GetSlot() != eslot)) return (pBagProto->SubClass == ITEM_SUBCLASS_AMMO_POUCH) - ? EQUIP_ERR_CAN_EQUIP_ONLY1_AMMOPOUCH - : EQUIP_ERR_CAN_EQUIP_ONLY1_QUIVER; + ? EQUIP_ERR_ONLY_ONE_AMMO + : EQUIP_ERR_ONLY_ONE_QUIVER; uint32 type = pProto->InventoryType; @@ -11272,16 +11272,16 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool if (type == INVTYPE_WEAPON || type == INVTYPE_WEAPONOFFHAND) { if (!CanDualWield()) - return EQUIP_ERR_CANT_DUAL_WIELD; + return EQUIP_ERR_2HSKILLNOTFOUND; } else if (type == INVTYPE_2HWEAPON) { if (!CanDualWield() || !CanTitanGrip()) - return EQUIP_ERR_CANT_DUAL_WIELD; + return EQUIP_ERR_2HSKILLNOTFOUND; } if (IsTwoHandUsed()) - return EQUIP_ERR_CANT_EQUIP_WITH_TWOHANDED; + return EQUIP_ERR_2HANDED_EQUIPPED; } // equip two-hand weapon case (with possible unequip 2 items) @@ -11290,10 +11290,10 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool if (eslot == EQUIPMENT_SLOT_OFFHAND) { if (!CanTitanGrip()) - return EQUIP_ERR_ITEM_CANT_BE_EQUIPPED; + return EQUIP_ERR_NOT_EQUIPPABLE; } else if (eslot != EQUIPMENT_SLOT_MAINHAND) - return EQUIP_ERR_ITEM_CANT_BE_EQUIPPED; + return EQUIP_ERR_NOT_EQUIPPABLE; if (!CanTitanGrip()) { @@ -11303,7 +11303,7 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool if (offItem && (!not_loading || CanUnequipItem(uint16(INVENTORY_SLOT_BAG_0) << 8 | EQUIPMENT_SLOT_OFFHAND, false) != EQUIP_ERR_OK || CanStoreItem(NULL_BAG, NULL_SLOT, off_dest, offItem, false) != EQUIP_ERR_OK)) - return swap ? EQUIP_ERR_ITEMS_CANT_BE_SWAPPED : EQUIP_ERR_INVENTORY_FULL; + return swap ? EQUIP_ERR_CANT_SWAP : EQUIP_ERR_INV_FULL; } } dest = ((INVENTORY_SLOT_BAG_0 << 8) | eslot); @@ -11311,7 +11311,7 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool } } - return !swap ? EQUIP_ERR_ITEM_NOT_FOUND : EQUIP_ERR_ITEMS_CANT_BE_SWAPPED; + return !swap ? EQUIP_ERR_ITEM_NOT_FOUND : EQUIP_ERR_CANT_SWAP; } InventoryResult Player::CanUnequipItem(uint16 pos, bool swap) const @@ -11334,7 +11334,7 @@ InventoryResult Player::CanUnequipItem(uint16 pos, bool swap) const // item used if (pItem->m_lootGenerated) - return EQUIP_ERR_ALREADY_LOOTED; + return EQUIP_ERR_LOOT_GONE; // do not allow unequipping gear except weapons, offhands, projectiles, relics in // - combat @@ -11350,7 +11350,7 @@ InventoryResult Player::CanUnequipItem(uint16 pos, bool swap) const } if (!swap && pItem->IsNotEmptyBag()) - return EQUIP_ERR_CAN_ONLY_DO_WITH_EMPTY_BAGS; + return EQUIP_ERR_DESTROY_NONEMPTY_BAG; return EQUIP_ERR_OK; } @@ -11358,28 +11358,28 @@ InventoryResult Player::CanUnequipItem(uint16 pos, bool swap) const InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, Item* pItem, bool swap, bool not_loading) const { if (!pItem) - return swap ? EQUIP_ERR_ITEMS_CANT_BE_SWAPPED : EQUIP_ERR_ITEM_NOT_FOUND; + return swap ? EQUIP_ERR_CANT_SWAP : EQUIP_ERR_ITEM_NOT_FOUND; uint32 count = pItem->GetCount(); sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanBankItem bag = %u, slot = %u, item = %u, count = %u", bag, slot, pItem->GetEntry(), pItem->GetCount()); ItemTemplate const* pProto = pItem->GetTemplate(); if (!pProto) - return swap ? EQUIP_ERR_ITEMS_CANT_BE_SWAPPED : EQUIP_ERR_ITEM_NOT_FOUND; + return swap ? EQUIP_ERR_CANT_SWAP : EQUIP_ERR_ITEM_NOT_FOUND; // item used if (pItem->m_lootGenerated) - return EQUIP_ERR_ALREADY_LOOTED; + return EQUIP_ERR_LOOT_GONE; if (pItem->IsBindedNotWith(this)) - return EQUIP_ERR_DONT_OWN_THAT_ITEM; + return EQUIP_ERR_NOT_OWNER; // Currency tokens are not supposed to be swapped out of their hidden bag if(pItem->IsCurrencyToken()) { sLog->outError(LOG_FILTER_PLAYER, "Possible hacking attempt: Player %s [guid: %u] tried to move token [guid: %u, entry: %u] out of the currency bag!", GetName(), GetGUIDLow(), pItem->GetGUIDLow(), pProto->ItemId); - return EQUIP_ERR_ITEMS_CANT_BE_SWAPPED; + return EQUIP_ERR_CANT_SWAP; } // check count of items (skip for auto move for same player from bank) @@ -11393,10 +11393,10 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest if (slot >= BANK_SLOT_BAG_START && slot < BANK_SLOT_BAG_END) { if (!pItem->IsBag()) - return EQUIP_ERR_ITEM_DOESNT_GO_TO_SLOT; + return EQUIP_ERR_WRONG_SLOT; if (slot - BANK_SLOT_BAG_START >= GetBankBagSlotCount()) - return EQUIP_ERR_MUST_PURCHASE_THAT_BAG_SLOT; + return EQUIP_ERR_NO_BANK_SLOT; res = CanUseItem(pItem, not_loading); if (res != EQUIP_ERR_OK) @@ -11417,7 +11417,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest if (bag != NULL_BAG) { if (pItem->IsNotEmptyBag()) - return EQUIP_ERR_NONEMPTY_BAG_OVER_OTHER_BAG; + return EQUIP_ERR_BAG_IN_BAG; // search stack in bag for merge to if (pProto->Stackable != 1) @@ -11548,16 +11548,16 @@ InventoryResult Player::CanUseItem(Item* pItem, bool not_loading) const sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanUseItem item = %u", pItem->GetEntry()); if (!isAlive() && not_loading) - return EQUIP_ERR_YOU_ARE_DEAD; + return EQUIP_ERR_PLAYER_DEAD; //if (isStunned()) - // return EQUIP_ERR_YOU_ARE_STUNNED; + // return EQUIP_ERR_GENERIC_STUNNED; ItemTemplate const* pProto = pItem->GetTemplate(); if (pProto) { if (pItem->IsBindedNotWith(this)) - return EQUIP_ERR_DONT_OWN_THAT_ITEM; + return EQUIP_ERR_NOT_OWNER; InventoryResult res = CanUseItem(pProto); if (res != EQUIP_ERR_OK) @@ -11570,7 +11570,7 @@ InventoryResult Player::CanUseItem(Item* pItem, bool not_loading) const // Armor that is binded to account can "morph" from plate to mail, etc. if skill is not learned yet. if (pProto->Quality == ITEM_QUALITY_HEIRLOOM && pProto->Class == ITEM_CLASS_ARMOR && !HasSkill(itemSkill)) { - // TODO: when you right-click already equipped item it throws EQUIP_ERR_NO_REQUIRED_PROFICIENCY. + // TODO: when you right-click already equipped item it throws EQUIP_ERR_PROFICIENCY_NEEDED. // In fact it's a visual bug, everything works properly... I need sniffs of operations with // binded to account items from off server. @@ -11588,7 +11588,7 @@ InventoryResult Player::CanUseItem(Item* pItem, bool not_loading) const } } if (!allowEquip && GetSkillValue(itemSkill) == 0) - return EQUIP_ERR_NO_REQUIRED_PROFICIENCY; + return EQUIP_ERR_PROFICIENCY_NEEDED; } if (pProto->RequiredReputationFaction && uint32(GetReputationRank(pProto->RequiredReputationFaction)) < pProto->RequiredReputationRank) @@ -11607,31 +11607,31 @@ InventoryResult Player::CanUseItem(ItemTemplate const* proto) const if (proto) { if ((proto->Flags2 & ITEM_FLAGS_EXTRA_HORDE_ONLY) && GetTeam() != HORDE) - return EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM; + return EQUIP_ERR_CANT_EQUIP_EVER; if ((proto->Flags2 & ITEM_FLAGS_EXTRA_ALLIANCE_ONLY) && GetTeam() != ALLIANCE) - return EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM; + return EQUIP_ERR_CANT_EQUIP_EVER; if ((proto->AllowableClass & getClassMask()) == 0 || (proto->AllowableRace & getRaceMask()) == 0) - return EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM; + return EQUIP_ERR_CANT_EQUIP_EVER; if (proto->RequiredSkill != 0) { if (GetSkillValue(proto->RequiredSkill) == 0) - return EQUIP_ERR_NO_REQUIRED_PROFICIENCY; + return EQUIP_ERR_PROFICIENCY_NEEDED; else if (GetSkillValue(proto->RequiredSkill) < proto->RequiredSkillRank) return EQUIP_ERR_CANT_EQUIP_SKILL; } if (proto->RequiredSpell != 0 && !HasSpell(proto->RequiredSpell)) - return EQUIP_ERR_NO_REQUIRED_PROFICIENCY; + return EQUIP_ERR_PROFICIENCY_NEEDED; if (getLevel() < proto->RequiredLevel) return EQUIP_ERR_CANT_EQUIP_LEVEL_I; // If World Event is not active, prevent using event dependant items if (proto->HolidayId && !IsHolidayActive((HolidayIds)proto->HolidayId)) - return EQUIP_ERR_CANT_DO_RIGHT_NOW; + return EQUIP_ERR_CLIENT_LOCKED_OUT; return EQUIP_ERR_OK; } @@ -11673,15 +11673,15 @@ InventoryResult Player::CanRollForItemInLFG(ItemTemplate const* proto, WorldObje }; //Copy from function Item::GetSkill() if ((proto->AllowableClass & getClassMask()) == 0 || (proto->AllowableRace & getRaceMask()) == 0) - return EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM; + return EQUIP_ERR_CANT_EQUIP_EVER; if (proto->RequiredSpell != 0 && !HasSpell(proto->RequiredSpell)) - return EQUIP_ERR_NO_REQUIRED_PROFICIENCY; + return EQUIP_ERR_PROFICIENCY_NEEDED; if (proto->RequiredSkill != 0) { if (!GetSkillValue(proto->RequiredSkill)) - return EQUIP_ERR_NO_REQUIRED_PROFICIENCY; + return EQUIP_ERR_PROFICIENCY_NEEDED; else if (GetSkillValue(proto->RequiredSkill) < proto->RequiredSkillRank) return EQUIP_ERR_CANT_EQUIP_SKILL; } @@ -11689,7 +11689,7 @@ InventoryResult Player::CanRollForItemInLFG(ItemTemplate const* proto, WorldObje uint8 _class = getClass(); if (proto->Class == ITEM_CLASS_WEAPON && GetSkillValue(item_weapon_skills[proto->SubClass]) == 0) - return EQUIP_ERR_NO_REQUIRED_PROFICIENCY; + return EQUIP_ERR_PROFICIENCY_NEEDED; if (proto->Class == ITEM_CLASS_ARMOR && proto->SubClass > ITEM_SUBCLASS_ARMOR_MISCELLANEOUS && proto->SubClass < ITEM_SUBCLASS_ARMOR_BUCKLER && proto->InventoryType != INVTYPE_CLOAK) { @@ -11698,29 +11698,29 @@ InventoryResult Player::CanRollForItemInLFG(ItemTemplate const* proto, WorldObje if (getLevel() < 40) { if (proto->SubClass != ITEM_SUBCLASS_ARMOR_MAIL) - return EQUIP_ERR_CANT_DO_RIGHT_NOW; + return EQUIP_ERR_CLIENT_LOCKED_OUT; } else if (proto->SubClass != ITEM_SUBCLASS_ARMOR_PLATE) - return EQUIP_ERR_CANT_DO_RIGHT_NOW; + return EQUIP_ERR_CLIENT_LOCKED_OUT; } else if (_class == CLASS_HUNTER || _class == CLASS_SHAMAN) { if (getLevel() < 40) { if (proto->SubClass != ITEM_SUBCLASS_ARMOR_LEATHER) - return EQUIP_ERR_CANT_DO_RIGHT_NOW; + return EQUIP_ERR_CLIENT_LOCKED_OUT; } else if (proto->SubClass != ITEM_SUBCLASS_ARMOR_MAIL) - return EQUIP_ERR_CANT_DO_RIGHT_NOW; + return EQUIP_ERR_CLIENT_LOCKED_OUT; } if (_class == CLASS_ROGUE || _class == CLASS_DRUID) if (proto->SubClass != ITEM_SUBCLASS_ARMOR_LEATHER) - return EQUIP_ERR_CANT_DO_RIGHT_NOW; + return EQUIP_ERR_CLIENT_LOCKED_OUT; if (_class == CLASS_MAGE || _class == CLASS_PRIEST || _class == CLASS_WARLOCK) if (proto->SubClass != ITEM_SUBCLASS_ARMOR_CLOTH) - return EQUIP_ERR_CANT_DO_RIGHT_NOW; + return EQUIP_ERR_CLIENT_LOCKED_OUT; } return EQUIP_ERR_OK; @@ -12522,21 +12522,21 @@ void Player::SplitItem(uint16 src, uint16 dst, uint32 count) if (pSrcItem->m_lootGenerated) // prevent split looting item (item { //best error message found for attempting to split while looting - SendEquipError(EQUIP_ERR_COULDNT_SPLIT_ITEMS, pSrcItem, NULL); + SendEquipError(EQUIP_ERR_SPLIT_FAILED, pSrcItem, NULL); return; } // not let split all items (can be only at cheating) if (pSrcItem->GetCount() == count) { - SendEquipError(EQUIP_ERR_COULDNT_SPLIT_ITEMS, pSrcItem, NULL); + SendEquipError(EQUIP_ERR_SPLIT_FAILED, pSrcItem, NULL); return; } // not let split more existed items (can be only at cheating) if (pSrcItem->GetCount() < count) { - SendEquipError(EQUIP_ERR_TRIED_TO_SPLIT_MORE_THAN_COUNT, pSrcItem, NULL); + SendEquipError(EQUIP_ERR_TOO_FEW_TO_SPLIT, pSrcItem, NULL); return; } @@ -12637,7 +12637,7 @@ void Player::SwapItem(uint16 src, uint16 dst) if (!isAlive()) { - SendEquipError(EQUIP_ERR_YOU_ARE_DEAD, pSrcItem, pDstItem); + SendEquipError(EQUIP_ERR_PLAYER_DEAD, pSrcItem, pDstItem); return; } @@ -12646,7 +12646,7 @@ void Player::SwapItem(uint16 src, uint16 dst) if (pSrcItem->m_lootGenerated) // prevent swap looting item { //best error message found for attempting to swap while looting - SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pSrcItem, NULL); + SendEquipError(EQUIP_ERR_CLIENT_LOCKED_OUT, pSrcItem, NULL); return; } @@ -12665,14 +12665,14 @@ void Player::SwapItem(uint16 src, uint16 dst) // prevent put equipped/bank bag in self if (IsBagPos(src) && srcslot == dstbag) { - SendEquipError(EQUIP_ERR_NONEMPTY_BAG_OVER_OTHER_BAG, pSrcItem, pDstItem); + SendEquipError(EQUIP_ERR_BAG_IN_BAG, pSrcItem, pDstItem); return; } // prevent equipping bag in the same slot from its inside if (IsBagPos(dst) && srcbag == dstslot) { - SendEquipError(EQUIP_ERR_ITEMS_CANT_BE_SWAPPED, pSrcItem, pDstItem); + SendEquipError(EQUIP_ERR_CANT_SWAP, pSrcItem, pDstItem); return; } @@ -12683,7 +12683,7 @@ void Player::SwapItem(uint16 src, uint16 dst) if (pDstItem->m_lootGenerated) // prevent swap looting item { //best error message found for attempting to swap while looting - SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pDstItem, NULL); + SendEquipError(EQUIP_ERR_CLIENT_LOCKED_OUT, pDstItem, NULL); return; } @@ -12880,7 +12880,7 @@ void Player::SwapItem(uint16 src, uint16 dst) if (!bagItemProto || !ItemCanGoIntoBag(bagItemProto, emptyProto)) { // one from items not go to empty target bag - SendEquipError(EQUIP_ERR_NONEMPTY_BAG_OVER_OTHER_BAG, pSrcItem, pDstItem); + SendEquipError(EQUIP_ERR_BAG_IN_BAG, pSrcItem, pDstItem); return; } @@ -12890,7 +12890,7 @@ void Player::SwapItem(uint16 src, uint16 dst) if (count > emptyBag->GetBagSize()) { // too small targeted bag - SendEquipError(EQUIP_ERR_ITEMS_CANT_BE_SWAPPED, pSrcItem, pDstItem); + SendEquipError(EQUIP_ERR_CANT_SWAP, pSrcItem, pDstItem); return; } @@ -13084,16 +13084,16 @@ void Player::SendEquipError(InventoryResult msg, Item* pItem, Item* pItem2, uint data << uint32(proto ? proto->RequiredLevel : 0); break; } - case EQUIP_ERR_EVENT_AUTOEQUIP_BIND_CONFIRM: // no idea about this one... + case EQUIP_ERR_NO_OUTPUT: // no idea about this one... { data << uint64(0); // item guid data << uint32(0); // slot data << uint64(0); // container break; } - case EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_COUNT_EXCEEDED: - case EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_SOCKETED_EXCEEDED: - case EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_EQUIPPED_EXCEEDED: + case EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_COUNT_EXCEEDED_IS: + case EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_SOCKETED_EXCEEDED_IS: + case EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_EQUIPPED_EXCEEDED_IS: { ItemTemplate const* proto = pItem ? pItem->GetTemplate() : sObjectMgr->GetItemTemplate(itemid); data << uint32(proto ? proto->ItemLimitCategory : 0); @@ -14630,7 +14630,7 @@ bool Player::CanAddQuest(Quest const* quest, bool msg) InventoryResult msg2 = CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, srcitem, count); // player already have max number (in most case 1) source item, no additional item needed and quest can be added. - if (msg2 == EQUIP_ERR_CANT_CARRY_MORE_OF_THIS) + if (msg2 == EQUIP_ERR_ITEM_MAX_COUNT) return true; else if (msg2 != EQUIP_ERR_OK) { @@ -15543,7 +15543,7 @@ bool Player::GiveQuestSourceItem(Quest const* quest) return true; } // player already have max amount required item, just report success - else if (msg == EQUIP_ERR_CANT_CARRY_MORE_OF_THIS) + else if (msg == EQUIP_ERR_ITEM_MAX_COUNT) return true; else SendEquipError(msg, NULL, NULL, srcitem); @@ -17496,7 +17496,7 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timeDiff) { std::map::iterator itr = invalidBagMap.find(bagGuid); if (std::find(problematicItems.begin(),problematicItems.end(),itr->second) != problematicItems.end()) - err = EQUIP_ERR_INT_BAG_ERROR; + err = EQUIP_ERR_INTERNAL_BAG_ERROR; } else { @@ -21269,7 +21269,7 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32 { if (pProto->BuyCount * count != 1) { - SendEquipError(EQUIP_ERR_ITEM_CANT_BE_EQUIPPED, NULL, NULL); + SendEquipError(EQUIP_ERR_NOT_EQUIPPABLE, NULL, NULL); return false; } if (!_StoreOrEquipNewItem(vendorslot, item, count, bag, slot, price, pProto, creature, crItem, false)) @@ -21277,7 +21277,7 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32 } else { - SendEquipError(EQUIP_ERR_ITEM_DOESNT_GO_TO_SLOT, NULL, NULL); + SendEquipError(EQUIP_ERR_WRONG_SLOT, NULL, NULL); return false; } @@ -23963,7 +23963,7 @@ void Player::StoreLootItem(uint8 lootSlot, Loot* loot) if (!item) { - SendEquipError(EQUIP_ERR_ALREADY_LOOTED, NULL, NULL); + SendEquipError(EQUIP_ERR_LOOT_GONE, NULL, NULL); return; } @@ -24255,7 +24255,7 @@ InventoryResult Player::CanEquipUniqueItem(ItemTemplate const* itemProto, uint8 { // there is an equip limit on this item if (HasItemOrGemWithIdEquipped(itemProto->ItemId, 1, except_slot)) - return EQUIP_ERR_ITEM_UNIQUE_EQUIPABLE; + return EQUIP_ERR_ITEM_UNIQUE_EQUIPPABLE; } // check unique-equipped limit @@ -24263,12 +24263,12 @@ InventoryResult Player::CanEquipUniqueItem(ItemTemplate const* itemProto, uint8 { ItemLimitCategoryEntry const* limitEntry = sItemLimitCategoryStore.LookupEntry(itemProto->ItemLimitCategory); if (!limitEntry) - return EQUIP_ERR_ITEM_CANT_BE_EQUIPPED; + return EQUIP_ERR_NOT_EQUIPPABLE; // NOTE: limitEntry->mode not checked because if item have have-limit then it applied and to equip case if (limit_count > limitEntry->maxCount) - return EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_EQUIPPED_EXCEEDED; + return EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_EQUIPPED_EXCEEDED_IS; // there is an equip limit on this item if (HasItemOrGemWithLimitCategoryEquipped(itemProto->ItemLimitCategory, limitEntry->maxCount - limit_count + 1, except_slot)) @@ -25756,7 +25756,7 @@ uint8 Player::AddVoidStorageItem(const VoidStorageItem& item) if (slot >= VOID_STORAGE_MAX_SLOT) { GetSession()->SendVoidStorageTransferResult(VOID_TRANSFER_ERROR_FULL); - return -1; + return 255; } _voidStorageItems[slot] = new VoidStorageItem(item.ItemId, item.ItemEntry, diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index e843191832e..f66e6ff8a03 100644 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -764,13 +764,13 @@ bool Guild::PlayerMoveItemData::InitItem() // Anti-WPE protection. Do not move non-empty bags to bank. if (m_pItem->IsNotEmptyBag()) { - m_pPlayer->SendEquipError(EQUIP_ERR_CAN_ONLY_DO_WITH_EMPTY_BAGS, m_pItem); + m_pPlayer->SendEquipError(EQUIP_ERR_DESTROY_NONEMPTY_BAG, m_pItem); m_pItem = NULL; } // Bound items cannot be put into bank. else if (!m_pItem->CanBeTraded()) { - m_pPlayer->SendEquipError(EQUIP_ERR_ITEMS_CANT_BE_SWAPPED, m_pItem); + m_pPlayer->SendEquipError(EQUIP_ERR_CANT_SWAP, m_pItem); m_pItem = NULL; } } @@ -989,11 +989,11 @@ InventoryResult Guild::BankMoveItemData::CanStore(Item* pItem, bool swap) uint32 count = pItem->GetCount(); // Soulbound items cannot be moved if (pItem->IsSoulBound()) - return EQUIP_ERR_CANT_DROP_SOULBOUND; + return EQUIP_ERR_DROP_BOUND_ITEM; // Make sure destination bank tab exists if (m_container >= m_pGuild->_GetPurchasedTabsSize()) - return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG; + return EQUIP_ERR_WRONG_BAG_TYPE; // Slot explicitely specified. Check it. if (m_slotId != NULL_SLOT) @@ -1004,7 +1004,7 @@ InventoryResult Guild::BankMoveItemData::CanStore(Item* pItem, bool swap) pItemDest = NULL; if (!_ReserveSpace(m_slotId, pItem, pItemDest, count)) - return EQUIP_ERR_ITEM_CANT_STACK; + return EQUIP_ERR_CANT_STACK; if (count == 0) return EQUIP_ERR_OK; diff --git a/src/server/game/Handlers/GuildHandler.cpp b/src/server/game/Handlers/GuildHandler.cpp index 5bb7259a1cf..89a53be3e24 100755 --- a/src/server/game/Handlers/GuildHandler.cpp +++ b/src/server/game/Handlers/GuildHandler.cpp @@ -591,7 +591,7 @@ void WorldSession::HandleGuildBankSwapItems(WorldPacket & recvData) // Player <-> Bank // Allow to work with inventory only if (!Player::IsInventoryPos(playerBag, playerSlotId) && !(playerBag == NULL_BAG && playerSlotId == NULL_SLOT)) - GetPlayer()->SendEquipError(EQUIP_ERR_NONE, NULL); + GetPlayer()->SendEquipError(EQUIP_ERR_INTERNAL_BAG_ERROR, NULL); else guild->SwapItemsWithInventory(GetPlayer(), toChar, tabId, slotId, playerBag, playerSlotId, splitedAmount); } diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 640d6996bdf..621278a6948 100644 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -55,7 +55,7 @@ void WorldSession::HandleSplitItemOpcode(WorldPacket& recvData) if (!_player->IsValidPos(dstbag, dstslot, false)) // can be autostore pos { - _player->SendEquipError(EQUIP_ERR_ITEM_DOESNT_GO_TO_SLOT, NULL, NULL); + _player->SendEquipError(EQUIP_ERR_WRONG_SLOT, NULL, NULL); return; } @@ -82,7 +82,7 @@ void WorldSession::HandleSwapInvItemOpcode(WorldPacket & recvData) if (!_player->IsValidPos(INVENTORY_SLOT_BAG_0, dstslot, true)) { - _player->SendEquipError(EQUIP_ERR_ITEM_DOESNT_GO_TO_SLOT, NULL, NULL); + _player->SendEquipError(EQUIP_ERR_WRONG_SLOT, NULL, NULL); return; } @@ -134,7 +134,7 @@ void WorldSession::HandleSwapItem(WorldPacket& recvData) if (!_player->IsValidPos(dstbag, dstslot, true)) { - _player->SendEquipError(EQUIP_ERR_ITEM_DOESNT_GO_TO_SLOT, NULL, NULL); + _player->SendEquipError(EQUIP_ERR_WRONG_SLOT, NULL, NULL); return; } @@ -265,7 +265,7 @@ void WorldSession::HandleDestroyItemOpcode(WorldPacket & recvData) if (pItem->GetTemplate()->Flags & ITEM_PROTO_FLAG_INDESTRUCTIBLE) { - _player->SendEquipError(EQUIP_ERR_CANT_DROP_SOULBOUND, NULL, NULL); + _player->SendEquipError(EQUIP_ERR_DROP_BOUND_ITEM, NULL, NULL); return; } @@ -885,7 +885,7 @@ void WorldSession::HandleAutoStoreBagItemOpcode(WorldPacket& recvData) if (!_player->IsValidPos(dstbag, NULL_SLOT, false)) // can be autostore pos { - _player->SendEquipError(EQUIP_ERR_ITEM_DOESNT_GO_TO_SLOT, NULL, NULL); + _player->SendEquipError(EQUIP_ERR_WRONG_SLOT, NULL, NULL); return; } @@ -914,7 +914,7 @@ void WorldSession::HandleAutoStoreBagItemOpcode(WorldPacket& recvData) if (dest.size() == 1 && dest[0].pos == src) { // just remove grey item state - _player->SendEquipError(EQUIP_ERR_NONE, pItem, NULL); + _player->SendEquipError(EQUIP_ERR_INTERNAL_BAG_ERROR, pItem, NULL); return; } @@ -997,7 +997,7 @@ void WorldSession::HandleAutoBankItemOpcode(WorldPacket& recvPacket) if (dest.size() == 1 && dest[0].pos == pItem->GetPos()) { - _player->SendEquipError(EQUIP_ERR_NONE, pItem, NULL); + _player->SendEquipError(EQUIP_ERR_CANT_SWAP, pItem, NULL); return; } @@ -1102,44 +1102,44 @@ void WorldSession::HandleWrapItemOpcode(WorldPacket& recvData) if (item == gift) // not possable with pacjket from real client { - _player->SendEquipError(EQUIP_ERR_WRAPPED_CANT_BE_WRAPPED, item, NULL); + _player->SendEquipError(EQUIP_ERR_CANT_WRAP_WRAPPED, item, NULL); return; } if (item->IsEquipped()) { - _player->SendEquipError(EQUIP_ERR_EQUIPPED_CANT_BE_WRAPPED, item, NULL); + _player->SendEquipError(EQUIP_ERR_CANT_WRAP_EQUIPPED, item, NULL); return; } if (item->GetUInt64Value(ITEM_FIELD_GIFTCREATOR)) // HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_WRAPPED); { - _player->SendEquipError(EQUIP_ERR_WRAPPED_CANT_BE_WRAPPED, item, NULL); + _player->SendEquipError(EQUIP_ERR_CANT_WRAP_WRAPPED, item, NULL); return; } if (item->IsBag()) { - _player->SendEquipError(EQUIP_ERR_BAGS_CANT_BE_WRAPPED, item, NULL); + _player->SendEquipError(EQUIP_ERR_CANT_WRAP_BAGS, item, NULL); return; } if (item->IsSoulBound()) { - _player->SendEquipError(EQUIP_ERR_BOUND_CANT_BE_WRAPPED, item, NULL); + _player->SendEquipError(EQUIP_ERR_CANT_WRAP_BOUND, item, NULL); return; } if (item->GetMaxStackCount() != 1) { - _player->SendEquipError(EQUIP_ERR_STACKABLE_CANT_BE_WRAPPED, item, NULL); + _player->SendEquipError(EQUIP_ERR_CANT_WRAP_STACKABLE, item, NULL); return; } // maybe not correct check (it is better than nothing) - if (item->GetTemplate()->MaxCount>0) + if (item->GetTemplate()->MaxCount > 0) { - _player->SendEquipError(EQUIP_ERR_UNIQUE_CANT_BE_WRAPPED, item, NULL); + _player->SendEquipError(EQUIP_ERR_CANT_WRAP_UNIQUE, item, NULL); return; } diff --git a/src/server/game/Handlers/LootHandler.cpp b/src/server/game/Handlers/LootHandler.cpp index 8641880db59..aa4b7b85023 100755 --- a/src/server/game/Handlers/LootHandler.cpp +++ b/src/server/game/Handlers/LootHandler.cpp @@ -483,7 +483,7 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPacket& recvData) ItemPosCountVec dest; InventoryResult msg = target->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, item.itemid, item.count); if (item.follow_loot_rules && !item.AllowedForPlayer(target)) - msg = EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM; + msg = EQUIP_ERR_CANT_EQUIP_EVER; if (msg != EQUIP_ERR_OK) { target->SendEquipError(msg, NULL, NULL, item.itemid); diff --git a/src/server/game/Handlers/MailHandler.cpp b/src/server/game/Handlers/MailHandler.cpp index 0722a9c1e00..4d16fb27bec 100644 --- a/src/server/game/Handlers/MailHandler.cpp +++ b/src/server/game/Handlers/MailHandler.cpp @@ -259,7 +259,7 @@ void WorldSession::HandleSendMail(WorldPacket& recvData) if (item->IsBoundAccountWide() && item->IsSoulBound() && player->GetSession()->GetAccountId() != rc_account) { - player->SendMailResult(0, MAIL_SEND, MAIL_ERR_EQUIP_ERROR, EQUIP_ERR_ARTEFACTS_ONLY_FOR_OWN_CHARACTERS); + player->SendMailResult(0, MAIL_SEND, MAIL_ERR_EQUIP_ERROR, EQUIP_ERR_NOT_SAME_ACCOUNT); return; } @@ -277,7 +277,7 @@ void WorldSession::HandleSendMail(WorldPacket& recvData) if (item->IsNotEmptyBag()) { - player->SendMailResult(0, MAIL_SEND, MAIL_ERR_EQUIP_ERROR, EQUIP_ERR_CAN_ONLY_DO_WITH_EMPTY_BAGS); + player->SendMailResult(0, MAIL_SEND, MAIL_ERR_EQUIP_ERROR, EQUIP_ERR_DESTROY_NONEMPTY_BAG); return; } diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp index 079a4e2422d..6aeb61b222b 100755 --- a/src/server/game/Handlers/SpellHandler.cpp +++ b/src/server/game/Handlers/SpellHandler.cpp @@ -228,7 +228,7 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket) // Verify that the bag is an actual bag or wrapped item that can be used "normally" if (!(proto->Flags & ITEM_PROTO_FLAG_OPENABLE) && !item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED)) { - pUser->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL); + pUser->SendEquipError(EQUIP_ERR_CLIENT_LOCKED_OUT, item, NULL); sLog->outError(LOG_FILTER_NETWORKIO, "Possible hacking attempt: Player %s [guid: %u] tried to open item [guid: %u, entry: %u] which is not openable!", pUser->GetName(), pUser->GetGUIDLow(), item->GetGUIDLow(), proto->ItemId); return; diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 406fc78a3ee..31129cf98d4 100755 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -791,14 +791,14 @@ void Aura::SetCharges(uint8 charges) uint8 Aura::CalcMaxCharges(Unit* caster) const { - uint8 maxProcCharges = m_spellInfo->ProcCharges; + uint32 maxProcCharges = m_spellInfo->ProcCharges; if (SpellProcEntry const* procEntry = sSpellMgr->GetSpellProcEntry(GetId())) maxProcCharges = procEntry->charges; if (caster) if (Player* modOwner = caster->GetSpellModOwner()) modOwner->ApplySpellMod(GetId(), SPELLMOD_CHARGES, maxProcCharges); - return maxProcCharges; + return uint8(maxProcCharges); } bool Aura::ModCharges(int32 num, AuraRemoveMode removeMode) diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index cbbc96b99d7..d1af1832ce4 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -1549,7 +1549,7 @@ void Spell::DoCreateItem(uint32 /*i*/, uint32 itemtype) if (msg != EQUIP_ERR_OK) { // convert to possible store amount - if (msg == EQUIP_ERR_INVENTORY_FULL || msg == EQUIP_ERR_CANT_CARRY_MORE_OF_THIS) + if (msg == EQUIP_ERR_INV_FULL || msg == EQUIP_ERR_ITEM_MAX_COUNT) num_to_add -= no_space; else { @@ -2070,9 +2070,9 @@ void Spell::EffectSummonChangeItem(SpellEffIndex effIndex) uint8 msg = player->CanEquipItem(m_CastItem->GetSlot(), dest, pNewItem, true); - if (msg == EQUIP_ERR_OK || msg == EQUIP_ERR_CANT_DO_RIGHT_NOW) + if (msg == EQUIP_ERR_OK || msg == EQUIP_ERR_CLIENT_LOCKED_OUT) { - if (msg == EQUIP_ERR_CANT_DO_RIGHT_NOW) dest = EQUIPMENT_SLOT_MAINHAND; + if (msg == EQUIP_ERR_CLIENT_LOCKED_OUT) dest = EQUIPMENT_SLOT_MAINHAND; // prevent crash at access and unexpected charges counting with item update queue corrupt if (m_CastItem == m_targets.GetItemTarget()) diff --git a/src/server/scripts/World/item_scripts.cpp b/src/server/scripts/World/item_scripts.cpp index d888e6cb56b..e7883f4f11f 100644 --- a/src/server/scripts/World/item_scripts.cpp +++ b/src/server/scripts/World/item_scripts.cpp @@ -75,7 +75,7 @@ public: return false; // error - player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL); + player->SendEquipError(EQUIP_ERR_CLIENT_LOCKED_OUT, item, NULL); return true; } }; @@ -118,7 +118,7 @@ public: targets.GetUnitTarget()->GetEntry() == 20748 && !targets.GetUnitTarget()->HasAura(32578)) return false; - player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL); + player->SendEquipError(EQUIP_ERR_CLIENT_LOCKED_OUT, item, NULL); return true; } }; @@ -267,15 +267,13 @@ class item_petrov_cluster_bombs : public ItemScript public: item_petrov_cluster_bombs() : ItemScript("item_petrov_cluster_bombs") { } - bool OnUse(Player* player, Item* item, const SpellCastTargets & /*targets*/) + bool OnUse(Player* player, Item* /*item*/, const SpellCastTargets & /*targets*/) { if (player->GetZoneId() != ZONE_ID_HOWLING) return false; if (!player->GetTransport() || player->GetAreaId() != AREA_ID_SHATTERED_STRAITS) { - player->SendEquipError(EQUIP_ERR_NONE, item, NULL); - if (const SpellInfo* spellInfo = sSpellMgr->GetSpellInfo(SPELL_PETROV_BOMB)) Spell::SendCastResult(player, spellInfo, 1, SPELL_FAILED_NOT_HERE); @@ -380,7 +378,7 @@ public: } else player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, item, NULL); } else - player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL); + player->SendEquipError(EQUIP_ERR_CLIENT_LOCKED_OUT, item, NULL); return true; } }; @@ -406,7 +404,7 @@ public: player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, item, NULL); } else - player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL); + player->SendEquipError(EQUIP_ERR_CLIENT_LOCKED_OUT, item, NULL); return true; } }; diff --git a/src/server/scripts/World/npc_professions.cpp b/src/server/scripts/World/npc_professions.cpp index 74f615a87d1..e6ac4a3a2a1 100644 --- a/src/server/scripts/World/npc_professions.cpp +++ b/src/server/scripts/World/npc_professions.cpp @@ -361,7 +361,7 @@ void ProcessUnlearnAction(Player* player, Creature* creature, uint32 spellId, ui player->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, creature, 0, 0); } else - player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, NULL, NULL); + player->SendEquipError(EQUIP_ERR_CLIENT_LOCKED_OUT, NULL, NULL); player->CLOSE_GOSSIP_MENU(); } -- cgit v1.2.3 From 5dc3ccbeab402e8f81cf0b8b38ff6cb252139aa4 Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 20 Aug 2012 15:55:24 +0200 Subject: Core/Items: Destroy only one item from stack when inserting a gem, not entire stack --- src/server/game/Handlers/ItemHandler.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 621278a6948..ad8846ab071 100644 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -1357,9 +1357,10 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recvData) { if (GemEnchants[i]) { + uint32 gemCount = 1; itemTarget->SetEnchantment(EnchantmentSlot(SOCK_ENCHANTMENT_SLOT+i), GemEnchants[i], 0, 0); if (Item* guidItem = _player->GetItemByGuid(gem_guids[i])) - _player->DestroyItem(guidItem->GetBagSlot(), guidItem->GetSlot(), true); + _player->DestroyItemCount(guidItem, gemCount, true); } } -- cgit v1.2.3 From 5b525cb0eebe9b7a6d09b51b742bca02e3b2db0c Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 20 Aug 2012 15:56:02 +0200 Subject: Core/Items: Updated purchasing items from vendor, will no longer buy 20 stacks if item is sold in stacks of 20 --- src/server/game/Entities/Player/Player.cpp | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index a46e7806961..6830a7a0db0 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -20965,7 +20965,7 @@ inline bool Player::_StoreOrEquipNewItem(uint32 vendorslot, uint32 item, uint8 c ItemPosCountVec vDest; uint16 uiDest = 0; InventoryResult msg = bStore ? - CanStoreNewItem(bag, slot, vDest, item, pProto->BuyCount * count) : + CanStoreNewItem(bag, slot, vDest, item, count) : CanEquipNewItem(slot, uiDest, item, false); if (msg != EQUIP_ERR_OK) { @@ -20981,7 +20981,7 @@ inline bool Player::_StoreOrEquipNewItem(uint32 vendorslot, uint32 item, uint8 c for (int i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i) { if (iece->RequiredItem[i]) - DestroyItemCount(iece->RequiredItem[i], iece->RequiredItem[i], true); + DestroyItemCount(iece->RequiredItem[i], iece->RequiredItemCount[i], true); } for (int i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i) @@ -20996,7 +20996,7 @@ inline bool Player::_StoreOrEquipNewItem(uint32 vendorslot, uint32 item, uint8 c EquipNewItem(uiDest, item, true); if (it) { - uint32 new_count = pVendor->UpdateVendorItemCurrentCount(crItem, pProto->BuyCount * count); + uint32 new_count = pVendor->UpdateVendorItemCurrentCount(crItem, count); WorldPacket data(SMSG_BUY_ITEM, (8+4+4+4)); data << uint64(pVendor->GetGUID()); @@ -21004,7 +21004,7 @@ inline bool Player::_StoreOrEquipNewItem(uint32 vendorslot, uint32 item, uint8 c data << int32(crItem->maxcount > 0 ? new_count : 0xFFFFFFFF); data << uint32(count); GetSession()->SendPacket(&data); - SendNewItem(it, pProto->BuyCount * count, true, false, false); + SendNewItem(it, count, true, false, false); if (!bStore) AutoUnequipOffhandIfNeed(); @@ -21062,7 +21062,7 @@ bool Player::BuyCurrencyFromVendorSlot(uint64 vendorGuid, uint32 vendorSlot, uin VendorItem const* crItem = vItems->GetItem(vendorSlot); // store diff item (cheating) - if (!crItem || crItem->item != currency || crItem->Type != 2) + if (!crItem || crItem->item != currency || crItem->Type != ITEM_VENDOR_TYPE_CURRENCY) { SendBuyError(BUY_ERR_CANT_FIND_ITEM, creature, currency, 0); return false; @@ -21100,7 +21100,7 @@ bool Player::BuyCurrencyFromVendorSlot(uint64 vendorGuid, uint32 vendorSlot, uin uint32 precision = (entry->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? 100 : 1; - if (HasCurrency(iece->RequiredCurrency[i], (iece->RequiredCurrencyCount[i] * count) / precision)) + if (!HasCurrency(iece->RequiredCurrency[i], (iece->RequiredCurrencyCount[i] * count) / precision)) { SendEquipError(EQUIP_ERR_VENDOR_MISSING_TURNINS, NULL, NULL); // Find correct error return false; @@ -21193,6 +21193,13 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32 if (crItem->ExtendedCost) { + // Can only buy full stacks for extended cost + if (pProto->BuyCount != count) + { + SendEquipError(EQUIP_ERR_CANT_BUY_QUANTITY, NULL, NULL); + return false; + } + ItemExtendedCostEntry const* iece = sItemExtendedCostStore.LookupEntry(crItem->ExtendedCost); if (!iece) { @@ -21223,9 +21230,9 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32 uint32 precision = (entry->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? 100 : 1; - if (HasCurrency(iece->RequiredCurrency[i], (iece->RequiredCurrencyCount[i] * count) / precision)) + if (!HasCurrency(iece->RequiredCurrency[i], (iece->RequiredCurrencyCount[i] * count) / precision)) { - SendEquipError(EQUIP_ERR_VENDOR_MISSING_TURNINS, NULL, NULL); // error not verified for currencies + SendEquipError(EQUIP_ERR_VENDOR_MISSING_TURNINS, NULL, NULL); return false; } } @@ -21267,7 +21274,7 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32 } else if (IsEquipmentPos(bag, slot)) { - if (pProto->BuyCount * count != 1) + if (count != 1) { SendEquipError(EQUIP_ERR_NOT_EQUIPPABLE, NULL, NULL); return false; -- cgit v1.2.3 From 460f42849fa3eb2eb83d6e580b1c34fc59f9d0f6 Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 20 Aug 2012 14:57:59 +0100 Subject: DB/Schema: Increase size of quest_template.RequiredRaces to mediumint needed because Worgen race is 1 << (22-1) --- sql/updates/world/2012_08_20_00_world_quest_template.sql | 1 + src/server/game/Quests/QuestDef.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 sql/updates/world/2012_08_20_00_world_quest_template.sql (limited to 'src') diff --git a/sql/updates/world/2012_08_20_00_world_quest_template.sql b/sql/updates/world/2012_08_20_00_world_quest_template.sql new file mode 100644 index 00000000000..ddd447acc50 --- /dev/null +++ b/sql/updates/world/2012_08_20_00_world_quest_template.sql @@ -0,0 +1 @@ +ALTER TABLE `quest_template` CHANGE `RequiredRaces` `RequiredRaces` mediumint(8) unsigned NOT NULL DEFAULT '0'; diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index c694e964e20..2a16756161b 100755 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -33,7 +33,7 @@ Quest::Quest(Field* questRecord) SuggestedPlayers = questRecord[7].GetUInt8(); LimitTime = questRecord[8].GetUInt32(); RequiredClasses = questRecord[9].GetUInt16(); - RequiredRaces = questRecord[10].GetUInt16(); + RequiredRaces = questRecord[10].GetUInt32(); RequiredSkillId = questRecord[11].GetUInt16(); RequiredSkillPoints = questRecord[12].GetUInt16(); RequiredFactionId1 = questRecord[13].GetUInt16(); -- cgit v1.2.3 From 9985493dde19bab8877b15a78fd907765cc5b2de Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 21 Aug 2012 13:29:55 +0200 Subject: Core/PacketIO: Fixed SMSG_ACTION_BUTTONS sent before talent spec swap --- src/server/game/Entities/Player/Player.cpp | 6 ++++-- src/server/game/Entities/Player/Player.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 7ff1438fdc0..87dd1c51737 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -6651,8 +6651,8 @@ void Player::SendActionButtons(uint32 state) const WorldPacket data(SMSG_ACTION_BUTTONS, 1+(MAX_ACTION_BUTTONS*4)); /* state can be 0, 1, 2 - 0 - Looks to be sent when initial action buttons get sent, however on Trinity we use 1 since 0 had some difficulties - 1 - Used in any SMSG_ACTION_BUTTONS packet with button data on Trinity. Only used after spec swaps on retail. + 0 - Sends initial action buttons, client does not validate if we have the spell or not + 1 - Used used after spec swaps, client validates if a spell is known. 2 - Clears the action bars client sided. This is sent during spec swap before unlearning and before sending the new buttons */ if (state != 2) @@ -6666,6 +6666,8 @@ void Player::SendActionButtons(uint32 state) const data << uint32(0); } } + else + data.resize(MAX_ACTION_BUTTONS * 4); // insert crap, client doesnt even parse this for state == 2 data << uint8(state); GetSession()->SendPacket(&data); diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 565a67c3631..cd6334714df 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1828,7 +1828,7 @@ class Player : public Unit, public GridObject ActionButton* addActionButton(uint8 button, uint32 action, uint8 type); void removeActionButton(uint8 button); ActionButton const* GetActionButton(uint8 button); - void SendInitialActionButtons() const { SendActionButtons(1); } + void SendInitialActionButtons() const { SendActionButtons(0); } void SendActionButtons(uint32 state) const; bool IsActionButtonDataValid(uint8 button, uint32 action, uint8 type); -- cgit v1.2.3 From cbe6375850586acc240ff741221f0710e78104a5 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 21 Aug 2012 15:16:49 +0200 Subject: Core/Auras: Implemented scaling auras with target's level --- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 2 +- src/server/game/Spells/Spell.cpp | 3 +-- src/server/game/Spells/SpellInfo.cpp | 19 ++++++++++++------- 3 files changed, 14 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index a25d8905f14..e9c498392ee 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -471,7 +471,7 @@ int32 AuraEffect::CalculateAmount(Unit* caster) { int32 amount; // default amount calculation - amount = m_spellInfo->Effects[m_effIndex].CalcValue(caster, &m_baseAmount, NULL); + amount = m_spellInfo->Effects[m_effIndex].CalcValue(caster, &m_baseAmount, GetBase()->GetOwner()->ToUnit()); // check item enchant aura cast if (!amount && caster) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 97789626987..46f735d26f1 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -4636,8 +4636,7 @@ void Spell::HandleEffects(Unit* pUnitTarget, Item* pItemTarget, GameObject* pGOT sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell: %u Effect : %u", m_spellInfo->Id, eff); - // we do not need DamageMultiplier here. - damage = CalculateDamage(i, NULL); + damage = CalculateDamage(i, unitTarget); bool preventDefault = CallScriptEffectHandlers((SpellEffIndex)i, mode); diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index d71de9e94e0..53ce893f0a0 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -406,7 +406,7 @@ bool SpellEffectInfo::IsUnitOwnedAuraEffect() const return IsAreaAuraEffect() || Effect == SPELL_EFFECT_APPLY_AURA; } -int32 SpellEffectInfo::CalcValue(Unit const* caster, int32 const* bp, Unit const* /*target*/) const +int32 SpellEffectInfo::CalcValue(Unit const* caster, int32 const* bp, Unit const* target) const { float basePointsPerLevel = RealPointsPerLevel; int32 basePoints = bp ? *bp : BasePoints; @@ -417,14 +417,18 @@ int32 SpellEffectInfo::CalcValue(Unit const* caster, int32 const* bp, Unit const { if (caster) { + uint32 level = caster->getLevel(); + if (target && _spellInfo->IsPositiveEffect(_effIndex) && (Effect == SPELL_EFFECT_APPLY_AURA)) + level = target->getLevel(); + SpellScalingEntry const* scaling = _spellInfo->GetSpellScaling(); // must exist, otherwise ScalingMultiplier == 0.0f - if (GtSpellScalingEntry const* gtScaling = sGtSpellScalingStore.LookupEntry((scaling->playerClass != -1 ? scaling->playerClass - 1 : MAX_CLASSES - 1) * 100 + caster->getLevel() - 1)) + if (GtSpellScalingEntry const* gtScaling = sGtSpellScalingStore.LookupEntry((scaling->playerClass != -1 ? scaling->playerClass - 1 : MAX_CLASSES - 1) * 100 + level - 1)) { float multiplier = gtScaling->value; - if (scaling->castTimeMax > 0 && scaling->castScalingMaxLevel > caster->getLevel()) - multiplier *= float(scaling->castTimeMin + (caster->getLevel() - 1) * (scaling->castTimeMax - scaling->castTimeMin) / (scaling->castScalingMaxLevel - 1)) / float(scaling->castTimeMax); - if (scaling->CoefLevelBase > caster->getLevel()) - multiplier *= (1.0f - scaling->CoefBase) * (float)(caster->getLevel() - 1) / (float)(scaling->CoefLevelBase - 1) + scaling->CoefBase; + if (scaling->castTimeMax > 0 && scaling->castScalingMaxLevel > level) + multiplier *= float(scaling->castTimeMin + (level - 1) * (scaling->castTimeMax - scaling->castTimeMin) / (scaling->castScalingMaxLevel - 1)) / float(scaling->castTimeMax); + if (scaling->CoefLevelBase > level) + multiplier *= (1.0f - scaling->CoefBase) * (float)(level - 1) / (float)(scaling->CoefLevelBase - 1) + scaling->CoefBase; float preciseBasePoints = ScalingMultiplier * multiplier; if (DeltaScalingMultiplier) @@ -2257,7 +2261,8 @@ SpellInfo const* SpellInfo::GetAuraRankForLevel(uint8 level) const if (IsPositiveEffect(i) && (Effects[i].Effect == SPELL_EFFECT_APPLY_AURA || Effects[i].Effect == SPELL_EFFECT_APPLY_AREA_AURA_PARTY || - Effects[i].Effect == SPELL_EFFECT_APPLY_AREA_AURA_RAID)) + Effects[i].Effect == SPELL_EFFECT_APPLY_AREA_AURA_RAID) && + !Effects[i].ScalingMultiplier) { needRankSelection = true; break; -- cgit v1.2.3 From 58ee30d7387c3b4a5b06ce76bdfa3d54167d132c Mon Sep 17 00:00:00 2001 From: Hexit Date: Tue, 21 Aug 2012 22:21:31 +0100 Subject: Tools: Fix compile for extractors tools on Linux Closes #7378 --- src/tools/map_extractor/System.cpp | 1 + src/tools/vmap4_extractor/mpqfile.h | 1 + src/tools/vmap4_extractor/vmapexport.cpp | 1 + 3 files changed, 3 insertions(+) (limited to 'src') diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp index 681013da18b..007734afb94 100644 --- a/src/tools/map_extractor/System.cpp +++ b/src/tools/map_extractor/System.cpp @@ -9,6 +9,7 @@ #include "direct.h" #else #include +#define ERROR_PATH_NOT_FOUND ERROR_FILE_NOT_FOUND #endif #include "StormLib.h" diff --git a/src/tools/vmap4_extractor/mpqfile.h b/src/tools/vmap4_extractor/mpqfile.h index 115d096a215..dfd1b713c97 100644 --- a/src/tools/vmap4_extractor/mpqfile.h +++ b/src/tools/vmap4_extractor/mpqfile.h @@ -11,6 +11,7 @@ #include #include #include +#include "StormLib.h" #ifdef _WIN32 #include // mainly only HANDLE definition is required diff --git a/src/tools/vmap4_extractor/vmapexport.cpp b/src/tools/vmap4_extractor/vmapexport.cpp index c1e4ee26650..489655659c3 100644 --- a/src/tools/vmap4_extractor/vmapexport.cpp +++ b/src/tools/vmap4_extractor/vmapexport.cpp @@ -30,6 +30,7 @@ #define mkdir _mkdir #else #include + #define ERROR_PATH_NOT_FOUND ERROR_FILE_NOT_FOUND #endif #undef min -- cgit v1.2.3 From df2d42e5c7619e0eb5bc9e22ab23d32facbb33ca Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 21 Aug 2012 22:23:45 +0100 Subject: Tools: Use correct flags in mkdir --- src/tools/map_extractor/System.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp index 007734afb94..448cf2320b2 100644 --- a/src/tools/map_extractor/System.cpp +++ b/src/tools/map_extractor/System.cpp @@ -108,7 +108,7 @@ void CreateDir(std::string const& path) #ifdef _WIN32 _mkdir(path.c_str()); #else - mkdir(path.c_str(), 777); + mkdir(path.c_str(), S_IRWXU | S_IRWXG | S_IRWXO); // 0777 #endif } -- cgit v1.2.3 From e3ea3b28bd6d505495908899de154dcf92a219d8 Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 21 Aug 2012 23:40:38 +0100 Subject: Merge remote-tracking branch 'origin/master' into 4.3.4 Conflicts: src/server/game/Groups/Group.cpp src/server/game/Handlers/BattleGroundHandler.cpp src/server/game/Handlers/MailHandler.cpp src/server/game/Handlers/MiscHandler.cpp src/server/game/Server/Protocol/Opcodes.cpp src/server/game/Server/Protocol/Opcodes.h src/server/game/Server/WorldSession.cpp src/server/game/Server/WorldSocket.cpp src/server/worldserver/worldserver.conf.dist --- .../2012_08_16_00_world_creature_template.sql | 3 + sql/updates/world/2012_08_21_01_world_command.sql | 3 + .../2012_08_21_02_world_wintergrasp_conditions.sql | 23 +++++ src/server/authserver/Main.cpp | 16 ++- src/server/authserver/authserver.conf.dist | 4 +- src/server/game/AI/CoreAI/GameObjectAI.h | 5 + src/server/game/AI/CreatureAISelector.cpp | 5 + src/server/game/Achievements/AchievementMgr.cpp | 4 +- src/server/game/Battlefield/Battlefield.cpp | 16 +-- .../game/Battlefield/Zones/BattlefieldWG.cpp | 4 +- src/server/game/Battlefield/Zones/BattlefieldWG.h | 88 +++++++++-------- src/server/game/Battlegrounds/ArenaTeam.cpp | 2 +- src/server/game/Battlegrounds/Battleground.cpp | 2 +- src/server/game/Entities/GameObject/GameObject.cpp | 9 +- src/server/game/Entities/GameObject/GameObject.h | 1 + src/server/game/Entities/Object/Object.cpp | 7 +- src/server/game/Entities/Player/Player.cpp | 13 ++- src/server/game/Entities/Player/Player.h | 6 +- src/server/game/Entities/Vehicle/Vehicle.h | 4 + src/server/game/Globals/ObjectAccessor.h | 1 + src/server/game/Groups/Group.cpp | 62 ++++++------ src/server/game/Groups/Group.h | 2 +- src/server/game/Handlers/AuctionHouseHandler.cpp | 4 +- src/server/game/Handlers/BattleGroundHandler.cpp | 49 --------- src/server/game/Handlers/ChatHandler.cpp | 4 +- src/server/game/Handlers/MailHandler.cpp | 6 +- src/server/game/Handlers/MiscHandler.cpp | 50 +++++++++- src/server/game/Scripting/ScriptLoader.cpp | 2 + src/server/game/Scripting/ScriptMgr.cpp | 16 +-- src/server/game/Server/Protocol/Opcodes.h | 9 ++ src/server/game/Server/WorldSession.cpp | 81 +++++++-------- src/server/game/Server/WorldSession.h | 4 +- src/server/game/Server/WorldSocket.cpp | 110 ++++++++++----------- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 3 +- src/server/game/Spells/Spell.cpp | 4 +- src/server/game/Spells/SpellEffects.cpp | 1 + src/server/game/Spells/SpellMgr.cpp | 16 +++ src/server/game/Warden/Warden.cpp | 5 +- src/server/game/Warden/WardenMac.cpp | 4 +- src/server/game/Warden/WardenWin.cpp | 16 +-- src/server/game/World/World.cpp | 2 +- src/server/scripts/Commands/CMakeLists.txt | 1 + src/server/scripts/Commands/cs_ban.cpp | 4 +- src/server/scripts/Commands/cs_quest.cpp | 35 ++++++- .../TrialOfTheCrusader/boss_anubarak_trial.cpp | 12 +-- .../TrialOfTheCrusader/boss_lord_jaraxxus.cpp | 14 +-- .../TrialOfTheCrusader/boss_northrend_beasts.cpp | 16 ++- .../TrialOfTheCrusader/boss_twin_valkyr.cpp | 6 +- .../instance_trial_of_the_crusader.cpp | 11 +++ .../TrialOfTheCrusader/trial_of_the_crusader.cpp | 2 +- .../TrialOfTheCrusader/trial_of_the_crusader.h | 4 +- src/server/scripts/Northrend/wintergrasp.cpp | 35 +++---- src/server/worldserver/Master.cpp | 2 +- src/server/worldserver/worldserver.conf.dist | 64 +++++++++++- 54 files changed, 531 insertions(+), 341 deletions(-) create mode 100644 sql/updates/world/2012_08_16_00_world_creature_template.sql create mode 100644 sql/updates/world/2012_08_21_01_world_command.sql create mode 100644 sql/updates/world/2012_08_21_02_world_wintergrasp_conditions.sql (limited to 'src') diff --git a/sql/updates/world/2012_08_16_00_world_creature_template.sql b/sql/updates/world/2012_08_16_00_world_creature_template.sql new file mode 100644 index 00000000000..732f647d7b7 --- /dev/null +++ b/sql/updates/world/2012_08_16_00_world_creature_template.sql @@ -0,0 +1,3 @@ +-- Added trigger flags to triggers +UPDATE `creature_template` SET `flags_extra` = flags_extra | 128 WHERE `entry` = 34862; +UPDATE `creature_template` SET `unit_flags` = unit_flags | 256 WHERE `entry` = 34862; diff --git a/sql/updates/world/2012_08_21_01_world_command.sql b/sql/updates/world/2012_08_21_01_world_command.sql new file mode 100644 index 00000000000..df833d2d246 --- /dev/null +++ b/sql/updates/world/2012_08_21_01_world_command.sql @@ -0,0 +1,3 @@ +DELETE FROM `command` WHERE name='quest reward'; +INSERT INTO `command` (`name`,`security`,`help`) VALUES +('quest reward',3,'Syntax: .quest reward #questId\n\n\Grants quest reward to selected player and removes quest from his log (quest must be in completed state).'); diff --git a/sql/updates/world/2012_08_21_02_world_wintergrasp_conditions.sql b/sql/updates/world/2012_08_21_02_world_wintergrasp_conditions.sql new file mode 100644 index 00000000000..caf8a0cc1e4 --- /dev/null +++ b/sql/updates/world/2012_08_21_02_world_wintergrasp_conditions.sql @@ -0,0 +1,23 @@ +-- Conditions +-- Add gossip_menu condition for 9904 Horde +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup` IN (9904,9923); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`NegativeCondition`) VALUES +(14,9904,13759,0,1,33280,0), -- Must have Rank 1: Corporal +(14,9904,13759,1,1,55629,0), -- Or must have Rank 2: First Lieutenant +(14,9904,13761,0,1,33280,1), -- Must not have Rank 1: Corporal +(14,9904,13761,0,1,55629,1), -- Must not have Rank 2: First Lieutenant +-- Add gossip_menu condition for 9923 Alliance +(14,9923,13798,0,1,33280,0), -- Must have Rank 1: Corporal +(14,9923,13798,1,1,55629,0), -- Or must have Rank 2: First Lieutenant +(14,9923,14172,0,1,33280,1), -- Must not have Rank 1: Corporal +(14,9923,14172,0,1,55629,1), -- Must not have Rank 2: First Lieutenant +-- Add conditions to gossip options horde +(15,9904,0,0,1,33280,0), -- Must have reached Rank 1: Corporal +(15,9904,0,1,1,55629,0), -- Or must have reached Rank 2: First Lieutenant +(15,9904,1,0,1,55629,0), -- Must have reached Rank 2: First Lieutenant +(15,9904,2,0,1,55629,0), -- Must have reached Rank 2: First Lieutenant +-- Add conditions to gossip options alliance +(15,9923,0,0,1,33280,0), -- Must have reached Rank 1: Corporal +(15,9923,0,1,1,55629,0), -- Or must have reached Rank 2: First Lieutenant +(15,9923,1,0,1,55629,0), -- Must have reached Rank 2: First Lieutenant +(15,9923,2,0,1,55629,0); -- Must have reached Rank 2: First Lieutenant diff --git a/src/server/authserver/Main.cpp b/src/server/authserver/Main.cpp index f5a3c7cf7e1..b938706a0be 100755 --- a/src/server/authserver/Main.cpp +++ b/src/server/authserver/Main.cpp @@ -141,10 +141,16 @@ extern int main(int argc, char **argv) // Launch the listening network socket RealmAcceptor acceptor; - uint16 rmport = ConfigMgr::GetIntDefault("RealmServerPort", 3724); + int32 rmport = ConfigMgr::GetIntDefault("RealmServerPort", 3724); + if (rmport < 0 || rmport > 0xFFFF) + { + sLog->outError(LOG_FILTER_AUTHSERVER, "Specified port out of allowed range (1-65535)"); + return 1; + } + std::string bind_ip = ConfigMgr::GetStringDefault("BindIP", "0.0.0.0"); - ACE_INET_Addr bind_addr(rmport, bind_ip.c_str()); + ACE_INET_Addr bind_addr(uint16(rmport), bind_ip.c_str()); if (acceptor.open(bind_addr, ACE_Reactor::instance(), ACE_NONBLOCK) == -1) { @@ -238,14 +244,14 @@ bool StartDB() return false; } - uint8 worker_threads = ConfigMgr::GetIntDefault("LoginDatabase.WorkerThreads", 1); + int32 worker_threads = ConfigMgr::GetIntDefault("LoginDatabase.WorkerThreads", 1); if (worker_threads < 1 || worker_threads > 32) { sLog->outError(LOG_FILTER_AUTHSERVER, "Improper value specified for LoginDatabase.WorkerThreads, defaulting to 1."); worker_threads = 1; } - uint8 synch_threads = ConfigMgr::GetIntDefault("LoginDatabase.SynchThreads", 1); + int32 synch_threads = ConfigMgr::GetIntDefault("LoginDatabase.SynchThreads", 1); if (synch_threads < 1 || synch_threads > 32) { sLog->outError(LOG_FILTER_AUTHSERVER, "Improper value specified for LoginDatabase.SynchThreads, defaulting to 1."); @@ -253,7 +259,7 @@ bool StartDB() } // NOTE: While authserver is singlethreaded you should keep synch_threads == 1. Increasing it is just silly since only 1 will be used ever. - if (!LoginDatabase.Open(dbstring.c_str(), worker_threads, synch_threads)) + if (!LoginDatabase.Open(dbstring.c_str(), uint8(worker_threads), uint8(synch_threads))) { sLog->outError(LOG_FILTER_AUTHSERVER, "Cannot connect to database"); return false; diff --git a/src/server/authserver/authserver.conf.dist b/src/server/authserver/authserver.conf.dist index 9a4beca9bf6..ee7e5970155 100644 --- a/src/server/authserver/authserver.conf.dist +++ b/src/server/authserver/authserver.conf.dist @@ -205,8 +205,8 @@ LoginDatabase.WorkerThreads = 1 # w - (Overwrite) # -Appender.Console=1,2,6 -Appender.Auth=2,2,7,Auth.log,w +Appender.Console=1,2,0 +Appender.Auth=2,2,0,Auth.log,w # LogLevel # 0 - (Disabled) diff --git a/src/server/game/AI/CoreAI/GameObjectAI.h b/src/server/game/AI/CoreAI/GameObjectAI.h index fbc8675cc47..6dfea9ac158 100644 --- a/src/server/game/AI/CoreAI/GameObjectAI.h +++ b/src/server/game/AI/CoreAI/GameObjectAI.h @@ -39,6 +39,11 @@ class GameObjectAI virtual void Reset() {}; + // Pass parameters between AI + virtual void DoAction(const int32 /*param = 0 */) {} + virtual void SetGUID(const uint64& /*guid*/, int32 /*id = 0 */) {} + virtual uint64 GetGUID(int32 /*id = 0 */) { return 0; } + static int Permissible(GameObject const* go); virtual bool GossipHello(Player* /*player*/) { return false; } diff --git a/src/server/game/AI/CreatureAISelector.cpp b/src/server/game/AI/CreatureAISelector.cpp index 2d69f1e0243..4ccaa174e67 100755 --- a/src/server/game/AI/CreatureAISelector.cpp +++ b/src/server/game/AI/CreatureAISelector.cpp @@ -137,6 +137,11 @@ namespace FactorySelector ai_factory = ai_registry.GetRegistryItem(go->GetAIName()); + // scriptname in db + if (!ai_factory) + if (GameObjectAI* scriptedAI = sScriptMgr->GetGameObjectAI(go)) + return scriptedAI; + //future goAI types go here std::string ainame = (ai_factory == NULL || go->GetScriptId()) ? "NullGameObjectAI" : ai_factory->key(); diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 30b6de3fc4d..7a73b9f8f69 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -342,14 +342,14 @@ bool AchievementCriteriaData::Meets(uint32 criteria_id, Player const* source, Un Map* map = source->GetMap(); if (!map->IsDungeon()) { - sLog->outError(LOG_FILTER_SQL, "Achievement system call ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT (%u) for achievement criteria %u for non-dungeon/non-raid map %u", + sLog->outError(LOG_FILTER_ACHIEVEMENTSYS, "Achievement system call ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT (%u) for achievement criteria %u for non-dungeon/non-raid map %u", ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT, criteria_id, map->GetId()); return false; } InstanceScript* instance = ((InstanceMap*)map)->GetInstanceScript(); if (!instance) { - sLog->outError(LOG_FILTER_SQL, "Achievement system call ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT (%u) for achievement criteria %u for map %u but map does not have a instance script", + sLog->outError(LOG_FILTER_ACHIEVEMENTSYS, "Achievement system call ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT (%u) for achievement criteria %u for map %u but map does not have a instance script", ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT, criteria_id, map->GetId()); return false; } diff --git a/src/server/game/Battlefield/Battlefield.cpp b/src/server/game/Battlefield/Battlefield.cpp index cdb8e1999fe..d159580d189 100644 --- a/src/server/game/Battlefield/Battlefield.cpp +++ b/src/server/game/Battlefield/Battlefield.cpp @@ -280,7 +280,7 @@ void Battlefield::InitStalker(uint32 entry, float x, float y, float z, float o) if (Creature* creature = SpawnCreature(entry, x, y, z, o, TEAM_NEUTRAL)) StalkerGuid = creature->GetGUID(); else - sLog->outError(LOG_FILTER_GENERAL, "Battlefield::InitStalker: could not spawn Stalker (Creature entry %u), zone messeges will be un-available", entry); + sLog->outError(LOG_FILTER_BATTLEFIELD, "Battlefield::InitStalker: could not spawn Stalker (Creature entry %u), zone messeges will be un-available", entry); } void Battlefield::KickAfkPlayers() @@ -563,7 +563,7 @@ bool Battlefield::AddOrSetPlayerToCorrectBfGroup(Player* player) else if (group->IsMember(player->GetGUID())) { uint8 subgroup = group->GetMemberGroup(player->GetGUID()); - player->SetBattlegroundRaid(group, subgroup); + player->SetBattlegroundOrBattlefieldRaid(group, subgroup); } else group->AddMember(player); @@ -587,10 +587,10 @@ BfGraveyard* Battlefield::GetGraveyardById(uint32 id) if (m_GraveyardList[id]) return m_GraveyardList[id]; else - sLog->outError(LOG_FILTER_GENERAL, "Battlefield::GetGraveyardById Id:%u not existed", id); + sLog->outError(LOG_FILTER_BATTLEFIELD, "Battlefield::GetGraveyardById Id:%u not existed", id); } else - sLog->outError(LOG_FILTER_GENERAL, "Battlefield::GetGraveyardById Id:%u cant be found", id); + sLog->outError(LOG_FILTER_BATTLEFIELD, "Battlefield::GetGraveyardById Id:%u cant be found", id); return NULL; } @@ -684,7 +684,7 @@ void BfGraveyard::SetSpirit(Creature* spirit, TeamId team) { if (!spirit) { - sLog->outError(LOG_FILTER_GENERAL, "BfGraveyard::SetSpirit: Invalid Spirit."); + sLog->outError(LOG_FILTER_BATTLEFIELD, "BfGraveyard::SetSpirit: Invalid Spirit."); return; } @@ -798,14 +798,14 @@ Creature* Battlefield::SpawnCreature(uint32 entry, float x, float y, float z, fl Map* map = const_cast < Map * >(sMapMgr->CreateBaseMap(m_MapId)); if (!map) { - sLog->outError(LOG_FILTER_GENERAL, "Battlefield::SpawnCreature: Can't create creature entry: %u map not found", entry); + sLog->outError(LOG_FILTER_BATTLEFIELD, "Battlefield::SpawnCreature: Can't create creature entry: %u map not found", entry); return 0; } Creature* creature = new Creature; if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, PHASEMASK_NORMAL, entry, 0, team, x, y, z, o)) { - sLog->outError(LOG_FILTER_GENERAL, "Battlefield::SpawnCreature: Can't create creature entry: %u", entry); + sLog->outError(LOG_FILTER_BATTLEFIELD, "Battlefield::SpawnCreature: Can't create creature entry: %u", entry); delete creature; return NULL; } @@ -1066,7 +1066,7 @@ bool BfCapturePoint::Update(uint32 diff) if (m_OldState != m_State) { - //sLog->outError(LOG_FILTER_GENERAL, "%u->%u", m_OldState, m_State); + //sLog->outError(LOG_FILTER_BATTLEFIELD, "%u->%u", m_OldState, m_State); if (oldTeam != m_team) ChangeTeam(oldTeam); return true; diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp index 48d6b59d007..8e58dcdc5c0 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp +++ b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp @@ -238,7 +238,7 @@ void BattlefieldWG::OnBattleStart() m_titansRelic->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE); } else - sLog->outError(LOG_FILTER_GENERAL, "WG: Failed to spawn titan relic."); + sLog->outError(LOG_FILTER_BATTLEFIELD, "WG: Failed to spawn titan relic."); // Update tower visibility and update faction @@ -490,7 +490,7 @@ uint8 BattlefieldWG::GetSpiritGraveyardId(uint32 areaId) case AREA_THE_CHILLED_QUAGMIRE: return BATTLEFIELD_WG_GY_HORDE; default: - sLog->outError(LOG_FILTER_GENERAL, "BattlefieldWG::GetSpiritGraveyardId: Unexpected Area Id %u", areaId); + sLog->outError(LOG_FILTER_BATTLEFIELD, "BattlefieldWG::GetSpiritGraveyardId: Unexpected Area Id %u", areaId); break; } diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.h b/src/server/game/Battlefield/Zones/BattlefieldWG.h index 97807eb989c..924ff1ad454 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldWG.h +++ b/src/server/game/Battlefield/Zones/BattlefieldWG.h @@ -26,11 +26,11 @@ #include "GroupMgr.h" #include "Battlefield.h" -const uint32 VehNumWorldState[2] = { 3680, 3490 }; -const uint32 MaxVehNumWorldState[2] = { 3681, 3491 }; -const uint32 ClockWorldState[2] = { 3781, 4354 }; -const uint32 WintergraspFaction[3] = { 1, 2, 35 }; -const float WintergraspStalkerPos[4] = { 0, 0, 0, 0 }; +uint32 const VehNumWorldState[2] = { 3680, 3490 }; +uint32 const MaxVehNumWorldState[2] = { 3681, 3491 }; +uint32 const ClockWorldState[2] = { 3781, 4354 }; +uint32 const WintergraspFaction[3] = { 1, 2, 35 }; +float const WintergraspStalkerPos[4] = { 0, 0, 0, 0 }; class BattlefieldWG; class WintergraspCapturePoint; @@ -81,11 +81,11 @@ enum WintergraspSpells SPELL_WINTERGRASP_RESTRICTED_FLIGHT_AREA = 58730, // Phasing spells - SPELL_HORDE_CONTROLS_FACTORY_PHASE_SHIFT = 56618,// ADDS PHASE 16 - SPELL_ALLIANCE_CONTROLS_FACTORY_PHASE_SHIFT = 56617,// ADDS PHASE 32 + SPELL_HORDE_CONTROLS_FACTORY_PHASE_SHIFT = 56618, // ADDS PHASE 16 + SPELL_ALLIANCE_CONTROLS_FACTORY_PHASE_SHIFT = 56617, // ADDS PHASE 32 - SPELL_HORDE_CONTROL_PHASE_SHIFT = 55773,// ADDS PHASE 64 - SPELL_ALLIANCE_CONTROL_PHASE_SHIFT = 55774,// ADDS PHASE 128 + SPELL_HORDE_CONTROL_PHASE_SHIFT = 55773, // ADDS PHASE 64 + SPELL_ALLIANCE_CONTROL_PHASE_SHIFT = 55774, // ADDS PHASE 128 }; enum WintergraspData @@ -151,7 +151,7 @@ enum WintergraspAreaIds class BfGraveyardWG : public BfGraveyard { public: - BfGraveyardWG(BattlefieldWG *Bf); + BfGraveyardWG(BattlefieldWG* Bf); void SetTextId(uint32 textid) { m_GossipTextId = textid; } uint32 GetTextId() { return m_GossipTextId; } @@ -189,9 +189,9 @@ enum WintergraspNpcs BATTLEFIELD_WG_NPC_STALKER = 15214, BATTLEFIELD_WG_NPC_VIERON_BLAZEFEATHER = 31102, - BATTLEFIELD_WG_NPC_STONE_GUARD_MUKAR = 32296,// - BATTLEFIELD_WG_NPC_HOODOO_MASTER_FU_JIN = 31101,// - BATTLEFIELD_WG_NPC_CHAMPION_ROS_SLAI = 39173,// + BATTLEFIELD_WG_NPC_STONE_GUARD_MUKAR = 32296, // + BATTLEFIELD_WG_NPC_HOODOO_MASTER_FU_JIN = 31101, // + BATTLEFIELD_WG_NPC_CHAMPION_ROS_SLAI = 39173, // BATTLEFIELD_WG_NPC_COMMANDER_DARDOSH = 31091, BATTLEFIELD_WG_NPC_TACTICAL_OFFICER_KILRATH = 31151, BATTLEFIELD_WG_NPC_SIEGESMITH_STRONGHOOF = 31106, @@ -199,17 +199,17 @@ enum WintergraspNpcs BATTLEFIELD_WG_NPC_LIEUTENANT_MURP = 31107, BATTLEFIELD_WG_NPC_BOWYER_RANDOLPH = 31052, - BATTLEFIELD_WG_NPC_KNIGHT_DAMERON = 32294,// - BATTLEFIELD_WG_NPC_SORCERESS_KAYLANA = 31051,// - BATTLEFIELD_WG_NPC_MARSHAL_MAGRUDER = 39172,// + BATTLEFIELD_WG_NPC_KNIGHT_DAMERON = 32294, // + BATTLEFIELD_WG_NPC_SORCERESS_KAYLANA = 31051, // + BATTLEFIELD_WG_NPC_MARSHAL_MAGRUDER = 39172, // BATTLEFIELD_WG_NPC_COMMANDER_ZANNETH = 31036, BATTLEFIELD_WG_NPC_TACTICAL_OFFICER_AHBRAMIS = 31153, BATTLEFIELD_WG_NPC_SIEGE_MASTER_STOUTHANDLE = 31108, BATTLEFIELD_WG_NPC_ANCHORITE_TESSA = 31054, BATTLEFIELD_WG_NPC_SENIOR_DEMOLITIONIST_LEGOSO = 31109, - NPC_TAUNKA_SPIRIT_GUIDE = 31841, // Horde spirit guide for Wintergrasp - NPC_DWARVEN_SPIRIT_GUIDE = 31842, // Alliance spirit guide for Wintergrasp + NPC_TAUNKA_SPIRIT_GUIDE = 31841, // Horde spirit guide for Wintergrasp + NPC_DWARVEN_SPIRIT_GUIDE = 31842, // Alliance spirit guide for Wintergrasp NPC_TOWER_CANNON = 28366, NPC_WINTERGRASP_SIEGE_ENGINE_ALLIANCE = 28312, @@ -434,14 +434,14 @@ class BattlefieldWG : public Battlefield GameObject* m_titansRelic; }; -const uint32 NORTHREND_WINTERGRASP = 4197; -const uint8 WG_MAX_OBJ = 32; -const uint8 WG_KEEPGAMEOBJECT_MAX = 44; -const uint8 WG_MAX_TURRET = 15; -const uint8 WG_MAX_KEEP_NPC = 39; -const uint8 WG_MAX_OUTSIDE_NPC = 14; -const uint8 WG_OUTSIDE_ALLIANCE_NPC = 7; -const uint8 WG_MAX_TELEPORTER = 12; +uint32 const NORTHREND_WINTERGRASP = 4197; +uint8 const WG_MAX_OBJ = 32; +uint8 const WG_KEEPGAMEOBJECT_MAX = 44; +uint8 const WG_MAX_TURRET = 15; +uint8 const WG_MAX_KEEP_NPC = 39; +uint8 const WG_MAX_OUTSIDE_NPC = 14; +uint8 const WG_OUTSIDE_ALLIANCE_NPC = 7; +uint8 const WG_MAX_TELEPORTER = 12; enum WintergraspGameObjectBuildingType { @@ -479,15 +479,15 @@ enum WintergraspWorkshopIds enum WintergraspWorldstates { - WORLDSTATE_WORKSHOP_NE = 3701, - WORLDSTATE_WORKSHOP_NW = 3700, - WORLDSTATE_WORKSHOP_SE = 3703, - WORLDSTATE_WORKSHOP_SW = 3702, - WORLDSTATE_WORKSHOP_K_W = 3698, - WORLDSTATE_WORKSHOP_K_E = 3699 + WORLDSTATE_WORKSHOP_NE = 3701, + WORLDSTATE_WORKSHOP_NW = 3700, + WORLDSTATE_WORKSHOP_SE = 3703, + WORLDSTATE_WORKSHOP_SW = 3702, + WORLDSTATE_WORKSHOP_K_W = 3698, + WORLDSTATE_WORKSHOP_K_E = 3699 }; -enum eWGTeamControl +enum WintergraspTeamControl { BATTLEFIELD_WG_TEAM_ALLIANCE, BATTLEFIELD_WG_TEAM_HORDE, @@ -495,7 +495,7 @@ enum eWGTeamControl }; // TODO: Handle this with creature_text ? -enum eWGText +enum WintergraspText { BATTLEFIELD_WG_TEXT_WORKSHOP_NAME_NE = 12055, BATTLEFIELD_WG_TEXT_WORKSHOP_NAME_NW = 12052, @@ -567,7 +567,8 @@ struct WintergraspBuildingSpawnData uint32 nameId; }; -const WintergraspBuildingSpawnData WGGameObjectBuilding[WG_MAX_OBJ] = { +const WintergraspBuildingSpawnData WGGameObjectBuilding[WG_MAX_OBJ] = +{ // Wall (Not spawned in db) // Entry WS X Y Z O type NameID { 190219, 3749, 5371.46f, 3047.47f, 407.571f, 3.14159f, BATTLEFIELD_WG_OBJECTTYPE_WALL, 0 }, @@ -659,7 +660,8 @@ const WintergraspBuildingSpawnData WGGameObjectBuilding[WG_MAX_OBJ] = { // 192357 : 1 in sql, 1 in header // 192350 : 1 in sql, 1 in header // 192351 : 1 in sql, 1 in header -const WintergraspObjectPositionData WGKeepGameObject[WG_KEEPGAMEOBJECT_MAX] = { +const WintergraspObjectPositionData WGKeepGameObject[WG_KEEPGAMEOBJECT_MAX] = +{ { 5262.540039f, 3047.949951f, 432.054993f, 3.106650f, 192488, 192501 }, // Flag on tower { 5272.939941f, 2976.550049f, 444.492004f, 3.124120f, 192374, 192416 }, // Flag on Wall Intersect { 5235.189941f, 2941.899902f, 444.278015f, 1.588250f, 192375, 192416 }, // Flag on Wall Intersect @@ -706,7 +708,8 @@ const WintergraspObjectPositionData WGKeepGameObject[WG_KEEPGAMEOBJECT_MAX] = { { 5271.279785f, 2820.159912f, 445.200989f, -3.13286f, 192351, 192416 } // Flag on wall intersect }; -const Position WGTurret[WG_MAX_TURRET] = { +const Position WGTurret[WG_MAX_TURRET] = +{ { 5391.19f, 3060.8f, 419.616f, 1.69557f }, { 5266.75f, 2976.5f, 421.067f, 3.20354f }, { 5234.86f, 2948.8f, 420.88f, 1.61311f }, @@ -841,7 +844,8 @@ struct WintergraspTowerData uint8 const WG_MAX_ATTACKTOWERS = 3; // 192414 : 0 in sql, 1 in header // 192278 : 0 in sql, 3 in header -const WintergraspTowerData AttackTowers[WG_MAX_ATTACKTOWERS] = { +const WintergraspTowerData AttackTowers[WG_MAX_ATTACKTOWERS] = +{ // West tower { 190356, @@ -1128,7 +1132,7 @@ const WGWorkshopData WorkshopsData[WG_MAX_WORKSHOP] = // Structure for different buildings that can be destroyed during battle struct BfWGGameObjectBuilding { - BfWGGameObjectBuilding(BattlefieldWG *WG) + BfWGGameObjectBuilding(BattlefieldWG* WG) { m_WG = WG; m_Team = 0; @@ -1143,7 +1147,7 @@ struct BfWGGameObjectBuilding uint8 m_Team; // WG object - BattlefieldWG *m_WG; + BattlefieldWG* m_WG; // Linked gameobject GameObject* m_Build; @@ -1254,7 +1258,7 @@ struct BfWGGameObjectBuilding m_WG->BrokenWallOrTower(TeamId(m_Team)); } - void Init(GameObject *go, uint32 type, uint32 worldstate, uint32 nameid) + void Init(GameObject* go, uint32 type, uint32 worldstate, uint32 nameid) { // GameObject associated to object m_Build = go; @@ -1612,7 +1616,7 @@ struct WintergraspWorkshopData GameObjectSet m_GameObjectOnPoint[2]; // Contain all Gameobject associate to this point uint32 m_NameId; // Id of trinity_string witch contain name of this node, using for alert message - WintergraspWorkshopData(BattlefieldWG * WG) + WintergraspWorkshopData(BattlefieldWG* WG) { m_WG = WG; m_Build = NULL; diff --git a/src/server/game/Battlegrounds/ArenaTeam.cpp b/src/server/game/Battlegrounds/ArenaTeam.cpp index b9ddabcf254..61b15bdd182 100755 --- a/src/server/game/Battlegrounds/ArenaTeam.cpp +++ b/src/server/game/Battlegrounds/ArenaTeam.cpp @@ -343,7 +343,7 @@ void ArenaTeam::Disband(WorldSession* session) // Broadcast update if (session) { - BroadcastEvent(ERR_ARENA_TEAM_DISBANDED_S, 0, 2, session->GetPlayerName(), GetName(), ""); + BroadcastEvent(ERR_ARENA_TEAM_DISBANDED_S, 0, 2, session->GetPlayerName().c_str(), GetName(), ""); if (Player* player = session->GetPlayer()) sLog->outInfo(LOG_FILTER_ARENAS, "Player: %s [GUID: %u] disbanded arena team type: %u [Id: %u].", player->GetName(), player->GetGUIDLow(), GetType(), GetId()); diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index d10e6a5dd90..98b95b5d32b 100755 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -1230,7 +1230,7 @@ void Battleground::AddOrSetPlayerToCorrectBgGroup(Player* player, uint32 team) if (group->IsMember(playerGuid)) { uint8 subgroup = group->GetMemberGroup(playerGuid); - player->SetBattlegroundRaid(group, subgroup); + player->SetBattlegroundOrBattlefieldRaid(group, subgroup); } else { diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 971716e24a1..e1b312d83d0 100755 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -855,6 +855,13 @@ bool GameObject::IsDynTransport() const return gInfo->type == GAMEOBJECT_TYPE_MO_TRANSPORT || (gInfo->type == GAMEOBJECT_TYPE_TRANSPORT && !gInfo->transport.pause); } +bool GameObject::IsDestructibleBuilding() const +{ + GameObjectTemplate const* gInfo = GetGOInfo(); + if (!gInfo) return false; + return gInfo->type == GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING; +} + Unit* GameObject::GetOwner() const { return ObjectAccessor::GetUnit(*this, GetOwnerGUID()); @@ -871,7 +878,7 @@ bool GameObject::IsAlwaysVisibleFor(WorldObject const* seer) const if (WorldObject::IsAlwaysVisibleFor(seer)) return true; - if (IsTransport()) + if (IsTransport() || IsDestructibleBuilding()) return true; if (!seer) diff --git a/src/server/game/Entities/GameObject/GameObject.h b/src/server/game/Entities/GameObject/GameObject.h index 80aaf1c933f..b3efb47dd6f 100755 --- a/src/server/game/Entities/GameObject/GameObject.h +++ b/src/server/game/Entities/GameObject/GameObject.h @@ -633,6 +633,7 @@ class GameObject : public WorldObject, public GridObject bool IsTransport() const; bool IsDynTransport() const; + bool IsDestructibleBuilding() const; uint32 GetDBTableGUIDLow() const { return m_DBTableGuid; } diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index fb1a5ccb9b6..2ccb5b68bca 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -2489,7 +2489,12 @@ void WorldObject::SetZoneScript() if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(GetZoneId())) m_zoneScript = bf; else - m_zoneScript = sOutdoorPvPMgr->GetZoneScript(GetZoneId()); + { + if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(GetZoneId())) + m_zoneScript = bf; + else + m_zoneScript = sOutdoorPvPMgr->GetZoneScript(GetZoneId()); + } } } } diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 87dd1c51737..3ad14cb9c72 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -5523,7 +5523,12 @@ void Player::RepopAtGraveyard() if (sBattlefieldMgr->GetBattlefieldToZoneId(GetZoneId())) ClosestGrave = sBattlefieldMgr->GetBattlefieldToZoneId(GetZoneId())->GetClosestGraveYard(this); else - ClosestGrave = sObjectMgr->GetClosestGraveYard(GetPositionX(), GetPositionY(), GetPositionZ(), GetMapId(), GetTeam()); + { + if (sBattlefieldMgr->GetBattlefieldToZoneId(GetZoneId())) + ClosestGrave = sBattlefieldMgr->GetBattlefieldToZoneId(GetZoneId())->GetClosestGraveYard(this); + else + ClosestGrave = sObjectMgr->GetClosestGraveYard(GetPositionX(), GetPositionY(), GetPositionZ(), GetMapId(), GetTeam()); + } } // stop countdown until repop @@ -7731,7 +7736,7 @@ void Player::CheckDuelDistance(time_t currTime) bool Player::IsOutdoorPvPActive() { - return isAlive() && !HasInvisibilityAura() && !HasStealthAura() && (IsPvP() || sWorld->IsPvPRealm()) && !HasUnitMovementFlag(MOVEMENTFLAG_FLYING) && !isInFlight(); + return isAlive() && !HasInvisibilityAura() && !HasStealthAura() && IsPvP() && !HasUnitMovementFlag(MOVEMENTFLAG_FLYING) && !isInFlight(); } void Player::DuelComplete(DuelCompleteType type) @@ -23464,7 +23469,7 @@ bool Player::isUsingLfg() return sLFGMgr->GetState(guid) != LFG_STATE_NONE; } -void Player::SetBattlegroundRaid(Group* group, int8 subgroup) +void Player::SetBattlegroundOrBattlefieldRaid(Group* group, int8 subgroup) { //we must move references from m_group to m_originalGroup SetOriginalGroup(GetGroup(), GetSubGroup()); @@ -23474,7 +23479,7 @@ void Player::SetBattlegroundRaid(Group* group, int8 subgroup) m_group.setSubGroup((uint8)subgroup); } -void Player::RemoveFromBattlegroundRaid() +void Player::RemoveFromBattlegroundOrBattlefieldRaid() { //remove existing reference m_group.unlink(); diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index cd6334714df..09c7e0ff2a1 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -2484,9 +2484,9 @@ class Player : public Unit, public GridObject Player* GetNextRandomRaidMember(float radius); PartyResult CanUninviteFromGroup() const; - // Battleground Group System - void SetBattlegroundRaid(Group* group, int8 subgroup = -1); - void RemoveFromBattlegroundRaid(); + // Battleground / Battlefield Group System + void SetBattlegroundOrBattlefieldRaid(Group* group, int8 subgroup = -1); + void RemoveFromBattlegroundOrBattlefieldRaid(); Group* GetOriginalGroup() { return m_originalGroup.getTarget(); } GroupReference& GetOriginalGroupRef() { return m_originalGroup; } uint8 GetOriginalSubGroup() const { return m_originalGroup.getSubGroup(); } diff --git a/src/server/game/Entities/Vehicle/Vehicle.h b/src/server/game/Entities/Vehicle/Vehicle.h index 213be5a21fe..95fc2364256 100755 --- a/src/server/game/Entities/Vehicle/Vehicle.h +++ b/src/server/game/Entities/Vehicle/Vehicle.h @@ -25,6 +25,8 @@ struct VehicleEntry; class Unit; +typedef std::set GuidSet; + class Vehicle { public: @@ -53,6 +55,7 @@ class Vehicle void RelocatePassengers(float x, float y, float z, float ang); void RemoveAllPassengers(); void Dismiss(); + void TeleportVehicle(float x, float y, float z, float ang); bool IsVehicleInUse() { return Seats.begin() != Seats.end(); } SeatMap Seats; @@ -65,6 +68,7 @@ class Vehicle Unit* _me; VehicleEntry const* _vehicleInfo; + GuidSet vehiclePlayers; uint32 _usableSeatNum; // Number of seats that match VehicleSeatEntry::UsableByPlayer, used for proper display flags uint32 _creatureEntry; // Can be different than me->GetBase()->GetEntry() in case of players }; diff --git a/src/server/game/Globals/ObjectAccessor.h b/src/server/game/Globals/ObjectAccessor.h index 5b31c6bfff4..0a1b41eb292 100755 --- a/src/server/game/Globals/ObjectAccessor.h +++ b/src/server/game/Globals/ObjectAccessor.h @@ -191,6 +191,7 @@ class ObjectAccessor // ACCESS LIKE THAT IS NOT THREAD SAFE static Pet* FindPet(uint64); static Player* FindPlayer(uint64); + static Creature* FindCreature(uint64); static Unit* FindUnit(uint64); static Player* FindPlayerByName(const char* name); diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index 60dbe64f7f1..2e0843f54c9 100755 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -104,7 +104,7 @@ bool Group::Create(Player* leader) m_leaderGuid = leaderGuid; m_leaderName = leader->GetName(); - m_groupType = isBGGroup() ? GROUPTYPE_BGRAID : GROUPTYPE_NORMAL; + m_groupType = (isBGGroup() || isBFGroup()) ? GROUPTYPE_BGRAID : GROUPTYPE_NORMAL; if (m_groupType & GROUPTYPE_RAID) _initRaidSubGroupsCounter(); @@ -116,7 +116,7 @@ bool Group::Create(Player* leader) m_dungeonDifficulty = DUNGEON_DIFFICULTY_NORMAL; m_raidDifficulty = RAID_DIFFICULTY_10MAN_NORMAL; - if (!isBGGroup()) + if (!isBGGroup() && !isBFGroup()) { m_dungeonDifficulty = leader->GetDungeonDifficulty(); m_raidDifficulty = leader->GetRaidDifficulty(); @@ -232,7 +232,7 @@ void Group::ConvertToLFG() { m_groupType = GroupType(m_groupType | GROUPTYPE_LFG | GROUPTYPE_UNK1); m_lootMethod = NEED_BEFORE_GREED; - if (!isBGGroup()) + if (!isBGGroup() && !isBFGroup()) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_TYPE); @@ -251,7 +251,7 @@ void Group::ConvertToRaid() _initRaidSubGroupsCounter(); - if (!isBGGroup()) + if (!isBGGroup() && !isBFGroup()) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_TYPE); @@ -305,7 +305,7 @@ bool Group::AddInvite(Player* player) if (!player || player->GetGroupInvite()) return false; Group* group = player->GetGroup(); - if (group && group->isBGGroup()) + if (group && (group->isBGGroup() || group->isBFGroup())) group = player->GetOriginalGroup(); if (group) return false; @@ -402,8 +402,8 @@ bool Group::AddMember(Player* player) if (player) { player->SetGroupInvite(NULL); - if (player->GetGroup() && isBGGroup()) //if player is in group and he is being added to BG raid group, then call SetBattlegroundRaid() - player->SetBattlegroundRaid(this, subGroup); + if (player->GetGroup() && (isBGGroup() || isBFGroup())) // if player is in group and he is being added to BG raid group, then call SetBattlegroundRaid() + player->SetBattlegroundOrBattlefieldRaid(this, subGroup); else if (player->GetGroup()) //if player is in bg raid and we are adding him to normal group, then call SetOriginalGroup() player->SetOriginalGroup(this, subGroup); else //if player is not in group, then call set group @@ -422,7 +422,7 @@ bool Group::AddMember(Player* player) } // insert into the table if we're not a battleground group - if (!isBGGroup()) + if (!isBGGroup() && !isBFGroup()) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GROUP_MEMBER); @@ -441,7 +441,7 @@ bool Group::AddMember(Player* player) if (player) { - if (!IsLeader(player->GetGUID()) && !isBGGroup()) + if (!IsLeader(player->GetGUID()) && !isBGGroup() && !isBFGroup()) { // reset the new member's instances, unless he is currently in one of them // including raid/heroic instances that they are not permanently bound to! @@ -527,15 +527,15 @@ bool Group::RemoveMember(uint64 guid, const RemoveMethod &method /*= GROUP_REMOV if (isLFGGroup() && method == GROUP_REMOVEMETHOD_KICK) return m_memberSlots.size(); - // remove member and change leader (if need) only if strong more 2 members _before_ member remove (BG allow 1 member group) - if (GetMembersCount() > ((isBGGroup() || isLFGGroup()) ? 1u : 2u)) + // remove member and change leader (if need) only if strong more 2 members _before_ member remove (BG/BF allow 1 member group) + if (GetMembersCount() > ((isBGGroup() || isLFGGroup() || isBFGroup()) ? 1u : 2u)) { Player* player = ObjectAccessor::FindPlayer(guid); if (player) { // Battleground group handling - if (isBGGroup()) - player->RemoveFromBattlegroundRaid(); + if (isBGGroup() || isBFGroup()) + player->RemoveFromBattlegroundOrBattlefieldRaid(); else // Regular group { @@ -566,13 +566,13 @@ bool Group::RemoveMember(uint64 guid, const RemoveMethod &method /*= GROUP_REMOV } // Remove player from group in DB - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GROUP_MEMBER); - - stmt->setUInt32(0, GUID_LOPART(guid)); - - CharacterDatabase.Execute(stmt); - - DelinkMember(guid); + if (!isBGGroup() && !isBFGroup()) + { + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GROUP_MEMBER); + stmt->setUInt32(0, GUID_LOPART(guid)); + CharacterDatabase.Execute(stmt); + DelinkMember(guid); + } // Reevaluate group enchanter if the leaving player had enchanting skill or the player is offline if ((player && player->GetSkillValue(SKILL_ENCHANTING)) || !player) @@ -663,7 +663,7 @@ void Group::ChangeLeader(uint64 guid) sScriptMgr->OnGroupChangeLeader(this, m_leaderGuid, guid); - if (!isBGGroup()) + if (!isBGGroup() && !isBFGroup()) { // Remove the groups permanent instance bindings for (uint8 i = 0; i < MAX_DIFFICULTY; ++i) @@ -723,8 +723,8 @@ void Group::Disband(bool hideDestroy /* = false */) //we cannot call _removeMember because it would invalidate member iterator //if we are removing player from battleground raid - if (isBGGroup()) - player->RemoveFromBattlegroundRaid(); + if (isBGGroup() || isBFGroup()) + player->RemoveFromBattlegroundOrBattlefieldRaid(); else { //we can remove player who is in battleground from his original group @@ -768,7 +768,7 @@ void Group::Disband(bool hideDestroy /* = false */) RemoveAllInvites(); - if (!isBGGroup()) + if (!isBGGroup() && !isBFGroup()) { SQLTransaction trans = CharacterDatabase.BeginTransaction(); @@ -1540,7 +1540,7 @@ void Group::SendUpdateToPlayer(uint64 playerGUID, MemberSlot* slot) Player* member = ObjectAccessor::FindPlayer(citr->guid); uint8 onlineState = (member) ? MEMBER_STATUS_ONLINE : MEMBER_STATUS_OFFLINE; - onlineState = onlineState | ((isBGGroup()) ? MEMBER_STATUS_PVP : 0); + onlineState = onlineState | ((isBGGroup() || isBFGroup()) ? MEMBER_STATUS_PVP : 0); data << citr->name; data << uint64(citr->guid); // guid @@ -1645,7 +1645,7 @@ bool Group::_setMembersGroup(uint64 guid, uint8 group) SubGroupCounterIncrease(group); - if (!isBGGroup()) + if (!isBGGroup() && !isBFGroup()) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_MEMBER_SUBGROUP); @@ -1696,7 +1696,7 @@ void Group::ChangeMembersGroup(uint64 guid, uint8 group) SubGroupCounterDecrease(prevSubGroup); // Preserve new sub group in database for non-raid groups - if (!isBGGroup()) + if (!isBGGroup() && !isBFGroup()) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_MEMBER_SUBGROUP); @@ -1891,7 +1891,7 @@ void Roll::targetObjectBuildLink() void Group::SetDungeonDifficulty(Difficulty difficulty) { m_dungeonDifficulty = difficulty; - if (!isBGGroup()) + if (!isBGGroup() && !isBFGroup()) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_DIFFICULTY); @@ -1915,7 +1915,7 @@ void Group::SetDungeonDifficulty(Difficulty difficulty) void Group::SetRaidDifficulty(Difficulty difficulty) { m_raidDifficulty = difficulty; - if (!isBGGroup()) + if (!isBGGroup() && !isBFGroup()) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_RAID_DIFFICULTY); @@ -1951,7 +1951,7 @@ bool Group::InCombatToInstance(uint32 instanceId) void Group::ResetInstances(uint8 method, bool isRaid, Player* SendMsgTo) { - if (isBGGroup()) + if (isBGGroup() || isBFGroup()) return; // method can be INSTANCE_RESET_ALL, INSTANCE_RESET_CHANGE_DIFFICULTY, INSTANCE_RESET_GROUP_DISBAND @@ -2066,7 +2066,7 @@ InstanceGroupBind* Group::GetBoundInstance(MapEntry const* mapEntry) InstanceGroupBind* Group::BindToInstance(InstanceSave* save, bool permanent, bool load) { - if (!save || isBGGroup()) + if (!save || isBGGroup() || isBFGroup()) return NULL; InstanceGroupBind& bind = m_boundInstances[save->GetDifficulty()][save->GetMapId()]; diff --git a/src/server/game/Groups/Group.h b/src/server/game/Groups/Group.h index f11cdcdbcf4..e6da9caea32 100755 --- a/src/server/game/Groups/Group.h +++ b/src/server/game/Groups/Group.h @@ -247,7 +247,7 @@ class Group void ConvertToGroup(); void SetBattlegroundGroup(Battleground* bg); - void SetBattlefieldGroup(Battlefield *bf); + void SetBattlefieldGroup(Battlefield* bf); GroupJoinBattlegroundResult CanJoinBattlegroundQueue(Battleground const* bgOrTemplate, BattlegroundQueueTypeId bgQueueTypeId, uint32 MinPlayerCount, uint32 MaxPlayerCount, bool isRated, uint32 arenaSlot); void ChangeMembersGroup(uint64 guid, uint8 group); diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp index 385bb8abb45..122102b76f3 100644 --- a/src/server/game/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Handlers/AuctionHouseHandler.cpp @@ -247,7 +247,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recvData) if (GetSecurity() > SEC_PLAYER && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE)) { sLog->outCommand(GetAccountId(), "GM %s (Account: %u) create auction: %s (Entry: %u Count: %u)", - GetPlayerName(), GetAccountId(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetCount()); + GetPlayerName().c_str(), GetAccountId(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetCount()); } AH->item_guidlow = item->GetGUIDLow(); @@ -293,7 +293,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recvData) if (GetSecurity() > SEC_PLAYER && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE)) { sLog->outCommand(GetAccountId(), "GM %s (Account: %u) create auction: %s (Entry: %u Count: %u)", - GetPlayerName(), GetAccountId(), newItem->GetTemplate()->Name1.c_str(), newItem->GetEntry(), newItem->GetCount()); + GetPlayerName().c_str(), GetAccountId(), newItem->GetTemplate()->Name1.c_str(), newItem->GetEntry(), newItem->GetCount()); } AH->item_guidlow = newItem->GetGUIDLow(); diff --git a/src/server/game/Handlers/BattleGroundHandler.cpp b/src/server/game/Handlers/BattleGroundHandler.cpp index e46aa4c39b7..d1da504008e 100755 --- a/src/server/game/Handlers/BattleGroundHandler.cpp +++ b/src/server/game/Handlers/BattleGroundHandler.cpp @@ -34,8 +34,6 @@ #include "Opcodes.h" #include "DisableMgr.h" #include "Group.h" -#include "Battlefield.h" -#include "BattlefieldMgr.h" void WorldSession::HandleBattlemasterHelloOpcode(WorldPacket & recvData) { @@ -561,53 +559,6 @@ void WorldSession::HandleBattlefieldStatusOpcode(WorldPacket & /*recvData*/) } } -void WorldSession::HandleAreaSpiritHealerQueryOpcode(WorldPacket & recvData) -{ - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AREA_SPIRIT_HEALER_QUERY"); - - Battleground* bg = _player->GetBattleground(); - - uint64 guid; - recvData >> guid; - - Creature* unit = GetPlayer()->GetMap()->GetCreature(guid); - if (!unit) - return; - - if (!unit->isSpiritService()) // it's not spirit service - return; - - if (bg) - sBattlegroundMgr->SendAreaSpiritHealerQueryOpcode(_player, bg, guid); - - if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(_player->GetZoneId())) - bf->SendAreaSpiritHealerQueryOpcode(_player,guid); -} - -void WorldSession::HandleAreaSpiritHealerQueueOpcode(WorldPacket & recvData) -{ - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AREA_SPIRIT_HEALER_QUEUE"); - - Battleground* bg = _player->GetBattleground(); - - uint64 guid; - recvData >> guid; - - Creature* unit = GetPlayer()->GetMap()->GetCreature(guid); - if (!unit) - return; - - if (!unit->isSpiritService()) // it's not spirit service - return; - - if (bg) - bg->AddPlayerToResurrectQueue(guid, _player->GetGUID()); - - if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(_player->GetZoneId())) - bf->AddPlayerToResurrectQueue(guid, _player->GetGUID()); -} - - void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_BATTLEMASTER_JOIN_ARENA"); diff --git a/src/server/game/Handlers/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cpp index 28f15a7377d..2ab2831c0d0 100644 --- a/src/server/game/Handlers/ChatHandler.cpp +++ b/src/server/game/Handlers/ChatHandler.cpp @@ -110,7 +110,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) type = CHAT_MSG_RAID_WARNING; break; default: - sLog->outInfo(LOG_FILTER_NETWORKIO, "HandleMessagechatOpcode : Unknown chat opcode (%u)", recvData.GetOpcode()); + sLog->outError(LOG_FILTER_NETWORKIO, "HandleMessagechatOpcode : Unknown chat opcode (%u)", recvData.GetOpcode()); recvData.hexlike(); return; } @@ -535,7 +535,7 @@ void WorldSession::HandleAddonMessagechatOpcode(WorldPacket& recvData) type = CHAT_MSG_WHISPER; break; default: - sLog->outInfo(LOG_FILTER_NETWORKIO, "HandleAddonMessagechatOpcode: Unknown addon chat opcode (%u)", recvData.GetOpcode()); + sLog->outError(LOG_FILTER_NETWORKIO, "HandleAddonMessagechatOpcode: Unknown addon chat opcode (%u)", recvData.GetOpcode()); recvData.hexlike(); return; } diff --git a/src/server/game/Handlers/MailHandler.cpp b/src/server/game/Handlers/MailHandler.cpp index 4d16fb27bec..f89fa2ab25e 100644 --- a/src/server/game/Handlers/MailHandler.cpp +++ b/src/server/game/Handlers/MailHandler.cpp @@ -305,7 +305,7 @@ void WorldSession::HandleSendMail(WorldPacket& recvData) if (!AccountMgr::IsPlayerAccount(GetSecurity()) && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE)) { sLog->outCommand(GetAccountId(), "GM %s (Account: %u) mail item: %s (Entry: %u Count: %u) to player: %s (Account: %u)", - GetPlayerName(), GetAccountId(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetCount(), receiver.c_str(), rc_account); + GetPlayerName().c_str(), GetAccountId(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetCount(), receiver.c_str(), rc_account); } item->SetNotRefundable(GetPlayer()); // makes the item no longer refundable @@ -325,7 +325,7 @@ void WorldSession::HandleSendMail(WorldPacket& recvData) if (money > 0 && !AccountMgr::IsPlayerAccount(GetSecurity()) && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE)) { sLog->outCommand(GetAccountId(), "GM %s (Account: %u) mail money: " UI64FMTD " to player: %s (Account: %u)", - GetPlayerName(), GetAccountId(), money, receiver.c_str(), rc_account); + GetPlayerName().c_str(), GetAccountId(), money, receiver.c_str(), rc_account); } } @@ -520,7 +520,7 @@ void WorldSession::HandleMailTakeItem(WorldPacket& recvData) sender_name = sObjectMgr->GetTrinityStringForDBCLocale(LANG_UNKNOWN); } sLog->outCommand(GetAccountId(), "GM %s (Account: %u) receive mail item: %s (Entry: %u Count: %u) and send COD money: " UI64FMTD " to player: %s (Account: %u)", - GetPlayerName(), GetAccountId(), it->GetTemplate()->Name1.c_str(), it->GetEntry(), it->GetCount(), m->COD, sender_name.c_str(), sender_accId); + GetPlayerName().c_str(), GetAccountId(), it->GetTemplate()->Name1.c_str(), it->GetEntry(), it->GetCount(), m->COD, sender_name.c_str(), sender_accId); } else if (!receive) sender_accId = sObjectMgr->GetPlayerAccountIdByGUID(sender_guid); diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index c177d8b2888..677b3cccf82 100644 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -52,6 +52,7 @@ #include "Group.h" #include "AccountMgr.h" #include "Spell.h" +#include "BattlegroundMgr.h" #include "Battlefield.h" #include "BattlefieldMgr.h" @@ -1727,6 +1728,53 @@ void WorldSession::SendSetPhaseShift(uint32 PhaseShift) SendPacket(&data); } +// Battlefield and Battleground +void WorldSession::HandleAreaSpiritHealerQueryOpcode(WorldPacket & recv_data) +{ + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AREA_SPIRIT_HEALER_QUERY"); + + Battleground* bg = _player->GetBattleground(); + + uint64 guid; + recv_data >> guid; + + Creature* unit = GetPlayer()->GetMap()->GetCreature(guid); + if (!unit) + return; + + if (!unit->isSpiritService()) // it's not spirit service + return; + + if (bg) + sBattlegroundMgr->SendAreaSpiritHealerQueryOpcode(_player, bg, guid); + + if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(_player->GetZoneId())) + bf->SendAreaSpiritHealerQueryOpcode(_player,guid); +} + +void WorldSession::HandleAreaSpiritHealerQueueOpcode(WorldPacket & recv_data) +{ + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AREA_SPIRIT_HEALER_QUEUE"); + + Battleground* bg = _player->GetBattleground(); + + uint64 guid; + recv_data >> guid; + + Creature* unit = GetPlayer()->GetMap()->GetCreature(guid); + if (!unit) + return; + + if (!unit->isSpiritService()) // it's not spirit service + return; + + if (bg) + bg->AddPlayerToResurrectQueue(guid, _player->GetGUID()); + + if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(_player->GetZoneId())) + bf->AddPlayerToResurrectQueue(guid, _player->GetGUID()); +} + void WorldSession::HandleHearthAndResurrect(WorldPacket& /*recvData*/) { if (_player->isInFlight()) @@ -1890,5 +1938,5 @@ void WorldSession::HandleUpdateMissileTrajectory(WorldPacket& recvPacket) recvPacket.ReadByteSeq(guid[5]); WorldObject* obj = ObjectAccessor::GetWorldObject(*GetPlayer(), guid); - sLog->outError(LOG_FILTER_NETWORKIO, "Object update failed for object "UI64FMTD" (%s) for player %s (%u)", uint64(guid), obj ? obj->GetName() : "object-not-found", GetPlayerName(), GetGuidLow()); + sLog->outError(LOG_FILTER_NETWORKIO, "Object update failed for object "UI64FMTD" (%s) for player %s (%u)", uint64(guid), obj ? obj->GetName() : "object-not-found", GetPlayerName().c_str(), GetGuidLow()); } diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index 0337a60a459..5e6caec1f29 100755 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -47,6 +47,7 @@ void AddSC_SmartSCripts(); void AddSC_account_commandscript(); void AddSC_achievement_commandscript(); void AddSC_ban_commandscript(); +void AddSC_bf_commandscript(); void AddSC_cast_commandscript(); void AddSC_character_commandscript(); void AddSC_debug_commandscript(); @@ -655,6 +656,7 @@ void AddCommandScripts() AddSC_account_commandscript(); AddSC_achievement_commandscript(); AddSC_ban_commandscript(); + AddSC_bf_commandscript(); AddSC_cast_commandscript(); AddSC_character_commandscript(); AddSC_debug_commandscript(); diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index 589eb6fc179..e3f550c5f48 100755 --- a/src/server/game/Scripting/ScriptMgr.cpp +++ b/src/server/game/Scripting/ScriptMgr.cpp @@ -723,14 +723,6 @@ bool ScriptMgr::OnDummyEffect(Unit* caster, uint32 spellId, SpellEffIndex effInd return tmpscript->OnDummyEffect(caster, spellId, effIndex, target); } -GameObjectAI* ScriptMgr::GetGameObjectAI(GameObject* go) -{ - ASSERT(go); - - GET_SCRIPT_RET(GameObjectScript, go->GetScriptId(), tmpscript, NULL); - return tmpscript->GetAI(go); -} - bool ScriptMgr::OnQuestAccept(Player* player, Item* item, Quest const* quest) { ASSERT(player); @@ -861,6 +853,14 @@ CreatureAI* ScriptMgr::GetCreatureAI(Creature* creature) return tmpscript->GetAI(creature); } +GameObjectAI* ScriptMgr::GetGameObjectAI(GameObject* gameobject) +{ + ASSERT(gameobject); + + GET_SCRIPT_RET(GameObjectScript, gameobject->GetScriptId(), tmpscript, NULL); + return tmpscript->GetAI(gameobject); +} + void ScriptMgr::OnCreatureUpdate(Creature* creature, uint32 diff) { ASSERT(creature); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 6c27c49bf79..43e4ddfb9e4 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -1466,5 +1466,14 @@ inline const char* LookupOpcodeName(Opcodes id) return "INVALID OPCODE"; } + +inline std::string GetOpcodeNameForLogging(Opcodes id) +{ + uint32 opcode = uint32(id); + std::ostringstream ss; + ss << '[' << LookupOpcodeName(id) << " 0x" << std::hex << std::uppercase << opcode << std::nouppercase << " (" << std::dec << opcode << ")]"; + return ss.str().c_str(); +} + #endif /// @} diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index 92db86c2a35..e2755d3d1f7 100644 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -163,16 +163,29 @@ WorldSession::~WorldSession() delete _compressionStream; } -void WorldSession::SizeError(WorldPacket const& packet, uint32 size) const -{ - sLog->outError(LOG_FILTER_GENERAL, "Client (account %u) send packet %s (%u) with size " SIZEFMTD " but expected %u (attempt to crash server?), skipped", - GetAccountId(), LookupOpcodeName(packet.GetOpcode()), packet.GetOpcode(), packet.size(), size); -} - /// Get the player name -char const* WorldSession::GetPlayerName() const -{ - return GetPlayer() ? GetPlayer()->GetName() : ""; +std::string WorldSession::GetPlayerName(bool simple /* = true */) const + { + std::string name = "[Player: "; + uint32 guidLow = 0; + + if (Player* player = GetPlayer()) + { + name.append(player->GetName()); + guidLow = player->GetGUIDLow(); + } + else + name.append(""); + + if (!simple) + { + std::ostringstream ss; + ss << " (Guid: " << guidLow << ", Account: " << GetAccountId() << ")"; + name.append(ss.str()); + } + + name.append("]"); + return name; } /// Get player guid if available. Use for logging purposes only @@ -249,16 +262,15 @@ void WorldSession::QueuePacket(WorldPacket* new_packet) /// Logging helper for unexpected opcodes void WorldSession::LogUnexpectedOpcode(WorldPacket* packet, const char* status, const char *reason) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "SESSION (account: %u, guidlow: %u, char: %s): received unexpected opcode %s (0x%.4X, status: %s) %s", - GetAccountId(), m_GUIDLow, _player ? _player->GetName() : "", - LookupOpcodeName(packet->GetOpcode()), packet->GetOpcode(), status, reason); + sLog->outError(LOG_FILTER_OPCODES, "Received unexpected opcode %s Status: %s Reason: %s from %s", + GetOpcodeNameForLogging(packet->GetOpcode()).c_str(), status, reason, GetPlayerName(false).c_str()); } /// Logging helper for unexpected opcodes void WorldSession::LogUnprocessedTail(WorldPacket* packet) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "SESSION: opcode %s (0x%.4X) have unprocessed tail data (read stop at %u from %u)", - LookupOpcodeName(packet->GetOpcode()), packet->GetOpcode(), uint32(packet->rpos()), uint32(packet->wpos())); + sLog->outError(LOG_FILTER_OPCODES, "Unprocessed tail data (read stop at %u from %u) Opcode %s from %s", + uint32(packet->rpos()), uint32(packet->wpos()), GetOpcodeNameForLogging(packet->GetOpcode()).c_str(), GetPlayerName(false).c_str()); packet->print_storage(); } @@ -290,6 +302,7 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) _recvQueue.next(packet, updater)) { const OpcodeHandler* opHandle = opcodeTable[packet->GetOpcode()]; + try { switch (opHandle->status) @@ -309,8 +322,8 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) deletePacket = false; QueuePacket(packet); //! Log - sLog->outDebug(LOG_FILTER_NETWORKIO, "Re-enqueueing packet with opcode %s (0x%.4X) with with status STATUS_LOGGEDIN. " - "Player is currently not in world yet.", opHandle->name, packet->GetOpcode()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Re-enqueueing packet with opcode %s with with status STATUS_LOGGEDIN. " + "Player is currently not in world yet.", GetOpcodeNameForLogging(packet->GetOpcode()).c_str()); } } else if (_player->IsInWorld()) @@ -367,14 +380,12 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) LogUnprocessedTail(packet); break; case STATUS_NEVER: - sLog->outError(LOG_FILTER_NETWORKIO, "SESSION (account: %u, guidlow: %u, char: %s): received not allowed opcode %s (0x%.4X)", - GetAccountId(), m_GUIDLow, _player ? _player->GetName() : "", - LookupOpcodeName(packet->GetOpcode()), packet->GetOpcode()); + sLog->outError(LOG_FILTER_OPCODES, "Received not allowed opcode %s from %s", GetOpcodeNameForLogging(packet->GetOpcode()).c_str() + , GetPlayerName(false).c_str()); break; case STATUS_UNHANDLED: - sLog->outDebug(LOG_FILTER_NETWORKIO, "SESSION (account: %u, guidlow: %u, char: %s): received not handled opcode %s (0x%.4X)", - GetAccountId(), m_GUIDLow, _player ? _player->GetName() : "", - LookupOpcodeName(packet->GetOpcode()), packet->GetOpcode()); + sLog->outDebug(LOG_FILTER_OPCODES, "Received not handled opcode %s from %s", GetOpcodeNameForLogging(packet->GetOpcode()).c_str() + , GetPlayerName(false).c_str()); break; } } @@ -382,11 +393,7 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) { sLog->outError(LOG_FILTER_NETWORKIO, "WorldSession::Update ByteBufferException occured while parsing a packet (opcode: %u) from client %s, accountid=%i. Skipped packet.", packet->GetOpcode(), GetRemoteAddress().c_str(), GetAccountId()); - if (sLog->ShouldLog(LOG_FILTER_NETWORKIO, LOG_LEVEL_TRACE)) - { - sLog->outTrace(LOG_FILTER_NETWORKIO, "Dumping error causing packet:"); - packet->hexlike(); - } + packet->hexlike(); } if (deletePacket) @@ -648,30 +655,26 @@ const char *WorldSession::GetTrinityString(int32 entry) const void WorldSession::Handle_NULL(WorldPacket& recvPacket) { - sLog->outError(LOG_FILTER_GENERAL, "SESSION: received unhandled opcode %s (0x%.4X)", - LookupOpcodeName(recvPacket.GetOpcode()), - recvPacket.GetOpcode()); + sLog->outError(LOG_FILTER_OPCODES, "Received unhandled opcode %s from %s" + , GetOpcodeNameForLogging(recvPacket.GetOpcode()).c_str(), GetPlayerName(false).c_str()); } void WorldSession::Handle_EarlyProccess(WorldPacket& recvPacket) { - sLog->outError(LOG_FILTER_GENERAL, "SESSION: received opcode %s (0x%.4X) that must be processed in WorldSocket::OnRead", - LookupOpcodeName(recvPacket.GetOpcode()), - recvPacket.GetOpcode()); + sLog->outError(LOG_FILTER_OPCODES, "Received opcode %s that must be processed in WorldSocket::OnRead from %s" + , GetOpcodeNameForLogging(recvPacket.GetOpcode()).c_str(), GetPlayerName(false).c_str()); } void WorldSession::Handle_ServerSide(WorldPacket& recvPacket) { - sLog->outError(LOG_FILTER_GENERAL, "SESSION: received server-side opcode %s (0x%.4X)", - LookupOpcodeName(recvPacket.GetOpcode()), - recvPacket.GetOpcode()); + sLog->outError(LOG_FILTER_OPCODES, "Received server-side opcode %s from %s" + , GetOpcodeNameForLogging(recvPacket.GetOpcode()).c_str(), GetPlayerName(false).c_str()); } void WorldSession::Handle_Deprecated(WorldPacket& recvPacket) { - sLog->outError(LOG_FILTER_GENERAL, "SESSION: received deprecated opcode %s (0x%.4X)", - LookupOpcodeName(recvPacket.GetOpcode()), - recvPacket.GetOpcode()); + sLog->outError(LOG_FILTER_OPCODES, "Received deprecated opcode %s from %s" + , GetOpcodeNameForLogging(recvPacket.GetOpcode()).c_str(), GetPlayerName(false).c_str()); } void WorldSession::SendAuthWaitQue(uint32 position) diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 78af675a348..53398de8c65 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -240,8 +240,6 @@ class WorldSession bool PlayerLogoutWithSave() const { return m_playerLogout && m_playerSave; } bool PlayerRecentlyLoggedOut() const { return m_playerRecentlyLogout; } - void SizeError(WorldPacket const& packet, uint32 size) const; - void ReadAddonsInfo(WorldPacket& data); void SendAddonsInfo(); bool IsAddonRegistered(const std::string& prefix) const; @@ -264,7 +262,7 @@ class WorldSession AccountTypes GetSecurity() const { return _security; } uint32 GetAccountId() const { return _accountId; } Player* GetPlayer() const { return _player; } - char const* GetPlayerName() const; + std::string GetPlayerName(bool simple = true) const; uint32 GetGuidLow() const; void SetSecurity(AccountTypes security) { _security = security; } std::string const& GetRemoteAddress() { return m_Address; } diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index 783d53562a2..8211f846f7d 100644 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -173,7 +173,7 @@ int WorldSocket::SendPacket(WorldPacket const& pct) pkt = &buff; } - sLog->outInfo(LOG_FILTER_OPCODES, "S->C: %s 0x%.4X (%u)", LookupOpcodeName(pkt->GetOpcode()), uint32(pkt->GetOpcode()), uint32(pkt->GetOpcode())); + sLog->outInfo(LOG_FILTER_OPCODES, "S->C: %s", GetOpcodeNameForLogging(pkt->GetOpcode()).c_str()); sScriptMgr->OnPacketSend(this, *pkt); @@ -204,7 +204,7 @@ int WorldSocket::SendPacket(WorldPacket const& pct) if (msg_queue()->enqueue_tail(mb, (ACE_Time_Value*)&ACE_Time_Value::zero) == -1) { - sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::SendPacket enqueue_tail failed"); + sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::SendPacket enqueue_tail failed"); mb->release(); return -1; } @@ -247,7 +247,7 @@ int WorldSocket::open (void *a) if (peer().get_remote_addr(remote_addr) == -1) { - sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::open: peer().get_remote_addr errno = %s", ACE_OS::strerror (errno)); + sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::open: peer().get_remote_addr errno = %s", ACE_OS::strerror (errno)); return -1; } @@ -264,7 +264,7 @@ int WorldSocket::open (void *a) // Register with ACE Reactor if (reactor()->register_handler(this, ACE_Event_Handler::READ_MASK | ACE_Event_Handler::WRITE_MASK) == -1) { - sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::open: unable to register client handler errno = %s", ACE_OS::strerror (errno)); + sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::open: unable to register client handler errno = %s", ACE_OS::strerror (errno)); return -1; } @@ -300,14 +300,14 @@ int WorldSocket::handle_input (ACE_HANDLE) return Update(); // interesting line, isn't it ? } - sLog->outDebug(LOG_FILTER_GENERAL, "WorldSocket::handle_input: Peer error closing connection errno = %s", ACE_OS::strerror (errno)); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WorldSocket::handle_input: Peer error closing connection errno = %s", ACE_OS::strerror (errno)); errno = ECONNRESET; return -1; } case 0: { - sLog->outDebug(LOG_FILTER_GENERAL, "WorldSocket::handle_input: Peer has closed connection"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WorldSocket::handle_input: Peer has closed connection"); errno = ECONNRESET; return -1; @@ -376,7 +376,7 @@ int WorldSocket::handle_output_queue (GuardType& g) if (msg_queue()->dequeue_head(mblk, (ACE_Time_Value*)&ACE_Time_Value::zero) == -1) { - sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::handle_output_queue dequeue_head"); + sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::handle_output_queue dequeue_head"); return -1; } @@ -411,7 +411,7 @@ int WorldSocket::handle_output_queue (GuardType& g) if (msg_queue()->enqueue_head(mblk, (ACE_Time_Value*) &ACE_Time_Value::zero) == -1) { - sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::handle_output_queue enqueue_head"); + sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::handle_output_queue enqueue_head"); mblk->release(); return -1; } @@ -483,7 +483,7 @@ int WorldSocket::handle_input_header (void) if ((header.size < 4) || (header.size > 10240) || (header.cmd > 0xFFFF && (header.cmd >> 16) != 0x4C52)) // LR (from MSG_VERIFY_CONNECTIVITY) { Player* _player = m_Session ? m_Session->GetPlayer() : NULL; - sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::handle_input_header(): client (account: %u, char [GUID: %u, name: %s]) sent malformed packet (size: %d, cmd: %d)", + sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::handle_input_header(): client (account: %u, char [GUID: %u, name: %s]) sent malformed packet (size: %d, cmd: %d)", m_Session ? m_Session->GetAccountId() : 0, _player ? _player->GetGUIDLow() : 0, _player ? _player->GetName() : "", @@ -589,7 +589,7 @@ int WorldSocket::handle_input_missing_data (void) // hope this is not hack, as proper m_RecvWPct is asserted around if (!m_RecvWPct) { - sLog->outError(LOG_FILTER_GENERAL, "Forcing close on input m_RecvWPct = NULL"); + sLog->outError(LOG_FILTER_NETWORKIO, "Forcing close on input m_RecvWPct = NULL"); errno = EINVAL; return -1; } @@ -635,7 +635,7 @@ int WorldSocket::cancel_wakeup_output (GuardType& g) (this, ACE_Event_Handler::WRITE_MASK) == -1) { // would be good to store errno from reactor with errno guard - sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::cancel_wakeup_output"); + sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::cancel_wakeup_output"); return -1; } @@ -654,7 +654,7 @@ int WorldSocket::schedule_wakeup_output (GuardType& g) if (reactor()->schedule_wakeup (this, ACE_Event_Handler::WRITE_MASK) == -1) { - sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::schedule_wakeup_output"); + sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::schedule_wakeup_output"); return -1; } @@ -668,7 +668,7 @@ int WorldSocket::ProcessIncoming(WorldPacket* new_pct) // manage memory ;) ACE_Auto_Ptr aptr(new_pct); - const ACE_UINT16 opcode = PacketFilter::DropHighBytes(new_pct->GetOpcode()); + Opcodes opcode = PacketFilter::DropHighBytes(new_pct->GetOpcode()); if (closing_) return -1; @@ -677,7 +677,8 @@ int WorldSocket::ProcessIncoming(WorldPacket* new_pct) if (sPacketLog->CanLogPacket()) sPacketLog->LogPacket(*new_pct, CLIENT_TO_SERVER); - sLog->outInfo(LOG_FILTER_OPCODES, "C->S: %s 0x%.4X (%u)", LookupOpcodeName(Opcodes(opcode)), uint32(Opcodes(opcode)), uint32(Opcodes(opcode))); + char const* opcodeName = GetOpcodeNameForLogging(opcode).c_str(); + sLog->outInfo(LOG_FILTER_OPCODES, "C->S: %s", opcodeName); try { @@ -688,26 +689,26 @@ int WorldSocket::ProcessIncoming(WorldPacket* new_pct) case CMSG_AUTH_SESSION: if (m_Session) { - sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::ProcessIncoming: Player send CMSG_AUTH_SESSION again"); + sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::ProcessIncoming: received duplicate CMSG_AUTH_SESSION from %s", m_Session->GetPlayerName(false).c_str()); return -1; } sScriptMgr->OnPacketReceive(this, WorldPacket(*new_pct)); return HandleAuthSession(*new_pct); case CMSG_KEEP_ALIVE: - sLog->outInfo(LOG_FILTER_NETWORKIO, "CMSG_KEEP_ALIVE, size: " UI64FMTD, uint64(new_pct->size())); + sLog->outDebug(LOG_FILTER_NETWORKIO, "%s", GetOpcodeNameForLogging(opcode).c_str()); sScriptMgr->OnPacketReceive(this, WorldPacket(*new_pct)); return 0; case CMSG_LOG_DISCONNECT: new_pct->rfinish(); // contains uint32 disconnectReason; - sLog->outInfo(LOG_FILTER_NETWORKIO, "CMSG_LOG_DISCONNECT , size: " UI64FMTD, uint64(new_pct->size())); + sLog->outDebug(LOG_FILTER_NETWORKIO, "%s", opcodeName); sScriptMgr->OnPacketReceive(this, WorldPacket(*new_pct)); return 0; // not an opcode, client sends string "WORLD OF WARCRAFT CONNECTION - CLIENT TO SERVER" without opcode // first 4 bytes become the opcode (2 dropped) case MSG_VERIFY_CONNECTIVITY: { - sLog->outInfo(LOG_FILTER_NETWORKIO, "MSG_VERIFY_CONNECTIVITY , size: " UI64FMTD, uint64(new_pct->size())); + sLog->outDebug(LOG_FILTER_NETWORKIO, "%s", opcodeName); sScriptMgr->OnPacketReceive(this, WorldPacket(*new_pct)); std::string str; *new_pct >> str; @@ -717,48 +718,43 @@ int WorldSocket::ProcessIncoming(WorldPacket* new_pct) } case CMSG_ENABLE_NAGLE: { + sLog->outDebug(LOG_FILTER_NETWORKIO, "%s", opcodeName); sScriptMgr->OnPacketReceive(this, WorldPacket(*new_pct)); return m_Session ? m_Session->HandleEnableNagleAlgorithm() : -1; } default: { ACE_GUARD_RETURN(LockType, Guard, m_SessionLock, -1); - if (!opcodeTable[Opcodes(opcode)]) + if (!m_Session) { - sLog->outError(LOG_FILTER_NETWORKIO, "Opcode with no defined handler received from client: %u", new_pct->GetOpcode()); - return 0; - } - if (m_Session != NULL) - { - // Our Idle timer will reset on any non PING opcodes. - // Catches people idling on the login screen and any lingering ingame connections. - m_Session->ResetTimeOutTime(); - - // OK, give the packet to WorldSession - aptr.release(); - // WARNINIG here we call it with locks held. - // Its possible to cause deadlock if QueuePacket calls back - m_Session->QueuePacket(new_pct); - return 0; + sLog->outError(LOG_FILTER_NETWORKIO, "ProcessIncoming: Client not authed opcode = %u", uint32(opcode)); + return -1; } - else + + if (!opcodeTable[opcode]) { - sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::ProcessIncoming: Client not authed opcode = %u", uint32(opcode)); + sLog->outError(LOG_FILTER_NETWORKIO, "ProcessIncoming: Client not authed opcode = %u", uint32(opcode)); return -1; } + + // Our Idle timer will reset on any non PING opcodes. + // Catches people idling on the login screen and any lingering ingame connections. + m_Session->ResetTimeOutTime(); + + // OK, give the packet to WorldSession + aptr.release(); + // WARNINIG here we call it with locks held. + // Its possible to cause deadlock if QueuePacket calls back + m_Session->QueuePacket(new_pct); + return 0; } } } catch (ByteBufferException &) { - sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::ProcessIncoming ByteBufferException occured while parsing an instant handled packet (opcode: %u) from client %s, accountid=%i. Disconnected client.", - opcode, GetRemoteAddress().c_str(), m_Session ? int32(m_Session->GetAccountId()) : -1); - if (sLog->ShouldLog(LOG_FILTER_NETWORKIO, LOG_LEVEL_DEBUG)) - { - sLog->outDebug(LOG_FILTER_NETWORKIO, "Dumping error causing packet:"); - new_pct->hexlike(); - } - + sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::ProcessIncoming ByteBufferException occured while parsing an instant handled packet (opcode: %u) from client %s, accountid=%i. Disconnected client.", + opcodeName, GetRemoteAddress().c_str(), m_Session ? int32(m_Session->GetAccountId()) : -1); + new_pct->hexlike(); return -1; } @@ -840,7 +836,7 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) packet << uint8(AUTH_REJECT); SendPacket(packet); - sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::HandleAuthSession: World closed, denying client (%s).", GetRemoteAddress().c_str()); + sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::HandleAuthSession: World closed, denying client (%s).", GetRemoteAddress().c_str()); return -1; } @@ -861,7 +857,7 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) SendPacket(packet); - sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::HandleAuthSession: Sent Auth Response (unknown account)."); + sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::HandleAuthSession: Sent Auth Response (unknown account)."); return -1; } @@ -872,7 +868,7 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) if (expansion > world_expansion) expansion = world_expansion; - sLog->outDebug(LOG_FILTER_GENERAL, "WorldSocket::HandleAuthSession: (s,v) check s: %s v: %s", + sLog->outDebug(LOG_FILTER_NETWORKIO, "WorldSocket::HandleAuthSession: (s,v) check s: %s v: %s", fields[5].GetCString(), fields[4].GetCString()); @@ -887,7 +883,7 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) packet << uint8(AUTH_FAILED); SendPacket(packet); - sLog->outDebug(LOG_FILTER_GENERAL, "WorldSocket::HandleAuthSession: Sent Auth Response (Account IP differs)."); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WorldSocket::HandleAuthSession: Sent Auth Response (Account IP differs)."); return -1; } } @@ -953,7 +949,7 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) packet << uint8(AUTH_BANNED); SendPacket(packet); - sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::HandleAuthSession: Sent Auth Response (Account banned)."); + sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::HandleAuthSession: Sent Auth Response (Account banned)."); return -1; } @@ -969,7 +965,7 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) SendPacket(packet); - sLog->outInfo(LOG_FILTER_GENERAL, "WorldSocket::HandleAuthSession: User tries to login but his security level is not enough"); + sLog->outInfo(LOG_FILTER_NETWORKIO, "WorldSocket::HandleAuthSession: User tries to login but his security level is not enough"); return -1; } @@ -994,11 +990,11 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) packet << uint8(AUTH_FAILED); SendPacket(packet); - sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::HandleAuthSession: Authentication failed for account: %u ('%s') address: %s", id, account.c_str(), address.c_str()); + sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::HandleAuthSession: Authentication failed for account: %u ('%s') address: %s", id, account.c_str(), address.c_str()); return -1; } - sLog->outDebug(LOG_FILTER_GENERAL, "WorldSocket::HandleAuthSession: Client '%s' authenticated successfully from %s.", + sLog->outDebug(LOG_FILTER_NETWORKIO, "WorldSocket::HandleAuthSession: Client '%s' authenticated successfully from %s.", account.c_str(), address.c_str()); @@ -1073,12 +1069,8 @@ int WorldSocket::HandlePing (WorldPacket& recvPacket) if (m_Session && AccountMgr::IsPlayerAccount(m_Session->GetSecurity())) { - Player* _player = m_Session->GetPlayer(); - sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::HandlePing: Player (account: %u, GUID: %u, name: %s) kicked for over-speed pings (address: %s)", - m_Session->GetAccountId(), - _player ? _player->GetGUIDLow() : 0, - _player ? _player->GetName() : "", - GetRemoteAddress().c_str()); + sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::HandlePing: %s kicked for over-speed pings (address: %s)", + m_Session->GetPlayerName(false).c_str(), GetRemoteAddress().c_str()); return -1; } @@ -1096,7 +1088,7 @@ int WorldSocket::HandlePing (WorldPacket& recvPacket) m_Session->SetLatency (latency); else { - sLog->outError(LOG_FILTER_GENERAL, "WorldSocket::HandlePing: peer sent CMSG_PING, " + sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::HandlePing: peer sent CMSG_PING, " "but is not authenticated or got recently kicked, " " address = %s", GetRemoteAddress().c_str()); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index e9c498392ee..be18785e76e 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -4923,7 +4923,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool { if (Battleground* bg = target->ToPlayer()->GetBattleground()) bg->RemovePlayerFromResurrectQueue(target->GetGUID()); - if(Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(target->GetZoneId())) + if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(target->GetZoneId())) bf->RemovePlayerFromResurrectQueue(target->GetGUID()); } break; @@ -4962,6 +4962,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool target->CastSpell((Unit*)NULL, GetAmount(), true, NULL, this); break; case 58600: // Restricted Flight Area + case 58730: // Restricted Flight Area if (aurApp->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE) target->CastSpell(target, 58601, true); break; diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 46f735d26f1..ed8a4252128 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -5439,8 +5439,8 @@ SpellCastResult Spell::CheckCast(bool strict) if (m_originalCaster && m_originalCaster->GetTypeId() == TYPEID_PLAYER && m_originalCaster->isAlive()) { Battlefield* Bf = sBattlefieldMgr->GetBattlefieldToZoneId(m_originalCaster->GetZoneId()); - if (AreaTableEntry const* pArea = GetAreaEntryByAreaID(m_originalCaster->GetAreaId())) - if (pArea->flags & AREA_FLAG_NO_FLY_ZONE) + if (AreaTableEntry const* area = GetAreaEntryByAreaID(m_originalCaster->GetAreaId())) + if (area->flags & AREA_FLAG_NO_FLY_ZONE || (Bf && !Bf->CanFlyIn())) return (_triggeredCastFlags & TRIGGERED_DONT_REPORT_CAST_ERROR) ? SPELL_FAILED_DONT_REPORT : SPELL_FAILED_NOT_HERE; } break; diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index d1af1832ce4..be5d4e3fa74 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -5928,6 +5928,7 @@ void Spell::EffectPlayerNotification(SpellEffIndex effIndex) case 58730: // Restricted Flight Area case 58600: // Restricted Flight Area unitTarget->ToPlayer()->GetSession()->SendNotification(LANG_ZONE_NOFLYZONE); + unitTarget->PlayDirectSound(9417); // Fel Reaver sound break; } diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 4cc72cc3660..03824cf7dc9 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -3249,6 +3249,22 @@ void SpellMgr::LoadDbcDataCorrections() // this needs research on modifier applying rules, does not seem to be in Attributes fields spellInfo->EffectSpellClassMask[0] = flag96(0x00000040, 0x00000000, 0x00000000); break; + case 64949: // Idol of the Flourishing Life + spellInfo->EffectSpellClassMask[EFFECT_0] = flag96(0x00000000, 0x02000000, 0x00000000); + spellInfo->EffectApplyAuraName[EFFECT_0] = SPELL_AURA_ADD_FLAT_MODIFIER; + break; + case 34231: // Libram of the Lightbringer + case 60792: // Libram of Tolerance + case 64956: // Libram of the Resolute + spellInfo->EffectSpellClassMask[EFFECT_0] = flag96(0x80000000, 0x00000000, 0x00000000); + spellInfo->EffectApplyAuraName[EFFECT_0] = SPELL_AURA_ADD_FLAT_MODIFIER; + break; + case 28851: // Libram of Light + case 28853: // Libram of Divinity + case 32403: // Blessed Book of Nagrand + spellInfo->EffectSpellClassMask[EFFECT_0] = flag96(0x40000000, 0x00000000, 0x00000000); + spellInfo->EffectApplyAuraName[EFFECT_0] = SPELL_AURA_ADD_FLAT_MODIFIER; + break; case 45602: // Ride Carpet spellInfo->EffectBasePoints[EFFECT_0] = 0; // force seat 0, vehicle doesn't have the required seat flags for "no seat specified (-1)" break; diff --git a/src/server/game/Warden/Warden.cpp b/src/server/game/Warden/Warden.cpp index 06f11cfaa2c..d651fbd4ce1 100644 --- a/src/server/game/Warden/Warden.cpp +++ b/src/server/game/Warden/Warden.cpp @@ -105,9 +105,8 @@ void Warden::Update() // Kick player if client response delays more than set in config if (_clientResponseTimer > maxClientResponseDelay * IN_MILLISECONDS) { - sLog->outDebug(LOG_FILTER_WARDEN, "WARDEN: Player %s (guid: %u, account: %u, latency: %u, IP: %s) exceeded Warden module response delay for more than %s - disconnecting client", - _session->GetPlayerName(), _session->GetGuidLow(), _session->GetAccountId(), _session->GetLatency(), _session->GetRemoteAddress().c_str(), - secsToTimeString(maxClientResponseDelay, true).c_str()); + sLog->outWarn(LOG_FILTER_WARDEN, "%s (latency: %u, IP: %s) exceeded Warden module response delay for more than %s - disconnecting client", + _session->GetPlayerName(false).c_str(), _session->GetLatency(), _session->GetRemoteAddress().c_str(), secsToTimeString(maxClientResponseDelay, true).c_str()); _session->KickPlayer(); } else diff --git a/src/server/game/Warden/WardenMac.cpp b/src/server/game/Warden/WardenMac.cpp index 96b71912421..9c90662105a 100644 --- a/src/server/game/Warden/WardenMac.cpp +++ b/src/server/game/Warden/WardenMac.cpp @@ -152,9 +152,7 @@ void WardenMac::HandleHashResult(ByteBuffer &buff) // Verify key if (memcmp(buff.contents() + 1, sha1.GetDigest(), 20) != 0) { - sLog->outDebug(LOG_FILTER_WARDEN, "Request hash reply: failed"); - sLog->outDebug(LOG_FILTER_WARDEN, "WARDEN: Player %s (guid: %u, account: %u) failed hash reply. Action: %s", - _session->GetPlayerName(), _session->GetGuidLow(), _session->GetAccountId(), Penalty().c_str()); + sLog->outWarn(LOG_FILTER_WARDEN, "%s failed hash reply. Action: %s", _session->GetPlayerName(false).c_str(), Penalty().c_str()); return; } diff --git a/src/server/game/Warden/WardenWin.cpp b/src/server/game/Warden/WardenWin.cpp index 7aea6794e01..20f09ec5bda 100644 --- a/src/server/game/Warden/WardenWin.cpp +++ b/src/server/game/Warden/WardenWin.cpp @@ -156,9 +156,7 @@ void WardenWin::HandleHashResult(ByteBuffer &buff) // Verify key if (memcmp(buff.contents() + 1, Module.ClientKeySeedHash, 20) != 0) { - sLog->outDebug(LOG_FILTER_WARDEN, "Request hash reply: failed"); - sLog->outDebug(LOG_FILTER_WARDEN, "WARDEN: Player %s (guid: %u, account: %u) failed hash reply. Action: %s", - _session->GetPlayerName(), _session->GetGuidLow(), _session->GetAccountId(), Penalty().c_str()); + sLog->outWarn(LOG_FILTER_WARDEN, "%s failed hash reply. Action: %s", _session->GetPlayerName(false).c_str(), Penalty().c_str()); return; } @@ -343,9 +341,7 @@ void WardenWin::HandleData(ByteBuffer &buff) if (!IsValidCheckSum(Checksum, buff.contents() + buff.rpos(), Length)) { buff.rpos(buff.wpos()); - sLog->outDebug(LOG_FILTER_WARDEN, "CHECKSUM FAIL"); - sLog->outDebug(LOG_FILTER_WARDEN, "WARDEN: Player %s (guid: %u, account: %u) failed checksum. Action: %s", - _session->GetPlayerName(), _session->GetGuidLow(), _session->GetAccountId(), Penalty().c_str()); + sLog->outWarn(LOG_FILTER_WARDEN, "%s failed checksum. Action: %s", _session->GetPlayerName(false).c_str(), Penalty().c_str()); return; } @@ -356,9 +352,7 @@ void WardenWin::HandleData(ByteBuffer &buff) // TODO: test it. if (result == 0x00) { - sLog->outDebug(LOG_FILTER_WARDEN, "TIMING CHECK FAIL result 0x00"); - sLog->outDebug(LOG_FILTER_WARDEN, "WARDEN: Player %s (guid: %u, account: %u) failed timing check. Action: %s", - _session->GetPlayerName(), _session->GetGuidLow(), _session->GetAccountId(), Penalty().c_str()); + sLog->outWarn(LOG_FILTER_WARDEN, "%s failed timing check. Action: %s", _session->GetPlayerName(false).c_str(), Penalty().c_str()); return; } @@ -500,9 +494,7 @@ void WardenWin::HandleData(ByteBuffer &buff) if (checkFailed > 0) { WardenCheck* check = sWardenCheckMgr->GetWardenDataById(checkFailed); - - sLog->outDebug(LOG_FILTER_WARDEN, "WARDEN: Player %s (guid: %u, account: %u) failed Warden check %u. Action: %s", - _session->GetPlayerName(), _session->GetGuidLow(), _session->GetAccountId(), checkFailed, Penalty(check).c_str()); + sLog->outWarn(LOG_FILTER_WARDEN, "%s failed Warden check %u. Action: %s", _session->GetPlayerName(false).c_str(), checkFailed, Penalty(check).c_str()); } // Set hold off timer, minimum timer should at least be 1 second diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 273820d02ff..e7c140c01b8 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1720,7 +1720,7 @@ void World::SetInitialWorldSettings() sOutdoorPvPMgr->InitOutdoorPvP(); ///- Initialize Battlefield - sLog->outInfo(LOG_FILTER_GENERAL, "Starting Battlefield System"); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Starting Battlefield System"); sBattlefieldMgr->InitBattlefield(); sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Transports..."); diff --git a/src/server/scripts/Commands/CMakeLists.txt b/src/server/scripts/Commands/CMakeLists.txt index bd439c2c473..d5ebeab3b8a 100644 --- a/src/server/scripts/Commands/CMakeLists.txt +++ b/src/server/scripts/Commands/CMakeLists.txt @@ -13,6 +13,7 @@ set(scripts_STAT_SRCS Commands/cs_account.cpp Commands/cs_achievement.cpp Commands/cs_ban.cpp + Commands/cs_bf.cpp Commands/cs_cast.cpp Commands/cs_character.cpp Commands/cs_debug.cpp diff --git a/src/server/scripts/Commands/cs_ban.cpp b/src/server/scripts/Commands/cs_ban.cpp index b84a7e5544a..bfb52d342e1 100644 --- a/src/server/scripts/Commands/cs_ban.cpp +++ b/src/server/scripts/Commands/cs_ban.cpp @@ -107,7 +107,7 @@ public: return false; } - switch (sWorld->BanCharacter(name, durationStr, reasonStr, handler->GetSession() ? handler->GetSession()->GetPlayerName() : "")) + switch (sWorld->BanCharacter(name, durationStr, reasonStr, handler->GetSession() ? handler->GetSession()->GetPlayerName().c_str() : "")) { case BAN_SUCCESS: { @@ -183,7 +183,7 @@ public: break; } - switch (sWorld->BanAccount(mode, nameOrIP, durationStr, reasonStr, handler->GetSession() ? handler->GetSession()->GetPlayerName() : "")) + switch (sWorld->BanAccount(mode, nameOrIP, durationStr, reasonStr, handler->GetSession() ? handler->GetSession()->GetPlayerName().c_str() : "")) { case BAN_SUCCESS: if (atoi(durationStr) > 0) diff --git a/src/server/scripts/Commands/cs_quest.cpp b/src/server/scripts/Commands/cs_quest.cpp index 2472a29e595..7e489a5781e 100644 --- a/src/server/scripts/Commands/cs_quest.cpp +++ b/src/server/scripts/Commands/cs_quest.cpp @@ -38,6 +38,7 @@ public: { "add", SEC_ADMINISTRATOR, false, &HandleQuestAdd, "", NULL }, { "complete", SEC_ADMINISTRATOR, false, &HandleQuestComplete, "", NULL }, { "remove", SEC_ADMINISTRATOR, false, &HandleQuestRemove, "", NULL }, + { "reward", SEC_ADMINISTRATOR, false, &HandleQuestReward, "", NULL }, { NULL, 0, false, NULL, "", NULL } }; static ChatCommand commandTable[] = @@ -77,7 +78,7 @@ public: // check item starting quest (it can work incorrectly if added without item in inventory) ItemTemplateContainer const* itc = sObjectMgr->GetItemTemplateStore(); - ItemTemplateContainer::const_iterator result = find_if (itc->begin(), itc->end(), Finder(entry, &ItemTemplate::StartQuest)); + ItemTemplateContainer::const_iterator result = find_if(itc->begin(), itc->end(), Finder(entry, &ItemTemplate::StartQuest)); if (result != itc->end()) { @@ -244,6 +245,38 @@ public: player->CompleteQuest(entry); return true; } + + static bool HandleQuestReward(ChatHandler* handler, char const* args) + { + Player* player = handler->getSelectedPlayer(); + if (!player) + { + handler->SendSysMessage(LANG_NO_CHAR_SELECTED); + handler->SetSentErrorMessage(true); + return false; + } + + // .quest reward #entry + // number or [name] Shift-click form |color|Hquest:quest_id:quest_level|h[name]|h|r + char* cId = handler->extractKeyFromLink((char*)args, "Hquest"); + if (!cId) + return false; + + uint32 entry = atol(cId); + + Quest const* quest = sObjectMgr->GetQuestTemplate(entry); + + // If player doesn't have the quest + if (!quest || player->GetQuestStatus(entry) != QUEST_STATUS_COMPLETE) + { + handler->PSendSysMessage(LANG_COMMAND_QUEST_NOTFOUND, entry); + handler->SetSentErrorMessage(true); + return false; + } + + player->RewardQuest(quest, 0, player); + return true; + } }; void AddSC_quest_commandscript() diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp index 1019deac106..89fdcc7f725 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp @@ -207,7 +207,7 @@ public: { if (!m_bIntro) { - DoScriptText(SAY_INTRO, me); + Talk(SAY_INTRO); m_bIntro = false; } } @@ -225,7 +225,7 @@ public: void JustDied(Unit* /*killer*/) { Summons.DespawnAll(); - DoScriptText(SAY_DEATH, me); + Talk(SAY_DEATH); if (instance) instance->SetData(TYPE_ANUBARAK, DONE); } @@ -242,7 +242,7 @@ public: break; case NPC_SPIKE: summoned->CombatStart(target); - DoScriptText(EMOTE_SPIKE, me, target); + Talk(EMOTE_SPIKE, target->GetGUID()); break; } Summons.Summon(summoned); @@ -260,7 +260,7 @@ public: void EnterCombat(Unit* /*who*/) { - DoScriptText(SAY_AGGRO, me); + Talk(SAY_AGGRO); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); me->SetInCombatWithZone(); if (instance) @@ -405,8 +405,8 @@ public: { m_bReachedPhase3 = true; DoCastAOE(SPELL_LEECHING_SWARM); - DoScriptText(EMOTE_LEECHING_SWARM, me); - DoScriptText(SAY_LEECHING_SWARM, me); + Talk(EMOTE_LEECHING_SWARM); + Talk(SAY_LEECHING_SWARM); } if (m_uiBerserkTimer <= uiDiff && !me->HasAura(SPELL_BERSERK)) diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp index f9e2080895a..10f7150351e 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp @@ -161,7 +161,7 @@ public: void JustDied(Unit* /*killer*/) { Summons.DespawnAll(); - DoScriptText(SAY_DEATH, me); + Talk(SAY_DEATH); if (instance) instance->SetData(TYPE_JARAXXUS, DONE); } @@ -176,7 +176,7 @@ public: me->SetInCombatWithZone(); if (instance) instance->SetData(TYPE_JARAXXUS, IN_PROGRESS); - DoScriptText(SAY_AGGRO, me); + Talk(SAY_AGGRO); } void UpdateAI(const uint32 uiDiff) @@ -186,8 +186,8 @@ public: if (m_uiSummonInfernalEruptionTimer <= uiDiff) { - DoScriptText(EMOTE_INFERNAL_ERUPTION, me); - DoScriptText(SAY_INFERNAL_ERUPTION, me); + Talk(EMOTE_INFERNAL_ERUPTION); + Talk(SAY_INFERNAL_ERUPTION); DoCast(SPELL_INFERNAL_ERUPTION); m_uiSummonInfernalEruptionTimer = 2*MINUTE*IN_MILLISECONDS; } else m_uiSummonInfernalEruptionTimer -= uiDiff; @@ -217,8 +217,8 @@ public: { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0, true)) { - DoScriptText(EMOTE_INCINERATE, me, target); - DoScriptText(SAY_INCINERATE, me); + Talk(EMOTE_INCINERATE, target->GetGUID()); + Talk(SAY_INCINERATE); DoCast(target, SPELL_INCINERATE_FLESH); } m_uiIncinerateFleshTimer = urand(20*IN_MILLISECONDS, 25*IN_MILLISECONDS); @@ -234,7 +234,7 @@ public: { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0, true)) { - DoScriptText(EMOTE_LEGION_FLAME, me, target); + Talk(EMOTE_LEGION_FLAME, target->GetGUID()); DoCast(target, SPELL_LEGION_FLAME); } m_uiLegionFlameTimer = 30*IN_MILLISECONDS; diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp index db9bc3581ea..88e0fe5ba66 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp @@ -905,6 +905,8 @@ public: if (m_uiMassiveCrashTimer <= diff) { me->GetMotionMaster()->MoveJump(ToCCommonLoc[1].GetPositionX(), ToCCommonLoc[1].GetPositionY(), ToCCommonLoc[1].GetPositionZ(), 10.0f, 20.0f); // 1: Middle of the room + SetCombatMovement(false); + me->AttackStop(); m_uiStage = 7; //Invalid (Do nothing more than move) m_uiMassiveCrashTimer = 30*IN_MILLISECONDS; } else m_uiMassiveCrashTimer -= diff; @@ -913,22 +915,28 @@ public: break; case 1: DoCastAOE(SPELL_MASSIVE_CRASH); + me->StopMoving(); + me->AttackStop(); m_uiStage = 2; break; case 2: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true)) { + me->StopMoving(); + me->AttackStop(); m_uiTrampleTargetGUID = target->GetGUID(); me->SetTarget(m_uiTrampleTargetGUID); m_bTrampleCasted = false; - SetCombatMovement(false); - me->GetMotionMaster()->MoveIdle(); + //SetCombatMovement(false); + //me->GetMotionMaster()->MoveIdle(); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); m_uiTrampleTimer = 4*IN_MILLISECONDS; m_uiStage = 3; } else m_uiStage = 6; break; case 3: + me->StopMoving(); + me->AttackStop(); if (m_uiTrampleTimer <= diff) { if (Unit* target = Unit::GetPlayer(*me, m_uiTrampleTargetGUID)) @@ -941,12 +949,14 @@ public: me->GetMotionMaster()->MoveJump(2*me->GetPositionX()-m_fTrampleTargetX, 2*me->GetPositionY()-m_fTrampleTargetY, me->GetPositionZ(), - 10.0f, 20.0f); // 2: Hop Backwards + 20.0f, 30.0f); // 2: Hop Backwards m_uiStage = 7; //Invalid (Do nothing more than move) } else m_uiStage = 6; } else m_uiTrampleTimer -= diff; break; case 4: + me->StopMoving(); + me->AttackStop(); Talk(EMOTE_TRAMPLE_START, m_uiTrampleTargetGUID); me->GetMotionMaster()->MoveCharge(m_fTrampleTargetX, m_fTrampleTargetY, m_fTrampleTargetZ+2, 42, 1); me->SetTarget(0); diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp index 203e49420be..a65eaebbc0c 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp @@ -254,7 +254,7 @@ struct boss_twin_baseAI : public ScriptedAI void JustDied(Unit* /*killer*/) { - DoScriptText(SAY_DEATH, me); + Talk(SAY_DEATH); if (instance) { if (Creature* pSister = GetSister()) @@ -296,7 +296,7 @@ struct boss_twin_baseAI : public ScriptedAI instance->SetData(TYPE_VALKIRIES, IN_PROGRESS); } - DoScriptText(SAY_AGGRO, me); + Talk(SAY_AGGRO); DoCast(me, m_uiSurgeSpellId); } @@ -384,7 +384,7 @@ struct boss_twin_baseAI : public ScriptedAI if (!m_bIsBerserk && m_uiBerserkTimer <= uiDiff) { DoCast(me, SPELL_BERSERK); - DoScriptText(SAY_BERSERK, me); + Talk(SAY_BERSERK); m_bIsBerserk = true; } else diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp index 3fb76ea52dc..9767126371b 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp @@ -244,10 +244,18 @@ class instance_trial_of_the_crusader : public InstanceMapScript switch (type) { case TYPE_JARAXXUS: + // Cleanup Icehowl + if (Creature* icehowl = instance->GetCreature(IcehowlGUID)) + icehowl->DespawnOrUnsummon(); if (data == DONE) EventStage = 2000; break; case TYPE_CRUSADERS: + // Cleanup Jaraxxus + if (Creature* jaraxxus = instance->GetCreature(JaraxxusGUID)) + jaraxxus->DespawnOrUnsummon(); + if (Creature* fizzlebang = instance->GetCreature(FizzlebangGUID)) + fizzlebang->DespawnOrUnsummon(); switch (data) { case IN_PROGRESS: @@ -267,6 +275,9 @@ class instance_trial_of_the_crusader : public InstanceMapScript } break; case TYPE_VALKIRIES: + // Cleanup chest + if (GameObject* cache = instance->GetGameObject(CrusadersCacheGUID)) + cache->Delete(); switch (data) { case FAIL: diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp index 7064368f090..37d08484f0b 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp @@ -789,7 +789,7 @@ class npc_tirion_toc : public CreatureScript case 5005: m_uiUpdateTimer = 8000; instance->SetData(TYPE_EVENT, 5010); - me->SummonCreature(NPC_LICH_KING_1, ToCSpawnLoc[0].GetPositionX(), ToCSpawnLoc[0].GetPositionY(), ToCSpawnLoc[0].GetPositionZ(), 5); + me->SummonCreature(NPC_LICH_KING_1, ToCCommonLoc[2].GetPositionX(), ToCCommonLoc[2].GetPositionY(), ToCCommonLoc[2].GetPositionZ(), 5); break; case 5020: Talk(SAY_STAGE_4_03); diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.h b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.h index f361c3521d1..ba230551b24 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.h +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.h @@ -53,8 +53,8 @@ const Position ToCCommonLoc[]= {563.833008f, 195.244995f, 394.585561f, 0}, // 5 - Center {573.5f, 180.5f, 395.14f, 0}, // 6 Move 0 Right {553.5f, 180.5f, 395.14f, 0}, // 7 Move 0 Left - {585.5f, 170.0f, 395.14f, 0}, // 8 Move 1 Right - {545.5f, 170.0f, 395.14f, 0}, // 9 Move 1 Left + {573.0f, 170.0f, 395.14f, 0}, // 8 Move 1 Right + {555.5f, 170.0f, 395.14f, 0}, // 9 Move 1 Left {563.8f, 216.1f, 395.1f, 0}, // 10 Behind the door {575.042358f, 195.260727f, 395.137146f, 0}, // 5 diff --git a/src/server/scripts/Northrend/wintergrasp.cpp b/src/server/scripts/Northrend/wintergrasp.cpp index 37994e40b63..fc967acf9e2 100644 --- a/src/server/scripts/Northrend/wintergrasp.cpp +++ b/src/server/scripts/Northrend/wintergrasp.cpp @@ -139,7 +139,7 @@ class npc_wg_demolisher_engineer : public CreatureScript return true; } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender */, uint32 action) + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->CLOSE_GOSSIP_MENU(); @@ -207,7 +207,7 @@ class npc_wg_spirit_guide : public CreatureScript return true; } - bool OnGossipSelect(Player* player, Creature* /*creature */ , uint32 /*sender */ , uint32 action) + bool OnGossipSelect(Player* player, Creature* /*creature*/ , uint32 /*sender */ , uint32 action) { player->CLOSE_GOSSIP_MENU(); @@ -225,17 +225,16 @@ class npc_wg_spirit_guide : public CreatureScript struct npc_wg_spirit_guideAI : public ScriptedAI { - npc_wg_spirit_guideAI(Creature* creature) : ScriptedAI(creature) - { } + npc_wg_spirit_guideAI(Creature* creature) : ScriptedAI(creature) { } - void UpdateAI(const uint32 /* diff */) + void UpdateAI(uint32 const /*diff*/) { if (!me->HasUnitState(UNIT_STATE_CASTING)) DoCast(me, SPELL_CHANNEL_SPIRIT_HEAL); } }; - CreatureAI *GetAI(Creature* creature) const + CreatureAI* GetAI(Creature* creature) const { return new npc_wg_spirit_guideAI(creature); } @@ -258,7 +257,7 @@ class npc_wg_queue : public CreatureScript if (wintergrasp->IsWarTime()) { player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, sObjectMgr->GetTrinityStringForDBCLocale(WG_NPCQUEUE_TEXTOPTION_JOIN), GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - player->SEND_GOSSIP_MENU(wintergrasp->GetDefenderTeam()? WG_NPCQUEUE_TEXT_H_WAR : WG_NPCQUEUE_TEXT_A_WAR, creature->GetGUID()); + player->SEND_GOSSIP_MENU(wintergrasp->GetDefenderTeam() ? WG_NPCQUEUE_TEXT_H_WAR : WG_NPCQUEUE_TEXT_A_WAR, creature->GetGUID()); } else { @@ -275,7 +274,7 @@ class npc_wg_queue : public CreatureScript return true; } - bool OnGossipSelect(Player* player, Creature* /*creature */ , uint32 /*sender */ , uint32 /*action*/) + bool OnGossipSelect(Player* player, Creature* /*creature*/ , uint32 /*sender*/ , uint32 /*action*/) { player->CLOSE_GOSSIP_MENU(); @@ -302,9 +301,7 @@ class go_wg_vehicle_teleporter : public GameObjectScript struct go_wg_vehicle_teleporterAI : public GameObjectAI { - go_wg_vehicle_teleporterAI(GameObject* gameObject) : GameObjectAI(gameObject), - _checkTimer(1000) - { } + go_wg_vehicle_teleporterAI(GameObject* gameObject) : GameObjectAI(gameObject), _checkTimer(1000) { } void UpdateAI(uint32 diff) { @@ -324,6 +321,7 @@ class go_wg_vehicle_teleporter : public GameObjectScript } else _checkTimer -= diff; } + private: uint32 _checkTimer; }; @@ -358,12 +356,12 @@ class npc_wg_quest_giver : public CreatureScript for (QuestRelations::const_iterator i = objectQIR.first; i != objectQIR.second; ++i) { - uint32 quest_id = i->second; - QuestStatus status = player->GetQuestStatus(quest_id); + uint32 questId = i->second; + QuestStatus status = player->GetQuestStatus(questId); if (status == QUEST_STATUS_COMPLETE) - qm.AddMenuItem(quest_id, 4); + qm.AddMenuItem(questId, 4); else if (status == QUEST_STATUS_INCOMPLETE) - qm.AddMenuItem(quest_id, 4); + qm.AddMenuItem(questId, 4); //else if (status == QUEST_STATUS_AVAILABLE) // qm.AddMenuItem(quest_id, 2); } @@ -549,17 +547,14 @@ public: } }; - - void AddSC_wintergrasp() { new npc_wg_queue(); new npc_wg_spirit_guide(); new npc_wg_demolisher_engineer(); + new go_wg_vehicle_teleporter(); new npc_wg_quest_giver(); - new achievement_wg_didnt_stand_a_chance(); new spell_wintergrasp_force_building(); new spell_wintergrasp_grab_passenger(); - - new go_wg_vehicle_teleporter(); + new achievement_wg_didnt_stand_a_chance(); } diff --git a/src/server/worldserver/Master.cpp b/src/server/worldserver/Master.cpp index 48e07c727b4..7587a9d1904 100755 --- a/src/server/worldserver/Master.cpp +++ b/src/server/worldserver/Master.cpp @@ -240,7 +240,7 @@ int Master::Run() if (ConfigMgr::GetBoolDefault("SOAP.Enabled", false)) { TCSoapRunnable* runnable = new TCSoapRunnable(); - runnable->setListenArguments(ConfigMgr::GetStringDefault("SOAP.IP", "127.0.0.1"), ConfigMgr::GetIntDefault("SOAP.Port", 7878)); + runnable->setListenArguments(ConfigMgr::GetStringDefault("SOAP.IP", "127.0.0.1"), uint16(ConfigMgr::GetIntDefault("SOAP.Port", 7878))); soap_thread = new ACE_Based::Thread(runnable); } diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index 28bd8aecaf3..fbd45bec8e1 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -20,6 +20,7 @@ # SERVER RATES # AUTO BROADCAST # BATTLEGROUND CONFIG +# BATTLEFIELD CONFIG # ARENA CONFIG # NETWORK CONFIG # CONSOLE AND REMOTE ACCESS @@ -2183,6 +2184,62 @@ Battleground.Random.ResetHour = 6 # ################################################################################################### +################################################################################################### +# BATTLEFIELD CONFIG +# +# Wintergrasp.Enable +# Description: Enable the Wintergrasp battlefield. +# Default: 0 - (Disabled) +# 1 - (Enabled, Experimental as of still being in development) + +Wintergrasp.Enable = 0 + +# +# Wintergrasp.PlayerMax +# Description: Maximum number of players allowed in Wintergrasp. +# Default: 100 + +Wintergrasp.PlayerMax = 100 + +# +# Wintergrasp.PlayerMin +# Description: Minimum number of players required for Wintergrasp. +# Default: 0 + +Wintergrasp.PlayerMin = 0 + +# +# Wintergrasp.PlayerMinLvl +# Description: Required character level for the Wintergrasp battle. +# Default: 77 + +Wintergrasp.PlayerMinLvl = 77 + +# +# Wintergrasp.BattleTimer +# Description: Time (in minutes) for the Wintergrasp battle to last. +# Default: 30 + +Wintergrasp.BattleTimer = 30 + +# +# Wintergrasp.NoBattleTimer +# Description: Time (in minutes) between Wintergrasp battles. +# Default: 150 + +Wintergrasp.NoBattleTimer = 150 + +# +# Wintergrasp.CrashRestartTimer +# Description: Time (in minutes) to delay the restart of Wintergrasp if the world server +# crashed during a running battle. +# Default: 10 + +Wintergrasp.CrashRestartTimer = 10 + +# +################################################################################################### + ################################################################################################### # ARENA CONFIG # @@ -2651,7 +2708,7 @@ Appender.GM=2,2,0,GM.log Appender.DBErrors=2,2,0,DBErrors.log Appender.Char=2,2,0,Char.log,w Appender.RA=2,2,0,RA.log -Appender.Warden=2,2,0,Warden.log +Appender.Warden=2,4,0,Warden.log Appender.Chat=2,2,0,Chat.log Appender.CharDump=2,2,0,%s.log Appender.Arenas=2,2,0,Arena.log @@ -2735,7 +2792,7 @@ Logger.Chat=22,3,Chat Logger.DBErrors=26,5,Console Server DBErrors Logger.GM=27,3,Console Server GM Logger.RA=28,3,RA -Logger.Warden=29,3,Warden +Logger.Warden=29,4,Warden Logger.WorldServer=31,3,Console Server Logger.Character=34,3,Char Logger.Arenas=35,3,Arenas @@ -2743,6 +2800,7 @@ Logger.SQLDriver=36,5,SQLDriver Logger.SQLDev=37,3,SQLDev Logger.CharDump=38,3,CharDump Logger.Load=40,3,Console Server +Logger.Opcodes=41,6,Console Server # # Loggers @@ -2750,4 +2808,4 @@ Logger.Load=40,3,Console Server # (Using spaces as separator). # Default: "Root Chat DBErrors GM RA Warden Character Load" -Loggers=Root Chat DBErrors GM RA Warden Character Load WorldServer +Loggers=Root Chat DBErrors GM RA Warden Character Load WorldServer Opcodes -- cgit v1.2.3 From 610a8609db707fdcada4e699d329a641b5323aef Mon Sep 17 00:00:00 2001 From: Spp Date: Wed, 22 Aug 2012 03:15:38 +0200 Subject: Core/Logging: Correct Log Level after merge --- src/server/game/Server/WorldSession.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index e2755d3d1f7..9c2c917519b 100644 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -384,7 +384,7 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) , GetPlayerName(false).c_str()); break; case STATUS_UNHANDLED: - sLog->outDebug(LOG_FILTER_OPCODES, "Received not handled opcode %s from %s", GetOpcodeNameForLogging(packet->GetOpcode()).c_str() + sLog->outError(LOG_FILTER_OPCODES, "Received not handled opcode %s from %s", GetOpcodeNameForLogging(packet->GetOpcode()).c_str() , GetPlayerName(false).c_str()); break; } -- cgit v1.2.3 From 1f162fb7c03d354afc07e99ef6ea588a24a0fdb9 Mon Sep 17 00:00:00 2001 From: Spp Date: Wed, 22 Aug 2012 10:42:05 +0200 Subject: Fix some merge problems --- src/server/game/Server/WorldSocket.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index 8211f846f7d..4d329c8d689 100644 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -727,14 +727,14 @@ int WorldSocket::ProcessIncoming(WorldPacket* new_pct) ACE_GUARD_RETURN(LockType, Guard, m_SessionLock, -1); if (!m_Session) { - sLog->outError(LOG_FILTER_NETWORKIO, "ProcessIncoming: Client not authed opcode = %u", uint32(opcode)); + sLog->outError(LOG_FILTER_OPCODES, "ProcessIncoming: Client not authed opcode = %u", uint32(opcode)); return -1; } if (!opcodeTable[opcode]) { - sLog->outError(LOG_FILTER_NETWORKIO, "ProcessIncoming: Client not authed opcode = %u", uint32(opcode)); - return -1; + sLog->outError(LOG_FILTER_OPCODES, "No defined handler for opcode %s sent by %s", GetOpcodeNameForLogging(new_pct->GetOpcode()).c_str(), m_Session->GetPlayerName(false).c_str()); + return 0; } // Our Idle timer will reset on any non PING opcodes. @@ -752,7 +752,7 @@ int WorldSocket::ProcessIncoming(WorldPacket* new_pct) } catch (ByteBufferException &) { - sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::ProcessIncoming ByteBufferException occured while parsing an instant handled packet (opcode: %u) from client %s, accountid=%i. Disconnected client.", + sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::ProcessIncoming ByteBufferException occured while parsing an instant handled packet %s from client %s, accountid=%i. Disconnected client.", opcodeName, GetRemoteAddress().c_str(), m_Session ? int32(m_Session->GetAccountId()) : -1); new_pct->hexlike(); return -1; -- cgit v1.2.3 From bb559072ee39ea3900ea86188a9032d03c8c7465 Mon Sep 17 00:00:00 2001 From: Spp Date: Wed, 22 Aug 2012 13:38:55 +0200 Subject: Core/Opcodes: Remove some opcodes that no longer exist on cata and fix a couple of log messages --- src/server/game/Handlers/GuildHandler.cpp | 17 - src/server/game/Server/Protocol/Opcodes.cpp | 3302 +++++++++++++-------------- src/server/game/Server/Protocol/Opcodes.h | 6 +- src/server/game/Server/WorldSession.cpp | 14 +- src/server/game/Server/WorldSession.h | 1 - src/server/game/Server/WorldSocket.cpp | 5 +- 6 files changed, 1665 insertions(+), 1680 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/GuildHandler.cpp b/src/server/game/Handlers/GuildHandler.cpp index 89a53be3e24..6ace7782de6 100755 --- a/src/server/game/Handlers/GuildHandler.cpp +++ b/src/server/game/Handlers/GuildHandler.cpp @@ -58,23 +58,6 @@ void WorldSession::HandleGuildQueryOpcode(WorldPacket& recvPacket) Guild::SendCommandResult(this, GUILD_CREATE_S, ERR_GUILD_PLAYER_NOT_IN_GUILD); } -void WorldSession::HandleGuildCreateOpcode(WorldPacket& recvPacket) -{ - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_CREATE"); - - std::string name; - recvPacket >> name; - - if (!GetPlayer()->GetGuildId()) // Player cannot be in guild - { - Guild* guild = new Guild(); - if (guild->Create(GetPlayer(), name)) - sGuildMgr->AddGuild(guild); - else - delete guild; - } -} - void WorldSession::HandleGuildInviteOpcode(WorldPacket& recvPacket) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_INVITE"); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index dc3e1b88f39..9f83f984cba 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -42,1661 +42,1661 @@ void InitOpcodes() memset(opcodeTable, 0, sizeof(opcodeTable)); - DEFINE_OPCODE_HANDLER(CMSG_ACCEPT_LEVEL_GRANT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAcceptGrantLevel ); - DEFINE_OPCODE_HANDLER(CMSG_ACCEPT_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAcceptTradeOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_ACTIVATETAXI, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleActivateTaxiOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_ACTIVATETAXIEXPRESS, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleActivateTaxiExpressOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_ADDON_REGISTERED_PREFIXES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonRegisteredPrefixesOpcode); - DEFINE_OPCODE_HANDLER(CMSG_ADD_FRIEND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddFriendOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_ADD_IGNORE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddIgnoreOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_ADD_VOICE_IGNORE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_ALTER_APPEARANCE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAlterAppearance ); - DEFINE_OPCODE_HANDLER(CMSG_AREATRIGGER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaTriggerOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_AREA_SPIRIT_HEALER_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaSpiritHealerQueryOpcode); - DEFINE_OPCODE_HANDLER(CMSG_AREA_SPIRIT_HEALER_QUEUE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaSpiritHealerQueueOpcode); - DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamAcceptOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_CREATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamDeclineOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_DISBAND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamDisbandOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamInviteOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamLeaderOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamLeaveOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamQueryOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_REMOVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamRemoveOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_ROSTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamRosterOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_ATTACKSTOP, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleAttackStopOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_ATTACKSWING, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleAttackSwingOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_BIDDER_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListBidderItems ); - //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListItems ); - //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_OWNER_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListOwnerItems ); - //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_PENDING_SALES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListPendingSales ); - //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_PLACE_BID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionPlaceBid ); - //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_REMOVE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionRemoveItem ); - //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_SELL_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionSellItem ); - DEFINE_OPCODE_HANDLER(CMSG_AUTH_SESSION, STATUS_NEVER, PROCESS_THREADUNSAFE, &WorldSession::Handle_EarlyProccess ); - DEFINE_OPCODE_HANDLER(CMSG_AUTOBANK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoBankItemOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_AUTOEQUIP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoEquipItemOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_AUTOEQUIP_ITEM_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoEquipItemSlotOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_BAG_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoStoreBagItemOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_BANK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoStoreBankItemOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_LOOT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutostoreLootItemOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_AUTO_DECLINE_GUILD_INVITES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_BANKER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBankerActivateOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_LEAVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlefieldListOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_ENTRY_INVITE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_EXIT_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_QUEUE_INVITE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_QUEUE_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_PORT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattleFieldPortOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_STATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlefieldStatusOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEGROUND_PLAYER_POSITIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_JOIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlemasterJoinOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_JOIN_ARENA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlemasterJoinArena ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_JOIN_RATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_BEGIN_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBeginTradeOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_BINDER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBinderActivateOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_BUG, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBugOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_BUSY_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBusyTradeOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_BUYBACK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuybackItem ); - DEFINE_OPCODE_HANDLER(CMSG_BUY_BANK_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyBankSlotOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_BUY_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyItemOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_ADD_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarAddEvent ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_ARENA_TEAM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarArenaTeam ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_COMPLAIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarComplain ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_COPY_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarCopyEvent ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventInvite ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_MODERATOR_STATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventModeratorStatus); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_REMOVE_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventRemoveInvite ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_RSVP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventRsvp ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_SIGNUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_STATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventStatus ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_GET_CALENDAR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGetCalendar ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_GET_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGetEvent ); - DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_GET_NUM_PENDING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGetNumPending ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_GUILD_FILTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGuildFilter ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_REMOVE_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarRemoveEvent ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_UPDATE_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarUpdateEvent ); - DEFINE_OPCODE_HANDLER(CMSG_CANCEL_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelAuraOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_AUTO_REPEAT_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelAutoRepeatSpellOpcode); - DEFINE_OPCODE_HANDLER(CMSG_CANCEL_CAST, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleCancelCastOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_CHANNELLING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelChanneling ); - DEFINE_OPCODE_HANDLER(CMSG_CANCEL_MOUNT_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelMountAuraOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_QUEUED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_TEMP_ENCHANTMENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelTempEnchantmentOpcode); + DEFINE_OPCODE_HANDLER(CMSG_ACCEPT_LEVEL_GRANT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAcceptGrantLevel ); + DEFINE_OPCODE_HANDLER(CMSG_ACCEPT_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAcceptTradeOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_ACTIVATETAXI, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleActivateTaxiOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_ACTIVATETAXIEXPRESS, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleActivateTaxiExpressOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_ADDON_REGISTERED_PREFIXES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonRegisteredPrefixesOpcode); + DEFINE_OPCODE_HANDLER(CMSG_ADD_FRIEND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddFriendOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_ADD_IGNORE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddIgnoreOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_ADD_VOICE_IGNORE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_ALTER_APPEARANCE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAlterAppearance ); + DEFINE_OPCODE_HANDLER(CMSG_AREATRIGGER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaTriggerOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_AREA_SPIRIT_HEALER_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaSpiritHealerQueryOpcode); + DEFINE_OPCODE_HANDLER(CMSG_AREA_SPIRIT_HEALER_QUEUE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaSpiritHealerQueueOpcode); + DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamAcceptOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_CREATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamDeclineOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_DISBAND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamDisbandOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamInviteOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamLeaderOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamLeaveOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamQueryOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_REMOVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamRemoveOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_ROSTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamRosterOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_ATTACKSTOP, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleAttackStopOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_ATTACKSWING, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleAttackSwingOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_BIDDER_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListBidderItems ); + //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListItems ); + //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_OWNER_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListOwnerItems ); + //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_PENDING_SALES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListPendingSales ); + //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_PLACE_BID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionPlaceBid ); + //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_REMOVE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionRemoveItem ); + //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_SELL_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionSellItem ); + DEFINE_OPCODE_HANDLER(CMSG_AUTH_SESSION, STATUS_NEVER, PROCESS_THREADUNSAFE, &WorldSession::Handle_EarlyProccess ); + DEFINE_OPCODE_HANDLER(CMSG_AUTOBANK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoBankItemOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_AUTOEQUIP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoEquipItemOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_AUTOEQUIP_ITEM_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoEquipItemSlotOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_BAG_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoStoreBagItemOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_BANK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoStoreBankItemOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_LOOT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutostoreLootItemOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_AUTO_DECLINE_GUILD_INVITES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_BANKER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBankerActivateOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_LEAVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlefieldListOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_ENTRY_INVITE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_EXIT_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_QUEUE_INVITE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_QUEUE_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_PORT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattleFieldPortOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_STATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlefieldStatusOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEGROUND_PLAYER_POSITIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_JOIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlemasterJoinOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_JOIN_ARENA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlemasterJoinArena ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_JOIN_RATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_BEGIN_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBeginTradeOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_BINDER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBinderActivateOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_BUG, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBugOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_BUSY_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBusyTradeOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_BUYBACK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuybackItem ); + DEFINE_OPCODE_HANDLER(CMSG_BUY_BANK_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyBankSlotOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_BUY_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyItemOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_ADD_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarAddEvent ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_ARENA_TEAM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarArenaTeam ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_COMPLAIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarComplain ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_COPY_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarCopyEvent ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventInvite ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_MODERATOR_STATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventModeratorStatus); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_REMOVE_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventRemoveInvite ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_RSVP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventRsvp ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_SIGNUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_STATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventStatus ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_GET_CALENDAR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGetCalendar ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_GET_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGetEvent ); + DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_GET_NUM_PENDING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGetNumPending ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_GUILD_FILTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGuildFilter ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_REMOVE_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarRemoveEvent ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_UPDATE_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarUpdateEvent ); + DEFINE_OPCODE_HANDLER(CMSG_CANCEL_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelAuraOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_AUTO_REPEAT_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelAutoRepeatSpellOpcode); + DEFINE_OPCODE_HANDLER(CMSG_CANCEL_CAST, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleCancelCastOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_CHANNELLING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelChanneling ); + DEFINE_OPCODE_HANDLER(CMSG_CANCEL_MOUNT_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelMountAuraOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_QUEUED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_TEMP_ENCHANTMENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelTempEnchantmentOpcode); DEFINE_OPCODE_HANDLER(CMSG_CANCEL_TRADE, STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelTradeOpcode); - DEFINE_OPCODE_HANDLER(CMSG_CAST_SPELL, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleCastSpellOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANGEPLAYER_DIFFICULTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); - DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_ANNOUNCEMENTS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelAnnouncements ); - DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_BAN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelBan ); - DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_DISPLAY_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelDisplayListQuery ); - DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelInvite ); - DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_KICK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelKick ); - DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelList ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_MODERATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_MODERATOR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelModerator ); - DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_MUTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelMute ); - DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_OWNER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelOwner ); - DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_PASSWORD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelPassword ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_ROSTER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_SET_OWNER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelSetOwner ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_SILENCE_ALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_SILENCE_VOICE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNBAN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelUnban ); - DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNMODERATOR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelUnmoderator ); - DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNMUTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelUnmute ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNSILENCE_ALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNSILENCE_VOICE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_VOICE_OFF, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_VOICE_ON, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelVoiceOnOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_CHAR_CREATE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharCreateOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_CHAR_CUSTOMIZE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharCustomize ); - DEFINE_OPCODE_HANDLER(CMSG_CHAR_DELETE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharDeleteOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_CHAR_ENUM, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharEnumOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_CHAR_FACTION_CHANGE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharFactionOrRaceChange ); - DEFINE_OPCODE_HANDLER(CMSG_CHAR_RACE_CHANGE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharFactionOrRaceChange ); - DEFINE_OPCODE_HANDLER(CMSG_CHAR_RENAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharRenameOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_CHAT_FILTERED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CHAT_IGNORED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChatIgnoredOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_CHANNEL_WATCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_RAID_MARKER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_CLEAR_TRADE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleClearTradeItemOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_ENTER_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_EXIT_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_GET_MAP_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_GET_PARTY_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_GET_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_INSTANCE_COMMAND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_SKIRMISH_QUEUE_COMMAND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_START_WARGAME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_COMPLAIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleComplainOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_COMPLETE_CINEMATIC, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCompleteCinematic ); - //DEFINE_OPCODE_HANDLER(CMSG_COMPLETE_MOVIE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CONNECT_TO_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_CONTACT_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleContactListOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_CORPSE_MAP_POSITION_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCorpseMapPositionQuery ); - DEFINE_OPCODE_HANDLER(CMSG_CREATURE_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleCreatureQueryOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_DANCE_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_DELETEEQUIPMENT_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_DEL_FRIEND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDelFriendOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_DEL_IGNORE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDelIgnoreOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_DEL_VOICE_IGNORE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_DESTROY_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDestroyItemOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_DISMISS_CONTROLLED_VEHICLE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDismissControlledVehicle ); - //DEFINE_OPCODE_HANDLER(CMSG_DISMISS_CRITTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDismissCritter ); - DEFINE_OPCODE_HANDLER(CMSG_DUEL_ACCEPTED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDuelAcceptedOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_DUEL_CANCELLED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDuelCancelledOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_DUNGEON_FINDER_GET_SYSTEM_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_EJECT_PASSENGER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEmoteOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_ENABLETAXI, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleTaxiQueryAvailableNodes ); - DEFINE_OPCODE_HANDLER(CMSG_ENABLE_NAGLE, STATUS_NEVER , PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); - DEFINE_OPCODE_HANDLER(CMSG_EQUIPMENT_SET_SAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetSave ); - DEFINE_OPCODE_HANDLER(CMSG_EQUIPMENT_SET_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetUse ); - DEFINE_OPCODE_HANDLER(CMSG_FAR_SIGHT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleFarSightOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_FORCE_MOVE_ROOT_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveRootAck ); - //DEFINE_OPCODE_HANDLER(CMSG_FORCE_MOVE_UNROOT_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveUnRootAck ); - DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJECT_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleGameObjectQueryOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJ_REPORT_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGameobjectReportUse ); - DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJ_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGameObjectUseOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_GET_MAIL_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGetMailList ); - DEFINE_OPCODE_HANDLER(CMSG_GET_MIRRORIMAGE_DATA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMirrorImageDataRequest ); - DEFINE_OPCODE_HANDLER(CMSG_GMRESPONSE_RESOLVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMResponseResolve ); - //DEFINE_OPCODE_HANDLER(CMSG_GMSURVEY_SUBMIT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMSurveySubmit ); - //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_CREATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketCreateOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_DELETETICKET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketDeleteOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_GETTICKET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketGetTicketOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_SYSTEMSTATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketSystemStatusOpcode); - //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_UPDATETEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketUpdateOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_REPORT_LAG, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReportLag ); - DEFINE_OPCODE_HANDLER(CMSG_GOSSIP_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGossipHelloOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_GOSSIP_SELECT_OPTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGossipSelectOptionOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_GRANT_LEVEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGrantLevel ); - DEFINE_OPCODE_HANDLER(CMSG_GROUP_ASSISTANT_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupAssistantLeaderOpcode); - DEFINE_OPCODE_HANDLER(CMSG_GROUP_CHANGE_SUB_GROUP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupChangeSubGroupOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_GROUP_DISBAND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupDisbandOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_GROUP_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupInviteOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_GROUP_INVITE_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupInviteResponseOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GROUP_RAID_CONVERT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupRaidConvertOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GROUP_REQUEST_JOIN_UPDATES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_GROUP_SET_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupSetLeaderOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GROUP_SET_ROLES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GROUP_SWAP_SUB_GROUP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupSwapSubGroupOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_GROUP_UNINVITE_GUID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupUninviteGuidOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildAcceptOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_ACHIEVEMENT_MEMBERS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_ACHIEVEMENT_PROGRESS_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildAchievementProgressQuery); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_ADD_RANK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildAddRankOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_ASSIGN_MEMBER_RANK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildAssignRankOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANKER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankerActivate ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_BUY_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankBuyTab ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_DEPOSIT_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankDepositMoney ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_LOG_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_QUERY_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankQueryTab ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_QUERY_TEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_REM_MONEY_WITHDRAW_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_SET_TAB_TEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_SWAP_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankSwapItems ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_UPDATE_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankUpdateTab ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_WITHDRAW_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankWithdrawMoney ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_CHANGE_NAME_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDeclineOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_DEL_RANK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDelRankOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_DEMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDemoteOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_DISBAND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDisbandOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_EVENT_LOG_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_INFO_TEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildChangeInfoTextOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildInviteOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildLeaveOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_MEMBER_SEND_SOR_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_MOTD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildMOTDOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_NEWS_UPDATE_STICKY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_PERMISSIONS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildPermissions ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_PROMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildPromoteOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_QUERY, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildQueryOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_QUERY_NEWS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_QUERY_RANKS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildQueryRanksOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_REMOVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildRemoveOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_REPLACE_GUILD_MASTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_REQUEST_CHALLENGE_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_REQUEST_MAX_DAILY_XP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_REQUEST_PARTY_STATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildRequestPartyState ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_ROSTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildRosterOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_SET_ACHIEVEMENT_TRACKING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_SET_GUILD_MASTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_SET_NOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildSetNoteOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_SET_RANK_PERMISSIONS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildSetRankPermissionsOpcode); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_SWITCH_RANK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_HEARTH_AND_RESURRECT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleHearthAndResurrect ); - DEFINE_OPCODE_HANDLER(CMSG_IGNORE_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleIgnoreTradeOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_INITIATE_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInitiateTradeOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_INSPECT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_INSTANCE_LOCK_WARNING_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_ITEM_REFUND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemRefund ); - DEFINE_OPCODE_HANDLER(CMSG_ITEM_REFUND_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemRefundInfoRequest ); - DEFINE_OPCODE_HANDLER(CMSG_ITEM_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemTextQuery ); - DEFINE_OPCODE_HANDLER(CMSG_JOIN_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleJoinChannel ); - DEFINE_OPCODE_HANDLER(CMSG_KEEP_ALIVE, STATUS_NEVER, PROCESS_THREADUNSAFE, &WorldSession::Handle_EarlyProccess ); - DEFINE_OPCODE_HANDLER(CMSG_LEARN_PREVIEW_TALENTS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnPreviewTalents ); - DEFINE_OPCODE_HANDLER(CMSG_LEARN_PREVIEW_TALENTS_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnPreviewTalentsPet ); - DEFINE_OPCODE_HANDLER(CMSG_LEARN_TALENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnTalentOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_LEAVE_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLeaveChannel ); - //DEFINE_OPCODE_HANDLER(CMSG_LFG_GET_STATUS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LFG_JOIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgJoinOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_LFG_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgLeaveOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_LFG_LFR_JOIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LFG_LFR_LEAVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LFG_PROPOSAL_RESULT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgProposalResultOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_BOOT_VOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetBootVoteOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_COMMENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_ROLES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetRolesOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_LFG_TELEPORT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgTeleportOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_ADD_RECRUIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_BROWSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_DECLINE_RECRUIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_GET_APPLICATIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_GET_RECRUITS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_POST_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_REMOVE_RECRUIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_SET_GUILD_POST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_LIST_INVENTORY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleListInventoryOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_LOAD_SCREEN, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleLoadScreenOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_LOGOUT_CANCEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLogoutCancelOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_LOGOUT_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLogoutRequestOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_LOG_DISCONNECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); - DEFINE_OPCODE_HANDLER(CMSG_LOOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_LOOT_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_LOOT_MASTER_GIVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMasterGiveOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_LOOT_METHOD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMethodOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_LOOT_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMoneyOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_LOOT_RELEASE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootReleaseOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_LOOT_ROLL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootRoll ); - DEFINE_OPCODE_HANDLER(CMSG_MAIL_CREATE_TEXT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailCreateTextItem ); - DEFINE_OPCODE_HANDLER(CMSG_MAIL_DELETE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailDelete ); - DEFINE_OPCODE_HANDLER(CMSG_MAIL_MARK_AS_READ, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailMarkAsRead ); - DEFINE_OPCODE_HANDLER(CMSG_MAIL_RETURN_TO_SENDER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailReturnToSender ); - DEFINE_OPCODE_HANDLER(CMSG_MAIL_TAKE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailTakeItem ); - DEFINE_OPCODE_HANDLER(CMSG_MAIL_TAKE_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailTakeMoney ); - DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_BATTLEGROUND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_GUILD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_OFFICER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_PARTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_RAID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_WHISPER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_AFK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_BATTLEGROUND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_DND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_GUILD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_OFFICER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_PARTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_RAID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_RAID_WARNING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_SAY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_WHISPER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_YELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MINIGAME_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_MOUNTSPECIAL_ANIM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMountSpecialAnimOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_MOVE_CHNG_TRANSPORT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FALL_RESET, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FEATHER_FALL_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleFeatherFallAck ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_FLIGHT_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_PITCH_RATE_CHANGE_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_RUN_BACK_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_RUN_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_SWIM_BACK_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_SWIM_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_TURN_RATE_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_WALK_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_GRAVITY_DISABLE_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_GRAVITY_ENABLE_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_HOVER_ACK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMoveHoverAck ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_KNOCK_BACK_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveKnockBackAck ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_NOT_ACTIVE_MOVER, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveNotActiveMover ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_CAN_FLY_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveSetCanFlyAckOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_COLLISION_HEIGHT_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_MOVE_SPLINE_DONE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveSplineDoneOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_MOVE_TIME_SKIPPED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleMoveTimeSkippedOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_WATER_WALK_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveWaterWalkAck ); - DEFINE_OPCODE_HANDLER(CMSG_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNameQueryOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_NEXT_CINEMATIC_CAMERA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNextCinematicCamera ); - DEFINE_OPCODE_HANDLER(CMSG_NPC_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNpcTextQueryOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_OBJECT_UPDATE_FAILED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleObjectUpdateFailedOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_OBJECT_UPDATE_RESCUED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_OFFER_PETITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleOfferPetitionOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_OPENING_CINEMATIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_OPEN_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleOpenItemOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_OPT_OUT_OF_LOOT, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleOptOutOfLootOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_PAGE_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePageTextQueryOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_PARTY_SILENCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_PARTY_UNSILENCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_PETITION_BUY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionBuyOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_PETITION_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionQueryOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_PETITION_SHOWLIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionShowListOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_PETITION_SHOW_SIGNATURES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionShowSignOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_PETITION_SIGN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionSignOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_PET_ABANDON, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetAbandon ); - DEFINE_OPCODE_HANDLER(CMSG_PET_ACTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetAction ); - DEFINE_OPCODE_HANDLER(CMSG_PET_CANCEL_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetCancelAuraOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_PET_CAST_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetCastSpellOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_PET_LEARN_TALENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetLearnTalent ); - DEFINE_OPCODE_HANDLER(CMSG_PET_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetNameQuery ); - DEFINE_OPCODE_HANDLER(CMSG_PET_RENAME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetRename ); - DEFINE_OPCODE_HANDLER(CMSG_PET_SET_ACTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetSetAction ); - DEFINE_OPCODE_HANDLER(CMSG_PET_SPELL_AUTOCAST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetSpellAutocastOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_PET_STOP_ATTACK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetStopAttack ); - DEFINE_OPCODE_HANDLER(CMSG_PING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); - DEFINE_OPCODE_HANDLER(CMSG_PLAYED_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayedTime ); - DEFINE_OPCODE_HANDLER(CMSG_PLAYER_LOGIN, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayerLoginOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_PLAYER_VEHICLE_ENTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEnterPlayerVehicle ); - //DEFINE_OPCODE_HANDLER(CMSG_PLAY_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_PUSHQUESTTOPARTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePushQuestToParty ); - //DEFINE_OPCODE_HANDLER(CMSG_PVP_LOG_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_QUERY_BATTLEFIELD_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_QUERY_COMPLETION_NPC_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_MEMBERS_FOR_RECIPE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_MEMBER_RECIPES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_RECIPES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_REWARDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_XP, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildQueryXPOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_QUERY_INSPECT_ACHIEVEMENTS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryInspectAchievements ); - DEFINE_OPCODE_HANDLER(CMSG_QUERY_QUESTS_COMPLETED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryQuestsCompleted ); - DEFINE_OPCODE_HANDLER(CMSG_QUERY_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryTimeOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_ACCEPT_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverAcceptQuestOpcode); - DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_CHOOSE_REWARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverChooseRewardOpcode); - DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_COMPLETE_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverCompleteQuest ); - DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverHelloOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_QUERY_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverQueryQuestOpcode); - DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_REQUEST_REWARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverRequestRewardOpcode); - DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverStatusMultipleQuery); - DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_STATUS_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleQuestgiverStatusQueryOpcode); - DEFINE_OPCODE_HANDLER(CMSG_QUESTLOG_REMOVE_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestLogRemoveQuest ); - DEFINE_OPCODE_HANDLER(CMSG_QUEST_CONFIRM_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestConfirmAccept ); - DEFINE_OPCODE_HANDLER(CMSG_QUEST_POI_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestPOIQuery ); - DEFINE_OPCODE_HANDLER(CMSG_QUEST_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestQueryOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_RANDOMIZE_CHAR_NAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRandomizeCharNameOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_READY_FOR_ACCOUNT_DATA_TIMES, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleReadyForAccountDataTimes ); - DEFINE_OPCODE_HANDLER(CMSG_READ_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReadItem ); - DEFINE_OPCODE_HANDLER(CMSG_REALM_SPLIT, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRealmSplitOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_RECLAIM_CORPSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReclaimCorpseOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_REDIRECTION_AUTH_PROOF, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_REFORGE_ITEM, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleReforgeItemOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_REORDER_CHARACTERS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_REPAIR_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepairItemOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_REPOP_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepopRequestOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_REPORT_PVP_AFK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReportPvPAFK ); - DEFINE_OPCODE_HANDLER(CMSG_REQUEST_ACCOUNT_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestAccountData ); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_CATEGORY_COOLDOWNS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_CEMETERY_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_GUILD_PARTY_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_HONOR_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_REQUEST_HOTFIX, STATUS_AUTHED, PROCESS_INPLACE, &WorldSession::HandleRequestHotfix ); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_INSPECT_RATED_BG_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PARTY_MEMBER_STATS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestPartyMemberStatsOpcode); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PET_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestPetInfoOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PVP_OPTIONS_ENABLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PVP_REWARDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RAID_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestRaidInfoOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RATED_BG_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RATED_BG_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RESEARCH_HISTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_EXIT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestVehicleExit ); - DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_NEXT_SEAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); - DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_PREV_SEAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_SWITCH_SEAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); - DEFINE_OPCODE_HANDLER(CMSG_RESET_FACTION_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_RESET_INSTANCES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleResetInstancesOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_RESURRECT_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleResurrectResponseOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_RETURN_TO_GRAVEYARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReturnToGraveyard ); - //DEFINE_OPCODE_HANDLER(CMSG_ROLE_POLL_BEGIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SAVE_CUF_PROFILES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_SELF_RES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSelfResOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_SELL_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSellItemOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_SEND_MAIL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSendMail ); - //DEFINE_OPCODE_HANDLER(CMSG_SEND_SOR_REQUEST_VIA_ADDRESS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SEND_SOR_REQUEST_VIA_BNET_ACCOUNT_ID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_SETSHEATHED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleSetSheathedOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIONBAR_TOGGLES, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActionBarToggles ); - DEFINE_OPCODE_HANDLER(CMSG_SET_ACTION_BUTTON, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActionButtonOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIVE_MOVER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActiveMoverOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIVE_VOICE_CHANNEL, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActiveVoiceChannel ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_ALLOW_LOW_LEVEL_RAID1, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_ALLOW_LOW_LEVEL_RAID2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_SET_CHANNEL_WATCH, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetChannelWatch ); - DEFINE_OPCODE_HANDLER(CMSG_SET_CONTACT_NOTES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetContactNotesOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_CURRENCY_FLAGS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_EVERYONE_IS_ASSISTANT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_SET_FACTION_ATWAR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetFactionAtWar ); - DEFINE_OPCODE_HANDLER(CMSG_SET_FACTION_INACTIVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetFactionInactiveOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_PET_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_SET_PLAYER_DECLINED_NAMES, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetPlayerDeclinedNames ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_PREFERED_CEMETERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_PRIMARY_TALENT_TREE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_RELATIVE_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_SAVED_INSTANCE_EXTEND, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_SET_SELECTION, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleSetSelectionOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_SET_TAXI_BENCHMARK_MODE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTaxiBenchmarkOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_SET_TITLE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTitleOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_TRADE_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_SET_TRADE_GOLD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTradeGoldOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_SET_TRADE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTradeItemOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_VEHICLE_REC_ID_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_SET_WATCHED_FACTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetWatchedFactionOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_SHOWING_CLOAK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleShowingCloakOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_SHOWING_HELM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleShowingHelmOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_SOCKET_GEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSocketOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_SPELLCLICK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSpellClick ); - DEFINE_OPCODE_HANDLER(CMSG_SPIRIT_HEALER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSpiritHealerActivateOpcode); - DEFINE_OPCODE_HANDLER(CMSG_SPLIT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSplitItemOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_STANDSTATECHANGE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStandStateChangeOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_STOP_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SUBMIT_BUG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SUBMIT_COMPLAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SUGGESTION_SUBMIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_SUMMON_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSummonResponseOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_SUSPEND_TOKEN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_SWAP_INV_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSwapInvItemOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_SWAP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSwapItem ); - //DEFINE_OPCODE_HANDLER(CMSG_SYNC_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_TAXINODE_STATUS_QUERY, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleTaxiNodeStatusQueryOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_TAXIQUERYAVAILABLENODES, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleTaxiQueryAvailableNodes ); - //DEFINE_OPCODE_HANDLER(CMSG_TELEPORT_TO_UNIT, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_TEXT_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTextEmoteOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_TIME_ADJUSTMENT_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_TIME_SYNC_RESP, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleTimeSyncResp ); - //DEFINE_OPCODE_HANDLER(CMSG_TIME_SYNC_RESP_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_TOGGLE_PVP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTogglePvP ); - //DEFINE_OPCODE_HANDLER(CMSG_TOTEM_DESTROYED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTotemDestroyed ); - DEFINE_OPCODE_HANDLER(CMSG_TRAINER_BUY_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerBuySpellOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_TRAINER_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerListOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_TRANSMOGRIFY_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTransmogrifyItems ); - DEFINE_OPCODE_HANDLER(CMSG_TURN_IN_PETITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTurnInPetitionOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_CLEAR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialClear ); - DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_FLAG, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialFlag ); - DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_RESET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialReset ); - DEFINE_OPCODE_HANDLER(CMSG_UNACCEPT_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnacceptTradeOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_SKILL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnlearnSkillOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_SPECIALIZATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_UNREGISTER_ALL_ADDON_PREFIXES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnregisterAddonPrefixesOpcode); - DEFINE_OPCODE_HANDLER(CMSG_UPDATE_ACCOUNT_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateAccountData ); - //DEFINE_OPCODE_HANDLER(CMSG_UPDATE_MISSILE_TRAJECTORY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateMissileTrajectory ); - //DEFINE_OPCODE_HANDLER(CMSG_UPDATE_PROJECTILE_POSITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateProjectilePosition ); - //DEFINE_OPCODE_HANDLER(CMSG_USED_FOLLOW, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_USE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUseItemOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_VIOLENCE_LEVEL, STATUS_AUTHED, PROCESS_INPLACE, &WorldSession::HandleViolenceLevel ); - DEFINE_OPCODE_HANDLER(CMSG_VOICE_SESSION_ENABLE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleVoiceSessionEnableOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_VOID_STORAGE_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleVoidStorageQuery ); - DEFINE_OPCODE_HANDLER(CMSG_VOID_STORAGE_TRANSFER, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleVoidStorageTransfer ); - DEFINE_OPCODE_HANDLER(CMSG_VOID_STORAGE_UNLOCK, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleVoidStorageUnlock ); - DEFINE_OPCODE_HANDLER(CMSG_VOID_SWAP_ITEM, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleVoidSwapItem ); - //DEFINE_OPCODE_HANDLER(CMSG_WARDEN_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleWardenDataOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_WARGAME_ACCEPT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_WARGAME_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_WHO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWhoOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_WHOIS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWhoisOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_WORLD_STATE_UI_TIMER_UPDATE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleWorldStateUITimerUpdate ); - //DEFINE_OPCODE_HANDLER(CMSG_WORLD_TELEPORT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWorldTeleportOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_WRAP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWrapItemOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_ZONEUPDATE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleZoneUpdateOpcode ); - DEFINE_OPCODE_HANDLER(MSG_AUCTION_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionHelloOpcode ); - DEFINE_OPCODE_HANDLER(MSG_CHANNEL_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(MSG_CHANNEL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(MSG_CORPSE_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCorpseQueryOpcode ); - DEFINE_OPCODE_HANDLER(MSG_INSPECT_ARENA_TEAMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectArenaTeamsOpcode ); - //DEFINE_OPCODE_HANDLER(MSG_LIST_STABLED_PETS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleListStabledPetsOpcode ); - DEFINE_OPCODE_HANDLER(MSG_MINIMAP_PING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMinimapPingOpcode ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_CHARM_TELEPORT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_FALL_LAND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_HEARTBEAT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_JUMP, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_FACING, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_PITCH, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_WALK_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_START_ASCEND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_START_BACKWARD, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_START_DESCEND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_START_FORWARD, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_START_PITCH_DOWN, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_START_PITCH_UP, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_START_STRAFE_LEFT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_START_STRAFE_RIGHT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_START_SWIM, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_START_TURN_LEFT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_START_TURN_RIGHT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_ASCEND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_PITCH, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_STRAFE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_SWIM, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_TURN, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_TELEPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_TELEPORT_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveTeleportAck ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_TELEPORT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_TIME_SKIPPED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_TOGGLE_COLLISION_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_TELEPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_WORLDPORT_ACK, STATUS_TRANSFER, PROCESS_THREADUNSAFE, &WorldSession::HandleMoveWorldportAckOpcode ); - //DEFINE_OPCODE_HANDLER(MSG_NOTIFY_PARTY_SQUELCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_PARTY_ASSIGNMENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePartyAssignmentOpcode ); - DEFINE_OPCODE_HANDLER(MSG_PETITION_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionDeclineOpcode ); - DEFINE_OPCODE_HANDLER(MSG_PETITION_RENAME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionRenameOpcode ); - DEFINE_OPCODE_HANDLER(MSG_QUERY_NEXT_MAIL_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryNextMailTime ); - DEFINE_OPCODE_HANDLER(MSG_QUEST_PUSH_RESULT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestPushResult ); - DEFINE_OPCODE_HANDLER(MSG_RAID_READY_CHECK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidReadyCheckOpcode ); - //DEFINE_OPCODE_HANDLER(MSG_RAID_READY_CHECK_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(MSG_RAID_READY_CHECK_FINISHED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidReadyCheckFinishedOpcode); - DEFINE_OPCODE_HANDLER(MSG_RAID_TARGET_UPDATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidTargetUpdateOpcode ); - DEFINE_OPCODE_HANDLER(MSG_RANDOM_ROLL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRandomRollOpcode ); - DEFINE_OPCODE_HANDLER(MSG_SAVE_GUILD_EMBLEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSaveGuildEmblemOpcode ); - DEFINE_OPCODE_HANDLER(MSG_SET_DUNGEON_DIFFICULTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetDungeonDifficultyOpcode); - DEFINE_OPCODE_HANDLER(MSG_SET_RAID_DIFFICULTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetRaidDifficultyOpcode ); - DEFINE_OPCODE_HANDLER(MSG_TABARDVENDOR_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTabardVendorActivateOpcode); - DEFINE_OPCODE_HANDLER(MSG_TALENT_WIPE_CONFIRM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTalentWipeConfirmOpcode ); - DEFINE_OPCODE_HANDLER(MSG_VERIFY_CONNECTIVITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); - DEFINE_OPCODE_HANDLER(SMSG_ACCOUNT_DATA_TIMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ACCOUNT_INFO_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ACCOUNT_RESTRICTED_WARNING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_ACHIEVEMENT_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_ACHIEVEMENT_EARNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_ACTION_BUTTONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_ACTIVATETAXIREPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_ADDON_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_ADD_RUNE_POWER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_AI_REACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_ALL_ACHIEVEMENT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_AREA_SPIRIT_HEALER_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_AREA_TRIGGER_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_AREA_TRIGGER_MOVEMENT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_ARENA_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_ARENA_OPPONENT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_CHANGE_FAILED_QUEUED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_ROSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_ATTACKERSTATEUPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_ATTACKSTART, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_ATTACKSTOP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_ATTACKSWING_BADFACING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_ATTACKSWING_CANT_ATTACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_ATTACKSWING_DEADTARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_ATTACKSWING_NOTINRANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_BIDDER_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_BIDDER_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_LIST_PENDING_SALES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_OWNER_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_OWNER_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_REMOVED_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_AURA_POINTS_DEPLETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_AURA_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_AURA_UPDATE_ALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_AUTH_CHALLENGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_AUTH_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_AVAILABLE_VOICE_CHANNEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_AVERAGE_ITEM_LEVEL_INFORM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_BARBER_SHOP_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_EJECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_EJECT_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_ENTERED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_ENTRY_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_EXIT_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_QUEUE_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_STATE_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_PLAYER_POSITIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_PORT_DENIED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_RATED_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS3, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS4, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_INFO_THROTTLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_PLAYER_JOINED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_PLAYER_LEFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_BINDER_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_BINDPOINTUPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_BREAK_TARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_BUY_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_BUY_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_ARENA_TEAM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_CLEAR_PENDING_ACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_NOTES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_NOTES_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_REMOVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_REMOVED_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_STATUS_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_MODERATOR_STATUS_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_REMOVED_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_UPDATED_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_FILTER_GUILD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_RAID_LOCKOUT_ADDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_RAID_LOCKOUT_REMOVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_RAID_LOCKOUT_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_SEND_CALENDAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_SEND_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_SEND_NUM_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CAMERA_SHAKE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CANCEL_AUTO_REPEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CANCEL_COMBAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CAST_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CHANNEL_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CHANNEL_MEMBER_COUNT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CHANNEL_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHARACTER_LOGIN_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CHAR_CREATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CHAR_CUSTOMIZE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CHAR_DELETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CHAR_ENUM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CHAR_FACTION_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CHAR_RENAME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHAT_IGNORED_ACCOUNT_MUTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHAT_NOT_IN_PARTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHAT_PLAYER_AMBIGUOUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CHAT_PLAYER_NOT_FOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CHAT_RESTRICTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHAT_SERVER_DISCONNECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHAT_SERVER_RECONNECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CHAT_WRONG_FACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_BOSS_EMOTES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_COOLDOWNS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_FAR_SIGHT_IMMEDIATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CLEAR_TARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CLIENTCACHE_VERSION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CLIENT_CONTROL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_COMBAT_EVENT_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_MAP_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_PARTY_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_SKIRMISH_QUEUE_RESULT1, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_SKIRMISH_QUEUE_RESULT2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_STATE_CHANGED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_COMPLAIN_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMPLETION_NPC_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_MOVES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMSAT_CONNECT_FAIL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMSAT_DISCONNECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMSAT_RECONNECT_TRY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CONTACT_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CONVERT_RUNE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COOLDOWN_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_COOLDOWN_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CORPSE_MAP_POSITION_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CORPSE_NOT_IN_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CORPSE_RECLAIM_DELAY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CREATURE_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CRITERIA_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CRITERIA_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CROSSED_INEBRIATION_THRESHOLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CURRENCY_LOOT_REMOVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CURRENCY_LOOT_RESTORED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CUSTOM_LOAD_SCREEN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DAMAGE_CALC_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DANCE_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_DB_REPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_DEATH_RELEASE_LOC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DEBUG_RUNE_REGEN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DEFENSE_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_DESTROY_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DESTRUCTIBLE_BUILDING_DAMAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DIFFERENT_INSTANCE_FROM_PARTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DISENCHANT_CREDIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_DISMOUNT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_DISMOUNTRESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_DISPEL_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DISPLAY_GAME_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DONT_AUTO_PUSH_SPELLS_TO_ACTION_BAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DROP_NEW_CONNECTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_DUEL_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_DUEL_COUNTDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_DUEL_INBOUNDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_DUEL_OUTOFBOUNDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_DUEL_REQUESTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_DUEL_WINNER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DUMP_RIDE_TICKETS_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_DURABILITY_DAMAGE_DEATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ECHO_PARTY_SQUELCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_EMOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_ENABLE_BARBER_SHOP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_ENCHANTMENTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_ENVIRONMENTALDAMAGELOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_EQUIPMENT_SET_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_EQUIPMENT_SET_SAVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_EQUIPMENT_SET_USE_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_EXPECTED_SPAM_RECORDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_EXPLORATION_EXPERIENCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_FAILED_PLAYER_CONDITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_FEATURE_SYSTEM_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_FEIGN_DEATH_RESISTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_FISH_ESCAPED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_FISH_NOT_HOOKED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_FLIGHT_SPLINE_SYNC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_FLOOD_DETECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_FORCED_DEATH_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_FORCE_SEND_QUEUED_PACKETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_FORCE_SET_VEHICLE_REC_ID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_FORGE_MASTER_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_FRIEND_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_CUSTOM_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_DESPAWN_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_PAGETEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_RESET_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GAMESPEED_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GAMETIME_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GAMETIME_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GAME_EVENT_DEBUG_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GAME_OBJECT_ACTIVATE_ANIM_KIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GMRESPONSE_DB_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GMRESPONSE_RECEIVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GMRESPONSE_STATUS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_CREATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_DELETETICKET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_GETTICKET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_SYSTEMSTATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_UPDATETEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GM_MESSAGECHAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GM_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GM_TICKET_STATUS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GODMODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GOSSIP_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GOSSIP_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GOSSIP_POI, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GROUPACTION_THROTTLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GROUP_CANCEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GROUP_DECLINE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GROUP_DESTROYED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GROUP_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GROUP_JOINED_BATTLEGROUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GROUP_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GROUP_SET_LEADER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GROUP_SET_ROLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GROUP_UNINVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GUILD_ACHIEVEMENT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GUILD_ACHIEVEMENT_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GUILD_ACHIEVEMENT_EARNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_ACHIEVEMENT_MEMBERS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_LOG_QUERY_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_QUERY_TEXT_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_REM_MONEY_WITHDRAW_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_CHALLENGE_COMPLETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_CHALLENGE_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_CHANGE_NAME_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GUILD_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GUILD_COMMAND_RESULT_2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GUILD_CRITERIA_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GUILD_CRITERIA_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GUILD_DECLINE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GUILD_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_EVENT_LOG_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_FLAGGED_FOR_RENAME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GUILD_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_INVITE_CANCEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_MAX_DAILY_XP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_MEMBERS_FOR_RECIPE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_MEMBER_DAILY_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_MEMBER_RECIPES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_MEMBER_UPDATE_NOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_MOVE_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_MOVE_STARTING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_NEWS_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_NEWS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GUILD_PARTY_STATE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GUILD_PERMISSIONS_QUERY_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GUILD_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GUILD_RANK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GUILD_RANKS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_RECIPES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_RENAMED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_REPUTATION_REACTION_CHANGED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_REPUTATION_WEEKLY_CAP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_REWARDS_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GUILD_ROSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_UPDATE_ROSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_XP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_XP_GAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_HEALTH_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_HIGHEST_THREAT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_HOTFIX_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_HOTFIX_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_INITIALIZE_FACTIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_INITIAL_SPELLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_INIT_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_INIT_WORLD_STATES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_INSPECT_HONOR_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_INSPECT_RATED_BG_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_INSPECT_RESULTS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_INSPECT_TALENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_LOCK_WARNING_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_RESET_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_SAVE_CREATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_INVALIDATE_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_INVALIDATE_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_INVALID_PROMOTION_CODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_INVENTORY_CHANGE_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ITEM_ADD_PASSIVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_ITEM_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_ITEM_ENCHANT_TIME_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ITEM_EXPIRE_PURCHASE_REFUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_ITEM_PUSH_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_ITEM_REFUND_INFO_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_ITEM_REFUND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ITEM_REMOVE_PASSIVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ITEM_SEND_PASSIVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_ITEM_TEXT_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ITEM_TIME_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LEARNED_DANCE_MOVES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LEARNED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LEVELUP_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_BOOT_PROPOSAL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_DISABLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_JOIN_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_OFFER_CONTINUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_PARTY_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_PLAYER_REWARD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_PROPOSAL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_QUEUE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_ROLE_CHECK_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_ROLE_CHOSEN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_SLOT_INVALID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_TELEPORT_DENIED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_SEARCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_STATUS_NONE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_APPLICANT_LIST_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_APPLICATIONS_LIST_CHANGED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_BROWSE_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_MEMBERSHIP_LIST_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_POST_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_RECRUIT_LIST_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LIST_INVENTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LOAD_CUF_PROFILES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LOGIN_SETTIMESPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LOGIN_VERIFY_WORLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LOGOUT_CANCEL_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LOGOUT_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LOGOUT_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LOG_XPGAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LOOT_ALL_PASSED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LOOT_CLEAR_MONEY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LOOT_CONTENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LOOT_ITEM_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LOOT_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LOOT_MASTER_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LOOT_MONEY_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LOOT_RELEASE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LOOT_REMOVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LOOT_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LOOT_ROLL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LOOT_ROLL_WON, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LOOT_SLOT_CHANGED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LOOT_START_ROLL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_MAIL_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MAP_OBJ_EVENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_IN_PROGRESS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_MESSAGECHAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MESSAGE_BOX, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MINIGAME_SETUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MINIGAME_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_MIRRORIMAGE_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MISSILE_CANCEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_MODIFY_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MONEY_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_MONSTER_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_MONSTER_MOVE_TRANSPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_MOTD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOUNTRESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_MOUNTSPECIAL_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_COLLISION_DISABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_COLLISION_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_MOVE_FEATHER_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_GRAVITY_DISABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_GRAVITY_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_MOVE_KNOCK_BACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_MOVE_LAND_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_MOVE_NORMAL_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_MOVE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_ACTIVE_MOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_COLLISION_HEIGHT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_COMPOUND_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_RUN_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_SWIM_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_SWIM_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_COLLISION_HEIGHT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_KNOCK_BACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_RUN_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_SWIM_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_SWIM_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_MOVE_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MULTIPLE_PACKETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_NEW_TAXI_PATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_NEW_WORLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_NEW_WORLD_ABORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_NOTIFY_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_NOTIFY_DEST_LOC_SPELL_CAST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_NPC_TEXT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_OFFER_PETITION_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_OPEN_CONTAINER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_OPEN_LFG_DUNGEON_FINDER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_OVERRIDE_LIGHT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PAGE_TEXT_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PARTYKILLLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PARTY_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PARTY_MEMBER_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PARTY_MEMBER_STATS_FULL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PAUSE_MIRROR_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PERIODICAURALOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PETGODMODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PETITION_ALREADY_SIGNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PETITION_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PETITION_SHOWLIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PETITION_SHOW_SIGNATURES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PETITION_SIGN_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_ACTION_FEEDBACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_ACTION_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_ADDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_BROKEN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_CAST_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_DISMISS_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_GUIDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PET_LEARNED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_NAME_INVALID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PET_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PET_REMOVED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_RENAMEABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_SLOT_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PET_SPELLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_TAME_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PET_UPDATE_COMBO_POINTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PLAYED_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PLAYERBINDERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PLAYERBOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PLAYER_DIFFICULTY_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PLAYER_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PLAYER_SKINNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PLAYER_VEHICLE_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PLAY_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PLAY_MUSIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PLAY_OBJECT_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PLAY_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PLAY_SPELL_VISUAL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PLAY_SPELL_VISUAL_KIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PLAY_TIME_WARNING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PONG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_POWER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PRE_RESURRECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PROCRESIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PROPOSE_LEVEL_GRANT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PVP_CREDIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PVP_LOG_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PVP_OPTIONS_ENABLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_QUERY_QUESTS_COMPLETED_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_QUERY_TIME_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_OFFER_REWARD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_DETAILS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_INVALID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_REQUEST_ITEMS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_STATUS_MULTIPLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_QUESTLOG_FULL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_ADD_KILL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_ADD_PVP_KILL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_FAILEDTIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_QUEST_CONFIRM_ACCEPT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_QUEST_FORCE_REMOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_QUEST_POI_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_QUEST_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RAID_GROUP_ONLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_RAID_INSTANCE_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_RAID_INSTANCE_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RAID_MARKERS_CHANGED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RAID_READY_CHECK_THROTTLED_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RAID_SUMMON_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_RANDOMIZE_CHAR_NAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RATED_BG_RATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RATED_BG_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_READ_ITEM_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_READ_ITEM_OK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_REALM_SPLIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_REAL_GROUP_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_RECEIVED_MAIL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_REDIRECT_CLIENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_REFER_A_FRIEND_EXPIRED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_REFER_A_FRIEND_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_REFORGE_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_REMOVED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_REPORT_PVP_AFK_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_REQUEST_CEMETERY_LIST_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_REQUEST_PVP_REWARDS_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RESEARCH_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RESEARCH_SETUP_HISTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RESET_COMPRESSION_CONTEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RESET_FAILED_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RESPOND_INSPECT_ACHIEVEMENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RESURRECT_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RESYNC_RUNES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ROLE_POLL_BEGIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RWHOIS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SELL_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SEND_MAIL_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SEND_UNLEARN_SPELLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SERVERTIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SERVER_FIRST_ACHIEVEMENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SERVER_INFO_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SERVER_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SERVER_PERF, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SET_DF_FAST_LAUNCH_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SET_FACTION_ATWAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SET_FACTION_STANDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SET_FACTION_VISIBLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SET_FLAT_SPELL_MODIFIER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SET_FORCED_REACTIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SET_PCT_SPELL_MODIFIER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SET_PHASE_SHIFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SET_PLAY_HOVER_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SET_PROFICIENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SET_PROJECTILE_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SHOWTAXINODES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SHOW_BANK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SHOW_RATINGS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SOR_START_EXPERIENCE_INCOMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPELLBREAKLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPELLDAMAGESHIELD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPELLDISPELLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPELLENERGIZELOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPELLHEALLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPELLINSTAKILLLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELLINTERRUPTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPELLLOGEXECUTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPELLLOGMISS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPELLNONMELEEDAMAGELOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPELLORDAMAGE_IMMUNE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPELLSTEALLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELL_CATEGORY_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPELL_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPELL_DELAYED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPELL_FAILED_OTHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPELL_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPELL_GO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPELL_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELL_UPDATE_CHAIN_TARGETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPIRIT_HEALER_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_COLLISION_DISABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_COLLISION_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_GRAVITY_DISABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_GRAVITY_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FEATHER_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FLYING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_LAND_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_NORMAL_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_RUN_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_RUN_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_SWIM_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_SWIM_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_WALK_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_START_SWIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_STOP_SWIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_UNROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_UNSET_FLYING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_UNSET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_STABLE_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_STANDSTATE_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_START_MIRROR_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_START_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_STOP_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_STOP_MIRROR_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_STREAMING_MOVIE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SUMMON_CANCEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SUMMON_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SUPERCEDED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SUPPRESS_NPC_GREETINGS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SUSPEND_COMMS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SUSPEND_TOKEN_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_TALENTS_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_TALENTS_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_TALENTS_INVOLUNTARILY_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_TAXINODE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_TEST_DROP_RATE_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_TEXT_EMOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_THREAT_CLEAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_THREAT_REMOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_THREAT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_TIME_ADJUSTMENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_TIME_SYNC_REQ, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_TITLE_EARNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_TOGGLE_XP_GAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_TOTEM_CREATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_TRADE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_TRADE_STATUS_EXTENDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_SUCCEEDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_TRAINER_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_TRANSFER_ABORTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_TRANSFER_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_TRIGGER_CINEMATIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_TRIGGER_MOVIE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_TURN_IN_PETITION_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_TUTORIAL_FLAGS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_UNIT_HEALTH_FREQUENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_UNIT_SPELLCAST_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ACCOUNT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ACCOUNT_DATA_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_UPDATE_COMBO_POINTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_UPDATE_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_UPDATE_CURRENCY_WEEK_LIMIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_DUNGEON_ENCOUNTER_FOR_LOOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_UPDATE_INSTANCE_ENCOUNTER_UNIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_UPDATE_INSTANCE_OWNERSHIP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ITEM_ENCHANTMENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_UPDATE_LAST_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_UPDATE_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_SERVER_PLAYER_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_UPDATE_WORLD_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_USERLIST_ADD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_USERLIST_REMOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_USERLIST_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_VOICESESSION_FULL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_VOICE_CHAT_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_VOICE_PARENTAL_CONTROLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_LEAVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_ROSTER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SET_TALKER_MUTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_VOID_ITEM_SWAP_RESPONSE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_VOID_STORAGE_CONTENTS, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_VOID_STORAGE_FAILED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_VOID_STORAGE_TRANSFER_CHANGES, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_VOID_TRANSFER_RESULT, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_WAIT_QUEUE_FINISH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_WAIT_QUEUE_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_WARDEN_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_WARGAME_CHECK_ENTRY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_WARGAME_REQUEST_SENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_WEATHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_WEEKLY_LAST_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_WEEKLY_RESET_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_WEEKLY_SPELL_USAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_WEEKLY_SPELL_USAGE_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_WHO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_WHOIS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_WORLD_SERVER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_WORLD_STATE_UI_TIMER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_XP_GAIN_ABORTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_ZONE_UNDER_ATTACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(CMSG_CAST_SPELL, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleCastSpellOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANGEPLAYER_DIFFICULTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_ANNOUNCEMENTS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelAnnouncements ); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_BAN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelBan ); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_DISPLAY_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelDisplayListQuery ); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelInvite ); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_KICK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelKick ); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelList ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_MODERATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_MODERATOR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelModerator ); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_MUTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelMute ); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_OWNER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelOwner ); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_PASSWORD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelPassword ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_ROSTER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_SET_OWNER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelSetOwner ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_SILENCE_ALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_SILENCE_VOICE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNBAN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelUnban ); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNMODERATOR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelUnmoderator ); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNMUTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelUnmute ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNSILENCE_ALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNSILENCE_VOICE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_VOICE_OFF, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_VOICE_ON, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelVoiceOnOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_CHAR_CREATE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharCreateOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_CHAR_CUSTOMIZE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharCustomize ); + DEFINE_OPCODE_HANDLER(CMSG_CHAR_DELETE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharDeleteOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_CHAR_ENUM, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharEnumOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_CHAR_FACTION_CHANGE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharFactionOrRaceChange ); + DEFINE_OPCODE_HANDLER(CMSG_CHAR_RACE_CHANGE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharFactionOrRaceChange ); + DEFINE_OPCODE_HANDLER(CMSG_CHAR_RENAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharRenameOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_CHAT_FILTERED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHAT_IGNORED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChatIgnoredOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_CHANNEL_WATCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_RAID_MARKER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_CLEAR_TRADE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleClearTradeItemOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_ENTER_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_EXIT_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_GET_MAP_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_GET_PARTY_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_GET_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_INSTANCE_COMMAND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_SKIRMISH_QUEUE_COMMAND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_START_WARGAME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_COMPLAIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleComplainOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_COMPLETE_CINEMATIC, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCompleteCinematic ); + //DEFINE_OPCODE_HANDLER(CMSG_COMPLETE_MOVIE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CONNECT_TO_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_CONTACT_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleContactListOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_CORPSE_MAP_POSITION_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCorpseMapPositionQuery ); + DEFINE_OPCODE_HANDLER(CMSG_CREATURE_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleCreatureQueryOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_DANCE_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DELETEEQUIPMENT_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_DEL_FRIEND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDelFriendOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_DEL_IGNORE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDelIgnoreOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_DEL_VOICE_IGNORE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_DESTROY_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDestroyItemOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_DISMISS_CONTROLLED_VEHICLE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDismissControlledVehicle ); + //DEFINE_OPCODE_HANDLER(CMSG_DISMISS_CRITTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDismissCritter ); + DEFINE_OPCODE_HANDLER(CMSG_DUEL_ACCEPTED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDuelAcceptedOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_DUEL_CANCELLED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDuelCancelledOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_DUNGEON_FINDER_GET_SYSTEM_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_EJECT_PASSENGER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEmoteOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_ENABLETAXI, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleTaxiQueryAvailableNodes ); + DEFINE_OPCODE_HANDLER(CMSG_ENABLE_NAGLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); + DEFINE_OPCODE_HANDLER(CMSG_EQUIPMENT_SET_SAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetSave ); + DEFINE_OPCODE_HANDLER(CMSG_EQUIPMENT_SET_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetUse ); + DEFINE_OPCODE_HANDLER(CMSG_FAR_SIGHT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleFarSightOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_FORCE_MOVE_ROOT_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveRootAck ); + //DEFINE_OPCODE_HANDLER(CMSG_FORCE_MOVE_UNROOT_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveUnRootAck ); + DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJECT_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleGameObjectQueryOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJ_REPORT_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGameobjectReportUse ); + DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJ_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGameObjectUseOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GET_MAIL_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGetMailList ); + DEFINE_OPCODE_HANDLER(CMSG_GET_MIRRORIMAGE_DATA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMirrorImageDataRequest ); + DEFINE_OPCODE_HANDLER(CMSG_GMRESPONSE_RESOLVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMResponseResolve ); + //DEFINE_OPCODE_HANDLER(CMSG_GMSURVEY_SUBMIT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMSurveySubmit ); + //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_CREATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketCreateOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_DELETETICKET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketDeleteOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_GETTICKET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketGetTicketOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_SYSTEMSTATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketSystemStatusOpcode); + //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_UPDATETEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketUpdateOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_REPORT_LAG, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReportLag ); + DEFINE_OPCODE_HANDLER(CMSG_GOSSIP_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGossipHelloOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GOSSIP_SELECT_OPTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGossipSelectOptionOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GRANT_LEVEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGrantLevel ); + DEFINE_OPCODE_HANDLER(CMSG_GROUP_ASSISTANT_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupAssistantLeaderOpcode); + DEFINE_OPCODE_HANDLER(CMSG_GROUP_CHANGE_SUB_GROUP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupChangeSubGroupOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GROUP_DISBAND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupDisbandOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GROUP_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupInviteOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GROUP_INVITE_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupInviteResponseOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GROUP_RAID_CONVERT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupRaidConvertOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GROUP_REQUEST_JOIN_UPDATES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_GROUP_SET_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupSetLeaderOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GROUP_SET_ROLES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GROUP_SWAP_SUB_GROUP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupSwapSubGroupOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GROUP_UNINVITE_GUID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupUninviteGuidOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildAcceptOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_ACHIEVEMENT_MEMBERS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_ACHIEVEMENT_PROGRESS_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildAchievementProgressQuery); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_ADD_RANK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildAddRankOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_ASSIGN_MEMBER_RANK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildAssignRankOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANKER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankerActivate ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_BUY_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankBuyTab ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_DEPOSIT_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankDepositMoney ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_LOG_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_QUERY_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankQueryTab ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_QUERY_TEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_REM_MONEY_WITHDRAW_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_SET_TAB_TEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_SWAP_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankSwapItems ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_UPDATE_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankUpdateTab ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_WITHDRAW_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankWithdrawMoney ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_CHANGE_NAME_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDeclineOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_DEL_RANK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDelRankOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_DEMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDemoteOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_DISBAND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDisbandOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_EVENT_LOG_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_INFO_TEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildChangeInfoTextOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildInviteOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildLeaveOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_MEMBER_SEND_SOR_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_MOTD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildMOTDOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_NEWS_UPDATE_STICKY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_PERMISSIONS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildPermissions ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_PROMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildPromoteOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_QUERY, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildQueryOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_QUERY_NEWS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_QUERY_RANKS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildQueryRanksOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_REMOVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildRemoveOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_REPLACE_GUILD_MASTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_REQUEST_CHALLENGE_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_REQUEST_MAX_DAILY_XP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_REQUEST_PARTY_STATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildRequestPartyState ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_ROSTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildRosterOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_SET_ACHIEVEMENT_TRACKING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_SET_GUILD_MASTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_SET_NOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildSetNoteOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_SET_RANK_PERMISSIONS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildSetRankPermissionsOpcode); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_SWITCH_RANK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_HEARTH_AND_RESURRECT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleHearthAndResurrect ); + DEFINE_OPCODE_HANDLER(CMSG_IGNORE_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleIgnoreTradeOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_INITIATE_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInitiateTradeOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_INSPECT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_INSTANCE_LOCK_WARNING_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_ITEM_REFUND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemRefund ); + DEFINE_OPCODE_HANDLER(CMSG_ITEM_REFUND_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemRefundInfoRequest ); + DEFINE_OPCODE_HANDLER(CMSG_ITEM_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemTextQuery ); + DEFINE_OPCODE_HANDLER(CMSG_JOIN_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleJoinChannel ); + DEFINE_OPCODE_HANDLER(CMSG_KEEP_ALIVE, STATUS_NEVER, PROCESS_THREADUNSAFE, &WorldSession::Handle_EarlyProccess ); + DEFINE_OPCODE_HANDLER(CMSG_LEARN_PREVIEW_TALENTS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnPreviewTalents ); + DEFINE_OPCODE_HANDLER(CMSG_LEARN_PREVIEW_TALENTS_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnPreviewTalentsPet ); + DEFINE_OPCODE_HANDLER(CMSG_LEARN_TALENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnTalentOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_LEAVE_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLeaveChannel ); + //DEFINE_OPCODE_HANDLER(CMSG_LFG_GET_STATUS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LFG_JOIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgJoinOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_LFG_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgLeaveOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_LFG_LFR_JOIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LFG_LFR_LEAVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LFG_PROPOSAL_RESULT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgProposalResultOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_BOOT_VOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetBootVoteOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_COMMENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_ROLES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetRolesOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_LFG_TELEPORT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgTeleportOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_ADD_RECRUIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_BROWSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_DECLINE_RECRUIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_GET_APPLICATIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_GET_RECRUITS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_POST_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_REMOVE_RECRUIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_SET_GUILD_POST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_LIST_INVENTORY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleListInventoryOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_LOAD_SCREEN, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleLoadScreenOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_LOGOUT_CANCEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLogoutCancelOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_LOGOUT_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLogoutRequestOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_LOG_DISCONNECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); + DEFINE_OPCODE_HANDLER(CMSG_LOOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_LOOT_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_LOOT_MASTER_GIVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMasterGiveOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_LOOT_METHOD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMethodOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_LOOT_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMoneyOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_LOOT_RELEASE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootReleaseOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_LOOT_ROLL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootRoll ); + DEFINE_OPCODE_HANDLER(CMSG_MAIL_CREATE_TEXT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailCreateTextItem ); + DEFINE_OPCODE_HANDLER(CMSG_MAIL_DELETE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailDelete ); + DEFINE_OPCODE_HANDLER(CMSG_MAIL_MARK_AS_READ, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailMarkAsRead ); + DEFINE_OPCODE_HANDLER(CMSG_MAIL_RETURN_TO_SENDER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailReturnToSender ); + DEFINE_OPCODE_HANDLER(CMSG_MAIL_TAKE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailTakeItem ); + DEFINE_OPCODE_HANDLER(CMSG_MAIL_TAKE_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMailTakeMoney ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_BATTLEGROUND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_GUILD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_OFFICER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_PARTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_RAID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_ADDON_WHISPER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_AFK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_BATTLEGROUND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_DND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_GUILD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_OFFICER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_PARTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_RAID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_RAID_WARNING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_SAY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_WHISPER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_YELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_MINIGAME_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_MOUNTSPECIAL_ANIM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMountSpecialAnimOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MOVE_CHNG_TRANSPORT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FALL_RESET, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FEATHER_FALL_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleFeatherFallAck ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_FLIGHT_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_PITCH_RATE_CHANGE_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_RUN_BACK_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_RUN_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_SWIM_BACK_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_SWIM_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_TURN_RATE_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_WALK_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_GRAVITY_DISABLE_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_GRAVITY_ENABLE_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_HOVER_ACK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMoveHoverAck ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_KNOCK_BACK_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveKnockBackAck ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_NOT_ACTIVE_MOVER, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveNotActiveMover ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_CAN_FLY_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveSetCanFlyAckOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_COLLISION_HEIGHT_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_MOVE_SPLINE_DONE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveSplineDoneOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MOVE_TIME_SKIPPED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleMoveTimeSkippedOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_WATER_WALK_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveWaterWalkAck ); + DEFINE_OPCODE_HANDLER(CMSG_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNameQueryOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_NEXT_CINEMATIC_CAMERA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNextCinematicCamera ); + DEFINE_OPCODE_HANDLER(CMSG_NPC_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNpcTextQueryOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_OBJECT_UPDATE_FAILED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleObjectUpdateFailedOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_OBJECT_UPDATE_RESCUED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_OFFER_PETITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleOfferPetitionOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_OPENING_CINEMATIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_OPEN_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleOpenItemOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_OPT_OUT_OF_LOOT, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleOptOutOfLootOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_PAGE_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePageTextQueryOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_PARTY_SILENCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_PARTY_UNSILENCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_PETITION_BUY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionBuyOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_PETITION_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionQueryOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_PETITION_SHOWLIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionShowListOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_PETITION_SHOW_SIGNATURES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionShowSignOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_PETITION_SIGN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionSignOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_PET_ABANDON, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetAbandon ); + DEFINE_OPCODE_HANDLER(CMSG_PET_ACTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetAction ); + DEFINE_OPCODE_HANDLER(CMSG_PET_CANCEL_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetCancelAuraOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_PET_CAST_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetCastSpellOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_PET_LEARN_TALENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetLearnTalent ); + DEFINE_OPCODE_HANDLER(CMSG_PET_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetNameQuery ); + DEFINE_OPCODE_HANDLER(CMSG_PET_RENAME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetRename ); + DEFINE_OPCODE_HANDLER(CMSG_PET_SET_ACTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetSetAction ); + DEFINE_OPCODE_HANDLER(CMSG_PET_SPELL_AUTOCAST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetSpellAutocastOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_PET_STOP_ATTACK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetStopAttack ); + DEFINE_OPCODE_HANDLER(CMSG_PING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); + DEFINE_OPCODE_HANDLER(CMSG_PLAYED_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayedTime ); + DEFINE_OPCODE_HANDLER(CMSG_PLAYER_LOGIN, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayerLoginOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_PLAYER_VEHICLE_ENTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEnterPlayerVehicle ); + //DEFINE_OPCODE_HANDLER(CMSG_PLAY_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_PUSHQUESTTOPARTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePushQuestToParty ); + //DEFINE_OPCODE_HANDLER(CMSG_PVP_LOG_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_QUERY_BATTLEFIELD_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_QUERY_COMPLETION_NPC_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_MEMBERS_FOR_RECIPE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_MEMBER_RECIPES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_RECIPES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_REWARDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_XP, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildQueryXPOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_QUERY_INSPECT_ACHIEVEMENTS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryInspectAchievements ); + DEFINE_OPCODE_HANDLER(CMSG_QUERY_QUESTS_COMPLETED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryQuestsCompleted ); + DEFINE_OPCODE_HANDLER(CMSG_QUERY_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryTimeOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_ACCEPT_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverAcceptQuestOpcode); + DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_CHOOSE_REWARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverChooseRewardOpcode); + DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_COMPLETE_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverCompleteQuest ); + DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverHelloOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_QUERY_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverQueryQuestOpcode); + DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_REQUEST_REWARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverRequestRewardOpcode); + DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverStatusMultipleQuery); + DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_STATUS_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleQuestgiverStatusQueryOpcode); + DEFINE_OPCODE_HANDLER(CMSG_QUESTLOG_REMOVE_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestLogRemoveQuest ); + DEFINE_OPCODE_HANDLER(CMSG_QUEST_CONFIRM_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestConfirmAccept ); + DEFINE_OPCODE_HANDLER(CMSG_QUEST_POI_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestPOIQuery ); + DEFINE_OPCODE_HANDLER(CMSG_QUEST_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestQueryOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_RANDOMIZE_CHAR_NAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRandomizeCharNameOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_READY_FOR_ACCOUNT_DATA_TIMES, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleReadyForAccountDataTimes ); + DEFINE_OPCODE_HANDLER(CMSG_READ_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReadItem ); + DEFINE_OPCODE_HANDLER(CMSG_REALM_SPLIT, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRealmSplitOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_RECLAIM_CORPSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReclaimCorpseOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_REDIRECTION_AUTH_PROOF, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_REFORGE_ITEM, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleReforgeItemOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_REORDER_CHARACTERS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_REPAIR_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepairItemOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_REPOP_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepopRequestOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_REPORT_PVP_AFK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReportPvPAFK ); + DEFINE_OPCODE_HANDLER(CMSG_REQUEST_ACCOUNT_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestAccountData ); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_CATEGORY_COOLDOWNS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_CEMETERY_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_GUILD_PARTY_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_HONOR_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_REQUEST_HOTFIX, STATUS_AUTHED, PROCESS_INPLACE, &WorldSession::HandleRequestHotfix ); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_INSPECT_RATED_BG_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PARTY_MEMBER_STATS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestPartyMemberStatsOpcode); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PET_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestPetInfoOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PVP_OPTIONS_ENABLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PVP_REWARDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RAID_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestRaidInfoOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RATED_BG_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RATED_BG_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RESEARCH_HISTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_EXIT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestVehicleExit ); + DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_NEXT_SEAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); + DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_PREV_SEAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); + //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_SWITCH_SEAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); + DEFINE_OPCODE_HANDLER(CMSG_RESET_FACTION_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_RESET_INSTANCES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleResetInstancesOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_RESURRECT_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleResurrectResponseOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_RETURN_TO_GRAVEYARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReturnToGraveyard ); + //DEFINE_OPCODE_HANDLER(CMSG_ROLE_POLL_BEGIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SAVE_CUF_PROFILES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_SELF_RES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSelfResOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_SELL_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSellItemOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_SEND_MAIL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSendMail ); + //DEFINE_OPCODE_HANDLER(CMSG_SEND_SOR_REQUEST_VIA_ADDRESS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SEND_SOR_REQUEST_VIA_BNET_ACCOUNT_ID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_SETSHEATHED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleSetSheathedOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIONBAR_TOGGLES, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActionBarToggles ); + DEFINE_OPCODE_HANDLER(CMSG_SET_ACTION_BUTTON, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActionButtonOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIVE_MOVER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActiveMoverOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIVE_VOICE_CHANNEL, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActiveVoiceChannel ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_ALLOW_LOW_LEVEL_RAID1, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_ALLOW_LOW_LEVEL_RAID2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_SET_CHANNEL_WATCH, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetChannelWatch ); + DEFINE_OPCODE_HANDLER(CMSG_SET_CONTACT_NOTES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetContactNotesOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_CURRENCY_FLAGS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_EVERYONE_IS_ASSISTANT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_SET_FACTION_ATWAR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetFactionAtWar ); + DEFINE_OPCODE_HANDLER(CMSG_SET_FACTION_INACTIVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetFactionInactiveOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_PET_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_SET_PLAYER_DECLINED_NAMES, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetPlayerDeclinedNames ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_PREFERED_CEMETERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_PRIMARY_TALENT_TREE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_RELATIVE_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_SAVED_INSTANCE_EXTEND, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_SET_SELECTION, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleSetSelectionOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_SET_TAXI_BENCHMARK_MODE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTaxiBenchmarkOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_SET_TITLE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTitleOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_TRADE_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_SET_TRADE_GOLD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTradeGoldOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_SET_TRADE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTradeItemOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_VEHICLE_REC_ID_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_SET_WATCHED_FACTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetWatchedFactionOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_SHOWING_CLOAK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleShowingCloakOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_SHOWING_HELM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleShowingHelmOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_SOCKET_GEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSocketOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_SPELLCLICK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSpellClick ); + DEFINE_OPCODE_HANDLER(CMSG_SPIRIT_HEALER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSpiritHealerActivateOpcode); + DEFINE_OPCODE_HANDLER(CMSG_SPLIT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSplitItemOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_STANDSTATECHANGE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStandStateChangeOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_STOP_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SUBMIT_BUG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SUBMIT_COMPLAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SUGGESTION_SUBMIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_SUMMON_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSummonResponseOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_SUSPEND_TOKEN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_SWAP_INV_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSwapInvItemOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_SWAP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSwapItem ); + //DEFINE_OPCODE_HANDLER(CMSG_SYNC_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_TAXINODE_STATUS_QUERY, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleTaxiNodeStatusQueryOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_TAXIQUERYAVAILABLENODES, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleTaxiQueryAvailableNodes ); + //DEFINE_OPCODE_HANDLER(CMSG_TELEPORT_TO_UNIT, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_TEXT_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTextEmoteOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_TIME_ADJUSTMENT_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_TIME_SYNC_RESP, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleTimeSyncResp ); + //DEFINE_OPCODE_HANDLER(CMSG_TIME_SYNC_RESP_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_TOGGLE_PVP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTogglePvP ); + //DEFINE_OPCODE_HANDLER(CMSG_TOTEM_DESTROYED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTotemDestroyed ); + DEFINE_OPCODE_HANDLER(CMSG_TRAINER_BUY_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerBuySpellOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_TRAINER_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerListOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_TRANSMOGRIFY_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTransmogrifyItems ); + DEFINE_OPCODE_HANDLER(CMSG_TURN_IN_PETITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTurnInPetitionOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_CLEAR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialClear ); + DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_FLAG, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialFlag ); + DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_RESET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialReset ); + DEFINE_OPCODE_HANDLER(CMSG_UNACCEPT_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnacceptTradeOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_SKILL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnlearnSkillOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_SPECIALIZATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_UNREGISTER_ALL_ADDON_PREFIXES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnregisterAddonPrefixesOpcode); + DEFINE_OPCODE_HANDLER(CMSG_UPDATE_ACCOUNT_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateAccountData ); + //DEFINE_OPCODE_HANDLER(CMSG_UPDATE_MISSILE_TRAJECTORY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateMissileTrajectory ); + //DEFINE_OPCODE_HANDLER(CMSG_UPDATE_PROJECTILE_POSITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateProjectilePosition ); + //DEFINE_OPCODE_HANDLER(CMSG_USED_FOLLOW, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_USE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUseItemOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_VIOLENCE_LEVEL, STATUS_AUTHED, PROCESS_INPLACE, &WorldSession::HandleViolenceLevel ); + DEFINE_OPCODE_HANDLER(CMSG_VOICE_SESSION_ENABLE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleVoiceSessionEnableOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_VOID_STORAGE_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleVoidStorageQuery ); + DEFINE_OPCODE_HANDLER(CMSG_VOID_STORAGE_TRANSFER, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleVoidStorageTransfer ); + DEFINE_OPCODE_HANDLER(CMSG_VOID_STORAGE_UNLOCK, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleVoidStorageUnlock ); + DEFINE_OPCODE_HANDLER(CMSG_VOID_SWAP_ITEM, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleVoidSwapItem ); + //DEFINE_OPCODE_HANDLER(CMSG_WARDEN_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleWardenDataOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_WARGAME_ACCEPT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_WARGAME_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_WHO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWhoOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_WHOIS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWhoisOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_WORLD_STATE_UI_TIMER_UPDATE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleWorldStateUITimerUpdate ); + //DEFINE_OPCODE_HANDLER(CMSG_WORLD_TELEPORT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWorldTeleportOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_WRAP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWrapItemOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_ZONEUPDATE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleZoneUpdateOpcode ); + DEFINE_OPCODE_HANDLER(MSG_AUCTION_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionHelloOpcode ); + DEFINE_OPCODE_HANDLER(MSG_CHANNEL_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(MSG_CHANNEL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(MSG_CORPSE_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCorpseQueryOpcode ); + DEFINE_OPCODE_HANDLER(MSG_INSPECT_ARENA_TEAMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectArenaTeamsOpcode ); + //DEFINE_OPCODE_HANDLER(MSG_LIST_STABLED_PETS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleListStabledPetsOpcode ); + DEFINE_OPCODE_HANDLER(MSG_MINIMAP_PING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMinimapPingOpcode ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_CHARM_TELEPORT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_FALL_LAND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_HEARTBEAT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_JUMP, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_FACING, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_PITCH, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_WALK_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_START_ASCEND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_START_BACKWARD, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_START_DESCEND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_START_FORWARD, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_START_PITCH_DOWN, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_START_PITCH_UP, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_START_STRAFE_LEFT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_START_STRAFE_RIGHT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_START_SWIM, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_START_TURN_LEFT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_START_TURN_RIGHT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_ASCEND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_PITCH, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_STRAFE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_SWIM, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_TURN, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_TELEPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_TELEPORT_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveTeleportAck ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_TELEPORT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_TIME_SKIPPED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_TOGGLE_COLLISION_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_TELEPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_WORLDPORT_ACK, STATUS_TRANSFER, PROCESS_THREADUNSAFE, &WorldSession::HandleMoveWorldportAckOpcode ); + //DEFINE_OPCODE_HANDLER(MSG_NOTIFY_PARTY_SQUELCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_PARTY_ASSIGNMENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePartyAssignmentOpcode ); + DEFINE_OPCODE_HANDLER(MSG_PETITION_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionDeclineOpcode ); + DEFINE_OPCODE_HANDLER(MSG_PETITION_RENAME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionRenameOpcode ); + DEFINE_OPCODE_HANDLER(MSG_QUERY_NEXT_MAIL_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryNextMailTime ); + DEFINE_OPCODE_HANDLER(MSG_QUEST_PUSH_RESULT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestPushResult ); + DEFINE_OPCODE_HANDLER(MSG_RAID_READY_CHECK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidReadyCheckOpcode ); + //DEFINE_OPCODE_HANDLER(MSG_RAID_READY_CHECK_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(MSG_RAID_READY_CHECK_FINISHED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidReadyCheckFinishedOpcode); + DEFINE_OPCODE_HANDLER(MSG_RAID_TARGET_UPDATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidTargetUpdateOpcode ); + DEFINE_OPCODE_HANDLER(MSG_RANDOM_ROLL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRandomRollOpcode ); + DEFINE_OPCODE_HANDLER(MSG_SAVE_GUILD_EMBLEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSaveGuildEmblemOpcode ); + DEFINE_OPCODE_HANDLER(MSG_SET_DUNGEON_DIFFICULTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetDungeonDifficultyOpcode); + DEFINE_OPCODE_HANDLER(MSG_SET_RAID_DIFFICULTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetRaidDifficultyOpcode ); + DEFINE_OPCODE_HANDLER(MSG_TABARDVENDOR_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTabardVendorActivateOpcode); + DEFINE_OPCODE_HANDLER(MSG_TALENT_WIPE_CONFIRM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTalentWipeConfirmOpcode ); + DEFINE_OPCODE_HANDLER(MSG_VERIFY_CONNECTIVITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); + DEFINE_OPCODE_HANDLER(SMSG_ACCOUNT_DATA_TIMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ACCOUNT_INFO_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ACCOUNT_RESTRICTED_WARNING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ACHIEVEMENT_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ACHIEVEMENT_EARNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ACTION_BUTTONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ACTIVATETAXIREPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ADDON_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ADD_RUNE_POWER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_AI_REACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ALL_ACHIEVEMENT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_AREA_SPIRIT_HEALER_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_AREA_TRIGGER_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_AREA_TRIGGER_MOVEMENT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ARENA_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ARENA_OPPONENT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_CHANGE_FAILED_QUEUED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_ROSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ATTACKERSTATEUPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ATTACKSTART, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ATTACKSTOP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ATTACKSWING_BADFACING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ATTACKSWING_CANT_ATTACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ATTACKSWING_DEADTARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ATTACKSWING_NOTINRANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_BIDDER_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_BIDDER_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_LIST_PENDING_SALES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_OWNER_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_OWNER_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_REMOVED_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_AURA_POINTS_DEPLETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_AURA_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_AURA_UPDATE_ALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_AUTH_CHALLENGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_AUTH_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_AVAILABLE_VOICE_CHANNEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_AVERAGE_ITEM_LEVEL_INFORM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BARBER_SHOP_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_EJECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_EJECT_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_ENTERED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_ENTRY_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_EXIT_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_QUEUE_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_STATE_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_PLAYER_POSITIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_PORT_DENIED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_RATED_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS3, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS4, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_INFO_THROTTLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_PLAYER_JOINED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_PLAYER_LEFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BINDER_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BINDPOINTUPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BREAK_TARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BUY_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BUY_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_ARENA_TEAM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_CLEAR_PENDING_ACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_NOTES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_NOTES_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_REMOVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_REMOVED_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_STATUS_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_MODERATOR_STATUS_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_REMOVED_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_UPDATED_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_FILTER_GUILD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_RAID_LOCKOUT_ADDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_RAID_LOCKOUT_REMOVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_RAID_LOCKOUT_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_SEND_CALENDAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_SEND_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_SEND_NUM_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CAMERA_SHAKE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CANCEL_AUTO_REPEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CANCEL_COMBAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CAST_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CHANNEL_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CHANNEL_MEMBER_COUNT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CHANNEL_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHARACTER_LOGIN_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CHAR_CREATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CHAR_CUSTOMIZE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CHAR_DELETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CHAR_ENUM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CHAR_FACTION_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CHAR_RENAME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHAT_IGNORED_ACCOUNT_MUTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHAT_NOT_IN_PARTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHAT_PLAYER_AMBIGUOUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CHAT_PLAYER_NOT_FOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CHAT_RESTRICTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHAT_SERVER_DISCONNECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHAT_SERVER_RECONNECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CHAT_WRONG_FACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_BOSS_EMOTES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_COOLDOWNS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_FAR_SIGHT_IMMEDIATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CLEAR_TARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CLIENTCACHE_VERSION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CLIENT_CONTROL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_COMBAT_EVENT_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_MAP_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_PARTY_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_SKIRMISH_QUEUE_RESULT1, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_SKIRMISH_QUEUE_RESULT2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_STATE_CHANGED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_COMPLAIN_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMPLETION_NPC_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_MOVES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMSAT_CONNECT_FAIL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMSAT_DISCONNECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMSAT_RECONNECT_TRY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CONTACT_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CONVERT_RUNE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COOLDOWN_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_COOLDOWN_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CORPSE_MAP_POSITION_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CORPSE_NOT_IN_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CORPSE_RECLAIM_DELAY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CREATURE_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CRITERIA_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CRITERIA_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CROSSED_INEBRIATION_THRESHOLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CURRENCY_LOOT_REMOVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CURRENCY_LOOT_RESTORED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CUSTOM_LOAD_SCREEN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DAMAGE_CALC_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DANCE_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_DB_REPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_DEATH_RELEASE_LOC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DEBUG_RUNE_REGEN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DEFENSE_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_DESTROY_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DESTRUCTIBLE_BUILDING_DAMAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DIFFERENT_INSTANCE_FROM_PARTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DISENCHANT_CREDIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_DISMOUNT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_DISMOUNTRESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_DISPEL_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DISPLAY_GAME_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DONT_AUTO_PUSH_SPELLS_TO_ACTION_BAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DROP_NEW_CONNECTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_DUEL_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_DUEL_COUNTDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_DUEL_INBOUNDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_DUEL_OUTOFBOUNDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_DUEL_REQUESTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_DUEL_WINNER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DUMP_RIDE_TICKETS_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_DURABILITY_DAMAGE_DEATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ECHO_PARTY_SQUELCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_EMOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ENABLE_BARBER_SHOP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ENCHANTMENTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ENVIRONMENTALDAMAGELOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_EQUIPMENT_SET_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_EQUIPMENT_SET_SAVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_EQUIPMENT_SET_USE_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_EXPECTED_SPAM_RECORDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_EXPLORATION_EXPERIENCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_FAILED_PLAYER_CONDITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_FEATURE_SYSTEM_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_FEIGN_DEATH_RESISTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_FISH_ESCAPED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_FISH_NOT_HOOKED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_FLIGHT_SPLINE_SYNC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_FLOOD_DETECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_FORCED_DEATH_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_FORCE_SEND_QUEUED_PACKETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_FORCE_SET_VEHICLE_REC_ID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_FORGE_MASTER_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_FRIEND_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_CUSTOM_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_DESPAWN_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_PAGETEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_RESET_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GAMESPEED_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GAMETIME_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GAMETIME_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GAME_EVENT_DEBUG_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GAME_OBJECT_ACTIVATE_ANIM_KIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GMRESPONSE_DB_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GMRESPONSE_RECEIVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GMRESPONSE_STATUS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_CREATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_DELETETICKET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_GETTICKET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_SYSTEMSTATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_UPDATETEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GM_MESSAGECHAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GM_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GM_TICKET_STATUS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GODMODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GOSSIP_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GOSSIP_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GOSSIP_POI, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GROUPACTION_THROTTLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GROUP_CANCEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GROUP_DECLINE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GROUP_DESTROYED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GROUP_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GROUP_JOINED_BATTLEGROUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GROUP_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GROUP_SET_LEADER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GROUP_SET_ROLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GROUP_UNINVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_ACHIEVEMENT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_ACHIEVEMENT_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_ACHIEVEMENT_EARNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_ACHIEVEMENT_MEMBERS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_LOG_QUERY_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_QUERY_TEXT_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_REM_MONEY_WITHDRAW_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_CHALLENGE_COMPLETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_CHALLENGE_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_CHANGE_NAME_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_COMMAND_RESULT_2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_CRITERIA_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_CRITERIA_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_DECLINE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_EVENT_LOG_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_FLAGGED_FOR_RENAME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_INVITE_CANCEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_MAX_DAILY_XP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_MEMBERS_FOR_RECIPE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_MEMBER_DAILY_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_MEMBER_RECIPES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_MEMBER_UPDATE_NOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_MOVE_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_MOVE_STARTING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_NEWS_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_NEWS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_PARTY_STATE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_PERMISSIONS_QUERY_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_RANK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_RANKS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_RECIPES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_RENAMED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_REPUTATION_REACTION_CHANGED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_REPUTATION_WEEKLY_CAP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_REWARDS_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_ROSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_UPDATE_ROSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_XP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_XP_GAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_HEALTH_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_HIGHEST_THREAT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_HOTFIX_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_HOTFIX_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_INITIALIZE_FACTIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_INITIAL_SPELLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_INIT_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_INIT_WORLD_STATES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_INSPECT_HONOR_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_INSPECT_RATED_BG_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_INSPECT_RESULTS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_INSPECT_TALENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_LOCK_WARNING_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_RESET_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_SAVE_CREATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_INVALIDATE_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_INVALIDATE_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_INVALID_PROMOTION_CODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_INVENTORY_CHANGE_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ITEM_ADD_PASSIVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ITEM_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ITEM_ENCHANT_TIME_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ITEM_EXPIRE_PURCHASE_REFUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ITEM_PUSH_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ITEM_REFUND_INFO_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ITEM_REFUND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ITEM_REMOVE_PASSIVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ITEM_SEND_PASSIVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ITEM_TEXT_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ITEM_TIME_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LEARNED_DANCE_MOVES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LEARNED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LEVELUP_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_BOOT_PROPOSAL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_DISABLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_JOIN_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_OFFER_CONTINUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_PARTY_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_PLAYER_REWARD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_PROPOSAL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_QUEUE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_ROLE_CHECK_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_ROLE_CHOSEN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_SLOT_INVALID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_TELEPORT_DENIED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_SEARCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_STATUS_NONE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_APPLICANT_LIST_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_APPLICATIONS_LIST_CHANGED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_BROWSE_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_MEMBERSHIP_LIST_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_POST_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_RECRUIT_LIST_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LIST_INVENTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LOAD_CUF_PROFILES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOGIN_SETTIMESPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOGIN_VERIFY_WORLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOGOUT_CANCEL_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOGOUT_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOGOUT_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOG_XPGAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOOT_ALL_PASSED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOOT_CLEAR_MONEY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LOOT_CONTENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LOOT_ITEM_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOOT_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOOT_MASTER_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOOT_MONEY_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOOT_RELEASE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOOT_REMOVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOOT_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOOT_ROLL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOOT_ROLL_WON, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOOT_SLOT_CHANGED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOOT_START_ROLL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MAIL_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MAP_OBJ_EVENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_IN_PROGRESS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MESSAGECHAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MESSAGE_BOX, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MINIGAME_SETUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MINIGAME_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MIRRORIMAGE_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MISSILE_CANCEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MODIFY_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MONEY_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MONSTER_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MONSTER_MOVE_TRANSPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOTD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOUNTRESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOUNTSPECIAL_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_COLLISION_DISABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_COLLISION_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_FEATHER_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_GRAVITY_DISABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_GRAVITY_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_KNOCK_BACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_LAND_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_NORMAL_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_ACTIVE_MOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_COLLISION_HEIGHT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_COMPOUND_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_RUN_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_SWIM_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_SWIM_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_COLLISION_HEIGHT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_KNOCK_BACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_RUN_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_SWIM_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_SWIM_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MULTIPLE_PACKETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_NEW_TAXI_PATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_NEW_WORLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_NEW_WORLD_ABORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_NOTIFY_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_NOTIFY_DEST_LOC_SPELL_CAST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_NPC_TEXT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_OFFER_PETITION_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_OPEN_CONTAINER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_OPEN_LFG_DUNGEON_FINDER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_OVERRIDE_LIGHT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PAGE_TEXT_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PARTYKILLLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PARTY_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PARTY_MEMBER_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PARTY_MEMBER_STATS_FULL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PAUSE_MIRROR_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PERIODICAURALOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PETGODMODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PETITION_ALREADY_SIGNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PETITION_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PETITION_SHOWLIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PETITION_SHOW_SIGNATURES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PETITION_SIGN_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_ACTION_FEEDBACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_ACTION_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_ADDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_BROKEN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_CAST_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_DISMISS_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_GUIDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PET_LEARNED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_NAME_INVALID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PET_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PET_REMOVED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_RENAMEABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_SLOT_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PET_SPELLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_TAME_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PET_UPDATE_COMBO_POINTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PLAYED_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PLAYERBINDERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PLAYERBOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PLAYER_DIFFICULTY_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PLAYER_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PLAYER_SKINNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PLAYER_VEHICLE_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PLAY_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PLAY_MUSIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PLAY_OBJECT_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PLAY_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PLAY_SPELL_VISUAL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PLAY_SPELL_VISUAL_KIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PLAY_TIME_WARNING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PONG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_POWER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PRE_RESURRECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PROCRESIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PROPOSE_LEVEL_GRANT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PVP_CREDIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PVP_LOG_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PVP_OPTIONS_ENABLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUERY_QUESTS_COMPLETED_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUERY_TIME_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_OFFER_REWARD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_DETAILS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_INVALID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_QUEST_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_REQUEST_ITEMS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_STATUS_MULTIPLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUESTLOG_FULL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_ADD_KILL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_ADD_PVP_KILL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_FAILEDTIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUEST_CONFIRM_ACCEPT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUEST_FORCE_REMOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUEST_POI_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUEST_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RAID_GROUP_ONLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_RAID_INSTANCE_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_RAID_INSTANCE_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RAID_MARKERS_CHANGED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RAID_READY_CHECK_THROTTLED_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RAID_SUMMON_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_RANDOMIZE_CHAR_NAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RATED_BG_RATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RATED_BG_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_READ_ITEM_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_READ_ITEM_OK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_REALM_SPLIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_REAL_GROUP_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_RECEIVED_MAIL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_REDIRECT_CLIENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_REFER_A_FRIEND_EXPIRED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_REFER_A_FRIEND_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_REFORGE_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_REMOVED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_REPORT_PVP_AFK_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_REQUEST_CEMETERY_LIST_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_REQUEST_PVP_REWARDS_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RESEARCH_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RESEARCH_SETUP_HISTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RESET_COMPRESSION_CONTEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RESET_FAILED_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RESPOND_INSPECT_ACHIEVEMENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RESURRECT_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RESYNC_RUNES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ROLE_POLL_BEGIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RWHOIS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SELL_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SEND_MAIL_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SEND_UNLEARN_SPELLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SERVERTIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SERVER_FIRST_ACHIEVEMENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SERVER_INFO_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SERVER_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SERVER_PERF, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SET_DF_FAST_LAUNCH_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SET_FACTION_ATWAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SET_FACTION_STANDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SET_FACTION_VISIBLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SET_FLAT_SPELL_MODIFIER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SET_FORCED_REACTIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SET_PCT_SPELL_MODIFIER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SET_PHASE_SHIFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SET_PLAY_HOVER_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SET_PROFICIENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SET_PROJECTILE_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SHOWTAXINODES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SHOW_BANK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SHOW_RATINGS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SOR_START_EXPERIENCE_INCOMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELLBREAKLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELLDAMAGESHIELD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELLDISPELLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELLENERGIZELOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELLHEALLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELLINSTAKILLLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELLINTERRUPTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELLLOGEXECUTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELLLOGMISS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELLNONMELEEDAMAGELOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELLORDAMAGE_IMMUNE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELLSTEALLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELL_CATEGORY_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELL_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELL_DELAYED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELL_FAILED_OTHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELL_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELL_GO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELL_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELL_UPDATE_CHAIN_TARGETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPIRIT_HEALER_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_COLLISION_DISABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_COLLISION_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_GRAVITY_DISABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_GRAVITY_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FEATHER_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FLYING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_LAND_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_NORMAL_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_RUN_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_RUN_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_SWIM_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_SWIM_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_WALK_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_START_SWIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_STOP_SWIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_UNROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_UNSET_FLYING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_UNSET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_STABLE_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_STANDSTATE_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_START_MIRROR_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_START_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_STOP_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_STOP_MIRROR_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_STREAMING_MOVIE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SUMMON_CANCEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SUMMON_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SUPERCEDED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SUPPRESS_NPC_GREETINGS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SUSPEND_COMMS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SUSPEND_TOKEN_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_TALENTS_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TALENTS_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_TALENTS_INVOLUNTARILY_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TAXINODE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_TEST_DROP_RATE_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TEXT_EMOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_THREAT_CLEAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_THREAT_REMOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_THREAT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_TIME_ADJUSTMENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TIME_SYNC_REQ, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TITLE_EARNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_TOGGLE_XP_GAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TOTEM_CREATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TRADE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TRADE_STATUS_EXTENDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_SUCCEEDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TRAINER_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TRANSFER_ABORTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TRANSFER_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TRIGGER_CINEMATIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TRIGGER_MOVIE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TURN_IN_PETITION_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TUTORIAL_FLAGS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_UNIT_HEALTH_FREQUENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_UNIT_SPELLCAST_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ACCOUNT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ACCOUNT_DATA_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_UPDATE_COMBO_POINTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_UPDATE_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_UPDATE_CURRENCY_WEEK_LIMIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_DUNGEON_ENCOUNTER_FOR_LOOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_UPDATE_INSTANCE_ENCOUNTER_UNIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_UPDATE_INSTANCE_OWNERSHIP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ITEM_ENCHANTMENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_UPDATE_LAST_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_UPDATE_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_SERVER_PLAYER_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_UPDATE_WORLD_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_USERLIST_ADD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_USERLIST_REMOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_USERLIST_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_VOICESESSION_FULL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_VOICE_CHAT_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_VOICE_PARENTAL_CONTROLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_LEAVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_ROSTER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SET_TALKER_MUTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_VOID_ITEM_SWAP_RESPONSE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_VOID_STORAGE_CONTENTS, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_VOID_STORAGE_FAILED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_VOID_STORAGE_TRANSFER_CHANGES, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_VOID_TRANSFER_RESULT, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_WAIT_QUEUE_FINISH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_WAIT_QUEUE_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_WARDEN_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_WARGAME_CHECK_ENTRY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_WARGAME_REQUEST_SENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_WEATHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_WEEKLY_LAST_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_WEEKLY_RESET_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_WEEKLY_SPELL_USAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_WEEKLY_SPELL_USAGE_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_WHO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_WHOIS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_WORLD_SERVER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_WORLD_STATE_UI_TIMER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_XP_GAIN_ABORTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ZONE_UNDER_ATTACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); // These opcodes are not in WPP - //DEFINE_OPCODE_HANDLER(CMSG_ACTIVE_PVP_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_ADD_PVP_MEDAL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_ADVANCE_SPAWN_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_AFK_MONITOR_INFO_CLEAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_AFK_MONITOR_INFO_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_AUTH_SRP6_BEGIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_AUTH_SRP6_PROOF, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_AUTH_SRP6_RECODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_AUTOEQUIP_GROUND_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_GROUND_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_JOIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MANAGER_ADVANCE_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MANAGER_SET_NEXT_TRANSITION_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_REQUEST_SCORE_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); Need to send the response - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlemasterHelloOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_BEASTMASTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_BOOTME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_BOT_DETECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_BOT_DETECTED2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_BUY_ITEM_IN_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyItemInSlotOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_BUY_LOTTERY_TICKET_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_BUY_STABLE_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyStableSlot ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_CONTEXT_EVENT_SIGNUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_INVITE_NOTES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_GROWTH_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelGrowthAuraOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANGE_GDF_ARENA_RATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANGE_PERSONAL_ARENA_RATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CHARACTER_POINT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_PLAYER_LOGIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_PLAYER_LOOKUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_SETMONEY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_SET_ARENA_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_SET_HONOR_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CHECK_LOGIN_CRITERIA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_EXPLORATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_HOLIDAY_BG_WIN_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_QUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_RANDOM_BG_WIN_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_SERVER_BUCK_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_COMPLETE_ACHIEVEMENT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CONTROLLER_EJECT_PASSENGER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEjectPassenger ); - //DEFINE_OPCODE_HANDLER(CMSG_COOLDOWN_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CREATEGAMEOBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CREATEITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CREATEMONSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_DBLOOKUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_ACTIONS_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_ACTIONS_STOP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_AISTATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_CHANGECELLZONE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_LIST_TARGETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_PASSIVE_AURA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_SERVER_GEO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_DECHARGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_DECLINE_CHANNEL_INVITE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleChannelDeclineInvite ); - //DEFINE_OPCODE_HANDLER(CMSG_DELETE_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_DEL_PVP_MEDAL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_DESTROYMONSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_DESTROY_ITEMS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_DISABLE_PVP_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_DROP_NEW_CONNECTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_DUMP_OBJECTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_ENABLE_DAMAGE_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_END_BATTLEFIELD_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_EQUIPMENT_SET_DELETE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetDelete ); - //DEFINE_OPCODE_HANDLER(CMSG_EXPIRE_RAID_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_FLAG_QUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_FLAG_QUEST_FINISH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_FLOOD_GRACE_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_FORCEACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_FORCEACTIONONOTHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_FORCEACTIONSHOW, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_FORCE_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_FORCE_SAY_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GAMESPEED_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GAMETIME_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GETDEATHBINDZONE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GET_CHANNEL_MEMBER_COUNT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGetChannelMemberCount ); - //DEFINE_OPCODE_HANDLER(CMSG_GHOST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GMRESPONSE_CREATE_TICKET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_CHARACTER_RESTORE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_CHARACTER_SAVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_CREATE_ITEM_TARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_DESTROY_ONLINE_CORPSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_FREEZE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_GRANT_ACHIEVEMENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_INVIS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_MOVECORPSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_NUKE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_NUKE_ACCOUNT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_NUKE_CHARACTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_REMOVE_ACHIEVEMENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_REQUEST_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_RESURRECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_REVEALTO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_SET_CRITERIA_FOR_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_SET_SECURITY_GROUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_SHOW_COMPLAINTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_SILENCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_SUMMONMOB, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_TEACH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_UBERINVIS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_UNSQUELCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_UNTEACH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_UPDATE_TICKET_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_VISION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_WHISPER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GODMODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GROUP_CANCEL, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GROUP_UNINVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupUninviteOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_MONEY_WITHDRAWN_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankMoneyWithdrawn ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_NOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_CREATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildCreateOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildInfoOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildLeaderOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_DIMINISHING_RETURNS_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_KNOCKBACK_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_REQUIREMENTS_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_INSTANCE_LOCK_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInstanceLockResponse ); - //DEFINE_OPCODE_HANDLER(CMSG_LEARN_DANCE_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LEARN_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LEAVE_BATTLEFIELD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLeaveBattlefieldOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_LEVEL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LFD_PARTY_LOCK_INFO_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgPartyLockInfoRequestOpcode); - //DEFINE_OPCODE_HANDLER(CMSG_LFD_PLAYER_LOCK_INFO_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgPlayerLockInfoRequestOpcode); - //DEFINE_OPCODE_HANDLER(CMSG_LFG_GET_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LFG_PARTY_LOCK_INFO_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_NEEDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_JOIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LOAD_DANCES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LOTTERY_QUERY_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LUA_USAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MAELSTROM_GM_SENT_MAIL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MAELSTROM_INVALIDATE_CACHE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MAELSTROM_RENAME_GUILD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MAKEMONSTERATTACKGUID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MEETINGSTONE_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_CHARACTER_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_CHARM_PORT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_CHARM_TELEPORT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_ENABLE_SWIM_TO_FLY_TRANS_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_FLY, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_RELATIVE_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_VEHICLE_REC_ID_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_START_SWIM_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_STOP_SWIM_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_TOGGLE_COLLISION_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_NEW_SPELL_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_NO_SPELL_VARIANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_PERFORM_ACTION_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_PETGODMODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_PET_LEVEL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_PET_NAME_CACHE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_PET_UNLEARN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_PET_UNLEARN_TALENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_PLAYER_AI_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_PLAYER_DIFFICULTY_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_PLAYER_LOGOUT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayerLogoutOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_PROFILEDATA_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_PVP_QUEUE_STATS_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_MAX_XP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_QUERY_OBJECT_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_QUERY_OBJECT_ROTATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_QUERY_SERVER_BUCK_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_QUERY_VEHICLE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_CANCEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverCancel ); - //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_QUEST_AUTOLAUNCH, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverQuestAutoLaunch ); - //DEFINE_OPCODE_HANDLER(CMSG_QUESTLOG_SWAP_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestLogSwapQuest ); - //DEFINE_OPCODE_HANDLER(CMSG_QUEST_NPC_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_RECHARGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_REDIRECTION_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_REFER_A_FRIEND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_REMOVE_GLYPH, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRemoveGlyph ); - //DEFINE_OPCODE_HANDLER(CMSG_REPLACE_ACCOUNT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_RUN_SCRIPT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SAVE_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SAVE_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SEARCH_LFG_JOIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfrSearchOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_SEARCH_LFG_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfrLeaveOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_SEND_COMBAT_TRIGGER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SEND_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SEND_GENERAL_TRIGGER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SEND_LOCAL_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SERVERINFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SERVERTIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SERVER_BROADCAST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SERVER_COMMAND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SERVER_INFO_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SETDEATHBINDPOINT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIVE_TALENT_GROUP_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_ARENA_MEMBER_SEASON_GAMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_ARENA_MEMBER_WEEKLY_GAMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_ARENA_TEAM_RATING_BY_INDEX, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_ARENA_TEAM_SEASON_GAMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_ARENA_TEAM_WEEKLY_GAMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_BREATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_CHARACTER_MODEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_CRITERIA_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_DURABILITY_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_EXPLORATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_EXPLORATION_ALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_FACTION_CHEAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetFactionCheat ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_GLYPH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_GLYPH_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_GRANTABLE_LEVELS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_GUILD_BANK_TEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetGuildBankTabText ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_LFG_COMMENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetCommentOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_PAID_SERVICE_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_PVP_RANK_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_PVP_TITLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_RUNE_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_RUNE_COUNT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_SKILL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_STAT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_TITLE_SUFFIX, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_WORLDSTATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SKILL_BUY_RANK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SKILL_BUY_STEP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_STABLE_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStablePet ); - //DEFINE_OPCODE_HANDLER(CMSG_STABLE_REVIVE_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStableRevivePet ); - //DEFINE_OPCODE_HANDLER(CMSG_STABLE_SWAP_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStableSwapPet ); - //DEFINE_OPCODE_HANDLER(CMSG_START_BATTLEFIELD_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_START_QUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_STORE_LOOT_IN_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SUSPEND_COMMS_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_TARGET_CAST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_TARGET_SCRIPT_CAST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_TAXICLEARALLNODES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_TAXICLEARNODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_TAXIENABLEALLNODES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_TAXIENABLENODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_TAXISHOWNODES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_TEST_DROP_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_TOGGLE_XP_GAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_TRIGGER_CINEMATIC_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_UNCLAIM_LICENSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_UNDRESSPLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_UNITANIMTIER_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_DANCE_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_TALENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_UNSTABLE_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnstablePet ); - //DEFINE_OPCODE_HANDLER(CMSG_UNUSED5, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_UNUSED6, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_USE_SKILL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_VOICE_SET_TALKER_MUTED_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_WEATHER_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_XP_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_ZONE_MAP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_BATTLEGROUND_PLAYER_POSITIONS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlegroundPlayerPositionsOpcode); - //DEFINE_OPCODE_HANDLER(MSG_DELAY_GHOST_TELEPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_DEV_SHOWLABEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_GM_ACCOUNT_ONLINE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_GM_BIND_OTHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_GM_CHANGE_ARENA_RATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_GM_DESTROY_CORPSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_GM_GEARRATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_GM_RESETINSTANCELIMIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_GM_SHOWLABEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_GM_SUMMON, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_GUILD_BANK_LOG_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankLogQuery ); - //DEFINE_OPCODE_HANDLER(MSG_GUILD_EVENT_LOG_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildEventLogQueryOpcode ); - //DEFINE_OPCODE_HANDLER(MSG_INSPECT_HONOR_STATS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectHonorStatsOpcode ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_FEATHER_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_GRAVITY_CHNG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_ALL_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_COLLISION_HEIGHT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_FLIGHT_BACK_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_FLIGHT_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_PITCH_RATE_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RAW_POSITION_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_BACK_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_SWIM_BACK_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_SWIM_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_TURN_RATE_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_WALK_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_SWIM_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_SWIM_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_TOGGLE_FALL_LOGGING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_TOGGLE_LOGGING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_MOUSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_NULL_ACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_PVP_LOG_DATA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePVPLogDataOpcode ); - //DEFINE_OPCODE_HANDLER(MSG_QUERY_GUILD_BANK_TEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryGuildBankTabText ); - //DEFINE_OPCODE_HANDLER(MSG_START_MOVE_FORWARD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_VIEW_PHASE_SHIFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_AFK_MONITOR_INFO_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_AURACASTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS1, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_PLAYER_POSITIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BINDZONEREPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BUY_BANK_SLOT_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_ACTION_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_UPDATE_INVITE_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHANGEPLAYER_DIFFICULTY_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHARACTER_PROFILE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHARACTER_PROFILE_REALM_CONNECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY_RESPONSE_WRITE_FILE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHEAT_PLAYER_LOOKUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHECK_FOR_BOTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_EXTRA_AURA_INFO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMBAT_LOG_MULTIPLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_GET_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMPLETION_NPC_RESPONCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_ACHIEVEMENT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_CHAR_ENUM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_GUILD_ROSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_UNKNOWN_1310, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_UPDATE_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CORPSE_IS_NOT_IN_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DAMAGE_DONE_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DBLOOKUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DEBUGAURAPROC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DEBUG_AISTATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DEBUG_LIST_TARGETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DEBUG_SERVER_GEO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DUMP_OBJECTS_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DYNAMIC_DROP_ROLL_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_FORCEACTIONSHOW, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_FORCE_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_FORCE_DISPLAY_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GAMETIMEBIAS_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GHOSTEE_GONE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GMRESPONSE_CREATE_TICKET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GOGOGO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_MONEY_WITHDRAWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_CANCEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_KNOWN_RECIPES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_SET_NOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_TRADESKILL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_XP_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_IGNORE_DIMINISHING_RETURNS_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_IGNORE_REQUIREMENTS_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_INIT_EXTRA_AURA_INFO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_INSPECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_DIFFICULTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_JOINED_BATTLEGROUND_QUEUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_KICK_REASON, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_OPEN_FROM_GOSSIP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_PARTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_SEARCH_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LOTTERY_QUERY_RESULT_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LOTTERY_RESULT_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_MEMBER_ADDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_SETQUEUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MINIGAME_MOVE_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_CHARACTER_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_DISABLE_COLLISION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_DISABLE_GRAVITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_ENABLE_COLLISION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_ENABLE_GRAVITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_VEHICLE_REC_ID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_WALK_IN_AIR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SKIP_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_WALK_IN_AIR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_TELEPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_NPC_WONT_TALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_UNLEARN_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PLAYER_UNK_DEAD_ALIVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PLAY_SPELL_IMPACT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PROFILEDATA_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PUREMOUNT_CANCELLED_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PVP_QUEUE_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_QUERY_OBJECT_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_QUERY_OBJECT_ROTATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RAID_READY_CHECK_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_REMOVED_FROM_PVP_QUEUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RESET_RANGED_COMBAT_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RESISTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RESUME_CAST_BAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RESURRECT_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SCRIPT_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SEND_ALL_COMBAT_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SERVERINFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SERVER_BUCK_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SERVER_BUCK_DATA_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SETUP_RESEARCH_HISTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SET_EXTRA_AURA_INFO_NEED_UPDATE_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SET_EXTRA_AURA_INFO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SHOW_MAILBOX, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELL_CHANCE_PROC_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELL_CHANCE_RESIST_PUSHBACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_LAND_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_NORMAL_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_RUN_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_SWIM_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_SWIM_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_ADJUST_PRIORITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ZONE_MAP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(CMSG_ACTIVE_PVP_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_ADD_PVP_MEDAL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_ADVANCE_SPAWN_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_AFK_MONITOR_INFO_CLEAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_AFK_MONITOR_INFO_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_AUTH_SRP6_BEGIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_AUTH_SRP6_PROOF, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_AUTH_SRP6_RECODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_AUTOEQUIP_GROUND_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_GROUND_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_JOIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MANAGER_ADVANCE_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MANAGER_SET_NEXT_TRANSITION_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_REQUEST_SCORE_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); Need to send the response + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlemasterHelloOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_BEASTMASTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_BOOTME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_BOT_DETECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_BOT_DETECTED2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_BUY_ITEM_IN_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyItemInSlotOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_BUY_LOTTERY_TICKET_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_BUY_STABLE_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyStableSlot ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_CONTEXT_EVENT_SIGNUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_INVITE_NOTES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_GROWTH_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelGrowthAuraOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANGE_GDF_ARENA_RATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHANGE_PERSONAL_ARENA_RATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHARACTER_POINT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_PLAYER_LOGIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_PLAYER_LOOKUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_SETMONEY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_SET_ARENA_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHEAT_SET_HONOR_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CHECK_LOGIN_CRITERIA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_EXPLORATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_HOLIDAY_BG_WIN_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_QUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_RANDOM_BG_WIN_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_SERVER_BUCK_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_COMPLETE_ACHIEVEMENT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CONTROLLER_EJECT_PASSENGER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEjectPassenger ); + //DEFINE_OPCODE_HANDLER(CMSG_COOLDOWN_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CREATEGAMEOBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CREATEITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_CREATEMONSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DBLOOKUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_ACTIONS_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_ACTIONS_STOP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_AISTATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_CHANGECELLZONE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_LIST_TARGETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_PASSIVE_AURA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DEBUG_SERVER_GEO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DECHARGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DECLINE_CHANNEL_INVITE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleChannelDeclineInvite ); + //DEFINE_OPCODE_HANDLER(CMSG_DELETE_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DEL_PVP_MEDAL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DESTROYMONSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DESTROY_ITEMS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DISABLE_PVP_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DROP_NEW_CONNECTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_DUMP_OBJECTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_ENABLE_DAMAGE_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_END_BATTLEFIELD_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_EQUIPMENT_SET_DELETE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetDelete ); + //DEFINE_OPCODE_HANDLER(CMSG_EXPIRE_RAID_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_FLAG_QUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_FLAG_QUEST_FINISH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_FLOOD_GRACE_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_FORCEACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_FORCEACTIONONOTHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_FORCEACTIONSHOW, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_FORCE_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_FORCE_SAY_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GAMESPEED_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GAMETIME_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GETDEATHBINDZONE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GET_CHANNEL_MEMBER_COUNT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGetChannelMemberCount ); + //DEFINE_OPCODE_HANDLER(CMSG_GHOST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GMRESPONSE_CREATE_TICKET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_CHARACTER_RESTORE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_CHARACTER_SAVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_CREATE_ITEM_TARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_DESTROY_ONLINE_CORPSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_FREEZE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_GRANT_ACHIEVEMENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_INVIS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_MOVECORPSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_NUKE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_NUKE_ACCOUNT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_NUKE_CHARACTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_REMOVE_ACHIEVEMENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_REQUEST_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_RESURRECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_REVEALTO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_SET_CRITERIA_FOR_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_SET_SECURITY_GROUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_SHOW_COMPLAINTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_SILENCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_SUMMONMOB, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_TEACH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_UBERINVIS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_UNSQUELCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_UNTEACH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_UPDATE_TICKET_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_VISION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GM_WHISPER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GODMODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GROUP_CANCEL, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GROUP_UNINVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupUninviteOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_MONEY_WITHDRAWN_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankMoneyWithdrawn ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_NOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_CREATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildCreateOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildInfoOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_GUILD_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildLeaderOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_DIMINISHING_RETURNS_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_KNOCKBACK_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_REQUIREMENTS_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_INSTANCE_LOCK_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInstanceLockResponse ); + //DEFINE_OPCODE_HANDLER(CMSG_LEARN_DANCE_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LEARN_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LEAVE_BATTLEFIELD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLeaveBattlefieldOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_LEVEL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LFD_PARTY_LOCK_INFO_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgPartyLockInfoRequestOpcode); + //DEFINE_OPCODE_HANDLER(CMSG_LFD_PLAYER_LOCK_INFO_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgPlayerLockInfoRequestOpcode); + //DEFINE_OPCODE_HANDLER(CMSG_LFG_GET_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LFG_PARTY_LOCK_INFO_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_NEEDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_JOIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LOAD_DANCES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LOTTERY_QUERY_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_LUA_USAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MAELSTROM_GM_SENT_MAIL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MAELSTROM_INVALIDATE_CACHE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MAELSTROM_RENAME_GUILD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MAKEMONSTERATTACKGUID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MEETINGSTONE_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_CHARACTER_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_CHARM_PORT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_CHARM_TELEPORT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_ENABLE_SWIM_TO_FLY_TRANS_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_FLY, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_RELATIVE_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_VEHICLE_REC_ID_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_START_SWIM_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_STOP_SWIM_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_MOVE_TOGGLE_COLLISION_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_NEW_SPELL_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_NO_SPELL_VARIANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_PERFORM_ACTION_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_PETGODMODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_PET_LEVEL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_PET_NAME_CACHE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_PET_UNLEARN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_PET_UNLEARN_TALENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_PLAYER_AI_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_PLAYER_DIFFICULTY_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_PLAYER_LOGOUT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayerLogoutOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_PROFILEDATA_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_PVP_QUEUE_STATS_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_MAX_XP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_QUERY_OBJECT_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_QUERY_OBJECT_ROTATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_QUERY_SERVER_BUCK_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_QUERY_VEHICLE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_CANCEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverCancel ); + //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_QUEST_AUTOLAUNCH, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverQuestAutoLaunch ); + //DEFINE_OPCODE_HANDLER(CMSG_QUESTLOG_SWAP_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestLogSwapQuest ); + //DEFINE_OPCODE_HANDLER(CMSG_QUEST_NPC_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_RECHARGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_REDIRECTION_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_REFER_A_FRIEND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_REMOVE_GLYPH, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRemoveGlyph ); + //DEFINE_OPCODE_HANDLER(CMSG_REPLACE_ACCOUNT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_RUN_SCRIPT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SAVE_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SAVE_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SEARCH_LFG_JOIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfrSearchOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_SEARCH_LFG_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfrLeaveOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_SEND_COMBAT_TRIGGER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SEND_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SEND_GENERAL_TRIGGER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SEND_LOCAL_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SERVERINFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SERVERTIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SERVER_BROADCAST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SERVER_COMMAND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SERVER_INFO_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SETDEATHBINDPOINT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIVE_TALENT_GROUP_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_ARENA_MEMBER_SEASON_GAMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_ARENA_MEMBER_WEEKLY_GAMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_ARENA_TEAM_RATING_BY_INDEX, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_ARENA_TEAM_SEASON_GAMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_ARENA_TEAM_WEEKLY_GAMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_BREATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_CHARACTER_MODEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_CRITERIA_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_DURABILITY_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_EXPLORATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_EXPLORATION_ALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_FACTION_CHEAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetFactionCheat ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_GLYPH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_GLYPH_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_GRANTABLE_LEVELS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_GUILD_BANK_TEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetGuildBankTabText ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_LFG_COMMENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetCommentOpcode ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_PAID_SERVICE_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_PVP_RANK_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_PVP_TITLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_RUNE_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_RUNE_COUNT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_SKILL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_STAT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_TITLE_SUFFIX, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SET_WORLDSTATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SKILL_BUY_RANK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SKILL_BUY_STEP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_STABLE_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStablePet ); + //DEFINE_OPCODE_HANDLER(CMSG_STABLE_REVIVE_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStableRevivePet ); + //DEFINE_OPCODE_HANDLER(CMSG_STABLE_SWAP_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStableSwapPet ); + //DEFINE_OPCODE_HANDLER(CMSG_START_BATTLEFIELD_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_START_QUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_STORE_LOOT_IN_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_SUSPEND_COMMS_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_TARGET_CAST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_TARGET_SCRIPT_CAST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_TAXICLEARALLNODES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_TAXICLEARNODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_TAXIENABLEALLNODES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_TAXIENABLENODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_TAXISHOWNODES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_TEST_DROP_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_TOGGLE_XP_GAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_TRIGGER_CINEMATIC_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_UNCLAIM_LICENSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_UNDRESSPLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_UNITANIMTIER_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_DANCE_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_TALENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_UNSTABLE_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnstablePet ); + //DEFINE_OPCODE_HANDLER(CMSG_UNUSED5, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_UNUSED6, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_USE_SKILL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_VOICE_SET_TALKER_MUTED_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_WEATHER_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_XP_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_ZONE_MAP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_BATTLEGROUND_PLAYER_POSITIONS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlegroundPlayerPositionsOpcode); + //DEFINE_OPCODE_HANDLER(MSG_DELAY_GHOST_TELEPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_DEV_SHOWLABEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_GM_ACCOUNT_ONLINE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_GM_BIND_OTHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_GM_CHANGE_ARENA_RATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_GM_DESTROY_CORPSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_GM_GEARRATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_GM_RESETINSTANCELIMIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_GM_SHOWLABEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_GM_SUMMON, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_GUILD_BANK_LOG_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankLogQuery ); + //DEFINE_OPCODE_HANDLER(MSG_GUILD_EVENT_LOG_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildEventLogQueryOpcode ); + //DEFINE_OPCODE_HANDLER(MSG_INSPECT_HONOR_STATS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectHonorStatsOpcode ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_FEATHER_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_GRAVITY_CHNG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_ALL_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_COLLISION_HEIGHT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_FLIGHT_BACK_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_FLIGHT_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_PITCH_RATE_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RAW_POSITION_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_BACK_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_SWIM_BACK_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_SWIM_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_TURN_RATE_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_WALK_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_START_SWIM_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_SWIM_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_TOGGLE_FALL_LOGGING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_TOGGLE_LOGGING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_MOUSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_MOVE_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_NULL_ACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_PVP_LOG_DATA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePVPLogDataOpcode ); + //DEFINE_OPCODE_HANDLER(MSG_QUERY_GUILD_BANK_TEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryGuildBankTabText ); + //DEFINE_OPCODE_HANDLER(MSG_START_MOVE_FORWARD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(MSG_VIEW_PHASE_SHIFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(SMSG_AFK_MONITOR_INFO_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_AURACASTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS1, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_PLAYER_POSITIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BINDZONEREPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_BUY_BANK_SLOT_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_ACTION_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_UPDATE_INVITE_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHANGEPLAYER_DIFFICULTY_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHARACTER_PROFILE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHARACTER_PROFILE_REALM_CONNECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY_RESPONSE_WRITE_FILE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHEAT_PLAYER_LOOKUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CHECK_FOR_BOTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_EXTRA_AURA_INFO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMBAT_LOG_MULTIPLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_GET_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMPLETION_NPC_RESPONCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_ACHIEVEMENT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_CHAR_ENUM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_GUILD_ROSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_UNKNOWN_1310, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_UPDATE_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_CORPSE_IS_NOT_IN_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DAMAGE_DONE_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DBLOOKUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DEBUGAURAPROC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DEBUG_AISTATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DEBUG_LIST_TARGETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DEBUG_SERVER_GEO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DUMP_OBJECTS_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_DYNAMIC_DROP_ROLL_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_FORCEACTIONSHOW, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_FORCE_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_FORCE_DISPLAY_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GAMETIMEBIAS_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GHOSTEE_GONE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GMRESPONSE_CREATE_TICKET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GOGOGO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_MONEY_WITHDRAWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_CANCEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_KNOWN_RECIPES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_SET_NOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_TRADESKILL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_GUILD_XP_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_IGNORE_DIMINISHING_RETURNS_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_IGNORE_REQUIREMENTS_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_INIT_EXTRA_AURA_INFO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_INSPECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_DIFFICULTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_JOINED_BATTLEGROUND_QUEUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_KICK_REASON, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_OPEN_FROM_GOSSIP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_PARTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_SEARCH_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LOTTERY_QUERY_RESULT_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_LOTTERY_RESULT_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_MEMBER_ADDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_SETQUEUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MINIGAME_MOVE_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_CHARACTER_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_DISABLE_COLLISION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_DISABLE_GRAVITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_ENABLE_COLLISION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_ENABLE_GRAVITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_VEHICLE_REC_ID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_WALK_IN_AIR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SKIP_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_WALK_IN_AIR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_TELEPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_NPC_WONT_TALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PET_UNLEARN_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PLAYER_UNK_DEAD_ALIVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PLAY_SPELL_IMPACT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PROFILEDATA_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PUREMOUNT_CANCELLED_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_PVP_QUEUE_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_QUERY_OBJECT_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_QUERY_OBJECT_ROTATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RAID_READY_CHECK_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_REMOVED_FROM_PVP_QUEUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RESET_RANGED_COMBAT_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RESISTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RESUME_CAST_BAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_RESURRECT_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SCRIPT_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SEND_ALL_COMBAT_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SERVERINFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SERVER_BUCK_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SERVER_BUCK_DATA_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SETUP_RESEARCH_HISTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SET_EXTRA_AURA_INFO_NEED_UPDATE_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SET_EXTRA_AURA_INFO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SHOW_MAILBOX, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELL_CHANCE_PROC_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPELL_CHANCE_RESIST_PUSHBACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_LAND_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_NORMAL_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_RUN_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_SWIM_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_SWIM_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_ADJUST_PRIORITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_ZONE_MAP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); #undef DEFINE_OPCODE_HANDLER }; diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 43e4ddfb9e4..cc3734ecdc2 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -183,7 +183,6 @@ enum Opcodes CMSG_DEL_IGNORE = 0x4727, CMSG_DEL_VOICE_IGNORE = 0x0024, CMSG_DESTROY_ITEM = 0x4A27, - CMSG_DESTROY_ITEMS = 0x0000, CMSG_DISMISS_CONTROLLED_VEHICLE = 0x3218, CMSG_DISMISS_CRITTER = 0x4227, CMSG_DUEL_ACCEPTED = 0x2136, @@ -254,7 +253,6 @@ enum Opcodes CMSG_GUILD_BANK_UPDATE_TAB = 0x0106, CMSG_GUILD_BANK_WITHDRAW_MONEY = 0x0037, CMSG_GUILD_CHANGE_NAME_REQUEST = 0x1232, - CMSG_GUILD_CREATE = 0x0000, CMSG_GUILD_DECLINE = 0x3231, CMSG_GUILD_DEL_RANK = 0x3234, CMSG_GUILD_DEMOTE = 0x1020, @@ -429,7 +427,6 @@ enum Opcodes CMSG_PVP_LOG_DATA = 0x7308, CMSG_QUERY_BATTLEFIELD_STATE = 0x7202, CMSG_QUERY_COMPLETION_NPC_RESPONSE = 0x7302, - CMSG_QUERY_GUILD_MAX_XP = 0x0000, CMSG_QUERY_GUILD_MEMBERS_FOR_RECIPE = 0x1036, CMSG_QUERY_GUILD_MEMBER_RECIPES = 0x1037, CMSG_QUERY_GUILD_RECIPES = 0x3033, @@ -816,8 +813,6 @@ enum Opcodes SMSG_COMMENTATOR_SKIRMISH_QUEUE_RESULT2 = 0x6814, SMSG_COMMENTATOR_STATE_CHANGED = 0x0737, SMSG_COMPLAIN_RESULT = 0x6D24, - SMSG_COMPLETION_NPC_RESPONCE = 0x0000, - SMSG_COMPLETION_NPC_RESPONSE = 0x75A1, SMSG_COMPRESSED_ACHIEVEMENT_DATA = 0x0000, SMSG_COMPRESSED_CHAR_ENUM = 0x0000, SMSG_COMPRESSED_GUILD_ROSTER = 0x0000, @@ -1217,6 +1212,7 @@ enum Opcodes SMSG_QUESTUPDATE_COMPLETE = 0x2937, SMSG_QUESTUPDATE_FAILED = 0x6324, SMSG_QUESTUPDATE_FAILEDTIMER = 0x6427, + SMSG_QUEST_NPC_QUERY_RESPONSE = 0x75A1, SMSG_QUEST_CONFIRM_ACCEPT = 0x6F07, SMSG_QUEST_FORCE_REMOVE = 0x6605, SMSG_QUEST_POI_QUERY_RESPONSE = 0x6304, diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index 9c2c917519b..a2f2492b810 100644 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -200,17 +200,23 @@ void WorldSession::SendPacket(WorldPacket const* packet, bool forced /*= false*/ if (!m_Socket) return; - if (packet->GetOpcode() == NULL_OPCODE || packet->GetOpcode() == UNKNOWN_OPCODE) + if (packet->GetOpcode() == NULL_OPCODE) { - sLog->outError(LOG_FILTER_NETWORKIO, "Prevented sending of %s", packet->GetOpcode() == NULL_OPCODE ? "NULL_OPCODE" : "UNKNOWN_OPCODE"); + sLog->outError(LOG_FILTER_OPCODES, "Prevented sending of NULL_OPCODE to %s", GetPlayerName(false).c_str()); + return; + } + else if (packet->GetOpcode() == UNKNOWN_OPCODE) + { + sLog->outError(LOG_FILTER_OPCODES, "Prevented sending of UNKNOWN_OPCODE to %s", GetPlayerName(false).c_str()); return; } if (!forced) { - if (!opcodeTable[packet->GetOpcode()]) + OpcodeHandler* handler = opcodeTable[packet->GetOpcode()]; + if (!handler || handler->status == STATUS_UNHANDLED) { - sLog->outError(LOG_FILTER_NETWORKIO, "Prevented sending disabled opcode %d (hex 0x%04X)", packet->GetOpcode(), packet->GetOpcode()); + sLog->outError(LOG_FILTER_OPCODES, "Prevented sending disabled opcode %s to %s", GetOpcodeNameForLogging(packet->GetOpcode()).c_str(), GetPlayerName(false).c_str()); return; } } diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 53398de8c65..2427ede716a 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -567,7 +567,6 @@ class WorldSession void HandleTurnInPetitionOpcode(WorldPacket& recvData); void HandleGuildQueryOpcode(WorldPacket& recvPacket); - void HandleGuildCreateOpcode(WorldPacket& recvPacket); void HandleGuildInviteOpcode(WorldPacket& recvPacket); void HandleGuildRemoveOpcode(WorldPacket& recvPacket); void HandleGuildAcceptOpcode(WorldPacket& recvPacket); diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index 4d329c8d689..4e8292c621e 100644 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -731,7 +731,8 @@ int WorldSocket::ProcessIncoming(WorldPacket* new_pct) return -1; } - if (!opcodeTable[opcode]) + OpcodeHandler* handler = opcodeTable[opcode]; + if (!handler || handler->status == STATUS_UNHANDLED) { sLog->outError(LOG_FILTER_OPCODES, "No defined handler for opcode %s sent by %s", GetOpcodeNameForLogging(new_pct->GetOpcode()).c_str(), m_Session->GetPlayerName(false).c_str()); return 0; @@ -743,7 +744,7 @@ int WorldSocket::ProcessIncoming(WorldPacket* new_pct) // OK, give the packet to WorldSession aptr.release(); - // WARNINIG here we call it with locks held. + // WARNING here we call it with locks held. // Its possible to cause deadlock if QueuePacket calls back m_Session->QueuePacket(new_pct); return 0; -- cgit v1.2.3 From 80a64f37f96bf80906cfdd0f3aa1e7e8e9aba441 Mon Sep 17 00:00:00 2001 From: Spp Date: Wed, 22 Aug 2012 13:57:00 +0200 Subject: Core/Opcodes: Enable all handlers and mark as UNHANDLED those that need to be implemented/reviewed (This change allows to see opcode name in logs when opcode is unhandled) Note: STATUS_NEVER should only be used for SMSG opcodes (and CMSG Handled by EarlyProcess) --- src/server/game/Server/Protocol/Opcodes.cpp | 1127 +++++++++++++-------------- 1 file changed, 563 insertions(+), 564 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 9f83f984cba..c8ec02e1edc 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -49,13 +49,13 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_ADDON_REGISTERED_PREFIXES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddonRegisteredPrefixesOpcode); DEFINE_OPCODE_HANDLER(CMSG_ADD_FRIEND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddFriendOpcode ); DEFINE_OPCODE_HANDLER(CMSG_ADD_IGNORE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAddIgnoreOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_ADD_VOICE_IGNORE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_ADD_VOICE_IGNORE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_ALTER_APPEARANCE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAlterAppearance ); DEFINE_OPCODE_HANDLER(CMSG_AREATRIGGER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaTriggerOpcode ); DEFINE_OPCODE_HANDLER(CMSG_AREA_SPIRIT_HEALER_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaSpiritHealerQueryOpcode); DEFINE_OPCODE_HANDLER(CMSG_AREA_SPIRIT_HEALER_QUEUE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaSpiritHealerQueueOpcode); DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamAcceptOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_CREATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_CREATE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamDeclineOpcode ); DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_DISBAND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamDisbandOpcode ); DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamInviteOpcode ); @@ -66,13 +66,13 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_ROSTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamRosterOpcode ); DEFINE_OPCODE_HANDLER(CMSG_ATTACKSTOP, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleAttackStopOpcode ); DEFINE_OPCODE_HANDLER(CMSG_ATTACKSWING, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleAttackSwingOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_BIDDER_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListBidderItems ); - //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListItems ); - //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_OWNER_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListOwnerItems ); - //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_PENDING_SALES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListPendingSales ); - //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_PLACE_BID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionPlaceBid ); - //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_REMOVE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionRemoveItem ); - //DEFINE_OPCODE_HANDLER(CMSG_AUCTION_SELL_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionSellItem ); + DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_BIDDER_ITEMS, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListBidderItems ); + DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_ITEMS, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListItems ); + DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_OWNER_ITEMS, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListOwnerItems ); + DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_PENDING_SALES, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListPendingSales ); + DEFINE_OPCODE_HANDLER(CMSG_AUCTION_PLACE_BID, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionPlaceBid ); + DEFINE_OPCODE_HANDLER(CMSG_AUCTION_REMOVE_ITEM, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionRemoveItem ); + DEFINE_OPCODE_HANDLER(CMSG_AUCTION_SELL_ITEM, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionSellItem ); DEFINE_OPCODE_HANDLER(CMSG_AUTH_SESSION, STATUS_NEVER, PROCESS_THREADUNSAFE, &WorldSession::Handle_EarlyProccess ); DEFINE_OPCODE_HANDLER(CMSG_AUTOBANK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoBankItemOpcode ); DEFINE_OPCODE_HANDLER(CMSG_AUTOEQUIP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoEquipItemOpcode ); @@ -80,76 +80,76 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_BAG_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoStoreBagItemOpcode ); DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_BANK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoStoreBankItemOpcode ); DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_LOOT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutostoreLootItemOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_AUTO_DECLINE_GUILD_INVITES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_AUTO_DECLINE_GUILD_INVITES, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_BANKER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBankerActivateOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_LEAVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_LEAVE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlefieldListOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_ENTRY_INVITE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_EXIT_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_QUEUE_INVITE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_QUEUE_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_PORT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattleFieldPortOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_ENTRY_INVITE_RESPONSE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_EXIT_REQUEST, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_QUEUE_INVITE_RESPONSE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_QUEUE_REQUEST, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_PORT, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleBattleFieldPortOpcode ); DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_STATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlefieldStatusOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEGROUND_PLAYER_POSITIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_JOIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlemasterJoinOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_JOIN_ARENA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlemasterJoinArena ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_JOIN_RATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_BATTLEGROUND_PLAYER_POSITIONS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_JOIN, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlemasterJoinOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_JOIN_ARENA, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlemasterJoinArena ); + DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_JOIN_RATED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_BEGIN_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBeginTradeOpcode ); DEFINE_OPCODE_HANDLER(CMSG_BINDER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBinderActivateOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_BUG, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBugOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_BUG, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleBugOpcode ); DEFINE_OPCODE_HANDLER(CMSG_BUSY_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBusyTradeOpcode ); DEFINE_OPCODE_HANDLER(CMSG_BUYBACK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuybackItem ); DEFINE_OPCODE_HANDLER(CMSG_BUY_BANK_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyBankSlotOpcode ); DEFINE_OPCODE_HANDLER(CMSG_BUY_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyItemOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_ADD_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarAddEvent ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_ARENA_TEAM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarArenaTeam ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_COMPLAIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarComplain ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_COPY_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarCopyEvent ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventInvite ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_MODERATOR_STATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventModeratorStatus); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_REMOVE_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventRemoveInvite ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_RSVP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventRsvp ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_SIGNUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_STATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventStatus ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_GET_CALENDAR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGetCalendar ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_GET_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGetEvent ); + DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_ADD_EVENT, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarAddEvent ); + DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_ARENA_TEAM, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarArenaTeam ); + DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_COMPLAIN, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarComplain ); + DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_COPY_EVENT, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarCopyEvent ); + DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_INVITE, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventInvite ); + DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_MODERATOR_STATUS, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventModeratorStatus); + DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_REMOVE_INVITE, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventRemoveInvite ); + DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_RSVP, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventRsvp ); + DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_SIGNUP, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_STATUS, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventStatus ); + DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_GET_CALENDAR, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGetCalendar ); + DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_GET_EVENT, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGetEvent ); DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_GET_NUM_PENDING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGetNumPending ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_GUILD_FILTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGuildFilter ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_REMOVE_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarRemoveEvent ); - //DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_UPDATE_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarUpdateEvent ); + DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_GUILD_FILTER, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGuildFilter ); + DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_REMOVE_EVENT, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarRemoveEvent ); + DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_UPDATE_EVENT, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarUpdateEvent ); DEFINE_OPCODE_HANDLER(CMSG_CANCEL_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelAuraOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_AUTO_REPEAT_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelAutoRepeatSpellOpcode); + DEFINE_OPCODE_HANDLER(CMSG_CANCEL_AUTO_REPEAT_SPELL, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelAutoRepeatSpellOpcode); DEFINE_OPCODE_HANDLER(CMSG_CANCEL_CAST, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleCancelCastOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_CHANNELLING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelChanneling ); + DEFINE_OPCODE_HANDLER(CMSG_CANCEL_CHANNELLING, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelChanneling ); DEFINE_OPCODE_HANDLER(CMSG_CANCEL_MOUNT_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelMountAuraOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_QUEUED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CANCEL_TEMP_ENCHANTMENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelTempEnchantmentOpcode); + DEFINE_OPCODE_HANDLER(CMSG_CANCEL_QUEUED_SPELL, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_CANCEL_TEMP_ENCHANTMENT, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelTempEnchantmentOpcode); DEFINE_OPCODE_HANDLER(CMSG_CANCEL_TRADE, STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelTradeOpcode); DEFINE_OPCODE_HANDLER(CMSG_CAST_SPELL, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleCastSpellOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANGEPLAYER_DIFFICULTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); + DEFINE_OPCODE_HANDLER(CMSG_CHANGEPLAYER_DIFFICULTY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_ANNOUNCEMENTS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelAnnouncements ); DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_BAN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelBan ); DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_DISPLAY_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelDisplayListQuery ); DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelInvite ); DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_KICK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelKick ); DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelList ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_MODERATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_MODERATE, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_MODERATOR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelModerator ); DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_MUTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelMute ); DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_OWNER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelOwner ); DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_PASSWORD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelPassword ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_ROSTER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_ROSTER_INFO, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_SET_OWNER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelSetOwner ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_SILENCE_ALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_SILENCE_VOICE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_SILENCE_ALL, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_SILENCE_VOICE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNBAN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelUnban ); DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNMODERATOR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelUnmoderator ); DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNMUTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelUnmute ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNSILENCE_ALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNSILENCE_VOICE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_VOICE_OFF, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_VOICE_ON, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelVoiceOnOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNSILENCE_ALL, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_UNSILENCE_VOICE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_VOICE_OFF, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_CHANNEL_VOICE_ON, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleChannelVoiceOnOpcode ); DEFINE_OPCODE_HANDLER(CMSG_CHAR_CREATE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharCreateOpcode ); DEFINE_OPCODE_HANDLER(CMSG_CHAR_CUSTOMIZE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharCustomize ); DEFINE_OPCODE_HANDLER(CMSG_CHAR_DELETE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharDeleteOpcode ); @@ -157,60 +157,60 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_CHAR_FACTION_CHANGE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharFactionOrRaceChange ); DEFINE_OPCODE_HANDLER(CMSG_CHAR_RACE_CHANGE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharFactionOrRaceChange ); DEFINE_OPCODE_HANDLER(CMSG_CHAR_RENAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharRenameOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_CHAT_FILTERED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CHAT_IGNORED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChatIgnoredOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_CHANNEL_WATCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CLEAR_RAID_MARKER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_CHAT_FILTERED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_CHAT_IGNORED, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleChatIgnoredOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_CLEAR_CHANNEL_WATCH, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_CLEAR_RAID_MARKER, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_CLEAR_TRADE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleClearTradeItemOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_ENTER_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_EXIT_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_GET_MAP_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_GET_PARTY_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_GET_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_INSTANCE_COMMAND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_SKIRMISH_QUEUE_COMMAND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_START_WARGAME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_COMPLAIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleComplainOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_ENABLE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_ENTER_INSTANCE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_EXIT_INSTANCE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_GET_MAP_INFO, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_GET_PARTY_INFO, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_GET_PLAYER_INFO, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_INSTANCE_COMMAND, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_SKIRMISH_QUEUE_COMMAND, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_START_WARGAME, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_COMPLAIN, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleComplainOpcode ); DEFINE_OPCODE_HANDLER(CMSG_COMPLETE_CINEMATIC, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCompleteCinematic ); - //DEFINE_OPCODE_HANDLER(CMSG_COMPLETE_MOVIE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_CONNECT_TO_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_COMPLETE_MOVIE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_CONNECT_TO_FAILED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_CONTACT_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleContactListOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_CORPSE_MAP_POSITION_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCorpseMapPositionQuery ); + DEFINE_OPCODE_HANDLER(CMSG_CORPSE_MAP_POSITION_QUERY, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleCorpseMapPositionQuery ); DEFINE_OPCODE_HANDLER(CMSG_CREATURE_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleCreatureQueryOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_DANCE_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_DELETEEQUIPMENT_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_DANCE_QUERY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_DELETEEQUIPMENT_SET, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_DEL_FRIEND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDelFriendOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_DEL_IGNORE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDelIgnoreOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_DEL_VOICE_IGNORE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_DEL_IGNORE, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleDelIgnoreOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_DEL_VOICE_IGNORE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_DESTROY_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDestroyItemOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_DISMISS_CONTROLLED_VEHICLE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDismissControlledVehicle ); - //DEFINE_OPCODE_HANDLER(CMSG_DISMISS_CRITTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDismissCritter ); + DEFINE_OPCODE_HANDLER(CMSG_DISMISS_CONTROLLED_VEHICLE, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleDismissControlledVehicle ); + DEFINE_OPCODE_HANDLER(CMSG_DISMISS_CRITTER, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleDismissCritter ); DEFINE_OPCODE_HANDLER(CMSG_DUEL_ACCEPTED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDuelAcceptedOpcode ); DEFINE_OPCODE_HANDLER(CMSG_DUEL_CANCELLED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDuelCancelledOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_DUNGEON_FINDER_GET_SYSTEM_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_EJECT_PASSENGER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_DUNGEON_FINDER_GET_SYSTEM_INFO, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_EJECT_PASSENGER, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEmoteOpcode ); DEFINE_OPCODE_HANDLER(CMSG_ENABLETAXI, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleTaxiQueryAvailableNodes ); DEFINE_OPCODE_HANDLER(CMSG_ENABLE_NAGLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); DEFINE_OPCODE_HANDLER(CMSG_EQUIPMENT_SET_SAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetSave ); DEFINE_OPCODE_HANDLER(CMSG_EQUIPMENT_SET_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEquipmentSetUse ); DEFINE_OPCODE_HANDLER(CMSG_FAR_SIGHT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleFarSightOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_FORCE_MOVE_ROOT_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveRootAck ); - //DEFINE_OPCODE_HANDLER(CMSG_FORCE_MOVE_UNROOT_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveUnRootAck ); + DEFINE_OPCODE_HANDLER(CMSG_FORCE_MOVE_ROOT_ACK, STATUS_UNHANDLED, PROCESS_THREADSAFE, &WorldSession::HandleMoveRootAck ); + DEFINE_OPCODE_HANDLER(CMSG_FORCE_MOVE_UNROOT_ACK, STATUS_UNHANDLED, PROCESS_THREADSAFE, &WorldSession::HandleMoveUnRootAck ); DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJECT_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleGameObjectQueryOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJ_REPORT_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGameobjectReportUse ); DEFINE_OPCODE_HANDLER(CMSG_GAMEOBJ_USE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGameObjectUseOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GET_MAIL_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGetMailList ); DEFINE_OPCODE_HANDLER(CMSG_GET_MIRRORIMAGE_DATA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMirrorImageDataRequest ); DEFINE_OPCODE_HANDLER(CMSG_GMRESPONSE_RESOLVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMResponseResolve ); - //DEFINE_OPCODE_HANDLER(CMSG_GMSURVEY_SUBMIT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMSurveySubmit ); - //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_CREATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketCreateOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_DELETETICKET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketDeleteOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GMSURVEY_SUBMIT, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleGMSurveySubmit ); + DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_CREATE, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketCreateOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_DELETETICKET, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketDeleteOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_GETTICKET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketGetTicketOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_SYSTEMSTATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketSystemStatusOpcode); - //DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_UPDATETEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketUpdateOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GM_REPORT_LAG, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReportLag ); + DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_SYSTEMSTATUS, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketSystemStatusOpcode); + DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_UPDATETEXT, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketUpdateOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GM_REPORT_LAG, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleReportLag ); DEFINE_OPCODE_HANDLER(CMSG_GOSSIP_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGossipHelloOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GOSSIP_SELECT_OPTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGossipSelectOptionOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GRANT_LEVEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGrantLevel ); @@ -219,61 +219,61 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_GROUP_DISBAND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupDisbandOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GROUP_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupInviteOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GROUP_INVITE_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupInviteResponseOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GROUP_RAID_CONVERT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupRaidConvertOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GROUP_REQUEST_JOIN_UPDATES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_GROUP_RAID_CONVERT, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupRaidConvertOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GROUP_REQUEST_JOIN_UPDATES, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GROUP_SET_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupSetLeaderOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GROUP_SET_ROLES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GROUP_SWAP_SUB_GROUP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupSwapSubGroupOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GROUP_SET_ROLES, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_GROUP_SWAP_SUB_GROUP, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupSwapSubGroupOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GROUP_UNINVITE_GUID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupUninviteGuidOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildAcceptOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_ACHIEVEMENT_MEMBERS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_ACHIEVEMENT_MEMBERS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_ACHIEVEMENT_PROGRESS_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildAchievementProgressQuery); DEFINE_OPCODE_HANDLER(CMSG_GUILD_ADD_RANK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildAddRankOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_ASSIGN_MEMBER_RANK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildAssignRankOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANKER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankerActivate ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_BUY_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankBuyTab ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_DEPOSIT_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankDepositMoney ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_LOG_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_LOG_QUERY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_QUERY_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankQueryTab ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_QUERY_TEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_REM_MONEY_WITHDRAW_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_SET_TAB_TEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_QUERY_TEXT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_REM_MONEY_WITHDRAW_QUERY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_SET_TAB_TEXT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_SWAP_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankSwapItems ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_UPDATE_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankUpdateTab ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_WITHDRAW_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankWithdrawMoney ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_CHANGE_NAME_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_WITHDRAW_MONEY, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankWithdrawMoney ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_CHANGE_NAME_REQUEST, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDeclineOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_DEL_RANK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDelRankOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_DEMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDemoteOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_DISBAND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDisbandOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_EVENT_LOG_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_DISBAND, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDisbandOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_EVENT_LOG_QUERY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_INFO_TEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildChangeInfoTextOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildInviteOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildLeaveOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_MEMBER_SEND_SOR_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_MEMBER_SEND_SOR_REQUEST, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_MOTD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildMOTDOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_NEWS_UPDATE_STICKY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_NEWS_UPDATE_STICKY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_PERMISSIONS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildPermissions ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_PROMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildPromoteOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_QUERY, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildQueryOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_QUERY_NEWS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_QUERY_NEWS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_QUERY_RANKS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildQueryRanksOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_REMOVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildRemoveOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_REPLACE_GUILD_MASTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_REQUEST_CHALLENGE_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_REQUEST_MAX_DAILY_XP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_REPLACE_GUILD_MASTER, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_REQUEST_CHALLENGE_UPDATE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_REQUEST_MAX_DAILY_XP, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_REQUEST_PARTY_STATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildRequestPartyState ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_ROSTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildRosterOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_SET_ACHIEVEMENT_TRACKING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_SET_GUILD_MASTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_SET_ACHIEVEMENT_TRACKING, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_SET_GUILD_MASTER, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_SET_NOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildSetNoteOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_SET_RANK_PERMISSIONS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildSetRankPermissionsOpcode); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_SWITCH_RANK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_HEARTH_AND_RESURRECT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleHearthAndResurrect ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_SWITCH_RANK, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_HEARTH_AND_RESURRECT, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleHearthAndResurrect ); DEFINE_OPCODE_HANDLER(CMSG_IGNORE_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleIgnoreTradeOpcode ); DEFINE_OPCODE_HANDLER(CMSG_INITIATE_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInitiateTradeOpcode ); DEFINE_OPCODE_HANDLER(CMSG_INSPECT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_INSTANCE_LOCK_WARNING_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_INSTANCE_LOCK_WARNING_RESPONSE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_ITEM_REFUND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemRefund ); DEFINE_OPCODE_HANDLER(CMSG_ITEM_REFUND_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemRefundInfoRequest ); DEFINE_OPCODE_HANDLER(CMSG_ITEM_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemTextQuery ); @@ -283,31 +283,31 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_LEARN_PREVIEW_TALENTS_PET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnPreviewTalentsPet ); DEFINE_OPCODE_HANDLER(CMSG_LEARN_TALENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLearnTalentOpcode ); DEFINE_OPCODE_HANDLER(CMSG_LEAVE_CHANNEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLeaveChannel ); - //DEFINE_OPCODE_HANDLER(CMSG_LFG_GET_STATUS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LFG_JOIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgJoinOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_LFG_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgLeaveOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_LFG_LFR_JOIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LFG_LFR_LEAVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LFG_PROPOSAL_RESULT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgProposalResultOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_BOOT_VOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetBootVoteOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_COMMENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_ROLES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetRolesOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_LFG_TELEPORT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgTeleportOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_ADD_RECRUIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_BROWSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_DECLINE_RECRUIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_GET_APPLICATIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_GET_RECRUITS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_POST_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_REMOVE_RECRUIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_SET_GUILD_POST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_LFG_GET_STATUS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_LFG_JOIN, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgJoinOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_LFG_LEAVE, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgLeaveOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_LFG_LFR_JOIN, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_LFG_LFR_LEAVE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_LFG_PROPOSAL_RESULT, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgProposalResultOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_BOOT_VOTE, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetBootVoteOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_COMMENT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_ROLES, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetRolesOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_LFG_TELEPORT, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgTeleportOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_ADD_RECRUIT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_BROWSE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_DECLINE_RECRUIT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_GET_APPLICATIONS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_GET_RECRUITS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_POST_REQUEST, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_REMOVE_RECRUIT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_SET_GUILD_POST, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_LIST_INVENTORY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleListInventoryOpcode ); DEFINE_OPCODE_HANDLER(CMSG_LOAD_SCREEN, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleLoadScreenOpcode ); DEFINE_OPCODE_HANDLER(CMSG_LOGOUT_CANCEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLogoutCancelOpcode ); DEFINE_OPCODE_HANDLER(CMSG_LOGOUT_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLogoutRequestOpcode ); DEFINE_OPCODE_HANDLER(CMSG_LOG_DISCONNECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); DEFINE_OPCODE_HANDLER(CMSG_LOOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_LOOT_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_LOOT_CURRENCY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_LOOT_MASTER_GIVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMasterGiveOpcode ); DEFINE_OPCODE_HANDLER(CMSG_LOOT_METHOD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMethodOpcode ); DEFINE_OPCODE_HANDLER(CMSG_LOOT_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMoneyOpcode ); @@ -338,44 +338,44 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_SAY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_WHISPER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); DEFINE_OPCODE_HANDLER(CMSG_MESSAGECHAT_YELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMessagechatOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MINIGAME_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_MINIGAME_MOVE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_MOUNTSPECIAL_ANIM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMountSpecialAnimOpcode ); DEFINE_OPCODE_HANDLER(CMSG_MOVE_CHNG_TRANSPORT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FALL_RESET, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FEATHER_FALL_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleFeatherFallAck ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_FLIGHT_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_PITCH_RATE_CHANGE_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_RUN_BACK_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_RUN_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_SWIM_BACK_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_SWIM_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_TURN_RATE_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_WALK_SPEED_CHANGE_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_GRAVITY_DISABLE_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_GRAVITY_ENABLE_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_HOVER_ACK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMoveHoverAck ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_KNOCK_BACK_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveKnockBackAck ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_NOT_ACTIVE_MOVER, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveNotActiveMover ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_CAN_FLY_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveSetCanFlyAckOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_COLLISION_HEIGHT_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_MOVE_FALL_RESET, STATUS_UNHANDLED, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); + DEFINE_OPCODE_HANDLER(CMSG_MOVE_FEATHER_FALL_ACK, STATUS_UNHANDLED, PROCESS_THREADSAFE, &WorldSession::HandleFeatherFallAck ); + DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_FLIGHT_BACK_SPEED_CHANGE_ACK, STATUS_UNHANDLED, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); + DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_FLIGHT_SPEED_CHANGE_ACK, STATUS_UNHANDLED, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); + DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_PITCH_RATE_CHANGE_ACK, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_RUN_BACK_SPEED_CHANGE_ACK, STATUS_UNHANDLED, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); + DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_RUN_SPEED_CHANGE_ACK, STATUS_UNHANDLED, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); + DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_SWIM_BACK_SPEED_CHANGE_ACK, STATUS_UNHANDLED, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); + DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_SWIM_SPEED_CHANGE_ACK, STATUS_UNHANDLED, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); + DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_TURN_RATE_CHANGE_ACK, STATUS_UNHANDLED, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); + DEFINE_OPCODE_HANDLER(CMSG_MOVE_FORCE_WALK_SPEED_CHANGE_ACK, STATUS_UNHANDLED, PROCESS_THREADSAFE, &WorldSession::HandleForceSpeedChangeAck ); + DEFINE_OPCODE_HANDLER(CMSG_MOVE_GRAVITY_DISABLE_ACK, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_MOVE_GRAVITY_ENABLE_ACK, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_MOVE_HOVER_ACK, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleMoveHoverAck ); + DEFINE_OPCODE_HANDLER(CMSG_MOVE_KNOCK_BACK_ACK, STATUS_UNHANDLED, PROCESS_THREADSAFE, &WorldSession::HandleMoveKnockBackAck ); + DEFINE_OPCODE_HANDLER(CMSG_MOVE_NOT_ACTIVE_MOVER, STATUS_UNHANDLED, PROCESS_THREADSAFE, &WorldSession::HandleMoveNotActiveMover ); + DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_CAN_FLY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_CAN_FLY_ACK, STATUS_UNHANDLED, PROCESS_THREADSAFE, &WorldSession::HandleMoveSetCanFlyAckOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY_ACK, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_COLLISION_HEIGHT_ACK, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_MOVE_SPLINE_DONE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveSplineDoneOpcode ); DEFINE_OPCODE_HANDLER(CMSG_MOVE_TIME_SKIPPED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleMoveTimeSkippedOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_MOVE_WATER_WALK_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveWaterWalkAck ); + DEFINE_OPCODE_HANDLER(CMSG_MOVE_WATER_WALK_ACK, STATUS_UNHANDLED, PROCESS_THREADSAFE, &WorldSession::HandleMoveWaterWalkAck ); DEFINE_OPCODE_HANDLER(CMSG_NAME_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNameQueryOpcode ); DEFINE_OPCODE_HANDLER(CMSG_NEXT_CINEMATIC_CAMERA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNextCinematicCamera ); DEFINE_OPCODE_HANDLER(CMSG_NPC_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleNpcTextQueryOpcode ); DEFINE_OPCODE_HANDLER(CMSG_OBJECT_UPDATE_FAILED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleObjectUpdateFailedOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_OBJECT_UPDATE_RESCUED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_OBJECT_UPDATE_RESCUED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_OFFER_PETITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleOfferPetitionOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_OPENING_CINEMATIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_OPENING_CINEMATIC, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_OPEN_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleOpenItemOpcode ); DEFINE_OPCODE_HANDLER(CMSG_OPT_OUT_OF_LOOT, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleOptOutOfLootOpcode ); DEFINE_OPCODE_HANDLER(CMSG_PAGE_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePageTextQueryOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_PARTY_SILENCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_PARTY_UNSILENCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_PARTY_SILENCE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_PARTY_UNSILENCE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_PETITION_BUY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionBuyOpcode ); DEFINE_OPCODE_HANDLER(CMSG_PETITION_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionQueryOpcode ); DEFINE_OPCODE_HANDLER(CMSG_PETITION_SHOWLIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionShowListOpcode ); @@ -395,16 +395,16 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_PLAYED_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayedTime ); DEFINE_OPCODE_HANDLER(CMSG_PLAYER_LOGIN, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandlePlayerLoginOpcode ); DEFINE_OPCODE_HANDLER(CMSG_PLAYER_VEHICLE_ENTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEnterPlayerVehicle ); - //DEFINE_OPCODE_HANDLER(CMSG_PLAY_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_PLAY_DANCE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_PUSHQUESTTOPARTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePushQuestToParty ); - //DEFINE_OPCODE_HANDLER(CMSG_PVP_LOG_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_QUERY_BATTLEFIELD_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_QUERY_COMPLETION_NPC_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_MEMBERS_FOR_RECIPE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_MEMBER_RECIPES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_RECIPES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_REWARDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_XP, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildQueryXPOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_PVP_LOG_DATA, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_QUERY_BATTLEFIELD_STATE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_QUERY_COMPLETION_NPC_RESPONSE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_MEMBERS_FOR_RECIPE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_MEMBER_RECIPES, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_RECIPES, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_REWARDS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_XP, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildQueryXPOpcode ); // STATUS_AUTHED DEFINE_OPCODE_HANDLER(CMSG_QUERY_INSPECT_ACHIEVEMENTS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryInspectAchievements ); DEFINE_OPCODE_HANDLER(CMSG_QUERY_QUESTS_COMPLETED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryQuestsCompleted ); DEFINE_OPCODE_HANDLER(CMSG_QUERY_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryTimeOpcode ); @@ -425,68 +425,67 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_READ_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReadItem ); DEFINE_OPCODE_HANDLER(CMSG_REALM_SPLIT, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRealmSplitOpcode ); DEFINE_OPCODE_HANDLER(CMSG_RECLAIM_CORPSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReclaimCorpseOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_REDIRECTION_AUTH_PROOF, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_REDIRECTION_AUTH_PROOF, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_REFORGE_ITEM, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleReforgeItemOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_REORDER_CHARACTERS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_REORDER_CHARACTERS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_REPAIR_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepairItemOpcode ); DEFINE_OPCODE_HANDLER(CMSG_REPOP_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepopRequestOpcode ); DEFINE_OPCODE_HANDLER(CMSG_REPORT_PVP_AFK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReportPvPAFK ); DEFINE_OPCODE_HANDLER(CMSG_REQUEST_ACCOUNT_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestAccountData ); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_CATEGORY_COOLDOWNS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_CEMETERY_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_GUILD_PARTY_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_HONOR_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_REQUEST_CATEGORY_COOLDOWNS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_REQUEST_CEMETERY_LIST, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_REQUEST_HONOR_STATS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_REQUEST_HOTFIX, STATUS_AUTHED, PROCESS_INPLACE, &WorldSession::HandleRequestHotfix ); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_INSPECT_RATED_BG_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PARTY_MEMBER_STATS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestPartyMemberStatsOpcode); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PET_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestPetInfoOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PVP_OPTIONS_ENABLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PVP_REWARDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_REQUEST_INSPECT_RATED_BG_STATS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PARTY_MEMBER_STATS, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestPartyMemberStatsOpcode); + DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PET_INFO, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestPetInfoOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PVP_OPTIONS_ENABLED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PVP_REWARDS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RAID_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestRaidInfoOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RATED_BG_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RATED_BG_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RESEARCH_HISTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RATED_BG_INFO, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RATED_BG_STATS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RESEARCH_HISTORY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_EXIT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestVehicleExit ); DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_NEXT_SEAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_PREV_SEAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); - //DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_SWITCH_SEAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); - DEFINE_OPCODE_HANDLER(CMSG_RESET_FACTION_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_SWITCH_SEAT, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); + DEFINE_OPCODE_HANDLER(CMSG_RESET_FACTION_CHEAT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_RESET_INSTANCES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleResetInstancesOpcode ); DEFINE_OPCODE_HANDLER(CMSG_RESURRECT_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleResurrectResponseOpcode ); DEFINE_OPCODE_HANDLER(CMSG_RETURN_TO_GRAVEYARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReturnToGraveyard ); - //DEFINE_OPCODE_HANDLER(CMSG_ROLE_POLL_BEGIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SAVE_CUF_PROFILES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_ROLE_POLL_BEGIN, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_SAVE_CUF_PROFILES, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_SELF_RES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSelfResOpcode ); DEFINE_OPCODE_HANDLER(CMSG_SELL_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSellItemOpcode ); DEFINE_OPCODE_HANDLER(CMSG_SEND_MAIL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSendMail ); - //DEFINE_OPCODE_HANDLER(CMSG_SEND_SOR_REQUEST_VIA_ADDRESS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SEND_SOR_REQUEST_VIA_BNET_ACCOUNT_ID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_SEND_SOR_REQUEST_VIA_ADDRESS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_SEND_SOR_REQUEST_VIA_BNET_ACCOUNT_ID, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_SETSHEATHED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleSetSheathedOpcode ); DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIONBAR_TOGGLES, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActionBarToggles ); DEFINE_OPCODE_HANDLER(CMSG_SET_ACTION_BUTTON, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActionButtonOpcode ); DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIVE_MOVER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActiveMoverOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIVE_VOICE_CHANNEL, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActiveVoiceChannel ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_ALLOW_LOW_LEVEL_RAID1, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_ALLOW_LOW_LEVEL_RAID2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_SET_ACTIVE_VOICE_CHANNEL, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActiveVoiceChannel ); // STATUS_AUTHED + DEFINE_OPCODE_HANDLER(CMSG_SET_ALLOW_LOW_LEVEL_RAID1, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_SET_ALLOW_LOW_LEVEL_RAID2, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_SET_CHANNEL_WATCH, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetChannelWatch ); DEFINE_OPCODE_HANDLER(CMSG_SET_CONTACT_NOTES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetContactNotesOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_CURRENCY_FLAGS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_EVERYONE_IS_ASSISTANT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_SET_CURRENCY_FLAGS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_SET_EVERYONE_IS_ASSISTANT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_SET_FACTION_ATWAR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetFactionAtWar ); DEFINE_OPCODE_HANDLER(CMSG_SET_FACTION_INACTIVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetFactionInactiveOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_PET_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_SET_PET_SLOT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_SET_PLAYER_DECLINED_NAMES, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetPlayerDeclinedNames ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_PREFERED_CEMETERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_PRIMARY_TALENT_TREE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_RELATIVE_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_SAVED_INSTANCE_EXTEND, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_SET_PREFERED_CEMETERY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_SET_PRIMARY_TALENT_TREE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_SET_RELATIVE_POSITION, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_SET_SAVED_INSTANCE_EXTEND, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_SET_SELECTION, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleSetSelectionOpcode ); DEFINE_OPCODE_HANDLER(CMSG_SET_TAXI_BENCHMARK_MODE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTaxiBenchmarkOpcode ); DEFINE_OPCODE_HANDLER(CMSG_SET_TITLE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTitleOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_TRADE_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_SET_TRADE_CURRENCY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_SET_TRADE_GOLD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTradeGoldOpcode ); DEFINE_OPCODE_HANDLER(CMSG_SET_TRADE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTradeItemOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_VEHICLE_REC_ID_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_SET_VEHICLE_REC_ID_ACK, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_SET_WATCHED_FACTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetWatchedFactionOpcode ); DEFINE_OPCODE_HANDLER(CMSG_SHOWING_CLOAK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleShowingCloakOpcode ); DEFINE_OPCODE_HANDLER(CMSG_SHOWING_HELM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleShowingHelmOpcode ); @@ -495,24 +494,24 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_SPIRIT_HEALER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSpiritHealerActivateOpcode); DEFINE_OPCODE_HANDLER(CMSG_SPLIT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSplitItemOpcode ); DEFINE_OPCODE_HANDLER(CMSG_STANDSTATECHANGE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleStandStateChangeOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_STOP_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SUBMIT_BUG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SUBMIT_COMPLAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SUGGESTION_SUBMIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_STOP_DANCE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_SUBMIT_BUG, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_SUBMIT_COMPLAIN, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_SUGGESTION_SUBMIT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_SUMMON_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSummonResponseOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_SUSPEND_TOKEN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_SUSPEND_TOKEN, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_SWAP_INV_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSwapInvItemOpcode ); DEFINE_OPCODE_HANDLER(CMSG_SWAP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSwapItem ); - //DEFINE_OPCODE_HANDLER(CMSG_SYNC_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_SYNC_DANCE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_TAXINODE_STATUS_QUERY, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleTaxiNodeStatusQueryOpcode ); DEFINE_OPCODE_HANDLER(CMSG_TAXIQUERYAVAILABLENODES, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleTaxiQueryAvailableNodes ); - //DEFINE_OPCODE_HANDLER(CMSG_TELEPORT_TO_UNIT, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_TELEPORT_TO_UNIT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_TEXT_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTextEmoteOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_TIME_ADJUSTMENT_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_TIME_ADJUSTMENT_RESPONSE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_TIME_SYNC_RESP, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleTimeSyncResp ); - //DEFINE_OPCODE_HANDLER(CMSG_TIME_SYNC_RESP_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_TIME_SYNC_RESP_FAILED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_TOGGLE_PVP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTogglePvP ); - //DEFINE_OPCODE_HANDLER(CMSG_TOTEM_DESTROYED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTotemDestroyed ); + DEFINE_OPCODE_HANDLER(CMSG_TOTEM_DESTROYED, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleTotemDestroyed ); DEFINE_OPCODE_HANDLER(CMSG_TRAINER_BUY_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerBuySpellOpcode ); DEFINE_OPCODE_HANDLER(CMSG_TRAINER_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerListOpcode ); DEFINE_OPCODE_HANDLER(CMSG_TRANSMOGRIFY_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTransmogrifyItems ); @@ -522,12 +521,12 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_TUTORIAL_RESET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTutorialReset ); DEFINE_OPCODE_HANDLER(CMSG_UNACCEPT_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnacceptTradeOpcode ); DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_SKILL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnlearnSkillOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_SPECIALIZATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_SPECIALIZATION, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_UNREGISTER_ALL_ADDON_PREFIXES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnregisterAddonPrefixesOpcode); DEFINE_OPCODE_HANDLER(CMSG_UPDATE_ACCOUNT_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateAccountData ); - //DEFINE_OPCODE_HANDLER(CMSG_UPDATE_MISSILE_TRAJECTORY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateMissileTrajectory ); - //DEFINE_OPCODE_HANDLER(CMSG_UPDATE_PROJECTILE_POSITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateProjectilePosition ); - //DEFINE_OPCODE_HANDLER(CMSG_USED_FOLLOW, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_UPDATE_MISSILE_TRAJECTORY, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateMissileTrajectory ); + DEFINE_OPCODE_HANDLER(CMSG_UPDATE_PROJECTILE_POSITION, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateProjectilePosition ); + DEFINE_OPCODE_HANDLER(CMSG_USED_FOLLOW, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_USE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUseItemOpcode ); DEFINE_OPCODE_HANDLER(CMSG_VIOLENCE_LEVEL, STATUS_AUTHED, PROCESS_INPLACE, &WorldSession::HandleViolenceLevel ); DEFINE_OPCODE_HANDLER(CMSG_VOICE_SESSION_ENABLE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleVoiceSessionEnableOpcode ); @@ -535,30 +534,30 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_VOID_STORAGE_TRANSFER, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleVoidStorageTransfer ); DEFINE_OPCODE_HANDLER(CMSG_VOID_STORAGE_UNLOCK, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleVoidStorageUnlock ); DEFINE_OPCODE_HANDLER(CMSG_VOID_SWAP_ITEM, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleVoidSwapItem ); - //DEFINE_OPCODE_HANDLER(CMSG_WARDEN_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleWardenDataOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_WARGAME_ACCEPT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_WARGAME_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_WARDEN_DATA, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleWardenDataOpcode ); // STATUS_AUTHED + DEFINE_OPCODE_HANDLER(CMSG_WARGAME_ACCEPT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_WARGAME_START, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_WHO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWhoOpcode ); DEFINE_OPCODE_HANDLER(CMSG_WHOIS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWhoisOpcode ); DEFINE_OPCODE_HANDLER(CMSG_WORLD_STATE_UI_TIMER_UPDATE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleWorldStateUITimerUpdate ); - //DEFINE_OPCODE_HANDLER(CMSG_WORLD_TELEPORT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWorldTeleportOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_WRAP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWrapItemOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_WORLD_TELEPORT, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleWorldTeleportOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_WRAP_ITEM, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleWrapItemOpcode ); DEFINE_OPCODE_HANDLER(CMSG_ZONEUPDATE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleZoneUpdateOpcode ); DEFINE_OPCODE_HANDLER(MSG_AUCTION_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionHelloOpcode ); - DEFINE_OPCODE_HANDLER(MSG_CHANNEL_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(MSG_CHANNEL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(MSG_CHANNEL_START, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(MSG_CHANNEL_UPDATE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_CORPSE_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCorpseQueryOpcode ); DEFINE_OPCODE_HANDLER(MSG_INSPECT_ARENA_TEAMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectArenaTeamsOpcode ); - //DEFINE_OPCODE_HANDLER(MSG_LIST_STABLED_PETS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleListStabledPetsOpcode ); + DEFINE_OPCODE_HANDLER(MSG_LIST_STABLED_PETS, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleListStabledPetsOpcode ); DEFINE_OPCODE_HANDLER(MSG_MINIMAP_PING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMinimapPingOpcode ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_CHARM_TELEPORT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_CHARM_TELEPORT_CHEAT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_MOVE_FALL_LAND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); DEFINE_OPCODE_HANDLER(MSG_MOVE_HEARTBEAT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); DEFINE_OPCODE_HANDLER(MSG_MOVE_JUMP, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_FACING, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_PITCH, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_WALK_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_RUN_MODE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_SET_WALK_MODE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_MOVE_START_ASCEND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); DEFINE_OPCODE_HANDLER(MSG_MOVE_START_BACKWARD, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); DEFINE_OPCODE_HANDLER(MSG_MOVE_START_DESCEND, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); @@ -576,23 +575,23 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_STRAFE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_SWIM, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_TURN, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_TELEPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_TELEPORT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_MOVE_TELEPORT_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveTeleportAck ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_TELEPORT_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_TIME_SKIPPED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_TOGGLE_COLLISION_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_TELEPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_TELEPORT_CHEAT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_TIME_SKIPPED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_TOGGLE_COLLISION_CHEAT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_FLIGHT_SPEED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_RUN_SPEED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_TELEPORT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_MOVE_WORLDPORT_ACK, STATUS_TRANSFER, PROCESS_THREADUNSAFE, &WorldSession::HandleMoveWorldportAckOpcode ); - //DEFINE_OPCODE_HANDLER(MSG_NOTIFY_PARTY_SQUELCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_PARTY_ASSIGNMENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePartyAssignmentOpcode ); + DEFINE_OPCODE_HANDLER(MSG_NOTIFY_PARTY_SQUELCH, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(MSG_PARTY_ASSIGNMENT, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandlePartyAssignmentOpcode ); DEFINE_OPCODE_HANDLER(MSG_PETITION_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionDeclineOpcode ); DEFINE_OPCODE_HANDLER(MSG_PETITION_RENAME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePetitionRenameOpcode ); DEFINE_OPCODE_HANDLER(MSG_QUERY_NEXT_MAIL_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryNextMailTime ); DEFINE_OPCODE_HANDLER(MSG_QUEST_PUSH_RESULT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestPushResult ); DEFINE_OPCODE_HANDLER(MSG_RAID_READY_CHECK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidReadyCheckOpcode ); - //DEFINE_OPCODE_HANDLER(MSG_RAID_READY_CHECK_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(MSG_RAID_READY_CHECK_CONFIRM, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_RAID_READY_CHECK_FINISHED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidReadyCheckFinishedOpcode); DEFINE_OPCODE_HANDLER(MSG_RAID_TARGET_UPDATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidTargetUpdateOpcode ); DEFINE_OPCODE_HANDLER(MSG_RANDOM_ROLL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRandomRollOpcode ); @@ -603,8 +602,8 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(MSG_TALENT_WIPE_CONFIRM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTalentWipeConfirmOpcode ); DEFINE_OPCODE_HANDLER(MSG_VERIFY_CONNECTIVITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_EarlyProccess ); DEFINE_OPCODE_HANDLER(SMSG_ACCOUNT_DATA_TIMES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ACCOUNT_INFO_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ACCOUNT_RESTRICTED_WARNING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ACCOUNT_INFO_RESPONSE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ACCOUNT_RESTRICTED_WARNING, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ACHIEVEMENT_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ACHIEVEMENT_EARNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ACTION_BUTTONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -615,10 +614,10 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_ALL_ACHIEVEMENT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_AREA_SPIRIT_HEALER_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_AREA_TRIGGER_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_AREA_TRIGGER_MOVEMENT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_AREA_TRIGGER_MOVEMENT_UPDATE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ARENA_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ARENA_OPPONENT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_CHANGE_FAILED_QUEUED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_CHANGE_FAILED_QUEUED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -632,148 +631,147 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_ATTACKSWING_CANT_ATTACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ATTACKSWING_DEADTARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ATTACKSWING_NOTINRANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_BIDDER_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_BIDDER_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_LIST_PENDING_SALES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_OWNER_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_OWNER_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_AUCTION_REMOVED_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_AURA_POINTS_DEPLETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_AUCTION_BIDDER_LIST_RESULT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_AUCTION_BIDDER_NOTIFICATION, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_AUCTION_COMMAND_RESULT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_AUCTION_LIST_PENDING_SALES, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_AUCTION_LIST_RESULT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_AUCTION_OWNER_LIST_RESULT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_AUCTION_OWNER_NOTIFICATION, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_AUCTION_REMOVED_NOTIFICATION, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_AURA_POINTS_DEPLETED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_AURA_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_AURA_UPDATE_ALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_AUTH_CHALLENGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_AUTH_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_AVAILABLE_VOICE_CHANNEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_AVERAGE_ITEM_LEVEL_INFORM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_AVAILABLE_VOICE_CHANNEL, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_AVERAGE_ITEM_LEVEL_INFORM, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_BARBER_SHOP_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_EJECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_EJECT_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_ENTERED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_ENTRY_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_EXIT_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_QUEUE_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_STATE_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_PLAYER_POSITIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_PORT_DENIED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_RATED_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_LIST, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_EJECTED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_EJECT_PENDING, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_ENTERED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_ENTRY_INVITE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_EXIT_REQUEST, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_QUEUE_INVITE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_STATE_CHANGE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_PLAYER_POSITIONS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_PORT_DENIED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_RATED_INFO, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS3, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS4, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_INFO_THROTTLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_PLAYER_JOINED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_PLAYER_LEFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS2, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS3, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS4, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS_FAILED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_INFO_THROTTLED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_PLAYER_JOINED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_PLAYER_LEFT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_BINDER_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_BINDPOINTUPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_BREAK_TARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_BUY_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_BUY_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_ARENA_TEAM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_CLEAR_PENDING_ACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_NOTES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_NOTES_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_REMOVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_REMOVED_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_STATUS_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_MODERATOR_STATUS_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_REMOVED_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_UPDATED_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_FILTER_GUILD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_RAID_LOCKOUT_ADDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_RAID_LOCKOUT_REMOVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_RAID_LOCKOUT_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_SEND_CALENDAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_SEND_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_ARENA_TEAM, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_CLEAR_PENDING_ACTION, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_COMMAND_RESULT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_ALERT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_NOTES, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_NOTES_ALERT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_REMOVED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_REMOVED_ALERT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_STATUS_ALERT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_MODERATOR_STATUS_ALERT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_REMOVED_ALERT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_STATUS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_UPDATED_ALERT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_FILTER_GUILD, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_RAID_LOCKOUT_ADDED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_RAID_LOCKOUT_REMOVED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_RAID_LOCKOUT_UPDATED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_SEND_CALENDAR, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_SEND_EVENT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_SEND_NUM_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CAMERA_SHAKE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CAMERA_SHAKE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CANCEL_AUTO_REPEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CANCEL_COMBAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CAST_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CHANNEL_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CHANNEL_MEMBER_COUNT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CHANNEL_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHARACTER_LOGIN_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CHARACTER_LOGIN_FAILED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CHAR_CREATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CHAR_CUSTOMIZE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CHAR_DELETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CHAR_ENUM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CHAR_FACTION_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CHAR_RENAME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHAT_IGNORED_ACCOUNT_MUTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHAT_NOT_IN_PARTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHAT_PLAYER_AMBIGUOUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CHAT_IGNORED_ACCOUNT_MUTED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CHAT_NOT_IN_PARTY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CHAT_PLAYER_AMBIGUOUS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CHAT_PLAYER_NOT_FOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CHAT_RESTRICTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHAT_SERVER_DISCONNECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CHAT_SERVER_RECONNECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CHAT_SERVER_DISCONNECTED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CHAT_SERVER_RECONNECTED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CHAT_WRONG_FACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_BOSS_EMOTES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_COOLDOWNS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_FAR_SIGHT_IMMEDIATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CLEAR_BOSS_EMOTES, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CLEAR_COOLDOWNS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CLEAR_FAR_SIGHT_IMMEDIATE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CLEAR_TARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CLIENTCACHE_VERSION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CLIENT_CONTROL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_COMBAT_EVENT_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_MAP_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_PARTY_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_SKIRMISH_QUEUE_RESULT1, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_SKIRMISH_QUEUE_RESULT2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_STATE_CHANGED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_MAP_INFO, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_PARTY_INFO, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_PLAYER_INFO, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_SKIRMISH_QUEUE_RESULT1, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_SKIRMISH_QUEUE_RESULT2, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_STATE_CHANGED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_COMPLAIN_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMPLETION_NPC_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_MOVES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMSAT_CONNECT_FAIL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMSAT_DISCONNECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COMSAT_RECONNECT_TRY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_COMPRESSED_MOVES, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_COMSAT_CONNECT_FAIL, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_COMSAT_DISCONNECT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_COMSAT_RECONNECT_TRY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CONTACT_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CONVERT_RUNE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_COOLDOWN_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_COOLDOWN_CHEAT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_COOLDOWN_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CORPSE_MAP_POSITION_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CORPSE_NOT_IN_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CORPSE_MAP_POSITION_QUERY_RESPONSE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CORPSE_NOT_IN_INSTANCE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CORPSE_RECLAIM_DELAY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CREATURE_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CRITERIA_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CRITERIA_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CROSSED_INEBRIATION_THRESHOLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CURRENCY_LOOT_REMOVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CURRENCY_LOOT_RESTORED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CUSTOM_LOAD_SCREEN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DAMAGE_CALC_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DANCE_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CURRENCY_LOOT_REMOVED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CURRENCY_LOOT_RESTORED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CUSTOM_LOAD_SCREEN, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_DAMAGE_CALC_LOG, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_DANCE_QUERY_RESPONSE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_DB_REPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_DEATH_RELEASE_LOC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DEBUG_RUNE_REGEN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DEFENSE_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_DEBUG_RUNE_REGEN, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_DEFENSE_MESSAGE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_DESTROY_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DESTRUCTIBLE_BUILDING_DAMAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DIFFERENT_INSTANCE_FROM_PARTY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DISENCHANT_CREDIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_DESTRUCTIBLE_BUILDING_DAMAGE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_DIFFERENT_INSTANCE_FROM_PARTY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_DISENCHANT_CREDIT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_DISMOUNT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_DISMOUNTRESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_DISPEL_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DISPLAY_GAME_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DONT_AUTO_PUSH_SPELLS_TO_ACTION_BAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DROP_NEW_CONNECTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_DISPLAY_GAME_ERROR, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_DONT_AUTO_PUSH_SPELLS_TO_ACTION_BAR, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_DROP_NEW_CONNECTION, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_DUEL_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_DUEL_COUNTDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_DUEL_INBOUNDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_DUEL_OUTOFBOUNDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_DUEL_REQUESTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_DUEL_WINNER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_DUMP_RIDE_TICKETS_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_DUMP_RIDE_TICKETS_RESPONSE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_DURABILITY_DAMAGE_DEATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ECHO_PARTY_SQUELCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ECHO_PARTY_SQUELCH, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_EMOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ENABLE_BARBER_SHOP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ENCHANTMENTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -781,159 +779,159 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_EQUIPMENT_SET_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_EQUIPMENT_SET_SAVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_EQUIPMENT_SET_USE_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_EXPECTED_SPAM_RECORDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_EXPECTED_SPAM_RECORDS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_EXPLORATION_EXPERIENCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_FAILED_PLAYER_CONDITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_FAILED_PLAYER_CONDITION, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_FEATURE_SYSTEM_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_FEIGN_DEATH_RESISTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_FEIGN_DEATH_RESISTED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_FISH_ESCAPED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_FISH_NOT_HOOKED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_FLIGHT_SPLINE_SYNC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_FLOOD_DETECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_FORCED_DEATH_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_FORCE_SEND_QUEUED_PACKETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_FORCE_SET_VEHICLE_REC_ID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_FORGE_MASTER_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_FLIGHT_SPLINE_SYNC, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_FLOOD_DETECTED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_FORCED_DEATH_UPDATE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_FORCE_SEND_QUEUED_PACKETS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_FORCE_SET_VEHICLE_REC_ID, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_FORGE_MASTER_SET, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_FRIEND_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_CUSTOM_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_DESPAWN_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_PAGETEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GAMEOBJECT_RESET_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GAMESPEED_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GAMETIME_SET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GAMETIME_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GAME_EVENT_DEBUG_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GAME_OBJECT_ACTIVATE_ANIM_KIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GMRESPONSE_DB_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GMRESPONSE_RECEIVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GMRESPONSE_STATUS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_CREATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_DELETETICKET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GAMESPEED_SET, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GAMETIME_SET, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GAMETIME_UPDATE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GAME_EVENT_DEBUG_LOG, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GAME_OBJECT_ACTIVATE_ANIM_KIT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GMRESPONSE_DB_ERROR, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GMRESPONSE_RECEIVED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GMRESPONSE_STATUS_UPDATE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_CREATE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_DELETETICKET, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_GETTICKET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_SYSTEMSTATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_UPDATETEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GM_MESSAGECHAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GM_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GM_TICKET_STATUS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_SYSTEMSTATUS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GMTICKET_UPDATETEXT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GM_MESSAGECHAT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GM_PLAYER_INFO, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GM_TICKET_STATUS_UPDATE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GODMODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GOSSIP_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GOSSIP_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GOSSIP_POI, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GROUPACTION_THROTTLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GROUP_CANCEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GROUPACTION_THROTTLED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GROUP_CANCEL, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GROUP_DECLINE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GROUP_DESTROYED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GROUP_DESTROYED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GROUP_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GROUP_JOINED_BATTLEGROUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GROUP_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GROUP_JOINED_BATTLEGROUND, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GROUP_LIST, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GROUP_SET_LEADER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GROUP_SET_ROLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GROUP_UNINVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GROUP_SET_ROLE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GROUP_UNINVITE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_ACHIEVEMENT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_ACHIEVEMENT_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_ACHIEVEMENT_EARNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_ACHIEVEMENT_MEMBERS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_LOG_QUERY_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_QUERY_TEXT_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_REM_MONEY_WITHDRAW_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_CHALLENGE_COMPLETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_CHALLENGE_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_CHANGE_NAME_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_ACHIEVEMENT_MEMBERS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_LIST, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_LOG_QUERY_RESULTS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_QUERY_TEXT_RESULTS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_REM_MONEY_WITHDRAW_QUERY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_CHALLENGE_COMPLETED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_CHALLENGE_UPDATED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_CHANGE_NAME_RESULT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_COMMAND_RESULT_2, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_CRITERIA_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_CRITERIA_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_DECLINE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_EVENT_LOG_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_FLAGGED_FOR_RENAME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_EVENT_LOG_QUERY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_FLAGGED_FOR_RENAME, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_INVITE_CANCEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_MAX_DAILY_XP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_MEMBERS_FOR_RECIPE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_MEMBER_DAILY_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_MEMBER_RECIPES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_MEMBER_UPDATE_NOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_MOVE_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_MOVE_STARTING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_NEWS_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_NEWS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_INVITE_CANCEL, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_MAX_DAILY_XP, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_MEMBERS_FOR_RECIPE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_MEMBER_DAILY_RESET, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_MEMBER_RECIPES, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_MEMBER_UPDATE_NOTE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_MOVE_COMPLETE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_MOVE_STARTING, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_NEWS_DELETED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_NEWS_UPDATE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_PARTY_STATE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_PERMISSIONS_QUERY_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_RANK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_RANKS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_RECIPES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_RENAMED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_REPUTATION_REACTION_CHANGED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_REPUTATION_WEEKLY_CAP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_REWARDS_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_RECIPES, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_RENAMED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_REPUTATION_REACTION_CHANGED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_REPUTATION_WEEKLY_CAP, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_RESET, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_REWARDS_LIST, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_ROSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_UPDATE_ROSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_XP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_XP_GAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_HEALTH_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_UPDATE_ROSTER, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_XP, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_XP_GAIN, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_HEALTH_UPDATE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_HIGHEST_THREAT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_HOTFIX_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_HOTFIX_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_HOTFIX_NOTIFY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_INITIALIZE_FACTIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_INITIAL_SPELLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_INIT_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_INIT_WORLD_STATES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_INSPECT_HONOR_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_INSPECT_RATED_BG_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_INSPECT_RESULTS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_INSPECT_TALENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_LOCK_WARNING_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_INSPECT_HONOR_STATS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_INSPECT_RATED_BG_STATS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_INSPECT_RESULTS_UPDATE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_INSPECT_TALENT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_LOCK_WARNING_QUERY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_RESET_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_SAVE_CREATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_INVALIDATE_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_INVALIDATE_PLAYER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_INVALID_PROMOTION_CODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_INVALIDATE_DANCE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_INVALIDATE_PLAYER, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_INVALID_PROMOTION_CODE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_INVENTORY_CHANGE_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ITEM_ADD_PASSIVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ITEM_ADD_PASSIVE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ITEM_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ITEM_ENCHANT_TIME_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ITEM_EXPIRE_PURCHASE_REFUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ITEM_EXPIRE_PURCHASE_REFUND, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ITEM_PUSH_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ITEM_REFUND_INFO_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ITEM_REFUND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ITEM_REMOVE_PASSIVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ITEM_SEND_PASSIVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ITEM_REMOVE_PASSIVE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ITEM_SEND_PASSIVE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ITEM_TEXT_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ITEM_TIME_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ITEM_TIME_UPDATE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LEARNED_DANCE_MOVES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LEARNED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LEVELUP_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_BOOT_PROPOSAL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_DISABLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_JOIN_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_OFFER_CONTINUE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_PARTY_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_PLAYER_REWARD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_PROPOSAL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_QUEUE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_ROLE_CHECK_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_ROLE_CHOSEN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_SLOT_INVALID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_TELEPORT_DENIED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LFG_BOOT_PROPOSAL_UPDATE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LFG_DISABLED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LFG_JOIN_RESULT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LFG_OFFER_CONTINUE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LFG_PARTY_INFO, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LFG_PLAYER_INFO, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LFG_PLAYER_REWARD, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LFG_PROPOSAL_UPDATE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LFG_QUEUE_STATUS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LFG_ROLE_CHECK_UPDATE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LFG_ROLE_CHOSEN, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LFG_SLOT_INVALID, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LFG_TELEPORT_DENIED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_SEARCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_STATUS_NONE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_APPLICANT_LIST_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_APPLICATIONS_LIST_CHANGED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_BROWSE_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_MEMBERSHIP_LIST_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_POST_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_RECRUIT_LIST_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_STATUS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_STATUS_NONE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_APPLICANT_LIST_UPDATED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_APPLICATIONS_LIST_CHANGED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_BROWSE_UPDATED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_COMMAND_RESULT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_MEMBERSHIP_LIST_UPDATED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_POST_UPDATED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_RECRUIT_LIST_UPDATED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LIST_INVENTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LOAD_CUF_PROFILES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOAD_CUF_PROFILES, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LOGIN_SETTIMESPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LOGIN_VERIFY_WORLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LOGOUT_CANCEL_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -942,8 +940,8 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_LOG_XPGAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LOOT_ALL_PASSED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LOOT_CLEAR_MONEY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LOOT_CONTENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_LOOT_ITEM_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOOT_CONTENTS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOOT_ITEM_NOTIFY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LOOT_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LOOT_MASTER_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LOOT_MONEY_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -955,39 +953,39 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_LOOT_SLOT_CHANGED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LOOT_START_ROLL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MAIL_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MAP_OBJ_EVENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_IN_PROGRESS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MAP_OBJ_EVENTS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_COMPLETE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MEETINGSTONE_IN_PROGRESS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MESSAGECHAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MESSAGE_BOX, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MINIGAME_SETUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MINIGAME_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MESSAGE_BOX, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MINIGAME_SETUP, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MINIGAME_STATE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MIRRORIMAGE_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MISSILE_CANCEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MISSILE_CANCEL, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MODIFY_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MONEY_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MONEY_NOTIFY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MONSTER_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MONSTER_MOVE_TRANSPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOTD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOUNTRESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOUNTRESULT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOUNTSPECIAL_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_COLLISION_DISABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_COLLISION_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_COLLISION_DISABLE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_COLLISION_ENABLE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_FEATHER_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_GRAVITY_DISABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_GRAVITY_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_GRAVITY_DISABLE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_GRAVITY_ENABLE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_KNOCK_BACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_LAND_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_NORMAL_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_ACTIVE_MOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_ACTIVE_MOVER, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_COLLISION_HEIGHT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_COMPOUND_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_COMPOUND_STATE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_HOVER, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_RUN_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -997,66 +995,66 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_COLLISION_HEIGHT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_KNOCK_BACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_RUN_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_SWIM_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_SWIM_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_HOVER, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_COLLISION_HEIGHT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_FLIGHT_BACK_SPEED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_KNOCK_BACK, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_PITCH_RATE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_RUN_BACK_SPEED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_SWIM_BACK_SPEED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_SWIM_SPEED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_TURN_RATE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_WALK_SPEED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_MULTIPLE_PACKETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MULTIPLE_PACKETS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_NEW_TAXI_PATH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_NEW_WORLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_NEW_WORLD_ABORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_NEW_WORLD_ABORT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_NOTIFY_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_NOTIFY_DEST_LOC_SPELL_CAST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_NOTIFY_DANCE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_NOTIFY_DEST_LOC_SPELL_CAST, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_NPC_TEXT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_OFFER_PETITION_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_OPEN_CONTAINER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_OPEN_LFG_DUNGEON_FINDER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_OVERRIDE_LIGHT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_OFFER_PETITION_ERROR, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_OPEN_CONTAINER, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_OPEN_LFG_DUNGEON_FINDER, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_OVERRIDE_LIGHT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PAGE_TEXT_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PARTYKILLLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PARTY_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PARTY_MEMBER_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PARTY_MEMBER_STATS_FULL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PAUSE_MIRROR_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PARTY_MEMBER_STATS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PARTY_MEMBER_STATS_FULL, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PAUSE_MIRROR_TIMER, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PERIODICAURALOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PETGODMODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PETITION_ALREADY_SIGNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PETITION_ALREADY_SIGNED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PETITION_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PETITION_SHOWLIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PETITION_SHOW_SIGNATURES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PETITION_SIGN_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_ACTION_FEEDBACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_ACTION_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_ADDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_BROKEN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_CAST_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_DISMISS_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_GUIDS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PET_ACTION_FEEDBACK, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PET_ACTION_SOUND, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PET_ADDED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PET_BROKEN, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PET_CAST_FAILED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PET_DISMISS_SOUND, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PET_GUIDS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PET_LEARNED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_NAME_INVALID, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PET_MODE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PET_NAME_INVALID, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PET_NAME_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PET_REMOVED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_RENAMEABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_SLOT_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PET_RENAMEABLE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PET_SLOT_UPDATED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PET_SPELLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PET_TAME_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PET_TAME_FAILURE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PET_UPDATE_COMBO_POINTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAYED_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PLAYERBINDERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PLAYERBINDERROR, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAYERBOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PLAYER_DIFFICULTY_CHANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PLAYER_DIFFICULTY_CHANGE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAYER_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAYER_SKINNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAYER_VEHICLE_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1065,16 +1063,16 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_PLAY_OBJECT_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAY_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAY_SPELL_VISUAL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PLAY_SPELL_VISUAL_KIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PLAY_TIME_WARNING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PLAY_SPELL_VISUAL_KIT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PLAY_TIME_WARNING, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PONG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_POWER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PRE_RESURRECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PROCRESIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PROPOSE_LEVEL_GRANT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PVP_CREDIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PVP_LOG_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PVP_OPTIONS_ENABLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PVP_LOG_DATA, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PVP_OPTIONS_ENABLED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_QUERY_QUESTS_COMPLETED_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_QUERY_TIME_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_OFFER_REWARD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1094,96 +1092,97 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_QUESTUPDATE_FAILEDTIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_QUEST_CONFIRM_ACCEPT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_QUEST_FORCE_REMOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_QUEST_NPC_QUERY_RESPONSE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_QUEST_POI_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_QUEST_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RAID_GROUP_ONLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_RAID_GROUP_ONLY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_RAID_INSTANCE_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_RAID_INSTANCE_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RAID_MARKERS_CHANGED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RAID_READY_CHECK_THROTTLED_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RAID_SUMMON_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_RAID_MARKERS_CHANGED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_RAID_READY_CHECK_THROTTLED_ERROR, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_RAID_SUMMON_FAILED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_RANDOMIZE_CHAR_NAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RATED_BG_RATING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RATED_BG_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_RATED_BG_RATING, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_RATED_BG_STATS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_READ_ITEM_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_READ_ITEM_OK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_REALM_SPLIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_REAL_GROUP_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_REAL_GROUP_UPDATE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_RECEIVED_MAIL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_REDIRECT_CLIENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_REFER_A_FRIEND_EXPIRED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_REFER_A_FRIEND_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_REDIRECT_CLIENT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_REFER_A_FRIEND_EXPIRED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_REFER_A_FRIEND_FAILURE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_REFORGE_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_REMOVED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_REPORT_PVP_AFK_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(SMSG_REQUEST_CEMETERY_LIST_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_REQUEST_PVP_REWARDS_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RESEARCH_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RESEARCH_SETUP_HISTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RESET_COMPRESSION_CONTEXT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RESET_FAILED_NOTIFY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RESPOND_INSPECT_ACHIEVEMENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RESURRECT_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RESYNC_RUNES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_ROLE_POLL_BEGIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_RWHOIS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_REPORT_PVP_AFK_RESULT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_REQUEST_CEMETERY_LIST_RESPONSE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_REQUEST_PVP_REWARDS_RESPONSE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_RESEARCH_COMPLETE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_RESEARCH_SETUP_HISTORY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_RESET_COMPRESSION_CONTEXT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_RESET_FAILED_NOTIFY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_RESPOND_INSPECT_ACHIEVEMENTS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_RESURRECT_REQUEST, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_RESYNC_RUNES, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_ROLE_POLL_BEGIN, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_RWHOIS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SELL_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SEND_MAIL_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SEND_UNLEARN_SPELLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SERVERTIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SERVERTIME, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SERVER_FIRST_ACHIEVEMENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SERVER_INFO_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SERVER_INFO_RESPONSE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SERVER_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SERVER_PERF, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SET_DF_FAST_LAUNCH_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SET_FACTION_ATWAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SERVER_PERF, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SET_DF_FAST_LAUNCH_RESULT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SET_FACTION_ATWAR, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SET_FACTION_STANDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SET_FACTION_VISIBLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SET_FLAT_SPELL_MODIFIER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SET_FORCED_REACTIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SET_PCT_SPELL_MODIFIER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SET_PHASE_SHIFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SET_PLAY_HOVER_ANIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SET_PHASE_SHIFT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SET_PLAY_HOVER_ANIM, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SET_PROFICIENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SET_PROJECTILE_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SHOWTAXINODES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SHOW_BANK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SHOW_RATINGS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SOR_START_EXPERIENCE_INCOMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SHOW_RATINGS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SOR_START_EXPERIENCE_INCOMPLETE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPELLBREAKLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPELLDAMAGESHIELD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPELLDISPELLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPELLENERGIZELOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPELLHEALLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPELLINSTAKILLLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELLINTERRUPTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELLINTERRUPTLOG, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPELLLOGEXECUTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPELLLOGMISS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPELLNONMELEEDAMAGELOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPELLORDAMAGE_IMMUNE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPELLSTEALLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELL_CATEGORY_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELL_CATEGORY_COOLDOWN, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPELL_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPELL_DELAYED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPELL_FAILED_OTHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPELL_FAILURE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPELL_GO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPELL_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPELL_UPDATE_CHAIN_TARGETS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPELL_UPDATE_CHAIN_TARGETS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPIRIT_HEALER_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_COLLISION_DISABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_COLLISION_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_COLLISION_DISABLE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_COLLISION_ENABLE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_GRAVITY_DISABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_GRAVITY_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FEATHER_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FEATHER_FALL, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FLYING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_FLYING, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_LAND_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_NORMAL_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_LAND_WALK, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_NORMAL_FALL, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_RUN_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_RUN_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1193,43 +1192,43 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_WALK_MODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_SET_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_START_SWIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_STOP_SWIM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_START_SWIM, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_STOP_SWIM, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_UNROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_UNSET_FLYING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_UNSET_FLYING, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_UNSET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_STABLE_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SPLINE_MOVE_WATER_WALK, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_STABLE_RESULT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_STANDSTATE_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_START_MIRROR_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_START_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_START_TIMER, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_STOP_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_STOP_MIRROR_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_STREAMING_MOVIE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_STREAMING_MOVIE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SUMMON_CANCEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SUMMON_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SUPERCEDED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SUPPRESS_NPC_GREETINGS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SUSPEND_COMMS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SUSPEND_TOKEN_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_TALENTS_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SUPPRESS_NPC_GREETINGS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SUSPEND_COMMS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SUSPEND_TOKEN_RESPONSE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TALENTS_ERROR, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TALENTS_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_TALENTS_INVOLUNTARILY_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TALENTS_INVOLUNTARILY_RESET, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TAXINODE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_TEST_DROP_RATE_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TEST_DROP_RATE_RESULT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TEXT_EMOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_THREAT_CLEAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_THREAT_REMOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_THREAT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_TIME_ADJUSTMENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TIME_ADJUSTMENT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TIME_SYNC_REQ, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TITLE_EARNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_TOGGLE_XP_GAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TOGGLE_XP_GAIN, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TOTEM_CREATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TRADE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TRADE_STATUS_EXTENDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_SUCCEEDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_FAILED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_SUCCEEDED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TRAINER_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TRANSFER_ABORTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TRANSFER_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1237,50 +1236,50 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_TRIGGER_MOVIE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TURN_IN_PETITION_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TUTORIAL_FLAGS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_UNIT_HEALTH_FREQUENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_UNIT_SPELLCAST_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_UNIT_HEALTH_FREQUENT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_UNIT_SPELLCAST_START, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ACCOUNT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ACCOUNT_DATA_COMPLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_COMBO_POINTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_CURRENCY_WEEK_LIMIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_DUNGEON_ENCOUNTER_FOR_LOOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_UPDATE_DUNGEON_ENCOUNTER_FOR_LOOT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_INSTANCE_ENCOUNTER_UNIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_INSTANCE_OWNERSHIP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ITEM_ENCHANTMENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_UPDATE_ITEM_ENCHANTMENTS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_LAST_INSTANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_OBJECT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_UPDATE_SERVER_PLAYER_POSITION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_UPDATE_SERVER_PLAYER_POSITION, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_UPDATE_WORLD_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_USERLIST_ADD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_USERLIST_REMOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_USERLIST_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_VOICESESSION_FULL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_VOICE_CHAT_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_VOICE_PARENTAL_CONTROLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_LEAVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_ROSTER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SET_TALKER_MUTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_USERLIST_ADD, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_USERLIST_REMOVE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_USERLIST_UPDATE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_VOICESESSION_FULL, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_VOICE_CHAT_STATUS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_VOICE_PARENTAL_CONTROLS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_LEAVE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_ROSTER_UPDATE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_VOICE_SET_TALKER_MUTED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_VOID_ITEM_SWAP_RESPONSE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_VOID_STORAGE_CONTENTS, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_VOID_STORAGE_FAILED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_VOID_STORAGE_TRANSFER_CHANGES, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_VOID_TRANSFER_RESULT, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_WAIT_QUEUE_FINISH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_WAIT_QUEUE_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_WARDEN_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_WARGAME_CHECK_ENTRY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_WARGAME_REQUEST_SENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_WAIT_QUEUE_FINISH, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_WAIT_QUEUE_UPDATE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_WARDEN_DATA, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_WARGAME_CHECK_ENTRY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_WARGAME_REQUEST_SENT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_WEATHER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_WEEKLY_LAST_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_WEEKLY_RESET_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_WEEKLY_SPELL_USAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_WEEKLY_SPELL_USAGE_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_WEEKLY_LAST_RESET, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_WEEKLY_RESET_CURRENCY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_WEEKLY_SPELL_USAGE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_WEEKLY_SPELL_USAGE_UPDATE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_WHO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_WHOIS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_WORLD_SERVER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_WORLD_SERVER_INFO, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_WORLD_STATE_UI_TIMER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_XP_GAIN_ABORTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_XP_GAIN_ABORTED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ZONE_UNDER_ATTACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); // These opcodes are not in WPP @@ -1297,7 +1296,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_GROUND_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_JOIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MANAGER_ADVANCE_STATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MANAGER_SET_NEXT_TRANSITION_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MANAGER_SET_NEXT_TRANSITION_TIME, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_REQUEST_SCORE_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); Need to send the response //DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlemasterHelloOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_BEASTMASTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); -- cgit v1.2.3 From e2b61714ca5adb98fab0c390a7b0ec3c8e0b5baa Mon Sep 17 00:00:00 2001 From: Spp Date: Wed, 22 Aug 2012 14:23:00 +0200 Subject: Core/Opcodes: Remove duplicate opcode CMSG_QUERY_COMPLETION_NPC_RESPONSE --- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- src/server/game/Server/Protocol/Opcodes.h | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index c8ec02e1edc..817cc772e5c 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -399,7 +399,6 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_PUSHQUESTTOPARTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePushQuestToParty ); DEFINE_OPCODE_HANDLER(CMSG_PVP_LOG_DATA, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_QUERY_BATTLEFIELD_STATE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_QUERY_COMPLETION_NPC_RESPONSE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_MEMBERS_FOR_RECIPE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_MEMBER_RECIPES, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_RECIPES, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -418,6 +417,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_STATUS_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleQuestgiverStatusQueryOpcode); DEFINE_OPCODE_HANDLER(CMSG_QUESTLOG_REMOVE_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestLogRemoveQuest ); DEFINE_OPCODE_HANDLER(CMSG_QUEST_CONFIRM_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestConfirmAccept ); + DEFINE_OPCODE_HANDLER(CMSG_QUEST_NPC_QUERY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_QUEST_POI_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestPOIQuery ); DEFINE_OPCODE_HANDLER(CMSG_QUEST_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestQueryOpcode ); DEFINE_OPCODE_HANDLER(CMSG_RANDOMIZE_CHAR_NAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRandomizeCharNameOpcode ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index cc3734ecdc2..8ca134b8862 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -426,7 +426,6 @@ enum Opcodes CMSG_PUSHQUESTTOPARTY = 0x4B14, CMSG_PVP_LOG_DATA = 0x7308, CMSG_QUERY_BATTLEFIELD_STATE = 0x7202, - CMSG_QUERY_COMPLETION_NPC_RESPONSE = 0x7302, CMSG_QUERY_GUILD_MEMBERS_FOR_RECIPE = 0x1036, CMSG_QUERY_GUILD_MEMBER_RECIPES = 0x1037, CMSG_QUERY_GUILD_RECIPES = 0x3033, @@ -448,7 +447,7 @@ enum Opcodes CMSG_QUESTLOG_REMOVE_QUEST = 0x0D16, CMSG_QUESTLOG_SWAP_QUEST = 0x0000, CMSG_QUEST_CONFIRM_ACCEPT = 0x0D15, - CMSG_QUEST_NPC_QUERY = 0x0000, + CMSG_QUEST_NPC_QUERY = 0x7302, CMSG_QUEST_POI_QUERY = 0x4037, CMSG_QUEST_QUERY = 0x0D06, CMSG_RANDOMIZE_CHAR_NAME = 0x2413, -- cgit v1.2.3 From 5b19f8672c8746985d5ed87cacb2129ee9a2bb99 Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 22 Aug 2012 16:50:42 +0200 Subject: Core/Spells: Fixed spell scaling problems with CastTimeMin > CastTimeMax, also minor cleanup --- src/server/game/DataStores/DBCStructure.h | 12 +++++----- src/server/game/Spells/SpellInfo.cpp | 39 +++++++++++-------------------- src/server/game/Spells/SpellInfo.h | 14 +++++------ 3 files changed, 26 insertions(+), 39 deletions(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index f743b051ce8..7b076698d9d 100644 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -2006,16 +2006,16 @@ typedef std::map SpellReagentMap; // SpellScaling.dbc struct SpellScalingEntry { - //uint32 Id; // 0 m_ID - int32 castTimeMin; // 1 - int32 castTimeMax; // 2 - uint32 castScalingMaxLevel; // 3 - uint32 playerClass; // 4 (index * 100) + charLevel => gtSpellScaling.dbc + //uint32 Id; // 0 m_ID + int32 CastTimeMin; // 1 + int32 CastTimeMax; // 2 + int32 CastTimeMaxLevel; // 3 + int32 ScalingClass; // 4 (index * 100) + charLevel - 1 => gtSpellScaling.dbc float Multiplier[3]; // 5-7 float RandomMultiplier[3]; // 8-10 float OtherMultiplier[3]; // 11-13 float CoefBase; // 14 some coefficient, mostly 1.0f - uint32 CoefLevelBase; // 15 some level + int32 CoefLevelBase; // 15 some level }; struct SpellDurationEntry diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 53ce893f0a0..72cd40ea1ea 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -417,18 +417,17 @@ int32 SpellEffectInfo::CalcValue(Unit const* caster, int32 const* bp, Unit const { if (caster) { - uint32 level = caster->getLevel(); + int32 level = caster->getLevel(); if (target && _spellInfo->IsPositiveEffect(_effIndex) && (Effect == SPELL_EFFECT_APPLY_AURA)) level = target->getLevel(); - SpellScalingEntry const* scaling = _spellInfo->GetSpellScaling(); // must exist, otherwise ScalingMultiplier == 0.0f - if (GtSpellScalingEntry const* gtScaling = sGtSpellScalingStore.LookupEntry((scaling->playerClass != -1 ? scaling->playerClass - 1 : MAX_CLASSES - 1) * 100 + level - 1)) + if (GtSpellScalingEntry const* gtScaling = sGtSpellScalingStore.LookupEntry((_spellInfo->ScalingClass != -1 ? _spellInfo->ScalingClass - 1 : MAX_CLASSES - 1) * 100 + level - 1)) { float multiplier = gtScaling->value; - if (scaling->castTimeMax > 0 && scaling->castScalingMaxLevel > level) - multiplier *= float(scaling->castTimeMin + (level - 1) * (scaling->castTimeMax - scaling->castTimeMin) / (scaling->castScalingMaxLevel - 1)) / float(scaling->castTimeMax); - if (scaling->CoefLevelBase > level) - multiplier *= (1.0f - scaling->CoefBase) * (float)(level - 1) / (float)(scaling->CoefLevelBase - 1) + scaling->CoefBase; + if (_spellInfo->CastTimeMax > 0 && _spellInfo->CastTimeMaxLevel > level) + multiplier *= float(_spellInfo->CastTimeMin + (level - 1) * (_spellInfo->CastTimeMax - _spellInfo->CastTimeMin) / (_spellInfo->CastTimeMaxLevel - 1)) / float(_spellInfo->CastTimeMax); + if (_spellInfo->CoefLevelBase > level) + multiplier *= (1.0f - _spellInfo->CoefBase) * (float)(level - 1) / (float)(_spellInfo->CoefLevelBase - 1) + _spellInfo->CoefBase; float preciseBasePoints = ScalingMultiplier * multiplier; if (DeltaScalingMultiplier) @@ -804,16 +803,10 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry) // SpellScalingEntry SpellScalingEntry const* _scaling = GetSpellScaling(); - castTimeMin = _scaling ? _scaling->castTimeMin : 0; - castTimeMax = _scaling ?_scaling->castTimeMax : 0; - castScalingMaxLevel = _scaling ? _scaling->castScalingMaxLevel : 0; - playerClass = _scaling ? _scaling->playerClass : 0; - for (uint8 i = 0; i < 3; ++i) - { - Multiplier[i] = _scaling ? _scaling->Multiplier[i] : 0; - RandomMultiplier[i] = _scaling ? _scaling->RandomMultiplier[i] : 0; - OtherMultiplier[i] = _scaling ? _scaling->OtherMultiplier[i] : 0; - } + CastTimeMin = _scaling ? _scaling->CastTimeMin : 0; + CastTimeMax = _scaling ?_scaling->CastTimeMax : 0; + CastTimeMaxLevel = _scaling ? _scaling->CastTimeMaxLevel : 0; + ScalingClass = _scaling ? _scaling->ScalingClass : 0; CoefBase = _scaling ? _scaling->CoefBase : 0; CoefLevelBase = _scaling ? _scaling->CoefLevelBase : 0; @@ -2092,15 +2085,11 @@ uint32 SpellInfo::CalcCastTime(Unit* caster, Spell* spell) const int32 castTime = 0; // not all spells have cast time index and this is all is pasiive abilities - SpellScalingEntry const* scaling = GetSpellScaling(); - if (scaling && caster) + if (caster && CastTimeMax > 0) { - if (scaling->castTimeMax > 0) - { - castTime = scaling->castTimeMax; - if (scaling->castScalingMaxLevel > caster->getLevel()) - castTime = scaling->castTimeMin + (caster->getLevel() - 1) * (scaling->castTimeMax - scaling->castTimeMin) / (scaling->castScalingMaxLevel - 1); - } + castTime = CastTimeMax; + if (CastTimeMaxLevel > int32(caster->getLevel())) + castTime = CastTimeMin + int32(caster->getLevel() - 1) * (CastTimeMax - CastTimeMin) / (CastTimeMaxLevel - 1); } else if (CastTimeEntry) castTime = CastTimeEntry->CastTime; diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h index 9387ad750a0..b77adf6ad58 100644 --- a/src/server/game/Spells/SpellInfo.h +++ b/src/server/game/Spells/SpellInfo.h @@ -251,6 +251,7 @@ public: uint32 TriggerSpell; flag96 SpellClassMask; std::list* ImplicitTargetConditions; + // SpellScalingEntry float ScalingMultiplier; float DeltaScalingMultiplier; float ComboScalingMultiplier; @@ -383,15 +384,12 @@ public: uint32 SpellTargetRestrictionsId; uint32 SpellTotemsId; // SpellScalingEntry - int32 castTimeMin; - int32 castTimeMax; - uint32 castScalingMaxLevel; - uint32 playerClass; - float Multiplier[3]; - float RandomMultiplier[3]; - float OtherMultiplier[3]; + int32 CastTimeMin; + int32 CastTimeMax; + int32 CastTimeMaxLevel; + int32 ScalingClass; float CoefBase; - uint32 CoefLevelBase; + int32 CoefLevelBase; SpellEffectInfo Effects[MAX_SPELL_EFFECTS]; uint32 ExplicitTargetMask; SpellChainNode const* ChainEntry; -- cgit v1.2.3 From 3888dd62cf0a02a11907c0d868707e66d0c633cb Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 22 Aug 2012 17:35:15 +0200 Subject: Core/PacketIO: Re-enabled opcodes that were mistakingly disabled --- src/server/game/Server/Protocol/Opcodes.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 817cc772e5c..95e38ffcb0d 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -540,12 +540,12 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_WHO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWhoOpcode ); DEFINE_OPCODE_HANDLER(CMSG_WHOIS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleWhoisOpcode ); DEFINE_OPCODE_HANDLER(CMSG_WORLD_STATE_UI_TIMER_UPDATE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleWorldStateUITimerUpdate ); - DEFINE_OPCODE_HANDLER(CMSG_WORLD_TELEPORT, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleWorldTeleportOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_WRAP_ITEM, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleWrapItemOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_WORLD_TELEPORT, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleWorldTeleportOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_WRAP_ITEM, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleWrapItemOpcode ); DEFINE_OPCODE_HANDLER(CMSG_ZONEUPDATE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleZoneUpdateOpcode ); DEFINE_OPCODE_HANDLER(MSG_AUCTION_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionHelloOpcode ); - DEFINE_OPCODE_HANDLER(MSG_CHANNEL_START, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(MSG_CHANNEL_UPDATE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(MSG_CHANNEL_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(MSG_CHANNEL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_CORPSE_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCorpseQueryOpcode ); DEFINE_OPCODE_HANDLER(MSG_INSPECT_ARENA_TEAMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectArenaTeamsOpcode ); DEFINE_OPCODE_HANDLER(MSG_LIST_STABLED_PETS, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleListStabledPetsOpcode ); @@ -575,7 +575,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_STRAFE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_SWIM, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_TURN, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_TELEPORT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_TELEPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_MOVE_TELEPORT_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveTeleportAck ); DEFINE_OPCODE_HANDLER(MSG_MOVE_TELEPORT_CHEAT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_MOVE_TIME_SKIPPED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); -- cgit v1.2.3 From e4648b745caf33b2afea24f9cb75de6cf58eecff Mon Sep 17 00:00:00 2001 From: Shocker Date: Wed, 22 Aug 2012 20:33:45 +0300 Subject: Core/Spells: Add missing AttributesEx9 and AttributesEx10 and correct arena/rated battleground spells usability --- src/server/game/DataStores/DBCStructure.h | 4 +- src/server/game/DataStores/DBCfmt.h | 2 +- src/server/game/Miscellaneous/SharedDefines.h | 74 ++++++++++++++++++++++++++- src/server/game/Spells/Spell.cpp | 47 ++++++++++++++--- src/server/game/Spells/Spell.h | 1 + src/server/game/Spells/SpellInfo.cpp | 2 + src/server/game/Spells/SpellInfo.h | 2 + 7 files changed, 120 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 7b076698d9d..4e688d39c75 100644 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -1766,8 +1766,8 @@ struct SpellEntry uint32 AttributesEx6; // 7 m_attributesExF uint32 AttributesEx7; // 8 m_attributesExG uint32 AttributesEx8; // 9 m_attributesExH - // uint32 unk_400_1; // 10 4.0.0 - // uint32 unk_420_1 // 11 4.2.0 + uint32 AttributesEx9; // 10 m_attributesExI + uint32 AttributesEx10; // 11 m_attributesExJ uint32 CastingTimeIndex; // 12 m_castingTimeIndex uint32 DurationIndex; // 13 m_durationIndex uint32 powerType; // 14 m_powerType diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index bdef905acfd..4999a10a9de 100755 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -128,7 +128,7 @@ const std::string CustomSpellDifficultyfmt="ppppp"; const std::string CustomSpellDifficultyIndex="id"; const char SpellDurationfmt[]="niii"; const char SpellEffectEntryfmt[]="nifiiiffiiiiiifiifiiiiiiiix"; -const char SpellEntryfmt[]="niiiiiiiiixxiiiifiiiissxxiixxixiiiiiiixiiiiiiiix"; +const char SpellEntryfmt[]="niiiiiiiiiiiiiiifiiiissxxiixxixiiiiiiixiiiiiiiix"; const std::string CustomSpellEntryfmt="papppppppppppapapaaaaaaaaaaapaaapapppppppaaaaapaapaaaaaaaaaaaaaaaaaappppppppppppppppppppppppppppppppppppaaaaaapppppppppaaapppppppppaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaappppppppapppaaaaappaaaaaaa"; const std::string CustomSpellEntryIndex = "Id"; const char SpellFocusObjectfmt[]="nx"; diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index c129310a91a..fc656f2e88b 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -437,7 +437,7 @@ enum SpellAttr4 SPELL_ATTR4_UNK13 = 0x00002000, // 13 SPELL_ATTR4_DAMAGE_DOESNT_BREAK_AURAS = 0x00004000, // 14 doesn't break auras by damage from these spells SPELL_ATTR4_UNK15 = 0x00008000, // 15 - SPELL_ATTR4_NOT_USABLE_IN_ARENA = 0x00010000, // 16 + SPELL_ATTR4_NOT_USABLE_IN_ARENA_OR_RATED_BG = 0x00010000, // 16 Cannot be used in both Arenas or Rated Battlegrounds SPELL_ATTR4_USABLE_IN_ARENA = 0x00020000, // 17 SPELL_ATTR4_AREA_TARGET_CHAIN = 0x00040000, // 18 (NYI)hits area targets one after another instead of all at once SPELL_ATTR4_UNK19 = 0x00080000, // 19 proc dalayed, after damage or don't proc on absorb? @@ -599,6 +599,78 @@ enum SpellAttr8 SPELL_ATTR8_UNK31 = 0x80000000 // 31 }; +enum SpellAttr9 +{ + SPELL_ATTR9_UNK0 = 0x00000001, // 0 + SPELL_ATTR9_UNK1 = 0x00000002, // 1 + SPELL_ATTR9_UNK2 = 0x00000004, // 2 + SPELL_ATTR9_UNK3 = 0x00000008, // 3 + SPELL_ATTR9_UNK4 = 0x00000010, // 4 + SPELL_ATTR9_UNK5 = 0x00000020, // 5 + SPELL_ATTR9_UNK6 = 0x00000040, // 6 + SPELL_ATTR9_UNK7 = 0x00000080, // 7 + SPELL_ATTR9_UNK8 = 0x00000100, // 8 + SPELL_ATTR9_NOT_USABLE_IN_ARENA = 0x00000200, // 9 Cannot be used in arenas + SPELL_ATTR9_UNK10 = 0x00000400, // 10 + SPELL_ATTR9_UNK11 = 0x00000800, // 11 + SPELL_ATTR9_UNK12 = 0x00001000, // 12 + SPELL_ATTR9_UNK13 = 0x00002000, // 13 + SPELL_ATTR9_USABLE_IN_RATED_BATTLEGROUNDS = 0x00004000, // 14 Can be used in Rated Battlegrounds + SPELL_ATTR9_UNK15 = 0x00008000, // 15 + SPELL_ATTR9_UNK16 = 0x00010000, // 16 + SPELL_ATTR9_UNK17 = 0x00020000, // 17 + SPELL_ATTR9_UNK18 = 0x00040000, // 18 + SPELL_ATTR9_UNK19 = 0x00080000, // 19 + SPELL_ATTR9_UNK20 = 0x00100000, // 20 + SPELL_ATTR9_UNK21 = 0x00200000, // 21 + SPELL_ATTR9_UNK22 = 0x00400000, // 22 + SPELL_ATTR9_UNK23 = 0x00800000, // 23 + SPELL_ATTR9_UNK24 = 0x01000000, // 24 + SPELL_ATTR9_UNK25 = 0x02000000, // 25 + SPELL_ATTR9_UNK26 = 0x04000000, // 26 + SPELL_ATTR9_UNK27 = 0x08000000, // 27 + SPELL_ATTR9_UNK28 = 0x10000000, // 28 + SPELL_ATTR9_UNK29 = 0x20000000, // 29 + SPELL_ATTR9_UNK30 = 0x40000000, // 30 + SPELL_ATTR9_UNK31 = 0x80000000 // 31 +}; + +enum SpellAttr10 +{ + SPELL_ATTR10_UNK0 = 0x00000001, // 0 + SPELL_ATTR10_UNK1 = 0x00000002, // 1 + SPELL_ATTR10_UNK2 = 0x00000004, // 2 + SPELL_ATTR10_UNK3 = 0x00000008, // 3 + SPELL_ATTR10_UNK4 = 0x00000010, // 4 + SPELL_ATTR10_UNK5 = 0x00000020, // 5 + SPELL_ATTR10_UNK6 = 0x00000040, // 6 + SPELL_ATTR10_UNK7 = 0x00000080, // 7 + SPELL_ATTR10_UNK8 = 0x00000100, // 8 + SPELL_ATTR10_UNK9 = 0x00000200, // 9 + SPELL_ATTR10_UNK10 = 0x00000400, // 10 + SPELL_ATTR10_UNK11 = 0x00000800, // 11 + SPELL_ATTR10_UNK12 = 0x00001000, // 12 + SPELL_ATTR10_UNK13 = 0x00002000, // 13 + SPELL_ATTR10_UNK14 = 0x00004000, // 14 + SPELL_ATTR10_UNK15 = 0x00008000, // 15 + SPELL_ATTR10_UNK16 = 0x00010000, // 16 + SPELL_ATTR10_UNK17 = 0x00020000, // 17 + SPELL_ATTR10_UNK18 = 0x00040000, // 18 + SPELL_ATTR10_UNK19 = 0x00080000, // 19 + SPELL_ATTR10_UNK20 = 0x00100000, // 20 + SPELL_ATTR10_UNK21 = 0x00200000, // 21 + SPELL_ATTR10_UNK22 = 0x00400000, // 22 + SPELL_ATTR10_UNK23 = 0x00800000, // 23 + SPELL_ATTR10_UNK24 = 0x01000000, // 24 + SPELL_ATTR10_UNK25 = 0x02000000, // 25 + SPELL_ATTR10_UNK26 = 0x04000000, // 26 + SPELL_ATTR10_UNK27 = 0x08000000, // 27 + SPELL_ATTR10_UNK28 = 0x10000000, // 28 + SPELL_ATTR10_UNK29 = 0x20000000, // 29 + SPELL_ATTR10_UNK30 = 0x40000000, // 30 + SPELL_ATTR10_UNK31 = 0x80000000 // 31 +}; + #define MIN_TALENT_SPEC 0 #define MAX_TALENT_SPEC 1 #define MIN_TALENT_SPECS 1 diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index ed8a4252128..98833c3eb41 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -4889,14 +4889,14 @@ SpellCastResult Spell::CheckCast(bool strict) if (!m_caster->ToPlayer()->InBattleground()) return SPELL_FAILED_ONLY_BATTLEGROUNDS; - // do not allow spells to be cast in arenas - // - with greater than 10 min CD without SPELL_ATTR4_USABLE_IN_ARENA flag - // - with SPELL_ATTR4_NOT_USABLE_IN_ARENA flag - if ((m_spellInfo->AttributesEx4 & SPELL_ATTR4_NOT_USABLE_IN_ARENA) || - (m_spellInfo->GetRecoveryTime() > 10 * MINUTE * IN_MILLISECONDS && !(m_spellInfo->AttributesEx4 & SPELL_ATTR4_USABLE_IN_ARENA))) - if (MapEntry const* mapEntry = sMapStore.LookupEntry(m_caster->GetMapId())) - if (mapEntry->IsBattleArena()) - return SPELL_FAILED_NOT_IN_ARENA; + // do not allow spells to be cast in arenas or rated battlegrounds + if (Player * player = m_caster->ToPlayer()) + if (player->InArena()/* || player->InRatedBattleGround() NYI*/) + { + SpellCastResult castResult = CheckArenaAndRatedBattlegroundCastRules(); + if (castResult != SPELL_CAST_OK) + return castResult; + } // zone check if (m_caster->GetTypeId() == TYPEID_UNIT || !m_caster->ToPlayer()->isGameMaster()) @@ -5656,6 +5656,37 @@ SpellCastResult Spell::CheckCasterAuras() const return SPELL_CAST_OK; } +SpellCastResult Spell::CheckArenaAndRatedBattlegroundCastRules() +{ + bool isRatedBattleground = false; // NYI + bool isArena = !isRatedBattleground; + + // check USABLE attributes + // USABLE takes precedence over NOT_USABLE + if (isRatedBattleground && m_spellInfo->AttributesEx9 & SPELL_ATTR9_USABLE_IN_RATED_BATTLEGROUNDS) + return SPELL_CAST_OK; + + if (isArena && m_spellInfo->AttributesEx4 & SPELL_ATTR4_USABLE_IN_ARENA) + return SPELL_CAST_OK; + + // check NOT_USABLE attributes + if (m_spellInfo->AttributesEx4 & SPELL_ATTR4_NOT_USABLE_IN_ARENA_OR_RATED_BG) + return isArena ? SPELL_FAILED_NOT_IN_ARENA : SPELL_FAILED_NOT_IN_RATED_BATTLEGROUND; + + if (isArena && m_spellInfo->AttributesEx9 & SPELL_ATTR9_NOT_USABLE_IN_ARENA) + return SPELL_FAILED_NOT_IN_ARENA; + + // check cooldowns + uint32 spellCooldown = m_spellInfo->GetRecoveryTime(); + if (isArena && spellCooldown > 10 * MINUTE * IN_MILLISECONDS) // not sure if still needed + return SPELL_FAILED_NOT_IN_ARENA; + + if (isRatedBattleground && spellCooldown > 15 * MINUTE * IN_MILLISECONDS) + return SPELL_FAILED_NOT_IN_RATED_BATTLEGROUND; + + return SPELL_CAST_OK; +} + bool Spell::CanAutoCast(Unit* target) { uint64 targetguid = target->GetGUID(); diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h index cb9a5fdef4d..ce8754cbff7 100755 --- a/src/server/game/Spells/Spell.h +++ b/src/server/game/Spells/Spell.h @@ -396,6 +396,7 @@ class Spell SpellCastResult CheckPower(); SpellCastResult CheckRuneCost(uint32 runeCostID); SpellCastResult CheckCasterAuras() const; + SpellCastResult CheckArenaAndRatedBattlegroundCastRules(); int32 CalculateDamage(uint8 i, Unit const* target) const { return m_caster->CalculateSpellDamage(target, m_spellInfo, i, &m_spellValue->EffectBasePoints[i]); } diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 72cd40ea1ea..8fa008da823 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -766,6 +766,8 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry) AttributesEx6 = spellEntry->AttributesEx6; AttributesEx7 = spellEntry->AttributesEx7; AttributesEx8 = spellEntry->AttributesEx8; + AttributesEx9 = spellEntry->AttributesEx9; + AttributesEx10 = spellEntry->AttributesEx10; AttributesCu = 0; CastTimeEntry = spellEntry->CastingTimeIndex ? sSpellCastTimesStore.LookupEntry(spellEntry->CastingTimeIndex) : NULL; DurationEntry = spellEntry->DurationIndex ? sSpellDurationStore.LookupEntry(spellEntry->DurationIndex) : NULL; diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h index b77adf6ad58..1161ac23aa3 100644 --- a/src/server/game/Spells/SpellInfo.h +++ b/src/server/game/Spells/SpellInfo.h @@ -308,6 +308,8 @@ public: uint32 AttributesEx6; uint32 AttributesEx7; uint32 AttributesEx8; + uint32 AttributesEx9; + uint32 AttributesEx10; uint32 AttributesCu; uint32 Stances; uint32 StancesNot; -- cgit v1.2.3 From 28a81b3d2376694760b0add783389f6584f429c6 Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 22 Aug 2012 19:50:42 +0200 Subject: Core/Guilds: Corrected guild packet login sequence and removed unused opcode --- src/server/game/DataStores/DBCStores.cpp | 2 + src/server/game/DataStores/DBCStores.h | 5 ++- src/server/game/DataStores/DBCStructure.h | 8 ++++ src/server/game/DataStores/DBCfmt.h | 1 + src/server/game/Guilds/Guild.cpp | 67 +++++++++++++++++++++-------- src/server/game/Guilds/Guild.h | 10 +++-- src/server/game/Handlers/GuildHandler.cpp | 8 ---- src/server/game/Server/Protocol/Opcodes.cpp | 4 +- src/server/game/Server/Protocol/Opcodes.h | 1 - src/server/game/Server/WorldSession.h | 1 - 10 files changed, 71 insertions(+), 36 deletions(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 3a0f48c1991..ffceb4e60aa 100644 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -109,6 +109,7 @@ DBCStorage sGtRegenMPPerSptStore(GtRegenMPPerSptf DBCStorage sGtSpellScalingStore(GtSpellScalingfmt); DBCStorage sGtOCTBaseHPByClassStore(GtOCTBaseHPByClassfmt); DBCStorage sGtOCTBaseMPByClassStore(GtOCTBaseMPByClassfmt); +DBCStorage sGuildPerkSpellsStore(GuildPerkSpellsfmt); DBCStorage sHolidaysStore(Holidaysfmt); @@ -400,6 +401,7 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sGtSpellScalingStore, dbcPath, "gtSpellScaling.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sGtOCTBaseHPByClassStore, dbcPath, "gtOCTBaseHPByClass.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sGtOCTBaseMPByClassStore, dbcPath, "gtOCTBaseMPByClass.dbc");//15595 + LoadDBC(availableDbcLocales, bad_dbc_files, sGuildPerkSpellsStore, dbcPath, "GuildPerkSpells.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sHolidaysStore, dbcPath, "Holidays.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sImportPriceArmorStore, dbcPath, "ImportPriceArmor.dbc"); // 15595 diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h index 0c19a64f12c..f669049be5c 100755 --- a/src/server/game/DataStores/DBCStores.h +++ b/src/server/game/DataStores/DBCStores.h @@ -121,8 +121,9 @@ extern DBCStorage sGtOCTClassCombatRatingSca extern DBCStorage sGtOCTHpPerStaminaStore; extern DBCStorage sGtRegenMPPerSptStore; extern DBCStorage sGtSpellScalingStore; -extern DBCStorage sGtOCTBaseHPByClassStore; -extern DBCStorage sGtOCTBaseMPByClassStore; +extern DBCStorage sGtOCTBaseHPByClassStore; +extern DBCStorage sGtOCTBaseMPByClassStore; +extern DBCStorage sGuildPerkSpellsStore; extern DBCStorage sHolidaysStore; extern DBCStorage sImportPriceArmorStore; extern DBCStorage sImportPriceQualityStore; diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 4e688d39c75..b12aee36fc1 100644 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -1131,6 +1131,14 @@ struct GtOCTBaseMPByClassEntry { float ratio; }; + +struct GuildPerkSpellsEntry +{ + //uint32 Id; + uint32 Level; + uint32 SpellId; +}; + /* no used struct HolidayDescriptionsEntry { diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index 4999a10a9de..8dfc40d9b4e 100755 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -79,6 +79,7 @@ const char GtRegenMPPerSptfmt[]="xf"; const char GtSpellScalingfmt[]="df"; const char GtOCTBaseHPByClassfmt[]="df"; const char GtOCTBaseMPByClassfmt[]="df"; +const char GuildPerkSpellsfmt[]="dii"; const char Holidaysfmt[]="niiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiixxsiix"; const char ImportPriceArmorfmt[]="nffff"; const char ImportPriceQualityfmt[]="nf"; diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index f66e6ff8a03..24cf5147522 100644 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -1219,7 +1219,7 @@ void Guild::HandleRoster(WorldSession* session /*= NULL*/) memberData << uint32(player ? player->GetZoneId() : member->GetZone()); memberData << uint64(0); // Total activity memberData.WriteByteSeq(guid[7]); - memberData << uint32(0); // Remaining guild week Rep + memberData << uint32(member->GetRemainingWeeklyReputation());// Remaining guild week Rep if (pubNoteLength) memberData.WriteString(member->GetPublicNote()); @@ -1250,9 +1250,9 @@ void Guild::HandleRoster(WorldSession* session /*= NULL*/) data.WriteString(m_info); data.WriteString(m_motd); - data << uint32(0); - data << uint32(0); - data << uint32(0); + data << uint32(m_accountsNumber); + data << uint32(GUILD_REPUATATION_WEEKLY_CAP); + data << uint32(secsToTimeBitFields(m_createdDate)); data << uint32(0); if (session) @@ -1305,7 +1305,7 @@ void Guild::HandleQuery(WorldSession* session) sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Sent (SMSG_GUILD_QUERY_RESPONSE)"); } -void Guild::HandleGuildRanks(WorldSession* session) +void Guild::HandleGuildRanks(WorldSession* session) const { // perhaps move to guild.cpp..... ByteBuffer rankData(100); @@ -1315,7 +1315,7 @@ void Guild::HandleGuildRanks(WorldSession* session) for (uint8 i = 0; i < _GetRanksSize(); i++) { - RankInfo* rankInfo = GetRankInfo(i); + RankInfo const* rankInfo = GetRankInfo(i); if (!rankInfo) continue; @@ -1918,18 +1918,6 @@ void Guild::HandleGuildPartyRequest(WorldSession* session) /////////////////////////////////////////////////////////////////////////////// // Send data to client -void Guild::SendInfo(WorldSession* session) const -{ - WorldPacket data(SMSG_GUILD_INFO, m_name.size() + 4 + 4 + 4); - data << m_name; - data << secsToTimeBitFields(m_createdDate); // 3.x (prev. year + month + day) - data << uint32(m_members.size()); // Number of members - data << m_accountsNumber; // Number of accounts - - session->SendPacket(&data); - sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Sent (SMSG_GUILD_INFO)"); -} - void Guild::SendEventLog(WorldSession* session) const { WorldPacket data(MSG_GUILD_EVENT_LOG_QUERY, 1 + m_eventLog->GetSize() * (1 + 8 + 4)); @@ -2016,6 +2004,17 @@ void Guild::SendMoneyInfo(WorldSession* session) const void Guild::SendLoginInfo(WorldSession* session) const { + /* + Login sequence: + SMSG_GUILD_EVENT - GE_MOTD + SMSG_GUILD_RANK + SMSG_GUILD_EVENT - GE_SIGNED_ON + -- learn perks + SMSG_GUILD_REPUTATION_WEEKLY_CAP + SMSG_GUILD_ACHIEVEMENT_DATA + SMSG_GUILD_MEMBER_DAILY_RESET // bank withdrawal reset + */ + WorldPacket data(SMSG_GUILD_EVENT, 1 + 1 + m_motd.size() + 1); data << uint8(GE_MOTD); data << uint8(1); @@ -2023,9 +2022,39 @@ void Guild::SendLoginInfo(WorldSession* session) const session->SendPacket(&data); sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Sent guild MOTD (SMSG_GUILD_EVENT)"); - SendBankTabsInfo(session); + HandleGuildRanks(session); _BroadcastEvent(GE_SIGNED_ON, session->GetPlayer()->GetGUID(), session->GetPlayer()->GetName()); + + // Send to self separately, player is not in world yet and is not found by _BroadcastEvent + data.Initialize(SMSG_GUILD_EVENT, 1 + 1 + strlen(session->GetPlayer()->GetName()) + 8); + data << uint8(GE_SIGNED_ON); + data << uint8(1); + data << session->GetPlayer()->GetName(); + data << uint64(session->GetPlayer()->GetGUID()); + session->SendPacket(&data); + + for (uint32 i = 0; i < sGuildPerkSpellsStore.GetNumRows(); ++i) + if (GuildPerkSpellsEntry const* entry = sGuildPerkSpellsStore.LookupEntry(i)) + if (entry->Level >= GetLevel()) + session->GetPlayer()->learnSpell(entry->SpellId, false); + + SendGuildReputationWeeklyCap(session); + + GetAchievementMgr().SendAllAchievementData(session->GetPlayer()); + + data.Initialize(SMSG_GUILD_MEMBER_DAILY_RESET, 0); // tells the client to request bank withdrawal limit + session->SendPacket(&data); +} + +void Guild::SendGuildReputationWeeklyCap(WorldSession* session) const +{ + if (Member const* member = GetMember(session->GetPlayer()->GetGUID())) + { + WorldPacket data(SMSG_GUILD_REPUTATION_WEEKLY_CAP, 4); + data << uint32(member->GetRemainingWeeklyReputation()); + session->SendPacket(&data); + } } /////////////////////////////////////////////////////////////////////////////// diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h index 94d161cd34f..27c87c6853c 100755 --- a/src/server/game/Guilds/Guild.h +++ b/src/server/game/Guilds/Guild.h @@ -72,7 +72,7 @@ enum GuildRankRights GR_RIGHT_WITHDRAW_REPAIR = 0x00040000, // withdraw for repair GR_RIGHT_WITHDRAW_GOLD = 0x00080000, // withdraw gold GR_RIGHT_CREATE_GUILD_EVENT = 0x00100000, // wotlk - GR_RIGHT_ALL = 0x001DF1FF + GR_RIGHT_ALL = 0x00DDFFBF }; enum GuildCommandType @@ -224,6 +224,8 @@ enum GuildMemberFlags GUILDMEMBER_STATUS_MOBILE = 0x0008, // remote chat from mobile app }; +#define GUILD_REPUATATION_WEEKLY_CAP 4375 + //////////////////////////////////////////////////////////////////////////////////////////// // Emblem info class EmblemInfo @@ -324,6 +326,8 @@ private: inline Player* FindPlayer() const { return ObjectAccessor::FindPlayer(m_guid); } + uint32 GetRemainingWeeklyReputation() const { return 0; } + private: uint32 m_guildId; // Fields from characters table @@ -634,7 +638,7 @@ public: // Handle client commands void HandleRoster(WorldSession* session = NULL); // NULL = broadcast void HandleQuery(WorldSession* session); - void HandleGuildRanks(WorldSession* session); + void HandleGuildRanks(WorldSession* session) const; void HandleSetMOTD(WorldSession* session, const std::string& motd); void HandleSetInfo(WorldSession* session, const std::string& info); void HandleSetEmblem(WorldSession* session, const EmblemInfo& emblemInfo); @@ -658,7 +662,6 @@ public: void HandleGuildPartyRequest(WorldSession* session); // Send info to client - void SendInfo(WorldSession* session) const; void SendEventLog(WorldSession* session) const; void SendBankLog(WorldSession* session, uint8 tabId) const; void SendBankTabsInfo(WorldSession* session) const; @@ -667,6 +670,7 @@ public: void SendPermissions(WorldSession* session) const; void SendMoneyInfo(WorldSession* session) const; void SendLoginInfo(WorldSession* session) const; + void SendGuildReputationWeeklyCap(WorldSession* session) const; // Load from DB bool LoadFromDB(Field* fields); diff --git a/src/server/game/Handlers/GuildHandler.cpp b/src/server/game/Handlers/GuildHandler.cpp index 6ace7782de6..05e9d0d2691 100755 --- a/src/server/game/Handlers/GuildHandler.cpp +++ b/src/server/game/Handlers/GuildHandler.cpp @@ -116,14 +116,6 @@ void WorldSession::HandleGuildDeclineOpcode(WorldPacket& /*recvPacket*/) GetPlayer()->SetInGuild(0); } -void WorldSession::HandleGuildInfoOpcode(WorldPacket& /*recvPacket*/) -{ - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_INFO"); - - if (Guild* guild = _GetPlayerGuild(this, true)) - guild->SendInfo(this); -} - void WorldSession::HandleGuildRosterOpcode(WorldPacket& recvPacket) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_ROSTER"); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 95e38ffcb0d..3426a8ceb54 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -851,7 +851,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_GUILD_INVITE_CANCEL, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_MAX_DAILY_XP, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_MEMBERS_FOR_RECIPE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GUILD_MEMBER_DAILY_RESET, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_MEMBER_DAILY_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_MEMBER_RECIPES, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_MEMBER_UPDATE_NOTE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_MOVE_COMPLETE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -866,7 +866,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_GUILD_RECIPES, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_RENAMED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_REPUTATION_REACTION_CHANGED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GUILD_REPUTATION_WEEKLY_CAP, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_REPUTATION_WEEKLY_CAP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_RESET, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_REWARDS_LIST, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_ROSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 8ca134b8862..9e290128996 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -939,7 +939,6 @@ enum Opcodes SMSG_GUILD_EVENT = 0x0705, SMSG_GUILD_EVENT_LOG_QUERY = 0x10B2, SMSG_GUILD_FLAGGED_FOR_RENAME = 0x30B6, - SMSG_GUILD_INFO = 0x0000, SMSG_GUILD_INVITE = 0x14A2, SMSG_GUILD_INVITE_CANCEL = 0x0606, SMSG_GUILD_KNOWN_RECIPES = 0x0000, diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 2427ede716a..444c79de95d 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -571,7 +571,6 @@ class WorldSession void HandleGuildRemoveOpcode(WorldPacket& recvPacket); void HandleGuildAcceptOpcode(WorldPacket& recvPacket); void HandleGuildDeclineOpcode(WorldPacket& recvPacket); - void HandleGuildInfoOpcode(WorldPacket& recvPacket); void HandleGuildEventLogQueryOpcode(WorldPacket& recvPacket); void HandleGuildRosterOpcode(WorldPacket& recvPacket); void HandleGuildPromoteOpcode(WorldPacket& recvPacket); -- cgit v1.2.3 From 6c2ad888e7a2cf82d8c2be01c955f49ed60b5efc Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 22 Aug 2012 20:22:32 +0200 Subject: Core/Logging: Fixed opcode logging --- src/server/game/Server/WorldSocket.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index 4e8292c621e..246b1424f23 100644 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -677,8 +677,8 @@ int WorldSocket::ProcessIncoming(WorldPacket* new_pct) if (sPacketLog->CanLogPacket()) sPacketLog->LogPacket(*new_pct, CLIENT_TO_SERVER); - char const* opcodeName = GetOpcodeNameForLogging(opcode).c_str(); - sLog->outInfo(LOG_FILTER_OPCODES, "C->S: %s", opcodeName); + std::string opcodeName = GetOpcodeNameForLogging(opcode); + sLog->outInfo(LOG_FILTER_OPCODES, "C->S: %s", opcodeName.c_str()); try { @@ -701,14 +701,14 @@ int WorldSocket::ProcessIncoming(WorldPacket* new_pct) return 0; case CMSG_LOG_DISCONNECT: new_pct->rfinish(); // contains uint32 disconnectReason; - sLog->outDebug(LOG_FILTER_NETWORKIO, "%s", opcodeName); + sLog->outDebug(LOG_FILTER_NETWORKIO, "%s", opcodeName.c_str()); sScriptMgr->OnPacketReceive(this, WorldPacket(*new_pct)); return 0; // not an opcode, client sends string "WORLD OF WARCRAFT CONNECTION - CLIENT TO SERVER" without opcode // first 4 bytes become the opcode (2 dropped) case MSG_VERIFY_CONNECTIVITY: { - sLog->outDebug(LOG_FILTER_NETWORKIO, "%s", opcodeName); + sLog->outDebug(LOG_FILTER_NETWORKIO, "%s", opcodeName.c_str()); sScriptMgr->OnPacketReceive(this, WorldPacket(*new_pct)); std::string str; *new_pct >> str; @@ -718,7 +718,7 @@ int WorldSocket::ProcessIncoming(WorldPacket* new_pct) } case CMSG_ENABLE_NAGLE: { - sLog->outDebug(LOG_FILTER_NETWORKIO, "%s", opcodeName); + sLog->outDebug(LOG_FILTER_NETWORKIO, "%s", opcodeName.c_str()); sScriptMgr->OnPacketReceive(this, WorldPacket(*new_pct)); return m_Session ? m_Session->HandleEnableNagleAlgorithm() : -1; } @@ -754,7 +754,7 @@ int WorldSocket::ProcessIncoming(WorldPacket* new_pct) catch (ByteBufferException &) { sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::ProcessIncoming ByteBufferException occured while parsing an instant handled packet %s from client %s, accountid=%i. Disconnected client.", - opcodeName, GetRemoteAddress().c_str(), m_Session ? int32(m_Session->GetAccountId()) : -1); + opcodeName.c_str(), GetRemoteAddress().c_str(), m_Session ? int32(m_Session->GetAccountId()) : -1); new_pct->hexlike(); return -1; } -- cgit v1.2.3 From bb6f3023f0203ddcf7b5f1068e37e3e685b2111a Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 22 Aug 2012 20:54:53 +0200 Subject: Core/PacketIO: Enabled guild bank money withdraw limits opcodes and removed duplicate ones --- src/server/game/Guilds/Guild.cpp | 2 +- src/server/game/Guilds/Guild.h | 2 +- src/server/game/Handlers/GuildHandler.cpp | 2 +- src/server/game/Server/Protocol/Opcodes.cpp | 6 ++---- src/server/game/Server/Protocol/Opcodes.h | 6 ++---- 5 files changed, 7 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 24cf5147522..4f8b64d7226 100644 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -1251,7 +1251,7 @@ void Guild::HandleRoster(WorldSession* session /*= NULL*/) data.WriteString(m_motd); data << uint32(m_accountsNumber); - data << uint32(GUILD_REPUATATION_WEEKLY_CAP); + data << uint32(GUILD_REPUTATION_WEEKLY_CAP); data << uint32(secsToTimeBitFields(m_createdDate)); data << uint32(0); diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h index 27c87c6853c..c4ec165d4ab 100755 --- a/src/server/game/Guilds/Guild.h +++ b/src/server/game/Guilds/Guild.h @@ -224,7 +224,7 @@ enum GuildMemberFlags GUILDMEMBER_STATUS_MOBILE = 0x0008, // remote chat from mobile app }; -#define GUILD_REPUATATION_WEEKLY_CAP 4375 +#define GUILD_REPUTATION_WEEKLY_CAP 4375 //////////////////////////////////////////////////////////////////////////////////////////// // Emblem info diff --git a/src/server/game/Handlers/GuildHandler.cpp b/src/server/game/Handlers/GuildHandler.cpp index 05e9d0d2691..ff9189ff704 100755 --- a/src/server/game/Handlers/GuildHandler.cpp +++ b/src/server/game/Handlers/GuildHandler.cpp @@ -405,7 +405,7 @@ void WorldSession::HandleGuildEventLogQueryOpcode(WorldPacket& /* recvPacket */) void WorldSession::HandleGuildBankMoneyWithdrawn(WorldPacket & /* recvData */) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (MSG_GUILD_BANK_MONEY_WITHDRAWN)"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (CMSG_GUILD_BANK_MONEY_WITHDRAWN_QUERY)"); if (Guild* guild = _GetPlayerGuild(this)) guild->SendMoneyInfo(this); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 3426a8ceb54..2e823c7d461 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -234,9 +234,9 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_BUY_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankBuyTab ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_DEPOSIT_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankDepositMoney ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_LOG_QUERY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_MONEY_WITHDRAWN_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankMoneyWithdrawn ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_QUERY_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankQueryTab ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_QUERY_TEXT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_REM_MONEY_WITHDRAW_QUERY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_SET_TAB_TEXT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_SWAP_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankSwapItems ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_UPDATE_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankUpdateTab ); @@ -834,8 +834,8 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_GUILD_ACHIEVEMENT_MEMBERS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_LIST, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_LOG_QUERY_RESULTS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_MONEY_WITHDRAWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_QUERY_TEXT_RESULTS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_REM_MONEY_WITHDRAW_QUERY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_CHALLENGE_COMPLETED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_CHALLENGE_UPDATED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_CHANGE_NAME_RESULT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1395,7 +1395,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_GODMODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_CANCEL, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GROUP_UNINVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupUninviteOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_MONEY_WITHDRAWN_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankMoneyWithdrawn ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_NOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_CREATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildCreateOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildInfoOpcode ); @@ -1620,7 +1619,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_GHOSTEE_GONE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GMRESPONSE_CREATE_TICKET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GOGOGO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_MONEY_WITHDRAWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_CANCEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_GUILD_KNOWN_RECIPES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 9e290128996..63da75e8885 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -243,11 +243,10 @@ enum Opcodes CMSG_GUILD_BANK_BUY_TAB = 0x0C37, CMSG_GUILD_BANK_DEPOSIT_MONEY = 0x0707, CMSG_GUILD_BANK_LOG_QUERY = 0x3224, - CMSG_GUILD_BANK_MONEY_WITHDRAWN_QUERY = 0x0000, + CMSG_GUILD_BANK_MONEY_WITHDRAWN_QUERY = 0x1225, CMSG_GUILD_BANK_NOTE = 0x0000, CMSG_GUILD_BANK_QUERY_TAB = 0x2E35, CMSG_GUILD_BANK_QUERY_TEXT = 0x3220, - CMSG_GUILD_BANK_REM_MONEY_WITHDRAW_QUERY = 0x1225, CMSG_GUILD_BANK_SET_TAB_TEXT = 0x3023, CMSG_GUILD_BANK_SWAP_ITEMS = 0x2315, CMSG_GUILD_BANK_UPDATE_TAB = 0x0106, @@ -924,9 +923,8 @@ enum Opcodes SMSG_GUILD_ACHIEVEMENT_MEMBERS = 0x38A5, SMSG_GUILD_BANK_LIST = 0x78A5, SMSG_GUILD_BANK_LOG_QUERY_RESULTS = 0x30B2, - SMSG_GUILD_BANK_MONEY_WITHDRAWN = 0x0000, + SMSG_GUILD_BANK_MONEY_WITHDRAWN = 0x5DB4, SMSG_GUILD_BANK_QUERY_TEXT_RESULTS = 0x75A3, - SMSG_GUILD_BANK_REM_MONEY_WITHDRAW_QUERY = 0x5DB4, SMSG_GUILD_CANCEL = 0x0000, SMSG_GUILD_CHALLENGE_COMPLETED = 0x39A3, SMSG_GUILD_CHALLENGE_UPDATED = 0x18B1, -- cgit v1.2.3 From 7bd358f5a014c2c87c8892475d2829b1c85cdf01 Mon Sep 17 00:00:00 2001 From: NTX Date: Wed, 22 Aug 2012 23:18:06 +0200 Subject: Core/Opcodes: Fix CMSG_REORDER_CHARACTERS --- .../2012_08_22_00_characters_characters_434.sql | 1 + src/server/game/Entities/Player/Player.cpp | 9 ++--- src/server/game/Handlers/CharacterHandler.cpp | 40 ++++++++++++++++++++++ src/server/game/Server/Protocol/Opcodes.cpp | 2 +- src/server/game/Server/WorldSession.h | 1 + .../Database/Implementation/CharacterDatabase.cpp | 4 +-- 6 files changed, 50 insertions(+), 7 deletions(-) create mode 100644 sql/updates/characters/2012_08_22_00_characters_characters_434.sql (limited to 'src') diff --git a/sql/updates/characters/2012_08_22_00_characters_characters_434.sql b/sql/updates/characters/2012_08_22_00_characters_characters_434.sql new file mode 100644 index 00000000000..087f6f894eb --- /dev/null +++ b/sql/updates/characters/2012_08_22_00_characters_characters_434.sql @@ -0,0 +1 @@ +ALTER TABLE `characters` ADD `slot` TINYINT UNSIGNED NOT NULL DEFAULT '0' AFTER `name`; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 3ad14cb9c72..812383b9616 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -1848,8 +1848,8 @@ bool Player::BuildEnumData(PreparedQueryResult result, ByteBuffer* dataBuffer, B // "SELECT characters.guid, characters.name, characters.race, characters.class, characters.gender, characters.playerBytes, characters.playerBytes2, characters.level, " // 8 9 10 11 12 13 14 // "characters.zone, characters.map, characters.position_x, characters.position_y, characters.position_z, guild_member.guildid, characters.playerFlags, " - // 15 16 17 18 19 20 21 - // "characters.at_login, character_pet.entry, character_pet.modelid, character_pet.level, characters.data, character_banned.guid, character_declinedname.genitive " + // 15 16 17 18 19 20 21 22 + // "characters.at_login, character_pet.entry, character_pet.modelid, character_pet.level, characters.data, character_banned.guid, characters.slot, character_declinedname.genitive" Field* fields = result->Fetch(); @@ -1874,6 +1874,7 @@ bool Player::BuildEnumData(PreparedQueryResult result, ByteBuffer* dataBuffer, B uint32 playerFlags = fields[14].GetUInt32(); uint32 atLoginFlags = fields[15].GetUInt16(); Tokens equipment(fields[19].GetString(), ' '); + uint8 slot = fields[21].GetUInt8(); uint32 charFlags = 0; if (playerFlags & PLAYER_FLAGS_HIDE_HELM) @@ -1891,7 +1892,7 @@ bool Player::BuildEnumData(PreparedQueryResult result, ByteBuffer* dataBuffer, B if (fields[20].GetUInt32()) charFlags |= CHARACTER_FLAG_LOCKED_BY_BILLING; - if (sWorld->getBoolConfig(CONFIG_DECLINED_NAMES_USED) && !fields[21].GetString().empty()) + if (sWorld->getBoolConfig(CONFIG_DECLINED_NAMES_USED) && !fields[22].GetString().empty()) charFlags |= CHARACTER_FLAG_DECLINED; uint32 customizationFlag = 0; @@ -1974,7 +1975,7 @@ bool Player::BuildEnumData(PreparedQueryResult result, ByteBuffer* dataBuffer, B *dataBuffer << uint32(petFamily); // Pet family dataBuffer->WriteByteSeq(guildGuid[2]); - *dataBuffer << uint8(0); // List order + *dataBuffer << uint8(slot); // List order *dataBuffer << uint8(hairStyle); // Hair style dataBuffer->WriteByteSeq(guildGuid[3]); *dataBuffer << uint32(petDisplayId); // Pet DisplayID diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 661da579c5e..f89b1b95bc1 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -2132,3 +2132,43 @@ void WorldSession::HandleRandomizeCharNameOpcode(WorldPacket& recvData) data.WriteString(*name); SendPacket(&data); } + +void WorldSession::HandleReorderCharacters(WorldPacket& recvData) +{ + uint32 charactersCount = recvData.ReadBits(10); + + ObjectGuid guids[charactersCount]; + uint8 positions[charactersCount]; + + for (uint8 i = 0; i < charactersCount; ++i) + { + guids[i][1] = recvData.ReadBit(); + guids[i][4] = recvData.ReadBit(); + guids[i][5] = recvData.ReadBit(); + guids[i][3] = recvData.ReadBit(); + guids[i][0] = recvData.ReadBit(); + guids[i][7] = recvData.ReadBit(); + guids[i][6] = recvData.ReadBit(); + guids[i][2] = recvData.ReadBit(); + } + + SQLTransaction trans = CharacterDatabase.BeginTransaction(); + for (uint8 i = 0; i < charactersCount; ++i) + { + recvData.ReadByteSeq(guids[i][6]); + recvData.ReadByteSeq(guids[i][5]); + recvData.ReadByteSeq(guids[i][1]); + recvData.ReadByteSeq(guids[i][4]); + recvData.ReadByteSeq(guids[i][0]); + recvData.ReadByteSeq(guids[i][3]); + + recvData >> positions[i]; + position[i] /= 10; + + recvData.ReadByteSeq(guids[i][2]); + recvData.ReadByteSeq(guids[i][7]); + + trans->PAppend("UPDATE characters SET slot = '%u' WHERE guid = '%u'", positions[i], uint64(guids[i])); + } + CharacterDatabase.CommitTransaction(trans); +} diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 2e823c7d461..b25a7d3f1c6 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -427,7 +427,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_RECLAIM_CORPSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReclaimCorpseOpcode ); DEFINE_OPCODE_HANDLER(CMSG_REDIRECTION_AUTH_PROOF, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_REFORGE_ITEM, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleReforgeItemOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_REORDER_CHARACTERS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_REORDER_CHARACTERS, STATUS_AUTHED, PROCESS_INPLACE, &WorldSession::HandleReorderCharacters ); DEFINE_OPCODE_HANDLER(CMSG_REPAIR_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepairItemOpcode ); DEFINE_OPCODE_HANDLER(CMSG_REPOP_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRepopRequestOpcode ); DEFINE_OPCODE_HANDLER(CMSG_REPORT_PVP_AFK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReportPvPAFK ); diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 444c79de95d..a35cd7cc595 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -422,6 +422,7 @@ class WorldSession void HandlePlayerLogin(LoginQueryHolder * holder); void HandleCharFactionOrRaceChange(WorldPacket& recvData); void HandleRandomizeCharNameOpcode(WorldPacket& recvData); + void HandleReorderCharacters(WorldPacket& recvData); // played time diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index 06cc5754b68..f99a0ad88fd 100755 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -38,8 +38,8 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_SEL_GUID_BY_NAME_FILTER, "SELECT guid, name FROM characters WHERE name LIKE CONCAT('%%', ?, '%%')", CONNECTION_SYNCH) PREPARE_STATEMENT(CHAR_SEL_BANINFO_LIST, "SELECT bandate, unbandate, bannedby, banreason FROM character_banned WHERE guid = ? ORDER BY unbandate", CONNECTION_SYNCH) PREPARE_STATEMENT(CHAR_SEL_BANNED_NAME, "SELECT characters.name FROM characters, character_banned WHERE character_banned.guid = ? AND character_banned.guid = characters.guid", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_SEL_ENUM, "SELECT c.guid, c.name, c.race, c.class, c.gender, c.playerBytes, c.playerBytes2, c.level, c.zone, c.map, c.position_x, c.position_y, c.position_z, gm.guildid, c.playerFlags, c.at_login, cp.entry, cp.modelid, cp.level, c.equipmentCache, cb.guid FROM characters AS c LEFT JOIN character_pet AS cp ON c.guid = cp.owner AND cp.slot = ? LEFT JOIN guild_member AS gm ON c.guid = gm.guid LEFT JOIN character_banned AS cb ON c.guid = cb.guid AND cb.active = 1 WHERE c.account = ? ORDER BY c.guid", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_SEL_ENUM_DECLINED_NAME, "SELECT c.guid, c.name, c.race, c.class, c.gender, c.playerBytes, c.playerBytes2, c.level, c.zone, c.map, c.position_x, c.position_y, c.position_z, gm.guildid, c.playerFlags, c.at_login, cp.entry, cp.modelid, cp.level, c.equipmentCache, cb.guid, cd.genitive FROM characters AS c LEFT JOIN character_pet AS cp ON c.guid = cp.owner AND cp.slot = ? LEFT JOIN character_declinedname AS cd ON c.guid = cd.guid LEFT JOIN guild_member AS gm ON c.guid = gm.guid LEFT JOIN character_banned AS cb ON c.guid = cb.guid AND cb.active = 1 WHERE c.account = ? ORDER BY c.guid", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_SEL_ENUM, "SELECT c.guid, c.name, c.race, c.class, c.gender, c.playerBytes, c.playerBytes2, c.level, c.zone, c.map, c.position_x, c.position_y, c.position_z, gm.guildid, c.playerFlags, c.at_login, cp.entry, cp.modelid, cp.level, c.equipmentCache, cb.guid, c.slot FROM characters AS c LEFT JOIN character_pet AS cp ON c.guid = cp.owner AND cp.slot = ? LEFT JOIN guild_member AS gm ON c.guid = gm.guid LEFT JOIN character_banned AS cb ON c.guid = cb.guid AND cb.active = 1 WHERE c.account = ? ORDER BY c.guid", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_SEL_ENUM_DECLINED_NAME, "SELECT c.guid, c.name, c.race, c.class, c.gender, c.playerBytes, c.playerBytes2, c.level, c.zone, c.map, c.position_x, c.position_y, c.position_z, gm.guildid, c.playerFlags, c.at_login, cp.entry, cp.modelid, cp.level, c.equipmentCache, cb.guid, c.slot, cd.genitive FROM characters AS c LEFT JOIN character_pet AS cp ON c.guid = cp.owner AND cp.slot = ? LEFT JOIN character_declinedname AS cd ON c.guid = cd.guid LEFT JOIN guild_member AS gm ON c.guid = gm.guid LEFT JOIN character_banned AS cb ON c.guid = cb.guid AND cb.active = 1 WHERE c.account = ? ORDER BY c.guid", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_SEL_PET_SLOTS, "SELECT owner, slot FROM character_pet WHERE owner = ? AND slot >= ? AND slot <= ? ORDER BY slot", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_SEL_PET_SLOTS_DETAIL, "SELECT owner, id, entry, level, name FROM character_pet WHERE owner = ? AND slot >= ? AND slot <= ? ORDER BY slot", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_SEL_PET_ENTRY, "SELECT entry FROM character_pet WHERE owner = ? AND id = ? AND slot >= ? AND slot <= ?", CONNECTION_ASYNC); -- cgit v1.2.3 From da9480557b3f191efab08d6aaf75a21a62512252 Mon Sep 17 00:00:00 2001 From: Nay Date: Wed, 22 Aug 2012 22:56:31 +0100 Subject: Core: Fix a typo and whitespace cleanup --- src/server/game/Battlefield/Battlefield.cpp | 6 +++--- src/server/game/Battlefield/Battlefield.h | 2 +- src/server/game/Battlefield/BattlefieldHandler.cpp | 6 +++--- src/server/game/Handlers/CharacterHandler.cpp | 2 +- src/server/game/Spells/SpellMgr.cpp | 2 +- src/server/game/World/World.cpp | 4 ++-- src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp | 2 +- src/tools/map_extractor/CMakeLists.txt | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/server/game/Battlefield/Battlefield.cpp b/src/server/game/Battlefield/Battlefield.cpp index d159580d189..99852f14277 100644 --- a/src/server/game/Battlefield/Battlefield.cpp +++ b/src/server/game/Battlefield/Battlefield.cpp @@ -65,7 +65,7 @@ Battlefield::~Battlefield() // Called when a player enters the zone void Battlefield::HandlePlayerEnterZone(Player* player, uint32 /*zone*/) { - // If battle is started, + // If battle is started, // If not full of players > invite player to join the war // If full of players > announce to player that BF is full and kick him after a few second if he desn't leave if (IsWarTime()) @@ -885,9 +885,9 @@ GuidSet::iterator BfCapturePoint::HandlePlayerLeave(Player* player) { if (m_capturePoint) player->SendUpdateWorldState(m_capturePoint->GetGOInfo()->capturePoint.worldState1, 0); - + GuidSet::iterator current = m_activePlayers[player->GetTeamId()].find(player->GetGUID()); - + if (current == m_activePlayers[player->GetTeamId()].end()) return current; // return end() diff --git a/src/server/game/Battlefield/Battlefield.h b/src/server/game/Battlefield/Battlefield.h index 5fa8d6b1bc8..07daf33d431 100644 --- a/src/server/game/Battlefield/Battlefield.h +++ b/src/server/game/Battlefield/Battlefield.h @@ -35,7 +35,7 @@ enum BattlefieldTypes enum BattlefieldIDs { - BATTLEFIELD_BATTLEID_WG = 1, // Wintergrasp battle + BATTLEFIELD_BATTLEID_WG = 1, // Wintergrasp battle }; enum BattlefieldObjectiveStates diff --git a/src/server/game/Battlefield/BattlefieldHandler.cpp b/src/server/game/Battlefield/BattlefieldHandler.cpp index 09c6f18f796..b852082d582 100644 --- a/src/server/game/Battlefield/BattlefieldHandler.cpp +++ b/src/server/game/Battlefield/BattlefieldHandler.cpp @@ -32,7 +32,7 @@ //Param3:(time) Time in second that the player have for accept void WorldSession::SendBfInvitePlayerToWar(uint32 BattleId, uint32 ZoneId, uint32 p_time) { - //Send packet + //Send packet WorldPacket data(SMSG_BATTLEFIELD_MGR_ENTRY_INVITE, 12); data << uint32(BattleId); data << uint32(ZoneId); @@ -65,13 +65,13 @@ void WorldSession::SendBfQueueInviteResponse(uint32 BattleId,uint32 ZoneId, bool WorldPacket data(SMSG_BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE, 11); data << uint32(BattleId); data << uint32(ZoneId); - data << uint8((CanQueue ? 1 : 0)); //Accepted //0 you cannot queue wg //1 you are queued + data << uint8((CanQueue ? 1 : 0)); //Accepted //0 you cannot queue wg //1 you are queued data << uint8((Full ? 0 : 1)); //Logging In //0 wg full //1 queue for upcoming data << uint8(1); //Warmup SendPacket(&data); } -//This is call when player accept to join war +//This is call when player accept to join war //Param1:(BattleId) the BattleId of Bf void WorldSession::SendBfEntered(uint32 BattleId) { diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index f89b1b95bc1..c86bd363c98 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -2163,7 +2163,7 @@ void WorldSession::HandleReorderCharacters(WorldPacket& recvData) recvData.ReadByteSeq(guids[i][3]); recvData >> positions[i]; - position[i] /= 10; + positions[i] /= 10; recvData.ReadByteSeq(guids[i][2]); recvData.ReadByteSeq(guids[i][7]); diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 03824cf7dc9..5c2b007493c 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -1160,7 +1160,7 @@ bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32 // team that controls the workshop in the specified area uint32 team = bf->GetData(newArea); - + if (team == TEAM_HORDE) return spellId == 56618; else if (team == TEAM_ALLIANCE) diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index e7c140c01b8..936b2d3629b 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1209,7 +1209,7 @@ void World::LoadConfigSettings(bool reload) m_int_configs[CONFIG_WINTERGRASP_BATTLETIME] = ConfigMgr::GetIntDefault("Wintergrasp.BattleTimer", 30); m_int_configs[CONFIG_WINTERGRASP_NOBATTLETIME] = ConfigMgr::GetIntDefault("Wintergrasp.NoBattleTimer", 150); m_int_configs[CONFIG_WINTERGRASP_RESTART_AFTER_CRASH] = ConfigMgr::GetIntDefault("Wintergrasp.CrashRestartTimer", 10); - + if (reload) sScriptMgr->OnConfigLoad(reload); } @@ -1722,7 +1722,7 @@ void World::SetInitialWorldSettings() ///- Initialize Battlefield sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Starting Battlefield System"); sBattlefieldMgr->InitBattlefield(); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Transports..."); sMapMgr->LoadTransports(); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp index b0c1c7ecddd..d6a0b4e3761 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp @@ -97,7 +97,7 @@ class instance_zulgurub : public InstanceMapScript default: break; } - + return true; } diff --git a/src/tools/map_extractor/CMakeLists.txt b/src/tools/map_extractor/CMakeLists.txt index af66b73827e..b84e56e5734 100644 --- a/src/tools/map_extractor/CMakeLists.txt +++ b/src/tools/map_extractor/CMakeLists.txt @@ -33,5 +33,5 @@ add_dependencies(mapextractor storm) if( UNIX ) install(TARGETS mapextractor DESTINATION bin) elseif( WIN32 ) - install(TARGETS mapextractor DESTINATION "${CMAKE_INSTALL_PREFIX}") + install(TARGETS mapextractor DESTINATION "${CMAKE_INSTALL_PREFIX}") endif() -- cgit v1.2.3 From 7c8671489561e53d7878852c1e8917863d7459b5 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 23 Aug 2012 01:54:06 +0200 Subject: Core/PacketIO: Corrected character reordering --- src/server/game/Handlers/CharacterHandler.cpp | 13 ++++++++----- .../shared/Database/Implementation/CharacterDatabase.cpp | 5 +++-- .../shared/Database/Implementation/CharacterDatabase.h | 1 + 3 files changed, 12 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index c86bd363c98..649f09ad212 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -2137,8 +2137,8 @@ void WorldSession::HandleReorderCharacters(WorldPacket& recvData) { uint32 charactersCount = recvData.ReadBits(10); - ObjectGuid guids[charactersCount]; - uint8 positions[charactersCount]; + std::vector guids(charactersCount); + uint8 position; for (uint8 i = 0; i < charactersCount; ++i) { @@ -2162,13 +2162,16 @@ void WorldSession::HandleReorderCharacters(WorldPacket& recvData) recvData.ReadByteSeq(guids[i][0]); recvData.ReadByteSeq(guids[i][3]); - recvData >> positions[i]; - positions[i] /= 10; + recvData >> position; recvData.ReadByteSeq(guids[i][2]); recvData.ReadByteSeq(guids[i][7]); - trans->PAppend("UPDATE characters SET slot = '%u' WHERE guid = '%u'", positions[i], uint64(guids[i])); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_LIST_SLOT); + stmt->setUInt8(0, position); + stmt->setUInt32(1, GUID_LOPART(guids[i])); + trans->Append(stmt); } + CharacterDatabase.CommitTransaction(trans); } diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index f99a0ad88fd..39cdbf50ca9 100755 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -38,8 +38,8 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_SEL_GUID_BY_NAME_FILTER, "SELECT guid, name FROM characters WHERE name LIKE CONCAT('%%', ?, '%%')", CONNECTION_SYNCH) PREPARE_STATEMENT(CHAR_SEL_BANINFO_LIST, "SELECT bandate, unbandate, bannedby, banreason FROM character_banned WHERE guid = ? ORDER BY unbandate", CONNECTION_SYNCH) PREPARE_STATEMENT(CHAR_SEL_BANNED_NAME, "SELECT characters.name FROM characters, character_banned WHERE character_banned.guid = ? AND character_banned.guid = characters.guid", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_SEL_ENUM, "SELECT c.guid, c.name, c.race, c.class, c.gender, c.playerBytes, c.playerBytes2, c.level, c.zone, c.map, c.position_x, c.position_y, c.position_z, gm.guildid, c.playerFlags, c.at_login, cp.entry, cp.modelid, cp.level, c.equipmentCache, cb.guid, c.slot FROM characters AS c LEFT JOIN character_pet AS cp ON c.guid = cp.owner AND cp.slot = ? LEFT JOIN guild_member AS gm ON c.guid = gm.guid LEFT JOIN character_banned AS cb ON c.guid = cb.guid AND cb.active = 1 WHERE c.account = ? ORDER BY c.guid", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_SEL_ENUM_DECLINED_NAME, "SELECT c.guid, c.name, c.race, c.class, c.gender, c.playerBytes, c.playerBytes2, c.level, c.zone, c.map, c.position_x, c.position_y, c.position_z, gm.guildid, c.playerFlags, c.at_login, cp.entry, cp.modelid, cp.level, c.equipmentCache, cb.guid, c.slot, cd.genitive FROM characters AS c LEFT JOIN character_pet AS cp ON c.guid = cp.owner AND cp.slot = ? LEFT JOIN character_declinedname AS cd ON c.guid = cd.guid LEFT JOIN guild_member AS gm ON c.guid = gm.guid LEFT JOIN character_banned AS cb ON c.guid = cb.guid AND cb.active = 1 WHERE c.account = ? ORDER BY c.guid", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_SEL_ENUM, "SELECT c.guid, c.name, c.race, c.class, c.gender, c.playerBytes, c.playerBytes2, c.level, c.zone, c.map, c.position_x, c.position_y, c.position_z, gm.guildid, c.playerFlags, c.at_login, cp.entry, cp.modelid, cp.level, c.equipmentCache, cb.guid, c.slot FROM characters AS c LEFT JOIN character_pet AS cp ON c.guid = cp.owner AND cp.slot = ? LEFT JOIN guild_member AS gm ON c.guid = gm.guid LEFT JOIN character_banned AS cb ON c.guid = cb.guid AND cb.active = 1 WHERE c.account = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_SEL_ENUM_DECLINED_NAME, "SELECT c.guid, c.name, c.race, c.class, c.gender, c.playerBytes, c.playerBytes2, c.level, c.zone, c.map, c.position_x, c.position_y, c.position_z, gm.guildid, c.playerFlags, c.at_login, cp.entry, cp.modelid, cp.level, c.equipmentCache, cb.guid, c.slot, cd.genitive FROM characters AS c LEFT JOIN character_pet AS cp ON c.guid = cp.owner AND cp.slot = ? LEFT JOIN character_declinedname AS cd ON c.guid = cd.guid LEFT JOIN guild_member AS gm ON c.guid = gm.guid LEFT JOIN character_banned AS cb ON c.guid = cb.guid AND cb.active = 1 WHERE c.account = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_SEL_PET_SLOTS, "SELECT owner, slot FROM character_pet WHERE owner = ? AND slot >= ? AND slot <= ? ORDER BY slot", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_SEL_PET_SLOTS_DETAIL, "SELECT owner, id, entry, level, name FROM character_pet WHERE owner = ? AND slot >= ? AND slot <= ? ORDER BY slot", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_SEL_PET_ENTRY, "SELECT entry FROM character_pet WHERE owner = ? AND id = ? AND slot >= ? AND slot <= ?", CONNECTION_ASYNC); @@ -555,6 +555,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_INS_CHAR_TALENT, "INSERT INTO character_talent (guid, spell, spec) VALUES (?, ?, ?)", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_DEL_CHAR_ACTION_EXCEPT_SPEC, "DELETE FROM character_action WHERE spec<>? AND guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_SEL_CHAR_PET_BY_ENTRY_AND_SLOT, "SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, abdata, savetime, CreatedBySpell, PetType FROM character_pet WHERE owner = ? AND slot = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_UPD_CHAR_LIST_SLOT, "UPDATE characters SET slot = ? WHERE guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_SEL_VOID_STORAGE, "SELECT itemId, itemEntry, slot, creatorGuid, randomProperty, suffixFactor FROM character_void_storage WHERE playerGuid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_REP_VOID_STORAGE_ITEM, "REPLACE INTO character_void_storage (itemId, playerGuid, itemEntry, slot, creatorGuid, randomProperty, suffixFactor) VALUES (?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.h b/src/server/shared/Database/Implementation/CharacterDatabase.h index 01db91320f5..91b043dbdbd 100755 --- a/src/server/shared/Database/Implementation/CharacterDatabase.h +++ b/src/server/shared/Database/Implementation/CharacterDatabase.h @@ -518,6 +518,7 @@ enum CharacterDatabaseStatements CHAR_INS_CHAR_TALENT, CHAR_DEL_CHAR_ACTION_EXCEPT_SPEC, CHAR_SEL_CHAR_PET_BY_ENTRY_AND_SLOT, + CHAR_UPD_CHAR_LIST_SLOT, CHAR_SEL_VOID_STORAGE, CHAR_REP_VOID_STORAGE_ITEM, -- cgit v1.2.3 From fa546654c36ef3545c95882017ef63327ea37037 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 23 Aug 2012 01:55:49 +0200 Subject: Core: Optimized compile time after recent changes --- src/server/game/Handlers/MovementHandler.cpp | 1 - src/server/game/Server/Protocol/Opcodes.cpp | 43 +++++++++++++++++----------- src/server/game/Server/Protocol/Opcodes.h | 35 +++++++++++----------- 3 files changed, 45 insertions(+), 34 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp index 193135c5067..0cc9263bfbd 100644 --- a/src/server/game/Handlers/MovementHandler.cpp +++ b/src/server/game/Handlers/MovementHandler.cpp @@ -422,7 +422,6 @@ void WorldSession::HandleMovementOpcodes(WorldPacket& recvPacket) void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recvData) { uint32 opcode = recvData.GetOpcode(); - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd %s (%u, 0x%X) opcode", LookupOpcodeName(Opcodes(opcode)), opcode, opcode); /* extract packet */ uint64 guid; diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index b25a7d3f1c6..f4f77dbe702 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -16,30 +16,41 @@ * with this program. If not, see . */ -/** \file - \ingroup u2w -*/ - #include "Opcodes.h" #include "WorldSession.h" OpcodeHandler* opcodeTable[NUM_OPCODE_HANDLERS] = { }; -/// Correspondence between opcodes and their names -void InitOpcodes() +template +inline void ValidateAndSetOpcode(uint16 opcode, char const* name, SessionStatus status, PacketProcessing processing, pOpcodeHandler handler) { -#define DEFINE_OPCODE_HANDLER(opcode, status, processing, handler) \ - if (opcode == 0) \ - sLog->outError(LOG_FILTER_NETWORKIO, "Opcode %s got value 0", #opcode); \ - if (opcode < NUM_OPCODE_HANDLERS) { \ - if (opcodeTable[opcode] != NULL) \ - { \ - sLog->outError(LOG_FILTER_NETWORKIO, "Tried to override handler of %s with %s (opcode %u)", \ - opcodeTable[opcode]->name, #opcode, opcode); \ - } \ - else opcodeTable[opcode] = new OpcodeHandler(#opcode, #opcode "_COMPRESSED", status, processing, handler); \ + if (opcodeTable[opcode] != NULL) + { + sLog->outError(LOG_FILTER_NETWORKIO, "Tried to override handler of %s with %s (opcode %u)", opcodeTable[opcode]->name, name, opcode); + return; } + opcodeTable[opcode] = new OpcodeHandler(name, status, processing, handler); +} + +template<> +void ValidateAndSetOpcode(uint16 opcode, char const* /*name*/, SessionStatus /*status*/, PacketProcessing /*processing*/, pOpcodeHandler /*handler*/) +{ + sLog->outError(LOG_FILTER_NETWORKIO, "Tried to set handler for an invalid opcode %d", opcode); +} + +template<> +void ValidateAndSetOpcode(uint16 /*opcode*/, char const* name, SessionStatus /*status*/, PacketProcessing /*processing*/, pOpcodeHandler /*handler*/) +{ + sLog->outError(LOG_FILTER_NETWORKIO, "Opcode %s got value 0", name); +} + +#define DEFINE_OPCODE_HANDLER(opcode, status, processing, handler) \ + ValidateAndSetOpcode<(opcode < NUM_OPCODE_HANDLERS), (opcode != 0)>(opcode, #opcode, status, processing, handler); + +/// Correspondence between opcodes and their names +void InitOpcodes() +{ memset(opcodeTable, 0, sizeof(opcodeTable)); DEFINE_OPCODE_HANDLER(CMSG_ACCEPT_LEVEL_GRANT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAcceptGrantLevel ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 63da75e8885..b4ccb87f204 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -1431,11 +1431,10 @@ typedef void(WorldSession::*pOpcodeHandler)(WorldPacket& recvPacket); struct OpcodeHandler { OpcodeHandler() {} - OpcodeHandler(char const* _name, char const* _compressedName, SessionStatus _status, PacketProcessing _processing, pOpcodeHandler _handler) - : name(_name), compressedName(_compressedName), status(_status), packetProcessing(_processing), handler(_handler) {} + OpcodeHandler(char const* _name, SessionStatus _status, PacketProcessing _processing, pOpcodeHandler _handler) + : name(_name), status(_status), packetProcessing(_processing), handler(_handler) {} char const* name; - char const* compressedName; SessionStatus status; PacketProcessing packetProcessing; pOpcodeHandler handler; @@ -1445,26 +1444,28 @@ extern OpcodeHandler* opcodeTable[NUM_OPCODE_HANDLERS]; void InitOpcodes(); /// Lookup opcode name for human understandable logging -inline const char* LookupOpcodeName(Opcodes id) +inline std::string GetOpcodeNameForLogging(Opcodes id) { + uint32 opcode = uint32(id); + std::ostringstream ss; + ss << '['; + if (id < UNKNOWN_OPCODE) { - bool isCompressed = uint32(id) & COMPRESSED_OPCODE_MASK; if (OpcodeHandler* handler = opcodeTable[uint32(id) & 0x7FFF]) - return isCompressed ? handler->compressedName : handler->name; - - return "UNKNOWN OPCODE"; + { + ss << handler->name; + if (opcode & COMPRESSED_OPCODE_MASK) + ss << "_COMPRESSED"; + } + else + ss << "UNKNOWN OPCODE"; } + else + ss << "INVALID OPCODE"; - return "INVALID OPCODE"; -} - -inline std::string GetOpcodeNameForLogging(Opcodes id) -{ - uint32 opcode = uint32(id); - std::ostringstream ss; - ss << '[' << LookupOpcodeName(id) << " 0x" << std::hex << std::uppercase << opcode << std::nouppercase << " (" << std::dec << opcode << ")]"; - return ss.str().c_str(); + ss << " 0x" << std::hex << std::uppercase << opcode << std::nouppercase << " (" << std::dec << opcode << ")]"; + return ss.str(); } #endif -- cgit v1.2.3 From bd4609e8293a3ce6ebbe40b74828ce4c34156b49 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 23 Aug 2012 12:34:36 +0200 Subject: Core/Guilds: Fixed saving bank withdraw limits for tabs 7 and 8 --- sql/base/characters_database.sql | 4 ++++ .../characters/2012_08_23_00_characters_guild_member.sql | 4 ++++ src/server/game/Guilds/Guild.cpp | 12 ++++++------ src/server/game/Guilds/GuildMgr.cpp | 4 +++- .../shared/Database/Implementation/CharacterDatabase.cpp | 6 ++++++ .../shared/Database/Implementation/CharacterDatabase.h | 6 ++++++ 6 files changed, 29 insertions(+), 7 deletions(-) create mode 100644 sql/updates/characters/2012_08_23_00_characters_guild_member.sql (limited to 'src') diff --git a/sql/base/characters_database.sql b/sql/base/characters_database.sql index 330b6936104..e9703fe0b28 100644 --- a/sql/base/characters_database.sql +++ b/sql/base/characters_database.sql @@ -1815,6 +1815,10 @@ CREATE TABLE `guild_member` ( `BankRemSlotsTab4` int(10) unsigned NOT NULL DEFAULT '0', `BankResetTimeTab5` int(10) unsigned NOT NULL DEFAULT '0', `BankRemSlotsTab5` int(10) unsigned NOT NULL DEFAULT '0', + `BankResetTimeTab6` int(10) unsigned NOT NULL DEFAULT '0', + `BankRemSlotsTab6` int(10) unsigned NOT NULL DEFAULT '0', + `BankResetTimeTab7` int(10) unsigned NOT NULL DEFAULT '0', + `BankRemSlotsTab7` int(10) unsigned NOT NULL DEFAULT '0', UNIQUE KEY `guid_key` (`guid`), KEY `guildid_key` (`guildid`), KEY `guildid_rank_key` (`guildid`,`rank`) diff --git a/sql/updates/characters/2012_08_23_00_characters_guild_member.sql b/sql/updates/characters/2012_08_23_00_characters_guild_member.sql new file mode 100644 index 00000000000..cdd4781c0c0 --- /dev/null +++ b/sql/updates/characters/2012_08_23_00_characters_guild_member.sql @@ -0,0 +1,4 @@ +ALTER TABLE guild_member ADD BankResetTimeTab6 INT(10) unsigned DEFAULT '0' AFTER BankRemSlotsTab5; +ALTER TABLE guild_member ADD BankRemSlotsTab6 INT(10) unsigned DEFAULT '0' AFTER BankResetTimeTab6; +ALTER TABLE guild_member ADD BankResetTimeTab7 INT(10) unsigned DEFAULT '0' AFTER BankRemSlotsTab6; +ALTER TABLE guild_member ADD BankRemSlotsTab7 INT(10) unsigned DEFAULT '0' AFTER BankResetTimeTab7; diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 4f8b64d7226..0bab8ab2418 100644 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -575,12 +575,12 @@ bool Guild::Member::LoadFromDB(Field* fields) m_bankRemaining[i].value = fields[8 + i * 2].GetUInt32(); } - SetStats(fields[19].GetString(), - fields[20].GetUInt8(), // characters.level - fields[21].GetUInt8(), // characters.class - fields[22].GetUInt16(), // characters.zone - fields[23].GetUInt32()); // characters.account - m_logoutTime = fields[24].GetUInt32(); // characters.logout_time + SetStats(fields[23].GetString(), + fields[24].GetUInt8(), // characters.level + fields[25].GetUInt8(), // characters.class + fields[26].GetUInt16(), // characters.zone + fields[27].GetUInt32()); // characters.account + m_logoutTime = fields[28].GetUInt32(); // characters.logout_time if (!CheckStats()) return false; diff --git a/src/server/game/Guilds/GuildMgr.cpp b/src/server/game/Guilds/GuildMgr.cpp index 4d7e2ebd4c6..473fe32ec27 100644 --- a/src/server/game/Guilds/GuildMgr.cpp +++ b/src/server/game/Guilds/GuildMgr.cpp @@ -190,7 +190,9 @@ void GuildMgr::LoadGuilds() "BankResetTimeTab0, BankRemSlotsTab0, BankResetTimeTab1, BankRemSlotsTab1, BankResetTimeTab2, BankRemSlotsTab2, " // 13 14 15 16 17 18 "BankResetTimeTab3, BankRemSlotsTab3, BankResetTimeTab4, BankRemSlotsTab4, BankResetTimeTab5, BankRemSlotsTab5, " - // 19 20 21 22 23 24 + // 19 20 21 22 + "BankResetTimeTab6, BankRemSlotsTab6, BankResetTimeTab7, BankRemSlotsTab7, " + // 23 24 25 26 27 28 "c.name, c.level, c.class, c.zone, c.account, c.logout_time " "FROM guild_member gm LEFT JOIN characters c ON c.guid = gm.guid ORDER BY guildid ASC"); diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index 39cdbf50ca9..368e70a758c 100755 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -210,6 +210,8 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_UPD_GUILD_MEMBER_BANK_REM_SLOTS3, "UPDATE guild_member SET BankRemSlotsTab3 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_UPD_GUILD_MEMBER_BANK_REM_SLOTS4, "UPDATE guild_member SET BankRemSlotsTab4 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_UPD_GUILD_MEMBER_BANK_REM_SLOTS5, "UPDATE guild_member SET BankRemSlotsTab5 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_UPD_GUILD_MEMBER_BANK_REM_SLOTS6, "UPDATE guild_member SET BankRemSlotsTab6 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_UPD_GUILD_MEMBER_BANK_REM_SLOTS7, "UPDATE guild_member SET BankRemSlotsTab7 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC) // 0: uint32, 1: uint32, 2: uint32, 3: uint32 PREPARE_STATEMENT(CHAR_UPD_GUILD_MEMBER_BANK_TIME_REM_SLOTS0, "UPDATE guild_member SET BankResetTimeTab0 = ?, BankRemSlotsTab0 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_UPD_GUILD_MEMBER_BANK_TIME_REM_SLOTS1, "UPDATE guild_member SET BankResetTimeTab1 = ?, BankRemSlotsTab1 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC) @@ -217,6 +219,8 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_UPD_GUILD_MEMBER_BANK_TIME_REM_SLOTS3, "UPDATE guild_member SET BankResetTimeTab3 = ?, BankRemSlotsTab3 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_UPD_GUILD_MEMBER_BANK_TIME_REM_SLOTS4, "UPDATE guild_member SET BankResetTimeTab4 = ?, BankRemSlotsTab4 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_UPD_GUILD_MEMBER_BANK_TIME_REM_SLOTS5, "UPDATE guild_member SET BankResetTimeTab5 = ?, BankRemSlotsTab5 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_UPD_GUILD_MEMBER_BANK_TIME_REM_SLOTS6, "UPDATE guild_member SET BankResetTimeTab6 = ?, BankRemSlotsTab6 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_UPD_GUILD_MEMBER_BANK_TIME_REM_SLOTS7, "UPDATE guild_member SET BankResetTimeTab7 = ?, BankRemSlotsTab7 = ? WHERE guildid = ? AND guid = ?", CONNECTION_ASYNC) // 0: uint32, 1: uint8 PREPARE_STATEMENT(CHAR_UPD_GUILD_RANK_BANK_TIME0, "UPDATE guild_member SET BankResetTimeTab0 = 0 WHERE guildid = ? AND rank = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_UPD_GUILD_RANK_BANK_TIME1, "UPDATE guild_member SET BankResetTimeTab1 = 0 WHERE guildid = ? AND rank = ?", CONNECTION_ASYNC) @@ -224,6 +228,8 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_UPD_GUILD_RANK_BANK_TIME3, "UPDATE guild_member SET BankResetTimeTab3 = 0 WHERE guildid = ? AND rank = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_UPD_GUILD_RANK_BANK_TIME4, "UPDATE guild_member SET BankResetTimeTab4 = 0 WHERE guildid = ? AND rank = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_UPD_GUILD_RANK_BANK_TIME5, "UPDATE guild_member SET BankResetTimeTab5 = 0 WHERE guildid = ? AND rank = ?", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_UPD_GUILD_RANK_BANK_TIME6, "UPDATE guild_member SET BankResetTimeTab6 = 0 WHERE guildid = ? AND rank = ?", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_UPD_GUILD_RANK_BANK_TIME7, "UPDATE guild_member SET BankResetTimeTab7 = 0 WHERE guildid = ? AND rank = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_CHAR_DATA_FOR_GUILD, "SELECT name, level, class, zone, account FROM characters WHERE guid = ?", CONNECTION_SYNCH) PREPARE_STATEMENT(CHAR_DEL_GUILD_ACHIEVEMENT, "DELETE FROM guild_achievement WHERE guildId = ? AND achievement = ?", CONNECTION_SYNCH) PREPARE_STATEMENT(CHAR_INS_GUILD_ACHIEVEMENT, "INSERT INTO guild_achievement (guildId, achievement, date, guids) VALUES (?, ?, ?, ?)", CONNECTION_SYNCH) diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.h b/src/server/shared/Database/Implementation/CharacterDatabase.h index 91b043dbdbd..8c7042ad926 100755 --- a/src/server/shared/Database/Implementation/CharacterDatabase.h +++ b/src/server/shared/Database/Implementation/CharacterDatabase.h @@ -207,18 +207,24 @@ enum CharacterDatabaseStatements CHAR_UPD_GUILD_MEMBER_BANK_TIME_REM_SLOTS3, CHAR_UPD_GUILD_MEMBER_BANK_TIME_REM_SLOTS4, CHAR_UPD_GUILD_MEMBER_BANK_TIME_REM_SLOTS5, + CHAR_UPD_GUILD_MEMBER_BANK_TIME_REM_SLOTS6, + CHAR_UPD_GUILD_MEMBER_BANK_TIME_REM_SLOTS7, CHAR_UPD_GUILD_MEMBER_BANK_REM_SLOTS0, CHAR_UPD_GUILD_MEMBER_BANK_REM_SLOTS1, CHAR_UPD_GUILD_MEMBER_BANK_REM_SLOTS2, CHAR_UPD_GUILD_MEMBER_BANK_REM_SLOTS3, CHAR_UPD_GUILD_MEMBER_BANK_REM_SLOTS4, CHAR_UPD_GUILD_MEMBER_BANK_REM_SLOTS5, + CHAR_UPD_GUILD_MEMBER_BANK_REM_SLOTS6, + CHAR_UPD_GUILD_MEMBER_BANK_REM_SLOTS7, CHAR_UPD_GUILD_RANK_BANK_TIME0, CHAR_UPD_GUILD_RANK_BANK_TIME1, CHAR_UPD_GUILD_RANK_BANK_TIME2, CHAR_UPD_GUILD_RANK_BANK_TIME3, CHAR_UPD_GUILD_RANK_BANK_TIME4, CHAR_UPD_GUILD_RANK_BANK_TIME5, + CHAR_UPD_GUILD_RANK_BANK_TIME6, + CHAR_UPD_GUILD_RANK_BANK_TIME7, CHAR_SEL_CHAR_DATA_FOR_GUILD, CHAR_DEL_GUILD_ACHIEVEMENT, CHAR_INS_GUILD_ACHIEVEMENT, -- cgit v1.2.3 From dbda9b549cab53a93c54f55347283c71f33635c3 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 23 Aug 2012 15:35:53 +0200 Subject: Core/PacketIO: Updated SMSG_GUILD_BANK_LIST --- src/server/game/Guilds/Guild.cpp | 230 +++++++++++++++------------- src/server/game/Guilds/Guild.h | 17 +- src/server/game/Handlers/GuildHandler.cpp | 4 +- src/server/game/Server/Protocol/Opcodes.cpp | 12 +- src/server/shared/Packets/ByteBuffer.h | 3 +- 5 files changed, 138 insertions(+), 128 deletions(-) (limited to 'src') diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 0bab8ab2418..4b193b62b2b 100644 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -370,48 +370,6 @@ void Guild::BankTab::Delete(SQLTransaction& trans, bool removeItemsFromDB) } } -inline void Guild::BankTab::WritePacket(WorldPacket& data) const -{ - data << uint8(GUILD_BANK_MAX_SLOTS); - for (uint8 slotId = 0; slotId < GUILD_BANK_MAX_SLOTS; ++slotId) - WriteSlotPacket(data, slotId); -} - -// Writes information about contents of specified slot into packet. -void Guild::BankTab::WriteSlotPacket(WorldPacket& data, uint8 slotId) const -{ - Item* pItem = GetItem(slotId); - uint32 itemEntry = pItem ? pItem->GetEntry() : 0; - - data << uint8(slotId); - data << uint32(itemEntry); - if (itemEntry) - { - data << uint32(0); // 3.3.0 (0x00018020, 0x00018000) - data << uint32(pItem->GetItemRandomPropertyId()); // Random item property id - - if (pItem->GetItemRandomPropertyId()) - data << uint32(pItem->GetItemSuffixFactor()); // SuffixFactor - - data << uint32(pItem->GetCount()); // ITEM_FIELD_STACK_COUNT - data << uint32(0); - data << uint8(abs(pItem->GetSpellCharges())); // Spell charges - - uint8 enchCount = 0; - size_t enchCountPos = data.wpos(); - - data << uint8(enchCount); // Number of enchantments - for (uint32 i = PERM_ENCHANTMENT_SLOT; i < MAX_ENCHANTMENT_SLOT; ++i) - if (uint32 enchId = pItem->GetEnchantmentId(EnchantmentSlot(i))) - { - data << uint8(i); - data << uint32(enchId); - ++enchCount; - } - data.put(enchCountPos, enchCount); - } -} - void Guild::BankTab::SetInfo(const std::string& name, const std::string& icon) { if (m_name == name && m_icon == icon) @@ -1436,8 +1394,7 @@ void Guild::HandleSetBankTabInfo(WorldSession* session, uint8 tabId, const std:: if (BankTab* pTab = GetBankTab(tabId)) { pTab->SetInfo(name, icon); - SendBankTabsInfo(session); - _SendBankContent(session, tabId); + SendBankList(session, tabId, true, true); } } @@ -1498,7 +1455,7 @@ void Guild::HandleBuyBankTab(WorldSession* session, uint8 tabId) _SetRankBankMoneyPerDay(player->GetRank(), uint32(GUILD_WITHDRAW_MONEY_UNLIMITED)); _SetRankBankTabRightsAndSlots(player->GetRank(), tabId, GuildBankRightsAndSlots(GUILD_BANK_RIGHT_FULL, uint32(GUILD_WITHDRAW_SLOT_UNLIMITED))); HandleRoster(); // Broadcast for tab rights update - SendBankTabsInfo(session); + SendBankList(session, tabId, false, true); } void Guild::HandleInviteMember(WorldSession* session, const std::string& name) @@ -1822,9 +1779,7 @@ void Guild::HandleMemberDepositMoney(WorldSession* session, uint32 amount) CharacterDatabase.CommitTransaction(trans); - SendBankTabsInfo(session); - _SendBankContent(session, 0); - _SendBankMoneyUpdate(session); + SendBankList(session, 0, false, false); } bool Guild::HandleMemberWithdrawMoney(WorldSession* session, uint32 amount, bool repair) @@ -1865,11 +1820,7 @@ bool Guild::HandleMemberWithdrawMoney(WorldSession* session, uint32 amount, bool SendMoneyInfo(session); if (!repair) - { - SendBankTabsInfo(session); - _SendBankContent(session, 0); - _SendBankMoneyUpdate(session); - } + SendBankList(session, 0, false, false); return true; } @@ -1940,29 +1891,86 @@ void Guild::SendBankLog(WorldSession* session, uint8 tabId) const } } -void Guild::SendBankTabData(WorldSession* session, uint8 tabId) const +void Guild::SendBankList(WorldSession* session, uint8 tabId, bool withContent, bool withTabInfo) const { - if (tabId < _GetPurchasedTabsSize()) + ByteBuffer tabData; + WorldPacket data(SMSG_GUILD_BANK_LIST, 500); + data.WriteBit(0); + uint32 itemCount = 0; + if (withContent && _MemberHasTabRights(session->GetPlayer()->GetGUID(), tabId, GUILD_BANK_RIGHT_VIEW_TAB)) + if (BankTab const* tab = GetBankTab(tabId)) + for (uint8 slotId = 0; slotId < GUILD_BANK_MAX_SLOTS; ++slotId) + if (Item* tabItem = tab->GetItem(slotId)) + ++itemCount; + + data.WriteBits(itemCount, 20); + data.WriteBits(withTabInfo ? _GetPurchasedTabsSize() : 0, 22); + if (withContent && _MemberHasTabRights(session->GetPlayer()->GetGUID(), tabId, GUILD_BANK_RIGHT_VIEW_TAB)) + { + if (BankTab const* tab = GetBankTab(tabId)) + { + for (uint8 slotId = 0; slotId < GUILD_BANK_MAX_SLOTS; ++slotId) + { + if (Item* tabItem = tab->GetItem(slotId)) + { + data.WriteBit(0); + + uint32 enchants = 0; + for (uint32 ench = 0; ench < MAX_ENCHANTMENT_SLOT; ++ench) + { + if (uint32 enchantId = tabItem->GetEnchantmentId(EnchantmentSlot(ench))) + { + tabData << uint32(enchantId); + tabData << uint32(ench); + ++enchants; + } + } + + data.WriteBits(enchants, 23); + + tabData << uint32(0); + tabData << uint32(0); + tabData << uint32(0); + tabData << uint32(tabItem->GetCount()); // ITEM_FIELD_STACK_COUNT + tabData << uint32(slotId); + tabData << uint32(0); + tabData << uint32(tabItem->GetEntry()); + tabData << uint32(tabItem->GetItemRandomPropertyId()); + tabData << uint32(abs(tabItem->GetSpellCharges())); // Spell charges + tabData << uint32(tabItem->GetItemSuffixFactor()); // SuffixFactor + } + } + } + } + + if (withTabInfo) { - SendMoneyInfo(session); - _SendBankContent(session, tabId); + for (uint8 i = 0; i < _GetPurchasedTabsSize(); ++i) + { + data.WriteBits(m_bankTabs[i]->GetIcon().length(), 9); + data.WriteBits(m_bankTabs[i]->GetName().length(), 7); + } } -} -void Guild::SendBankTabsInfo(WorldSession* session) const -{ - WorldPacket data(SMSG_GUILD_BANK_LIST, 500); + data.FlushBits(); + + if (withTabInfo) + { + for (uint8 i = 0; i < _GetPurchasedTabsSize(); ++i) + { + data.WriteString(m_bankTabs[i]->GetIcon()); + data << uint32(i); + data.WriteString(m_bankTabs[i]->GetName()); + } + } data << uint64(m_bankMoney); - data << uint8(0); // TabInfo packet must be for tabId 0 - data << uint32(_GetMemberRemainingSlots(session->GetPlayer()->GetGUID(), 0)); - data << uint8(1); // Tell client that this packet includes tab info + if (!tabData.empty()) + data.append(tabData); - data << uint8(_GetPurchasedTabsSize()); // Number of tabs - for (uint8 i = 0; i < _GetPurchasedTabsSize(); ++i) - m_bankTabs[i]->WriteInfoPacket(data); + data << uint32(tabId); + data << uint32(_GetMemberRemainingSlots(session->GetPlayer()->GetGUID(), 0)); - data << uint8(0); // Do not send tab content session->SendPacket(&data); sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Sent (SMSG_GUILD_BANK_LIST)"); @@ -2880,41 +2888,6 @@ bool Guild::_DoItemsMove(MoveItemData* pSrc, MoveItemData* pDest, bool sendError return true; } -void Guild::_SendBankContent(WorldSession* session, uint8 tabId) const -{ - uint64 guid = session->GetPlayer()->GetGUID(); - if (_MemberHasTabRights(guid, tabId, GUILD_BANK_RIGHT_VIEW_TAB)) - if (const BankTab* pTab = GetBankTab(tabId)) - { - WorldPacket data(SMSG_GUILD_BANK_LIST, 1200); - - data << uint64(m_bankMoney); - data << uint8(tabId); - data << uint32(_GetMemberRemainingSlots(guid, tabId)); - data << uint8(0); // Tell client that there's no tab info in this packet - - pTab->WritePacket(data); - - session->SendPacket(&data); - - sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Sent (SMSG_GUILD_BANK_LIST)"); - } -} - -void Guild::_SendBankMoneyUpdate(WorldSession* session) const -{ - WorldPacket data(SMSG_GUILD_BANK_LIST, 8 + 1 + 4 + 1 + 1); - - data << uint64(m_bankMoney); - data << uint8(0); // tabId, default 0 - data << uint32(_GetMemberRemainingSlots(session->GetPlayer()->GetGUID(), 0)); - data << uint8(0); // Tell that there's no tab info in this packet - data << uint8(0); // No items - BroadcastPacket(&data); - - sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Sent (SMSG_GUILD_BANK_LIST)"); -} - void Guild::_SendBankContentUpdate(MoveItemData* pSrc, MoveItemData* pDest) const { ASSERT(pSrc->IsBank() || pDest->IsBank()); @@ -2943,6 +2916,7 @@ void Guild::_SendBankContentUpdate(MoveItemData* pSrc, MoveItemData* pDest) cons tabId = pDest->GetContainer(); pDest->CopySlots(slots); } + _SendBankContentUpdate(tabId, slots); } @@ -2950,19 +2924,55 @@ void Guild::_SendBankContentUpdate(uint8 tabId, SlotIds slots) const { if (BankTab const* tab = GetBankTab(tabId)) { + ByteBuffer tabData; WorldPacket data(SMSG_GUILD_BANK_LIST, 1200); + data.WriteBit(0); + data.WriteBits(slots.size(), 20); // Item count + data.WriteBits(0, 22); // Tab count + + for (SlotIds::const_iterator itr = slots.begin(); itr != slots.end(); ++itr) + { + data.WriteBit(0); + + Item const* tabItem = tab->GetItem(*itr); + uint32 enchantCount = 0; + if (tabItem) + { + for (uint32 enchSlot = 0; enchSlot < MAX_ENCHANTMENT_SLOT; ++enchSlot) + { + if (uint32 enchantId = tabItem->GetEnchantmentId(EnchantmentSlot(enchSlot))) + { + tabData << uint32(enchantId); + tabData << uint32(enchSlot); + ++enchantCount; + } + } + } + + data.WriteBits(enchantCount, 23); // enchantment count + + tabData << uint32(0); + tabData << uint32(0); + tabData << uint32(0); + tabData << uint32(tabItem ? tabItem->GetCount() : 0); // ITEM_FIELD_STACK_COUNT + tabData << uint32(*itr); + tabData << uint32(0); + tabData << uint32(tabItem ? tabItem->GetEntry() : 0); + tabData << uint32(tabItem ? tabItem->GetItemRandomPropertyId() : 0); + tabData << uint32(tabItem ? abs(tabItem->GetSpellCharges()) : 0); // Spell charges + tabData << uint32(tabItem ? tabItem->GetItemSuffixFactor() : 0); // SuffixFactor + } + + data.FlushBits(); data << uint64(m_bankMoney); - data << uint8(tabId); + if (!tabData.empty()) + data.append(tabData); + + data << uint32(tabId); size_t rempos = data.wpos(); data << uint32(0); // Item withdraw amount, will be filled later - data << uint8(0); // Tell client that there's no tab info in this packet - - data << uint8(slots.size()); - for (uint8 slotId = 0; slotId < GUILD_BANK_MAX_SLOTS; ++slotId) - if (slots.find(slotId) != slots.end()) - tab->WriteSlotPacket(data, slotId); for (Members::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr) if (_MemberHasTabRights(itr->second->GetGUID(), tabId, GUILD_BANK_RIGHT_VIEW_TAB)) diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h index c4ec165d4ab..67888f636ff 100755 --- a/src/server/game/Guilds/Guild.h +++ b/src/server/game/Guilds/Guild.h @@ -502,18 +502,14 @@ private: bool LoadItemFromDB(Field* fields); void Delete(SQLTransaction& trans, bool removeItemsFromDB = false); - void WritePacket(WorldPacket& data) const; - void WriteSlotPacket(WorldPacket& data, uint8 slotId) const; - void WriteInfoPacket(WorldPacket& data) const - { - data << m_name; - data << m_icon; - } - void SetInfo(const std::string& name, const std::string& icon); void SetText(const std::string& text); void SendText(const Guild* guild, WorldSession* session) const; + std::string const& GetName() const { return m_name; } + std::string const& GetIcon() const { return m_icon; } + std::string const& GetText() const { return m_text; } + inline Item* GetItem(uint8 slotId) const { return slotId < GUILD_BANK_MAX_SLOTS ? m_items[slotId] : NULL; } bool SetItem(SQLTransaction& trans, uint8 slotId, Item* pItem); @@ -664,8 +660,7 @@ public: // Send info to client void SendEventLog(WorldSession* session) const; void SendBankLog(WorldSession* session, uint8 tabId) const; - void SendBankTabsInfo(WorldSession* session) const; - void SendBankTabData(WorldSession* session, uint8 tabId) const; + void SendBankList(WorldSession* session, uint8 tabId, bool withContent, bool withTabInfo) const; void SendBankTabText(WorldSession* session, uint8 tabId) const; void SendPermissions(WorldSession* session) const; void SendMoneyInfo(WorldSession* session) const; @@ -814,8 +809,6 @@ private: void _MoveItems(MoveItemData* pSrc, MoveItemData* pDest, uint32 splitedAmount); bool _DoItemsMove(MoveItemData* pSrc, MoveItemData* pDest, bool sendError, uint32 splitedAmount = 0); - void _SendBankContent(WorldSession* session, uint8 tabId) const; - void _SendBankMoneyUpdate(WorldSession* session) const; void _SendBankContentUpdate(MoveItemData* pSrc, MoveItemData* pDest) const; void _SendBankContentUpdate(uint8 tabId, SlotIds slots) const; diff --git a/src/server/game/Handlers/GuildHandler.cpp b/src/server/game/Handlers/GuildHandler.cpp index ff9189ff704..778ecc2659f 100755 --- a/src/server/game/Handlers/GuildHandler.cpp +++ b/src/server/game/Handlers/GuildHandler.cpp @@ -433,7 +433,7 @@ void WorldSession::HandleGuildBankerActivate(WorldPacket& recvData) if (GetPlayer()->GetGameObjectIfCanInteractWith(GoGuid, GAMEOBJECT_TYPE_GUILD_BANK)) { if (Guild* guild = _GetPlayerGuild(this)) - guild->SendBankTabsInfo(this); + guild->SendBankList(this, 0, true, true); else Guild::SendCommandResult(this, GUILD_UNK1, ERR_GUILD_PLAYER_NOT_IN_GUILD); } @@ -455,7 +455,7 @@ void WorldSession::HandleGuildBankQueryTab(WorldPacket & recvData) if (GetPlayer()->GetGameObjectIfCanInteractWith(GoGuid, GAMEOBJECT_TYPE_GUILD_BANK)) if (Guild* guild = _GetPlayerGuild(this)) - guild->SendBankTabData(this, tabId); + guild->SendBankList(this, tabId, true, false); } void WorldSession::HandleGuildBankDepositMoney(WorldPacket & recvData) diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index f4f77dbe702..7138b90ba23 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -22,7 +22,13 @@ OpcodeHandler* opcodeTable[NUM_OPCODE_HANDLERS] = { }; template -inline void ValidateAndSetOpcode(uint16 opcode, char const* name, SessionStatus status, PacketProcessing processing, pOpcodeHandler handler) +inline void ValidateAndSetOpcode(uint16 /*opcode*/, char const* /*name*/, SessionStatus /*status*/, PacketProcessing /*processing*/, pOpcodeHandler /*handler*/) +{ + // if for some reason we are here, that means NUM_OPCODE_HANDLERS == 0 (or your compiler is broken) +} + +template<> +void ValidateAndSetOpcode(uint16 opcode, char const* name, SessionStatus status, PacketProcessing processing, pOpcodeHandler handler) { if (opcodeTable[opcode] != NULL) { @@ -40,7 +46,7 @@ void ValidateAndSetOpcode(uint16 opcode, char const* /*name*/, Sess } template<> -void ValidateAndSetOpcode(uint16 /*opcode*/, char const* name, SessionStatus /*status*/, PacketProcessing /*processing*/, pOpcodeHandler /*handler*/) +void ValidateAndSetOpcode(uint16 /*opcode*/, char const* name, SessionStatus /*status*/, PacketProcessing /*processing*/, pOpcodeHandler /*handler*/) { sLog->outError(LOG_FILTER_NETWORKIO, "Opcode %s got value 0", name); } @@ -843,7 +849,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_GUILD_ACHIEVEMENT_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_ACHIEVEMENT_EARNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_ACHIEVEMENT_MEMBERS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_LIST, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_LOG_QUERY_RESULTS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_MONEY_WITHDRAWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_QUERY_TEXT_RESULTS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h index 4386ce03d42..0b08b4118d4 100755 --- a/src/server/shared/Packets/ByteBuffer.h +++ b/src/server/shared/Packets/ByteBuffer.h @@ -456,7 +456,8 @@ class ByteBuffer //! without null-terminating the string void WriteString(std::string const& str) { - append(str.c_str(), str.length()); + if (size_t len = str.length()) + append(str.c_str(), len); } const uint8 *contents() const { return &_storage[0]; } -- cgit v1.2.3 From 7891ee3e63524ddeb00761af53306104571e0c9d Mon Sep 17 00:00:00 2001 From: Tuxity Date: Thu, 23 Aug 2012 16:24:39 +0200 Subject: Core/AuctionHouse: Update Auction House to 4.3.4 --- src/server/game/AuctionHouse/AuctionHouseMgr.cpp | 53 ++++----- src/server/game/AuctionHouse/AuctionHouseMgr.h | 22 ++-- src/server/game/Handlers/AuctionHouseHandler.cpp | 130 +++++++++++++---------- src/server/game/Server/Protocol/Opcodes.cpp | 30 +++--- src/server/game/Server/Protocol/Opcodes.h | 4 +- src/server/game/Server/WorldSession.h | 3 +- 6 files changed, 135 insertions(+), 107 deletions(-) (limited to 'src') diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp index 952c49ffdf5..4c934991d44 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp @@ -89,7 +89,7 @@ uint32 AuctionHouseMgr::GetAuctionDeposit(AuctionHouseEntry const* entry, uint32 //does not clear ram void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry* auction, SQLTransaction& trans) { - Item* pItem = GetAItem(auction->item_guidlow); + Item* pItem = GetAItem(auction->itemGUIDLow); if (!pItem) return; @@ -143,7 +143,7 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry* auction, SQLTransaction& if (bidder) { - bidder->GetSession()->SendAuctionBidderNotification(auction->GetHouseId(), auction->Id, bidder_guid, 0, 0, auction->item_template); + bidder->GetSession()->SendAuctionBidderNotification(auction->GetHouseId(), auction->Id, bidder_guid, 0, 0, auction->itemEntry); // FIXME: for offline player need also bidder->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WON_AUCTIONS, 1); } @@ -195,7 +195,7 @@ void AuctionHouseMgr::SendAuctionSuccessfulMail(AuctionEntry* auction, SQLTransa void AuctionHouseMgr::SendAuctionExpiredMail(AuctionEntry* auction, SQLTransaction& trans) { //return an item in auction to its owner by mail - Item* pItem = GetAItem(auction->item_guidlow); + Item* pItem = GetAItem(auction->itemGUIDLow); if (!pItem) return; @@ -228,7 +228,7 @@ void AuctionHouseMgr::SendAuctionOutbiddedMail(AuctionEntry* auction, uint32 new if (oldBidder || oldBidder_accId) { if (oldBidder && newBidder) - oldBidder->GetSession()->SendAuctionBidderNotification(auction->GetHouseId(), auction->Id, newBidder->GetGUID(), newPrice, auction->GetAuctionOutBid(), auction->item_template); + oldBidder->GetSession()->SendAuctionBidderNotification(auction->GetHouseId(), auction->Id, newBidder->GetGUID(), newPrice, auction->GetAuctionOutBid(), auction->itemEntry); MailDraft(auction->BuildAuctionMailSubject(AUCTION_OUTBIDDED), AuctionEntry::BuildAuctionMailBody(auction->owner, auction->bid, auction->buyout, auction->deposit, auction->GetAuctionCut())) .AddMoney(auction->bid) @@ -237,7 +237,7 @@ void AuctionHouseMgr::SendAuctionOutbiddedMail(AuctionEntry* auction, uint32 new } //this function sends mail, when auction is cancelled to old bidder -void AuctionHouseMgr::SendAuctionCancelledToBidderMail(AuctionEntry* auction, SQLTransaction& trans) +void AuctionHouseMgr::SendAuctionCancelledToBidderMail(AuctionEntry* auction, SQLTransaction& trans, Item* item) { uint64 bidder_guid = MAKE_NEW_GUID(auction->bidder, 0, HIGHGUID_PLAYER); Player* bidder = ObjectAccessor::FindPlayer(bidder_guid); @@ -246,6 +246,9 @@ void AuctionHouseMgr::SendAuctionCancelledToBidderMail(AuctionEntry* auction, SQ if (!bidder) bidder_accId = sObjectMgr->GetPlayerAccountIdByGUID(bidder_guid); + if (bidder) + bidder->GetSession()->SendAuctionRemovedNotification(auction->Id, auction->itemEntry, item->GetItemRandomPropertyId()); + // bidder exist if (bidder || bidder_accId) MailDraft(auction->BuildAuctionMailSubject(AUCTION_CANCELLED_TO_BIDDER), AuctionEntry::BuildAuctionMailBody(auction->owner, auction->bid, auction->buyout, auction->deposit, 0)) @@ -275,17 +278,17 @@ void AuctionHouseMgr::LoadAuctionItems() Field* fields = result->Fetch(); uint32 item_guid = fields[11].GetUInt32(); - uint32 item_template = fields[12].GetUInt32(); + uint32 itemEntry = fields[12].GetUInt32(); - ItemTemplate const* proto = sObjectMgr->GetItemTemplate(item_template); + ItemTemplate const* proto = sObjectMgr->GetItemTemplate(itemEntry); if (!proto) { - sLog->outError(LOG_FILTER_GENERAL, "AuctionHouseMgr::LoadAuctionItems: Unknown item (GUID: %u id: #%u) in auction, skipped.", item_guid, item_template); + sLog->outError(LOG_FILTER_GENERAL, "AuctionHouseMgr::LoadAuctionItems: Unknown item (GUID: %u id: #%u) in auction, skipped.", item_guid, itemEntry); continue; } Item* item = NewItemOrBag(proto); - if (!item->LoadFromDB(item_guid, 0, fields, item_template)) + if (!item->LoadFromDB(item_guid, 0, fields, itemEntry)) { delete item; continue; @@ -411,7 +414,7 @@ void AuctionHouseObject::AddAuction(AuctionEntry* auction) sScriptMgr->OnAuctionAdd(this, auction); } -bool AuctionHouseObject::RemoveAuction(AuctionEntry* auction, uint32 /*item_template*/) +bool AuctionHouseObject::RemoveAuction(AuctionEntry* auction, uint32 /*itemEntry*/) { bool wasInMap = AuctionsMap.erase(auction->Id) ? true : false; @@ -465,14 +468,14 @@ void AuctionHouseObject::Update() sScriptMgr->OnAuctionSuccessful(this, auction); } - uint32 item_template = auction->item_template; + uint32 itemEntry = auction->itemEntry; ///- In any case clear the auction auction->DeleteFromDB(trans); CharacterDatabase.CommitTransaction(trans); - RemoveAuction(auction, item_template); - sAuctionMgr->RemoveAItem(auction->item_guidlow); + RemoveAuction(auction, itemEntry); + sAuctionMgr->RemoveAItem(auction->itemGUIDLow); } while (result->NextRow()); } @@ -518,7 +521,7 @@ void AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player for (AuctionEntryMap::const_iterator itr = AuctionsMap.begin(); itr != AuctionsMap.end(); ++itr) { AuctionEntry* Aentry = itr->second; - Item* item = sAuctionMgr->GetAItem(Aentry->item_guidlow); + Item* item = sAuctionMgr->GetAItem(Aentry->itemGUIDLow); if (!item) continue; @@ -601,10 +604,10 @@ void AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player //this function inserts to WorldPacket auction's data bool AuctionEntry::BuildAuctionInfo(WorldPacket& data) const { - Item* item = sAuctionMgr->GetAItem(item_guidlow); + Item* item = sAuctionMgr->GetAItem(itemGUIDLow); if (!item) { - sLog->outError(LOG_FILTER_GENERAL, "AuctionEntry::BuildAuctionInfo: Auction %u has a non-existent item: %u", Id, item_guidlow); + sLog->outError(LOG_FILTER_GENERAL, "AuctionEntry::BuildAuctionInfo: Auction %u has a non-existent item: %u", Id, itemGUIDLow); return false; } data << uint32(Id); @@ -658,7 +661,7 @@ void AuctionEntry::SaveToDB(SQLTransaction& trans) const PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_AUCTION); stmt->setUInt32(0, Id); stmt->setUInt32(1, auctioneer); - stmt->setUInt32(2, item_guidlow); + stmt->setUInt32(2, itemGUIDLow); stmt->setUInt32(3, owner); stmt->setInt32 (4, int32(buyout)); stmt->setUInt64(5, uint64(expire_time)); @@ -673,8 +676,8 @@ bool AuctionEntry::LoadFromDB(Field* fields) { Id = fields[0].GetUInt32(); auctioneer = fields[1].GetUInt32(); - item_guidlow = fields[2].GetUInt32(); - item_template = fields[3].GetUInt32(); + itemGUIDLow = fields[2].GetUInt32(); + itemEntry = fields[3].GetUInt32(); itemCount = fields[4].GetUInt32(); owner = fields[5].GetUInt32(); buyout = fields[6].GetUInt32(); @@ -707,10 +710,10 @@ bool AuctionEntry::LoadFromDB(Field* fields) } // check if sold item exists for guid - // and item_template in fact (GetAItem will fail if problematic in result check in AuctionHouseMgr::LoadAuctionItems) - if (!sAuctionMgr->GetAItem(item_guidlow)) + // and itemEntry in fact (GetAItem will fail if problematic in result check in AuctionHouseMgr::LoadAuctionItems) + if (!sAuctionMgr->GetAItem(itemGUIDLow)) { - sLog->outError(LOG_FILTER_GENERAL, "Auction %u has not a existing item : %u", Id, item_guidlow); + sLog->outError(LOG_FILTER_GENERAL, "Auction %u has not a existing item : %u", Id, itemGUIDLow); return false; } return true; @@ -795,8 +798,8 @@ bool AuctionEntry::LoadFromFieldList(Field* fields) Id = fields[0].GetUInt32(); auctioneer = fields[1].GetUInt32(); - item_guidlow = fields[2].GetUInt32(); - item_template = fields[3].GetUInt32(); + itemGUIDLow = fields[2].GetUInt32(); + itemEntry = fields[3].GetUInt32(); itemCount = fields[4].GetUInt32(); owner = fields[5].GetUInt32(); buyout = fields[6].GetUInt32(); @@ -835,7 +838,7 @@ bool AuctionEntry::LoadFromFieldList(Field* fields) std::string AuctionEntry::BuildAuctionMailSubject(MailAuctionAnswers response) const { std::ostringstream strm; - strm << item_template << ":0:" << response << ':' << Id << ':' << itemCount; + strm << itemEntry << ":0:" << response << ':' << Id << ':' << itemCount; return strm.str(); } diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.h b/src/server/game/AuctionHouse/AuctionHouseMgr.h index 049440f99d0..b7080101588 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.h +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.h @@ -34,11 +34,15 @@ class WorldPacket; enum AuctionError { - AUCTION_OK = 0, - AUCTION_INTERNAL_ERROR = 2, - AUCTION_NOT_ENOUGHT_MONEY = 3, - AUCTION_ITEM_NOT_FOUND = 4, - CANNOT_BID_YOUR_AUCTION_ERROR = 10 + ERR_AUCTION_OK = 0, + ERR_AUCTION_INVENTORY = 1, + ERR_AUCTION_DATABASE_ERROR = 2, + ERR_AUCTION_NOT_ENOUGHT_MONEY = 3, + ERR_AUCTION_ITEM_NOT_FOUND = 4, + ERR_AUCTION_HIGHER_BID = 5, + ERR_AUCTION_BID_INCREMENT = 7, + ERR_AUCTION_BID_OWN = 10, + ERR_RESTRICTED_ACCOUNT = 13, }; enum AuctionAction @@ -63,8 +67,8 @@ struct AuctionEntry { uint32 Id; uint32 auctioneer; // creature low guid - uint32 item_guidlow; - uint32 item_template; + uint32 itemGUIDLow; + uint32 itemEntry; uint32 itemCount; uint32 owner; uint32 startbid; //maybe useless @@ -118,7 +122,7 @@ class AuctionHouseObject void AddAuction(AuctionEntry* auction); - bool RemoveAuction(AuctionEntry* auction, uint32 item_template); + bool RemoveAuction(AuctionEntry* auction, uint32 itemEntry); void Update(); @@ -166,7 +170,7 @@ class AuctionHouseMgr void SendAuctionSuccessfulMail(AuctionEntry* auction, SQLTransaction& trans); void SendAuctionExpiredMail(AuctionEntry* auction, SQLTransaction& trans); void SendAuctionOutbiddedMail(AuctionEntry* auction, uint32 newPrice, Player* newBidder, SQLTransaction& trans); - void SendAuctionCancelledToBidderMail(AuctionEntry* auction, SQLTransaction& trans); + void SendAuctionCancelledToBidderMail(AuctionEntry* auction, SQLTransaction& trans, Item* item); static uint32 GetAuctionDeposit(AuctionHouseEntry const* entry, uint32 time, Item* pItem, uint32 count); static AuctionHouseEntry const* GetAuctionHouseEntry(uint32 factionTemplateId); diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp index 122102b76f3..dd7d7fc58b9 100644 --- a/src/server/game/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Handlers/AuctionHouseHandler.cpp @@ -73,19 +73,34 @@ void WorldSession::SendAuctionHello(uint64 guid, Creature* unit) } //call this method when player bids, creates, or deletes auction -void WorldSession::SendAuctionCommandResult(uint32 auctionId, uint32 Action, uint32 ErrorCode, uint32 bidError) +void WorldSession::SendAuctionCommandResult(AuctionEntry* auction, uint32 Action, uint32 ErrorCode, uint32 bidError) { - WorldPacket data(SMSG_AUCTION_COMMAND_RESULT, 16); - data << auctionId; - data << Action; - data << ErrorCode; - if (!ErrorCode && Action) - data << bidError; //when bid, then send 0, once... + WorldPacket data(SMSG_AUCTION_COMMAND_RESULT); + data << uint32(auction ? auction->Id : 0); + data << uint32(Action); + data << uint32(ErrorCode); + + switch (ErrorCode) + { + case ERR_AUCTION_OK: + if (Action == AUCTION_PLACE_BID) + data << uint64(auction->bid ? auction->GetAuctionOutBid() : 0); + break; + case ERR_AUCTION_INVENTORY: + data << uint32(bidError); + break; + case ERR_AUCTION_HIGHER_BID: + data << uint64(auction->bidder); + data << uint64(auction->bid); + data << uint64(auction->bid ? auction->GetAuctionOutBid() : 0); + break; + } + SendPacket(&data); } //this function sends notification, if bidder is online -void WorldSession::SendAuctionBidderNotification(uint32 location, uint32 auctionId, uint64 bidder, uint32 bidSum, uint32 diff, uint32 item_template) +void WorldSession::SendAuctionBidderNotification(uint32 location, uint32 auctionId, uint64 bidder, uint32 bidSum, uint32 diff, uint32 itemEntry) { WorldPacket data(SMSG_AUCTION_BIDDER_NOTIFICATION, (8*4)); data << uint32(location); @@ -93,7 +108,7 @@ void WorldSession::SendAuctionBidderNotification(uint32 location, uint32 auction data << uint64(bidder); data << uint64(bidSum); data << uint64(diff); - data << uint32(item_template); + data << uint32(itemEntry); data << uint32(0); SendPacket(&data); } @@ -106,17 +121,26 @@ void WorldSession::SendAuctionOwnerNotification(AuctionEntry* auction) data << uint64(auction->bid); data << uint64(0); //unk data << uint64(0); //unk - data << uint32(auction->item_template); + data << uint32(auction->itemEntry); data << uint32(0); //unk data << float(0); //unk SendPacket(&data); } +void WorldSession::SendAuctionRemovedNotification(uint32 auctionId, uint32 itemEntry, int32 randomPropertyId) +{ + WorldPacket data(SMSG_AUCTION_REMOVED_NOTIFICATION, (4+4+4)); + data << uint32(auctionId); + data << uint32(itemEntry); + data << uint32(randomPropertyId); + SendPacket(&data); +} + //this void creates new auction and adds auction to some auctionhouse void WorldSession::HandleAuctionSellItem(WorldPacket & recvData) { - uint64 auctioneer; - uint32 itemsCount, etime, bid, buyout; + uint64 auctioneer, bid, buyout; + uint32 itemsCount, etime; recvData >> auctioneer; recvData >> itemsCount; @@ -125,7 +149,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recvData) if (itemsCount > MAX_AUCTION_ITEMS) { - SendAuctionCommandResult(0, AUCTION_SELL_ITEM, AUCTION_INTERNAL_ERROR); + SendAuctionCommandResult(NULL, AUCTION_SELL_ITEM, ERR_AUCTION_DATABASE_ERROR); return; } @@ -184,7 +208,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recvData) if (!item) { - SendAuctionCommandResult(0, AUCTION_SELL_ITEM, AUCTION_ITEM_NOT_FOUND); + SendAuctionCommandResult(NULL, AUCTION_SELL_ITEM, ERR_AUCTION_ITEM_NOT_FOUND); return; } @@ -192,7 +216,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recvData) item->GetTemplate()->Flags & ITEM_PROTO_FLAG_CONJURED || item->GetUInt32Value(ITEM_FIELD_DURATION) || item->GetCount() < count[i]) { - SendAuctionCommandResult(0, AUCTION_SELL_ITEM, AUCTION_INTERNAL_ERROR); + SendAuctionCommandResult(NULL, AUCTION_SELL_ITEM, ERR_AUCTION_DATABASE_ERROR); return; } @@ -202,7 +226,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recvData) if (!finalCount) { - SendAuctionCommandResult(0, AUCTION_SELL_ITEM, AUCTION_INTERNAL_ERROR); + SendAuctionCommandResult(NULL, AUCTION_SELL_ITEM, ERR_AUCTION_DATABASE_ERROR); return; } @@ -212,7 +236,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recvData) if (item->GetMaxStackCount() < finalCount) { - SendAuctionCommandResult(0, AUCTION_SELL_ITEM, AUCTION_INTERNAL_ERROR); + SendAuctionCommandResult(NULL, AUCTION_SELL_ITEM, ERR_AUCTION_DATABASE_ERROR); return; } } @@ -227,7 +251,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recvData) uint32 deposit = sAuctionMgr->GetAuctionDeposit(auctionHouseEntry, etime, item, finalCount); if (!_player->HasEnoughMoney((uint64)deposit)) { - SendAuctionCommandResult(0, AUCTION_SELL_ITEM, AUCTION_NOT_ENOUGHT_MONEY); + SendAuctionCommandResult(NULL, AUCTION_SELL_ITEM, ERR_AUCTION_NOT_ENOUGHT_MONEY); return; } @@ -250,8 +274,8 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recvData) GetPlayerName().c_str(), GetAccountId(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetCount()); } - AH->item_guidlow = item->GetGUIDLow(); - AH->item_template = item->GetEntry(); + AH->itemGUIDLow = item->GetGUIDLow(); + AH->itemEntry = item->GetEntry(); AH->itemCount = item->GetCount(); AH->owner = _player->GetGUIDLow(); AH->startbid = bid; @@ -275,7 +299,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recvData) _player->SaveInventoryAndGoldToDB(trans); CharacterDatabase.CommitTransaction(trans); - SendAuctionCommandResult(AH->Id, AUCTION_SELL_ITEM, AUCTION_OK); + SendAuctionCommandResult(AH, AUCTION_SELL_ITEM, ERR_AUCTION_OK); GetPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CREATE_AUCTION, 1); return; @@ -286,7 +310,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recvData) if (!newItem) { sLog->outError(LOG_FILTER_NETWORKIO, "CMSG_AUCTION_SELL_ITEM: Could not create clone of item %u", item->GetEntry()); - SendAuctionCommandResult(0, AUCTION_SELL_ITEM, AUCTION_INTERNAL_ERROR); + SendAuctionCommandResult(NULL, AUCTION_SELL_ITEM, ERR_AUCTION_DATABASE_ERROR); return; } @@ -296,8 +320,8 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recvData) GetPlayerName().c_str(), GetAccountId(), newItem->GetTemplate()->Name1.c_str(), newItem->GetEntry(), newItem->GetCount()); } - AH->item_guidlow = newItem->GetGUIDLow(); - AH->item_template = newItem->GetEntry(); + AH->itemGUIDLow = newItem->GetGUIDLow(); + AH->itemEntry = newItem->GetEntry(); AH->itemCount = newItem->GetCount(); AH->owner = _player->GetGUIDLow(); AH->startbid = bid; @@ -345,7 +369,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recvData) _player->SaveInventoryAndGoldToDB(trans); CharacterDatabase.CommitTransaction(trans); - SendAuctionCommandResult(AH->Id, AUCTION_SELL_ITEM, AUCTION_OK); + SendAuctionCommandResult(AH, AUCTION_SELL_ITEM, ERR_AUCTION_OK); GetPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CREATE_AUCTION, 1); return; @@ -387,18 +411,18 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket& recvData) if (!auction || auction->owner == player->GetGUIDLow()) { //you cannot bid your own auction: - SendAuctionCommandResult(0, AUCTION_PLACE_BID, CANNOT_BID_YOUR_AUCTION_ERROR); + SendAuctionCommandResult(NULL, AUCTION_PLACE_BID, ERR_AUCTION_BID_OWN); return; } // impossible have online own another character (use this for speedup check in case online owner) - Player* auction_owner = ObjectAccessor::FindPlayer(MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER)); + /*Player* auction_owner = ObjectAccessor::FindPlayer(MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER)); if (!auction_owner && sObjectMgr->GetPlayerAccountIdByGUID(MAKE_NEW_GUID(auction->owner, 0, HIGHGUID_PLAYER)) == player->GetSession()->GetAccountId()) { //you cannot bid your another character auction: - SendAuctionCommandResult(0, AUCTION_PLACE_BID, CANNOT_BID_YOUR_AUCTION_ERROR); + SendAuctionCommandResult(NULL, AUCTION_PLACE_BID, ERR_AUCTION_BID_OWN); return; - } + }*/ // cheating if (price <= auction->bid || price < auction->startbid) @@ -408,14 +432,15 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket& recvData) if ((price < auction->buyout || auction->buyout == 0) && price < auction->bid + auction->GetAuctionOutBid()) { - //auction has already higher bid, client tests it! + // client already test it but just in case ... + SendAuctionCommandResult(auction, AUCTION_PLACE_BID, ERR_AUCTION_HIGHER_BID); return; } if (!player->HasEnoughMoney(price)) { - //you don't have enought money!, client tests! - //SendAuctionCommandResult(auction->auctionId, AUCTION_PLACE_BID, ???); + // client already test it but just in case ... + SendAuctionCommandResult(auction, AUCTION_PLACE_BID, ERR_AUCTION_NOT_ENOUGHT_MONEY); return; } @@ -447,7 +472,7 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket& recvData) stmt->setUInt32(2, auction->Id); trans->Append(stmt); - SendAuctionCommandResult(auction->Id, AUCTION_PLACE_BID, AUCTION_OK, 0); + SendAuctionCommandResult(auction, AUCTION_PLACE_BID, ERR_AUCTION_OK); } else { @@ -469,13 +494,13 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket& recvData) sAuctionMgr->SendAuctionSuccessfulMail(auction, trans); sAuctionMgr->SendAuctionWonMail(auction, trans); - SendAuctionCommandResult(auction->Id, AUCTION_PLACE_BID, AUCTION_OK); + SendAuctionCommandResult(auction, AUCTION_PLACE_BID, ERR_AUCTION_OK); auction->DeleteFromDB(trans); - uint32 item_template = auction->item_template; - sAuctionMgr->RemoveAItem(auction->item_guidlow); - auctionHouse->RemoveAuction(auction, item_template); + uint32 itemEntry = auction->itemEntry; + sAuctionMgr->RemoveAItem(auction->itemGUIDLow); + auctionHouse->RemoveAuction(auction, itemEntry); } player->SaveInventoryAndGoldToDB(trans); CharacterDatabase.CommitTransaction(trans); @@ -510,7 +535,7 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recvData) SQLTransaction trans = CharacterDatabase.BeginTransaction(); if (auction && auction->owner == player->GetGUIDLow()) { - Item* pItem = sAuctionMgr->GetAItem(auction->item_guidlow); + Item* pItem = sAuctionMgr->GetAItem(auction->itemGUIDLow); if (pItem) { if (auction->bidder > 0) // If we have a bidder, we have to send him the money he paid @@ -518,8 +543,7 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recvData) uint32 auctionCut = auction->GetAuctionCut(); if (!player->HasEnoughMoney((uint64)auctionCut)) //player doesn't have enough money, maybe message needed return; - //some auctionBidderNotification would be needed, but don't know that parts.. - sAuctionMgr->SendAuctionCancelledToBidderMail(auction, trans); + sAuctionMgr->SendAuctionCancelledToBidderMail(auction, trans, pItem); player->ModifyMoney(-int64(auctionCut)); } @@ -530,21 +554,21 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recvData) } else { - sLog->outError(LOG_FILTER_NETWORKIO, "Auction id: %u got non existing item (item guid : %u)!", auction->Id, auction->item_guidlow); - SendAuctionCommandResult(0, AUCTION_CANCEL, AUCTION_INTERNAL_ERROR); + sLog->outError(LOG_FILTER_NETWORKIO, "Auction id: %u got non existing item (item guid : %u)!", auction->Id, auction->itemGUIDLow); + SendAuctionCommandResult(NULL, AUCTION_CANCEL, ERR_AUCTION_DATABASE_ERROR); return; } } else { - SendAuctionCommandResult(0, AUCTION_CANCEL, AUCTION_INTERNAL_ERROR); + SendAuctionCommandResult(NULL, AUCTION_CANCEL, ERR_AUCTION_DATABASE_ERROR); //this code isn't possible ... maybe there should be assert sLog->outError(LOG_FILTER_NETWORKIO, "CHEATER: %u tried to cancel auction (id: %u) of another player or auction is NULL", player->GetGUIDLow(), auctionId); return; } //inform player, that auction is removed - SendAuctionCommandResult(auction->Id, AUCTION_CANCEL, AUCTION_OK); + SendAuctionCommandResult(auction, AUCTION_CANCEL, ERR_AUCTION_OK); // Now remove the auction @@ -552,9 +576,9 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recvData) auction->DeleteFromDB(trans); CharacterDatabase.CommitTransaction(trans); - uint32 item_template = auction->item_template; - sAuctionMgr->RemoveAItem(auction->item_guidlow); - auctionHouse->RemoveAuction(auction, item_template); + uint32 itemEntry = auction->itemEntry; + sAuctionMgr->RemoveAItem(auction->itemGUIDLow); + auctionHouse->RemoveAuction(auction, itemEntry); } //called when player lists his bids @@ -669,16 +693,12 @@ void WorldSession::HandleAuctionListItems(WorldPacket & recvData) recvData >> auctionSlotID >> auctionMainCategory >> auctionSubCategory; recvData >> quality >> usable; + recvData.read_skip(); // unk recvData.read_skip(); // unk // this block looks like it uses some lame byte packing or similar... - uint8 unkCnt; - recvData >> unkCnt; - for (uint8 i = 0; i < unkCnt; i++) - { - recvData.read_skip(); + for (uint8 i = 0; i < 15; i++) recvData.read_skip(); - } Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_AUCTIONEER); if (!creature) @@ -699,7 +719,7 @@ void WorldSession::HandleAuctionListItems(WorldPacket & recvData) WorldPacket data(SMSG_AUCTION_LIST_RESULT, (4+4+4)); uint32 count = 0; uint32 totalcount = 0; - data << (uint32) 0; + data << uint32(0); // converting string that we try to find to lower case std::wstring wsearchedname; @@ -733,7 +753,7 @@ void WorldSession::HandleAuctionListPendingSales(WorldPacket & recvData) { data << ""; // string data << ""; // string - data << uint32(0); + data << uint64(0); data << uint32(0); data << float(0); }*/ diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 7138b90ba23..a3c807c09c8 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -83,13 +83,13 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_ROSTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamRosterOpcode ); DEFINE_OPCODE_HANDLER(CMSG_ATTACKSTOP, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleAttackStopOpcode ); DEFINE_OPCODE_HANDLER(CMSG_ATTACKSWING, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleAttackSwingOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_BIDDER_ITEMS, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListBidderItems ); - DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_ITEMS, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListItems ); - DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_OWNER_ITEMS, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListOwnerItems ); - DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_PENDING_SALES, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListPendingSales ); - DEFINE_OPCODE_HANDLER(CMSG_AUCTION_PLACE_BID, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionPlaceBid ); - DEFINE_OPCODE_HANDLER(CMSG_AUCTION_REMOVE_ITEM, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionRemoveItem ); - DEFINE_OPCODE_HANDLER(CMSG_AUCTION_SELL_ITEM, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionSellItem ); + DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_BIDDER_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListBidderItems ); + DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListItems ); + DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_OWNER_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListOwnerItems ); + DEFINE_OPCODE_HANDLER(CMSG_AUCTION_LIST_PENDING_SALES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionListPendingSales ); + DEFINE_OPCODE_HANDLER(CMSG_AUCTION_PLACE_BID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionPlaceBid ); + DEFINE_OPCODE_HANDLER(CMSG_AUCTION_REMOVE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionRemoveItem ); + DEFINE_OPCODE_HANDLER(CMSG_AUCTION_SELL_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionSellItem ); DEFINE_OPCODE_HANDLER(CMSG_AUTH_SESSION, STATUS_NEVER, PROCESS_THREADUNSAFE, &WorldSession::Handle_EarlyProccess ); DEFINE_OPCODE_HANDLER(CMSG_AUTOBANK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoBankItemOpcode ); DEFINE_OPCODE_HANDLER(CMSG_AUTOEQUIP_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoEquipItemOpcode ); @@ -648,14 +648,14 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_ATTACKSWING_CANT_ATTACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ATTACKSWING_DEADTARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ATTACKSWING_NOTINRANGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_AUCTION_BIDDER_LIST_RESULT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_AUCTION_BIDDER_NOTIFICATION, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_AUCTION_COMMAND_RESULT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_AUCTION_LIST_PENDING_SALES, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_AUCTION_LIST_RESULT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_AUCTION_OWNER_LIST_RESULT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_AUCTION_OWNER_NOTIFICATION, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_AUCTION_REMOVED_NOTIFICATION, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_AUCTION_BIDDER_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_AUCTION_BIDDER_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_AUCTION_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_AUCTION_LIST_PENDING_SALES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_AUCTION_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_AUCTION_OWNER_LIST_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_AUCTION_OWNER_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_AUCTION_REMOVED_NOTIFICATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_AURA_POINTS_DEPLETED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_AURA_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_AURA_UPDATE_ALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index b4ccb87f204..07cfdf39bb1 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -703,11 +703,11 @@ enum Opcodes SMSG_ATTACKSWING_CANT_ATTACK = 0x0016, SMSG_ATTACKSWING_DEADTARGET = 0x2B26, SMSG_ATTACKSWING_NOTINRANGE = 0x6C07, - SMSG_AUCTION_BIDDER_LIST_RESULT = 0x6637, + SMSG_AUCTION_BIDDER_LIST_RESULT = 0x0027, SMSG_AUCTION_BIDDER_NOTIFICATION = 0x4E27, SMSG_AUCTION_COMMAND_RESULT = 0x4C25, SMSG_AUCTION_LIST_PENDING_SALES = 0x6A27, - SMSG_AUCTION_LIST_RESULT = 0x0027, + SMSG_AUCTION_LIST_RESULT = 0x6637, SMSG_AUCTION_OWNER_LIST_RESULT = 0x6C34, SMSG_AUCTION_OWNER_NOTIFICATION = 0x4116, SMSG_AUCTION_REMOVED_NOTIFICATION = 0x2334, diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index a35cd7cc595..84d715ada2c 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -352,9 +352,10 @@ class WorldSession bool SendItemInfo(uint32 itemid, WorldPacket data); //auction void SendAuctionHello(uint64 guid, Creature* unit); - void SendAuctionCommandResult(uint32 auctionId, uint32 Action, uint32 ErrorCode, uint32 bidError = 0); + void SendAuctionCommandResult(AuctionEntry* auction, uint32 Action, uint32 ErrorCode, uint32 bidError = 0); void SendAuctionBidderNotification(uint32 location, uint32 auctionId, uint64 bidder, uint32 bidSum, uint32 diff, uint32 item_template); void SendAuctionOwnerNotification(AuctionEntry* auction); + void SendAuctionRemovedNotification(uint32 auctionId, uint32 item_template, int32 randomPropertyId); //Item Enchantment void SendEnchantmentLog(uint64 Target, uint64 Caster, uint32 ItemID, uint32 SpellID); -- cgit v1.2.3 From 42972052955970c2b4a1bff98591add1140bc5f9 Mon Sep 17 00:00:00 2001 From: Tuxity Date: Thu, 23 Aug 2012 17:13:54 +0200 Subject: Core/AuctionHouse: Fix few coding style typos --- src/server/game/Handlers/AuctionHouseHandler.cpp | 10 +++++----- src/server/game/Server/WorldSession.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp index dd7d7fc58b9..3e2d0e1310a 100644 --- a/src/server/game/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Handlers/AuctionHouseHandler.cpp @@ -73,17 +73,17 @@ void WorldSession::SendAuctionHello(uint64 guid, Creature* unit) } //call this method when player bids, creates, or deletes auction -void WorldSession::SendAuctionCommandResult(AuctionEntry* auction, uint32 Action, uint32 ErrorCode, uint32 bidError) +void WorldSession::SendAuctionCommandResult(AuctionEntry* auction, uint32 action, uint32 errorCode, uint32 bidError) { WorldPacket data(SMSG_AUCTION_COMMAND_RESULT); data << uint32(auction ? auction->Id : 0); - data << uint32(Action); - data << uint32(ErrorCode); + data << uint32(action); + data << uint32(errorCode); - switch (ErrorCode) + switch (errorCode) { case ERR_AUCTION_OK: - if (Action == AUCTION_PLACE_BID) + if (action == AUCTION_PLACE_BID) data << uint64(auction->bid ? auction->GetAuctionOutBid() : 0); break; case ERR_AUCTION_INVENTORY: diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 84d715ada2c..ac8e48a0c04 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -355,7 +355,7 @@ class WorldSession void SendAuctionCommandResult(AuctionEntry* auction, uint32 Action, uint32 ErrorCode, uint32 bidError = 0); void SendAuctionBidderNotification(uint32 location, uint32 auctionId, uint64 bidder, uint32 bidSum, uint32 diff, uint32 item_template); void SendAuctionOwnerNotification(AuctionEntry* auction); - void SendAuctionRemovedNotification(uint32 auctionId, uint32 item_template, int32 randomPropertyId); + void SendAuctionRemovedNotification(uint32 auctionId, uint32 itemEntry, int32 randomPropertyId); //Item Enchantment void SendEnchantmentLog(uint64 Target, uint64 Caster, uint32 ItemID, uint32 SpellID); -- cgit v1.2.3 From 2582e3c0d54619ba9265572b87824ed3d43997f3 Mon Sep 17 00:00:00 2001 From: Northstrider Date: Thu, 23 Aug 2012 18:14:08 +0200 Subject: Core/Player: updated player health regeneation to Cataclysm --- src/server/game/Entities/Player/Player.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 812383b9616..800498a82dd 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -2690,10 +2690,6 @@ void Player::RegenerateHealth() return; float HealthIncreaseRate = sWorld->getRate(RATE_HEALTH); - - if (getLevel() < 15) - HealthIncreaseRate = sWorld->getRate(RATE_HEALTH) * (2.066f - (getLevel() * 0.066f)); - float addvalue = 0.0f; // polymorphed case @@ -2705,6 +2701,11 @@ void Player::RegenerateHealth() addvalue = HealthIncreaseRate; if (!isInCombat()) { + if (getLevel() < 15) + addvalue = (0.20f*((float)GetMaxHealth())/getLevel()*HealthIncreaseRate); + else + addvalue = 0.015f*((float)GetMaxHealth())*HealthIncreaseRate; + AuraEffectList const& mModHealthRegenPct = GetAuraEffectsByType(SPELL_AURA_MOD_HEALTH_REGEN_PERCENT); for (AuraEffectList::const_iterator i = mModHealthRegenPct.begin(); i != mModHealthRegenPct.end(); ++i) AddPctN(addvalue, (*i)->GetAmount()); -- cgit v1.2.3 From 26bc57733af4c2cedc60b9777cd037d43e4b8063 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Sat, 25 Aug 2012 02:09:15 +0200 Subject: Core/outdoorPvP: Remove outdoor pvp eastern plaguelands (thx projectfreya) --- src/server/game/Entities/Player/Player.cpp | 43 -- src/server/game/OutdoorPvP/OutdoorPvP.h | 3 +- src/server/game/Scripting/ScriptLoader.cpp | 2 - src/server/scripts/OutdoorPvP/CMakeLists.txt | 2 - src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp | 785 ------------------------- src/server/scripts/OutdoorPvP/OutdoorPvPEP.h | 331 ----------- 6 files changed, 1 insertion(+), 1165 deletions(-) delete mode 100755 src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp delete mode 100755 src/server/scripts/OutdoorPvP/OutdoorPvPEP.h (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 812383b9616..f84ff1ead1d 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -9138,9 +9138,6 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid) case 2918: NumberOfFields = 8; break; - case 139: - NumberOfFields = 41; - break; case 1377: NumberOfFields = 15; break; @@ -9228,46 +9225,6 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid) case 2257: // Deeprun Tram case 3703: // Shattrath City break; - case 139: // Eastern Plaguelands - if (pvp && pvp->GetTypeId() == OUTDOOR_PVP_EP) - pvp->FillInitialWorldStates(data); - else - { - data << uint32(0x97a) << uint32(0x0); // 10 2426 - data << uint32(0x917) << uint32(0x0); // 11 2327 - data << uint32(0x918) << uint32(0x0); // 12 2328 - data << uint32(0x97b) << uint32(0x32); // 13 2427 - data << uint32(0x97c) << uint32(0x32); // 14 2428 - data << uint32(0x933) << uint32(0x1); // 15 2355 - data << uint32(0x946) << uint32(0x0); // 16 2374 - data << uint32(0x947) << uint32(0x0); // 17 2375 - data << uint32(0x948) << uint32(0x0); // 18 2376 - data << uint32(0x949) << uint32(0x0); // 19 2377 - data << uint32(0x94a) << uint32(0x0); // 20 2378 - data << uint32(0x94b) << uint32(0x0); // 21 2379 - data << uint32(0x932) << uint32(0x0); // 22 2354 - data << uint32(0x934) << uint32(0x0); // 23 2356 - data << uint32(0x935) << uint32(0x0); // 24 2357 - data << uint32(0x936) << uint32(0x0); // 25 2358 - data << uint32(0x937) << uint32(0x0); // 26 2359 - data << uint32(0x938) << uint32(0x0); // 27 2360 - data << uint32(0x939) << uint32(0x1); // 28 2361 - data << uint32(0x930) << uint32(0x1); // 29 2352 - data << uint32(0x93a) << uint32(0x0); // 30 2362 - data << uint32(0x93b) << uint32(0x0); // 31 2363 - data << uint32(0x93c) << uint32(0x0); // 32 2364 - data << uint32(0x93d) << uint32(0x0); // 33 2365 - data << uint32(0x944) << uint32(0x0); // 34 2372 - data << uint32(0x945) << uint32(0x0); // 35 2373 - data << uint32(0x931) << uint32(0x1); // 36 2353 - data << uint32(0x93e) << uint32(0x0); // 37 2366 - data << uint32(0x931) << uint32(0x1); // 38 2367 ?? grey horde not in dbc! send for consistency's sake, and to match field count - data << uint32(0x940) << uint32(0x0); // 39 2368 - data << uint32(0x941) << uint32(0x0); // 7 2369 - data << uint32(0x942) << uint32(0x0); // 8 2370 - data << uint32(0x943) << uint32(0x0); // 9 2371 - } - break; case 1377: // Silithus if (pvp && pvp->GetTypeId() == OUTDOOR_PVP_SI) pvp->FillInitialWorldStates(data); diff --git a/src/server/game/OutdoorPvP/OutdoorPvP.h b/src/server/game/OutdoorPvP/OutdoorPvP.h index 6ea13d353c5..d2f1362dc82 100755 --- a/src/server/game/OutdoorPvP/OutdoorPvP.h +++ b/src/server/game/OutdoorPvP/OutdoorPvP.h @@ -31,10 +31,9 @@ enum OutdoorPvPTypes OUTDOOR_PVP_TF = 3, OUTDOOR_PVP_ZM = 4, OUTDOOR_PVP_SI = 5, - OUTDOOR_PVP_EP = 6, }; -#define MAX_OUTDOORPVP_TYPES 7 +#define MAX_OUTDOORPVP_TYPES 6 enum ObjectiveStates { diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index 5e6caec1f29..e7d203c9bc1 100755 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -593,7 +593,6 @@ void AddSC_zangarmarsh(); // battlegrounds // outdoor pvp -void AddSC_outdoorpvp_ep(); void AddSC_outdoorpvp_hp(); void AddSC_outdoorpvp_na(); void AddSC_outdoorpvp_si(); @@ -1224,7 +1223,6 @@ void AddNorthrendScripts() void AddOutdoorPvPScripts() { #ifdef SCRIPTS - AddSC_outdoorpvp_ep(); AddSC_outdoorpvp_hp(); AddSC_outdoorpvp_na(); AddSC_outdoorpvp_si(); diff --git a/src/server/scripts/OutdoorPvP/CMakeLists.txt b/src/server/scripts/OutdoorPvP/CMakeLists.txt index 237b974aa9d..15d7dbd7e8d 100644 --- a/src/server/scripts/OutdoorPvP/CMakeLists.txt +++ b/src/server/scripts/OutdoorPvP/CMakeLists.txt @@ -17,8 +17,6 @@ set(scripts_STAT_SRCS OutdoorPvP/OutdoorPvPNA.cpp OutdoorPvP/OutdoorPvPHP.cpp OutdoorPvP/OutdoorPvPTF.h - OutdoorPvP/OutdoorPvPEP.h - OutdoorPvP/OutdoorPvPEP.cpp OutdoorPvP/OutdoorPvPHP.h OutdoorPvP/OutdoorPvPZM.h OutdoorPvP/OutdoorPvPNA.h diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp deleted file mode 100755 index 2a94ddb3134..00000000000 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp +++ /dev/null @@ -1,785 +0,0 @@ -/* - * Copyright (C) 2008-2012 TrinityCore - * - * 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; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; 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, see . - */ - -#include "ScriptMgr.h" -#include "OutdoorPvPEP.h" -#include "WorldPacket.h" -#include "Player.h" -#include "GameObject.h" -#include "ObjectMgr.h" -#include "ObjectAccessor.h" -#include "OutdoorPvPMgr.h" -#include "Creature.h" -#include "Language.h" -#include "World.h" -#include "GossipDef.h" - -OPvPCapturePointEP_EWT::OPvPCapturePointEP_EWT(OutdoorPvP* pvp) -: OPvPCapturePoint(pvp), m_TowerState(EP_TS_N), m_UnitsSummonedSide(0) -{ - SetCapturePointData(EPCapturePoints[EP_EWT].entry, EPCapturePoints[EP_EWT].map, EPCapturePoints[EP_EWT].x, EPCapturePoints[EP_EWT].y, EPCapturePoints[EP_EWT].z, EPCapturePoints[EP_EWT].o, EPCapturePoints[EP_EWT].rot0, EPCapturePoints[EP_EWT].rot1, EPCapturePoints[EP_EWT].rot2, EPCapturePoints[EP_EWT].rot3); - AddObject(EP_EWT_FLAGS, EPTowerFlags[EP_EWT].entry, EPTowerFlags[EP_EWT].map, EPTowerFlags[EP_EWT].x, EPTowerFlags[EP_EWT].y, EPTowerFlags[EP_EWT].z, EPTowerFlags[EP_EWT].o, EPTowerFlags[EP_EWT].rot0, EPTowerFlags[EP_EWT].rot1, EPTowerFlags[EP_EWT].rot2, EPTowerFlags[EP_EWT].rot3); -} - -void OPvPCapturePointEP_EWT::ChangeState() -{ - // if changing from controlling alliance to horde or vice versa - if ( m_OldState == OBJECTIVESTATE_ALLIANCE && m_OldState != m_State ) - { - sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_EWT_A)); - ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_EWT, 0); - } - else if ( m_OldState == OBJECTIVESTATE_HORDE && m_OldState != m_State ) - { - sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_EWT_H)); - ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_EWT, 0); - } - - uint32 artkit = 21; - - switch (m_State) - { - case OBJECTIVESTATE_ALLIANCE: - m_TowerState = EP_TS_A; - artkit = 2; - SummonSupportUnitAtNorthpassTower(ALLIANCE); - ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_EWT, ALLIANCE); - if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_EWT_A)); - break; - case OBJECTIVESTATE_HORDE: - m_TowerState = EP_TS_H; - artkit = 1; - SummonSupportUnitAtNorthpassTower(HORDE); - ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_EWT, HORDE); - if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_EWT_H)); - break; - case OBJECTIVESTATE_NEUTRAL: - m_TowerState = EP_TS_N; - break; - case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE: - case OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE: - m_TowerState = EP_TS_N_A; - break; - case OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE: - case OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE: - m_TowerState = EP_TS_N_H; - break; - } - - GameObject* flag = HashMapHolder::Find(m_capturePointGUID); - GameObject* flag2 = HashMapHolder::Find(m_Objects[EP_EWT_FLAGS]); - if (flag) - { - flag->SetGoArtKit(artkit); - } - if (flag2) - { - flag2->SetGoArtKit(artkit); - } - - UpdateTowerState(); - - // complete quest objective - if (m_TowerState == EP_TS_A || m_TowerState == EP_TS_H) - SendObjectiveComplete(EP_EWT_CM, 0); -} - -void OPvPCapturePointEP_EWT::SendChangePhase() -{ - // send this too, sometimes the slider disappears, dunno why :( - SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1); - // send these updates to only the ones in this objective - uint32 phase = (uint32)ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f); - SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase); - // send this too, sometimes it resets :S - SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, m_neutralValuePct); -} - -void OPvPCapturePointEP_EWT::FillInitialWorldStates(WorldPacket &data) -{ - data << EP_EWT_A << uint32(bool(m_TowerState & EP_TS_A)); - data << EP_EWT_H << uint32(bool(m_TowerState & EP_TS_H)); - data << EP_EWT_N_A << uint32(bool(m_TowerState & EP_TS_N_A)); - data << EP_EWT_N_H << uint32(bool(m_TowerState & EP_TS_N_H)); - data << EP_EWT_N << uint32(bool(m_TowerState & EP_TS_N)); -} - -void OPvPCapturePointEP_EWT::UpdateTowerState() -{ - m_PvP->SendUpdateWorldState(EP_EWT_A, bool(m_TowerState & EP_TS_A)); - m_PvP->SendUpdateWorldState(EP_EWT_H, bool(m_TowerState & EP_TS_H)); - m_PvP->SendUpdateWorldState(EP_EWT_N_A, bool(m_TowerState & EP_TS_N_A)); - m_PvP->SendUpdateWorldState(EP_EWT_N_H, bool(m_TowerState & EP_TS_N_H)); - m_PvP->SendUpdateWorldState(EP_EWT_N, bool(m_TowerState & EP_TS_N)); -} - -bool OPvPCapturePointEP_EWT::HandlePlayerEnter(Player* player) -{ - if (OPvPCapturePoint::HandlePlayerEnter(player)) - { - player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1); - uint32 phase = (uint32)ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f); - player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase); - player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, m_neutralValuePct); - return true; - } - return false; -} - -void OPvPCapturePointEP_EWT::HandlePlayerLeave(Player* player) -{ - player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 0); - OPvPCapturePoint::HandlePlayerLeave(player); -} - -void OPvPCapturePointEP_EWT::SummonSupportUnitAtNorthpassTower(uint32 team) -{ - if (m_UnitsSummonedSide != team) - { - m_UnitsSummonedSide = team; - const creature_type * ct = NULL; - if (team == ALLIANCE) - ct=EP_EWT_Summons_A; - else - ct=EP_EWT_Summons_H; - - for (uint8 i = 0; i < EP_EWT_NUM_CREATURES; ++i) - { - DelCreature(i); - AddCreature(i, ct[i].entry, ct[i].teamval, ct[i].map, ct[i].x, ct[i].y, ct[i].z, ct[i].o, 1000000); - } - } -} - -// NPT -OPvPCapturePointEP_NPT::OPvPCapturePointEP_NPT(OutdoorPvP* pvp) -: OPvPCapturePoint(pvp), m_TowerState(EP_TS_N), m_SummonedGOSide(0) -{ - SetCapturePointData(EPCapturePoints[EP_NPT].entry, EPCapturePoints[EP_NPT].map, EPCapturePoints[EP_NPT].x, EPCapturePoints[EP_NPT].y, EPCapturePoints[EP_NPT].z, EPCapturePoints[EP_NPT].o, EPCapturePoints[EP_NPT].rot0, EPCapturePoints[EP_NPT].rot1, EPCapturePoints[EP_NPT].rot2, EPCapturePoints[EP_NPT].rot3); - AddObject(EP_NPT_FLAGS, EPTowerFlags[EP_NPT].entry, EPTowerFlags[EP_NPT].map, EPTowerFlags[EP_NPT].x, EPTowerFlags[EP_NPT].y, EPTowerFlags[EP_NPT].z, EPTowerFlags[EP_NPT].o, EPTowerFlags[EP_NPT].rot0, EPTowerFlags[EP_NPT].rot1, EPTowerFlags[EP_NPT].rot2, EPTowerFlags[EP_NPT].rot3); -} - -void OPvPCapturePointEP_NPT::ChangeState() -{ - // if changing from controlling alliance to horde or vice versa - if ( m_OldState == OBJECTIVESTATE_ALLIANCE && m_OldState != m_State ) - { - sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_NPT_A)); - ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_NPT, 0); - } - else if ( m_OldState == OBJECTIVESTATE_HORDE && m_OldState != m_State ) - { - sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_NPT_H)); - ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_NPT, 0); - } - - uint32 artkit = 21; - - switch (m_State) - { - case OBJECTIVESTATE_ALLIANCE: - m_TowerState = EP_TS_A; - artkit = 2; - SummonGO(ALLIANCE); - ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_NPT, ALLIANCE); - if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_NPT_A)); - break; - case OBJECTIVESTATE_HORDE: - m_TowerState = EP_TS_H; - artkit = 1; - SummonGO(HORDE); - ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_NPT, HORDE); - if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_NPT_H)); - break; - case OBJECTIVESTATE_NEUTRAL: - m_TowerState = EP_TS_N; - m_SummonedGOSide = 0; - DelObject(EP_NPT_BUFF); - break; - case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE: - m_TowerState = EP_TS_N_A; - break; - case OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE: - m_TowerState = EP_TS_N_A; - m_SummonedGOSide = 0; - DelObject(EP_NPT_BUFF); - break; - case OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE: - m_TowerState = EP_TS_N_H; - break; - case OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE: - m_TowerState = EP_TS_N_H; - m_SummonedGOSide = 0; - DelObject(EP_NPT_BUFF); - break; - } - - GameObject* flag = HashMapHolder::Find(m_capturePointGUID); - GameObject* flag2 = HashMapHolder::Find(m_Objects[EP_NPT_FLAGS]); - if (flag) - { - flag->SetGoArtKit(artkit); - } - if (flag2) - { - flag2->SetGoArtKit(artkit); - } - - UpdateTowerState(); - - // complete quest objective - if (m_TowerState == EP_TS_A || m_TowerState == EP_TS_H) - SendObjectiveComplete(EP_NPT_CM, 0); -} - -void OPvPCapturePointEP_NPT::SendChangePhase() -{ - // send this too, sometimes the slider disappears, dunno why :( - SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1); - // send these updates to only the ones in this objective - uint32 phase = (uint32)ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f); - SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase); - // send this too, sometimes it resets :S - SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, m_neutralValuePct); -} - -void OPvPCapturePointEP_NPT::FillInitialWorldStates(WorldPacket &data) -{ - data << EP_NPT_A << uint32(bool(m_TowerState & EP_TS_A)); - data << EP_NPT_H << uint32(bool(m_TowerState & EP_TS_H)); - data << EP_NPT_N_A << uint32(bool(m_TowerState & EP_TS_N_A)); - data << EP_NPT_N_H << uint32(bool(m_TowerState & EP_TS_N_H)); - data << EP_NPT_N << uint32(bool(m_TowerState & EP_TS_N)); -} - -void OPvPCapturePointEP_NPT::UpdateTowerState() -{ - m_PvP->SendUpdateWorldState(EP_NPT_A, bool(m_TowerState & EP_TS_A)); - m_PvP->SendUpdateWorldState(EP_NPT_H, bool(m_TowerState & EP_TS_H)); - m_PvP->SendUpdateWorldState(EP_NPT_N_A, bool(m_TowerState & EP_TS_N_A)); - m_PvP->SendUpdateWorldState(EP_NPT_N_H, bool(m_TowerState & EP_TS_N_H)); - m_PvP->SendUpdateWorldState(EP_NPT_N, bool(m_TowerState & EP_TS_N)); -} - -bool OPvPCapturePointEP_NPT::HandlePlayerEnter(Player* player) -{ - if (OPvPCapturePoint::HandlePlayerEnter(player)) - { - player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1); - uint32 phase = (uint32)ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f); - player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase); - player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, m_neutralValuePct); - return true; - } - return false; -} - -void OPvPCapturePointEP_NPT::HandlePlayerLeave(Player* player) -{ - player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 0); - OPvPCapturePoint::HandlePlayerLeave(player); -} - -void OPvPCapturePointEP_NPT::SummonGO(uint32 team) -{ - if (m_SummonedGOSide != team) - { - m_SummonedGOSide = team; - DelObject(EP_NPT_BUFF); - AddObject(EP_NPT_BUFF, EP_NPT_LordaeronShrine.entry, EP_NPT_LordaeronShrine.map, EP_NPT_LordaeronShrine.x, EP_NPT_LordaeronShrine.y, EP_NPT_LordaeronShrine.z, EP_NPT_LordaeronShrine.o, EP_NPT_LordaeronShrine.rot0, EP_NPT_LordaeronShrine.rot1, EP_NPT_LordaeronShrine.rot2, EP_NPT_LordaeronShrine.rot3); - GameObject* go = HashMapHolder::Find(m_Objects[EP_NPT_BUFF]); - if (go) - go->SetUInt32Value(GAMEOBJECT_FACTION, (team == ALLIANCE ? 84 : 83)); - } -} - -// CGT -OPvPCapturePointEP_CGT::OPvPCapturePointEP_CGT(OutdoorPvP* pvp) -: OPvPCapturePoint(pvp), m_TowerState(EP_TS_N), m_GraveyardSide(0) -{ - SetCapturePointData(EPCapturePoints[EP_CGT].entry, EPCapturePoints[EP_CGT].map, EPCapturePoints[EP_CGT].x, EPCapturePoints[EP_CGT].y, EPCapturePoints[EP_CGT].z, EPCapturePoints[EP_CGT].o, EPCapturePoints[EP_CGT].rot0, EPCapturePoints[EP_CGT].rot1, EPCapturePoints[EP_CGT].rot2, EPCapturePoints[EP_CGT].rot3); - AddObject(EP_CGT_FLAGS, EPTowerFlags[EP_CGT].entry, EPTowerFlags[EP_CGT].map, EPTowerFlags[EP_CGT].x, EPTowerFlags[EP_CGT].y, EPTowerFlags[EP_CGT].z, EPTowerFlags[EP_CGT].o, EPTowerFlags[EP_CGT].rot0, EPTowerFlags[EP_CGT].rot1, EPTowerFlags[EP_CGT].rot2, EPTowerFlags[EP_CGT].rot3); -} - -void OPvPCapturePointEP_CGT::ChangeState() -{ - // if changing from controlling alliance to horde or vice versa - if ( m_OldState == OBJECTIVESTATE_ALLIANCE && m_OldState != m_State ) - { - sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_CGT_A)); - ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_CGT, 0); - } - else if ( m_OldState == OBJECTIVESTATE_HORDE && m_OldState != m_State ) - { - sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_CGT_H)); - ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_CGT, 0); - } - - uint32 artkit = 21; - - switch (m_State) - { - case OBJECTIVESTATE_ALLIANCE: - m_TowerState = EP_TS_A; - artkit = 2; - LinkGraveYard(ALLIANCE); - ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_CGT, ALLIANCE); - if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_CGT_A)); - break; - case OBJECTIVESTATE_HORDE: - m_TowerState = EP_TS_H; - artkit = 1; - LinkGraveYard(HORDE); - ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_CGT, HORDE); - if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_CGT_H)); - break; - case OBJECTIVESTATE_NEUTRAL: - m_TowerState = EP_TS_N; - break; - case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE: - case OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE: - m_TowerState = EP_TS_N_A; - break; - case OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE: - case OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE: - m_TowerState = EP_TS_N_H; - break; - } - - GameObject* flag = HashMapHolder::Find(m_capturePointGUID); - GameObject* flag2 = HashMapHolder::Find(m_Objects[EP_CGT_FLAGS]); - if (flag) - { - flag->SetGoArtKit(artkit); - } - if (flag2) - { - flag2->SetGoArtKit(artkit); - } - - UpdateTowerState(); - - // complete quest objective - if (m_TowerState == EP_TS_A || m_TowerState == EP_TS_H) - SendObjectiveComplete(EP_CGT_CM, 0); -} - -void OPvPCapturePointEP_CGT::SendChangePhase() -{ - // send this too, sometimes the slider disappears, dunno why :( - SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1); - // send these updates to only the ones in this objective - uint32 phase = (uint32)ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f); - SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase); - // send this too, sometimes it resets :S - SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, m_neutralValuePct); -} - -void OPvPCapturePointEP_CGT::FillInitialWorldStates(WorldPacket &data) -{ - data << EP_CGT_A << uint32(bool(m_TowerState & EP_TS_A)); - data << EP_CGT_H << uint32(bool(m_TowerState & EP_TS_H)); - data << EP_CGT_N_A << uint32(bool(m_TowerState & EP_TS_N_A)); - data << EP_CGT_N_H << uint32(bool(m_TowerState & EP_TS_N_H)); - data << EP_CGT_N << uint32(bool(m_TowerState & EP_TS_N)); -} - -void OPvPCapturePointEP_CGT::UpdateTowerState() -{ - m_PvP->SendUpdateWorldState(EP_CGT_A, bool(m_TowerState & EP_TS_A)); - m_PvP->SendUpdateWorldState(EP_CGT_H, bool(m_TowerState & EP_TS_H)); - m_PvP->SendUpdateWorldState(EP_CGT_N_A, bool(m_TowerState & EP_TS_N_A)); - m_PvP->SendUpdateWorldState(EP_CGT_N_H, bool(m_TowerState & EP_TS_N_H)); - m_PvP->SendUpdateWorldState(EP_CGT_N, bool(m_TowerState & EP_TS_N)); -} - -bool OPvPCapturePointEP_CGT::HandlePlayerEnter(Player* player) -{ - if (OPvPCapturePoint::HandlePlayerEnter(player)) - { - player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1); - uint32 phase = (uint32)ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f); - player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase); - player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, m_neutralValuePct); - return true; - } - return false; -} - -void OPvPCapturePointEP_CGT::HandlePlayerLeave(Player* player) -{ - player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 0); - OPvPCapturePoint::HandlePlayerLeave(player); -} - -void OPvPCapturePointEP_CGT::LinkGraveYard(uint32 team) -{ - if (m_GraveyardSide != team) - { - m_GraveyardSide = team; - sObjectMgr->RemoveGraveYardLink(EP_GraveYardId, EP_GraveYardZone, team, false); - sObjectMgr->AddGraveYardLink(EP_GraveYardId, EP_GraveYardZone, team, false); - } -} - -// PWT -OPvPCapturePointEP_PWT::OPvPCapturePointEP_PWT(OutdoorPvP* pvp) -: OPvPCapturePoint(pvp), m_FlightMasterSpawned(0), m_TowerState(EP_TS_N) -{ - SetCapturePointData(EPCapturePoints[EP_PWT].entry, EPCapturePoints[EP_PWT].map, EPCapturePoints[EP_PWT].x, EPCapturePoints[EP_PWT].y, EPCapturePoints[EP_PWT].z, EPCapturePoints[EP_PWT].o, EPCapturePoints[EP_PWT].rot0, EPCapturePoints[EP_PWT].rot1, EPCapturePoints[EP_PWT].rot2, EPCapturePoints[EP_PWT].rot3); - AddObject(EP_PWT_FLAGS, EPTowerFlags[EP_PWT].entry, EPTowerFlags[EP_PWT].map, EPTowerFlags[EP_PWT].x, EPTowerFlags[EP_PWT].y, EPTowerFlags[EP_PWT].z, EPTowerFlags[EP_PWT].o, EPTowerFlags[EP_PWT].rot0, EPTowerFlags[EP_PWT].rot1, EPTowerFlags[EP_PWT].rot2, EPTowerFlags[EP_PWT].rot3); -} - -void OPvPCapturePointEP_PWT::ChangeState() -{ - // if changing from controlling alliance to horde or vice versa - if ( m_OldState == OBJECTIVESTATE_ALLIANCE && m_OldState != m_State ) - { - sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_PWT_A)); - ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_PWT, 0); - } - else if ( m_OldState == OBJECTIVESTATE_HORDE && m_OldState != m_State ) - { - sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_PWT_H)); - ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_PWT, 0); - } - - uint32 artkit = 21; - - switch (m_State) - { - case OBJECTIVESTATE_ALLIANCE: - m_TowerState = EP_TS_A; - SummonFlightMaster(ALLIANCE); - artkit = 2; - ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_PWT, ALLIANCE); - if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_PWT_A)); - break; - case OBJECTIVESTATE_HORDE: - m_TowerState = EP_TS_H; - SummonFlightMaster(HORDE); - artkit = 1; - ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_PWT, HORDE); - if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_PWT_H)); - break; - case OBJECTIVESTATE_NEUTRAL: - m_TowerState = EP_TS_N; - DelCreature(EP_PWT_FLIGHTMASTER); - m_FlightMasterSpawned = 0; - break; - case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE: - m_TowerState = EP_TS_N_A; - break; - case OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE: - m_TowerState = EP_TS_N_A; - DelCreature(EP_PWT_FLIGHTMASTER); - m_FlightMasterSpawned = 0; - break; - case OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE: - m_TowerState = EP_TS_N_H; - break; - case OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE: - m_TowerState = EP_TS_N_H; - DelCreature(EP_PWT_FLIGHTMASTER); - m_FlightMasterSpawned = 0; - break; - } - - GameObject* flag = HashMapHolder::Find(m_capturePointGUID); - GameObject* flag2 = HashMapHolder::Find(m_Objects[EP_PWT_FLAGS]); - if (flag) - { - flag->SetGoArtKit(artkit); - } - if (flag2) - { - flag2->SetGoArtKit(artkit); - } - - UpdateTowerState(); - - // complete quest objective - if (m_TowerState == EP_TS_A || m_TowerState == EP_TS_H) - SendObjectiveComplete(EP_PWT_CM, 0); -} - -void OPvPCapturePointEP_PWT::SendChangePhase() -{ - // send this too, sometimes the slider disappears, dunno why :( - SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1); - // send these updates to only the ones in this objective - uint32 phase = (uint32)ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f); - SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase); - // send this too, sometimes it resets :S - SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, m_neutralValuePct); -} - -void OPvPCapturePointEP_PWT::FillInitialWorldStates(WorldPacket &data) -{ - data << EP_PWT_A << uint32(bool(m_TowerState & EP_TS_A)); - data << EP_PWT_H << uint32(bool(m_TowerState & EP_TS_H)); - data << EP_PWT_N_A << uint32(bool(m_TowerState & EP_TS_N_A)); - data << EP_PWT_N_H << uint32(bool(m_TowerState & EP_TS_N_H)); - data << EP_PWT_N << uint32(bool(m_TowerState & EP_TS_N)); -} - -void OPvPCapturePointEP_PWT::UpdateTowerState() -{ - m_PvP->SendUpdateWorldState(EP_PWT_A, bool(m_TowerState & EP_TS_A)); - m_PvP->SendUpdateWorldState(EP_PWT_H, bool(m_TowerState & EP_TS_H)); - m_PvP->SendUpdateWorldState(EP_PWT_N_A, bool(m_TowerState & EP_TS_N_A)); - m_PvP->SendUpdateWorldState(EP_PWT_N_H, bool(m_TowerState & EP_TS_N_H)); - m_PvP->SendUpdateWorldState(EP_PWT_N, bool(m_TowerState & EP_TS_N)); -} - -bool OPvPCapturePointEP_PWT::HandlePlayerEnter(Player* player) -{ - if (OPvPCapturePoint::HandlePlayerEnter(player)) - { - player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 1); - uint32 phase = (uint32)ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f); - player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, phase); - player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, m_neutralValuePct); - return true; - } - return false; -} - -void OPvPCapturePointEP_PWT::HandlePlayerLeave(Player* player) -{ - player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 0); - OPvPCapturePoint::HandlePlayerLeave(player); -} - -void OPvPCapturePointEP_PWT::SummonFlightMaster(uint32 team) -{ - if (m_FlightMasterSpawned != team) - { - m_FlightMasterSpawned = team; - DelCreature(EP_PWT_FLIGHTMASTER); - AddCreature(EP_PWT_FLIGHTMASTER, EP_PWT_FlightMaster.entry, team, EP_PWT_FlightMaster.map, EP_PWT_FlightMaster.x, EP_PWT_FlightMaster.y, EP_PWT_FlightMaster.z, EP_PWT_FlightMaster.o); - /* - // sky - we need update gso code - - Creature* c = HashMapHolder::Find(m_Creatures[EP_PWT_FLIGHTMASTER]); - //Spawn flight master as friendly to capturing team - c->SetUInt32Value(GAMEOBJECT_FACTION, (team == ALLIANCE ? 55 : 68)); - if (c) - { - GossipOption gso; - gso.Action = GOSSIP_OPTION_OUTDOORPVP; - gso.GossipId = 0; - gso.OptionText.assign(sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_FLIGHT_NPT)); - gso.Id = 50; - gso.Icon = 0; - gso.NpcFlag = 0; - gso.BoxMoney = 0; - gso.Coded = false; - c->addGossipOption(gso); - - gso.Action = GOSSIP_OPTION_OUTDOORPVP; - gso.GossipId = 0; - gso.OptionText.assign(sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_FLIGHT_EWT)); - gso.Id = 50; - gso.Icon = 0; - gso.NpcFlag = 0; - gso.BoxMoney = 0; - gso.Coded = false; - c->addGossipOption(gso); - - gso.Action = GOSSIP_OPTION_OUTDOORPVP; - gso.GossipId = 0; - gso.OptionText.assign(sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_FLIGHT_CGT)); - gso.Id = 50; - gso.Icon = 0; - gso.NpcFlag = 0; - gso.BoxMoney = 0; - gso.Coded = false; - c->addGossipOption(gso); - } - */ - } -} - -// ep -OutdoorPvPEP::OutdoorPvPEP() -{ - m_TypeId = OUTDOOR_PVP_EP; - memset(EP_Controls, 0, sizeof(EP_Controls)); - m_AllianceTowersControlled = 0; - m_HordeTowersControlled = 0; -} - -bool OutdoorPvPEP::SetupOutdoorPvP() -{ - for (uint8 i = 0; i < EPBuffZonesNum; ++i) - RegisterZone(EPBuffZones[i]); - - AddCapturePoint(new OPvPCapturePointEP_EWT(this)); - AddCapturePoint(new OPvPCapturePointEP_PWT(this)); - AddCapturePoint(new OPvPCapturePointEP_CGT(this)); - AddCapturePoint(new OPvPCapturePointEP_NPT(this)); - return true; -} - -bool OutdoorPvPEP::Update(uint32 diff) -{ - if (OutdoorPvP::Update(diff)) - { - m_AllianceTowersControlled = 0; - m_HordeTowersControlled = 0; - for (int i = 0; i < EP_TOWER_NUM; ++i) - { - if (EP_Controls[i] == ALLIANCE) - ++m_AllianceTowersControlled; - else if (EP_Controls[i] == HORDE) - ++m_HordeTowersControlled; - SendUpdateWorldState(EP_UI_TOWER_COUNT_A, m_AllianceTowersControlled); - SendUpdateWorldState(EP_UI_TOWER_COUNT_H, m_HordeTowersControlled); - BuffTeams(); - } - return true; - } - return false; -} - -void OutdoorPvPEP::HandlePlayerEnterZone(Player* player, uint32 zone) -{ - // add buffs - if (player->GetTeam() == ALLIANCE) - { - if (m_AllianceTowersControlled && m_AllianceTowersControlled < 5) - player->CastSpell(player, EP_AllianceBuffs[m_AllianceTowersControlled-1], true); - } - else - { - if (m_HordeTowersControlled && m_HordeTowersControlled < 5) - player->CastSpell(player, EP_HordeBuffs[m_HordeTowersControlled-1], true); - } - OutdoorPvP::HandlePlayerEnterZone(player, zone); -} - -void OutdoorPvPEP::HandlePlayerLeaveZone(Player* player, uint32 zone) -{ - // remove buffs - if (player->GetTeam() == ALLIANCE) - { - for (int i = 0; i < 4; ++i) - player->RemoveAurasDueToSpell(EP_AllianceBuffs[i]); - } - else - { - for (int i = 0; i < 4; ++i) - player->RemoveAurasDueToSpell(EP_HordeBuffs[i]); - } - OutdoorPvP::HandlePlayerLeaveZone(player, zone); -} - -void OutdoorPvPEP::BuffTeams() -{ - for (PlayerSet::iterator itr = m_players[0].begin(); itr != m_players[0].end(); ++itr) - { - Player* player = *itr; - { - for (int i = 0; i < 4; ++i) - player->RemoveAurasDueToSpell(EP_AllianceBuffs[i]); - if (m_AllianceTowersControlled && m_AllianceTowersControlled < 5) - player->CastSpell(player, EP_AllianceBuffs[m_AllianceTowersControlled-1], true); - } - } - for (PlayerSet::iterator itr = m_players[1].begin(); itr != m_players[1].end(); ++itr) - { - Player* player = *itr; - { - for (int i = 0; i < 4; ++i) - player->RemoveAurasDueToSpell(EP_HordeBuffs[i]); - if (m_HordeTowersControlled && m_HordeTowersControlled < 5) - player->CastSpell(player, EP_HordeBuffs[m_HordeTowersControlled-1], true); - } - } -} - -void OutdoorPvPEP::SetControlledState(uint32 index, uint32 state) -{ - EP_Controls[index] = state; -} - -void OutdoorPvPEP::FillInitialWorldStates(WorldPacket & data) -{ - data << EP_UI_TOWER_COUNT_A << m_AllianceTowersControlled; - data << EP_UI_TOWER_COUNT_H << m_HordeTowersControlled; - data << EP_UI_TOWER_SLIDER_DISPLAY << uint32(0); - data << EP_UI_TOWER_SLIDER_POS << uint32(50); - data << EP_UI_TOWER_SLIDER_N << uint32(100); - for (OPvPCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr) - { - itr->second->FillInitialWorldStates(data); - } -} - -void OutdoorPvPEP::SendRemoveWorldStates(Player* player) -{ - player->SendUpdateWorldState(EP_UI_TOWER_COUNT_A, 0); - player->SendUpdateWorldState(EP_UI_TOWER_COUNT_H, 0); - player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_DISPLAY, 0); - player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_POS, 0); - player->SendUpdateWorldState(EP_UI_TOWER_SLIDER_N, 0); - - player->SendUpdateWorldState(EP_EWT_A, 0); - player->SendUpdateWorldState(EP_EWT_H, 0); - player->SendUpdateWorldState(EP_EWT_N, 0); - player->SendUpdateWorldState(EP_EWT_N_A, 0); - player->SendUpdateWorldState(EP_EWT_N_H, 0); - - player->SendUpdateWorldState(EP_PWT_A, 0); - player->SendUpdateWorldState(EP_PWT_H, 0); - player->SendUpdateWorldState(EP_PWT_N, 0); - player->SendUpdateWorldState(EP_PWT_N_A, 0); - player->SendUpdateWorldState(EP_PWT_N_H, 0); - - player->SendUpdateWorldState(EP_NPT_A, 0); - player->SendUpdateWorldState(EP_NPT_H, 0); - player->SendUpdateWorldState(EP_NPT_N, 0); - player->SendUpdateWorldState(EP_NPT_N_A, 0); - player->SendUpdateWorldState(EP_NPT_N_H, 0); - - player->SendUpdateWorldState(EP_CGT_A, 0); - player->SendUpdateWorldState(EP_CGT_H, 0); - player->SendUpdateWorldState(EP_CGT_N, 0); - player->SendUpdateWorldState(EP_CGT_N_A, 0); - player->SendUpdateWorldState(EP_CGT_N_H, 0); -} - -class OutdoorPvP_eastern_plaguelands : public OutdoorPvPScript -{ - public: - - OutdoorPvP_eastern_plaguelands() - : OutdoorPvPScript("outdoorpvp_ep") - { - } - - OutdoorPvP* GetOutdoorPvP() const - { - return new OutdoorPvPEP(); - } -}; - -void AddSC_outdoorpvp_ep() -{ - new OutdoorPvP_eastern_plaguelands(); -} diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPEP.h b/src/server/scripts/OutdoorPvP/OutdoorPvPEP.h deleted file mode 100755 index 14712e0150d..00000000000 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPEP.h +++ /dev/null @@ -1,331 +0,0 @@ -/* - * Copyright (C) 2008-2012 TrinityCore - * - * 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; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; 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, see . - */ - -#ifndef OUTDOOR_PVP_EP_ -#define OUTDOOR_PVP_EP_ - -#include "DBCStructure.h" -#include "OutdoorPvP.h" - -const uint32 EP_AllianceBuffs[4] = {11413, 11414, 11415, 1386}; - -const uint32 EP_HordeBuffs[4] = {30880, 30683, 30682, 29520}; - -const uint32 EP_GraveYardZone = 139; - -const uint32 EP_GraveYardId = 927; - -const uint8 EPBuffZonesNum = 3; - -const uint32 EP_EWT_CM = 17690; -const uint32 EP_CGT_CM = 17689; -const uint32 EP_NPT_CM = 17696; -const uint32 EP_PWT_CM = 17698; - -const uint32 EPBuffZones[EPBuffZonesNum] = {139, 2017, 2057}; - -enum EP_TaxiNodes -{ - EP_CGT_Taxi = 87, - EP_EWT_Taxi = 86, - EP_NPT_Taxi = 85, - EP_PWT_Taxi = 84 -}; - -enum EP_EastwallTowerWorldStates -{ - EP_EWT_A = 2354, - EP_EWT_H = 2356, - EP_EWT_N_A = 2359, // ally conquested - EP_EWT_N_H = 2360, - EP_EWT_N = 2361 -}; - -enum EP_NorthpassTowerWorldStates -{ - EP_NPT_N = 2352, - EP_NPT_N_A = 2362, - EP_NPT_N_H = 2363, - EP_NPT_A = 2372, - EP_NPT_H = 2373 -}; - -enum EP_PlagewoodTowerWorldStates -{ - EP_PWT_N_A = 2366, - EP_PWT_N_H = 2353, //2367 not present! use neutral! - EP_PWT_A = 2370, - EP_PWT_H = 2371, - EP_PWT_N = 2353 -}; - -enum EP_CrownGuardTowerWorldStates -{ - EP_CGT_N_A = 2374, - EP_CGT_N_H = 2375, - EP_CGT_A = 2378, - EP_CGT_H = 2379, - EP_CGT_N = 2355 -}; - -enum EP_WorldStates -{ - EP_UI_TOWER_SLIDER_DISPLAY = 2426, - EP_UI_TOWER_SLIDER_POS = 2427, - EP_UI_TOWER_SLIDER_N = 2428, - - EP_UI_TOWER_COUNT_A = 2327, - EP_UI_TOWER_COUNT_H = 2328 -}; - -enum EP_Summons -{ - EP_EWT_COMMANDER = 0, - EP_EWT_SOLDIER1, - EP_EWT_SOLDIER2, - EP_EWT_SOLDIER3, - EP_EWT_SOLDIER4, - EP_PWT_FLIGHTMASTER, -}; - -enum EP_GoSummons -{ - EP_NPT_BUFF = 0, - EP_NPT_FLAGS, - EP_EWT_FLAGS, - EP_CGT_FLAGS, - EP_PWT_FLAGS -}; - -enum EP_Towers -{ - EP_EWT = 0, // plaguelands 03 - EP_NPT, // plaguelands 01 - EP_PWT, // plaguelands 04 - EP_CGT, // plaguelands 02 - EP_TOWER_NUM -}; - -const go_type EPCapturePoints[EP_TOWER_NUM] = -{ - {182097, 0, 2574.51f, -4794.89f, 144.704f, -1.45003f, -0.097056f, 0.095578f, -0.656229f, 0.742165f}, - {181899, 0, 3181.08f, -4379.36f, 174.123f, -2.03472f, -0.065392f, 0.119494f, -0.842275f, 0.521553f}, - {182098, 0, 2962.71f, -3042.31f, 154.789f, 2.08426f, -0.074807f, -0.113837f, 0.855928f, 0.49883f}, - {182096, 0, 1860.85f, -3731.23f, 196.716f, -2.53214f, 0.033967f, -0.131914f, 0.944741f, -0.298177f} -}; - -const go_type EPTowerFlags[EP_TOWER_NUM] = -{ - {182106, 0, 2569.60f, -4772.93f, 115.399f, 2.72271f, 0.0f, 0.0f, 0.978148f, 0.207912f}, - {182106, 0, 3148.17f, -4365.51f, 145.029f, 1.53589f, 0.0f, 0.0f, 0.694658f, 0.71934f}, - {182106, 0, 2992.63f, -3022.95f, 125.593f, 3.03687f, 0.0f, 0.0f, 0.99863f, 0.052336f}, - {182106, 0, 1838.42f, -3703.56f, 167.713f, 0.890118f, 0.0f, 0.0f, 0.430511f, 0.902585f} -}; - -const uint32 EPTowerPlayerEnterEvents[EP_TOWER_NUM] = {10691, 10699, 10701, 10705}; - -const uint32 EPTowerPlayerLeaveEvents[EP_TOWER_NUM] = {10692, 10698, 10700, 10704}; - -const uint8 EP_NUM_CREATURES = 6; -const uint8 EP_EWT_NUM_CREATURES = 5; - -// one lordaeron commander, 4 soldiers -// should be spawned at EWT and follow a path, but trans-grid pathing isn't safe, so summon them directly at NPT -const creature_type EP_EWT_Summons_A[EP_EWT_NUM_CREATURES] = -{ - {17635, 469, 0, 3167.61f, -4352.09f, 138.20f, 4.5811f}, - {17647, 469, 0, 3172.74f, -4352.99f, 139.14f, 4.9873f}, - {17647, 469, 0, 3165.89f, -4354.46f, 138.67f, 3.7244f}, - {17647, 469, 0, 3164.65f, -4350.26f, 138.22f, 2.4794f}, - {17647, 469, 0, 3169.91f, -4349.68f, 138.37f, 0.7444f} -}; - -const creature_type EP_EWT_Summons_H[EP_EWT_NUM_CREATURES] = -{ - {17995, 67, 0, 3167.61f, -4352.09f, 138.20f, 4.5811f}, - {17996, 67, 0, 3172.74f, -4352.99f, 139.14f, 4.9873f}, - {17996, 67, 0, 3165.89f, -4354.46f, 138.67f, 3.7244f}, - {17996, 67, 0, 3164.65f, -4350.26f, 138.22f, 2.4794f}, - {17996, 67, 0, 3169.91f, -4349.68f, 138.37f, 0.7444f} -}; - -enum EP_TowerStates -{ - EP_TS_N = 1, - EP_TS_N_A = 2, - EP_TS_N_H = 4, - EP_TS_A_P = 8, - EP_TS_H_P = 16, - EP_TS_A = 32, - EP_TS_H = 64 -}; - -// when spawning, pay attention at setting the faction manually! -const creature_type EP_PWT_FlightMaster = {17209, 0, 0, 2987.5f, -3049.11f, 120.126f, 5.75959f}; - -// after spawning, modify the faction so that only the controller will be able to use it with SetUInt32Value(GAMEOBJECT_FACTION, faction_id); -const go_type EP_NPT_LordaeronShrine = {181682, 0, 3167.72f, -4355.91f, 138.785f, 1.69297f, 0.0f, 0.0f, 0.748956f, 0.66262f}; - -class OutdoorPvPEP; - -class OPvPCapturePointEP_EWT : public OPvPCapturePoint -{ - public: - - OPvPCapturePointEP_EWT(OutdoorPvP* pvp); - - void ChangeState(); - - void SendChangePhase(); - - void FillInitialWorldStates(WorldPacket & data); - - // used when player is activated/inactivated in the area - bool HandlePlayerEnter(Player* player); - void HandlePlayerLeave(Player* player); - - protected: - - void SummonSupportUnitAtNorthpassTower(uint32 team); - - void UpdateTowerState(); - - protected: - - uint32 m_TowerState; - - uint32 m_UnitsSummonedSide; -}; - -class OPvPCapturePointEP_NPT : public OPvPCapturePoint -{ - public: - - OPvPCapturePointEP_NPT(OutdoorPvP* pvp); - - void ChangeState(); - - void SendChangePhase(); - - void FillInitialWorldStates(WorldPacket & data); - - // used when player is activated/inactivated in the area - bool HandlePlayerEnter(Player* player); - void HandlePlayerLeave(Player* player); - - protected: - - void SummonGO(uint32 team); - - void UpdateTowerState(); - - protected: - - uint32 m_TowerState; - - uint32 m_SummonedGOSide; -}; - -class OPvPCapturePointEP_CGT : public OPvPCapturePoint -{ - public: - - OPvPCapturePointEP_CGT(OutdoorPvP* pvp); - - void ChangeState(); - - void SendChangePhase(); - - void FillInitialWorldStates(WorldPacket & data); - - // used when player is activated/inactivated in the area - bool HandlePlayerEnter(Player* player); - void HandlePlayerLeave(Player* player); - - protected: - - void LinkGraveYard(uint32 team); - - void UpdateTowerState(); - - protected: - - uint32 m_TowerState; - - uint32 m_GraveyardSide; -}; - -class OPvPCapturePointEP_PWT : public OPvPCapturePoint -{ - public: - - OPvPCapturePointEP_PWT(OutdoorPvP* pvp); - - void ChangeState(); - - void SendChangePhase(); - - void FillInitialWorldStates(WorldPacket & data); - - // used when player is activated/inactivated in the area - bool HandlePlayerEnter(Player* player); - void HandlePlayerLeave(Player* player); - - protected: - - void SummonFlightMaster(uint32 team); - - void UpdateTowerState(); - - protected: - - uint32 m_FlightMasterSpawned; - - uint32 m_TowerState; -}; - -class OutdoorPvPEP : public OutdoorPvP -{ - public: - - OutdoorPvPEP(); - - bool SetupOutdoorPvP(); - - void HandlePlayerEnterZone(Player* player, uint32 zone); - void HandlePlayerLeaveZone(Player* player, uint32 zone); - - bool Update(uint32 diff); - - void FillInitialWorldStates(WorldPacket &data); - - void SendRemoveWorldStates(Player* player); - - void BuffTeams(); - - void SetControlledState(uint32 index, uint32 state); - - private: - - // how many towers are controlled - uint32 EP_Controls[EP_TOWER_NUM]; - - uint32 m_AllianceTowersControlled; - uint32 m_HordeTowersControlled; -}; - -#endif -- cgit v1.2.3 From 07e645d024bc3c3fb5a2707e51ca807e63225594 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 25 Aug 2012 15:36:45 +0200 Subject: Core/Guilds: Save guild achievements to database periodically and when a member logs out. --- src/server/game/Guilds/Guild.cpp | 11 +++++++++++ src/server/game/Guilds/Guild.h | 2 ++ src/server/game/Guilds/GuildMgr.cpp | 6 ++++++ src/server/game/Guilds/GuildMgr.h | 2 ++ src/server/game/World/World.cpp | 11 +++++++++++ src/server/game/World/World.h | 2 ++ src/server/worldserver/worldserver.conf.dist | 8 ++++++++ 7 files changed, 42 insertions(+) (limited to 'src') diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 4b193b62b2b..595ad77feeb 100644 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -1119,6 +1119,15 @@ void Guild::Disband() sGuildMgr->RemoveGuild(m_id); } +void Guild::SaveToDB() +{ + SQLTransaction trans = CharacterDatabase.BeginTransaction(); + + m_achievementMgr.SaveToDB(trans); + + CharacterDatabase.CommitTransaction(trans); +} + /////////////////////////////////////////////////////////////////////////////// // HANDLE CLIENT COMMANDS void Guild::HandleRoster(WorldSession* session /*= NULL*/) @@ -1833,6 +1842,8 @@ void Guild::HandleMemberLogout(WorldSession* session) member->UpdateLogoutTime(); } _BroadcastEvent(GE_SIGNED_OFF, player->GetGUID(), player->GetName()); + + SaveToDB(); } void Guild::HandleDisband(WorldSession* session) diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h index 67888f636ff..565420052ec 100755 --- a/src/server/game/Guilds/Guild.h +++ b/src/server/game/Guilds/Guild.h @@ -623,6 +623,8 @@ public: bool Create(Player* pLeader, const std::string& name); void Disband(); + void SaveToDB(); + // Getters uint32 GetId() const { return m_id; } uint64 GetGUID() const { return MAKE_NEW_GUID(m_id, 0, HIGHGUID_GUILD); } diff --git a/src/server/game/Guilds/GuildMgr.cpp b/src/server/game/Guilds/GuildMgr.cpp index 473fe32ec27..04b0cfeaa39 100644 --- a/src/server/game/Guilds/GuildMgr.cpp +++ b/src/server/game/Guilds/GuildMgr.cpp @@ -39,6 +39,12 @@ void GuildMgr::RemoveGuild(uint32 guildId) GuildStore.erase(guildId); } +void GuildMgr::SaveGuilds() +{ + for (GuildContainer::iterator itr = GuildStore.begin(); itr != GuildStore.end(); ++itr) + itr->second->SaveToDB(); +} + uint32 GuildMgr::GenerateGuildId() { if (NextGuildId >= 0xFFFFFFFE) diff --git a/src/server/game/Guilds/GuildMgr.h b/src/server/game/Guilds/GuildMgr.h index d9c18a8026d..4b999c9231a 100644 --- a/src/server/game/Guilds/GuildMgr.h +++ b/src/server/game/Guilds/GuildMgr.h @@ -40,6 +40,8 @@ public: void AddGuild(Guild* guild); void RemoveGuild(uint32 guildId); + void SaveGuilds(); + uint32 GenerateGuildId(); void SetNextGuildId(uint32 Id) { NextGuildId = Id; } diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 936b2d3629b..6fc74dd5e1e 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1197,6 +1197,9 @@ void World::LoadConfigSettings(bool reload) // MySQL ping time interval m_int_configs[CONFIG_DB_PING_INTERVAL] = ConfigMgr::GetIntDefault("MaxPingTime", 30); + // Guild save interval + m_int_configs[CONFIG_GUILD_SAVE_INTERVAL] = ConfigMgr::GetIntDefault("GuildSaveInterval", 15); + // misc m_bool_configs[CONFIG_PDUMP_NO_PATHS] = ConfigMgr::GetBoolDefault("PlayerDump.DisallowPaths", true); m_bool_configs[CONFIG_PDUMP_NO_OVERWRITE] = ConfigMgr::GetBoolDefault("PlayerDump.DisallowOverwrite", true); @@ -1679,6 +1682,8 @@ void World::SetInitialWorldSettings() m_timers[WUPDATE_PINGDB].SetInterval(getIntConfig(CONFIG_DB_PING_INTERVAL)*MINUTE*IN_MILLISECONDS); // Mysql ping time in minutes + m_timers[WUPDATE_GUILDSAVE].SetInterval(getIntConfig(CONFIG_GUILD_SAVE_INTERVAL) * MINUTE * IN_MILLISECONDS); + //to set mailtimer to return mails every day between 4 and 5 am //mailtimer is increased when updating auctions //one second is 1000 -(tested on win system) @@ -2035,6 +2040,12 @@ void World::Update(uint32 diff) WorldDatabase.KeepAlive(); } + if (m_timers[WUPDATE_GUILDSAVE].Passed()) + { + m_timers[WUPDATE_GUILDSAVE].Reset(); + sGuildMgr->SaveGuilds(); + } + // update the instance reset times sInstanceSaveMgr->Update(); diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h index 841ae2530ca..b25444f4865 100755 --- a/src/server/game/World/World.h +++ b/src/server/game/World/World.h @@ -86,6 +86,7 @@ enum WorldTimers WUPDATE_MAILBOXQUEUE, WUPDATE_DELETECHARS, WUPDATE_PINGDB, + WUPDATE_GUILDSAVE, WUPDATE_COUNT }; @@ -335,6 +336,7 @@ enum WorldIntConfigs CONFIG_WINTERGRASP_BATTLETIME, CONFIG_WINTERGRASP_NOBATTLETIME, CONFIG_WINTERGRASP_RESTART_AFTER_CRASH, + CONFIG_GUILD_SAVE_INTERVAL, INT_CONFIG_VALUE_COUNT }; diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index fbd45bec8e1..a720255ad21 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -391,6 +391,14 @@ CleanCharacterDB = 0 PersistentCharacterCleanFlags = 0 +# +# GuildSaveInterval +# Description: Time (in minutes) between guild experience saves +# Default: 15 +# + +GuildSaveInterval = 15 + # ################################################################################################### -- cgit v1.2.3 From 71ca10681408b6d5098a3718ea61b54f91d5f803 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Sun, 26 Aug 2012 04:43:08 +0200 Subject: Core/Spells: Implement visual spells for priest shadowform --- .../2012_08_26_00_world_spell_script_names_434.sql | 3 ++ src/server/scripts/Spells/spell_priest.cpp | 47 ++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 sql/updates/world/2012_08_26_00_world_spell_script_names_434.sql (limited to 'src') diff --git a/sql/updates/world/2012_08_26_00_world_spell_script_names_434.sql b/sql/updates/world/2012_08_26_00_world_spell_script_names_434.sql new file mode 100644 index 00000000000..d9bb921bf8a --- /dev/null +++ b/sql/updates/world/2012_08_26_00_world_spell_script_names_434.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `spell_id`=15473; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(15473,'spell_pri_shadowform'); diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index 3d8ca3e729b..da4229ff175 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -39,6 +39,9 @@ enum PriestSpells PRIEST_ICON_ID_EMPOWERED_RENEW_TALENT = 3021, PRIEST_ICON_ID_PAIN_AND_SUFFERING = 2874, PRIEST_SHADOW_WORD_DEATH = 32409, + PRIEST_SHADOWFORM_VISUAL_WITHOUT_GLYPH = 107903, + PRIEST_SHADOWFORM_VISUAL_WITH_GLYPH = 107904, + PRIEST_GLYPH_OF_SHADOW = 107906, }; // Guardian Spirit @@ -449,6 +452,49 @@ class spell_pri_shadow_word_death : public SpellScriptLoader } }; +class spell_pri_shadowform : public SpellScriptLoader +{ + public: + spell_pri_shadowform() : SpellScriptLoader("spell_pri_shadowform") { } + + class spell_pri_shadowform_AuraScript : public AuraScript + { + PrepareAuraScript(spell_pri_shadowform_AuraScript); + + bool Validate(SpellInfo const* /*entry*/) + { + if (!sSpellMgr->GetSpellInfo(PRIEST_SHADOWFORM_VISUAL_WITHOUT_GLYPH) || + !sSpellMgr->GetSpellInfo(PRIEST_SHADOWFORM_VISUAL_WITH_GLYPH)) + return false; + return true; + } + + void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (GetTarget()->HasAura(PRIEST_GLYPH_OF_SHADOW)) + GetTarget()->CastSpell(GetTarget(), PRIEST_SHADOWFORM_VISUAL_WITH_GLYPH, true); + else + GetTarget()->CastSpell(GetTarget(), PRIEST_SHADOWFORM_VISUAL_WITHOUT_GLYPH, true); + } + + void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + GetTarget()->RemoveAurasDueToSpell(GetTarget()->HasAura(PRIEST_GLYPH_OF_SHADOW) ? PRIEST_SHADOWFORM_VISUAL_WITH_GLYPH : PRIEST_SHADOWFORM_VISUAL_WITHOUT_GLYPH); + } + + void Register() + { + AfterEffectApply += AuraEffectApplyFn(spell_pri_shadowform_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_MOD_SHAPESHIFT, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + AfterEffectRemove += AuraEffectRemoveFn(spell_pri_shadowform_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_MOD_SHAPESHIFT, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_pri_shadowform_AuraScript(); + } +}; + void AddSC_priest_spell_scripts() { new spell_pri_guardian_spirit(); @@ -461,4 +507,5 @@ void AddSC_priest_spell_scripts() new spell_pri_vampiric_touch(); new spell_priest_renew(); new spell_pri_shadow_word_death(); + new spell_pri_shadowform(); } -- cgit v1.2.3 From 50bed7eb4bba6709dfab2c2e28ceb5bf9e4c931b Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Sun, 26 Aug 2012 05:05:05 +0200 Subject: Core/Spells: Cleanup in 71ca10681408b6d5098a3718ea61b54f91d5f803 /slap me --- src/server/scripts/Spells/spell_priest.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index da4229ff175..be5ec311c39 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -471,10 +471,7 @@ class spell_pri_shadowform : public SpellScriptLoader void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - if (GetTarget()->HasAura(PRIEST_GLYPH_OF_SHADOW)) - GetTarget()->CastSpell(GetTarget(), PRIEST_SHADOWFORM_VISUAL_WITH_GLYPH, true); - else - GetTarget()->CastSpell(GetTarget(), PRIEST_SHADOWFORM_VISUAL_WITHOUT_GLYPH, true); + GetTarget()->CastSpell(GetTarget(), GetTarget()->HasAura(PRIEST_GLYPH_OF_SHADOW) ? PRIEST_SHADOWFORM_VISUAL_WITH_GLYPH : PRIEST_SHADOWFORM_VISUAL_WITHOUT_GLYPH, true); } void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) -- cgit v1.2.3 From 974310ffe6a4ea75fa474cb146be6b5cf66c7f9c Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 27 Aug 2012 00:12:53 +0100 Subject: Core/Groups: Update to group opcode related structs - Should fix group creation. - Enabled/fixed opcodes: CMSG_GROUP_RAID_CONVERT, CMSG_REQUEST_PARTY_MEMBER_STATS, MSG_RAID_READY_CHECK_CONFIRM, SMSG_GROUP_DESTROYED, SMSG_GROUP_LIST, SMSG_GROUP_UNINVITE, SMSG_PARTY_MEMBER_STATS(_FULL) and SMSG_RAID_GROUP_ONLY - Based on WPP and the work of Zakamurite --- src/server/game/Entities/Player/Player.cpp | 4 - src/server/game/Groups/Group.cpp | 3 +- src/server/game/Groups/Group.h | 58 ++++++------ src/server/game/Handlers/GroupHandler.cpp | 134 ++++++++++++++++++++++------ src/server/game/Server/Protocol/Opcodes.cpp | 18 ++-- 5 files changed, 149 insertions(+), 68 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index f84ff1ead1d..e20956879b3 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -7598,13 +7598,9 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea) { SetGroupUpdateFlag(GROUP_UPDATE_FULL); if (GetSession() && group->isLFGGroup() && sLFGMgr->IsTeleported(GetGUID())) - { for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) - { if (Player* member = itr->getSource()) GetSession()->SendNameQueryOpcode(member->GetGUID()); - } - } } m_zoneUpdateId = newZone; diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index d0bbaffacea..b9ede2ec985 100755 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -1531,6 +1531,7 @@ void Group::SendUpdateToPlayer(uint64 playerGUID, MemberSlot* slot) { data << uint8(sLFGMgr->GetState(m_guid) == LFG_STATE_FINISHED_DUNGEON ? 2 : 0); // FIXME - Dungeon save status? 2 = done data << uint32(sLFGMgr->GetDungeon(m_guid)); + data << uint8(0); // 4.x new } data << uint64(m_guid); @@ -1543,7 +1544,7 @@ void Group::SendUpdateToPlayer(uint64 playerGUID, MemberSlot* slot) Player* member = ObjectAccessor::FindPlayer(citr->guid); - uint8 onlineState = (member) ? MEMBER_STATUS_ONLINE : MEMBER_STATUS_OFFLINE; + uint8 onlineState = member ? MEMBER_STATUS_ONLINE : MEMBER_STATUS_OFFLINE; onlineState = onlineState | ((isBGGroup() || isBFGroup()) ? MEMBER_STATUS_PVP : 0); data << citr->name; diff --git a/src/server/game/Groups/Group.h b/src/server/game/Groups/Group.h index e6da9caea32..5d3bcdd48a3 100755 --- a/src/server/game/Groups/Group.h +++ b/src/server/game/Groups/Group.h @@ -96,36 +96,38 @@ enum GroupType enum GroupUpdateFlags { GROUP_UPDATE_FLAG_NONE = 0x00000000, // nothing - GROUP_UPDATE_FLAG_STATUS = 0x00000001, // uint16, flags - GROUP_UPDATE_FLAG_CUR_HP = 0x00000002, // uint32 - GROUP_UPDATE_FLAG_MAX_HP = 0x00000004, // uint32 - GROUP_UPDATE_FLAG_POWER_TYPE = 0x00000008, // uint8 - GROUP_UPDATE_FLAG_CUR_POWER = 0x00000010, // uint16 - GROUP_UPDATE_FLAG_MAX_POWER = 0x00000020, // uint16 - GROUP_UPDATE_FLAG_LEVEL = 0x00000040, // uint16 - GROUP_UPDATE_FLAG_ZONE = 0x00000080, // uint16 - GROUP_UPDATE_FLAG_POSITION = 0x00000100, // uint16, uint16 - GROUP_UPDATE_FLAG_AURAS = 0x00000200, // uint64 mask, for each bit set uint32 spellid + uint8 unk - GROUP_UPDATE_FLAG_PET_GUID = 0x00000400, // uint64 pet guid - GROUP_UPDATE_FLAG_PET_NAME = 0x00000800, // pet name, NULL terminated string - GROUP_UPDATE_FLAG_PET_MODEL_ID = 0x00001000, // uint16, model id - GROUP_UPDATE_FLAG_PET_CUR_HP = 0x00002000, // uint32 pet cur health - GROUP_UPDATE_FLAG_PET_MAX_HP = 0x00004000, // uint32 pet max health - GROUP_UPDATE_FLAG_PET_POWER_TYPE = 0x00008000, // uint8 pet power type - GROUP_UPDATE_FLAG_PET_CUR_POWER = 0x00010000, // uint16 pet cur power - GROUP_UPDATE_FLAG_PET_MAX_POWER = 0x00020000, // uint16 pet max power - GROUP_UPDATE_FLAG_PET_AURAS = 0x00040000, // uint64 mask, for each bit set uint32 spellid + uint8 unk, pet auras... - GROUP_UPDATE_FLAG_VEHICLE_SEAT = 0x00080000, // uint8, uint64, if (uint32 != 0) { uint32, if (uint16 & 0x40) { uint32, uint32, uint32 } } - GROUP_UPDATE_FLAG_UNKNOWN_1 = 0x00100000, // uint32 - GROUP_UPDATE_FLAG_UNKNOWN_2 = 0x00200000, // uint32, uint32, string - GROUP_UPDATE_PET = 0x0007FC00, // all pet flags - GROUP_UPDATE_FULL = 0x0007FFFF, // all known flags + GROUP_UPDATE_FLAG_STATUS = 0x00000001, // uint16 (GroupMemberStatusFlag) + GROUP_UPDATE_FLAG_CUR_HP = 0x00000002, // uint32 (HP) + GROUP_UPDATE_FLAG_MAX_HP = 0x00000004, // uint32 (HP) + GROUP_UPDATE_FLAG_POWER_TYPE = 0x00000008, // uint8 (PowerType) + GROUP_UPDATE_FLAG_CUR_POWER = 0x00000010, // int16 (power value) + GROUP_UPDATE_FLAG_MAX_POWER = 0x00000020, // int16 (power value) + GROUP_UPDATE_FLAG_LEVEL = 0x00000040, // uint16 (level value) + GROUP_UPDATE_FLAG_ZONE = 0x00000080, // uint16 (zone id) + GROUP_UPDATE_FLAG_UNK100 = 0x00000100, // int16 (unk) + GROUP_UPDATE_FLAG_POSITION = 0x00000200, // uint16 (x), uint16 (y), uint16 (z) + GROUP_UPDATE_FLAG_AURAS = 0x00000400, // uint8 (unk), uint64 (mask), uint32 (count), for each bit set: uint32 (spell id) + uint16 (AuraFlags) (if has flags Scalable -> 3x int32 (bps)) + GROUP_UPDATE_FLAG_PET_GUID = 0x00000800, // uint64 (pet guid) + GROUP_UPDATE_FLAG_PET_NAME = 0x00001000, // cstring (name, NULL terminated string) + GROUP_UPDATE_FLAG_PET_MODEL_ID = 0x00002000, // uint16 (model id) + GROUP_UPDATE_FLAG_PET_CUR_HP = 0x00004000, // uint32 (HP) + GROUP_UPDATE_FLAG_PET_MAX_HP = 0x00008000, // uint32 (HP) + GROUP_UPDATE_FLAG_PET_POWER_TYPE = 0x00010000, // uint8 (PowerType) + GROUP_UPDATE_FLAG_PET_CUR_POWER = 0x00020000, // uint16 (power value) + GROUP_UPDATE_FLAG_PET_MAX_POWER = 0x00040000, // uint16 (power value) + GROUP_UPDATE_FLAG_PET_AURAS = 0x00080000, // [see GROUP_UPDATE_FLAG_AURAS] + GROUP_UPDATE_FLAG_VEHICLE_SEAT = 0x00100000, // int32 (vehicle seat id) + GROUP_UPDATE_FLAG_PHASE = 0x00200000, // int32 (unk), uint32 (length), if length > 0, string (size 2*length), else cstring + + GROUP_UPDATE_PET = GROUP_UPDATE_FLAG_PET_GUID | GROUP_UPDATE_FLAG_PET_NAME | GROUP_UPDATE_FLAG_PET_MODEL_ID | + GROUP_UPDATE_FLAG_PET_CUR_HP | GROUP_UPDATE_FLAG_PET_MAX_HP | GROUP_UPDATE_FLAG_PET_POWER_TYPE | + GROUP_UPDATE_FLAG_PET_CUR_POWER | GROUP_UPDATE_FLAG_PET_MAX_POWER | GROUP_UPDATE_FLAG_PET_AURAS, // all pet flags + GROUP_UPDATE_FULL = GROUP_UPDATE_FLAG_STATUS | GROUP_UPDATE_FLAG_CUR_HP | GROUP_UPDATE_FLAG_MAX_HP | + GROUP_UPDATE_FLAG_POWER_TYPE | GROUP_UPDATE_FLAG_CUR_POWER | GROUP_UPDATE_FLAG_MAX_POWER | + GROUP_UPDATE_FLAG_LEVEL | GROUP_UPDATE_FLAG_ZONE | /* unk100 */ GROUP_UPDATE_FLAG_POSITION | + GROUP_UPDATE_FLAG_AURAS | GROUP_UPDATE_PET | GROUP_UPDATE_FLAG_VEHICLE_SEAT | GROUP_UPDATE_FLAG_PHASE, // all known flags }; -#define GROUP_UPDATE_FLAGS_COUNT 20 - // 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 -static const uint8 GroupUpdateLength[GROUP_UPDATE_FLAGS_COUNT] = { 0, 2, 2, 2, 1, 2, 2, 2, 2, 4, 8, 8, 1, 2, 2, 2, 1, 2, 2, 8}; - class Roll : public LootValidatorRef { public: diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp index ae549d76b33..590cd5ff63f 100644 --- a/src/server/game/Handlers/GroupHandler.cpp +++ b/src/server/game/Handlers/GroupHandler.cpp @@ -33,6 +33,7 @@ #include "Vehicle.h" #include "DB2Structure.h" #include "DB2Stores.h" +#include "SpellAuraEffects.h" class Aura; @@ -390,9 +391,8 @@ void WorldSession::HandleGroupInviteResponseOpcode(WorldPacket& recvData) return; // report - std::string name = std::string(GetPlayer()->GetName()); - WorldPacket data(SMSG_GROUP_DECLINE, name.length()); - data << name.c_str(); + WorldPacket data(SMSG_GROUP_DECLINE, strlen(GetPlayer()->GetName())); + data << GetPlayer()->GetName(); leader->GetSession()->SendPacket(&data); } } @@ -857,12 +857,7 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player* player, WorldPacke if (mask & GROUP_UPDATE_FLAG_PET_POWER_TYPE) // same for pets mask |= (GROUP_UPDATE_FLAG_PET_CUR_POWER | GROUP_UPDATE_FLAG_PET_MAX_POWER); - uint32 byteCount = 0; - for (int i = 1; i < GROUP_UPDATE_FLAGS_COUNT; ++i) - if (mask & (1 << i)) - byteCount += GroupUpdateLength[i]; - - data->Initialize(SMSG_PARTY_MEMBER_STATS, 8 + 4 + byteCount); + data->Initialize(SMSG_PARTY_MEMBER_STATS, 80); // average value data->append(player->GetPackGUID()); *data << (uint32) mask; @@ -901,20 +896,39 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player* player, WorldPacke if (mask & GROUP_UPDATE_FLAG_ZONE) *data << (uint16) player->GetZoneId(); + if (mask & GROUP_UPDATE_FLAG_UNK100) + *data << uint16(0); + if (mask & GROUP_UPDATE_FLAG_POSITION) - *data << (uint16) player->GetPositionX() << (uint16) player->GetPositionY(); + *data << (uint16) player->GetPositionX() << (uint16) player->GetPositionY() << (uint16) player->GetPositionZ(); if (mask & GROUP_UPDATE_FLAG_AURAS) { + *data << uint8(0); uint64 auramask = player->GetAuraUpdateMaskForRaid(); *data << uint64(auramask); + *data << uint32(MAX_AURAS); // count for (uint32 i = 0; i < MAX_AURAS; ++i) { if (auramask & (uint64(1) << i)) { AuraApplication const* aurApp = player->GetVisibleAura(i); - *data << uint32(aurApp ? aurApp->GetBase()->GetId() : 0); - *data << uint8(1); + if (!aurApp) + continue; // mhmm... + + *data << uint32(aurApp->GetBase()->GetId()); + *data << uint16(aurApp->GetFlags()); + + if (aurApp->GetFlags() & AFLAG_ANY_EFFECT_AMOUNT_SENT) + { + for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i) + { + if (AuraEffect const* eff = aurApp->GetBase()->GetEffect(i)) + *data << int32(eff->GetAmount()); + else + *data << int32(0); + } + } } } } @@ -994,21 +1008,44 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player* player, WorldPacke { if (pet) { + *data << uint8(0); uint64 auramask = pet->GetAuraUpdateMaskForRaid(); *data << uint64(auramask); + *data << uint32(MAX_AURAS); // count for (uint32 i = 0; i < MAX_AURAS; ++i) { if (auramask & (uint64(1) << i)) { - AuraApplication const* aurApp = player->GetVisibleAura(i); - *data << uint32(aurApp ? aurApp->GetBase()->GetId() : 0); - *data << uint8(1); + AuraApplication const* aurApp = pet->GetVisibleAura(i); + if (!aurApp) + continue; // mhmm... + + *data << uint32(aurApp->GetBase()->GetId()); + *data << uint16(aurApp->GetFlags()); + + if (aurApp->GetFlags() & AFLAG_ANY_EFFECT_AMOUNT_SENT) + { + for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i) + { + if (AuraEffect const* eff = aurApp->GetBase()->GetEffect(i)) + *data << int32(eff->GetAmount()); + else + *data << int32(0); + } + } } } } else *data << (uint64) 0; } + + if (mask & GROUP_UPDATE_FLAG_PHASE) + { + *data << uint32(8); // either 0 or 8, same unk found in SMSG_PHASESHIFT + *data << uint32(0); // count + // for (count) *data << uint16(phaseId) + } } /*this procedure handles clients CMSG_REQUEST_PARTY_MEMBER_STATS request*/ @@ -1036,9 +1073,14 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket& recvData) data << uint8(0); // only for SMSG_PARTY_MEMBER_STATS_FULL, probably arena/bg related data.append(player->GetPackGUID()); - uint32 mask1 = 0x00040BFF; // common mask, real flags used 0x000040BFF + uint32 mask1 = GROUP_UPDATE_FLAG_STATUS | GROUP_UPDATE_FLAG_CUR_HP | GROUP_UPDATE_FLAG_MAX_HP | + GROUP_UPDATE_FLAG_POWER_TYPE | GROUP_UPDATE_FLAG_CUR_POWER | GROUP_UPDATE_FLAG_MAX_POWER | + GROUP_UPDATE_FLAG_LEVEL | GROUP_UPDATE_FLAG_ZONE | GROUP_UPDATE_FLAG_POSITION | + GROUP_UPDATE_FLAG_AURAS | GROUP_UPDATE_FLAG_PET_NAME | GROUP_UPDATE_FLAG_PET_AURAS | + GROUP_UPDATE_FLAG_PHASE; + if (pet) - mask1 = 0x7FFFFFFF; // for hunters and other classes with pets + mask1 = 0x7FEFFEFF; // full mask & ~(GROUP_UPDATE_FLAG_VEHICLE_SEAT | GROUP_UPDATE_FLAG_UNK) (for hunters and other classes with pets) Powers powerType = player->getPowerType(); data << (uint32) mask1; // group update mask @@ -1052,17 +1094,34 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket& recvData) data << (uint16) player->GetZoneId(); // GROUP_UPDATE_FLAG_ZONE data << (uint16) player->GetPositionX(); // GROUP_UPDATE_FLAG_POSITION data << (uint16) player->GetPositionY(); // GROUP_UPDATE_FLAG_POSITION + data << (uint16) player->GetPositionZ(); // GROUP_UPDATE_FLAG_POSITION uint64 auramask = 0; size_t maskPos = data.wpos(); - data << (uint64) auramask; // placeholder + data << (uint8) 1; + data << (uint64) auramask; // placeholder + data << (uint32) MAX_AURAS; // count for (uint8 i = 0; i < MAX_AURAS; ++i) { - if (AuraApplication * aurApp = player->GetVisibleAura(i)) + if (auramask & (uint64(1) << i)) { - auramask |= (uint64(1) << i); - data << (uint32) aurApp->GetBase()->GetId(); - data << (uint8) 1; + AuraApplication const* aurApp = player->GetVisibleAura(i); + if (!aurApp) + continue; // mhmm... + + data << uint32(aurApp->GetBase()->GetId()); + data << uint16(aurApp->GetFlags()); + + if (aurApp->GetFlags() & AFLAG_ANY_EFFECT_AMOUNT_SENT) + { + for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i) + { + if (AuraEffect const* eff = aurApp->GetBase()->GetEffect(i)) + data << int32(eff->GetAmount()); + else + data << int32(0); + } + } } } data.put(maskPos, auramask); // GROUP_UPDATE_FLAG_AURAS @@ -1081,14 +1140,30 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket& recvData) uint64 petauramask = 0; size_t petMaskPos = data.wpos(); + data << (uint8) 1; data << (uint64) petauramask; // placeholder + data << (uint32) MAX_AURAS; // count for (uint8 i = 0; i < MAX_AURAS; ++i) { - if (AuraApplication * auraApp = pet->GetVisibleAura(i)) + if (auramask & (uint64(1) << i)) { - petauramask |= (uint64(1) << i); - data << (uint32) auraApp->GetBase()->GetId(); - data << (uint8) 1; + AuraApplication const* aurApp = pet->GetVisibleAura(i); + if (!aurApp) + continue; // mhmm... + + data << uint32(aurApp->GetBase()->GetId()); + data << uint16(aurApp->GetFlags()); + + if (aurApp->GetFlags() & AFLAG_ANY_EFFECT_AMOUNT_SENT) + { + for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i) + { + if (AuraEffect const* eff = aurApp->GetBase()->GetEffect(i)) + data << int32(eff->GetAmount()); + else + data << int32(0); + } + } } } data.put(petMaskPos, petauramask); // GROUP_UPDATE_FLAG_PET_AURAS @@ -1096,9 +1171,16 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket& recvData) else { data << (uint8) 0; // GROUP_UPDATE_FLAG_PET_NAME + data << (uint8) 0; // GROUP_UPDATE_FLAG_PET_AURAS data << (uint64) 0; // GROUP_UPDATE_FLAG_PET_AURAS + data << (uint32) 0; // GROUP_UPDATE_FLAG_PET_AURAS } + // GROUP_UPDATE_FLAG_PHASE + data << uint32(8); // either 0 or 8, same unk found in SMSG_PHASESHIFT + data << uint32(0); // count + // for (count) *data << uint16(phaseId) + SendPacket(&data); } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index a3c807c09c8..798dedfa755 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -236,7 +236,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_GROUP_DISBAND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupDisbandOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GROUP_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupInviteOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GROUP_INVITE_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupInviteResponseOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_GROUP_RAID_CONVERT, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupRaidConvertOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GROUP_RAID_CONVERT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupRaidConvertOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GROUP_REQUEST_JOIN_UPDATES, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GROUP_SET_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupSetLeaderOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GROUP_SET_ROLES, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -454,7 +454,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_REQUEST_HONOR_STATS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_REQUEST_HOTFIX, STATUS_AUTHED, PROCESS_INPLACE, &WorldSession::HandleRequestHotfix ); DEFINE_OPCODE_HANDLER(CMSG_REQUEST_INSPECT_RATED_BG_STATS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PARTY_MEMBER_STATS, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestPartyMemberStatsOpcode); + DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PARTY_MEMBER_STATS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestPartyMemberStatsOpcode); DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PET_INFO, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestPetInfoOpcode ); DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PVP_OPTIONS_ENABLED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PVP_REWARDS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -608,7 +608,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(MSG_QUERY_NEXT_MAIL_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryNextMailTime ); DEFINE_OPCODE_HANDLER(MSG_QUEST_PUSH_RESULT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestPushResult ); DEFINE_OPCODE_HANDLER(MSG_RAID_READY_CHECK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidReadyCheckOpcode ); - DEFINE_OPCODE_HANDLER(MSG_RAID_READY_CHECK_CONFIRM, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(MSG_RAID_READY_CHECK_CONFIRM, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_RAID_READY_CHECK_FINISHED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidReadyCheckFinishedOpcode); DEFINE_OPCODE_HANDLER(MSG_RAID_TARGET_UPDATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRaidTargetUpdateOpcode ); DEFINE_OPCODE_HANDLER(MSG_RANDOM_ROLL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRandomRollOpcode ); @@ -838,13 +838,13 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_GROUPACTION_THROTTLED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GROUP_CANCEL, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GROUP_DECLINE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GROUP_DESTROYED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GROUP_DESTROYED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GROUP_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GROUP_JOINED_BATTLEGROUND, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GROUP_LIST, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GROUP_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GROUP_SET_LEADER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GROUP_SET_ROLE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GROUP_UNINVITE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GROUP_UNINVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_ACHIEVEMENT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_ACHIEVEMENT_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_ACHIEVEMENT_EARNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1041,8 +1041,8 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_PAGE_TEXT_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PARTYKILLLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PARTY_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PARTY_MEMBER_STATS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PARTY_MEMBER_STATS_FULL, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PARTY_MEMBER_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PARTY_MEMBER_STATS_FULL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PAUSE_MIRROR_TIMER, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PERIODICAURALOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PETGODMODE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1112,7 +1112,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_QUEST_NPC_QUERY_RESPONSE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_QUEST_POI_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_QUEST_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_RAID_GROUP_ONLY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_RAID_GROUP_ONLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_RAID_INSTANCE_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_RAID_INSTANCE_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_RAID_MARKERS_CHANGED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From b26a7337f616016b7c317a1b6fb85161cd9c835d Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 27 Aug 2012 00:26:02 +0100 Subject: Core/Groups: Correction to comment of GROUP_UPDATE_FLAG_PHASE --- src/server/game/Groups/Group.h | 2 +- src/server/game/Spells/SpellMgr.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Groups/Group.h b/src/server/game/Groups/Group.h index 5d3bcdd48a3..b32b6b9b77f 100755 --- a/src/server/game/Groups/Group.h +++ b/src/server/game/Groups/Group.h @@ -117,7 +117,7 @@ enum GroupUpdateFlags GROUP_UPDATE_FLAG_PET_MAX_POWER = 0x00040000, // uint16 (power value) GROUP_UPDATE_FLAG_PET_AURAS = 0x00080000, // [see GROUP_UPDATE_FLAG_AURAS] GROUP_UPDATE_FLAG_VEHICLE_SEAT = 0x00100000, // int32 (vehicle seat id) - GROUP_UPDATE_FLAG_PHASE = 0x00200000, // int32 (unk), uint32 (length), if length > 0, string (size 2*length), else cstring + GROUP_UPDATE_FLAG_PHASE = 0x00200000, // int32 (unk), uint32 (phase count), for (count) uint16(phaseId) GROUP_UPDATE_PET = GROUP_UPDATE_FLAG_PET_GUID | GROUP_UPDATE_FLAG_PET_NAME | GROUP_UPDATE_FLAG_PET_MODEL_ID | GROUP_UPDATE_FLAG_PET_CUR_HP | GROUP_UPDATE_FLAG_PET_MAX_HP | GROUP_UPDATE_FLAG_PET_POWER_TYPE | diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index c160673ae66..fe7a0eab229 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -1172,7 +1172,7 @@ bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32 { if (!player) return false; - + if (Battlefield* battlefieldWG = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG)) return battlefieldWG->IsEnabled() && (player->GetTeamId() == battlefieldWG->GetDefenderTeam()) && !battlefieldWG->IsWarTime(); break; -- cgit v1.2.3 From 9a0203cb3efb4ec7e87a4d1abaadf5c4850ff97e Mon Sep 17 00:00:00 2001 From: Tuxity Date: Mon, 27 Aug 2012 14:22:32 +0200 Subject: Core/Groups: Fix CMSG_GROUP_SET_ROLES and SMSG_GROUP_SET_ROLE --- src/server/game/Handlers/GroupHandler.cpp | 74 +++++++++++++++++++++++++++++ src/server/game/Server/Protocol/Opcodes.cpp | 4 +- src/server/game/Server/WorldSession.h | 1 + 3 files changed, 77 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp index 590cd5ff63f..3296b17ad78 100644 --- a/src/server/game/Handlers/GroupHandler.cpp +++ b/src/server/game/Handlers/GroupHandler.cpp @@ -510,6 +510,80 @@ void WorldSession::HandleGroupSetLeaderOpcode(WorldPacket& recvData) group->SendUpdate(); } +void WorldSession::HandleGroupSetRolesOpcode(WorldPacket& recvData) +{ + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_SET_ROLES"); + + uint32 newRole; + ObjectGuid guid1; // Assigner GUID + ObjectGuid guid2; // Target GUID + + guid1 = GetPlayer()->GetGUID(); + + recvData >> newRole; + + guid2[2] = recvData.ReadBit(); + guid2[6] = recvData.ReadBit(); + guid2[3] = recvData.ReadBit(); + guid2[7] = recvData.ReadBit(); + guid2[5] = recvData.ReadBit(); + guid2[1] = recvData.ReadBit(); + guid2[0] = recvData.ReadBit(); + guid2[4] = recvData.ReadBit(); + + recvData.ReadByteSeq(guid2[6]); + recvData.ReadByteSeq(guid2[4]); + recvData.ReadByteSeq(guid2[1]); + recvData.ReadByteSeq(guid2[3]); + recvData.ReadByteSeq(guid2[0]); + recvData.ReadByteSeq(guid2[5]); + recvData.ReadByteSeq(guid2[2]); + recvData.ReadByteSeq(guid2[7]); + + WorldPacket data(SMSG_GROUP_SET_ROLE, 24); + + data.WriteBit(guid1[1]); + data.WriteBit(guid2[0]); + data.WriteBit(guid2[2]); + data.WriteBit(guid2[4]); + data.WriteBit(guid2[7]); + data.WriteBit(guid2[3]); + data.WriteBit(guid1[7]); + data.WriteBit(guid2[5]); + data.WriteBit(guid1[5]); + data.WriteBit(guid1[4]); + data.WriteBit(guid1[3]); + data.WriteBit(guid2[6]); + data.WriteBit(guid1[2]); + data.WriteBit(guid1[6]); + data.WriteBit(guid2[1]); + data.WriteBit(guid1[0]); + + data.WriteByteSeq(guid1[7]); + data.WriteByteSeq(guid2[3]); + data.WriteByteSeq(guid1[6]); + data.WriteByteSeq(guid2[4]); + data.WriteByteSeq(guid2[0]); + data << uint32(newRole); // New Role + data.WriteByteSeq(guid2[6]); + data.WriteByteSeq(guid2[2]); + data.WriteByteSeq(guid1[0]); + data.WriteByteSeq(guid1[4]); + data.WriteByteSeq(guid2[1]); + data.WriteByteSeq(guid1[3]); + data.WriteByteSeq(guid1[5]); + data.WriteByteSeq(guid1[2]); + data.WriteByteSeq(guid2[5]); + data.WriteByteSeq(guid2[7]); + data.WriteByteSeq(guid1[1]); + data << uint32(0); // Old Role + + if (GetPlayer()->GetGroup()) + GetPlayer()->GetGroup()->BroadcastPacket(&data, false); + else + SendPacket(&data); +} + void WorldSession::HandleGroupDisbandOpcode(WorldPacket& /*recvData*/) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_DISBAND"); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 798dedfa755..862ac7fe794 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -239,7 +239,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_GROUP_RAID_CONVERT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupRaidConvertOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GROUP_REQUEST_JOIN_UPDATES, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GROUP_SET_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupSetLeaderOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_GROUP_SET_ROLES, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_GROUP_SET_ROLES, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleGroupSetRolesOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GROUP_SWAP_SUB_GROUP, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupSwapSubGroupOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GROUP_UNINVITE_GUID, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupUninviteGuidOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildAcceptOpcode ); @@ -843,7 +843,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_GROUP_JOINED_BATTLEGROUND, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GROUP_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GROUP_SET_LEADER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GROUP_SET_ROLE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GROUP_SET_ROLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GROUP_UNINVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_ACHIEVEMENT_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_ACHIEVEMENT_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index ac8e48a0c04..6770c3244ed 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -545,6 +545,7 @@ class WorldSession void HandleGroupUninviteOpcode(WorldPacket& recvPacket); void HandleGroupUninviteGuidOpcode(WorldPacket& recvPacket); void HandleGroupSetLeaderOpcode(WorldPacket& recvPacket); + void HandleGroupSetRolesOpcode(WorldPacket& recvData); void HandleGroupDisbandOpcode(WorldPacket& recvPacket); void HandleOptOutOfLootOpcode(WorldPacket& recvData); void HandleLootMethodOpcode(WorldPacket& recvPacket); -- cgit v1.2.3 From 913186bcce37ce1a069a35beaf8302288ca70bf2 Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 27 Aug 2012 15:05:43 +0200 Subject: Core/PacketIO: Fixed mistake in sending vendors - now items that bind on pickup will display properly --- src/server/game/Handlers/ItemHandler.cpp | 54 +++++++++++++++----------------- 1 file changed, 26 insertions(+), 28 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index ad8846ab071..0349b88a9ad 100644 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -754,16 +754,14 @@ void WorldSession::SendListInventory(uint64 vendorGuid) if (vendorItem->Type == ITEM_VENDOR_TYPE_ITEM) { ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(vendorItem->item); - if (!itemTemplate) continue; + if (!itemTemplate) + continue; + uint32 leftInStock = !vendorItem->maxcount ? 0xFFFFFFFF : vendor->GetVendorItemCurrentCount(vendorItem); if (!_player->isGameMaster()) // ignore conditions if GM on { // Respect allowed class - if (!(itemTemplate->AllowableClass & _player->getClassMask())) - continue; - - // Do not sell BOP items - if (itemTemplate->Bonding == BIND_WHEN_PICKED_UP) + if (!(itemTemplate->AllowableClass & _player->getClassMask()) && itemTemplate->Bonding == BIND_WHEN_PICKED_UP) continue; // Only display items in vendor lists for the team the player is on @@ -772,13 +770,11 @@ void WorldSession::SendListInventory(uint64 vendorGuid) continue; // Items sold out are not displayed in list - uint32 leftInStock = !vendorItem->maxcount ? 0xFFFFFFFF : vendor->GetVendorItemCurrentCount(vendorItem); if (leftInStock == 0) continue; } int32 price = vendorItem->IsGoldRequired(itemTemplate) ? uint32(floor(itemTemplate->BuyPrice * discountMod)) : 0; - uint32 leftInStock = !vendorItem->maxcount ? 0xFFFFFFFF : vendor->GetVendorItemCurrentCount(vendorItem); itemsData << uint32(count++ + 1); // client expects counting to start at 1 itemsData << uint32(itemTemplate->MaxDurability); @@ -803,10 +799,11 @@ void WorldSession::SendListInventory(uint64 vendorGuid) else if (vendorItem->Type == ITEM_VENDOR_TYPE_CURRENCY) { CurrencyTypesEntry const* currencyTemplate = sCurrencyTypesStore.LookupEntry(vendorItem->item); + if (!currencyTemplate) + continue; - if (!currencyTemplate) continue; - - if (vendorItem->ExtendedCost == 0) continue; // there's no price defined for currencies, only extendedcost is used + if (vendorItem->ExtendedCost == 0) + continue; // there's no price defined for currencies, only extendedcost is used uint32 precision = (currencyTemplate->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? 100 : 1; @@ -820,6 +817,7 @@ void WorldSession::SendListInventory(uint64 vendorGuid) } else enablers.push_back(1); + enablers.push_back(1); // unk bit itemsData << uint32(vendorItem->item); @@ -833,40 +831,40 @@ void WorldSession::SendListInventory(uint64 vendorGuid) // else error } - uint8* guidBytes = (uint8*)&vendorGuid; + ObjectGuid guid = vendorGuid; WorldPacket data(SMSG_LIST_INVENTORY, 12 + itemsData.size()); - data.WriteBit(guidBytes[1]); - data.WriteBit(guidBytes[0]); + data.WriteBit(guid[1]); + data.WriteBit(guid[0]); data.WriteBits(count, 21); // item count - data.WriteBit(guidBytes[3]); - data.WriteBit(guidBytes[6]); - data.WriteBit(guidBytes[5]); - data.WriteBit(guidBytes[2]); - data.WriteBit(guidBytes[7]); + data.WriteBit(guid[3]); + data.WriteBit(guid[6]); + data.WriteBit(guid[5]); + data.WriteBit(guid[2]); + data.WriteBit(guid[7]); for (std::vector::const_iterator itr = enablers.begin(); itr != enablers.end(); ++itr) data.WriteBit(*itr); - data.WriteBit(guidBytes[4]); + data.WriteBit(guid[4]); data.FlushBits(); data.append(itemsData); - data.WriteByteSeq(guidBytes[5]); - data.WriteByteSeq(guidBytes[4]); - data.WriteByteSeq(guidBytes[1]); - data.WriteByteSeq(guidBytes[0]); - data.WriteByteSeq(guidBytes[6]); + data.WriteByteSeq(guid[5]); + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[6]); data << uint8(count == 0); // unk byte, item count 0: 1, item count != 0: 0 or some "random" value below 300 - data.WriteByteSeq(guidBytes[2]); - data.WriteByteSeq(guidBytes[3]); - data.WriteByteSeq(guidBytes[7]); + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[7]); SendPacket(&data); } -- cgit v1.2.3 From 2d7b1c8b90d253a9fc102a1a8da2742ffb0c472a Mon Sep 17 00:00:00 2001 From: Spp Date: Mon, 27 Aug 2012 15:06:59 +0200 Subject: Core/Achievements: Define some flags, cleanup and split Requirement Conditions and SetCriteriaProgress in different functions --- src/server/game/Achievements/AchievementMgr.cpp | 1716 +++++++++++++---------- src/server/game/Achievements/AchievementMgr.h | 21 +- src/server/game/DataStores/DBCEnums.h | 204 ++- src/server/game/DataStores/DBCStructure.h | 4 +- src/server/game/Handlers/MiscHandler.cpp | 54 +- src/server/game/Server/Protocol/Opcodes.cpp | 12 +- 6 files changed, 1104 insertions(+), 907 deletions(-) (limited to 'src') diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 7a73b9f8f69..ee2795a83a8 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -80,7 +80,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) return false; } - switch (criteria->requiredType) + switch (criteria->type) { case ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE: case ACHIEVEMENT_CRITERIA_TYPE_WIN_BG: @@ -108,7 +108,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) default: if (dataType != ACHIEVEMENT_CRITERIA_DATA_TYPE_SCRIPT) { - sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` has data for non-supported criteria type (Entry: %u Type: %u), ignored.", criteria->ID, criteria->requiredType); + sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` has data for non-supported criteria type (Entry: %u Type: %u), ignored.", criteria->ID, criteria->type); return false; } break; @@ -124,7 +124,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) if (!creature.id || !sObjectMgr->GetCreatureTemplate(creature.id)) { sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_CREATURE (%u) has non-existing creature id in value1 (%u), ignored.", - criteria->ID, criteria->requiredType, dataType, creature.id); + criteria->ID, criteria->type, dataType, creature.id); return false; } return true; @@ -132,19 +132,19 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) if (!classRace.class_id && !classRace.race_id) { sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE (%u) must not have 0 in either value field, ignored.", - criteria->ID, criteria->requiredType, dataType); + criteria->ID, criteria->type, dataType); return false; } if (classRace.class_id && ((1 << (classRace.class_id-1)) & CLASSMASK_ALL_PLAYABLE) == 0) { sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE (%u) has non-existing class in value1 (%u), ignored.", - criteria->ID, criteria->requiredType, dataType, classRace.class_id); + criteria->ID, criteria->type, dataType, classRace.class_id); return false; } if (classRace.race_id && ((1 << (classRace.race_id-1)) & RACEMASK_ALL_PLAYABLE) == 0) { sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE (%u) has non-existing race in value2 (%u), ignored.", - criteria->ID, criteria->requiredType, dataType, classRace.race_id); + criteria->ID, criteria->type, dataType, classRace.race_id); return false; } return true; @@ -152,7 +152,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) if (health.percent < 1 || health.percent > 100) { sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_PLAYER_LESS_HEALTH (%u) has wrong percent value in value1 (%u), ignored.", - criteria->ID, criteria->requiredType, dataType, health.percent); + criteria->ID, criteria->type, dataType, health.percent); return false; } return true; @@ -163,19 +163,19 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) if (!spellEntry) { sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type %s (%u) has wrong spell id in value1 (%u), ignored.", - criteria->ID, criteria->requiredType, (dataType == ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA?"ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA":"ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA"), dataType, aura.spell_id); + criteria->ID, criteria->type, (dataType == ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA?"ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA":"ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA"), dataType, aura.spell_id); return false; } if (aura.effect_idx >= 3) { sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type %s (%u) has wrong spell effect index in value2 (%u), ignored.", - criteria->ID, criteria->requiredType, (dataType == ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA?"ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA":"ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA"), dataType, aura.effect_idx); + criteria->ID, criteria->type, (dataType == ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA?"ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA":"ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA"), dataType, aura.effect_idx); return false; } if (!spellEntry->Effects[aura.effect_idx].ApplyAuraName) { sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type %s (%u) has non-aura spell effect (ID: %u Effect: %u), ignores.", - criteria->ID, criteria->requiredType, (dataType == ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA?"ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA":"ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA"), dataType, aura.spell_id, aura.effect_idx); + criteria->ID, criteria->type, (dataType == ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA?"ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA":"ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA"), dataType, aura.spell_id, aura.effect_idx); return false; } return true; @@ -184,7 +184,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) if (level.minlevel > STRONG_MAX_LEVEL) { sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_LEVEL (%u) has wrong minlevel in value1 (%u), ignored.", - criteria->ID, criteria->requiredType, dataType, level.minlevel); + criteria->ID, criteria->type, dataType, level.minlevel); return false; } return true; @@ -192,7 +192,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) if (gender.gender > GENDER_NONE) { sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_GENDER (%u) has wrong gender in value1 (%u), ignored.", - criteria->ID, criteria->requiredType, dataType, gender.gender); + criteria->ID, criteria->type, dataType, gender.gender); return false; } return true; @@ -200,7 +200,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) if (!ScriptId) { sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_SCRIPT (%u) does not have ScriptName set, ignored.", - criteria->ID, criteria->requiredType, dataType); + criteria->ID, criteria->type, dataType); return false; } return true; @@ -208,7 +208,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) if (map_players.maxcount <= 0) { sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_PLAYER_COUNT (%u) has wrong max players count in value1 (%u), ignored.", - criteria->ID, criteria->requiredType, dataType, map_players.maxcount); + criteria->ID, criteria->type, dataType, map_players.maxcount); return false; } return true; @@ -216,7 +216,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) if (team.team != ALLIANCE && team.team != HORDE) { sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_TEAM (%u) has unknown team in value1 (%u), ignored.", - criteria->ID, criteria->requiredType, dataType, team.team); + criteria->ID, criteria->type, dataType, team.team); return false; } return true; @@ -224,7 +224,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) if (drunk.state >= MAX_DRUNKEN) { sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_DRUNK (%u) has unknown drunken state in value1 (%u), ignored.", - criteria->ID, criteria->requiredType, dataType, drunk.state); + criteria->ID, criteria->type, dataType, drunk.state); return false; } return true; @@ -232,7 +232,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) if (!sHolidaysStore.LookupEntry(holiday.id)) { sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_HOLIDAY (%u) has unknown holiday in value1 (%u), ignored.", - criteria->ID, criteria->requiredType, dataType, holiday.id); + criteria->ID, criteria->type, dataType, holiday.id); return false; } return true; @@ -242,7 +242,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) if (equipped_item.item_quality >= MAX_ITEM_QUALITY) { sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_requirement` (Entry: %u Type: %u) for requirement ACHIEVEMENT_CRITERIA_REQUIRE_S_EQUIPED_ITEM (%u) has unknown quality state in value1 (%u), ignored.", - criteria->ID, criteria->requiredType, dataType, equipped_item.item_quality); + criteria->ID, criteria->type, dataType, equipped_item.item_quality); return false; } return true; @@ -250,29 +250,29 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) if (!classRace.class_id && !classRace.race_id) { sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_PLAYER_CLASS_RACE (%u) must not have 0 in either value field, ignored.", - criteria->ID, criteria->requiredType, dataType); + criteria->ID, criteria->type, dataType); return false; } if (classRace.class_id && ((1 << (classRace.class_id-1)) & CLASSMASK_ALL_PLAYABLE) == 0) { sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_PLAYER_CLASS_RACE (%u) has non-existing class in value1 (%u), ignored.", - criteria->ID, criteria->requiredType, dataType, classRace.class_id); + criteria->ID, criteria->type, dataType, classRace.class_id); return false; } if (classRace.race_id && ((1 << (classRace.race_id-1)) & RACEMASK_ALL_PLAYABLE) == 0) { sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_PLAYER_CLASS_RACE (%u) has non-existing race in value2 (%u), ignored.", - criteria->ID, criteria->requiredType, dataType, classRace.race_id); + criteria->ID, criteria->type, dataType, classRace.race_id); return false; } return true; default: - sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) has data for non-supported data type (%u), ignored.", criteria->ID, criteria->requiredType, dataType); + sLog->outError(LOG_FILTER_SQL, "Table `achievement_criteria_data` (Entry: %u Type: %u) has data for non-supported data type (%u), ignored.", criteria->ID, criteria->type, dataType); return false; } } -bool AchievementCriteriaData::Meets(uint32 criteria_id, Player const* source, Unit const* target, uint32 miscvalue1 /*= 0*/) const +bool AchievementCriteriaData::Meets(uint32 criteria_id, Player const* source, Unit const* target, uint32 miscValue1 /*= 0*/) const { switch (dataType) { @@ -307,7 +307,7 @@ bool AchievementCriteriaData::Meets(uint32 criteria_id, Player const* source, Un case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA: return target && target->HasAuraEffect(aura.spell_id, aura.effect_idx); case ACHIEVEMENT_CRITERIA_DATA_TYPE_VALUE: - return miscvalue1 >= value.minvalue; + return miscValue1 >= value.minvalue; case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_LEVEL: if (!target) return false; @@ -353,11 +353,11 @@ bool AchievementCriteriaData::Meets(uint32 criteria_id, Player const* source, Un ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT, criteria_id, map->GetId()); return false; } - return instance->CheckAchievementCriteriaMeet(criteria_id, source, target, miscvalue1); + return instance->CheckAchievementCriteriaMeet(criteria_id, source, target, miscValue1); } case ACHIEVEMENT_CRITERIA_DATA_TYPE_S_EQUIPED_ITEM: { - ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(miscvalue1); + ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(miscValue1); if (!pProto) return false; return pProto->ItemLevel >= equipped_item.item_level && pProto->Quality >= equipped_item.item_quality; @@ -368,10 +368,10 @@ bool AchievementCriteriaData::Meets(uint32 criteria_id, Player const* source, Un return false; } -bool AchievementCriteriaDataSet::Meets(Player const* source, Unit const* target, uint32 miscvalue /*= 0*/) const +bool AchievementCriteriaDataSet::Meets(Player const* source, Unit const* target, uint32 miscValue /*= 0*/) const { for (Storage::const_iterator itr = storage.begin(); itr != storage.end(); ++itr) - if (!itr->Meets(criteria_id, source, target, miscvalue)) + if (!itr->Meets(criteria_id, source, target, miscValue)) return false; return true; @@ -454,9 +454,9 @@ void AchievementMgr::RemoveCriteriaProgress(const AchievementCriteriaEntr } template -void AchievementMgr::ResetAchievementCriteria(AchievementCriteriaTypes type, uint32 miscvalue1, uint32 miscvalue2, bool evenIfCriteriaComplete) +void AchievementMgr::ResetAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1, uint32 miscValue2, bool evenIfCriteriaComplete) { - sLog->outDebug(LOG_FILTER_ACHIEVEMENTSYS, "AchievementMgr::ResetAchievementCriteria(%u, %u, %u)", type, miscvalue1, miscvalue2); + sLog->outDebug(LOG_FILTER_ACHIEVEMENTSYS, "AchievementMgr::ResetAchievementCriteria(%u, %u, %u)", type, miscValue1, miscValue2); // disable for gamemasters with GM-mode enabled if (GetOwner()->isGameMaster()) @@ -467,7 +467,7 @@ void AchievementMgr::ResetAchievementCriteria(AchievementCriteriaTypes type, { AchievementCriteriaEntry const* achievementCriteria = (*i); - AchievementEntry const* achievement = sAchievementStore.LookupEntry(achievementCriteria->referredAchievement); + AchievementEntry const* achievement = sAchievementMgr->GetAchievement(achievementCriteria->achievement); if (!achievement) continue; @@ -476,9 +476,9 @@ void AchievementMgr::ResetAchievementCriteria(AchievementCriteriaTypes type, continue; for (uint8 j = 0; j < MAX_CRITERIA_REQUIREMENTS; ++j) - if (achievementCriteria->additionalRequirements[j].additionalRequirement_type == miscvalue1 && + if (achievementCriteria->additionalRequirements[j].additionalRequirement_type == miscValue1 && (!achievementCriteria->additionalRequirements[j].additionalRequirement_value || - achievementCriteria->additionalRequirements[j].additionalRequirement_value == miscvalue2)) + achievementCriteria->additionalRequirements[j].additionalRequirement_value == miscValue2)) { RemoveCriteriaProgress(achievementCriteria); break; @@ -487,7 +487,7 @@ void AchievementMgr::ResetAchievementCriteria(AchievementCriteriaTypes type, } template<> -void AchievementMgr::ResetAchievementCriteria(AchievementCriteriaTypes /*type*/, uint32 /*miscvalue1*/, uint32 /*miscvalue2*/, bool /*evenIfCriteriaComplete*/) +void AchievementMgr::ResetAchievementCriteria(AchievementCriteriaTypes /*type*/, uint32 /*miscValue1*/, uint32 /*miscValue2*/, bool /*evenIfCriteriaComplete*/) { // Not needed } @@ -703,7 +703,7 @@ void AchievementMgr::LoadFromDB(PreparedQueryResult achievementResult, P uint32 achievementid = fields[0].GetUInt16(); // must not happen: cleanup at server startup in sAchievementMgr->LoadCompletedAchievements() - AchievementEntry const* achievement = sAchievementStore.LookupEntry(achievementid); + AchievementEntry const* achievement = sAchievementMgr->GetAchievement(achievementid); if (!achievement) continue; @@ -718,11 +718,13 @@ void AchievementMgr::LoadFromDB(PreparedQueryResult achievementResult, P if (!GetOwner()->HasTitle(titleEntry)) GetOwner()->SetTitle(titleEntry); - } while (achievementResult->NextRow()); + } + while (achievementResult->NextRow()); } if (criteriaResult) { + time_t now = time(NULL); do { Field* fields = criteriaResult->Fetch(); @@ -730,7 +732,7 @@ void AchievementMgr::LoadFromDB(PreparedQueryResult achievementResult, P uint32 counter = fields[1].GetUInt32(); time_t date = time_t(fields[2].GetUInt32()); - AchievementCriteriaEntry const* criteria = sAchievementCriteriaStore.LookupEntry(id); + AchievementCriteriaEntry const* criteria = sAchievementMgr->GetAchievementCriteria(id); if (!criteria) { // we will remove not existed criteria for all characters @@ -743,14 +745,15 @@ void AchievementMgr::LoadFromDB(PreparedQueryResult achievementResult, P continue; } - if (criteria->timeLimit && time_t(date + criteria->timeLimit) < time(NULL)) + if (criteria->timeLimit && time_t(date + criteria->timeLimit) < now) continue; CriteriaProgress& progress = m_criteriaProgress[id]; progress.counter = counter; progress.date = date; progress.changed = false; - } while (criteriaResult->NextRow()); + } + while (criteriaResult->NextRow()); } } @@ -765,7 +768,7 @@ void AchievementMgr::LoadFromDB(PreparedQueryResult achievementResult, Pr uint32 achievementid = fields[0].GetUInt16(); // must not happen: cleanup at server startup in sAchievementMgr->LoadCompletedAchievements() - AchievementEntry const* achievement = sAchievementStore.LookupEntry(achievementid); + AchievementEntry const* achievement = sAchievementMgr->GetAchievement(achievementid); if (!achievement) continue; @@ -776,8 +779,8 @@ void AchievementMgr::LoadFromDB(PreparedQueryResult achievementResult, Pr ca.guids.insert(MAKE_NEW_GUID(atol(guids[i]), 0, HIGHGUID_PLAYER)); ca.changed = false; - - } while (achievementResult->NextRow()); + } + while (achievementResult->NextRow()); } if (criteriaResult) @@ -791,11 +794,11 @@ void AchievementMgr::LoadFromDB(PreparedQueryResult achievementResult, Pr time_t date = time_t(fields[2].GetUInt32()); uint64 guid = fields[3].GetUInt32(); - AchievementCriteriaEntry const* criteria = sAchievementCriteriaStore.LookupEntry(id); + AchievementCriteriaEntry const* criteria = sAchievementMgr->GetAchievementCriteria(id); if (!criteria) { // we will remove not existed criteria for all guilds - sLog->outError(LOG_FILTER_GENERAL, "Non-existing achievement criteria %u data removed from table `guild_achievement_progress`.", id); + sLog->outError(LOG_FILTER_ACHIEVEMENTSYS, "Non-existing achievement criteria %u data removed from table `guild_achievement_progress`.", id); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVALID_ACHIEV_PROGRESS_CRITERIA); stmt->setUInt16(0, uint16(id)); @@ -839,7 +842,7 @@ void AchievementMgr::Reset() m_completedAchievements.clear(); m_criteriaProgress.clear(); - DeleteFromDB(_owner->GetGUIDLow()); + DeleteFromDB(GetOwner()->GetGUIDLow()); // re-fill data CheckAllAchievementCriteria(GetOwner()); @@ -874,23 +877,21 @@ void AchievementMgr::Reset() } while (!m_criteriaProgress.empty()) - if (AchievementCriteriaEntry const* criteria = sAchievementCriteriaStore.LookupEntry(m_criteriaProgress.begin()->first)) + if (AchievementCriteriaEntry const* criteria = sAchievementMgr->GetAchievementCriteria(m_criteriaProgress.begin()->first)) RemoveCriteriaProgress(criteria); m_completedAchievements.clear(); - DeleteFromDB(_owner->GetId()); + DeleteFromDB(GetOwner()->GetId()); } template void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement) const { - // Don't send for achievements with ACHIEVEMENT_FLAG_TRACKING + // Don't send for achievements with ACHIEVEMENT_FLAG_HIDDEN if (achievement->flags & ACHIEVEMENT_FLAG_HIDDEN) return; - #ifdef TRINITY_DEBUG - sLog->outDebug(LOG_FILTER_ACHIEVEMENTSYS, "AchievementMgr::SendAchievementEarned(%u)", achievement->ID); - #endif + sLog->outDebug(LOG_FILTER_ACHIEVEMENTSYS, "AchievementMgr::SendAchievementEarned(%u)", achievement->ID); if (Guild* guild = sGuildMgr->GetGuildById(GetOwner()->GetGuildId())) { @@ -902,7 +903,7 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievemen if (achievement->flags & (ACHIEVEMENT_FLAG_REALM_FIRST_KILL | ACHIEVEMENT_FLAG_REALM_FIRST_REACH)) { // broadcast realm first reached - WorldPacket data(SMSG_SERVER_FIRST_ACHIEVEMENT, strlen(GetOwner()->GetName())+1+8+4+4); + WorldPacket data(SMSG_SERVER_FIRST_ACHIEVEMENT, strlen(GetOwner()->GetName()) + 1 + 8 + 4 + 4); data << GetOwner()->GetName(); data << uint64(GetOwner()->GetGUID()); data << uint32(achievement->ID); @@ -969,7 +970,7 @@ void AchievementMgr::SendCriteriaUpdate(AchievementCriteriaEntry const* /*ent template<> void AchievementMgr::SendCriteriaUpdate(AchievementCriteriaEntry const* entry, CriteriaProgress const* progress, uint32 timeElapsed, bool timedCompleted) const { - WorldPacket data(SMSG_CRITERIA_UPDATE, 8+4+8); + WorldPacket data(SMSG_CRITERIA_UPDATE, 8 + 4 + 8); data << uint32(entry->ID); // the counter is packed like a packed Guid @@ -1051,7 +1052,7 @@ void AchievementMgr::CheckAllAchievementCriteria(Player* referencePlayer) UpdateAchievementCriteria(AchievementCriteriaTypes(i), 0, 0, NULL, referencePlayer); } -static const uint32 achievIdByArenaSlot[MAX_ARENA_SLOT] = { 1057, 1107, 1108 }; +static const uint32 achievIdByArenaSlot[MAX_ARENA_SLOT] = {1057, 1107, 1108}; static const uint32 achievIdForDungeon[][4] = { // ach_cr_id, is_dungeon, is_raid, is_heroic_dungeon @@ -1071,9 +1072,9 @@ template<> bool IsGuild() { return true; } * this function will be called whenever the user might have done a criteria relevant action */ template -void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1 /*= 0*/, uint32 miscValue2 /*= 0*/, Unit* unit /*= NULL*/, Player* referencePlayer /*= NULL*/) +void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1 /*= 0*/, uint32 miscValue2 /*= 0*/, Unit const* unit /*= NULL*/, Player* referencePlayer /*= NULL*/) { - sLog->outDebug(LOG_FILTER_ACHIEVEMENTSYS, "AchievementMgr::UpdateAchievementCriteria(%u, %u, %u)", type, miscValue1, miscValue2); + sLog->outDebug(LOG_FILTER_ACHIEVEMENTSYS, "UpdateAchievementCriteria(%u, %u, %u)", type, miscValue1, miscValue2); // disable for gamemasters with GM-mode enabled if (referencePlayer->isGameMaster()) @@ -1083,9 +1084,12 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, for (AchievementCriteriaEntryList::const_iterator i = achievementCriteriaList.begin(); i != achievementCriteriaList.end(); ++i) { AchievementCriteriaEntry const* achievementCriteria = (*i); - AchievementEntry const* achievement = sAchievementStore.LookupEntry(achievementCriteria->referredAchievement); + AchievementEntry const* achievement = sAchievementMgr->GetAchievement(achievementCriteria->achievement); if (!achievement) + { + sLog->outError(LOG_FILTER_ACHIEVEMENTSYS, "UpdateAchievementCriteria: Achievement %u not found!", achievementCriteria->achievement); continue; + } if (!CanUpdateCriteria(achievementCriteria, achievement, miscValue1, miscValue2, unit, referencePlayer)) continue; @@ -1108,12 +1112,37 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, case ACHIEVEMENT_CRITERIA_TYPE_FLIGHT_PATHS_TAKEN: case ACHIEVEMENT_CRITERIA_TYPE_ACCEPTED_SUMMONINGS: case ACHIEVEMENT_CRITERIA_TYPE_USE_LFD_TO_GROUP_WITH_PLAYERS: - // AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case - if (!miscValue1) - continue; + case ACHIEVEMENT_CRITERIA_TYPE_LOOT_EPIC_ITEM: + case ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM: + case ACHIEVEMENT_CRITERIA_TYPE_DEATH: + case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST: + case ACHIEVEMENT_CRITERIA_TYPE_DEATH_AT_MAP: + case ACHIEVEMENT_CRITERIA_TYPE_DEATH_IN_DUNGEON: + case ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_CREATURE: + case ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_PLAYER: + case ACHIEVEMENT_CRITERIA_TYPE_DEATHS_FROM: + case ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET: + case ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2: + case ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL: + case ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL2: + case ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA: + case ACHIEVEMENT_CRITERIA_TYPE_USE_ITEM: + case ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED_ON_LOOT: + case ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED_ON_LOOT: + case ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE: + case ACHIEVEMENT_CRITERIA_TYPE_USE_GAMEOBJECT: + case ACHIEVEMENT_CRITERIA_TYPE_FISH_IN_GAMEOBJECT: + case ACHIEVEMENT_CRITERIA_TYPE_WIN_DUEL: + case ACHIEVEMENT_CRITERIA_TYPE_HK_CLASS: + case ACHIEVEMENT_CRITERIA_TYPE_HK_RACE: + case ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE: + case ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL: + case ACHIEVEMENT_CRITERIA_TYPE_SPECIAL_PVP_KILL: + case ACHIEVEMENT_CRITERIA_TYPE_GET_KILLING_BLOWS: + case ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL_AT_AREA: SetCriteriaProgress(achievementCriteria, 1, referencePlayer, PROGRESS_ACCUMULATE); break; - // std case: increment at miscvalue1 + // std case: increment at miscValue1 case ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_VENDORS: case ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TALENTS: case ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_QUEST_REWARD: @@ -1124,82 +1153,42 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, case ACHIEVEMENT_CRITERIA_TYPE_GOLD_EARNED_BY_AUCTIONS:/* FIXME: for online player only currently */ case ACHIEVEMENT_CRITERIA_TYPE_TOTAL_DAMAGE_RECEIVED: case ACHIEVEMENT_CRITERIA_TYPE_TOTAL_HEALING_RECEIVED: - // AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case - if (!miscValue1) - continue; + case ACHIEVEMENT_CRITERIA_TYPE_WIN_BG: + case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_BATTLEGROUND: + case ACHIEVEMENT_CRITERIA_TYPE_DAMAGE_DONE: + case ACHIEVEMENT_CRITERIA_TYPE_HEALING_DONE: SetCriteriaProgress(achievementCriteria, miscValue1, referencePlayer, PROGRESS_ACCUMULATE); break; - // std case: high value at miscvalue1 + case ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE: + case ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE: + case ACHIEVEMENT_CRITERIA_TYPE_OWN_ITEM: + case ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM: + case ACHIEVEMENT_CRITERIA_TYPE_CURRENCY: + SetCriteriaProgress(achievementCriteria, miscValue2, referencePlayer, PROGRESS_ACCUMULATE); + break; + // std case: high value at miscValue1 case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_BID: case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_SOLD: /* FIXME: for online player only currently */ case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HIT_DEALT: case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HIT_RECEIVED: case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEAL_CASTED: case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEALING_RECEIVED: - // AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case - if (!miscValue1) - continue; SetCriteriaProgress(achievementCriteria, miscValue1, referencePlayer, PROGRESS_HIGHEST); break; - - // specialized cases - case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST: - { - // AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case - if (!miscValue1) - continue; - - SetCriteriaProgress(achievementCriteria, 1, referencePlayer, PROGRESS_ACCUMULATE); - break; - } - case ACHIEVEMENT_CRITERIA_TYPE_WIN_BG: - { - // AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case - if (!miscValue1) - continue; - if (achievementCriteria->win_bg.bgMapID != referencePlayer->GetMapId()) - continue; - - SetCriteriaProgress(achievementCriteria, miscValue1, referencePlayer, PROGRESS_ACCUMULATE); - break; - } - case ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE: - { - // AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case - if (!miscValue1) - continue; - if (achievementCriteria->kill_creature.creatureID != miscValue1) - continue; - - SetCriteriaProgress(achievementCriteria, miscValue2, referencePlayer, PROGRESS_ACCUMULATE); - break; - } case ACHIEVEMENT_CRITERIA_TYPE_REACH_LEVEL: SetCriteriaProgress(achievementCriteria, referencePlayer->getLevel(), referencePlayer); break; case ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL: - // update at loading or specific skill update - if (miscValue1 && miscValue1 != achievementCriteria->reach_skill_level.skillID) - continue; if (uint32 skillvalue = referencePlayer->GetBaseSkillValue(achievementCriteria->reach_skill_level.skillID)) SetCriteriaProgress(achievementCriteria, skillvalue, referencePlayer); break; case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LEVEL: - // update at loading or specific skill update - if (miscValue1 && miscValue1 != achievementCriteria->learn_skill_level.skillID) - continue; if (uint32 maxSkillvalue = referencePlayer->GetPureMaxSkillValue(achievementCriteria->learn_skill_level.skillID)) SetCriteriaProgress(achievementCriteria, maxSkillvalue, referencePlayer); break; - case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT: - if (m_completedAchievements.find(achievementCriteria->complete_achievement.linkedAchievement) != m_completedAchievements.end()) - SetCriteriaProgress(achievementCriteria, 1, referencePlayer); - break; case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST_COUNT: - { SetCriteriaProgress(achievementCriteria, referencePlayer->GetRewardedQuestCount(), referencePlayer); break; - } case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST_DAILY: { time_t nextDailyResetTime = sWorld->GetNextDailyQuestsResetTime(); @@ -1218,7 +1207,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, // 1st time. Start count. progressType = PROGRESS_SET; else if (progress->date < (nextDailyResetTime - 2 * DAY)) - // last progress is older than 2 days. Player missed 1 day => Retart count. + // last progress is older than 2 days. Player missed 1 day => Restart count. progressType = PROGRESS_SET; else if (progress->date < (nextDailyResetTime - DAY)) // last progress is between 1 and 2 days. => 1st time of the day. @@ -1232,10 +1221,6 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, } case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUESTS_IN_ZONE: { - // speedup for non-login case - if (miscValue1 && miscValue1 != achievementCriteria->complete_quests_in_zone.zoneID) - continue; - uint32 counter = 0; const RewardedQuestSet &rewQuests = referencePlayer->getRewardedQuests(); @@ -1248,494 +1233,126 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, SetCriteriaProgress(achievementCriteria, counter, referencePlayer); break; } - case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_BATTLEGROUND: - // AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case - if (!miscValue1) - continue; - if (referencePlayer->GetMapId() != achievementCriteria->complete_battleground.mapID) - continue; - SetCriteriaProgress(achievementCriteria, miscValue1, referencePlayer, PROGRESS_ACCUMULATE); + case ACHIEVEMENT_CRITERIA_TYPE_FALL_WITHOUT_DYING: + // miscValue1 is the ingame fallheight*100 as stored in dbc + SetCriteriaProgress(achievementCriteria, miscValue1, referencePlayer); break; - case ACHIEVEMENT_CRITERIA_TYPE_DEATH_AT_MAP: - // AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case - if (!miscValue1) - continue; - if (referencePlayer->GetMapId() != achievementCriteria->death_at_map.mapID) - continue; - SetCriteriaProgress(achievementCriteria, 1, referencePlayer, PROGRESS_ACCUMULATE); + case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST: + case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL: + case ACHIEVEMENT_CRITERIA_TYPE_EXPLORE_AREA: + case ACHIEVEMENT_CRITERIA_TYPE_VISIT_BARBER_SHOP: + case ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM: + case ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM: + case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT: + SetCriteriaProgress(achievementCriteria, 1, referencePlayer); break; - case ACHIEVEMENT_CRITERIA_TYPE_DEATH: + case ACHIEVEMENT_CRITERIA_TYPE_BUY_BANK_SLOT: + SetCriteriaProgress(achievementCriteria, referencePlayer->GetBankBagSlotCount(), referencePlayer); + break; + case ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION: { - // AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case - if (!miscValue1) - continue; - // skip wrong arena achievements, if not achievIdByArenaSlot then normal total death counter - bool notfit = false; - for (int j = 0; j < MAX_ARENA_SLOT; ++j) + int32 reputation = referencePlayer->GetReputationMgr().GetReputation(achievementCriteria->gain_reputation.factionID); + if (reputation > 0) + SetCriteriaProgress(achievementCriteria, reputation, referencePlayer); + break; + } + case ACHIEVEMENT_CRITERIA_TYPE_GAIN_EXALTED_REPUTATION: + SetCriteriaProgress(achievementCriteria, referencePlayer->GetReputationMgr().GetExaltedFactionCount(), referencePlayer); + break; + case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS: + { + uint32 spellCount = 0; + for (PlayerSpellMap::const_iterator spellIter = referencePlayer->GetSpellMap().begin(); + spellIter != referencePlayer->GetSpellMap().end(); + ++spellIter) { - if (achievIdByArenaSlot[j] == achievement->ID) + SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellIter->first); + for (SkillLineAbilityMap::const_iterator skillIter = bounds.first; skillIter != bounds.second; ++skillIter) { - Battleground* bg = referencePlayer->GetBattleground(); - if (!bg || !bg->isArena() || ArenaTeam::GetSlotByType(bg->GetArenaType()) != j) - notfit = true; - - break; + if (skillIter->second->skillId == achievementCriteria->learn_skillline_spell.skillLine) + spellCount++; } } - if (notfit) - continue; - - SetCriteriaProgress(achievementCriteria, 1, referencePlayer, PROGRESS_ACCUMULATE); + SetCriteriaProgress(achievementCriteria, spellCount, referencePlayer); break; } - case ACHIEVEMENT_CRITERIA_TYPE_DEATH_IN_DUNGEON: + case ACHIEVEMENT_CRITERIA_TYPE_GAIN_REVERED_REPUTATION: + SetCriteriaProgress(achievementCriteria, referencePlayer->GetReputationMgr().GetReveredFactionCount(), referencePlayer); + break; + case ACHIEVEMENT_CRITERIA_TYPE_GAIN_HONORED_REPUTATION: + SetCriteriaProgress(achievementCriteria, referencePlayer->GetReputationMgr().GetHonoredFactionCount(), referencePlayer); + break; + case ACHIEVEMENT_CRITERIA_TYPE_KNOWN_FACTIONS: + SetCriteriaProgress(achievementCriteria, referencePlayer->GetReputationMgr().GetVisibleFactionCount(), referencePlayer); + break; + case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LINE: { - // AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case - if (!miscValue1) - continue; - - Map const* map = referencePlayer->IsInWorld() ? referencePlayer->GetMap() : sMapMgr->FindMap(referencePlayer->GetMapId(), referencePlayer->GetInstanceId()); - if (!map || !map->IsDungeon()) - continue; - - // search case - bool found = false; - for (int j = 0; achievIdForDungeon[j][0]; ++j) + uint32 spellCount = 0; + for (PlayerSpellMap::const_iterator spellIter = referencePlayer->GetSpellMap().begin(); + spellIter != referencePlayer->GetSpellMap().end(); + ++spellIter) { - if (achievIdForDungeon[j][0] == achievement->ID) - { - if (map->IsRaid()) - { - // if raid accepted (ignore difficulty) - if (!achievIdForDungeon[j][2]) - break; // for - } - else if (referencePlayer->GetDungeonDifficulty() == DUNGEON_DIFFICULTY_NORMAL) - { - // dungeon in normal mode accepted - if (!achievIdForDungeon[j][1]) - break; // for - } - else - { - // dungeon in heroic mode accepted - if (!achievIdForDungeon[j][3]) - break; // for - } - - found = true; - break; // for - } + SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellIter->first); + for (SkillLineAbilityMap::const_iterator skillIter = bounds.first; skillIter != bounds.second; ++skillIter) + if (skillIter->second->skillId == achievementCriteria->learn_skill_line.skillLine) + spellCount++; } - if (!found) - continue; - - //FIXME: work only for instances where max == min for players - if (((InstanceMap*)map)->GetMaxPlayers() != achievementCriteria->death_in_dungeon.manLimit) - continue; - SetCriteriaProgress(achievementCriteria, 1, referencePlayer, PROGRESS_ACCUMULATE); + SetCriteriaProgress(achievementCriteria, spellCount, referencePlayer); break; - } - case ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_CREATURE: - // AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case - if (!miscValue1) - continue; - if (miscValue1 != achievementCriteria->killed_by_creature.creatureEntry) - continue; - SetCriteriaProgress(achievementCriteria, 1, referencePlayer, PROGRESS_ACCUMULATE); + case ACHIEVEMENT_CRITERIA_TYPE_EARN_HONORABLE_KILL: + SetCriteriaProgress(achievementCriteria, referencePlayer->GetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS), referencePlayer); break; - case ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_PLAYER: - // AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case - if (!miscValue1) - continue; - - // if team check required: must kill by opposition faction - if (achievement->ID == 318 && miscValue2 == referencePlayer->GetTeam()) - continue; - - SetCriteriaProgress(achievementCriteria, 1, referencePlayer, PROGRESS_ACCUMULATE); + case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_GOLD_VALUE_OWNED: + SetCriteriaProgress(achievementCriteria, referencePlayer->GetMoney(), referencePlayer, PROGRESS_HIGHEST); break; - case ACHIEVEMENT_CRITERIA_TYPE_FALL_WITHOUT_DYING: + case ACHIEVEMENT_CRITERIA_TYPE_EARN_ACHIEVEMENT_POINTS: { - // AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case if (!miscValue1) - continue; - - // miscvalue1 is the ingame fallheight*100 as stored in dbc - SetCriteriaProgress(achievementCriteria, miscValue1, referencePlayer); + { + uint32 points = 0; + for (CompletedAchievementMap::iterator itr = m_completedAchievements.begin(); itr != m_completedAchievements.end(); ++itr) + if (AchievementEntry const* pAchievement = sAchievementMgr->GetAchievement(itr->first)) + points += pAchievement->points; + SetCriteriaProgress(achievementCriteria, points, referencePlayer, PROGRESS_SET); + } + else + SetCriteriaProgress(achievementCriteria, miscValue1, referencePlayer, PROGRESS_ACCUMULATE); break; } - case ACHIEVEMENT_CRITERIA_TYPE_DEATHS_FROM: - // AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case - if (!miscValue1) - continue; - if (miscValue2 != achievementCriteria->death_from.type) - continue; - SetCriteriaProgress(achievementCriteria, 1, referencePlayer, PROGRESS_ACCUMULATE); - break; - case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST: + case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_TEAM_RATING: { - // if miscvalues != 0, it contains the questID. + uint32 reqTeamType = achievementCriteria->highest_team_rating.teamtype; + if (miscValue1) { - if (miscValue1 != achievementCriteria->complete_quest.questID) + if (miscValue2 != reqTeamType) continue; + + SetCriteriaProgress(achievementCriteria, miscValue1, referencePlayer, PROGRESS_HIGHEST); } - else + else // login case { - // login case. - if (!referencePlayer->GetQuestRewardStatus(achievementCriteria->complete_quest.questID)) - continue; - } + for (uint32 arena_slot = 0; arena_slot < MAX_ARENA_SLOT; ++arena_slot) + { + uint32 teamId = referencePlayer->GetArenaTeamId(arena_slot); + if (!teamId) + continue; - if (AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria)) - if (!data->Meets(referencePlayer, unit)) - continue; + ArenaTeam* team = sArenaTeamMgr->GetArenaTeamById(teamId); + if (!team || team->GetType() != reqTeamType) + continue; - SetCriteriaProgress(achievementCriteria, 1, referencePlayer); - break; - } - case ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET: - case ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2: - { - if (!miscValue1 || miscValue1 != achievementCriteria->be_spell_target.spellID) - continue; + SetCriteriaProgress(achievementCriteria, team->GetStats().Rating, referencePlayer, PROGRESS_HIGHEST); + break; + } + } - SetCriteriaProgress(achievementCriteria, 1, referencePlayer, PROGRESS_ACCUMULATE); break; } - case ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL: - case ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL2: + case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_PERSONAL_RATING: { - if (!miscValue1 || miscValue1 != achievementCriteria->cast_spell.spellID) - continue; - - SetCriteriaProgress(achievementCriteria, 1, referencePlayer, PROGRESS_ACCUMULATE); - break; - } - case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL: - if (miscValue1 && miscValue1 != achievementCriteria->learn_spell.spellID) - continue; - - if (referencePlayer->HasSpell(achievementCriteria->learn_spell.spellID)) - SetCriteriaProgress(achievementCriteria, 1, referencePlayer); - break; - case ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE: - { - // miscvalue1=loot_type (note: 0 = LOOT_CORPSE and then it ignored) - // miscvalue2=count of item loot - if (!miscValue1 || !miscValue2) - continue; - if (miscValue1 != achievementCriteria->loot_type.lootType) - continue; - - SetCriteriaProgress(achievementCriteria, miscValue2, referencePlayer, PROGRESS_ACCUMULATE); - break; - } - case ACHIEVEMENT_CRITERIA_TYPE_OWN_ITEM: - // speedup for non-login case - if (miscValue1 && achievementCriteria->own_item.itemID != miscValue1) - continue; - SetCriteriaProgress(achievementCriteria, miscValue2, referencePlayer, PROGRESS_ACCUMULATE); - break; - case ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA: - if (!miscValue1) // no update at login - continue; - - SetCriteriaProgress(achievementCriteria, 1, referencePlayer, PROGRESS_ACCUMULATE); - break; - case ACHIEVEMENT_CRITERIA_TYPE_USE_ITEM: - // AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case - if (!miscValue1) - continue; - - if (achievementCriteria->use_item.itemID != miscValue1) - continue; - - SetCriteriaProgress(achievementCriteria, 1, referencePlayer, PROGRESS_ACCUMULATE); - break; - case ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM: - // You _have_ to loot that item, just owning it when logging in does _not_ count! - if (!miscValue1) - continue; - if (miscValue1 != achievementCriteria->own_item.itemID) - continue; - SetCriteriaProgress(achievementCriteria, miscValue2, referencePlayer, PROGRESS_ACCUMULATE); - break; - case ACHIEVEMENT_CRITERIA_TYPE_EXPLORE_AREA: - { - WorldMapOverlayEntry const* worldOverlayEntry = sWorldMapOverlayStore.LookupEntry(achievementCriteria->explore_area.areaReference); - if (!worldOverlayEntry) - break; - - bool matchFound = false; - for (int j = 0; j < MAX_WORLD_MAP_OVERLAY_AREA_IDX; ++j) - { - uint32 area_id = worldOverlayEntry->areatableID[j]; - if (!area_id) // array have 0 only in empty tail - break; - - int32 exploreFlag = GetAreaFlagByAreaID(area_id); - if (exploreFlag < 0) - continue; - - uint32 playerIndexOffset = uint32(exploreFlag) / 32; - uint32 mask = 1<< (uint32(exploreFlag) % 32); - - if (referencePlayer->GetUInt32Value(PLAYER_EXPLORED_ZONES_1 + playerIndexOffset) & mask) - { - matchFound = true; - break; - } - } - - if (matchFound) - SetCriteriaProgress(achievementCriteria, 1, referencePlayer); - break; - } - case ACHIEVEMENT_CRITERIA_TYPE_BUY_BANK_SLOT: - SetCriteriaProgress(achievementCriteria, referencePlayer->GetBankBagSlotCount(), referencePlayer); - break; - case ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION: - { - // skip faction check only at loading - if (miscValue1 && miscValue1 != achievementCriteria->gain_reputation.factionID) - continue; - - int32 reputation = referencePlayer->GetReputationMgr().GetReputation(achievementCriteria->gain_reputation.factionID); - if (reputation > 0) - SetCriteriaProgress(achievementCriteria, reputation, referencePlayer); - break; - } - case ACHIEVEMENT_CRITERIA_TYPE_GAIN_EXALTED_REPUTATION: - { - SetCriteriaProgress(achievementCriteria, referencePlayer->GetReputationMgr().GetExaltedFactionCount(), referencePlayer); - break; - } - case ACHIEVEMENT_CRITERIA_TYPE_VISIT_BARBER_SHOP: - { - // skip for login case - if (!miscValue1) - continue; - SetCriteriaProgress(achievementCriteria, 1, referencePlayer); - break; - } - case ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM: - { - // miscvalue1 = itemid - // miscvalue2 = itemSlot - if (!miscValue1) - continue; - - if (miscValue2 != achievementCriteria->equip_epic_item.itemSlot) - continue; - - SetCriteriaProgress(achievementCriteria, 1, referencePlayer); - break; - } - - case ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED_ON_LOOT: - case ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED_ON_LOOT: - { - // miscvalue1 = itemid - // miscvalue2 = diced value - if (!miscValue1) - continue; - if (miscValue2 != achievementCriteria->roll_greed_on_loot.rollValue) - continue; - - ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(miscValue1); - if (!pProto) - continue; - - SetCriteriaProgress(achievementCriteria, 1, referencePlayer, PROGRESS_ACCUMULATE); - break; - } - case ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE: - { - // miscvalue1 = emote - if (!miscValue1) - continue; - if (miscValue1 != achievementCriteria->do_emote.emoteID) - continue; - - SetCriteriaProgress(achievementCriteria, 1, referencePlayer, PROGRESS_ACCUMULATE); - break; - } - case ACHIEVEMENT_CRITERIA_TYPE_DAMAGE_DONE: - case ACHIEVEMENT_CRITERIA_TYPE_HEALING_DONE: - { - if (!miscValue1) - continue; - - if (achievementCriteria->additionalRequirements[0].additionalRequirement_type == ACHIEVEMENT_CRITERIA_CONDITION_BG_MAP) - { - if (referencePlayer->GetMapId() != achievementCriteria->additionalRequirements[0].additionalRequirement_value) - continue; - - // map specific case (BG in fact) expected player targeted damage/heal - if (!unit || unit->GetTypeId() != TYPEID_PLAYER) - continue; - } - - SetCriteriaProgress(achievementCriteria, miscValue1, referencePlayer, PROGRESS_ACCUMULATE); - break; - } - case ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM: - // miscvalue1 = item_id - if (!miscValue1) - continue; - if (miscValue1 != achievementCriteria->equip_item.itemID) - continue; - - SetCriteriaProgress(achievementCriteria, 1, referencePlayer); - break; - case ACHIEVEMENT_CRITERIA_TYPE_USE_GAMEOBJECT: - // miscvalue1 = go entry - if (!miscValue1) - continue; - if (miscValue1 != achievementCriteria->use_gameobject.goEntry) - continue; - - SetCriteriaProgress(achievementCriteria, 1, referencePlayer, PROGRESS_ACCUMULATE); - break; - case ACHIEVEMENT_CRITERIA_TYPE_FISH_IN_GAMEOBJECT: - if (!miscValue1) - continue; - if (miscValue1 != achievementCriteria->fish_in_gameobject.goEntry) - continue; - - SetCriteriaProgress(achievementCriteria, 1, referencePlayer, PROGRESS_ACCUMULATE); - break; - case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS: - { - if (miscValue1 && miscValue1 != achievementCriteria->learn_skillline_spell.skillLine) - continue; - - uint32 spellCount = 0; - for (PlayerSpellMap::const_iterator spellIter = referencePlayer->GetSpellMap().begin(); - spellIter != referencePlayer->GetSpellMap().end(); - ++spellIter) - { - SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellIter->first); - for (SkillLineAbilityMap::const_iterator skillIter = bounds.first; skillIter != bounds.second; ++skillIter) - { - if (skillIter->second->skillId == achievementCriteria->learn_skillline_spell.skillLine) - spellCount++; - } - } - SetCriteriaProgress(achievementCriteria, spellCount, referencePlayer); - break; - } - case ACHIEVEMENT_CRITERIA_TYPE_WIN_DUEL: - // AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case - if (!miscValue1) - continue; - - SetCriteriaProgress(achievementCriteria, 1, referencePlayer, PROGRESS_ACCUMULATE); - break; - case ACHIEVEMENT_CRITERIA_TYPE_GAIN_REVERED_REPUTATION: - SetCriteriaProgress(achievementCriteria, referencePlayer->GetReputationMgr().GetReveredFactionCount(), referencePlayer); - break; - case ACHIEVEMENT_CRITERIA_TYPE_GAIN_HONORED_REPUTATION: - SetCriteriaProgress(achievementCriteria, referencePlayer->GetReputationMgr().GetHonoredFactionCount(), referencePlayer); - break; - case ACHIEVEMENT_CRITERIA_TYPE_KNOWN_FACTIONS: - SetCriteriaProgress(achievementCriteria, referencePlayer->GetReputationMgr().GetVisibleFactionCount(), referencePlayer); - break; - case ACHIEVEMENT_CRITERIA_TYPE_LOOT_EPIC_ITEM: - case ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM: - { - // AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case - if (!miscValue1) - continue; - ItemTemplate const* proto = sObjectMgr->GetItemTemplate(miscValue1); - if (!proto || proto->Quality < ITEM_QUALITY_EPIC) - continue; - SetCriteriaProgress(achievementCriteria, 1, referencePlayer, PROGRESS_ACCUMULATE); - break; - } - case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LINE: - { - if (miscValue1 && miscValue1 != achievementCriteria->learn_skill_line.skillLine) - continue; - - uint32 spellCount = 0; - for (PlayerSpellMap::const_iterator spellIter = referencePlayer->GetSpellMap().begin(); - spellIter != referencePlayer->GetSpellMap().end(); - ++spellIter) - { - SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellIter->first); - for (SkillLineAbilityMap::const_iterator skillIter = bounds.first; skillIter != bounds.second; ++skillIter) - if (skillIter->second->skillId == achievementCriteria->learn_skill_line.skillLine) - spellCount++; - } - SetCriteriaProgress(achievementCriteria, spellCount, referencePlayer); - break; - } - case ACHIEVEMENT_CRITERIA_TYPE_EARN_HONORABLE_KILL: - SetCriteriaProgress(achievementCriteria, referencePlayer->GetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS), referencePlayer); - break; - case ACHIEVEMENT_CRITERIA_TYPE_HK_CLASS: - if (!miscValue1 || miscValue1 != achievementCriteria->hk_class.classID) - continue; - - SetCriteriaProgress(achievementCriteria, 1, referencePlayer, PROGRESS_ACCUMULATE); - break; - case ACHIEVEMENT_CRITERIA_TYPE_HK_RACE: - if (!miscValue1 || miscValue1 != achievementCriteria->hk_race.raceID) - continue; - - SetCriteriaProgress(achievementCriteria, 1, referencePlayer, PROGRESS_ACCUMULATE); - break; - case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_GOLD_VALUE_OWNED: - SetCriteriaProgress(achievementCriteria, referencePlayer->GetMoney(), referencePlayer, PROGRESS_HIGHEST); - break; - case ACHIEVEMENT_CRITERIA_TYPE_EARN_ACHIEVEMENT_POINTS: - { - if (!miscValue1) - { - uint32 points = 0; - for (CompletedAchievementMap::iterator itr = m_completedAchievements.begin(); itr != m_completedAchievements.end(); ++itr) - if (AchievementEntry const* pAchievement = sAchievementStore.LookupEntry(itr->first)) - points += pAchievement->points; - SetCriteriaProgress(achievementCriteria, points, referencePlayer, PROGRESS_SET); - } - else - SetCriteriaProgress(achievementCriteria, miscValue1, referencePlayer, PROGRESS_ACCUMULATE); - break; - } - case ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE: - { - if (!miscValue1 || miscValue1 != achievementCriteria->bg_objective.objectiveId) - continue; - - SetCriteriaProgress(achievementCriteria, 1, referencePlayer, PROGRESS_ACCUMULATE); - break; - } - case ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL: - case ACHIEVEMENT_CRITERIA_TYPE_SPECIAL_PVP_KILL: - case ACHIEVEMENT_CRITERIA_TYPE_GET_KILLING_BLOWS: - { - // skip login update - if (!miscValue1) - continue; - - SetCriteriaProgress(achievementCriteria, 1, referencePlayer, PROGRESS_ACCUMULATE); - break; - } - case ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL_AT_AREA: - { - if (!miscValue1 || miscValue1 != achievementCriteria->honorable_kill_at_area.areaID) - continue; - - SetCriteriaProgress(achievementCriteria, 1, referencePlayer, PROGRESS_ACCUMULATE); - break; - } - case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_TEAM_RATING: - { - uint32 reqTeamType = achievementCriteria->highest_team_rating.teamtype; + uint32 reqTeamType = achievementCriteria->highest_personal_rating.teamtype; if (miscValue1) { @@ -1744,37 +1361,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, SetCriteriaProgress(achievementCriteria, miscValue1, referencePlayer, PROGRESS_HIGHEST); } - else // login case - { - for (uint32 arena_slot = 0; arena_slot < MAX_ARENA_SLOT; ++arena_slot) - { - uint32 teamId = referencePlayer->GetArenaTeamId(arena_slot); - if (!teamId) - continue; - - ArenaTeam* team = sArenaTeamMgr->GetArenaTeamById(teamId); - if (!team || team->GetType() != reqTeamType) - continue; - - SetCriteriaProgress(achievementCriteria, team->GetStats().Rating, referencePlayer, PROGRESS_HIGHEST); - break; - } - } - - break; - } - case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_PERSONAL_RATING: - { - uint32 reqTeamType = achievementCriteria->highest_personal_rating.teamtype; - - if (miscValue1) - { - if (miscValue2 != reqTeamType) - continue; - - SetCriteriaProgress(achievementCriteria, miscValue1, referencePlayer, PROGRESS_HIGHEST); - } - else // login case + else // login case { for (uint32 arena_slot = 0; arena_slot < MAX_ARENA_SLOT; ++arena_slot) { @@ -1796,15 +1383,6 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, break; } - case ACHIEVEMENT_CRITERIA_TYPE_CURRENCY: - if (!miscValue1 || !miscValue2) - continue; - if (miscValue1 != achievementCriteria->currencyGain.currency) - continue; - if (int64(miscValue2) < 0) - continue; - SetCriteriaProgress(achievementCriteria, miscValue2, referencePlayer, PROGRESS_ACCUMULATE); - break; // FIXME: not triggered in code as result, need to implement case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_RAID: case ACHIEVEMENT_CRITERIA_TYPE_WIN_ARENA: @@ -1812,7 +1390,6 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, case ACHIEVEMENT_CRITERIA_TYPE_OWN_RANK: case ACHIEVEMENT_CRITERIA_TYPE_EARNED_PVP_TITLE: case ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE_TYPE: - case ACHIEVEMENT_CRITERIA_TYPE_TOTAL: case ACHIEVEMENT_CRITERIA_TYPE_SPENT_GOLD_GUILD_REPAIRS: case ACHIEVEMENT_CRITERIA_TYPE_REACH_GUILD_LEVEL: case ACHIEVEMENT_CRITERIA_TYPE_CRAFT_ITEMS_GUILD: @@ -1882,7 +1459,7 @@ bool AchievementMgr::IsCompletedCriteria(AchievementCriteriaEntry const* achi if (!progress) return false; - switch (achievementCriteria->requiredType) + switch (achievementCriteria->type) { case ACHIEVEMENT_CRITERIA_TYPE_WIN_BG: return progress->counter >= achievementCriteria->win_bg.winCount; @@ -2045,16 +1622,16 @@ bool AchievementMgr::IsCompletedAchievement(AchievementEntry const* entry) return false; // for achievement with referenced achievement criterias get from referenced and counter from self - uint32 achievmentForTestId = entry->refAchievement ? entry->refAchievement : entry->ID; - uint32 achievmentForTestCount = entry->count; + uint32 achievementForTestId = entry->refAchievement ? entry->refAchievement : entry->ID; + uint32 achievementForTestCount = entry->count; - AchievementCriteriaEntryList const* cList = sAchievementMgr->GetAchievementCriteriaByAchievement(achievmentForTestId); + AchievementCriteriaEntryList const* cList = sAchievementMgr->GetAchievementCriteriaByAchievement(achievementForTestId); if (!cList) return false; uint32 count = 0; // For SUMM achievements, we have to count the progress of each criteria of the achievement. - // Oddly, the target count is NOT countained in the achievement, but in each individual criteria + // Oddly, the target count is NOT contained in the achievement, but in each individual criteria if (entry->flags & ACHIEVEMENT_FLAG_SUMM) { for (AchievementCriteriaEntryList::const_iterator itr = cList->begin(); itr != cList->end(); ++itr) @@ -2089,12 +1666,12 @@ bool AchievementMgr::IsCompletedAchievement(AchievementEntry const* entry) completed_all = false; // completed as have req. count of completed criterias - if (achievmentForTestCount > 0 && achievmentForTestCount <= count) + if (achievementForTestCount > 0 && achievementForTestCount <= count) return true; } // all criterias completed requirement - if (completed_all && achievmentForTestCount == 0) + if (completed_all && achievementForTestCount == 0) return true; return false; @@ -2162,7 +1739,7 @@ void AchievementMgr::SetCriteriaProgress(AchievementCriteriaEntry const* entr progress->changed = true; progress->date = time(NULL); // set the date to the latest update. - AchievementEntry const* achievement = sAchievementStore.LookupEntry(entry->referredAchievement); + AchievementEntry const* achievement = sAchievementMgr->GetAchievement(entry->achievement); uint32 timeElapsed = 0; bool criteriaComplete = IsCompletedCriteria(entry, achievement); @@ -2192,7 +1769,7 @@ void AchievementMgr::UpdateTimedAchievements(uint32 timeDiff) // Time is up, remove timer and reset progress if (itr->second <= timeDiff) { - AchievementCriteriaEntry const* entry = sAchievementCriteriaStore.LookupEntry(itr->first); + AchievementCriteriaEntry const* entry = sAchievementMgr->GetAchievementCriteria(itr->first); RemoveCriteriaProgress(entry); m_timedAchievements.erase(itr++); } @@ -2219,7 +1796,7 @@ void AchievementMgr::StartTimedAchievement(AchievementCriteriaTimedTypes if ((*i)->timedCriteriaMiscId != entry) continue; - AchievementEntry const* achievement = sAchievementStore.LookupEntry((*i)->referredAchievement); + AchievementEntry const* achievement = sAchievementMgr->GetAchievement((*i)->achievement); if (m_timedAchievements.find((*i)->ID) == m_timedAchievements.end() && !IsCompletedCriteria(*i, achievement)) { // Start the timer @@ -2238,7 +1815,7 @@ template void AchievementMgr::RemoveTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry) { AchievementCriteriaEntryList const& achievementCriteriaList = sAchievementMgr->GetTimedAchievementCriteriaByType(type); - for (AchievementCriteriaEntryList::const_iterator i = achievementCriteriaList.begin(); i!=achievementCriteriaList.end(); ++i) + for (AchievementCriteriaEntryList::const_iterator i = achievementCriteriaList.begin(); i != achievementCriteriaList.end(); ++i) { if ((*i)->timedCriteriaMiscId != entry) continue; @@ -2262,7 +1839,7 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement sLog->outInfo(LOG_FILTER_ACHIEVEMENTSYS, "AchievementMgr::CompletedAchievement(%u)", achievement->ID); // disable for gamemasters with GM-mode enabled - if (_owner->isGameMaster()) + if (GetOwner()->isGameMaster()) return; if (achievement->flags & ACHIEVEMENT_FLAG_COUNTER || HasAchieved(achievement->ID)) @@ -2338,7 +1915,7 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement template<> void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement, Player* referencePlayer) { - sLog->outInfo(LOG_FILTER_GENERAL, "AchievementMgr::CompletedAchievement(%u)", achievement->ID); + sLog->outDebug(LOG_FILTER_ACHIEVEMENTSYS, "AchievementMgr::CompletedAchievement(%u)", achievement->ID); if (achievement->flags & ACHIEVEMENT_FLAG_COUNTER || HasAchieved(achievement->ID)) return; @@ -2370,7 +1947,7 @@ struct VisibleAchievementPred { bool operator()(CompletedAchievementMap::value_type const& val) { - AchievementEntry const* achievement = sAchievementStore.LookupEntry(val.first); + AchievementEntry const* achievement = sAchievementMgr->GetAchievement(val.first); return achievement && !(achievement->flags & ACHIEVEMENT_FLAG_HIDDEN); } }; @@ -2450,7 +2027,7 @@ void AchievementMgr::SendAllAchievementData(Player* /*receiver*/) const template<> void AchievementMgr::SendAllAchievementData(Player* receiver) const { - WorldPacket data(SMSG_GUILD_ACHIEVEMENT_DATA, m_completedAchievements.size() * (4 + 4) + 4); + WorldPacket data(SMSG_GUILD_ACHIEVEMENT_DATA, m_completedAchievements.size() * (4 + 4) + 3); data.WriteBits(m_completedAchievements.size(), 23); for (CompletedAchievementMap::const_iterator itr = m_completedAchievements.begin(); itr != m_completedAchievements.end(); ++itr) { @@ -2642,174 +2219,804 @@ void AchievementMgr::SendAchievementInfo(Player* receiver, uint32 achieve if (numCriteria) data.append(criteriaData); - receiver->GetSession()->SendPacket(&data); -} + receiver->GetSession()->SendPacket(&data); +} + +template +bool AchievementMgr::HasAchieved(uint32 achievementId) const +{ + return m_completedAchievements.find(achievementId) != m_completedAchievements.end(); +} + +template +bool AchievementMgr::CanUpdateCriteria(AchievementCriteriaEntry const* criteria, AchievementEntry const* achievement, uint64 miscValue1, uint64 miscValue2, Unit const* unit, Player* referencePlayer) +{ + if (DisableMgr::IsDisabledFor(DISABLE_TYPE_ACHIEVEMENT_CRITERIA, criteria->ID, NULL)) + { + sLog->outTrace(LOG_FILTER_ACHIEVEMENTSYS, "CanUpdateCriteria: %s (Id: %u Type %s) Disabled", + criteria->name, criteria->ID, AchievementGlobalMgr::GetCriteriaTypeString(criteria->type)); + return false; + } + + if (achievement->mapID != -1 && referencePlayer->GetMapId() != uint32(achievement->mapID)) + { + sLog->outTrace(LOG_FILTER_ACHIEVEMENTSYS, "CanUpdateCriteria: %s (Id: %u Type %s) Wrong map", + criteria->name, criteria->ID, AchievementGlobalMgr::GetCriteriaTypeString(criteria->type)); + return false; + } + + if ((achievement->requiredFaction == ACHIEVEMENT_FACTION_HORDE && referencePlayer->GetTeam() != HORDE) || + (achievement->requiredFaction == ACHIEVEMENT_FACTION_ALLIANCE && referencePlayer->GetTeam() != ALLIANCE)) + { + sLog->outTrace(LOG_FILTER_ACHIEVEMENTSYS, "CanUpdateCriteria: %s (Id: %u Type %s) Wrong faction", + criteria->name, criteria->ID, AchievementGlobalMgr::GetCriteriaTypeString(criteria->type)); + return false; + } + + if (IsCompletedCriteria(criteria, achievement)) + { + sLog->outTrace(LOG_FILTER_ACHIEVEMENTSYS, "CanUpdateCriteria: %s (Id: %u Type %s) Is Completed", + criteria->name, criteria->ID, AchievementGlobalMgr::GetCriteriaTypeString(criteria->type)); + return false; + } + + if (!RequirementsSatisfied(criteria, miscValue1, miscValue2, unit, referencePlayer)) + { + sLog->outTrace(LOG_FILTER_ACHIEVEMENTSYS, "CanUpdateCriteria: %s (Id: %u Type %s) Requirements not satisfied", + criteria->name, criteria->ID, AchievementGlobalMgr::GetCriteriaTypeString(criteria->type)); + return false; + } + + if (!AdditionalRequirementsSatisfied(criteria, miscValue1, miscValue2, unit, referencePlayer)) + { + sLog->outTrace(LOG_FILTER_ACHIEVEMENTSYS, "CanUpdateCriteria: %s (Id: %u Type %s) Additional requirements not satisfied", + criteria->name, criteria->ID, AchievementGlobalMgr::GetCriteriaTypeString(criteria->type)); + return false; + } + + if (!ConditionsSatisfied(criteria, referencePlayer)) + { + sLog->outTrace(LOG_FILTER_ACHIEVEMENTSYS, "CanUpdateCriteria: %s (Id: %u Type %s) Conditions not satisfied", + criteria->name, criteria->ID, AchievementGlobalMgr::GetCriteriaTypeString(criteria->type)); + return false; + } + + return true; +} + +template +bool AchievementMgr::ConditionsSatisfied(AchievementCriteriaEntry const *criteria, Player* referencePlayer) const +{ + for (uint32 i = 0; i < MAX_CRITERIA_REQUIREMENTS; ++i) + { + if (!criteria->additionalRequirements[i].additionalRequirement_type) + continue; + + switch (criteria->additionalRequirements[i].additionalRequirement_type) + { + case ACHIEVEMENT_CRITERIA_CONDITION_BG_MAP: + if (referencePlayer->GetMapId() != criteria->additionalRequirements[i].additionalRequirement_value) + return false; + break; + case ACHIEVEMENT_CRITERIA_CONDITION_NOT_IN_GROUP: + if (referencePlayer->GetGroup()) + return false; + break; + default: + break; + } + } + + return true; +} + +template +bool AchievementMgr::RequirementsSatisfied(AchievementCriteriaEntry const *achievementCriteria, uint64 miscValue1, uint64 miscValue2, Unit const *unit, Player* referencePlayer) const +{ + switch (AchievementCriteriaTypes(achievementCriteria->type)) + { + case ACHIEVEMENT_CRITERIA_TYPE_ACCEPTED_SUMMONINGS: + case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST: + case ACHIEVEMENT_CRITERIA_TYPE_CREATE_AUCTION: + case ACHIEVEMENT_CRITERIA_TYPE_FALL_WITHOUT_DYING: + case ACHIEVEMENT_CRITERIA_TYPE_FLIGHT_PATHS_TAKEN: + case ACHIEVEMENT_CRITERIA_TYPE_GET_KILLING_BLOWS: + case ACHIEVEMENT_CRITERIA_TYPE_GOLD_EARNED_BY_AUCTIONS: + case ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_AT_BARBER: + case ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_MAIL: + case ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TALENTS: + case ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TRAVELLING: + case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_BID: + case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_SOLD: + case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEALING_RECEIVED: + case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEAL_CASTED: + case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HIT_DEALT: + case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HIT_RECEIVED: + case ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL: + case ACHIEVEMENT_CRITERIA_TYPE_LOOT_MONEY: + case ACHIEVEMENT_CRITERIA_TYPE_LOSE_DUEL: + case ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_QUEST_REWARD: + case ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_VENDORS: + case ACHIEVEMENT_CRITERIA_TYPE_NUMBER_OF_TALENT_RESETS: + case ACHIEVEMENT_CRITERIA_TYPE_QUEST_ABANDONED: + case ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED: + case ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED: + case ACHIEVEMENT_CRITERIA_TYPE_SPECIAL_PVP_KILL: + case ACHIEVEMENT_CRITERIA_TYPE_TOTAL_DAMAGE_RECEIVED: + case ACHIEVEMENT_CRITERIA_TYPE_TOTAL_HEALING_RECEIVED: + case ACHIEVEMENT_CRITERIA_TYPE_USE_LFD_TO_GROUP_WITH_PLAYERS: + case ACHIEVEMENT_CRITERIA_TYPE_VISIT_BARBER_SHOP: + case ACHIEVEMENT_CRITERIA_TYPE_WIN_DUEL: + case ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA: + case ACHIEVEMENT_CRITERIA_TYPE_WON_AUCTIONS: + if (!miscValue1) + return false; + break; + case ACHIEVEMENT_CRITERIA_TYPE_BUY_BANK_SLOT: + case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST_DAILY: + case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST_COUNT: + case ACHIEVEMENT_CRITERIA_TYPE_EARNED_PVP_TITLE: + case ACHIEVEMENT_CRITERIA_TYPE_EARN_ACHIEVEMENT_POINTS: + case ACHIEVEMENT_CRITERIA_TYPE_GAIN_EXALTED_REPUTATION: + case ACHIEVEMENT_CRITERIA_TYPE_GAIN_HONORED_REPUTATION: + case ACHIEVEMENT_CRITERIA_TYPE_GAIN_REVERED_REPUTATION: + case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_GOLD_VALUE_OWNED: + case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_PERSONAL_RATING: + case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_TEAM_RATING: + case ACHIEVEMENT_CRITERIA_TYPE_KNOWN_FACTIONS: + case ACHIEVEMENT_CRITERIA_TYPE_REACH_LEVEL: + break; + case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT: + if (m_completedAchievements.find(achievementCriteria->complete_achievement.linkedAchievement) == m_completedAchievements.end()) + return false; + break; + case ACHIEVEMENT_CRITERIA_TYPE_WIN_BG: + if (!miscValue1 || achievementCriteria->win_bg.bgMapID != referencePlayer->GetMapId()) + return false; + break; + case ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE: + if (!miscValue1 || achievementCriteria->kill_creature.creatureID != miscValue1) + return false; + break; + case ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL: + // update at loading or specific skill update + if (miscValue1 && miscValue1 != achievementCriteria->reach_skill_level.skillID) + return false; + break; + case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LEVEL: + // update at loading or specific skill update + if (miscValue1 && miscValue1 != achievementCriteria->learn_skill_level.skillID) + return false; + break; + case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUESTS_IN_ZONE: + if (miscValue1 && miscValue1 != achievementCriteria->complete_quests_in_zone.zoneID) + return false; + break; + case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_BATTLEGROUND: + if (!miscValue1 || referencePlayer->GetMapId() != achievementCriteria->complete_battleground.mapID) + return false; + break; + case ACHIEVEMENT_CRITERIA_TYPE_DEATH_AT_MAP: + if (!miscValue1 || referencePlayer->GetMapId() != achievementCriteria->death_at_map.mapID) + return false; + break; + case ACHIEVEMENT_CRITERIA_TYPE_DEATH: + { + if (!miscValue1) + return false; + // skip wrong arena achievements, if not achievIdByArenaSlot then normal total death counter + bool notfit = false; + for (int j = 0; j < MAX_ARENA_SLOT; ++j) + { + if (achievIdByArenaSlot[j] == achievementCriteria->achievement) + { + Battleground* bg = referencePlayer->GetBattleground(); + if (!bg || !bg->isArena() || ArenaTeam::GetSlotByType(bg->GetArenaType()) != j) + notfit = true; + break; + } + } + if (notfit) + return false; + break; + } + case ACHIEVEMENT_CRITERIA_TYPE_DEATH_IN_DUNGEON: + { + if (!miscValue1) + return false; + + Map const* map = referencePlayer->IsInWorld() ? referencePlayer->GetMap() : sMapMgr->FindMap(referencePlayer->GetMapId(), referencePlayer->GetInstanceId()); + if (!map || !map->IsDungeon()) + return false; + + // search case + bool found = false; + for (int j = 0; achievIdForDungeon[j][0]; ++j) + { + if (achievIdForDungeon[j][0] == achievementCriteria->achievement) + { + if (map->IsRaid()) + { + // if raid accepted (ignore difficulty) + if (!achievIdForDungeon[j][2]) + break; // for + } + else if (referencePlayer->GetDungeonDifficulty() == DUNGEON_DIFFICULTY_NORMAL) + { + // dungeon in normal mode accepted + if (!achievIdForDungeon[j][1]) + break; // for + } + else + { + // dungeon in heroic mode accepted + if (!achievIdForDungeon[j][3]) + break; // for + } + + found = true; + break; // for + } + } + if (!found) + return false; + + //FIXME: work only for instances where max == min for players + if (((InstanceMap*)map)->GetMaxPlayers() != achievementCriteria->death_in_dungeon.manLimit) + return false; + break; + } + case ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_CREATURE: + if (!miscValue1 || miscValue1 != achievementCriteria->killed_by_creature.creatureEntry) + return false; + break; + case ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_PLAYER: + if (!miscValue1) + return false; + + // if team check required: must kill by opposition faction + if (achievementCriteria->achievement == 318 && miscValue2 == referencePlayer->GetTeam()) + return false; + break; + case ACHIEVEMENT_CRITERIA_TYPE_DEATHS_FROM: + if (!miscValue1 || miscValue2 != achievementCriteria->death_from.type) + return false; + break; + case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST: + { + // if miscValues != 0, it contains the questID. + if (miscValue1) + { + if (miscValue1 != achievementCriteria->complete_quest.questID) + return false; + } + else + { + // login case. + if (!referencePlayer->GetQuestRewardStatus(achievementCriteria->complete_quest.questID)) + return false; + } + + if (AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria)) + if (!data->Meets(referencePlayer, unit)) + return false; + break; + } + case ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET: + case ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2: + if (!miscValue1 || miscValue1 != achievementCriteria->be_spell_target.spellID) + return false; + break; + case ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL: + case ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL2: + if (!miscValue1 || miscValue1 != achievementCriteria->cast_spell.spellID) + return false; + break; + case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL: + if (miscValue1 && miscValue1 != achievementCriteria->learn_spell.spellID) + return false; + + if (!referencePlayer->HasSpell(achievementCriteria->learn_spell.spellID)) + return false; + break; + case ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE: + // miscValue1 = loot_type (note: 0 = LOOT_CORPSE and then it ignored) + // miscValue2 = count of item loot + if (!miscValue1 || !miscValue2 || miscValue1 != achievementCriteria->loot_type.lootType) + return false; + break; + case ACHIEVEMENT_CRITERIA_TYPE_OWN_ITEM: + if (miscValue1 && achievementCriteria->own_item.itemID != miscValue1) + return false; + break; + case ACHIEVEMENT_CRITERIA_TYPE_USE_ITEM: + if (!miscValue1 || achievementCriteria->use_item.itemID != miscValue1) + return false; + break; + case ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM: + if (!miscValue1 || miscValue1 != achievementCriteria->own_item.itemID) + return false; + break; + case ACHIEVEMENT_CRITERIA_TYPE_EXPLORE_AREA: + { + WorldMapOverlayEntry const* worldOverlayEntry = sWorldMapOverlayStore.LookupEntry(achievementCriteria->explore_area.areaReference); + if (!worldOverlayEntry) + break; -template -bool AchievementMgr::HasAchieved(uint32 achievementId) const -{ - return m_completedAchievements.find(achievementId) != m_completedAchievements.end(); -} + bool matchFound = false; + for (int j = 0; j < MAX_WORLD_MAP_OVERLAY_AREA_IDX; ++j) + { + uint32 area_id = worldOverlayEntry->areatableID[j]; + if (!area_id) // array have 0 only in empty tail + break; -template -bool AchievementMgr::CanUpdateCriteria(AchievementCriteriaEntry const* criteria, AchievementEntry const* achievement, uint64 miscValue1, uint64 /*miscValue2*/, Unit* unit, Player* referencePlayer) -{ - if (DisableMgr::IsDisabledFor(DISABLE_TYPE_ACHIEVEMENT_CRITERIA, criteria->ID, NULL)) - return false; + int32 exploreFlag = GetAreaFlagByAreaID(area_id); + if (exploreFlag < 0) + continue; - if (achievement->mapID != -1 && referencePlayer->GetMapId() != uint32(achievement->mapID)) - return false; + uint32 playerIndexOffset = uint32(exploreFlag) / 32; + uint32 mask = 1 << (uint32(exploreFlag) % 32); - // don't update already completed criteria - if (IsCompletedCriteria(criteria, achievement)) - return false; + if (referencePlayer->GetUInt32Value(PLAYER_EXPLORED_ZONES_1 + playerIndexOffset) & mask) + { + matchFound = true; + break; + } + } - if ((achievement->requiredFaction == ACHIEVEMENT_FACTION_HORDE && referencePlayer->GetTeam() != HORDE) || - (achievement->requiredFaction == ACHIEVEMENT_FACTION_ALLIANCE && referencePlayer->GetTeam() != ALLIANCE)) - return false; + if (!matchFound) + return false; + break; + } + case ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION: + if (miscValue1 && miscValue1 != achievementCriteria->gain_reputation.factionID) + return false; + break; + case ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM: + // miscValue1 = itemid miscValue2 = itemSlot + if (!miscValue1 || miscValue2 != achievementCriteria->equip_epic_item.itemSlot) + return false; + break; + case ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED_ON_LOOT: + case ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED_ON_LOOT: + { + // miscValue1 = itemid miscValue2 = diced value + if (!miscValue1 || miscValue2 != achievementCriteria->roll_greed_on_loot.rollValue) + return false; - for (uint32 i = 0; i < MAX_CRITERIA_REQUIREMENTS; ++i) - { - if (!criteria->additionalRequirements[i].additionalRequirement_type) - continue; + ItemTemplate const* proto = sObjectMgr->GetItemTemplate(uint32(miscValue1)); + if (!proto) + return false; + break; + } + case ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE: + if (!miscValue1 || miscValue1 != achievementCriteria->do_emote.emoteID) + return false; + break; + case ACHIEVEMENT_CRITERIA_TYPE_DAMAGE_DONE: + case ACHIEVEMENT_CRITERIA_TYPE_HEALING_DONE: + if (!miscValue1) + return false; - switch (criteria->additionalRequirements[i].additionalRequirement_type) - { - case ACHIEVEMENT_CRITERIA_CONDITION_BG_MAP: - if (referencePlayer->GetMapId() != criteria->additionalRequirements[i].additionalRequirement_value) + if (achievementCriteria->additionalRequirements[0].additionalRequirement_type == ACHIEVEMENT_CRITERIA_CONDITION_BG_MAP) + { + if (referencePlayer->GetMapId() != achievementCriteria->additionalRequirements[0].additionalRequirement_value) return false; - break; - case ACHIEVEMENT_CRITERIA_CONDITION_NOT_IN_GROUP: - if (referencePlayer->GetGroup()) + + // map specific case (BG in fact) expected player targeted damage/heal + if (!unit || unit->GetTypeId() != TYPEID_PLAYER) return false; - break; - default: - break; + } + break; + case ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM: + // miscValue1 = item_id + if (!miscValue1 || miscValue1 != achievementCriteria->equip_item.itemID) + return false; + break; + case ACHIEVEMENT_CRITERIA_TYPE_USE_GAMEOBJECT: + if (!miscValue1 || miscValue1 != achievementCriteria->use_gameobject.goEntry) + return false; + break; + case ACHIEVEMENT_CRITERIA_TYPE_FISH_IN_GAMEOBJECT: + if (!miscValue1 || miscValue1 != achievementCriteria->fish_in_gameobject.goEntry) + return false; + break; + case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS: + if (miscValue1 && miscValue1 != achievementCriteria->learn_skillline_spell.skillLine) + return false; + break; + case ACHIEVEMENT_CRITERIA_TYPE_LOOT_EPIC_ITEM: + case ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM: + { + if (!miscValue1) + return false; + ItemTemplate const* proto = sObjectMgr->GetItemTemplate(miscValue1); + if (!proto || proto->Quality < ITEM_QUALITY_EPIC) + return false; + break; } + case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LINE: + if (miscValue1 && miscValue1 != achievementCriteria->learn_skill_line.skillLine) + return false; + break; + case ACHIEVEMENT_CRITERIA_TYPE_HK_CLASS: + if (!miscValue1 || miscValue1 != achievementCriteria->hk_class.classID) + return false; + break; + case ACHIEVEMENT_CRITERIA_TYPE_HK_RACE: + if (!miscValue1 || miscValue1 != achievementCriteria->hk_race.raceID) + return false; + break; + case ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE: + if (!miscValue1 || miscValue1 != achievementCriteria->bg_objective.objectiveId) + return false; + break; + case ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL_AT_AREA: + if (!miscValue1 || miscValue1 != achievementCriteria->honorable_kill_at_area.areaID) + return false; + break; + case ACHIEVEMENT_CRITERIA_TYPE_CURRENCY: + if (!miscValue1 || !miscValue2 || int64(miscValue2) < 0 + || miscValue1 != achievementCriteria->currencyGain.currency) + return false; + break; + default: + break; } + return true; +} - // additional conditions - for (int8 i = 0; i < MAX_ADDITIONAL_CRITERIA_CONDITIONS; ++i) +template +bool AchievementMgr::AdditionalRequirementsSatisfied(AchievementCriteriaEntry const *criteria, uint64 miscValue1, uint64 /*miscValue2*/, Unit const* unit, Player* referencePlayer) const +{ + for (uint8 i = 0; i < MAX_ADDITIONAL_CRITERIA_CONDITIONS; ++i) { - if (!criteria->additionalConditionType[i]) - continue; + uint32 const reqType = criteria->additionalConditionType[i]; + uint32 const reqValue = criteria->additionalConditionValue[i]; - uint32 value = criteria->additionalConditionValue[i]; - switch (criteria->additionalConditionType[i]) + switch (AchievementCriteriaAdditionalCondition(reqType)) { - case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_MUST_BE_PLAYER: - if (!unit || !unit->ToPlayer()) + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_CREATURE_ENTRY: // 4 + if (!unit || unit->GetEntry() != reqValue) return false; break; - case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_MUST_BE_DEAD: - if (!unit || unit->isAlive()) + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_MUST_BE_PLAYER: // 5 + if (!unit || unit->GetTypeId() != TYPEID_PLAYER) return false; break; - case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_MUST_BE_MOUNTED: - if (!unit || !unit->IsMounted()) + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_MUST_BE_DEAD: // 6 + if (!unit || unit->isAlive()) return false; break; - case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_MAP_DIFFICULTY: - if (uint32(referencePlayer->GetMap()->GetDifficulty()) != value) + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_MUST_BE_ENEMY: // 7 + if (!unit) return false; + if (const Player* player = unit->ToPlayer()) + if (player->GetTeam() == referencePlayer->GetTeam()) + return false; break; - case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_MAP: - if (referencePlayer->GetMapId() != value) + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_HAS_AURA: // 8 + if (!referencePlayer->HasAura(reqValue)) return false; break; - case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_ZONE: - if (referencePlayer->GetZoneId() != value) + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_HAS_AURA: // 10 + if (!unit || !unit->HasAura(reqValue)) return false; - break; - case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_AREA: - if (referencePlayer->GetAreaId() != value) + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_MUST_BE_MOUNTED: // 11 + if (!unit || !unit->IsMounted()) return false; break; - case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_MUST_BE_ENEMY: - if (!unit) + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_ITEM_QUALITY_MIN: // 14 + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_ITEM_QUALITY_EQUALS: // 15 + { + // miscValue1 is itemid + ItemTemplate const * const item = sObjectMgr->GetItemTemplate(uint32(miscValue1)); + if (!item || item->Quality < reqValue) return false; - if (const Player* player = unit->ToPlayer()) - if (player->GetTeam() == referencePlayer->GetTeam()) - return false; break; - case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_CREATURE_ENTRY: - if (!unit || !unit->ToCreature()) - return false; - if (unit->ToCreature()->GetEntry() != value) + } + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_MAP_DIFFICULTY: // 20 + if (uint32(referencePlayer->GetMap()->GetDifficulty()) != reqValue) return false; break; - case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_HAS_AURA: - if (!referencePlayer->HasAura(value)) + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_MAP: // 32 + if (referencePlayer->GetMapId() != reqValue) return false; break; - case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_HAS_AURA: - if (!unit || !unit->HasAura(value)) + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_ZONE: // 18 + if (referencePlayer->GetZoneId() != reqValue) return false; - case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_ITEM_QUALITY_MIN: - if (ItemTemplate const * itemProto = sObjectMgr->GetItemTemplate(miscValue1)) - if (itemProto->Quality < value) - return false; break; - case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_ITEM_QUALITY_EQUALS: - if (ItemTemplate const * itemProto = sObjectMgr->GetItemTemplate(miscValue1)) - if (itemProto->Quality < value) - return false; + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_AREA: // 17 + if (referencePlayer->GetAreaId() != reqValue) + return false; break; - case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_RACE: - if (referencePlayer->getRace() != value) + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_RACE: // 25 + if (referencePlayer->getRace() != reqValue) return false; break; - case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_CLASS: - if (referencePlayer->getClass() != value) + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_CLASS: // 26 + if (referencePlayer->getClass() != reqValue) return false; break; - case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_RACE: - if (!unit || !unit->ToPlayer()) - break; - if (unit->ToPlayer()->getRace() != value) + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_RACE: // 27 + if (!unit || unit->GetTypeId() != TYPEID_PLAYER || unit->getRace() != reqValue) return false; break; - case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_CLASS: - if (!unit || !unit->ToPlayer()) - break; - if (unit->ToPlayer()->getClass() != value) + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_CLASS: // 28 + if (!unit || unit->GetTypeId() != TYPEID_PLAYER || unit->getClass() != reqValue) return false; break; - case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_MAX_GROUP_MEMBERS: - if (referencePlayer->GetGroup() && referencePlayer->GetGroup()->GetMembersCount() >= value) + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_MAX_GROUP_MEMBERS: // 29 + if (referencePlayer->GetGroup() && referencePlayer->GetGroup()->GetMembersCount() >= reqValue) return false; break; - case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_CREATURE_TYPE: - if (!unit || !unit->ToCreature()) + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_CREATURE_TYPE: // 30 + { + if (!unit) return false; - if (unit->ToCreature()->GetCreatureType() != value) + Creature const * const creature = unit->ToCreature(); + if (!creature || creature->GetCreatureType() != reqValue) return false; break; - case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_LEVEL: - if (referencePlayer->getLevel() != value) + } + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TITLE_BIT_INDEX: // 38 + // miscValue1 is title's bit index + if (miscValue1 != reqValue) return false; break; - case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_LEVEL: - if (!unit || unit->getLevel() != value) + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_LEVEL: // 39 + if (referencePlayer->getLevel() != reqValue) return false; break; - case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_HEALTH_PERCENT_BELOW: - if (!unit || unit->GetHealthPct() >= value) + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_LEVEL: // 40 + if (!unit || unit->getLevel() != reqValue) return false; break; - // generic, compare miscValue1 with DBC value - case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TITLE_BIT_INDEX: - if (miscValue1 != value) + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_HEALTH_PERCENT_BELOW: // 46 + if (!unit || unit->GetHealthPct() >= reqValue) return false; break; default: break; } } - return true; } +char const* AchievementGlobalMgr::GetCriteriaTypeString(uint32 type) +{ + return GetCriteriaTypeString(AchievementCriteriaTypes(type)); +} + +char const* AchievementGlobalMgr::GetCriteriaTypeString(AchievementCriteriaTypes type) +{ + switch (type) + { + case ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE: + return "KILL_CREATURE"; + case ACHIEVEMENT_CRITERIA_TYPE_WIN_BG: + return "TYPE_WIN_BG"; + case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ARCHAEOLOGY_PROJECTS: + return "COMPLETE_RESEARCH"; + case ACHIEVEMENT_CRITERIA_TYPE_REACH_LEVEL: + return "REACH_LEVEL"; + case ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL: + return "REACH_SKILL_LEVEL"; + case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT: + return "COMPLETE_ACHIEVEMENT"; + case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST_COUNT: + return "COMPLETE_QUEST_COUNT"; + case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST_DAILY: + return "COMPLETE_DAILY_QUEST_DAILY"; + case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUESTS_IN_ZONE: + return "COMPLETE_QUESTS_IN_ZONE"; + case ACHIEVEMENT_CRITERIA_TYPE_CURRENCY: + return "CURRENCY"; + case ACHIEVEMENT_CRITERIA_TYPE_DAMAGE_DONE: + return "DAMAGE_DONE"; + case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST: + return "COMPLETE_DAILY_QUEST"; + case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_BATTLEGROUND: + return "COMPLETE_BATTLEGROUND"; + case ACHIEVEMENT_CRITERIA_TYPE_DEATH_AT_MAP: + return "DEATH_AT_MAP"; + case ACHIEVEMENT_CRITERIA_TYPE_DEATH: + return "DEATH"; + case ACHIEVEMENT_CRITERIA_TYPE_DEATH_IN_DUNGEON: + return "DEATH_IN_DUNGEON"; + case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_RAID: + return "COMPLETE_RAID"; + case ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_CREATURE: + return "KILLED_BY_CREATURE"; + case ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_PLAYER: + return "KILLED_BY_PLAYER"; + case ACHIEVEMENT_CRITERIA_TYPE_FALL_WITHOUT_DYING: + return "FALL_WITHOUT_DYING"; + case ACHIEVEMENT_CRITERIA_TYPE_DEATHS_FROM: + return "DEATHS_FROM"; + case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST: + return "COMPLETE_QUEST"; + case ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET: + return "BE_SPELL_TARGET"; + case ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL: + return "CAST_SPELL"; + case ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE: + return "BG_OBJECTIVE_CAPTURE"; + case ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL_AT_AREA: + return "HONORABLE_KILL_AT_AREA"; + case ACHIEVEMENT_CRITERIA_TYPE_WIN_ARENA: + return "WIN_ARENA"; + case ACHIEVEMENT_CRITERIA_TYPE_PLAY_ARENA: + return "PLAY_ARENA"; + case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL: + return "LEARN_SPELL"; + case ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL: + return "HONORABLE_KILL"; + case ACHIEVEMENT_CRITERIA_TYPE_OWN_ITEM: + return "OWN_ITEM"; + case ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA: + return "WIN_RATED_ARENA"; + case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_TEAM_RATING: + return "HIGHEST_TEAM_RATING"; + case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_PERSONAL_RATING: + return "HIGHEST_PERSONAL_RATING"; + case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LEVEL: + return "LEARN_SKILL_LEVEL"; + case ACHIEVEMENT_CRITERIA_TYPE_USE_ITEM: + return "USE_ITEM"; + case ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM: + return "LOOT_ITEM"; + case ACHIEVEMENT_CRITERIA_TYPE_EXPLORE_AREA: + return "EXPLORE_AREA"; + case ACHIEVEMENT_CRITERIA_TYPE_OWN_RANK: + return "OWN_RANK"; + case ACHIEVEMENT_CRITERIA_TYPE_BUY_BANK_SLOT: + return "BUY_BANK_SLOT"; + case ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION: + return "GAIN_REPUTATION"; + case ACHIEVEMENT_CRITERIA_TYPE_GAIN_EXALTED_REPUTATION: + return "GAIN_EXALTED_REPUTATION"; + case ACHIEVEMENT_CRITERIA_TYPE_VISIT_BARBER_SHOP: + return "VISIT_BARBER_SHOP"; + case ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM: + return "EQUIP_EPIC_ITEM"; + case ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED_ON_LOOT: + return "ROLL_NEED_ON_LOOT"; + case ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED_ON_LOOT: + return "GREED_ON_LOOT"; + case ACHIEVEMENT_CRITERIA_TYPE_HK_CLASS: + return "HK_CLASS"; + case ACHIEVEMENT_CRITERIA_TYPE_HK_RACE: + return "HK_RACE"; + case ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE: + return "DO_EMOTE"; + case ACHIEVEMENT_CRITERIA_TYPE_HEALING_DONE: + return "HEALING_DONE"; + case ACHIEVEMENT_CRITERIA_TYPE_GET_KILLING_BLOWS: + return "GET_KILLING_BLOWS"; + case ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM: + return "EQUIP_ITEM"; + case ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_VENDORS: + return "MONEY_FROM_VENDORS"; + case ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TALENTS: + return "GOLD_SPENT_FOR_TALENTS"; + case ACHIEVEMENT_CRITERIA_TYPE_NUMBER_OF_TALENT_RESETS: + return "NUMBER_OF_TALENT_RESETS"; + case ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_QUEST_REWARD: + return "MONEY_FROM_QUEST_REWARD"; + case ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TRAVELLING: + return "GOLD_SPENT_FOR_TRAVELLING"; + case ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_AT_BARBER: + return "GOLD_SPENT_AT_BARBER"; + case ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_MAIL: + return "GOLD_SPENT_FOR_MAIL"; + case ACHIEVEMENT_CRITERIA_TYPE_LOOT_MONEY: + return "LOOT_MONEY"; + case ACHIEVEMENT_CRITERIA_TYPE_USE_GAMEOBJECT: + return "USE_GAMEOBJECT"; + case ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2: + return "BE_SPELL_TARGET2"; + case ACHIEVEMENT_CRITERIA_TYPE_SPECIAL_PVP_KILL: + return "SPECIAL_PVP_KILL"; + case ACHIEVEMENT_CRITERIA_TYPE_FISH_IN_GAMEOBJECT: + return "FISH_IN_GAMEOBJECT"; + case ACHIEVEMENT_CRITERIA_TYPE_EARNED_PVP_TITLE: + return "EARNED_PVP_TITLE"; + case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS: + return "LEARN_SKILLLINE_SPELLS"; + case ACHIEVEMENT_CRITERIA_TYPE_WIN_DUEL: + return "WIN_DUEL"; + case ACHIEVEMENT_CRITERIA_TYPE_LOSE_DUEL: + return "LOSE_DUEL"; + case ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE_TYPE: + return "KILL_CREATURE_TYPE"; + case ACHIEVEMENT_CRITERIA_TYPE_GOLD_EARNED_BY_AUCTIONS: + return "GOLD_EARNED_BY_AUCTIONS"; + case ACHIEVEMENT_CRITERIA_TYPE_CREATE_AUCTION: + return "CREATE_AUCTION"; + case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_BID: + return "HIGHEST_AUCTION_BID"; + case ACHIEVEMENT_CRITERIA_TYPE_WON_AUCTIONS: + return "WON_AUCTIONS"; + case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_SOLD: + return "HIGHEST_AUCTION_SOLD"; + case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_GOLD_VALUE_OWNED: + return "HIGHEST_GOLD_VALUE_OWNED"; + case ACHIEVEMENT_CRITERIA_TYPE_GAIN_REVERED_REPUTATION: + return "GAIN_REVERED_REPUTATION"; + case ACHIEVEMENT_CRITERIA_TYPE_GAIN_HONORED_REPUTATION: + return "GAIN_HONORED_REPUTATION"; + case ACHIEVEMENT_CRITERIA_TYPE_KNOWN_FACTIONS: + return "KNOWN_FACTIONS"; + case ACHIEVEMENT_CRITERIA_TYPE_LOOT_EPIC_ITEM: + return "LOOT_EPIC_ITEM"; + case ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM: + return "RECEIVE_EPIC_ITEM"; + case ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED: + return "ROLL_NEED"; + case ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED: + return "ROLL_GREED"; + case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HIT_DEALT: + return "HIT_DEALT"; + case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HIT_RECEIVED: + return "HIT_RECEIVED"; + case ACHIEVEMENT_CRITERIA_TYPE_TOTAL_DAMAGE_RECEIVED: + return "TOTAL_DAMAGE_RECEIVED"; + case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEAL_CASTED: + return "HIGHEST_HEAL_CASTED"; + case ACHIEVEMENT_CRITERIA_TYPE_TOTAL_HEALING_RECEIVED: + return "TOTAL_HEALING_RECEIVED"; + case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEALING_RECEIVED: + return "HIGHEST_HEALING_RECEIVED"; + case ACHIEVEMENT_CRITERIA_TYPE_QUEST_ABANDONED: + return "QUEST_ABANDONED"; + case ACHIEVEMENT_CRITERIA_TYPE_FLIGHT_PATHS_TAKEN: + return "FLIGHT_PATHS_TAKEN"; + case ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE: + return "LOOT_TYPE"; + case ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL2: + return "CAST_SPELL2"; + case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LINE: + return "LEARN_SKILL_LINE"; + case ACHIEVEMENT_CRITERIA_TYPE_EARN_HONORABLE_KILL: + return "EARN_HONORABLE_KILL"; + case ACHIEVEMENT_CRITERIA_TYPE_ACCEPTED_SUMMONINGS: + return "ACCEPTED_SUMMONINGS"; + case ACHIEVEMENT_CRITERIA_TYPE_EARN_ACHIEVEMENT_POINTS: + return "EARN_ACHIEVEMENT_POINTS"; + case ACHIEVEMENT_CRITERIA_TYPE_USE_LFD_TO_GROUP_WITH_PLAYERS: + return "USE_LFD_TO_GROUP_WITH_PLAYERS"; + case ACHIEVEMENT_CRITERIA_TYPE_SPENT_GOLD_GUILD_REPAIRS: + return "SPENT_GOLD_GUILD_REPAIRS"; + case ACHIEVEMENT_CRITERIA_TYPE_REACH_GUILD_LEVEL: + return "REACH_GUILD_LEVEL"; + case ACHIEVEMENT_CRITERIA_TYPE_CRAFT_ITEMS_GUILD: + return "CRAFT_ITEMS_GUILD"; + case ACHIEVEMENT_CRITERIA_TYPE_CATCH_FROM_POOL: + return "CATCH_FROM_POOL"; + case ACHIEVEMENT_CRITERIA_TYPE_BUY_GUILD_BANK_SLOTS: + return "BUY_GUILD_BANK_SLOTS"; + case ACHIEVEMENT_CRITERIA_TYPE_EARN_GUILD_ACHIEVEMENT_POINTS: + return "EARN_GUILD_ACHIEVEMENT_POINTS"; + case ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_BATTLEGROUND: + return "WIN_RATED_BATTLEGROUND"; + case ACHIEVEMENT_CRITERIA_TYPE_REACH_BG_RATING: + return "REACH_BG_RATING"; + case ACHIEVEMENT_CRITERIA_TYPE_BUY_GUILD_TABARD: + return "BUY_GUILD_TABARD"; + case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUESTS_GUILD: + return "COMPLETE_QUESTS_GUILD"; + case ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILLS_GUILD: + return "HONORABLE_KILLS_GUILD"; + case ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE_TYPE_GUILD: + return "KILL_CREATURE_TYPE_GUILD"; + default: + return "MISSING_TYPE"; + } + return ""; +} + template class AchievementMgr; template class AchievementMgr; @@ -2828,18 +3035,18 @@ void AchievementGlobalMgr::LoadAchievementCriteriaList() uint32 guildCriterias = 0; for (uint32 entryId = 0; entryId < sAchievementCriteriaStore.GetNumRows(); ++entryId) { - AchievementCriteriaEntry const* criteria = sAchievementCriteriaStore.LookupEntry(entryId); + AchievementCriteriaEntry const* criteria = sAchievementMgr->GetAchievementCriteria(entryId); if (!criteria) continue; - AchievementEntry const* achievement = sAchievementStore.LookupEntry(criteria->referredAchievement); + AchievementEntry const* achievement = sAchievementMgr->GetAchievement(criteria->achievement); - m_AchievementCriteriaListByAchievement[criteria->referredAchievement].push_back(criteria); + m_AchievementCriteriaListByAchievement[criteria->achievement].push_back(criteria); if (achievement && achievement->flags & ACHIEVEMENT_FLAG_GUILD) - ++guildCriterias, m_GuildAchievementCriteriasByType[criteria->requiredType].push_back(criteria); + ++guildCriterias, m_GuildAchievementCriteriasByType[criteria->type].push_back(criteria); else - ++criterias, m_AchievementCriteriasByType[criteria->requiredType].push_back(criteria); + ++criterias, m_AchievementCriteriasByType[criteria->type].push_back(criteria); if (criteria->timeLimit) m_AchievementCriteriasByTimedType[criteria->timedCriteriaStartType].push_back(criteria); @@ -2862,7 +3069,7 @@ void AchievementGlobalMgr::LoadAchievementReferenceList() for (uint32 entryId = 0; entryId < sAchievementStore.GetNumRows(); ++entryId) { - AchievementEntry const* achievement = sAchievementStore.LookupEntry(entryId); + AchievementEntry const* achievement = sAchievementMgr->GetAchievement(entryId); if (!achievement || !achievement->refAchievement) continue; @@ -2871,7 +3078,7 @@ void AchievementGlobalMgr::LoadAchievementReferenceList() } // Once Bitten, Twice Shy (10 player) - Icecrown Citadel - if (AchievementEntry const* achievement = sAchievementStore.LookupEntry(4539)) + if (AchievementEntry const* achievement = sAchievementMgr->GetAchievement(4539)) const_cast(achievement)->mapID = 631; // Correct map requirement (currently has Ulduar) sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u achievement references in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); @@ -2898,7 +3105,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaData() Field* fields = result->Fetch(); uint32 criteria_id = fields[0].GetUInt32(); - AchievementCriteriaEntry const* criteria = sAchievementCriteriaStore.LookupEntry(criteria_id); + AchievementCriteriaEntry const* criteria = sAchievementMgr->GetAchievementCriteria(criteria_id); if (!criteria) { @@ -2955,7 +3162,7 @@ void AchievementGlobalMgr::LoadCompletedAchievements() Field* fields = result->Fetch(); uint16 achievementId = fields[0].GetUInt16(); - const AchievementEntry* achievement = sAchievementStore.LookupEntry(achievementId); + const AchievementEntry* achievement = sAchievementMgr->GetAchievement(achievementId); if (!achievement) { // Remove non existent achievements from all characters @@ -2971,7 +3178,8 @@ void AchievementGlobalMgr::LoadCompletedAchievements() } else if (achievement->flags & (ACHIEVEMENT_FLAG_REALM_FIRST_REACH | ACHIEVEMENT_FLAG_REALM_FIRST_KILL)) m_allCompletedAchievements.insert(achievementId); - } while (result->NextRow()); + } + while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu completed achievements in %u ms", (unsigned long)m_allCompletedAchievements.size(), GetMSTimeDiffToNow(oldMSTime)); } @@ -2982,7 +3190,7 @@ void AchievementGlobalMgr::LoadRewards() m_achievementRewards.clear(); // need for reload case - // 0 1 2 3 4 5 6 + // 0 1 2 3 4 5 6 QueryResult result = WorldDatabase.Query("SELECT entry, title_A, title_H, item, sender, subject, text FROM achievement_reward"); if (!result) @@ -2997,10 +3205,10 @@ void AchievementGlobalMgr::LoadRewards() { Field* fields = result->Fetch(); uint32 entry = fields[0].GetUInt32(); - const AchievementEntry* pAchievement = sAchievementStore.LookupEntry(entry); + const AchievementEntry* pAchievement = GetAchievement(entry); if (!pAchievement) { - sLog->outError(LOG_FILTER_SQL, "Table `achievement_reward` has wrong achievement (Entry: %u), ignore", entry); + sLog->outError(LOG_FILTER_SQL, "Table `achievement_reward` has wrong achievement (Entry: %u), ignored.", entry); continue; } @@ -3015,7 +3223,7 @@ void AchievementGlobalMgr::LoadRewards() // must be title or mail at least if (!reward.titleId[0] && !reward.titleId[1] && !reward.sender) { - sLog->outError(LOG_FILTER_SQL, "Table `achievement_reward` (Entry: %u) not have title or item reward data, ignore.", entry); + sLog->outError(LOG_FILTER_SQL, "Table `achievement_reward` (Entry: %u) does not have title or item reward data, ignored.", entry); continue; } @@ -3074,7 +3282,6 @@ void AchievementGlobalMgr::LoadRewards() m_achievementRewards[entry] = reward; ++count; - } while (result->NextRow()); @@ -3117,7 +3324,18 @@ void AchievementGlobalMgr::LoadRewardLocales() ObjectMgr::AddLocaleString(fields[1 + 2 * (i - 1)].GetString(), locale, data.subject); ObjectMgr::AddLocaleString(fields[1 + 2 * (i - 1) + 1].GetString(), locale, data.text); } - } while (result->NextRow()); + } + while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu achievement reward locale strings in %u ms", (unsigned long)m_achievementRewardLocales.size(), GetMSTimeDiffToNow(oldMSTime)); } + +AchievementEntry const* AchievementGlobalMgr::GetAchievement(uint32 achievementId) const +{ + return sAchievementStore.LookupEntry(achievementId); +} + +AchievementCriteriaEntry const* AchievementGlobalMgr::GetAchievementCriteria(uint32 criteriaId) const +{ + return sAchievementCriteriaStore.LookupEntry(criteriaId); +} diff --git a/src/server/game/Achievements/AchievementMgr.h b/src/server/game/Achievements/AchievementMgr.h index bcedbd09901..4196f6728fe 100755 --- a/src/server/game/Achievements/AchievementMgr.h +++ b/src/server/game/Achievements/AchievementMgr.h @@ -15,6 +15,7 @@ * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ + #ifndef __TRINITY_ACHIEVEMENTMGR_H #define __TRINITY_ACHIEVEMENTMGR_H @@ -67,6 +68,7 @@ enum AchievementCriteriaDataType #define MAX_ACHIEVEMENT_CRITERIA_DATA_TYPE 22 // maximum value in AchievementCriteriaDataType enum class Player; class Unit; +class WorldPacket; struct AchievementCriteriaData { @@ -217,10 +219,6 @@ struct CompletedAchievementData typedef UNORDERED_MAP CriteriaProgressMap; typedef UNORDERED_MAP CompletedAchievementMap; -class Unit; -class Player; -class WorldPacket; - template class AchievementMgr { @@ -232,8 +230,8 @@ class AchievementMgr static void DeleteFromDB(uint32 lowguid); void LoadFromDB(PreparedQueryResult achievementResult, PreparedQueryResult criteriaResult); void SaveToDB(SQLTransaction& trans); - void ResetAchievementCriteria(AchievementCriteriaTypes type, uint32 miscvalue1 = 0, uint32 miscvalue2 = 0, bool evenIfCriteriaComplete = false); - void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1 = 0, uint32 miscValue2 = 0, Unit* unit = NULL, Player* referencePlayer = NULL); + void ResetAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1 = 0, uint32 miscValue2 = 0, bool evenIfCriteriaComplete = false); + void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1 = 0, uint32 miscValue2 = 0, Unit const* unit = NULL, Player* referencePlayer = NULL); void CompletedAchievement(AchievementEntry const* entry, Player* referencePlayer); void CheckAllAchievementCriteria(Player* referencePlayer); void SendAllAchievementData(Player* receiver) const; @@ -255,9 +253,13 @@ class AchievementMgr void CompletedCriteriaFor(AchievementEntry const* achievement, Player* referencePlayer); bool IsCompletedCriteria(AchievementCriteriaEntry const* achievementCriteria, AchievementEntry const* achievement); bool IsCompletedAchievement(AchievementEntry const* entry); - bool CanUpdateCriteria(AchievementCriteriaEntry const* criteria, AchievementEntry const* achievement, uint64 miscValue1, uint64 miscValue2, Unit* unit, Player* referencePlayer); + bool CanUpdateCriteria(AchievementCriteriaEntry const* criteria, AchievementEntry const* achievement, uint64 miscValue1, uint64 miscValue2, Unit const* unit, Player* referencePlayer); void SendPacket(WorldPacket* data) const; + bool ConditionsSatisfied(AchievementCriteriaEntry const *criteria, Player* referencePlayer) const; + bool RequirementsSatisfied(AchievementCriteriaEntry const *criteria, uint64 miscValue1, uint64 miscValue2, Unit const* unit, Player* referencePlayer) const; + bool AdditionalRequirementsSatisfied(AchievementCriteriaEntry const* criteria, uint64 miscValue1, uint64 miscValue2, Unit const* unit, Player* referencePlayer) const; + T* _owner; CriteriaProgressMap m_criteriaProgress; CompletedAchievementMap m_completedAchievements; @@ -272,6 +274,9 @@ class AchievementGlobalMgr ~AchievementGlobalMgr() {} public: + static char const* GetCriteriaTypeString(AchievementCriteriaTypes type); + static char const* GetCriteriaTypeString(uint32 type); + AchievementCriteriaEntryList const& GetAchievementCriteriaByType(AchievementCriteriaTypes type, bool guild = false) const { return guild ? m_GuildAchievementCriteriasByType[type] : m_AchievementCriteriasByType[type]; @@ -346,6 +351,8 @@ class AchievementGlobalMgr void LoadCompletedAchievements(); void LoadRewards(); void LoadRewardLocales(); + AchievementEntry const* GetAchievement(uint32 achievementId) const; + AchievementCriteriaEntry const* GetAchievementCriteria(uint32 achievementId) const; private: AchievementCriteriaDataMap m_criteriaDataMap; diff --git a/src/server/game/DataStores/DBCEnums.h b/src/server/game/DataStores/DBCEnums.h index cd8accd3759..5ab9949d9cf 100755 --- a/src/server/game/DataStores/DBCEnums.h +++ b/src/server/game/DataStores/DBCEnums.h @@ -19,18 +19,21 @@ #ifndef DBCENUMS_H #define DBCENUMS_H -// Client expected level limitation, like as used in DBC item max levels for "until max player level" -// use as default max player level, must be fit max level for used client -// also see MAX_LEVEL and STRONG_MAX_LEVEL define -#define DEFAULT_MAX_LEVEL 85 - -// client supported max level for player/pets/etc. Avoid overflow or client stability affected. -// also see GT_MAX_LEVEL define -#define MAX_LEVEL 100 - -// Server side limitation. Base at used code requirements. -// also see MAX_LEVEL and GT_MAX_LEVEL define -#define STRONG_MAX_LEVEL 255 +enum LevelLimit +{ + // Client expected level limitation, like as used in DBC item max levels for "until max player level" + // use as default max player level, must be fit max level for used client + // also see MAX_LEVEL and STRONG_MAX_LEVEL define + DEFAULT_MAX_LEVEL = 85, + + // client supported max level for player/pets/etc. Avoid overflow or client stability affected. + // also see GT_MAX_LEVEL define + MAX_LEVEL = 100, + + // Server side limitation. Base at used code requirements. + // also see MAX_LEVEL and GT_MAX_LEVEL define + STRONG_MAX_LEVEL = 255, +}; enum BattlegroundBracketId // bracketId for level ranges { @@ -58,27 +61,30 @@ enum AchievementFaction enum AchievementFlags { - ACHIEVEMENT_FLAG_COUNTER = 0x00000001, // Just count statistic (never stop and complete) - ACHIEVEMENT_FLAG_HIDDEN = 0x00000002, // Not sent to client - internal use only - ACHIEVEMENT_FLAG_PLAY_NO_VISUAL = 0x00000004, // Client does not play achievement earned visual - ACHIEVEMENT_FLAG_SUMM = 0x00000008, // Use summ criteria value from all reqirements (and calculate max value) - ACHIEVEMENT_FLAG_MAX_USED = 0x00000010, // Show max criteria (and calculate max value ??) - ACHIEVEMENT_FLAG_REQ_COUNT = 0x00000020, // Use not zero req count (and calculate max value) - ACHIEVEMENT_FLAG_AVERAGE = 0x00000040, // Show as average value (value / time_in_days) depend from other flag (by def use last criteria value) - ACHIEVEMENT_FLAG_BAR = 0x00000080, // Show as progress bar (value / max vale) depend from other flag (by def use last criteria value) - ACHIEVEMENT_FLAG_REALM_FIRST_REACH = 0x00000100, // - ACHIEVEMENT_FLAG_REALM_FIRST_KILL = 0x00000200, // - ACHIEVEMENT_FLAG_UNK3 = 0x00000400, // ACHIEVEMENT_FLAG_HIDE_NAME_IN_TIE - ACHIEVEMENT_FLAG_REALM_FIRST_GUILD = 0x00000800, // first guild on realm done something - ACHIEVEMENT_FLAG_SHOW_IN_GUILD_NEWS = 0x00001000, // Shows in guild news - ACHIEVEMENT_FLAG_SHOW_IN_GUILD_HEADER = 0x00002000, // Shows in guild news header - ACHIEVEMENT_FLAG_GUILD = 0x00004000, // - ACHIEVEMENT_FLAG_SHOW_GUILD_MEMBERS = 0x00008000, // - ACHIEVEMENT_FLAG_SHOW_CRITERIA_MEMBERS = 0x00010000, // - + ACHIEVEMENT_FLAG_COUNTER = 0x00000001, // Just count statistic (never stop and complete) + ACHIEVEMENT_FLAG_HIDDEN = 0x00000002, // Not sent to client - internal use only + ACHIEVEMENT_FLAG_PLAY_NO_VISUAL = 0x00000004, // Client does not play achievement earned visual + ACHIEVEMENT_FLAG_SUMM = 0x00000008, // Use summ criteria value from all requirements (and calculate max value) + ACHIEVEMENT_FLAG_MAX_USED = 0x00000010, // Show max criteria (and calculate max value ??) + ACHIEVEMENT_FLAG_REQ_COUNT = 0x00000020, // Use not zero req count (and calculate max value) + ACHIEVEMENT_FLAG_AVERAGE = 0x00000040, // Show as average value (value / time_in_days) depend from other flag (by def use last criteria value) + ACHIEVEMENT_FLAG_BAR = 0x00000080, // Show as progress bar (value / max vale) depend from other flag (by def use last criteria value) + ACHIEVEMENT_FLAG_REALM_FIRST_REACH = 0x00000100, // + ACHIEVEMENT_FLAG_REALM_FIRST_KILL = 0x00000200, // + ACHIEVEMENT_FLAG_UNK3 = 0x00000400, // ACHIEVEMENT_FLAG_HIDE_NAME_IN_TIE + ACHIEVEMENT_FLAG_REALM_FIRST_GUILD = 0x00000800, // first guild on realm done something + ACHIEVEMENT_FLAG_SHOW_IN_GUILD_NEWS = 0x00001000, // Shows in guild news + ACHIEVEMENT_FLAG_SHOW_IN_GUILD_HEADER = 0x00002000, // Shows in guild news header + ACHIEVEMENT_FLAG_GUILD = 0x00004000, // + ACHIEVEMENT_FLAG_SHOW_GUILD_MEMBERS = 0x00008000, // + ACHIEVEMENT_FLAG_SHOW_CRITERIA_MEMBERS = 0x00010000, // }; -#define MAX_CRITERIA_REQUIREMENTS 2 +enum +{ + MAX_CRITERIA_REQUIREMENTS = 2, + MAX_ADDITIONAL_CRITERIA_CONDITIONS = 3 +}; enum AchievementCriteriaCondition { @@ -92,80 +98,53 @@ enum AchievementCriteriaCondition ACHIEVEMENT_CRITERIA_CONDITION_UNK3 = 13, // unk }; -#define MAX_ADDITIONAL_CRITERIA_CONDITIONS 3 - enum AchievementCriteriaAdditionalCondition { - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_DRUNK_VALUE = 1, // NYI - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK2 = 2, - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_ITEM_LEVEL = 3, // NYI - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_CREATURE_ENTRY = 4, - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_MUST_BE_PLAYER = 5, - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_MUST_BE_DEAD = 6, - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_MUST_BE_ENEMY = 7, - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_HAS_AURA = 8, - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK9 = 9, // unused in 4.0.6a - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_HAS_AURA = 10, - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_MUST_BE_MOUNTED = 11, - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK12 = 12, // unused in 4.0.6a - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK13 = 13, // unused in 4.0.6a - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_ITEM_QUALITY_MIN = 14, - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_ITEM_QUALITY_EQUALS = 15, - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK16 = 16, - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_AREA = 17, - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_ZONE = 18, - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK19 = 19, // unused in 4.0.6a - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_MAP_DIFFICULTY = 20, - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_CREATURE_YIELDS_XP = 21, // NYI - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK22 = 22, // unused in 4.0.6a - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK23 = 23, // unused in 4.0.6a - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_ARENA_TEAM_SIZE = 24, // NYI - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_RACE = 25, - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_CLASS = 26, - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_RACE = 27, - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_CLASS = 28, - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_MAX_GROUP_MEMBERS = 29, - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_CREATURE_TYPE = 30, - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK31 = 31, // unused in 4.0.6a - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_MAP = 32, - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_ITEM_CLASS = 33, // NYI - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_ITEM_SUBCLASS = 34, // NYI - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK35 = 35, // related to timed completing-quests achievements - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK36 = 36, // unused in 4.0.6a - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_MIN_PERSONAL_RATING = 37, // NYI (when implementing don't forget about ACHIEVEMENT_CRITERIA_CONDITION_NO_LOSE) - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TITLE_BIT_INDEX = 38, - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_LEVEL = 39, - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_LEVEL = 40, - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_ZONE = 41, // NYI - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK42 = 42, // unused in 4.0.6a - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK43 = 43, // unused in 4.0.6a - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK44 = 44, // unused in 4.0.6a - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK45 = 45, // unused in 4.0.6a - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_HEALTH_PERCENT_BELOW = 46, - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK47 = 47, // unused in 4.0.6a - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK48 = 48, // unused in 4.0.6a - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK49 = 49, // unused in 4.0.6a - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK50 = 50, // unused in 4.0.6a - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK51 = 51, // unused in 4.0.6a - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK52 = 52, // unused in 4.0.6a - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK53 = 53, // unused in 4.0.6a - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK54 = 54, // unused in 4.0.6a - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK55 = 55, - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_MIN_ACHIEVEMENT_POINTS = 56, // NYI - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK57 = 57, // unused in 4.0.6a - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_REQUIRES_LFG_GROUP = 58, // NYI - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK59 = 59, // unused in 4.0.6a - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK60 = 60, - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_REQUIRES_GUILD_GROUP = 61, // NYI - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_GUILD_REPUTATION = 62, // NYI - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_RATED_BATTLEGROUND = 63, // NYI - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK64 = 64, // unused in 4.0.6a - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK65 = 65, // Archaeology, item quality related - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK66 = 66, // Archaeology, race related + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_DRUNK_VALUE = 1, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK2 = 2, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_ITEM_LEVEL = 3, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_CREATURE_ENTRY = 4, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_MUST_BE_PLAYER = 5, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_MUST_BE_DEAD = 6, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_MUST_BE_ENEMY = 7, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_HAS_AURA = 8, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_HAS_AURA = 10, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_MUST_BE_MOUNTED = 11, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_ITEM_QUALITY_MIN = 14, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_ITEM_QUALITY_EQUALS = 15, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK16 = 16, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_AREA = 17, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_ZONE = 18, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_MAP_DIFFICULTY = 20, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_CREATURE_YIELDS_XP = 21, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_ARENA_TEAM_SIZE = 24, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_RACE = 25, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_CLASS = 26, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_RACE = 27, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_CLASS = 28, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_MAX_GROUP_MEMBERS = 29, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_CREATURE_TYPE = 30, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_MAP = 32, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_ITEM_CLASS = 33, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_ITEM_SUBCLASS = 34, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK35 = 35, // related to timed completing-quests achievements + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_MIN_PERSONAL_RATING = 37, // NYI (when implementing don't forget about ACHIEVEMENT_CRITERIA_CONDITION_NO_LOSE) + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TITLE_BIT_INDEX = 38, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_LEVEL = 39, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_LEVEL = 40, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_ZONE = 41, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_HEALTH_PERCENT_BELOW = 46, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK55 = 55, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_MIN_ACHIEVEMENT_POINTS = 56, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_REQUIRES_LFG_GROUP = 58, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK60 = 60, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_REQUIRES_GUILD_GROUP = 61, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_GUILD_REPUTATION = 62, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_RATED_BATTLEGROUND = 63, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_PROJECT_RARITY = 65, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_PROJECT_RACE = 66, }; -#define MAX_ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TYPE 66 - enum AchievementCriteriaFlags { ACHIEVEMENT_CRITERIA_FLAG_SHOW_PROGRESS_BAR = 0x00000001, // Show progress as bar @@ -198,8 +177,7 @@ enum AchievementCriteriaTypes ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL = 7, ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT = 8, ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST_COUNT = 9, - // you have to complete a daily quest x times in a row - ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST_DAILY = 10, + ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST_DAILY = 10, // you have to complete a daily quest x times in a row ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUESTS_IN_ZONE = 11, ACHIEVEMENT_CRITERIA_TYPE_CURRENCY = 12, ACHIEVEMENT_CRITERIA_TYPE_DAMAGE_DONE = 13, @@ -234,18 +212,15 @@ enum AchievementCriteriaTypes ACHIEVEMENT_CRITERIA_TYPE_BUY_BANK_SLOT = 45, ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION = 46, ACHIEVEMENT_CRITERIA_TYPE_GAIN_EXALTED_REPUTATION = 47, - // noted: rewarded as soon as the player payed, not at taking place at the seat ACHIEVEMENT_CRITERIA_TYPE_VISIT_BARBER_SHOP = 48, ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM = 49, - // TODO: itemlevel is mentioned in text but not present in dbc - ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED_ON_LOOT = 50, + ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED_ON_LOOT = 50, // TODO: itemlevel is mentioned in text but not present in dbc ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED_ON_LOOT = 51, ACHIEVEMENT_CRITERIA_TYPE_HK_CLASS = 52, ACHIEVEMENT_CRITERIA_TYPE_HK_RACE = 53, ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE = 54, ACHIEVEMENT_CRITERIA_TYPE_HEALING_DONE = 55, - // TODO: in some cases map not present, and in some cases need do without die - ACHIEVEMENT_CRITERIA_TYPE_GET_KILLING_BLOWS = 56, + ACHIEVEMENT_CRITERIA_TYPE_GET_KILLING_BLOWS = 56, // TODO: in some cases map not present, and in some cases need do without die ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM = 57, ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_VENDORS = 59, ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TALENTS = 60, @@ -259,13 +234,11 @@ enum AchievementCriteriaTypes ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2 = 69, ACHIEVEMENT_CRITERIA_TYPE_SPECIAL_PVP_KILL = 70, ACHIEVEMENT_CRITERIA_TYPE_FISH_IN_GAMEOBJECT = 72, - // TODO: title id is not mentioned in dbc - ACHIEVEMENT_CRITERIA_TYPE_EARNED_PVP_TITLE = 74, + ACHIEVEMENT_CRITERIA_TYPE_EARNED_PVP_TITLE = 74, // TODO: title id is not mentioned in dbc ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS = 75, ACHIEVEMENT_CRITERIA_TYPE_WIN_DUEL = 76, ACHIEVEMENT_CRITERIA_TYPE_LOSE_DUEL = 77, - // TODO: creature type (demon, undead etc.) is not stored in dbc - ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE_TYPE = 78, + ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE_TYPE = 78, // TODO: creature type (demon, undead etc.) is not stored in dbc ACHIEVEMENT_CRITERIA_TYPE_GOLD_EARNED_BY_AUCTIONS = 80, ACHIEVEMENT_CRITERIA_TYPE_CREATE_AUCTION = 82, ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_BID = 83, @@ -288,8 +261,7 @@ enum AchievementCriteriaTypes ACHIEVEMENT_CRITERIA_TYPE_QUEST_ABANDONED = 107, ACHIEVEMENT_CRITERIA_TYPE_FLIGHT_PATHS_TAKEN = 108, ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE = 109, - // TODO: target entry is missing - ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL2 = 110, + ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL2 = 110, // TODO: target entry is missing ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LINE = 112, ACHIEVEMENT_CRITERIA_TYPE_EARN_HONORABLE_KILL = 113, ACHIEVEMENT_CRITERIA_TYPE_ACCEPTED_SUMMONINGS = 114, @@ -326,10 +298,10 @@ enum AchievementCriteriaTypes ACHIEVEMENT_CRITERIA_TYPE_UNK148 = 148, ACHIEVEMENT_CRITERIA_TYPE_UNK149 = 149, ACHIEVEMENT_CRITERIA_TYPE_UNK150 = 150, - // 0..144 => 145 criteria types total - ACHIEVEMENT_CRITERIA_TYPE_TOTAL = 151, }; +#define ACHIEVEMENT_CRITERIA_TYPE_TOTAL 151 + enum AchievementCategory { CATEGORY_CHILDRENS_WEEK = 163, diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index b12aee36fc1..1d397e8f3ec 100644 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -67,8 +67,8 @@ struct AchievementCategoryEntry struct AchievementCriteriaEntry { uint32 ID; // 0 - uint32 referredAchievement; // 1 - uint32 requiredType; // 2 + uint32 achievement; // 1 + uint32 type; // 2 union { // ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE = 0 diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 677b3cccf82..76aae192c41 100644 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -85,7 +85,7 @@ void WorldSession::HandleRepopRequestOpcode(WorldPacket& recvData) GetPlayer()->RepopAtGraveyard(); } -void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recvData) +void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_GOSSIP_SELECT_OPTION"); @@ -170,7 +170,7 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recvData) } } -void WorldSession::HandleWhoOpcode(WorldPacket & recvData) +void WorldSession::HandleWhoOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_WHO Message"); @@ -367,7 +367,7 @@ void WorldSession::HandleWhoOpcode(WorldPacket & recvData) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Send SMSG_WHO Message"); } -void WorldSession::HandleLogoutRequestOpcode(WorldPacket & /*recvData*/) +void WorldSession::HandleLogoutRequestOpcode(WorldPacket& /*recvData*/) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_LOGOUT_REQUEST Message, security - %u", GetSecurity()); @@ -420,12 +420,12 @@ void WorldSession::HandleLogoutRequestOpcode(WorldPacket & /*recvData*/) LogoutRequest(time(NULL)); } -void WorldSession::HandlePlayerLogoutOpcode(WorldPacket & /*recvData*/) +void WorldSession::HandlePlayerLogoutOpcode(WorldPacket& /*recvData*/) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_PLAYER_LOGOUT Message"); } -void WorldSession::HandleLogoutCancelOpcode(WorldPacket & /*recvData*/) +void WorldSession::HandleLogoutCancelOpcode(WorldPacket& /*recvData*/) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_LOGOUT_CANCEL Message"); @@ -485,7 +485,7 @@ void WorldSession::HandleTogglePvP(WorldPacket& recvData) // pvp->HandlePlayerActivityChanged(_player); } -void WorldSession::HandleZoneUpdateOpcode(WorldPacket & recvData) +void WorldSession::HandleZoneUpdateOpcode(WorldPacket& recvData) { uint32 newZone; recvData >> newZone; @@ -506,7 +506,7 @@ void WorldSession::HandleReturnToGraveyard(WorldPacket& /*recvPacket*/) GetPlayer()->RepopAtGraveyard(); } -void WorldSession::HandleSetSelectionOpcode(WorldPacket & recvData) +void WorldSession::HandleSetSelectionOpcode(WorldPacket& recvData) { uint64 guid; recvData >> guid; @@ -514,9 +514,9 @@ void WorldSession::HandleSetSelectionOpcode(WorldPacket & recvData) _player->SetSelection(guid); } -void WorldSession::HandleStandStateChangeOpcode(WorldPacket & recvData) +void WorldSession::HandleStandStateChangeOpcode(WorldPacket& recvData) { - // sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: Received CMSG_STANDSTATECHANGE"); -- too many spam in log at lags/debug stop + // sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_STANDSTATECHANGE"); -- too many spam in log at lags/debug stop uint32 animstate; recvData >> animstate; @@ -530,7 +530,7 @@ void WorldSession::HandleContactListOpcode(WorldPacket& recvData) _player->GetSocial()->SendSocialList(_player); } -void WorldSession::HandleAddFriendOpcode(WorldPacket & recvData) +void WorldSession::HandleAddFriendOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ADD_FRIEND"); @@ -623,7 +623,7 @@ void WorldSession::HandleDelFriendOpcode(WorldPacket& recvData) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent motd (SMSG_FRIEND_STATUS)"); } -void WorldSession::HandleAddIgnoreOpcode(WorldPacket & recvData) +void WorldSession::HandleAddIgnoreOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ADD_IGNORE"); @@ -681,7 +681,7 @@ void WorldSession::HandleAddIgnoreOpcodeCallBack(PreparedQueryResult result) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (SMSG_FRIEND_STATUS)"); } -void WorldSession::HandleDelIgnoreOpcode(WorldPacket & recvData) +void WorldSession::HandleDelIgnoreOpcode(WorldPacket& recvData) { uint64 IgnoreGUID; @@ -705,7 +705,7 @@ void WorldSession::HandleSetContactNotesOpcode(WorldPacket& recvData) _player->GetSocial()->SetFriendNote(GUID_LOPART(guid), note); } -void WorldSession::HandleBugOpcode(WorldPacket & recvData) +void WorldSession::HandleBugOpcode(WorldPacket& recvData) { uint32 suggestion, contentlen, typelen; std::string content, type; @@ -938,7 +938,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recvData) player->TeleportTo(at->target_mapId, at->target_X, at->target_Y, at->target_Z, at->target_Orientation, TELE_TO_NOT_LEAVE_TRANSPORT); } -void WorldSession::HandleUpdateAccountData(WorldPacket &recvData) +void WorldSession::HandleUpdateAccountData(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_UPDATE_ACCOUNT_DATA"); @@ -1084,12 +1084,12 @@ void WorldSession::HandleCompleteCinematic(WorldPacket& /*recvData*/) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_COMPLETE_CINEMATIC"); } -void WorldSession::HandleNextCinematicCamera(WorldPacket & /*recvData*/) +void WorldSession::HandleNextCinematicCamera(WorldPacket& /*recvData*/) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_NEXT_CINEMATIC_CAMERA"); } -void WorldSession::HandleMoveTimeSkippedOpcode(WorldPacket & recvData) +void WorldSession::HandleMoveTimeSkippedOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_MOVE_TIME_SKIPPED"); @@ -1132,7 +1132,7 @@ void WorldSession::HandleMoveTimeSkippedOpcode(WorldPacket & recvData) */ } -void WorldSession::HandleFeatherFallAck(WorldPacket &recvData) +void WorldSession::HandleFeatherFallAck(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_MOVE_FEATHER_FALL_ACK"); @@ -1190,11 +1190,11 @@ void WorldSession::HandleMoveRootAck(WorldPacket& recvData) */ } -void WorldSession::HandleSetActionBarToggles(WorldPacket& recvPacket) +void WorldSession::HandleSetActionBarToggles(WorldPacket& recvData) { uint8 actionBar; - recvPacket >> actionBar; + recvData >> actionBar; if (!GetPlayer()) // ignore until not logged (check needed because STATUS_AUTHED) { @@ -1371,7 +1371,7 @@ void WorldSession::HandleWhoisOpcode(WorldPacket& recvData) sLog->outDebug(LOG_FILTER_NETWORKIO, "Received whois command from player %s for character %s", GetPlayer()->GetName(), charname.c_str()); } -void WorldSession::HandleComplainOpcode(WorldPacket & recvData) +void WorldSession::HandleComplainOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_COMPLAIN"); @@ -1412,7 +1412,7 @@ void WorldSession::HandleComplainOpcode(WorldPacket & recvData) sLog->outDebug(LOG_FILTER_NETWORKIO, "REPORT SPAM: type %u, guid %u, unk1 %u, unk2 %u, unk3 %u, unk4 %u, message %s", spam_type, GUID_LOPART(spammer_guid), unk1, unk2, unk3, unk4, description.c_str()); } -void WorldSession::HandleRealmSplitOpcode(WorldPacket & recvData) +void WorldSession::HandleRealmSplitOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_REALM_SPLIT"); @@ -1512,7 +1512,7 @@ void WorldSession::HandleResetInstancesOpcode(WorldPacket& /*recvData*/) _player->ResetInstances(INSTANCE_RESET_ALL, false); } -void WorldSession::HandleSetDungeonDifficultyOpcode(WorldPacket & recvData) +void WorldSession::HandleSetDungeonDifficultyOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "MSG_SET_DUNGEON_DIFFICULTY"); @@ -1569,7 +1569,7 @@ void WorldSession::HandleSetDungeonDifficultyOpcode(WorldPacket & recvData) } } -void WorldSession::HandleSetRaidDifficultyOpcode(WorldPacket & recvData) +void WorldSession::HandleSetRaidDifficultyOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "MSG_SET_RAID_DIFFICULTY"); @@ -1626,7 +1626,7 @@ void WorldSession::HandleSetRaidDifficultyOpcode(WorldPacket & recvData) } } -void WorldSession::HandleCancelMountAuraOpcode(WorldPacket & /*recvData*/) +void WorldSession::HandleCancelMountAuraOpcode(WorldPacket& /*recvData*/) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CANCEL_MOUNT_AURA"); @@ -1647,7 +1647,7 @@ void WorldSession::HandleCancelMountAuraOpcode(WorldPacket & /*recvData*/) _player->RemoveAurasByType(SPELL_AURA_MOUNTED); } -void WorldSession::HandleMoveSetCanFlyAckOpcode(WorldPacket & recvData) +void WorldSession::HandleMoveSetCanFlyAckOpcode(WorldPacket& recvData) { // fly mode on/off sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_MOVE_SET_CAN_FLY_ACK"); @@ -1729,7 +1729,7 @@ void WorldSession::SendSetPhaseShift(uint32 PhaseShift) } // Battlefield and Battleground -void WorldSession::HandleAreaSpiritHealerQueryOpcode(WorldPacket & recv_data) +void WorldSession::HandleAreaSpiritHealerQueryOpcode(WorldPacket& recv_data) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AREA_SPIRIT_HEALER_QUERY"); @@ -1752,7 +1752,7 @@ void WorldSession::HandleAreaSpiritHealerQueryOpcode(WorldPacket & recv_data) bf->SendAreaSpiritHealerQueryOpcode(_player,guid); } -void WorldSession::HandleAreaSpiritHealerQueueOpcode(WorldPacket & recv_data) +void WorldSession::HandleAreaSpiritHealerQueueOpcode(WorldPacket& recv_data) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AREA_SPIRIT_HEALER_QUEUE"); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 862ac7fe794..83acbda36d5 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -541,8 +541,8 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_UNLEARN_SPECIALIZATION, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_UNREGISTER_ALL_ADDON_PREFIXES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUnregisterAddonPrefixesOpcode); DEFINE_OPCODE_HANDLER(CMSG_UPDATE_ACCOUNT_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateAccountData ); - DEFINE_OPCODE_HANDLER(CMSG_UPDATE_MISSILE_TRAJECTORY, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateMissileTrajectory ); - DEFINE_OPCODE_HANDLER(CMSG_UPDATE_PROJECTILE_POSITION, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateProjectilePosition ); + DEFINE_OPCODE_HANDLER(CMSG_UPDATE_MISSILE_TRAJECTORY, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateMissileTrajectory ); + DEFINE_OPCODE_HANDLER(CMSG_UPDATE_PROJECTILE_POSITION, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateProjectilePosition ); DEFINE_OPCODE_HANDLER(CMSG_USED_FOLLOW, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_USE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleUseItemOpcode ); DEFINE_OPCODE_HANDLER(CMSG_VIOLENCE_LEVEL, STATUS_AUTHED, PROCESS_INPLACE, &WorldSession::HandleViolenceLevel ); @@ -561,8 +561,8 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_WRAP_ITEM, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleWrapItemOpcode ); DEFINE_OPCODE_HANDLER(CMSG_ZONEUPDATE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleZoneUpdateOpcode ); DEFINE_OPCODE_HANDLER(MSG_AUCTION_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAuctionHelloOpcode ); - DEFINE_OPCODE_HANDLER(MSG_CHANNEL_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(MSG_CHANNEL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(MSG_CHANNEL_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(MSG_CHANNEL_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(MSG_CORPSE_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCorpseQueryOpcode ); DEFINE_OPCODE_HANDLER(MSG_INSPECT_ARENA_TEAMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectArenaTeamsOpcode ); DEFINE_OPCODE_HANDLER(MSG_LIST_STABLED_PETS, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleListStabledPetsOpcode ); @@ -592,7 +592,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_STRAFE, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_SWIM, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); DEFINE_OPCODE_HANDLER(MSG_MOVE_STOP_TURN, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_TELEPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_TELEPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(MSG_MOVE_TELEPORT_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveTeleportAck ); DEFINE_OPCODE_HANDLER(MSG_MOVE_TELEPORT_CHEAT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_MOVE_TIME_SKIPPED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -1690,7 +1690,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_SERVER_BUCK_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SERVER_BUCK_DATA_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SETUP_RESEARCH_HISTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SET_EXTRA_AURA_INFO_NEED_UPDATE_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + //DEFINE_OPCODE_HANDLER(SMSG_SET_EXTRA_AURA_INFO_NEED_UPDATE_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SET_EXTRA_AURA_INFO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SHOW_MAILBOX, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPELL_CHANCE_PROC_LOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From 353ebad6b91ee97469bd0ff0aaebadf3b8f28183 Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 27 Aug 2012 20:20:17 +0200 Subject: Core/Guilds * Item moves within the same guild bank tab will not be logged * Updated and enabled CMSG_GUILD_BANK_QUERY_TEXT, CMSG_GUILD_EVENT_LOG_QUERY, CMSG_SET_GUILD_BANK_TEXT, SMSG_GUILD_BANK_LOG_QUERY_RESULT, SMSG_GUILD_BANK_QUERY_TEXT_RESULT and SMSG_GUILD_EVENT_LOG_QUERY_RESULT --- ...012_08_27_00_characters_guild_bank_eventlog.sql | 1 + src/server/game/Guilds/Guild.cpp | 174 +++++++++++++++------ src/server/game/Guilds/Guild.h | 41 +++-- src/server/game/Handlers/GuildHandler.cpp | 12 +- src/server/game/Server/Protocol/Opcodes.cpp | 19 +-- src/server/game/Server/Protocol/Opcodes.h | 12 +- 6 files changed, 169 insertions(+), 90 deletions(-) create mode 100644 sql/updates/characters/2012_08_27_00_characters_guild_bank_eventlog.sql (limited to 'src') diff --git a/sql/updates/characters/2012_08_27_00_characters_guild_bank_eventlog.sql b/sql/updates/characters/2012_08_27_00_characters_guild_bank_eventlog.sql new file mode 100644 index 00000000000..c019bc81504 --- /dev/null +++ b/sql/updates/characters/2012_08_27_00_characters_guild_bank_eventlog.sql @@ -0,0 +1 @@ +DELETE FROM `guild_bank_eventlog` WHERE `EventType` IN (3,7) AND `TabId`=`DestTabId`; -- delete log entries of item moves within one tab diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 595ad77feeb..ba9d8610c12 100644 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -99,9 +99,13 @@ inline void Guild::LogHolder::AddEvent(SQLTransaction& trans, LogEntry* entry) // Writes information about all events into packet. inline void Guild::LogHolder::WritePacket(WorldPacket& data) const { - data << uint8(m_log.size()); + ByteBuffer buffer; + data.WriteBits(m_log.size(), 23); for (GuildLog::const_iterator itr = m_log.begin(); itr != m_log.end(); ++itr) - (*itr)->WritePacket(data); + (*itr)->WritePacket(data, buffer); + + data.FlushBits(); + data.append(buffer); } inline uint32 Guild::LogHolder::GetNextGUID() @@ -138,20 +142,56 @@ void Guild::EventLogEntry::SaveToDB(SQLTransaction& trans) const CharacterDatabase.ExecuteOrAppend(trans, stmt); } -void Guild::EventLogEntry::WritePacket(WorldPacket& data) const +void Guild::EventLogEntry::WritePacket(WorldPacket& data, ByteBuffer& content) const { - // Event type - data << uint8(m_eventType); - // Player 1 - data << uint64(MAKE_NEW_GUID(m_playerGuid1, 0, HIGHGUID_PLAYER)); - // Player 2 not for left/join guild events - if (m_eventType != GUILD_EVENT_LOG_JOIN_GUILD && m_eventType != GUILD_EVENT_LOG_LEAVE_GUILD) - data << uint64(MAKE_NEW_GUID(m_playerGuid2, 0, HIGHGUID_PLAYER)); - // New Rank - only for promote/demote guild events - if (m_eventType == GUILD_EVENT_LOG_PROMOTE_PLAYER || m_eventType == GUILD_EVENT_LOG_DEMOTE_PLAYER) - data << uint8(m_newRank); + ObjectGuid guid1 = MAKE_NEW_GUID(m_playerGuid1, 0, HIGHGUID_PLAYER); + ObjectGuid guid2 = MAKE_NEW_GUID(m_playerGuid2, 0, HIGHGUID_PLAYER); + + data.WriteBit(guid1[2]); + data.WriteBit(guid1[4]); + data.WriteBit(guid2[7]); + data.WriteBit(guid2[6]); + data.WriteBit(guid1[3]); + data.WriteBit(guid2[3]); + data.WriteBit(guid2[5]); + data.WriteBit(guid1[7]); + data.WriteBit(guid1[5]); + data.WriteBit(guid1[0]); + data.WriteBit(guid2[4]); + data.WriteBit(guid2[2]); + data.WriteBit(guid2[0]); + data.WriteBit(guid2[1]); + data.WriteBit(guid1[1]); + data.WriteBit(guid1[6]); + + content.WriteByteSeq(guid2[3]); + content.WriteByteSeq(guid2[2]); + content.WriteByteSeq(guid2[5]); + + // New Rank + content << uint8(m_newRank); + + content.WriteByteSeq(guid2[4]); + content.WriteByteSeq(guid1[0]); + content.WriteByteSeq(guid1[4]); + // Event timestamp - data << uint32(::time(NULL) - m_timestamp); + content << uint32(::time(NULL) - m_timestamp); + + content.WriteByteSeq(guid1[7]); + content.WriteByteSeq(guid1[3]); + content.WriteByteSeq(guid2[0]); + content.WriteByteSeq(guid2[6]); + content.WriteByteSeq(guid2[7]); + content.WriteByteSeq(guid1[5]); + + // Event type + content << uint8(m_eventType); + + content.WriteByteSeq(guid2[1]); + content.WriteByteSeq(guid1[2]); + content.WriteByteSeq(guid1[6]); + content.WriteByteSeq(guid1[1]); } /////////////////////////////////////////////////////////////////////////////// @@ -181,20 +221,52 @@ void Guild::BankEventLogEntry::SaveToDB(SQLTransaction& trans) const CharacterDatabase.ExecuteOrAppend(trans, stmt); } -void Guild::BankEventLogEntry::WritePacket(WorldPacket& data) const +void Guild::BankEventLogEntry::WritePacket(WorldPacket& data, ByteBuffer& content) const { - data << uint8(m_eventType); - data << uint64(MAKE_NEW_GUID(m_playerGuid, 0, HIGHGUID_PLAYER)); - data << uint32(m_itemOrMoney); - // if ( m_eventType != 4 || m_eventType != 5 || m_eventType != 6 || m_eventType != 8 || m_eventType != 9 ) - if (m_eventType < GUILD_BANK_LOG_DEPOSIT_MONEY) - { - data << uint32(m_itemStackCount); - if (m_eventType == GUILD_BANK_LOG_MOVE_ITEM || m_eventType == GUILD_BANK_LOG_MOVE_ITEM2) - data << uint8(m_destTabId); - } + ObjectGuid logGuid = MAKE_NEW_GUID(m_playerGuid, 0, HIGHGUID_PLAYER); - data << uint32(time(NULL) - m_timestamp); + bool hasItem = m_eventType == GUILD_BANK_LOG_DEPOSIT_ITEM || m_eventType == GUILD_BANK_LOG_WITHDRAW_ITEM || + m_eventType == GUILD_BANK_LOG_MOVE_ITEM || m_eventType == GUILD_BANK_LOG_MOVE_ITEM2; + + bool itemMoved = (m_eventType == GUILD_BANK_LOG_MOVE_ITEM || m_eventType == GUILD_BANK_LOG_MOVE_ITEM2); + + bool hasStack = (hasItem && m_itemStackCount > 1) || itemMoved; + + data.WriteBit(IsMoneyEvent()); + data.WriteBit(logGuid[4]); + data.WriteBit(logGuid[1]); + data.WriteBit(hasItem); + data.WriteBit(hasStack); + data.WriteBit(logGuid[2]); + data.WriteBit(logGuid[5]); + data.WriteBit(logGuid[3]); + data.WriteBit(logGuid[6]); + data.WriteBit(logGuid[0]); + data.WriteBit(itemMoved); + data.WriteBit(logGuid[7]); + + content.WriteByteSeq(logGuid[6]); + content.WriteByteSeq(logGuid[1]); + content.WriteByteSeq(logGuid[5]); + if (hasStack) + content << uint32(m_itemStackCount); + + content << uint8(m_eventType); + content.WriteByteSeq(logGuid[2]); + content.WriteByteSeq(logGuid[4]); + content.WriteByteSeq(logGuid[0]); + content.WriteByteSeq(logGuid[7]); + content.WriteByteSeq(logGuid[3]); + if (hasItem) + content << uint32(m_itemOrMoney); + + content << uint32(time(NULL) - m_timestamp); + + if (IsMoneyEvent()) + content << uint64(m_itemOrMoney); + + if (itemMoved) + content << uint8(m_destTabId); } /////////////////////////////////////////////////////////////////////////////// @@ -403,12 +475,12 @@ void Guild::BankTab::SetText(const std::string& text) // Sets/removes contents of specified slot. // If pItem == NULL contents are removed. -bool Guild::BankTab::SetItem(SQLTransaction& trans, uint8 slotId, Item* pItem) +bool Guild::BankTab::SetItem(SQLTransaction& trans, uint8 slotId, Item* item) { if (slotId >= GUILD_BANK_MAX_SLOTS) return false; - m_items[slotId] = pItem; + m_items[slotId] = item; PreparedStatement* stmt = NULL; @@ -418,28 +490,29 @@ bool Guild::BankTab::SetItem(SQLTransaction& trans, uint8 slotId, Item* pItem) stmt->setUInt8 (2, slotId); CharacterDatabase.ExecuteOrAppend(trans, stmt); - if (pItem) + if (item) { stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GUILD_BANK_ITEM); stmt->setUInt32(0, m_guildId); stmt->setUInt8 (1, m_tabId); stmt->setUInt8 (2, slotId); - stmt->setUInt32(3, pItem->GetGUIDLow()); + stmt->setUInt32(3, item->GetGUIDLow()); CharacterDatabase.ExecuteOrAppend(trans, stmt); - pItem->SetUInt64Value(ITEM_FIELD_CONTAINED, 0); - pItem->SetUInt64Value(ITEM_FIELD_OWNER, 0); - pItem->FSetState(ITEM_NEW); - pItem->SaveToDB(trans); // Not in inventory and can be saved standalone + item->SetUInt64Value(ITEM_FIELD_CONTAINED, 0); + item->SetUInt64Value(ITEM_FIELD_OWNER, 0); + item->FSetState(ITEM_NEW); + item->SaveToDB(trans); // Not in inventory and can be saved standalone } return true; } -void Guild::BankTab::SendText(const Guild* guild, WorldSession* session) const +void Guild::BankTab::SendText(Guild const* guild, WorldSession* session) const { - WorldPacket data(MSG_QUERY_GUILD_BANK_TEXT, 1 + m_text.size() + 1); - data << uint8(m_tabId); - data << m_text; + WorldPacket data(SMSG_GUILD_BANK_QUERY_TEXT_RESULT, 1 + m_text.size() + 1); + data.WriteBits(m_text.length(), 14); + data << uint32(m_tabId); + data.WriteString(m_text); if (session) session->SendPacket(&data); @@ -1882,10 +1955,10 @@ void Guild::HandleGuildPartyRequest(WorldSession* session) // Send data to client void Guild::SendEventLog(WorldSession* session) const { - WorldPacket data(MSG_GUILD_EVENT_LOG_QUERY, 1 + m_eventLog->GetSize() * (1 + 8 + 4)); + WorldPacket data(SMSG_GUILD_EVENT_LOG_QUERY_RESULT, 1 + m_eventLog->GetSize() * (1 + 8 + 4)); m_eventLog->WritePacket(data); session->SendPacket(&data); - sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Sent (MSG_GUILD_EVENT_LOG_QUERY)"); + sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Sent (SMSG_GUILD_EVENT_LOG_QUERY_RESULT)"); } void Guild::SendBankLog(WorldSession* session, uint8 tabId) const @@ -1893,12 +1966,15 @@ void Guild::SendBankLog(WorldSession* session, uint8 tabId) const // GUILD_BANK_MAX_TABS send by client for money log if (tabId < _GetPurchasedTabsSize() || tabId == GUILD_BANK_MAX_TABS) { - const LogHolder* pLog = m_bankEventLog[tabId]; - WorldPacket data(MSG_GUILD_BANK_LOG_QUERY, pLog->GetSize() * (4 * 4 + 1) + 1 + 1); - data << uint8(tabId); - pLog->WritePacket(data); + LogHolder const* log = m_bankEventLog[tabId]; + WorldPacket data(SMSG_GUILD_BANK_LOG_QUERY_RESULT, log->GetSize() * (4 * 4 + 1) + 1 + 1); + data.WriteBit(GetLevel() >= 5 && tabId == GUILD_BANK_MAX_TABS); // has Cash Flow perk + log->WritePacket(data); + data << uint32(tabId); + //if (tabId == GUILD_BANK_MAX_TABS && hasCashFlow) + // data << uint64(cashFlowContribution); session->SendPacket(&data); - sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Sent (MSG_GUILD_BANK_LOG_QUERY)"); + sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Sent (SMSG_GUILD_BANK_LOG_QUERY_RESULT) for tab %u", tabId); } } @@ -1989,8 +2065,8 @@ void Guild::SendBankList(WorldSession* session, uint8 tabId, bool withContent, b void Guild::SendBankTabText(WorldSession* session, uint8 tabId) const { - if (const BankTab* pTab = GetBankTab(tabId)) - pTab->SendText(this, session); + if (BankTab const* tab = GetBankTab(tabId)) + tab->SendText(this, session); } void Guild::SendPermissions(WorldSession* session) const @@ -2769,6 +2845,10 @@ void Guild::_LogBankEvent(SQLTransaction& trans, GuildBankEventLogTypes eventTyp if (tabId > GUILD_BANK_MAX_TABS) return; + // not logging moves within the same tab + if (eventType == GUILD_BANK_LOG_MOVE_ITEM && tabId == destTabId) + return; + uint8 dbTabId = tabId; if (BankEventLogEntry::IsMoneyEvent(eventType)) { diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h index 565420052ec..bb94fdbb0f1 100755 --- a/src/server/game/Guilds/Guild.h +++ b/src/server/game/Guilds/Guild.h @@ -184,15 +184,16 @@ enum GuildBankRights enum GuildBankEventLogTypes { - GUILD_BANK_LOG_DEPOSIT_ITEM = 1, - GUILD_BANK_LOG_WITHDRAW_ITEM = 2, - GUILD_BANK_LOG_MOVE_ITEM = 3, - GUILD_BANK_LOG_DEPOSIT_MONEY = 4, - GUILD_BANK_LOG_WITHDRAW_MONEY = 5, - GUILD_BANK_LOG_REPAIR_MONEY = 6, - GUILD_BANK_LOG_MOVE_ITEM2 = 7, - GUILD_BANK_LOG_UNK1 = 8, - GUILD_BANK_LOG_BUY_SLOT = 9, + GUILD_BANK_LOG_DEPOSIT_ITEM = 1, + GUILD_BANK_LOG_WITHDRAW_ITEM = 2, + GUILD_BANK_LOG_MOVE_ITEM = 3, + GUILD_BANK_LOG_DEPOSIT_MONEY = 4, + GUILD_BANK_LOG_WITHDRAW_MONEY = 5, + GUILD_BANK_LOG_REPAIR_MONEY = 6, + GUILD_BANK_LOG_MOVE_ITEM2 = 7, + GUILD_BANK_LOG_UNK1 = 8, + GUILD_BANK_LOG_BUY_SLOT = 9, + GUILD_BANK_LOG_CASH_FLOW_DEPOSIT = 10, }; enum GuildEventLogTypes @@ -357,7 +358,7 @@ private: uint32 GetGUID() const { return m_guid; } virtual void SaveToDB(SQLTransaction& trans) const = 0; - virtual void WritePacket(WorldPacket& data) const = 0; + virtual void WritePacket(WorldPacket& data, ByteBuffer& content) const = 0; protected: uint32 m_guildId; @@ -378,7 +379,7 @@ private: ~EventLogEntry() { } void SaveToDB(SQLTransaction& trans) const; - void WritePacket(WorldPacket& data) const; + void WritePacket(WorldPacket& data, ByteBuffer& content) const; private: GuildEventLogTypes m_eventType; @@ -396,7 +397,13 @@ private: return eventType == GUILD_BANK_LOG_DEPOSIT_MONEY || eventType == GUILD_BANK_LOG_WITHDRAW_MONEY || - eventType == GUILD_BANK_LOG_REPAIR_MONEY; + eventType == GUILD_BANK_LOG_REPAIR_MONEY || + eventType == GUILD_BANK_LOG_CASH_FLOW_DEPOSIT; + } + + bool IsMoneyEvent() const + { + return IsMoneyEvent(m_eventType); } BankEventLogEntry(uint32 guildId, uint32 guid, GuildBankEventLogTypes eventType, uint8 tabId, uint32 playerGuid, uint32 itemOrMoney, uint16 itemStackCount, uint8 destTabId) : @@ -410,7 +417,7 @@ private: ~BankEventLogEntry() { } void SaveToDB(SQLTransaction& trans) const; - void WritePacket(WorldPacket& data) const; + void WritePacket(WorldPacket& data, ByteBuffer& content) const; private: GuildBankEventLogTypes m_eventType; @@ -502,16 +509,16 @@ private: bool LoadItemFromDB(Field* fields); void Delete(SQLTransaction& trans, bool removeItemsFromDB = false); - void SetInfo(const std::string& name, const std::string& icon); - void SetText(const std::string& text); - void SendText(const Guild* guild, WorldSession* session) const; + void SetInfo(std::string const& name, std::string const& icon); + void SetText(std::string const& text); + void SendText(Guild const* guild, WorldSession* session) const; std::string const& GetName() const { return m_name; } std::string const& GetIcon() const { return m_icon; } std::string const& GetText() const { return m_text; } inline Item* GetItem(uint8 slotId) const { return slotId < GUILD_BANK_MAX_SLOTS ? m_items[slotId] : NULL; } - bool SetItem(SQLTransaction& trans, uint8 slotId, Item* pItem); + bool SetItem(SQLTransaction& trans, uint8 slotId, Item* item); private: uint32 m_guildId; diff --git a/src/server/game/Handlers/GuildHandler.cpp b/src/server/game/Handlers/GuildHandler.cpp index 778ecc2659f..b3c2d4ae030 100755 --- a/src/server/game/Handlers/GuildHandler.cpp +++ b/src/server/game/Handlers/GuildHandler.cpp @@ -397,7 +397,7 @@ void WorldSession::HandleSaveGuildEmblemOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildEventLogQueryOpcode(WorldPacket& /* recvPacket */) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (MSG_GUILD_EVENT_LOG_QUERY)"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (CMSG_GUILD_EVENT_LOG_QUERY)"); if (Guild* guild = _GetPlayerGuild(this)) guild->SendEventLog(this); @@ -613,7 +613,7 @@ void WorldSession::HandleGuildBankLogQuery(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (MSG_GUILD_BANK_LOG_QUERY)"); - uint8 tabId; + uint32 tabId; recvData >> tabId; if (Guild* guild = _GetPlayerGuild(this)) @@ -622,7 +622,7 @@ void WorldSession::HandleGuildBankLogQuery(WorldPacket & recvData) void WorldSession::HandleQueryGuildBankTabText(WorldPacket &recvData) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_QUERY_GUILD_BANK_TEXT"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_BANK_QUERY_TEXT"); uint8 tabId; recvData >> tabId; @@ -635,11 +635,11 @@ void WorldSession::HandleSetGuildBankTabText(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_SET_GUILD_BANK_TEXT"); - uint8 tabId; + uint32 tabId; recvData >> tabId; - std::string text; - recvData >> text; + uint32 textLen = recvData.ReadBits(14); + std::string text = recvData.ReadString(textLen); if (Guild* guild = _GetPlayerGuild(this)) guild->SetBankTabText(tabId, text); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 83acbda36d5..320cebe5a89 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -250,11 +250,10 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANKER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankerActivate ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_BUY_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankBuyTab ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_DEPOSIT_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankDepositMoney ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_LOG_QUERY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_LOG_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankLogQuery ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_MONEY_WITHDRAWN_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankMoneyWithdrawn ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_QUERY_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankQueryTab ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_QUERY_TEXT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_SET_TAB_TEXT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_QUERY_TEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryGuildBankTabText ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_SWAP_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankSwapItems ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_UPDATE_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankUpdateTab ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_WITHDRAW_MONEY, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankWithdrawMoney ); @@ -263,7 +262,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_GUILD_DEL_RANK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDelRankOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_DEMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDemoteOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_DISBAND, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDisbandOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_EVENT_LOG_QUERY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_EVENT_LOG_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildEventLogQueryOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_INFO_TEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildChangeInfoTextOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildInviteOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildLeaveOpcode ); @@ -490,6 +489,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_SET_EVERYONE_IS_ASSISTANT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_SET_FACTION_ATWAR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetFactionAtWar ); DEFINE_OPCODE_HANDLER(CMSG_SET_FACTION_INACTIVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetFactionInactiveOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_SET_GUILD_BANK_TEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetGuildBankTabText ); DEFINE_OPCODE_HANDLER(CMSG_SET_PET_SLOT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_SET_PLAYER_DECLINED_NAMES, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetPlayerDeclinedNames ); DEFINE_OPCODE_HANDLER(CMSG_SET_PREFERED_CEMETERY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -850,9 +850,9 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_GUILD_ACHIEVEMENT_EARNED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_ACHIEVEMENT_MEMBERS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_LOG_QUERY_RESULTS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_LOG_QUERY_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_MONEY_WITHDRAWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_QUERY_TEXT_RESULTS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_BANK_QUERY_TEXT_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_CHALLENGE_COMPLETED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_CHALLENGE_UPDATED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_CHANGE_NAME_RESULT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -862,7 +862,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_GUILD_CRITERIA_DELETED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_DECLINE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GUILD_EVENT_LOG_QUERY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_EVENT_LOG_QUERY_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_FLAGGED_FOR_RENAME, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_INVITE_CANCEL, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1507,7 +1507,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_SET_GLYPH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_GLYPH_SLOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_GRANTABLE_LEVELS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_SET_GUILD_BANK_TEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetGuildBankTabText ); //DEFINE_OPCODE_HANDLER(CMSG_SET_LFG_COMMENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetCommentOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_SET_PAID_SERVICE_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_SET_PVP_RANK_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -1562,8 +1561,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(MSG_GM_RESETINSTANCELIMIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_GM_SHOWLABEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_GM_SUMMON, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_GUILD_BANK_LOG_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankLogQuery ); - //DEFINE_OPCODE_HANDLER(MSG_GUILD_EVENT_LOG_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildEventLogQueryOpcode ); //DEFINE_OPCODE_HANDLER(MSG_INSPECT_HONOR_STATS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectHonorStatsOpcode ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_FEATHER_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_GRAVITY_CHNG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -1592,8 +1589,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(MSG_MOVE_WATER_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_NULL_ACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_PVP_LOG_DATA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePVPLogDataOpcode ); - //DEFINE_OPCODE_HANDLER(MSG_QUERY_GUILD_BANK_TEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryGuildBankTabText ); - //DEFINE_OPCODE_HANDLER(MSG_START_MOVE_FORWARD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_VIEW_PHASE_SHIFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_AFK_MONITOR_INFO_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_AURACASTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 07cfdf39bb1..342a9974ec0 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -247,7 +247,6 @@ enum Opcodes CMSG_GUILD_BANK_NOTE = 0x0000, CMSG_GUILD_BANK_QUERY_TAB = 0x2E35, CMSG_GUILD_BANK_QUERY_TEXT = 0x3220, - CMSG_GUILD_BANK_SET_TAB_TEXT = 0x3023, CMSG_GUILD_BANK_SWAP_ITEMS = 0x2315, CMSG_GUILD_BANK_UPDATE_TAB = 0x0106, CMSG_GUILD_BANK_WITHDRAW_MONEY = 0x0037, @@ -509,7 +508,7 @@ enum Opcodes CMSG_SET_FACTION_ATWAR = 0x0706, CMSG_SET_FACTION_CHEAT = 0x0000, CMSG_SET_FACTION_INACTIVE = 0x0E37, - CMSG_SET_GUILD_BANK_TEXT = 0x0000, + CMSG_SET_GUILD_BANK_TEXT = 0x3023, CMSG_SET_LFG_COMMENT = 0x0000, CMSG_SET_PET_SLOT = 0x3A04, CMSG_SET_PLAYER_DECLINED_NAMES = 0x6316, @@ -596,8 +595,6 @@ enum Opcodes MSG_GM_BIND_OTHER = 0x0000, MSG_GM_SHOWLABEL = 0x0000, MSG_GM_SUMMON = 0x0000, - MSG_GUILD_BANK_LOG_QUERY = 0x0000, - MSG_GUILD_EVENT_LOG_QUERY = 0x0000, MSG_INSPECT_ARENA_TEAMS = 0x2704, MSG_LIST_STABLED_PETS = 0x0834, MSG_MINIMAP_PING = 0x6635, @@ -658,7 +655,6 @@ enum Opcodes MSG_PETITION_DECLINE = 0x4905, MSG_PETITION_RENAME = 0x4005, MSG_PVP_LOG_DATA = 0x0000, - MSG_QUERY_GUILD_BANK_TEXT = 0x0000, MSG_QUERY_NEXT_MAIL_TIME = 0x0F04, MSG_QUEST_PUSH_RESULT = 0x4515, MSG_RAID_READY_CHECK = 0x2304, @@ -922,9 +918,9 @@ enum Opcodes SMSG_GUILD_ACHIEVEMENT_EARNED = 0x50B5, SMSG_GUILD_ACHIEVEMENT_MEMBERS = 0x38A5, SMSG_GUILD_BANK_LIST = 0x78A5, - SMSG_GUILD_BANK_LOG_QUERY_RESULTS = 0x30B2, + SMSG_GUILD_BANK_LOG_QUERY_RESULT = 0x30B2, SMSG_GUILD_BANK_MONEY_WITHDRAWN = 0x5DB4, - SMSG_GUILD_BANK_QUERY_TEXT_RESULTS = 0x75A3, + SMSG_GUILD_BANK_QUERY_TEXT_RESULT = 0x75A3, SMSG_GUILD_CANCEL = 0x0000, SMSG_GUILD_CHALLENGE_COMPLETED = 0x39A3, SMSG_GUILD_CHALLENGE_UPDATED = 0x18B1, @@ -935,7 +931,7 @@ enum Opcodes SMSG_GUILD_CRITERIA_DELETED = 0x55B1, SMSG_GUILD_DECLINE = 0x2C07, SMSG_GUILD_EVENT = 0x0705, - SMSG_GUILD_EVENT_LOG_QUERY = 0x10B2, + SMSG_GUILD_EVENT_LOG_QUERY_RESULT = 0x10B2, SMSG_GUILD_FLAGGED_FOR_RENAME = 0x30B6, SMSG_GUILD_INVITE = 0x14A2, SMSG_GUILD_INVITE_CANCEL = 0x0606, -- cgit v1.2.3 From b7fa5cb566d7a90d749e783c8deb3e1052130124 Mon Sep 17 00:00:00 2001 From: Gigatotem Date: Tue, 28 Aug 2012 00:03:37 +0200 Subject: Spells/Shaman: Heroism and Bloodlust Heroism and Bloodlust will now check for Temporal Displacement from Time Warp and Insanity from Ancient Hysteria. --- src/server/scripts/Spells/spell_shaman.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index c863c2363af..1c6e6e11f04 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -35,6 +35,8 @@ enum ShamanSpells SHAMAN_SPELL_FIRE_NOVA_TRIGGERED_R1 = 8349, SHAMAN_SPELL_SATED = 57724, SHAMAN_SPELL_EXHAUSTION = 57723, + HUNTER_SPELL_INSANITY = 95809, + MAGE_SPELL_TEMPORAL_DISPLACEMENT = 80354, SHAMAN_SPELL_STORM_EARTH_AND_FIRE = 51483, EARTHBIND_TOTEM_SPELL_EARTHGRAB = 64695, @@ -319,6 +321,8 @@ class spell_sha_bloodlust : public SpellScriptLoader void RemoveInvalidTargets(std::list& targets) { targets.remove_if(Trinity::UnitAuraCheck(true, SHAMAN_SPELL_SATED)); + targets.remove_if(Trinity::UnitAuraCheck(true, HUNTER_SPELL_INSANITY)); + targets.remove_if(Trinity::UnitAuraCheck(true, MAGE_SPELL_TEMPORAL_DISPLACEMENT)); } void ApplyDebuff() @@ -361,6 +365,8 @@ class spell_sha_heroism : public SpellScriptLoader void RemoveInvalidTargets(std::list& targets) { targets.remove_if(Trinity::UnitAuraCheck(true, SHAMAN_SPELL_EXHAUSTION)); + targets.remove_if(Trinity::UnitAuraCheck(true, HUNTER_SPELL_INSANITY)); + targets.remove_if(Trinity::UnitAuraCheck(true, MAGE_SPELL_TEMPORAL_DISPLACEMENT)); } void ApplyDebuff() -- cgit v1.2.3 From 449e577b70dab742942eeae2da88973d36048e8b Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 28 Aug 2012 14:12:17 +0100 Subject: Core/Authserver: Fix previous merge --- src/server/authserver/Authentication/AuthCodes.cpp | 56 +++++++++++++-- src/server/authserver/Authentication/AuthCodes.h | 18 ++++- src/server/authserver/Server/AuthSocket.cpp | 81 ++++++++++++++++------ src/server/authserver/Server/AuthSocket.h | 1 + 4 files changed, 128 insertions(+), 28 deletions(-) (limited to 'src') diff --git a/src/server/authserver/Authentication/AuthCodes.cpp b/src/server/authserver/Authentication/AuthCodes.cpp index 7a97cbee3de..bdb96ca0d25 100644 --- a/src/server/authserver/Authentication/AuthCodes.cpp +++ b/src/server/authserver/Authentication/AuthCodes.cpp @@ -16,17 +16,65 @@ */ #include "AuthCodes.h" +#include namespace AuthHelper { - bool IsAcceptedClientBuild(int build) + static RealmBuildInfo const PostBcAcceptedClientBuilds[] = + { + {15595, 4, 3, 4, ' '}, + {14545, 4, 2, 2, ' '}, + {13623, 4, 0, 6, 'a'}, + {12340, 3, 3, 5, 'a'}, + {11723, 3, 3, 3, 'a'}, + {11403, 3, 3, 2, ' '}, + {11159, 3, 3, 0, 'a'}, + {10505, 3, 2, 2, 'a'}, + {9947, 3, 1, 3, ' '}, + {8606, 2, 4, 3, ' '}, + {0, 0, 0, 0, ' '} // terminator + }; + + static RealmBuildInfo const PreBcAcceptedClientBuilds[] = + { + {6005, 1, 12, 2, ' '}, + {5875, 1, 12, 1, ' '}, + {0, 0, 0, 0, ' '} // terminator + }; + + bool IsPreBCAcceptedClientBuild(int build) { - static int accepted_versions[] = TRINITYCORE_ACCEPTED_CLIENT_BUILD; + for (int i = 0; PreBcAcceptedClientBuilds[i].Build; ++i) + if (PreBcAcceptedClientBuilds[i].Build == build) + return true; - for (int i = 0; accepted_versions[i]; ++i) - if (build == accepted_versions[i]) + return false; + } + + bool IsPostBCAcceptedClientBuild(int build) + { + for (int i = 0; PostBcAcceptedClientBuilds[i].Build; ++i) + if (PostBcAcceptedClientBuilds[i].Build == build) return true; return false; } + + bool IsAcceptedClientBuild(int build) + { + return (IsPostBCAcceptedClientBuild(build) || IsPreBCAcceptedClientBuild(build)); + } + + RealmBuildInfo const* GetBuildInfo(int build) + { + for (int i = 0; PostBcAcceptedClientBuilds[i].Build; ++i) + if (PostBcAcceptedClientBuilds[i].Build == build) + return &PostBcAcceptedClientBuilds[i]; + + for (int i = 0; PreBcAcceptedClientBuilds[i].Build; ++i) + if (PreBcAcceptedClientBuilds[i].Build == build) + return &PreBcAcceptedClientBuilds[i]; + + return NULL; + } }; diff --git a/src/server/authserver/Authentication/AuthCodes.h b/src/server/authserver/Authentication/AuthCodes.h index 9d631a5800d..148225377ff 100755 --- a/src/server/authserver/Authentication/AuthCodes.h +++ b/src/server/authserver/Authentication/AuthCodes.h @@ -65,12 +65,28 @@ enum LoginResult LOGIN_LOCKED_ENFORCED = 0x10, }; -#define TRINITYCORE_ACCEPTED_CLIENT_BUILD {15595, 12340, 0} // accept one Cataclysm and one Wrath of the Lich King build +enum ExpansionFlags +{ + POST_BC_EXP_FLAG = 0x2, + PRE_BC_EXP_FLAG = 0x1, + NO_VALID_EXP_FLAG = 0x0 +}; +struct RealmBuildInfo +{ + int Build; + int MajorVersion; + int MinorVersion; + int BugfixVersion; + int HotfixVersion; +}; namespace AuthHelper { + RealmBuildInfo const* GetBuildInfo(int build); bool IsAcceptedClientBuild(int build); + bool IsPostBCAcceptedClientBuild(int build); + bool IsPreBCAcceptedClientBuild(int build); }; #endif diff --git a/src/server/authserver/Server/AuthSocket.cpp b/src/server/authserver/Server/AuthSocket.cpp index 793f310f8c1..2ad80c7f62d 100644 --- a/src/server/authserver/Server/AuthSocket.cpp +++ b/src/server/authserver/Server/AuthSocket.cpp @@ -389,7 +389,7 @@ bool AuthSocket::_HandleLogonChallenge() if (strcmp(fields[3].GetCString(), ip_address.c_str())) { sLog->outDebug(LOG_FILTER_AUTHSERVER, "[AuthChallenge] Account IP differs"); - pkt << uint8(WOW_FAIL_SUSPENDED); + pkt << (uint8) WOW_FAIL_SUSPENDED; locked = true; } else @@ -450,10 +450,7 @@ bool AuthSocket::_HandleLogonChallenge() unk3.SetRand(16 * 8); // Fill the response packet with the result - // If the client has no valid version - if (!AuthHelper::IsAcceptedClientBuild(_build)) - pkt << uint8(WOW_FAIL_VERSION_INVALID); - else + if (AuthHelper::IsAcceptedClientBuild(_build)) pkt << uint8(WOW_SUCCESS); else pkt << uint8(WOW_FAIL_VERSION_INVALID); @@ -501,7 +498,7 @@ bool AuthSocket::_HandleLogonChallenge() } } else //no account - pkt << uint8(WOW_FAIL_UNKNOWN_ACCOUNT); + pkt << (uint8)WOW_FAIL_UNKNOWN_ACCOUNT; } socket().send((char const*)pkt.contents(), pkt.size()); @@ -518,6 +515,15 @@ bool AuthSocket::_HandleLogonProof() if (!socket().recv((char *)&lp, sizeof(sAuthLogonProof_C))) return false; + // If the client has no valid version + if (_expversion == NO_VALID_EXP_FLAG) + { + // Check if we have the appropriate patch on the disk + sLog->outDebug(LOG_FILTER_NETWORKIO, "Client with invalid version, patching is not implemented"); + socket().shutdown(); + return true; + } + // Continue the SRP6 calculation based on data received from the client BigNumber A; @@ -618,14 +624,26 @@ bool AuthSocket::_HandleLogonProof() sha.UpdateBigNumbers(&A, &M, &K, NULL); sha.Finalize(); - sAuthLogonProof_S proof; - memcpy(proof.M2, sha.GetDigest(), 20); - proof.cmd = AUTH_LOGON_PROOF; - proof.error = 0; - proof.unk1 = 0x00800000; // Accountflags. 0x01 = GM, 0x08 = Trial, 0x00800000 = Pro pass (arena tournament) - proof.unk2 = 0x00; // SurveyId - proof.unk3 = 0x00; - socket().send((char *)&proof, sizeof(proof)); + if (_expversion & POST_BC_EXP_FLAG) // 2.x and 3.x clients + { + sAuthLogonProof_S proof; + memcpy(proof.M2, sha.GetDigest(), 20); + proof.cmd = AUTH_LOGON_PROOF; + proof.error = 0; + proof.unk1 = 0x00800000; // Accountflags. 0x01 = GM, 0x08 = Trial, 0x00800000 = Pro pass (arena tournament) + proof.unk2 = 0x00; // SurveyId + proof.unk3 = 0x00; + socket().send((char *)&proof, sizeof(proof)); + } + else + { + sAuthLogonProof_S_Old proof; + memcpy(proof.M2, sha.GetDigest(), 20); + proof.cmd = AUTH_LOGON_PROOF; + proof.error = 0; + proof.unk2 = 0x00; + socket().send((char *)&proof, sizeof(proof)); + } _authed = true; } @@ -734,6 +752,7 @@ bool AuthSocket::_HandleReconnectChallenge() // Reinitialize build, expansion and the account securitylevel _build = ch->build; + _expversion = uint8(AuthHelper::IsPostBCAcceptedClientBuild(_build) ? POST_BC_EXP_FLAG : (AuthHelper::IsPreBCAcceptedClientBuild(_build) ? PRE_BC_EXP_FLAG : NO_VALID_EXP_FLAG)); _os = (const char*)ch->os; if (_os.size() > 4) @@ -833,13 +852,15 @@ bool AuthSocket::_HandleRealmList() for (RealmList::RealmMap::const_iterator i = sRealmList->begin(); i != sRealmList->end(); ++i) { // don't work with realms which not compatible with the client - if (i->second.gamebuild != _build) + bool okBuild = ((_expversion & POST_BC_EXP_FLAG) && i->second.gamebuild == _build) || ((_expversion & PRE_BC_EXP_FLAG) && !AuthHelper::IsPreBCAcceptedClientBuild(i->second.gamebuild)); + + // No SQL injection. id of realm is controlled by the database. uint32 flag = i->second.flag; RealmBuildInfo const* buildInfo = AuthHelper::GetBuildInfo(i->second.gamebuild); if (!okBuild) { if (!buildInfo) - continue; + continue; flag |= REALM_FLAG_OFFLINE | REALM_FLAG_SPECIFYBUILD; // tell the client what build the realm is for } @@ -866,14 +887,18 @@ bool AuthSocket::_HandleRealmList() AmountOfCharacters = (*result)[0].GetUInt8(); pkt << i->second.icon; // realm type - pkt << lock; // if 1, then realm locked + if (_expversion & POST_BC_EXP_FLAG) // only 2.x and 3.x clients + pkt << lock; // if 1, then realm locked pkt << uint8(flag); // RealmFlags pkt << name; pkt << i->second.address; pkt << i->second.populationLevel; pkt << AmountOfCharacters; pkt << i->second.timezone; // realm category - pkt << uint8(0x2C); // unk, may be realm number/id? + if (_expversion & POST_BC_EXP_FLAG) // 2.x and 3.x clients + pkt << uint8(0x2C); // unk, may be realm number/id? + else + pkt << uint8(0x0); // 1.12.1 and 1.12.2 clients if (_expversion & POST_BC_EXP_FLAG && flag & REALM_FLAG_SPECIFYBUILD) { @@ -886,18 +911,28 @@ bool AuthSocket::_HandleRealmList() ++RealmListSize; } - pkt << uint8(0x10); - pkt << uint8(0x00); - + if (_expversion & POST_BC_EXP_FLAG) // 2.x and 3.x clients + { + pkt << uint8(0x10); + pkt << uint8(0x00); + } + else // 1.12.1 and 1.12.2 clients + { + pkt << uint8(0x00); + pkt << uint8(0x02); + } // make a ByteBuffer which stores the RealmList's size ByteBuffer RealmListSizeBuffer; RealmListSizeBuffer << uint32(0); - RealmListSizeBuffer << uint16(RealmListSize); + if (_expversion & POST_BC_EXP_FLAG) // only 2.x and 3.x clients + RealmListSizeBuffer << uint16(RealmListSize); + else + RealmListSizeBuffer << uint32(RealmListSize); ByteBuffer hdr; hdr << uint8(REALM_LIST); - hdr << uint16((pkt.size() + RealmListSizeBuffer.size())); + hdr << uint16(pkt.size() + RealmListSizeBuffer.size()); hdr.append(RealmListSizeBuffer); // append RealmList's size buffer hdr.append(pkt); // append realms in the realmlist diff --git a/src/server/authserver/Server/AuthSocket.h b/src/server/authserver/Server/AuthSocket.h index edd2b345183..9be2136b55c 100755 --- a/src/server/authserver/Server/AuthSocket.h +++ b/src/server/authserver/Server/AuthSocket.h @@ -70,6 +70,7 @@ private: std::string _localizationName; std::string _os; uint16 _build; + uint8 _expversion; AccountTypes _accountSecurityLevel; }; -- cgit v1.2.3 From 49532cd220df08affcbc7faff0b538ca2837144d Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 28 Aug 2012 21:02:48 +0100 Subject: Core/Groups: Fix some failures when building stats Thanks Zakamurite and Kaelima --- src/server/game/Handlers/GroupHandler.cpp | 34 ++++++++++++++++++------------- 1 file changed, 20 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp index 3296b17ad78..9287045bfb1 100644 --- a/src/server/game/Handlers/GroupHandler.cpp +++ b/src/server/game/Handlers/GroupHandler.cpp @@ -988,7 +988,11 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player* player, WorldPacke { AuraApplication const* aurApp = player->GetVisibleAura(i); if (!aurApp) - continue; // mhmm... + { + *data << uint32(0); + *data << uint16(0); + continue; + } *data << uint32(aurApp->GetBase()->GetId()); *data << uint16(aurApp->GetFlags()); @@ -1092,7 +1096,11 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player* player, WorldPacke { AuraApplication const* aurApp = pet->GetVisibleAura(i); if (!aurApp) - continue; // mhmm... + { + *data << uint32(0); + *data << uint16(0); + continue; + } *data << uint32(aurApp->GetBase()->GetId()); *data << uint16(aurApp->GetFlags()); @@ -1170,18 +1178,17 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket& recvData) data << (uint16) player->GetPositionY(); // GROUP_UPDATE_FLAG_POSITION data << (uint16) player->GetPositionZ(); // GROUP_UPDATE_FLAG_POSITION - uint64 auramask = 0; - size_t maskPos = data.wpos(); + // GROUP_UPDATE_FLAG_AURAS data << (uint8) 1; + uint64 auramask = 0; data << (uint64) auramask; // placeholder + size_t maskPos = data.wpos(); data << (uint32) MAX_AURAS; // count for (uint8 i = 0; i < MAX_AURAS; ++i) { - if (auramask & (uint64(1) << i)) + if (AuraApplication const* aurApp = player->GetVisibleAura(i)) { - AuraApplication const* aurApp = player->GetVisibleAura(i); - if (!aurApp) - continue; // mhmm... + auramask |= (uint64(1) << i); data << uint32(aurApp->GetBase()->GetId()); data << uint16(aurApp->GetFlags()); @@ -1212,18 +1219,17 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket& recvData) data << (uint16) pet->GetPower(petpowertype); // GROUP_UPDATE_FLAG_PET_CUR_POWER data << (uint16) pet->GetMaxPower(petpowertype); // GROUP_UPDATE_FLAG_PET_MAX_POWER - uint64 petauramask = 0; - size_t petMaskPos = data.wpos(); + // GROUP_UPDATE_FLAG_PET_AURAS data << (uint8) 1; + uint64 petauramask = 0; data << (uint64) petauramask; // placeholder + size_t petMaskPos = data.wpos(); data << (uint32) MAX_AURAS; // count for (uint8 i = 0; i < MAX_AURAS; ++i) { - if (auramask & (uint64(1) << i)) + if (AuraApplication const* aurApp = pet->GetVisibleAura(i);) { - AuraApplication const* aurApp = pet->GetVisibleAura(i); - if (!aurApp) - continue; // mhmm... + petauramask |= (uint64(1) << i); data << uint32(aurApp->GetBase()->GetId()); data << uint16(aurApp->GetFlags()); -- cgit v1.2.3 From 568e7eb3ea1ec387b62d504349ee1f14ee06fbb4 Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 28 Aug 2012 21:21:05 +0100 Subject: Core/Groups: Simplify some GroupUpdateFlags handling and fix a typo --- src/server/game/Groups/Group.h | 4 ++-- src/server/game/Handlers/GroupHandler.cpp | 14 +++++--------- 2 files changed, 7 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/server/game/Groups/Group.h b/src/server/game/Groups/Group.h index b32b6b9b77f..c24b3f3deae 100755 --- a/src/server/game/Groups/Group.h +++ b/src/server/game/Groups/Group.h @@ -124,8 +124,8 @@ enum GroupUpdateFlags GROUP_UPDATE_FLAG_PET_CUR_POWER | GROUP_UPDATE_FLAG_PET_MAX_POWER | GROUP_UPDATE_FLAG_PET_AURAS, // all pet flags GROUP_UPDATE_FULL = GROUP_UPDATE_FLAG_STATUS | GROUP_UPDATE_FLAG_CUR_HP | GROUP_UPDATE_FLAG_MAX_HP | GROUP_UPDATE_FLAG_POWER_TYPE | GROUP_UPDATE_FLAG_CUR_POWER | GROUP_UPDATE_FLAG_MAX_POWER | - GROUP_UPDATE_FLAG_LEVEL | GROUP_UPDATE_FLAG_ZONE | /* unk100 */ GROUP_UPDATE_FLAG_POSITION | - GROUP_UPDATE_FLAG_AURAS | GROUP_UPDATE_PET | GROUP_UPDATE_FLAG_VEHICLE_SEAT | GROUP_UPDATE_FLAG_PHASE, // all known flags + GROUP_UPDATE_FLAG_LEVEL | GROUP_UPDATE_FLAG_ZONE | GROUP_UPDATE_FLAG_POSITION | + GROUP_UPDATE_FLAG_AURAS | GROUP_UPDATE_PET | GROUP_UPDATE_FLAG_PHASE, // all known flags, except UNK100 and VEHICLE_SEAT }; class Roll : public LootValidatorRef diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp index 9287045bfb1..b2ac00b0461 100644 --- a/src/server/game/Handlers/GroupHandler.cpp +++ b/src/server/game/Handlers/GroupHandler.cpp @@ -1155,18 +1155,14 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket& recvData) data << uint8(0); // only for SMSG_PARTY_MEMBER_STATS_FULL, probably arena/bg related data.append(player->GetPackGUID()); - uint32 mask1 = GROUP_UPDATE_FLAG_STATUS | GROUP_UPDATE_FLAG_CUR_HP | GROUP_UPDATE_FLAG_MAX_HP | - GROUP_UPDATE_FLAG_POWER_TYPE | GROUP_UPDATE_FLAG_CUR_POWER | GROUP_UPDATE_FLAG_MAX_POWER | - GROUP_UPDATE_FLAG_LEVEL | GROUP_UPDATE_FLAG_ZONE | GROUP_UPDATE_FLAG_POSITION | - GROUP_UPDATE_FLAG_AURAS | GROUP_UPDATE_FLAG_PET_NAME | GROUP_UPDATE_FLAG_PET_AURAS | - GROUP_UPDATE_FLAG_PHASE; + uint32 mask1 = GROUP_UPDATE_FULL; - if (pet) - mask1 = 0x7FEFFEFF; // full mask & ~(GROUP_UPDATE_FLAG_VEHICLE_SEAT | GROUP_UPDATE_FLAG_UNK) (for hunters and other classes with pets) + if (!pet) + mask1 &= ~GROUP_UPDATE_PET; Powers powerType = player->getPowerType(); data << (uint32) mask1; // group update mask - data << (uint16) MEMBER_STATUS_ONLINE; // member's online status + data << (uint16) MEMBER_STATUS_ONLINE; // member's online status, GROUP_UPDATE_FLAG_STATUS data << (uint32) player->GetHealth(); // GROUP_UPDATE_FLAG_CUR_HP data << (uint32) player->GetMaxHealth(); // GROUP_UPDATE_FLAG_MAX_HP data << (uint8) powerType; // GROUP_UPDATE_FLAG_POWER_TYPE @@ -1227,7 +1223,7 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket& recvData) data << (uint32) MAX_AURAS; // count for (uint8 i = 0; i < MAX_AURAS; ++i) { - if (AuraApplication const* aurApp = pet->GetVisibleAura(i);) + if (AuraApplication const* aurApp = pet->GetVisibleAura(i)) { petauramask |= (uint64(1) << i); -- cgit v1.2.3 From f50811f3a9b9d7e4a6beefc9912bca2acee395fd Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 28 Aug 2012 21:42:49 +0100 Subject: Core/Group: Code style corrections and logic fixes --- src/server/game/Handlers/GroupHandler.cpp | 143 ++++++++++++++---------------- 1 file changed, 69 insertions(+), 74 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp index b2ac00b0461..a624c4ef2bd 100644 --- a/src/server/game/Handlers/GroupHandler.cpp +++ b/src/server/game/Handlers/GroupHandler.cpp @@ -931,50 +931,50 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player* player, WorldPacke if (mask & GROUP_UPDATE_FLAG_PET_POWER_TYPE) // same for pets mask |= (GROUP_UPDATE_FLAG_PET_CUR_POWER | GROUP_UPDATE_FLAG_PET_MAX_POWER); - data->Initialize(SMSG_PARTY_MEMBER_STATS, 80); // average value + data->Initialize(SMSG_PARTY_MEMBER_STATS, 80); // average value data->append(player->GetPackGUID()); - *data << (uint32) mask; + *data << uint32(mask); if (mask & GROUP_UPDATE_FLAG_STATUS) { if (player) { if (player->IsPvP()) - *data << (uint16) (MEMBER_STATUS_ONLINE | MEMBER_STATUS_PVP); + *data << uint16(MEMBER_STATUS_ONLINE | MEMBER_STATUS_PVP); else - *data << (uint16) MEMBER_STATUS_ONLINE; + *data << uint16(MEMBER_STATUS_ONLINE); } else - *data << (uint16) MEMBER_STATUS_OFFLINE; + *data << uint16(MEMBER_STATUS_OFFLINE); } if (mask & GROUP_UPDATE_FLAG_CUR_HP) - *data << (uint32) player->GetHealth(); + *data << uint32(player->GetHealth()); if (mask & GROUP_UPDATE_FLAG_MAX_HP) - *data << (uint32) player->GetMaxHealth(); + *data << uint32(player->GetMaxHealth()); Powers powerType = player->getPowerType(); if (mask & GROUP_UPDATE_FLAG_POWER_TYPE) - *data << (uint8) powerType; + *data << uint8(powerType); if (mask & GROUP_UPDATE_FLAG_CUR_POWER) - *data << (uint16) player->GetPower(powerType); + *data << uint16(player->GetPower(powerType)); if (mask & GROUP_UPDATE_FLAG_MAX_POWER) - *data << (uint16) player->GetMaxPower(powerType); + *data << uint16(player->GetMaxPower(powerType)); if (mask & GROUP_UPDATE_FLAG_LEVEL) - *data << (uint16) player->getLevel(); + *data << uint16(player->getLevel()); if (mask & GROUP_UPDATE_FLAG_ZONE) - *data << (uint16) player->GetZoneId(); + *data << uint16(player->GetZoneId()); if (mask & GROUP_UPDATE_FLAG_UNK100) *data << uint16(0); if (mask & GROUP_UPDATE_FLAG_POSITION) - *data << (uint16) player->GetPositionX() << (uint16) player->GetPositionY() << (uint16) player->GetPositionZ(); + *data << uint16(player->GetPositionX()) << uint16(player->GetPositionY()) << uint16(player->GetPositionZ()); if (mask & GROUP_UPDATE_FLAG_AURAS) { @@ -1015,9 +1015,9 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player* player, WorldPacke if (mask & GROUP_UPDATE_FLAG_PET_GUID) { if (pet) - *data << (uint64) pet->GetGUID(); + *data << uint64(pet->GetGUID()); else - *data << (uint64) 0; + *data << uint64(0); } if (mask & GROUP_UPDATE_FLAG_PET_NAME) @@ -1025,61 +1025,63 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player* player, WorldPacke if (pet) *data << pet->GetName(); else - *data << (uint8) 0; + *data << uint8(0); } if (mask & GROUP_UPDATE_FLAG_PET_MODEL_ID) { if (pet) - *data << (uint16) pet->GetDisplayId(); + *data << uint16(pet->GetDisplayId()); else - *data << (uint16) 0; + *data << uint16(0); } if (mask & GROUP_UPDATE_FLAG_PET_CUR_HP) { if (pet) - *data << (uint32) pet->GetHealth(); + *data << uint32(pet->GetHealth()); else - *data << (uint32) 0; + *data << uint32(0); } if (mask & GROUP_UPDATE_FLAG_PET_MAX_HP) { if (pet) - *data << (uint32) pet->GetMaxHealth(); + *data << uint32(pet->GetMaxHealth()); else - *data << (uint32) 0; + *data << uint32(0); } if (mask & GROUP_UPDATE_FLAG_PET_POWER_TYPE) { if (pet) - *data << (uint8) pet->getPowerType(); + *data << uint8(pet->getPowerType()); else - *data << (uint8) 0; + *data << uint8(0); } if (mask & GROUP_UPDATE_FLAG_PET_CUR_POWER) { if (pet) - *data << (uint16) pet->GetPower(pet->getPowerType()); + *data << uint16(pet->GetPower(pet->getPowerType())); else - *data << (uint16) 0; + *data << uint16(0); } if (mask & GROUP_UPDATE_FLAG_PET_MAX_POWER) { if (pet) - *data << (uint16) pet->GetMaxPower(pet->getPowerType()); + *data << uint16(pet->GetMaxPower(pet->getPowerType())); else - *data << (uint16) 0; + *data << uint16(0); } if (mask & GROUP_UPDATE_FLAG_VEHICLE_SEAT) { if (Vehicle* veh = player->GetVehicle()) - *data << (uint32) veh->GetVehicleInfo()->m_seatID[player->m_movementInfo.t_seat]; + *data << uint32(veh->GetVehicleInfo()->m_seatID[player->m_movementInfo.t_seat]); + else + *data << uint32(0); } if (mask & GROUP_UPDATE_FLAG_PET_AURAS) @@ -1119,7 +1121,10 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player* player, WorldPacke } } else - *data << (uint64) 0; + { + *data << uint8(0); + *data << uint64(0); + } } if (mask & GROUP_UPDATE_FLAG_PHASE) @@ -1134,15 +1139,15 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player* player, WorldPacke void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_REQUEST_PARTY_MEMBER_STATS"); - uint64 Guid; - recvData >> Guid; + uint64 guid; + recvData >> guid; - Player* player = HashMapHolder::Find(Guid); + Player* player = HashMapHolder::Find(guid); if (!player) { WorldPacket data(SMSG_PARTY_MEMBER_STATS_FULL, 3+4+2); data << uint8(0); // only for SMSG_PARTY_MEMBER_STATS_FULL, probably arena/bg related - data.appendPackGUID(Guid); + data.appendPackGUID(guid); data << (uint32) GROUP_UPDATE_FLAG_STATUS; data << (uint16) MEMBER_STATUS_OFFLINE; SendPacket(&data); @@ -1161,25 +1166,25 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket& recvData) mask1 &= ~GROUP_UPDATE_PET; Powers powerType = player->getPowerType(); - data << (uint32) mask1; // group update mask - data << (uint16) MEMBER_STATUS_ONLINE; // member's online status, GROUP_UPDATE_FLAG_STATUS - data << (uint32) player->GetHealth(); // GROUP_UPDATE_FLAG_CUR_HP - data << (uint32) player->GetMaxHealth(); // GROUP_UPDATE_FLAG_MAX_HP - data << (uint8) powerType; // GROUP_UPDATE_FLAG_POWER_TYPE - data << (uint16) player->GetPower(powerType); // GROUP_UPDATE_FLAG_CUR_POWER - data << (uint16) player->GetMaxPower(powerType); // GROUP_UPDATE_FLAG_MAX_POWER - data << (uint16) player->getLevel(); // GROUP_UPDATE_FLAG_LEVEL - data << (uint16) player->GetZoneId(); // GROUP_UPDATE_FLAG_ZONE - data << (uint16) player->GetPositionX(); // GROUP_UPDATE_FLAG_POSITION - data << (uint16) player->GetPositionY(); // GROUP_UPDATE_FLAG_POSITION - data << (uint16) player->GetPositionZ(); // GROUP_UPDATE_FLAG_POSITION + data << uint32(mask1); // group update mask + data << uint16(MEMBER_STATUS_ONLINE); // member's online status, GROUP_UPDATE_FLAG_STATUS + data << uint32(player->GetHealth()); // GROUP_UPDATE_FLAG_CUR_HP + data << uint32(player->GetMaxHealth()); // GROUP_UPDATE_FLAG_MAX_HP + data << uint8 (powerType); // GROUP_UPDATE_FLAG_POWER_TYPE + data << uint16(player->GetPower(powerType)); // GROUP_UPDATE_FLAG_CUR_POWER + data << uint16(player->GetMaxPower(powerType)); // GROUP_UPDATE_FLAG_MAX_POWER + data << uint16(player->getLevel()); // GROUP_UPDATE_FLAG_LEVEL + data << uint16(player->GetZoneId()); // GROUP_UPDATE_FLAG_ZONE + data << uint16(player->GetPositionX()); // GROUP_UPDATE_FLAG_POSITION + data << uint16(player->GetPositionY()); // GROUP_UPDATE_FLAG_POSITION + data << uint16(player->GetPositionZ()); // GROUP_UPDATE_FLAG_POSITION // GROUP_UPDATE_FLAG_AURAS - data << (uint8) 1; + data << uint8(1); uint64 auramask = 0; - data << (uint64) auramask; // placeholder + data << uint64(auramask); // placeholder size_t maskPos = data.wpos(); - data << (uint32) MAX_AURAS; // count + data << uint32(MAX_AURAS); // count for (uint8 i = 0; i < MAX_AURAS; ++i) { if (AuraApplication const* aurApp = player->GetVisibleAura(i)) @@ -1201,26 +1206,26 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket& recvData) } } } - data.put(maskPos, auramask); // GROUP_UPDATE_FLAG_AURAS + data.put(maskPos, auramask); // GROUP_UPDATE_FLAG_AURAS if (pet) { Powers petpowertype = pet->getPowerType(); - data << (uint64) pet->GetGUID(); // GROUP_UPDATE_FLAG_PET_GUID + data << uint64(pet->GetGUID()); // GROUP_UPDATE_FLAG_PET_GUID data << pet->GetName(); // GROUP_UPDATE_FLAG_PET_NAME - data << (uint16) pet->GetDisplayId(); // GROUP_UPDATE_FLAG_PET_MODEL_ID - data << (uint32) pet->GetHealth(); // GROUP_UPDATE_FLAG_PET_CUR_HP - data << (uint32) pet->GetMaxHealth(); // GROUP_UPDATE_FLAG_PET_MAX_HP - data << (uint8) petpowertype; // GROUP_UPDATE_FLAG_PET_POWER_TYPE - data << (uint16) pet->GetPower(petpowertype); // GROUP_UPDATE_FLAG_PET_CUR_POWER - data << (uint16) pet->GetMaxPower(petpowertype); // GROUP_UPDATE_FLAG_PET_MAX_POWER + data << uint16(pet->GetDisplayId()); // GROUP_UPDATE_FLAG_PET_MODEL_ID + data << uint32(pet->GetHealth()); // GROUP_UPDATE_FLAG_PET_CUR_HP + data << uint32(pet->GetMaxHealth()); // GROUP_UPDATE_FLAG_PET_MAX_HP + data << uint8 (petpowertype); // GROUP_UPDATE_FLAG_PET_POWER_TYPE + data << uint16(pet->GetPower(petpowertype)); // GROUP_UPDATE_FLAG_PET_CUR_POWER + data << uint16(pet->GetMaxPower(petpowertype)); // GROUP_UPDATE_FLAG_PET_MAX_POWER // GROUP_UPDATE_FLAG_PET_AURAS - data << (uint8) 1; + data << uint8(1); uint64 petauramask = 0; - data << (uint64) petauramask; // placeholder + data << uint64(petauramask); // placeholder size_t petMaskPos = data.wpos(); - data << (uint32) MAX_AURAS; // count + data << uint32(MAX_AURAS); // count for (uint8 i = 0; i < MAX_AURAS; ++i) { if (AuraApplication const* aurApp = pet->GetVisibleAura(i)) @@ -1242,15 +1247,10 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket& recvData) } } } + data.put(petMaskPos, petauramask); // GROUP_UPDATE_FLAG_PET_AURAS } - else - { - data << (uint8) 0; // GROUP_UPDATE_FLAG_PET_NAME - data << (uint8) 0; // GROUP_UPDATE_FLAG_PET_AURAS - data << (uint64) 0; // GROUP_UPDATE_FLAG_PET_AURAS - data << (uint32) 0; // GROUP_UPDATE_FLAG_PET_AURAS - } + // else not needed, flags do not include any PET_ update // GROUP_UPDATE_FLAG_PHASE data << uint32(8); // either 0 or 8, same unk found in SMSG_PHASESHIFT @@ -1260,18 +1260,13 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket& recvData) SendPacket(&data); } -/*!*/void WorldSession::HandleRequestRaidInfoOpcode(WorldPacket & /*recvData*/) +void WorldSession::HandleRequestRaidInfoOpcode(WorldPacket& /*recvData*/) { // every time the player checks the character screen _player->SendRaidInfo(); } -/*void WorldSession::HandleGroupCancelOpcode(WorldPacket & recvData) -{ - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: got CMSG_GROUP_CANCEL."); -}*/ - -void WorldSession::HandleOptOutOfLootOpcode(WorldPacket & recvData) +void WorldSession::HandleOptOutOfLootOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_OPT_OUT_OF_LOOT"); -- cgit v1.2.3 From 122df951654b0f16f464e8a48e3c093c80825474 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 28 Aug 2012 23:32:09 +0200 Subject: Core/Items: Bind item to owner when using it for transmogrification --- src/server/game/Handlers/ItemHandler.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 0349b88a9ad..3b38db78d94 100644 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -1620,6 +1620,9 @@ void WorldSession::HandleTransmogrifyItems(WorldPacket& recvData) itemTransmogrified->SetNotRefundable(player); itemTransmogrified->ClearSoulboundTradeable(player); + if (itemTransmogrifier->GetTemplate()->Bonding == BIND_WHEN_EQUIPED || itemTransmogrifier->GetTemplate()->Bonding == BIND_WHEN_USE) + itemTransmogrifier->SetBinding(true); + itemTransmogrifier->SetOwnerGUID(player->GetGUID()); itemTransmogrifier->SetNotRefundable(player); itemTransmogrifier->ClearSoulboundTradeable(player); -- cgit v1.2.3 From ee760ab36089c940cf53ba565102d49c6961fbf1 Mon Sep 17 00:00:00 2001 From: Tuxity Date: Tue, 28 Aug 2012 23:42:15 +0100 Subject: Core/BG: Initial work on battleground and battlefield related packets --- src/server/game/Battlefield/Battlefield.cpp | 12 +- src/server/game/Battlefield/Battlefield.h | 3 + src/server/game/Battlefield/BattlefieldHandler.cpp | 301 +++++++++++---- src/server/game/Battlefield/BattlefieldMgr.cpp | 9 + src/server/game/Battlefield/BattlefieldMgr.h | 1 + src/server/game/Battlegrounds/Battleground.cpp | 13 +- src/server/game/Battlegrounds/Battleground.h | 14 +- src/server/game/Battlegrounds/BattlegroundMgr.cpp | 422 ++++++++++++++++----- src/server/game/Battlegrounds/BattlegroundMgr.h | 8 +- .../game/Battlegrounds/BattlegroundQueue.cpp | 8 +- src/server/game/Entities/Object/ObjectDefines.h | 1 + src/server/game/Handlers/BattleGroundHandler.cpp | 148 +++++--- src/server/game/Server/Protocol/Opcodes.cpp | 45 +-- src/server/game/Server/Protocol/Opcodes.h | 11 +- src/server/game/Server/WorldSession.h | 16 +- 15 files changed, 742 insertions(+), 270 deletions(-) (limited to 'src') diff --git a/src/server/game/Battlefield/Battlefield.cpp b/src/server/game/Battlefield/Battlefield.cpp index 7f701f541a1..8ed4375bc41 100644 --- a/src/server/game/Battlefield/Battlefield.cpp +++ b/src/server/game/Battlefield/Battlefield.cpp @@ -34,6 +34,8 @@ Battlefield::Battlefield() { + m_Guid = MAKE_NEW_GUID(m_TypeId, 0, HIGHGUID_TYPE_BATTLEGROUND); + m_Timer = 0; m_IsEnabled = true; m_isActive = false; @@ -100,7 +102,7 @@ void Battlefield::HandlePlayerLeaveZone(Player* player, uint32 /*zone*/) if (m_PlayersInWar[player->GetTeamId()].find(player->GetGUID()) != m_PlayersInWar[player->GetTeamId()].end()) { m_PlayersInWar[player->GetTeamId()].erase(player->GetGUID()); - player->GetSession()->SendBfLeaveMessage(m_BattleId); + player->GetSession()->SendBfLeaveMessage(m_Guid); if (Group* group = player->GetGroup()) // Remove the player from the raid group group->RemoveMember(player->GetGUID()); @@ -203,7 +205,7 @@ void Battlefield::InvitePlayerToQueue(Player* player) return; if (m_PlayersInQueue[player->GetTeamId()].size() <= m_MinPlayer || m_PlayersInQueue[GetOtherTeam(player->GetTeamId())].size() >= m_MinPlayer) - player->GetSession()->SendBfInvitePlayerToQueue(m_BattleId); + player->GetSession()->SendBfInvitePlayerToQueue(m_Guid); } void Battlefield::InvitePlayersInQueueToWar() @@ -272,7 +274,7 @@ void Battlefield::InvitePlayerToWar(Player* player) m_PlayersWillBeKick[player->GetTeamId()].erase(player->GetGUID()); m_InvitedPlayers[player->GetTeamId()][player->GetGUID()] = time(NULL) + m_TimeForAcceptInvite; - player->GetSession()->SendBfInvitePlayerToWar(m_BattleId, m_ZoneId, m_TimeForAcceptInvite); + player->GetSession()->SendBfInvitePlayerToWar(m_Guid, m_ZoneId, m_TimeForAcceptInvite); } void Battlefield::InitStalker(uint32 entry, float x, float y, float z, float o) @@ -368,7 +370,7 @@ void Battlefield::PlayerAcceptInviteToQueue(Player* player) // Add player in queue m_PlayersInQueue[player->GetTeamId()].insert(player->GetGUID()); // Send notification - player->GetSession()->SendBfQueueInviteResponse(m_BattleId, m_ZoneId); + player->GetSession()->SendBfQueueInviteResponse(m_Guid, m_ZoneId); } // Called in WorldSession::HandleBfExitRequest @@ -386,7 +388,7 @@ void Battlefield::PlayerAcceptInviteToWar(Player* player) if (AddOrSetPlayerToCorrectBfGroup(player)) { - player->GetSession()->SendBfEntered(m_BattleId); + player->GetSession()->SendBfEntered(m_Guid); m_PlayersInWar[player->GetTeamId()].insert(player->GetGUID()); m_InvitedPlayers[player->GetTeamId()].erase(player->GetGUID()); diff --git a/src/server/game/Battlefield/Battlefield.h b/src/server/game/Battlefield/Battlefield.h index 07daf33d431..175bb039744 100644 --- a/src/server/game/Battlefield/Battlefield.h +++ b/src/server/game/Battlefield/Battlefield.h @@ -239,6 +239,7 @@ class Battlefield : public ZoneScript uint32 GetTypeId() { return m_TypeId; } uint32 GetZoneId() { return m_ZoneId; } + uint64 GetGUID() { return m_Guid; } void TeamApplyBuff(TeamId team, uint32 spellId, uint32 spellId2 = 0); @@ -357,6 +358,8 @@ class Battlefield : public ZoneScript void InitStalker(uint32 entry, float x, float y, float z, float o); protected: + uint64 m_Guid; + uint64 StalkerGuid; uint32 m_Timer; // Global timer for event bool m_IsEnabled; diff --git a/src/server/game/Battlefield/BattlefieldHandler.cpp b/src/server/game/Battlefield/BattlefieldHandler.cpp index b852082d582..ddb903a6d4e 100644 --- a/src/server/game/Battlefield/BattlefieldHandler.cpp +++ b/src/server/game/Battlefield/BattlefieldHandler.cpp @@ -27,124 +27,291 @@ #include "Opcodes.h" //This send to player windows for invite player to join the war -//Param1:(BattleId) the BattleId of Bf +//Param1:(guid) the guid of Bf //Param2:(ZoneId) the zone where the battle is (4197 for wg) //Param3:(time) Time in second that the player have for accept -void WorldSession::SendBfInvitePlayerToWar(uint32 BattleId, uint32 ZoneId, uint32 p_time) +void WorldSession::SendBfInvitePlayerToWar(uint64 guid, uint32 zoneId, uint32 pTime) { - //Send packet - WorldPacket data(SMSG_BATTLEFIELD_MGR_ENTRY_INVITE, 12); - data << uint32(BattleId); - data << uint32(ZoneId); - data << uint32((time(NULL) + p_time)); + ObjectGuid guidBytes = guid; + + WorldPacket data(SMSG_BATTLEFIELD_MGR_ENTRY_INVITE, 16); + + data.WriteBit(guidBytes[5]); + data.WriteBit(guidBytes[3]); + data.WriteBit(guidBytes[7]); + data.WriteBit(guidBytes[2]); + data.WriteBit(guidBytes[6]); + data.WriteBit(guidBytes[4]); + data.WriteBit(guidBytes[1]); + data.WriteBit(guidBytes[0]); + + data.WriteByteSeq(guidBytes[6]); + data << uint32(zoneId); // Zone Id + data.WriteByteSeq(guidBytes[1]); + data.WriteByteSeq(guidBytes[3]); + data.WriteByteSeq(guidBytes[4]); + data.WriteByteSeq(guidBytes[2]); + data.WriteByteSeq(guidBytes[0]); + data << uint32(time(NULL) + pTime); // Invite lasts until + data.WriteByteSeq(guidBytes[7]); + data.WriteByteSeq(guidBytes[5]); //Sending the packet to player SendPacket(&data); } //This send invitation to player to join the queue -//Param1:(BattleId) the BattleId of Bf -void WorldSession::SendBfInvitePlayerToQueue(uint32 BattleId) +void WorldSession::SendBfInvitePlayerToQueue(uint64 guid) { + ObjectGuid guidBytes = guid; + WorldPacket data(SMSG_BATTLEFIELD_MGR_QUEUE_INVITE, 5); - data << uint32(BattleId); - data << uint8(1); //warmup ? used ? + data.WriteBit(1); // unk + data.WriteBit(0); // Has Warmup + data.WriteBit(1); // unk + data.WriteBit(guidBytes[0]); + data.WriteBit(1); // unk + data.WriteBit(guidBytes[2]); + data.WriteBit(guidBytes[6]); + data.WriteBit(guidBytes[3]); + data.WriteBit(1); // unk + data.WriteBit(0); // unk + data.WriteBit(guidBytes[1]); + data.WriteBit(guidBytes[5]); + data.WriteBit(guidBytes[4]); + data.WriteBit(1); // unk + data.WriteBit(guidBytes[7]); + + data.FlushBits(); + + data.WriteByteSeq(guidBytes[2]); + data.WriteByteSeq(guidBytes[3]); + data.WriteByteSeq(guidBytes[6]); + data << uint8(1); // Warmup + data.WriteByteSeq(guidBytes[5]); + data.WriteByteSeq(guidBytes[0]); + data.WriteByteSeq(guidBytes[4]); + data.WriteByteSeq(guidBytes[1]); + data.WriteByteSeq(guidBytes[7]); //Sending packet to player SendPacket(&data); } //This send packet for inform player that he join queue -//Param1:(BattleId) the BattleId of Bf +//Param1:(guid) the guid of Bf //Param2:(ZoneId) the zone where the battle is (4197 for wg) //Param3:(CanQueue) if able to queue //Param4:(Full) on log in is full -void WorldSession::SendBfQueueInviteResponse(uint32 BattleId,uint32 ZoneId, bool CanQueue, bool Full) +void WorldSession::SendBfQueueInviteResponse(uint64 guid, uint32 ZoneId, bool CanQueue, bool Full) { - WorldPacket data(SMSG_BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE, 11); - data << uint32(BattleId); + const bool hasSecondGuid = false; + const bool warmup = true; + ObjectGuid guidBytes = guid; + + WorldPacket data(SMSG_BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE, 16); + + data.WriteBit(guidBytes[1]); + data.WriteBit(guidBytes[6]); + data.WriteBit(guidBytes[5]); + data.WriteBit(guidBytes[7]); + data.WriteBit(Full); // Logging In, VERIFYME + data.WriteBit(guidBytes[0]); + data.WriteBit(!hasSecondGuid); + data.WriteBit(guidBytes[4]); + + // if (hasSecondGuid) 7 3 0 4 2 6 1 5 + + data.WriteBit(guidBytes[3]); + data.WriteBit(guidBytes[2]); + + // if (hasSecondGuid) 2 5 3 0 4 6 1 7 + + data.FlushBits(); + + data << uint8(CanQueue); // Accepted + + data.WriteByteSeq(guidBytes[1]); + data.WriteByteSeq(guidBytes[3]); + data.WriteByteSeq(guidBytes[6]); + data.WriteByteSeq(guidBytes[7]); + data.WriteByteSeq(guidBytes[0]); + + data << uint8(warmup); + + data.WriteByteSeq(guidBytes[2]); + data.WriteByteSeq(guidBytes[4]); + data.WriteByteSeq(guidBytes[5]); + data << uint32(ZoneId); - data << uint8((CanQueue ? 1 : 0)); //Accepted //0 you cannot queue wg //1 you are queued - data << uint8((Full ? 0 : 1)); //Logging In //0 wg full //1 queue for upcoming - data << uint8(1); //Warmup + SendPacket(&data); } //This is call when player accept to join war -//Param1:(BattleId) the BattleId of Bf -void WorldSession::SendBfEntered(uint32 BattleId) +void WorldSession::SendBfEntered(uint64 guid) { -// m_PlayerInWar[player->GetTeamId()].insert(player->GetGUID()); - WorldPacket data(SMSG_BATTLEFIELD_MGR_ENTERED, 7); - data << uint32(BattleId); - data << uint8(1); //unk - data << uint8(1); //unk - data << uint8(_player->isAFK() ? 1 : 0); //Clear AFK + uint8 isAFK = _player->isAFK() ? 1 : 0; + ObjectGuid guidBytes = guid; + + WorldPacket data(SMSG_BATTLEFIELD_MGR_ENTERED, 11); + + data.WriteBit(0); // unk + data.WriteBit(isAFK); // Clear AFK + data.WriteBit(guidBytes[1]); + data.WriteBit(guidBytes[4]); + data.WriteBit(guidBytes[5]); + data.WriteBit(guidBytes[0]); + data.WriteBit(guidBytes[3]); + data.WriteBit(0); // unk + data.WriteBit(guidBytes[6]); + data.WriteBit(guidBytes[7]); + data.WriteBit(guidBytes[2]); + + data.FlushBits(); + + data.WriteByteSeq(guidBytes[5]); + data.WriteByteSeq(guidBytes[3]); + data.WriteByteSeq(guidBytes[0]); + data.WriteByteSeq(guidBytes[4]); + data.WriteByteSeq(guidBytes[1]); + data.WriteByteSeq(guidBytes[7]); + data.WriteByteSeq(guidBytes[2]); + data.WriteByteSeq(guidBytes[6]); + SendPacket(&data); } -void WorldSession::SendBfLeaveMessage(uint32 BattleId, BFLeaveReason reason) +void WorldSession::SendBfLeaveMessage(uint64 guid, BFLeaveReason reason) { - WorldPacket data(SMSG_BATTLEFIELD_MGR_EJECTED, 7); - data << uint32(BattleId); - data << uint8(reason);//byte Reason - data << uint8(2);//byte BattleStatus - data << uint8(0);//bool Relocated + ObjectGuid guidBytes = guid; + + WorldPacket data(SMSG_BATTLEFIELD_MGR_EJECTED, 11); + + data.WriteBit(guidBytes[2]); + data.WriteBit(guidBytes[5]); + data.WriteBit(guidBytes[1]); + data.WriteBit(guidBytes[0]); + data.WriteBit(guidBytes[3]); + data.WriteBit(guidBytes[6]); + data.WriteBit(0); // Relocated + data.WriteBit(guidBytes[7]); + data.WriteBit(guidBytes[4]); + + data.FlushBits(); + + data << uint8(2); // BattleStatus + data.WriteByteSeq(guidBytes[1]); + data.WriteByteSeq(guidBytes[7]); + data.WriteByteSeq(guidBytes[4]); + data.WriteByteSeq(guidBytes[2]); + data.WriteByteSeq(guidBytes[3]); + data << uint8(reason); // Reason + data.WriteByteSeq(guidBytes[6]); + data.WriteByteSeq(guidBytes[0]); + data.WriteByteSeq(guidBytes[5]); + SendPacket(&data); } //Send by client when he click on accept for queue -void WorldSession::HandleBfQueueInviteResponse(WorldPacket & recv_data) +void WorldSession::HandleBfQueueInviteResponse(WorldPacket& recvData) { - uint32 BattleId; - uint8 Accepted; + uint8 accepted; + ObjectGuid guid; + + guid[2] = recvData.ReadBit(); + guid[0] = recvData.ReadBit(); + guid[4] = recvData.ReadBit(); + guid[3] = recvData.ReadBit(); + guid[5] = recvData.ReadBit(); + guid[7] = recvData.ReadBit(); + accepted = recvData.ReadBit(); + guid[1] = recvData.ReadBit(); + guid[6] = recvData.ReadBit(); + + recvData.ReadByteSeq(guid[1]); + recvData.ReadByteSeq(guid[3]); + recvData.ReadByteSeq(guid[2]); + recvData.ReadByteSeq(guid[4]); + recvData.ReadByteSeq(guid[6]); + recvData.ReadByteSeq(guid[7]); + recvData.ReadByteSeq(guid[0]); + recvData.ReadByteSeq(guid[5]); - recv_data >> BattleId >> Accepted; - sLog->outError(LOG_FILTER_GENERAL, "HandleQueueInviteResponse: BattleID:%u Accepted:%u", BattleId, Accepted); - Battlefield* Bf = sBattlefieldMgr->GetBattlefieldByBattleId(BattleId); - if (!Bf) + sLog->outError(LOG_FILTER_GENERAL, "HandleQueueInviteResponse: GUID:"UI64FMTD" Accepted:%u", guid, accepted); + + Battlefield* bf = sBattlefieldMgr->GetBattlefieldByGUID(guid); + if (!bf) return; - if (Accepted) - { - Bf->PlayerAcceptInviteToQueue(_player); - } + if (accepted) + bf->PlayerAcceptInviteToQueue(_player); } //Send by client on clicking in accept or refuse of invitation windows for join game -void WorldSession::HandleBfEntryInviteResponse(WorldPacket & recv_data) +void WorldSession::HandleBfEntryInviteResponse(WorldPacket& recvData) { - uint32 BattleId; - uint8 Accepted; + uint8 accepted; + ObjectGuid guid; + + guid[6] = recvData.ReadBit(); + guid[1] = recvData.ReadBit(); + accepted = recvData.ReadBit(); + guid[5] = recvData.ReadBit(); + guid[3] = recvData.ReadBit(); + guid[2] = recvData.ReadBit(); + guid[0] = recvData.ReadBit(); + guid[7] = recvData.ReadBit(); + guid[4] = recvData.ReadBit(); + + recvData.ReadByteSeq(guid[0]); + recvData.ReadByteSeq(guid[3]); + recvData.ReadByteSeq(guid[4]); + recvData.ReadByteSeq(guid[2]); + recvData.ReadByteSeq(guid[1]); + recvData.ReadByteSeq(guid[6]); + recvData.ReadByteSeq(guid[7]); + recvData.ReadByteSeq(guid[5]); + + sLog->outError(LOG_FILTER_GENERAL, "HandleBattlefieldInviteResponse: GUID:"UI64FMTD" Accepted:%u", guid, accepted); - recv_data >> BattleId >> Accepted; - sLog->outError(LOG_FILTER_GENERAL, "HandleBattlefieldInviteResponse: BattleID:%u Accepted:%u", BattleId, Accepted); - Battlefield* Bf = sBattlefieldMgr->GetBattlefieldByBattleId(BattleId); - if (!Bf) + Battlefield* bf = sBattlefieldMgr->GetBattlefieldByGUID(guid); + if (!bf) return; - //If player accept invitation - if (Accepted) - { - Bf->PlayerAcceptInviteToWar(_player); - } + if (accepted) + bf->PlayerAcceptInviteToWar(_player); else - { - if (_player->GetZoneId() == Bf->GetZoneId()) - Bf->KickPlayerFromBattlefield(_player->GetGUID()); - } + if (_player->GetZoneId() == bf->GetZoneId()) + bf->KickPlayerFromBattlefield(_player->GetGUID()); } -void WorldSession::HandleBfExitRequest(WorldPacket & recv_data) +void WorldSession::HandleBfExitRequest(WorldPacket& recvData) { - uint32 BattleId; + ObjectGuid guid; - recv_data >> BattleId; - sLog->outError(LOG_FILTER_GENERAL, "HandleBfExitRequest: BattleID:%u ", BattleId); - Battlefield* Bf = sBattlefieldMgr->GetBattlefieldByBattleId(BattleId); - if (!Bf) - return; + guid[2] = recvData.ReadBit(); + guid[0] = recvData.ReadBit(); + guid[3] = recvData.ReadBit(); + guid[7] = recvData.ReadBit(); + guid[4] = recvData.ReadBit(); + guid[5] = recvData.ReadBit(); + guid[6] = recvData.ReadBit(); + guid[1] = recvData.ReadBit(); + + recvData.ReadByteSeq(guid[5]); + recvData.ReadByteSeq(guid[2]); + recvData.ReadByteSeq(guid[0]); + recvData.ReadByteSeq(guid[1]); + recvData.ReadByteSeq(guid[4]); + recvData.ReadByteSeq(guid[3]); + recvData.ReadByteSeq(guid[7]); + recvData.ReadByteSeq(guid[6]); + + sLog->outError(LOG_FILTER_GENERAL, "HandleBfExitRequest: GUID:"UI64FMTD" ", guid); - Bf->AskToLeaveQueue(_player); + if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldByGUID(guid)) + bf->AskToLeaveQueue(_player); } diff --git a/src/server/game/Battlefield/BattlefieldMgr.cpp b/src/server/game/Battlefield/BattlefieldMgr.cpp index 6122b25e8e8..d2ecf43ee9b 100644 --- a/src/server/game/Battlefield/BattlefieldMgr.cpp +++ b/src/server/game/Battlefield/BattlefieldMgr.cpp @@ -118,6 +118,15 @@ Battlefield *BattlefieldMgr::GetBattlefieldByBattleId(uint32 battleid) return NULL; } +Battlefield* BattlefieldMgr::GetBattlefieldByGUID(uint64 guid) +{ + for (BattlefieldSet::iterator itr = m_BattlefieldSet.begin(); itr != m_BattlefieldSet.end(); ++itr) + if ((*itr)->GetGUID() == guid) + return (*itr); + + return NULL; +} + void BattlefieldMgr::Update(uint32 diff) { m_UpdateTimer += diff; diff --git a/src/server/game/Battlefield/BattlefieldMgr.h b/src/server/game/Battlefield/BattlefieldMgr.h index 4ee37e424fd..b448cd4ead2 100644 --- a/src/server/game/Battlefield/BattlefieldMgr.h +++ b/src/server/game/Battlefield/BattlefieldMgr.h @@ -48,6 +48,7 @@ class BattlefieldMgr // return assigned battlefield Battlefield *GetBattlefieldToZoneId(uint32 zoneid); Battlefield *GetBattlefieldByBattleId(uint32 battleid); + Battlefield *GetBattlefieldByGUID(uint64 guid); ZoneScript *GetZoneScript(uint32 zoneId); diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index 98b95b5d32b..ab69ed40943 100755 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -131,6 +131,7 @@ void Battleground::BroadcastWorker(Do& _do) Battleground::Battleground() { + m_Guid = MAKE_NEW_GUID(m_TypeID, 0, HIGHGUID_TYPE_BATTLEGROUND); m_TypeID = BATTLEGROUND_TYPE_NONE; m_RandomTypeID = BATTLEGROUND_TYPE_NONE; m_InstanceID = 0; @@ -493,7 +494,7 @@ inline void Battleground::_ProcessJoin(uint32 diff) WorldPacket status; BattlegroundQueueTypeId bgQueueTypeId = sBattlegroundMgr->BGQueueTypeId(m_TypeID, GetArenaType()); uint32 queueSlot = player->GetBattlegroundQueueIndex(bgQueueTypeId); - sBattlegroundMgr->BuildBattlegroundStatusPacket(&status, this, queueSlot, STATUS_IN_PROGRESS, 0, GetStartTime(), GetArenaType()); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&status, this, player, queueSlot, STATUS_IN_PROGRESS, 0, GetStartTime(), GetArenaType()); player->GetSession()->SendPacket(&status); player->RemoveAurasDueToSpell(SPELL_ARENA_PREPARATION); @@ -914,7 +915,7 @@ void Battleground::EndBattleground(uint32 winner) player->GetSession()->SendPacket(&data); BattlegroundQueueTypeId bgQueueTypeId = BattlegroundMgr::BGQueueTypeId(GetTypeID(), GetArenaType()); - sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, this, player->GetBattlegroundQueueIndex(bgQueueTypeId), STATUS_IN_PROGRESS, TIME_TO_AUTOREMOVE, GetStartTime(), GetArenaType()); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, this, player, player->GetBattlegroundQueueIndex(bgQueueTypeId), STATUS_IN_PROGRESS, TIME_TO_AUTOREMOVE, GetStartTime(), GetArenaType()); player->GetSession()->SendPacket(&data); player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_BATTLEGROUND, 1); } @@ -1020,7 +1021,7 @@ void Battleground::RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPac if (SendPacket) { WorldPacket data; - sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, this, player->GetBattlegroundQueueIndex(bgQueueTypeId), STATUS_NONE, 0, 0, 0); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, this, player, player->GetBattlegroundQueueIndex(bgQueueTypeId), STATUS_NONE, 0, 0, 0); player->GetSession()->SendPacket(&data); } @@ -1144,14 +1145,14 @@ void Battleground::AddPlayer(Player* player) UpdatePlayersCountByTeam(team, false); // +1 player WorldPacket data; - sBattlegroundMgr->BuildPlayerJoinedBattlegroundPacket(&data, player); + sBattlegroundMgr->BuildPlayerJoinedBattlegroundPacket(&data, player->GetGUID()); SendPacketToTeam(team, &data, player, false); // BG Status packet WorldPacket status; BattlegroundQueueTypeId bgQueueTypeId = sBattlegroundMgr->BGQueueTypeId(m_TypeID, GetArenaType()); uint32 queueSlot = player->GetBattlegroundQueueIndex(bgQueueTypeId); - sBattlegroundMgr->BuildBattlegroundStatusPacket(&status, this, queueSlot, STATUS_IN_PROGRESS, 0, GetStartTime(), GetArenaType(), isArena() ? 0 : 1); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&status, this, player, queueSlot, STATUS_IN_PROGRESS, 0, GetStartTime(), GetArenaType(), isArena() ? 0 : 1); player->GetSession()->SendPacket(&status); player->RemoveAurasByType(SPELL_AURA_MOUNTED); @@ -1860,7 +1861,7 @@ void Battleground::PlayerAddedToBGCheckIfBGIsRunning(Player* player) sBattlegroundMgr->BuildPvpLogDataPacket(&data, this); player->GetSession()->SendPacket(&data); - sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, this, player->GetBattlegroundQueueIndex(bgQueueTypeId), STATUS_IN_PROGRESS, GetEndTime(), GetStartTime(), GetArenaType()); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, this, player, player->GetBattlegroundQueueIndex(bgQueueTypeId), STATUS_IN_PROGRESS, GetEndTime(), GetStartTime(), GetArenaType()); player->GetSession()->SendPacket(&data); } diff --git a/src/server/game/Battlegrounds/Battleground.h b/src/server/game/Battlegrounds/Battleground.h index 234cda4105c..29523864329 100755 --- a/src/server/game/Battlegrounds/Battleground.h +++ b/src/server/game/Battlegrounds/Battleground.h @@ -133,12 +133,12 @@ enum BattlegroundBuffObjects enum BattlegroundRandomRewards { - BG_REWARD_WINNER_HONOR_FIRST = 30, - BG_REWARD_WINNER_ARENA_FIRST = 25, - BG_REWARD_WINNER_HONOR_LAST = 15, - BG_REWARD_WINNER_ARENA_LAST = 0, - BG_REWARD_LOSER_HONOR_FIRST = 5, - BG_REWARD_LOSER_HONOR_LAST = 5 + BG_REWARD_WINNER_HONOR_FIRST = 270, + BG_REWARD_WINNER_CONQUEST_FIRST = 100, + BG_REWARD_WINNER_HONOR_LAST = 135, + BG_REWARD_WINNER_CONQUEST_LAST = 50, + BG_REWARD_LOSER_HONOR_FIRST = 45, + BG_REWARD_LOSER_HONOR_LAST = 35 }; const uint32 Buff_Entries[3] = { BG_OBJECTID_SPEEDBUFF_ENTRY, BG_OBJECTID_REGENBUFF_ENTRY, BG_OBJECTID_BERSERKERBUFF_ENTRY }; @@ -342,6 +342,7 @@ class Battleground /* Battleground */ // Get methods: char const* GetName() const { return m_Name; } + uint64 GetGUID() { return m_Guid; } BattlegroundTypeId GetTypeID(bool GetRandom = false) const { return GetRandom ? m_RandomTypeID : m_TypeID; } BattlegroundBracketId GetBracketId() const { return m_BracketId; } uint32 GetInstanceID() const { return m_InstanceID; } @@ -635,6 +636,7 @@ class Battleground bool m_PrematureCountDown; uint32 m_PrematureCountDownTimer; char const* m_Name; + uint64 m_Guid; /* Pre- and post-update hooks */ diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index 86b06de2cec..9ff21ca2d30 100755 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -180,56 +180,244 @@ void BattlegroundMgr::Update(uint32 diff) } } -void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket* data, Battleground* bg, uint8 QueueSlot, uint8 StatusID, uint32 Time1, uint32 Time2, uint8 arenatype, uint8 uiFrame) +void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battleground *bg, Player * pPlayer, uint8 QueueSlot, uint8 StatusID, uint32 Time1, uint32 Time2, uint8 arenatype, uint8 uiFrame) { - // we can be in 2 queues in same time... + if (!bg) + StatusID = STATUS_NONE; - if (StatusID == 0 || !bg) - { - data->Initialize(SMSG_BATTLEFIELD_STATUS, 4+8); - *data << uint32(QueueSlot); // queue id (0...1) - *data << uint64(0); - return; - } + ObjectGuid guidBytes1 = pPlayer->GetGUID(); + ObjectGuid guidBytes2 = bg->GetGUID(); - data->Initialize(SMSG_BATTLEFIELD_STATUS, (4+8+1+1+4+1+4+4+4)); - *data << uint32(QueueSlot); // queue id (0...1) - player can be in 2 queues in time - // The following segment is read as uint64 in client but can be appended as their original type. - *data << uint8(arenatype); - sLog->outDebug(LOG_FILTER_NETWORKIO, "BattlegroundMgr::BuildBattlegroundStatusPacket: arenatype = %u for bg instanceID %u, TypeID %u.", arenatype, bg->GetClientInstanceID(), bg->GetTypeID()); - *data << uint8(bg->isArena() ? 0xC : 0x2); - *data << uint32(bg->GetTypeID()); - *data << uint16(0x1F90); - // End of uint64 segment, decomposed this way for simplicity - *data << uint8(0); // 3.3.0, some level, only saw 80... - *data << uint8(0); // 3.3.0, some level, only saw 80... - *data << uint32(bg->GetClientInstanceID()); - // alliance/horde for BG and skirmish/rated for Arenas - // following displays the minimap-icon 0 = faction icon 1 = arenaicon - *data << uint8(bg->isRated()); // 1 for rated match, 0 for bg or non rated match - - *data << uint32(StatusID); // status switch (StatusID) { - case STATUS_WAIT_QUEUE: // status_in_queue - *data << uint32(Time1); // average wait time, milliseconds - *data << uint32(Time2); // time in queue, updated every minute!, milliseconds + case STATUS_NONE: + { + //data->Initialize(SMSG_BATTLEFIELD_STATUS_FAILED); + sLog->outDebug(LOG_FILTER_NETWORKIO, ">>>>> STATUS_NONE"); break; - case STATUS_WAIT_JOIN: // status_invite - *data << uint32(bg->GetMapId()); // map id - *data << uint64(0); // 3.3.5, unknown - *data << uint32(Time1); // time to remove from queue, milliseconds + } + case STATUS_WAIT_QUEUE: + { + data->Initialize(SMSG_BATTLEFIELD_STATUS_QUEUED); + + data->WriteBit(guidBytes1[3]); + data->WriteBit(guidBytes1[0]); + data->WriteBit(guidBytes2[3]); + data->WriteBit(guidBytes1[2]); + data->WriteBit(0); // unk + data->WriteBit(0); // Join Failed + data->WriteBit(guidBytes2[2]); + data->WriteBit(guidBytes1[1]); + data->WriteBit(guidBytes2[0]); + data->WriteBit(guidBytes2[6]); + data->WriteBit(guidBytes2[4]); + data->WriteBit(guidBytes1[6]); + data->WriteBit(guidBytes1[7]); + data->WriteBit(guidBytes2[7]); + data->WriteBit(guidBytes2[5]); + data->WriteBit(guidBytes1[4]); + data->WriteBit(guidBytes1[5]); + data->WriteBit(0); // unk + data->WriteBit(0); // unk + data->WriteBit(guidBytes2[1]); + + data->FlushBits(); + + data->WriteByteSeq(guidBytes1[0]); + *data << uint32(0); // unk + data->WriteByteSeq(guidBytes2[5]); + data->WriteByteSeq(guidBytes1[3]); + *data << uint32(0); // unk + data->WriteByteSeq(guidBytes2[7]); + data->WriteByteSeq(guidBytes2[1]); + data->WriteByteSeq(guidBytes2[2]); + *data << uint8(0); // unk + data->WriteByteSeq(guidBytes2[4]); + data->WriteByteSeq(guidBytes1[2]); + *data << uint8(0); // unk + data->WriteByteSeq(guidBytes2[6]); + data->WriteByteSeq(guidBytes1[7]); + data->WriteByteSeq(guidBytes2[3]); + data->WriteByteSeq(guidBytes1[6]); + data->WriteByteSeq(guidBytes2[0]); + *data << uint32(bg->GetStartTime()); // Time + *data << uint32(0); // unk + *data << uint8(bg->GetMinLevel()); // Min Level + *data << uint32(0); // unk + data->WriteByteSeq(guidBytes1[1]); + data->WriteByteSeq(guidBytes1[5]); + *data << uint32(0); // unk + data->WriteByteSeq(guidBytes1[4]); + break; - case STATUS_IN_PROGRESS: // status_in_progress - *data << uint32(bg->GetMapId()); // map id - *data << uint64(0); // 3.3.5, unknown - *data << uint32(Time1); // time to bg auto leave, 0 at bg start, 120000 after bg end, milliseconds - *data << uint32(Time2); // time from bg start, milliseconds - *data << uint8(uiFrame); + } + case STATUS_WAIT_JOIN: + { + data->Initialize(SMSG_BATTLEFIELD_STATUS_NEEDCONFIRMATION, 44); + + *data << uint32(bg->GetClientInstanceID()); // Client Instance ID + *data << uint32(Time1); // Time until closed + *data << uint8(0); // unk + *data << uint32(QueueSlot); // Queue slot + *data << uint32(Time2); // Time + *data << uint8(bg->GetMinLevel()); // Min Level + *data << uint32(bg->GetStatus()); // Status + *data << uint32(bg->GetMapId()); // Map Id + *data << uint8(0); // unk + + data->WriteBit(guidBytes1[5]); + data->WriteBit(guidBytes1[2]); + data->WriteBit(guidBytes1[1]); + data->WriteBit(guidBytes2[2]); + data->WriteBit(guidBytes1[4]); + data->WriteBit(guidBytes2[6]); + data->WriteBit(guidBytes2[3]); + data->WriteBit(bg->isRated()); // Is Rated + data->WriteBit(guidBytes1[7]); + data->WriteBit(guidBytes1[3]); + data->WriteBit(guidBytes2[7]); + data->WriteBit(guidBytes2[0]); + data->WriteBit(guidBytes2[4]); + data->WriteBit(guidBytes1[6]); + data->WriteBit(guidBytes2[1]); + data->WriteBit(guidBytes2[5]); + data->WriteBit(guidBytes1[0]); + + data->FlushBits(); + + data->WriteByteSeq(guidBytes2[6]); + data->WriteByteSeq(guidBytes2[5]); + data->WriteByteSeq(guidBytes2[7]); + data->WriteByteSeq(guidBytes2[0]); + data->WriteByteSeq(guidBytes1[0]); + data->WriteByteSeq(guidBytes1[7]); + data->WriteByteSeq(guidBytes2[4]); + data->WriteByteSeq(guidBytes1[1]); + data->WriteByteSeq(guidBytes2[0]); + data->WriteByteSeq(guidBytes1[4]); + data->WriteByteSeq(guidBytes2[1]); + data->WriteByteSeq(guidBytes1[5]); + data->WriteByteSeq(guidBytes2[3]); + data->WriteByteSeq(guidBytes1[6]); + data->WriteByteSeq(guidBytes1[2]); + data->WriteByteSeq(guidBytes1[3]); break; - default: - sLog->outError(LOG_FILTER_BATTLEGROUND, "Unknown BG status!"); + } + case STATUS_IN_PROGRESS: + { + data->Initialize(SMSG_BATTLEFIELD_STATUS_ACTIVE, 49); + + data->WriteBit(guidBytes1[2]); + data->WriteBit(guidBytes1[7]); + data->WriteBit(guidBytes2[7]); + data->WriteBit(guidBytes2[1]); + data->WriteBit(guidBytes1[5]); + data->WriteBit(0); // Unk + data->WriteBit(guidBytes2[0]); + data->WriteBit(guidBytes1[1]); + data->WriteBit(guidBytes2[3]); + data->WriteBit(guidBytes1[6]); + data->WriteBit(guidBytes2[5]); + data->WriteBit(0); // Unk Bit 64 + data->WriteBit(guidBytes1[4]); + data->WriteBit(guidBytes2[6]); + data->WriteBit(guidBytes2[4]); + data->WriteBit(guidBytes2[2]); + data->WriteBit(guidBytes1[3]); + data->WriteBit(guidBytes1[0]); + + data->WriteByteSeq(guidBytes2[4]); + data->WriteByteSeq(guidBytes2[5]); + data->WriteByteSeq(guidBytes1[5]); + data->WriteByteSeq(guidBytes2[1]); + data->WriteByteSeq(guidBytes2[6]); + data->WriteByteSeq(guidBytes2[3]); + data->WriteByteSeq(guidBytes2[7]); + data->WriteByteSeq(guidBytes1[6]); + + *data << uint32(Time2); // Time + *data << uint8(bg->GetPlayersCountByTeam(bg->GetPlayerTeam(pPlayer->GetGUID()))); // Teamsize + + data->WriteByteSeq(guidBytes1[4]); + data->WriteByteSeq(guidBytes1[1]); + + *data << uint32(QueueSlot); // Queue slot + *data << uint8(bg->GetMaxLevel()); // Max Level + *data << uint32(bg->GetStatus()); // Status + *data << uint32(bg->GetMapId()); // Map Id + *data << uint8(bg->GetMinLevel()); // Min Level + *data << uint32(Time1); // Time until closed + + data->WriteByteSeq(guidBytes1[2]); + + *data << uint32(bg->GetStartTime()); // Time since started + + data->WriteByteSeq(guidBytes1[0]); + data->WriteByteSeq(guidBytes1[3]); + data->WriteByteSeq(guidBytes1[2]); + + *data << uint32(bg->GetClientInstanceID()); // Client Instance ID + + data->WriteByteSeq(guidBytes2[0]); + data->WriteByteSeq(guidBytes1[7]); break; + } + case STATUS_WAIT_LEAVE: + { + data->Initialize(SMSG_BATTLEFIELD_STATUS_WAITFORGROUPS, 48); + + *data << uint8(0); // unk + *data << uint32(bg->GetStatus()); // Status + *data << uint32(QueueSlot); // Queue slot + *data << uint32(Time1); // Time until closed + *data << uint32(0); // unk + *data << uint8(0); // unk + *data << uint8(0); // unk + *data << uint8(bg->GetMinLevel()); // Min Level + *data << uint8(0); // unk + *data << uint8(0); // unk + *data << uint32(bg->GetMapId()); // Map Id + *data << uint32(Time2); // Time + *data << uint8(0); // unk + + data->WriteBit(guidBytes2[0]); + data->WriteBit(guidBytes2[1]); + data->WriteBit(guidBytes2[7]); + data->WriteBit(guidBytes1[7]); + data->WriteBit(guidBytes1[0]); + data->WriteBit(guidBytes2[4]); + data->WriteBit(guidBytes1[6]); + data->WriteBit(guidBytes1[2]); + data->WriteBit(guidBytes1[3]); + data->WriteBit(guidBytes2[3]); + data->WriteBit(guidBytes1[4]); + data->WriteBit(guidBytes2[5]); + data->WriteBit(guidBytes1[5]); + data->WriteBit(guidBytes2[2]); + data->WriteBit(bg->isRated()); // Is Rated + data->WriteBit(guidBytes1[1]); + data->WriteBit(guidBytes2[6]); + + data->FlushBits(); + + data->WriteByteSeq(guidBytes1[0]); + data->WriteByteSeq(guidBytes2[4]); + data->WriteByteSeq(guidBytes1[3]); + data->WriteByteSeq(guidBytes2[1]); + data->WriteByteSeq(guidBytes2[0]); + data->WriteByteSeq(guidBytes2[2]); + data->WriteByteSeq(guidBytes1[2]); + data->WriteByteSeq(guidBytes2[7]); + data->WriteByteSeq(guidBytes1[1]); + data->WriteByteSeq(guidBytes1[6]); + data->WriteByteSeq(guidBytes2[6]); + data->WriteByteSeq(guidBytes2[5]); + data->WriteByteSeq(guidBytes1[5]); + data->WriteByteSeq(guidBytes1[4]); + data->WriteByteSeq(guidBytes1[7]); + data->WriteByteSeq(guidBytes2[3]); + break; + } } } @@ -419,12 +607,13 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg) data->put(wpos, scoreCount); } -void BattlegroundMgr::BuildGroupJoinedBattlegroundPacket(WorldPacket* data, GroupJoinBattlegroundResult result) +void BattlegroundMgr::BuildGroupJoinedBattlegroundPacket(WorldPacket* data, Battleground* bg, Player* pPlayer, GroupJoinBattlegroundResult result) { - data->Initialize(SMSG_GROUP_JOINED_BATTLEGROUND, 4); - *data << int32(result); - if (result == ERR_BATTLEGROUND_JOIN_TIMED_OUT || result == ERR_BATTLEGROUND_JOIN_FAILED) - *data << uint64(0); // player guid + ObjectGuid guidBytes1 = pPlayer->GetGUID(); + ObjectGuid guidBytes2 = bg->GetGUID(); + + data->Initialize(SMSG_BATTLEFIELD_STATUS_FAILED); + } void BattlegroundMgr::BuildUpdateWorldStatePacket(WorldPacket* data, uint32 field, uint32 value) @@ -442,14 +631,52 @@ void BattlegroundMgr::BuildPlaySoundPacket(WorldPacket* data, uint32 soundid) void BattlegroundMgr::BuildPlayerLeftBattlegroundPacket(WorldPacket* data, uint64 guid) { + ObjectGuid guidBytes = guid; + data->Initialize(SMSG_BATTLEGROUND_PLAYER_LEFT, 8); - *data << uint64(guid); + + data->WriteBit(guidBytes[7]); + data->WriteBit(guidBytes[6]); + data->WriteBit(guidBytes[2]); + data->WriteBit(guidBytes[4]); + data->WriteBit(guidBytes[5]); + data->WriteBit(guidBytes[1]); + data->WriteBit(guidBytes[3]); + data->WriteBit(guidBytes[0]); + + data->WriteByteSeq(guidBytes[4]); + data->WriteByteSeq(guidBytes[2]); + data->WriteByteSeq(guidBytes[5]); + data->WriteByteSeq(guidBytes[7]); + data->WriteByteSeq(guidBytes[0]); + data->WriteByteSeq(guidBytes[6]); + data->WriteByteSeq(guidBytes[1]); + data->WriteByteSeq(guidBytes[3]); } -void BattlegroundMgr::BuildPlayerJoinedBattlegroundPacket(WorldPacket* data, Player* player) +void BattlegroundMgr::BuildPlayerJoinedBattlegroundPacket(WorldPacket* data, uint64 guid) { + ObjectGuid guidBytes = guid; + data->Initialize(SMSG_BATTLEGROUND_PLAYER_JOINED, 8); - *data << uint64(player->GetGUID()); + + data->WriteBit(guidBytes[0]); + data->WriteBit(guidBytes[4]); + data->WriteBit(guidBytes[3]); + data->WriteBit(guidBytes[5]); + data->WriteBit(guidBytes[7]); + data->WriteBit(guidBytes[6]); + data->WriteBit(guidBytes[2]); + data->WriteBit(guidBytes[1]); + + data->WriteByteSeq(guidBytes[1]); + data->WriteByteSeq(guidBytes[5]); + data->WriteByteSeq(guidBytes[3]); + data->WriteByteSeq(guidBytes[2]); + data->WriteByteSeq(guidBytes[0]); + data->WriteByteSeq(guidBytes[7]); + data->WriteByteSeq(guidBytes[4]); + data->WriteByteSeq(guidBytes[6]); } Battleground* BattlegroundMgr::GetBattlegroundThroughClientInstance(uint32 instanceId, BattlegroundTypeId bgTypeId) @@ -846,63 +1073,66 @@ void BattlegroundMgr::BuildBattlegroundListPacket(WorldPacket* data, uint64 guid if (!player) return; - uint32 winner_kills = player->GetRandomWinner() ? BG_REWARD_WINNER_HONOR_LAST : BG_REWARD_WINNER_HONOR_FIRST; - uint32 winner_arena = player->GetRandomWinner() ? BG_REWARD_WINNER_ARENA_LAST : BG_REWARD_WINNER_ARENA_FIRST; - uint32 loser_kills = player->GetRandomWinner() ? BG_REWARD_LOSER_HONOR_LAST : BG_REWARD_LOSER_HONOR_FIRST; + uint32 winner_conquest = player->GetRandomWinner() ? BG_REWARD_WINNER_CONQUEST_FIRST : BG_REWARD_WINNER_CONQUEST_LAST; + uint32 winner_honor = player->GetRandomWinner() ? BG_REWARD_WINNER_HONOR_FIRST : BG_REWARD_WINNER_HONOR_LAST; + uint32 loser_honor = !player->GetRandomWinner() ? BG_REWARD_LOSER_HONOR_FIRST : BG_REWARD_LOSER_HONOR_LAST; - winner_kills = Trinity::Honor::hk_honor_at_level(player->getLevel(), float(winner_kills)); - loser_kills = Trinity::Honor::hk_honor_at_level(player->getLevel(), float(loser_kills)); + ObjectGuid guidBytes = guid; data->Initialize(SMSG_BATTLEFIELD_LIST); - // TODO: Fix guid - *data << uint64(guid); // battlemaster guid + *data << uint32(winner_conquest); // Winner Conquest Reward or Random Winner Conquest Reward + *data << uint32(winner_conquest); // Winner Conquest Reward or Random Winner Conquest Reward + *data << uint32(loser_honor); // Loser Honor Reward or Random Loser Honor Reward *data << uint32(bgTypeId); // battleground id - *data << uint8(0); // unk - *data << uint8(0); // unk - - // Rewards - *data << uint8(player->GetRandomWinner()); // 3.3.3 hasWin - *data << uint32(winner_kills); // 3.3.3 winHonor - *data << uint32(winner_arena); // 3.3.3 winArena - *data << uint32(loser_kills); // 3.3.3 lossHonor - - uint8 isRandom = bgTypeId == BATTLEGROUND_RB; - - *data << uint8(isRandom); // 3.3.3 isRandom - if (isRandom) - { - // Rewards (random) - *data << uint8(player->GetRandomWinner()); // 3.3.3 hasWin_Random - *data << uint32(winner_kills); // 3.3.3 winHonor_Random - *data << uint32(winner_arena); // 3.3.3 winArena_Random - *data << uint32(loser_kills); // 3.3.3 lossHonor_Random - } - - if (bgTypeId == BATTLEGROUND_AA) // arena - { - *data << uint32(0); // unk (count?) - } - else // battleground + *data << uint32(loser_honor); // Loser Honor Reward or Random Loser Honor Reward + *data << uint32(winner_honor); // Winner Honor Reward or Random Winner Honor Reward + *data << uint32(winner_honor); // Winner Honor Reward or Random Winner Honor Reward + *data << uint8(0); // max level + *data << uint8(0); // min level + + data->WriteBit(guidBytes[0]); + data->WriteBit(guidBytes[1]); + data->WriteBit(guidBytes[7]); + data->WriteBit(0); // unk + data->WriteBit(0); // unk + size_t count_pos = data->wpos(); + data->WriteBit(0); // bg instance count + + data->WriteBit(guidBytes[6]); + data->WriteBit(guidBytes[4]); + data->WriteBit(guidBytes[2]); + data->WriteBit(guidBytes[3]); + data->WriteBit(0); // unk + data->WriteBit(guidBytes[5]); + data->WriteBit(0); // unk + + data->FlushBits(); + + data->WriteByteSeq(guidBytes[6]); + data->WriteByteSeq(guidBytes[1]); + data->WriteByteSeq(guidBytes[7]); + data->WriteByteSeq(guidBytes[5]); + + if (Battleground* bgTemplate = sBattlegroundMgr->GetBattlegroundTemplate(bgTypeId)) { - size_t count_pos = data->wpos(); - *data << uint32(0); // number of bg instances - - if (Battleground* bgTemplate = sBattlegroundMgr->GetBattlegroundTemplate(bgTypeId)) + // expected bracket entry + if (PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bgTemplate->GetMapId(), player->getLevel())) { - // expected bracket entry - if (PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bgTemplate->GetMapId(), player->getLevel())) + uint32 count = 0; + BattlegroundBracketId bracketId = bracketEntry->GetBracketId(); + for (std::set::iterator itr = m_ClientBattlegroundIds[bgTypeId][bracketId].begin(); itr != m_ClientBattlegroundIds[bgTypeId][bracketId].end();++itr) { - uint32 count = 0; - BattlegroundBracketId bracketId = bracketEntry->GetBracketId(); - for (std::set::iterator itr = m_ClientBattlegroundIds[bgTypeId][bracketId].begin(); itr != m_ClientBattlegroundIds[bgTypeId][bracketId].end();++itr) - { - *data << uint32(*itr); - ++count; - } - data->put(count_pos, count); + *data << uint32(*itr); // instance id + ++count; } + data->put(count_pos, count); } } + + data->WriteByteSeq(guidBytes[0]); + data->WriteByteSeq(guidBytes[2]); + data->WriteByteSeq(guidBytes[4]); + data->WriteByteSeq(guidBytes[3]); } void BattlegroundMgr::SendToBattleground(Player* player, uint32 instanceId, BattlegroundTypeId bgTypeId) diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.h b/src/server/game/Battlegrounds/BattlegroundMgr.h index 4edad4da742..a161f36fc6d 100755 --- a/src/server/game/Battlegrounds/BattlegroundMgr.h +++ b/src/server/game/Battlegrounds/BattlegroundMgr.h @@ -66,14 +66,14 @@ class BattlegroundMgr void Update(uint32 diff); /* Packet Building */ - void BuildPlayerJoinedBattlegroundPacket(WorldPacket* data, Player* player); + void BuildPlayerJoinedBattlegroundPacket(WorldPacket* data, uint64 guid); void BuildPlayerLeftBattlegroundPacket(WorldPacket* data, uint64 guid); void BuildBattlegroundListPacket(WorldPacket* data, uint64 guid, Player* player, BattlegroundTypeId bgTypeId); - void BuildGroupJoinedBattlegroundPacket(WorldPacket* data, GroupJoinBattlegroundResult result); + void BuildGroupJoinedBattlegroundPacket(WorldPacket* data, Battleground* bg, Player* player, GroupJoinBattlegroundResult result); void BuildUpdateWorldStatePacket(WorldPacket* data, uint32 field, uint32 value); void BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg); - void BuildBattlegroundStatusPacket(WorldPacket* data, Battleground* bg, uint8 QueueSlot, uint8 StatusID, uint32 Time1, uint32 Time2, uint8 arenatype, uint8 uiFrame = 1); - void BuildPlaySoundPacket(WorldPacket* data, uint32 soundid); + void BuildBattlegroundStatusPacket(WorldPacket* data, Battleground* bg, Player* player, uint8 queueSlot, uint8 statusId, uint32 time1, uint32 time2, uint8 arenaType, uint8 uiFrame = 1); + void BuildPlaySoundPacket(WorldPacket* data, uint32 soundId); void SendAreaSpiritHealerQueryOpcode(Player* player, Battleground* bg, uint64 guid); /* Battlegrounds */ diff --git a/src/server/game/Battlegrounds/BattlegroundQueue.cpp b/src/server/game/Battlegrounds/BattlegroundQueue.cpp index 85d41977d13..7e7502b0538 100755 --- a/src/server/game/Battlegrounds/BattlegroundQueue.cpp +++ b/src/server/game/Battlegrounds/BattlegroundQueue.cpp @@ -391,7 +391,7 @@ void BattlegroundQueue::RemovePlayer(uint64 guid, bool decreaseInvitedCount) plr2->RemoveBattlegroundQueueId(bgQueueTypeId); // must be called this way, because if you move this call to // queue->removeplayer, it causes bugs WorldPacket data; - sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_NONE, 0, 0, 0); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, plr2, queueSlot, STATUS_NONE, 0, 0, 0); plr2->GetSession()->SendPacket(&data); } // then actually delete, this may delete the group as well! @@ -470,7 +470,7 @@ bool BattlegroundQueue::InviteGroupToBG(GroupQueueInfo* ginfo, Battleground* bg, sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: invited player %s (%u) to BG instance %u queueindex %u bgtype %u, I can't help it if they don't press the enter battle button.", player->GetName(), player->GetGUIDLow(), bg->GetInstanceID(), queueSlot, bg->GetTypeID()); // send status packet - sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_JOIN, INVITE_ACCEPT_WAIT_TIME, 0, ginfo->ArenaType); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, player, queueSlot, STATUS_WAIT_JOIN, INVITE_ACCEPT_WAIT_TIME, 0, ginfo->ArenaType); player->GetSession()->SendPacket(&data); } return true; @@ -1022,7 +1022,7 @@ bool BGQueueInviteEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/) { WorldPacket data; //we must send remaining time in queue - sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_JOIN, INVITE_ACCEPT_WAIT_TIME - INVITATION_REMIND_TIME, 0, m_ArenaType); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, player, queueSlot, STATUS_WAIT_JOIN, INVITE_ACCEPT_WAIT_TIME - INVITATION_REMIND_TIME, 0, m_ArenaType); player->GetSession()->SendPacket(&data); } } @@ -1070,7 +1070,7 @@ bool BGQueueRemoveEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/) sBattlegroundMgr->ScheduleQueueUpdate(0, 0, m_BgQueueTypeId, m_BgTypeId, bg->GetBracketId()); WorldPacket data; - sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_NONE, 0, 0, 0); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, player, queueSlot, STATUS_NONE, 0, 0, 0); player->GetSession()->SendPacket(&data); } } diff --git a/src/server/game/Entities/Object/ObjectDefines.h b/src/server/game/Entities/Object/ObjectDefines.h index 9fd4279a79c..b971943954e 100755 --- a/src/server/game/Entities/Object/ObjectDefines.h +++ b/src/server/game/Entities/Object/ObjectDefines.h @@ -43,6 +43,7 @@ enum HighGuid HIGHGUID_VEHICLE = 0xF15, // blizz F550 HIGHGUID_DYNAMICOBJECT = 0xF10, // blizz F100 HIGHGUID_CORPSE = 0xF101, // blizz F100 + HIGHGUID_TYPE_BATTLEGROUND = 0x1F1, // new 4.x HIGHGUID_MO_TRANSPORT = 0x1FC, // blizz 1FC0 (for GAMEOBJECT_TYPE_MO_TRANSPORT) HIGHGUID_GROUP = 0x1F5, HIGHGUID_GUILD = 0x1FF5, // new 4.x diff --git a/src/server/game/Handlers/BattleGroundHandler.cpp b/src/server/game/Handlers/BattleGroundHandler.cpp index d1da504008e..d3e28bd84d1 100755 --- a/src/server/game/Handlers/BattleGroundHandler.cpp +++ b/src/server/game/Handlers/BattleGroundHandler.cpp @@ -72,17 +72,35 @@ void WorldSession::SendBattleGroundList(uint64 guid, BattlegroundTypeId bgTypeId void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recvData) { - uint64 guid; uint32 bgTypeId_; uint32 instanceId; - uint8 joinAsGroup; + uint8 asGroup; bool isPremade = false; Group* grp = NULL; - - recvData >> guid; // battlemaster guid - recvData >> bgTypeId_; // battleground type id (DBC id) - recvData >> instanceId; // instance id, 0 if First Available selected - recvData >> joinAsGroup; // join as group + ObjectGuid guid; + + recvData >> instanceId; // Instance Id + guid[2] = recvData.ReadBit(); + guid[0] = recvData.ReadBit(); + guid[3] = recvData.ReadBit(); + guid[1] = recvData.ReadBit(); + guid[5] = recvData.ReadBit(); + asGroup = recvData.ReadBit(); // As Group + guid[4] = recvData.ReadBit(); + guid[6] = recvData.ReadBit(); + guid[7] = recvData.ReadBit(); + + recvData.ReadByteSeq(guid[2]); + recvData.ReadByteSeq(guid[6]); + recvData.ReadByteSeq(guid[4]); + recvData.ReadByteSeq(guid[3]); + recvData.ReadByteSeq(guid[7]); + recvData.ReadByteSeq(guid[0]); + recvData.ReadByteSeq(guid[5]); + recvData.ReadByteSeq(guid[1]); + + //extract from guid + bgTypeId_ = GUID_LOPART(guid); if (!sBattlemasterListStore.LookupEntry(bgTypeId_)) { @@ -95,10 +113,9 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recvData) ChatHandler(this).PSendSysMessage(LANG_BG_DISABLED); return; } - BattlegroundTypeId bgTypeId = BattlegroundTypeId(bgTypeId_); - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_BATTLEMASTER_JOIN Message from (GUID: %u TypeId:%u)", GUID_LOPART(guid), GuidHigh2TypeId(GUID_HIPART(guid))); + //sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_BATTLEMASTER_JOIN Message from (GUID:"UI64FMTD" TypeId:%u)", guid, bgTypeId_); // can do this, since it's battleground, not arena BattlegroundQueueTypeId bgQueueTypeId = BattlegroundMgr::BGQueueTypeId(bgTypeId, 0); @@ -126,13 +143,13 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recvData) GroupJoinBattlegroundResult err; // check queue conditions - if (!joinAsGroup) + if (!asGroup) { if (GetPlayer()->isUsingLfg()) { // player is using dungeon finder or raid finder WorldPacket data; - sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, ERR_LFG_CANT_USE_BATTLEGROUND); + sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, bg, _player, ERR_LFG_CANT_USE_BATTLEGROUND); GetPlayer()->GetSession()->SendPacket(&data); return; } @@ -141,7 +158,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recvData) if (!_player->CanJoinToBattleground()) { WorldPacket data; - sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, ERR_GROUP_JOIN_BATTLEGROUND_DESERTERS); + sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, bg, _player, ERR_GROUP_JOIN_BATTLEGROUND_DESERTERS); _player->GetSession()->SendPacket(&data); return; } @@ -150,7 +167,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recvData) { //player is already in random queue WorldPacket data; - sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, ERR_IN_RANDOM_BG); + sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, bg, _player, ERR_IN_RANDOM_BG); _player->GetSession()->SendPacket(&data); return; } @@ -159,7 +176,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recvData) { //player is already in queue, can't start random queue WorldPacket data; - sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, ERR_IN_NON_RANDOM_BG); + sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, bg, _player, ERR_IN_NON_RANDOM_BG); _player->GetSession()->SendPacket(&data); return; } @@ -173,7 +190,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recvData) if (!_player->HasFreeBattlegroundQueueId()) { WorldPacket data; - sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, ERR_BATTLEGROUND_TOO_MANY_QUEUES); + sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, bg, _player, ERR_BATTLEGROUND_TOO_MANY_QUEUES); _player->GetSession()->SendPacket(&data); return; } @@ -187,7 +204,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recvData) WorldPacket data; // send status packet (in queue) - sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, ginfo->ArenaType); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, _player, queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, ginfo->ArenaType); SendPacket(&data); sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: player joined queue for bg queue type %u bg type %u: GUID %u, NAME %s", bgQueueTypeId, bgTypeId, _player->GetGUIDLow(), _player->GetName()); } @@ -223,7 +240,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recvData) if (err <= 0) { - sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, err); + sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, bg, _player, err); member->GetSession()->SendPacket(&data); continue; } @@ -232,9 +249,9 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recvData) uint32 queueSlot = member->AddBattlegroundQueueId(bgQueueTypeId); // send status packet (in queue) - sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, ginfo->ArenaType); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, member, queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, ginfo->ArenaType); member->GetSession()->SendPacket(&data); - sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, err); + sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, bg, _player, err); member->GetSession()->SendPacket(&data); sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: player joined queue for bg queue type %u bg type %u: GUID %u, NAME %s", bgQueueTypeId, bgTypeId, member->GetGUIDLow(), member->GetName()); } @@ -246,13 +263,14 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recvData) void WorldSession::HandleBattlegroundPlayerPositionsOpcode(WorldPacket & /*recvData*/) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd MSG_BATTLEGROUND_PLAYER_POSITIONS Message"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_BATTLEGROUND_PLAYER_POSITIONS Message"); Battleground* bg = _player->GetBattleground(); if (!bg) // can't be received if player not in battleground return; - uint32 count = 0; + uint32 acount = 0; + uint32 hcount = 0; Player* aplr = NULL; Player* hplr = NULL; @@ -260,31 +278,75 @@ void WorldSession::HandleBattlegroundPlayerPositionsOpcode(WorldPacket & /*recvD { aplr = ObjectAccessor::FindPlayer(guid); if (aplr) - ++count; + ++acount; } if (uint64 guid = bg->GetFlagPickerGUID(BG_TEAM_HORDE)) { hplr = ObjectAccessor::FindPlayer(guid); if (hplr) - ++count; + ++hcount; } - WorldPacket data(MSG_BATTLEGROUND_PLAYER_POSITIONS, 4 + 4 + 16 * count); - data << 0; - data << count; - if (aplr) + ObjectGuid aguid = aplr ? aplr->GetGUID() : 0; + ObjectGuid hguid = hplr ? hplr->GetGUID() : 0; + + WorldPacket data(SMSG_BATTLEFIELD_PLAYER_POSITIONS); + + data.WriteBits(acount, 22); + for (uint8 i = 0; i < acount; i++) { - data << uint64(aplr->GetGUID()); - data << float(aplr->GetPositionX()); - data << float(aplr->GetPositionY()); + data.WriteBit(aguid[3]); + data.WriteBit(aguid[5]); + data.WriteBit(aguid[1]); + data.WriteBit(aguid[6]); + data.WriteBit(aguid[7]); + data.WriteBit(aguid[0]); + data.WriteBit(aguid[2]); + data.WriteBit(aguid[4]); } - if (hplr) + data.WriteBits(hcount, 22); + for (uint8 i = 0; i < hcount; i++) { - data << uint64(hplr->GetGUID()); - data << float(hplr->GetPositionX()); + data.WriteBit(hguid[6]); + data.WriteBit(hguid[5]); + data.WriteBit(hguid[4]); + data.WriteBit(hguid[7]); + data.WriteBit(hguid[2]); + data.WriteBit(hguid[1]); + data.WriteBit(hguid[0]); + data.WriteBit(hguid[3]); + } + + data.FlushBits(); + + for (uint8 i = 0; i < hcount; i++) + { + data.WriteByteSeq(hguid[2]); + data.WriteByteSeq(hguid[1]); data << float(hplr->GetPositionY()); + data.WriteByteSeq(hguid[5]); + data.WriteByteSeq(hguid[4]); + data.WriteByteSeq(hguid[7]); + data.WriteByteSeq(hguid[0]); + data.WriteByteSeq(hguid[6]); + data.WriteByteSeq(hguid[3]); + data << float(hplr->GetPositionX()); + } + + for (uint8 i = 0; i < acount; i++) + { + data.WriteByteSeq(aguid[6]); + data << float(aplr->GetPositionX()); + data.WriteByteSeq(aguid[5]); + data.WriteByteSeq(aguid[3]); + data << float(aplr->GetPositionY()); + data.WriteByteSeq(aguid[1]); + data.WriteByteSeq(aguid[7]); + data.WriteByteSeq(aguid[0]); + data.WriteByteSeq(aguid[2]); + data.WriteByteSeq(aguid[4]); } SendPacket(&data); @@ -394,7 +456,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData) { //send bg command result to show nice message WorldPacket data2; - sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data2, ERR_GROUP_JOIN_BATTLEGROUND_DESERTERS); + sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data2, bg, _player, ERR_GROUP_JOIN_BATTLEGROUND_DESERTERS); _player->GetSession()->SendPacket(&data2); action = 0; sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: player %s (%u) has a deserter debuff, do not port him to battleground!", _player->GetName(), _player->GetGUIDLow()); @@ -431,7 +493,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData) _player->CleanupAfterTaxiFlight(); } - sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_IN_PROGRESS, 0, bg->GetStartTime(), bg->GetArenaType()); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, _player, queueSlot, STATUS_IN_PROGRESS, 0, bg->GetStartTime(), bg->GetArenaType()); _player->GetSession()->SendPacket(&data); // remove battleground queue status from BGmgr bgQueue.RemovePlayer(_player->GetGUID(), false); @@ -463,7 +525,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData) } } _player->RemoveBattlegroundQueueId(bgQueueTypeId); // must be called this way, because if you move this call to queue->removeplayer, it causes bugs - sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_NONE, 0, 0, 0); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, _player, queueSlot, STATUS_NONE, 0, 0, 0); bgQueue.RemovePlayer(_player->GetGUID(), true); // player left queue, we should update it - do not update Arena Queue if (!ginfo.ArenaType) @@ -519,7 +581,7 @@ void WorldSession::HandleBattlefieldStatusOpcode(WorldPacket & /*recvData*/) { // this line is checked, i only don't know if GetStartTime is changing itself after bg end! // send status in Battleground - sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, i, STATUS_IN_PROGRESS, bg->GetEndTime(), bg->GetStartTime(), arenaType); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, GetPlayer(), i, STATUS_IN_PROGRESS, bg->GetEndTime(), bg->GetStartTime(), arenaType); SendPacket(&data); continue; } @@ -537,7 +599,7 @@ void WorldSession::HandleBattlefieldStatusOpcode(WorldPacket & /*recvData*/) continue; uint32 remainingTime = getMSTimeDiff(getMSTime(), ginfo.RemoveInviteTime); // send status invited to Battleground - sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, i, STATUS_WAIT_JOIN, remainingTime, 0, arenaType); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, GetPlayer(), i, STATUS_WAIT_JOIN, remainingTime, 0, arenaType); SendPacket(&data); } else @@ -553,7 +615,7 @@ void WorldSession::HandleBattlefieldStatusOpcode(WorldPacket & /*recvData*/) uint32 avgTime = bgQueue.GetAverageQueueWaitTime(&ginfo, bracketEntry->GetBracketId()); // send status in Battleground Queue - sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, i, STATUS_WAIT_QUEUE, avgTime, getMSTimeDiff(ginfo.JoinTime, getMSTime()), arenaType); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, GetPlayer(), i, STATUS_WAIT_QUEUE, avgTime, getMSTimeDiff(ginfo.JoinTime, getMSTime()), arenaType); SendPacket(&data); } } @@ -696,7 +758,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recvData) if (err <= 0) { - sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, err); + sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, bg, _player, err); member->GetSession()->SendPacket(&data); continue; } @@ -705,9 +767,9 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recvData) uint32 queueSlot = member->AddBattlegroundQueueId(bgQueueTypeId); // send status packet (in queue) - sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, arenatype); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, member, queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, arenatype); member->GetSession()->SendPacket(&data); - sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, err); + sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, bg, _player, err); member->GetSession()->SendPacket(&data); sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: player joined queue for arena as group bg queue type %u bg type %u: GUID %u, NAME %s", bgQueueTypeId, bgTypeId, member->GetGUIDLow(), member->GetName()); } @@ -720,7 +782,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recvData) WorldPacket data; // send status packet (in queue) - sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, arenatype); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, GetPlayer(), queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, arenatype); SendPacket(&data); sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: player joined queue for arena, skirmish, bg queue type %u bg type %u: GUID %u, NAME %s", bgQueueTypeId, bgTypeId, _player->GetGUIDLow(), _player->GetName()); } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 320cebe5a89..94713013d4c 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -101,14 +101,14 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_BANKER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBankerActivateOpcode ); DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_LEAVE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlefieldListOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_ENTRY_INVITE_RESPONSE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_EXIT_REQUEST, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_QUEUE_INVITE_RESPONSE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_ENTRY_INVITE_RESPONSE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleBfEntryInviteResponse ); + DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_EXIT_REQUEST, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleBfExitRequest ); + DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_QUEUE_INVITE_RESPONSE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleBfQueueInviteResponse ); DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_QUEUE_REQUEST, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_PORT, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleBattleFieldPortOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_PORT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattleFieldPortOpcode ); DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_STATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlefieldStatusOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_BATTLEGROUND_PLAYER_POSITIONS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_JOIN, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlemasterJoinOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_BATTLEGROUND_PLAYER_POSITIONS, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleBattlegroundPlayerPositionsOpcode); + DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_JOIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlemasterJoinOpcode ); DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_JOIN_ARENA, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlemasterJoinArena ); DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_JOIN_RATED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_BEGIN_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBeginTradeOpcode ); @@ -664,26 +664,27 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_AVAILABLE_VOICE_CHANNEL, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_AVERAGE_ITEM_LEVEL_INFORM, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_BARBER_SHOP_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_LIST, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_EJECTED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_EJECTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_EJECT_PENDING, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_ENTERED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_ENTRY_INVITE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_ENTERED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_ENTRY_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_EXIT_REQUEST, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_QUEUE_INVITE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_QUEUE_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_STATE_CHANGE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_PLAYER_POSITIONS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_PLAYER_POSITIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_PORT_DENIED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_RATED_INFO, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS2, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS3, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS4, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS_FAILED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS_QUEUED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS_ACTIVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS_NEEDCONFIRMATION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS_WAITFORGROUPS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_INFO_THROTTLED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_PLAYER_JOINED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_PLAYER_LEFT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_PLAYER_JOINED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_PLAYER_LEFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_BINDER_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_BINDPOINTUPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_BREAK_TARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -840,8 +841,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_GROUP_DECLINE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GROUP_DESTROYED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GROUP_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GROUP_JOINED_BATTLEGROUND, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GROUP_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GROUP_LIST, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GROUP_SET_LEADER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GROUP_SET_ROLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GROUP_UNINVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1550,7 +1550,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_WEATHER_SPEED_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_XP_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_ZONE_MAP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_BATTLEGROUND_PLAYER_POSITIONS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlegroundPlayerPositionsOpcode); //DEFINE_OPCODE_HANDLER(MSG_DELAY_GHOST_TELEPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_DEV_SHOWLABEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_GM_ACCOUNT_ONLINE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -1592,8 +1591,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(MSG_VIEW_PHASE_SHIFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(SMSG_AFK_MONITOR_INFO_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_AURACASTLOG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS1, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_BATTLEGROUND_PLAYER_POSITIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BINDZONEREPLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_BUY_BANK_SLOT_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_ACTION_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 342a9974ec0..da881a7eb5b 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -588,7 +588,6 @@ enum Opcodes CMSG_WRAP_ITEM = 0x4F06, CMSG_ZONEUPDATE = 0x4F37, MSG_AUCTION_HELLO = 0x2307, - MSG_BATTLEGROUND_PLAYER_POSITIONS = 0x0000, MSG_CHANNEL_START = 0x0A15, // SMSG only? MSG_CHANNEL_UPDATE = 0x2417, // SMSG only? MSG_CORPSE_QUERY = 0x4336, @@ -729,15 +728,14 @@ enum Opcodes SMSG_BATTLEFIELD_PORT_DENIED = 0x35A3, SMSG_BATTLEFIELD_RATED_INFO = 0x54A3, SMSG_BATTLEFIELD_STATUS = 0x7DA1, - SMSG_BATTLEFIELD_STATUS1 = 0x0000, - SMSG_BATTLEFIELD_STATUS2 = 0x74A4, - SMSG_BATTLEFIELD_STATUS3 = 0x59A0, - SMSG_BATTLEFIELD_STATUS4 = 0x75A2, + SMSG_BATTLEFIELD_STATUS_QUEUED = 0x35A1, + SMSG_BATTLEFIELD_STATUS_ACTIVE = 0x74A4, + SMSG_BATTLEFIELD_STATUS_NEEDCONFIRMATION = 0x59A0, + SMSG_BATTLEFIELD_STATUS_WAITFORGROUPS = 0x75A2, SMSG_BATTLEFIELD_STATUS_FAILED = 0x71A7, SMSG_BATTLEGROUND_INFO_THROTTLED = 0x34B2, SMSG_BATTLEGROUND_PLAYER_JOINED = 0x50B0, SMSG_BATTLEGROUND_PLAYER_LEFT = 0x59A6, - SMSG_BATTLEGROUND_PLAYER_POSITIONS = 0x0000, SMSG_BINDER_CONFIRM = 0x2835, SMSG_BINDPOINTUPDATE = 0x0527, SMSG_BINDZONEREPLY = 0x0000, @@ -908,7 +906,6 @@ enum Opcodes SMSG_GROUP_DECLINE = 0x6835, SMSG_GROUP_DESTROYED = 0x2207, SMSG_GROUP_INVITE = 0x31B2, - SMSG_GROUP_JOINED_BATTLEGROUND = 0x35A1, SMSG_GROUP_LIST = 0x4C24, SMSG_GROUP_SET_LEADER = 0x0526, SMSG_GROUP_SET_ROLE = 0x39A6, diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 6770c3244ed..44b259bdfc4 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -809,14 +809,14 @@ class WorldSession void HandleInstanceLockResponse(WorldPacket& recvPacket); // Battlefield - void SendBfInvitePlayerToWar(uint32 BattleId,uint32 ZoneId,uint32 time); - void SendBfInvitePlayerToQueue(uint32 BattleId); - void SendBfQueueInviteResponse(uint32 BattleId,uint32 ZoneId, bool CanQueue = true, bool Full = false); - void SendBfEntered(uint32 BattleId); - void SendBfLeaveMessage(uint32 BattleId, BFLeaveReason reason = BF_LEAVE_REASON_EXITED); - void HandleBfQueueInviteResponse(WorldPacket &recv_data); - void HandleBfEntryInviteResponse(WorldPacket &recv_data); - void HandleBfExitRequest(WorldPacket &recv_data); + void SendBfInvitePlayerToWar(uint64 guid, uint32 zoneId, uint32 pTime); + void SendBfInvitePlayerToQueue(uint64 guid); + void SendBfQueueInviteResponse(uint64 guid, uint32 zoneId, bool canQueue = true, bool full = false); + void SendBfEntered(uint64 guid); + void SendBfLeaveMessage(uint64 guid, BFLeaveReason reason = BF_LEAVE_REASON_EXITED); + void HandleBfQueueInviteResponse(WorldPacket& recvData); + void HandleBfEntryInviteResponse(WorldPacket& recvData); + void HandleBfExitRequest(WorldPacket& recvData); // Looking for Dungeon/Raid void HandleLfgSetCommentOpcode(WorldPacket& recvData); -- cgit v1.2.3 From adb6ae7770ee27c87ca255233ca57135bc3b02b3 Mon Sep 17 00:00:00 2001 From: Nay Date: Wed, 29 Aug 2012 14:06:52 +0100 Subject: Core: Add missing include to BfHandler (thanks Chevron) and a typo in HandleRequestPartyMemberStatsOpcode (thanks Kaelima) --- src/server/game/Battlefield/BattlefieldHandler.cpp | 1 + src/server/game/Handlers/GroupHandler.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Battlefield/BattlefieldHandler.cpp b/src/server/game/Battlefield/BattlefieldHandler.cpp index ddb903a6d4e..aac9ac42392 100644 --- a/src/server/game/Battlefield/BattlefieldHandler.cpp +++ b/src/server/game/Battlefield/BattlefieldHandler.cpp @@ -21,6 +21,7 @@ #include "ObjectMgr.h" #include "WorldPacket.h" #include "WorldSession.h" +#include "Object.h" #include "Battlefield.h" #include "BattlefieldMgr.h" diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp index a624c4ef2bd..13f1c5af9ec 100644 --- a/src/server/game/Handlers/GroupHandler.cpp +++ b/src/server/game/Handlers/GroupHandler.cpp @@ -1182,8 +1182,8 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket& recvData) // GROUP_UPDATE_FLAG_AURAS data << uint8(1); uint64 auramask = 0; - data << uint64(auramask); // placeholder size_t maskPos = data.wpos(); + data << uint64(auramask); // placeholder data << uint32(MAX_AURAS); // count for (uint8 i = 0; i < MAX_AURAS; ++i) { -- cgit v1.2.3 From 3d1f8fd29223bfa4d59bd2390722998311244b7c Mon Sep 17 00:00:00 2001 From: Nay Date: Wed, 29 Aug 2012 15:47:30 +0100 Subject: Core/Groups: Enable SMSG_GROUP_LIST and correct position of petauramask --- src/server/game/Handlers/GroupHandler.cpp | 2 +- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp index 13f1c5af9ec..936f387a68a 100644 --- a/src/server/game/Handlers/GroupHandler.cpp +++ b/src/server/game/Handlers/GroupHandler.cpp @@ -1223,8 +1223,8 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket& recvData) // GROUP_UPDATE_FLAG_PET_AURAS data << uint8(1); uint64 petauramask = 0; - data << uint64(petauramask); // placeholder size_t petMaskPos = data.wpos(); + data << uint64(petauramask); // placeholder data << uint32(MAX_AURAS); // count for (uint8 i = 0; i < MAX_AURAS; ++i) { diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 94713013d4c..671cec2905e 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -841,7 +841,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_GROUP_DECLINE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GROUP_DESTROYED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GROUP_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GROUP_LIST, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GROUP_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GROUP_SET_LEADER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GROUP_SET_ROLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GROUP_UNINVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From 5ab5cbcd2caf5169fb4b4cf88eaf3314ce60329f Mon Sep 17 00:00:00 2001 From: Nay Date: Fri, 31 Aug 2012 17:48:05 +0100 Subject: Core/Loading: Fix a typo when loading creature_template --- src/server/game/Globals/ObjectMgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 8a0242fe865..2f128a70b02 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -370,7 +370,7 @@ void ObjectMgr::LoadCreatureTemplates() // 9 10 11 12 13 14 15 16 17 18 19 20 21 "modelid4, name, subname, IconName, gossip_menu_id, minlevel, maxlevel, exp, exp_unk, faction_A, faction_H, npcflag, speed_walk, " // 22 23 24 25 26 27 28 29 30 31 32 33 34 - "speed_run, scale, rank, mindmg, maxdmg, dmgschool, attackpower, dmg_multiplier, baseattacktime, rangeattacktime, unit_class, unit_flags, unit_flags2 " + "speed_run, scale, rank, mindmg, maxdmg, dmgschool, attackpower, dmg_multiplier, baseattacktime, rangeattacktime, unit_class, unit_flags, unit_flags2, " // 35 36 37 38 39 40 41 42 43 44 "dynamicflags, family, trainer_type, trainer_spell, trainer_class, trainer_race, minrangedmg, maxrangedmg, rangedattackpower, type, " // 45 46 47 48 49 50 51 52 53 54 55 -- cgit v1.2.3 From 8bfdfd18cd97fc80846809eae80e81e1315d329e Mon Sep 17 00:00:00 2001 From: Nay Date: Fri, 31 Aug 2012 19:48:26 +0100 Subject: Scripts: Fix a merge issue, thanks cyberbrest --- src/server/scripts/Kalimdor/silithus.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'src') diff --git a/src/server/scripts/Kalimdor/silithus.cpp b/src/server/scripts/Kalimdor/silithus.cpp index 44a68355a4e..1fe945b06d4 100644 --- a/src/server/scripts/Kalimdor/silithus.cpp +++ b/src/server/scripts/Kalimdor/silithus.cpp @@ -224,9 +224,6 @@ public: }; - Unit* mob = NULL; - Unit* target = NULL; - /*### ## go_wind_stone ###*/ -- cgit v1.2.3 From c0602889b57b3a6ab07a7d8ba9b4b91a560f086e Mon Sep 17 00:00:00 2001 From: kaelima Date: Sat, 1 Sep 2012 05:03:15 +0200 Subject: Core/PacketIO: - Rename and fix: CMSG_INSPECT_HONOR_STATS and SMSG_INSPECT_HONOR_STATS. - Replaced SMSG_TRAINER_BUY_SUCCEEDED with new SMSG_TRAINER_SERVICE. - Fix sending SMSG_PLAY_SPELL_VISUAL_KIT and removed obsolate SMSG_PLAY_SPELL_IMPACT. Thanks to mangos --- src/server/game/Entities/Unit/Unit.cpp | 16 +++------- src/server/game/Entities/Unit/Unit.h | 13 +++++--- src/server/game/Guilds/Guild.h | 1 + src/server/game/Handlers/MiscHandler.cpp | 48 ++++++++++++++++++++++++----- src/server/game/Handlers/NPCHandler.cpp | 45 ++++++++++++++++++--------- src/server/game/Server/Protocol/Opcodes.cpp | 9 ++---- src/server/game/Server/Protocol/Opcodes.h | 6 ++-- src/server/game/Server/WorldSession.h | 1 + 8 files changed, 89 insertions(+), 50 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 1db8b93f9ee..42fa018d7b2 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -15655,14 +15655,14 @@ void Unit::SetAuraStack(uint32 spellId, Unit* target, uint32 stack) aura->SetStackAmount(stack); } -void Unit::SendPlaySpellVisual(uint32 id) +void Unit::SendPlaySpellVisualKit(uint32 id, uint32 unkParam) { ObjectGuid guid = GetGUID(); - WorldPacket data(SMSG_PLAY_SPELL_VISUAL, 4 * 3 + 8); - data << uint32(0); - data << uint32(id); // SpellVisualKit.dbc index + WorldPacket data(SMSG_PLAY_SPELL_VISUAL_KIT, 4 + 4+ 4 + 8); data << uint32(0); + data << uint32(id); // SpellVisualKit.dbc index + data << uint32(unkParam); data.WriteBit(guid[4]); data.WriteBit(guid[7]); data.WriteBit(guid[5]); @@ -15683,14 +15683,6 @@ void Unit::SendPlaySpellVisual(uint32 id) SendMessageToSet(&data, false); } -void Unit::SendPlaySpellImpact(uint64 guid, uint32 id) -{ - WorldPacket data(SMSG_PLAY_SPELL_IMPACT, 8 + 4); - data << uint64(guid); // target - data << uint32(id); // SpellVisualKit.dbc index - SendMessageToSet(&data, false); -} - void Unit::ApplyResilience(Unit const* victim, float* crit, int32* damage, bool isCrit, CombatRating type) const { // player mounted on multi-passenger mount is also classified as vehicle diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index d5bfaff5e87..4e68ae9a3a0 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1579,8 +1579,7 @@ class Unit : public WorldObject Aura* AddAura(uint32 spellId, Unit* target); Aura* AddAura(SpellInfo const* spellInfo, uint8 effMask, Unit* target); void SetAuraStack(uint32 spellId, Unit* target, uint32 stack); - void SendPlaySpellVisual(uint32 id); - void SendPlaySpellImpact(uint64 guid, uint32 id); + void SendPlaySpellVisualKit(uint32 id, uint32 unkParam); void DeMorph(); @@ -2199,10 +2198,14 @@ class Unit : public WorldObject virtual bool isBeingLoaded() const { return false;} bool IsDuringRemoveFromWorld() const {return m_duringRemoveFromWorld;} - Pet* ToPet(){ if (isPet()) return reinterpret_cast(this); else return NULL; } - Totem* ToTotem(){ if (isTotem()) return reinterpret_cast(this); else return NULL; } + Pet* ToPet() { if (isPet()) return reinterpret_cast(this); else return NULL; } + Pet const* ToPet() const { if (isPet()) return reinterpret_cast(this); else return NULL; } + + Totem* ToTotem() { if (isTotem()) return reinterpret_cast(this); else return NULL; } + Totem const* ToTotem() const { if (isTotem()) return reinterpret_cast(this); else return NULL; } + TempSummon* ToTempSummon() { if (isSummon()) return reinterpret_cast(this); else return NULL; } - const TempSummon* ToTempSummon() const { if (isSummon()) return reinterpret_cast(this); else return NULL; } + TempSummon const* ToTempSummon() const { if (isSummon()) return reinterpret_cast(this); else return NULL; } void SetTarget(uint64 guid) { diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h index bb94fdbb0f1..1adf1675c45 100755 --- a/src/server/game/Guilds/Guild.h +++ b/src/server/game/Guilds/Guild.h @@ -708,6 +708,7 @@ public: void DeleteMember(uint64 guid, bool isDisbanding = false, bool isKicked = false); bool ChangeMemberRank(uint64 guid, uint8 newRank); bool IsMember(uint64 guid); + uint32 GetMembersCount() { return m_members.size(); } // Bank void SwapItems(Player* player, uint8 tabId, uint8 slotId, uint8 destTabId, uint8 destSlotId, uint32 splitedAmount); diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 76aae192c41..18ec0067623 100644 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -1253,29 +1253,61 @@ void WorldSession::HandleInspectOpcode(WorldPacket& recvData) data << uint64(guild->GetGUID()); data << uint32(guild->GetLevel()); data << uint64(0/*guild->GetXP()*/); - data << uint32(0/*guild->GetMembersCount()*/); // number of members + data << uint32(guild->GetMembersCount()); } SendPacket(&data); } void WorldSession::HandleInspectHonorStatsOpcode(WorldPacket& recvData) { - uint64 guid; - recvData >> guid; + ObjectGuid guid; + guid[1] = recvData.ReadBit(); + guid[5] = recvData.ReadBit(); + guid[7] = recvData.ReadBit(); + guid[3] = recvData.ReadBit(); + guid[2] = recvData.ReadBit(); + guid[4] = recvData.ReadBit(); + guid[0] = recvData.ReadBit(); + guid[6] = recvData.ReadBit(); + recvData.ReadByteSeq(guid[4]); + recvData.ReadByteSeq(guid[7]); + recvData.ReadByteSeq(guid[0]); + recvData.ReadByteSeq(guid[5]); + recvData.ReadByteSeq(guid[1]); + recvData.ReadByteSeq(guid[6]); + recvData.ReadByteSeq(guid[2]); + recvData.ReadByteSeq(guid[3]); Player* player = ObjectAccessor::FindPlayer(guid); if (!player) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "MSG_INSPECT_HONOR_STATS: No player found from GUID: " UI64FMTD, guid); + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_INSPECT_HONOR_STATS: No player found from GUID: " UI64FMTD, guid); return; } - WorldPacket data(SMSG_INSPECT_HONOR_STATS, 4+1+4+8); - data << uint32(player->GetUInt32Value(PLAYER_FIELD_KILLS)); - data << uint8(0); // rank + ObjectGuid playerGuid = player->GetGUID(); + WorldPacket data(SMSG_INSPECT_HONOR_STATS, 8+1+4+4); + data.WriteBit(playerGuid[4]); + data.WriteBit(playerGuid[3]); + data.WriteBit(playerGuid[6]); + data.WriteBit(playerGuid[2]); + data.WriteBit(playerGuid[5]); + data.WriteBit(playerGuid[0]); + data.WriteBit(playerGuid[7]); + data.WriteBit(playerGuid[1]); + data << uint8(0); // rank + data << uint16(player->GetUInt16Value(PLAYER_FIELD_KILLS, 1)); // yesterday kills + data << uint16(player->GetUInt16Value(PLAYER_FIELD_KILLS, 0)); // today kills + data.WriteByteSeq(playerGuid[2]); + data.WriteByteSeq(playerGuid[0]); + data.WriteByteSeq(playerGuid[6]); + data.WriteByteSeq(playerGuid[3]); + data.WriteByteSeq(playerGuid[4]); + data.WriteByteSeq(playerGuid[1]); + data.WriteByteSeq(playerGuid[5]); data << uint32(player->GetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS)); - data << uint64(player->GetGUID()); + data.WriteByteSeq(playerGuid[7]); SendPacket(&data); } diff --git a/src/server/game/Handlers/NPCHandler.cpp b/src/server/game/Handlers/NPCHandler.cpp index 32636d51f49..749c0254571 100755 --- a/src/server/game/Handlers/NPCHandler.cpp +++ b/src/server/game/Handlers/NPCHandler.cpp @@ -236,13 +236,13 @@ void WorldSession::SendTrainerList(uint64 guid, const std::string& strTitle) SendPacket(&data); } -void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket & recvData) +void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket& recvData) { uint64 guid; - uint32 spellId = 0; - int32 unkInt; + uint32 spellId; + uint32 trainerId; - recvData >> guid >> unkInt >> spellId; + recvData >> guid >> trainerId >> spellId; sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_TRAINER_BUY_SPELL NpcGUID=%u, learn spell id is: %u", uint32(GUID_LOPART(guid)), spellId); Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TRAINER); @@ -257,33 +257,48 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket & recvData) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); if (!unit->isCanTrainingOf(_player, true)) + { + SendTrainerService(guid, spellId, 0); return; + } // check present spell in trainer spell list TrainerSpellData const* trainer_spells = unit->GetTrainerSpells(); if (!trainer_spells) + { + SendTrainerService(guid, spellId, 0); return; + } // not found, cheat? TrainerSpell const* trainer_spell = trainer_spells->Find(spellId); if (!trainer_spell) + { + SendTrainerService(guid, spellId, 0); return; + } // can't be learn, cheat? Or double learn with lags... if (_player->GetTrainerSpellState(trainer_spell) != TRAINER_SPELL_GREEN) + { + SendTrainerService(guid, spellId, 0); return; + } // apply reputation discount uint32 nSpellCost = uint32(floor(trainer_spell->spellCost * _player->GetReputationPriceDiscount(unit))); // check money requirement if (!_player->HasEnoughMoney(uint64(nSpellCost))) + { + SendTrainerService(guid, spellId, 1); return; + } _player->ModifyMoney(-int64(nSpellCost)); - unit->SendPlaySpellVisual(179); // 53 SpellCastDirected - unit->SendPlaySpellImpact(_player->GetGUID(), 362); // 113 EmoteSalute + unit->SendPlaySpellVisualKit(179, 0); // 53 SpellCastDirected + _player->SendPlaySpellVisualKit(362, 1); // 113 EmoteSalute // learn explicitly or cast explicitly if (trainer_spell->IsCastable()) @@ -291,10 +306,15 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket & recvData) else _player->learnSpell(spellId, false); - WorldPacket data(SMSG_TRAINER_BUY_SUCCEEDED, 12); + SendTrainerService(guid, spellId, 2); +} + +void WorldSession::SendTrainerService(uint64 guid, uint32 spellId, uint32 result) +{ + WorldPacket data(SMSG_TRAINER_SERVICE, 16); data << uint64(guid); - data << uint32(spellId); // should be same as in packet from client - data << uint32(0); // "Trainer service", 1 = "Not enough money for trainer service ". 0 = "Trainer service unavailable" + data << uint32(spellId); // should be same as in packet from client + data << uint32(result); // 2 == Success. 1 == "Not enough money for trainer service." 0 == "Trainer service %d unavailable." SendPacket(&data); } @@ -490,12 +510,7 @@ void WorldSession::SendBindPoint(Creature* npc) // send spell for homebinding (3286) npc->CastSpell(_player, bindspell, true); - WorldPacket data(SMSG_TRAINER_BUY_SUCCEEDED, (8+4)); - data << uint64(npc->GetGUID()); - data << uint32(bindspell); - data << uint32(0); // "Trainer service", 1 = "Not enough money for trainer service ". 0 = "Trainer service unavailable" - SendPacket(&data); - + SendTrainerService(npc->GetGUID(), bindspell, 2); _player->PlayerTalkClass->SendCloseGossip(); } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 671cec2905e..42cd6fc0a32 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -450,7 +450,6 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_REQUEST_ACCOUNT_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestAccountData ); DEFINE_OPCODE_HANDLER(CMSG_REQUEST_CATEGORY_COOLDOWNS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_REQUEST_CEMETERY_LIST, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_REQUEST_HONOR_STATS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_REQUEST_HOTFIX, STATUS_AUTHED, PROCESS_INPLACE, &WorldSession::HandleRequestHotfix ); DEFINE_OPCODE_HANDLER(CMSG_REQUEST_INSPECT_RATED_BG_STATS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PARTY_MEMBER_STATS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestPartyMemberStatsOpcode); @@ -898,7 +897,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_INITIAL_SPELLS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_INIT_CURRENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_INIT_WORLD_STATES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_INSPECT_HONOR_STATS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_INSPECT_HONOR_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_INSPECT_RATED_BG_STATS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_INSPECT_RESULTS_UPDATE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_INSPECT_TALENT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1245,8 +1244,8 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_TRADE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TRADE_STATUS_EXTENDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_FAILED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_SUCCEEDED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TRAINER_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TRAINER_SERVICE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TRANSFER_ABORTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TRANSFER_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TRIGGER_CINEMATIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1560,7 +1559,7 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(MSG_GM_RESETINSTANCELIMIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_GM_SHOWLABEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_GM_SUMMON, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(MSG_INSPECT_HONOR_STATS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectHonorStatsOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_INSPECT_HONOR_STATS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectHonorStatsOpcode ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_FEATHER_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_GRAVITY_CHNG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -1664,7 +1663,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_NPC_WONT_TALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PET_UNLEARN_CONFIRM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PLAYER_UNK_DEAD_ALIVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_PLAY_SPELL_IMPACT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PROFILEDATA_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PUREMOUNT_CANCELLED_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_PVP_QUEUE_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1699,7 +1697,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_SWIM_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_TURN_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SPLINE_SET_WALK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_ADJUST_PRIORITY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_ENABLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_ZONE_MAP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index da881a7eb5b..6c0ac6c88f3 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -284,6 +284,7 @@ enum Opcodes CMSG_IGNORE_TRADE = 0x7112, CMSG_INITIATE_TRADE = 0x7916, CMSG_INSPECT = 0x0927, + CMSG_INSPECT_HONOR_STATS = 0x791E, CMSG_INSTANCE_LOCK_WARNING_RESPONSE = 0x6234, CMSG_ITEM_REFUND = 0x6134, CMSG_ITEM_REFUND_INFO = 0x2206, @@ -463,7 +464,6 @@ enum Opcodes CMSG_REQUEST_ACCOUNT_DATA = 0x6505, CMSG_REQUEST_CATEGORY_COOLDOWNS = 0x7102, CMSG_REQUEST_CEMETERY_LIST = 0x720A, - CMSG_REQUEST_HONOR_STATS = 0x791E, CMSG_REQUEST_HOTFIX = 0x2401, CMSG_REQUEST_INSPECT_RATED_BG_STATS = 0x3010, CMSG_REQUEST_PARTY_MEMBER_STATS = 0x0C04, @@ -1170,7 +1170,6 @@ enum Opcodes SMSG_PLAY_MUSIC = 0x4B06, SMSG_PLAY_OBJECT_SOUND = 0x2635, SMSG_PLAY_SOUND = 0x2134, - SMSG_PLAY_SPELL_IMPACT = 0x0000, SMSG_PLAY_SPELL_VISUAL = 0x10B1, SMSG_PLAY_SPELL_VISUAL_KIT = 0x55A5, SMSG_PLAY_TIME_WARNING = 0x4814, @@ -1342,9 +1341,8 @@ enum Opcodes SMSG_TRADE_STATUS = 0x5CA3, SMSG_TRADE_STATUS_EXTENDED = 0x70A2, SMSG_TRAINER_BUY_FAILED = 0x0004, - SMSG_TRAINER_BUY_RESULT = 0x0000, - SMSG_TRAINER_BUY_SUCCEEDED = 0x6A05, SMSG_TRAINER_LIST = 0x4414, + SMSG_TRAINER_SERVICE = 0x6A05, SMSG_TRANSFER_ABORTED = 0x0537, SMSG_TRANSFER_PENDING = 0x18A6, SMSG_TRIGGER_CINEMATIC = 0x6C27, diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 44b259bdfc4..8ee09e55c72 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -619,6 +619,7 @@ class WorldSession void HandleStableRevivePet(WorldPacket& recvPacket); void HandleStableSwapPet(WorldPacket& recvPacket); void HandleStableSwapPetCallback(PreparedQueryResult result, uint32 petId); + void SendTrainerService(uint64 guid, uint32 spellId, uint32 trainState); void HandleDuelAcceptedOpcode(WorldPacket& recvPacket); void HandleDuelCancelledOpcode(WorldPacket& recvPacket); -- cgit v1.2.3 From 859b7060790344654606fda6180a82bfb54aa634 Mon Sep 17 00:00:00 2001 From: kaelima Date: Sat, 1 Sep 2012 05:39:19 +0200 Subject: Core/PacketIO: Refix SMSG_TRAINER_BUY_SUCCEEDED and actually activate SMSG_PLAY_SPELL_VISUAL_KIT ref commit c0602889b57b3a6ab07a7d8ba9b4b91a560f086e --- src/server/game/Entities/Unit/Unit.cpp | 2 +- src/server/game/Handlers/NPCHandler.cpp | 27 +++++++++++++++++---------- src/server/game/Server/Protocol/Opcodes.cpp | 8 ++++---- src/server/game/Server/Protocol/Opcodes.h | 2 +- src/server/game/Server/WorldSession.h | 2 +- 5 files changed, 24 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 42fa018d7b2..19c522eff87 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -15680,7 +15680,7 @@ void Unit::SendPlaySpellVisualKit(uint32 id, uint32 unkParam) data.WriteByteSeq(guid[2]); data.WriteByteSeq(guid[3]); data.WriteByteSeq(guid[5]); - SendMessageToSet(&data, false); + SendMessageToSet(&data, true); } void Unit::ApplyResilience(Unit const* victim, float* crit, int32* damage, bool isCrit, CombatRating type) const diff --git a/src/server/game/Handlers/NPCHandler.cpp b/src/server/game/Handlers/NPCHandler.cpp index 749c0254571..554030270d9 100755 --- a/src/server/game/Handlers/NPCHandler.cpp +++ b/src/server/game/Handlers/NPCHandler.cpp @@ -258,7 +258,7 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket& recvData) if (!unit->isCanTrainingOf(_player, true)) { - SendTrainerService(guid, spellId, 0); + SendTrainerBuyFailed(guid, spellId, 0); return; } @@ -266,7 +266,7 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket& recvData) TrainerSpellData const* trainer_spells = unit->GetTrainerSpells(); if (!trainer_spells) { - SendTrainerService(guid, spellId, 0); + SendTrainerBuyFailed(guid, spellId, 0); return; } @@ -274,14 +274,14 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket& recvData) TrainerSpell const* trainer_spell = trainer_spells->Find(spellId); if (!trainer_spell) { - SendTrainerService(guid, spellId, 0); + SendTrainerBuyFailed(guid, spellId, 0); return; } // can't be learn, cheat? Or double learn with lags... if (_player->GetTrainerSpellState(trainer_spell) != TRAINER_SPELL_GREEN) { - SendTrainerService(guid, spellId, 0); + SendTrainerBuyFailed(guid, spellId, 0); return; } @@ -291,7 +291,7 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket& recvData) // check money requirement if (!_player->HasEnoughMoney(uint64(nSpellCost))) { - SendTrainerService(guid, spellId, 1); + SendTrainerBuyFailed(guid, spellId, 1); return; } @@ -306,15 +306,18 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket& recvData) else _player->learnSpell(spellId, false); - SendTrainerService(guid, spellId, 2); + WorldPacket data(SMSG_TRAINER_BUY_SUCCEEDED, 12); + data << uint64(guid); + data << uint32(spellId); + SendPacket(&data); } -void WorldSession::SendTrainerService(uint64 guid, uint32 spellId, uint32 result) +void WorldSession::SendTrainerBuyFailed(uint64 guid, uint32 spellId, uint32 reason) { - WorldPacket data(SMSG_TRAINER_SERVICE, 16); + WorldPacket data(SMSG_TRAINER_BUY_FAILED, 16); data << uint64(guid); data << uint32(spellId); // should be same as in packet from client - data << uint32(result); // 2 == Success. 1 == "Not enough money for trainer service." 0 == "Trainer service %d unavailable." + data << uint32(reason); // 1 == "Not enough money for trainer service." 0 == "Trainer service %d unavailable." SendPacket(&data); } @@ -510,7 +513,11 @@ void WorldSession::SendBindPoint(Creature* npc) // send spell for homebinding (3286) npc->CastSpell(_player, bindspell, true); - SendTrainerService(npc->GetGUID(), bindspell, 2); + WorldPacket data(SMSG_TRAINER_BUY_SUCCEEDED, 12); + data << uint64(npc->GetGUID()); + data << uint32(bindspell); + SendPacket(&data); + _player->PlayerTalkClass->SendCloseGossip(); } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 42cd6fc0a32..81620808485 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -1078,8 +1078,8 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_PLAY_MUSIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAY_OBJECT_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAY_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PLAY_SPELL_VISUAL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PLAY_SPELL_VISUAL_KIT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PLAY_SPELL_VISUAL, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PLAY_SPELL_VISUAL_KIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAY_TIME_WARNING, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PONG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_POWER_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1243,9 +1243,9 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_TOTEM_CREATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TRADE_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TRADE_STATUS_EXTENDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_FAILED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_TRAINER_BUY_SUCCEEDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TRAINER_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_TRAINER_SERVICE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TRANSFER_ABORTED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TRANSFER_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_TRIGGER_CINEMATIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 6c0ac6c88f3..3155c4eb922 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -1341,8 +1341,8 @@ enum Opcodes SMSG_TRADE_STATUS = 0x5CA3, SMSG_TRADE_STATUS_EXTENDED = 0x70A2, SMSG_TRAINER_BUY_FAILED = 0x0004, + SMSG_TRAINER_BUY_SUCCEEDED = 0x6A05, SMSG_TRAINER_LIST = 0x4414, - SMSG_TRAINER_SERVICE = 0x6A05, SMSG_TRANSFER_ABORTED = 0x0537, SMSG_TRANSFER_PENDING = 0x18A6, SMSG_TRIGGER_CINEMATIC = 0x6C27, diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 8ee09e55c72..dda9d0c146d 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -619,7 +619,7 @@ class WorldSession void HandleStableRevivePet(WorldPacket& recvPacket); void HandleStableSwapPet(WorldPacket& recvPacket); void HandleStableSwapPetCallback(PreparedQueryResult result, uint32 petId); - void SendTrainerService(uint64 guid, uint32 spellId, uint32 trainState); + void SendTrainerBuyFailed(uint64 guid, uint32 spellId, uint32 reason); void HandleDuelAcceptedOpcode(WorldPacket& recvPacket); void HandleDuelCancelledOpcode(WorldPacket& recvPacket); -- cgit v1.2.3 From 5a649b52b3b89f8160b20a4df2f7102d69926466 Mon Sep 17 00:00:00 2001 From: Sovak Date: Sat, 1 Sep 2012 15:16:59 +0200 Subject: Core/Groups: Fixed issue, when invite message says that you are inviting yourself Signed-off-by: Sovak --- src/server/game/Handlers/GroupHandler.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp index 936f387a68a..1d6cbf61c68 100644 --- a/src/server/game/Handlers/GroupHandler.cpp +++ b/src/server/game/Handlers/GroupHandler.cpp @@ -181,7 +181,7 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket & recvData) data.WriteBit(invitedGuid[4]); - data.WriteBits(strlen(player->GetName()), 7); // Invited name length + data.WriteBits(strlen(GetPlayer()->GetName()), 7); // Inviter name length data.WriteBits(0, 24); // Count 2 @@ -212,7 +212,7 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket & recvData) data.WriteByteSeq(invitedGuid[7]); - data.WriteString(player->GetName()); // invited name + data.WriteString(GetPlayer()->GetName()); // inviter name data << int32(0); @@ -283,7 +283,7 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket & recvData) data.WriteBit(invitedGuid[4]); - data.WriteBits(strlen(player->GetName()), 7); // Invited name length + data.WriteBits(strlen(GetPlayer()->GetName()), 7); // Inviter name length data.WriteBits(0, 24); // Count 2 @@ -314,7 +314,7 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket & recvData) data.WriteByteSeq(invitedGuid[7]); - data.WriteString(player->GetName()); + data.WriteString(GetPlayer()->GetName()); data << int32(0); -- cgit v1.2.3 From d218afa19849e1be810bb06c96402cff956dc036 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 1 Sep 2012 17:52:19 +0200 Subject: Core/PacketIO: Implemented ByteBuffer::PutBits allowing to put a value at specified position with bit precision --- src/server/shared/Packets/ByteBuffer.h | 36 ++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'src') diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h index 0b08b4118d4..bed09e8e372 100755 --- a/src/server/shared/Packets/ByteBuffer.h +++ b/src/server/shared/Packets/ByteBuffer.h @@ -189,6 +189,32 @@ class ByteBuffer put(pos, (uint8 *)&value, sizeof(value)); } + /** + * @name PutBits + * @brief Places specified amount of bits of value at specified position in packet + + * @param pos Position to place the value at, in bits. The entire value must fit in the packet + * It is advised to obtain the position using bitwpos() function. + + * @param value Data to write. + * @param bitCount Number of bits to store the value on. + */ + template void PutBits(size_t pos, T value, uint32 bitCount) + { + if (pos + bitCount > size() * 8) + throw ByteBufferPositionException(false, (pos + bitCount) / 8, size()); + + for (int32 i = 0; i < bitCount; ++i) + { + size_t wp = (pos + i) / 8; + size_t bit = (pos + i) % 8; + if ((value >> (bitCount - i - 1)) & 1) + _storage[wp] |= 1 << (7 - bit); + else + _storage[wp] &= ~(1 << (7 - bit)); + } + } + ByteBuffer &operator<<(uint8 value) { append(value); @@ -382,6 +408,16 @@ class ByteBuffer return _wpos; } + /// Returns position of last written bit + size_t bitwpos() const { return _wpos * 8 + 8 - _bitpos; } + + size_t bitwpos(size_t newPos) + { + _wpos = newPos / 8; + _bitpos = 8 - (newPos % 8); + return _wpos * 8 + 8 - _bitpos; + } + template void read_skip() { read_skip(sizeof(T)); } -- cgit v1.2.3 From 13e1e2361170c6e4a1fb5bcddc21b007d8681352 Mon Sep 17 00:00:00 2001 From: Sovak Date: Sun, 2 Sep 2012 12:17:38 +0200 Subject: Core/Battlegrounds: More battleground fixes Signed-off-by: Shauren --- src/server/game/Battlegrounds/BattlegroundMgr.cpp | 306 +++++++++++++--------- src/server/game/Handlers/BattleGroundHandler.cpp | 43 ++- src/server/game/Server/Protocol/Opcodes.cpp | 9 +- src/server/game/Server/Protocol/Opcodes.h | 1 - src/server/game/Server/WorldSession.h | 2 +- src/server/shared/Packets/ByteBuffer.h | 9 +- 6 files changed, 221 insertions(+), 149 deletions(-) (limited to 'src') diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index 9ff21ca2d30..afc63ed6704 100755 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -199,7 +199,7 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro case STATUS_WAIT_QUEUE: { data->Initialize(SMSG_BATTLEFIELD_STATUS_QUEUED); - + data->WriteBit(guidBytes1[3]); data->WriteBit(guidBytes1[0]); data->WriteBit(guidBytes2[3]); @@ -222,7 +222,7 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro data->WriteBit(guidBytes2[1]); data->FlushBits(); - + data->WriteByteSeq(guidBytes1[0]); *data << uint32(0); // unk data->WriteByteSeq(guidBytes2[5]); @@ -306,7 +306,7 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro case STATUS_IN_PROGRESS: { data->Initialize(SMSG_BATTLEFIELD_STATUS_ACTIVE, 49); - + data->WriteBit(guidBytes1[2]); data->WriteBit(guidBytes1[7]); data->WriteBit(guidBytes2[7]); @@ -325,7 +325,9 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro data->WriteBit(guidBytes2[2]); data->WriteBit(guidBytes1[3]); data->WriteBit(guidBytes1[0]); - + + data->FlushBits(); + data->WriteByteSeq(guidBytes2[4]); data->WriteByteSeq(guidBytes2[5]); data->WriteByteSeq(guidBytes1[5]); @@ -337,7 +339,7 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro *data << uint32(Time2); // Time *data << uint8(bg->GetPlayersCountByTeam(bg->GetPlayerTeam(pPlayer->GetGUID()))); // Teamsize - + data->WriteByteSeq(guidBytes1[4]); data->WriteByteSeq(guidBytes1[1]); @@ -351,13 +353,13 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro data->WriteByteSeq(guidBytes1[2]); *data << uint32(bg->GetStartTime()); // Time since started - + data->WriteByteSeq(guidBytes1[0]); data->WriteByteSeq(guidBytes1[3]); data->WriteByteSeq(guidBytes1[2]); - + *data << uint32(bg->GetClientInstanceID()); // Client Instance ID - + data->WriteByteSeq(guidBytes2[0]); data->WriteByteSeq(guidBytes1[7]); break; @@ -379,7 +381,7 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro *data << uint32(bg->GetMapId()); // Map Id *data << uint32(Time2); // Time *data << uint8(0); // unk - + data->WriteBit(guidBytes2[0]); data->WriteBit(guidBytes2[1]); data->WriteBit(guidBytes2[7]); @@ -397,7 +399,7 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro data->WriteBit(bg->isRated()); // Is Rated data->WriteBit(guidBytes1[1]); data->WriteBit(guidBytes2[6]); - + data->FlushBits(); data->WriteByteSeq(guidBytes1[0]); @@ -423,47 +425,30 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg) { - uint8 type = (bg->isArena() ? 1 : 0); - // last check on 3.0.3 - data->Initialize(MSG_PVP_LOG_DATA, (1+1+4+40*bg->GetPlayerScoresSize())); - *data << uint8(type); // type (battleground=0/arena=1) - - if (type) // arena - { - // it seems this must be according to BG_WINNER_A/H and _NOT_ BG_TEAM_A/H - for (int8 i = 1; i >= 0; --i) - { - int32 rating_change = bg->GetArenaTeamRatingChangeByIndex(i); + uint8 isRated = (bg->isRated() ? 1 : 0); // type (normal=0/rated=1) -- ATM arena or bg, RBG NYI + uint8 isArena = (bg->isArena() ? 1 : 0); // Arena names - uint32 pointsLost = rating_change < 0 ? -rating_change : 0; - uint32 pointsGained = rating_change > 0 ? rating_change : 0; - uint32 MatchmakerRating = bg->GetArenaMatchmakerRatingByIndex(i); + data->Initialize(SMSG_PVP_LOG_DATA, (1+1+4+40*bg->GetPlayerScoresSize())); + data->WriteBit(isArena); + data->WriteBit(isRated); - *data << uint32(pointsLost); // Rating Lost - *data << uint32(pointsGained); // Rating gained - *data << uint32(MatchmakerRating); // Matchmaking Value - sLog->outDebug(LOG_FILTER_BATTLEGROUND, "rating change: %d", rating_change); - } + if (isArena) + { for (int8 i = 1; i >= 0; --i) { if (ArenaTeam* at = sArenaTeamMgr->GetArenaTeamById(bg->GetArenaTeamIdByIndex(i))) - *data << at->GetName(); + data->WriteBits(at->GetName().length(), 8); else - *data << uint8(0); + data->WriteBits(0, 8); } } - if (bg->GetStatus() != STATUS_WAIT_LEAVE) - *data << uint8(0); // bg not ended - else - { - *data << uint8(1); // bg ended - *data << uint8(bg->GetWinner()); // who win - } + size_t count_pos = data->bitwpos(); - size_t wpos = data->wpos(); - uint32 scoreCount = 0; - *data << uint32(scoreCount); // placeholder + data->WriteBits(0, 21); // Placeholder + + int32 count = 0; + ByteBuffer buff; Battleground::BattlegroundScoreMap::const_iterator itr2 = bg->GetPlayerScoresBegin(); for (Battleground::BattlegroundScoreMap::const_iterator itr = itr2; itr != bg->GetPlayerScoresEnd();) @@ -474,137 +459,202 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg) sLog->outError(LOG_FILTER_BATTLEGROUND, "Player " UI64FMTD " has scoreboard entry for battleground %u but is not in battleground!", itr->first, bg->GetTypeID(true)); continue; } - - *data << uint64(itr2->first); - *data << uint32(itr2->second->KillingBlows); - if (type == 0) - { - *data << uint32(itr2->second->HonorableKills); - *data << uint32(itr2->second->Deaths); - *data << uint32(itr2->second->BonusHonor); - } - else + ObjectGuid guid = itr2->first; + Player* player = ObjectAccessor::FindPlayer(itr2->first); + data->WriteBit(0); // Unk 1 + data->WriteBit(0); // Unk 2 + data->WriteBit(guid[2]); + data->WriteBit(!isArena); // Unk 3 -- Prolly if (bg) + data->WriteBit(0); // Unk 4 + data->WriteBit(0); // Unk 5 + data->WriteBit(0); // Unk 6 + data->WriteBit(guid[3]); + data->WriteBit(guid[0]); + data->WriteBit(guid[5]); + data->WriteBit(guid[1]); + data->WriteBit(guid[6]); + data->WriteBit(player->GetTeam() == ALLIANCE); + data->WriteBit(guid[7]); + + buff << uint32(itr2->second->HealingDone); // healing done + buff << uint32(itr2->second->DamageDone); // damage done + + if (!isArena) // Unk 3 prolly is (bg) { - Player* player = ObjectAccessor::FindPlayer(itr2->first); - uint32 team = bg->GetPlayerTeam(itr2->first); - if (!team && player) - team = player->GetBGTeam(); - *data << uint8(team == ALLIANCE ? 1 : 0); // green or yellow + buff << uint32(itr2->second->BonusHonor); + buff << uint32(itr2->second->Deaths); + buff << uint32(itr2->second->HonorableKills); } - *data << uint32(itr2->second->DamageDone); // damage done - *data << uint32(itr2->second->HealingDone); // healing done - switch (bg->GetTypeID(true)) // battleground specific things + + buff.WriteByteSeq(guid[4]); + buff << uint32(itr2->second->KillingBlows); + + // if (unk 5) << uint32() unk + + buff.WriteByteSeq(guid[5]); + + // if (unk 6) << uint32() unk + // if (unk 2) << uint32() unk + + buff.WriteByteSeq(guid[1]); + buff.WriteByteSeq(guid[6]); + + buff << int32(player->GetPrimaryTalentTree(player->GetActiveSpec())); + + switch (bg->GetTypeID(true)) // Custom values { case BATTLEGROUND_RB: switch (bg->GetMapId()) { case 489: - *data << uint32(0x00000002); // count of next fields - *data << uint32(((BattlegroundWGScore*)itr2->second)->FlagCaptures); // flag captures - *data << uint32(((BattlegroundWGScore*)itr2->second)->FlagReturns); // flag returns + data->WriteBits(0x00000002, 24); + buff << uint32(((BattlegroundWGScore*)itr2->second)->FlagCaptures); // flag captures + buff << uint32(((BattlegroundWGScore*)itr2->second)->FlagReturns); // flag returns break; case 566: - *data << uint32(0x00000001); // count of next fields - *data << uint32(((BattlegroundEYScore*)itr2->second)->FlagCaptures); // flag captures + data->WriteBits(0x00000001, 24); + buff << uint32(((BattlegroundEYScore*)itr2->second)->FlagCaptures); // flag captures break; case 529: - *data << uint32(0x00000002); // count of next fields - *data << uint32(((BattlegroundABScore*)itr2->second)->BasesAssaulted); // bases asssulted - *data << uint32(((BattlegroundABScore*)itr2->second)->BasesDefended); // bases defended + data->WriteBits(0x00000002, 24); + buff << uint32(((BattlegroundABScore*)itr2->second)->BasesAssaulted); // bases asssulted + buff << uint32(((BattlegroundABScore*)itr2->second)->BasesDefended); // bases defended break; case 30: - *data << uint32(0x00000005); // count of next fields - *data << uint32(((BattlegroundAVScore*)itr2->second)->GraveyardsAssaulted); // GraveyardsAssaulted - *data << uint32(((BattlegroundAVScore*)itr2->second)->GraveyardsDefended); // GraveyardsDefended - *data << uint32(((BattlegroundAVScore*)itr2->second)->TowersAssaulted); // TowersAssaulted - *data << uint32(((BattlegroundAVScore*)itr2->second)->TowersDefended); // TowersDefended - *data << uint32(((BattlegroundAVScore*)itr2->second)->MinesCaptured); // MinesCaptured + data->WriteBits(0x00000005, 24); + buff << uint32(((BattlegroundAVScore*)itr2->second)->GraveyardsAssaulted); // GraveyardsAssaulted + buff << uint32(((BattlegroundAVScore*)itr2->second)->GraveyardsDefended); // GraveyardsDefended + buff << uint32(((BattlegroundAVScore*)itr2->second)->TowersAssaulted); // TowersAssaulted + buff << uint32(((BattlegroundAVScore*)itr2->second)->TowersDefended); // TowersDefended + buff << uint32(((BattlegroundAVScore*)itr2->second)->MinesCaptured); // MinesCaptured break; case 607: - *data << uint32(0x00000002); // count of next fields - *data << uint32(((BattlegroundSAScore*)itr2->second)->demolishers_destroyed); - *data << uint32(((BattlegroundSAScore*)itr2->second)->gates_destroyed); + data->WriteBits(0x00000002, 24); + buff << uint32(((BattlegroundSAScore*)itr2->second)->demolishers_destroyed); + buff << uint32(((BattlegroundSAScore*)itr2->second)->gates_destroyed); break; case 628: // IC - *data << uint32(0x00000002); // count of next fields - *data << uint32(((BattlegroundICScore*)itr2->second)->BasesAssaulted); // bases asssulted - *data << uint32(((BattlegroundICScore*)itr2->second)->BasesDefended); // bases defended + data->WriteBits(0x00000002, 24); + buff << uint32(((BattlegroundICScore*)itr2->second)->BasesAssaulted); // bases asssulted + buff << uint32(((BattlegroundICScore*)itr2->second)->BasesDefended); // bases defended + break; case 726: - *data << uint32(0x00000002); // count of next fields - *data << uint32(((BattlegroundTPScore*)itr2->second)->FlagCaptures); // flag captures - *data << uint32(((BattlegroundTPScore*)itr2->second)->FlagReturns); // flag returns + data->WriteBits(0x00000002, 24); + buff << uint32(((BattlegroundTPScore*)itr2->second)->FlagCaptures); // flag captures + buff << uint32(((BattlegroundTPScore*)itr2->second)->FlagReturns); // flag returns break; case 761: - *data << uint32(0x00000002); // count of next fields - *data << uint32(((BattlegroundBFGScore*)itr2->second)->BasesAssaulted); // bases asssulted - *data << uint32(((BattlegroundBFGScore*)itr2->second)->BasesDefended); // bases defended + data->WriteBits(0x00000002, 24); + buff << uint32(((BattlegroundBFGScore*)itr2->second)->BasesAssaulted); // bases asssulted + buff << uint32(((BattlegroundBFGScore*)itr2->second)->BasesDefended); // bases defended break; default: - *data << uint32(0); + data->WriteBits(0, 24); break; } + break; case BATTLEGROUND_AV: - *data << uint32(0x00000005); // count of next fields - *data << uint32(((BattlegroundAVScore*)itr2->second)->GraveyardsAssaulted); // GraveyardsAssaulted - *data << uint32(((BattlegroundAVScore*)itr2->second)->GraveyardsDefended); // GraveyardsDefended - *data << uint32(((BattlegroundAVScore*)itr2->second)->TowersAssaulted); // TowersAssaulted - *data << uint32(((BattlegroundAVScore*)itr2->second)->TowersDefended); // TowersDefended - *data << uint32(((BattlegroundAVScore*)itr2->second)->MinesCaptured); // MinesCaptured + data->WriteBits(0x00000005, 24); + buff << uint32(((BattlegroundAVScore*)itr2->second)->GraveyardsAssaulted); // GraveyardsAssaulted + buff << uint32(((BattlegroundAVScore*)itr2->second)->GraveyardsDefended); // GraveyardsDefended + buff << uint32(((BattlegroundAVScore*)itr2->second)->TowersAssaulted); // TowersAssaulted + buff << uint32(((BattlegroundAVScore*)itr2->second)->TowersDefended); // TowersDefended + buff << uint32(((BattlegroundAVScore*)itr2->second)->MinesCaptured); // MinesCaptured break; case BATTLEGROUND_WS: - *data << uint32(0x00000002); // count of next fields - *data << uint32(((BattlegroundWGScore*)itr2->second)->FlagCaptures); // flag captures - *data << uint32(((BattlegroundWGScore*)itr2->second)->FlagReturns); // flag returns + data->WriteBits(0x00000002, 24); + buff << uint32(((BattlegroundWGScore*)itr2->second)->FlagCaptures); // flag captures + buff << uint32(((BattlegroundWGScore*)itr2->second)->FlagReturns); // flag returns break; case BATTLEGROUND_AB: - *data << uint32(0x00000002); // count of next fields - *data << uint32(((BattlegroundABScore*)itr2->second)->BasesAssaulted); // bases asssulted - *data << uint32(((BattlegroundABScore*)itr2->second)->BasesDefended); // bases defended + data->WriteBits(0x00000002, 24); + buff << uint32(((BattlegroundABScore*)itr2->second)->BasesAssaulted); // bases asssulted + buff << uint32(((BattlegroundABScore*)itr2->second)->BasesDefended); // bases defended break; case BATTLEGROUND_EY: - *data << uint32(0x00000001); // count of next fields - *data << uint32(((BattlegroundEYScore*)itr2->second)->FlagCaptures); // flag captures + data->WriteBits(0x00000001, 24); + buff << uint32(((BattlegroundEYScore*)itr2->second)->FlagCaptures); // flag captures break; case BATTLEGROUND_SA: - *data << uint32(0x00000002); // count of next fields - *data << uint32(((BattlegroundSAScore*)itr2->second)->demolishers_destroyed); - *data << uint32(((BattlegroundSAScore*)itr2->second)->gates_destroyed); + data->WriteBits(0x00000002, 24); + buff << uint32(((BattlegroundSAScore*)itr2->second)->demolishers_destroyed); + buff << uint32(((BattlegroundSAScore*)itr2->second)->gates_destroyed); break; - case BATTLEGROUND_IC: // wotlk - *data << uint32(0x00000002); // count of next fields - *data << uint32(((BattlegroundICScore*)itr2->second)->BasesAssaulted); // bases asssulted - *data << uint32(((BattlegroundICScore*)itr2->second)->BasesDefended); // bases defended + case BATTLEGROUND_IC: + data->WriteBits(0x00000002, 24); + buff << uint32(((BattlegroundICScore*)itr2->second)->BasesAssaulted); // bases asssulted + buff << uint32(((BattlegroundICScore*)itr2->second)->BasesDefended); // bases defended break; case BATTLEGROUND_TP: - *data << uint32(0x00000002); // count of next fields - *data << uint32(((BattlegroundTPScore*)itr2->second)->FlagCaptures); // flag captures - *data << uint32(((BattlegroundTPScore*)itr2->second)->FlagReturns); // flag returns + data->WriteBits(0x00000002, 24); + buff << uint32(((BattlegroundTPScore*)itr2->second)->FlagCaptures); // flag captures + buff << uint32(((BattlegroundTPScore*)itr2->second)->FlagReturns); // flag returns + break; case BATTLEGROUND_BFG: - *data << uint32(0x00000002); // count of next fields - *data << uint32(((BattlegroundBFGScore*)itr2->second)->BasesAssaulted); // bases asssulted - *data << uint32(((BattlegroundBFGScore*)itr2->second)->BasesDefended); // bases defended + data->WriteBits(0x00000002, 24); + buff << uint32(((BattlegroundBFGScore*)itr2->second)->BasesAssaulted); // bases asssulted + buff << uint32(((BattlegroundBFGScore*)itr2->second)->BasesDefended); // bases defended + break; case BATTLEGROUND_NA: case BATTLEGROUND_BE: case BATTLEGROUND_AA: case BATTLEGROUND_RL: case BATTLEGROUND_DS: // wotlk case BATTLEGROUND_RV: // wotlk - *data << uint32(0); + data->WriteBits(0, 24); break; default: - sLog->outDebug(LOG_FILTER_NETWORKIO, "Unhandled MSG_PVP_LOG_DATA for BG id %u", bg->GetTypeID()); - *data << uint32(0); + data->WriteBits(0, 24); break; } - // should never happen - if (++scoreCount >= bg->GetMaxPlayers() && itr != bg->GetPlayerScoresEnd()) + data->WriteBit(guid[4]); + + buff.WriteByteSeq(guid[0]); + buff.WriteByteSeq(guid[3]); + + // if (unk 4) << uint32() unk + + buff.WriteByteSeq(guid[7]); + buff.WriteByteSeq(guid[2]); + + ++count; + } + + data->WriteBit(bg->GetStatus() == STATUS_WAIT_LEAVE); // If Ended + data->FlushBits(); + data->PutBits(count_pos, count, 21); // Number of Players + + if (isRated) // arena TODO : Fix Order on Rated Implementation + { + // it seems this must be according to BG_WINNER_A/H and _NOT_ BG_TEAM_A/H + for (int8 i = 1; i >= 0; --i) { - sLog->outError(LOG_FILTER_BATTLEGROUND, "Battleground %u scoreboard has more entries (%u) than allowed players in this bg (%u)", bg->GetTypeID(true), bg->GetPlayerScoresSize(), bg->GetMaxPlayers()); - break; + int32 rating_change = bg->GetArenaTeamRatingChangeByIndex(i); + + uint32 pointsLost = rating_change < 0 ? -rating_change : 0; + uint32 pointsGained = rating_change > 0 ? rating_change : 0; + uint32 MatchmakerRating = bg->GetArenaMatchmakerRatingByIndex(i); + + *data << uint32(pointsLost); // Rating Lost + *data << uint32(pointsGained); // Rating gained + *data << uint32(MatchmakerRating); // Matchmaking Value + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "rating change: %d", rating_change); } } - data->put(wpos, scoreCount); + data->append(buff); + + if (isArena) + for (int8 i = 1; i >= 0; --i) + if (ArenaTeam* at = sArenaTeamMgr->GetArenaTeamById(bg->GetArenaTeamIdByIndex(i))) + data->WriteString(at->GetName()); + + *data << uint8(0); // unk + + if (bg->GetStatus() == STATUS_WAIT_LEAVE) + *data << uint8(bg->GetWinner()); // who win + + *data << uint8(0); // unk } void BattlegroundMgr::BuildGroupJoinedBattlegroundPacket(WorldPacket* data, Battleground* bg, Player* pPlayer, GroupJoinBattlegroundResult result) @@ -613,7 +663,7 @@ void BattlegroundMgr::BuildGroupJoinedBattlegroundPacket(WorldPacket* data, Batt ObjectGuid guidBytes2 = bg->GetGUID(); data->Initialize(SMSG_BATTLEFIELD_STATUS_FAILED); - + } void BattlegroundMgr::BuildUpdateWorldStatePacket(WorldPacket* data, uint32 field, uint32 value) @@ -659,7 +709,7 @@ void BattlegroundMgr::BuildPlayerJoinedBattlegroundPacket(WorldPacket* data, uin ObjectGuid guidBytes = guid; data->Initialize(SMSG_BATTLEGROUND_PLAYER_JOINED, 8); - + data->WriteBit(guidBytes[0]); data->WriteBit(guidBytes[4]); data->WriteBit(guidBytes[3]); @@ -668,7 +718,7 @@ void BattlegroundMgr::BuildPlayerJoinedBattlegroundPacket(WorldPacket* data, uin data->WriteBit(guidBytes[6]); data->WriteBit(guidBytes[2]); data->WriteBit(guidBytes[1]); - + data->WriteByteSeq(guidBytes[1]); data->WriteByteSeq(guidBytes[5]); data->WriteByteSeq(guidBytes[3]); @@ -1095,8 +1145,10 @@ void BattlegroundMgr::BuildBattlegroundListPacket(WorldPacket* data, uint64 guid data->WriteBit(guidBytes[7]); data->WriteBit(0); // unk data->WriteBit(0); // unk - size_t count_pos = data->wpos(); - data->WriteBit(0); // bg instance count + + data->FlushBits(); + size_t count_pos = data->bitwpos(); + data->WriteBits(0, 24); // placeholder data->WriteBit(guidBytes[6]); data->WriteBit(guidBytes[4]); @@ -1125,7 +1177,7 @@ void BattlegroundMgr::BuildBattlegroundListPacket(WorldPacket* data, uint64 guid *data << uint32(*itr); // instance id ++count; } - data->put(count_pos, count); + data->PutBits(count_pos, count, 24); // bg instance count } } diff --git a/src/server/game/Handlers/BattleGroundHandler.cpp b/src/server/game/Handlers/BattleGroundHandler.cpp index d3e28bd84d1..085b5181913 100755 --- a/src/server/game/Handlers/BattleGroundHandler.cpp +++ b/src/server/game/Handlers/BattleGroundHandler.cpp @@ -354,7 +354,7 @@ void WorldSession::HandleBattlegroundPlayerPositionsOpcode(WorldPacket & /*recvD void WorldSession::HandlePVPLogDataOpcode(WorldPacket & /*recvData*/) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd MSG_PVP_LOG_DATA Message"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_PVP_LOG_DATA Message"); Battleground* bg = _player->GetBattleground(); if (!bg) @@ -368,7 +368,7 @@ void WorldSession::HandlePVPLogDataOpcode(WorldPacket & /*recvData*/) sBattlegroundMgr->BuildPvpLogDataPacket(&data, bg); SendPacket(&data); - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent MSG_PVP_LOG_DATA Message"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_PVP_LOG_DATA Message"); } void WorldSession::HandleBattlefieldListOpcode(WorldPacket& recvData) @@ -394,13 +394,35 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_BATTLEFIELD_PORT Message"); - uint8 type; // arenatype if arena - uint8 unk2; // unk, can be 0x0 (may be if was invited?) and 0x1 + uint32 time; + uint32 type; // guessed uint32 bgTypeId_; // type id from dbc - uint16 unk; // 0x1F90 constant? uint8 action; // enter battle 0x1, leave queue 0x0 + ObjectGuid guid; + + recvData >> time; + recvData >> type; + recvData >> bgTypeId_; + + guid[0] = recvData.ReadBit(); + guid[1] = recvData.ReadBit(); + guid[5] = recvData.ReadBit(); + guid[6] = recvData.ReadBit(); + guid[7] = recvData.ReadBit(); + guid[4] = recvData.ReadBit(); + guid[3] = recvData.ReadBit(); + guid[2] = recvData.ReadBit(); - recvData >> type >> unk2 >> bgTypeId_ >> unk >> action; + action = recvData.ReadBit(); + + recvData.ReadByteSeq(guid[1]); + recvData.ReadByteSeq(guid[3]); + recvData.ReadByteSeq(guid[5]); + recvData.ReadByteSeq(guid[7]); + recvData.ReadByteSeq(guid[0]); + recvData.ReadByteSeq(guid[2]); + recvData.ReadByteSeq(guid[6]); + recvData.ReadByteSeq(guid[4]); if (!sBattlemasterListStore.LookupEntry(bgTypeId_)) { @@ -539,14 +561,9 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData) } } -void WorldSession::HandleLeaveBattlefieldOpcode(WorldPacket& recvData) +void WorldSession::HandleBattlefieldLeaveOpcode(WorldPacket& recvData) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_LEAVE_BATTLEFIELD Message"); - - recvData.read_skip(); // unk1 - recvData.read_skip(); // unk2 - recvData.read_skip(); // BattlegroundTypeId - recvData.read_skip(); // unk3 + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_BATTLEFIELD_LEAVE Message"); // not allow leave battleground in combat if (_player->isInCombat()) diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 81620808485..6eeb3661028 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -99,7 +99,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_LOOT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutostoreLootItemOpcode ); DEFINE_OPCODE_HANDLER(CMSG_AUTO_DECLINE_GUILD_INVITES, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_BANKER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBankerActivateOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_LEAVE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_LEAVE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleBattlefieldLeaveOpcode ); DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlefieldListOpcode ); DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_ENTRY_INVITE_RESPONSE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleBfEntryInviteResponse ); DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_MGR_EXIT_REQUEST, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleBfExitRequest ); @@ -289,6 +289,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_IGNORE_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleIgnoreTradeOpcode ); DEFINE_OPCODE_HANDLER(CMSG_INITIATE_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInitiateTradeOpcode ); DEFINE_OPCODE_HANDLER(CMSG_INSPECT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_INSPECT_HONOR_STATS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectHonorStatsOpcode ); DEFINE_OPCODE_HANDLER(CMSG_INSTANCE_LOCK_WARNING_RESPONSE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_ITEM_REFUND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemRefund ); DEFINE_OPCODE_HANDLER(CMSG_ITEM_REFUND_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleItemRefundInfoRequest ); @@ -413,7 +414,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_PLAYER_VEHICLE_ENTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleEnterPlayerVehicle ); DEFINE_OPCODE_HANDLER(CMSG_PLAY_DANCE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_PUSHQUESTTOPARTY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePushQuestToParty ); - DEFINE_OPCODE_HANDLER(CMSG_PVP_LOG_DATA, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_PVP_LOG_DATA, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandlePVPLogDataOpcode ); DEFINE_OPCODE_HANDLER(CMSG_QUERY_BATTLEFIELD_STATE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_MEMBERS_FOR_RECIPE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_MEMBER_RECIPES, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -1087,7 +1088,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_PROCRESIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PROPOSE_LEVEL_GRANT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PVP_CREDIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PVP_LOG_DATA, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PVP_LOG_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PVP_OPTIONS_ENABLED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_QUERY_QUESTS_COMPLETED_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_QUERY_TIME_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1421,7 +1422,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(CMSG_INSTANCE_LOCK_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInstanceLockResponse ); //DEFINE_OPCODE_HANDLER(CMSG_LEARN_DANCE_MOVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_LEARN_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - //DEFINE_OPCODE_HANDLER(CMSG_LEAVE_BATTLEFIELD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLeaveBattlefieldOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_LEVEL_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_LFD_PARTY_LOCK_INFO_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgPartyLockInfoRequestOpcode); //DEFINE_OPCODE_HANDLER(CMSG_LFD_PLAYER_LOCK_INFO_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgPlayerLockInfoRequestOpcode); @@ -1559,7 +1559,6 @@ void InitOpcodes() //DEFINE_OPCODE_HANDLER(MSG_GM_RESETINSTANCELIMIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_GM_SHOWLABEL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_GM_SUMMON, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_INSPECT_HONOR_STATS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleInspectHonorStatsOpcode ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_FEATHER_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_GRAVITY_CHNG, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(MSG_MOVE_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 3155c4eb922..b948ce76ca6 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -294,7 +294,6 @@ enum Opcodes CMSG_LEARN_PREVIEW_TALENTS = 0x2415, CMSG_LEARN_PREVIEW_TALENTS_PET = 0x6E24, CMSG_LEARN_TALENT = 0x0306, - CMSG_LEAVE_BATTLEFIELD = 0x0000, CMSG_LEAVE_CHANNEL = 0x2D56, CMSG_LFG_GET_PLAYER_INFO = 0x0000, CMSG_LFG_GET_STATUS = 0x2581, diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index dda9d0c146d..0ac7884efe2 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -789,7 +789,7 @@ class WorldSession void HandlePVPLogDataOpcode(WorldPacket& recvData); void HandleBattleFieldPortOpcode(WorldPacket& recvData); void HandleBattlefieldListOpcode(WorldPacket& recvData); - void HandleLeaveBattlefieldOpcode(WorldPacket& recvData); + void HandleBattlefieldLeaveOpcode(WorldPacket& recvData); void HandleBattlemasterJoinArena(WorldPacket& recvData); void HandleReportPvPAFK(WorldPacket& recvData); diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h index bed09e8e372..39d3724835c 100755 --- a/src/server/shared/Packets/ByteBuffer.h +++ b/src/server/shared/Packets/ByteBuffer.h @@ -191,7 +191,9 @@ class ByteBuffer /** * @name PutBits - * @brief Places specified amount of bits of value at specified position in packet + * @brief Places specified amount of bits of value at specified position in packet. + * To ensure all bits are correctly written, only call this method after + * bit flush has been performed * @param pos Position to place the value at, in bits. The entire value must fit in the packet * It is advised to obtain the position using bitwpos() function. @@ -201,8 +203,11 @@ class ByteBuffer */ template void PutBits(size_t pos, T value, uint32 bitCount) { + if (!bitCount) + throw ByteBufferSourceException((pos + bitCount) / 8, , size(), 0); + if (pos + bitCount > size() * 8) - throw ByteBufferPositionException(false, (pos + bitCount) / 8, size()); + throw ByteBufferPositionException(false, (pos + bitCount) / 8, size(), (bitCount - 1) / 8 + 1); for (int32 i = 0; i < bitCount; ++i) { -- cgit v1.2.3 From c649e2fe6b455d031e0331bb26f158a3081743cb Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 2 Sep 2012 14:22:18 +0200 Subject: Fixed typo in PutBits --- src/server/shared/Packets/ByteBuffer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h index 39d3724835c..e4535378a48 100755 --- a/src/server/shared/Packets/ByteBuffer.h +++ b/src/server/shared/Packets/ByteBuffer.h @@ -204,7 +204,7 @@ class ByteBuffer template void PutBits(size_t pos, T value, uint32 bitCount) { if (!bitCount) - throw ByteBufferSourceException((pos + bitCount) / 8, , size(), 0); + throw ByteBufferSourceException((pos + bitCount) / 8, size(), 0); if (pos + bitCount > size() * 8) throw ByteBufferPositionException(false, (pos + bitCount) / 8, size(), (bitCount - 1) / 8 + 1); -- cgit v1.2.3 From 10c9f0d0eda80253febb5913000f41182e887f89 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 2 Sep 2012 18:40:08 +0200 Subject: Scripts/Commands: Fixed compile --- src/server/scripts/Commands/cs_cheat.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/scripts/Commands/cs_cheat.cpp b/src/server/scripts/Commands/cs_cheat.cpp index ade1b9fae02..1911c6d476b 100644 --- a/src/server/scripts/Commands/cs_cheat.cpp +++ b/src/server/scripts/Commands/cs_cheat.cpp @@ -178,14 +178,14 @@ public: if (argstr == "off") { handler->GetSession()->GetPlayer()->SetCommandStatusOff(CHEAT_WATERWALK); - handler->GetSession()->GetPlayer()->SetMovement(MOVE_LAND_WALK); // OFF + handler->GetSession()->GetPlayer()->SendMovementSetWaterWalking(false); // OFF handler->SendSysMessage("Waterwalking is OFF. You can't walk on water."); return true; } else if (argstr == "on") { handler->GetSession()->GetPlayer()->SetCommandStatusOn(CHEAT_WATERWALK); - handler->GetSession()->GetPlayer()->SetMovement(MOVE_WATER_WALK); // ON + handler->GetSession()->GetPlayer()->SendMovementSetWaterWalking(true); // ON handler->SendSysMessage("Waterwalking is ON. You can walk on water."); return true; } -- cgit v1.2.3 From dba602ea1617c42c95fa9703d53f4af0a2b3f35d Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 3 Sep 2012 13:33:21 +0100 Subject: Core/BFs: Fix GCC (?) compile Closes #7629 --- src/server/game/Battlefield/BattlefieldHandler.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Battlefield/BattlefieldHandler.cpp b/src/server/game/Battlefield/BattlefieldHandler.cpp index aac9ac42392..f16237b6e31 100644 --- a/src/server/game/Battlefield/BattlefieldHandler.cpp +++ b/src/server/game/Battlefield/BattlefieldHandler.cpp @@ -241,7 +241,7 @@ void WorldSession::HandleBfQueueInviteResponse(WorldPacket& recvData) recvData.ReadByteSeq(guid[0]); recvData.ReadByteSeq(guid[5]); - sLog->outError(LOG_FILTER_GENERAL, "HandleQueueInviteResponse: GUID:"UI64FMTD" Accepted:%u", guid, accepted); + sLog->outError(LOG_FILTER_GENERAL, "HandleQueueInviteResponse: GUID:"UI64FMTD" Accepted:%u", (uint64)guid, accepted); Battlefield* bf = sBattlefieldMgr->GetBattlefieldByGUID(guid); if (!bf) @@ -276,7 +276,7 @@ void WorldSession::HandleBfEntryInviteResponse(WorldPacket& recvData) recvData.ReadByteSeq(guid[7]); recvData.ReadByteSeq(guid[5]); - sLog->outError(LOG_FILTER_GENERAL, "HandleBattlefieldInviteResponse: GUID:"UI64FMTD" Accepted:%u", guid, accepted); + sLog->outError(LOG_FILTER_GENERAL, "HandleBattlefieldInviteResponse: GUID:"UI64FMTD" Accepted:%u", (uint64)guid, accepted); Battlefield* bf = sBattlefieldMgr->GetBattlefieldByGUID(guid); if (!bf) @@ -311,7 +311,7 @@ void WorldSession::HandleBfExitRequest(WorldPacket& recvData) recvData.ReadByteSeq(guid[7]); recvData.ReadByteSeq(guid[6]); - sLog->outError(LOG_FILTER_GENERAL, "HandleBfExitRequest: GUID:"UI64FMTD" ", guid); + sLog->outError(LOG_FILTER_GENERAL, "HandleBfExitRequest: GUID:"UI64FMTD" ", (uint64)guid); if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldByGUID(guid)) bf->AskToLeaveQueue(_player); -- cgit v1.2.3 From 83bb6d0207fbe98065013b1fa5840a5713c46b32 Mon Sep 17 00:00:00 2001 From: cyberbrest Date: Mon, 3 Sep 2012 16:26:46 +0100 Subject: Core/Stats mana generation: remove MP5 rule (http://www.wowwiki.com/Mana_regeneration) + add correct generation formula from wowwiki Closes #7459 --- src/server/game/Entities/Unit/StatSystem.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index f5b313987e3..7a2857f6a88 100755 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -690,21 +690,17 @@ void Player::UpdateManaRegen() // Apply PCT bonus from SPELL_AURA_MOD_POWER_REGEN_PERCENT aura on spirit base regen power_regen *= GetTotalAuraMultiplierByMiscValue(SPELL_AURA_MOD_POWER_REGEN_PERCENT, POWER_MANA); - // Mana regen from SPELL_AURA_MOD_POWER_REGEN aura - float power_regen_mp5 = (GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_POWER_REGEN, POWER_MANA) + m_baseManaRegen) / 5.0f; - - // Get bonus from SPELL_AURA_MOD_MANA_REGEN_FROM_STAT aura - AuraEffectList const& regenAura = GetAuraEffectsByType(SPELL_AURA_MOD_MANA_REGEN_FROM_STAT); - for (AuraEffectList::const_iterator i = regenAura.begin(); i != regenAura.end(); ++i) - power_regen_mp5 += GetStat(Stats((*i)->GetMiscValue())) * (*i)->GetAmount() / 500.0f; - // Set regen rate in cast state apply only on spirit based regen int32 modManaRegenInterrupt = GetTotalAuraModifier(SPELL_AURA_MOD_MANA_REGEN_INTERRUPT); - if (modManaRegenInterrupt > 100) + if (!modManaRegenInterrupt || modManaRegenInterrupt > 100) modManaRegenInterrupt = 100; - SetStatFloatValue(UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER, power_regen_mp5 + CalculatePctN(power_regen, modManaRegenInterrupt)); + //From WowWiki: CombatRegen = 5% of Base Mana + float combat_regen = GetCreateMana() * 0.01f + GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_POWER_REGEN, POWER_MANA) / 5.0f; + SetStatFloatValue(UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER, CalculatePctN(combat_regen, modManaRegenInterrupt)); - SetStatFloatValue(UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER, power_regen_mp5 + power_regen); + // SpiritRegen(SPI,INT,LEVEL) = (0.001 + (SPI x sqrt(INT) x BASE_REGEN[LEVEL])) x 5 + float sqint = sqrt(GetStat(STAT_INTELLECT)); + SetStatFloatValue(UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER, 0.001f + power_regen * sqint); } void Player::UpdateRuneRegen(RuneType rune) -- cgit v1.2.3 From 25cc49b489c0e58fa621c65f187740f871598744 Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 3 Sep 2012 18:16:04 +0100 Subject: Core: Fix x64 compile and GCC compile --- dep/g3dlite/source/RegistryUtil.cpp | 2 +- src/server/game/Handlers/MiscHandler.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/dep/g3dlite/source/RegistryUtil.cpp b/dep/g3dlite/source/RegistryUtil.cpp index 28ff6955d9b..fc4cebc2ee5 100644 --- a/dep/g3dlite/source/RegistryUtil.cpp +++ b/dep/g3dlite/source/RegistryUtil.cpp @@ -257,7 +257,7 @@ bool RegistryUtil::writeString(const std::string& key, const std::string& value, // static helpers -static HKEY getRootKeyFromString(const char* str, uint32 length) { +static HKEY getRootKeyFromString(const char* str, size_t length) { debugAssert(str); if (str) { diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 18ec0067623..c6e0515a8ed 100644 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -1282,7 +1282,7 @@ void WorldSession::HandleInspectHonorStatsOpcode(WorldPacket& recvData) if (!player) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_INSPECT_HONOR_STATS: No player found from GUID: " UI64FMTD, guid); + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_INSPECT_HONOR_STATS: No player found from GUID: " UI64FMTD, (uint64)guid); return; } -- cgit v1.2.3 From 9025a865364688fddc508724682ca88a78db8e33 Mon Sep 17 00:00:00 2001 From: cyberbrest Date: Sun, 2 Sep 2012 23:19:19 +0300 Subject: [Core/Currency] no needed delta calculations + fix crashes because of it. --- src/server/game/Entities/Player/Player.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 180f43109f2..025f883eb20 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -7374,23 +7374,19 @@ void Player::ModifyCurrency(uint32 id, int32 count, bool printLog/* = true*/) if (newWeekCount < 0) newWeekCount = 0; - if (currency->TotalCap && int32(currency->TotalCap) < newTotalCount) - { - int32 delta = newTotalCount - int32(currency->TotalCap); - newTotalCount = int32(currency->TotalCap); - newWeekCount -= delta; - } // TODO: fix conquest points + + // if we get more then weekCap just set to limit. uint32 weekCap = _GetCurrencyWeekCap(currency); if (weekCap && int32(weekCap) < newTotalCount) - { - int32 delta = newWeekCount - int32(weekCap); newWeekCount = int32(weekCap); - newTotalCount -= delta; - } - // if we change total, we must change week - ASSERT(((newTotalCount-oldTotalCount) != 0) == ((newWeekCount-oldWeekCount) != 0)); + // if we get more then totalCap set to maximum; + if (currency->TotalCap && int32(currency->TotalCap) < newTotalCount) + { + newTotalCount = int32(currency->TotalCap); + newWeekCount = weekCap; + } if (uint32(newTotalCount) != oldTotalCount) { -- cgit v1.2.3 From e9a3d3876943610641904caad624517977eb8aec Mon Sep 17 00:00:00 2001 From: cyberbrest Date: Mon, 3 Sep 2012 14:03:53 +0300 Subject: [Core/Currency] not allow add more then week limit. --- src/server/game/Entities/Player/Player.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 025f883eb20..f0a3628e32c 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -7366,6 +7366,11 @@ void Player::ModifyCurrency(uint32 id, int32 count, bool printLog/* = true*/) oldWeekCount = itr->second.weekCount; } + // count can't be more then weekCap. + uint32 weekCap = _GetCurrencyWeekCap(currency); + if (count > int32(weekCap)) + count = weekCap; + int32 newTotalCount = int32(oldTotalCount) + count; if (newTotalCount < 0) newTotalCount = 0; @@ -7374,12 +7379,16 @@ void Player::ModifyCurrency(uint32 id, int32 count, bool printLog/* = true*/) if (newWeekCount < 0) newWeekCount = 0; - // TODO: fix conquest points + ASSERT(weekCap >= oldWeekCount); - // if we get more then weekCap just set to limit. - uint32 weekCap = _GetCurrencyWeekCap(currency); - if (weekCap && int32(weekCap) < newTotalCount) + // TODO: fix conquest points + // if we get more then weekCap just set to limit + if (weekCap && int32(weekCap) < newWeekCount) + { newWeekCount = int32(weekCap); + // weekCap - oldWeekCount alwayt >= 0 as we set limit before! + newTotalCount = oldTotalCount + (weekCap - oldWeekCount); + } // if we get more then totalCap set to maximum; if (currency->TotalCap && int32(currency->TotalCap) < newTotalCount) -- cgit v1.2.3 From 0c40fb0fe9a28400e8639145800224c9a9c1de48 Mon Sep 17 00:00:00 2001 From: cyberbrest Date: Mon, 3 Sep 2012 22:27:18 +0300 Subject: [Core/Currency] save all currencies on special db table. + fix initialization currencies. --- .../2012_09_03_00_characters_currency.sql | 8 ++ src/server/game/Entities/Player/Player.cpp | 112 ++++++++++++++++++++- src/server/game/Entities/Player/Player.h | 6 +- src/server/game/Handlers/CharacterHandler.cpp | 4 + .../Database/Implementation/CharacterDatabase.cpp | 5 + .../Database/Implementation/CharacterDatabase.h | 4 + 6 files changed, 136 insertions(+), 3 deletions(-) create mode 100644 sql/updates/characters/2012_09_03_00_characters_currency.sql (limited to 'src') diff --git a/sql/updates/characters/2012_09_03_00_characters_currency.sql b/sql/updates/characters/2012_09_03_00_characters_currency.sql new file mode 100644 index 00000000000..84c5690f1ac --- /dev/null +++ b/sql/updates/characters/2012_09_03_00_characters_currency.sql @@ -0,0 +1,8 @@ +DROP TABLE IF EXISTS `character_currency`; +CREATE TABLE `character_currency` ( + `guid` int(11) unsigned NOT NULL, + `currency` smallint(5) unsigned NOT NULL, + `total_count` int(11) unsigned NOT NULL, + `week_count` int(11) unsigned NOT NULL, + PRIMARY KEY (`guid`,`currency`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; \ No newline at end of file diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index f0a3628e32c..2661c83842c 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -7290,6 +7290,105 @@ bool Player::RewardHonor(Unit* victim, uint32 groupsize, int32 honor, bool pvpto } +void Player::_LoadCurrency(PreparedQueryResult result) +{ + if (!result) + return; + + do + { + Field* fields = result->Fetch(); + + uint16 currencyID = fields[0].GetUInt16(); + + CurrencyTypesEntry const* currency = sCurrencyTypesStore.LookupEntry(currencyID); + if(!currencyID) + continue; + + PlayerCurrency cur; + cur.state = PLAYERCURRENCY_UNCHANGED; + cur.weekCount = fields[1].GetUInt32(); + cur.totalCount = fields[2].GetUInt32(); + + m_currencies.insert(PlayerCurrenciesMap::value_type(currencyID, cur)); + + } while (result->NextRow()); +} + +void Player::_SaveCurrency(SQLTransaction& trans) +{ + PreparedStatement* stmt = NULL; + for (PlayerCurrenciesMap::iterator itr = m_currencies.begin(); itr != m_currencies.end(); ++itr) + { + CurrencyTypesEntry const* entry = sCurrencyTypesStore.LookupEntry(itr->first); + if (!entry) // should never happen + continue; + + switch(itr->second.state) + { + case PLAYERCURRENCY_NEW: + stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_PLAYER_CURRENCY); + stmt->setUInt32(0, GetGUIDLow()); + stmt->setUInt16(1, itr->first); + stmt->setUInt32(2, itr->second.weekCount); + stmt->setUInt32(3, itr->second.totalCount); + trans->Append(stmt); + break; + case PLAYERCURRENCY_CHANGED: + stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_PLAYER_CURRENCY); + stmt->setUInt32(0, itr->second.weekCount); + stmt->setUInt32(1, itr->second.totalCount); + stmt->setUInt32(2, GetGUIDLow()); + stmt->setUInt16(3, itr->first); + trans->Append(stmt); + break; + default: + break; + } + + itr->second.state = PLAYERCURRENCY_UNCHANGED; + } +} + +void SendNewCurrency(uint32 id) const +{ + PlayerCurrenciesMap::const_iterator itr = m_currencies.find(id); + if (itr == m_currencies.end()) + return; + + ByteBuffer currencyData; + WorldPacket packet(SMSG_INIT_CURRENCY, 4 + (5*4 + 1)); + packet.WriteBits(1, 23); + + CurrencyTypesEntry const* entry = sCurrencyTypesStore.LookupEntry(id); + if (!entry) // should never happen + return; + + uint32 precision = (entry->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? 100 : 1; + uint32 weekCount = itr->second.weekCount / precision; + uint32 weekCap = _GetCurrencyWeekCap(entry) / precision; + + packet.WriteBit(weekCount); + packet.WriteBits(0, 4); // some flags + packet.WriteBit(weekCap); + packet.WriteBit(0); // season total earned + + currencyData << uint32(itr->second.totalCount / precision); + if (weekCap) + currencyData << uint32(weekCap); + + //if (seasonTotal) + // currencyData << uint32(seasonTotal); + + currencyData << uint32(entry->ID); + if (weekCount) + currencyData << uint32(weekCount); + + packet.FlushBits(); + packet.append(currencyData); + GetSession()->SendPacket(&packet); +} + void Player::SendCurrencies() const { ByteBuffer currencyData; @@ -7339,6 +7438,7 @@ bool Player::HasCurrency(uint32 id, uint32 count) const PlayerCurrenciesMap::const_iterator itr = m_currencies.find(id); return itr != m_currencies.end() && itr->second.totalCount >= count; } + void Player::ModifyCurrency(uint32 id, int32 count, bool printLog/* = true*/) { if (!count) @@ -7411,6 +7511,13 @@ void Player::ModifyCurrency(uint32 id, int32 count, bool printLog/* = true*/) if (count > 0) UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CURRENCY, id, count); + // on new case just set init. + if(itr->second.state == PLAYERCURRENCY_NEW) + { + SendNewCurrency(id); + return; + } + WorldPacket packet(SMSG_UPDATE_CURRENCY, 12); packet.WriteBit(weekCap != 0); @@ -16717,8 +16824,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) SetArenaTeamInfoField(arena_slot, ArenaTeamInfoType(j), 0); } - SetCurrency(CURRENCY_TYPE_CONQUEST_POINTS, fields[40].GetUInt32()); - SetCurrency(CURRENCY_TYPE_HONOR_POINTS, fields[41].GetUInt32()); + _LoadCurrency(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADCURRENCY)); SetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS, fields[42].GetUInt32()); SetUInt16Value(PLAYER_FIELD_KILLS, 0, fields[43].GetUInt16()); SetUInt16Value(PLAYER_FIELD_KILLS, 1, fields[44].GetUInt16()); @@ -18833,6 +18939,7 @@ void Player::SaveToDB(bool create /*=false*/) GetSession()->SaveTutorialsData(trans); // changed only while character in game _SaveGlyphs(trans); _SaveInstanceTimeRestrictions(trans); + _SaveCurrency(trans); // check if stats should only be saved on logout // save stats can be out of transaction @@ -18850,6 +18957,7 @@ void Player::SaveToDB(bool create /*=false*/) void Player::SaveInventoryAndGoldToDB(SQLTransaction& trans) { _SaveInventory(trans); + _SaveCurrency(trans); SaveGoldToDB(trans); } diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index c4047485033..219880df7f5 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -130,7 +130,7 @@ enum PlayerCurrencyState PLAYERCURRENCY_UNCHANGED = 0, PLAYERCURRENCY_CHANGED = 1, PLAYERCURRENCY_NEW = 2, - PLAYERCURRENCY_REMOVED = 3 + PLAYERCURRENCY_REMOVED = 3 //not removed just set count == 0 }; struct PlayerCurrency @@ -792,6 +792,7 @@ enum PlayerLoginQueryIndex PLAYER_LOGIN_QUERY_LOADINSTANCELOCKTIMES = 30, PLAYER_LOGIN_QUERY_LOADSEASONALQUESTSTATUS = 31, PLAYER_LOGIN_QUERY_LOADVOIDSTORAGE = 32, + PLAYER_LOGIN_QUERY_LOADCURRENCY = 33, MAX_PLAYER_LOGIN_QUERY, }; @@ -1340,6 +1341,7 @@ class Player : public Unit, public GridObject void AddRefundReference(uint32 it); void DeleteRefundReference(uint32 it); + void SendNewCurrency(uint32 id) const; void SendCurrencies() const; uint32 GetCurrency(uint32 id) const; bool HasCurrency(uint32 id, uint32 count) const; @@ -2695,6 +2697,7 @@ class Player : public Unit, public GridObject void _LoadGlyphs(PreparedQueryResult result); void _LoadTalents(PreparedQueryResult result); void _LoadInstanceTimeRestrictions(PreparedQueryResult result); + void _LoadCurrency(PreparedQueryResult result); /*********************************************************/ /*** SAVE SYSTEM ***/ @@ -2717,6 +2720,7 @@ class Player : public Unit, public GridObject void _SaveTalents(SQLTransaction& trans); void _SaveStats(SQLTransaction& trans); void _SaveInstanceTimeRestrictions(SQLTransaction& trans); + void _SaveCurrency(SQLTransaction& trans); /*********************************************************/ /*** ENVIRONMENTAL SYSTEM ***/ diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index c7b66381158..b28ce3ab180 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -202,6 +202,10 @@ bool LoginQueryHolder::Initialize() stmt->setUInt32(0, m_accountId); res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADINSTANCELOCKTIMES, stmt); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PLAYER_CURRENCY); + stmt->setUInt32(0, lowGuid); + res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADCURRENCY, stmt); + return res; } diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index 368e70a758c..b441ad6939f 100755 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -257,6 +257,11 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_INS_AURA, "INSERT INTO character_aura (guid, caster_guid, item_guid, spell, effect_mask, recalculate_mask, stackcount, amount0, amount1, amount2, base_amount0, base_amount1, base_amount2, maxduration, remaintime, remaincharges) " "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) + // Currency + PREPARE_STATEMENT(CHAR_SEL_PLAYER_CURRENCY, "SELECT currency, week_count, total_count FROM character_currency WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_UPD_PLAYER_CURRENCY, "UPDATE character_currency SET week_count = ?, total_count = ? WHERE guid = ? AND currency = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_REP_PLAYER_CURRENCY, "REPLACE INTO character_currency (guid, currency, week_count, total_count) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC); + // Account data PREPARE_STATEMENT(CHAR_SEL_ACCOUNT_DATA, "SELECT type, time, data FROM account_data WHERE accountId = ?", CONNECTION_SYNCH) PREPARE_STATEMENT(CHAR_REP_ACCOUNT_DATA, "REPLACE INTO account_data (accountId, type, time, data) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC) diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.h b/src/server/shared/Database/Implementation/CharacterDatabase.h index 8c7042ad926..9682a6ab641 100755 --- a/src/server/shared/Database/Implementation/CharacterDatabase.h +++ b/src/server/shared/Database/Implementation/CharacterDatabase.h @@ -248,6 +248,10 @@ enum CharacterDatabaseStatements CHAR_INS_AURA, + CHAR_SEL_PLAYER_CURRENCY, + CHAR_UPD_PLAYER_CURRENCY, + CHAR_REP_PLAYER_CURRENCY, + CHAR_SEL_ACCOUNT_DATA, CHAR_REP_ACCOUNT_DATA, CHAR_DEL_ACCOUNT_DATA, -- cgit v1.2.3 From dcfaf070546df192415c32b36787bbbdf340bba3 Mon Sep 17 00:00:00 2001 From: cyberbrest Date: Mon, 3 Sep 2012 22:51:13 +0300 Subject: [Core/Currency] drop conquestPoints and totalHonorPoints columns with porting data to new table. --- .../2012_09_03_01_characters_currency.sql | 3 ++ .../2012_09_03_02_characters_characters.sql | 2 ++ src/server/game/Entities/Player/Player.cpp | 42 ++++++++++------------ .../Database/Implementation/CharacterDatabase.cpp | 9 +++-- .../Database/Implementation/CharacterDatabase.h | 1 - 5 files changed, 28 insertions(+), 29 deletions(-) create mode 100644 sql/updates/characters/2012_09_03_01_characters_currency.sql create mode 100644 sql/updates/characters/2012_09_03_02_characters_characters.sql (limited to 'src') diff --git a/sql/updates/characters/2012_09_03_01_characters_currency.sql b/sql/updates/characters/2012_09_03_01_characters_currency.sql new file mode 100644 index 00000000000..308f0dfeafd --- /dev/null +++ b/sql/updates/characters/2012_09_03_01_characters_currency.sql @@ -0,0 +1,3 @@ +-- porting from characters table +insert into `character_currency` (`guid`, `currency`, `total_count`, `week_count`) SELECT characters.guid, 392, characters.totalHonorPoints, 0 FROM characters WHERE characters.totalHonorPoints > 0; +insert into `character_currency` (`guid`, `currency`, `total_count`, `week_count`) SELECT characters.guid, 390, characters.conquestPoints, 0 FROM characters WHERE characters.conquestPoints > 0; \ No newline at end of file diff --git a/sql/updates/characters/2012_09_03_02_characters_characters.sql b/sql/updates/characters/2012_09_03_02_characters_characters.sql new file mode 100644 index 00000000000..7dc811fe66d --- /dev/null +++ b/sql/updates/characters/2012_09_03_02_characters_characters.sql @@ -0,0 +1,2 @@ +ALTER TABLE `characters` DROP `conquestPoints`; +ALTER TABLE `characters` DROP `totalHonorPoints`; \ No newline at end of file diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 2661c83842c..e203f1240a0 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -16663,11 +16663,11 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) //"position_x, position_y, position_z, map, orientation, taximask, cinematic, totaltime, leveltime, rest_bonus, logout_time, is_logout_resting, resettalents_cost, " // 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 //"resettalents_time, talentTree, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, online, death_expire_time, taxi_path, instance_mode_mask, " - // 40 41 42 43 44 45 46 47 - //"conquestPoints, totalHonorPoints, totalKills, todayKills, yesterdayKills, chosenTitle, watchedFaction, drunk, " - // 48 49 50 51 52 53 54 55 56 57 58 + // 40 41 42 43 44 45 + //"totalKills, todayKills, yesterdayKills, chosenTitle, watchedFaction, drunk, " + // 46 47 48 49 50 51 52 53 54 55 56 //"health, power1, power2, power3, power4, power5, instance_id, speccount, activespec, exploredZones, equipmentCache, " - // 59 60 61 + // 57 58 59 //"knownTitles, actionBars, grantableLevels FROM characters WHERE guid = '%u'", guid); PreparedQueryResult result = holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADFROM); @@ -16733,8 +16733,8 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) SetUInt32Value(UNIT_FIELD_LEVEL, fields[6].GetUInt8()); SetUInt32Value(PLAYER_XP, fields[7].GetUInt32()); - _LoadIntoDataField(fields[57].GetCString(), PLAYER_EXPLORED_ZONES_1, PLAYER_EXPLORED_ZONES_SIZE); - _LoadIntoDataField(fields[59].GetCString(), PLAYER__FIELD_KNOWN_TITLES, KNOWN_TITLES_SIZE*2); + _LoadIntoDataField(fields[55].GetCString(), PLAYER_EXPLORED_ZONES_1, PLAYER_EXPLORED_ZONES_SIZE); + _LoadIntoDataField(fields[57].GetCString(), PLAYER__FIELD_KNOWN_TITLES, KNOWN_TITLES_SIZE*2); SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, DEFAULT_WORLD_OBJECT_SIZE); SetFloatValue(UNIT_FIELD_COMBATREACH, 1.5f); @@ -16751,12 +16751,12 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) SetUInt32Value(PLAYER_BYTES, fields[9].GetUInt32()); SetUInt32Value(PLAYER_BYTES_2, fields[10].GetUInt32()); SetByteValue(PLAYER_BYTES_3, 0, fields[5].GetUInt8()); - SetByteValue(PLAYER_BYTES_3, 1, fields[47].GetUInt8()); + SetByteValue(PLAYER_BYTES_3, 1, fields[45].GetUInt8()); SetUInt32Value(PLAYER_FLAGS, fields[11].GetUInt32()); - SetInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, fields[46].GetUInt32()); + SetInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, fields[44].GetUInt32()); // set which actionbars the client has active - DO NOT REMOVE EVER AGAIN (can be changed though, if it does change fieldwise) - SetByteValue(PLAYER_FIELD_BYTES, 2, fields[60].GetUInt8()); + SetByteValue(PLAYER_FIELD_BYTES, 2, fields[58].GetUInt8()); InitDisplayIds(); @@ -16789,7 +16789,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) Relocate(fields[12].GetFloat(), fields[13].GetFloat(), fields[14].GetFloat(), fields[16].GetFloat()); uint32 mapId = fields[15].GetUInt16(); - uint32 instanceId = fields[54].GetUInt32(); + uint32 instanceId = fields[52].GetUInt32(); uint32 dungeonDiff = fields[39].GetUInt8() & 0x0F; if (dungeonDiff >= MAX_DUNGEON_DIFFICULTY) @@ -16825,9 +16825,9 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) } _LoadCurrency(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADCURRENCY)); - SetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS, fields[42].GetUInt32()); - SetUInt16Value(PLAYER_FIELD_KILLS, 0, fields[43].GetUInt16()); - SetUInt16Value(PLAYER_FIELD_KILLS, 1, fields[44].GetUInt16()); + SetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS, fields[40].GetUInt32()); + SetUInt16Value(PLAYER_FIELD_KILLS, 0, fields[41].GetUInt16()); + SetUInt16Value(PLAYER_FIELD_KILLS, 1, fields[42].GetUInt16()); _LoadBoundInstances(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADBOUNDINSTANCES)); _LoadInstanceTimeRestrictions(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADINSTANCELOCKTIMES)); @@ -17146,8 +17146,8 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) //mails are loaded only when needed ;-) - when player in game click on mailbox. //_LoadMail(); - SetSpecsCount(fields[55].GetUInt8()); - SetActiveSpec(fields[56].GetUInt8()); + SetSpecsCount(fields[53].GetUInt8()); + SetActiveSpec(fields[54].GetUInt8()); // sanity check if (GetSpecsCount() > MAX_TALENT_SPECS || GetActiveSpec() > MAX_TALENT_SPEC || GetSpecsCount() < MIN_TALENT_SPECS) @@ -17198,7 +17198,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) // check PLAYER_CHOSEN_TITLE compatibility with PLAYER__FIELD_KNOWN_TITLES // note: PLAYER__FIELD_KNOWN_TITLES updated at quest status loaded - uint32 curTitle = fields[45].GetUInt32(); + uint32 curTitle = fields[43].GetUInt32(); if (curTitle && !HasTitle(curTitle)) curTitle = 0; @@ -17221,14 +17221,14 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) UpdateAllStats(); // restore remembered power/health values (but not more max values) - uint32 savedHealth = fields[48].GetUInt32(); + uint32 savedHealth = fields[46].GetUInt32(); SetHealth(savedHealth > GetMaxHealth() ? GetMaxHealth() : savedHealth); uint32 loadedPowers = 0; for (uint32 i = 0; i < MAX_POWERS; ++i) { if (GetPowerIndexByClass(Powers(i), getClass()) != MAX_POWERS) { - uint32 savedPower = fields[49+loadedPowers].GetUInt32(); + uint32 savedPower = fields[47+loadedPowers].GetUInt32(); uint32 maxPower = GetUInt32Value(UNIT_FIELD_MAXPOWER1 + loadedPowers); SetPower(Powers(i), (savedPower > maxPower) ? maxPower : savedPower); if (++loadedPowers >= MAX_STORED_POWERS) @@ -17307,7 +17307,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) } // RaF stuff. - m_grantableLevels = fields[61].GetUInt8(); + m_grantableLevels = fields[59].GetUInt8(); if (GetSession()->IsARecruiter() || (GetSession()->GetRecruiterId() != 0)) SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_REFER_A_FRIEND); @@ -18727,8 +18727,6 @@ void Player::SaveToDB(bool create /*=false*/) ss << m_taxi.SaveTaxiDestinationsToString(); stmt->setString(index++, ss.str()); - stmt->setUInt32(index++, GetCurrency(CURRENCY_TYPE_CONQUEST_POINTS)); - stmt->setUInt32(index++, GetCurrency(CURRENCY_TYPE_HONOR_POINTS)); stmt->setUInt32(index++, GetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS)); stmt->setUInt16(index++, GetUInt16Value(PLAYER_FIELD_KILLS, 0)); stmt->setUInt16(index++, GetUInt16Value(PLAYER_FIELD_KILLS, 1)); @@ -18849,8 +18847,6 @@ void Player::SaveToDB(bool create /*=false*/) ss << m_taxi.SaveTaxiDestinationsToString(); stmt->setString(index++, ss.str()); - stmt->setUInt32(index++, GetCurrency(CURRENCY_TYPE_CONQUEST_POINTS)); - stmt->setUInt32(index++, GetCurrency(CURRENCY_TYPE_HONOR_POINTS)); stmt->setUInt32(index++, GetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS)); stmt->setUInt16(index++, GetUInt16Value(PLAYER_FIELD_KILLS, 0)); stmt->setUInt16(index++, GetUInt16Value(PLAYER_FIELD_KILLS, 1)); diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index b441ad6939f..cf8a5880032 100755 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -65,7 +65,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_SEL_CHARACTER, "SELECT guid, account, name, race, class, gender, level, xp, money, playerBytes, playerBytes2, playerFlags, " "position_x, position_y, position_z, map, orientation, taximask, cinematic, totaltime, leveltime, rest_bonus, logout_time, is_logout_resting, resettalents_cost, " "resettalents_time, talentTree, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, online, death_expire_time, taxi_path, instance_mode_mask, " - "conquestPoints, totalHonorPoints, totalKills, todayKills, yesterdayKills, chosenTitle, watchedFaction, drunk, " + "totalKills, todayKills, yesterdayKills, chosenTitle, watchedFaction, drunk, " "health, power1, power2, power3, power4, power5, instance_id, speccount, activespec, exploredZones, equipmentCache, knownTitles, actionBars, grantableLevels FROM characters WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_GROUP_MEMBER, "SELECT guid FROM group_member WHERE memberGuid = ?", CONNECTION_BOTH) PREPARE_STATEMENT(CHAR_SEL_CHARACTER_INSTANCE, "SELECT id, permanent, map, difficulty, resettime FROM character_instance LEFT JOIN instance ON instance = id WHERE guid = ?", CONNECTION_ASYNC) @@ -369,14 +369,14 @@ void CharacterDatabaseConnection::DoPrepareStatements() "taximask, cinematic, " "totaltime, leveltime, rest_bonus, logout_time, is_logout_resting, resettalents_cost, resettalents_time, talentTree, " "extra_flags, stable_slots, at_login, zone, " - "death_expire_time, taxi_path, conquestPoints, totalHonorPoints, totalKills, " + "death_expire_time, taxi_path, totalKills, " "todayKills, yesterdayKills, chosenTitle, watchedFaction, drunk, health, power1, power2, power3, " "power4, power5, latency, speccount, activespec, exploredZones, equipmentCache, knownTitles, actionBars, grantableLevels) VALUES " - "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", CONNECTION_ASYNC); + "(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_UPD_CHARACTER, "UPDATE characters SET name=?,race=?,class=?,gender=?,level=?,xp=?,money=?,playerBytes=?,playerBytes2=?,playerFlags=?," "map=?,instance_id=?,instance_mode_mask=?,position_x=?,position_y=?,position_z=?,orientation=?,taximask=?,cinematic=?,totaltime=?,leveltime=?,rest_bonus=?," "logout_time=?,is_logout_resting=?,resettalents_cost=?,resettalents_time=?,talentTree=?,extra_flags=?,stable_slots=?,at_login=?,zone=?,death_expire_time=?,taxi_path=?," - "conquestPoints=?,totalHonorPoints=?,totalKills=?,todayKills=?,yesterdayKills=?,chosenTitle=?," + "totalKills=?,todayKills=?,yesterdayKills=?,chosenTitle=?," "watchedFaction=?,drunk=?,health=?,power1=?,power2=?,power3=?,power4=?,power5=?,latency=?,speccount=?,activespec=?,exploredZones=?," "equipmentCache=?,knownTitles=?,actionBars=?,grantableLevels=?,online=? WHERE guid=?", CONNECTION_ASYNC); @@ -539,7 +539,6 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_DEL_CHAR_QUESTSTATUS_DAILY, "DELETE FROM character_queststatus_daily WHERE guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_DEL_CHAR_TALENT, "DELETE FROM character_talent WHERE guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_DEL_CHAR_SKILLS, "DELETE FROM character_skills WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_UDP_CHAR_HONOR_POINTS, "UPDATE characters SET totalHonorPoints = ? WHERE guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_UDP_CHAR_MONEY, "UPDATE characters SET money = ? WHERE guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_INS_CHAR_ACTION, "INSERT INTO character_action (guid, spec, button, action, type) VALUES (?, ?, ?, ?, ?)", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_UPD_CHAR_ACTION, "UPDATE character_action SET action = ?, type = ? WHERE guid = ? AND button = ? AND spec = ?", CONNECTION_ASYNC); diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.h b/src/server/shared/Database/Implementation/CharacterDatabase.h index 9682a6ab641..b63b67914f2 100755 --- a/src/server/shared/Database/Implementation/CharacterDatabase.h +++ b/src/server/shared/Database/Implementation/CharacterDatabase.h @@ -501,7 +501,6 @@ enum CharacterDatabaseStatements CHAR_DEL_CHAR_QUESTSTATUS_DAILY, CHAR_DEL_CHAR_TALENT, CHAR_DEL_CHAR_SKILLS, - CHAR_UDP_CHAR_HONOR_POINTS, CHAR_UDP_CHAR_MONEY, CHAR_INS_CHAR_ACTION, CHAR_UPD_CHAR_ACTION, -- cgit v1.2.3 From 6ab07e81bd6aaa163fdfc5ee56cfdf498cc02068 Mon Sep 17 00:00:00 2001 From: cyberbrest Date: Mon, 3 Sep 2012 23:27:14 +0300 Subject: Core/Misc: typo --- src/server/game/Entities/Player/Player.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index e203f1240a0..d7e27420076 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -7350,7 +7350,7 @@ void Player::_SaveCurrency(SQLTransaction& trans) } } -void SendNewCurrency(uint32 id) const +void Player::SendNewCurrency(uint32 id) const { PlayerCurrenciesMap::const_iterator itr = m_currencies.find(id); if (itr == m_currencies.end()) -- cgit v1.2.3 From c969fd1f3a2bbed68bb4eea1cbb7309f90fedaa8 Mon Sep 17 00:00:00 2001 From: cyberbrest Date: Tue, 4 Sep 2012 00:22:00 +0300 Subject: Core/Currency: codestyle and Doxygen documentation. --- src/server/game/Entities/Player/Player.cpp | 32 +++++++++++++++--------------- src/server/game/Entities/Player/Player.h | 16 ++++++++++++++- 2 files changed, 31 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index d7e27420076..eb7208ceb46 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -7302,7 +7302,7 @@ void Player::_LoadCurrency(PreparedQueryResult result) uint16 currencyID = fields[0].GetUInt16(); CurrencyTypesEntry const* currency = sCurrencyTypesStore.LookupEntry(currencyID); - if(!currencyID) + if (!currencyID) continue; PlayerCurrency cur; @@ -7310,7 +7310,7 @@ void Player::_LoadCurrency(PreparedQueryResult result) cur.weekCount = fields[1].GetUInt32(); cur.totalCount = fields[2].GetUInt32(); - m_currencies.insert(PlayerCurrenciesMap::value_type(currencyID, cur)); + _currencyStorage.insert(PlayerCurrenciesMap::value_type(currencyID, cur)); } while (result->NextRow()); } @@ -7318,7 +7318,7 @@ void Player::_LoadCurrency(PreparedQueryResult result) void Player::_SaveCurrency(SQLTransaction& trans) { PreparedStatement* stmt = NULL; - for (PlayerCurrenciesMap::iterator itr = m_currencies.begin(); itr != m_currencies.end(); ++itr) + for (PlayerCurrenciesMap::iterator itr = _currencyStorage.begin(); itr != _currencyStorage.end(); ++itr) { CurrencyTypesEntry const* entry = sCurrencyTypesStore.LookupEntry(itr->first); if (!entry) // should never happen @@ -7352,8 +7352,8 @@ void Player::_SaveCurrency(SQLTransaction& trans) void Player::SendNewCurrency(uint32 id) const { - PlayerCurrenciesMap::const_iterator itr = m_currencies.find(id); - if (itr == m_currencies.end()) + PlayerCurrenciesMap::const_iterator itr = _currencyStorage.find(id); + if (itr == _currencyStorage.end()) return; ByteBuffer currencyData; @@ -7392,10 +7392,10 @@ void Player::SendNewCurrency(uint32 id) const void Player::SendCurrencies() const { ByteBuffer currencyData; - WorldPacket packet(SMSG_INIT_CURRENCY, 4 + m_currencies.size()*(5*4 + 1)); - packet.WriteBits(m_currencies.size(), 23); + WorldPacket packet(SMSG_INIT_CURRENCY, 4 + _currencyStorage.size()*(5*4 + 1)); + packet.WriteBits(_currencyStorage.size(), 23); - for (PlayerCurrenciesMap::const_iterator itr = m_currencies.begin(); itr != m_currencies.end(); ++itr) + for (PlayerCurrenciesMap::const_iterator itr = _currencyStorage.begin(); itr != _currencyStorage.end(); ++itr) { CurrencyTypesEntry const* entry = sCurrencyTypesStore.LookupEntry(itr->first); if (!entry) // should never happen @@ -7429,14 +7429,14 @@ void Player::SendCurrencies() const uint32 Player::GetCurrency(uint32 id) const { - PlayerCurrenciesMap::const_iterator itr = m_currencies.find(id); - return itr != m_currencies.end() ? itr->second.totalCount : 0; + PlayerCurrenciesMap::const_iterator itr = _currencyStorage.find(id); + return itr != _currencyStorage.end() ? itr->second.totalCount : 0; } bool Player::HasCurrency(uint32 id, uint32 count) const { - PlayerCurrenciesMap::const_iterator itr = m_currencies.find(id); - return itr != m_currencies.end() && itr->second.totalCount >= count; + PlayerCurrenciesMap::const_iterator itr = _currencyStorage.find(id); + return itr != _currencyStorage.end() && itr->second.totalCount >= count; } void Player::ModifyCurrency(uint32 id, int32 count, bool printLog/* = true*/) @@ -7450,15 +7450,15 @@ void Player::ModifyCurrency(uint32 id, int32 count, bool printLog/* = true*/) int32 precision = currency->Flags & CURRENCY_FLAG_HIGH_PRECISION ? 100 : 1; uint32 oldTotalCount = 0; uint32 oldWeekCount = 0; - PlayerCurrenciesMap::iterator itr = m_currencies.find(id); - if (itr == m_currencies.end()) + PlayerCurrenciesMap::iterator itr = _currencyStorage.find(id); + if (itr == _currencyStorage.end()) { PlayerCurrency cur; cur.state = PLAYERCURRENCY_NEW; cur.totalCount = 0; cur.weekCount = 0; - m_currencies[id] = cur; - itr = m_currencies.find(id); + _currencyStorage[id] = cur; + itr = _currencyStorage.find(id); } else { diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 219880df7f5..bf3d061d21e 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1341,11 +1341,25 @@ class Player : public Unit, public GridObject void AddRefundReference(uint32 it); void DeleteRefundReference(uint32 it); + /// send initialization of new currency for client void SendNewCurrency(uint32 id) const; + /// send full data about all currencies to client void SendCurrencies() const; + /// return count of currency witch has plr uint32 GetCurrency(uint32 id) const; + /// return presence related currency bool HasCurrency(uint32 id, uint32 count) const; + /// @todo: not understand why it subtract from total count and for what it used. It should be remove and replaced by ModifyCurrency void SetCurrency(uint32 id, uint32 count, bool printLog = true); + + /** + * @name ModifyCurrency + * @brief Change specific currency and send result to client + + * @param id currency entry from CurrencyTypes.dbc + * @param count integer value for adding/removing curent currency + * @param printLog used on SMSG_UPDATE_CURRENCY + */ void ModifyCurrency(uint32 id, int32 count, bool printLog = true); void ApplyEquipCooldown(Item* pItem); @@ -2752,7 +2766,7 @@ class Player : public Unit, public GridObject Item* m_items[PLAYER_SLOTS_COUNT]; uint32 m_currentBuybackSlot; - PlayerCurrenciesMap m_currencies; + PlayerCurrenciesMap _currencyStorage; uint32 _GetCurrencyWeekCap(const CurrencyTypesEntry* currency) const; VoidStorageItem* _voidStorageItems[VOID_STORAGE_MAX_SLOT]; -- cgit v1.2.3 From 9c954a0cc4c850c0f9e594380f8e3cb1d6ce1dbb Mon Sep 17 00:00:00 2001 From: Shocker Date: Tue, 4 Sep 2012 17:15:37 +0300 Subject: Core/Spells: Crowd control spells PvP duration has been decreased to 8 seconds (down from 10) --- src/server/game/Spells/SpellMgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index fe7a0eab229..d74263e8588 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -305,7 +305,7 @@ int32 GetDiminishingReturnsLimitDuration(DiminishingGroup group, SpellInfo const break; } - return 10 * IN_MILLISECONDS; + return 8 * IN_MILLISECONDS; } bool IsDiminishingReturnsGroupDurationLimited(DiminishingGroup group) -- cgit v1.2.3 From a005d4a9e31a294e00d256652080f2d872509046 Mon Sep 17 00:00:00 2001 From: Shocker Date: Tue, 4 Sep 2012 17:52:10 +0300 Subject: Core/Spells: Implement SPELL_AURA_MOD_VENDOR_ITEMS_PRICES --- src/server/game/Entities/Player/Player.cpp | 3 +++ src/server/game/Handlers/ItemHandler.cpp | 3 +++ src/server/game/Spells/Auras/SpellAuraDefines.h | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index eb7208ceb46..3919c6d3bc3 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -21363,6 +21363,9 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32 // reputation discount price = uint32(floor(price * GetReputationPriceDiscount(creature))); + if (int32 priceMod = GetTotalAuraModifier(SPELL_AURA_MOD_VENDOR_ITEMS_PRICES)) + price -= CalculatePctN(price, priceMod); + if (!HasEnoughMoney(uint64(price))) { SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, creature, item, 0); diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 3b38db78d94..5b5f83719e3 100644 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -775,6 +775,9 @@ void WorldSession::SendListInventory(uint64 vendorGuid) } int32 price = vendorItem->IsGoldRequired(itemTemplate) ? uint32(floor(itemTemplate->BuyPrice * discountMod)) : 0; + + if (int32 priceMod = _player->GetTotalAuraModifier(SPELL_AURA_MOD_VENDOR_ITEMS_PRICES)) + price -= CalculatePctN(price, priceMod); itemsData << uint32(count++ + 1); // client expects counting to start at 1 itemsData << uint32(itemTemplate->MaxDurability); diff --git a/src/server/game/Spells/Auras/SpellAuraDefines.h b/src/server/game/Spells/Auras/SpellAuraDefines.h index 1482136f52e..c20397aa960 100755 --- a/src/server/game/Spells/Auras/SpellAuraDefines.h +++ b/src/server/game/Spells/Auras/SpellAuraDefines.h @@ -396,7 +396,7 @@ enum AuraType SPELL_AURA_334 = 334, SPELL_AURA_335 = 335, SPELL_AURA_MOD_FLYING_RESTRICTIONS = 336, // NYI - SPELL_AURA_MOD_VENDOR_ITEMS_PRICES = 337, // NYI + SPELL_AURA_MOD_VENDOR_ITEMS_PRICES = 337, SPELL_AURA_MOD_DURABILITY_LOSS = 338, SPELL_AURA_INCREASE_SKILL_GAIN_CHANCE = 339, // NYI SPELL_AURA_340 = 340, -- cgit v1.2.3 From 41cf99f1d940caee09e37d312d54b19eacd3f161 Mon Sep 17 00:00:00 2001 From: Nay Date: Wed, 5 Sep 2012 02:55:42 +0100 Subject: Core/Misc: Rename void storage related prep. statements to comply with standards --- src/server/game/Entities/Player/Player.cpp | 4 ++-- src/server/game/Handlers/CharacterHandler.cpp | 2 +- src/server/shared/Database/Implementation/CharacterDatabase.cpp | 6 +++--- src/server/shared/Database/Implementation/CharacterDatabase.h | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 3919c6d3bc3..5d8109b41e2 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -19200,14 +19200,14 @@ void Player::_SaveVoidStorage(SQLTransaction& trans) if (!_voidStorageItems[i]) // unused item { // DELETE FROM void_storage WHERE slot = ? AND playerGuid = ? - stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_VOID_STORAGE_ITEM_BY_SLOT); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_VOID_STORAGE_ITEM_BY_SLOT); stmt->setUInt8(0, i); stmt->setUInt32(1, lowGuid); } else { // REPLACE INTO character_inventory (itemId, playerGuid, itemEntry, slot, creatorGuid) VALUES (?, ?, ?, ?, ?) - stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_VOID_STORAGE_ITEM); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_CHAR_VOID_STORAGE_ITEM); stmt->setUInt64(0, _voidStorageItems[i]->ItemId); stmt->setUInt32(1, lowGuid); stmt->setUInt32(2, _voidStorageItems[i]->ItemEntry); diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index b28ce3ab180..7e1195463a2 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -110,7 +110,7 @@ bool LoginQueryHolder::Initialize() stmt->setUInt32(0, lowGuid); res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADINVENTORY, stmt); - stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_VOID_STORAGE); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_VOID_STORAGE); stmt->setUInt32(0, lowGuid); res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADVOIDSTORAGE, stmt); diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index cf8a5880032..aff2083ca5f 100755 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -567,7 +567,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_SEL_CHAR_PET_BY_ENTRY_AND_SLOT, "SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, abdata, savetime, CreatedBySpell, PetType FROM character_pet WHERE owner = ? AND slot = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_UPD_CHAR_LIST_SLOT, "UPDATE characters SET slot = ? WHERE guid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_SEL_VOID_STORAGE, "SELECT itemId, itemEntry, slot, creatorGuid, randomProperty, suffixFactor FROM character_void_storage WHERE playerGuid = ?", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_REP_VOID_STORAGE_ITEM, "REPLACE INTO character_void_storage (itemId, playerGuid, itemEntry, slot, creatorGuid, randomProperty, suffixFactor) VALUES (?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_VOID_STORAGE_ITEM_BY_SLOT, "DELETE FROM character_void_storage WHERE slot = ? AND playerGuid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_SEL_CHAR_VOID_STORAGE, "SELECT itemId, itemEntry, slot, creatorGuid, randomProperty, suffixFactor FROM character_void_storage WHERE playerGuid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_REP_CHAR_VOID_STORAGE_ITEM, "REPLACE INTO character_void_storage (itemId, playerGuid, itemEntry, slot, creatorGuid, randomProperty, suffixFactor) VALUES (?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_DEL_CHAR_VOID_STORAGE_ITEM_BY_SLOT, "DELETE FROM character_void_storage WHERE slot = ? AND playerGuid = ?", CONNECTION_ASYNC); } diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.h b/src/server/shared/Database/Implementation/CharacterDatabase.h index b63b67914f2..0634e226d5e 100755 --- a/src/server/shared/Database/Implementation/CharacterDatabase.h +++ b/src/server/shared/Database/Implementation/CharacterDatabase.h @@ -529,9 +529,9 @@ enum CharacterDatabaseStatements CHAR_SEL_CHAR_PET_BY_ENTRY_AND_SLOT, CHAR_UPD_CHAR_LIST_SLOT, - CHAR_SEL_VOID_STORAGE, - CHAR_REP_VOID_STORAGE_ITEM, - CHAR_DEL_VOID_STORAGE_ITEM_BY_SLOT, + CHAR_SEL_CHAR_VOID_STORAGE, + CHAR_REP_CHAR_VOID_STORAGE_ITEM, + CHAR_DEL_CHAR_VOID_STORAGE_ITEM_BY_SLOT, MAX_CHARACTERDATABASE_STATEMENTS, }; -- cgit v1.2.3 From 8fe7fd4bd55d40badab847b7baf8a83b2d26d73c Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 5 Sep 2012 16:40:42 +0200 Subject: Core/Units: Updated mana regen and removed 5 second rule --- src/server/game/Entities/Creature/Creature.cpp | 9 +++------ src/server/game/Entities/Player/Player.cpp | 3 +-- src/server/game/Entities/Unit/StatSystem.cpp | 21 +++++++++++---------- src/server/game/Entities/Unit/Unit.cpp | 6 ------ src/server/game/Entities/Unit/Unit.h | 4 ---- src/server/game/Spells/Spell.cpp | 4 ---- 6 files changed, 15 insertions(+), 32 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 6270b3b64c0..5e7f5984ac5 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -616,13 +616,10 @@ void Creature::RegenerateMana() // Combat and any controlled creature if (isInCombat() || GetCharmerOrOwnerGUID()) { - if (!IsUnderLastManaUseEffect()) - { - float ManaIncreaseRate = sWorld->getRate(RATE_POWER_MANA); - float Spirit = GetStat(STAT_SPIRIT); + float ManaIncreaseRate = sWorld->getRate(RATE_POWER_MANA); + float Spirit = GetStat(STAT_SPIRIT); - addvalue = uint32((Spirit / 5.0f + 17.0f) * ManaIncreaseRate); - } + addvalue = uint32((Spirit / 5.0f + 17.0f) * ManaIncreaseRate); } else addvalue = maxValue / 3; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 5d8109b41e2..46dd5759e78 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -2577,10 +2577,9 @@ void Player::Regenerate(Powers power) { case POWER_MANA: { - bool recentCast = IsUnderLastManaUseEffect(); float ManaIncreaseRate = sWorld->getRate(RATE_POWER_MANA); - if (recentCast) // Trinity Updates Mana in intervals of 2s, which is correct + if (isInCombat()) // Trinity Updates Mana in intervals of 2s, which is correct addvalue += GetFloatValue(UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER) * ManaIncreaseRate * ((0.001f * m_regenTimer) + CalculatePctF(0.001f, spellHaste)); else addvalue += GetFloatValue(UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER) * ManaIncreaseRate * ((0.001f * m_regenTimer) + CalculatePctF(0.001f, spellHaste)); diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index 7a2857f6a88..12d214e49ab 100755 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -686,21 +686,22 @@ void Player::ApplyHealthRegenBonus(int32 amount, bool apply) void Player::UpdateManaRegen() { // Mana regen from spirit - float power_regen = OCTRegenMPPerSpirit(); + float spirit_regen = OCTRegenMPPerSpirit(); // Apply PCT bonus from SPELL_AURA_MOD_POWER_REGEN_PERCENT aura on spirit base regen - power_regen *= GetTotalAuraMultiplierByMiscValue(SPELL_AURA_MOD_POWER_REGEN_PERCENT, POWER_MANA); + spirit_regen *= GetTotalAuraMultiplierByMiscValue(SPELL_AURA_MOD_POWER_REGEN_PERCENT, POWER_MANA); + + // SpiritRegen(SPI,INT,LEVEL) = (0.001 + (SPI x sqrt(INT) x BASE_REGEN[LEVEL])) x 5 + if (GetStat(STAT_INTELLECT) > 0.0f) + spirit_regen *= sqrt(GetStat(STAT_INTELLECT)); + + // CombatRegen = 5% of Base Mana + float base_regen = GetCreateMana() * 0.01f + GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_POWER_REGEN, POWER_MANA) / 5.0f; // Set regen rate in cast state apply only on spirit based regen int32 modManaRegenInterrupt = GetTotalAuraModifier(SPELL_AURA_MOD_MANA_REGEN_INTERRUPT); - if (!modManaRegenInterrupt || modManaRegenInterrupt > 100) - modManaRegenInterrupt = 100; - //From WowWiki: CombatRegen = 5% of Base Mana - float combat_regen = GetCreateMana() * 0.01f + GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_POWER_REGEN, POWER_MANA) / 5.0f; - SetStatFloatValue(UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER, CalculatePctN(combat_regen, modManaRegenInterrupt)); - // SpiritRegen(SPI,INT,LEVEL) = (0.001 + (SPI x sqrt(INT) x BASE_REGEN[LEVEL])) x 5 - float sqint = sqrt(GetStat(STAT_INTELLECT)); - SetStatFloatValue(UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER, 0.001f + power_regen * sqint); + SetStatFloatValue(UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER, base_regen + CalculatePctN(spirit_regen, modManaRegenInterrupt)); + SetStatFloatValue(UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER, 0.001f + spirit_regen + base_regen); } void Player::UpdateRuneRegen(RuneType rune) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index b72feefae4f..12bd06034c4 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -230,7 +230,6 @@ m_HostileRefManager(this), m_TempSpeed(0.0f), m_AutoRepeatFirstCast(false) m_baseSpellCritChance = 5; m_CombatTimer = 0; - m_lastManaUse = 0; for (uint8 i = 0; i < MAX_SPELL_SCHOOL; ++i) m_threatModifier[i] = 1.0f; @@ -14325,11 +14324,6 @@ float Unit::GetAPMultiplier(WeaponAttackType attType, bool normalized) } } -bool Unit::IsUnderLastManaUseEffect() const -{ - return getMSTimeDiff(m_lastManaUse, getMSTime()) < 5000; -} - void Unit::SetContestedPvP(Player* attackedPlayer) { Player* player = GetCharmerOrOwnerPlayerOrPlayerItself(); diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 92ad0d9d11f..60bf93e312d 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -2030,9 +2030,6 @@ class Unit : public WorldObject uint32 SpellCriticalDamageBonus(SpellInfo const* spellProto, uint32 damage, Unit* victim); uint32 SpellCriticalHealingBonus(SpellInfo const* spellProto, uint32 damage, Unit* victim); - void SetLastManaUse(uint32 spellCastTime) { m_lastManaUse = spellCastTime; } - bool IsUnderLastManaUseEffect() const; - void SetContestedPvP(Player* attackedPlayer = NULL); uint32 GetCastingTimeForBonus(SpellInfo const* spellProto, DamageEffectType damagetype, uint32 CastingTime) const; @@ -2349,7 +2346,6 @@ class Unit : public WorldObject uint32 m_state; // Even derived shouldn't modify uint32 m_CombatTimer; - uint32 m_lastManaUse; // msecs TimeTrackerSmall m_movesplineTimer; Diminishing m_Diminishing; diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 8a093bce2b9..efb4f2c3bc2 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -4408,10 +4408,6 @@ void Spell::TakePower() m_caster->ModifyPower(powerType, -m_powerCost); else m_caster->ModifyPower(powerType, -irand(0, m_powerCost/4)); - - // Set the five second timer - if (powerType == POWER_MANA && m_powerCost > 0) - m_caster->SetLastManaUse(getMSTime()); } void Spell::TakeAmmo() -- cgit v1.2.3 From 38dbea7583e1b6b7d666eaa53fbd753162f30697 Mon Sep 17 00:00:00 2001 From: cyberbrest Date: Wed, 5 Sep 2012 17:18:34 +0200 Subject: Core/Units: Fixed setting power fields from regeneration Signed-off-by: Shauren --- src/server/game/Entities/Player/Player.cpp | 38 ++++++++++++++++----------- src/server/game/Entities/Player/Player.h | 2 +- src/server/game/Miscellaneous/SharedDefines.h | 2 +- 3 files changed, 24 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 46dd5759e78..bef557e0b8f 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -836,7 +836,7 @@ Player::Player(WorldSession* session): Unit(true), m_achievementMgr(this), m_rep m_ChampioningFaction = 0; - for (uint8 i = 0; i < MAX_POWERS; ++i) + for (uint8 i = 0; i < MAX_POWERS_PER_CLASS; ++i) m_powerFraction[i] = 0; isDebugAreaTriggers = false; @@ -846,7 +846,7 @@ Player::Player(WorldSession* session): Unit(true), m_achievementMgr(this), m_rep m_SeasonalQuestChanged = false; SetPendingBind(0, 0); - + _activeCheats = CHEAT_NONE; memset(_voidStorageItems, 0, VOID_STORAGE_MAX_SLOT * sizeof(VoidStorageItem*)); @@ -2566,6 +2566,11 @@ void Player::Regenerate(Powers power) if (HasAuraTypeWithValue(SPELL_AURA_PREVENT_REGENERATE_POWER, power)) return; + // Skip regeneration for power type we cannot have + uint32 powerIndex = GetPowerIndexByClass(power, getClass()); + if (powerIndex == MAX_POWERS) + return; + float addvalue = 0.0f; // Powers now benefit from haste. @@ -2648,7 +2653,7 @@ void Player::Regenerate(Powers power) else return; - addvalue += m_powerFraction[power]; + addvalue += m_powerFraction[powerIndex]; uint32 integerValue = uint32(fabs(addvalue)); if (addvalue < 0.0f) @@ -2656,12 +2661,12 @@ void Player::Regenerate(Powers power) if (curValue > integerValue) { curValue -= integerValue; - m_powerFraction[power] = addvalue + integerValue; + m_powerFraction[powerIndex] = addvalue + integerValue; } else { curValue = 0; - m_powerFraction[power] = 0; + m_powerFraction[powerIndex] = 0; } } else @@ -2671,15 +2676,16 @@ void Player::Regenerate(Powers power) if (curValue > maxValue) { curValue = maxValue; - m_powerFraction[power] = 0; + m_powerFraction[powerIndex] = 0; } else - m_powerFraction[power] = addvalue - integerValue; + m_powerFraction[powerIndex] = addvalue - integerValue; } + if (m_regenTimerCount >= 2000) SetPower(power, curValue); else - UpdateUInt32Value(UNIT_FIELD_POWER1 + power, curValue); + UpdateUInt32Value(UNIT_FIELD_POWER1 + powerIndex, curValue); } void Player::RegenerateHealth() @@ -3105,7 +3111,7 @@ void Player::GiveLevel(uint8 level) sObjectMgr->GetPlayerClassLevelInfo(getClass(), level, basehp, basemana); // send levelup info to client - WorldPacket data(SMSG_LEVELUP_INFO, (4+4+MAX_STORED_POWERS*4+MAX_STATS*4)); + WorldPacket data(SMSG_LEVELUP_INFO, (4+4+MAX_POWERS_PER_CLASS*4+MAX_STATS*4)); data << uint32(level); data << uint32(int32(basehp) - int32(GetCreateHealth())); // for (int i = 0; i < MAX_STORED_POWERS; ++i) // Powers loop (0-10) @@ -17230,12 +17236,12 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) uint32 savedPower = fields[47+loadedPowers].GetUInt32(); uint32 maxPower = GetUInt32Value(UNIT_FIELD_MAXPOWER1 + loadedPowers); SetPower(Powers(i), (savedPower > maxPower) ? maxPower : savedPower); - if (++loadedPowers >= MAX_STORED_POWERS) + if (++loadedPowers >= MAX_POWERS_PER_CLASS) break; } } - for (; loadedPowers < MAX_STORED_POWERS; ++loadedPowers) + for (; loadedPowers < MAX_POWERS_PER_CLASS; ++loadedPowers) SetUInt32Value(UNIT_FIELD_POWER1 + loadedPowers, 0); SetPower(POWER_ECLIPSE, 0); @@ -18740,12 +18746,12 @@ void Player::SaveToDB(bool create /*=false*/) if (GetPowerIndexByClass(Powers(i), getClass()) != MAX_POWERS) { stmt->setUInt32(index++, GetUInt32Value(UNIT_FIELD_POWER1 + storedPowers)); - if (++storedPowers >= MAX_STORED_POWERS) + if (++storedPowers >= MAX_POWERS_PER_CLASS) break; } } - for (; storedPowers < MAX_STORED_POWERS; ++storedPowers) + for (; storedPowers < MAX_POWERS_PER_CLASS; ++storedPowers) stmt->setUInt32(index++, 0); stmt->setUInt32(index++, GetSession()->GetLatency()); @@ -18860,12 +18866,12 @@ void Player::SaveToDB(bool create /*=false*/) if (GetPowerIndexByClass(Powers(i), getClass()) != MAX_POWERS) { stmt->setUInt32(index++, GetUInt32Value(UNIT_FIELD_POWER1 + storedPowers)); - if (++storedPowers >= MAX_STORED_POWERS) + if (++storedPowers >= MAX_POWERS_PER_CLASS) break; } } - for (; storedPowers < MAX_STORED_POWERS; ++storedPowers) + for (; storedPowers < MAX_POWERS_PER_CLASS; ++storedPowers) stmt->setUInt32(index++, 0); stmt->setUInt32(index++, GetSession()->GetLatency()); @@ -19571,7 +19577,7 @@ void Player::_SaveStats(SQLTransaction& trans) stmt->setUInt32(index++, GetGUIDLow()); stmt->setUInt32(index++, GetMaxHealth()); - for (uint8 i = 0; i < MAX_STORED_POWERS; ++i) + for (uint8 i = 0; i < MAX_POWERS_PER_CLASS; ++i) stmt->setUInt32(index++, GetMaxPower(Powers(i))); for (uint8 i = 0; i < MAX_STATS; ++i) diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index bf3d061d21e..bfa70e611e6 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -2644,7 +2644,7 @@ class Player : public Unit, public GridObject uint32 m_regenTimerCount; uint32 m_holyPowerRegenTimerCount; uint32 m_focusRegenTimerCount; - float m_powerFraction[MAX_POWERS]; + float m_powerFraction[MAX_POWERS_PER_CLASS]; uint32 m_contestedPvPTimer; /*********************************************************/ diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index fc656f2e88b..52be807ee06 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -191,7 +191,7 @@ enum Powers POWER_HEALTH = 0xFFFFFFFE // (-2 as signed value) }; -#define MAX_STORED_POWERS 5 +#define MAX_POWERS_PER_CLASS 5 enum SpellSchools { -- cgit v1.2.3 From db819bbdbe091e97a8451bf9dc9d74b4c5899a41 Mon Sep 17 00:00:00 2001 From: Nay Date: Wed, 5 Sep 2012 19:01:28 +0100 Subject: Core/Player: Implement server-side loading/saving of CUF profiles CompactUnitFrames / RaidProfiles / GroupUI There are unknown fields added to DB, received and sent in packets that should be renamed --- sql/base/characters_database.sql | 38 +++- ...04_00_characters_character_cuf_profiles_434.sql | 19 ++ src/server/game/Battlefield/BattlefieldHandler.cpp | 22 +-- src/server/game/Entities/Player/Player.cpp | 85 ++++++++- src/server/game/Entities/Player/Player.h | 105 +++++++++++ src/server/game/Handlers/CharacterHandler.cpp | 4 + src/server/game/Handlers/GroupHandler.cpp | 6 +- src/server/game/Handlers/ItemHandler.cpp | 2 +- src/server/game/Handlers/MiscHandler.cpp | 194 +++++++++++++++++---- src/server/game/Server/Protocol/Opcodes.cpp | 4 +- src/server/game/Server/WorldSession.h | 4 + .../Database/Implementation/CharacterDatabase.cpp | 6 + .../Database/Implementation/CharacterDatabase.h | 4 + 13 files changed, 442 insertions(+), 51 deletions(-) create mode 100644 sql/updates/characters/2012_09_04_00_characters_character_cuf_profiles_434.sql (limited to 'src') diff --git a/sql/base/characters_database.sql b/sql/base/characters_database.sql index 6656fe7d48c..5396b23857c 100644 --- a/sql/base/characters_database.sql +++ b/sql/base/characters_database.sql @@ -507,6 +507,42 @@ LOCK TABLES `character_battleground_random` WRITE; /*!40000 ALTER TABLE `character_battleground_random` ENABLE KEYS */; UNLOCK TABLES; +-- +-- Table structure for table `character_cuf_profiles` +-- + +DROP TABLE IF EXISTS `character_cuf_profiles`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `character_cuf_profiles` ( + `guid` int(10) unsigned NOT NULL COMMENT 'Character Guid', + `id` tinyint(3) unsigned NOT NULL COMMENT 'Profile Id (0-5)', + `name` varchar(12) NOT NULL COMMENT 'Profile Name', + `frameHeight` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Profile Frame Height', + `frameWidth` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Profile Frame Width', + `sortBy` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT 'Frame Sort By', + `healthText` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT 'Frame Health Text', + `boolOptions` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Many Configurable Bool Options', + `unk146` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT 'Profile Unk Int8', + `unk147` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT 'Profile Unk Int8', + `unk148` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT 'Profile Unk Int8', + `unk150` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Profile Unk Int16', + `unk152` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Profile Unk Int16', + `unk154` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Profile Unk Int16', + PRIMARY KEY (`guid`,`id`), + KEY `index` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `character_cuf_profiles` +-- + +LOCK TABLES `character_cuf_profiles` WRITE; +/*!40000 ALTER TABLE `character_cuf_profiles` DISABLE KEYS */; +/*!40000 ALTER TABLE `character_cuf_profiles` ENABLE KEYS */; +UNLOCK TABLES; + -- -- Table structure for table `character_currency` -- @@ -2380,4 +2416,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2012-08-08 18:51:30 +-- Dump completed on 2012-09-05 18:59:26 diff --git a/sql/updates/characters/2012_09_04_00_characters_character_cuf_profiles_434.sql b/sql/updates/characters/2012_09_04_00_characters_character_cuf_profiles_434.sql new file mode 100644 index 00000000000..df0c825e67a --- /dev/null +++ b/sql/updates/characters/2012_09_04_00_characters_character_cuf_profiles_434.sql @@ -0,0 +1,19 @@ +DROP TABLE IF EXISTS `character_cuf_profiles`; +CREATE TABLE IF NOT EXISTS `character_cuf_profiles` ( + `guid` int(10) unsigned NOT NULL COMMENT 'Character Guid', + `id` tinyint(3) unsigned NOT NULL COMMENT 'Profile Id (0-5)', + `name` varchar(12) NOT NULL COMMENT 'Profile Name', + `frameHeight` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Profile Frame Height', + `frameWidth` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Profile Frame Width', + `sortBy` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT 'Frame Sort By', + `healthText` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT 'Frame Health Text', + `boolOptions` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Many Configurable Bool Options', + `unk146` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT 'Profile Unk Int8', + `unk147` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT 'Profile Unk Int8', + `unk148` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT 'Profile Unk Int8', + `unk150` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Profile Unk Int16', + `unk152` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Profile Unk Int16', + `unk154` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Profile Unk Int16', + PRIMARY KEY (`guid`,`id`), + KEY `index` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/src/server/game/Battlefield/BattlefieldHandler.cpp b/src/server/game/Battlefield/BattlefieldHandler.cpp index f16237b6e31..66285fe1b04 100644 --- a/src/server/game/Battlefield/BattlefieldHandler.cpp +++ b/src/server/game/Battlefield/BattlefieldHandler.cpp @@ -112,7 +112,7 @@ void WorldSession::SendBfQueueInviteResponse(uint64 guid, uint32 ZoneId, bool Ca ObjectGuid guidBytes = guid; WorldPacket data(SMSG_BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE, 16); - + data.WriteBit(guidBytes[1]); data.WriteBit(guidBytes[6]); data.WriteBit(guidBytes[5]); @@ -121,32 +121,32 @@ void WorldSession::SendBfQueueInviteResponse(uint64 guid, uint32 ZoneId, bool Ca data.WriteBit(guidBytes[0]); data.WriteBit(!hasSecondGuid); data.WriteBit(guidBytes[4]); - - // if (hasSecondGuid) 7 3 0 4 2 6 1 5 - + + // if (hasSecondGuid) 7 3 0 4 2 6 1 5 + data.WriteBit(guidBytes[3]); data.WriteBit(guidBytes[2]); - + // if (hasSecondGuid) 2 5 3 0 4 6 1 7 data.FlushBits(); data << uint8(CanQueue); // Accepted - + data.WriteByteSeq(guidBytes[1]); data.WriteByteSeq(guidBytes[3]); data.WriteByteSeq(guidBytes[6]); data.WriteByteSeq(guidBytes[7]); data.WriteByteSeq(guidBytes[0]); - + data << uint8(warmup); - + data.WriteByteSeq(guidBytes[2]); data.WriteByteSeq(guidBytes[4]); data.WriteByteSeq(guidBytes[5]); - + data << uint32(ZoneId); - + SendPacket(&data); } @@ -157,7 +157,7 @@ void WorldSession::SendBfEntered(uint64 guid) ObjectGuid guidBytes = guid; WorldPacket data(SMSG_BATTLEFIELD_MGR_ENTERED, 11); - + data.WriteBit(0); // unk data.WriteBit(isAFK); // Clear AFK data.WriteBit(guidBytes[1]); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index bef557e0b8f..8ac3ba358dd 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -849,7 +849,8 @@ Player::Player(WorldSession* session): Unit(true), m_achievementMgr(this), m_rep _activeCheats = CHEAT_NONE; - memset(_voidStorageItems, 0, VOID_STORAGE_MAX_SLOT * sizeof(VoidStorageItem*)); + memset(_voidStorageItems, NULL, VOID_STORAGE_MAX_SLOT * sizeof(VoidStorageItem*)); + memset(_CUFProfiles, NULL, MAX_CUF_PROFILES * sizeof(CUFProfile*)); } Player::~Player() @@ -884,6 +885,9 @@ Player::~Player() for (uint8 i = 0; i < VOID_STORAGE_MAX_SLOT; ++i) delete _voidStorageItems[i]; + for (uint8 i = 0; i < MAX_CUF_PROFILES; ++i) + delete _CUFProfiles[i]; + sWorld->DecreasePlayerCount(); } @@ -17325,9 +17329,46 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) _LoadEquipmentSets(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADEQUIPMENTSETS)); + _LoadCUFProfiles(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_CUF_PROFILES)); + return true; } +void Player::_LoadCUFProfiles(PreparedQueryResult result) +{ + if (!result) + return; + + do + { + // SELECT id, name, frameHeight, frameWidth, sortBy, healthText, boolOptions, unk146, unk147, unk148, unk150, unk152, unk154 FROM character_cuf_profiles WHERE guid = ? + Field* fields = result->Fetch(); + + uint8 id = fields[0].GetUInt8(); + std::string name = fields[1].GetString(); + uint16 frameHeight = fields[2].GetUInt16(); + uint16 frameWidth = fields[3].GetUInt16(); + uint8 sortBy = fields[4].GetUInt8(); + uint8 healthText = fields[5].GetUInt8(); + uint32 boolOptions = fields[6].GetUInt32(); + uint8 unk146 = fields[7].GetUInt8(); + uint8 unk147 = fields[8].GetUInt8(); + uint8 unk148 = fields[9].GetUInt8(); + uint16 unk150 = fields[10].GetUInt16(); + uint16 unk152 = fields[11].GetUInt16(); + uint16 unk154 = fields[12].GetUInt16(); + + if (id > MAX_CUF_PROFILES) + { + sLog->outError(LOG_FILTER_PLAYER, "Player::_LoadCUFProfiles - Player (GUID: %u, name: %s) has an CUF profile with invalid id (id: %u), max is %i.", GetGUIDLow(), GetName(), id, MAX_CUF_PROFILES); + continue; + } + + _CUFProfiles[id] = new CUFProfile(name, frameHeight, frameWidth, sortBy, healthText, boolOptions, unk146, unk147, unk148, unk150, unk152, unk154); + } + while (result->NextRow()); +} + bool Player::isAllowedToLoot(const Creature* creature) { if (!creature->isDead() || !creature->IsDamageEnoughForLootingAndReward()) @@ -18941,6 +18982,7 @@ void Player::SaveToDB(bool create /*=false*/) _SaveGlyphs(trans); _SaveInstanceTimeRestrictions(trans); _SaveCurrency(trans); + _SaveCUFProfiles(trans); // check if stats should only be saved on logout // save stats can be out of transaction @@ -19226,6 +19268,45 @@ void Player::_SaveVoidStorage(SQLTransaction& trans) } } + +void Player::_SaveCUFProfiles(SQLTransaction& trans) +{ + PreparedStatement* stmt = NULL; + uint32 lowGuid = GetGUIDLow(); + + for (uint8 i = 0; i < MAX_CUF_PROFILES; ++i) + { + if (!_CUFProfiles[i]) // unused profile + { + // DELETE FROM character_cuf_profiles WHERE guid = ? and id = ? + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_CUF_PROFILES); + stmt->setUInt32(0, lowGuid); + stmt->setUInt8(1, i); + } + else + { + // REPLACE INTO character_cuf_profiles (guid, id, name, frameHeight, frameWidth, sortBy, healthText, boolOptions, unk146, unk147, unk148, unk150, unk152, unk154) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) + stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_CHAR_CUF_PROFILES); + stmt->setUInt32(0, lowGuid); + stmt->setUInt8(1, i); + stmt->setString(2, _CUFProfiles[i]->ProfileName); + stmt->setUInt16(3, _CUFProfiles[i]->FrameHeight); + stmt->setUInt16(4, _CUFProfiles[i]->FrameWidth); + stmt->setUInt8(5, _CUFProfiles[i]->SortBy); + stmt->setUInt8(6, _CUFProfiles[i]->HealthText); + stmt->setUInt32(7, _CUFProfiles[i]->BoolOptions.to_ulong()); // 24 of 31 fields used, fits in an int + stmt->setUInt8(8, _CUFProfiles[i]->Unk146); + stmt->setUInt8(9, _CUFProfiles[i]->Unk147); + stmt->setUInt8(10, _CUFProfiles[i]->Unk148); + stmt->setUInt16(11, _CUFProfiles[i]->Unk150); + stmt->setUInt16(12, _CUFProfiles[i]->Unk152); + stmt->setUInt16(13, _CUFProfiles[i]->Unk154); + } + + trans->Append(stmt); + } +} + void Player::_SaveMail(SQLTransaction& trans) { if (!m_mailsLoaded) @@ -22358,6 +22439,8 @@ void Player::SendInitialPacketsAfterAddToMap() ResetTimeSync(); SendTimeSync(); + Player::GetSession()->SendLoadCUFProfiles(); + CastSpell(this, 836, true); // LOGINEFFECT // set some aura effects that send packet to player client after add player to map diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index bfa70e611e6..89c56165390 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -19,6 +19,7 @@ #ifndef _PLAYER_H #define _PLAYER_H +#include #include "AchievementMgr.h" #include "Battleground.h" #include "Bag.h" @@ -147,6 +148,94 @@ typedef UNORDERED_MAP PlayerCurrenciesMap; typedef std::list WhisperListContainer; +/// Maximum number of CompactUnitFrames profiles +#define MAX_CUF_PROFILES 5 + +/// Bit index used in the many bool options of CompactUnitFrames +enum CUFBoolOptions +{ + CUF_KEEP_GROUPS_TOGETHER, + CUF_DISPLAY_PETS, + CUF_DISPLAY_MAIN_TANK_AND_ASSIST, + CUF_DISPLAY_HEAL_PREDICTION, + CUF_DISPLAY_AGGRO_HIGHLIGHT, + CUF_DISPLAY_ONLY_DISPELLABLE_DEBUFFS, + CUF_DISPLAY_POWER_BAR, + CUF_DISPLAY_BORDER, + CUF_USE_CLASS_COLORS, + CUF_DISPLAY_NON_BOSS_DEBUFFS, + CUF_DISPLAY_HORIZONTAL_GROUPS, + CUF_LOCKED, + CUF_SHOWN, + CUF_AUTO_ACTIVATE_2_PLAYERS, + CUF_AUTO_ACTIVATE_3_PLAYERS, + CUF_AUTO_ACTIVATE_5_PLAYERS, + CUF_AUTO_ACTIVATE_10_PLAYERS, + CUF_AUTO_ACTIVATE_15_PLAYERS, + CUF_AUTO_ACTIVATE_25_PLAYERS, + CUF_AUTO_ACTIVATE_40_PLAYERS, + CUF_AUTO_ACTIVATE_SPEC_1, + CUF_AUTO_ACTIVATE_SPEC_2, + CUF_AUTO_ACTIVATE_PVP, + CUF_AUTO_ACTIVATE_PVE, + CUF_UNK_145, + CUF_UNK_156, + CUF_UNK_157, + + CUF_BOOL_OPTIONS_COUNT, +}; + +/// Represents a CompactUnitFrame profile +struct CUFProfile +{ + CUFProfile() : ProfileName(), BoolOptions() // might want to change default value for options + { + FrameHeight = 0; + FrameWidth = 0; + SortBy = 0; + HealthText = 0; + Unk146 = 0; + Unk147 = 0; + Unk148 = 0; + Unk150 = 0; + Unk152 = 0; + Unk154 = 0; + } + + CUFProfile(const std::string& name, uint16 frameHeight, uint16 frameWidth, uint8 sortBy, uint8 healthText, uint32 boolOptions, + uint8 unk146, uint8 unk147, uint8 unk148, uint16 unk150, uint16 unk152, uint16 unk154) + : ProfileName(name), BoolOptions((int)boolOptions) + { + FrameHeight = frameHeight; + FrameWidth = frameWidth; + SortBy = sortBy; + HealthText = healthText; + Unk146 = unk146; + Unk147 = unk147; + Unk148 = unk148; + Unk150 = Unk150; + Unk152 = unk152; + Unk154 = unk154; + } + + std::string ProfileName; + uint16 FrameHeight; + uint16 FrameWidth; + uint8 SortBy; + uint8 HealthText; + + uint8 Unk146; + uint8 Unk147; + uint8 Unk148; + uint16 Unk150; + uint16 Unk152; + uint16 Unk154; + + std::bitset BoolOptions; + + // More fields can be added to BoolOptions without changing DB schema (up to 31, currently 24) +}; + struct SpellCooldown { time_t end; @@ -793,6 +882,7 @@ enum PlayerLoginQueryIndex PLAYER_LOGIN_QUERY_LOADSEASONALQUESTSTATUS = 31, PLAYER_LOGIN_QUERY_LOADVOIDSTORAGE = 32, PLAYER_LOGIN_QUERY_LOADCURRENCY = 33, + PLAYER_LOGIN_QUERY_LOAD_CUF_PROFILES = 34, MAX_PLAYER_LOGIN_QUERY, }; @@ -1577,6 +1667,17 @@ class Player : public Unit, public GridObject void AddTimedQuest(uint32 quest_id) { m_timedquests.insert(quest_id); } void RemoveTimedQuest(uint32 quest_id) { m_timedquests.erase(quest_id); } + void SaveCUFProfile(uint8 id, CUFProfile* profile) { delete _CUFProfiles[id]; _CUFProfiles[id] = profile; } ///> Replaces a CUF profile at position 0-4 + CUFProfile* GetCUFProfile(uint8 id) const { return _CUFProfiles[id]; } ///> Retrieves a CUF profile at position 0-4 + uint8 GetCUFProfilesCount() const + { + uint8 count = 0; + for (uint8 i = 0; i < MAX_CUF_PROFILES; ++i) + if (_CUFProfiles[i]) + ++count; + return count; + } + /*********************************************************/ /*** LOAD SYSTEM ***/ /*********************************************************/ @@ -2712,6 +2813,7 @@ class Player : public Unit, public GridObject void _LoadTalents(PreparedQueryResult result); void _LoadInstanceTimeRestrictions(PreparedQueryResult result); void _LoadCurrency(PreparedQueryResult result); + void _LoadCUFProfiles(PreparedQueryResult result); /*********************************************************/ /*** SAVE SYSTEM ***/ @@ -2735,6 +2837,7 @@ class Player : public Unit, public GridObject void _SaveStats(SQLTransaction& trans); void _SaveInstanceTimeRestrictions(SQLTransaction& trans); void _SaveCurrency(SQLTransaction& trans); + void _SaveCUFProfiles(SQLTransaction& trans); /*********************************************************/ /*** ENVIRONMENTAL SYSTEM ***/ @@ -2898,6 +3001,8 @@ class Player : public Unit, public GridObject uint8 m_grantableLevels; + CUFProfile* _CUFProfiles[MAX_CUF_PROFILES]; + private: // internal common parts for CanStore/StoreItem functions InventoryResult CanStoreItem_InSpecificSlot(uint8 bag, uint8 slot, ItemPosCountVec& dest, ItemTemplate const* pProto, uint32& count, bool swap, Item* pSrcItem) const; diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 7e1195463a2..6609ef55494 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -166,6 +166,10 @@ bool LoginQueryHolder::Initialize() stmt->setUInt32(0, lowGuid); res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADEQUIPMENTSETS, stmt); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_CUF_PROFILES); + stmt->setUInt32(0, lowGuid); + res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_CUF_PROFILES, stmt); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_BGDATA); stmt->setUInt32(0, lowGuid); res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADBGDATA, stmt); diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp index 1d6cbf61c68..3549e56fb88 100644 --- a/src/server/game/Handlers/GroupHandler.cpp +++ b/src/server/game/Handlers/GroupHandler.cpp @@ -513,7 +513,7 @@ void WorldSession::HandleGroupSetLeaderOpcode(WorldPacket& recvData) void WorldSession::HandleGroupSetRolesOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_SET_ROLES"); - + uint32 newRole; ObjectGuid guid1; // Assigner GUID ObjectGuid guid2; // Target GUID @@ -539,7 +539,7 @@ void WorldSession::HandleGroupSetRolesOpcode(WorldPacket& recvData) recvData.ReadByteSeq(guid2[5]); recvData.ReadByteSeq(guid2[2]); recvData.ReadByteSeq(guid2[7]); - + WorldPacket data(SMSG_GROUP_SET_ROLE, 24); data.WriteBit(guid1[1]); @@ -558,7 +558,7 @@ void WorldSession::HandleGroupSetRolesOpcode(WorldPacket& recvData) data.WriteBit(guid1[6]); data.WriteBit(guid2[1]); data.WriteBit(guid1[0]); - + data.WriteByteSeq(guid1[7]); data.WriteByteSeq(guid2[3]); data.WriteByteSeq(guid1[6]); diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 5b5f83719e3..e127a5ba658 100644 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -775,7 +775,7 @@ void WorldSession::SendListInventory(uint64 vendorGuid) } int32 price = vendorItem->IsGoldRequired(itemTemplate) ? uint32(floor(itemTemplate->BuyPrice * discountMod)) : 0; - + if (int32 priceMod = _player->GetTotalAuraModifier(SPELL_AURA_MOD_VENDOR_ITEMS_PRICES)) price -= CalculatePctN(price, priceMod); diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index c6e0515a8ed..6499ead3685 100644 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -1940,35 +1940,165 @@ void WorldSession::HandleUpdateMissileTrajectory(WorldPacket& recvPacket) HandleMovementOpcodes(recvPacket); } } - void WorldSession::HandleViolenceLevel(WorldPacket& recvPacket) - { - uint8 violenceLevel; - recvPacket >> violenceLevel; - - // do something? - } - - void WorldSession::HandleObjectUpdateFailedOpcode(WorldPacket& recvPacket) - { - ObjectGuid guid; - guid[6] = recvPacket.ReadBit(); - guid[7] = recvPacket.ReadBit(); - guid[4] = recvPacket.ReadBit(); - guid[0] = recvPacket.ReadBit(); - guid[1] = recvPacket.ReadBit(); - guid[5] = recvPacket.ReadBit(); - guid[3] = recvPacket.ReadBit(); - guid[2] = recvPacket.ReadBit(); - - recvPacket.ReadByteSeq(guid[6]); - recvPacket.ReadByteSeq(guid[7]); - recvPacket.ReadByteSeq(guid[2]); - recvPacket.ReadByteSeq(guid[3]); - recvPacket.ReadByteSeq(guid[1]); - recvPacket.ReadByteSeq(guid[4]); - recvPacket.ReadByteSeq(guid[0]); - recvPacket.ReadByteSeq(guid[5]); - - WorldObject* obj = ObjectAccessor::GetWorldObject(*GetPlayer(), guid); - sLog->outError(LOG_FILTER_NETWORKIO, "Object update failed for object "UI64FMTD" (%s) for player %s (%u)", uint64(guid), obj ? obj->GetName() : "object-not-found", GetPlayerName().c_str(), GetGuidLow()); - } + +void WorldSession::HandleViolenceLevel(WorldPacket& recvPacket) +{ + uint8 violenceLevel; + recvPacket >> violenceLevel; + + // do something? +} + +void WorldSession::HandleObjectUpdateFailedOpcode(WorldPacket& recvPacket) +{ + ObjectGuid guid; + guid[6] = recvPacket.ReadBit(); + guid[7] = recvPacket.ReadBit(); + guid[4] = recvPacket.ReadBit(); + guid[0] = recvPacket.ReadBit(); + guid[1] = recvPacket.ReadBit(); + guid[5] = recvPacket.ReadBit(); + guid[3] = recvPacket.ReadBit(); + guid[2] = recvPacket.ReadBit(); + + recvPacket.ReadByteSeq(guid[6]); + recvPacket.ReadByteSeq(guid[7]); + recvPacket.ReadByteSeq(guid[2]); + recvPacket.ReadByteSeq(guid[3]); + recvPacket.ReadByteSeq(guid[1]); + recvPacket.ReadByteSeq(guid[4]); + recvPacket.ReadByteSeq(guid[0]); + recvPacket.ReadByteSeq(guid[5]); + + WorldObject* obj = ObjectAccessor::GetWorldObject(*GetPlayer(), guid); + sLog->outError(LOG_FILTER_NETWORKIO, "Object update failed for object "UI64FMTD" (%s) for player %s (%u)", uint64(guid), obj ? obj->GetName() : "object-not-found", GetPlayerName().c_str(), GetGuidLow()); +} + +void WorldSession::HandleSaveCUFProfiles(WorldPacket& recvPacket) +{ + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_SAVE_CUF_PROFILES"); + + uint8 count = (uint8)recvPacket.ReadBits(20); + + if (count > MAX_CUF_PROFILES) + { + sLog->outError(LOG_FILTER_PLAYER, "HandleSaveCUFProfiles - %s tried to save more than %i CUF profiles. Hacking attempt?", GetPlayerName(), MAX_CUF_PROFILES); + recvPacket.rfinish(); + return; + } + + CUFProfile* profiles[MAX_CUF_PROFILES]; + uint8 strlens[MAX_CUF_PROFILES]; + + for (uint8 i = 0; i < count; ++i) + { + profiles[i] = new CUFProfile; + profiles[i]->BoolOptions.set(CUF_AUTO_ACTIVATE_SPEC_2 , recvPacket.ReadBit()); + profiles[i]->BoolOptions.set(CUF_AUTO_ACTIVATE_10_PLAYERS , recvPacket.ReadBit()); + profiles[i]->BoolOptions.set(CUF_UNK_157 , recvPacket.ReadBit()); + profiles[i]->BoolOptions.set(CUF_DISPLAY_HEAL_PREDICTION , recvPacket.ReadBit()); + profiles[i]->BoolOptions.set(CUF_AUTO_ACTIVATE_SPEC_1 , recvPacket.ReadBit()); + profiles[i]->BoolOptions.set(CUF_AUTO_ACTIVATE_PVP , recvPacket.ReadBit()); + profiles[i]->BoolOptions.set(CUF_DISPLAY_POWER_BAR , recvPacket.ReadBit()); + profiles[i]->BoolOptions.set(CUF_AUTO_ACTIVATE_15_PLAYERS , recvPacket.ReadBit()); + profiles[i]->BoolOptions.set(CUF_AUTO_ACTIVATE_40_PLAYERS , recvPacket.ReadBit()); + profiles[i]->BoolOptions.set(CUF_DISPLAY_PETS , recvPacket.ReadBit()); + profiles[i]->BoolOptions.set(CUF_AUTO_ACTIVATE_5_PLAYERS , recvPacket.ReadBit()); + profiles[i]->BoolOptions.set(CUF_DISPLAY_ONLY_DISPELLABLE_DEBUFFS, recvPacket.ReadBit()); + profiles[i]->BoolOptions.set(CUF_AUTO_ACTIVATE_2_PLAYERS , recvPacket.ReadBit()); + profiles[i]->BoolOptions.set(CUF_UNK_156 , recvPacket.ReadBit()); + profiles[i]->BoolOptions.set(CUF_DISPLAY_NON_BOSS_DEBUFFS , recvPacket.ReadBit()); + profiles[i]->BoolOptions.set(CUF_DISPLAY_MAIN_TANK_AND_ASSIST , recvPacket.ReadBit()); + profiles[i]->BoolOptions.set(CUF_DISPLAY_AGGRO_HIGHLIGHT , recvPacket.ReadBit()); + profiles[i]->BoolOptions.set(CUF_AUTO_ACTIVATE_3_PLAYERS , recvPacket.ReadBit()); + profiles[i]->BoolOptions.set(CUF_DISPLAY_BORDER , recvPacket.ReadBit()); + profiles[i]->BoolOptions.set(CUF_USE_CLASS_COLORS , recvPacket.ReadBit()); + profiles[i]->BoolOptions.set(CUF_UNK_145 , recvPacket.ReadBit()); + strlens[i] = (uint8)recvPacket.ReadBits(8); + profiles[i]->BoolOptions.set(CUF_AUTO_ACTIVATE_PVE , recvPacket.ReadBit()); + profiles[i]->BoolOptions.set(CUF_DISPLAY_HORIZONTAL_GROUPS , recvPacket.ReadBit()); + profiles[i]->BoolOptions.set(CUF_AUTO_ACTIVATE_25_PLAYERS , recvPacket.ReadBit()); + profiles[i]->BoolOptions.set(CUF_KEEP_GROUPS_TOGETHER , recvPacket.ReadBit()); + } + + for (uint8 i = 0; i < count; ++i) + { + recvPacket >> profiles[i]->Unk146; + profiles[i]->ProfileName = recvPacket.ReadString(strlens[i]); + recvPacket >> profiles[i]->Unk152; + recvPacket >> profiles[i]->FrameHeight; + recvPacket >> profiles[i]->FrameWidth; + recvPacket >> profiles[i]->Unk150; + recvPacket >> profiles[i]->HealthText; + recvPacket >> profiles[i]->Unk147; + recvPacket >> profiles[i]->SortBy; + recvPacket >> profiles[i]->Unk154; + recvPacket >> profiles[i]->Unk148; + + GetPlayer()->SaveCUFProfile(i, profiles[i]); + } + + for (uint8 i = count; i < MAX_CUF_PROFILES; ++i) + GetPlayer()->SaveCUFProfile(i, NULL); +} + +void WorldSession::SendLoadCUFProfiles() +{ + Player* player = GetPlayer(); + + uint8 count = player->GetCUFProfilesCount(); + + ByteBuffer byteBuffer(25 * count); + WorldPacket data(SMSG_LOAD_CUF_PROFILES, 5 * count + 25 * count); + + data.WriteBits(count, 20); + for (uint8 i = 0; i < MAX_CUF_PROFILES; ++i) + { + CUFProfile* profile = player->GetCUFProfile(i); + if (!profile) + continue; + + data.WriteBit(profile->BoolOptions[CUF_UNK_157]); + data.WriteBit(profile->BoolOptions[CUF_AUTO_ACTIVATE_10_PLAYERS]); + data.WriteBit(profile->BoolOptions[CUF_AUTO_ACTIVATE_5_PLAYERS]); + data.WriteBit(profile->BoolOptions[CUF_AUTO_ACTIVATE_25_PLAYERS]); + data.WriteBit(profile->BoolOptions[CUF_DISPLAY_HEAL_PREDICTION]); + data.WriteBit(profile->BoolOptions[CUF_AUTO_ACTIVATE_PVE]); + data.WriteBit(profile->BoolOptions[CUF_DISPLAY_HORIZONTAL_GROUPS]); + data.WriteBit(profile->BoolOptions[CUF_AUTO_ACTIVATE_40_PLAYERS]); + data.WriteBit(profile->BoolOptions[CUF_AUTO_ACTIVATE_3_PLAYERS]); + data.WriteBit(profile->BoolOptions[CUF_DISPLAY_AGGRO_HIGHLIGHT]); + data.WriteBit(profile->BoolOptions[CUF_DISPLAY_BORDER]); + data.WriteBit(profile->BoolOptions[CUF_AUTO_ACTIVATE_2_PLAYERS]); + data.WriteBit(profile->BoolOptions[CUF_DISPLAY_NON_BOSS_DEBUFFS]); + data.WriteBit(profile->BoolOptions[CUF_DISPLAY_MAIN_TANK_AND_ASSIST]); + data.WriteBit(profile->BoolOptions[CUF_UNK_156]); + data.WriteBit(profile->BoolOptions[CUF_AUTO_ACTIVATE_SPEC_2]); + data.WriteBit(profile->BoolOptions[CUF_USE_CLASS_COLORS]); + data.WriteBit(profile->BoolOptions[CUF_DISPLAY_POWER_BAR]); + data.WriteBit(profile->BoolOptions[CUF_AUTO_ACTIVATE_SPEC_1]); + data.WriteBits(profile->ProfileName.size(), 8); + data.WriteBit(profile->BoolOptions[CUF_DISPLAY_ONLY_DISPELLABLE_DEBUFFS]); + data.WriteBit(profile->BoolOptions[CUF_KEEP_GROUPS_TOGETHER]); + data.WriteBit(profile->BoolOptions[CUF_UNK_145]); + data.WriteBit(profile->BoolOptions[CUF_AUTO_ACTIVATE_15_PLAYERS]); + data.WriteBit(profile->BoolOptions[CUF_DISPLAY_PETS]); + data.WriteBit(profile->BoolOptions[CUF_AUTO_ACTIVATE_PVP]); + + byteBuffer << uint16(profile->Unk154); + byteBuffer << uint16(profile->FrameHeight); + byteBuffer << uint16(profile->Unk152); + byteBuffer << uint8(profile->Unk147); + byteBuffer << uint16(profile->Unk150); + byteBuffer << uint8(profile->Unk146); + byteBuffer << uint8(profile->HealthText); + byteBuffer << uint8(profile->SortBy); + byteBuffer << uint16(profile->FrameWidth); + byteBuffer << uint8(profile->Unk148); + byteBuffer.WriteString(profile->ProfileName); + } + + data.FlushBits(); + data.append(byteBuffer); + SendPacket(&data); +} diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 6eeb3661028..f25f8d18b0d 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -470,7 +470,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_RESURRECT_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleResurrectResponseOpcode ); DEFINE_OPCODE_HANDLER(CMSG_RETURN_TO_GRAVEYARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReturnToGraveyard ); DEFINE_OPCODE_HANDLER(CMSG_ROLE_POLL_BEGIN, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_SAVE_CUF_PROFILES, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_SAVE_CUF_PROFILES, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleSaveCUFProfiles ); DEFINE_OPCODE_HANDLER(CMSG_SELF_RES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSelfResOpcode ); DEFINE_OPCODE_HANDLER(CMSG_SELL_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSellItemOpcode ); DEFINE_OPCODE_HANDLER(CMSG_SEND_MAIL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSendMail ); @@ -948,7 +948,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_POST_UPDATED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_RECRUIT_LIST_UPDATED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LIST_INVENTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LOAD_CUF_PROFILES, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LOAD_CUF_PROFILES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LOGIN_SETTIMESPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LOGIN_VERIFY_WORLD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LOGOUT_CANCEL_ACK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 0ac7884efe2..6ff03b9c838 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -968,6 +968,10 @@ class WorldSession void HandleObjectUpdateFailedOpcode(WorldPacket& recvPacket); int32 HandleEnableNagleAlgorithm(); + // Compact Unit Frames (4.x) + void HandleSaveCUFProfiles(WorldPacket& recvPacket); + void SendLoadCUFProfiles(); + private: void InitializeQueryCallbackParameters(); void ProcessQueryCallbacks(); diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index aff2083ca5f..286f2c20811 100755 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -567,7 +567,13 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_SEL_CHAR_PET_BY_ENTRY_AND_SLOT, "SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, abdata, savetime, CreatedBySpell, PetType FROM character_pet WHERE owner = ? AND slot = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_UPD_CHAR_LIST_SLOT, "UPDATE characters SET slot = ? WHERE guid = ?", CONNECTION_ASYNC); + // Void Storage PREPARE_STATEMENT(CHAR_SEL_CHAR_VOID_STORAGE, "SELECT itemId, itemEntry, slot, creatorGuid, randomProperty, suffixFactor FROM character_void_storage WHERE playerGuid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_REP_CHAR_VOID_STORAGE_ITEM, "REPLACE INTO character_void_storage (itemId, playerGuid, itemEntry, slot, creatorGuid, randomProperty, suffixFactor) VALUES (?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_CHAR_VOID_STORAGE_ITEM_BY_SLOT, "DELETE FROM character_void_storage WHERE slot = ? AND playerGuid = ?", CONNECTION_ASYNC); + + // CompactUnitFrame profiles + PREPARE_STATEMENT(CHAR_SEL_CHAR_CUF_PROFILES, "SELECT id, name, frameHeight, frameWidth, sortBy, healthText, boolOptions, unk146, unk147, unk148, unk150, unk152, unk154 FROM character_cuf_profiles WHERE guid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_REP_CHAR_CUF_PROFILES, "REPLACE INTO character_cuf_profiles (guid, id, name, frameHeight, frameWidth, sortBy, healthText, boolOptions, unk146, unk147, unk148, unk150, unk152, unk154) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_CHAR_CUF_PROFILES, "DELETE FROM character_cuf_profiles WHERE guid = ? and id = ?", CONNECTION_ASYNC); } diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.h b/src/server/shared/Database/Implementation/CharacterDatabase.h index 0634e226d5e..c134856a74f 100755 --- a/src/server/shared/Database/Implementation/CharacterDatabase.h +++ b/src/server/shared/Database/Implementation/CharacterDatabase.h @@ -533,6 +533,10 @@ enum CharacterDatabaseStatements CHAR_REP_CHAR_VOID_STORAGE_ITEM, CHAR_DEL_CHAR_VOID_STORAGE_ITEM_BY_SLOT, + CHAR_SEL_CHAR_CUF_PROFILES, + CHAR_REP_CHAR_CUF_PROFILES, + CHAR_DEL_CHAR_CUF_PROFILES, + MAX_CHARACTERDATABASE_STATEMENTS, }; -- cgit v1.2.3 From 3b91bf8932278c32210deea54ee412edb5499ce9 Mon Sep 17 00:00:00 2001 From: Nay Date: Wed, 5 Sep 2012 19:13:22 +0100 Subject: Core: Some comment corrections to previous commit --- sql/base/characters_database.sql | 2 +- .../2012_09_04_00_characters_character_cuf_profiles_434.sql | 2 +- src/server/game/Entities/Player/Player.cpp | 2 +- src/server/game/Entities/Player/Player.h | 4 +++- 4 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/sql/base/characters_database.sql b/sql/base/characters_database.sql index 5396b23857c..718ff3dba20 100644 --- a/sql/base/characters_database.sql +++ b/sql/base/characters_database.sql @@ -516,7 +516,7 @@ DROP TABLE IF EXISTS `character_cuf_profiles`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `character_cuf_profiles` ( `guid` int(10) unsigned NOT NULL COMMENT 'Character Guid', - `id` tinyint(3) unsigned NOT NULL COMMENT 'Profile Id (0-5)', + `id` tinyint(3) unsigned NOT NULL COMMENT 'Profile Id (0-4)', `name` varchar(12) NOT NULL COMMENT 'Profile Name', `frameHeight` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Profile Frame Height', `frameWidth` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Profile Frame Width', diff --git a/sql/updates/characters/2012_09_04_00_characters_character_cuf_profiles_434.sql b/sql/updates/characters/2012_09_04_00_characters_character_cuf_profiles_434.sql index df0c825e67a..394c0912601 100644 --- a/sql/updates/characters/2012_09_04_00_characters_character_cuf_profiles_434.sql +++ b/sql/updates/characters/2012_09_04_00_characters_character_cuf_profiles_434.sql @@ -1,7 +1,7 @@ DROP TABLE IF EXISTS `character_cuf_profiles`; CREATE TABLE IF NOT EXISTS `character_cuf_profiles` ( `guid` int(10) unsigned NOT NULL COMMENT 'Character Guid', - `id` tinyint(3) unsigned NOT NULL COMMENT 'Profile Id (0-5)', + `id` tinyint(3) unsigned NOT NULL COMMENT 'Profile Id (0-4)', `name` varchar(12) NOT NULL COMMENT 'Profile Name', `frameHeight` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Profile Frame Height', `frameWidth` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Profile Frame Width', diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 8ac3ba358dd..2c350956c0a 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -19294,7 +19294,7 @@ void Player::_SaveCUFProfiles(SQLTransaction& trans) stmt->setUInt16(4, _CUFProfiles[i]->FrameWidth); stmt->setUInt8(5, _CUFProfiles[i]->SortBy); stmt->setUInt8(6, _CUFProfiles[i]->HealthText); - stmt->setUInt32(7, _CUFProfiles[i]->BoolOptions.to_ulong()); // 24 of 31 fields used, fits in an int + stmt->setUInt32(7, _CUFProfiles[i]->BoolOptions.to_ulong()); // 27 of 32 fields used, fits in an int stmt->setUInt8(8, _CUFProfiles[i]->Unk146); stmt->setUInt8(9, _CUFProfiles[i]->Unk147); stmt->setUInt8(10, _CUFProfiles[i]->Unk148); diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 89c56165390..41b01036ef5 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -182,6 +182,8 @@ enum CUFBoolOptions CUF_UNK_156, CUF_UNK_157, + // Two of the unks is _LOCKED and _SHOWN + CUF_BOOL_OPTIONS_COUNT, }; @@ -233,7 +235,7 @@ struct CUFProfile std::bitset BoolOptions; - // More fields can be added to BoolOptions without changing DB schema (up to 31, currently 24) + // More fields can be added to BoolOptions without changing DB schema (up to 32, currently 27) }; struct SpellCooldown -- cgit v1.2.3 From 7da92908b8e176248db4d87217f0adf48318fd15 Mon Sep 17 00:00:00 2001 From: Nay Date: Wed, 5 Sep 2012 19:55:55 +0100 Subject: Scripts/Commands: Fix .reload creature_template # (4.3.4 branch) --- src/server/scripts/Commands/cs_reload.cpp | 99 ++++++++++++++++--------------- 1 file changed, 50 insertions(+), 49 deletions(-) (limited to 'src') diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp index 77f6316c881..88be4d6d151 100644 --- a/src/server/scripts/Commands/cs_reload.cpp +++ b/src/server/scripts/Commands/cs_reload.cpp @@ -451,57 +451,58 @@ public: cInfo->rangeattacktime = fields[29].GetUInt32(); cInfo->unit_class = fields[30].GetUInt8(); cInfo->unit_flags = fields[31].GetUInt32(); - cInfo->dynamicflags = fields[32].GetUInt32(); - cInfo->family = fields[33].GetUInt8(); - cInfo->trainer_type = fields[34].GetUInt8(); - cInfo->trainer_spell = fields[35].GetUInt32(); - cInfo->trainer_class = fields[36].GetUInt8(); - cInfo->trainer_race = fields[37].GetUInt8(); - cInfo->minrangedmg = fields[38].GetFloat(); - cInfo->maxrangedmg = fields[39].GetFloat(); - cInfo->rangedattackpower = fields[40].GetUInt16(); - cInfo->type = fields[41].GetUInt8(); - cInfo->type_flags = fields[42].GetUInt32(); - cInfo->lootid = fields[43].GetUInt32(); - cInfo->pickpocketLootId = fields[44].GetUInt32(); - cInfo->SkinLootId = fields[45].GetUInt32(); + cInfo->unit_flags2 = fields[32].GetUInt32(); + cInfo->dynamicflags = fields[33].GetUInt32(); + cInfo->family = fields[34].GetUInt8(); + cInfo->trainer_type = fields[35].GetUInt8(); + cInfo->trainer_spell = fields[36].GetUInt32(); + cInfo->trainer_class = fields[37].GetUInt8(); + cInfo->trainer_race = fields[38].GetUInt8(); + cInfo->minrangedmg = fields[39].GetFloat(); + cInfo->maxrangedmg = fields[40].GetFloat(); + cInfo->rangedattackpower = fields[41].GetUInt16(); + cInfo->type = fields[42].GetUInt8(); + cInfo->type_flags = fields[43].GetUInt32(); + cInfo->lootid = fields[44].GetUInt32(); + cInfo->pickpocketLootId = fields[45].GetUInt32(); + cInfo->SkinLootId = fields[46].GetUInt32(); for (uint8 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i) - cInfo->resistance[i] = fields[46 + i -1].GetUInt16(); - - cInfo->spells[0] = fields[52].GetUInt32(); - cInfo->spells[1] = fields[53].GetUInt32(); - cInfo->spells[2] = fields[54].GetUInt32(); - cInfo->spells[3] = fields[55].GetUInt32(); - cInfo->spells[4] = fields[56].GetUInt32(); - cInfo->spells[5] = fields[57].GetUInt32(); - cInfo->spells[6] = fields[58].GetUInt32(); - cInfo->spells[7] = fields[59].GetUInt32(); - cInfo->PetSpellDataId = fields[60].GetUInt32(); - cInfo->VehicleId = fields[61].GetUInt32(); - cInfo->mingold = fields[62].GetUInt32(); - cInfo->maxgold = fields[63].GetUInt32(); - cInfo->AIName = fields[64].GetString(); - cInfo->MovementType = fields[65].GetUInt8(); - cInfo->InhabitType = fields[66].GetUInt8(); - cInfo->HoverHeight = fields[67].GetFloat(); - cInfo->ModHealth = fields[68].GetFloat(); - cInfo->ModMana = fields[69].GetFloat(); - cInfo->ModManaExtra = fields[70].GetFloat(); - cInfo->ModArmor = fields[71].GetFloat(); - cInfo->RacialLeader = fields[72].GetBool(); - cInfo->questItems[0] = fields[73].GetUInt32(); - cInfo->questItems[1] = fields[74].GetUInt32(); - cInfo->questItems[2] = fields[75].GetUInt32(); - cInfo->questItems[3] = fields[76].GetUInt32(); - cInfo->questItems[4] = fields[77].GetUInt32(); - cInfo->questItems[5] = fields[78].GetUInt32(); - cInfo->movementId = fields[79].GetUInt32(); - cInfo->RegenHealth = fields[80].GetBool(); - cInfo->equipmentId = fields[81].GetUInt32(); - cInfo->MechanicImmuneMask = fields[82].GetUInt32(); - cInfo->flags_extra = fields[83].GetUInt32(); - cInfo->ScriptID = sObjectMgr->GetScriptId(fields[84].GetCString()); + cInfo->resistance[i] = fields[47 + i -1].GetUInt16(); + + cInfo->spells[0] = fields[53].GetUInt32(); + cInfo->spells[1] = fields[54].GetUInt32(); + cInfo->spells[2] = fields[55].GetUInt32(); + cInfo->spells[3] = fields[56].GetUInt32(); + cInfo->spells[4] = fields[57].GetUInt32(); + cInfo->spells[5] = fields[58].GetUInt32(); + cInfo->spells[6] = fields[59].GetUInt32(); + cInfo->spells[7] = fields[60].GetUInt32(); + cInfo->PetSpellDataId = fields[61].GetUInt32(); + cInfo->VehicleId = fields[62].GetUInt32(); + cInfo->mingold = fields[63].GetUInt32(); + cInfo->maxgold = fields[64].GetUInt32(); + cInfo->AIName = fields[65].GetString(); + cInfo->MovementType = fields[66].GetUInt8(); + cInfo->InhabitType = fields[67].GetUInt8(); + cInfo->HoverHeight = fields[68].GetFloat(); + cInfo->ModHealth = fields[69].GetFloat(); + cInfo->ModMana = fields[70].GetFloat(); + cInfo->ModManaExtra = fields[71].GetFloat(); + cInfo->ModArmor = fields[72].GetFloat(); + cInfo->RacialLeader = fields[73].GetBool(); + cInfo->questItems[0] = fields[74].GetUInt32(); + cInfo->questItems[1] = fields[75].GetUInt32(); + cInfo->questItems[2] = fields[76].GetUInt32(); + cInfo->questItems[3] = fields[77].GetUInt32(); + cInfo->questItems[4] = fields[78].GetUInt32(); + cInfo->questItems[5] = fields[79].GetUInt32(); + cInfo->movementId = fields[80].GetUInt32(); + cInfo->RegenHealth = fields[81].GetBool(); + cInfo->equipmentId = fields[82].GetUInt32(); + cInfo->MechanicImmuneMask = fields[83].GetUInt32(); + cInfo->flags_extra = fields[84].GetUInt32(); + cInfo->ScriptID = sObjectMgr->GetScriptId(fields[85].GetCString()); sObjectMgr->CheckCreatureTemplate(cInfo); } -- cgit v1.2.3 From f44ddb3355eaab1786fbdad806001db5d1f0769e Mon Sep 17 00:00:00 2001 From: Nay Date: Wed, 5 Sep 2012 20:15:20 +0100 Subject: Tabs to spaces --- src/server/game/Entities/Player/Player.h | 5 ++++- src/server/game/Handlers/MiscHandler.cpp | 2 +- .../Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 41b01036ef5..97a8d10b16a 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -182,7 +182,7 @@ enum CUFBoolOptions CUF_UNK_156, CUF_UNK_157, - // Two of the unks is _LOCKED and _SHOWN + // The unks is _LOCKED and _SHOWN and _DYNAMIC, unknown order CUF_BOOL_OPTIONS_COUNT, }; @@ -226,9 +226,12 @@ struct CUFProfile uint8 SortBy; uint8 HealthText; + // LeftAlign, TopAlight, BottomAllign (unk order) uint8 Unk146; uint8 Unk147; uint8 Unk148; + + // LeftOffset, TopOffset and BottomOffset (unk order) uint16 Unk150; uint16 Unk152; uint16 Unk154; diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 6499ead3685..aace2b8c9b8 100644 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -2051,7 +2051,7 @@ void WorldSession::SendLoadCUFProfiles() ByteBuffer byteBuffer(25 * count); WorldPacket data(SMSG_LOAD_CUF_PROFILES, 5 * count + 25 * count); - data.WriteBits(count, 20); + data.WriteBits(count, 20); for (uint8 i = 0; i < MAX_CUF_PROFILES; ++i) { CUFProfile* profile = player->GetCUFProfile(i); diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp index 156581e8cd2..233a8d82497 100644 --- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp @@ -350,10 +350,10 @@ class instance_blood_furnace : public InstanceMapScript ++PrisonerCounter8; } else - return; + return; } else - return; + return; ResetPrisoner(creature); } -- cgit v1.2.3 From b81dbf08374bfa9693e628ac21bd6e7d6889be22 Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 6 Sep 2012 17:52:39 +0100 Subject: Core/CUF: Fix 2 typos Thanks ste1s and chipsi --- src/server/game/Entities/Player/Player.h | 2 +- src/server/game/Handlers/MiscHandler.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 97a8d10b16a..0da557aff50 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -215,7 +215,7 @@ struct CUFProfile Unk146 = unk146; Unk147 = unk147; Unk148 = unk148; - Unk150 = Unk150; + Unk150 = unk150; Unk152 = unk152; Unk154 = unk154; } diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index aace2b8c9b8..aaf7540325b 100644 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -1982,7 +1982,7 @@ void WorldSession::HandleSaveCUFProfiles(WorldPacket& recvPacket) if (count > MAX_CUF_PROFILES) { - sLog->outError(LOG_FILTER_PLAYER, "HandleSaveCUFProfiles - %s tried to save more than %i CUF profiles. Hacking attempt?", GetPlayerName(), MAX_CUF_PROFILES); + sLog->outError(LOG_FILTER_PLAYER, "HandleSaveCUFProfiles - %s tried to save more than %i CUF profiles. Hacking attempt?", GetPlayerName().c_str(), MAX_CUF_PROFILES); recvPacket.rfinish(); return; } -- cgit v1.2.3 From 82efe7e505aed0a19b303d4f019da66471e0e5b7 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 6 Sep 2012 22:45:21 +0200 Subject: Core/Stats: Fixed spellpower display and implemented gaining spellpower from intellect. --- src/server/game/DataStores/DBCStores.cpp | 23 +++++++++++++++++ src/server/game/DataStores/DBCStores.h | 2 ++ src/server/game/Entities/Creature/Creature.cpp | 17 +++++-------- src/server/game/Entities/Player/Player.cpp | 15 ++++++------ src/server/game/Entities/Player/Player.h | 4 ++- src/server/game/Entities/Unit/Unit.cpp | 34 ++++++-------------------- src/server/game/Entities/Unit/Unit.h | 2 -- 7 files changed, 50 insertions(+), 47 deletions(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index ffceb4e60aa..22c450e33d5 100644 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -76,6 +76,7 @@ DBCStorage sCreatureModelDataStore(CreatureModelDatafmt DBCStorage sCreatureSpellDataStore(CreatureSpellDatafmt); DBCStorage sCreatureTypeStore(CreatureTypefmt); DBCStorage sCurrencyTypesStore(CurrencyTypesfmt); +uint32 PowersByClass[MAX_CLASSES][MAX_POWERS]; DBCStorage sDestructibleModelDataStore(DestructibleModelDatafmt); DBCStorage sDungeonEncounterStore(DungeonEncounterfmt); @@ -345,6 +346,23 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sChrClassesStore, dbcPath, "ChrClasses.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sChrRacesStore, dbcPath, "ChrRaces.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sChrPowerTypesStore, dbcPath, "ChrClassesXPowerTypes.dbc");//14545 + for (uint32 i = 0; i < MAX_CLASSES; ++i) + for (uint32 j = 0; j < MAX_POWERS; ++j) + PowersByClass[i][j] = MAX_POWERS; + + for (uint32 i = 0; i < sChrPowerTypesStore.GetNumRows(); ++i) + { + if (ChrPowerTypesEntry const* power = sChrPowerTypesStore.LookupEntry(i)) + { + uint32 index = 0; + for (uint32 j = 0; j < MAX_POWERS; ++j) + if (PowersByClass[power->classId][j] != MAX_POWERS) + ++index; + + PowersByClass[power->classId][power->power] = index; + } + } + LoadDBC(availableDbcLocales, bad_dbc_files, sCinematicSequencesStore, dbcPath, "CinematicSequences.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sCreatureDisplayInfoStore, dbcPath, "CreatureDisplayInfo.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sCreatureFamilyStore, dbcPath, "CreatureFamily.dbc");//14545 @@ -1044,6 +1062,11 @@ uint32 GetLiquidFlags(uint32 liquidType) return 0; } +uint32 GetPowerIndexByClass(uint32 powerType, uint32 classId) +{ + return PowersByClass[classId][powerType]; +} + uint32 ScalingStatValuesEntry::GetStatMultiplier(uint32 inventoryType) const { if (inventoryType < MAX_INVTYPE) diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h index f669049be5c..98ae2aa5ff6 100755 --- a/src/server/game/DataStores/DBCStores.h +++ b/src/server/game/DataStores/DBCStores.h @@ -73,6 +73,8 @@ uint32 GetLiquidFlags(uint32 liquidType); PvPDifficultyEntry const* GetBattlegroundBracketByLevel(uint32 mapid, uint32 level); PvPDifficultyEntry const* GetBattlegroundBracketById(uint32 mapid, BattlegroundBracketId id); +uint32 GetPowerIndexByClass(uint32 powerType, uint32 classId); + extern DBCStorage sAchievementStore; extern DBCStorage sAchievementCriteriaStore; extern DBCStorage sAreaStore;// recommend access using functions diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 5e7f5984ac5..be690b52803 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -1164,16 +1164,11 @@ void Creature::SelectLevel(const CreatureTemplate* cinfo) { case CLASS_WARRIOR: setPowerType(POWER_RAGE); - SetMaxPower(POWER_RAGE, GetCreatePowers(POWER_RAGE)); - SetPower(POWER_RAGE, GetCreatePowers(POWER_RAGE)); break; case CLASS_ROGUE: setPowerType(POWER_ENERGY); - SetMaxPower(POWER_ENERGY, GetCreatePowers(POWER_ENERGY)); - SetPower(POWER_ENERGY, GetCreatePowers(POWER_ENERGY)); break; default: - setPowerType(POWER_MANA); SetMaxPower(POWER_MANA, mana); SetPower(POWER_MANA, mana); break; @@ -1183,15 +1178,15 @@ void Creature::SelectLevel(const CreatureTemplate* cinfo) SetModifierValue(UNIT_MOD_MANA, BASE_VALUE, (float)mana); //damage - float damagemod = 1.0f;//_GetDamageMod(rank); + //float damagemod = _GetDamageMod(rank); // Set during loading templates into dmg_multiplier field - SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, cinfo->mindmg * damagemod); - SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, cinfo->maxdmg * damagemod); + SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, cinfo->mindmg); + SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, cinfo->maxdmg); - SetFloatValue(UNIT_FIELD_MINRANGEDDAMAGE, cinfo->minrangedmg * damagemod); - SetFloatValue(UNIT_FIELD_MAXRANGEDDAMAGE, cinfo->maxrangedmg * damagemod); + SetFloatValue(UNIT_FIELD_MINRANGEDDAMAGE, cinfo->minrangedmg); + SetFloatValue(UNIT_FIELD_MAXRANGEDDAMAGE, cinfo->maxrangedmg); - SetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_VALUE, cinfo->attackpower * damagemod); + SetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_VALUE, cinfo->attackpower); } diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 2c350956c0a..6ce0c0f902b 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -964,15 +964,11 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo) SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_PVP); SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE); } + SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_REGENERATE_POWER); - SetFloatValue(UNIT_MOD_CAST_SPEED, 1.0f); // fix cast time showed in spell tooltip on client - SetFloatValue(UNIT_MOD_CAST_HASTE, 1.0f); - SetFloatValue(PLAYER_FIELD_MOD_HASTE, 1.0f); - SetFloatValue(PLAYER_FIELD_MOD_RANGED_HASTE, 1.0f); SetFloatValue(UNIT_FIELD_HOVERHEIGHT, 1.0f); // default for players in 3.0.3 - // -1 is default value - SetInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, uint32(-1)); + SetInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, uint32(-1)); // -1 is default value SetUInt32Value(PLAYER_BYTES, (createInfo->Skin | (createInfo->Face << 8) | (createInfo->HairStyle << 16) | (createInfo->HairColor << 24))); SetUInt32Value(PLAYER_BYTES_2, (createInfo->FacialHair | @@ -3284,13 +3280,17 @@ void Player::InitStatsForLevel(bool reapplyMods) SetUInt32Value(index, 0); SetUInt32Value(PLAYER_FIELD_MOD_HEALING_DONE_POS, 0); + SetFloatValue(PLAYER_FIELD_MOD_HEALING_PCT, 1.0f); + SetFloatValue(PLAYER_FIELD_MOD_HEALING_DONE_PCT, 1.0f); for (uint8 i = 0; i < 7; ++i) { SetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG+i, 0); SetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS+i, 0); - SetFloatValue(PLAYER_FIELD_MOD_DAMAGE_DONE_PCT+i, 1.00f); + SetFloatValue(PLAYER_FIELD_MOD_DAMAGE_DONE_PCT+i, 1.0f); } + SetFloatValue(PLAYER_FIELD_MOD_SPELL_POWER_PCT, 1.0f); + //reset attack power, damage and attack speed fields SetFloatValue(UNIT_FIELD_BASEATTACKTIME, 2000.0f); SetFloatValue(UNIT_FIELD_BASEATTACKTIME + 1, 2000.0f); // offhand attack time @@ -3302,6 +3302,7 @@ void Player::InitStatsForLevel(bool reapplyMods) SetFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE, 0.0f); SetFloatValue(UNIT_FIELD_MINRANGEDDAMAGE, 0.0f); SetFloatValue(UNIT_FIELD_MAXRANGEDDAMAGE, 0.0f); + SetFloatValue(PLAYER_FIELD_WEAPON_DMG_MULTIPLIERS, 1.0f); SetInt32Value(UNIT_FIELD_ATTACK_POWER, 0); SetFloatValue(UNIT_FIELD_ATTACK_POWER_MULTIPLIER, 0.0f); diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 0da557aff50..368a78d5539 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -2095,7 +2095,9 @@ class Player : public Unit, public GridObject float OCTRegenMPPerSpirit(); float GetRatingMultiplier(CombatRating cr) const; float GetRatingBonusValue(CombatRating cr) const; - uint32 GetBaseSpellPowerBonus() { return m_baseSpellPower; } + + /// Returns base spellpower bonus from spellpower stat on items, without spellpower from intellect stat + uint32 GetBaseSpellPowerBonus() const { return m_baseSpellPower; } int32 GetSpellPenetrationItemMod() const { return m_spellPenetrationItemMod; } float GetExpertiseDodgeOrParryReduction(WeaponAttackType attType) const; diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 58bc4c541e6..1c583e4937e 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -9689,6 +9689,10 @@ int32 Unit::SpellBaseDamageBonusDone(SpellSchoolMask schoolMask) // Base value DoneAdvertisedBenefit += ToPlayer()->GetBaseSpellPowerBonus(); + // Check if we are ever using mana - PaperDollFrame.lua + if (GetPowerIndexByClass(POWER_MANA, getClass()) != MAX_POWERS) + DoneAdvertisedBenefit += std::max(0, int32(GetStat(STAT_INTELLECT)) - 10); // spellpower from intellect + // Damage bonus from stats AuraEffectList const& mDamageDoneOfStatPercent = GetAuraEffectsByType(SPELL_AURA_MOD_SPELL_DAMAGE_OF_STAT_PERCENT); for (AuraEffectList::const_iterator i = mDamageDoneOfStatPercent.begin(); i != mDamageDoneOfStatPercent.end(); ++i) @@ -10211,6 +10215,10 @@ int32 Unit::SpellBaseHealingBonusDone(SpellSchoolMask schoolMask) // Base value AdvertisedBenefit += ToPlayer()->GetBaseSpellPowerBonus(); + // Check if we are ever using mana - PaperDollFrame.lua + if (GetPowerIndexByClass(POWER_MANA, getClass()) != MAX_POWERS) + AdvertisedBenefit += std::max(0, int32(GetStat(STAT_INTELLECT)) - 10); // spellpower from intellect + // Healing bonus from stats AuraEffectList const& mHealingDoneOfStatPercent = GetAuraEffectsByType(SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT); for (AuraEffectList::const_iterator i = mHealingDoneOfStatPercent.begin(); i != mHealingDoneOfStatPercent.end(); ++i) @@ -12799,32 +12807,6 @@ void Unit::SetMaxHealth(uint32 val) SetHealth(val); } -uint32 Unit::GetPowerIndexByClass(uint32 powerId, uint32 classId) const -{ - ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(classId); - - ASSERT(classEntry && "Class not found"); - - uint32 index = 0; - for (uint32 i = 0; i <= sChrPowerTypesStore.GetNumRows(); ++i) - { - ChrPowerTypesEntry const* powerEntry = sChrPowerTypesStore.LookupEntry(i); - if (!powerEntry) - continue; - - if (powerEntry->classId != classId) - continue; - - if (powerEntry->power == powerId) - return index; - - ++index; - } - - // return invalid value - this class doesn't use this power - return MAX_POWERS; -}; - int32 Unit::GetPower(Powers power) const { uint32 powerIndex = GetPowerIndexByClass(power, getClass()); diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 60bf93e312d..3f79c8430b3 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1359,8 +1359,6 @@ class Unit : public WorldObject int32 ModifyPower(Powers power, int32 val); int32 ModifyPowerPct(Powers power, float pct, bool apply = true); - uint32 GetPowerIndexByClass(uint32 powerId, uint32 classId) const; - uint32 GetAttackTime(WeaponAttackType att) const { float f_BaseAttackTime = GetFloatValue(UNIT_FIELD_BASEATTACKTIME+att) / m_modAttackSpeedPct[att]; -- cgit v1.2.3 From d1b2f23078d973d49b5fe2864ed1d5079f828453 Mon Sep 17 00:00:00 2001 From: cyberbrest Date: Thu, 6 Sep 2012 22:12:39 +0100 Subject: Core/Movement: Fix & enable CMSG_MOVE_NOT_ACTIVE_MOVER and CMSG_DISMISS_CONTROLLED_VEHICLE Enables vehicles exit --- src/server/game/Movement/MovementStructures.h | 164 ++++++++++++++++++++++++++ src/server/game/Server/Protocol/Opcodes.cpp | 4 +- 2 files changed, 166 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Movement/MovementStructures.h b/src/server/game/Movement/MovementStructures.h index 8f609e8d076..d2a6e8ea8f6 100644 --- a/src/server/game/Movement/MovementStructures.h +++ b/src/server/game/Movement/MovementStructures.h @@ -1934,6 +1934,166 @@ MovementStatusElements MoveSplineDone[] = MSEEnd, }; +// 4.3.4 +MovementStatusElements MoveNotActiveMover[] = +{ + MSEPositionZ, + MSEPositionX, + MSEPositionY, + MSEHasMovementFlags2, + MSEHasTransportData, + MSEHasGuidByte6, + MSEHasSplineElevation, + MSEHasGuidByte3, + MSEZeroBit, + MSEHasTimestamp, + MSEHasGuidByte0, + MSEHasOrientation, + MSEHasGuidByte5, + MSEHasPitch, + MSEHasGuidByte1, + MSEHasGuidByte4, + MSEHasGuidByte7, + MSEHasSpline, + MSEHasGuidByte2, + MSEHasFallData, + MSEHasMovementFlags, + + MSEHasTransportGuidByte4, + MSEHasTransportGuidByte0, + MSEHasTransportGuidByte1, + MSEHasTransportGuidByte6, + MSEHasTransportGuidByte2, + MSEHasTransportTime3, + MSEHasTransportGuidByte5, + MSEHasTransportGuidByte7, + MSEHasTransportTime2, + MSEHasTransportGuidByte3, + + MSEHasFallDirection, + MSEMovementFlags, + MSEMovementFlags2, + + MSEGuidByte1, + MSEGuidByte0, + MSEGuidByte4, + MSEGuidByte2, + MSEGuidByte7, + MSEGuidByte5, + MSEGuidByte6, + MSEGuidByte3, + + MSEFallVerticalSpeed, + MSEFallCosAngle, + MSEFallSinAngle, + MSEFallHorizontalSpeed, + MSEFallTime, + + MSETransportTime3, + MSETransportGuidByte1, + MSETransportTime2, + MSETransportOrientation, + MSETransportGuidByte0, + MSETransportSeat, + MSETransportGuidByte4, + MSETransportGuidByte6, + MSETransportGuidByte3, + MSETransportGuidByte5, + MSETransportPositionY, + MSETransportPositionX, + MSETransportGuidByte2, + MSETransportPositionZ, + MSETransportGuidByte7, + MSETransportTime, + + MSETimestamp, + MSESplineElevation, + MSEPitch, + MSEOrientation, + + MSEEnd, +}; + +// 4.3.4 +MovementStatusElements DismissControlledVehicle[] = +{ + MSEPositionY, + MSEPositionZ, + MSEPositionX, + MSEHasSplineElevation, + MSEHasFallData, + MSEHasTransportData, + MSEHasGuidByte4, + MSEHasGuidByte7, + MSEHasMovementFlags2, + MSEHasGuidByte2, + MSEHasOrientation, + MSEHasGuidByte0, + MSEHasGuidByte6, + MSEHasPitch, + MSEHasTimestamp, + MSEHasGuidByte1, + MSEZeroBit, + MSEHasSpline, + MSEHasGuidByte3, + MSEHasMovementFlags, + MSEHasGuidByte5, + + MSEHasTransportGuidByte5, + MSEHasTransportTime3, + MSEHasTransportGuidByte2, + MSEHasTransportGuidByte0, + MSEHasTransportGuidByte7, + MSEHasTransportGuidByte3, + MSEHasTransportGuidByte4, + MSEHasTransportGuidByte1, + MSEHasTransportGuidByte6, + MSEHasTransportTime2, + + MSEMovementFlags2, + MSEHasFallDirection, + MSEMovementFlags, + + MSEGuidByte6, + MSEGuidByte3, + MSEGuidByte1, + MSEGuidByte5, + MSEGuidByte2, + MSEGuidByte4, + MSEGuidByte7, + MSEGuidByte0, + + MSETimestamp, + + MSETransportTime3, + MSETransportGuidByte4, + MSETransportGuidByte7, + MSETransportTime2, + MSETransportGuidByte6, + MSETransportTime, + MSETransportPositionZ, + MSETransportGuidByte0, + MSETransportPositionX, + MSETransportGuidByte3, + MSETransportSeat, + MSETransportPositionY, + MSETransportOrientation, + MSETransportGuidByte1, + MSETransportGuidByte5, + MSETransportGuidByte2, + + MSEFallTime, + MSEFallHorizontalSpeed, + MSEFallSinAngle, + MSEFallCosAngle, + MSEFallVerticalSpeed, + + MSEOrientation, + MSESplineElevation, + MSEPitch, + MSEEnd, +}; + MovementStatusElements* GetMovementStatusElementsSequence(Opcodes opcode) { switch (opcode) @@ -1988,6 +2148,10 @@ MovementStatusElements* GetMovementStatusElementsSequence(Opcodes opcode) return MoveChngTransport; case CMSG_MOVE_SPLINE_DONE: return MoveSplineDone; + case CMSG_MOVE_NOT_ACTIVE_MOVER: + return MoveNotActiveMover; + case CMSG_DISMISS_CONTROLLED_VEHICLE: + return DismissControlledVehicle; default: break; } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index f25f8d18b0d..1d5e7a3705b 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -201,7 +201,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_DEL_IGNORE, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleDelIgnoreOpcode ); DEFINE_OPCODE_HANDLER(CMSG_DEL_VOICE_IGNORE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_DESTROY_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDestroyItemOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_DISMISS_CONTROLLED_VEHICLE, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleDismissControlledVehicle ); + DEFINE_OPCODE_HANDLER(CMSG_DISMISS_CONTROLLED_VEHICLE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDismissControlledVehicle ); DEFINE_OPCODE_HANDLER(CMSG_DISMISS_CRITTER, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleDismissCritter ); DEFINE_OPCODE_HANDLER(CMSG_DUEL_ACCEPTED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDuelAcceptedOpcode ); DEFINE_OPCODE_HANDLER(CMSG_DUEL_CANCELLED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleDuelCancelledOpcode ); @@ -373,7 +373,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_MOVE_GRAVITY_ENABLE_ACK, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_MOVE_HOVER_ACK, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleMoveHoverAck ); DEFINE_OPCODE_HANDLER(CMSG_MOVE_KNOCK_BACK_ACK, STATUS_UNHANDLED, PROCESS_THREADSAFE, &WorldSession::HandleMoveKnockBackAck ); - DEFINE_OPCODE_HANDLER(CMSG_MOVE_NOT_ACTIVE_MOVER, STATUS_UNHANDLED, PROCESS_THREADSAFE, &WorldSession::HandleMoveNotActiveMover ); + DEFINE_OPCODE_HANDLER(CMSG_MOVE_NOT_ACTIVE_MOVER, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMoveNotActiveMover ); DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_CAN_FLY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_CAN_FLY_ACK, STATUS_UNHANDLED, PROCESS_THREADSAFE, &WorldSession::HandleMoveSetCanFlyAckOpcode ); DEFINE_OPCODE_HANDLER(CMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY_ACK, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); -- cgit v1.2.3 From 727369a159f9dd1a44ad65d9a1af241dcbe02c1b Mon Sep 17 00:00:00 2001 From: Tuxity Date: Fri, 7 Sep 2012 14:32:05 +0200 Subject: Core/Spells: DoTs can now crit --- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'src') diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 10ea10fab11..746a0ac238f 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -1155,18 +1155,7 @@ void AuraEffect::UpdatePeriodic(Unit* caster) bool AuraEffect::IsPeriodicTickCrit(Unit* target, Unit const* caster) const { ASSERT(caster); - Unit::AuraEffectList const& mPeriodicCritAuras= caster->GetAuraEffectsByType(SPELL_AURA_ABILITY_PERIODIC_CRIT); - for (Unit::AuraEffectList::const_iterator itr = mPeriodicCritAuras.begin(); itr != mPeriodicCritAuras.end(); ++itr) - { - if ((*itr)->IsAffectingSpell(m_spellInfo) && caster->isSpellCrit(target, m_spellInfo, m_spellInfo->GetSchoolMask())) - return true; - } - - // Rupture - since 3.3.3 can crit - if (m_spellInfo->SpellIconID == 500 && m_spellInfo->SpellFamilyName == SPELLFAMILY_ROGUE) - return caster->isSpellCrit(target, m_spellInfo, m_spellInfo->GetSchoolMask()); - - return false; + return caster->isSpellCrit(target, m_spellInfo, m_spellInfo->GetSchoolMask()); } bool AuraEffect::IsAffectingSpell(SpellInfo const* spell) const -- cgit v1.2.3 From 6ca7a7b78d2e08d9eae4b38d18ef7303c19acd82 Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 7 Sep 2012 14:39:19 +0200 Subject: Core/Guilds: Implemented basic guild leveling (no player statistics/reputation) --- sql/base/characters_database.sql | 3 + .../2012_09_07_00_characters_guild_434.sql | 3 + .../2012_09_09_00_world_guild_xp_for_level.sql | 33 ++++++ src/server/game/Achievements/AchievementMgr.cpp | 11 +- src/server/game/DataStores/DBCEnums.h | 5 - src/server/game/DataStores/DBCStructure.h | 1 + src/server/game/Entities/Player/Player.cpp | 20 +++- src/server/game/Entities/Player/Player.h | 75 ++++++------ src/server/game/Guilds/Guild.cpp | 132 +++++++++++++++++++-- src/server/game/Guilds/Guild.h | 14 ++- src/server/game/Guilds/GuildMgr.cpp | 78 +++++++++++- src/server/game/Guilds/GuildMgr.h | 9 ++ src/server/game/Handlers/CharacterHandler.cpp | 3 +- src/server/game/Handlers/GuildHandler.cpp | 73 ++++++++---- src/server/game/Server/Protocol/Opcodes.cpp | 10 +- src/server/game/Server/WorldSession.h | 1 + src/server/game/World/World.cpp | 18 ++- src/server/game/World/World.h | 6 + .../Database/Implementation/CharacterDatabase.cpp | 2 + .../Database/Implementation/CharacterDatabase.h | 2 + src/server/worldserver/worldserver.conf.dist | 70 +++++++++-- 21 files changed, 465 insertions(+), 104 deletions(-) create mode 100644 sql/updates/characters/2012_09_07_00_characters_guild_434.sql create mode 100644 sql/updates/world/2012_09_09_00_world_guild_xp_for_level.sql (limited to 'src') diff --git a/sql/base/characters_database.sql b/sql/base/characters_database.sql index 718ff3dba20..404ffbb6593 100644 --- a/sql/base/characters_database.sql +++ b/sql/base/characters_database.sql @@ -1639,6 +1639,9 @@ CREATE TABLE `guild` ( `motd` varchar(128) NOT NULL DEFAULT '', `createdate` int(10) unsigned NOT NULL DEFAULT '0', `BankMoney` bigint(20) unsigned NOT NULL DEFAULT '0', + `level` int(10) unsigned DEFAULT '1', + `experience` bigint(20) unsigned DEFAULT '0', + `todayExperience` bigint(20) unsigned DEFAULT '0', PRIMARY KEY (`guildid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Guild System'; /*!40101 SET character_set_client = @saved_cs_client */; diff --git a/sql/updates/characters/2012_09_07_00_characters_guild_434.sql b/sql/updates/characters/2012_09_07_00_characters_guild_434.sql new file mode 100644 index 00000000000..31695bab93f --- /dev/null +++ b/sql/updates/characters/2012_09_07_00_characters_guild_434.sql @@ -0,0 +1,3 @@ +ALTER TABLE guild ADD `level` INT(10) unsigned DEFAULT '1' AFTER `BankMoney`; +ALTER TABLE guild ADD `experience` BIGINT(20) unsigned DEFAULT '0' AFTER `level`; +ALTER TABLE guild ADD `todayExperience` BIGINT(20) unsigned DEFAULT '0' AFTER `experience`; diff --git a/sql/updates/world/2012_09_09_00_world_guild_xp_for_level.sql b/sql/updates/world/2012_09_09_00_world_guild_xp_for_level.sql new file mode 100644 index 00000000000..aa2ee143d53 --- /dev/null +++ b/sql/updates/world/2012_09_09_00_world_guild_xp_for_level.sql @@ -0,0 +1,33 @@ +DROP TABLE IF EXISTS `guild_xp_for_level`; +CREATE TABLE `guild_xp_for_level` ( + `lvl` int(11) unsigned NOT NULL, + `xp_for_next_level` bigint(20) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`lvl`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +INSERT INTO `guild_xp_for_level` VALUES +(1,16580000), +(2,18240000), +(3,19900000), +(4,21550000), +(5,23220000), +(6,24880000), +(7,26530000), +(8,28190000), +(9,29850000), +(10,31510000), +(11,33170000), +(12,34820000), +(13,36490000), +(14,38140000), +(15,39800000), +(16,41450000), +(17,43120000), +(18,44780000), +(19,46430000), +(20,48090000), +(21,49750000), +(22,51410000), +(23,53060000), +(24,54730000), +(25,56390000); diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index ee2795a83a8..a0400dad77a 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -1080,6 +1080,10 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, if (referencePlayer->isGameMaster()) return; + // Lua_GetGuildLevelEnabled() is checked in achievement UI to display guild tab + if (IsGuild() && !sWorld->getBoolConfig(CONFIG_GUILD_LEVELING_ENABLED)) + return; + AchievementCriteriaEntryList const& achievementCriteriaList = sAchievementMgr->GetAchievementCriteriaByType(type, IsGuild()); for (AchievementCriteriaEntryList::const_iterator i = achievementCriteriaList.begin(); i != achievementCriteriaList.end(); ++i) { @@ -1383,6 +1387,11 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, break; } + case ACHIEVEMENT_CRITERIA_TYPE_REACH_GUILD_LEVEL: + { + SetCriteriaProgress(achievementCriteria, referencePlayer->GetGuildLevel(), referencePlayer, PROGRESS_SET); + break; + } // FIXME: not triggered in code as result, need to implement case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_RAID: case ACHIEVEMENT_CRITERIA_TYPE_WIN_ARENA: @@ -1391,7 +1400,6 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, case ACHIEVEMENT_CRITERIA_TYPE_EARNED_PVP_TITLE: case ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE_TYPE: case ACHIEVEMENT_CRITERIA_TYPE_SPENT_GOLD_GUILD_REPAIRS: - case ACHIEVEMENT_CRITERIA_TYPE_REACH_GUILD_LEVEL: case ACHIEVEMENT_CRITERIA_TYPE_CRAFT_ITEMS_GUILD: case ACHIEVEMENT_CRITERIA_TYPE_CATCH_FROM_POOL: case ACHIEVEMENT_CRITERIA_TYPE_BUY_GUILD_BANK_SLOTS: @@ -1466,6 +1474,7 @@ bool AchievementMgr::IsCompletedCriteria(AchievementCriteriaEntry const* achi case ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE: return progress->counter >= achievementCriteria->kill_creature.creatureCount; case ACHIEVEMENT_CRITERIA_TYPE_REACH_LEVEL: + case ACHIEVEMENT_CRITERIA_TYPE_REACH_GUILD_LEVEL: return progress->counter >= achievementCriteria->reach_level.level; case ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL: return progress->counter >= achievementCriteria->reach_skill_level.skillLevel; diff --git a/src/server/game/DataStores/DBCEnums.h b/src/server/game/DataStores/DBCEnums.h index 5ab9949d9cf..1cf04aefdc1 100755 --- a/src/server/game/DataStores/DBCEnums.h +++ b/src/server/game/DataStores/DBCEnums.h @@ -302,11 +302,6 @@ enum AchievementCriteriaTypes #define ACHIEVEMENT_CRITERIA_TYPE_TOTAL 151 -enum AchievementCategory -{ - CATEGORY_CHILDRENS_WEEK = 163, -}; - enum AreaFlags { AREA_FLAG_SNOW = 0x00000001, // snow (only Dun Morogh, Naxxramas, Razorfen Downs and Winterspring) diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 1d397e8f3ec..552c4d81472 100644 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -87,6 +87,7 @@ struct AchievementCriteriaEntry } win_bg; // ACHIEVEMENT_CRITERIA_TYPE_REACH_LEVEL = 5 + // ACHIEVEMENT_CRITERIA_TYPE_REACH_GUILD_LEVEL = 125 struct { uint32 unused; // 3 diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 97c52ffd9f9..0579c9a4c36 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -980,7 +980,7 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo) SetUInt64Value(OBJECT_FIELD_DATA, 0); SetUInt32Value(PLAYER_GUILDRANK, 0); - SetUInt32Value(PLAYER_GUILDLEVEL, 0); + SetGuildLevel(0); SetUInt32Value(PLAYER_GUILD_TIMESTAMP, 0); for (int i = 0; i < KNOWN_TITLES_SIZE; ++i) @@ -7581,7 +7581,7 @@ uint32 Player::_GetCurrencyWeekCap(const CurrencyTypesEntry* currency) const if (cap != currency->WeekCap && IsInWorld() && !GetSession()->PlayerLoading()) { WorldPacket packet(SMSG_UPDATE_CURRENCY_WEEK_LIMIT, 8); - packet << uint32(cap / ((currency->Flags & 0x8) ? 100 : 1)); + packet << uint32(cap / ((currency->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? 100 : 1)); packet << uint32(currency->ID); GetSession()->SendPacket(&packet); } @@ -7589,6 +7589,17 @@ uint32 Player::_GetCurrencyWeekCap(const CurrencyTypesEntry* currency) const return cap; } +void Player::SetInGuild(uint32 guildId) +{ + if (guildId) + SetUInt64Value(OBJECT_FIELD_DATA, MAKE_NEW_GUID(guildId, 0, HIGHGUID_GUILD)); + else + SetUInt64Value(OBJECT_FIELD_DATA, 0); + + ApplyModFlag(PLAYER_FLAGS, PLAYER_FLAGS_GUILD_LEVEL_ENABLED, guildId != 0 && sWorld->getBoolConfig(CONFIG_GUILD_LEVELING_ENABLED)); + SetUInt16Value(OBJECT_FIELD_TYPE, 1, guildId != 0); +} + uint32 Player::GetGuildIdFromDB(uint64 guid) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_MEMBER); @@ -15098,7 +15109,7 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver, bool rewarded = (m_RewardedQuests.find(quest_id) != m_RewardedQuests.end()); // Not give XP in case already completed once repeatable quest - uint32 XP = rewarded ? 0 : uint32(quest->XPValue(this)*sWorld->getRate(RATE_XP_QUEST)); + uint32 XP = rewarded ? 0 : uint32(quest->XPValue(this) * sWorld->getRate(RATE_XP_QUEST)); // handle SPELL_AURA_MOD_XP_QUEST_PCT auras Unit::AuraEffectList const& ModXPPctAuras = GetAuraEffectsByType(SPELL_AURA_MOD_XP_QUEST_PCT); @@ -15111,6 +15122,9 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver, else moneyRew = int32(quest->GetRewMoneyMaxLevel() * sWorld->getRate(RATE_DROP_MONEY)); + if (Guild* guild = sGuildMgr->GetGuildById(GetGuildId())) + guild->GiveXP(uint32(quest->XPValue(this) * sWorld->getRate(RATE_XP_QUEST) * sWorld->getRate(RATE_XP_GUILD_MODIFIER)), this); + // Give player extra money if GetRewOrReqMoney > 0 and get ReqMoney if negative if (quest->GetRewOrReqMoney()) moneyRew += quest->GetRewOrReqMoney(); diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 368a78d5539..95013eed71c 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -457,38 +457,38 @@ enum DrunkenState enum PlayerFlags { - PLAYER_FLAGS_GROUP_LEADER = 0x00000001, - PLAYER_FLAGS_AFK = 0x00000002, - PLAYER_FLAGS_DND = 0x00000004, - PLAYER_FLAGS_GM = 0x00000008, - PLAYER_FLAGS_GHOST = 0x00000010, - PLAYER_FLAGS_RESTING = 0x00000020, - PLAYER_FLAGS_UNK6 = 0x00000040, - PLAYER_FLAGS_UNK7 = 0x00000080, // pre-3.0.3 PLAYER_FLAGS_FFA_PVP flag for FFA PVP state - PLAYER_FLAGS_CONTESTED_PVP = 0x00000100, // Player has been involved in a PvP combat and will be attacked by contested guards - PLAYER_FLAGS_IN_PVP = 0x00000200, - PLAYER_FLAGS_HIDE_HELM = 0x00000400, - PLAYER_FLAGS_HIDE_CLOAK = 0x00000800, - PLAYER_FLAGS_PLAYED_LONG_TIME = 0x00001000, // played long time - PLAYER_FLAGS_PLAYED_TOO_LONG = 0x00002000, // played too long time - PLAYER_FLAGS_IS_OUT_OF_BOUNDS = 0x00004000, - PLAYER_FLAGS_DEVELOPER = 0x00008000, // prefix for something? - PLAYER_FLAGS_UNK16 = 0x00010000, // pre-3.0.3 PLAYER_FLAGS_SANCTUARY flag for player entered sanctuary - PLAYER_FLAGS_TAXI_BENCHMARK = 0x00020000, // taxi benchmark mode (on/off) (2.0.1) - PLAYER_FLAGS_PVP_TIMER = 0x00040000, // 3.0.2, pvp timer active (after you disable pvp manually) - PLAYER_FLAGS_UNK19 = 0x00080000, - PLAYER_FLAGS_UNK20 = 0x00100000, - PLAYER_FLAGS_UNK21 = 0x00200000, - PLAYER_FLAGS_COMMENTATOR2 = 0x00400000, - PLAYER_ALLOW_ONLY_ABILITY = 0x00800000, // used by bladestorm and killing spree, allowed only spells with SPELL_ATTR0_REQ_AMMO, SPELL_EFFECT_ATTACK, checked only for active player - PLAYER_FLAGS_UNK24 = 0x01000000, // disabled all melee ability on tab include autoattack - PLAYER_FLAGS_NO_XP_GAIN = 0x02000000, - PLAYER_FLAGS_UNK26 = 0x04000000, - PLAYER_FLAGS_UNK27 = 0x08000000, - PLAYER_FLAGS_UNK28 = 0x10000000, - PLAYER_FLAGS_VOID_UNLOCKED = 0x20000000, // void storage - PLAYER_FLAGS_UNK30 = 0x40000000, - PLAYER_FLAGS_UNK31 = 0x80000000, + PLAYER_FLAGS_GROUP_LEADER = 0x00000001, + PLAYER_FLAGS_AFK = 0x00000002, + PLAYER_FLAGS_DND = 0x00000004, + PLAYER_FLAGS_GM = 0x00000008, + PLAYER_FLAGS_GHOST = 0x00000010, + PLAYER_FLAGS_RESTING = 0x00000020, + PLAYER_FLAGS_UNK6 = 0x00000040, + PLAYER_FLAGS_UNK7 = 0x00000080, // pre-3.0.3 PLAYER_FLAGS_FFA_PVP flag for FFA PVP state + PLAYER_FLAGS_CONTESTED_PVP = 0x00000100, // Player has been involved in a PvP combat and will be attacked by contested guards + PLAYER_FLAGS_IN_PVP = 0x00000200, + PLAYER_FLAGS_HIDE_HELM = 0x00000400, + PLAYER_FLAGS_HIDE_CLOAK = 0x00000800, + PLAYER_FLAGS_PLAYED_LONG_TIME = 0x00001000, // played long time + PLAYER_FLAGS_PLAYED_TOO_LONG = 0x00002000, // played too long time + PLAYER_FLAGS_IS_OUT_OF_BOUNDS = 0x00004000, + PLAYER_FLAGS_DEVELOPER = 0x00008000, // prefix for something? + PLAYER_FLAGS_UNK16 = 0x00010000, // pre-3.0.3 PLAYER_FLAGS_SANCTUARY flag for player entered sanctuary + PLAYER_FLAGS_TAXI_BENCHMARK = 0x00020000, // taxi benchmark mode (on/off) (2.0.1) + PLAYER_FLAGS_PVP_TIMER = 0x00040000, // 3.0.2, pvp timer active (after you disable pvp manually) + PLAYER_FLAGS_UNK19 = 0x00080000, + PLAYER_FLAGS_UNK20 = 0x00100000, + PLAYER_FLAGS_UNK21 = 0x00200000, + PLAYER_FLAGS_COMMENTATOR2 = 0x00400000, + PLAYER_ALLOW_ONLY_ABILITY = 0x00800000, // used by bladestorm and killing spree, allowed only spells with SPELL_ATTR0_REQ_AMMO, SPELL_EFFECT_ATTACK, checked only for active player + PLAYER_FLAGS_UNK24 = 0x01000000, // disabled all melee ability on tab include autoattack + PLAYER_FLAGS_NO_XP_GAIN = 0x02000000, + PLAYER_FLAGS_UNK26 = 0x04000000, + PLAYER_FLAGS_UNK27 = 0x08000000, + PLAYER_FLAGS_GUILD_LEVEL_ENABLED = 0x10000000, // Lua_GetGuildLevelEnabled() - enables guild leveling related UI + PLAYER_FLAGS_VOID_UNLOCKED = 0x20000000, // void storage + PLAYER_FLAGS_UNK30 = 0x40000000, + PLAYER_FLAGS_UNK31 = 0x80000000, }; // used for PLAYER__FIELD_KNOWN_TITLES field (uint64), (1< void RemoveFromGroup(RemoveMethod method = GROUP_REMOVEMETHOD_DEFAULT) { RemoveFromGroup(GetGroup(), GetGUID(), method); } void SendUpdateToOutOfRangeGroupMembers(); - void SetInGuild(uint32 guildId) - { - if (guildId) - SetUInt64Value(OBJECT_FIELD_DATA, MAKE_NEW_GUID(guildId, 0, HIGHGUID_GUILD)); - else - SetUInt64Value(OBJECT_FIELD_DATA, 0); - - SetUInt16Value(OBJECT_FIELD_TYPE, 1, guildId != 0); - } - + void SetInGuild(uint32 guildId); void SetRank(uint8 rankId) { SetUInt32Value(PLAYER_GUILDRANK, rankId); } uint32 GetRank() { return GetUInt32Value(PLAYER_GUILDRANK); } void SetGuildLevel(uint32 level) { SetUInt32Value(PLAYER_GUILDLEVEL, level); } diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index ba9d8610c12..322e953be4a 100644 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -1060,7 +1060,8 @@ InventoryResult Guild::BankMoveItemData::CanStore(Item* pItem, bool swap) /////////////////////////////////////////////////////////////////////////////// // Guild -Guild::Guild() : m_id(0), m_leaderGuid(0), m_createdDate(0), m_accountsNumber(0), m_bankMoney(0), m_eventLog(NULL), m_achievementMgr(this), m_level(1) +Guild::Guild() : m_id(0), m_leaderGuid(0), m_createdDate(0), m_accountsNumber(0), m_bankMoney(0), m_eventLog(NULL), + m_achievementMgr(this), _level(1), _experience(0), _todayExperience(0) { memset(&m_bankEventLog, 0, (GUILD_BANK_MAX_TABS + 1) * sizeof(LogHolder*)); } @@ -1098,7 +1099,7 @@ bool Guild::Create(Player* pLeader, const std::string& name) m_motd = "No message set."; m_bankMoney = 0; m_createdDate = ::time(NULL); - m_level = 1; + _level = 1; _CreateLogHolders(); sLog->outDebug(LOG_FILTER_GUILD, "GUILD: creating guild [%s] for leader %s (%u)", @@ -1196,6 +1197,13 @@ void Guild::SaveToDB() { SQLTransaction trans = CharacterDatabase.BeginTransaction(); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_EXPERIENCE); + stmt->setUInt32(0, GetLevel()); + stmt->setUInt64(1, GetExperience()); + stmt->setUInt64(2, GetTodayExperience()); + stmt->setUInt32(3, GetId()); + trans->Append(stmt); + m_achievementMgr.SaveToDB(trans); CharacterDatabase.CommitTransaction(trans); @@ -1291,7 +1299,7 @@ void Guild::HandleRoster(WorldSession* session /*= NULL*/) data.WriteString(m_motd); data << uint32(m_accountsNumber); - data << uint32(GUILD_REPUTATION_WEEKLY_CAP); + data << uint32(sWorld->getIntConfig(CONFIG_GUILD_WEEKLY_REP_CAP)); data << uint32(secsToTimeBitFields(m_createdDate)); data << uint32(0); @@ -1669,6 +1677,8 @@ void Guild::HandleLeaveMember(WorldSession* session) if (m_members.size() > 1) // Leader cannot leave if he is not the last member SendCommandResult(session, GUILD_QUIT_S, ERR_GUILD_LEADER_LEAVE); + else if (GetLevel() >= sWorld->getIntConfig(CONFIG_GUILD_UNDELETABLE_LEVEL)) + SendCommandResult(session, GUILD_QUIT_S, ERR_GUILD_UNDELETABLE_DUE_TO_LEVEL); else // Guild is disbanded if leader leaves. Disband(); @@ -1924,6 +1934,8 @@ void Guild::HandleDisband(WorldSession* session) // Only leader can disband guild if (!_IsLeader(session->GetPlayer())) Guild::SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_PERMISSIONS); + else if (GetLevel() >= sWorld->getIntConfig(CONFIG_GUILD_UNDELETABLE_LEVEL)) + Guild::SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_UNDELETABLE_DUE_TO_LEVEL); else { Disband(); @@ -1941,11 +1953,11 @@ void Guild::HandleGuildPartyRequest(WorldSession* session) return; WorldPacket data(SMSG_GUILD_PARTY_STATE_RESPONSE, 13); - data.WriteBit(0); // Is guild group + data.WriteBit(player->GetMap()->GetOwnerGuildId(player->GetTeam()) == GetId()); // Is guild group data.FlushBits(); - data << float(0.f); // Guild XP multiplier - data << uint32(0); // Current guild members - data << uint32(0); // Needed guild members + data << float(0.f); // Guild XP multiplier + data << uint32(0); // Current guild members + data << uint32(0); // Needed guild members session->SendPacket(&data); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (SMSG_GUILD_PARTY_STATE_RESPONSE)"); @@ -2129,17 +2141,20 @@ void Guild::SendLoginInfo(WorldSession* session) const data << uint64(session->GetPlayer()->GetGUID()); session->SendPacket(&data); + data.Initialize(SMSG_GUILD_MEMBER_DAILY_RESET, 0); // tells the client to request bank withdrawal limit + session->SendPacket(&data); + + if (!sWorld->getBoolConfig(CONFIG_GUILD_LEVELING_ENABLED)) + return; + for (uint32 i = 0; i < sGuildPerkSpellsStore.GetNumRows(); ++i) if (GuildPerkSpellsEntry const* entry = sGuildPerkSpellsStore.LookupEntry(i)) if (entry->Level >= GetLevel()) - session->GetPlayer()->learnSpell(entry->SpellId, false); + session->GetPlayer()->learnSpell(entry->SpellId, true); SendGuildReputationWeeklyCap(session); GetAchievementMgr().SendAllAchievementData(session->GetPlayer()); - - data.Initialize(SMSG_GUILD_MEMBER_DAILY_RESET, 0); // tells the client to request bank withdrawal limit - session->SendPacket(&data); } void Guild::SendGuildReputationWeeklyCap(WorldSession* session) const @@ -2164,8 +2179,11 @@ bool Guild::LoadFromDB(Field* fields) m_motd = fields[9].GetString(); m_createdDate = time_t(fields[10].GetUInt32()); m_bankMoney = fields[11].GetUInt64(); + _level = fields[12].GetUInt32(); + _experience = fields[13].GetUInt64(); + _todayExperience = fields[14].GetUInt64(); - uint8 purchasedTabs = uint8(fields[12].GetUInt64()); + uint8 purchasedTabs = uint8(fields[15].GetUInt64()); if (purchasedTabs > GUILD_BANK_MAX_TABS) purchasedTabs = GUILD_BANK_MAX_TABS; @@ -2459,8 +2477,16 @@ bool Guild::AddMember(uint64 guid, uint8 rankId) { player->SetInGuild(m_id); player->SetRank(rankId); - player->SetGuildLevel(m_level); + player->SetGuildLevel(GetLevel()); player->SetGuildIdInvited(0); + + if (sWorld->getBoolConfig(CONFIG_GUILD_LEVELING_ENABLED)) + { + for (uint32 i = 0; i < sGuildPerkSpellsStore.GetNumRows(); ++i) + if (GuildPerkSpellsEntry const* entry = sGuildPerkSpellsStore.LookupEntry(i)) + if (entry->Level >= GetLevel()) + player->learnSpell(entry->SpellId, true); + } } _UpdateAccountsNumber(); @@ -2520,6 +2546,11 @@ void Guild::DeleteMember(uint64 guid, bool isDisbanding, bool isKicked) { player->SetInGuild(0); player->SetRank(0); + player->SetGuildLevel(0); + for (uint32 i = 0; i < sGuildPerkSpellsStore.GetNumRows(); ++i) + if (GuildPerkSpellsEntry const* entry = sGuildPerkSpellsStore.LookupEntry(i)) + if (entry->Level >= GetLevel()) + player->removeSpell(entry->SpellId, false, false); } _DeleteMemberFromDB(lowguid); @@ -3152,3 +3183,78 @@ void Guild::SendGuildRanksUpdate(uint64 setterGuid, uint64 targetGuid, uint32 ra sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_GUILD_RANKS_UPDATE"); } + +void Guild::GiveXP(uint32 xp, Player* source) +{ + if (!sWorld->getBoolConfig(CONFIG_GUILD_LEVELING_ENABLED)) + return; + + /// @TODO: Award reputation and count activity for player + + if (GetLevel() >= sWorld->getIntConfig(CONFIG_GUILD_MAX_LEVEL)) + xp = 0; // SMSG_GUILD_XP_GAIN is always sent, even for no gains + + if (GetLevel() >= GUILD_EXPERIENCE_UNCAPPED_LEVEL) + xp = std::min(xp, sWorld->getIntConfig(CONFIG_GUILD_DAILY_XP_CAP) - uint32(_todayExperience)); + + WorldPacket data(SMSG_GUILD_XP_GAIN, 8); + data << uint64(xp); + source->GetSession()->SendPacket(&data); + + _experience += xp; + _todayExperience += xp; + + if (!xp) + return; + + uint32 oldLevel = GetLevel(); + + // Ding, mon! + while (GetExperience() >= sGuildMgr->GetXPForGuildLevel(GetLevel()) && GetLevel() < sWorld->getIntConfig(CONFIG_GUILD_MAX_LEVEL)) + { + _experience -= sGuildMgr->GetXPForGuildLevel(GetLevel()); + ++_level; + } + + // Find all guild perks to learn + std::vector perksToLearn; + for (uint32 i = 0; i < sGuildPerkSpellsStore.GetNumRows(); ++i) + if (GuildPerkSpellsEntry const* entry = sGuildPerkSpellsStore.LookupEntry(i)) + if (entry->Level > oldLevel && entry->Level <= GetLevel()) + perksToLearn.push_back(entry->SpellId); + + // Notify all online players that guild level changed and learn perks + for (Members::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr) + { + if (Player* player = itr->second->FindPlayer()) + { + player->SetGuildLevel(GetLevel()); + for (size_t i = 0; i < perksToLearn.size(); ++i) + player->learnSpell(perksToLearn[i], true); + } + } + + GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_GUILD_LEVEL, GetLevel(), 0, NULL, source); +} + +void Guild::SendGuildXP(WorldSession* session) const +{ + Member const* member = GetMember(session->GetGuidLow()); + + WorldPacket data(SMSG_GUILD_XP, 40); + data << uint64(/*member ? member->GetTotalActivity() :*/ 0); + data << uint64(sGuildMgr->GetXPForGuildLevel(GetLevel()) - GetExperience()); // XP missing for next level + data << uint64(GetTodayExperience()); + data << uint64(/*member ? member->GetWeeklyActivity() :*/ 0); + data << uint64(GetExperience()); + session->SendPacket(&data); +} + +void Guild::ResetDailyExperience() +{ + _todayExperience = 0; + + for (Members::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr) + if (Player* player = itr->second->FindPlayer()) + SendGuildXP(player->GetSession()); +} diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h index 1adf1675c45..b7613957a45 100755 --- a/src/server/game/Guilds/Guild.h +++ b/src/server/game/Guilds/Guild.h @@ -225,7 +225,7 @@ enum GuildMemberFlags GUILDMEMBER_STATUS_MOBILE = 0x0008, // remote chat from mobile app }; -#define GUILD_REPUTATION_WEEKLY_CAP 4375 +#define GUILD_EXPERIENCE_UNCAPPED_LEVEL 20 ///> Hardcoded in client, starting from this level, guild daily experience gain is unlimited. //////////////////////////////////////////////////////////////////////////////////////////// // Emblem info @@ -675,6 +675,7 @@ public: void SendMoneyInfo(WorldSession* session) const; void SendLoginInfo(WorldSession* session) const; void SendGuildReputationWeeklyCap(WorldSession* session) const; + void SendGuildXP(WorldSession* session) const; // Load from DB bool LoadFromDB(Field* fields); @@ -720,7 +721,12 @@ public: AchievementMgr& GetAchievementMgr() { return m_achievementMgr; } AchievementMgr const& GetAchievementMgr() const { return m_achievementMgr; } - uint32 GetLevel() const { return m_level; } + // Guild leveling + uint32 GetLevel() const { return _level; } + void GiveXP(uint32 xp, Player* source); + uint64 GetExperience() const { return _experience; } + uint64 GetTodayExperience() const { return _todayExperience; } + void ResetDailyExperience(); protected: uint32 m_id; @@ -744,7 +750,9 @@ protected: AchievementMgr m_achievementMgr; - uint32 m_level; + uint32 _level; + uint64 _experience; + uint64 _todayExperience; private: inline uint32 _GetRanksSize() const { return uint32(m_ranks.size()); } diff --git a/src/server/game/Guilds/GuildMgr.cpp b/src/server/game/Guilds/GuildMgr.cpp index 04b0cfeaa39..726add2cf44 100644 --- a/src/server/game/Guilds/GuildMgr.cpp +++ b/src/server/game/Guilds/GuildMgr.cpp @@ -107,6 +107,26 @@ Guild* GuildMgr::GetGuildByLeader(uint64 guid) const return NULL; } +uint32 GuildMgr::GetXPForGuildLevel(uint8 level) const +{ + if (level < GuildXPperLevel.size()) + return GuildXPperLevel[level]; + return 0; +} + +void GuildMgr::ResetExperienceCaps() +{ + CharacterDatabase.Execute(CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_RESET_TODAY_EXPERIENCE)); + + for (GuildContainer::iterator itr = GuildStore.begin(); itr != GuildStore.end(); ++itr) + itr->second->ResetDailyExperience(); +} + +void GuildMgr::ResetReputationCaps() +{ + /// @TODO: Implement +} + void GuildMgr::LoadGuilds() { // 1. Load all guilds @@ -116,8 +136,8 @@ void GuildMgr::LoadGuilds() // 0 1 2 3 4 5 6 QueryResult result = CharacterDatabase.Query("SELECT g.guildid, g.name, g.leaderguid, g.EmblemStyle, g.EmblemColor, g.BorderStyle, g.BorderColor, " - // 7 8 9 10 11 12 - "g.BackgroundColor, g.info, g.motd, g.createdate, g.BankMoney, COUNT(gbt.guildid) " + // 7 8 9 10 11 12 13 14 15 + "g.BackgroundColor, g.info, g.motd, g.createdate, g.BankMoney, g.level, g.experience, g.todayExperience, COUNT(gbt.guildid) " "FROM guild g LEFT JOIN guild_bank_tab gbt ON g.guildid = gbt.guildid GROUP BY g.guildid ORDER BY g.guildid ASC"); if (!result) @@ -435,3 +455,57 @@ void GuildMgr::LoadGuilds() sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Validated data of loaded guilds in %u ms", GetMSTimeDiffToNow(oldMSTime)); } } + +void GuildMgr::LoadGuildXpForLevel() +{ + uint32 oldMSTime = getMSTime(); + + GuildXPperLevel.resize(sWorld->getIntConfig(CONFIG_GUILD_MAX_LEVEL)); + for (uint8 level = 0; level < sWorld->getIntConfig(CONFIG_GUILD_MAX_LEVEL); ++level) + GuildXPperLevel[level] = 0; + + // 0 1 + QueryResult result = WorldDatabase.Query("SELECT lvl, xp_for_next_level FROM guild_xp_for_level"); + + if (!result) + { + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 xp for guild level definitions. DB table `guild_xp_for_level` is empty."); + return; + } + + uint32 count = 0; + + do + { + Field* fields = result->Fetch(); + + uint32 level = fields[0].GetUInt8(); + uint32 requiredXP = fields[1].GetUInt64(); + + if (level >= sWorld->getIntConfig(CONFIG_GUILD_MAX_LEVEL)) + { + sLog->outInfo(LOG_FILTER_GENERAL, "Unused (> Guild.MaxLevel in worldserver.conf) level %u in `guild_xp_for_level` table, ignoring.", uint32(level)); + continue; + } + + GuildXPperLevel[level] = requiredXP; + ++count; + } while (result->NextRow()); + + // fill level gaps + for (uint8 level = 1; level < sWorld->getIntConfig(CONFIG_GUILD_MAX_LEVEL); ++level) + { + if (!GuildXPperLevel[level]) + { + sLog->outError(LOG_FILTER_SQL, "Level %i does not have XP for guild level data. Using data of level [%i] + 1660000.", level+1, level); + GuildXPperLevel[level] = GuildXPperLevel[level - 1] + 1660000; + } + } + + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u xp for guild level definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); +} + +void GuildMgr::LoadGuildRewards() +{ + /// @TODO: Implement +} diff --git a/src/server/game/Guilds/GuildMgr.h b/src/server/game/Guilds/GuildMgr.h index 4b999c9231a..a2bf6d268b5 100644 --- a/src/server/game/Guilds/GuildMgr.h +++ b/src/server/game/Guilds/GuildMgr.h @@ -36,18 +36,27 @@ public: Guild* GetGuildByName(const std::string& guildName) const; std::string GetGuildNameById(uint32 guildId) const; + void LoadGuildXpForLevel(); + void LoadGuildRewards(); + void LoadGuilds(); void AddGuild(Guild* guild); void RemoveGuild(uint32 guildId); void SaveGuilds(); + void ResetExperienceCaps(); + void ResetReputationCaps(); + uint32 GenerateGuildId(); void SetNextGuildId(uint32 Id) { NextGuildId = Id; } + uint32 GetXPForGuildLevel(uint8 level) const; + protected: uint32 NextGuildId; GuildContainer GuildStore; + std::vector GuildXPperLevel; }; #define sGuildMgr ACE_Singleton::instance() diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 6609ef55494..f3f21c40002 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -928,12 +928,13 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder) pCurrChar->SetInGuild(fields[0].GetUInt32()); pCurrChar->SetRank(fields[1].GetUInt8()); if (Guild* guild = sGuildMgr->GetGuildById(pCurrChar->GetGuildId())) - pCurrChar->SetUInt32Value(PLAYER_GUILDLEVEL, guild->GetLevel()); + pCurrChar->SetGuildLevel(guild->GetLevel()); } else if (pCurrChar->GetGuildId()) // clear guild related fields in case wrong data about non existed membership { pCurrChar->SetInGuild(0); pCurrChar->SetRank(0); + pCurrChar->SetGuildLevel(0); } data.Initialize(SMSG_LEARNED_DANCE_MOVES, 4+4); diff --git a/src/server/game/Handlers/GuildHandler.cpp b/src/server/game/Handlers/GuildHandler.cpp index b3c2d4ae030..06536a90db3 100755 --- a/src/server/game/Handlers/GuildHandler.cpp +++ b/src/server/game/Handlers/GuildHandler.cpp @@ -645,32 +645,33 @@ void WorldSession::HandleSetGuildBankTabText(WorldPacket& recvData) guild->SetBankTabText(tabId, text); } -void WorldSession::HandleGuildQueryXPOpcode(WorldPacket& recvData) +void WorldSession::HandleGuildQueryXPOpcode(WorldPacket& recvPacket) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUERY_GUILD_XP"); ObjectGuid guildGuid; - guildGuid[2] = recvData.ReadBit(); - guildGuid[1] = recvData.ReadBit(); - guildGuid[0] = recvData.ReadBit(); - guildGuid[5] = recvData.ReadBit(); - guildGuid[4] = recvData.ReadBit(); - guildGuid[7] = recvData.ReadBit(); - guildGuid[6] = recvData.ReadBit(); - guildGuid[3] = recvData.ReadBit(); - - recvData.ReadByteSeq(guildGuid[7]); - recvData.ReadByteSeq(guildGuid[2]); - recvData.ReadByteSeq(guildGuid[3]); - recvData.ReadByteSeq(guildGuid[6]); - recvData.ReadByteSeq(guildGuid[1]); - recvData.ReadByteSeq(guildGuid[5]); - recvData.ReadByteSeq(guildGuid[0]); - recvData.ReadByteSeq(guildGuid[4]); + guildGuid[2] = recvPacket.ReadBit(); + guildGuid[1] = recvPacket.ReadBit(); + guildGuid[0] = recvPacket.ReadBit(); + guildGuid[5] = recvPacket.ReadBit(); + guildGuid[4] = recvPacket.ReadBit(); + guildGuid[7] = recvPacket.ReadBit(); + guildGuid[6] = recvPacket.ReadBit(); + guildGuid[3] = recvPacket.ReadBit(); + + recvPacket.ReadByteSeq(guildGuid[7]); + recvPacket.ReadByteSeq(guildGuid[2]); + recvPacket.ReadByteSeq(guildGuid[3]); + recvPacket.ReadByteSeq(guildGuid[6]); + recvPacket.ReadByteSeq(guildGuid[1]); + recvPacket.ReadByteSeq(guildGuid[5]); + recvPacket.ReadByteSeq(guildGuid[0]); + recvPacket.ReadByteSeq(guildGuid[4]); - //if (Guild* guild = sGuildMgr->GetGuildByGuid(guildGuid)) - // guild->Send SMSG_GUILD_XP + if (Guild* guild = sGuildMgr->GetGuildByGuid(guildGuid)) + if (guild->IsMember(_player->GetGUID())) + guild->SendGuildXP(this); } void WorldSession::HandleGuildSetRankPermissionsOpcode(WorldPacket& recvPacket) @@ -741,3 +742,35 @@ void WorldSession::HandleGuildRequestPartyState(WorldPacket& recvData) if (Guild* guild = sGuildMgr->GetGuildByGuid(guildGuid)) guild->HandleGuildPartyRequest(this); } + +void WorldSession::HandleGuildRequestMaxDailyXP(WorldPacket& recvPacket) +{ + ObjectGuid guid; + guid[0] = recvPacket.ReadBit(); + guid[3] = recvPacket.ReadBit(); + guid[5] = recvPacket.ReadBit(); + guid[1] = recvPacket.ReadBit(); + guid[4] = recvPacket.ReadBit(); + guid[6] = recvPacket.ReadBit(); + guid[7] = recvPacket.ReadBit(); + guid[2] = recvPacket.ReadBit(); + + recvPacket.ReadByteSeq(guid[7]); + recvPacket.ReadByteSeq(guid[4]); + recvPacket.ReadByteSeq(guid[3]); + recvPacket.ReadByteSeq(guid[5]); + recvPacket.ReadByteSeq(guid[1]); + recvPacket.ReadByteSeq(guid[2]); + recvPacket.ReadByteSeq(guid[6]); + recvPacket.ReadByteSeq(guid[0]); + + if (Guild* guild = sGuildMgr->GetGuildByGuid(guid)) + { + if (guild->IsMember(_player->GetGUID())) + { + WorldPacket data(SMSG_GUILD_MAX_DAILY_XP, 8); + data << uint64(sWorld->getIntConfig(CONFIG_GUILD_DAILY_XP_CAP)); + SendPacket(&data); + } + } +} diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 1d5e7a3705b..1989481581f 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -277,7 +277,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_GUILD_REMOVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildRemoveOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_REPLACE_GUILD_MASTER, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_REQUEST_CHALLENGE_UPDATE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_REQUEST_MAX_DAILY_XP, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_REQUEST_MAX_DAILY_XP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildRequestMaxDailyXP ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_REQUEST_PARTY_STATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildRequestPartyState ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_ROSTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildRosterOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_SET_ACHIEVEMENT_TRACKING, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -420,7 +420,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_MEMBER_RECIPES, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_RECIPES, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_REWARDS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_XP, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildQueryXPOpcode ); // STATUS_AUTHED + DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_XP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildQueryXPOpcode ); // STATUS_AUTHED DEFINE_OPCODE_HANDLER(CMSG_QUERY_INSPECT_ACHIEVEMENTS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryInspectAchievements ); DEFINE_OPCODE_HANDLER(CMSG_QUERY_QUESTS_COMPLETED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryQuestsCompleted ); DEFINE_OPCODE_HANDLER(CMSG_QUERY_TIME, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryTimeOpcode ); @@ -866,7 +866,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_GUILD_FLAGGED_FOR_RENAME, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_INVITE_CANCEL, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GUILD_MAX_DAILY_XP, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_MAX_DAILY_XP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_MEMBERS_FOR_RECIPE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_MEMBER_DAILY_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_MEMBER_RECIPES, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -888,8 +888,8 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_GUILD_REWARDS_LIST, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_ROSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_UPDATE_ROSTER, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GUILD_XP, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GUILD_XP_GAIN, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_XP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_XP_GAIN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_HEALTH_UPDATE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_HIGHEST_THREAT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_HOTFIX_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 6ff03b9c838..307f61beb4a 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -591,6 +591,7 @@ class WorldSession void HandleGuildChangeInfoTextOpcode(WorldPacket& recvPacket); void HandleSaveGuildEmblemOpcode(WorldPacket& recvPacket); void HandleGuildRequestPartyState(WorldPacket& recvPacket); + void HandleGuildRequestMaxDailyXP(WorldPacket& recvPacket); void HandleTaxiNodeStatusQueryOpcode(WorldPacket& recvPacket); void HandleTaxiQueryAvailableNodes(WorldPacket& recvPacket); diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 0a9af095352..1b3c44375d9 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1198,7 +1198,13 @@ void World::LoadConfigSettings(bool reload) m_int_configs[CONFIG_DB_PING_INTERVAL] = ConfigMgr::GetIntDefault("MaxPingTime", 30); // Guild save interval - m_int_configs[CONFIG_GUILD_SAVE_INTERVAL] = ConfigMgr::GetIntDefault("GuildSaveInterval", 15); + m_bool_configs[CONFIG_GUILD_LEVELING_ENABLED] = ConfigMgr::GetBoolDefault("Guild.LevelingEnabled", true); + m_int_configs[CONFIG_GUILD_SAVE_INTERVAL] = ConfigMgr::GetIntDefault("Guild.SaveInterval", 15); + m_int_configs[CONFIG_GUILD_MAX_LEVEL] = ConfigMgr::GetIntDefault("Guild.MaxLevel", 25); + m_int_configs[CONFIG_GUILD_UNDELETABLE_LEVEL] = ConfigMgr::GetIntDefault("Guild.UndeletableLevel", 4); + rate_values[RATE_XP_GUILD_MODIFIER] = ConfigMgr::GetFloatDefault("Guild.XPModifier", 0.25f); + m_int_configs[CONFIG_GUILD_DAILY_XP_CAP] = ConfigMgr::GetIntDefault("Guild.DailyXPCap", 7807500); + m_int_configs[CONFIG_GUILD_WEEKLY_REP_CAP] = ConfigMgr::GetIntDefault("Guild.WeeklyReputationCap", 4375); // misc m_bool_configs[CONFIG_PDUMP_NO_PATHS] = ConfigMgr::GetBoolDefault("PlayerDump.DisallowPaths", true); @@ -1553,6 +1559,12 @@ void World::SetInitialWorldSettings() sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Auctions..."); sAuctionMgr->LoadAuctions(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Guild XP for level..."); + sGuildMgr->LoadGuildXpForLevel(); + + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Guild rewards..."); + sGuildMgr->LoadGuildRewards(); + sGuildMgr->LoadGuilds(); sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading ArenaTeams..."); @@ -1905,10 +1917,14 @@ void World::Update(uint32 diff) { ResetDailyQuests(); m_NextDailyQuestReset += DAY; + sGuildMgr->ResetExperienceCaps(); } if (m_gameTime > m_NextWeeklyQuestReset) + { ResetWeeklyQuests(); + sGuildMgr->ResetReputationCaps(); + } if (m_gameTime > m_NextRandomBGReset) ResetRandomBG(); diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h index b25444f4865..f0f5e3f723b 100755 --- a/src/server/game/World/World.h +++ b/src/server/game/World/World.h @@ -174,6 +174,7 @@ enum WorldBoolConfigs CONFIG_QUEST_IGNORE_AUTO_COMPLETE, CONFIG_WARDEN_ENABLED, CONFIG_WINTERGRASP_ENABLE, + CONFIG_GUILD_LEVELING_ENABLED, BOOL_CONFIG_VALUE_COUNT }; @@ -337,6 +338,10 @@ enum WorldIntConfigs CONFIG_WINTERGRASP_NOBATTLETIME, CONFIG_WINTERGRASP_RESTART_AFTER_CRASH, CONFIG_GUILD_SAVE_INTERVAL, + CONFIG_GUILD_MAX_LEVEL, + CONFIG_GUILD_UNDELETABLE_LEVEL, + CONFIG_GUILD_DAILY_XP_CAP, + CONFIG_GUILD_WEEKLY_REP_CAP, INT_CONFIG_VALUE_COUNT }; @@ -364,6 +369,7 @@ enum Rates RATE_DROP_MONEY, RATE_XP_KILL, RATE_XP_QUEST, + RATE_XP_GUILD_MODIFIER, RATE_XP_EXPLORE, RATE_REPAIRCOST, RATE_REPUTATION_GAIN, diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index 286f2c20811..bb958be8ca7 100755 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -239,6 +239,8 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_DEL_ALL_GUILD_ACHIEVEMENT_CRITERIA, "DELETE FROM guild_achievement_progress WHERE guildId = ?", CONNECTION_SYNCH) PREPARE_STATEMENT(CHAR_SEL_GUILD_ACHIEVEMENT, "SELECT achievement, date, guids FROM guild_achievement WHERE guildId = ?", CONNECTION_SYNCH) PREPARE_STATEMENT(CHAR_SEL_GUILD_ACHIEVEMENT_CRITERIA, "SELECT criteria, counter, date, completedGuid FROM guild_achievement_progress WHERE guildId = ?", CONNECTION_SYNCH) + PREPARE_STATEMENT(CHAR_UPD_GUILD_EXPERIENCE, "UPDATE guild SET level = ?, experience = ?, todayExperience = ? WHERE guildId = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_UPD_GUILD_RESET_TODAY_EXPERIENCE, "UPDATE guild SET todayExperience = 0", CONNECTION_ASYNC); // Chat channel handling PREPARE_STATEMENT(CHAR_SEL_CHANNEL, "SELECT announce, ownership, password, bannedList FROM channels WHERE name = ? AND team = ?", CONNECTION_SYNCH) diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.h b/src/server/shared/Database/Implementation/CharacterDatabase.h index c134856a74f..9c06c547b39 100755 --- a/src/server/shared/Database/Implementation/CharacterDatabase.h +++ b/src/server/shared/Database/Implementation/CharacterDatabase.h @@ -234,6 +234,8 @@ enum CharacterDatabaseStatements CHAR_DEL_ALL_GUILD_ACHIEVEMENT_CRITERIA, CHAR_SEL_GUILD_ACHIEVEMENT, CHAR_SEL_GUILD_ACHIEVEMENT_CRITERIA, + CHAR_UPD_GUILD_EXPERIENCE, + CHAR_UPD_GUILD_RESET_TODAY_EXPERIENCE, CHAR_SEL_CHANNEL, CHAR_INS_CHANNEL, diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index 83b0edf61df..f8ee2390842 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -392,14 +392,6 @@ CleanCharacterDB = 0 PersistentCharacterCleanFlags = 0 -# -# GuildSaveInterval -# Description: Time (in minutes) between guild experience saves -# Default: 15 -# - -GuildSaveInterval = 15 - # ################################################################################################### @@ -2821,3 +2813,65 @@ Loggers=Root Chat DBErrors GM RA Warden Character Load WorldServer Opcodes # ################################################################################################### + +################################################################################################### +# +# GUILD LEVELING SETTINGS +# +# Guild.LevelingEnabled +# Description: Controls whether guild can gain levels +# Default: 1 +# + +Guild.LevelingEnabled = 1 + +# +# Guild.SaveInterval +# Description: Time (in minutes) between guild experience saves +# Default: 15 +# + +Guild.SaveInterval = 15 + +# +# Guild.MaxLevel +# Description: Defines max level a guild can reach +# Default: 25 +# + +Guild.MaxLevel = 25 + +# +# Guild.UndeletableLevel +# Description: Guild reaching this level (and higher) cannot be disbanded anymore +# Default: 4 +# + +Guild.UndeletableLevel = 4 + +# +# Guild.XPModifier +# Description: Multiplier for guild experience gained from quests +# Default: 0.25 +# + +Guild.XPModifier = 0.25 + +# +# Guild.DailyXPCap +# Description: Maximum experience points a guild can earn each day +# Default: 7807500 +# + +Guild.DailyXPCap = 7807500 + +# +# Guild.WeeklyReputationCap +# Description: Maximum guild reputation a player can earn every week +# Default: 4375 +# + +Guild.WeeklyReputationCap = 4375 + +# +################################################################################################### -- cgit v1.2.3 From eda5c3a9bfae1c9759a5cc00a2bdbd6bae184fab Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 7 Sep 2012 16:21:04 +0200 Subject: Core/Player: Implemented auto declining guild invites --- src/server/game/Entities/Player/Player.h | 2 +- src/server/game/Handlers/GuildHandler.cpp | 8 ++++++++ src/server/game/Server/Protocol/Opcodes.cpp | 2 +- src/server/game/Server/WorldSession.h | 1 + 4 files changed, 11 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 95013eed71c..7346ce54dff 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -484,7 +484,7 @@ enum PlayerFlags PLAYER_FLAGS_UNK24 = 0x01000000, // disabled all melee ability on tab include autoattack PLAYER_FLAGS_NO_XP_GAIN = 0x02000000, PLAYER_FLAGS_UNK26 = 0x04000000, - PLAYER_FLAGS_UNK27 = 0x08000000, + PLAYER_FLAGS_AUTO_DECLINE_GUILD = 0x08000000, // Automatically declines guild invites PLAYER_FLAGS_GUILD_LEVEL_ENABLED = 0x10000000, // Lua_GetGuildLevelEnabled() - enables guild leveling related UI PLAYER_FLAGS_VOID_UNLOCKED = 0x20000000, // void storage PLAYER_FLAGS_UNK30 = 0x40000000, diff --git a/src/server/game/Handlers/GuildHandler.cpp b/src/server/game/Handlers/GuildHandler.cpp index 06536a90db3..d45c79d1b84 100755 --- a/src/server/game/Handlers/GuildHandler.cpp +++ b/src/server/game/Handlers/GuildHandler.cpp @@ -774,3 +774,11 @@ void WorldSession::HandleGuildRequestMaxDailyXP(WorldPacket& recvPacket) } } } + +void WorldSession::HandleAutoDeclineGuildInvites(WorldPacket& recvPakcet) +{ + uint8 enable; + recvPakcet >> enable; + + GetPlayer()->ApplyModFlag(PLAYER_FLAGS, PLAYER_FLAGS_AUTO_DECLINE_GUILD, enable); +} diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 1989481581f..74b6bd5d106 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -97,7 +97,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_BAG_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoStoreBagItemOpcode ); DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_BANK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoStoreBankItemOpcode ); DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_LOOT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutostoreLootItemOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_AUTO_DECLINE_GUILD_INVITES, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_AUTO_DECLINE_GUILD_INVITES, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleAutoDeclineGuildInvites ); DEFINE_OPCODE_HANDLER(CMSG_BANKER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBankerActivateOpcode ); DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_LEAVE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleBattlefieldLeaveOpcode ); DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlefieldListOpcode ); diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 307f61beb4a..6490b38105c 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -592,6 +592,7 @@ class WorldSession void HandleSaveGuildEmblemOpcode(WorldPacket& recvPacket); void HandleGuildRequestPartyState(WorldPacket& recvPacket); void HandleGuildRequestMaxDailyXP(WorldPacket& recvPacket); + void HandleAutoDeclineGuildInvites(WorldPacket& recvPakcet); void HandleTaxiNodeStatusQueryOpcode(WorldPacket& recvPacket); void HandleTaxiQueryAvailableNodes(WorldPacket& recvPacket); -- cgit v1.2.3 From a55c7f6c8401e2e7333f7f94f8c21d0c9e69ebe2 Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 8 Sep 2012 15:21:44 +0100 Subject: Core: Fix build and a warning --- src/server/game/Movement/Spline/MoveSplineInit.cpp | 4 ++-- src/server/shared/Packets/ByteBuffer.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Movement/Spline/MoveSplineInit.cpp b/src/server/game/Movement/Spline/MoveSplineInit.cpp index 973c1a918a6..60255f61b80 100644 --- a/src/server/game/Movement/Spline/MoveSplineInit.cpp +++ b/src/server/game/Movement/Spline/MoveSplineInit.cpp @@ -73,7 +73,7 @@ namespace Movement // there is a big chance that current position is unknown if current state is not finalized, need compute it // this also allows calculate spline position and update map position in much greater intervals // Don't compute for transport movement if the unit is in a motion between two transports - if (!move_spline.Finalized() && move_spline.onTransport == transport) + if (!move_spline.Finalized() && move_spline.onTransport == (unit.GetTransGUID() != 0)) real_position = move_spline.ComputePosition(); // should i do the things that user should do? - no. @@ -83,7 +83,7 @@ namespace Movement // correct first vertex args.path[0] = real_position; args.initialOrientation = real_position.orientation; - move_spline.onTransport = transport; + move_spline.onTransport = (unit.GetTransGUID() != 0); uint32 moveFlags = unit.m_movementInfo.GetMovementFlags(); if (args.flags.walkmode) diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h index e4535378a48..ee828b203b9 100755 --- a/src/server/shared/Packets/ByteBuffer.h +++ b/src/server/shared/Packets/ByteBuffer.h @@ -209,7 +209,7 @@ class ByteBuffer if (pos + bitCount > size() * 8) throw ByteBufferPositionException(false, (pos + bitCount) / 8, size(), (bitCount - 1) / 8 + 1); - for (int32 i = 0; i < bitCount; ++i) + for (uint32 i = 0; i < bitCount; ++i) { size_t wp = (pos + i) / 8; size_t bit = (pos + i) % 8; -- cgit v1.2.3 From c86abc28c2f3a944922d1fcac75805c32dfb7663 Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 8 Sep 2012 16:40:36 +0100 Subject: Core/Tools: Update PlayerDump TODO: character_void_storage --- src/server/game/Tools/PlayerDump.cpp | 16 +++++++++------- src/server/game/Tools/PlayerDump.h | 3 ++- 2 files changed, 11 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/server/game/Tools/PlayerDump.cpp b/src/server/game/Tools/PlayerDump.cpp index 2907292f5a6..ae05cb4e8eb 100644 --- a/src/server/game/Tools/PlayerDump.cpp +++ b/src/server/game/Tools/PlayerDump.cpp @@ -23,7 +23,7 @@ #include "ObjectMgr.h" #include "AccountMgr.h" -#define DUMP_TABLE_COUNT 27 +#define DUMP_TABLE_COUNT 29 struct DumpTable { char const* name; @@ -38,6 +38,8 @@ static DumpTable dumpTables[DUMP_TABLE_COUNT] = { "character_achievement_progress", DTT_CHAR_TABLE }, { "character_action", DTT_CHAR_TABLE }, { "character_aura", DTT_CHAR_TABLE }, + { "character_currency", DTT_CHAR_TABLE }, + { "character_cuf_profiles", DTT_CHAR_TABLE }, { "character_declinedname", DTT_CHAR_TABLE }, { "character_equipmentsets", DTT_EQSET_TABLE}, { "character_gifts", DTT_ITEM_GIFT }, @@ -319,13 +321,13 @@ bool PlayerDumpWriter::DumpTable(std::string& dump, uint32 guid, char const*tabl break; case DTT_CHARACTER: { - if (result->GetFieldCount() <= 68) // avoid crashes on next check + if (result->GetFieldCount() <= 64) // avoid crashes on next check { sLog->outFatal(LOG_FILTER_GENERAL, "PlayerDumpWriter::DumpTable - Trying to access non-existing or wrong positioned field (`deleteInfos_Account`) in `characters` table."); return false; } - if (result->Fetch()[68].GetUInt32()) // characters.deleteInfos_Account - if filled error + if (result->Fetch()[64].GetUInt32()) // characters.deleteInfos_Account - if filled error return false; break; } @@ -544,18 +546,18 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s PreparedQueryResult result = CharacterDatabase.Query(stmt); if (result) - if (!changenth(line, 37, "1")) // characters.at_login set to "rename on login" + if (!changenth(line, 38, "1")) // characters.at_login set to "rename on login" ROLLBACK(DUMP_FILE_BROKEN); } else if (!changenth(line, 3, name.c_str())) // characters.name ROLLBACK(DUMP_FILE_BROKEN); const char null[5] = "NULL"; - if (!changenth(line, 69, null)) // characters.deleteInfos_Account + if (!changenth(line, 63, null)) // characters.deleteInfos_Account ROLLBACK(DUMP_FILE_BROKEN); - if (!changenth(line, 70, null)) // characters.deleteInfos_Name + if (!changenth(line, 64, null)) // characters.deleteInfos_Name ROLLBACK(DUMP_FILE_BROKEN); - if (!changenth(line, 71, null)) // characters.deleteDate + if (!changenth(line, 65, null)) // characters.deleteDate ROLLBACK(DUMP_FILE_BROKEN); break; } diff --git a/src/server/game/Tools/PlayerDump.h b/src/server/game/Tools/PlayerDump.h index b5655328507..691a7725a17 100755 --- a/src/server/game/Tools/PlayerDump.h +++ b/src/server/game/Tools/PlayerDump.h @@ -30,7 +30,8 @@ enum DumpTableType DTT_CHAR_TABLE, // // character_achievement, character_achievement_progress, // character_action, character_aura, character_homebind, // character_queststatus, character_queststatus_rewarded, character_reputation, - // character_spell, character_spell_cooldown, character_ticket, character_talent + // character_spell, character_spell_cooldown, character_ticket, character_talent. + // character_cuf_profiles, character_currency DTT_EQSET_TABLE, // <- guid // character_equipmentsets -- cgit v1.2.3 From 8a88994a821a485c9dcb4d14139d88396e27e781 Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 9 Sep 2012 03:05:45 +0100 Subject: Fix a merge failure, I need to sleep... --- src/server/game/Handlers/CharacterHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 6684b09c5ca..32ed1d2b27f 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -1396,7 +1396,7 @@ void WorldSession::HandleAlterAppearance(WorldPacket& recvData) if (bs_skinColor && (bs_skinColor->type != 3 || bs_skinColor->race != _player->getRace() || bs_skinColor->gender != _player->getGender())) return; - uint32 cost = _player->GetBarberShopCost(bs_hair->hair_id, Color, bs_facialHair->hair_id, bs_skinColor); + GameObject* go = _player->FindNearestGameObjectOfType(GAMEOBJECT_TYPE_BARBER_CHAIR, 5.0f); if (!go) { WorldPacket data(SMSG_BARBER_SHOP_RESULT, 4); -- cgit v1.2.3 From 6662c4e60455f1f62a1360ca87b537069d1766ee Mon Sep 17 00:00:00 2001 From: Sovak Date: Sun, 9 Sep 2012 11:14:56 +0200 Subject: Core/Battlegrounds: Fixed 2 more structures Signed-off-by: Sovak --- src/server/game/Battlegrounds/BattlegroundMgr.cpp | 71 ++++++++++++++++++++++- 1 file changed, 68 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index afc63ed6704..becfc70fce8 100755 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -192,8 +192,73 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro { case STATUS_NONE: { - //data->Initialize(SMSG_BATTLEFIELD_STATUS_FAILED); - sLog->outDebug(LOG_FILTER_NETWORKIO, ">>>>> STATUS_NONE"); + data->Initialize(SMSG_BATTLEFIELD_STATUS_FAILED); + ObjectGuid unkGuid1 = 0; // Not seen packets + ObjectGuid unkGuid2 = 0; // Not seen packets + + data->Initialize(SMSG_BATTLEFIELD_STATUS_FAILED); + + data->WriteBit(guidBytes2[3]); + data->WriteBit(unkGuid2[3]); + data->WriteBit(unkGuid1[3]); + data->WriteBit(unkGuid2[0]); + data->WriteBit(guidBytes2[6]); + data->WriteBit(unkGuid1[5]); + data->WriteBit(unkGuid1[6]); + data->WriteBit(unkGuid1[4]); + + data->WriteBit(unkGuid1[2]); + data->WriteBit(unkGuid2[1]); + data->WriteBit(guidBytes2[1]); + data->WriteBit(unkGuid2[5]); + data->WriteBit(unkGuid2[6]); + data->WriteBit(unkGuid1[1]); + data->WriteBit(guidBytes2[7]); + data->WriteBit(unkGuid2[4]); + + data->WriteBit(guidBytes2[2]); + data->WriteBit(guidBytes2[5]); + data->WriteBit(unkGuid2[7]); + data->WriteBit(guidBytes2[4]); + data->WriteBit(guidBytes2[0]); + data->WriteBit(unkGuid1[0]); + data->WriteBit(unkGuid2[2]); + data->WriteBit(unkGuid1[7]); + + data->WriteByteSeq(guidBytes2[1]); + + *data << uint32(bg->GetStatus()); + *data << uint32(QueueSlot); + + data->WriteByteSeq(unkGuid1[6]); + data->WriteByteSeq(unkGuid1[3]); + data->WriteByteSeq(unkGuid1[7]); + data->WriteByteSeq(unkGuid1[4]); + data->WriteByteSeq(guidBytes2[0]); + data->WriteByteSeq(unkGuid1[5]); + data->WriteByteSeq(guidBytes2[7]); + data->WriteByteSeq(guidBytes2[6]); + data->WriteByteSeq(guidBytes2[2]); + data->WriteByteSeq(unkGuid2[6]); + data->WriteByteSeq(unkGuid2[3]); + data->WriteByteSeq(unkGuid1[1]); + data->WriteByteSeq(guidBytes2[3]); + data->WriteByteSeq(unkGuid2[0]); + data->WriteByteSeq(unkGuid2[1]); + data->WriteByteSeq(unkGuid2[4]); + data->WriteByteSeq(unkGuid1[0]); + data->WriteByteSeq(guidBytes2[5]); + data->WriteByteSeq(unkGuid2[7]); + data->WriteByteSeq(guidBytes2[4]); + data->WriteByteSeq(unkGuid1[2]); + + *data << uint32(bg->GetTypeID()); + + data->WriteByteSeq(unkGuid2[2]); + + *data << uint32(time(NULL)); + + data->WriteByteSeq(unkGuid2[5]); break; } case STATUS_WAIT_QUEUE: @@ -288,7 +353,7 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro data->WriteByteSeq(guidBytes2[6]); data->WriteByteSeq(guidBytes2[5]); data->WriteByteSeq(guidBytes2[7]); - data->WriteByteSeq(guidBytes2[0]); + data->WriteByteSeq(guidBytes2[2]); data->WriteByteSeq(guidBytes1[0]); data->WriteByteSeq(guidBytes1[7]); data->WriteByteSeq(guidBytes2[4]); -- cgit v1.2.3 From da5f8f58e205bd2c896677daf6500af4ffe655f1 Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 9 Sep 2012 11:42:31 -0500 Subject: Core/Scripts: Cleanup the warrior spell scripts --- .../2012_09_09_01_world_spell_script_names.sql | 5 + src/server/game/Spells/SpellEffects.cpp | 2 +- src/server/scripts/Spells/spell_warrior.cpp | 233 ++++----------------- 3 files changed, 45 insertions(+), 195 deletions(-) create mode 100644 sql/updates/world/2012_09_09_01_world_spell_script_names.sql (limited to 'src') diff --git a/sql/updates/world/2012_09_09_01_world_spell_script_names.sql b/sql/updates/world/2012_09_09_01_world_spell_script_names.sql new file mode 100644 index 00000000000..5c1701e45bd --- /dev/null +++ b/sql/updates/world/2012_09_09_01_world_spell_script_names.sql @@ -0,0 +1,5 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_warr_improved_spell_reflection', 'spell_warr_vigilance', 'spell_warr_charge', 'spell_warr_slam', 'spell_warr_execute', 'spell_warr_overpower'); +INSERT INTO `spell_script_names`(`spell_id`,`ScriptName`) VALUES +(100,'spell_warr_charge'), +(1464,'spell_warr_slam'), +(5308,'spell_warr_execute'); diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 340140ea249..7e32ce9137e 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -387,7 +387,7 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex) case SPELLFAMILY_WARRIOR: { // Victory Rush - if (m_spellInfo->SpellFamilyFlags[1] & 0x100) + if (m_spellInfo->Id == 34428) ApplyPctF(damage, m_caster->GetTotalAttackPowerValue(BASE_ATTACK)); // Shockwave else if (m_spellInfo->Id == 46968) diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index c64101e11ea..2918a05774d 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -27,9 +27,21 @@ enum WarriorSpells { - WARRIOR_SPELL_LAST_STAND_TRIGGERED = 12976, + SPELL_LAST_STAND_TRIGGERED = 12976, + SPELL_DEEP_WOUNDS_RANK_1 = 12162, + SPELL_DEEP_WOUNDS_RANK_2 = 12850, + SPELL_DEEP_WOUNDS_RANK_3 = 12868, + SPELL_DEEP_WOUNDS_RANK_PERIODIC = 12721, + SPELL_JUGGERNAUT_CRIT_BONUS_TALENT = 64976, + SPELL_JUGGERNAUT_CRIT_BONUS_BUFF = 65156, + SPELL_CHARGE = 34846, + SPELL_SLAM = 50782, + ICON_ID_SUDDEN_DEATH = 1989, + SPELL_BLOODTHIRST_DAMAGE = 23881, + SPELL_BLOODTHIRST = 23885, }; +/// Updated 4.3.4 class spell_warr_last_stand : public SpellScriptLoader { public: @@ -41,7 +53,7 @@ class spell_warr_last_stand : public SpellScriptLoader bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellMgr->GetSpellInfo(WARRIOR_SPELL_LAST_STAND_TRIGGERED)) + if (!sSpellMgr->GetSpellInfo(SPELL_LAST_STAND_TRIGGERED)) return false; return true; } @@ -50,8 +62,8 @@ class spell_warr_last_stand : public SpellScriptLoader { if (Unit* caster = GetCaster()) { - int32 healthModSpellBasePoints0 = int32(caster->CountPctFromMaxHealth(30)); - caster->CastCustomSpell(caster, WARRIOR_SPELL_LAST_STAND_TRIGGERED, &healthModSpellBasePoints0, NULL, NULL, true, NULL); + int32 healthModSpellBasePoints0 = int32(caster->CountPctFromMaxHealth(GetEffectValue())); + caster->CastCustomSpell(caster, SPELL_LAST_STAND_TRIGGERED, &healthModSpellBasePoints0, NULL, NULL, true, NULL); } } @@ -68,96 +80,7 @@ class spell_warr_last_stand : public SpellScriptLoader } }; -class spell_warr_improved_spell_reflection : public SpellScriptLoader -{ - public: - spell_warr_improved_spell_reflection() : SpellScriptLoader("spell_warr_improved_spell_reflection") { } - - class spell_warr_improved_spell_reflection_SpellScript : public SpellScript - { - PrepareSpellScript(spell_warr_improved_spell_reflection_SpellScript); - - void FilterTargets(std::list& unitList) - { - if (GetCaster()) - unitList.remove(GetCaster()); - } - - void Register() - { - OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_warr_improved_spell_reflection_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_PARTY); - } - }; - - SpellScript* GetSpellScript() const - { - return new spell_warr_improved_spell_reflection_SpellScript(); - } -}; - -enum DamageReductionAura -{ - SPELL_BLESSING_OF_SANCTUARY = 20911, - SPELL_GREATER_BLESSING_OF_SANCTUARY = 25899, - SPELL_RENEWED_HOPE = 63944, - SPELL_DAMAGE_REDUCTION_AURA = 68066, -}; - -class spell_warr_vigilance : public SpellScriptLoader -{ -public: - spell_warr_vigilance() : SpellScriptLoader("spell_warr_vigilance") { } - - class spell_warr_vigilance_AuraScript : public AuraScript - { - PrepareAuraScript(spell_warr_vigilance_AuraScript); - - bool Validate(SpellInfo const* /*SpellEntry*/) - { - if (!sSpellMgr->GetSpellInfo(SPELL_DAMAGE_REDUCTION_AURA)) - return false; - return true; - } - - void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - if (Unit* target = GetTarget()) - target->CastSpell(target, SPELL_DAMAGE_REDUCTION_AURA, true); - } - - void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - if (Unit* target = GetTarget()) - { - if (target->HasAura(SPELL_DAMAGE_REDUCTION_AURA) && !(target->HasAura(SPELL_BLESSING_OF_SANCTUARY) || - target->HasAura(SPELL_GREATER_BLESSING_OF_SANCTUARY) || - target->HasAura(SPELL_RENEWED_HOPE))) - target->RemoveAurasDueToSpell(SPELL_DAMAGE_REDUCTION_AURA); - } - } - - void Register() - { - OnEffectApply += AuraEffectApplyFn(spell_warr_vigilance_AuraScript::OnApply, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); - OnEffectRemove += AuraEffectRemoveFn(spell_warr_vigilance_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); - } - - }; - - AuraScript* GetAuraScript() const - { - return new spell_warr_vigilance_AuraScript(); - } -}; - -enum DeepWounds -{ - SPELL_DEEP_WOUNDS_RANK_1 = 12162, - SPELL_DEEP_WOUNDS_RANK_2 = 12850, - SPELL_DEEP_WOUNDS_RANK_3 = 12868, - SPELL_DEEP_WOUNDS_RANK_PERIODIC = 12721, -}; - +/// Updated 4.3.4 class spell_warr_deep_wounds : public SpellScriptLoader { public: @@ -174,7 +97,7 @@ class spell_warr_deep_wounds : public SpellScriptLoader return true; } - void HandleDummy(SpellEffIndex /* effIndex */) + void HandleDummy(SpellEffIndex /*effIndex*/) { int32 damage = GetEffectValue(); Unit* caster = GetCaster(); @@ -212,13 +135,7 @@ class spell_warr_deep_wounds : public SpellScriptLoader } }; -enum Charge -{ - SPELL_JUGGERNAUT_CRIT_BONUS_TALENT = 64976, - SPELL_JUGGERNAUT_CRIT_BONUS_BUFF = 65156, - SPELL_CHARGE = 34846, -}; - +/// Updated 4.3.4 class spell_warr_charge : public SpellScriptLoader { public: @@ -234,7 +151,7 @@ class spell_warr_charge : public SpellScriptLoader return false; return true; } - void HandleDummy(SpellEffIndex /* effIndex */) + void HandleDummy(SpellEffIndex /*effIndex*/) { int32 chargeBasePoints0 = GetEffectValue(); Unit* caster = GetCaster(); @@ -257,11 +174,7 @@ class spell_warr_charge : public SpellScriptLoader } }; -enum Slam -{ - SPELL_SLAM = 50783, -}; - +/// Updated 4.3.4 class spell_warr_slam : public SpellScriptLoader { public: @@ -277,7 +190,7 @@ class spell_warr_slam : public SpellScriptLoader return false; return true; } - void HandleDummy(SpellEffIndex /* effIndex */) + void HandleDummy(SpellEffIndex /*effIndex*/) { int32 bp0 = GetEffectValue(); if (GetHitUnit()) @@ -296,13 +209,7 @@ class spell_warr_slam : public SpellScriptLoader } }; -enum Execute -{ - SPELL_EXECUTE = 20647, - SPELL_GLYPH_OF_EXECUTION = 58367, - ICON_ID_SUDDEN_DEATH = 1989, -}; - +/// Updated 4.3.4 class spell_warr_execute : public SpellScriptLoader { public: @@ -312,42 +219,35 @@ class spell_warr_execute : public SpellScriptLoader { PrepareSpellScript(spell_warr_execute_SpellScript); - bool Validate(SpellInfo const* /*SpellEntry*/) - { - if (!sSpellMgr->GetSpellInfo(SPELL_EXECUTE) || !sSpellMgr->GetSpellInfo(SPELL_GLYPH_OF_EXECUTION)) - return false; - return true; - } - void HandleDummy(SpellEffIndex effIndex) + void HandleEffect(SpellEffIndex /*effIndex*/) { Unit* caster = GetCaster(); if (Unit* target = GetHitUnit()) { SpellInfo const* spellInfo = GetSpellInfo(); - int32 rageUsed = std::min(300 - spellInfo->CalcPowerCost(caster, SpellSchoolMask(spellInfo->SchoolMask)), caster->GetPower(POWER_RAGE)); + int32 rageUsed = std::min(200 - spellInfo->CalcPowerCost(caster, SpellSchoolMask(spellInfo->SchoolMask)), caster->GetPower(POWER_RAGE)); int32 newRage = std::max(0, caster->GetPower(POWER_RAGE) - rageUsed); // Sudden Death rage save if (AuraEffect* aurEff = caster->GetAuraEffect(SPELL_AURA_PROC_TRIGGER_SPELL, SPELLFAMILY_GENERIC, ICON_ID_SUDDEN_DEATH, EFFECT_0)) { - int32 ragesave = aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue() * 10; + int32 ragesave = aurEff->GetSpellInfo()->Effects[EFFECT_0].CalcValue() * 10; newRage = std::max(newRage, ragesave); } - + caster->SetPower(POWER_RAGE, uint32(newRage)); - // Glyph of Execution bonus - if (AuraEffect* aurEff = caster->GetAuraEffect(SPELL_GLYPH_OF_EXECUTION, EFFECT_0)) - rageUsed += aurEff->GetAmount() * 10; - - - int32 bp = GetEffectValue() + int32(rageUsed * spellInfo->Effects[effIndex].DamageMultiplier + caster->GetTotalAttackPowerValue(BASE_ATTACK) * 0.2f); - caster->CastCustomSpell(target,SPELL_EXECUTE,&bp,0,0,true,0,0,GetOriginalCaster()->GetGUID()); + + /// Formula taken from the DBC: "${10+$AP*0.437*$m1/100}" + int32 baseDamage = int32(10 + caster->GetTotalAttackPowerValue(BASE_ATTACK) * 0.437f * GetEffectValue() / 100.0f); + /// Formula taken from the DBC: "${$ap*0.874*$m1/100-1} = 20 rage" + int32 moreDamage = int32(rageUsed * (caster->GetTotalAttackPowerValue(BASE_ATTACK) * 0.874f * GetEffectValue() / 100.0f - 1) / 200); + SetHitDamage(baseDamage + moreDamage); } } void Register() { - OnEffectHitTarget += SpellEffectFn(spell_warr_execute_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + OnEffectHitTarget += SpellEffectFn(spell_warr_execute_SpellScript::HandleEffect, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); } }; @@ -357,6 +257,7 @@ class spell_warr_execute : public SpellScriptLoader } }; +/// Updated 4.3.4 class spell_warr_concussion_blow : public SpellScriptLoader { public: @@ -366,7 +267,7 @@ class spell_warr_concussion_blow : public SpellScriptLoader { PrepareSpellScript(spell_warr_concussion_blow_SpellScript); - void HandleDummy(SpellEffIndex /* effIndex */) + void HandleDummy(SpellEffIndex /*effIndex*/) { SetHitDamage(CalculatePctN(GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK), GetEffectValue())); } @@ -383,11 +284,7 @@ class spell_warr_concussion_blow : public SpellScriptLoader } }; -enum Bloodthirst -{ - SPELL_BLOODTHIRST = 23885, -}; - +/// Updated 4.3.4 class spell_warr_bloodthirst : public SpellScriptLoader { public: @@ -429,11 +326,7 @@ class spell_warr_bloodthirst : public SpellScriptLoader } }; -enum BloodthirstHeal -{ - SPELL_BLOODTHIRST_DAMAGE = 23881, -}; - +/// Updated 4.3.4 class spell_warr_bloodthirst_heal : public SpellScriptLoader { public: @@ -446,7 +339,7 @@ class spell_warr_bloodthirst_heal : public SpellScriptLoader void HandleHeal(SpellEffIndex /*effIndex*/) { if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_BLOODTHIRST_DAMAGE)) - SetHitHeal(GetCaster()->CountPctFromMaxHealth(spellInfo->Effects[EFFECT_1].CalcValue(GetCaster()))); + SetHitHeal(GetCaster()->CountPctFromMaxHealth(spellInfo->Effects[EFFECT_1].CalcValue(GetCaster())) / 100); } void Register() @@ -461,56 +354,9 @@ class spell_warr_bloodthirst_heal : public SpellScriptLoader } }; -enum Overpower -{ - SPELL_UNRELENTING_ASSAULT_RANK_1 = 46859, - SPELL_UNRELENTING_ASSAULT_RANK_2 = 46860, - SPELL_UNRELENTING_ASSAULT_TRIGGER_1 = 64849, - SPELL_UNRELENTING_ASSAULT_TRIGGER_2 = 64850, -}; - -class spell_warr_overpower : public SpellScriptLoader -{ -public: - spell_warr_overpower() : SpellScriptLoader("spell_warr_overpower") { } - - class spell_warr_overpower_SpellScript : public SpellScript - { - PrepareSpellScript(spell_warr_overpower_SpellScript); - - void HandleEffect(SpellEffIndex /* effIndex */) - { - uint32 spellId = 0; - if (GetCaster()->HasAura(SPELL_UNRELENTING_ASSAULT_RANK_1)) - spellId = SPELL_UNRELENTING_ASSAULT_TRIGGER_1; - else if (GetCaster()->HasAura(SPELL_UNRELENTING_ASSAULT_RANK_2)) - spellId = SPELL_UNRELENTING_ASSAULT_TRIGGER_2; - - if (!spellId) - return; - - if (Player* target = GetHitPlayer()) - if (target->HasUnitState(UNIT_STATE_CASTING)) - target->CastSpell(target, spellId, true); - } - - void Register() - { - OnEffectHitTarget += SpellEffectFn(spell_warr_overpower_SpellScript::HandleEffect, EFFECT_0, SPELL_EFFECT_ANY); - } - }; - - SpellScript* GetSpellScript() const - { - return new spell_warr_overpower_SpellScript(); - } -}; - void AddSC_warrior_spell_scripts() { new spell_warr_last_stand(); - new spell_warr_improved_spell_reflection(); - new spell_warr_vigilance(); new spell_warr_deep_wounds(); new spell_warr_charge(); new spell_warr_slam(); @@ -518,5 +364,4 @@ void AddSC_warrior_spell_scripts() new spell_warr_concussion_blow(); new spell_warr_bloodthirst(); new spell_warr_bloodthirst_heal(); - new spell_warr_overpower(); } -- cgit v1.2.3 From 6fc3d3a77c738411b12a06fd1e6b32b1562a56c7 Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 9 Sep 2012 12:28:31 -0500 Subject: Core/Scripts: Some cleanup in warlock spellscripts --- .../2012_09_09_02_world_spell_script_names.sql | 4 +++ src/server/scripts/Spells/spell_warlock.cpp | 38 ++++------------------ 2 files changed, 10 insertions(+), 32 deletions(-) create mode 100644 sql/updates/world/2012_09_09_02_world_spell_script_names.sql (limited to 'src') diff --git a/sql/updates/world/2012_09_09_02_world_spell_script_names.sql b/sql/updates/world/2012_09_09_02_world_spell_script_names.sql new file mode 100644 index 00000000000..a4304663d9c --- /dev/null +++ b/sql/updates/world/2012_09_09_02_world_spell_script_names.sql @@ -0,0 +1,4 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_warl_banish','spell_warl_create_healthstone','spell_warl_ritual_of_doom_effect'); +INSERT INTO `spell_script_names`(`spell_id`,`ScriptName`) VALUES +(710,'spell_warl_banish'), +(6201,'spell_warl_create_healthstone'); diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 0def62b7d3a..a841db86e65 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -47,6 +47,7 @@ enum WarlockSpells WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R2 = 60956, }; +/// Updated 4.3.4 class spell_warl_banish : public SpellScriptLoader { public: @@ -64,11 +65,13 @@ public: void HandleBanish() { + /// Casting Banish on a banished target will cancel the effect + /// Check if the target already has Banish, if so, do nothing. if (Unit* target = GetHitUnit()) { if (target->GetAuraEffect(SPELL_AURA_SCHOOL_IMMUNITY, SPELLFAMILY_WARLOCK, 0, 0x08000000, 0)) { - //No need to remove old aura since its removed due to not stack by current Banish aura + // No need to remove old aura since its removed due to not stack by current Banish aura PreventHitDefaultEffect(EFFECT_0); PreventHitDefaultEffect(EFFECT_1); PreventHitDefaultEffect(EFFECT_2); @@ -99,6 +102,7 @@ public: }; // 47193 Demonic Empowerment +/// Updated 4.3.4 class spell_warl_demonic_empowerment : public SpellScriptLoader { public: @@ -132,7 +136,6 @@ class spell_warl_demonic_empowerment : public SpellScriptLoader SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER); int32 hp = int32(targetCreature->CountPctFromMaxHealth(GetCaster()->CalculateSpellDamage(targetCreature, spellInfo, 0))); targetCreature->CastCustomSpell(targetCreature, WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER, &hp, NULL, NULL, true); - //unitTarget->CastSpell(unitTarget, 54441, true); break; } case CREATURE_FAMILY_FELGUARD: @@ -161,7 +164,7 @@ class spell_warl_demonic_empowerment : public SpellScriptLoader } }; -// 6201 Create Healthstone (and ranks) +// 6201 Create Healthstone class spell_warl_create_healthstone : public SpellScriptLoader { public: @@ -270,34 +273,6 @@ class spell_warl_everlasting_affliction : public SpellScriptLoader } }; -// 18541 Ritual of Doom Effect -class spell_warl_ritual_of_doom_effect : public SpellScriptLoader -{ -public: - spell_warl_ritual_of_doom_effect() : SpellScriptLoader("spell_warl_ritual_of_doom_effect") { } - - class spell_warl_ritual_of_doom_effect_SpellScript : public SpellScript - { - PrepareSpellScript(spell_warl_ritual_of_doom_effect_SpellScript); - - void HandleDummy(SpellEffIndex /*effIndex*/) - { - Unit* caster = GetCaster(); - caster->CastSpell(caster, GetEffectValue(), true); - } - - void Register() - { - OnEffectHit += SpellEffectFn(spell_warl_ritual_of_doom_effect_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; - - SpellScript* GetSpellScript() const - { - return new spell_warl_ritual_of_doom_effect_SpellScript(); - } -}; - class spell_warl_seed_of_corruption : public SpellScriptLoader { public: @@ -723,7 +698,6 @@ void AddSC_warlock_spell_scripts() new spell_warl_demonic_empowerment(); new spell_warl_create_healthstone(); new spell_warl_everlasting_affliction(); - new spell_warl_ritual_of_doom_effect(); new spell_warl_seed_of_corruption(); new spell_warl_soulshatter(); new spell_warl_life_tap(); -- cgit v1.2.3 From ca7bab19e0b05952be494ee1efd7b0ab9aebfa1b Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 9 Sep 2012 14:57:37 -0500 Subject: Core/PacketIO: Enabled some opcodes --- src/server/game/Handlers/ChatHandler.cpp | 24 ++++++++++++++++++++---- src/server/game/Handlers/MiscHandler.cpp | 2 +- src/server/game/Handlers/PetHandler.cpp | 2 +- src/server/game/Handlers/QueryHandler.cpp | 2 +- src/server/game/Handlers/SpellHandler.cpp | 2 +- src/server/game/Server/Protocol/Opcodes.cpp | 12 ++++++------ 6 files changed, 30 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cpp index 2ab2831c0d0..66d8acb5d34 100644 --- a/src/server/game/Handlers/ChatHandler.cpp +++ b/src/server/game/Handlers/ChatHandler.cpp @@ -754,14 +754,30 @@ void WorldSession::HandleTextEmoteOpcode(WorldPacket & recvData) void WorldSession::HandleChatIgnoredOpcode(WorldPacket& recvData) { - uint64 iguid; + ObjectGuid guid; uint8 unk; //sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: Received CMSG_CHAT_IGNORED"); - recvData >> iguid; recvData >> unk; // probably related to spam reporting - - Player* player = ObjectAccessor::FindPlayer(iguid); + guid[5] = recvData.ReadBit(); + guid[2] = recvData.ReadBit(); + guid[6] = recvData.ReadBit(); + guid[4] = recvData.ReadBit(); + guid[7] = recvData.ReadBit(); + guid[0] = recvData.ReadBit(); + guid[1] = recvData.ReadBit(); + guid[3] = recvData.ReadBit(); + + recvData.ReadByteSeq(guid[0]); + recvData.ReadByteSeq(guid[6]); + recvData.ReadByteSeq(guid[5]); + recvData.ReadByteSeq(guid[1]); + recvData.ReadByteSeq(guid[4]); + recvData.ReadByteSeq(guid[3]); + recvData.ReadByteSeq(guid[7]); + recvData.ReadByteSeq(guid[2]); + + Player* player = ObjectAccessor::FindPlayer(guid); if (!player || !player->GetSession()) return; diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index aaf7540325b..1df8edd7275 100644 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -1427,7 +1427,7 @@ void WorldSession::HandleComplainOpcode(WorldPacket& recvData) recvData >> unk1; // probably language recvData >> unk2; // message type? recvData >> unk3; // probably channel id - recvData >> unk4; // unk random value + recvData >> unk4; // time recvData >> description; // spam description string (messagetype, channel name, player name, message) break; } diff --git a/src/server/game/Handlers/PetHandler.cpp b/src/server/game/Handlers/PetHandler.cpp index c0345e17fcd..85d4ce83990 100644 --- a/src/server/game/Handlers/PetHandler.cpp +++ b/src/server/game/Handlers/PetHandler.cpp @@ -32,7 +32,7 @@ #include "Group.h" #include "SpellInfo.h" -void WorldSession::HandleDismissCritter(WorldPacket &recvData) +void WorldSession::HandleDismissCritter(WorldPacket& recvData) { uint64 guid; recvData >> guid; diff --git a/src/server/game/Handlers/QueryHandler.cpp b/src/server/game/Handlers/QueryHandler.cpp index 6ee11e4936d..a1f823b4534 100755 --- a/src/server/game/Handlers/QueryHandler.cpp +++ b/src/server/game/Handlers/QueryHandler.cpp @@ -388,7 +388,7 @@ void WorldSession::HandlePageTextQueryOpcode(WorldPacket& recvData) } } -void WorldSession::HandleCorpseMapPositionQuery(WorldPacket & recvData) +void WorldSession::HandleCorpseMapPositionQuery(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv CMSG_CORPSE_MAP_POSITION_QUERY"); diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp index de881e0608d..5c8f6c1f720 100755 --- a/src/server/game/Handlers/SpellHandler.cpp +++ b/src/server/game/Handlers/SpellHandler.cpp @@ -532,7 +532,7 @@ void WorldSession::HandleCancelAutoRepeatSpellOpcode(WorldPacket& /*recvPacket*/ _player->InterruptSpell(CURRENT_AUTOREPEAT_SPELL); } -void WorldSession::HandleCancelChanneling(WorldPacket & recvData) +void WorldSession::HandleCancelChanneling(WorldPacket& recvData) { recvData.read_skip(); // spellid, not used diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 74b6bd5d106..8399c69782d 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -135,12 +135,12 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_REMOVE_EVENT, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarRemoveEvent ); DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_UPDATE_EVENT, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarUpdateEvent ); DEFINE_OPCODE_HANDLER(CMSG_CANCEL_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelAuraOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_CANCEL_AUTO_REPEAT_SPELL, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelAutoRepeatSpellOpcode); + DEFINE_OPCODE_HANDLER(CMSG_CANCEL_AUTO_REPEAT_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelAutoRepeatSpellOpcode); DEFINE_OPCODE_HANDLER(CMSG_CANCEL_CAST, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleCancelCastOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_CANCEL_CHANNELLING, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelChanneling ); + DEFINE_OPCODE_HANDLER(CMSG_CANCEL_CHANNELLING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelChanneling ); DEFINE_OPCODE_HANDLER(CMSG_CANCEL_MOUNT_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelMountAuraOpcode ); DEFINE_OPCODE_HANDLER(CMSG_CANCEL_QUEUED_SPELL, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_CANCEL_TEMP_ENCHANTMENT, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelTempEnchantmentOpcode); + DEFINE_OPCODE_HANDLER(CMSG_CANCEL_TEMP_ENCHANTMENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelTempEnchantmentOpcode); DEFINE_OPCODE_HANDLER(CMSG_CANCEL_TRADE, STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelTradeOpcode); DEFINE_OPCODE_HANDLER(CMSG_CAST_SPELL, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleCastSpellOpcode ); DEFINE_OPCODE_HANDLER(CMSG_CHANGEPLAYER_DIFFICULTY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -175,7 +175,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_CHAR_RACE_CHANGE, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharFactionOrRaceChange ); DEFINE_OPCODE_HANDLER(CMSG_CHAR_RENAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleCharRenameOpcode ); DEFINE_OPCODE_HANDLER(CMSG_CHAT_FILTERED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_CHAT_IGNORED, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleChatIgnoredOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_CHAT_IGNORED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChatIgnoredOpcode ); DEFINE_OPCODE_HANDLER(CMSG_CLEAR_CHANNEL_WATCH, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_CLEAR_RAID_MARKER, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_CLEAR_TRADE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleClearTradeItemOpcode ); @@ -188,12 +188,12 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_INSTANCE_COMMAND, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_SKIRMISH_QUEUE_COMMAND, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_COMMENTATOR_START_WARGAME, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_COMPLAIN, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleComplainOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_COMPLAIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleComplainOpcode ); DEFINE_OPCODE_HANDLER(CMSG_COMPLETE_CINEMATIC, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCompleteCinematic ); DEFINE_OPCODE_HANDLER(CMSG_COMPLETE_MOVIE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_CONNECT_TO_FAILED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_CONTACT_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleContactListOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_CORPSE_MAP_POSITION_QUERY, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleCorpseMapPositionQuery ); + DEFINE_OPCODE_HANDLER(CMSG_CORPSE_MAP_POSITION_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCorpseMapPositionQuery ); DEFINE_OPCODE_HANDLER(CMSG_CREATURE_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleCreatureQueryOpcode ); DEFINE_OPCODE_HANDLER(CMSG_DANCE_QUERY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_DELETEEQUIPMENT_SET, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); -- cgit v1.2.3 From 271e9cb9e628177d37d45effbd39e7a31f8c9910 Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 9 Sep 2012 16:35:22 -0500 Subject: Core/Entities: Fixed the "Move To" command for pets. --- src/server/game/Entities/Unit/Unit.h | 3 ++- src/server/game/Handlers/PetHandler.cpp | 18 +++++++++++++++--- src/server/game/Server/WorldSession.h | 2 +- 3 files changed, 18 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 428769ab42c..ea892514e1a 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1042,7 +1042,8 @@ enum CommandStates COMMAND_STAY = 0, COMMAND_FOLLOW = 1, COMMAND_ATTACK = 2, - COMMAND_ABANDON = 3 + COMMAND_ABANDON = 3, + COMMAND_MOVE_TO = 4 }; #define UNIT_ACTION_BUTTON_ACTION(X) (uint32(X) & 0x00FFFFFF) diff --git a/src/server/game/Handlers/PetHandler.cpp b/src/server/game/Handlers/PetHandler.cpp index 85d4ce83990..db077011ee0 100644 --- a/src/server/game/Handlers/PetHandler.cpp +++ b/src/server/game/Handlers/PetHandler.cpp @@ -102,7 +102,7 @@ void WorldSession::HandlePetAction(WorldPacket & recvData) return; if (GetPlayer()->m_Controlled.size() == 1) - HandlePetActionHelper(pet, guid1, spellid, flag, guid2); + HandlePetActionHelper(pet, guid1, spellid, flag, guid2, x, y, z); else { //If a pet is dismissed, m_Controlled will change @@ -111,7 +111,7 @@ void WorldSession::HandlePetAction(WorldPacket & recvData) if ((*itr)->GetEntry() == pet->GetEntry() && (*itr)->isAlive()) controlled.push_back(*itr); for (std::vector::iterator itr = controlled.begin(); itr != controlled.end(); ++itr) - HandlePetActionHelper(*itr, guid1, spellid, flag, guid2); + HandlePetActionHelper(*itr, guid1, spellid, flag, guid2, x, y, z); } } @@ -142,7 +142,7 @@ void WorldSession::HandlePetStopAttack(WorldPacket &recvData) pet->AttackStop(); } -void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint16 spellid, uint16 flag, uint64 guid2) +void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint16 spellid, uint16 flag, uint64 guid2, float x, float y, float z) { CharmInfo* charmInfo = pet->GetCharmInfo(); if (!charmInfo) @@ -267,6 +267,18 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint16 spellid } } break; + case COMMAND_MOVE_TO: + pet->StopMoving(); + pet->GetMotionMaster()->Clear(false); + pet->GetMotionMaster()->MovePoint(0, x, y, z); + charmInfo->SetCommandState(COMMAND_MOVE_TO); + + charmInfo->SetIsCommandAttack(false); + charmInfo->SetIsAtStay(true); + charmInfo->SetIsFollowing(false); + charmInfo->SetIsReturning(false); + charmInfo->SaveStayPosition(); + break; default: sLog->outError(LOG_FILTER_NETWORKIO, "WORLD: unknown PET flag Action %i and spellid %i.", uint32(flag), spellid); } diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 6490b38105c..e44514847d6 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -764,7 +764,7 @@ class WorldSession //Pet void HandlePetAction(WorldPacket& recvData); void HandlePetStopAttack(WorldPacket& recvData); - void HandlePetActionHelper(Unit* pet, uint64 guid1, uint16 spellid, uint16 flag, uint64 guid2); + void HandlePetActionHelper(Unit* pet, uint64 guid1, uint16 spellid, uint16 flag, uint64 guid2, float x, float y, float z); void HandlePetNameQuery(WorldPacket& recvData); void HandlePetSetAction(WorldPacket& recvData); void HandlePetAbandon(WorldPacket& recvData); -- cgit v1.2.3 From 2440a2875567905df48ce9073041a960e9ebd0bd Mon Sep 17 00:00:00 2001 From: Sovak Date: Sun, 9 Sep 2012 14:39:34 +0200 Subject: Core/Guilds: Implemented guild news & guild rewards tab Signed-off-by: Sovak Signed-off-by: Nay --- src/server/game/Achievements/AchievementMgr.cpp | 8 ++ src/server/game/DataStores/DBCStores.h | 3 +- src/server/game/Entities/Player/Player.cpp | 13 ++- src/server/game/Guilds/Guild.cpp | 129 ++++++++++++++++++++- src/server/game/Guilds/Guild.h | 59 ++++++++++ src/server/game/Guilds/GuildMgr.cpp | 59 +++++++++- src/server/game/Guilds/GuildMgr.h | 2 + src/server/game/Handlers/GuildHandler.cpp | 77 ++++++++++++ src/server/game/Server/Protocol/Opcodes.cpp | 10 +- src/server/game/Server/WorldSession.h | 3 + src/server/game/Spells/SpellEffects.cpp | 6 + .../Database/Implementation/CharacterDatabase.cpp | 2 + .../Database/Implementation/CharacterDatabase.h | 2 + 13 files changed, 363 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index a0400dad77a..a664a6dca06 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -1854,6 +1854,10 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement if (achievement->flags & ACHIEVEMENT_FLAG_COUNTER || HasAchieved(achievement->ID)) return; + if (achievement->flags & ACHIEVEMENT_FLAG_SHOW_IN_GUILD_NEWS) + if (Guild* guild = sGuildMgr->GetGuildById(referencePlayer->GetGuildId())) + guild->GetNewsLog().AddNewEvent(GUILD_NEWS_PLAYER_ACHIEVEMENT, time(NULL), referencePlayer->GetGUID(), achievement->flags & ACHIEVEMENT_FLAG_SHOW_IN_GUILD_HEADER, achievement->ID); + if (!GetOwner()->GetSession()->PlayerLoading()) SendAchievementEarned(achievement); @@ -1929,6 +1933,10 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achieve if (achievement->flags & ACHIEVEMENT_FLAG_COUNTER || HasAchieved(achievement->ID)) return; + if (achievement->flags & ACHIEVEMENT_FLAG_SHOW_IN_GUILD_NEWS) + if (Guild* guild = sGuildMgr->GetGuildById(referencePlayer->GetGuildId())) + guild->GetNewsLog().AddNewEvent(GUILD_NEWS_GUILD_ACHIEVEMENT, time(NULL), 0, achievement->flags & ACHIEVEMENT_FLAG_SHOW_IN_GUILD_HEADER, achievement->ID); + SendAchievementEarned(achievement); CompletedAchievementData& ca = m_completedAchievements[achievement->ID]; ca.date = time(NULL); diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h index 98ae2aa5ff6..9e8dc76d832 100755 --- a/src/server/game/DataStores/DBCStores.h +++ b/src/server/game/DataStores/DBCStores.h @@ -51,7 +51,8 @@ enum ContentLevels CONTENT_1_60 = 0, CONTENT_61_70 = 1, CONTENT_71_80 = 2, - CONTENT_81_85 = 3 + CONTENT_81_85 = 3, + MAX_CONTENT }; ContentLevels GetContentLevelsForMapAndZone(uint32 mapid, uint32 zoneId); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index ed3f7a144b3..9b80750437c 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -21496,7 +21496,13 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32 return false; } - return crItem->maxcount != 0; + bool bought = crItem->maxcount != 0; + + if (bought) + if ((pProto->Quality == ITEM_QUALITY_EPIC && pProto->ItemLevel >= MinNewsItemLevel[sWorld->getIntConfig(CONFIG_EXPANSION)]) || pProto->Quality > ITEM_QUALITY_EPIC) + if (Guild* guild = sGuildMgr->GetGuildById(GetGuildId())) + guild->GetNewsLog().AddNewEvent(GUILD_NEWS_ITEM_PURCHASED, time(NULL), GetGUID(), 0, item); + return bought; } uint32 Player::GetMaxPersonalArenaRatingRequirement(uint32 minarenaslot) const @@ -24230,6 +24236,11 @@ void Player::StoreLootItem(uint8 lootSlot, Loot* loot) --loot->unlootedCount; + if (const ItemTemplate* proto = sObjectMgr->GetItemTemplate(item->itemid)) + if ((proto->Quality == ITEM_QUALITY_EPIC && proto->ItemLevel >= MinNewsItemLevel[sWorld->getIntConfig(CONFIG_EXPANSION)]) || proto->Quality > ITEM_QUALITY_EPIC) + if (Guild* guild = sGuildMgr->GetGuildById(GetGuildId())) + guild->GetNewsLog().AddNewEvent(GUILD_NEWS_ITEM_LOOTED, time(NULL), GetGUID(), 0, item->itemid); + SendNewItem(newitem, uint32(item->count), false, false, true); UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM, item->itemid, item->count); UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE, loot->loot_type, item->count); diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 322e953be4a..09188843d52 100644 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -1061,7 +1061,7 @@ InventoryResult Guild::BankMoveItemData::CanStore(Item* pItem, bool swap) /////////////////////////////////////////////////////////////////////////////// // Guild Guild::Guild() : m_id(0), m_leaderGuid(0), m_createdDate(0), m_accountsNumber(0), m_bankMoney(0), m_eventLog(NULL), - m_achievementMgr(this), _level(1), _experience(0), _todayExperience(0) + m_achievementMgr(this), _level(1), _experience(0), _todayExperience(0), _newsLog(this) { memset(&m_bankEventLog, 0, (GUILD_BANK_MAX_TABS + 1) * sizeof(LogHolder*)); } @@ -3234,6 +3234,7 @@ void Guild::GiveXP(uint32 xp, Player* source) } } + GetNewsLog().AddNewEvent(GUILD_NEWS_LEVEL_UP, time(NULL), 0, 0, _level); GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_GUILD_LEVEL, GetLevel(), 0, NULL, source); } @@ -3258,3 +3259,129 @@ void Guild::ResetDailyExperience() if (Player* player = itr->second->FindPlayer()) SendGuildXP(player->GetSession()); } + +void Guild::GuildNewsLog::AddNewEvent(GuildNews eventType, time_t date, uint64 playerGuid, uint32 flags, uint32 data) +{ + uint32 id = _newsLog.size(); + GuildNewsEntry& log = _newsLog[id]; + log.EventType = eventType; + log.PlayerGuid = playerGuid; + log.Data = data; + log.Flags = flags; + log.Date = date; + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SAVE_GUILD_NEWS); + stmt->setUInt32(0, GetGuild()->GetId()); + stmt->setUInt32(1, id); + stmt->setUInt32(2, log.EventType); + stmt->setUInt64(3, log.PlayerGuid); + stmt->setUInt32(4, log.Data); + stmt->setUInt32(5, log.Flags); + stmt->setUInt32(6, uint32(log.Date)); + CharacterDatabase.Execute(stmt); + + WorldPacket pData; + BuildNewsData(id, log, pData); + GetGuild()->BroadcastPacket(&pData); +} + +void Guild::GuildNewsLog::LoadFromDB(PreparedQueryResult result) +{ + if (!result) + return; + do + { + Field* fields = result->Fetch(); + uint32 id = fields[0].GetInt32(); + GuildNewsEntry& log = _newsLog[id]; + log.EventType = GuildNews(fields[1].GetInt32()); + log.PlayerGuid = fields[2].GetInt64(); + log.Data = fields[3].GetInt32(); + log.Flags = fields[4].GetInt32(); + log.Date = time_t(fields[5].GetInt32()); + } + while (result->NextRow()); +} + +void Guild::GuildNewsLog::BuildNewsData(uint32 id, GuildNewsEntry& guildNew, WorldPacket& data) +{ + data.Initialize(SMSG_GUILD_NEWS_UPDATE); + data.WriteBits(1, 21); + + data.WriteBits(0, 26); // Other Guids NYI + ObjectGuid guid = guildNew.PlayerGuid; + + data.WriteBit(guid[7]); + data.WriteBit(guid[0]); + data.WriteBit(guid[6]); + data.WriteBit(guid[5]); + data.WriteBit(guid[4]); + data.WriteBit(guid[3]); + data.WriteBit(guid[1]); + data.WriteBit(guid[2]); + + data.FlushBits(); + + data.WriteByteSeq(guid[5]); + + data << uint32(guildNew.Flags); // 1 sticky + data << uint32(guildNew.Data); + data << uint32(0); + + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[6]); + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[1]); + + data << uint32(id); + data << uint32(guildNew.EventType); + data << uint32(secsToTimeBitFields(guildNew.Date)); +} + +void Guild::GuildNewsLog::BuildNewsData(WorldPacket& data) +{ + data.Initialize(SMSG_GUILD_NEWS_UPDATE); + data.WriteBits(_newsLog.size(), 21); + + for (GuildNewsLogMap::const_iterator it = _newsLog.begin(); it != _newsLog.end(); it++) + { + data.WriteBits(0, 26); // Not yet implemented used for guild achievements + ObjectGuid guid = it->second.PlayerGuid; + + data.WriteBit(guid[7]); + data.WriteBit(guid[0]); + data.WriteBit(guid[6]); + data.WriteBit(guid[5]); + data.WriteBit(guid[4]); + data.WriteBit(guid[3]); + data.WriteBit(guid[1]); + data.WriteBit(guid[2]); + } + + data.FlushBits(); + + for (GuildNewsLogMap::const_iterator it = _newsLog.begin(); it != _newsLog.end(); it++) + { + ObjectGuid guid = it->second.PlayerGuid; + data.WriteByteSeq(guid[5]); + + data << uint32(it->second.Flags); // 1 sticky + data << uint32(it->second.Data); + data << uint32(0); + + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[6]); + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[1]); + + data << uint32(it->first); + data << uint32(it->second.EventType); + data << uint32(secsToTimeBitFields(it->second.Date)); + } +} diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h index b7613957a45..d846e814357 100755 --- a/src/server/game/Guilds/Guild.h +++ b/src/server/game/Guilds/Guild.h @@ -24,6 +24,7 @@ #include "WorldPacket.h" #include "ObjectMgr.h" #include "Player.h" +#include "DBCStore.h" class Item; @@ -225,6 +226,38 @@ enum GuildMemberFlags GUILDMEMBER_STATUS_MOBILE = 0x0008, // remote chat from mobile app }; +enum GuildNews +{ + GUILD_NEWS_GUILD_ACHIEVEMENT = 0, + GUILD_NEWS_PLAYER_ACHIEVEMENT = 1, + GUILD_NEWS_DUNGEON_ENCOUNTER = 2, // Todo Implement + GUILD_NEWS_ITEM_LOOTED = 3, + GUILD_NEWS_ITEM_CRAFTED = 4, + GUILD_NEWS_ITEM_PURCHASED = 5, + GUILD_NEWS_LEVEL_UP = 6, +}; + +struct GuildNewsEntry +{ + GuildNews EventType; + time_t Date; + uint64 PlayerGuid; + uint32 Flags; + uint32 Data; +}; + +struct GuildReward +{ + uint32 Entry; + uint8 Standing; + int32 Racemask; + uint64 Price; + uint32 AchievementId; +}; + +uint32 const MinNewsItemLevel[MAX_CONTENT] = { 61, 90, 200, 353 }; + +typedef std::map GuildNewsLogMap; #define GUILD_EXPERIENCE_UNCAPPED_LEVEL 20 ///> Hardcoded in client, starting from this level, guild daily experience gain is unlimited. //////////////////////////////////////////////////////////////////////////////////////////// @@ -347,6 +380,30 @@ private: RemainingValue m_bankRemaining[GUILD_BANK_MAX_TABS + 1]; }; + // News Log class + class GuildNewsLog + { + public: + GuildNewsLog(Guild* guild) : _guild(guild) { } + + void LoadFromDB(PreparedQueryResult result); + void BuildNewsData(WorldPacket& data); + void BuildNewsData(uint32 id, GuildNewsEntry& guildNew, WorldPacket& data); + void AddNewEvent(GuildNews eventType, time_t date, uint64 playerGuid, uint32 flags, uint32 data); + GuildNewsEntry* GetNewById(uint32 id) + { + GuildNewsLogMap::iterator itr = _newsLog.find(id); + if (itr != _newsLog.end()) + return &itr->second; + return NULL; + } + Guild* GetGuild() const {return _guild; } + + private: + Guild* _guild; + GuildNewsLogMap _newsLog; + }; + // Base class for event entries class LogEntry { @@ -727,6 +784,7 @@ public: uint64 GetExperience() const { return _experience; } uint64 GetTodayExperience() const { return _todayExperience; } void ResetDailyExperience(); + GuildNewsLog& GetNewsLog() { return _newsLog; } protected: uint32 m_id; @@ -749,6 +807,7 @@ protected: LogHolder* m_bankEventLog[GUILD_BANK_MAX_TABS + 1]; AchievementMgr m_achievementMgr; + GuildNewsLog _newsLog; uint32 _level; uint64 _experience; diff --git a/src/server/game/Guilds/GuildMgr.cpp b/src/server/game/Guilds/GuildMgr.cpp index 726add2cf44..c611732ab48 100644 --- a/src/server/game/Guilds/GuildMgr.cpp +++ b/src/server/game/Guilds/GuildMgr.cpp @@ -433,8 +433,18 @@ void GuildMgr::LoadGuilds() itr->second->GetAchievementMgr().LoadFromDB(achievementResult, criteriaResult); } } + // 10. Loading Guild news + sLog->outInfo(LOG_FILTER_GENERAL, "Loading Guild News"); + { + for (GuildContainer::const_iterator itr = GuildStore.begin(); itr != GuildStore.end(); itr++) + { + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_GUILD_NEWS); + stmt->setInt32(0, itr->first); + itr->second->GetNewsLog().LoadFromDB(CharacterDatabase.Query(stmt)); + } + } - // 10. Validate loaded guild data + // 11. Validate loaded guild data sLog->outInfo(LOG_FILTER_GENERAL, "Validating data of loaded guilds..."); { uint32 oldMSTime = getMSTime(); @@ -507,5 +517,50 @@ void GuildMgr::LoadGuildXpForLevel() void GuildMgr::LoadGuildRewards() { - /// @TODO: Implement + uint32 oldMSTime = getMSTime(); + + // 0 1 2 3 4 + QueryResult result = WorldDatabase.Query("SELECT entry, standing, racemask, price, achievement FROM guild_rewards"); + + if (!result) + { + sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 guild reward definitions. DB table `guild_rewards` is empty."); + return; + } + + uint32 count = 0; + + do + { + GuildReward reward; + Field* fields = result->Fetch(); + reward.Entry = fields[0].GetUInt32(); + reward.Standing = fields[1].GetUInt8(); + reward.Racemask = fields[2].GetInt32(); + reward.Price = fields[3].GetUInt64(); + reward.AchievementId = fields[4].GetUInt32(); + + if (!sObjectMgr->GetItemTemplate(reward.Entry)) + { + sLog->outError(LOG_FILTER_SERVER_LOADING, "Guild rewards constains not existing item entry %u", reward.Entry); + continue; + } + + if (reward.AchievementId != 0 && (!sAchievementStore.LookupEntry(reward.AchievementId))) + { + sLog->outError(LOG_FILTER_SERVER_LOADING, "Guild rewards constains not existing achievement entry %u", reward.AchievementId); + continue; + } + + if (reward.Standing >= MAX_REPUTATION_RANK) + { + sLog->outError(LOG_FILTER_SERVER_LOADING, "Guild rewards contains wrong reputation standing %u, max is %u", uint32(reward.Standing), MAX_REPUTATION_RANK - 1); + continue; + } + + GuildRewards.push_back(reward); + ++count; + } while (result->NextRow()); + + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u guild reward definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } diff --git a/src/server/game/Guilds/GuildMgr.h b/src/server/game/Guilds/GuildMgr.h index a2bf6d268b5..24c1a4c0d5d 100644 --- a/src/server/game/Guilds/GuildMgr.h +++ b/src/server/game/Guilds/GuildMgr.h @@ -52,11 +52,13 @@ public: void SetNextGuildId(uint32 Id) { NextGuildId = Id; } uint32 GetXPForGuildLevel(uint8 level) const; + std::vector const& GetGuildRewards() const { return GuildRewards; } protected: uint32 NextGuildId; GuildContainer GuildStore; std::vector GuildXPperLevel; + std::vector GuildRewards; }; #define sGuildMgr ACE_Singleton::instance() diff --git a/src/server/game/Handlers/GuildHandler.cpp b/src/server/game/Handlers/GuildHandler.cpp index d45c79d1b84..f5f69b18b62 100755 --- a/src/server/game/Handlers/GuildHandler.cpp +++ b/src/server/game/Handlers/GuildHandler.cpp @@ -782,3 +782,80 @@ void WorldSession::HandleAutoDeclineGuildInvites(WorldPacket& recvPakcet) GetPlayer()->ApplyModFlag(PLAYER_FLAGS, PLAYER_FLAGS_AUTO_DECLINE_GUILD, enable); } + +void WorldSession::HandleGuildRewardsQueryOpcode(WorldPacket& recvPacket) +{ + recvPacket.read_skip(); // Unk + + if (Guild* guild = sGuildMgr->GetGuildById(_player->GetGuildId())) + { + std::vector const& rewards = sGuildMgr->GetGuildRewards(); + + WorldPacket data(SMSG_GUILD_REWARDS_LIST, (3 + rewards.size() * (4 + 4 + 4 +8 + 4 +4))); + data.WriteBits(rewards.size(), 21); + data.FlushBits(); + + for (uint32 i = 0; i < rewards.size(); i++) + { + data << uint32(rewards[i].Standing); + data << int32(rewards[i].Racemask); + data << uint32(rewards[i].Entry); + data << uint64(rewards[i].Price); + data << uint32(0); // Unused + data << uint32(rewards[i].AchievementId); + } + data << uint32(time(NULL)); + SendPacket(&data); + } +} + +void WorldSession::HandleGuildQueryNewsOpcode(WorldPacket& recvPacket) +{ + recvPacket.read_skip(); + + if (Guild* guild = sGuildMgr->GetGuildById(_player->GetGuildId())) + { + WorldPacket data; + guild->GetNewsLog().BuildNewsData(data); + SendPacket(&data); + } +} + +void WorldSession::HandleGuildNewsUpdateStickyOpcode(WorldPacket& recvPacket) +{ + uint32 newId; + bool unk; + ObjectGuid guid; + + recvPacket >> newId; + + unk = recvPacket.ReadBit(); + guid[2] = recvPacket.ReadBit(); + guid[4] = recvPacket.ReadBit(); + guid[3] = recvPacket.ReadBit(); + guid[0] = recvPacket.ReadBit(); + guid[6] = recvPacket.ReadBit(); + guid[7] = recvPacket.ReadBit(); + guid[1] = recvPacket.ReadBit(); + guid[5] = recvPacket.ReadBit(); + + recvPacket.ReadByteSeq(guid[6]); + recvPacket.ReadByteSeq(guid[2]); + recvPacket.ReadByteSeq(guid[1]); + recvPacket.ReadByteSeq(guid[0]); + recvPacket.ReadByteSeq(guid[5]); + recvPacket.ReadByteSeq(guid[3]); + recvPacket.ReadByteSeq(guid[7]); + recvPacket.ReadByteSeq(guid[4]); + + if (Guild* guild = sGuildMgr->GetGuildById(_player->GetGuildId())) + { + if (GuildNewsEntry* guildNew = guild->GetNewsLog().GetNewById(newId)) + { + guildNew->Flags ^= 1; + WorldPacket data; + guild->GetNewsLog().BuildNewsData(newId, *guildNew, data); + SendPacket(&data); + } + } +} diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 8399c69782d..3ed5c0fe7f8 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -268,11 +268,11 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_GUILD_LEAVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildLeaveOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_MEMBER_SEND_SOR_REQUEST, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_MOTD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildMOTDOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_NEWS_UPDATE_STICKY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_NEWS_UPDATE_STICKY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleGuildNewsUpdateStickyOpcode); DEFINE_OPCODE_HANDLER(CMSG_GUILD_PERMISSIONS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildPermissions ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_PROMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildPromoteOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_QUERY, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildQueryOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_QUERY_NEWS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_QUERY_NEWS, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleGuildQueryNewsOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_QUERY_RANKS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildQueryRanksOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_REMOVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildRemoveOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_REPLACE_GUILD_MASTER, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -419,7 +419,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_MEMBERS_FOR_RECIPE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_MEMBER_RECIPES, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_RECIPES, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_REWARDS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_REWARDS, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleGuildRewardsQueryOpcode ); DEFINE_OPCODE_HANDLER(CMSG_QUERY_GUILD_XP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildQueryXPOpcode ); // STATUS_AUTHED DEFINE_OPCODE_HANDLER(CMSG_QUERY_INSPECT_ACHIEVEMENTS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryInspectAchievements ); DEFINE_OPCODE_HANDLER(CMSG_QUERY_QUESTS_COMPLETED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryQuestsCompleted ); @@ -874,7 +874,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_GUILD_MOVE_COMPLETE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_MOVE_STARTING, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_NEWS_DELETED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GUILD_NEWS_UPDATE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_NEWS_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_PARTY_STATE_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_PERMISSIONS_QUERY_RESULTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_QUERY_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -885,7 +885,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_GUILD_REPUTATION_REACTION_CHANGED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_REPUTATION_WEEKLY_CAP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_RESET, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_GUILD_REWARDS_LIST, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_GUILD_REWARDS_LIST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_ROSTER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_UPDATE_ROSTER, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_GUILD_XP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index e44514847d6..543f04e305b 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -576,6 +576,7 @@ class WorldSession void HandleGuildDeclineOpcode(WorldPacket& recvPacket); void HandleGuildEventLogQueryOpcode(WorldPacket& recvPacket); void HandleGuildRosterOpcode(WorldPacket& recvPacket); + void HandleGuildRewardsQueryOpcode(WorldPacket& recvPacket); void HandleGuildPromoteOpcode(WorldPacket& recvPacket); void HandleGuildDemoteOpcode(WorldPacket& recvPacket); void HandleGuildAssignRankOpcode(WorldPacket& recvPacket); @@ -583,8 +584,10 @@ class WorldSession void HandleGuildDisbandOpcode(WorldPacket& recvPacket); void HandleGuildLeaderOpcode(WorldPacket& recvPacket); void HandleGuildMOTDOpcode(WorldPacket& recvPacket); + void HandleGuildNewsUpdateStickyOpcode(WorldPacket& recvPacket); void HandleGuildSetNoteOpcode(WorldPacket& recvPacket); void HandleGuildQueryRanksOpcode(WorldPacket& recvPacket); + void HandleGuildQueryNewsOpcode(WorldPacket& recvPacket); void HandleGuildSetRankPermissionsOpcode(WorldPacket& recvPacket); void HandleGuildAddRankOpcode(WorldPacket& recvPacket); void HandleGuildDelRankOpcode(WorldPacket& recvPacket); diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 7e32ce9137e..095cceab7bf 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -63,6 +63,8 @@ #include "GameObjectAI.h" #include "AccountMgr.h" #include "InstanceScript.h" +#include "Guild.h" +#include "GuildMgr.h" pEffect SpellEffects[TOTAL_SPELL_EFFECTS]= { @@ -1567,6 +1569,10 @@ void Spell::DoCreateItem(uint32 /*i*/, uint32 itemtype) // create the new item and store it Item* pItem = player->StoreNewItem(dest, newitemid, true, Item::GenerateItemRandomPropertyId(newitemid)); + if ((pProto->Quality == ITEM_QUALITY_EPIC && pProto->ItemLevel >= MinNewsItemLevel[sWorld->getIntConfig(CONFIG_EXPANSION)]) || pProto->Quality > ITEM_QUALITY_EPIC) + if (Guild* guild = sGuildMgr->GetGuildById(player->GetGuildId())) + guild->GetNewsLog().AddNewEvent(GUILD_NEWS_ITEM_CRAFTED, time(NULL), player->GetGUID(), 0, pProto->ItemId); + // was it successful? return error if not if (!pItem) { diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index bb958be8ca7..1b17c35284b 100755 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -241,6 +241,8 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_SEL_GUILD_ACHIEVEMENT_CRITERIA, "SELECT criteria, counter, date, completedGuid FROM guild_achievement_progress WHERE guildId = ?", CONNECTION_SYNCH) PREPARE_STATEMENT(CHAR_UPD_GUILD_EXPERIENCE, "UPDATE guild SET level = ?, experience = ?, todayExperience = ? WHERE guildId = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_UPD_GUILD_RESET_TODAY_EXPERIENCE, "UPDATE guild SET todayExperience = 0", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_LOAD_GUILD_NEWS, "SELECT id, eventType, playerGuid, data, flags, date FROM guild_news_log WHERE guild = ? ORDER BY guild ASC, id ASC", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SAVE_GUILD_NEWS, "INSERT INTO guild_news_log values (?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); // Chat channel handling PREPARE_STATEMENT(CHAR_SEL_CHANNEL, "SELECT announce, ownership, password, bannedList FROM channels WHERE name = ? AND team = ?", CONNECTION_SYNCH) diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.h b/src/server/shared/Database/Implementation/CharacterDatabase.h index 9c06c547b39..20454798f98 100755 --- a/src/server/shared/Database/Implementation/CharacterDatabase.h +++ b/src/server/shared/Database/Implementation/CharacterDatabase.h @@ -236,6 +236,8 @@ enum CharacterDatabaseStatements CHAR_SEL_GUILD_ACHIEVEMENT_CRITERIA, CHAR_UPD_GUILD_EXPERIENCE, CHAR_UPD_GUILD_RESET_TODAY_EXPERIENCE, + CHAR_LOAD_GUILD_NEWS, + CHAR_SAVE_GUILD_NEWS, CHAR_SEL_CHANNEL, CHAR_INS_CHANNEL, -- cgit v1.2.3 From 9f841da63d44206386f5190689c4f5ee035df41a Mon Sep 17 00:00:00 2001 From: Sovak Date: Sun, 9 Sep 2012 14:44:37 +0200 Subject: Little codestyle change Signed-off-by: Sovak Signed-off-by: Nay --- src/server/game/Guilds/Guild.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h index d846e814357..c9799fbe5ca 100755 --- a/src/server/game/Guilds/Guild.h +++ b/src/server/game/Guilds/Guild.h @@ -394,10 +394,10 @@ private: { GuildNewsLogMap::iterator itr = _newsLog.find(id); if (itr != _newsLog.end()) - return &itr->second; + return &itr->second; return NULL; } - Guild* GetGuild() const {return _guild; } + Guild* GetGuild() const { return _guild; } private: Guild* _guild; -- cgit v1.2.3 From f508f7dbc52f3e41861ef408a440224307a65f61 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 9 Sep 2012 15:57:40 +0300 Subject: Core/Guilds: Corrected CMSG_GUILD_NEWS_UPDATE_STICKY structure Signed-off-by: Nay --- src/server/game/Handlers/GuildHandler.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/GuildHandler.cpp b/src/server/game/Handlers/GuildHandler.cpp index f5f69b18b62..bbd21176511 100755 --- a/src/server/game/Handlers/GuildHandler.cpp +++ b/src/server/game/Handlers/GuildHandler.cpp @@ -824,16 +824,16 @@ void WorldSession::HandleGuildQueryNewsOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildNewsUpdateStickyOpcode(WorldPacket& recvPacket) { uint32 newId; - bool unk; + bool sticky; ObjectGuid guid; - recvPacket >> newId; + recvPacket >> id; - unk = recvPacket.ReadBit(); guid[2] = recvPacket.ReadBit(); guid[4] = recvPacket.ReadBit(); guid[3] = recvPacket.ReadBit(); guid[0] = recvPacket.ReadBit(); + sticky = recvPacket.ReadBit(); guid[6] = recvPacket.ReadBit(); guid[7] = recvPacket.ReadBit(); guid[1] = recvPacket.ReadBit(); @@ -850,11 +850,15 @@ void WorldSession::HandleGuildNewsUpdateStickyOpcode(WorldPacket& recvPacket) if (Guild* guild = sGuildMgr->GetGuildById(_player->GetGuildId())) { - if (GuildNewsEntry* guildNew = guild->GetNewsLog().GetNewById(newId)) + if (GuildNewsEntry* newsEntry = guild->GetNewsLog().GetNewById(id)) { - guildNew->Flags ^= 1; + if (sticky) + newsEntry->Flags |= 1; + else + newsEntry->Flags &= ~1; + WorldPacket data; - guild->GetNewsLog().BuildNewsData(newId, *guildNew, data); + guild->GetNewsLog().BuildNewsData(id, *newsEntry, data); SendPacket(&data); } } -- cgit v1.2.3 From 5226f53b8ae815f707538b66207727e2715af826 Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 10 Sep 2012 00:06:47 +0100 Subject: Core/Guilds: Corrections to guild news & rewards commit, fixed build and added missing sql Closes #7708 --- .../characters/2012_09_09_00_characters_guild_news.sql | 11 +++++++++++ src/server/game/Entities/Player/Player.cpp | 14 ++++++++------ src/server/game/Guilds/Guild.cpp | 17 +++++++++-------- src/server/game/Guilds/Guild.h | 7 ++++--- src/server/game/Guilds/GuildMgr.cpp | 7 ++++--- src/server/game/Handlers/ChatHandler.cpp | 2 +- src/server/game/Handlers/GuildHandler.cpp | 10 +++++----- src/server/game/Spells/SpellEffects.cpp | 2 +- src/server/scripts/Spells/spell_warrior.cpp | 4 ++-- .../Database/Implementation/CharacterDatabase.cpp | 2 +- 10 files changed, 46 insertions(+), 30 deletions(-) create mode 100644 sql/updates/characters/2012_09_09_00_characters_guild_news.sql (limited to 'src') diff --git a/sql/updates/characters/2012_09_09_00_characters_guild_news.sql b/sql/updates/characters/2012_09_09_00_characters_guild_news.sql new file mode 100644 index 00000000000..78fa817678b --- /dev/null +++ b/sql/updates/characters/2012_09_09_00_characters_guild_news.sql @@ -0,0 +1,11 @@ +DROP TABLE IF EXISTS `guild_news_log`; +CREATE TABLE `guild_news_log` ( + `guild` int(10) unsigned NOT NULL, + `id` int(10) unsigned NOT NULL, + `eventType` int(10) unsigned NOT NULL, + `playerGuid` bigint(20) unsigned NOT NULL, + `data` int(10) unsigned NOT NULL, + `flags` int(10) unsigned NOT NULL, + `date` int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`guild`,`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 9b80750437c..ee6d71e64b1 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -21496,13 +21496,15 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32 return false; } - bool bought = crItem->maxcount != 0; - - if (bought) - if ((pProto->Quality == ITEM_QUALITY_EPIC && pProto->ItemLevel >= MinNewsItemLevel[sWorld->getIntConfig(CONFIG_EXPANSION)]) || pProto->Quality > ITEM_QUALITY_EPIC) + if (crItem->maxcount != 0) // bought + { + if (pProto->Quality > ITEM_QUALITY_EPIC || (pProto->Quality == ITEM_QUALITY_EPIC && pProto->ItemLevel >= MinNewsItemLevel[sWorld->getIntConfig(CONFIG_EXPANSION)])) if (Guild* guild = sGuildMgr->GetGuildById(GetGuildId())) guild->GetNewsLog().AddNewEvent(GUILD_NEWS_ITEM_PURCHASED, time(NULL), GetGUID(), 0, item); - return bought; + return true; + } + + return false; } uint32 Player::GetMaxPersonalArenaRatingRequirement(uint32 minarenaslot) const @@ -24237,7 +24239,7 @@ void Player::StoreLootItem(uint8 lootSlot, Loot* loot) --loot->unlootedCount; if (const ItemTemplate* proto = sObjectMgr->GetItemTemplate(item->itemid)) - if ((proto->Quality == ITEM_QUALITY_EPIC && proto->ItemLevel >= MinNewsItemLevel[sWorld->getIntConfig(CONFIG_EXPANSION)]) || proto->Quality > ITEM_QUALITY_EPIC) + if (proto->Quality > ITEM_QUALITY_EPIC || (proto->Quality == ITEM_QUALITY_EPIC && proto->ItemLevel >= MinNewsItemLevel[sWorld->getIntConfig(CONFIG_EXPANSION)])) if (Guild* guild = sGuildMgr->GetGuildById(GetGuildId())) guild->GetNewsLog().AddNewEvent(GUILD_NEWS_ITEM_LOOTED, time(NULL), GetGUID(), 0, item->itemid); diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 09188843d52..e7121b0fa81 100644 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -3263,6 +3263,7 @@ void Guild::ResetDailyExperience() void Guild::GuildNewsLog::AddNewEvent(GuildNews eventType, time_t date, uint64 playerGuid, uint32 flags, uint32 data) { uint32 id = _newsLog.size(); + GuildNewsEntry& log = _newsLog[id]; log.EventType = eventType; log.PlayerGuid = playerGuid; @@ -3280,9 +3281,9 @@ void Guild::GuildNewsLog::AddNewEvent(GuildNews eventType, time_t date, uint64 p stmt->setUInt32(6, uint32(log.Date)); CharacterDatabase.Execute(stmt); - WorldPacket pData; - BuildNewsData(id, log, pData); - GetGuild()->BroadcastPacket(&pData); + WorldPacket packet; + BuildNewsData(id, log, packet); + GetGuild()->BroadcastPacket(&packet); } void Guild::GuildNewsLog::LoadFromDB(PreparedQueryResult result) @@ -3305,10 +3306,10 @@ void Guild::GuildNewsLog::LoadFromDB(PreparedQueryResult result) void Guild::GuildNewsLog::BuildNewsData(uint32 id, GuildNewsEntry& guildNew, WorldPacket& data) { - data.Initialize(SMSG_GUILD_NEWS_UPDATE); - data.WriteBits(1, 21); + data.Initialize(SMSG_GUILD_NEWS_UPDATE, 7 + 32); + data.WriteBits(1, 21); // size, we are only sending 1 news here - data.WriteBits(0, 26); // Other Guids NYI + data.WriteBits(0, 26); // Not yet implemented used for guild achievements ObjectGuid guid = guildNew.PlayerGuid; data.WriteBit(guid[7]); @@ -3326,7 +3327,7 @@ void Guild::GuildNewsLog::BuildNewsData(uint32 id, GuildNewsEntry& guildNew, Wor data << uint32(guildNew.Flags); // 1 sticky data << uint32(guildNew.Data); - data << uint32(0); + data << uint32(0); // always 0 data.WriteByteSeq(guid[7]); data.WriteByteSeq(guid[6]); @@ -3343,7 +3344,7 @@ void Guild::GuildNewsLog::BuildNewsData(uint32 id, GuildNewsEntry& guildNew, Wor void Guild::GuildNewsLog::BuildNewsData(WorldPacket& data) { - data.Initialize(SMSG_GUILD_NEWS_UPDATE); + data.Initialize(SMSG_GUILD_NEWS_UPDATE, (21 + _newsLog.size() * (26 + 8)) / 8 + (8 + 6 * 4) * _newsLog.size()); data.WriteBits(_newsLog.size(), 21); for (GuildNewsLogMap::const_iterator it = _newsLog.begin(); it != _newsLog.end(); it++) diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h index c9799fbe5ca..f3e18d8998b 100755 --- a/src/server/game/Guilds/Guild.h +++ b/src/server/game/Guilds/Guild.h @@ -230,7 +230,7 @@ enum GuildNews { GUILD_NEWS_GUILD_ACHIEVEMENT = 0, GUILD_NEWS_PLAYER_ACHIEVEMENT = 1, - GUILD_NEWS_DUNGEON_ENCOUNTER = 2, // Todo Implement + GUILD_NEWS_DUNGEON_ENCOUNTER = 2, // @todo Implement GUILD_NEWS_ITEM_LOOTED = 3, GUILD_NEWS_ITEM_CRAFTED = 4, GUILD_NEWS_ITEM_PURCHASED = 5, @@ -249,15 +249,16 @@ struct GuildNewsEntry struct GuildReward { uint32 Entry; - uint8 Standing; int32 Racemask; uint64 Price; uint32 AchievementId; + uint8 Standing; }; uint32 const MinNewsItemLevel[MAX_CONTENT] = { 61, 90, 200, 353 }; typedef std::map GuildNewsLogMap; + #define GUILD_EXPERIENCE_UNCAPPED_LEVEL 20 ///> Hardcoded in client, starting from this level, guild daily experience gain is unlimited. //////////////////////////////////////////////////////////////////////////////////////////// @@ -390,7 +391,7 @@ private: void BuildNewsData(WorldPacket& data); void BuildNewsData(uint32 id, GuildNewsEntry& guildNew, WorldPacket& data); void AddNewEvent(GuildNews eventType, time_t date, uint64 playerGuid, uint32 flags, uint32 data); - GuildNewsEntry* GetNewById(uint32 id) + GuildNewsEntry* GetNewsById(uint32 id) { GuildNewsLogMap::iterator itr = _newsLog.find(id); if (itr != _newsLog.end()) diff --git a/src/server/game/Guilds/GuildMgr.cpp b/src/server/game/Guilds/GuildMgr.cpp index c611732ab48..8eef6b2ade3 100644 --- a/src/server/game/Guilds/GuildMgr.cpp +++ b/src/server/game/Guilds/GuildMgr.cpp @@ -436,7 +436,7 @@ void GuildMgr::LoadGuilds() // 10. Loading Guild news sLog->outInfo(LOG_FILTER_GENERAL, "Loading Guild News"); { - for (GuildContainer::const_iterator itr = GuildStore.begin(); itr != GuildStore.end(); itr++) + for (GuildContainer::const_iterator itr = GuildStore.begin(); itr != GuildStore.end(); ++itr) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_GUILD_NEWS); stmt->setInt32(0, itr->first); @@ -474,7 +474,7 @@ void GuildMgr::LoadGuildXpForLevel() for (uint8 level = 0; level < sWorld->getIntConfig(CONFIG_GUILD_MAX_LEVEL); ++level) GuildXPperLevel[level] = 0; - // 0 1 + // 0 1 QueryResult result = WorldDatabase.Query("SELECT lvl, xp_for_next_level FROM guild_xp_for_level"); if (!result) @@ -500,6 +500,7 @@ void GuildMgr::LoadGuildXpForLevel() GuildXPperLevel[level] = requiredXP; ++count; + } while (result->NextRow()); // fill level gaps @@ -519,7 +520,7 @@ void GuildMgr::LoadGuildRewards() { uint32 oldMSTime = getMSTime(); - // 0 1 2 3 4 + // 0 1 2 3 4 QueryResult result = WorldDatabase.Query("SELECT entry, standing, racemask, price, achievement FROM guild_rewards"); if (!result) diff --git a/src/server/game/Handlers/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cpp index 66d8acb5d34..f21001ba7bf 100644 --- a/src/server/game/Handlers/ChatHandler.cpp +++ b/src/server/game/Handlers/ChatHandler.cpp @@ -767,7 +767,7 @@ void WorldSession::HandleChatIgnoredOpcode(WorldPacket& recvData) guid[0] = recvData.ReadBit(); guid[1] = recvData.ReadBit(); guid[3] = recvData.ReadBit(); - + recvData.ReadByteSeq(guid[0]); recvData.ReadByteSeq(guid[6]); recvData.ReadByteSeq(guid[5]); diff --git a/src/server/game/Handlers/GuildHandler.cpp b/src/server/game/Handlers/GuildHandler.cpp index bbd21176511..c0d96b53190 100755 --- a/src/server/game/Handlers/GuildHandler.cpp +++ b/src/server/game/Handlers/GuildHandler.cpp @@ -791,7 +791,7 @@ void WorldSession::HandleGuildRewardsQueryOpcode(WorldPacket& recvPacket) { std::vector const& rewards = sGuildMgr->GetGuildRewards(); - WorldPacket data(SMSG_GUILD_REWARDS_LIST, (3 + rewards.size() * (4 + 4 + 4 +8 + 4 +4))); + WorldPacket data(SMSG_GUILD_REWARDS_LIST, 3 + rewards.size() * (4 + 4 + 4 + 8 + 4 + 4)); data.WriteBits(rewards.size(), 21); data.FlushBits(); @@ -823,11 +823,11 @@ void WorldSession::HandleGuildQueryNewsOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildNewsUpdateStickyOpcode(WorldPacket& recvPacket) { - uint32 newId; + uint32 newsId; bool sticky; ObjectGuid guid; - recvPacket >> id; + recvPacket >> newsId; guid[2] = recvPacket.ReadBit(); guid[4] = recvPacket.ReadBit(); @@ -850,7 +850,7 @@ void WorldSession::HandleGuildNewsUpdateStickyOpcode(WorldPacket& recvPacket) if (Guild* guild = sGuildMgr->GetGuildById(_player->GetGuildId())) { - if (GuildNewsEntry* newsEntry = guild->GetNewsLog().GetNewById(id)) + if (GuildNewsEntry* newsEntry = guild->GetNewsLog().GetNewsById(newsId)) { if (sticky) newsEntry->Flags |= 1; @@ -858,7 +858,7 @@ void WorldSession::HandleGuildNewsUpdateStickyOpcode(WorldPacket& recvPacket) newsEntry->Flags &= ~1; WorldPacket data; - guild->GetNewsLog().BuildNewsData(id, *newsEntry, data); + guild->GetNewsLog().BuildNewsData(newsId, *newsEntry, data); SendPacket(&data); } } diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 095cceab7bf..767f17cd276 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -1569,7 +1569,7 @@ void Spell::DoCreateItem(uint32 /*i*/, uint32 itemtype) // create the new item and store it Item* pItem = player->StoreNewItem(dest, newitemid, true, Item::GenerateItemRandomPropertyId(newitemid)); - if ((pProto->Quality == ITEM_QUALITY_EPIC && pProto->ItemLevel >= MinNewsItemLevel[sWorld->getIntConfig(CONFIG_EXPANSION)]) || pProto->Quality > ITEM_QUALITY_EPIC) + if (pProto->Quality > ITEM_QUALITY_EPIC || (pProto->Quality == ITEM_QUALITY_EPIC && pProto->ItemLevel >= MinNewsItemLevel[sWorld->getIntConfig(CONFIG_EXPANSION)])) if (Guild* guild = sGuildMgr->GetGuildById(player->GetGuildId())) guild->GetNewsLog().AddNewEvent(GUILD_NEWS_ITEM_CRAFTED, time(NULL), player->GetGUID(), 0, pProto->ItemId); diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index 2918a05774d..7b0952dac7b 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -234,9 +234,9 @@ class spell_warr_execute : public SpellScriptLoader int32 ragesave = aurEff->GetSpellInfo()->Effects[EFFECT_0].CalcValue() * 10; newRage = std::max(newRage, ragesave); } - + caster->SetPower(POWER_RAGE, uint32(newRage)); - + /// Formula taken from the DBC: "${10+$AP*0.437*$m1/100}" int32 baseDamage = int32(10 + caster->GetTotalAttackPowerValue(BASE_ATTACK) * 0.437f * GetEffectValue() / 100.0f); /// Formula taken from the DBC: "${$ap*0.874*$m1/100-1} = 20 rage" diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index 1b17c35284b..3d848f94c00 100755 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -242,7 +242,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_UPD_GUILD_EXPERIENCE, "UPDATE guild SET level = ?, experience = ?, todayExperience = ? WHERE guildId = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_UPD_GUILD_RESET_TODAY_EXPERIENCE, "UPDATE guild SET todayExperience = 0", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_LOAD_GUILD_NEWS, "SELECT id, eventType, playerGuid, data, flags, date FROM guild_news_log WHERE guild = ? ORDER BY guild ASC, id ASC", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_SAVE_GUILD_NEWS, "INSERT INTO guild_news_log values (?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_SAVE_GUILD_NEWS, "INSERT INTO guild_news_log (guild, id, eventType, playerGuid, data, flags, date) VALUES (?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); // Chat channel handling PREPARE_STATEMENT(CHAR_SEL_CHANNEL, "SELECT announce, ownership, password, bannedList FROM channels WHERE name = ? AND team = ?", CONNECTION_SYNCH) -- cgit v1.2.3 From de0c9dac00b0a94a01ac9b41f82c0fd541b0bfd8 Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 10 Sep 2012 00:31:15 +0100 Subject: Core/Guild: pakcet -> packet --- src/server/game/Handlers/GuildHandler.cpp | 4 ++-- src/server/game/Server/WorldSession.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/GuildHandler.cpp b/src/server/game/Handlers/GuildHandler.cpp index c0d96b53190..e60cf015039 100755 --- a/src/server/game/Handlers/GuildHandler.cpp +++ b/src/server/game/Handlers/GuildHandler.cpp @@ -775,10 +775,10 @@ void WorldSession::HandleGuildRequestMaxDailyXP(WorldPacket& recvPacket) } } -void WorldSession::HandleAutoDeclineGuildInvites(WorldPacket& recvPakcet) +void WorldSession::HandleAutoDeclineGuildInvites(WorldPacket& recvPacket) { uint8 enable; - recvPakcet >> enable; + recvPacket >> enable; GetPlayer()->ApplyModFlag(PLAYER_FLAGS, PLAYER_FLAGS_AUTO_DECLINE_GUILD, enable); } diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 543f04e305b..a7ab19f393a 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -595,7 +595,7 @@ class WorldSession void HandleSaveGuildEmblemOpcode(WorldPacket& recvPacket); void HandleGuildRequestPartyState(WorldPacket& recvPacket); void HandleGuildRequestMaxDailyXP(WorldPacket& recvPacket); - void HandleAutoDeclineGuildInvites(WorldPacket& recvPakcet); + void HandleAutoDeclineGuildInvites(WorldPacket& recvPacket); void HandleTaxiNodeStatusQueryOpcode(WorldPacket& recvPacket); void HandleTaxiQueryAvailableNodes(WorldPacket& recvPacket); -- cgit v1.2.3 From 4f1bad9a5508d1477525f709831beda6546802bb Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Mon, 10 Sep 2012 11:20:53 +0200 Subject: Core: Fix build Closes #7717 --- src/server/game/Entities/Player/Player.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 7afe0a1be88..1b6d515d623 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -11397,8 +11397,7 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool { // Do not allow polearm to be equipped in the offhand (rare case for the only 1h polearm 41750) if (pProto->SubClass == ITEM_SUBCLASS_WEAPON_POLEARM) - return EQUIP_ERR_ITEM_DOESNT_GO_TO_SLOT; - + return EQUIP_ERR_2HSKILLNOTFOUND; else if (type == INVTYPE_WEAPON || type == INVTYPE_WEAPONOFFHAND) { if (!CanDualWield()) -- cgit v1.2.3 From 917ffc030ea2ffaf698d2bd2b1e7967081a27beb Mon Sep 17 00:00:00 2001 From: Warpten Date: Sun, 9 Sep 2012 11:32:14 +0200 Subject: Core/Guilds: Implemented GuildFinder. --- sql/base/characters_database.sql | 38 ++ .../2012_09_08_00_characters_guild_finder_434.sql | 40 ++ src/server/game/Entities/Object/ObjectDefines.h | 1 + src/server/game/Entities/Unit/Unit.cpp | 3 + src/server/game/Guilds/Guild.cpp | 5 + src/server/game/Guilds/Guild.h | 2 + src/server/game/Guilds/GuildFinderMgr.cpp | 305 ++++++++++++++ src/server/game/Guilds/GuildFinderMgr.h | 268 +++++++++++++ src/server/game/Handlers/CharacterHandler.cpp | 2 +- src/server/game/Handlers/GuildFinderHandler.cpp | 443 +++++++++++++++++++++ src/server/game/Server/Protocol/Opcodes.cpp | 32 +- src/server/game/Server/Protocol/Opcodes.h | 2 - src/server/game/Server/WorldSession.h | 11 +- src/server/game/Tools/PlayerDump.cpp | 4 +- src/server/game/World/World.cpp | 19 +- src/server/game/World/World.h | 6 +- src/server/scripts/Commands/cs_character.cpp | 2 +- .../Database/Implementation/CharacterDatabase.cpp | 8 +- .../Database/Implementation/CharacterDatabase.h | 5 + 19 files changed, 1168 insertions(+), 28 deletions(-) create mode 100644 sql/updates/characters/2012_09_08_00_characters_guild_finder_434.sql create mode 100644 src/server/game/Guilds/GuildFinderMgr.cpp create mode 100644 src/server/game/Guilds/GuildFinderMgr.h create mode 100644 src/server/game/Handlers/GuildFinderHandler.cpp mode change 100755 => 100644 src/server/shared/Database/Implementation/CharacterDatabase.cpp (limited to 'src') diff --git a/sql/base/characters_database.sql b/sql/base/characters_database.sql index fe2a859d5e6..115047173ae 100644 --- a/sql/base/characters_database.sql +++ b/sql/base/characters_database.sql @@ -1851,6 +1851,44 @@ LOCK TABLES `guild_eventlog` WRITE; /*!40000 ALTER TABLE `guild_eventlog` ENABLE KEYS */; UNLOCK TABLES; +--- +--- Table structure for table `guild_finder_applicant` +--- + +DROP TABLE IF EXISTS `guild_finder_applicant`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `guild_finder_applicant` ( + `guildId` int(10) unsigned DEFAULT NULL, + `playerGuid` int(10) unsigned DEFAULT NULL, + `availability` tinyint(3) unsigned DEFAULT '0', + `classRole` tinyint(3) unsigned DEFAULT '0', + `interests` tinyint(3) unsigned DEFAULT '0', + `comment` varchar(255) DEFAULT NULL, + `submitTime` int(10) unsigned DEFAULT NULL, + UNIQUE KEY `guildId` (`guildId`,`playerGuid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT="Guild finder membership requests"; +/*!40101 SET character_set_client = @saved_cs_client */; + +--- +--- Table structure for table `guild_finder_guild_settings` +--- + +DROP TABLE IF EXISTS `guild_finder_guild_settings`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `guild_finder_guild_settings` ( + `guildId` int(10) unsigned NOT NULL, + `availability` tinyint(3) unsigned NOT NULL DEFAULT '0', + `classRoles` tinyint(3) unsigned NOT NULL DEFAULT '0', + `interests` tinyint(3) unsigned NOT NULL DEFAULT '0', + `level` tinyint(3) unsigned NOT NULL DEFAULT '1', + `listed` tinyint(3) unsigned NOT NULL DEFAULT '0', + `comment` varchar(255) DEFAULT NULL, + PRIMARY KEY (`guildId`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT="Guild finder guild-releated settings storage"; +/*!40101 SET character_set_client = @saved_cs_client */; + -- -- Table structure for table `guild_member` -- diff --git a/sql/updates/characters/2012_09_08_00_characters_guild_finder_434.sql b/sql/updates/characters/2012_09_08_00_characters_guild_finder_434.sql new file mode 100644 index 00000000000..d4d524e0bef --- /dev/null +++ b/sql/updates/characters/2012_09_08_00_characters_guild_finder_434.sql @@ -0,0 +1,40 @@ +/*!40101 SET NAMES utf8 */; + +/*!40101 SET SQL_MODE=''*/; + +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +/* Table structure for table `guild_finder_applicant` */ + +DROP TABLE IF EXISTS `guild_finder_applicant`; + +CREATE TABLE `guild_finder_applicant` ( + `guildId` int(10) unsigned DEFAULT NULL, + `playerGuid` int(10) unsigned DEFAULT NULL, + `availability` tinyint(3) unsigned DEFAULT '0', + `classRole` tinyint(3) unsigned DEFAULT '0', + `interests` tinyint(3) unsigned DEFAULT '0', + `comment` varchar(255) DEFAULT NULL, + `submitTime` int(10) unsigned DEFAULT NULL, + UNIQUE KEY `guildId` (`guildId`,`playerGuid`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +/* Table structure for table `guild_finder_guild_settings` */ + +DROP TABLE IF EXISTS `guild_finder_guild_settings`; + +CREATE TABLE `guild_finder_guild_settings` ( + `guildId` int(10) unsigned NOT NULL, + `availability` tinyint(3) unsigned NOT NULL DEFAULT '0', + `classRoles` tinyint(3) unsigned NOT NULL DEFAULT '0', + `interests` tinyint(3) unsigned NOT NULL DEFAULT '0', + `level` tinyint(3) unsigned NOT NULL DEFAULT '1', + `listed` tinyint(3) unsigned NOT NULL DEFAULT '0', + `comment` varchar(255) DEFAULT NULL, + PRIMARY KEY (`guildId`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; diff --git a/src/server/game/Entities/Object/ObjectDefines.h b/src/server/game/Entities/Object/ObjectDefines.h index b971943954e..46baee4a284 100755 --- a/src/server/game/Entities/Object/ObjectDefines.h +++ b/src/server/game/Entities/Object/ObjectDefines.h @@ -57,6 +57,7 @@ enum HighGuid #define IS_CRE_OR_VEH_GUID(Guid) (IS_CREATURE_GUID(Guid) || IS_VEHICLE_GUID(Guid)) #define IS_CRE_OR_VEH_OR_PET_GUID(Guid)(IS_CRE_OR_VEH_GUID(Guid) || IS_PET_GUID(Guid)) #define IS_PLAYER_GUID(Guid) (GUID_HIPART(Guid) == HIGHGUID_PLAYER && Guid != 0) +#define IS_GUILD_GUID(Guid) (GUID_HIPART(Guid) == HIGHGUID_GUILD && Guid != 0) #define IS_UNIT_GUID(Guid) (IS_CRE_OR_VEH_OR_PET_GUID(Guid) || IS_PLAYER_GUID(Guid)) // special case for empty guid need check #define IS_ITEM_GUID(Guid) (GUID_HIPART(Guid) == HIGHGUID_ITEM) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 7d1734ee204..7886c0354f5 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -12780,6 +12780,9 @@ void Unit::SetLevel(uint8 lvl) // group update if (GetTypeId() == TYPEID_PLAYER && ToPlayer()->GetGroup()) ToPlayer()->SetGroupUpdateFlag(GROUP_UPDATE_FLAG_LEVEL); + + if (GetTypeId() == TYPEID_PLAYER) + sWorld->UpdateCharacterNameDataLevel(ToPlayer()->GetGUIDLow(), lvl); } void Unit::SetHealth(uint32 val) diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index e7121b0fa81..92191551858 100644 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -19,6 +19,7 @@ #include "DatabaseEnv.h" #include "Guild.h" #include "GuildMgr.h" +#include "GuildFinderMgr.h" #include "ScriptMgr.h" #include "Chat.h" #include "Config.h" @@ -1190,6 +1191,9 @@ void Guild::Disband() trans->Append(stmt); CharacterDatabase.CommitTransaction(trans); + + sGuildFinderMgr->DeleteGuild(m_id); + sGuildMgr->RemoveGuild(m_id); } @@ -1665,6 +1669,7 @@ void Guild::HandleAcceptMember(WorldSession* session) { _LogEvent(GUILD_EVENT_LOG_JOIN_GUILD, player->GetGUIDLow()); _BroadcastEvent(GE_JOINED, player->GetGUID(), player->GetName()); + sGuildFinderMgr->RemoveMembershipRequest(player->GetGUIDLow(), GUID_LOPART(this->GetGUID())); } } diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h index f3e18d8998b..f644e5d3592 100755 --- a/src/server/game/Guilds/Guild.h +++ b/src/server/game/Guilds/Guild.h @@ -787,6 +787,8 @@ public: void ResetDailyExperience(); GuildNewsLog& GetNewsLog() { return _newsLog; } + EmblemInfo const& GetEmblemInfo() const { return m_emblemInfo; } + protected: uint32 m_id; std::string m_name; diff --git a/src/server/game/Guilds/GuildFinderMgr.cpp b/src/server/game/Guilds/GuildFinderMgr.cpp new file mode 100644 index 00000000000..71a1a9ded0d --- /dev/null +++ b/src/server/game/Guilds/GuildFinderMgr.cpp @@ -0,0 +1,305 @@ +/* + * Copyright (C) 2008-2012 TrinityCore + * + * 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; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; 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, see . + */ + +#include "ObjectMgr.h" +#include "GuildFinderMgr.h" +#include "GuildMgr.h" +#include "World.h" + +GuildFinderMgr::GuildFinderMgr() +{ +} + +GuildFinderMgr::~GuildFinderMgr() +{ +} + +void GuildFinderMgr::LoadFromDB() +{ + LoadGuildSettings(); + LoadMembershipRequests(); +} + +void GuildFinderMgr::LoadGuildSettings() +{ + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading guild finder guild-related settings..."); + // 0 1 2 3 4 5 6 7 + QueryResult result = CharacterDatabase.Query("SELECT gfgs.guildId, gfgs.availability, gfgs.classRoles, gfgs.interests, gfgs.level, gfgs.listed, gfgs.comment, c.race " + "FROM guild_finder_guild_settings gfgs " + "LEFT JOIN guild_member gm ON gm.guildid=gfgs.guildId " + "LEFT JOIN characters c ON c.guid = gm.guid LIMIT 1"); + + if (!result) + { + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 guild finder guild-related settings. Table `guild_finder_guild_settings` is empty."); + return; + } + + uint32 count = 0; + uint32 oldMSTime = getMSTime(); + do + { + Field* fields = result->Fetch(); + uint32 guildId = fields[0].GetUInt32(); + uint8 availability = fields[1].GetUInt8(); + uint8 classRoles = fields[2].GetUInt8(); + uint8 interests = fields[3].GetUInt8(); + uint8 level = fields[4].GetUInt8(); + bool listed = (fields[5].GetUInt8() != 0); + std::string comment = fields[6].GetString(); + + TeamId guildTeam = TEAM_ALLIANCE; + if (ChrRacesEntry const* raceEntry = sChrRacesStore.LookupEntry(fields[7].GetUInt8())) + if (raceEntry->TeamID == 1) + guildTeam = TEAM_HORDE; + + LFGuildSettings settings(listed, guildTeam, guildId, classRoles, availability, interests, level, comment); + _guildSettings[guildId] = settings; + + ++count; + } while (result->NextRow()); + + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u guild finder guild-related settings in %u ms.", count, GetMSTimeDiffToNow(oldMSTime)); +} + +void GuildFinderMgr::LoadMembershipRequests() +{ + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading guild finder membership requests..."); + // 0 1 2 3 4 5 6 + QueryResult result = CharacterDatabase.Query("SELECT guildId, playerGuid, availability, classRole, interests, comment, submitTime " + "FROM guild_finder_applicant"); + + if (!result) + { + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 guild finder membership requests. Table `guild_finder_applicant` is empty."); + return; + } + + uint32 count = 0; + uint32 oldMSTime = getMSTime(); + do + { + Field* fields = result->Fetch(); + uint32 guildId = fields[0].GetUInt32(); + uint32 playerId = fields[1].GetUInt32(); + uint8 availability = fields[2].GetUInt8(); + uint8 classRoles = fields[3].GetUInt8(); + uint8 interests = fields[4].GetUInt8(); + std::string comment = fields[5].GetString(); + uint32 submitTime = fields[6].GetUInt32(); + + MembershipRequest request(playerId, guildId, availability, classRoles, interests, comment, time_t(submitTime)); + + _membershipRequests[guildId].push_back(request); + + ++count; + } while (result->NextRow()); + + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u guild finder membership requests in %u ms.", count, GetMSTimeDiffToNow(oldMSTime)); +} + +void GuildFinderMgr::AddMembershipRequest(uint32 guildGuid, MembershipRequest const& request) +{ + _membershipRequests[guildGuid].push_back(request); + + SQLTransaction trans = CharacterDatabase.BeginTransaction(); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_GUILD_FINDER_APPLICANT); + stmt->setUInt32(0, request.GetGuildId()); + stmt->setUInt32(1, request.GetPlayerGUID()); + stmt->setUInt8(2, request.GetAvailability()); + stmt->setUInt8(3, request.GetClassRoles()); + stmt->setUInt8(4, request.GetInterests()); + stmt->setString(5, request.GetComment()); + stmt->setUInt32(6, request.GetSubmitTime()); + trans->Append(stmt); + CharacterDatabase.CommitTransaction(trans); + + // Notify the applicant his submittion has been added + if (Player* player = ObjectAccessor::FindPlayer(MAKE_NEW_GUID(request.GetPlayerGUID(), 0, HIGHGUID_PLAYER))) + SendMembershipRequestListUpdate(*player); + + // Notify the guild master and officers the list changed + if (Guild* guild = sGuildMgr->GetGuildById(guildGuid)) + SendApplicantListUpdate(*guild); +} + +void GuildFinderMgr::RemoveMembershipRequest(uint32 playerId, uint32 guildId) +{ + std::vector::iterator itr = _membershipRequests[guildId].begin(); + for(; itr != _membershipRequests[guildId].end(); ++itr) + if (itr->GetPlayerGUID() == playerId) + break; + + if (itr == _membershipRequests[guildId].end()) + return; + + SQLTransaction trans = CharacterDatabase.BeginTransaction(); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_FINDER_APPLICANT); + stmt->setUInt32(0, (*itr).GetGuildId()); + stmt->setUInt32(1, (*itr).GetPlayerGUID()); + trans->Append(stmt); + + CharacterDatabase.CommitTransaction(trans); + + _membershipRequests[guildId].erase(itr); + + // Notify the applicant his submittion has been removed + if (Player* player = ObjectAccessor::FindPlayer(MAKE_NEW_GUID(playerId, 0, HIGHGUID_PLAYER))) + SendMembershipRequestListUpdate(*player); + + // Notify the guild master and officers the list changed + if (Guild* guild = sGuildMgr->GetGuildById(guildId)) + SendApplicantListUpdate(*guild); +} + +std::list GuildFinderMgr::GetAllMembershipRequestsForPlayer(uint32 playerGuid) +{ + std::list resultSet; + for (MembershipRequestStore::const_iterator itr = _membershipRequests.begin(); itr != _membershipRequests.end(); ++itr) + { + std::vector const& guildReqs = itr->second; + for (std::vector::const_iterator itr2 = guildReqs.begin(); itr2 != guildReqs.end(); ++itr2) + { + if (itr2->GetPlayerGUID() == playerGuid) + { + resultSet.push_back(*itr2); + break; + } + } + } + return resultSet; +} + +uint8 GuildFinderMgr::CountRequestsFromPlayer(uint32 playerId) +{ + uint8 result = 0; + for (MembershipRequestStore::const_iterator itr = _membershipRequests.begin(); itr != _membershipRequests.end(); ++itr) + { + for (std::vector::const_iterator itr2 = itr->second.begin(); itr2 != itr->second.end(); ++itr2) + { + if (itr2->GetPlayerGUID() != playerId) + continue; + ++result; + break; + } + } + return result; +} + +LFGuildStore GuildFinderMgr::GetGuildsMatchingSetting(LFGuildPlayer& settings, TeamId faction) +{ + LFGuildStore resultSet; + for (LFGuildStore::const_iterator itr = _guildSettings.begin(); itr != _guildSettings.end(); ++itr) + { + LFGuildSettings const& guildSettings = itr->second; + + if (guildSettings.GetTeam() != faction) + continue; + + if (!(guildSettings.GetAvailability() & settings.GetAvailability())) + continue; + + if (!(guildSettings.GetClassRoles() & settings.GetClassRoles())) + continue; + + if (!(guildSettings.GetInterests() & settings.GetInterests())) + continue; + + if (!(guildSettings.GetLevel() & settings.GetLevel())) + continue; + + resultSet.insert(std::make_pair(itr->first, guildSettings)); + } + + return resultSet; +} + +bool GuildFinderMgr::HasRequest(uint32 playerId, uint32 guildId) +{ + for (std::vector::const_iterator itr = _membershipRequests[guildId].begin(); itr != _membershipRequests[guildId].end(); ++itr) + if (itr->GetPlayerGUID() == playerId) + return true; + return false; +} + +void GuildFinderMgr::SetGuildSettings(uint32 guildGuid, LFGuildSettings const& settings) +{ + _guildSettings[guildGuid] = settings; + + SQLTransaction trans = CharacterDatabase.BeginTransaction(); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_GUILD_FINDER_GUILD_SETTINGS); + stmt->setUInt32(0, settings.GetGUID()); + stmt->setUInt8(1, settings.GetAvailability()); + stmt->setUInt8(2, settings.GetClassRoles()); + stmt->setUInt8(3, settings.GetInterests()); + stmt->setUInt8(4, settings.GetLevel()); + stmt->setUInt8(5, settings.IsListed()); + stmt->setString(6, settings.GetComment()); + trans->Append(stmt); + + CharacterDatabase.CommitTransaction(trans); +} + +void GuildFinderMgr::DeleteGuild(uint32 guildId) +{ + std::vector::iterator itr = _membershipRequests[guildId].begin(); + while (itr != _membershipRequests[guildId].end()) + { + SQLTransaction trans = CharacterDatabase.BeginTransaction(); + + uint32 applicant = itr->GetPlayerGUID(); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_FINDER_APPLICANT); + stmt->setUInt32(0, itr->GetGuildId()); + stmt->setUInt32(1, applicant); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_FINDER_GUILD_SETTINGS); + stmt->setUInt32(0, (*itr).GetGuildId()); + trans->Append(stmt); + + CharacterDatabase.CommitTransaction(trans); + _membershipRequests[guildId].erase(itr); + + // Notify the applicant his submition has been removed + if (Player* player = ObjectAccessor::FindPlayer(MAKE_NEW_GUID(applicant, 0, HIGHGUID_PLAYER))) + SendMembershipRequestListUpdate(*player); + } + + _membershipRequests.erase(guildId); + _guildSettings.erase(guildId); + + // Notify the guild master the list changed (even if he's not a GM any more, not sure if needed) + if (Guild* guild = sGuildMgr->GetGuildById(guildId)) + SendApplicantListUpdate(*guild); +} + +void GuildFinderMgr::SendApplicantListUpdate(Guild& guild) +{ + WorldPacket data(SMSG_LF_GUILD_APPLICANT_LIST_UPDATED, 0); + if (Player* player = ObjectAccessor::FindPlayer(guild.GetLeaderGUID())) + player->SendDirectMessage(&data); + guild.BroadcastPacketToRank(&data, GR_OFFICER); +} + +void GuildFinderMgr::SendMembershipRequestListUpdate(Player& player) +{ + WorldPacket data(SMSG_LF_GUILD_APPLICATIONS_LIST_CHANGED, 0); + player.SendDirectMessage(&data); +} diff --git a/src/server/game/Guilds/GuildFinderMgr.h b/src/server/game/Guilds/GuildFinderMgr.h new file mode 100644 index 00000000000..049071dbca9 --- /dev/null +++ b/src/server/game/Guilds/GuildFinderMgr.h @@ -0,0 +1,268 @@ +/* + * Copyright (C) 2008-2012 TrinityCore + * + * 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; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; 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, see . + */ + +#ifndef __TRINITY_GUILDFINDER_H +#define __TRINITY_GUILDFINDER_H + +#include +#include "Common.h" +#include "World.h" +#include "GuildMgr.h" + +enum GuildFinderOptionsInterest +{ + INTEREST_QUESTING = 0x01, + INTEREST_DUNGEONS = 0x02, + INTEREST_RAIDS = 0x04, + INTEREST_PVP = 0x08, + INTEREST_ROLE_PLAYING = 0x10, + ALL_INTERESTS = INTEREST_QUESTING | INTEREST_DUNGEONS | INTEREST_RAIDS | INTEREST_PVP | INTEREST_ROLE_PLAYING +}; + +enum GuildFinderOptionsAvailability +{ + AVAILABILITY_WEEKDAYS = 0x1, + AVAILABILITY_WEEKENDS = 0x2, + ALL_WEEK = AVAILABILITY_WEEKDAYS | AVAILABILITY_WEEKENDS +}; + +enum GuildFinderOptionsRoles +{ + GUILDFINDER_ROLE_TANK = 0x1, + GUILDFINDER_ROLE_HEALER = 0x2, + GUILDFINDER_ROLE_DPS = 0x4, + GUILDFINDER_ALL_ROLES = GUILDFINDER_ROLE_TANK | GUILDFINDER_ROLE_HEALER | GUILDFINDER_ROLE_DPS +}; + +enum GuildFinderOptionsLevel +{ + ANY_FINDER_LEVEL = 0x1, + MAX_FINDER_LEVEL = 0x2, + ALL_GUILDFINDER_LEVELS = ANY_FINDER_LEVEL | MAX_FINDER_LEVEL +}; + +/// Holds all required informations about a membership request +struct MembershipRequest +{ + public: + MembershipRequest(MembershipRequest const& settings) : _comment(settings.GetComment()) + { + _availability = settings.GetAvailability(); + _classRoles = settings.GetClassRoles(); + _interests = settings.GetInterests(); + _guildId = settings.GetGuildId(); + _playerGUID = settings.GetPlayerGUID(); + _time = settings.GetSubmitTime(); + } + + MembershipRequest(uint32 playerGUID, uint32 guildId, uint32 availability, uint32 classRoles, uint32 interests, std::string& comment, time_t submitTime) : + _playerGUID(playerGUID), _guildId(guildId), _availability(availability), _classRoles(classRoles), + _interests(interests), _time(submitTime), _comment(comment) {} + + MembershipRequest() : _playerGUID(0), _guildId(0), _availability(0), _classRoles(0), + _interests(0), _time(time(NULL)) {} + + uint32 GetGuildId() const { return _guildId; } + uint32 GetPlayerGUID() const { return _playerGUID; } + uint8 GetAvailability() const { return _availability; } + uint8 GetClassRoles() const { return _classRoles; } + uint8 GetInterests() const { return _interests; } + uint8 GetClass() const { return sWorld->GetCharacterNameData(GetPlayerGUID())->m_class; } + uint8 GetLevel() const { return sWorld->GetCharacterNameData(GetPlayerGUID())->m_level; } + time_t GetSubmitTime() const { return _time; } + time_t GetExpiryTime() const { return time_t(_time + 30 * 24 * 3600); } // Adding 30 days + std::string const& GetComment() const { return _comment; } + std::string const& GetName() const { return sWorld->GetCharacterNameData(GetPlayerGUID())->m_name; } + private: + std::string _comment; + + uint32 _guildId; + uint32 _playerGUID; + + uint8 _availability; + uint8 _classRoles; + uint8 _interests; + + time_t _time; +}; + +/// Holds all informations about a player's finder settings. _NOT_ stored in database. +struct LFGuildPlayer +{ + public: + LFGuildPlayer() + { + _guid = 0; + _roles = 0; + _availability = 0; + _interests = 0; + _level = 0; + } + + LFGuildPlayer(uint32 guid, uint8 role, uint8 availability, uint8 interests, uint8 level) + { + _guid = guid; + _roles = role; + _availability = availability; + _interests = interests; + _level = level; + } + + LFGuildPlayer(uint32 guid, uint8 role, uint8 availability, uint8 interests, uint8 level, std::string& comment) : _comment(comment) + { + _guid = guid; + _roles = role; + _availability = availability; + _interests = interests; + _level = level; + } + + LFGuildPlayer(LFGuildPlayer const& settings) : _comment(settings.GetComment()) + { + _guid = settings.GetGUID(); + _roles = settings.GetClassRoles(); + _availability = settings.GetAvailability(); + _interests = settings.GetInterests(); + _level = settings.GetLevel(); + } + + uint32 GetGUID() const { return _guid; } + uint8 GetClassRoles() const { return _roles; } + uint8 GetAvailability() const { return _availability; } + uint8 GetInterests() const { return _interests; } + uint8 GetLevel() const { return _level; } + std::string const& GetComment() const { return _comment; } + + private: + std::string _comment; + uint32 _guid; + uint8 _roles; + uint8 _availability; + uint8 _interests; + uint8 _level; +}; + +/// Holds settings for a guild in the finder system. Saved to database. +struct LFGuildSettings : public LFGuildPlayer +{ + public: + LFGuildSettings() : LFGuildPlayer(), _listed(false), _team(TEAM_ALLIANCE) {} + + LFGuildSettings(bool listed, TeamId team) : LFGuildPlayer(), _listed(listed), _team(team) {} + + LFGuildSettings(bool listed, TeamId team, uint32 guid, uint8 role, uint8 availability, uint8 interests, uint8 level) : _listed(listed), + LFGuildPlayer(guid, role, availability, interests, level), _team(team) {} + + LFGuildSettings(bool listed, TeamId team, uint32 guid, uint8 role, uint8 availability, uint8 interests, uint8 level, std::string& comment) : _listed(listed), + LFGuildPlayer(guid, role, availability, interests, level, comment), _team(team) {} + + LFGuildSettings(LFGuildSettings const& settings) : _listed(settings.IsListed()), _team(settings.GetTeam()), + LFGuildPlayer(settings) {} + + + bool IsListed() const { return _listed; } + void SetListed(bool state) { _listed = state; } + + TeamId GetTeam() const { return _team; } + private: + TeamId _team; + bool _listed; +}; + +typedef std::map LFGuildStore; +typedef std::map > MembershipRequestStore; + +class GuildFinderMgr +{ + friend class ACE_Singleton; + + private: + GuildFinderMgr(); + ~GuildFinderMgr(); + + LFGuildStore _guildSettings; + + MembershipRequestStore _membershipRequests; + + void LoadGuildSettings(); + void LoadMembershipRequests(); + + public: + void LoadFromDB(); + + /** + * @brief Stores guild settings and begins an asynchronous database insert + * @param guildGuid The guild's database guid. + * @param LFGuildSettings The guild's settings storage. + */ + void SetGuildSettings(uint32 guildGuid, LFGuildSettings const& settings); + + /** + * @brief Returns settings for a guild. + * @param guildGuid The guild's database guid. + */ + LFGuildSettings GetGuildSettings(uint32 guildGuid) { return _guildSettings[guildGuid]; } + + /** + * @brief Files a membership request to a guild + * @param guildGuid The guild's database GUID. + * @param MembershipRequest An object storing all data related to the request. + */ + void AddMembershipRequest(uint32 guildGuid, MembershipRequest const& request); + + /** + * @brief Removes a membership request to a guild. + * @param playerId The player's database guid whose application shall be deleted. + * @param guildId The guild's database guid + */ + void RemoveMembershipRequest(uint32 playerId, uint32 guildId); + + /// wipes everything related to a guild. Used when that guild is disbanded + void DeleteGuild(uint32 guildId); + + /** + * @brief Returns a set of membership requests for a guild + * @param guildGuid The guild's database guid. + */ + std::vector GetAllMembershipRequestsForGuild(uint32 guildGuid) { return _membershipRequests[guildGuid]; } + + /** + * @brief Returns a list of membership requests for a player. + * @param playerGuid The player's database guid. + */ + std::list GetAllMembershipRequestsForPlayer(uint32 playerGuid); + + /** + * @brief Returns a store of guilds matching the settings provided, using bitmask operators. + * @param settings The player's finder settings + * @param teamId The player's faction (TEAM_ALLIANCE or TEAM_HORDE) + */ + LFGuildStore GetGuildsMatchingSetting(LFGuildPlayer& settings, TeamId faction); + + /// Provided a player DB guid and a guild DB guid, determines if a pending request is filed with these keys. + bool HasRequest(uint32 playerId, uint32 guildId); + + /// Counts the amount of pending membership requests, given the player's db guid. + uint8 CountRequestsFromPlayer(uint32 playerId); + + void SendApplicantListUpdate(Guild& guild); + void SendMembershipRequestListUpdate(Player& player); +}; + +#define sGuildFinderMgr ACE_Singleton::instance() + +#endif // __TRINITY_GUILDFINDER_H diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 32ed1d2b27f..33ffb5ba169 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -685,7 +685,7 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte std::string IP_str = GetRemoteAddress(); sLog->outInfo(LOG_FILTER_CHARACTER, "Account: %d (IP: %s) Create Character:[%s] (GUID: %u)", GetAccountId(), IP_str.c_str(), createInfo->Name.c_str(), newChar.GetGUIDLow()); sScriptMgr->OnPlayerCreate(&newChar); - sWorld->AddCharacterNameData(newChar.GetGUIDLow(), std::string(newChar.GetName()), newChar.getGender(), newChar.getRace(), newChar.getClass()); + sWorld->AddCharacterNameData(newChar.GetGUIDLow(), std::string(newChar.GetName()), newChar.getGender(), newChar.getRace(), newChar.getClass(), newChar.getLevel()); newChar.CleanupsBeforeDelete(); delete createInfo; diff --git a/src/server/game/Handlers/GuildFinderHandler.cpp b/src/server/game/Handlers/GuildFinderHandler.cpp new file mode 100644 index 00000000000..af57a5908f8 --- /dev/null +++ b/src/server/game/Handlers/GuildFinderHandler.cpp @@ -0,0 +1,443 @@ +/* + * Copyright (C) 2008-2012 TrinityCore + * + * 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; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; 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, see . + */ + +#include "WorldSession.h" +#include "WorldPacket.h" +#include "Object.h" +#include "SharedDefines.h" +#include "GuildFinderMgr.h" +#include "GuildMgr.h" + +void WorldSession::HandleGuildFinderAddRecruit(WorldPacket& recvPacket) +{ + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_LF_GUILD_ADD_RECRUIT"); + + if (sGuildFinderMgr->GetAllMembershipRequestsForPlayer(GetPlayer()->GetGUIDLow()).size() == 10) + return; + + uint32 classRoles = 0; + uint32 availability = 0; + uint32 guildInterests = 0; + + recvPacket >> classRoles >> guildInterests >> availability; + + ObjectGuid guid; + guid[3] = recvPacket.ReadBit(); + guid[0] = recvPacket.ReadBit(); + guid[6] = recvPacket.ReadBit(); + guid[1] = recvPacket.ReadBit(); + uint16 commentLength = recvPacket.ReadBits(11); + guid[5] = recvPacket.ReadBit(); + guid[4] = recvPacket.ReadBit(); + guid[7] = recvPacket.ReadBit(); + uint8 nameLength = recvPacket.ReadBits(7); + guid[2] = recvPacket.ReadBit(); + + recvPacket.ReadByteSeq(guid[4]); + recvPacket.ReadByteSeq(guid[5]); + std::string comment = recvPacket.ReadString(commentLength); + std::string playerName = recvPacket.ReadString(nameLength); + recvPacket.ReadByteSeq(guid[7]); + recvPacket.ReadByteSeq(guid[2]); + recvPacket.ReadByteSeq(guid[0]); + recvPacket.ReadByteSeq(guid[6]); + recvPacket.ReadByteSeq(guid[1]); + recvPacket.ReadByteSeq(guid[3]); + + uint32 guildLowGuid = GUID_LOPART(uint64(guid)); + + if (!IS_GUILD_GUID(guid)) + return; + if (!(classRoles & GUILDFINDER_ALL_ROLES) || classRoles > GUILDFINDER_ALL_ROLES) + return; + if (!(availability & ALL_WEEK) || availability > ALL_WEEK) + return; + if (!(guildInterests & ALL_INTERESTS) || guildInterests > ALL_INTERESTS) + return; + + MembershipRequest request = MembershipRequest(GetPlayer()->GetGUIDLow(), guildLowGuid, availability, classRoles, guildInterests, comment, time(NULL)); + sGuildFinderMgr->AddMembershipRequest(guildLowGuid, request); +} + +void WorldSession::HandleGuildFinderBrowse(WorldPacket& recvPacket) +{ + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_LF_GUILD_BROWSE"); + uint32 classRoles = 0; + uint32 availability = 0; + uint32 guildInterests = 0; + uint32 playerLevel = 0; // Raw player level (1-85), do they use MAX_FINDER_LEVEL when on level 85 ? + + recvPacket >> classRoles >> availability >> guildInterests >> playerLevel; + + if (!(classRoles & GUILDFINDER_ALL_ROLES) || classRoles > GUILDFINDER_ALL_ROLES) + return; + if (!(availability & ALL_WEEK) || availability > ALL_WEEK) + return; + if (!(guildInterests & ALL_INTERESTS) || guildInterests > ALL_INTERESTS) + return; + if (playerLevel > sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL) || playerLevel < 1) + return; + + Player* player = GetPlayer(); + + LFGuildPlayer settings(player->GetGUIDLow(), classRoles, availability, guildInterests, ANY_FINDER_LEVEL); + LFGuildStore guildList = sGuildFinderMgr->GetGuildsMatchingSetting(settings, player->GetTeamId()); + uint32 guildCount = guildList.size(); + + if (guildCount == 0) + { + WorldPacket packet(SMSG_LF_GUILD_BROWSE_UPDATED, 0); + player->SendDirectMessage(&packet); + return; + } + + ByteBuffer bufferData(65 * guildCount); + WorldPacket data(SMSG_LF_GUILD_BROWSE_UPDATED, 3 + guildCount * 65); // Estimated size + data.WriteBits(guildCount, 19); + + for (LFGuildStore::const_iterator itr = guildList.begin(); itr != guildList.end(); ++itr) + { + LFGuildSettings guildSettings = itr->second; + Guild* guild = sGuildMgr->GetGuildById(itr->first); + + ObjectGuid guildGUID = ObjectGuid(guild->GetGUID()); + + data.WriteBit(guildGUID[7]); + data.WriteBit(guildGUID[5]); + data.WriteBits(guild->GetName().size(), 8); + data.WriteBit(guildGUID[0]); + data.WriteBits(guildSettings.GetComment().size(), 11); + data.WriteBit(guildGUID[4]); + data.WriteBit(guildGUID[1]); + data.WriteBit(guildGUID[2]); + data.WriteBit(guildGUID[6]); + data.WriteBit(guildGUID[3]); + + bufferData << int32(guild->GetEmblemInfo().GetColor()); + bufferData << int32(guild->GetEmblemInfo().GetBorderStyle()); // Guessed + bufferData << int32(guild->GetEmblemInfo().GetStyle()); + + bufferData.WriteString(guildSettings.GetComment()); + + bufferData << uint8(0); // Cached ? Idk + + bufferData.WriteByteSeq(guildGUID[5]); + + bufferData << uint32(guildSettings.GetInterests()); // Guild Interests + + bufferData.WriteByteSeq(guildGUID[6]); + bufferData.WriteByteSeq(guildGUID[4]); + + bufferData << guild->GetLevel(); + + bufferData.WriteString(guild->GetName()); + + bufferData << int32(0); // guild->GetAchievementMgr().GetAchievementPoints() + + bufferData.WriteByteSeq(guildGUID[7]); + + bufferData << uint8(sGuildFinderMgr->HasRequest(player->GetGUIDLow(), guild->GetGUID())); // Request pending + + bufferData.WriteByteSeq(guildGUID[2]); + bufferData.WriteByteSeq(guildGUID[0]); + + bufferData << uint32(guildSettings.GetAvailability()); + + bufferData.WriteByteSeq(guildGUID[1]); + + bufferData << int32(guild->GetEmblemInfo().GetBackgroundColor()); + bufferData << uint32(0); // Unk Int 2 (+ 128) // Always 0 or 1 + bufferData << int32(guild->GetEmblemInfo().GetBorderColor()); + bufferData << uint32(guildSettings.GetClassRoles()); + + bufferData.WriteByteSeq(guildGUID[3]); + bufferData << int32(guild->GetMembersCount()); + } + + data.FlushBits(); + data.append(bufferData); + + player->SendDirectMessage(&data); +} + +void WorldSession::HandleGuildFinderDeclineRecruit(WorldPacket& recvPacket) +{ + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_LF_GUILD_DECLINE_RECRUIT"); + + ObjectGuid playerGuid; + + playerGuid[1] = recvPacket.ReadBit(); + playerGuid[4] = recvPacket.ReadBit(); + playerGuid[5] = recvPacket.ReadBit(); + playerGuid[2] = recvPacket.ReadBit(); + playerGuid[6] = recvPacket.ReadBit(); + playerGuid[7] = recvPacket.ReadBit(); + playerGuid[0] = recvPacket.ReadBit(); + playerGuid[3] = recvPacket.ReadBit(); + + recvPacket.ReadByteSeq(playerGuid[5]); + recvPacket.ReadByteSeq(playerGuid[7]); + recvPacket.ReadByteSeq(playerGuid[2]); + recvPacket.ReadByteSeq(playerGuid[3]); + recvPacket.ReadByteSeq(playerGuid[4]); + recvPacket.ReadByteSeq(playerGuid[1]); + recvPacket.ReadByteSeq(playerGuid[0]); + recvPacket.ReadByteSeq(playerGuid[6]); + + if (!IS_PLAYER_GUID(playerGuid)) + return; + + sGuildFinderMgr->RemoveMembershipRequest(GUID_LOPART(playerGuid), GetPlayer()->GetGuildId()); +} + +void WorldSession::HandleGuildFinderGetApplications(WorldPacket& /*recvPacket*/) +{ + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_LF_GUILD_GET_APPLICATIONS"); // Empty opcode + + std::list applicatedGuilds = sGuildFinderMgr->GetAllMembershipRequestsForPlayer(GetPlayer()->GetGUIDLow()); + uint32 applicationsCount = applicatedGuilds.size(); + WorldPacket data(SMSG_LF_GUILD_MEMBERSHIP_LIST_UPDATED, 7 + 54 * applicationsCount); + data.WriteBits(applicationsCount, 20); + + if (applicationsCount > 0) + { + ByteBuffer bufferData(54 * applicationsCount); + for (std::list::const_iterator itr = applicatedGuilds.begin(); itr != applicatedGuilds.end(); ++itr) + { + Guild* guild = sGuildMgr->GetGuildById(itr->GetGuildId()); + LFGuildSettings guildSettings = sGuildFinderMgr->GetGuildSettings(itr->GetGuildId()); + MembershipRequest request = *itr; + + ObjectGuid guildGuid = ObjectGuid(guild->GetGUID()); + + data.WriteBit(guildGuid[1]); + data.WriteBit(guildGuid[0]); + data.WriteBit(guildGuid[5]); + data.WriteBits(request.GetComment().size(), 11); + data.WriteBit(guildGuid[3]); + data.WriteBit(guildGuid[7]); + data.WriteBit(guildGuid[4]); + data.WriteBit(guildGuid[6]); + data.WriteBit(guildGuid[2]); + data.WriteBits(guild->GetName().size(), 8); + + bufferData.WriteByteSeq(guildGuid[2]); + bufferData.WriteString(request.GetComment()); + bufferData.WriteByteSeq(guildGuid[5]); + bufferData.WriteString(guild->GetName()); + + bufferData << uint32(guildSettings.GetAvailability()); + bufferData << uint32(request.GetExpiryTime() - time(NULL)); // Time left to application expiry (seconds) + + bufferData.WriteByteSeq(guildGuid[0]); + bufferData.WriteByteSeq(guildGuid[6]); + bufferData.WriteByteSeq(guildGuid[3]); + bufferData.WriteByteSeq(guildGuid[7]); + + bufferData << uint32(guildSettings.GetClassRoles()); + + bufferData.WriteByteSeq(guildGuid[4]); + bufferData.WriteByteSeq(guildGuid[1]); + + bufferData << uint32(time(NULL) - request.GetSubmitTime()); // Time since application (seconds) + bufferData << uint32(guildSettings.GetInterests()); + } + + data.FlushBits(); + data.append(bufferData); + } + data << uint32(10 - sGuildFinderMgr->CountRequestsFromPlayer(GetPlayer()->GetGUIDLow())); // Applications count left + + GetPlayer()->SendDirectMessage(&data); +} + +// Lists all recruits for a guild - Misses times +void WorldSession::HandleGuildFinderGetRecruits(WorldPacket& recvPacket) +{ + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_LF_GUILD_GET_RECRUITS"); + + uint32 unkTime = 0; + recvPacket >> unkTime; + + Player* player = GetPlayer(); + if (!player->GetGuildId()) + return; + + std::vector recruitsList = sGuildFinderMgr->GetAllMembershipRequestsForGuild(player->GetGuildId()); + uint32 recruitCount = recruitsList.size(); + + ByteBuffer dataBuffer(53 * recruitCount); + WorldPacket data(SMSG_LF_GUILD_RECRUIT_LIST_UPDATED, 7 + 26 * recruitCount + 53 * recruitCount); + data.WriteBits(recruitCount, 20); + + for (std::vector::const_iterator itr = recruitsList.begin(); itr != recruitsList.end(); ++itr) + { + MembershipRequest request = *itr; + ObjectGuid playerGuid(MAKE_NEW_GUID(request.GetPlayerGUID(), 0, HIGHGUID_PLAYER)); + + data.WriteBits(request.GetComment().size(), 11); + data.WriteBit(playerGuid[2]); + data.WriteBit(playerGuid[4]); + data.WriteBit(playerGuid[3]); + data.WriteBit(playerGuid[7]); + data.WriteBit(playerGuid[0]); + data.WriteBits(request.GetName().size(), 7); + data.WriteBit(playerGuid[5]); + data.WriteBit(playerGuid[1]); + data.WriteBit(playerGuid[6]); + + dataBuffer.WriteByteSeq(playerGuid[4]); + + dataBuffer << int32(time(NULL) <= request.GetExpiryTime()); + + dataBuffer.WriteByteSeq(playerGuid[3]); + dataBuffer.WriteByteSeq(playerGuid[0]); + dataBuffer.WriteByteSeq(playerGuid[1]); + + dataBuffer << int32(request.GetLevel()); + + dataBuffer.WriteByteSeq(playerGuid[6]); + dataBuffer.WriteByteSeq(playerGuid[7]); + dataBuffer.WriteByteSeq(playerGuid[2]); + + dataBuffer << int32(time(NULL) - request.GetSubmitTime()); // Time in seconds since application submitted. + dataBuffer << int32(request.GetAvailability()); + dataBuffer << int32(request.GetClassRoles()); + dataBuffer << int32(request.GetInterests()); + dataBuffer << int32(request.GetExpiryTime() - time(NULL)); // TIme in seconds until application expires. + + dataBuffer.WriteString(request.GetName()); + dataBuffer.WriteString(request.GetComment()); + + dataBuffer << int32(request.GetClass()); + + dataBuffer.WriteByteSeq(playerGuid[5]); + } + + data.FlushBits(); + data.append(dataBuffer); + data << uint32(time(NULL)); // Unk time + + player->SendDirectMessage(&data); +} + +void WorldSession::HandleGuildFinderPostRequest(WorldPacket& /*recvPacket*/) +{ + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_LF_GUILD_POST_REQUEST"); // Empty opcode + + Player* player = GetPlayer(); + + if (!player->GetGuildId()) // Player must be in guild + return; + + bool isGuildMaster = true; + if (Guild* guild = sGuildMgr->GetGuildById(player->GetGuildId())) + if (guild->GetLeaderGUID() != player->GetGUID()) + isGuildMaster = false; + + LFGuildSettings settings = sGuildFinderMgr->GetGuildSettings(player->GetGuildId()); + + /// Client does not seem to receive correct data as only the comment is correctly displayed. + WorldPacket data(SMSG_LF_GUILD_POST_UPDATED, 35); + data.WriteBit(isGuildMaster); // Guessed + + if (isGuildMaster) + { + data.WriteBits(settings.GetComment().size(), 11); + data.WriteBit(settings.IsListed()); + data << uint32(settings.GetLevel()); + data.WriteString(settings.GetComment()); + data << uint32(0); // Unk Int32 + data << uint32(settings.GetAvailability()); + data << uint32(settings.GetClassRoles()); + data << uint32(settings.GetInterests()); + } + else + data.FlushBits(); + player->SendDirectMessage(&data); +} + +void WorldSession::HandleGuildFinderRemoveRecruit(WorldPacket& recvPacket) +{ + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_LF_GUILD_REMOVE_RECRUIT"); + + ObjectGuid guildGuid; + + guildGuid[0] = recvPacket.ReadBit(); + guildGuid[4] = recvPacket.ReadBit(); + guildGuid[3] = recvPacket.ReadBit(); + guildGuid[5] = recvPacket.ReadBit(); + guildGuid[7] = recvPacket.ReadBit(); + guildGuid[6] = recvPacket.ReadBit(); + guildGuid[2] = recvPacket.ReadBit(); + guildGuid[1] = recvPacket.ReadBit(); + + recvPacket.ReadByteSeq(guildGuid[4]); + recvPacket.ReadByteSeq(guildGuid[0]); + recvPacket.ReadByteSeq(guildGuid[3]); + recvPacket.ReadByteSeq(guildGuid[6]); + recvPacket.ReadByteSeq(guildGuid[5]); + recvPacket.ReadByteSeq(guildGuid[1]); + recvPacket.ReadByteSeq(guildGuid[2]); + recvPacket.ReadByteSeq(guildGuid[7]); + + if (!IS_GUILD_GUID(guildGuid)) + return; + + sGuildFinderMgr->RemoveMembershipRequest(GetPlayer()->GetGUIDLow(), GUID_LOPART(guildGuid)); +} + +// Sent any time a guild master sets an option in the interface and when listing / unlisting his guild +void WorldSession::HandleGuildFinderSetGuildPost(WorldPacket& recvPacket) +{ + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_LF_GUILD_SET_GUILD_POST"); + + uint32 classRoles = 0; + uint32 availability = 0; + uint32 guildInterests = 0; + uint32 level = 0; + + recvPacket >> level >> availability >> guildInterests >> classRoles; + // Level sent is zero if untouched, force to any (from interface). Idk why + if (!level) + level = ANY_FINDER_LEVEL; + + uint16 length = recvPacket.ReadBits(11); + bool listed = recvPacket.ReadBit(); + std::string comment = recvPacket.ReadString(length); + + if (!(classRoles & GUILDFINDER_ALL_ROLES) || classRoles > GUILDFINDER_ALL_ROLES) + return; + if (!(availability & ALL_WEEK) || availability > ALL_WEEK) + return; + if (!(guildInterests & ALL_INTERESTS) || guildInterests > ALL_INTERESTS) + return; + if (!(level & ALL_GUILDFINDER_LEVELS) || level > ALL_GUILDFINDER_LEVELS) + return; + + Player* player = GetPlayer(); + + if (!player->GetGuildId()) // Player must be in guild + return; + + if (Guild* guild = sGuildMgr->GetGuildById(player->GetGuildId())) // Player must be guild master + if (guild->GetLeaderGUID() != player->GetGUID()) + return; + + LFGuildSettings settings(listed, player->GetTeamId(), player->GetGuildId(), classRoles, availability, guildInterests, level, comment); + sGuildFinderMgr->SetGuildSettings(player->GetGuildId(), settings); +} diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 3ed5c0fe7f8..b1ef5bcb704 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -261,7 +261,7 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_GUILD_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDeclineOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_DEL_RANK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDelRankOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_DEMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDemoteOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_DISBAND, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDisbandOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_DISBAND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDisbandOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_EVENT_LOG_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildEventLogQueryOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_INFO_TEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildChangeInfoTextOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildInviteOpcode ); @@ -310,14 +310,14 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_COMMENT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_LFG_SET_ROLES, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetRolesOpcode ); DEFINE_OPCODE_HANDLER(CMSG_LFG_TELEPORT, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgTeleportOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_ADD_RECRUIT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_BROWSE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_DECLINE_RECRUIT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_GET_APPLICATIONS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_GET_RECRUITS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_POST_REQUEST, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_REMOVE_RECRUIT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_SET_GUILD_POST, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_ADD_RECRUIT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildFinderAddRecruit ); + DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_BROWSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildFinderBrowse ); + DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_DECLINE_RECRUIT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildFinderDeclineRecruit ); + DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_GET_APPLICATIONS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildFinderGetApplications); + DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_GET_RECRUITS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildFinderGetRecruits ); + DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_POST_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildFinderPostRequest ); + DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_REMOVE_RECRUIT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildFinderRemoveRecruit ); + DEFINE_OPCODE_HANDLER(CMSG_LF_GUILD_SET_GUILD_POST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildFinderSetGuildPost ); DEFINE_OPCODE_HANDLER(CMSG_LIST_INVENTORY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleListInventoryOpcode ); DEFINE_OPCODE_HANDLER(CMSG_LOAD_SCREEN, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleLoadScreenOpcode ); DEFINE_OPCODE_HANDLER(CMSG_LOGOUT_CANCEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLogoutCancelOpcode ); @@ -940,13 +940,13 @@ void InitOpcodes() DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_SEARCH, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_STATUS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LFG_UPDATE_STATUS_NONE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_APPLICANT_LIST_UPDATED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_APPLICATIONS_LIST_CHANGED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_BROWSE_UPDATED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_COMMAND_RESULT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_MEMBERSHIP_LIST_UPDATED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_POST_UPDATED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_RECRUIT_LIST_UPDATED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_APPLICANT_LIST_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_APPLICATIONS_LIST_CHANGED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_BROWSE_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_MEMBERSHIP_LIST_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_POST_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_LF_GUILD_RECRUIT_LIST_UPDATED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LIST_INVENTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LOAD_CUF_PROFILES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_LOGIN_SETTIMESPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index b948ce76ca6..a9594fa44a6 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -312,7 +312,6 @@ enum Opcodes CMSG_LF_GUILD_DECLINE_RECRUIT = 0x1031, CMSG_LF_GUILD_GET_APPLICATIONS = 0x1230, CMSG_LF_GUILD_GET_RECRUITS = 0x3230, - CMSG_LF_GUILD_JOIN = 0x0000, CMSG_LF_GUILD_POST_REQUEST = 0x3237, CMSG_LF_GUILD_REMOVE_RECRUIT = 0x3027, CMSG_LF_GUILD_SET_GUILD_POST = 0x0448, @@ -1024,7 +1023,6 @@ enum Opcodes SMSG_LF_GUILD_MEMBERSHIP_LIST_UPDATED = 0x1CA5, SMSG_LF_GUILD_POST_UPDATED = 0x35B7, SMSG_LF_GUILD_RECRUIT_LIST_UPDATED = 0x1CB2, - SMSG_LF_GUILD_SEARCH_RESULT = 0x0000, SMSG_LIST_INVENTORY = 0x7CB0, SMSG_LOAD_CUF_PROFILES = 0x50B1, SMSG_LOGIN_SETTIMESPEED = 0x4D15, diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index a7ab19f393a..1db1399e45f 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -245,7 +245,7 @@ class WorldSession bool IsAddonRegistered(const std::string& prefix) const; void ReadMovementInfo(WorldPacket& data, MovementInfo* mi); - void WriteMovementInfo(WorldPacket &data, MovementInfo* mi); + void WriteMovementInfo(WorldPacket& data, MovementInfo* mi); void SendPacket(WorldPacket const* packet, bool forced = false); void SendNotification(const char *format, ...) ATTR_PRINTF(2, 3); @@ -597,6 +597,15 @@ class WorldSession void HandleGuildRequestMaxDailyXP(WorldPacket& recvPacket); void HandleAutoDeclineGuildInvites(WorldPacket& recvPacket); + void HandleGuildFinderAddRecruit(WorldPacket& recvPacket); + void HandleGuildFinderBrowse(WorldPacket& recvPacket); + void HandleGuildFinderDeclineRecruit(WorldPacket& recvPacket); + void HandleGuildFinderGetApplications(WorldPacket& recvPacket); + void HandleGuildFinderGetRecruits(WorldPacket& recvPacket); + void HandleGuildFinderPostRequest(WorldPacket& recvPacket); + void HandleGuildFinderRemoveRecruit(WorldPacket& recvPacket); + void HandleGuildFinderSetGuildPost(WorldPacket& recvPacket); + void HandleTaxiNodeStatusQueryOpcode(WorldPacket& recvPacket); void HandleTaxiQueryAvailableNodes(WorldPacket& recvPacket); void HandleActivateTaxiOpcode(WorldPacket& recvPacket); diff --git a/src/server/game/Tools/PlayerDump.cpp b/src/server/game/Tools/PlayerDump.cpp index ae05cb4e8eb..86cc42fba42 100644 --- a/src/server/game/Tools/PlayerDump.cpp +++ b/src/server/game/Tools/PlayerDump.cpp @@ -462,6 +462,7 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s uint8 gender = GENDER_NONE; uint8 race = RACE_NONE; uint8 playerClass = 0; + uint8 level = 1; SQLTransaction trans = CharacterDatabase.BeginTransaction(); while (!feof(fin)) @@ -536,6 +537,7 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s race = uint8(atol(getnth(line, 4).c_str())); playerClass = uint8(atol(getnth(line, 5).c_str())); gender = uint8(atol(getnth(line, 6).c_str())); + level = uint8(atol(getnth(line, 7).c_str())); if (name == "") { // check if the original name already exists @@ -679,7 +681,7 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s CharacterDatabase.CommitTransaction(trans); // in case of name conflict player has to rename at login anyway - sWorld->AddCharacterNameData(guid, name, gender, race, playerClass); + sWorld->AddCharacterNameData(guid, name, gender, race, playerClass, level); sObjectMgr->_hiItemGuid += items.size(); sObjectMgr->_mailId += mails.size(); diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 92dd103f79d..204e90053ad 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -39,6 +39,7 @@ #include "ObjectMgr.h" #include "ArenaTeamMgr.h" #include "GuildMgr.h" +#include "GuildFinderMgr.h" #include "TicketMgr.h" #include "SpellMgr.h" #include "GroupMgr.h" @@ -1572,6 +1573,8 @@ void World::SetInitialWorldSettings() sGuildMgr->LoadGuilds(); + sGuildFinderMgr->LoadFromDB(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading ArenaTeams..."); sArenaTeamMgr->LoadArenaTeams(); @@ -2955,7 +2958,7 @@ void World::LoadCharacterNameData() { sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading character name data"); - QueryResult result = CharacterDatabase.Query("SELECT guid, name, race, gender, class FROM characters WHERE deleteDate IS NULL"); + QueryResult result = CharacterDatabase.Query("SELECT guid, name, race, gender, class, level FROM characters WHERE deleteDate IS NULL"); if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, "No character name data loaded, empty query"); @@ -2968,20 +2971,21 @@ void World::LoadCharacterNameData() { Field* fields = result->Fetch(); AddCharacterNameData(fields[0].GetUInt32(), fields[1].GetString(), - fields[3].GetUInt8() /*gender*/, fields[2].GetUInt8() /*race*/, fields[4].GetUInt8() /*class*/); + fields[3].GetUInt8() /*gender*/, fields[2].GetUInt8() /*race*/, fields[4].GetUInt8() /*class*/, fields[5].GetUInt8()); ++count; } while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loaded name data for %u characters", count); } -void World::AddCharacterNameData(uint32 guid, std::string const& name, uint8 gender, uint8 race, uint8 playerClass) +void World::AddCharacterNameData(uint32 guid, std::string const& name, uint8 gender, uint8 race, uint8 playerClass, uint8 level) { CharacterNameData& data = _characterNameDataMap[guid]; data.m_name = name; data.m_race = race; data.m_gender = gender; data.m_class = playerClass; + data.m_level = level; } void World::UpdateCharacterNameData(uint32 guid, std::string const& name, uint8 gender /*= GENDER_NONE*/, uint8 race /*= RACE_NONE*/) @@ -2999,6 +3003,15 @@ void World::UpdateCharacterNameData(uint32 guid, std::string const& name, uint8 itr->second.m_race = race; } +void World::UpdateCharacterNameDataLevel(uint32 guid, uint8 level) +{ + std::map::iterator itr = _characterNameDataMap.find(guid); + if (itr == _characterNameDataMap.end()) + return; + + itr->second.m_level = level; +} + CharacterNameData const* World::GetCharacterNameData(uint32 guid) const { std::map::const_iterator itr = _characterNameDataMap.find(guid); diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h index f0f5e3f723b..83746bb6022 100755 --- a/src/server/game/World/World.h +++ b/src/server/game/World/World.h @@ -555,6 +555,7 @@ struct CharacterNameData uint8 m_class; uint8 m_race; uint8 m_gender; + uint8 m_level; }; /// The World @@ -776,9 +777,10 @@ class World bool isEventKillStart; CharacterNameData const* GetCharacterNameData(uint32 guid) const; - void AddCharacterNameData(uint32 guid, std::string const& name, uint8 gender, uint8 race, uint8 playerClass); + void AddCharacterNameData(uint32 guid, std::string const& name, uint8 gender, uint8 race, uint8 playerClass, uint8 level); void UpdateCharacterNameData(uint32 guid, std::string const& name, uint8 gender = GENDER_NONE, uint8 race = RACE_NONE); - void DeleteCharaceterNameData(uint32 guid) { _characterNameDataMap.erase(guid); } + void UpdateCharacterNameDataLevel(uint32 guid, uint8 level); + void DeleteCharaceterNameData(uint32 guid) { _characterNameDataMap.erase(guid); }; uint32 GetCleaningFlags() const { return m_CleaningFlags; } void SetCleaningFlags(uint32 flags) { m_CleaningFlags = flags; } diff --git a/src/server/scripts/Commands/cs_character.cpp b/src/server/scripts/Commands/cs_character.cpp index 87948391500..9f910cbaf75 100644 --- a/src/server/scripts/Commands/cs_character.cpp +++ b/src/server/scripts/Commands/cs_character.cpp @@ -224,7 +224,7 @@ public: stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_NAME_DATA); stmt->setUInt32(0, delInfo.lowGuid); if (PreparedQueryResult result = CharacterDatabase.Query(stmt)) - sWorld->AddCharacterNameData(delInfo.lowGuid, delInfo.name, (*result)[2].GetUInt8(), (*result)[0].GetUInt8(), (*result)[1].GetUInt8()); + sWorld->AddCharacterNameData(delInfo.lowGuid, delInfo.name, (*result)[2].GetUInt8(), (*result)[0].GetUInt8(), (*result)[1].GetUInt8(), (*result)[2].GetUInt8()); } static void HandleCharacterLevel(Player* player, uint64 playerGuid, uint32 oldLevel, uint32 newLevel, ChatHandler* handler) diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp old mode 100755 new mode 100644 index 3d848f94c00..a335d8bc4fe --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -49,7 +49,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_SEL_CHAR_RACE, "SELECT race FROM characters WHERE guid = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_SEL_CHAR_LEVEL, "SELECT level FROM characters WHERE guid = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_SEL_CHAR_ZONE, "SELECT zone FROM characters WHERE guid = ?", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_SEL_CHARACTER_NAME_DATA, "SELECT race, class, gender FROM characters WHERE guid = ?", CONNECTION_SYNCH); + PREPARE_STATEMENT(CHAR_SEL_CHARACTER_NAME_DATA, "SELECT race, class, gender, level FROM characters WHERE guid = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_SEL_CHAR_POSITION_XYZ, "SELECT map, position_x, position_y, position_z FROM characters WHERE guid = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_SEL_CHAR_POSITION, "SELECT position_x, position_y, position_z, orientation, map, taxi_path FROM characters WHERE guid = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(CHAR_DEL_QUEST_STATUS_DAILY, "DELETE FROM character_queststatus_daily", CONNECTION_ASYNC); @@ -580,4 +580,10 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_SEL_CHAR_CUF_PROFILES, "SELECT id, name, frameHeight, frameWidth, sortBy, healthText, boolOptions, unk146, unk147, unk148, unk150, unk152, unk154 FROM character_cuf_profiles WHERE guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_REP_CHAR_CUF_PROFILES, "REPLACE INTO character_cuf_profiles (guid, id, name, frameHeight, frameWidth, sortBy, healthText, boolOptions, unk146, unk147, unk148, unk150, unk152, unk154) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_DEL_CHAR_CUF_PROFILES, "DELETE FROM character_cuf_profiles WHERE guid = ? and id = ?", CONNECTION_ASYNC); + + // Guild Finder + PREPARE_STATEMENT(CHAR_REP_GUILD_FINDER_APPLICANT, "REPLACE INTO guild_finder_applicant (guildId, playerGuid, availability, classRole, interests, comment, submitTime) VALUES(?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_GUILD_FINDER_APPLICANT, "DELETE FROM guild_finder_applicant WHERE guildId = ? AND playerGuid = ?", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_REP_GUILD_FINDER_GUILD_SETTINGS, "REPLACE INTO guild_finder_guild_settings (guildId, availability, classRoles, interests, level, listed, comment) VALUES(?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_DEL_GUILD_FINDER_GUILD_SETTINGS, "DELETE FROM guild_finder_guild_settings WHERE guildId = ?", CONNECTION_ASYNC); } diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.h b/src/server/shared/Database/Implementation/CharacterDatabase.h index 20454798f98..93bcb1d70ab 100755 --- a/src/server/shared/Database/Implementation/CharacterDatabase.h +++ b/src/server/shared/Database/Implementation/CharacterDatabase.h @@ -541,6 +541,11 @@ enum CharacterDatabaseStatements CHAR_REP_CHAR_CUF_PROFILES, CHAR_DEL_CHAR_CUF_PROFILES, + CHAR_REP_GUILD_FINDER_APPLICANT, + CHAR_DEL_GUILD_FINDER_APPLICANT, + CHAR_REP_GUILD_FINDER_GUILD_SETTINGS, + CHAR_DEL_GUILD_FINDER_GUILD_SETTINGS, + MAX_CHARACTERDATABASE_STATEMENTS, }; -- cgit v1.2.3 From 4e0314e9546a6cda849533e6abebc931b954987d Mon Sep 17 00:00:00 2001 From: Warpten Date: Sun, 9 Sep 2012 21:03:28 +0200 Subject: Core/GuildFinder: Fix SMSG_LF_GUILD_POST_UPDATED, thanks @Shauren. --- src/server/game/Handlers/GuildFinderHandler.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/GuildFinderHandler.cpp b/src/server/game/Handlers/GuildFinderHandler.cpp index af57a5908f8..facbd98ffac 100644 --- a/src/server/game/Handlers/GuildFinderHandler.cpp +++ b/src/server/game/Handlers/GuildFinderHandler.cpp @@ -351,14 +351,13 @@ void WorldSession::HandleGuildFinderPostRequest(WorldPacket& /*recvPacket*/) LFGuildSettings settings = sGuildFinderMgr->GetGuildSettings(player->GetGuildId()); - /// Client does not seem to receive correct data as only the comment is correctly displayed. WorldPacket data(SMSG_LF_GUILD_POST_UPDATED, 35); data.WriteBit(isGuildMaster); // Guessed if (isGuildMaster) { - data.WriteBits(settings.GetComment().size(), 11); data.WriteBit(settings.IsListed()); + data.WriteBits(settings.GetComment().size(), 11); data << uint32(settings.GetLevel()); data.WriteString(settings.GetComment()); data << uint32(0); // Unk Int32 -- cgit v1.2.3 From a6c9cb00be419845655fcb50d23806236d3849a0 Mon Sep 17 00:00:00 2001 From: Warpten Date: Mon, 10 Sep 2012 12:28:40 +0200 Subject: Core/GuildFinder: Fixed a possible crash caused by membership requests left after a character is deleted. --- src/server/game/Guilds/GuildFinderMgr.cpp | 34 ++++++++++++++++++++++++--- src/server/game/Guilds/GuildFinderMgr.h | 6 +++++ src/server/game/Handlers/CharacterHandler.cpp | 4 +++- src/server/game/World/World.h | 2 +- 4 files changed, 41 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/server/game/Guilds/GuildFinderMgr.cpp b/src/server/game/Guilds/GuildFinderMgr.cpp index 71a1a9ded0d..c81abeec47a 100644 --- a/src/server/game/Guilds/GuildFinderMgr.cpp +++ b/src/server/game/Guilds/GuildFinderMgr.cpp @@ -137,6 +137,34 @@ void GuildFinderMgr::AddMembershipRequest(uint32 guildGuid, MembershipRequest co SendApplicantListUpdate(*guild); } +void GuildFinderMgr::RemoveAllMembershipRequestsFromPlayer(uint32 playerId) +{ + for (MembershipRequestStore::iterator itr = _membershipRequests.begin(); itr != _membershipRequests.end(); ++itr) + { + std::vector::iterator itr2 = itr->second.begin(); + for(; itr2 != itr->second.end(); ++itr2) + if (itr2->GetPlayerGUID() == playerId) + break; + + if (itr2 == itr->second.end()) + return; + + SQLTransaction trans = CharacterDatabase.BeginTransaction(); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_FINDER_APPLICANT); + stmt->setUInt32(0, itr2->GetGuildId()); + stmt->setUInt32(1, itr2->GetPlayerGUID()); + trans->Append(stmt); + + CharacterDatabase.CommitTransaction(trans); + itr->second.erase(itr2); + + // Notify the guild master and officers the list changed + if (Guild* guild = sGuildMgr->GetGuildById(itr->first)) + SendApplicantListUpdate(*guild); + } +} + void GuildFinderMgr::RemoveMembershipRequest(uint32 playerId, uint32 guildId) { std::vector::iterator itr = _membershipRequests[guildId].begin(); @@ -150,8 +178,8 @@ void GuildFinderMgr::RemoveMembershipRequest(uint32 playerId, uint32 guildId) SQLTransaction trans = CharacterDatabase.BeginTransaction(); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_FINDER_APPLICANT); - stmt->setUInt32(0, (*itr).GetGuildId()); - stmt->setUInt32(1, (*itr).GetPlayerGUID()); + stmt->setUInt32(0, itr->GetGuildId()); + stmt->setUInt32(1, itr->GetPlayerGUID()); trans->Append(stmt); CharacterDatabase.CommitTransaction(trans); @@ -271,7 +299,7 @@ void GuildFinderMgr::DeleteGuild(uint32 guildId) trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_FINDER_GUILD_SETTINGS); - stmt->setUInt32(0, (*itr).GetGuildId()); + stmt->setUInt32(0, itr->GetGuildId()); trans->Append(stmt); CharacterDatabase.CommitTransaction(trans); diff --git a/src/server/game/Guilds/GuildFinderMgr.h b/src/server/game/Guilds/GuildFinderMgr.h index 049071dbca9..169b42740aa 100644 --- a/src/server/game/Guilds/GuildFinderMgr.h +++ b/src/server/game/Guilds/GuildFinderMgr.h @@ -224,6 +224,12 @@ class GuildFinderMgr */ void AddMembershipRequest(uint32 guildGuid, MembershipRequest const& request); + /** + * @brief Removes all membership request from a player. + * @param playerId The player's database guid whose application shall be deleted. + */ + void RemoveAllMembershipRequestsFromPlayer(uint32 playerId); + /** * @brief Removes a membership request to a guild. * @param playerId The player's database guid whose application shall be deleted. diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 33ffb5ba169..70c1bc5955b 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -30,6 +30,7 @@ #include "Chat.h" #include "Group.h" #include "Guild.h" +#include "GuildFinderMgr.h" #include "Language.h" #include "Log.h" #include "Opcodes.h" @@ -742,7 +743,7 @@ void WorldSession::HandleCharDeleteOpcode(WorldPacket & recvData) std::string IP_str = GetRemoteAddress(); sLog->outInfo(LOG_FILTER_CHARACTER, "Account: %d (IP: %s) Delete Character:[%s] (GUID: %u)", GetAccountId(), IP_str.c_str(), name.c_str(), GUID_LOPART(guid)); sScriptMgr->OnPlayerDelete(guid); - sWorld->DeleteCharaceterNameData(GUID_LOPART(guid)); + sWorld->DeleteCharacterNameData(GUID_LOPART(guid)); if (sLog->ShouldLog(LOG_FILTER_PLAYER_DUMP, LOG_LEVEL_INFO)) // optimize GetPlayerDump call { @@ -751,6 +752,7 @@ void WorldSession::HandleCharDeleteOpcode(WorldPacket & recvData) sLog->outCharDump(dump.c_str(), GetAccountId(), GUID_LOPART(guid), name.c_str()); } + sGuildFinderMgr->RemoveAllMembershipRequestsFromPlayer(guid); Player::DeleteFromDB(guid, GetAccountId()); WorldPacket data(SMSG_CHAR_DELETE, 1); diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h index 83746bb6022..b8243cb0531 100755 --- a/src/server/game/World/World.h +++ b/src/server/game/World/World.h @@ -780,7 +780,7 @@ class World void AddCharacterNameData(uint32 guid, std::string const& name, uint8 gender, uint8 race, uint8 playerClass, uint8 level); void UpdateCharacterNameData(uint32 guid, std::string const& name, uint8 gender = GENDER_NONE, uint8 race = RACE_NONE); void UpdateCharacterNameDataLevel(uint32 guid, uint8 level); - void DeleteCharaceterNameData(uint32 guid) { _characterNameDataMap.erase(guid); }; + void DeleteCharacterNameData(uint32 guid) { _characterNameDataMap.erase(guid); } uint32 GetCleaningFlags() const { return m_CleaningFlags; } void SetCleaningFlags(uint32 flags) { m_CleaningFlags = flags; } -- cgit v1.2.3 From dd7e73b34735dc742fae27d17da6ba75f7e31b40 Mon Sep 17 00:00:00 2001 From: Subv Date: Mon, 10 Sep 2012 18:01:29 -0500 Subject: Core/Spells: Send SMSG_SPELL_[START/GO] also for spells with SPELL_ATTR8_AURA_SEND_AMOUNT --- src/server/game/Spells/Spell.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 9e25ad25e12..147f21c882e 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -6520,7 +6520,7 @@ bool Spell::IsAutoActionResetSpell() const bool Spell::IsNeedSendToClient() const { return m_spellInfo->SpellVisual[0] || m_spellInfo->SpellVisual[1] || m_spellInfo->IsChanneled() || - m_spellInfo->Speed > 0.0f || (!m_triggeredByAuraSpell && !IsTriggered()); + (m_spellInfo->AttributesEx8 & SPELL_ATTR8_AURA_SEND_AMOUNT) || m_spellInfo->Speed > 0.0f || (!m_triggeredByAuraSpell && !IsTriggered()); } bool Spell::HaveTargetsForEffect(uint8 effect) const -- cgit v1.2.3 From 7bfd36ae80369b897c7159024c468074e407178d Mon Sep 17 00:00:00 2001 From: Subv Date: Mon, 10 Sep 2012 18:20:26 -0500 Subject: Core/Spells: Fixed SPELL_AURA_CAST_WHILE_WALKING --- src/server/game/Entities/Unit/Unit.cpp | 4 +++- src/server/game/Spells/Auras/SpellAuraDefines.h | 2 +- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 2 +- src/server/game/Spells/Spell.cpp | 11 ++++++++--- 4 files changed, 13 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 7886c0354f5..10e13ec0077 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -2700,7 +2700,9 @@ void Unit::_UpdateSpells(uint32 time) void Unit::_UpdateAutoRepeatSpell() { // check "realtime" interrupts - if ((GetTypeId() == TYPEID_PLAYER && ToPlayer()->isMoving()) || IsNonMeleeSpellCasted(false, false, true, m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo->Id == 75)) + // don't cancel spells which are affected by a SPELL_AURA_CAST_WHILE_WALKING effect + if (((GetTypeId() == TYPEID_PLAYER && ToPlayer()->isMoving()) || IsNonMeleeSpellCasted(false, false, true, m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo->Id == 75)) && + !HasAuraTypeWithAffectMask(SPELL_AURA_CAST_WHILE_WALKING, m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo)) { // cancel wand shoot if (m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo->Id != 75) diff --git a/src/server/game/Spells/Auras/SpellAuraDefines.h b/src/server/game/Spells/Auras/SpellAuraDefines.h index c20397aa960..35b4f692075 100755 --- a/src/server/game/Spells/Auras/SpellAuraDefines.h +++ b/src/server/game/Spells/Auras/SpellAuraDefines.h @@ -389,7 +389,7 @@ enum AuraType SPELL_AURA_327 = 327, SPELL_AURA_PROC_ON_POWER_AMOUNT = 328, SPELL_AURA_MOD_RUNE_REGEN_SPEED = 329, // NYI - SPELL_AURA_CAST_WHILE_WALKING = 330, // NYI + SPELL_AURA_CAST_WHILE_WALKING = 330, SPELL_AURA_331 = 331, SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS = 332, SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS_2 = 333, diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 746a0ac238f..64025fc685f 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -385,7 +385,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleUnused, //327 unused (4.3.4) &AuraEffect::HandleNoImmediateEffect, //328 SPELL_AURA_PROC_ON_POWER_AMOUNT implemented in Unit::HandleAuraProcOnPowerAmount &AuraEffect::HandleNULL, //329 SPELL_AURA_MOD_RUNE_REGEN_SPEED - &AuraEffect::HandleNULL, //330 SPELL_AURA_CAST_WHILE_WALKING + &AuraEffect::HandleNoImmediateEffect, //330 SPELL_AURA_CAST_WHILE_WALKING &AuraEffect::HandleNULL, //331 SPELL_AURA_331 &AuraEffect::HandleNoImmediateEffect, //332 SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS implemented in WorldSession::HandleCastSpellOpcode &AuraEffect::HandleNoImmediateEffect, //333 SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS_2 implemented in WorldSession::HandleCastSpellOpcode diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 147f21c882e..bc4e88bda2e 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3011,7 +3011,9 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered // don't allow channeled spells / spells with cast time to be casted while moving // (even if they are interrupted on moving, spells with almost immediate effect get to have their effect processed before movement interrupter kicks in) - if ((m_spellInfo->IsChanneled() || m_casttime) && m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->isMoving() && m_spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_MOVEMENT) + // don't cancel spells which are affected by a SPELL_AURA_CAST_WHILE_WALKING effect + if (((m_spellInfo->IsChanneled() || m_casttime) && m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->isMoving() && + m_spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_MOVEMENT) && !HasAuraTypeWithAffectMask(SPELL_AURA_CAST_WHILE_WALKING, m_spellInfo)) { SendCastResult(SPELL_FAILED_MOVING); finish(false); @@ -3530,9 +3532,11 @@ void Spell::update(uint32 difftime) } // check if the player caster has moved before the spell finished + // with the exception of spells affected with SPELL_AURA_CAST_WHILE_WALKING effect if ((m_caster->GetTypeId() == TYPEID_PLAYER && m_timer != 0) && m_caster->isMoving() && (m_spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_MOVEMENT) && - (m_spellInfo->Effects[0].Effect != SPELL_EFFECT_STUCK || !m_caster->HasUnitMovementFlag(MOVEMENTFLAG_FALLING_FAR))) + (m_spellInfo->Effects[0].Effect != SPELL_EFFECT_STUCK || !m_caster->HasUnitMovementFlag(MOVEMENTFLAG_FALLING_FAR)) && + !HasAuraTypeWithAffectMask(SPELL_AURA_CAST_WHILE_WALKING, m_spellInfo)) { // don't cancel for melee, autorepeat, triggered and instant spells if (!IsNextMeleeSwingSpell() && !IsAutoRepeat() && !IsTriggered()) @@ -4789,7 +4793,8 @@ SpellCastResult Spell::CheckCast(bool strict) // cancel autorepeat spells if cast start when moving // (not wand currently autorepeat cast delayed to moving stop anyway in spell update code) - if (m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->ToPlayer()->isMoving()) + // Do not cancel spells which are affected by a SPELL_AURA_CAST_WHILE_WALKING effect + if (m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->ToPlayer()->isMoving() && !HasAuraTypeWithAffectMask(SPELL_AURA_CAST_WHILE_WALKING, m_spellInfo)) { // skip stuck spell to allow use it in falling case and apply spell limitations at movement if ((!m_caster->HasUnitMovementFlag(MOVEMENTFLAG_FALLING_FAR) || m_spellInfo->Effects[0].Effect != SPELL_EFFECT_STUCK) && -- cgit v1.2.3 From dd9d7e6870f32a76da99f00d9c16812332a9e2f8 Mon Sep 17 00:00:00 2001 From: Subv Date: Mon, 10 Sep 2012 18:43:06 -0500 Subject: Core/Spells: Fixed SPELL_AURA_DEPOSIT_BONUS_MONEY_IN_GUILD_BANK_ON_LOOT --- src/server/game/Guilds/Guild.cpp | 9 +++++---- src/server/game/Guilds/Guild.h | 2 +- src/server/game/Handlers/LootHandler.cpp | 20 ++++++++++++++++++++ src/server/game/Spells/Auras/SpellAuraEffects.cpp | 6 +++--- 4 files changed, 29 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 92191551858..13c85cc954f 100644 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -1851,7 +1851,7 @@ void Guild::HandleRemoveRank(WorldSession* session, uint32 rankId) } } -void Guild::HandleMemberDepositMoney(WorldSession* session, uint32 amount) +void Guild::HandleMemberDepositMoney(WorldSession* session, uint32 amount, bool cashFlow /*=false*/) { Player* player = session->GetPlayer(); @@ -1872,11 +1872,12 @@ void Guild::HandleMemberDepositMoney(WorldSession* session, uint32 amount) player->GetName(), player->GetSession()->GetAccountId(), amount, m_id); } // Log guild bank event - _LogBankEvent(trans, GUILD_BANK_LOG_DEPOSIT_MONEY, uint8(0), player->GetGUIDLow(), amount); + _LogBankEvent(trans, cashFlow ? GUILD_BANK_LOG_CASH_FLOW_DEPOSIT : GUILD_BANK_LOG_DEPOSIT_MONEY, uint8(0), player->GetGUIDLow(), amount); CharacterDatabase.CommitTransaction(trans); - - SendBankList(session, 0, false, false); + + if (!cashFlow) + SendBankList(session, 0, false, false); } bool Guild::HandleMemberWithdrawMoney(WorldSession* session, uint32 amount, bool repair) diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h index f644e5d3592..6180a2ea355 100755 --- a/src/server/game/Guilds/Guild.h +++ b/src/server/game/Guilds/Guild.h @@ -718,7 +718,7 @@ public: void HandleSetMemberRank(WorldSession* session, uint64 targetGuid, uint64 setterGuid, uint32 rank); void HandleAddNewRank(WorldSession* session, const std::string& name); void HandleRemoveRank(WorldSession* session, uint32 rankId); - void HandleMemberDepositMoney(WorldSession* session, uint32 amount); + void HandleMemberDepositMoney(WorldSession* session, uint32 amount, bool cashFlow = false); bool HandleMemberWithdrawMoney(WorldSession* session, uint32 amount, bool repair = false); void HandleMemberLogout(WorldSession* session); void HandleDisband(WorldSession* session); diff --git a/src/server/game/Handlers/LootHandler.cpp b/src/server/game/Handlers/LootHandler.cpp index aa4b7b85023..897f03d0850 100755 --- a/src/server/game/Handlers/LootHandler.cpp +++ b/src/server/game/Handlers/LootHandler.cpp @@ -181,9 +181,19 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket& /*recvData*/) (*i)->ModifyMoney(goldPerPlayer); (*i)->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_MONEY, goldPerPlayer); + uint32 guildGold = 0; + + if (Guild* guild = sGuildMgr->GetGuildById((*i)->GetGuildId())) + { + guildGold = CalculatePctN(goldPerPlayer, (*i)->GetTotalAuraModifier(SPELL_AURA_DEPOSIT_BONUS_MONEY_IN_GUILD_BANK_ON_LOOT)); + if (guildGold) + guild->HandleMemberDepositMoney(this, guildGold, true); + } + WorldPacket data(SMSG_LOOT_MONEY_NOTIFY, 4 + 1); data << uint32(goldPerPlayer); data << uint8(playersNear.size() > 1 ? 0 : 1); // Controls the text displayed in chat. 0 is "Your share is..." and 1 is "You loot..." + data << uint32(guildGold); (*i)->GetSession()->SendPacket(&data); } } @@ -192,9 +202,19 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket& /*recvData*/) player->ModifyMoney(loot->gold); player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_MONEY, loot->gold); + uint32 guildGold = 0; + + if (Guild* guild = sGuildMgr->GetGuildById(player->GetGuildId())) + { + guildGold = CalculatePctN(loot->gold, player->GetTotalAuraModifier(SPELL_AURA_DEPOSIT_BONUS_MONEY_IN_GUILD_BANK_ON_LOOT)); + if (guildGold) + guild->HandleMemberDepositMoney(this, guildGold, true); + } + WorldPacket data(SMSG_LOOT_MONEY_NOTIFY, 4 + 1); data << uint32(loot->gold); data << uint8(1); // "You loot..." + data << uint32(guildGold); SendPacket(&data); } diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 64025fc685f..04ad2eb99f3 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -392,7 +392,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleNULL, //334 SPELL_AURA_334 &AuraEffect::HandleNULL, //335 SPELL_AURA_335 &AuraEffect::HandleNULL, //336 SPELL_AURA_MOD_FLYING_RESTRICTIONS - &AuraEffect::HandleNULL, //337 SPELL_AURA_MOD_VENDOR_ITEMS_PRICES + &AuraEffect::HandleNoImmediateEffect, //337 SPELL_AURA_MOD_VENDOR_ITEMS_PRICES &AuraEffect::HandleNoImmediateEffect, //338 SPELL_AURA_MOD_DURABILITY_LOSS &AuraEffect::HandleNULL, //339 SPELL_AURA_INCREASE_SKILL_GAIN_CHANCE &AuraEffect::HandleNULL, //340 SPELL_AURA_340 @@ -400,10 +400,10 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleModMeleeRangedSpeedPct, //342 SPELL_AURA_MOD_MELEE_RANGED_HASTE_2 &AuraEffect::HandleNULL, //343 SPELL_AURA_343 &AuraEffect::HandleNULL, //344 SPELL_AURA_MOD_AUTOATTACK_DAMAGE - &AuraEffect::HandleNULL, //345 SPELL_AURA_BYPASS_ARMOR_FOR_CASTER + &AuraEffect::HandleNoImmediateEffect, //345 SPELL_AURA_BYPASS_ARMOR_FOR_CASTER &AuraEffect::HandleNULL, //346 SPELL_AURA_PROGRESS_BAR &AuraEffect::HandleNULL, //347 SPELL_AURA_MOD_SPELL_COOLDOWN_BY_HASTE - &AuraEffect::HandleNULL, //348 SPELL_AURA_DEPOSIT_BONUS_MONEY_IN_GUILD_BANK_ON_LOOT + &AuraEffect::HandleNoImmediateEffect, //348 SPELL_AURA_DEPOSIT_BONUS_MONEY_IN_GUILD_BANK_ON_LOOT &AuraEffect::HandleNULL, //349 SPELL_AURA_MOD_CURRENCY_GAIN &AuraEffect::HandleNULL, //350 SPELL_AURA_MOD_GATHERING_ITEMS_GAINED_PERCENT &AuraEffect::HandleNULL, //351 SPELL_AURA_351 -- cgit v1.2.3 From 6a1f4f1da095d64a510a5869629806350c7ad734 Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 11 Sep 2012 01:19:11 +0100 Subject: Resolve merge issues and cleanup whitespace --- src/server/game/Battlefield/Battlefield.h | 3 ++- src/server/game/DataStores/DBCEnums.h | 2 +- src/server/game/Entities/Player/Player.h | 3 ++- src/server/game/Entities/Unit/Unit.cpp | 2 +- src/server/game/Guilds/Guild.cpp | 2 +- src/server/game/Guilds/GuildFinderMgr.cpp | 18 +++++++++--------- src/server/game/Guilds/GuildFinderMgr.h | 6 +++--- src/server/game/Handlers/GuildFinderHandler.cpp | 12 ++++++------ src/server/game/Handlers/LootHandler.cpp | 4 ++-- src/server/game/Miscellaneous/SharedDefines.h | 4 ++-- src/server/game/Spells/Spell.cpp | 2 +- 11 files changed, 30 insertions(+), 28 deletions(-) (limited to 'src') diff --git a/src/server/game/Battlefield/Battlefield.h b/src/server/game/Battlefield/Battlefield.h index 8dc598d1b10..520f6a8c2a7 100644 --- a/src/server/game/Battlefield/Battlefield.h +++ b/src/server/game/Battlefield/Battlefield.h @@ -29,7 +29,8 @@ enum BattlefieldTypes { - BATTLEFIELD_WG // Wintergrasp + BATTLEFIELD_WG, // Wintergrasp + BATTLEFIELD_TB // Tol Barad (cataclysm) }; enum BattlefieldIDs diff --git a/src/server/game/DataStores/DBCEnums.h b/src/server/game/DataStores/DBCEnums.h index c1d445a93e2..b6ae93f9bb8 100755 --- a/src/server/game/DataStores/DBCEnums.h +++ b/src/server/game/DataStores/DBCEnums.h @@ -490,7 +490,7 @@ enum SummonPropFlags SUMMON_PROP_FLAG_UNK13 = 0x00001000, // Lightwell, Jeeves, Gnomish Alarm-o-bot, Build vehicles(wintergrasp) SUMMON_PROP_FLAG_UNK14 = 0x00002000, // Guides, player follows SUMMON_PROP_FLAG_UNK15 = 0x00004000, // Force of Nature, Shadowfiend, Feral Spirit, Summon Water Elemental - SUMMON_PROP_FLAG_UNK16 = 0x00008000 // Light/Dark Bullet, Soul/Fiery Consumption, Twisted Visage, Twilight Whelp. Phase related? + SUMMON_PROP_FLAG_UNK16 = 0x00008000, // Light/Dark Bullet, Soul/Fiery Consumption, Twisted Visage, Twilight Whelp. Phase related? SUMMON_PROP_FLAG_UNK17 = 0x00010000, SUMMON_PROP_FLAG_UNK18 = 0x00020000, SUMMON_PROP_FLAG_UNK19 = 0x00040000, diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 74fe8b9181f..89c82736335 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -887,7 +887,8 @@ enum PlayerLoginQueryIndex PLAYER_LOGIN_QUERY_LOADSEASONALQUESTSTATUS = 31, PLAYER_LOGIN_QUERY_LOADVOIDSTORAGE = 32, PLAYER_LOGIN_QUERY_LOADCURRENCY = 33, - PLAYER_LOGIN_QUERY_LOAD_CUF_PROFILES = 34 + PLAYER_LOGIN_QUERY_LOAD_CUF_PROFILES = 34, + MAX_PLAYER_LOGIN_QUERY }; enum PlayerDelayedOperations diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index b2953011e6c..5407cbd274e 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -2714,7 +2714,7 @@ void Unit::_UpdateAutoRepeatSpell() { // check "realtime" interrupts // don't cancel spells which are affected by a SPELL_AURA_CAST_WHILE_WALKING effect - if (((GetTypeId() == TYPEID_PLAYER && ToPlayer()->isMoving()) || IsNonMeleeSpellCasted(false, false, true, m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo->Id == 75)) && + if (((GetTypeId() == TYPEID_PLAYER && ToPlayer()->isMoving()) || IsNonMeleeSpellCasted(false, false, true, m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo->Id == 75)) && !HasAuraTypeWithAffectMask(SPELL_AURA_CAST_WHILE_WALKING, m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo)) { // cancel wand shoot diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 13c85cc954f..23003fdf367 100644 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -1875,7 +1875,7 @@ void Guild::HandleMemberDepositMoney(WorldSession* session, uint32 amount, bool _LogBankEvent(trans, cashFlow ? GUILD_BANK_LOG_CASH_FLOW_DEPOSIT : GUILD_BANK_LOG_DEPOSIT_MONEY, uint8(0), player->GetGUIDLow(), amount); CharacterDatabase.CommitTransaction(trans); - + if (!cashFlow) SendBankList(session, 0, false, false); } diff --git a/src/server/game/Guilds/GuildFinderMgr.cpp b/src/server/game/Guilds/GuildFinderMgr.cpp index c81abeec47a..461c3093cd4 100644 --- a/src/server/game/Guilds/GuildFinderMgr.cpp +++ b/src/server/game/Guilds/GuildFinderMgr.cpp @@ -42,13 +42,13 @@ void GuildFinderMgr::LoadGuildSettings() "FROM guild_finder_guild_settings gfgs " "LEFT JOIN guild_member gm ON gm.guildid=gfgs.guildId " "LEFT JOIN characters c ON c.guid = gm.guid LIMIT 1"); - + if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 guild finder guild-related settings. Table `guild_finder_guild_settings` is empty."); return; } - + uint32 count = 0; uint32 oldMSTime = getMSTime(); do @@ -69,7 +69,7 @@ void GuildFinderMgr::LoadGuildSettings() LFGuildSettings settings(listed, guildTeam, guildId, classRoles, availability, interests, level, comment); _guildSettings[guildId] = settings; - + ++count; } while (result->NextRow()); @@ -82,13 +82,13 @@ void GuildFinderMgr::LoadMembershipRequests() // 0 1 2 3 4 5 6 QueryResult result = CharacterDatabase.Query("SELECT guildId, playerGuid, availability, classRole, interests, comment, submitTime " "FROM guild_finder_applicant"); - + if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 guild finder membership requests. Table `guild_finder_applicant` is empty."); return; } - + uint32 count = 0; uint32 oldMSTime = getMSTime(); do @@ -101,11 +101,11 @@ void GuildFinderMgr::LoadMembershipRequests() uint8 interests = fields[4].GetUInt8(); std::string comment = fields[5].GetString(); uint32 submitTime = fields[6].GetUInt32(); - + MembershipRequest request(playerId, guildId, availability, classRoles, interests, comment, time_t(submitTime)); _membershipRequests[guildId].push_back(request); - + ++count; } while (result->NextRow()); @@ -115,7 +115,7 @@ void GuildFinderMgr::LoadMembershipRequests() void GuildFinderMgr::AddMembershipRequest(uint32 guildGuid, MembershipRequest const& request) { _membershipRequests[guildGuid].push_back(request); - + SQLTransaction trans = CharacterDatabase.BeginTransaction(); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_GUILD_FINDER_APPLICANT); stmt->setUInt32(0, request.GetGuildId()); @@ -301,7 +301,7 @@ void GuildFinderMgr::DeleteGuild(uint32 guildId) stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_FINDER_GUILD_SETTINGS); stmt->setUInt32(0, itr->GetGuildId()); trans->Append(stmt); - + CharacterDatabase.CommitTransaction(trans); _membershipRequests[guildId].erase(itr); diff --git a/src/server/game/Guilds/GuildFinderMgr.h b/src/server/game/Guilds/GuildFinderMgr.h index 169b42740aa..54faa83a002 100644 --- a/src/server/game/Guilds/GuildFinderMgr.h +++ b/src/server/game/Guilds/GuildFinderMgr.h @@ -72,7 +72,7 @@ struct MembershipRequest MembershipRequest(uint32 playerGUID, uint32 guildId, uint32 availability, uint32 classRoles, uint32 interests, std::string& comment, time_t submitTime) : _playerGUID(playerGUID), _guildId(guildId), _availability(availability), _classRoles(classRoles), _interests(interests), _time(submitTime), _comment(comment) {} - + MembershipRequest() : _playerGUID(0), _guildId(0), _availability(0), _classRoles(0), _interests(0), _time(time(NULL)) {} @@ -239,7 +239,7 @@ class GuildFinderMgr /// wipes everything related to a guild. Used when that guild is disbanded void DeleteGuild(uint32 guildId); - + /** * @brief Returns a set of membership requests for a guild * @param guildGuid The guild's database guid. @@ -264,7 +264,7 @@ class GuildFinderMgr /// Counts the amount of pending membership requests, given the player's db guid. uint8 CountRequestsFromPlayer(uint32 playerId); - + void SendApplicantListUpdate(Guild& guild); void SendMembershipRequestListUpdate(Player& player); }; diff --git a/src/server/game/Handlers/GuildFinderHandler.cpp b/src/server/game/Handlers/GuildFinderHandler.cpp index facbd98ffac..c017a10ca1a 100644 --- a/src/server/game/Handlers/GuildFinderHandler.cpp +++ b/src/server/game/Handlers/GuildFinderHandler.cpp @@ -82,7 +82,7 @@ void WorldSession::HandleGuildFinderBrowse(WorldPacket& recvPacket) uint32 playerLevel = 0; // Raw player level (1-85), do they use MAX_FINDER_LEVEL when on level 85 ? recvPacket >> classRoles >> availability >> guildInterests >> playerLevel; - + if (!(classRoles & GUILDFINDER_ALL_ROLES) || classRoles > GUILDFINDER_ALL_ROLES) return; if (!(availability & ALL_WEEK) || availability > ALL_WEEK) @@ -180,7 +180,7 @@ void WorldSession::HandleGuildFinderDeclineRecruit(WorldPacket& recvPacket) ObjectGuid playerGuid; - playerGuid[1] = recvPacket.ReadBit(); + playerGuid[1] = recvPacket.ReadBit(); playerGuid[4] = recvPacket.ReadBit(); playerGuid[5] = recvPacket.ReadBit(); playerGuid[2] = recvPacket.ReadBit(); @@ -252,7 +252,7 @@ void WorldSession::HandleGuildFinderGetApplications(WorldPacket& /*recvPacket*/) bufferData.WriteByteSeq(guildGuid[4]); bufferData.WriteByteSeq(guildGuid[1]); - + bufferData << uint32(time(NULL) - request.GetSubmitTime()); // Time since application (seconds) bufferData << uint32(guildSettings.GetInterests()); } @@ -301,9 +301,9 @@ void WorldSession::HandleGuildFinderGetRecruits(WorldPacket& recvPacket) data.WriteBit(playerGuid[6]); dataBuffer.WriteByteSeq(playerGuid[4]); - + dataBuffer << int32(time(NULL) <= request.GetExpiryTime()); - + dataBuffer.WriteByteSeq(playerGuid[3]); dataBuffer.WriteByteSeq(playerGuid[0]); dataBuffer.WriteByteSeq(playerGuid[1]); @@ -376,7 +376,7 @@ void WorldSession::HandleGuildFinderRemoveRecruit(WorldPacket& recvPacket) ObjectGuid guildGuid; - guildGuid[0] = recvPacket.ReadBit(); + guildGuid[0] = recvPacket.ReadBit(); guildGuid[4] = recvPacket.ReadBit(); guildGuid[3] = recvPacket.ReadBit(); guildGuid[5] = recvPacket.ReadBit(); diff --git a/src/server/game/Handlers/LootHandler.cpp b/src/server/game/Handlers/LootHandler.cpp index 897f03d0850..a243ef29c5c 100755 --- a/src/server/game/Handlers/LootHandler.cpp +++ b/src/server/game/Handlers/LootHandler.cpp @@ -182,7 +182,7 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket& /*recvData*/) (*i)->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_MONEY, goldPerPlayer); uint32 guildGold = 0; - + if (Guild* guild = sGuildMgr->GetGuildById((*i)->GetGuildId())) { guildGold = CalculatePctN(goldPerPlayer, (*i)->GetTotalAuraModifier(SPELL_AURA_DEPOSIT_BONUS_MONEY_IN_GUILD_BANK_ON_LOOT)); @@ -203,7 +203,7 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket& /*recvData*/) player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_MONEY, loot->gold); uint32 guildGold = 0; - + if (Guild* guild = sGuildMgr->GetGuildById(player->GetGuildId())) { guildGold = CalculatePctN(loot->gold, player->GetTotalAuraModifier(SPELL_AURA_DEPOSIT_BONUS_MONEY_IN_GUILD_BANK_ON_LOOT)); diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 89e66ccdb05..01d02939bb3 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -1276,7 +1276,7 @@ enum SpellCustomErrors SPELL_CUSTOM_ERROR_MAX_NUMBER_OF_RECRUITS = 96, // You already have the max number of recruits. SPELL_CUSTOM_ERROR_MAX_NUMBER_OF_VOLUNTEERS = 97, // You already have the max number of volunteers. SPELL_CUSTOM_ERROR_FROSTMOURNE_RENDERED_RESSURECT = 98, // Frostmourne has rendered you unable to ressurect. - SPELL_CUSTOM_ERROR_CANT_MOUNT_WITH_SHAPESHIFT = 99 // You can't mount while affected by that shapeshift. + SPELL_CUSTOM_ERROR_CANT_MOUNT_WITH_SHAPESHIFT = 99, // You can't mount while affected by that shapeshift. SPELL_CUSTOM_ERROR_FAWNS_ALREADY_FOLLOWING = 100, // Three fawns are already following you! SPELL_CUSTOM_ERROR_ALREADY_HAVE_RIVER_BOAT = 101, // You already have a River Boat. SPELL_CUSTOM_ERROR_NO_ACTIVE_ENCHANTMENT = 102, // You have no active enchantment to unleash. @@ -1298,7 +1298,7 @@ enum SpellCustomErrors SPELL_CUSTOM_ERROR_CANNOT_SUPERVISE_MORE_CULTISTS = 118, // You cannot supervise more than 5 Arrested Cultists at a time. SPELL_CUSTOM_ERROR_REQUIRES_LEVEL_85 = 119, // You must reach level 85 to use this portal. SPELL_CUSTOM_ERROR_MUST_BE_BELOW_35_HEALTH = 120, // Your target must be below 35% health. - SPELL_CUSTOM_ERROR_MUST_SELECT_TALENT_SPECIAL = 121, // You must select a talent specialization first. + SPELL_CUSTOM_ERROR_MUST_SELECT_TALENT_SPECIAL = 121 // You must select a talent specialization first. }; enum StealthType diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index f9b7dca2393..ea13b4a4bcc 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3012,7 +3012,7 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered // don't allow channeled spells / spells with cast time to be casted while moving // (even if they are interrupted on moving, spells with almost immediate effect get to have their effect processed before movement interrupter kicks in) // don't cancel spells which are affected by a SPELL_AURA_CAST_WHILE_WALKING effect - if (((m_spellInfo->IsChanneled() || m_casttime) && m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->isMoving() && + if (((m_spellInfo->IsChanneled() || m_casttime) && m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->isMoving() && m_spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_MOVEMENT) && !HasAuraTypeWithAffectMask(SPELL_AURA_CAST_WHILE_WALKING, m_spellInfo)) { SendCastResult(SPELL_FAILED_MOVING); -- cgit v1.2.3 From f236db6b266e23d9b9354c39a2d8d6f225541213 Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 11 Sep 2012 01:31:55 +0100 Subject: Fix build, thanks Vincent --- src/server/game/DataStores/DBCEnums.h | 2 +- src/server/game/Entities/Unit/Unit.h | 4 ++-- src/server/game/Guilds/Guild.h | 4 ++-- src/server/game/Handlers/LootHandler.cpp | 1 + src/server/game/Miscellaneous/SharedDefines.h | 8 ++++---- src/server/game/Spells/Spell.cpp | 6 +++--- src/server/game/Spells/SpellInfo.h | 4 ++-- 7 files changed, 15 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCEnums.h b/src/server/game/DataStores/DBCEnums.h index b6ae93f9bb8..07f68acfd68 100755 --- a/src/server/game/DataStores/DBCEnums.h +++ b/src/server/game/DataStores/DBCEnums.h @@ -495,7 +495,7 @@ enum SummonPropFlags SUMMON_PROP_FLAG_UNK18 = 0x00020000, SUMMON_PROP_FLAG_UNK19 = 0x00040000, SUMMON_PROP_FLAG_UNK20 = 0x00080000, - SUMMON_PROP_FLAG_UNK21 = 0x00100000, // Totems + SUMMON_PROP_FLAG_UNK21 = 0x00100000 // Totems }; enum VehicleSeatFlags diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 692fe734f60..327886adfec 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -673,10 +673,10 @@ enum NPCFlags UNIT_NPC_FLAG_STABLEMASTER = 0x00400000, // 100% UNIT_NPC_FLAG_GUILD_BANKER = 0x00800000, // cause client to send 997 opcode UNIT_NPC_FLAG_SPELLCLICK = 0x01000000, // cause client to send 1015 opcode (spell click) - UNIT_NPC_FLAG_PLAYER_VEHICLE = 0x02000000 // players with mounts that have vehicle data should have it set + UNIT_NPC_FLAG_PLAYER_VEHICLE = 0x02000000, // players with mounts that have vehicle data should have it set UNIT_NPC_FLAG_REFORGER = 0x08000000, // reforging UNIT_NPC_FLAG_TRANSMOGRIFIER = 0x10000000, // transmogrification - UNIT_NPC_FLAG_VAULTKEEPER = 0x20000000, // void storage + UNIT_NPC_FLAG_VAULTKEEPER = 0x20000000 // void storage }; enum MovementFlags diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h index 14015bd4eb3..58dedf0137a 100755 --- a/src/server/game/Guilds/Guild.h +++ b/src/server/game/Guilds/Guild.h @@ -156,9 +156,9 @@ enum PetitionTurns { PETITION_TURN_OK = 0, PETITION_TURN_ALREADY_IN_GUILD = 2, - PETITION_TURN_NEED_MORE_SIGNATURES = 4 + PETITION_TURN_NEED_MORE_SIGNATURES = 4, PETITION_TURN_GUILD_PERMISSIONS = 11, - PETITION_TURN_GUILD_NAME_INVALID = 12, + PETITION_TURN_GUILD_NAME_INVALID = 12 }; enum PetitionSigns diff --git a/src/server/game/Handlers/LootHandler.cpp b/src/server/game/Handlers/LootHandler.cpp index a243ef29c5c..8d815d6fb2d 100755 --- a/src/server/game/Handlers/LootHandler.cpp +++ b/src/server/game/Handlers/LootHandler.cpp @@ -29,6 +29,7 @@ #include "Group.h" #include "World.h" #include "Util.h" +#include "GuildMgr.h" void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket & recvData) { diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 01d02939bb3..9a31e7d792d 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -2923,12 +2923,12 @@ enum QuestSort QUEST_SORT_JEWELCRAFTING = 373, QUEST_SORT_NOBLEGARDEN = 374, QUEST_SORT_PILGRIMS_BOUNTY = 375, - QUEST_SORT_LOVE_IS_IN_THE_AIR = 376 + QUEST_SORT_LOVE_IS_IN_THE_AIR = 376, QUEST_SORT_ARCHAEOLOGY = 377, QUEST_SORT_CHILDRENS_WEEK = 378, QUEST_SORT_FIRELANDS_INVASION = 379, QUEST_SORT_ZANDALARI = 380, - QUEST_SORT_ELEMENTAL_BONDS = 381, + QUEST_SORT_ELEMENTAL_BONDS = 381 }; inline uint8 ClassByQuestSort(int32 QuestSort) @@ -3403,9 +3403,9 @@ enum SummonType SUMMON_TYPE_WILD3 = 8, SUMMON_TYPE_VEHICLE = 9, SUMMON_TYPE_VEHICLE2 = 10, - SUMMON_TYPE_OBJECT = 11 + SUMMON_TYPE_OBJECT = 11, SUMMON_TYPE_UNK12 = 12, - SUMMON_TYPE_UNK13 = 13, + SUMMON_TYPE_UNK13 = 13 }; enum EventId diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index ea13b4a4bcc..afcc08d59fe 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3013,7 +3013,7 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered // (even if they are interrupted on moving, spells with almost immediate effect get to have their effect processed before movement interrupter kicks in) // don't cancel spells which are affected by a SPELL_AURA_CAST_WHILE_WALKING effect if (((m_spellInfo->IsChanneled() || m_casttime) && m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->isMoving() && - m_spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_MOVEMENT) && !HasAuraTypeWithAffectMask(SPELL_AURA_CAST_WHILE_WALKING, m_spellInfo)) + m_spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_MOVEMENT) && !m_caster->HasAuraTypeWithAffectMask(SPELL_AURA_CAST_WHILE_WALKING, m_spellInfo)) { SendCastResult(SPELL_FAILED_MOVING); finish(false); @@ -3536,7 +3536,7 @@ void Spell::update(uint32 difftime) if ((m_caster->GetTypeId() == TYPEID_PLAYER && m_timer != 0) && m_caster->isMoving() && (m_spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_MOVEMENT) && (m_spellInfo->Effects[0].Effect != SPELL_EFFECT_STUCK || !m_caster->HasUnitMovementFlag(MOVEMENTFLAG_FALLING_FAR)) && - !HasAuraTypeWithAffectMask(SPELL_AURA_CAST_WHILE_WALKING, m_spellInfo)) + !m_caster->HasAuraTypeWithAffectMask(SPELL_AURA_CAST_WHILE_WALKING, m_spellInfo)) { // don't cancel for melee, autorepeat, triggered and instant spells if (!IsNextMeleeSwingSpell() && !IsAutoRepeat() && !IsTriggered()) @@ -4794,7 +4794,7 @@ SpellCastResult Spell::CheckCast(bool strict) // cancel autorepeat spells if cast start when moving // (not wand currently autorepeat cast delayed to moving stop anyway in spell update code) // Do not cancel spells which are affected by a SPELL_AURA_CAST_WHILE_WALKING effect - if (m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->ToPlayer()->isMoving() && !HasAuraTypeWithAffectMask(SPELL_AURA_CAST_WHILE_WALKING, m_spellInfo)) + if (m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->ToPlayer()->isMoving() && !m_caster->HasAuraTypeWithAffectMask(SPELL_AURA_CAST_WHILE_WALKING, m_spellInfo)) { // skip stuck spell to allow use it in falling case and apply spell limitations at movement if ((!m_caster->HasUnitMovementFlag(MOVEMENTFLAG_FALLING_FAR) || m_spellInfo->Effects[0].Effect != SPELL_EFFECT_STUCK) && diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h index 810bcd0c66d..9dcf0140933 100644 --- a/src/server/game/Spells/SpellInfo.h +++ b/src/server/game/Spells/SpellInfo.h @@ -165,9 +165,9 @@ enum SpellSpecificType SPELL_SPECIFIC_MAGE_ARCANE_BRILLANCE = 25, SPELL_SPECIFIC_WARRIOR_ENRAGE = 26, SPELL_SPECIFIC_PRIEST_DIVINE_SPIRIT = 27, - SPELL_SPECIFIC_HAND = 28 + SPELL_SPECIFIC_HAND = 28, SPELL_SPECIFIC_PHASE = 29, - SPELL_SPECIFIC_BANE = 30, + SPELL_SPECIFIC_BANE = 30 }; enum SpellCustomAttributes -- cgit v1.2.3 From b075d8cca7e147b97283fac71efb358f7354e1da Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 11 Sep 2012 01:40:58 +0100 Subject: Core/Loot: Re-fix structure of SMSG_LOOT_MONEY_NOTIFY --- src/server/game/Handlers/LootHandler.cpp | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/LootHandler.cpp b/src/server/game/Handlers/LootHandler.cpp index 8d815d6fb2d..155d6c73e9c 100755 --- a/src/server/game/Handlers/LootHandler.cpp +++ b/src/server/game/Handlers/LootHandler.cpp @@ -182,19 +182,13 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket& /*recvData*/) (*i)->ModifyMoney(goldPerPlayer); (*i)->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_MONEY, goldPerPlayer); - uint32 guildGold = 0; - if (Guild* guild = sGuildMgr->GetGuildById((*i)->GetGuildId())) - { - guildGold = CalculatePctN(goldPerPlayer, (*i)->GetTotalAuraModifier(SPELL_AURA_DEPOSIT_BONUS_MONEY_IN_GUILD_BANK_ON_LOOT)); - if (guildGold) + if (uint32 guildGold = CalculatePctN(goldPerPlayer, (*i)->GetTotalAuraModifier(SPELL_AURA_DEPOSIT_BONUS_MONEY_IN_GUILD_BANK_ON_LOOT))) guild->HandleMemberDepositMoney(this, guildGold, true); - } WorldPacket data(SMSG_LOOT_MONEY_NOTIFY, 4 + 1); data << uint32(goldPerPlayer); - data << uint8(playersNear.size() > 1 ? 0 : 1); // Controls the text displayed in chat. 0 is "Your share is..." and 1 is "You loot..." - data << uint32(guildGold); + data << uint8(playersNear.size() <= 1); // Controls the text displayed in chat. 0 is "Your share is..." and 1 is "You loot..." (*i)->GetSession()->SendPacket(&data); } } @@ -203,19 +197,13 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket& /*recvData*/) player->ModifyMoney(loot->gold); player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_MONEY, loot->gold); - uint32 guildGold = 0; - if (Guild* guild = sGuildMgr->GetGuildById(player->GetGuildId())) - { - guildGold = CalculatePctN(loot->gold, player->GetTotalAuraModifier(SPELL_AURA_DEPOSIT_BONUS_MONEY_IN_GUILD_BANK_ON_LOOT)); - if (guildGold) + if (uint32 guildGold = CalculatePctN(loot->gold, player->GetTotalAuraModifier(SPELL_AURA_DEPOSIT_BONUS_MONEY_IN_GUILD_BANK_ON_LOOT))) guild->HandleMemberDepositMoney(this, guildGold, true); - } WorldPacket data(SMSG_LOOT_MONEY_NOTIFY, 4 + 1); data << uint32(loot->gold); data << uint8(1); // "You loot..." - data << uint32(guildGold); SendPacket(&data); } -- cgit v1.2.3 From 3de6d44a0048df24267987d747b033c94c827ebc Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 11 Sep 2012 15:59:45 +0200 Subject: Core: Free memory allocated for opcode handlers at shutdown. --- src/server/game/Server/Protocol/Opcodes.cpp | 24 +++++++------- src/server/game/Server/Protocol/Opcodes.h | 49 ++++++++++++++++++++++++----- src/server/game/Server/WorldSession.cpp | 24 +++++++------- src/server/game/Server/WorldSocket.cpp | 4 +-- src/server/game/World/World.cpp | 2 +- 5 files changed, 67 insertions(+), 36 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index b1ef5bcb704..1b458920817 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -19,45 +19,43 @@ #include "Opcodes.h" #include "WorldSession.h" -OpcodeHandler* opcodeTable[NUM_OPCODE_HANDLERS] = { }; +OpcodeTable opcodeTable; template -inline void ValidateAndSetOpcode(uint16 /*opcode*/, char const* /*name*/, SessionStatus /*status*/, PacketProcessing /*processing*/, pOpcodeHandler /*handler*/) +void OpcodeTable::ValidateAndSetOpcode(uint16 /*opcode*/, char const* /*name*/, SessionStatus /*status*/, PacketProcessing /*processing*/, pOpcodeHandler /*handler*/) { // if for some reason we are here, that means NUM_OPCODE_HANDLERS == 0 (or your compiler is broken) } template<> -void ValidateAndSetOpcode(uint16 opcode, char const* name, SessionStatus status, PacketProcessing processing, pOpcodeHandler handler) +void OpcodeTable::ValidateAndSetOpcode(uint16 opcode, char const* name, SessionStatus status, PacketProcessing processing, pOpcodeHandler handler) { - if (opcodeTable[opcode] != NULL) + if (_internalTable[opcode] != NULL) { - sLog->outError(LOG_FILTER_NETWORKIO, "Tried to override handler of %s with %s (opcode %u)", opcodeTable[opcode]->name, name, opcode); + sLog->outError(LOG_FILTER_NETWORKIO, "Tried to override handler of %s with %s (opcode %u)", opcodeTable[opcode]->Name, name, opcode); return; } - opcodeTable[opcode] = new OpcodeHandler(name, status, processing, handler); + _internalTable[opcode] = new OpcodeHandler(name, status, processing, handler); } template<> -void ValidateAndSetOpcode(uint16 opcode, char const* /*name*/, SessionStatus /*status*/, PacketProcessing /*processing*/, pOpcodeHandler /*handler*/) +void OpcodeTable::ValidateAndSetOpcode(uint16 opcode, char const* /*name*/, SessionStatus /*status*/, PacketProcessing /*processing*/, pOpcodeHandler /*handler*/) { sLog->outError(LOG_FILTER_NETWORKIO, "Tried to set handler for an invalid opcode %d", opcode); } template<> -void ValidateAndSetOpcode(uint16 /*opcode*/, char const* name, SessionStatus /*status*/, PacketProcessing /*processing*/, pOpcodeHandler /*handler*/) +void OpcodeTable::ValidateAndSetOpcode(uint16 /*opcode*/, char const* name, SessionStatus /*status*/, PacketProcessing /*processing*/, pOpcodeHandler /*handler*/) { sLog->outError(LOG_FILTER_NETWORKIO, "Opcode %s got value 0", name); } -#define DEFINE_OPCODE_HANDLER(opcode, status, processing, handler) \ - ValidateAndSetOpcode<(opcode < NUM_OPCODE_HANDLERS), (opcode != 0)>(opcode, #opcode, status, processing, handler); - /// Correspondence between opcodes and their names -void InitOpcodes() +void OpcodeTable::Initialize() { - memset(opcodeTable, 0, sizeof(opcodeTable)); +#define DEFINE_OPCODE_HANDLER(opcode, status, processing, handler) \ + ValidateAndSetOpcode<(opcode < NUM_OPCODE_HANDLERS), (opcode != 0)>(opcode, #opcode, status, processing, handler); DEFINE_OPCODE_HANDLER(CMSG_ACCEPT_LEVEL_GRANT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAcceptGrantLevel ); DEFINE_OPCODE_HANDLER(CMSG_ACCEPT_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAcceptTradeOpcode ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index b67b84e7521..980a6c7d0d8 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -1420,15 +1420,48 @@ struct OpcodeHandler { OpcodeHandler() {} OpcodeHandler(char const* _name, SessionStatus _status, PacketProcessing _processing, pOpcodeHandler _handler) - : name(_name), status(_status), packetProcessing(_processing), handler(_handler) {} + : Name(_name), Status(_status), ProcessingPlace(_processing), Handler(_handler) {} - char const* name; - SessionStatus status; - PacketProcessing packetProcessing; - pOpcodeHandler handler; + char const* Name; + SessionStatus Status; + PacketProcessing ProcessingPlace; + pOpcodeHandler Handler; }; -extern OpcodeHandler* opcodeTable[NUM_OPCODE_HANDLERS]; +class OpcodeTable +{ + public: + OpcodeTable() + { + memset(_internalTable, 0, sizeof(_internalTable)); + } + + ~OpcodeTable() + { + for (uint16 i = 0; i < NUM_OPCODE_HANDLERS; ++i) + delete _internalTable[i]; + } + + void Initialize(); + + OpcodeHandler const* operator[](uint32 index) const + { + return _internalTable[index]; + } + + private: + template + void ValidateAndSetOpcode(uint16 opcode, char const* name, SessionStatus status, PacketProcessing processing, pOpcodeHandler handler); + + // Prevent copying this structure + OpcodeTable(OpcodeTable const&); + OpcodeTable& operator=(OpcodeTable& const); + + OpcodeHandler* _internalTable[NUM_OPCODE_HANDLERS]; +}; + +extern OpcodeTable opcodeTable; + void InitOpcodes(); /// Lookup opcode name for human understandable logging @@ -1440,9 +1473,9 @@ inline std::string GetOpcodeNameForLogging(Opcodes id) if (id < UNKNOWN_OPCODE) { - if (OpcodeHandler* handler = opcodeTable[uint32(id) & 0x7FFF]) + if (OpcodeHandler const* handler = opcodeTable[uint32(id) & 0x7FFF]) { - ss << handler->name; + ss << handler->Name; if (opcode & COMPRESSED_OPCODE_MASK) ss << "_COMPRESSED"; } diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index a2f2492b810..c9d12333b89 100644 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -52,11 +52,11 @@ bool MapSessionFilter::Process(WorldPacket* packet) OpcodeHandler const* opHandle = opcodeTable[opcode]; //let's check if our opcode can be really processed in Map::Update() - if (opHandle->packetProcessing == PROCESS_INPLACE) + if (opHandle->ProcessingPlace == PROCESS_INPLACE) return true; //we do not process thread-unsafe packets - if (opHandle->packetProcessing == PROCESS_THREADUNSAFE) + if (opHandle->ProcessingPlace == PROCESS_THREADUNSAFE) return false; Player* player = m_pSession->GetPlayer(); @@ -74,11 +74,11 @@ bool WorldSessionFilter::Process(WorldPacket* packet) Opcodes opcode = DropHighBytes(packet->GetOpcode()); OpcodeHandler const* opHandle = opcodeTable[opcode]; //check if packet handler is supposed to be safe - if (opHandle->packetProcessing == PROCESS_INPLACE) + if (opHandle->ProcessingPlace == PROCESS_INPLACE) return true; //thread-unsafe packets should be processed in World::UpdateSessions() - if (opHandle->packetProcessing == PROCESS_THREADUNSAFE) + if (opHandle->ProcessingPlace == PROCESS_THREADUNSAFE) return true; //no player attached? -> our client! ^^ @@ -213,8 +213,8 @@ void WorldSession::SendPacket(WorldPacket const* packet, bool forced /*= false*/ if (!forced) { - OpcodeHandler* handler = opcodeTable[packet->GetOpcode()]; - if (!handler || handler->status == STATUS_UNHANDLED) + OpcodeHandler const* handler = opcodeTable[packet->GetOpcode()]; + if (!handler || handler->Status == STATUS_UNHANDLED) { sLog->outError(LOG_FILTER_OPCODES, "Prevented sending disabled opcode %s to %s", GetOpcodeNameForLogging(packet->GetOpcode()).c_str(), GetPlayerName(false).c_str()); return; @@ -307,11 +307,11 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) !_recvQueue.empty() && _recvQueue.peek(true) != firstDelayedPacket && _recvQueue.next(packet, updater)) { - const OpcodeHandler* opHandle = opcodeTable[packet->GetOpcode()]; + OpcodeHandler const* opHandle = opcodeTable[packet->GetOpcode()]; try { - switch (opHandle->status) + switch (opHandle->Status) { case STATUS_LOGGEDIN: if (!_player) @@ -335,7 +335,7 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) else if (_player->IsInWorld()) { sScriptMgr->OnPacketReceive(m_Socket, WorldPacket(*packet)); - (this->*opHandle->handler)(*packet); + (this->*opHandle->Handler)(*packet); if (sLog->ShouldLog(LOG_FILTER_NETWORKIO, LOG_LEVEL_TRACE) && packet->rpos() < packet->wpos()) LogUnprocessedTail(packet); } @@ -349,7 +349,7 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) { // not expected _player or must checked in packet hanlder sScriptMgr->OnPacketReceive(m_Socket, WorldPacket(*packet)); - (this->*opHandle->handler)(*packet); + (this->*opHandle->Handler)(*packet); if (sLog->ShouldLog(LOG_FILTER_NETWORKIO, LOG_LEVEL_TRACE) && packet->rpos() < packet->wpos()) LogUnprocessedTail(packet); } @@ -362,7 +362,7 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) else { sScriptMgr->OnPacketReceive(m_Socket, WorldPacket(*packet)); - (this->*opHandle->handler)(*packet); + (this->*opHandle->Handler)(*packet); if (sLog->ShouldLog(LOG_FILTER_NETWORKIO, LOG_LEVEL_TRACE) && packet->rpos() < packet->wpos()) LogUnprocessedTail(packet); } @@ -381,7 +381,7 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) m_playerRecentlyLogout = false; sScriptMgr->OnPacketReceive(m_Socket, WorldPacket(*packet)); - (this->*opHandle->handler)(*packet); + (this->*opHandle->Handler)(*packet); if (sLog->ShouldLog(LOG_FILTER_NETWORKIO, LOG_LEVEL_TRACE) && packet->rpos() < packet->wpos()) LogUnprocessedTail(packet); break; diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index 246b1424f23..4cf144dd7a2 100644 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -731,8 +731,8 @@ int WorldSocket::ProcessIncoming(WorldPacket* new_pct) return -1; } - OpcodeHandler* handler = opcodeTable[opcode]; - if (!handler || handler->status == STATUS_UNHANDLED) + OpcodeHandler const* handler = opcodeTable[opcode]; + if (!handler || handler->Status == STATUS_UNHANDLED) { sLog->outError(LOG_FILTER_OPCODES, "No defined handler for opcode %s sent by %s", GetOpcodeNameForLogging(new_pct->GetOpcode()).c_str(), m_Session->GetPlayerName(false).c_str()); return 0; diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 204e90053ad..2779814d4ee 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1776,7 +1776,7 @@ void World::SetInitialWorldSettings() LoadCharacterNameData(); sLog->outInfo(LOG_FILTER_GENERAL, "Initializing Opcodes..."); - InitOpcodes(); + opcodeTable.Initialize(); sLog->outInfo(LOG_FILTER_GENERAL, "Loading hotfix info..."); sObjectMgr->LoadHotfixData(); -- cgit v1.2.3 From 2eed9b40459e89be288eca30718d00beb8513ecc Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 11 Sep 2012 16:14:09 +0200 Subject: Fixed minor typo in previous commit --- src/server/game/Server/Protocol/Opcodes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 980a6c7d0d8..3dd142da8f3 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -1455,7 +1455,7 @@ class OpcodeTable // Prevent copying this structure OpcodeTable(OpcodeTable const&); - OpcodeTable& operator=(OpcodeTable& const); + OpcodeTable& operator=(OpcodeTable const&); OpcodeHandler* _internalTable[NUM_OPCODE_HANDLERS]; }; -- cgit v1.2.3 From 045682006a429cf4d585ce36878a7b4ffc0330de Mon Sep 17 00:00:00 2001 From: Tuxity Date: Tue, 11 Sep 2012 23:14:41 +0200 Subject: Core/Stats: - Defense skill doesn't exist since 4.0.X - Weapon skill doesn't increase during player's level anymore, it's set to the max value for level on each levelup. --- src/server/game/Entities/Item/Item.cpp | 40 -------- src/server/game/Entities/Item/Item.h | 1 - src/server/game/Entities/Player/Player.cpp | 116 +--------------------- src/server/game/Entities/Player/Player.h | 8 -- src/server/game/Entities/Unit/StatSystem.cpp | 25 ++--- src/server/game/Entities/Unit/Unit.cpp | 91 ++--------------- src/server/game/Entities/Unit/Unit.h | 4 +- src/server/game/Globals/ObjectMgr.cpp | 8 +- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 5 +- src/server/game/World/World.cpp | 5 - src/server/game/World/World.h | 3 - src/server/scripts/Spells/spell_paladin.cpp | 8 +- src/server/worldserver/worldserver.conf.dist | 15 --- 13 files changed, 29 insertions(+), 300 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index faa91c2672a..08489bcacba 100755 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -547,46 +547,6 @@ uint32 Item::GetSkill() } } -uint32 Item::GetSpell() -{ - ItemTemplate const* proto = GetTemplate(); - - switch (proto->Class) - { - case ITEM_CLASS_WEAPON: - switch (proto->SubClass) - { - case ITEM_SUBCLASS_WEAPON_AXE: return 196; - case ITEM_SUBCLASS_WEAPON_AXE2: return 197; - case ITEM_SUBCLASS_WEAPON_BOW: return 264; - case ITEM_SUBCLASS_WEAPON_GUN: return 266; - case ITEM_SUBCLASS_WEAPON_MACE: return 198; - case ITEM_SUBCLASS_WEAPON_MACE2: return 199; - case ITEM_SUBCLASS_WEAPON_POLEARM: return 200; - case ITEM_SUBCLASS_WEAPON_SWORD: return 201; - case ITEM_SUBCLASS_WEAPON_SWORD2: return 202; - case ITEM_SUBCLASS_WEAPON_STAFF: return 227; - case ITEM_SUBCLASS_WEAPON_DAGGER: return 1180; - case ITEM_SUBCLASS_WEAPON_THROWN: return 2567; - case ITEM_SUBCLASS_WEAPON_SPEAR: return 3386; - case ITEM_SUBCLASS_WEAPON_CROSSBOW:return 5011; - case ITEM_SUBCLASS_WEAPON_WAND: return 5009; - default: return 0; - } - case ITEM_CLASS_ARMOR: - switch (proto->SubClass) - { - case ITEM_SUBCLASS_ARMOR_CLOTH: return 9078; - case ITEM_SUBCLASS_ARMOR_LEATHER: return 9077; - case ITEM_SUBCLASS_ARMOR_MAIL: return 8737; - case ITEM_SUBCLASS_ARMOR_PLATE: return 750; - case ITEM_SUBCLASS_ARMOR_SHIELD: return 9116; - default: return 0; - } - } - return 0; -} - int32 Item::GenerateItemRandomPropertyId(uint32 item_id) { ItemTemplate const* itemProto = sObjectMgr->GetItemTemplate(item_id); diff --git a/src/server/game/Entities/Item/Item.h b/src/server/game/Entities/Item/Item.h index b5ee171e6b1..3927676af47 100755 --- a/src/server/game/Entities/Item/Item.h +++ b/src/server/game/Entities/Item/Item.h @@ -279,7 +279,6 @@ class Item : public Object bool IsEquipped() const; uint32 GetSkill(); - uint32 GetSpell(); // RandomPropertyId (signed but stored as unsigned) int32 GetItemRandomPropertyId() const { return GetInt32Value(ITEM_FIELD_RANDOM_PROPERTIES_ID); } diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 302791f4888..a27a1b4c64a 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -5699,17 +5699,6 @@ void Player::LeaveLFGChannel() } } -void Player::UpdateDefense() -{ - uint32 defense_skill_gain = sWorld->getIntConfig(CONFIG_SKILL_GAIN_DEFENSE); - - if (UpdateSkill(SKILL_DEFENSE, defense_skill_gain)) - { - // update dependent from defense skill part - UpdateDefenseBonusesMod(); - } -} - void Player::HandleBaseModValue(BaseModGroup modGroup, BaseModType modType, float amount, bool apply) { if (modGroup >= BASEMOD_END || modType >= MOD_END) @@ -5961,9 +5950,8 @@ void Player::UpdateRating(CombatRating cr) switch (cr) { - case CR_WEAPON_SKILL: // Implemented in Unit::RollMeleeOutcomeAgainst + case CR_WEAPON_SKILL: case CR_DEFENSE_SKILL: - UpdateDefenseBonusesMod(); break; case CR_DODGE: UpdateDodgePercentage(); @@ -6239,70 +6227,6 @@ bool Player::UpdateSkillPro(uint16 SkillId, int32 Chance, uint32 step) return false; } -void Player::UpdateWeaponSkill(WeaponAttackType attType) -{ - // no skill gain in pvp - Unit* victim = getVictim(); - if (victim && victim->GetTypeId() == TYPEID_PLAYER) - return; - - if (IsInFeralForm()) - return; // always maximized SKILL_FERAL_COMBAT in fact - - if (GetShapeshiftForm() == FORM_TREE) - return; // use weapon but not skill up - - if (victim && victim->GetTypeId() == TYPEID_UNIT && (victim->ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_SKILLGAIN)) - return; - - uint32 weapon_skill_gain = sWorld->getIntConfig(CONFIG_SKILL_GAIN_WEAPON); - - Item* tmpitem = GetWeaponForAttack(attType, true); - if (!tmpitem && attType == BASE_ATTACK) - UpdateSkill(SKILL_UNARMED, weapon_skill_gain); - else if (tmpitem && tmpitem->GetTemplate()->SubClass != ITEM_SUBCLASS_WEAPON_FISHING_POLE) - UpdateSkill(tmpitem->GetSkill(), weapon_skill_gain); - - UpdateAllCritPercentages(); -} - -void Player::UpdateCombatSkills(Unit* victim, WeaponAttackType attType, bool defence) -{ - uint8 plevel = getLevel(); // if defense than victim == attacker - uint8 greylevel = Trinity::XP::GetGrayLevel(plevel); - uint8 moblevel = victim->getLevelForTarget(this); - if (moblevel < greylevel) - return; - - if (moblevel > plevel + 5) - moblevel = plevel + 5; - - uint8 lvldif = moblevel - greylevel; - if (lvldif < 3) - lvldif = 3; - - uint32 skilldif = 5 * plevel - (defence ? GetBaseDefenseSkillValue() : GetBaseWeaponSkillValue(attType)); - if (skilldif <= 0) - return; - - float chance = float(3 * lvldif * skilldif) / plevel; - if (!defence) - if (getClass() == CLASS_WARRIOR || getClass() == CLASS_ROGUE) - chance += chance * 0.02f * GetStat(STAT_INTELLECT); - - chance = chance < 1.0f ? 1.0f : chance; //minimum chance to increase skill is 1% - - if (roll_chance_f(chance)) - { - if (defence) - UpdateDefense(); - else - UpdateWeaponSkill(attType); - } - else - return; -} - void Player::ModifySkillBonus(uint32 skillid, int32 val, bool talent) { SkillStatusMap::const_iterator itr = mSkillStatus.find(skillid); @@ -6319,11 +6243,8 @@ void Player::ModifySkillBonus(uint32 skillid, int32 val, bool talent) void Player::UpdateSkillsForLevel() { - uint16 maxconfskill = sWorld->GetConfigMaxSkillValue(); uint32 maxSkill = GetMaxSkillValueForLevel(); - bool alwaysMaxSkill = sWorld->getBoolConfig(CONFIG_ALWAYS_MAX_SKILL_FOR_LEVEL); - for (SkillStatusMap::iterator itr = mSkillStatus.begin(); itr != mSkillStatus.end(); ++itr) { if (itr->second.uState == SKILL_DELETED) @@ -6346,22 +6267,10 @@ void Player::UpdateSkillsForLevel() /// update only level dependent max skill values if (max != 1) { - /// maximize skill always - if (alwaysMaxSkill) - { - SetUInt16Value(PLAYER_SKILL_RANK_0 + field, offset, maxSkill); - SetUInt16Value(PLAYER_SKILL_MAX_RANK_0 + field, offset, maxSkill); - if (itr->second.uState != SKILL_NEW) - itr->second.uState = SKILL_CHANGED; - } - - else if (max != maxconfskill) /// update max skill value if current max skill not maximized - { - SetUInt16Value(PLAYER_SKILL_RANK_0 + field, offset, val); - SetUInt16Value(PLAYER_SKILL_MAX_RANK_0 + field, offset, maxSkill); - if (itr->second.uState != SKILL_NEW) - itr->second.uState = SKILL_CHANGED; - } + SetUInt16Value(PLAYER_SKILL_RANK_0 + field, offset, maxSkill); + SetUInt16Value(PLAYER_SKILL_MAX_RANK_0 + field, offset, maxSkill); + if (itr->second.uState != SKILL_NEW) + itr->second.uState = SKILL_CHANGED; } } } @@ -6389,8 +6298,6 @@ void Player::UpdateSkillsToMaxSkillsForLevel() if (itr->second.uState != SKILL_NEW) itr->second.uState = SKILL_CHANGED; } - if (pskill == SKILL_DEFENSE) - UpdateDefenseBonusesMod(); } } @@ -23388,19 +23295,6 @@ bool Player::IsAtRecruitAFriendDistance(WorldObject const* pOther) const return pOther->GetDistance(player) <= sWorld->getFloatConfig(CONFIG_MAX_RECRUIT_A_FRIEND_DISTANCE); } -uint32 Player::GetBaseWeaponSkillValue (WeaponAttackType attType) const -{ - Item* item = GetWeaponForAttack(attType, true); - - // unarmed only with base attack - if (attType != BASE_ATTACK && !item) - return 0; - - // weapon skill or (unarmed for base attack and for fist weapons) - uint32 skill = (item && item->GetSkill() != SKILL_FIST_WEAPONS) ? item->GetSkill() : uint32(SKILL_UNARMED); - return GetBaseSkillValue(skill); -} - void Player::ResurectUsingRequestData() { /// Teleport before resurrecting by player, otherwise the player might get attacked from creatures near his corpse diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 89c82736335..ad17ee7844b 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -2054,9 +2054,6 @@ class Player : public Unit, public GridObject bool UpdateGatherSkill(uint32 SkillId, uint32 SkillValue, uint32 RedLevel, uint32 Multiplicator = 1); bool UpdateFishingSkill(); - uint32 GetBaseDefenseSkillValue() const { return GetBaseSkillValue(SKILL_DEFENSE); } - uint32 GetBaseWeaponSkillValue(WeaponAttackType attType) const; - uint32 GetSpellByProto(ItemTemplate* proto); float GetHealthBonusFromStamina(); @@ -2078,7 +2075,6 @@ class Player : public Unit, public GridObject void CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bool addTotalPct, float& min_damage, float& max_damage); - void UpdateDefenseBonusesMod(); inline void RecalculateRating(CombatRating cr) { ApplyRatingMod(cr, 0, true);} float GetMeleeCritFromAgility(); void GetDodgeFromAgility(float &diminishing, float &nondiminishing); @@ -2183,10 +2179,6 @@ class Player : public Unit, public GridObject void UpdateLocalChannels(uint32 newZone); void LeaveLFGChannel(); - void UpdateDefense(); - void UpdateWeaponSkill (WeaponAttackType attType); - void UpdateCombatSkills(Unit* victim, WeaponAttackType attType, bool defence); - void SetSkill(uint16 id, uint16 step, uint16 currVal, uint16 maxVal); uint16 GetMaxSkillValue(uint32 skill) const; // max + perm. bonus + temp bonus uint16 GetPureMaxSkillValue(uint32 skill) const; // max diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index 12d214e49ab..c0f7f5c8939 100755 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -75,16 +75,16 @@ bool Player::UpdateStats(Stats stat) UpdateAllCritPercentages(); UpdateDodgePercentage(); break; - case STAT_STAMINA: UpdateMaxHealth(); break; + case STAT_STAMINA: + UpdateMaxHealth(); + break; case STAT_INTELLECT: UpdateMaxPower(POWER_MANA); UpdateAllSpellCritChances(); UpdateArmor(); //SPELL_AURA_MOD_RESISTANCE_OF_INTELLECT_PERCENT, only armor currently break; - case STAT_SPIRIT: break; - default: break; } @@ -155,7 +155,9 @@ bool Player::UpdateAllStats() UpdateAllRatings(); UpdateAllCritPercentages(); UpdateAllSpellCritChances(); - UpdateDefenseBonusesMod(); + UpdateBlockPercentage(); + UpdateParryPercentage(); + UpdateDodgePercentage(); UpdateSpellDamageAndHealingBonus(); UpdateManaRegen(); UpdateExpertise(BASE_ATTACK); @@ -430,13 +432,6 @@ void Player::UpdateDamagePhysical(WeaponAttackType attType) } } -void Player::UpdateDefenseBonusesMod() -{ - UpdateBlockPercentage(); - UpdateParryPercentage(); - UpdateDodgePercentage(); -} - void Player::UpdateBlockPercentage() { // No block @@ -482,7 +477,7 @@ void Player::UpdateCritPercentage(WeaponAttackType attType) float value = GetTotalPercentageModValue(modGroup) + GetRatingBonusValue(cr); // Modify crit from weapon skill and maximized defense skill of same level victim difference - value += (int32(GetWeaponSkillValue(attType)) - int32(GetMaxSkillValueForLevel())) * 0.04f; + value += (int32(GetMaxSkillValueForLevel()) - int32(GetMaxSkillValueForLevel())) * 0.04f; value = value < 0.0f ? 0.0f : value; SetStatFloatValue(index, value); } @@ -540,9 +535,6 @@ void Player::UpdateParryPercentage() float nondiminishing = 5.0f; // Parry from rating float diminishing = GetRatingBonusValue(CR_PARRY); - // Modify value from defense skill (only bonus from defense rating diminishes) - nondiminishing += (GetSkillValue(SKILL_DEFENSE) - GetMaxSkillValueForLevel()) * 0.04f; - diminishing += (int32(GetRatingBonusValue(CR_DEFENSE_SKILL))) * 0.04f; // Parry from SPELL_AURA_MOD_PARRY_PERCENT aura nondiminishing += GetTotalAuraModifier(SPELL_AURA_MOD_PARRY_PERCENT); // apply diminishing formula to diminishing parry chance @@ -571,9 +563,6 @@ void Player::UpdateDodgePercentage() float diminishing = 0.0f, nondiminishing = 0.0f; GetDodgeFromAgility(diminishing, nondiminishing); - // Modify value from defense skill (only bonus from defense rating diminishes) - nondiminishing += (GetSkillValue(SKILL_DEFENSE) - GetMaxSkillValueForLevel()) * 0.04f; - diminishing += (int32(GetRatingBonusValue(CR_DEFENSE_SKILL))) * 0.04f; // Dodge from SPELL_AURA_MOD_DODGE_PERCENT aura nondiminishing += GetTotalAuraModifier(SPELL_AURA_MOD_DODGE_PERCENT); // Dodge from rating diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 5407cbd274e..01ee90ce895 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -1311,8 +1311,8 @@ void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss) if (victim->getLevel() < 30) Probability = 0.65f * victim->getLevel() + 0.5f; - uint32 VictimDefense=victim->GetDefenseSkillValue(); - uint32 AttackerMeleeSkill=GetUnitMeleeSkill(); + uint32 VictimDefense = victim->GetMaxSkillValueForLevel(this); + uint32 AttackerMeleeSkill = GetMaxSkillValueForLevel(); Probability *= AttackerMeleeSkill/(float)VictimDefense; @@ -1860,11 +1860,8 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit* victim, WeaponAttackT int32 attackerMaxSkillValueForLevel = GetMaxSkillValueForLevel(victim); int32 victimMaxSkillValueForLevel = victim->GetMaxSkillValueForLevel(this); - int32 attackerWeaponSkill = GetWeaponSkillValue(attType, victim); - int32 victimDefenseSkill = victim->GetDefenseSkillValue(this); - // bonus from skills is 0.04% - int32 skillBonus = 4 * (attackerWeaponSkill - victimMaxSkillValueForLevel); + int32 skillBonus = 4 * (attackerMaxSkillValueForLevel - victimMaxSkillValueForLevel); int32 sum = 0, tmp = 0; int32 roll = urand (0, 10000); @@ -1973,11 +1970,9 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit* victim, WeaponAttackT getLevel() < victim->getLevelForTarget(this)) { // cap possible value (with bonuses > max skill) - int32 skill = attackerWeaponSkill; - int32 maxskill = attackerMaxSkillValueForLevel; - skill = (skill > maxskill) ? maxskill : skill; + int32 skill = attackerMaxSkillValueForLevel; - tmp = (10 + (victimDefenseSkill - skill)) * 100; + tmp = (10 + (victimMaxSkillValueForLevel - skill)) * 100; tmp = tmp > 4000 ? 4000 : tmp; if (roll < (sum += tmp)) { @@ -1993,10 +1988,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit* victim, WeaponAttackT !(GetTypeId() == TYPEID_UNIT && ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_CRUSH)) { // when their weapon skill is 15 or more above victim's defense skill - tmp = victimDefenseSkill; - int32 tmpmax = victimMaxSkillValueForLevel; - // having defense above your maximum (from items, talents etc.) has no effect - tmp = tmp > tmpmax ? tmpmax : tmp; + tmp = victimMaxSkillValueForLevel; // tmp = mob's level * 5 - player's current defense skill tmp = attackerMaxSkillValueForLevel - tmp; if (tmp >= 15) @@ -2441,21 +2433,6 @@ SpellMissInfo Unit::SpellHitResult(Unit* victim, SpellInfo const* spell, bool Ca return SPELL_MISS_NONE; } -uint32 Unit::GetDefenseSkillValue(Unit const* target) const -{ - if (GetTypeId() == TYPEID_PLAYER) - { - // in PvP use full skill instead current skill value - uint32 value = (target && target->GetTypeId() == TYPEID_PLAYER) - ? ToPlayer()->GetMaxSkillValue(SKILL_DEFENSE) - : ToPlayer()->GetSkillValue(SKILL_DEFENSE); - value += uint32(ToPlayer()->GetRatingBonusValue(CR_DEFENSE_SKILL)); - return value; - } - else - return GetUnitMeleeSkill(target); -} - float Unit::GetUnitDodgeChance() const { if (IsNonMeleeSpellCasted(false) || HasUnitState(UNIT_STATE_CONTROLLED)) @@ -2597,54 +2574,11 @@ float Unit::GetUnitCriticalChance(WeaponAttackType attackType, const Unit* victi else ApplyResilience(victim, &crit, NULL, false, CR_CRIT_TAKEN_RANGED); - // Apply crit chance from defence skill - crit += (int32(GetMaxSkillValueForLevel(victim)) - int32(victim->GetDefenseSkillValue(this))) * 0.04f; - if (crit < 0.0f) crit = 0.0f; return crit; } -uint32 Unit::GetWeaponSkillValue (WeaponAttackType attType, Unit const* target) const -{ - uint32 value = 0; - if (Player const* player = ToPlayer()) - { - Item* item = player->GetWeaponForAttack(attType, true); - - // feral or unarmed skill only for base attack - if (attType != BASE_ATTACK && !item) - return 0; - - if (IsInFeralForm()) - return GetMaxSkillValueForLevel(); // always maximized SKILL_FERAL_COMBAT in fact - - // weapon skill or (unarmed for base attack and fist weapons) - uint32 skill; - if (item && item->GetSkill() != SKILL_FIST_WEAPONS) - skill = item->GetSkill(); - else - skill = SKILL_UNARMED; - - // in PvP use full skill instead current skill value - value = (target && target->IsControlledByPlayer()) - ? player->GetMaxSkillValue(skill) - : player->GetSkillValue(skill); - // Modify value from ratings - value += uint32(player->GetRatingBonusValue(CR_WEAPON_SKILL)); - switch (attType) - { - case BASE_ATTACK: value += uint32(player->GetRatingBonusValue(CR_WEAPON_SKILL_MAINHAND)); break; - case OFF_ATTACK: value += uint32(player->GetRatingBonusValue(CR_WEAPON_SKILL_OFFHAND)); break; - case RANGED_ATTACK: value += uint32(player->GetRatingBonusValue(CR_WEAPON_SKILL_RANGED)); break; - default: break; - } - } - else - value = GetUnitMeleeSkill(target); - return value; -} - void Unit::_DeleteRemovedAuras() { while (!m_removedAuras.empty()) @@ -13482,19 +13416,6 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u // For melee/ranged based attack need update skills and set some Aura states if victim present if (procFlag & MELEE_BASED_TRIGGER_MASK && target) { - // Update skills here for players - if (GetTypeId() == TYPEID_PLAYER) - { - // On melee based hit/miss/resist need update skill (for victim and attacker) - if (procExtra & (PROC_EX_NORMAL_HIT|PROC_EX_MISS|PROC_EX_RESIST)) - { - if (target->GetTypeId() != TYPEID_PLAYER && target->GetCreatureType() != CREATURE_TYPE_CRITTER) - ToPlayer()->UpdateCombatSkills(target, attType, isVictim); - } - // Update defence if player is victim and parry/dodge/block - else if (isVictim && procExtra & (PROC_EX_DODGE|PROC_EX_PARRY|PROC_EX_BLOCK)) - ToPlayer()->UpdateCombatSkills(target, attType, true); - } // If exist crit/parry/dodge/block need update aura state (for victim and attacker) if (procExtra & (PROC_EX_CRITICAL_HIT|PROC_EX_PARRY|PROC_EX_DODGE|PROC_EX_BLOCK)) { diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 327886adfec..b57f148c3d6 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -546,7 +546,7 @@ enum WeaponAttackType enum CombatRating { CR_WEAPON_SKILL = 0, - CR_DEFENSE_SKILL = 1, + CR_DEFENSE_SKILL = 1, // Removed in 4.0.1 CR_DODGE = 2, CR_PARRY = 3, CR_BLOCK = 4, @@ -1493,8 +1493,6 @@ class Unit : public WorldObject virtual uint32 GetBlockPercent() { return 30; } uint32 GetUnitMeleeSkill(Unit const* target = NULL) const { return (target ? getLevelForTarget(target) : getLevel()) * 5; } - uint32 GetDefenseSkillValue(Unit const* target = NULL) const; - uint32 GetWeaponSkillValue(WeaponAttackType attType, Unit const* target = NULL) const; float GetWeaponProcChance() const; float GetPPMProcChance(uint32 WeaponSpeed, float PPM, const SpellInfo* spellProto) const; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 6b6c95eda66..d26011a552a 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -7568,12 +7568,10 @@ SkillRangeType GetSkillRangeType(SkillLineEntry const* pSkill, bool racial) { switch (pSkill->categoryId) { - case SKILL_CATEGORY_LANGUAGES: return SKILL_RANGE_LANGUAGE; + case SKILL_CATEGORY_LANGUAGES: + return SKILL_RANGE_LANGUAGE; case SKILL_CATEGORY_WEAPON: - if (pSkill->id != SKILL_FIST_WEAPONS) - return SKILL_RANGE_LEVEL; - else - return SKILL_RANGE_MONO; + return SKILL_RANGE_LEVEL; case SKILL_CATEGORY_ARMOR: case SKILL_CATEGORY_CLASS: if (pSkill->id != SKILL_LOCKPICKING) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 04ad2eb99f3..cf58a51dad8 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -2711,9 +2711,10 @@ void AuraEffect::HandleAuraModSkill(AuraApplication const* aurApp, uint8 mode, b uint32 prot = GetMiscValue(); int32 points = GetAmount(); - target->ModifySkillBonus(prot, (apply ? points : -points), GetAuraType() == SPELL_AURA_MOD_SKILL_TALENT); if (prot == SKILL_DEFENSE) - target->UpdateDefenseBonusesMod(); + return; + + target->ModifySkillBonus(prot, (apply ? points : -points), GetAuraType() == SPELL_AURA_MOD_SKILL_TALENT); } /****************************/ diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 2779814d4ee..703b158d6a3 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -920,12 +920,8 @@ void World::LoadConfigSettings(bool reload) m_int_configs[CONFIG_SKILL_GAIN_CRAFTING] = ConfigMgr::GetIntDefault("SkillGain.Crafting", 1); - m_int_configs[CONFIG_SKILL_GAIN_DEFENSE] = ConfigMgr::GetIntDefault("SkillGain.Defense", 1); - m_int_configs[CONFIG_SKILL_GAIN_GATHERING] = ConfigMgr::GetIntDefault("SkillGain.Gathering", 1); - m_int_configs[CONFIG_SKILL_GAIN_WEAPON] = ConfigMgr::GetIntDefault("SkillGain.Weapon", 1); - m_int_configs[CONFIG_MAX_OVERSPEED_PINGS] = ConfigMgr::GetIntDefault("MaxOverspeedPings", 2); if (m_int_configs[CONFIG_MAX_OVERSPEED_PINGS] != 0 && m_int_configs[CONFIG_MAX_OVERSPEED_PINGS] < 2) { @@ -938,7 +934,6 @@ void World::LoadConfigSettings(bool reload) m_int_configs[CONFIG_DISABLE_BREATHING] = ConfigMgr::GetIntDefault("DisableWaterBreath", SEC_CONSOLE); - m_bool_configs[CONFIG_ALWAYS_MAX_SKILL_FOR_LEVEL] = ConfigMgr::GetBoolDefault("AlwaysMaxSkillForLevel", false); if (reload) { diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h index 53422108971..5a8c7cc879c 100755 --- a/src/server/game/World/World.h +++ b/src/server/game/World/World.h @@ -122,7 +122,6 @@ enum WorldBoolConfigs CONFIG_SKILL_MILLING, CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY, CONFIG_WEATHER, - CONFIG_ALWAYS_MAX_SKILL_FOR_LEVEL, CONFIG_QUEST_IGNORE_RAID, CONFIG_DETECT_POS_COLLISION, CONFIG_RESTRICTED_LFG_CHANNEL, @@ -256,9 +255,7 @@ enum WorldIntConfigs CONFIG_SKILL_CHANCE_MINING_STEPS, CONFIG_SKILL_CHANCE_SKINNING_STEPS, CONFIG_SKILL_GAIN_CRAFTING, - CONFIG_SKILL_GAIN_DEFENSE, CONFIG_SKILL_GAIN_GATHERING, - CONFIG_SKILL_GAIN_WEAPON, CONFIG_MAX_OVERSPEED_PINGS, CONFIG_EXPANSION, CONFIG_CHATFLOOD_MESSAGE_COUNT, diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index 0bf2e5664a0..557cef24ee6 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -50,7 +50,7 @@ enum PaladinSpells }; // 31850 - Ardent Defender -class spell_pal_ardent_defender : public SpellScriptLoader +/*class spell_pal_ardent_defender : public SpellScriptLoader { public: spell_pal_ardent_defender() : SpellScriptLoader("spell_pal_ardent_defender") { } @@ -73,7 +73,7 @@ class spell_pal_ardent_defender : public SpellScriptLoader return GetUnitOwner()->GetTypeId() == TYPEID_PLAYER; } - void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/) + void CalculateAmount(AuraEffect const* aurEff, int32 & amount, bool & canBeRecalculated) { // Set absorbtion amount to unlimited amount = -1; @@ -123,7 +123,7 @@ class spell_pal_ardent_defender : public SpellScriptLoader { return new spell_pal_ardent_defender_AuraScript(); } -}; +};*/ class spell_pal_blessing_of_faith : public SpellScriptLoader { @@ -568,7 +568,7 @@ class spell_pal_exorcism_and_holy_wrath_damage : public SpellScriptLoader void AddSC_paladin_spell_scripts() { - new spell_pal_ardent_defender(); + //new spell_pal_ardent_defender(); new spell_pal_blessing_of_faith(); new spell_pal_blessing_of_sanctuary(); new spell_pal_guarded_by_the_light(); diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index f8ee2390842..ec6d60863dd 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -862,15 +862,6 @@ AllFlightPaths = 0 InstantFlightPaths = 0 -# -# AlwaysMaxSkillForLevel -# Description: Players will automatically gain max skill level when logging in or leveling -# up. -# Default: 0 - (Disabled) -# 1 - (Enabled) - -AlwaysMaxSkillForLevel = 0 - # # ActivateWeather # Description: Activate the weather system. @@ -1952,19 +1943,13 @@ Rate.InstanceResetTime = 1 # # SkillGain.Crafting -# SkillGain.Defense # SkillGain.Gathering -# SkillGain.Weapon # Description: Crafting/defense/gathering/weapon skills gain rate. # Default: 1 - (SkillGain.Crafting) -# 1 - (SkillGain.Defense) # 1 - (SkillGain.Gathering) -# 1 - (SkillGain.Weapon) SkillGain.Crafting = 1 -SkillGain.Defense = 1 SkillGain.Gathering = 1 -SkillGain.Weapon = 1 # # SkillChance.Orange -- cgit v1.2.3 From 9483653c1e68f2588939fecdb221b80cd50b4514 Mon Sep 17 00:00:00 2001 From: CrYser Date: Tue, 11 Sep 2012 22:34:23 +0100 Subject: [4.3.4]Core/Spells: Remove useless code Fixes Glyph of Might --- src/server/game/Entities/Unit/Unit.cpp | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 5407cbd274e..33a0cd9c857 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -12386,20 +12386,6 @@ int32 Unit::ModSpellDuration(SpellInfo const* spellProto, Unit const* target, in duration += aurEff->GetAmount() * MINUTE * IN_MILLISECONDS; } break; - case SPELLFAMILY_PALADIN: - if ((spellProto->SpellFamilyFlags[0] & 0x00000002) && spellProto->SpellIconID == 298) - { - // Glyph of Blessing of Might - if (AuraEffect* aurEff = GetAuraEffect(57958, 0)) - duration += aurEff->GetAmount() * MINUTE * IN_MILLISECONDS; - } - else if ((spellProto->SpellFamilyFlags[0] & 0x00010000) && spellProto->SpellIconID == 306) - { - // Glyph of Blessing of Wisdom - if (AuraEffect* aurEff = GetAuraEffect(57979, 0)) - duration += aurEff->GetAmount() * MINUTE * IN_MILLISECONDS; - } - break; } } return std::max(duration, 0); -- cgit v1.2.3 From 9e9ebcbfb3b45e07f05e9cc23a8820eda7b2fbf3 Mon Sep 17 00:00:00 2001 From: Northstrider Date: Wed, 12 Sep 2012 07:07:29 +0200 Subject: Core/Protocol: *added 4 opcode names (thx fabi for the names) *added opcode value for smsg_play_one_shot_anim_kit --- src/server/game/Server/Protocol/Opcodes.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 3dd142da8f3..379ea2542ca 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -1166,6 +1166,7 @@ enum Opcodes SMSG_PLAY_DANCE = 0x4704, SMSG_PLAY_MUSIC = 0x4B06, SMSG_PLAY_OBJECT_SOUND = 0x2635, + SMSG_PLAY_ONE_SHOT_ANIM_KIT = 0x4A35, SMSG_PLAY_SOUND = 0x2134, SMSG_PLAY_SPELL_VISUAL = 0x10B1, SMSG_PLAY_SPELL_VISUAL_KIT = 0x55A5, @@ -1243,12 +1244,15 @@ enum Opcodes SMSG_SERVER_MESSAGE = 0x6C04, SMSG_SERVER_PERF = 0x74B6, SMSG_SETUP_RESEARCH_HISTORY = 0x0000, + SMSG_SET_AI_ANIM_KIT = 0x0000, SMSG_SET_DF_FAST_LAUNCH_RESULT = 0x35B6, SMSG_SET_FACTION_ATWAR = 0x4216, SMSG_SET_FACTION_STANDING = 0x0126, SMSG_SET_FACTION_VISIBLE = 0x2525, SMSG_SET_FLAT_SPELL_MODIFIER = 0x2834, SMSG_SET_FORCED_REACTIONS = 0x4615, + SMSG_SET_MELEE_ANIM_KIT = 0x0000, + SMSG_SET_MOVEMENT_ANIM_KIT = 0x0000, SMSG_SET_PCT_SPELL_MODIFIER = 0x0224, SMSG_SET_PHASE_SHIFT = 0x70A0, SMSG_SET_PLAYER_DECLINED_NAMES_RESULT = 0x2B25, -- cgit v1.2.3 From 058789e866d95c69f3611c6b30593facf2e2abf2 Mon Sep 17 00:00:00 2001 From: Northstrider Date: Wed, 12 Sep 2012 07:10:49 +0200 Subject: Core/Units: implement function to play animkit.dbc entrys by using smsg play one shot anim kit. *handle emote command is deprecated for cataclysm; on sniffs i've seen that every npc use the animkit.dbc for playing special emotes. --- src/server/game/Entities/Unit/Unit.cpp | 8 ++++++++ src/server/game/Entities/Unit/Unit.h | 1 + src/server/game/Server/Protocol/Opcodes.cpp | 1 + 3 files changed, 10 insertions(+) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 99d43a2e33d..288d741589d 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -14579,6 +14579,14 @@ void Unit::SendDurabilityLoss(Player* receiver, uint32 percent) receiver->GetSession()->SendPacket(&data); } +void Unit::PlayOneShotAnimKit(uint32 id) +{ + WorldPacket data(SMSG_PLAY_ONE_SHOT_ANIM_KIT, 8+1); + data.appendPackGUID(GetGUID()); + data << uint16(id); + SendMessageToSet(&data, true); +} + void Unit::Kill(Unit* victim, bool durabilityLoss) { // Prevent killing unit twice (and giving reward from kill twice) diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index b57f148c3d6..102754f1d81 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1426,6 +1426,7 @@ class Unit : public WorldObject MountCapabilityEntry const* GetMountCapability(uint32 mountType) const; void SendDurabilityLoss(Player* receiver, uint32 percent); + void PlayOneShotAnimKit(uint32 id); uint16 GetMaxSkillValueForLevel(Unit const* target = NULL) const { return (target ? getLevelForTarget(target) : getLevel()) * 5; } void DealDamageMods(Unit* victim, uint32 &damage, uint32* absorb); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 1b458920817..1448f046213 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -1076,6 +1076,7 @@ void OpcodeTable::Initialize() DEFINE_OPCODE_HANDLER(SMSG_PLAY_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAY_MUSIC, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAY_OBJECT_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PLAY_ONE_SHOT_ANIM_KIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAY_SOUND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAY_SPELL_VISUAL, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PLAY_SPELL_VISUAL_KIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From 7b08ea5df71a51defc395f3e3f2b711bb6022e7b Mon Sep 17 00:00:00 2001 From: Nay Date: Wed, 12 Sep 2012 18:00:15 +0100 Subject: Core/PacketIO: Correct status for SMSG_VOID_* opcs, thanks Horn for noticing it --- src/server/game/Server/Protocol/Opcodes.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 1b458920817..6c23811953c 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -1275,11 +1275,11 @@ void OpcodeTable::Initialize() DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_LEAVE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_VOICE_SESSION_ROSTER_UPDATE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_VOICE_SET_TALKER_MUTED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_VOID_ITEM_SWAP_RESPONSE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_VOID_STORAGE_CONTENTS, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_VOID_STORAGE_FAILED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_VOID_STORAGE_TRANSFER_CHANGES, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_VOID_TRANSFER_RESULT, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_VOID_ITEM_SWAP_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_VOID_STORAGE_CONTENTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_VOID_STORAGE_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_VOID_STORAGE_TRANSFER_CHANGES, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_VOID_TRANSFER_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_WAIT_QUEUE_FINISH, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_WAIT_QUEUE_UPDATE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_WARDEN_DATA, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From f139243de5ea13080c5eaab33d596873e45174de Mon Sep 17 00:00:00 2001 From: Northstrider Date: Wed, 12 Sep 2012 20:39:36 +0200 Subject: Core/Units: pakcet guid change for recent function --- src/server/game/Entities/Unit/Unit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 288d741589d..688c15841f1 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -14581,7 +14581,7 @@ void Unit::SendDurabilityLoss(Player* receiver, uint32 percent) void Unit::PlayOneShotAnimKit(uint32 id) { - WorldPacket data(SMSG_PLAY_ONE_SHOT_ANIM_KIT, 8+1); + WorldPacket data(SMSG_PLAY_ONE_SHOT_ANIM_KIT, 7+2); data.appendPackGUID(GetGUID()); data << uint16(id); SendMessageToSet(&data, true); -- cgit v1.2.3 From 7a2ed4a142f49fbabaef602a512c0fb5b44ac099 Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 12 Sep 2012 22:09:04 +0200 Subject: Core: Fixed crashes guild achievement db queries Closes #7632 --- .../shared/Database/Implementation/CharacterDatabase.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index a335d8bc4fe..3004e3d4e21 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -231,12 +231,12 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_UPD_GUILD_RANK_BANK_TIME6, "UPDATE guild_member SET BankResetTimeTab6 = 0 WHERE guildid = ? AND rank = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_UPD_GUILD_RANK_BANK_TIME7, "UPDATE guild_member SET BankResetTimeTab7 = 0 WHERE guildid = ? AND rank = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_CHAR_DATA_FOR_GUILD, "SELECT name, level, class, zone, account FROM characters WHERE guid = ?", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_DEL_GUILD_ACHIEVEMENT, "DELETE FROM guild_achievement WHERE guildId = ? AND achievement = ?", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_INS_GUILD_ACHIEVEMENT, "INSERT INTO guild_achievement (guildId, achievement, date, guids) VALUES (?, ?, ?, ?)", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_DEL_GUILD_ACHIEVEMENT_CRITERIA, "DELETE FROM guild_achievement_progress WHERE guildId = ? AND criteria = ?", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_INS_GUILD_ACHIEVEMENT_CRITERIA, "INSERT INTO guild_achievement_progress (guildId, criteria, counter, date, completedGuid) VALUES (?, ?, ?, ?, ?)", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_DEL_ALL_GUILD_ACHIEVEMENTS, "DELETE FROM guild_achievement WHERE guildId = ?", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_DEL_ALL_GUILD_ACHIEVEMENT_CRITERIA, "DELETE FROM guild_achievement_progress WHERE guildId = ?", CONNECTION_SYNCH) + PREPARE_STATEMENT(CHAR_DEL_GUILD_ACHIEVEMENT, "DELETE FROM guild_achievement WHERE guildId = ? AND achievement = ?", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_INS_GUILD_ACHIEVEMENT, "INSERT INTO guild_achievement (guildId, achievement, date, guids) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_DEL_GUILD_ACHIEVEMENT_CRITERIA, "DELETE FROM guild_achievement_progress WHERE guildId = ? AND criteria = ?", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_INS_GUILD_ACHIEVEMENT_CRITERIA, "INSERT INTO guild_achievement_progress (guildId, criteria, counter, date, completedGuid) VALUES (?, ?, ?, ?, ?)", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_DEL_ALL_GUILD_ACHIEVEMENTS, "DELETE FROM guild_achievement WHERE guildId = ?", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_DEL_ALL_GUILD_ACHIEVEMENT_CRITERIA, "DELETE FROM guild_achievement_progress WHERE guildId = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_SEL_GUILD_ACHIEVEMENT, "SELECT achievement, date, guids FROM guild_achievement WHERE guildId = ?", CONNECTION_SYNCH) PREPARE_STATEMENT(CHAR_SEL_GUILD_ACHIEVEMENT_CRITERIA, "SELECT criteria, counter, date, completedGuid FROM guild_achievement_progress WHERE guildId = ?", CONNECTION_SYNCH) PREPARE_STATEMENT(CHAR_UPD_GUILD_EXPERIENCE, "UPDATE guild SET level = ?, experience = ?, todayExperience = ? WHERE guildId = ?", CONNECTION_ASYNC); -- cgit v1.2.3 From ed1ece2bb78d6e473872ff1691343295cd573309 Mon Sep 17 00:00:00 2001 From: cyberbrest Date: Thu, 13 Sep 2012 16:16:33 +0100 Subject: Core/Quest: allow to complete quest by new auto-submit system with getting next quest in chain. Closes #7752 (Modified) --- src/server/game/Entities/Player/Player.cpp | 50 +++++++---- src/server/game/Handlers/QuestHandler.cpp | 139 +++++++++++++++++------------ src/server/game/Quests/QuestDef.h | 5 ++ 3 files changed, 119 insertions(+), 75 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index a27a1b4c64a..223278faf16 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -14454,11 +14454,11 @@ void Player::PrepareQuestMenu(uint64 guid) //only for quests which cast teleport spells on player Map* _map = IsInWorld() ? GetMap() : sMapMgr->FindMap(GetMapId(), GetInstanceId()); ASSERT(_map); - GameObject* pGameObject = _map->GetGameObject(guid); - if (pGameObject) + GameObject* gameObject = _map->GetGameObject(guid); + if (gameObject) { - objectQR = sObjectMgr->GetGOQuestRelationBounds(pGameObject->GetEntry()); - objectQIR = sObjectMgr->GetGOQuestInvolvedRelationBounds(pGameObject->GetEntry()); + objectQR = sObjectMgr->GetGOQuestRelationBounds(gameObject->GetEntry()); + objectQIR = sObjectMgr->GetGOQuestInvolvedRelationBounds(gameObject->GetEntry()); } else return; @@ -14600,24 +14600,40 @@ bool Player::IsActiveQuest(uint32 quest_id) const Quest const* Player::GetNextQuest(uint64 guid, Quest const* quest) { QuestRelationBounds objectQR; + uint32 nextQuestID = quest->GetNextQuestInChain(); - Creature* creature = ObjectAccessor::GetCreatureOrPetOrVehicle(*this, guid); - if (creature) - objectQR = sObjectMgr->GetCreatureQuestRelationBounds(creature->GetEntry()); - else + switch (GUID_HIPART(guid)) { - //we should obtain map pointer from GetMap() in 99% of cases. Special case - //only for quests which cast teleport spells on player - Map* _map = IsInWorld() ? GetMap() : sMapMgr->FindMap(GetMapId(), GetInstanceId()); - ASSERT(_map); - GameObject* pGameObject = _map->GetGameObject(guid); - if (pGameObject) - objectQR = sObjectMgr->GetGOQuestRelationBounds(pGameObject->GetEntry()); - else + case HIGHGUID_PLAYER: + ASSERT(quest->HasFlag(QUEST_FLAGS_AUTO_SUBMIT)); + return sObjectMgr->GetQuestTemplate(nextQuestID); + case HIGHGUID_UNIT: + case HIGHGUID_PET: + case HIGHGUID_VEHICLE: + { + if (Creature* creature = ObjectAccessor::GetCreatureOrPetOrVehicle(*this, guid)) + objectQR = sObjectMgr->GetCreatureQuestRelationBounds(creature->GetEntry()); + else + return NULL; + break; + } + case HIGHGUID_GAMEOBJECT: + { + //we should obtain map pointer from GetMap() in 99% of cases. Special case + //only for quests which cast teleport spells on player + Map* _map = IsInWorld() ? GetMap() : sMapMgr->FindMap(GetMapId(), GetInstanceId()); + ASSERT(_map); + if (GameObject* gameObject = _map->GetGameObject(guid)) + objectQR = sObjectMgr->GetGOQuestRelationBounds(gameObject->GetEntry()); + else + return NULL; + break; + } + default: return NULL; } - uint32 nextQuestID = quest->GetNextQuestInChain(); + // for unit and go state for (QuestRelations::const_iterator itr = objectQR.first; itr != objectQR.second; ++itr) { if (itr->second == nextQuestID) diff --git a/src/server/game/Handlers/QuestHandler.cpp b/src/server/game/Handlers/QuestHandler.cpp index 2f5c031e336..8d433ca6157 100644 --- a/src/server/game/Handlers/QuestHandler.cpp +++ b/src/server/game/Handlers/QuestHandler.cpp @@ -295,74 +295,87 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket& recvData) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_CHOOSE_REWARD npc = %u, quest = %u, reward = %u", uint32(GUID_LOPART(guid)), questId, reward); - Object* object = ObjectAccessor::GetObjectByTypeMask(*_player, guid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT); - if (!object || !object->hasInvolvedQuest(questId)) + Quest const* quest = sObjectMgr->GetQuestTemplate(questId); + if (!quest) return; - // some kind of WPE protection - if (!_player->CanInteractWithQuestGiver(object)) - return; + Object* object = _player; - if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId)) + if (!quest->HasFlag(QUEST_FLAGS_AUTO_SUBMIT)) { - if ((!_player->CanSeeStartQuest(quest) && _player->GetQuestStatus(questId) == QUEST_STATUS_NONE) || - (_player->GetQuestStatus(questId) != QUEST_STATUS_COMPLETE && !quest->IsAutoComplete())) - { - sLog->outError(LOG_FILTER_NETWORKIO, "HACK ALERT: Player %s (guid: %u) is trying to complete quest (id: %u) but he has no right to do it!", - _player->GetName(), _player->GetGUIDLow(), questId); + object = ObjectAccessor::GetObjectByTypeMask(*_player, guid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT); + if (!object || !object->hasInvolvedQuest(questId)) return; - } - if (_player->CanRewardQuest(quest, reward, true)) - { - _player->RewardQuest(quest, reward, object); - switch (object->GetTypeId()) + // some kind of WPE protection + if (!_player->CanInteractWithQuestGiver(object)) + return; + } + + if ((!_player->CanSeeStartQuest(quest) && _player->GetQuestStatus(questId) == QUEST_STATUS_NONE) || + (_player->GetQuestStatus(questId) != QUEST_STATUS_COMPLETE && !quest->IsAutoComplete())) + { + sLog->outError(LOG_FILTER_NETWORKIO, "HACK ALERT: Player %s (guid: %u) is trying to complete quest (id: %u) but he has no right to do it!", + _player->GetName(), _player->GetGUIDLow(), questId); + return; + } + + if (_player->CanRewardQuest(quest, reward, true)) + { + _player->RewardQuest(quest, reward, object); + + switch (object->GetTypeId()) + { + case TYPEID_UNIT: + case TYPEID_PLAYER: { - case TYPEID_UNIT: - if (!(sScriptMgr->OnQuestReward(_player, (object->ToCreature()), quest, reward))) + //For AutoSubmition was added plr case there as it almost same exclute AI script cases. + Creature *creatureQGiver = object->ToCreature(); + if (!creatureQGiver || !(sScriptMgr->OnQuestReward(_player, creatureQGiver, quest, reward))) + { + // Send next quest + if (Quest const* nextQuest = _player->GetNextQuest(guid, quest)) { - // Send next quest - if (Quest const* nextQuest = _player->GetNextQuest(guid, quest)) + if (nextQuest->IsAutoAccept() && _player->CanAddQuest(nextQuest, true) && _player->CanTakeQuest(nextQuest, true)) { - if (nextQuest->IsAutoAccept() && _player->CanAddQuest(nextQuest, true) && _player->CanTakeQuest(nextQuest, true)) - { - _player->AddQuest(nextQuest, object); - if (_player->CanCompleteQuest(nextQuest->GetQuestId())) - _player->CompleteQuest(nextQuest->GetQuestId()); - } - - _player->PlayerTalkClass->SendQuestGiverQuestDetails(nextQuest, guid, true); + _player->AddQuest(nextQuest, object); + if (_player->CanCompleteQuest(nextQuest->GetQuestId())) + _player->CompleteQuest(nextQuest->GetQuestId()); } - (object->ToCreature())->AI()->sQuestReward(_player, quest, reward); + _player->PlayerTalkClass->SendQuestGiverQuestDetails(nextQuest, guid, true); } - break; - case TYPEID_GAMEOBJECT: - if (!sScriptMgr->OnQuestReward(_player, ((GameObject*)object), quest, reward)) + + if (creatureQGiver) + creatureQGiver->AI()->sQuestReward(_player, quest, reward); + } + break; + } + case TYPEID_GAMEOBJECT: + if (!sScriptMgr->OnQuestReward(_player, ((GameObject*)object), quest, reward)) + { + // Send next quest + if (Quest const* nextQuest = _player->GetNextQuest(guid, quest)) { - // Send next quest - if (Quest const* nextQuest = _player->GetNextQuest(guid, quest)) + if (nextQuest->IsAutoAccept() && _player->CanAddQuest(nextQuest, true) && _player->CanTakeQuest(nextQuest, true)) { - if (nextQuest->IsAutoAccept() && _player->CanAddQuest(nextQuest, true) && _player->CanTakeQuest(nextQuest, true)) - { - _player->AddQuest(nextQuest, object); - if (_player->CanCompleteQuest(nextQuest->GetQuestId())) - _player->CompleteQuest(nextQuest->GetQuestId()); - } - - _player->PlayerTalkClass->SendQuestGiverQuestDetails(nextQuest, guid, true); + _player->AddQuest(nextQuest, object); + if (_player->CanCompleteQuest(nextQuest->GetQuestId())) + _player->CompleteQuest(nextQuest->GetQuestId()); } - object->ToGameObject()->AI()->QuestReward(_player, quest, reward); + _player->PlayerTalkClass->SendQuestGiverQuestDetails(nextQuest, guid, true); } - break; - default: - break; - } + + object->ToGameObject()->AI()->QuestReward(_player, quest, reward); + } + break; + default: + break; } - else - _player->PlayerTalkClass->SendQuestGiverOfferReward(quest, guid, true); } + else + _player->PlayerTalkClass->SendQuestGiverOfferReward(quest, guid, true); } void WorldSession::HandleQuestgiverRequestRewardOpcode(WorldPacket & recvData) @@ -483,21 +496,31 @@ void WorldSession::HandleQuestgiverCompleteQuest(WorldPacket& recvData) { uint32 questId; uint64 playerGuid; - int8 unkByte; - recvData >> playerGuid >> questId >> unkByte; + bool autoCompleteMode; // 0 - standart complete quest mode with npc, 1 - auto-complete mode + recvData >> playerGuid >> questId >> autoCompleteMode; sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_COMPLETE_QUEST npc = %u, questId = %u", uint32(GUID_LOPART(playerGuid)), questId); - Object* object = ObjectAccessor::GetObjectByTypeMask(*_player, playerGuid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT); - if (!object || !object->hasInvolvedQuest(questId)) - return; + if (autoCompleteMode == 0) + { + Object* object = ObjectAccessor::GetObjectByTypeMask(*_player, playerGuid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT); + if (!object || !object->hasInvolvedQuest(questId)) + return; - // some kind of WPE protection - if (!_player->CanInteractWithQuestGiver(object)) - return; + // some kind of WPE protection + if (!_player->CanInteractWithQuestGiver(object)) + return; + } if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId)) { + if (autoCompleteMode && !quest->HasFlag(QUEST_FLAGS_AUTO_SUBMIT)) + { + sLog->outError(LOG_FILTER_NETWORKIO, "Possible hacking attempt: Player %s [playerGuid: %u] tried to complete questId [entry: %u] by auto-submit flag for quest witch not suport it.", + _player->GetName(), _player->GetGUIDLow(), questId); + return; + } + if (!_player->CanSeeStartQuest(quest) && _player->GetQuestStatus(questId) == QUEST_STATUS_NONE) { sLog->outError(LOG_FILTER_NETWORKIO, "Possible hacking attempt: Player %s [playerGuid: %u] tried to complete questId [entry: %u] without being in possession of the questId!", @@ -522,7 +545,7 @@ void WorldSession::HandleQuestgiverCompleteQuest(WorldPacket& recvData) if (quest->GetReqItemsCount()) // some items required _player->PlayerTalkClass->SendQuestGiverRequestItems(quest, playerGuid, _player->CanRewardQuest(quest, false), false); else // no items required - _player->PlayerTalkClass->SendQuestGiverOfferReward(quest, playerGuid, true); + _player->PlayerTalkClass->SendQuestGiverOfferReward(quest, playerGuid, !autoCompleteMode); } } } diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h index c00f297a7e6..8719a710497 100755 --- a/src/server/game/Quests/QuestDef.h +++ b/src/server/game/Quests/QuestDef.h @@ -148,6 +148,11 @@ enum __QuestFlags QUEST_FLAGS_SPECIAL_ITEM = 0x00020000, // has something to do with RequiredItemId and SourceItemId QUEST_FLAGS_OBJ_TEXT = 0x00040000, // use Objective text as Complete text QUEST_FLAGS_AUTO_ACCEPT = 0x00080000, // The client recognizes this flag as auto-accept. However, NONE of the current quests (3.3.5a) have this flag. Maybe blizz used to use it, or will use it in the future. + QUEST_FLAGS_AUTO_SUBMIT = 0x00100000, // Quests with this flag player submit automatically by special button in player gui + QUEST_FLAGS_AUTO_TAKE = 0x00200000, // Automatically suggestion of accepting quest. Not from npc. + //QUEST_FLAGS_UNK2 = 0x00400000, + //QUEST_FLAGS_UNK3 = 0x00800000, // Found in quest 14069 + //QUEST_FLAGS_UNK4 = 0x01000000, // ... 4.x added flags up to 0x80000000 - all unknown for now }; -- cgit v1.2.3 From 8249a43cf27e25602fe99c5bc29b3045d3d2d3cf Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 13 Sep 2012 18:29:32 +0100 Subject: Fix build --- src/server/game/Achievements/AchievementMgr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 7e957ca28d6..a873676810f 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -2035,7 +2035,7 @@ void AchievementMgr::SendAllAchievementData(Player* /*receiver*/) const continue; data << uint32(itr->first); - data->AppendPackedTime(itr->second.date); + data.AppendPackedTime(itr->second.date); } SendPacket(&data); @@ -2048,7 +2048,7 @@ void AchievementMgr::SendAllAchievementData(Player* receiver) const data.WriteBits(m_completedAchievements.size(), 23); for (CompletedAchievementMap::const_iterator itr = m_completedAchievements.begin(); itr != m_completedAchievements.end(); ++itr) { - data->AppendPackedTime(itr->second.date); + data.AppendPackedTime(itr->second.date); data << uint32(itr->first); } -- cgit v1.2.3 From 0c02c574dc7b38cbf3728d558e6bd1fb1472c8cc Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Fri, 14 Sep 2012 11:30:21 +0200 Subject: Core: Fix build --- src/server/game/Achievements/AchievementMgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index a873676810f..e2b5a7d81bc 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -2106,7 +2106,7 @@ void AchievementMgr::SendAchievementInfo(Player* receiver, uint32 /*achi criteriaData.WriteByteSeq(counter[4]); criteriaData << uint32(0); // timer 1 criteriaData.WriteByteSeq(guid[1]); - criteriaData << uint32(secsToTimeBitFields(itr->second.date)); + criteriaData.AppendPackedTime(itr->second.date); criteriaData.WriteByteSeq(counter[3]); criteriaData.WriteByteSeq(counter[7]); criteriaData.WriteByteSeq(guid[5]); -- cgit v1.2.3 From 6c7961ad9caaf583dbf4f09aaac1c1969a2c705a Mon Sep 17 00:00:00 2001 From: Sovak Date: Sat, 15 Sep 2012 20:35:30 +0200 Subject: Core/Auras: Fix some spells with effect SPELL_AURA_MOD_RESISTANCE_EXCLUSIVE Thanks to SkyFire Signed-off-by: Sovak --- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 31 +++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'src') diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index cf58a51dad8..6004e6d36d1 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -718,6 +718,37 @@ int32 AuraEffect::CalculateAmount(Unit* caster) if (MountCapabilityEntry const* mountCapability = GetBase()->GetUnitOwner()->GetMountCapability(uint32(GetMiscValueB()))) amount = mountCapability->Id; break; + case SPELL_AURA_MOD_RESISTANCE_EXCLUSIVE: + { + if (caster) + { + // if Level <= 70 resist = player level + int32 resist = caster->getLevel(); + + if (resist > 70 && resist < 81) + resist += (resist - 70) * 5; + else if (resist > 80) + resist += ((resist-70) * 5 + (resist - 80) * 7); + + switch (GetId()) + { + case 20043: // Aspect of the Wild + case 8185: // Elemental Resistance + case 19891: // Resistance Aura + case 79106: // Shadow Protection + case 79107: // Shadow Protection + amount = resist; + break; + case 79060: // Mark of the Wild + case 79061: // Mark of the Wild + case 79062: // Blessing of Kings + case 79063: // Blessing of Kings + case 90363: // Embrace of the Shale Spider + amount = resist / 2; + break; + } + break; + } default: break; } -- cgit v1.2.3 From a51ab0abc4298ca55e90aa67be68380555114296 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 15 Sep 2012 22:02:17 +0200 Subject: Core/Spells * Removed unneeded ported helper functions and use our own * Corrected filling pet spells --- src/server/game/DataStores/DBCStores.cpp | 108 ++++++++++-------------------- src/server/game/DataStores/DBCStores.h | 3 - src/server/game/DataStores/DBCStructure.h | 46 ------------- src/server/game/Spells/SpellInfo.cpp | 20 ++---- src/server/game/Spells/SpellInfo.h | 4 +- src/server/game/Spells/SpellMgr.cpp | 31 ++++++++- 6 files changed, 73 insertions(+), 139 deletions(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 22c450e33d5..9ecc41732f0 100644 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -195,11 +195,6 @@ DBCStorage sSpellCooldownsStore(SpellCooldownsEntryfmt); DBCStorage sSpellAuraOptionsStore(SpellAuraOptionsEntryfmt); DBCStorage sSpellAuraRestrictionsStore(SpellAuraRestrictionsEntryfmt); DBCStorage sSpellCastingRequirementsStore(SpellCastingRequirementsEntryfmt); - -SpellEffectMap sSpellEffectMap; -SpellReagentMap sSpellReagentMap; -SpellTotemMap sSpellTotemMap; - DBCStorage sSpellCastTimesStore(SpellCastTimefmt); DBCStorage sSpellCategoriesStore(SpellCategoriesEntryfmt); DBCStorage sSpellEffectStore(SpellEffectEntryfmt); @@ -503,40 +498,6 @@ void LoadDBCStores(const std::string& dataPath) sSpellCategoryStore[spell->Category].insert(i); } - for (uint32 j = 0; j < sSkillLineAbilityStore.GetNumRows(); ++j) - { - SkillLineAbilityEntry const *skillLine = sSkillLineAbilityStore.LookupEntry(j); - - if (!skillLine) - continue; - - SpellEntry const* spellInfo = sSpellStore.LookupEntry(skillLine->spellId); - if (spellInfo && spellInfo->Attributes & SPELL_ATTR0_PASSIVE) - { - for (uint32 i = 1; i < sCreatureFamilyStore.GetNumRows(); ++i) - { - SpellLevelsEntry const* levels = sSpellLevelsStore.LookupEntry(i); - if (!levels) - continue; - - CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(i); - if (!cFamily) - continue; - - if (skillLine->skillId != cFamily->skillLine[0] && skillLine->skillId != cFamily->skillLine[1]) - continue; - if (levels->spellLevel) - continue; - - if (skillLine->learnOnGetSkill != ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL) - continue; - - sPetFamilySpellsStore[i].insert(spellInfo->Id); - } - } - } - - LoadDBC(availableDbcLocales, bad_dbc_files, sSpellReagentsStore, dbcPath,"SpellReagents.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellScalingStore, dbcPath,"SpellScaling.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellTotemsStore, dbcPath,"SpellTotems.dbc");//14545 @@ -550,16 +511,8 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sSpellAuraOptionsStore, dbcPath,"SpellAuraOptions.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellAuraRestrictionsStore, dbcPath,"SpellAuraRestrictions.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellCastingRequirementsStore, dbcPath,"SpellCastingRequirements.dbc");//14545 - LoadDBC(availableDbcLocales, bad_dbc_files, sSpellCategoriesStore, dbcPath,"SpellCategories.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellEffectStore, dbcPath,"SpellEffect.dbc");//14545 - - for(uint32 i = 1; i < sSpellEffectStore.GetNumRows(); ++i) - { - if(SpellEffectEntry const *spellEffect = sSpellEffectStore.LookupEntry(i)) - sSpellEffectMap[spellEffect->EffectSpellId].effects[spellEffect->EffectIndex] = spellEffect; - } - LoadDBC(availableDbcLocales, bad_dbc_files, sSpellCastTimesStore, dbcPath, "SpellCastTimes.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellDifficultyStore, dbcPath, "SpellDifficulty.dbc"/*, &CustomSpellDifficultyfmt, &CustomSpellDifficultyIndex*/);//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellDurationStore, dbcPath, "SpellDuration.dbc");//14545 @@ -574,6 +527,40 @@ void LoadDBCStores(const std::string& dataPath) //LoadDBC(availableDbcLocales, bad_dbc_files, sStableSlotPricesStore, dbcPath, "StableSlotPrices.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sSummonPropertiesStore, dbcPath, "SummonProperties.dbc");//14545 + // Must be done when sSkillLineAbilityStore, sSpellStore, sSpellLevelsStore and sCreatureFamilyStore are all loaded + for (uint32 j = 0; j < sSkillLineAbilityStore.GetNumRows(); ++j) + { + SkillLineAbilityEntry const *skillLine = sSkillLineAbilityStore.LookupEntry(j); + if (!skillLine) + continue; + + SpellEntry const* spellInfo = sSpellStore.LookupEntry(skillLine->spellId); + if (!spellInfo) + continue; + + SpellLevelsEntry const* levels = sSpellLevelsStore.LookupEntry(spellInfo->SpellLevelsId); + if (spellInfo->SpellLevelsId && (!levels || levels->spellLevel)) + continue; + + if (spellInfo && spellInfo->Attributes & SPELL_ATTR0_PASSIVE) + { + for (uint32 i = 1; i < sCreatureFamilyStore.GetNumRows(); ++i) + { + CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(i); + if (!cFamily) + continue; + + if (skillLine->skillId != cFamily->skillLine[0] && skillLine->skillId != cFamily->skillLine[1]) + continue; + + if (skillLine->learnOnGetSkill != ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL) + continue; + + sPetFamilySpellsStore[i].insert(spellInfo->Id); + } + } + } + LoadDBC(availableDbcLocales, bad_dbc_files, sTalentStore, dbcPath, "Talent.dbc");//14545 // Create Spelldifficulty searcher @@ -801,33 +788,6 @@ char const* GetPetName(uint32 petfamily, uint32 /*dbclang*/) return pet_family->Name ? pet_family->Name : NULL; } -SpellEffectEntry const* GetSpellEffectEntry(uint32 spellId, uint32 effect) -{ - SpellEffectMap::const_iterator itr = sSpellEffectMap.find(spellId); - if(itr == sSpellEffectMap.end()) - return NULL; - - return itr->second.effects[effect]; -} - -SpellReagentsEntry const* GetSpellReagentEntry(uint32 spellId, uint8 reagent) -{ - SpellReagentMap::const_iterator itr = sSpellReagentMap.find(spellId); - if(itr == sSpellReagentMap.end()) - return NULL; - - return itr->second.reagents[reagent]; -} - -SpellTotemsEntry const* GetSpellTotemEntry(uint32 spellId, uint8 totem) -{ - SpellTotemMap::const_iterator itr = sSpellTotemMap.find(spellId); - if(itr == sSpellTotemMap.end()) - return NULL; - - return itr->second.totems[totem]; -} - TalentSpellPos const* GetTalentSpellPos(uint32 spellId) { TalentSpellPosMap::const_iterator itr = sTalentSpellPosMap.find(spellId); diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h index 9e8dc76d832..174cf5c4dfb 100755 --- a/src/server/game/DataStores/DBCStores.h +++ b/src/server/game/DataStores/DBCStores.h @@ -31,9 +31,6 @@ SimpleFactionsList const* GetFactionTeamList(uint32 faction); char const* GetPetName(uint32 petfamily, uint32 dbclang); uint32 GetTalentSpellCost(uint32 spellId); TalentSpellPos const* GetTalentSpellPos(uint32 spellId); -SpellEffectEntry const* GetSpellEffectEntry(uint32 spellId, uint32 effect); -SpellReagentsEntry const* GetSpellReagentEntry(uint32 spellId, uint8 reagent); -SpellTotemsEntry const* GetSpellTotemEntry(uint32 spellId, uint8 totem); int32 GetAreaFlagByAreaID(uint32 area_id); // -1 if not found AreaTableEntry const* GetAreaEntryByAreaID(uint32 area_id); diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 552c4d81472..ded0ff65a94 100644 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -1750,18 +1750,6 @@ struct SpellTotemsEntry uint32 Totem[MAX_SPELL_TOTEMS]; // 2 m_totem }; -struct SpellTotem -{ - SpellTotem() - { - totems[0] = NULL; - totems[1] = NULL; - } - SpellTotemsEntry const* totems[MAX_SPELL_TOTEMS]; -}; - -typedef std::map SpellTotemMap; - // Spell.dbc struct SpellEntry { @@ -1812,9 +1800,6 @@ struct SpellEntry uint32 SpellTargetRestrictionsId; // 45 SpellTargetRestrictions.dbc uint32 SpellTotemsId; // 46 SpellTotems.dbc //uint32 ResearchProject; // 47 ResearchProject.dbc - - // struct access functions - SpellEffectEntry const* GetSpellEffect(uint32 eff) const; }; // SpellCategories.dbc @@ -1994,24 +1979,6 @@ struct SpellReagentsEntry uint32 ReagentCount[MAX_SPELL_REAGENTS]; // 62-69 m_reagentCount }; -struct SpellReagent -{ - SpellReagent() - { - reagents[0] = NULL; - reagents[1] = NULL; - reagents[2] = NULL; - reagents[3] = NULL; - reagents[4] = NULL; - reagents[5] = NULL; - reagents[6] = NULL; - reagents[7] = NULL; - } - SpellReagentsEntry const* reagents[MAX_SPELL_REAGENTS]; -}; - -typedef std::map SpellReagentMap; - // SpellScaling.dbc struct SpellScalingEntry { @@ -2403,19 +2370,6 @@ struct TalentSpellPos typedef std::map TalentSpellPosMap; -struct SpellEffect -{ - SpellEffect() - { - effects[0] = NULL; - effects[1] = NULL; - effects[2] = NULL; - } - SpellEffectEntry const* effects[3]; -}; - -typedef std::map SpellEffectMap; - struct TaxiPathBySourceAndDestination { TaxiPathBySourceAndDestination() : ID(0), price(0) {} diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 28e865fdcdc..c497ee6203a 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -317,13 +317,12 @@ SpellImplicitTargetInfo::StaticData SpellImplicitTargetInfo::_data[TOTAL_SPELL_ {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 110 TARGET_DEST_UNK_110 }; -SpellEffectInfo::SpellEffectInfo(SpellEntry const* spellEntry, SpellInfo const* spellInfo, uint8 effIndex) +SpellEffectInfo::SpellEffectInfo(SpellEntry const* spellEntry, SpellInfo const* spellInfo, uint8 effIndex, SpellEffectEntry const* _effect) { - SpellEffectEntry const* _effect = spellEntry->GetSpellEffect(effIndex); SpellScalingEntry const* scaling = spellInfo->GetSpellScaling(); _spellInfo = spellInfo; - _effIndex = effIndex; + _effIndex = _effect ? _effect->EffectIndex : effIndex; Effect = _effect ? _effect->Effect : 0; ApplyAuraName = _effect ? _effect->EffectApplyAuraName : 0; Amplitude = _effect ? _effect->EffectAmplitude : 0; @@ -345,9 +344,9 @@ SpellEffectInfo::SpellEffectInfo(SpellEntry const* spellEntry, SpellInfo const* TriggerSpell = _effect ? _effect->EffectTriggerSpell : 0; SpellClassMask = _effect ? _effect->EffectSpellClassMask : flag96(0); ImplicitTargetConditions = NULL; - ScalingMultiplier = scaling ? scaling->Multiplier[effIndex] : 0.0f; - DeltaScalingMultiplier = scaling ? scaling->RandomMultiplier[effIndex] : 0.0f; - ComboScalingMultiplier = scaling ? scaling->OtherMultiplier[effIndex] : 0.0f; + ScalingMultiplier = scaling ? scaling->Multiplier[_effIndex] : 0.0f; + DeltaScalingMultiplier = scaling ? scaling->RandomMultiplier[_effIndex] : 0.0f; + ComboScalingMultiplier = scaling ? scaling->OtherMultiplier[_effIndex] : 0.0f; } bool SpellEffectInfo::IsEffect() const @@ -754,7 +753,7 @@ SpellEffectInfo::StaticData SpellEffectInfo::_data[TOTAL_SPELL_EFFECTS] = {EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT}, // 164 SPELL_EFFECT_REMOVE_AURA }; -SpellInfo::SpellInfo(SpellEntry const* spellEntry) +SpellInfo::SpellInfo(SpellEntry const* spellEntry, SpellEffectEntry const** effects) { Id = spellEntry->Id; Attributes = spellEntry->Attributes; @@ -801,7 +800,7 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry) // SpellDifficultyEntry for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) - Effects[i] = SpellEffectInfo(spellEntry, this, i); + Effects[i] = SpellEffectInfo(spellEntry, this, i, effects[i]); // SpellScalingEntry SpellScalingEntry const* _scaling = GetSpellScaling(); @@ -2687,11 +2686,6 @@ SpellCooldownsEntry const* SpellInfo::GetSpellCooldowns() const return SpellCooldownsId ? sSpellCooldownsStore.LookupEntry(SpellCooldownsId) : NULL; } -SpellEffectEntry const* SpellEntry::GetSpellEffect(uint32 eff) const -{ - return GetSpellEffectEntry(Id, eff); -} - void SpellInfo::_UnloadImplicitTargetConditionLists() { // find the same instances of ConditionList and delete them. diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h index 9dcf0140933..d8115569f25 100644 --- a/src/server/game/Spells/SpellInfo.h +++ b/src/server/game/Spells/SpellInfo.h @@ -257,7 +257,7 @@ public: float ComboScalingMultiplier; SpellEffectInfo() {} - SpellEffectInfo(SpellEntry const* spellEntry, SpellInfo const* spellInfo, uint8 effIndex); + SpellEffectInfo(SpellEntry const* spellEntry, SpellInfo const* spellInfo, uint8 effIndex, SpellEffectEntry const* effect); bool IsEffect() const; bool IsEffect(SpellEffects effectName) const; @@ -413,7 +413,7 @@ public: SpellShapeshiftEntry const* GetSpellShapeshift() const; SpellTotemsEntry const* GetSpellTotems() const; - SpellInfo(SpellEntry const* spellEntry); + SpellInfo(SpellEntry const* spellEntry, SpellEffectEntry const** effects); ~SpellInfo(); bool HasEffect(SpellEffects effect) const; diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index c3d5f5c68c1..82a712209ec 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -2630,10 +2630,39 @@ void SpellMgr::LoadSpellInfoStore() UnloadSpellInfoStore(); mSpellInfoMap.resize(sSpellStore.GetNumRows(), NULL); + // Temporary structure to hold spell effect entries for faster loading + struct SpellEffectArray + { + SpellEffectArray() + { + effects[0] = NULL; + effects[1] = NULL; + effects[2] = NULL; + } + + SpellEffectEntry const* effects[MAX_SPELL_EFFECTS]; + + SpellEffectEntry const*& operator[](int index) + { + return effects[index]; + } + }; + + std::map effectsBySpell; + + for (uint32 i = 0; i < sSpellEffectStore.GetNumRows(); ++i) + { + SpellEffectEntry const* effect = sSpellEffectStore.LookupEntry(i); + if (!effect) + continue; + + effectsBySpell[effect->EffectSpellId][effect->EffectIndex] = effect; + } + for (uint32 i = 0; i < sSpellStore.GetNumRows(); ++i) { if (SpellEntry const* spellEntry = sSpellStore.LookupEntry(i)) - mSpellInfoMap[i] = new SpellInfo(spellEntry); + mSpellInfoMap[i] = new SpellInfo(spellEntry, effectsBySpell[i].effects); } sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded spell info store in %u ms", GetMSTimeDiffToNow(oldMSTime)); -- cgit v1.2.3 From 547895762dd00ec3ef7073a0c8a41b1e6ef147de Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 16 Sep 2012 00:35:48 +0200 Subject: Compile fixes --- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 1 + src/server/game/Spells/SpellMgr.cpp | 35 +++++++++-------------- 2 files changed, 15 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 6004e6d36d1..e93d9f25b67 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -749,6 +749,7 @@ int32 AuraEffect::CalculateAmount(Unit* caster) } break; } + } default: break; } diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 82a712209ec..91041384200 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -2623,6 +2623,19 @@ void SpellMgr::LoadSpellAreas() sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spell area requirements in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } +// Temporary structure to hold spell effect entries for faster loading +struct SpellEffectArray +{ + SpellEffectArray() + { + effects[0] = NULL; + effects[1] = NULL; + effects[2] = NULL; + } + + SpellEffectEntry const* effects[MAX_SPELL_EFFECTS]; +}; + void SpellMgr::LoadSpellInfoStore() { uint32 oldMSTime = getMSTime(); @@ -2630,24 +2643,6 @@ void SpellMgr::LoadSpellInfoStore() UnloadSpellInfoStore(); mSpellInfoMap.resize(sSpellStore.GetNumRows(), NULL); - // Temporary structure to hold spell effect entries for faster loading - struct SpellEffectArray - { - SpellEffectArray() - { - effects[0] = NULL; - effects[1] = NULL; - effects[2] = NULL; - } - - SpellEffectEntry const* effects[MAX_SPELL_EFFECTS]; - - SpellEffectEntry const*& operator[](int index) - { - return effects[index]; - } - }; - std::map effectsBySpell; for (uint32 i = 0; i < sSpellEffectStore.GetNumRows(); ++i) @@ -2656,14 +2651,12 @@ void SpellMgr::LoadSpellInfoStore() if (!effect) continue; - effectsBySpell[effect->EffectSpellId][effect->EffectIndex] = effect; + effectsBySpell[effect->EffectSpellId].effects[effect->EffectIndex] = effect; } for (uint32 i = 0; i < sSpellStore.GetNumRows(); ++i) - { if (SpellEntry const* spellEntry = sSpellStore.LookupEntry(i)) mSpellInfoMap[i] = new SpellInfo(spellEntry, effectsBySpell[i].effects); - } sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded spell info store in %u ms", GetMSTimeDiffToNow(oldMSTime)); } -- cgit v1.2.3 From c83d2dc4065c94df9e27a1e8f10267cb851b7438 Mon Sep 17 00:00:00 2001 From: kaelima Date: Tue, 18 Sep 2012 01:30:00 +0200 Subject: Core/Protocol: Implemented CMSG_OPENING_CINEMATIC and enabled CMSG_GUILD_BANK_WITHDRAW_MONEY --- src/server/game/Handlers/CharacterHandler.cpp | 15 +++++++++++++++ src/server/game/Handlers/GuildHandler.cpp | 2 +- src/server/game/Server/Protocol/Opcodes.cpp | 4 ++-- src/server/game/Server/WorldSession.h | 1 + 4 files changed, 19 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 70c1bc5955b..7951ac25d92 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -2199,3 +2199,18 @@ void WorldSession::HandleReorderCharacters(WorldPacket& recvData) CharacterDatabase.CommitTransaction(trans); } + +void WorldSession::HandleOpeningCinematic(WorldPacket& /*recvData*/) +{ + // Only players that has not yet gained any experience can use this + if (_player->GetUInt32Value(PLAYER_XP)) + return; + + if (ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(_player->getClass())) + { + if (classEntry->CinematicSequence) + _player->SendCinematicStart(classEntry->CinematicSequence); + else if (ChrRacesEntry const* raceEntry = sChrRacesStore.LookupEntry(_player->getRace())) + _player->SendCinematicStart(raceEntry->CinematicSequence); + } +} diff --git a/src/server/game/Handlers/GuildHandler.cpp b/src/server/game/Handlers/GuildHandler.cpp index e60cf015039..fa3147ca175 100755 --- a/src/server/game/Handlers/GuildHandler.cpp +++ b/src/server/game/Handlers/GuildHandler.cpp @@ -481,7 +481,7 @@ void WorldSession::HandleGuildBankWithdrawMoney(WorldPacket & recvData) uint64 GoGuid; recvData >> GoGuid; - uint32 money; + uint64 money; recvData >> money; if (money) diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 7d01e90c340..5b6af4b2de8 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -254,7 +254,7 @@ void OpcodeTable::Initialize() DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_QUERY_TEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQueryGuildBankTabText ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_SWAP_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankSwapItems ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_UPDATE_TAB, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankUpdateTab ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_WITHDRAW_MONEY, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankWithdrawMoney ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_WITHDRAW_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildBankWithdrawMoney ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_CHANGE_NAME_REQUEST, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDeclineOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_DEL_RANK, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildDelRankOpcode ); @@ -385,7 +385,7 @@ void OpcodeTable::Initialize() DEFINE_OPCODE_HANDLER(CMSG_OBJECT_UPDATE_FAILED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleObjectUpdateFailedOpcode ); DEFINE_OPCODE_HANDLER(CMSG_OBJECT_UPDATE_RESCUED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_OFFER_PETITION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleOfferPetitionOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_OPENING_CINEMATIC, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_OPENING_CINEMATIC, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleOpeningCinematic ); DEFINE_OPCODE_HANDLER(CMSG_OPEN_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleOpenItemOpcode ); DEFINE_OPCODE_HANDLER(CMSG_OPT_OUT_OF_LOOT, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::HandleOptOutOfLootOpcode ); DEFINE_OPCODE_HANDLER(CMSG_PAGE_TEXT_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandlePageTextQueryOpcode ); diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index d71287f68dd..e6c13557076 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -424,6 +424,7 @@ class WorldSession void HandleCharFactionOrRaceChange(WorldPacket& recvData); void HandleRandomizeCharNameOpcode(WorldPacket& recvData); void HandleReorderCharacters(WorldPacket& recvData); + void HandleOpeningCinematic(WorldPacket& recvData); // played time -- cgit v1.2.3 From b5af7c5c2e8331d310205cf5741d4d9ecce02a4a Mon Sep 17 00:00:00 2001 From: kaelima Date: Tue, 18 Sep 2012 01:31:38 +0200 Subject: Core/Defines: Updated SpellCustomErrors and HolidayIds to 4.3.4 --- src/server/game/Miscellaneous/SharedDefines.h | 56 +++++++++++++++++++-------- 1 file changed, 39 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index d0fee62873f..bc62c46830f 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -1282,23 +1282,43 @@ enum SpellCustomErrors SPELL_CUSTOM_ERROR_NO_ACTIVE_ENCHANTMENT = 102, // You have no active enchantment to unleash. SPELL_CUSTOM_ERROR_ENOUGH_HIGHBOURNE_SOULS = 103, // You have bound enough Highborne souls. Return to Arcanist Valdurian. SPELL_CUSTOM_ERROR_ATLEAST_40YD_FROM_OIL_DRILLING = 104, // You must be at least 40 yards away from all other Oil Drilling Rigs. - SPELL_CUSTOM_ERROR_ABOVE_ENSLAVED_PEARL_MINER = 105, // You must be above the Enslaved Pearl Miner. - SPELL_CUSTOM_ERROR_MUST_TARGET_CORPSE_SPECIAL_1 = 106, // You must target the corpse of a Seabrush Terrapin, Scourgut Remora, or Spinescale Hammerhead. - SPELL_CUSTOM_ERROR_SLAGHAMMER_ALREADY_PRISONER = 107, // Ambassador Slaghammer is already your prisoner. - SPELL_CUSTOM_ERROR_REQUIRE_ATTUNED_LOCATION_1 = 108, // Requires a location that is attuned with the Naz'jar Battlemaiden. - SPELL_CUSTOM_ERROR_NEED_TO_FREE_DRAKE_FIRST = 109, // Free the Drake from the net first! - SPELL_CUSTOM_ERROR_DRAGONMAW_ALLIES_ALREADY_FOLLOW = 110, // You already have three Dragonmaw allies following you. - SPELL_CUSTOM_ERROR_REQUIRE_OPPOSABLE_THUMBS = 111, // Requires Opposable Thumbs. - SPELL_CUSTOM_ERROR_NOT_ENOUGH_HEALTH_2 = 112, // Not enough health - SPELL_CUSTOM_ERROR_ENOUGH_FORSAKEN_TROOPERS = 113, // You already have enough Forsaken Troopers. - SPELL_CUSTOM_ERROR_CANNOT_JUMP_TO_BOULDER = 114, // You cannot jump to another boulder yet. - SPELL_CUSTOM_ERROR_SKILL_TOO_HIGH = 115, // Skill too high. - SPELL_CUSTOM_ERROR_ALREADY_6_SURVIVORS_RESCUED = 116, // You have already rescued 6 Survivors. - SPELL_CUSTOM_ERROR_MUST_FACE_SHIPS_FROM_BALLOON = 117, // You need to be facing the ships from the rescue balloon. - SPELL_CUSTOM_ERROR_CANNOT_SUPERVISE_MORE_CULTISTS = 118, // You cannot supervise more than 5 Arrested Cultists at a time. - SPELL_CUSTOM_ERROR_REQUIRES_LEVEL_85 = 119, // You must reach level 85 to use this portal. - SPELL_CUSTOM_ERROR_MUST_BE_BELOW_35_HEALTH = 120, // Your target must be below 35% health. - SPELL_CUSTOM_ERROR_MUST_SELECT_TALENT_SPECIAL = 121 // You must select a talent specialization first. + SPELL_CUSTOM_ERROR_ABOVE_ENSLAVED_PEARL_MINER = 106, // You must be above the Enslaved Pearl Miner. + SPELL_CUSTOM_ERROR_MUST_TARGET_CORPSE_SPECIAL_1 = 107, // You must target the corpse of a Seabrush Terrapin, Scourgut Remora, or Spinescale Hammerhead. + SPELL_CUSTOM_ERROR_SLAGHAMMER_ALREADY_PRISONER = 108, // Ambassador Slaghammer is already your prisoner. + SPELL_CUSTOM_ERROR_REQUIRE_ATTUNED_LOCATION_1 = 109, // Requires a location that is attuned with the Naz'jar Battlemaiden. + SPELL_CUSTOM_ERROR_NEED_TO_FREE_DRAKE_FIRST = 110, // Free the Drake from the net first! + SPELL_CUSTOM_ERROR_DRAGONMAW_ALLIES_ALREADY_FOLLOW = 111, // You already have three Dragonmaw allies following you. + SPELL_CUSTOM_ERROR_REQUIRE_OPPOSABLE_THUMBS = 112, // Requires Opposable Thumbs. + SPELL_CUSTOM_ERROR_NOT_ENOUGH_HEALTH_2 = 113, // Not enough health + SPELL_CUSTOM_ERROR_ENOUGH_FORSAKEN_TROOPERS = 114, // You already have enough Forsaken Troopers. + SPELL_CUSTOM_ERROR_CANNOT_JUMP_TO_BOULDER = 115, // You cannot jump to another boulder yet. + SPELL_CUSTOM_ERROR_SKILL_TOO_HIGH = 116, // Skill too high. + SPELL_CUSTOM_ERROR_ALREADY_6_SURVIVORS_RESCUED = 117, // You have already rescued 6 Survivors. + SPELL_CUSTOM_ERROR_MUST_FACE_SHIPS_FROM_BALLOON = 118, // You need to be facing the ships from the rescue balloon. + SPELL_CUSTOM_ERROR_CANNOT_SUPERVISE_MORE_CULTISTS = 119, // You cannot supervise more than 5 Arrested Cultists at a time. + SPELL_CUSTOM_ERROR_REQUIRES_LEVEL_85 = 120, // You must reach level 85 to use this portal. + SPELL_CUSTOM_ERROR_MUST_BE_BELOW_35_HEALTH = 121, // Your target must be below 35% health. + SPELL_CUSTOM_ERROR_MUST_SELECT_TALENT_SPECIAL = 122, // You must select a talent specialization first. + SPELL_CUSTOM_ERROR_TOO_WISE_AND_POWERFUL = 123, // You are too wise and powerful to gain any benefit from that item. + SPELL_CUSTOM_ERROR_TOO_CLOSE_ARGENT_LIGHTWELL = 124, // You are within 10 yards of another Argent Lightwell. + SPELL_CUSTOM_ERROR_NOT_WHILE_SHAPESHIFTED = 125, // You can't do that while shapeshifted. + SPELL_CUSTOM_ERROR_MANA_GEM_IN_BANK = 126, // You already have a Mana Gem in your bank. + SPELL_CUSTOM_ERROR_FLAME_SHOCK_NOT_ACTIVE = 127, // You must have at least one Flame Shock active. + SPELL_CUSTOM_ERROR_CANT_TRANSFORM = 128, // You cannot transform right now + SPELL_CUSTOM_ERROR_PET_MUST_BE_ATTACKING = 129, // Your pet must be attacking a target. + SPELL_CUSTOM_ERROR_GNOMISH_ENGINEERING = 130, // Requires Gnomish Engineering + SPELL_CUSTOM_ERROR_GOBLIN_ENGINEERING = 131, // Requires Goblin Engineering + SPELL_CUSTOM_ERROR_NO_TARGET = 132, // You have no target. + SPELL_CUSTOM_ERROR_PET_OUT_OF_RANGE = 133, // Your Pet is out of range of the target. + SPELL_CUSTOM_ERROR_HOLDING_FLAG = 134, // You can't do that while holding the flag. + SPELL_CUSTOM_ERROR_TARGET_HOLDING_FLAG = 135, // You can't do that to targets holding the flag. + SPELL_CUSTOM_ERROR_PORTAL_NOT_OPEN = 136, // The portal is not yet open. Continue helping the druids at the Sanctuary of Malorne. + SPELL_CUSTOM_ERROR_AGGRA_AIR_TOTEM = 137, // You need to be closer to Aggra's Air Totem, in the west. + SPELL_CUSTOM_ERROR_AGGRA_WATER_TOTEM = 138, // You need to be closer to Aggra's Water Totem, in the north. + SPELL_CUSTOM_ERROR_AGGRA_EARTH_TOTEM = 139, // You need to be closer to Aggra's Earth Totem, in the east. + SPELL_CUSTOM_ERROR_AGGRA_FIRE_TOTEM = 140, // You need to be closer to Aggra's Fire Totem, near Thrall. + SPELL_CUSTOM_ERROR_TARGET_HAS_STARTDUST_2 = 148, // Target is already affected by Stardust No. 2. + SPELL_CUSTOM_ERROR_ELEMENTIUM_GEM_CLUSTERS = 149 // You cannot deconstruct Elementium Gem Clusters while collecting them! }; enum StealthType @@ -2862,6 +2882,8 @@ enum HolidayIds HOLIDAY_RATED_BG_15_VS_15 = 442, HOLIDAY_RATED_BG_25_VS_25 = 443, HOLIDAY_ANNIVERSARY_7_YEARS = 467, + HOLIDAY_DARKMOON_FAIRE_TEROKKAR = 479, + HOLIDAY_ANNIVERSARY_8_YEARS = 484, }; // values based at QuestInfo.dbc -- cgit v1.2.3 From c4d4beff3b26bfa4a34b7d520b0b96899fc5dd69 Mon Sep 17 00:00:00 2001 From: Spp Date: Tue, 18 Sep 2012 11:33:09 +0200 Subject: Warning fixes and some minor changes here and there - Added GetAchievementPoints to AchievementMgr --- src/server/game/Achievements/AchievementMgr.cpp | 50 +++++++------- src/server/game/Achievements/AchievementMgr.h | 2 + src/server/game/Battlegrounds/BattlegroundMgr.cpp | 2 +- src/server/game/Entities/Player/Player.cpp | 8 +-- src/server/game/Entities/Unit/Unit.cpp | 6 +- src/server/game/Guilds/Guild.cpp | 76 ++++++++-------------- src/server/game/Guilds/Guild.h | 13 ++-- src/server/game/Guilds/GuildFinderMgr.h | 20 +++--- src/server/game/Handlers/GuildHandler.cpp | 2 +- .../EasternKingdoms/ZulGurub/boss_mandokir.cpp | 2 +- src/server/scripts/Spells/spell_warrior.cpp | 2 +- 11 files changed, 79 insertions(+), 104 deletions(-) (limited to 'src') diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 5bb9b4a0a11..39dc169b11d 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -16,6 +16,7 @@ * with this program. If not, see . */ +#include "AchievementMgr.h" #include "Common.h" #include "DBCEnums.h" #include "ObjectMgr.h" @@ -24,7 +25,6 @@ #include "World.h" #include "WorldPacket.h" #include "DatabaseEnv.h" -#include "AchievementMgr.h" #include "ArenaTeam.h" #include "CellImpl.h" #include "GameEventMgr.h" @@ -37,7 +37,6 @@ #include "ScriptMgr.h" #include "MapManager.h" #include "Battleground.h" -#include "BattlegroundAB.h" #include "Map.h" #include "InstanceScript.h" #include "Group.h" @@ -378,10 +377,7 @@ bool AchievementCriteriaDataSet::Meets(Player const* source, Unit const* target, } template -AchievementMgr::AchievementMgr(T* owner) -{ - _owner = owner; -} +AchievementMgr::AchievementMgr(T* owner): _owner(owner), _achievementPoints(0) {} template AchievementMgr::~AchievementMgr() @@ -456,7 +452,7 @@ void AchievementMgr::RemoveCriteriaProgress(const AchievementCriteriaEntr template void AchievementMgr::ResetAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1, uint32 miscValue2, bool evenIfCriteriaComplete) { - sLog->outDebug(LOG_FILTER_ACHIEVEMENTSYS, "AchievementMgr::ResetAchievementCriteria(%u, %u, %u)", type, miscValue1, miscValue2); + sLog->outDebug(LOG_FILTER_ACHIEVEMENTSYS, "ResetAchievementCriteria(%u, %u, %u)", type, miscValue1, miscValue2); // disable for gamemasters with GM-mode enabled if (GetOwner()->isGameMaster()) @@ -711,6 +707,8 @@ void AchievementMgr::LoadFromDB(PreparedQueryResult achievementResult, P ca.date = time_t(fields[1].GetUInt32()); ca.changed = false; + _achievementPoints += achievement->points; + // title achievement rewards are retroactive if (AchievementReward const* reward = sAchievementMgr->GetAchievementReward(achievement)) if (uint32 titleId = reward->titleId[Player::TeamForRace(GetOwner()->getRace()) == ALLIANCE ? 0 : 1]) @@ -778,6 +776,8 @@ void AchievementMgr::LoadFromDB(PreparedQueryResult achievementResult, Pr ca.guids.insert(MAKE_NEW_GUID(atol(guids[i]), 0, HIGHGUID_PLAYER)); ca.changed = false; + + _achievementPoints += achievement->points; } while (achievementResult->NextRow()); } @@ -840,6 +840,7 @@ void AchievementMgr::Reset() } m_completedAchievements.clear(); + _achievementPoints = 0; m_criteriaProgress.clear(); DeleteFromDB(GetOwner()->GetGUIDLow()); @@ -879,6 +880,7 @@ void AchievementMgr::Reset() if (AchievementCriteriaEntry const* criteria = sAchievementMgr->GetAchievementCriteria(m_criteriaProgress.begin()->first)) RemoveCriteriaProgress(criteria); + _achievementPoints = 0; m_completedAchievements.clear(); DeleteFromDB(GetOwner()->GetId()); } @@ -1310,19 +1312,11 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, SetCriteriaProgress(achievementCriteria, referencePlayer->GetMoney(), referencePlayer, PROGRESS_HIGHEST); break; case ACHIEVEMENT_CRITERIA_TYPE_EARN_ACHIEVEMENT_POINTS: - { if (!miscValue1) - { - uint32 points = 0; - for (CompletedAchievementMap::iterator itr = m_completedAchievements.begin(); itr != m_completedAchievements.end(); ++itr) - if (AchievementEntry const* pAchievement = sAchievementMgr->GetAchievement(itr->first)) - points += pAchievement->points; - SetCriteriaProgress(achievementCriteria, points, referencePlayer, PROGRESS_SET); - } + SetCriteriaProgress(achievementCriteria, _achievementPoints, referencePlayer, PROGRESS_SET); else SetCriteriaProgress(achievementCriteria, miscValue1, referencePlayer, PROGRESS_ACCUMULATE); break; - } case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_TEAM_RATING: { uint32 reqTeamType = achievementCriteria->highest_team_rating.teamtype; @@ -1387,10 +1381,8 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, break; } case ACHIEVEMENT_CRITERIA_TYPE_REACH_GUILD_LEVEL: - { - SetCriteriaProgress(achievementCriteria, referencePlayer->GetGuildLevel(), referencePlayer, PROGRESS_SET); + SetCriteriaProgress(achievementCriteria, miscValue1, referencePlayer); break; - } // FIXME: not triggered in code as result, need to implement case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_RAID: case ACHIEVEMENT_CRITERIA_TYPE_WIN_ARENA: @@ -1466,7 +1458,7 @@ bool AchievementMgr::IsCompletedCriteria(AchievementCriteriaEntry const* achi if (!progress) return false; - switch (achievementCriteria->type) + switch (AchievementCriteriaTypes(achievementCriteria->type)) { case ACHIEVEMENT_CRITERIA_TYPE_WIN_BG: return progress->counter >= achievementCriteria->win_bg.winCount; @@ -1604,6 +1596,7 @@ bool AchievementMgr::IsCompletedCriteria(AchievementCriteriaEntry const* achi default: break; } + return false; } @@ -1704,7 +1697,8 @@ void AchievementMgr::SetCriteriaProgress(AchievementCriteriaEntry const* entr if (entry->timeLimit && timedIter == m_timedAchievements.end()) return; - sLog->outDebug(LOG_FILTER_ACHIEVEMENTSYS, "AchievementMgr::SetCriteriaProgress(%u, %u) for (%s GUID: "UI64FMTD")", entry->ID, changeValue, GetLogNameForGuid(GetOwner()->GetGUID()), GetOwner()->GetGUID()); + sLog->outDebug(LOG_FILTER_ACHIEVEMENTSYS, "SetCriteriaProgress(%u, %u) for (%s GUID: %u)", + entry->ID, changeValue, GetLogNameForGuid(GetOwner()->GetGUID()), GUID_LOPART(GetOwner()->GetGUID())); CriteriaProgress* progress = GetCriteriaProgress(entry); if (!progress) @@ -1841,8 +1835,8 @@ void AchievementMgr::RemoveTimedAchievement(AchievementCriteriaTimedTypes typ } } -template -void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement, Player* referencePlayer) +template<> +void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement, Player* referencePlayer) { sLog->outInfo(LOG_FILTER_ACHIEVEMENTSYS, "AchievementMgr::CompletedAchievement(%u)", achievement->ID); @@ -1869,6 +1863,8 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement if (!(achievement->flags & ACHIEVEMENT_FLAG_REALM_FIRST_KILL)) sAchievementMgr->SetRealmCompleted(achievement); + _achievementPoints += achievement->points; + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT, 0, 0, NULL, referencePlayer); UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EARN_ACHIEVEMENT_POINTS, achievement->points, 0, NULL, referencePlayer); @@ -1955,6 +1951,8 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achieve sAchievementMgr->SetRealmCompleted(achievement); + _achievementPoints += achievement->points; + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT, 0, 0, NULL, referencePlayer); UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EARN_ACHIEVEMENT_POINTS, achievement->points, 0, NULL, referencePlayer); } @@ -2054,11 +2052,6 @@ void AchievementMgr::SendAllAchievementData(Player* receiver) const receiver->GetSession()->SendPacket(&data); } -template -void AchievementMgr::SendAchievementInfo(Player* receiver, uint32 achievementId /*= 0*/) const -{ -} - template<> void AchievementMgr::SendAchievementInfo(Player* receiver, uint32 /*achievementId = 0 */) const { @@ -2355,6 +2348,7 @@ bool AchievementMgr::RequirementsSatisfied(AchievementCriteriaEntry const *ac case ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_VENDORS: case ACHIEVEMENT_CRITERIA_TYPE_NUMBER_OF_TALENT_RESETS: case ACHIEVEMENT_CRITERIA_TYPE_QUEST_ABANDONED: + case ACHIEVEMENT_CRITERIA_TYPE_REACH_GUILD_LEVEL: case ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED: case ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED: case ACHIEVEMENT_CRITERIA_TYPE_SPECIAL_PVP_KILL: diff --git a/src/server/game/Achievements/AchievementMgr.h b/src/server/game/Achievements/AchievementMgr.h index 38d76c247a9..efb9fcba1b6 100755 --- a/src/server/game/Achievements/AchievementMgr.h +++ b/src/server/game/Achievements/AchievementMgr.h @@ -243,6 +243,7 @@ class AchievementMgr void StartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry, uint32 timeLost = 0); void RemoveTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry); // used for quest and scripted timed achievements + uint32 GetAchievementPoints() const { return _achievementPoints; } private: enum ProgressType { PROGRESS_SET, PROGRESS_ACCUMULATE, PROGRESS_HIGHEST }; void SendAchievementEarned(AchievementEntry const* achievement) const; @@ -265,6 +266,7 @@ class AchievementMgr CompletedAchievementMap m_completedAchievements; typedef std::map TimedAchievementMap; TimedAchievementMap m_timedAchievements; // Criteria id/time left in MS + uint32 _achievementPoints; }; class AchievementGlobalMgr diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index becfc70fce8..2842a825e87 100755 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -180,7 +180,7 @@ void BattlegroundMgr::Update(uint32 diff) } } -void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battleground *bg, Player * pPlayer, uint8 QueueSlot, uint8 StatusID, uint32 Time1, uint32 Time2, uint8 arenatype, uint8 uiFrame) +void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battleground *bg, Player * pPlayer, uint8 QueueSlot, uint8 StatusID, uint32 Time1, uint32 Time2, uint8 /*arenatype*/, uint8 /*uiFrame*/) { if (!bg) StatusID = STATUS_NONE; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 3384c7a30d7..6ddbe2d037d 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -849,8 +849,8 @@ Player::Player(WorldSession* session): Unit(true), m_achievementMgr(this), m_rep _activeCheats = CHEAT_NONE; - memset(_voidStorageItems, NULL, VOID_STORAGE_MAX_SLOT * sizeof(VoidStorageItem*)); - memset(_CUFProfiles, NULL, MAX_CUF_PROFILES * sizeof(CUFProfile*)); + memset(_voidStorageItems, 0, VOID_STORAGE_MAX_SLOT * sizeof(VoidStorageItem*)); + memset(_CUFProfiles, 0, MAX_CUF_PROFILES * sizeof(CUFProfile*)); } Player::~Player() @@ -6261,7 +6261,7 @@ void Player::UpdateSkillsForLevel() uint16 field = itr->second.pos / 2; uint8 offset = itr->second.pos & 1; // itr->second.pos % 2 - uint16 val = GetUInt16Value(PLAYER_SKILL_RANK_0 + field, offset); + //uint16 val = GetUInt16Value(PLAYER_SKILL_RANK_0 + field, offset); uint16 max = GetUInt16Value(PLAYER_SKILL_MAX_RANK_0 + field, offset); /// update only level dependent max skill values @@ -7219,7 +7219,7 @@ void Player::_LoadCurrency(PreparedQueryResult result) uint16 currencyID = fields[0].GetUInt16(); CurrencyTypesEntry const* currency = sCurrencyTypesStore.LookupEntry(currencyID); - if (!currencyID) + if (!currency) continue; PlayerCurrency cur; diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 2cd395a1877..a96a829b91f 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -9900,7 +9900,7 @@ bool Unit::isSpellCrit(Unit* victim, SpellInfo const* spellProto, SpellSchoolMas return false; } -uint32 Unit::SpellCriticalDamageBonus(SpellInfo const* spellProto, uint32 damage, Unit* victim) +uint32 Unit::SpellCriticalDamageBonus(SpellInfo const* spellProto, uint32 damage, Unit* /*victim*/) { // Calculate critical bonus int32 crit_bonus = damage; @@ -9937,7 +9937,7 @@ uint32 Unit::SpellCriticalDamageBonus(SpellInfo const* spellProto, uint32 damage return crit_bonus; } -uint32 Unit::SpellCriticalHealingBonus(SpellInfo const* /*spellProto*/, uint32 damage, Unit* victim) +uint32 Unit::SpellCriticalHealingBonus(SpellInfo const* /*spellProto*/, uint32 damage, Unit* /*victim*/) { // Calculate critical bonus int32 crit_bonus = damage; @@ -10459,7 +10459,7 @@ uint32 Unit::MeleeDamageBonusDone(Unit* victim, uint32 pdamage, WeaponAttackType AddPctN(DoneTotalMod, GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_DAMAGE_DONE_FOR_MECHANIC, spellProto->Mechanic)); // done scripted mod (take it from owner) - Unit* owner = GetOwner() ? GetOwner() : this; + // Unit* owner = GetOwner() ? GetOwner() : this; // AuraEffectList const& mOverrideClassScript = owner->GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS); float tmpDamage = float(int32(pdamage) + DoneFlatBenefit) * DoneTotalMod; diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index a7ff2c75309..12455784cc8 100644 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -120,13 +120,10 @@ inline uint32 Guild::LogHolder::GetNextGUID() return m_nextGUID; } -/////////////////////////////////////////////////////////////////////////////// // EventLogEntry void Guild::EventLogEntry::SaveToDB(SQLTransaction& trans) const { - PreparedStatement* stmt = NULL; - - stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_EVENTLOG); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_EVENTLOG); stmt->setUInt32(0, m_guildId); stmt->setUInt32(1, m_guid); CharacterDatabase.ExecuteOrAppend(trans, stmt); @@ -195,14 +192,12 @@ void Guild::EventLogEntry::WritePacket(WorldPacket& data, ByteBuffer& content) c content.WriteByteSeq(guid1[1]); } -/////////////////////////////////////////////////////////////////////////////// // BankEventLogEntry void Guild::BankEventLogEntry::SaveToDB(SQLTransaction& trans) const { - PreparedStatement* stmt = NULL; uint8 index = 0; - stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_BANK_EVENTLOG); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_BANK_EVENTLOG); stmt->setUInt32( index, m_guildId); stmt->setUInt32(++index, m_guid); stmt->setUInt8 (++index, m_bankTabId); @@ -270,7 +265,6 @@ void Guild::BankEventLogEntry::WritePacket(WorldPacket& data, ByteBuffer& conten content << uint8(m_destTabId); } -/////////////////////////////////////////////////////////////////////////////// // RankInfo void Guild::RankInfo::LoadFromDB(Field* fields) { @@ -351,16 +345,15 @@ void Guild::RankInfo::SetBankTabSlotsAndRights(uint8 tabId, GuildBankRightsAndSl if (m_rankId == GR_GUILDMASTER) // Prevent loss of leader rights rightsAndSlots.SetGuildMasterValues(); - if (m_bankTabRightsAndSlots[tabId].IsEqual(rightsAndSlots)) + GuildBankRightsAndSlots& guildBR = m_bankTabRightsAndSlots[tabId]; + if (guildBR.IsEqual(rightsAndSlots)) return; - m_bankTabRightsAndSlots[tabId] = rightsAndSlots; + guildBR = rightsAndSlots; if (saveToDB) { - PreparedStatement* stmt = NULL; - - stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_BANK_RIGHT); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_BANK_RIGHT); stmt->setUInt32(0, m_guildId); stmt->setUInt8 (1, tabId); stmt->setUInt8 (2, m_rankId); @@ -370,8 +363,8 @@ void Guild::RankInfo::SetBankTabSlotsAndRights(uint8 tabId, GuildBankRightsAndSl stmt->setUInt32(0, m_guildId); stmt->setUInt8 (1, tabId); stmt->setUInt8 (2, m_rankId); - stmt->setUInt8 (3, m_bankTabRightsAndSlots[tabId].rights); - stmt->setUInt32(4, m_bankTabRightsAndSlots[tabId].slots); + stmt->setUInt8 (3, guildBR.rights); + stmt->setUInt32(4, guildBR.slots); CharacterDatabase.Execute(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_RANK_BANK_TIME0 + tabId); @@ -381,7 +374,6 @@ void Guild::RankInfo::SetBankTabSlotsAndRights(uint8 tabId, GuildBankRightsAndSl } } -/////////////////////////////////////////////////////////////////////////////// // BankTab bool Guild::BankTab::LoadFromDB(Field* fields) { @@ -414,7 +406,7 @@ bool Guild::BankTab::LoadItemFromDB(Field* fields) { sLog->outError(LOG_FILTER_GUILD, "Item (GUID %u, id: %u) not found in item_instance, deleting from guild bank!", itemGuid, itemEntry); - PreparedStatement *stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_NONEXISTENT_GUILD_BANK_ITEM); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_NONEXISTENT_GUILD_BANK_ITEM); stmt->setUInt32(0, m_guildId); stmt->setUInt8 (1, m_tabId); stmt->setUInt8 (2, slotId); @@ -483,9 +475,7 @@ bool Guild::BankTab::SetItem(SQLTransaction& trans, uint8 slotId, Item* item) m_items[slotId] = item; - PreparedStatement* stmt = NULL; - - stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_BANK_ITEM); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_BANK_ITEM); stmt->setUInt32(0, m_guildId); stmt->setUInt8 (1, m_tabId); stmt->setUInt8 (2, slotId); @@ -521,7 +511,6 @@ void Guild::BankTab::SendText(Guild const* guild, WorldSession* session) const guild->BroadcastPacket(&data); } -/////////////////////////////////////////////////////////////////////////////// // Member void Guild::Member::SetStats(Player* player) { @@ -633,6 +622,7 @@ bool Guild::Member::CheckStats() const sLog->outError(LOG_FILTER_GUILD, "Player (GUID: %u) has a broken data in field `characters`.`level`, deleting him from guild!", GUID_LOPART(m_guid)); return false; } + if (m_class < CLASS_WARRIOR || m_class >= MAX_CLASSES) { sLog->outError(LOG_FILTER_GUILD, "Player (GUID: %u) has a broken data in field `characters`.`class`, deleting him from guild!", GUID_LOPART(m_guid)); @@ -706,8 +696,12 @@ inline void Guild::Member::ResetMoneyTime() m_bankRemaining[GUILD_BANK_MAX_TABS].resetTime = 0; } -/////////////////////////////////////////////////////////////////////////////// // EmblemInfo +void EmblemInfo::ReadPacket(WorldPacket& recv) +{ + recv >> m_style >> m_color >> m_borderStyle >> m_borderColor >> m_backgroundColor; +} + void EmblemInfo::LoadFromDB(Field* fields) { m_style = fields[3].GetUInt8(); @@ -738,7 +732,6 @@ void EmblemInfo::SaveToDB(uint32 guildId) const CharacterDatabase.Execute(stmt); } -/////////////////////////////////////////////////////////////////////////////// // MoveItemData bool Guild::MoveItemData::CheckItem(uint32& splitedAmount) { @@ -786,7 +779,6 @@ inline void Guild::MoveItemData::CopySlots(SlotIds& ids) const ids.insert(uint8(itr->pos)); } -/////////////////////////////////////////////////////////////////////////////// // PlayerMoveItemData bool Guild::PlayerMoveItemData::InitItem() { @@ -846,7 +838,6 @@ inline InventoryResult Guild::PlayerMoveItemData::CanStore(Item* pItem, bool swa return m_pPlayer->CanStoreItem(m_container, m_slotId, m_vec, pItem, swap); } -/////////////////////////////////////////////////////////////////////////////// // BankMoveItemData bool Guild::BankMoveItemData::InitItem() { @@ -1059,10 +1050,9 @@ InventoryResult Guild::BankMoveItemData::CanStore(Item* pItem, bool swap) return EQUIP_ERR_BANK_FULL; } -/////////////////////////////////////////////////////////////////////////////// // Guild Guild::Guild() : m_id(0), m_leaderGuid(0), m_createdDate(0), m_accountsNumber(0), m_bankMoney(0), m_eventLog(NULL), - m_achievementMgr(this), _level(1), _experience(0), _todayExperience(0), _newsLog(this) + m_achievementMgr(this), _newsLog(this), _level(1), _experience(0), _todayExperience(0) { memset(&m_bankEventLog, 0, (GUILD_BANK_MAX_TABS + 1) * sizeof(LogHolder*)); } @@ -1213,8 +1203,6 @@ void Guild::SaveToDB() CharacterDatabase.CommitTransaction(trans); } -/////////////////////////////////////////////////////////////////////////////// -// HANDLE CLIENT COMMANDS void Guild::HandleRoster(WorldSession* session /*= NULL*/) { ByteBuffer memberData(100); @@ -1565,6 +1553,7 @@ void Guild::HandleInviteMember(WorldSession* session, const std::string& name) // Do not show invitations from ignored players if (pInvitee->GetSocial()->HasIgnore(player->GetGUIDLow())) return; + if (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && pInvitee->GetTeam() != player->GetTeam()) { SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_NOT_ALLIED, name); @@ -1695,7 +1684,7 @@ void Guild::HandleLeaveMember(WorldSession* session) _LogEvent(GUILD_EVENT_LOG_LEAVE_GUILD, player->GetGUIDLow()); _BroadcastEvent(GE_LEFT, player->GetGUID(), player->GetName()); - SendCommandResult(session, GUILD_QUIT_S, ERR_PLAYER_NO_MORE_IN_GUILD, m_name); + SendCommandResult(session, GUILD_QUIT_S, ERR_GUILD_COMMAND_SUCCESS, m_name); } } @@ -1726,7 +1715,7 @@ void Guild::HandleRemoveMember(WorldSession* session, uint64 guid) } } else if (removedPlayer) - SendCommandResult(session, GUILD_QUIT_S, ERR_PLAYER_NO_MORE_IN_GUILD, removedPlayer->GetName()); + SendCommandResult(session, GUILD_QUIT_S, ERR_GUILD_COMMAND_SUCCESS, removedPlayer->GetName()); } void Guild::HandleUpdateMemberRank(WorldSession* session, uint64 targetGuid, bool demote) @@ -1969,8 +1958,6 @@ void Guild::HandleGuildPartyRequest(WorldSession* session) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (SMSG_GUILD_PARTY_STATE_RESPONSE)"); } -/////////////////////////////////////////////////////////////////////////////// -// Send data to client void Guild::SendEventLog(WorldSession* session) const { WorldPacket data(SMSG_GUILD_EVENT_LOG_QUERY_RESULT, 1 + m_eventLog->GetSize() * (1 + 8 + 4)); @@ -2005,7 +1992,7 @@ void Guild::SendBankList(WorldSession* session, uint8 tabId, bool withContent, b if (withContent && _MemberHasTabRights(session->GetPlayer()->GetGUID(), tabId, GUILD_BANK_RIGHT_VIEW_TAB)) if (BankTab const* tab = GetBankTab(tabId)) for (uint8 slotId = 0; slotId < GUILD_BANK_MAX_SLOTS; ++slotId) - if (Item* tabItem = tab->GetItem(slotId)) + if (tab->GetItem(slotId)) ++itemCount; data.WriteBits(itemCount, 20); @@ -2173,7 +2160,6 @@ void Guild::SendGuildReputationWeeklyCap(WorldSession* session) const } } -/////////////////////////////////////////////////////////////////////////////// // Loading methods bool Guild::LoadFromDB(Field* fields) { @@ -2377,7 +2363,6 @@ bool Guild::Validate() return true; } -/////////////////////////////////////////////////////////////////////////////// // Broadcasts void Guild::BroadcastToGuild(WorldSession* session, bool officerOnly, const std::string& msg, uint32 language) const { @@ -2423,7 +2408,6 @@ void Guild::BroadcastPacket(WorldPacket* packet) const player->GetSession()->SendPacket(packet); } -/////////////////////////////////////////////////////////////////////////////// // Members handling bool Guild::AddMember(uint64 guid, uint8 rankId) { @@ -2521,6 +2505,7 @@ void Guild::DeleteMember(uint64 guid, bool isDisbanding, bool isKicked) else if (!newLeader || newLeader->GetRankId() > i->second->GetRankId()) newLeader = i->second; } + if (!newLeader) { Disband(); @@ -2540,7 +2525,7 @@ void Guild::DeleteMember(uint64 guid, bool isDisbanding, bool isKicked) _BroadcastEvent(GE_LEFT, guid, oldLeader->GetName().c_str()); } } - // Call script on remove before member is acutally removed from guild (and database) + // Call script on remove before member is actually removed from guild (and database) sScriptMgr->OnGuildRemoveMember(this, player, isDisbanding, isKicked); if (Member* member = GetMember(guid)) @@ -2581,7 +2566,6 @@ bool Guild::IsMember(uint64 guid) return itr != m_members.end(); } -/////////////////////////////////////////////////////////////////////////////// // Bank (items move) void Guild::SwapItems(Player* player, uint8 tabId, uint8 slotId, uint8 destTabId, uint8 destSlotId, uint32 splitedAmount) { @@ -2610,7 +2594,6 @@ void Guild::SwapItemsWithInventory(Player* player, bool toChar, uint8 tabId, uin _MoveItems(&charData, &bankData, splitedAmount); } -/////////////////////////////////////////////////////////////////////////////// // Bank tabs void Guild::SetBankTabText(uint8 tabId, const std::string& text) { @@ -2621,7 +2604,6 @@ void Guild::SetBankTabText(uint8 tabId, const std::string& text) } } -/////////////////////////////////////////////////////////////////////////////// // Private methods void Guild::_CreateLogHolders() { @@ -2676,12 +2658,11 @@ void Guild::_CreateDefaultGuildRanks(LocaleConstant loc) void Guild::_CreateRank(const std::string& name, uint32 rights) { - if (_GetRanksSize() >= GUILD_RANKS_MAX_COUNT) + uint32 newRankId = _GetRanksSize(); + if (newRankId >= GUILD_RANKS_MAX_COUNT) return; // Ranks represent sequence 0, 1, 2, ... where 0 means guildmaster - uint32 newRankId = _GetRanksSize(); - RankInfo info(m_id, newRankId, name, rights, 0); m_ranks.push_back(info); @@ -2923,7 +2904,7 @@ void Guild::_MoveItems(MoveItemData* pSrc, MoveItemData* pDest, uint32 splitedAm /* if (pItemSrc->GetCount() == 0) { - sLog->outFatal(LOG_FILTER_GENERAL, "Guild::SwapItems: Player %s(GUIDLow: %u) tried to move item %u from tab %u slot %u to tab %u slot %u, but item %u has a stack of zero!", + sLog->outFatal(LOG_FILTER_GUILD, "Guild::SwapItems: Player %s(GUIDLow: %u) tried to move item %u from tab %u slot %u to tab %u slot %u, but item %u has a stack of zero!", player->GetName(), player->GetGUIDLow(), pItemSrc->GetEntry(), tabId, slotId, destTabId, destSlotId, pItemSrc->GetEntry()); //return; // Commented out for now, uncomment when it's verified that this causes a crash!! } @@ -3133,8 +3114,7 @@ void Guild::_BroadcastEvent(GuildEvents guildEvent, uint64 guid, const char* par data << uint64(guid); BroadcastPacket(&data); - - sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Sent SMSG_GUILD_EVENT"); + sLog->outDebug(LOG_FILTER_GUILD, "SMSG_GUILD_EVENT [Broadcast] Event: %u", guildEvent); } void Guild::SendGuildRanksUpdate(uint64 setterGuid, uint64 targetGuid, uint32 rank) @@ -3246,7 +3226,7 @@ void Guild::GiveXP(uint32 xp, Player* source) void Guild::SendGuildXP(WorldSession* session) const { - Member const* member = GetMember(session->GetGuidLow()); + //Member const* member = GetMember(session->GetGuidLow()); WorldPacket data(SMSG_GUILD_XP, 40); data << uint64(/*member ? member->GetTotalActivity() :*/ 0); diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h index 58dedf0137a..f39cd386a96 100755 --- a/src/server/game/Guilds/Guild.h +++ b/src/server/game/Guilds/Guild.h @@ -38,7 +38,8 @@ enum GuildMisc GUILD_RANK_NONE = 0xFF, GUILD_WITHDRAW_MONEY_UNLIMITED = 0xFFFFFFFF, GUILD_WITHDRAW_SLOT_UNLIMITED = 0xFFFFFFFF, - GUILD_EVENT_LOG_GUID_UNDEFINED = 0xFFFFFFFF + GUILD_EVENT_LOG_GUID_UNDEFINED = 0xFFFFFFFF, + GUILD_EXPERIENCE_UNCAPPED_LEVEL = 20 ///> Hardcoded in client, starting from this level, guild daily experience gain is unlimited. }; enum GuildDefaultRanks @@ -88,7 +89,7 @@ enum GuildCommandType enum GuildCommandError { - ERR_PLAYER_NO_MORE_IN_GUILD = 0x00, + ERR_GUILD_COMMAND_SUCCESS = 0x00, ERR_GUILD_INTERNAL = 0x01, ERR_ALREADY_IN_GUILD = 0x02, ERR_ALREADY_IN_GUILD_S = 0x03, @@ -138,7 +139,7 @@ enum GuildEvents GE_RANK_CREATED = 12, GE_RANK_DELETED = 13, GE_RANK_ORDER_CHANGED = 14, - GE_FOUNDER = 15, // At guild creation - Set founder + GE_FOUNDER = 15, GE_SIGNED_ON = 16, GE_SIGNED_OFF = 17, GE_GUILDBANKBAGSLOTS_CHANGED = 18, @@ -259,9 +260,6 @@ uint32 const MinNewsItemLevel[MAX_CONTENT] = { 61, 90, 200, 353 }; typedef std::map GuildNewsLogMap; -#define GUILD_EXPERIENCE_UNCAPPED_LEVEL 20 ///> Hardcoded in client, starting from this level, guild daily experience gain is unlimited. - -//////////////////////////////////////////////////////////////////////////////////////////// // Emblem info class EmblemInfo { @@ -270,7 +268,7 @@ public: void LoadFromDB(Field* fields); void SaveToDB(uint32 guildId) const; - void ReadPacket(WorldPacket& recv) { recv >> m_style >> m_color >> m_borderStyle >> m_borderColor >> m_backgroundColor; } + void ReadPacket(WorldPacket& recv); void WritePacket(WorldPacket& data) const; uint32 GetStyle() const { return m_style; } @@ -623,6 +621,7 @@ private: Item* GetItem(bool isCloned = false) const { return isCloned ? m_pClonedItem : m_pItem; } uint8 GetContainer() const { return m_container; } uint8 GetSlotId() const { return m_slotId; } + protected: virtual InventoryResult CanStore(Item* pItem, bool swap) = 0; diff --git a/src/server/game/Guilds/GuildFinderMgr.h b/src/server/game/Guilds/GuildFinderMgr.h index 54faa83a002..930d538ebca 100644 --- a/src/server/game/Guilds/GuildFinderMgr.h +++ b/src/server/game/Guilds/GuildFinderMgr.h @@ -70,10 +70,10 @@ struct MembershipRequest } MembershipRequest(uint32 playerGUID, uint32 guildId, uint32 availability, uint32 classRoles, uint32 interests, std::string& comment, time_t submitTime) : - _playerGUID(playerGUID), _guildId(guildId), _availability(availability), _classRoles(classRoles), - _interests(interests), _time(submitTime), _comment(comment) {} + _comment(comment), _guildId(guildId), _playerGUID(playerGUID), _availability(availability), + _classRoles(classRoles), _interests(interests), _time(submitTime) {} - MembershipRequest() : _playerGUID(0), _guildId(0), _availability(0), _classRoles(0), + MembershipRequest() : _guildId(0), _playerGUID(0), _availability(0), _classRoles(0), _interests(0), _time(time(NULL)) {} uint32 GetGuildId() const { return _guildId; } @@ -164,14 +164,14 @@ struct LFGuildSettings : public LFGuildPlayer LFGuildSettings(bool listed, TeamId team) : LFGuildPlayer(), _listed(listed), _team(team) {} - LFGuildSettings(bool listed, TeamId team, uint32 guid, uint8 role, uint8 availability, uint8 interests, uint8 level) : _listed(listed), - LFGuildPlayer(guid, role, availability, interests, level), _team(team) {} + LFGuildSettings(bool listed, TeamId team, uint32 guid, uint8 role, uint8 availability, uint8 interests, uint8 level) : + LFGuildPlayer(guid, role, availability, interests, level), _listed(listed), _team(team) {} - LFGuildSettings(bool listed, TeamId team, uint32 guid, uint8 role, uint8 availability, uint8 interests, uint8 level, std::string& comment) : _listed(listed), - LFGuildPlayer(guid, role, availability, interests, level, comment), _team(team) {} + LFGuildSettings(bool listed, TeamId team, uint32 guid, uint8 role, uint8 availability, uint8 interests, uint8 level, std::string& comment) : + LFGuildPlayer(guid, role, availability, interests, level, comment), _listed(listed), _team(team) {} - LFGuildSettings(LFGuildSettings const& settings) : _listed(settings.IsListed()), _team(settings.GetTeam()), - LFGuildPlayer(settings) {} + LFGuildSettings(LFGuildSettings const& settings) : + LFGuildPlayer(settings), _listed(settings.IsListed()), _team(settings.GetTeam()) {} bool IsListed() const { return _listed; } @@ -179,8 +179,8 @@ struct LFGuildSettings : public LFGuildPlayer TeamId GetTeam() const { return _team; } private: - TeamId _team; bool _listed; + TeamId _team; }; typedef std::map LFGuildStore; diff --git a/src/server/game/Handlers/GuildHandler.cpp b/src/server/game/Handlers/GuildHandler.cpp index fa3147ca175..d6f61b45ccf 100755 --- a/src/server/game/Handlers/GuildHandler.cpp +++ b/src/server/game/Handlers/GuildHandler.cpp @@ -787,7 +787,7 @@ void WorldSession::HandleGuildRewardsQueryOpcode(WorldPacket& recvPacket) { recvPacket.read_skip(); // Unk - if (Guild* guild = sGuildMgr->GetGuildById(_player->GetGuildId())) + if (sGuildMgr->GetGuildById(_player->GetGuildId())) { std::vector const& rewards = sGuildMgr->GetGuildRewards(); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp index 108d2118a25..55f257e5ecc 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp @@ -46,7 +46,7 @@ class boss_mandokir : public CreatureScript { } - void KilledUnit(Unit* victim) + void KilledUnit(Unit* /*victim*/) { } diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index 7b0952dac7b..891505f1ec8 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -222,7 +222,7 @@ class spell_warr_execute : public SpellScriptLoader void HandleEffect(SpellEffIndex /*effIndex*/) { Unit* caster = GetCaster(); - if (Unit* target = GetHitUnit()) + if (GetHitUnit()) { SpellInfo const* spellInfo = GetSpellInfo(); int32 rageUsed = std::min(200 - spellInfo->CalcPowerCost(caster, SpellSchoolMask(spellInfo->SchoolMask)), caster->GetPower(POWER_RAGE)); -- cgit v1.2.3 From 69ad5e8c4be9c7ea7dadec84b9947542e7802971 Mon Sep 17 00:00:00 2001 From: Spp Date: Tue, 18 Sep 2012 14:54:56 +0200 Subject: Fix merge error --- src/server/game/Entities/Player/Player.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 977e85bd7eb..96c6b30cba5 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -24477,7 +24477,7 @@ void Player::ResetAchievements() void Player::SendRespondInspectAchievements(Player* player) const { - m_achievementMgr.SendRespondInspectAchievements(player); + m_achievementMgr.SendAchievementInfo(player); } bool Player::HasAchieved(uint32 achievementId) const -- cgit v1.2.3 From 361034e8484e1ad7ef7cb7ebd560d0565f620ce9 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 18 Sep 2012 18:11:22 +0200 Subject: Scripts/Icecrown Citadel: Fixed Unbound Plague Closes #7791 --- .../Northrend/IcecrownCitadel/boss_professor_putricide.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp index 489616332c8..7f6448382ba 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp @@ -1122,17 +1122,18 @@ class spell_putricide_unbound_plague : public SpellScriptLoader return true; } - SpellCastResult CheckCast() + void FilterTargets(std::list& targets) { if (AuraEffect const* eff = GetCaster()->GetAuraEffect(SPELL_UNBOUND_PLAGUE_SEARCHER, EFFECT_0)) + { if (eff->GetTickNumber() < 2) - return SPELL_FAILED_DONT_REPORT; + { + targets.clear(); + return; + } + } - return SPELL_CAST_OK; - } - void FilterTargets(std::list& targets) - { targets.remove_if(Trinity::UnitAuraCheck(true, sSpellMgr->GetSpellIdForDifficulty(SPELL_UNBOUND_PLAGUE, GetCaster()))); Trinity::Containers::RandomResizeList(targets, 1); } @@ -1171,7 +1172,6 @@ class spell_putricide_unbound_plague : public SpellScriptLoader void Register() { - OnCheckCast += SpellCheckCastFn(spell_putricide_unbound_plague_SpellScript::CheckCast); OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_putricide_unbound_plague_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY); OnEffectHitTarget += SpellEffectFn(spell_putricide_unbound_plague_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); } -- cgit v1.2.3 From 6446a73cc11278aaf3cfd5c0f8d9456f8bb3352e Mon Sep 17 00:00:00 2001 From: Subv Date: Tue, 18 Sep 2012 19:19:38 -0500 Subject: Core/PacketIO: Fixed CMSG_MESSAGECHAT_ADDON_BATTLEGROUND --- src/server/game/Handlers/ChatHandler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cpp index f21001ba7bf..66388631dde 100644 --- a/src/server/game/Handlers/ChatHandler.cpp +++ b/src/server/game/Handlers/ChatHandler.cpp @@ -569,10 +569,10 @@ void WorldSession::HandleAddonMessagechatOpcode(WorldPacket& recvData) case CHAT_MSG_GUILD: case CHAT_MSG_BATTLEGROUND: { - uint32 msgLen = recvData.ReadBits(9); uint32 prefixLen = recvData.ReadBits(5); - message = recvData.ReadString(msgLen); + uint32 msgLen = recvData.ReadBits(9); prefix = recvData.ReadString(prefixLen); + message = recvData.ReadString(msgLen); break; } default: -- cgit v1.2.3 From 993fb5b4a66e963344e07ef300055cf548a21796 Mon Sep 17 00:00:00 2001 From: Shocker Date: Fri, 21 Sep 2012 01:02:18 +0300 Subject: Core/Spells: Fix SPELL_AURA_MOD_CURRENCY_GAIN --- src/server/game/Entities/Player/Player.cpp | 9 ++++++--- src/server/game/Entities/Player/Player.h | 3 ++- src/server/game/Spells/Auras/SpellAuraDefines.h | 2 +- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 2 +- src/server/scripts/Commands/cs_modify.cpp | 4 ++-- 5 files changed, 12 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 96c6b30cba5..0d6e5a37b90 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -7356,7 +7356,7 @@ bool Player::HasCurrency(uint32 id, uint32 count) const return itr != _currencyStorage.end() && itr->second.totalCount >= count; } -void Player::ModifyCurrency(uint32 id, int32 count, bool printLog/* = true*/) +void Player::ModifyCurrency(uint32 id, int32 count, bool printLog/* = true*/, bool ignoreMultipliers/* = false*/) { if (!count) return; @@ -7364,6 +7364,9 @@ void Player::ModifyCurrency(uint32 id, int32 count, bool printLog/* = true*/) CurrencyTypesEntry const* currency = sCurrencyTypesStore.LookupEntry(id); ASSERT(currency); + if (!ignoreMultipliers) + count *= GetTotalAuraMultiplierByMiscValue(SPELL_AURA_MOD_CURRENCY_GAIN, id); + int32 precision = currency->Flags & CURRENCY_FLAG_HIGH_PRECISION ? 100 : 1; uint32 oldTotalCount = 0; uint32 oldWeekCount = 0; @@ -21118,7 +21121,7 @@ inline bool Player::_StoreOrEquipNewItem(uint32 vendorslot, uint32 item, uint8 c for (int i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i) { if (iece->RequiredCurrency[i]) - ModifyCurrency(iece->RequiredCurrency[i], -int32(iece->RequiredCurrencyCount[i])); + ModifyCurrency(iece->RequiredCurrency[i], -int32(iece->RequiredCurrencyCount[i]), true, true); } } @@ -21252,7 +21255,7 @@ bool Player::BuyCurrencyFromVendorSlot(uint64 vendorGuid, uint32 vendorSlot, uin return false; } - ModifyCurrency(currency, crItem->maxcount); + ModifyCurrency(currency, crItem->maxcount, true, true); return true; } diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 758e44aeefe..22091f80ce2 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1454,8 +1454,9 @@ class Player : public Unit, public GridObject * @param id currency entry from CurrencyTypes.dbc * @param count integer value for adding/removing curent currency * @param printLog used on SMSG_UPDATE_CURRENCY + * @param ignore gain multipliers */ - void ModifyCurrency(uint32 id, int32 count, bool printLog = true); + void ModifyCurrency(uint32 id, int32 count, bool printLog = true, bool ignoreMultipliers = false); void ApplyEquipCooldown(Item* pItem); void QuickEquipItem(uint16 pos, Item* pItem); diff --git a/src/server/game/Spells/Auras/SpellAuraDefines.h b/src/server/game/Spells/Auras/SpellAuraDefines.h index 1561f6289ed..102986c01ea 100755 --- a/src/server/game/Spells/Auras/SpellAuraDefines.h +++ b/src/server/game/Spells/Auras/SpellAuraDefines.h @@ -408,7 +408,7 @@ enum AuraType SPELL_AURA_PROGRESS_BAR = 346, // NYI SPELL_AURA_MOD_SPELL_COOLDOWN_BY_HASTE = 347, // NYI SPELL_AURA_DEPOSIT_BONUS_MONEY_IN_GUILD_BANK_ON_LOOT = 348, // NYI - SPELL_AURA_MOD_CURRENCY_GAIN = 349, // NYI + SPELL_AURA_MOD_CURRENCY_GAIN = 349, SPELL_AURA_MOD_GATHERING_ITEMS_GAINED_PERCENT = 350, // NYI SPELL_AURA_351 = 351, SPELL_AURA_352 = 352, diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index e93d9f25b67..0aa599baae3 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -404,7 +404,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleNULL, //346 SPELL_AURA_PROGRESS_BAR &AuraEffect::HandleNULL, //347 SPELL_AURA_MOD_SPELL_COOLDOWN_BY_HASTE &AuraEffect::HandleNoImmediateEffect, //348 SPELL_AURA_DEPOSIT_BONUS_MONEY_IN_GUILD_BANK_ON_LOOT - &AuraEffect::HandleNULL, //349 SPELL_AURA_MOD_CURRENCY_GAIN + &AuraEffect::HandleNoImmediateEffect, //349 SPELL_AURA_MOD_CURRENCY_GAIN &AuraEffect::HandleNULL, //350 SPELL_AURA_MOD_GATHERING_ITEMS_GAINED_PERCENT &AuraEffect::HandleNULL, //351 SPELL_AURA_351 &AuraEffect::HandleNULL, //352 SPELL_AURA_352 diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index beb5db62dfa..f527d7fb275 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -1121,7 +1121,7 @@ public: int32 amount = (uint32)atoi(args); - target->ModifyCurrency(CURRENCY_TYPE_HONOR_POINTS, amount); + target->ModifyCurrency(CURRENCY_TYPE_HONOR_POINTS, amount, true, true); handler->PSendSysMessage(LANG_COMMAND_MODIFY_HONOR, handler->GetNameLink(target).c_str(), target->GetCurrency(CURRENCY_TYPE_HONOR_POINTS)); @@ -1311,7 +1311,7 @@ public: int32 amount = (uint32)atoi(args); - target->ModifyCurrency(CURRENCY_TYPE_CONQUEST_POINTS, amount); + target->ModifyCurrency(CURRENCY_TYPE_CONQUEST_POINTS, amount, true, true); handler->PSendSysMessage(LANG_COMMAND_MODIFY_ARENA, handler->GetNameLink(target).c_str(), target->GetCurrency(CURRENCY_TYPE_CONQUEST_POINTS)); -- cgit v1.2.3 From 5a9d3e90f2e80261a0004c2e0c17eb3f5eaacc3f Mon Sep 17 00:00:00 2001 From: Shocker Date: Fri, 21 Sep 2012 02:00:12 +0300 Subject: Core/Spells: Rename some unknown spell auras --- src/server/game/Spells/Auras/SpellAuraDefines.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Spells/Auras/SpellAuraDefines.h b/src/server/game/Spells/Auras/SpellAuraDefines.h index 102986c01ea..9a8ed98df7a 100755 --- a/src/server/game/Spells/Auras/SpellAuraDefines.h +++ b/src/server/game/Spells/Auras/SpellAuraDefines.h @@ -390,17 +390,17 @@ enum AuraType SPELL_AURA_PROC_ON_POWER_AMOUNT = 328, SPELL_AURA_MOD_RUNE_REGEN_SPEED = 329, // NYI SPELL_AURA_CAST_WHILE_WALKING = 330, - SPELL_AURA_331 = 331, + SPELL_AURA_FORCE_WEATHER = 331, // NYI SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS = 332, SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS_2 = 333, - SPELL_AURA_334 = 334, + SPELL_AURA_MOD_BLIND = 334, // NYI SPELL_AURA_335 = 335, SPELL_AURA_MOD_FLYING_RESTRICTIONS = 336, // NYI SPELL_AURA_MOD_VENDOR_ITEMS_PRICES = 337, SPELL_AURA_MOD_DURABILITY_LOSS = 338, SPELL_AURA_INCREASE_SKILL_GAIN_CHANCE = 339, // NYI SPELL_AURA_340 = 340, - SPELL_AURA_341 = 341, // cooldown decrease + SPELL_AURA_MOD_SPELL_CATEGORY_COOLDOWN = 341, // NYI SPELL_AURA_MOD_MELEE_RANGED_HASTE_2 = 342, SPELL_AURA_343 = 343, SPELL_AURA_MOD_AUTOATTACK_DAMAGE = 344, -- cgit v1.2.3 From 6d2a74a20192f7ccc8bcfa07e476ce4fbd55941b Mon Sep 17 00:00:00 2001 From: Shocker Date: Fri, 21 Sep 2012 02:24:02 +0300 Subject: Core/Spells: Fix SPELL_AURA_FORCE_WEATHER --- src/server/game/Spells/Auras/SpellAuraDefines.h | 2 +- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 36 ++++++++++++++++++++++- src/server/game/Spells/Auras/SpellAuraEffects.h | 1 + 3 files changed, 37 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Spells/Auras/SpellAuraDefines.h b/src/server/game/Spells/Auras/SpellAuraDefines.h index 9a8ed98df7a..0eb197d203b 100755 --- a/src/server/game/Spells/Auras/SpellAuraDefines.h +++ b/src/server/game/Spells/Auras/SpellAuraDefines.h @@ -390,7 +390,7 @@ enum AuraType SPELL_AURA_PROC_ON_POWER_AMOUNT = 328, SPELL_AURA_MOD_RUNE_REGEN_SPEED = 329, // NYI SPELL_AURA_CAST_WHILE_WALKING = 330, - SPELL_AURA_FORCE_WEATHER = 331, // NYI + SPELL_AURA_FORCE_WEATHER = 331, SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS = 332, SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS_2 = 333, SPELL_AURA_MOD_BLIND = 334, // NYI diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 0aa599baae3..f468bab187d 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -38,6 +38,7 @@ #include "Vehicle.h" #include "Battlefield.h" #include "BattlefieldMgr.h" +#include "WeatherMgr.h" class Aura; // @@ -386,7 +387,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleNoImmediateEffect, //328 SPELL_AURA_PROC_ON_POWER_AMOUNT implemented in Unit::HandleAuraProcOnPowerAmount &AuraEffect::HandleNULL, //329 SPELL_AURA_MOD_RUNE_REGEN_SPEED &AuraEffect::HandleNoImmediateEffect, //330 SPELL_AURA_CAST_WHILE_WALKING - &AuraEffect::HandleNULL, //331 SPELL_AURA_331 + &AuraEffect::HandleAuraForceWeather, //331 SPELL_AURA_FORCE_WEATHER &AuraEffect::HandleNoImmediateEffect, //332 SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS implemented in WorldSession::HandleCastSpellOpcode &AuraEffect::HandleNoImmediateEffect, //333 SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS_2 implemented in WorldSession::HandleCastSpellOpcode &AuraEffect::HandleNULL, //334 SPELL_AURA_334 @@ -6714,3 +6715,36 @@ void AuraEffect::HandleRaidProcFromChargeWithValueAuraProc(AuraApplication* aurA sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "AuraEffect::HandleRaidProcFromChargeWithValueAuraProc: Triggering spell %u from aura %u proc", triggerSpellId, GetId()); target->CastCustomSpell(target, triggerSpellId, &value, NULL, NULL, true, NULL, this, GetCasterGUID()); } + +void AuraEffect::HandleAuraForceWeather(AuraApplication const* aurApp, uint8 mode, bool apply) const +{ + if (!(mode & AURA_EFFECT_HANDLE_REAL)) + return; + + Player* target = aurApp->GetTarget()->ToPlayer(); + + if (!target) + return; + + if (apply) + { + WorldPacket data(SMSG_WEATHER, (4 + 4 + 1)); + + data << uint32(GetMiscValue()) << 1.0f << uint8(0); + target->GetSession()->SendPacket(&data); + } + else + { + // send weather for current zone + if (Weather* weather = WeatherMgr::FindWeather(target->GetZoneId())) + weather->SendWeatherUpdateToPlayer(target); + else + { + if (!WeatherMgr::AddWeather(target->GetZoneId())) + { + // send fine weather packet to remove old weather + WeatherMgr::SendFineWeatherUpdateToPlayer(target); + } + } + } +} diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.h b/src/server/game/Spells/Auras/SpellAuraEffects.h index 6d29035b9e3..d5ee96ade5e 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.h +++ b/src/server/game/Spells/Auras/SpellAuraEffects.h @@ -277,6 +277,7 @@ class AuraEffect void HandleAuraOverrideSpells(AuraApplication const* aurApp, uint8 mode, bool apply) const; void HandleAuraSetVehicle(AuraApplication const* aurApp, uint8 mode, bool apply) const; void HandlePreventResurrection(AuraApplication const* aurApp, uint8 mode, bool apply) const; + void HandleAuraForceWeather(AuraApplication const* aurApp, uint8 mode, bool apply) const; // aura effect periodic tick handlers void HandlePeriodicDummyAuraTick(Unit* target, Unit* caster) const; -- cgit v1.2.3 From 84eb64295776e4328917adcca64e5fb50ea8af09 Mon Sep 17 00:00:00 2001 From: Shocker Date: Fri, 21 Sep 2012 02:37:54 +0300 Subject: Core/Spells: Don't update weather on zone change if player has SPELL_AURA_FORCE_WEATHER --- src/server/game/Entities/Player/Player.cpp | 2 +- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 0d6e5a37b90..463be7b42db 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -7657,7 +7657,7 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea) if (!zone) return; - if (sWorld->getBoolConfig(CONFIG_WEATHER)) + if (sWorld->getBoolConfig(CONFIG_WEATHER) && !HasAuraType(SPELL_AURA_FORCE_WEATHER)) { if (Weather* weather = WeatherMgr::FindWeather(zone->ID)) weather->SendWeatherUpdateToPlayer(this); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index f468bab187d..36733045c85 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -390,14 +390,14 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleAuraForceWeather, //331 SPELL_AURA_FORCE_WEATHER &AuraEffect::HandleNoImmediateEffect, //332 SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS implemented in WorldSession::HandleCastSpellOpcode &AuraEffect::HandleNoImmediateEffect, //333 SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS_2 implemented in WorldSession::HandleCastSpellOpcode - &AuraEffect::HandleNULL, //334 SPELL_AURA_334 + &AuraEffect::HandleNULL, //334 SPELL_AURA_MOD_BLIND &AuraEffect::HandleNULL, //335 SPELL_AURA_335 &AuraEffect::HandleNULL, //336 SPELL_AURA_MOD_FLYING_RESTRICTIONS &AuraEffect::HandleNoImmediateEffect, //337 SPELL_AURA_MOD_VENDOR_ITEMS_PRICES &AuraEffect::HandleNoImmediateEffect, //338 SPELL_AURA_MOD_DURABILITY_LOSS &AuraEffect::HandleNULL, //339 SPELL_AURA_INCREASE_SKILL_GAIN_CHANCE &AuraEffect::HandleNULL, //340 SPELL_AURA_340 - &AuraEffect::HandleNULL, //341 SPELL_AURA_341 + &AuraEffect::HandleNULL, //341 SSPELL_AURA_MOD_SPELL_CATEGORY_COOLDOWN &AuraEffect::HandleModMeleeRangedSpeedPct, //342 SPELL_AURA_MOD_MELEE_RANGED_HASTE_2 &AuraEffect::HandleNULL, //343 SPELL_AURA_343 &AuraEffect::HandleNULL, //344 SPELL_AURA_MOD_AUTOATTACK_DAMAGE -- cgit v1.2.3 From 50d1a1bf5c76ba6cce0e33c3907881295790fe2e Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 21 Sep 2012 13:35:59 +0200 Subject: Core/Auras: Defined more aura types and implemented aura 361 (used by 4 spells) --- src/server/game/Entities/Unit/Unit.cpp | 1 + src/server/game/Spells/Auras/SpellAuraDefines.h | 78 ++++++++++++------------- 2 files changed, 40 insertions(+), 39 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index a96a829b91f..3952f70af71 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -13542,6 +13542,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u switch (triggeredByAura->GetAuraType()) { case SPELL_AURA_PROC_TRIGGER_SPELL: + case SPELL_AURA_PROC_TRIGGER_SPELL_2: { sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell %u (triggered by %s aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); // Don`t drop charge or add cooldown for not started trigger diff --git a/src/server/game/Spells/Auras/SpellAuraDefines.h b/src/server/game/Spells/Auras/SpellAuraDefines.h index 0eb197d203b..09b28f017d5 100755 --- a/src/server/game/Spells/Auras/SpellAuraDefines.h +++ b/src/server/game/Spells/Auras/SpellAuraDefines.h @@ -79,7 +79,7 @@ enum AuraType SPELL_AURA_MOD_STEALTH_DETECT = 17, SPELL_AURA_MOD_INVISIBILITY = 18, SPELL_AURA_MOD_INVISIBILITY_DETECT = 19, - SPELL_AURA_OBS_MOD_HEALTH = 20, // 20, 21 unofficial + SPELL_AURA_OBS_MOD_HEALTH = 20, // 20, 21 unofficial SPELL_AURA_OBS_MOD_POWER = 21, SPELL_AURA_MOD_RESISTANCE = 22, SPELL_AURA_PERIODIC_TRIGGER_SPELL = 23, @@ -105,9 +105,9 @@ enum AuraType SPELL_AURA_PROC_TRIGGER_DAMAGE = 43, SPELL_AURA_TRACK_CREATURES = 44, SPELL_AURA_TRACK_RESOURCES = 45, - SPELL_AURA_46 = 46, // Ignore all Gear test spells + SPELL_AURA_46 = 46, // Ignore all Gear test spells SPELL_AURA_MOD_PARRY_PERCENT = 47, - SPELL_AURA_48 = 48, // One periodic spell + SPELL_AURA_48 = 48, // One periodic spell SPELL_AURA_MOD_DODGE_PERCENT = 49, SPELL_AURA_MOD_CRITICAL_HEALING_AMOUNT = 50, SPELL_AURA_MOD_BLOCK_PERCENT = 51, @@ -122,7 +122,7 @@ enum AuraType SPELL_AURA_MOD_PACIFY_SILENCE = 60, SPELL_AURA_MOD_SCALE = 61, SPELL_AURA_PERIODIC_HEALTH_FUNNEL = 62, - SPELL_AURA_63 = 63, // old SPELL_AURA_PERIODIC_MANA_FUNNEL + SPELL_AURA_63 = 63, // old SPELL_AURA_PERIODIC_MANA_FUNNEL SPELL_AURA_PERIODIC_MANA_LEECH = 64, SPELL_AURA_MOD_CASTING_SPEED_NOT_STACK = 65, SPELL_AURA_FEIGN_DEATH = 66, @@ -149,7 +149,7 @@ enum AuraType SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN = 87, SPELL_AURA_MOD_HEALTH_REGEN_PERCENT = 88, SPELL_AURA_PERIODIC_DAMAGE_PERCENT = 89, - SPELL_AURA_90 = 90, // old SPELL_AURA_MOD_RESIST_CHANCE + SPELL_AURA_90 = 90, // old SPELL_AURA_MOD_RESIST_CHANCE SPELL_AURA_MOD_DETECT_RANGE = 91, SPELL_AURA_PREVENTS_FLEEING = 92, SPELL_AURA_MOD_UNATTACKABLE = 93, @@ -200,7 +200,7 @@ enum AuraType SPELL_AURA_MOD_MELEE_HASTE = 138, SPELL_AURA_FORCE_REACTION = 139, SPELL_AURA_MOD_RANGED_HASTE = 140, - SPELL_AURA_141 = 141, // old SPELL_AURA_MOD_RANGED_AMMO_HASTE, unused now + SPELL_AURA_141 = 141, // old SPELL_AURA_MOD_RANGED_AMMO_HASTE, unused now SPELL_AURA_MOD_BASE_RESISTANCE_PCT = 142, SPELL_AURA_MOD_RESISTANCE_EXCLUSIVE = 143, SPELL_AURA_SAFE_FALL = 144, @@ -212,14 +212,14 @@ enum AuraType SPELL_AURA_MOD_SHIELD_BLOCKVALUE_PCT = 150, SPELL_AURA_TRACK_STEALTHED = 151, // Track Stealthed SPELL_AURA_MOD_DETECTED_RANGE = 152, // Mod Detected Range - SPELL_AURA_153 = 153, // old SPELL_AURA_SPLIT_DAMAGE_FLAT. unused 4.3.4 + SPELL_AURA_153 = 153, // old SPELL_AURA_SPLIT_DAMAGE_FLAT. unused 4.3.4 SPELL_AURA_MOD_STEALTH_LEVEL = 154, // Stealth Level Modifier SPELL_AURA_MOD_WATER_BREATHING = 155, // Mod Water Breathing SPELL_AURA_MOD_REPUTATION_GAIN = 156, // Mod Reputation Gain SPELL_AURA_PET_DAMAGE_MULTI = 157, // Mod Pet Damage SPELL_AURA_MOD_SHIELD_BLOCKVALUE = 158, SPELL_AURA_NO_PVP_CREDIT = 159, - SPELL_AURA_160 = 160, // old SPELL_AURA_MOD_AOE_AVOIDANCE. Unused 4.3.4 + SPELL_AURA_160 = 160, // old SPELL_AURA_MOD_AOE_AVOIDANCE. Unused 4.3.4 SPELL_AURA_MOD_HEALTH_REGEN_IN_COMBAT = 161, SPELL_AURA_POWER_BURN = 162, SPELL_AURA_MOD_CRIT_DAMAGE_BONUS = 163, @@ -228,7 +228,7 @@ enum AuraType SPELL_AURA_MOD_ATTACK_POWER_PCT = 166, SPELL_AURA_MOD_RANGED_ATTACK_POWER_PCT = 167, SPELL_AURA_MOD_DAMAGE_DONE_VERSUS = 168, - SPELL_AURA_169 = 169, // old SPELL_AURA_MOD_CRIT_PERCENT_VERSUS. unused 4.3.4 + SPELL_AURA_169 = 169, // old SPELL_AURA_MOD_CRIT_PERCENT_VERSUS. unused 4.3.4 SPELL_AURA_DETECT_AMORE = 170, SPELL_AURA_MOD_SPEED_NOT_STACK = 171, SPELL_AURA_MOD_MOUNTED_SPEED_NOT_STACK = 172, @@ -237,7 +237,7 @@ enum AuraType SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT = 175, SPELL_AURA_SPIRIT_OF_REDEMPTION = 176, SPELL_AURA_AOE_CHARM = 177, - SPELL_AURA_178 = 178, // old SPELL_AURA_MOD_DEBUFF_RESISTANCE, unused + SPELL_AURA_178 = 178, // old SPELL_AURA_MOD_DEBUFF_RESISTANCE, unused SPELL_AURA_MOD_ATTACKER_SPELL_CRIT_CHANCE = 179, SPELL_AURA_MOD_FLAT_SPELL_DAMAGE_VERSUS = 180, SPELL_AURA_181 = 181, // old SPELL_AURA_MOD_FLAT_SPELL_CRIT_DAMAGE_VERSUS - possible flat spell crit damage versus @@ -258,7 +258,7 @@ enum AuraType SPELL_AURA_MOD_COOLDOWN = 196, // only 24818 Noxious Breath SPELL_AURA_MOD_ATTACKER_SPELL_AND_WEAPON_CRIT_CHANCE = 197, SPELL_AURA_198 = 198, // old SPELL_AURA_MOD_ALL_WEAPON_SKILLS - SPELL_AURA_199 = 199, // old SPELL_AURA_MOD_INCREASES_SPELL_PCT_TO_HIT. unused 4.3.4 + SPELL_AURA_199 = 199, // old SPELL_AURA_MOD_INCREASES_SPELL_PCT_TO_HIT. unused 4.3.4 SPELL_AURA_MOD_XP_PCT = 200, SPELL_AURA_FLY = 201, SPELL_AURA_IGNORE_COMBAT_RESULT = 202, @@ -271,7 +271,7 @@ enum AuraType SPELL_AURA_MOD_MOUNTED_FLIGHT_SPEED_ALWAYS = 209, SPELL_AURA_MOD_VEHICLE_SPEED_ALWAYS = 210, SPELL_AURA_MOD_FLIGHT_SPEED_NOT_STACK = 211, - SPELL_AURA_212 = 212, // old SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT. unused 4.3.4 + SPELL_AURA_212 = 212, // old SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT. unused 4.3.4 SPELL_AURA_MOD_RAGE_FROM_DAMAGE_DEALT = 213, SPELL_AURA_214 = 214, SPELL_AURA_ARENA_PREPARATION = 215, @@ -318,7 +318,7 @@ enum AuraType SPELL_AURA_NO_REAGENT_USE = 256, SPELL_AURA_MOD_TARGET_RESIST_BY_SPELL_CLASS = 257, SPELL_AURA_258 = 258, - SPELL_AURA_259 = 259, // old SPELL_AURA_MOD_HOT_PCT, unused 4.3.4 + SPELL_AURA_259 = 259, // old SPELL_AURA_MOD_HOT_PCT, unused 4.3.4 SPELL_AURA_SCREEN_EFFECT = 260, SPELL_AURA_PHASE = 261, SPELL_AURA_ABILITY_IGNORE_AURASTATE = 262, @@ -327,19 +327,19 @@ enum AuraType SPELL_AURA_265 = 265, SPELL_AURA_266 = 266, SPELL_AURA_MOD_IMMUNE_AURA_APPLY_SCHOOL = 267, - SPELL_AURA_268 = 268, // old SPELL_AURA_MOD_ATTACK_POWER_OF_STAT_PERCENT. unused 4.3.4 + SPELL_AURA_268 = 268, // old SPELL_AURA_MOD_ATTACK_POWER_OF_STAT_PERCENT. unused 4.3.4 SPELL_AURA_MOD_IGNORE_TARGET_RESIST = 269, SPELL_AURA_270 = 270, // old SPELL_AURA_MOD_ABILITY_IGNORE_TARGET_RESIST, unused 4.3.4 SPELL_AURA_MOD_DAMAGE_FROM_CASTER = 271, SPELL_AURA_IGNORE_MELEE_RESET = 272, SPELL_AURA_X_RAY = 273, - SPELL_AURA_274 = 274, // old SPELL_AURA_ABILITY_CONSUME_NO_AMMO, unused 4.3.4 + SPELL_AURA_274 = 274, // old SPELL_AURA_ABILITY_CONSUME_NO_AMMO, unused 4.3.4 SPELL_AURA_MOD_IGNORE_SHAPESHIFT = 275, SPELL_AURA_MOD_DAMAGE_DONE_FOR_MECHANIC = 276, - SPELL_AURA_277 = 277, // old SPELL_AURA_MOD_MAX_AFFECTED_TARGETS. unused 4.3.4 + SPELL_AURA_277 = 277, // old SPELL_AURA_MOD_MAX_AFFECTED_TARGETS. unused 4.3.4 SPELL_AURA_MOD_DISARM_RANGED = 278, SPELL_AURA_INITIALIZE_IMAGES = 279, - SPELL_AURA_280 = 280, // old SPELL_AURA_MOD_ARMOR_PENETRATION_PCT unused 4.3.4 + SPELL_AURA_280 = 280, // old SPELL_AURA_MOD_ARMOR_PENETRATION_PCT unused 4.3.4 SPELL_AURA_MOD_HONOR_GAIN_PCT = 281, SPELL_AURA_MOD_BASE_HEALTH_PCT = 282, SPELL_AURA_MOD_HEALING_RECEIVED = 283, // Possibly only for some spell family class spells @@ -368,25 +368,25 @@ enum AuraType SPELL_AURA_306 = 306, SPELL_AURA_HEAL_ABSORB_TEST = 307, SPELL_AURA_MOD_CRIT_CHANCE_FOR_CASTER = 308, - SPELL_AURA_309 = 309, + SPELL_AURA_309 = 309, // Not used in 4.3.4 SPELL_AURA_MOD_CREATURE_AOE_DAMAGE_AVOIDANCE = 310, SPELL_AURA_311 = 311, - SPELL_AURA_312 = 312, // puts the caster in stealth? - SPELL_AURA_313 = 313, + SPELL_AURA_ANIM_REPLACEMENT_SET = 312, + SPELL_AURA_313 = 313, // Not used in 4.3.4 - related to mounts SPELL_AURA_PREVENT_RESURRECTION = 314, SPELL_AURA_UNDERWATER_WALKING = 315, - SPELL_AURA_316 = 316, // old SPELL_AURA_PERIODIC_HASTE. unused 4.3.4 + SPELL_AURA_PERIODIC_HASTE = 316, // Not used in 4.3.4 (name from 3.3.5a) SPELL_AURA_MOD_SPELL_POWER_PCT = 317, SPELL_AURA_MASTERY = 318, SPELL_AURA_MOD_MELEE_HASTE_3 = 319, SPELL_AURA_MOD_RANGED_HASTE_2 = 320, SPELL_AURA_321 = 321, SPELL_AURA_INTERFERE_TARGETTING = 322, // NYI - SPELL_AURA_323 = 323, + SPELL_AURA_323 = 323, // Not used in 4.3.4 SPELL_AURA_324 = 324, // spell critical chance (probably by school mask) - SPELL_AURA_325 = 325, + SPELL_AURA_325 = 325, // Not used in 4.3.4 SPELL_AURA_326 = 326, // phase related - SPELL_AURA_327 = 327, + SPELL_AURA_327 = 327, // Not used in 4.3.4 SPELL_AURA_PROC_ON_POWER_AMOUNT = 328, SPELL_AURA_MOD_RUNE_REGEN_SPEED = 329, // NYI SPELL_AURA_CAST_WHILE_WALKING = 330, @@ -399,13 +399,13 @@ enum AuraType SPELL_AURA_MOD_VENDOR_ITEMS_PRICES = 337, SPELL_AURA_MOD_DURABILITY_LOSS = 338, SPELL_AURA_INCREASE_SKILL_GAIN_CHANCE = 339, // NYI - SPELL_AURA_340 = 340, + SPELL_AURA_MOD_RESURRECTED_HEALTH_BY_GUILD_MEMBER = 340, // Increases health gained when resurrected by a guild member by X SPELL_AURA_MOD_SPELL_CATEGORY_COOLDOWN = 341, // NYI SPELL_AURA_MOD_MELEE_RANGED_HASTE_2 = 342, SPELL_AURA_343 = 343, SPELL_AURA_MOD_AUTOATTACK_DAMAGE = 344, SPELL_AURA_BYPASS_ARMOR_FOR_CASTER = 345, - SPELL_AURA_PROGRESS_BAR = 346, // NYI + SPELL_AURA_ENABLE_ALT_POWER = 346, // NYI SPELL_AURA_MOD_SPELL_COOLDOWN_BY_HASTE = 347, // NYI SPELL_AURA_DEPOSIT_BONUS_MONEY_IN_GUILD_BANK_ON_LOOT = 348, // NYI SPELL_AURA_MOD_CURRENCY_GAIN = 349, @@ -413,23 +413,23 @@ enum AuraType SPELL_AURA_351 = 351, SPELL_AURA_352 = 352, SPELL_AURA_MOD_CAMOUFLAGE = 353, // NYI - SPELL_AURA_354 = 354, + SPELL_AURA_354 = 354, // Restoration Shaman mastery - mod healing based on target's health (less = more healing) SPELL_AURA_355 = 355, - SPELL_AURA_356 = 356, - SPELL_AURA_357 = 357, + SPELL_AURA_356 = 356, // Arcane Mage mastery - mod damage based on current mana + SPELL_AURA_ENABLE_BOSS1_UNIT_FRAME = 357, SPELL_AURA_358 = 358, SPELL_AURA_359 = 359, - SPELL_AURA_360 = 360, - SPELL_AURA_361 = 361, - SPELL_AURA_362 = 362, - SPELL_AURA_363 = 363, - SPELL_AURA_364 = 364, - SPELL_AURA_365 = 365, - SPELL_AURA_366 = 366, + SPELL_AURA_PROC_TRIGGER_SPELL_COPY = 360, // Procs the same spell that caused this proc (Dragonwrath, Tarecgosa's Rest) + SPELL_AURA_PROC_TRIGGER_SPELL_2 = 361, + SPELL_AURA_362 = 362, // Not used in 4.3.4 + SPELL_AURA_MOD_NEXT_SPELL = 363, // Used by 101601 Throw Totem - causes the client to initialize spell cast with specified spell + SPELL_AURA_364 = 364, // Not used in 4.3.4 + SPELL_AURA_MAX_FAR_CLIP_PLANE = 365, // Overrides client's View Distance setting to max("Fair", current_setting) and turns off terrain display + SPELL_AURA_OVERRIDE_SPELL_POWER_BY_AP_PCT = 366, // Sets spellpower equal to % of attack power, discarding all other bonuses (from gear and buffs) SPELL_AURA_367 = 367, - SPELL_AURA_368 = 368, - SPELL_AURA_369 = 369, - SPELL_AURA_370 = 370, + SPELL_AURA_368 = 368, // Not used in 4.3.4 + SPELL_AURA_ENABLE_POWER_BAR_TIMER = 369, + SPELL_AURA_SET_FAIR_FAR_CLIP = 370, // Overrides client's View Distance setting to max("Fair", current_setting) TOTAL_AURAS = 371 // 4.3.4 }; -- cgit v1.2.3 From a692526b88c000d73c8ae6306d08abf8c194f4bd Mon Sep 17 00:00:00 2001 From: Shocker Date: Fri, 21 Sep 2012 20:06:32 +0300 Subject: Core/Spells: Ffix typo in recent commit --- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 36733045c85..85a1f07f490 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -397,7 +397,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleNoImmediateEffect, //338 SPELL_AURA_MOD_DURABILITY_LOSS &AuraEffect::HandleNULL, //339 SPELL_AURA_INCREASE_SKILL_GAIN_CHANCE &AuraEffect::HandleNULL, //340 SPELL_AURA_340 - &AuraEffect::HandleNULL, //341 SSPELL_AURA_MOD_SPELL_CATEGORY_COOLDOWN + &AuraEffect::HandleNULL, //341 SPELL_AURA_MOD_SPELL_CATEGORY_COOLDOWN &AuraEffect::HandleModMeleeRangedSpeedPct, //342 SPELL_AURA_MOD_MELEE_RANGED_HASTE_2 &AuraEffect::HandleNULL, //343 SPELL_AURA_343 &AuraEffect::HandleNULL, //344 SPELL_AURA_MOD_AUTOATTACK_DAMAGE -- cgit v1.2.3 From 424ac73766da612cbae8c55d47f1cd5a667f18d5 Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 25 Sep 2012 19:58:18 +0100 Subject: Core/Spells: Properly (hopefully) merge 335's Beacon of Light + 434 changes (also fixes build) Closes #7871 Closes #7872 --- src/server/game/Entities/Unit/Unit.cpp | 53 +++++++++++++++++----------------- 1 file changed, 26 insertions(+), 27 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index b9c08296840..8e13c24c64f 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -6359,42 +6359,41 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere { for (GroupReference *itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) { - Player* Member = itr->getSource(); + Player* Member = itr->getSource(); - // check if it was heal by paladin which casted this beacon of light - if (Aura const * aura = Member->GetAura(53563, victim->GetGUID())) - { - Unit* beaconTarget = Member; - - // do not proc when target of beacon of light is healed - if (beaconTarget == this) - return false; - - basepoints0 = int32(damage); - triggered_spell_id = 53652; - victim->CastCustomSpell(beaconTarget, triggered_spell_id, &basepoints0, NULL, NULL, true, 0, triggeredByAura); - int32 percent = 0; - switch (procSpell->Id) + // check if it was heal by paladin which casted this beacon of light + if (Aura const * aura = Member->GetAura(53563, victim->GetGUID())) { - case 85673: // Word of Glory - case 20473: // Holy Shock - case 19750: // Flash of Light - case 82326: // Divine Light - case 85222: // Light of Dawn - percent = triggerAmount; // 50% heal from these spells - break; - case 635: // Holy Light - percent = triggerAmount * 2; // 100% heal from Holy Light - break; + // do not proc when target of beacon of light is healed + if (Member == this) + return false; + + beaconTarget = Member; + basepoints0 = int32(damage); + triggered_spell_id = procSpell->IsRankOf(sSpellMgr->GetSpellInfo(365)) ? 53652 : 53654; + break; } - basepoints0 = CalculatePctN(damage, percent); - victim->CastCustomSpell(beaconTarget, 53652, &basepoints0, NULL, NULL, true); } } } if (triggered_spell_id && beaconTarget) { + int32 percent = 0; + switch (procSpell->Id) + { + case 85673: // Word of Glory + case 20473: // Holy Shock + case 19750: // Flash of Light + case 82326: // Divine Light + case 85222: // Light of Dawn + percent = triggerAmount; // 50% heal from these spells + break; + case 635: // Holy Light + percent = triggerAmount * 2; // 100% heal from Holy Light + break; + } + basepoints0 = CalculatePctN(damage, percent); victim->CastCustomSpell(beaconTarget, triggered_spell_id, &basepoints0, NULL, NULL, true, 0, triggeredByAura); return true; } -- cgit v1.2.3 From df12eba82044200541b80a65ce9a41d7699f78a3 Mon Sep 17 00:00:00 2001 From: Subv Date: Wed, 26 Sep 2012 10:50:44 -0500 Subject: Core/Entities: Use the Ranged Attack Power multiplier from the DBC to calculate ranged attack power bonus from agility --- src/server/game/DataStores/DBCStructure.h | 6 +++--- src/server/game/DataStores/DBCfmt.h | 2 +- src/server/game/Entities/Unit/StatSystem.cpp | 14 +------------- 3 files changed, 5 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index ded0ff65a94..d210347cc2a 100644 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -706,9 +706,9 @@ struct ChrClassesEntry //uint32 flags2; // 8 m_flags (0x08 HasRelicSlot) uint32 CinematicSequence; // 9 m_cinematicSequenceID uint32 expansion; // 10 m_required_expansion - uint32 APPerStrenth; // 11 - uint32 APPerAgility; // 12 - //uint32 // 13 + uint32 APPerStrenth; // 11 Attack Power bonus per point of strength + uint32 APPerAgility; // 12 Attack Power bonus per point of agility + uint32 RAPPerAgility; // 13 Ranged Attack Power bonus per point of agility }; struct ChrRacesEntry diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index 8dfc40d9b4e..41c4bc58a1d 100755 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -39,7 +39,7 @@ const char CharStartOutfitEntryfmt[]="diiiiiiiiiiiiiiiiiiiiiiiiixxxxxxxxxxxxxxxx const char CharTitlesEntryfmt[]="nxsxix"; const char ChatChannelsEntryfmt[]="nixsx"; -const char ChrClassesEntryfmt[]="nixsxxxixiiiix"; +const char ChrClassesEntryfmt[]="nixsxxxixiiiii"; const char ChrRacesEntryfmt[]="nxixiixixxxxixsxxxxxixxx"; const char ChrClassesXPowerTypesfmt[]="nii"; diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index c0f7f5c8939..b6ce94cd39b 100755 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -274,19 +274,7 @@ void Player::UpdateAttackPowerAndDamage(bool ranged) if (ranged) { index = UNIT_FIELD_RANGED_ATTACK_POWER; - - switch (getClass()) - { - case CLASS_HUNTER: - val2 = level * 2.0f + GetStat(STAT_AGILITY) * 2.0f - 20.0f; - break; - case CLASS_ROGUE: - val2 = level + GetStat(STAT_AGILITY) - 10.0f; - break; - case CLASS_WARRIOR: - val2 = level + GetStat(STAT_AGILITY) - 10.0f; - break; - } + val2 = (level + std::max(GetStat(STAT_AGILITY) - 10.0f, 0.0f)) * entry->RAPPerAgility; } else { -- cgit v1.2.3 From 0d8a8e94863734dada1bf66e316f6491482ed6b8 Mon Sep 17 00:00:00 2001 From: Subv Date: Wed, 26 Sep 2012 11:03:46 -0500 Subject: Core/Entities: Updated some pet stats code to Cataclysm. --- src/server/game/Entities/Unit/StatSystem.cpp | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index b6ce94cd39b..c77ea187eb3 100755 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -932,17 +932,8 @@ bool Guardian::UpdateStats(Stats stat) } else if (stat == STAT_STAMINA) { - if (owner->getClass() == CLASS_WARLOCK && isPet()) - { - ownersBonus = CalculatePctN(owner->GetStat(STAT_STAMINA), 75); - value += ownersBonus; - } - else - { - mod = 0.45f; - ownersBonus = float(owner->GetStat(stat)) * mod; - value += ownersBonus; - } + ownersBonus = CalculatePctN(owner->GetStat(STAT_STAMINA), 30); + value += ownersBonus; } //warlock's and mage's pets gain 30% of owner's intellect else if (stat == STAT_INTELLECT) @@ -1015,13 +1006,14 @@ void Guardian::UpdateArmor() float bonus_armor = 0.0f; UnitMods unitMod = UNIT_MOD_ARMOR; - // hunter and warlock pets gain 35% of owner's armor value - if (isPet()) - bonus_armor = float(CalculatePctN(m_owner->GetArmor(), 35)); + // hunter pets gain 35% of owner's armor value, warlock pets gain 100% of owner's armor + if (isHunterPet()) + bonus_armor = float(CalculatePctN(m_owner->GetArmor(), 70); + else if (isPet()) + bonus_armor = m_owner->GetArmor(); value = GetModifierValue(unitMod, BASE_VALUE); value *= GetModifierValue(unitMod, BASE_PCT); - value += GetStat(STAT_AGILITY) * 2.0f; value += GetModifierValue(unitMod, TOTAL_VALUE) + bonus_armor; value *= GetModifierValue(unitMod, TOTAL_PCT); -- cgit v1.2.3 From 1bb39edd02993f490ae1985ff126a89f1bf235ee Mon Sep 17 00:00:00 2001 From: Subv Date: Wed, 26 Sep 2012 12:10:23 -0500 Subject: Core/Maps: Use DBC value to determine the maximum depth that a player can reach in an area before being teleported back up. --- src/server/game/DataStores/DBCStructure.h | 2 +- src/server/game/DataStores/DBCfmt.h | 2 +- src/server/game/Entities/Player/Player.cpp | 4 ++-- src/server/game/Handlers/MovementHandler.cpp | 6 ++++-- 4 files changed, 8 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index d210347cc2a..704f252c625 100644 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -547,7 +547,7 @@ struct AreaTableEntry char* area_name; // 11 uint32 team; // 12 uint32 LiquidTypeOverride[4]; // 13-16 liquid override by type - //float unk13; // 17, + float MaxDepth; // 17, //float unk13; // 18, //uint32 unk19; // 19, All zeros (4.2.2) //uint32 unk20; // 20 4.0.0 diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index 41c4bc58a1d..bffe9263549 100755 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -26,7 +26,7 @@ const char Achievementfmt[]="niixsxiixixxii"; //const std::string CustomAchievementfmt="pppaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaapapaaaaaaaaaaaaaaaaaapp"; //const std::string CustomAchievementIndex = "ID"; const char AchievementCriteriafmt[]="niiiiiiiisiiiiixxiiiiii"; -const char AreaTableEntryfmt[]="iiinixxxxxisiiiiixxxxxxxxx"; +const char AreaTableEntryfmt[]="iiinixxxxxisiiiiifxxxxxxxx"; const char AreaGroupEntryfmt[]="niiiiiii"; const char AreaPOIEntryfmt[]="niiiiiiiiiiiffixixxixx"; const char AreaTriggerEntryfmt[]="nifffxxxfffff"; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 4c9df5f0ed4..f577a51e468 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -5524,7 +5524,7 @@ void Player::RepopAtGraveyard() AreaTableEntry const* zone = GetAreaEntryByAreaID(GetAreaId()); // Such zones are considered unreachable as a ghost and the player must be automatically revived - if ((!isAlive() && zone && zone->flags & AREA_FLAG_NEED_FLY) || GetTransport() || GetPositionZ() < -500.0f) + if ((!isAlive() && zone && zone->flags & AREA_FLAG_NEED_FLY) || GetTransport() || GetPositionZ() < zone->MaxDepth) { ResurrectPlayer(0.5f); SpawnCorpseBones(); @@ -5566,7 +5566,7 @@ void Player::RepopAtGraveyard() GetSession()->SendPacket(&data); } } - else if (GetPositionZ() < -500.0f) + else if (GetPositionZ() < zone->MaxDepth) TeleportTo(m_homebindMapId, m_homebindX, m_homebindY, m_homebindZ, GetOrientation()); } diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp index 0cc9263bfbd..43da34fa451 100644 --- a/src/server/game/Handlers/MovementHandler.cpp +++ b/src/server/game/Handlers/MovementHandler.cpp @@ -397,8 +397,10 @@ void WorldSession::HandleMovementOpcodes(WorldPacket& recvPacket) if (plrMover) // nothing is charmed, or player charmed { plrMover->UpdateFallInformationIfNeed(movementInfo, opcode); - - if (movementInfo.pos.GetPositionZ() < -500.0f) + + AreaTableEntry const* zone = GetAreaEntryByAreaID(plrMover->GetAreaId()); + float depth = zone ? zone->MaxDepth : -500.0f; + if (movementInfo.pos.GetPositionZ() < depth) { if (!(plrMover->GetBattleground() && plrMover->GetBattleground()->HandlePlayerUnderMap(_player))) { -- cgit v1.2.3 From eee2a4bd9c1e7a930a3b175c12aec5ee8f73cca2 Mon Sep 17 00:00:00 2001 From: Tuxity Date: Fri, 28 Sep 2012 11:17:18 +0200 Subject: Core/Spells: Add holy power resource handler. By @Greymane --- src/server/game/Spells/Spell.cpp | 38 ++++++++++++++++++++++++++++++++++++++ src/server/game/Spells/Spell.h | 1 + 2 files changed, 39 insertions(+) (limited to 'src') diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 3f5811fa86f..d62db4b4390 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3488,6 +3488,9 @@ void Spell::_handle_finish_phase() // Real add combo points from effects if (m_comboPointGain) m_caster->m_movedPlayer->GainSpellComboPoints(m_comboPointGain); + + if (m_spellInfo->PowerType == POWER_HOLY_POWER && m_caster->m_movedPlayer->getClass() == CLASS_PALADIN) + HandleHolyPower(m_caster->m_movedPlayer); } if (m_caster->m_extraAttacks && GetSpellInfo()->HasEffect(SPELL_EFFECT_ADD_EXTRA_ATTACKS)) @@ -4654,6 +4657,41 @@ void Spell::HandleThreatSpells() sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell %u, added an additional %f threat for %s %u target(s)", m_spellInfo->Id, threat, m_spellInfo->_IsPositiveSpell() ? "assisting" : "harming", uint32(m_UniqueTargetInfo.size())); } +void Spell::HandleHolyPower(Player* caster) +{ + if (!caster) + return; + + bool hit = true; + Player* modOwner = caster->GetSpellModOwner(); + + m_powerCost = caster->GetPower(POWER_HOLY_POWER); // Always use all the holy power we have + + if (!m_powerCost || !modOwner) + return; + + if (uint64 targetGUID = m_targets.GetUnitTargetGUID()) + { + for (std::list::iterator ihit = m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit) + { + if (ihit->targetGUID == targetGUID) + { + if (ihit->missCondition != SPELL_MISS_NONE && ihit->missCondition != SPELL_MISS_MISS) + hit = false; + + break; + } + } + + // The spell did hit the target, apply aura cost mods if there are any. + if (hit) + { + modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_COST, m_powerCost); + m_caster->ModifyPower(POWER_HOLY_POWER, -m_powerCost); + } + } +} + void Spell::HandleEffects(Unit* pUnitTarget, Item* pItemTarget, GameObject* pGOTarget, uint32 i, SpellEffectHandleMode mode) { effectHandleMode = mode; diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h index f43c13c8fae..9ea9fef9aaf 100755 --- a/src/server/game/Spells/Spell.h +++ b/src/server/game/Spells/Spell.h @@ -435,6 +435,7 @@ class Spell void SendChannelStart(uint32 duration); void SendResurrectRequest(Player* target); + void HandleHolyPower(Player* caster); void HandleEffects(Unit* pUnitTarget, Item* pItemTarget, GameObject* pGOTarget, uint32 i, SpellEffectHandleMode mode); void HandleThreatSpells(); -- cgit v1.2.3 From dea3ca95f6cef79a23a2f0f68b55545c4bd82b41 Mon Sep 17 00:00:00 2001 From: Sovak Date: Sat, 29 Sep 2012 13:43:14 +0200 Subject: Core/Build: Fix compile Signed-off-by: Sovak --- src/server/game/Entities/Unit/StatSystem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index c77ea187eb3..853f4ae2a1d 100755 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -1008,7 +1008,7 @@ void Guardian::UpdateArmor() // hunter pets gain 35% of owner's armor value, warlock pets gain 100% of owner's armor if (isHunterPet()) - bonus_armor = float(CalculatePctN(m_owner->GetArmor(), 70); + bonus_armor = float(CalculatePctN(m_owner->GetArmor(), 70)); else if (isPet()) bonus_armor = m_owner->GetArmor(); -- cgit v1.2.3 From 4fabb0ba32e29b8a8150a353e532ec01175a41cd Mon Sep 17 00:00:00 2001 From: Nexflame Date: Mon, 8 Oct 2012 22:52:13 +0300 Subject: Fix Compile --- .../scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp index 64210e97122..ce1e45f21e8 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp @@ -1016,7 +1016,7 @@ class npc_meteor_strike_initial : public CreatureScript _meteorList.clear(); for (uint8 i = 0; i < 4; i++) { - angle[i] = MapManager::NormalizeOrientation(angle[i]); + angle[i] = Position::NormalizeOrientation(angle[i]); me->SetOrientation(angle[i]); me->GetNearPosition(newPos, 10.0f, 0.0f); // Exact distance if (Creature* meteor = me->SummonCreature(NPC_METEOR_STRIKE_NORTH + i, newPos, TEMPSUMMON_TIMED_DESPAWN, 30000)) -- cgit v1.2.3 From afba120838d8da9af5de09fe1ca1ec83248e2e60 Mon Sep 17 00:00:00 2001 From: Gigatotem Date: Tue, 9 Oct 2012 01:25:18 +0200 Subject: Items/PVP Trinkets: As of Cataclysm you're able to PVP Trinket out of Disarms and Silence effects. --- src/server/game/Miscellaneous/SharedDefines.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index bc62c46830f..9fec219f5cd 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -1437,7 +1437,7 @@ enum Mechanics #define IMMUNE_TO_MOVEMENT_IMPAIRMENT_AND_LOSS_CONTROL_MASK (\ (1< Date: Tue, 9 Oct 2012 01:26:52 +0200 Subject: Typo fix with Previous commit. --- src/server/game/Miscellaneous/SharedDefines.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 9fec219f5cd..2c0dd0aa1a3 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -1437,7 +1437,7 @@ enum Mechanics #define IMMUNE_TO_MOVEMENT_IMPAIRMENT_AND_LOSS_CONTROL_MASK (\ (1< Date: Wed, 10 Oct 2012 09:13:03 -0500 Subject: Core/Players: Fixed a possible crash if a player is in an invalid zone Thanks to the ones who commented in the commit that introduced the issue. --- src/server/game/Entities/Player/Player.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 9177672e8c7..d33dac1a446 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -5524,7 +5524,7 @@ void Player::RepopAtGraveyard() AreaTableEntry const* zone = GetAreaEntryByAreaID(GetAreaId()); // Such zones are considered unreachable as a ghost and the player must be automatically revived - if ((!isAlive() && zone && zone->flags & AREA_FLAG_NEED_FLY) || GetTransport() || GetPositionZ() < zone->MaxDepth) + if ((!isAlive() && zone && zone->flags & AREA_FLAG_NEED_FLY) || GetTransport() || GetPositionZ() < (zone ? zone->MaxDepth : -500.0f)) { ResurrectPlayer(0.5f); SpawnCorpseBones(); -- cgit v1.2.3 From 1f699f2cd300895a5889d24d7513b09b544638ff Mon Sep 17 00:00:00 2001 From: Subv Date: Wed, 10 Oct 2012 10:14:26 -0500 Subject: Core/Scripts: Fixed the command to restore deleted characters. --- src/server/scripts/Commands/cs_character.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/scripts/Commands/cs_character.cpp b/src/server/scripts/Commands/cs_character.cpp index 9f910cbaf75..d6c4ef54d15 100644 --- a/src/server/scripts/Commands/cs_character.cpp +++ b/src/server/scripts/Commands/cs_character.cpp @@ -224,7 +224,7 @@ public: stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_NAME_DATA); stmt->setUInt32(0, delInfo.lowGuid); if (PreparedQueryResult result = CharacterDatabase.Query(stmt)) - sWorld->AddCharacterNameData(delInfo.lowGuid, delInfo.name, (*result)[2].GetUInt8(), (*result)[0].GetUInt8(), (*result)[1].GetUInt8(), (*result)[2].GetUInt8()); + sWorld->AddCharacterNameData(delInfo.lowGuid, delInfo.name, (*result)[2].GetUInt8(), (*result)[0].GetUInt8(), (*result)[1].GetUInt8(), (*result)[3].GetUInt8()); } static void HandleCharacterLevel(Player* player, uint64 playerGuid, uint32 oldLevel, uint32 newLevel, ChatHandler* handler) -- cgit v1.2.3 From ec21666cc60ad4a564a1153a5147eaf165e14944 Mon Sep 17 00:00:00 2001 From: Subv Date: Wed, 10 Oct 2012 15:45:05 -0500 Subject: Core/Build: Fixed some compile errors left from the merge. --- src/server/game/Achievements/AchievementMgr.cpp | 351 +----------------------- 1 file changed, 7 insertions(+), 344 deletions(-) (limited to 'src') diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index e4c021106fc..389f2bef824 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -1147,6 +1147,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, case ACHIEVEMENT_CRITERIA_TYPE_SPECIAL_PVP_KILL: case ACHIEVEMENT_CRITERIA_TYPE_GET_KILLING_BLOWS: case ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL_AT_AREA: + case ACHIEVEMENT_CRITERIA_TYPE_WIN_ARENA: // This also behaves like ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA SetCriteriaProgress(achievementCriteria, 1, referencePlayer, PROGRESS_ACCUMULATE); break; // std case: increment at miscValue1 @@ -1385,350 +1386,6 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, case ACHIEVEMENT_CRITERIA_TYPE_REACH_GUILD_LEVEL: SetCriteriaProgress(achievementCriteria, miscValue1, referencePlayer); break; - case ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION: - { - // skip faction check only at loading - if (miscValue1 && miscValue1 != achievementCriteria->gain_reputation.factionID) - continue; - - int32 reputation = GetPlayer()->GetReputationMgr().GetReputation(achievementCriteria->gain_reputation.factionID); - if (reputation > 0) - SetCriteriaProgress(achievementCriteria, reputation); - break; - } - case ACHIEVEMENT_CRITERIA_TYPE_GAIN_EXALTED_REPUTATION: - { - SetCriteriaProgress(achievementCriteria, GetPlayer()->GetReputationMgr().GetExaltedFactionCount()); - break; - } - case ACHIEVEMENT_CRITERIA_TYPE_VISIT_BARBER_SHOP: - { - // skip for login case - if (!miscValue1) - continue; - SetCriteriaProgress(achievementCriteria, 1); - break; - } - case ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM: - { - // miscvalue1 = itemid - // miscvalue2 = itemSlot - if (!miscValue1) - continue; - - if (miscValue2 != achievementCriteria->equip_epic_item.itemSlot) - continue; - - // check item level and quality via achievement_criteria_data - AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria); - if (!data || !data->Meets(GetPlayer(), 0, miscValue1)) - continue; - - SetCriteriaProgress(achievementCriteria, 1); - break; - } - - case ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED_ON_LOOT: - case ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED_ON_LOOT: - { - // miscvalue1 = itemid - // miscvalue2 = diced value - if (!miscValue1) - continue; - if (miscValue2 != achievementCriteria->roll_greed_on_loot.rollValue) - continue; - - ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(miscValue1); - if (!pProto) - continue; - - // check item level via achievement_criteria_data - AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria); - if (!data || !data->Meets(GetPlayer(), 0, pProto->ItemLevel)) - continue; - - SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); - break; - } - case ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE: - { - // miscvalue1 = emote - if (!miscValue1) - continue; - if (miscValue1 != achievementCriteria->do_emote.emoteID) - continue; - if (achievementCriteria->do_emote.count) - { - // those requirements couldn't be found in the dbc - AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria); - if (!data || !data->Meets(GetPlayer(), unit)) - continue; - } - - SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); - break; - } - case ACHIEVEMENT_CRITERIA_TYPE_DAMAGE_DONE: - case ACHIEVEMENT_CRITERIA_TYPE_HEALING_DONE: - { - if (!miscValue1) - continue; - - if (achievementCriteria->additionalRequirements[0].additionalRequirement_type == ACHIEVEMENT_CRITERIA_CONDITION_BG_MAP) - { - if (GetPlayer()->GetMapId() != achievementCriteria->additionalRequirements[0].additionalRequirement_value) - continue; - - // map specific case (BG in fact) expected player targeted damage/heal - if (!unit || unit->GetTypeId() != TYPEID_PLAYER) - continue; - } - - SetCriteriaProgress(achievementCriteria, miscValue1, PROGRESS_ACCUMULATE); - break; - } - case ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM: - // miscvalue1 = item_id - if (!miscValue1) - continue; - if (miscValue1 != achievementCriteria->equip_item.itemID) - continue; - - SetCriteriaProgress(achievementCriteria, 1); - break; - case ACHIEVEMENT_CRITERIA_TYPE_USE_GAMEOBJECT: - // miscvalue1 = go entry - if (!miscValue1) - continue; - if (miscValue1 != achievementCriteria->use_gameobject.goEntry) - continue; - - SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); - break; - case ACHIEVEMENT_CRITERIA_TYPE_FISH_IN_GAMEOBJECT: - if (!miscValue1) - continue; - if (miscValue1 != achievementCriteria->fish_in_gameobject.goEntry) - continue; - - SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); - break; - case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS: - { - if (miscValue1 && miscValue1 != achievementCriteria->learn_skillline_spell.skillLine) - continue; - - uint32 spellCount = 0; - for (PlayerSpellMap::const_iterator spellIter = GetPlayer()->GetSpellMap().begin(); - spellIter != GetPlayer()->GetSpellMap().end(); - ++spellIter) - { - SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellIter->first); - for (SkillLineAbilityMap::const_iterator skillIter = bounds.first; skillIter != bounds.second; ++skillIter) - { - if (skillIter->second->skillId == achievementCriteria->learn_skillline_spell.skillLine) - spellCount++; - } - } - SetCriteriaProgress(achievementCriteria, spellCount); - break; - } - case ACHIEVEMENT_CRITERIA_TYPE_WIN_DUEL: - // AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case - if (!miscValue1) - continue; - - if (achievementCriteria->win_duel.duelCount) - { - // those requirements couldn't be found in the dbc - AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria); - if (!data) - continue; - - if (!data->Meets(GetPlayer(), unit)) - continue; - } - - SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); - break; - case ACHIEVEMENT_CRITERIA_TYPE_GAIN_REVERED_REPUTATION: - SetCriteriaProgress(achievementCriteria, GetPlayer()->GetReputationMgr().GetReveredFactionCount()); - break; - case ACHIEVEMENT_CRITERIA_TYPE_GAIN_HONORED_REPUTATION: - SetCriteriaProgress(achievementCriteria, GetPlayer()->GetReputationMgr().GetHonoredFactionCount()); - break; - case ACHIEVEMENT_CRITERIA_TYPE_KNOWN_FACTIONS: - SetCriteriaProgress(achievementCriteria, GetPlayer()->GetReputationMgr().GetVisibleFactionCount()); - break; - case ACHIEVEMENT_CRITERIA_TYPE_LOOT_EPIC_ITEM: - case ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM: - { - // AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case - if (!miscValue1) - continue; - ItemTemplate const* proto = sObjectMgr->GetItemTemplate(miscValue1); - if (!proto || proto->Quality < ITEM_QUALITY_EPIC) - continue; - SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); - break; - } - case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LINE: - { - if (miscValue1 && miscValue1 != achievementCriteria->learn_skill_line.skillLine) - continue; - - uint32 spellCount = 0; - for (PlayerSpellMap::const_iterator spellIter = GetPlayer()->GetSpellMap().begin(); - spellIter != GetPlayer()->GetSpellMap().end(); - ++spellIter) - { - SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellIter->first); - for (SkillLineAbilityMap::const_iterator skillIter = bounds.first; skillIter != bounds.second; ++skillIter) - if (skillIter->second->skillId == achievementCriteria->learn_skill_line.skillLine) - spellCount++; - } - SetCriteriaProgress(achievementCriteria, spellCount); - break; - } - case ACHIEVEMENT_CRITERIA_TYPE_EARN_HONORABLE_KILL: - SetCriteriaProgress(achievementCriteria, GetPlayer()->GetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS)); - break; - case ACHIEVEMENT_CRITERIA_TYPE_HK_CLASS: - if (!miscValue1 || miscValue1 != achievementCriteria->hk_class.classID) - continue; - - SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); - break; - case ACHIEVEMENT_CRITERIA_TYPE_HK_RACE: - if (!miscValue1 || miscValue1 != achievementCriteria->hk_race.raceID) - continue; - - SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); - break; - case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_GOLD_VALUE_OWNED: - SetCriteriaProgress(achievementCriteria, GetPlayer()->GetMoney(), PROGRESS_HIGHEST); - break; - case ACHIEVEMENT_CRITERIA_TYPE_EARN_ACHIEVEMENT_POINTS: - { - if (!miscValue1) - { - uint32 points = 0; - for (CompletedAchievementMap::iterator itr = m_completedAchievements.begin(); itr != m_completedAchievements.end(); ++itr) - if (AchievementEntry const* pAchievement = sAchievementStore.LookupEntry(itr->first)) - points += pAchievement->points; - SetCriteriaProgress(achievementCriteria, points, PROGRESS_SET); - } - else - SetCriteriaProgress(achievementCriteria, miscValue1, PROGRESS_ACCUMULATE); - break; - } - case ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE: - { - if (!miscValue1 || miscValue1 != achievementCriteria->bg_objective.objectiveId) - continue; - - // those requirements couldn't be found in the dbc - AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria); - if (!data || !data->Meets(GetPlayer(), unit)) - continue; - - SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); - break; - } - case ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL: - case ACHIEVEMENT_CRITERIA_TYPE_SPECIAL_PVP_KILL: - case ACHIEVEMENT_CRITERIA_TYPE_GET_KILLING_BLOWS: - { - // skip login update - if (!miscValue1) - continue; - - // those requirements couldn't be found in the dbc - AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria); - if (!data || !data->Meets(GetPlayer(), unit)) - continue; - - SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); - break; - } - case ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL_AT_AREA: - { - if (!miscValue1 || miscValue1 != achievementCriteria->honorable_kill_at_area.areaID) - continue; - - SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); - break; - } - case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_TEAM_RATING: - { - uint32 reqTeamType = achievementCriteria->highest_team_rating.teamtype; - - if (miscValue1) - { - if (miscValue2 != reqTeamType) - continue; - - SetCriteriaProgress(achievementCriteria, miscValue1, PROGRESS_HIGHEST); - } - else // login case - { - for (uint32 arena_slot = 0; arena_slot < MAX_ARENA_SLOT; ++arena_slot) - { - uint32 teamId = GetPlayer()->GetArenaTeamId(arena_slot); - if (!teamId) - continue; - - ArenaTeam* team = sArenaTeamMgr->GetArenaTeamById(teamId); - if (!team || team->GetType() != reqTeamType) - continue; - - SetCriteriaProgress(achievementCriteria, team->GetStats().Rating, PROGRESS_HIGHEST); - break; - } - } - - break; - } - case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_PERSONAL_RATING: - { - uint32 reqTeamType = achievementCriteria->highest_personal_rating.teamtype; - - if (miscValue1) - { - if (miscValue2 != reqTeamType) - continue; - - SetCriteriaProgress(achievementCriteria, miscValue1, PROGRESS_HIGHEST); - } - else // login case - { - for (uint32 arena_slot = 0; arena_slot < MAX_ARENA_SLOT; ++arena_slot) - { - uint32 teamId = GetPlayer()->GetArenaTeamId(arena_slot); - if (!teamId) - continue; - - ArenaTeam* team = sArenaTeamMgr->GetArenaTeamById(teamId); - if (!team || team->GetType() != reqTeamType) - continue; - - if (ArenaTeamMember const* member = team->GetMember(GetPlayer()->GetGUID())) - { - SetCriteriaProgress(achievementCriteria, member->PersonalRating, PROGRESS_HIGHEST); - break; - } - } - } - - break; - } - case ACHIEVEMENT_CRITERIA_TYPE_WIN_ARENA: // This also behaves like ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA - { - // Check map id requirement - if (miscValue1 == achievementCriteria->win_arena.mapID) - SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); - break; - } // std case: not exist in DBC, not triggered in code as result case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEALTH: case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_SPELLPOWER: @@ -3026,6 +2683,10 @@ bool AchievementMgr::RequirementsSatisfied(AchievementCriteriaEntry const *ac || miscValue1 != achievementCriteria->currencyGain.currency) return false; break; + case ACHIEVEMENT_CRITERIA_TYPE_WIN_ARENA: + if (miscValue1 != achievementCriteria->win_arena.mapID) + return false; + break; default: break; } @@ -3377,6 +3038,8 @@ char const* AchievementGlobalMgr::GetCriteriaTypeString(AchievementCriteriaTypes return "HONORABLE_KILLS_GUILD"; case ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE_TYPE_GUILD: return "KILL_CREATURE_TYPE_GUILD"; + case ACHIEVEMENT_CRITERIA_TYPE_WIN_ARENA: + return "WIN_ARENA"; default: return "MISSING_TYPE"; } -- cgit v1.2.3 From eff164caf68b5655185b5fe91e356cbb2d9df7c5 Mon Sep 17 00:00:00 2001 From: Subv Date: Wed, 10 Oct 2012 17:31:00 -0500 Subject: Core/Build: Fixed some more errors from recent merge. Closes #8038 --- src/server/game/Achievements/AchievementMgr.cpp | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'src') diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 389f2bef824..0fe66c94534 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -1386,14 +1386,6 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, case ACHIEVEMENT_CRITERIA_TYPE_REACH_GUILD_LEVEL: SetCriteriaProgress(achievementCriteria, miscValue1, referencePlayer); break; - // std case: not exist in DBC, not triggered in code as result - case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEALTH: - case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_SPELLPOWER: - case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_ARMOR: - case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_POWER: - case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_STAT: - case ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_RATING: - break; // FIXME: not triggered in code as result, need to implement case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_RAID: case ACHIEVEMENT_CRITERIA_TYPE_PLAY_ARENA: @@ -3038,8 +3030,6 @@ char const* AchievementGlobalMgr::GetCriteriaTypeString(AchievementCriteriaTypes return "HONORABLE_KILLS_GUILD"; case ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE_TYPE_GUILD: return "KILL_CREATURE_TYPE_GUILD"; - case ACHIEVEMENT_CRITERIA_TYPE_WIN_ARENA: - return "WIN_ARENA"; default: return "MISSING_TYPE"; } -- cgit v1.2.3 From a1c0d81fd6a1f4d61c8cd499ecf440fc56ef6196 Mon Sep 17 00:00:00 2001 From: kaelima Date: Thu, 11 Oct 2012 08:34:00 +0200 Subject: Fix build Remove 2 unused header includes --- src/server/game/Handlers/CharacterHandler.cpp | 2 +- .../scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp | 1 - src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index b5a6bee8319..a37362ce7bc 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -1734,7 +1734,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) Field* fields = result->Fetch(); uint32 at_loginFlags = fields[0].GetUInt16(); char const* knownTitlesStr = fields[1].GetCString(); - uint32 used_loginFlag = ((recv_data.GetOpcode() == CMSG_CHAR_RACE_CHANGE) ? AT_LOGIN_CHANGE_RACE : AT_LOGIN_CHANGE_FACTION); + uint32 used_loginFlag = ((recvData.GetOpcode() == CMSG_CHAR_RACE_CHANGE) ? AT_LOGIN_CHANGE_RACE : AT_LOGIN_CHANGE_FACTION); if (!sObjectMgr->GetPlayerInfo(race, playerClass)) { diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp index ce1e45f21e8..497ce889c62 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp @@ -20,7 +20,6 @@ #include "SpellAuraEffects.h" #include "Spell.h" #include "Vehicle.h" -#include "MapManager.h" #include "GameObjectAI.h" #include "ScriptedCreature.h" #include "ruby_sanctum.h" diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp index aab54785213..5ad7375f259 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp @@ -20,7 +20,6 @@ #include "SpellScript.h" #include "SpellAuraEffects.h" #include "oculus.h" -#include "MapManager.h" enum Says { -- cgit v1.2.3 From b881f131c1c86560b43a346c058f8faeb9754d4c Mon Sep 17 00:00:00 2001 From: Tuxity Date: Fri, 12 Oct 2012 00:26:05 +0200 Subject: Core/Battlegrounds: Now it works ! Thanks to @Subv, @Drethek and @Zakamurite Todo: - Display countdown when bg start (packet related) - Implement packet SMSG_BATTLEFIELD_STATUS_WAITFORGROUPS - Maybe little typos here and here Signed-off-by: Tuxity --- src/server/game/Battlefield/Battlefield.cpp | 3 +- src/server/game/Battlegrounds/Battleground.cpp | 43 ++-- src/server/game/Battlegrounds/Battleground.h | 57 +++-- src/server/game/Battlegrounds/BattlegroundMgr.cpp | 259 +++++++++------------ src/server/game/Battlegrounds/BattlegroundMgr.h | 2 +- .../game/Battlegrounds/BattlegroundQueue.cpp | 8 +- .../game/Battlegrounds/Zones/BattlegroundWS.cpp | 4 +- src/server/game/Entities/Player/Player.h | 14 +- src/server/game/Groups/Group.cpp | 2 +- src/server/game/Handlers/BattleGroundHandler.cpp | 122 +++++----- 10 files changed, 258 insertions(+), 256 deletions(-) (limited to 'src') diff --git a/src/server/game/Battlefield/Battlefield.cpp b/src/server/game/Battlefield/Battlefield.cpp index b7572c6f2b0..cfc1de4e68e 100644 --- a/src/server/game/Battlefield/Battlefield.cpp +++ b/src/server/game/Battlefield/Battlefield.cpp @@ -34,13 +34,12 @@ Battlefield::Battlefield() { - m_Guid = MAKE_NEW_GUID(m_TypeId, 0, HIGHGUID_TYPE_BATTLEGROUND); - m_Timer = 0; m_IsEnabled = true; m_isActive = false; m_DefenderTeam = TEAM_NEUTRAL; + m_Guid = 0; m_TypeId = 0; m_BattleId = 0; m_ZoneId = 0; diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index 164b0217a43..1b303760095 100755 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -131,7 +131,7 @@ void Battleground::BroadcastWorker(Do& _do) Battleground::Battleground() { - m_Guid = MAKE_NEW_GUID(m_TypeID, 0, HIGHGUID_TYPE_BATTLEGROUND); + m_Guid = 0; m_TypeID = BATTLEGROUND_TYPE_NONE; m_RandomTypeID = BATTLEGROUND_TYPE_NONE; m_InstanceID = 0; @@ -273,7 +273,7 @@ void Battleground::Update(uint32 diff) // after 47 minutes without one team losing, the arena closes with no winner and no rating change if (isArena()) { - if (GetStartTime() >= 47*MINUTE*IN_MILLISECONDS) + if (GetElapsedTime() >= 47*MINUTE*IN_MILLISECONDS) { UpdateArenaWorldState(); CheckArenaAfterTimerConditions(); @@ -456,6 +456,10 @@ inline void Battleground::_ProcessJoin(uint32 diff) // ********************************************************* ModifyStartDelayTime(diff); + // I know it's a too big but it's the value sent in packet, I get it from retail sniff. + // I think it's link to the countdown when bgs start + SetRemainingTime(300000); + if (m_ResetStatTimer > 5000) { m_ResetStatTimer = 0; @@ -521,7 +525,7 @@ inline void Battleground::_ProcessJoin(uint32 diff) WorldPacket status; BattlegroundQueueTypeId bgQueueTypeId = sBattlegroundMgr->BGQueueTypeId(m_TypeID, GetArenaType()); uint32 queueSlot = player->GetBattlegroundQueueIndex(bgQueueTypeId); - sBattlegroundMgr->BuildBattlegroundStatusPacket(&status, this, player, queueSlot, STATUS_IN_PROGRESS, 0, GetStartTime(), GetArenaType()); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&status, this, player, queueSlot, STATUS_IN_PROGRESS, 0, GetElapsedTime(), GetArenaType()); player->GetSession()->SendPacket(&status); player->RemoveAurasDueToSpell(SPELL_ARENA_PREPARATION); @@ -560,6 +564,9 @@ inline void Battleground::_ProcessJoin(uint32 diff) sWorld->SendWorldText(LANG_BG_STARTED_ANNOUNCE_WORLD, GetName(), GetMinLevel(), GetMaxLevel()); } } + + if (m_EndTime > 0 && (m_EndTime -= diff) > 0) + m_EndTime -= diff; } inline void Battleground::_ProcessLeave(uint32 diff) @@ -758,7 +765,7 @@ void Battleground::EndBattleground(uint32 winner) SetStatus(STATUS_WAIT_LEAVE); //we must set it this way, because end time is sent in packet! - m_EndTime = TIME_TO_AUTOREMOVE; + m_EndTime = TIME_AUTOCLOSE_BATTLEGROUND; // arena rating calculation if (isArena() && isRated()) @@ -919,9 +926,9 @@ void Battleground::EndBattleground(uint32 winner) player->GetSession()->SendPacket(&pvpLogData); WorldPacket data; - sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, this, player, player->GetBattlegroundQueueIndex(bgQueueTypeId), STATUS_IN_PROGRESS, TIME_TO_AUTOREMOVE, GetStartTime(), GetArenaType()); - + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, this, player, player->GetBattlegroundQueueIndex(bgQueueTypeId), STATUS_IN_PROGRESS, player->GetBattlegroundQueueJoinTime(GetTypeID()), GetElapsedTime(), GetArenaType()); player->GetSession()->SendPacket(&data); + player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_BATTLEGROUND, 1); } @@ -992,10 +999,11 @@ void Battleground::RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPac RemovePlayer(player, guid, team); // BG subclass specific code + BattlegroundTypeId bgTypeId = GetTypeID(); + BattlegroundQueueTypeId bgQueueTypeId = BattlegroundMgr::BGQueueTypeId(GetTypeID(), GetArenaType()); + if (participant) // if the player was a match participant, remove auras, calc rating, update queue { - BattlegroundTypeId bgTypeId = GetTypeID(); - BattlegroundQueueTypeId bgQueueTypeId = BattlegroundMgr::BGQueueTypeId(GetTypeID(), GetArenaType()); if (player) { player->ClearAfkReports(); @@ -1023,7 +1031,7 @@ void Battleground::RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPac if (SendPacket) { WorldPacket data; - sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, this, player, player->GetBattlegroundQueueIndex(bgQueueTypeId), STATUS_NONE, 0, 0, 0); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, this, player, player->GetBattlegroundQueueIndex(bgQueueTypeId), STATUS_NONE, player->GetBattlegroundQueueJoinTime(bgTypeId), 0, 0); player->GetSession()->SendPacket(&data); } @@ -1071,6 +1079,7 @@ void Battleground::RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPac player->SetBattlegroundId(0, BATTLEGROUND_TYPE_NONE); // We're not in BG. // reset destination bg team player->SetBGTeam(0); + player->RemoveBattlegroundQueueJoinTime(bgTypeId); if (Transport) player->TeleportToBGEntryPoint(); @@ -1086,8 +1095,8 @@ void Battleground::Reset() { SetWinner(WINNER_NONE); SetStatus(STATUS_WAIT_QUEUE); - SetStartTime(0); - SetEndTime(0); + SetElapsedTime(0); + SetRemainingTime(0); SetLastResurrectTime(0); SetArenaType(0); SetRated(false); @@ -1113,7 +1122,7 @@ void Battleground::Reset() void Battleground::StartBattleground() { - SetStartTime(0); + SetElapsedTime(0); SetLastResurrectTime(0); // add BG to free slot queue AddToBGFreeSlotQueue(); @@ -1152,11 +1161,11 @@ void Battleground::AddPlayer(Player* player) SendPacketToTeam(team, &data, player, false); // BG Status packet - WorldPacket status; BattlegroundQueueTypeId bgQueueTypeId = sBattlegroundMgr->BGQueueTypeId(m_TypeID, GetArenaType()); uint32 queueSlot = player->GetBattlegroundQueueIndex(bgQueueTypeId); - sBattlegroundMgr->BuildBattlegroundStatusPacket(&status, this, player, queueSlot, STATUS_IN_PROGRESS, 0, GetStartTime(), GetArenaType(), isArena() ? 0 : 1); - player->GetSession()->SendPacket(&status); + + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, this, player, queueSlot, STATUS_IN_PROGRESS, player->GetBattlegroundQueueJoinTime(m_TypeID), GetElapsedTime(), GetArenaType(), isArena() ? 0 : 1); + player->GetSession()->SendPacket(&data); player->RemoveAurasByType(SPELL_AURA_MOUNTED); @@ -1738,7 +1747,7 @@ void Battleground::EndNow() { RemoveFromBGFreeSlotQueue(); SetStatus(STATUS_WAIT_LEAVE); - SetEndTime(0); + SetRemainingTime(0); } // To be removed @@ -1858,7 +1867,7 @@ void Battleground::PlayerAddedToBGCheckIfBGIsRunning(Player* player) sBattlegroundMgr->BuildPvpLogDataPacket(&data, this); player->GetSession()->SendPacket(&data); - sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, this, player, player->GetBattlegroundQueueIndex(bgQueueTypeId), STATUS_IN_PROGRESS, GetEndTime(), GetStartTime(), GetArenaType()); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, this, player, player->GetBattlegroundQueueIndex(bgQueueTypeId), STATUS_IN_PROGRESS, player->GetBattlegroundQueueJoinTime(GetTypeID()), GetElapsedTime(), GetArenaType()); player->GetSession()->SendPacket(&data); } diff --git a/src/server/game/Battlegrounds/Battleground.h b/src/server/game/Battlegrounds/Battleground.h index 4589f9bf0f2..ea22e2a4dd0 100755 --- a/src/server/game/Battlegrounds/Battleground.h +++ b/src/server/game/Battlegrounds/Battleground.h @@ -108,8 +108,8 @@ enum BattlegroundTimeIntervals RESURRECTION_INTERVAL = 30000, // ms //REMIND_INTERVAL = 10000, // ms INVITATION_REMIND_TIME = 20000, // ms - INVITE_ACCEPT_WAIT_TIME = 40000, // ms - TIME_TO_AUTOREMOVE = 120000, // ms + INVITE_ACCEPT_WAIT_TIME = 90000, // ms + TIME_AUTOCLOSE_BATTLEGROUND = 120000, // ms MAX_OFFLINE_TIME = 300, // secs RESPAWN_ONE_DAY = 86400, // secs RESPAWN_IMMEDIATELY = 0, // secs @@ -257,23 +257,33 @@ enum BattlegroundStartingEventsIds enum GroupJoinBattlegroundResult { - // positive values are indexes in BattlemasterList.dbc - ERR_GROUP_JOIN_BATTLEGROUND_FAIL = 0, // Your group has joined a battleground queue, but you are not eligible (showed for non existing BattlemasterList.dbc indexes) - ERR_BATTLEGROUND_NONE = -1, // not show anything - ERR_GROUP_JOIN_BATTLEGROUND_DESERTERS = -2, // You cannot join the battleground yet because you or one of your party members is flagged as a Deserter. - ERR_ARENA_TEAM_PARTY_SIZE = -3, // Incorrect party size for this arena. - ERR_BATTLEGROUND_TOO_MANY_QUEUES = -4, // You can only be queued for 2 battles at once - ERR_BATTLEGROUND_CANNOT_QUEUE_FOR_RATED = -5, // You cannot queue for a rated match while queued for other battles - ERR_BATTLEDGROUND_QUEUED_FOR_RATED = -6, // You cannot queue for another battle while queued for a rated arena match - ERR_BATTLEGROUND_TEAM_LEFT_QUEUE = -7, // Your team has left the arena queue - ERR_BATTLEGROUND_NOT_IN_BATTLEGROUND = -8, // You can't do that in a battleground. - ERR_BATTLEGROUND_JOIN_XP_GAIN = -9, // wtf, doesn't exist in client... - ERR_BATTLEGROUND_JOIN_RANGE_INDEX = -10, // Cannot join the queue unless all members of your party are in the same battleground level range. - ERR_BATTLEGROUND_JOIN_TIMED_OUT = -11, // %s was unavailable to join the queue. (uint64 guid exist in client cache) - ERR_BATTLEGROUND_JOIN_FAILED = -12, // Join as a group failed (uint64 guid doesn't exist in client cache) - ERR_LFG_CANT_USE_BATTLEGROUND = -13, // You cannot queue for a battleground or arena while using the dungeon system. - ERR_IN_RANDOM_BG = -14, // Can't do that while in a Random Battleground queue. - ERR_IN_NON_RANDOM_BG = -15 // Can't queue for Random Battleground while in another Battleground queue. + ERR_BATTLEGROUND_NONE = 0, + ERR_GROUP_JOIN_BATTLEGROUND_DESERTERS = 2, // You cannot join the battleground yet because you or one of your party members is flagged as a Deserter. + ERR_ARENA_TEAM_PARTY_SIZE = 3, // Incorrect party size for this arena. + ERR_BATTLEGROUND_TOO_MANY_QUEUES = 4, // You can only be queued for 2 battles at once + ERR_BATTLEGROUND_CANNOT_QUEUE_FOR_RATED = 5, // You cannot queue for a rated match while queued for other battles + ERR_BATTLEDGROUND_QUEUED_FOR_RATED = 6, // You cannot queue for another battle while queued for a rated arena match + ERR_BATTLEGROUND_TEAM_LEFT_QUEUE = 7, // Your team has left the arena queue + ERR_BATTLEGROUND_NOT_IN_BATTLEGROUND = 8, // You can't do that in a battleground. + ERR_BATTLEGROUND_JOIN_XP_GAIN = 9, // wtf, doesn't exist in client... + ERR_BATTLEGROUND_JOIN_RANGE_INDEX = 10, // Cannot join the queue unless all members of your party are in the same battleground level range. + ERR_BATTLEGROUND_JOIN_TIMED_OUT = 11, // %s was unavailable to join the queue. (uint64 guid exist in client cache) + //ERR_BATTLEGROUND_JOIN_TIMED_OUT = 12, // same as 11 + //ERR_BATTLEGROUND_TEAM_LEFT_QUEUE = 13, // same as 7 + ERR_LFG_CANT_USE_BATTLEGROUND = 14, // You cannot queue for a battleground or arena while using the dungeon system. + ERR_IN_RANDOM_BG = 15, // Can't do that while in a Random Battleground queue. + ERR_IN_NON_RANDOM_BG = 16, // Can't queue for Random Battleground while in another Battleground queue. + ERR_BG_DEVELOPER_ONLY = 17, + ERR_BATTLEGROUND_INVITATION_DECLINED = 18, + ERR_MEETING_STONE_NOT_FOUND = 19, + ERR_WARGAME_REQUEST_FAILURE = 20, + ERR_BATTLEFIELD_TEAM_PARTY_SIZE = 22, + ERR_NOT_ON_TOURNAMENT_REALM = 23, + ERR_BATTLEGROUND_PLAYERS_FROM_DIFFERENT_REALMS = 24, + ERR_REMOVE_FROM_PVP_QUEUE_GRANT_LEVEL = 33, + ERR_REMOVE_FROM_PVP_QUEUE_FACTION_CHANGE = 34, + ERR_BATTLEGROUND_JOIN_FAILED = 35, + ERR_BATTLEGROUND_DUPE_QUEUE = 43 }; struct BattlegroundScore @@ -341,8 +351,8 @@ class Battleground uint32 GetInstanceID() const { return m_InstanceID; } BattlegroundStatus GetStatus() const { return m_Status; } uint32 GetClientInstanceID() const { return m_ClientInstanceID; } - uint32 GetStartTime() const { return m_StartTime; } - uint32 GetEndTime() const { return m_EndTime; } + uint32 GetElapsedTime() const { return m_StartTime; } + uint32 GetRemainingTime() const { return m_EndTime; } uint32 GetLastResurrectTime() const { return m_LastResurrectTime; } uint32 GetMaxPlayers() const { return m_MaxPlayers; } uint32 GetMinPlayers() const { return m_MinPlayers; } @@ -361,6 +371,7 @@ class Battleground bool IsRandom() const { return m_IsRandom; } // Set methods: + void SetGuid(uint64 newGuid) { m_Guid = newGuid; } void SetName(char const* Name) { m_Name = Name; } void SetTypeID(BattlegroundTypeId TypeID) { m_TypeID = TypeID; } void SetRandomTypeID(BattlegroundTypeId TypeID) { m_RandomTypeID = TypeID; } @@ -369,8 +380,8 @@ class Battleground void SetInstanceID(uint32 InstanceID) { m_InstanceID = InstanceID; } void SetStatus(BattlegroundStatus Status) { m_Status = Status; } void SetClientInstanceID(uint32 InstanceID) { m_ClientInstanceID = InstanceID; } - void SetStartTime(uint32 Time) { m_StartTime = Time; } - void SetEndTime(uint32 Time) { m_EndTime = Time; } + void SetElapsedTime(uint32 Time) { m_StartTime = Time; } + void SetRemainingTime(uint32 Time) { m_EndTime = Time; } void SetLastResurrectTime(uint32 Time) { m_LastResurrectTime = Time; } void SetMaxPlayers(uint32 MaxPlayers) { m_MaxPlayers = MaxPlayers; } void SetMinPlayers(uint32 MinPlayers) { m_MinPlayers = MinPlayers; } diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index 072ea443df8..941123f9671 100755 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -163,7 +163,7 @@ void BattlegroundMgr::Update(uint32 diff) } } -void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battleground *bg, Player * pPlayer, uint8 QueueSlot, uint8 StatusID, uint32 Time1, uint32 Time2, uint8 /*arenatype*/, uint8 /*uiFrame*/) +void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battleground *bg, Player * pPlayer, uint8 QueueSlot, uint8 StatusID, uint32 Time1, uint32 Time2, uint8 arenatype, uint8 /*uiFrame*/) { if (!bg) StatusID = STATUS_NONE; @@ -175,73 +175,30 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro { case STATUS_NONE: { - data->Initialize(SMSG_BATTLEFIELD_STATUS_FAILED); - ObjectGuid unkGuid1 = 0; // Not seen packets - ObjectGuid unkGuid2 = 0; // Not seen packets + data->Initialize(SMSG_BATTLEFIELD_STATUS); - data->Initialize(SMSG_BATTLEFIELD_STATUS_FAILED); - - data->WriteBit(guidBytes2[3]); - data->WriteBit(unkGuid2[3]); - data->WriteBit(unkGuid1[3]); - data->WriteBit(unkGuid2[0]); - data->WriteBit(guidBytes2[6]); - data->WriteBit(unkGuid1[5]); - data->WriteBit(unkGuid1[6]); - data->WriteBit(unkGuid1[4]); - - data->WriteBit(unkGuid1[2]); - data->WriteBit(unkGuid2[1]); - data->WriteBit(guidBytes2[1]); - data->WriteBit(unkGuid2[5]); - data->WriteBit(unkGuid2[6]); - data->WriteBit(unkGuid1[1]); - data->WriteBit(guidBytes2[7]); - data->WriteBit(unkGuid2[4]); - - data->WriteBit(guidBytes2[2]); - data->WriteBit(guidBytes2[5]); - data->WriteBit(unkGuid2[7]); - data->WriteBit(guidBytes2[4]); - data->WriteBit(guidBytes2[0]); - data->WriteBit(unkGuid1[0]); - data->WriteBit(unkGuid2[2]); - data->WriteBit(unkGuid1[7]); - - data->WriteByteSeq(guidBytes2[1]); - - *data << uint32(bg->GetStatus()); - *data << uint32(QueueSlot); - - data->WriteByteSeq(unkGuid1[6]); - data->WriteByteSeq(unkGuid1[3]); - data->WriteByteSeq(unkGuid1[7]); - data->WriteByteSeq(unkGuid1[4]); - data->WriteByteSeq(guidBytes2[0]); - data->WriteByteSeq(unkGuid1[5]); - data->WriteByteSeq(guidBytes2[7]); - data->WriteByteSeq(guidBytes2[6]); - data->WriteByteSeq(guidBytes2[2]); - data->WriteByteSeq(unkGuid2[6]); - data->WriteByteSeq(unkGuid2[3]); - data->WriteByteSeq(unkGuid1[1]); - data->WriteByteSeq(guidBytes2[3]); - data->WriteByteSeq(unkGuid2[0]); - data->WriteByteSeq(unkGuid2[1]); - data->WriteByteSeq(unkGuid2[4]); - data->WriteByteSeq(unkGuid1[0]); - data->WriteByteSeq(guidBytes2[5]); - data->WriteByteSeq(unkGuid2[7]); - data->WriteByteSeq(guidBytes2[4]); - data->WriteByteSeq(unkGuid1[2]); - - *data << uint32(bg->GetTypeID()); - - data->WriteByteSeq(unkGuid2[2]); + data->WriteBit(guidBytes1[0]); + data->WriteBit(guidBytes1[4]); + data->WriteBit(guidBytes1[7]); + data->WriteBit(guidBytes1[1]); + data->WriteBit(guidBytes1[6]); + data->WriteBit(guidBytes1[3]); + data->WriteBit(guidBytes1[5]); + data->WriteBit(guidBytes1[2]); - *data << uint32(time(NULL)); + data->FlushBits(); - data->WriteByteSeq(unkGuid2[5]); + data->WriteByteSeq(guidBytes1[5]); + data->WriteByteSeq(guidBytes1[6]); + data->WriteByteSeq(guidBytes1[7]); + data->WriteByteSeq(guidBytes1[2]); + *data << uint32(1); // unk, always 1 + data->WriteByteSeq(guidBytes1[3]); + data->WriteByteSeq(guidBytes1[1]); + *data << uint32(QueueSlot); // Queue slot + *data << uint32(Time1); // Join Time + data->WriteByteSeq(guidBytes1[0]); + data->WriteByteSeq(guidBytes1[4]); break; } case STATUS_WAIT_QUEUE: @@ -252,7 +209,7 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro data->WriteBit(guidBytes1[0]); data->WriteBit(guidBytes2[3]); data->WriteBit(guidBytes1[2]); - data->WriteBit(0); // unk + data->WriteBit(1); // Eligible In Queue data->WriteBit(0); // Join Failed data->WriteBit(guidBytes2[2]); data->WriteBit(guidBytes1[1]); @@ -265,53 +222,52 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro data->WriteBit(guidBytes2[5]); data->WriteBit(guidBytes1[4]); data->WriteBit(guidBytes1[5]); - data->WriteBit(0); // unk - data->WriteBit(0); // unk + data->WriteBit(bg->isRated()); // Is Rated + data->WriteBit(0); // Waiting On Other Activity data->WriteBit(guidBytes2[1]); data->FlushBits(); data->WriteByteSeq(guidBytes1[0]); - *data << uint32(0); // unk + *data << uint32(1); // unk, always 1 data->WriteByteSeq(guidBytes2[5]); data->WriteByteSeq(guidBytes1[3]); - *data << uint32(0); // unk + *data << uint32(Time1); // Estimated Wait Time data->WriteByteSeq(guidBytes2[7]); data->WriteByteSeq(guidBytes2[1]); data->WriteByteSeq(guidBytes2[2]); *data << uint8(0); // unk data->WriteByteSeq(guidBytes2[4]); data->WriteByteSeq(guidBytes1[2]); - *data << uint8(0); // unk + *data << uint8(0); // Player count in rated mode data->WriteByteSeq(guidBytes2[6]); data->WriteByteSeq(guidBytes1[7]); data->WriteByteSeq(guidBytes2[3]); data->WriteByteSeq(guidBytes1[6]); data->WriteByteSeq(guidBytes2[0]); - *data << uint32(bg->GetStartTime()); // Time - *data << uint32(0); // unk + *data << uint32(Time2); // Join Time + *data << uint32(QueueSlot); // Queue slot *data << uint8(bg->GetMinLevel()); // Min Level - *data << uint32(0); // unk + *data << uint32(GetMSTimeDiffToNow(Time2)); // Time since joined data->WriteByteSeq(guidBytes1[1]); data->WriteByteSeq(guidBytes1[5]); - *data << uint32(0); // unk + *data << uint32(bg->GetClientInstanceID()); // Client Instance ID data->WriteByteSeq(guidBytes1[4]); - break; } case STATUS_WAIT_JOIN: { - data->Initialize(SMSG_BATTLEFIELD_STATUS_NEEDCONFIRMATION, 44); + data->Initialize(SMSG_BATTLEFIELD_STATUS_NEEDCONFIRMATION); *data << uint32(bg->GetClientInstanceID()); // Client Instance ID *data << uint32(Time1); // Time until closed *data << uint8(0); // unk *data << uint32(QueueSlot); // Queue slot - *data << uint32(Time2); // Time + *data << uint32(Time2); // Join Time *data << uint8(bg->GetMinLevel()); // Min Level - *data << uint32(bg->GetStatus()); // Status + *data << uint32(1); // unk, always 1 *data << uint32(bg->GetMapId()); // Map Id - *data << uint8(0); // unk + *data << uint8(0); // Player count in rated mode data->WriteBit(guidBytes1[5]); data->WriteBit(guidBytes1[2]); @@ -353,20 +309,20 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro } case STATUS_IN_PROGRESS: { - data->Initialize(SMSG_BATTLEFIELD_STATUS_ACTIVE, 49); + data->Initialize(SMSG_BATTLEFIELD_STATUS_ACTIVE); data->WriteBit(guidBytes1[2]); data->WriteBit(guidBytes1[7]); data->WriteBit(guidBytes2[7]); data->WriteBit(guidBytes2[1]); data->WriteBit(guidBytes1[5]); - data->WriteBit(0); // Unk + data->WriteBit(bg->GetPlayerTeam(guidBytes1) == ALLIANCE); // Battlefield Faction ( 0 horde, 1 alliance ) data->WriteBit(guidBytes2[0]); data->WriteBit(guidBytes1[1]); data->WriteBit(guidBytes2[3]); data->WriteBit(guidBytes1[6]); data->WriteBit(guidBytes2[5]); - data->WriteBit(0); // Unk Bit 64 + data->WriteBit(0); // unk, Bit 64 data->WriteBit(guidBytes1[4]); data->WriteBit(guidBytes2[6]); data->WriteBit(guidBytes2[4]); @@ -385,22 +341,21 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro data->WriteByteSeq(guidBytes2[7]); data->WriteByteSeq(guidBytes1[6]); - *data << uint32(Time2); // Time - *data << uint8(bg->GetPlayersCountByTeam(bg->GetPlayerTeam(pPlayer->GetGUID()))); // Teamsize + *data << uint32(Time1); // Join Time + *data << uint8(arenatype); // Teamsize (0 if not arena) data->WriteByteSeq(guidBytes1[4]); data->WriteByteSeq(guidBytes1[1]); *data << uint32(QueueSlot); // Queue slot - *data << uint8(bg->GetMaxLevel()); // Max Level - *data << uint32(bg->GetStatus()); // Status + *data << uint8(0); // Player count in rated mode + *data << uint32(1); // unk, always 1 *data << uint32(bg->GetMapId()); // Map Id *data << uint8(bg->GetMinLevel()); // Min Level - *data << uint32(Time1); // Time until closed + *data << uint32(Time2); // Elapsed Time data->WriteByteSeq(guidBytes1[2]); - - *data << uint32(bg->GetStartTime()); // Time since started + *data << uint32(getMSTimeDiff(bg->GetRemainingTime(), Time2)); // Remaining Time data->WriteByteSeq(guidBytes1[0]); data->WriteByteSeq(guidBytes1[3]); @@ -413,61 +368,7 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro break; } case STATUS_WAIT_LEAVE: - { - data->Initialize(SMSG_BATTLEFIELD_STATUS_WAITFORGROUPS, 48); - - *data << uint8(0); // unk - *data << uint32(bg->GetStatus()); // Status - *data << uint32(QueueSlot); // Queue slot - *data << uint32(Time1); // Time until closed - *data << uint32(0); // unk - *data << uint8(0); // unk - *data << uint8(0); // unk - *data << uint8(bg->GetMinLevel()); // Min Level - *data << uint8(0); // unk - *data << uint8(0); // unk - *data << uint32(bg->GetMapId()); // Map Id - *data << uint32(Time2); // Time - *data << uint8(0); // unk - - data->WriteBit(guidBytes2[0]); - data->WriteBit(guidBytes2[1]); - data->WriteBit(guidBytes2[7]); - data->WriteBit(guidBytes1[7]); - data->WriteBit(guidBytes1[0]); - data->WriteBit(guidBytes2[4]); - data->WriteBit(guidBytes1[6]); - data->WriteBit(guidBytes1[2]); - data->WriteBit(guidBytes1[3]); - data->WriteBit(guidBytes2[3]); - data->WriteBit(guidBytes1[4]); - data->WriteBit(guidBytes2[5]); - data->WriteBit(guidBytes1[5]); - data->WriteBit(guidBytes2[2]); - data->WriteBit(bg->isRated()); // Is Rated - data->WriteBit(guidBytes1[1]); - data->WriteBit(guidBytes2[6]); - - data->FlushBits(); - - data->WriteByteSeq(guidBytes1[0]); - data->WriteByteSeq(guidBytes2[4]); - data->WriteByteSeq(guidBytes1[3]); - data->WriteByteSeq(guidBytes2[1]); - data->WriteByteSeq(guidBytes2[0]); - data->WriteByteSeq(guidBytes2[2]); - data->WriteByteSeq(guidBytes1[2]); - data->WriteByteSeq(guidBytes2[7]); - data->WriteByteSeq(guidBytes1[1]); - data->WriteByteSeq(guidBytes1[6]); - data->WriteByteSeq(guidBytes2[6]); - data->WriteByteSeq(guidBytes2[5]); - data->WriteByteSeq(guidBytes1[5]); - data->WriteByteSeq(guidBytes1[4]); - data->WriteByteSeq(guidBytes1[7]); - data->WriteByteSeq(guidBytes2[3]); break; - } } } @@ -705,13 +606,75 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg) *data << uint8(0); // unk } -void BattlegroundMgr::BuildGroupJoinedBattlegroundPacket(WorldPacket* data, Battleground* /*bg*/, Player* /*player*/, GroupJoinBattlegroundResult /*result*/) +void BattlegroundMgr::BuildStatusFailedPacket(WorldPacket* data, Battleground* bg, Player* pPlayer, uint8 QueueSlot, GroupJoinBattlegroundResult result) { - //ObjectGuid guidBytes1 = player->GetGUID(); - //ObjectGuid guidBytes2 = bg->GetGUID(); + ObjectGuid guidBytes1 = pPlayer ? pPlayer->GetGUID() : 0; // player who caused the error + ObjectGuid guidBytes2 = bg->GetGUID(); + ObjectGuid unkGuid3 = 0; data->Initialize(SMSG_BATTLEFIELD_STATUS_FAILED); + data->WriteBit(guidBytes2[3]); + data->WriteBit(unkGuid3[3]); + data->WriteBit(guidBytes1[3]); + data->WriteBit(unkGuid3[0]); + data->WriteBit(guidBytes2[6]); + data->WriteBit(guidBytes1[5]); + data->WriteBit(guidBytes1[6]); + data->WriteBit(guidBytes1[4]); + + data->WriteBit(guidBytes1[2]); + data->WriteBit(unkGuid3[1]); + data->WriteBit(guidBytes2[1]); + data->WriteBit(unkGuid3[5]); + data->WriteBit(unkGuid3[6]); + data->WriteBit(guidBytes1[1]); + data->WriteBit(guidBytes2[7]); + data->WriteBit(unkGuid3[4]); + + data->WriteBit(guidBytes2[2]); + data->WriteBit(guidBytes2[5]); + data->WriteBit(unkGuid3[7]); + data->WriteBit(guidBytes2[4]); + data->WriteBit(guidBytes2[0]); + data->WriteBit(guidBytes1[0]); + data->WriteBit(unkGuid3[2]); + data->WriteBit(guidBytes1[7]); + + data->WriteByteSeq(guidBytes2[1]); + + *data << uint32(bg->GetStatus()); // Status + *data << uint32(QueueSlot); // Queue slot + + data->WriteByteSeq(guidBytes1[6]); + data->WriteByteSeq(guidBytes1[3]); + data->WriteByteSeq(guidBytes1[7]); + data->WriteByteSeq(guidBytes1[4]); + data->WriteByteSeq(guidBytes2[0]); + data->WriteByteSeq(guidBytes1[5]); + data->WriteByteSeq(guidBytes2[7]); + data->WriteByteSeq(guidBytes2[6]); + data->WriteByteSeq(guidBytes2[2]); + data->WriteByteSeq(unkGuid3[6]); + data->WriteByteSeq(unkGuid3[3]); + data->WriteByteSeq(guidBytes1[1]); + data->WriteByteSeq(guidBytes2[3]); + data->WriteByteSeq(unkGuid3[0]); + data->WriteByteSeq(unkGuid3[1]); + data->WriteByteSeq(unkGuid3[4]); + data->WriteByteSeq(guidBytes1[0]); + data->WriteByteSeq(guidBytes2[5]); + data->WriteByteSeq(unkGuid3[7]); + data->WriteByteSeq(guidBytes2[4]); + data->WriteByteSeq(guidBytes1[2]); + + *data << uint32(result); // Result + + data->WriteByteSeq(unkGuid3[2]); + + *data << uint32(time(NULL)); // Time + + data->WriteByteSeq(unkGuid3[5]); } void BattlegroundMgr::BuildUpdateWorldStatePacket(WorldPacket* data, uint32 field, uint32 value) @@ -955,6 +918,7 @@ Battleground* BattlegroundMgr::CreateNewBattleground(BattlegroundTypeId original bg->SetRandomTypeID(bgTypeId); bg->SetRated(isRated); bg->SetRandom(isRandom); + bg->SetGuid(MAKE_NEW_GUID(bgTypeId, 0, HIGHGUID_TYPE_BATTLEGROUND)); return bg; } @@ -1030,6 +994,7 @@ bool BattlegroundMgr::CreateBattleground(CreateBattlegroundData& data) bg->SetStartMaxDist(data.StartMaxDist); bg->SetLevelRange(data.LevelMin, data.LevelMax); bg->SetScriptId(data.scriptId); + bg->SetGuid(MAKE_NEW_GUID(data.bgTypeId, 0, HIGHGUID_TYPE_BATTLEGROUND)); AddBattleground(bg); diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.h b/src/server/game/Battlegrounds/BattlegroundMgr.h index 0c7d9a3be1f..b901b3e5b79 100755 --- a/src/server/game/Battlegrounds/BattlegroundMgr.h +++ b/src/server/game/Battlegrounds/BattlegroundMgr.h @@ -77,7 +77,7 @@ class BattlegroundMgr void BuildPlayerJoinedBattlegroundPacket(WorldPacket* data, uint64 guid); void BuildPlayerLeftBattlegroundPacket(WorldPacket* data, uint64 guid); void BuildBattlegroundListPacket(WorldPacket* data, uint64 guid, Player* player, BattlegroundTypeId bgTypeId); - void BuildGroupJoinedBattlegroundPacket(WorldPacket* data, Battleground* bg, Player* player, GroupJoinBattlegroundResult result); + void BuildStatusFailedPacket(WorldPacket* data, Battleground* bg, Player* pPlayer, uint8 QueueSlot, GroupJoinBattlegroundResult result); void BuildUpdateWorldStatePacket(WorldPacket* data, uint32 field, uint32 value); void BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg); void BuildBattlegroundStatusPacket(WorldPacket* data, Battleground* bg, Player* player, uint8 queueSlot, uint8 statusId, uint32 time1, uint32 time2, uint8 arenaType, uint8 uiFrame = 1); diff --git a/src/server/game/Battlegrounds/BattlegroundQueue.cpp b/src/server/game/Battlegrounds/BattlegroundQueue.cpp index b88aebd00fb..19e574dc137 100755 --- a/src/server/game/Battlegrounds/BattlegroundQueue.cpp +++ b/src/server/game/Battlegrounds/BattlegroundQueue.cpp @@ -394,7 +394,7 @@ void BattlegroundQueue::RemovePlayer(uint64 guid, bool decreaseInvitedCount) plr2->RemoveBattlegroundQueueId(bgQueueTypeId); // must be called this way, because if you move this call to // queue->removeplayer, it causes bugs WorldPacket data; - sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, plr2, queueSlot, STATUS_NONE, 0, 0, 0); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, plr2, queueSlot, STATUS_NONE, group->JoinTime, 0, 0); plr2->GetSession()->SendPacket(&data); } // then actually delete, this may delete the group as well! @@ -479,7 +479,7 @@ bool BattlegroundQueue::InviteGroupToBG(GroupQueueInfo* ginfo, Battleground* bg, player->GetName(), player->GetGUIDLow(), bg->GetInstanceID(), queueSlot, bg->GetTypeID()); // send status packet - sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, player, queueSlot, STATUS_WAIT_JOIN, INVITE_ACCEPT_WAIT_TIME, 0, ginfo->ArenaType); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, player, queueSlot, STATUS_WAIT_JOIN, INVITE_ACCEPT_WAIT_TIME, player->GetBattlegroundQueueJoinTime(bgTypeId), ginfo->ArenaType); player->GetSession()->SendPacket(&data); } return true; @@ -1001,7 +1001,7 @@ bool BGQueueInviteEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/) { WorldPacket data; //we must send remaining time in queue - sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, player, queueSlot, STATUS_WAIT_JOIN, INVITE_ACCEPT_WAIT_TIME - INVITATION_REMIND_TIME, 0, m_ArenaType); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, player, queueSlot, STATUS_WAIT_JOIN, INVITE_ACCEPT_WAIT_TIME - INVITATION_REMIND_TIME, player->GetBattlegroundQueueJoinTime(m_BgTypeId), m_ArenaType); player->GetSession()->SendPacket(&data); } } @@ -1049,7 +1049,7 @@ bool BGQueueRemoveEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/) sBattlegroundMgr->ScheduleQueueUpdate(0, 0, m_BgQueueTypeId, m_BgTypeId, bg->GetBracketId()); WorldPacket data; - sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, player, queueSlot, STATUS_NONE, 0, 0, 0); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, player, queueSlot, STATUS_NONE, player->GetBattlegroundQueueJoinTime(m_BgTypeId), 0, 0); player->GetSession()->SendPacket(&data); } } diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp index 5fd6e43c029..9f59344843c 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp @@ -64,7 +64,7 @@ void BattlegroundWS::PostUpdateImpl(uint32 diff) { if (GetStatus() == STATUS_IN_PROGRESS) { - if (GetStartTime() >= 27*MINUTE*IN_MILLISECONDS) + if (GetElapsedTime() >= 27*MINUTE*IN_MILLISECONDS) { if (GetTeamScore(TEAM_ALLIANCE) == 0) { @@ -83,7 +83,7 @@ void BattlegroundWS::PostUpdateImpl(uint32 diff) EndBattleground(ALLIANCE); } // first update needed after 1 minute of game already in progress - else if (GetStartTime() > uint32(_minutesElapsed * MINUTE * IN_MILLISECONDS) + 3 * MINUTE * IN_MILLISECONDS) + else if (GetElapsedTime() > uint32(_minutesElapsed * MINUTE * IN_MILLISECONDS) + 3 * MINUTE * IN_MILLISECONDS) { ++_minutesElapsed; UpdateWorldState(BG_WS_STATE_TIMER, 25 - _minutesElapsed); diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 51019ae686f..4d91ac42879 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1038,12 +1038,14 @@ class Player; struct BGData { BGData() : bgInstanceID(0), bgTypeID(BATTLEGROUND_TYPE_NONE), bgAfkReportedCount(0), bgAfkReportedTimer(0), - bgTeam(0), mountSpell(0) { ClearTaxiPath(); } + bgTeam(0), mountSpell(0) { bgQueuesJoinedTime.clear(); ClearTaxiPath(); } uint32 bgInstanceID; ///< This variable is set to bg->m_InstanceID, /// when player is teleported to BG - (it is battleground's GUID) BattlegroundTypeId bgTypeID; + std::map bgQueuesJoinedTime; + std::set bgAfkReporter; uint8 bgAfkReportedCount; time_t bgAfkReportedTimer; @@ -2320,6 +2322,16 @@ class Player : public Unit, public GridObject BattlegroundTypeId GetBattlegroundTypeId() const { return m_bgData.bgTypeID; } Battleground* GetBattleground() const; + uint32 GetBattlegroundQueueJoinTime(uint32 bgTypeId) const { return m_bgData.bgQueuesJoinedTime.find(bgTypeId)->second; } + void AddBattlegroundQueueJoinTime(uint32 bgTypeId, uint32 joinTime) + { + m_bgData.bgQueuesJoinedTime[bgTypeId] = joinTime; + } + void RemoveBattlegroundQueueJoinTime(uint32 bgTypeId) + { + m_bgData.bgQueuesJoinedTime.erase(m_bgData.bgQueuesJoinedTime.find(bgTypeId)->second); + } + bool InBattlegroundQueue() const { for (uint8 i = 0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; ++i) diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index b9ede2ec985..84e5dd58e44 100755 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -1815,7 +1815,7 @@ GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const* BattlemasterListEntry const* bgEntry = sBattlemasterListStore.LookupEntry(bgOrTemplate->GetTypeID()); if (!bgEntry) - return ERR_GROUP_JOIN_BATTLEGROUND_FAIL; // shouldn't happen + return ERR_BATTLEGROUND_JOIN_FAILED; // shouldn't happen // check for min / max count uint32 memberscount = GetMembersCount(); diff --git a/src/server/game/Handlers/BattleGroundHandler.cpp b/src/server/game/Handlers/BattleGroundHandler.cpp index 9c99bf0a066..17d65264e9e 100755 --- a/src/server/game/Handlers/BattleGroundHandler.cpp +++ b/src/server/game/Handlers/BattleGroundHandler.cpp @@ -140,16 +140,15 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recvData) if (!bracketEntry) return; - GroupJoinBattlegroundResult err; + GroupJoinBattlegroundResult err = ERR_BATTLEGROUND_NONE; // check queue conditions if (!asGroup) { if (GetPlayer()->isUsingLfg()) { - // player is using dungeon finder or raid finder WorldPacket data; - sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, bg, _player, ERR_LFG_CANT_USE_BATTLEGROUND); + sBattlegroundMgr->BuildStatusFailedPacket(&data, bg, _player, 0, ERR_LFG_CANT_USE_BATTLEGROUND); GetPlayer()->GetSession()->SendPacket(&data); return; } @@ -158,7 +157,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recvData) if (!_player->CanJoinToBattleground()) { WorldPacket data; - sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, bg, _player, ERR_GROUP_JOIN_BATTLEGROUND_DESERTERS); + sBattlegroundMgr->BuildStatusFailedPacket(&data, bg, _player, 0, ERR_GROUP_JOIN_BATTLEGROUND_DESERTERS); _player->GetSession()->SendPacket(&data); return; } @@ -167,7 +166,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recvData) { // player is already in random queue WorldPacket data; - sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, bg, _player, ERR_IN_RANDOM_BG); + sBattlegroundMgr->BuildStatusFailedPacket(&data, bg, _player, 0, ERR_IN_RANDOM_BG); _player->GetSession()->SendPacket(&data); return; } @@ -176,7 +175,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recvData) { // player is already in queue, can't start random queue WorldPacket data; - sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, bg, _player, ERR_IN_NON_RANDOM_BG); + sBattlegroundMgr->BuildStatusFailedPacket(&data, bg, _player, 0, ERR_IN_NON_RANDOM_BG); _player->GetSession()->SendPacket(&data); return; } @@ -190,33 +189,37 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recvData) if (!_player->HasFreeBattlegroundQueueId()) { WorldPacket data; - sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, bg, _player, ERR_BATTLEGROUND_TOO_MANY_QUEUES); + sBattlegroundMgr->BuildStatusFailedPacket(&data, bg, _player, 0, ERR_BATTLEGROUND_TOO_MANY_QUEUES); _player->GetSession()->SendPacket(&data); return; } BattlegroundQueue& bgQueue = sBattlegroundMgr->GetBattlegroundQueue(bgQueueTypeId); - GroupQueueInfo* ginfo = bgQueue.AddGroup(_player, NULL, bgTypeId, bracketEntry, 0, false, isPremade, 0, 0); + uint32 avgTime = bgQueue.GetAverageQueueWaitTime(ginfo, bracketEntry->GetBracketId()); - // already checked if queueSlot is valid, now just get it uint32 queueSlot = _player->AddBattlegroundQueueId(bgQueueTypeId); - WorldPacket data; - // send status packet (in queue) - sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, _player, queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, ginfo->ArenaType); + // add joined time data + _player->AddBattlegroundQueueJoinTime(bgTypeId, ginfo->JoinTime); + + WorldPacket data; // send status packet (in queue) + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, _player, queueSlot, STATUS_WAIT_QUEUE, avgTime, ginfo->JoinTime, ginfo->ArenaType); SendPacket(&data); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: player joined queue for bg queue type %u bg type %u: GUID %u, NAME %s", bgQueueTypeId, bgTypeId, _player->GetGUIDLow(), _player->GetName()); } else { grp = _player->GetGroup(); - // no group found, error + if (!grp) return; + if (grp->GetLeaderGUID() != _player->GetGUID()) return; + err = grp->CanJoinBattlegroundQueue(bg, bgQueueTypeId, 0, bg->GetMaxPlayersPerTeam(), false, 0); isPremade = (grp->GetMembersCount() >= bg->GetMinPlayersPerTeam()); @@ -224,7 +227,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recvData) GroupQueueInfo* ginfo = NULL; uint32 avgTime = 0; - if (err > 0) + if (!err) { sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: the following players are joining as group:"); ginfo = bgQueue.AddGroup(_player, grp, bgTypeId, bracketEntry, 0, false, isPremade, 0, 0); @@ -237,11 +240,10 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recvData) if (!member) continue; // this should never happen - WorldPacket data; - - if (err <= 0) + if (err) { - sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, bg, _player, err); + WorldPacket data; + sBattlegroundMgr->BuildStatusFailedPacket(&data, bg, _player, 0, err); member->GetSession()->SendPacket(&data); continue; } @@ -249,16 +251,19 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recvData) // add to queue uint32 queueSlot = member->AddBattlegroundQueueId(bgQueueTypeId); - // send status packet (in queue) - sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, member, queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, ginfo->ArenaType); - member->GetSession()->SendPacket(&data); - sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, bg, _player, err); + // add joined time data + member->AddBattlegroundQueueJoinTime(bgTypeId, ginfo->JoinTime); + + WorldPacket data; // send status packet (in queue) + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, member, queueSlot, STATUS_WAIT_QUEUE, avgTime, ginfo->JoinTime, ginfo->ArenaType); member->GetSession()->SendPacket(&data); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: player joined queue for bg queue type %u bg type %u: GUID %u, NAME %s", bgQueueTypeId, bgTypeId, member->GetGUIDLow(), member->GetName()); } sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: group end"); } + sBattlegroundMgr->ScheduleQueueUpdate(0, 0, bgQueueTypeId, bgTypeId, bracketEntry->GetBracketId()); } @@ -396,14 +401,14 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_BATTLEFIELD_PORT Message"); uint32 time; - uint32 type; // guessed - uint32 bgTypeId_; // type id from dbc - uint8 action; // enter battle 0x1, leave queue 0x0 + uint32 queueSlot; + uint32 unk; + uint8 action; // enter battle 0x1, leave queue 0x0 ObjectGuid guid; recvData >> time; - recvData >> type; - recvData >> bgTypeId_; + recvData >> queueSlot; + recvData >> unk; guid[0] = recvData.ReadBit(); guid[1] = recvData.ReadBit(); @@ -425,22 +430,22 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData) recvData.ReadByteSeq(guid[6]); recvData.ReadByteSeq(guid[4]); - if (!sBattlemasterListStore.LookupEntry(bgTypeId_)) + if (!_player->InBattlegroundQueue()) { - sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BattlegroundHandler: invalid bgtype (%u) with player (Name: %s, GUID: %u) received.", bgTypeId_, _player->GetName(), _player->GetGUIDLow()); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BattlegroundHandler: Invalid CMSG_BATTLEFIELD_PORT received from player (Name: %s, GUID: %u), he is not in bg_queue.", _player->GetName(), _player->GetGUIDLow()); return; } - if (!_player->InBattlegroundQueue()) + BattlegroundQueueTypeId bgQueueTypeId = _player->GetBattlegroundQueueTypeId(queueSlot); + if (bgQueueTypeId == BATTLEGROUND_QUEUE_NONE) { - sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BattlegroundHandler: Invalid CMSG_BATTLEFIELD_PORT received from player (Name: %s, GUID: %u), he is not in bg_queue.", _player->GetName(), _player->GetGUIDLow()); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BattlegroundHandler: invalid queueSlot (%u) received.", queueSlot); return; } - //get GroupQueueInfo from BattlegroundQueue - BattlegroundTypeId bgTypeId = BattlegroundTypeId(bgTypeId_); - BattlegroundQueueTypeId bgQueueTypeId = BattlegroundMgr::BGQueueTypeId(bgTypeId, type); + BattlegroundTypeId bgTypeId = BattlegroundMgr::BGTemplateId(bgQueueTypeId); BattlegroundQueue& bgQueue = sBattlegroundMgr->GetBattlegroundQueue(bgQueueTypeId); + //we must use temporary variable, because GroupQueueInfo pointer can be deleted in BattlegroundQueue::RemovePlayer() function GroupQueueInfo ginfo; if (!bgQueue.GetPlayerGroupInfoData(_player->GetGUID(), &ginfo)) @@ -479,7 +484,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData) { //send bg command result to show nice message WorldPacket data2; - sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data2, bg, _player, ERR_GROUP_JOIN_BATTLEGROUND_DESERTERS); + sBattlegroundMgr->BuildStatusFailedPacket(&data2, bg, _player, 0, ERR_GROUP_JOIN_BATTLEGROUND_DESERTERS); _player->GetSession()->SendPacket(&data2); action = 0; sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: player %s (%u) has a deserter debuff, do not port him to battleground!", _player->GetName(), _player->GetGUIDLow()); @@ -492,7 +497,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData) action = 0; } } - uint32 queueSlot = _player->GetBattlegroundQueueIndex(bgQueueTypeId); + WorldPacket data; switch (action) { @@ -516,7 +521,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData) _player->CleanupAfterTaxiFlight(); } - sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, _player, queueSlot, STATUS_IN_PROGRESS, 0, bg->GetStartTime(), bg->GetArenaType()); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, _player, queueSlot, STATUS_IN_PROGRESS, _player->GetBattlegroundQueueJoinTime(bgTypeId), bg->GetElapsedTime(), bg->GetArenaType()); _player->GetSession()->SendPacket(&data); // remove battleground queue status from BGmgr bgQueue.RemovePlayer(_player->GetGUID(), false); @@ -551,7 +556,8 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData) } } _player->RemoveBattlegroundQueueId(bgQueueTypeId); // must be called this way, because if you move this call to queue->removeplayer, it causes bugs - sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, _player, queueSlot, STATUS_NONE, 0, 0, 0); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, _player, queueSlot, STATUS_NONE, _player->GetBattlegroundQueueJoinTime(bgTypeId), 0, 0); + bgQueue.RemovePlayer(_player->GetGUID(), true); // player left queue, we should update it - do not update Arena Queue if (!ginfo.ArenaType) @@ -581,7 +587,7 @@ void WorldSession::HandleBattlefieldLeaveOpcode(WorldPacket& recvData) void WorldSession::HandleBattlefieldStatusOpcode(WorldPacket & /*recvData*/) { // empty opcode - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Battleground status"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_BATTLEFIELD_STATUS Message"); WorldPacket data; // we must update all queues here @@ -600,13 +606,14 @@ void WorldSession::HandleBattlefieldStatusOpcode(WorldPacket & /*recvData*/) //so i must use bg pointer to get that information if (bg && bg->GetArenaType() == arenaType) { - // this line is checked, i only don't know if GetStartTime is changing itself after bg end! + // this line is checked, i only don't know if GetElapsedTime() is changing itself after bg end! // send status in Battleground - sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, GetPlayer(), i, STATUS_IN_PROGRESS, bg->GetEndTime(), bg->GetStartTime(), arenaType); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, GetPlayer(), i, STATUS_IN_PROGRESS, _player->GetBattlegroundQueueJoinTime(bgTypeId), bg->GetElapsedTime(), arenaType); SendPacket(&data); continue; } } + //we are sending update to player about queue - he can be invited there! //get GroupQueueInfo for queue status BattlegroundQueue& bgQueue = sBattlegroundMgr->GetBattlegroundQueue(bgQueueTypeId); @@ -618,9 +625,9 @@ void WorldSession::HandleBattlefieldStatusOpcode(WorldPacket & /*recvData*/) bg = sBattlegroundMgr->GetBattleground(ginfo.IsInvitedToBGInstanceGUID, bgTypeId); if (!bg) continue; - uint32 remainingTime = getMSTimeDiff(getMSTime(), ginfo.RemoveInviteTime); + // send status invited to Battleground - sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, GetPlayer(), i, STATUS_WAIT_JOIN, remainingTime, 0, arenaType); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, GetPlayer(), i, STATUS_WAIT_JOIN, getMSTimeDiff(getMSTime(), ginfo.RemoveInviteTime), _player->GetBattlegroundQueueJoinTime(bgTypeId), arenaType); SendPacket(&data); } else @@ -636,7 +643,7 @@ void WorldSession::HandleBattlefieldStatusOpcode(WorldPacket & /*recvData*/) uint32 avgTime = bgQueue.GetAverageQueueWaitTime(&ginfo, bracketEntry->GetBracketId()); // send status in Battleground Queue - sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, GetPlayer(), i, STATUS_WAIT_QUEUE, avgTime, getMSTimeDiff(ginfo.JoinTime, getMSTime()), arenaType); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, GetPlayer(), i, STATUS_WAIT_QUEUE, avgTime, _player->GetBattlegroundQueueJoinTime(bgTypeId), arenaType); SendPacket(&data); } } @@ -705,7 +712,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recvData) if (!bracketEntry) return; - GroupJoinBattlegroundResult err = ERR_GROUP_JOIN_BATTLEGROUND_FAIL; + GroupJoinBattlegroundResult err = ERR_BATTLEGROUND_NONE; if (!asGroup) { @@ -753,8 +760,9 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recvData) if (asGroup) { uint32 avgTime = 0; + GroupQueueInfo* ginfo; - if (err > 0) + if (!err) { sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: arena join as group start"); if (isRated) @@ -765,7 +773,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recvData) else bg->SetRated(false); - GroupQueueInfo* ginfo = bgQueue.AddGroup(_player, grp, bgTypeId, bracketEntry, arenatype, isRated, false, arenaRating, matchmakerRating, ateamId); + ginfo = bgQueue.AddGroup(_player, grp, bgTypeId, bracketEntry, arenatype, isRated, false, arenaRating, matchmakerRating, ateamId); avgTime = bgQueue.GetAverageQueueWaitTime(ginfo, bracketEntry->GetBracketId()); } @@ -775,11 +783,10 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recvData) if (!member) continue; - WorldPacket data; - - if (err <= 0) + if (err) { - sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, bg, _player, err); + WorldPacket data; + sBattlegroundMgr->BuildStatusFailedPacket(&data, bg, _player, 0, err); member->GetSession()->SendPacket(&data); continue; } @@ -787,11 +794,10 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recvData) // add to queue uint32 queueSlot = member->AddBattlegroundQueueId(bgQueueTypeId); - // send status packet (in queue) - sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, member, queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, arenatype); - member->GetSession()->SendPacket(&data); - sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, bg, _player, err); + WorldPacket data; // send status packet (in queue) + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, member, queueSlot, STATUS_WAIT_QUEUE, avgTime, ginfo->JoinTime, arenatype); member->GetSession()->SendPacket(&data); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: player joined queue for arena as group bg queue type %u bg type %u: GUID %u, NAME %s", bgQueueTypeId, bgTypeId, member->GetGUIDLow(), member->GetName()); } } @@ -801,10 +807,10 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recvData) uint32 avgTime = bgQueue.GetAverageQueueWaitTime(ginfo, bracketEntry->GetBracketId()); uint32 queueSlot = _player->AddBattlegroundQueueId(bgQueueTypeId); - WorldPacket data; - // send status packet (in queue) - sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, GetPlayer(), queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, arenatype); + WorldPacket data; // send status packet (in queue) + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, GetPlayer(), queueSlot, STATUS_WAIT_QUEUE, avgTime, ginfo->JoinTime, arenatype); SendPacket(&data); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: player joined queue for arena, skirmish, bg queue type %u bg type %u: GUID %u, NAME %s", bgQueueTypeId, bgTypeId, _player->GetGUIDLow(), _player->GetName()); } sBattlegroundMgr->ScheduleQueueUpdate(matchmakerRating, arenatype, bgQueueTypeId, bgTypeId, bracketEntry->GetBracketId()); -- cgit v1.2.3 From c199e308741a3fa1c7d2b08d98cbb6a1341a45d7 Mon Sep 17 00:00:00 2001 From: Subv Date: Fri, 12 Oct 2012 10:39:13 -0500 Subject: Core/XP: Players only get 10% xp for killing NPCs of the same expansion or lower. --- src/server/game/DataStores/DBCStores.cpp | 18 ++++++++++++++++++ src/server/game/DataStores/DBCStores.h | 2 ++ src/server/game/Entities/Player/Player.cpp | 9 +++++++-- 3 files changed, 27 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 9ecc41732f0..8a647bacfea 100644 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -862,6 +862,24 @@ uint32 GetVirtualMapForMapAndZone(uint32 mapid, uint32 zoneId) return mapid; } +uint32 GetMaxLevelForExpansion(uint32 expansion) +{ + switch (expansion) + { + case CONTENT_1_60: + return 60; + case CONTENT_61_70: + return 70; + case CONTENT_71_80: + return 80; + case CONTENT_81_85: + return 85; + default: + break; + } + return 0; +} + /* Used only for calculate xp gain by content lvl. Calculation on Gilneas and group maps of LostIslands calculated as CONTENT_1_60. diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h index 174cf5c4dfb..c4e012c62c1 100755 --- a/src/server/game/DataStores/DBCStores.h +++ b/src/server/game/DataStores/DBCStores.h @@ -52,6 +52,8 @@ enum ContentLevels MAX_CONTENT }; +uint32 GetMaxLevelForExpansion(uint32 expansion); + ContentLevels GetContentLevelsForMapAndZone(uint32 mapid, uint32 zoneId); bool IsTotemCategoryCompatiableWith(uint32 itemTotemCategoryId, uint32 requiredTotemCategoryId); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 505da4355c3..c4fdb33bef6 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -75,6 +75,7 @@ #include #include "AccountMgr.h" #include "DB2Stores.h" +#include "DBCStores.h" #include "Battlefield.h" #include "BattlefieldMgr.h" #include "BattlefieldWG.h" @@ -513,10 +514,14 @@ inline void KillRewarder::_RewardXP(Player* player, float rate) for (Unit::AuraEffectList::const_iterator i = auras.begin(); i != auras.end(); ++i) AddPct(xp, (*i)->GetAmount()); - // 4.2.3. Give XP to player. + // 4.2.3. Calculate expansion penalty + if (_victim->GetTypeId() == TYPEID_UNIT && player->GetLevel() >= GetMaxLevelForExpansion(_victim->ToCreature()->GetCreatureTemplate()->expansion)) + xp = CalculatePct(xp, 10); // Players get only 10% xp for killing creatures of lower expansion levels than himself + + // 4.2.4. Give XP to player. player->GiveXP(xp, _victim, _groupRate); if (Pet* pet = player->GetPet()) - // 4.2.4. If player has pet, reward pet with XP (100% for single player, 50% for group case). + // 4.2.5. If player has pet, reward pet with XP (100% for single player, 50% for group case). pet->GivePetXP(_group ? xp / 2 : xp); } } -- cgit v1.2.3 From 1b432405121527b92d91ed4843d5ebed9a56874d Mon Sep 17 00:00:00 2001 From: Shocker Date: Sat, 13 Oct 2012 01:35:42 +0300 Subject: Fix build --- src/server/game/Entities/Player/Player.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index c4fdb33bef6..ddd52ff352f 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -515,7 +515,7 @@ inline void KillRewarder::_RewardXP(Player* player, float rate) AddPct(xp, (*i)->GetAmount()); // 4.2.3. Calculate expansion penalty - if (_victim->GetTypeId() == TYPEID_UNIT && player->GetLevel() >= GetMaxLevelForExpansion(_victim->ToCreature()->GetCreatureTemplate()->expansion)) + if (_victim->GetTypeId() == TYPEID_UNIT && player->getLevel() >= GetMaxLevelForExpansion(_victim->ToCreature()->GetCreatureTemplate()->expansion)) xp = CalculatePct(xp, 10); // Players get only 10% xp for killing creatures of lower expansion levels than himself // 4.2.4. Give XP to player. -- cgit v1.2.3 From 85cd89235495d1d2918f3cb1c0db10488d05b1ee Mon Sep 17 00:00:00 2001 From: Cristal Date: Sat, 13 Oct 2012 15:19:06 +0200 Subject: Core/Battlegrounds: Fix visual honor gain in PvPLogData --- src/server/game/Battlegrounds/BattlegroundMgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index 941123f9671..d090db1268a 100755 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -430,7 +430,7 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg) if (!isArena) // Unk 3 prolly is (bg) { - buff << uint32(itr2->second->BonusHonor); + buff << uint32(itr2->second->BonusHonor / 100); buff << uint32(itr2->second->Deaths); buff << uint32(itr2->second->HonorableKills); } -- cgit v1.2.3 From 963aa5a159c5541b6c794b42a5f5809bc7a36192 Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 14 Oct 2012 19:15:00 -0500 Subject: Scripts/Spells: Updated some warlock spellscripts to 4.3.4 --- src/server/game/Entities/Unit/StatSystem.cpp | 10 ++-- src/server/scripts/Spells/spell_warlock.cpp | 74 +++++++++++++++------------- 2 files changed, 44 insertions(+), 40 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index f2266f03ae9..eac2b531805 100755 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -1101,8 +1101,8 @@ void Guardian::UpdateAttackPowerAndDamage(bool ranged) //demons benefit from warlocks shadow or fire damage else if (isPet()) { - int32 fire = int32(owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FIRE)) - owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_FIRE); - int32 shadow = int32(owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_SHADOW)) - owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_SHADOW); + int32 fire = int32(owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FIRE)) + owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_FIRE); + int32 shadow = int32(owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_SHADOW)) + owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_SHADOW); int32 maximum = (fire > shadow) ? fire : shadow; if (maximum < 0) maximum = 0; @@ -1112,7 +1112,7 @@ void Guardian::UpdateAttackPowerAndDamage(bool ranged) //water elementals benefit from mage's frost damage else if (GetEntry() == ENTRY_WATER_ELEMENTAL) { - int32 frost = int32(owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FROST)) - owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_FROST); + int32 frost = int32(owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FROST)) + owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_FROST); if (frost < 0) frost = 0; SetBonusDamage(int32(frost * 0.4f)); @@ -1145,14 +1145,14 @@ void Guardian::UpdateDamagePhysical(WeaponAttackType attType) //force of nature if (GetEntry() == ENTRY_TREANT) { - int32 spellDmg = int32(m_owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_NATURE)) - m_owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_NATURE); + int32 spellDmg = int32(m_owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_NATURE)) + m_owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_NATURE); if (spellDmg > 0) bonusDamage = spellDmg * 0.09f; } //greater fire elemental else if (GetEntry() == ENTRY_FIRE_ELEMENTAL) { - int32 spellDmg = int32(m_owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FIRE)) - m_owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_FIRE); + int32 spellDmg = int32(m_owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FIRE)) + m_owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_FIRE); if (spellDmg > 0) bonusDamage = spellDmg * 0.4f; } diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index e7cca8fed36..6bfa2419fdd 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -40,11 +40,16 @@ enum WarlockSpells WARLOCK_HAUNT = 48181, WARLOCK_HAUNT_HEAL = 48210, WARLOCK_UNSTABLE_AFFLICTION_DISPEL = 31117, - WARLOCK_CURSE_OF_DOOM_EFFECT = 18662, + WARLOCK_BANE_OF_DOOM_EFFECT = 18662, WARLOCK_IMPROVED_HEALTH_FUNNEL_R1 = 18703, WARLOCK_IMPROVED_HEALTH_FUNNEL_R2 = 18704, WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R1 = 60955, WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R2 = 60956, + WARLOCK_SOULSHATTER = 32835, + WARLOCK_LIFE_TAP_ENERGIZE = 31818, + WARLOCK_LIFE_TAP_ENERGIZE_2 = 32553, + WARLOCK_IMPROVED_LIFE_TAP_ICON_ID = 208, + WARLOCK_MANA_FEED_ICON_ID = 1982, }; /// Updated 4.3.4 @@ -244,6 +249,7 @@ uint32 const spell_warl_create_healthstone::spell_warl_create_healthstone_SpellS }; // 47422 Everlasting Affliction +/// Updated 4.3.4 class spell_warl_everlasting_affliction : public SpellScriptLoader { public: @@ -273,6 +279,8 @@ class spell_warl_everlasting_affliction : public SpellScriptLoader } }; +// 27285 Seed of Corruption +/// Updated 4.3.4 class spell_warl_seed_of_corruption : public SpellScriptLoader { public: @@ -300,11 +308,8 @@ class spell_warl_seed_of_corruption : public SpellScriptLoader } }; -enum Soulshatter -{ - SPELL_SOULSHATTER = 32835, -}; - +// 29858 Soulshatter +/// Updated 4.3.4 class spell_warl_soulshatter : public SpellScriptLoader { public: @@ -316,7 +321,7 @@ class spell_warl_soulshatter : public SpellScriptLoader bool Validate(SpellInfo const* /*spell*/) { - if (!sSpellMgr->GetSpellInfo(SPELL_SOULSHATTER)) + if (!sSpellMgr->GetSpellInfo(WARLOCK_SOULSHATTER)) return false; return true; } @@ -325,10 +330,8 @@ class spell_warl_soulshatter : public SpellScriptLoader { Unit* caster = GetCaster(); if (Unit* target = GetHitUnit()) - { if (target->CanHaveThreatList() && target->getThreatManager().getThreat(caster) > 0.0f) - caster->CastSpell(target, SPELL_SOULSHATTER, true); - } + caster->CastSpell(target, WARLOCK_SOULSHATTER, true); } void Register() @@ -343,14 +346,8 @@ class spell_warl_soulshatter : public SpellScriptLoader } }; -enum LifeTap -{ - SPELL_LIFE_TAP_ENERGIZE = 31818, - SPELL_LIFE_TAP_ENERGIZE_2 = 32553, - ICON_ID_IMPROVED_LIFE_TAP = 208, - ICON_ID_MANA_FEED = 1982, -}; - +// 1454 Life Tap +/// Updated 4.3.4 class spell_warl_life_tap : public SpellScriptLoader { public: @@ -367,7 +364,7 @@ class spell_warl_life_tap : public SpellScriptLoader bool Validate(SpellInfo const* /*spell*/) { - if (!sSpellMgr->GetSpellInfo(SPELL_LIFE_TAP_ENERGIZE) || !sSpellMgr->GetSpellInfo(SPELL_LIFE_TAP_ENERGIZE_2)) + if (!sSpellMgr->GetSpellInfo(WARLOCK_LIFE_TAP_ENERGIZE) || !sSpellMgr->GetSpellInfo(WARLOCK_LIFE_TAP_ENERGIZE_2)) return false; return true; } @@ -377,34 +374,31 @@ class spell_warl_life_tap : public SpellScriptLoader Player* caster = GetCaster()->ToPlayer(); if (Unit* target = GetHitUnit()) { - int32 damage = GetEffectValue(); - int32 mana = int32(damage + (caster->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS+SPELL_SCHOOL_SHADOW) * 0.5f)); + int32 damage = caster->CountPctFromMaxHealth(GetSpellInfo()->Effects[EFFECT_2].CalcValue()); + int32 mana = CalculatePct(damage, GetSpellInfo()->Effects[EFFECT_1].CalcValue()); // Shouldn't Appear in Combat Log target->ModifyHealth(-damage); // Improved Life Tap mod - if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_WARLOCK, ICON_ID_IMPROVED_LIFE_TAP, 0)) + if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_WARLOCK, WARLOCK_IMPROVED_LIFE_TAP_ICON_ID, 0)) AddPct(mana, aurEff->GetAmount()); - caster->CastCustomSpell(target, SPELL_LIFE_TAP_ENERGIZE, &mana, NULL, NULL, false); + caster->CastCustomSpell(target, WARLOCK_LIFE_TAP_ENERGIZE, &mana, NULL, NULL, false); // Mana Feed - int32 manaFeedVal = 0; - if (AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_AURA_ADD_FLAT_MODIFIER, SPELLFAMILY_WARLOCK, ICON_ID_MANA_FEED, 0)) - manaFeedVal = aurEff->GetAmount(); - - if (manaFeedVal > 0) + if (AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_AURA_ADD_FLAT_MODIFIER, SPELLFAMILY_WARLOCK, WARLOCK_MANA_FEED_ICON_ID, 0)) { + int32 manaFeedVal = aurEff->GetAmount(); ApplyPct(manaFeedVal, mana); - caster->CastCustomSpell(caster, SPELL_LIFE_TAP_ENERGIZE_2, &manaFeedVal, NULL, NULL, true, NULL); + caster->CastCustomSpell(caster, WARLOCK_LIFE_TAP_ENERGIZE_2, &manaFeedVal, NULL, NULL, true, NULL); } } } SpellCastResult CheckCast() { - if ((int32(GetCaster()->GetHealth()) > int32(GetSpellInfo()->Effects[EFFECT_0].CalcValue() + (6.3875 * GetSpellInfo()->BaseLevel)))) + if (int32(GetCaster()->GetHealth()) > int32(GetCaster()->CountPctFromMaxHealth(GetSpellInfo()->Effects[EFFECT_2].CalcValue()))) return SPELL_CAST_OK; return SPELL_FAILED_FIZZLE; } @@ -422,6 +416,8 @@ class spell_warl_life_tap : public SpellScriptLoader } }; +// 48018 Demonic Circle: Summon +/// Updated 4.3.4 class spell_warl_demonic_circle_summon : public SpellScriptLoader { public: @@ -473,6 +469,8 @@ class spell_warl_demonic_circle_summon : public SpellScriptLoader } }; +// 48020 Demonic Circle: Teleport +/// Updated 4.3.4 class spell_warl_demonic_circle_teleport : public SpellScriptLoader { public: @@ -506,6 +504,8 @@ class spell_warl_demonic_circle_teleport : public SpellScriptLoader } }; +// 48181 Haunt +/// Updated 4.3.4 class spell_warl_haunt : public SpellScriptLoader { public: @@ -565,6 +565,7 @@ class spell_warl_haunt : public SpellScriptLoader } }; +/// Updated 4.3.4 class spell_warl_unstable_affliction : public SpellScriptLoader { public: @@ -604,10 +605,12 @@ class spell_warl_unstable_affliction : public SpellScriptLoader } }; -class spell_warl_curse_of_doom : public SpellScriptLoader +// 603 Bane of Doom +/// Updated 4.3.4 +class spell_warl_bane_of_doom : public SpellScriptLoader { public: - spell_warl_curse_of_doom() : SpellScriptLoader("spell_warl_curse_of_doom") { } + spell_warl_bane_of_doom() : SpellScriptLoader("spell_warl_bane_of_doom") { } class spell_warl_curse_of_doom_AuraScript : public AuraScript { @@ -615,7 +618,7 @@ class spell_warl_curse_of_doom : public SpellScriptLoader bool Validate(SpellInfo const* /*spell*/) { - if (!sSpellMgr->GetSpellInfo(WARLOCK_CURSE_OF_DOOM_EFFECT)) + if (!sSpellMgr->GetSpellInfo(WARLOCK_BANE_OF_DOOM_EFFECT)) return false; return true; } @@ -635,7 +638,7 @@ class spell_warl_curse_of_doom : public SpellScriptLoader return; if (GetCaster()->ToPlayer()->isHonorOrXPTarget(GetTarget())) - GetCaster()->CastSpell(GetTarget(), WARLOCK_CURSE_OF_DOOM_EFFECT, true, NULL, aurEff); + GetCaster()->CastSpell(GetTarget(), WARLOCK_BANE_OF_DOOM_EFFECT, true, NULL, aurEff); } void Register() @@ -650,6 +653,7 @@ class spell_warl_curse_of_doom : public SpellScriptLoader } }; +// 755 Health Funnel class spell_warl_health_funnel : public SpellScriptLoader { public: @@ -705,6 +709,6 @@ void AddSC_warlock_spell_scripts() new spell_warl_demonic_circle_teleport(); new spell_warl_haunt(); new spell_warl_unstable_affliction(); - new spell_warl_curse_of_doom(); + new spell_warl_bane_of_doom(); new spell_warl_health_funnel(); } -- cgit v1.2.3 From 61dce1a02e0092f4ad57dbe05ec74d6dd89df14a Mon Sep 17 00:00:00 2001 From: Naios Date: Wed, 26 Sep 2012 17:46:00 +0200 Subject: Core/PhaseMgr: Implemented Phase Definitions, Terrainswap and multiphasing * fixes cataclysm aura effect SPELL_AURA_PHASE without phasemasks defined in miscValueA * implements CONDITION_SOURCE_TYPE_PHASE_DEFINITION Thanks to: - Cyberbrest: For the hard research work about multiphasing. - Venugh: He helped me with a lot of strange compile Errors. - Shauren: For the 4.3.4 phaseshift packet. - Booksize: He showed me how terrainswap works Signed-off-by: Naios --- .../2012_09_26_00_world_phase_definitions_434.sql | 66 ++++ src/server/game/Conditions/ConditionMgr.cpp | 48 ++- src/server/game/Conditions/ConditionMgr.h | 6 +- src/server/game/DataStores/DBCStructure.h | 4 +- src/server/game/Entities/Player/Player.cpp | 74 ++-- src/server/game/Entities/Player/Player.h | 9 +- src/server/game/Globals/ObjectMgr.cpp | 97 +++++- src/server/game/Globals/ObjectMgr.h | 11 + src/server/game/Handlers/MiscHandler.cpp | 47 ++- src/server/game/Instances/InstanceScript.cpp | 11 + src/server/game/Instances/InstanceScript.h | 3 + src/server/game/Maps/PhaseMgr.cpp | 371 +++++++++++++++++++++ src/server/game/Maps/PhaseMgr.h | 173 ++++++++++ src/server/game/Miscellaneous/Language.h | 10 +- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- src/server/game/Server/WorldSession.h | 2 +- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 26 +- src/server/game/World/World.cpp | 14 + src/server/game/World/World.h | 2 + src/server/scripts/Commands/cs_debug.cpp | 29 +- src/server/scripts/Commands/cs_gobject.cpp | 4 +- src/server/scripts/Commands/cs_modify.cpp | 17 +- src/server/scripts/Commands/cs_npc.cpp | 4 +- src/server/scripts/Commands/cs_reload.cpp | 10 + src/server/scripts/Commands/cs_wp.cpp | 16 +- 25 files changed, 973 insertions(+), 83 deletions(-) create mode 100644 sql/updates/world/2012_09_26_00_world_phase_definitions_434.sql mode change 100755 => 100644 src/server/game/Entities/Player/Player.h create mode 100644 src/server/game/Maps/PhaseMgr.cpp create mode 100644 src/server/game/Maps/PhaseMgr.h (limited to 'src') diff --git a/sql/updates/world/2012_09_26_00_world_phase_definitions_434.sql b/sql/updates/world/2012_09_26_00_world_phase_definitions_434.sql new file mode 100644 index 00000000000..b8e97278eb5 --- /dev/null +++ b/sql/updates/world/2012_09_26_00_world_phase_definitions_434.sql @@ -0,0 +1,66 @@ +DROP TABLE IF EXISTS `phase_definitions`; +CREATE TABLE `phase_definitions` ( + `zoneId` mediumint(7) unsigned NOT NULL DEFAULT '0', + `entry` smallint(5) unsigned NOT NULL AUTO_INCREMENT, + `phasemask` bigint(20) unsigned NOT NULL DEFAULT '0', + `phaseId` tinyint(3) unsigned NOT NULL DEFAULT '0', + `terrainswapmap` smallint(5) unsigned NOT NULL DEFAULT '0', + `flags` tinyint(3) unsigned DEFAULT '0', + `comment` text, + PRIMARY KEY (`zoneId`, `entry`) +) +AUTO_INCREMENT=1 +ENGINE=MyISAM +COLLATE='utf8_general_ci'; + +INSERT INTO `phase_definitions` (`zoneId`, `entry`, `phasemask`, `phaseId`, `terrainswapmap`, `flags`, `comment`) VALUES +(1519, 1, 129, 0, 0, 0, 'Stormwind: [A] Heros Call: Vashj''ir'), +(1519, 2, 257, 0, 0, 0, 'Stormwind: [A] Heros Call: Hyjal'), +(1519, 3, 513, 0, 0, 0, 'Stormwind: [A] Heros Call: Deepholm'), +(1519, 4, 1025, 0, 0, 0, 'Stormwind: [A] Heros Call: Uldum'), +(1519, 5, 2049, 0, 0, 0, 'Stormwind: [A] Heros Call: Twilight Highlands'), +(1637, 1, 129, 0, 0, 0, 'Orgrimmar: [H] Warchiefs Command: Vashj''ir'), +(1637, 2, 257, 0, 0, 0, 'Orgrimmar: [H] Warchiefs Command: Hyjal'), +(1637, 3, 513, 0, 0, 0, 'Orgrimmar: [H] Warchiefs Command: Deepholm'), +(1637, 4, 1025, 0, 0, 0, 'Orgrimmar: [H] Warchiefs Command: Uldum'), +(1637, 5, 2049, 0, 0, 0, 'Orgrimmar: [H] Warchiefs Command: Twilight Highlands'), +(616 , 1, 0 , 165, 719, 0, 'Mount Hyjal: Default Terrainswap'); + +DROP TABLE IF EXISTS `spell_phase`; +CREATE TABLE `spell_phase` ( + `id` mediumint(7) unsigned NOT NULL DEFAULT '0', + `phasemask` bigint(20) unsigned NOT NULL DEFAULT '1', + `terrainswapmap` smallint(5) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id`) +) +AUTO_INCREMENT=1 +ENGINE=MyISAM +COLLATE='utf8_general_ci'; + +DELETE FROM `trinity_string` WHERE `entry` BETWEEN 176 AND 182; +INSERT INTO `trinity_string` (`entry`, `content_default`) VALUES +(176, '|cff0099FFPhaseMgr: Report for player: %s, zoneId: %u, level: %u, team: %u, phaseupdateflag: %u|r'), +(177, '|cff663399PhaseMgr: There are no definitions defined for zoneId %u.|r'), +(178, '|cff0066FFPhaseMgr: Success (entry: %u) - added %s %u to the players phase.|r'), +(179, '|cffFF0000PhaseMgr: Condition for phase %u (entry: %u, zoneId: %u) failed.|r'), +(180, '|cffFF0000PhaseMgr: Condition for phase %u (entry: %u, zoneId: %u) has last phasemask flag. Skipped other definitions.|r'), +(181, '|cff6699FFPhaseMgr: The player gets phasemask %u through definitions, %u through phasing auras, and phase %u through custom phase.|r'), +(182, '|cff0099FFPhaseMgr: The player has phasemask %u (real: %u).|r'); + +DELETE FROM `command` WHERE `name` IN('debug phase', 'debug send setphaseshift'); +INSERT INTO `command` (`name`, `security`, `help`) VALUES +('debug phase', 1, 'Syntax: .debug phase\r\n\r\nSends a phase debug report of a player to you.'); + +/* +Conditions (SourceGroup -> ZoneId, SourceEntry -> Entry) + +If you visit the Gm Island as a alliance race you are automatically phased into phase 2. + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=23 AND `SourceGroup`=876 AND `SourceEntry`=1; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(23, 876, 1, 0, 0, 6, 0, 469, 0, 0, 0, 0, '', 'Phase Definitions Example: Phase is only visible for Alliance Members'); + +DELETE FROM `phase_definitions` WHERE `zoneId`=876 AND `entry`=1; +INSERT INTO `phase_definitions` (`zoneId`, `entry`, `phasemask`, `phaseId`, `terrainswapmap`, `flags`, `comment`) VALUES +(876, 1, 2, 0, 0, 0, '[Example] Gm Island'); +*/ diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 917c4cd7f90..406fb7cb753 100755 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -611,7 +611,8 @@ bool ConditionMgr::CanHaveSourceGroupSet(ConditionSourceType sourceType) const sourceType == CONDITION_SOURCE_TYPE_VEHICLE_SPELL || sourceType == CONDITION_SOURCE_TYPE_SPELL_IMPLICIT_TARGET || sourceType == CONDITION_SOURCE_TYPE_SPELL_CLICK_EVENT || - sourceType == CONDITION_SOURCE_TYPE_SMART_EVENT); + sourceType == CONDITION_SOURCE_TYPE_SMART_EVENT || + sourceType == CONDITION_SOURCE_TYPE_PHASE_DEFINITION); } bool ConditionMgr::CanHaveSourceIdSet(ConditionSourceType sourceType) const @@ -687,6 +688,23 @@ ConditionList ConditionMgr::GetConditionsForSmartEvent(int32 entryOrGuid, uint32 return cond; } +ConditionList ConditionMgr::GetConditionsForPhaseDefinition(uint32 zone, uint32 entry) +{ + ConditionList cond; + PhaseDefinitionConditionContainer::const_iterator itr = PhaseDefinitionsConditionStore.find(zone); + if (itr != PhaseDefinitionsConditionStore.end()) + { + ConditionTypeContainer::const_iterator i = (*itr).second.find(entry); + if (i != (*itr).second.end()) + { + cond = (*i).second; + sLog->outDebug(LOG_FILTER_CONDITIONSYS, "GetConditionsForPhaseDefinition: found conditions for zone %u entry %u spell %u", zone, entry); + } + } + + return cond; +} + void ConditionMgr::LoadConditions(bool isReload) { uint32 oldMSTime = getMSTime(); @@ -898,6 +916,13 @@ void ConditionMgr::LoadConditions(bool isReload) ++count; continue; } + case CONDITION_SOURCE_TYPE_PHASE_DEFINITION: + { + PhaseDefinitionsConditionStore[cond->SourceGroup][cond->SourceEntry].push_back(cond); + valid = true; + ++count; + continue; + } default: break; } @@ -1389,6 +1414,13 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) return false; } break; + case CONDITION_SOURCE_TYPE_PHASE_DEFINITION: + if (!PhaseMgr::IsConditionTypeSupported(cond->ConditionType)) + { + sLog->outError(LOG_FILTER_SQL, "Condition source type `CONDITION_SOURCE_TYPE_PHASE_DEFINITION` does not support condition type %u, ignoring.", cond->ConditionType); + return false; + } + break; case CONDITION_SOURCE_TYPE_GOSSIP_MENU: case CONDITION_SOURCE_TYPE_GOSSIP_MENU_OPTION: case CONDITION_SOURCE_TYPE_SMART_EVENT: @@ -1399,6 +1431,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) return true; } + bool ConditionMgr::isConditionTypeValid(Condition* cond) { if (cond->ConditionType == CONDITION_NONE || cond->ConditionType >= CONDITION_MAX) @@ -1940,6 +1973,19 @@ void ConditionMgr::Clean() SpellClickEventConditionStore.clear(); + for (PhaseDefinitionConditionContainer::iterator itr = PhaseDefinitionsConditionStore.begin(); itr != PhaseDefinitionsConditionStore.end(); ++itr) + { + for (ConditionTypeContainer::iterator it = itr->second.begin(); it != itr->second.end(); ++it) + { + for (ConditionList::const_iterator i = it->second.begin(); i != it->second.end(); ++i) + delete *i; + it->second.clear(); + } + itr->second.clear(); + } + + PhaseDefinitionsConditionStore.clear(); + // this is a BIG hack, feel free to fix it if you can figure out the ConditionMgr ;) for (std::list::const_iterator itr = AllocatedMemoryStore.begin(); itr != AllocatedMemoryStore.end(); ++itr) delete *itr; diff --git a/src/server/game/Conditions/ConditionMgr.h b/src/server/game/Conditions/ConditionMgr.h index 57af0562dcd..fe7f6a18af8 100755 --- a/src/server/game/Conditions/ConditionMgr.h +++ b/src/server/game/Conditions/ConditionMgr.h @@ -124,7 +124,8 @@ enum ConditionSourceType CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK = 20, CONDITION_SOURCE_TYPE_VEHICLE_SPELL = 21, CONDITION_SOURCE_TYPE_SMART_EVENT = 22, - CONDITION_SOURCE_TYPE_MAX = 23 //MAX + CONDITION_SOURCE_TYPE_PHASE_DEFINITION = 23, + CONDITION_SOURCE_TYPE_MAX = 24 //MAX }; enum ComparisionType @@ -211,6 +212,7 @@ typedef std::map ConditionTypeContainer; typedef std::map ConditionContainer; typedef std::map CreatureSpellConditionContainer; typedef std::map, ConditionTypeContainer> SmartEventConditionContainer; +typedef std::map PhaseDefinitionConditionContainer; typedef std::map ConditionReferenceContainer;//only used for references @@ -237,6 +239,7 @@ class ConditionMgr ConditionList GetConditionsForSpellClickEvent(uint32 creatureId, uint32 spellId); ConditionList GetConditionsForSmartEvent(int32 entryOrGuid, uint32 eventId, uint32 sourceType); ConditionList GetConditionsForVehicleSpell(uint32 creatureId, uint32 spellId); + ConditionList GetConditionsForPhaseDefinition(uint32 zone, uint32 entry); private: bool isSourceTypeValid(Condition* cond); @@ -254,6 +257,7 @@ class ConditionMgr CreatureSpellConditionContainer VehicleSpellConditionStore; CreatureSpellConditionContainer SpellClickEventConditionStore; SmartEventConditionContainer SmartEventConditionStore; + PhaseDefinitionConditionContainer PhaseDefinitionsConditionStore; }; template bool CompareValues(ComparisionType type, T val1, T val2) diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 308b9fa1a60..a1a0931dc5a 100644 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -1408,8 +1408,8 @@ struct LockEntry struct PhaseEntry { uint32 ID; // 0 - char* Name; // 1 - uint32 phaseShift; // 2 + char* Name; // 1 + uint32 flag; // 2 }; struct MailTemplateEntry diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 9a0b21194cd..0582a879d5f 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -649,7 +649,7 @@ void KillRewarder::Reward() #ifdef _MSC_VER #pragma warning(disable:4355) #endif -Player::Player(WorldSession* session): Unit(true), m_achievementMgr(this), m_reputationMgr(this) +Player::Player(WorldSession* session): Unit(true), m_achievementMgr(this), m_reputationMgr(this), phaseMgr(this) { #ifdef _MSC_VER #pragma warning(default:4355) @@ -2938,18 +2938,6 @@ void Player::SetGameMaster(bool on) } else { - // restore phase - uint32 newPhase = 0; - AuraEffectList const& phases = GetAuraEffectsByType(SPELL_AURA_PHASE); - if (!phases.empty()) - for (AuraEffectList::const_iterator itr = phases.begin(); itr != phases.end(); ++itr) - newPhase |= (*itr)->GetMiscValue(); - - if (!newPhase) - newPhase = PHASEMASK_NORMAL; - - SetPhaseMask(newPhase, false); - m_ExtraFlags &= ~ PLAYER_EXTRA_GM_ON; setFactionForRace(getRace()); RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_GM); @@ -2970,6 +2958,9 @@ void Player::SetGameMaster(bool on) getHostileRefManager().setOnlineOfflineState(true); m_serverSideVisibilityDetect.SetValue(SERVERSIDE_VISIBILITY_GM, SEC_PLAYER); + + phaseMgr.AddUpdateFlag(PHASE_UPDATE_FLAG_SERVERSIDE_CHANGED); + phaseMgr.Update(); } UpdateObjectVisibility(); @@ -3202,6 +3193,11 @@ void Player::GiveLevel(uint8 level) UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_LEVEL); + PhaseUpdateData phaseUdateData; + phaseUdateData.AddConditionType(CONDITION_LEVEL); + + phaseMgr.NotifyConditionChanged(phaseUdateData); + // Refer-A-Friend if (GetSession()->GetRecruiterId()) if (level < sWorld->getIntConfig(CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL)) @@ -7628,6 +7624,8 @@ void Player::UpdateArea(uint32 newArea) // so apply them accordingly m_areaUpdateId = newArea; + phaseMgr.AddUpdateFlag(PHASE_UPDATE_FLAG_AREA_UPDATE); + AreaTableEntry const* area = GetAreaEntryByAreaID(newArea); pvpInfo.inFFAPvPArea = area && (area->flags & AREA_FLAG_ARENA); UpdatePvPState(true); @@ -7644,10 +7642,14 @@ void Player::UpdateArea(uint32 newArea) } else RemoveByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_SANCTUARY); + + phaseMgr.RemoveUpdateFlag(PHASE_UPDATE_FLAG_AREA_UPDATE); } void Player::UpdateZone(uint32 newZone, uint32 newArea) { + phaseMgr.AddUpdateFlag(PHASE_UPDATE_FLAG_ZONE_UPDATE); + if (m_zoneUpdateId != newZone) { sOutdoorPvPMgr->HandlePlayerLeaveZone(this, m_zoneUpdateId); @@ -7757,6 +7759,8 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea) UpdateLocalChannels(newZone); UpdateZoneDependentAuras(newZone); + + phaseMgr.RemoveUpdateFlag(PHASE_UPDATE_FLAG_ZONE_UPDATE); } //If players are too far away from the duel flag... they lose the duel @@ -15010,6 +15014,11 @@ void Player::AddQuest(Quest const* quest, Object* questGiver) CastSpell(this, itr->second->spellId, true); } + PhaseUpdateData phaseUdateData; + phaseUdateData.AddQuestUpdate(quest_id); + + phaseMgr.NotifyConditionChanged(phaseUdateData); + UpdateForQuestWorldObjects(); } @@ -15178,6 +15187,11 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver, m_RewardedQuests.insert(quest_id); m_RewardedQuestsSave[quest_id] = true; + PhaseUpdateData phaseUdateData; + phaseUdateData.AddQuestUpdate(quest_id); + + phaseMgr.NotifyConditionChanged(phaseUdateData); + // StoreNewItem, mail reward, etc. save data directly to the database // to prevent exploitable data desynchronisation we save the quest status to the database too // (to prevent rewarding this quest another time while rewards were already given out) @@ -15767,6 +15781,11 @@ void Player::SetQuestStatus(uint32 quest_id, QuestStatus status) m_QuestStatusSave[quest_id] = true; } + PhaseUpdateData phaseUdateData; + phaseUdateData.AddQuestUpdate(quest_id); + + phaseMgr.NotifyConditionChanged(phaseUdateData); + UpdateForQuestWorldObjects(); } @@ -15777,6 +15796,11 @@ void Player::RemoveActiveQuest(uint32 quest_id) { m_QuestStatus.erase(itr); m_QuestStatusSave[quest_id] = false; + + PhaseUpdateData phaseUdateData; + phaseUdateData.AddQuestUpdate(quest_id); + + phaseMgr.NotifyConditionChanged(phaseUdateData); return; } } @@ -15788,6 +15812,11 @@ void Player::RemoveRewardedQuest(uint32 quest_id) { m_RewardedQuests.erase(rewItr); m_RewardedQuestsSave[quest_id] = false; + + PhaseUpdateData phaseUdateData; + phaseUdateData.AddQuestUpdate(quest_id); + + phaseMgr.NotifyConditionChanged(phaseUdateData); } } @@ -24420,25 +24449,6 @@ void Player::_LoadSkills(PreparedQueryResult result) } } -uint32 Player::GetPhaseMaskForSpawn() const -{ - uint32 phase = PHASEMASK_NORMAL; - if (!isGameMaster()) - phase = GetPhaseMask(); - else - { - AuraEffectList const& phases = GetAuraEffectsByType(SPELL_AURA_PHASE); - if (!phases.empty()) - phase = phases.front()->GetMiscValue(); - } - - // some aura phases include 1 normal map in addition to phase itself - if (uint32 n_phase = phase & ~PHASEMASK_NORMAL) - return n_phase; - - return PHASEMASK_NORMAL; -} - InventoryResult Player::CanEquipUniqueItem(Item* pItem, uint8 eslot, uint32 limit_count) const { ItemTemplate const* pProto = pItem->GetTemplate(); diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h old mode 100755 new mode 100644 index 4d91ac42879..f1f58231bef --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -37,6 +37,9 @@ #include "Unit.h" #include "Util.h" // for Tokens typedef #include "WorldSession.h" +#include "PhaseMgr.h" + +// for template #include "SpellMgr.h" #include @@ -54,6 +57,7 @@ class PlayerMenu; class PlayerSocial; class SpellCastTargets; class UpdateMask; +class PhaseMgr; typedef std::deque PlayerMails; @@ -1342,7 +1346,8 @@ class Player : public Unit, public GridObject Pet* GetPet() const; Pet* SummonPet(uint32 entry, float x, float y, float z, float ang, PetType petType, uint32 despwtime); void RemovePet(Pet* pet, PetSaveMode mode, bool returnreagent = false); - uint32 GetPhaseMaskForSpawn() const; // used for proper set phase for DB at GM-mode creature/GO spawn + + PhaseMgr& GetPhaseMgr() { return phaseMgr; } void Say(const std::string& text, const uint32 language); void Yell(const std::string& text, const uint32 language); @@ -3083,6 +3088,8 @@ class Player : public Unit, public GridObject uint32 _pendingBindTimer; uint32 _activeCheats; + + PhaseMgr phaseMgr; }; void AddItemsSetItem(Player*player, Item* item); diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 3945d3b76fe..dd2afa44a07 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -8652,7 +8652,7 @@ void ObjectMgr::LoadFactionChangeTitles() } uint32 count = 0; - + do { Field* fields = result->Fetch(); @@ -8666,7 +8666,7 @@ void ObjectMgr::LoadFactionChangeTitles() sLog->outError(LOG_FILTER_SQL, "Title %u referenced in `player_factionchange_title` does not exist, pair skipped!", horde); else FactionChange_Titles[alliance] = horde; - + ++count; } while (result->NextRow()); @@ -8674,6 +8674,99 @@ void ObjectMgr::LoadFactionChangeTitles() sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u faction change title pairs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } +void ObjectMgr::LoadPhaseDefinitions() +{ + _PhaseDefinitionStore.clear(); + + uint32 oldMSTime = getMSTime(); + + // 0 1 2 3 4 5 + QueryResult result = WorldDatabase.Query("SELECT zoneId, entry, phasemask, phaseId, terrainswapmap, flags FROM `phase_definitions` ORDER BY `entry` ASC"); + + if (!result) + { + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 phasing definitions. DB table `phase_definitions` is empty."); + return; + } + + uint32 count = 0; + + do + { + Field *fields = result->Fetch(); + + PhaseDefinition PhaseDefinition; + + PhaseDefinition.zoneId = fields[0].GetUInt32(); + PhaseDefinition.entry = fields[1].GetUInt32(); + PhaseDefinition.phasemask = fields[2].GetUInt32(); + PhaseDefinition.phaseId = fields[3].GetUInt32(); + PhaseDefinition.terrainswapmap = fields[4].GetUInt32(); + PhaseDefinition.flags = fields[5].GetUInt32(); + + // Checks + if ((PhaseDefinition.flags & PHASE_FLAG_OVERWRITE_EXISTING) && (PhaseDefinition.flags & PHASE_FLAG_NEGATE_PHASE)) + { + sLog->outError(LOG_FILTER_SQL, "Flags defined in phase_definitions in zoneId %d and entry %u does contain PHASE_FLAG_OVERWRITE_EXISTING and PHASE_FLAG_NEGATE_PHASE. Setting flags to PHASE_FLAG_OVERWRITE_EXISTING", PhaseDefinition.zoneId, PhaseDefinition.entry); + PhaseDefinition.flags &= ~PHASE_FLAG_NEGATE_PHASE; + } + + _PhaseDefinitionStore[PhaseDefinition.zoneId].push_back(PhaseDefinition); + + ++count; + } + while (result->NextRow()); + + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u phasing definitions in %u ms.", count, GetMSTimeDiffToNow(oldMSTime)); +} + +void ObjectMgr::LoadSpellPhaseInfo() +{ + _SpellPhaseStore.clear(); + + uint32 oldMSTime = getMSTime(); + + // 0 1 2 + QueryResult result = WorldDatabase.Query("SELECT id, phasemask, terrainswapmap FROM `spell_phase`"); + + if (!result) + { + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 spell dbc infos. DB table `spell_phase` is empty."); + return; + } + + uint32 count = 0; + do + { + Field *fields = result->Fetch(); + + SpellPhaseInfo spellPhaseInfo; + spellPhaseInfo.spellId = fields[0].GetUInt32(); + + SpellInfo const* spell = sSpellMgr->GetSpellInfo(spellPhaseInfo.spellId); + if (!spell) + { + sLog->outError(LOG_FILTER_SQL, "Spell %u defined in `spell_phase` does not exists, skipped.", spellPhaseInfo.spellId); + continue; + } + + if (!spell->HasAura(SPELL_AURA_PHASE)) + { + sLog->outError(LOG_FILTER_SQL, "Spell %u defined in `spell_phase` does not have aura effect type SPELL_AURA_PHASE, useless value.", spellPhaseInfo.spellId); + continue; + } + + spellPhaseInfo.phasemask = fields[1].GetUInt32(); + spellPhaseInfo.terrainswapmap = fields[2].GetUInt32(); + + _SpellPhaseStore[spellPhaseInfo.spellId] = spellPhaseInfo; + + ++count; + } + while (result->NextRow()); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spell dbc infos in %u ms.", count, GetMSTimeDiffToNow(oldMSTime)); +} + GameObjectTemplate const* ObjectMgr::GetGameObjectTemplate(uint32 entry) { GameObjectTemplateContainer::const_iterator itr = _gameObjectTemplateStore.find(entry); diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index 61094d60c55..496d5ae224f 100755 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -42,8 +42,10 @@ #include #include "ConditionMgr.h" #include +#include "PhaseMgr.h" class Item; +class PhaseMgr; // GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push, N), also any gcc version not support it at some platform #if defined(__GNUC__) @@ -906,6 +908,12 @@ class ObjectMgr void LoadTrainerSpell(); void AddSpellToTrainer(uint32 entry, uint32 spell, uint32 spellCost, uint32 reqSkill, uint32 reqSkillValue, uint32 reqLevel); + void LoadPhaseDefinitions(); + void LoadSpellPhaseInfo(); + + PhaseDefinitionStore const* GetPhaseDefinitionStore() { return &_PhaseDefinitionStore; } + SpellPhaseStore const* GetSpellPhaseStore() { return &_SpellPhaseStore; } + std::string GeneratePetName(uint32 entry); uint32 GetBaseXP(uint8 level); uint32 GetXPForLevel(uint8 level) const; @@ -1222,6 +1230,9 @@ class ObjectMgr PageTextContainer _pageTextStore; InstanceTemplateContainer _instanceTemplateStore; + PhaseDefinitionStore _PhaseDefinitionStore; + SpellPhaseStore _SpellPhaseStore; + private: void LoadScripts(ScriptsType type); void CheckScripts(ScriptsType type, std::set& ids); diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 2acc8ffcf7b..1947baa43b6 100644 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -1753,10 +1753,51 @@ void WorldSession::HandleReadyForAccountDataTimes(WorldPacket& /*recvData*/) SendAccountDataTimes(GLOBAL_CACHE_MASK); } -void WorldSession::SendSetPhaseShift(uint32 PhaseShift) +void WorldSession::SendSetPhaseShift(std::set const& phaseIds, std::set const& terrainswaps) { - WorldPacket data(SMSG_SET_PHASE_SHIFT, 4); - data << uint32(PhaseShift); + ObjectGuid guid = _player->GetGUID(); + + WorldPacket data(SMSG_SET_PHASE_SHIFT, 1 + 8 + 4 + 4 + 4 + 4 + 2 * phaseIds.size() + 4 + terrainswaps.size() * 2); + data.WriteBit(guid[2]); + data.WriteBit(guid[3]); + data.WriteBit(guid[1]); + data.WriteBit(guid[6]); + data.WriteBit(guid[4]); + data.WriteBit(guid[5]); + data.WriteBit(guid[0]); + data.WriteBit(guid[7]); + + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[4]); + + data << uint32(0); + //for (uint8 i = 0; i < worldMapAreaCount; ++i) + // data << uint16(0); // WorldMapArea.dbc id (controls map display) + + data.WriteByteSeq(guid[1]); + + data << uint32(0); // flags (not phasemask) + + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[6]); + + data << uint32(0); // Inactive terrain swaps + //for (uint8 i = 0; i < inactiveSwapsCount; ++i) + // data << uint16(0); + + data << uint32(phaseIds.size()) * 2; // Phase.dbc ids + for (std::set::const_iterator itr = phaseIds.begin(); itr != phaseIds.end(); ++itr) + data << uint16(*itr); + + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[0]); + + data << uint32(terrainswaps.size()) * 2; // Active terrain swaps + for (std::set::const_iterator itr = terrainswaps.begin(); itr != terrainswaps.end(); ++itr) + data << uint16(*itr); + + data.WriteByteSeq(guid[5]); + SendPacket(&data); } diff --git a/src/server/game/Instances/InstanceScript.cpp b/src/server/game/Instances/InstanceScript.cpp index d967ece9cf2..f14dc3c8b14 100755 --- a/src/server/game/Instances/InstanceScript.cpp +++ b/src/server/game/Instances/InstanceScript.cpp @@ -450,3 +450,14 @@ void InstanceScript::UpdateEncounterState(EncounterCreditType type, uint32 credi } } } + +void InstanceScript::UpdatePhasing() +{ + PhaseUpdateData phaseUdateData; + phaseUdateData.AddConditionType(CONDITION_INSTANCE_DATA); + + Map::PlayerList const& players = instance->GetPlayers(); + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + if (Player* player = itr->getSource()) + player->GetPhaseMgr().NotifyConditionChanged(phaseUdateData); +} diff --git a/src/server/game/Instances/InstanceScript.h b/src/server/game/Instances/InstanceScript.h index ab37c1ab5e9..291ba3be52f 100755 --- a/src/server/game/Instances/InstanceScript.h +++ b/src/server/game/Instances/InstanceScript.h @@ -217,6 +217,9 @@ class InstanceScript : public ZoneScript virtual void FillInitialWorldStates(WorldPacket& /*data*/) {} + // ReCheck PhaseTemplate related conditions + void UpdatePhasing(); + protected: void SetBossNumber(uint32 number) { bosses.resize(number); } void LoadDoorData(DoorData const* data); diff --git a/src/server/game/Maps/PhaseMgr.cpp b/src/server/game/Maps/PhaseMgr.cpp new file mode 100644 index 00000000000..63bdff2d094 --- /dev/null +++ b/src/server/game/Maps/PhaseMgr.cpp @@ -0,0 +1,371 @@ +/* + * Copyright (C) 2008-2012 TrinityCore + * + * 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; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; 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, see . + */ + +#include "PhaseMgr.h" +#include "Chat.h" + +////////////////////////////////////////////////////////////////// +// Updating + +PhaseMgr::PhaseMgr(Player* _player) : player(_player), phaseData(_player), _UpdateFlags(0) +{ + _PhaseDefinitionStore = sObjectMgr->GetPhaseDefinitionStore(); + _SpellPhaseStore = sObjectMgr->GetSpellPhaseStore(); +} + +void PhaseMgr::Update() +{ + if (IsUpdateInProgress()) + return; + + if (_UpdateFlags & PHASE_UPDATE_FLAG_CLIENTSIDE_CHANGED) + phaseData.SendPhaseshiftToPlayer(); + + if (_UpdateFlags & PHASE_UPDATE_FLAG_SERVERSIDE_CHANGED) + phaseData.SendPhaseMaskToPlayer(); + + _UpdateFlags = 0; +} + +void PhaseMgr::RemoveUpdateFlag(PhaseUpdateFlag updateFlag) +{ + _UpdateFlags &= ~updateFlag; + + if (updateFlag == PHASE_UPDATE_FLAG_ZONE_UPDATE) + { + // Update zone changes + if (phaseData.HasActiveDefinitions()) + { + phaseData.ResetDefinitions(); + _UpdateFlags |= (PHASE_UPDATE_FLAG_CLIENTSIDE_CHANGED | PHASE_UPDATE_FLAG_SERVERSIDE_CHANGED); + } + + if (_PhaseDefinitionStore->find(player->GetZoneId()) != _PhaseDefinitionStore->end()) + Recalculate(); + } + + Update(); +} + +///////////////////////////////////////////////////////////////// +// Notifier + +void PhaseMgr::NotifyConditionChanged(PhaseUpdateData const& updateData) +{ + if (NeedsPhaseUpdateWithData(updateData)) + { + Recalculate(); + Update(); + } +} + +////////////////////////////////////////////////////////////////// +// Phasing Definitions + +void PhaseMgr::Recalculate() +{ + if (phaseData.HasActiveDefinitions()) + { + phaseData.ResetDefinitions(); + _UpdateFlags |= (PHASE_UPDATE_FLAG_CLIENTSIDE_CHANGED | PHASE_UPDATE_FLAG_SERVERSIDE_CHANGED); + } + + PhaseDefinitionStore::const_iterator itr = _PhaseDefinitionStore->find(player->GetZoneId()); + if (itr != _PhaseDefinitionStore->end()) + for (PhaseDefinitionContainer::const_iterator phase = itr->second.begin(); phase != itr->second.end(); ++phase) + if (CheckDefinition(&(*phase))) + { + phaseData.AddPhaseDefinition(&(*phase)); + + if (phase->phasemask) + _UpdateFlags |= PHASE_UPDATE_FLAG_SERVERSIDE_CHANGED; + + if (phase->phaseId || phase->terrainswapmap) + _UpdateFlags |= PHASE_UPDATE_FLAG_CLIENTSIDE_CHANGED; + + if (phase->IsLastDefinition()) + break; + } +} + +inline bool PhaseMgr::CheckDefinition(PhaseDefinition const* phaseDefinition) +{ + return sConditionMgr->IsObjectMeetToConditions(player, sConditionMgr->GetConditionsForPhaseDefinition(phaseDefinition->zoneId, phaseDefinition->entry)); +} + +bool PhaseMgr::NeedsPhaseUpdateWithData(PhaseUpdateData const updateData) const +{ + PhaseDefinitionStore::const_iterator itr = _PhaseDefinitionStore->find(player->GetZoneId()); + if (itr != _PhaseDefinitionStore->end()) + { + for (PhaseDefinitionContainer::const_iterator phase = itr->second.begin(); phase != itr->second.end(); ++phase) + { + ConditionList conditionList = sConditionMgr->GetConditionsForPhaseDefinition(phase->zoneId, phase->entry); + for (ConditionList::const_iterator condition = conditionList.begin(); condition != conditionList.end(); ++condition) + if (updateData.IsConditionRelated(*condition)) + return true; + } + } + return false; +} + +////////////////////////////////////////////////////////////////// +// Auras + +void PhaseMgr::RegisterPhasingAuraEffect(AuraEffect const* auraEffect) +{ + PhaseInfo phaseInfo; + + if (auraEffect->GetMiscValue()) + { + _UpdateFlags |= PHASE_UPDATE_FLAG_SERVERSIDE_CHANGED; + phaseInfo.phasemask = auraEffect->GetMiscValue(); + } + else + { + SpellPhaseStore::const_iterator itr = _SpellPhaseStore->find(auraEffect->GetId()); + if (itr != _SpellPhaseStore->end()) + { + if (itr->second.phasemask) + { + _UpdateFlags |= PHASE_UPDATE_FLAG_SERVERSIDE_CHANGED; + phaseInfo.phasemask = itr->second.phasemask; + } + + if (itr->second.terrainswapmap) + phaseInfo.terrainswapmap = itr->second.terrainswapmap; + } + } + + phaseInfo.phaseId = auraEffect->GetMiscValueB(); + + if (phaseInfo.NeedsClientSideUpdate()) + _UpdateFlags |= PHASE_UPDATE_FLAG_CLIENTSIDE_CHANGED; + + phaseData.AddAuraInfo(auraEffect->GetId(), phaseInfo); + + Update(); +} + +void PhaseMgr::UnRegisterPhasingAuraEffect(AuraEffect const* auraEffect) +{ + _UpdateFlags |= phaseData.RemoveAuraInfo(auraEffect->GetId()); + + Update(); +} + +////////////////////////////////////////////////////////////////// +// Commands + +void PhaseMgr::SendDebugReportToPlayer(Player* const debugger) +{ + ChatHandler(debugger).PSendSysMessage(LANG_PHASING_REPORT_STATUS, player->GetName(), player->GetZoneId(), player->getLevel(), player->GetTeamId(), _UpdateFlags); + + PhaseDefinitionStore::const_iterator itr = _PhaseDefinitionStore->find(player->GetZoneId()); + if (itr == _PhaseDefinitionStore->end()) + ChatHandler(debugger).PSendSysMessage(LANG_PHASING_NO_DEFINITIONS, player->GetZoneId()); + else + { + for (PhaseDefinitionContainer::const_iterator phase = itr->second.begin(); phase != itr->second.end(); ++phase) + { + if (CheckDefinition(&(*phase))) + ChatHandler(debugger).PSendSysMessage(LANG_PHASING_SUCCESS, phase->entry, phase->IsNegatingPhasemask() ? "negated Phase" : "Phase", phase->phasemask); + else + ChatHandler(debugger).PSendSysMessage(LANG_PHASING_FAILED, phase->phasemask, phase->entry, phase->zoneId); + + if (phase->IsLastDefinition()) + { + ChatHandler(debugger).PSendSysMessage(LANG_PHASING_LAST_PHASE, phase->phasemask, phase->entry, phase->zoneId); + break; + } + } + } + + ChatHandler(debugger).PSendSysMessage(LANG_PHASING_LIST, phaseData._PhasemaskThroughDefinitions, phaseData._PhasemaskThroughAuras, phaseData._CustomPhasemask); + + ChatHandler(debugger).PSendSysMessage(LANG_PHASING_PHASEMASK, phaseData.GetPhaseMaskForSpawn(), player->GetPhaseMask()); +} + +void PhaseMgr::SetCustomPhase(uint32 const phaseMask) +{ + phaseData._CustomPhasemask = phaseMask; + + _UpdateFlags |= PHASE_UPDATE_FLAG_SERVERSIDE_CHANGED; + + Update(); +} + +////////////////////////////////////////////////////////////////// +// Phase Data + +uint32 PhaseData::GetCurrentPhasemask() const +{ + if (player->isGameMaster()) + return PHASEMASK_ANYWHERE; + + if (_CustomPhasemask) + return _CustomPhasemask; + + return GetPhaseMaskForSpawn(); +} + +inline uint32 PhaseData::GetPhaseMaskForSpawn() const +{ + uint32 const phase = (_PhasemaskThroughDefinitions | _PhasemaskThroughAuras); + return (phase ? phase : PHASEMASK_NORMAL); +} + +void PhaseData::SendPhaseMaskToPlayer() +{ + // Server side update + uint32 const phasemask = GetCurrentPhasemask(); + if (player->GetPhaseMask() == phasemask) + return; + + player->SetPhaseMask(phasemask, false); + + if (player->IsVisible()) + player->UpdateObjectVisibility(); +} + +void PhaseData::SendPhaseshiftToPlayer() +{ + // Client side update + std::set phaseIds; + std::set terrainswaps; + + for (PhaseInfoContainer::const_iterator itr = spellPhaseInfo.begin(); itr != spellPhaseInfo.end(); ++itr) + { + if (itr->second.terrainswapmap) + terrainswaps.insert(itr->second.terrainswapmap); + + if (itr->second.phaseId) + phaseIds.insert(itr->second.phaseId); + } + + // Phase Definitions + for (std::list::const_iterator itr = activePhaseDefinitions.begin(); itr != activePhaseDefinitions.end(); ++itr) + { + if ((*itr)->phaseId) + phaseIds.insert((*itr)->phaseId); + + if ((*itr)->terrainswapmap) + terrainswaps.insert((*itr)->terrainswapmap); + } + + player->GetSession()->SendSetPhaseShift(phaseIds, terrainswaps); +} + +void PhaseData::AddPhaseDefinition(PhaseDefinition const* phaseDefinition) +{ + if (phaseDefinition->IsOverwritingExistingPhases()) + { + activePhaseDefinitions.clear(); + _PhasemaskThroughDefinitions = phaseDefinition->phasemask; + } + else + { + if (phaseDefinition->IsNegatingPhasemask()) + _PhasemaskThroughDefinitions &= ~phaseDefinition->phasemask; + else + _PhasemaskThroughDefinitions |= phaseDefinition->phasemask; + } + + activePhaseDefinitions.push_back(phaseDefinition); +} + +void PhaseData::AddAuraInfo(uint32 const spellId, PhaseInfo phaseInfo) +{ + if (phaseInfo.phasemask) + _PhasemaskThroughAuras |= phaseInfo.phasemask; + + spellPhaseInfo[spellId] = phaseInfo; +} + +uint32 PhaseData::RemoveAuraInfo(uint32 const spellId) +{ + PhaseInfoContainer::const_iterator rAura = spellPhaseInfo.find(spellId); + if (rAura != spellPhaseInfo.end()) + { + uint32 updateflag = 0; + + if (rAura->second.NeedsClientSideUpdate()) + updateflag |= PHASE_UPDATE_FLAG_CLIENTSIDE_CHANGED; + + if (rAura->second.NeedsServerSideUpdate()) + { + _PhasemaskThroughAuras = 0; + + updateflag |= PHASE_UPDATE_FLAG_SERVERSIDE_CHANGED; + + spellPhaseInfo.erase(rAura); + + for (PhaseInfoContainer::const_iterator itr = spellPhaseInfo.begin(); itr != spellPhaseInfo.end(); ++itr) + _PhasemaskThroughAuras |= itr->second.phasemask; + } + + return updateflag; + } + else + return 0; +} + +////////////////////////////////////////////////////////////////// +// Phase Update Data + +void PhaseUpdateData::AddQuestUpdate(uint32 const questId) +{ + AddConditionType(CONDITION_QUESTREWARDED); + AddConditionType(CONDITION_QUESTTAKEN); + AddConditionType(CONDITION_QUEST_COMPLETE); + AddConditionType(CONDITION_QUEST_NONE); + + _questId = questId; +} + +bool PhaseUpdateData::IsConditionRelated(Condition const* condition) const +{ + switch (condition->ConditionType) + { + case CONDITION_QUESTREWARDED: + case CONDITION_QUESTTAKEN: + case CONDITION_QUEST_COMPLETE: + case CONDITION_QUEST_NONE: + return condition->ConditionValue1 == _questId && ((1 << condition->ConditionType) & _conditionTypeFlags); + default: + return (1 << condition->ConditionType) & _conditionTypeFlags; + } +} + +bool PhaseMgr::IsConditionTypeSupported(ConditionTypes const conditionType) +{ + switch (conditionType) + { + case CONDITION_QUESTREWARDED: + case CONDITION_QUESTTAKEN: + case CONDITION_QUEST_COMPLETE: + case CONDITION_QUEST_NONE: + case CONDITION_TEAM: + case CONDITION_CLASS: + case CONDITION_RACE: + case CONDITION_INSTANCE_DATA: + case CONDITION_LEVEL: + return true; + default: + return false; + } +} diff --git a/src/server/game/Maps/PhaseMgr.h b/src/server/game/Maps/PhaseMgr.h new file mode 100644 index 00000000000..accb0cd3ea8 --- /dev/null +++ b/src/server/game/Maps/PhaseMgr.h @@ -0,0 +1,173 @@ +/* + * Copyright (C) 2008-2012 TrinityCore + * + * 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; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; 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, see . + */ + +#ifndef TRINITY_PHASEMGR_H +#define TRINITY_PHASEMGR_H + +#include "SharedDefines.h" +#include "SpellAuras.h" +#include "SpellAuraEffects.h" + +class ObjectMgr; +class Player; + +// Phasing (visibility) +enum PhasingFlags +{ + PHASE_FLAG_OVERWRITE_EXISTING = 0x01, // don't stack with existing phases, overwrites existing phases + PHASE_FLAG_NO_MORE_PHASES = 0x02, // stop calculating phases after this phase was applied (no more phases will be applied) + PHASE_FLAG_NEGATE_PHASE = 0x04 // negate instead to add the phasemask +}; + +enum PhaseUpdateFlag +{ + PHASE_UPDATE_FLAG_ZONE_UPDATE = 0x01, + PHASE_UPDATE_FLAG_AREA_UPDATE = 0x02, + + // Internal flags + PHASE_UPDATE_FLAG_CLIENTSIDE_CHANGED = 0x08, + PHASE_UPDATE_FLAG_SERVERSIDE_CHANGED = 0x10, +}; + +struct PhaseDefinition +{ + uint32 zoneId; + uint32 entry; + uint32 phasemask; + uint32 phaseId; + uint32 terrainswapmap; + uint8 flags; + + bool IsOverwritingExistingPhases() const { return flags & PHASE_FLAG_OVERWRITE_EXISTING; } + bool IsLastDefinition() const { return flags & PHASE_FLAG_NO_MORE_PHASES; } + bool IsNegatingPhasemask() const { return flags & PHASE_FLAG_NEGATE_PHASE; } +}; + +typedef std::list PhaseDefinitionContainer; +typedef UNORDERED_MAP PhaseDefinitionStore; + +struct SpellPhaseInfo +{ + uint32 spellId; + uint32 phasemask; + uint32 terrainswapmap; +}; + +typedef UNORDERED_MAP SpellPhaseStore; + +struct PhaseInfo +{ + PhaseInfo() : phasemask(0), terrainswapmap(0), phaseId(0) {} + + uint32 phasemask; + uint32 terrainswapmap; + uint32 phaseId; + + bool NeedsServerSideUpdate() const { return phasemask; } + bool NeedsClientSideUpdate() const { return terrainswapmap || phaseId; } +}; + +typedef UNORDERED_MAP PhaseInfoContainer; + +struct PhaseData +{ + PhaseData(Player* _player) : player(_player), _PhasemaskThroughDefinitions(0), _PhasemaskThroughAuras(0), _CustomPhasemask(0) {} + + uint32 _PhasemaskThroughDefinitions; + uint32 _PhasemaskThroughAuras; + uint32 _CustomPhasemask; + + uint32 GetCurrentPhasemask() const; + inline uint32 GetPhaseMaskForSpawn() const; + + void ResetDefinitions() { _PhasemaskThroughDefinitions = 0; activePhaseDefinitions.clear(); } + void AddPhaseDefinition(PhaseDefinition const* phaseDefinition); + bool HasActiveDefinitions() const { return !activePhaseDefinitions.empty(); } + + void AddAuraInfo(uint32 const spellId, PhaseInfo phaseInfo); + uint32 RemoveAuraInfo(uint32 const spellId); + + void SendPhaseMaskToPlayer(); + void SendPhaseshiftToPlayer(); + +private: + Player* player; + std::list activePhaseDefinitions; + PhaseInfoContainer spellPhaseInfo; +}; + +struct PhaseUpdateData +{ + void AddConditionType(ConditionTypes const conditionType) { _conditionTypeFlags |= (1 << conditionType); } + void AddQuestUpdate(uint32 const questId); + + bool IsConditionRelated(Condition const* condition) const; + +private: + uint32 _conditionTypeFlags; + uint32 _questId; +}; + +class PhaseMgr +{ +public: + PhaseMgr(Player* _player); + ~PhaseMgr() {} + + uint32 GetCurrentPhasemask() { return phaseData.GetCurrentPhasemask(); }; + inline uint32 GetPhaseMaskForSpawn() { return phaseData.GetCurrentPhasemask(); } + + // Phase definitions update handling + void NotifyConditionChanged(PhaseUpdateData const& updateData); + void NotifyStoresReloaded() { Recalculate(); Update(); } + + void Update(); + + // Aura phase effects + void RegisterPhasingAuraEffect(AuraEffect const* auraEffect); + void UnRegisterPhasingAuraEffect(AuraEffect const* auraEffect); + + // Update flags (delayed phasing) + void AddUpdateFlag(PhaseUpdateFlag const updateFlag) { _UpdateFlags |= updateFlag; } + void RemoveUpdateFlag(PhaseUpdateFlag const updateFlag); + + // Needed for modify phase command + void SetCustomPhase(uint32 const phaseMask); + + // Debug + void SendDebugReportToPlayer(Player* const debugger); + + static bool IsConditionTypeSupported(ConditionTypes const conditionType); + +private: + void Recalculate(); + + inline bool CheckDefinition(PhaseDefinition const* phaseDefinition); + + bool NeedsPhaseUpdateWithData(PhaseUpdateData const updateData) const; + + inline bool IsUpdateInProgress() const { return (_UpdateFlags & PHASE_UPDATE_FLAG_ZONE_UPDATE) || (_UpdateFlags & PHASE_UPDATE_FLAG_AREA_UPDATE); } + + PhaseDefinitionStore const* _PhaseDefinitionStore; + SpellPhaseStore const* _SpellPhaseStore; + + Player* player; + PhaseData phaseData; + uint8 _UpdateFlags; +}; + +#endif diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h index 5893bbd6564..c55c57481f4 100755 --- a/src/server/game/Miscellaneous/Language.h +++ b/src/server/game/Miscellaneous/Language.h @@ -174,7 +174,15 @@ enum TrinityStrings LANG_YOU_CHANGE_RUNIC_POWER = 173, LANG_YOURS_RUNIC_POWER_CHANGED = 174, LANG_LIQUID_STATUS = 175, - // Room for more level 1 176-199 not used + + LANG_PHASING_REPORT_STATUS = 176, + LANG_PHASING_NO_DEFINITIONS = 177, // Phasing + LANG_PHASING_SUCCESS = 178, + LANG_PHASING_FAILED = 179, + LANG_PHASING_LAST_PHASE = 180, + LANG_PHASING_LIST = 181, + LANG_PHASING_PHASEMASK = 182, + // Room for more level 1 183-199 not used // level 2 chat LANG_NO_SELECTION = 200, diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 5b6af4b2de8..694b2cf2d7f 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -1157,7 +1157,7 @@ void OpcodeTable::Initialize() DEFINE_OPCODE_HANDLER(SMSG_SET_FLAT_SPELL_MODIFIER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SET_FORCED_REACTIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SET_PCT_SPELL_MODIFIER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_SET_PHASE_SHIFT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_SET_PHASE_SHIFT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SET_PLAYER_DECLINED_NAMES_RESULT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SET_PLAY_HOVER_ANIM, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_SET_PROFICIENCY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index e6c13557076..5c61385f537 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -253,7 +253,7 @@ class WorldSession void SendPetNameInvalid(uint32 error, const std::string& name, DeclinedName *declinedName); void SendPartyResult(PartyOperation operation, const std::string& member, PartyResult res, uint32 val = 0); void SendAreaTriggerMessage(const char* Text, ...) ATTR_PRINTF(2, 3); - void SendSetPhaseShift(uint32 phaseShift); + void SendSetPhaseShift(std::set const& phaseIds, std::set const& terrainswaps); void SendQueryTimeResponse(); void SendAuthResponse(uint8 code, bool queued, uint32 queuePos = 0); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 28ddaf05afc..d70c68b9be2 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -1808,27 +1808,21 @@ void AuraEffect::HandlePhase(AuraApplication const* aurApp, uint8 mode, bool app Unit* target = aurApp->GetTarget(); - // no-phase is also phase state so same code for apply and remove - uint32 newPhase = 0; - Unit::AuraEffectList const& phases = target->GetAuraEffectsByType(SPELL_AURA_PHASE); - if (!phases.empty()) - for (Unit::AuraEffectList::const_iterator itr = phases.begin(); itr != phases.end(); ++itr) - newPhase |= (*itr)->GetMiscValue(); - if (Player* player = target->ToPlayer()) { - if (!newPhase) - newPhase = PHASEMASK_NORMAL; - - // GM-mode have mask 0xFFFFFFFF - if (player->isGameMaster()) - newPhase = 0xFFFFFFFF; - - player->SetPhaseMask(newPhase, false); - player->GetSession()->SendSetPhaseShift(newPhase); + if (apply) + player->GetPhaseMgr().RegisterPhasingAuraEffect(this); + else + player->GetPhaseMgr().UnRegisterPhasingAuraEffect(this); } else { + uint32 newPhase = 0; + Unit::AuraEffectList const& phases = target->GetAuraEffectsByType(SPELL_AURA_PHASE); + if (!phases.empty()) + for (Unit::AuraEffectList::const_iterator itr = phases.begin(); itr != phases.end(); ++itr) + newPhase |= (*itr)->GetMiscValue(); + if (!newPhase) { newPhase = PHASEMASK_NORMAL; diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 94961b7b930..371668e73d9 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1368,6 +1368,9 @@ void World::SetInitialWorldSettings() sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Spell Group Stack Rules..."); sSpellMgr->LoadSpellGroupStackRules(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Spell Phase Dbc Info..."); + sObjectMgr->LoadSpellPhaseInfo(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading NPC Texts..."); sObjectMgr->LoadGossipText(); @@ -1616,6 +1619,9 @@ void World::SetInitialWorldSettings() sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading World States..."); // must be loaded before battleground, outdoor PvP and conditions LoadWorldStates(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Phase definitions..."); + sObjectMgr->LoadPhaseDefinitions(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Conditions..."); sConditionMgr->LoadConditions(); @@ -3022,3 +3028,11 @@ CharacterNameData const* World::GetCharacterNameData(uint32 guid) const else return NULL; } + +void World::UpdatePhaseDefinitions() +{ + SessionMap::const_iterator itr; + for (itr = m_sessions.begin(); itr != m_sessions.end(); ++itr) + if (itr->second && itr->second->GetPlayer() && itr->second->GetPlayer()->IsInWorld()) + itr->second->GetPlayer()->GetPhaseMgr().NotifyStoresReloaded(); +} diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h index 33ec159ec81..e1465f4897d 100644 --- a/src/server/game/World/World.h +++ b/src/server/game/World/World.h @@ -784,6 +784,8 @@ class World uint32 GetCleaningFlags() const { return m_CleaningFlags; } void SetCleaningFlags(uint32 flags) { m_CleaningFlags = flags; } void ResetEventSeasonalQuests(uint16 event_id); + + void UpdatePhaseDefinitions(); protected: void _UpdateGameTime(); // callback for UpdateRealmCharacters diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index 67b4d780942..363258648f6 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -90,6 +90,7 @@ public: { "areatriggers", SEC_ADMINISTRATOR, false, &HandleDebugAreaTriggersCommand, "", NULL }, { "los", SEC_MODERATOR, false, &HandleDebugLoSCommand, "", NULL }, { "moveflags", SEC_ADMINISTRATOR, false, &HandleDebugMoveflagsCommand, "", NULL }, + { "phase", SEC_MODERATOR, false, &HandleDebugPhaseCommand, "", NULL }, { NULL, SEC_PLAYER, false, NULL, "", NULL } }; static ChatCommand commandTable[] = @@ -948,8 +949,21 @@ public: if (!*args) return false; - uint32 PhaseShift = atoi(args); - handler->GetSession()->SendSetPhaseShift(PhaseShift); + char* t = strtok((char*)args, " "); + char* p = strtok(NULL, " "); + + if (!t) + return false; + + std::set terrainswap; + std::set phaseId; + + terrainswap.insert((uint32)atoi(t)); + + if (p) + phaseId.insert((uint32)atoi(p)); + + handler->GetSession()->SendSetPhaseShift(phaseId, terrainswap); return true; } @@ -1330,6 +1344,17 @@ public: handler->PSendSysMessage("Waypoint SQL written to SQL Developer log"); return true; } + + static bool HandleDebugPhaseCommand(ChatHandler* handler, char const* args) + { + Unit* unit = handler->getSelectedUnit(); + Player* player = handler->GetSession()->GetPlayer(); + if(unit && unit->GetTypeId() == TYPEID_PLAYER) + player = unit->ToPlayer(); + + player->GetPhaseMgr().SendDebugReportToPlayer(handler->GetSession()->GetPlayer()); + return true; + } }; void AddSC_debug_commandscript() diff --git a/src/server/scripts/Commands/cs_gobject.cpp b/src/server/scripts/Commands/cs_gobject.cpp index 6803354d29b..fd24e618ef0 100644 --- a/src/server/scripts/Commands/cs_gobject.cpp +++ b/src/server/scripts/Commands/cs_gobject.cpp @@ -149,7 +149,7 @@ public: GameObject* object = new GameObject; uint32 guidLow = sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT); - if (!object->Create(guidLow, objectInfo->entry, map, player->GetPhaseMaskForSpawn(), x, y, z, o, 0.0f, 0.0f, 0.0f, 0.0f, 0, GO_STATE_READY)) + if (!object->Create(guidLow, objectInfo->entry, map, player->GetPhaseMgr().GetPhaseMaskForSpawn(), x, y, z, o, 0.0f, 0.0f, 0.0f, 0.0f, 0, GO_STATE_READY)) { delete object; return false; @@ -162,7 +162,7 @@ public: } // fill the gameobject data and save to the db - object->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), player->GetPhaseMaskForSpawn()); + object->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), player->GetPhaseMgr().GetPhaseMaskForSpawn()); // this will generate a new guid if the object is in an instance if (!object->LoadGameObjectFromDB(guidLow, map)) diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index c370c70a94a..932a0cbc634 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -1277,14 +1277,15 @@ public: uint32 phasemask = (uint32)atoi((char*)args); Unit* target = handler->getSelectedUnit(); - if (!target) - target = handler->GetSession()->GetPlayer(); - - // check online security - else if (target->GetTypeId() == TYPEID_PLAYER && handler->HasLowerSecurity(target->ToPlayer(), 0)) - return false; - - target->SetPhaseMask(phasemask, true); + if (target) + { + if (target->GetTypeId() == TYPEID_PLAYER) + target->ToPlayer()->GetPhaseMgr().SetCustomPhase(phasemask); + else + target->SetPhaseMask(phasemask, true); + } + else + handler->GetSession()->GetPlayer()->GetPhaseMgr().SetCustomPhase(phasemask); return true; } diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index e43760191df..30713728cf6 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -151,13 +151,13 @@ public: } Creature* creature = new Creature(); - if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0, (uint32)teamval, x, y, z, o)) + if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMgr().GetPhaseMaskForSpawn(), id, 0, (uint32)teamval, x, y, z, o)) { delete creature; return false; } - creature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMaskForSpawn()); + creature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMgr().GetPhaseMaskForSpawn()); uint32 db_guid = creature->GetDBTableGUIDLow(); diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp index ce0141290ff..14481884ec8 100644 --- a/src/server/scripts/Commands/cs_reload.cpp +++ b/src/server/scripts/Commands/cs_reload.cpp @@ -115,6 +115,7 @@ public: { "npc_trainer", SEC_ADMINISTRATOR, true, &HandleReloadNpcTrainerCommand, "", NULL }, { "npc_vendor", SEC_ADMINISTRATOR, true, &HandleReloadNpcVendorCommand, "", NULL }, { "page_text", SEC_ADMINISTRATOR, true, &HandleReloadPageTextsCommand, "", NULL }, + { "phasedefinitions", SEC_ADMINISTRATOR, true, &HandleReloadPhaseDefinitionsCommand, "", NULL }, { "pickpocketing_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesPickpocketingCommand, "", NULL}, { "points_of_interest", SEC_ADMINISTRATOR, true, &HandleReloadPointsOfInterestCommand, "", NULL }, { "prospecting_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesProspectingCommand, "", NULL }, @@ -1250,6 +1251,15 @@ public: handler->SendGlobalGMSysMessage("Vehicle template accessories reloaded."); return true; } + + static bool HandleReloadPhaseDefinitionsCommand(ChatHandler* handler, const char* /*args*/) + { + sLog->outInfo(LOG_FILTER_GENERAL, "Reloading phase_definitions table..."); + sObjectMgr->LoadPhaseDefinitions(); + sWorld->UpdatePhaseDefinitions(); + handler->SendGlobalGMSysMessage("Phase Definitions reloaded."); + return true; + } }; void AddSC_reload_commandscript() diff --git a/src/server/scripts/Commands/cs_wp.cpp b/src/server/scripts/Commands/cs_wp.cpp index e3cd185e4a3..05226fb55aa 100644 --- a/src/server/scripts/Commands/cs_wp.cpp +++ b/src/server/scripts/Commands/cs_wp.cpp @@ -688,7 +688,7 @@ public: } // re-create Creature* wpCreature2 = new Creature; - if (!wpCreature2->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), VISUAL_WAYPOINT, 0, 0, chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ(), chr->GetOrientation())) + if (!wpCreature2->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMgr().GetPhaseMaskForSpawn(), VISUAL_WAYPOINT, 0, 0, chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ(), chr->GetOrientation())) { handler->PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, VISUAL_WAYPOINT); delete wpCreature2; @@ -696,7 +696,7 @@ public: return false; } - wpCreature2->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMaskForSpawn()); + wpCreature2->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMgr().GetPhaseMaskForSpawn()); // To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells(); //TODO: Should we first use "Create" then use "LoadFromDB"? if (!wpCreature2->LoadCreatureFromDB(wpCreature2->GetDBTableGUIDLow(), map)) @@ -912,7 +912,7 @@ public: float o = chr->GetOrientation(); Creature* wpCreature = new Creature; - if (!wpCreature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0, 0, x, y, z, o)) + if (!wpCreature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMgr().GetPhaseMaskForSpawn(), id, 0, 0, x, y, z, o)) { handler->PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, id); delete wpCreature; @@ -928,7 +928,7 @@ public: WorldDatabase.Execute(stmt); - wpCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMaskForSpawn()); + wpCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMgr().GetPhaseMaskForSpawn()); // To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells(); if (!wpCreature->LoadCreatureFromDB(wpCreature->GetDBTableGUIDLow(), map)) { @@ -976,14 +976,14 @@ public: Map* map = chr->GetMap(); Creature* creature = new Creature; - if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0, 0, x, y, z, o)) + if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMgr().GetPhaseMaskForSpawn(), id, 0, 0, x, y, z, o)) { handler->PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, id); delete creature; return false; } - creature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMaskForSpawn()); + creature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMgr().GetPhaseMaskForSpawn()); if (!creature->LoadCreatureFromDB(creature->GetDBTableGUIDLow(), map)) { handler->PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, id); @@ -1025,14 +1025,14 @@ public: Map* map = chr->GetMap(); Creature* creature = new Creature; - if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0, 0, x, y, z, o)) + if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMgr().GetPhaseMaskForSpawn(), id, 0, 0, x, y, z, o)) { handler->PSendSysMessage(LANG_WAYPOINT_NOTCREATED, id); delete creature; return false; } - creature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMaskForSpawn()); + creature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMgr().GetPhaseMaskForSpawn()); if (!creature->LoadCreatureFromDB(creature->GetDBTableGUIDLow(), map)) { handler->PSendSysMessage(LANG_WAYPOINT_NOTCREATED, id); -- cgit v1.2.3 From fe55f735c12ad2a372dac24c636f3362a20d9eff Mon Sep 17 00:00:00 2001 From: Subv Date: Mon, 15 Oct 2012 14:27:56 -0500 Subject: Scripts/Spells: Updated some more spells to 4.3.4 --- .../2012_10_15_01_world_spell_script_names.sql | 2 + src/server/scripts/Commands/cs_modify.cpp | 2 +- src/server/scripts/Spells/spell_shaman.cpp | 43 +++++----------------- src/server/scripts/Spells/spell_warlock.cpp | 1 + 4 files changed, 14 insertions(+), 34 deletions(-) create mode 100644 sql/updates/world/2012_10_15_01_world_spell_script_names.sql (limited to 'src') diff --git a/sql/updates/world/2012_10_15_01_world_spell_script_names.sql b/sql/updates/world/2012_10_15_01_world_spell_script_names.sql new file mode 100644 index 00000000000..c3390573bc2 --- /dev/null +++ b/sql/updates/world/2012_10_15_01_world_spell_script_names.sql @@ -0,0 +1,2 @@ +UPDATE `spell_script_names` SET `spell_id`=755 WHERE `spell_id`=-755; +UPDATE `spell_script_names` SET `spell_id`=1535 WHERE `spell_id`=-1535; diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index 932a0cbc634..9f13dd00fb8 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -1047,7 +1047,7 @@ public: target->ModifyMoney(moneyToAdd); } - sLog->outDebug(LOG_FILTER_GENERAL, handler->GetTrinityString(LANG_NEW_MONEY), uint32(targetMoney), nt32(moneyToAdd), uint32(target->GetMoney())); + sLog->outDebug(LOG_FILTER_GENERAL, handler->GetTrinityString(LANG_NEW_MONEY), uint32(targetMoney), int32(moneyToAdd), uint32(target->GetMoney())); return true; } diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index 23f09a88911..8e8d0a89cde 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -31,7 +31,7 @@ enum ShamanSpells { SHAMAN_SPELL_GLYPH_OF_MANA_TIDE = 55441, SHAMAN_SPELL_MANA_TIDE_TOTEM = 39609, - SHAMAN_SPELL_FIRE_NOVA_R1 = 1535, + SHAMAN_SPELL_FLAME_SHOCK = 8050, SHAMAN_SPELL_FIRE_NOVA_TRIGGERED_R1 = 8349, SHAMAN_SPELL_SATED = 57724, SHAMAN_SPELL_EXHAUSTION = 57723, @@ -53,6 +53,7 @@ enum ShamanSpells }; // 51474 - Astral shift +/// Updated 4.3.4 class spell_sha_astral_shift : public SpellScriptLoader { public: @@ -76,10 +77,10 @@ class spell_sha_astral_shift : public SpellScriptLoader amount = -1; } - void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount) + void Absorb(AuraEffect* /*aurEff*/, DamageInfo& dmgInfo, uint32& absorbAmount) { // reduces all damage taken while stun, fear or silence - if (GetTarget()->GetUInt32Value(UNIT_FIELD_FLAGS) & (UNIT_FLAG_FLEEING | UNIT_FLAG_SILENCED) || (GetTarget()->GetUInt32Value(UNIT_FIELD_FLAGS) & (UNIT_FLAG_STUNNED) && GetTarget()->HasAuraWithMechanic(1<GetUInt32Value(UNIT_FIELD_FLAGS) & (UNIT_FLAG_FLEEING | UNIT_FLAG_SILENCED) || ((GetTarget()->GetUInt32Value(UNIT_FIELD_FLAGS) & UNIT_FLAG_STUNNED) && GetTarget()->HasAuraWithMechanic(1<GetSpellInfo(SHAMAN_SPELL_FIRE_NOVA_R1) || sSpellMgr->GetFirstSpellInChain(SHAMAN_SPELL_FIRE_NOVA_R1) != sSpellMgr->GetFirstSpellInChain(spellEntry->Id)) - return false; - - uint8 rank = sSpellMgr->GetSpellRank(spellEntry->Id); - if (!sSpellMgr->GetSpellWithRank(SHAMAN_SPELL_FIRE_NOVA_TRIGGERED_R1, rank, true)) - return false; - return true; - } - - SpellCastResult CheckFireTotem() - { - // fire totem - if (!GetCaster()->m_SummonSlot[1]) - { - SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_MUST_HAVE_FIRE_TOTEM); - return SPELL_FAILED_CUSTOM_ERROR; - } - - return SPELL_CAST_OK; - } - void HandleDummy(SpellEffIndex /*effIndex*/) { - if (Unit* caster = GetCaster()) + Unit* caster = GetCaster(); + if (Unit* target = GetHitUnit()) { - uint8 rank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id); - if (uint32 spellId = sSpellMgr->GetSpellWithRank(SHAMAN_SPELL_FIRE_NOVA_TRIGGERED_R1, rank)) + if (target->HasAura(SHAMAN_SPELL_FLAME_SHOCK)) { - Creature* totem = caster->GetMap()->GetCreature(caster->m_SummonSlot[1]); - if (totem && totem->isTotem()) - caster->CastSpell(totem, spellId, true); + caster->CastSpell(target, SHAMAN_SPELL_FIRE_NOVA_TRIGGERED_R1, true); + target->RemoveAurasDueToSpell(SHAMAN_SPELL_FLAME_SHOCK); } } } void Register() { - OnCheckCast += SpellCheckCastFn(spell_sha_fire_nova_SpellScript::CheckFireTotem); OnEffectHitTarget += SpellEffectFn(spell_sha_fire_nova_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 6bfa2419fdd..42296154634 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -654,6 +654,7 @@ class spell_warl_bane_of_doom : public SpellScriptLoader }; // 755 Health Funnel +/// Updated 4.3.4 class spell_warl_health_funnel : public SpellScriptLoader { public: -- cgit v1.2.3 From fc796fb879fcf399b7e05636e2876c53b261f8f2 Mon Sep 17 00:00:00 2001 From: Subv Date: Mon, 15 Oct 2012 18:01:16 -0500 Subject: Scripts/Spells: Deleted a deprecated SpellScript (Astral Shift) --- .../2012_10_15_02_world_spell_script_names_434.sql | 1 + src/server/scripts/Spells/spell_shaman.cpp | 46 ---------------------- 2 files changed, 1 insertion(+), 46 deletions(-) create mode 100644 sql/updates/world/2012_10_15_02_world_spell_script_names_434.sql (limited to 'src') diff --git a/sql/updates/world/2012_10_15_02_world_spell_script_names_434.sql b/sql/updates/world/2012_10_15_02_world_spell_script_names_434.sql new file mode 100644 index 00000000000..d0876fa3cc6 --- /dev/null +++ b/sql/updates/world/2012_10_15_02_world_spell_script_names_434.sql @@ -0,0 +1 @@ +DELETE FROM `spell_script_names` WHERE `scriptname`='spell_sha_astral_shift'; diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index 8e8d0a89cde..8b1fe6f38ba 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -52,51 +52,6 @@ enum ShamanSpells SHAMAN_LAVA_FLOWS_TRIGGERED_R1 = 64694, }; -// 51474 - Astral shift -/// Updated 4.3.4 -class spell_sha_astral_shift : public SpellScriptLoader -{ - public: - spell_sha_astral_shift() : SpellScriptLoader("spell_sha_astral_shift") { } - - class spell_sha_astral_shift_AuraScript : public AuraScript - { - PrepareAuraScript(spell_sha_astral_shift_AuraScript); - - uint32 absorbPct; - - bool Load() - { - absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(GetCaster()); - return true; - } - - void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/) - { - // Set absorbtion amount to unlimited - amount = -1; - } - - void Absorb(AuraEffect* /*aurEff*/, DamageInfo& dmgInfo, uint32& absorbAmount) - { - // reduces all damage taken while stun, fear or silence - if (GetTarget()->GetUInt32Value(UNIT_FIELD_FLAGS) & (UNIT_FLAG_FLEEING | UNIT_FLAG_SILENCED) || ((GetTarget()->GetUInt32Value(UNIT_FIELD_FLAGS) & UNIT_FLAG_STUNNED) && GetTarget()->HasAuraWithMechanic(1< Date: Tue, 16 Oct 2012 09:35:15 +0200 Subject: Fix compile without pch --- src/server/game/Achievements/AchievementMgr.cpp | 3 +-- src/server/game/Battlefield/Zones/BattlefieldWG.cpp | 2 +- src/server/game/Chat/ChatLink.cpp | 2 +- src/server/game/Conditions/ConditionMgr.cpp | 4 ++-- src/server/game/Conditions/ConditionMgr.h | 1 - src/server/game/Conditions/DisableMgr.cpp | 2 +- src/server/game/Globals/ObjectMgr.cpp | 6 +++--- src/server/game/Guilds/GuildMgr.cpp | 2 +- src/server/game/Handlers/AuctionHouseHandler.cpp | 10 ++++++++-- src/server/game/Handlers/BattleGroundHandler.cpp | 2 +- src/server/game/Handlers/ItemHandler.cpp | 4 ++-- src/server/game/Loot/LootMgr.h | 1 - src/server/game/Maps/PhaseMgr.cpp | 1 + src/server/game/Maps/PhaseMgr.h | 3 ++- src/server/game/Spells/SpellInfo.cpp | 2 +- src/server/game/Spells/SpellScript.h | 2 +- src/server/game/Tools/CharacterDatabaseCleaner.cpp | 3 ++- src/server/scripts/Commands/cs_achievement.cpp | 2 +- src/server/scripts/Commands/cs_debug.cpp | 2 +- src/server/scripts/Commands/cs_disable.cpp | 2 +- src/server/scripts/Commands/cs_wp.cpp | 2 +- src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp | 2 +- .../Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp | 4 ++-- src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp | 2 +- src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp | 2 +- .../scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp | 2 +- src/server/scripts/World/npcs_special.cpp | 2 +- 27 files changed, 39 insertions(+), 33 deletions(-) (limited to 'src') diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 0fe66c94534..7830ea3f7f8 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -1423,7 +1423,6 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, case ACHIEVEMENT_CRITERIA_TYPE_UNK148: case ACHIEVEMENT_CRITERIA_TYPE_UNK149: case ACHIEVEMENT_CRITERIA_TYPE_UNK150: - case ACHIEVEMENT_CRITERIA_TYPE_TOTAL: break; // Not implemented yet :( } @@ -3356,5 +3355,5 @@ AchievementEntry const* AchievementGlobalMgr::GetAchievement(uint32 achievementI AchievementCriteriaEntry const* AchievementGlobalMgr::GetAchievementCriteria(uint32 criteriaId) const { - return sAchievementCriteriaStore.LookupEntry(criteriaId); + return sAchievementMgr->GetAchievementCriteria(criteriaId); } diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp index 59dc6761583..4468660006e 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp +++ b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp @@ -427,7 +427,7 @@ void BattlefieldWG::OnBattleEnd(bool endByTimer) // ******************************************************* void BattlefieldWG::DoCompleteOrIncrementAchievement(uint32 achievement, Player* player, uint8 /*incrementNumber*/) { - AchievementEntry const* achievementEntry = sAchievementStore.LookupEntry(achievement); + AchievementEntry const* achievementEntry = sAchievementMgr->GetAchievement(achievement); if (!achievementEntry) return; diff --git a/src/server/game/Chat/ChatLink.cpp b/src/server/game/Chat/ChatLink.cpp index 6860426c3eb..7d5078a751e 100644 --- a/src/server/game/Chat/ChatLink.cpp +++ b/src/server/game/Chat/ChatLink.cpp @@ -335,7 +335,7 @@ bool AchievementChatLink::Initialize(std::istringstream& iss) return false; } // Validate achievement - _achievement = sAchievementStore.LookupEntry(achievementId); + _achievement = sAchievementMgr->GetAchievement(achievementId); if (!_achievement) { sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): got invalid achivement id %u in |achievement command", iss.str().c_str(), achievementId); diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 406fb7cb753..b7eea9f0b7e 100755 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -698,7 +698,7 @@ ConditionList ConditionMgr::GetConditionsForPhaseDefinition(uint32 zone, uint32 if (i != (*itr).second.end()) { cond = (*i).second; - sLog->outDebug(LOG_FILTER_CONDITIONSYS, "GetConditionsForPhaseDefinition: found conditions for zone %u entry %u spell %u", zone, entry); + sLog->outDebug(LOG_FILTER_CONDITIONSYS, "GetConditionsForPhaseDefinition: found conditions for zone %u entry %u", zone, entry); } } @@ -1595,7 +1595,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) } case CONDITION_ACHIEVEMENT: { - AchievementEntry const* achievement = sAchievementStore.LookupEntry(cond->ConditionValue1); + AchievementEntry const* achievement = sAchievementMgr->GetAchievement(cond->ConditionValue1); if (!achievement) { sLog->outError(LOG_FILTER_SQL, "Achivement condition has non existing achivement id (%u), skipped", cond->ConditionValue1); diff --git a/src/server/game/Conditions/ConditionMgr.h b/src/server/game/Conditions/ConditionMgr.h index fe7f6a18af8..9d14bde1586 100755 --- a/src/server/game/Conditions/ConditionMgr.h +++ b/src/server/game/Conditions/ConditionMgr.h @@ -19,7 +19,6 @@ #ifndef TRINITY_CONDITIONMGR_H #define TRINITY_CONDITIONMGR_H -#include "LootMgr.h" #include class Player; diff --git a/src/server/game/Conditions/DisableMgr.cpp b/src/server/game/Conditions/DisableMgr.cpp index 9b065729b88..cf5b7bd53a2 100755 --- a/src/server/game/Conditions/DisableMgr.cpp +++ b/src/server/game/Conditions/DisableMgr.cpp @@ -171,7 +171,7 @@ void LoadDisables() sLog->outError(LOG_FILTER_SQL, "Disable flags specified for outdoor PvP %u, useless data.", entry); break; case DISABLE_TYPE_ACHIEVEMENT_CRITERIA: - if (!sAchievementCriteriaStore.LookupEntry(entry)) + if (!sAchievementMgr->GetAchievementCriteria(entry)) { sLog->outError(LOG_FILTER_SQL, "Achievement Criteria entry %u from `disables` doesn't exist in dbc, skipped.", entry); continue; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index dd2afa44a07..d62a4c9b9fb 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -5920,7 +5920,7 @@ void ObjectMgr::LoadAccessRequirements() if (ar.achievement) { - if (!sAchievementStore.LookupEntry(ar.achievement)) + if (!sAchievementMgr->GetAchievement(ar.achievement)) { sLog->outError(LOG_FILTER_SQL, "Required Achievement %u not exist for map %u difficulty %u, remove quest done requirement.", ar.achievement, mapid, difficulty); ar.achievement = 0; @@ -8487,9 +8487,9 @@ void ObjectMgr::LoadFactionChangeAchievements() uint32 alliance = fields[0].GetUInt32(); uint32 horde = fields[1].GetUInt32(); - if (!sAchievementStore.LookupEntry(alliance)) + if (!sAchievementMgr->GetAchievement(alliance)) sLog->outError(LOG_FILTER_SQL, "Achievement %u referenced in `player_factionchange_achievement` does not exist, pair skipped!", alliance); - else if (!sAchievementStore.LookupEntry(horde)) + else if (!sAchievementMgr->GetAchievement(horde)) sLog->outError(LOG_FILTER_SQL, "Achievement %u referenced in `player_factionchange_achievement` does not exist, pair skipped!", horde); else FactionChange_Achievements[alliance] = horde; diff --git a/src/server/game/Guilds/GuildMgr.cpp b/src/server/game/Guilds/GuildMgr.cpp index 8eef6b2ade3..0f421c7c432 100644 --- a/src/server/game/Guilds/GuildMgr.cpp +++ b/src/server/game/Guilds/GuildMgr.cpp @@ -547,7 +547,7 @@ void GuildMgr::LoadGuildRewards() continue; } - if (reward.AchievementId != 0 && (!sAchievementStore.LookupEntry(reward.AchievementId))) + if (reward.AchievementId != 0 && (!sAchievementMgr->GetAchievement(reward.AchievementId))) { sLog->outError(LOG_FILTER_SERVER_LOADING, "Guild rewards constains not existing achievement entry %u", reward.AchievementId); continue; diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp index 3e2d0e1310a..53cf3fe7caf 100644 --- a/src/server/game/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Handlers/AuctionHouseHandler.cpp @@ -286,7 +286,10 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recvData) AH->deposit = deposit; AH->auctionHouseEntry = auctionHouseEntry; - sLog->outInfo(LOG_FILTER_NETWORKIO, "CMSG_AUCTION_SELL_ITEM: Player %s (guid %d) is selling item %s entry %u (guid %d) to auctioneer %u with count %u with initial bid %u with buyout %u and with time %u (in sec) in auctionhouse %u", _player->GetName(), _player->GetGUIDLow(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetGUIDLow(), AH->auctioneer, item->GetCount(), bid, buyout, auctionTime, AH->GetHouseId()); + sLog->outInfo(LOG_FILTER_NETWORKIO, "CMSG_AUCTION_SELL_ITEM: Player %s (guid %d) is selling item %s entry %u (guid %d) " + "to auctioneer %u with count %u with initial bid " UI64FMTD " with buyout " UI64FMTD " and with time %u (in sec) in auctionhouse %u", + _player->GetName(), _player->GetGUIDLow(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetGUIDLow(), + AH->auctioneer, item->GetCount(), bid, buyout, auctionTime, AH->GetHouseId()); sAuctionMgr->AddAItem(item); auctionHouse->AddAuction(AH); @@ -332,7 +335,10 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recvData) AH->deposit = deposit; AH->auctionHouseEntry = auctionHouseEntry; - sLog->outInfo(LOG_FILTER_NETWORKIO, "CMSG_AUCTION_SELL_ITEM: Player %s (guid %d) is selling item %s entry %u (guid %d) to auctioneer %u with count %u with initial bid %u with buyout %u and with time %u (in sec) in auctionhouse %u", _player->GetName(), _player->GetGUIDLow(), newItem->GetTemplate()->Name1.c_str(), newItem->GetEntry(), newItem->GetGUIDLow(), AH->auctioneer, newItem->GetCount(), bid, buyout, auctionTime, AH->GetHouseId()); + sLog->outInfo(LOG_FILTER_NETWORKIO, "CMSG_AUCTION_SELL_ITEM: Player %s (guid %d) is selling item %s entry %u (guid %d) to " + "auctioneer %u with count %u with initial bid " UI64FMTD " with buyout " UI64FMTD " and with time %u (in sec) in auctionhouse %u", + _player->GetName(), _player->GetGUIDLow(), newItem->GetTemplate()->Name1.c_str(), newItem->GetEntry(), + newItem->GetGUIDLow(), AH->auctioneer, newItem->GetCount(), bid, buyout, auctionTime, AH->GetHouseId()); sAuctionMgr->AddAItem(newItem); auctionHouse->AddAuction(AH); diff --git a/src/server/game/Handlers/BattleGroundHandler.cpp b/src/server/game/Handlers/BattleGroundHandler.cpp index 17d65264e9e..62ab55f70f8 100755 --- a/src/server/game/Handlers/BattleGroundHandler.cpp +++ b/src/server/game/Handlers/BattleGroundHandler.cpp @@ -571,7 +571,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData) } } -void WorldSession::HandleBattlefieldLeaveOpcode(WorldPacket& recvData) +void WorldSession::HandleBattlefieldLeaveOpcode(WorldPacket& /*recvData*/) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_BATTLEFIELD_LEAVE Message"); diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 69d9d24db8c..3d7de576c6c 100644 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -1476,7 +1476,7 @@ void WorldSession::HandleTransmogrifyItems(WorldPacket& recvData) // Read data uint32 count = recvData.ReadBits(22); - if (count < EQUIPMENT_SLOT_START || count >= EQUIPMENT_SLOT_END) + if (count >= EQUIPMENT_SLOT_END) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleTransmogrifyItems - Player (GUID: %u, name: %s) sent a wrong count (%u) when transmogrifying items.", player->GetGUIDLow(), player->GetName(), count); recvData.rfinish(); @@ -1548,7 +1548,7 @@ void WorldSession::HandleTransmogrifyItems(WorldPacket& recvData) for (uint8 i = 0; i < count; ++i) { // slot of the transmogrified item - if (slots[i] < EQUIPMENT_SLOT_START || slots[i] >= EQUIPMENT_SLOT_END) + if (slots[i] >= EQUIPMENT_SLOT_END) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleTransmogrifyItems - Player (GUID: %u, name: %s) tried to transmogrify an item (lowguid: %u) with a wrong slot (%u) when transmogrifying items.", player->GetGUIDLow(), player->GetName(), GUID_LOPART(itemGuids[i]), slots[i]); return; diff --git a/src/server/game/Loot/LootMgr.h b/src/server/game/Loot/LootMgr.h index 45fc5c7983c..72243cd98f6 100755 --- a/src/server/game/Loot/LootMgr.h +++ b/src/server/game/Loot/LootMgr.h @@ -99,7 +99,6 @@ enum LootSlotType class Player; class LootStore; -class ConditionMgr; struct LootStoreItem { diff --git a/src/server/game/Maps/PhaseMgr.cpp b/src/server/game/Maps/PhaseMgr.cpp index 63bdff2d094..5e0989c1cad 100644 --- a/src/server/game/Maps/PhaseMgr.cpp +++ b/src/server/game/Maps/PhaseMgr.cpp @@ -17,6 +17,7 @@ #include "PhaseMgr.h" #include "Chat.h" +#include "ObjectMgr.h" ////////////////////////////////////////////////////////////////// // Updating diff --git a/src/server/game/Maps/PhaseMgr.h b/src/server/game/Maps/PhaseMgr.h index accb0cd3ea8..2fdf8eb5e7f 100644 --- a/src/server/game/Maps/PhaseMgr.h +++ b/src/server/game/Maps/PhaseMgr.h @@ -21,6 +21,7 @@ #include "SharedDefines.h" #include "SpellAuras.h" #include "SpellAuraEffects.h" +#include "ConditionMgr.h" class ObjectMgr; class Player; @@ -85,7 +86,7 @@ typedef UNORDERED_MAP PhaseInfoContainer; struct PhaseData { - PhaseData(Player* _player) : player(_player), _PhasemaskThroughDefinitions(0), _PhasemaskThroughAuras(0), _CustomPhasemask(0) {} + PhaseData(Player* _player) : _PhasemaskThroughDefinitions(0), _PhasemaskThroughAuras(0), _CustomPhasemask(0), player(_player) {} uint32 _PhasemaskThroughDefinitions; uint32 _PhasemaskThroughAuras; diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 3dc095a8611..f99321a0396 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -317,7 +317,7 @@ SpellImplicitTargetInfo::StaticData SpellImplicitTargetInfo::_data[TOTAL_SPELL_ {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 110 TARGET_DEST_UNK_110 }; -SpellEffectInfo::SpellEffectInfo(SpellEntry const* spellEntry, SpellInfo const* spellInfo, uint8 effIndex, SpellEffectEntry const* _effect) +SpellEffectInfo::SpellEffectInfo(SpellEntry const* /*spellEntry*/, SpellInfo const* spellInfo, uint8 effIndex, SpellEffectEntry const* _effect) { SpellScalingEntry const* scaling = spellInfo->GetSpellScaling(); diff --git a/src/server/game/Spells/SpellScript.h b/src/server/game/Spells/SpellScript.h index c8126f8aaf3..b1a2097a8f9 100755 --- a/src/server/game/Spells/SpellScript.h +++ b/src/server/game/Spells/SpellScript.h @@ -586,7 +586,7 @@ class AuraScript : public _SpellScript uint8 _currentScriptState; bool _defaultActionPrevented; ScriptStateStore(uint8 currentScriptState, AuraApplication const* auraApplication, bool defaultActionPrevented) - : _currentScriptState(currentScriptState), _auraApplication(auraApplication), _defaultActionPrevented(defaultActionPrevented) + : _auraApplication(auraApplication), _currentScriptState(currentScriptState), _defaultActionPrevented(defaultActionPrevented) {} }; typedef std::stack ScriptStateStack; diff --git a/src/server/game/Tools/CharacterDatabaseCleaner.cpp b/src/server/game/Tools/CharacterDatabaseCleaner.cpp index f87b81c8be8..8c86b80e827 100644 --- a/src/server/game/Tools/CharacterDatabaseCleaner.cpp +++ b/src/server/game/Tools/CharacterDatabaseCleaner.cpp @@ -22,6 +22,7 @@ #include "Database/DatabaseEnv.h" #include "SpellMgr.h" #include "DBCStores.h" +#include "AchievementMgr.h" void CharacterDatabaseCleaner::CleanDatabase() { @@ -108,7 +109,7 @@ void CharacterDatabaseCleaner::CheckUnique(const char* column, const char* table bool CharacterDatabaseCleaner::AchievementProgressCheck(uint32 criteria) { - return sAchievementCriteriaStore.LookupEntry(criteria); + return sAchievementMgr->GetAchievementCriteria(criteria); } void CharacterDatabaseCleaner::CleanCharacterAchievementProgress() diff --git a/src/server/scripts/Commands/cs_achievement.cpp b/src/server/scripts/Commands/cs_achievement.cpp index 7667e79ece7..a5dacc7bb00 100644 --- a/src/server/scripts/Commands/cs_achievement.cpp +++ b/src/server/scripts/Commands/cs_achievement.cpp @@ -67,7 +67,7 @@ public: return false; } - if (AchievementEntry const* achievementEntry = sAchievementStore.LookupEntry(achievementId)) + if (AchievementEntry const* achievementEntry = sAchievementMgr->GetAchievement(achievementId)) target->CompletedAchievement(achievementEntry); return true; diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index 363258648f6..6c5abfe60e6 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -1345,7 +1345,7 @@ public: return true; } - static bool HandleDebugPhaseCommand(ChatHandler* handler, char const* args) + static bool HandleDebugPhaseCommand(ChatHandler* handler, char const* /*args*/) { Unit* unit = handler->getSelectedUnit(); Player* player = handler->GetSession()->GetPlayer(); diff --git a/src/server/scripts/Commands/cs_disable.cpp b/src/server/scripts/Commands/cs_disable.cpp index 0bb376b08dd..00214ed4b0f 100644 --- a/src/server/scripts/Commands/cs_disable.cpp +++ b/src/server/scripts/Commands/cs_disable.cpp @@ -137,7 +137,7 @@ public: } case DISABLE_TYPE_ACHIEVEMENT_CRITERIA: { - if (!sAchievementCriteriaStore.LookupEntry(entry)) + if (!sAchievementMgr->GetAchievementCriteria(entry)) { handler->PSendSysMessage(LANG_COMMAND_NO_ACHIEVEMENT_CRITERIA_FOUND); handler->SetSentErrorMessage(true); diff --git a/src/server/scripts/Commands/cs_wp.cpp b/src/server/scripts/Commands/cs_wp.cpp index 05226fb55aa..5bc84bed28a 100644 --- a/src/server/scripts/Commands/cs_wp.cpp +++ b/src/server/scripts/Commands/cs_wp.cpp @@ -941,7 +941,7 @@ public: { wpCreature->SetDisplayId(target->GetDisplayId()); wpCreature->SetObjectScale(0.5f); - wpCreature->SetLevel(point > STRONG_MAX_LEVEL ? STRONG_MAX_LEVEL : point); + wpCreature->SetLevel(std::min(point, STRONG_MAX_LEVEL)); } } while (result->NextRow()); diff --git a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp index 0d4efac4321..aa7dfb4a864 100644 --- a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp +++ b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp @@ -317,7 +317,7 @@ public: eventTimer = 3000; if (Creature* naralex = instance->instance->GetCreature(instance->GetData64(DATA_NARALEX))) { - AchievementEntry const* AchievWC = sAchievementStore.LookupEntry(ACHIEVEMENT_WAILING_CAVERNS); + AchievementEntry const* AchievWC = sAchievementMgr->GetAchievement(ACHIEVEMENT_WAILING_CAVERNS); if (AchievWC) { Map* map = me->GetMap(); diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp index 497ce889c62..ddecc62ab08 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp @@ -695,7 +695,7 @@ class npc_halion_controller : public CreatureScript halion->AI()->Talk(SAY_INTRO); break; case EVENT_TWILIGHT_MENDING: - if (Creature* halion = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_HALION))) + if (ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_HALION))) if (Creature* twilightHalion = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_TWILIGHT_HALION))) twilightHalion->CastSpell((Unit*)NULL, SPELL_TWILIGHT_MENDING, true); break; @@ -1114,7 +1114,7 @@ class npc_combustion_consumption : public CreatureScript struct npc_combustion_consumptionAI : public Scripted_NoMovementAI { npc_combustion_consumptionAI(Creature* creature) : Scripted_NoMovementAI(creature), - _summonerGuid(0), _instance(creature->GetInstanceScript()) + _instance(creature->GetInstanceScript()), _summonerGuid(0) { switch (me->GetEntry()) { diff --git a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp index a2acf8a64da..9822146984f 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp @@ -154,7 +154,7 @@ public: CheckPlayersFrostResist(); if (CanTheHundredClub) { - AchievementEntry const* AchievTheHundredClub = sAchievementStore.LookupEntry(ACHIEVEMENT_THE_HUNDRED_CLUB); + AchievementEntry const* AchievTheHundredClub = sAchievementMgr->GetAchievement(ACHIEVEMENT_THE_HUNDRED_CLUB); if (AchievTheHundredClub) { if (map && map->IsDungeon()) diff --git a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp index 39fff139b52..28595571a2f 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp @@ -232,7 +232,7 @@ public: { npc_verdisa_beglaristrasz_eternosAI(Creature* creature) : ScriptedAI(creature) { } - void MovementInform(uint32 type, uint32 id) + void MovementInform(uint32 /*type*/, uint32 id) { // When Belgaristraz finish his moving say grateful text if (me->GetEntry() == NPC_BELGARISTRASZ) diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp index fe41e7a12dc..707ea7f138d 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp @@ -153,7 +153,7 @@ public: if (IsHeroic() && GolemsShattered < 5) { - AchievementEntry const* AchievShatterResistant = sAchievementStore.LookupEntry(ACHIEVEMENT_SHATTER_RESISTANT); + AchievementEntry const* AchievShatterResistant = sAchievementMgr->GetAchievement(ACHIEVEMENT_SHATTER_RESISTANT); if (AchievShatterResistant) { Map* map = me->GetMap(); diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index f689d2f29ac..f7363f2fb0a 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -2115,7 +2115,7 @@ class npc_shadowfiend : public CreatureScript { npc_shadowfiendAI(Creature* creature) : PetAI(creature) {} - void JustDied(Unit* killer) + void JustDied(Unit* /*killer*/) { if (me->isSummon()) if (Unit* owner = me->ToTempSummon()->GetSummoner()) -- cgit v1.2.3 From bc792e7c66315c034c2f06fa00e1c0dddba225b9 Mon Sep 17 00:00:00 2001 From: Subv Date: Tue, 16 Oct 2012 11:27:36 -0500 Subject: Core/Achievements: Fixed a recursive call in AchievementGlobalMgr::GetAchievementCriteria --- src/server/game/Achievements/AchievementMgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 7830ea3f7f8..b2c110b790f 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -3355,5 +3355,5 @@ AchievementEntry const* AchievementGlobalMgr::GetAchievement(uint32 achievementI AchievementCriteriaEntry const* AchievementGlobalMgr::GetAchievementCriteria(uint32 criteriaId) const { - return sAchievementMgr->GetAchievementCriteria(criteriaId); + return sAchievementCriteriaStore.LookupEntry(criteriaId); } -- cgit v1.2.3 From 67118c6999cc7241520274d1b852386f1490f05e Mon Sep 17 00:00:00 2001 From: Spp Date: Tue, 16 Oct 2012 18:43:21 +0200 Subject: Fix compile under windows --- src/server/scripts/Commands/cs_modify.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index 9f13dd00fb8..5c9280e5956 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -1026,12 +1026,13 @@ public: } else { + uint32 moneyToAddMsg = moneyToAdd * -1; if (newmoney > MAX_MONEY_AMOUNT) newmoney = MAX_MONEY_AMOUNT; - handler->PSendSysMessage(LANG_YOU_TAKE_MONEY, uint32(abs(moneyToAdd)), handler->GetNameLink(target).c_str()); + handler->PSendSysMessage(LANG_YOU_TAKE_MONEY, moneyToAddMsg, handler->GetNameLink(target).c_str()); if (handler->needReportToTarget(target)) - (ChatHandler(target)).PSendSysMessage(LANG_YOURS_MONEY_TAKEN, handler->GetNameLink().c_str(), uint32(abs(moneyToAdd))); + (ChatHandler(target)).PSendSysMessage(LANG_YOURS_MONEY_TAKEN, handler->GetNameLink().c_str(), moneyToAddMsg); target->SetMoney(newmoney); } } -- cgit v1.2.3 From bbb5712e97fc3519506588aab96d99e1f544de84 Mon Sep 17 00:00:00 2001 From: Subv Date: Tue, 16 Oct 2012 13:18:32 -0500 Subject: Core/Vendors: Fixed the "Item does not go into that slot" problem. The client sends the player guid when trying to store the item in the default backpack (255) --- src/server/game/Handlers/ItemHandler.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 3d7de576c6c..eca195e7586 100644 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -691,6 +691,8 @@ void WorldSession::HandleBuyItemOpcode(WorldPacket& recvData) uint8 bag = NULL_BAG; if (bagItem && bagItem->IsBag()) bag = bagItem->GetSlot(); + else if (bagGuid == GetPlayer()->GetGUID()) // The client sends the player guid when trying to store an item in the default backpack + bag = INVENTORY_SLOT_BAG_0; GetPlayer()->BuyItemFromVendorSlot(vendorguid, slot, item, count, bag, bagSlot); } -- cgit v1.2.3 From 4d526fd73dfd9cc850bf748dfb524aad9553967d Mon Sep 17 00:00:00 2001 From: Subv Date: Tue, 16 Oct 2012 14:28:41 -0500 Subject: Core/Vendors: Fixed the "Item not found" error message when trying to buy an item from a vendor. --- src/server/game/Handlers/ItemHandler.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index eca195e7586..fe0e5098180 100644 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -781,7 +781,8 @@ void WorldSession::SendListInventory(uint64 vendorGuid) if (int32 priceMod = _player->GetTotalAuraModifier(SPELL_AURA_MOD_VENDOR_ITEMS_PRICES)) price -= CalculatePct(price, priceMod); - itemsData << uint32(count++ + 1); // client expects counting to start at 1 + ++count; + itemsData << uint32(slot + 1); // client expects counting to start at 1 itemsData << uint32(itemTemplate->MaxDurability); if (vendorItem->ExtendedCost != 0) @@ -812,7 +813,8 @@ void WorldSession::SendListInventory(uint64 vendorGuid) uint32 precision = (currencyTemplate->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? 100 : 1; - itemsData << uint32(count++ + 1); // client expects counting to start at 1 + ++count; + itemsData << uint32(slot + 1); // client expects counting to start at 1 itemsData << uint32(0); // max durability if (vendorItem->ExtendedCost != 0) -- cgit v1.2.3 From 644d3c09874845ddf58fb8d3d9b3d45c8fc95e26 Mon Sep 17 00:00:00 2001 From: Subv Date: Tue, 16 Oct 2012 14:41:13 -0500 Subject: Codestyle: Fixed codestyle from previous commits. --- src/server/game/Handlers/ItemHandler.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index fe0e5098180..5180e543bec 100644 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -691,8 +691,8 @@ void WorldSession::HandleBuyItemOpcode(WorldPacket& recvData) uint8 bag = NULL_BAG; if (bagItem && bagItem->IsBag()) bag = bagItem->GetSlot(); - else if (bagGuid == GetPlayer()->GetGUID()) // The client sends the player guid when trying to store an item in the default backpack - bag = INVENTORY_SLOT_BAG_0; + else if (bagGuid == GetPlayer()->GetGUID()) // The client sends the player guid when trying to store an item in the default backpack + bag = INVENTORY_SLOT_BAG_0; GetPlayer()->BuyItemFromVendorSlot(vendorguid, slot, item, count, bag, bagSlot); } @@ -781,7 +781,7 @@ void WorldSession::SendListInventory(uint64 vendorGuid) if (int32 priceMod = _player->GetTotalAuraModifier(SPELL_AURA_MOD_VENDOR_ITEMS_PRICES)) price -= CalculatePct(price, priceMod); - ++count; + ++count; itemsData << uint32(slot + 1); // client expects counting to start at 1 itemsData << uint32(itemTemplate->MaxDurability); @@ -813,7 +813,7 @@ void WorldSession::SendListInventory(uint64 vendorGuid) uint32 precision = (currencyTemplate->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? 100 : 1; - ++count; + ++count; itemsData << uint32(slot + 1); // client expects counting to start at 1 itemsData << uint32(0); // max durability -- cgit v1.2.3 From b49891e348c01ae7f240ef07c05e09bc361f4c58 Mon Sep 17 00:00:00 2001 From: Subv Date: Tue, 16 Oct 2012 20:17:45 -0500 Subject: Core/Entities: Fixed the WorldObject::BuildMonsterChat method. closes #7556 --- src/server/game/Entities/Object/Object.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 2cdfcdc18f9..ac1679c241f 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -2293,8 +2293,6 @@ void WorldObject::BuildMonsterChat(WorldPacket* data, uint8 msgtype, char const* *data << (uint32)(strlen(text)+1); *data << text; *data << (uint8)0; // ChatTag - *data << (float)0.0f; // added in 4.2.0, unk - *data << (uint8)0; // added in 4.2.0, unk } void Unit::BuildHeartBeatMsg(WorldPacket* data) const -- cgit v1.2.3 From 2356e936a4730dddc32c3893722cdf0c0aa2138a Mon Sep 17 00:00:00 2001 From: Subv Date: Wed, 17 Oct 2012 15:04:51 -0500 Subject: Scripts/Spells: Updated some Shaman SpellScripts to 4.3.4 --- src/server/scripts/Spells/spell_shaman.cpp | 240 ++++++----------------------- 1 file changed, 46 insertions(+), 194 deletions(-) (limited to 'src') diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index 8b1fe6f38ba..d09289d59ab 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -29,8 +29,6 @@ enum ShamanSpells { - SHAMAN_SPELL_GLYPH_OF_MANA_TIDE = 55441, - SHAMAN_SPELL_MANA_TIDE_TOTEM = 39609, SHAMAN_SPELL_FLAME_SHOCK = 8050, SHAMAN_SPELL_FIRE_NOVA_TRIGGERED_R1 = 8349, SHAMAN_SPELL_SATED = 57724, @@ -38,7 +36,7 @@ enum ShamanSpells HUNTER_SPELL_INSANITY = 95809, MAGE_SPELL_TEMPORAL_DISPLACEMENT = 80354, - SHAMAN_SPELL_STORM_EARTH_AND_FIRE = 51483, + SHAMAN_SPELL_EARTH_GRASP = 51483, EARTHBIND_TOTEM_SPELL_EARTHGRAB = 64695, // For Earthen Power @@ -49,7 +47,11 @@ enum ShamanSpells ICON_ID_SHAMAN_LAVA_FLOW = 3087, SHAMAN_LAVA_FLOWS_R1 = 51480, - SHAMAN_LAVA_FLOWS_TRIGGERED_R1 = 64694, + SHAMAN_LAVA_FLOWS_TRIGGERED_R1 = 65264, + SHAMAN_SPELL_ANCESTRAL_AWAKENING_PROC = 52752, + + ICON_ID_SOOTHING_RAIN = 2011, + SPELL_HEALING_STREAM_TOTEM_HEAL = 52042, }; // 1535 Fire Nova @@ -88,55 +90,38 @@ class spell_sha_fire_nova : public SpellScriptLoader } }; -// 39610 Mana Tide Totem -class spell_sha_mana_tide_totem : public SpellScriptLoader +// 16191 Mana Tide +/// Updated 4.3.4 +class spell_sha_mana_tide : public SpellScriptLoader { public: - spell_sha_mana_tide_totem() : SpellScriptLoader("spell_sha_mana_tide_totem") { } + spell_sha_mana_tide() : SpellScriptLoader("spell_sha_mana_tide") { } - class spell_sha_mana_tide_totem_SpellScript : public SpellScript + class spell_sha_mana_tide_AuraScript : public AuraScript { - PrepareSpellScript(spell_sha_mana_tide_totem_SpellScript); - - bool Validate(SpellInfo const* /*spellEntry*/) - { - if (!sSpellMgr->GetSpellInfo(SHAMAN_SPELL_GLYPH_OF_MANA_TIDE) || !sSpellMgr->GetSpellInfo(SHAMAN_SPELL_MANA_TIDE_TOTEM)) - return false; - return true; - } + PrepareAuraScript(spell_sha_mana_tide_AuraScript); - void HandleDummy(SpellEffIndex /*effIndex*/) + void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) { if (Unit* caster = GetCaster()) - if (Unit* unitTarget = GetHitUnit()) - { - if (unitTarget->getPowerType() == POWER_MANA) - { - int32 effValue = GetEffectValue(); - // Glyph of Mana Tide - if (Unit* owner = caster->GetOwner()) - if (AuraEffect* dummy = owner->GetAuraEffect(SHAMAN_SPELL_GLYPH_OF_MANA_TIDE, 0)) - effValue += dummy->GetAmount(); - // Regenerate 6% of Total Mana Every 3 secs - int32 effBasePoints0 = int32(CalculatePct(unitTarget->GetMaxPower(POWER_MANA), effValue)); - caster->CastCustomSpell(unitTarget, SHAMAN_SPELL_MANA_TIDE_TOTEM, &effBasePoints0, NULL, NULL, true, NULL, NULL, GetOriginalCaster()->GetGUID()); - } - } + if (Unit* owner = caster->GetOwner()) + amount = CalculatePct(owner->GetCreateStat(STAT_SPIRIT), aurEff->GetAmount()); } void Register() { - OnEffectHitTarget += SpellEffectFn(spell_sha_mana_tide_totem_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_sha_mana_tide_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_MOD_STAT); } }; - SpellScript* GetSpellScript() const + AuraScript* GetAuraScript() const { - return new spell_sha_mana_tide_totem_SpellScript(); + return new spell_sha_mana_tide_AuraScript(); } }; -// 6474 - Earthbind Totem - Fix Talent:Earthen Power +// 6474 - Earthbind Totem - Fix Talent:Earthen Power, Earth's Grasp +/// Updated 4.3.4 class spell_sha_earthbind_totem : public SpellScriptLoader { public: @@ -170,8 +155,8 @@ class spell_sha_earthbind_totem : public SpellScriptLoader Player* owner = GetCaster()->GetCharmerOrOwnerPlayerOrPlayerItself(); if (!owner) return; - // Storm, Earth and Fire - if (AuraEffect* aurEff = owner->GetAuraEffectOfRankedSpell(SHAMAN_SPELL_STORM_EARTH_AND_FIRE, EFFECT_1)) + // Earth's Grasp + if (AuraEffect* aurEff = owner->GetAuraEffectOfRankedSpell(SHAMAN_SPELL_EARTH_GRASP, EFFECT_0)) { if (roll_chance_i(aurEff->GetAmount())) GetCaster()->CastSpell(GetCaster(), EARTHBIND_TOTEM_SPELL_EARTHGRAB, false); @@ -234,6 +219,7 @@ class spell_sha_earthen_power : public SpellScriptLoader } }; +/// Updated 4.3.4 class spell_sha_bloodlust : public SpellScriptLoader { public: @@ -278,6 +264,7 @@ class spell_sha_bloodlust : public SpellScriptLoader } }; +/// Updated 4.3.4 class spell_sha_heroism : public SpellScriptLoader { public: @@ -322,11 +309,7 @@ class spell_sha_heroism : public SpellScriptLoader } }; -enum AncestralAwakeningProc -{ - SPELL_ANCESTRAL_AWAKENING_PROC = 52752, -}; - +/// Updated 4.3.4 class spell_sha_ancestral_awakening_proc : public SpellScriptLoader { public: @@ -338,7 +321,7 @@ class spell_sha_ancestral_awakening_proc : public SpellScriptLoader bool Validate(SpellInfo const* /*SpellEntry*/) { - if (!sSpellMgr->GetSpellInfo(SPELL_ANCESTRAL_AWAKENING_PROC)) + if (!sSpellMgr->GetSpellInfo(SHAMAN_SPELL_ANCESTRAL_AWAKENING_PROC)) return false; return true; } @@ -347,7 +330,7 @@ class spell_sha_ancestral_awakening_proc : public SpellScriptLoader { int32 damage = GetEffectValue(); if (GetCaster() && GetHitUnit()) - GetCaster()->CastCustomSpell(GetHitUnit(), SPELL_ANCESTRAL_AWAKENING_PROC, &damage, NULL, NULL, true); + GetCaster()->CastCustomSpell(GetHitUnit(), SHAMAN_SPELL_ANCESTRAL_AWAKENING_PROC, &damage, NULL, NULL, true); } void Register() @@ -362,53 +345,7 @@ class spell_sha_ancestral_awakening_proc : public SpellScriptLoader } }; -enum CleansingTotemPulse -{ - SPELL_CLEANSING_TOTEM_EFFECT = 52025, -}; - -class spell_sha_cleansing_totem_pulse : public SpellScriptLoader -{ - public: - spell_sha_cleansing_totem_pulse() : SpellScriptLoader("spell_sha_cleansing_totem_pulse") { } - - class spell_sha_cleansing_totem_pulse_SpellScript : public SpellScript - { - PrepareSpellScript(spell_sha_cleansing_totem_pulse_SpellScript); - - bool Validate(SpellInfo const* /*SpellEntry*/) - { - if (!sSpellMgr->GetSpellInfo(SPELL_CLEANSING_TOTEM_EFFECT)) - return false; - return true; - } - - void HandleDummy(SpellEffIndex /* effIndex */) - { - int32 bp = 1; - if (GetCaster() && GetHitUnit() && GetOriginalCaster()) - GetCaster()->CastCustomSpell(GetHitUnit(), SPELL_CLEANSING_TOTEM_EFFECT, NULL, &bp, NULL, true, NULL, NULL, GetOriginalCaster()->GetGUID()); - } - - void Register() - { - OnEffectHitTarget += SpellEffectFn(spell_sha_cleansing_totem_pulse_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; - - SpellScript* GetSpellScript() const - { - return new spell_sha_cleansing_totem_pulse_SpellScript(); - } -}; - -enum HealingStreamTotem -{ - SPELL_GLYPH_OF_HEALING_STREAM_TOTEM = 55456, - ICON_ID_RESTORATIVE_TOTEMS = 338, - SPELL_HEALING_STREAM_TOTEM_HEAL = 52042, -}; - +/// Updated 4.3.4 class spell_sha_healing_stream_totem : public SpellScriptLoader { public: @@ -420,9 +357,7 @@ class spell_sha_healing_stream_totem : public SpellScriptLoader bool Validate(SpellInfo const* /*SpellEntry*/) { - if (!sSpellMgr->GetSpellInfo(SPELL_GLYPH_OF_HEALING_STREAM_TOTEM) || !sSpellMgr->GetSpellInfo(SPELL_HEALING_STREAM_TOTEM_HEAL)) - return false; - return true; + return sSpellMgr->GetSpellInfo(SPELL_HEALING_STREAM_TOTEM_HEAL); } void HandleDummy(SpellEffIndex /* effIndex */) @@ -437,14 +372,10 @@ class spell_sha_healing_stream_totem : public SpellScriptLoader if (triggeringSpell) damage = int32(owner->SpellHealingBonusDone(target, triggeringSpell, damage, HEAL)); - // Restorative Totems - if (AuraEffect* dummy = owner->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, ICON_ID_RESTORATIVE_TOTEMS, 1)) + // Soothing Rains + if (AuraEffect* dummy = owner->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, ICON_ID_SOOTHING_RAIN, EFFECT_0)) AddPct(damage, dummy->GetAmount()); - // Glyph of Healing Stream Totem - if (AuraEffect const* aurEff = owner->GetAuraEffect(SPELL_GLYPH_OF_HEALING_STREAM_TOTEM, EFFECT_0)) - AddPct(damage, aurEff->GetAmount()); - damage = int32(target->SpellHealingBonusTaken(owner, triggeringSpell, damage, HEAL)); } caster->CastCustomSpell(target, SPELL_HEALING_STREAM_TOTEM_HEAL, &damage, 0, 0, true, 0, 0, GetOriginalCaster()->GetGUID()); @@ -463,49 +394,7 @@ class spell_sha_healing_stream_totem : public SpellScriptLoader } }; -enum ManaSpringTotem -{ - SPELL_MANA_SPRING_TOTEM_ENERGIZE = 52032, -}; - -class spell_sha_mana_spring_totem : public SpellScriptLoader -{ - public: - spell_sha_mana_spring_totem() : SpellScriptLoader("spell_sha_mana_spring_totem") { } - - class spell_sha_mana_spring_totem_SpellScript : public SpellScript - { - PrepareSpellScript(spell_sha_mana_spring_totem_SpellScript); - - bool Validate(SpellInfo const* /*SpellEntry*/) - { - if (!sSpellMgr->GetSpellInfo(SPELL_MANA_SPRING_TOTEM_ENERGIZE)) - return false; - return true; - } - - void HandleDummy(SpellEffIndex /* effIndex */) - { - int32 damage = GetEffectValue(); - if (Unit* target = GetHitUnit()) - if (Unit* caster = GetCaster()) - if (target->getPowerType() == POWER_MANA) - caster->CastCustomSpell(target, SPELL_MANA_SPRING_TOTEM_ENERGIZE, &damage, 0, 0, true, 0, 0, GetOriginalCaster()->GetGUID()); - } - - void Register() - { - OnEffectHitTarget += SpellEffectFn(spell_sha_mana_spring_totem_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } - - }; - - SpellScript* GetSpellScript() const - { - return new spell_sha_mana_spring_totem_SpellScript(); - } -}; - +/// Updated 4.3.4 class spell_sha_lava_lash : public SpellScriptLoader { public: @@ -550,6 +439,7 @@ class spell_sha_lava_lash : public SpellScriptLoader }; // 1064 Chain Heal +/// Updated 4.3.4 class spell_sha_chain_heal : public SpellScriptLoader { public: @@ -563,6 +453,7 @@ class spell_sha_chain_heal : public SpellScriptLoader { firstHeal = true; riptide = false; + amount = 0; return true; } @@ -574,6 +465,7 @@ class spell_sha_chain_heal : public SpellScriptLoader if (AuraEffect* aurEff = GetHitUnit()->GetAuraEffect(SPELL_AURA_PERIODIC_HEAL, SPELLFAMILY_SHAMAN, 0, 0, 0x10, GetCaster()->GetGUID())) { riptide = true; + amount = aurEff->GetSpellInfo()->Effects[EFFECT_2].CalcValue(); // Consume it GetHitUnit()->RemoveAura(aurEff->GetBase()); } @@ -581,7 +473,10 @@ class spell_sha_chain_heal : public SpellScriptLoader } // Riptide increases the Chain Heal effect by 25% if (riptide) - SetHitHeal(GetHitHeal() * 1.25f); + { + uint32 bonus = CalculatePct(GetHitHeal(), amount); + SetHitHeal(GetHitHeal() + bonus); + } } void Register() @@ -591,6 +486,7 @@ class spell_sha_chain_heal : public SpellScriptLoader bool firstHeal; bool riptide; + uint32 amount; }; SpellScript* GetSpellScript() const @@ -599,6 +495,7 @@ class spell_sha_chain_heal : public SpellScriptLoader } }; +/// Updated 4.3.4 class spell_sha_flame_shock : public SpellScriptLoader { public: @@ -620,15 +517,17 @@ class spell_sha_flame_shock : public SpellScriptLoader void HandleDispel(DispelInfo* /*dispelInfo*/) { if (Unit* caster = GetCaster()) + { // Lava Flows if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, ICON_ID_SHAMAN_LAVA_FLOW, EFFECT_0)) { if (sSpellMgr->GetFirstSpellInChain(SHAMAN_LAVA_FLOWS_R1) != sSpellMgr->GetFirstSpellInChain(aurEff->GetId())) return; - uint8 rank = sSpellMgr->GetSpellRank(aurEff->GetId()); - caster->CastSpell(caster, sSpellMgr->GetSpellWithRank(SHAMAN_LAVA_FLOWS_TRIGGERED_R1, rank), true); + uint32 basepoints = aurEff->GetAmount(); + caster->CastCustomSpell(caster, SHAMAN_LAVA_FLOWS_TRIGGERED_R1, &basepoints, NULL, NULL, true); } + } } void Register() @@ -643,64 +542,17 @@ class spell_sha_flame_shock : public SpellScriptLoader } }; -class spell_sha_sentry_totem : public SpellScriptLoader -{ - public: - spell_sha_sentry_totem() : SpellScriptLoader("spell_sha_sentry_totem") { } - - class spell_sha_sentry_totem_AuraScript : public AuraScript - { - PrepareAuraScript(spell_sha_sentry_totem_AuraScript); - - bool Validate(SpellInfo const* /*spell*/) - { - if (!sSpellMgr->GetSpellInfo(SHAMAN_BIND_SIGHT)) - return false; - return true; - } - - void AfterApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - if (Unit* caster = GetCaster()) - if (Creature* totem = caster->GetMap()->GetCreature(caster->m_SummonSlot[4])) - if (totem->isTotem()) - caster->CastSpell(totem, SHAMAN_BIND_SIGHT, true); - } - - void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - if (Unit* caster = GetCaster()) - if (caster->GetTypeId() == TYPEID_PLAYER) - caster->ToPlayer()->StopCastingBindSight(); - } - - void Register() - { - AfterEffectApply += AuraEffectApplyFn(spell_sha_sentry_totem_AuraScript::AfterApply, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); - AfterEffectRemove += AuraEffectRemoveFn(spell_sha_sentry_totem_AuraScript::AfterRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); - } - }; - - AuraScript* GetAuraScript() const - { - return new spell_sha_sentry_totem_AuraScript(); - } -}; - void AddSC_shaman_spell_scripts() { new spell_sha_fire_nova(); - new spell_sha_mana_tide_totem(); + new spell_sha_mana_tide(); new spell_sha_earthbind_totem(); new spell_sha_earthen_power(); new spell_sha_bloodlust(); new spell_sha_heroism(); new spell_sha_ancestral_awakening_proc(); - new spell_sha_cleansing_totem_pulse(); new spell_sha_healing_stream_totem(); - new spell_sha_mana_spring_totem(); new spell_sha_lava_lash(); new spell_sha_chain_heal(); new spell_sha_flame_shock(); - new spell_sha_sentry_totem(); } -- cgit v1.2.3 From f8feb1ec0ed5964bd8e5049dc3263f87c785b599 Mon Sep 17 00:00:00 2001 From: Subv Date: Wed, 17 Oct 2012 17:35:50 -0500 Subject: Core/Scripts: Fixed build --- src/server/scripts/Spells/spell_shaman.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index d09289d59ab..e776fc87a5e 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -524,7 +524,7 @@ class spell_sha_flame_shock : public SpellScriptLoader if (sSpellMgr->GetFirstSpellInChain(SHAMAN_LAVA_FLOWS_R1) != sSpellMgr->GetFirstSpellInChain(aurEff->GetId())) return; - uint32 basepoints = aurEff->GetAmount(); + int32 basepoints = aurEff->GetAmount(); caster->CastCustomSpell(caster, SHAMAN_LAVA_FLOWS_TRIGGERED_R1, &basepoints, NULL, NULL, true); } } -- cgit v1.2.3 From def294523f99a169a4c025de0d6c59ee40da09a4 Mon Sep 17 00:00:00 2001 From: Shocker Date: Thu, 18 Oct 2012 02:48:36 +0300 Subject: Core/Guild: Correctly give guild perks based on guild level --- src/server/game/Guilds/Guild.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 12455784cc8..9bd9fb4ffb9 100644 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -2142,7 +2142,7 @@ void Guild::SendLoginInfo(WorldSession* session) const for (uint32 i = 0; i < sGuildPerkSpellsStore.GetNumRows(); ++i) if (GuildPerkSpellsEntry const* entry = sGuildPerkSpellsStore.LookupEntry(i)) - if (entry->Level >= GetLevel()) + if (entry->Level <= GetLevel()) session->GetPlayer()->learnSpell(entry->SpellId, true); SendGuildReputationWeeklyCap(session); @@ -2474,7 +2474,7 @@ bool Guild::AddMember(uint64 guid, uint8 rankId) { for (uint32 i = 0; i < sGuildPerkSpellsStore.GetNumRows(); ++i) if (GuildPerkSpellsEntry const* entry = sGuildPerkSpellsStore.LookupEntry(i)) - if (entry->Level >= GetLevel()) + if (entry->Level <= GetLevel()) player->learnSpell(entry->SpellId, true); } } @@ -2540,7 +2540,7 @@ void Guild::DeleteMember(uint64 guid, bool isDisbanding, bool isKicked) player->SetGuildLevel(0); for (uint32 i = 0; i < sGuildPerkSpellsStore.GetNumRows(); ++i) if (GuildPerkSpellsEntry const* entry = sGuildPerkSpellsStore.LookupEntry(i)) - if (entry->Level >= GetLevel()) + if (entry->Level <= GetLevel()) player->removeSpell(entry->SpellId, false, false); } -- cgit v1.2.3 From 56df638092c551a025cd3dc200ed5d330f92fa63 Mon Sep 17 00:00:00 2001 From: Subv Date: Wed, 17 Oct 2012 20:21:09 -0500 Subject: Core/Entities: Fixed declining a group invitation --- src/server/game/Handlers/GroupHandler.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp index 3549e56fb88..69056cbf4c8 100644 --- a/src/server/game/Handlers/GroupHandler.cpp +++ b/src/server/game/Handlers/GroupHandler.cpp @@ -327,9 +327,12 @@ void WorldSession::HandleGroupInviteResponseOpcode(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_INVITE_RESPONSE"); - bool accept = !recvData.ReadBit(); - if (!accept) - recvData.read_skip(); // unk + recvData.ReadBit(); // unk always 0 + bool accept = recvData.ReadBit(); + + // Never actually received? + /*if (accept) + recvData.read_skip(); // unk*/ Group* group = GetPlayer()->GetGroupInvite(); -- cgit v1.2.3 From 77a8d6f127b0fd082c2b7072bd512822a6732362 Mon Sep 17 00:00:00 2001 From: Subv Date: Fri, 19 Oct 2012 16:16:30 -0500 Subject: Scripts/Spells: Corrected the spirit value used in the Mana Tide Totem script. --- src/server/scripts/Spells/spell_shaman.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index e776fc87a5e..5ddfe1f4dc5 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -103,9 +103,10 @@ class spell_sha_mana_tide : public SpellScriptLoader void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) { + ///@TODO: Exclude the "short term" buffs from the stat value if (Unit* caster = GetCaster()) if (Unit* owner = caster->GetOwner()) - amount = CalculatePct(owner->GetCreateStat(STAT_SPIRIT), aurEff->GetAmount()); + amount = CalculatePct(owner->GetStat(STAT_SPIRIT), aurEff->GetAmount()); } void Register() -- cgit v1.2.3 From c40e9e259599273b4317fe7a980c8f487e6f76e2 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 20 Oct 2012 00:02:32 +0200 Subject: Core/Spells: Fixed visuals of area spells that use a dynamic object --- src/server/game/Entities/DynamicObject/DynamicObject.cpp | 16 +++++----------- src/server/game/Entities/DynamicObject/DynamicObject.h | 2 +- src/server/game/Spells/Spell.cpp | 6 +++--- src/server/game/Spells/Spell.h | 2 +- src/server/game/Spells/SpellEffects.cpp | 10 ++++++---- 5 files changed, 16 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/DynamicObject/DynamicObject.cpp b/src/server/game/Entities/DynamicObject/DynamicObject.cpp index 065333dc9e2..a8f8d54c6d6 100755 --- a/src/server/game/Entities/DynamicObject/DynamicObject.cpp +++ b/src/server/game/Entities/DynamicObject/DynamicObject.cpp @@ -79,29 +79,23 @@ void DynamicObject::RemoveFromWorld() } } -bool DynamicObject::CreateDynamicObject(uint32 guidlow, Unit* caster, uint32 spellId, Position const& pos, float radius, DynamicObjectType type) +bool DynamicObject::CreateDynamicObject(uint32 guidlow, Unit* caster, SpellInfo const* spell, Position const& pos, float radius, DynamicObjectType type) { SetMap(caster->GetMap()); Relocate(pos); if (!IsPositionValid()) { - sLog->outError(LOG_FILTER_GENERAL, "DynamicObject (spell %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)", spellId, GetPositionX(), GetPositionY()); + sLog->outError(LOG_FILTER_GENERAL, "DynamicObject (spell %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)", spell, GetPositionX(), GetPositionY()); return false; } WorldObject::_Create(guidlow, HIGHGUID_DYNAMICOBJECT, caster->GetPhaseMask()); - SetEntry(spellId); + SetEntry(spell->Id); SetObjectScale(1); SetUInt64Value(DYNAMICOBJECT_CASTER, caster->GetGUID()); - - // The lower word of DYNAMICOBJECT_BYTES must be 0x0001. This value means that the visual radius will be overriden - // by client for most of the "ground patch" visual effect spells and a few "skyfall" ones like Hurricane. - // If any other value is used, the client will _always_ use the radius provided in DYNAMICOBJECT_RADIUS, but - // precompensation is necessary (eg radius *= 2) for many spells. Anyway, blizz sends 0x0001 for all the spells - // I saw sniffed... - SetByteValue(DYNAMICOBJECT_BYTES, 0, type); - SetUInt32Value(DYNAMICOBJECT_SPELLID, spellId); + SetUInt32Value(DYNAMICOBJECT_BYTES, spell->SpellVisual[0] | (type << 28)); + SetUInt32Value(DYNAMICOBJECT_SPELLID, spell->Id); SetFloatValue(DYNAMICOBJECT_RADIUS, radius); SetUInt32Value(DYNAMICOBJECT_CASTTIME, getMSTime()); diff --git a/src/server/game/Entities/DynamicObject/DynamicObject.h b/src/server/game/Entities/DynamicObject/DynamicObject.h index 68da99ac668..b988693315f 100755 --- a/src/server/game/Entities/DynamicObject/DynamicObject.h +++ b/src/server/game/Entities/DynamicObject/DynamicObject.h @@ -41,7 +41,7 @@ class DynamicObject : public WorldObject, public GridObject void AddToWorld(); void RemoveFromWorld(); - bool CreateDynamicObject(uint32 guidlow, Unit* caster, uint32 spellId, Position const& pos, float radius, DynamicObjectType type); + bool CreateDynamicObject(uint32 guidlow, Unit* caster, SpellInfo const* spell, Position const& pos, float radius, DynamicObjectType type); void Update(uint32 p_time); void Remove(); void SetDuration(int32 newDuration); diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 57f3a7d3711..d3e24394974 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -4162,12 +4162,12 @@ void Spell::ExecuteLogEffectInterruptCast(uint8 effIndex, Unit* victim, uint32 s *m_effectExecuteData[effIndex] << uint32(spellId); } -void Spell::ExecuteLogEffectDurabilityDamage(uint8 effIndex, Unit* victim, uint32 /*itemslot*/, uint32 damage) +void Spell::ExecuteLogEffectDurabilityDamage(uint8 effIndex, Unit* victim, int32 itemId, int32 slot) { InitEffectExecuteData(effIndex); m_effectExecuteData[effIndex]->append(victim->GetPackGUID()); - *m_effectExecuteData[effIndex] << uint32(m_spellInfo->Id); - *m_effectExecuteData[effIndex] << uint32(damage); + *m_effectExecuteData[effIndex] << int32(itemId); + *m_effectExecuteData[effIndex] << int32(slot); } void Spell::ExecuteLogEffectOpenLock(uint8 effIndex, Object* obj) diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h index 5b9c0436ef1..a69795bf5e1 100755 --- a/src/server/game/Spells/Spell.h +++ b/src/server/game/Spells/Spell.h @@ -423,7 +423,7 @@ class Spell void ExecuteLogEffectTakeTargetPower(uint8 effIndex, Unit* target, uint32 powerType, uint32 powerTaken, float gainMultiplier); void ExecuteLogEffectExtraAttacks(uint8 effIndex, Unit* victim, uint32 attCount); void ExecuteLogEffectInterruptCast(uint8 effIndex, Unit* victim, uint32 spellId); - void ExecuteLogEffectDurabilityDamage(uint8 effIndex, Unit* victim, uint32 itemslot, uint32 damage); + void ExecuteLogEffectDurabilityDamage(uint8 effIndex, Unit* victim, int32 itemId, int32 slot); void ExecuteLogEffectOpenLock(uint8 effIndex, Object* obj); void ExecuteLogEffectCreateItem(uint8 effIndex, uint32 entry); void ExecuteLogEffectDestroyItem(uint8 effIndex, uint32 entry); diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 0b62000fb3f..2b2bd53232d 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -1683,7 +1683,7 @@ void Spell::EffectPersistentAA(SpellEffIndex effIndex) if (!caster->IsInWorld()) return; DynamicObject* dynObj = new DynamicObject(false); - if (!dynObj->CreateDynamicObject(sObjectMgr->GenerateLowGuid(HIGHGUID_DYNAMICOBJECT), caster, m_spellInfo->Id, *destTarget, radius, DYNAMIC_OBJECT_AREA_SPELL)) + if (!dynObj->CreateDynamicObject(sObjectMgr->GenerateLowGuid(HIGHGUID_DYNAMICOBJECT), caster, m_spellInfo, *destTarget, radius, DYNAMIC_OBJECT_AREA_SPELL)) { delete dynObj; return; @@ -2507,7 +2507,7 @@ void Spell::EffectAddFarsight(SpellEffIndex effIndex) return; DynamicObject* dynObj = new DynamicObject(true); - if (!dynObj->CreateDynamicObject(sObjectMgr->GenerateLowGuid(HIGHGUID_DYNAMICOBJECT), m_caster, m_spellInfo->Id, *destTarget, radius, DYNAMIC_OBJECT_FARSIGHT_FOCUS)) + if (!dynObj->CreateDynamicObject(sObjectMgr->GenerateLowGuid(HIGHGUID_DYNAMICOBJECT), m_caster, m_spellInfo, *destTarget, radius, DYNAMIC_OBJECT_FARSIGHT_FOCUS)) { delete dynObj; return; @@ -5142,6 +5142,7 @@ void Spell::EffectDurabilityDamage(SpellEffIndex effIndex) if (slot < 0) { unitTarget->ToPlayer()->DurabilityPointsLossAll(damage, (slot < -1)); + ExecuteLogEffectDurabilityDamage(effIndex, unitTarget, -1, -1); // -1 -1 pair triggers SPELL_DURABILITY_DAMAGE_ALL event return; } @@ -5150,9 +5151,10 @@ void Spell::EffectDurabilityDamage(SpellEffIndex effIndex) return; if (Item* item = unitTarget->ToPlayer()->GetItemByPos(INVENTORY_SLOT_BAG_0, slot)) + { unitTarget->ToPlayer()->DurabilityPointsLoss(item, damage); - - ExecuteLogEffectDurabilityDamage(effIndex, unitTarget, slot, damage); + ExecuteLogEffectDurabilityDamage(effIndex, unitTarget, item->GetEntry(), slot); + } } void Spell::EffectDurabilityDamagePCT(SpellEffIndex effIndex) -- cgit v1.2.3 From c343448989916df4fa41f42b57c5629e9997603d Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 20 Oct 2012 13:01:03 +0200 Subject: Core/Entities: Corrected error log message, thanks zorix for noticing --- src/server/game/Entities/DynamicObject/DynamicObject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Entities/DynamicObject/DynamicObject.cpp b/src/server/game/Entities/DynamicObject/DynamicObject.cpp index a8f8d54c6d6..312f858751b 100755 --- a/src/server/game/Entities/DynamicObject/DynamicObject.cpp +++ b/src/server/game/Entities/DynamicObject/DynamicObject.cpp @@ -85,7 +85,7 @@ bool DynamicObject::CreateDynamicObject(uint32 guidlow, Unit* caster, SpellInfo Relocate(pos); if (!IsPositionValid()) { - sLog->outError(LOG_FILTER_GENERAL, "DynamicObject (spell %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)", spell, GetPositionX(), GetPositionY()); + sLog->outError(LOG_FILTER_GENERAL, "DynamicObject (spell %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)", spell->Id, GetPositionX(), GetPositionY()); return false; } -- cgit v1.2.3 From 9de3528233219a7f22e3866e728f60b579366f7b Mon Sep 17 00:00:00 2001 From: Shocker Date: Sun, 21 Oct 2012 22:17:49 +0300 Subject: Core/Player: Define talent trees (tabs) --- src/server/game/Entities/Player/Player.h | 34 ++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 583423a28d5..bca2110d72f 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -115,6 +115,40 @@ struct PlayerTalent uint8 spec : 8; }; +enum TalentTree // talent tabs +{ + TALENT_TREE_WARRIOR_ARMS = 746, + TALENT_TREE_WARRIOR_FURY = 815, + TALENT_TREE_WARRIOR_PROTECTION = 845, + TALENT_TREE_PALADIN_HOLY = 831, + TALENT_TREE_PALADIN_PROTECTION = 839, + TALENT_TREE_PALADIN_RETRIBUTION = 855, + TALENT_TREE_HUNTER_BEAST_MASTERY = 811, + TALENT_TREE_HUNTER_MARKSMANSHIP = 807, + TALENT_TREE_HUNTER_SURVIVAL = 809, + TALENT_TREE_ROGUE_ASSASSINATION = 182, + TALENT_TREE_ROGUE_COMBAT = 181, + TALENT_TREE_ROGUE_SUBTLETY = 183, + TALENT_TREE_PRIEST_DISCIPLINE = 760, + TALENT_TREE_PRIEST_HOLY = 813, + TALENT_TREE_PRIEST_SHADOW = 759, + TALENT_TREE_DEATH_KNIGHT_BLOOD = 398, + TALENT_TREE_DEATH_KNIGHT_FROST = 399, + TALENT_TREE_DEATH_KNIGHT_UNHOLY = 400, + TALENT_TREE_SHAMAN_ELEMENTAL = 261, + TALENT_TREE_SHAMAN_ENHANCEMENT = 263, + TALENT_TREE_SHAMAN_RESTORATION = 262, + TALENT_TREE_MAGE_ARCANE = 799, + TALENT_TREE_MAGE_FIRE = 851, + TALENT_TREE_MAGE_FROST = 823, + TALENT_TREE_WARLOCK_AFFLICTION = 871, + TALENT_TREE_WARLOCK_DEMONOLOGY = 867, + TALENT_TREE_WARLOCK_DESTRUCTION = 865, + TALENT_TREE_DRUID_BALANCE = 752, + TALENT_TREE_DRUID_FERAL_COMBAT = 750, + TALENT_TREE_DRUID_RESTORATION = 748 +}; + // Spell modifier (used for modify other spells) struct SpellModifier { -- cgit v1.2.3 From 66889f11b72966fbdfc10abc460ec7345b29855a Mon Sep 17 00:00:00 2001 From: Shocker Date: Sun, 21 Oct 2012 22:25:52 +0300 Subject: Core/Spells: Use previous defines in a druid spell script --- src/server/scripts/Spells/spell_druid.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index 5cba8edb37e..f8adb13d058 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -158,7 +158,6 @@ enum EclipseSpells SPELL_DRUID_SOLAR_ECLIPSE_MARKER = 67483, // Will make the yellow arrow on eclipse bar point to the yellow side (solar) SPELL_DRUID_SOLAR_ECLIPSE = 48517, SPELL_DRUID_LUNAR_ECLIPSE = 48518, - TALENT_TREE_BALANCE = 752, }; // Wrath, Starfire, and Starsurge @@ -191,7 +190,7 @@ public: Player* caster = GetCaster()->ToPlayer(); // No boomy, no deal. - if (caster->GetPrimaryTalentTree(caster->GetActiveSpec()) != TALENT_TREE_BALANCE) + if (caster->GetPrimaryTalentTree(caster->GetActiveSpec()) != TALENT_TREE_DRUID_BALANCE) return; switch(GetSpellInfo()->Id) -- cgit v1.2.3 From cff550449d90c50af96f2b765fd1230b2f629464 Mon Sep 17 00:00:00 2001 From: Shocker Date: Sun, 21 Oct 2012 22:32:18 +0300 Subject: Core/Player: Correct value for TALENT_TREE_PRIEST_SHADOW --- src/server/game/Entities/Player/Player.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index bca2110d72f..9b2b508dbe7 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -131,7 +131,7 @@ enum TalentTree // talent tabs TALENT_TREE_ROGUE_SUBTLETY = 183, TALENT_TREE_PRIEST_DISCIPLINE = 760, TALENT_TREE_PRIEST_HOLY = 813, - TALENT_TREE_PRIEST_SHADOW = 759, + TALENT_TREE_PRIEST_SHADOW = 795, TALENT_TREE_DEATH_KNIGHT_BLOOD = 398, TALENT_TREE_DEATH_KNIGHT_FROST = 399, TALENT_TREE_DEATH_KNIGHT_UNHOLY = 400, -- cgit v1.2.3 From 38b5a6c7be25fef3b9b16adc82dfbfaeebd76f53 Mon Sep 17 00:00:00 2001 From: Naios Date: Mon, 22 Oct 2012 20:12:46 +0200 Subject: Core/Spells: On Dismount use the amount to get the MountCapabilityEntry to remove related mount auras #8123 --- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index d70c68b9be2..68e7cd398d0 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -717,7 +717,10 @@ int32 AuraEffect::CalculateAmount(Unit* caster) break; case SPELL_AURA_MOUNTED: if (MountCapabilityEntry const* mountCapability = GetBase()->GetUnitOwner()->GetMountCapability(uint32(GetMiscValueB()))) + { amount = mountCapability->Id; + m_canBeRecalculated = false; + } break; case SPELL_AURA_MOD_RESISTANCE_EXCLUSIVE: { @@ -2809,7 +2812,7 @@ void AuraEffect::HandleAuraMounted(AuraApplication const* aurApp, uint8 mode, bo target->RemoveAurasByType(SPELL_AURA_MOUNTED); // remove speed aura - if (MountCapabilityEntry const* mountCapability = target->GetMountCapability(uint32(GetMiscValueB()))) + if (MountCapabilityEntry const* mountCapability = sMountCapabilityStore.LookupEntry(GetAmount())) target->RemoveAurasDueToSpell(mountCapability->SpeedModSpell, target->GetGUID()); } } -- cgit v1.2.3 From b73a5f32b07c227abc9c03a3348bf6d786107c30 Mon Sep 17 00:00:00 2001 From: Shocker Date: Mon, 22 Oct 2012 22:43:38 +0300 Subject: Core/Spells: Add some info to various aura defines --- src/server/game/Spells/Auras/SpellAuraDefines.h | 4 ++-- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 24 +++++++++++------------ 2 files changed, 14 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/server/game/Spells/Auras/SpellAuraDefines.h b/src/server/game/Spells/Auras/SpellAuraDefines.h index 09b28f017d5..c198f4c178b 100755 --- a/src/server/game/Spells/Auras/SpellAuraDefines.h +++ b/src/server/game/Spells/Auras/SpellAuraDefines.h @@ -403,7 +403,7 @@ enum AuraType SPELL_AURA_MOD_SPELL_CATEGORY_COOLDOWN = 341, // NYI SPELL_AURA_MOD_MELEE_RANGED_HASTE_2 = 342, SPELL_AURA_343 = 343, - SPELL_AURA_MOD_AUTOATTACK_DAMAGE = 344, + SPELL_AURA_MOD_AUTOATTACK_DAMAGE = 344, // NYI SPELL_AURA_BYPASS_ARMOR_FOR_CASTER = 345, SPELL_AURA_ENABLE_ALT_POWER = 346, // NYI SPELL_AURA_MOD_SPELL_COOLDOWN_BY_HASTE = 347, // NYI @@ -425,7 +425,7 @@ enum AuraType SPELL_AURA_MOD_NEXT_SPELL = 363, // Used by 101601 Throw Totem - causes the client to initialize spell cast with specified spell SPELL_AURA_364 = 364, // Not used in 4.3.4 SPELL_AURA_MAX_FAR_CLIP_PLANE = 365, // Overrides client's View Distance setting to max("Fair", current_setting) and turns off terrain display - SPELL_AURA_OVERRIDE_SPELL_POWER_BY_AP_PCT = 366, // Sets spellpower equal to % of attack power, discarding all other bonuses (from gear and buffs) + SPELL_AURA_OVERRIDE_SPELL_POWER_BY_AP_PCT = 366, // NYI - Sets spellpower equal to % of attack power, discarding all other bonuses (from gear and buffs) SPELL_AURA_367 = 367, SPELL_AURA_368 = 368, // Not used in 4.3.4 SPELL_AURA_ENABLE_POWER_BAR_TIMER = 369, diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index d70c68b9be2..29c27bc871f 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -396,16 +396,16 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleNoImmediateEffect, //337 SPELL_AURA_MOD_VENDOR_ITEMS_PRICES &AuraEffect::HandleNoImmediateEffect, //338 SPELL_AURA_MOD_DURABILITY_LOSS &AuraEffect::HandleNULL, //339 SPELL_AURA_INCREASE_SKILL_GAIN_CHANCE - &AuraEffect::HandleNULL, //340 SPELL_AURA_340 + &AuraEffect::HandleNULL, //340 SPELL_AURA_MOD_RESURRECTED_HEALTH_BY_GUILD_MEMBER &AuraEffect::HandleNULL, //341 SPELL_AURA_MOD_SPELL_CATEGORY_COOLDOWN &AuraEffect::HandleModMeleeRangedSpeedPct, //342 SPELL_AURA_MOD_MELEE_RANGED_HASTE_2 &AuraEffect::HandleNULL, //343 SPELL_AURA_343 &AuraEffect::HandleNULL, //344 SPELL_AURA_MOD_AUTOATTACK_DAMAGE &AuraEffect::HandleNoImmediateEffect, //345 SPELL_AURA_BYPASS_ARMOR_FOR_CASTER - &AuraEffect::HandleNULL, //346 SPELL_AURA_PROGRESS_BAR + &AuraEffect::HandleNULL, //346 SPELL_AURA_ENABLE_ALT_POWER &AuraEffect::HandleNULL, //347 SPELL_AURA_MOD_SPELL_COOLDOWN_BY_HASTE - &AuraEffect::HandleNoImmediateEffect, //348 SPELL_AURA_DEPOSIT_BONUS_MONEY_IN_GUILD_BANK_ON_LOOT - &AuraEffect::HandleNoImmediateEffect, //349 SPELL_AURA_MOD_CURRENCY_GAIN + &AuraEffect::HandleNoImmediateEffect, //348 SPELL_AURA_DEPOSIT_BONUS_MONEY_IN_GUILD_BANK_ON_LOOT implemented in WorldSession::HandleLootMoneyOpcode + &AuraEffect::HandleNoImmediateEffect, //349 SPELL_AURA_MOD_CURRENCY_GAIN implemented in Player::ModifyCurrency &AuraEffect::HandleNULL, //350 SPELL_AURA_MOD_GATHERING_ITEMS_GAINED_PERCENT &AuraEffect::HandleNULL, //351 SPELL_AURA_351 &AuraEffect::HandleNULL, //352 SPELL_AURA_352 @@ -413,20 +413,20 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleNULL, //354 SPELL_AURA_354 &AuraEffect::HandleUnused, //355 unused (4.3.4) &AuraEffect::HandleNULL, //356 SPELL_AURA_356 - &AuraEffect::HandleNULL, //357 SPELL_AURA_357 + &AuraEffect::HandleNULL, //357 SPELL_AURA_ENABLE_BOSS1_UNIT_FRAME &AuraEffect::HandleNULL, //358 SPELL_AURA_358 &AuraEffect::HandleNULL, //359 SPELL_AURA_359 - &AuraEffect::HandleNULL, //360 SPELL_AURA_360 - &AuraEffect::HandleNULL, //361 SPELL_AURA_361 + &AuraEffect::HandleNULL, //360 SPELL_AURA_PROC_TRIGGER_SPELL_COPY + &AuraEffect::HandleNULL, //361 SPELL_AURA_PROC_TRIGGER_SPELL_2 implemented in Unit::ProcDamageAndSpellFor &AuraEffect::HandleUnused, //362 unused (4.3.4) - &AuraEffect::HandleNULL, //363 SPELL_AURA_363 + &AuraEffect::HandleNULL, //363 SPELL_AURA_MOD_NEXT_SPELL &AuraEffect::HandleUnused, //364 unused (4.3.4) - &AuraEffect::HandleNULL, //365 SPELL_AURA_365 - &AuraEffect::HandleNULL, //366 SPELL_AURA_366 + &AuraEffect::HandleNULL, //365 SPELL_AURA_MAX_FAR_CLIP_PLANE + &AuraEffect::HandleNULL, //366 SPELL_AURA_OVERRIDE_SPELL_POWER_BY_AP_PCT &AuraEffect::HandleNULL, //367 SPELL_AURA_367 &AuraEffect::HandleUnused, //368 unused (4.3.4) - &AuraEffect::HandleNULL, //369 SPELL_AURA_369 - &AuraEffect::HandleNULL, //370 SPELL_AURA_370 + &AuraEffect::HandleNULL, //369 SPELL_AURA_ENABLE_POWER_BAR_TIMER + &AuraEffect::HandleNULL, //370 SPELL_AURA_SET_FAIR_FAR_CLIP }; AuraEffect::AuraEffect(Aura* base, uint8 effIndex, int32 *baseAmount, Unit* caster): -- cgit v1.2.3 From 4354882ba2299817a6fc02b22849ebd9863cbd99 Mon Sep 17 00:00:00 2001 From: Shocker Date: Tue, 23 Oct 2012 04:44:26 +0300 Subject: Core/Arena: Log team name on member join too --- src/server/game/Battlegrounds/ArenaTeam.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Battlegrounds/ArenaTeam.cpp b/src/server/game/Battlegrounds/ArenaTeam.cpp index e88c501398e..c2512d71579 100755 --- a/src/server/game/Battlegrounds/ArenaTeam.cpp +++ b/src/server/game/Battlegrounds/ArenaTeam.cpp @@ -177,7 +177,7 @@ bool ArenaTeam::AddMember(uint64 playerGuid) player->SetArenaTeamInfoField(GetSlot(), ARENA_TEAM_MEMBER, 1); } - sLog->outInfo(LOG_FILTER_ARENAS, "Player: %s [GUID: %u] joined arena team type: %u [Id: %u].", playerName.c_str(), GUID_LOPART(playerGuid), GetType(), GetId()); + sLog->outInfo(LOG_FILTER_ARENAS, "Player: %s [GUID: %u] joined arena team type: %u [Id: %u, Name: %s].", playerName.c_str(), GUID_LOPART(playerGuid), GetType(), GetId(), GetName().c_str()); return true; } -- cgit v1.2.3 From aa30f9c5f553f08999d267cb38458c25ad83a151 Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 26 Oct 2012 21:13:00 +0200 Subject: Core/Spells: Implemented play movie spell effect --- src/server/game/Miscellaneous/SharedDefines.h | 2 +- src/server/game/Spells/Spell.h | 2 +- src/server/game/Spells/SpellEffects.cpp | 26 +++++--------------------- 3 files changed, 7 insertions(+), 23 deletions(-) (limited to 'src') diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index ed7ed2ea05a..93a911459c9 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -825,7 +825,7 @@ enum SpellEffects SPELL_EFFECT_JUMP_DEST = 42, SPELL_EFFECT_TELEPORT_UNITS_FACE_CASTER = 43, SPELL_EFFECT_SKILL_STEP = 44, - SPELL_EFFECT_ADD_HONOR = 45, + SPELL_EFFECT_PLAY_MOVIE = 45, SPELL_EFFECT_SPAWN = 46, SPELL_EFFECT_TRADE_SKILL = 47, SPELL_EFFECT_STEALTH = 48, diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h index a69795bf5e1..603cfbf1309 100755 --- a/src/server/game/Spells/Spell.h +++ b/src/server/game/Spells/Spell.h @@ -252,7 +252,7 @@ class Spell void EffectQuestClear(SpellEffIndex effIndex); void EffectTeleUnitsFaceCaster(SpellEffIndex effIndex); void EffectLearnSkill(SpellEffIndex effIndex); - void EffectAddHonor(SpellEffIndex effIndex); + void EffectPlayMovie(SpellEffIndex effIndex); void EffectTradeSkill(SpellEffIndex effIndex); void EffectEnchantItemPerm(SpellEffIndex effIndex); void EffectEnchantItemTmp(SpellEffIndex effIndex); diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 969ce89fa66..16cf6549c41 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -113,7 +113,7 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]= &Spell::EffectJumpDest, // 42 SPELL_EFFECT_JUMP_DEST &Spell::EffectTeleUnitsFaceCaster, // 43 SPELL_EFFECT_TELEPORT_UNITS_FACE_CASTER &Spell::EffectLearnSkill, // 44 SPELL_EFFECT_SKILL_STEP - &Spell::EffectAddHonor, // 45 SPELL_EFFECT_ADD_HONOR honor/pvp related + &Spell::EffectPlayMovie, // 45 SPELL_EFFECT_PLAY_MOVIE &Spell::EffectUnused, // 46 SPELL_EFFECT_SPAWN clientside, unit appears as if it was just spawned &Spell::EffectTradeSkill, // 47 SPELL_EFFECT_TRADE_SKILL &Spell::EffectUnused, // 48 SPELL_EFFECT_STEALTH one spell: Base Stealth @@ -2564,7 +2564,7 @@ void Spell::EffectLearnSkill(SpellEffIndex effIndex) unitTarget->ToPlayer()->SetSkill(skillid, m_spellInfo->Effects[effIndex].CalcValue(), skillval?skillval:1, damage*75); } -void Spell::EffectAddHonor(SpellEffIndex /*effIndex*/) +void Spell::EffectPlayMovie(SpellEffIndex effIndex) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; @@ -2572,27 +2572,11 @@ void Spell::EffectAddHonor(SpellEffIndex /*effIndex*/) if (unitTarget->GetTypeId() != TYPEID_PLAYER) return; - // not scale value for item based reward (/10 value expected) - if (m_CastItem) - { - unitTarget->ToPlayer()->RewardHonor(NULL, 1, damage/10); - sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SpellEffect::AddHonor (spell_id %u) rewards %d honor points (item %u) for player: %u", m_spellInfo->Id, damage/10, m_CastItem->GetEntry(), unitTarget->ToPlayer()->GetGUIDLow()); + uint32 movieId = GetSpellInfo()->Effects[effIndex].MiscValue; + if (!sMovieStore.LookupEntry(movieId)) return; - } - // do not allow to add too many honor for player (50 * 21) = 1040 at level 70, or (50 * 31) = 1550 at level 80 - if (damage <= 50) - { - uint32 honor_reward = Trinity::Honor::hk_honor_at_level(unitTarget->getLevel(), float(damage)); - unitTarget->ToPlayer()->RewardHonor(NULL, 1, honor_reward); - sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SpellEffect::AddHonor (spell_id %u) rewards %u honor points (scale) to player: %u", m_spellInfo->Id, honor_reward, unitTarget->ToPlayer()->GetGUIDLow()); - } - else - { - //maybe we have correct honor_gain in damage already - unitTarget->ToPlayer()->RewardHonor(NULL, 1, damage); - sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SpellEffect::AddHonor (spell_id %u) rewards %u honor points (non scale) for player: %u", m_spellInfo->Id, damage, unitTarget->ToPlayer()->GetGUIDLow()); - } + unitTarget->ToPlayer()->SendMovieStart(movieId); } void Spell::EffectTradeSkill(SpellEffIndex /*effIndex*/) -- cgit v1.2.3 From 3b4b536fd04d71aae8d79906a7c552fde7c6a9f1 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 27 Oct 2012 12:19:29 +0200 Subject: Core/Battlegrounds: Minor cleanup --- src/server/game/Battlegrounds/BattlegroundMgr.cpp | 242 +++++++++++----------- 1 file changed, 121 insertions(+), 121 deletions(-) (limited to 'src') diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index d090db1268a..070f974e65a 100755 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -163,13 +163,15 @@ void BattlegroundMgr::Update(uint32 diff) } } -void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battleground *bg, Player * pPlayer, uint8 QueueSlot, uint8 StatusID, uint32 Time1, uint32 Time2, uint8 arenatype, uint8 /*uiFrame*/) +void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battleground *bg, Player * player, uint8 QueueSlot, uint8 StatusID, uint32 Time1, uint32 Time2, uint8 arenatype, uint8 /*uiFrame*/) { - if (!bg) - StatusID = STATUS_NONE; + ObjectGuid playerGuid = player->GetGUID(); + ObjectGuid bgGuid; - ObjectGuid guidBytes1 = pPlayer->GetGUID(); - ObjectGuid guidBytes2 = bg->GetGUID(); + if (bg) + bgGuid = bg->GetGUID(); + else + StatusID = STATUS_NONE; switch (StatusID) { @@ -177,82 +179,82 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro { data->Initialize(SMSG_BATTLEFIELD_STATUS); - data->WriteBit(guidBytes1[0]); - data->WriteBit(guidBytes1[4]); - data->WriteBit(guidBytes1[7]); - data->WriteBit(guidBytes1[1]); - data->WriteBit(guidBytes1[6]); - data->WriteBit(guidBytes1[3]); - data->WriteBit(guidBytes1[5]); - data->WriteBit(guidBytes1[2]); + data->WriteBit(playerGuid[0]); + data->WriteBit(playerGuid[4]); + data->WriteBit(playerGuid[7]); + data->WriteBit(playerGuid[1]); + data->WriteBit(playerGuid[6]); + data->WriteBit(playerGuid[3]); + data->WriteBit(playerGuid[5]); + data->WriteBit(playerGuid[2]); data->FlushBits(); - data->WriteByteSeq(guidBytes1[5]); - data->WriteByteSeq(guidBytes1[6]); - data->WriteByteSeq(guidBytes1[7]); - data->WriteByteSeq(guidBytes1[2]); + data->WriteByteSeq(playerGuid[5]); + data->WriteByteSeq(playerGuid[6]); + data->WriteByteSeq(playerGuid[7]); + data->WriteByteSeq(playerGuid[2]); *data << uint32(1); // unk, always 1 - data->WriteByteSeq(guidBytes1[3]); - data->WriteByteSeq(guidBytes1[1]); + data->WriteByteSeq(playerGuid[3]); + data->WriteByteSeq(playerGuid[1]); *data << uint32(QueueSlot); // Queue slot *data << uint32(Time1); // Join Time - data->WriteByteSeq(guidBytes1[0]); - data->WriteByteSeq(guidBytes1[4]); + data->WriteByteSeq(playerGuid[0]); + data->WriteByteSeq(playerGuid[4]); break; } case STATUS_WAIT_QUEUE: { data->Initialize(SMSG_BATTLEFIELD_STATUS_QUEUED); - data->WriteBit(guidBytes1[3]); - data->WriteBit(guidBytes1[0]); - data->WriteBit(guidBytes2[3]); - data->WriteBit(guidBytes1[2]); + data->WriteBit(playerGuid[3]); + data->WriteBit(playerGuid[0]); + data->WriteBit(bgGuid[3]); + data->WriteBit(playerGuid[2]); data->WriteBit(1); // Eligible In Queue data->WriteBit(0); // Join Failed - data->WriteBit(guidBytes2[2]); - data->WriteBit(guidBytes1[1]); - data->WriteBit(guidBytes2[0]); - data->WriteBit(guidBytes2[6]); - data->WriteBit(guidBytes2[4]); - data->WriteBit(guidBytes1[6]); - data->WriteBit(guidBytes1[7]); - data->WriteBit(guidBytes2[7]); - data->WriteBit(guidBytes2[5]); - data->WriteBit(guidBytes1[4]); - data->WriteBit(guidBytes1[5]); + data->WriteBit(bgGuid[2]); + data->WriteBit(playerGuid[1]); + data->WriteBit(bgGuid[0]); + data->WriteBit(bgGuid[6]); + data->WriteBit(bgGuid[4]); + data->WriteBit(playerGuid[6]); + data->WriteBit(playerGuid[7]); + data->WriteBit(bgGuid[7]); + data->WriteBit(bgGuid[5]); + data->WriteBit(playerGuid[4]); + data->WriteBit(playerGuid[5]); data->WriteBit(bg->isRated()); // Is Rated data->WriteBit(0); // Waiting On Other Activity - data->WriteBit(guidBytes2[1]); + data->WriteBit(bgGuid[1]); data->FlushBits(); - data->WriteByteSeq(guidBytes1[0]); + data->WriteByteSeq(playerGuid[0]); *data << uint32(1); // unk, always 1 - data->WriteByteSeq(guidBytes2[5]); - data->WriteByteSeq(guidBytes1[3]); + data->WriteByteSeq(bgGuid[5]); + data->WriteByteSeq(playerGuid[3]); *data << uint32(Time1); // Estimated Wait Time - data->WriteByteSeq(guidBytes2[7]); - data->WriteByteSeq(guidBytes2[1]); - data->WriteByteSeq(guidBytes2[2]); + data->WriteByteSeq(bgGuid[7]); + data->WriteByteSeq(bgGuid[1]); + data->WriteByteSeq(bgGuid[2]); *data << uint8(0); // unk - data->WriteByteSeq(guidBytes2[4]); - data->WriteByteSeq(guidBytes1[2]); + data->WriteByteSeq(bgGuid[4]); + data->WriteByteSeq(playerGuid[2]); *data << uint8(0); // Player count in rated mode - data->WriteByteSeq(guidBytes2[6]); - data->WriteByteSeq(guidBytes1[7]); - data->WriteByteSeq(guidBytes2[3]); - data->WriteByteSeq(guidBytes1[6]); - data->WriteByteSeq(guidBytes2[0]); + data->WriteByteSeq(bgGuid[6]); + data->WriteByteSeq(playerGuid[7]); + data->WriteByteSeq(bgGuid[3]); + data->WriteByteSeq(playerGuid[6]); + data->WriteByteSeq(bgGuid[0]); *data << uint32(Time2); // Join Time *data << uint32(QueueSlot); // Queue slot *data << uint8(bg->GetMinLevel()); // Min Level *data << uint32(GetMSTimeDiffToNow(Time2)); // Time since joined - data->WriteByteSeq(guidBytes1[1]); - data->WriteByteSeq(guidBytes1[5]); + data->WriteByteSeq(playerGuid[1]); + data->WriteByteSeq(playerGuid[5]); *data << uint32(bg->GetClientInstanceID()); // Client Instance ID - data->WriteByteSeq(guidBytes1[4]); + data->WriteByteSeq(playerGuid[4]); break; } case STATUS_WAIT_JOIN: @@ -269,83 +271,83 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro *data << uint32(bg->GetMapId()); // Map Id *data << uint8(0); // Player count in rated mode - data->WriteBit(guidBytes1[5]); - data->WriteBit(guidBytes1[2]); - data->WriteBit(guidBytes1[1]); - data->WriteBit(guidBytes2[2]); - data->WriteBit(guidBytes1[4]); - data->WriteBit(guidBytes2[6]); - data->WriteBit(guidBytes2[3]); + data->WriteBit(playerGuid[5]); + data->WriteBit(playerGuid[2]); + data->WriteBit(playerGuid[1]); + data->WriteBit(bgGuid[2]); + data->WriteBit(playerGuid[4]); + data->WriteBit(bgGuid[6]); + data->WriteBit(bgGuid[3]); data->WriteBit(bg->isRated()); // Is Rated - data->WriteBit(guidBytes1[7]); - data->WriteBit(guidBytes1[3]); - data->WriteBit(guidBytes2[7]); - data->WriteBit(guidBytes2[0]); - data->WriteBit(guidBytes2[4]); - data->WriteBit(guidBytes1[6]); - data->WriteBit(guidBytes2[1]); - data->WriteBit(guidBytes2[5]); - data->WriteBit(guidBytes1[0]); + data->WriteBit(playerGuid[7]); + data->WriteBit(playerGuid[3]); + data->WriteBit(bgGuid[7]); + data->WriteBit(bgGuid[0]); + data->WriteBit(bgGuid[4]); + data->WriteBit(playerGuid[6]); + data->WriteBit(bgGuid[1]); + data->WriteBit(bgGuid[5]); + data->WriteBit(playerGuid[0]); data->FlushBits(); - data->WriteByteSeq(guidBytes2[6]); - data->WriteByteSeq(guidBytes2[5]); - data->WriteByteSeq(guidBytes2[7]); - data->WriteByteSeq(guidBytes2[2]); - data->WriteByteSeq(guidBytes1[0]); - data->WriteByteSeq(guidBytes1[7]); - data->WriteByteSeq(guidBytes2[4]); - data->WriteByteSeq(guidBytes1[1]); - data->WriteByteSeq(guidBytes2[0]); - data->WriteByteSeq(guidBytes1[4]); - data->WriteByteSeq(guidBytes2[1]); - data->WriteByteSeq(guidBytes1[5]); - data->WriteByteSeq(guidBytes2[3]); - data->WriteByteSeq(guidBytes1[6]); - data->WriteByteSeq(guidBytes1[2]); - data->WriteByteSeq(guidBytes1[3]); + data->WriteByteSeq(bgGuid[6]); + data->WriteByteSeq(bgGuid[5]); + data->WriteByteSeq(bgGuid[7]); + data->WriteByteSeq(bgGuid[2]); + data->WriteByteSeq(playerGuid[0]); + data->WriteByteSeq(playerGuid[7]); + data->WriteByteSeq(bgGuid[4]); + data->WriteByteSeq(playerGuid[1]); + data->WriteByteSeq(bgGuid[0]); + data->WriteByteSeq(playerGuid[4]); + data->WriteByteSeq(bgGuid[1]); + data->WriteByteSeq(playerGuid[5]); + data->WriteByteSeq(bgGuid[3]); + data->WriteByteSeq(playerGuid[6]); + data->WriteByteSeq(playerGuid[2]); + data->WriteByteSeq(playerGuid[3]); break; } case STATUS_IN_PROGRESS: { data->Initialize(SMSG_BATTLEFIELD_STATUS_ACTIVE); - data->WriteBit(guidBytes1[2]); - data->WriteBit(guidBytes1[7]); - data->WriteBit(guidBytes2[7]); - data->WriteBit(guidBytes2[1]); - data->WriteBit(guidBytes1[5]); - data->WriteBit(bg->GetPlayerTeam(guidBytes1) == ALLIANCE); // Battlefield Faction ( 0 horde, 1 alliance ) - data->WriteBit(guidBytes2[0]); - data->WriteBit(guidBytes1[1]); - data->WriteBit(guidBytes2[3]); - data->WriteBit(guidBytes1[6]); - data->WriteBit(guidBytes2[5]); + data->WriteBit(playerGuid[2]); + data->WriteBit(playerGuid[7]); + data->WriteBit(bgGuid[7]); + data->WriteBit(bgGuid[1]); + data->WriteBit(playerGuid[5]); + data->WriteBit(player->GetBGTeam() == ALLIANCE); // Battlefield Faction ( 0 horde, 1 alliance ) + data->WriteBit(bgGuid[0]); + data->WriteBit(playerGuid[1]); + data->WriteBit(bgGuid[3]); + data->WriteBit(playerGuid[6]); + data->WriteBit(bgGuid[5]); data->WriteBit(0); // unk, Bit 64 - data->WriteBit(guidBytes1[4]); - data->WriteBit(guidBytes2[6]); - data->WriteBit(guidBytes2[4]); - data->WriteBit(guidBytes2[2]); - data->WriteBit(guidBytes1[3]); - data->WriteBit(guidBytes1[0]); + data->WriteBit(playerGuid[4]); + data->WriteBit(bgGuid[6]); + data->WriteBit(bgGuid[4]); + data->WriteBit(bgGuid[2]); + data->WriteBit(playerGuid[3]); + data->WriteBit(playerGuid[0]); data->FlushBits(); - data->WriteByteSeq(guidBytes2[4]); - data->WriteByteSeq(guidBytes2[5]); - data->WriteByteSeq(guidBytes1[5]); - data->WriteByteSeq(guidBytes2[1]); - data->WriteByteSeq(guidBytes2[6]); - data->WriteByteSeq(guidBytes2[3]); - data->WriteByteSeq(guidBytes2[7]); - data->WriteByteSeq(guidBytes1[6]); + data->WriteByteSeq(bgGuid[4]); + data->WriteByteSeq(bgGuid[5]); + data->WriteByteSeq(playerGuid[5]); + data->WriteByteSeq(bgGuid[1]); + data->WriteByteSeq(bgGuid[6]); + data->WriteByteSeq(bgGuid[3]); + data->WriteByteSeq(bgGuid[7]); + data->WriteByteSeq(playerGuid[6]); *data << uint32(Time1); // Join Time *data << uint8(arenatype); // Teamsize (0 if not arena) - data->WriteByteSeq(guidBytes1[4]); - data->WriteByteSeq(guidBytes1[1]); + data->WriteByteSeq(playerGuid[4]); + data->WriteByteSeq(playerGuid[1]); *data << uint32(QueueSlot); // Queue slot *data << uint8(0); // Player count in rated mode @@ -354,17 +356,17 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro *data << uint8(bg->GetMinLevel()); // Min Level *data << uint32(Time2); // Elapsed Time - data->WriteByteSeq(guidBytes1[2]); + data->WriteByteSeq(playerGuid[2]); *data << uint32(getMSTimeDiff(bg->GetRemainingTime(), Time2)); // Remaining Time - data->WriteByteSeq(guidBytes1[0]); - data->WriteByteSeq(guidBytes1[3]); - data->WriteByteSeq(guidBytes1[2]); + data->WriteByteSeq(playerGuid[0]); + data->WriteByteSeq(playerGuid[3]); + data->WriteByteSeq(playerGuid[2]); *data << uint32(bg->GetClientInstanceID()); // Client Instance ID - data->WriteByteSeq(guidBytes2[0]); - data->WriteByteSeq(guidBytes1[7]); + data->WriteByteSeq(bgGuid[0]); + data->WriteByteSeq(playerGuid[7]); break; } case STATUS_WAIT_LEAVE: @@ -422,7 +424,7 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg) data->WriteBit(guid[5]); data->WriteBit(guid[1]); data->WriteBit(guid[6]); - data->WriteBit(player->GetTeam() == ALLIANCE); + data->WriteBit(player->GetBGTeam() == ALLIANCE); data->WriteBit(guid[7]); buff << uint32(itr2->second->HealingDone); // healing done @@ -1215,8 +1217,6 @@ void BattlegroundMgr::SendToBattleground(Player* player, uint32 instanceId, Batt float x, y, z, O; uint32 mapid = bg->GetMapId(); uint32 team = player->GetBGTeam(); - if (team == 0) - team = player->GetTeam(); bg->GetTeamStartLoc(team, x, y, z, O); sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BattlegroundMgr::SendToBattleground: Sending %s to map %u, X %f, Y %f, Z %f, O %f (bgType %u)", player->GetName(), mapid, x, y, z, O, bgTypeId); -- cgit v1.2.3 From eed7c46f4ee954255e8d01c9feac9d5b1c5b060a Mon Sep 17 00:00:00 2001 From: Shocker Date: Sun, 28 Oct 2012 00:38:11 +0300 Subject: Core/Spells: Remove hack for Glyph of Barkskin --- src/server/game/Entities/Unit/Unit.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 01207b6bf2f..54aa1da2c39 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -2568,12 +2568,7 @@ float Unit::GetUnitCriticalChance(WeaponAttackType attackType, const Unit* victi // reduce crit chance from Rating for players if (attackType != RANGED_ATTACK) - { ApplyResilience(victim, &crit, NULL, false, CR_CRIT_TAKEN_MELEE); - // Glyph of barkskin - if (victim->HasAura(63057) && victim->HasAura(22812)) - crit -= 25.0f; - } else ApplyResilience(victim, &crit, NULL, false, CR_CRIT_TAKEN_RANGED); -- cgit v1.2.3 From 02c182a1ce2b7790e7404199c7b7618ac55ce270 Mon Sep 17 00:00:00 2001 From: Shocker Date: Sun, 28 Oct 2012 04:19:37 +0200 Subject: Core/Spells: Remove unneeded hack for Focus Magic proc --- src/server/game/Entities/Unit/Unit.cpp | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 54aa1da2c39..879b6bcf078 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -4797,27 +4797,6 @@ bool Unit::HandleSpellCritChanceAuraProc(Unit* victim, uint32 /*damage*/, AuraEf Unit* target = victim; int32 basepoints0 = 0; - switch (triggeredByAuraSpell->SpellFamilyName) - { - case SPELLFAMILY_MAGE: - { - switch (triggeredByAuraSpell->Id) - { - // Focus Magic - case 54646: - { - Unit* caster = triggeredByAura->GetCaster(); - if (!caster) - return false; - - triggered_spell_id = 54648; - target = caster; - break; - } - } - } - } - // processed charge only counting case if (!triggered_spell_id) return true; @@ -4826,7 +4805,7 @@ bool Unit::HandleSpellCritChanceAuraProc(Unit* victim, uint32 /*damage*/, AuraEf if (!triggerEntry) { - sLog->outError(LOG_FILTER_UNITS, "Unit::HandleHasteAuraProc: Spell %u has non-existing triggered spell %u", triggeredByAuraSpell->Id, triggered_spell_id); + sLog->outError(LOG_FILTER_UNITS, "Unit::HandleSpellCritChanceAuraProc: Spell %u has non-existing triggered spell %u", triggeredByAuraSpell->Id, triggered_spell_id); return false; } -- cgit v1.2.3 From b2cb0d62ba73122a599ca73a81d288415c59aa47 Mon Sep 17 00:00:00 2001 From: Shocker Date: Sun, 28 Oct 2012 21:17:10 +0200 Subject: Core/Misc: Improve structure for SMSG_RAID_INSTANCE_INFO --- src/server/game/Entities/Player/Player.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 6b202513103..3dabb81a98b 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -18394,14 +18394,20 @@ void Player::SendRaidInfo() if (itr->second.perm) { InstanceSave* save = itr->second.save; + bool isHeroic = save->GetDifficulty() == RAID_DIFFICULTY_10MAN_HEROIC || save->GetDifficulty() == RAID_DIFFICULTY_25MAN_HEROIC; + uint32 completedEncounters = 0; + if (Map* map = sMapMgr->FindMap(save->GetMapId(), save->GetInstanceId())) + if (InstanceScript* instanceScript = ((InstanceMap*)map)->GetInstanceScript()) + completedEncounters = instanceScript->GetCompletedEncounterMask(); + data << uint32(save->GetMapId()); // map id data << uint32(save->GetDifficulty()); // difficulty - data << uint32(0); // Unknown 4.2.2 + data << uint32(isHeroic); // heroic data << uint64(save->GetInstanceId()); // instance id data << uint8(1); // expired = 0 data << uint8(0); // extended = 1 data << uint32(save->GetResetTime() - now); // reset time - data << uint32(0); // Unknown 4.2.2 + data << uint32(completedEncounters); // completed encounters mask ++counter; } } -- cgit v1.2.3 From 59a828b49ed1e07bd5d705e3d3aa1a6d110be8fc Mon Sep 17 00:00:00 2001 From: Shocker Date: Mon, 29 Oct 2012 00:37:08 +0200 Subject: Core/Arena: Fix arena team existing name checking on team create --- src/server/game/Battlegrounds/ArenaTeam.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Battlegrounds/ArenaTeam.cpp b/src/server/game/Battlegrounds/ArenaTeam.cpp index c2512d71579..9ebe47e61f4 100755 --- a/src/server/game/Battlegrounds/ArenaTeam.cpp +++ b/src/server/game/Battlegrounds/ArenaTeam.cpp @@ -46,7 +46,7 @@ bool ArenaTeam::Create(uint64 captainGuid, uint8 type, std::string teamName, uin return false; // Check if arena team name is already taken - if (sArenaTeamMgr->GetArenaTeamByName(TeamName)) + if (sArenaTeamMgr->GetArenaTeamByName(teamName)) return false; // Generate new arena team id -- cgit v1.2.3 From b28499ac77b9321d39c5631a0408fd859882fd8b Mon Sep 17 00:00:00 2001 From: kaelima Date: Fri, 2 Nov 2012 00:17:59 +0100 Subject: Core/Protocol: Enabled a couple of (confirmed) opcodes. Removed SMSG_SETUP_RESEARCH_HISTORY, as it is redundant to SMSG_RESEARCH_SETUP_HISTORY. --- src/server/game/Entities/Creature/Creature.cpp | 36 ++++++++--------- src/server/game/Entities/Player/Player.cpp | 55 ++++++++++++++++++++++---- src/server/game/Handlers/SpellHandler.cpp | 6 +-- src/server/game/Server/Protocol/Opcodes.cpp | 17 ++++---- src/server/game/Server/Protocol/Opcodes.h | 1 - src/server/game/Spells/SpellEffects.cpp | 1 + src/server/game/Tickets/TicketMgr.cpp | 5 +++ 7 files changed, 82 insertions(+), 39 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 8076372df43..a1297391a08 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -2506,9 +2506,10 @@ bool Creature::SetWalk(bool enable) return false; ObjectGuid guid = GetGUID(); + WorldPacket data; if (enable) { - WorldPacket data(SMSG_SPLINE_MOVE_SET_WALK_MODE, 9); + data.Initialize(SMSG_SPLINE_MOVE_SET_WALK_MODE, 9); data.WriteBit(guid[7]); data.WriteBit(guid[6]); data.WriteBit(guid[5]); @@ -2517,7 +2518,7 @@ bool Creature::SetWalk(bool enable) data.WriteBit(guid[4]); data.WriteBit(guid[2]); data.WriteBit(guid[0]); - data.FlushBits(); + data.WriteByteSeq(guid[4]); data.WriteByteSeq(guid[2]); data.WriteByteSeq(guid[1]); @@ -2526,11 +2527,10 @@ bool Creature::SetWalk(bool enable) data.WriteByteSeq(guid[0]); data.WriteByteSeq(guid[7]); data.WriteByteSeq(guid[3]); - SendMessageToSet(&data, false); } else { - WorldPacket data(SMSG_SPLINE_MOVE_SET_RUN_MODE, 9); + data.Initialize(SMSG_SPLINE_MOVE_SET_RUN_MODE, 9); data.WriteBit(guid[5]); data.WriteBit(guid[6]); data.WriteBit(guid[3]); @@ -2539,7 +2539,7 @@ bool Creature::SetWalk(bool enable) data.WriteBit(guid[0]); data.WriteBit(guid[4]); data.WriteBit(guid[1]); - data.FlushBits(); + data.WriteByteSeq(guid[7]); data.WriteByteSeq(guid[0]); data.WriteByteSeq(guid[4]); @@ -2548,9 +2548,9 @@ bool Creature::SetWalk(bool enable) data.WriteByteSeq(guid[1]); data.WriteByteSeq(guid[2]); data.WriteByteSeq(guid[3]); - SendMessageToSet(&data, false); } + SendMessageToSet(&data, false); return true; } @@ -2565,9 +2565,10 @@ bool Creature::SetDisableGravity(bool disable, bool packetOnly/*=false*/) return true; ObjectGuid guid = GetGUID(); + WorldPacket data; if (disable) { - WorldPacket data(SMSG_SPLINE_MOVE_GRAVITY_DISABLE, 9); + data.Initialize(SMSG_SPLINE_MOVE_GRAVITY_DISABLE, 9); data.WriteBit(guid[7]); data.WriteBit(guid[3]); data.WriteBit(guid[4]); @@ -2576,7 +2577,7 @@ bool Creature::SetDisableGravity(bool disable, bool packetOnly/*=false*/) data.WriteBit(guid[1]); data.WriteBit(guid[0]); data.WriteBit(guid[6]); - data.FlushBits(); + data.WriteByteSeq(guid[7]); data.WriteByteSeq(guid[1]); data.WriteByteSeq(guid[3]); @@ -2585,11 +2586,10 @@ bool Creature::SetDisableGravity(bool disable, bool packetOnly/*=false*/) data.WriteByteSeq(guid[2]); data.WriteByteSeq(guid[5]); data.WriteByteSeq(guid[0]); - SendMessageToSet(&data, false); } else { - WorldPacket data(SMSG_SPLINE_MOVE_GRAVITY_ENABLE, 9); + data.Initialize(SMSG_SPLINE_MOVE_GRAVITY_ENABLE, 9); data.WriteBit(guid[5]); data.WriteBit(guid[4]); data.WriteBit(guid[7]); @@ -2598,7 +2598,7 @@ bool Creature::SetDisableGravity(bool disable, bool packetOnly/*=false*/) data.WriteBit(guid[6]); data.WriteBit(guid[2]); data.WriteBit(guid[0]); - data.FlushBits(); + data.WriteByteSeq(guid[7]); data.WriteByteSeq(guid[3]); data.WriteByteSeq(guid[4]); @@ -2607,9 +2607,9 @@ bool Creature::SetDisableGravity(bool disable, bool packetOnly/*=false*/) data.WriteByteSeq(guid[6]); data.WriteByteSeq(guid[0]); data.WriteByteSeq(guid[5]); - SendMessageToSet(&data, false); } + SendMessageToSet(&data, false); return true; } @@ -2629,9 +2629,10 @@ bool Creature::SetHover(bool enable) //! Not always a packet is sent ObjectGuid guid = GetGUID(); + WorldPacket data; if (enable) { - WorldPacket data(SMSG_SPLINE_MOVE_SET_HOVER, 9); + data.Initialize(SMSG_SPLINE_MOVE_SET_HOVER, 9); data.WriteBit(guid[3]); data.WriteBit(guid[7]); data.WriteBit(guid[0]); @@ -2640,7 +2641,7 @@ bool Creature::SetHover(bool enable) data.WriteBit(guid[6]); data.WriteBit(guid[2]); data.WriteBit(guid[5]); - data.FlushBits(); + data.WriteByteSeq(guid[2]); data.WriteByteSeq(guid[4]); data.WriteByteSeq(guid[3]); @@ -2649,11 +2650,10 @@ bool Creature::SetHover(bool enable) data.WriteByteSeq(guid[0]); data.WriteByteSeq(guid[5]); data.WriteByteSeq(guid[6]); - SendMessageToSet(&data, false); } else { - WorldPacket data(SMSG_SPLINE_MOVE_UNSET_HOVER, 9); + data.Initialize(SMSG_SPLINE_MOVE_UNSET_HOVER, 9); data.WriteBit(guid[6]); data.WriteBit(guid[7]); data.WriteBit(guid[4]); @@ -2662,7 +2662,7 @@ bool Creature::SetHover(bool enable) data.WriteBit(guid[1]); data.WriteBit(guid[5]); data.WriteBit(guid[2]); - data.FlushBits(); + data.WriteByteSeq(guid[4]); data.WriteByteSeq(guid[5]); data.WriteByteSeq(guid[3]); @@ -2671,8 +2671,8 @@ bool Creature::SetHover(bool enable) data.WriteByteSeq(guid[7]); data.WriteByteSeq(guid[6]); data.WriteByteSeq(guid[1]); - SendMessageToSet(&data, false); } + SendMessageToSet(&data, false); return true; } diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 65050753bb2..459cd030b40 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -26087,9 +26087,53 @@ void Player::SendMovementSetCanTransitionBetweenSwimAndFly(bool apply) void Player::SendMovementSetHover(bool apply) { - WorldPacket data(apply ? SMSG_MOVE_SET_HOVER : SMSG_MOVE_UNSET_HOVER, 12); - data.append(GetPackGUID()); - data << uint32(0); //! movement counter + ObjectGuid guid = GetGUID(); + WorldPacket data; + if (apply) + { + data.Initialize(SMSG_MOVE_SET_HOVER, 12); + data.WriteBit(guid[1]); + data.WriteBit(guid[4]); + data.WriteBit(guid[2]); + data.WriteBit(guid[3]); + data.WriteBit(guid[0]); + data.WriteBit(guid[5]); + data.WriteBit(guid[6]); + data.WriteBit(guid[7]); + + data.WriteByteSeq(guid[5]); + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[6]); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[7]); + data << uint32(0); // movement counter + } + else + { + data.Initialize(SMSG_MOVE_UNSET_HOVER, 12); + data.WriteBit(guid[4]); + data.WriteBit(guid[6]); + data.WriteBit(guid[3]); + data.WriteBit(guid[1]); + data.WriteBit(guid[2]); + data.WriteBit(guid[7]); + data.WriteBit(guid[5]); + data.WriteBit(guid[0]); + + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[5]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[6]); + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[0]); + data << uint32(0); // movement counter + } + SendDirectMessage(&data); } @@ -26112,9 +26156,7 @@ void Player::SendMovementSetWaterWalking(bool apply) data.WriteByteSeq(guid[0]); data.WriteByteSeq(guid[5]); data.WriteByteSeq(guid[2]); - data << uint32(0); //! movement counter - data.WriteByteSeq(guid[7]); data.WriteByteSeq(guid[3]); data.WriteByteSeq(guid[4]); @@ -26141,7 +26183,6 @@ void Player::SendMovementSetWaterWalking(bool apply) data.WriteByteSeq(guid[0]); data.WriteByteSeq(guid[3]); data.WriteByteSeq(guid[2]); - data << uint32(0); //! movement counter } SendDirectMessage(&data); @@ -26167,9 +26208,7 @@ void Player::SendMovementSetFeatherFall(bool apply) data.WriteByteSeq(guid[5]); data.WriteByteSeq(guid[7]); data.WriteByteSeq(guid[2]); - data << uint32(0); //! movement counter - data.WriteByteSeq(guid[0]); data.WriteByteSeq(guid[3]); data.WriteByteSeq(guid[4]); diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp index 9bfc5ffa87e..33824fa0b49 100755 --- a/src/server/game/Handlers/SpellHandler.cpp +++ b/src/server/game/Handlers/SpellHandler.cpp @@ -552,8 +552,9 @@ void WorldSession::HandleTotemDestroyed(WorldPacket& recvPacket) return; uint8 slotId; - + uint64 guid; recvPacket >> slotId; + recvPacket >> guid; ++slotId; if (slotId >= MAX_TOTEM_SLOT) @@ -563,8 +564,7 @@ void WorldSession::HandleTotemDestroyed(WorldPacket& recvPacket) return; Creature* totem = GetPlayer()->GetMap()->GetCreature(_player->m_SummonSlot[slotId]); - - if (totem && totem->isTotem()) + if (totem && totem->isTotem() && totem->GetGUID() == guid) totem->ToTotem()->UnSummon(); } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 5a2ea0f5746..a69b4cc91c3 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -220,12 +220,12 @@ void OpcodeTable::Initialize() DEFINE_OPCODE_HANDLER(CMSG_GET_MIRRORIMAGE_DATA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMirrorImageDataRequest ); DEFINE_OPCODE_HANDLER(CMSG_GMRESPONSE_RESOLVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMResponseResolve ); DEFINE_OPCODE_HANDLER(CMSG_GMSURVEY_SUBMIT, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleGMSurveySubmit ); - DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_CREATE, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketCreateOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_DELETETICKET, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketDeleteOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_CREATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketCreateOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_DELETETICKET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketDeleteOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_GETTICKET, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketGetTicketOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_SYSTEMSTATUS, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketSystemStatusOpcode); - DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_UPDATETEXT, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketUpdateOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_GM_REPORT_LAG, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleReportLag ); + DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_SYSTEMSTATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketSystemStatusOpcode); + DEFINE_OPCODE_HANDLER(CMSG_GMTICKET_UPDATETEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGMTicketUpdateOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_GM_REPORT_LAG, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleReportLag ); DEFINE_OPCODE_HANDLER(CMSG_GOSSIP_HELLO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGossipHelloOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GOSSIP_SELECT_OPTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGossipSelectOptionOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GRANT_LEVEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGrantLevel ); @@ -526,7 +526,7 @@ void OpcodeTable::Initialize() DEFINE_OPCODE_HANDLER(CMSG_TIME_SYNC_RESP, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleTimeSyncResp ); DEFINE_OPCODE_HANDLER(CMSG_TIME_SYNC_RESP_FAILED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_TOGGLE_PVP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTogglePvP ); - DEFINE_OPCODE_HANDLER(CMSG_TOTEM_DESTROYED, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleTotemDestroyed ); + DEFINE_OPCODE_HANDLER(CMSG_TOTEM_DESTROYED, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTotemDestroyed ); DEFINE_OPCODE_HANDLER(CMSG_TRAINER_BUY_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerBuySpellOpcode ); DEFINE_OPCODE_HANDLER(CMSG_TRAINER_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerListOpcode ); DEFINE_OPCODE_HANDLER(CMSG_TRANSMOGRIFY_ITEMS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleTransmogrifyItems ); @@ -1000,7 +1000,7 @@ void OpcodeTable::Initialize() DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_COMPOUND_STATE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_FLIGHT_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_FLIGHT_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_HOVER, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_PITCH_RATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_RUN_BACK_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_RUN_SPEED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1011,7 +1011,7 @@ void OpcodeTable::Initialize() DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_HOVER, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_UNSET_HOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_COLLISION_HEIGHT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_FLIGHT_BACK_SPEED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_UPDATE_KNOCK_BACK, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1677,7 +1677,6 @@ void OpcodeTable::Initialize() //DEFINE_OPCODE_HANDLER(SMSG_SERVERINFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SERVER_BUCK_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SERVER_BUCK_DATA_START, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_SETUP_RESEARCH_HISTORY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SET_EXTRA_AURA_INFO_NEED_UPDATE_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SET_EXTRA_AURA_INFO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_SHOW_MAILBOX, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 379ea2542ca..006ef8fa133 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -1243,7 +1243,6 @@ enum Opcodes SMSG_SERVER_INFO_RESPONSE = 0x74B5, SMSG_SERVER_MESSAGE = 0x6C04, SMSG_SERVER_PERF = 0x74B6, - SMSG_SETUP_RESEARCH_HISTORY = 0x0000, SMSG_SET_AI_ANIM_KIT = 0x0000, SMSG_SET_DF_FAST_LAUNCH_RESULT = 0x35B6, SMSG_SET_FACTION_ATWAR = 0x4216, diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 81f1bbe7198..27abe8ebc6e 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -5845,6 +5845,7 @@ void Spell::EffectPlayMusic(SpellEffIndex effIndex) WorldPacket data(SMSG_PLAY_MUSIC, 4); data << uint32(soundid); + data << uint64(unitTarget->GetGUID()); unitTarget->ToPlayer()->GetSession()->SendPacket(&data); } diff --git a/src/server/game/Tickets/TicketMgr.cpp b/src/server/game/Tickets/TicketMgr.cpp index 334ed676660..ffcb65bb14b 100644 --- a/src/server/game/Tickets/TicketMgr.cpp +++ b/src/server/game/Tickets/TicketMgr.cpp @@ -131,6 +131,11 @@ void GmTicket::WritePacket(WorldPacket& data) const data << uint8(std::min(_escalatedStatus, TICKET_IN_ESCALATION_QUEUE)); // escalated data data << uint8(_viewed ? GMTICKET_OPENEDBYGM_STATUS_OPENED : GMTICKET_OPENEDBYGM_STATUS_NOT_OPENED); // whether or not it has been viewed + + // TODO: implement these + std::string waitTimeOverrideMessage = ""; + data << waitTimeOverrideMessage; + data << uint32(0); // waitTimeOverrideMinutes } void GmTicket::SendResponse(WorldSession* session) const -- cgit v1.2.3 From cedf0855e872ff4d38da7e69357de9781f1846c5 Mon Sep 17 00:00:00 2001 From: kaelima Date: Fri, 2 Nov 2012 00:18:44 +0100 Subject: Core/Handlers: Fixed CharFactionOrRaceChange for goblins/worgens after merge --- src/server/game/Handlers/CharacterHandler.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 04334315427..a285b38f46f 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -1820,6 +1820,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) case RACE_UNDEAD_PLAYER: case RACE_TROLL: case RACE_BLOODELF: + case RACE_GOBLIN: team = TEAM_HORDE; break; default: @@ -1864,6 +1865,9 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) case RACE_NIGHTELF: stmt->setUInt16(1, 113); break; + case RACE_WORGEN: + stmt->setUInt16(1, 791); + break; case RACE_UNDEAD_PLAYER: stmt->setUInt16(1, 673); break; @@ -1876,6 +1880,9 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) case RACE_BLOODELF: stmt->setUInt16(1, 137); break; + case RACE_GOBLIN: + stmt->setUInt16(1, 792); + break; } trans->Append(stmt); @@ -1943,16 +1950,16 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) // Delete record of the faction old completed quests { std::ostringstream quests; - ObjectMgr::QuestMap const& qTemplates = sObjectMgr->GetQuestTemplates(); - for (ObjectMgr::QuestMap::const_iterator iter = qTemplates.begin(); iter != qTemplates.end(); ++iter) + ObjectMgr::QuestMap const& questTemplate = sObjectMgr->GetQuestTemplates(); + for (ObjectMgr::QuestMap::const_iterator iter = questTemplate.begin(); iter != questTemplate.end(); ++iter) { - Quest *qinfo = iter->second; - uint32 requiredRaces = qinfo->GetRequiredRaces(); + Quest* questInfo = iter->second; + uint32 requiredRaces = questInfo->GetRequiredRaces(); if (team == TEAM_ALLIANCE) { if (requiredRaces & RACEMASK_ALLIANCE) { - quests << uint32(qinfo->GetQuestId()); + quests << uint32(questInfo->GetQuestId()); quests << ','; } } @@ -1960,7 +1967,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) { if (requiredRaces & RACEMASK_HORDE) { - quests << uint32(qinfo->GetQuestId()); + quests << uint32(questInfo->GetQuestId()); quests << ','; } } -- cgit v1.2.3 From c6ce7bc9fd7a44acc18b50ec9aa933b96ff8799d Mon Sep 17 00:00:00 2001 From: Shocker Date: Sat, 3 Nov 2012 21:27:00 +0200 Subject: Core/Misc: Define CR_MASTERY combat rating --- src/server/game/Entities/Unit/Unit.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 7351d4b014b..9dae2708526 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -571,10 +571,11 @@ enum CombatRating CR_WEAPON_SKILL_OFFHAND = 21, CR_WEAPON_SKILL_RANGED = 22, CR_EXPERTISE = 23, - CR_ARMOR_PENETRATION = 24 + CR_ARMOR_PENETRATION = 24, + CR_MASTERY = 25, }; -#define MAX_COMBAT_RATING 25 +#define MAX_COMBAT_RATING 26 enum DamageEffectType { -- cgit v1.2.3 From 9659f0335f3dad4cf84dca70fa436cb4b214ba39 Mon Sep 17 00:00:00 2001 From: Spp Date: Wed, 7 Nov 2012 23:21:19 +0100 Subject: Core/Guilds: Multiple changes - Fix Delete Rank - Fix Rank order after Rank is deleted - Send correct event after Guild Tab purchase - Better debug msgs - Move news to Event Logs (internal struct is like Event Logs and Bank Event Logs). Max news configurable --- .../2012_11_07_00_characters_guild_newslog_434.sql | 21 + src/server/game/Achievements/AchievementMgr.cpp | 8 +- src/server/game/Battlegrounds/Battleground.cpp | 4 +- src/server/game/DungeonFinding/LFGQueue.cpp | 4 +- src/server/game/DungeonFinding/LFGQueue.h | 2 +- src/server/game/Entities/Player/Player.cpp | 21 +- src/server/game/Entities/Player/Player.h | 3 +- src/server/game/Globals/ObjectMgr.cpp | 4 +- src/server/game/Guilds/Guild.cpp | 454 ++++++++++++--------- src/server/game/Guilds/Guild.h | 153 ++++--- src/server/game/Guilds/GuildMgr.cpp | 54 ++- src/server/game/Handlers/AuctionHouseHandler.cpp | 4 +- src/server/game/Handlers/BattleGroundHandler.cpp | 2 +- src/server/game/Handlers/ChatHandler.cpp | 3 +- src/server/game/Handlers/GuildHandler.cpp | 259 ++++++------ src/server/game/Handlers/ItemHandler.cpp | 2 +- src/server/game/Handlers/MailHandler.cpp | 20 +- src/server/game/Handlers/MovementHandler.cpp | 2 +- src/server/game/Miscellaneous/SharedDefines.h | 8 +- src/server/game/Spells/Spell.cpp | 2 +- src/server/game/Spells/SpellEffects.cpp | 9 +- src/server/game/World/World.cpp | 3 + src/server/game/World/World.h | 1 + src/server/scripts/Spells/spell_shaman.cpp | 2 +- .../Database/Implementation/CharacterDatabase.cpp | 6 +- .../Database/Implementation/CharacterDatabase.h | 3 +- src/server/worldserver/worldserver.conf.dist | 10 + 27 files changed, 598 insertions(+), 466 deletions(-) create mode 100644 sql/updates/characters/2012_11_07_00_characters_guild_newslog_434.sql (limited to 'src') diff --git a/sql/updates/characters/2012_11_07_00_characters_guild_newslog_434.sql b/sql/updates/characters/2012_11_07_00_characters_guild_newslog_434.sql new file mode 100644 index 00000000000..1504bd3b6e5 --- /dev/null +++ b/sql/updates/characters/2012_11_07_00_characters_guild_newslog_434.sql @@ -0,0 +1,21 @@ +-- Rename table and column to fit the other guild_*log tables and columns and create indexes +RENAME TABLE `guild_news_log` TO `guild_newslog`; + +ALTER TABLE `guild_newslog` +CHANGE COLUMN `guild` `guildid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Guild Identificator', +CHANGE COLUMN `id` `LogGuid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Log record identificator - auxiliary column', +CHANGE COLUMN `eventType` `EventType` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT 'Event type', +CHANGE COLUMN `playerGuid` `PlayerGuid` int(10) unsigned NOT NULL DEFAULT '0', +CHANGE COLUMN `data` `Value` int(10) unsigned NOT NULL DEFAULT '0', +CHANGE COLUMN `flags` `Flags` int(10) unsigned NOT NULL DEFAULT '0' AFTER `PlayerGuid`, +CHANGE COLUMN `date` `TimeStamp` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Event UNIX time', +ADD KEY `guildid_key` (`guildid`), +ADD KEY `Idx_PlayerGuid` (`PlayerGuid`), +ADD KEY `Idx_LogGuid` (`LogGuid`); + +-- Create missing tabs + +ALTER TABLE `guild_member_withdraw` +ADD COLUMN `tab6` int(10) unsigned NOT NULL DEFAULT '0' AFTER `tab5`, +ADD COLUMN `tab7` int(10) unsigned NOT NULL DEFAULT '0' AFTER `tab6`; + diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index c5aabff7db6..356be60909d 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -1852,8 +1852,8 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achiev return; if (achievement->flags & ACHIEVEMENT_FLAG_SHOW_IN_GUILD_NEWS) - if (Guild* guild = sGuildMgr->GetGuildById(referencePlayer->GetGuildId())) - guild->GetNewsLog().AddNewEvent(GUILD_NEWS_PLAYER_ACHIEVEMENT, time(NULL), referencePlayer->GetGUID(), achievement->flags & ACHIEVEMENT_FLAG_SHOW_IN_GUILD_HEADER, achievement->ID); + if (Guild* guild = referencePlayer->GetGuild()) + guild->AddGuildNews(GUILD_NEWS_PLAYER_ACHIEVEMENT, referencePlayer->GetGUID(), achievement->flags & ACHIEVEMENT_FLAG_SHOW_IN_GUILD_HEADER, achievement->ID); if (!GetOwner()->GetSession()->PlayerLoading()) SendAchievementEarned(achievement); @@ -1933,8 +1933,8 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achieve return; if (achievement->flags & ACHIEVEMENT_FLAG_SHOW_IN_GUILD_NEWS) - if (Guild* guild = sGuildMgr->GetGuildById(referencePlayer->GetGuildId())) - guild->GetNewsLog().AddNewEvent(GUILD_NEWS_GUILD_ACHIEVEMENT, time(NULL), 0, achievement->flags & ACHIEVEMENT_FLAG_SHOW_IN_GUILD_HEADER, achievement->ID); + if (Guild* guild = referencePlayer->GetGuild()) + guild->AddGuildNews(GUILD_NEWS_GUILD_ACHIEVEMENT, 0, achievement->flags & ACHIEVEMENT_FLAG_SHOW_IN_GUILD_HEADER, achievement->ID); SendAchievementEarned(achievement); CompletedAchievementData& ca = m_completedAchievements[achievement->ID]; diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index 1e252b5b705..389873f7caf 100755 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -914,9 +914,9 @@ void Battleground::EndBattleground(uint32 winner) if (uint32 guildId = GetBgMap()->GetOwnerGuildId(player->GetTeam())) if (Guild* guild = sGuildMgr->GetGuildById(guildId)) { - guild->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_BG, 1, 0, NULL, player); + guild->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_BG, 1, 0, NULL, player); if (isArena() && isRated() && winnerArenaTeam && loserArenaTeam && winnerArenaTeam != loserArenaTeam) - guild->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA, std::max(winnerArenaTeam->GetRating(), 1), 0, NULL, player); + guild->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA, std::max(winnerArenaTeam->GetRating(), 1), 0, NULL, player); } } } diff --git a/src/server/game/DungeonFinding/LFGQueue.cpp b/src/server/game/DungeonFinding/LFGQueue.cpp index cf600b0645f..3bcd1ee5643 100644 --- a/src/server/game/DungeonFinding/LFGQueue.cpp +++ b/src/server/game/DungeonFinding/LFGQueue.cpp @@ -639,7 +639,7 @@ void LFGQueue::FindBestCompatibleInQueue(LfgQueueDataContainer::iterator itrQueu std::string sguid = o.str(); for (LfgCompatibleContainer::const_iterator itr = CompatibleMapStore.begin(); itr != CompatibleMapStore.end(); ++itr) - if (itr->second.compatibility == LFG_COMPATIBLES_WITH_LESS_PLAYERS && + if (itr->second.compatibility == LFG_COMPATIBLES_WITH_LESS_PLAYERS && std::string::npos != itr->first.find(sguid)) { UpdateBestCompatibleInQueue(itrQueue, itr->first, itr->second.roles); @@ -650,7 +650,7 @@ void LFGQueue::UpdateBestCompatibleInQueue(LfgQueueDataContainer::iterator itrQu { LfgQueueData& queueData = itrQueue->second; - uint8 storedSize = queueData.bestCompatible.empty() ? 0 : + uint8 storedSize = queueData.bestCompatible.empty() ? 0 : std::count(queueData.bestCompatible.begin(), queueData.bestCompatible.end(), '|') + 1; uint8 size = std::count(key.begin(), key.end(), '|') + 1; diff --git a/src/server/game/DungeonFinding/LFGQueue.h b/src/server/game/DungeonFinding/LFGQueue.h index f937ac0d21a..e6ba038a9e6 100644 --- a/src/server/game/DungeonFinding/LFGQueue.h +++ b/src/server/game/DungeonFinding/LFGQueue.h @@ -42,7 +42,7 @@ struct LfgCompatibilityData compatibility(_compatibility), roles(_roles) { } LfgCompatibility compatibility; - LfgRolesMap roles; + LfgRolesMap roles; }; /// Stores player or group queue info diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 1de1a453d86..b6974082604 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -515,7 +515,7 @@ inline void KillRewarder::_RewardXP(Player* player, float rate) // 4.2.3. Calculate expansion penalty if (_victim->GetTypeId() == TYPEID_UNIT && player->getLevel() >= GetMaxLevelForExpansion(_victim->ToCreature()->GetCreatureTemplate()->expansion)) xp = CalculatePct(xp, 10); // Players get only 10% xp for killing creatures of lower expansion levels than himself - + // 4.2.4. Give XP to player. player->GiveXP(xp, _victim, _groupRate); if (Pet* pet = player->GetPet()) @@ -635,7 +635,7 @@ void KillRewarder::Reward() if (uint32 guildId = victim->GetMap()->GetOwnerGuildId()) if (Guild* guild = sGuildMgr->GetGuildById(guildId)) - guild->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE, victim->GetEntry(), 1, victim, _killer); + guild->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE, victim->GetEntry(), 1, victim, _killer); } } @@ -21440,8 +21440,8 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32 if (crItem->maxcount != 0) // bought { if (pProto->Quality > ITEM_QUALITY_EPIC || (pProto->Quality == ITEM_QUALITY_EPIC && pProto->ItemLevel >= MinNewsItemLevel[sWorld->getIntConfig(CONFIG_EXPANSION)])) - if (Guild* guild = sGuildMgr->GetGuildById(GetGuildId())) - guild->GetNewsLog().AddNewEvent(GUILD_NEWS_ITEM_PURCHASED, time(NULL), GetGUID(), 0, item); + if (Guild* guild = GetGuild()) + guild->AddGuildNews(GUILD_NEWS_ITEM_PURCHASED, GetGUID(), 0, item); return true; } @@ -24189,10 +24189,10 @@ void Player::StoreLootItem(uint8 lootSlot, Loot* loot) --loot->unlootedCount; - if (const ItemTemplate* proto = sObjectMgr->GetItemTemplate(item->itemid)) + if (ItemTemplate const* proto = sObjectMgr->GetItemTemplate(item->itemid)) if (proto->Quality > ITEM_QUALITY_EPIC || (proto->Quality == ITEM_QUALITY_EPIC && proto->ItemLevel >= MinNewsItemLevel[sWorld->getIntConfig(CONFIG_EXPANSION)])) - if (Guild* guild = sGuildMgr->GetGuildById(GetGuildId())) - guild->GetNewsLog().AddNewEvent(GUILD_NEWS_ITEM_LOOTED, time(NULL), GetGUID(), 0, item->itemid); + if (Guild* guild = GetGuild()) + guild->AddGuildNews(GUILD_NEWS_ITEM_LOOTED, GetGUID(), 0, item->itemid); SendNewItem(newitem, uint32(item->count), false, false, true); UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM, item->itemid, item->count); @@ -24499,6 +24499,11 @@ void Player::SendRespondInspectAchievements(Player* player) const m_achievementMgr.SendAchievementInfo(player); } +uint32 Player::GetAchievementPoints() const +{ + return m_achievementMgr.GetAchievementPoints(); +} + bool Player::HasAchieved(uint32 achievementId) const { return m_achievementMgr.HasAchieved(achievementId); @@ -24529,7 +24534,7 @@ void Player::UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 mis return; if (Guild* guild = sGuildMgr->GetGuildById(GetGuildId())) - guild->GetAchievementMgr().UpdateAchievementCriteria(type, miscValue1, miscValue2, unit, this); + guild->UpdateAchievementCriteria(type, miscValue1, miscValue2, unit, this); } void Player::CompletedAchievement(AchievementEntry const* entry) diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 2bc8aeb9c10..0f1a60c5c79 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -2057,7 +2057,7 @@ class Player : public Unit, public GridObject uint32 GetGuildLevel() { return GetUInt32Value(PLAYER_GUILDLEVEL); } void SetGuildIdInvited(uint32 GuildId) { m_GuildIdInvited = GuildId; } uint32 GetGuildId() const { return GetUInt32Value(OBJECT_FIELD_DATA); /* return only lower part */ } - Guild* GetGuild(); + Guild* GetGuild(); static uint32 GetGuildIdFromDB(uint64 guid); static uint8 GetRankFromDB(uint64 guid); int GetGuildIdInvited() { return m_GuildIdInvited; } @@ -2701,6 +2701,7 @@ class Player : public Unit, public GridObject void InitRunes(); void SendRespondInspectAchievements(Player* player) const; + uint32 GetAchievementPoints() const; bool HasAchieved(uint32 achievementId) const; void ResetAchievements(); void CheckAllAchievementCriteria(); diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 146654d69af..edf5aba1305 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -8652,7 +8652,7 @@ void ObjectMgr::LoadFactionChangeTitles() } uint32 count = 0; - + do { Field* fields = result->Fetch(); @@ -8666,7 +8666,7 @@ void ObjectMgr::LoadFactionChangeTitles() sLog->outError(LOG_FILTER_SQL, "Title %u referenced in `player_factionchange_title` does not exist, pair skipped!", horde); else FactionChange_Titles[alliance] = horde; - + ++count; } while (result->NextRow()); diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 0a8267652c6..2f9d4d3b8ec 100644 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -267,6 +267,55 @@ void Guild::BankEventLogEntry::WritePacket(WorldPacket& data, ByteBuffer& conten content << uint8(m_destTabId); } +void Guild::NewsLogEntry::SaveToDB(SQLTransaction& trans) const +{ + uint8 index = 0; + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GUILD_NEWS); + stmt->setUInt32( index, m_guildId); + stmt->setUInt32(++index, GetGUID()); + stmt->setUInt8 (++index, GetType()); + stmt->setUInt32(++index, GetPlayerGuid()); + stmt->setUInt32(++index, GetFlags()); + stmt->setUInt32(++index, GetValue()); + stmt->setUInt64(++index, GetTimestamp()); + CharacterDatabase.ExecuteOrAppend(trans, stmt); +} + +void Guild::NewsLogEntry::WritePacket(WorldPacket& data, ByteBuffer& /*content*/) const +{ + data.WriteBits(0, 26); // Not yet implemented used for guild achievements + ObjectGuid guid = GetPlayerGuid(); + + data.WriteBit(guid[7]); + data.WriteBit(guid[0]); + data.WriteBit(guid[6]); + data.WriteBit(guid[5]); + data.WriteBit(guid[4]); + data.WriteBit(guid[3]); + data.WriteBit(guid[1]); + data.WriteBit(guid[2]); + + data.FlushBits(); + + data.WriteByteSeq(guid[5]); + + data << uint32(GetFlags()); // 1 sticky + data << uint32(GetValue()); + data << uint32(0); // always 0 + + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[6]); + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[1]); + + data << uint32(GetGUID()); + data << uint32(GetType()); + data.AppendPackedTime(GetTimestamp()); +} + // RankInfo void Guild::RankInfo::LoadFromDB(Field* fields) { @@ -514,13 +563,13 @@ void Guild::BankTab::SendText(Guild const* guild, WorldSession* session) const if (session) { - sLog->outDebug(LOG_FILTER_GUILD, "MSG_QUERY_GUILD_BANK_TEXT [%s]: Tabid: %u, Text: %s" + sLog->outDebug(LOG_FILTER_GUILD, "SMSG_GUILD_BANK_QUERY_TEXT_RESULT [%s]: Tabid: %u, Text: %s" , session->GetPlayerInfo().c_str(), m_tabId, m_text.c_str()); session->SendPacket(&data); } else { - sLog->outDebug(LOG_FILTER_GUILD, "MSG_QUERY_GUILD_BANK_TEXT [Broadcast]: Tabid: %u, Text: %s", m_tabId, m_text.c_str()); + sLog->outDebug(LOG_FILTER_GUILD, "SMSG_GUILD_BANK_QUERY_TEXT_RESULT [Broadcast]: Tabid: %u, Text: %s", m_tabId, m_text.c_str()); guild->BroadcastPacket(&data); } } @@ -533,15 +582,17 @@ void Guild::Member::SetStats(Player* player) m_class = player->getClass(); m_zoneId = player->GetZoneId(); m_accountId = player->GetSession()->GetAccountId(); + m_achievementPoints = player->GetAchievementPoints(); } -void Guild::Member::SetStats(std::string const& name, uint8 level, uint8 _class, uint32 zoneId, uint32 accountId) +void Guild::Member::SetStats(std::string const& name, uint8 level, uint8 _class, uint32 zoneId, uint32 accountId, uint32 reputation) { m_name = name; m_level = level; m_class = _class; m_zoneId = zoneId; m_accountId = accountId; + m_totalReputation = reputation; } void Guild::Member::SetPublicNote(std::string const& publicNote) @@ -610,8 +661,12 @@ bool Guild::Member::LoadFromDB(Field* fields) fields[15].GetUInt8(), // characters.level fields[16].GetUInt8(), // characters.class fields[17].GetUInt16(), // characters.zone - fields[18].GetUInt32()); // characters.account + fields[18].GetUInt32(), // characters.account + 0); m_logoutTime = fields[19].GetUInt32(); // characters.logout_time + m_totalActivity = 0; + m_weekActivity = 0; + m_weekReputation = 0; if (!CheckStats()) return false; @@ -660,10 +715,16 @@ void Guild::Member::UpdateBankWithdrawValue(SQLTransaction& trans, uint8 tabId, CharacterDatabase.ExecuteOrAppend(trans, stmt); } -void Guild::Member::ResetValues(bool /*week*/) +void Guild::Member::ResetValues(bool weekly /* = false*/) { for (uint8 tabId = 0; tabId <= GUILD_BANK_MAX_TABS; ++tabId) m_bankWithdraw[tabId] = 0; + + if (weekly) + { + m_weekActivity = 0; + m_weekReputation = 0; + } } // Get amount of money/slots left for today. @@ -1045,8 +1106,8 @@ Guild::Guild(): m_accountsNumber(0), m_bankMoney(0), m_eventLog(NULL), + m_newsLog(NULL), m_achievementMgr(this), - _newsLog(this), _level(1), _experience(0), _todayExperience(0) @@ -1062,6 +1123,8 @@ Guild::~Guild() // Cleanup delete m_eventLog; m_eventLog = NULL; + delete m_newsLog; + m_newsLog = NULL; for (uint8 tabId = 0; tabId <= GUILD_BANK_MAX_TABS; ++tabId) { @@ -1095,6 +1158,8 @@ bool Guild::Create(Player* pLeader, std::string const& name) m_bankMoney = 0; m_createdDate = ::time(NULL); _level = 1; + _experience = 0; + _todayExperience = 0; _CreateLogHolders(); sLog->outDebug(LOG_FILTER_GUILD, "GUILD: creating guild [%s] for leader %s (%u)", @@ -1128,7 +1193,7 @@ bool Guild::Create(Player* pLeader, std::string const& name) if (ret) { - _BroadcastEvent(GE_FOUNDER, m_leaderGuid); + _BroadcastEvent(GE_FOUNDER, 0); sScriptMgr->OnGuildCreate(this, pLeader, name); } @@ -1214,6 +1279,9 @@ void Guild::UpdateMemberData(Player* player, uint8 dataid, uint32 value) case GUILD_MEMBER_DATA_ZONEID: member->SetZoneId(value); break; + case GUILD_MEMBER_DATA_ACHIEVEMENT_POINTS: + member->SetAchievementPoints(value); + break; case GUILD_MEMBER_DATA_LEVEL: member->SetLevel(value); break; @@ -1265,11 +1333,11 @@ void Guild::HandleRoster(WorldSession* session /*= NULL*/) data.WriteBit(guid[7]); memberData << uint8(member->GetClass()); - memberData << int32(0); // unk + memberData << uint32(member->GetTotalReputation()); memberData.WriteByteSeq(guid[0]); - memberData << uint64(0); // weekly activity + memberData << uint64(member->GetWeekActivity()); memberData << uint32(member->GetRankId()); - memberData << uint32(0); // player->GetAchievementMgr().GetCompletedAchievementsAmount() + memberData << uint32(member->GetAchievementPoints()); // for (2 professions) memberData << uint32(0) << uint32(0) << uint32(0); @@ -1278,9 +1346,9 @@ void Guild::HandleRoster(WorldSession* session /*= NULL*/) memberData.WriteByteSeq(guid[2]); memberData << uint8(member->GetFlags()); memberData << uint32(member->GetZoneId()); - memberData << uint64(0); // Total activity + memberData << uint64(member->GetTotalActivity()); memberData.WriteByteSeq(guid[7]); - memberData << uint32(member->GetRemainingWeeklyReputation());// Remaining guild week Rep + memberData << uint32(sWorld->getIntConfig(CONFIG_GUILD_WEEKLY_REP_CAP) - member->GetWeekReputation()); if (pubNoteLength) memberData.WriteString(member->GetPublicNote()); @@ -1371,7 +1439,6 @@ void Guild::HandleQuery(WorldSession* session) void Guild::SendGuildRankInfo(WorldSession* session) const { - // perhaps move to guild.cpp..... ByteBuffer rankData(100); WorldPacket data(SMSG_GUILD_RANK, 100); @@ -1385,7 +1452,7 @@ void Guild::SendGuildRankInfo(WorldSession* session) const data.WriteBits(rankInfo->GetName().length(), 7); - rankData << uint32(i); + rankData << uint32(rankInfo->GetId()); for (uint8 j = 0; j < GUILD_BANK_MAX_TABS; ++j) { @@ -1399,12 +1466,13 @@ void Guild::SendGuildRankInfo(WorldSession* session) const if (rankInfo->GetName().length()) rankData.WriteString(rankInfo->GetName()); - rankData << uint32(rankInfo->GetId()); + rankData << uint32(i); } data.FlushBits(); data.append(rankData); session->SendPacket(&data); + sLog->outDebug(LOG_FILTER_GUILD, "SMSG_GUILD_RANK [%s]", session->GetPlayerInfo().c_str()); } void Guild::HandleSetMOTD(WorldSession* session, std::string const& motd) @@ -1517,7 +1585,7 @@ void Guild::HandleSetMemberNote(WorldSession* session, std::string const& note, else member->SetOfficerNote(note); - HandleRoster(session); // FIXME - We should send SMSG_GUILD_SET_NOTE + HandleRoster(session); // FIXME - We should send SMSG_GUILD_MEMBER_UPDATE_NOTE } } @@ -1539,7 +1607,7 @@ void Guild::HandleSetRankInfo(WorldSession* session, uint8 rankId, std::string c char aux[2]; sprintf(aux, "%u", rankId); - _BroadcastEvent(GE_RANK_UPDATED, 0, aux, name.c_str()); + _BroadcastEvent(GE_RANK_UPDATED, 0, aux); } } @@ -1556,26 +1624,24 @@ void Guild::HandleBuyBankTab(WorldSession* session, uint8 tabId) if (_GetPurchasedTabsSize() >= GUILD_BANK_MAX_TABS) return; - if (tabId != _GetPurchasedTabsSize()) - return; - - uint32 tabCost = _GetGuildBankTabPrice(tabId) * GOLD; - if (!tabCost) - return; + if (tabId != _GetPurchasedTabsSize()) + return; + uint32 tabCost = _GetGuildBankTabPrice(tabId) * GOLD; + if (!tabCost) + return; - if (!player->HasEnoughMoney(uint64(tabCost))) // Should not happen, this is checked by client - return; + if (!player->HasEnoughMoney(uint64(tabCost))) // Should not happen, this is checked by client + return; - player->ModifyMoney(-int64(tabCost)); + player->ModifyMoney(-int64(tabCost)); uint8 rankId = member->GetRankId(); _CreateNewBankTab(); - _SetRankBankMoneyPerDay(rankId, uint32(GUILD_WITHDRAW_MONEY_UNLIMITED)); GuildBankRightsAndSlots rightsAndSlots(tabId); _SetRankBankTabRightsAndSlots(rankId, rightsAndSlots); - //HandleRoster(); // Broadcast for tab rights update - SendBankList(session, tabId, false, true); + _BroadcastEvent(GE_BANK_TAB_PURCHASED, 0); + SendPermissions(session); /// Hack to force client to update permissions } void Guild::HandleInviteMember(WorldSession* session, std::string const& name) @@ -1749,7 +1815,7 @@ void Guild::HandleRemoveMember(WorldSession* session, uint64 guid) DeleteMember(guid, false, true); _LogEvent(GUILD_EVENT_LOG_UNINVITE_PLAYER, player->GetGUIDLow(), GUID_LOPART(guid)); _BroadcastEvent(GE_REMOVED, 0, name.c_str(), player->GetName().c_str()); - SendCommandResult(session, GUILD_COMMAND_REMOVE, ERR_GUILD_COMMAND_SUCCESS, name); + SendCommandResult(session, GUILD_COMMAND_REMOVE, ERR_GUILD_COMMAND_SUCCESS, name); } } } @@ -1847,11 +1913,7 @@ void Guild::HandleAddNewRank(WorldSession* session, std::string const& name) // Only leader can add new rank if (_IsLeader(session->GetPlayer())) if (_CreateRank(name, GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK)) - { - char aux[2]; - sprintf(aux, "%u", size); - _BroadcastEvent(GE_RANK_CREATED, 0, aux, name.c_str()); - } + _BroadcastEvent(GE_RANK_CREATED, 0); } void Guild::HandleRemoveRank(WorldSession* session, uint8 rankId) @@ -1860,18 +1922,18 @@ void Guild::HandleRemoveRank(WorldSession* session, uint8 rankId) if (_GetRanksSize() <= GUILD_RANKS_MIN_COUNT || rankId >= _GetRanksSize() || !_IsLeader(session->GetPlayer())) return; - // Delete bank rights for rank - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_BANK_RIGHTS_FOR_RANK); - stmt->setUInt32(0, m_id); - stmt->setUInt8(1, rankId); - CharacterDatabase.Execute(stmt); - // Delete rank - stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_RANK); - stmt->setUInt32(0, m_id); - stmt->setUInt8(1, rankId); - CharacterDatabase.Execute(stmt); + // Delete bank rights for rank + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_BANK_RIGHTS_FOR_RANK); + stmt->setUInt32(0, m_id); + stmt->setUInt8(1, rankId); + CharacterDatabase.Execute(stmt); + // Delete rank + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_RANK); + stmt->setUInt32(0, m_id); + stmt->setUInt8(1, rankId); + CharacterDatabase.Execute(stmt); - m_ranks.erase(m_ranks.begin() + rankId-1); + m_ranks.erase(m_ranks.begin() + rankId); _BroadcastEvent(GE_RANK_DELETED, rankId); } @@ -1994,6 +2056,61 @@ void Guild::SendEventLog(WorldSession* session) const sLog->outDebug(LOG_FILTER_GUILD, "SMSG_GUILD_EVENT_LOG_QUERY_RESULT [%s]", session->GetPlayerInfo().c_str()); } +void Guild::SendNewsUpdate(WorldSession* session) +{ + uint32 size = m_newsLog->GetSize(); + GuildLog* logs = m_newsLog->GetGuildLog(); + + if (!logs) + return; + + WorldPacket data(SMSG_GUILD_NEWS_UPDATE, (21 + size * (26 + 8)) / 8 + (8 + 6 * 4) * size); + data.WriteBits(size, 21); + + for (GuildLog::const_iterator itr = logs->begin(); itr != logs->end(); ++itr) + { + data.WriteBits(0, 26); // Not yet implemented used for guild achievements + ObjectGuid guid = ((NewsLogEntry*)(*itr))->GetPlayerGuid(); + + data.WriteBit(guid[7]); + data.WriteBit(guid[0]); + data.WriteBit(guid[6]); + data.WriteBit(guid[5]); + data.WriteBit(guid[4]); + data.WriteBit(guid[3]); + data.WriteBit(guid[1]); + data.WriteBit(guid[2]); + } + + data.FlushBits(); + + for (GuildLog::const_iterator itr = logs->begin(); itr != logs->end(); ++itr) + { + NewsLogEntry* news = (NewsLogEntry*)(*itr); + ObjectGuid guid = news->GetPlayerGuid(); + data.WriteByteSeq(guid[5]); + + data << uint32(news->GetFlags()); // 1 sticky + data << uint32(news->GetValue()); + data << uint32(0); + + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[6]); + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[1]); + + data << uint32(news->GetGUID()); + data << uint32(news->GetType()); + data.AppendPackedTime(news->GetTimestamp()); + } + + session->SendPacket(&data); + sLog->outDebug(LOG_FILTER_GUILD, "SMSG_GUILD_NEWS_UPDATE [%s]", session->GetPlayerInfo().c_str()); +} + void Guild::SendBankLog(WorldSession* session, uint8 tabId) const { // GUILD_BANK_MAX_TABS send by client for money log @@ -2011,8 +2128,6 @@ void Guild::SendBankLog(WorldSession* session, uint8 tabId) const } } - - void Guild::SendBankTabText(WorldSession* session, uint8 tabId) const { if (BankTab const* tab = GetBankTab(tabId)) @@ -2050,7 +2165,7 @@ void Guild::SendMoneyInfo(WorldSession* session) const return; int32 amount = _GetMemberRemainingMoney(member); - WorldPacket data(SMSG_GUILD_BANK_MONEY_WITHDRAWN, 4); + WorldPacket data(SMSG_GUILD_BANK_MONEY_WITHDRAWN, 8); data << int64(amount); session->SendPacket(&data); sLog->outDebug(LOG_FILTER_GUILD, "SMSG_GUILD_BANK_MONEY_WITHDRAWN [%s] Money: %u", session->GetPlayerInfo().c_str(), amount); @@ -2058,6 +2173,11 @@ void Guild::SendMoneyInfo(WorldSession* session) const void Guild::SendLoginInfo(WorldSession* session) { + Player* player = session->GetPlayer(); + Member* member = GetMember(player->GetGUID()); + if (!member) + return; + /* Login sequence: SMSG_GUILD_EVENT - GE_MOTD @@ -2077,13 +2197,11 @@ void Guild::SendLoginInfo(WorldSession* session) sLog->outDebug(LOG_FILTER_GUILD, "SMSG_GUILD_EVENT [%s] MOTD", session->GetPlayerInfo().c_str()); - Player* player = session->GetPlayer(); - SendGuildRankInfo(session); _BroadcastEvent(GE_SIGNED_ON, player->GetGUID(), player->GetName().c_str()); // Send to self separately, player is not in world yet and is not found by _BroadcastEvent - data.Initialize(SMSG_GUILD_EVENT, 1 + 1 + session->GetPlayer()->GetName().size() + 8); + data.Initialize(SMSG_GUILD_EVENT, 1 + 1 + player->GetName().size() + 8); data << uint8(GE_SIGNED_ON); data << uint8(1); data << player->GetName(); @@ -2099,27 +2217,14 @@ void Guild::SendLoginInfo(WorldSession* session) for (uint32 i = 0; i < sGuildPerkSpellsStore.GetNumRows(); ++i) if (GuildPerkSpellsEntry const* entry = sGuildPerkSpellsStore.LookupEntry(i)) if (entry->Level <= GetLevel()) - session->GetPlayer()->learnSpell(entry->SpellId, true); + player->learnSpell(entry->SpellId, true); - SendGuildReputationWeeklyCap(session); + SendGuildReputationWeeklyCap(session, member->GetWeekReputation()); - GetAchievementMgr().SendAllAchievementData(player); + m_achievementMgr.SendAllAchievementData(player); - if (Member* member = GetMember(player->GetGUID())) - { - member->SetStats(player); - member->AddFlag(GUILDMEMBER_STATUS_ONLINE); - } -} - -void Guild::SendGuildReputationWeeklyCap(WorldSession* session) const -{ - if (Member const* member = GetMember(session->GetPlayer()->GetGUID())) - { - WorldPacket data(SMSG_GUILD_REPUTATION_WEEKLY_CAP, 4); - data << uint32(member->GetRemainingWeeklyReputation()); - session->SendPacket(&data); - } + member->SetStats(player); + member->AddFlag(GUILDMEMBER_STATUS_ONLINE); } // Loading methods @@ -2237,6 +2342,21 @@ bool Guild::LoadBankEventLogFromDB(Field* fields) return true; } +void Guild::LoadGuildNewsLogFromDB(Field* fields) +{ + if (!m_newsLog->CanInsert()) + return; + + m_newsLog->LoadEvent(new NewsLogEntry( + m_id, // guild id + fields[1].GetUInt32(), // guid + fields[6].GetUInt32(), // timestamp //64 bits? + GuildNews(fields[2].GetUInt8()), // type + fields[3].GetUInt32(), // player guid + fields[4].GetUInt32(), // Flags + fields[5].GetUInt32())); // value +} + void Guild::LoadBankTabFromDB(Field* fields) { uint8 tabId = fields[1].GetUInt8(); @@ -2405,11 +2525,11 @@ bool Guild::AddMember(uint64 guid, uint8 rankId) std::string name; if (player) { + m_members[lowguid] = member; player->SetInGuild(m_id); player->SetGuildIdInvited(0); player->SetRank(rankId); player->SetGuildLevel(GetLevel()); - member->SetStats(player); SendLoginInfo(player->GetSession()); name = player->GetName(); } @@ -2430,17 +2550,19 @@ bool Guild::AddMember(uint64 guid, uint8 rankId) fields[1].GetUInt8(), fields[2].GetUInt8(), fields[3].GetUInt16(), - fields[4].GetUInt32()); + fields[4].GetUInt32(), + 0); ok = member->CheckStats(); } + if (!ok) { delete member; return false; } + m_members[lowguid] = member; } - m_members[lowguid] = member; SQLTransaction trans(NULL); member->SaveToDB(trans); @@ -2448,7 +2570,7 @@ bool Guild::AddMember(uint64 guid, uint8 rankId) _UpdateAccountsNumber(); _LogEvent(GUILD_EVENT_LOG_JOIN_GUILD, lowguid); _BroadcastEvent(GE_JOINED, guid, name.c_str()); - sGuildFinderMgr->RemoveMembershipRequest(player->GetGUIDLow(), GUID_LOPART(this->GetGUID())); + sGuildFinderMgr->RemoveMembershipRequest(player->GetGUIDLow(), GUID_LOPART(this->GetGUID())); // Call scripts if member was succesfully added (and stored to database) sScriptMgr->OnGuildAddMember(this, player, rankId); @@ -2507,6 +2629,7 @@ void Guild::DeleteMember(uint64 guid, bool isDisbanding, bool isKicked) player->SetInGuild(0); player->SetRank(0); player->SetGuildLevel(0); + for (uint32 i = 0; i < sGuildPerkSpellsStore.GetNumRows(); ++i) if (GuildPerkSpellsEntry const* entry = sGuildPerkSpellsStore.LookupEntry(i)) if (entry->Level <= GetLevel()) @@ -2529,7 +2652,7 @@ bool Guild::ChangeMemberRank(uint64 guid, uint8 newRank) return false; } -bool Guild::IsMember(uint64 guid) +bool Guild::IsMember(uint64 guid) const { Members::const_iterator itr = m_members.find(GUID_LOPART(guid)); return itr != m_members.end(); @@ -2577,6 +2700,7 @@ void Guild::SetBankTabText(uint8 tabId, std::string const& text) void Guild::_CreateLogHolders() { m_eventLog = new LogHolder(m_id, sWorld->getIntConfig(CONFIG_GUILD_EVENT_LOG_COUNT)); + m_newsLog = new LogHolder(m_id, sWorld->getIntConfig(CONFIG_GUILD_NEWS_LOG_COUNT)); for (uint8 tabId = 0; tabId <= GUILD_BANK_MAX_TABS; ++tabId) m_bankEventLog[tabId] = new LogHolder(m_id, sWorld->getIntConfig(CONFIG_GUILD_BANK_EVENT_LOG_COUNT)); } @@ -3222,7 +3346,8 @@ void Guild::SendGuildRanksUpdate(uint64 setterGuid, uint64 targetGuid, uint32 ra member->ChangeRank(rank); - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_GUILD_RANKS_UPDATE"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_GUILD_RANKS_UPDATE [Broadcast] Target: %u, Issuer: %u, RankId: %u", + GUID_LOPART(targetGuid), GUID_LOPART(setterGuid), rank); } void Guild::GiveXP(uint32 xp, Player* source) @@ -3275,11 +3400,11 @@ void Guild::GiveXP(uint32 xp, Player* source) } } - GetNewsLog().AddNewEvent(GUILD_NEWS_LEVEL_UP, time(NULL), 0, 0, _level); - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_GUILD_LEVEL, GetLevel(), 0, NULL, source); + AddGuildNews(GUILD_NEWS_LEVEL_UP, 0, 0, _level); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_GUILD_LEVEL, GetLevel(), 0, NULL, source); } -void Guild::SendGuildXP(WorldSession* session) const +void Guild::SendGuildXP(WorldSession* session /* = NULL */) const { //Member const* member = GetMember(session->GetGuidLow()); @@ -3292,144 +3417,81 @@ void Guild::SendGuildXP(WorldSession* session) const session->SendPacket(&data); } -void Guild::GuildNewsLog::AddNewEvent(GuildNews eventType, time_t date, uint64 playerGuid, uint32 flags, uint32 data) +void Guild::SendGuildReputationWeeklyCap(WorldSession* session, uint32 reputation) const { - uint32 id = _newsLog.size(); - - GuildNewsEntry& log = _newsLog[id]; - log.EventType = eventType; - log.PlayerGuid = playerGuid; - log.Data = data; - log.Flags = flags; - log.Date = date; - - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SAVE_GUILD_NEWS); - stmt->setUInt32(0, GetGuild()->GetId()); - stmt->setUInt32(1, id); - stmt->setUInt32(2, log.EventType); - stmt->setUInt64(3, log.PlayerGuid); - stmt->setUInt32(4, log.Data); - stmt->setUInt32(5, log.Flags); - stmt->setUInt32(6, uint32(log.Date)); - CharacterDatabase.Execute(stmt); - - WorldPacket packet; - BuildNewsData(id, log, packet); - GetGuild()->BroadcastPacket(&packet); + uint32 cap = sWorld->getIntConfig(CONFIG_GUILD_WEEKLY_REP_CAP) - reputation; + WorldPacket data(SMSG_GUILD_REPUTATION_WEEKLY_CAP, 4); + data << uint32(cap); + session->SendPacket(&data); + sLog->outDebug(LOG_FILTER_GUILD, "SMSG_GUILD_REPUTATION_WEEKLY_CAP [%s]: Left: %u", + session->GetPlayerInfo().c_str(), cap); } -void Guild::GuildNewsLog::LoadFromDB(PreparedQueryResult result) +void Guild::ResetTimes(bool weekly) { - if (!result) - return; - do + _todayExperience = 0; + for (Members::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr) { - Field* fields = result->Fetch(); - uint32 id = fields[0].GetInt32(); - GuildNewsEntry& log = _newsLog[id]; - log.EventType = GuildNews(fields[1].GetInt32()); - log.PlayerGuid = fields[2].GetInt64(); - log.Data = fields[3].GetInt32(); - log.Flags = fields[4].GetInt32(); - log.Date = time_t(fields[5].GetInt32()); + itr->second->ResetValues(weekly); + if (Player* player = itr->second->FindPlayer()) + { + //SendGuildXP(player->GetSession()); + WorldPacket data(SMSG_GUILD_MEMBER_DAILY_RESET, 0); // tells the client to request bank withdrawal limit + player->GetSession()->SendPacket(&data); + } } - while (result->NextRow()); } -void Guild::GuildNewsLog::BuildNewsData(uint32 id, GuildNewsEntry& guildNew, WorldPacket& data) +void Guild::AddGuildNews(uint8 type, uint64 guid, uint32 flags, uint32 value) { - data.Initialize(SMSG_GUILD_NEWS_UPDATE, 7 + 32); - data.WriteBits(1, 21); // size, we are only sending 1 news here + uint32 lowGuid = GUID_LOPART(guid); + NewsLogEntry* news = new NewsLogEntry(m_id, m_newsLog->GetNextGUID(), GuildNews(type), lowGuid, flags, value); - data.WriteBits(0, 26); // Not yet implemented used for guild achievements - ObjectGuid guid = guildNew.PlayerGuid; - - data.WriteBit(guid[7]); - data.WriteBit(guid[0]); - data.WriteBit(guid[6]); - data.WriteBit(guid[5]); - data.WriteBit(guid[4]); - data.WriteBit(guid[3]); - data.WriteBit(guid[1]); - data.WriteBit(guid[2]); - - data.FlushBits(); + SQLTransaction trans = CharacterDatabase.BeginTransaction(); + m_newsLog->AddEvent(trans, news); + CharacterDatabase.CommitTransaction(trans); - data.WriteByteSeq(guid[5]); + WorldPacket data(SMSG_GUILD_NEWS_UPDATE, 7 + 32); + data.WriteBits(1, 21); // size, we are only sending 1 news here + ByteBuffer buffer; + news->WritePacket(data, buffer); - data << uint32(guildNew.Flags); // 1 sticky - data << uint32(guildNew.Data); - data << uint32(0); // always 0 + BroadcastPacket(&data); +} - data.WriteByteSeq(guid[7]); - data.WriteByteSeq(guid[6]); - data.WriteByteSeq(guid[2]); - data.WriteByteSeq(guid[3]); - data.WriteByteSeq(guid[0]); - data.WriteByteSeq(guid[4]); - data.WriteByteSeq(guid[1]); +bool Guild::HasAchieved(uint32 achievementId) const +{ + return m_achievementMgr.HasAchieved(achievementId); +} - data << uint32(id); - data << uint32(guildNew.EventType); - data.AppendPackedTime(guildNew.Date); +void Guild::UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1, uint32 miscValue2, Unit* unit, Player* player) +{ + m_achievementMgr.UpdateAchievementCriteria(type, miscValue1, miscValue2, unit, player); } -void Guild::GuildNewsLog::BuildNewsData(WorldPacket& data) +void Guild::HandleNewsSetSticky(WorldSession* session, uint32 newsId, bool sticky) { - data.Initialize(SMSG_GUILD_NEWS_UPDATE, (21 + _newsLog.size() * (26 + 8)) / 8 + (8 + 6 * 4) * _newsLog.size()); - data.WriteBits(_newsLog.size(), 21); + GuildLog* logs = m_newsLog->GetGuildLog(); + GuildLog::iterator itr = logs->begin(); + while (itr != logs->end() && (*itr)->GetGUID() != newsId) + ++itr; - for (GuildNewsLogMap::const_iterator it = _newsLog.begin(); it != _newsLog.end(); it++) + if (itr == logs->end()) { - data.WriteBits(0, 26); // Not yet implemented used for guild achievements - ObjectGuid guid = it->second.PlayerGuid; - - data.WriteBit(guid[7]); - data.WriteBit(guid[0]); - data.WriteBit(guid[6]); - data.WriteBit(guid[5]); - data.WriteBit(guid[4]); - data.WriteBit(guid[3]); - data.WriteBit(guid[1]); - data.WriteBit(guid[2]); + sLog->outDebug(LOG_FILTER_GUILD, "HandleNewsSetSticky: [%s] requested unknown newsId %u - Sticky: %u", + session->GetPlayerInfo().c_str(), newsId, sticky); + return; } - data.FlushBits(); - - for (GuildNewsLogMap::const_iterator it = _newsLog.begin(); it != _newsLog.end(); it++) - { - ObjectGuid guid = it->second.PlayerGuid; - data.WriteByteSeq(guid[5]); + NewsLogEntry* news = (NewsLogEntry*)(*itr); + news->SetSticky(sticky); - data << uint32(it->second.Flags); // 1 sticky - data << uint32(it->second.Data); - data << uint32(0); + sLog->outDebug(LOG_FILTER_GUILD, "HandleNewsSetSticky: [%s] chenged newsId %u sticky to %u", + session->GetPlayerInfo().c_str(), newsId, sticky); - data.WriteByteSeq(guid[7]); - data.WriteByteSeq(guid[6]); - data.WriteByteSeq(guid[2]); - data.WriteByteSeq(guid[3]); - data.WriteByteSeq(guid[0]); - data.WriteByteSeq(guid[4]); - data.WriteByteSeq(guid[1]); - - data << uint32(it->first); - data << uint32(it->second.EventType); - data.AppendPackedTime(it->second.Date); - } -} - -void Guild::ResetTimes(bool week) -{ - _todayExperience = 0; - for (Members::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr) - { - itr->second->ResetValues(week); - if (Player* player = itr->second->FindPlayer()) - { - //SendGuildXP(player->GetSession()); - WorldPacket data(SMSG_GUILD_MEMBER_DAILY_RESET, 0); // tells the client to request bank withdrawal limit - player->GetSession()->SendPacket(&data); - } - } + WorldPacket data(SMSG_GUILD_NEWS_UPDATE, 7 + 32); + data.WriteBits(1, 21); + ByteBuffer buffer; + news->WritePacket(data, buffer); + session->SendPacket(&data); } diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h index 9a0b9e682e4..796d8359dea 100755 --- a/src/server/game/Guilds/Guild.h +++ b/src/server/game/Guilds/Guild.h @@ -33,7 +33,7 @@ enum GuildMisc GUILD_BANK_MAX_TABS = 8, // send by client for money log also GUILD_BANK_MAX_SLOTS = 98, GUILD_BANK_MONEY_LOGS_TAB = 100, // used for money log in DB - GUILD_RANKS_MIN_COUNT = 5, + GUILD_RANKS_MIN_COUNT = 2, GUILD_RANKS_MAX_COUNT = 10, GUILD_RANK_NONE = 0xFF, GUILD_WITHDRAW_MONEY_UNLIMITED = 0xFFFFFFFF, @@ -46,6 +46,7 @@ enum GuildMisc enum GuildMemberData { GUILD_MEMBER_DATA_ZONEID, + GUILD_MEMBER_DATA_ACHIEVEMENT_POINTS, GUILD_MEMBER_DATA_LEVEL, }; @@ -255,15 +256,6 @@ enum GuildNews GUILD_NEWS_LEVEL_UP = 6, }; -struct GuildNewsEntry -{ - GuildNews EventType; - time_t Date; - uint64 PlayerGuid; - uint32 Flags; - uint32 Data; -}; - struct GuildReward { uint32 Entry; @@ -275,8 +267,6 @@ struct GuildReward uint32 const MinNewsItemLevel[MAX_CONTENT] = { 61, 90, 200, 353 }; -typedef std::map GuildNewsLogMap; - // Emblem info class EmblemInfo { @@ -347,29 +337,35 @@ private: m_zoneId(0), m_level(0), m_class(0), + m_flags(GUILDMEMBER_STATUS_NONE), m_logoutTime(::time(NULL)), m_accountId(0), - m_rankId(rankId) + m_rankId(rankId), + m_achievementPoints(0), + m_totalActivity(0), + m_weekActivity(0), + m_totalReputation(0), + m_weekReputation(0) { memset(m_bankWithdraw, 0, (GUILD_BANK_MAX_TABS + 1) * sizeof(int32)); } void SetStats(Player* player); - void SetStats(std::string const& name, uint8 level, uint8 _class, uint32 zoneId, uint32 accountId); + void SetStats(std::string const& name, uint8 level, uint8 _class, uint32 zoneId, uint32 accountId, uint32 reputation); bool CheckStats() const; void SetPublicNote(std::string const& publicNote); void SetOfficerNote(std::string const& officerNote); void SetZoneId(uint32 id) { m_zoneId = id; } + void SetAchievementPoints(uint32 val) { m_achievementPoints = val; } void SetLevel(uint8 var) { m_level = var; } + void AddReputation(uint32& reputation); + void AddActivity(uint64 activity); void AddFlag(uint8 var) { m_flags |= var; } void RemFlag(uint8 var) { m_flags &= ~var; } void ResetFlags() { m_flags = GUILDMEMBER_STATUS_NONE; } - std::string GetPublicNote() { return m_publicNote; }; - std::string GetOfficerNote() { return m_officerNote; }; - bool LoadFromDB(Field* fields); void SaveToDB(SQLTransaction& trans) const; @@ -384,6 +380,12 @@ private: uint8 GetLevel() const { return m_level; } uint8 GetFlags() const { return m_flags; } uint32 GetZoneId() const { return m_zoneId; } + uint32 GetAchievementPoints() const { return m_achievementPoints; } + uint64 GetTotalActivity() const { return m_totalActivity; } + uint64 GetWeekActivity() const { return m_weekActivity; } + uint32 GetTotalReputation() const { return m_totalReputation; } + uint32 GetWeekReputation() const { return m_weekReputation; } + bool IsOnline() { return (m_flags & GUILDMEMBER_STATUS_ONLINE); } void ChangeRank(uint8 newRank); @@ -395,12 +397,10 @@ private: void UpdateBankWithdrawValue(SQLTransaction& trans, uint8 tabId, uint32 amount); int32 GetBankWithdrawValue(uint8 tabId) const; - void ResetValues(bool week); + void ResetValues(bool weekly = false); inline Player* FindPlayer() const { return ObjectAccessor::FindPlayer(m_guid); } - uint32 GetRemainingWeeklyReputation() const { return 0; } - private: uint32 m_guildId; // Fields from characters table @@ -418,30 +418,11 @@ private: std::string m_officerNote; int32 m_bankWithdraw[GUILD_BANK_MAX_TABS + 1]; - }; - - // News Log class - class GuildNewsLog - { - public: - GuildNewsLog(Guild* guild) : _guild(guild) { } - - void LoadFromDB(PreparedQueryResult result); - void BuildNewsData(WorldPacket& data); - void BuildNewsData(uint32 id, GuildNewsEntry& guildNew, WorldPacket& data); - void AddNewEvent(GuildNews eventType, time_t date, uint64 playerGuid, uint32 flags, uint32 data); - GuildNewsEntry* GetNewsById(uint32 id) - { - GuildNewsLogMap::iterator itr = _newsLog.find(id); - if (itr != _newsLog.end()) - return &itr->second; - return NULL; - } - Guild* GetGuild() const { return _guild; } - - private: - Guild* _guild; - GuildNewsLogMap _newsLog; + uint32 m_achievementPoints; + uint64 m_totalActivity; + uint64 m_weekActivity; + uint32 m_totalReputation; + uint32 m_weekReputation; }; // Base class for event entries @@ -504,11 +485,11 @@ private: return IsMoneyEvent(m_eventType); } - BankEventLogEntry(uint32 guildId, uint32 guid, GuildBankEventLogTypes eventType, uint8 tabId, uint32 playerGuid, uint32 itemOrMoney, uint16 itemStackCount, uint8 destTabId) : + BankEventLogEntry(uint32 guildId, uint32 guid, GuildBankEventLogTypes eventType, uint8 tabId, uint32 playerGuid, uint64 itemOrMoney, uint16 itemStackCount, uint8 destTabId) : LogEntry(guildId, guid), m_eventType(eventType), m_bankTabId(tabId), m_playerGuid(playerGuid), m_itemOrMoney(itemOrMoney), m_itemStackCount(itemStackCount), m_destTabId(destTabId) { } - BankEventLogEntry(uint32 guildId, uint32 guid, time_t timestamp, uint8 tabId, GuildBankEventLogTypes eventType, uint32 playerGuid, uint32 itemOrMoney, uint16 itemStackCount, uint8 destTabId) : + BankEventLogEntry(uint32 guildId, uint32 guid, time_t timestamp, uint8 tabId, GuildBankEventLogTypes eventType, uint32 playerGuid, uint64 itemOrMoney, uint16 itemStackCount, uint8 destTabId) : LogEntry(guildId, guid, timestamp), m_eventType(eventType), m_bankTabId(tabId), m_playerGuid(playerGuid), m_itemOrMoney(itemOrMoney), m_itemStackCount(itemStackCount), m_destTabId(destTabId) { } @@ -521,18 +502,52 @@ private: GuildBankEventLogTypes m_eventType; uint8 m_bankTabId; uint32 m_playerGuid; - uint32 m_itemOrMoney; + uint64 m_itemOrMoney; uint16 m_itemStackCount; uint8 m_destTabId; }; + // News log entry + class NewsLogEntry : public LogEntry + { + public: + NewsLogEntry(uint32 guildId, uint32 guid, GuildNews type, uint32 playerGuid, uint32 flags, uint32 value) : + LogEntry(guildId, guid), m_type(type), m_playerGuid(playerGuid), m_flags(flags), m_value(value) { } + + NewsLogEntry(uint32 guildId, uint32 guid, time_t timestamp, GuildNews type, uint32 playerGuid, uint32 flags, uint32 value) : + LogEntry(guildId, guid, timestamp), m_type(type), m_playerGuid(playerGuid), m_flags(flags), m_value(value) { } + + ~NewsLogEntry() { } + + GuildNews GetType() const { return m_type; } + uint64 GetPlayerGuid() const { return m_playerGuid ? MAKE_NEW_GUID(m_playerGuid, 0, HIGHGUID_PLAYER) : 0; } + uint32 GetValue() const { return m_value; } + uint32 GetFlags() const { return m_flags; } + void SetSticky(bool sticky) + { + if (sticky) + m_flags |= 1; + else + m_flags &= ~1; + } + + void SaveToDB(SQLTransaction& trans) const; + void WritePacket(WorldPacket& data, ByteBuffer& content) const; + + private: + GuildNews m_type; + uint32 m_playerGuid; + uint32 m_flags; + uint32 m_value; + }; + // Class encapsulating work with events collection typedef std::list GuildLog; class LogHolder { public: - LogHolder(uint32 guildId, uint32 maxRecords) : m_guildId(guildId), m_maxRecords(maxRecords), m_nextGUID(uint32(GUILD_EVENT_LOG_GUID_UNDEFINED)) { } + LogHolder(uint32 guildId, uint32 maxRecords) : m_guildId(guildId), m_maxRecords(maxRecords), m_nextGUID(GUILD_EVENT_LOG_GUID_UNDEFINED) { } ~LogHolder(); uint8 GetSize() const { return uint8(m_log.size()); } @@ -545,6 +560,7 @@ private: // Writes information about all events to packet void WritePacket(WorldPacket& data) const; uint32 GetNextGUID(); + GuildLog* GetGuildLog() { return &m_log; } // Hack needed for news as WritePacket can't be used private: GuildLog m_log; @@ -559,13 +575,13 @@ private: public: RankInfo(): m_guildId(0), m_rankId(GUILD_RANK_NONE), m_rights(GR_RIGHT_EMPTY), m_bankMoneyPerDay(0) { } RankInfo(uint32 guildId) : m_guildId(guildId), m_rankId(GUILD_RANK_NONE), m_rights(GR_RIGHT_EMPTY), m_bankMoneyPerDay(0) { } - RankInfo(uint32 guildId, uint32 rankId, std::string const& name, uint32 rights, uint32 money) : + RankInfo(uint32 guildId, uint8 rankId, std::string const& name, uint32 rights, uint32 money) : m_guildId(guildId), m_rankId(rankId), m_name(name), m_rights(rights), m_bankMoneyPerDay(money) { } void LoadFromDB(Field* fields); void SaveToDB(SQLTransaction& trans) const; - uint32 GetId() const { return m_rankId; } + uint8 GetId() const { return m_rankId; } std::string const& GetName() const { return m_name; } void SetName(std::string const& name); @@ -592,7 +608,7 @@ private: private: uint32 m_guildId; - uint32 m_rankId; + uint8 m_rankId; std::string m_name; uint32 m_rights; uint32 m_bankMoneyPerDay; @@ -752,7 +768,7 @@ public: std::string const& GetInfo() const { return m_info; } // Handle client commands - void HandleRoster(WorldSession* session = NULL); // NULL = broadcast + void HandleRoster(WorldSession* session = NULL); void HandleQuery(WorldSession* session); void HandleSetMOTD(WorldSession* session, std::string const& motd); void HandleSetInfo(WorldSession* session, std::string const& info); @@ -766,8 +782,8 @@ public: void HandleAcceptMember(WorldSession* session); void HandleLeaveMember(WorldSession* session); void HandleRemoveMember(WorldSession* session, uint64 guid); - void HandleUpdateMemberRank(WorldSession* session, uint64 targetGuid, bool demote); - void HandleSetMemberRank(WorldSession* session, uint64 targetGuid, uint64 setterGuid, uint32 rank); + void HandleUpdateMemberRank(WorldSession* session, uint64 guid, bool demote); + void HandleSetMemberRank(WorldSession* session, uint64 guid, uint64 setterGuid, uint32 rank); void HandleAddNewRank(WorldSession* session, std::string const& name); void HandleRemoveRank(WorldSession* session, uint8 rankId); void HandleMemberDepositMoney(WorldSession* session, uint64 amount, bool cashFlow = false); @@ -775,6 +791,7 @@ public: void HandleMemberLogout(WorldSession* session); void HandleDisband(WorldSession* session); void HandleGuildPartyRequest(WorldSession* session); + void HandleNewsSetSticky(WorldSession* session, uint32 newsId, bool sticky); void UpdateMemberData(Player* player, uint8 dataid, uint32 value); void OnPlayerStatusChange(Player* player, uint32 flag, bool state); @@ -784,15 +801,16 @@ public: void SendEventLog(WorldSession* session) const; void SendBankLog(WorldSession* session, uint8 tabId) const; void SendBankList(WorldSession* session, uint8 tabId, bool withContent, bool withTabInfo) const; - void SendGuildReputationWeeklyCap(WorldSession* session) const; - void SendGuildXP(WorldSession* session) const; + void SendGuildXP(WorldSession* session = NULL) const; void SendBankTabText(WorldSession* session, uint8 tabId) const; void SendPermissions(WorldSession* session) const; void SendMoneyInfo(WorldSession* session) const; void SendLoginInfo(WorldSession* session); + void SendNewsUpdate(WorldSession* session); // Load from DB bool LoadFromDB(Field* fields); + void LoadGuildNewsLogFromDB(Field* fields); void LoadRankFromDB(Field* fields); bool LoadMemberFromDB(Field* fields); bool LoadEventLogFromDB(Field* fields); @@ -822,7 +840,7 @@ public: bool AddMember(uint64 guid, uint8 rankId = GUILD_RANK_NONE); void DeleteMember(uint64 guid, bool isDisbanding = false, bool isKicked = false); bool ChangeMemberRank(uint64 guid, uint8 newRank); - bool IsMember(uint64 guid); + bool IsMember(uint64 guid) const; uint32 GetMembersCount() { return m_members.size(); } // Bank @@ -836,15 +854,18 @@ public: AchievementMgr const& GetAchievementMgr() const { return m_achievementMgr; } // Guild leveling - uint32 GetLevel() const { return _level; } + uint8 GetLevel() const { return _level; } void GiveXP(uint32 xp, Player* source); uint64 GetExperience() const { return _experience; } uint64 GetTodayExperience() const { return _todayExperience; } - void ResetDailyExperience(); - GuildNewsLog& GetNewsLog() { return _newsLog; } + + void AddGuildNews(uint8 type, uint64 guid, uint32 flags, uint32 value); EmblemInfo const& GetEmblemInfo() const { return m_emblemInfo; } - void ResetTimes(bool week); + void ResetTimes(bool weekly); + + bool HasAchieved(uint32 achievementId) const; + void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1, uint32 miscValue2, Unit* unit, Player* player); protected: uint32 m_id; @@ -865,11 +886,10 @@ protected: // These are actually ordered lists. The first element is the oldest entry. LogHolder* m_eventLog; LogHolder* m_bankEventLog[GUILD_BANK_MAX_TABS + 1]; - + LogHolder* m_newsLog; AchievementMgr m_achievementMgr; - GuildNewsLog _newsLog; - uint32 _level; + uint8 _level; uint64 _experience; uint64 _todayExperience; @@ -877,7 +897,7 @@ private: inline uint8 _GetRanksSize() const { return uint8(m_ranks.size()); } inline const RankInfo* GetRankInfo(uint8 rankId) const { return rankId < _GetRanksSize() ? &m_ranks[rankId] : NULL; } inline RankInfo* GetRankInfo(uint8 rankId) { return rankId < _GetRanksSize() ? &m_ranks[rankId] : NULL; } - inline bool _HasRankRight(Player* player, uint32 right) const + inline bool _HasRankRight(Player const* player, uint32 right) const { if (player) if (Member const* member = GetMember(player->GetGUID())) @@ -957,8 +977,7 @@ private: void _SendBankContentUpdate(MoveItemData* pSrc, MoveItemData* pDest) const; void _SendBankContentUpdate(uint8 tabId, SlotIds slots) const; - void _SendBankList(WorldSession* session = NULL, uint8 tabId = 0, bool sendFullSlots = false, SlotIds *slots = NULL) const; - + void SendGuildReputationWeeklyCap(WorldSession* session, uint32 reputation) const; void SendGuildRanksUpdate(uint64 setterGuid, uint64 targetGuid, uint32 rank); void _BroadcastEvent(GuildEvents guildEvent, uint64 guid, const char* param1 = NULL, const char* param2 = NULL, const char* param3 = NULL) const; diff --git a/src/server/game/Guilds/GuildMgr.cpp b/src/server/game/Guilds/GuildMgr.cpp index 38a5699510e..1cb8419be7c 100644 --- a/src/server/game/Guilds/GuildMgr.cpp +++ b/src/server/game/Guilds/GuildMgr.cpp @@ -197,13 +197,13 @@ void GuildMgr::LoadGuilds() CharacterDatabase.DirectExecute("DELETE gm FROM guild_member gm LEFT JOIN guild g ON gm.guildId = g.guildId WHERE g.guildId IS NULL"); CharacterDatabase.DirectExecute("DELETE gm FROM guild_member_withdraw gm LEFT JOIN guild_member g ON gm.guid = g.guid WHERE g.guid IS NULL"); - // 0 1 2 3 4 5 6 7 8 9 10 - QueryResult result = CharacterDatabase.Query("SELECT guildid, gm.guid, rank, pnote, offnote, w.tab0, w.tab1, w.tab2, w.tab3, w.tab4, w.tab5, " + // 0 1 2 3 4 5 6 7 8 9 10 + QueryResult result = CharacterDatabase.Query("SELECT gm.guildid, gm.guid, rank, pnote, offnote, w.tab0, w.tab1, w.tab2, w.tab3, w.tab4, w.tab5, " // 11 12 13 14 15 16 17 18 19 "w.tab6, w.tab7, w.money, c.name, c.level, c.class, c.zone, c.account, c.logout_time " "FROM guild_member gm " "LEFT JOIN guild_member_withdraw w ON gm.guid = w.guid " - "LEFT JOIN characters c ON c.guid = gm.guid ORDER BY guildid ASC"); + "LEFT JOIN characters c ON c.guid = gm.guid ORDER BY gm.guildid ASC"); if (!result) sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 guild members. DB table `guild_member` is empty."); @@ -328,7 +328,39 @@ void GuildMgr::LoadGuilds() } } - // 7. Load all guild bank tabs + // 7. Load all news event logs + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Guild News..."); + { + uint32 oldMSTime = getMSTime(); + + CharacterDatabase.DirectPExecute("DELETE FROM guild_newslog WHERE LogGuid > %u", sWorld->getIntConfig(CONFIG_GUILD_NEWS_LOG_COUNT)); + + // 0 1 2 3 4 5 6 + QueryResult result = CharacterDatabase.Query("SELECT guildid, LogGuid, EventType, PlayerGuid, Flags, Value, Timestamp FROM guild_newslog ORDER BY TimeStamp DESC, LogGuid DESC"); + + if (!result) + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 guild event logs. DB table `guild_newslog` is empty."); + else + { + uint32 count = 0; + do + { + Field* fields = result->Fetch(); + uint32 guildId = fields[0].GetUInt32(); + + if (Guild* guild = GetGuildById(guildId)) + guild->LoadGuildNewsLogFromDB(fields); + + ++count; + } + while (result->NextRow()); + + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u guild new logs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + } + } + + + // 8. Load all guild bank tabs sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading guild bank tabs..."); { uint32 oldMSTime = getMSTime(); @@ -362,7 +394,7 @@ void GuildMgr::LoadGuilds() } } - // 8. Fill all guild bank tabs + // 9. Fill all guild bank tabs sLog->outInfo(LOG_FILTER_GUILD, "Filling bank tabs with items..."); { uint32 oldMSTime = getMSTime(); @@ -398,7 +430,7 @@ void GuildMgr::LoadGuilds() } } - // 9. Load guild achievements + // 10. Load guild achievements { PreparedQueryResult achievementResult; PreparedQueryResult criteriaResult; @@ -414,16 +446,6 @@ void GuildMgr::LoadGuilds() itr->second->GetAchievementMgr().LoadFromDB(achievementResult, criteriaResult); } } - // 10. Loading Guild news - sLog->outInfo(LOG_FILTER_GENERAL, "Loading Guild News"); - { - for (GuildContainer::const_iterator itr = GuildStore.begin(); itr != GuildStore.end(); ++itr) - { - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_GUILD_NEWS); - stmt->setInt32(0, itr->first); - itr->second->GetNewsLog().LoadFromDB(CharacterDatabase.Query(stmt)); - } - } // 11. Validate loaded guild data sLog->outInfo(LOG_FILTER_GENERAL, "Validating data of loaded guilds..."); diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp index ac440b23d65..17d84295bd7 100644 --- a/src/server/game/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Handlers/AuctionHouseHandler.cpp @@ -336,8 +336,8 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recvData) AH->auctionHouseEntry = auctionHouseEntry; sLog->outInfo(LOG_FILTER_NETWORKIO, "CMSG_AUCTION_SELL_ITEM: Player %s (guid %d) is selling item %s entry %u (guid %d) to " - "auctioneer %u with count %u with initial bid " UI64FMTD " with buyout " UI64FMTD " and with time %u (in sec) in auctionhouse %u", - _player->GetName().c_str(), _player->GetGUIDLow(), newItem->GetTemplate()->Name1.c_str(), newItem->GetEntry(), + "auctioneer %u with count %u with initial bid " UI64FMTD " with buyout " UI64FMTD " and with time %u (in sec) in auctionhouse %u", + _player->GetName().c_str(), _player->GetGUIDLow(), newItem->GetTemplate()->Name1.c_str(), newItem->GetEntry(), newItem->GetGUIDLow(), AH->auctioneer, newItem->GetCount(), bid, buyout, auctionTime, AH->GetHouseId()); sAuctionMgr->AddAItem(newItem); auctionHouse->AddAuction(AH); diff --git a/src/server/game/Handlers/BattleGroundHandler.cpp b/src/server/game/Handlers/BattleGroundHandler.cpp index e2537d84149..6ad0c7c0b2b 100755 --- a/src/server/game/Handlers/BattleGroundHandler.cpp +++ b/src/server/game/Handlers/BattleGroundHandler.cpp @@ -219,7 +219,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recvData) if (grp->GetLeaderGUID() != _player->GetGUID()) return; - + err = grp->CanJoinBattlegroundQueue(bg, bgQueueTypeId, 0, bg->GetMaxPlayersPerTeam(), false, 0); isPremade = (grp->GetMembersCount() >= bg->GetMinPlayersPerTeam()); diff --git a/src/server/game/Handlers/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cpp index a82496c1335..4b830505467 100644 --- a/src/server/game/Handlers/ChatHandler.cpp +++ b/src/server/game/Handlers/ChatHandler.cpp @@ -137,7 +137,6 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) } } -<<<<<<< HEAD if (lang == LANG_ADDON) { // LANG_ADDON is only valid for the following message types @@ -164,7 +163,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) return; break; default: - sLog->outError(LOG_FILTER_NETWORKIO, "Player %s (GUID: %u) sent a chatmessage with an invalid language/message type combination", + sLog->outError(LOG_FILTER_NETWORKIO, "Player %s (GUID: %u) sent a chatmessage with an invalid language/message type combination", GetPlayer()->GetName().c_str(), GetPlayer()->GetGUIDLow()); recvData.rfinish(); diff --git a/src/server/game/Handlers/GuildHandler.cpp b/src/server/game/Handlers/GuildHandler.cpp index e27118db6ac..f97216f2169 100755 --- a/src/server/game/Handlers/GuildHandler.cpp +++ b/src/server/game/Handlers/GuildHandler.cpp @@ -33,8 +33,8 @@ void WorldSession::HandleGuildQueryOpcode(WorldPacket& recvPacket) uint64 guildGuid, playerGuid; recvPacket >> guildGuid >> playerGuid; - sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_QUERY [%s]: Guild: " UI64FMTD " Target: ", - GetPlayerInfo().c_str(), guildGuid, playerGuid); + sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_QUERY [%s]: Guild: %u Target: %u", + GetPlayerInfo().c_str(), GUID_LOPART(guildGuid), GUID_LOPART(playerGuid)); if (Guild* guild = sGuildMgr->GetGuildByGuid(guildGuid)) if (guild->IsMember(playerGuid)) @@ -74,7 +74,7 @@ void WorldSession::HandleGuildRemoveOpcode(WorldPacket& recvPacket) recvPacket.ReadByteSeq(playerGuid[3]); recvPacket.ReadByteSeq(playerGuid[0]); - sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_REMOVE [%s]: Target: " UI64FMTD, GetPlayerInfo().c_str(), playerGuid); + sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_REMOVE [%s]: Target: %u", GetPlayerInfo().c_str(), GUID_LOPART(playerGuid)); if (Guild* guild = GetPlayer()->GetGuild()) guild->HandleRemoveMember(this, playerGuid); @@ -82,7 +82,7 @@ void WorldSession::HandleGuildRemoveOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildAcceptOpcode(WorldPacket& /*recvPacket*/) { - sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_ACCEPT [%s]", GetPlayer()->GetName().c_str()); + sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_ACCEPT [%s]", GetPlayerInfo().c_str()); if (!GetPlayer()->GetGuildId()) if (Guild* guild = sGuildMgr->GetGuildById(GetPlayer()->GetGuildIdInvited())) @@ -130,7 +130,7 @@ void WorldSession::HandleGuildPromoteOpcode(WorldPacket& recvPacket) recvPacket.ReadByteSeq(targetGuid[1]); recvPacket.ReadByteSeq(targetGuid[7]); - sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_PROMOTE [%s]: Target: " UI64FMTD, GetPlayerInfo().c_str(), targetGuid); + sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_PROMOTE [%s]: Target: %u", GetPlayerInfo().c_str(), GUID_LOPART(targetGuid)); if (Guild* guild = GetPlayer()->GetGuild()) guild->HandleUpdateMemberRank(this, targetGuid, false); @@ -158,7 +158,7 @@ void WorldSession::HandleGuildDemoteOpcode(WorldPacket& recvPacket) recvPacket.ReadByteSeq(targetGuid[4]); recvPacket.ReadByteSeq(targetGuid[3]); - sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_DEMOTE [%s]: Target: " UI64FMTD, GetPlayerInfo().c_str(), targetGuid); + sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_DEMOTE [%s]: Target: %u", GetPlayerInfo().c_str(), GUID_LOPART(targetGuid)); if (Guild* guild = GetPlayer()->GetGuild()) guild->HandleUpdateMemberRank(this, targetGuid, true); @@ -206,8 +206,8 @@ void WorldSession::HandleGuildAssignRankOpcode(WorldPacket& recvPacket) recvPacket.ReadByteSeq(targetGuid[6]); recvPacket.ReadByteSeq(setterGuid[7]); - sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_ASSIGN_MEMBER_RANK [%s]: Target: " UI64FMTD " Rank: %u, Issuer " UI64FMTD, - GetPlayerInfo().c_str(), targetGuid, rankId, setterGuid); + sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_ASSIGN_MEMBER_RANK [%s]: Target: %u Rank: %u, Issuer: %u", + GetPlayerInfo().c_str(), GUID_LOPART(targetGuid), rankId, GUID_LOPART(setterGuid)); if (Guild* guild = GetPlayer()->GetGuild()) guild->HandleSetMemberRank(this, targetGuid, setterGuid, rankId); @@ -261,7 +261,7 @@ void WorldSession::HandleGuildSetNoteOpcode(WorldPacket& recvPacket) playerGuid[3] = recvPacket.ReadBit(); playerGuid[0] = recvPacket.ReadBit(); playerGuid[7] = recvPacket.ReadBit(); - bool type = recvPacket.ReadBit(); // 0 == Officer, 1 == Public + bool ispublic = recvPacket.ReadBit(); // 0 == Officer, 1 == Public playerGuid[6] = recvPacket.ReadBit(); uint32 noteLength = recvPacket.ReadBits(8); playerGuid[2] = recvPacket.ReadBit(); @@ -276,37 +276,37 @@ void WorldSession::HandleGuildSetNoteOpcode(WorldPacket& recvPacket) std::string note = recvPacket.ReadString(noteLength); recvPacket.ReadByteSeq(playerGuid[2]); - sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_SET_NOTE [%s]: Target: " UI64FMTD ", Note: %s, Public: %u", - GetPlayerInfo().c_str(), playerGuid, note.c_str(), type); + sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_SET_NOTE [%s]: Target: %u, Note: %s, Public: %u", + GetPlayerInfo().c_str(), GUID_LOPART(playerGuid), note.c_str(), ispublic); if (Guild* guild = GetPlayer()->GetGuild()) - guild->HandleSetMemberNote(this, note, playerGuid, type); + guild->HandleSetMemberNote(this, note, playerGuid, ispublic); } -void WorldSession::HandleGuildQueryRanksOpcode(WorldPacket& recvData) +void WorldSession::HandleGuildQueryRanksOpcode(WorldPacket& recvPacket) { ObjectGuid guildGuid; - guildGuid[2] = recvData.ReadBit(); - guildGuid[3] = recvData.ReadBit(); - guildGuid[0] = recvData.ReadBit(); - guildGuid[6] = recvData.ReadBit(); - guildGuid[4] = recvData.ReadBit(); - guildGuid[7] = recvData.ReadBit(); - guildGuid[5] = recvData.ReadBit(); - guildGuid[1] = recvData.ReadBit(); - - recvData.ReadByteSeq(guildGuid[3]); - recvData.ReadByteSeq(guildGuid[4]); - recvData.ReadByteSeq(guildGuid[5]); - recvData.ReadByteSeq(guildGuid[7]); - recvData.ReadByteSeq(guildGuid[1]); - recvData.ReadByteSeq(guildGuid[0]); - recvData.ReadByteSeq(guildGuid[6]); - recvData.ReadByteSeq(guildGuid[2]); - - sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_QUERY_RANKS [%s]: Guild: " UI64FMTD, - GetPlayerInfo().c_str(), guildGuid); + guildGuid[2] = recvPacket.ReadBit(); + guildGuid[3] = recvPacket.ReadBit(); + guildGuid[0] = recvPacket.ReadBit(); + guildGuid[6] = recvPacket.ReadBit(); + guildGuid[4] = recvPacket.ReadBit(); + guildGuid[7] = recvPacket.ReadBit(); + guildGuid[5] = recvPacket.ReadBit(); + guildGuid[1] = recvPacket.ReadBit(); + + recvPacket.ReadByteSeq(guildGuid[3]); + recvPacket.ReadByteSeq(guildGuid[4]); + recvPacket.ReadByteSeq(guildGuid[5]); + recvPacket.ReadByteSeq(guildGuid[7]); + recvPacket.ReadByteSeq(guildGuid[1]); + recvPacket.ReadByteSeq(guildGuid[0]); + recvPacket.ReadByteSeq(guildGuid[6]); + recvPacket.ReadByteSeq(guildGuid[2]); + + sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_QUERY_RANKS [%s]: Guild: %u", + GetPlayerInfo().c_str(), GUID_LOPART(guildGuid)); if (Guild* guild = sGuildMgr->GetGuildByGuid(guildGuid)) if (guild->IsMember(_player->GetGUID())) @@ -386,7 +386,7 @@ void WorldSession::HandleGuildEventLogQueryOpcode(WorldPacket& /* recvPacket */) guild->SendEventLog(this); } -void WorldSession::HandleGuildBankMoneyWithdrawn(WorldPacket & /* recvData */) +void WorldSession::HandleGuildBankMoneyWithdrawn(WorldPacket& /* recvPacket */) { sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_BANK_MONEY_WITHDRAWN [%s]", GetPlayerInfo().c_str()); @@ -394,7 +394,7 @@ void WorldSession::HandleGuildBankMoneyWithdrawn(WorldPacket & /* recvData */) guild->SendMoneyInfo(this); } -void WorldSession::HandleGuildPermissions(WorldPacket& /* recvData */) +void WorldSession::HandleGuildPermissions(WorldPacket& /* recvPacket */) { sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_PERMISSIONS [%s]", GetPlayerInfo().c_str()); @@ -403,46 +403,51 @@ void WorldSession::HandleGuildPermissions(WorldPacket& /* recvData */) } // Called when clicking on Guild bank gameobject -void WorldSession::HandleGuildBankerActivate(WorldPacket& recvData) +void WorldSession::HandleGuildBankerActivate(WorldPacket& recvPacket) { uint64 guid; bool sendAllSlots; - recvData >> guid >> sendAllSlots; + recvPacket >> guid >> sendAllSlots; sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_BANKER_ACTIVATE [%s]: Go: [" UI64FMTD "] AllSlots: %u" , GetPlayerInfo().c_str(), guid, sendAllSlots); - if (GetPlayer()->GetGameObjectIfCanInteractWith(guid, GAMEOBJECT_TYPE_GUILD_BANK)) + GameObject const * const go = GetPlayer()->GetGameObjectIfCanInteractWith(guid, GAMEOBJECT_TYPE_GUILD_BANK); + if (!go) + return; + + Guild * const guild = GetPlayer()->GetGuild(); + if (!guild) { - if (Guild* guild = GetPlayer()->GetGuild()) - guild->SendBankList(this, 0, true, true); - else - Guild::SendCommandResult(this, GUILD_COMMAND_VIEW_TAB, ERR_GUILD_PLAYER_NOT_IN_GUILD); + Guild::SendCommandResult(this, GUILD_COMMAND_VIEW_TAB, ERR_GUILD_PLAYER_NOT_IN_GUILD); + return; } + + guild->SendBankList(this, 0, true, true); } // Called when opening guild bank tab only (first one) -void WorldSession::HandleGuildBankQueryTab(WorldPacket& recvData) +void WorldSession::HandleGuildBankQueryTab(WorldPacket& recvPacket) { uint64 guid; uint8 tabId; - bool full; + bool sendAllSlots; - recvData >> guid >> tabId >> full; + recvPacket >> guid >> tabId >> sendAllSlots; - sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_BANK_QUERY_TAB [%s]: Go: [" UI64FMTD "], TabId: %u, ShowTabs: %u" - , GetPlayerInfo().c_str(), guid, tabId, full); + sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_BANK_QUERY_TAB [%s]: Go: [" UI64FMTD "], TabId: %u, AllSlots: %u" + , GetPlayerInfo().c_str(), guid, tabId, sendAllSlots); if (GetPlayer()->GetGameObjectIfCanInteractWith(guid, GAMEOBJECT_TYPE_GUILD_BANK)) if (Guild* guild = GetPlayer()->GetGuild()) guild->SendBankList(this, tabId, true, false); } -void WorldSession::HandleGuildBankDepositMoney(WorldPacket& recvData) +void WorldSession::HandleGuildBankDepositMoney(WorldPacket& recvPacket) { uint64 guid; uint64 money; - recvData >> guid >> money; + recvPacket >> guid >> money; sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_BANK_DEPOSIT_MONEY [%s]: Go: [" UI64FMTD "], money: " UI64FMTD, GetPlayerInfo().c_str(), guid, money); @@ -453,11 +458,11 @@ void WorldSession::HandleGuildBankDepositMoney(WorldPacket& recvData) guild->HandleMemberDepositMoney(this, money); } -void WorldSession::HandleGuildBankWithdrawMoney(WorldPacket& recvData) +void WorldSession::HandleGuildBankWithdrawMoney(WorldPacket& recvPacket) { uint64 guid; uint64 money; - recvData >> guid >> money; + recvPacket >> guid >> money; sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_BANK_WITHDRAW_MONEY [%s]: Go: [" UI64FMTD "], money: " UI64FMTD, GetPlayerInfo().c_str(), guid, money); @@ -467,28 +472,28 @@ void WorldSession::HandleGuildBankWithdrawMoney(WorldPacket& recvData) guild->HandleMemberWithdrawMoney(this, money); } -void WorldSession::HandleGuildBankSwapItems(WorldPacket& recvData) +void WorldSession::HandleGuildBankSwapItems(WorldPacket& recvPacket) { sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_BANK_SWAP_ITEMS [%s]", GetPlayerInfo().c_str()); uint64 GoGuid; - recvData >> GoGuid; + recvPacket >> GoGuid; if (!GetPlayer()->GetGameObjectIfCanInteractWith(GoGuid, GAMEOBJECT_TYPE_GUILD_BANK)) { - recvData.rfinish(); // Prevent additional spam at rejected packet + recvPacket.rfinish(); // Prevent additional spam at rejected packet return; } Guild* guild = GetPlayer()->GetGuild(); if (!guild) { - recvData.rfinish(); // Prevent additional spam at rejected packet + recvPacket.rfinish(); // Prevent additional spam at rejected packet return; } uint8 bankToBank; - recvData >> bankToBank; + recvPacket >> bankToBank; uint8 tabId; uint8 slotId; @@ -498,19 +503,19 @@ void WorldSession::HandleGuildBankSwapItems(WorldPacket& recvData) if (bankToBank) { uint8 destTabId; - recvData >> destTabId; + recvPacket >> destTabId; uint8 destSlotId; - recvData >> destSlotId; + recvPacket >> destSlotId; uint32 destItemEntry; - recvData >> destItemEntry; + recvPacket >> destItemEntry; - recvData >> tabId; - recvData >> slotId; - recvData >> itemEntry; - recvData.read_skip(); // Always 0 - recvData >> splitedAmount; + recvPacket >> tabId; + recvPacket >> slotId; + recvPacket >> itemEntry; + recvPacket.read_skip(); // Always 0 + recvPacket >> splitedAmount; guild->SwapItems(GetPlayer(), tabId, slotId, destTabId, destSlotId, splitedAmount); } @@ -520,24 +525,24 @@ void WorldSession::HandleGuildBankSwapItems(WorldPacket& recvData) uint8 playerSlotId = NULL_SLOT; uint8 toChar = 1; - recvData >> tabId; - recvData >> slotId; - recvData >> itemEntry; + recvPacket >> tabId; + recvPacket >> slotId; + recvPacket >> itemEntry; uint8 autoStore; - recvData >> autoStore; + recvPacket >> autoStore; if (autoStore) { - recvData.read_skip(); // autoStoreCount - recvData.read_skip(); // ToChar (?), always and expected to be 1 (autostore only triggered in Bank -> Char) - recvData.read_skip(); // Always 0 + recvPacket.read_skip(); // autoStoreCount + recvPacket.read_skip(); // ToChar (?), always and expected to be 1 (autostore only triggered in Bank -> Char) + recvPacket.read_skip(); // Always 0 } else { - recvData >> playerBag; - recvData >> playerSlotId; - recvData >> toChar; - recvData >> splitedAmount; + recvPacket >> playerBag; + recvPacket >> playerSlotId; + recvPacket >> toChar; + recvPacket >> splitedAmount; } // Player <-> Bank @@ -549,13 +554,13 @@ void WorldSession::HandleGuildBankSwapItems(WorldPacket& recvData) } } -void WorldSession::HandleGuildBankBuyTab(WorldPacket& recvData) +void WorldSession::HandleGuildBankBuyTab(WorldPacket& recvPacket) { uint64 guid; - recvData >> guid; + recvPacket >> guid; uint8 tabId; - recvData >> tabId; + recvPacket >> tabId; sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_BANK_BUY_TAB [%s]: Go: [" UI64FMTD "], TabId: %u", GetPlayerInfo().c_str(), guid, tabId); @@ -564,13 +569,13 @@ void WorldSession::HandleGuildBankBuyTab(WorldPacket& recvData) guild->HandleBuyBankTab(this, tabId); } -void WorldSession::HandleGuildBankUpdateTab(WorldPacket& recvData) +void WorldSession::HandleGuildBankUpdateTab(WorldPacket& recvPacket) { uint64 guid; uint8 tabId; std::string name, icon; - recvData >> guid >> tabId >> name >> icon; + recvPacket >> guid >> tabId >> name >> icon; sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_BANK_UPDATE_TAB [%s]: Go: [" UI64FMTD "], TabId: %u, Name: %s, Icon: %s" , GetPlayerInfo().c_str(), guid, tabId, name.c_str(), icon.c_str()); @@ -580,10 +585,10 @@ void WorldSession::HandleGuildBankUpdateTab(WorldPacket& recvData) guild->HandleSetBankTabInfo(this, tabId, name, icon); } -void WorldSession::HandleGuildBankLogQuery(WorldPacket& recvData) +void WorldSession::HandleGuildBankLogQuery(WorldPacket& recvPacket) { uint32 tabId; - recvData >> tabId; + recvPacket >> tabId; sLog->outDebug(LOG_FILTER_GUILD, "MSG_GUILD_BANK_LOG_QUERY [%s]: TabId: %u", GetPlayerInfo().c_str(), tabId); @@ -591,10 +596,10 @@ void WorldSession::HandleGuildBankLogQuery(WorldPacket& recvData) guild->SendBankLog(this, tabId); } -void WorldSession::HandleQueryGuildBankTabText(WorldPacket &recvData) +void WorldSession::HandleQueryGuildBankTabText(WorldPacket &recvPacket) { uint8 tabId; - recvData >> tabId; + recvPacket >> tabId; sLog->outDebug(LOG_FILTER_GUILD, "MSG_QUERY_GUILD_BANK_TEXT [%s]: TabId: %u", GetPlayerInfo().c_str(), tabId); @@ -602,13 +607,13 @@ void WorldSession::HandleQueryGuildBankTabText(WorldPacket &recvData) guild->SendBankTabText(this, tabId); } -void WorldSession::HandleSetGuildBankTabText(WorldPacket& recvData) +void WorldSession::HandleSetGuildBankTabText(WorldPacket& recvPacket) { uint32 tabId; - recvData >> tabId; + recvPacket >> tabId; - uint32 textLen = recvData.ReadBits(14); - std::string text = recvData.ReadString(textLen); + uint32 textLen = recvPacket.ReadBits(14); + std::string text = recvPacket.ReadString(textLen); sLog->outDebug(LOG_FILTER_GUILD, "CMSG_SET_GUILD_BANK_TEXT [%s]: TabId: %u, Text: %s", GetPlayerInfo().c_str(), tabId, text.c_str()); @@ -640,6 +645,8 @@ void WorldSession::HandleGuildQueryXPOpcode(WorldPacket& recvPacket) recvPacket.ReadByteSeq(guildGuid[0]); recvPacket.ReadByteSeq(guildGuid[4]); + sLog->outDebug(LOG_FILTER_GUILD, "CMSG_QUERY_GUILD_XP [%s]: Guild: %u", GetPlayerInfo().c_str(), GUID_LOPART(guildGuid)); + if (Guild* guild = sGuildMgr->GetGuildByGuid(guildGuid)) if (guild->IsMember(_player->GetGUID())) guild->SendGuildXP(this); @@ -647,8 +654,6 @@ void WorldSession::HandleGuildQueryXPOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildSetRankPermissionsOpcode(WorldPacket& recvPacket) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_SET_RANK_PERMISSIONS"); - Guild* guild = GetPlayer()->GetGuild(); if (!guild) { @@ -656,13 +661,13 @@ void WorldSession::HandleGuildSetRankPermissionsOpcode(WorldPacket& recvPacket) return; } - uint32 unk; - uint32 rankId; + uint32 oldRankId; + uint32 newRankId; uint32 oldRights; uint32 newRights; uint32 moneyPerDay; - recvPacket >> unk; + recvPacket >> oldRankId; recvPacket >> oldRights; recvPacket >> newRights; @@ -679,36 +684,38 @@ void WorldSession::HandleGuildSetRankPermissionsOpcode(WorldPacket& recvPacket) } recvPacket >> moneyPerDay; - recvPacket >> rankId; + recvPacket >> newRankId; uint32 nameLength = recvPacket.ReadBits(7); std::string rankName = recvPacket.ReadString(nameLength); - guild->HandleSetRankInfo(this, rankId, rankName, newRights, moneyPerDay, rightsAndSlots); + sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_SET_RANK_PERMISSIONS [%s]: Rank: %s (%u)", GetPlayerInfo().c_str(), rankName.c_str(), newRankId); + + guild->HandleSetRankInfo(this, newRankId, rankName, newRights, moneyPerDay, rightsAndSlots); } -void WorldSession::HandleGuildRequestPartyState(WorldPacket& recvData) +void WorldSession::HandleGuildRequestPartyState(WorldPacket& recvPacket) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_REQUEST_PARTY_STATE"); ObjectGuid guildGuid; - guildGuid[0] = recvData.ReadBit(); - guildGuid[6] = recvData.ReadBit(); - guildGuid[7] = recvData.ReadBit(); - guildGuid[3] = recvData.ReadBit(); - guildGuid[5] = recvData.ReadBit(); - guildGuid[1] = recvData.ReadBit(); - guildGuid[2] = recvData.ReadBit(); - guildGuid[4] = recvData.ReadBit(); - - recvData.ReadByteSeq(guildGuid[6]); - recvData.ReadByteSeq(guildGuid[3]); - recvData.ReadByteSeq(guildGuid[2]); - recvData.ReadByteSeq(guildGuid[1]); - recvData.ReadByteSeq(guildGuid[5]); - recvData.ReadByteSeq(guildGuid[0]); - recvData.ReadByteSeq(guildGuid[7]); - recvData.ReadByteSeq(guildGuid[4]); + guildGuid[0] = recvPacket.ReadBit(); + guildGuid[6] = recvPacket.ReadBit(); + guildGuid[7] = recvPacket.ReadBit(); + guildGuid[3] = recvPacket.ReadBit(); + guildGuid[5] = recvPacket.ReadBit(); + guildGuid[1] = recvPacket.ReadBit(); + guildGuid[2] = recvPacket.ReadBit(); + guildGuid[4] = recvPacket.ReadBit(); + + recvPacket.ReadByteSeq(guildGuid[6]); + recvPacket.ReadByteSeq(guildGuid[3]); + recvPacket.ReadByteSeq(guildGuid[2]); + recvPacket.ReadByteSeq(guildGuid[1]); + recvPacket.ReadByteSeq(guildGuid[5]); + recvPacket.ReadByteSeq(guildGuid[0]); + recvPacket.ReadByteSeq(guildGuid[7]); + recvPacket.ReadByteSeq(guildGuid[4]); if (Guild* guild = sGuildMgr->GetGuildByGuid(guildGuid)) guild->HandleGuildPartyRequest(this); @@ -783,13 +790,9 @@ void WorldSession::HandleGuildRewardsQueryOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildQueryNewsOpcode(WorldPacket& recvPacket) { recvPacket.read_skip(); - - if (Guild* guild = sGuildMgr->GetGuildById(_player->GetGuildId())) - { - WorldPacket data; - guild->GetNewsLog().BuildNewsData(data); - SendPacket(&data); - } + sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_QUERY_NEWS [%s]", GetPlayerInfo().c_str()); + if (Guild* guild = GetPlayer()->GetGuild()) + guild->SendNewsUpdate(this); } void WorldSession::HandleGuildNewsUpdateStickyOpcode(WorldPacket& recvPacket) @@ -819,18 +822,6 @@ void WorldSession::HandleGuildNewsUpdateStickyOpcode(WorldPacket& recvPacket) recvPacket.ReadByteSeq(guid[7]); recvPacket.ReadByteSeq(guid[4]); - if (Guild* guild = sGuildMgr->GetGuildById(_player->GetGuildId())) - { - if (GuildNewsEntry* newsEntry = guild->GetNewsLog().GetNewsById(newsId)) - { - if (sticky) - newsEntry->Flags |= 1; - else - newsEntry->Flags &= ~1; - - WorldPacket data; - guild->GetNewsLog().BuildNewsData(newsId, *newsEntry, data); - SendPacket(&data); - } - } + if (Guild* guild = GetPlayer()->GetGuild()) + guild->HandleNewsSetSticky(this, newsId, sticky); } diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 5e568a90d85..ea96f4051a7 100644 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -814,7 +814,7 @@ void WorldSession::SendListInventory(uint64 vendorGuid) uint32 precision = (currencyTemplate->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? 100 : 1; ++count; - itemsData << uint32(slot + 1); // client expects counting to start at 1 + itemsData << uint32(slot + 1); // client expects counting to start at 1 itemsData << uint32(0); // max durability if (vendorItem->ExtendedCost != 0) diff --git a/src/server/game/Handlers/MailHandler.cpp b/src/server/game/Handlers/MailHandler.cpp index d7798f18f99..5df7b20b596 100644 --- a/src/server/game/Handlers/MailHandler.cpp +++ b/src/server/game/Handlers/MailHandler.cpp @@ -412,8 +412,7 @@ void WorldSession::HandleMailReturnToSender(WorldPacket & recvData) player->SendMailResult(mailId, MAIL_RETURNED_TO_SENDER, MAIL_ERR_INTERNAL_ERROR); return; } - //we can return mail now - //so firstly delete the old one + //we can return mail now, so firstly delete the old one SQLTransaction trans = CharacterDatabase.BeginTransaction(); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_MAIL_BY_ID); @@ -437,14 +436,8 @@ void WorldSession::HandleMailReturnToSender(WorldPacket & recvData) { for (MailItemInfoVec::iterator itr2 = m->items.begin(); itr2 != m->items.end(); ++itr2) { - Item* item = player->GetMItem(itr2->item_guid); - if (item) + if (Item * const item = player->GetMItem(itr2->item_guid)) draft.AddItem(item); - else - { - //WTF? - } - player->RemoveMItem(itr2->item_guid); } } @@ -652,10 +645,10 @@ void WorldSession::HandleGetMailList(WorldPacket& recvData) case MAIL_CREATURE: case MAIL_GAMEOBJECT: case MAIL_AUCTION: - data << uint32((*itr)->sender); // creature/gameobject entry, auction id + data << uint32((*itr)->sender); // creature/gameobject entry, auction id break; - case MAIL_ITEM: // item entry (?) sender = "Unknown", NYI - data << uint32(0); // item entry + case MAIL_ITEM: // item entry (?) sender = "Unknown", NYI + data << uint32(0); // item entry break; } @@ -685,6 +678,7 @@ void WorldSession::HandleGetMailList(WorldPacket& recvData) data << uint32((item ? item->GetEnchantmentDuration((EnchantmentSlot)j) : 0)); data << uint32((item ? item->GetEnchantmentCharges((EnchantmentSlot)j) : 0)); } + // can be negative data << int32((item ? item->GetItemRandomPropertyId() : 0)); // unk @@ -780,7 +774,7 @@ void WorldSession::HandleMailCreateTextItem(WorldPacket& recvData) } //TODO Fix me! ... this void has probably bad condition, but good data are sent -void WorldSession::HandleQueryNextMailTime(WorldPacket & /*recvData*/) +void WorldSession::HandleQueryNextMailTime(WorldPacket& /*recvData*/) { WorldPacket data(MSG_QUERY_NEXT_MAIL_TIME, 8); diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp index 73232320d43..2b9cf4a9b6d 100644 --- a/src/server/game/Handlers/MovementHandler.cpp +++ b/src/server/game/Handlers/MovementHandler.cpp @@ -398,7 +398,7 @@ void WorldSession::HandleMovementOpcodes(WorldPacket& recvPacket) if (plrMover) // nothing is charmed, or player charmed { plrMover->UpdateFallInformationIfNeed(movementInfo, opcode); - + AreaTableEntry const* zone = GetAreaEntryByAreaID(plrMover->GetAreaId()); float depth = zone ? zone->MaxDepth : -500.0f; if (movementInfo.pos.GetPositionZ() < depth) diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 93a911459c9..4159b58554c 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -3355,8 +3355,12 @@ enum PetDiet #define CHAIN_SPELL_JUMP_RADIUS 8 -#define GUILD_BANKLOG_MAX_RECORDS 25 -#define GUILD_EVENTLOG_MAX_RECORDS 100 +enum GuildLogs +{ + GUILD_BANKLOG_MAX_RECORDS = 25, + GUILD_EVENTLOG_MAX_RECORDS = 100, + GUILD_NEWSLOG_MAX_RECORDS = 250 +}; enum AiReaction { diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 1a565dacad9..89c698744a3 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3488,7 +3488,7 @@ void Spell::_handle_finish_phase() // Real add combo points from effects if (m_comboPointGain) m_caster->m_movedPlayer->GainSpellComboPoints(m_comboPointGain); - + if (m_spellInfo->PowerType == POWER_HOLY_POWER && m_caster->m_movedPlayer->getClass() == CLASS_PALADIN) HandleHolyPower(m_caster->m_movedPlayer); } diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 27abe8ebc6e..56aa88852a9 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -1577,10 +1577,6 @@ void Spell::DoCreateItem(uint32 /*i*/, uint32 itemtype) // create the new item and store it Item* pItem = player->StoreNewItem(dest, newitemid, true, Item::GenerateItemRandomPropertyId(newitemid)); - if (pProto->Quality > ITEM_QUALITY_EPIC || (pProto->Quality == ITEM_QUALITY_EPIC && pProto->ItemLevel >= MinNewsItemLevel[sWorld->getIntConfig(CONFIG_EXPANSION)])) - if (Guild* guild = sGuildMgr->GetGuildById(player->GetGuildId())) - guild->GetNewsLog().AddNewEvent(GUILD_NEWS_ITEM_CRAFTED, time(NULL), player->GetGUID(), 0, pProto->ItemId); - // was it successful? return error if not if (!pItem) { @@ -1595,6 +1591,11 @@ void Spell::DoCreateItem(uint32 /*i*/, uint32 itemtype) // send info to the client player->SendNewItem(pItem, num_to_add, true, bgType == 0); + if (pProto->Quality > ITEM_QUALITY_EPIC || (pProto->Quality == ITEM_QUALITY_EPIC && pProto->ItemLevel >= MinNewsItemLevel[sWorld->getIntConfig(CONFIG_EXPANSION)])) + if (Guild* guild = player->GetGuild()) + guild->AddGuildNews(GUILD_NEWS_ITEM_CRAFTED, player->GetGUID(), 0, pProto->ItemId); + + // we succeeded in creating at least one item, so a levelup is possible if (bgType == 0) player->UpdateCraftSkill(m_spellInfo->Id); diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 75f5dd1c807..39512aa155e 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1054,6 +1054,9 @@ void World::LoadConfigSettings(bool reload) m_int_configs[CONFIG_INSTANT_LOGOUT] = ConfigMgr::GetIntDefault("InstantLogout", SEC_MODERATOR); + m_int_configs[CONFIG_GUILD_NEWS_LOG_COUNT] = ConfigMgr::GetIntDefault("Guild.NewsLogRecordsCount", GUILD_NEWSLOG_MAX_RECORDS); + if (m_int_configs[CONFIG_GUILD_NEWS_LOG_COUNT] > GUILD_NEWSLOG_MAX_RECORDS) + m_int_configs[CONFIG_GUILD_NEWS_LOG_COUNT] = GUILD_NEWSLOG_MAX_RECORDS; m_int_configs[CONFIG_GUILD_EVENT_LOG_COUNT] = ConfigMgr::GetIntDefault("Guild.EventLogRecordsCount", GUILD_EVENTLOG_MAX_RECORDS); if (m_int_configs[CONFIG_GUILD_EVENT_LOG_COUNT] > GUILD_EVENTLOG_MAX_RECORDS) m_int_configs[CONFIG_GUILD_EVENT_LOG_COUNT] = GUILD_EVENTLOG_MAX_RECORDS; diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h index 1f90c169fa6..230f96e4997 100644 --- a/src/server/game/World/World.h +++ b/src/server/game/World/World.h @@ -308,6 +308,7 @@ enum WorldIntConfigs CONFIG_LOGDB_CLEARINTERVAL, CONFIG_LOGDB_CLEARTIME, CONFIG_CLIENTCACHE_VERSION, + CONFIG_GUILD_NEWS_LOG_COUNT, CONFIG_GUILD_EVENT_LOG_COUNT, CONFIG_GUILD_BANK_EVENT_LOG_COUNT, CONFIG_MIN_LEVEL_STAT_SAVE, diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index 5ddfe1f4dc5..af508dd1fca 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -49,7 +49,7 @@ enum ShamanSpells SHAMAN_LAVA_FLOWS_R1 = 51480, SHAMAN_LAVA_FLOWS_TRIGGERED_R1 = 65264, SHAMAN_SPELL_ANCESTRAL_AWAKENING_PROC = 52752, - + ICON_ID_SOOTHING_RAIN = 2011, SPELL_HEALING_STREAM_TOTEM_HEAL = 52042, }; diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index 96a282d9c85..91941a02df6 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -201,7 +201,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_UPD_GUILD_BANK_TAB_TEXT, "UPDATE guild_bank_tab SET TabText = ? WHERE guildid = ? AND TabId = ?", CONNECTION_ASYNC) // 0: string, 1: uint32, 2: uint8 PREPARE_STATEMENT(CHAR_INS_GUILD_MEMBER_WITHDRAW, - "INSERT INTO guild_member_withdraw (guid, tab0, tab1, tab2, tab3, tab4, tab5, tab6, tab7, money) VALUES (?, ?, ?, ?, ?, ?, ?, ?) " + "INSERT INTO guild_member_withdraw (guid, tab0, tab1, tab2, tab3, tab4, tab5, tab6, tab7, money) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) " "ON DUPLICATE KEY UPDATE tab0 = VALUES (tab0), tab1 = VALUES (tab1), tab2 = VALUES (tab2), tab3 = VALUES (tab3), tab4 = VALUES (tab4), tab5 = VALUES (tab5), tab6 = VALUES (tab6), tab7 = VALUES (tab7)", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_GUILD_MEMBER_WITHDRAW, "TRUNCATE guild_member_withdraw", CONNECTION_ASYNC) @@ -217,8 +217,8 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_SEL_GUILD_ACHIEVEMENT_CRITERIA, "SELECT criteria, counter, date, completedGuid FROM guild_achievement_progress WHERE guildId = ?", CONNECTION_SYNCH) PREPARE_STATEMENT(CHAR_UPD_GUILD_EXPERIENCE, "UPDATE guild SET level = ?, experience = ?, todayExperience = ? WHERE guildId = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(CHAR_UPD_GUILD_RESET_TODAY_EXPERIENCE, "UPDATE guild SET todayExperience = 0", CONNECTION_ASYNC); - PREPARE_STATEMENT(CHAR_LOAD_GUILD_NEWS, "SELECT id, eventType, playerGuid, data, flags, date FROM guild_news_log WHERE guild = ? ORDER BY guild ASC, id ASC", CONNECTION_SYNCH); - PREPARE_STATEMENT(CHAR_SAVE_GUILD_NEWS, "INSERT INTO guild_news_log (guild, id, eventType, playerGuid, data, flags, date) VALUES (?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PREPARE_STATEMENT(CHAR_INS_GUILD_NEWS, "INSERT INTO guild_newslog (guildid, LogGuid, EventType, PlayerGuid, Flags, Value, Timestamp) VALUES (?, ?, ?, ?, ?, ?, ?)" + " ON DUPLICATE KEY UPDATE LogGuid = VALUES (LogGuid), EventType = VALUES (EventType), PlayerGuid = VALUES (PlayerGuid), Flags = VALUES (Flags), Value = VALUES (Value), Timestamp = VALUES (Timestamp)", CONNECTION_ASYNC); // Chat channel handling PREPARE_STATEMENT(CHAR_SEL_CHANNEL, "SELECT announce, ownership, password, bannedList FROM channels WHERE name = ? AND team = ?", CONNECTION_SYNCH) diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.h b/src/server/shared/Database/Implementation/CharacterDatabase.h index 80c41122e7c..5a03ee4767c 100755 --- a/src/server/shared/Database/Implementation/CharacterDatabase.h +++ b/src/server/shared/Database/Implementation/CharacterDatabase.h @@ -209,8 +209,7 @@ enum CharacterDatabaseStatements CHAR_SEL_GUILD_ACHIEVEMENT_CRITERIA, CHAR_UPD_GUILD_EXPERIENCE, CHAR_UPD_GUILD_RESET_TODAY_EXPERIENCE, - CHAR_LOAD_GUILD_NEWS, - CHAR_SAVE_GUILD_NEWS, + CHAR_INS_GUILD_NEWS, CHAR_SEL_CHANNEL, CHAR_INS_CHANNEL, diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index e257198745d..0cb6072c244 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -984,6 +984,16 @@ Guild.ResetHour = 6 Guild.BankEventLogRecordsCount = 25 +# +# Guild.Guild.NewsLogRecordsCount +# Description: Number of log entries for guild news that are stored per guild. Old +# entries will be overwritten if the number of log entries exceed the +# configured value. High numbers prevent this behavior but may have performance +# impacts. +# Default: 250 + +Guild.Guild.NewsLogRecordsCount = 250 + # # MaxPrimaryTradeSkill # Description: Maximum number of primary professions a character can learn. -- cgit v1.2.3 From ccf593c6738ad1073381f1c2d404664e8d4ea187 Mon Sep 17 00:00:00 2001 From: Spp Date: Fri, 9 Nov 2012 09:03:29 +0100 Subject: Fix merge conflic and typos in worldserver config file and characters.sql --- sql/base/characters_database.sql | 5 +++-- src/server/game/Guilds/Guild.cpp | 4 ++-- src/server/worldserver/worldserver.conf.dist | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/sql/base/characters_database.sql b/sql/base/characters_database.sql index ebbdba293d6..89bc1f13d18 100644 --- a/sql/base/characters_database.sql +++ b/sql/base/characters_database.sql @@ -1975,7 +1975,7 @@ UNLOCK TABLES; DROP TABLE IF EXISTS `guild_newslog`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; -CREATE TABLE `guild_news_log` ( +CREATE TABLE `guild_newslog` ( `guildid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Guild Identificator', `LogGuid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Log record identificator - auxiliary column', `EventType` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT 'Event type', @@ -1983,7 +1983,7 @@ CREATE TABLE `guild_news_log` ( `Flags` int(10) unsigned NOT NULL DEFAULT '0', `Value` int(10) unsigned NOT NULL DEFAULT '0', `TimeStamp` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Event UNIX time', - PRIMARY KEY (`guildid`,`LogGuid`) + PRIMARY KEY (`guildid`,`LogGuid`), KEY `guildid_key` (`guildid`), KEY `Idx_PlayerGuid` (`PlayerGuid`), KEY `Idx_LogGuid` (`LogGuid`) @@ -1997,6 +1997,7 @@ CREATE TABLE `guild_news_log` ( LOCK TABLES `guild_newslog` WRITE; /*!40000 ALTER TABLE `guild_newslog` DISABLE KEYS */; /*!40000 ALTER TABLE `guild_newslog` ENABLE KEYS */; +UNLOCK TABLES; -- -- Table structure for table `guild_rank` diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 58bd94a3bdc..deb51bf4ac6 100644 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -1680,10 +1680,10 @@ void Guild::HandleBuyBankTab(WorldSession* session, uint8 tabId) if (!tabCost) return; - if (!player->HasEnoughMoney(tabCost)) // Should not happen, this is checked by client + if (!player->HasEnoughMoney(uint64(tabCost))) // Should not happen, this is checked by client return; - player->ModifyMoney(-int32(tabCost)); + player->ModifyMoney(-int64(tabCost)); _CreateNewBankTab(); _BroadcastEvent(GE_BANK_TAB_PURCHASED, 0); diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index 0cb6072c244..650695a1397 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -985,14 +985,14 @@ Guild.ResetHour = 6 Guild.BankEventLogRecordsCount = 25 # -# Guild.Guild.NewsLogRecordsCount +# Guild.NewsLogRecordsCount # Description: Number of log entries for guild news that are stored per guild. Old # entries will be overwritten if the number of log entries exceed the # configured value. High numbers prevent this behavior but may have performance # impacts. # Default: 250 -Guild.Guild.NewsLogRecordsCount = 250 +Guild.NewsLogRecordsCount = 250 # # MaxPrimaryTradeSkill -- cgit v1.2.3 From 44729aa69fe5cb9a9d83bcf5d83392d35de4a756 Mon Sep 17 00:00:00 2001 From: Shocker Date: Sat, 10 Nov 2012 05:18:55 +0200 Subject: Core/Achievements: Sepparate ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_ITEM_QUALITY_MIN and ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_ITEM_QUALITY_EQUALS --- src/server/game/Achievements/AchievementMgr.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 356be60909d..0c46cee8470 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -2725,7 +2725,6 @@ bool AchievementMgr::AdditionalRequirementsSatisfied(AchievementCriteriaEntry return false; break; case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_ITEM_QUALITY_MIN: // 14 - case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_ITEM_QUALITY_EQUALS: // 15 { // miscValue1 is itemid ItemTemplate const * const item = sObjectMgr->GetItemTemplate(uint32(miscValue1)); @@ -2733,6 +2732,14 @@ bool AchievementMgr::AdditionalRequirementsSatisfied(AchievementCriteriaEntry return false; break; } + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_ITEM_QUALITY_EQUALS: // 15 + { + // miscValue1 is itemid + ItemTemplate const * const item = sObjectMgr->GetItemTemplate(uint32(miscValue1)); + if (!item || item->Quality != reqValue) + return false; + break; + } case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_MAP_DIFFICULTY: // 20 if (uint32(referencePlayer->GetMap()->GetDifficulty()) != reqValue) return false; -- cgit v1.2.3 From 592513c0126893329735260a2d03f00e56395df2 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 10 Nov 2012 23:12:25 +0100 Subject: Tools/Extractors: Completely skip trying to read patch archives with version lower than 15211 if selected build to extract is higher, these files should not even be present in WoW directory after patch 4.3.2 - this skips reading them if for some reason they still are there --- src/tools/map_extractor/System.cpp | 13 ++++++++++++- src/tools/vmap4_extractor/vmapexport.cpp | 11 +++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp index 63132d269b2..c5241cad933 100644 --- a/src/tools/map_extractor/System.cpp +++ b/src/tools/map_extractor/System.cpp @@ -90,6 +90,7 @@ char const* CONF_mpq_list[]= uint32 const Builds[] = {13164, 13205, 13287, 13329, 13596, 13623, 13914, 14007, 14333, 14480, 14545, 15005, 15050, 15211, 15354, 15595, 0}; #define LAST_DBC_IN_DATA_BUILD 13623 // after this build mpqs with dbc are back to locale folder +#define NEW_BASE_SET_BUILD 15211 char* const Locales[] = {"enGB", "enUS", "deDE", "esES", "frFR", "koKR", "zhCN", "zhTW", "enCN", "enTW", "esMX", "ruRU"}; TCHAR* const LocalesT[] = @@ -1114,6 +1115,11 @@ bool LoadLocaleMPQFile(int locale) char const* prefix = NULL; for (int i = 0; Builds[i] && Builds[i] <= CONF_TargetBuild; ++i) { + // Do not attempt to read older MPQ patch archives past this build, they were merged with base + // and trying to read them together with new base will not end well + if (CONF_TargetBuild >= NEW_BASE_SET_BUILD && Builds[i] < NEW_BASE_SET_BUILD) + continue; + memset(buff, 0, sizeof(buff)); if (Builds[i] > LAST_DBC_IN_DATA_BUILD) { @@ -1151,7 +1157,7 @@ void LoadCommonMPQFiles(uint32 build) int count = sizeof(CONF_mpq_list) / sizeof(char*); for (int i = 1; i < count; ++i) { - if (build < 15211 && !strcmp("world2.MPQ", CONF_mpq_list[i])) // 4.3.2 and higher MPQ + if (build < NEW_BASE_SET_BUILD && !strcmp("world2.MPQ", CONF_mpq_list[i])) // 4.3.2 and higher MPQ continue; _stprintf(filename, _T("%s/Data/%s"), input_path, CONF_mpq_list[i]); @@ -1170,6 +1176,11 @@ void LoadCommonMPQFiles(uint32 build) char const* prefix = NULL; for (int i = 0; Builds[i] && Builds[i] <= CONF_TargetBuild; ++i) { + // Do not attempt to read older MPQ patch archives past this build, they were merged with base + // and trying to read them together with new base will not end well + if (CONF_TargetBuild >= NEW_BASE_SET_BUILD && Builds[i] < NEW_BASE_SET_BUILD) + continue; + memset(filename, 0, sizeof(filename)); if (Builds[i] > LAST_DBC_IN_DATA_BUILD) { diff --git a/src/tools/vmap4_extractor/vmapexport.cpp b/src/tools/vmap4_extractor/vmapexport.cpp index eebc763f2f2..050ec790dbb 100644 --- a/src/tools/vmap4_extractor/vmapexport.cpp +++ b/src/tools/vmap4_extractor/vmapexport.cpp @@ -75,6 +75,7 @@ char const* CONF_mpq_list[]= uint32 const Builds[] = {13164, 13205, 13287, 13329, 13596, 13623, 13914, 14007, 14333, 14480, 14545, 15005, 15050, 15211, 15354, 15595, 0}; #define LAST_DBC_IN_DATA_BUILD 13623 // after this build mpqs with dbc are back to locale folder +#define NEW_BASE_SET_BUILD 15211 char* const Locales[] = {"enGB", "enUS", "deDE", "esES", "frFR", "koKR", "zhCN", "zhTW", "enCN", "enTW", "esMX", "ruRU"}; TCHAR* const LocalesT[] = @@ -123,6 +124,11 @@ bool LoadLocaleMPQFile(int locale) char const* prefix = NULL; for (int i = 0; Builds[i] && Builds[i] <= CONF_TargetBuild; ++i) { + // Do not attempt to read older MPQ patch archives past this build, they were merged with base + // and trying to read them together with new base will not end well + if (CONF_TargetBuild >= NEW_BASE_SET_BUILD && Builds[i] < NEW_BASE_SET_BUILD) + continue; + memset(buff, 0, sizeof(buff)); if (Builds[i] > LAST_DBC_IN_DATA_BUILD) { @@ -200,6 +206,11 @@ void LoadCommonMPQFiles(uint32 build) char const* prefix = NULL; for (int i = 0; Builds[i] && Builds[i] <= CONF_TargetBuild; ++i) { + // Do not attempt to read older MPQ patch archives past this build, they were merged with base + // and trying to read them together with new base will not end well + if (CONF_TargetBuild >= NEW_BASE_SET_BUILD && Builds[i] < NEW_BASE_SET_BUILD) + continue; + memset(filename, 0, sizeof(filename)); if (Builds[i] > LAST_DBC_IN_DATA_BUILD) { -- cgit v1.2.3 From d3b12738a75607fced3d1da73741b479fc6fe6de Mon Sep 17 00:00:00 2001 From: Tuxity Date: Sun, 11 Nov 2012 18:21:53 +0100 Subject: Core/Player: Reset emote state when player stop attacking --- src/server/game/Entities/Unit/Unit.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index a9f9cb763a5..fea9a73386a 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -8484,6 +8484,9 @@ bool Unit::AttackStop() SendMeleeAttackStop(victim); + if (GetTypeId() == TYPEID_PLAYER) + HandleEmoteCommand(EMOTE_STATE_NONE); + return true; } -- cgit v1.2.3 From e9cabbe0003695e820343052aca4c4c4334c472a Mon Sep 17 00:00:00 2001 From: Tuxity Date: Sun, 11 Nov 2012 18:28:41 +0100 Subject: Core/Spells: Fix opcode SMSG_CLEAR_COOLDOWN and SMSG_CLEAR_COOLDOWNS. Closes #7783 --- src/server/game/Entities/Player/Player.cpp | 37 ++++++++++++++++++++++++++--- src/server/game/Entities/Player/Player.h | 1 + src/server/game/Server/Protocol/Opcodes.cpp | 3 ++- src/server/game/Server/Protocol/Opcodes.h | 4 ++-- 4 files changed, 39 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index b6974082604..37ce8029566 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -4359,9 +4359,7 @@ void Player::RemoveAllSpellCooldown() { if (!m_spellCooldowns.empty()) { - for (SpellCooldowns::const_iterator itr = m_spellCooldowns.begin(); itr != m_spellCooldowns.end(); ++itr) - SendClearCooldown(itr->first, this); - + SendClearAllCooldowns(this); m_spellCooldowns.clear(); } } @@ -25250,6 +25248,39 @@ void Player::SendClearCooldown(uint32 spell_id, Unit* target) SendDirectMessage(&data); } +void Player::SendClearAllCooldowns(Unit* target) +{ + uint32 spellCount = m_spellCooldowns.size(); + ObjectGuid guid = target ? target->GetGUID() : 0; + + WorldPacket data(SMSG_CLEAR_COOLDOWNS, 4+8); + data.WriteBit(guid[1]); + data.WriteBit(guid[3]); + data.WriteBit(guid[6]); + data.WriteBits(spellCount, 24); // Spell Count + data.WriteBit(guid[7]); + data.WriteBit(guid[5]); + data.WriteBit(guid[2]); + data.WriteBit(guid[4]); + data.WriteBit(guid[0]); + + data.FlushBits(); + + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[4]); + data.WriteByteSeq(guid[5]); + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[3]); + for (SpellCooldowns::const_iterator itr = m_spellCooldowns.begin(); itr != m_spellCooldowns.end(); ++itr) + data << uint32(itr->first); // Spell ID + + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[6]); + + SendDirectMessage(&data); +} + void Player::ResetMap() { // this may be called during Map::Update diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 0f1a60c5c79..b1bd61480de 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1967,6 +1967,7 @@ class Player : public Unit, public GridObject void RemoveSpellCooldown(uint32 spell_id, bool update = false); void RemoveSpellCategoryCooldown(uint32 cat, bool update = false); void SendClearCooldown(uint32 spell_id, Unit* target); + void SendClearAllCooldowns(Unit* target); GlobalCooldownMgr& GetGlobalCooldownMgr() { return m_GlobalCooldownMgr; } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index a69b4cc91c3..116f953b2a3 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -732,7 +732,8 @@ void OpcodeTable::Initialize() DEFINE_OPCODE_HANDLER(SMSG_CHAT_SERVER_RECONNECTED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CHAT_WRONG_FACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CLEAR_BOSS_EMOTES, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CLEAR_COOLDOWNS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CLEAR_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CLEAR_COOLDOWNS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CLEAR_FAR_SIGHT_IMMEDIATE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CLEAR_TARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CLIENTCACHE_VERSION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 006ef8fa133..f1159ec6d5c 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -788,7 +788,7 @@ enum Opcodes SMSG_CHAT_WRONG_FACTION = 0x6724, SMSG_CHECK_FOR_BOTS = 0x0000, SMSG_CLEAR_BOSS_EMOTES = 0x19A3, - SMSG_CLEAR_COOLDOWN = 0x0000, + SMSG_CLEAR_COOLDOWN = 0x0627, SMSG_CLEAR_COOLDOWNS = 0x59B4, SMSG_CLEAR_FAR_SIGHT_IMMEDIATE = 0x2A04, SMSG_CLEAR_TARGET = 0x4B26, @@ -813,7 +813,7 @@ enum Opcodes SMSG_COMSAT_RECONNECT_TRY = 0x4D35, SMSG_CONTACT_LIST = 0x6017, SMSG_CONVERT_RUNE = 0x4F14, - SMSG_COOLDOWN_CHEAT = 0x0627, + SMSG_COOLDOWN_CHEAT = 0x4537, SMSG_COOLDOWN_EVENT = 0x4F26, SMSG_CORPSE_MAP_POSITION_QUERY_RESPONSE = 0x0E35, SMSG_CORPSE_NOT_IN_INSTANCE = 0x2A14, -- cgit v1.2.3 From 6f6b0643ee0aa0f62d9e63ecee60f30f01d20369 Mon Sep 17 00:00:00 2001 From: Tuxity Date: Sun, 11 Nov 2012 19:15:10 +0100 Subject: Core/Pets: Fix crash with Shadowfiend. Closes #7803 --- src/server/game/AI/CoreAI/PetAI.cpp | 2 +- src/server/game/Entities/Player/Player.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/server/game/AI/CoreAI/PetAI.cpp b/src/server/game/AI/CoreAI/PetAI.cpp index 6802c109401..f30c4516830 100755 --- a/src/server/game/AI/CoreAI/PetAI.cpp +++ b/src/server/game/AI/CoreAI/PetAI.cpp @@ -136,7 +136,7 @@ void PetAI::UpdateAI(const uint32 diff) } } else if (owner && !me->HasUnitState(UNIT_STATE_FOLLOW)) // no charm info and no victim - HandleReturnMovement(); + me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle()); if (!me->GetCharmInfo()) return; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 37ce8029566..2356f021d00 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -25252,7 +25252,7 @@ void Player::SendClearAllCooldowns(Unit* target) { uint32 spellCount = m_spellCooldowns.size(); ObjectGuid guid = target ? target->GetGUID() : 0; - + WorldPacket data(SMSG_CLEAR_COOLDOWNS, 4+8); data.WriteBit(guid[1]); data.WriteBit(guid[3]); @@ -25263,9 +25263,9 @@ void Player::SendClearAllCooldowns(Unit* target) data.WriteBit(guid[2]); data.WriteBit(guid[4]); data.WriteBit(guid[0]); - + data.FlushBits(); - + data.WriteByteSeq(guid[7]); data.WriteByteSeq(guid[2]); data.WriteByteSeq(guid[4]); @@ -25274,10 +25274,10 @@ void Player::SendClearAllCooldowns(Unit* target) data.WriteByteSeq(guid[3]); for (SpellCooldowns::const_iterator itr = m_spellCooldowns.begin(); itr != m_spellCooldowns.end(); ++itr) data << uint32(itr->first); // Spell ID - + data.WriteByteSeq(guid[0]); data.WriteByteSeq(guid[6]); - + SendDirectMessage(&data); } -- cgit v1.2.3 From 5fd7d01bde40f5375847e863a9ef7d4f4432a304 Mon Sep 17 00:00:00 2001 From: Spp Date: Mon, 12 Nov 2012 10:29:52 +0100 Subject: Core/Build: Remove some more unneeded code for OS X from cmake files Core: Minor changes here and there --- dep/StormLib/CMakeLists.txt | 6 ----- src/server/game/Achievements/AchievementMgr.cpp | 21 ++-------------- src/server/game/DataStores/DBCEnums.h | 32 +++++++------------------ src/server/game/Spells/Auras/SpellAuraDefines.h | 4 ++-- src/server/game/Spells/SpellMgr.cpp | 4 ++-- src/server/game/World/World.cpp | 5 +--- src/server/scripts/Events/event.cpp | 2 -- src/server/worldserver/CMakeLists.txt | 1 - src/tools/vmap4_assembler/CMakeLists.txt | 4 ---- 9 files changed, 16 insertions(+), 63 deletions(-) (limited to 'src') diff --git a/dep/StormLib/CMakeLists.txt b/dep/StormLib/CMakeLists.txt index a6735e0a6a0..7096c8f8729 100644 --- a/dep/StormLib/CMakeLists.txt +++ b/dep/StormLib/CMakeLists.txt @@ -262,12 +262,6 @@ endif() add_library(storm STATIC ${SRC_FILES} ${SRC_ADDITIONAL_FILES}) target_link_libraries(storm ${LINK_LIBS}) -if(APPLE) - set_target_properties(storm PROPERTIES FRAMEWORK true) - set_target_properties(storm PROPERTIES PUBLIC_HEADER "src/StormLib.h src/StormPort.h") - set_target_properties(storm PROPERTIES LINK_FLAGS "-framework Carbon") -endif() - if(UNIX) set_target_properties(storm PROPERTIES SOVERSION 0) endif() diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 0c46cee8470..436d3851d43 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -1404,25 +1404,8 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, case ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILLS_GUILD: case ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE_TYPE_GUILD: case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ARCHAEOLOGY_PROJECTS: - case ACHIEVEMENT_CRITERIA_TYPE_UNK118: - case ACHIEVEMENT_CRITERIA_TYPE_UNK120: - case ACHIEVEMENT_CRITERIA_TYPE_UNK121: - case ACHIEVEMENT_CRITERIA_TYPE_UNK122: - case ACHIEVEMENT_CRITERIA_TYPE_UNK123: - case ACHIEVEMENT_CRITERIA_TYPE_UNK137: - case ACHIEVEMENT_CRITERIA_TYPE_UNK138: - case ACHIEVEMENT_CRITERIA_TYPE_UNK139: - case ACHIEVEMENT_CRITERIA_TYPE_UNK140: - case ACHIEVEMENT_CRITERIA_TYPE_UNK141: - case ACHIEVEMENT_CRITERIA_TYPE_UNK142: - case ACHIEVEMENT_CRITERIA_TYPE_UNK143: - case ACHIEVEMENT_CRITERIA_TYPE_UNK144: - case ACHIEVEMENT_CRITERIA_TYPE_UNK145: - case ACHIEVEMENT_CRITERIA_TYPE_UNK146: - case ACHIEVEMENT_CRITERIA_TYPE_UNK147: - case ACHIEVEMENT_CRITERIA_TYPE_UNK148: - case ACHIEVEMENT_CRITERIA_TYPE_UNK149: - case ACHIEVEMENT_CRITERIA_TYPE_UNK150: + case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_GUILD_CHALLENGE_TYPE: + case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_GUILD_CHALLENGE: break; // Not implemented yet :( } diff --git a/src/server/game/DataStores/DBCEnums.h b/src/server/game/DataStores/DBCEnums.h index 8f4415631b4..5217fa0d979 100755 --- a/src/server/game/DataStores/DBCEnums.h +++ b/src/server/game/DataStores/DBCEnums.h @@ -77,7 +77,7 @@ enum AchievementFlags ACHIEVEMENT_FLAG_SHOW_IN_GUILD_HEADER = 0x00002000, // Shows in guild news header ACHIEVEMENT_FLAG_GUILD = 0x00004000, // ACHIEVEMENT_FLAG_SHOW_GUILD_MEMBERS = 0x00008000, // - ACHIEVEMENT_FLAG_SHOW_CRITERIA_MEMBERS = 0x00010000, // + ACHIEVEMENT_FLAG_SHOW_CRITERIA_MEMBERS = 0x00010000 // }; enum @@ -90,12 +90,14 @@ enum AchievementCriteriaCondition { ACHIEVEMENT_CRITERIA_CONDITION_NONE = 0, ACHIEVEMENT_CRITERIA_CONDITION_NO_DEATH = 1, // reset progress on death - ACHIEVEMENT_CRITERIA_CONDITION_UNK1 = 2, // only used in "Complete a daily quest every day for five consecutive days" + ACHIEVEMENT_CRITERIA_CONDITION_UNK2 = 2, // only used in "Complete a daily quest every day for five consecutive days" ACHIEVEMENT_CRITERIA_CONDITION_BG_MAP = 3, // requires you to be on specific map, reset at change ACHIEVEMENT_CRITERIA_CONDITION_NO_LOSE = 4, // only used in "Win 10 arenas without losing" + ACHIEVEMENT_CRITERIA_CONDITION_UNK5 = 5, // Have spell? + ACHIEVEMENT_CRITERIA_CONDITION_UNK8 = 8, ACHIEVEMENT_CRITERIA_CONDITION_NO_SPELL_HIT = 9, // requires the player not to be hit by specific spell ACHIEVEMENT_CRITERIA_CONDITION_NOT_IN_GROUP = 10, // requires the player not to be in group - ACHIEVEMENT_CRITERIA_CONDITION_UNK3 = 13 // unk + ACHIEVEMENT_CRITERIA_CONDITION_UNK13 = 13 // unk }; enum AchievementCriteriaAdditionalCondition @@ -234,6 +236,7 @@ enum AchievementCriteriaTypes ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2 = 69, ACHIEVEMENT_CRITERIA_TYPE_SPECIAL_PVP_KILL = 70, ACHIEVEMENT_CRITERIA_TYPE_FISH_IN_GAMEOBJECT = 72, + // TODO 73: Achievements 1515, 1241, 1103 (Name: Mal'Ganis) ACHIEVEMENT_CRITERIA_TYPE_EARNED_PVP_TITLE = 74, // TODO: title id is not mentioned in dbc ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS = 75, ACHIEVEMENT_CRITERIA_TYPE_WIN_DUEL = 76, @@ -266,12 +269,7 @@ enum AchievementCriteriaTypes ACHIEVEMENT_CRITERIA_TYPE_EARN_HONORABLE_KILL = 113, ACHIEVEMENT_CRITERIA_TYPE_ACCEPTED_SUMMONINGS = 114, ACHIEVEMENT_CRITERIA_TYPE_EARN_ACHIEVEMENT_POINTS = 115, - ACHIEVEMENT_CRITERIA_TYPE_UNK118 = 118, ACHIEVEMENT_CRITERIA_TYPE_USE_LFD_TO_GROUP_WITH_PLAYERS = 119, - ACHIEVEMENT_CRITERIA_TYPE_UNK120 = 120, - ACHIEVEMENT_CRITERIA_TYPE_UNK121 = 121, - ACHIEVEMENT_CRITERIA_TYPE_UNK122 = 122, - ACHIEVEMENT_CRITERIA_TYPE_UNK123 = 123, ACHIEVEMENT_CRITERIA_TYPE_SPENT_GOLD_GUILD_REPAIRS = 124, ACHIEVEMENT_CRITERIA_TYPE_REACH_GUILD_LEVEL = 125, ACHIEVEMENT_CRITERIA_TYPE_CRAFT_ITEMS_GUILD = 126, @@ -284,23 +282,11 @@ enum AchievementCriteriaTypes ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUESTS_GUILD = 134, ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILLS_GUILD = 135, ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE_TYPE_GUILD = 136, - ACHIEVEMENT_CRITERIA_TYPE_UNK137 = 137, - ACHIEVEMENT_CRITERIA_TYPE_UNK138 = 138, //struct { Flag flag; uint32 count; } 1: Guild Dungeon, 2:Guild Challenge, 3:Guild battlefield - ACHIEVEMENT_CRITERIA_TYPE_UNK139 = 139, //struct { uint32 count; } Guild Challenge - ACHIEVEMENT_CRITERIA_TYPE_UNK140 = 140, - ACHIEVEMENT_CRITERIA_TYPE_UNK141 = 141, - ACHIEVEMENT_CRITERIA_TYPE_UNK142 = 142, - ACHIEVEMENT_CRITERIA_TYPE_UNK143 = 143, - ACHIEVEMENT_CRITERIA_TYPE_UNK144 = 144, - ACHIEVEMENT_CRITERIA_TYPE_UNK145 = 145, - ACHIEVEMENT_CRITERIA_TYPE_UNK146 = 146, - ACHIEVEMENT_CRITERIA_TYPE_UNK147 = 147, - ACHIEVEMENT_CRITERIA_TYPE_UNK148 = 148, - ACHIEVEMENT_CRITERIA_TYPE_UNK149 = 149, - ACHIEVEMENT_CRITERIA_TYPE_UNK150 = 150, + ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_GUILD_CHALLENGE_TYPE = 138, //struct { Flag flag; uint32 count; } 1: Guild Dungeon, 2:Guild Challenge, 3:Guild battlefield + ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_GUILD_CHALLENGE = 139 //struct { uint32 count; } Guild Challenge }; -#define ACHIEVEMENT_CRITERIA_TYPE_TOTAL 151 +#define ACHIEVEMENT_CRITERIA_TYPE_TOTAL 140 enum AreaFlags { diff --git a/src/server/game/Spells/Auras/SpellAuraDefines.h b/src/server/game/Spells/Auras/SpellAuraDefines.h index c198f4c178b..84a25158e8a 100755 --- a/src/server/game/Spells/Auras/SpellAuraDefines.h +++ b/src/server/game/Spells/Auras/SpellAuraDefines.h @@ -289,7 +289,7 @@ enum AuraType SPELL_AURA_PERIODIC_TRIGGER_SPELL_WITH_VALUE = 227, SPELL_AURA_DETECT_STEALTH = 228, SPELL_AURA_MOD_AOE_DAMAGE_AVOIDANCE = 229, - SPELL_AURA_230 = 230, + SPELL_AURA_MOD_MAX_HEALTH = 230, SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE = 231, SPELL_AURA_MECHANIC_DURATION_MOD = 232, SPELL_AURA_CHANGE_MODEL_FOR_ALL_HUMANOIDS = 233, // client-side only @@ -417,7 +417,7 @@ enum AuraType SPELL_AURA_355 = 355, SPELL_AURA_356 = 356, // Arcane Mage mastery - mod damage based on current mana SPELL_AURA_ENABLE_BOSS1_UNIT_FRAME = 357, - SPELL_AURA_358 = 358, + SPELL_AURA_WORGEN_ALTERED_FORM = 358, SPELL_AURA_359 = 359, SPELL_AURA_PROC_TRIGGER_SPELL_COPY = 360, // Procs the same spell that caused this proc (Dragonwrath, Tarecgosa's Rest) SPELL_AURA_PROC_TRIGGER_SPELL_2 = 361, diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 337f7293cec..a596d4bf076 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -1424,10 +1424,10 @@ void SpellMgr::LoadSpellLearnSpells() { Field* fields = result->Fetch(); - uint32 spell_id = fields[0].GetUInt16(); + uint32 spell_id = fields[0].GetUInt32(); SpellLearnSpellNode node; - node.spell = fields[1].GetUInt16(); + node.spell = fields[1].GetUInt32(); node.active = fields[2].GetBool(); node.autoLearned = false; diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 39512aa155e..dc64c607c62 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1888,7 +1888,6 @@ void World::LoadAutobroadcasts() if (!result) { sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 autobroadcasts definitions. DB table `autobroadcast` is empty!"); - return; } @@ -1896,7 +1895,6 @@ void World::LoadAutobroadcasts() do { - Field* fields = result->Fetch(); std::string message = fields[0].GetString(); @@ -1905,8 +1903,7 @@ void World::LoadAutobroadcasts() ++count; } while (result->NextRow()); - sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u autobroadcasts definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u autobroadcast definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } /// Update the World ! diff --git a/src/server/scripts/Events/event.cpp b/src/server/scripts/Events/event.cpp index 22334f8d365..d77ef2b78c1 100644 --- a/src/server/scripts/Events/event.cpp +++ b/src/server/scripts/Events/event.cpp @@ -15,8 +15,6 @@ * with this program. If not, see . */ -#include "ScriptPCH.h" - void AddSC_event_childrens_week(); void AddSC_event_scripts() diff --git a/src/server/worldserver/CMakeLists.txt b/src/server/worldserver/CMakeLists.txt index 0ea5a562732..0ab3d7715c7 100644 --- a/src/server/worldserver/CMakeLists.txt +++ b/src/server/worldserver/CMakeLists.txt @@ -149,7 +149,6 @@ endif() add_dependencies(worldserver revision.h) - if( UNIX AND NOT NOJEM ) set(worldserver_LINK_FLAGS "-pthread -lncurses ${worldserver_LINK_FLAGS}") endif() diff --git a/src/tools/vmap4_assembler/CMakeLists.txt b/src/tools/vmap4_assembler/CMakeLists.txt index f0f2e88c471..871624620ce 100644 --- a/src/tools/vmap4_assembler/CMakeLists.txt +++ b/src/tools/vmap4_assembler/CMakeLists.txt @@ -24,10 +24,6 @@ add_definitions(-DNO_CORE_FUNCS) add_executable(vmap4assembler VMapAssembler.cpp) add_dependencies(vmap4assembler storm) -if(CMAKE_SYSTEM_NAME MATCHES "Darwin") - set_target_properties(vmap4assembler PROPERTIES LINK_FLAGS "-framework Carbon") -endif() - target_link_libraries(vmap4assembler collision g3dlib -- cgit v1.2.3 From f53a04add0931fd059861fd530f368e9c0a6b3e0 Mon Sep 17 00:00:00 2001 From: Spp Date: Mon, 12 Nov 2012 10:31:56 +0100 Subject: Core/Scripts: Added Worgen and Goblin races to .pinfo command. --- src/server/scripts/Commands/cs_misc.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index d69e7e1cc6b..cfa5f6d6f3d 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -1659,6 +1659,12 @@ public: case RACE_DRAENEI: raceStr = "Draenei"; break; + case RACE_GOBLIN: + raceStr = "Goblin"; + break; + case RACE_WORGEN: + raceStr = "Worgen"; + break; } switch (Class) -- cgit v1.2.3 From a3a667460aafbd96688359fc358cb1272908720c Mon Sep 17 00:00:00 2001 From: Spp Date: Mon, 12 Nov 2012 10:37:27 +0100 Subject: Core/Achievement: Do not expose AchivementCriteriaData to ScriptMgr --- src/server/game/Achievements/AchievementMgr.cpp | 2 +- src/server/game/Scripting/ScriptMgr.cpp | 4 ++-- src/server/game/Scripting/ScriptMgr.h | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 436d3851d43..d6b6c928ebb 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -316,7 +316,7 @@ bool AchievementCriteriaData::Meets(uint32 criteria_id, Player const* source, Un return false; return target->getGender() == gender.gender; case ACHIEVEMENT_CRITERIA_DATA_TYPE_SCRIPT: - return sScriptMgr->OnCriteriaCheck(this, const_cast(source), const_cast(target)); + return sScriptMgr->OnCriteriaCheck(ScriptId, source, target); case ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_PLAYER_COUNT: return source->GetMap()->GetPlayersCountExceptGMs() <= map_players.maxcount; case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_TEAM: diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index 6c8d651a5a0..93dae4c63f2 100755 --- a/src/server/game/Scripting/ScriptMgr.cpp +++ b/src/server/game/Scripting/ScriptMgr.cpp @@ -1186,12 +1186,12 @@ void ScriptMgr::OnShutdown() FOREACH_SCRIPT(WorldScript)->OnShutdown(); } -bool ScriptMgr::OnCriteriaCheck(AchievementCriteriaData const* data, Player* source, Unit* target) +bool ScriptMgr::OnCriteriaCheck(uint32 scriptId, Player* source, Unit* target) { ASSERT(source); // target can be NULL. - GET_SCRIPT_RET(AchievementCriteriaScript, data->ScriptId, tmpscript, false); + GET_SCRIPT_RET(AchievementCriteriaScript, scriptId, tmpscript, false); return tmpscript->OnCheck(source, target); } diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h index 80439b4e556..b245039dc92 100755 --- a/src/server/game/Scripting/ScriptMgr.h +++ b/src/server/game/Scripting/ScriptMgr.h @@ -61,7 +61,6 @@ class WorldPacket; class WorldSocket; class WorldObject; -struct AchievementCriteriaData; struct AuctionEntry; struct ConditionSourceInfo; struct Condition; @@ -980,7 +979,7 @@ class ScriptMgr public: /* AchievementCriteriaScript */ - bool OnCriteriaCheck(AchievementCriteriaData const* data, Player* source, Unit* target); + bool OnCriteriaCheck(uint32 scriptId, Player* source, Unit* target); public: /* PlayerScript */ -- cgit v1.2.3 From 5c6af8d1f30b70cc8b54807739443fe6d233cfef Mon Sep 17 00:00:00 2001 From: Spp Date: Mon, 12 Nov 2012 12:07:16 +0100 Subject: Core: Added some attribute definitions --- src/server/game/Miscellaneous/SharedDefines.h | 82 ++++++++++++++------------- src/server/game/Spells/SpellEffects.cpp | 2 +- 2 files changed, 45 insertions(+), 39 deletions(-) (limited to 'src') diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 4159b58554c..9e160c9fe86 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -534,7 +534,7 @@ enum SpellAttr7 SPELL_ATTR7_REACTIVATE_AT_RESURRECT = 0x00000004, // 2 Paladin's auras and 65607 only. SPELL_ATTR7_IS_CHEAT_SPELL = 0x00000008, // 3 Cannot cast if caster doesn't have UnitFlag2 & UNIT_FLAG2_ALLOW_CHEAT_SPELLS SPELL_ATTR7_UNK4 = 0x00000010, // 4 Only 47883 (Soulstone Resurrection) and test spell. - SPELL_ATTR7_SUMMON_PLAYER_TOTEM = 0x00000020, // 5 Only Shaman player totems. + SPELL_ATTR7_SUMMON_TOTEM = 0x00000020, // 5 Only Shaman player totems. SPELL_ATTR7_UNK6 = 0x00000040, // 6 Dark Surge, Surge of Light, Burning Breath triggers (boss spells). SPELL_ATTR7_UNK7 = 0x00000080, // 7 66218 (Launch) spell. SPELL_ATTR7_HORDE_ONLY = 0x00000100, // 8 Teleports, mounts and other spells. @@ -565,31 +565,31 @@ enum SpellAttr7 enum SpellAttr8 { - SPELL_ATTR8_UNK0 = 0x00000001, // 0 - SPELL_ATTR8_UNK1 = 0x00000002, // 1 - SPELL_ATTR8_UNK2 = 0x00000004, // 2 - SPELL_ATTR8_UNK3 = 0x00000008, // 3 - SPELL_ATTR8_UNK4 = 0x00000010, // 4 - SPELL_ATTR8_UNK5 = 0x00000020, // 5 - SPELL_ATTR8_UNK6 = 0x00000040, // 6 - SPELL_ATTR8_UNK7 = 0x00000080, // 7 - SPELL_ATTR8_UNK8 = 0x00000100, // 8 - SPELL_ATTR8_DONT_RESET_PERIODIC_TIMER = 0x00000200, // 9 Periodic auras with this flag keep old periodic timer when refreshing at close to one tick remaining (kind of anti DoT clipping) - SPELL_ATTR8_UNK10 = 0x00000400, // 10 + SPELL_ATTR8_UNK0 = 0x00000001, // 0 + SPELL_ATTR8_UNK1 = 0x00000002, // 1 + SPELL_ATTR8_UNK2 = 0x00000004, // 2 + SPELL_ATTR8_UNK3 = 0x00000008, // 3 + SPELL_ATTR8_UNK4 = 0x00000010, // 4 + SPELL_ATTR8_UNK5 = 0x00000020, // 5 + SPELL_ATTR8_UNK6 = 0x00000040, // 6 + SPELL_ATTR8_UNK7 = 0x00000080, // 7 + SPELL_ATTR8_AFFECT_PARTY_AND_RAID = 0x00000100, // 8 Nearly all spells have "all party and raid" in description + SPELL_ATTR8_DONT_RESET_PERIODIC_TIMER = 0x00000200, // 9 Periodic auras with this flag keep old periodic timer when refreshing at close to one tick remaining (kind of anti DoT clipping) + SPELL_ATTR8_NAME_CHANGED_DURING_TRANSFORM = 0x00000400, // 10 according to wowhead comments, name changes, title remains SPELL_ATTR8_UNK11 = 0x00000800, // 11 SPELL_ATTR8_AURA_SEND_AMOUNT = 0x00001000, // 12 Aura must have flag AFLAG_ANY_EFFECT_AMOUNT_SENT to send amount SPELL_ATTR8_UNK13 = 0x00002000, // 13 SPELL_ATTR8_UNK14 = 0x00004000, // 14 - SPELL_ATTR8_UNK15 = 0x00008000, // 15 + SPELL_ATTR8_WATER_MOUNT = 0x00008000, // 15 only one River Boat used in Thousand Needles SPELL_ATTR8_UNK16 = 0x00010000, // 16 SPELL_ATTR8_UNK17 = 0x00020000, // 17 - SPELL_ATTR8_UNK18 = 0x00040000, // 18 - SPELL_ATTR8_UNK19 = 0x00080000, // 19 + SPELL_ATTR8_REMEMBER_SPELLS = 0x00040000, // 18 at some point in time, these auras remember spells and allow to cast them later + SPELL_ATTR8_USE_COMBO_POINTS_ON_ANY_TARGET = 0x00080000, // 19 allows to consume combo points from dead targets SPELL_ATTR8_ARMOR_SPECIALIZATION = 0x00100000, // 20 SPELL_ATTR8_UNK21 = 0x00200000, // 21 SPELL_ATTR8_UNK22 = 0x00400000, // 22 SPELL_ATTR8_UNK23 = 0x00800000, // 23 - SPELL_ATTR8_UNK24 = 0x01000000, // 24 + SPELL_ATTR8_HEALING_SPELL = 0x01000000, // 24 SPELL_ATTR8_UNK25 = 0x02000000, // 25 SPELL_ATTR8_RAID_MARKER = 0x04000000, // 26 probably spell no need learn to cast SPELL_ATTR8_UNK27 = 0x08000000, // 27 @@ -601,20 +601,20 @@ enum SpellAttr8 enum SpellAttr9 { - SPELL_ATTR9_UNK0 = 0x00000001, // 0 - SPELL_ATTR9_UNK1 = 0x00000002, // 1 - SPELL_ATTR9_UNK2 = 0x00000004, // 2 - SPELL_ATTR9_UNK3 = 0x00000008, // 3 - SPELL_ATTR9_UNK4 = 0x00000010, // 4 - SPELL_ATTR9_UNK5 = 0x00000020, // 5 - SPELL_ATTR9_UNK6 = 0x00000040, // 6 - SPELL_ATTR9_UNK7 = 0x00000080, // 7 - SPELL_ATTR9_UNK8 = 0x00000100, // 8 - SPELL_ATTR9_NOT_USABLE_IN_ARENA = 0x00000200, // 9 Cannot be used in arenas + SPELL_ATTR9_UNK0 = 0x00000001, // 0 + SPELL_ATTR9_UNK1 = 0x00000002, // 1 + SPELL_ATTR9_RESTRICTED_FLIGHT_AREA = 0x00000004, // 2 Dalaran and Wintergrasp flight area auras have it + SPELL_ATTR9_UNK3 = 0x00000008, // 3 + SPELL_ATTR9_UNK4 = 0x00000010, // 4 + SPELL_ATTR9_SUMMON_PLAYER_TOTEM = 0x00000020, // 5 + SPELL_ATTR9_UNK6 = 0x00000040, // 6 + SPELL_ATTR9_UNK7 = 0x00000080, // 7 + SPELL_ATTR9_AIMED_SHOT = 0x00000100, // 8 + SPELL_ATTR9_NOT_USABLE_IN_ARENA = 0x00000200, // 9 Cannot be used in arenas SPELL_ATTR9_UNK10 = 0x00000400, // 10 SPELL_ATTR9_UNK11 = 0x00000800, // 11 SPELL_ATTR9_UNK12 = 0x00001000, // 12 - SPELL_ATTR9_UNK13 = 0x00002000, // 13 + SPELL_ATTR9_SLAM = 0x00002000, // 13 SPELL_ATTR9_USABLE_IN_RATED_BATTLEGROUNDS = 0x00004000, // 14 Can be used in Rated Battlegrounds SPELL_ATTR9_UNK15 = 0x00008000, // 15 SPELL_ATTR9_UNK16 = 0x00010000, // 16 @@ -637,18 +637,18 @@ enum SpellAttr9 enum SpellAttr10 { - SPELL_ATTR10_UNK0 = 0x00000001, // 0 - SPELL_ATTR10_UNK1 = 0x00000002, // 1 - SPELL_ATTR10_UNK2 = 0x00000004, // 2 - SPELL_ATTR10_UNK3 = 0x00000008, // 3 - SPELL_ATTR10_UNK4 = 0x00000010, // 4 - SPELL_ATTR10_UNK5 = 0x00000020, // 5 - SPELL_ATTR10_UNK6 = 0x00000040, // 6 - SPELL_ATTR10_UNK7 = 0x00000080, // 7 - SPELL_ATTR10_UNK8 = 0x00000100, // 8 - SPELL_ATTR10_UNK9 = 0x00000200, // 9 + SPELL_ATTR10_UNK0 = 0x00000001, // 0 + SPELL_ATTR10_UNK1 = 0x00000002, // 1 + SPELL_ATTR10_UNK2 = 0x00000004, // 2 + SPELL_ATTR10_UNK3 = 0x00000008, // 3 + SPELL_ATTR10_WATER_SPOUT = 0x00000010, // 4 + SPELL_ATTR10_UNK5 = 0x00000020, // 5 + SPELL_ATTR10_UNK6 = 0x00000040, // 6 + SPELL_ATTR10_TELEPORT_PLAYER = 0x00000080, // 7 4 Teleport Player spells + SPELL_ATTR10_UNK8 = 0x00000100, // 8 + SPELL_ATTR10_UNK9 = 0x00000200, // 9 SPELL_ATTR10_UNK10 = 0x00000400, // 10 - SPELL_ATTR10_UNK11 = 0x00000800, // 11 + SPELL_ATTR10_HERB_GATHERING_MINING = 0x00000800, // 11 Only Herb Gathering and Mining SPELL_ATTR10_UNK12 = 0x00001000, // 12 SPELL_ATTR10_UNK13 = 0x00002000, // 13 SPELL_ATTR10_UNK14 = 0x00004000, // 14 @@ -3724,6 +3724,12 @@ enum ActivateTaxiReply ERR_TAXINOTSTANDING = 12 }; +enum ProfessionUI +{ + MAX_PRIMARY_PROFESSIONS = 2, + MAX_SECONDARY_SKILLS = 5 +}; + // Calendar - start enum CalendarFlags diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 416213c202e..c7990eb1ed6 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -5944,7 +5944,7 @@ void Spell::EffectCastButtons(SpellEffIndex effIndex) if (!p_caster->HasSpell(spell_id) || p_caster->HasSpellCooldown(spell_id)) continue; - if (!(spellInfo->AttributesEx7 & SPELL_ATTR7_SUMMON_PLAYER_TOTEM)) + if (!(spellInfo->AttributesEx9 & SPELL_ATTR9_SUMMON_PLAYER_TOTEM)) continue; int32 cost = spellInfo->CalcPowerCost(m_caster, spellInfo->GetSchoolMask()); -- cgit v1.2.3 From 16d9d1e56db68c40eec023d55e7c61874cdb7bc7 Mon Sep 17 00:00:00 2001 From: Spp Date: Mon, 12 Nov 2012 14:25:51 +0100 Subject: Core/Achievements: multiple changes - Fix crash when updating criteria with no reference player - Update progress counter to uint64 - Remove hack introduced for achievement 318 (conditions are already checked in additionalConditions) - Add extra parameter miscValue3 (needed for type "LOOT_TYPE" with additionalConditions "ITEM_SUBCLASS") - Correct definition for Additional conditions: 11 (HAS_AURA_TYPE), 17 (SOURCE_AREA_OR_ZONE), 18 (TARGET_AREA_OR_ZONE), 41 (TARGET_ZONE) --- src/server/game/Achievements/AchievementMgr.cpp | 128 ++++++++++++++---------- src/server/game/Achievements/AchievementMgr.h | 42 ++++---- src/server/game/Battlegrounds/Battleground.cpp | 4 +- src/server/game/DataStores/DBCEnums.h | 12 +-- src/server/game/Entities/Player/Player.cpp | 32 +++--- src/server/game/Entities/Player/Player.h | 8 +- src/server/game/Entities/Unit/Unit.cpp | 8 +- src/server/game/Guilds/Guild.cpp | 6 +- src/server/game/Guilds/Guild.h | 2 +- src/server/game/Handlers/ChatHandler.cpp | 2 +- src/server/game/Handlers/LootHandler.cpp | 2 +- src/server/game/Instances/InstanceScript.cpp | 2 +- src/server/game/Spells/Spell.cpp | 4 +- 13 files changed, 143 insertions(+), 109 deletions(-) (limited to 'src') diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index d6b6c928ebb..e5ab02c897e 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -316,7 +316,7 @@ bool AchievementCriteriaData::Meets(uint32 criteria_id, Player const* source, Un return false; return target->getGender() == gender.gender; case ACHIEVEMENT_CRITERIA_DATA_TYPE_SCRIPT: - return sScriptMgr->OnCriteriaCheck(ScriptId, source, target); + return sScriptMgr->OnCriteriaCheck(ScriptId, const_cast(source), const_cast(target)); case ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_PLAYER_COUNT: return source->GetMap()->GetPlayersCountExceptGMs() <= map_players.maxcount; case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_TEAM: @@ -452,9 +452,9 @@ void AchievementMgr::RemoveCriteriaProgress(const AchievementCriteriaEntr } template -void AchievementMgr::ResetAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1, uint32 miscValue2, bool evenIfCriteriaComplete) +void AchievementMgr::ResetAchievementCriteria(AchievementCriteriaTypes type, uint64 miscValue1, uint64 miscValue2, bool evenIfCriteriaComplete) { - sLog->outDebug(LOG_FILTER_ACHIEVEMENTSYS, "ResetAchievementCriteria(%u, %u, %u)", type, miscValue1, miscValue2); + sLog->outDebug(LOG_FILTER_ACHIEVEMENTSYS, "ResetAchievementCriteria(%u, " UI64FMTD ", " UI64FMTD ")", type, miscValue1, miscValue2); // disable for gamemasters with GM-mode enabled if (GetOwner()->isGameMaster()) @@ -485,7 +485,7 @@ void AchievementMgr::ResetAchievementCriteria(AchievementCriteriaTypes type, } template<> -void AchievementMgr::ResetAchievementCriteria(AchievementCriteriaTypes /*type*/, uint32 /*miscValue1*/, uint32 /*miscValue2*/, bool /*evenIfCriteriaComplete*/) +void AchievementMgr::ResetAchievementCriteria(AchievementCriteriaTypes /*type*/, uint64 /*miscValue1*/, uint64 /*miscValue2*/, bool /*evenIfCriteriaComplete*/) { // Not needed } @@ -728,7 +728,7 @@ void AchievementMgr::LoadFromDB(PreparedQueryResult achievementResult, P { Field* fields = criteriaResult->Fetch(); uint32 id = fields[0].GetUInt16(); - uint32 counter = fields[1].GetUInt32(); + uint64 counter = fields[1].GetUInt64(); time_t date = time_t(fields[2].GetUInt32()); AchievementCriteriaEntry const* criteria = sAchievementMgr->GetAchievementCriteria(id); @@ -916,12 +916,13 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievemen // if player is in world he can tell his friends about new achievement else if (GetOwner()->IsInWorld()) { + Trinity::AchievementChatBuilder say_builder(*GetOwner(), CHAT_MSG_ACHIEVEMENT, LANG_ACHIEVEMENT_EARNED, achievement->ID); + CellCoord p = Trinity::ComputeCellCoord(GetOwner()->GetPositionX(), GetOwner()->GetPositionY()); Cell cell(p); cell.SetNoCreate(); - Trinity::AchievementChatBuilder say_builder(*GetOwner(), CHAT_MSG_ACHIEVEMENT, LANG_ACHIEVEMENT_EARNED, achievement->ID); Trinity::LocalizedPacketDo say_do(say_builder); Trinity::PlayerDistWorker > say_worker(GetOwner(), sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), say_do); TypeContainerVisitor >, WorldTypeMapContainer > message(say_worker); @@ -1052,7 +1053,7 @@ void AchievementMgr::CheckAllAchievementCriteria(Player* referencePlayer) { // suppress sending packets for (uint32 i=0; i bool IsGuild() { return true; } * this function will be called whenever the user might have done a criteria relevant action */ template -void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1 /*= 0*/, uint32 miscValue2 /*= 0*/, Unit const* unit /*= NULL*/, Player* referencePlayer /*= NULL*/) +void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, uint64 miscValue1 /*= 0*/, uint64 miscValue2 /*= 0*/, uint64 miscValue3 /*= 0*/, Unit const* unit /*= NULL*/, Player* referencePlayer /*= NULL*/) { - sLog->outDebug(LOG_FILTER_ACHIEVEMENTSYS, "UpdateAchievementCriteria(%u, %u, %u)", type, miscValue1, miscValue2); + if (type >= ACHIEVEMENT_CRITERIA_TYPE_TOTAL) + { + sLog->outDebug(LOG_FILTER_ACHIEVEMENTSYS, "UpdateAchievementCriteria: Wrong criteria type %u", type); + return; + } + + if (!referencePlayer) + { + sLog->outDebug(LOG_FILTER_ACHIEVEMENTSYS, "UpdateAchievementCriteria: Player is NULL! Cant update criteria"); + return; + } // disable for gamemasters with GM-mode enabled if (referencePlayer->isGameMaster()) + { + sLog->outDebug(LOG_FILTER_ACHIEVEMENTSYS, "UpdateAchievementCriteria: [Player %s GM mode on] %s, %s (%u), " UI64FMTD ", " UI64FMTD ", " UI64FMTD + , referencePlayer->GetName().c_str(), GetLogNameForGuid(GetOwner()->GetGUID()), AchievementGlobalMgr::GetCriteriaTypeString(type), type, miscValue1, miscValue2, miscValue3); return; + } + + sLog->outDebug(LOG_FILTER_ACHIEVEMENTSYS, "UpdateAchievementCriteria: %s, %s (%u), " UI64FMTD ", " UI64FMTD ", " UI64FMTD + , GetLogNameForGuid(GetOwner()->GetGUID()), AchievementGlobalMgr::GetCriteriaTypeString(type), type, miscValue1, miscValue2, miscValue3); // Lua_GetGuildLevelEnabled() is checked in achievement UI to display guild tab if (IsGuild() && !sWorld->getBoolConfig(CONFIG_GUILD_LEVELING_ENABLED)) @@ -1098,7 +1116,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, continue; } - if (!CanUpdateCriteria(achievementCriteria, achievement, miscValue1, miscValue2, unit, referencePlayer)) + if (!CanUpdateCriteria(achievementCriteria, achievement, miscValue1, miscValue2, miscValue3, unit, referencePlayer)) continue; // requirements not found in the dbc @@ -1118,7 +1136,6 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, case ACHIEVEMENT_CRITERIA_TYPE_QUEST_ABANDONED: case ACHIEVEMENT_CRITERIA_TYPE_FLIGHT_PATHS_TAKEN: case ACHIEVEMENT_CRITERIA_TYPE_ACCEPTED_SUMMONINGS: - case ACHIEVEMENT_CRITERIA_TYPE_USE_LFD_TO_GROUP_WITH_PLAYERS: case ACHIEVEMENT_CRITERIA_TYPE_LOOT_EPIC_ITEM: case ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM: case ACHIEVEMENT_CRITERIA_TYPE_DEATH: @@ -1161,6 +1178,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, case ACHIEVEMENT_CRITERIA_TYPE_GOLD_EARNED_BY_AUCTIONS:/* FIXME: for online player only currently */ case ACHIEVEMENT_CRITERIA_TYPE_TOTAL_DAMAGE_RECEIVED: case ACHIEVEMENT_CRITERIA_TYPE_TOTAL_HEALING_RECEIVED: + case ACHIEVEMENT_CRITERIA_TYPE_USE_LFD_TO_GROUP_WITH_PLAYERS: case ACHIEVEMENT_CRITERIA_TYPE_WIN_BG: case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_BATTLEGROUND: case ACHIEVEMENT_CRITERIA_TYPE_DAMAGE_DONE: @@ -1616,7 +1634,7 @@ bool AchievementMgr::IsCompletedAchievement(AchievementEntry const* entry) AchievementCriteriaEntryList const* cList = sAchievementMgr->GetAchievementCriteriaByAchievement(achievementForTestId); if (!cList) return false; - uint32 count = 0; + uint64 count = 0; // For SUMM achievements, we have to count the progress of each criteria of the achievement. // Oddly, the target count is NOT contained in the achievement, but in each individual criteria @@ -1677,14 +1695,14 @@ CriteriaProgress* AchievementMgr::GetCriteriaProgress(AchievementCriteriaEntr } template -void AchievementMgr::SetCriteriaProgress(AchievementCriteriaEntry const* entry, uint32 changeValue, Player* referencePlayer, ProgressType ptype) +void AchievementMgr::SetCriteriaProgress(AchievementCriteriaEntry const* entry, uint64 changeValue, Player* referencePlayer, ProgressType ptype) { // Don't allow to cheat - doing timed achievements without timer active TimedAchievementMap::iterator timedIter = m_timedAchievements.find(entry->ID); if (entry->timeLimit && timedIter == m_timedAchievements.end()) return; - sLog->outDebug(LOG_FILTER_ACHIEVEMENTSYS, "SetCriteriaProgress(%u, %u) for (%s GUID: %u)", + sLog->outDebug(LOG_FILTER_ACHIEVEMENTSYS, "SetCriteriaProgress(%u, " UI64FMTD ") for (%s GUID: %u)", entry->ID, changeValue, GetLogNameForGuid(GetOwner()->GetGUID()), GUID_LOPART(GetOwner()->GetGUID())); CriteriaProgress* progress = GetCriteriaProgress(entry); @@ -1700,7 +1718,7 @@ void AchievementMgr::SetCriteriaProgress(AchievementCriteriaEntry const* entr } else { - uint32 newValue = 0; + uint64 newValue = 0; switch (ptype) { case PROGRESS_SET: @@ -1709,7 +1727,7 @@ void AchievementMgr::SetCriteriaProgress(AchievementCriteriaEntry const* entr case PROGRESS_ACCUMULATE: { // avoid overflow - uint32 max_value = std::numeric_limits::max(); + uint64 max_value = std::numeric_limits::max(); newValue = max_value - progress->counter > changeValue ? progress->counter + changeValue : max_value; break; } @@ -1852,8 +1870,8 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achiev _achievementPoints += achievement->points; - UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT, 0, 0, NULL, referencePlayer); - UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EARN_ACHIEVEMENT_POINTS, achievement->points, 0, NULL, referencePlayer); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT, 0, 0, 0, NULL, referencePlayer); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EARN_ACHIEVEMENT_POINTS, achievement->points, 0, 0, NULL, referencePlayer); // reward items and titles if any AchievementReward const* reward = sAchievementMgr->GetAchievementReward(achievement); @@ -1940,8 +1958,8 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achieve _achievementPoints += achievement->points; - UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT, 0, 0, NULL, referencePlayer); - UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EARN_ACHIEVEMENT_POINTS, achievement->points, 0, NULL, referencePlayer); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT, 0, 0, 0, NULL, referencePlayer); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EARN_ACHIEVEMENT_POINTS, achievement->points, 0, 0, NULL, referencePlayer); } struct VisibleAchievementPred @@ -2225,7 +2243,7 @@ bool AchievementMgr::HasAchieved(uint32 achievementId) const } template -bool AchievementMgr::CanUpdateCriteria(AchievementCriteriaEntry const* criteria, AchievementEntry const* achievement, uint64 miscValue1, uint64 miscValue2, Unit const* unit, Player* referencePlayer) +bool AchievementMgr::CanUpdateCriteria(AchievementCriteriaEntry const* criteria, AchievementEntry const* achievement, uint64 miscValue1, uint64 miscValue2, uint64 miscValue3, Unit const* unit, Player* referencePlayer) { if (DisableMgr::IsDisabledFor(DISABLE_TYPE_ACHIEVEMENT_CRITERIA, criteria->ID, NULL)) { @@ -2256,7 +2274,7 @@ bool AchievementMgr::CanUpdateCriteria(AchievementCriteriaEntry const* criter return false; } - if (!RequirementsSatisfied(criteria, miscValue1, miscValue2, unit, referencePlayer)) + if (!RequirementsSatisfied(criteria, miscValue1, miscValue2, miscValue3, unit, referencePlayer)) { sLog->outTrace(LOG_FILTER_ACHIEVEMENTSYS, "CanUpdateCriteria: %s (Id: %u Type %s) Requirements not satisfied", criteria->name, criteria->ID, AchievementGlobalMgr::GetCriteriaTypeString(criteria->type)); @@ -2307,7 +2325,7 @@ bool AchievementMgr::ConditionsSatisfied(AchievementCriteriaEntry const *crit } template -bool AchievementMgr::RequirementsSatisfied(AchievementCriteriaEntry const *achievementCriteria, uint64 miscValue1, uint64 miscValue2, Unit const *unit, Player* referencePlayer) const +bool AchievementMgr::RequirementsSatisfied(AchievementCriteriaEntry const *achievementCriteria, uint64 miscValue1, uint64 miscValue2, uint64 miscValue3, Unit const *unit, Player* referencePlayer) const { switch (AchievementCriteriaTypes(achievementCriteria->type)) { @@ -2468,11 +2486,7 @@ bool AchievementMgr::RequirementsSatisfied(AchievementCriteriaEntry const *ac return false; break; case ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_PLAYER: - if (!miscValue1) - return false; - - // if team check required: must kill by opposition faction - if (achievementCriteria->achievement == 318 && miscValue2 == referencePlayer->GetTeam()) + if (!miscValue1 || !unit || unit->GetTypeId() != TYPEID_PLAYER) return false; break; case ACHIEVEMENT_CRITERIA_TYPE_DEATHS_FROM: @@ -2517,9 +2531,9 @@ bool AchievementMgr::RequirementsSatisfied(AchievementCriteriaEntry const *ac return false; break; case ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE: - // miscValue1 = loot_type (note: 0 = LOOT_CORPSE and then it ignored) - // miscValue2 = count of item loot - if (!miscValue1 || !miscValue2 || miscValue1 != achievementCriteria->loot_type.lootType) + // miscValue1 = itemId - miscValue2 = count of item loot + // miscValue3 = loot_type (note: 0 = LOOT_CORPSE and then it ignored) + if (!miscValue1 || !miscValue2 || !miscValue3 || miscValue3 != achievementCriteria->loot_type.lootType) return false; break; case ACHIEVEMENT_CRITERIA_TYPE_OWN_ITEM: @@ -2627,7 +2641,7 @@ bool AchievementMgr::RequirementsSatisfied(AchievementCriteriaEntry const *ac { if (!miscValue1) return false; - ItemTemplate const* proto = sObjectMgr->GetItemTemplate(miscValue1); + ItemTemplate const* proto = sObjectMgr->GetItemTemplate(uint32(miscValue1)); if (!proto || proto->Quality < ITEM_QUALITY_EPIC) return false; break; @@ -2690,11 +2704,8 @@ bool AchievementMgr::AdditionalRequirementsSatisfied(AchievementCriteriaEntry return false; break; case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_MUST_BE_ENEMY: // 7 - if (!unit) + if (!unit || !referencePlayer->IsHostileTo(unit)) return false; - if (const Player* player = unit->ToPlayer()) - if (player->GetTeam() == referencePlayer->GetTeam()) - return false; break; case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_HAS_AURA: // 8 if (!referencePlayer->HasAura(reqValue)) @@ -2703,8 +2714,8 @@ bool AchievementMgr::AdditionalRequirementsSatisfied(AchievementCriteriaEntry case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_HAS_AURA: // 10 if (!unit || !unit->HasAura(reqValue)) return false; - case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_MUST_BE_MOUNTED: // 11 - if (!unit || !unit->IsMounted()) + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_HAS_AURA_TYPE: // 11 + if (!unit || !unit->HasAuraType(AuraType(reqValue))) return false; break; case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_ITEM_QUALITY_MIN: // 14 @@ -2723,20 +2734,26 @@ bool AchievementMgr::AdditionalRequirementsSatisfied(AchievementCriteriaEntry return false; break; } - case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_MAP_DIFFICULTY: // 20 - if (uint32(referencePlayer->GetMap()->GetDifficulty()) != reqValue) + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_AREA_OR_ZONE: // 17 + { + uint32 zoneId, areaId; + referencePlayer->GetZoneAndAreaId(zoneId, areaId); + if (zoneId != reqValue && areaId != reqValue) return false; break; - case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_MAP: // 32 - if (referencePlayer->GetMapId() != reqValue) + } + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_AREA_OR_ZONE: // 18 + { + if (!unit) return false; - break; - case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_ZONE: // 18 - if (referencePlayer->GetZoneId() != reqValue) + uint32 zoneId, areaId; + unit->GetZoneAndAreaId(zoneId, areaId); + if (zoneId != reqValue && areaId != reqValue) return false; break; - case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_AREA: // 17 - if (referencePlayer->GetAreaId() != reqValue) + } + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_MAP_DIFFICULTY: // 20 + if (uint32(referencePlayer->GetMap()->GetDifficulty()) != reqValue) return false; break; case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_RACE: // 25 @@ -2768,6 +2785,10 @@ bool AchievementMgr::AdditionalRequirementsSatisfied(AchievementCriteriaEntry return false; break; } + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_MAP: // 32 + if (referencePlayer->GetMapId() != reqValue) + return false; + break; case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TITLE_BIT_INDEX: // 38 // miscValue1 is title's bit index if (miscValue1 != reqValue) @@ -2781,6 +2802,9 @@ bool AchievementMgr::AdditionalRequirementsSatisfied(AchievementCriteriaEntry if (!unit || unit->getLevel() != reqValue) return false; break; + case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_ZONE: // 41 + if (!unit || unit->GetZoneId() != reqValue) + return false; case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_HEALTH_PERCENT_BELOW: // 46 if (!unit || unit->GetHealthPct() >= reqValue) return false; @@ -3019,10 +3043,12 @@ char const* AchievementGlobalMgr::GetCriteriaTypeString(AchievementCriteriaTypes return "HONORABLE_KILLS_GUILD"; case ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE_TYPE_GUILD: return "KILL_CREATURE_TYPE_GUILD"; - default: - return "MISSING_TYPE"; + case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_GUILD_CHALLENGE_TYPE: + return "GUILD_CHALLENGE_TYPE"; + case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_GUILD_CHALLENGE: + return "GUILD_CHALLENGE"; } - return ""; + return "MISSING_TYPE"; } template class AchievementMgr; @@ -3177,9 +3203,7 @@ void AchievementGlobalMgr::LoadCompletedAchievements() sLog->outError(LOG_FILTER_ACHIEVEMENTSYS, "Non-existing achievement %u data removed from table `character_achievement`.", achievementId); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVALID_ACHIEVMENT); - stmt->setUInt16(0, uint16(achievementId)); - CharacterDatabase.Execute(stmt); continue; diff --git a/src/server/game/Achievements/AchievementMgr.h b/src/server/game/Achievements/AchievementMgr.h index efb9fcba1b6..aa13dac3649 100755 --- a/src/server/game/Achievements/AchievementMgr.h +++ b/src/server/game/Achievements/AchievementMgr.h @@ -28,11 +28,15 @@ #include "DBCEnums.h" #include "DBCStores.h" -typedef std::list AchievementCriteriaEntryList; -typedef std::list AchievementEntryList; +class Unit; +class Player; +class WorldPacket; -typedef std::map AchievementCriteriaListByAchievement; -typedef std::map AchievementListByReferencedId; +typedef std::vector AchievementCriteriaEntryList; +typedef std::vector AchievementEntryList; + +typedef UNORDERED_MAP AchievementCriteriaListByAchievement; +typedef UNORDERED_MAP AchievementListByReferencedId; struct CriteriaProgress { @@ -66,9 +70,7 @@ enum AchievementCriteriaDataType }; #define MAX_ACHIEVEMENT_CRITERIA_DATA_TYPE 22 // maximum value in AchievementCriteriaDataType enum -class Player; -class Unit; -class WorldPacket; + struct AchievementCriteriaData { @@ -199,15 +201,15 @@ struct AchievementReward std::string text; }; -typedef std::map AchievementRewards; +typedef UNORDERED_MAP AchievementRewards; struct AchievementRewardLocale { - StringVector subject; - StringVector text; + std::vector subject; + std::vector text; }; -typedef std::map AchievementRewardLocales; +typedef UNORDERED_MAP AchievementRewardLocales; struct CompletedAchievementData { @@ -219,6 +221,13 @@ struct CompletedAchievementData typedef UNORDERED_MAP CriteriaProgressMap; typedef UNORDERED_MAP CompletedAchievementMap; +enum ProgressType +{ + PROGRESS_SET, + PROGRESS_ACCUMULATE, + PROGRESS_HIGHEST +}; + template class AchievementMgr { @@ -230,8 +239,8 @@ class AchievementMgr static void DeleteFromDB(uint32 lowguid); void LoadFromDB(PreparedQueryResult achievementResult, PreparedQueryResult criteriaResult); void SaveToDB(SQLTransaction& trans); - void ResetAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1 = 0, uint32 miscValue2 = 0, bool evenIfCriteriaComplete = false); - void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1 = 0, uint32 miscValue2 = 0, Unit const* unit = NULL, Player* referencePlayer = NULL); + void ResetAchievementCriteria(AchievementCriteriaTypes type, uint64 miscValue1 = 0, uint64 miscValue2 = 0, bool evenIfCriteriaComplete = false); + void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint64 miscValue1 = 0, uint64 miscValue2 = 0, uint64 miscValue3 = 0, Unit const* unit = NULL, Player* referencePlayer = NULL); void CompletedAchievement(AchievementEntry const* entry, Player* referencePlayer); void CheckAllAchievementCriteria(Player* referencePlayer); void SendAllAchievementData(Player* receiver) const; @@ -245,20 +254,19 @@ class AchievementMgr uint32 GetAchievementPoints() const { return _achievementPoints; } private: - enum ProgressType { PROGRESS_SET, PROGRESS_ACCUMULATE, PROGRESS_HIGHEST }; void SendAchievementEarned(AchievementEntry const* achievement) const; void SendCriteriaUpdate(AchievementCriteriaEntry const* entry, CriteriaProgress const* progress, uint32 timeElapsed, bool timedCompleted) const; CriteriaProgress* GetCriteriaProgress(AchievementCriteriaEntry const* entry); - void SetCriteriaProgress(AchievementCriteriaEntry const* entry, uint32 changeValue, Player* referencePlayer, ProgressType ptype = PROGRESS_SET); + void SetCriteriaProgress(AchievementCriteriaEntry const* entry, uint64 changeValue, Player* referencePlayer, ProgressType ptype = PROGRESS_SET); void RemoveCriteriaProgress(AchievementCriteriaEntry const* entry); void CompletedCriteriaFor(AchievementEntry const* achievement, Player* referencePlayer); bool IsCompletedCriteria(AchievementCriteriaEntry const* achievementCriteria, AchievementEntry const* achievement); bool IsCompletedAchievement(AchievementEntry const* entry); - bool CanUpdateCriteria(AchievementCriteriaEntry const* criteria, AchievementEntry const* achievement, uint64 miscValue1, uint64 miscValue2, Unit const* unit, Player* referencePlayer); + bool CanUpdateCriteria(AchievementCriteriaEntry const* criteria, AchievementEntry const* achievement, uint64 miscValue1, uint64 miscValue2, uint64 miscValue3, Unit const* unit, Player* referencePlayer); void SendPacket(WorldPacket* data) const; bool ConditionsSatisfied(AchievementCriteriaEntry const *criteria, Player* referencePlayer) const; - bool RequirementsSatisfied(AchievementCriteriaEntry const *criteria, uint64 miscValue1, uint64 miscValue2, Unit const* unit, Player* referencePlayer) const; + bool RequirementsSatisfied(AchievementCriteriaEntry const *criteria, uint64 miscValue1, uint64 miscValue2, uint64 miscValue3, Unit const* unit, Player* referencePlayer) const; bool AdditionalRequirementsSatisfied(AchievementCriteriaEntry const* criteria, uint64 miscValue1, uint64 miscValue2, Unit const* unit, Player* referencePlayer) const; T* _owner; diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index 389873f7caf..022ff8fa6ee 100755 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -914,9 +914,9 @@ void Battleground::EndBattleground(uint32 winner) if (uint32 guildId = GetBgMap()->GetOwnerGuildId(player->GetTeam())) if (Guild* guild = sGuildMgr->GetGuildById(guildId)) { - guild->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_BG, 1, 0, NULL, player); + guild->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_BG, 1, 0, 0, NULL, player); if (isArena() && isRated() && winnerArenaTeam && loserArenaTeam && winnerArenaTeam != loserArenaTeam) - guild->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA, std::max(winnerArenaTeam->GetRating(), 1), 0, NULL, player); + guild->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA, std::max(winnerArenaTeam->GetRating(), 1), 0, 0, NULL, player); } } } diff --git a/src/server/game/DataStores/DBCEnums.h b/src/server/game/DataStores/DBCEnums.h index 5217fa0d979..853202df8d0 100755 --- a/src/server/game/DataStores/DBCEnums.h +++ b/src/server/game/DataStores/DBCEnums.h @@ -111,15 +111,15 @@ enum AchievementCriteriaAdditionalCondition ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_MUST_BE_ENEMY = 7, ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_HAS_AURA = 8, ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_HAS_AURA = 10, - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_MUST_BE_MOUNTED = 11, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_HAS_AURA_TYPE = 11, ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_ITEM_QUALITY_MIN = 14, ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_ITEM_QUALITY_EQUALS = 15, ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK16 = 16, - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_AREA = 17, - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_ZONE = 18, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_AREA_OR_ZONE = 17, + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_AREA_OR_ZONE = 18, ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_MAP_DIFFICULTY = 20, ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_CREATURE_YIELDS_XP = 21, // NYI - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_ARENA_TEAM_SIZE = 24, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_ARENA_TYPE = 24, // NYI ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_RACE = 25, ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_CLASS = 26, ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_RACE = 27, @@ -129,12 +129,12 @@ enum AchievementCriteriaAdditionalCondition ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_MAP = 32, ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_ITEM_CLASS = 33, // NYI ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_ITEM_SUBCLASS = 34, // NYI - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK35 = 35, // related to timed completing-quests achievements + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_COMPLETE_QUEST_NOT_IN_GROUP = 35, // NYI ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_MIN_PERSONAL_RATING = 37, // NYI (when implementing don't forget about ACHIEVEMENT_CRITERIA_CONDITION_NO_LOSE) ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TITLE_BIT_INDEX = 38, ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_SOURCE_LEVEL = 39, ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_LEVEL = 40, - ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_ZONE = 41, // NYI + ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_ZONE = 41, ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_HEALTH_PERCENT_BELOW = 46, ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_UNK55 = 55, ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_MIN_ACHIEVEMENT_POINTS = 56, // NYI diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 2356f021d00..9fec81729bb 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -598,7 +598,7 @@ void KillRewarder::_RewardGroup() if (member->IsAtGroupRewardDistance(_victim)) { _RewardPlayer(member, isDungeon); - member->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_SPECIAL_PVP_KILL, 1, 0, _victim); + member->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_SPECIAL_PVP_KILL, 1, 0, 0, _victim); } } } @@ -635,7 +635,7 @@ void KillRewarder::Reward() if (uint32 guildId = victim->GetMap()->GetOwnerGuildId()) if (Guild* guild = sGuildMgr->GetGuildById(guildId)) - guild->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE, victim->GetEntry(), 1, victim, _killer); + guild->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE, victim->GetEntry(), 1, 0, victim, _killer); } } @@ -7156,7 +7156,7 @@ bool Player::RewardHonor(Unit* victim, uint32 groupsize, int32 honor, bool pvpto UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HK_CLASS, victim->getClass()); UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HK_RACE, victim->getRace()); UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL_AT_AREA, GetAreaId()); - UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL, 1, 0, victim); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL, 1, 0, 0, victim); } else { @@ -15910,7 +15910,7 @@ void Player::KilledMonsterCredit(uint32 entry, uint64 guid) } StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_CREATURE, real_entry); // MUST BE CALLED FIRST - UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE, real_entry, addkillcount, guid ? GetMap()->GetCreature(guid) : NULL); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE, real_entry, addkillcount, 0, guid ? GetMap()->GetCreature(guid) : NULL); for (uint8 i = 0; i < MAX_QUEST_LOG_SIZE; ++i) { @@ -23212,7 +23212,7 @@ uint32 Player::GetResurrectionSpellId() } // Used in triggers for check "Only to targets that grant experience or honor" req -bool Player::isHonorOrXPTarget(Unit* victim) +bool Player::isHonorOrXPTarget(Unit const *victim) { uint8 v_level = victim->getLevel(); uint8 k_grey = Trinity::XP::GetGrayLevel(getLevel()); @@ -23221,11 +23221,11 @@ bool Player::isHonorOrXPTarget(Unit* victim) if (v_level <= k_grey) return false; - if (victim->GetTypeId() == TYPEID_UNIT) + if (Creature const* const creature = victim->ToCreature()) { - if (victim->ToCreature()->isTotem() || - victim->ToCreature()->isPet() || - victim->ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_XP_AT_KILL) + if (creature->isTotem() || + creature->isPet() || + creature->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_XP_AT_KILL) return false; } return true; @@ -24194,7 +24194,7 @@ void Player::StoreLootItem(uint8 lootSlot, Loot* loot) SendNewItem(newitem, uint32(item->count), false, false, true); UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM, item->itemid, item->count); - UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE, loot->loot_type, item->count); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE, item->itemid, item->count, loot->loot_type); UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_EPIC_ITEM, item->itemid, item->count); } else @@ -24517,22 +24517,24 @@ void Player::RemoveTimedAchievement(AchievementCriteriaTimedTypes type, uint32 e m_achievementMgr.RemoveTimedAchievement(type, entry); } -void Player::ResetAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1 /*= 0*/, uint32 miscValue2 /*= 0*/, bool evenIfCriteriaComplete /* = false*/) +void Player::ResetAchievementCriteria(AchievementCriteriaTypes type, uint64 miscValue1 /*= 0*/, uint64 miscValue2 /*= 0*/, bool evenIfCriteriaComplete /* = false*/) { m_achievementMgr.ResetAchievementCriteria(type, miscValue1, miscValue2, evenIfCriteriaComplete); } -void Player::UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1 /*= 0*/, uint32 miscValue2 /*= 0*/, Unit* unit /*= NULL*/) +void Player::UpdateAchievementCriteria(AchievementCriteriaTypes type, uint64 miscValue1 /*= 0*/, uint64 miscValue2 /*= 0*/, uint64 miscValue3 /*= 0*/, Unit* unit /*= NULL*/) { - m_achievementMgr.UpdateAchievementCriteria(type, miscValue1, miscValue2, unit, this); + m_achievementMgr.UpdateAchievementCriteria(type, miscValue1, miscValue2, miscValue3, unit, this); + Guild* guild = sGuildMgr->GetGuildById(GetGuildId()); + if (!guild) + return; // Update only individual achievement criteria here, otherwise we may get multiple updates // from a single boss kill if (sAchievementMgr->IsGroupCriteriaType(type)) return; - if (Guild* guild = sGuildMgr->GetGuildById(GetGuildId())) - guild->UpdateAchievementCriteria(type, miscValue1, miscValue2, unit, this); + guild->UpdateAchievementCriteria(type, miscValue1, miscValue2, miscValue3, unit, this); } void Player::CompletedAchievement(AchievementEntry const* entry) diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index b1bd61480de..2f044326b96 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -2090,7 +2090,7 @@ class Player : public Unit, public GridObject void StoreRaidMapDifficulty() { m_raidMapDifficulty = GetMap()->GetDifficulty(); } bool UpdateSkill(uint32 skill_id, uint32 step); - bool UpdateSkillPro(uint16 SkillId, int32 Chance, uint32 step); + bool UpdateSkillPro(uint16 skillId, int32 chance, uint32 step); bool UpdateCraftSkill(uint32 spellid); bool UpdateGatherSkill(uint32 SkillId, uint32 SkillValue, uint32 RedLevel, uint32 Multiplicator = 1); @@ -2254,7 +2254,7 @@ class Player : public Unit, public GridObject bool IsAtRecruitAFriendDistance(WorldObject const* pOther) const; void RewardPlayerAndGroupAtKill(Unit* victim, bool isBattleGround); void RewardPlayerAndGroupAtEvent(uint32 creature_id, WorldObject* pRewardSource); - bool isHonorOrXPTarget(Unit* victim); + bool isHonorOrXPTarget(Unit const *victim); bool GetsRecruitAFriendBonus(bool forXP); uint8 GetGrantableLevels() { return m_grantableLevels; } @@ -2706,8 +2706,8 @@ class Player : public Unit, public GridObject bool HasAchieved(uint32 achievementId) const; void ResetAchievements(); void CheckAllAchievementCriteria(); - void ResetAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1 = 0, uint32 miscValue2 = 0, bool evenIfCriteriaComplete = false); - void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1 = 0, uint32 miscValue2 = 0, Unit* unit = NULL); + void ResetAchievementCriteria(AchievementCriteriaTypes type, uint64 miscValue1 = 0, uint64 miscValue2 = 0, bool evenIfCriteriaComplete = false); + void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint64 miscValue1 = 0, uint64 miscValue2 = 0, uint64 miscValue3 = 0, Unit* unit = NULL); void StartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry, uint32 timeLost = 0); void RemoveTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry); void CompletedAchievement(AchievementEntry const* entry); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index fea9a73386a..7ee40ce9fed 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -672,7 +672,7 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam if (Battleground* bg = killer->GetBattleground()) bg->UpdatePlayerScore(killer, SCORE_DAMAGE_DONE, damage); - killer->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DAMAGE_DONE, damage, 0, victim); + killer->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DAMAGE_DONE, damage, 0, 0, victim); killer->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HIT_DEALT, damage); } @@ -9025,7 +9025,7 @@ int32 Unit::DealHeal(Unit* victim, uint32 addhealth) // use the actual gain, as the overheal shall not be counted, skip gain 0 (it ignored anyway in to criteria) if (gain) - player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HEALING_DONE, gain, 0, victim); + player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HEALING_DONE, gain, 0, 0, victim); player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEAL_CASTED, addhealth); } @@ -9217,7 +9217,7 @@ void Unit::UnsummonAllTotems() void Unit::SendHealSpellLog(Unit* victim, uint32 SpellID, uint32 Damage, uint32 OverHeal, uint32 Absorb, bool critical) { // we guess size - WorldPacket data(SMSG_SPELLHEALLOG, (8+8+4+4+4+4+1+1)); + WorldPacket data(SMSG_SPELLHEALLOG, 8+8+4+4+4+4+1+1); data.append(victim->GetPackGUID()); data.append(GetPackGUID()); data << uint32(SpellID); @@ -14684,7 +14684,7 @@ void Unit::Kill(Unit* victim, bool durabilityLoss) // update get killing blow achievements, must be done before setDeathState to be able to require auras on target // and before Spirit of Redemption as it also removes auras if (player) - player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GET_KILLING_BLOWS, 1, 0, victim); + player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GET_KILLING_BLOWS, 1, 0, 0, victim); // if talent known but not triggered (check priest class for speedup check) bool spiritOfRedemption = false; diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 78cd9fb1da5..1a73974b906 100644 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -3450,7 +3450,7 @@ void Guild::GiveXP(uint32 xp, Player* source) } AddGuildNews(GUILD_NEWS_LEVEL_UP, 0, 0, _level); - UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_GUILD_LEVEL, GetLevel(), 0, NULL, source); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_GUILD_LEVEL, GetLevel(), 0, 0, NULL, source); } void Guild::SendGuildXP(WorldSession* session /* = NULL */) const @@ -3513,9 +3513,9 @@ bool Guild::HasAchieved(uint32 achievementId) const return m_achievementMgr.HasAchieved(achievementId); } -void Guild::UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1, uint32 miscValue2, Unit* unit, Player* player) +void Guild::UpdateAchievementCriteria(AchievementCriteriaTypes type, uint64 miscValue1, uint64 miscValue2, uint64 miscValue3, Unit* unit, Player* player) { - m_achievementMgr.UpdateAchievementCriteria(type, miscValue1, miscValue2, unit, player); + m_achievementMgr.UpdateAchievementCriteria(type, miscValue1, miscValue2, miscValue3, unit, player); } void Guild::HandleNewsSetSticky(WorldSession* session, uint32 newsId, bool sticky) diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h index ddb7ab505cc..36d8d56b30c 100755 --- a/src/server/game/Guilds/Guild.h +++ b/src/server/game/Guilds/Guild.h @@ -865,7 +865,7 @@ public: void ResetTimes(bool weekly); bool HasAchieved(uint32 achievementId) const; - void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1, uint32 miscValue2, Unit* unit, Player* player); + void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint64 miscValue1, uint64 miscValue2, uint64 miscValue3, Unit* unit, Player* player); protected: uint32 m_id; diff --git a/src/server/game/Handlers/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cpp index 2a923250ad3..d194d379b5c 100644 --- a/src/server/game/Handlers/ChatHandler.cpp +++ b/src/server/game/Handlers/ChatHandler.cpp @@ -748,7 +748,7 @@ void WorldSession::HandleTextEmoteOpcode(WorldPacket& recvData) TypeContainerVisitor >, WorldTypeMapContainer> message(emote_worker); cell.Visit(p, message, *GetPlayer()->GetMap(), *GetPlayer(), sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE)); - GetPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE, text_emote, 0, unit); + GetPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE, text_emote, 0, 0, unit); //Send scripted event call if (unit && unit->GetTypeId() == TYPEID_UNIT && ((Creature*)unit)->AI()) diff --git a/src/server/game/Handlers/LootHandler.cpp b/src/server/game/Handlers/LootHandler.cpp index 5f3e3d58da5..c8d6d749331 100755 --- a/src/server/game/Handlers/LootHandler.cpp +++ b/src/server/game/Handlers/LootHandler.cpp @@ -509,7 +509,7 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPacket& recvData) Item* newitem = target->StoreNewItem(dest, item.itemid, true, item.randomPropertyId, looters); target->SendNewItem(newitem, uint32(item.count), false, false, true); target->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM, item.itemid, item.count); - target->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE, loot->loot_type, item.count); + target->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE, item.itemid, item.count, loot->loot_type); target->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_EPIC_ITEM, item.itemid, item.count); // mark as looted diff --git a/src/server/game/Instances/InstanceScript.cpp b/src/server/game/Instances/InstanceScript.cpp index f14dc3c8b14..af4b33e079c 100755 --- a/src/server/game/Instances/InstanceScript.cpp +++ b/src/server/game/Instances/InstanceScript.cpp @@ -328,7 +328,7 @@ void InstanceScript::DoUpdateAchievementCriteria(AchievementCriteriaTypes type, if (!PlayerList.isEmpty()) for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) if (Player* player = i->getSource()) - player->UpdateAchievementCriteria(type, miscValue1, miscValue2, unit); + player->UpdateAchievementCriteria(type, miscValue1, miscValue2, 0, unit); } // Start timed achievement for all players in instance diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 89c698744a3..bb482704bb7 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -2569,14 +2569,14 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA if (Player* player = unit->ToPlayer()) { player->StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_SPELL_TARGET, m_spellInfo->Id); - player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, m_spellInfo->Id, 0, m_caster); + player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, m_spellInfo->Id, 0, 0, m_caster); player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2, m_spellInfo->Id); } if (Player* player = m_caster->ToPlayer()) { player->StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_SPELL_CASTER, m_spellInfo->Id); - player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL2, m_spellInfo->Id, 0, unit); + player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL2, m_spellInfo->Id, 0, 0, unit); } if (m_caster != unit) -- cgit v1.2.3 From 49c250f3c5ffa64e35c7893b10c34d8e553cf7bf Mon Sep 17 00:00:00 2001 From: Spp Date: Mon, 12 Nov 2012 15:27:01 +0100 Subject: Core: Removed passing of integer types by const reference where possible --- src/server/game/AI/CoreAI/GameObjectAI.h | 4 ++-- src/server/game/Battlefield/Battlefield.cpp | 2 +- src/server/game/Battlefield/Battlefield.h | 18 +++++++++--------- src/server/game/Globals/ObjectMgr.cpp | 4 ++-- src/server/game/Miscellaneous/SharedDefines.h | 8 ++++---- src/server/game/Movement/MovementGenerator.h | 4 ++-- .../MovementGenerators/ConfusedMovementGenerator.cpp | 6 +++--- .../MovementGenerators/ConfusedMovementGenerator.h | 2 +- .../MovementGenerators/FleeingMovementGenerator.cpp | 10 +++++----- .../MovementGenerators/FleeingMovementGenerator.h | 4 ++-- .../MovementGenerators/IdleMovementGenerator.cpp | 4 ++-- .../MovementGenerators/IdleMovementGenerator.h | 6 +++--- .../MovementGenerators/PointMovementGenerator.cpp | 8 ++++---- .../MovementGenerators/PointMovementGenerator.h | 4 ++-- .../MovementGenerators/TargetedMovementGenerator.cpp | 10 +++++----- .../MovementGenerators/TargetedMovementGenerator.h | 2 +- .../MovementGenerators/WaypointMovementGenerator.cpp | 4 ++-- .../MovementGenerators/WaypointMovementGenerator.h | 4 ++-- 18 files changed, 52 insertions(+), 52 deletions(-) (limited to 'src') diff --git a/src/server/game/AI/CoreAI/GameObjectAI.h b/src/server/game/AI/CoreAI/GameObjectAI.h index 6dfea9ac158..195f8d19c86 100644 --- a/src/server/game/AI/CoreAI/GameObjectAI.h +++ b/src/server/game/AI/CoreAI/GameObjectAI.h @@ -37,11 +37,11 @@ class GameObjectAI virtual void InitializeAI() { Reset(); } - virtual void Reset() {}; + virtual void Reset() { } // Pass parameters between AI virtual void DoAction(const int32 /*param = 0 */) {} - virtual void SetGUID(const uint64& /*guid*/, int32 /*id = 0 */) {} + virtual void SetGUID(uint64 /*guid*/, int32 /*id = 0 */) {} virtual uint64 GetGUID(int32 /*id = 0 */) { return 0; } static int Permissible(GameObject const* go); diff --git a/src/server/game/Battlefield/Battlefield.cpp b/src/server/game/Battlefield/Battlefield.cpp index 36193527f13..f1a2e22b34b 100644 --- a/src/server/game/Battlefield/Battlefield.cpp +++ b/src/server/game/Battlefield/Battlefield.cpp @@ -659,7 +659,7 @@ void Battlefield::RemovePlayerFromResurrectQueue(uint64 playerGuid) } } -void Battlefield::SendAreaSpiritHealerQueryOpcode(Player* player, const uint64 &guid) +void Battlefield::SendAreaSpiritHealerQueryOpcode(Player* player, uint64 guid) { WorldPacket data(SMSG_AREA_SPIRIT_HEALER_TIME, 12); uint32 time = m_LastResurectTimer; // resurrect every 30 seconds diff --git a/src/server/game/Battlefield/Battlefield.h b/src/server/game/Battlefield/Battlefield.h index 07851f9aa72..7bd893e3e56 100644 --- a/src/server/game/Battlefield/Battlefield.h +++ b/src/server/game/Battlefield/Battlefield.h @@ -304,19 +304,19 @@ class Battlefield : public ZoneScript // Script-methods /// Called on start - virtual void OnBattleStart() {}; + virtual void OnBattleStart() { } /// Called at the end of battle - virtual void OnBattleEnd(bool /*endByTimer*/) {}; + virtual void OnBattleEnd(bool /*endByTimer*/) { } /// Called x minutes before battle start when player in zone are invite to join queue - virtual void OnStartGrouping() {}; + virtual void OnStartGrouping() { } /// Called when a player accept to join the battle - virtual void OnPlayerJoinWar(Player* /*player*/) {}; + virtual void OnPlayerJoinWar(Player* /*player*/) { } /// Called when a player leave the battle - virtual void OnPlayerLeaveWar(Player* /*player*/) {}; + virtual void OnPlayerLeaveWar(Player* /*player*/) { } /// Called when a player leave battlefield zone - virtual void OnPlayerLeaveZone(Player* /*player*/) {}; + virtual void OnPlayerLeaveZone(Player* /*player*/) { } /// Called when a player enter in battlefield zone - virtual void OnPlayerEnterZone(Player* /*player*/) {}; + virtual void OnPlayerEnterZone(Player* /*player*/) { } WorldPacket BuildWarningAnnPacket(std::string const& msg); void SendWarningToAllInZone(uint32 entry); @@ -328,7 +328,7 @@ class Battlefield : public ZoneScript uint32 GetBattleId() { return m_BattleId; } void AskToLeaveQueue(Player* player); - virtual void DoCompleteOrIncrementAchievement(uint32 /*achievement*/, Player* /*player*/, uint8 /*incrementNumber = 1*/) {}; + virtual void DoCompleteOrIncrementAchievement(uint32 /*achievement*/, Player* /*player*/, uint8 /*incrementNumber = 1*/) { } /// Send all worldstate data to all player in zone. virtual void SendInitWorldStatesToAll() = 0; @@ -337,7 +337,7 @@ class Battlefield : public ZoneScript /// Return if we can use mount in battlefield bool CanFlyIn() { return !m_isActive; } - void SendAreaSpiritHealerQueryOpcode(Player* player, const uint64 & guid); + void SendAreaSpiritHealerQueryOpcode(Player* player, uint64 guid); void StartBattle(); void EndBattle(bool endByTimer); diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index edf5aba1305..96e0c246f1c 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -6190,7 +6190,7 @@ inline void CheckGOSpellId(GameObjectTemplate const* goInfo, uint32 dataN, uint3 goInfo->entry, goInfo->type, N, dataN, dataN); } -inline void CheckAndFixGOChairHeightId(GameObjectTemplate const* goInfo, uint32 const& dataN, uint32 N) +inline void CheckAndFixGOChairHeightId(GameObjectTemplate const* goInfo, uint32& dataN, uint32 N) { if (dataN <= (UNIT_STAND_STATE_SIT_HIGH_CHAIR-UNIT_STAND_STATE_SIT_LOW_CHAIR)) return; @@ -6199,7 +6199,7 @@ inline void CheckAndFixGOChairHeightId(GameObjectTemplate const* goInfo, uint32 goInfo->entry, goInfo->type, N, dataN, UNIT_STAND_STATE_SIT_HIGH_CHAIR-UNIT_STAND_STATE_SIT_LOW_CHAIR); // prevent client and server unexpected work - const_cast(dataN) = 0; + dataN = 0; } inline void CheckGONoDamageImmuneId(GameObjectTemplate* goTemplate, uint32 dataN, uint32 N) diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 9e160c9fe86..3f2500b6b27 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -534,7 +534,7 @@ enum SpellAttr7 SPELL_ATTR7_REACTIVATE_AT_RESURRECT = 0x00000004, // 2 Paladin's auras and 65607 only. SPELL_ATTR7_IS_CHEAT_SPELL = 0x00000008, // 3 Cannot cast if caster doesn't have UnitFlag2 & UNIT_FLAG2_ALLOW_CHEAT_SPELLS SPELL_ATTR7_UNK4 = 0x00000010, // 4 Only 47883 (Soulstone Resurrection) and test spell. - SPELL_ATTR7_SUMMON_TOTEM = 0x00000020, // 5 Only Shaman player totems. + SPELL_ATTR7_SUMMON_TOTEM = 0x00000020, // 5 Only Shaman totems. SPELL_ATTR7_UNK6 = 0x00000040, // 6 Dark Surge, Surge of Light, Burning Breath triggers (boss spells). SPELL_ATTR7_UNK7 = 0x00000080, // 7 66218 (Launch) spell. SPELL_ATTR7_HORDE_ONLY = 0x00000100, // 8 Teleports, mounts and other spells. @@ -565,7 +565,7 @@ enum SpellAttr7 enum SpellAttr8 { - SPELL_ATTR8_UNK0 = 0x00000001, // 0 + SPELL_ATTR8_CANT_MISS = 0x00000001, // 0 SPELL_ATTR8_UNK1 = 0x00000002, // 1 SPELL_ATTR8_UNK2 = 0x00000004, // 2 SPELL_ATTR8_UNK3 = 0x00000008, // 3 @@ -593,7 +593,7 @@ enum SpellAttr8 SPELL_ATTR8_UNK25 = 0x02000000, // 25 SPELL_ATTR8_RAID_MARKER = 0x04000000, // 26 probably spell no need learn to cast SPELL_ATTR8_UNK27 = 0x08000000, // 27 - SPELL_ATTR8_GUILD_PERKS = 0x10000000, // 28 + SPELL_ATTR8_NOT_IN_BG_OR_ARENA = 0x10000000, // 28 not allow to cast or deactivate currently active effect, not sure about Fast Track SPELL_ATTR8_MASTERY = 0x20000000, // 29 SPELL_ATTR8_UNK30 = 0x40000000, // 30 SPELL_ATTR8_UNK31 = 0x80000000 // 31 @@ -605,7 +605,7 @@ enum SpellAttr9 SPELL_ATTR9_UNK1 = 0x00000002, // 1 SPELL_ATTR9_RESTRICTED_FLIGHT_AREA = 0x00000004, // 2 Dalaran and Wintergrasp flight area auras have it SPELL_ATTR9_UNK3 = 0x00000008, // 3 - SPELL_ATTR9_UNK4 = 0x00000010, // 4 + SPELL_ATTR9_SPECIAL_DELAY_CALCULATION = 0x00000010, // 4 SPELL_ATTR9_SUMMON_PLAYER_TOTEM = 0x00000020, // 5 SPELL_ATTR9_UNK6 = 0x00000040, // 6 SPELL_ATTR9_UNK7 = 0x00000080, // 7 diff --git a/src/server/game/Movement/MovementGenerator.h b/src/server/game/Movement/MovementGenerator.h index 0c1fc8114ca..e586d7e6ae6 100755 --- a/src/server/game/Movement/MovementGenerator.h +++ b/src/server/game/Movement/MovementGenerator.h @@ -38,7 +38,7 @@ class MovementGenerator virtual void Reset(Unit &) = 0; - virtual bool Update(Unit &, const uint32& time_diff) = 0; + virtual bool Update(Unit &, uint32 time_diff) = 0; virtual MovementGeneratorType GetMovementGeneratorType() = 0; @@ -64,7 +64,7 @@ class MovementGeneratorMedium : public MovementGenerator //u->AssertIsType(); (static_cast(this))->DoReset(*((T*)&u)); } - bool Update(Unit &u, const uint32& time_diff) + bool Update(Unit &u, uint32 time_diff) { //u->AssertIsType(); return (static_cast(this))->DoUpdate(*((T*)&u), time_diff); diff --git a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp index b8925c8b512..f93e94fa35b 100755 --- a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp @@ -109,7 +109,7 @@ void ConfusedMovementGenerator::DoReset(T &unit) } template -bool ConfusedMovementGenerator::DoUpdate(T &unit, const uint32 &diff) +bool ConfusedMovementGenerator::DoUpdate(T &unit, uint32 diff) { if (unit.HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED | UNIT_STATE_DISTRACTED)) return true; @@ -168,6 +168,6 @@ template void ConfusedMovementGenerator::DoInitialize(Player &player); template void ConfusedMovementGenerator::DoInitialize(Creature &creature); template void ConfusedMovementGenerator::DoReset(Player &player); template void ConfusedMovementGenerator::DoReset(Creature &creature); -template bool ConfusedMovementGenerator::DoUpdate(Player &player, const uint32 &diff); -template bool ConfusedMovementGenerator::DoUpdate(Creature &creature, const uint32 &diff); +template bool ConfusedMovementGenerator::DoUpdate(Player &player, uint32 diff); +template bool ConfusedMovementGenerator::DoUpdate(Creature &creature, uint32 diff); diff --git a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.h b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.h index 1943b113888..34ce1e04dd2 100755 --- a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.h @@ -33,7 +33,7 @@ class ConfusedMovementGenerator : public MovementGeneratorMedium< T, ConfusedMov void DoInitialize(T &); void DoFinalize(T &); void DoReset(T &); - bool DoUpdate(T &, const uint32 &); + bool DoUpdate(T &, uint32); MovementGeneratorType GetMovementGeneratorType() { return CONFUSED_MOTION_TYPE; } private: diff --git a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp index e57e8ac7390..313a29a1b59 100755 --- a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp @@ -354,7 +354,7 @@ void FleeingMovementGenerator::DoReset(T &owner) } template -bool FleeingMovementGenerator::DoUpdate(T &owner, const uint32 &time_diff) +bool FleeingMovementGenerator::DoUpdate(T &owner, uint32 time_diff) { if (!&owner || !owner.isAlive()) return false; @@ -381,8 +381,8 @@ template void FleeingMovementGenerator::_setTargetLocation(Player &); template void FleeingMovementGenerator::_setTargetLocation(Creature &); template void FleeingMovementGenerator::DoReset(Player &); template void FleeingMovementGenerator::DoReset(Creature &); -template bool FleeingMovementGenerator::DoUpdate(Player &, const uint32 &); -template bool FleeingMovementGenerator::DoUpdate(Creature &, const uint32 &); +template bool FleeingMovementGenerator::DoUpdate(Player &, uint32); +template bool FleeingMovementGenerator::DoUpdate(Creature &, uint32); void TimedFleeingMovementGenerator::Finalize(Unit &owner) { @@ -398,7 +398,7 @@ void TimedFleeingMovementGenerator::Finalize(Unit &owner) } } -bool TimedFleeingMovementGenerator::Update(Unit & owner, const uint32& time_diff) +bool TimedFleeingMovementGenerator::Update(Unit & owner, uint32 time_diff) { if (!owner.isAlive()) return false; @@ -413,7 +413,7 @@ bool TimedFleeingMovementGenerator::Update(Unit & owner, const uint32& time_diff if (i_totalFleeTime.Passed()) return false; - // This calls grant-parent Update method hiden by FleeingMovementGenerator::Update(Creature &, const uint32 &) version + // This calls grant-parent Update method hiden by FleeingMovementGenerator::Update(Creature &, uint32) version // This is done instead of casting Unit& to Creature& and call parent method, then we can use Unit directly return MovementGeneratorMedium< Creature, FleeingMovementGenerator >::Update(owner, time_diff); } diff --git a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.h b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.h index 288abbb5753..5acebb54c99 100755 --- a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.h @@ -30,7 +30,7 @@ class FleeingMovementGenerator : public MovementGeneratorMedium< T, FleeingMovem void DoInitialize(T &); void DoFinalize(T &); void DoReset(T &); - bool DoUpdate(T &, const uint32 &); + bool DoUpdate(T &, uint32); MovementGeneratorType GetMovementGeneratorType() { return FLEEING_MOTION_TYPE; } @@ -62,7 +62,7 @@ class TimedFleeingMovementGenerator : public FleeingMovementGenerator i_totalFleeTime(time) {} MovementGeneratorType GetMovementGeneratorType() { return TIMED_FLEEING_MOTION_TYPE; } - bool Update(Unit &, const uint32&); + bool Update(Unit &, uint32); void Finalize(Unit &); private: diff --git a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp index 5a2090cfe28..e237f22e8b1 100755 --- a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp @@ -48,7 +48,7 @@ void RotateMovementGenerator::Initialize(Unit& owner) owner.AttackStop(); } -bool RotateMovementGenerator::Update(Unit& owner, const uint32& diff) +bool RotateMovementGenerator::Update(Unit& owner, uint32 diff) { float angle = owner.GetOrientation(); if (m_direction == ROTATE_DIRECTION_LEFT) @@ -89,7 +89,7 @@ void DistractMovementGenerator::Finalize(Unit& owner) owner.ClearUnitState(UNIT_STATE_DISTRACTED); } -bool DistractMovementGenerator::Update(Unit& /*owner*/, const uint32& time_diff) +bool DistractMovementGenerator::Update(Unit& /*owner*/, uint32 time_diff) { if (time_diff > m_timer) return false; diff --git a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.h b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.h index 7acec82af98..ad28cc185e6 100755 --- a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.h @@ -28,7 +28,7 @@ class IdleMovementGenerator : public MovementGenerator void Initialize(Unit &); void Finalize(Unit &) { } void Reset(Unit &); - bool Update(Unit &, const uint32&) { return true; } + bool Update(Unit &, uint32) { return true; } MovementGeneratorType GetMovementGeneratorType() { return IDLE_MOTION_TYPE; } }; @@ -42,7 +42,7 @@ class RotateMovementGenerator : public MovementGenerator void Initialize(Unit& owner); void Finalize(Unit& owner); void Reset(Unit& owner) { Initialize(owner); } - bool Update(Unit& owner, const uint32& time_diff); + bool Update(Unit& owner, uint32 time_diff); MovementGeneratorType GetMovementGeneratorType() { return ROTATE_MOTION_TYPE; } private: @@ -58,7 +58,7 @@ class DistractMovementGenerator : public MovementGenerator void Initialize(Unit& owner); void Finalize(Unit& owner); void Reset(Unit& owner) { Initialize(owner); } - bool Update(Unit& owner, const uint32& time_diff); + bool Update(Unit& owner, uint32 time_diff); MovementGeneratorType GetMovementGeneratorType() { return DISTRACT_MOTION_TYPE; } private: diff --git a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp index 91f77e8ebfe..9bc3e09640f 100755 --- a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp @@ -42,7 +42,7 @@ void PointMovementGenerator::DoInitialize(T &unit) } template -bool PointMovementGenerator::DoUpdate(T &unit, const uint32 & /*diff*/) +bool PointMovementGenerator::DoUpdate(T &unit, uint32 /*diff*/) { if (!&unit) return false; @@ -103,8 +103,8 @@ template void PointMovementGenerator::DoFinalize(Player&); template void PointMovementGenerator::DoFinalize(Creature&); template void PointMovementGenerator::DoReset(Player&); template void PointMovementGenerator::DoReset(Creature&); -template bool PointMovementGenerator::DoUpdate(Player &, const uint32 &); -template bool PointMovementGenerator::DoUpdate(Creature&, const uint32 &); +template bool PointMovementGenerator::DoUpdate(Player &, uint32); +template bool PointMovementGenerator::DoUpdate(Creature&, uint32); void AssistanceMovementGenerator::Finalize(Unit &unit) { @@ -114,7 +114,7 @@ void AssistanceMovementGenerator::Finalize(Unit &unit) unit.GetMotionMaster()->MoveSeekAssistanceDistract(sWorld->getIntConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_DELAY)); } -bool EffectMovementGenerator::Update(Unit &unit, const uint32&) +bool EffectMovementGenerator::Update(Unit &unit, uint32) { return !unit.movespline->Finalized(); } diff --git a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h index 62ffb931e6d..93516e5d354 100755 --- a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h @@ -32,7 +32,7 @@ class PointMovementGenerator : public MovementGeneratorMedium< T, PointMovementG void DoInitialize(T &); void DoFinalize(T &); void DoReset(T &); - bool DoUpdate(T &, const uint32 &); + bool DoUpdate(T &, uint32); void MovementInform(T &); @@ -66,7 +66,7 @@ class EffectMovementGenerator : public MovementGenerator void Initialize(Unit &) {} void Finalize(Unit &unit); void Reset(Unit &) {} - bool Update(Unit &u, const uint32&); + bool Update(Unit &u, uint32); MovementGeneratorType GetMovementGeneratorType() { return EFFECT_MOTION_TYPE; } private: uint32 m_Id; diff --git a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp index 7e74907040f..d6c69c2c679 100755 --- a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp @@ -120,7 +120,7 @@ void TargetedMovementGeneratorMedium } template -bool TargetedMovementGeneratorMedium::DoUpdate(T &owner, const uint32 & time_diff) +bool TargetedMovementGeneratorMedium::DoUpdate(T &owner, uint32 time_diff) { if (!i_target.isValid() || !i_target->IsInWorld()) return false; @@ -306,10 +306,10 @@ template void TargetedMovementGeneratorMedium >::_setTargetLocation(Player &); template void TargetedMovementGeneratorMedium >::_setTargetLocation(Creature &); template void TargetedMovementGeneratorMedium >::_setTargetLocation(Creature &); -template bool TargetedMovementGeneratorMedium >::DoUpdate(Player &, const uint32 &); -template bool TargetedMovementGeneratorMedium >::DoUpdate(Player &, const uint32 &); -template bool TargetedMovementGeneratorMedium >::DoUpdate(Creature &, const uint32 &); -template bool TargetedMovementGeneratorMedium >::DoUpdate(Creature &, const uint32 &); +template bool TargetedMovementGeneratorMedium >::DoUpdate(Player &, uint32); +template bool TargetedMovementGeneratorMedium >::DoUpdate(Player &, uint32); +template bool TargetedMovementGeneratorMedium >::DoUpdate(Creature &, uint32); +template bool TargetedMovementGeneratorMedium >::DoUpdate(Creature &, uint32); template void ChaseMovementGenerator::_reachTarget(Player &); template void ChaseMovementGenerator::_reachTarget(Creature &); diff --git a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h index 94b4078efbd..f4a36e13a74 100755 --- a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h @@ -46,7 +46,7 @@ class TargetedMovementGeneratorMedium : public MovementGeneratorMedium< T, D >, ~TargetedMovementGeneratorMedium() {} public: - bool DoUpdate(T &, const uint32 &); + bool DoUpdate(T &, uint32); Unit* GetTarget() const { return i_target.getTarget(); } void unitSpeedChanged() { i_recalculateTravel=true; } diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp index ba67aa00526..38a03ff9b21 100755 --- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp @@ -130,7 +130,7 @@ bool WaypointMovementGenerator::StartMove(Creature &creature) return true; } -bool WaypointMovementGenerator::DoUpdate(Creature &creature, const uint32 &diff) +bool WaypointMovementGenerator::DoUpdate(Creature &creature, uint32 diff) { // Waypoint movement can be switched on/off // This is quite handy for escort quests and other stuff @@ -243,7 +243,7 @@ void FlightPathMovementGenerator::DoReset(Player & player) init.Launch(); } -bool FlightPathMovementGenerator::DoUpdate(Player &player, const uint32& /*diff*/) +bool FlightPathMovementGenerator::DoUpdate(Player &player, uint32 /*diff*/) { uint32 pointId = (uint32)player.movespline->currentPathIdx(); if (pointId > i_currentNode) diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h index bb6381da2f0..0bd75076a33 100755 --- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h @@ -68,7 +68,7 @@ class WaypointMovementGenerator : public MovementGeneratorMedium< Crea void DoInitialize(Creature &); void DoFinalize(Creature &); void DoReset(Creature &); - bool DoUpdate(Creature &, const uint32 &diff); + bool DoUpdate(Creature &, uint32 diff); void MovementInform(Creature &); @@ -121,7 +121,7 @@ class FlightPathMovementGenerator : public MovementGeneratorMedium< Player, Flig void DoInitialize(Player &); void DoReset(Player &); void DoFinalize(Player &); - bool DoUpdate(Player &, const uint32&); + bool DoUpdate(Player &, uint32); MovementGeneratorType GetMovementGeneratorType() { return FLIGHT_MOTION_TYPE; } TaxiPathNodeList const& GetPath() { return *i_path; } -- cgit v1.2.3 From 967068d81ac42609d5d3990f52dc3714a1266571 Mon Sep 17 00:00:00 2001 From: Shocker Date: Wed, 14 Nov 2012 22:39:11 +0200 Subject: Core/Currency: Use define for currency precision --- src/server/game/Entities/Player/Player.cpp | 12 ++++++------ src/server/game/Handlers/ItemHandler.cpp | 2 +- src/server/game/Miscellaneous/SharedDefines.h | 2 ++ 3 files changed, 9 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 9fec81729bb..a94346ec7ab 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -7303,7 +7303,7 @@ void Player::SendNewCurrency(uint32 id) const if (!entry) // should never happen return; - uint32 precision = (entry->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? 100 : 1; + uint32 precision = (entry->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? CURRENCY_PRECISION : 1; uint32 weekCount = itr->second.weekCount / precision; uint32 weekCap = _GetCurrencyWeekCap(entry) / precision; @@ -7340,7 +7340,7 @@ void Player::SendCurrencies() const if (!entry) // should never happen continue; - uint32 precision = (entry->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? 100 : 1; + uint32 precision = (entry->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? CURRENCY_PRECISION : 1; uint32 weekCount = itr->second.weekCount / precision; uint32 weekCap = _GetCurrencyWeekCap(entry) / precision; @@ -7389,7 +7389,7 @@ void Player::ModifyCurrency(uint32 id, int32 count, bool printLog/* = true*/, bo if (!ignoreMultipliers) count *= GetTotalAuraMultiplierByMiscValue(SPELL_AURA_MOD_CURRENCY_GAIN, id); - int32 precision = currency->Flags & CURRENCY_FLAG_HIGH_PRECISION ? 100 : 1; + int32 precision = currency->Flags & CURRENCY_FLAG_HIGH_PRECISION ? CURRENCY_PRECISION : 1; uint32 oldTotalCount = 0; uint32 oldWeekCount = 0; PlayerCurrenciesMap::iterator itr = _currencyStorage.find(id); @@ -7513,7 +7513,7 @@ uint32 Player::_GetCurrencyWeekCap(const CurrencyTypesEntry* currency) const if (cap != currency->WeekCap && IsInWorld() && !GetSession()->PlayerLoading()) { WorldPacket packet(SMSG_UPDATE_CURRENCY_WEEK_LIMIT, 8); - packet << uint32(cap / ((currency->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? 100 : 1)); + packet << uint32(cap / ((currency->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? CURRENCY_PRECISION : 1)); packet << uint32(currency->ID); GetSession()->SendPacket(&packet); } @@ -21242,7 +21242,7 @@ bool Player::BuyCurrencyFromVendorSlot(uint64 vendorGuid, uint32 vendorSlot, uin return false; } - uint32 precision = (entry->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? 100 : 1; + uint32 precision = (entry->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? CURRENCY_PRECISION : 1; if (!HasCurrency(iece->RequiredCurrency[i], (iece->RequiredCurrencyCount[i] * count) / precision)) { @@ -21372,7 +21372,7 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32 return false; } - uint32 precision = (entry->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? 100 : 1; + uint32 precision = (entry->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? CURRENCY_PRECISION : 1; if (!HasCurrency(iece->RequiredCurrency[i], (iece->RequiredCurrencyCount[i] * count) / precision)) { diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index ea96f4051a7..a6ffcc2b2ef 100644 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -811,7 +811,7 @@ void WorldSession::SendListInventory(uint64 vendorGuid) if (vendorItem->ExtendedCost == 0) continue; // there's no price defined for currencies, only extendedcost is used - uint32 precision = (currencyTemplate->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? 100 : 1; + uint32 precision = (currencyTemplate->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? CURRENCY_PRECISION : 1; ++count; itemsData << uint32(slot + 1); // client expects counting to start at 1 diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 3f2500b6b27..908cfe41404 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -3851,4 +3851,6 @@ enum VoidTransferError VOID_TRANSFER_ERROR_TRANSFER_UNKNOWN = 9, }; +#define CURRENCY_PRECISION 100 + #endif -- cgit v1.2.3 From 792e636a32ed194adf6bc77d366e9ce01aed4cfd Mon Sep 17 00:00:00 2001 From: Shocker Date: Wed, 14 Nov 2012 23:41:32 +0200 Subject: Core/Config: Implement CONFIG_MAX_JUSTICE_POINTS and CONFIG_START_JUSTICE_POINTS options --- src/server/game/Entities/Player/Player.cpp | 1 + src/server/game/World/World.cpp | 21 +++++++++++++++++++++ src/server/worldserver/worldserver.conf.dist | 14 ++++++++++++++ 3 files changed, 36 insertions(+) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index a94346ec7ab..80b17683cf2 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -1018,6 +1018,7 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo) SetUInt32Value(PLAYER_FIELD_COINAGE, sWorld->getIntConfig(CONFIG_START_PLAYER_MONEY)); SetCurrency(CURRENCY_TYPE_HONOR_POINTS, sWorld->getIntConfig(CONFIG_START_HONOR_POINTS)); + SetCurrency(CURRENCY_TYPE_JUSTICE_POINTS, sWorld->getIntConfig(CONFIG_START_JUSTICE_POINTS)); SetCurrency(CURRENCY_TYPE_CONQUEST_POINTS, sWorld->getIntConfig(CONFIG_START_ARENA_POINTS)); // start with every map explored diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index dc64c607c62..e2cc4ff2c43 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -803,6 +803,27 @@ void World::LoadConfigSettings(bool reload) m_int_configs[CONFIG_START_HONOR_POINTS] = m_int_configs[CONFIG_MAX_HONOR_POINTS]; } + m_int_configs[CONFIG_MAX_JUSTICE_POINTS] = ConfigMgr::GetIntDefault("MaxJusticePoints", 400000); + if (int32(m_int_configs[CONFIG_MAX_JUSTICE_POINTS]) < 0) + { + sLog->outError(LOG_FILTER_SERVER_LOADING, "MaxJusticePoints (%i) can't be negative. Set to 0.", m_int_configs[CONFIG_MAX_JUSTICE_POINTS]); + m_int_configs[CONFIG_MAX_JUSTICE_POINTS] = 0; + } + + m_int_configs[CONFIG_START_JUSTICE_POINTS] = ConfigMgr::GetIntDefault("StartJusticePoints", 0); + if (int32(m_int_configs[CONFIG_START_JUSTICE_POINTS]) < 0) + { + sLog->outError(LOG_FILTER_SERVER_LOADING, "StartJusticePoints (%i) must be in range 0..MaxJusticePoints(%u). Set to %u.", + m_int_configs[CONFIG_START_JUSTICE_POINTS], m_int_configs[CONFIG_MAX_JUSTICE_POINTS], 0); + m_int_configs[CONFIG_START_JUSTICE_POINTS] = 0; + } + else if (m_int_configs[CONFIG_START_JUSTICE_POINTS] > m_int_configs[CONFIG_MAX_JUSTICE_POINTS]) + { + sLog->outError(LOG_FILTER_SERVER_LOADING, "StartJusticePoints (%i) must be in range 0..MaxJusticePoints(%u). Set to %u.", + m_int_configs[CONFIG_START_JUSTICE_POINTS], m_int_configs[CONFIG_MAX_JUSTICE_POINTS], m_int_configs[CONFIG_MAX_JUSTICE_POINTS]); + m_int_configs[CONFIG_START_JUSTICE_POINTS] = m_int_configs[CONFIG_MAX_JUSTICE_POINTS]; + } + m_int_configs[CONFIG_MAX_ARENA_POINTS] = ConfigMgr::GetIntDefault("MaxArenaPoints", 10000); if (int32(m_int_configs[CONFIG_MAX_ARENA_POINTS]) < 0) { diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index 650695a1397..217daeeca6a 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -792,6 +792,20 @@ MaxHonorPoints = 75000 StartHonorPoints = 0 +# +# MaxJusticePoints +# Description: Maximum justice points a character can have. +# Default: 400000 + +MaxJusticePoints = 400000 + +# +# StartJusticePoints +# Description: Amount of justice points that characters have after creation. +# Default: 0 + +StartJusticePoints = 0 + # # MaxArenaPoints # Description: Maximum arena points a character can have. -- cgit v1.2.3 From 7bee7d3a9a8b007fc3f5b62b55cb893d92c963ee Mon Sep 17 00:00:00 2001 From: Subv Date: Wed, 14 Nov 2012 16:55:47 -0500 Subject: Core/Maps: Set correct phase flag from DBC when using phases. Fixes AreaTriggers and some other things. Thanks @lehtola for the tip. --- src/server/game/DataStores/DBCStores.cpp | 2 ++ src/server/game/DataStores/DBCStores.h | 1 + src/server/game/DataStores/DBCStructure.h | 7 +++++++ src/server/game/DataStores/DBCfmt.h | 1 + src/server/game/Handlers/MiscHandler.cpp | 7 ++++++- 5 files changed, 17 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 8a647bacfea..9dc60c33328 100644 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -58,6 +58,7 @@ static WMOAreaInfoByTripple sWMOAreaInfoByTripple; DBCStorage sAchievementStore(Achievementfmt); DBCStorage sAchievementCriteriaStore(AchievementCriteriafmt); DBCStorage sAreaTriggerStore(AreaTriggerEntryfmt); +DBCStorage sPhaseStore(PhaseEntryfmt); DBCStorage sArmorLocationStore(ArmorLocationfmt); DBCStorage sAuctionHouseStore(AuctionHouseEntryfmt); DBCStorage sBankBagSlotPricesStore(BankBagSlotPricesEntryfmt); @@ -328,6 +329,7 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sAchievementStore, dbcPath, "Achievement.dbc"/*, &CustomAchievementfmt, &CustomAchievementIndex*/);//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sAchievementCriteriaStore, dbcPath, "Achievement_Criteria.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sAreaTriggerStore, dbcPath, "AreaTrigger.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sPhaseStore, dbcPath, "Phase.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sAreaGroupStore, dbcPath, "AreaGroup.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sAreaPOIStore, dbcPath, "AreaPOI.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sAuctionHouseStore, dbcPath, "AuctionHouse.dbc");//14545 diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h index c4e012c62c1..80bed703c84 100755 --- a/src/server/game/DataStores/DBCStores.h +++ b/src/server/game/DataStores/DBCStores.h @@ -81,6 +81,7 @@ extern DBCStorage sAreaStore;// recommend access extern DBCStorage sAreaGroupStore; extern DBCStorage sAreaPOIStore; extern DBCStorage sAreaTriggerStore; +extern DBCStorage sPhaseStore; extern DBCStorage sArmorLocationStore; extern DBCStorage sAuctionHouseStore; extern DBCStorage sBankBagSlotPricesStore; diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 87e77ad491e..31e1817d0ad 100644 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -609,6 +609,13 @@ struct AreaTriggerEntry float box_orientation; // 12 m_box_yaw }; +struct PhaseEntry +{ + uint32 Id; + char* Name; + uint32 Flag; +} + struct ArmorLocationEntry { uint32 InventoryType; // 0 diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index c1430c7bef0..17d036e6e59 100644 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -30,6 +30,7 @@ char const AreaTableEntryfmt[]="iiinixxxxxisiiiiifxxxxxxxx"; char const AreaGroupEntryfmt[]="niiiiiii"; char const AreaPOIEntryfmt[]="niiiiiiiiiiiffixixxixx"; char const AreaTriggerEntryfmt[]="nifffxxxfffff"; +char const PhaseEntryfmt[]="isi"; char const ArmorLocationfmt[]="nfffff"; char const AuctionHouseEntryfmt[]="niiix"; char const BankBagSlotPricesEntryfmt[]="ni"; diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index d1bf36b885b..38e3a56985b 100644 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -1756,7 +1756,12 @@ void WorldSession::SendSetPhaseShift(std::set const& phaseIds, std::set< data.WriteByteSeq(guid[1]); - data << uint32(0); // flags (not phasemask) + uint32 flag = 8; + for (std::set::const_iterator itr = phaseIds.begin(); itr != phaseIds.end(); ++itr) + if (PhaseEntry const* phaseEntry = sPhaseStore.LookupEntry(*itr)) + flag |= phaseEntry->Flag; + + data << uint32(flag); // flags (not phasemask) data.WriteByteSeq(guid[2]); data.WriteByteSeq(guid[6]); -- cgit v1.2.3 From 11df55f8b1f39beb19497724a214f46170bf0829 Mon Sep 17 00:00:00 2001 From: Subv Date: Wed, 14 Nov 2012 17:06:46 -0500 Subject: Core/DBC: The index of a DBC fmt is represented by 'n' (Solves previous commit error) --- src/server/game/DataStores/DBCfmt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index 17d036e6e59..55ea9070427 100644 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -30,7 +30,7 @@ char const AreaTableEntryfmt[]="iiinixxxxxisiiiiifxxxxxxxx"; char const AreaGroupEntryfmt[]="niiiiiii"; char const AreaPOIEntryfmt[]="niiiiiiiiiiiffixixxixx"; char const AreaTriggerEntryfmt[]="nifffxxxfffff"; -char const PhaseEntryfmt[]="isi"; +char const PhaseEntryfmt[]="nsi"; char const ArmorLocationfmt[]="nfffff"; char const AuctionHouseEntryfmt[]="niiix"; char const BankBagSlotPricesEntryfmt[]="ni"; -- cgit v1.2.3 From b295688322ad1475ba57e04af85d1f4665f2e2a7 Mon Sep 17 00:00:00 2001 From: Subv Date: Wed, 14 Nov 2012 17:22:39 -0500 Subject: Core/Maps: Changed SMSG_SET_PHASE_SHIFT to send either 8 or 0 depending on whether the player is phased or not. --- src/server/game/Handlers/MiscHandler.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 38e3a56985b..780117c029b 100644 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -1756,12 +1756,7 @@ void WorldSession::SendSetPhaseShift(std::set const& phaseIds, std::set< data.WriteByteSeq(guid[1]); - uint32 flag = 8; - for (std::set::const_iterator itr = phaseIds.begin(); itr != phaseIds.end(); ++itr) - if (PhaseEntry const* phaseEntry = sPhaseStore.LookupEntry(*itr)) - flag |= phaseEntry->Flag; - - data << uint32(flag); // flags (not phasemask) + data << uint32(phaseIds.size() ? 0 : 8); // flags (not phasemask) data.WriteByteSeq(guid[2]); data.WriteByteSeq(guid[6]); -- cgit v1.2.3 From 7a7e273e46b4b92f1b5f0ddc06f6a5e207aea126 Mon Sep 17 00:00:00 2001 From: Shocker Date: Thu, 15 Nov 2012 07:37:03 +0200 Subject: Revert "Core/Maps: Set correct phase flag from DBC when using phases." This reverts commit 7bee7d3a9a8b007fc3f5b62b55cb893d92c963ee. Phase.dbc already implemented --- src/server/game/DataStores/DBCStores.cpp | 2 -- src/server/game/DataStores/DBCStores.h | 1 - src/server/game/DataStores/DBCStructure.h | 7 ------- src/server/game/DataStores/DBCfmt.h | 1 - 4 files changed, 11 deletions(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 9dc60c33328..8a647bacfea 100644 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -58,7 +58,6 @@ static WMOAreaInfoByTripple sWMOAreaInfoByTripple; DBCStorage sAchievementStore(Achievementfmt); DBCStorage sAchievementCriteriaStore(AchievementCriteriafmt); DBCStorage sAreaTriggerStore(AreaTriggerEntryfmt); -DBCStorage sPhaseStore(PhaseEntryfmt); DBCStorage sArmorLocationStore(ArmorLocationfmt); DBCStorage sAuctionHouseStore(AuctionHouseEntryfmt); DBCStorage sBankBagSlotPricesStore(BankBagSlotPricesEntryfmt); @@ -329,7 +328,6 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sAchievementStore, dbcPath, "Achievement.dbc"/*, &CustomAchievementfmt, &CustomAchievementIndex*/);//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sAchievementCriteriaStore, dbcPath, "Achievement_Criteria.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sAreaTriggerStore, dbcPath, "AreaTrigger.dbc");//14545 - LoadDBC(availableDbcLocales, bad_dbc_files, sPhaseStore, dbcPath, "Phase.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sAreaGroupStore, dbcPath, "AreaGroup.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sAreaPOIStore, dbcPath, "AreaPOI.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sAuctionHouseStore, dbcPath, "AuctionHouse.dbc");//14545 diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h index 80bed703c84..c4e012c62c1 100755 --- a/src/server/game/DataStores/DBCStores.h +++ b/src/server/game/DataStores/DBCStores.h @@ -81,7 +81,6 @@ extern DBCStorage sAreaStore;// recommend access extern DBCStorage sAreaGroupStore; extern DBCStorage sAreaPOIStore; extern DBCStorage sAreaTriggerStore; -extern DBCStorage sPhaseStore; extern DBCStorage sArmorLocationStore; extern DBCStorage sAuctionHouseStore; extern DBCStorage sBankBagSlotPricesStore; diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 31e1817d0ad..87e77ad491e 100644 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -609,13 +609,6 @@ struct AreaTriggerEntry float box_orientation; // 12 m_box_yaw }; -struct PhaseEntry -{ - uint32 Id; - char* Name; - uint32 Flag; -} - struct ArmorLocationEntry { uint32 InventoryType; // 0 diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index 55ea9070427..c1430c7bef0 100644 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -30,7 +30,6 @@ char const AreaTableEntryfmt[]="iiinixxxxxisiiiiifxxxxxxxx"; char const AreaGroupEntryfmt[]="niiiiiii"; char const AreaPOIEntryfmt[]="niiiiiiiiiiiffixixxixx"; char const AreaTriggerEntryfmt[]="nifffxxxfffff"; -char const PhaseEntryfmt[]="nsi"; char const ArmorLocationfmt[]="nfffff"; char const AuctionHouseEntryfmt[]="niiix"; char const BankBagSlotPricesEntryfmt[]="ni"; -- cgit v1.2.3 From f13e57d9edb8664be746cf17d2ea36e24eca863e Mon Sep 17 00:00:00 2001 From: Spp Date: Thu, 15 Nov 2012 10:29:26 +0100 Subject: Core/Player: Added skill step 525 --- src/server/game/Entities/Player/Player.cpp | 68 +++++++++++++++--------------- src/server/game/Entities/Player/Player.h | 2 +- 2 files changed, 34 insertions(+), 36 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 80b17683cf2..5e2fdae9c2c 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -6181,25 +6181,25 @@ bool Player::UpdateFishingSkill() return UpdateSkillPro(SKILL_FISHING, chance*10, gathering_skill_gain); } -// levels sync. with spell requirement for skill levels to learn -// bonus abilities in sSkillLineAbilityStore -// Used only to avoid scan DBC at each skill grow -static uint32 bonusSkillLevels[] = {75, 150, 225, 300, 375, 450}; -static const size_t bonusSkillLevelsSize = sizeof(bonusSkillLevels) / sizeof(uint32); - -bool Player::UpdateSkillPro(uint16 SkillId, int32 Chance, uint32 step) +bool Player::UpdateSkillPro(uint16 skillId, int32 chance, uint32 step) { - sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "UpdateSkillPro(SkillId %d, Chance %3.1f%%)", SkillId, Chance / 10.0f); - if (!SkillId) + // levels sync. with spell requirement for skill levels to learn + // bonus abilities in sSkillLineAbilityStore + // Used only to avoid scan DBC at each skill grow + static uint32 bonusSkillLevels[] = { 75, 150, 225, 300, 375, 450, 525 }; + static const size_t bonusSkillLevelsSize = sizeof(bonusSkillLevels) / sizeof(uint32); + + sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "UpdateSkillPro(SkillId %d, Chance %3.1f%%)", skillId, chance / 10.0f); + if (!skillId) return false; - if (Chance <= 0) // speedup in 0 chance case + if (chance <= 0) // speedup in 0 chance case { - sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "Player::UpdateSkillPro Chance=%3.1f%% missed", Chance / 10.0f); + sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "Player::UpdateSkillPro Chance=%3.1f%% missed", chance / 10.0f); return false; } - SkillStatusMap::iterator itr = mSkillStatus.find(SkillId); + SkillStatusMap::iterator itr = mSkillStatus.find(skillId); if (itr == mSkillStatus.end() || itr->second.uState == SKILL_DELETED) return false; @@ -6212,36 +6212,34 @@ bool Player::UpdateSkillPro(uint16 SkillId, int32 Chance, uint32 step) if (!max || !value || value >= max) return false; - int32 Roll = irand(1, 1000); - - if (Roll <= Chance) + if (irand(1, 1000) > chance) { - uint16 new_value = value + step; - if (new_value > max) - new_value = max; + sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "Player::UpdateSkillPro Chance=%3.1f%% missed", chance / 10.0f); + return false; + } - SetUInt16Value(PLAYER_SKILL_RANK_0 + field, offset, new_value); - if (itr->second.uState != SKILL_NEW) - itr->second.uState = SKILL_CHANGED; + uint16 new_value = value + step; + if (new_value > max) + new_value = max; - for (size_t i = 0; i < bonusSkillLevelsSize; ++i) + SetUInt16Value(PLAYER_SKILL_RANK_0 + field, offset, new_value); + if (itr->second.uState != SKILL_NEW) + itr->second.uState = SKILL_CHANGED; + + for (size_t i = 0; i < bonusSkillLevelsSize; ++i) + { + uint32 bsl = bonusSkillLevels[i]; + if (value < bsl && new_value >= bsl) { - uint32 bsl = bonusSkillLevels[i]; - if (value < bsl && new_value >= bsl) - { - learnSkillRewardedSpells(SkillId, new_value); - break; - } + learnSkillRewardedSpells(skillId, new_value); + break; } - - UpdateSkillEnchantments(SkillId, value, new_value); - UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL, SkillId); - sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "Player::UpdateSkillPro Chance=%3.1f%% taken", Chance / 10.0f); - return true; } - sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "Player::UpdateSkillPro Chance=%3.1f%% missed", Chance / 10.0f); - return false; + UpdateSkillEnchantments(skillId, value, new_value); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL, skillId); + sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "Player::UpdateSkillPro Chance=%3.1f%% taken", chance / 10.0f); + return true; } void Player::ModifySkillBonus(uint32 skillid, int32 val, bool talent) diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 2f044326b96..18cc95444c0 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1680,7 +1680,7 @@ class Player : public Unit, public GridObject void ItemAddedQuestCheck(uint32 entry, uint32 count); void ItemRemovedQuestCheck(uint32 entry, uint32 count); void KilledMonster(CreatureTemplate const* cInfo, uint64 guid); - void KilledMonsterCredit(uint32 entry, uint64 guid); + void KilledMonsterCredit(uint32 entry, uint64 guid = 0); void KilledPlayerCredit(); void CastedCreatureOrGO(uint32 entry, uint64 guid, uint32 spell_id); void TalkedToCreature(uint32 entry, uint64 guid); -- cgit v1.2.3 From 978fc4b7b9c8de757d41dca0c61f1bda5a4e4e6c Mon Sep 17 00:00:00 2001 From: Spp Date: Fri, 16 Nov 2012 09:09:27 +0100 Subject: Fix compile --- src/server/game/Handlers/BattleGroundHandler.cpp | 2 +- src/server/game/Server/WorldSocket.cpp | 2 +- src/server/scripts/Commands/cs_lookup.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/BattleGroundHandler.cpp b/src/server/game/Handlers/BattleGroundHandler.cpp index 47586c32a2e..7aabd9d4bdf 100755 --- a/src/server/game/Handlers/BattleGroundHandler.cpp +++ b/src/server/game/Handlers/BattleGroundHandler.cpp @@ -469,7 +469,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData) if (action) { sLog->outDebug(LOG_FILTER_BATTLEGROUND, "CMSG_BATTLEFIELD_PORT %s Slot: %u, Unk: %u, Time: %u, Action: %u. Cant find BG with id %u!", - GetPlayerInfo().c_str(), queueSlot, unk, time, action); + GetPlayerInfo().c_str(), queueSlot, unk, time, action, ginfo.IsInvitedToBGInstanceGUID); return; } diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index 5c71c9e503c..df3c2d77c02 100644 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -921,7 +921,7 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) // Must be done before WorldSession is created if (sWorld->getBoolConfig(CONFIG_WARDEN_ENABLED) && os != "Win" && os != "OSX") { - packet.Initialize(SMSG_AUTH_RESPONSE, 1); + WorldPacket packet(SMSG_AUTH_RESPONSE, 1); packet << uint8(AUTH_REJECT); SendPacket(packet); diff --git a/src/server/scripts/Commands/cs_lookup.cpp b/src/server/scripts/Commands/cs_lookup.cpp index 612e2ecd7ed..e1bf34fb6cf 100644 --- a/src/server/scripts/Commands/cs_lookup.cpp +++ b/src/server/scripts/Commands/cs_lookup.cpp @@ -1049,7 +1049,7 @@ public: { if (MapEntry const* mapInfo = sMapStore.LookupEntry(id)) { - std::string name = mapInfo->name[locale]; + std::string name = mapInfo->name; if (name.empty()) continue; -- cgit v1.2.3 From 306d4d3ab198fc86fce1ed6cd3c97c580a5fb47a Mon Sep 17 00:00:00 2001 From: Spp Date: Fri, 16 Nov 2012 09:47:36 +0100 Subject: Core/Battleground: Send bracket levels in SMSG_BATTLEFIELD_LIST --- src/server/game/Battlegrounds/BattlegroundMgr.cpp | 48 +++++++++++------------ 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'src') diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index 8e145a49fb4..8ce212472e4 100755 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -1144,6 +1144,14 @@ void BattlegroundMgr::BuildBattlegroundListPacket(WorldPacket* data, uint64 guid if (!player) return; + BattlegroundDataContainer::iterator it = bgDataStore.find(bgTypeId); + if (it == bgDataStore.end()) + return; + + PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(it->second.m_Battlegrounds.begin()->second->GetMapId(), player->getLevel()); + if (!bracketEntry) + return; + uint32 winner_conquest = player->GetRandomWinner() ? BG_REWARD_WINNER_CONQUEST_FIRST : BG_REWARD_WINNER_CONQUEST_LAST; uint32 winner_honor = player->GetRandomWinner() ? BG_REWARD_WINNER_HONOR_FIRST : BG_REWARD_WINNER_HONOR_LAST; uint32 loser_honor = !player->GetRandomWinner() ? BG_REWARD_LOSER_HONOR_FIRST : BG_REWARD_LOSER_HONOR_LAST; @@ -1151,15 +1159,15 @@ void BattlegroundMgr::BuildBattlegroundListPacket(WorldPacket* data, uint64 guid ObjectGuid guidBytes = guid; data->Initialize(SMSG_BATTLEFIELD_LIST); - *data << uint32(winner_conquest); // Winner Conquest Reward or Random Winner Conquest Reward - *data << uint32(winner_conquest); // Winner Conquest Reward or Random Winner Conquest Reward - *data << uint32(loser_honor); // Loser Honor Reward or Random Loser Honor Reward - *data << uint32(bgTypeId); // battleground id - *data << uint32(loser_honor); // Loser Honor Reward or Random Loser Honor Reward - *data << uint32(winner_honor); // Winner Honor Reward or Random Winner Honor Reward - *data << uint32(winner_honor); // Winner Honor Reward or Random Winner Honor Reward - *data << uint8(0); // max level - *data << uint8(0); // min level + *data << uint32(winner_conquest) // Winner Conquest Reward or Random Winner Conquest Reward + << uint32(winner_conquest) // Winner Conquest Reward or Random Winner Conquest Reward + << uint32(loser_honor) // Loser Honor Reward or Random Loser Honor Reward + << uint32(bgTypeId) // battleground id + << uint32(loser_honor) // Loser Honor Reward or Random Loser Honor Reward + << uint32(winner_honor) // Winner Honor Reward or Random Winner Honor Reward + << uint32(winner_honor) // Winner Honor Reward or Random Winner Honor Reward + << uint8(bracketEntry->maxLevel) // max level + << uint8(bracketEntry->minLevel); // min level data->WriteBit(guidBytes[0]); data->WriteBit(guidBytes[1]); @@ -1186,23 +1194,15 @@ void BattlegroundMgr::BuildBattlegroundListPacket(WorldPacket* data, uint64 guid data->WriteByteSeq(guidBytes[7]); data->WriteByteSeq(guidBytes[5]); - BattlegroundDataContainer::iterator it = bgDataStore.find(bgTypeId); - if (it != bgDataStore.end()) + uint32 count = 0; + BattlegroundBracketId bracketId = bracketEntry->GetBracketId(); + BattlegroundClientIdsContainer& clientIds = it->second.m_ClientBattlegroundIds[bracketId]; + for (BattlegroundClientIdsContainer::const_iterator itr = clientIds.begin(); itr != clientIds.end(); ++itr) { - // expected bracket entry - if (PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(it->second.m_Battlegrounds.begin()->second->GetMapId(), player->getLevel())) - { - uint32 count = 0; - BattlegroundBracketId bracketId = bracketEntry->GetBracketId(); - BattlegroundClientIdsContainer& clientIds = it->second.m_ClientBattlegroundIds[bracketId]; - for (BattlegroundClientIdsContainer::const_iterator itr = clientIds.begin(); itr != clientIds.end(); ++itr) - { - *data << uint32(*itr); - ++count; - } - data->PutBits(count_pos, count, 24); // bg instance count - } + *data << uint32(*itr); + ++count; } + data->PutBits(count_pos, count, 24); // bg instance count data->WriteByteSeq(guidBytes[0]); data->WriteByteSeq(guidBytes[2]); -- cgit v1.2.3 From 279b7f4c1029b239000a7db746c361abc639e798 Mon Sep 17 00:00:00 2001 From: Spp Date: Fri, 16 Nov 2012 09:51:44 +0100 Subject: Core/Misc: Minor changes here and there --- src/server/game/Battlefield/Battlefield.cpp | 4 ++ src/server/game/Chat/Chat.cpp | 3 +- src/server/game/Chat/Chat.h | 2 +- src/server/game/Entities/Vehicle/Vehicle.h | 7 ++++ src/server/game/Miscellaneous/Formulas.h | 7 ++-- src/server/game/Miscellaneous/SharedDefines.h | 5 ++- src/server/game/Movement/MotionMaster.h | 4 +- src/server/game/Server/WorldSession.cpp | 33 ++++++++++------ src/server/game/Spells/Auras/SpellAuraEffects.cpp | 3 +- src/server/game/Spells/Spell.cpp | 7 ++++ src/server/game/Spells/SpellInfo.cpp | 3 +- src/server/game/Spells/SpellInfo.h | 2 +- src/server/game/Spells/SpellMgr.cpp | 1 + src/server/game/World/World.cpp | 6 +-- src/server/scripts/Commands/cs_wp.cpp | 48 ++++++++++++----------- 15 files changed, 86 insertions(+), 49 deletions(-) (limited to 'src') diff --git a/src/server/game/Battlefield/Battlefield.cpp b/src/server/game/Battlefield/Battlefield.cpp index f1a2e22b34b..f6b3d133cb9 100644 --- a/src/server/game/Battlefield/Battlefield.cpp +++ b/src/server/game/Battlefield/Battlefield.cpp @@ -408,13 +408,17 @@ void Battlefield::PlayerAcceptInviteToWar(Player* player) void Battlefield::TeamCastSpell(TeamId team, int32 spellId) { if (spellId > 0) + { for (GuidSet::const_iterator itr = m_PlayersInWar[team].begin(); itr != m_PlayersInWar[team].end(); ++itr) if (Player* player = sObjectAccessor->FindPlayer(*itr)) player->CastSpell(player, uint32(spellId), true); + } else + { for (GuidSet::const_iterator itr = m_PlayersInWar[team].begin(); itr != m_PlayersInWar[team].end(); ++itr) if (Player* player = sObjectAccessor->FindPlayer(*itr)) player->RemoveAuraFromStack(uint32(-spellId)); + } } void Battlefield::BroadcastPacketToZone(WorldPacket& data) const diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index b120cd5e978..4571f261587 100755 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -63,7 +63,7 @@ ChatCommand* ChatHandler::getCommandTable() // cache for commands, needed because some commands are loaded dynamically through ScriptMgr // cache is never freed and will show as a memory leak in diagnostic tools // can't use vector as vector storage is implementation-dependent, eg, there can be alignment gaps between elements - static ChatCommand* commandTableCache = 0; + static ChatCommand* commandTableCache = NULL; if (LoadCommandTable()) { @@ -96,7 +96,6 @@ ChatCommand* ChatHandler::getCommandTable() std::string name = fields[0].GetString(); SetDataForCommandInTable(commandTableCache, name.c_str(), fields[1].GetUInt8(), fields[2].GetString(), name); - } while (result->NextRow()); } diff --git a/src/server/game/Chat/Chat.h b/src/server/game/Chat/Chat.h index b583d749301..0597ab216ec 100644 --- a/src/server/game/Chat/Chat.h +++ b/src/server/game/Chat/Chat.h @@ -115,7 +115,7 @@ class ChatHandler bool extractPlayerTarget(char* args, Player** player, uint64* player_guid = NULL, std::string* player_name = NULL); std::string playerLink(std::string const& name) const { return m_session ? "|cffffffff|Hplayer:"+name+"|h["+name+"]|h|r" : name; } - std::string GetNameLink(Player* chr) const { return playerLink(chr->GetName()); } + std::string GetNameLink(Player const* chr) const { return playerLink(chr->GetName()); } GameObject* GetNearbyGameObject(); GameObject* GetObjectGlobalyWithGuidOrNearWithDbGuid(uint32 lowguid, uint32 entry); diff --git a/src/server/game/Entities/Vehicle/Vehicle.h b/src/server/game/Entities/Vehicle/Vehicle.h index 4ad8663a17a..3f1567c74ee 100755 --- a/src/server/game/Entities/Vehicle/Vehicle.h +++ b/src/server/game/Entities/Vehicle/Vehicle.h @@ -20,9 +20,11 @@ #define __TRINITY_VEHICLE_H #include "ObjectDefines.h" +#include "Object.h" #include "VehicleDefines.h" struct VehicleEntry; + class Unit; typedef std::set GuidSet; @@ -58,6 +60,9 @@ class Vehicle : public TransportBase void TeleportVehicle(float x, float y, float z, float ang); bool IsVehicleInUse() { return Seats.begin() != Seats.end(); } + void SetLastShootPos(Position const& pos) { m_lastShootPos.Relocate(pos); } + Position GetLastShootPos() { return m_lastShootPos; } + SeatMap Seats; VehicleSeatEntry const* GetSeatForPassenger(Unit* passenger); @@ -77,5 +82,7 @@ class Vehicle : public TransportBase GuidSet vehiclePlayers; uint32 _usableSeatNum; // Number of seats that match VehicleSeatEntry::UsableByPlayer, used for proper display flags uint32 _creatureEntry; // Can be different than me->GetBase()->GetEntry() in case of players + + Position m_lastShootPos; }; #endif diff --git a/src/server/game/Miscellaneous/Formulas.h b/src/server/game/Miscellaneous/Formulas.h index 212c391d186..3cf4b1f96b7 100755 --- a/src/server/game/Miscellaneous/Formulas.h +++ b/src/server/game/Miscellaneous/Formulas.h @@ -38,7 +38,8 @@ namespace Trinity { return uint32(ceil(hk_honor_at_level_f(level, multiplier))); } - } + } // namespace Trinity::Honor + namespace XP { inline uint8 GetGrayLevel(uint8 pl_level) @@ -221,7 +222,7 @@ namespace Trinity sScriptMgr->OnGroupRateCalculation(rate, count, isRaid); return rate; } - } -} + } // namespace Trinity::XP +} // namespace Trinity #endif diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 908cfe41404..b5b7bb4a6cf 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -594,7 +594,7 @@ enum SpellAttr8 SPELL_ATTR8_RAID_MARKER = 0x04000000, // 26 probably spell no need learn to cast SPELL_ATTR8_UNK27 = 0x08000000, // 27 SPELL_ATTR8_NOT_IN_BG_OR_ARENA = 0x10000000, // 28 not allow to cast or deactivate currently active effect, not sure about Fast Track - SPELL_ATTR8_MASTERY = 0x20000000, // 29 + SPELL_ATTR8_MASTERY_SPECIALIZATION = 0x20000000, // 29 SPELL_ATTR8_UNK30 = 0x40000000, // 30 SPELL_ATTR8_UNK31 = 0x80000000 // 31 }; @@ -3436,7 +3436,8 @@ enum SummonType enum EventId { - EVENT_CHARGE = 1003 + EVENT_CHARGE = 1003, + EVENT_JUMP = 1004 }; enum ResponseCodes diff --git a/src/server/game/Movement/MotionMaster.h b/src/server/game/Movement/MotionMaster.h index 8d7fdee7ad2..7037d1316f1 100755 --- a/src/server/game/Movement/MotionMaster.h +++ b/src/server/game/Movement/MotionMaster.h @@ -163,7 +163,9 @@ class MotionMaster //: private std::stack void MoveCharge(float x, float y, float z, float speed = SPEED_CHARGE, uint32 id = EVENT_CHARGE); void MoveKnockbackFrom(float srcX, float srcY, float speedXY, float speedZ); void MoveJumpTo(float angle, float speedXY, float speedZ); - void MoveJump(float x, float y, float z, float speedXY, float speedZ, uint32 id = 0); + void MoveJump(Position const& pos, float speedXY, float speedZ, uint32 id = EVENT_JUMP) + { MoveJump(pos.m_positionX, pos.m_positionY, pos.m_positionZ, speedXY, speedZ, id); }; + void MoveJump(float x, float y, float z, float speedXY, float speedZ, uint32 id = EVENT_JUMP); void MoveFall(uint32 id = 0); void MoveSeekAssistance(float x, float y, float z); diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index 3bdd8e54fc0..72e1a472c06 100644 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -98,18 +98,29 @@ bool WorldSessionFilter::Process(WorldPacket* packet) /// WorldSession constructor WorldSession::WorldSession(uint32 id, WorldSocket* sock, AccountTypes sec, uint8 expansion, time_t mute_time, LocaleConstant locale, uint32 recruiter, bool isARecruiter): -m_muteTime(mute_time), m_timeOutTime(0), _player(NULL), m_Socket(sock), -_security(sec), _accountId(id), m_expansion(expansion), _logoutTime(0), -m_inQueue(false), m_playerLoading(false), m_playerLogout(false), -m_playerRecentlyLogout(false), m_playerSave(false), -m_sessionDbcLocale(sWorld->GetAvailableDbcLocale(locale)), -m_sessionDbLocaleIndex(locale), -m_latency(0), m_TutorialsChanged(false), recruiterId(recruiter), -isRecruiter(isARecruiter), timeLastWhoCommand(0) + m_muteTime(mute_time), + m_timeOutTime(0), + _player(NULL), + m_Socket(sock), + _security(sec), + _accountId(id), + m_expansion(expansion), + _warden(NULL), + _logoutTime(0), + m_inQueue(false), + m_playerLoading(false), + m_playerLogout(false), + m_playerRecentlyLogout(false), + m_playerSave(false), + m_sessionDbcLocale(sWorld->GetAvailableDbcLocale(locale)), + m_sessionDbLocaleIndex(locale), + m_latency(0), + m_TutorialsChanged(false), + _filterAddonMessages(false), + recruiterId(recruiter), + isRecruiter(isARecruiter), + timeLastWhoCommand(0) { - _warden = NULL; - _filterAddonMessages = false; - if (sock) { m_Address = sock->GetRemoteAddress(); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 6a282d15241..1c41f1fb2ff 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -470,9 +470,8 @@ void AuraEffect::GetApplicationList(std::list & applicationLis int32 AuraEffect::CalculateAmount(Unit* caster) { - int32 amount; // default amount calculation - amount = m_spellInfo->Effects[m_effIndex].CalcValue(caster, &m_baseAmount, GetBase()->GetOwner()->ToUnit()); + int32 amount = m_spellInfo->Effects[m_effIndex].CalcValue(caster, &m_baseAmount, GetBase()->GetOwner()->ToUnit()); // check item enchant aura cast if (!amount && caster) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 5beaa49c050..d66d60fece9 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -1725,6 +1725,9 @@ void Spell::SelectImplicitTrajTargets() trajDst.Relocate(x, y, z, m_caster->GetOrientation()); m_targets.ModDst(trajDst); } + + if (Vehicle * veh = m_caster->GetVehicleKit()) + veh->SetLastShootPos(*m_targets.GetDstPos()); } void Spell::SelectEffectTypeImplicitTargets(uint8 effIndex) @@ -2795,11 +2798,15 @@ void Spell::DoTriggersOnSpellHit(Unit* unit, uint8 effMask) // trigger linked auras remove/apply // TODO: remove/cleanup this, as this table is not documented and people are doing stupid things with it if (std::vector const* spellTriggered = sSpellMgr->GetSpellLinked(m_spellInfo->Id + SPELL_LINK_HIT)) + { for (std::vector::const_iterator i = spellTriggered->begin(); i != spellTriggered->end(); ++i) + { if (*i < 0) unit->RemoveAurasDueToSpell(-(*i)); else unit->CastSpell(unit, *i, true, 0, 0, m_caster->GetGUID()); + } + } } void Spell::DoAllEffectOnTarget(GOTargetInfo* target) diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 7054d866e6f..9faf9a1f850 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -15,12 +15,13 @@ * with this program. If not, see . */ -#include "SpellAuraDefines.h" #include "SpellInfo.h" +#include "SpellAuraDefines.h" #include "SpellMgr.h" #include "Spell.h" #include "DBCStores.h" #include "ConditionMgr.h" +#include "Object.h" uint32 GetTargetFlagMask(SpellTargetObjectTypes objType) { diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h index d8115569f25..636ef607e2b 100644 --- a/src/server/game/Spells/SpellInfo.h +++ b/src/server/game/Spells/SpellInfo.h @@ -21,13 +21,13 @@ #include "SharedDefines.h" #include "Util.h" #include "DBCStructure.h" -#include "Object.h" class Unit; class Player; class Item; class Spell; class SpellInfo; +class WorldObject; struct SpellChainNode; struct SpellTargetPosition; struct SpellDurationEntry; diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index a596d4bf076..600b9dc65a3 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -1292,6 +1292,7 @@ void SpellMgr::LoadSpellRanks() mSpellInfoMap[addedSpell]->ChainEntry = &mSpellChains[addedSpell]; prevRank = addedSpell; ++itr; + if (itr == rankChain.end()) { mSpellChains[addedSpell].next = NULL; diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index e2cc4ff2c43..e301367ce43 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -223,7 +223,7 @@ void World::AddSession(WorldSession* s) void World::AddSession_(WorldSession* s) { - ASSERT (s); + ASSERT(s); //NOTE - Still there is race condition in WorldSession* being used in the Sockets @@ -258,7 +258,7 @@ void World::AddSession_(WorldSession* s) uint32 Sessions = GetActiveAndQueuedSessionCount(); uint32 pLimit = GetPlayerAmountLimit(); - uint32 QueueSize = GetQueuedSessionCount(); //number of players in the queue + uint32 QueueSize = GetQueuedSessionCount(); //number of players in the queue //so we don't count the user trying to //login as a session and queue the socket that we are using @@ -267,7 +267,7 @@ void World::AddSession_(WorldSession* s) if (pLimit > 0 && Sessions >= pLimit && AccountMgr::IsPlayerAccount(s->GetSecurity()) && !HasRecentlyDisconnected(s)) { - AddQueuedPlayer (s); + AddQueuedPlayer(s); UpdateMaxSessionCounters(); sLog->outInfo(LOG_FILTER_GENERAL, "PlayerQueue: Account id %u is in Queue Position (%u).", s->GetAccountId(), ++QueueSize); return; diff --git a/src/server/scripts/Commands/cs_wp.cpp b/src/server/scripts/Commands/cs_wp.cpp index 5bc84bed28a..259845d82ae 100644 --- a/src/server/scripts/Commands/cs_wp.cpp +++ b/src/server/scripts/Commands/cs_wp.cpp @@ -239,40 +239,44 @@ public: if (!target) { - handler->PSendSysMessage("%s%s|r", "|cff33ffff", "You must select target."); + handler->PSendSysMessage("%s%s|r", "|cff33ffff", "You must select a target."); return true; } - uint32 guildLow = target->GetDBTableGUIDLow(); + uint32 guidLow = target->GetDBTableGUIDLow(); + if (guidLow == 0) + { + handler->PSendSysMessage("%s%s|r", "|cffff33ff", "Target is not saved to DB."); + return true; + } - if (target->GetCreatureAddon()) + CreatureAddon const* addon = sObjectMgr->GetCreatureAddon(guidLow); + if (!addon || addon->path_id == 0) { - if (target->GetCreatureAddon()->path_id != 0) - { - PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_CREATURE_ADDON); + handler->PSendSysMessage("%s%s|r", "|cffff33ff", "Target does not have a loaded path."); + return true; + } - stmt->setUInt32(0, guildLow); + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_CREATURE_ADDON); - WorldDatabase.Execute(stmt); + stmt->setUInt32(0, guidLow); + + WorldDatabase.Execute(stmt); - target->UpdateWaypointID(0); + target->UpdateWaypointID(0); - stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_MOVEMENT_TYPE); + stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_MOVEMENT_TYPE); - stmt->setUInt8(0, uint8(IDLE_MOTION_TYPE)); - stmt->setUInt32(1, guildLow); + stmt->setUInt8(0, uint8(IDLE_MOTION_TYPE)); + stmt->setUInt32(1, guidLow); - WorldDatabase.Execute(stmt); + WorldDatabase.Execute(stmt); - target->LoadPath(0); - target->SetDefaultMovementType(IDLE_MOTION_TYPE); - target->GetMotionMaster()->MoveTargetedHome(); - target->GetMotionMaster()->Initialize(); - target->MonsterSay("Path unloaded.", 0, 0); - return true; - } - handler->PSendSysMessage("%s%s|r", "|cffff33ff", "Target have no loaded path."); - } + target->LoadPath(0); + target->SetDefaultMovementType(IDLE_MOTION_TYPE); + target->GetMotionMaster()->MoveTargetedHome(); + target->GetMotionMaster()->Initialize(); + target->MonsterSay("Path unloaded.", 0, 0); return true; } -- cgit v1.2.3 From c0bf188b3d0f06cc171bc5aa858dd785da5c247e Mon Sep 17 00:00:00 2001 From: Shocker Date: Fri, 16 Nov 2012 22:48:35 +0200 Subject: Core/Currency: Define CURRENCY_FLAG_COUNT_SEASON_TOTAL --- src/server/game/Entities/Item/ItemPrototype.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Item/ItemPrototype.h b/src/server/game/Entities/Item/ItemPrototype.h index 867969d533e..cf818b740b4 100755 --- a/src/server/game/Entities/Item/ItemPrototype.h +++ b/src/server/game/Entities/Item/ItemPrototype.h @@ -212,10 +212,11 @@ enum ItemFlagsCustom enum CurrencyFlags { - CURRENCY_FLAG_TRADEABLE = 0x01, + CURRENCY_FLAG_TRADEABLE = 0x01, // ... - CURRENCY_FLAG_HIGH_PRECISION = 0x08, + CURRENCY_FLAG_HIGH_PRECISION = 0x08, // ... + CURRENCY_FLAG_COUNT_SEASON_TOTAL = 0x80, }; enum ItemVendorType -- cgit v1.2.3 From 572788c3c048bb4319956d527505a8159674656e Mon Sep 17 00:00:00 2001 From: Shocker Date: Fri, 16 Nov 2012 23:23:38 +0200 Subject: Core/Commands: Fix .npc add item --- src/server/scripts/Commands/cs_npc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index 1fa84985445..d4d4adad6a0 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -222,7 +222,7 @@ public: return false; } - sObjectMgr->AddVendorItem(vendor_entry, itemId, maxcount, incrtime, type, extendedcost); + sObjectMgr->AddVendorItem(vendor_entry, itemId, maxcount, incrtime, extendedcost, type); ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(itemId); -- cgit v1.2.3 From 98ba51f2e2fe1103f7b1a337d87910f236a40960 Mon Sep 17 00:00:00 2001 From: Tuxity Date: Sat, 17 Nov 2012 00:23:33 +0100 Subject: Revert "Core/Player: Reset emote state when player stop attacking" This reverts commit d3b12738a75607fced3d1da73741b479fc6fe6de. --- src/server/game/Entities/Unit/Unit.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 66926d94e0a..4c30d0b196a 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -8487,9 +8487,6 @@ bool Unit::AttackStop() SendMeleeAttackStop(victim); - if (GetTypeId() == TYPEID_PLAYER) - HandleEmoteCommand(EMOTE_STATE_NONE); - return true; } -- cgit v1.2.3 From 339d2b12575550b40840c410f04eb90a45f4e79d Mon Sep 17 00:00:00 2001 From: Spp Date: Sat, 17 Nov 2012 03:18:37 +0100 Subject: Fix compile --- .../PitOfSaron/boss_forgemaster_garfrost.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp index a12bd96f6df..e24024f5305 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp @@ -48,16 +48,6 @@ enum Spells #define SPELL_PERMAFROST_HELPER RAID_MODE(68786, 70336) #define SPELL_FORGE_BLADE_HELPER RAID_MODE(68774, 70334) -enum Events -{ - EVENT_THROW_SARONITE = 1, - EVENT_CHILLING_WAVE = 2, - EVENT_DEEP_FREEZE = 3, - EVENT_JUMP = 4, - EVENT_FORGING = 5, - EVENT_RESUME_ATTACK = 6, -}; - enum Phases { PHASE_ONE = 1, @@ -82,6 +72,15 @@ Position const southForgePos = {639.257f, -210.1198f, 529.015f, 0.523599f}; class boss_garfrost : public CreatureScript { +enum Events +{ + EVENT_THROW_SARONITE = 1, + EVENT_CHILLING_WAVE = 2, + EVENT_DEEP_FREEZE = 3, + EVENT_JUMP = 4, + EVENT_FORGING = 5, + EVENT_RESUME_ATTACK = 6, +}; public: boss_garfrost() : CreatureScript("boss_garfrost") { } -- cgit v1.2.3 From 477d17b0fc065f8d859d52037bf711b933d7bee8 Mon Sep 17 00:00:00 2001 From: oMadMano Date: Sat, 17 Nov 2012 14:10:47 -0500 Subject: Core/Spells: Fixed Improved Cone of Cold. --- .../2012_11_17_00_world_spell_script_names_434.sql | 4 ++ src/server/scripts/Spells/spell_mage.cpp | 44 ++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 sql/updates/world/2012_11_17_00_world_spell_script_names_434.sql (limited to 'src') diff --git a/sql/updates/world/2012_11_17_00_world_spell_script_names_434.sql b/sql/updates/world/2012_11_17_00_world_spell_script_names_434.sql new file mode 100644 index 00000000000..13eac8b301e --- /dev/null +++ b/sql/updates/world/2012_11_17_00_world_spell_script_names_434.sql @@ -0,0 +1,4 @@ +-- 120 Cone of Cold +DELETE FROM `spell_script_names` WHERE `spell_id` IN (120); +INSERT INTO `spell_script_names` VALUES +(120, "spell_mage_cone_of_cold"); diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index f4bbccc8587..35f0e98eef2 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -380,6 +380,49 @@ class spell_mage_living_bomb : public SpellScriptLoader } }; +enum ConeOfColdSpells +{ + SPELL_CONE_OF_COLD_AURA_R1 = 11190, // Improved Cone of Cold Rank 1 aura + SPELL_CONE_OF_COLD_AURA_R2 = 12489, // Improved Cone of Cold Rank 2 aura + SPELL_CONE_OF_COLD_TRIGGER_R1 = 83301, // Improved Cone of Cold Rank 1 Trigger + SPELL_CONE_OF_COLD_TRIGGER_R2 = 83302, // Improved Cone of Cold Rank 2 Trigger +}; + +// 120 Cone of Cold +/// Updated 4.3.4 +class spell_mage_cone_of_cold : public SpellScriptLoader +{ +public: + spell_mage_cone_of_cold() : SpellScriptLoader("spell_mage_cone_of_cold") { } + + class spell_mage_cone_of_cold_SpellScript : public SpellScript + { + PrepareSpellScript(spell_mage_cone_of_cold_SpellScript); + + void HandleConeOfColdScript(SpellEffIndex effIndex) + { + Unit* caster = GetCaster(); + if (Unit* unitTarget = GetHitUnit()) + { + if (caster->HasAura(SPELL_CONE_OF_COLD_AURA_R1)) // Improved Cone of Cold Rank 1 + unitTarget->CastSpell(unitTarget, SPELL_CONE_OF_COLD_TRIGGER_R1, true); + else if (caster->HasAura(SPELL_CONE_OF_COLD_AURA_R2)) // Improved Cone of Cold Rank 2 + unitTarget->CastSpell(unitTarget, SPELL_CONE_OF_COLD_TRIGGER_R2, true); + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_mage_cone_of_cold_SpellScript::HandleConeOfColdScript, EFFECT_0, SPELL_EFFECT_APPLY_AURA); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_mage_cone_of_cold_SpellScript(); + } +}; + void AddSC_mage_spell_scripts() { new spell_mage_blast_wave(); @@ -390,4 +433,5 @@ void AddSC_mage_spell_scripts() new spell_mage_polymorph_cast_visual(); new spell_mage_summon_water_elemental(); new spell_mage_living_bomb(); + new spell_mage_cone_of_cold(); } -- cgit v1.2.3 From 09ab26ac946bc7b5458d92fbadfb66e442744098 Mon Sep 17 00:00:00 2001 From: oMadMano Date: Sat, 17 Nov 2012 14:15:04 -0500 Subject: Core/Spells: Fixed mage's Permafrost --- src/server/game/Entities/Unit/Unit.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 4c30d0b196a..18002fb3531 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -5681,6 +5681,20 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere triggered_spell_id = 64413; break; } + // Permafrost + case 11175: + case 12569: + case 12571: + { + if (!GetGuardianPet()) + return false; + + // heal amount + basepoints0 = CalculatePct(damage, triggerAmount); + target = this; + triggered_spell_id = 91394; + break; + } } break; } -- cgit v1.2.3 From fff684ec7884440500aad7ca5a90e39709dc675e Mon Sep 17 00:00:00 2001 From: Spp Date: Mon, 19 Nov 2012 12:03:45 +0100 Subject: Remove duplicate code after some old merge --- src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp | 1 - src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp | 2 -- 2 files changed, 3 deletions(-) (limited to 'src') diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp index e8180057cec..afb60e60bf2 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp @@ -966,7 +966,6 @@ class spell_xt002_tympanic_tantrum : public SpellScriptLoader OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_xt002_tympanic_tantrum_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_xt002_tympanic_tantrum_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); OnHit += SpellHitFn(spell_xt002_tympanic_tantrum_SpellScript::RecalculateDamage); - OnHit += SpellHitFn(spell_xt002_tympanic_tantrum_SpellScript::RecalculateDamage); } }; diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp index 3a90b6901e3..f2f03ff602b 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp @@ -339,8 +339,6 @@ public: me->GetMotionMaster()->MoveLand(0, pos); me->SetDisableGravity(false, true); me->SetHover(true); - me->SetDisableGravity(false, true); - me->SetHover(true); ++introPhase; introTimer = 3000; break; -- cgit v1.2.3 From 172c5f0b93d8810ed06dde48af529d0e1998a48c Mon Sep 17 00:00:00 2001 From: Tuxity Date: Tue, 20 Nov 2012 10:37:25 +0100 Subject: Core/Arenas: Fix arena system, you can now enter in arenas and fight ! Countdown in preparation time are also displayed EnnemyUnitFrame while fighting works too N.B: There might be some little typos to fix. --- src/server/game/Battlegrounds/ArenaTeam.cpp | 14 ++ src/server/game/Battlegrounds/ArenaTeam.h | 2 + src/server/game/Battlegrounds/Battleground.cpp | 34 +++- src/server/game/Battlegrounds/Battleground.h | 5 +- src/server/game/Battlegrounds/BattlegroundMgr.cpp | 214 ++++++++++----------- src/server/game/Battlegrounds/BattlegroundMgr.h | 2 +- .../game/Battlegrounds/BattlegroundQueue.cpp | 5 +- src/server/game/Groups/Group.cpp | 2 +- src/server/game/Handlers/ArenaTeamHandler.cpp | 54 ++++++ src/server/game/Handlers/BattleGroundHandler.cpp | 187 +++++++----------- src/server/game/Server/Protocol/Opcodes.cpp | 6 +- src/server/game/Server/WorldSession.h | 1 + 12 files changed, 279 insertions(+), 247 deletions(-) (limited to 'src') diff --git a/src/server/game/Battlegrounds/ArenaTeam.cpp b/src/server/game/Battlegrounds/ArenaTeam.cpp index e7644805a76..4cfe069960d 100755 --- a/src/server/game/Battlegrounds/ArenaTeam.cpp +++ b/src/server/game/Battlegrounds/ArenaTeam.cpp @@ -542,6 +542,20 @@ uint8 ArenaTeam::GetSlotByType(uint32 type) return 0xFF; } +uint8 ArenaTeam::GetTypeBySlot(uint8 slot) +{ + switch (slot) + { + case 0: return ARENA_TEAM_2v2; + case 1: return ARENA_TEAM_3v3; + case 2: return ARENA_TEAM_5v5; + default: + break; + } + sLog->outError(LOG_FILTER_ARENAS, "FATAL: Unknown arena team slot %u for some arena team", slot); + return 0xFF; +} + bool ArenaTeam::IsMember(uint64 guid) const { for (MemberList::const_iterator itr = Members.begin(); itr != Members.end(); ++itr) diff --git a/src/server/game/Battlegrounds/ArenaTeam.h b/src/server/game/Battlegrounds/ArenaTeam.h index 5d8345aec53..405b82c6f4d 100755 --- a/src/server/game/Battlegrounds/ArenaTeam.h +++ b/src/server/game/Battlegrounds/ArenaTeam.h @@ -39,6 +39,7 @@ enum ArenaTeamCommandTypes enum ArenaTeamCommandErrors { + ERR_ARENA_TEAM_CREATED = 0x00, ERR_ARENA_TEAM_INTERNAL = 0x01, ERR_ALREADY_IN_ARENA_TEAM = 0x02, ERR_ALREADY_IN_ARENA_TEAM_S = 0x03, @@ -129,6 +130,7 @@ class ArenaTeam uint32 GetType() const { return Type; } uint8 GetSlot() const { return GetSlotByType(GetType()); } static uint8 GetSlotByType(uint32 type); + static uint8 GetTypeBySlot(uint8 slot); uint64 GetCaptain() const { return CaptainGuid; } std::string const& GetName() const { return TeamName; } const ArenaTeamStats& GetStats() const { return Stats; } diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index eb7ce9a64a4..13d434ff0e9 100755 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -146,6 +146,7 @@ Battleground::Battleground() m_IsArena = false; m_Winner = 2; m_StartTime = 0; + m_CountdownTimer = 0; m_ResetStatTimer = 0; m_ValidStartPositionTimer = 0; m_Events = 0; @@ -298,7 +299,11 @@ void Battleground::Update(uint32 diff) // Update start time and reset stats timer m_StartTime += diff; - m_ResetStatTimer += diff; + if (GetStatus() == STATUS_WAIT_JOIN) + { + m_ResetStatTimer += diff; + m_CountdownTimer += diff; + } PostUpdateImpl(diff); } @@ -462,7 +467,6 @@ inline void Battleground::_ProcessJoin(uint32 diff) ModifyStartDelayTime(diff); // I know it's a too big but it's the value sent in packet, I get it from retail sniff. - // I think it's link to the countdown when bgs start SetRemainingTime(300000); if (m_ResetStatTimer > 5000) @@ -473,6 +477,23 @@ inline void Battleground::_ProcessJoin(uint32 diff) player->ResetAllPowers(); } + // Send packet every 10 seconds until the 2nd field reach 0 + if (m_CountdownTimer >= 10000) + { + uint32 countdownMaxForBGType = isArena() ? ARENA_COUNTDOWN_MAX : BATTLEGROUND_COUNTDOWN_MAX; + + WorldPacket data(SMSG_START_TIMER, 4+4+4); + data << uint32(0); // unk + data << uint32(countdownMaxForBGType - (m_CountdownTimer / 1000)); + data << uint32(countdownMaxForBGType); + + for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr) + if (Player* player = ObjectAccessor::FindPlayer(itr->first)) + player->GetSession()->SendPacket(&data); + + m_CountdownTimer = 0; + } + if (!(m_Events & BG_STARTING_EVENT_1)) { m_Events |= BG_STARTING_EVENT_1; @@ -530,7 +551,7 @@ inline void Battleground::_ProcessJoin(uint32 diff) WorldPacket status; BattlegroundQueueTypeId bgQueueTypeId = sBattlegroundMgr->BGQueueTypeId(m_TypeID, GetArenaType()); uint32 queueSlot = player->GetBattlegroundQueueIndex(bgQueueTypeId); - sBattlegroundMgr->BuildBattlegroundStatusPacket(&status, this, player, queueSlot, STATUS_IN_PROGRESS, 0, GetElapsedTime(), GetArenaType()); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&status, this, player, queueSlot, STATUS_IN_PROGRESS, player->GetBattlegroundQueueJoinTime(m_TypeID), GetElapsedTime(), GetArenaType()); player->GetSession()->SendPacket(&status); player->RemoveAurasDueToSpell(SPELL_ARENA_PREPARATION); @@ -778,7 +799,7 @@ void Battleground::EndBattleground(uint32 winner) SetStatus(STATUS_WAIT_LEAVE); //we must set it this way, because end time is sent in packet! - m_EndTime = TIME_AUTOCLOSE_BATTLEGROUND; + SetRemainingTime(TIME_AUTOCLOSE_BATTLEGROUND); // arena rating calculation if (isArena() && isRated()) @@ -1179,7 +1200,7 @@ void Battleground::AddPlayer(Player* player) BattlegroundQueueTypeId bgQueueTypeId = sBattlegroundMgr->BGQueueTypeId(m_TypeID, GetArenaType()); uint32 queueSlot = player->GetBattlegroundQueueIndex(bgQueueTypeId); - sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, this, player, queueSlot, STATUS_IN_PROGRESS, player->GetBattlegroundQueueJoinTime(m_TypeID), GetElapsedTime(), GetArenaType(), isArena() ? 0 : 1); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, this, player, queueSlot, STATUS_IN_PROGRESS, player->GetBattlegroundQueueJoinTime(m_TypeID), GetElapsedTime(), GetArenaType()); player->GetSession()->SendPacket(&data); player->RemoveAurasByType(SPELL_AURA_MOUNTED); @@ -1212,6 +1233,9 @@ void Battleground::AddPlayer(Player* player) player->ResetAllPowers(); } + // Correctly display EnemyUnitFrame + player->SetByteValue(PLAYER_BYTES_3, 3, player->GetBGTeam()); + WorldPacket data(SMSG_ARENA_OPPONENT_UPDATE, 8); data << uint64(player->GetGUID()); SendPacketToTeam(team, &data, player, false); diff --git a/src/server/game/Battlegrounds/Battleground.h b/src/server/game/Battlegrounds/Battleground.h index 3feeea53ad8..7c0ca616214 100755 --- a/src/server/game/Battlegrounds/Battleground.h +++ b/src/server/game/Battlegrounds/Battleground.h @@ -113,7 +113,9 @@ enum BattlegroundTimeIntervals MAX_OFFLINE_TIME = 300, // secs RESPAWN_ONE_DAY = 86400, // secs RESPAWN_IMMEDIATELY = 0, // secs - BUFF_RESPAWN_TIME = 180 // secs + BUFF_RESPAWN_TIME = 180, // secs + BATTLEGROUND_COUNTDOWN_MAX = 120, // secs + ARENA_COUNTDOWN_MAX = 60 // secs }; enum BattlegroundStartTimeIntervals @@ -580,6 +582,7 @@ class Battleground BattlegroundStatus m_Status; uint32 m_ClientInstanceID; // the instance-id which is sent to the client and without any other internal use uint32 m_StartTime; + uint32 m_CountdownTimer; uint32 m_ResetStatTimer; uint32 m_ValidStartPositionTimer; int32 m_EndTime; // it is set to 120000 when bg is ending and it decreases itself diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index 8ce212472e4..323bc3fa1d2 100755 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -163,7 +163,7 @@ void BattlegroundMgr::Update(uint32 diff) } } -void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battleground *bg, Player * player, uint8 QueueSlot, uint8 StatusID, uint32 Time1, uint32 Time2, uint8 arenatype, uint8 /*uiFrame*/) +void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battleground *bg, Player * player, uint8 QueueSlot, uint8 StatusID, uint32 Time1, uint32 Time2, uint8 arenatype) { ObjectGuid playerGuid = player->GetGUID(); ObjectGuid bgGuid; @@ -212,7 +212,7 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro data->WriteBit(bgGuid[3]); data->WriteBit(playerGuid[2]); data->WriteBit(1); // Eligible In Queue - data->WriteBit(0); // Join Failed + data->WriteBit(0); // Join Failed, 1 when it's arena ... data->WriteBit(bgGuid[2]); data->WriteBit(playerGuid[1]); data->WriteBit(bgGuid[0]); @@ -231,7 +231,7 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro data->FlushBits(); data->WriteByteSeq(playerGuid[0]); - *data << uint32(1); // unk, always 1 + *data << uint32(bg->isArena() ? arenatype : 1); // Player count, 1 for bgs, 2-3-5 for arena (2v2, 3v3, 5v5) data->WriteByteSeq(bgGuid[5]); data->WriteByteSeq(playerGuid[3]); *data << uint32(Time1); // Estimated Wait Time @@ -241,7 +241,7 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro *data << uint8(0); // unk data->WriteByteSeq(bgGuid[4]); data->WriteByteSeq(playerGuid[2]); - *data << uint8(0); // Player count in rated mode + *data << uint8(0); // unk data->WriteByteSeq(bgGuid[6]); data->WriteByteSeq(playerGuid[7]); data->WriteByteSeq(bgGuid[3]); @@ -267,9 +267,9 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro *data << uint32(QueueSlot); // Queue slot *data << uint32(Time2); // Join Time *data << uint8(bg->GetMinLevel()); // Min Level - *data << uint32(1); // unk, always 1 + *data << uint32(bg->isArena() ? arenatype : 1); // Player count, 1 for bgs, 2-3-5 for arena (2v2, 3v3, 5v5) *data << uint32(bg->GetMapId()); // Map Id - *data << uint8(0); // Player count in rated mode + *data << uint8(0); // unk data->WriteBit(playerGuid[5]); data->WriteBit(playerGuid[2]); @@ -324,7 +324,7 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro data->WriteBit(bgGuid[3]); data->WriteBit(playerGuid[6]); data->WriteBit(bgGuid[5]); - data->WriteBit(0); // unk, Bit 64 + data->WriteBit(bg->isRated()); // Is Rated data->WriteBit(playerGuid[4]); data->WriteBit(bgGuid[6]); data->WriteBit(bgGuid[4]); @@ -344,26 +344,26 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro data->WriteByteSeq(playerGuid[6]); *data << uint32(Time1); // Join Time - *data << uint8(arenatype); // Teamsize (0 if not arena) + *data << uint8(0); // unk data->WriteByteSeq(playerGuid[4]); data->WriteByteSeq(playerGuid[1]); *data << uint32(QueueSlot); // Queue slot - *data << uint8(0); // Player count in rated mode - *data << uint32(1); // unk, always 1 + *data << uint8(0); // unk + *data << uint32(bg->isArena() ? arenatype : 1); // Player count, 1 for bgs, 2-3-5 for arena (2v2, 3v3, 5v5) *data << uint32(bg->GetMapId()); // Map Id *data << uint8(bg->GetMinLevel()); // Min Level *data << uint32(Time2); // Elapsed Time data->WriteByteSeq(playerGuid[2]); - *data << uint32(getMSTimeDiff(bg->GetRemainingTime(), Time2)); // Remaining Time + *data << uint32(bg->GetRemainingTime()); // Remaining Time data->WriteByteSeq(playerGuid[0]); data->WriteByteSeq(playerGuid[3]); data->WriteByteSeq(playerGuid[2]); - *data << uint32(bg->GetClientInstanceID()); // Client Instance ID + *data << uint32(bg->GetClientInstanceID()); // Client Instance ID or faction ? data->WriteByteSeq(bgGuid[0]); data->WriteByteSeq(playerGuid[7]); @@ -376,6 +376,7 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg) { + ByteBuffer buff; uint8 isRated = (bg->isRated() ? 1 : 0); // type (normal=0/rated=1) -- ATM arena or bg, RBG NYI uint8 isArena = (bg->isArena() ? 1 : 0); // Arena names @@ -385,7 +386,7 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg) if (isArena) { - for (int8 i = 1; i >= 0; --i) + for (int8 i = 0; i < BG_TEAMS_COUNT; ++i) { if (ArenaTeam* at = sArenaTeamMgr->GetArenaTeamById(bg->GetArenaTeamIdByIndex(i))) data->WriteBits(at->GetName().length(), 8); @@ -394,61 +395,51 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg) } } - size_t count_pos = data->bitwpos(); - - data->WriteBits(0, 21); // Placeholder - - int32 count = 0; - ByteBuffer buff; - - Battleground::BattlegroundScoreMap::const_iterator itr2 = bg->GetPlayerScoresBegin(); - for (Battleground::BattlegroundScoreMap::const_iterator itr = itr2; itr != bg->GetPlayerScoresEnd();) + data->WriteBits(bg->GetPlayerScoresSize(), 21); + for (Battleground::BattlegroundScoreMap::const_iterator itr = bg->GetPlayerScoresBegin(); itr != bg->GetPlayerScoresEnd(); ++itr) { - itr2 = itr++; - if (!bg->IsPlayerInBattleground(itr2->first)) + if (!bg->IsPlayerInBattleground(itr->first)) { sLog->outError(LOG_FILTER_BATTLEGROUND, "Player " UI64FMTD " has scoreboard entry for battleground %u but is not in battleground!", itr->first, bg->GetTypeID(true)); continue; } - ObjectGuid guid = itr2->first; - Player* player = ObjectAccessor::FindPlayer(itr2->first); - data->WriteBit(0); // Unk 1 - data->WriteBit(0); // Unk 2 - data->WriteBit(guid[2]); - data->WriteBit(!isArena); // Unk 3 -- Prolly if (bg) - data->WriteBit(0); // Unk 4 - data->WriteBit(0); // Unk 5 - data->WriteBit(0); // Unk 6 - data->WriteBit(guid[3]); - data->WriteBit(guid[0]); - data->WriteBit(guid[5]); - data->WriteBit(guid[1]); - data->WriteBit(guid[6]); - data->WriteBit(player->GetBGTeam() == ALLIANCE); - data->WriteBit(guid[7]); - - buff << uint32(itr2->second->HealingDone); // healing done - buff << uint32(itr2->second->DamageDone); // damage done - - if (!isArena) // Unk 3 prolly is (bg) + Player* player = ObjectAccessor::FindPlayer(itr->first); + ObjectGuid playerGUID = itr->first; + + data->WriteBit(0); // Unk 1 + data->WriteBit(0); // Unk 2 + data->WriteBit(playerGUID[2]); + data->WriteBit(!isArena); + data->WriteBit(0); // Unk 4 + data->WriteBit(0); // Unk 5 + data->WriteBit(0); // Unk 6 + data->WriteBit(playerGUID[3]); + data->WriteBit(playerGUID[0]); + data->WriteBit(playerGUID[5]); + data->WriteBit(playerGUID[1]); + data->WriteBit(playerGUID[6]); + data->WriteBit(player->GetTeam() == ALLIANCE); + data->WriteBit(playerGUID[7]); + + buff << uint32(itr->second->HealingDone); // healing done + buff << uint32(itr->second->DamageDone); // damage done + + if (!isArena) { - buff << uint32(itr2->second->BonusHonor / 100); - buff << uint32(itr2->second->Deaths); - buff << uint32(itr2->second->HonorableKills); + buff << uint32(itr->second->BonusHonor / 100); + buff << uint32(itr->second->Deaths); + buff << uint32(itr->second->HonorableKills); } - - buff.WriteByteSeq(guid[4]); - buff << uint32(itr2->second->KillingBlows); - + + buff.WriteByteSeq(playerGUID[4]); + buff << uint32(itr->second->KillingBlows); // if (unk 5) << uint32() unk - - buff.WriteByteSeq(guid[5]); - + buff.WriteByteSeq(playerGUID[5]); // if (unk 6) << uint32() unk // if (unk 2) << uint32() unk + buff.WriteByteSeq(playerGUID[1]); + buff.WriteByteSeq(playerGUID[6]); - buff.WriteByteSeq(guid[1]); - buff.WriteByteSeq(guid[6]); buff << int32(player->GetPrimaryTalentTree(player->GetActiveSpec())); @@ -459,45 +450,45 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg) { case 489: data->WriteBits(0x00000002, 24); - buff << uint32(((BattlegroundWGScore*)itr2->second)->FlagCaptures); // flag captures - buff << uint32(((BattlegroundWGScore*)itr2->second)->FlagReturns); // flag returns + buff << uint32(((BattlegroundWGScore*)itr->second)->FlagCaptures); // flag captures + buff << uint32(((BattlegroundWGScore*)itr->second)->FlagReturns); // flag returns break; case 566: data->WriteBits(0x00000001, 24); - buff << uint32(((BattlegroundEYScore*)itr2->second)->FlagCaptures); // flag captures + buff << uint32(((BattlegroundEYScore*)itr->second)->FlagCaptures); // flag captures break; case 529: data->WriteBits(0x00000002, 24); - buff << uint32(((BattlegroundABScore*)itr2->second)->BasesAssaulted); // bases asssulted - buff << uint32(((BattlegroundABScore*)itr2->second)->BasesDefended); // bases defended + buff << uint32(((BattlegroundABScore*)itr->second)->BasesAssaulted); // bases asssulted + buff << uint32(((BattlegroundABScore*)itr->second)->BasesDefended); // bases defended break; case 30: data->WriteBits(0x00000005, 24); - buff << uint32(((BattlegroundAVScore*)itr2->second)->GraveyardsAssaulted); // GraveyardsAssaulted - buff << uint32(((BattlegroundAVScore*)itr2->second)->GraveyardsDefended); // GraveyardsDefended - buff << uint32(((BattlegroundAVScore*)itr2->second)->TowersAssaulted); // TowersAssaulted - buff << uint32(((BattlegroundAVScore*)itr2->second)->TowersDefended); // TowersDefended - buff << uint32(((BattlegroundAVScore*)itr2->second)->MinesCaptured); // MinesCaptured + buff << uint32(((BattlegroundAVScore*)itr->second)->GraveyardsAssaulted); // GraveyardsAssaulted + buff << uint32(((BattlegroundAVScore*)itr->second)->GraveyardsDefended); // GraveyardsDefended + buff << uint32(((BattlegroundAVScore*)itr->second)->TowersAssaulted); // TowersAssaulted + buff << uint32(((BattlegroundAVScore*)itr->second)->TowersDefended); // TowersDefended + buff << uint32(((BattlegroundAVScore*)itr->second)->MinesCaptured); // MinesCaptured break; case 607: data->WriteBits(0x00000002, 24); - buff << uint32(((BattlegroundSAScore*)itr2->second)->demolishers_destroyed); - buff << uint32(((BattlegroundSAScore*)itr2->second)->gates_destroyed); + buff << uint32(((BattlegroundSAScore*)itr->second)->demolishers_destroyed); + buff << uint32(((BattlegroundSAScore*)itr->second)->gates_destroyed); break; case 628: // IC data->WriteBits(0x00000002, 24); - buff << uint32(((BattlegroundICScore*)itr2->second)->BasesAssaulted); // bases asssulted - buff << uint32(((BattlegroundICScore*)itr2->second)->BasesDefended); // bases defended + buff << uint32(((BattlegroundICScore*)itr->second)->BasesAssaulted); // bases asssulted + buff << uint32(((BattlegroundICScore*)itr->second)->BasesDefended); // bases defended break; case 726: data->WriteBits(0x00000002, 24); - buff << uint32(((BattlegroundTPScore*)itr2->second)->FlagCaptures); // flag captures - buff << uint32(((BattlegroundTPScore*)itr2->second)->FlagReturns); // flag returns + buff << uint32(((BattlegroundTPScore*)itr->second)->FlagCaptures); // flag captures + buff << uint32(((BattlegroundTPScore*)itr->second)->FlagReturns); // flag returns break; case 761: data->WriteBits(0x00000002, 24); - buff << uint32(((BattlegroundBFGScore*)itr2->second)->BasesAssaulted); // bases asssulted - buff << uint32(((BattlegroundBFGScore*)itr2->second)->BasesDefended); // bases defended + buff << uint32(((BattlegroundBFGScore*)itr->second)->BasesAssaulted); // bases asssulted + buff << uint32(((BattlegroundBFGScore*)itr->second)->BasesDefended); // bases defended break; default: data->WriteBits(0, 24); @@ -506,45 +497,45 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg) break; case BATTLEGROUND_AV: data->WriteBits(0x00000005, 24); - buff << uint32(((BattlegroundAVScore*)itr2->second)->GraveyardsAssaulted); // GraveyardsAssaulted - buff << uint32(((BattlegroundAVScore*)itr2->second)->GraveyardsDefended); // GraveyardsDefended - buff << uint32(((BattlegroundAVScore*)itr2->second)->TowersAssaulted); // TowersAssaulted - buff << uint32(((BattlegroundAVScore*)itr2->second)->TowersDefended); // TowersDefended - buff << uint32(((BattlegroundAVScore*)itr2->second)->MinesCaptured); // MinesCaptured + buff << uint32(((BattlegroundAVScore*)itr->second)->GraveyardsAssaulted); // GraveyardsAssaulted + buff << uint32(((BattlegroundAVScore*)itr->second)->GraveyardsDefended); // GraveyardsDefended + buff << uint32(((BattlegroundAVScore*)itr->second)->TowersAssaulted); // TowersAssaulted + buff << uint32(((BattlegroundAVScore*)itr->second)->TowersDefended); // TowersDefended + buff << uint32(((BattlegroundAVScore*)itr->second)->MinesCaptured); // MinesCaptured break; case BATTLEGROUND_WS: data->WriteBits(0x00000002, 24); - buff << uint32(((BattlegroundWGScore*)itr2->second)->FlagCaptures); // flag captures - buff << uint32(((BattlegroundWGScore*)itr2->second)->FlagReturns); // flag returns + buff << uint32(((BattlegroundWGScore*)itr->second)->FlagCaptures); // flag captures + buff << uint32(((BattlegroundWGScore*)itr->second)->FlagReturns); // flag returns break; case BATTLEGROUND_AB: data->WriteBits(0x00000002, 24); - buff << uint32(((BattlegroundABScore*)itr2->second)->BasesAssaulted); // bases asssulted - buff << uint32(((BattlegroundABScore*)itr2->second)->BasesDefended); // bases defended + buff << uint32(((BattlegroundABScore*)itr->second)->BasesAssaulted); // bases asssulted + buff << uint32(((BattlegroundABScore*)itr->second)->BasesDefended); // bases defended break; case BATTLEGROUND_EY: data->WriteBits(0x00000001, 24); - buff << uint32(((BattlegroundEYScore*)itr2->second)->FlagCaptures); // flag captures + buff << uint32(((BattlegroundEYScore*)itr->second)->FlagCaptures); // flag captures break; case BATTLEGROUND_SA: data->WriteBits(0x00000002, 24); - buff << uint32(((BattlegroundSAScore*)itr2->second)->demolishers_destroyed); - buff << uint32(((BattlegroundSAScore*)itr2->second)->gates_destroyed); + buff << uint32(((BattlegroundSAScore*)itr->second)->demolishers_destroyed); + buff << uint32(((BattlegroundSAScore*)itr->second)->gates_destroyed); break; case BATTLEGROUND_IC: data->WriteBits(0x00000002, 24); - buff << uint32(((BattlegroundICScore*)itr2->second)->BasesAssaulted); // bases asssulted - buff << uint32(((BattlegroundICScore*)itr2->second)->BasesDefended); // bases defended + buff << uint32(((BattlegroundICScore*)itr->second)->BasesAssaulted); // bases asssulted + buff << uint32(((BattlegroundICScore*)itr->second)->BasesDefended); // bases defended break; case BATTLEGROUND_TP: data->WriteBits(0x00000002, 24); - buff << uint32(((BattlegroundTPScore*)itr2->second)->FlagCaptures); // flag captures - buff << uint32(((BattlegroundTPScore*)itr2->second)->FlagReturns); // flag returns + buff << uint32(((BattlegroundTPScore*)itr->second)->FlagCaptures); // flag captures + buff << uint32(((BattlegroundTPScore*)itr->second)->FlagReturns); // flag returns break; case BATTLEGROUND_BFG: data->WriteBits(0x00000002, 24); - buff << uint32(((BattlegroundBFGScore*)itr2->second)->BasesAssaulted); // bases asssulted - buff << uint32(((BattlegroundBFGScore*)itr2->second)->BasesDefended); // bases defended + buff << uint32(((BattlegroundBFGScore*)itr->second)->BasesAssaulted); // bases asssulted + buff << uint32(((BattlegroundBFGScore*)itr->second)->BasesDefended); // bases defended break; case BATTLEGROUND_NA: case BATTLEGROUND_BE: @@ -558,27 +549,22 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg) data->WriteBits(0, 24); break; } - data->WriteBit(guid[4]); - buff.WriteByteSeq(guid[0]); - buff.WriteByteSeq(guid[3]); + data->WriteBit(playerGUID[4]); + buff.WriteByteSeq(playerGUID[0]); + buff.WriteByteSeq(playerGUID[3]); // if (unk 4) << uint32() unk - - buff.WriteByteSeq(guid[7]); - buff.WriteByteSeq(guid[2]); - - ++count; + buff.WriteByteSeq(playerGUID[7]); + buff.WriteByteSeq(playerGUID[2]); } data->WriteBit(bg->GetStatus() == STATUS_WAIT_LEAVE); // If Ended - data->FlushBits(); - data->PutBits(count_pos, count, 21); // Number of Players - if (isRated) // arena TODO : Fix Order on Rated Implementation + if (isRated) // arena { // it seems this must be according to BG_WINNER_A/H and _NOT_ BG_TEAM_A/H - for (int8 i = 1; i >= 0; --i) + for (int8 i = 0; i < BG_TEAMS_COUNT; ++i) { int32 rating_change = bg->GetArenaTeamRatingChangeByIndex(i); @@ -586,31 +572,33 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg) uint32 pointsGained = rating_change > 0 ? rating_change : 0; uint32 MatchmakerRating = bg->GetArenaMatchmakerRatingByIndex(i); + *data << uint32(MatchmakerRating); // Matchmaking Value *data << uint32(pointsLost); // Rating Lost *data << uint32(pointsGained); // Rating gained - *data << uint32(MatchmakerRating); // Matchmaking Value + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "rating change: %d", rating_change); } } + data->FlushBits(); data->append(buff); if (isArena) - for (int8 i = 1; i >= 0; --i) + for (int8 i = 0; i < BG_TEAMS_COUNT; ++i) if (ArenaTeam* at = sArenaTeamMgr->GetArenaTeamById(bg->GetArenaTeamIdByIndex(i))) data->WriteString(at->GetName()); - *data << uint8(0); // unk + *data << uint8(bg->GetPlayersCountByTeam(HORDE)); if (bg->GetStatus() == STATUS_WAIT_LEAVE) *data << uint8(bg->GetWinner()); // who win - *data << uint8(0); // unk + *data << uint8(bg->GetPlayersCountByTeam(ALLIANCE)); } -void BattlegroundMgr::BuildStatusFailedPacket(WorldPacket* data, Battleground* bg, Player* pPlayer, uint8 QueueSlot, GroupJoinBattlegroundResult result) +void BattlegroundMgr::BuildStatusFailedPacket(WorldPacket* data, Battleground* bg, Player* player, uint8 QueueSlot, GroupJoinBattlegroundResult result) { - ObjectGuid guidBytes1 = pPlayer ? pPlayer->GetGUID() : 0; // player who caused the error + ObjectGuid guidBytes1 = player->GetGUID(); // player who caused the error ObjectGuid guidBytes2 = bg->GetGUID(); ObjectGuid unkGuid3 = 0; @@ -645,7 +633,7 @@ void BattlegroundMgr::BuildStatusFailedPacket(WorldPacket* data, Battleground* b data->WriteByteSeq(guidBytes2[1]); - *data << uint32(bg->GetStatus()); // Status + *data << uint32(1); // Unk, always 1 *data << uint32(QueueSlot); // Queue slot data->WriteByteSeq(guidBytes1[6]); @@ -674,7 +662,7 @@ void BattlegroundMgr::BuildStatusFailedPacket(WorldPacket* data, Battleground* b data->WriteByteSeq(unkGuid3[2]); - *data << uint32(time(NULL)); // Time + *data << uint32(player->GetBattlegroundQueueJoinTime(bg->GetTypeID())); // Join Time data->WriteByteSeq(unkGuid3[5]); } diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.h b/src/server/game/Battlegrounds/BattlegroundMgr.h index b901b3e5b79..da7839ff1b0 100755 --- a/src/server/game/Battlegrounds/BattlegroundMgr.h +++ b/src/server/game/Battlegrounds/BattlegroundMgr.h @@ -80,7 +80,7 @@ class BattlegroundMgr void BuildStatusFailedPacket(WorldPacket* data, Battleground* bg, Player* pPlayer, uint8 QueueSlot, GroupJoinBattlegroundResult result); void BuildUpdateWorldStatePacket(WorldPacket* data, uint32 field, uint32 value); void BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg); - void BuildBattlegroundStatusPacket(WorldPacket* data, Battleground* bg, Player* player, uint8 queueSlot, uint8 statusId, uint32 time1, uint32 time2, uint8 arenaType, uint8 uiFrame = 1); + void BuildBattlegroundStatusPacket(WorldPacket* data, Battleground* bg, Player* player, uint8 queueSlot, uint8 statusId, uint32 time1, uint32 time2, uint8 arenaType); void BuildPlaySoundPacket(WorldPacket* data, uint32 soundId); void SendAreaSpiritHealerQueryOpcode(Player* player, Battleground* bg, uint64 guid); diff --git a/src/server/game/Battlegrounds/BattlegroundQueue.cpp b/src/server/game/Battlegrounds/BattlegroundQueue.cpp index fec17b2873e..43865b5ec8e 100755 --- a/src/server/game/Battlegrounds/BattlegroundQueue.cpp +++ b/src/server/game/Battlegrounds/BattlegroundQueue.cpp @@ -392,10 +392,11 @@ void BattlegroundQueue::RemovePlayer(uint64 guid, bool decreaseInvitedCount) Battleground* bg = sBattlegroundMgr->GetBattlegroundTemplate(group->BgTypeId); BattlegroundQueueTypeId bgQueueTypeId = BattlegroundMgr::BGQueueTypeId(group->BgTypeId, group->ArenaType); uint32 queueSlot = plr2->GetBattlegroundQueueIndex(bgQueueTypeId); + plr2->RemoveBattlegroundQueueId(bgQueueTypeId); // must be called this way, because if you move this call to // queue->removeplayer, it causes bugs WorldPacket data; - sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, plr2, queueSlot, STATUS_NONE, group->JoinTime, 0, 0); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, plr2, queueSlot, STATUS_NONE, plr2->GetBattlegroundQueueJoinTime(group->BgTypeId), 0, 0); plr2->GetSession()->SendPacket(&data); } // then actually delete, this may delete the group as well! @@ -666,7 +667,7 @@ bool BattlegroundQueue::CheckNormalMatch(Battleground* bg_template, Battleground return false; } //allow 1v0 if debug bg - if (sBattlegroundMgr->isTesting() && bg_template->isBattleground() && (m_SelectionPools[TEAM_ALLIANCE].GetPlayerCount() || m_SelectionPools[TEAM_HORDE].GetPlayerCount())) + if (sBattlegroundMgr->isTesting() && (m_SelectionPools[TEAM_ALLIANCE].GetPlayerCount() || m_SelectionPools[TEAM_HORDE].GetPlayerCount())) return true; //return true if there are enough players in selection pools - enable to work .debug bg command correctly return m_SelectionPools[TEAM_ALLIANCE].GetPlayerCount() >= minPlayers && m_SelectionPools[TEAM_HORDE].GetPlayerCount() >= minPlayers; diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index 527b7801a72..a98f7cd8424 100755 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -1877,7 +1877,7 @@ GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const* if (bgOrTemplate->isArena() && memberscount != MinPlayerCount) return ERR_ARENA_TEAM_PARTY_SIZE; - return GroupJoinBattlegroundResult(bgOrTemplate->GetTypeID()); + return ERR_BATTLEGROUND_NONE; } //=================================================== diff --git a/src/server/game/Handlers/ArenaTeamHandler.cpp b/src/server/game/Handlers/ArenaTeamHandler.cpp index 0790acb4ae6..0d1fa986b87 100755 --- a/src/server/game/Handlers/ArenaTeamHandler.cpp +++ b/src/server/game/Handlers/ArenaTeamHandler.cpp @@ -74,6 +74,54 @@ void WorldSession::HandleArenaTeamRosterOpcode(WorldPacket & recvData) arenaTeam->Roster(this); } +void WorldSession::HandleArenaTeamCreateOpcode(WorldPacket & recvData) +{ + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ARENA_TEAM_CREATE"); + + uint32 slot, icon, iconcolor, border, bordercolor, background; + std::string name; + + recvData >> slot; + recvData >> iconcolor; + recvData >> bordercolor; + recvData >> icon; + recvData >> background; + recvData >> border; + name = recvData.ReadString(recvData.ReadBits(8)); + + uint8 type = ArenaTeam::GetTypeBySlot(slot); + + if (_player->GetArenaTeamId(slot)) + { + SendArenaTeamCommandResult(ERR_ARENA_TEAM_INVITE_SS, "", _player->GetName(), ERR_ALREADY_IN_ARENA_TEAM_S); + return; + } + + if (sObjectMgr->IsReservedName(name) || !ObjectMgr::IsValidCharterName(name)) + { + SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, name, "", ERR_ARENA_TEAM_NAME_INVALID); + return; + } + + if (sArenaTeamMgr->GetArenaTeamByName(name)) + { + SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, name, "", ERR_ARENA_TEAM_NAME_EXISTS_S); + return; + } + + ArenaTeam* arenaTeam = new ArenaTeam; + if (!arenaTeam->Create(GUID_LOPART(_player->GetGUID()), type, name, background, icon, iconcolor, border, bordercolor)) + { + sLog->outError(LOG_FILTER_ARENAS, "Arena team create failed."); + delete arenaTeam; + return; + } + + sArenaTeamMgr->AddArenaTeam(arenaTeam); + + SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, name, "", ERR_ARENA_TEAM_CREATED); +} + void WorldSession::HandleArenaTeamInviteOpcode(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ARENA_TEAM_INVITE"); @@ -112,6 +160,12 @@ void WorldSession::HandleArenaTeamInviteOpcode(WorldPacket & recvData) return; } + if (arenaTeam->GetCaptain() != _player->GetGUID()) + { + SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, "", "", ERR_ARENA_TEAM_PERMISSIONS); + return; + } + // OK result but don't send invite if (player->GetSocial()->HasIgnore(GetPlayer()->GetGUIDLow())) return; diff --git a/src/server/game/Handlers/BattleGroundHandler.cpp b/src/server/game/Handlers/BattleGroundHandler.cpp index 7aabd9d4bdf..a4177b9a081 100755 --- a/src/server/game/Handlers/BattleGroundHandler.cpp +++ b/src/server/game/Handlers/BattleGroundHandler.cpp @@ -444,7 +444,6 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData) return; } - BattlegroundTypeId bgTypeId = BattlegroundMgr::BGTemplateId(bgQueueTypeId); BattlegroundQueue& bgQueue = sBattlegroundMgr->GetBattlegroundQueue(bgQueueTypeId); //we must use temporary variable, because GroupQueueInfo pointer can be deleted in BattlegroundQueue::RemovePlayer() function @@ -463,7 +462,10 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData) return; } - Battleground* bg = sBattlegroundMgr->GetBattleground(ginfo.IsInvitedToBGInstanceGUID, bgTypeId); + BattlegroundTypeId bgTypeId = BattlegroundMgr::BGTemplateId(bgQueueTypeId); + // BGTemplateId returns BATTLEGROUND_AA when it is arena queue. + // Do instance id search as there is no AA bg instances. + Battleground* bg = sBattlegroundMgr->GetBattleground(ginfo.IsInvitedToBGInstanceGUID, bgTypeId == BATTLEGROUND_AA ? BATTLEGROUND_TYPE_NONE : bgTypeId); if (!bg) { if (action) @@ -484,6 +486,9 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData) sLog->outDebug(LOG_FILTER_BATTLEGROUND, "CMSG_BATTLEFIELD_PORT %s Slot: %u, Unk: %u, Time: %u, Action: %u.", GetPlayerInfo().c_str(), queueSlot, unk, time, action); + // get real bg type + bgTypeId = bg->GetTypeID(); + // expected bracket entry PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(), _player->getLevel()); if (!bracketEntry) @@ -554,9 +559,6 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData) } else // leave queue { - if (bg->isArena() && bg->GetStatus() > STATUS_WAIT_QUEUE) - return; - // if player leaves rated arena match before match start, it is counted as he played but he lost if (ginfo.IsRated && ginfo.IsInvitedToBGInstanceGUID) { @@ -568,14 +570,15 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData) at->SaveToDB(); } } - _player->RemoveBattlegroundQueueId(bgQueueTypeId); // must be called this way, because if you move this call to queue->removeplayer, it causes bugs sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, _player, queueSlot, STATUS_NONE, _player->GetBattlegroundQueueJoinTime(bgTypeId), 0, 0); + SendPacket(&data); + _player->RemoveBattlegroundQueueId(bgQueueTypeId); // must be called this way, because if you move this call to queue->removeplayer, it causes bugs bgQueue.RemovePlayer(_player->GetGUID(), true); // player left queue, we should update it - do not update Arena Queue if (!ginfo.ArenaType) sBattlegroundMgr->ScheduleQueueUpdate(ginfo.ArenaMatchmakerRating, ginfo.ArenaType, bgQueueTypeId, bgTypeId, bracketEntry->GetBracketId()); - SendPacket(&data); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: player %s (%u) left queue for bgtype %u, queue type %u.", _player->GetName().c_str(), _player->GetGUIDLow(), bg->GetTypeID(), bgQueueTypeId); } } @@ -662,44 +665,18 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_BATTLEMASTER_JOIN_ARENA"); - uint64 guid; // arena Battlemaster guid uint8 arenaslot; // 2v2, 3v3 or 5v5 - uint8 asGroup; // asGroup - uint8 isRated; // isRated - Group* grp = NULL; - recvData >> guid >> arenaslot >> asGroup >> isRated; + recvData >> arenaslot; // ignore if we already in BG or BG queue if (_player->InBattleground()) return; - Creature* unit = GetPlayer()->GetMap()->GetCreature(guid); - if (!unit) - return; - - if (!unit->isBattleMaster()) // it's not battle master - return; - - uint8 arenatype = 0; uint32 arenaRating = 0; uint32 matchmakerRating = 0; - switch (arenaslot) - { - case 0: - arenatype = ARENA_TYPE_2v2; - break; - case 1: - arenatype = ARENA_TYPE_3v3; - break; - case 2: - arenatype = ARENA_TYPE_5v5; - break; - default: - sLog->outError(LOG_FILTER_NETWORKIO, "Unknown arena slot %u at HandleBattlemasterJoinArena()", arenaslot); - return; - } + uint8 arenatype = ArenaTeam::GetTypeBySlot(arenaslot); //check existance Battleground* bg = sBattlegroundMgr->GetBattlegroundTemplate(BATTLEGROUND_AA); @@ -723,103 +700,71 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recvData) GroupJoinBattlegroundResult err = ERR_BATTLEGROUND_NONE; - if (!asGroup) - { - // check if already in queue - if (_player->GetBattlegroundQueueIndex(bgQueueTypeId) < PLAYER_MAX_BATTLEGROUND_QUEUES) - //player is already in this queue - return; - // check if has free queue slots - if (!_player->HasFreeBattlegroundQueueId()) - return; - } - else + Group* grp = _player->GetGroup(); + // no group found, error + if (!grp) + return; + if (grp->GetLeaderGUID() != _player->GetGUID()) + return; + + uint32 ateamId = _player->GetArenaTeamId(arenaslot); + // check real arenateam existence only here (if it was moved to group->CanJoin .. () then we would ahve to get it twice) + ArenaTeam* at = sArenaTeamMgr->GetArenaTeamById(ateamId); + if (!at) { - grp = _player->GetGroup(); - // no group found, error - if (!grp) - return; - if (grp->GetLeaderGUID() != _player->GetGUID()) - return; - err = grp->CanJoinBattlegroundQueue(bg, bgQueueTypeId, arenatype, arenatype, (bool)isRated, arenaslot); + _player->GetSession()->SendNotInArenaTeamPacket(arenatype); + return; } - uint32 ateamId = 0; - - if (isRated) + // get the team rating for queueing + arenaRating = at->GetRating(); + matchmakerRating = at->GetAverageMMR(grp); + // the arenateam id must match for everyone in the group + + if (arenaRating <= 0) + arenaRating = 1; + + BattlegroundQueue &bgQueue = sBattlegroundMgr->GetBattlegroundQueue(bgQueueTypeId); + + uint32 avgTime = 0; + GroupQueueInfo* ginfo; + + err = grp->CanJoinBattlegroundQueue(bg, bgQueueTypeId, arenatype, arenatype, true, arenaslot); + if (!err) { - ateamId = _player->GetArenaTeamId(arenaslot); - // check real arenateam existence only here (if it was moved to group->CanJoin .. () then we would ahve to get it twice) - ArenaTeam* at = sArenaTeamMgr->GetArenaTeamById(ateamId); - if (!at) - { - _player->GetSession()->SendNotInArenaTeamPacket(arenatype); - return; - } - // get the team rating for queueing - arenaRating = at->GetRating(); - matchmakerRating = at->GetAverageMMR(grp); - // the arenateam id must match for everyone in the group - - if (arenaRating <= 0) - arenaRating = 1; + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: arena team id %u, leader %s queued with matchmaker rating %u for type %u", _player->GetArenaTeamId(arenaslot), _player->GetName().c_str(), matchmakerRating, arenatype); + + ginfo = bgQueue.AddGroup(_player, grp, bgTypeId, bracketEntry, arenatype, true, false, arenaRating, matchmakerRating, ateamId); + avgTime = bgQueue.GetAverageQueueWaitTime(ginfo, bracketEntry->GetBracketId()); } - - BattlegroundQueue &bgQueue = sBattlegroundMgr->GetBattlegroundQueue(bgQueueTypeId); - if (asGroup) + + for (GroupReference* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next()) { - uint32 avgTime = 0; - GroupQueueInfo* ginfo; - - if (!err) - { - sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: arena join as group start"); - if (isRated) - { - sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: arena team id %u, leader %s queued with matchmaker rating %u for type %u", _player->GetArenaTeamId(arenaslot), _player->GetName().c_str(), matchmakerRating, arenatype); - bg->SetRated(true); - } - else - bg->SetRated(false); - - ginfo = bgQueue.AddGroup(_player, grp, bgTypeId, bracketEntry, arenatype, isRated, false, arenaRating, matchmakerRating, ateamId); - avgTime = bgQueue.GetAverageQueueWaitTime(ginfo, bracketEntry->GetBracketId()); - } - - for (GroupReference* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next()) + Player* member = itr->getSource(); + if (!member) + continue; + + if (err) { - Player* member = itr->getSource(); - if (!member) - continue; - - if (err) - { - WorldPacket data; - sBattlegroundMgr->BuildStatusFailedPacket(&data, bg, _player, 0, err); - member->GetSession()->SendPacket(&data); - continue; - } - - // add to queue - uint32 queueSlot = member->AddBattlegroundQueueId(bgQueueTypeId); - - WorldPacket data; // send status packet (in queue) - sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, member, queueSlot, STATUS_WAIT_QUEUE, avgTime, ginfo->JoinTime, arenatype); + WorldPacket data; + sBattlegroundMgr->BuildStatusFailedPacket(&data, bg, _player, 0, err); member->GetSession()->SendPacket(&data); - sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: player joined queue for arena as group bg queue type %u bg type %u: GUID %u, NAME %s", bgQueueTypeId, bgTypeId, member->GetGUIDLow(), member->GetName().c_str()); + continue; } - } - else - { - GroupQueueInfo* ginfo = bgQueue.AddGroup(_player, NULL, bgTypeId, bracketEntry, arenatype, isRated, false, arenaRating, matchmakerRating, ateamId); - uint32 avgTime = bgQueue.GetAverageQueueWaitTime(ginfo, bracketEntry->GetBracketId()); - uint32 queueSlot = _player->AddBattlegroundQueueId(bgQueueTypeId); - + + // add to queue + uint32 queueSlot = member->AddBattlegroundQueueId(bgQueueTypeId); + + // add joined time data + member->AddBattlegroundQueueJoinTime(bgTypeId, ginfo->JoinTime); + WorldPacket data; // send status packet (in queue) - sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, GetPlayer(), queueSlot, STATUS_WAIT_QUEUE, avgTime, ginfo->JoinTime, arenatype); - SendPacket(&data); - sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: player joined queue for arena, skirmish, bg queue type %u bg type %u: GUID %u, NAME %s", bgQueueTypeId, bgTypeId, _player->GetGUIDLow(), _player->GetName().c_str()); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, member, queueSlot, STATUS_WAIT_QUEUE, avgTime, ginfo->JoinTime, arenatype); + member->GetSession()->SendPacket(&data); + + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: player joined queue for arena as group bg queue type %u bg type %u: GUID %u, NAME %s", bgQueueTypeId, bgTypeId, member->GetGUIDLow(), member->GetName().c_str()); } + sBattlegroundMgr->ScheduleQueueUpdate(matchmakerRating, arenatype, bgQueueTypeId, bgTypeId, bracketEntry->GetBracketId()); } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 93efc8d2132..0ecb6529ea8 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -70,7 +70,7 @@ void OpcodeTable::Initialize() DEFINE_OPCODE_HANDLER(CMSG_AREA_SPIRIT_HEALER_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaSpiritHealerQueryOpcode); DEFINE_OPCODE_HANDLER(CMSG_AREA_SPIRIT_HEALER_QUEUE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaSpiritHealerQueueOpcode); DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamAcceptOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_CREATE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_CREATE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleArenaTeamCreateOpcode ); DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamDeclineOpcode ); DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_DISBAND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamDisbandOpcode ); DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamInviteOpcode ); @@ -107,7 +107,7 @@ void OpcodeTable::Initialize() DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_STATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlefieldStatusOpcode ); DEFINE_OPCODE_HANDLER(CMSG_BATTLEGROUND_PLAYER_POSITIONS, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleBattlegroundPlayerPositionsOpcode); DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_JOIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlemasterJoinOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_JOIN_ARENA, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlemasterJoinArena ); + DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_JOIN_ARENA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlemasterJoinArena ); DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_JOIN_RATED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_BEGIN_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBeginTradeOpcode ); DEFINE_OPCODE_HANDLER(CMSG_BINDER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBinderActivateOpcode ); @@ -1218,7 +1218,7 @@ void OpcodeTable::Initialize() DEFINE_OPCODE_HANDLER(SMSG_STABLE_RESULT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_STANDSTATE_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_START_MIRROR_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_START_TIMER, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_START_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_STOP_DANCE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_STOP_MIRROR_TIMER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_STREAMING_MOVIE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 0c4220e9ea6..68490e3b4dc 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -865,6 +865,7 @@ class WorldSession void HandleInspectArenaTeamsOpcode(WorldPacket& recvData); void HandleArenaTeamQueryOpcode(WorldPacket& recvData); void HandleArenaTeamRosterOpcode(WorldPacket& recvData); + void HandleArenaTeamCreateOpcode(WorldPacket& recvData); void HandleArenaTeamInviteOpcode(WorldPacket& recvData); void HandleArenaTeamAcceptOpcode(WorldPacket& recvData); void HandleArenaTeamDeclineOpcode(WorldPacket& recvData); -- cgit v1.2.3 From 43d5af1ebd3743968c04edc58f9df9e0acf5b503 Mon Sep 17 00:00:00 2001 From: huri Date: Tue, 20 Nov 2012 17:29:15 +0100 Subject: Core/Spells: Fixed Arcane Brilliance, Dalaran Brilliance, Power Word: Fortitude, Shadow Protection, Mark of the Wild, Blessing of Kings, Blessing of Might --- sql/updates/world/2012_11_20_00_world_misc.sql | 39 ++++++++++++++++++++++++++ src/server/scripts/Spells/spell_generic.cpp | 36 ++++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 sql/updates/world/2012_11_20_00_world_misc.sql (limited to 'src') diff --git a/sql/updates/world/2012_11_20_00_world_misc.sql b/sql/updates/world/2012_11_20_00_world_misc.sql new file mode 100644 index 00000000000..c0a95134b0a --- /dev/null +++ b/sql/updates/world/2012_11_20_00_world_misc.sql @@ -0,0 +1,39 @@ +-- Mark of the Wild +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=1126; +DELETE FROM `spell_script_names` WHERE `spell_id`=1126 OR `ScriptName`='spell_dru_mark_of_the_wild'; +INSERT INTO `spell_script_names` VALUES +(1126,'spell_dru_mark_of_the_wild'); + +-- Arcane Brilliance +DELETE FROM `spell_script_names` WHERE `spell_id`=1459 OR `ScriptName`='spell_mage_arcane_brilliance'; +INSERT INTO `spell_script_names` VALUES +(1459,'spell_mage_arcane_brilliance'); + +-- Dalaran Brilliance +DELETE FROM `spell_script_names` WHERE `spell_id`=61316 OR `ScriptName`='spell_mage_dalaran_brilliance'; +INSERT INTO `spell_script_names` VALUES +(61316,'spell_mage_dalaran_brilliance'); + +-- Blessing of Kings +DELETE FROM `spell_script_names` WHERE `spell_id`=20217 OR `ScriptName`='spell_pal_blessing_of_kings'; +INSERT INTO `spell_script_names` VALUES +(20217,'spell_pal_blessing_of_kings'); + +-- Blessing of Might +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=19740; +DELETE FROM `spell_script_names` WHERE `spell_id`=19740 OR `ScriptName`='spell_pal_blessing_of_might'; +INSERT INTO `spell_script_names` VALUES +(19740,'spell_pal_blessing_of_might'); + +-- Power Word: Fortitude +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=21562; +DELETE FROM `spell_script_names` WHERE `spell_id`=21562 OR `ScriptName`='spell_pri_power_word_fortitude'; +INSERT INTO `spell_script_names` VALUES +(21562,'spell_pri_power_word_fortitude'); + +-- Shadow Protection +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=27683; +DELETE FROM `spell_scripts` WHERE `id`=27683; +DELETE FROM `spell_script_names` WHERE `spell_id`=27683 OR `ScriptName`='spell_pri_shadow_protection'; +INSERT INTO `spell_script_names` VALUES +(27683,'spell_pri_shadow_protection'); diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 65fde6059c9..1f23d0a4d7a 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -3306,6 +3306,35 @@ class spell_gen_gift_of_naaru : public SpellScriptLoader } }; +class spell_gen_increase_stats_buff : public SpellScriptLoader +{ + public: + spell_gen_increase_stats_buff(char const* scriptName) : SpellScriptLoader(scriptName) { } + + class spell_gen_increase_stats_buff_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_increase_stats_buff_SpellScript); + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + if (GetHitUnit()->IsInRaidWith(GetCaster())) + GetCaster()->CastSpell(GetCaster(), GetEffectValue() + 1, true); // raid buff + else + GetCaster()->CastSpell(GetHitUnit(), GetEffectValue(), true); // single-target buff + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_gen_increase_stats_buff_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_gen_increase_stats_buff_SpellScript(); + } +}; + void AddSC_generic_spell_scripts() { new spell_gen_absorb0_hitlimit1(); @@ -3382,4 +3411,11 @@ void AddSC_generic_spell_scripts() new spell_gen_upper_deck_create_foam_sword(); new spell_gen_bonked(); new spell_gen_gift_of_naaru(); + new spell_gen_increase_stats_buff("spell_pal_blessing_of_kings"); + new spell_gen_increase_stats_buff("spell_pal_blessing_of_might"); + new spell_gen_increase_stats_buff("spell_dru_mark_of_the_wild"); + new spell_gen_increase_stats_buff("spell_pri_power_word_fortitude"); + new spell_gen_increase_stats_buff("spell_pri_shadow_protection"); + new spell_gen_increase_stats_buff("spell_mage_arcane_brilliance"); + new spell_gen_increase_stats_buff("spell_mage_dalaran_brilliance"); } -- cgit v1.2.3 From e5681fe90492055dcbf8fe3f55c3cdec92213024 Mon Sep 17 00:00:00 2001 From: horn Date: Wed, 21 Nov 2012 18:01:55 +0100 Subject: Core/Calendar: Update calendar to 4.3.4 and enable calendar related opcodes --- src/server/game/Calendar/CalendarMgr.cpp | 8 +++- src/server/game/Calendar/CalendarMgr.h | 3 +- src/server/game/Handlers/CalendarHandler.cpp | 4 ++ src/server/game/Server/Protocol/Opcodes.cpp | 60 ++++++++++++++-------------- 4 files changed, 43 insertions(+), 32 deletions(-) (limited to 'src') diff --git a/src/server/game/Calendar/CalendarMgr.cpp b/src/server/game/Calendar/CalendarMgr.cpp index 9f4816d6c7c..a7c9e007acc 100644 --- a/src/server/game/Calendar/CalendarMgr.cpp +++ b/src/server/game/Calendar/CalendarMgr.cpp @@ -510,6 +510,10 @@ void CalendarMgr::SendCalendarEventInviteAlert(CalendarEvent const& calendarEven data << uint32(calendarEvent.GetType()); data << int32(calendarEvent.GetDungeonId()); data << uint64(invite.GetInviteId()); + + Guild* guild = sGuildMgr->GetGuildById(calendarEvent.GetGuildId()); + data << uint64(guild ? guild->GetGUID() : 0); + data << uint8(invite.GetStatus()); data << uint8(invite.GetRank()); data.appendPackGUID(calendarEvent.GetCreatorGUID()); @@ -546,7 +550,9 @@ void CalendarMgr::SendCalendarEvent(uint64 guid, CalendarEvent const& calendarEv data << uint32(calendarEvent.GetFlags()); data.AppendPackedTime(calendarEvent.GetEventTime()); data.AppendPackedTime(calendarEvent.GetTimeZoneTime()); - data << uint32(calendarEvent.GetGuildId()); + + Guild* guild = sGuildMgr->GetGuildById(calendarEvent.GetGuildId()); + data << uint64(guild ? guild->GetGUID() : 0); data << uint32(eventInviteeList.size()); for (std::vector::const_iterator itr = eventInviteeList.begin(); itr != eventInviteeList.end(); ++itr) diff --git a/src/server/game/Calendar/CalendarMgr.h b/src/server/game/Calendar/CalendarMgr.h index db6acb667ec..c1c7d66f41d 100644 --- a/src/server/game/Calendar/CalendarMgr.h +++ b/src/server/game/Calendar/CalendarMgr.h @@ -58,7 +58,8 @@ enum CalendarEventType CALENDAR_TYPE_DUNGEON = 1, CALENDAR_TYPE_PVP = 2, CALENDAR_TYPE_MEETING = 3, - CALENDAR_TYPE_OTHER = 4 + CALENDAR_TYPE_OTHER = 4, + CALENDAR_TYPE_HEROIC = 5 }; enum CalendarRepeatType diff --git a/src/server/game/Handlers/CalendarHandler.cpp b/src/server/game/Handlers/CalendarHandler.cpp index 3301b821f2b..12873d2d4a4 100755 --- a/src/server/game/Handlers/CalendarHandler.cpp +++ b/src/server/game/Handlers/CalendarHandler.cpp @@ -90,6 +90,10 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recvData*/) data.AppendPackedTime(calendarEvent->GetEventTime()); data << uint32(calendarEvent->GetFlags()); data << int32(calendarEvent->GetDungeonId()); + + Guild* guild = sGuildMgr->GetGuildById(calendarEvent->GetGuildId()); + data << uint64(guild ? guild->GetGUID() : 0); + data.appendPackGUID(calendarEvent->GetCreatorGUID()); } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 0ecb6529ea8..e36fc9736fa 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -116,22 +116,22 @@ void OpcodeTable::Initialize() DEFINE_OPCODE_HANDLER(CMSG_BUYBACK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuybackItem ); DEFINE_OPCODE_HANDLER(CMSG_BUY_BANK_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyBankSlotOpcode ); DEFINE_OPCODE_HANDLER(CMSG_BUY_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyItemOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_ADD_EVENT, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarAddEvent ); - DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_ARENA_TEAM, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarArenaTeam ); + DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_ADD_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarAddEvent ); + DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_ARENA_TEAM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarArenaTeam ); DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_COMPLAIN, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarComplain ); - DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_COPY_EVENT, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarCopyEvent ); - DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_INVITE, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventInvite ); - DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_MODERATOR_STATUS, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventModeratorStatus); - DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_REMOVE_INVITE, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventRemoveInvite ); - DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_RSVP, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventRsvp ); - DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_SIGNUP, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_STATUS, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventStatus ); - DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_GET_CALENDAR, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGetCalendar ); - DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_GET_EVENT, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGetEvent ); + DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_COPY_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarCopyEvent ); + DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventInvite ); + DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_MODERATOR_STATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventModeratorStatus); + DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_REMOVE_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventRemoveInvite ); + DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_RSVP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventRsvp ); + DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_SIGNUP, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventSignup ); + DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_STATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventStatus ); + DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_GET_CALENDAR, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGetCalendar ); + DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_GET_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGetEvent ); DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_GET_NUM_PENDING, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGetNumPending ); - DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_GUILD_FILTER, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGuildFilter ); - DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_REMOVE_EVENT, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarRemoveEvent ); - DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_UPDATE_EVENT, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarUpdateEvent ); + DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_GUILD_FILTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarGuildFilter ); + DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_REMOVE_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarRemoveEvent ); + DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_UPDATE_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarUpdateEvent ); DEFINE_OPCODE_HANDLER(CMSG_CANCEL_AURA, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelAuraOpcode ); DEFINE_OPCODE_HANDLER(CMSG_CANCEL_AUTO_REPEAT_SPELL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCancelAutoRepeatSpellOpcode); DEFINE_OPCODE_HANDLER(CMSG_CANCEL_CAST, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleCancelCastOpcode ); @@ -688,26 +688,26 @@ void OpcodeTable::Initialize() DEFINE_OPCODE_HANDLER(SMSG_BREAK_TARGET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_BUY_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_BUY_ITEM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_ARENA_TEAM, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_CLEAR_PENDING_ACTION, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_COMMAND_RESULT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_ALERT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_ARENA_TEAM, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_CLEAR_PENDING_ACTION, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_NOTES, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_NOTES_ALERT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_REMOVED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_REMOVED_ALERT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_REMOVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_REMOVED_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_INVITE_STATUS_ALERT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_MODERATOR_STATUS_ALERT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_REMOVED_ALERT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_STATUS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_UPDATED_ALERT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_FILTER_GUILD, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_RAID_LOCKOUT_ADDED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_RAID_LOCKOUT_REMOVED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_MODERATOR_STATUS_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_REMOVED_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_EVENT_UPDATED_ALERT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_FILTER_GUILD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_RAID_LOCKOUT_ADDED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_RAID_LOCKOUT_REMOVED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_RAID_LOCKOUT_UPDATED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_SEND_CALENDAR, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_SEND_EVENT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_SEND_CALENDAR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_SEND_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CALENDAR_SEND_NUM_PENDING, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CAMERA_SHAKE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_CANCEL_AUTO_REPEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From f205bc9b4fabc2e2a21fa7975e2b15737969147f Mon Sep 17 00:00:00 2001 From: cyberbrest Date: Wed, 21 Nov 2012 18:25:23 +0100 Subject: Core/Currency: Add support of Conquest points cap for arena and bg Remove obselete code for arena points distribution Thanks to @Zakamurite --- .../2012_11_21_00_characters_worldstates_434.sql | 1 + sql/updates/world/2012_11_21_00_world_command.sql | 1 + .../world/2012_11_21_01_world_trinity_string.sql | 1 + src/server/game/Battlegrounds/ArenaTeam.cpp | 56 ------ src/server/game/Battlegrounds/ArenaTeam.h | 3 - src/server/game/Battlegrounds/ArenaTeamMgr.cpp | 58 ------ src/server/game/Battlegrounds/ArenaTeamMgr.h | 2 - src/server/game/Battlegrounds/Battleground.cpp | 9 +- src/server/game/Battlegrounds/Battleground.h | 13 +- src/server/game/Battlegrounds/BattlegroundMgr.cpp | 36 +--- src/server/game/Battlegrounds/BattlegroundMgr.h | 6 +- src/server/game/DataStores/DBCEnums.h | 10 +- src/server/game/DataStores/DBCStructure.h | 4 +- src/server/game/DataStores/DBCfmt.h | 2 +- src/server/game/Entities/Item/ItemPrototype.h | 7 + src/server/game/Entities/Player/Player.cpp | 212 ++++++++++++++++----- src/server/game/Entities/Player/Player.h | 26 ++- src/server/game/Handlers/BattleGroundHandler.cpp | 75 ++++++++ src/server/game/Miscellaneous/Formulas.h | 20 ++ src/server/game/Miscellaneous/Language.h | 12 +- src/server/game/Server/Protocol/Opcodes.cpp | 16 +- src/server/game/Server/WorldSession.h | 4 + src/server/game/World/World.cpp | 146 +++++++++----- src/server/game/World/World.h | 23 ++- src/server/scripts/Commands/cs_misc.cpp | 7 - src/server/scripts/Commands/cs_modify.cpp | 4 +- src/server/worldserver/worldserver.conf.dist | 104 ++++++---- 27 files changed, 516 insertions(+), 342 deletions(-) create mode 100644 sql/updates/characters/2012_11_21_00_characters_worldstates_434.sql create mode 100644 sql/updates/world/2012_11_21_00_world_command.sql create mode 100644 sql/updates/world/2012_11_21_01_world_trinity_string.sql (limited to 'src') diff --git a/sql/updates/characters/2012_11_21_00_characters_worldstates_434.sql b/sql/updates/characters/2012_11_21_00_characters_worldstates_434.sql new file mode 100644 index 00000000000..14e9ffb6834 --- /dev/null +++ b/sql/updates/characters/2012_11_21_00_characters_worldstates_434.sql @@ -0,0 +1 @@ +UPDATE `worldstates` SET `comment` = 'NextCurrencyDistributionTime' WHERE `entry` =20001; diff --git a/sql/updates/world/2012_11_21_00_world_command.sql b/sql/updates/world/2012_11_21_00_world_command.sql new file mode 100644 index 00000000000..74a472aa526 --- /dev/null +++ b/sql/updates/world/2012_11_21_00_world_command.sql @@ -0,0 +1 @@ +DELETE FROM `command` WHERE `name`='flusharenapoints'; diff --git a/sql/updates/world/2012_11_21_01_world_trinity_string.sql b/sql/updates/world/2012_11_21_01_world_trinity_string.sql new file mode 100644 index 00000000000..6c70d8cb28b --- /dev/null +++ b/sql/updates/world/2012_11_21_01_world_trinity_string.sql @@ -0,0 +1 @@ +DELETE FROM `trinity_string` WHERE `entry` IN ('741','742','743','744','745','746'); diff --git a/src/server/game/Battlegrounds/ArenaTeam.cpp b/src/server/game/Battlegrounds/ArenaTeam.cpp index 7889d5caf65..a7ec2cde2b8 100755 --- a/src/server/game/Battlegrounds/ArenaTeam.cpp +++ b/src/server/game/Battlegrounds/ArenaTeam.cpp @@ -567,32 +567,6 @@ bool ArenaTeam::IsMember(uint64 guid) const return false; } -uint32 ArenaTeam::GetPoints(uint32 memberRating) -{ - // Returns how many points would be awarded with this team type with this rating - float points; - - uint32 rating = memberRating + 150 < Stats.Rating ? memberRating : Stats.Rating; - - if (rating <= 1500) - { - if (sWorld->getIntConfig(CONFIG_ARENA_SEASON_ID) < 6) - points = (float)rating * 0.22f + 14.0f; - else - points = 344; - } - else - points = 1511.26f / (1.0f + 1639.28f * exp(-0.00412f * (float)rating)); - - // Type penalties for teams < 5v5 - if (Type == ARENA_TEAM_2v2) - points *= 0.76f; - else if (Type == ARENA_TEAM_3v3) - points *= 0.88f; - - return (uint32) points; -} - uint32 ArenaTeam::GetAverageMMR(Group* group) const { if (!group) @@ -820,36 +794,6 @@ void ArenaTeam::MemberWon(Player* player, uint32 againstMatchmakerRating, int32 } } -void ArenaTeam::UpdateArenaPointsHelper(std::map& playerPoints) -{ - // Called after a match has ended and the stats are already modified - // Helper function for arena point distribution (this way, when distributing, no actual calculation is required, just a few comparisons) - // 10 played games per week is a minimum - if (Stats.WeekGames < 10) - return; - - // To get points, a player has to participate in at least 30% of the matches - uint32 requiredGames = (uint32)ceil(Stats.WeekGames * 0.3f); - - for (MemberList::const_iterator itr = Members.begin(); itr != Members.end(); ++itr) - { - // The player participated in enough games, update his points - uint32 pointsToAdd = 0; - if (itr->WeekGames >= requiredGames) - pointsToAdd = GetPoints(itr->PersonalRating); - - std::map::iterator plr_itr = playerPoints.find(GUID_LOPART(itr->Guid)); - if (plr_itr != playerPoints.end()) - { - // Check if there is already more points - if (plr_itr->second < pointsToAdd) - playerPoints[GUID_LOPART(itr->Guid)] = pointsToAdd; - } - else - playerPoints[GUID_LOPART(itr->Guid)] = pointsToAdd; - } -} - void ArenaTeam::SaveToDB() { // Save team and member stats to db diff --git a/src/server/game/Battlegrounds/ArenaTeam.h b/src/server/game/Battlegrounds/ArenaTeam.h index 405b82c6f4d..58d67cf9daa 100755 --- a/src/server/game/Battlegrounds/ArenaTeam.h +++ b/src/server/game/Battlegrounds/ArenaTeam.h @@ -172,7 +172,6 @@ class ArenaTeam void SendStats(WorldSession* session); void Inspect(WorldSession* session, uint64 guid); - uint32 GetPoints(uint32 MemberRating); int32 GetMatchmakerRatingMod(uint32 ownRating, uint32 opponentRating, bool won); int32 GetRatingMod(uint32 ownRating, uint32 opponentRating, bool won); float GetChanceAgainst(uint32 ownRating, uint32 opponentRating); @@ -182,8 +181,6 @@ class ArenaTeam void MemberLost(Player* player, uint32 againstMatchmakerRating, int32 MatchmakerRatingChange = -12); void OfflineMemberLost(uint64 guid, uint32 againstMatchmakerRating, int32 MatchmakerRatingChange = -12); - void UpdateArenaPointsHelper(std::map & PlayerPoints); - void FinishWeek(); void FinishGame(int32 mod); diff --git a/src/server/game/Battlegrounds/ArenaTeamMgr.cpp b/src/server/game/Battlegrounds/ArenaTeamMgr.cpp index 8b2a056f4bb..78840a8dde4 100644 --- a/src/server/game/Battlegrounds/ArenaTeamMgr.cpp +++ b/src/server/game/Battlegrounds/ArenaTeamMgr.cpp @@ -134,61 +134,3 @@ void ArenaTeamMgr::LoadArenaTeams() sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u arena teams in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } - -void ArenaTeamMgr::DistributeArenaPoints() -{ - // Used to distribute arena points based on last week's stats - sWorld->SendWorldText(LANG_DIST_ARENA_POINTS_START); - - sWorld->SendWorldText(LANG_DIST_ARENA_POINTS_ONLINE_START); - - // Temporary structure for storing maximum points to add values for all players - std::map PlayerPoints; - - // At first update all points for all team members - for (ArenaTeamContainer::iterator teamItr = GetArenaTeamMapBegin(); teamItr != GetArenaTeamMapEnd(); ++teamItr) - if (ArenaTeam* at = teamItr->second) - at->UpdateArenaPointsHelper(PlayerPoints); - - /* - SQLTransaction trans = CharacterDatabase.BeginTransaction(); - - // Cycle that gives points to all players - PreparedStatement* stmt; - - for (std::map::iterator playerItr = PlayerPoints.begin(); playerItr != PlayerPoints.end(); ++playerItr) - { - // Add points to player if online - if (Player* player = HashMapHolder::Find(playerItr->first)) - player->ModifyConquestPoints(playerItr->second, &trans); - else // Update database - { - stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_ARENA_POINTS); - stmt->setUInt32(0, playerItr->second); - stmt->setUInt32(1, playerItr->first); - trans->Append(stmt); - } - } - - CharacterDatabase.CommitTransaction(trans); - */ - - PlayerPoints.clear(); - - sWorld->SendWorldText(LANG_DIST_ARENA_POINTS_ONLINE_END); - - sWorld->SendWorldText(LANG_DIST_ARENA_POINTS_TEAM_START); - for (ArenaTeamContainer::iterator titr = GetArenaTeamMapBegin(); titr != GetArenaTeamMapEnd(); ++titr) - { - if (ArenaTeam* at = titr->second) - { - at->FinishWeek(); - at->SaveToDB(); - at->NotifyStatsChanged(); - } - } - - sWorld->SendWorldText(LANG_DIST_ARENA_POINTS_TEAM_END); - - sWorld->SendWorldText(LANG_DIST_ARENA_POINTS_END); -} diff --git a/src/server/game/Battlegrounds/ArenaTeamMgr.h b/src/server/game/Battlegrounds/ArenaTeamMgr.h index bf06418145d..9e06e84d1e6 100644 --- a/src/server/game/Battlegrounds/ArenaTeamMgr.h +++ b/src/server/game/Battlegrounds/ArenaTeamMgr.h @@ -40,8 +40,6 @@ public: ArenaTeamContainer::iterator GetArenaTeamMapBegin() { return ArenaTeamStore.begin(); } ArenaTeamContainer::iterator GetArenaTeamMapEnd() { return ArenaTeamStore.end(); } - void DistributeArenaPoints(); - uint32 GenerateArenaTeamId(); void SetNextArenaTeamId(uint32 Id) { NextArenaTeamId = Id; } diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index d1165456abb..393ca57e22c 100755 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -907,6 +907,7 @@ void Battleground::EndBattleground(uint32 winner) uint32 rating = player->GetArenaPersonalRating(winnerArenaTeam->GetSlot()); player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA, rating ? rating : 1); player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_ARENA, GetMapId()); + player->ModifyCurrency(CURRENCY_TYPE_CONQUEST_META_ARENA, sWorld->getIntConfig(CONFIG_CURRENCY_CONQUEST_POINTS_ARENA_REWARD)); winnerArenaTeam->MemberWon(player, loserMatchmakerRating, winnerMatchmakerChange); } @@ -932,11 +933,15 @@ void Battleground::EndBattleground(uint32 winner) if (IsRandom() || BattlegroundMgr::IsBGWeekend(GetTypeID())) { UpdatePlayerScore(player, SCORE_BONUS_HONOR, GetBonusHonorFromKill(winner_kills)); - /*if (CanAwardArenaPoints()) - player->ModifyConquestPoints(player->GetRandomWinner() ? BG_REWARD_WINNER_ARENA_LAST : BG_REWARD_WINNER_ARENA_FIRST);*/ if (!player->GetRandomWinner()) + { + // 100cp awarded for the first rated battleground won each day + player->ModifyCurrency(CURRENCY_TYPE_CONQUEST_META_BG, BG_REWARD_WINNER_CONQUEST_FIRST); player->SetRandomWinner(true); + } } + else // 50cp awarded for each non-rated battleground won + player->ModifyCurrency(CURRENCY_TYPE_CONQUEST_META_BG, BG_REWARD_WINNER_CONQUEST_LAST ); player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_BG, 1); if (!guildAwarded) diff --git a/src/server/game/Battlegrounds/Battleground.h b/src/server/game/Battlegrounds/Battleground.h index 7c0ca616214..90b7e5167a6 100755 --- a/src/server/game/Battlegrounds/Battleground.h +++ b/src/server/game/Battlegrounds/Battleground.h @@ -134,14 +134,15 @@ enum BattlegroundBuffObjects BG_OBJECTID_BERSERKERBUFF_ENTRY = 179905 }; +/// Battleground currency rewards. Should be with precision mod. enum BattlegroundRandomRewards { - BG_REWARD_WINNER_HONOR_FIRST = 270, - BG_REWARD_WINNER_CONQUEST_FIRST = 100, - BG_REWARD_WINNER_HONOR_LAST = 135, - BG_REWARD_WINNER_CONQUEST_LAST = 50, - BG_REWARD_LOSER_HONOR_FIRST = 45, - BG_REWARD_LOSER_HONOR_LAST = 35 + BG_REWARD_WINNER_HONOR_FIRST = 27000, + BG_REWARD_WINNER_CONQUEST_FIRST = 10000, + BG_REWARD_WINNER_HONOR_LAST = 13500, + BG_REWARD_WINNER_CONQUEST_LAST = 5000, + BG_REWARD_LOSER_HONOR_FIRST = 4500, + BG_REWARD_LOSER_HONOR_LAST = 3500 }; const uint32 Buff_Entries[3] = { BG_OBJECTID_SPEEDBUFF_ENTRY, BG_OBJECTID_REGENBUFF_ENTRY, BG_OBJECTID_BERSERKERBUFF_ENTRY }; diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index 13aed749a49..271cbee850e 100755 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -54,7 +54,7 @@ BattlegroundMgr::BattlegroundMgr() : m_NextRatedArenaUpdate(sWorld->getIntConfig(CONFIG_ARENA_RATED_UPDATE_TIMER)), - m_AutoDistributionTimeChecker(0), m_ArenaTesting(false), m_Testing(false) + m_ArenaTesting(false), m_Testing(false) { } BattlegroundMgr::~BattlegroundMgr() @@ -146,22 +146,6 @@ void BattlegroundMgr::Update(uint32 diff) else m_NextRatedArenaUpdate -= diff; } - - if (sWorld->getBoolConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS)) - { - if (m_AutoDistributionTimeChecker < diff) - { - if (time(NULL) > m_NextAutoDistributionTime) - { - sArenaTeamMgr->DistributeArenaPoints(); - m_NextAutoDistributionTime = m_NextAutoDistributionTime + BATTLEGROUND_ARENA_POINT_DISTRIBUTION_DAY * sWorld->getIntConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS); - sWorld->setWorldState(WS_ARENA_DISTRIBUTION_TIME, uint64(m_NextAutoDistributionTime)); - } - m_AutoDistributionTimeChecker = 600000; // check 10 minutes - } - else - m_AutoDistributionTimeChecker -= diff; - } } void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battleground *bg, Player * player, uint8 QueueSlot, uint8 StatusID, uint32 Time1, uint32 Time2, uint8 arenatype) @@ -1110,24 +1094,6 @@ void BattlegroundMgr::CreateInitialBattlegrounds() sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u battlegrounds in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } -void BattlegroundMgr::InitAutomaticArenaPointDistribution() -{ - if (!sWorld->getBoolConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS)) - return; - - time_t wstime = time_t(sWorld->getWorldState(WS_ARENA_DISTRIBUTION_TIME)); - time_t curtime = time(NULL); - sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Initializing Automatic Arena Point Distribution"); - if (wstime < curtime) - { - m_NextAutoDistributionTime = curtime; // reset will be called in the next update - sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: Next arena point distribution time in the past, reseting it now."); - } - else - m_NextAutoDistributionTime = wstime; - sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Automatic Arena Point Distribution initialized."); -} - void BattlegroundMgr::BuildBattlegroundListPacket(WorldPacket* data, uint64 guid, Player* player, BattlegroundTypeId bgTypeId) { if (!player) diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.h b/src/server/game/Battlegrounds/BattlegroundMgr.h index da7839ff1b0..3512e1c2891 100755 --- a/src/server/game/Battlegrounds/BattlegroundMgr.h +++ b/src/server/game/Battlegrounds/BattlegroundMgr.h @@ -30,8 +30,7 @@ typedef std::set BattlegroundClientIdsContainer; typedef UNORDERED_MAP BattleMastersMap; -#define BATTLEGROUND_ARENA_POINT_DISTRIBUTION_DAY 86400 // seconds in a day -#define WS_ARENA_DISTRIBUTION_TIME 20001 // Custom worldstate +#define WS_CURRENCY_RESET_TIME 20001 // Custom worldstate struct CreateBattlegroundData { @@ -124,7 +123,6 @@ class BattlegroundMgr uint32 GetMaxRatingDifference() const; uint32 GetRatingDiscardTimer() const; - void InitAutomaticArenaPointDistribution(); void LoadBattleMastersEntry(); BattlegroundTypeId GetBattleMasterBG(uint32 entry) const { @@ -150,8 +148,6 @@ class BattlegroundMgr BattlegroundSelectionWeightMap m_BGSelectionWeights; std::vector m_QueueUpdateScheduler; uint32 m_NextRatedArenaUpdate; - time_t m_NextAutoDistributionTime; - uint32 m_AutoDistributionTimeChecker; bool m_ArenaTesting; bool m_Testing; BattleMastersMap mBattleMastersMap; diff --git a/src/server/game/DataStores/DBCEnums.h b/src/server/game/DataStores/DBCEnums.h index 853202df8d0..dc91a0642c4 100755 --- a/src/server/game/DataStores/DBCEnums.h +++ b/src/server/game/DataStores/DBCEnums.h @@ -525,10 +525,12 @@ enum VehicleSeatFlagsB // CurrencyTypes.dbc enum CurrencyTypes { - CURRENCY_TYPE_CONQUEST_POINTS = 390, - CURRENCY_TYPE_HONOR_POINTS = 392, - CURRENCY_TYPE_JUSTICE_POINTS = 395, - CURRENCY_TYPE_VALOR_POINTS = 396 + CURRENCY_TYPE_CONQUEST_POINTS = 390, + CURRENCY_TYPE_HONOR_POINTS = 392, + CURRENCY_TYPE_JUSTICE_POINTS = 395, + CURRENCY_TYPE_VALOR_POINTS = 396, + CURRENCY_TYPE_CONQUEST_META_ARENA = 483, + CURRENCY_TYPE_CONQUEST_META_BG = 484, }; #endif diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 87e77ad491e..ee6cd5d951f 100644 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -848,8 +848,8 @@ struct CurrencyCategoryEntry struct CurrencyTypesEntry { - uint32 ID; // 0 not used - //uint32 Category; // 1 may be category + uint32 ID; // 0 not used + uint32 Category; // 1 may be category //char* name; // 2 //char* iconName; // 3 //uint32 unk4; // 4 all 0 diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index c1430c7bef0..9e593f66244 100644 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -49,7 +49,7 @@ char const CreatureModelDatafmt[]="nxxxxxxxxxxxxxffxxxxxxxxxxxxxxx"; char const CreatureFamilyfmt[]="nfifiiiiixsx"; char const CreatureSpellDatafmt[]="niiiixxxx"; char const CreatureTypefmt[]="nxx"; -char const CurrencyTypesfmt[]="nxxxxxiiiix"; +char const CurrencyTypesfmt[]="nixxxxiiiix"; char const DestructibleModelDatafmt[]="ixxixxxixxxixxxixxxxxxxx"; char const DungeonEncounterfmt[]="iiixisxx"; diff --git a/src/server/game/Entities/Item/ItemPrototype.h b/src/server/game/Entities/Item/ItemPrototype.h index cf818b740b4..e8795347d0e 100755 --- a/src/server/game/Entities/Item/ItemPrototype.h +++ b/src/server/game/Entities/Item/ItemPrototype.h @@ -219,6 +219,13 @@ enum CurrencyFlags CURRENCY_FLAG_COUNT_SEASON_TOTAL = 0x80, }; +enum CurrencyCategory +{ + // ... + CURRENCY_CATEGORY_META_CONQUEST = 89, + // ... +}; + enum ItemVendorType { ITEM_VENDOR_TYPE_ITEM = 1, diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 0e0bbb95daa..fdf9c2c7a90 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -858,6 +858,8 @@ Player::Player(WorldSession* session): Unit(true), phaseMgr(this) SetPendingBind(0, 0); _activeCheats = CHEAT_NONE; + _maxPersonalArenaRate = 0; + _ConquestCurrencyTotalWeekCap = 0; memset(_voidStorageItems, 0, VOID_STORAGE_MAX_SLOT * sizeof(VoidStorageItem*)); memset(_CUFProfiles, 0, MAX_CUF_PROFILES * sizeof(CUFProfile*)); @@ -1022,9 +1024,9 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo) InitRunes(); SetUInt32Value(PLAYER_FIELD_COINAGE, sWorld->getIntConfig(CONFIG_START_PLAYER_MONEY)); - SetCurrency(CURRENCY_TYPE_HONOR_POINTS, sWorld->getIntConfig(CONFIG_START_HONOR_POINTS)); - SetCurrency(CURRENCY_TYPE_JUSTICE_POINTS, sWorld->getIntConfig(CONFIG_START_JUSTICE_POINTS)); - SetCurrency(CURRENCY_TYPE_CONQUEST_POINTS, sWorld->getIntConfig(CONFIG_START_ARENA_POINTS)); + SetCurrency(CURRENCY_TYPE_HONOR_POINTS, sWorld->getIntConfig(CONFIG_CURRENCY_START_HONOR_POINTS)); + SetCurrency(CURRENCY_TYPE_JUSTICE_POINTS, sWorld->getIntConfig(CONFIG_CURRENCY_START_JUSTICE_POINTS)); + SetCurrency(CURRENCY_TYPE_CONQUEST_POINTS, sWorld->getIntConfig(CONFIG_CURRENCY_START_CONQUEST_POINTS)); // start with every map explored if (sWorld->getBoolConfig(CONFIG_START_ALL_EXPLORED)) @@ -7255,6 +7257,14 @@ void Player::_LoadCurrency(PreparedQueryResult result) _currencyStorage.insert(PlayerCurrenciesMap::value_type(currencyID, cur)); + // load total conquest cap. should be after insert. + if (currency->Category == CURRENCY_CATEGORY_META_CONQUEST) + { + uint32 cap = _GetCurrencyWeekCap(currency); + if (cap > _ConquestCurrencyTotalWeekCap) + _ConquestCurrencyTotalWeekCap = cap; + } + } while (result->NextRow()); } @@ -7336,12 +7346,16 @@ void Player::SendCurrencies() const { ByteBuffer currencyData; WorldPacket packet(SMSG_INIT_CURRENCY, 4 + _currencyStorage.size()*(5*4 + 1)); + size_t count_pos = packet.bitwpos(); packet.WriteBits(_currencyStorage.size(), 23); + size_t count = 0; for (PlayerCurrenciesMap::const_iterator itr = _currencyStorage.begin(); itr != _currencyStorage.end(); ++itr) { CurrencyTypesEntry const* entry = sCurrencyTypesStore.LookupEntry(itr->first); - if (!entry) // should never happen + + // not send init meta currencies. + if (!entry || entry->Category == CURRENCY_CATEGORY_META_CONQUEST) continue; uint32 precision = (entry->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? CURRENCY_PRECISION : 1; @@ -7363,17 +7377,59 @@ void Player::SendCurrencies() const currencyData << uint32(entry->ID); if (weekCount) currencyData << uint32(weekCount); + + ++count; } packet.FlushBits(); packet.append(currencyData); + packet.PutBits(count_pos, count, 23); + GetSession()->SendPacket(&packet); +} + +void Player::SendPvpRewards() const +{ + WorldPacket packet(SMSG_REQUEST_PVP_REWARDS_RESPONSE, 24); + packet << GetCurrencyWeekCap(CURRENCY_TYPE_CONQUEST_POINTS, true); + packet << GetCurrencyOnWeek(CURRENCY_TYPE_CONQUEST_POINTS, true); + packet << GetCurrencyWeekCap(CURRENCY_TYPE_CONQUEST_META_ARENA, true); + packet << GetCurrencyOnWeek(CURRENCY_TYPE_CONQUEST_META_ARENA, true); + packet << GetCurrencyOnWeek(CURRENCY_TYPE_CONQUEST_META_BG, true); + packet << GetCurrencyWeekCap(CURRENCY_TYPE_CONQUEST_POINTS, true); + packet << GetCurrencyWeekCap(CURRENCY_TYPE_CONQUEST_META_BG, true); GetSession()->SendPacket(&packet); } -uint32 Player::GetCurrency(uint32 id) const +uint32 Player::GetCurrency(uint32 id, bool precision) const { PlayerCurrenciesMap::const_iterator itr = _currencyStorage.find(id); - return itr != _currencyStorage.end() ? itr->second.totalCount : 0; + if (itr == _currencyStorage.end()) + return 0; + + if (!precision) + return itr->second.totalCount; + + CurrencyTypesEntry const* currency = sCurrencyTypesStore.LookupEntry(id); + ASSERT(currency); + + int32 mod = currency->Flags & CURRENCY_FLAG_HIGH_PRECISION ? 100 : 1; + return itr->second.totalCount / mod; +} + +uint32 Player::GetCurrencyOnWeek(uint32 id, bool precision) const +{ + PlayerCurrenciesMap::const_iterator itr = _currencyStorage.find(id); + if (itr == _currencyStorage.end()) + return 0; + + if (!precision) + return itr->second.weekCount; + + CurrencyTypesEntry const* currency = sCurrencyTypesStore.LookupEntry(id); + ASSERT(currency); + + int32 mod = currency->Flags & CURRENCY_FLAG_HIGH_PRECISION ? 100 : 1; + return itr->second.weekCount / mod; } bool Player::HasCurrency(uint32 id, uint32 count) const @@ -7412,9 +7468,9 @@ void Player::ModifyCurrency(uint32 id, int32 count, bool printLog/* = true*/, bo oldWeekCount = itr->second.weekCount; } - // count can't be more then weekCap. + // count can't be more then weekCap if used (weekCap > 0) uint32 weekCap = _GetCurrencyWeekCap(currency); - if (count > int32(weekCap)) + if (weekCap && count > int32(weekCap)) count = weekCap; int32 newTotalCount = int32(oldTotalCount) + count; @@ -7427,7 +7483,6 @@ void Player::ModifyCurrency(uint32 id, int32 count, bool printLog/* = true*/, bo ASSERT(weekCap >= oldWeekCount); - // TODO: fix conquest points // if we get more then weekCap just set to limit if (weekCap && int32(weekCap) < newWeekCount) { @@ -7457,6 +7512,16 @@ void Player::ModifyCurrency(uint32 id, int32 count, bool printLog/* = true*/, bo if (count > 0) UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CURRENCY, id, count); + if (currency->Category == CURRENCY_CATEGORY_META_CONQUEST) + { + //original conquest cap is highest of bg/arena conquest cap. + if(weekCap > _ConquestCurrencyTotalWeekCap) + _ConquestCurrencyTotalWeekCap = weekCap; + // count was changed to week limit, now we can modify original points. + ModifyCurrency(CURRENCY_TYPE_CONQUEST_POINTS, count, printLog ); + return; + } + // on new case just set init. if(itr->second.state == PLAYERCURRENCY_NEW) { @@ -7484,45 +7549,94 @@ void Player::ModifyCurrency(uint32 id, int32 count, bool printLog/* = true*/, bo void Player::SetCurrency(uint32 id, uint32 count, bool printLog /*= true*/) { - ModifyCurrency(id, int32(count) - GetCurrency(id), printLog); + PlayerCurrenciesMap::iterator itr = _currencyStorage.find(id); + if (itr == _currencyStorage.end()) + { + PlayerCurrency cur; + cur.state = PLAYERCURRENCY_NEW; + cur.totalCount = count; + cur.weekCount = 0; + _currencyStorage[id] = cur; + } +} + +uint32 Player::GetCurrencyWeekCap(uint32 id, bool usePrecision) const +{ + CurrencyTypesEntry const* entry = sCurrencyTypesStore.LookupEntry(id); + if (!entry) + return 0; + + uint32 cap = _GetCurrencyWeekCap(entry); + if(usePrecision && entry->Flags & CURRENCY_FLAG_HIGH_PRECISION) + cap /= 100; + + return cap; } -uint32 Player::_GetCurrencyWeekCap(const CurrencyTypesEntry* currency) const +void Player::ResetCurrencyWeekCap() { - uint32 cap = currency->WeekCap; - switch (currency->ID) - { - case CURRENCY_TYPE_CONQUEST_POINTS: - { - // TODO: implement - cap = 0; - break; - } - case CURRENCY_TYPE_HONOR_POINTS: - { - uint32 honorcap = sWorld->getIntConfig(CONFIG_MAX_HONOR_POINTS); - if (honorcap > 0) - cap = honorcap; - break; - } - case CURRENCY_TYPE_JUSTICE_POINTS: - { - uint32 justicecap = sWorld->getIntConfig(CONFIG_MAX_JUSTICE_POINTS); - if (justicecap > 0) - cap = justicecap; - break; - } - } + for (uint32 arenaSlot = 0; arenaSlot < MAX_ARENA_SLOT; arenaSlot++) + { + if (uint32 arenaTeamId = GetArenaTeamId(arenaSlot)) + { + ArenaTeam* arenaTeam = sArenaTeamMgr->GetArenaTeamById(arenaTeamId); + arenaTeam->FinishWeek(); // set played this week etc values to 0 in memory, too + arenaTeam->SaveToDB(); // save changes + arenaTeam->NotifyStatsChanged(); // notify the players of the changes + } + } + + for (PlayerCurrenciesMap::iterator itr = _currencyStorage.begin(); itr != _currencyStorage.end(); ++itr) + { + itr->second.weekCount = 0; + itr->second.state = PLAYERCURRENCY_CHANGED; + } + + WorldPacket data(SMSG_WEEKLY_RESET_CURRENCY, 0); + SendDirectMessage(&data); +} - if (cap != currency->WeekCap && IsInWorld() && !GetSession()->PlayerLoading()) - { - WorldPacket packet(SMSG_UPDATE_CURRENCY_WEEK_LIMIT, 8); - packet << uint32(cap / ((currency->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? CURRENCY_PRECISION : 1)); - packet << uint32(currency->ID); - GetSession()->SendPacket(&packet); - } +uint32 Player::_GetCurrencyWeekCap(const CurrencyTypesEntry* currency) const +{ + uint32 cap = currency->WeekCap; + + switch (currency->ID) + { + //original conquest not have week cap + case CURRENCY_TYPE_CONQUEST_POINTS: + return _ConquestCurrencyTotalWeekCap; + case CURRENCY_TYPE_CONQUEST_META_ARENA: + // should add precision mod = 100 + return Trinity::Currency::ConquestRatingCalculator(_maxPersonalArenaRate) * 100; + case CURRENCY_TYPE_CONQUEST_META_BG: + // should add precision mod = 100 + return Trinity::Currency::BgConquestRatingCalculator(GetRBGPersonalRating()) * 100; + case CURRENCY_TYPE_HONOR_POINTS: + { + uint32 honorcap = sWorld->getIntConfig(CONFIG_CURRENCY_MAX_HONOR_POINTS); + if (honorcap > 0) + cap = honorcap; + break; + } + case CURRENCY_TYPE_JUSTICE_POINTS: + { + uint32 justicecap = sWorld->getIntConfig(CONFIG_CURRENCY_MAX_JUSTICE_POINTS); + if (justicecap > 0) + cap = justicecap; + break; + } + } + + if (cap != currency->WeekCap && IsInWorld() && !GetSession()->PlayerLoading()) + { + WorldPacket packet(SMSG_UPDATE_CURRENCY_WEEK_LIMIT, 8); + packet << uint32(cap / ((currency->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? 100 : 1)); + packet << uint32(currency->ID); + GetSession()->SendPacket(&packet); + } + + return cap; - return cap; } void Player::SetInGuild(uint32 guildId) @@ -7556,6 +7670,13 @@ uint8 Player::GetRankFromDB(uint64 guid) return 0; } +void Player::SetArenaTeamInfoField(uint8 slot, ArenaTeamInfoType type, uint32 value) +{ + SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (slot * ARENA_TEAM_END) + type, value); + if (type == ARENA_TEAM_PERSONAL_RATING && value > _maxPersonalArenaRate) + _maxPersonalArenaRate = value; +} + uint32 Player::GetArenaTeamIdFromDB(uint64 guid, uint8 type) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ARENA_TEAM_ID_BY_PLAYER_GUID); @@ -20720,6 +20841,11 @@ void Player::LeaveAllArenaTeams(uint64 guid) while (result->NextRow()); } +uint32 Player::GetRBGPersonalRating() const +{ + return 0; +} + void Player::SetRestBonus (float rest_bonus_new) { // Prevent resting on max level diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 0056230f6ce..56983dfeee9 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1454,12 +1454,19 @@ class Player : public Unit, public GridObject void SendNewCurrency(uint32 id) const; /// send full data about all currencies to client void SendCurrencies() const; + /// send conquest currency points and their cap week/arena + void SendPvpRewards() const; /// return count of currency witch has plr - uint32 GetCurrency(uint32 id) const; + uint32 GetCurrency(uint32 id, bool precision) const; + /// return count of currency gaind on current week + uint32 GetCurrencyOnWeek(uint32 id, bool precision) const; + /// return week cap by currency id + uint32 GetCurrencyWeekCap(uint32 id, bool usePrecision) const; /// return presence related currency bool HasCurrency(uint32 id, uint32 count) const; - /// @todo: not understand why it subtract from total count and for what it used. It should be remove and replaced by ModifyCurrency + /// initialize currency count for custom initialization at create character void SetCurrency(uint32 id, uint32 count, bool printLog = true); + void ResetCurrencyWeekCap(); /** * @name ModifyCurrency @@ -2045,16 +2052,14 @@ class Player : public Unit, public GridObject SetArenaTeamInfoField(slot, ARENA_TEAM_ID, ArenaTeamId); SetArenaTeamInfoField(slot, ARENA_TEAM_TYPE, type); } - void SetArenaTeamInfoField(uint8 slot, ArenaTeamInfoType type, uint32 value) - { - SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (slot * ARENA_TEAM_END) + type, value); - } + void SetArenaTeamInfoField(uint8 slot, ArenaTeamInfoType type, uint32 value); static uint32 GetArenaTeamIdFromDB(uint64 guid, uint8 slot); static void LeaveAllArenaTeams(uint64 guid); uint32 GetArenaTeamId(uint8 slot) const { return GetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (slot * ARENA_TEAM_END) + ARENA_TEAM_ID); } uint32 GetArenaPersonalRating(uint8 slot) const { return GetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (slot * ARENA_TEAM_END) + ARENA_TEAM_PERSONAL_RATING); } void SetArenaTeamIdInvited(uint32 ArenaTeamId) { m_ArenaTeamIdInvited = ArenaTeamId; } uint32 GetArenaTeamIdInvited() { return m_ArenaTeamIdInvited; } + uint32 GetRBGPersonalRating() const; Difficulty GetDifficulty(bool isRaid) const { return isRaid ? m_raidDifficulty : m_dungeonDifficulty; } Difficulty GetDungeonDifficulty() const { return m_dungeonDifficulty; } @@ -2890,6 +2895,13 @@ class Player : public Unit, public GridObject uint32 m_currentBuybackSlot; PlayerCurrenciesMap _currencyStorage; + + /** + * @name _GetCurrencyWeekCap + * @brief return week cap for selected currency + + * @param currency CurrencyTypesEntry witch should get week cap + */ uint32 _GetCurrencyWeekCap(const CurrencyTypesEntry* currency) const; VoidStorageItem* _voidStorageItems[VOID_STORAGE_MAX_SLOT]; @@ -3096,6 +3108,8 @@ class Player : public Unit, public GridObject uint32 _pendingBindTimer; uint32 _activeCheats; + uint32 _maxPersonalArenaRate; + uint32 _ConquestCurrencyTotalWeekCap; PhaseMgr phaseMgr; }; diff --git a/src/server/game/Handlers/BattleGroundHandler.cpp b/src/server/game/Handlers/BattleGroundHandler.cpp index a4177b9a081..5a6a26dd1c8 100755 --- a/src/server/game/Handlers/BattleGroundHandler.cpp +++ b/src/server/game/Handlers/BattleGroundHandler.cpp @@ -784,3 +784,78 @@ void WorldSession::HandleReportPvPAFK(WorldPacket & recvData) reportedPlayer->ReportedAfkBy(_player); } + +void WorldSession::HandleRequestRatedBgInfo(WorldPacket & recvData) +{ + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_REQUEST_RATED_BG_INFO"); + + uint8 unk; + recvData >> unk; + + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "WorldSession::HandleRequestRatedBgInfo: get unk = %u", unk); + + /// @Todo: perfome research in this case + /// The unk fields are related to arenas + WorldPacket data(SMSG_RATED_BG_STATS, 72); + data << uint32(0); // BgWeeklyWins20vs20 + data << uint32(0); // BgWeeklyPlayed20vs20 + data << uint32(0); // BgWeeklyPlayed15vs15 + data << uint32(0); + data << uint32(0); // BgWeeklyWins10vs10 + data << uint32(0); + data << uint32(0); + data << uint32(0); + data << uint32(0); // BgWeeklyWins15vs15 + data << uint32(0); + data << uint32(0); + data << uint32(0); + data << uint32(0); + data << uint32(0); + data << uint32(0); + data << uint32(0); // BgWeeklyPlayed10vs10 + data << uint32(0); + data << uint32(0); + + SendPacket(&data); +} + +void WorldSession::HandleRequestPvpOptions(WorldPacket& recvData) +{ + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_REQUEST_PVP_OPTIONS_ENABLED"); + + /// @Todo: perfome research in this case + WorldPacket data(SMSG_PVP_OPTIONS_ENABLED, 1); + data.WriteBit(1); + data.WriteBit(1); // WargamesEnabled + data.WriteBit(1); + data.WriteBit(1); // RatedBGsEnabled + data.WriteBit(1); // RatedArenasEnabled + + data.FlushBits(); + + SendPacket(&data); +} + +void WorldSession::HandleRequestPvpReward(WorldPacket& recvData) +{ + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_REQUEST_PVP_REWARDS"); + + _player->SendPvpRewards(); +} + +void WorldSession::HandleRequestRatedBgStats(WorldPacket& recvData) +{ + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_REQUEST_RATED_BG_STATS"); + + WorldPacket data(SMSG_BATTLEFIELD_RATED_INFO, 29); + data << uint32(0); // Reward + data << uint8(3); // unk + data << uint32(0); // unk + data << uint32(0); // unk + data << _player->GetCurrencyWeekCap(CURRENCY_TYPE_CONQUEST_META_BG, true); + data << uint32(0); // unk + data << uint32(0); // unk + data << _player->GetCurrency(CURRENCY_TYPE_CONQUEST_POINTS, true); + + SendPacket(&data); +} \ No newline at end of file diff --git a/src/server/game/Miscellaneous/Formulas.h b/src/server/game/Miscellaneous/Formulas.h index 6e6668ba4d6..d557a1093ed 100755 --- a/src/server/game/Miscellaneous/Formulas.h +++ b/src/server/game/Miscellaneous/Formulas.h @@ -224,6 +224,26 @@ namespace Trinity return rate; } } // namespace Trinity::XP + + namespace Currency + { + inline uint32 ConquestRatingCalculator(uint32 rate) + { + if (rate <= 1500) + return 1350; // Default conquest points + else if (rate > 3000) + rate = 3000; + + // http://www.arenajunkies.com/topic/179536-conquest-point-cap-vs-personal-rating-chart/page__st__60#entry3085246 + return 1.4326 * ((1511.26 / (1 + 1639.28 / exp(0.00412 * rate))) + 850.15); + } + + inline uint32 BgConquestRatingCalculator(uint32 rate) + { + // WowWiki: Battleground ratings receive a bonus of 22.2% to the cap they generate + return ConquestRatingCalculator(rate)*1.222f; + } + } // namespace Trinity::Currency } // namespace Trinity #endif diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h index b1eb24c507b..8a7a1cec33a 100755 --- a/src/server/game/Miscellaneous/Language.h +++ b/src/server/game/Miscellaneous/Language.h @@ -707,12 +707,12 @@ enum TrinityStrings LANG_DEBUG_ARENA_OFF = 738, LANG_DEBUG_BG_ON = 739, LANG_DEBUG_BG_OFF = 740, - LANG_DIST_ARENA_POINTS_START = 741, - LANG_DIST_ARENA_POINTS_ONLINE_START = 742, - LANG_DIST_ARENA_POINTS_ONLINE_END = 743, - LANG_DIST_ARENA_POINTS_TEAM_START = 744, - LANG_DIST_ARENA_POINTS_TEAM_END = 745, - LANG_DIST_ARENA_POINTS_END = 746, +// LANG_DIST_ARENA_POINTS_START = 741, +// LANG_DIST_ARENA_POINTS_ONLINE_START = 742, +// LANG_DIST_ARENA_POINTS_ONLINE_END = 743, +// LANG_DIST_ARENA_POINTS_TEAM_START = 744, +// LANG_DIST_ARENA_POINTS_TEAM_END = 745, +// LANG_DIST_ARENA_POINTS_END = 746, LANG_BG_DISABLED = 747, LANG_ARENA_DISABLED = 748, // = 749, not used diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 0ecb6529ea8..aad5085e477 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -453,11 +453,11 @@ void OpcodeTable::Initialize() DEFINE_OPCODE_HANDLER(CMSG_REQUEST_INSPECT_RATED_BG_STATS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PARTY_MEMBER_STATS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestPartyMemberStatsOpcode); DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PET_INFO, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestPetInfoOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PVP_OPTIONS_ENABLED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PVP_REWARDS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PVP_OPTIONS_ENABLED, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleRequestPvpOptions ); + DEFINE_OPCODE_HANDLER(CMSG_REQUEST_PVP_REWARDS, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleRequestPvpReward ); DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RAID_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestRaidInfoOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RATED_BG_INFO, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RATED_BG_STATS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RATED_BG_INFO, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleRequestRatedBgInfo ); + DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RATED_BG_STATS, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleRequestRatedBgStats ); DEFINE_OPCODE_HANDLER(CMSG_REQUEST_RESEARCH_HISTORY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_EXIT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestVehicleExit ); DEFINE_OPCODE_HANDLER(CMSG_REQUEST_VEHICLE_NEXT_SEAT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleChangeSeatsOnControlledVehicle); @@ -673,7 +673,7 @@ void OpcodeTable::Initialize() DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_MGR_STATE_CHANGE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_PLAYER_POSITIONS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_PORT_DENIED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_RATED_INFO, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_RATED_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS_QUEUED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_BATTLEFIELD_STATUS_ACTIVE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1089,7 +1089,7 @@ void OpcodeTable::Initialize() DEFINE_OPCODE_HANDLER(SMSG_PROPOSE_LEVEL_GRANT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PVP_CREDIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_PVP_LOG_DATA, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_PVP_OPTIONS_ENABLED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_PVP_OPTIONS_ENABLED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_QUERY_QUESTS_COMPLETED_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_QUERY_TIME_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_QUESTGIVER_OFFER_REWARD, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1120,7 +1120,7 @@ void OpcodeTable::Initialize() DEFINE_OPCODE_HANDLER(SMSG_RAID_SUMMON_FAILED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_RANDOMIZE_CHAR_NAME, STATUS_AUTHED, PROCESS_THREADUNSAFE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_RATED_BG_RATING, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_RATED_BG_STATS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_RATED_BG_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_READ_ITEM_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_READ_ITEM_OK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_REALM_SPLIT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1133,7 +1133,7 @@ void OpcodeTable::Initialize() DEFINE_OPCODE_HANDLER(SMSG_REMOVED_SPELL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_REPORT_PVP_AFK_RESULT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_REQUEST_CEMETERY_LIST_RESPONSE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_REQUEST_PVP_REWARDS_RESPONSE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_REQUEST_PVP_REWARDS_RESPONSE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_RESEARCH_COMPLETE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_RESEARCH_SETUP_HISTORY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_RESET_COMPRESSION_CONTEXT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 306ce8323cf..eecbbc56368 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -772,6 +772,10 @@ class WorldSession void HandleBattlefieldLeaveOpcode(WorldPacket& recvData); void HandleBattlemasterJoinArena(WorldPacket& recvData); void HandleReportPvPAFK(WorldPacket& recvData); + void HandleRequestRatedBgInfo(WorldPacket& recvData); + void HandleRequestPvpOptions(WorldPacket& recvData); + void HandleRequestPvpReward(WorldPacket& recvData); + void HandleRequestRatedBgStats(WorldPacket& recvData); void HandleWardenDataOpcode(WorldPacket& recvData); void HandleWorldTeleportOpcode(WorldPacket& recvData); diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index e301367ce43..f5472ac8bf4 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -108,6 +108,7 @@ World::World() m_MaxPlayerCount = 0; m_NextDailyQuestReset = 0; m_NextWeeklyQuestReset = 0; + m_NextCurrencyReset = 0; m_defaultDbcLocale = LOCALE_enUS; m_availableDbcLocaleMask = 0; @@ -782,67 +783,78 @@ void World::LoadConfigSettings(bool reload) m_int_configs[CONFIG_START_PLAYER_MONEY] = 0x7FFFFFFF-1; } - m_int_configs[CONFIG_MAX_HONOR_POINTS] = ConfigMgr::GetIntDefault("MaxHonorPoints", 75000); - if (int32(m_int_configs[CONFIG_MAX_HONOR_POINTS]) < 0) + m_int_configs[CONFIG_CURRENCY_RESET_HOUR] = ConfigMgr::GetIntDefault("Currency.ResetHour", 3); + if (m_int_configs[CONFIG_CURRENCY_RESET_HOUR] > 23) { - sLog->outError(LOG_FILTER_SERVER_LOADING, "MaxHonorPoints (%i) can't be negative. Set to 0.", m_int_configs[CONFIG_MAX_HONOR_POINTS]); - m_int_configs[CONFIG_MAX_HONOR_POINTS] = 0; + sLog->outError(LOG_FILTER_SERVER_LOADING, "Currency.ResetHour (%i) can't be load. Set to 6.", m_int_configs[CONFIG_CURRENCY_RESET_HOUR]); + m_int_configs[CONFIG_CURRENCY_RESET_HOUR] = 3; } - - m_int_configs[CONFIG_START_HONOR_POINTS] = ConfigMgr::GetIntDefault("StartHonorPoints", 0); - if (int32(m_int_configs[CONFIG_START_HONOR_POINTS]) < 0) + m_int_configs[CONFIG_CURRENCY_RESET_DAY] = ConfigMgr::GetIntDefault("Currency.ResetDay", 3); + if (m_int_configs[CONFIG_CURRENCY_RESET_DAY] > 6) { - sLog->outError(LOG_FILTER_SERVER_LOADING, "StartHonorPoints (%i) must be in range 0..MaxHonorPoints(%u). Set to %u.", - m_int_configs[CONFIG_START_HONOR_POINTS], m_int_configs[CONFIG_MAX_HONOR_POINTS], 0); - m_int_configs[CONFIG_START_HONOR_POINTS] = 0; + sLog->outError(LOG_FILTER_SERVER_LOADING, "Currency.ResetDay (%i) can't be load. Set to 3.", m_int_configs[CONFIG_CURRENCY_RESET_DAY]); + m_int_configs[CONFIG_CURRENCY_RESET_DAY] = 3; } - else if (m_int_configs[CONFIG_START_HONOR_POINTS] > m_int_configs[CONFIG_MAX_HONOR_POINTS]) + m_int_configs[CONFIG_CURRENCY_RESET_INTERVAL] = ConfigMgr::GetIntDefault("Currency.ResetInterval", 7); + if (int32(m_int_configs[CONFIG_CURRENCY_RESET_INTERVAL]) <= 0) { - sLog->outError(LOG_FILTER_SERVER_LOADING, "StartHonorPoints (%i) must be in range 0..MaxHonorPoints(%u). Set to %u.", - m_int_configs[CONFIG_START_HONOR_POINTS], m_int_configs[CONFIG_MAX_HONOR_POINTS], m_int_configs[CONFIG_MAX_HONOR_POINTS]); - m_int_configs[CONFIG_START_HONOR_POINTS] = m_int_configs[CONFIG_MAX_HONOR_POINTS]; + sLog->outError(LOG_FILTER_SERVER_LOADING, "Currency.ResetInterval (%i) must be > 0, set to default 7.", m_int_configs[CONFIG_CURRENCY_RESET_INTERVAL]); + m_int_configs[CONFIG_CURRENCY_RESET_INTERVAL] = 7; } - - m_int_configs[CONFIG_MAX_JUSTICE_POINTS] = ConfigMgr::GetIntDefault("MaxJusticePoints", 400000); - if (int32(m_int_configs[CONFIG_MAX_JUSTICE_POINTS]) < 0) + + m_int_configs[CONFIG_CURRENCY_START_HONOR_POINTS] = ConfigMgr::GetIntDefault("Currency.StartHonorPoints", 0); + if (int32(m_int_configs[CONFIG_CURRENCY_START_HONOR_POINTS]) < 0) { - sLog->outError(LOG_FILTER_SERVER_LOADING, "MaxJusticePoints (%i) can't be negative. Set to 0.", m_int_configs[CONFIG_MAX_JUSTICE_POINTS]); - m_int_configs[CONFIG_MAX_JUSTICE_POINTS] = 0; + sLog->outError(LOG_FILTER_SERVER_LOADING, "Currency.StartHonorPoints (%i) must be >= 0, set to default 0.", m_int_configs[CONFIG_CURRENCY_START_HONOR_POINTS]); + m_int_configs[CONFIG_CURRENCY_START_HONOR_POINTS] = 0; + } + m_int_configs[CONFIG_CURRENCY_MAX_HONOR_POINTS] = ConfigMgr::GetIntDefault("Currency.MaxHonorPoints", 40000); + if (int32(m_int_configs[CONFIG_CURRENCY_MAX_HONOR_POINTS]) < 0) + { + sLog->outError(LOG_FILTER_SERVER_LOADING, "Currency.MaxHonorPoints (%i) can't be negative. Set to 0.", m_int_configs[CONFIG_CURRENCY_MAX_HONOR_POINTS]); + m_int_configs[CONFIG_CURRENCY_MAX_HONOR_POINTS] = 0; } - m_int_configs[CONFIG_START_JUSTICE_POINTS] = ConfigMgr::GetIntDefault("StartJusticePoints", 0); - if (int32(m_int_configs[CONFIG_START_JUSTICE_POINTS]) < 0) + m_int_configs[CONFIG_CURRENCY_START_CONQUEST_POINTS] = ConfigMgr::GetIntDefault("Currency.StartConquestPoints", 0); + if (int32(m_int_configs[CONFIG_CURRENCY_START_CONQUEST_POINTS]) < 0) { - sLog->outError(LOG_FILTER_SERVER_LOADING, "StartJusticePoints (%i) must be in range 0..MaxJusticePoints(%u). Set to %u.", - m_int_configs[CONFIG_START_JUSTICE_POINTS], m_int_configs[CONFIG_MAX_JUSTICE_POINTS], 0); - m_int_configs[CONFIG_START_JUSTICE_POINTS] = 0; + sLog->outError(LOG_FILTER_SERVER_LOADING, "Currency.StartConquestPoints (%i) must be >= 0, set to default 0.", m_int_configs[CONFIG_CURRENCY_START_CONQUEST_POINTS]); + m_int_configs[CONFIG_CURRENCY_START_CONQUEST_POINTS] = 0; } - else if (m_int_configs[CONFIG_START_JUSTICE_POINTS] > m_int_configs[CONFIG_MAX_JUSTICE_POINTS]) + m_int_configs[CONFIG_CURRENCY_CONQUEST_POINTS_WEEK_CAP] = ConfigMgr::GetIntDefault("Currency.ConquestPointsWeekCap", 1650); + if (int32(m_int_configs[CONFIG_CURRENCY_CONQUEST_POINTS_WEEK_CAP]) <= 0) { - sLog->outError(LOG_FILTER_SERVER_LOADING, "StartJusticePoints (%i) must be in range 0..MaxJusticePoints(%u). Set to %u.", - m_int_configs[CONFIG_START_JUSTICE_POINTS], m_int_configs[CONFIG_MAX_JUSTICE_POINTS], m_int_configs[CONFIG_MAX_JUSTICE_POINTS]); - m_int_configs[CONFIG_START_JUSTICE_POINTS] = m_int_configs[CONFIG_MAX_JUSTICE_POINTS]; + sLog->outError(LOG_FILTER_SERVER_LOADING, "Currency.ConquestPointsWeekCap (%i) must be > 0, set to default 1650.", m_int_configs[CONFIG_CURRENCY_CONQUEST_POINTS_WEEK_CAP]); + m_int_configs[CONFIG_CURRENCY_CONQUEST_POINTS_WEEK_CAP] = 1650; } - - m_int_configs[CONFIG_MAX_ARENA_POINTS] = ConfigMgr::GetIntDefault("MaxArenaPoints", 10000); - if (int32(m_int_configs[CONFIG_MAX_ARENA_POINTS]) < 0) + m_int_configs[CONFIG_CURRENCY_CONQUEST_POINTS_WEEK_CAP] *= 100; //precision mod + + m_int_configs[CONFIG_CURRENCY_CONQUEST_POINTS_ARENA_REWARD] = ConfigMgr::GetIntDefault("Currency.ConquestPointsArenaReward", 150); + if (int32(m_int_configs[CONFIG_CURRENCY_CONQUEST_POINTS_ARENA_REWARD]) <= 0) { - sLog->outError(LOG_FILTER_SERVER_LOADING, "MaxArenaPoints (%i) can't be negative. Set to 0.", m_int_configs[CONFIG_MAX_ARENA_POINTS]); - m_int_configs[CONFIG_MAX_ARENA_POINTS] = 0; + sLog->outError(LOG_FILTER_SERVER_LOADING, "Currency.ConquestPointsArenaReward (%i) must be > 0, set to default 180.", m_int_configs[CONFIG_CURRENCY_CONQUEST_POINTS_ARENA_REWARD]); + m_int_configs[CONFIG_CURRENCY_CONQUEST_POINTS_ARENA_REWARD] = 150; } + m_int_configs[CONFIG_CURRENCY_CONQUEST_POINTS_ARENA_REWARD] *= 100; //precision mod - m_int_configs[CONFIG_START_ARENA_POINTS] = ConfigMgr::GetIntDefault("StartArenaPoints", 0); - if (int32(m_int_configs[CONFIG_START_ARENA_POINTS]) < 0) + m_int_configs[CONFIG_CURRENCY_START_JUSTICE_POINTS] = ConfigMgr::GetIntDefault("StartJusticePoints", 0); + if (int32(m_int_configs[CONFIG_CURRENCY_START_JUSTICE_POINTS]) < 0) + { + sLog->outError(LOG_FILTER_SERVER_LOADING, "StartJusticePoints (%i) must be in range 0..MaxJusticePoints(%u). Set to %u.", + m_int_configs[CONFIG_CURRENCY_START_JUSTICE_POINTS], m_int_configs[CONFIG_CURRENCY_MAX_JUSTICE_POINTS], 0); + m_int_configs[CONFIG_CURRENCY_START_JUSTICE_POINTS] = 0; + } + else if (m_int_configs[CONFIG_CURRENCY_START_JUSTICE_POINTS] > m_int_configs[CONFIG_CURRENCY_MAX_JUSTICE_POINTS]) { - sLog->outError(LOG_FILTER_SERVER_LOADING, "StartArenaPoints (%i) must be in range 0..MaxArenaPoints(%u). Set to %u.", - m_int_configs[CONFIG_START_ARENA_POINTS], m_int_configs[CONFIG_MAX_ARENA_POINTS], 0); - m_int_configs[CONFIG_START_ARENA_POINTS] = 0; + sLog->outError(LOG_FILTER_SERVER_LOADING, "StartJusticePoints (%i) must be in range 0..MaxJusticePoints(%u). Set to %u.", + m_int_configs[CONFIG_CURRENCY_START_JUSTICE_POINTS], m_int_configs[CONFIG_CURRENCY_MAX_JUSTICE_POINTS], m_int_configs[CONFIG_CURRENCY_MAX_JUSTICE_POINTS]); + m_int_configs[CONFIG_CURRENCY_START_JUSTICE_POINTS] = m_int_configs[CONFIG_CURRENCY_MAX_JUSTICE_POINTS]; } - else if (m_int_configs[CONFIG_START_ARENA_POINTS] > m_int_configs[CONFIG_MAX_ARENA_POINTS]) + m_int_configs[CONFIG_CURRENCY_MAX_JUSTICE_POINTS] = ConfigMgr::GetIntDefault("MaxJusticePoints", 400000); + if (int32(m_int_configs[CONFIG_CURRENCY_MAX_JUSTICE_POINTS]) < 0) { - sLog->outError(LOG_FILTER_SERVER_LOADING, "StartArenaPoints (%i) must be in range 0..MaxArenaPoints(%u). Set to %u.", - m_int_configs[CONFIG_START_ARENA_POINTS], m_int_configs[CONFIG_MAX_ARENA_POINTS], m_int_configs[CONFIG_MAX_ARENA_POINTS]); - m_int_configs[CONFIG_START_ARENA_POINTS] = m_int_configs[CONFIG_MAX_ARENA_POINTS]; + sLog->outError(LOG_FILTER_SERVER_LOADING, "MaxJusticePoints (%i) can't be negative. Set to 0.", m_int_configs[CONFIG_CURRENCY_MAX_JUSTICE_POINTS]); + m_int_configs[CONFIG_CURRENCY_MAX_JUSTICE_POINTS] = 0; } m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL] = ConfigMgr::GetIntDefault("RecruitAFriend.MaxLevel", 60); @@ -1048,8 +1060,6 @@ void World::LoadConfigSettings(bool reload) m_int_configs[CONFIG_ARENA_MAX_RATING_DIFFERENCE] = ConfigMgr::GetIntDefault ("Arena.MaxRatingDifference", 150); m_int_configs[CONFIG_ARENA_RATING_DISCARD_TIMER] = ConfigMgr::GetIntDefault ("Arena.RatingDiscardTimer", 10 * MINUTE * IN_MILLISECONDS); m_int_configs[CONFIG_ARENA_RATED_UPDATE_TIMER] = ConfigMgr::GetIntDefault ("Arena.RatedUpdateTimer", 5 * IN_MILLISECONDS); - m_bool_configs[CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS] = ConfigMgr::GetBoolDefault("Arena.AutoDistributePoints", false); - m_int_configs[CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS] = ConfigMgr::GetIntDefault ("Arena.AutoDistributeInterval", 7); m_bool_configs[CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE] = ConfigMgr::GetBoolDefault("Arena.QueueAnnouncer.Enable", false); m_bool_configs[CONFIG_ARENA_QUEUE_ANNOUNCER_PLAYERONLY] = ConfigMgr::GetBoolDefault("Arena.QueueAnnouncer.PlayerOnly", false); m_int_configs[CONFIG_ARENA_SEASON_ID] = ConfigMgr::GetIntDefault ("Arena.ArenaSeason.ID", 1); @@ -1777,7 +1787,6 @@ void World::SetInitialWorldSettings() ///- Initialize Battlegrounds sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Starting Battleground System"); sBattlegroundMgr->CreateInitialBattlegrounds(); - sBattlegroundMgr->InitAutomaticArenaPointDistribution(); ///- Initialize outdoor pvp sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Starting Outdoor PvP System"); @@ -1815,6 +1824,9 @@ void World::SetInitialWorldSettings() sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Calculate Guild cap reset time..."); InitGuildResetTime(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Calculate next currency reset time..."); + InitCurrencyResetTime(); + LoadCharacterNameData(); sLog->outInfo(LOG_FILTER_GENERAL, "Initializing Opcodes..."); @@ -1975,6 +1987,9 @@ void World::Update(uint32 diff) if (m_gameTime > m_NextGuildReset) ResetGuildCap(); + if (m_gameTime > m_NextCurrencyReset) + ResetCurrencyWeekCap(); + ///
  • Handle auctions when the timer has passed if (m_timers[WUPDATE_AUCTIONS].Passed()) { @@ -2822,6 +2837,35 @@ void World::InitGuildResetTime() sWorld->setWorldState(WS_GUILD_DAILY_RESET_TIME, uint64(m_NextGuildReset)); } +void World::InitCurrencyResetTime() +{ + time_t currencytime = uint64(sWorld->getWorldState(WS_CURRENCY_RESET_TIME)); + if (!currencytime) + m_NextCurrencyReset = time_t(time(NULL)); // game time not yet init + + // generate time by config + time_t curTime = time(NULL); + tm localTm = *localtime(&curTime); + + localTm.tm_wday = getIntConfig(CONFIG_CURRENCY_RESET_DAY); + localTm.tm_hour = getIntConfig(CONFIG_CURRENCY_RESET_HOUR); + localTm.tm_min = 0; + localTm.tm_sec = 0; + + // current week reset time + time_t nextWeekResetTime = mktime(&localTm); + + // next reset time before current moment + if (curTime >= nextWeekResetTime) + nextWeekResetTime += getIntConfig(CONFIG_CURRENCY_RESET_INTERVAL) * DAY; + + // normalize reset time + m_NextCurrencyReset = currencytime < curTime ? nextWeekResetTime - getIntConfig(CONFIG_CURRENCY_RESET_INTERVAL) * DAY : nextWeekResetTime; + + if (!currencytime) + sWorld->setWorldState(WS_CURRENCY_RESET_TIME, uint64(m_NextCurrencyReset)); +} + void World::ResetDailyQuests() { sLog->outInfo(LOG_FILTER_GENERAL, "Daily quests reset for all characters."); @@ -2837,6 +2881,18 @@ void World::ResetDailyQuests() sPoolMgr->ChangeDailyQuests(); } +void World::ResetCurrencyWeekCap() +{ + CharacterDatabase.Execute("UPDATE `character_currency` SET `week_count` = 0"); + + for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr) + if (itr->second->GetPlayer()) + itr->second->GetPlayer()->ResetCurrencyWeekCap(); + + m_NextCurrencyReset = time_t(m_NextCurrencyReset + DAY * getIntConfig(CONFIG_CURRENCY_RESET_INTERVAL)); + sWorld->setWorldState(WS_CURRENCY_RESET_TIME, uint64(m_NextCurrencyReset)); +} + void World::LoadDBAllowedSecurityLevel() { PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_REALMLIST_SECURITY_LEVEL); diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h index 917ab6c5fec..f187f302bea 100644 --- a/src/server/game/World/World.h +++ b/src/server/game/World/World.h @@ -139,7 +139,6 @@ enum WorldBoolConfigs CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE, CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY, CONFIG_BG_XP_FOR_KILL, - CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS, CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE, CONFIG_ARENA_QUEUE_ANNOUNCER_PLAYERONLY, CONFIG_ARENA_SEASON_IN_PROGRESS, @@ -225,12 +224,16 @@ enum WorldIntConfigs CONFIG_START_PLAYER_LEVEL, CONFIG_START_HEROIC_PLAYER_LEVEL, CONFIG_START_PLAYER_MONEY, - CONFIG_MAX_HONOR_POINTS, - CONFIG_START_HONOR_POINTS, - CONFIG_MAX_JUSTICE_POINTS, - CONFIG_START_JUSTICE_POINTS, - CONFIG_MAX_ARENA_POINTS,//todo: remove - CONFIG_START_ARENA_POINTS,//todo: remove + CONFIG_CURRENCY_START_JUSTICE_POINTS, + CONFIG_CURRENCY_MAX_JUSTICE_POINTS, + CONFIG_CURRENCY_START_HONOR_POINTS, + CONFIG_CURRENCY_MAX_HONOR_POINTS, + CONFIG_CURRENCY_START_CONQUEST_POINTS, + CONFIG_CURRENCY_CONQUEST_POINTS_WEEK_CAP, + CONFIG_CURRENCY_CONQUEST_POINTS_ARENA_REWARD, + CONFIG_CURRENCY_RESET_HOUR, + CONFIG_CURRENCY_RESET_DAY, + CONFIG_CURRENCY_RESET_INTERVAL, CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL, CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL_DIFFERENCE, CONFIG_INSTANCE_RESET_TIME_HOUR, @@ -290,7 +293,6 @@ enum WorldIntConfigs CONFIG_ARENA_MAX_RATING_DIFFERENCE, CONFIG_ARENA_RATING_DISCARD_TIMER, CONFIG_ARENA_RATED_UPDATE_TIMER, - CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS, CONFIG_ARENA_SEASON_ID, CONFIG_ARENA_START_RATING, CONFIG_ARENA_START_PERSONAL_RATING, @@ -764,10 +766,12 @@ class World void InitWeeklyQuestResetTime(); void InitRandomBGResetTime(); void InitGuildResetTime(); + void InitCurrencyResetTime(); void ResetDailyQuests(); void ResetWeeklyQuests(); void ResetRandomBG(); void ResetGuildCap(); + void ResetCurrencyWeekCap(); private: static ACE_Atomic_Op m_stopEvent; static uint8 m_ExitCode; @@ -824,11 +828,12 @@ class World // CLI command holder to be thread safe ACE_Based::LockedQueue cliCmdQueue; - // next daily quests and random bg reset time + // scheduled reset times time_t m_NextDailyQuestReset; time_t m_NextWeeklyQuestReset; time_t m_NextRandomBGReset; time_t m_NextGuildReset; + time_t m_NextCurrencyReset; //Player Queue Queue m_QueuedPlayer; diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index 443bc9a0ecd..8078b09baa3 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -106,7 +106,6 @@ public: { "cometome", SEC_ADMINISTRATOR, false, &HandleComeToMeCommand, "", NULL }, { "damage", SEC_ADMINISTRATOR, false, &HandleDamageCommand, "", NULL }, { "combatstop", SEC_GAMEMASTER, true, &HandleCombatStopCommand, "", NULL }, - { "flusharenapoints", SEC_ADMINISTRATOR, false, &HandleFlushArenaPointsCommand, "", NULL }, { "repairitems", SEC_GAMEMASTER, true, &HandleRepairitemsCommand, "", NULL }, { "freeze", SEC_MODERATOR, false, &HandleFreezeCommand, "", NULL }, { "unfreeze", SEC_MODERATOR, false, &HandleUnFreezeCommand, "", NULL }, @@ -2125,12 +2124,6 @@ public: return true; } - static bool HandleFlushArenaPointsCommand(ChatHandler* /*handler*/, char const* /*args*/) - { - sArenaTeamMgr->DistributeArenaPoints(); - return true; - } - static bool HandleRepairitemsCommand(ChatHandler* handler, char const* args) { Player* target; diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index 47955e26ac8..61f90b9d046 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -1134,7 +1134,7 @@ public: target->ModifyCurrency(CURRENCY_TYPE_HONOR_POINTS, amount, true, true); - handler->PSendSysMessage(LANG_COMMAND_MODIFY_HONOR, handler->GetNameLink(target).c_str(), target->GetCurrency(CURRENCY_TYPE_HONOR_POINTS)); + handler->PSendSysMessage(LANG_COMMAND_MODIFY_HONOR, handler->GetNameLink(target).c_str(), target->GetCurrency(CURRENCY_TYPE_HONOR_POINTS, false)); return true; } @@ -1325,7 +1325,7 @@ public: target->ModifyCurrency(CURRENCY_TYPE_CONQUEST_POINTS, amount, true, true); - handler->PSendSysMessage(LANG_COMMAND_MODIFY_ARENA, handler->GetNameLink(target).c_str(), target->GetCurrency(CURRENCY_TYPE_CONQUEST_POINTS)); + handler->PSendSysMessage(LANG_COMMAND_MODIFY_ARENA, handler->GetNameLink(target).c_str(), target->GetCurrency(CURRENCY_TYPE_CONQUEST_POINTS, false)); return true; } diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index 217daeeca6a..8b8e45432c8 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -27,6 +27,7 @@ # CHARACTER DELETE OPTIONS # CUSTOM SERVER OPTIONS # LOGGING SYSTEM SETTINGS +# CURRENCIES SETTINGS # ################################################################################################### @@ -778,48 +779,6 @@ StartHeroicPlayerLevel = 55 StartPlayerMoney = 0 -# -# MaxHonorPoints -# Description: Maximum honor points a character can have. -# Default: 75000 - -MaxHonorPoints = 75000 - -# -# StartHonorPoints -# Description: Amount of honor points that characters have after creation. -# Default: 0 - -StartHonorPoints = 0 - -# -# MaxJusticePoints -# Description: Maximum justice points a character can have. -# Default: 400000 - -MaxJusticePoints = 400000 - -# -# StartJusticePoints -# Description: Amount of justice points that characters have after creation. -# Default: 0 - -StartJusticePoints = 0 - -# -# MaxArenaPoints -# Description: Maximum arena points a character can have. -# Default: 10000 - -MaxArenaPoints = 10000 - -# -# StartArenaPoints -# Description: Amount of arena points that characters has after creation. -# Default: 0 - -StartArenaPoints = 0 - # # RecruitAFriend.MaxLevel # Description: Highest level up to which a character can benefit from the Recruit-A-Friend @@ -2905,3 +2864,64 @@ Guild.WeeklyReputationCap = 4375 # ################################################################################################### + +################################################################################################### +# CURRENCIES SETTINGS +# +# Currency.StartHonorPoints +# Amount of honor that new players will start with +# Default: 0 (with precision) +# + +Currency.StartHonorPoints = 0 + +# +# Currency.StartConquestPoints +# Amount of conquest points that new players will start with +# Default: 0 (with precision) +# + +Currency.StartConquestPoints = 0 + +# +# Currency.ResetInterval +# How often should currency week count reset (days) +# Default: 7 (weekly) +# + +Currency.ResetInterval = 7 + +# +# Currency.ResetWeekDay +# Week day when currency week count is reset (0..6) 0 == Sunday +# Default: 3 (Wednesday) +# + +Currency.ResetWeekDay = 3 + +# +# Currency.ResetHour +# Hour of a day when currency week count is reset (0..23) +# Default: 6 +# + +Currency.ResetHour = 6 + +# +# Currency.ConquestPointsDefaultWeekCap +# Amount of conquest points that player can earn per week +# Default: 1350 +# + +Currency.ConquestPointsDefaultWeekCap = 1350 + +# +# Currency.ConquestPointsArenaReward +# Amount of conquest points rewarded by winning arenas +# Default: 150 +# + +Currency.ConquestPointsArenaReward = 150 + +# +################################################################################################### -- cgit v1.2.3 From f5a54f8cbefc150b41571e7e5fea1d8a4eec8e1a Mon Sep 17 00:00:00 2001 From: Tuxity Date: Wed, 21 Nov 2012 18:26:28 +0100 Subject: Misc: Whitespace and tabs cleanup --- src/server/game/Battlegrounds/Battleground.cpp | 10 ++++----- src/server/game/Battlegrounds/Battleground.h | 2 +- src/server/game/Battlegrounds/BattlegroundMgr.cpp | 8 +++---- .../game/Battlegrounds/Zones/BattlegroundAB.cpp | 4 ++-- .../game/Battlegrounds/Zones/BattlegroundAB.h | 2 +- .../game/Battlegrounds/Zones/BattlegroundAV.cpp | 4 ++-- .../game/Battlegrounds/Zones/BattlegroundAV.h | 2 +- .../game/Battlegrounds/Zones/BattlegroundEY.cpp | 2 +- .../game/Battlegrounds/Zones/BattlegroundEY.h | 2 +- .../game/Battlegrounds/Zones/BattlegroundWS.cpp | 2 +- .../game/Battlegrounds/Zones/BattlegroundWS.h | 2 +- src/server/game/Entities/Player/Player.cpp | 14 ++++++------ src/server/game/Handlers/ArenaTeamHandler.cpp | 2 +- src/server/game/Handlers/BattleGroundHandler.cpp | 26 +++++++++++----------- src/server/game/Miscellaneous/Formulas.h | 6 ++--- src/server/game/World/World.cpp | 6 ++--- .../MagistersTerrace/boss_felblood_kaelthas.cpp | 2 +- .../instance_magisters_terrace.cpp | 10 ++++----- 18 files changed, 53 insertions(+), 53 deletions(-) (limited to 'src') diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index 393ca57e22c..881d0e3296b 100755 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -419,7 +419,7 @@ uint32 Battleground::GetPrematureWinner() winner = ALLIANCE; else if (GetPlayersCountByTeam(HORDE) >= GetMinPlayersPerTeam()) winner = HORDE; - + return winner; } @@ -481,7 +481,7 @@ inline void Battleground::_ProcessJoin(uint32 diff) if (m_CountdownTimer >= 10000) { uint32 countdownMaxForBGType = isArena() ? ARENA_COUNTDOWN_MAX : BATTLEGROUND_COUNTDOWN_MAX; - + WorldPacket data(SMSG_START_TIMER, 4+4+4); data << uint32(0); // unk data << uint32(countdownMaxForBGType - (m_CountdownTimer / 1000)); @@ -935,12 +935,12 @@ void Battleground::EndBattleground(uint32 winner) UpdatePlayerScore(player, SCORE_BONUS_HONOR, GetBonusHonorFromKill(winner_kills)); if (!player->GetRandomWinner()) { - // 100cp awarded for the first rated battleground won each day + // 100cp awarded for the first rated battleground won each day player->ModifyCurrency(CURRENCY_TYPE_CONQUEST_META_BG, BG_REWARD_WINNER_CONQUEST_FIRST); player->SetRandomWinner(true); } } - else // 50cp awarded for each non-rated battleground won + else // 50cp awarded for each non-rated battleground won player->ModifyCurrency(CURRENCY_TYPE_CONQUEST_META_BG, BG_REWARD_WINNER_CONQUEST_LAST ); player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_BG, 1); @@ -1240,7 +1240,7 @@ void Battleground::AddPlayer(Player* player) // Correctly display EnemyUnitFrame player->SetByteValue(PLAYER_BYTES_3, 3, player->GetBGTeam()); - + WorldPacket data(SMSG_ARENA_OPPONENT_UPDATE, 8); data << uint64(player->GetGUID()); SendPacketToTeam(team, &data, player, false); diff --git a/src/server/game/Battlegrounds/Battleground.h b/src/server/game/Battlegrounds/Battleground.h index 90b7e5167a6..3026d737bda 100755 --- a/src/server/game/Battlegrounds/Battleground.h +++ b/src/server/game/Battlegrounds/Battleground.h @@ -533,7 +533,7 @@ class Battleground virtual uint64 GetFlagPickerGUID(int32 /*team*/ = -1) const { return 0; } virtual void SetDroppedFlagGUID(uint64 /*guid*/, int32 /*team*/ = -1) {} uint32 GetTeamScore(uint32 TeamID) const; - + virtual uint32 GetPrematureWinner(); protected: diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index 271cbee850e..f5edafec655 100755 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -390,7 +390,7 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg) } Player* player = ObjectAccessor::FindPlayer(itr->first); ObjectGuid playerGUID = itr->first; - + data->WriteBit(0); // Unk 1 data->WriteBit(0); // Unk 2 data->WriteBit(playerGUID[2]); @@ -405,17 +405,17 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg) data->WriteBit(playerGUID[6]); data->WriteBit(player->GetTeam() == ALLIANCE); data->WriteBit(playerGUID[7]); - + buff << uint32(itr->second->HealingDone); // healing done buff << uint32(itr->second->DamageDone); // damage done - + if (!isArena) { buff << uint32(itr->second->BonusHonor / 100); buff << uint32(itr->second->Deaths); buff << uint32(itr->second->HonorableKills); } - + buff.WriteByteSeq(playerGUID[4]); buff << uint32(itr->second->KillingBlows); // if (unk 5) << uint32() unk diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp index 47320db27cf..cb0d651ad47 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp @@ -558,12 +558,12 @@ uint32 BattlegroundAB::GetPrematureWinner() ++ally; else if (m_Nodes[i] == BG_AB_NODE_STATUS_HORDE_OCCUPIED) ++horde; - + if (ally > horde) return ALLIANCE; else if (horde > ally) return HORDE; - + // If the values are equal, fall back to the original result (based on number of players on each team) return Battleground::GetPrematureWinner(); } diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAB.h b/src/server/game/Battlegrounds/Zones/BattlegroundAB.h index b80e216a216..6e01437b895 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAB.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAB.h @@ -272,7 +272,7 @@ class BattlegroundAB : public Battleground /* achievement req. */ bool IsAllNodesConrolledByTeam(uint32 team) const; // overwrited bool IsTeamScores500Disadvantage(uint32 team) const { return m_TeamScores500Disadvantage[GetTeamIndexByTeamId(team)]; } - + uint32 GetPrematureWinner(); private: void PostUpdateImpl(uint32 diff); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp index 918cef4d261..b12aec245cd 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp @@ -1701,11 +1701,11 @@ uint32 BattlegroundAV::GetPrematureWinner() { uint32 allianceScore = m_Team_Scores[GetTeamIndexByTeamId(ALLIANCE)]; uint32 hordeScore = m_Team_Scores[GetTeamIndexByTeamId(HORDE)]; - + if (allianceScore > hordeScore) return ALLIANCE; else if (hordeScore > allianceScore) return HORDE; - + return Battleground::GetPrematureWinner(); } diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.h b/src/server/game/Battlegrounds/Zones/BattlegroundAV.h index bedd946a78c..b7fa8d6ece8 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.h @@ -1572,7 +1572,7 @@ class BattlegroundAV : public Battleground /* achievement req. */ bool IsBothMinesControlledByTeam(uint32 team) const; bool IsAllTowersControlledAndCaptainAlive(uint32 team) const; - + uint32 GetPrematureWinner(); private: diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp index 458e86729e7..ab0f94b74f6 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp @@ -944,6 +944,6 @@ uint32 BattlegroundEY::GetPrematureWinner() return ALLIANCE; else if (GetTeamScore(TEAM_HORDE) > GetTeamScore(TEAM_ALLIANCE)) return HORDE; - + return Battleground::GetPrematureWinner(); } \ No newline at end of file diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundEY.h b/src/server/game/Battlegrounds/Zones/BattlegroundEY.h index 2cfd4ca7e0f..43e7fb4f933 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.h @@ -369,7 +369,7 @@ class BattlegroundEY : public Battleground /* achievement req. */ bool IsAllNodesConrolledByTeam(uint32 team) const; - + uint32 GetPrematureWinner(); private: void PostUpdateImpl(uint32 diff); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp index 663e5aed1e4..e47cb0acb35 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp @@ -864,6 +864,6 @@ uint32 BattlegroundWS::GetPrematureWinner() return ALLIANCE; else if (GetTeamScore(TEAM_HORDE) > GetTeamScore(TEAM_ALLIANCE)) return HORDE; - + return Battleground::GetPrematureWinner(); } diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundWS.h b/src/server/game/Battlegrounds/Zones/BattlegroundWS.h index 5b72de43b32..b0d68177072 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundWS.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundWS.h @@ -211,7 +211,7 @@ class BattlegroundWS : public Battleground void AddPoint(uint32 TeamID, uint32 Points = 1) { m_TeamScores[GetTeamIndexByTeamId(TeamID)] += Points; } void SetTeamPoint(uint32 TeamID, uint32 Points = 0) { m_TeamScores[GetTeamIndexByTeamId(TeamID)] = Points; } void RemovePoint(uint32 TeamID, uint32 Points = 1) { m_TeamScores[GetTeamIndexByTeamId(TeamID)] -= Points; } - + uint32 GetPrematureWinner(); private: uint64 m_FlagKeepers[2]; // 0 - alliance, 1 - horde diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index fdf9c2c7a90..8b85f761b85 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -7565,11 +7565,11 @@ uint32 Player::GetCurrencyWeekCap(uint32 id, bool usePrecision) const CurrencyTypesEntry const* entry = sCurrencyTypesStore.LookupEntry(id); if (!entry) return 0; - + uint32 cap = _GetCurrencyWeekCap(entry); if(usePrecision && entry->Flags & CURRENCY_FLAG_HIGH_PRECISION) cap /= 100; - + return cap; } @@ -7585,13 +7585,13 @@ void Player::ResetCurrencyWeekCap() arenaTeam->NotifyStatsChanged(); // notify the players of the changes } } - + for (PlayerCurrenciesMap::iterator itr = _currencyStorage.begin(); itr != _currencyStorage.end(); ++itr) { itr->second.weekCount = 0; itr->second.state = PLAYERCURRENCY_CHANGED; } - + WorldPacket data(SMSG_WEEKLY_RESET_CURRENCY, 0); SendDirectMessage(&data); } @@ -7599,7 +7599,7 @@ void Player::ResetCurrencyWeekCap() uint32 Player::_GetCurrencyWeekCap(const CurrencyTypesEntry* currency) const { uint32 cap = currency->WeekCap; - + switch (currency->ID) { //original conquest not have week cap @@ -7626,7 +7626,7 @@ uint32 Player::_GetCurrencyWeekCap(const CurrencyTypesEntry* currency) const break; } } - + if (cap != currency->WeekCap && IsInWorld() && !GetSession()->PlayerLoading()) { WorldPacket packet(SMSG_UPDATE_CURRENCY_WEEK_LIMIT, 8); @@ -7634,7 +7634,7 @@ uint32 Player::_GetCurrencyWeekCap(const CurrencyTypesEntry* currency) const packet << uint32(currency->ID); GetSession()->SendPacket(&packet); } - + return cap; } diff --git a/src/server/game/Handlers/ArenaTeamHandler.cpp b/src/server/game/Handlers/ArenaTeamHandler.cpp index 917fc7069a8..1116587a63b 100755 --- a/src/server/game/Handlers/ArenaTeamHandler.cpp +++ b/src/server/game/Handlers/ArenaTeamHandler.cpp @@ -119,7 +119,7 @@ void WorldSession::HandleArenaTeamCreateOpcode(WorldPacket & recvData) } sArenaTeamMgr->AddArenaTeam(arenaTeam); - + SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, name, "", ERR_ARENA_TEAM_CREATED); } diff --git a/src/server/game/Handlers/BattleGroundHandler.cpp b/src/server/game/Handlers/BattleGroundHandler.cpp index 5a6a26dd1c8..a2780459f9b 100755 --- a/src/server/game/Handlers/BattleGroundHandler.cpp +++ b/src/server/game/Handlers/BattleGroundHandler.cpp @@ -706,7 +706,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recvData) return; if (grp->GetLeaderGUID() != _player->GetGUID()) return; - + uint32 ateamId = _player->GetArenaTeamId(arenaslot); // check real arenateam existence only here (if it was moved to group->CanJoin .. () then we would ahve to get it twice) ArenaTeam* at = sArenaTeamMgr->GetArenaTeamById(ateamId); @@ -720,30 +720,30 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recvData) arenaRating = at->GetRating(); matchmakerRating = at->GetAverageMMR(grp); // the arenateam id must match for everyone in the group - + if (arenaRating <= 0) arenaRating = 1; - + BattlegroundQueue &bgQueue = sBattlegroundMgr->GetBattlegroundQueue(bgQueueTypeId); - + uint32 avgTime = 0; GroupQueueInfo* ginfo; - + err = grp->CanJoinBattlegroundQueue(bg, bgQueueTypeId, arenatype, arenatype, true, arenaslot); if (!err) { sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: arena team id %u, leader %s queued with matchmaker rating %u for type %u", _player->GetArenaTeamId(arenaslot), _player->GetName().c_str(), matchmakerRating, arenatype); - + ginfo = bgQueue.AddGroup(_player, grp, bgTypeId, bracketEntry, arenatype, true, false, arenaRating, matchmakerRating, ateamId); avgTime = bgQueue.GetAverageQueueWaitTime(ginfo, bracketEntry->GetBracketId()); } - + for (GroupReference* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next()) { Player* member = itr->getSource(); if (!member) continue; - + if (err) { WorldPacket data; @@ -751,20 +751,20 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recvData) member->GetSession()->SendPacket(&data); continue; } - + // add to queue uint32 queueSlot = member->AddBattlegroundQueueId(bgQueueTypeId); - + // add joined time data member->AddBattlegroundQueueJoinTime(bgTypeId, ginfo->JoinTime); - + WorldPacket data; // send status packet (in queue) sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, member, queueSlot, STATUS_WAIT_QUEUE, avgTime, ginfo->JoinTime, arenatype); member->GetSession()->SendPacket(&data); - + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: player joined queue for arena as group bg queue type %u bg type %u: GUID %u, NAME %s", bgQueueTypeId, bgTypeId, member->GetGUIDLow(), member->GetName().c_str()); } - + sBattlegroundMgr->ScheduleQueueUpdate(matchmakerRating, arenatype, bgQueueTypeId, bgTypeId, bracketEntry->GetBracketId()); } diff --git a/src/server/game/Miscellaneous/Formulas.h b/src/server/game/Miscellaneous/Formulas.h index d557a1093ed..ad13bcba316 100755 --- a/src/server/game/Miscellaneous/Formulas.h +++ b/src/server/game/Miscellaneous/Formulas.h @@ -224,7 +224,7 @@ namespace Trinity return rate; } } // namespace Trinity::XP - + namespace Currency { inline uint32 ConquestRatingCalculator(uint32 rate) @@ -233,11 +233,11 @@ namespace Trinity return 1350; // Default conquest points else if (rate > 3000) rate = 3000; - + // http://www.arenajunkies.com/topic/179536-conquest-point-cap-vs-personal-rating-chart/page__st__60#entry3085246 return 1.4326 * ((1511.26 / (1 + 1639.28 / exp(0.00412 * rate))) + 850.15); } - + inline uint32 BgConquestRatingCalculator(uint32 rate) { // WowWiki: Battleground ratings receive a bonus of 22.2% to the cap they generate diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index f5472ac8bf4..fa813f454e5 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -801,7 +801,7 @@ void World::LoadConfigSettings(bool reload) sLog->outError(LOG_FILTER_SERVER_LOADING, "Currency.ResetInterval (%i) must be > 0, set to default 7.", m_int_configs[CONFIG_CURRENCY_RESET_INTERVAL]); m_int_configs[CONFIG_CURRENCY_RESET_INTERVAL] = 7; } - + m_int_configs[CONFIG_CURRENCY_START_HONOR_POINTS] = ConfigMgr::GetIntDefault("Currency.StartHonorPoints", 0); if (int32(m_int_configs[CONFIG_CURRENCY_START_HONOR_POINTS]) < 0) { @@ -828,7 +828,7 @@ void World::LoadConfigSettings(bool reload) m_int_configs[CONFIG_CURRENCY_CONQUEST_POINTS_WEEK_CAP] = 1650; } m_int_configs[CONFIG_CURRENCY_CONQUEST_POINTS_WEEK_CAP] *= 100; //precision mod - + m_int_configs[CONFIG_CURRENCY_CONQUEST_POINTS_ARENA_REWARD] = ConfigMgr::GetIntDefault("Currency.ConquestPointsArenaReward", 150); if (int32(m_int_configs[CONFIG_CURRENCY_CONQUEST_POINTS_ARENA_REWARD]) <= 0) { @@ -1989,7 +1989,7 @@ void World::Update(uint32 diff) if (m_gameTime > m_NextCurrencyReset) ResetCurrencyWeekCap(); - + ///
    • Handle auctions when the timer has passed if (m_timers[WUPDATE_AUCTIONS].Passed()) { diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp index eec520f04e2..0c3c046a2e0 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp @@ -168,7 +168,7 @@ public: { if (!instance) return; - + instance->SetData(DATA_KAELTHAS_EVENT, IN_PROGRESS); } diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp index c8bf50c0bcc..c142a0c30d7 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp @@ -150,7 +150,7 @@ public: HandleGameObject(SelinEncounterDoorGUID, false); else if (data == NOT_STARTED) HandleGameObject(SelinEncounterDoorGUID, true); - + Encounter[0] = data; break; case DATA_VEXALLUS_EVENT: @@ -184,7 +184,7 @@ public: StatuesState = data; break; } - + SaveToDB(); } @@ -245,7 +245,7 @@ public: OUT_SAVE_INST_DATA_COMPLETE; return saveStream.str(); } - + void Load(const char* str) { if (!str) @@ -257,7 +257,7 @@ public: OUT_LOAD_INST_DATA(str); std::istringstream loadStream(str); - + for (uint32 i = 0; i < MAX_ENCOUNTER; ++i) { uint32 tmpState; @@ -272,7 +272,7 @@ public: OUT_LOAD_INST_DATA_COMPLETE; } - + uint64 GetData64(uint32 identifier) const { switch (identifier) -- cgit v1.2.3 From 3d314acda8059cdb489597137407d735618f101b Mon Sep 17 00:00:00 2001 From: Tuxity Date: Thu, 22 Nov 2012 01:19:48 +0100 Subject: Core/Spells: Fix Soulshards creation, remove old code of glyph of Drain Soul. Closes #8341 --- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'src') diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 71dd40fdd37..3a7aa5110b3 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -5213,15 +5213,6 @@ void AuraEffect::HandleChannelDeathItem(AuraApplication const* aurApp, uint8 mod if (!plCaster->isHonorOrXPTarget(target) || (target->GetTypeId() == TYPEID_UNIT && !target->ToCreature()->isTappedBy(plCaster))) return; - - // If this is Drain Soul, check for Glyph of Drain Soul - if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_WARLOCK && (GetSpellInfo()->SpellFamilyFlags[0] & 0x00004000)) - { - // Glyph of Drain Soul - chance to create an additional Soul Shard - if (AuraEffect* aur = caster->GetAuraEffect(58070, 0)) - if (roll_chance_i(aur->GetMiscValue())) - caster->CastSpell(caster, 58068, true, 0, aur); // We _could_ simply do ++count here, but Blizz does it this way :) - } } //Adding items @@ -6132,16 +6123,7 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_WARLOCK && (GetSpellInfo()->SpellFamilyFlags[0] & 0x00004000)) { if (caster->GetTypeId() == TYPEID_PLAYER && caster->ToPlayer()->isHonorOrXPTarget(target)) - { - if (roll_chance_i(20)) - { - caster->CastSpell(caster, 43836, true, 0, this); - // Glyph of Drain Soul - chance to create an additional Soul Shard - if (AuraEffect* aur = caster->GetAuraEffect(58070, 0)) - if (roll_chance_i(aur->GetMiscValue())) - caster->CastSpell(caster, 58068, true, 0, aur); - } - } + caster->CastSpell(caster, 95810, true, 0, this); } if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_GENERIC) { -- cgit v1.2.3 From 2f1000a9ed14fbfabce05278ec80a4dc7bfd45e7 Mon Sep 17 00:00:00 2001 From: Tuxity Date: Thu, 22 Nov 2012 01:39:54 +0100 Subject: Core/Arenas: Drop old .modify arenapoint command, create a new command to add currency to players. --- sql/updates/world/2012_11_22_00_world_command.sql | 4 ++ src/server/scripts/Commands/cs_modify.cpp | 51 +++++++++++++---------- 2 files changed, 32 insertions(+), 23 deletions(-) create mode 100644 sql/updates/world/2012_11_22_00_world_command.sql (limited to 'src') diff --git a/sql/updates/world/2012_11_22_00_world_command.sql b/sql/updates/world/2012_11_22_00_world_command.sql new file mode 100644 index 00000000000..74ed29e31ac --- /dev/null +++ b/sql/updates/world/2012_11_22_00_world_command.sql @@ -0,0 +1,4 @@ +DELETE FROM `command` WHERE `name` = 'modify arenapoints'; + +INSERT INTO `command` (`name`, `security`, `help`) VALUES +('modify currency', 2, 'Syntax: .modify currency #id #value\nAdd $amount (without precision) of $currency to the selected player.'); diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index 61f90b9d046..dff89821a2a 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -65,11 +65,11 @@ public: { "mount", SEC_MODERATOR, false, &HandleModifyMountCommand, "", NULL }, { "honor", SEC_MODERATOR, false, &HandleModifyHonorCommand, "", NULL }, { "reputation", SEC_GAMEMASTER, false, &HandleModifyRepCommand, "", NULL }, - { "arenapoints", SEC_MODERATOR, false, &HandleModifyArenaCommand, "", NULL }, { "drunk", SEC_MODERATOR, false, &HandleModifyDrunkCommand, "", NULL }, { "standstate", SEC_GAMEMASTER, false, &HandleModifyStandStateCommand, "", NULL }, { "phase", SEC_ADMINISTRATOR, false, &HandleModifyPhaseCommand, "", NULL }, { "gender", SEC_GAMEMASTER, false, &HandleModifyGenderCommand, "", NULL }, + { "currency", SEC_GAMEMASTER, false, &HandleModifyCurrencyCommand, "", NULL }, { "speed", SEC_MODERATOR, false, NULL, "", modifyspeedCommandTable }, { NULL, 0, false, NULL, "", NULL } }; @@ -1308,28 +1308,6 @@ public: return true; } - static bool HandleModifyArenaCommand(ChatHandler* handler, const char* args) - { - if (!*args) - return false; - - Player* target = handler->getSelectedPlayer(); - if (!target) - { - handler->SendSysMessage(LANG_PLAYER_NOT_FOUND); - handler->SetSentErrorMessage(true); - return false; - } - - int32 amount = (uint32)atoi(args); - - target->ModifyCurrency(CURRENCY_TYPE_CONQUEST_POINTS, amount, true, true); - - handler->PSendSysMessage(LANG_COMMAND_MODIFY_ARENA, handler->GetNameLink(target).c_str(), target->GetCurrency(CURRENCY_TYPE_CONQUEST_POINTS, false)); - - return true; - } - static bool HandleModifyGenderCommand(ChatHandler* handler, const char* args) { if (!*args) @@ -1405,6 +1383,33 @@ public: return true; } + + static bool HandleModifyCurrencyCommand(ChatHandler* handler, const char* args) + { + if (!*args) + return false; + + Player* target = handler->getSelectedPlayer(); + if (!target) + { + handler->PSendSysMessage(LANG_PLAYER_NOT_FOUND); + handler->SetSentErrorMessage(true); + return false; + } + + uint32 currencyId = atoi(strtok((char*)args, " ")); + const CurrencyTypesEntry* currencyType = sCurrencyTypesStore.LookupEntry(currencyId); + if (!currencyType) + return false; + + uint32 amount = atoi(strtok(NULL, " ")); + if (!amount) + return false; + + target->ModifyCurrency(currencyId, amount, true, true); + + return true; + } }; void AddSC_modify_commandscript() -- cgit v1.2.3 From 3cf7eb23f9f3d145d91a182669bf3f820e53211c Mon Sep 17 00:00:00 2001 From: Spp Date: Thu, 22 Nov 2012 15:08:28 +0100 Subject: Missing change from merge --- src/server/scripts/EasternKingdoms/hinterlands.cpp | 201 --------------------- 1 file changed, 201 deletions(-) (limited to 'src') diff --git a/src/server/scripts/EasternKingdoms/hinterlands.cpp b/src/server/scripts/EasternKingdoms/hinterlands.cpp index 618491c8c7b..cf4a6f273f9 100644 --- a/src/server/scripts/EasternKingdoms/hinterlands.cpp +++ b/src/server/scripts/EasternKingdoms/hinterlands.cpp @@ -146,207 +146,6 @@ public: }; }; -<<<<<<< HEAD -======= -/*###### -## npc_rinji -######*/ - -enum eRinji -{ - SAY_RIN_BY_OUTRUNNER = 0, - - SAY_RIN_FREE = 0, //from here - SAY_RIN_HELP = 1, - SAY_RIN_COMPLETE = 2, - SAY_RIN_PROGRESS_1 = 3, - SAY_RIN_PROGRESS_2 = 4, - - QUEST_RINJI_TRAPPED = 2742, - NPC_RANGER = 2694, - NPC_OUTRUNNER = 2691, - GO_RINJI_CAGE = 142036 -}; - -struct Location -{ - float m_fX, m_fY, m_fZ; -}; - -Location m_afAmbushSpawn[] = -{ - {191.296204f, -2839.329346f, 107.388f}, - {70.972466f, -2848.674805f, 109.459f} -}; - -Location m_afAmbushMoveTo[] = -{ - {166.630386f, -2824.780273f, 108.153f}, - {70.886589f, -2874.335449f, 116.675f} -}; - -class npc_rinji : public CreatureScript -{ -public: - npc_rinji() : CreatureScript("npc_rinji") { } - - bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) - { - if (quest->GetQuestId() == QUEST_RINJI_TRAPPED) - { - if (GameObject* go = creature->FindNearestGameObject(GO_RINJI_CAGE, INTERACTION_DISTANCE)) - go->UseDoorOrButton(); - - if (npc_rinjiAI* pEscortAI = CAST_AI(npc_rinji::npc_rinjiAI, creature->AI())) - pEscortAI->Start(false, false, player->GetGUID(), quest); - } - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_rinjiAI(creature); - } - - struct npc_rinjiAI : public npc_escortAI - { - npc_rinjiAI(Creature* creature) : npc_escortAI(creature) - { - m_bIsByOutrunner = false; - m_iSpawnId = 0; - } - - bool m_bIsByOutrunner; - uint32 m_uiPostEventCount; - uint32 m_uiPostEventTimer; - int m_iSpawnId; - - void Reset() - { - m_uiPostEventCount = 0; - m_uiPostEventTimer = 3000; - } - - void JustRespawned() - { - m_bIsByOutrunner = false; - m_iSpawnId = 0; - - npc_escortAI::JustRespawned(); - } - - void EnterCombat(Unit* who) - { - if (HasEscortState(STATE_ESCORT_ESCORTING)) - { - if (who->GetEntry() == NPC_OUTRUNNER && !m_bIsByOutrunner) - { - if (Creature* talker = who->ToCreature()) - talker->AI()->Talk(SAY_RIN_BY_OUTRUNNER); - m_bIsByOutrunner = true; - } - - if (rand()%4) - return; - - //only if attacked and escorter is not in combat? - Talk(SAY_RIN_HELP); - } - } - - void DoSpawnAmbush(bool bFirst) - { - if (!bFirst) - m_iSpawnId = 1; - - me->SummonCreature(NPC_RANGER, - m_afAmbushSpawn[m_iSpawnId].m_fX, m_afAmbushSpawn[m_iSpawnId].m_fY, m_afAmbushSpawn[m_iSpawnId].m_fZ, 0.0f, - TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000); - - for (int i = 0; i < 2; ++i) - { - me->SummonCreature(NPC_OUTRUNNER, - m_afAmbushSpawn[m_iSpawnId].m_fX, m_afAmbushSpawn[m_iSpawnId].m_fY, m_afAmbushSpawn[m_iSpawnId].m_fZ, 0.0f, - TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000); - } - } - - void JustSummoned(Creature* summoned) - { - summoned->SetWalk(false); - summoned->GetMotionMaster()->MovePoint(0, m_afAmbushMoveTo[m_iSpawnId].m_fX, m_afAmbushMoveTo[m_iSpawnId].m_fY, m_afAmbushMoveTo[m_iSpawnId].m_fZ); - } - - void WaypointReached(uint32 waypointId) - { - Player* player = GetPlayerForEscort(); - if (!player) - return; - - switch (waypointId) - { - case 1: - Talk(SAY_RIN_FREE, player->GetGUID()); - break; - case 7: - DoSpawnAmbush(true); - break; - case 13: - DoSpawnAmbush(false); - break; - case 17: - Talk(SAY_RIN_COMPLETE, player->GetGUID()); - player->GroupEventHappens(QUEST_RINJI_TRAPPED, me); - SetRun(); - m_uiPostEventCount = 1; - break; - } - } - - void UpdateEscortAI(const uint32 uiDiff) - { - //Check if we have a current target - if (!UpdateVictim()) - { - if (HasEscortState(STATE_ESCORT_ESCORTING) && m_uiPostEventCount) - { - if (m_uiPostEventTimer <= uiDiff) - { - m_uiPostEventTimer = 3000; - - if (Player* player = GetPlayerForEscort()) - { - switch (m_uiPostEventCount) - { - case 1: - Talk(SAY_RIN_PROGRESS_1, player->GetGUID()); - ++m_uiPostEventCount; - break; - case 2: - Talk(SAY_RIN_PROGRESS_2, player->GetGUID()); - m_uiPostEventCount = 0; - break; - } - } - else - { - me->DespawnOrUnsummon(); - return; - } - } - else - m_uiPostEventTimer -= uiDiff; - } - - return; - } - - DoMeleeAttackIfReady(); - } - }; -}; - ->>>>>>> master void AddSC_hinterlands() { new npc_00x09hl(); -- cgit v1.2.3 From 7e69409e65be4da9176ef706f51bcf7ac072e393 Mon Sep 17 00:00:00 2001 From: Tuxity Date: Fri, 23 Nov 2012 11:40:08 +0100 Subject: Core/Arenas: Update enum GroupJoinBattlegroundResult. Closes #8391 Closes #8392 --- src/server/game/Miscellaneous/SharedDefines.h | 44 ++++++++++++++++----------- 1 file changed, 27 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 59ebfa8044e..95ad89392b2 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -3758,23 +3758,33 @@ enum BattlegroundQueueTypeId enum GroupJoinBattlegroundResult { - // positive values are indexes in BattlemasterList.dbc - ERR_GROUP_JOIN_BATTLEGROUND_FAIL = 0, // Your group has joined a battleground queue, but you are not eligible (showed for non existing BattlemasterList.dbc indexes) - ERR_BATTLEGROUND_NONE = -1, // not show anything - ERR_GROUP_JOIN_BATTLEGROUND_DESERTERS = -2, // You cannot join the battleground yet because you or one of your party members is flagged as a Deserter. - ERR_ARENA_TEAM_PARTY_SIZE = -3, // Incorrect party size for this arena. - ERR_BATTLEGROUND_TOO_MANY_QUEUES = -4, // You can only be queued for 2 battles at once - ERR_BATTLEGROUND_CANNOT_QUEUE_FOR_RATED = -5, // You cannot queue for a rated match while queued for other battles - ERR_BATTLEDGROUND_QUEUED_FOR_RATED = -6, // You cannot queue for another battle while queued for a rated arena match - ERR_BATTLEGROUND_TEAM_LEFT_QUEUE = -7, // Your team has left the arena queue - ERR_BATTLEGROUND_NOT_IN_BATTLEGROUND = -8, // You can't do that in a battleground. - ERR_BATTLEGROUND_JOIN_XP_GAIN = -9, // wtf, doesn't exist in client... - ERR_BATTLEGROUND_JOIN_RANGE_INDEX = -10, // Cannot join the queue unless all members of your party are in the same battleground level range. - ERR_BATTLEGROUND_JOIN_TIMED_OUT = -11, // %s was unavailable to join the queue. (uint64 guid exist in client cache) - ERR_BATTLEGROUND_JOIN_FAILED = -12, // Join as a group failed (uint64 guid doesn't exist in client cache) - ERR_LFG_CANT_USE_BATTLEGROUND = -13, // You cannot queue for a battleground or arena while using the dungeon system. - ERR_IN_RANDOM_BG = -14, // Can't do that while in a Random Battleground queue. - ERR_IN_NON_RANDOM_BG = -15 // Can't queue for Random Battleground while in another Battleground queue. + ERR_BATTLEGROUND_NONE = 0, + ERR_GROUP_JOIN_BATTLEGROUND_DESERTERS = 2, // You cannot join the battleground yet because you or one of your party members is flagged as a Deserter. + ERR_ARENA_TEAM_PARTY_SIZE = 3, // Incorrect party size for this arena. + ERR_BATTLEGROUND_TOO_MANY_QUEUES = 4, // You can only be queued for 2 battles at once + ERR_BATTLEGROUND_CANNOT_QUEUE_FOR_RATED = 5, // You cannot queue for a rated match while queued for other battles + ERR_BATTLEDGROUND_QUEUED_FOR_RATED = 6, // You cannot queue for another battle while queued for a rated arena match + ERR_BATTLEGROUND_TEAM_LEFT_QUEUE = 7, // Your team has left the arena queue + ERR_BATTLEGROUND_NOT_IN_BATTLEGROUND = 8, // You can't do that in a battleground. + ERR_BATTLEGROUND_JOIN_XP_GAIN = 9, // wtf, doesn't exist in client... + ERR_BATTLEGROUND_JOIN_RANGE_INDEX = 10, // Cannot join the queue unless all members of your party are in the same battleground level range. + ERR_BATTLEGROUND_JOIN_TIMED_OUT = 11, // %s was unavailable to join the queue. (uint64 guid exist in client cache) + //ERR_BATTLEGROUND_JOIN_TIMED_OUT = 12, // same as 11 + //ERR_BATTLEGROUND_TEAM_LEFT_QUEUE = 13, // same as 7 + ERR_LFG_CANT_USE_BATTLEGROUND = 14, // You cannot queue for a battleground or arena while using the dungeon system. + ERR_IN_RANDOM_BG = 15, // Can't do that while in a Random Battleground queue. + ERR_IN_NON_RANDOM_BG = 16, // Can't queue for Random Battleground while in another Battleground queue. + ERR_BG_DEVELOPER_ONLY = 17, + ERR_BATTLEGROUND_INVITATION_DECLINED = 18, + ERR_MEETING_STONE_NOT_FOUND = 19, + ERR_WARGAME_REQUEST_FAILURE = 20, + ERR_BATTLEFIELD_TEAM_PARTY_SIZE = 22, + ERR_NOT_ON_TOURNAMENT_REALM = 23, + ERR_BATTLEGROUND_PLAYERS_FROM_DIFFERENT_REALMS = 24, + ERR_REMOVE_FROM_PVP_QUEUE_GRANT_LEVEL = 33, + ERR_REMOVE_FROM_PVP_QUEUE_FACTION_CHANGE = 34, + ERR_BATTLEGROUND_JOIN_FAILED = 35, + ERR_BATTLEGROUND_DUPE_QUEUE = 43 }; enum PetNameInvalidReason -- cgit v1.2.3 From 4bb9b13e011631446d190a01f832178d5c7b7409 Mon Sep 17 00:00:00 2001 From: Warpten Date: Sun, 25 Nov 2012 14:01:51 +0100 Subject: Core/Guilds: Handle CMSG_GUILD_SET_GUILD_MASTER. You can now promote any guild member to the GuildMaster rank. Also enable talents inspection and automagically refusing guild invites. --- src/server/game/Guilds/Guild.cpp | 16 ++++++++-------- src/server/game/Guilds/Guild.h | 2 +- src/server/game/Handlers/GuildHandler.cpp | 21 +++++++++------------ src/server/game/Server/Protocol/Opcodes.cpp | 7 +++---- src/server/game/Server/Protocol/Opcodes.h | 1 - src/server/game/Server/WorldSession.h | 2 +- 6 files changed, 22 insertions(+), 27 deletions(-) (limited to 'src') diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 903aac6e983..c91b5746e84 100644 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -1588,20 +1588,20 @@ void Guild::HandleSetEmblem(WorldSession* session, const EmblemInfo& emblemInfo) } } -void Guild::HandleSetLeader(WorldSession* session, std::string const& name) +void Guild::HandleSetNewGuildMaster(WorldSession* session, std::string const& name) { Player* player = session->GetPlayer(); - // Only leader can assign new leader + // Only the guild master can throne a new guild master if (!_IsLeader(player)) SendCommandResult(session, GUILD_COMMAND_CHANGE_LEADER, ERR_GUILD_PERMISSIONS); - // Old leader must be a member of guild - else if (Member* pOldLeader = GetMember(player->GetGUID())) + // Old GM must be a guild member + else if (Member* oldGuildMaster = GetMember(player->GetGUID())) { - // New leader must be a member of guild - if (Member* pNewLeader = GetMember(name)) + // Same for the new one + if (Member* newGuildMaster = GetMember(name)) { - _SetLeaderGUID(pNewLeader); - pOldLeader->ChangeRank(GR_OFFICER); + _SetLeaderGUID(newGuildMaster); + oldGuildMaster->ChangeRank(GR_INITIATE); _BroadcastEvent(GE_LEADER_CHANGED, 0, player->GetName().c_str(), name.c_str()); } } diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h index 2b1ec24c7d5..1122889dc84 100755 --- a/src/server/game/Guilds/Guild.h +++ b/src/server/game/Guilds/Guild.h @@ -774,7 +774,7 @@ public: void HandleSetMOTD(WorldSession* session, std::string const& motd); void HandleSetInfo(WorldSession* session, std::string const& info); void HandleSetEmblem(WorldSession* session, const EmblemInfo& emblemInfo); - void HandleSetLeader(WorldSession* session, std::string const& name); + void HandleSetNewGuildMaster(WorldSession* session, std::string const& name); void HandleSetBankTabInfo(WorldSession* session, uint8 tabId, std::string const& name, std::string const& icon); void HandleSetMemberNote(WorldSession* session, std::string const& note, uint64 guid, bool isPublic); void HandleSetRankInfo(WorldSession* session, uint8 rankId, std::string const& name, uint32 rights, uint32 moneyPerDay, GuildBankRightsAndSlotsVec rightsAndSlots); diff --git a/src/server/game/Handlers/GuildHandler.cpp b/src/server/game/Handlers/GuildHandler.cpp index f97216f2169..22f8513870c 100755 --- a/src/server/game/Handlers/GuildHandler.cpp +++ b/src/server/game/Handlers/GuildHandler.cpp @@ -229,18 +229,6 @@ void WorldSession::HandleGuildDisbandOpcode(WorldPacket& /*recvPacket*/) guild->HandleDisband(this); } -void WorldSession::HandleGuildLeaderOpcode(WorldPacket& recvPacket) -{ - std::string name; - recvPacket >> name; - - sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_LEADER [%s]: Target: %s", GetPlayerInfo().c_str(), name.c_str()); - - if (normalizePlayerName(name)) - if (Guild* guild = GetPlayer()->GetGuild()) - guild->HandleSetLeader(this, name); -} - void WorldSession::HandleGuildMOTDOpcode(WorldPacket& recvPacket) { uint32 motdLength = recvPacket.ReadBits(11); @@ -825,3 +813,12 @@ void WorldSession::HandleGuildNewsUpdateStickyOpcode(WorldPacket& recvPacket) if (Guild* guild = GetPlayer()->GetGuild()) guild->HandleNewsSetSticky(this, newsId, sticky); } + +void WorldSession::HandleGuildSetGuildMaster(WorldPacket& recvPacket) +{ + uint8 nameLength; + recvPacket >> nameLength; + std::string playerName = recvPacket.ReadString(nameLength); + if (Guild* guild = GetPlayer()->GetGuild()) + guild->HandleSetNewGuildMaster(this, playerName); +} diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 1933638dd7d..d02149f2840 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -95,7 +95,7 @@ void OpcodeTable::Initialize() DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_BAG_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoStoreBagItemOpcode ); DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_BANK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoStoreBankItemOpcode ); DEFINE_OPCODE_HANDLER(CMSG_AUTOSTORE_LOOT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutostoreLootItemOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_AUTO_DECLINE_GUILD_INVITES, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleAutoDeclineGuildInvites ); + DEFINE_OPCODE_HANDLER(CMSG_AUTO_DECLINE_GUILD_INVITES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoDeclineGuildInvites ); DEFINE_OPCODE_HANDLER(CMSG_BANKER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBankerActivateOpcode ); DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_LEAVE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleBattlefieldLeaveOpcode ); DEFINE_OPCODE_HANDLER(CMSG_BATTLEFIELD_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBattlefieldListOpcode ); @@ -279,7 +279,7 @@ void OpcodeTable::Initialize() DEFINE_OPCODE_HANDLER(CMSG_GUILD_REQUEST_PARTY_STATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildRequestPartyState ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_ROSTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildRosterOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_SET_ACHIEVEMENT_TRACKING, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(CMSG_GUILD_SET_GUILD_MASTER, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(CMSG_GUILD_SET_GUILD_MASTER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildSetGuildMaster ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_SET_NOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildSetNoteOpcode ); DEFINE_OPCODE_HANDLER(CMSG_GUILD_SET_RANK_PERMISSIONS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildSetRankPermissionsOpcode); DEFINE_OPCODE_HANDLER(CMSG_GUILD_SWITCH_RANK, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -900,7 +900,7 @@ void OpcodeTable::Initialize() DEFINE_OPCODE_HANDLER(SMSG_INSPECT_HONOR_STATS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_INSPECT_RATED_BG_STATS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_INSPECT_RESULTS_UPDATE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_INSPECT_TALENT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_INSPECT_TALENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_LOCK_WARNING_QUERY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_RESET, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_INSTANCE_RESET_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1415,7 +1415,6 @@ void OpcodeTable::Initialize() //DEFINE_OPCODE_HANDLER(CMSG_GUILD_BANK_NOTE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_CREATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildCreateOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_GUILD_INFO, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildInfoOpcode ); - //DEFINE_OPCODE_HANDLER(CMSG_GUILD_LEADER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGuildLeaderOpcode ); //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_DIMINISHING_RETURNS_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_KNOCKBACK_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_IGNORE_REQUIREMENTS_CHEAT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index f1159ec6d5c..be0b8ad4d89 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -259,7 +259,6 @@ enum Opcodes CMSG_GUILD_INFO = 0x0000, CMSG_GUILD_INFO_TEXT = 0x3227, CMSG_GUILD_INVITE = 0x24B0, - CMSG_GUILD_LEADER = 0x0000, CMSG_GUILD_LEAVE = 0x1021, CMSG_GUILD_MEMBER_SEND_SOR_REQUEST = 0x3225, CMSG_GUILD_MOTD = 0x1035, diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index eecbbc56368..fccb60bf472 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -549,7 +549,7 @@ class WorldSession void HandleGuildAssignRankOpcode(WorldPacket& recvPacket); void HandleGuildLeaveOpcode(WorldPacket& recvPacket); void HandleGuildDisbandOpcode(WorldPacket& recvPacket); - void HandleGuildLeaderOpcode(WorldPacket& recvPacket); + void HandleGuildSetGuildMaster(WorldPacket& recvPacket); void HandleGuildMOTDOpcode(WorldPacket& recvPacket); void HandleGuildNewsUpdateStickyOpcode(WorldPacket& recvPacket); void HandleGuildSetNoteOpcode(WorldPacket& recvPacket); -- cgit v1.2.3 From f01f695c7d31e0db9e4f36af406964598653aad7 Mon Sep 17 00:00:00 2001 From: Warpten Date: Sun, 25 Nov 2012 21:07:08 +0100 Subject: Core/Spells: Fixed Leap of Faith and renamed a spell script to match standards. --- .../world/2012_11_25_world_spell_script_names.sql | 9 ++++ src/server/scripts/Spells/spell_priest.cpp | 59 +++++++++++++++++++--- 2 files changed, 61 insertions(+), 7 deletions(-) create mode 100644 sql/updates/world/2012_11_25_world_spell_script_names.sql (limited to 'src') diff --git a/sql/updates/world/2012_11_25_world_spell_script_names.sql b/sql/updates/world/2012_11_25_world_spell_script_names.sql new file mode 100644 index 00000000000..f0dd277cc96 --- /dev/null +++ b/sql/updates/world/2012_11_25_world_spell_script_names.sql @@ -0,0 +1,9 @@ +DELETE FROM spell_linked_spell WHERE spell_trigger = 73325; +INSERT INTO spell_linked_spell (spell_trigger, spell_effect, type, comment) VALUES +(73325, 92833, 0, "Priest - Leap of Faith"); + +DELETE FROM spell_script_names WHERE spell_id = 92833; +DELETE FROM spell_script_names WHERE spell_id = -139; +INSERT INTO spell_script_names (spell_id, ScriptName) VALUES +(92833, "spell_pri_leap_of_faith_effect_trigger"), +(139, "spell_pri_renew"); -- Minus doesnt matter, theres no rank any more diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index 01598f12166..999140dd073 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -43,6 +43,10 @@ enum PriestSpells PRIEST_SHADOWFORM_VISUAL_WITHOUT_GLYPH = 107903, PRIEST_SHADOWFORM_VISUAL_WITH_GLYPH = 107904, PRIEST_GLYPH_OF_SHADOW = 107906, + PRIEST_LEAP_OF_FAITH = 73325, + PRIEST_LEAP_OF_FAITH_TRIGGERED = 92572, + PRIEST_LEAP_OF_FAITH_EFFECT_TRIGGER = 92833, + PRIEST_LEAP_OF_FAITH_EFFECT = 92832 }; // Guardian Spirit @@ -102,6 +106,45 @@ class spell_pri_guardian_spirit : public SpellScriptLoader } }; +class spell_pri_leap_of_faith_effect_trigger : public SpellScriptLoader +{ +public: + spell_pri_leap_of_faith_effect_trigger() : SpellScriptLoader("spell_pri_leap_of_faith_effect_trigger") { } + + class spell_pri_leap_of_faith_effect_trigger_SpellScript : public SpellScript + { + PrepareSpellScript(spell_pri_leap_of_faith_effect_trigger_SpellScript); + + bool Validate(SpellInfo const* /*entry*/) + { + if (!sSpellMgr->GetSpellInfo(PRIEST_LEAP_OF_FAITH_EFFECT)) + return false; + return true; + } + + void HandleEffectDummy(SpellEffIndex /*effIndex*/) + { + Position destPos; + GetHitDest()->GetPosition(&destPos); + + SpellCastTargets targets; + targets.SetDst(destPos); + targets.SetUnitTarget(GetCaster()); + GetHitUnit()->CastSpell(targets, sSpellMgr->GetSpellInfo(GetEffectValue()), NULL); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_pri_leap_of_faith_effect_trigger_SpellScript::HandleEffectDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_pri_leap_of_faith_effect_trigger_SpellScript(); + } +}; + class spell_pri_mana_burn : public SpellScriptLoader { public: @@ -303,6 +346,7 @@ enum PrayerOfMending { SPELL_T9_HEALING_2_PIECE = 67201, }; + // Prayer of Mending Heal class spell_pri_prayer_of_mending_heal : public SpellScriptLoader { @@ -379,14 +423,14 @@ class spell_pri_vampiric_touch : public SpellScriptLoader } }; -class spell_priest_renew : public SpellScriptLoader +class spell_pri_renew : public SpellScriptLoader { public: - spell_priest_renew() : SpellScriptLoader("spell_priest_renew") { } + spell_pri_renew() : SpellScriptLoader("spell_pri_renew") { } - class spell_priest_renew_AuraScript : public AuraScript + class spell_pri_renew_AuraScript : public AuraScript { - PrepareAuraScript(spell_priest_renew_AuraScript); + PrepareAuraScript(spell_pri_renew_AuraScript); bool Load() { @@ -411,13 +455,13 @@ class spell_priest_renew : public SpellScriptLoader void Register() { - OnEffectApply += AuraEffectApplyFn(spell_priest_renew_AuraScript::HandleApplyEffect, EFFECT_0, SPELL_AURA_PERIODIC_HEAL, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + OnEffectApply += AuraEffectApplyFn(spell_pri_renew_AuraScript::HandleApplyEffect, EFFECT_0, SPELL_AURA_PERIODIC_HEAL, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); } }; AuraScript* GetAuraScript() const { - return new spell_priest_renew_AuraScript(); + return new spell_pri_renew_AuraScript(); } }; @@ -496,6 +540,7 @@ class spell_pri_shadowform : public SpellScriptLoader void AddSC_priest_spell_scripts() { new spell_pri_guardian_spirit(); + new spell_pri_leap_of_faith_effect_trigger(); new spell_pri_mana_burn(); new spell_pri_pain_and_suffering_proc(); new spell_pri_penance(); @@ -503,7 +548,7 @@ void AddSC_priest_spell_scripts() new spell_pri_mind_sear(); new spell_pri_prayer_of_mending_heal(); new spell_pri_vampiric_touch(); - new spell_priest_renew(); + new spell_pri_renew(); new spell_pri_shadow_word_death(); new spell_pri_shadowform(); } -- cgit v1.2.3 From 99e050fb271697ded6bf649c3173e7d04a196a74 Mon Sep 17 00:00:00 2001 From: Spp Date: Tue, 27 Nov 2012 11:56:23 +0100 Subject: Core/Misc: Tab2spaces, remove trailing whitespaces and remove dupe code after merge --- src/server/game/Battlefield/Battlefield.cpp | 14 +++++++------- src/server/game/Battlefield/Battlefield.h | 4 ++-- src/server/game/Battlefield/Zones/BattlefieldWG.h | 2 +- src/server/game/Entities/Creature/Creature.cpp | 3 --- src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp | 2 +- .../scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp | 2 +- .../ScarletMonastery/boss_headless_horseman.cpp | 2 +- .../EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp | 2 +- .../EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp | 2 +- 9 files changed, 15 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/server/game/Battlefield/Battlefield.cpp b/src/server/game/Battlefield/Battlefield.cpp index b0ad965f310..6431f8a3479 100644 --- a/src/server/game/Battlefield/Battlefield.cpp +++ b/src/server/game/Battlefield/Battlefield.cpp @@ -918,7 +918,7 @@ bool BfCapturePoint::HandlePlayerEnter(Player* player) player->SendUpdateWorldState(capturePoint->GetGOInfo()->capturePoint.worldstate3, m_neutralValuePct); } } - + return m_activePlayers[player->GetTeamId()].insert(player->GetGUID()).second; } @@ -941,7 +941,7 @@ void BfCapturePoint::SendChangePhase() { if (!m_capturePointGUID) return; - + if (GameObject* capturePoint = m_Bf->GetGameObject(m_capturePointGUID)) { // send this too, sometimes the slider disappears, dunno why :( @@ -989,9 +989,9 @@ bool BfCapturePoint::SetCapturePointData(GameObject* capturePoint) return true; } -GameObject* BfCapturePoint::GetCapturePointGo() -{ - return m_Bf->GetGameObject(m_capturePointGUID); +GameObject* BfCapturePoint::GetCapturePointGo() +{ + return m_Bf->GetGameObject(m_capturePointGUID); } bool BfCapturePoint::DelCapturePoint() @@ -1039,13 +1039,13 @@ bool BfCapturePoint::Update(uint32 diff) Trinity::AnyPlayerInObjectRangeCheck checker(capturePoint, radius); Trinity::PlayerListSearcher searcher(capturePoint, players, checker); capturePoint->VisitNearbyWorldObject(radius, searcher); - + for (std::list::iterator itr = players.begin(); itr != players.end(); ++itr) if ((*itr)->IsOutdoorPvPActive()) if (m_activePlayers[(*itr)->GetTeamId()].insert((*itr)->GetGUID()).second) HandlePlayerEnter(*itr); } - + // get the difference of numbers float fact_diff = ((float) m_activePlayers[0].size() - (float) m_activePlayers[1].size()) * diff / BATTLEFIELD_OBJECTIVE_UPDATE_INTERVAL; if (G3D::fuzzyEq(fact_diff, 0.0f)) diff --git a/src/server/game/Battlefield/Battlefield.h b/src/server/game/Battlefield/Battlefield.h index f17a7666d67..cccdf320d89 100644 --- a/src/server/game/Battlefield/Battlefield.h +++ b/src/server/game/Battlefield/Battlefield.h @@ -106,7 +106,7 @@ class BfCapturePoint bool SetCapturePointData(GameObject* capturePoint); GameObject* GetCapturePointGo(); uint32 GetCapturePointEntry(){ return m_capturePointEntry; } - + TeamId GetTeamId() { return m_team; } protected: bool DelCapturePoint(); @@ -294,7 +294,7 @@ class Battlefield : public ZoneScript Creature* GetCreature(uint64 GUID); GameObject* GetGameObject(uint64 GUID); - + // Script-methods /// Called on start diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.h b/src/server/game/Battlefield/Zones/BattlefieldWG.h index 73ec858e965..0ac87af94ba 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldWG.h +++ b/src/server/game/Battlefield/Zones/BattlefieldWG.h @@ -1201,7 +1201,7 @@ struct BfWGGameObjectBuilding { if (!go) return; - + // GameObject associated to object m_BuildGUID = go->GetGUID(); diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 458b4ea7706..41d48cbfc02 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -1721,9 +1721,6 @@ SpellInfo const* Creature::reachWithSpellAttack(Unit* victim) if (bcontinue) continue; - if (bcontinue) - continue; - if (spellInfo->ManaCost > (uint32)GetPower(POWER_MANA)) continue; float range = spellInfo->GetMaxRange(false); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp index 660b8f6c460..da6fdb2d0e3 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp @@ -226,7 +226,7 @@ public: if (text) CreatureAI::Talk(text); - + } void PrepareEncounter() diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp index 78fc8d127b2..1bfcb4adf6a 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp @@ -171,7 +171,7 @@ public: ++speechCounter; DoCastAOE(SPELL_THREAT_PULSE, true); - } else + } else speechTimer -= diff; return; diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp index 5bedf1e99b2..5422d3812f1 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp @@ -34,7 +34,7 @@ EndScriptData */ //this texts are already used by 3975 and 3976 enum Says { - SAY_LOST_HEAD = 0, + SAY_LOST_HEAD = 0, SAY_PLAYER_DEATH = 1, SAY_ENTRANCE = 0, diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp index c7db80c7f22..c2dc7123f6d 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp @@ -54,7 +54,7 @@ enum Spells AURA_SPECTRAL_REALM = 46021, AURA_SPECTRAL_INVISIBILITY = 44801, AURA_DEMONIC_VISUAL = 44800, - + SPELL_SPECTRAL_BLAST = 44869, SPELL_TELEPORT_SPECTRAL = 46019, SPELL_ARCANE_BUFFET = 45018, diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp index 814588fdf68..4c724c1c1a1 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp @@ -34,7 +34,7 @@ EndScriptData */ enum Yells { SAY_KJ_OFFCOMBAT = 0, - + SAY_KALECGOS_ENCOURAGE = 0, SAY_KALECGOS_READY1 = 1, SAY_KALECGOS_READY2 = 2, -- cgit v1.2.3 From aab59442a45b1396edfd508f2ad0d7cf36484ba7 Mon Sep 17 00:00:00 2001 From: Spp Date: Tue, 27 Nov 2012 15:06:40 +0100 Subject: Fix merge error --- src/server/game/Reputation/ReputationMgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Reputation/ReputationMgr.cpp b/src/server/game/Reputation/ReputationMgr.cpp index d16f419defe..218582f5678 100644 --- a/src/server/game/Reputation/ReputationMgr.cpp +++ b/src/server/game/Reputation/ReputationMgr.cpp @@ -199,7 +199,7 @@ void ReputationMgr::SendState(FactionState const* faction) void ReputationMgr::SendInitialReputations() { - uint8 count = 256; + uint16 count = 256; WorldPacket data(SMSG_INITIALIZE_FACTIONS, 4 + count * 5); data << uint32(count); -- cgit v1.2.3 From 8b555ffa9f817f69bcd32298b7b660c2d6d53183 Mon Sep 17 00:00:00 2001 From: QT Date: Tue, 27 Nov 2012 09:27:38 -0700 Subject: Move _ApplyAllLevelScaleItemMods to above SetFullHealth so player will have full health regardless of heirlooms equipped (blizzlike) --- src/server/game/Entities/Player/Player.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index f26769001c9..170582755b3 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -3179,6 +3179,8 @@ void Player::GiveLevel(uint8 level) if (sWorld->getBoolConfig(CONFIG_ALWAYS_MAXSKILL)) // Max weapon skill when leveling up UpdateSkillsToMaxSkillsForLevel(); + _ApplyAllLevelScaleItemMods(true); // Moved to above SetFullHealth so player will have full health from Heirlooms + // set current level health and mana/energy to maximum after applying all mods. SetFullHealth(); SetPower(POWER_MANA, GetMaxPower(POWER_MANA)); @@ -3187,8 +3189,6 @@ void Player::GiveLevel(uint8 level) SetPower(POWER_RAGE, GetMaxPower(POWER_RAGE)); SetPower(POWER_FOCUS, 0); - _ApplyAllLevelScaleItemMods(true); - // update level to hunter/summon pet if (Pet* pet = GetPet()) pet->SynchronizeLevelWithOwner(); -- cgit v1.2.3 From c33e366eff37fd7663a6d1fc1fc117c57bcce086 Mon Sep 17 00:00:00 2001 From: Warpten Date: Sat, 1 Dec 2012 13:59:40 +0100 Subject: Core/Players: Fixed "Your talents have been reset" at login. Reason behind this is that when you are not specced your talents field in database is "0 0". However, zero is an invalid talent tree ID. As such, ignore it. --- src/server/game/Entities/Player/Player.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 170582755b3..ee9b63eb364 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -17337,7 +17337,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) uint32 talentTree = atol(talentTrees[i]); if (sTalentTabStore.LookupEntry(talentTree)) SetPrimaryTalentTree(i, talentTree); - else if (i == GetActiveSpec()) + else if (i == GetActiveSpec() && talentTree != 0) SetAtLoginFlag(AT_LOGIN_RESET_TALENTS); // invalid tree, reset talents } -- cgit v1.2.3 From fc6c93d0c4dc15f06c60619fb96a395589d8e67d Mon Sep 17 00:00:00 2001 From: Warpten Date: Sat, 1 Dec 2012 14:00:08 +0100 Subject: Core/Guilds: Fixed one mistake in CMSG_GUILD_SET_GUILD_MASTER's handling, thanks to @Shauren for pointing it out. --- src/server/game/Handlers/GuildHandler.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/GuildHandler.cpp b/src/server/game/Handlers/GuildHandler.cpp index 22f8513870c..8a2f9d9d39a 100644 --- a/src/server/game/Handlers/GuildHandler.cpp +++ b/src/server/game/Handlers/GuildHandler.cpp @@ -816,8 +816,9 @@ void WorldSession::HandleGuildNewsUpdateStickyOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildSetGuildMaster(WorldPacket& recvPacket) { - uint8 nameLength; - recvPacket >> nameLength; + uint8 nameLength = recvPacket.ReadBits(7); + // This is related to guild master inactivity. + /*bool isDethrone = */recvPacket.ReadBit(); std::string playerName = recvPacket.ReadString(nameLength); if (Guild* guild = GetPlayer()->GetGuild()) guild->HandleSetNewGuildMaster(this, playerName); -- cgit v1.2.3 From 4d111c10f0389b0fc762e58df0fb7003fb4ec11e Mon Sep 17 00:00:00 2001 From: Warpten Date: Sat, 1 Dec 2012 14:58:56 +0100 Subject: Scripts/Spells: Fixed Rogue's Recuperate, Mage's Conjure Refreshment and Paladin's Sacred Shield. Also fixed SQL file naming. --- .../2012_11_25_02_world_spell_script_names.sql | 9 +++ .../world/2012_11_25_world_spell_script_names.sql | 9 --- .../2012_12_01_00_world_spell_script_names.sql | 16 +++++ src/server/scripts/Spells/spell_mage.cpp | 70 ++++++++++++++++++++++ src/server/scripts/Spells/spell_paladin.cpp | 40 ++++++++++++- src/server/scripts/Spells/spell_rogue.cpp | 53 +++++++++++++++- 6 files changed, 184 insertions(+), 13 deletions(-) create mode 100644 sql/updates/world/2012_11_25_02_world_spell_script_names.sql delete mode 100644 sql/updates/world/2012_11_25_world_spell_script_names.sql create mode 100644 sql/updates/world/2012_12_01_00_world_spell_script_names.sql (limited to 'src') diff --git a/sql/updates/world/2012_11_25_02_world_spell_script_names.sql b/sql/updates/world/2012_11_25_02_world_spell_script_names.sql new file mode 100644 index 00000000000..f0dd277cc96 --- /dev/null +++ b/sql/updates/world/2012_11_25_02_world_spell_script_names.sql @@ -0,0 +1,9 @@ +DELETE FROM spell_linked_spell WHERE spell_trigger = 73325; +INSERT INTO spell_linked_spell (spell_trigger, spell_effect, type, comment) VALUES +(73325, 92833, 0, "Priest - Leap of Faith"); + +DELETE FROM spell_script_names WHERE spell_id = 92833; +DELETE FROM spell_script_names WHERE spell_id = -139; +INSERT INTO spell_script_names (spell_id, ScriptName) VALUES +(92833, "spell_pri_leap_of_faith_effect_trigger"), +(139, "spell_pri_renew"); -- Minus doesnt matter, theres no rank any more diff --git a/sql/updates/world/2012_11_25_world_spell_script_names.sql b/sql/updates/world/2012_11_25_world_spell_script_names.sql deleted file mode 100644 index f0dd277cc96..00000000000 --- a/sql/updates/world/2012_11_25_world_spell_script_names.sql +++ /dev/null @@ -1,9 +0,0 @@ -DELETE FROM spell_linked_spell WHERE spell_trigger = 73325; -INSERT INTO spell_linked_spell (spell_trigger, spell_effect, type, comment) VALUES -(73325, 92833, 0, "Priest - Leap of Faith"); - -DELETE FROM spell_script_names WHERE spell_id = 92833; -DELETE FROM spell_script_names WHERE spell_id = -139; -INSERT INTO spell_script_names (spell_id, ScriptName) VALUES -(92833, "spell_pri_leap_of_faith_effect_trigger"), -(139, "spell_pri_renew"); -- Minus doesnt matter, theres no rank any more diff --git a/sql/updates/world/2012_12_01_00_world_spell_script_names.sql b/sql/updates/world/2012_12_01_00_world_spell_script_names.sql new file mode 100644 index 00000000000..bd13cb8ef9d --- /dev/null +++ b/sql/updates/world/2012_12_01_00_world_spell_script_names.sql @@ -0,0 +1,16 @@ +-- Conjure Refreshment +DELETE FROM `spell_script_names` WHERE `spell_id`=42955; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(42955, 'spell_mage_conjure_refreshment'); + +-- Sacred Shield +DELETE FROM spell_proc_event WHERE entry=85285; +INSERT INTO spell_proc_event (entry, Cooldown) VALUES(85285, 60); +DELETE FROM spell_script_names WHERE spell_id=85285; +INSERT INTO spell_script_names (spell_id, ScriptName) VALUES +(85285, 'spell_pal_sacred_shield'); + +-- Recuperate +DELETE FROM spell_script_names WHERE spell_id=73651; +INSERT INTO spell_script_names (spell_id, ScriptName) VALUES +(73651, "spell_rog_recuperate"); diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index 1d94cb6caf8..da020d944e8 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -39,6 +39,7 @@ enum MageSpells SPELL_MAGE_SUMMON_WATER_ELEMENTAL_PERMANENT = 70908, SPELL_MAGE_SUMMON_WATER_ELEMENTAL_TEMPORARY = 70907, SPELL_MAGE_GLYPH_OF_BLAST_WAVE = 62126, + SPELL_MAGE_CONJURE_REFRESHMENT = 42955, }; class spell_mage_blast_wave : public SpellScriptLoader @@ -423,6 +424,75 @@ public: } }; +struct ConjureRefreshmentData +{ + uint32 minLevel; + uint32 maxLevel; + uint32 spellId; +}; + +uint8 const MAX_CONJURE_REFRESHMENT_SPELLS = 7; +const ConjureRefreshmentData _conjureData[MAX_CONJURE_REFRESHMENT_SPELLS] = +{ + { 33, 43, 92739 }, + { 44, 53, 92799 }, + { 54, 63, 92802 }, + { 64, 73, 92805 }, + { 74, 79, 74625 }, + { 80, 84, 92822 }, + { 85, 85, 92727 } +}; + +class spell_mage_conjure_refreshment : public SpellScriptLoader +{ + public: + spell_mage_conjure_refreshment() : SpellScriptLoader("spell_mage_conjure_refreshment") { } + + class spell_mage_conjure_refreshment_SpellScript : public SpellScript + { + PrepareSpellScript(spell_mage_conjure_refreshment_SpellScript); + + bool Validate(SpellInfo const* /*spellEntry*/) + { + for (uint8 i = 0; i < MAX_CONJURE_REFRESHMENT_SPELLS; ++i) + if (!sSpellMgr->GetSpellInfo(_conjureData[i].spellId)) + return false; + return true; + } + + bool Load() + { + if (GetCaster()->GetTypeId() != TYPEID_PLAYER) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + uint8 level = GetHitUnit()->getLevel(); + for (uint8 i = 0; i < MAX_CONJURE_REFRESHMENT_SPELLS; ++i) + { + ConjureRefreshmentData const& spellData = _conjureData[i]; + if (level < spellData.minLevel || level > spellData.maxLevel) + continue; + GetHitUnit()->CastSpell(GetHitUnit(), spellData.spellId); + break; + } + } + + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_mage_conjure_refreshment_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_mage_conjure_refreshment_SpellScript(); + } +}; + void AddSC_mage_spell_scripts() { new spell_mage_blast_wave(); diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index 2a3fcd88778..3faa4cebe23 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -668,19 +668,53 @@ class spell_pal_divine_sacrifice : public SpellScriptLoader } }; +class spell_pal_sacred_shield : public SpellScriptLoader +{ + public: + spell_pal_sacred_shield() : SpellScriptLoader("spell_pal_sacred_shield") { } + + class spell_pal_sacred_shield_SpellScript : public SpellScript + { + PrepareSpellScript(spell_pal_sacred_shield_SpellScript); + + SpellCastResult CheckCast() + { + Unit* caster = GetCaster(); + if (caster->GetTypeId() != TYPEID_PLAYER) + return SPELL_FAILED_DONT_REPORT; + + if (!caster->HealthBelowPct(30)) + return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; + + return SPELL_CAST_OK; + } + + void Register() + { + OnCheckCast += SpellCheckCastFn(spell_pal_sacred_shield_SpellScript::CheckCast); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_pal_sacred_shield_SpellScript(); + } +}; + void AddSC_paladin_spell_scripts() { //new spell_pal_ardent_defender(); new spell_pal_blessing_of_faith(); new spell_pal_blessing_of_sanctuary(); + new spell_pal_divine_sacrifice(); + new spell_pal_exorcism_and_holy_wrath_damage(); new spell_pal_guarded_by_the_light(); + new spell_pal_hand_of_sacrifice(); new spell_pal_holy_shock(); new spell_pal_judgement_of_command(); new spell_pal_divine_storm(); new spell_pal_divine_storm_dummy(); new spell_pal_lay_on_hands(); new spell_pal_righteous_defense(); - new spell_pal_exorcism_and_holy_wrath_damage(); - new spell_pal_hand_of_sacrifice(); - new spell_pal_divine_sacrifice(); + new spell_pal_sacred_shield(); } diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp index 39f23fc0516..ee0dd44f008 100644 --- a/src/server/scripts/Spells/spell_rogue.cpp +++ b/src/server/scripts/Spells/spell_rogue.cpp @@ -26,12 +26,14 @@ #include "SpellScript.h" #include "SpellAuraEffects.h" -enum RogueSpells +enum RogueData { ROGUE_SPELL_SHIV_TRIGGERED = 5940, ROGUE_SPELL_GLYPH_OF_PREPARATION = 56819, ROGUE_SPELL_PREY_ON_THE_WEAK = 58670, ROGUE_SPELL_CHEAT_DEATH_COOLDOWN = 31231, + + ROGUE_ICON_IMPROVED_RECUPERATE = 4819 }; // Cheat Death @@ -418,12 +420,61 @@ class spell_rog_shadowstep : public SpellScriptLoader } }; +class spell_rog_recuperate : public SpellScriptLoader +{ + public: + spell_rog_recuperate() : SpellScriptLoader("spell_rog_recuperate") { } + + class spell_rog_recuperate_AuraScript : public AuraScript + { + PrepareAuraScript(spell_rog_recuperate_AuraScript); + + bool Load() + { + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } + + void OnPeriodic(AuraEffect const* /*aurEff*/) + { + if (Unit* caster = GetCaster()) + if (AuraEffect* effect = GetAura()->GetEffect(EFFECT_0)) + effect->RecalculateAmount(caster); + } + + void CalculateBonus(AuraEffect const* /*aurEff*/, int32& amount, bool& canBeRecalculated) + { + canBeRecalculated = false; + if (Unit* caster = GetCaster()) + { + int32 baseAmount = GetSpellInfo()->Effects[EFFECT_0].CalcValue(caster) * 1000; + // Improved Recuperate + if (AuraEffect const* auraEffect = caster->GetDummyAuraEffect(SPELLFAMILY_ROGUE, ROGUE_ICON_IMPROVED_RECUPERATE, EFFECT_0)) + baseAmount += auraEffect->GetAmount(); + + amount = CalculatePct(caster->GetMaxHealth(), float(baseAmount) / 1000.0f); + } + } + + void Register() + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_rog_recuperate_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_HEAL); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_rog_recuperate_AuraScript::CalculateBonus, EFFECT_0, SPELL_AURA_PERIODIC_HEAL); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_rog_recuperate_AuraScript(); + } +}; + void AddSC_rogue_spell_scripts() { new spell_rog_cheat_death(); new spell_rog_nerves_of_steel(); new spell_rog_preparation(); new spell_rog_prey_on_the_weak(); + new spell_rog_recuperate(); new spell_rog_shiv(); new spell_rog_deadly_poison(); new spell_rog_shadowstep(); -- cgit v1.2.3 From 4449434d62521e49f56a9e44cb9cf0457fa83023 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 2 Dec 2012 01:04:19 +0100 Subject: Core/Items: Corrected armor calculations, thanks Flemzard Closes #8530 --- src/server/game/Globals/ObjectMgr.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 3b043368186..7ca6602eace 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -2110,8 +2110,8 @@ uint32 FillItemArmor(uint32 itemlevel, uint32 itemClass, uint32 itemSubclass, ui if (itemClass != ITEM_CLASS_ARMOR || itemSubclass != ITEM_SUBCLASS_ARMOR_SHIELD) { ItemArmorQualityEntry const* armorQuality = sItemArmorQualityStore.LookupEntry(itemlevel); - ItemArmorTotalEntry const* armorToral = sItemArmorTotalStore.LookupEntry(itemlevel); - if (!armorQuality || !armorToral) + ItemArmorTotalEntry const* armorTotal = sItemArmorTotalStore.LookupEntry(itemlevel); + if (!armorQuality || !armorTotal) return 0; if (inventoryType == INVTYPE_ROBE) @@ -2124,7 +2124,7 @@ uint32 FillItemArmor(uint32 itemlevel, uint32 itemClass, uint32 itemSubclass, ui if (itemSubclass < ITEM_SUBCLASS_ARMOR_CLOTH) return 0; - return uint32(armorQuality->Value[quality] * armorToral->Value[quality] * location->Value[itemSubclass - 1] + 0.5f); + return uint32(armorQuality->Value[quality] * armorTotal->Value[itemSubclass - 1] * location->Value[itemSubclass - 1] + 0.5f); } // shields -- cgit v1.2.3 From e6c763f4337cfe4ab673bb17b6d0c24c9dae1c60 Mon Sep 17 00:00:00 2001 From: Warpten Date: Fri, 7 Dec 2012 17:29:31 +0100 Subject: Core/Spells: Fixed multiple spell effects where RadiusEntry is NULL but where MaxRadiusEntry is a valid radius entry. Also fixed COD and money being swapped when sending mails, and another typo when sending battleground log data. --- src/server/game/Battlegrounds/BattlegroundMgr.cpp | 19 +++++++++---------- src/server/game/Handlers/MailHandler.cpp | 2 +- src/server/game/Spells/SpellInfo.cpp | 14 ++++++++++++++ src/server/game/Spells/SpellInfo.h | 2 ++ src/server/scripts/Spells/spell_mage.cpp | 3 ++- 5 files changed, 28 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index 79c4f1accab..362c4e3fb65 100644 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -403,7 +403,7 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg) data->WriteBit(playerGUID[5]); data->WriteBit(playerGUID[1]); data->WriteBit(playerGUID[6]); - data->WriteBit(player->GetTeam() == ALLIANCE); + data->WriteBit(player->GetBGTeam() == ALLIANCE); data->WriteBit(playerGUID[7]); buff << uint32(itr->second->HealingDone); // healing done @@ -444,7 +444,7 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg) break; case 529: data->WriteBits(0x00000002, 24); - buff << uint32(((BattlegroundABScore*)itr->second)->BasesAssaulted); // bases asssulted + buff << uint32(((BattlegroundABScore*)itr->second)->BasesAssaulted); // bases assaulted buff << uint32(((BattlegroundABScore*)itr->second)->BasesDefended); // bases defended break; case 30: @@ -462,7 +462,7 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg) break; case 628: // IC data->WriteBits(0x00000002, 24); - buff << uint32(((BattlegroundICScore*)itr->second)->BasesAssaulted); // bases asssulted + buff << uint32(((BattlegroundICScore*)itr->second)->BasesAssaulted); // bases assaulted buff << uint32(((BattlegroundICScore*)itr->second)->BasesDefended); // bases defended break; case 726: @@ -472,7 +472,7 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg) break; case 761: data->WriteBits(0x00000002, 24); - buff << uint32(((BattlegroundBFGScore*)itr->second)->BasesAssaulted); // bases asssulted + buff << uint32(((BattlegroundBFGScore*)itr->second)->BasesAssaulted); // bases assaulted buff << uint32(((BattlegroundBFGScore*)itr->second)->BasesDefended); // bases defended break; default: @@ -495,7 +495,7 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg) break; case BATTLEGROUND_AB: data->WriteBits(0x00000002, 24); - buff << uint32(((BattlegroundABScore*)itr->second)->BasesAssaulted); // bases asssulted + buff << uint32(((BattlegroundABScore*)itr->second)->BasesAssaulted); // bases assaulted buff << uint32(((BattlegroundABScore*)itr->second)->BasesDefended); // bases defended break; case BATTLEGROUND_EY: @@ -509,7 +509,7 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg) break; case BATTLEGROUND_IC: data->WriteBits(0x00000002, 24); - buff << uint32(((BattlegroundICScore*)itr->second)->BasesAssaulted); // bases asssulted + buff << uint32(((BattlegroundICScore*)itr->second)->BasesAssaulted); // bases assaulted buff << uint32(((BattlegroundICScore*)itr->second)->BasesDefended); // bases defended break; case BATTLEGROUND_TP: @@ -519,7 +519,7 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg) break; case BATTLEGROUND_BFG: data->WriteBits(0x00000002, 24); - buff << uint32(((BattlegroundBFGScore*)itr->second)->BasesAssaulted); // bases asssulted + buff << uint32(((BattlegroundBFGScore*)itr->second)->BasesAssaulted); // bases assaulted buff << uint32(((BattlegroundBFGScore*)itr->second)->BasesDefended); // bases defended break; case BATTLEGROUND_NA: @@ -576,7 +576,7 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg) *data << uint8(bg->GetPlayersCountByTeam(HORDE)); if (bg->GetStatus() == STATUS_WAIT_LEAVE) - *data << uint8(bg->GetWinner()); // who win + *data << uint8(bg->GetWinner()); *data << uint8(bg->GetPlayersCountByTeam(ALLIANCE)); } @@ -777,7 +777,7 @@ Battleground* BattlegroundMgr::GetBattlegroundTemplate(BattlegroundTypeId bgType return NULL; BattlegroundContainer const& bgs = itr->second.m_Battlegrounds; - //map is sorted and we can be sure that lowest instance id has only BG template + // map is sorted and we can be sure that lowest instance id has only BG template return bgs.empty() ? NULL : bgs.begin()->second; } @@ -1497,4 +1497,3 @@ void BattlegroundMgr::RemoveBattleground(BattlegroundTypeId bgTypeId, uint32 ins { bgDataStore[bgTypeId].m_Battlegrounds.erase(instanceId); } - diff --git a/src/server/game/Handlers/MailHandler.cpp b/src/server/game/Handlers/MailHandler.cpp index 3e84ab5151c..9e4e8c56da9 100644 --- a/src/server/game/Handlers/MailHandler.cpp +++ b/src/server/game/Handlers/MailHandler.cpp @@ -40,7 +40,7 @@ void WorldSession::HandleSendMail(WorldPacket& recvData) recvData >> unk1; recvData >> unk2; // Stationery? - recvData >> money >> COD; // money and cod + recvData >> COD >> money; // money and cod bodyLength = recvData.ReadBits(12); subjectLength = recvData.ReadBits(9); diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index fbc0ae1d803..9b9b888a9f3 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -341,6 +341,7 @@ SpellEffectInfo::SpellEffectInfo(SpellEntry const* /*spellEntry*/, SpellInfo con TargetA = SpellImplicitTargetInfo(_effect ? _effect->EffectImplicitTargetA : 0); TargetB = SpellImplicitTargetInfo(_effect ? _effect->EffectImplicitTargetB : 0); RadiusEntry = _effect && _effect->EffectRadiusIndex ? sSpellRadiusStore.LookupEntry(_effect->EffectRadiusIndex) : NULL; + MaxRadiusEntry = _effect && _effect->EffectRadiusMaxIndex ? sSpellRadiusStore.LookupEntry(_effect->EffectRadiusMaxIndex) : NULL; ChainTarget = _effect ? _effect->EffectChainTarget : 0; ItemType = _effect ? _effect->EffectItemType : 0; TriggerSpell = _effect ? _effect->EffectTriggerSpell : 0; @@ -534,10 +535,23 @@ bool SpellEffectInfo::HasRadius() const return RadiusEntry != NULL; } +bool SpellEffectInfo::HasMaxRadius() const +{ + return MaxRadiusEntry != NULL; +} + float SpellEffectInfo::CalcRadius(Unit* caster, Spell* spell) const { if (!HasRadius()) + { + if (HasMaxRadius()) + { + //! Still not sure which to pick. Anyway at the current time (Patch 4.3.4) most of the spell effects + //! have no radius mod per level, and RadiusMin is equal to RadiusMax. + return MaxRadiusEntry->RadiusMin; + } return 0.0f; + } float radius = RadiusEntry->RadiusMin; if (caster) diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h index 9abb82bbc4b..b51ed93a86f 100644 --- a/src/server/game/Spells/SpellInfo.h +++ b/src/server/game/Spells/SpellInfo.h @@ -247,6 +247,7 @@ public: SpellImplicitTargetInfo TargetA; SpellImplicitTargetInfo TargetB; SpellRadiusEntry const* RadiusEntry; + SpellRadiusEntry const* MaxRadiusEntry; uint32 ChainTarget; uint32 ItemType; uint32 TriggerSpell; @@ -276,6 +277,7 @@ public: float CalcDamageMultiplier(Unit* caster, Spell* spell = NULL) const; bool HasRadius() const; + bool HasMaxRadius() const; float CalcRadius(Unit* caster = NULL, Spell* = NULL) const; uint32 GetProvidedTargetMask() const; diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index da020d944e8..78217cfd7cd 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -497,11 +497,12 @@ void AddSC_mage_spell_scripts() { new spell_mage_blast_wave(); new spell_mage_cold_snap(); + new spell_mage_cone_of_cold(); + new spell_mage_conjure_refreshment(); new spell_mage_frost_warding_trigger(); new spell_mage_incanters_absorbtion_absorb(); new spell_mage_incanters_absorbtion_manashield(); new spell_mage_polymorph_cast_visual(); new spell_mage_summon_water_elemental(); new spell_mage_living_bomb(); - new spell_mage_cone_of_cold(); } -- cgit v1.2.3 From bd51d033f66d8dc5c0ee60dc256ff36e6a448b06 Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 10 Dec 2012 11:50:17 +0100 Subject: Core/StatSystem: Fixed possible crash when calculating health bonus from stamina Closes #8595 Closes #8620 --- src/server/game/Entities/Unit/StatSystem.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index eac2b531805..ebb8d69382e 100644 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -215,13 +215,15 @@ void Player::UpdateArmor() float Player::GetHealthBonusFromStamina() { // Taken from PaperDollFrame.lua - 4.3.4.15595 - gtOCTHpPerStaminaEntry const* hpBase = sGtOCTHpPerStaminaStore.LookupEntry((getClass() - 1) * GT_MAX_LEVEL + getLevel() - 1); + float ratio = 10.0f; + if (gtOCTHpPerStaminaEntry const* hpBase = sGtOCTHpPerStaminaStore.LookupEntry((getClass() - 1) * GT_MAX_LEVEL + getLevel() - 1)) + ratio = hpBase->ratio; float stamina = GetStat(STAT_STAMINA); float baseStam = std::min(20.0f, stamina); float moreStam = stamina - baseStam; - return baseStam + moreStam * hpBase->ratio; + return baseStam + moreStam * ratio; } float Player::GetManaBonusFromIntellect() -- cgit v1.2.3 From 9731607c9d30bf5ef4b89fdd7ab54817e8d64b28 Mon Sep 17 00:00:00 2001 From: kaelima Date: Thu, 13 Dec 2012 17:53:52 +0100 Subject: Core/Protocol: Enable SMSG_RESURRECT_REQUEST --- src/server/game/Server/Protocol/Opcodes.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index d02149f2840..0d7f82fa0b1 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -1139,7 +1139,7 @@ void OpcodeTable::Initialize() DEFINE_OPCODE_HANDLER(SMSG_RESET_COMPRESSION_CONTEXT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_RESET_FAILED_NOTIFY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_RESPOND_INSPECT_ACHIEVEMENTS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_RESURRECT_REQUEST, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_RESURRECT_REQUEST, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_RESYNC_RUNES, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_ROLE_POLL_BEGIN, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_RWHOIS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); @@ -1468,7 +1468,6 @@ void OpcodeTable::Initialize() //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_CANCEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverCancel ); //DEFINE_OPCODE_HANDLER(CMSG_QUESTGIVER_QUEST_AUTOLAUNCH, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestgiverQuestAutoLaunch ); //DEFINE_OPCODE_HANDLER(CMSG_QUESTLOG_SWAP_QUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleQuestLogSwapQuest ); - //DEFINE_OPCODE_HANDLER(CMSG_QUEST_NPC_QUERY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_RECHARGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_REDIRECTION_FAILED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); //DEFINE_OPCODE_HANDLER(CMSG_REFER_A_FRIEND, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -1599,7 +1598,6 @@ void OpcodeTable::Initialize() //DEFINE_OPCODE_HANDLER(SMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY_RESPONSE_WRITE_FILE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHEAT_PLAYER_LOOKUP, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CHECK_FOR_BOTS, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_COOLDOWN, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_CLEAR_EXTRA_AURA_INFO_OBSOLETE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMBAT_LOG_MULTIPLE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); //DEFINE_OPCODE_HANDLER(SMSG_COMMENTATOR_GET_PLAYER_INFO, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From 78017ac222cdedffc8878ba88204cd94cadd864f Mon Sep 17 00:00:00 2001 From: Warpten Date: Mon, 17 Dec 2012 00:41:46 +0100 Subject: Core/Guilds: Fixed guild news spam related to guild level-up. --- src/server/game/Guilds/Guild.cpp | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index c91b5746e84..3057a97eb27 100644 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -3466,28 +3466,30 @@ void Guild::GiveXP(uint32 xp, Player* source) { _experience -= sGuildMgr->GetXPForGuildLevel(GetLevel()); ++_level; - } - // Find all guild perks to learn - std::vector perksToLearn; - for (uint32 i = 0; i < sGuildPerkSpellsStore.GetNumRows(); ++i) - if (GuildPerkSpellsEntry const* entry = sGuildPerkSpellsStore.LookupEntry(i)) - if (entry->Level > oldLevel && entry->Level <= GetLevel()) - perksToLearn.push_back(entry->SpellId); + // Find all guild perks to learn + std::vector perksToLearn; + for (uint32 i = 0; i < sGuildPerkSpellsStore.GetNumRows(); ++i) + if (GuildPerkSpellsEntry const* entry = sGuildPerkSpellsStore.LookupEntry(i)) + if (entry->Level > oldLevel && entry->Level <= GetLevel()) + perksToLearn.push_back(entry->SpellId); - // Notify all online players that guild level changed and learn perks - for (Members::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr) - { - if (Player* player = itr->second->FindPlayer()) + // Notify all online players that guild level changed and learn perks + for (Members::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr) { - player->SetGuildLevel(GetLevel()); - for (size_t i = 0; i < perksToLearn.size(); ++i) - player->learnSpell(perksToLearn[i], true); + if (Player* player = itr->second->FindPlayer()) + { + player->SetGuildLevel(GetLevel()); + for (size_t i = 0; i < perksToLearn.size(); ++i) + player->learnSpell(perksToLearn[i], true); + } } - } - AddGuildNews(GUILD_NEWS_LEVEL_UP, 0, 0, _level); - UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_GUILD_LEVEL, GetLevel(), 0, 0, NULL, source); + AddGuildNews(GUILD_NEWS_LEVEL_UP, 0, 0, _level); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_GUILD_LEVEL, GetLevel(), 0, 0, NULL, source); + + ++oldLevel; + } } void Guild::SendGuildXP(WorldSession* session /* = NULL */) const -- cgit v1.2.3 From 1293de90be725521c5c8f04095cef7804811427c Mon Sep 17 00:00:00 2001 From: Shocker Date: Mon, 17 Dec 2012 01:53:52 +0200 Subject: Core/Spells: Correct effect index check for Earth's Grasp --- src/server/scripts/Spells/spell_shaman.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index 939e6371d98..02c314fd472 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -158,7 +158,7 @@ class spell_sha_earthbind_totem : public SpellScriptLoader if (!owner) return; // Earth's Grasp - if (AuraEffect* aurEff = owner->GetAuraEffectOfRankedSpell(SHAMAN_SPELL_EARTH_GRASP, EFFECT_0)) + if (AuraEffect* aurEff = owner->GetAuraEffectOfRankedSpell(SHAMAN_SPELL_EARTH_GRASP, EFFECT_1)) { if (roll_chance_i(aurEff->GetAmount())) GetCaster()->CastSpell(GetCaster(), EARTHBIND_TOTEM_SPELL_EARTHGRAB, false); -- cgit v1.2.3 From 70b542a88cef4f33a793d87665a1e0ebd179c5ab Mon Sep 17 00:00:00 2001 From: Warpten Date: Mon, 17 Dec 2012 01:10:20 +0100 Subject: Core/Battlegrounds: Fix one typo from e6c763f4337cfe4ab673bb17. --- src/server/game/Battlegrounds/BattlegroundMgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index 362c4e3fb65..2244dd8b9e8 100644 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -303,7 +303,7 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro data->WriteBit(bgGuid[7]); data->WriteBit(bgGuid[1]); data->WriteBit(playerGuid[5]); - data->WriteBit(player->GetBGTeam() == ALLIANCE); // Battlefield Faction ( 0 horde, 1 alliance ) + data->WriteBit(player->GetBGTeam() == TEAM_ALLIANCE); // Battlefield Faction ( 0 horde, 1 alliance ) data->WriteBit(bgGuid[0]); data->WriteBit(playerGuid[1]); data->WriteBit(bgGuid[3]); -- cgit v1.2.3 From 9b2d7448476bb7b60b6cc1a956f665a5e757b9fb Mon Sep 17 00:00:00 2001 From: Warpten Date: Thu, 20 Dec 2012 19:22:14 +0100 Subject: Core/StatsSystem: Resilience updates. * No longer reduces mana draining effects. * No longer reduces crit chances. * No longer reduces hit chances. --- src/server/game/Entities/Player/Player.cpp | 155 +++++++++++----------- src/server/game/Entities/Unit/Unit.cpp | 66 +-------- src/server/game/Entities/Unit/Unit.h | 67 ++++------ src/server/game/Spells/Auras/SpellAuraEffects.cpp | 12 +- src/server/game/Spells/SpellEffects.cpp | 16 +-- 5 files changed, 116 insertions(+), 200 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 606bcc6cfec..67e359cf4c7 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -5886,7 +5886,10 @@ float Player::GetRatingMultiplier(CombatRating cr) const float Player::GetRatingBonusValue(CombatRating cr) const { - return float(GetUInt32Value(PLAYER_FIELD_COMBAT_RATING_1 + cr)) * GetRatingMultiplier(cr); + float baseResult = float(GetUInt32Value(PLAYER_FIELD_COMBAT_RATING_1 + cr)) * GetRatingMultiplier(cr); + if (cr != CR_RESILIENCE_PLAYER_DAMAGE_TAKEN) + return baseResult; + return float(1.0f - pow(0.99f, baseResult)); } float Player::GetExpertiseDodgeOrParryReduction(WeaponAttackType attType) const @@ -6010,15 +6013,12 @@ void Player::UpdateRating(CombatRating cr) if (affectStats) UpdateAllSpellCritChances(); break; - case CR_HIT_TAKEN_MELEE: // Implemented in Unit::MeleeMissChanceCalc - case CR_HIT_TAKEN_RANGED: - break; - case CR_HIT_TAKEN_SPELL: // Implemented in Unit::MagicSpellHitResult - break; - case CR_CRIT_TAKEN_MELEE: // Implemented in Unit::RollMeleeOutcomeAgainst (only for chance to crit) - case CR_CRIT_TAKEN_RANGED: - break; - case CR_CRIT_TAKEN_SPELL: // Implemented in Unit::SpellCriticalBonus (only for chance to crit) + case CR_HIT_TAKEN_MELEE: // Deprecated since Cataclysm + case CR_HIT_TAKEN_RANGED: // Deprecated since Cataclysm + case CR_HIT_TAKEN_SPELL: // Deprecated since Cataclysm + case CR_RESILIENCE_PLAYER_DAMAGE_TAKEN: + case CR_RESILIENCE_CRIT_TAKEN: + case CR_CRIT_TAKEN_SPELL: // Deprecated since Cataclysm break; case CR_HASTE_MELEE: // Implemented in Player::ApplyRatingMod case CR_HASTE_RANGED: @@ -8239,24 +8239,24 @@ void Player::_ApplyItemBonuses(ItemTemplate const* proto, uint8 slot, bool apply case ITEM_MOD_CRIT_SPELL_RATING: ApplyRatingMod(CR_CRIT_SPELL, int32(val), apply); break; - case ITEM_MOD_HIT_TAKEN_MELEE_RATING: - ApplyRatingMod(CR_HIT_TAKEN_MELEE, int32(val), apply); - break; - case ITEM_MOD_HIT_TAKEN_RANGED_RATING: - ApplyRatingMod(CR_HIT_TAKEN_RANGED, int32(val), apply); - break; - case ITEM_MOD_HIT_TAKEN_SPELL_RATING: - ApplyRatingMod(CR_HIT_TAKEN_SPELL, int32(val), apply); - break; - case ITEM_MOD_CRIT_TAKEN_MELEE_RATING: - ApplyRatingMod(CR_CRIT_TAKEN_MELEE, int32(val), apply); - break; + // case ITEM_MOD_HIT_TAKEN_MELEE_RATING: + // ApplyRatingMod(CR_HIT_TAKEN_MELEE, int32(val), apply); + // break; + // case ITEM_MOD_HIT_TAKEN_RANGED_RATING: + // ApplyRatingMod(CR_HIT_TAKEN_RANGED, int32(val), apply); + // break; + // case ITEM_MOD_HIT_TAKEN_SPELL_RATING: + // ApplyRatingMod(CR_HIT_TAKEN_SPELL, int32(val), apply); + // break; + // case ITEM_MOD_CRIT_TAKEN_MELEE_RATING: + // ApplyRatingMod(CR_CRIT_TAKEN_MELEE, int32(val), apply); + // break; case ITEM_MOD_CRIT_TAKEN_RANGED_RATING: - ApplyRatingMod(CR_CRIT_TAKEN_RANGED, int32(val), apply); - break; - case ITEM_MOD_CRIT_TAKEN_SPELL_RATING: - ApplyRatingMod(CR_CRIT_TAKEN_SPELL, int32(val), apply); + ApplyRatingMod(CR_RESILIENCE_PLAYER_DAMAGE_TAKEN, int32(val), apply); break; + // case ITEM_MOD_CRIT_TAKEN_SPELL_RATING: + // ApplyRatingMod(CR_CRIT_TAKEN_SPELL, int32(val), apply); + // break; case ITEM_MOD_HASTE_MELEE_RATING: ApplyRatingMod(CR_HASTE_MELEE, int32(val), apply); break; @@ -8276,20 +8276,18 @@ void Player::_ApplyItemBonuses(ItemTemplate const* proto, uint8 slot, bool apply ApplyRatingMod(CR_CRIT_RANGED, int32(val), apply); ApplyRatingMod(CR_CRIT_SPELL, int32(val), apply); break; - case ITEM_MOD_HIT_TAKEN_RATING: - ApplyRatingMod(CR_HIT_TAKEN_MELEE, int32(val), apply); - ApplyRatingMod(CR_HIT_TAKEN_RANGED, int32(val), apply); - ApplyRatingMod(CR_HIT_TAKEN_SPELL, int32(val), apply); - break; - case ITEM_MOD_CRIT_TAKEN_RATING: - ApplyRatingMod(CR_CRIT_TAKEN_MELEE, int32(val), apply); - ApplyRatingMod(CR_CRIT_TAKEN_RANGED, int32(val), apply); - ApplyRatingMod(CR_CRIT_TAKEN_SPELL, int32(val), apply); - break; + // case ITEM_MOD_HIT_TAKEN_RATING: // Unused since 3.3.5 + // ApplyRatingMod(CR_HIT_TAKEN_MELEE, int32(val), apply); + // ApplyRatingMod(CR_HIT_TAKEN_RANGED, int32(val), apply); + // ApplyRatingMod(CR_HIT_TAKEN_SPELL, int32(val), apply); + // break; + // case ITEM_MOD_CRIT_TAKEN_RATING: // Unused since 3.3.5 + // ApplyRatingMod(CR_CRIT_TAKEN_MELEE, int32(val), apply); + // ApplyRatingMod(CR_CRIT_TAKEN_RANGED, int32(val), apply); + // ApplyRatingMod(CR_CRIT_TAKEN_SPELL, int32(val), apply); + // break; case ITEM_MOD_RESILIENCE_RATING: - ApplyRatingMod(CR_CRIT_TAKEN_MELEE, int32(val), apply); - ApplyRatingMod(CR_CRIT_TAKEN_RANGED, int32(val), apply); - ApplyRatingMod(CR_CRIT_TAKEN_SPELL, int32(val), apply); + ApplyRatingMod(CR_RESILIENCE_PLAYER_DAMAGE_TAKEN, int32(val), apply); break; case ITEM_MOD_HASTE_RATING: ApplyRatingMod(CR_HASTE_MELEE, int32(val), apply); @@ -14078,32 +14076,32 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool ApplyRatingMod(CR_CRIT_SPELL, enchant_amount, apply); sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u SPELL_CRIT", enchant_amount); break; -// Values from ITEM_STAT_MELEE_HA_RATING to ITEM_MOD_HASTE_RANGED_RATING are never used -// in Enchantments -// case ITEM_MOD_HIT_TAKEN_MELEE_RATING: -// ApplyRatingMod(CR_HIT_TAKEN_MELEE, enchant_amount, apply); -// break; -// case ITEM_MOD_HIT_TAKEN_RANGED_RATING: -// ApplyRatingMod(CR_HIT_TAKEN_RANGED, enchant_amount, apply); -// break; -// case ITEM_MOD_HIT_TAKEN_SPELL_RATING: -// ApplyRatingMod(CR_HIT_TAKEN_SPELL, enchant_amount, apply); -// break; -// case ITEM_MOD_CRIT_TAKEN_MELEE_RATING: -// ApplyRatingMod(CR_CRIT_TAKEN_MELEE, enchant_amount, apply); -// break; -// case ITEM_MOD_CRIT_TAKEN_RANGED_RATING: -// ApplyRatingMod(CR_CRIT_TAKEN_RANGED, enchant_amount, apply); -// break; -// case ITEM_MOD_CRIT_TAKEN_SPELL_RATING: -// ApplyRatingMod(CR_CRIT_TAKEN_SPELL, enchant_amount, apply); -// break; -// case ITEM_MOD_HASTE_MELEE_RATING: -// ApplyRatingMod(CR_HASTE_MELEE, enchant_amount, apply); -// break; -// case ITEM_MOD_HASTE_RANGED_RATING: -// ApplyRatingMod(CR_HASTE_RANGED, enchant_amount, apply); -// break; + // Values from ITEM_STAT_MELEE_HA_RATING to ITEM_MOD_HASTE_RANGED_RATING are never used + // in Enchantments + // case ITEM_MOD_HIT_TAKEN_MELEE_RATING: + // ApplyRatingMod(CR_HIT_TAKEN_MELEE, enchant_amount, apply); + // break; + // case ITEM_MOD_HIT_TAKEN_RANGED_RATING: + // ApplyRatingMod(CR_HIT_TAKEN_RANGED, enchant_amount, apply); + // break; + // case ITEM_MOD_HIT_TAKEN_SPELL_RATING: + // ApplyRatingMod(CR_HIT_TAKEN_SPELL, enchant_amount, apply); + // break; + // case ITEM_MOD_CRIT_TAKEN_MELEE_RATING: + // ApplyRatingMod(CR_CRIT_TAKEN_MELEE, enchant_amount, apply); + // break; + // case ITEM_MOD_CRIT_TAKEN_RANGED_RATING: + // ApplyRatingMod(CR_CRIT_TAKEN_RANGED, enchant_amount, apply); + // break; + // case ITEM_MOD_CRIT_TAKEN_SPELL_RATING: + // ApplyRatingMod(CR_CRIT_TAKEN_SPELL, enchant_amount, apply); + // break; + // case ITEM_MOD_HASTE_MELEE_RATING: + // ApplyRatingMod(CR_HASTE_MELEE, enchant_amount, apply); + // break; + // case ITEM_MOD_HASTE_RANGED_RATING: + // ApplyRatingMod(CR_HASTE_RANGED, enchant_amount, apply); + // break; case ITEM_MOD_HASTE_SPELL_RATING: ApplyRatingMod(CR_HASTE_SPELL, enchant_amount, apply); break; @@ -14119,21 +14117,18 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool ApplyRatingMod(CR_CRIT_SPELL, enchant_amount, apply); sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u CRITICAL", enchant_amount); break; -// Values ITEM_MOD_HIT_TAKEN_RATING and ITEM_MOD_CRIT_TAKEN_RATING are never used in Enchantment -// case ITEM_MOD_HIT_TAKEN_RATING: -// ApplyRatingMod(CR_HIT_TAKEN_MELEE, enchant_amount, apply); -// ApplyRatingMod(CR_HIT_TAKEN_RANGED, enchant_amount, apply); -// ApplyRatingMod(CR_HIT_TAKEN_SPELL, enchant_amount, apply); -// break; -// case ITEM_MOD_CRIT_TAKEN_RATING: -// ApplyRatingMod(CR_CRIT_TAKEN_MELEE, enchant_amount, apply); -// ApplyRatingMod(CR_CRIT_TAKEN_RANGED, enchant_amount, apply); -// ApplyRatingMod(CR_CRIT_TAKEN_SPELL, enchant_amount, apply); -// break; + // case ITEM_MOD_HIT_TAKEN_RATING: // Unused since 3.3.5 + // ApplyRatingMod(CR_HIT_TAKEN_MELEE, enchant_amount, apply); + // ApplyRatingMod(CR_HIT_TAKEN_RANGED, enchant_amount, apply); + // ApplyRatingMod(CR_HIT_TAKEN_SPELL, enchant_amount, apply); + // break; + // case ITEM_MOD_CRIT_TAKEN_RATING: // Unused since 3.3.5 + // ApplyRatingMod(CR_CRIT_TAKEN_MELEE, enchant_amount, apply); + // ApplyRatingMod(CR_CRIT_TAKEN_RANGED, enchant_amount, apply); + // ApplyRatingMod(CR_CRIT_TAKEN_SPELL, enchant_amount, apply); + // break; case ITEM_MOD_RESILIENCE_RATING: - ApplyRatingMod(CR_CRIT_TAKEN_MELEE, enchant_amount, apply); - ApplyRatingMod(CR_CRIT_TAKEN_RANGED, enchant_amount, apply); - ApplyRatingMod(CR_CRIT_TAKEN_SPELL, enchant_amount, apply); + ApplyRatingMod(CR_RESILIENCE_PLAYER_DAMAGE_TAKEN, enchant_amount, apply); sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u RESILIENCE", enchant_amount); break; case ITEM_MOD_HASTE_RATING: @@ -19943,7 +19938,7 @@ void Player::_SaveStats(SQLTransaction& trans) stmt->setUInt32(index++, GetUInt32Value(UNIT_FIELD_ATTACK_POWER)); stmt->setUInt32(index++, GetUInt32Value(UNIT_FIELD_RANGED_ATTACK_POWER)); stmt->setUInt32(index++, GetBaseSpellPowerBonus()); - stmt->setUInt32(index++, GetUInt32Value(PLAYER_FIELD_COMBAT_RATING_1 + CR_CRIT_TAKEN_SPELL)); + stmt->setUInt32(index++, GetUInt32Value(PLAYER_FIELD_COMBAT_RATING_1 + CR_RESILIENCE_PLAYER_DAMAGE_TAKEN)); trans->Append(stmt); } diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index b6573fe4f8a..a4bbeb928d8 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -998,10 +998,7 @@ void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage* damageInfo, int32 dama damage -= damageInfo->blocked; } - if (attackType != RANGED_ATTACK) - ApplyResilience(victim, NULL, &damage, crit, CR_CRIT_TAKEN_MELEE); - else - ApplyResilience(victim, NULL, &damage, crit, CR_CRIT_TAKEN_RANGED); + ApplyResilience(victim, &damage, crit); break; } // Magical Attacks @@ -1015,7 +1012,7 @@ void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage* damageInfo, int32 dama damage = SpellCriticalDamageBonus(spellInfo, damage, victim); } - ApplyResilience(victim, NULL, &damage, crit, CR_CRIT_TAKEN_SPELL); + ApplyResilience(victim, &damage, crit); break; } default: @@ -1227,10 +1224,7 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam damageInfo->HitInfo |= HITINFO_AFFECTS_VICTIM; int32 resilienceReduction = damageInfo->damage; - if (attackType != RANGED_ATTACK) - ApplyResilience(victim, NULL, &resilienceReduction, (damageInfo->hitOutCome == MELEE_HIT_CRIT), CR_CRIT_TAKEN_MELEE); - else - ApplyResilience(victim, NULL, &resilienceReduction, (damageInfo->hitOutCome == MELEE_HIT_CRIT), CR_CRIT_TAKEN_RANGED); + ApplyResilience(victim, &resilienceReduction, (damageInfo->hitOutCome == MELEE_HIT_CRIT)); resilienceReduction = damageInfo->damage - resilienceReduction; damageInfo->damage -= resilienceReduction; damageInfo->cleanDamage += resilienceReduction; @@ -2344,10 +2338,6 @@ SpellMissInfo Unit::MagicSpellHitResult(Unit* victim, SpellInfo const* spell) { // Chance hit from victim SPELL_AURA_MOD_ATTACKER_SPELL_HIT_CHANCE auras modHitChance += victim->GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_ATTACKER_SPELL_HIT_CHANCE, schoolMask); - - // Decrease hit chance from victim rating bonus - if (victim->GetTypeId() == TYPEID_PLAYER) - modHitChance -= int32(victim->ToPlayer()->GetRatingBonusValue(CR_HIT_TAKEN_SPELL)); } int32 HitChance = modHitChance * 100; @@ -2580,12 +2570,6 @@ float Unit::GetUnitCriticalChance(WeaponAttackType attackType, const Unit* victi crit += victim->GetTotalAuraModifier(SPELL_AURA_MOD_ATTACKER_SPELL_AND_WEAPON_CRIT_CHANCE); - // reduce crit chance from Rating for players - if (attackType != RANGED_ATTACK) - ApplyResilience(victim, &crit, NULL, false, CR_CRIT_TAKEN_MELEE); - else - ApplyResilience(victim, &crit, NULL, false, CR_CRIT_TAKEN_RANGED); - if (crit < 0.0f) crit = 0.0f; return crit; @@ -9769,7 +9753,6 @@ bool Unit::isSpellCrit(Unit* victim, SpellInfo const* spellProto, SpellSchoolMas crit_chance += victim->GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_ATTACKER_SPELL_CRIT_CHANCE, schoolMask); // Modify critical chance by victim SPELL_AURA_MOD_ATTACKER_SPELL_AND_WEAPON_CRIT_CHANCE crit_chance += victim->GetTotalAuraModifier(SPELL_AURA_MOD_ATTACKER_SPELL_AND_WEAPON_CRIT_CHANCE); - ApplyResilience(victim, &crit_chance, NULL, false, CR_CRIT_TAKEN_SPELL); } // scripted (increase crit chance ... against ... target by x% AuraEffectList const& mOverrideClassScript = GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS); @@ -15685,7 +15668,7 @@ void Unit::SendPlaySpellVisualKit(uint32 id, uint32 unkParam) SendMessageToSet(&data, true); } -void Unit::ApplyResilience(Unit const* victim, float* crit, int32* damage, bool isCrit, CombatRating type) const +void Unit::ApplyResilience(Unit const* victim, int32* damage, bool isCrit) const { // player mounted on multi-passenger mount is also classified as vehicle if (IsVehicle() || (victim->IsVehicle() && victim->GetTypeId() != TYPEID_PLAYER)) @@ -15706,44 +15689,9 @@ void Unit::ApplyResilience(Unit const* victim, float* crit, int32* damage, bool if (!target) return; - switch (type) - { - case CR_CRIT_TAKEN_MELEE: - // Crit chance reduction works against nonpets - if (crit) - *crit -= target->GetMeleeCritChanceReduction(); - if (source && damage) - { - if (isCrit) - *damage -= target->GetMeleeCritDamageReduction(*damage); - *damage -= target->GetMeleeDamageReduction(*damage); - } - break; - case CR_CRIT_TAKEN_RANGED: - // Crit chance reduction works against nonpets - if (crit) - *crit -= target->GetRangedCritChanceReduction(); - if (source && damage) - { - if (isCrit) - *damage -= target->GetRangedCritDamageReduction(*damage); - *damage -= target->GetRangedDamageReduction(*damage); - } - break; - case CR_CRIT_TAKEN_SPELL: - // Crit chance reduction works against nonpets - if (crit) - *crit -= target->GetSpellCritChanceReduction(); - if (source && damage) - { - if (isCrit) - *damage -= target->GetSpellCritDamageReduction(*damage); - *damage -= target->GetSpellDamageReduction(*damage); - } - break; - default: - break; - } + if (isCrit) + *damage = target->GetCritDamageReduction(*damage); + * damage = target->GetDamageReduction(*damage); } // Melee based spells can be miss, parry or dodge on this step diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 1bd3e5d59aa..515e7644299 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -538,32 +538,32 @@ enum WeaponAttackType enum CombatRating { - CR_WEAPON_SKILL = 0, - CR_DEFENSE_SKILL = 1, // Removed in 4.0.1 - CR_DODGE = 2, - CR_PARRY = 3, - CR_BLOCK = 4, - CR_HIT_MELEE = 5, - CR_HIT_RANGED = 6, - CR_HIT_SPELL = 7, - CR_CRIT_MELEE = 8, - CR_CRIT_RANGED = 9, - CR_CRIT_SPELL = 10, - CR_HIT_TAKEN_MELEE = 11, - CR_HIT_TAKEN_RANGED = 12, - CR_HIT_TAKEN_SPELL = 13, - CR_CRIT_TAKEN_MELEE = 14, - CR_CRIT_TAKEN_RANGED = 15, - CR_CRIT_TAKEN_SPELL = 16, - CR_HASTE_MELEE = 17, - CR_HASTE_RANGED = 18, - CR_HASTE_SPELL = 19, - CR_WEAPON_SKILL_MAINHAND = 20, - CR_WEAPON_SKILL_OFFHAND = 21, - CR_WEAPON_SKILL_RANGED = 22, - CR_EXPERTISE = 23, - CR_ARMOR_PENETRATION = 24, - CR_MASTERY = 25, + CR_WEAPON_SKILL = 0, + CR_DEFENSE_SKILL = 1, // Removed in 4.0.1 + CR_DODGE = 2, + CR_PARRY = 3, + CR_BLOCK = 4, + CR_HIT_MELEE = 5, + CR_HIT_RANGED = 6, + CR_HIT_SPELL = 7, + CR_CRIT_MELEE = 8, + CR_CRIT_RANGED = 9, + CR_CRIT_SPELL = 10, + CR_HIT_TAKEN_MELEE = 11, // Deprecated since Cataclysm + CR_HIT_TAKEN_RANGED = 12, // Deprecated since Cataclysm + CR_HIT_TAKEN_SPELL = 13, // Deprecated since Cataclysm + CR_RESILIENCE_CRIT_TAKEN = 14, + CR_RESILIENCE_PLAYER_DAMAGE_TAKEN = 15, + CR_CRIT_TAKEN_SPELL = 16, // Deprecated since Cataclysm + CR_HASTE_MELEE = 17, + CR_HASTE_RANGED = 18, + CR_HASTE_SPELL = 19, + CR_WEAPON_SKILL_MAINHAND = 20, + CR_WEAPON_SKILL_OFFHAND = 21, + CR_WEAPON_SKILL_RANGED = 22, + CR_EXPERTISE = 23, + CR_ARMOR_PENETRATION = 24, + CR_MASTERY = 25, }; #define MAX_COMBAT_RATING 26 @@ -1450,21 +1450,12 @@ class Unit : public WorldObject void DealSpellDamage(SpellNonMeleeDamage* damageInfo, bool durabilityLoss); // player or player's pet resilience (-1%) - float GetMeleeCritChanceReduction() const { return GetCombatRatingReduction(CR_CRIT_TAKEN_MELEE); } - float GetRangedCritChanceReduction() const { return GetCombatRatingReduction(CR_CRIT_TAKEN_RANGED); } - float GetSpellCritChanceReduction() const { return GetCombatRatingReduction(CR_CRIT_TAKEN_SPELL); } - - // player or player's pet resilience (-1%) - uint32 GetMeleeCritDamageReduction(uint32 damage) const { return GetCombatRatingDamageReduction(CR_CRIT_TAKEN_MELEE, 2.2f, 33.0f, damage); } - uint32 GetRangedCritDamageReduction(uint32 damage) const { return GetCombatRatingDamageReduction(CR_CRIT_TAKEN_RANGED, 2.2f, 33.0f, damage); } - uint32 GetSpellCritDamageReduction(uint32 damage) const { return GetCombatRatingDamageReduction(CR_CRIT_TAKEN_SPELL, 2.2f, 33.0f, damage); } + uint32 GetCritDamageReduction(uint32 damage) const { return GetCombatRatingDamageReduction(CR_RESILIENCE_CRIT_TAKEN, 2.2f, 33.0f, damage); } // player or player's pet resilience (-1%), cap 100% - uint32 GetMeleeDamageReduction(uint32 damage) const { return GetCombatRatingDamageReduction(CR_CRIT_TAKEN_MELEE, 2.0f, 100.0f, damage); } - uint32 GetRangedDamageReduction(uint32 damage) const { return GetCombatRatingDamageReduction(CR_CRIT_TAKEN_RANGED, 2.0f, 100.0f, damage); } - uint32 GetSpellDamageReduction(uint32 damage) const { return GetCombatRatingDamageReduction(CR_CRIT_TAKEN_SPELL, 2.0f, 100.0f, damage); } + uint32 GetDamageReduction(uint32 damage) const { return GetCombatRatingDamageReduction(CR_RESILIENCE_PLAYER_DAMAGE_TAKEN, 2.0f, 100.0f, damage); } - void ApplyResilience(const Unit* victim, float * crit, int32 * damage, bool isCrit, CombatRating type) const; + void ApplyResilience(const Unit* victim, int32 * damage, bool isCrit) const; float MeleeSpellMissChance(const Unit* victim, WeaponAttackType attType, uint32 spellId) const; SpellMissInfo MeleeSpellHitResult(Unit* victim, SpellInfo const* spell); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 0ab0b3f21e9..21732bad951 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -6148,7 +6148,7 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const damage = caster->SpellCriticalDamageBonus(m_spellInfo, damage, target); int32 dmg = damage; - caster->ApplyResilience(target, NULL, &dmg, crit, CR_CRIT_TAKEN_SPELL); + caster->ApplyResilience(target, &dmg, crit); damage = dmg; caster->CalcAbsorbResist(target, GetSpellInfo()->GetSchoolMask(), DOT, damage, &absorb, &resist, GetSpellInfo()); @@ -6215,7 +6215,7 @@ void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) c } int32 dmg = damage; - caster->ApplyResilience(target, NULL, &dmg, crit, CR_CRIT_TAKEN_SPELL); + caster->ApplyResilience(target, &dmg, crit); damage = dmg; caster->CalcAbsorbResist(target, GetSpellInfo()->GetSchoolMask(), DOT, damage, &absorb, &resist, m_spellInfo); @@ -6418,10 +6418,6 @@ void AuraEffect::HandlePeriodicManaLeechAuraTick(Unit* target, Unit* caster) con sLog->outInfo(LOG_FILTER_SPELLS_AURAS, "PeriodicTick: %u (TypeId: %u) power leech of %u (TypeId: %u) for %u dmg inflicted by %u", GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), drainAmount, GetId()); - // resilience reduce mana draining effect at spell crit damage reduction (added in 2.4) - if (powerType == POWER_MANA) - drainAmount -= target->GetSpellCritDamageReduction(drainAmount); - int32 drainedAmount = -target->ModifyPower(powerType, -drainAmount); float gainMultiplier = GetSpellInfo()->Effects[GetEffIndex()].CalcValueMultiplier(caster); @@ -6536,10 +6532,6 @@ void AuraEffect::HandlePeriodicPowerBurnAuraTick(Unit* target, Unit* caster) con // ignore negative values (can be result apply spellmods to aura damage int32 damage = std::max(m_amount, 0); - // resilience reduce mana draining effect at spell crit damage reduction (added in 2.4) - if (powerType == POWER_MANA) - damage -= target->GetSpellCritDamageReduction(damage); - uint32 gain = uint32(-target->ModifyPower(powerType, -damage)); float dmgMultiplier = GetSpellInfo()->Effects[GetEffIndex()].CalcValueMultiplier(caster); diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index ebe005ca67e..2bb93b03112 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -1232,16 +1232,11 @@ void Spell::EffectPowerDrain(SpellEffIndex effIndex) damage = m_caster->SpellDamageBonusDone(unitTarget, m_spellInfo, uint32(damage), SPELL_DIRECT_DAMAGE); damage = unitTarget->SpellDamageBonusTaken(m_caster, m_spellInfo, uint32(damage), SPELL_DIRECT_DAMAGE); - // resilience reduce mana draining effect at spell crit damage reduction (added in 2.4) - int32 power = damage; - if (powerType == POWER_MANA) - power -= unitTarget->GetSpellCritDamageReduction(power); - - int32 newDamage = -(unitTarget->ModifyPower(powerType, -int32(power))); + int32 newDamage = -(unitTarget->ModifyPower(powerType, -damage)); float gainMultiplier = 0.0f; - // Don`t restore from self drain + // Don't restore from self drain if (m_caster != unitTarget) { gainMultiplier = m_spellInfo->Effects[effIndex].CalcValueMultiplier(m_originalCaster, this); @@ -1315,12 +1310,7 @@ void Spell::EffectPowerBurn(SpellEffIndex effIndex) damage = std::min(damage, maxDamage); } - int32 power = damage; - // resilience reduce mana draining effect at spell crit damage reduction (added in 2.4) - if (powerType == POWER_MANA) - power -= unitTarget->GetSpellCritDamageReduction(power); - - int32 newDamage = -(unitTarget->ModifyPower(powerType, -power)); + int32 newDamage = -(unitTarget->ModifyPower(powerType, -damage)); // NO - Not a typo - EffectPowerBurn uses effect value multiplier - not effect damage multiplier float dmgMultiplier = m_spellInfo->Effects[effIndex].CalcValueMultiplier(m_originalCaster, this); -- cgit v1.2.3 From a06a57a6c1f911d642dbbf499e70aa58990ba22c Mon Sep 17 00:00:00 2001 From: Warpten Date: Thu, 20 Dec 2012 20:09:29 +0100 Subject: Core/StatsSystem: Missing changes to previous commit. --- src/server/game/Entities/Player/Player.cpp | 4 +--- src/server/game/Entities/Unit/Unit.cpp | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 67e359cf4c7..14c0040ec9e 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -13690,9 +13690,7 @@ void Player::ApplyReforgeEnchantment(Item* item, bool apply) ApplyRatingMod(CR_CRIT_SPELL, -int32(removeValue), apply); break; case ITEM_MOD_RESILIENCE_RATING: - ApplyRatingMod(CR_CRIT_TAKEN_MELEE, -int32(removeValue), apply); - ApplyRatingMod(CR_CRIT_TAKEN_RANGED, -int32(removeValue), apply); - ApplyRatingMod(CR_CRIT_TAKEN_SPELL, -int32(removeValue), apply); + ApplyRatingMod(CR_RESILIENCE_PLAYER_DAMAGE_TAKEN, -int32(removeValue), apply); break; case ITEM_MOD_HASTE_RATING: ApplyRatingMod(CR_HASTE_MELEE, -int32(removeValue), apply); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index a4bbeb928d8..58566def5a9 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -10551,7 +10551,7 @@ uint32 Unit::MeleeDamageBonusTaken(Unit* attacker, uint32 pdamage, WeaponAttackT { if (GetTypeId() != TYPEID_PLAYER) continue; - float mod = ToPlayer()->GetRatingBonusValue(CR_CRIT_TAKEN_MELEE) * (-8.0f); + float mod = ToPlayer()->GetRatingBonusValue(CR_RESILIENCE_PLAYER_DAMAGE_TAKEN) * (-8.0f); AddPct(TakenTotalMod, std::max(mod, float((*i)->GetAmount()))); } break; -- cgit v1.2.3 From cf99043c1ef446fc6394a295d8bb6dbb1a0566f3 Mon Sep 17 00:00:00 2001 From: Warpten Date: Fri, 21 Dec 2012 19:37:50 +0100 Subject: Core/StatsSystem: Fixed resilience being considered in non-PvP situations. Also fixed build. --- src/server/game/Entities/Player/Player.cpp | 4 +--- src/server/game/Entities/Unit/Unit.cpp | 16 +++++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 14c0040ec9e..222fa6c1c74 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -13800,9 +13800,7 @@ void Player::ApplyReforgeEnchantment(Item* item, bool apply) ApplyRatingMod(CR_CRIT_SPELL, int32(addValue), apply); break; case ITEM_MOD_RESILIENCE_RATING: - ApplyRatingMod(CR_CRIT_TAKEN_MELEE, int32(addValue), apply); - ApplyRatingMod(CR_CRIT_TAKEN_RANGED, int32(addValue), apply); - ApplyRatingMod(CR_CRIT_TAKEN_SPELL, int32(addValue), apply); + ApplyRatingMod(CR_RESILIENCE_PLAYER_DAMAGE_TAKEN, int32(addValue), apply); break; case ITEM_MOD_HASTE_RATING: ApplyRatingMod(CR_HASTE_MELEE, int32(addValue), apply); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 58566def5a9..4d2934f5842 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -1224,7 +1224,7 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam damageInfo->HitInfo |= HITINFO_AFFECTS_VICTIM; int32 resilienceReduction = damageInfo->damage; - ApplyResilience(victim, &resilienceReduction, (damageInfo->hitOutCome == MELEE_HIT_CRIT)); + ApplyResilience(victim, &resilienceReduction, damageInfo->hitOutCome == MELEE_HIT_CRIT); resilienceReduction = damageInfo->damage - resilienceReduction; damageInfo->damage -= resilienceReduction; damageInfo->cleanDamage += resilienceReduction; @@ -15674,11 +15674,13 @@ void Unit::ApplyResilience(Unit const* victim, int32* damage, bool isCrit) const if (IsVehicle() || (victim->IsVehicle() && victim->GetTypeId() != TYPEID_PLAYER)) return; - Unit const* source = NULL; - if (GetTypeId() == TYPEID_PLAYER) - source = this; - else if (GetTypeId() == TYPEID_UNIT && GetOwner() && GetOwner()->GetTypeId() == TYPEID_PLAYER) - source = GetOwner(); + // Don't consider resilience if not in PvP - player or pet + bool isAllowedSource = (GetTypeId() == TYPEID_PLAYER); + if (!isAllowedSource && GetTypeId() == TYPEID_UNIT && GetOwner() && GetOwner()->GetTypeId() == TYPEID_PLAYER) + isAllowedSource = true; + + if (!isAllowedSource) + return; Unit const* target = NULL; if (victim->GetTypeId() == TYPEID_PLAYER) @@ -15691,7 +15693,7 @@ void Unit::ApplyResilience(Unit const* victim, int32* damage, bool isCrit) const if (isCrit) *damage = target->GetCritDamageReduction(*damage); - * damage = target->GetDamageReduction(*damage); + *damage = target->GetDamageReduction(*damage); } // Melee based spells can be miss, parry or dodge on this step -- cgit v1.2.3 From b5a3947a805c9ca9eca1150aa7a935c2611d742a Mon Sep 17 00:00:00 2001 From: Warpten Date: Fri, 21 Dec 2012 20:12:11 +0100 Subject: Core/StatsSystem: Fixing up "fucked up logic". Nayd's Seal of Approval. --- src/server/game/Entities/Unit/Unit.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 4d2934f5842..e8ac91eb145 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -15675,11 +15675,7 @@ void Unit::ApplyResilience(Unit const* victim, int32* damage, bool isCrit) const return; // Don't consider resilience if not in PvP - player or pet - bool isAllowedSource = (GetTypeId() == TYPEID_PLAYER); - if (!isAllowedSource && GetTypeId() == TYPEID_UNIT && GetOwner() && GetOwner()->GetTypeId() == TYPEID_PLAYER) - isAllowedSource = true; - - if (!isAllowedSource) + if (!GetCharmerOrOwnerPlayerOrPlayerItself()) return; Unit const* target = NULL; -- cgit v1.2.3 From d40cbe0113329de96723e8fe015651c919760a15 Mon Sep 17 00:00:00 2001 From: Warpten Date: Sat, 22 Dec 2012 18:10:50 +0100 Subject: Core/Battlegrounds: Another typo when building battleground log data. --- src/server/game/Battlegrounds/BattlegroundMgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index 2244dd8b9e8..1474440959d 100644 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -403,7 +403,7 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg) data->WriteBit(playerGUID[5]); data->WriteBit(playerGUID[1]); data->WriteBit(playerGUID[6]); - data->WriteBit(player->GetBGTeam() == ALLIANCE); + data->WriteBit(player->GetBGTeam() == TEAM_ALLIANCE); data->WriteBit(playerGUID[7]); buff << uint32(itr->second->HealingDone); // healing done -- cgit v1.2.3 From 92374d203d2926ac5fd300ce6b0c0341cebfe891 Mon Sep 17 00:00:00 2001 From: QT Date: Sat, 22 Dec 2012 22:21:33 +0100 Subject: Core/Leveling: Prevent blue text spam 'Your skill in Axes increased to 30' closes #8484 --- src/server/game/Entities/Player/Player.cpp | 6 ++++++ src/server/game/Spells/SpellMgr.cpp | 12 ++++++------ src/server/game/Spells/SpellMgr.h | 2 ++ 3 files changed, 14 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 222fa6c1c74..ffda2efc0b1 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -6280,6 +6280,9 @@ void Player::UpdateSkillsForLevel() if (GetSkillRangeType(pSkill, false) != SKILL_RANGE_LEVEL) continue; + if (IsWeaponSkill(pSkill->id)) + continue; + uint16 field = itr->second.pos / 2; uint8 offset = itr->second.pos & 1; // itr->second.pos % 2 @@ -6308,6 +6311,9 @@ void Player::UpdateSkillsToMaxSkillsForLevel() if (IsProfessionOrRidingSkill(pskill)) continue; + if (IsWeaponSkill(pskill)) + continue; + uint16 field = itr->second.pos / 2; uint8 offset = itr->second.pos & 1; // itr->second.pos % 2 diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 308ac07f404..3e221536b13 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -37,13 +37,13 @@ bool IsPrimaryProfessionSkill(uint32 skill) { SkillLineEntry const* pSkill = sSkillLineStore.LookupEntry(skill); - if (!pSkill) - return false; - - if (pSkill->categoryId != SKILL_CATEGORY_PROFESSION) - return false; + return pSkill && pSkill->categoryId == SKILL_CATEGORY_PROFESSION; +} - return true; +bool IsWeaponSkill(uint32 skill) +{ + SkillLineEntry const* pSkill = sSkillLineStore.LookupEntry(skill); + return pSkill && pSkill->categoryId == SKILL_CATEGORY_WEAPON; } bool IsPartOfSkillLine(uint32 skillId, uint32 spellId) diff --git a/src/server/game/Spells/SpellMgr.h b/src/server/game/Spells/SpellMgr.h index cec9d4650f5..2cfc8aad624 100644 --- a/src/server/game/Spells/SpellMgr.h +++ b/src/server/game/Spells/SpellMgr.h @@ -578,6 +578,8 @@ typedef std::map > SpellLinkedMap; bool IsPrimaryProfessionSkill(uint32 skill); +bool IsWeaponSkill(uint32 skill); + inline bool IsProfessionSkill(uint32 skill) { return IsPrimaryProfessionSkill(skill) || skill == SKILL_FISHING || skill == SKILL_COOKING || skill == SKILL_FIRST_AID; -- cgit v1.2.3 From 8c53f042ad02259b0cd6a49a9730b9bd0cdfe04a Mon Sep 17 00:00:00 2001 From: Warpten Date: Sat, 22 Dec 2012 23:32:07 +0100 Subject: Core/StatsSystem: Typos, typos everywhere. Thanks @Wayt for noticing. --- src/server/game/Entities/Player/Player.cpp | 10 ++++------ src/server/game/Entities/Unit/Unit.cpp | 4 ++-- src/server/game/Entities/Unit/Unit.h | 2 -- 3 files changed, 6 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index ffda2efc0b1..897df8b1633 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -5889,7 +5889,7 @@ float Player::GetRatingBonusValue(CombatRating cr) const float baseResult = float(GetUInt32Value(PLAYER_FIELD_COMBAT_RATING_1 + cr)) * GetRatingMultiplier(cr); if (cr != CR_RESILIENCE_PLAYER_DAMAGE_TAKEN) return baseResult; - return float(1.0f - pow(0.99f, baseResult)); + return float(1.0f - pow(0.99f, baseResult)) * 100.0f; } float Player::GetExpertiseDodgeOrParryReduction(WeaponAttackType attType) const @@ -5927,7 +5927,7 @@ float Player::OCTRegenMPPerSpirit() void Player::ApplyRatingMod(CombatRating cr, int32 value, bool apply) { - m_baseRatingValue[cr]+=(apply ? value : -value); + m_baseRatingValue[cr] +=(apply ? value : -value); // explicit affected values switch (cr) @@ -5943,14 +5943,12 @@ void Player::ApplyRatingMod(CombatRating cr, int32 value, bool apply) } case CR_HASTE_RANGED: { - float RatingChange = value * GetRatingMultiplier(cr); - ApplyAttackTimePercentMod(RANGED_ATTACK, RatingChange, apply); + ApplyAttackTimePercentMod(RANGED_ATTACK, value * GetRatingMultiplier(cr), apply); break; } case CR_HASTE_SPELL: { - float RatingChange = value * GetRatingMultiplier(cr); - ApplyCastTimePercentMod(RatingChange, apply); + ApplyCastTimePercentMod(value * GetRatingMultiplier(cr), apply); break; } default: diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index e8ac91eb145..f95c808d167 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -15688,8 +15688,8 @@ void Unit::ApplyResilience(Unit const* victim, int32* damage, bool isCrit) const return; if (isCrit) - *damage = target->GetCritDamageReduction(*damage); - *damage = target->GetDamageReduction(*damage); + *damage -= target->GetCritDamageReduction(*damage); + *damage -= target->GetDamageReduction(*damage); } // Melee based spells can be miss, parry or dodge on this step diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 515e7644299..cb58b79794e 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1451,8 +1451,6 @@ class Unit : public WorldObject // player or player's pet resilience (-1%) uint32 GetCritDamageReduction(uint32 damage) const { return GetCombatRatingDamageReduction(CR_RESILIENCE_CRIT_TAKEN, 2.2f, 33.0f, damage); } - - // player or player's pet resilience (-1%), cap 100% uint32 GetDamageReduction(uint32 damage) const { return GetCombatRatingDamageReduction(CR_RESILIENCE_PLAYER_DAMAGE_TAKEN, 2.0f, 100.0f, damage); } void ApplyResilience(const Unit* victim, int32 * damage, bool isCrit) const; -- cgit v1.2.3 From f4bd89ba03fe06c774639ebed22ade2c28ae5b4e Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 23 Dec 2012 09:07:32 -0500 Subject: Build/Core: Fixed build. --- src/server/game/Entities/Unit/Unit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index ad4ada215d9..0d532205c0c 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -16721,7 +16721,7 @@ void Unit::SendTeleportPacket(Position& oldPos) data.WriteByteSeq(guid[6]); data << float(GetPositionY()); - if (GetTypeId == TYPEID_PLAYER) + if (GetTypeId() == TYPEID_PLAYER) Relocate(&oldPos); SendMessageToSet(&data, false); -- cgit v1.2.3 From 64775fba3ef653e843c3a525bf58804267aee591 Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 23 Dec 2012 13:51:17 -0500 Subject: Fixed a merge fail --- src/server/game/Entities/Player/Player.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 471cbc6d114..9615513a181 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -20331,6 +20331,11 @@ void Player::WhisperAddon(const std::string& text, const std::string& prefix, Pl void Player::Whisper(const std::string& text, uint32 language, uint64 receiver) { + bool isAddonMessage = language == LANG_ADDON; + + if (!isAddonMessage) // if not addon data + language = LANG_UNIVERSAL; // whispers should always be readable + Player* rPlayer = ObjectAccessor::FindPlayer(receiver); std::string _text(text); -- cgit v1.2.3 From 497dcc5974766b5017460378f87c5d7a1ca91027 Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 23 Dec 2012 18:15:15 -0500 Subject: Core/Chat: Fixed raid boss emotes. --- src/server/game/Entities/Object/Object.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 1e255890178..62977a0bc78 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -2294,6 +2294,11 @@ void WorldObject::BuildMonsterChat(WorldPacket* data, uint8 msgtype, char const* *data << (uint32)(strlen(text)+1); *data << text; *data << (uint8)0; // ChatTag + if (msgtype == CHAT_MSG_RAID_BOSS_EMOTE) + { + *data << float(0); + *data << uint8(0); + } } void Unit::BuildHeartBeatMsg(WorldPacket* data) const -- cgit v1.2.3 From 181b8fca51675ae18fb5e898c3f303768059cc6b Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 23 Dec 2012 18:31:30 -0500 Subject: Core/Chat: CHAT_MSG_RAID_BOSS_WHISPER also sends extra data Note: SMSG_MESSAGECHAT is bloated all around the core, a complete mess. --- src/server/game/Battlefield/Battlefield.cpp | 2 ++ src/server/game/Entities/Object/Object.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Battlefield/Battlefield.cpp b/src/server/game/Battlefield/Battlefield.cpp index 6431f8a3479..f0fc16b73d5 100644 --- a/src/server/game/Battlefield/Battlefield.cpp +++ b/src/server/game/Battlefield/Battlefield.cpp @@ -459,6 +459,8 @@ WorldPacket Battlefield::BuildWarningAnnPacket(std::string const& msg) data << uint32(msg.length() + 1); data << msg; data << uint8(0); + data << float(0); + data << uint8(0); return data; } diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 62977a0bc78..9bd04a17c78 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -2294,7 +2294,7 @@ void WorldObject::BuildMonsterChat(WorldPacket* data, uint8 msgtype, char const* *data << (uint32)(strlen(text)+1); *data << text; *data << (uint8)0; // ChatTag - if (msgtype == CHAT_MSG_RAID_BOSS_EMOTE) + if (msgtype == CHAT_MSG_RAID_BOSS_EMOTE || msgtype == CHAT_MSG_RAID_BOSS_WHISPER) { *data << float(0); *data << uint8(0); -- cgit v1.2.3 From 8a52e6b1e366d3eabd7ecf19c16ab0482c084a7c Mon Sep 17 00:00:00 2001 From: Warpten Date: Mon, 24 Dec 2012 01:51:43 +0100 Subject: Core/Battlegrounds: Corrected one typo in SMSG_BATTLEFIELD_STATUS_ACTIVE. --- src/server/game/Battlegrounds/BattlegroundMgr.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src') diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index 1474440959d..141cdee531d 100644 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -173,8 +173,6 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro data->WriteBit(playerGuid[5]); data->WriteBit(playerGuid[2]); - data->FlushBits(); - data->WriteByteSeq(playerGuid[5]); data->WriteByteSeq(playerGuid[6]); data->WriteByteSeq(playerGuid[7]); @@ -274,8 +272,6 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro data->WriteBit(bgGuid[5]); data->WriteBit(playerGuid[0]); - data->FlushBits(); - data->WriteByteSeq(bgGuid[6]); data->WriteByteSeq(bgGuid[5]); data->WriteByteSeq(bgGuid[7]); @@ -346,7 +342,7 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro data->WriteByteSeq(playerGuid[0]); data->WriteByteSeq(playerGuid[3]); - data->WriteByteSeq(playerGuid[2]); + data->WriteByteSeq(bgGuid[2]); *data << uint32(bg->GetClientInstanceID()); // Client Instance ID or faction ? -- cgit v1.2.3 From ec6f7541b7b71b6948336de1a8e54ce36d58a918 Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Mon, 24 Dec 2012 14:38:31 +0100 Subject: Core: Fix merge fail --- .../EasternKingdoms/ZulGurub/boss_arlokk.cpp | 293 ---------- .../EasternKingdoms/ZulGurub/boss_hakkar.cpp | 262 --------- .../EasternKingdoms/ZulGurub/boss_jeklik.cpp | 308 ----------- .../EasternKingdoms/ZulGurub/boss_jindo.cpp | 286 ---------- .../EasternKingdoms/ZulGurub/boss_marli.cpp | 278 ---------- .../EasternKingdoms/ZulGurub/boss_thekal.cpp | 588 --------------------- 6 files changed, 2015 deletions(-) delete mode 100644 src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp delete mode 100644 src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp delete mode 100644 src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp delete mode 100644 src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp delete mode 100644 src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp delete mode 100644 src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp (limited to 'src') diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp deleted file mode 100644 index c5639a68860..00000000000 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp +++ /dev/null @@ -1,293 +0,0 @@ -/* - * Copyright (C) 2008-2012 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 - * - * 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; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; 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, see . - */ - -/* ScriptData -SDName: Boss_Arlokk -SD%Complete: 95 -SDComment: Wrong cleave and red aura is missing. -SDCategory: Zul'Gurub -EndScriptData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "zulgurub.h" - -enum eYells -{ - SAY_AGGRO = 0, - SAY_FEAST_PANTHER = 1, - SAY_DEATH = 2, -}; - -enum eSpells -{ - SPELL_SHADOWWORDPAIN = 23952, - SPELL_GOUGE = 24698, - SPELL_MARK = 24210, - SPELL_CLEAVE = 26350, //Perhaps not right. Not a red aura... - SPELL_PANTHER_TRANSFORM = 24190, - - MODEL_ID_NORMAL = 15218, - MODEL_ID_PANTHER = 15215, - MODEL_ID_BLANK = 11686, - - NPC_ZULIAN_PROWLER = 15101 -}; - -class boss_arlokk : public CreatureScript -{ - public: - - boss_arlokk() - : CreatureScript("boss_arlokk") - { - } - - struct boss_arlokkAI : public ScriptedAI - { - boss_arlokkAI(Creature* creature) : ScriptedAI(creature) - { - instance = creature->GetInstanceScript(); - } - - InstanceScript* instance; - - uint32 m_uiShadowWordPain_Timer; - uint32 m_uiGouge_Timer; - uint32 m_uiMark_Timer; - uint32 m_uiCleave_Timer; - uint32 m_uiVanish_Timer; - uint32 m_uiVisible_Timer; - - uint32 m_uiSummon_Timer; - uint32 m_uiSummonCount; - - Unit* m_pMarkedTarget; - uint64 MarkedTargetGUID; - - bool m_bIsPhaseTwo; - bool m_bIsVanished; - - void Reset() - { - m_uiShadowWordPain_Timer = 8000; - m_uiGouge_Timer = 14000; - m_uiMark_Timer = 35000; - m_uiCleave_Timer = 4000; - m_uiVanish_Timer = 60000; - m_uiVisible_Timer = 6000; - - m_uiSummon_Timer = 5000; - m_uiSummonCount = 0; - - m_bIsPhaseTwo = false; - m_bIsVanished = false; - - MarkedTargetGUID = 0; - - me->SetDisplayId(MODEL_ID_NORMAL); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - - void EnterCombat(Unit* /*who*/) - { - Talk(SAY_AGGRO); - } - - void JustReachedHome() - { - if (instance) - instance->SetData(DATA_ARLOKK, NOT_STARTED); - - //we should be summoned, so despawn - me->DespawnOrUnsummon(); - } - - void JustDied(Unit* /*killer*/) - { - Talk(SAY_DEATH); - - me->SetDisplayId(MODEL_ID_NORMAL); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - - if (instance) - instance->SetData(DATA_ARLOKK, DONE); - } - - void DoSummonPhanters() - { - if (MarkedTargetGUID) - Talk(SAY_FEAST_PANTHER, MarkedTargetGUID); - - me->SummonCreature(NPC_ZULIAN_PROWLER, -11532.7998f, -1649.6734f, 41.4800f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - me->SummonCreature(NPC_ZULIAN_PROWLER, -11532.9970f, -1606.4840f, 41.2979f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - } - - void JustSummoned(Creature* summoned) - { - if (Unit* pMarkedTarget = Unit::GetUnit(*me, MarkedTargetGUID)) - summoned->AI()->AttackStart(pMarkedTarget); - - ++m_uiSummonCount; - } - - void UpdateAI(const uint32 uiDiff) - { - if (!UpdateVictim()) - return; - - if (!m_bIsPhaseTwo) - { - if (m_uiShadowWordPain_Timer <= uiDiff) - { - DoCast(me->getVictim(), SPELL_SHADOWWORDPAIN); - m_uiShadowWordPain_Timer = 15000; - } - else - m_uiShadowWordPain_Timer -= uiDiff; - - if (m_uiMark_Timer <= uiDiff) - { - Unit* pMarkedTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); - - if (pMarkedTarget) - { - DoCast(pMarkedTarget, SPELL_MARK); - MarkedTargetGUID = pMarkedTarget->GetGUID(); - } - else - sLog->outError(LOG_FILTER_TSCR, "boss_arlokk could not accuire pMarkedTarget."); - - m_uiMark_Timer = 15000; - } - else - m_uiMark_Timer -= uiDiff; - } - else - { - //Cleave_Timer - if (m_uiCleave_Timer <= uiDiff) - { - DoCast(me->getVictim(), SPELL_CLEAVE); - m_uiCleave_Timer = 16000; - } - else - m_uiCleave_Timer -= uiDiff; - - //Gouge_Timer - if (m_uiGouge_Timer <= uiDiff) - { - DoCast(me->getVictim(), SPELL_GOUGE); - - DoModifyThreatPercent(me->getVictim(), -80); - - m_uiGouge_Timer = 17000+rand()%10000; - } - else - m_uiGouge_Timer -= uiDiff; - } - - if (m_uiSummonCount <= 30) - { - if (m_uiSummon_Timer <= uiDiff) - { - DoSummonPhanters(); - m_uiSummon_Timer = 5000; - } - else - m_uiSummon_Timer -= uiDiff; - } - - if (m_uiVanish_Timer <= uiDiff) - { - //Invisble Model - me->SetDisplayId(MODEL_ID_BLANK); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - - me->AttackStop(); - DoResetThreat(); - - m_bIsVanished = true; - - m_uiVanish_Timer = 45000; - m_uiVisible_Timer = 6000; - } - else - m_uiVanish_Timer -= uiDiff; - - if (m_bIsVanished) - { - if (m_uiVisible_Timer <= uiDiff) - { - //The Panther Model - me->SetDisplayId(MODEL_ID_PANTHER); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - - const CreatureTemplate* cinfo = me->GetCreatureTemplate(); - me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35))); - me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35))); - me->UpdateDamagePhysical(BASE_ATTACK); - - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) - AttackStart(target); - - m_bIsPhaseTwo = true; - m_bIsVanished = false; - } - else - m_uiVisible_Timer -= uiDiff; - } - else - DoMeleeAttackIfReady(); - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new boss_arlokkAI(creature); - } -}; - -class go_gong_of_bethekk : public GameObjectScript -{ - public: - go_gong_of_bethekk() : GameObjectScript("go_gong_of_bethekk") - { - } - - bool OnGossipHello(Player* /*player*/, GameObject* go) - { - if (InstanceScript* instance = go->GetInstanceScript()) - { - if (instance->GetData(DATA_ARLOKK) == DONE || instance->GetData(DATA_ARLOKK) == IN_PROGRESS) - return true; - - instance->SetData(DATA_ARLOKK, IN_PROGRESS); - return true; - } - - return true; - } -}; - -void AddSC_boss_arlokk() -{ - new boss_arlokk(); - new go_gong_of_bethekk(); -} - diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp deleted file mode 100644 index 7d80de88beb..00000000000 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Copyright (C) 2008-2012 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 - * - * 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; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; 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, see . - */ - -/* ScriptData -SDName: Boss_Hakkar -SD%Complete: 95 -SDComment: Blood siphon spell buggy cause of Core Issue. -SDCategory: Zul'Gurub -EndScriptData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "zulgurub.h" - -enum Hakkar -{ - SAY_AGGRO = 0, - SAY_FLEEING = 1, - SAY_MINION_DESTROY = 2, //where does it belong? - SAY_PROTECT_ALTAR = 3, //where does it belong? - - SPELL_BLOODSIPHON = 24322, - SPELL_CORRUPTEDBLOOD = 24328, - SPELL_CAUSEINSANITY = 24327, //Not working disabled. - SPELL_WILLOFHAKKAR = 24178, - SPELL_ENRAGE = 24318, - -// The Aspects of all High Priests - SPELL_ASPECT_OF_JEKLIK = 24687, - SPELL_ASPECT_OF_VENOXIS = 24688, - SPELL_ASPECT_OF_MARLI = 24686, - SPELL_ASPECT_OF_THEKAL = 24689, - SPELL_ASPECT_OF_ARLOKK = 24690 -}; - -class boss_hakkar : public CreatureScript -{ - public: - - boss_hakkar() - : CreatureScript("boss_hakkar") - { - } - - struct boss_hakkarAI : public ScriptedAI - { - boss_hakkarAI(Creature* creature) : ScriptedAI(creature) - { - instance = creature->GetInstanceScript(); - } - - InstanceScript* instance; - - uint32 BloodSiphon_Timer; - uint32 CorruptedBlood_Timer; - uint32 CauseInsanity_Timer; - uint32 WillOfHakkar_Timer; - uint32 Enrage_Timer; - - uint32 CheckJeklik_Timer; - uint32 CheckVenoxis_Timer; - uint32 CheckMarli_Timer; - uint32 CheckThekal_Timer; - uint32 CheckArlokk_Timer; - - uint32 AspectOfJeklik_Timer; - uint32 AspectOfVenoxis_Timer; - uint32 AspectOfMarli_Timer; - uint32 AspectOfThekal_Timer; - uint32 AspectOfArlokk_Timer; - - bool Enraged; - - void Reset() - { - BloodSiphon_Timer = 90000; - CorruptedBlood_Timer = 25000; - CauseInsanity_Timer = 17000; - WillOfHakkar_Timer = 17000; - Enrage_Timer = 600000; - - CheckJeklik_Timer = 1000; - CheckVenoxis_Timer = 2000; - CheckMarli_Timer = 3000; - CheckThekal_Timer = 4000; - CheckArlokk_Timer = 5000; - - AspectOfJeklik_Timer = 4000; - AspectOfVenoxis_Timer = 7000; - AspectOfMarli_Timer = 12000; - AspectOfThekal_Timer = 8000; - AspectOfArlokk_Timer = 18000; - - Enraged = false; - } - - void EnterCombat(Unit* /*who*/) - { - Talk(SAY_AGGRO); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //BloodSiphon_Timer - if (BloodSiphon_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_BLOODSIPHON); - BloodSiphon_Timer = 90000; - } else BloodSiphon_Timer -= diff; - - //CorruptedBlood_Timer - if (CorruptedBlood_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CORRUPTEDBLOOD); - CorruptedBlood_Timer = urand(30000, 45000); - } else CorruptedBlood_Timer -= diff; - - //CauseInsanity_Timer - /*if (CauseInsanity_Timer <= diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_CAUSEINSANITY); - - CauseInsanity_Timer = urand(35000, 43000); - } else CauseInsanity_Timer -= diff;*/ - - //WillOfHakkar_Timer - if (WillOfHakkar_Timer <= diff) - { - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_WILLOFHAKKAR); - - WillOfHakkar_Timer = urand(25000, 35000); - } else WillOfHakkar_Timer -= diff; - - if (!Enraged && Enrage_Timer <= diff) - { - DoCast(me, SPELL_ENRAGE); - Enraged = true; - } else Enrage_Timer -= diff; - - //Checking if Jeklik is dead. If not we cast her Aspect - if (CheckJeklik_Timer <= diff) - { - if (instance) - { - if (instance->GetData(DATA_JEKLIK) != DONE) - { - if (AspectOfJeklik_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_ASPECT_OF_JEKLIK); - AspectOfJeklik_Timer = urand(10000, 14000); - } else AspectOfJeklik_Timer -= diff; - } - } - CheckJeklik_Timer = 1000; - } else CheckJeklik_Timer -= diff; - - //Checking if Venoxis is dead. If not we cast his Aspect - if (CheckVenoxis_Timer <= diff) - { - if (instance) - { - if (instance->GetData(DATA_VENOXIS) != DONE) - { - if (AspectOfVenoxis_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_ASPECT_OF_VENOXIS); - AspectOfVenoxis_Timer = 8000; - } else AspectOfVenoxis_Timer -= diff; - } - } - CheckVenoxis_Timer = 1000; - } else CheckVenoxis_Timer -= diff; - - //Checking if Marli is dead. If not we cast her Aspect - if (CheckMarli_Timer <= diff) - { - if (instance) - { - if (instance->GetData(DATA_MARLI) != DONE) - { - if (AspectOfMarli_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_ASPECT_OF_MARLI); - AspectOfMarli_Timer = 10000; - } else AspectOfMarli_Timer -= diff; - - } - } - CheckMarli_Timer = 1000; - } else CheckMarli_Timer -= diff; - - //Checking if Thekal is dead. If not we cast his Aspect - if (CheckThekal_Timer <= diff) - { - if (instance) - { - if (instance->GetData(DATA_THEKAL) != DONE) - { - if (AspectOfThekal_Timer <= diff) - { - DoCast(me, SPELL_ASPECT_OF_THEKAL); - AspectOfThekal_Timer = 15000; - } else AspectOfThekal_Timer -= diff; - } - } - CheckThekal_Timer = 1000; - } else CheckThekal_Timer -= diff; - - //Checking if Arlokk is dead. If yes we cast her Aspect - if (CheckArlokk_Timer <= diff) - { - if (instance) - { - if (instance->GetData(DATA_ARLOKK) != DONE) - { - if (AspectOfArlokk_Timer <= diff) - { - DoCast(me, SPELL_ASPECT_OF_ARLOKK); - DoResetThreat(); - - AspectOfArlokk_Timer = urand(10000, 15000); - } else AspectOfArlokk_Timer -= diff; - } - } - CheckArlokk_Timer = 1000; - } else CheckArlokk_Timer -= diff; - - DoMeleeAttackIfReady(); - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new boss_hakkarAI(creature); - } -}; - -void AddSC_boss_hakkar() -{ - new boss_hakkar(); -} - diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp deleted file mode 100644 index 3a2da6fdba9..00000000000 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp +++ /dev/null @@ -1,308 +0,0 @@ -/* - * Copyright (C) 2008-2012 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 - * - * 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; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; 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, see . - */ - -/* ScriptData -SDName: Boss_Jeklik -SD%Complete: 85 -SDComment: Problem in finding the right flying batriders for spawning and making them fly. -SDCategory: Zul'Gurub -EndScriptData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "zulgurub.h" - -enum Jeklik -{ - SAY_AGGRO = 0, - SAY_RAIN_FIRE = 1, - SAY_DEATH = 2, - - SPELL_CHARGE = 22911, - SPELL_SONICBURST = 23918, - SPELL_SCREECH = 6605, - SPELL_SHADOW_WORD_PAIN = 23952, - SPELL_MIND_FLAY = 23953, - SPELL_CHAIN_MIND_FLAY = 26044, //Right ID unknown. So disabled - SPELL_GREATERHEAL = 23954, - SPELL_BAT_FORM = 23966, - - // Batriders Spell - SPELL_BOMB = 40332 //Wrong ID but Magmadars bomb is not working... -}; - -class boss_jeklik : public CreatureScript -{ - public: - - boss_jeklik() - : CreatureScript("boss_jeklik") - { - } - - struct boss_jeklikAI : public ScriptedAI - { - boss_jeklikAI(Creature* creature) : ScriptedAI(creature) - { - instance = creature->GetInstanceScript(); - } - - InstanceScript* instance; - - uint32 Charge_Timer; - uint32 SonicBurst_Timer; - uint32 Screech_Timer; - uint32 SpawnBats_Timer; - uint32 ShadowWordPain_Timer; - uint32 MindFlay_Timer; - uint32 ChainMindFlay_Timer; - uint32 GreaterHeal_Timer; - uint32 SpawnFlyingBats_Timer; - - bool PhaseTwo; - - void Reset() - { - Charge_Timer = 20000; - SonicBurst_Timer = 8000; - Screech_Timer = 13000; - SpawnBats_Timer = 60000; - ShadowWordPain_Timer = 6000; - MindFlay_Timer = 11000; - ChainMindFlay_Timer = 26000; - GreaterHeal_Timer = 50000; - SpawnFlyingBats_Timer = 10000; - - PhaseTwo = false; - } - - void EnterCombat(Unit* /*who*/) - { - Talk(SAY_AGGRO); - DoCast(me, SPELL_BAT_FORM); - } - - void JustDied(Unit* /*killer*/) - { - Talk(SAY_DEATH); - - if (instance) - instance->SetData(DATA_JEKLIK, DONE); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (me->getVictim() && me->isAlive()) - { - if (HealthAbovePct(50)) - { - if (Charge_Timer <= diff) - { - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) - { - DoCast(target, SPELL_CHARGE); - AttackStart(target); - } - - Charge_Timer = urand(15000, 30000); - } else Charge_Timer -= diff; - - if (SonicBurst_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SONICBURST); - SonicBurst_Timer = urand(8000, 13000); - } else SonicBurst_Timer -= diff; - - if (Screech_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SCREECH); - Screech_Timer = urand(18000, 26000); - } else Screech_Timer -= diff; - - if (SpawnBats_Timer <= diff) - { - Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0); - - Creature* Bat = NULL; - Bat = me->SummonCreature(11368, -12291.6220f, -1380.2640f, 144.8304f, 5.483f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (target && Bat) Bat ->AI()->AttackStart(target); - - Bat = me->SummonCreature(11368, -12289.6220f, -1380.2640f, 144.8304f, 5.483f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (target && Bat) Bat ->AI()->AttackStart(target); - - Bat = me->SummonCreature(11368, -12293.6220f, -1380.2640f, 144.8304f, 5.483f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (target && Bat) Bat ->AI()->AttackStart(target); - - Bat = me->SummonCreature(11368, -12291.6220f, -1380.2640f, 144.8304f, 5.483f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (target && Bat) Bat ->AI()->AttackStart(target); - - Bat = me->SummonCreature(11368, -12289.6220f, -1380.2640f, 144.8304f, 5.483f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (target && Bat) Bat ->AI()->AttackStart(target); - Bat = me->SummonCreature(11368, -12293.6220f, -1380.2640f, 144.8304f, 5.483f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (target && Bat) Bat ->AI()->AttackStart(target); - - SpawnBats_Timer = 60000; - } else SpawnBats_Timer -= diff; - } - else - { - if (PhaseTwo) - { - if (PhaseTwo && ShadowWordPain_Timer <= diff) - { - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) - { - DoCast(target, SPELL_SHADOW_WORD_PAIN); - ShadowWordPain_Timer = urand(12000, 18000); - } - }ShadowWordPain_Timer -=diff; - - if (MindFlay_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_MIND_FLAY); - MindFlay_Timer = 16000; - }MindFlay_Timer -=diff; - - if (ChainMindFlay_Timer <= diff) - { - me->InterruptNonMeleeSpells(false); - DoCast(me->getVictim(), SPELL_CHAIN_MIND_FLAY); - ChainMindFlay_Timer = urand(15000, 30000); - }ChainMindFlay_Timer -=diff; - - if (GreaterHeal_Timer <= diff) - { - me->InterruptNonMeleeSpells(false); - DoCast(me, SPELL_GREATERHEAL); - GreaterHeal_Timer = urand(25000, 35000); - }GreaterHeal_Timer -=diff; - - if (SpawnFlyingBats_Timer <= diff) - { - Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0); - if (!target) - return; - - Creature* FlyingBat = me->SummonCreature(14965, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ()+15, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (FlyingBat) - FlyingBat->AI()->AttackStart(target); - - SpawnFlyingBats_Timer = urand(10000, 15000); - } else SpawnFlyingBats_Timer -=diff; - } - else - { - me->SetDisplayId(15219); - DoResetThreat(); - PhaseTwo = true; - } - } - - DoMeleeAttackIfReady(); - } - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new boss_jeklikAI(creature); - } -}; - -//Flying Bat -class mob_batrider : public CreatureScript -{ - public: - - mob_batrider() - : CreatureScript("mob_batrider") - { - } - - struct mob_batriderAI : public ScriptedAI - { - mob_batriderAI(Creature* creature) : ScriptedAI(creature) - { - instance = creature->GetInstanceScript(); - } - - InstanceScript* instance; - - uint32 Bomb_Timer; - uint32 Check_Timer; - - void Reset() - { - Bomb_Timer = 2000; - Check_Timer = 1000; - - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - - void EnterCombat(Unit* /*who*/) {} - - void UpdateAI (const uint32 diff) - { - if (!UpdateVictim()) - return; - - //Bomb_Timer - if (Bomb_Timer <= diff) - { - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) - { - DoCast(target, SPELL_BOMB); - Bomb_Timer = 5000; - } - } else Bomb_Timer -= diff; - - //Check_Timer - if (Check_Timer <= diff) - { - if (instance) - { - if (instance->GetData(DATA_JEKLIK) == DONE) - { - me->setDeathState(JUST_DIED); - me->RemoveCorpse(); - return; - } - } - - Check_Timer = 1000; - } else Check_Timer -= diff; - - DoMeleeAttackIfReady(); - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_batriderAI(creature); - } -}; - -void AddSC_boss_jeklik() -{ - new boss_jeklik(); - new mob_batrider(); -} - diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp deleted file mode 100644 index 844a2b16800..00000000000 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp +++ /dev/null @@ -1,286 +0,0 @@ -/* - * Copyright (C) 2008-2012 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 - * - * 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; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; 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, see . - */ - -/* ScriptData -SDName: Boss_Jin'do the Hexxer -SD%Complete: 85 -SDComment: Mind Control not working because of core bug. Shades visible for all. -SDCategory: Zul'Gurub -EndScriptData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "zulgurub.h" - -enum Jindo -{ - SAY_AGGRO = 1, - - SPELL_BRAINWASHTOTEM = 24262, - SPELL_POWERFULLHEALINGWARD = 24309, //We will not use this spell. We will summon a totem by script cause the spell totems will not cast. - SPELL_HEX = 24053, - SPELL_DELUSIONSOFJINDO = 24306, - SPELL_SHADEOFJINDO = 24308, //We will not use this spell. We will summon a shade by script. - - //Healing Ward Spell - SPELL_HEAL = 38588, //Totems are not working right. Right heal spell ID is 24311 but this spell is not casting... - - //Shade of Jindo Spell - SPELL_SHADOWSHOCK = 19460, - SPELL_INVISIBLE = 24699 -}; - -class boss_jindo : public CreatureScript -{ - public: - - boss_jindo() - : CreatureScript("boss_jindo") - { - } - - struct boss_jindoAI : public ScriptedAI - { - boss_jindoAI(Creature* creature) : ScriptedAI(creature) {} - - uint32 BrainWashTotem_Timer; - uint32 HealingWard_Timer; - uint32 Hex_Timer; - uint32 Delusions_Timer; - uint32 Teleport_Timer; - - void Reset() - { - BrainWashTotem_Timer = 20000; - HealingWard_Timer = 16000; - Hex_Timer = 8000; - Delusions_Timer = 10000; - Teleport_Timer = 5000; - } - - void EnterCombat(Unit* /*who*/) - { - Talk(SAY_AGGRO); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //BrainWashTotem_Timer - if (BrainWashTotem_Timer <= diff) - { - DoCast(me, SPELL_BRAINWASHTOTEM); - BrainWashTotem_Timer = urand(18000, 26000); - } else BrainWashTotem_Timer -= diff; - - //HealingWard_Timer - if (HealingWard_Timer <= diff) - { - //DoCast(me, SPELL_POWERFULLHEALINGWARD); - me->SummonCreature(14987, me->GetPositionX()+3, me->GetPositionY()-2, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000); - HealingWard_Timer = urand(14000, 20000); - } else HealingWard_Timer -= diff; - - //Hex_Timer - if (Hex_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_HEX); - - if (DoGetThreat(me->getVictim())) - DoModifyThreatPercent(me->getVictim(), -80); - - Hex_Timer = urand(12000, 20000); - } else Hex_Timer -= diff; - - //Casting the delusion curse with a shade. So shade will attack the same target with the curse. - if (Delusions_Timer <= diff) - { - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) - { - DoCast(target, SPELL_DELUSIONSOFJINDO); - - Creature* Shade = me->SummonCreature(14986, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Shade) - Shade->AI()->AttackStart(target); - } - - Delusions_Timer = urand(4000, 12000); - } else Delusions_Timer -= diff; - - //Teleporting a random gamer and spawning 9 skeletons that will attack this gamer - if (Teleport_Timer <= diff) - { - Unit* target = NULL; - target = SelectTarget(SELECT_TARGET_RANDOM, 0); - if (target && target->GetTypeId() == TYPEID_PLAYER) - { - DoTeleportPlayer(target, -11583.7783f, -1249.4278f, 77.5471f, 4.745f); - - if (DoGetThreat(me->getVictim())) - DoModifyThreatPercent(target, -100); - - Creature* Skeletons; - Skeletons = me->SummonCreature(14826, target->GetPositionX()+2, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Skeletons) - Skeletons->AI()->AttackStart(target); - Skeletons = me->SummonCreature(14826, target->GetPositionX()-2, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Skeletons) - Skeletons->AI()->AttackStart(target); - Skeletons = me->SummonCreature(14826, target->GetPositionX()+4, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Skeletons) - Skeletons->AI()->AttackStart(target); - Skeletons = me->SummonCreature(14826, target->GetPositionX()-4, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Skeletons) - Skeletons->AI()->AttackStart(target); - Skeletons = me->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()+2, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Skeletons) - Skeletons->AI()->AttackStart(target); - Skeletons = me->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()-2, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Skeletons) - Skeletons->AI()->AttackStart(target); - Skeletons = me->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()+4, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Skeletons) - Skeletons->AI()->AttackStart(target); - Skeletons = me->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()-4, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Skeletons) - Skeletons->AI()->AttackStart(target); - Skeletons = me->SummonCreature(14826, target->GetPositionX()+3, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Skeletons) - Skeletons->AI()->AttackStart(target); - } - - Teleport_Timer = urand(15000, 23000); - } else Teleport_Timer -= diff; - - DoMeleeAttackIfReady(); - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new boss_jindoAI(creature); - } -}; - -//Healing Ward -class mob_healing_ward : public CreatureScript -{ - public: - - mob_healing_ward() - : CreatureScript("mob_healing_ward") - { - } - - struct mob_healing_wardAI : public ScriptedAI - { - mob_healing_wardAI(Creature* creature) : ScriptedAI(creature) - { - instance = creature->GetInstanceScript(); - } - - uint32 Heal_Timer; - - InstanceScript* instance; - - void Reset() - { - Heal_Timer = 2000; - } - - void EnterCombat(Unit* /*who*/) - { - } - - void UpdateAI (const uint32 diff) - { - //Heal_Timer - if (Heal_Timer <= diff) - { - if (instance) - { - Unit* pJindo = Unit::GetUnit(*me, instance->GetData64(DATA_JINDO)); - if (pJindo) - DoCast(pJindo, SPELL_HEAL); - } - Heal_Timer = 3000; - } else Heal_Timer -= diff; - - DoMeleeAttackIfReady(); - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_healing_wardAI(creature); - } -}; - -//Shade of Jindo -class mob_shade_of_jindo : public CreatureScript -{ - public: - - mob_shade_of_jindo() - : CreatureScript("mob_shade_of_jindo") - { - } - - struct mob_shade_of_jindoAI : public ScriptedAI - { - mob_shade_of_jindoAI(Creature* creature) : ScriptedAI(creature) {} - - uint32 ShadowShock_Timer; - - void Reset() - { - ShadowShock_Timer = 1000; - DoCast(me, SPELL_INVISIBLE, true); - } - - void EnterCombat(Unit* /*who*/){} - - void UpdateAI (const uint32 diff) - { - - //ShadowShock_Timer - if (ShadowShock_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SHADOWSHOCK); - ShadowShock_Timer = 2000; - } else ShadowShock_Timer -= diff; - - DoMeleeAttackIfReady(); - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_shade_of_jindoAI(creature); - } -}; - -void AddSC_boss_jindo() -{ - new boss_jindo(); - new mob_healing_ward(); - new mob_shade_of_jindo(); -} - diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp deleted file mode 100644 index 17b268b92ef..00000000000 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp +++ /dev/null @@ -1,278 +0,0 @@ -/* - * Copyright (C) 2008-2012 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 - * - * 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; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; 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, see . - */ - -/* ScriptData -SDName: Boss_Marli -SD%Complete: 80 -SDComment: Charging healers and casters not working. Perhaps wrong Spell Timers. -SDCategory: Zul'Gurub -EndScriptData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "zulgurub.h" - -enum Marli -{ - SAY_AGGRO = 0, - SAY_TRANSFORM = 1, - SAY_SPIDER_SPAWN = 2, - SAY_DEATH = 3, - - SPELL_CHARGE = 22911, - SPELL_ASPECT_OF_MARLI = 24686, // A stun spell - SPELL_ENVOLWINGWEB = 24110, - SPELL_POISONVOLLEY = 24099, - SPELL_SPIDER_FORM = 24084, - -//The Spider Spells - SPELL_LEVELUP = 24312 //Not right Spell. -}; - -class boss_marli : public CreatureScript -{ - public: - - boss_marli() - : CreatureScript("boss_marli") - { - } - - struct boss_marliAI : public ScriptedAI - { - boss_marliAI(Creature* creature) : ScriptedAI(creature) - { - instance = creature->GetInstanceScript(); - } - - InstanceScript* instance; - - uint32 SpawnStartSpiders_Timer; - uint32 PoisonVolley_Timer; - uint32 SpawnSpider_Timer; - uint32 Charge_Timer; - uint32 Aspect_Timer; - uint32 Transform_Timer; - uint32 TransformBack_Timer; - - bool Spawned; - bool PhaseTwo; - - void Reset() - { - SpawnStartSpiders_Timer = 1000; - PoisonVolley_Timer = 15000; - SpawnSpider_Timer = 30000; - Charge_Timer = 1500; - Aspect_Timer = 12000; - Transform_Timer = 45000; - TransformBack_Timer = 25000; - - Spawned = false; - PhaseTwo = false; - } - - void EnterCombat(Unit* /*who*/) - { - Talk(SAY_AGGRO); - } - - void JustDied(Unit* /*killer*/) - { - Talk(SAY_DEATH); - if (instance) - instance->SetData(DATA_MARLI, DONE); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (me->getVictim() && me->isAlive()) - { - if (PoisonVolley_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_POISONVOLLEY); - PoisonVolley_Timer = urand(10000, 20000); - } else PoisonVolley_Timer -= diff; - - if (!PhaseTwo && Aspect_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_ASPECT_OF_MARLI); - Aspect_Timer = urand(13000, 18000); - } else Aspect_Timer -= diff; - - if (!Spawned && SpawnStartSpiders_Timer <= diff) - { - Talk(SAY_SPIDER_SPAWN); - - Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0); - if (!target) - return; - - Creature* Spider = NULL; - - Spider = me->SummonCreature(15041, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Spider) - Spider->AI()->AttackStart(target); - Spider = me->SummonCreature(15041, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Spider) - Spider->AI()->AttackStart(target); - Spider = me->SummonCreature(15041, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Spider) - Spider->AI()->AttackStart(target); - Spider = me->SummonCreature(15041, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Spider) - Spider->AI()->AttackStart(target); - - Spawned = true; - } else SpawnStartSpiders_Timer -= diff; - - if (SpawnSpider_Timer <= diff) - { - Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0); - if (!target) - return; - - Creature* Spider = me->SummonCreature(15041, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Spider) - Spider->AI()->AttackStart(target); - SpawnSpider_Timer = urand(12000, 17000); - } else SpawnSpider_Timer -= diff; - - if (!PhaseTwo && Transform_Timer <= diff) - { - Talk(SAY_TRANSFORM); - DoCast(me, SPELL_SPIDER_FORM); - const CreatureTemplate* cinfo = me->GetCreatureTemplate(); - me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35))); - me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35))); - me->UpdateDamagePhysical(BASE_ATTACK); - DoCast(me->getVictim(), SPELL_ENVOLWINGWEB); - - if (DoGetThreat(me->getVictim())) - DoModifyThreatPercent(me->getVictim(), -100); - - PhaseTwo = true; - Transform_Timer = urand(35000, 60000); - } else Transform_Timer -= diff; - - if (PhaseTwo) - { - if (Charge_Timer <= diff) - { - Unit* target = NULL; - int i = 0; - while (i < 3) // max 3 tries to get a random target with power_mana - { - ++i; - target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true); // not aggro leader - if (target && target->getPowerType() == POWER_MANA) - i = 3; - } - if (target) - { - DoCast(target, SPELL_CHARGE); - //me->SetPosition(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0); - //me->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, true, 1); - AttackStart(target); - } - - Charge_Timer = 8000; - } else Charge_Timer -= diff; - - if (TransformBack_Timer <= diff) - { - me->SetDisplayId(15220); - const CreatureTemplate* cinfo = me->GetCreatureTemplate(); - me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 1))); - me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 1))); - me->UpdateDamagePhysical(BASE_ATTACK); - - PhaseTwo = false; - TransformBack_Timer = urand(25000, 40000); - } else TransformBack_Timer -= diff; - - } - - DoMeleeAttackIfReady(); - } - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new boss_marliAI(creature); - } -}; - -//Spawn of Marli -class mob_spawn_of_marli : public CreatureScript -{ - public: - - mob_spawn_of_marli() - : CreatureScript("mob_spawn_of_marli") - { - } - - struct mob_spawn_of_marliAI : public ScriptedAI - { - mob_spawn_of_marliAI(Creature* creature) : ScriptedAI(creature) {} - - uint32 LevelUp_Timer; - - void Reset() - { - LevelUp_Timer = 3000; - } - - void EnterCombat(Unit* /*who*/) - { - } - - void UpdateAI (const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //LevelUp_Timer - if (LevelUp_Timer <= diff) - { - DoCast(me, SPELL_LEVELUP); - LevelUp_Timer = 3000; - } else LevelUp_Timer -= diff; - - DoMeleeAttackIfReady(); - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_spawn_of_marliAI(creature); - } -}; - -void AddSC_boss_marli() -{ - new boss_marli(); - new mob_spawn_of_marli(); -} - diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp deleted file mode 100644 index 3ea5d932ab0..00000000000 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp +++ /dev/null @@ -1,588 +0,0 @@ -/* - * Copyright (C) 2008-2012 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 - * - * 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; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; 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, see . - */ - -/* ScriptData -SDName: Boss_Thekal -SD%Complete: 95 -SDComment: Almost finished. -SDCategory: Zul'Gurub -EndScriptData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "zulgurub.h" - -enum Thekal -{ - SAY_AGGRO = 0, - SAY_DEATH = 1, - - SPELL_MORTALCLEAVE = 22859, - SPELL_SILENCE = 22666, - SPELL_FRENZY = 8269, - SPELL_FORCEPUNCH = 24189, - SPELL_CHARGE = 24193, - SPELL_ENRAGE = 8269, - SPELL_SUMMONTIGERS = 24183, - SPELL_TIGER_FORM = 24169, - SPELL_RESURRECT = 24173, //We will not use this spell. - -//Zealot Lor'Khan Spells - SPELL_SHIELD = 20545, - SPELL_BLOODLUST = 24185, - SPELL_GREATERHEAL = 24208, - SPELL_DISARM = 6713, - -//Zealot Zath Spells - SPELL_SWEEPINGSTRIKES = 18765, - SPELL_SINISTERSTRIKE = 15581, - SPELL_GOUGE = 12540, - SPELL_KICK = 15614, - SPELL_BLIND = 21060 -}; - -class boss_thekal : public CreatureScript -{ - public: - - boss_thekal() - : CreatureScript("boss_thekal") - { - } - - struct boss_thekalAI : public ScriptedAI - { - boss_thekalAI(Creature* creature) : ScriptedAI(creature) - { - instance = creature->GetInstanceScript(); - } - - uint32 MortalCleave_Timer; - uint32 Silence_Timer; - uint32 Frenzy_Timer; - uint32 ForcePunch_Timer; - uint32 Charge_Timer; - uint32 Enrage_Timer; - uint32 SummonTigers_Timer; - uint32 Check_Timer; - uint32 Resurrect_Timer; - - InstanceScript* instance; - bool Enraged; - bool PhaseTwo; - bool WasDead; - - void Reset() - { - MortalCleave_Timer = 4000; - Silence_Timer = 9000; - Frenzy_Timer = 30000; - ForcePunch_Timer = 4000; - Charge_Timer = 12000; - Enrage_Timer = 32000; - SummonTigers_Timer = 25000; - Check_Timer = 10000; - Resurrect_Timer = 10000; - - Enraged = false; - PhaseTwo = false; - WasDead = false; - } - - void EnterCombat(Unit* /*who*/) - { - Talk(SAY_AGGRO); - } - - void JustDied(Unit* /*killer*/) - { - Talk(SAY_DEATH); - if (instance) - instance->SetData(DATA_THEKAL, DONE); - } - - void JustReachedHome() - { - if (instance) - instance->SetData(DATA_THEKAL, NOT_STARTED); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //Check_Timer for the death of LorKhan and Zath. - if (!WasDead && Check_Timer <= diff) - { - if (instance) - { - if (instance->GetData(DATA_LORKHAN) == SPECIAL) - { - //Resurrect LorKhan - if (Unit* pLorKhan = Unit::GetUnit(*me, instance->GetData64(DATA_LORKHAN))) - { - pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - pLorKhan->setFaction(14); - pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - pLorKhan->SetFullHealth(); - - instance->SetData(DATA_LORKHAN, DONE); - } - } - - if (instance->GetData(DATA_ZATH) == SPECIAL) - { - //Resurrect Zath - Unit* pZath = Unit::GetUnit(*me, instance->GetData64(DATA_ZATH)); - if (pZath) - { - pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - pZath->setFaction(14); - pZath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - pZath->SetFullHealth(); - - instance->SetData(DATA_ZATH, DONE); - } - } - } - - Check_Timer = 5000; - } else Check_Timer -= diff; - - if (!PhaseTwo && MortalCleave_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_MORTALCLEAVE); - MortalCleave_Timer = urand(15000, 20000); - } else MortalCleave_Timer -= diff; - - if (!PhaseTwo && Silence_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SILENCE); - Silence_Timer = urand(20000, 25000); - } else Silence_Timer -= diff; - - if (!PhaseTwo && !WasDead && !HealthAbovePct(5)) - { - me->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE_PERCENT); - me->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE); - me->RemoveAurasByType(SPELL_AURA_PERIODIC_LEECH); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetStandState(UNIT_STAND_STATE_SLEEP); - me->AttackStop(); - - if (instance) - instance->SetData(DATA_THEKAL, SPECIAL); - - WasDead=true; - } - - //Thekal will transform to Tiger if he died and was not resurrected after 10 seconds. - if (!PhaseTwo && WasDead) - { - if (Resurrect_Timer <= diff) - { - DoCast(me, SPELL_TIGER_FORM); - me->SetObjectScale(2.00f); - me->SetStandState(UNIT_STAND_STATE_STAND); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetFullHealth(); - const CreatureTemplate* cinfo = me->GetCreatureTemplate(); - me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 40))); - me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 40))); - me->UpdateDamagePhysical(BASE_ATTACK); - DoResetThreat(); - PhaseTwo = true; - } else Resurrect_Timer -= diff; - } - - if (me->IsFullHealth() && WasDead) - { - WasDead = false; - } - - if (PhaseTwo) - { - if (Charge_Timer <= diff) - { - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) - { - DoCast(target, SPELL_CHARGE); - DoResetThreat(); - AttackStart(target); - } - - Charge_Timer = urand(15000, 22000); - } else Charge_Timer -= diff; - - if (Frenzy_Timer <= diff) - { - DoCast(me, SPELL_FRENZY); - Frenzy_Timer = 30000; - } else Frenzy_Timer -= diff; - - if (ForcePunch_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SILENCE); - ForcePunch_Timer = urand(16000, 21000); - } else ForcePunch_Timer -= diff; - - if (SummonTigers_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SUMMONTIGERS); - SummonTigers_Timer = urand(10000, 14000); - } else SummonTigers_Timer -= diff; - - if (HealthBelowPct(11) && !Enraged) - { - DoCast(me, SPELL_ENRAGE); - Enraged = true; - } - } - - DoMeleeAttackIfReady(); - - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new boss_thekalAI(creature); - } -}; - -//Zealot Lor'Khan -class mob_zealot_lorkhan : public CreatureScript -{ - public: - - mob_zealot_lorkhan() - : CreatureScript("mob_zealot_lorkhan") - { - } - - struct mob_zealot_lorkhanAI : public ScriptedAI - { - mob_zealot_lorkhanAI(Creature* creature) : ScriptedAI(creature) - { - instance = creature->GetInstanceScript(); - } - - uint32 Shield_Timer; - uint32 BloodLust_Timer; - uint32 GreaterHeal_Timer; - uint32 Disarm_Timer; - uint32 Check_Timer; - - bool FakeDeath; - - InstanceScript* instance; - - void Reset() - { - Shield_Timer = 1000; - BloodLust_Timer = 16000; - GreaterHeal_Timer = 32000; - Disarm_Timer = 6000; - Check_Timer = 10000; - - FakeDeath = false; - - if (instance) - instance->SetData(DATA_LORKHAN, NOT_STARTED); - - me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - - void EnterCombat(Unit* /*who*/) - { - } - - void UpdateAI (const uint32 diff) - { - if (!UpdateVictim()) - return; - - //Shield_Timer - if (Shield_Timer <= diff) - { - DoCast(me, SPELL_SHIELD); - Shield_Timer = 61000; - } else Shield_Timer -= diff; - - //BloodLust_Timer - if (BloodLust_Timer <= diff) - { - DoCast(me, SPELL_BLOODLUST); - BloodLust_Timer = 20000+rand()%8000; - } else BloodLust_Timer -= diff; - - //Casting Greaterheal to Thekal or Zath if they are in meele range. - if (GreaterHeal_Timer <= diff) - { - if (instance) - { - Unit* pThekal = Unit::GetUnit(*me, instance->GetData64(DATA_THEKAL)); - Unit* pZath = Unit::GetUnit(*me, instance->GetData64(DATA_ZATH)); - - if (!pThekal || !pZath) - return; - - switch (urand(0, 1)) - { - case 0: - if (me->IsWithinMeleeRange(pThekal)) - DoCast(pThekal, SPELL_GREATERHEAL); - break; - case 1: - if (me->IsWithinMeleeRange(pZath)) - DoCast(pZath, SPELL_GREATERHEAL); - break; - } - } - - GreaterHeal_Timer = 15000+rand()%5000; - } else GreaterHeal_Timer -= diff; - - //Disarm_Timer - if (Disarm_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_DISARM); - Disarm_Timer = 15000+rand()%10000; - } else Disarm_Timer -= diff; - - //Check_Timer for the death of LorKhan and Zath. - if (!FakeDeath && Check_Timer <= diff) - { - if (instance) - { - if (instance->GetData(DATA_THEKAL) == SPECIAL) - { - //Resurrect Thekal - if (Unit* pThekal = Unit::GetUnit(*me, instance->GetData64(DATA_THEKAL))) - { - pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - pThekal->setFaction(14); - pThekal->SetFullHealth(); - } - } - - if (instance->GetData(DATA_ZATH) == SPECIAL) - { - //Resurrect Zath - if (Unit* pZath = Unit::GetUnit(*me, instance->GetData64(DATA_ZATH))) - { - pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - pZath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - pZath->setFaction(14); - pZath->SetFullHealth(); - } - } - } - - Check_Timer = 5000; - } else Check_Timer -= diff; - - if (!HealthAbovePct(5)) - { - me->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE_PERCENT); - me->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE); - me->RemoveAurasByType(SPELL_AURA_PERIODIC_LEECH); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetStandState(UNIT_STAND_STATE_SLEEP); - me->setFaction(35); - me->AttackStop(); - - if (instance) - instance->SetData(DATA_LORKHAN, SPECIAL); - - FakeDeath = true; - } - - DoMeleeAttackIfReady(); - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_zealot_lorkhanAI(creature); - } -}; - -//Zealot Zath -class mob_zealot_zath : public CreatureScript -{ - public: - - mob_zealot_zath() - : CreatureScript("mob_zealot_zath") - { - } - - struct mob_zealot_zathAI : public ScriptedAI - { - mob_zealot_zathAI(Creature* creature) : ScriptedAI(creature) - { - instance = creature->GetInstanceScript(); - } - - uint32 SweepingStrikes_Timer; - uint32 SinisterStrike_Timer; - uint32 Gouge_Timer; - uint32 Kick_Timer; - uint32 Blind_Timer; - uint32 Check_Timer; - - bool FakeDeath; - - InstanceScript* instance; - - void Reset() - { - SweepingStrikes_Timer = 13000; - SinisterStrike_Timer = 8000; - Gouge_Timer = 25000; - Kick_Timer = 18000; - Blind_Timer = 5000; - Check_Timer = 10000; - - FakeDeath = false; - - if (instance) - instance->SetData(DATA_ZATH, NOT_STARTED); - - me->SetStandState(UNIT_STAND_STATE_STAND); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - - void EnterCombat(Unit* /*who*/) - { - } - - void UpdateAI (const uint32 diff) - { - if (!UpdateVictim()) - return; - - //SweepingStrikes_Timer - if (SweepingStrikes_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SWEEPINGSTRIKES); - SweepingStrikes_Timer = 22000+rand()%4000; - } else SweepingStrikes_Timer -= diff; - - //SinisterStrike_Timer - if (SinisterStrike_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SINISTERSTRIKE); - SinisterStrike_Timer = 8000+rand()%8000; - } else SinisterStrike_Timer -= diff; - - //Gouge_Timer - if (Gouge_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_GOUGE); - - if (DoGetThreat(me->getVictim())) - DoModifyThreatPercent(me->getVictim(), -100); - - Gouge_Timer = 17000+rand()%10000; - } else Gouge_Timer -= diff; - - //Kick_Timer - if (Kick_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_KICK); - Kick_Timer = 15000+rand()%10000; - } else Kick_Timer -= diff; - - //Blind_Timer - if (Blind_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_BLIND); - Blind_Timer = 10000+rand()%10000; - } else Blind_Timer -= diff; - - //Check_Timer for the death of LorKhan and Zath. - if (!FakeDeath && Check_Timer <= diff) - { - if (instance) - { - if (instance->GetData(DATA_LORKHAN) == SPECIAL) - { - //Resurrect LorKhan - if (Unit* pLorKhan = Unit::GetUnit(*me, instance->GetData64(DATA_LORKHAN))) - { - pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - pLorKhan->setFaction(14); - pLorKhan->SetFullHealth(); - } - } - - if (instance->GetData(DATA_THEKAL) == SPECIAL) - { - //Resurrect Thekal - if (Unit* pThekal = Unit::GetUnit(*me, instance->GetData64(DATA_THEKAL))) - { - pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - pThekal->setFaction(14); - pThekal->SetFullHealth(); - } - } - } - - Check_Timer = 5000; - } else Check_Timer -= diff; - - if (!HealthAbovePct(5)) - { - me->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE_PERCENT); - me->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE); - me->RemoveAurasByType(SPELL_AURA_PERIODIC_LEECH); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetStandState(UNIT_STAND_STATE_SLEEP); - me->setFaction(35); - me->AttackStop(); - - if (instance) - instance->SetData(DATA_ZATH, SPECIAL); - - FakeDeath = true; - } - - DoMeleeAttackIfReady(); - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_zealot_zathAI(creature); - } -}; - -void AddSC_boss_thekal() -{ - new boss_thekal(); - new mob_zealot_lorkhan(); - new mob_zealot_zath(); -} - -- cgit v1.2.3 From bba157109903c034f991315ba62fac91f4565011 Mon Sep 17 00:00:00 2001 From: Subv Date: Mon, 24 Dec 2012 08:59:18 -0500 Subject: Core/Chat: Corrected SMSG_MESSAGECHAT in a few more places --- src/server/game/Texts/CreatureTextMgr.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Texts/CreatureTextMgr.cpp b/src/server/game/Texts/CreatureTextMgr.cpp index 89b75fd1695..fc0cea04013 100644 --- a/src/server/game/Texts/CreatureTextMgr.cpp +++ b/src/server/game/Texts/CreatureTextMgr.cpp @@ -53,6 +53,11 @@ class CreatureTextBuilder *data << uint32(text.length() + 1); *data << text; *data << uint8(0); // ChatTag + if (_msgType == CHAT_MSG_RAID_BOSS_EMOTE || _msgType == CHAT_MSG_RAID_BOSS_WHISPER) + { + *data << float(0); + *data << uint8(0); + } return whisperGUIDpos; } @@ -93,7 +98,11 @@ class PlayerTextBuilder *data << uint32(text.length() + 1); *data << text; *data << uint8(0); // ChatTag - + if (_msgType == CHAT_MSG_RAID_BOSS_EMOTE || _msgType == CHAT_MSG_RAID_BOSS_WHISPER) + { + *data << float(0); + *data << uint8(0); + } return whisperGUIDpos; } -- cgit v1.2.3 From 6e7734c31872142c119199e95a50f845644ccf0c Mon Sep 17 00:00:00 2001 From: Subv Date: Mon, 24 Dec 2012 10:13:15 -0500 Subject: Core/Spells: Fixed interrupting of some bosses spells --- src/server/game/Miscellaneous/SharedDefines.h | 3 ++- src/server/game/Spells/SpellEffects.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 1056de4e760..4571bc2e099 100644 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -1644,7 +1644,8 @@ enum SpellPreventionType { SPELL_PREVENTION_TYPE_NONE = 0, SPELL_PREVENTION_TYPE_SILENCE = 1, - SPELL_PREVENTION_TYPE_PACIFY = 2 + SPELL_PREVENTION_TYPE_PACIFY = 2, + SPELL_PREVENTION_TYPE_UNK = 3 // Only a few spells have this, but most of the should be interruptable. }; enum GameobjectTypes diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 2bb93b03112..18aae01bf1c 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -3288,7 +3288,7 @@ void Spell::EffectInterruptCast(SpellEffIndex effIndex) // check if we can interrupt spell if ((spell->getState() == SPELL_STATE_CASTING || (spell->getState() == SPELL_STATE_PREPARING && spell->GetCastTime() > 0.0f)) - && curSpellInfo->PreventionType == SPELL_PREVENTION_TYPE_SILENCE + && (curSpellInfo->PreventionType == SPELL_PREVENTION_TYPE_SILENCE || curSpellInfo->PreventionType == SPELL_PREVENTION_TYPE_UNK) && ((i == CURRENT_GENERIC_SPELL && curSpellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_INTERRUPT) || (i == CURRENT_CHANNELED_SPELL && curSpellInfo->ChannelInterruptFlags & CHANNEL_INTERRUPT_FLAG_INTERRUPT))) { -- cgit v1.2.3 From accc83a76dd1fae8174146abaf099e36023d58cf Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Mon, 24 Dec 2012 17:18:43 +0100 Subject: Core/Scripts: Fix typo --- .../scripts/EasternKingdoms/ZulGurub/boss_jindo_the_godbreaker.cpp | 2 +- src/server/scripts/EasternKingdoms/ZulGurub/boss_kilnara.cpp | 2 +- src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp | 2 +- src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp | 2 +- src/server/scripts/EasternKingdoms/ZulGurub/boss_zanzil.cpp | 2 +- src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo_the_godbreaker.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo_the_godbreaker.cpp index 204db428bf0..4677ce52e1c 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo_the_godbreaker.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo_the_godbreaker.cpp @@ -81,7 +81,7 @@ class boss_jindo_the_godbreaker : public CreatureScript CreatureAI* GetAI(Creature* creature) const { - return new boss_jindo_the_godbreakerAI(creature); + return GetZulGurubAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_kilnara.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_kilnara.cpp index 17c73ae96bd..a60eeb0c715 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_kilnara.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_kilnara.cpp @@ -82,7 +82,7 @@ class boss_kilnara : public CreatureScript CreatureAI* GetAI(Creature* creature) const { - return new boss_kilnaraAI(creature); + return GetZulGurubAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp index 55f257e5ecc..3619f0d0bc9 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp @@ -84,7 +84,7 @@ class boss_mandokir : public CreatureScript CreatureAI* GetAI(Creature* creature) const { - return new boss_mandokirAI(creature); + return GetZulGurubAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp index 83815d17d2e..8980d766400 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp @@ -87,7 +87,7 @@ class boss_venoxis : public CreatureScript CreatureAI* GetAI(Creature* creature) const { - return new boss_venoxisAI(creature); + return GetZulGurubAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_zanzil.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_zanzil.cpp index 2d5fae00550..7466d8e47d3 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_zanzil.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_zanzil.cpp @@ -81,7 +81,7 @@ class boss_zanzil : public CreatureScript CreatureAI* GetAI(Creature* creature) const { - return new boss_zanzilAI(creature); + return GetZulGurubAI(creature); } }; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h b/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h index 0deeb1c974d..dc4db4be5c4 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h +++ b/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h @@ -54,7 +54,7 @@ enum CreatureIds }; template -CreatureAI* GetZulGurubCitadelAI(Creature* creature) +CreatureAI* GetZulGurubAI(Creature* creature) { if (InstanceMap* instance = creature->GetMap()->ToInstanceMap()) if (instance->GetInstanceScript()) -- cgit v1.2.3 From 7b534774b63537f300d22f21c38e8b46794b6a2f Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Mon, 24 Dec 2012 17:21:07 +0100 Subject: Core/Spells: Remove spell script "spell_gen_damage_reduction_aura" --- .../2012_12_24_00_world_spell_script_names_434.sql | 1 + src/server/scripts/Spells/spell_generic.cpp | 56 ---------------------- 2 files changed, 1 insertion(+), 56 deletions(-) create mode 100644 sql/updates/world/2012_12_24_00_world_spell_script_names_434.sql (limited to 'src') diff --git a/sql/updates/world/2012_12_24_00_world_spell_script_names_434.sql b/sql/updates/world/2012_12_24_00_world_spell_script_names_434.sql new file mode 100644 index 00000000000..d95da8f3239 --- /dev/null +++ b/sql/updates/world/2012_12_24_00_world_spell_script_names_434.sql @@ -0,0 +1 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_gen_damage_reduction_aura'; diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index c8f3236a008..e0c35a96426 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -1322,61 +1322,6 @@ class spell_gen_oracle_wolvar_reputation : public SpellScriptLoader } }; -enum DamageReductionAura -{ - SPELL_BLESSING_OF_SANCTUARY = 20911, - SPELL_GREATER_BLESSING_OF_SANCTUARY = 25899, - SPELL_RENEWED_HOPE = 63944, - SPELL_VIGILANCE = 50720, - SPELL_DAMAGE_REDUCTION_AURA = 68066, -}; - -class spell_gen_damage_reduction_aura : public SpellScriptLoader -{ - public: - spell_gen_damage_reduction_aura() : SpellScriptLoader("spell_gen_damage_reduction_aura") { } - - class spell_gen_damage_reduction_AuraScript : public AuraScript - { - PrepareAuraScript(spell_gen_damage_reduction_AuraScript); - - bool Validate(SpellInfo const* /*SpellEntry*/) - { - if (!sSpellMgr->GetSpellInfo(SPELL_DAMAGE_REDUCTION_AURA)) - return false; - return true; - } - - void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - Unit* target = GetTarget(); - target->CastSpell(target, SPELL_DAMAGE_REDUCTION_AURA, true); - } - - void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - Unit* target = GetTarget(); - if (target->HasAura(SPELL_DAMAGE_REDUCTION_AURA) && !(target->HasAura(SPELL_BLESSING_OF_SANCTUARY) || - target->HasAura(SPELL_GREATER_BLESSING_OF_SANCTUARY) || - target->HasAura(SPELL_RENEWED_HOPE) || - target->HasAura(SPELL_VIGILANCE))) - target->RemoveAurasDueToSpell(SPELL_DAMAGE_REDUCTION_AURA); - } - - void Register() - { - OnEffectApply += AuraEffectApplyFn(spell_gen_damage_reduction_AuraScript::OnApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); - OnEffectRemove += AuraEffectRemoveFn(spell_gen_damage_reduction_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); - } - - }; - - AuraScript* GetAuraScript() const - { - return new spell_gen_damage_reduction_AuraScript(); - } -}; - class spell_gen_luck_of_the_draw : public SpellScriptLoader { public: @@ -3247,7 +3192,6 @@ void AddSC_generic_spell_scripts() new spell_gen_launch(); new spell_gen_vehicle_scaling(); new spell_gen_oracle_wolvar_reputation(); - new spell_gen_damage_reduction_aura(); new spell_gen_luck_of_the_draw(); new spell_gen_dummy_trigger(); new spell_gen_spirit_healer_res(); -- cgit v1.2.3 From b4996c90ffc59045c2999da909e77a3ddd666f02 Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Mon, 24 Dec 2012 17:26:42 +0100 Subject: Core: Fix some codestyle --- src/server/game/Entities/Player/Player.cpp | 2 +- src/server/game/Entities/Unit/Unit.cpp | 6 +++--- src/server/game/Entities/Unit/Unit.h | 2 +- src/server/game/Spells/SpellInfo.cpp | 2 +- src/server/scripts/Northrend/dragonblight.cpp | 6 +++--- 5 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 9615513a181..52002fd39bd 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -3113,7 +3113,7 @@ void Player::GiveLevel(uint8 level) if (sWorld->getBoolConfig(CONFIG_ALWAYS_MAXSKILL)) // Max weapon skill when leveling up UpdateSkillsToMaxSkillsForLevel(); - _ApplyAllLevelScaleItemMods(true); // Moved to above SetFullHealth so player will have full health from Heirlooms + _ApplyAllLevelScaleItemMods(true); // Moved to above SetFullHealth so player will have full health from Heirlooms // set current level health and mana/energy to maximum after applying all mods. SetFullHealth(); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index f3111fab39c..de1044271c9 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -16669,10 +16669,10 @@ void Unit::NearTeleportTo(float x, float y, float z, float orientation, bool cas void Unit::SendTeleportPacket(Position& pos) { Position oldPos = {GetPositionX(), GetPositionY(), GetPositionZMinusOffset(), GetOrientation()}; - + if (GetTypeId() == TYPEID_UNIT) Relocate(&pos); - + ObjectGuid guid = GetGUID(); ObjectGuid transGuid = GetTransGUID(); @@ -16731,7 +16731,7 @@ void Unit::SendTeleportPacket(Position& pos) Relocate(&pos); else Relocate(&oldPos); - + SendMessageToSet(&data, true); } diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 5b086747442..053876d0532 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1579,7 +1579,7 @@ class Unit : public WorldObject void SendSpellDamageImmune(Unit* target, uint32 spellId); void NearTeleportTo(float x, float y, float z, float orientation, bool casting = false); - void SendTeleportPacket(Position& oldPos); + void SendTeleportPacket(Position& pos); virtual bool UpdatePosition(float x, float y, float z, float ang, bool teleport = false); // returns true if unit's position really changed bool UpdatePosition(const Position &pos, bool teleport = false) { return UpdatePosition(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), teleport); } diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index e8d0cb6feeb..70932fc6821 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -1680,7 +1680,7 @@ SpellCastResult SpellInfo::CheckTarget(Unit const* caster, WorldObject const* ta if (unitTarget->HasUnitState(UNIT_STATE_IN_FLIGHT)) return SPELL_FAILED_BAD_TARGETS; - /* TARGET_UNIT_MASTER gets blocked here for passengers, because the whole idea of this check is to + /* TARGET_UNIT_MASTER gets blocked here for passengers, because the whole idea of this check is to not allow passengers to be implicitly hit by spells, however this target type should be an exception, if this is left it kills spells that award kill credit from vehicle to master (few spells), the use of these 2 covers passenger target check, logically, if vehicle cast this to master it should always hit diff --git a/src/server/scripts/Northrend/dragonblight.cpp b/src/server/scripts/Northrend/dragonblight.cpp index 698daba99e3..695a942721d 100644 --- a/src/server/scripts/Northrend/dragonblight.cpp +++ b/src/server/scripts/Northrend/dragonblight.cpp @@ -182,12 +182,12 @@ enum WyrmDefenderEnum // Quest data QUEST_DEFENDING_WYRMREST_TEMPLE = 12372, GOSSIP_TEXTID_DEF1 = 12899, - + // Gossip data GOSSIP_TEXTID_DEF2 = 12900, // Spells data - SPELL_CHARACTER_SCRIPT = 49213, + SPELL_CHARACTER_SCRIPT = 49213, SPELL_DEFENDER_ON_LOW_HEALTH_EMOTE = 52421, // ID - 52421 Wyrmrest Defender: On Low Health Boss Emote to Controller - Random /self/ SPELL_RENEW = 49263, // casted to heal drakes SPELL_WYRMREST_DEFENDER_MOUNT = 49256, @@ -258,7 +258,7 @@ class npc_wyrmrest_defender : public CreatureScript me->CastSpell(me, SPELL_DEFENDER_ON_LOW_HEALTH_EMOTE); hpWarningReady = false; } - + if (renewRecoveryCanCheck) { if (RenewRecoveryChecker <= diff) -- cgit v1.2.3 From 77b85b2ea0aec6cd3e545e60e46ac60eebb11e47 Mon Sep 17 00:00:00 2001 From: Subv Date: Mon, 24 Dec 2012 12:34:46 -0500 Subject: Core/Spells: Fixed loading of spell data corrections. --- src/server/game/Spells/SpellMgr.cpp | 264 ++++++++++++++++++------------------ src/server/game/Spells/SpellMgr.h | 2 +- 2 files changed, 133 insertions(+), 133 deletions(-) (limited to 'src') diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 088a112fd3b..b86d67ff1ca 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -2970,33 +2970,33 @@ void SpellMgr::LoadSpellCustomAttr() sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded spell custom attributes in %u ms", GetMSTimeDiffToNow(oldMSTime)); } -void SpellMgr::LoadDbcDataCorrections() +void SpellMgr::LoadSpellInfoCorrections() { uint32 oldMSTime = getMSTime(); - /*SpellEntry* spellInfo = NULL; - for (uint32 i = 0; i < sSpellStore.GetNumRows(); ++i) + SpellInfo* spellInfo = NULL; + for (uint32 i = 0; i < mSpellInfoMap.size(); ++i) { - spellInfo = (SpellEntry*)sSpellStore.LookupEntry(i); + spellInfo = (SpellInfo*)mSpellInfoMap[i]; if (!spellInfo) continue; for (uint8 j = 0; j < MAX_SPELL_EFFECTS; ++j) { - switch (spellInfo->Effect[j]) + switch (spellInfo->Effects[j].Effect) { case SPELL_EFFECT_CHARGE: case SPELL_EFFECT_CHARGE_DEST: case SPELL_EFFECT_JUMP: case SPELL_EFFECT_JUMP_DEST: case SPELL_EFFECT_LEAP_BACK: - if (!spellInfo->speed && !spellInfo->SpellFamilyName) - spellInfo->speed = SPEED_CHARGE; + if (!spellInfo->Speed && !spellInfo->SpellFamilyName) + spellInfo->Speed = SPEED_CHARGE; break; } } - if (spellInfo->activeIconID == 2158) // flight + if (spellInfo->ActiveIconID == 2158) // flight spellInfo->Attributes |= SPELL_ATTR0_PASSIVE; switch (spellInfo->Id) @@ -3005,28 +3005,28 @@ void SpellMgr::LoadDbcDataCorrections() spellInfo->MaxAffectedTargets = 1; break; case 42730: - spellInfo->EffectTriggerSpell[EFFECT_1] = 42739; + spellInfo->Effects[EFFECT_1].TriggerSpell = 42739; break; case 59735: - spellInfo->EffectTriggerSpell[EFFECT_1] = 59736; + spellInfo->Effects[EFFECT_1].TriggerSpell = 59736; break; case 52611: // Summon Skeletons case 52612: // Summon Skeletons - spellInfo->EffectMiscValueB[0] = 64; + spellInfo->Effects[EFFECT_0].MiscValueB = 64; break; case 40244: // Simon Game Visual case 40245: // Simon Game Visual case 40246: // Simon Game Visual case 40247: // Simon Game Visual case 42835: // Spout, remove damage effect, only anim is needed - spellInfo->Effect[0] = 0; + spellInfo->Effects[EFFECT_0].Effect = 0; break; case 30657: // Quake - spellInfo->EffectTriggerSpell[0] = 30571; + spellInfo->Effects[EFFECT_0].TriggerSpell = 30571; break; case 30541: // Blaze (needs conditions entry) - spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_TARGET_ENEMY; - spellInfo->EffectImplicitTargetB[0] = 0; + spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ENEMY); + spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(); break; case 63665: // Charge (Argent Tournament emote on riders) case 31298: // Sleep (needs target selection script) @@ -3034,18 +3034,18 @@ void SpellMgr::LoadDbcDataCorrections() case 2895: // Wrath of Air Totem rank 1 (Aura) case 68933: // Wrath of Air Totem rank 2 (Aura) case 29200: // Purify Helboar Meat - spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_CASTER; - spellInfo->EffectImplicitTargetB[0] = 0; + spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER); + spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(); break; case 31344: // Howl of Azgalor - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_100_YARDS; // 100yards instead of 50000?! + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_100_YARDS); // 100yards instead of 50000?! break; case 42818: // Headless Horseman - Wisp Flight Port case 42821: // Headless Horseman - Wisp Flight Missile - spellInfo->rangeIndex = 6; // 100 yards + spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(6); // 100 yards break; case 36350: //They Must Burn Bomb Aura (self) - spellInfo->EffectTriggerSpell[0] = 36325; // They Must Burn Bomb Drop (DND) + spellInfo->Effects[EFFECT_0].TriggerSpell = 36325; // They Must Burn Bomb Drop (DND) break; case 49838: // Stop Time spellInfo->AttributesEx3 |= SPELL_ATTR3_NO_INITIAL_AGGRO; @@ -3054,15 +3054,15 @@ void SpellMgr::LoadDbcDataCorrections() case 62136: // Energize Cores case 54069: // Energize Cores case 56251: // Energize Cores - spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_SRC_AREA_ENTRY; + spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ENTRY); break; case 50785: // Energize Cores case 59372: // Energize Cores - spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_SRC_AREA_ENEMY; + spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ENEMY); break; case 8494: // Mana Shield (rank 2) // because of bug in dbc - spellInfo->procChance = 0; + spellInfo->ProcChance = 0; break; case 20335: // Heart of the Crusader case 20336: @@ -3073,8 +3073,8 @@ void SpellMgr::LoadDbcDataCorrections() break; case 59725: // Improved Spell Reflection - aoe aura // Target entry seems to be wrong for this spell :/ - spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_CASTER_AREA_PARTY; - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_10_YARDS_2; + spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER_AREA_PARTY); + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_10_YARDS_2); break; case 44978: // Wild Magic case 45001: @@ -3145,7 +3145,7 @@ void SpellMgr::LoadDbcDataCorrections() case 33711: // Murmur's Touch case 38794: spellInfo->MaxAffectedTargets = 1; - spellInfo->EffectTriggerSpell[0] = 33760; + spellInfo->Effects[EFFECT_0].TriggerSpell = 33760; break; case 17941: // Shadow Trance case 22008: // Netherwind Focus @@ -3160,17 +3160,17 @@ void SpellMgr::LoadDbcDataCorrections() case 64823: // Item - Druid T8 Balance 4P Bonus case 34477: // Misdirection case 44401: // Missile Barrage - spellInfo->procCharges = 1; + spellInfo->ProcCharges = 1; break; case 44544: // Fingers of Frost - spellInfo->EffectSpellClassMask[0] = flag96(685904631, 1151048, 0); + spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(685904631, 1151048, 0); break; case 74396: // Fingers of Frost visual buff - spellInfo->procCharges = 2; + spellInfo->ProcCharges = 2; spellInfo->StackAmount = 0; break; case 28200: // Ascendance (Talisman of Ascendance trinket) - spellInfo->procCharges = 6; + spellInfo->ProcCharges = 6; break; case 47201: // Everlasting Affliction case 47202: @@ -3178,16 +3178,16 @@ void SpellMgr::LoadDbcDataCorrections() case 47204: case 47205: // add corruption to affected spells - spellInfo->EffectSpellClassMask[1][0] |= 2; + spellInfo->Effects[1].SpellClassMask[0] |= 2; break; case 51852: // The Eye of Acherus (no spawn in phase 2 in db) - spellInfo->EffectMiscValue[0] |= 1; + spellInfo->Effects[0].MiscValue |= 1; break; case 51912: // Crafty's Ultra-Advanced Proto-Typical Shortening Blaster - spellInfo->EffectAmplitude[0] = 3000; + spellInfo->Effects[0].Amplitude = 3000; break; case 29809: // Desecration Arm - 36 instead of 37 - typo? :/ - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_7_YARDS; + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_7_YARDS); break; // Master Shapeshifter: missing stance data for forms other than bear - bear version has correct data // To prevent aura staying on target after talent unlearned @@ -3202,37 +3202,37 @@ void SpellMgr::LoadDbcDataCorrections() break; case 51466: // Elemental Oath (Rank 1) case 51470: // Elemental Oath (Rank 2) - spellInfo->Effect[EFFECT_1] = SPELL_EFFECT_APPLY_AURA; - spellInfo->EffectApplyAuraName[EFFECT_1] = SPELL_AURA_ADD_FLAT_MODIFIER; - spellInfo->EffectMiscValue[EFFECT_1] = SPELLMOD_EFFECT2; - spellInfo->EffectSpellClassMask[EFFECT_1] = flag96(0x00000000, 0x00004000, 0x00000000); + spellInfo->Effects[EFFECT_1].Effect = SPELL_EFFECT_APPLY_AURA; + spellInfo->Effects[EFFECT_1].ApplyAuraName = SPELL_AURA_ADD_FLAT_MODIFIER; + spellInfo->Effects[EFFECT_1].MiscValue = SPELLMOD_EFFECT2; + spellInfo->Effects[EFFECT_1].SpellClassMask = flag96(0x00000000, 0x00004000, 0x00000000); break; case 47569: // Improved Shadowform (Rank 1) // with this spell atrribute aura can be stacked several times spellInfo->Attributes &= ~SPELL_ATTR0_NOT_SHAPESHIFT; break; case 64904: // Hymn of Hope - spellInfo->EffectApplyAuraName[EFFECT_1] = SPELL_AURA_MOD_INCREASE_ENERGY_PERCENT; + spellInfo->Effects[EFFECT_1].ApplyAuraName = SPELL_AURA_MOD_INCREASE_ENERGY_PERCENT; break; case 19465: // Improved Stings (Rank 2) - spellInfo->EffectImplicitTargetA[EFFECT_2] = TARGET_UNIT_CASTER; + spellInfo->Effects[EFFECT_2].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER); break; case 30421: // Nether Portal - Perseverence - spellInfo->EffectBasePoints[2] += 30000; + spellInfo->Effects[2].BasePoints += 30000; break; case 16834: // Natural shapeshifter case 16835: - spellInfo->DurationIndex = 21; + spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(21); break; case 51735: // Ebon Plague case 51734: case 51726: spellInfo->AttributesEx3 |= SPELL_ATTR3_STACK_FOR_DIFF_CASTERS; spellInfo->SpellFamilyFlags[2] = 0x10; - spellInfo->EffectApplyAuraName[1] = SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN; + spellInfo->Effects[1].ApplyAuraName = SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN; break; case 41913: // Parasitic Shadowfiend Passive - spellInfo->EffectApplyAuraName[0] = SPELL_AURA_DUMMY; // proc debuff, and summon infinite fiends + spellInfo->Effects[0].ApplyAuraName = SPELL_AURA_DUMMY; // proc debuff, and summon infinite fiends break; case 27892: // To Anchor 1 case 27928: // To Anchor 1 @@ -3240,18 +3240,18 @@ void SpellMgr::LoadDbcDataCorrections() case 27915: // Anchor to Skulls case 27931: // Anchor to Skulls case 27937: // Anchor to Skulls - spellInfo->rangeIndex = 13; + spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(13); break; // target allys instead of enemies, target A is src_caster, spells with effect like that have ally target // this is the only known exception, probably just wrong data case 29214: // Wrath of the Plaguebringer case 54836: // Wrath of the Plaguebringer - spellInfo->EffectImplicitTargetB[0] = TARGET_UNIT_SRC_AREA_ALLY; - spellInfo->EffectImplicitTargetB[1] = TARGET_UNIT_SRC_AREA_ALLY; + spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ALLY); + spellInfo->Effects[EFFECT_1].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ALLY); break; case 57994: // Wind Shear - improper data for EFFECT_1 in 3.3.5 DBC, but is correct in 4.x - spellInfo->Effect[EFFECT_1] = SPELL_EFFECT_MODIFY_THREAT_PERCENT; - spellInfo->EffectBasePoints[EFFECT_1] = -6; // -5% + spellInfo->Effects[EFFECT_1].Effect = SPELL_EFFECT_MODIFY_THREAT_PERCENT; + spellInfo->Effects[EFFECT_1].BasePoints = -6; // -5% break; case 63675: // Improved Devouring Plague spellInfo->AttributesEx3 |= SPELL_ATTR3_NO_DONE_BONUS; @@ -3268,17 +3268,17 @@ void SpellMgr::LoadDbcDataCorrections() case 58651: // Flametongue Totem rank 6 (Aura) case 58654: // Flametongue Totem rank 7 (Aura) case 58655: // Flametongue Totem rank 8 (Aura) - spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_CASTER; - spellInfo->EffectImplicitTargetA[1] = TARGET_UNIT_CASTER; - spellInfo->EffectImplicitTargetB[0] = 0; - spellInfo->EffectImplicitTargetB[1] = 0; + spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER); + spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER); + spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(); + spellInfo->Effects[EFFECT_1].TargetB = SpellImplicitTargetInfo(); break; case 53241: // Marked for Death (Rank 1) case 53243: // Marked for Death (Rank 2) case 53244: // Marked for Death (Rank 3) case 53245: // Marked for Death (Rank 4) case 53246: // Marked for Death (Rank 5) - spellInfo->EffectSpellClassMask[0] = flag96(0x00067801, 0x10820001, 0x00000801); + spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(0x00067801, 0x10820001, 0x00000801); break; case 5176: // Wrath case 2912: // Starfire @@ -3288,41 +3288,41 @@ void SpellMgr::LoadDbcDataCorrections() break; case 70728: // Exploit Weakness (needs target selection script) case 70840: // Devious Minds (needs target selection script) - spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_CASTER; - spellInfo->EffectImplicitTargetB[0] = TARGET_UNIT_PET; + spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER); + spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_PET); break; case 70893: // Culling The Herd (needs target selection script) - spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_CASTER; - spellInfo->EffectImplicitTargetB[0] = TARGET_UNIT_MASTER; + spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER); + spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_MASTER); break; case 54800: // Sigil of the Frozen Conscience - change class mask to custom extended flags of Icy Touch // this is done because another spell also uses the same SpellFamilyFlags as Icy Touch // SpellFamilyFlags[0] & 0x00000040 in SPELLFAMILY_DEATHKNIGHT is currently unused (3.3.5a) // this needs research on modifier applying rules, does not seem to be in Attributes fields - spellInfo->EffectSpellClassMask[0] = flag96(0x00000040, 0x00000000, 0x00000000); + spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(0x00000040, 0x00000000, 0x00000000); break; case 64949: // Idol of the Flourishing Life - spellInfo->EffectSpellClassMask[EFFECT_0] = flag96(0x00000000, 0x02000000, 0x00000000); - spellInfo->EffectApplyAuraName[EFFECT_0] = SPELL_AURA_ADD_FLAT_MODIFIER; + spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(0x00000000, 0x02000000, 0x00000000); + spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_ADD_FLAT_MODIFIER; break; case 34231: // Libram of the Lightbringer case 60792: // Libram of Tolerance case 64956: // Libram of the Resolute - spellInfo->EffectSpellClassMask[EFFECT_0] = flag96(0x80000000, 0x00000000, 0x00000000); - spellInfo->EffectApplyAuraName[EFFECT_0] = SPELL_AURA_ADD_FLAT_MODIFIER; + spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(0x80000000, 0x00000000, 0x00000000); + spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_ADD_FLAT_MODIFIER; break; case 28851: // Libram of Light case 28853: // Libram of Divinity case 32403: // Blessed Book of Nagrand - spellInfo->EffectSpellClassMask[EFFECT_0] = flag96(0x40000000, 0x00000000, 0x00000000); - spellInfo->EffectApplyAuraName[EFFECT_0] = SPELL_AURA_ADD_FLAT_MODIFIER; + spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(0x40000000, 0x00000000, 0x00000000); + spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_ADD_FLAT_MODIFIER; break; case 45602: // Ride Carpet - spellInfo->EffectBasePoints[EFFECT_0] = 0; // force seat 0, vehicle doesn't have the required seat flags for "no seat specified (-1)" + spellInfo->Effects[EFFECT_0].BasePoints = 0; // force seat 0, vehicle doesn't have the required seat flags for "no seat specified (-1)" break; case 64745: // Item - Death Knight T8 Tank 4P Bonus case 64936: // Item - Warrior T8 Protection 4P Bonus - spellInfo->EffectBasePoints[0] = 100; // 100% chance of procc'ing, not -10% (chance calculated in PrepareTriggersExecutedOnHit) + spellInfo->Effects[0].BasePoints = 100; // 100% chance of procc'ing, not -10% (chance calculated in PrepareTriggersExecutedOnHit) break; case 19970: // Entangling Roots (Rank 6) -- Nature's Grasp Proc case 19971: // Entangling Roots (Rank 5) -- Nature's Grasp Proc @@ -3332,7 +3332,7 @@ void SpellMgr::LoadDbcDataCorrections() case 19975: // Entangling Roots (Rank 1) -- Nature's Grasp Proc case 27010: // Entangling Roots (Rank 7) -- Nature's Grasp Proc case 53313: // Entangling Roots (Rank 8) -- Nature's Grasp Proc - spellInfo->CastingTimeIndex = 1; + spellInfo->CastTimeEntry = sSpellCastTimesStore.LookupEntry(1); break; case 59414: // Pulsing Shockwave Aura (Loken) // this flag breaks movement, remove it @@ -3342,7 +3342,7 @@ void SpellMgr::LoadDbcDataCorrections() spellInfo->AuraInterruptFlags = AURA_INTERRUPT_FLAG_HITBYSPELL | AURA_INTERRUPT_FLAG_TAKE_DAMAGE; break; case 70650: // Death Knight T10 Tank 2P Bonus - spellInfo->EffectApplyAuraName[0] = SPELL_AURA_ADD_PCT_MODIFIER; + spellInfo->Effects[0].ApplyAuraName = SPELL_AURA_ADD_PCT_MODIFIER; break; case 71838: // Drain Life - Bryntroll Normal case 71839: // Drain Life - Bryntroll Heroic @@ -3354,7 +3354,7 @@ void SpellMgr::LoadDbcDataCorrections() // ULDUAR SPELLS // case 62374: // Pursued (Flame Leviathan) - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_50000_YARDS; // 50000yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // 50000yd break; case 63342: // Focused Eyebeam Summon Trigger (Kologarn) spellInfo->MaxAffectedTargets = 1; @@ -3376,12 +3376,12 @@ void SpellMgr::LoadDbcDataCorrections() // then EFFECT_1, etc - instead of applying each effect on target1, then target2, etc. // The above situation causes the visual for this spell to be bugged, so we remove the instakill // effect and implement a script hack for that. - spellInfo->Effect[EFFECT_1] = 0; + spellInfo->Effects[EFFECT_1].Effect = 0; break; case 64386: // Terrifying Screech (Auriaya) case 64389: // Sentinel Blast (Auriaya) case 64678: // Sentinel Blast (Auriaya) - spellInfo->DurationIndex = 28; // 5 seconds, wrong DBC data? + spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(28); // 5 seconds, wrong DBC data? break; case 64321: // Potent Pheromones (Freya) // spell should dispel area aura, but doesn't have the attribute @@ -3396,11 +3396,11 @@ void SpellMgr::LoadDbcDataCorrections() spellInfo->MaxAffectedTargets = 3; break; case 62293: // Cosmic Smash (Algalon the Observer) - spellInfo->EffectImplicitTargetB[0] = TARGET_DEST_CASTER; + spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_DEST_CASTER); break; case 62311: // Cosmic Smash (Algalon the Observer) case 64596: // Cosmic Smash (Algalon the Observer) - spellInfo->rangeIndex = 6; // 100yd + spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(6); // 100yd break; // ENDOF ULDUAR SPELLS // @@ -3410,7 +3410,7 @@ void SpellMgr::LoadDbcDataCorrections() case 67901: // Infernal Eruption (25N) // increase duration from 15 to 18 seconds because caster is already // unsummoned when spell missile hits the ground so nothing happen in result - spellInfo->DurationIndex = 85; + spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(85); break; // ENDOF TRIAL OF THE CRUSADER SPELLS // @@ -3426,11 +3426,11 @@ void SpellMgr::LoadDbcDataCorrections() case 70859: // Upper Spire Teleport case 70860: // Frozen Throne Teleport case 70861: // Sindragosa's Lair Teleport - spellInfo->EffectImplicitTargetA[0] = TARGET_DEST_DB; + spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DB); break; case 69055: // Saber Lash (Lord Marrowgar) case 70814: // Saber Lash (Lord Marrowgar) - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_5_YARDS; // 5yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_5_YARDS); // 5yd break; case 69075: // Bone Storm (Lord Marrowgar) case 70834: // Bone Storm (Lord Marrowgar) @@ -3440,62 +3440,62 @@ void SpellMgr::LoadDbcDataCorrections() case 71160: // Plague Stench (Stinky) case 71161: // Plague Stench (Stinky) case 71123: // Decimate (Stinky & Precious) - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_100_YARDS; // 100yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_100_YARDS); // 100yd break; case 71169: // Shadow's Fate spellInfo->AttributesEx3 |= SPELL_ATTR3_STACK_FOR_DIFF_CASTERS; break; case 72378: // Blood Nova (Deathbringer Saurfang) case 73058: // Blood Nova (Deathbringer Saurfang) - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_200_YARDS; - spellInfo->EffectRadiusIndex[1] = EFFECT_RADIUS_200_YARDS; + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); + spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); break; case 72769: // Scent of Blood (Deathbringer Saurfang) - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_200_YARDS; + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // no break case 72771: // Scent of Blood (Deathbringer Saurfang) - spellInfo->EffectRadiusIndex[1] = EFFECT_RADIUS_200_YARDS; + spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); break; case 72723: // Resistant Skin (Deathbringer Saurfang adds) // this spell initially granted Shadow damage immunity, however it was removed but the data was left in client - spellInfo->Effect[2] = 0; + spellInfo->Effects[EFFECT_2].Effect = 0; break; case 70460: // Coldflame Jets (Traps after Saurfang) - spellInfo->DurationIndex = 1; // 10 seconds + spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(1); // 10 seconds break; case 71412: // Green Ooze Summon (Professor Putricide) case 71415: // Orange Ooze Summon (Professor Putricide) - spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_TARGET_ANY; + spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY); break; case 71159: // Awaken Plagued Zombies - spellInfo->DurationIndex = 21; + spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(21); break; case 70530: // Volatile Ooze Beam Protection (Professor Putricide) - spellInfo->Effect[0] = SPELL_EFFECT_APPLY_AURA; // for an unknown reason this was SPELL_EFFECT_APPLY_AREA_AURA_RAID + spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_APPLY_AURA; // for an unknown reason this was SPELL_EFFECT_APPLY_AREA_AURA_RAID break; // THIS IS HERE BECAUSE COOLDOWN ON CREATURE PROCS IS NOT IMPLEMENTED case 71604: // Mutated Strength (Professor Putricide) case 72673: // Mutated Strength (Professor Putricide) case 72674: // Mutated Strength (Professor Putricide) case 72675: // Mutated Strength (Professor Putricide) - spellInfo->Effect[1] = 0; + spellInfo->Effects[EFFECT_1].Effect = 0; break; case 72454: // Mutated Plague (Professor Putricide) case 72464: // Mutated Plague (Professor Putricide) case 72506: // Mutated Plague (Professor Putricide) case 72507: // Mutated Plague (Professor Putricide) - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_50000_YARDS; // 50000yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // 50000yd break; case 70911: // Unbound Plague (Professor Putricide) (needs target selection script) case 72854: // Unbound Plague (Professor Putricide) (needs target selection script) case 72855: // Unbound Plague (Professor Putricide) (needs target selection script) case 72856: // Unbound Plague (Professor Putricide) (needs target selection script) - spellInfo->EffectImplicitTargetB[0] = TARGET_UNIT_TARGET_ENEMY; + spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ENEMY); break; case 71518: // Unholy Infusion Quest Credit (Professor Putricide) case 72934: // Blood Infusion Quest Credit (Blood-Queen Lana'thel) case 72289: // Frost Infusion Quest Credit (Sindragosa) - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_50000_YARDS; // another missing radius + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // another missing radius break; case 71708: // Empowered Flare (Blood Prince Council) case 72785: // Empowered Flare (Blood Prince Council) @@ -3512,98 +3512,98 @@ void SpellMgr::LoadDbcDataCorrections() spellInfo->AttributesEx3 |= SPELL_ATTR3_STACK_FOR_DIFF_CASTERS; break; case 70715: // Column of Frost (visual marker) - spellInfo->DurationIndex = 32; // 6 seconds (missing) + spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(32); // 6 seconds (missing) break; case 71085: // Mana Void (periodic aura) - spellInfo->DurationIndex = 9; // 30 seconds (missing) + spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(9); // 30 seconds (missing) break; case 72015: // Frostbolt Volley (only heroic) case 72016: // Frostbolt Volley (only heroic) - spellInfo->EffectRadiusIndex[2] = EFFECT_RADIUS_40_YARDS; + spellInfo->Effects[EFFECT_2].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_40_YARDS); break; case 70936: // Summon Suppressor (needs target selection script) - spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_TARGET_ANY; - spellInfo->EffectImplicitTargetB[0] = 0; + spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY); + spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(); break; case 72706: // Achievement Check (Valithria Dreamwalker) case 71357: // Order Whelp - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_200_YARDS; // 200yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd break; case 70598: // Sindragosa's Fury - spellInfo->EffectImplicitTargetA[0] = TARGET_DEST_DEST; + spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DEST); break; case 69846: // Frost Bomb - spellInfo->speed = 0.0f; // This spell's summon happens instantly + spellInfo->Speed = 0.0f; // This spell's summon happens instantly break; case 71614: // Ice Lock spellInfo->Mechanic = MECHANIC_STUN; break; case 72762: // Defile - spellInfo->DurationIndex = 559; // 53 seconds + spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(559); // 53 seconds break; case 72743: // Defile - spellInfo->DurationIndex = 22; // 45 seconds + spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(22); // 45 seconds break; case 72754: // Defile case 73708: // Defile case 73709: // Defile case 73710: // Defile - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_200_YARDS; // 200yd - spellInfo->EffectRadiusIndex[1] = EFFECT_RADIUS_200_YARDS; // 200yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd + spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd break; case 69030: // Val'kyr Target Search - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_200_YARDS; // 200yd - spellInfo->EffectRadiusIndex[1] = EFFECT_RADIUS_200_YARDS; // 200yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd + spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd break; case 69198: // Raging Spirit Visual - spellInfo->rangeIndex = 13; // 50000yd + spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(13); // 50000yd break; case 73654: // Harvest Souls case 74295: // Harvest Souls case 74296: // Harvest Souls case 74297: // Harvest Souls - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_50000_YARDS; // 50000yd - spellInfo->EffectRadiusIndex[1] = EFFECT_RADIUS_50000_YARDS; // 50000yd - spellInfo->EffectRadiusIndex[2] = EFFECT_RADIUS_50000_YARDS; // 50000yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // 50000yd + spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // 50000yd + spellInfo->Effects[EFFECT_2].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // 50000yd break; case 73655: // Harvest Soul spellInfo->AttributesEx3 |= SPELL_ATTR3_NO_DONE_BONUS; break; case 73540: // Summon Shadow Trap - spellInfo->DurationIndex = 23; // 90 seconds + spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(23); // 90 seconds break; case 73530: // Shadow Trap (visual) - spellInfo->DurationIndex = 28; // 5 seconds + spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(28); // 5 seconds break; case 73529: // Shadow Trap - spellInfo->EffectRadiusIndex[1] = EFFECT_RADIUS_10_YARDS; // 10yd + spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_10_YARDS); // 10yd break; case 74282: // Shadow Trap (searcher) - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_3_YARDS; // 3yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_3_YARDS); // 3yd break; case 72595: // Restore Soul case 73650: // Restore Soul - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_200_YARDS; // 200yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd break; case 74086: // Destroy Soul - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_200_YARDS; // 200yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd break; case 74302: // Summon Spirit Bomb case 74342: // Summon Spirit Bomb - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_200_YARDS; // 200yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd spellInfo->MaxAffectedTargets = 1; break; case 74341: // Summon Spirit Bomb case 74343: // Summon Spirit Bomb - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_200_YARDS; // 200yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd spellInfo->MaxAffectedTargets = 3; break; case 73579: // Summon Spirit Bomb - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_25_YARDS; // 25yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_25_YARDS); // 25yd break; case 72350: // Fury of Frostmourne - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_50000_YARDS; // 50000yd - spellInfo->EffectRadiusIndex[1] = EFFECT_RADIUS_50000_YARDS; // 50000yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // 50000yd + spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // 50000yd break; case 75127: // Kill Frostmourne Players case 72351: // Fury of Frostmourne @@ -3611,18 +3611,18 @@ void SpellMgr::LoadDbcDataCorrections() case 72429: // Mass Resurrection case 73159: // Play Movie case 73582: // Trigger Vile Spirit (Inside, Heroic) - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_50000_YARDS; // 50000yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // 50000yd break; case 72376: // Raise Dead spellInfo->MaxAffectedTargets = 3; - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_50000_YARDS; // 50000yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); // 50000yd break; case 71809: // Jump - spellInfo->rangeIndex = 3; // 20yd - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_25_YARDS; // 25yd + spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(3); // 20yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_25_YARDS); // 25yd break; case 72405: // Broken Frostmourne - spellInfo->EffectRadiusIndex[1] = EFFECT_RADIUS_200_YARDS; // 200yd + spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_200_YARDS); // 200yd break; // ENDOF ICECROWN CITADEL SPELLS // @@ -3632,7 +3632,7 @@ void SpellMgr::LoadDbcDataCorrections() case 77844: // Twilight Cutter case 77845: // Twilight Cutter case 77846: // Twilight Cutter - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_100_YARDS; // 100yd + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_100_YARDS); // 100yd break; case 75509: // Twilight Mending spellInfo->AttributesEx6 |= SPELL_ATTR6_CAN_TARGET_INVISIBLE; @@ -3651,15 +3651,15 @@ void SpellMgr::LoadDbcDataCorrections() spellInfo->Attributes |= SPELL_ATTR0_NEGATIVE_1; break; case 2378: // Minor Fortitude - spellInfo->manaCost = 0; - spellInfo->manaPerSecond = 0; + spellInfo->ManaCost = 0; + spellInfo->ManaPerSecond = 0; break; // OCULUS SPELLS // The spells below are here, because their effect 1 is giving warning, because the triggered spell is not found in dbc and is missing from encounter sniff. case 49462: // Call Ruby Drake case 49461: // Call Amber Drake case 49345: // Call Emerald Drake - spellInfo->Effect[1] = 0; + spellInfo->Effects[EFFECT_1].Effect = 0; break; default: break; @@ -3670,7 +3670,7 @@ void SpellMgr::LoadDbcDataCorrections() case SPELLFAMILY_PALADIN: // Seals of the Pure should affect Seal of Righteousness if (spellInfo->SpellIconID == 25 && spellInfo->Attributes & SPELL_ATTR0_PASSIVE) - spellInfo->EffectSpellClassMask[0][1] |= 0x20000000; + spellInfo->Effects[EFFECT_0].SpellClassMask[1] |= 0x20000000; break; case SPELLFAMILY_DEATHKNIGHT: // Icy Touch - extend FamilyFlags (unused value) for Sigil of the Frozen Conscience to use @@ -3684,6 +3684,6 @@ void SpellMgr::LoadDbcDataCorrections() properties->Type = SUMMON_TYPE_TOTEM; properties = const_cast(sSummonPropertiesStore.LookupEntry(647)); // 52893 properties->Type = SUMMON_TYPE_TOTEM; - */ - sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded spell dbc data corrections in %u ms", GetMSTimeDiffToNow(oldMSTime)); + + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded SpellInfo corrections in %u ms", GetMSTimeDiffToNow(oldMSTime)); } diff --git a/src/server/game/Spells/SpellMgr.h b/src/server/game/Spells/SpellMgr.h index 2cfc8aad624..96c46eb6db7 100644 --- a/src/server/game/Spells/SpellMgr.h +++ b/src/server/game/Spells/SpellMgr.h @@ -720,7 +720,7 @@ class SpellMgr void UnloadSpellInfoStore(); void UnloadSpellInfoImplicitTargetConditionLists(); void LoadSpellCustomAttr(); - void LoadDbcDataCorrections(); + void LoadSpellInfoCorrections(); private: SpellDifficultySearcherMap mSpellDifficultySearcherMap; -- cgit v1.2.3 From f43b9df40068152caea39aae1f313f1ed41bc917 Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 24 Dec 2012 19:13:00 +0100 Subject: Core/Spells: Added missing changes to 77b85b2ea0aec6cd3e545e60e46ac60eebb11e47 --- src/server/game/World/World.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 1ee10399398..dd40357a2fb 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1333,12 +1333,12 @@ void World::SetInitialWorldSettings() LoadDB2Stores(m_dataPath); DetectDBCLang(); - sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading spell dbc data corrections..."); - sSpellMgr->LoadDbcDataCorrections(); - sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading SpellInfo store..."); sSpellMgr->LoadSpellInfoStore(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading SpellInfo corrections..."); + sSpellMgr->LoadSpellInfoCorrections(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading SkillLineAbilityMultiMap Data..."); sSpellMgr->LoadSkillLineAbilityMap(); -- cgit v1.2.3 From d3d9dfd7346b46eb0994ab89ac97a09d5dbde2fb Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Mon, 24 Dec 2012 21:35:34 +0100 Subject: Core/Script: Add some talks for Zul'Gurub --- .../ZulGurub/boss_jindo_the_godbreaker.cpp | 23 ++++- .../EasternKingdoms/ZulGurub/boss_kilnara.cpp | 21 +++- .../EasternKingdoms/ZulGurub/boss_mandokir.cpp | 21 +++- .../EasternKingdoms/ZulGurub/boss_venoxis.cpp | 23 ++++- .../EasternKingdoms/ZulGurub/boss_zanzil.cpp | 24 ++++- .../EasternKingdoms/ZulGurub/instance_zulgurub.cpp | 107 +++++++++++---------- .../scripts/EasternKingdoms/ZulGurub/zulgurub.h | 8 ++ 7 files changed, 160 insertions(+), 67 deletions(-) (limited to 'src') diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo_the_godbreaker.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo_the_godbreaker.cpp index 4677ce52e1c..bcf742fcf32 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo_the_godbreaker.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo_the_godbreaker.cpp @@ -22,6 +22,22 @@ enum Yells { + // Jin'do the Godbreaker + SAY_INTRO = 0, + SAY_AGGRO = 1, + EMOTE_SHADOWS_OF_HAKKAR = 2, // ID - 97172 Shadows of Hakkar + SAY_JINDO_SPIRIT_PHASE = 3, + //SAY_PLAYER_KILL = 4, // missing data + + // Spirit of Hakkar + SAY_SPIRIT_SPIRIT_PHASE = 0, + SAY_SPIRIT_DEFEATED = 1, + + // Jin'do the Godbreaker - Trigger + SAY_JINDO_DEFEATED = 0, + + // Shadow of Hakkar + SAY_SHADOW_DEFEATED = 0, }; enum Spells @@ -39,16 +55,17 @@ class boss_jindo_the_godbreaker : public CreatureScript struct boss_jindo_the_godbreakerAI : public BossAI { - boss_jindo_the_godbreakerAI(Creature* creature) : BossAI(creature, DATA_JINDO) - { - } + boss_jindo_the_godbreakerAI(Creature* creature) : BossAI(creature, DATA_JINDO) { } void Reset() { + _Reset(); } void EnterCombat(Unit* /*who*/) { + _EnterCombat(); + Talk(SAY_AGGRO); } void JustDied(Unit* /*killer*/) diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_kilnara.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_kilnara.cpp index a60eeb0c715..f582edd54db 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_kilnara.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_kilnara.cpp @@ -23,6 +23,12 @@ enum Yells { + SAY_AGGRO = 0, + SAY_WAVE_OF_AGONY = 1, // ID - 96457 Wave of Agony + SAY_TRANSFROM_1 = 2, + SAY_TRANSFROM_2 = 3, + SAY_PLAYER_KILL = 4, + SAY_DEATH = 5 }; enum Spells @@ -40,20 +46,29 @@ class boss_kilnara : public CreatureScript struct boss_kilnaraAI : public BossAI { - boss_kilnaraAI(Creature* creature) : BossAI(creature, DATA_KILNARA) - { - } + boss_kilnaraAI(Creature* creature) : BossAI(creature, DATA_KILNARA) { } void Reset() { + _Reset(); } void EnterCombat(Unit* /*who*/) { + _EnterCombat(); + Talk(SAY_AGGRO); } void JustDied(Unit* /*killer*/) { + _JustDied(); + Talk(SAY_DEATH); + } + + void KilledUnit(Unit* victim) + { + if (victim->GetTypeId() == TYPEID_PLAYER) + Talk(SAY_PLAYER_KILL); } void UpdateAI(uint32 const diff) diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp index 3619f0d0bc9..fde47a2ccb5 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp @@ -22,6 +22,14 @@ enum Yells { + SAY_AGGRO = 0, + SAY_PLAYER_KILL = 1, + SAY_DISMOUNT_OHGAN = 2, + EMOTE_DEVASTATING_SLAM = 3, // ID - 96739 Devastating Slam + SAY_REANIMATE_OHGAN = 4, // ID - 96724 Reanimate Ohgan + EMOTE_FRENZY = 5, // ID - 96800 Frenzy + SAY_FRENZY = 6, // ID - 96800 Frenzy + SAY_DEATH = 7 }; enum Spells @@ -44,18 +52,25 @@ class boss_mandokir : public CreatureScript void Reset() { + _Reset(); } - void KilledUnit(Unit* /*victim*/) + void EnterCombat(Unit* /*who*/) { + _EnterCombat(); + Talk(SAY_AGGRO); } - void EnterCombat(Unit* /*who*/) + void JustDied(Unit* /*killer*/) { + _JustDied(); + Talk(SAY_DEATH); } - void JustDied(Unit* /*killer*/) + void KilledUnit(Unit* victim) { + if (victim->GetTypeId() == TYPEID_PLAYER) + Talk(SAY_PLAYER_KILL); } void UpdateAI(uint32 const diff) diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp index 8980d766400..a0ca0cff73d 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp @@ -24,6 +24,14 @@ enum Yells { + SAY_AGGRO = 0, + SAY_BLOODVENOM = 1, // ID - 96842 Venomous Effusion + SAY_TRANSFROM = 2, // ID - 97354 Blessing of the Snake God + SAY_WORD_OF_HETHISS = 3, // ID - 96560 Word of Hethiss + EMOTE_BLOODVENOM = 4, // ID - 96842 Bloodvenom + EMOTE_VENOM_WITHDRAWAL = 5, // ID - 96653 Venom Withdrawal + SAY_PLAYER_KILL = 6, + SAY_DEATH = 7 }; enum Spells @@ -41,24 +49,29 @@ class boss_venoxis : public CreatureScript struct boss_venoxisAI : public BossAI { - boss_venoxisAI(Creature* creature) : BossAI(creature, DATA_VENOXIS) - { - } + boss_venoxisAI(Creature* creature) : BossAI(creature, DATA_VENOXIS) { } void Reset() { + _Reset(); } void EnterCombat(Unit* /*who*/) { + _EnterCombat(); + Talk(SAY_AGGRO); } - void DamageTaken(Unit* /*attacker*/, uint32& /*damage*/) + void JustDied(Unit* /*killer*/) { + _JustDied(); + Talk(SAY_DEATH); } - void JustDied(Unit* /*killer*/) + void KilledUnit(Unit* victim) { + if (victim->GetTypeId() == TYPEID_PLAYER) + Talk(SAY_PLAYER_KILL); } void UpdateAI(uint32 const diff) diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_zanzil.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_zanzil.cpp index 7466d8e47d3..00b8c8747f6 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_zanzil.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_zanzil.cpp @@ -22,6 +22,15 @@ enum Yells { + SAY_AGGRO = 0, + EMOTE_ZANZIL_ZOMBIES = 1, // ID - 96319 Zanzil's Resurrection Elixir + SAY_ZANZIL_ZOMBIES = 2, // ID - 96319 Zanzil's Resurrection Elixir + EMOTE_ZANZIL_GRAVEYARD_GAS = 3, // ID - 96338 Zanzil's Graveyard Gas + SAY_ZANZIL_GRAVEYARD_GAS = 4, // ID - 96338 Zanzil's Graveyard Gas + EMOTE_ZANZIL_BERSEKER = 5, // ID - 96316 Zanzil's Resurrection Elixir + SAY_ZANZIL_BERSEKER = 6, // ID - 96316 Zanzil's Resurrection Elixir + SAY_PLAYER_KILL = 7, + SAY_DEATH = 8 }; enum Spells @@ -39,20 +48,29 @@ class boss_zanzil : public CreatureScript struct boss_zanzilAI : public BossAI { - boss_zanzilAI(Creature* creature) : BossAI(creature, DATA_ZANZIL) - { - } + boss_zanzilAI(Creature* creature) : BossAI(creature, DATA_ZANZIL) { } void Reset() { + _Reset(); } void EnterCombat(Unit* /*who*/) { + _EnterCombat(); + Talk(SAY_AGGRO); } void JustDied(Unit* /*killer*/) { + _JustDied(); + Talk(SAY_DEATH); + } + + void KilledUnit(Unit* victim) + { + if (victim->GetTypeId() == TYPEID_PLAYER) + Talk(SAY_PLAYER_KILL); } void UpdateAI(uint32 const diff) diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp index b887755e25a..953d9f392bd 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp @@ -30,50 +30,54 @@ class instance_zulgurub : public InstanceMapScript instance_zulgurub_InstanceMapScript(Map* map) : InstanceScript(map) { SetBossNumber(EncounterCount); - venoxisGUID = 0; - mandokirGUID = 0; - kilnaraGUID = 0; - zanzilGUID = 0; - jindoGUID = 0; - hazzarahGUID = 0; - renatakiGUID = 0; - wushoolayGUID = 0; - grilekGUID = 0; + venoxisGUID = 0; + mandokirGUID = 0; + kilnaraGUID = 0; + zanzilGUID = 0; + jindoGUID = 0; + hazzarahGUID = 0; + renatakiGUID = 0; + wushoolayGUID = 0; + grilekGUID = 0; + jindoTiggerGUID = 0; } void OnCreatureCreate(Creature* creature) { switch (creature->GetEntry()) { - case NPC_VENOXIS: - venoxisGUID = creature->GetGUID(); - break; - case NPC_MANDOKIR: - mandokirGUID = creature->GetGUID(); - break; - case NPC_KILNARA: - kilnaraGUID = creature->GetGUID(); - break; - case NPC_ZANZIL: - zanzilGUID = creature->GetGUID(); - break; - case NPC_JINDO: - jindoGUID = creature->GetGUID(); - break; - case NPC_HAZZARAH: - hazzarahGUID = creature->GetGUID(); - break; - case NPC_RENATAKI: - renatakiGUID = creature->GetGUID(); - break; - case NPC_WUSHOOLAY: - wushoolayGUID = creature->GetGUID(); - break; - case NPC_GRILEK: - grilekGUID = creature->GetGUID(); - break; - default: - break; + case NPC_VENOXIS: + venoxisGUID = creature->GetGUID(); + break; + case NPC_MANDOKIR: + mandokirGUID = creature->GetGUID(); + break; + case NPC_KILNARA: + kilnaraGUID = creature->GetGUID(); + break; + case NPC_ZANZIL: + zanzilGUID = creature->GetGUID(); + break; + case NPC_JINDO: + jindoGUID = creature->GetGUID(); + break; + case NPC_HAZZARAH: + hazzarahGUID = creature->GetGUID(); + break; + case NPC_RENATAKI: + renatakiGUID = creature->GetGUID(); + break; + case NPC_WUSHOOLAY: + wushoolayGUID = creature->GetGUID(); + break; + case NPC_GRILEK: + grilekGUID = creature->GetGUID(); + break; + case NPC_JINDO_TRIGGER: + jindoTiggerGUID = creature->GetGUID(); + break; + default: + break; } } @@ -84,18 +88,18 @@ class instance_zulgurub : public InstanceMapScript switch (type) { - case DATA_VENOXIS: - case DATA_MANDOKIR: - case DATA_KILNARA: - case DATA_ZANZIL: - case DATA_JINDO: - case DATA_HAZZARAH: - case DATA_RENATAKI: - case DATA_WUSHOOLAY: - case DATA_GRILEK: - break; - default: - break; + case DATA_VENOXIS: + case DATA_MANDOKIR: + case DATA_KILNARA: + case DATA_ZANZIL: + case DATA_JINDO: + case DATA_HAZZARAH: + case DATA_RENATAKI: + case DATA_WUSHOOLAY: + case DATA_GRILEK: + break; + default: + break; } return true; @@ -141,6 +145,8 @@ class instance_zulgurub : public InstanceMapScript return wushoolayGUID; case DATA_GRILEK: return grilekGUID; + case DATA_JINDOR_TRIGGER: + return jindoTiggerGUID; default: break; } @@ -202,6 +208,7 @@ class instance_zulgurub : public InstanceMapScript uint64 renatakiGUID; uint64 wushoolayGUID; uint64 grilekGUID; + uint64 jindoTiggerGUID; }; InstanceScript* GetInstanceScript(InstanceMap* map) const diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h b/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h index dc4db4be5c4..cdf4724dc35 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h +++ b/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h @@ -36,6 +36,9 @@ enum DataTypes DATA_RENATAKI = 6, DATA_WUSHOOLAY = 7, DATA_GRILEK = 8, + + // Jin'do the Godbreaker + DATA_JINDOR_TRIGGER, }; enum CreatureIds @@ -51,6 +54,11 @@ enum CreatureIds NPC_RENATAKI = 52269, NPC_WUSHOOLAY = 52286, NPC_GRILEK = 52258, + + // Jin'do the Godbreaker + NPC_JINDO_TRIGGER = 52150, + NPC_SPIRIT_OF_HAKKAR = 52222, + NPC_SHADOW_OF_HAKKAR = 52650 }; template -- cgit v1.2.3 From f9e592e9c7b758d8d61d43e7f2c6b09cc0c1dd7f Mon Sep 17 00:00:00 2001 From: Subv Date: Mon, 24 Dec 2012 18:24:30 -0500 Subject: Scripts/HallsOfOrigination: Some work on Halls of Origination. Temple Guardian Anhuur's script added. ToDo: Make the triggers invisible. Merry Christmas folks! --- ...012_12_24_09_world_halls_of_origination_434.sql | 50 +++ src/server/game/Grids/Notifiers/GridNotifiers.h | 19 + src/server/game/Scripting/ScriptLoader.cpp | 5 + src/server/game/Spells/SpellMgr.cpp | 7 + src/server/scripts/Kalimdor/CMakeLists.txt | 3 + .../boss_temple_guardian_anhuur.cpp | 402 +++++++++++++++++++++ .../HallsOfOrigination/halls_of_origination.h | 70 ++++ .../instance_halls_of_origination.cpp | 167 +++++++++ .../IcecrownCitadel/boss_the_lich_king.cpp | 23 +- 9 files changed, 725 insertions(+), 21 deletions(-) create mode 100644 sql/updates/world/2012_12_24_09_world_halls_of_origination_434.sql create mode 100644 src/server/scripts/Kalimdor/HallsOfOrigination/boss_temple_guardian_anhuur.cpp create mode 100644 src/server/scripts/Kalimdor/HallsOfOrigination/halls_of_origination.h create mode 100644 src/server/scripts/Kalimdor/HallsOfOrigination/instance_halls_of_origination.cpp (limited to 'src') diff --git a/sql/updates/world/2012_12_24_09_world_halls_of_origination_434.sql b/sql/updates/world/2012_12_24_09_world_halls_of_origination_434.sql new file mode 100644 index 00000000000..940f3407f23 --- /dev/null +++ b/sql/updates/world/2012_12_24_09_world_halls_of_origination_434.sql @@ -0,0 +1,50 @@ +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=76599; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(13, 1, 76599, 0, 0, 31, 0, 5, 207218, 0, 0, 0, 0, '', 'Activate Beacons - Beacon of Light'), +(13, 1, 76599, 0, 1, 31, 0, 5, 207219, 0, 0, 0, 0, '', 'Activate Beacons - Beacon of Light'), +(13, 1, 76599, 0, 2, 31, 0, 5, 203133, 0, 0, 0, 0, '', 'Activate Beacons - Beacon of Light'), +(13, 1, 76599, 0, 3, 31, 0, 5, 203136, 0, 0, 0, 0, '', 'Activate Beacons - Beacon of Light'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=75194; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(13, 1, 75194, 0, 0, 31, 0, 3, 40283, 0, 0, 0, 0, '', 'Burning Light - Searing Light'); + +UPDATE `creature_template` SET `ScriptName`='boss_temple_guardian_anhuur' WHERE `entry`=39425; +UPDATE `creature_template` SET `ScriptName`='',`unit_flags`=`unit_flags`|0x00000040|0x00008000 WHERE `entry`=40183; + +DELETE FROM `spell_target_position` WHERE `id`=74969; +INSERT INTO `spell_target_position` (`id`,`target_map`,`target_position_x`,`target_position_y`,`target_position_z`,`target_orientation`) VALUES +(74969, 644, -640.437, 335.306, 77.7573, 1.52073); + +UPDATE `instance_template` SET `script`='instance_halls_of_origination' WHERE `map`=644; + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (76573,74930); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(13, 2, 74930, 0, 0, 31, 0, 3, 40183, 0, 0, 0, 0, '', 'Shield of Light - Cave In Stalker'), +(13, 2, 76573, 0, 0, 31, 0, 3, 40183, 0, 0, 0, 0, '', 'Shield of Light - Cave In Stalker'); + +DELETE FROM `spell_script_names` WHERE `spell_id` IN (74930,76573,76599,76606,76608); +INSERT INTO `spell_script_names`(`spell_id`,`ScriptName`) VALUES +(74930, 'spell_anhuur_shield_of_light'), +(76573, 'spell_anhuur_shield_of_light'), +(76599, 'spell_anhuur_activate_beacons'), +(76606, 'spell_anhuur_disable_beacon_beams'), +(76608, 'spell_anhuur_disable_beacon_beams'), +(75592, 'spell_anhuur_divine_reckoning'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (76606,76608); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,1,76606,0,0,31,0,3,40183,0,0,0,'','Disable Beacon Beams L - Cave In Stalker'), +(13,1,76608,0,0,31,0,3,40183,0,0,0,'','Disable Beacon Beams R - Cave In Stalker'); + +DELETE FROM `creature_text` WHERE `entry`=39425; +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES +(39425, 0, 0, 'Turn back, intruders! These halls must not be disturbed!', 14, 0, 100, 0, 0, 18580, 'Temple Guardian Anhuur - SAY_AGGRO'), +(39425, 1, 0, 'Beacons of light, bestow upon me your aegis!', 14, 0, 100, 0, 0, 18581, 'Temple Guardian Anhuur - SAY_SHIELD'), +(39425, 2, 0, '%s becomes protected by his defense beacons! Disable them by pulling the levers below!', 41, 0, 100, 0, 0, 0, 'Temple Guardian Anhuur - EMOTE_SHIELD'), +(39425, 3, 0, '%s is no longer protected by the beacons!', 41, 0, 100, 0, 0, 0, 'Temple Guardian Anhuur'), +(39425, 4, 0, 'I regret nothing.', 14, 0, 100, 0, 0, 18582, 'Temple Guardian Anhuur'), +(39425, 5, 0, 'What... have you... done?', 14, 0, 100, 0, 0, 18579, 'Temple Guardian Anhuur - SAY_DEATH'); + +-- Template updates for creature 40283 (Searing Light) +UPDATE `creature_template` SET `faction_A`=14,`faction_H`=14,`minlevel`=80,`maxlevel`=80,`baseattacktime`=2000,`unit_flags`=`unit_flags`|33555008 WHERE `entry`=40283; -- Searing Light diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h index 1dbf1ba0be8..73dd5aa7247 100644 --- a/src/server/game/Grids/Notifiers/GridNotifiers.h +++ b/src/server/game/Grids/Notifiers/GridNotifiers.h @@ -1375,6 +1375,25 @@ namespace Trinity uint64 _GUID; }; + class HeightDifferenceCheck + { + public: + HeightDifferenceCheck(WorldObject* go, float diff, bool reverse) + : _baseObject(go), _difference(diff), _reverse(reverse) + { + } + + bool operator()(WorldObject* unit) const + { + return (unit->GetPositionZ() - _baseObject->GetPositionZ() > _difference) != _reverse; + } + + private: + WorldObject* _baseObject; + float _difference; + bool _reverse; + }; + class UnitAuraCheck { public: diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index 97ad1d5f651..5faae2bf719 100644 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -328,6 +328,8 @@ void AddSC_wailing_caverns(); //Wailing caverns void AddSC_instance_wailing_caverns(); void AddSC_zulfarrak(); //Zul'Farrak generic void AddSC_instance_zulfarrak(); //Zul'Farrak instance script +void AddSC_instance_halls_of_origination(); +void AddSC_boss_temple_guardian_anhuur(); void AddSC_ashenvale(); void AddSC_azshara(); @@ -979,6 +981,9 @@ void AddKalimdorScripts() AddSC_thunder_bluff(); AddSC_ungoro_crater(); AddSC_winterspring(); + + AddSC_instance_halls_of_origination(); + AddSC_boss_temple_guardian_anhuur(); #endif } diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index b86d67ff1ca..295aeceee8c 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -3661,6 +3661,13 @@ void SpellMgr::LoadSpellInfoCorrections() case 49345: // Call Emerald Drake spellInfo->Effects[EFFECT_1].Effect = 0; break; + // Halls Of Origination spells + // Temple Guardian Anhuur + case 76606: // Disable Beacon Beams L + case 76608: // Disable Beacon Beams R + // Little hack, Increase the radius so it can hit the Cave In Stalkers in the platform. + spellInfo->Effects[EFFECT_0].MaxRadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_45_YARDS); + break; default: break; } diff --git a/src/server/scripts/Kalimdor/CMakeLists.txt b/src/server/scripts/Kalimdor/CMakeLists.txt index f54c23afb3c..37e2f86e787 100644 --- a/src/server/scripts/Kalimdor/CMakeLists.txt +++ b/src/server/scripts/Kalimdor/CMakeLists.txt @@ -110,6 +110,9 @@ set(scripts_STAT_SRCS Kalimdor/OnyxiasLair/boss_onyxia.cpp Kalimdor/OnyxiasLair/onyxias_lair.h Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp + Kalimdor/HallsOfOrigination/halls_of_origination.h + Kalimdor/HallsOfOrigination/boss_temple_guardian_anhuur.cpp + Kalimdor/HallsOfOrigination/instance_halls_of_origination.cpp ) message(" -> Prepared: Kalimdor") diff --git a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_temple_guardian_anhuur.cpp b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_temple_guardian_anhuur.cpp new file mode 100644 index 00000000000..0df55f5f276 --- /dev/null +++ b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_temple_guardian_anhuur.cpp @@ -0,0 +1,402 @@ +/* + * Copyright (C) 2008-2012 TrinityCore + * + * 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; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; 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, see . + */ + +#include "ObjectMgr.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "SpellAuras.h" +#include "halls_of_origination.h" +#include "Player.h" + +enum Texts +{ + SAY_AGGRO = 0, + SAY_SHIELD = 1, + EMOTE_SHIELD = 2, + EMOTE_UNSHIELD = 3, + SAY_KILL = 4, + SAY_DEATH = 5 +}; + +enum Events +{ + EVENT_DIVINE_RECKONING = 1, + EVENT_BURNING_LIGHT = 2, + EVENT_SEAR = 3, +}; + +enum Spells +{ + SPELL_DIVINE_RECKONING = 75592, + SPELL_BURNING_LIGHT = 75115, + SPELL_REVERBERATING_HYMN = 75322, + SPELL_SHIELD_OF_LIGHT = 74938, + + SPELL_ACTIVATE_BEACONS = 76599, + SPELL_TELEPORT = 74969, + + SPELL_SHIELD_VISUAL_RIGHT = 83698, + SPELL_BEAM_OF_LIGHT_RIGHT = 76573, + + SPELL_SHIELD_VISUAL_LEFT = 83697, + SPELL_BEAM_OF_LIGHT_LEFT = 74930, + + SPELL_SEARING_LIGHT = 75194, +}; + +enum Phases +{ + PHASE_SHIELDED = 0, + PHASE_FIRST_SHIELD = 1, // Ready to be shielded for the first time + PHASE_SECOND_SHIELD = 2, // First shield already happened, ready to be shielded a second time + PHASE_FINAL = 3 // Already shielded twice, ready to finish the encounter normally. +}; + +enum Actions +{ + ACTION_DISABLE_BEACON, +}; + +class boss_temple_guardian_anhuur : public CreatureScript +{ +public: + boss_temple_guardian_anhuur() : CreatureScript("boss_temple_guardian_anhuur") { } + + struct boss_temple_guardian_anhuurAI : public BossAI + { + boss_temple_guardian_anhuurAI(Creature* creature) : BossAI(creature, DATA_TEMPLE_GUARDIAN_ANHUUR) { } + + void CleanStalkers() + { + std::list stalkers; + GetCreatureListWithEntryInGrid(stalkers, me, NPC_CAVE_IN_STALKER, 100.0f); + for (std::list::iterator itr = stalkers.begin(); itr != stalkers.end(); ++itr) + { + (*itr)->RemoveAurasDueToSpell(SPELL_BEAM_OF_LIGHT_RIGHT); + (*itr)->RemoveAurasDueToSpell(SPELL_BEAM_OF_LIGHT_LEFT); + } + } + + void Reset() + { + _phase = PHASE_FIRST_SHIELD; + _oldPhase = PHASE_FIRST_SHIELD; + _beacons = 0; + _Reset(); + CleanStalkers(); + me->RemoveAurasDueToSpell(SPELL_SHIELD_OF_LIGHT); + events.ScheduleEvent(EVENT_DIVINE_RECKONING, urand(10000, 12000)); + events.ScheduleEvent(EVENT_BURNING_LIGHT, 12000); + } + + void DamageTaken(Unit* /*attacker*/, uint32& damage) + { + if ((me->HealthBelowPctDamaged(66, damage) && _phase == PHASE_FIRST_SHIELD) || + (me->HealthBelowPctDamaged(33, damage) && _phase == PHASE_SECOND_SHIELD)) + { + _beacons = 2; + _phase++; // Increase the phase + _oldPhase = _phase; + + _phase = PHASE_SHIELDED; + + me->InterruptNonMeleeSpells(true); + me->AttackStop(); + DoCast(me, SPELL_TELEPORT); + + DoCast(me, SPELL_SHIELD_OF_LIGHT); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_31); + + DoCastAOE(SPELL_ACTIVATE_BEACONS); + + std::list stalkers; + GameObject* door = ObjectAccessor::GetGameObject(*me, instance->GetData64(DATA_ANHUUR_DOOR)); + GetCreatureListWithEntryInGrid(stalkers, me, NPC_CAVE_IN_STALKER, 100.0f); + + stalkers.remove_if(Trinity::HeightDifferenceCheck(door, 0.0f, false)); // Target only the bottom ones + for (std::list::iterator itr = stalkers.begin(); itr != stalkers.end(); ++itr) + { + if ((*itr)->GetPositionX() > door->GetPositionX()) + { + (*itr)->CastSpell((*itr), SPELL_SHIELD_VISUAL_LEFT, true); + (*itr)->CastSpell((*itr), SPELL_BEAM_OF_LIGHT_LEFT, true); + } + else + { + (*itr)->CastSpell((*itr), SPELL_SHIELD_VISUAL_RIGHT, true); + (*itr)->CastSpell((*itr), SPELL_BEAM_OF_LIGHT_RIGHT, true); + } + } + + DoCast(me, SPELL_REVERBERATING_HYMN); + + Talk(EMOTE_SHIELD); + Talk(SAY_SHIELD); + } + } + + void DoAction(int32 const action) + { + if (action == ACTION_DISABLE_BEACON) + { + --_beacons; + if (!_beacons) + { + me->RemoveAurasDueToSpell(SPELL_SHIELD_OF_LIGHT); + Talk(EMOTE_UNSHIELD); + _phase = _oldPhase; + } + } + } + + void EnterCombat(Unit* /*who*/) + { + instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me, 1); + Talk(SAY_AGGRO); + _EnterCombat(); + } + + void JustDied(Unit* /*killer*/) + { + instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); + Talk(SAY_DEATH); + _JustDied(); + } + + void KilledUnit(Unit* victim) + { + if (victim->GetTypeId() == TYPEID_PLAYER) + Talk(SAY_KILL); + } + + void JustReachedHome() + { + instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); + _JustReachedHome(); + instance->SetBossState(DATA_TEMPLE_GUARDIAN_ANHUUR, FAIL); + } + + void UpdateAI(uint32 const diff) + { + if (!UpdateVictim() || !CheckInRoom() || me->GetCurrentSpell(CURRENT_CHANNELED_SPELL) || _phase == PHASE_SHIELDED) + return; + + events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_DIVINE_RECKONING: + DoCastVictim(SPELL_DIVINE_RECKONING); + events.ScheduleEvent(EVENT_DIVINE_RECKONING, urand(10000, 12000)); + break; + case EVENT_BURNING_LIGHT: + { + Unit* unit = SelectTarget(SELECT_TARGET_RANDOM, 0, NonTankTargetSelector(me)); + if (!unit) + unit = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true); + DoCast(unit, SPELL_BURNING_LIGHT); + events.ScheduleEvent(EVENT_SEAR, 2000); + events.ScheduleEvent(EVENT_BURNING_LIGHT, 12000); + break; + } + case EVENT_SEAR: + { + Unit* target = me->FindNearestCreature(NPC_SEARING_LIGHT, 100.0f); + if (!target) + break; + + std::list stalkers; + GetCreatureListWithEntryInGrid(stalkers, me, NPC_CAVE_IN_STALKER, 100.0f); + stalkers.remove_if(Trinity::HeightDifferenceCheck(ObjectAccessor::GetGameObject(*me, instance->GetData64(DATA_ANHUUR_DOOR)), 5.0f, true)); + + if (stalkers.empty()) + break; + + stalkers.sort(Trinity::ObjectDistanceOrderPred(target)); + + // Get the closest statue face (any of its eyes) + Creature* eye1 = stalkers.front(); + stalkers.remove(eye1); // Remove the eye. + stalkers.sort(Trinity::ObjectDistanceOrderPred(eye1)); // Find the second eye. + Creature* eye2 = stalkers.front(); + + eye1->CastSpell(eye1, SPELL_SEARING_LIGHT, true); + eye2->CastSpell(eye2, SPELL_SEARING_LIGHT, true); + break; + } + } + } + + DoMeleeAttackIfReady(); + } + + private: + uint8 _phase; + uint8 _oldPhase; + uint8 _beacons; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return GetHallsOfOriginationAI(creature); + } +}; + +class spell_anhuur_shield_of_light : public SpellScriptLoader +{ + public: + spell_anhuur_shield_of_light() : SpellScriptLoader("spell_anhuur_shield_of_light") { } + + class spell_anhuur_shield_of_light_SpellScript : public SpellScript + { + PrepareSpellScript(spell_anhuur_shield_of_light_SpellScript); + + void FilterTargets(std::list& targets) + { + if (InstanceMap* instance = GetCaster()->GetMap()->ToInstanceMap()) + { + if (InstanceScript* const script = instance->GetInstanceScript()) + { + if (GameObject* go = ObjectAccessor::GetGameObject(*GetCaster(), script->GetData64(DATA_ANHUUR_DOOR))) + { + targets.remove_if(Trinity::HeightDifferenceCheck(go, 5.0f, false)); + targets.remove(GetCaster()); + targets.sort(Trinity::ObjectDistanceOrderPred(GetCaster())); + targets.resize(2); + } + } + } + } + + void Register() + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_anhuur_shield_of_light_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENTRY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_anhuur_shield_of_light_SpellScript(); + } +}; + +class spell_anhuur_disable_beacon_beams : public SpellScriptLoader +{ + public: + spell_anhuur_disable_beacon_beams() : SpellScriptLoader("spell_anhuur_disable_beacon_beams") { } + + class spell_anhuur_disable_beacon_beams_SpellScript : public SpellScript + { + PrepareSpellScript(spell_anhuur_disable_beacon_beams_SpellScript); + + void HandleScript(SpellEffIndex /*effIndex*/) + { + GetHitUnit()->RemoveAurasDueToSpell(GetEffectValue()); + } + + void Notify(SpellEffIndex /*index*/) + { + if (InstanceMap* instance = GetCaster()->GetMap()->ToInstanceMap()) + if (InstanceScript* const script = instance->GetInstanceScript()) + if (Creature* anhuur = instance->GetCreature(script->GetData64(DATA_ANHUUR_GUID))) + anhuur->AI()->DoAction(ACTION_DISABLE_BEACON); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_anhuur_disable_beacon_beams_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + OnEffectHit += SpellEffectFn(spell_anhuur_disable_beacon_beams_SpellScript::Notify, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_anhuur_disable_beacon_beams_SpellScript(); + } +}; + +class spell_anhuur_activate_beacons : public SpellScriptLoader +{ + public: + spell_anhuur_activate_beacons() : SpellScriptLoader("spell_anhuur_activate_beacons") { } + + class spell_anhuur_activate_beacons_SpellScript : public SpellScript + { + PrepareSpellScript(spell_anhuur_activate_beacons_SpellScript); + + void Activate(SpellEffIndex index) + { + PreventHitDefaultEffect(index); + GetHitGObj()->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_anhuur_activate_beacons_SpellScript::Activate, EFFECT_0, SPELL_EFFECT_ACTIVATE_OBJECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_anhuur_activate_beacons_SpellScript(); + } +}; + +class spell_anhuur_divine_reckoning : public SpellScriptLoader +{ +public: + spell_anhuur_divine_reckoning() : SpellScriptLoader("spell_anhuur_divine_reckoning") { } + + class spell_anhuur_divine_reckoning_AuraScript : public AuraScript + { + PrepareAuraScript(spell_anhuur_divine_reckoning_AuraScript); + + void OnPeriodic(AuraEffect const* aurEff) + { + if (Unit* caster = GetCaster()) + { + CustomSpellValues values; + values.AddSpellMod(SPELLVALUE_BASE_POINT0, aurEff->GetAmount()); + caster->CastCustomSpell(GetSpellInfo()->Effects[EFFECT_0].TriggerSpell, values, GetTarget()); + } + } + + void Register() + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_anhuur_divine_reckoning_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_anhuur_divine_reckoning_AuraScript(); + } +}; + +void AddSC_boss_temple_guardian_anhuur() +{ + new boss_temple_guardian_anhuur(); + new spell_anhuur_shield_of_light(); + new spell_anhuur_disable_beacon_beams(); + new spell_anhuur_activate_beacons(); + new spell_anhuur_divine_reckoning(); +} \ No newline at end of file diff --git a/src/server/scripts/Kalimdor/HallsOfOrigination/halls_of_origination.h b/src/server/scripts/Kalimdor/HallsOfOrigination/halls_of_origination.h new file mode 100644 index 00000000000..d25272c92ac --- /dev/null +++ b/src/server/scripts/Kalimdor/HallsOfOrigination/halls_of_origination.h @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2008-2012 TrinityCore + * + * 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; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; 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, see . + */ + +#ifndef HALLS_OF_ORIGINATION_H +#define HALLS_OF_ORIGINATION_H + +#define HoOScriptName "instance_halls_of_origination" + +uint32 const EncounterCount = 7; + +enum Data +{ + // Bosses + DATA_TEMPLE_GUARDIAN_ANHUUR, + DATA_EARTHRAGER_PTAH, + DATA_ANRAPHET, + DATA_ISISET, + DATA_AMMUNAE, + DATA_SETESH, + DATA_RAJH, + + // Temple Guardian Anhuur + DATA_ANHUUR_GUID, + DATA_ANHUUR_LEFT_BEACON, + DATA_ANHUUR_RIGHT_BEACON, + DATA_ANHUUR_BRIDGE, + DATA_ANHUUR_DOOR, +}; + +enum Creatures +{ + BOSS_TEMPLE_GUARDIAN_ANHUUR = 39425, + NPC_CAVE_IN_STALKER = 40183, + NPC_SEARING_LIGHT = 40283, +}; + +enum GameObjects +{ + GO_ANHUURS_BRIDGE = 206506, + GO_DOODAD_ULDUM_ELEVATOR_COL01 = 207725, + GO_ANHUURS_DOOR = 202307, + GO_ANHUURS_RIGHT_BEACON = 203136, + GO_ANHUURS_LEFT_BEACON = 203133, +}; + +template +CreatureAI* GetHallsOfOriginationAI(Creature* creature) +{ + if (InstanceMap* instance = creature->GetMap()->ToInstanceMap()) + if (instance->GetInstanceScript()) + if (instance->GetScriptId() == sObjectMgr->GetScriptId(HoOScriptName)) + return new AI(creature); + return NULL; +} + +#endif // HALLS_OF_ORIGINATION_H \ No newline at end of file diff --git a/src/server/scripts/Kalimdor/HallsOfOrigination/instance_halls_of_origination.cpp b/src/server/scripts/Kalimdor/HallsOfOrigination/instance_halls_of_origination.cpp new file mode 100644 index 00000000000..f879f7b3202 --- /dev/null +++ b/src/server/scripts/Kalimdor/HallsOfOrigination/instance_halls_of_origination.cpp @@ -0,0 +1,167 @@ +/* + * Copyright (C) 2008-2012 TrinityCore + * + * 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; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; 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, see . + */ + +#include "ObjectMgr.h" +#include "ScriptMgr.h" +#include "InstanceScript.h" +#include "ScriptedCreature.h" +#include "Map.h" +#include "PoolMgr.h" +#include "AccountMgr.h" +#include "halls_of_origination.h" +#include "Player.h" +#include "WorldPacket.h" +#include "WorldSession.h" + +DoorData const doorData[] = +{ + {GO_ANHUURS_DOOR, DATA_TEMPLE_GUARDIAN_ANHUUR, DOOR_TYPE_PASSAGE, BOUNDARY_NONE }, + {GO_ANHUURS_BRIDGE, DATA_TEMPLE_GUARDIAN_ANHUUR, DOOR_TYPE_PASSAGE, BOUNDARY_NONE }, + {GO_DOODAD_ULDUM_ELEVATOR_COL01, DATA_TEMPLE_GUARDIAN_ANHUUR, DOOR_TYPE_PASSAGE, BOUNDARY_NONE }, + {0, 0, DOOR_TYPE_ROOM, BOUNDARY_NONE } +}; + +class instance_halls_of_origination : public InstanceMapScript +{ + public: + instance_halls_of_origination() : InstanceMapScript(HoOScriptName, 644) { } + + struct instance_halls_of_origination_InstanceMapScript : public InstanceScript + { + instance_halls_of_origination_InstanceMapScript(InstanceMap* map) : InstanceScript(map) + { + SetBossNumber(EncounterCount); + LoadDoorData(doorData); + TempleGuardianAnhuurGUID = 0; + AnhuursBridgeGUID = 0; + AnhuursDoorGUID = 0; + AnhuurRightBeaconGUID = 0; + AnhuurLeftBeaconGUID = 0; + } + + void OnGameObjectCreate(GameObject* go) + { + switch (go->GetEntry()) + { + case GO_ANHUURS_BRIDGE: + AnhuursBridgeGUID = go->GetGUID(); + case GO_DOODAD_ULDUM_ELEVATOR_COL01: + AddDoor(go, true); + break; + case GO_ANHUURS_DOOR: + AnhuursDoorGUID = go->GetGUID(); + AddDoor(go, true); + break; + case GO_ANHUURS_RIGHT_BEACON: + AnhuurRightBeaconGUID = go->GetGUID(); + break; + case GO_ANHUURS_LEFT_BEACON: + AnhuurLeftBeaconGUID = go->GetGUID(); + break; + } + } + + void OnCreatureCreate(Creature* creature) + { + switch (creature->GetEntry()) + { + case BOSS_TEMPLE_GUARDIAN_ANHUUR: + TempleGuardianAnhuurGUID = creature->GetGUID(); + break; + } + } + + uint64 GetData64(uint32 index) const + { + switch (index) + { + case DATA_ANHUUR_BRIDGE: + return AnhuursBridgeGUID; + case DATA_ANHUUR_DOOR: + return AnhuursDoorGUID; + case DATA_ANHUUR_LEFT_BEACON: + return AnhuurLeftBeaconGUID; + case DATA_ANHUUR_RIGHT_BEACON: + return AnhuurRightBeaconGUID; + case DATA_ANHUUR_GUID: + return TempleGuardianAnhuurGUID; + } + + return 0; + } + + std::string GetSaveData() + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << "H O " << GetBossSaveData(); + + OUT_SAVE_INST_DATA_COMPLETE; + return saveStream.str(); + } + + void Load(const char* str) + { + if (!str) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(str); + + char dataHead1, dataHead2; + + std::istringstream loadStream(str); + loadStream >> dataHead1 >> dataHead2; + + if (dataHead1 == 'H' && dataHead2 == 'O') + { + for (uint32 i = 0; i < EncounterCount; ++i) + { + uint32 tmpState; + loadStream >> tmpState; + if (tmpState == IN_PROGRESS || tmpState > SPECIAL) + tmpState = NOT_STARTED; + SetBossState(i, EncounterState(tmpState)); + } + } + else + OUT_LOAD_INST_DATA_FAIL; + + OUT_LOAD_INST_DATA_COMPLETE; + } + + protected: + uint64 TempleGuardianAnhuurGUID; + uint64 AnhuursBridgeGUID; + uint64 AnhuursDoorGUID; + uint64 AnhuurRightBeaconGUID; + uint64 AnhuurLeftBeaconGUID; + }; + + InstanceScript* GetInstanceScript(InstanceMap* map) const + { + return new instance_halls_of_origination_InstanceMapScript(map); + } +}; + +void AddSC_instance_halls_of_origination() +{ + new instance_halls_of_origination(); +} diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp index ec5172aeb83..a2663074de8 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -383,25 +383,6 @@ class NecroticPlagueTargetCheck : public std::unary_function uint32 _notAura2; }; -class HeightDifferenceCheck -{ - public: - HeightDifferenceCheck(GameObject* go, float diff, bool reverse) - : _baseObject(go), _difference(diff), _reverse(reverse) - { - } - - bool operator()(WorldObject* unit) const - { - return (unit->GetPositionZ() - _baseObject->GetPositionZ() > _difference) != _reverse; - } - - private: - GameObject* _baseObject; - float _difference; - bool _reverse; -}; - class FrozenThroneResetWorker { public: @@ -1535,7 +1516,7 @@ class npc_valkyr_shadowguard : public CreatureScript { std::list triggers; GetCreatureListWithEntryInGrid(triggers, me, NPC_WORLD_TRIGGER, 150.0f); - triggers.remove_if(HeightDifferenceCheck(platform, 5.0f, true)); + triggers.remove_if(Trinity::HeightDifferenceCheck(platform, 5.0f, true)); if (triggers.empty()) return; @@ -2325,7 +2306,7 @@ class spell_the_lich_king_quake : public SpellScriptLoader void FilterTargets(std::list& targets) { if (GameObject* platform = ObjectAccessor::GetGameObject(*GetCaster(), GetCaster()->GetInstanceScript()->GetData64(DATA_ARTHAS_PLATFORM))) - targets.remove_if(HeightDifferenceCheck(platform, 5.0f, false)); + targets.remove_if(Trinity::HeightDifferenceCheck(platform, 5.0f, false)); } void HandleSendEvent(SpellEffIndex /*effIndex*/) -- cgit v1.2.3 From d4f936a4fa9f4b6202ee5a5d1565373c7ca5d5e8 Mon Sep 17 00:00:00 2001 From: Subv Date: Mon, 24 Dec 2012 19:02:10 -0500 Subject: Scripts/HallsOfOrigination: Fixed Temple Guardian Anhuur's Reverberating Hymn spell damage. --- src/server/game/Spells/SpellMgr.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 295aeceee8c..faca4956d28 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -3668,6 +3668,10 @@ void SpellMgr::LoadSpellInfoCorrections() // Little hack, Increase the radius so it can hit the Cave In Stalkers in the platform. spellInfo->Effects[EFFECT_0].MaxRadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_45_YARDS); break; + case 75323: // Reverberating Hymn + // Aura is refreshed at 3 seconds, and the tick should happen at the fourth. + spellInfo->AttributesEx8 |= SPELL_ATTR8_DONT_RESET_PERIODIC_TIMER; + break; default: break; } -- cgit v1.2.3 From cfb6a1b4d562f93f2515db5928165fc297a38ca4 Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Wed, 26 Dec 2012 01:11:07 +0100 Subject: Core/Quest: Add missing changes for monthly quests --- src/server/game/Quests/QuestDef.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h index 3e91ba2ac8c..b0a1bc60f7c 100644 --- a/src/server/game/Quests/QuestDef.h +++ b/src/server/game/Quests/QuestDef.h @@ -168,7 +168,7 @@ enum __QuestSpecialFlags QUEST_SPECIAL_FLAGS_MONTHLY = 0x010, // quest is reset at the begining of the month // room for more custom flags - QUEST_SPECIAL_FLAGS_DB_ALLOWED = QUEST_SPECIAL_FLAGS_REPEATABLE | QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT | QUEST_SPECIAL_FLAGS_AUTO_ACCEPT | QUEST_SPECIAL_FLAGS_DF_QUEST, + QUEST_SPECIAL_FLAGS_DB_ALLOWED = QUEST_SPECIAL_FLAGS_REPEATABLE | QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT | QUEST_SPECIAL_FLAGS_AUTO_ACCEPT | QUEST_SPECIAL_FLAGS_DF_QUEST | QUEST_SPECIAL_FLAGS_MONTHLY, QUEST_SPECIAL_FLAGS_DELIVER = 0x080, // Internal flag computed only QUEST_SPECIAL_FLAGS_SPEAKTO = 0x100, // Internal flag computed only -- cgit v1.2.3 From 587710feb5f4de21204900d57c7a34320aadb85e Mon Sep 17 00:00:00 2001 From: Subv Date: Tue, 25 Dec 2012 19:35:13 -0500 Subject: Scripts/HallsOfOrigination: Added script for Earthrager Ptah. ToDo: Fix spell Sand Vortex on Heroic difficulty. Note: Feedback needed. --- ...012_12_25_01_world_halls_of_origination_434.sql | 54 ++++ src/server/game/Scripting/ScriptLoader.cpp | 2 + src/server/game/Spells/SpellMgr.cpp | 5 + src/server/scripts/Kalimdor/CMakeLists.txt | 3 +- .../HallsOfOrigination/boss_earthrager_ptah.cpp | 350 +++++++++++++++++++++ .../HallsOfOrigination/halls_of_origination.h | 6 + .../instance_halls_of_origination.cpp | 12 + 7 files changed, 431 insertions(+), 1 deletion(-) create mode 100644 sql/updates/world/2012_12_25_01_world_halls_of_origination_434.sql create mode 100644 src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp (limited to 'src') diff --git a/sql/updates/world/2012_12_25_01_world_halls_of_origination_434.sql b/sql/updates/world/2012_12_25_01_world_halls_of_origination_434.sql new file mode 100644 index 00000000000..2e6c1b0e5f0 --- /dev/null +++ b/sql/updates/world/2012_12_25_01_world_halls_of_origination_434.sql @@ -0,0 +1,54 @@ +DELETE FROM `creature_text` WHERE `entry`=39428; +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES +(39428, 0, 0, 'More carrion for the swarm...', 14, 0, 100, 0, 0, 18906, 'Earthrager Ptah - SAY_AGGRO'), +(39428, 1, 0, 'Ptah... is... no more...', 14, 0, 100, 0, 0, 18905, 'Earthrager Ptah - SAY_DEATH'); + +DELETE FROM `spell_script_names` WHERE `spell_id` IN (75540,94974,75519); +INSERT INTO `spell_script_names` VALUES +(75540,'spell_earthrager_ptah_flame_bolt'), +(75519 ,'spell_earthrager_ptah_explosion'), +(94974,'spell_earthrager_ptah_earth_spike'); + +UPDATE `creature_template` SET `ScriptName`='boss_earthrager_ptah' WHERE `Entry`=39428; + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=89398; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(13, 6, 89398, 0, 0, 31, 0, 3, 39443, 0, 0, 0, 0, '', 'Earth Spike - Camel'); + +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry`=39443; +INSERT INTO `npc_spellclick_spells` (`npc_entry`,`spell_id`,`cast_flags`,`user_type`) VALUES +(39443,89397,1,0); + +-- Jeweled Scarab SAI +SET @ENTRY := 40458; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,1,54,0,100,0,0,0,0,0,91,9,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Jeweled Scarab - On just summoned - Remove field byte for submerged'), +(@ENTRY,0,1,0,61,0,100,0,0,0,0,0,11,65982,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Jeweled Scarab - Linked - Cast emerge'), +(@ENTRY,0,2,0,1,0,100,1,2500,2500,2500,2500,49,0,0,0,0,0,0,21,100,0,0,0,0,0,0, 'Jeweled Scarab - OOC (one time) - Attack player in 100 yards'), +(@ENTRY,0,3,4,6,0,100,0,0,0,0,0,45,0,1,0,0,0,0,11,39428,100,0,0,0,0,0, 'Jeweled Scarab - On death - Set data 0 - 1'), +(@ENTRY,0,4,0,61,0,100,0,0,0,0,0,90,9,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Jeweled Scarab - Linked - Add again byte for submerged'); + +-- Dustbone Horror SAI +SET @ENTRY := 40450; +SET @SPELL := 75453; -- Smash +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,54,0,100,0,0,0,0,0,91,9,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Dustbone Horror - On just summoned - Remove field byte 1 for submerged'), +(@ENTRY,0,1,0,1,0,100,1,2500,2500,2500,2500,49,0,0,0,0,0,0,21,100,0,0,0,0,0,0, 'Dustbone Horror - OOC (one time) - Attack player in 100 yards'), +(@ENTRY,0,2,0,0,0,100,0,10000,12000,10000,12000,11,@SPELL,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Dustbone Horror - Combat - Cast Smash'), +(@ENTRY,0,3,4,6,0,100,0,0,0,0,0,45,0,1,0,0,0,0,11,39428,100,0,0,0,0,0, 'Dustbone Horror - On death - Set data 0 - 1'), +(@ENTRY,0,4,0,61,0,100,0,0,0,0,0,90,9,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Dustbone Horror - Linked - Add again byte for submerged'); + +-- Add creature_addon data +DELETE FROM `creature_template_addon` WHERE `entry` IN (40458,40450); +INSERT INTO `creature_template_addon` (`entry`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `auras`) VALUES +(40458,0,0,9,1,0,NULL), +(40450,0,0,9,1,0,NULL); + +SET @QUICKSAND := 75548; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@QUICKSAND; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@QUICKSAND,0,0,0,54,0,100,0,0,0,0,0,11,40503,0,0,0,0,0,1,0,0,0,0,0,0,0,'Quicksand - On summoned (spawned) - Cast spell'); diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index 5faae2bf719..a025f856d79 100644 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -330,6 +330,7 @@ void AddSC_zulfarrak(); //Zul'Farrak generic void AddSC_instance_zulfarrak(); //Zul'Farrak instance script void AddSC_instance_halls_of_origination(); void AddSC_boss_temple_guardian_anhuur(); +void AddSC_boss_earthrager_ptah(); void AddSC_ashenvale(); void AddSC_azshara(); @@ -984,6 +985,7 @@ void AddKalimdorScripts() AddSC_instance_halls_of_origination(); AddSC_boss_temple_guardian_anhuur(); + AddSC_boss_earthrager_ptah(); #endif } diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index faca4956d28..d1ec90c2ff3 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -3672,6 +3672,11 @@ void SpellMgr::LoadSpellInfoCorrections() // Aura is refreshed at 3 seconds, and the tick should happen at the fourth. spellInfo->AttributesEx8 |= SPELL_ATTR8_DONT_RESET_PERIODIC_TIMER; break; + // Earthrager Ptah + case 94974: + // Hacked as a timed event until SPELL_EFFECT_TRIGGER_MISSILE is correctly fixed. + spellInfo->Effects[EFFECT_0].TriggerSpell = 0; + break; default: break; } diff --git a/src/server/scripts/Kalimdor/CMakeLists.txt b/src/server/scripts/Kalimdor/CMakeLists.txt index 37e2f86e787..49415506565 100644 --- a/src/server/scripts/Kalimdor/CMakeLists.txt +++ b/src/server/scripts/Kalimdor/CMakeLists.txt @@ -111,8 +111,9 @@ set(scripts_STAT_SRCS Kalimdor/OnyxiasLair/onyxias_lair.h Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp Kalimdor/HallsOfOrigination/halls_of_origination.h - Kalimdor/HallsOfOrigination/boss_temple_guardian_anhuur.cpp Kalimdor/HallsOfOrigination/instance_halls_of_origination.cpp + Kalimdor/HallsOfOrigination/boss_temple_guardian_anhuur.cpp + Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp ) message(" -> Prepared: Kalimdor") diff --git a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp new file mode 100644 index 00000000000..1d5b473f09f --- /dev/null +++ b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp @@ -0,0 +1,350 @@ +#include "ObjectMgr.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "SpellAuras.h" +#include "halls_of_origination.h" +#include "Player.h" + +enum Texts +{ + SAY_AGGRO = 0, + SAY_DEATH = 1, +}; + +enum Events +{ + EVENT_RAGING_SMASH = 1, + EVENT_FLAME_BOLT = 2, + EVENT_EARTH_SPIKE = 3, + EVENT_PTAH_EXPLODE = 4, + EVENT_QUICKSAND = 5, +}; + +enum Spells +{ + SPELL_RAGING_SMASH = 83650, + SPELL_FLAME_BOLT = 77370, + SPELL_EARTH_SPIKE_WARN = 94974, + SPELL_EARTH_SPIKE_ERUPT = 75339, + + SPELL_PTAH_EXPLOSION = 75519, + SPELL_SANDSTORM = 75491, + + SPELL_SUMMON_QUICKSAND = 75550, // Spell not in DBC, no SMSG_SPELL_START/GO for it + + SPELL_BEETLE_BURROW = 75463, + + SPELL_SUMMON_JEWELED_SCARAB = 75462, + SPELL_SUMMON_DUSTBONE_HORROR = 75521, +}; + +enum Phases +{ + PHASE_NORMAL = 1, + PHASE_DISPERSE = 2, + + PHASE_MASK_DISPERSE = (1 << PHASE_DISPERSE), + PHASE_MASK_NORMAL = (1 << PHASE_NORMAL), +}; + +enum PtahData +{ + DATA_SUMMON_DEATHS = 0 +}; + +class SummonScarab : public BasicEvent +{ +public: + SummonScarab(Unit* owner, InstanceScript* instance) : _owner(owner), _instance(instance) { } + + bool Execute(uint64 execTime, uint32 /*diff*/) + { + if (!_instance || _instance->GetBossState(DATA_EARTHRAGER_PTAH) != IN_PROGRESS) + return true; // delete event + + _owner->CastSpell(_owner, SPELL_SUMMON_JEWELED_SCARAB); + _owner->RemoveAurasDueToSpell(SPELL_BEETLE_BURROW); + return true; + } +protected: + InstanceScript* _instance; + Unit* _owner; +}; + +class EruptEarthSpike : public BasicEvent +{ +public: + EruptEarthSpike(Unit* caster, WorldLocation const target) : _caster(caster), _target(target) { } + + bool Execute(uint64 execTime, uint32 /*diff*/) + { + _caster->CastSpell(_target.GetPositionX(), _target.GetPositionY(), _target.GetPositionZ(), SPELL_EARTH_SPIKE_ERUPT, true); + return true; + } + +protected: + Unit* _caster; + WorldLocation const _target; +}; + +class boss_earthrager_ptah : public CreatureScript +{ +public: + boss_earthrager_ptah() : CreatureScript("boss_earthrager_ptah") { } + + struct boss_earthrager_ptahAI : public BossAI + { + boss_earthrager_ptahAI(Creature* creature) : BossAI(creature, DATA_EARTHRAGER_PTAH), _summonDeaths(0), _hasDispersed(false) { } + + void Cleanup() + { + std::list units; + + GetCreatureListWithEntryInGrid(units, me, NPC_DUSTBONE_HORROR, 100.0f); + for (std::list::iterator itr = units.begin(); itr != units.end(); ++itr) + (*itr)->DespawnOrUnsummon(); + + GetCreatureListWithEntryInGrid(units, me, NPC_JEWELED_SCARAB, 100.0f); + for (std::list::iterator itr = units.begin(); itr != units.end(); ++itr) + (*itr)->DespawnOrUnsummon(); + } + + void Reset() + { + _summonDeaths = 0; + _hasDispersed = false; + Cleanup(); + _Reset(); + events.SetPhase(PHASE_NORMAL); + events.ScheduleEvent(EVENT_RAGING_SMASH, urand(7000, 12000), 0, PHASE_NORMAL); + events.ScheduleEvent(EVENT_FLAME_BOLT, 15000, 0, PHASE_NORMAL); + events.ScheduleEvent(EVENT_EARTH_SPIKE, urand(16000, 21000), 0, PHASE_NORMAL); + } + + void DamageTaken(Unit* /*attacker*/, uint32& damage) + { + if (me->HealthBelowPctDamaged(50, damage) && (events.GetPhaseMask() & PHASE_MASK_NORMAL) && !_hasDispersed) + { + events.SetPhase(PHASE_DISPERSE); + _hasDispersed = true; + + me->AttackStop(); + DoCast(me, SPELL_SANDSTORM); + events.ScheduleEvent(EVENT_PTAH_EXPLODE, 6000, 0, PHASE_DISPERSE); + events.ScheduleEvent(EVENT_QUICKSAND, 10000, 0, PHASE_DISPERSE); + + std::list stalkers; + GetCreatureListWithEntryInGrid(stalkers, me, NPC_BEETLE_STALKER, 100.0f); + std::list beetlers = stalkers; + + Trinity::Containers::RandomResizeList(beetlers, 9); // Holds the summoners of Jeweled Scarab + + for (std::list::iterator itr = beetlers.begin(); itr != beetlers.end(); ++itr) + { + stalkers.remove((*itr)); // Remove it to prevent a single trigger from spawning multiple npcs. + (*itr)->CastSpell((*itr), SPELL_BEETLE_BURROW); // Cast visual + // Summon after 5 seconds. + (*itr)->m_Events.AddEvent(new SummonScarab((*itr), instance), (*itr)->m_Events.CalculateTime(5000)); + } + + Trinity::Containers::RandomResizeList(stalkers, 2); // Holds the summoners of Dustbone Horror + + for (std::list::iterator itr = stalkers.begin(); itr != stalkers.end(); ++itr) + (*itr)->CastSpell((*itr), SPELL_SUMMON_DUSTBONE_HORROR); + } + } + + void SetData(uint32 index, uint32 value) + { + if (index == DATA_SUMMON_DEATHS) + { + ++_summonDeaths; + if (_summonDeaths == 11) // All summons died + { + me->RemoveAurasDueToSpell(SPELL_PTAH_EXPLOSION); + events.SetPhase(PHASE_NORMAL); + events.ScheduleEvent(EVENT_RAGING_SMASH, urand(7000, 12000), 0, PHASE_NORMAL); + events.ScheduleEvent(EVENT_FLAME_BOLT, 15000, 0, PHASE_NORMAL); + events.ScheduleEvent(EVENT_EARTH_SPIKE, urand(16000, 21000), 0, PHASE_NORMAL); + } + } + } + + void EnterCombat(Unit* /*who*/) + { + instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me, 1); + Talk(SAY_AGGRO); + _EnterCombat(); + } + + void JustDied(Unit* /*killer*/) + { + instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); + Talk(SAY_DEATH); + _JustDied(); + Cleanup(); + } + + void JustReachedHome() + { + instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); + _JustReachedHome(); + instance->SetBossState(DATA_EARTHRAGER_PTAH, FAIL); + } + + void UpdateAI(uint32 const diff) + { + if (!UpdateVictim() || !CheckInRoom()) + return; + + events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_RAGING_SMASH: + DoCastVictim(SPELL_RAGING_SMASH); + events.ScheduleEvent(EVENT_RAGING_SMASH, urand(7000, 12000), 0, PHASE_NORMAL); + break; + case EVENT_FLAME_BOLT: + DoCast(me, SPELL_FLAME_BOLT); + events.ScheduleEvent(EVENT_FLAME_BOLT, 15000, 0, PHASE_NORMAL); + break; + case EVENT_EARTH_SPIKE: + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true)) + DoCast(target, SPELL_EARTH_SPIKE_WARN); + events.ScheduleEvent(EVENT_EARTH_SPIKE, urand(16000, 21000), 0, PHASE_NORMAL); + break; + case EVENT_PTAH_EXPLODE: + DoCast(me, SPELL_PTAH_EXPLOSION); + break; + case EVENT_QUICKSAND: + // Spell not in DBC, it is not cast either, according to sniffs + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true)) + if (Creature* quicksand = me->SummonCreature(NPC_QUICKSAND, *target)) + quicksand->SetUInt32Value(UNIT_CREATED_BY_SPELL, SPELL_SUMMON_QUICKSAND); + events.ScheduleEvent(EVENT_QUICKSAND, 10000, 0, PHASE_DISPERSE); + break; + } + } + + if (events.GetPhaseMask() & PHASE_MASK_NORMAL) // Do not melee in the disperse phase + DoMeleeAttackIfReady(); + } + + protected: + bool _hasDispersed; + uint8 _summonDeaths; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return GetHallsOfOriginationAI(creature); + } +}; + +class spell_earthrager_ptah_flame_bolt : public SpellScriptLoader +{ + public: + spell_earthrager_ptah_flame_bolt() : SpellScriptLoader("spell_earthrager_ptah_flame_bolt") { } + + class spell_earthrager_ptah_flame_bolt_SpellScript : public SpellScript + { + PrepareSpellScript(spell_earthrager_ptah_flame_bolt_SpellScript); + + void FilterTargets(std::list& targets) + { + Trinity::Containers::RandomResizeList(targets, GetCaster()->GetMap()->IsHeroic() ? 3 : 2); + } + + void Register() + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_earthrager_ptah_flame_bolt_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_earthrager_ptah_flame_bolt_SpellScript(); + } +}; + +class spell_earthrager_ptah_earth_spike : public SpellScriptLoader +{ +public: + spell_earthrager_ptah_earth_spike() : SpellScriptLoader("spell_earthrager_ptah_earth_spike") { } + + class spell_earthrager_ptah_earth_spike_SpellScript : public SpellScript + { + PrepareSpellScript(spell_earthrager_ptah_earth_spike_SpellScript); + + void Launch(SpellEffIndex index) + { + PreventHitDefaultEffect(index); + // Erupt the spike in 4 seconds. + GetCaster()->m_Events.AddEvent(new EruptEarthSpike(GetCaster(), *GetExplTargetDest()), GetCaster()->m_Events.CalculateTime(4000)); + } + + void Register() + { + OnEffectHit += SpellEffectFn(spell_earthrager_ptah_earth_spike_SpellScript::Launch, EFFECT_0, SPELL_EFFECT_TRIGGER_MISSILE); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_earthrager_ptah_earth_spike_SpellScript(); + } +}; + +class spell_earthrager_ptah_explosion : public SpellScriptLoader +{ +public: + spell_earthrager_ptah_explosion() : SpellScriptLoader("spell_earthrager_ptah_explosion") { } + + class spell_earthrager_ptah_explosion_AuraScript : public AuraScript + { + PrepareAuraScript(spell_earthrager_ptah_explosion_AuraScript); + + void SetFlags(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Unit* ptah = GetCaster()) + { + ptah->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_UNK_29 | UNIT_FLAG_UNK_31); + ptah->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH); + } + } + + void RemoveFlags(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Unit* ptah = GetCaster()) + { + ptah->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_UNK_29 | UNIT_FLAG_UNK_31); + ptah->RemoveFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH); + } + } + + void Register() + { + OnEffectApply += AuraEffectApplyFn(spell_earthrager_ptah_explosion_AuraScript::SetFlags, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + OnEffectRemove += AuraEffectRemoveFn(spell_earthrager_ptah_explosion_AuraScript::RemoveFlags, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_earthrager_ptah_explosion_AuraScript(); + } +}; + +void AddSC_boss_earthrager_ptah() +{ + new boss_earthrager_ptah(); + new spell_earthrager_ptah_flame_bolt(); + new spell_earthrager_ptah_earth_spike(); + new spell_earthrager_ptah_explosion(); +} \ No newline at end of file diff --git a/src/server/scripts/Kalimdor/HallsOfOrigination/halls_of_origination.h b/src/server/scripts/Kalimdor/HallsOfOrigination/halls_of_origination.h index d25272c92ac..1f11b594353 100644 --- a/src/server/scripts/Kalimdor/HallsOfOrigination/halls_of_origination.h +++ b/src/server/scripts/Kalimdor/HallsOfOrigination/halls_of_origination.h @@ -46,6 +46,12 @@ enum Creatures BOSS_TEMPLE_GUARDIAN_ANHUUR = 39425, NPC_CAVE_IN_STALKER = 40183, NPC_SEARING_LIGHT = 40283, + + BOSS_EARTHRAGER_PTAH = 39428, + NPC_BEETLE_STALKER = 40459, // Summons both Jeweled Scarab and Dustbone Horror + NPC_JEWELED_SCARAB = 40458, + NPC_DUSTBONE_HORROR = 40450, + NPC_QUICKSAND = 40503, // Summoned by a spell not in dbc (75550) }; enum GameObjects diff --git a/src/server/scripts/Kalimdor/HallsOfOrigination/instance_halls_of_origination.cpp b/src/server/scripts/Kalimdor/HallsOfOrigination/instance_halls_of_origination.cpp index f879f7b3202..726ecbacd2e 100644 --- a/src/server/scripts/Kalimdor/HallsOfOrigination/instance_halls_of_origination.cpp +++ b/src/server/scripts/Kalimdor/HallsOfOrigination/instance_halls_of_origination.cpp @@ -75,6 +75,18 @@ class instance_halls_of_origination : public InstanceMapScript } } + void OnGameObjectRemove(GameObject* go) + { + switch (go->GetEntry()) + { + case GO_ANHUURS_BRIDGE: + case GO_DOODAD_ULDUM_ELEVATOR_COL01: + case GO_ANHUURS_DOOR: + AddDoor(go, false); + break; + } + } + void OnCreatureCreate(Creature* creature) { switch (creature->GetEntry()) -- cgit v1.2.3 From 3742205866e76ff1e5078da5fd20de2a7bab6f83 Mon Sep 17 00:00:00 2001 From: Subv Date: Tue, 25 Dec 2012 19:40:57 -0500 Subject: Copyright: Added missing license information. --- .../HallsOfOrigination/boss_earthrager_ptah.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src') diff --git a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp index 1d5b473f09f..3cb89f75c25 100644 --- a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp +++ b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp @@ -1,3 +1,20 @@ +/* + * Copyright (C) 2008-2012 TrinityCore + * + * 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; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; 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, see . + */ + #include "ObjectMgr.h" #include "ScriptMgr.h" #include "ScriptedCreature.h" -- cgit v1.2.3 From e65da39f23ed4dfad38585ccf09ddcfc3138bbb7 Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Wed, 26 Dec 2012 02:50:19 +0100 Subject: Core: Fix non pch build --- .../world/2012_12_25_01_world_halls_of_origination_434.sql | 2 +- .../scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp | 7 ++++--- .../Kalimdor/HallsOfOrigination/boss_temple_guardian_anhuur.cpp | 8 +++++--- .../scripts/Kalimdor/HallsOfOrigination/halls_of_origination.h | 2 +- 4 files changed, 11 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/sql/updates/world/2012_12_25_01_world_halls_of_origination_434.sql b/sql/updates/world/2012_12_25_01_world_halls_of_origination_434.sql index 84588cf76d9..7b2cd1a7245 100644 --- a/sql/updates/world/2012_12_25_01_world_halls_of_origination_434.sql +++ b/sql/updates/world/2012_12_25_01_world_halls_of_origination_434.sql @@ -3,7 +3,7 @@ INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language (39428, 0, 0, 'More carrion for the swarm...', 14, 0, 100, 0, 0, 18906, 'Earthrager Ptah - SAY_AGGRO'), (39428, 1, 0, 'Ptah... is... no more...', 14, 0, 100, 0, 0, 18905, 'Earthrager Ptah - SAY_DEATH'); -DELETE FROM `spell_script_names` WHERE `spell_id` IN (75540,94974,75519); +DELETE FROM `spell_script_names` WHERE `spell_id` IN (75540,89881,94974,75519); INSERT INTO `spell_script_names` VALUES (75540,'spell_earthrager_ptah_flame_bolt'), (89881,'spell_earthrager_ptah_flame_bolt'), diff --git a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp index 3cb89f75c25..19c27d49a79 100644 --- a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp +++ b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp @@ -18,9 +18,10 @@ #include "ObjectMgr.h" #include "ScriptMgr.h" #include "ScriptedCreature.h" -#include "SpellAuras.h" -#include "halls_of_origination.h" +#include "SpellScript.h" +#include "SpellAuraEffects.h" #include "Player.h" +#include "halls_of_origination.h" enum Texts { @@ -364,4 +365,4 @@ void AddSC_boss_earthrager_ptah() new spell_earthrager_ptah_flame_bolt(); new spell_earthrager_ptah_earth_spike(); new spell_earthrager_ptah_explosion(); -} \ No newline at end of file +} diff --git a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_temple_guardian_anhuur.cpp b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_temple_guardian_anhuur.cpp index 0df55f5f276..d4f9593df03 100644 --- a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_temple_guardian_anhuur.cpp +++ b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_temple_guardian_anhuur.cpp @@ -18,9 +18,11 @@ #include "ObjectMgr.h" #include "ScriptMgr.h" #include "ScriptedCreature.h" -#include "SpellAuras.h" -#include "halls_of_origination.h" +#include "SpellScript.h" +#include "SpellAuraEffects.h" +#include "GridNotifiers.h" #include "Player.h" +#include "halls_of_origination.h" enum Texts { @@ -399,4 +401,4 @@ void AddSC_boss_temple_guardian_anhuur() new spell_anhuur_disable_beacon_beams(); new spell_anhuur_activate_beacons(); new spell_anhuur_divine_reckoning(); -} \ No newline at end of file +} diff --git a/src/server/scripts/Kalimdor/HallsOfOrigination/halls_of_origination.h b/src/server/scripts/Kalimdor/HallsOfOrigination/halls_of_origination.h index 1f11b594353..f1316c5db3c 100644 --- a/src/server/scripts/Kalimdor/HallsOfOrigination/halls_of_origination.h +++ b/src/server/scripts/Kalimdor/HallsOfOrigination/halls_of_origination.h @@ -73,4 +73,4 @@ CreatureAI* GetHallsOfOriginationAI(Creature* creature) return NULL; } -#endif // HALLS_OF_ORIGINATION_H \ No newline at end of file +#endif // HALLS_OF_ORIGINATION_H -- cgit v1.2.3 From 74bcb07adc25cf73c476a2efbf08e9cd70e3af0d Mon Sep 17 00:00:00 2001 From: Northstrider Date: Wed, 26 Dec 2012 03:02:41 +0100 Subject: Core/Unit: Set Holy Power ammount to 3. Holy Power can now be gained by using Crusader Strike. --- src/server/game/Entities/Unit/Unit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 5f163bc33b0..a78ce6be4f0 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -12887,7 +12887,7 @@ int32 Unit::GetCreatePowers(Powers power) const case POWER_ECLIPSE: return 0; case POWER_HOLY_POWER: - return 0; + return 3; case POWER_HEALTH: return 0; default: -- cgit v1.2.3 From 9a11b59ba873addb39c9817317f80d43797bf3d5 Mon Sep 17 00:00:00 2001 From: Subv Date: Tue, 25 Dec 2012 21:49:48 -0500 Subject: Core/Vehicles: Fixed riding vehicles and mind control auras. Actually, fixed everything that allows you to control another unit. --- src/server/game/Entities/Player/Player.cpp | 30 ++++++++++++++++++++++++++++ src/server/game/Entities/Player/Player.h | 7 +------ src/server/game/Handlers/MovementHandler.cpp | 19 ++++-------------- src/server/game/Handlers/VehicleHandler.cpp | 5 ----- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- 5 files changed, 36 insertions(+), 27 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 676304a7ece..e759759e769 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -23598,6 +23598,36 @@ void Player::SetClientControl(Unit* target, uint8 allowMove) SetMover(this); } +void Player::SetMover(Unit* target) +{ + m_mover->m_movedPlayer = NULL; + m_mover = target; + m_mover->m_movedPlayer = this; + + ObjectGuid guid = target->GetGUID(); + + WorldPacket data(SMSG_MOVE_SET_ACTIVE_MOVER, 9); + data.WriteBit(guid[5]); + data.WriteBit(guid[7]); + data.WriteBit(guid[3]); + data.WriteBit(guid[6]); + data.WriteBit(guid[0]); + data.WriteBit(guid[4]); + data.WriteBit(guid[1]); + data.WriteBit(guid[2]); + + data.WriteByteSeq(guid[6]); + data.WriteByteSeq(guid[2]); + data.WriteByteSeq(guid[3]); + data.WriteByteSeq(guid[0]); + data.WriteByteSeq(guid[5]); + data.WriteByteSeq(guid[7]); + data.WriteByteSeq(guid[1]); + data.WriteByteSeq(guid[4]); + + SendDirectMessage(&data); +} + void Player::UpdateZoneDependentAuras(uint32 newZone) { // Some spells applied at enter into zone (with subzones), aura removed in UpdateAreaDependentAuras that called always at zone->area update diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index d74fd372451..c4f4c109e2b 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -2514,12 +2514,7 @@ class Player : public Unit, public GridObject void SetClientControl(Unit* target, uint8 allowMove); - void SetMover(Unit* target) - { - m_mover->m_movedPlayer = NULL; - m_mover = target; - m_mover->m_movedPlayer = this; - } + void SetMover(Unit* target); void SetSeer(WorldObject* target) { m_seer = target; } void SetViewpoint(WorldObject* target, bool apply); diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp index 5adaba3f5ec..b3a5c9fac82 100644 --- a/src/server/game/Handlers/MovementHandler.cpp +++ b/src/server/game/Handlers/MovementHandler.cpp @@ -535,14 +535,8 @@ void WorldSession::HandleMoveNotActiveMover(WorldPacket &recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_MOVE_NOT_ACTIVE_MOVER"); - uint64 old_mover_guid; - recvData.readPackGUID(old_mover_guid); - MovementInfo mi; ReadMovementInfo(recvData, &mi); - - mi.guid = old_mover_guid; - _player->m_movementInfo = mi; } @@ -558,21 +552,16 @@ void WorldSession::HandleMoveKnockBackAck(WorldPacket& recvData) { sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_MOVE_KNOCK_BACK_ACK"); - uint64 guid; - recvData.readPackGUID(guid); - - if (_player->m_mover->GetGUID() != guid) - return; - - recvData.read_skip(); // unk - MovementInfo movementInfo; ReadMovementInfo(recvData, &movementInfo); + if (_player->m_mover->GetGUID() != movementInfo.guid) + return; + _player->m_movementInfo = movementInfo; WorldPacket data(SMSG_MOVE_UPDATE_KNOCK_BACK, 66); - data.appendPackGUID(guid); + data.appendPackGUID(movementInfo.guid); _player->BuildMovementPacket(&data); // knockback specific info diff --git a/src/server/game/Handlers/VehicleHandler.cpp b/src/server/game/Handlers/VehicleHandler.cpp index b9603cc7822..6c1a7607e46 100644 --- a/src/server/game/Handlers/VehicleHandler.cpp +++ b/src/server/game/Handlers/VehicleHandler.cpp @@ -35,12 +35,7 @@ void WorldSession::HandleDismissControlledVehicle(WorldPacket &recvData) return; } - uint64 guid; - - recvData.readPackGUID(guid); - MovementInfo mi; - mi.guid = guid; ReadMovementInfo(recvData, &mi); _player->m_movementInfo = mi; diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 0d7f82fa0b1..79c566e08a5 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -994,7 +994,7 @@ void OpcodeTable::Initialize() DEFINE_OPCODE_HANDLER(SMSG_MOVE_LAND_WALK, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_NORMAL_FALL, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_ROOT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); - DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_ACTIVE_MOVER, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); + DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_ACTIVE_MOVER, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_CAN_FLY, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_CAN_TRANSITION_BETWEEN_SWIM_AND_FLY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); DEFINE_OPCODE_HANDLER(SMSG_MOVE_SET_COLLISION_HEIGHT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide ); -- cgit v1.2.3 From 0622cf8b64b9b77e583ae99baf42c01237ca7fb5 Mon Sep 17 00:00:00 2001 From: huri Date: Wed, 26 Dec 2012 18:03:41 +0100 Subject: Scripts/Spells: Fixed Mage's Improved Flamestrike, Ice Shards, Shatter, Shattered Barrier, Incanter's Absorption, Improved Mana Gem, Improved Freeze --- .../2012_12_26_00_world_spell_script_names_434.sql | 39 ++ src/server/game/Entities/Unit/Unit.cpp | 8 +- src/server/game/Spells/Auras/SpellAuras.cpp | 10 - src/server/scripts/Spells/spell_mage.cpp | 411 +++++++++++++++++---- 4 files changed, 374 insertions(+), 94 deletions(-) create mode 100644 sql/updates/world/2012_12_26_00_world_spell_script_names_434.sql (limited to 'src') diff --git a/sql/updates/world/2012_12_26_00_world_spell_script_names_434.sql b/sql/updates/world/2012_12_26_00_world_spell_script_names_434.sql new file mode 100644 index 00000000000..c1c7a8db271 --- /dev/null +++ b/sql/updates/world/2012_12_26_00_world_spell_script_names_434.sql @@ -0,0 +1,39 @@ +-- Blast Wave +DELETE FROM `spell_script_names` WHERE `spell_id`=11113 OR `ScriptName`='spell_mage_blast_wave'; +INSERT INTO `spell_script_names` VALUES +(11113,'spell_mage_blast_wave'); + +-- Blizzard +DELETE FROM `spell_script_names` WHERE `spell_id`=42208 OR `ScriptName`='spell_mage_blizzard'; +INSERT INTO `spell_script_names` VALUES +(42208,'spell_mage_blizzard'); + +-- Frostbolt +DELETE FROM `spell_script_names` WHERE `spell_id`=116 OR `ScriptName`='spell_mage_frostbolt'; +INSERT INTO `spell_script_names` VALUES +(116,'spell_mage_frostbolt'); + +-- Ice Barrier +DELETE FROM `spell_script_names` WHERE `spell_id`=11426 OR `ScriptName`='spell_mage_ice_barrier'; +INSERT INTO `spell_script_names` VALUES +(11426,'spell_mage_ice_barrier'); + +-- Mana Shield +DELETE FROM `spell_script_names` WHERE `spell_id`=1463 OR `ScriptName`='spell_mage_mana_shield' OR `ScriptName`='spell_mage_incanters_absorbtion_manashield'; +INSERT INTO `spell_script_names` VALUES +(1463,'spell_mage_mana_shield'); + +-- Mage Ward +DELETE FROM `spell_script_names` WHERE `spell_id`=543 OR `ScriptName`='spell_mage_mage_ward' OR `ScriptName`='spell_mage_incanters_absorbtion_absorb'; +INSERT INTO `spell_script_names` VALUES +(543,'spell_mage_mage_ward'); + +-- Replenish Mana (Mana Gem) +DELETE FROM `spell_script_names` WHERE `spell_id`=5405 OR `ScriptName`='spell_mage_replenish_mana'; +INSERT INTO `spell_script_names` VALUES +(5405,'spell_mage_replenish_mana'); + +-- Water Elemental's Freeze +DELETE FROM `spell_script_names` WHERE `spell_id`=33395 OR `ScriptName`='spell_mage_water_elemental_freeze'; +INSERT INTO `spell_script_names` VALUES +(33395,'spell_mage_water_elemental_freeze'); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index a78ce6be4f0..80032533954 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -9750,13 +9750,11 @@ bool Unit::isSpellCrit(Unit* victim, SpellInfo const* spellProto, SpellSchoolMas int32 modChance = 0; switch ((*i)->GetMiscValue()) { - // Shatter - case 911: modChance+= 16; - case 910: modChance+= 17; - case 849: modChance+= 17; + // Shatter + case 911: if (!victim->HasAuraState(AURA_STATE_FROZEN, spellProto, this)) break; - crit_chance+=modChance; + AddPct(crit_chance, (*i)->GetAmount()*20); break; case 7917: // Glyph of Shadowburn if (victim->HasAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, spellProto, this)) diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 190c2fcdb8c..78e4844831a 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -1286,16 +1286,6 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b default: break; } - if (!caster) - break; - // Ice barrier - dispel/absorb remove - if (removeMode == AURA_REMOVE_BY_ENEMY_SPELL && GetSpellInfo()->SpellFamilyFlags[1] & 0x1) - { - // Shattered Barrier - if (AuraEffect * dummy = caster->GetDummyAuraEffect(SPELLFAMILY_MAGE, 3260, 0)) - if (roll_chance_i(dummy->GetSpellInfo()->ProcChance)) - caster->CastSpell(target, 55080, true, NULL, GetEffect(0)); - } break; case SPELLFAMILY_WARLOCK: if (!caster) diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index 78217cfd7cd..354cbcbd4d6 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -40,6 +40,26 @@ enum MageSpells SPELL_MAGE_SUMMON_WATER_ELEMENTAL_TEMPORARY = 70907, SPELL_MAGE_GLYPH_OF_BLAST_WAVE = 62126, SPELL_MAGE_CONJURE_REFRESHMENT = 42955, + SPELL_MAGE_FLAMESTRIKE = 2120, + SPELL_MAGE_CHILLED_R1 = 12484, + SPELL_MAGE_CHILLED_R2 = 12485, + SPELL_MAGE_INCANTER_S_ABSORPTION_TRIGGERED = 44413, + SPELL_MAGE_INCANTER_S_ABSORPTION_KNOCKBACK = 86261, + SPELL_MAGE_IMPROVED_MANA_GEM_TRIGGERED = 83098, + SPELL_MAGE_SHATTERED_BARRIER_R1 = 44745, + SPELL_MAGE_SHATTERED_BARRIER_R2 = 54787, + SPELL_MAGE_SHATTERED_BARRIER_FREEZE_R1 = 55080, + SPELL_MAGE_SHATTERED_BARRIER_FREEZE_R2 = 83073, + SPELL_MAGE_FINGERS_OF_FROST = 44544, +}; + +enum MageIcons +{ + ICON_MAGE_SHATTER = 976, + ICON_MAGE_IMPROVED_FLAMESTRIKE = 37, + ICON_MAGE_IMPROVED_FREEZE = 94, + ICON_MAGE_INCANTER_S_ABSORPTION = 2941, + ICON_MAGE_IMPROVED_MANA_GEM = 1036, }; class spell_mage_blast_wave : public SpellScriptLoader @@ -53,21 +73,40 @@ class spell_mage_blast_wave : public SpellScriptLoader bool Validate(SpellInfo const* /*spellEntry*/) { - if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_GLYPH_OF_BLAST_WAVE)) + if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_FLAMESTRIKE)) return false; return true; } - void HandleKnockBack(SpellEffIndex effIndex) + void CountTargets(std::list& targetList) + { + _targetCount = targetList.size(); + } + + void HandleImprovedFlamestrike() { - if (GetCaster()->HasAura(SPELL_MAGE_GLYPH_OF_BLAST_WAVE)) - PreventHitDefaultEffect(effIndex); + if (_targetCount >= 2) + if (AuraEffect* aurEff = GetCaster()->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_MAGE, ICON_MAGE_IMPROVED_FLAMESTRIKE, EFFECT_0)) + if (roll_chance_i(aurEff->GetAmount())) + { + float x, y, z; + WorldLocation const* loc = GetExplTargetDest(); + if (!loc) + return; + + loc->GetPosition(x, y, z); + GetCaster()->CastSpell(x, y, z, SPELL_MAGE_FLAMESTRIKE, true); + } } void Register() { - OnEffectHitTarget += SpellEffectFn(spell_mage_blast_wave_SpellScript::HandleKnockBack, EFFECT_2, SPELL_EFFECT_KNOCK_BACK); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_mage_blast_wave_SpellScript::CountTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY); + AfterCast += SpellCastFn(spell_mage_blast_wave_SpellScript::HandleImprovedFlamestrike); } + + private: + uint32 _targetCount; }; SpellScript* GetSpellScript() const @@ -272,77 +311,6 @@ class spell_mage_frost_warding_trigger : public SpellScriptLoader } }; -class spell_mage_incanters_absorbtion_base_AuraScript : public AuraScript -{ - public: - enum Spells - { - SPELL_MAGE_INCANTERS_ABSORBTION_TRIGGERED = 44413, - SPELL_MAGE_INCANTERS_ABSORBTION_R1 = 44394, - }; - - bool Validate(SpellInfo const* /*spellEntry*/) - { - return sSpellMgr->GetSpellInfo(SPELL_MAGE_INCANTERS_ABSORBTION_TRIGGERED) - && sSpellMgr->GetSpellInfo(SPELL_MAGE_INCANTERS_ABSORBTION_R1); - } - - void Trigger(AuraEffect* aurEff, DamageInfo & /*dmgInfo*/, uint32 & absorbAmount) - { - Unit* target = GetTarget(); - - if (AuraEffect* talentAurEff = target->GetAuraEffectOfRankedSpell(SPELL_MAGE_INCANTERS_ABSORBTION_R1, EFFECT_0)) - { - int32 bp = CalculatePct(absorbAmount, talentAurEff->GetAmount()); - target->CastCustomSpell(target, SPELL_MAGE_INCANTERS_ABSORBTION_TRIGGERED, &bp, NULL, NULL, true, NULL, aurEff); - } - } -}; - -// Incanter's Absorption -class spell_mage_incanters_absorbtion_absorb : public SpellScriptLoader -{ -public: - spell_mage_incanters_absorbtion_absorb() : SpellScriptLoader("spell_mage_incanters_absorbtion_absorb") { } - - class spell_mage_incanters_absorbtion_absorb_AuraScript : public spell_mage_incanters_absorbtion_base_AuraScript - { - PrepareAuraScript(spell_mage_incanters_absorbtion_absorb_AuraScript); - - void Register() - { - AfterEffectAbsorb += AuraEffectAbsorbFn(spell_mage_incanters_absorbtion_absorb_AuraScript::Trigger, EFFECT_0); - } - }; - - AuraScript* GetAuraScript() const - { - return new spell_mage_incanters_absorbtion_absorb_AuraScript(); - } -}; - -// Incanter's Absorption -class spell_mage_incanters_absorbtion_manashield : public SpellScriptLoader -{ -public: - spell_mage_incanters_absorbtion_manashield() : SpellScriptLoader("spell_mage_incanters_absorbtion_manashield") { } - - class spell_mage_incanters_absorbtion_manashield_AuraScript : public spell_mage_incanters_absorbtion_base_AuraScript - { - PrepareAuraScript(spell_mage_incanters_absorbtion_manashield_AuraScript); - - void Register() - { - AfterEffectManaShield += AuraEffectManaShieldFn(spell_mage_incanters_absorbtion_manashield_AuraScript::Trigger, EFFECT_0); - } - }; - - AuraScript* GetAuraScript() const - { - return new spell_mage_incanters_absorbtion_manashield_AuraScript(); - } -}; - class spell_mage_living_bomb : public SpellScriptLoader { public: @@ -424,6 +392,8 @@ public: } }; +// 42955 Conjure Refreshment +/// Updated 4.3.4 struct ConjureRefreshmentData { uint32 minLevel; @@ -480,7 +450,6 @@ class spell_mage_conjure_refreshment : public SpellScriptLoader } } - void Register() { OnEffectHitTarget += SpellEffectFn(spell_mage_conjure_refreshment_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); @@ -493,6 +462,285 @@ class spell_mage_conjure_refreshment : public SpellScriptLoader } }; +// 42208 Blizzard +/// Updated 4.3.4 +class spell_mage_blizzard : public SpellScriptLoader +{ + public: + spell_mage_blizzard() : SpellScriptLoader("spell_mage_blizzard") { } + + bool Validate(SpellInfo const* /*spellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_CHILLED_R1)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_CHILLED_R2)) + return false; + return true; + } + + class spell_mage_blizzard_SpellScript : public SpellScript + { + PrepareSpellScript(spell_mage_blizzard_SpellScript); + + void AddChillEffect() + { + Unit* caster = GetCaster(); + if (Unit* unitTarget = GetHitUnit()) + { + if (caster->IsScriptOverriden(GetSpellInfo(), 836)) + caster->CastSpell(unitTarget, SPELL_MAGE_CHILLED_R1, true); + else if (caster->IsScriptOverriden(GetSpellInfo(), 988)) + caster->CastSpell(unitTarget, SPELL_MAGE_CHILLED_R2, true); + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_mage_blizzard_SpellScript::AddChillEffect, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); + } + }; + + SpellScript *GetSpellScript() const + { + return new spell_mage_blizzard_SpellScript(); + } +}; + +// 116 Frostbolt +/// Updated 4.3.4 +class spell_mage_frostbolt : public SpellScriptLoader +{ + public: + spell_mage_frostbolt() : SpellScriptLoader("spell_mage_frostbolt") { } + + class spell_mage_frostbolt_SpellScript : public SpellScript + { + PrepareSpellScript(spell_mage_frostbolt_SpellScript); + + void RecalculateDamage() + { + if (GetHitUnit() && GetHitUnit()->HasAuraState(AURA_STATE_FROZEN, GetSpellInfo(), GetCaster())) + { + if (AuraEffect* aurEff = GetCaster()->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_MAGE, ICON_MAGE_SHATTER, EFFECT_1)) + { + int32 damage = GetHitDamage(); + AddPct(damage, aurEff->GetAmount()); + SetHitDamage(damage); + } + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_mage_frostbolt_SpellScript::RecalculateDamage, EFFECT_1, SPELL_EFFECT_SCHOOL_DAMAGE); + } + }; + + SpellScript *GetSpellScript() const + { + return new spell_mage_frostbolt_SpellScript(); + } +}; + +// 11426 Ice Barrier +/// Updated 4.3.4 +class spell_mage_ice_barrier : public SpellScriptLoader +{ + public: + spell_mage_ice_barrier() : SpellScriptLoader("spell_mage_ice_barrier") { } + + class spell_mage_ice_barrier_AuraScript : public AuraScript + { + PrepareAuraScript(spell_mage_ice_barrier_AuraScript); + + void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + { + if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_ENEMY_SPELL) + return; + + if (GetTarget()->HasAura(SPELL_MAGE_SHATTERED_BARRIER_R1)) + GetTarget()->CastSpell(GetTarget(), SPELL_MAGE_SHATTERED_BARRIER_FREEZE_R1, true); + else if (GetTarget()->HasAura(SPELL_MAGE_SHATTERED_BARRIER_R2)) + GetTarget()->CastSpell(GetTarget(), SPELL_MAGE_SHATTERED_BARRIER_FREEZE_R2, true); + } + + void Register() + { + AfterEffectRemove += AuraEffectRemoveFn(spell_mage_ice_barrier_AuraScript::AfterRemove, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_mage_ice_barrier_AuraScript(); + } +}; + +// 1463 Mana Shield +/// Updated 4.3.4 +class spell_mage_mana_shield : public SpellScriptLoader +{ + public: + spell_mage_mana_shield() : SpellScriptLoader("spell_mage_mana_shield") { } + + class spell_mage_mana_shield_AuraScript : public AuraScript + { + PrepareAuraScript(spell_mage_mana_shield_AuraScript); + + void HandleAbsorb(AuraEffect* aurEff, DamageInfo & /*dmgInfo*/, uint32 & absorbAmount) + { + if (AuraEffect* aurEff = GetTarget()->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_GENERIC, ICON_MAGE_INCANTER_S_ABSORPTION, EFFECT_0)) + { + int32 bp = CalculatePct(absorbAmount, aurEff->GetAmount()); + GetTarget()->CastCustomSpell(GetTarget(), SPELL_MAGE_INCANTER_S_ABSORPTION_TRIGGERED, &bp, NULL, NULL, true); + } + } + + void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + { + if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_ENEMY_SPELL) + GetTarget()->CastSpell(GetTarget(), SPELL_MAGE_INCANTER_S_ABSORPTION_KNOCKBACK, true); + } + + void Register() + { + AfterEffectManaShield += AuraEffectManaShieldFn(spell_mage_mana_shield_AuraScript::HandleAbsorb, EFFECT_0); + AfterEffectRemove += AuraEffectRemoveFn(spell_mage_mana_shield_AuraScript::AfterRemove, EFFECT_0, SPELL_AURA_MANA_SHIELD, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_mage_mana_shield_AuraScript(); + } +}; + +// 543 Mage Ward +/// Updated 4.3.4 +class spell_mage_mage_ward : public SpellScriptLoader +{ + public: + spell_mage_mage_ward() : SpellScriptLoader("spell_mage_mage_ward") { } + + class spell_mage_mage_ward_AuraScript : public AuraScript + { + PrepareAuraScript(spell_mage_mage_ward_AuraScript); + + void HandleAbsorb(AuraEffect* aurEff, DamageInfo & /*dmgInfo*/, uint32 & absorbAmount) + { + if (AuraEffect* aurEff = GetTarget()->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_GENERIC, ICON_MAGE_INCANTER_S_ABSORPTION, EFFECT_0)) + { + int32 bp = CalculatePct(absorbAmount, aurEff->GetAmount()); + GetTarget()->CastCustomSpell(GetTarget(), SPELL_MAGE_INCANTER_S_ABSORPTION_TRIGGERED, &bp, NULL, NULL, true); + } + } + + void Register() + { + AfterEffectAbsorb += AuraEffectAbsorbFn(spell_mage_mage_ward_AuraScript::HandleAbsorb, EFFECT_0); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_mage_mage_ward_AuraScript(); + } +}; + +// 5405 Replenish Mana (Mana Gem) +/// Updated 4.3.4 +class spell_mage_replenish_mana : public SpellScriptLoader +{ + public: + spell_mage_replenish_mana() : SpellScriptLoader("spell_mage_replenish_mana") { } + + class spell_mage_replenish_mana_SpellScript : public SpellScript + { + PrepareSpellScript(spell_mage_replenish_mana_SpellScript); + + bool Validate(SpellInfo const* /*spellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_IMPROVED_MANA_GEM_TRIGGERED)) + return false; + return true; + } + + void HandleImprovedManaGem() + { + if (AuraEffect* aurEff = GetCaster()->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_MAGE, ICON_MAGE_IMPROVED_MANA_GEM, EFFECT_0)) + { + int32 bp = CalculatePct(GetCaster()->GetMaxPower(POWER_MANA), aurEff->GetAmount()); + GetCaster()->CastCustomSpell(GetCaster(), SPELL_MAGE_IMPROVED_MANA_GEM_TRIGGERED, &bp, &bp, NULL, true); + } + } + + void Register() + { + AfterCast += SpellCastFn(spell_mage_replenish_mana_SpellScript::HandleImprovedManaGem); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_mage_replenish_mana_SpellScript(); + } +}; + +// 33395 Water Elemental's Freeze +/// Updated 4.3.4 +class spell_mage_water_elemental_freeze : public SpellScriptLoader +{ + public: + spell_mage_water_elemental_freeze() : SpellScriptLoader("spell_mage_water_elemental_freeze") { } + + class spell_mage_water_elemental_freeze_SpellScript : public SpellScript + { + PrepareSpellScript(spell_mage_water_elemental_freeze_SpellScript); + + bool Validate(SpellInfo const* /*spellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_FINGERS_OF_FROST)) + return false; + return true; + } + + void CountTargets(std::list& targetList) + { + _didHit = !targetList.empty(); + } + + void HandleImprovedFreeze() + { + if (!_didHit) + return; + + Unit* owner = GetCaster()->GetOwner(); + if (!owner) + return; + + if (AuraEffect* aurEff = owner->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_MAGE, ICON_MAGE_IMPROVED_FREEZE, EFFECT_0)) + { + if (roll_chance_i(aurEff->GetAmount())) + owner->CastCustomSpell(SPELL_MAGE_FINGERS_OF_FROST, SPELLVALUE_AURA_STACK, 2, owner, true); + } + } + + void Register() + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_mage_water_elemental_freeze_SpellScript::CountTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY); + AfterCast += SpellCastFn(spell_mage_water_elemental_freeze_SpellScript::HandleImprovedFreeze); + } + + private: + bool _didHit; + }; + + SpellScript* GetSpellScript() const + { + return new spell_mage_water_elemental_freeze_SpellScript(); + } +}; + void AddSC_mage_spell_scripts() { new spell_mage_blast_wave(); @@ -500,9 +748,14 @@ void AddSC_mage_spell_scripts() new spell_mage_cone_of_cold(); new spell_mage_conjure_refreshment(); new spell_mage_frost_warding_trigger(); - new spell_mage_incanters_absorbtion_absorb(); - new spell_mage_incanters_absorbtion_manashield(); new spell_mage_polymorph_cast_visual(); new spell_mage_summon_water_elemental(); new spell_mage_living_bomb(); + new spell_mage_blizzard(); + new spell_mage_frostbolt(); + new spell_mage_ice_barrier(); + new spell_mage_mana_shield(); + new spell_mage_mage_ward(); + new spell_mage_replenish_mana(); + new spell_mage_water_elemental_freeze(); } -- cgit v1.2.3 From e873a22a379547c52c0e759ed333f134062164b9 Mon Sep 17 00:00:00 2001 From: Tuxity Date: Wed, 26 Dec 2012 18:30:37 +0100 Subject: Core: fix build and typo after 0622cf8b64b9b77e583ae99baf42c01237ca7fb5 --- src/server/scripts/Spells/spell_mage.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index 354cbcbd4d6..2e6729e591f 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -469,20 +469,20 @@ class spell_mage_blizzard : public SpellScriptLoader public: spell_mage_blizzard() : SpellScriptLoader("spell_mage_blizzard") { } - bool Validate(SpellInfo const* /*spellEntry*/) - { - if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_CHILLED_R1)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_CHILLED_R2)) - return false; - return true; - } - class spell_mage_blizzard_SpellScript : public SpellScript { PrepareSpellScript(spell_mage_blizzard_SpellScript); - void AddChillEffect() + bool Validate(SpellInfo const* /*spellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_CHILLED_R1)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_CHILLED_R2)) + return false; + return true; + } + + void AddChillEffect(SpellEffIndex /*effIndex*/) { Unit* caster = GetCaster(); if (Unit* unitTarget = GetHitUnit()) @@ -517,7 +517,7 @@ class spell_mage_frostbolt : public SpellScriptLoader { PrepareSpellScript(spell_mage_frostbolt_SpellScript); - void RecalculateDamage() + void RecalculateDamage(SpellEffIndex /*effIndex*/) { if (GetHitUnit() && GetHitUnit()->HasAuraState(AURA_STATE_FROZEN, GetSpellInfo(), GetCaster())) { -- cgit v1.2.3 From 05a7b3aaea1b6299cb8af0d4fb51028e56742ffe Mon Sep 17 00:00:00 2001 From: Subv Date: Wed, 26 Dec 2012 12:46:34 -0500 Subject: Scripts/HoO: Implemented the weather effect while on Earthrager Ptah's sandstorm. --- src/server/game/Weather/Weather.h | 1 + .../HallsOfOrigination/boss_earthrager_ptah.cpp | 23 ++++++++++++++++++++++ .../HallsOfOrigination/halls_of_origination.h | 5 +++++ 3 files changed, 29 insertions(+) (limited to 'src') diff --git a/src/server/game/Weather/Weather.h b/src/server/game/Weather/Weather.h index 59bff95d7ea..be3aa1f58a7 100644 --- a/src/server/game/Weather/Weather.h +++ b/src/server/game/Weather/Weather.h @@ -46,6 +46,7 @@ struct WeatherData enum WeatherState { WEATHER_STATE_FINE = 0, + WEATHER_STATE_UNK = 1, // Used in some instance encounters. WEATHER_STATE_LIGHT_RAIN = 3, WEATHER_STATE_MEDIUM_RAIN = 4, WEATHER_STATE_HEAVY_RAIN = 5, diff --git a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp index 19c27d49a79..63ee95cb3de 100644 --- a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp +++ b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp @@ -21,6 +21,7 @@ #include "SpellScript.h" #include "SpellAuraEffects.h" #include "Player.h" +#include "Weather.h" #include "halls_of_origination.h" enum Texts @@ -127,6 +128,26 @@ public: (*itr)->DespawnOrUnsummon(); } + void SendWeather(WeatherState weather, float grade) const + { + WorldPacket data(SMSG_WEATHER, 9); + data << uint32(weather); + data << float(grade); + data << uint8(0); + SendPacketToPlayers(&data); + } + + // Send packet to all players in Tomb of the Earthrager + void SendPacketToPlayers(WorldPacket const* data) const + { + Map::PlayerList const& players = me->GetMap()->GetPlayers(); + if (!players.isEmpty()) + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + if (Player* player = itr->getSource()) + if (player->GetAreaId() == AREA_TOMB_OF_THE_EARTHRAGER) + player->GetSession()->SendPacket(data); + } + void Reset() { _summonDeaths = 0; @@ -148,6 +169,7 @@ public: me->AttackStop(); DoCast(me, SPELL_SANDSTORM); + SendWeather(WEATHER_STATE_LIGHT_SANDSTORM, 1.0f); events.ScheduleEvent(EVENT_PTAH_EXPLODE, 6000, 0, PHASE_DISPERSE); events.ScheduleEvent(EVENT_QUICKSAND, 10000, 0, PHASE_DISPERSE); @@ -179,6 +201,7 @@ public: ++_summonDeaths; if (_summonDeaths == 11) // All summons died { + SendWeather(WEATHER_STATE_UNK, 0.0f); me->RemoveAurasDueToSpell(SPELL_PTAH_EXPLOSION); events.SetPhase(PHASE_NORMAL); events.ScheduleEvent(EVENT_RAGING_SMASH, urand(7000, 12000), 0, PHASE_NORMAL); diff --git a/src/server/scripts/Kalimdor/HallsOfOrigination/halls_of_origination.h b/src/server/scripts/Kalimdor/HallsOfOrigination/halls_of_origination.h index f1316c5db3c..8bdd4a16c9e 100644 --- a/src/server/scripts/Kalimdor/HallsOfOrigination/halls_of_origination.h +++ b/src/server/scripts/Kalimdor/HallsOfOrigination/halls_of_origination.h @@ -63,6 +63,11 @@ enum GameObjects GO_ANHUURS_LEFT_BEACON = 203133, }; +enum AreaIds +{ + AREA_TOMB_OF_THE_EARTHRAGER = 5610, +}; + template CreatureAI* GetHallsOfOriginationAI(Creature* creature) { -- cgit v1.2.3 From 88305adc63ac74958ea28a541d8b84630e928f4e Mon Sep 17 00:00:00 2001 From: Tuxity Date: Wed, 26 Dec 2012 19:03:11 +0100 Subject: Core/Spells: Fix eclipse system. Closes #8567 --- src/server/game/Entities/Unit/Unit.cpp | 2 +- src/server/game/Spells/SpellEffects.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 80032533954..f5c054df823 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -12883,7 +12883,7 @@ int32 Unit::GetCreatePowers(Powers power) const case POWER_SOUL_SHARDS: return 3; case POWER_ECLIPSE: - return 0; + return 100; case POWER_HOLY_POWER: return 3; case POWER_HEALTH: diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 18aae01bf1c..81cf5522db8 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -1745,7 +1745,7 @@ void Spell::EffectEnergize(SpellEffIndex effIndex) if (level_diff > 0) damage -= level_multiplier * level_diff; - if (damage < 0) + if (damage < 0 && power != POWER_ECLIPSE) return; if (unitTarget->GetMaxPower(power) == 0) -- cgit v1.2.3 From b81166651a279586146dedcab3cc09bc7e0dee77 Mon Sep 17 00:00:00 2001 From: Warpten Date: Wed, 26 Dec 2012 22:20:08 +0100 Subject: Core/Battlegrounds: Don't set a remaining time for arenas. --- src/server/game/Battlegrounds/Battleground.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index 16220d17170..a5c92962f57 100644 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -274,7 +274,7 @@ void Battleground::Update(uint32 diff) // after 47 minutes without one team losing, the arena closes with no winner and no rating change if (isArena()) { - if (GetElapsedTime() >= 47*MINUTE*IN_MILLISECONDS) + if (GetElapsedTime() >= 47 * MINUTE*IN_MILLISECONDS) { UpdateArenaWorldState(); CheckArenaAfterTimerConditions(); @@ -466,8 +466,8 @@ inline void Battleground::_ProcessJoin(uint32 diff) // ********************************************************* ModifyStartDelayTime(diff); - // I know it's a too big but it's the value sent in packet, I get it from retail sniff. - SetRemainingTime(300000); + if (!isArena()) + SetRemainingTime(300000); if (m_ResetStatTimer > 5000) { -- cgit v1.2.3 From 33ce380c128412fbc8aa5980474252e7ffb9bb3f Mon Sep 17 00:00:00 2001 From: Naios Date: Thu, 27 Dec 2012 15:40:10 +0100 Subject: Core/DataStores: Upgraded spelldifficulty_dbc db storage to 4.3.4 * Update 2012_12_27_00_world_spelldifficulty_dbc_434.sql is required --- sql/updates/world/2012_12_27_00_world_spelldifficulty_dbc_434.sql | 1 + src/server/game/DataStores/DBCStores.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 sql/updates/world/2012_12_27_00_world_spelldifficulty_dbc_434.sql (limited to 'src') diff --git a/sql/updates/world/2012_12_27_00_world_spelldifficulty_dbc_434.sql b/sql/updates/world/2012_12_27_00_world_spelldifficulty_dbc_434.sql new file mode 100644 index 00000000000..569e6eb7178 --- /dev/null +++ b/sql/updates/world/2012_12_27_00_world_spelldifficulty_dbc_434.sql @@ -0,0 +1 @@ +DELETE FROM `spelldifficulty_dbc` WHERE `id` IN(3000,3001,3002,3003,3004,3005,3006,3007,3008,3009,3010,3011,3012,3013,3014,3015,3016,3017,3018,3019,3020,3021,3022,3023,3024,3025,3026,3027,3028,3029,3030,3031,3032,3033,3034,3035,3036,3037,3038,3039,3040,3041,3042,3043,3044,3045,3046,3047,3049,3050,3051,3052,3053,3054,3062,3064,3065,3066,3067,3068,3069,3070,3071,3072,3096,3097,3098,3099,3100,3101,3102,3103,3104,3105,3106,3108,3109,3111,3112,3113,3114,3115,3116,3117,3118,3120,3121,3122,3123,3124,3125,3126,3127,3128,3129,3130,3131,3133,3137,3138,3139,3140,3141,3142,3143,3144,3145,3146,3147,3148,3149,3150,3151,3152,3153,3154,3155,3156,3157,3158,3159,3160,3161,3162,3163,3164,3165,3166,3167,3168,3169,3170,3171,3172,3173,3174,3175,3176,3177,3178,3179,3180,3181,3182,3183,3184,3185,3186,3187,3188,3189,3190,3191,3192,3193,3194,3200,3201,3202,3203,3204,3205,3206,3240,3241,3242,3243,3244,3245,3246,3247,3248,3249,3250,3251,3252,3253,3254,3255,3256,3257,3258,3259,3260,3261,3262,3263,3264,3265,3266,3267,3268,3269,3270); diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 8a647bacfea..d4b850adc7a 100644 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -514,7 +514,7 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sSpellCategoriesStore, dbcPath,"SpellCategories.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellEffectStore, dbcPath,"SpellEffect.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellCastTimesStore, dbcPath, "SpellCastTimes.dbc");//14545 - LoadDBC(availableDbcLocales, bad_dbc_files, sSpellDifficultyStore, dbcPath, "SpellDifficulty.dbc"/*, &CustomSpellDifficultyfmt, &CustomSpellDifficultyIndex*/);//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sSpellDifficultyStore, dbcPath, "SpellDifficulty.dbc", &CustomSpellDifficultyfmt, &CustomSpellDifficultyIndex);//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellDurationStore, dbcPath, "SpellDuration.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellFocusObjectStore, dbcPath, "SpellFocusObject.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellItemEnchantmentStore, dbcPath, "SpellItemEnchantment.dbc");//14545 -- cgit v1.2.3 From 978611d7ddc301d27c937574cc108f563b7cb73d Mon Sep 17 00:00:00 2001 From: Naios Date: Thu, 27 Dec 2012 15:40:29 +0100 Subject: Core/DataStores: Upgraded achievement_dbc db storage to 4.3.4 --- .../2012_12_27_01_world_achievement_dbc_434.sql | 418 +++++++++++++++++++++ src/server/game/DataStores/DBCStores.cpp | 2 +- src/server/game/DataStores/DBCfmt.h | 4 +- 3 files changed, 421 insertions(+), 3 deletions(-) create mode 100644 sql/updates/world/2012_12_27_01_world_achievement_dbc_434.sql (limited to 'src') diff --git a/sql/updates/world/2012_12_27_01_world_achievement_dbc_434.sql b/sql/updates/world/2012_12_27_01_world_achievement_dbc_434.sql new file mode 100644 index 00000000000..8229f489add --- /dev/null +++ b/sql/updates/world/2012_12_27_01_world_achievement_dbc_434.sql @@ -0,0 +1,418 @@ +TRUNCATE TABLE `achievement_dbc`; +INSERT INTO `achievement_dbc` (`ID`, `flags`, `count`) VALUES +(3376,0x2,1), +(3377,0x2,1), +(3378,0x2,1), +(3379,0x2,1), +(3380,0x2,1), +(3381,0x2,1), +(3382,0x2,1), +(3383,0x2,1), +(3384,0x2,1), +(3385,0x2,1), +(3386,0x2,1), +(3387,0x2,1), +(3388,0x2,1), +(3390,0x2,1), +(3389,0x2,1), +(3391,0x2,1), +(3392,0x2,1), +(3393,0x2,1), +(3394,0x2,1), +(3396,0x2,1), +(3398,0x2,1), +(3395,0x2,1), +(3397,0x2,1), +(3399,0x2,1), +(3400,0x2,1), +(3401,0x2,1), +(3402,0x2,1), +(3403,0x2,1), +(3404,0x2,1), +(3405,0x2,1), +(3406,0x2,1), +(3407,0x2,1), +(3408,0x2,1), +(3409,0x2,1), +(3410,0x2,1), +(3411,0x2,1), +(3696,0x2,1), +(4056,0x2,1), +(4276,0x2,1), +(4277,0x2,1), +(4278,0x2,1), +(4279,0x2,1), +(4280,0x2,1), +(4281,0x2,1), +(4282,0x2,1), +(4283,0x2,1), +(4284,0x2,1), +(4285,0x2,1), +(4057,0x2,1), +(4058,0x2,1), +(4059,0x2,1), +(4060,0x2,1), +(4061,0x2,1), +(4063,0x2,1), +(4062,0x2,1), +(4064,0x2,1), +(4065,0x2,1), +(4066,0x2,1), +(4067,0x2,1), +(4068,0x2,1), +(4070,0x2,1), +(4069,0x2,1), +(4071,0x2,1), +(4072,0x2,1), +(4073,0x2,1), +(4076,0x2,1), +(4077,0x2,1), +(4376,0x2,1), +(4416,0x2,1), +(4417,0x2,1), +(4689,0x2,1), +(4690,0x2,1), +(4691,0x2,1), +(4692,0x2,1), +(4693,0x2,1), +(4694,0x2,1), +(4695,0x2,1), +(4696,0x2,1), +(4697,0x2,1), +(4698,0x2,1), +(4699,0x2,1), +(4700,0x2,1), +(4701,0x2,1), +(4702,0x2,1), +(4703,0x2,1), +(4704,0x2,1), +(4705,0x2,1), +(4706,0x2,1), +(4707,0x2,1), +(4708,0x2,1), +(4709,0x2,1), +(4712,0x2,1), +(4710,0x2,1), +(4711,0x2,1), +(4731,0x2,1), +(4732,0x2,1), +(4733,0x2,1), +(4734,0x2,1), +(4735,0x2,1), +(4736,0x2,1), +(4737,0x2,1), +(4738,0x2,1), +(4739,0x2,1), +(4740,0x2,1), +(4741,0x2,1), +(4742,0x2,1), +(4743,0x2,1), +(4744,0x2,1), +(4745,0x2,1), +(4746,0x2,1), +(4747,0x2,1), +(4748,0x2,1), +(4749,0x2,1), +(4750,0x2,1), +(4751,0x2,1), +(4752,0x2,1), +(4753,0x2,1), +(4754,0x2,1), +(4755,0x2,1), +(4756,0x2,1), +(4757,0x2,1), +(4758,0x2,1), +(4759,0x2,1), +(4760,0x2,1), +(4761,0x2,1), +(4762,0x2,1), +(4763,0x2,1), +(4764,0x2,1), +(4765,0x2,1), +(4766,0x2,1), +(4767,0x2,1), +(4768,0x2,1), +(4769,0x2,1), +(4770,0x2,1), +(4771,0x2,1), +(4772,0x2,1), +(4773,0x2,1), +(4774,0x2,1), +(4775,0x2,1), +(4776,0x2,1), +(4788,0x2,1), +(4789,0x2,1), +(4791,0x2,1), +(4792,0x2,1), +(4793,0x2,1), +(4794,0x2,1), +(4795,0x2,1), +(5544,0x2,1), +(5545,0x2,1), +(5579,0x2,1), +(5580,0x2,1), +(5581,0x2,1), +(5582,0x2,1), +(5583,0x2,1), +(5584,0x2,1), +(5585,0x2,1), +(5586,0x2,1), +(5587,0x2,1), +(5588,0x2,1), +(5589,0x2,1), +(5590,0x2,1), +(5591,0x2,1), +(5593,0x2,1), +(5592,0x2,1), +(5594,0x2,1), +(5595,0x2,1), +(5596,0x2,1), +(5597,0x2,1), +(5598,0x2,1), +(5599,0x2,1), +(5601,0x2,1), +(5600,0x2,1), +(5602,0x2,1), +(5603,0x2,1), +(5604,0x2,1), +(5605,0x2,1), +(5606,0x2,1), +(5607,0x2,1), +(5608,0x2,1), +(5609,0x2,1), +(5610,0x2,1), +(5611,0x2,1), +(5612,0x2,1), +(5613,0x2,1), +(5614,0x2,1), +(5615,0x2,1), +(5616,0x2,1), +(5618,0x2,1), +(5617,0x2,1), +(5619,0x2,1), +(5620,0x2,1), +(5621,0x2,1), +(5622,0x2,1), +(5623,0x2,1), +(5624,0x2,1), +(5625,0x2,1), +(5626,0x2,1), +(5627,0x2,1), +(5629,0x2,1), +(5628,0x2,1), +(5630,0x2,1), +(5651,0x2,1), +(5652,0x2,1), +(5653,0x2,1), +(5654,0x2,1), +(5655,0x2,1), +(5656,0x2,1), +(5657,0x2,1), +(5658,0x2,1), +(5659,0x2,1), +(5660,0x2,1), +(5661,0x2,1), +(5662,0x2,1), +(5663,0x2,1), +(5664,0x2,1), +(5665,0x2,1), +(5666,0x2,1), +(5667,0x2,1), +(5668,0x2,1), +(5669,0x2,1), +(5670,0x2,1), +(5671,0x2,1), +(5672,0x2,1), +(5673,0x2,1), +(5674,0x2,1), +(5675,0x2,1), +(5676,0x2,1), +(5677,0x2,1), +(5678,0x2,1), +(5679,0x2,1), +(5680,0x2,1), +(5681,0x2,1), +(5682,0x2,1), +(5683,0x2,1), +(5684,0x2,1), +(5685,0x2,1), +(5686,0x2,1), +(5687,0x2,1), +(5688,0x2,1), +(5689,0x2,1), +(5690,0x2,1), +(5691,0x2,1), +(5696,0x2,1), +(5697,0x2,1), +(5698,0x2,1), +(5699,0x2,1), +(5700,0x2,1), +(5701,0x2,1), +(5702,0x2,1), +(5703,0x2,1), +(5704,0x2,1), +(5705,0x2,1), +(5706,0x2,1), +(5707,0x2,1), +(5763,0x2,1), +(5775,0x2,1), +(5776,0x2,1), +(5777,0x2,1), +(5778,0x2,1), +(5792,0x2,1), +(5125,0x2,1), +(5825,0x2,1), +(5826,0x2,1), +(5831,0x2,1), +(5832,0x2,1), +(5893,0x2,1), +(5894,0x2,1), +(5895,0x2,1), +(5896,0x2,1), +(5897,0x2,1), +(5898,0x2,1), +(5899,0x2,1), +(5900,0x2,1), +(5909,0x2,1), +(5910,0x2,1), +(5911,0x2,1), +(5912,0x2,1), +(5913,0x2,1), +(5914,0x2,1), +(5915,0x2,1), +(5916,0x2,1), +(5917,0x2,1), +(5918,0x2,1), +(5919,0x2,1), +(5920,0x2,1), +(5921,0x2,1), +(5922,0x2,1), +(5923,0x2,1), +(5924,0x2,1), +(5925,0x2,1), +(5926,0x2,1), +(5927,0x2,1), +(5928,0x2,1), +(5929,0x2,1), +(5930,0x2,1), +(5931,0x2,1), +(5932,0x2,1), +(5933,0x2,1), +(5934,0x2,1), +(5935,0x2,1), +(5936,0x2,1), +(5937,0x2,1), +(5938,0x2,1), +(5939,0x2,1), +(5940,0x2,1), +(5941,0x2,1), +(5942,0x2,1), +(5943,0x2,1), +(5944,0x2,1), +(5945,0x2,1), +(5946,0x2,1), +(5947,0x2,1), +(5948,0x2,1), +(5949,0x2,1), +(5950,0x2,1), +(5951,0x2,1), +(5952,0x2,1), +(5953,0x2,1), +(5954,0x2,1), +(5955,0x2,1), +(5956,0x2,1), +(5957,0x2,1), +(5958,0x2,1), +(5959,0x2,1), +(5960,0x2,1), +(5961,0x2,1), +(5962,0x2,1), +(5963,0x2,1), +(5986,0x2,1), +(5987,0x2,1), +(6186,0x2,1), +(6187,0x2,1), +(6188,0x2,1), +(6189,0x2,1), +(6190,0x2,1), +(6191,0x2,1), +(6192,0x2,1), +(6195,0x2,1), +(6196,0x2,1), +(6197,0x2,1), +(6198,0x2,1), +(6194,0x2,1), +(6199,0x2,1), +(6200,0x2,1), +(6201,0x2,1), +(6202,0x2,1), +(6203,0x2,1), +(6204,0x2,1), +(6205,0x2,1), +(6206,0x2,1), +(6207,0x2,1), +(6208,0x2,1), +(6209,0x2,1), +(6210,0x2,1), +(6211,0x2,1), +(6212,0x2,1), +(6213,0x2,1), +(6214,0x2,1), +(6215,0x2,1), +(6220,0x2,1), +(6216,0x2,1), +(6217,0x2,1), +(6218,0x2,1), +(6219,0x2,1), +(6221,0x2,1), +(6222,0x2,1), +(6223,0x2,1), +(6224,0x2,1), +(6225,0x2,1), +(6226,0x2,1), +(6227,0x2,1), +(6228,0x2,1), +(6229,0x2,1), +(6230,0x2,1), +(6231,0x2,1), +(6232,0x2,1), +(6233,0x2,1), +(6234,0x2,1), +(6235,0x2,1), +(6236,0x2,1), +(6237,0x2,1), +(6238,0x2,1), +(6239,0x2,1), +(6240,0x2,1), +(6243,0x2,1), +(6241,0x2,1), +(6242,0x2,1), +(6244,0x2,1), +(6245,0x2,1), +(6246,0x2,1), +(6247,0x2,1), +(6248,0x2,1), +(6249,0x2,1), +(6250,0x2,1), +(6251,0x2,1), +(6252,0x2,1), +(6253,0x2,1), +(6254,0x2,1), +(6255,0x2,1), +(6256,0x2,1), +(6257,0x2,1), +(6258,0x2,1), +(6259,0x2,1), +(6260,0x2,1), +(6261,0x2,1), +(6262,0x2,1), +(6263,0x2,1), +(6264,0x2,1), +(6265,0x2,1), +(6266,0x2,1), +(6267,0x2,1), +(6268,0x2,1), +(6269,0x2,1), +(6270,0x2,1), +(6271,0x2,1), +(6313,0x2,1); diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index d4b850adc7a..c8f77d45922 100644 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -325,7 +325,7 @@ void LoadDBCStores(const std::string& dataPath) } } - LoadDBC(availableDbcLocales, bad_dbc_files, sAchievementStore, dbcPath, "Achievement.dbc"/*, &CustomAchievementfmt, &CustomAchievementIndex*/);//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sAchievementStore, dbcPath, "Achievement.dbc", &CustomAchievementfmt, &CustomAchievementIndex);//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sAchievementCriteriaStore, dbcPath, "Achievement_Criteria.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sAreaTriggerStore, dbcPath, "AreaTrigger.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sAreaGroupStore, dbcPath, "AreaGroup.dbc");//14545 diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index 23f6798328f..599122d9eee 100644 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -23,8 +23,8 @@ // n - index (included), l - bool, p - field present in sql dbc, a - field absent in sql dbc char const Achievementfmt[]="niixsxiixixxii"; -//const std::string CustomAchievementfmt="pppaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaapapaaaaaaaaaaaaaaaaaapp"; -//const std::string CustomAchievementIndex = "ID"; +const std::string CustomAchievementfmt="pppaaaapapaapp"; +const std::string CustomAchievementIndex = "ID"; char const AchievementCriteriafmt[]="niiiiiiiisiiiiixxiiiiii"; char const AreaTableEntryfmt[]="iiinixxxxxisiiiiifxxxxxxxx"; char const AreaGroupEntryfmt[]="niiiiiii"; -- cgit v1.2.3 From c93559c02da0f949175c932c4b366a09f9b5c113 Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Thu, 27 Dec 2012 19:50:16 +0100 Subject: Core: Fix build --- src/server/scripts/Commands/cs_reload.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'src') diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp index 852bc176040..2e797ad32cd 100644 --- a/src/server/scripts/Commands/cs_reload.cpp +++ b/src/server/scripts/Commands/cs_reload.cpp @@ -1004,9 +1004,6 @@ public: return true; } - return true; - } - static bool HandleReloadSpellScriptsCommand(ChatHandler* handler, const char* args) { if (sScriptMgr->IsScriptScheduled()) -- cgit v1.2.3 From fef25a63745a1dc0fec58adcc64e574a2b223fe9 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 27 Dec 2012 20:21:44 +0100 Subject: Core/Spells: Fixed crash caused by uninitialized target type --- src/server/game/Spells/SpellInfo.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h index b51ed93a86f..a78f17da496 100644 --- a/src/server/game/Spells/SpellInfo.h +++ b/src/server/game/Spells/SpellInfo.h @@ -200,7 +200,7 @@ class SpellImplicitTargetInfo private: Targets _target; public: - SpellImplicitTargetInfo() {} + SpellImplicitTargetInfo() : _target(Targets(0)) {} SpellImplicitTargetInfo(uint32 target); bool IsArea() const; -- cgit v1.2.3 From a2bb50c462d000a40faaadf5ee8045384773716f Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 27 Dec 2012 20:22:22 +0100 Subject: Core/Spells: Removed a few obsolete spell fixes --- src/server/game/Spells/SpellMgr.cpp | 36 +----------------------------------- 1 file changed, 1 insertion(+), 35 deletions(-) (limited to 'src') diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 2f7908078c3..61b5b2805a3 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -3212,16 +3212,9 @@ void SpellMgr::LoadSpellInfoCorrections() case 64904: // Hymn of Hope spellInfo->Effects[EFFECT_1].ApplyAuraName = SPELL_AURA_MOD_INCREASE_ENERGY_PERCENT; break; - case 19465: // Improved Stings (Rank 2) - spellInfo->Effects[EFFECT_2].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER); - break; case 30421: // Nether Portal - Perseverence spellInfo->Effects[2].BasePoints += 30000; break; - case 16834: // Natural shapeshifter - case 16835: - spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(21); - break; case 51735: // Ebon Plague case 51734: case 51726: @@ -3247,10 +3240,6 @@ void SpellMgr::LoadSpellInfoCorrections() spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ALLY); spellInfo->Effects[EFFECT_1].TargetB = SpellImplicitTargetInfo(TARGET_UNIT_SRC_AREA_ALLY); break; - case 57994: // Wind Shear - improper data for EFFECT_1 in 3.3.5 DBC, but is correct in 4.x - spellInfo->Effects[EFFECT_1].Effect = SPELL_EFFECT_MODIFY_THREAT_PERCENT; - spellInfo->Effects[EFFECT_1].BasePoints = -6; // -5% - break; case 63675: // Improved Devouring Plague spellInfo->AttributesEx3 |= SPELL_ATTR3_NO_DONE_BONUS; break; @@ -3258,19 +3247,6 @@ void SpellMgr::LoadSpellInfoCorrections() case 6474: // Earthbind Totem (instant pulse) spellInfo->AttributesEx5 |= SPELL_ATTR5_START_PERIODIC_AT_APPLY; break; - case 52109: // Flametongue Totem rank 1 (Aura) - case 52110: // Flametongue Totem rank 2 (Aura) - case 52111: // Flametongue Totem rank 3 (Aura) - case 52112: // Flametongue Totem rank 4 (Aura) - case 52113: // Flametongue Totem rank 5 (Aura) - case 58651: // Flametongue Totem rank 6 (Aura) - case 58654: // Flametongue Totem rank 7 (Aura) - case 58655: // Flametongue Totem rank 8 (Aura) - spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER); - spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER); - spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(); - spellInfo->Effects[EFFECT_1].TargetB = SpellImplicitTargetInfo(); - break; case 53241: // Marked for Death (Rank 1) case 53243: // Marked for Death (Rank 2) case 53244: // Marked for Death (Rank 3) @@ -3322,16 +3298,6 @@ void SpellMgr::LoadSpellInfoCorrections() case 64936: // Item - Warrior T8 Protection 4P Bonus spellInfo->Effects[0].BasePoints = 100; // 100% chance of procc'ing, not -10% (chance calculated in PrepareTriggersExecutedOnHit) break; - case 19970: // Entangling Roots (Rank 6) -- Nature's Grasp Proc - case 19971: // Entangling Roots (Rank 5) -- Nature's Grasp Proc - case 19972: // Entangling Roots (Rank 4) -- Nature's Grasp Proc - case 19973: // Entangling Roots (Rank 3) -- Nature's Grasp Proc - case 19974: // Entangling Roots (Rank 2) -- Nature's Grasp Proc - case 19975: // Entangling Roots (Rank 1) -- Nature's Grasp Proc - case 27010: // Entangling Roots (Rank 7) -- Nature's Grasp Proc - case 53313: // Entangling Roots (Rank 8) -- Nature's Grasp Proc - spellInfo->CastTimeEntry = sSpellCastTimesStore.LookupEntry(1); - break; case 59414: // Pulsing Shockwave Aura (Loken) // this flag breaks movement, remove it spellInfo->AttributesEx &= ~SPELL_ATTR1_CHANNELED_1; @@ -3698,6 +3664,6 @@ void SpellMgr::LoadSpellInfoCorrections() properties->Type = SUMMON_TYPE_TOTEM; properties = const_cast(sSummonPropertiesStore.LookupEntry(647)); // 52893 properties->Type = SUMMON_TYPE_TOTEM; - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded SpellInfo corrections in %u ms", GetMSTimeDiffToNow(oldMSTime)); } -- cgit v1.2.3 From ed236024e1d4b80cec720c014450d1cd43f3f94e Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 27 Dec 2012 20:22:54 +0100 Subject: Core/ObjectMgr: Fixed loading creature_classlevelstats --- src/server/game/Globals/ObjectMgr.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 13e9425b961..be3331ead4c 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -8442,7 +8442,7 @@ CreatureBaseStats const* ObjectMgr::GetCreatureBaseStats(uint8 level, uint8 unit void ObjectMgr::LoadCreatureClassLevelStats() { uint32 oldMSTime = getMSTime(); - + // 0 1 2 3 4 5 6 7 QueryResult result = WorldDatabase.Query("SELECT level, class, basehp0, basehp1, basehp2, basehp3, basemana, basearmor FROM creature_classlevelstats"); if (!result) @@ -8464,8 +8464,8 @@ void ObjectMgr::LoadCreatureClassLevelStats() for (uint8 i = 0; i < MAX_CREATURE_BASE_HP; ++i) stats.BaseHealth[i] = fields[i + 2].GetUInt32(); - stats.BaseMana = fields[5].GetUInt32(); - stats.BaseArmor = fields[6].GetUInt32(); + stats.BaseMana = fields[6].GetUInt32(); + stats.BaseArmor = fields[7].GetUInt32(); if (!Class || ((1 << (Class - 1)) & CLASSMASK_ALL_CREATURES) == 0) sLog->outError(LOG_FILTER_SQL, "Creature base stats for level %u has invalid class %u", Level, Class); -- cgit v1.2.3 From 9281eb42da936aee2daab039237f0e52732c55fa Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Fri, 28 Dec 2012 19:11:55 +0100 Subject: Core: Fix build --- src/server/scripts/Commands/cs_lookup.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/scripts/Commands/cs_lookup.cpp b/src/server/scripts/Commands/cs_lookup.cpp index c7119ec1fc0..36772164b20 100644 --- a/src/server/scripts/Commands/cs_lookup.cpp +++ b/src/server/scripts/Commands/cs_lookup.cpp @@ -877,7 +877,7 @@ public: if (spellInfo) { int locale = handler->GetSessionDbcLocale(); - std::string name = spellInfo->SpellName[locale]; + std::string name = spellInfo->SpellName; if (name.empty()) { handler->SendSysMessage(LANG_COMMAND_NOSPELLFOUND); -- cgit v1.2.3 From abbbf55931f8038ee0999a3741cf50fb5c550c2f Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Fri, 28 Dec 2012 19:38:01 +0100 Subject: Core/Spell: Removed a obsolete spell fix for cata --- src/server/game/Spells/SpellMgr.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index e49b2891a4e..61b5b2805a3 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -3614,9 +3614,6 @@ void SpellMgr::LoadSpellInfoCorrections() case 40167: // Introspection spellInfo->Attributes |= SPELL_ATTR0_NEGATIVE_1; break; - case 45524: // Chains of Ice - spellInfo->EffectImplicitTargetA[EFFECT_2] = 0; - break; case 2378: // Minor Fortitude spellInfo->ManaCost = 0; spellInfo->ManaPerSecond = 0; -- cgit v1.2.3 From fc9bbe1046c1adcb089d5532f9e5baaa9fb543f1 Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 28 Dec 2012 22:18:19 +0100 Subject: Core/Spells: Implemented SPELL_ATTR9_SPECIAL_DELAY_CALCULATION. Spells using this attribute have missile travel time stored in Speed field (in seconds) instead of speed --- src/server/game/Spells/Spell.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 6a6caed68f0..c7ecae443b8 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -795,7 +795,10 @@ void Spell::SelectSpellTargets() else if (m_spellInfo->Speed > 0.0f) { float dist = m_caster->GetDistance(*m_targets.GetDstPos()); - m_delayMoment = (uint64) floor(dist / m_spellInfo->Speed * 1000.0f); + if (!(m_spellInfo->AttributesEx9 & SPELL_ATTR9_SPECIAL_DELAY_CALCULATION)) + m_delayMoment = uint64(floor(dist / m_spellInfo->Speed * 1000.0f)); + else + m_delayMoment = uint64(m_spellInfo->Speed * 1000.0f); } } } @@ -2162,7 +2165,11 @@ void Spell::AddUnitTarget(Unit* target, uint32 effectMask, bool checkIfValid /*= if (dist < 5.0f) dist = 5.0f; - targetInfo.timeDelay = (uint64) floor(dist / m_spellInfo->Speed * 1000.0f); + + if (!(m_spellInfo->AttributesEx9 & SPELL_ATTR9_SPECIAL_DELAY_CALCULATION)) + targetInfo.timeDelay = uint64(floor(dist / m_spellInfo->Speed * 1000.0f)); + else + targetInfo.timeDelay = uint64(m_spellInfo->Speed * 1000.0f); // Calculate minimum incoming time if (m_delayMoment == 0 || m_delayMoment > targetInfo.timeDelay) @@ -2241,7 +2248,12 @@ void Spell::AddGOTarget(GameObject* go, uint32 effectMask) float dist = m_caster->GetDistance(go->GetPositionX(), go->GetPositionY(), go->GetPositionZ()); if (dist < 5.0f) dist = 5.0f; - target.timeDelay = uint64(floor(dist / m_spellInfo->Speed * 1000.0f)); + + if (!(m_spellInfo->AttributesEx9 & SPELL_ATTR9_SPECIAL_DELAY_CALCULATION)) + target.timeDelay = uint64(floor(dist / m_spellInfo->Speed * 1000.0f)); + else + target.timeDelay = uint64(m_spellInfo->Speed * 1000.0f); + if (m_delayMoment == 0 || m_delayMoment > target.timeDelay) m_delayMoment = target.timeDelay; } -- cgit v1.2.3 From acd6969c95179c625515216e05ca57298837e7a9 Mon Sep 17 00:00:00 2001 From: Tuxity Date: Sat, 29 Dec 2012 11:28:26 +0100 Subject: Core/Arena: Change the place where the enemy unit frame should be set --- src/server/game/Battlegrounds/Battleground.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index d85b521af04..92e89d24a26 100644 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -554,6 +554,9 @@ inline void Battleground::_ProcessJoin(uint32 diff) sBattlegroundMgr->BuildBattlegroundStatusPacket(&status, this, player, queueSlot, STATUS_IN_PROGRESS, player->GetBattlegroundQueueJoinTime(m_TypeID), GetElapsedTime(), GetArenaType()); player->GetSession()->SendPacket(&status); + // Correctly display EnemyUnitFrame + player->SetByteValue(PLAYER_BYTES_3, 3, player->GetBGTeam()); + player->RemoveAurasDueToSpell(SPELL_ARENA_PREPARATION); player->ResetAllPowers(); if (!player->isGameMaster()) @@ -1237,9 +1240,6 @@ void Battleground::AddPlayer(Player* player) player->CastSpell(player, SPELL_ARENA_PREPARATION, true); player->ResetAllPowers(); } - // Correctly display EnemyUnitFrame - player->SetByteValue(PLAYER_BYTES_3, 3, player->GetBGTeam()); - } else { -- cgit v1.2.3 From 6c4e348412fc1bfb15ffedc55043b341e33034b6 Mon Sep 17 00:00:00 2001 From: Tuxity Date: Sat, 29 Dec 2012 11:37:33 +0100 Subject: Core/Arena: - Fix typo with opcode CMSG_ARENA_TEAM_CREATE by @Warpten - Fix honor points gain in UI --- src/server/game/Battlegrounds/BattlegroundMgr.cpp | 6 +++--- src/server/game/Server/Protocol/Opcodes.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index 141cdee531d..514afbf1eb9 100644 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -1103,9 +1103,9 @@ void BattlegroundMgr::BuildBattlegroundListPacket(WorldPacket* data, uint64 guid if (!bracketEntry) return; - uint32 winner_conquest = player->GetRandomWinner() ? BG_REWARD_WINNER_CONQUEST_FIRST : BG_REWARD_WINNER_CONQUEST_LAST; - uint32 winner_honor = player->GetRandomWinner() ? BG_REWARD_WINNER_HONOR_FIRST : BG_REWARD_WINNER_HONOR_LAST; - uint32 loser_honor = !player->GetRandomWinner() ? BG_REWARD_LOSER_HONOR_FIRST : BG_REWARD_LOSER_HONOR_LAST; + uint32 winner_conquest = (player->GetRandomWinner() ? BG_REWARD_WINNER_CONQUEST_FIRST : BG_REWARD_WINNER_CONQUEST_LAST) / CURRENCY_PRECISION; + uint32 winner_honor = (player->GetRandomWinner() ? BG_REWARD_WINNER_HONOR_FIRST : BG_REWARD_WINNER_HONOR_LAST) / CURRENCY_PRECISION; + uint32 loser_honor = (!player->GetRandomWinner() ? BG_REWARD_LOSER_HONOR_FIRST : BG_REWARD_LOSER_HONOR_LAST) / CURRENCY_PRECISION; ObjectGuid guidBytes = guid; diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 3a370333925..46a795f8194 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -70,7 +70,7 @@ void OpcodeTable::Initialize() DEFINE_OPCODE_HANDLER(CMSG_AREA_SPIRIT_HEALER_QUERY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaSpiritHealerQueryOpcode); DEFINE_OPCODE_HANDLER(CMSG_AREA_SPIRIT_HEALER_QUEUE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAreaSpiritHealerQueueOpcode); DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_ACCEPT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamAcceptOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_CREATE, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleArenaTeamCreateOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_CREATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamCreateOpcode ); DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_DECLINE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamDeclineOpcode ); DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_DISBAND, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamDisbandOpcode ); DEFINE_OPCODE_HANDLER(CMSG_ARENA_TEAM_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleArenaTeamInviteOpcode ); -- cgit v1.2.3 From 24eba2359a66e9b897baac6662fb94f7d64ff94e Mon Sep 17 00:00:00 2001 From: Tuxity Date: Sat, 29 Dec 2012 11:48:38 +0100 Subject: Core/Stats: Fix haste display in character panel --- src/server/game/Entities/Unit/Unit.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 86fd8d2f39c..7df33ceb2d8 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -14089,11 +14089,27 @@ void Unit::ApplyAttackTimePercentMod(WeaponAttackType att, float val, bool apply { ApplyPercentModFloatVar(m_modAttackSpeedPct[att], val, !apply); ApplyPercentModFloatValue(UNIT_FIELD_BASEATTACKTIME+att, val, !apply); + + if (GetTypeId() == TYPEID_PLAYER) + { + if (att == BASE_ATTACK) + ApplyPercentModFloatValue(PLAYER_FIELD_MOD_HASTE, val, !apply); + else if (att == RANGED_ATTACK) + ApplyPercentModFloatValue(PLAYER_FIELD_MOD_RANGED_HASTE, val, !apply); + } } else { ApplyPercentModFloatVar(m_modAttackSpeedPct[att], -val, apply); ApplyPercentModFloatValue(UNIT_FIELD_BASEATTACKTIME+att, -val, apply); + + if (GetTypeId() == TYPEID_PLAYER) + { + if (att == BASE_ATTACK) + ApplyPercentModFloatValue(PLAYER_FIELD_MOD_HASTE, -val, apply); + else if (att == RANGED_ATTACK) + ApplyPercentModFloatValue(PLAYER_FIELD_MOD_RANGED_HASTE, -val, apply); + } } m_attackTimer[att] = uint32(GetAttackTime(att) * m_modAttackSpeedPct[att] * remainingTimePct); } @@ -14101,9 +14117,15 @@ void Unit::ApplyAttackTimePercentMod(WeaponAttackType att, float val, bool apply void Unit::ApplyCastTimePercentMod(float val, bool apply) { if (val > 0) + { ApplyPercentModFloatValue(UNIT_MOD_CAST_SPEED, val, !apply); + ApplyPercentModFloatValue(UNIT_MOD_CAST_HASTE, val, !apply); + } else + { ApplyPercentModFloatValue(UNIT_MOD_CAST_SPEED, -val, apply); + ApplyPercentModFloatValue(UNIT_MOD_CAST_HASTE, -val, apply); + } } uint32 Unit::GetCastingTimeForBonus(SpellInfo const* spellProto, DamageEffectType damagetype, uint32 CastingTime) const -- cgit v1.2.3 From 9a9fbb87de5ac67b2004fe3fe0b5e7c4aeab5422 Mon Sep 17 00:00:00 2001 From: Subv Date: Sat, 29 Dec 2012 15:20:57 -0500 Subject: Entities/Movement: Correctly send MSG_MOVE_TELEPORT to the player when it is teleported, send MSG_MOVE_UPDATE_TELEPORT to nearby players when such thing happens. Allow the usage of WriteMovementInfo on non-player units. --- src/server/game/Entities/Unit/Unit.cpp | 595 +++++++++++++++++++++++--- src/server/game/Entities/Unit/Unit.h | 2 + src/server/game/Handlers/MiscHandler.cpp | 2 +- src/server/game/Handlers/MovementHandler.cpp | 499 +-------------------- src/server/game/Handlers/TaxiHandler.cpp | 2 +- src/server/game/Handlers/VehicleHandler.cpp | 2 +- src/server/game/Movement/MovementStructures.h | 85 ++++ src/server/game/Server/Protocol/Opcodes.cpp | 2 +- src/server/game/Server/WorldSession.h | 3 - 9 files changed, 647 insertions(+), 545 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 860bf13ca8a..aeef0a87535 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -59,6 +59,7 @@ #include "Vehicle.h" #include "World.h" #include "WorldPacket.h" +#include "MovementStructures.h" #include "WorldSession.h" #include @@ -16686,71 +16687,563 @@ void Unit::NearTeleportTo(float x, float y, float z, float orientation, bool cas } } -void Unit::SendTeleportPacket(Position& pos) +void Unit::ReadMovementInfo(WorldPacket& data, MovementInfo* mi) { - Position oldPos = {GetPositionX(), GetPositionY(), GetPositionZMinusOffset(), GetOrientation()}; + if (GetTypeId() != TYPEID_PLAYER) + return; - if (GetTypeId() == TYPEID_UNIT) - Relocate(&pos); + bool hasMovementFlags = false; + bool hasMovementFlags2 = false; + bool hasTimestamp = false; + bool hasOrientation = false; + bool hasTransportData = false; + bool hasTransportTime2 = false; + bool hasTransportTime3 = false; + bool hasPitch = false; + bool hasFallData = false; + bool hasFallDirection = false; + bool hasSplineElevation = false; + bool hasSpline = false; + + MovementStatusElements* sequence = GetMovementStatusElementsSequence(data.GetOpcode()); + if (sequence == NULL) + { + sLog->outError(LOG_FILTER_NETWORKIO, "WorldSession::ReadMovementInfo: No movement sequence found for opcode 0x%04X", uint32(data.GetOpcode())); + return; + } - ObjectGuid guid = GetGUID(); - ObjectGuid transGuid = GetTransGUID(); + ObjectGuid guid; + ObjectGuid tguid; - WorldPacket data(MSG_MOVE_TELEPORT, 38); - data.WriteBit(guid[6]); - data.WriteBit(guid[0]); - data.WriteBit(guid[3]); - data.WriteBit(guid[2]); - data.WriteBit(0); // unknown - data.WriteBit(uint64(transGuid)); - data.WriteBit(guid[1]); - if (transGuid) + for (uint32 i = 0; i < MSE_COUNT; ++i) { - data.WriteBit(transGuid[1]); - data.WriteBit(transGuid[3]); - data.WriteBit(transGuid[2]); - data.WriteBit(transGuid[5]); - data.WriteBit(transGuid[0]); - data.WriteBit(transGuid[7]); - data.WriteBit(transGuid[6]); - data.WriteBit(transGuid[4]); + MovementStatusElements element = sequence[i]; + if (element == MSEEnd) + break; + + if (element >= MSEHasGuidByte0 && element <= MSEHasGuidByte7) + { + guid[element - MSEHasGuidByte0] = data.ReadBit(); + continue; + } + + if (element >= MSEHasTransportGuidByte0 && + element <= MSEHasTransportGuidByte7) + { + if (hasTransportData) + tguid[element - MSEHasTransportGuidByte0] = data.ReadBit(); + continue; + } + + if (element >= MSEGuidByte0 && element <= MSEGuidByte7) + { + data.ReadByteSeq(guid[element - MSEGuidByte0]); + continue; + } + + if (element >= MSETransportGuidByte0 && + element <= MSETransportGuidByte7) + { + if (hasTransportData) + data.ReadByteSeq(tguid[element - MSETransportGuidByte0]); + continue; + } + + switch (element) + { + case MSEHasMovementFlags: + hasMovementFlags = !data.ReadBit(); + break; + case MSEHasMovementFlags2: + hasMovementFlags2 = !data.ReadBit(); + break; + case MSEHasTimestamp: + hasTimestamp = !data.ReadBit(); + break; + case MSEHasOrientation: + hasOrientation = !data.ReadBit(); + break; + case MSEHasTransportData: + hasTransportData = data.ReadBit(); + break; + case MSEHasTransportTime2: + if (hasTransportData) + hasTransportTime2 = data.ReadBit(); + break; + case MSEHasTransportTime3: + if (hasTransportData) + hasTransportTime3 = data.ReadBit(); + break; + case MSEHasPitch: + hasPitch = !data.ReadBit(); + break; + case MSEHasFallData: + hasFallData = data.ReadBit(); + break; + case MSEHasFallDirection: + if (hasFallData) + hasFallDirection = data.ReadBit(); + break; + case MSEHasSplineElevation: + hasSplineElevation = !data.ReadBit(); + break; + case MSEHasSpline: + hasSpline = data.ReadBit(); + break; + case MSEMovementFlags: + if (hasMovementFlags) + mi->flags = data.ReadBits(30); + break; + case MSEMovementFlags2: + if (hasMovementFlags2) + mi->flags2 = data.ReadBits(12); + break; + case MSETimestamp: + if (hasTimestamp) + data >> mi->time; + break; + case MSEPositionX: + data >> mi->pos.m_positionX; + break; + case MSEPositionY: + data >> mi->pos.m_positionY; + break; + case MSEPositionZ: + data >> mi->pos.m_positionZ; + break; + case MSEOrientation: + if (hasOrientation) + mi->pos.SetOrientation(data.read()); + break; + case MSETransportPositionX: + if (hasTransportData) + data >> mi->t_pos.m_positionX; + break; + case MSETransportPositionY: + if (hasTransportData) + data >> mi->t_pos.m_positionY; + break; + case MSETransportPositionZ: + if (hasTransportData) + data >> mi->t_pos.m_positionZ; + break; + case MSETransportOrientation: + if (hasTransportData) + mi->pos.SetOrientation(data.read()); + break; + case MSETransportSeat: + if (hasTransportData) + data >> mi->t_seat; + break; + case MSETransportTime: + if (hasTransportData) + data >> mi->t_time; + break; + case MSETransportTime2: + if (hasTransportData && hasTransportTime2) + data >> mi->t_time2; + break; + case MSETransportTime3: + if (hasTransportData && hasTransportTime3) + data >> mi->t_time3; + break; + case MSEPitch: + if (hasPitch) + data >> mi->pitch; + break; + case MSEFallTime: + if (hasFallData) + data >> mi->fallTime; + break; + case MSEFallVerticalSpeed: + if (hasFallData) + data >> mi->j_zspeed; + break; + case MSEFallCosAngle: + if (hasFallData && hasFallDirection) + data >> mi->j_cosAngle; + break; + case MSEFallSinAngle: + if (hasFallData && hasFallDirection) + data >> mi->j_sinAngle; + break; + case MSEFallHorizontalSpeed: + if (hasFallData && hasFallDirection) + data >> mi->j_xyspeed; + break; + case MSESplineElevation: + if (hasSplineElevation) + data >> mi->splineElevation; + break; + case MSEZeroBit: + case MSEOneBit: + data.ReadBit(); + break; + default: + ASSERT(false && "Incorrect sequence element detected at ReadMovementInfo"); + break; + } } - data.WriteBit(guid[4]); - data.WriteBit(guid[7]); - data.WriteBit(guid[5]); - data.FlushBits(); - if (transGuid) + mi->guid = guid; + mi->t_guid = tguid; + + if (hasTransportData && mi->pos.m_positionX != mi->t_pos.m_positionX) + if (GetTransport()) + GetTransport()->UpdatePosition(mi); + + //! Anti-cheat checks. Please keep them in seperate if() blocks to maintain a clear overview. + //! Might be subject to latency, so just remove improper flags. + #ifdef TRINITY_DEBUG + #define REMOVE_VIOLATING_FLAGS(check, maskToRemove) \ + { \ + if (check) \ + { \ + sLog->outDebug(LOG_FILTER_UNITS, "WorldSession::ReadMovementInfo: Violation of MovementFlags found (%s). " \ + "MovementFlags: %u, MovementFlags2: %u for player GUID: %u. Mask %u will be removed.", \ + STRINGIZE(check), mi->GetMovementFlags(), mi->GetExtraMovementFlags(), GetGUIDLow(), maskToRemove); \ + mi->RemoveMovementFlag((maskToRemove)); \ + } \ + } + #else + #define REMOVE_VIOLATING_FLAGS(check, maskToRemove) \ + if (check) \ + mi->RemoveMovementFlag((maskToRemove)); + #endif + + + /*! This must be a packet spoofing attempt. MOVEMENTFLAG_ROOT sent from the client is not valid + in conjunction with any of the moving movement flags such as MOVEMENTFLAG_FORWARD. + It will freeze clients that receive this player's movement info. + */ + REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_ROOT), + MOVEMENTFLAG_ROOT); + + //! Cannot hover without SPELL_AURA_HOVER + REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_HOVER) && !HasAuraType(SPELL_AURA_HOVER), + MOVEMENTFLAG_HOVER); + + //! Cannot ascend and descend at the same time + REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_ASCENDING) && mi->HasMovementFlag(MOVEMENTFLAG_DESCENDING), + MOVEMENTFLAG_ASCENDING | MOVEMENTFLAG_DESCENDING); + + //! Cannot move left and right at the same time + REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_LEFT) && mi->HasMovementFlag(MOVEMENTFLAG_RIGHT), + MOVEMENTFLAG_LEFT | MOVEMENTFLAG_RIGHT); + + //! Cannot strafe left and right at the same time + REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_STRAFE_LEFT) && mi->HasMovementFlag(MOVEMENTFLAG_STRAFE_RIGHT), + MOVEMENTFLAG_STRAFE_LEFT | MOVEMENTFLAG_STRAFE_RIGHT); + + //! Cannot pitch up and down at the same time + REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_PITCH_UP) && mi->HasMovementFlag(MOVEMENTFLAG_PITCH_DOWN), + MOVEMENTFLAG_PITCH_UP | MOVEMENTFLAG_PITCH_DOWN); + + //! Cannot move forwards and backwards at the same time + REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_FORWARD) && mi->HasMovementFlag(MOVEMENTFLAG_BACKWARD), + MOVEMENTFLAG_FORWARD | MOVEMENTFLAG_BACKWARD); + + //! Cannot walk on water without SPELL_AURA_WATER_WALK + REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_WATERWALKING) && !HasAuraType(SPELL_AURA_WATER_WALK), + MOVEMENTFLAG_WATERWALKING); + + //! Cannot feather fall without SPELL_AURA_FEATHER_FALL + REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_FALLING_SLOW) && !HasAuraType(SPELL_AURA_FEATHER_FALL), + MOVEMENTFLAG_FALLING_SLOW); + + /*! Cannot fly if no fly auras present. Exception is being a GM. + Note that we check for account level instead of Player::IsGameMaster() because in some + situations it may be feasable to use .gm fly on as a GM without having .gm on, + e.g. aerial combat. + */ + + REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_FLYING | MOVEMENTFLAG_CAN_FLY) && ToPlayer()->GetSession()->GetSecurity() == SEC_PLAYER && + !ToPlayer()->m_mover->HasAuraType(SPELL_AURA_FLY) && + !ToPlayer()->m_mover->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED), + MOVEMENTFLAG_FLYING | MOVEMENTFLAG_CAN_FLY); + + #undef REMOVE_VIOLATING_FLAGS +} + +void Unit::WriteMovementInfo(WorldPacket& data) +{ + Unit* mover = GetCharmerGUID() ? GetCharmer() : this; + + bool hasMovementFlags = mover->GetUnitMovementFlags() != 0; + bool hasMovementFlags2 = mover->GetExtraUnitMovementFlags() != 0; + bool hasTimestamp = GetTypeId() == TYPEID_PLAYER ? (mover->m_movementInfo.time != 0) : true; + bool hasOrientation = !G3D::fuzzyEq(mover->GetOrientation(), 0.0f); + bool hasTransportData = mover->GetTransport() != NULL; + bool hasTransportTime2 = mover->HasExtraUnitMovementFlag(MOVEMENTFLAG2_INTERPOLATED_MOVEMENT); + bool hasTransportTime3 = false; + bool hasPitch = mover->HasUnitMovementFlag(MovementFlags(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING)) || mover->HasExtraUnitMovementFlag(MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING); + bool hasFallData = mover->HasExtraUnitMovementFlag(MOVEMENTFLAG2_INTERPOLATED_TURNING); + bool hasFallDirection = mover->HasUnitMovementFlag(MOVEMENTFLAG_FALLING); + bool hasSplineElevation = mover->HasUnitMovementFlag(MOVEMENTFLAG_SPLINE_ELEVATION); + bool hasSpline = false; + + MovementStatusElements* sequence = GetMovementStatusElementsSequence(data.GetOpcode()); + if (!sequence) { - data.WriteByteSeq(transGuid[6]); - data.WriteByteSeq(transGuid[5]); - data.WriteByteSeq(transGuid[1]); - data.WriteByteSeq(transGuid[7]); - data.WriteByteSeq(transGuid[0]); - data.WriteByteSeq(transGuid[2]); - data.WriteByteSeq(transGuid[4]); - data.WriteByteSeq(transGuid[3]); + sLog->outError(LOG_FILTER_NETWORKIO, "WorldSession::WriteMovementInfo: No movement sequence found for opcode 0x%04X", uint32(data.GetOpcode())); + return; } - data << uint32(0); // counter - data.WriteByteSeq(guid[1]); - data.WriteByteSeq(guid[2]); - data.WriteByteSeq(guid[3]); - data.WriteByteSeq(guid[5]); - data << float(GetPositionX()); - data.WriteByteSeq(guid[4]); - data << float(GetOrientation()); - data.WriteByteSeq(guid[7]); - data << float(GetPositionZMinusOffset()); - data.WriteByteSeq(guid[0]); - data.WriteByteSeq(guid[6]); - data << float(GetPositionY()); + ObjectGuid guid = mover->GetGUID(); + ObjectGuid tguid = hasTransportData ? GetTransport()->GetGUID() : 0; + + for(uint32 i = 0; i < MSE_COUNT; ++i) + { + MovementStatusElements element = sequence[i]; + if (element == MSEEnd) + break; + + if (element >= MSEHasGuidByte0 && element <= MSEHasGuidByte7) + { + data.WriteBit(guid[element - MSEHasGuidByte0]); + continue; + } + + if (element >= MSEHasTransportGuidByte0 && + element <= MSEHasTransportGuidByte7) + { + if (hasTransportData) + data.WriteBit(tguid[element - MSEHasTransportGuidByte0]); + continue; + } + + if (element >= MSEGuidByte0 && element <= MSEGuidByte7) + { + data.WriteByteSeq(guid[element - MSEGuidByte0]); + continue; + } + + if (element >= MSETransportGuidByte0 && + element <= MSETransportGuidByte7) + { + if (hasTransportData) + data.WriteByteSeq(tguid[element - MSETransportGuidByte0]); + continue; + } + + switch (element) + { + case MSEHasMovementFlags: + data.WriteBit(!hasMovementFlags); + break; + case MSEHasMovementFlags2: + data.WriteBit(!hasMovementFlags2); + break; + case MSEHasTimestamp: + data.WriteBit(!hasTimestamp); + break; + case MSEHasOrientation: + data.WriteBit(!hasOrientation); + break; + case MSEHasTransportData: + data.WriteBit(hasTransportData); + break; + case MSEHasTransportTime2: + if (hasTransportData) + data.WriteBit(hasTransportTime2); + break; + case MSEHasTransportTime3: + if (hasTransportData) + data.WriteBit(hasTransportTime3); + break; + case MSEHasPitch: + data.WriteBit(!hasPitch); + break; + case MSEHasFallData: + data.WriteBit(hasFallData); + break; + case MSEHasFallDirection: + if (hasFallData) + data.WriteBit(hasFallDirection); + break; + case MSEHasSplineElevation: + data.WriteBit(!hasSplineElevation); + break; + case MSEHasSpline: + data.WriteBit(hasSpline); + break; + case MSEMovementFlags: + if (hasMovementFlags) + data.WriteBits(mover->GetUnitMovementFlags(), 30); + break; + case MSEMovementFlags2: + if (hasMovementFlags2) + data.WriteBits(mover->GetExtraUnitMovementFlags(), 12); + break; + case MSETimestamp: + if (hasTimestamp) + data << getMSTime(); + break; + case MSEPositionX: + data << mover->GetPositionX(); + break; + case MSEPositionY: + data << mover->GetPositionY(); + break; + case MSEPositionZ: + data << mover->GetPositionZ(); + break; + case MSEOrientation: + if (hasOrientation) + data << mover->GetOrientation(); + break; + case MSETransportPositionX: + if (hasTransportData) + data << mover->GetTransport()->GetPositionX(); + break; + case MSETransportPositionY: + if (hasTransportData) + data << mover->GetTransport()->GetPositionY(); + break; + case MSETransportPositionZ: + if (hasTransportData) + data << mover->GetTransport()->GetPositionZ(); + break; + case MSETransportOrientation: + if (hasTransportData) + data << mover->GetTransport()->GetOrientation(); + break; + case MSETransportSeat: + if (hasTransportData) + data << mover->GetTransSeat(); + break; + case MSETransportTime: + if (hasTransportData) + data << mover->GetTransTime(); + break; + case MSETransportTime2: + if (hasTransportData && hasTransportTime2) + data << mover->m_movementInfo.t_time2; + break; + case MSETransportTime3: + if (hasTransportData && hasTransportTime3) + data << mover->m_movementInfo.t_time3; + break; + case MSEPitch: + if (hasPitch) + data << mover->m_movementInfo.pitch; + break; + case MSEFallTime: + if (hasFallData) + data << mover->m_movementInfo.fallTime; + break; + case MSEFallVerticalSpeed: + if (hasFallData) + data << mover->m_movementInfo.j_zspeed; + break; + case MSEFallCosAngle: + if (hasFallData && hasFallDirection) + data << mover->m_movementInfo.j_cosAngle; + break; + case MSEFallSinAngle: + if (hasFallData && hasFallDirection) + data << mover->m_movementInfo.j_sinAngle; + break; + case MSEFallHorizontalSpeed: + if (hasFallData && hasFallDirection) + data << mover->m_movementInfo.j_xyspeed; + break; + case MSESplineElevation: + if (hasSplineElevation) + data << mover->m_movementInfo.splineElevation; + break; + case MSEZeroBit: + data.WriteBit(0); + break; + case MSEOneBit: + data.WriteBit(1); + break; + default: + ASSERT(false && "Incorrect sequence element detected at ReadMovementInfo"); + break; + } + } +} + +void Unit::SendTeleportPacket(Position& pos) +{ + // MSG_MOVE_UPDATE_TELEPORT is sent to nearby players to signal the teleport + // MSG_MOVE_TELEPORT is sent to self in order to trigger MSG_MOVE_TELEPORT_ACK and update the position server side + // This oldPos actually contains the destination position if the Unit is a Player. + Position oldPos = {GetPositionX(), GetPositionY(), GetPositionZMinusOffset(), GetOrientation()}; + + if (GetTypeId() == TYPEID_UNIT) + Relocate(&pos); // Relocate the unit to its new position in order to build the packets correctly. + + ObjectGuid guid = GetGUID(); + ObjectGuid transGuid = GetTransGUID(); + + WorldPacket data(MSG_MOVE_UPDATE_TELEPORT, 38); + WriteMovementInfo(data); + + if (GetTypeId() == TYPEID_PLAYER) + { + WorldPacket data2(MSG_MOVE_TELEPORT, 38); + data2.WriteBit(guid[6]); + data2.WriteBit(guid[0]); + data2.WriteBit(guid[3]); + data2.WriteBit(guid[2]); + data2.WriteBit(0); // unknown + data2.WriteBit(uint64(transGuid)); + data2.WriteBit(guid[1]); + if (transGuid) + { + data2.WriteBit(transGuid[1]); + data2.WriteBit(transGuid[3]); + data2.WriteBit(transGuid[2]); + data2.WriteBit(transGuid[5]); + data2.WriteBit(transGuid[0]); + data2.WriteBit(transGuid[7]); + data2.WriteBit(transGuid[6]); + data2.WriteBit(transGuid[4]); + } + data2.WriteBit(guid[4]); + data2.WriteBit(guid[7]); + data2.WriteBit(guid[5]); + data2.FlushBits(); + + if (transGuid) + { + data2.WriteByteSeq(transGuid[6]); + data2.WriteByteSeq(transGuid[5]); + data2.WriteByteSeq(transGuid[1]); + data2.WriteByteSeq(transGuid[7]); + data2.WriteByteSeq(transGuid[0]); + data2.WriteByteSeq(transGuid[2]); + data2.WriteByteSeq(transGuid[4]); + data2.WriteByteSeq(transGuid[3]); + } + + data2 << uint32(0); // counter + data2.WriteByteSeq(guid[1]); + data2.WriteByteSeq(guid[2]); + data2.WriteByteSeq(guid[3]); + data2.WriteByteSeq(guid[5]); + data2 << float(GetPositionX()); + data2.WriteByteSeq(guid[4]); + data2 << float(GetOrientation()); + data2.WriteByteSeq(guid[7]); + data2 << float(GetPositionZMinusOffset()); + data2.WriteByteSeq(guid[0]); + data2.WriteByteSeq(guid[6]); + data2 << float(GetPositionY()); + ToPlayer()->SendDirectMessage(&data2); // Send the MSG_MOVE_TELEPORT packet to self. + } + + // Relocate the player/creature to its old position, so we can broadcast to nearby players correctly if (GetTypeId() == TYPEID_PLAYER) - Relocate(&pos); + Relocate(&pos); else Relocate(&oldPos); - SendMessageToSet(&data, true); + + // Broadcast the packet to everyone except self. + SendMessageToSet(&data, false); } bool Unit::UpdatePosition(float x, float y, float z, float orientation, bool teleport) diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 053876d0532..0dda9db464c 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -2169,6 +2169,8 @@ class Unit : public WorldObject void _EnterVehicle(Vehicle* vehicle, int8 seatId, AuraApplication const* aurApp = NULL); void BuildMovementPacket(ByteBuffer *data) const; + void ReadMovementInfo(WorldPacket& data, MovementInfo* mi); + void WriteMovementInfo(WorldPacket& data); bool isMoving() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_MASK_MOVING); } bool isTurning() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_MASK_TURNING); } diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 2d34727bfbe..29af54f195f 100644 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -1666,7 +1666,7 @@ void WorldSession::HandleMoveSetCanFlyAckOpcode(WorldPacket& recvData) MovementInfo movementInfo; movementInfo.guid = guid; - ReadMovementInfo(recvData, &movementInfo); + _player->ReadMovementInfo(recvData, &movementInfo); recvData.read_skip(); // unk2 diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp index b3a5c9fac82..b1ae0f8dbd5 100644 --- a/src/server/game/Handlers/MovementHandler.cpp +++ b/src/server/game/Handlers/MovementHandler.cpp @@ -30,7 +30,6 @@ #include "WaypointMovementGenerator.h" #include "InstanceSaveMgr.h" #include "ObjectMgr.h" -#include "MovementStructures.h" void WorldSession::HandleMoveWorldportAckOpcode(WorldPacket& /*recvPacket*/) { @@ -276,7 +275,7 @@ void WorldSession::HandleMovementOpcodes(WorldPacket& recvPacket) /* extract packet */ MovementInfo movementInfo; - ReadMovementInfo(recvPacket, &movementInfo); + GetPlayer()->ReadMovementInfo(recvPacket, &movementInfo); // prevent tampered movement data if (movementInfo.guid != mover->GetGUID()) @@ -375,17 +374,16 @@ void WorldSession::HandleMovementOpcodes(WorldPacket& recvPacket) plrMover->SetInWater(!plrMover->IsInWater() || plrMover->GetBaseMap()->IsUnderWater(movementInfo.pos.GetPositionX(), movementInfo.pos.GetPositionY(), movementInfo.pos.GetPositionZ())); } - /*----------------------*/ + movementInfo.time = getMSTime(); + movementInfo.guid = mover->GetGUID(); + mover->m_movementInfo = movementInfo; + /*----------------------*/ /* process position-change */ WorldPacket data(SMSG_PLAYER_MOVE, recvPacket.size()); - movementInfo.time = getMSTime(); - movementInfo.guid = mover->GetGUID(); - WriteMovementInfo(data, &movementInfo); + _player->WriteMovementInfo(data); mover->SendMessageToSet(&data, _player); - mover->m_movementInfo = movementInfo; - // this is almost never true (not sure why it is sometimes, but it is), normally use mover->IsVehicle() if (mover->GetVehicle()) { @@ -446,7 +444,7 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recvData) MovementInfo movementInfo; movementInfo.guid = guid; - ReadMovementInfo(recvData, &movementInfo); + GetPlayer()->ReadMovementInfo(recvData, &movementInfo); recvData >> newspeed; /*----------------*/ @@ -536,7 +534,7 @@ void WorldSession::HandleMoveNotActiveMover(WorldPacket &recvData) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_MOVE_NOT_ACTIVE_MOVER"); MovementInfo mi; - ReadMovementInfo(recvData, &mi); + GetPlayer()->ReadMovementInfo(recvData, &mi); _player->m_movementInfo = mi; } @@ -553,7 +551,7 @@ void WorldSession::HandleMoveKnockBackAck(WorldPacket& recvData) sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_MOVE_KNOCK_BACK_ACK"); MovementInfo movementInfo; - ReadMovementInfo(recvData, &movementInfo); + GetPlayer()->ReadMovementInfo(recvData, &movementInfo); if (_player->m_mover->GetGUID() != movementInfo.guid) return; @@ -583,7 +581,7 @@ void WorldSession::HandleMoveHoverAck(WorldPacket& recvData) recvData.read_skip(); // unk MovementInfo movementInfo; - ReadMovementInfo(recvData, &movementInfo); + GetPlayer()->ReadMovementInfo(recvData, &movementInfo); recvData.read_skip(); // unk2 } @@ -598,7 +596,7 @@ void WorldSession::HandleMoveWaterWalkAck(WorldPacket& recvData) recvData.read_skip(); // unk MovementInfo movementInfo; - ReadMovementInfo(recvData, &movementInfo); + GetPlayer()->ReadMovementInfo(recvData, &movementInfo); recvData.read_skip(); // unk2 } @@ -614,477 +612,4 @@ void WorldSession::HandleSummonResponseOpcode(WorldPacket& recvData) recvData >> agree; _player->SummonIfPossible(agree); -} - -void WorldSession::ReadMovementInfo(WorldPacket& data, MovementInfo* mi) -{ - bool hasMovementFlags = false; - bool hasMovementFlags2 = false; - bool hasTimestamp = false; - bool hasOrientation = false; - bool hasTransportData = false; - bool hasTransportTime2 = false; - bool hasTransportTime3 = false; - bool hasPitch = false; - bool hasFallData = false; - bool hasFallDirection = false; - bool hasSplineElevation = false; - bool hasSpline = false; - - MovementStatusElements* sequence = GetMovementStatusElementsSequence(data.GetOpcode()); - if (sequence == NULL) - { - sLog->outError(LOG_FILTER_NETWORKIO, "WorldSession::ReadMovementInfo: No movement sequence found for opcode 0x%04X", uint32(data.GetOpcode())); - return; - } - - ObjectGuid guid; - ObjectGuid tguid; - - for (uint32 i = 0; i < MSE_COUNT; ++i) - { - MovementStatusElements element = sequence[i]; - if (element == MSEEnd) - break; - - if (element >= MSEHasGuidByte0 && element <= MSEHasGuidByte7) - { - guid[element - MSEHasGuidByte0] = data.ReadBit(); - continue; - } - - if (element >= MSEHasTransportGuidByte0 && - element <= MSEHasTransportGuidByte7) - { - if (hasTransportData) - tguid[element - MSEHasTransportGuidByte0] = data.ReadBit(); - continue; - } - - if (element >= MSEGuidByte0 && element <= MSEGuidByte7) - { - data.ReadByteSeq(guid[element - MSEGuidByte0]); - continue; - } - - if (element >= MSETransportGuidByte0 && - element <= MSETransportGuidByte7) - { - if (hasTransportData) - data.ReadByteSeq(tguid[element - MSETransportGuidByte0]); - continue; - } - - switch (element) - { - case MSEHasMovementFlags: - hasMovementFlags = !data.ReadBit(); - break; - case MSEHasMovementFlags2: - hasMovementFlags2 = !data.ReadBit(); - break; - case MSEHasTimestamp: - hasTimestamp = !data.ReadBit(); - break; - case MSEHasOrientation: - hasOrientation = !data.ReadBit(); - break; - case MSEHasTransportData: - hasTransportData = data.ReadBit(); - break; - case MSEHasTransportTime2: - if (hasTransportData) - hasTransportTime2 = data.ReadBit(); - break; - case MSEHasTransportTime3: - if (hasTransportData) - hasTransportTime3 = data.ReadBit(); - break; - case MSEHasPitch: - hasPitch = !data.ReadBit(); - break; - case MSEHasFallData: - hasFallData = data.ReadBit(); - break; - case MSEHasFallDirection: - if (hasFallData) - hasFallDirection = data.ReadBit(); - break; - case MSEHasSplineElevation: - hasSplineElevation = !data.ReadBit(); - break; - case MSEHasSpline: - hasSpline = data.ReadBit(); - break; - case MSEMovementFlags: - if (hasMovementFlags) - mi->flags = data.ReadBits(30); - break; - case MSEMovementFlags2: - if (hasMovementFlags2) - mi->flags2 = data.ReadBits(12); - break; - case MSETimestamp: - if (hasTimestamp) - data >> mi->time; - break; - case MSEPositionX: - data >> mi->pos.m_positionX; - break; - case MSEPositionY: - data >> mi->pos.m_positionY; - break; - case MSEPositionZ: - data >> mi->pos.m_positionZ; - break; - case MSEOrientation: - if (hasOrientation) - mi->pos.SetOrientation(data.read()); - break; - case MSETransportPositionX: - if (hasTransportData) - data >> mi->t_pos.m_positionX; - break; - case MSETransportPositionY: - if (hasTransportData) - data >> mi->t_pos.m_positionY; - break; - case MSETransportPositionZ: - if (hasTransportData) - data >> mi->t_pos.m_positionZ; - break; - case MSETransportOrientation: - if (hasTransportData) - mi->pos.SetOrientation(data.read()); - break; - case MSETransportSeat: - if (hasTransportData) - data >> mi->t_seat; - break; - case MSETransportTime: - if (hasTransportData) - data >> mi->t_time; - break; - case MSETransportTime2: - if (hasTransportData && hasTransportTime2) - data >> mi->t_time2; - break; - case MSETransportTime3: - if (hasTransportData && hasTransportTime3) - data >> mi->t_time3; - break; - case MSEPitch: - if (hasPitch) - data >> mi->pitch; - break; - case MSEFallTime: - if (hasFallData) - data >> mi->fallTime; - break; - case MSEFallVerticalSpeed: - if (hasFallData) - data >> mi->j_zspeed; - break; - case MSEFallCosAngle: - if (hasFallData && hasFallDirection) - data >> mi->j_cosAngle; - break; - case MSEFallSinAngle: - if (hasFallData && hasFallDirection) - data >> mi->j_sinAngle; - break; - case MSEFallHorizontalSpeed: - if (hasFallData && hasFallDirection) - data >> mi->j_xyspeed; - break; - case MSESplineElevation: - if (hasSplineElevation) - data >> mi->splineElevation; - break; - case MSEZeroBit: - case MSEOneBit: - data.ReadBit(); - break; - default: - ASSERT(false && "Incorrect sequence element detected at ReadMovementInfo"); - break; - } - } - - mi->guid = guid; - mi->t_guid = tguid; - - if (hasTransportData && mi->pos.m_positionX != mi->t_pos.m_positionX) - if (GetPlayer()->GetTransport()) - GetPlayer()->GetTransport()->UpdatePosition(mi); - - //! Anti-cheat checks. Please keep them in seperate if() blocks to maintain a clear overview. - //! Might be subject to latency, so just remove improper flags. - #ifdef TRINITY_DEBUG - #define REMOVE_VIOLATING_FLAGS(check, maskToRemove) \ - { \ - if (check) \ - { \ - sLog->outDebug(LOG_FILTER_UNITS, "WorldSession::ReadMovementInfo: Violation of MovementFlags found (%s). " \ - "MovementFlags: %u, MovementFlags2: %u for player GUID: %u. Mask %u will be removed.", \ - STRINGIZE(check), mi->GetMovementFlags(), mi->GetExtraMovementFlags(), GetPlayer()->GetGUIDLow(), maskToRemove); \ - mi->RemoveMovementFlag((maskToRemove)); \ - } \ - } - #else - #define REMOVE_VIOLATING_FLAGS(check, maskToRemove) \ - if (check) \ - mi->RemoveMovementFlag((maskToRemove)); - #endif - - - /*! This must be a packet spoofing attempt. MOVEMENTFLAG_ROOT sent from the client is not valid - in conjunction with any of the moving movement flags such as MOVEMENTFLAG_FORWARD. - It will freeze clients that receive this player's movement info. - */ - REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_ROOT), - MOVEMENTFLAG_ROOT); - - //! Cannot hover without SPELL_AURA_HOVER - REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_HOVER) && !GetPlayer()->HasAuraType(SPELL_AURA_HOVER), - MOVEMENTFLAG_HOVER); - - //! Cannot ascend and descend at the same time - REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_ASCENDING) && mi->HasMovementFlag(MOVEMENTFLAG_DESCENDING), - MOVEMENTFLAG_ASCENDING | MOVEMENTFLAG_DESCENDING); - - //! Cannot move left and right at the same time - REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_LEFT) && mi->HasMovementFlag(MOVEMENTFLAG_RIGHT), - MOVEMENTFLAG_LEFT | MOVEMENTFLAG_RIGHT); - - //! Cannot strafe left and right at the same time - REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_STRAFE_LEFT) && mi->HasMovementFlag(MOVEMENTFLAG_STRAFE_RIGHT), - MOVEMENTFLAG_STRAFE_LEFT | MOVEMENTFLAG_STRAFE_RIGHT); - - //! Cannot pitch up and down at the same time - REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_PITCH_UP) && mi->HasMovementFlag(MOVEMENTFLAG_PITCH_DOWN), - MOVEMENTFLAG_PITCH_UP | MOVEMENTFLAG_PITCH_DOWN); - - //! Cannot move forwards and backwards at the same time - REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_FORWARD) && mi->HasMovementFlag(MOVEMENTFLAG_BACKWARD), - MOVEMENTFLAG_FORWARD | MOVEMENTFLAG_BACKWARD); - - //! Cannot walk on water without SPELL_AURA_WATER_WALK - REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_WATERWALKING) && !GetPlayer()->HasAuraType(SPELL_AURA_WATER_WALK), - MOVEMENTFLAG_WATERWALKING); - - //! Cannot feather fall without SPELL_AURA_FEATHER_FALL - REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_FALLING_SLOW) && !GetPlayer()->HasAuraType(SPELL_AURA_FEATHER_FALL), - MOVEMENTFLAG_FALLING_SLOW); - - /*! Cannot fly if no fly auras present. Exception is being a GM. - Note that we check for account level instead of Player::IsGameMaster() because in some - situations it may be feasable to use .gm fly on as a GM without having .gm on, - e.g. aerial combat. - */ - - REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_FLYING | MOVEMENTFLAG_CAN_FLY) && GetSecurity() == SEC_PLAYER && - !GetPlayer()->m_mover->HasAuraType(SPELL_AURA_FLY) && - !GetPlayer()->m_mover->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED), - MOVEMENTFLAG_FLYING | MOVEMENTFLAG_CAN_FLY); - - #undef REMOVE_VIOLATING_FLAGS -} - -void WorldSession::WriteMovementInfo(WorldPacket &data, MovementInfo* mi) -{ - bool hasMovementFlags = mi->GetMovementFlags() != 0; - bool hasMovementFlags2 = mi->GetExtraMovementFlags() != 0; - bool hasTimestamp = mi->time != 0; - bool hasOrientation = !G3D::fuzzyEq(mi->pos.GetOrientation(), 0.0f); - bool hasTransportData = mi->t_guid != 0; - bool hasTransportTime2 = mi->HasExtraMovementFlag(MOVEMENTFLAG2_INTERPOLATED_MOVEMENT); - bool hasTransportTime3 = false; - bool hasPitch = mi->HasMovementFlag(MovementFlags(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING)) || mi->HasExtraMovementFlag(MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING); - bool hasFallData = mi->HasExtraMovementFlag(MOVEMENTFLAG2_INTERPOLATED_TURNING); - bool hasFallDirection = mi->HasMovementFlag(MOVEMENTFLAG_FALLING); - bool hasSplineElevation = mi->HasMovementFlag(MOVEMENTFLAG_SPLINE_ELEVATION); - bool hasSpline = false; - - MovementStatusElements* sequence = GetMovementStatusElementsSequence(data.GetOpcode()); - if (!sequence) - { - sLog->outError(LOG_FILTER_NETWORKIO, "WorldSession::WriteMovementInfo: No movement sequence found for opcode 0x%04X", uint32(data.GetOpcode())); - return; - } - - ObjectGuid guid = mi->guid; - ObjectGuid tguid = mi->t_guid; - - for(uint32 i = 0; i < MSE_COUNT; ++i) - { - MovementStatusElements element = sequence[i]; - if (element == MSEEnd) - break; - - if (element >= MSEHasGuidByte0 && element <= MSEHasGuidByte7) - { - data.WriteBit(guid[element - MSEHasGuidByte0]); - continue; - } - - if (element >= MSEHasTransportGuidByte0 && - element <= MSEHasTransportGuidByte7) - { - if (hasTransportData) - data.WriteBit(tguid[element - MSEHasTransportGuidByte0]); - continue; - } - - if (element >= MSEGuidByte0 && element <= MSEGuidByte7) - { - data.WriteByteSeq(guid[element - MSEGuidByte0]); - continue; - } - - if (element >= MSETransportGuidByte0 && - element <= MSETransportGuidByte7) - { - if (hasTransportData) - data.WriteByteSeq(tguid[element - MSETransportGuidByte0]); - continue; - } - - switch (element) - { - case MSEHasMovementFlags: - data.WriteBit(!hasMovementFlags); - break; - case MSEHasMovementFlags2: - data.WriteBit(!hasMovementFlags2); - break; - case MSEHasTimestamp: - data.WriteBit(!hasTimestamp); - break; - case MSEHasOrientation: - data.WriteBit(!hasOrientation); - break; - case MSEHasTransportData: - data.WriteBit(hasTransportData); - break; - case MSEHasTransportTime2: - if (hasTransportData) - data.WriteBit(hasTransportTime2); - break; - case MSEHasTransportTime3: - if (hasTransportData) - data.WriteBit(hasTransportTime3); - break; - case MSEHasPitch: - data.WriteBit(!hasPitch); - break; - case MSEHasFallData: - data.WriteBit(hasFallData); - break; - case MSEHasFallDirection: - if (hasFallData) - data.WriteBit(hasFallDirection); - break; - case MSEHasSplineElevation: - data.WriteBit(!hasSplineElevation); - break; - case MSEHasSpline: - data.WriteBit(hasSpline); - break; - case MSEMovementFlags: - if (hasMovementFlags) - data.WriteBits(mi->flags, 30); - break; - case MSEMovementFlags2: - if (hasMovementFlags2) - data.WriteBits(mi->flags2, 12); - break; - case MSETimestamp: - if (hasTimestamp) - data << mi->time; - break; - case MSEPositionX: - data << mi->pos.m_positionX; - break; - case MSEPositionY: - data << mi->pos.m_positionY; - break; - case MSEPositionZ: - data << mi->pos.m_positionZ; - break; - case MSEOrientation: - if (hasOrientation) - data << mi->pos.GetOrientation(); - break; - case MSETransportPositionX: - if (hasTransportData) - data << mi->t_pos.m_positionX; - break; - case MSETransportPositionY: - if (hasTransportData) - data << mi->t_pos.m_positionY; - break; - case MSETransportPositionZ: - if (hasTransportData) - data << mi->t_pos.m_positionZ; - break; - case MSETransportOrientation: - if (hasTransportData) - data << mi->t_pos.GetOrientation(); - break; - case MSETransportSeat: - if (hasTransportData) - data << mi->t_seat; - break; - case MSETransportTime: - if (hasTransportData) - data << mi->t_time; - break; - case MSETransportTime2: - if (hasTransportData && hasTransportTime2) - data << mi->t_time2; - break; - case MSETransportTime3: - if (hasTransportData && hasTransportTime3) - data << mi->t_time3; - break; - case MSEPitch: - if (hasPitch) - data << mi->pitch; - break; - case MSEFallTime: - if (hasFallData) - data << mi->fallTime; - break; - case MSEFallVerticalSpeed: - if (hasFallData) - data << mi->j_zspeed; - break; - case MSEFallCosAngle: - if (hasFallData && hasFallDirection) - data << mi->j_cosAngle; - break; - case MSEFallSinAngle: - if (hasFallData && hasFallDirection) - data << mi->j_sinAngle; - break; - case MSEFallHorizontalSpeed: - if (hasFallData && hasFallDirection) - data << mi->j_xyspeed; - break; - case MSESplineElevation: - if (hasSplineElevation) - data << mi->splineElevation; - break; - case MSEZeroBit: - data.WriteBit(0); - break; - case MSEOneBit: - data.WriteBit(1); - break; - default: - ASSERT(false && "Incorrect sequence element detected at ReadMovementInfo"); - break; - } - } -} +} \ No newline at end of file diff --git a/src/server/game/Handlers/TaxiHandler.cpp b/src/server/game/Handlers/TaxiHandler.cpp index e86c71bd3e0..ceee74fb3d6 100644 --- a/src/server/game/Handlers/TaxiHandler.cpp +++ b/src/server/game/Handlers/TaxiHandler.cpp @@ -202,7 +202,7 @@ void WorldSession::HandleMoveSplineDoneOpcode(WorldPacket& recvData) recvData.read_skip(); // unk MovementInfo movementInfo; // used only for proper packet read - ReadMovementInfo(recvData, &movementInfo); + _player->ReadMovementInfo(recvData, &movementInfo); // in taxi flight packet received in 2 case: // 1) end taxi path in far (multi-node) flight diff --git a/src/server/game/Handlers/VehicleHandler.cpp b/src/server/game/Handlers/VehicleHandler.cpp index 6c1a7607e46..ad8edff6589 100644 --- a/src/server/game/Handlers/VehicleHandler.cpp +++ b/src/server/game/Handlers/VehicleHandler.cpp @@ -36,7 +36,7 @@ void WorldSession::HandleDismissControlledVehicle(WorldPacket &recvData) } MovementInfo mi; - ReadMovementInfo(recvData, &mi); + _player->ReadMovementInfo(recvData, &mi); _player->m_movementInfo = mi; diff --git a/src/server/game/Movement/MovementStructures.h b/src/server/game/Movement/MovementStructures.h index d2a6e8ea8f6..29b7fb5dfe6 100644 --- a/src/server/game/Movement/MovementStructures.h +++ b/src/server/game/Movement/MovementStructures.h @@ -2094,6 +2094,89 @@ MovementStatusElements DismissControlledVehicle[] = MSEEnd, }; +// 4.3.4 +MovementStatusElements MoveUpdateTeleport[] = +{ + MSEPositionZ, + MSEPositionY, + MSEPositionX, + MSEHasOrientation, + + MSEHasSpline, + MSEHasMovementFlags, + MSEHasGuidByte2, + MSEHasGuidByte4, + MSEHasGuidByte6, + MSEHasFallData, + MSEHasGuidByte0, + MSEHasTransportData, + MSEHasGuidByte5, + + MSEHasTransportGuidByte1, + MSEHasTransportGuidByte4, + MSEHasTransportGuidByte5, + MSEHasTransportGuidByte3, + MSEHasTransportGuidByte0, + MSEHasTransportTime2, + MSEHasTransportGuidByte7, + MSEHasTransportGuidByte6, + MSEHasTransportTime3, + MSEHasTransportGuidByte2, + + MSEZeroBit, + + MSEHasGuidByte7, + MSEHasGuidByte3, + MSEHasPitch, + MSEHasMovementFlags2, + MSEHasTimestamp, + + MSEHasFallDirection, + MSEMovementFlags2, + MSEHasSplineElevation, + MSEMovementFlags, + MSEHasGuidByte1, + + MSEGuidByte7, + MSETransportGuidByte3, + MSETransportGuidByte4, + MSETransportOrientation, + MSETransportTime3, + MSETransportGuidByte1, + MSETransportTime2, + MSETransportPositionZ, + MSETransportGuidByte7, + MSETransportGuidByte0, + MSETransportGuidByte6, + MSETransportGuidByte5, + MSETransportGuidByte2, + MSETransportSeat, + MSETransportTime, + MSETransportPositionY, + MSETransportPositionX, + + MSEGuidByte6, + MSEPitch, + MSESplineElevation, + MSEOrientation, + MSEGuidByte2, + MSEGuidByte3, + MSEGuidByte1, + + MSEFallTime, + MSEFallHorizontalSpeed, + MSEFallSinAngle, + MSEFallCosAngle, + MSEFallVerticalSpeed, + + MSEGuidByte5, + MSEGuidByte4, + MSETimestamp, + MSEGuidByte0, + + MSEEnd, +}; + MovementStatusElements* GetMovementStatusElementsSequence(Opcodes opcode) { switch (opcode) @@ -2152,6 +2235,8 @@ MovementStatusElements* GetMovementStatusElementsSequence(Opcodes opcode) return MoveNotActiveMover; case CMSG_DISMISS_CONTROLLED_VEHICLE: return DismissControlledVehicle; + case MSG_MOVE_UPDATE_TELEPORT: + return MoveUpdateTeleport; default: break; } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 46a795f8194..7a939526cf7 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -597,7 +597,7 @@ void OpcodeTable::Initialize() DEFINE_OPCODE_HANDLER(MSG_MOVE_TOGGLE_COLLISION_CHEAT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_FLIGHT_SPEED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_RUN_SPEED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_TELEPORT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); + DEFINE_OPCODE_HANDLER(MSG_MOVE_UPDATE_TELEPORT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_MOVE_WORLDPORT_ACK, STATUS_TRANSFER, PROCESS_THREADUNSAFE, &WorldSession::HandleMoveWorldportAckOpcode ); DEFINE_OPCODE_HANDLER(MSG_NOTIFY_PARTY_SQUELCH, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(MSG_PARTY_ASSIGNMENT, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandlePartyAssignmentOpcode ); diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index fccb60bf472..60ebb3543af 100644 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -209,9 +209,6 @@ class WorldSession void SendAddonsInfo(); bool IsAddonRegistered(const std::string& prefix) const; - void ReadMovementInfo(WorldPacket& data, MovementInfo* mi); - void WriteMovementInfo(WorldPacket& data, MovementInfo* mi); - void SendPacket(WorldPacket const* packet, bool forced = false); void SendNotification(const char *format, ...) ATTR_PRINTF(2, 3); void SendNotification(uint32 string_id, ...); -- cgit v1.2.3 From 834f98f6bb766524ae0009407dd004a2f41e5b86 Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Sun, 30 Dec 2012 03:01:12 +0100 Subject: Core/ZulGurub: Added script for Bloodlord Mandokir ToDo: Remove hack :P --- .../world/2012_12_30_00_world_zul_gurub.sql | 26 + .../EasternKingdoms/ZulGurub/boss_mandokir.cpp | 698 ++++++++++++++++++++- .../EasternKingdoms/ZulGurub/instance_zulgurub.cpp | 44 +- .../scripts/EasternKingdoms/ZulGurub/zulgurub.h | 76 ++- 4 files changed, 806 insertions(+), 38 deletions(-) create mode 100644 sql/updates/world/2012_12_30_00_world_zul_gurub.sql (limited to 'src') diff --git a/sql/updates/world/2012_12_30_00_world_zul_gurub.sql b/sql/updates/world/2012_12_30_00_world_zul_gurub.sql new file mode 100644 index 00000000000..5b4e31636db --- /dev/null +++ b/sql/updates/world/2012_12_30_00_world_zul_gurub.sql @@ -0,0 +1,26 @@ +UPDATE `creature_template` SET `ScriptName`='npc_chained_spirit' WHERE `entry`=52156; +UPDATE `creature_template` SET `ScriptName`='npc_ohgan' WHERE `entry`=52157; + +DELETE FROM `creature` WHERE `id`=52156; + +DELETE FROM `spell_script_names` WHERE `spell_id` IN (96682,96776,96761,96821,96721,96722,96724,96740,28471); +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(96682,'spell_mandokir_decapitate'), +(96776,'spell_mandokir_bloodletting'), +(96761,'spell_mandokir_devastating_slam'), +(96821,'spell_mandokir_spirit_vengeance_cancel'), +(96721,'spell_mandokir_ohgan_orders'), +(96722,'spell_mandokir_ohgan_orders_trigger'), +(96724,'spell_mandokir_reanimate_ohgan'), +(96740,'spell_mandokir_devastating_slam_damage'), +(28471,'spell_clear_all'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`IN (96724,96721); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(13, 3, 96724, 0, 0, 31, 0, 3, 52157, 0, 0, 0, 0, '', 'Earth Spike - Ohgan'), +(13, 1, 96721, 0, 0, 31, 0, 3, 52156, 0, 0, 0, 0, '', 'Ohgan''s Orders - Chained Spirit'); + +DELETE FROM `achievement_criteria_data` WHERE `criteria_id`=16848; +INSERT INTO `achievement_criteria_data` (`criteria_id`, `type`, `value1`, `value2`, `ScriptName`) VALUES +(16848,11,0,0,'achievement_ohganot_so_fast'), +(16848,12,1,0,''); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp index fde47a2ccb5..8d9ccd7bdfc 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp @@ -1,6 +1,5 @@ /* * Copyright (C) 2008-2012 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 * * 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 @@ -18,26 +17,92 @@ #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "SpellScript.h" +#include "SpellAuraEffects.h" +#include "Player.h" #include "zulgurub.h" enum Yells { - SAY_AGGRO = 0, - SAY_PLAYER_KILL = 1, - SAY_DISMOUNT_OHGAN = 2, - EMOTE_DEVASTATING_SLAM = 3, // ID - 96739 Devastating Slam - SAY_REANIMATE_OHGAN = 4, // ID - 96724 Reanimate Ohgan - EMOTE_FRENZY = 5, // ID - 96800 Frenzy - SAY_FRENZY = 6, // ID - 96800 Frenzy - SAY_DEATH = 7 + SAY_AGGRO = 0, + SAY_PLAYER_KILL = 1, + SAY_DISMOUNT_OHGAN = 2, + EMOTE_DEVASTATING_SLAM = 3, + SAY_REANIMATE_OHGAN = 4, + EMOTE_FRENZY = 5, + SAY_FRENZY = 6, + SAY_DEATH = 7 }; enum Spells { + // Bloodlord Mandokir + SPELL_BLOODLORD_AURA = 96480, + SPELL_SUMMON_OHGAN = 96717, + SPELL_REANIMATE_OHGAN = 96724, + SPELL_DECAPITATE = 96682, + SPELL_BLOODLETTING = 96776, + SPELL_BLOODLETTING_DAMAGE = 96777, + SPELL_BLOODLETTING_HEAL = 96778, + SPELL_FRENZY = 96800, + SPELL_LEVEL_UP = 96662, + SPELL_DEVASTATING_SLAM = 96740, + SPELL_DEVASTATING_SLAM_TRIGGER = 96761, + SPELL_DEVASTATING_SLAM_DAMAGE = 97385, + SPELL_SPIRIT_VENGEANCE_CANCEL = 96821, + + // Chained Spirit + SPELL_REVIVE = 96484, + + // Ohgan + SPELL_OHGAN_HEART_VISUAL = 96727, + SPELL_PERMANENT_FEIGN_DEATH = 96733, + SPELL_CLEAR_ALL = 28471, + SPELL_OHGAN_ORDERS = 96721, + SPELL_OHGAN_ORDERS_TRIGGER = 96722 }; enum Events { + // Bloodlord Mandokir + EVENT_SUMMON_OHGAN = 1, + EVENT_DECAPITATE = 2, + EVENT_BLOODLETTING = 3, + EVENT_REANIMATE_OHGAN = 4, + EVENT_REANIMATE_OHGAN_COOLDOWN = 5, + EVENT_DEVASTATING_SLAM = 6 +}; + +enum Action +{ + // Bloodlord Mandokir + ACTION_OHGAN_IS_DEATH = 1, + ACTION_START_REVIVE = 2, + + // Chained Spirit + ACTION_REVIVE = 1 +}; + +enum Misc +{ + POINT_START_REVIVE = 1, + + DATA_OHGANOT_SO_FAST = 5762, + + FACTION_NONE = 1665 +}; + +// ToDo: Need better respawn support +Position const ChainedSpiritsSpawnPos[8] = +{ + { -12330.34f, -1878.406f, 127.3196f, 3.892084f }, + { -12351.94f, -1861.51f, 127.4807f, 4.677482f }, + { -12326.71f, -1904.328f, 127.4111f, 2.75762f }, + { -12347.41f, -1917.535f, 127.3196f, 1.553343f }, + { -12378.57f, -1861.222f, 127.5416f, 5.340707f }, + { -12397.79f, -1887.731f, 127.5453f, 0.03490658f }, + { -12372.36f, -1918.844f, 127.343f, 1.151917f }, + { -12391.23f, -1905.273f, 127.3196f, 0.6108652f } }; class boss_mandokir : public CreatureScript @@ -52,17 +117,44 @@ class boss_mandokir : public CreatureScript void Reset() { + DoCastAOE(SPELL_SPIRIT_VENGEANCE_CANCEL); + _Reset(); + + for (uint8 i = 0; i < 8; ++i) + me->SummonCreature(NPC_CHAINED_SPIRIT, ChainedSpiritsSpawnPos[i]); + + _ohganotSoFast = true; + _reanimateOhganCooldown = false; + _reviveGUID = 0; } void EnterCombat(Unit* /*who*/) { _EnterCombat(); Talk(SAY_AGGRO); + + DoCastAOE(SPELL_BLOODLORD_AURA); + + if (!summons.empty()) + { + for (std::list::const_iterator itr = summons.begin(); itr != summons.end(); ++itr) + { + if (Creature* chainedSpirit = ObjectAccessor::GetCreature(*me, *itr)) + if (chainedSpirit->GetEntry() == NPC_CHAINED_SPIRIT && chainedSpirit->AI()) + chainedSpirit->setFaction(FACTION_NONE); + } + } + + events.ScheduleEvent(EVENT_DECAPITATE, 10000); + events.ScheduleEvent(EVENT_BLOODLETTING, 15000); + events.ScheduleEvent(EVENT_SUMMON_OHGAN, 20000); + events.ScheduleEvent(EVENT_DEVASTATING_SLAM, 25000); } void JustDied(Unit* /*killer*/) { + DoCastAOE(SPELL_SPIRIT_VENGEANCE_CANCEL); _JustDied(); Talk(SAY_DEATH); } @@ -70,7 +162,70 @@ class boss_mandokir : public CreatureScript void KilledUnit(Unit* victim) { if (victim->GetTypeId() == TYPEID_PLAYER) + { Talk(SAY_PLAYER_KILL); + DoCast(SPELL_LEVEL_UP); + _reviveGUID = victim->GetGUID(); + DoAction(ACTION_START_REVIVE); + } + } + + void DamageTaken(Unit* /*attacker*/, uint32& damage) + { + if (me->HealthBelowPctDamaged(20, damage) && !me->HasAura(SPELL_FRENZY)) + { + DoCast(me, SPELL_FRENZY, true); + Talk(SAY_FRENZY); + Talk(EMOTE_FRENZY); + } + } + + void DoAction(int32 const action) + { + switch (action) + { + case ACTION_OHGAN_IS_DEATH: + events.ScheduleEvent(EVENT_REANIMATE_OHGAN, 4000); + _ohganotSoFast = false; + break; + case ACTION_START_REVIVE: + { + std::list creatures; + GetCreatureListWithEntryInGrid(creatures, me, NPC_CHAINED_SPIRIT, 200.0f); + creatures.remove_if(Trinity::AnyDeadUnitCheck()); + creatures.remove_if(Trinity::UnitAuraCheck(true, SPELL_OHGAN_ORDERS_TRIGGER)); + Trinity::Containers::RandomResizeList(creatures, 1); + if (creatures.empty()) + return; + + for (std::list::iterator itr = creatures.begin(); itr != creatures.end(); ++itr) + { + if (Creature* chainedSpirit = ObjectAccessor::GetCreature(*me, (*itr)->GetGUID())) + { + chainedSpirit->AI()->SetGUID(_reviveGUID); + chainedSpirit->AI()->DoAction(ACTION_REVIVE); + _reviveGUID = 0; + } + } + break; + } + default: + break; + + } + } + + uint32 GetData(uint32 type) const + { + if (type == DATA_OHGANOT_SO_FAST) + return _ohganotSoFast; + + return 0; + } + + void SetGUID(uint64 guid, int32 type/* = 0 */) + { + _reviveGUID = guid; } void UpdateAI(uint32 const diff) @@ -82,19 +237,58 @@ class boss_mandokir : public CreatureScript if (me->HasUnitState(UNIT_STATE_CASTING)) return; - /* + while (uint32 eventId = events.ExecuteEvent()) { switch (eventId) { + case EVENT_SUMMON_OHGAN: + me->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, 0); + DoCast(me, SPELL_SUMMON_OHGAN, true); + break; + case EVENT_DECAPITATE: + DoCastAOE(SPELL_DECAPITATE); + events.ScheduleEvent(EVENT_DECAPITATE, me->HasAura(SPELL_FRENZY) ? 17500 : 35000); + break; + case EVENT_BLOODLETTING: + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true)) + { + DoCast(target, SPELL_BLOODLETTING, true); + me->ClearUnitState(UNIT_STATE_CASTING); + } + events.ScheduleEvent(EVENT_BLOODLETTING, 25000); + break; + case EVENT_REANIMATE_OHGAN: + if (_reanimateOhganCooldown) + events.ScheduleEvent(EVENT_REANIMATE_OHGAN, 1000); + else + { + DoCastAOE(SPELL_REANIMATE_OHGAN); + Talk(SAY_REANIMATE_OHGAN); + // Cooldown + _reanimateOhganCooldown = true; + events.ScheduleEvent(EVENT_REANIMATE_OHGAN_COOLDOWN, 20000); + } + break; + case EVENT_REANIMATE_OHGAN_COOLDOWN: + _reanimateOhganCooldown = false; + break; + case EVENT_DEVASTATING_SLAM: + DoCastAOE(SPELL_DEVASTATING_SLAM_TRIGGER); + events.ScheduleEvent(EVENT_DEVASTATING_SLAM, 30000); + break; default: break; } } - */ DoMeleeAttackIfReady(); } + + private: + bool _ohganotSoFast; + bool _reanimateOhganCooldown; + uint64 _reviveGUID; }; CreatureAI* GetAI(Creature* creature) const @@ -103,7 +297,489 @@ class boss_mandokir : public CreatureScript } }; +class npc_ohgan : public CreatureScript +{ + public: + npc_ohgan() : CreatureScript("npc_ohgan") { } + + struct npc_ohganAI : public ScriptedAI + { + npc_ohganAI(Creature* creature) : ScriptedAI(creature) + { + _instance = me->GetInstanceScript(); + } + + void EnterCombat(Unit* /*who*/) + { + DoCastAOE(SPELL_OHGAN_ORDERS, true); + } + + void DamageTaken(Unit* /*attacker*/, uint32& damage) + { + if (damage >= me->GetHealth()) + { + damage = 0; + me->AttackStop(); + me->SetHealth(0); + me->SetTarget(0); + DoCast(me, SPELL_CLEAR_ALL, true); + DoCast(me, SPELL_PERMANENT_FEIGN_DEATH); + + if (Creature* mandokir = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_MANDOKIR))) + mandokir->AI()->DoAction(ACTION_OHGAN_IS_DEATH); + } + } + + void KilledUnit(Unit* victim) + { + if (Creature* creature = victim->ToCreature()) + { + if (creature->GetEntry() == NPC_CHAINED_SPIRIT) + DoCastAOE(SPELL_OHGAN_ORDERS, true); + } + } + + void UpdateAI(uint32 const diff) + { + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + + private: + InstanceScript* _instance; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return GetZulGurubAI(creature); + } +}; + +class npc_chained_spirit : public CreatureScript +{ + public: + npc_chained_spirit() : CreatureScript("npc_chained_spirit") { } + + struct npc_chained_spiritAI : public ScriptedAI + { + npc_chained_spiritAI(Creature* creature) : ScriptedAI(creature) + { + _instance = me->GetInstanceScript(); + me->AddUnitMovementFlag(MOVEMENTFLAG_HOVER); + me->SetReactState(REACT_PASSIVE); // correct? + } + + void Reset() + { + _revivePlayerGUID = 0; + } + + void SetGUID(uint64 guid, int32 type/* = 0 */) + { + _revivePlayerGUID = guid; + } + + void DoAction(int32 const action) + { + if (action == ACTION_REVIVE) + { + Position pos; + if (Player* target = ObjectAccessor::GetPlayer(*me, _revivePlayerGUID)) + { + target->GetNearPoint(me, pos.m_positionX, pos.m_positionY, pos.m_positionZ, 0.0f, 5.0f, target->GetAngle(me)); + me->GetMotionMaster()->MovePoint(POINT_START_REVIVE, pos); + } + } + } + + void MovementInform(uint32 type, uint32 pointId) + { + if (type != POINT_MOTION_TYPE || !_revivePlayerGUID) + return; + + if (pointId == POINT_START_REVIVE) + { + if (Player* target = ObjectAccessor::GetPlayer(*me, _revivePlayerGUID)) + DoCast(target, SPELL_REVIVE); + + me->DespawnOrUnsummon(2000); + } + } + + void JustDied(Unit* /*killer*/) + { + Player* target = ObjectAccessor::GetPlayer(*me, _revivePlayerGUID); + if (!target || target->isAlive()) + return; + + if (Creature* mandokir = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_MANDOKIR))) + { + mandokir->GetAI()->SetGUID(target->GetGUID()); + mandokir->GetAI()->DoAction(ACTION_START_REVIVE); + } + + me->DespawnOrUnsummon(); + } + + void UpdateAI(uint32 const /*diff*/) { } + + private: + InstanceScript* _instance; + uint64 _revivePlayerGUID; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return GetZulGurubAI(creature); + } +}; + +class spell_mandokir_decapitate : public SpellScriptLoader +{ + public: + spell_mandokir_decapitate() : SpellScriptLoader("spell_mandokir_decapitate") { } + + class spell_mandokir_decapitate_SpellScript : public SpellScript + { + PrepareSpellScript(spell_mandokir_decapitate_SpellScript); + + void FilterTargets(std::list& targets) + { + if (targets.empty()) + return; + + WorldObject* target = Trinity::Containers::SelectRandomContainerElement(targets); + targets.clear(); + targets.push_back(target); + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + if (Player* target = GetHitPlayer()) + caster->CastSpell(target, uint32(GetEffectValue()), true); + } + + void Register() + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_mandokir_decapitate_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnEffectHitTarget += SpellEffectFn(spell_mandokir_decapitate_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_mandokir_decapitate_SpellScript(); + } +}; + +class spell_mandokir_bloodletting : public SpellScriptLoader +{ + public: + spell_mandokir_bloodletting() : SpellScriptLoader("spell_mandokir_bloodletting") { } + + class spell_mandokir_bloodletting_AuraScript : public AuraScript + { + PrepareAuraScript(spell_mandokir_bloodletting_AuraScript); + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_BLOODLETTING_DAMAGE)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_BLOODLETTING_HEAL)) + return false; + return true; + } + + void HandleEffectPeriodic(AuraEffect const* aurEff) + { + Unit* target = GetTarget(); + Unit* caster = GetCaster(); + if (!caster) + return; + + int32 damage = std::max(7500, target->CountPctFromCurHealth(aurEff->GetAmount())); + + caster->CastCustomSpell(target, SPELL_BLOODLETTING_DAMAGE, &damage, 0, 0, true); + target->CastCustomSpell(caster, SPELL_BLOODLETTING_HEAL, &damage, 0, 0, true); + } + + void Register() + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_mandokir_bloodletting_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_mandokir_bloodletting_AuraScript(); + } +}; + +class spell_mandokir_spirit_vengeance_cancel : public SpellScriptLoader +{ + public: + spell_mandokir_spirit_vengeance_cancel() : SpellScriptLoader("spell_mandokir_spirit_vengeance_cancel") { } + + class spell_mandokir_spirit_vengeance_cancel_SpellScript : public SpellScript + { + PrepareSpellScript(spell_mandokir_spirit_vengeance_cancel_SpellScript); + + void HandleScript(SpellEffIndex /*effIndex*/) + { + if (Player* target = GetHitPlayer()) + target->RemoveAura(uint32(GetEffectValue())); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_mandokir_spirit_vengeance_cancel_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + OnEffectHitTarget += SpellEffectFn(spell_mandokir_spirit_vengeance_cancel_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_mandokir_spirit_vengeance_cancel_SpellScript(); + } +}; + +class DevastatingSlamTargetSelector : public std::unary_function +{ + public: + DevastatingSlamTargetSelector(Creature* me, const Unit* victim) : _me(me), _victim(victim) {} + + bool operator() (WorldObject* target) + { + if (target == _victim && _me->getThreatManager().getThreatList().size() > 1) + return true; + + if (target->GetTypeId() != TYPEID_PLAYER) + return true; + + return false; + } + + Creature* _me; + Unit const* _victim; +}; + +class spell_mandokir_devastating_slam : public SpellScriptLoader +{ + public: + spell_mandokir_devastating_slam() : SpellScriptLoader("spell_mandokir_devastating_slam") { } + + class spell_mandokir_devastating_slam_SpellScript : public SpellScript + { + PrepareSpellScript(spell_mandokir_devastating_slam_SpellScript); + + void FilterTargets(std::list& targets) + { + targets.remove_if(DevastatingSlamTargetSelector(GetCaster()->ToCreature(), GetCaster()->getVictim())); + if (targets.empty()) + return; + + WorldObject* target = Trinity::Containers::SelectRandomContainerElement(targets); + targets.clear(); + targets.push_back(target); + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + float angle = 0.0f; + float x, y, z; + + if (Player* target = GetHitPlayer()) + { + caster->AttackStop(); + caster->SetOrientation(caster->GetAngle(target)); + caster->SetFacingTo(caster->GetAngle(target)); + + caster->CastSpell(caster, SPELL_DEVASTATING_SLAM, false); + + // HACK: Need better way for pos calculation + for (uint8 i = 0; i <= 50; ++i) + { + angle = float(rand_norm()) * static_cast(M_PI * 35.0f / 180.0f) - static_cast(M_PI * 17.5f / 180.0f); + caster->GetClosePoint(x, y, z, 4.0f, frand(-2.5f, 50.0f), angle); + + caster->CastSpell(x, y, z, SPELL_DEVASTATING_SLAM_DAMAGE, true); + } + } + } + + void Register() + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_mandokir_devastating_slam_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + OnEffectHitTarget += SpellEffectFn(spell_mandokir_devastating_slam_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_FORCE_CAST); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_mandokir_devastating_slam_SpellScript(); + } +}; + +class spell_mandokir_ohgan_orders : public SpellScriptLoader +{ + public: + spell_mandokir_ohgan_orders() : SpellScriptLoader("spell_mandokir_ohgan_orders") { } + + class spell_mandokir_ohgan_orders_SpellScript : public SpellScript + { + PrepareSpellScript(spell_mandokir_ohgan_orders_SpellScript); + + void FilterTargets(std::list& targets) + { + if (targets.empty()) + return; + + WorldObject* target = Trinity::Containers::SelectRandomContainerElement(targets); + targets.clear(); + targets.push_back(target); + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + if (Unit* target = GetHitUnit()) + caster->CastSpell(target, uint32(GetEffectValue()), true); + } + + void Register() + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_mandokir_ohgan_orders_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY); + OnEffectHitTarget += SpellEffectFn(spell_mandokir_ohgan_orders_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_mandokir_ohgan_orders_SpellScript(); + } +}; + +class spell_mandokir_ohgan_orders_trigger : public SpellScriptLoader +{ + public: + spell_mandokir_ohgan_orders_trigger() : SpellScriptLoader("spell_mandokir_ohgan_orders_trigger") { } + + class spell_mandokir_ohgan_orders_trigger_AuraScript : public AuraScript + { + PrepareAuraScript(spell_mandokir_ohgan_orders_trigger_AuraScript); + + void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + if (Unit* caster = GetCaster()) + { + // HACK: research better way + caster->ClearUnitState(UNIT_STATE_CASTING); + caster->GetMotionMaster()->Clear(); + caster->DeleteThreatList(); + caster->AddThreat(target, 50000000.0f); + caster->TauntApply(target); + } + } + + void Register() + { + AfterEffectApply += AuraEffectApplyFn(spell_mandokir_ohgan_orders_trigger_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_mandokir_ohgan_orders_trigger_AuraScript(); + } +}; + +class spell_mandokir_reanimate_ohgan : public SpellScriptLoader +{ + public: + spell_mandokir_reanimate_ohgan() : SpellScriptLoader("spell_mandokir_reanimate_ohgan") { } + + class spell_mandokir_reanimate_ohgan_SpellScript : public SpellScript + { + PrepareSpellScript(spell_mandokir_reanimate_ohgan_SpellScript); + + void HandleScript(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + if (Unit* target = GetHitUnit()) + { + target->RemoveAura(SPELL_PERMANENT_FEIGN_DEATH); + target->CastSpell(target, SPELL_OHGAN_HEART_VISUAL, true); + target->CastSpell((Unit*)NULL, SPELL_OHGAN_ORDERS, true); + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_mandokir_reanimate_ohgan_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_mandokir_reanimate_ohgan_SpellScript(); + } +}; + +class spell_clear_all : public SpellScriptLoader +{ + public: + spell_clear_all() : SpellScriptLoader("spell_clear_all") { } + + class spell_clear_all_SpellScript : public SpellScript + { + PrepareSpellScript(spell_clear_all_SpellScript); + + void HandleScript(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + caster->RemoveAllAurasOnDeath(); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_clear_all_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_clear_all_SpellScript(); + } +}; + +class achievement_ohganot_so_fast : public AchievementCriteriaScript +{ + public: + achievement_ohganot_so_fast() : AchievementCriteriaScript("achievement_ohganot_so_fast") { } + + bool OnCheck(Player* /*player*/, Unit* target) + { + return target && target->GetAI()->GetData(DATA_OHGANOT_SO_FAST); + } +}; + void AddSC_boss_mandokir() { new boss_mandokir(); + new npc_ohgan(); + new npc_chained_spirit(); + new spell_mandokir_decapitate(); + new spell_mandokir_bloodletting(); + new spell_mandokir_spirit_vengeance_cancel(); + new spell_mandokir_devastating_slam(); + new spell_mandokir_ohgan_orders(); + new spell_mandokir_ohgan_orders_trigger(); + new spell_mandokir_reanimate_ohgan(); + new spell_clear_all(); + new achievement_ohganot_so_fast(); } diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp index 953d9f392bd..f1c1444be8c 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp @@ -1,6 +1,5 @@ /* * Copyright (C) 2008-2012 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 * * 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 @@ -20,6 +19,16 @@ #include "InstanceScript.h" #include "zulgurub.h" +DoorData const doorData[] = +{ + { GO_VENOXIS_COIL, DATA_VENOXIS, DOOR_TYPE_ROOM, BOUNDARY_NONE }, + { GO_ARENA_DOOR_1, DATA_MANDOKIR, DOOR_TYPE_ROOM, BOUNDARY_NONE }, + { GO_FORCEFIELD, DATA_KILNARA, DOOR_TYPE_ROOM, BOUNDARY_NONE }, + { GO_ZANZIL_DOOR, DATA_ZANZIL, DOOR_TYPE_ROOM, BOUNDARY_NONE }, + //{ GO_THE_CACHE_OF_MADNESS_DOOR, DATA_xxxxxxx, DOOR_TYPE_ROOM, BOUNDARY_NONE }, + { 0, 0, DOOR_TYPE_ROOM, BOUNDARY_NONE } +}; + class instance_zulgurub : public InstanceMapScript { public: @@ -30,6 +39,7 @@ class instance_zulgurub : public InstanceMapScript instance_zulgurub_InstanceMapScript(Map* map) : InstanceScript(map) { SetBossNumber(EncounterCount); + LoadDoorData(doorData); venoxisGUID = 0; mandokirGUID = 0; kilnaraGUID = 0; @@ -81,6 +91,38 @@ class instance_zulgurub : public InstanceMapScript } } + void OnGameObjectCreate(GameObject* go) + { + switch (go->GetEntry()) + { + case GO_VENOXIS_COIL: + case GO_ARENA_DOOR_1: + case GO_FORCEFIELD: + case GO_ZANZIL_DOOR: + case GO_THE_CACHE_OF_MADNESS_DOOR: + AddDoor(go, true); + break; + default: + break; + } + } + + void OnGameObjectRemove(GameObject* go) + { + switch (go->GetEntry()) + { + case GO_VENOXIS_COIL: + case GO_ARENA_DOOR_1: + case GO_FORCEFIELD: + case GO_ZANZIL_DOOR: + case GO_THE_CACHE_OF_MADNESS_DOOR: + AddDoor(go, false); + break; + default: + break; + } + } + bool SetBossState(uint32 type, EncounterState state) { if (!InstanceScript::SetBossState(type, state)) diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h b/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h index cdf4724dc35..e4d2d2e3902 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h +++ b/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h @@ -1,6 +1,5 @@ /* * Copyright (C) 2008-2012 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 * * 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 @@ -25,40 +24,66 @@ uint32 const EncounterCount = 5; enum DataTypes { - DATA_VENOXIS = 0, - DATA_MANDOKIR = 1, - DATA_KILNARA = 2, - DATA_ZANZIL = 3, - DATA_JINDO = 4, + DATA_VENOXIS = 0, + DATA_MANDOKIR = 1, + DATA_KILNARA = 2, + DATA_ZANZIL = 3, + DATA_JINDO = 4, // Cache of Madness - DATA_HAZZARAH = 5, - DATA_RENATAKI = 6, - DATA_WUSHOOLAY = 7, - DATA_GRILEK = 8, + DATA_HAZZARAH = 5, + DATA_RENATAKI = 6, + DATA_WUSHOOLAY = 7, + DATA_GRILEK = 8, - // Jin'do the Godbreaker + // Jin'do the Godbreaker DATA_JINDOR_TRIGGER, }; enum CreatureIds { - NPC_VENOXIS = 52155, - NPC_MANDOKIR = 52151, - NPC_KILNARA = 52059, - NPC_ZANZIL = 52053, - NPC_JINDO = 52148, + NPC_VENOXIS = 52155, + NPC_MANDOKIR = 52151, + NPC_KILNARA = 52059, + NPC_ZANZIL = 52053, + NPC_JINDO = 52148, // Cache of Madness - NPC_HAZZARAH = 52271, - NPC_RENATAKI = 52269, - NPC_WUSHOOLAY = 52286, - NPC_GRILEK = 52258, - - // Jin'do the Godbreaker - NPC_JINDO_TRIGGER = 52150, - NPC_SPIRIT_OF_HAKKAR = 52222, - NPC_SHADOW_OF_HAKKAR = 52650 + NPC_HAZZARAH = 52271, + NPC_RENATAKI = 52269, + NPC_WUSHOOLAY = 52286, + NPC_GRILEK = 52258, + + // Bloodlord Mandokir + NPC_CHAINED_SPIRIT = 52156, + NPC_OHGAN = 52157, + + // Jin'do the Godbreaker + NPC_JINDO_TRIGGER = 52150, + NPC_SPIRIT_OF_HAKKAR = 52222, + NPC_SHADOW_OF_HAKKAR = 52650 +}; + +enum GameObjectIds +{ + // High Priest Venoxis + GO_VENOXIS_COIL = 208844, + + // Bloodlord Mandokir + GO_ARENA_DOOR_1 = 208845, + GO_ARENA_DOOR_2 = 208847, + GO_ARENA_DOOR_3 = 208848, + GO_ARENA_DOOR_4 = 208846, + GO_ARENA_DOOR_5 = 208849, + + // High Priestess Kilnara + GO_FORCEFIELD = 180497, + + // Zanzil + GO_ZANZIL_DOOR = 208850, + + // Cache of Madness + GO_THE_CACHE_OF_MADNESS_DOOR = 208843 }; template @@ -72,4 +97,3 @@ CreatureAI* GetZulGurubAI(Creature* creature) } #endif - -- cgit v1.2.3 From ee9b7dfef8059f05ab404c48dd34929283d48963 Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Sun, 30 Dec 2012 17:09:55 +0100 Subject: Core/Command: Add command for near creature finding --- .../world/2012_12_30_01_world_trinity_string.sql | 3 ++ src/server/game/Miscellaneous/Language.h | 2 +- src/server/scripts/Commands/cs_npc.cpp | 47 ++++++++++++++++++++++ .../Database/Implementation/WorldDatabase.cpp | 1 + .../shared/Database/Implementation/WorldDatabase.h | 1 + 5 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 sql/updates/world/2012_12_30_01_world_trinity_string.sql (limited to 'src') diff --git a/sql/updates/world/2012_12_30_01_world_trinity_string.sql b/sql/updates/world/2012_12_30_01_world_trinity_string.sql new file mode 100644 index 00000000000..ce0578168f4 --- /dev/null +++ b/sql/updates/world/2012_12_30_01_world_trinity_string.sql @@ -0,0 +1,3 @@ +DELETE FROM `trinity_string` WHERE `entry`=556; +INSERT INTO `trinity_string` (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) VALUES +(556, 'Found near creatures (distance %f): %u ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h index 6576b470a7f..b60a2de0ab6 100644 --- a/src/server/game/Miscellaneous/Language.h +++ b/src/server/game/Miscellaneous/Language.h @@ -539,7 +539,7 @@ enum TrinityStrings LANG_NPC_SETDATA = 555, //! Old ones now free: - // LANG_HOVER_DISABLED = 556, + LANG_COMMAND_NEAR_NPC_MESSAGE = 556, LANG_YOURS_LEVEL_UP = 557, LANG_YOURS_LEVEL_DOWN = 558, diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index 115737e0dfe..b44b01d916f 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -87,6 +87,7 @@ public: static ChatCommand npcCommandTable[] = { { "info", SEC_ADMINISTRATOR, false, &HandleNpcInfoCommand, "", NULL }, + { "near", SEC_GAMEMASTER, false, &HandleNpcNearCommand, "", NULL }, { "move", SEC_GAMEMASTER, false, &HandleNpcMoveCommand, "", NULL }, { "playemote", SEC_ADMINISTRATOR, false, &HandleNpcPlayEmoteCommand, "", NULL }, { "say", SEC_MODERATOR, false, &HandleNpcSayCommand, "", NULL }, @@ -631,6 +632,52 @@ public: return true; } + static bool HandleNpcNearCommand(ChatHandler* handler, char const* args) + { + float distance = (!*args) ? 10.0f : float((atof(args))); + uint32 count = 0; + + Player* player = handler->GetSession()->GetPlayer(); + + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_CREATURE_NEAREST); + stmt->setFloat(0, player->GetPositionX()); + stmt->setFloat(1, player->GetPositionY()); + stmt->setFloat(2, player->GetPositionZ()); + stmt->setUInt32(3, player->GetMapId()); + stmt->setFloat(4, player->GetPositionX()); + stmt->setFloat(5, player->GetPositionY()); + stmt->setFloat(6, player->GetPositionZ()); + stmt->setFloat(7, distance * distance); + PreparedQueryResult result = WorldDatabase.Query(stmt); + + if (result) + { + do + { + Field* fields = result->Fetch(); + uint32 guid = fields[0].GetUInt32(); + uint32 entry = fields[1].GetUInt32(); + float x = fields[2].GetFloat(); + float y = fields[3].GetFloat(); + float z = fields[4].GetFloat(); + uint16 mapId = fields[5].GetUInt16(); + + CreatureTemplate const* creatureTemplate = sObjectMgr->GetCreatureTemplate(entry); + if (!creatureTemplate) + continue; + + handler->PSendSysMessage(LANG_CREATURE_LIST_CHAT, guid, guid, creatureTemplate->Name.c_str(), x, y, z, mapId); + + ++count; + } + while (result->NextRow()); + } + + handler->PSendSysMessage(LANG_COMMAND_NEAR_NPC_MESSAGE, distance, count); + + return true; + } + //move selected creature static bool HandleNpcMoveCommand(ChatHandler* handler, char const* args) { diff --git a/src/server/shared/Database/Implementation/WorldDatabase.cpp b/src/server/shared/Database/Implementation/WorldDatabase.cpp index 95c888249cd..0fc2dcfd55a 100644 --- a/src/server/shared/Database/Implementation/WorldDatabase.cpp +++ b/src/server/shared/Database/Implementation/WorldDatabase.cpp @@ -84,6 +84,7 @@ void WorldDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(WORLD_SEL_ITEM_TEMPLATE_BY_NAME, "SELECT entry FROM item_template WHERE name = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(WORLD_SEL_CREATURE_BY_ID, "SELECT guid FROM creature WHERE id = ?", CONNECTION_SYNCH); PREPARE_STATEMENT(WORLD_SEL_GAMEOBJECT_NEAREST, "SELECT guid, id, position_x, position_y, position_z, map, (POW(position_x - ?, 2) + POW(position_y - ?, 2) + POW(position_z - ?, 2)) AS order_ FROM gameobject WHERE map = ? AND (POW(position_x - ?, 2) + POW(position_y - ?, 2) + POW(position_z - ?, 2)) <= ? ORDER BY order_", CONNECTION_SYNCH); + PREPARE_STATEMENT(WORLD_SEL_CREATURE_NEAREST, "SELECT guid, id, position_x, position_y, position_z, map, (POW(position_x - ?, 2) + POW(position_y - ?, 2) + POW(position_z - ?, 2)) AS order_ FROM creature WHERE map = ? AND (POW(position_x - ?, 2) + POW(position_y - ?, 2) + POW(position_z - ?, 2)) <= ? ORDER BY order_", CONNECTION_SYNCH); PREPARE_STATEMENT(WORLD_INS_CREATURE, "INSERT INTO creature (guid, id , map, spawnMask, phaseMask, modelid, equipment_id, position_x, position_y, position_z, orientation, spawntimesecs, spawndist, currentwaypoint, curhealth, curmana, MovementType, npcflag, unit_flags, dynamicflags) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); PREPARE_STATEMENT(WORLD_DEL_GAME_EVENT_CREATURE, "DELETE FROM game_event_creature WHERE guid = ?", CONNECTION_ASYNC); PREPARE_STATEMENT(WORLD_DEL_GAME_EVENT_MODEL_EQUIP, "DELETE FROM game_event_model_equip WHERE guid = ?", CONNECTION_ASYNC); diff --git a/src/server/shared/Database/Implementation/WorldDatabase.h b/src/server/shared/Database/Implementation/WorldDatabase.h index 31da84c5151..64269edf7e1 100644 --- a/src/server/shared/Database/Implementation/WorldDatabase.h +++ b/src/server/shared/Database/Implementation/WorldDatabase.h @@ -104,6 +104,7 @@ enum WorldDatabaseStatements WORLD_SEL_ITEM_TEMPLATE_BY_NAME, WORLD_SEL_CREATURE_BY_ID, WORLD_SEL_GAMEOBJECT_NEAREST, + WORLD_SEL_CREATURE_NEAREST, WORLD_SEL_GAMEOBJECT_TARGET, WORLD_INS_CREATURE, WORLD_DEL_GAME_EVENT_CREATURE, -- cgit v1.2.3 From e7d02bfb7f4ab2a511badfad9c2b90725c6fb3da Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Mon, 31 Dec 2012 02:10:04 +0100 Subject: Core/Spells: Implemented effect SPELL_EFFECT_DAMAGE_FROM_MAX_HEALTH_PCT --- src/server/game/Miscellaneous/SharedDefines.h | 2 +- src/server/game/Spells/Spell.h | 1 + src/server/game/Spells/SpellEffects.cpp | 13 ++++++++++++- 3 files changed, 14 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index b50e4581908..2f9d698b302 100644 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -945,7 +945,7 @@ enum SpellEffects SPELL_EFFECT_TALENT_SPEC_SELECT = 162, SPELL_EFFECT_163 = 163, // Unused (4.3.4) SPELL_EFFECT_REMOVE_AURA = 164, - SPELL_EFFECT_165 = 165, + SPELL_EFFECT_DAMAGE_FROM_MAX_HEALTH_PCT = 165, SPELL_EFFECT_166 = 166, SPELL_EFFECT_167 = 167, SPELL_EFFECT_168 = 168, diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h index 603cfbf1309..4bc7b4e14fe 100644 --- a/src/server/game/Spells/Spell.h +++ b/src/server/game/Spells/Spell.h @@ -335,6 +335,7 @@ class Spell void EffectActivateSpec(SpellEffIndex effIndex); void EffectPlayerNotification(SpellEffIndex effIndex); void EffectRemoveAura(SpellEffIndex effIndex); + void EffectDamageFromMaxHealthPCT(SpellEffIndex effIndex); void EffectCastButtons(SpellEffIndex effIndex); void EffectRechargeManaGem(SpellEffIndex effIndex); diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 444704e2372..8b5b4c56351 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -234,7 +234,7 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]= &Spell::EffectActivateSpec, //162 SPELL_EFFECT_TALENT_SPEC_SELECT activate primary/secondary spec &Spell::EffectUnused, //163 SPELL_EFFECT_163 unused &Spell::EffectRemoveAura, //164 SPELL_EFFECT_REMOVE_AURA - &Spell::EffectNULL, //165 SPELL_EFFECT_165 + &Spell::EffectDamageFromMaxHealthPCT, //165 SPELL_EFFECT_DAMAGE_FROM_MAX_HEALTH_PCT &Spell::EffectNULL, //166 SPELL_EFFECT_166 &Spell::EffectNULL, //167 SPELL_EFFECT_167 &Spell::EffectNULL, //168 SPELL_EFFECT_168 @@ -5896,6 +5896,17 @@ void Spell::EffectRemoveAura(SpellEffIndex effIndex) unitTarget->RemoveAurasDueToSpell(m_spellInfo->Effects[effIndex].TriggerSpell); } +void Spell::EffectDamageFromMaxHealthPCT(SpellEffIndex effIndex) +{ + if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) + return; + + if (!unitTarget) + return; + + m_damage += unitTarget->CountPctFromMaxHealth(damage); +} + void Spell::EffectCastButtons(SpellEffIndex effIndex) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT) -- cgit v1.2.3 From 82f3b24e8a3f2b86f09bcf7d06bffbecaef0bc6f Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 30 Dec 2012 16:03:25 -0500 Subject: Core/Conditions: Rename CONDITION_INSTANCE_DATA to CONDITION_INSTANCE_INFO. And allow it to be used with GetData, GetData64 and GetBossState. --- src/server/game/Conditions/ConditionMgr.cpp | 26 +++++++++++++++++++++----- src/server/game/Conditions/ConditionMgr.h | 9 ++++++++- 2 files changed, 29 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 34e48c62771..304b153b000 100644 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -154,11 +154,27 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) case CONDITION_ACTIVE_EVENT: condMeets = sGameEventMgr->IsActiveEvent(ConditionValue1); break; - case CONDITION_INSTANCE_DATA: + case CONDITION_INSTANCE_INFO: { Map* map = object->GetMap(); - if (map && map->IsDungeon() && ((InstanceMap*)map)->GetInstanceScript()) - condMeets = ((InstanceMap*)map)->GetInstanceScript()->GetData(ConditionValue1) == ConditionValue2; + if (map && map->IsDungeon()) + { + if (InstanceScript const* instance = ((InstanceMap*)map)->GetInstanceScript()) + { + switch (ConditionValue3) + { + case INSTANCE_INFO_DATA: + condMeets = instance->GetData(ConditionValue1) == ConditionValue2; + break; + case INSTANCE_INFO_DATA64: + condMeets = instance->GetData64(ConditionValue1) == ConditionValue2; + break; + case INSTANCE_INFO_BOSS_STATE: + condMeets = instance->GetBossState(ConditionValue1) == ConditionValue2; + break; + } + } + } break; } case CONDITION_MAPID: @@ -367,7 +383,7 @@ uint32 Condition::GetSearcherTypeMaskForCondition() case CONDITION_ACTIVE_EVENT: mask |= GRID_MAP_TYPE_MASK_ALL; break; - case CONDITION_INSTANCE_DATA: + case CONDITION_INSTANCE_INFO: mask |= GRID_MAP_TYPE_MASK_ALL; break; case CONDITION_MAPID: @@ -1930,7 +1946,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) break; } case CONDITION_AREAID: - case CONDITION_INSTANCE_DATA: + case CONDITION_INSTANCE_INFO: break; case CONDITION_WORLD_STATE: { diff --git a/src/server/game/Conditions/ConditionMgr.h b/src/server/game/Conditions/ConditionMgr.h index 95b564dc0ee..22e1fd6592d 100644 --- a/src/server/game/Conditions/ConditionMgr.h +++ b/src/server/game/Conditions/ConditionMgr.h @@ -46,7 +46,7 @@ enum ConditionTypes CONDITION_DRUNKENSTATE = 10, // DrunkenState 0, 0 true if player is drunk enough CONDITION_WORLD_STATE = 11, // index value 0 true if world has the value for the index CONDITION_ACTIVE_EVENT = 12, // event_id 0 0 true if event is active - CONDITION_INSTANCE_DATA = 13, // entry data 0 true if data is set in current instance + CONDITION_INSTANCE_INFO = 13, // entry data type true if the instance info defined by type (enum InstanceInfo) equals data. CONDITION_QUEST_NONE = 14, // quest_id 0 0 true if doesn't have quest saved CONDITION_CLASS = 15, // class 0 0 true if player's class is equal to class CONDITION_RACE = 16, // race 0 0 true if player's race is equal to race @@ -153,6 +153,13 @@ enum RelationType RELATION_MAX }; +enum InstanceInfo +{ + INSTANCE_INFO_DATA = 0, + INSTANCE_INFO_DATA64, + INSTANCE_INFO_BOSS_STATE +}; + enum { MAX_CONDITION_TARGETS = 3 -- cgit v1.2.3 From c0913f09f4ca6ffd617c00a77e5d5f4d96426e56 Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 30 Dec 2012 16:43:30 -0500 Subject: Core/Conditions: Fixed build from previous merge. --- src/server/game/Instances/InstanceScript.cpp | 2 +- src/server/game/Maps/PhaseMgr.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Instances/InstanceScript.cpp b/src/server/game/Instances/InstanceScript.cpp index a183c13d2c7..08515140ee7 100644 --- a/src/server/game/Instances/InstanceScript.cpp +++ b/src/server/game/Instances/InstanceScript.cpp @@ -457,7 +457,7 @@ void InstanceScript::UpdateEncounterState(EncounterCreditType type, uint32 credi void InstanceScript::UpdatePhasing() { PhaseUpdateData phaseUdateData; - phaseUdateData.AddConditionType(CONDITION_INSTANCE_DATA); + phaseUdateData.AddConditionType(CONDITION_INSTANCE_INFO); Map::PlayerList const& players = instance->GetPlayers(); for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) diff --git a/src/server/game/Maps/PhaseMgr.cpp b/src/server/game/Maps/PhaseMgr.cpp index d43a930c71d..9949ee5bdd4 100644 --- a/src/server/game/Maps/PhaseMgr.cpp +++ b/src/server/game/Maps/PhaseMgr.cpp @@ -365,7 +365,7 @@ bool PhaseMgr::IsConditionTypeSupported(ConditionTypes const conditionType) case CONDITION_TEAM: case CONDITION_CLASS: case CONDITION_RACE: - case CONDITION_INSTANCE_DATA: + case CONDITION_INSTANCE_INFO: case CONDITION_LEVEL: return true; default: -- cgit v1.2.3 From 4232658c62b367f6d486ea3b842775854ddece98 Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Mon, 31 Dec 2012 12:57:35 +0100 Subject: Core:/ZulGurub: Fix mandokir decapitate targets --- src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp index 8d9ccd7bdfc..d23c2386db5 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp @@ -447,6 +447,7 @@ class spell_mandokir_decapitate : public SpellScriptLoader void FilterTargets(std::list& targets) { + targets.remove(GetCaster()->getVictim()); if (targets.empty()) return; -- cgit v1.2.3 From 8431be6bc6416e4d952e3fb8f42c2400ec76b2d1 Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Mon, 31 Dec 2012 14:15:24 +0100 Subject: SQL: rename sql for 4.3.4 Core/ZulGurub: revert my logic fail in 4232658c62b367f6d486ea3b842775854ddece98 --- .../world/2012_12_30_00_world_zul_gurub.sql | 26 ---------------------- .../world/2012_12_30_00_world_zul_gurub_434.sql | 26 ++++++++++++++++++++++ .../EasternKingdoms/ZulGurub/boss_mandokir.cpp | 1 - 3 files changed, 26 insertions(+), 27 deletions(-) delete mode 100644 sql/updates/world/2012_12_30_00_world_zul_gurub.sql create mode 100644 sql/updates/world/2012_12_30_00_world_zul_gurub_434.sql (limited to 'src') diff --git a/sql/updates/world/2012_12_30_00_world_zul_gurub.sql b/sql/updates/world/2012_12_30_00_world_zul_gurub.sql deleted file mode 100644 index 5b4e31636db..00000000000 --- a/sql/updates/world/2012_12_30_00_world_zul_gurub.sql +++ /dev/null @@ -1,26 +0,0 @@ -UPDATE `creature_template` SET `ScriptName`='npc_chained_spirit' WHERE `entry`=52156; -UPDATE `creature_template` SET `ScriptName`='npc_ohgan' WHERE `entry`=52157; - -DELETE FROM `creature` WHERE `id`=52156; - -DELETE FROM `spell_script_names` WHERE `spell_id` IN (96682,96776,96761,96821,96721,96722,96724,96740,28471); -INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES -(96682,'spell_mandokir_decapitate'), -(96776,'spell_mandokir_bloodletting'), -(96761,'spell_mandokir_devastating_slam'), -(96821,'spell_mandokir_spirit_vengeance_cancel'), -(96721,'spell_mandokir_ohgan_orders'), -(96722,'spell_mandokir_ohgan_orders_trigger'), -(96724,'spell_mandokir_reanimate_ohgan'), -(96740,'spell_mandokir_devastating_slam_damage'), -(28471,'spell_clear_all'); - -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`IN (96724,96721); -INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES -(13, 3, 96724, 0, 0, 31, 0, 3, 52157, 0, 0, 0, 0, '', 'Earth Spike - Ohgan'), -(13, 1, 96721, 0, 0, 31, 0, 3, 52156, 0, 0, 0, 0, '', 'Ohgan''s Orders - Chained Spirit'); - -DELETE FROM `achievement_criteria_data` WHERE `criteria_id`=16848; -INSERT INTO `achievement_criteria_data` (`criteria_id`, `type`, `value1`, `value2`, `ScriptName`) VALUES -(16848,11,0,0,'achievement_ohganot_so_fast'), -(16848,12,1,0,''); diff --git a/sql/updates/world/2012_12_30_00_world_zul_gurub_434.sql b/sql/updates/world/2012_12_30_00_world_zul_gurub_434.sql new file mode 100644 index 00000000000..5b4e31636db --- /dev/null +++ b/sql/updates/world/2012_12_30_00_world_zul_gurub_434.sql @@ -0,0 +1,26 @@ +UPDATE `creature_template` SET `ScriptName`='npc_chained_spirit' WHERE `entry`=52156; +UPDATE `creature_template` SET `ScriptName`='npc_ohgan' WHERE `entry`=52157; + +DELETE FROM `creature` WHERE `id`=52156; + +DELETE FROM `spell_script_names` WHERE `spell_id` IN (96682,96776,96761,96821,96721,96722,96724,96740,28471); +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(96682,'spell_mandokir_decapitate'), +(96776,'spell_mandokir_bloodletting'), +(96761,'spell_mandokir_devastating_slam'), +(96821,'spell_mandokir_spirit_vengeance_cancel'), +(96721,'spell_mandokir_ohgan_orders'), +(96722,'spell_mandokir_ohgan_orders_trigger'), +(96724,'spell_mandokir_reanimate_ohgan'), +(96740,'spell_mandokir_devastating_slam_damage'), +(28471,'spell_clear_all'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`IN (96724,96721); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(13, 3, 96724, 0, 0, 31, 0, 3, 52157, 0, 0, 0, 0, '', 'Earth Spike - Ohgan'), +(13, 1, 96721, 0, 0, 31, 0, 3, 52156, 0, 0, 0, 0, '', 'Ohgan''s Orders - Chained Spirit'); + +DELETE FROM `achievement_criteria_data` WHERE `criteria_id`=16848; +INSERT INTO `achievement_criteria_data` (`criteria_id`, `type`, `value1`, `value2`, `ScriptName`) VALUES +(16848,11,0,0,'achievement_ohganot_so_fast'), +(16848,12,1,0,''); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp index d23c2386db5..8d9ccd7bdfc 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp @@ -447,7 +447,6 @@ class spell_mandokir_decapitate : public SpellScriptLoader void FilterTargets(std::list& targets) { - targets.remove(GetCaster()->getVictim()); if (targets.empty()) return; -- cgit v1.2.3 From 4082a411acd05cfa027bad8c794cb9d307842900 Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 31 Dec 2012 21:13:40 +0100 Subject: Core/Spells: Added new spell effect/target definitions --- src/server/game/Miscellaneous/SharedDefines.h | 6 ++--- src/server/game/Spells/SpellEffects.cpp | 8 +++--- src/server/game/Spells/SpellInfo.cpp | 39 +++++++++++++++++++++++++-- 3 files changed, 44 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 2f9d698b302..f59e10ba846 100644 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -946,10 +946,10 @@ enum SpellEffects SPELL_EFFECT_163 = 163, // Unused (4.3.4) SPELL_EFFECT_REMOVE_AURA = 164, SPELL_EFFECT_DAMAGE_FROM_MAX_HEALTH_PCT = 165, - SPELL_EFFECT_166 = 166, + SPELL_EFFECT_GIVE_CURRENCY = 166, SPELL_EFFECT_167 = 167, SPELL_EFFECT_168 = 168, - SPELL_EFFECT_169 = 169, + SPELL_EFFECT_DESTROY_ITEM = 169, SPELL_EFFECT_170 = 170, SPELL_EFFECT_171 = 171, // Summons gamebject SPELL_EFFECT_172 = 172, // Aoe ressurection @@ -959,7 +959,7 @@ enum SpellEffects SPELL_EFFECT_176 = 176, // Some kind of sanctuary effect (Vanish) SPELL_EFFECT_177 = 177, SPELL_EFFECT_178 = 178, // Unused (4.3.4) - SPELL_EFFECT_179 = 179, + SPELL_EFFECT_CREATE_AREATRIGGER = 179, SPELL_EFFECT_180 = 180, // Unused (4.3.4) SPELL_EFFECT_181 = 181, // Unused (4.3.4) SPELL_EFFECT_182 = 182, diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 8b5b4c56351..9dbe9ab3459 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -235,20 +235,20 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]= &Spell::EffectUnused, //163 SPELL_EFFECT_163 unused &Spell::EffectRemoveAura, //164 SPELL_EFFECT_REMOVE_AURA &Spell::EffectDamageFromMaxHealthPCT, //165 SPELL_EFFECT_DAMAGE_FROM_MAX_HEALTH_PCT - &Spell::EffectNULL, //166 SPELL_EFFECT_166 + &Spell::EffectNULL, //166 SPELL_EFFECT_GIVE_CURRENCY &Spell::EffectNULL, //167 SPELL_EFFECT_167 &Spell::EffectNULL, //168 SPELL_EFFECT_168 - &Spell::EffectNULL, //169 SPELL_EFFECT_169 + &Spell::EffectNULL, //169 SPELL_EFFECT_DESTROY_ITEM &Spell::EffectNULL, //170 SPELL_EFFECT_170 &Spell::EffectNULL, //171 SPELL_EFFECT_171 &Spell::EffectNULL, //172 SPELL_EFFECT_172 - &Spell::EffectNULL, //173 SPELL_EFFECT_173 + &Spell::EffectNULL, //173 SPELL_EFFECT_UNLOCK_GUILD_VAULT_TAB &Spell::EffectNULL, //174 SPELL_EFFECT_174 &Spell::EffectUnused, //175 SPELL_EFFECT_175 unused &Spell::EffectNULL, //176 SPELL_EFFECT_176 &Spell::EffectNULL, //177 SPELL_EFFECT_177 &Spell::EffectUnused, //178 SPELL_EFFECT_178 unused - &Spell::EffectNULL, //179 SPELL_EFFECT_179 + &Spell::EffectNULL, //179 SPELL_EFFECT_CREATE_AREATRIGGER &Spell::EffectUnused, //180 SPELL_EFFECT_180 unused &Spell::EffectUnused, //181 SPELL_EFFECT_181 unused &Spell::EffectNULL, //182 SPELL_EFFECT_182 diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 70932fc6821..3621d9f91be 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -316,7 +316,24 @@ SpellImplicitTargetInfo::StaticData SpellImplicitTargetInfo::_data[TOTAL_SPELL_ {TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_DEST, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 107 TARGET_UNK_DEST_AREA_UNK_107 {TARGET_OBJECT_TYPE_GOBJ, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_CONE, TARGET_CHECK_DEFAULT, TARGET_DIR_FRONT}, // 108 TARGET_GAMEOBJECT_CONE {TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 109 - {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 110 TARGET_DEST_UNK_110 + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_CONE, TARGET_CHECK_DEFAULT, TARGET_DIR_FRONT}, // 110 TARGET_DEST_UNK_110 + {TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 111 + {TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 112 + {TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 113 + {TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 114 + {TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 115 + {TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 116 + {TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 117 + {TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 118 + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_AREA, TARGET_CHECK_RAID, TARGET_DIR_NONE}, // 119 + {TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 120 + {TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 121 + {TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 122 + {TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 123 + {TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 124 + {TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 125 + {TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 126 + {TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 127 }; SpellEffectInfo::SpellEffectInfo(SpellEntry const* /*spellEntry*/, SpellInfo const* spellInfo, uint8 effIndex, SpellEffectEntry const* _effect) @@ -604,7 +621,7 @@ SpellTargetObjectTypes SpellEffectInfo::GetUsedTargetObjectType() const return _data[Effect].UsedTargetObjectType; } -SpellEffectInfo::StaticData SpellEffectInfo::_data[TOTAL_SPELL_EFFECTS] = +SpellEffectInfo::StaticData SpellEffectInfo::_data[TOTAL_SPELL_EFFECTS] = { // implicit target type used target object type {EFFECT_IMPLICIT_TARGET_NONE, TARGET_OBJECT_TYPE_NONE}, // 0 @@ -772,6 +789,24 @@ SpellEffectInfo::StaticData SpellEffectInfo::_data[TOTAL_SPELL_EFFECTS] = {EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT}, // 162 SPELL_EFFECT_TALENT_SPEC_SELECT {EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT}, // 163 SPELL_EFFECT_163 {EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT}, // 164 SPELL_EFFECT_REMOVE_AURA + {EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT}, // 165 SPELL_EFFECT_165 + {EFFECT_IMPLICIT_TARGET_CASTER, TARGET_OBJECT_TYPE_UNIT}, // 166 SPELL_EFFECT_GIVE_CURRENCY + {EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT}, // 167 SPELL_EFFECT_167 + {EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT}, // 168 SPELL_EFFECT_168 + {EFFECT_IMPLICIT_TARGET_NONE, TARGET_OBJECT_TYPE_ITEM}, // 169 SPELL_EFFECT_DESTROY_ITEM + {EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT}, // 170 SPELL_EFFECT_170 + {EFFECT_IMPLICIT_TARGET_NONE, TARGET_OBJECT_TYPE_DEST}, // 171 SPELL_EFFECT_171 + {EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT}, // 172 SPELL_EFFECT_172 + {EFFECT_IMPLICIT_TARGET_NONE, TARGET_OBJECT_TYPE_NONE}, // 173 SPELL_EFFECT_UNLOCK_GUILD_VAULT_TAB + {EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT}, // 174 SPELL_EFFECT_174 + {EFFECT_IMPLICIT_TARGET_NONE, TARGET_OBJECT_TYPE_NONE}, // 175 SPELL_EFFECT_175 + {EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT}, // 176 SPELL_EFFECT_176 + {EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT}, // 177 SPELL_EFFECT_177 + {EFFECT_IMPLICIT_TARGET_NONE, TARGET_OBJECT_TYPE_NONE}, // 178 SPELL_EFFECT_178 + {EFFECT_IMPLICIT_TARGET_NONE, TARGET_OBJECT_TYPE_DEST}, // 179 SPELL_EFFECT_CREATE_AREATRIGGER + {EFFECT_IMPLICIT_TARGET_NONE, TARGET_OBJECT_TYPE_NONE}, // 180 SPELL_EFFECT_180 + {EFFECT_IMPLICIT_TARGET_NONE, TARGET_OBJECT_TYPE_NONE}, // 181 SPELL_EFFECT_181 + {EFFECT_IMPLICIT_TARGET_NONE, TARGET_OBJECT_TYPE_UNIT}, // 182 SPELL_EFFECT_182 }; SpellInfo::SpellInfo(SpellEntry const* spellEntry, SpellEffectEntry const** effects) -- cgit v1.2.3 From fefee58de7d8c72ba6b34d7f84ee2d626dad59ce Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 31 Dec 2012 21:14:54 +0100 Subject: Core/Scripts: Added ai method to temporarily despawn a boss when it enters evade mode (respawns after 30 seconds) --- src/server/game/AI/ScriptedAI/ScriptedCreature.cpp | 14 ++++++++++++++ src/server/game/AI/ScriptedAI/ScriptedCreature.h | 1 + 2 files changed, 15 insertions(+) (limited to 'src') diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp index ac74cacf2c5..c1ea712e4e6 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp @@ -585,6 +585,20 @@ void BossAI::UpdateAI(uint32 const diff) DoMeleeAttackIfReady(); } +void BossAI::_DespawnAtEvade() +{ + uint32 corpseDelay = me->GetCorpseDelay(); + uint32 respawnDelay = me->GetRespawnDelay(); + + me->SetCorpseDelay(1); + me->SetRespawnDelay(29); + + me->DespawnOrUnsummon(); + + me->SetCorpseDelay(corpseDelay); + me->SetRespawnDelay(respawnDelay); +} + // WorldBossAI - for non-instanced bosses WorldBossAI::WorldBossAI(Creature* creature) : diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.h b/src/server/game/AI/ScriptedAI/ScriptedCreature.h index 2a221d04404..52bfc24f578 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.h +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.h @@ -308,6 +308,7 @@ class BossAI : public ScriptedAI void _EnterCombat(); void _JustDied(); void _JustReachedHome() { me->setActive(false); } + void _DespawnAtEvade(); bool CheckInRoom() { -- cgit v1.2.3 From 49e3526882839cfefa088304dd0538b704231aac Mon Sep 17 00:00:00 2001 From: Warpten Date: Tue, 1 Jan 2013 17:48:09 +0100 Subject: Core/Spells: Implemented SPELL_EFFECT_GIVE_CURRENCY. --- src/server/game/Spells/Spell.h | 1 + src/server/game/Spells/SpellEffects.cpp | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h index 4bc7b4e14fe..2a976d74f30 100644 --- a/src/server/game/Spells/Spell.h +++ b/src/server/game/Spells/Spell.h @@ -338,6 +338,7 @@ class Spell void EffectDamageFromMaxHealthPCT(SpellEffIndex effIndex); void EffectCastButtons(SpellEffIndex effIndex); void EffectRechargeManaGem(SpellEffIndex effIndex); + void EffectGiveCurrency(SpellEffIndex effIndex); typedef std::set UsedSpellMods; diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 9dbe9ab3459..3e6994176cc 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -235,7 +235,7 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]= &Spell::EffectUnused, //163 SPELL_EFFECT_163 unused &Spell::EffectRemoveAura, //164 SPELL_EFFECT_REMOVE_AURA &Spell::EffectDamageFromMaxHealthPCT, //165 SPELL_EFFECT_DAMAGE_FROM_MAX_HEALTH_PCT - &Spell::EffectNULL, //166 SPELL_EFFECT_GIVE_CURRENCY + &Spell::EffectGiveCurrency, //166 SPELL_EFFECT_GIVE_CURRENCY &Spell::EffectNULL, //167 SPELL_EFFECT_167 &Spell::EffectNULL, //168 SPELL_EFFECT_168 &Spell::EffectNULL, //169 SPELL_EFFECT_DESTROY_ITEM @@ -5907,6 +5907,17 @@ void Spell::EffectDamageFromMaxHealthPCT(SpellEffIndex effIndex) m_damage += unitTarget->CountPctFromMaxHealth(damage); } +void Spell::EffectGiveCurrency(SpellEffIndex effIndex) +{ + if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) + return; + + if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER) + return; + + unitTarget->ToPlayer()->ModifyCurrency(m_spellInfo->Effects[effIndex].MiscValue, damage); +} + void Spell::EffectCastButtons(SpellEffIndex effIndex) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT) -- cgit v1.2.3 From 35451c23076ebe6a5f5bd2deddbf806bfbe5f658 Mon Sep 17 00:00:00 2001 From: Warpten Date: Tue, 1 Jan 2013 18:12:11 +0100 Subject: Core/Logging: Improved opcode compressing logging. --- src/server/game/Server/WorldPacket.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Server/WorldPacket.cpp b/src/server/game/Server/WorldPacket.cpp index 266f5e74e1d..81203edba05 100644 --- a/src/server/game/Server/WorldPacket.cpp +++ b/src/server/game/Server/WorldPacket.cpp @@ -45,8 +45,7 @@ void WorldPacket::Compress(z_stream* compressionStream) *this << uint32(size); append(&storage[0], destsize); SetOpcode(opcode); - - sLog->outInfo(LOG_FILTER_NETWORKIO, "Successfully compressed opcode %u (len %u) to %u (len %u)", uncompressedOpcode, size, opcode, destsize); + sLog->outInfo(LOG_FILTER_NETWORKIO, "%s (len %u) successfully compressed to %04X (len %u)", GetOpcodeNameForLogging(uncompressedOpcode).c_str(), size, opcode, destsize); } //! Compresses another packet and stores it in self (source left intact) @@ -78,7 +77,7 @@ void WorldPacket::Compress(z_stream* compressionStream, WorldPacket const* sourc SetOpcode(opcode); - sLog->outInfo(LOG_FILTER_NETWORKIO, "Successfully compressed opcode %u (len %u) to %u (len %u)", uncompressedOpcode, size, opcode, destsize); + sLog->outInfo(LOG_FILTER_NETWORKIO, "%s (len %u) successfully compressed to %04X (len %u)", GetOpcodeNameForLogging(uncompressedOpcode).c_str(), size, opcode, destsize); } void WorldPacket::Compress(void* dst, uint32 *dst_size, const void* src, int src_size) -- cgit v1.2.3 From 312e8509dddf910a5ab199d646c5a4d237d5fda9 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 1 Jan 2013 21:57:31 +0100 Subject: Core/Spells: Implemented SPELL_EFFECT_RESURRECT_WITH_AURA (effect number 172) --- src/server/game/Entities/Player/Player.cpp | 34 +++++++++------ src/server/game/Entities/Player/Player.h | 49 +++++++++++++++------- src/server/game/Handlers/MiscHandler.cpp | 4 +- src/server/game/Miscellaneous/SharedDefines.h | 2 +- src/server/game/Spells/Spell.h | 1 + src/server/game/Spells/SpellEffects.cpp | 44 ++++++++++++++++--- .../ScarletEnclave/the_scarlet_enclave.cpp | 2 +- 7 files changed, 99 insertions(+), 37 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index bfe86337b4d..e1030766704 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -693,7 +693,7 @@ Player::Player(WorldSession* session): Unit(true), phaseMgr(this) m_nextSave = sWorld->getIntConfig(CONFIG_INTERVAL_SAVE); - clearResurrectRequestData(); + _resurrectionData = NULL; memset(m_items, 0, sizeof(Item*)*PLAYER_SLOTS_COUNT); @@ -905,6 +905,8 @@ Player::~Player() for (uint8 i = 0; i < MAX_CUF_PROFILES; ++i) delete _CUFProfiles[i]; + ClearResurrectRequestData(); + sWorld->DecreasePlayerCount(); } @@ -1842,7 +1844,7 @@ void Player::setDeathState(DeathState s) // lost combo points at any target (targeted combo points clear in Unit::setDeathState) ClearComboPoints(); - clearResurrectRequestData(); + ClearResurrectRequestData(); //FIXME: is pet dismissed at dying or releasing spirit? if second, add setDeathState(DEAD) to HandleRepopRequestOpcode and define pet unsummon here with (s == DEAD) RemovePet(NULL, PET_SAVE_NOT_IN_SLOT, true); @@ -2348,13 +2350,13 @@ void Player::ProcessDelayedOperations() { ResurrectPlayer(0.0f, false); - if (GetMaxHealth() > m_resurrectHealth) - SetHealth(m_resurrectHealth); + if (GetMaxHealth() > _resurrectionData->Health) + SetHealth(_resurrectionData->Health); else SetFullHealth(); - if (uint32(GetMaxPower(POWER_MANA)) > m_resurrectMana) - SetPower(POWER_MANA, m_resurrectMana); + if (uint32(GetMaxPower(POWER_MANA)) > _resurrectionData->Mana) + SetPower(POWER_MANA, _resurrectionData->Mana); else SetPower(POWER_MANA, GetMaxPower(POWER_MANA)); @@ -2362,6 +2364,9 @@ void Player::ProcessDelayedOperations() SetPower(POWER_ENERGY, GetMaxPower(POWER_ENERGY)); SetPower(POWER_ECLIPSE, 0); + if (uint32 aura = _resurrectionData->Aura) + CastSpell(this, aura, true, NULL, NULL, _resurrectionData->GUID); + SpawnCorpseBones(); } @@ -7505,7 +7510,7 @@ void Player::ModifyCurrency(uint32 id, int32 count, bool printLog/* = true*/, bo } } -void Player::SetCurrency(uint32 id, uint32 count, bool printLog /*= true*/) +void Player::SetCurrency(uint32 id, uint32 count, bool /*printLog*/ /*= true*/) { PlayerCurrenciesMap::iterator itr = _currencyStorage.find(id); if (itr == _currencyStorage.end()) @@ -23557,7 +23562,9 @@ bool Player::IsAtRecruitAFriendDistance(WorldObject const* pOther) const void Player::ResurectUsingRequestData() { /// Teleport before resurrecting by player, otherwise the player might get attacked from creatures near his corpse - TeleportTo(m_resurrectMap, m_resurrectX, m_resurrectY, m_resurrectZ, GetOrientation()); + float x, y, z, o; + _resurrectionData->Location.GetPosition(x, y, z, o); + TeleportTo(_resurrectionData->Location.GetMapId(), x, y, z, o); if (IsBeingTeleported()) { @@ -23567,13 +23574,13 @@ void Player::ResurectUsingRequestData() ResurrectPlayer(0.0f, false); - if (GetMaxHealth() > m_resurrectHealth) - SetHealth(m_resurrectHealth); + if (GetMaxHealth() > _resurrectionData->Health) + SetHealth(_resurrectionData->Health); else SetFullHealth(); - if (uint32(GetMaxPower(POWER_MANA)) > m_resurrectMana) - SetPower(POWER_MANA, m_resurrectMana); + if (uint32(GetMaxPower(POWER_MANA)) > _resurrectionData->Mana) + SetPower(POWER_MANA, _resurrectionData->Mana); else SetPower(POWER_MANA, GetMaxPower(POWER_MANA)); @@ -23582,6 +23589,9 @@ void Player::ResurectUsingRequestData() SetPower(POWER_FOCUS, GetMaxPower(POWER_FOCUS)); SetPower(POWER_ECLIPSE, 0); + if (uint32 aura = _resurrectionData->Aura) + CastSpell(this, aura, true, NULL, NULL, _resurrectionData->GUID); + SpawnCorpseBones(); } diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 12674552666..c3bdfd5bd7f 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1163,6 +1163,15 @@ class TradeData uint64 m_items[TRADE_SLOT_COUNT]; // traded items from m_player side including non-traded slot }; +struct ResurrectionData +{ + uint64 GUID; + WorldLocation Location; + uint32 Health; + uint32 Mana; + uint32 Aura; +}; + class KillRewarder { public: @@ -1974,19 +1983,32 @@ class Player : public Unit, public GridObject void SetLastPotionId(uint32 item_id) { m_lastPotionId = item_id; } void UpdatePotionCooldown(Spell* spell = NULL); - void setResurrectRequestData(uint64 guid, uint32 mapId, float X, float Y, float Z, uint32 health, uint32 mana) + void SetResurrectRequestData(Unit* caster, uint32 health, uint32 mana, uint32 appliedAura) + { + ASSERT(!IsRessurectRequested()); + _resurrectionData = new ResurrectionData(); + _resurrectionData->GUID = caster->GetGUID(); + _resurrectionData->Location.WorldRelocate(*caster); + _resurrectionData->Health = health; + _resurrectionData->Mana = mana; + _resurrectionData->Aura = appliedAura; + } + + void ClearResurrectRequestData() { - m_resurrectGUID = guid; - m_resurrectMap = mapId; - m_resurrectX = X; - m_resurrectY = Y; - m_resurrectZ = Z; - m_resurrectHealth = health; - m_resurrectMana = mana; + delete _resurrectionData; + _resurrectionData = NULL; } - void clearResurrectRequestData() { setResurrectRequestData(0, 0, 0.0f, 0.0f, 0.0f, 0, 0); } - bool isRessurectRequestedBy(uint64 guid) const { return m_resurrectGUID == guid; } - bool isRessurectRequested() const { return m_resurrectGUID != 0; } + + bool IsRessurectRequestedBy(uint64 guid) const + { + if (!IsRessurectRequested()) + return false; + + return _resurrectionData->GUID == guid; + } + + bool IsRessurectRequested() const { return _resurrectionData != NULL; } void ResurectUsingRequestData(); uint8 getCinematic() @@ -2963,10 +2985,7 @@ class Player : public Unit, public GridObject void ResetTimeSync(); void SendTimeSync(); - uint64 m_resurrectGUID; - uint32 m_resurrectMap; - float m_resurrectX, m_resurrectY, m_resurrectZ; - uint32 m_resurrectHealth, m_resurrectMana; + ResurrectionData* _resurrectionData; WorldSession* m_session; diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 29af54f195f..ff319fdbfe9 100644 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -783,11 +783,11 @@ void WorldSession::HandleResurrectResponseOpcode(WorldPacket& recvData) if (status == 0) { - GetPlayer()->clearResurrectRequestData(); // reject + GetPlayer()->ClearResurrectRequestData(); // reject return; } - if (!GetPlayer()->isRessurectRequestedBy(guid)) + if (!GetPlayer()->IsRessurectRequestedBy(guid)) return; GetPlayer()->ResurectUsingRequestData(); diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index f59e10ba846..c855f7e2af2 100644 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -952,7 +952,7 @@ enum SpellEffects SPELL_EFFECT_DESTROY_ITEM = 169, SPELL_EFFECT_170 = 170, SPELL_EFFECT_171 = 171, // Summons gamebject - SPELL_EFFECT_172 = 172, // Aoe ressurection + SPELL_EFFECT_RESURRECT_WITH_AURA = 172, SPELL_EFFECT_UNLOCK_GUILD_VAULT_TAB = 173, // Guild tab unlocked (guild perk) SPELL_EFFECT_174 = 174, SPELL_EFFECT_175 = 175, // Unused (4.3.4) diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h index 2a976d74f30..b009bc6e2d7 100644 --- a/src/server/game/Spells/Spell.h +++ b/src/server/game/Spells/Spell.h @@ -339,6 +339,7 @@ class Spell void EffectCastButtons(SpellEffIndex effIndex); void EffectRechargeManaGem(SpellEffIndex effIndex); void EffectGiveCurrency(SpellEffIndex effIndex); + void EffectResurrectWithAura(SpellEffIndex effIndex); typedef std::set UsedSpellMods; diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 3e6994176cc..f76b696dfc3 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -241,7 +241,7 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]= &Spell::EffectNULL, //169 SPELL_EFFECT_DESTROY_ITEM &Spell::EffectNULL, //170 SPELL_EFFECT_170 &Spell::EffectNULL, //171 SPELL_EFFECT_171 - &Spell::EffectNULL, //172 SPELL_EFFECT_172 + &Spell::EffectResurrectWithAura, //172 SPELL_EFFECT_RESURRECT_WITH_AURA &Spell::EffectNULL, //173 SPELL_EFFECT_UNLOCK_GUILD_VAULT_TAB &Spell::EffectNULL, //174 SPELL_EFFECT_174 &Spell::EffectUnused, //175 SPELL_EFFECT_175 unused @@ -280,13 +280,13 @@ void Spell::EffectResurrectNew(SpellEffIndex effIndex) Player* target = unitTarget->ToPlayer(); - if (target->isRessurectRequested()) // already have one active request + if (target->IsRessurectRequested()) // already have one active request return; uint32 health = damage; uint32 mana = m_spellInfo->Effects[effIndex].MiscValue; ExecuteLogEffectResurrect(effIndex, target); - target->setResurrectRequestData(m_caster->GetGUID(), m_caster->GetMapId(), m_caster->GetPositionX(), m_caster->GetPositionY(), m_caster->GetPositionZ(), health, mana); + target->SetResurrectRequestData(m_caster, health, mana, 0); SendResurrectRequest(target); } @@ -4622,7 +4622,7 @@ void Spell::EffectResurrect(SpellEffIndex effIndex) Player* target = unitTarget->ToPlayer(); - if (target->isRessurectRequested()) // already have one active request + if (target->IsRessurectRequested()) // already have one active request return; uint32 health = target->CountPctFromMaxHealth(damage); @@ -4630,7 +4630,7 @@ void Spell::EffectResurrect(SpellEffIndex effIndex) ExecuteLogEffectResurrect(effIndex, target); - target->setResurrectRequestData(m_caster->GetGUID(), m_caster->GetMapId(), m_caster->GetPositionX(), m_caster->GetPositionY(), m_caster->GetPositionZ(), health, mana); + target->SetResurrectRequestData(m_caster, health, mana, 0); SendResurrectRequest(target); } @@ -5896,7 +5896,7 @@ void Spell::EffectRemoveAura(SpellEffIndex effIndex) unitTarget->RemoveAurasDueToSpell(m_spellInfo->Effects[effIndex].TriggerSpell); } -void Spell::EffectDamageFromMaxHealthPCT(SpellEffIndex effIndex) +void Spell::EffectDamageFromMaxHealthPCT(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; @@ -6046,3 +6046,35 @@ void Spell::EffectSummonRaFFriend(SpellEffIndex effIndex) m_caster->CastSpell(unitTarget, m_spellInfo->Effects[effIndex].TriggerSpell, true); } + +void Spell::EffectResurrectWithAura(SpellEffIndex effIndex) +{ + if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) + return; + + if (!unitTarget || !unitTarget->IsInWorld()) + return; + + Player* target = unitTarget->ToPlayer(); + if (!target) + return; + + if (unitTarget->isAlive()) + return; + + if (target->IsRessurectRequested()) // already have one active request + return; + + uint32 health = target->CountPctFromMaxHealth(damage); + uint32 mana = CalculatePct(target->GetMaxPower(POWER_MANA), damage); + uint32 resurrectAura = 0; + if (sSpellMgr->GetSpellInfo(GetSpellInfo()->Effects[effIndex].TriggerSpell)) + resurrectAura = GetSpellInfo()->Effects[effIndex].TriggerSpell; + + if (resurrectAura && target->HasAura(resurrectAura)) + return; + + ExecuteLogEffectResurrect(effIndex, target); + target->SetResurrectRequestData(m_caster, health, mana, resurrectAura); + SendResurrectRequest(target); +} diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp index 6e7f7e103c5..8f10bad2095 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp @@ -92,7 +92,7 @@ public: FlyBackTimer = 4500; break; case 2: - if (!player->isRessurectRequested()) + if (!player->IsRessurectRequested()) { me->HandleEmoteCommand(EMOTE_ONESHOT_CUSTOM_SPELL_01); DoCast(player, SPELL_REVIVE, true); -- cgit v1.2.3 From 2fa39727070995003ab3833004fc2c3ec469bde6 Mon Sep 17 00:00:00 2001 From: Warpten Date: Tue, 1 Jan 2013 22:26:15 +0100 Subject: Core/Guilds: Fixed a possible crash on guild invite. Closes #8699 --- src/server/game/Guilds/Guild.cpp | 2 +- src/server/game/Handlers/PetitionsHandler.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 3057a97eb27..9d7592db138 100644 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -2650,7 +2650,7 @@ bool Guild::AddMember(uint64 guid, uint8 rankId) _UpdateAccountsNumber(); _LogEvent(GUILD_EVENT_LOG_JOIN_GUILD, lowguid); _BroadcastEvent(GE_JOINED, guid, name.c_str()); - sGuildFinderMgr->RemoveMembershipRequest(player->GetGUIDLow(), GUID_LOPART(this->GetGUID())); + sGuildFinderMgr->RemoveMembershipRequest(lowguid, GUID_LOPART(GetGUID())); // Call scripts if member was succesfully added (and stored to database) sScriptMgr->OnGuildAddMember(this, player, rankId); diff --git a/src/server/game/Handlers/PetitionsHandler.cpp b/src/server/game/Handlers/PetitionsHandler.cpp index 9b7338f1104..e301f7eb18d 100644 --- a/src/server/game/Handlers/PetitionsHandler.cpp +++ b/src/server/game/Handlers/PetitionsHandler.cpp @@ -775,7 +775,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket& recvData) if (_player->GetGuildId()) { data.Initialize(SMSG_TURN_IN_PETITION_RESULTS, 4); - data << (uint32)PETITION_TURN_ALREADY_IN_GUILD; + data << uint32(PETITION_TURN_ALREADY_IN_GUILD); _player->GetSession()->SendPacket(&data); return; } -- cgit v1.2.3 From 91f8ca32445f839e36ec699627a12781907950c9 Mon Sep 17 00:00:00 2001 From: Warpten Date: Wed, 2 Jan 2013 05:19:18 +0100 Subject: Core/GuildFinder: Remove all requests from a player when he enters a guild. --- src/server/game/Guilds/Guild.cpp | 2 +- src/server/game/Guilds/GuildFinderMgr.h | 8 ++++---- src/server/game/Handlers/GuildFinderHandler.cpp | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 9d7592db138..e2d5f32b938 100644 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -2650,7 +2650,7 @@ bool Guild::AddMember(uint64 guid, uint8 rankId) _UpdateAccountsNumber(); _LogEvent(GUILD_EVENT_LOG_JOIN_GUILD, lowguid); _BroadcastEvent(GE_JOINED, guid, name.c_str()); - sGuildFinderMgr->RemoveMembershipRequest(lowguid, GUID_LOPART(GetGUID())); + sGuildFinderMgr->RemoveAllMembershipRequestsFromPlayer(lowguid); // Call scripts if member was succesfully added (and stored to database) sScriptMgr->OnGuildAddMember(this, player, rankId); diff --git a/src/server/game/Guilds/GuildFinderMgr.h b/src/server/game/Guilds/GuildFinderMgr.h index 930d538ebca..691132512d1 100644 --- a/src/server/game/Guilds/GuildFinderMgr.h +++ b/src/server/game/Guilds/GuildFinderMgr.h @@ -37,7 +37,7 @@ enum GuildFinderOptionsAvailability { AVAILABILITY_WEEKDAYS = 0x1, AVAILABILITY_WEEKENDS = 0x2, - ALL_WEEK = AVAILABILITY_WEEKDAYS | AVAILABILITY_WEEKENDS + AVAILABILITY_ALWAYS = AVAILABILITY_WEEKDAYS | AVAILABILITY_WEEKENDS }; enum GuildFinderOptionsRoles @@ -50,8 +50,8 @@ enum GuildFinderOptionsRoles enum GuildFinderOptionsLevel { - ANY_FINDER_LEVEL = 0x1, - MAX_FINDER_LEVEL = 0x2, + ANY_FINDER_LEVEL = 0x1, + MAX_FINDER_LEVEL = 0x2, ALL_GUILDFINDER_LEVELS = ANY_FINDER_LEVEL | MAX_FINDER_LEVEL }; @@ -237,7 +237,7 @@ class GuildFinderMgr */ void RemoveMembershipRequest(uint32 playerId, uint32 guildId); - /// wipes everything related to a guild. Used when that guild is disbanded + /// Wipes everything related to a guild. Used when that guild is disbanded void DeleteGuild(uint32 guildId); /** diff --git a/src/server/game/Handlers/GuildFinderHandler.cpp b/src/server/game/Handlers/GuildFinderHandler.cpp index c017a10ca1a..d43c4eb86ca 100644 --- a/src/server/game/Handlers/GuildFinderHandler.cpp +++ b/src/server/game/Handlers/GuildFinderHandler.cpp @@ -64,7 +64,7 @@ void WorldSession::HandleGuildFinderAddRecruit(WorldPacket& recvPacket) return; if (!(classRoles & GUILDFINDER_ALL_ROLES) || classRoles > GUILDFINDER_ALL_ROLES) return; - if (!(availability & ALL_WEEK) || availability > ALL_WEEK) + if (!(availability & AVAILABILITY_ALWAYS) || availability > AVAILABILITY_ALWAYS) return; if (!(guildInterests & ALL_INTERESTS) || guildInterests > ALL_INTERESTS) return; @@ -85,7 +85,7 @@ void WorldSession::HandleGuildFinderBrowse(WorldPacket& recvPacket) if (!(classRoles & GUILDFINDER_ALL_ROLES) || classRoles > GUILDFINDER_ALL_ROLES) return; - if (!(availability & ALL_WEEK) || availability > ALL_WEEK) + if (!(availability & AVAILABILITY_ALWAYS) || availability > AVAILABILITY_ALWAYS) return; if (!(guildInterests & ALL_INTERESTS) || guildInterests > ALL_INTERESTS) return; @@ -421,7 +421,7 @@ void WorldSession::HandleGuildFinderSetGuildPost(WorldPacket& recvPacket) if (!(classRoles & GUILDFINDER_ALL_ROLES) || classRoles > GUILDFINDER_ALL_ROLES) return; - if (!(availability & ALL_WEEK) || availability > ALL_WEEK) + if (!(availability & AVAILABILITY_ALWAYS) || availability > AVAILABILITY_ALWAYS) return; if (!(guildInterests & ALL_INTERESTS) || guildInterests > ALL_INTERESTS) return; -- cgit v1.2.3 From 6b668c8337d2efe306ad4c5a1d0ade6e34b5d66d Mon Sep 17 00:00:00 2001 From: Spp Date: Wed, 2 Jan 2013 13:31:19 +0100 Subject: Core/Misc: Update headers to 2013 --- src/server/game/Battlegrounds/Zones/BattlegroundBFG.cpp | 2 +- src/server/game/Battlegrounds/Zones/BattlegroundBFG.h | 2 +- src/server/game/Battlegrounds/Zones/BattlegroundTP.cpp | 2 +- src/server/game/Battlegrounds/Zones/BattlegroundTP.h | 2 +- src/server/game/Guilds/GuildFinderMgr.cpp | 2 +- src/server/game/Guilds/GuildFinderMgr.h | 2 +- src/server/game/Handlers/GuildFinderHandler.cpp | 2 +- src/server/game/Handlers/VoidStorageHandler.cpp | 2 +- src/server/game/Maps/PhaseMgr.cpp | 2 +- src/server/game/Maps/PhaseMgr.h | 2 +- src/server/game/Movement/MovementStructures.h | 2 +- src/server/game/Movement/Spline/MovementPacketBuilder.cpp | 2 +- src/server/game/Movement/Spline/MovementPacketBuilder.h | 2 +- src/server/game/Server/WorldPacket.cpp | 2 +- .../scripts/EasternKingdoms/ZulGurub/boss_jindo_the_godbreaker.cpp | 2 +- src/server/scripts/EasternKingdoms/ZulGurub/boss_kilnara.cpp | 2 +- src/server/scripts/EasternKingdoms/ZulGurub/boss_zanzil.cpp | 2 +- src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp | 2 +- .../scripts/Kalimdor/HallsOfOrigination/boss_temple_guardian_anhuur.cpp | 2 +- src/server/scripts/Kalimdor/HallsOfOrigination/halls_of_origination.h | 2 +- .../Kalimdor/HallsOfOrigination/instance_halls_of_origination.cpp | 2 +- 21 files changed, 21 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundBFG.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundBFG.cpp index 52af3e23e11..d067967e682 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundBFG.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundBFG.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore + * Copyright (C) 2008-2013 TrinityCore * * 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 diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundBFG.h b/src/server/game/Battlegrounds/Zones/BattlegroundBFG.h index 35c9bef8b17..088fe3bc142 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundBFG.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundBFG.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore + * Copyright (C) 2008-2013 TrinityCore * * 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 diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundTP.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundTP.cpp index 5a19dff589f..05fbc723cac 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundTP.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundTP.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore + * Copyright (C) 2008-2013 TrinityCore * * 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 diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundTP.h b/src/server/game/Battlegrounds/Zones/BattlegroundTP.h index 45be413e5cf..c5706fd7ccc 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundTP.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundTP.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore + * Copyright (C) 2008-2013 TrinityCore * * 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 diff --git a/src/server/game/Guilds/GuildFinderMgr.cpp b/src/server/game/Guilds/GuildFinderMgr.cpp index 461c3093cd4..1f9030b94ae 100644 --- a/src/server/game/Guilds/GuildFinderMgr.cpp +++ b/src/server/game/Guilds/GuildFinderMgr.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore + * Copyright (C) 2008-2013 TrinityCore * * 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 diff --git a/src/server/game/Guilds/GuildFinderMgr.h b/src/server/game/Guilds/GuildFinderMgr.h index 691132512d1..d101c91e97c 100644 --- a/src/server/game/Guilds/GuildFinderMgr.h +++ b/src/server/game/Guilds/GuildFinderMgr.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore + * Copyright (C) 2008-2013 TrinityCore * * 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 diff --git a/src/server/game/Handlers/GuildFinderHandler.cpp b/src/server/game/Handlers/GuildFinderHandler.cpp index d43c4eb86ca..c374aa635ab 100644 --- a/src/server/game/Handlers/GuildFinderHandler.cpp +++ b/src/server/game/Handlers/GuildFinderHandler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore + * Copyright (C) 2008-2013 TrinityCore * * 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 diff --git a/src/server/game/Handlers/VoidStorageHandler.cpp b/src/server/game/Handlers/VoidStorageHandler.cpp index 1310a65d179..52fbaaf43e2 100644 --- a/src/server/game/Handlers/VoidStorageHandler.cpp +++ b/src/server/game/Handlers/VoidStorageHandler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore + * Copyright (C) 2008-2013 TrinityCore * * 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 diff --git a/src/server/game/Maps/PhaseMgr.cpp b/src/server/game/Maps/PhaseMgr.cpp index 9949ee5bdd4..2bb4ed0fb8c 100644 --- a/src/server/game/Maps/PhaseMgr.cpp +++ b/src/server/game/Maps/PhaseMgr.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore + * Copyright (C) 2008-2013 TrinityCore * * 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 diff --git a/src/server/game/Maps/PhaseMgr.h b/src/server/game/Maps/PhaseMgr.h index 2fdf8eb5e7f..bf3da7b4cb7 100644 --- a/src/server/game/Maps/PhaseMgr.h +++ b/src/server/game/Maps/PhaseMgr.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore + * Copyright (C) 2008-2013 TrinityCore * * 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 diff --git a/src/server/game/Movement/MovementStructures.h b/src/server/game/Movement/MovementStructures.h index 29b7fb5dfe6..9a92e9747f1 100644 --- a/src/server/game/Movement/MovementStructures.h +++ b/src/server/game/Movement/MovementStructures.h @@ -1,5 +1,5 @@ /* -* Copyright (C) 2008-2012 TrinityCore +* Copyright (C) 2008-2013 TrinityCore * Copyright (C) 2005-2009 MaNGOS * * This program is free software; you can redistribute it and/or modify it diff --git a/src/server/game/Movement/Spline/MovementPacketBuilder.cpp b/src/server/game/Movement/Spline/MovementPacketBuilder.cpp index d840302365f..f2dc8897532 100644 --- a/src/server/game/Movement/Spline/MovementPacketBuilder.cpp +++ b/src/server/game/Movement/Spline/MovementPacketBuilder.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore + * Copyright (C) 2008-2013 TrinityCore * Copyright (C) 2005-2011 MaNGOS * * This program is free software; you can redistribute it and/or modify diff --git a/src/server/game/Movement/Spline/MovementPacketBuilder.h b/src/server/game/Movement/Spline/MovementPacketBuilder.h index 24b355924c8..fb6d0f435a0 100644 --- a/src/server/game/Movement/Spline/MovementPacketBuilder.h +++ b/src/server/game/Movement/Spline/MovementPacketBuilder.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore + * Copyright (C) 2008-2013 TrinityCore * Copyright (C) 2005-2011 MaNGOS * * This program is free software; you can redistribute it and/or modify diff --git a/src/server/game/Server/WorldPacket.cpp b/src/server/game/Server/WorldPacket.cpp index 81203edba05..af8e6bd5f1a 100644 --- a/src/server/game/Server/WorldPacket.cpp +++ b/src/server/game/Server/WorldPacket.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore + * Copyright (C) 2008-2013 TrinityCore * * 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 diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo_the_godbreaker.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo_the_godbreaker.cpp index bcf742fcf32..f4083337f56 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo_the_godbreaker.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo_the_godbreaker.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore + * Copyright (C) 2008-2013 TrinityCore * * 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 diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_kilnara.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_kilnara.cpp index f582edd54db..36689c89f06 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_kilnara.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_kilnara.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore + * Copyright (C) 2008-2013 TrinityCore * * 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 diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_zanzil.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_zanzil.cpp index 00b8c8747f6..6b6aa727848 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_zanzil.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_zanzil.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore + * Copyright (C) 2008-2013 TrinityCore * * 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 diff --git a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp index 63ee95cb3de..659350caa6d 100644 --- a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp +++ b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore + * Copyright (C) 2008-2013 TrinityCore * * 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 diff --git a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_temple_guardian_anhuur.cpp b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_temple_guardian_anhuur.cpp index d4f9593df03..aec5f7416c6 100644 --- a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_temple_guardian_anhuur.cpp +++ b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_temple_guardian_anhuur.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore + * Copyright (C) 2008-2013 TrinityCore * * 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 diff --git a/src/server/scripts/Kalimdor/HallsOfOrigination/halls_of_origination.h b/src/server/scripts/Kalimdor/HallsOfOrigination/halls_of_origination.h index 8bdd4a16c9e..3258df45a0b 100644 --- a/src/server/scripts/Kalimdor/HallsOfOrigination/halls_of_origination.h +++ b/src/server/scripts/Kalimdor/HallsOfOrigination/halls_of_origination.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore + * Copyright (C) 2008-2013 TrinityCore * * 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 diff --git a/src/server/scripts/Kalimdor/HallsOfOrigination/instance_halls_of_origination.cpp b/src/server/scripts/Kalimdor/HallsOfOrigination/instance_halls_of_origination.cpp index 726ecbacd2e..e5ef556003f 100644 --- a/src/server/scripts/Kalimdor/HallsOfOrigination/instance_halls_of_origination.cpp +++ b/src/server/scripts/Kalimdor/HallsOfOrigination/instance_halls_of_origination.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2012 TrinityCore + * Copyright (C) 2008-2013 TrinityCore * * 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 -- cgit v1.2.3 From aa43ecd18d9f434392d08f215182c73815f8c0da Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Thu, 3 Jan 2013 16:58:38 +0100 Subject: Core/Spells: Removed no fly zone for dalaran --- .../world/2013_01_03_00_world_spell_area_434.sql | 1 + src/server/game/Spells/Auras/SpellAuraEffects.cpp | 1 - src/server/game/Spells/SpellEffects.cpp | 1 - src/server/game/Spells/SpellMgr.cpp | 38 ++++++++-------------- 4 files changed, 14 insertions(+), 27 deletions(-) create mode 100644 sql/updates/world/2013_01_03_00_world_spell_area_434.sql (limited to 'src') diff --git a/sql/updates/world/2013_01_03_00_world_spell_area_434.sql b/sql/updates/world/2013_01_03_00_world_spell_area_434.sql new file mode 100644 index 00000000000..207b51f9f7b --- /dev/null +++ b/sql/updates/world/2013_01_03_00_world_spell_area_434.sql @@ -0,0 +1 @@ +DELETE FROM `spell_area` WHERE `spell`=58600; -- Restricted Flight Area (Dalaran) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index a8469518aa8..c792446e8db 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -4988,7 +4988,6 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool case 60244: // Blood Parrot Despawn Aura target->CastSpell((Unit*)NULL, GetAmount(), true, NULL, this); break; - case 58600: // Restricted Flight Area case 58730: // Restricted Flight Area if (aurApp->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE) target->CastSpell(target, 58601, true); diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index a487ec586b3..18f10fd92b5 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -5866,7 +5866,6 @@ void Spell::EffectPlayerNotification(SpellEffIndex effIndex) switch (m_spellInfo->Id) { case 58730: // Restricted Flight Area - case 58600: // Restricted Flight Area unitTarget->ToPlayer()->GetSession()->SendNotification(LANG_ZONE_NOFLYZONE); unitTarget->PlayDirectSound(9417); // Fel Reaver sound break; diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 6d7ae103467..7f0c0976569 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -1114,18 +1114,6 @@ bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32 // Extra conditions -- leaving the possibility add extra conditions... switch (spellId) { - case 58600: // No fly Zone - Dalaran - { - if (!player) - return false; - - AreaTableEntry const* pArea = GetAreaEntryByAreaID(player->GetAreaId()); - if (!(pArea && pArea->flags & AREA_FLAG_NO_FLY_ZONE)) - return false; - if (!player->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) && !player->HasAuraType(SPELL_AURA_FLY)) - return false; - break; - } case 58730: // No fly Zone - Wintergrasp { if (!player) @@ -1153,24 +1141,24 @@ bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32 } case 56618: // Horde Controls Factory Phase Shift case 56617: // Alliance Controls Factory Phase Shift - { - if (!player) - return false; + { + if (!player) + return false; - Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(player->GetZoneId()); + Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(player->GetZoneId()); - if (!bf || bf->GetTypeId() != BATTLEFIELD_WG) - return false; + if (!bf || bf->GetTypeId() != BATTLEFIELD_WG) + return false; - // team that controls the workshop in the specified area - uint32 team = bf->GetData(newArea); + // team that controls the workshop in the specified area + uint32 team = bf->GetData(newArea); - if (team == TEAM_HORDE) - return spellId == 56618; - else if (team == TEAM_ALLIANCE) - return spellId == 56617; - } + if (team == TEAM_HORDE) + return spellId == 56618; + else if (team == TEAM_ALLIANCE) + return spellId == 56617; break; + } case 57940: // Essence of Wintergrasp - Northrend case 58045: // Essence of Wintergrasp - Wintergrasp { -- cgit v1.2.3 From eba9abd2ee552859d5f63127e1d13b78e48dba7f Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Thu, 3 Jan 2013 17:37:39 +0100 Subject: Core/Spells: Update no fly zone for wintergrasp --- sql/updates/world/2013_01_03_01_world_spell_area_434.sql | 13 +++++++++++++ src/server/game/Battlefield/Zones/BattlefieldWG.h | 2 +- src/server/game/Miscellaneous/SharedDefines.h | 2 +- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 2 +- src/server/game/Spells/SpellEffects.cpp | 13 +++++++------ src/server/game/Spells/SpellInfo.cpp | 2 +- src/server/game/Spells/SpellMgr.cpp | 2 +- 7 files changed, 25 insertions(+), 11 deletions(-) create mode 100644 sql/updates/world/2013_01_03_01_world_spell_area_434.sql (limited to 'src') diff --git a/sql/updates/world/2013_01_03_01_world_spell_area_434.sql b/sql/updates/world/2013_01_03_01_world_spell_area_434.sql new file mode 100644 index 00000000000..2eb36926193 --- /dev/null +++ b/sql/updates/world/2013_01_03_01_world_spell_area_434.sql @@ -0,0 +1,13 @@ +DELETE FROM `spell_area` WHERE `spell`=91604; +INSERT INTO `spell_area` (`spell`, `area`, `quest_start`, `quest_end`, `aura_spell`, `racemask`, `gender`, `autocast`, `quest_start_status`, `quest_end_status`) VALUES +(91604, 4197, 0, 0, 0, 0, 2, 1, 64, 11), +(91604, 4538, 0, 0, 0, 0, 2, 1, 64, 11), +(91604, 4539, 0, 0, 0, 0, 2, 1, 64, 11), +(91604, 4575, 0, 0, 0, 0, 2, 1, 64, 11), +(91604, 4577, 0, 0, 0, 0, 2, 1, 64, 11), +(91604, 4581, 0, 0, 0, 0, 2, 1, 64, 11), +(91604, 4582, 0, 0, 0, 0, 2, 1, 64, 11), +(91604, 4583, 0, 0, 0, 0, 2, 1, 64, 11), +(91604, 4585, 0, 0, 0, 0, 2, 1, 64, 11), +(91604, 4589, 0, 0, 0, 0, 2, 1, 64, 11), +(91604, 4612, 0, 0, 0, 0, 2, 1, 64, 11); diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.h b/src/server/game/Battlefield/Zones/BattlefieldWG.h index f313357e323..422518632f4 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldWG.h +++ b/src/server/game/Battlefield/Zones/BattlefieldWG.h @@ -76,7 +76,7 @@ enum WintergraspSpells // Other spells SPELL_WINTERGRASP_WATER = 36444, SPELL_ESSENCE_OF_WINTERGRASP = 58045, - SPELL_WINTERGRASP_RESTRICTED_FLIGHT_AREA = 58730, + SPELL_WINTERGRASP_RESTRICTED_FLIGHT_AREA = 91604, // Phasing spells SPELL_HORDE_CONTROLS_FACTORY_PHASE_SHIFT = 56618, // ADDS PHASE 16 diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index a68a8ca1729..221fd1c8dcc 100644 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -911,7 +911,7 @@ enum SpellEffects SPELL_EFFECT_APPLY_AREA_AURA_FRIEND = 128, SPELL_EFFECT_APPLY_AREA_AURA_ENEMY = 129, SPELL_EFFECT_REDIRECT_THREAT = 130, - SPELL_EFFECT_131 = 131, + SPELL_EFFECT_PLAYER_NOTIFICATION = 131, SPELL_EFFECT_PLAY_MUSIC = 132, SPELL_EFFECT_UNLEARN_SPECIALIZATION = 133, SPELL_EFFECT_KILL_CREDIT2 = 134, diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index c792446e8db..43e8c2be05a 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -4988,7 +4988,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool case 60244: // Blood Parrot Despawn Aura target->CastSpell((Unit*)NULL, GetAmount(), true, NULL, this); break; - case 58730: // Restricted Flight Area + case 91604: // Restricted Flight Area if (aurApp->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE) target->CastSpell(target, 58601, true); break; diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 18f10fd92b5..6c28633857c 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -5865,22 +5865,23 @@ void Spell::EffectPlayerNotification(SpellEffIndex effIndex) switch (m_spellInfo->Id) { - case 58730: // Restricted Flight Area + case 91604: // Restricted Flight Area unitTarget->ToPlayer()->GetSession()->SendNotification(LANG_ZONE_NOFLYZONE); - unitTarget->PlayDirectSound(9417); // Fel Reaver sound + break; + default: break; } - uint32 soundid = m_spellInfo->Effects[effIndex].MiscValue; + uint32 soundId = m_spellInfo->Effects[effIndex].MiscValue; - if (!sSoundEntriesStore.LookupEntry(soundid)) + if (!sSoundEntriesStore.LookupEntry(soundId)) { - sLog->outError(LOG_FILTER_SPELLS_AURAS, "EffectPlayerNotification: Sound (Id: %u) not exist in spell %u.", soundid, m_spellInfo->Id); + sLog->outError(LOG_FILTER_SPELLS_AURAS, "EffectPlayerNotification: Sound (Id: %u) not exist in spell %u.", soundId, m_spellInfo->Id); return; } WorldPacket data(SMSG_PLAY_SOUND, 4); - data << uint32(soundid); + data << uint32(soundId); unitTarget->ToPlayer()->GetSession()->SendPacket(&data); } diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index a602167314c..3cb8d16811e 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -755,7 +755,7 @@ SpellEffectInfo::StaticData SpellEffectInfo::_data[TOTAL_SPELL_EFFECTS] = {EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT}, // 128 SPELL_EFFECT_APPLY_AREA_AURA_FRIEND {EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT}, // 129 SPELL_EFFECT_APPLY_AREA_AURA_ENEMY {EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT}, // 130 SPELL_EFFECT_REDIRECT_THREAT - {EFFECT_IMPLICIT_TARGET_NONE, TARGET_OBJECT_TYPE_UNIT}, // 131 SPELL_EFFECT_131 + {EFFECT_IMPLICIT_TARGET_NONE, TARGET_OBJECT_TYPE_UNIT}, // 131 SPELL_EFFECT_PLAYER_NOTIFICATION {EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT}, // 132 SPELL_EFFECT_PLAY_MUSIC {EFFECT_IMPLICIT_TARGET_EXPLICIT, TARGET_OBJECT_TYPE_UNIT}, // 133 SPELL_EFFECT_UNLEARN_SPECIALIZATION {EFFECT_IMPLICIT_TARGET_NONE, TARGET_OBJECT_TYPE_UNIT}, // 134 SPELL_EFFECT_KILL_CREDIT2 diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 7f0c0976569..d05fb243fa2 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -1114,7 +1114,7 @@ bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32 // Extra conditions -- leaving the possibility add extra conditions... switch (spellId) { - case 58730: // No fly Zone - Wintergrasp + case 91604: // No fly Zone - Wintergrasp { if (!player) return false; -- cgit v1.2.3 From f6ee4e37690e8e4dbbb3d2ede3143104c2036616 Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Thu, 3 Jan 2013 18:15:23 +0100 Subject: Core: Fix build --- src/server/game/Achievements/AchievementMgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 31bb2e63cbd..a861e88c18f 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -1846,7 +1846,7 @@ template<> void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement, Player* referencePlayer) { sLog->outInfo(LOG_FILTER_ACHIEVEMENTSYS, "AchievementMgr::CompletedAchievement(%u). Player: %s (%u)", - achievement->ID, m_player->GetName().c_str(), m_player->GetGUIDLow()); + achievement->ID, GetOwner()->GetName().c_str(), GetOwner()->GetGUIDLow()); // disable for gamemasters with GM-mode enabled if (GetOwner()->isGameMaster()) -- cgit v1.2.3 From a28d2d22f3899208554332882d64543abdd1e1dc Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Thu, 3 Jan 2013 23:40:12 +0100 Subject: Core: Fix non pch build --- src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp | 1 + src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp | 1 + 2 files changed, 2 insertions(+) (limited to 'src') diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp index 74ded63d692..db34d22ff4e 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp @@ -21,6 +21,7 @@ #include "SpellScript.h" #include "SpellAuraEffects.h" #include "Player.h" +#include "GridNotifiers.h" #include "zulgurub.h" enum Yells diff --git a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp index 659350caa6d..cba0ea0b61c 100644 --- a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp +++ b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp @@ -22,6 +22,7 @@ #include "SpellAuraEffects.h" #include "Player.h" #include "Weather.h" +#include "WorldSession.h" #include "halls_of_origination.h" enum Texts -- cgit v1.2.3 From 0f71fd8e23b158df64c9cc871ee5d32647c06f34 Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Thu, 3 Jan 2013 23:48:50 +0100 Subject: Core: Fix build --- src/server/scripts/Commands/cs_reload.cpp | 8 -------- 1 file changed, 8 deletions(-) (limited to 'src') diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp index 16fe5991461..f5f998bbf0d 100644 --- a/src/server/scripts/Commands/cs_reload.cpp +++ b/src/server/scripts/Commands/cs_reload.cpp @@ -929,14 +929,6 @@ public: return true; } - static bool HandleReloadItemSetNamesCommand(ChatHandler* handler, const char* /*args*/) - { - sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Item set names..."); - sObjectMgr->LoadItemSetNames(); - handler->SendGlobalGMSysMessage("DB table `item_set_names` reloaded."); - return true; - } - static bool HandleReloadEventScriptsCommand(ChatHandler* handler, const char* args) { if (sScriptMgr->IsScriptScheduled()) -- cgit v1.2.3 From bb1c955c8b63399e8a62154152cfa1d4bcb6d24a Mon Sep 17 00:00:00 2001 From: Subv Date: Fri, 4 Jan 2013 18:06:55 -0500 Subject: Scripts/HallsOfOrigination: Added script for Anraphet and the Vault of Lights. Some bugs might still remain. Crumbling Ruin spell has a problem with radius handling. --- ...013_01_04_00_world_halls_of_origination_434.sql | 51 ++ src/server/game/Scripting/ScriptLoader.cpp | 2 + src/server/game/Spells/SpellMgr.cpp | 5 - src/server/scripts/Kalimdor/CMakeLists.txt | 1 + .../Kalimdor/HallsOfOrigination/boss_anraphet.cpp | 571 +++++++++++++++++++++ .../HallsOfOrigination/boss_earthrager_ptah.cpp | 46 -- .../HallsOfOrigination/halls_of_origination.h | 49 +- .../instance_halls_of_origination.cpp | 113 +++- 8 files changed, 780 insertions(+), 58 deletions(-) create mode 100644 sql/updates/world/2013_01_04_00_world_halls_of_origination_434.sql create mode 100644 src/server/scripts/Kalimdor/HallsOfOrigination/boss_anraphet.cpp (limited to 'src') diff --git a/sql/updates/world/2013_01_04_00_world_halls_of_origination_434.sql b/sql/updates/world/2013_01_04_00_world_halls_of_origination_434.sql new file mode 100644 index 00000000000..36df0da72ca --- /dev/null +++ b/sql/updates/world/2013_01_04_00_world_halls_of_origination_434.sql @@ -0,0 +1,51 @@ +UPDATE `creature_template` SET `ScriptName`="npc_brann_bronzebeard_anraphet" WHERE `entry`=39908; +DELETE FROM `creature_text` WHERE `entry`=39908; +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES +(39908, 0, 0, 'Right, let''s go! Just need to input the final entry sequence into the door mechanism... and...', 12, 0, 100, 5, 0, 20897, 'Brann Bronzebeard'), +(39908, 1, 0, 'That did the trick! The control room should be right behind this... oh... wow...', 12, 0, 100, 5, 0, 20898, 'Brann Bronzebeard'), +(39908, 2, 0, 'What? This isn''t the control room! There''s another entire defense mechanism in place, and the blasted Rock Troggs broke into here somehow. Troggs. Why did it have to be Troggs!', 12, 0, 100, 5, 0, 20899, 'Brann Bronzebeard'), +(39908, 3, 0, 'Ok, let me think a moment.', 12, 0, 100, 1, 0, 20900, 'Brann Bronzebeard'), +(39908, 4, 0, 'Mirrors pointing all over the place.', 12, 0, 100, 25, 0, 20902, 'Brann Bronzebeard'), +(39908, 5, 0, 'Four platforms with huge elementals.', 12, 0, 100, 25, 0, 20901, 'Brann Bronzebeard'), +(39908, 6, 0, 'I got it! I saw a tablet that mentioned this chamber. This is the Vault of Lights! Ok, simple enough. I need you adventurers to take out each of the four elementals to trigger the opening sequence for the far door!', 12, 0, 100, 5, 0, 20903, 'Brann Bronzebeard'), +(39908, 7, 0, 'One down!', 14, 0, 100, 5, 0, 20904, 'Brann Bronzebeard'), +(39908, 8, 0, 'Another one down! Just look at those light beams! They seem to be connecting to the far door!', 14, 0, 100, 5, 0, 20905, 'Brann Bronzebeard'), +(39908, 9, 0, 'One more elemental to go! The door is almost open!', 14, 0, 100, 5, 0, 20906, 'Brann Bronzebeard'), +(39908, 10, 0, 'That''s it, you''ve done it! The vault door is opening! Now we can... oh, no!', 14, 0, 100, 5, 0, 20907, 'Brann Bronzebeard'), +(39908, 11, 0, 'We''ve done it! The control room is breached!', 14, 0, 100, 5, 0, 23709, 'Brann Bronzebeard'), +(39908, 12, 0, 'Here we go! Now this should only take a moment...', 14, 0, 100, 5, 0, 23710, 'Brann Bronzebeard'); + +UPDATE `creature_template` SET `ScriptName`="boss_anraphet" WHERE `entry`=39788; +DELETE FROM `creature_text` WHERE `entry`=39788; +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES +(39788, 0, 0, 'This unit has been activated outside normal operating protocols. Downloading new operational parameters. Download complete. Full unit self defense routines are now active. Destruction of foreign units in the system shall now commence.', 14, 0, 100, 0, 0, 20857, 'Anraphet - SAY_INTRO'), +(39788, 1, 0, 'Purge of unauthorized entities commencing.', 14, 0, 100, 0, 0, 20862, 'Anraphet - SAY_AGGRO'), +(39788, 2, 0, 'Omega Stance activated. Annihilation of foreign unit is now imminent.', 14, 0, 100, 0, 0, 20861, 'Anraphet - SAY_OMEGA_STANCE'), +(39788, 3, 0, 'Purge Complete.', 14, 0, 100, 0, 0, 20859, 'Anraphet - SAY_PLAYER_KILL'), +(39788, 3, 1, 'Target Annihilated.', 14, 0, 100, 0, 0, 20858, 'Anraphet - SAY_PLAYER_KILL'), +(39788, 4, 0, 'Anraphet unit shutting down...', 14, 0, 100, 0, 0, 20856, 'Anraphet - SAY_DEATH'); + +DELETE FROM `spell_script_names` WHERE `spell_id` IN (76904,77106,77127); +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(76904,'spell_anraphet_alpha_beams'), +(77106,'spell_anraphet_omega_stance_summon'), +(77127,'spell_omega_stance_spider_effect'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup` IN (11339,11348,12512); +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=11339; +INSERT INTO `conditions`(`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14, 11339, 15794, 0, 0, 13, 1, 2, 3, 2, 1, 0, 0, '', 'Brann Bronzebeard gossip menu - Show only if DATA_VAULT_OF_LIGHTS is not done'), +(14, 11348, 15815, 0, 0, 13, 1, 18, 4, 0, 1, 0, 0, '', 'Brann Bronzebeard gossip menu - Show only if DATA_DEAD_ELEMENTALS is less than 4'), +(14, 12512, 17600, 0, 0, 13, 1, 18, 4, 0, 0, 0, 0, '', 'Brann Bronzebeard gossip menu - Show only if DATA_DEAD_ELEMENTALS is 4'), +(15, 11339, 0, 0, 0, 13, 1, 2, 3, 2, 1, 0, 0, '', 'Brann Bronzebeard gossip menu option - Show only if DATA_VAULT_OF_LIGHTS is not done'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=77437; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(13, 6, 77437, 0, 0, 31, 0, 3, 39804, 0, 0, 0, 0, '', 'Destruction Protocol - Stone Trogg Pillager'), +(13, 6, 77437, 0, 1, 31, 0, 3, 40252, 0, 0, 0, 0, '', 'Destruction Protocol - Stone Trogg Rock Flinger'), +(13, 6, 77437, 0, 2, 31, 0, 3, 40251, 0, 0, 0, 0, '', 'Destruction Protocol - Stone Trogg Brute'); + +UPDATE `creature_template` SET `ScriptName`='npc_alpha_beam' WHERE `entry`=41144; +UPDATE `creature_template` SET `ScriptName`='npc_omega_stance' WHERE `entry`=41194; + +DELETE FROM `spell_script_names` WHERE `spell_id`=94974; diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index 33fd43a86d5..570fe23478f 100644 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -331,6 +331,7 @@ void AddSC_instance_zulfarrak(); //Zul'Farrak instance script void AddSC_instance_halls_of_origination(); void AddSC_boss_temple_guardian_anhuur(); void AddSC_boss_earthrager_ptah(); +void AddSC_boss_anraphet(); void AddSC_ashenvale(); void AddSC_azshara(); @@ -989,6 +990,7 @@ void AddKalimdorScripts() AddSC_instance_halls_of_origination(); AddSC_boss_temple_guardian_anhuur(); AddSC_boss_earthrager_ptah(); + AddSC_boss_anraphet(); #endif } diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index d05fb243fa2..69270c1ed4b 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -3624,11 +3624,6 @@ void SpellMgr::LoadSpellInfoCorrections() // Aura is refreshed at 3 seconds, and the tick should happen at the fourth. spellInfo->AttributesEx8 |= SPELL_ATTR8_DONT_RESET_PERIODIC_TIMER; break; - // Earthrager Ptah - case 94974: - // Hacked as a timed event until SPELL_EFFECT_TRIGGER_MISSILE is correctly fixed. - spellInfo->Effects[EFFECT_0].TriggerSpell = 0; - break; default: break; } diff --git a/src/server/scripts/Kalimdor/CMakeLists.txt b/src/server/scripts/Kalimdor/CMakeLists.txt index 4c22cdd080b..fc75444bda6 100644 --- a/src/server/scripts/Kalimdor/CMakeLists.txt +++ b/src/server/scripts/Kalimdor/CMakeLists.txt @@ -115,6 +115,7 @@ set(scripts_STAT_SRCS Kalimdor/HallsOfOrigination/instance_halls_of_origination.cpp Kalimdor/HallsOfOrigination/boss_temple_guardian_anhuur.cpp Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp + Kalimdor/HallsOfOrigination/boss_anraphet.cpp ) message(" -> Prepared: Kalimdor") diff --git a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_anraphet.cpp b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_anraphet.cpp new file mode 100644 index 00000000000..490c0a77494 --- /dev/null +++ b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_anraphet.cpp @@ -0,0 +1,571 @@ +/* + * Copyright (C) 2008-2012 TrinityCore + * + * 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; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; 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, see . + */ + +#include "ObjectMgr.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "SpellScript.h" +#include "SpellAuraEffects.h" +#include "GridNotifiers.h" +#include "Player.h" +#include "ObjectAccessor.h" +#include "halls_of_origination.h" + +enum Texts +{ + ANRAPHET_SAY_INTRO = 0, + ANRAPHET_SAY_AGGRO = 1, + ANRAPHET_SAY_OMEGA_STANCE = 2, + ANRAPHET_SAY_KILL = 3, + ANRAPHET_SAY_DEATH = 4, + + BRANN_SAY_DOOR_INTRO = 0, // Right, let's go! Just need to input the final entry sequence into the door mechanism... and... + BRANN_SAY_UNLOCK_DOOR = 1, // That did the trick! The control room should be right behind this... oh... wow... + BRANN_SAY_TROGGS = 2, // What? This isn't the control room! There's another entire defense mechanism in place, and the blasted Rock Troggs broke into here somehow. Troggs. Why did it have to be Troggs! + BRANN_SAY_THINK = 3, // Ok, let me think a moment. + BRANN_SAY_MIRRORS = 4, // Mirrors pointing all over the place. + BRANN_SAY_ELEMENTALS = 5, // Four platforms with huge elementals. + BRANN_SAY_GET_IT = 6, // I got it! I saw a tablet that mentioned this chamber. This is the Vault of Lights! Ok, simple enough. I need you adventurers to take out each of the four elementals to trigger the opening sequence for the far door! + BRANN_1_ELEMENTAL_DEAD = 7, // One down! + BRANN_2_ELEMENTAL_DEAD = 8, // Another one down! Just look at those light beams! They seem to be connecting to the far door! + BRANN_3_ELEMENTAL_DEAD = 9, // One more elemental to go! The door is almost open! + BRANN_4_ELEMENTAL_DEAD = 10, // That''s it, you''ve done it! The vault door is opening! Now we can... oh, no! + BRANN_SAY_ANRAPHET_DIED = 11, // We''ve done it! The control room is breached! + BRANN_SAY_MOMENT = 12 // Here we go! Now this should only take a moment... +}; + +enum Events +{ + EVENT_BRANN_MOVE_INTRO = 1, + EVENT_BRANN_UNLOCK_DOOR = 2, + EVENT_BRANN_THINK = 3, + EVENT_BRANN_SET_ORIENTATION_1 = 4, + EVENT_BRANN_SET_ORIENTATION_2 = 5, + EVENT_BRANN_SET_ORIENTATION_3 = 6, + EVENT_BRANN_SAY_ELEMENTALS = 7, + EVENT_BRANN_SAY_GET_IT = 8, + EVENT_BRANN_SET_ORIENTATION_4 = 9, + + EVENT_ANRAPHET_APPEAR = 10, + EVENT_ANRAPHET_ACTIVATE = 11, + EVENT_ANRAPHET_DESTROY = 12, + EVENT_ANRAPHET_READY = 13, + EVENT_ANRAPHET_NEMESIS_STRIKE = 14, + EVENT_ANRAPHET_ALPHA_BEAMS = 15, + EVENT_ANRAPHET_OMEGA_STANCE = 16, + EVENT_ANRAPHET_CRUMBLING_RUIN = 17, + EVENT_ANRAPHET_ACTIVATE_OMEGA = 18 +}; + +enum Spells +{ + SPELL_DESTRUCTION_PROTOCOL = 77437, + + SPELL_ALPHA_BEAMS = 76184, + SPELL_ALPHA_BEAMS_BACK_CAST = 76912, + + SPELL_CRUMBLING_RUIN = 75609, + + + SPELL_NEMESIS_STRIKE = 75604, + + SPELL_OMEGA_STANCE_SUMMON = 77106, + SPELL_OMEGA_STANCE = 75622, + SPELL_OMEGA_STANCE_SPIDER_TRIGGER = 77121, +}; + +enum Phases +{ + PHASE_INTRO = 1, + PHASE_COMBAT = 2, + + PHASE_MASK_COMBAT = (1 << PHASE_COMBAT), +}; + +enum Points +{ + POINT_ANRAPHET_ACTIVATE = 0, + MAX_BRANN_WAYPOINTS_INTRO = 17 +}; + +Position const AnraphetActivatePos = {-193.656f, 366.689f, 75.91001f, 3.138207f}; + +Position const BrannIntroWaypoint[MAX_BRANN_WAYPOINTS_INTRO] = +{ + {-429.583f, 367.019f, 89.79282f, 0.0f}, + {-409.9531f, 367.0469f, 89.81111f, 0.0f}, + {-397.8246f, 366.967f, 86.37722f, 0.0f}, + {-383.7813f, 366.8229f, 82.07919f, 0.0f}, + {-368.2604f, 366.7448f, 77.0984f, 0.0f}, + {-353.6458f, 366.4896f, 75.92504f, 0.0f}, + {-309.0608f, 366.7205f, 75.91345f, 0.0f}, + {-276.3303f, 367.0f, 75.92413f, 0.0f}, + {-246.5104f, 366.6389f, 75.87791f, 0.0f}, + {-202.0417f, 366.7517f, 75.92508f, 0.0f}, + {-187.6024f, 366.7656f, 76.23077f, 0.0f}, + {-155.0938f, 366.783f, 86.45834f, 0.0f}, + {-143.5694f, 366.8177f, 89.73354f, 0.0f}, + {-128.5608f, 366.8629f, 89.74199f, 0.0f}, + {-103.559f, 366.5938f, 89.79725f, 0.0f}, + {-71.58507f, 367.0278f, 89.77069f, 0.0f}, + {-35.04861f, 366.6563f, 89.77447f, 0.0f}, +}; + +class boss_anraphet : public CreatureScript +{ +public: + boss_anraphet() : CreatureScript("boss_anraphet") { } + + struct boss_anraphetAI : public BossAI + { + boss_anraphetAI(Creature* creature) : BossAI(creature, DATA_ANRAPHET) { } + + void ScheduleCombatEvents() + { + events.ScheduleEvent(EVENT_ANRAPHET_NEMESIS_STRIKE, 8000, 0, PHASE_COMBAT); + events.ScheduleEvent(EVENT_ANRAPHET_ALPHA_BEAMS, 10000, 0, PHASE_COMBAT); + events.ScheduleEvent(EVENT_ANRAPHET_OMEGA_STANCE, 35000, 0, PHASE_COMBAT); + } + + void Reset() + { + _Reset(); + me->SetWalk(false); + events.SetPhase(PHASE_INTRO); + if (instance->GetData(DATA_DEAD_ELEMENTALS) == 4) + { + // Set to combat automatically, Brann's event won't repeat + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + events.SetPhase(PHASE_COMBAT); + ScheduleCombatEvents(); + me->SetHomePosition(AnraphetActivatePos); + } + } + + void EnterCombat(Unit* /*who*/) + { + instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me, 1); + Talk(ANRAPHET_SAY_AGGRO); + _EnterCombat(); + } + + void JustDied(Unit* /*killer*/) + { + instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); + Talk(ANRAPHET_SAY_DEATH); + + if (Creature* brann = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_BRANN_0_GUID))) + brann->AI()->DoAction(ACTION_ANRAPHET_DIED); + + _JustDied(); + } + + void KilledUnit(Unit* victim) + { + if (victim->GetTypeId() == TYPEID_PLAYER) + Talk(ANRAPHET_SAY_KILL); + } + + void JustReachedHome() + { + instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); + _JustReachedHome(); + instance->SetBossState(DATA_ANRAPHET, FAIL); + } + + void DoAction(int32 const action) + { + if (action == ACTION_ANRAPHET_INTRO) + events.ScheduleEvent(EVENT_ANRAPHET_APPEAR, 6000, 0, PHASE_INTRO); + } + + void MovementInform(uint32 type, uint32 point) + { + if (type != POINT_MOTION_TYPE) + return; + + if (point == POINT_ANRAPHET_ACTIVATE) + { + events.ScheduleEvent(EVENT_ANRAPHET_ACTIVATE, 1500, 0, PHASE_INTRO); + me->SetHomePosition(AnraphetActivatePos); + } + } + + void UpdateAI(uint32 const diff) + { + if ((events.GetPhaseMask() & PHASE_MASK_COMBAT) && (!UpdateVictim() || !CheckInRoom())) + return; + + events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_ANRAPHET_APPEAR: + me->SetWalk(true); + me->GetMotionMaster()->MovePoint(POINT_ANRAPHET_ACTIVATE, AnraphetActivatePos); + break; + case EVENT_ANRAPHET_ACTIVATE: + me->SetWalk(false); + Talk(ANRAPHET_SAY_INTRO); + events.ScheduleEvent(EVENT_ANRAPHET_DESTROY, 17500, 0, PHASE_INTRO); + return; + case EVENT_ANRAPHET_DESTROY: + DoCastAOE(SPELL_DESTRUCTION_PROTOCOL); + events.ScheduleEvent(EVENT_ANRAPHET_READY, 6000, 0, PHASE_INTRO); + break; + case EVENT_ANRAPHET_READY: + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + events.SetPhase(PHASE_COMBAT); + ScheduleCombatEvents(); + break; + case EVENT_ANRAPHET_NEMESIS_STRIKE: + DoCastVictim(SPELL_NEMESIS_STRIKE); + events.ScheduleEvent(EVENT_ANRAPHET_NEMESIS_STRIKE, 21500, 0, PHASE_COMBAT); + break; + case EVENT_ANRAPHET_ALPHA_BEAMS: + DoCast(me, SPELL_ALPHA_BEAMS); + events.ScheduleEvent(EVENT_ANRAPHET_CRUMBLING_RUIN, 12500, 0, PHASE_COMBAT); + events.ScheduleEvent(EVENT_ANRAPHET_ALPHA_BEAMS, urand(40000, 45000), 0, PHASE_COMBAT); + break; + case EVENT_ANRAPHET_OMEGA_STANCE: + DoCast(me, SPELL_OMEGA_STANCE_SUMMON); + DoCast(me, SPELL_OMEGA_STANCE); + Talk(ANRAPHET_SAY_OMEGA_STANCE); + events.ScheduleEvent(EVENT_ANRAPHET_OMEGA_STANCE, urand(45000, 50000), 0, PHASE_COMBAT); + events.ScheduleEvent(EVENT_ANRAPHET_CRUMBLING_RUIN, 13000, 0, PHASE_COMBAT); + break; + case EVENT_ANRAPHET_CRUMBLING_RUIN: + DoCast(me, SPELL_CRUMBLING_RUIN); + break; + } + } + + if (events.GetPhaseMask() & PHASE_MASK_COMBAT) + DoMeleeAttackIfReady(); + } + }; + + CreatureAI* GetAI(Creature* creature) const + { + return GetHallsOfOriginationAI(creature); + } +}; + +class npc_omega_stance : public CreatureScript +{ + public: + npc_omega_stance() : CreatureScript("npc_omega_stance") { } + + struct npc_omega_stanceAI : public ScriptedAI + { + npc_omega_stanceAI(Creature* creature) : ScriptedAI(creature) { } + + void IsSummonedBy(Unit* /*who*/) + { + DoCast(me, SPELL_OMEGA_STANCE_SPIDER_TRIGGER, true); + } + + void EnterEvadeMode() { } + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_omega_stanceAI(creature); + } +}; + +class npc_alpha_beam : public CreatureScript +{ + public: + npc_alpha_beam() : CreatureScript("npc_alpha_beam") { } + + struct npc_alpha_beamAI : public ScriptedAI + { + npc_alpha_beamAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) { } + + void IsSummonedBy(Unit* summoner) + { + if (Creature* anraphet = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_ANRAPHET_GUID))) + anraphet->CastSpell(me, SPELL_ALPHA_BEAMS_BACK_CAST); + } + + void EnterEvadeMode() { } // Never evade + + private: + InstanceScript* _instance; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return GetHallsOfOriginationAI(creature); + } +}; + +class npc_brann_bronzebeard_anraphet : public CreatureScript +{ + public: + npc_brann_bronzebeard_anraphet() : CreatureScript("npc_brann_bronzebeard_anraphet") { } + + struct npc_brann_bronzebeard_anraphetAI : public CreatureAI + { + npc_brann_bronzebeard_anraphetAI(Creature* creature) : CreatureAI(creature), _currentPoint(0), _instance(creature->GetInstanceScript()) { } + + void sGossipSelect(Player* /*player*/, uint32 sender, uint32 action) + { + if (_instance->GetBossState(DATA_VAULT_OF_LIGHTS) == DONE) + return; + + if (me->GetCreatureTemplate()->GossipMenuId == sender && !action) + { + _instance->SetBossState(DATA_VAULT_OF_LIGHTS, IN_PROGRESS); + _currentPoint = 0; + events.Reset(); + me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + me->SetWalk(true); + Talk(BRANN_SAY_DOOR_INTRO); + events.ScheduleEvent(EVENT_BRANN_UNLOCK_DOOR, 7500); + } + } + + void DoAction(int32 const action) + { + switch (action) + { + case ACTION_ELEMENTAL_DIED: + { + uint32 dead = _instance->GetData(DATA_DEAD_ELEMENTALS); + Talk(BRANN_1_ELEMENTAL_DEAD + dead - 1); + if (dead == 4) + { + _instance->DoCastSpellOnPlayers(SPELL_VAULT_OF_LIGHTS_CREDIT); + if (Creature* anraphet = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_ANRAPHET_GUID))) + anraphet->AI()->DoAction(ACTION_ANRAPHET_INTRO); + } + break; + } + case ACTION_ANRAPHET_DIED: + me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + events.ScheduleEvent(EVENT_BRANN_MOVE_INTRO, 1000); + break; + } + } + + void UpdateAI(uint32 const diff) + { + events.Update(diff); + + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_BRANN_MOVE_INTRO: + if (_currentPoint < MAX_BRANN_WAYPOINTS_INTRO) + me->GetMotionMaster()->MovePoint(_currentPoint, BrannIntroWaypoint[_currentPoint]); + break; + case EVENT_BRANN_UNLOCK_DOOR: + Talk(BRANN_SAY_UNLOCK_DOOR); + _instance->SetBossState(DATA_VAULT_OF_LIGHTS, DONE); + _instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_VAULT_OF_LIGHTS_EVENT); + events.ScheduleEvent(EVENT_BRANN_MOVE_INTRO, 3500); + break; + case EVENT_BRANN_THINK: + Talk(BRANN_SAY_THINK); + events.ScheduleEvent(EVENT_BRANN_SET_ORIENTATION_1, 6000); + break; + case EVENT_BRANN_SET_ORIENTATION_1: + me->SetFacingTo(5.445427f); + Talk(BRANN_SAY_MIRRORS); + events.ScheduleEvent(EVENT_BRANN_SET_ORIENTATION_2, 1000); + break; + case EVENT_BRANN_SET_ORIENTATION_2: + me->SetFacingTo(0.6283185f); + events.ScheduleEvent(EVENT_BRANN_SET_ORIENTATION_3, 2500); + break; + case EVENT_BRANN_SET_ORIENTATION_3: + me->SetFacingTo(0.01745329f); + events.ScheduleEvent(EVENT_BRANN_SAY_ELEMENTALS, 200); + break; + case EVENT_BRANN_SAY_ELEMENTALS: + Talk(BRANN_SAY_ELEMENTALS); + events.ScheduleEvent(EVENT_BRANN_SAY_GET_IT, 3500); + break; + case EVENT_BRANN_SAY_GET_IT: + Talk(BRANN_SAY_GET_IT); + me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + break; + case EVENT_BRANN_SET_ORIENTATION_4: + me->SetFacingTo(3.141593f); + break; + } + } + } + + void MovementInform(uint32 movementType, uint32 pointId) + { + if (movementType != POINT_MOTION_TYPE) + return; + + _currentPoint = pointId + 1; + uint32 delay = 1; + + switch (pointId) + { + case 0: + Talk(BRANN_SAY_TROGGS); + events.ScheduleEvent(EVENT_BRANN_THINK, 15000); + return; + case 1: + Talk(BRANN_SAY_ANRAPHET_DIED); + delay = 1000; + break; + case 14: + Talk(BRANN_SAY_MOMENT); + delay = 2200; + break; + case 16: + events.ScheduleEvent(EVENT_BRANN_SET_ORIENTATION_4, 6000); + return; + default: + break; + } + + events.ScheduleEvent(EVENT_BRANN_MOVE_INTRO, delay); + } + + protected: + EventMap events; + uint32 _currentPoint; + InstanceScript* _instance; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return GetHallsOfOriginationAI(creature); + } +}; + +class spell_anraphet_alpha_beams : public SpellScriptLoader +{ +public: + spell_anraphet_alpha_beams() : SpellScriptLoader("spell_anraphet_alpha_beams") { } + + class spell_anraphet_alpha_beams_SpellScript : public SpellScript + { + PrepareSpellScript(spell_anraphet_alpha_beams_SpellScript); + + void FilterTargets(std::list& targets) + { + if (targets.empty()) + return; + + WorldObject* target = Trinity::Containers::SelectRandomContainerElement(targets); + targets.clear(); + targets.push_back(target); + } + + void Register() + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_anraphet_alpha_beams_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_anraphet_alpha_beams_SpellScript(); + } +}; + +class spell_anraphet_omega_stance_summon : public SpellScriptLoader +{ +public: + spell_anraphet_omega_stance_summon() : SpellScriptLoader("spell_anraphet_omega_stance_summon") { } + + class spell_anraphet_omega_stance_summon_SpellScript : public SpellScript + { + PrepareSpellScript(spell_anraphet_omega_stance_summon_SpellScript); + + void ModDestHeight(SpellEffIndex /*effIndex*/) + { + Position offset = {0.0f, 0.0f, 30.0f, 0.0f}; + const_cast(GetExplTargetDest())->RelocateOffset(offset); + GetHitDest()->RelocateOffset(offset); + } + + void Register() + { + OnEffectLaunch += SpellEffectFn(spell_anraphet_omega_stance_summon_SpellScript::ModDestHeight, EFFECT_0, SPELL_EFFECT_SUMMON); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_anraphet_omega_stance_summon_SpellScript(); + } +}; + +class spell_omega_stance_spider_effect : public SpellScriptLoader +{ +public: + spell_omega_stance_spider_effect() : SpellScriptLoader("spell_omega_stance_spider_effect") { } + + class spell_omega_stance_spider_effect_SpellScript : public SpellScript + { + PrepareSpellScript(spell_omega_stance_spider_effect_SpellScript); + + void SetDestPosition(SpellEffIndex effIndex) + { + // Do our own calculations for the destination position. + /// TODO: Remove this once we find a general rule for WorldObject::MovePosition (this spell shouldn't take the Z change into consideration) + Unit* caster = GetCaster(); + float angle = float(rand_norm()) * static_cast(2 * M_PI); + uint32 dist = caster->GetObjectSize() + GetSpellInfo()->Effects[effIndex].CalcRadius(GetCaster()) * (float)rand_norm(); + + float x = caster->GetPositionX() + dist * std::cos(angle); + float y = caster->GetPositionY() + dist * std::sin(angle); + float z = caster->GetMap()->GetHeight(x, y, caster->GetPositionZ()); + + const_cast(GetExplTargetDest())->Relocate(x, y, z); + GetHitDest()->Relocate(x, y, z); + } + + void Register() + { + OnEffectLaunch += SpellEffectFn(spell_omega_stance_spider_effect_SpellScript::SetDestPosition, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_omega_stance_spider_effect_SpellScript(); + } +}; + +void AddSC_boss_anraphet() +{ + new boss_anraphet(); + new spell_anraphet_alpha_beams(); + new npc_brann_bronzebeard_anraphet(); + new npc_alpha_beam(); + new spell_anraphet_omega_stance_summon(); + new spell_omega_stance_spider_effect(); + new npc_omega_stance(); +} diff --git a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp index cba0ea0b61c..e20ad0ccf82 100644 --- a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp +++ b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp @@ -45,7 +45,6 @@ enum Spells SPELL_RAGING_SMASH = 83650, SPELL_FLAME_BOLT = 77370, SPELL_EARTH_SPIKE_WARN = 94974, - SPELL_EARTH_SPIKE_ERUPT = 75339, SPELL_PTAH_EXPLOSION = 75519, SPELL_SANDSTORM = 75491, @@ -91,22 +90,6 @@ protected: Unit* _owner; }; -class EruptEarthSpike : public BasicEvent -{ -public: - EruptEarthSpike(Unit* caster, WorldLocation const target) : _caster(caster), _target(target) { } - - bool Execute(uint64 execTime, uint32 /*diff*/) - { - _caster->CastSpell(_target.GetPositionX(), _target.GetPositionY(), _target.GetPositionZ(), SPELL_EARTH_SPIKE_ERUPT, true); - return true; - } - -protected: - Unit* _caster; - WorldLocation const _target; -}; - class boss_earthrager_ptah : public CreatureScript { public: @@ -315,34 +298,6 @@ class spell_earthrager_ptah_flame_bolt : public SpellScriptLoader } }; -class spell_earthrager_ptah_earth_spike : public SpellScriptLoader -{ -public: - spell_earthrager_ptah_earth_spike() : SpellScriptLoader("spell_earthrager_ptah_earth_spike") { } - - class spell_earthrager_ptah_earth_spike_SpellScript : public SpellScript - { - PrepareSpellScript(spell_earthrager_ptah_earth_spike_SpellScript); - - void Launch(SpellEffIndex index) - { - PreventHitDefaultEffect(index); - // Erupt the spike in 4 seconds. - GetCaster()->m_Events.AddEvent(new EruptEarthSpike(GetCaster(), *GetExplTargetDest()), GetCaster()->m_Events.CalculateTime(4000)); - } - - void Register() - { - OnEffectHit += SpellEffectFn(spell_earthrager_ptah_earth_spike_SpellScript::Launch, EFFECT_0, SPELL_EFFECT_TRIGGER_MISSILE); - } - }; - - SpellScript* GetSpellScript() const - { - return new spell_earthrager_ptah_earth_spike_SpellScript(); - } -}; - class spell_earthrager_ptah_explosion : public SpellScriptLoader { public: @@ -387,6 +342,5 @@ void AddSC_boss_earthrager_ptah() { new boss_earthrager_ptah(); new spell_earthrager_ptah_flame_bolt(); - new spell_earthrager_ptah_earth_spike(); new spell_earthrager_ptah_explosion(); } diff --git a/src/server/scripts/Kalimdor/HallsOfOrigination/halls_of_origination.h b/src/server/scripts/Kalimdor/HallsOfOrigination/halls_of_origination.h index 3258df45a0b..54ecdfb331d 100644 --- a/src/server/scripts/Kalimdor/HallsOfOrigination/halls_of_origination.h +++ b/src/server/scripts/Kalimdor/HallsOfOrigination/halls_of_origination.h @@ -20,13 +20,18 @@ #define HoOScriptName "instance_halls_of_origination" -uint32 const EncounterCount = 7; +uint32 const EncounterCount = 12; enum Data { // Bosses DATA_TEMPLE_GUARDIAN_ANHUUR, DATA_EARTHRAGER_PTAH, + DATA_VAULT_OF_LIGHTS, + DATA_FIRE_WARDEN, + DATA_EARTH_WARDEN, + DATA_WATER_WARDEN, + DATA_AIR_WARDEN, DATA_ANRAPHET, DATA_ISISET, DATA_AMMUNAE, @@ -39,6 +44,11 @@ enum Data DATA_ANHUUR_RIGHT_BEACON, DATA_ANHUUR_BRIDGE, DATA_ANHUUR_DOOR, + + // Anraphet + DATA_BRANN_0_GUID, + DATA_DEAD_ELEMENTALS, + DATA_ANRAPHET_GUID, }; enum Creatures @@ -52,6 +62,17 @@ enum Creatures NPC_JEWELED_SCARAB = 40458, NPC_DUSTBONE_HORROR = 40450, NPC_QUICKSAND = 40503, // Summoned by a spell not in dbc (75550) + + BOSS_ANRAPHET = 39788, + NPC_FIRE_WARDEN = 39800, + NPC_EARTH_WARDEN = 39801, + NPC_WATER_WARDEN = 39802, + NPC_AIR_WARDEN = 39803, + + WARDEN_ENTRY_DATA_DELTA = NPC_FIRE_WARDEN - DATA_FIRE_WARDEN, + + NPC_BRANN_BRONZEBEARD_0 = 39908, + NPC_OMEGA_STANCE = 41194, }; enum GameObjects @@ -61,11 +82,35 @@ enum GameObjects GO_ANHUURS_DOOR = 202307, GO_ANHUURS_RIGHT_BEACON = 203136, GO_ANHUURS_LEFT_BEACON = 203133, + + GO_VAULT_OF_LIGHTS_DOOR = 202313, + GO_SUN_MIRROR = 207726, + GO_ANRAPHET_DOOR = 202314, + + GO_DOODAD_ULDUM_LIGHTMACHINE_01 = 207375, + GO_DOODAD_ULDUM_LIGHTMACHINE_02 = 207374, + GO_DOODAD_ULDUM_LIGHTMACHINE_03 = 207377, + GO_DOODAD_ULDUM_LIGHTMACHINE_04 = 207376, + + GO_DOODAD_ULDUM_LASERBEAMS01 = 207662, // Matches GO_DOODAD_ULDUM_LIGHTMACHINE_02 + GO_DOODAD_ULDUM_LASERBEAMS_01 = 207663, // Matches GO_DOODAD_ULDUM_LIGHTMACHINE_01 + GO_DOODAD_ULDUM_LASERBEAMS_02 = 207664, // Matches GO_DOODAD_ULDUM_LIGHTMACHINE_04 + GO_DOODAD_ULDUM_LASERBEAMS_03 = 207665, // Matches GO_DOODAD_ULDUM_LIGHTMACHINE_03 }; -enum AreaIds +enum Misc { AREA_TOMB_OF_THE_EARTHRAGER = 5610, + ACHIEV_VAULT_OF_LIGHTS_EVENT = 24212, // Faster Than The Speed Of Light + SPELL_VAULT_OF_LIGHTS_CREDIT = 94067, // Not in DBC +}; + +enum GlobalActions +{ + ACTION_ANRAPHET_INTRO, + ACTION_ELEMENTAL_DIED, + ACTION_ANRAPHET_DIED, + ACTION_OMEGA_TRIGGER, }; template diff --git a/src/server/scripts/Kalimdor/HallsOfOrigination/instance_halls_of_origination.cpp b/src/server/scripts/Kalimdor/HallsOfOrigination/instance_halls_of_origination.cpp index e5ef556003f..0cb21aeeba1 100644 --- a/src/server/scripts/Kalimdor/HallsOfOrigination/instance_halls_of_origination.cpp +++ b/src/server/scripts/Kalimdor/HallsOfOrigination/instance_halls_of_origination.cpp @@ -29,10 +29,19 @@ DoorData const doorData[] = { - {GO_ANHUURS_DOOR, DATA_TEMPLE_GUARDIAN_ANHUUR, DOOR_TYPE_PASSAGE, BOUNDARY_NONE }, - {GO_ANHUURS_BRIDGE, DATA_TEMPLE_GUARDIAN_ANHUUR, DOOR_TYPE_PASSAGE, BOUNDARY_NONE }, - {GO_DOODAD_ULDUM_ELEVATOR_COL01, DATA_TEMPLE_GUARDIAN_ANHUUR, DOOR_TYPE_PASSAGE, BOUNDARY_NONE }, - {0, 0, DOOR_TYPE_ROOM, BOUNDARY_NONE } + {GO_ANHUURS_DOOR, DATA_TEMPLE_GUARDIAN_ANHUUR, DOOR_TYPE_PASSAGE, BOUNDARY_NONE }, + {GO_ANHUURS_BRIDGE, DATA_TEMPLE_GUARDIAN_ANHUUR, DOOR_TYPE_PASSAGE, BOUNDARY_NONE }, + {GO_DOODAD_ULDUM_ELEVATOR_COL01, DATA_TEMPLE_GUARDIAN_ANHUUR, DOOR_TYPE_PASSAGE, BOUNDARY_NONE }, + {GO_VAULT_OF_LIGHTS_DOOR, DATA_VAULT_OF_LIGHTS, DOOR_TYPE_PASSAGE, BOUNDARY_NONE }, + {GO_DOODAD_ULDUM_LIGHTMACHINE_02, DATA_EARTH_WARDEN, DOOR_TYPE_PASSAGE, BOUNDARY_NONE }, + {GO_DOODAD_ULDUM_LASERBEAMS01, DATA_EARTH_WARDEN, DOOR_TYPE_PASSAGE, BOUNDARY_NONE }, + {GO_DOODAD_ULDUM_LIGHTMACHINE_01, DATA_FIRE_WARDEN, DOOR_TYPE_PASSAGE, BOUNDARY_NONE }, + {GO_DOODAD_ULDUM_LASERBEAMS_01, DATA_FIRE_WARDEN, DOOR_TYPE_PASSAGE, BOUNDARY_NONE }, + {GO_DOODAD_ULDUM_LIGHTMACHINE_03, DATA_WATER_WARDEN, DOOR_TYPE_PASSAGE, BOUNDARY_NONE }, + {GO_DOODAD_ULDUM_LASERBEAMS_03, DATA_WATER_WARDEN, DOOR_TYPE_PASSAGE, BOUNDARY_NONE }, + {GO_DOODAD_ULDUM_LIGHTMACHINE_04, DATA_AIR_WARDEN, DOOR_TYPE_PASSAGE, BOUNDARY_NONE }, + {GO_DOODAD_ULDUM_LASERBEAMS_02, DATA_AIR_WARDEN, DOOR_TYPE_PASSAGE, BOUNDARY_NONE }, + {0, 0, DOOR_TYPE_ROOM, BOUNDARY_NONE } }; class instance_halls_of_origination : public InstanceMapScript @@ -51,6 +60,11 @@ class instance_halls_of_origination : public InstanceMapScript AnhuursDoorGUID = 0; AnhuurRightBeaconGUID = 0; AnhuurLeftBeaconGUID = 0; + BrannBronzebeardGUID = 0; + AnraphetGUID = 0; + AnraphetDoorGUID = 0; + SunMirrorGUID = 0; + _deadElementals = 0; } void OnGameObjectCreate(GameObject* go) @@ -60,6 +74,15 @@ class instance_halls_of_origination : public InstanceMapScript case GO_ANHUURS_BRIDGE: AnhuursBridgeGUID = go->GetGUID(); case GO_DOODAD_ULDUM_ELEVATOR_COL01: + case GO_VAULT_OF_LIGHTS_DOOR: + case GO_DOODAD_ULDUM_LIGHTMACHINE_01: + case GO_DOODAD_ULDUM_LIGHTMACHINE_02: + case GO_DOODAD_ULDUM_LIGHTMACHINE_03: + case GO_DOODAD_ULDUM_LIGHTMACHINE_04: + case GO_DOODAD_ULDUM_LASERBEAMS01: + case GO_DOODAD_ULDUM_LASERBEAMS_01: + case GO_DOODAD_ULDUM_LASERBEAMS_02: + case GO_DOODAD_ULDUM_LASERBEAMS_03: AddDoor(go, true); break; case GO_ANHUURS_DOOR: @@ -72,6 +95,12 @@ class instance_halls_of_origination : public InstanceMapScript case GO_ANHUURS_LEFT_BEACON: AnhuurLeftBeaconGUID = go->GetGUID(); break; + case GO_SUN_MIRROR: + SunMirrorGUID = go->GetGUID(); + break; + case GO_ANRAPHET_DOOR: + AnraphetDoorGUID = go->GetGUID(); + break; } } @@ -82,6 +111,15 @@ class instance_halls_of_origination : public InstanceMapScript case GO_ANHUURS_BRIDGE: case GO_DOODAD_ULDUM_ELEVATOR_COL01: case GO_ANHUURS_DOOR: + case GO_VAULT_OF_LIGHTS_DOOR: + case GO_DOODAD_ULDUM_LIGHTMACHINE_01: + case GO_DOODAD_ULDUM_LIGHTMACHINE_02: + case GO_DOODAD_ULDUM_LIGHTMACHINE_03: + case GO_DOODAD_ULDUM_LIGHTMACHINE_04: + case GO_DOODAD_ULDUM_LASERBEAMS01: + case GO_DOODAD_ULDUM_LASERBEAMS_01: + case GO_DOODAD_ULDUM_LASERBEAMS_02: + case GO_DOODAD_ULDUM_LASERBEAMS_03: AddDoor(go, false); break; } @@ -94,9 +132,28 @@ class instance_halls_of_origination : public InstanceMapScript case BOSS_TEMPLE_GUARDIAN_ANHUUR: TempleGuardianAnhuurGUID = creature->GetGUID(); break; + case NPC_BRANN_BRONZEBEARD_0: + BrannBronzebeardGUID = creature->GetGUID(); + break; + case BOSS_ANRAPHET: + AnraphetGUID = creature->GetGUID(); + break; } } + uint32 GetData(uint32 data) const + { + switch (data) + { + case DATA_DEAD_ELEMENTALS: + return _deadElementals; + default: + break; + } + + return 0; + } + uint64 GetData64(uint32 index) const { switch (index) @@ -111,17 +168,55 @@ class instance_halls_of_origination : public InstanceMapScript return AnhuurRightBeaconGUID; case DATA_ANHUUR_GUID: return TempleGuardianAnhuurGUID; + case DATA_BRANN_0_GUID: + return BrannBronzebeardGUID; + case DATA_ANRAPHET_GUID: + return AnraphetGUID; } return 0; } + void IncreaseDeadElementals(uint32 inc) + { + _deadElementals += inc; + if (_deadElementals == 4) + { + if (GameObject* mirror = instance->GetGameObject(SunMirrorGUID)) + mirror->SetGoState(GO_STATE_ACTIVE); + if (GameObject* door = instance->GetGameObject(AnraphetDoorGUID)) + door->SetGoState(GO_STATE_ACTIVE); + } + } + + void OnUnitDeath(Unit* unit) + { + Creature* creature = unit->ToCreature(); + if (!creature) + return; + + switch (creature->GetEntry()) + { + case NPC_FIRE_WARDEN: + case NPC_EARTH_WARDEN: + case NPC_WATER_WARDEN: + case NPC_AIR_WARDEN: + uint32 data = creature->GetEntry() - WARDEN_ENTRY_DATA_DELTA; + SetBossState(data, IN_PROGRESS); // Needs to be set to IN_PROGRESS or else the gameobjects state won't be updated + SetBossState(data, DONE); + IncreaseDeadElementals(1); + if (Creature* brann = instance->GetCreature(BrannBronzebeardGUID)) + brann->AI()->DoAction(ACTION_ELEMENTAL_DIED); + break; + } + } + std::string GetSaveData() { OUT_SAVE_INST_DATA; std::ostringstream saveStream; - saveStream << "H O " << GetBossSaveData(); + saveStream << "H O " << GetBossSaveData() << _deadElementals; OUT_SAVE_INST_DATA_COMPLETE; return saveStream.str(); @@ -152,6 +247,9 @@ class instance_halls_of_origination : public InstanceMapScript tmpState = NOT_STARTED; SetBossState(i, EncounterState(tmpState)); } + uint32 tmp; + loadStream >> tmp; + IncreaseDeadElementals(tmp); } else OUT_LOAD_INST_DATA_FAIL; @@ -165,6 +263,11 @@ class instance_halls_of_origination : public InstanceMapScript uint64 AnhuursDoorGUID; uint64 AnhuurRightBeaconGUID; uint64 AnhuurLeftBeaconGUID; + uint64 BrannBronzebeardGUID; + uint64 AnraphetGUID; + uint64 AnraphetDoorGUID; + uint64 SunMirrorGUID; + uint32 _deadElementals; }; InstanceScript* GetInstanceScript(InstanceMap* map) const -- cgit v1.2.3 From 7e29e0d2b268ca6722311e2bf4d2e78404e7d51e Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 5 Jan 2013 00:59:33 +0100 Subject: Scripts/Firelands: Implemented Alysrazor's trash event --- .../world/2013_01_05_00_world_firelands.sql | 113 ++++ src/server/game/Scripting/ScriptLoader.cpp | 5 + src/server/scripts/Kalimdor/CMakeLists.txt | 3 + .../scripts/Kalimdor/Firelands/boss_alysrazor.cpp | 703 +++++++++++++++++++++ src/server/scripts/Kalimdor/Firelands/firelands.h | 74 +++ .../Kalimdor/Firelands/instance_firelands.cpp | 59 ++ 6 files changed, 957 insertions(+) create mode 100644 sql/updates/world/2013_01_05_00_world_firelands.sql create mode 100644 src/server/scripts/Kalimdor/Firelands/boss_alysrazor.cpp create mode 100644 src/server/scripts/Kalimdor/Firelands/firelands.h create mode 100644 src/server/scripts/Kalimdor/Firelands/instance_firelands.cpp (limited to 'src') diff --git a/sql/updates/world/2013_01_05_00_world_firelands.sql b/sql/updates/world/2013_01_05_00_world_firelands.sql new file mode 100644 index 00000000000..fa20d425209 --- /dev/null +++ b/sql/updates/world/2013_01_05_00_world_firelands.sql @@ -0,0 +1,113 @@ +DELETE FROM `creature` WHERE `id` IN (53520,53375,53698,53693,53487,53691,52530,53369,53680,53734,53896,53900) AND `map`=720; +DELETE FROM `gameobject` WHERE `id` IN (209036,208966,201722,209035) AND `map`=720; + +UPDATE `creature_template` SET `flags_extra`=`flags_extra`|0x80 WHERE `entry` IN (53723,53154,53789,53792,53787,53788); + +UPDATE `creature_template` SET `minlevel`=88,`maxlevel`=88,`exp`=3,`faction_A`=16,`faction_H`=16,`speed_walk`=3.2,`speed_run`=2,`baseattacktime`=2000,`rangeattacktime`=2000,`unit_class`=2,`unit_flags`=0x2008140,`unit_flags2`=0x8000800,`VehicleId`=1673,`HoverHeight`=14,`mana_mod_extra`=1.72414 WHERE `entry` IN (52530,54044,54045,54046); +UPDATE `creature_template` SET `minlevel`=87,`maxlevel`=87,`exp`=3,`faction_A`=16,`faction_H`=16,`speed_walk`=3.2,`speed_run`=2,`baseattacktime`=2000,`rangeattacktime`=2000,`unit_flags`=0x8000,`unit_flags2`=0x800,`VehicleId`=1695 WHERE `entry` IN (54056,54057); -- Blazing Monstrosity +UPDATE `creature_template` SET `minlevel`=87,`maxlevel`=87,`exp`=3,`faction_A`=16,`faction_H`=16,`speed_walk`=1,`speed_run`=1,`baseattacktime`=2000,`rangeattacktime`=2000,`unit_flags`=0x8000,`unit_flags2`=0x8800 WHERE `entry` IN (53795,54059); -- Egg Pile +UPDATE `creature_template` SET `spell1`=100076,`spell2`=100080,`spell3`=100078,`spell4`=100082 WHERE `entry`=53789; +UPDATE `creature_template` SET `spell1`=100090,`spell2`=100089,`spell3`=100091,`spell4`=100092 WHERE `entry`=53792; +UPDATE `creature_template` SET `minlevel`=85,`maxlevel`=85,`exp`=3,`faction_A`=14,`faction_H`=14,`speed_walk`=1.2,`speed_run`=0.428571,`unit_flags`=0x2000000,`unit_flags2`=0x2000800 WHERE `entry` IN (53787,53788); -- Molten Barrage +UPDATE `creature_template` SET `minlevel`=85,`maxlevel`=85,`exp`=3,`faction_A`=16,`faction_H`=16,`speed_walk`=3.2,`speed_run`=2,`unit_flags`=0x8000,`unit_flags2`=0x800,`baseattacktime`=2000,`rangeattacktime`=2000 WHERE `entry` IN (53794,54058); -- Smouldering Hatchling +UPDATE `creature_template` SET `minlevel`=86,`maxlevel`=86,`exp`=3,`faction_A`=16,`faction_H`=16,`speed_walk`=1,`speed_run`=1.14286,`unit_flags`=0,`unit_flags2`=0x800,`baseattacktime`=2000,`rangeattacktime`=2000,`unit_class`=8,`dynamicflags`=0 WHERE `entry` IN (53793,53973); -- Harbinger of Flame + +UPDATE `creature_template` SET `difficulty_entry_1`=54044,`difficulty_entry_2`=54045,`difficulty_entry_3`=54046 WHERE `entry`=52530; -- Alysrazor +UPDATE `creature_template` SET `difficulty_entry_1`=54056 WHERE `entry`=53786; -- Blazing Monstrosity +UPDATE `creature_template` SET `difficulty_entry_1`=54057 WHERE `entry`=53791; -- Blazing Monstrosity +UPDATE `creature_template` SET `difficulty_entry_1`=54059 WHERE `entry`=53795; -- Egg Pile +UPDATE `creature_template` SET `difficulty_entry_1`=54058 WHERE `entry`=53794; -- Smouldering Hatchling +UPDATE `creature_template` SET `difficulty_entry_1`=53973 WHERE `entry`=53793; -- Harbinger of Flame + +DELETE FROM `creature_template_addon` WHERE `entry` IN (53786,53791,54056,54057,53794,54058,54276,54019,53224,53102,52530,54044,54045,54046,53900,53680,53520,53693,53698); +INSERT INTO `creature_template_addon` (`entry`, `mount`, `bytes1`, `bytes2`, `auras`) VALUES +(53786, 0, 0x0, 0x1, '100712 99480'), -- Blazing Monstrosity - Fire Hawk Smoke Cosmetic, Sleep (Ultra-High Priority) +(53791, 0, 0x0, 0x1, '100712 99480'), -- Blazing Monstrosity - Fire Hawk Smoke Cosmetic, Sleep (Ultra-High Priority) +(54056, 0, 0x0, 0x1, '100712 99480'), -- Blazing Monstrosity - Fire Hawk Smoke Cosmetic, Sleep (Ultra-High Priority) +(54057, 0, 0x0, 0x1, '100712 99480'), -- Blazing Monstrosity - Fire Hawk Smoke Cosmetic, Sleep (Ultra-High Priority) +(53794, 0, 0x0, 0x1, '100712'), -- Smouldering Hatchling - Fire Hawk Smoke Cosmetic +(54058, 0, 0x0, 0x1, '100712'), -- Smouldering Hatchling - Fire Hawk Smoke Cosmetic +(54276, 0, 0x0, 0x1, '101112'), -- Cinderslither Snake - Cinderslither Aura +(54019, 0, 0x0, 0x1, '100556'), -- Captive Druid of the Talon - Smouldering Roots +(53224, 0, 0x0, 0x1, '100743'), -- Flamewaker Taskmaster - Aura of Indomitability +(53102, 0, 0x3000000, 0x1, '100712'), -- Inferno Hawk - Fire Hawk Smoke Cosmetic +(52530, 0, 0x0, 0x1, '100712'), -- Alysrazor - Fire Hawk Smoke Cosmetic +(54044, 0, 0x0, 0x1, '100712'), -- Alysrazor - Fire Hawk Smoke Cosmetic +(54045, 0, 0x0, 0x1, '100712'), -- Alysrazor - Fire Hawk Smoke Cosmetic +(54046, 0, 0x0, 0x1, '100712'), -- Alysrazor - Fire Hawk Smoke Cosmetic +(53900, 0, 0x3000000, 0x1, '100712'), -- Blazing Broodmother - Fire Hawk Smoke Cosmetic +(53680, 0, 0x3000000, 0x1, '100712'), -- Blazing Broodmother - Fire Hawk Smoke Cosmetic +(53520, 0, 0x0, 0x1, '99327'), -- Plump Lava Worm - Fire Worm Cosmetic +(53693, 0, 0x0, 0x1, '99793'), -- Fiery Vortex - Fiery Vortex +(53698, 0, 0x0, 0x1, '99817'); -- Fiery Tornado - Fiery Tornado + +DELETE FROM `vehicle_template_accessory` WHERE `entry` IN (53786,53791); +INSERT INTO `vehicle_template_accessory` (`entry`, `accessory_entry`, `minion`, `description`, `summontype`, `summontimer`) VALUES +(53786,53789,1,'Blazing Monstrosity',5,0), +(53791,53792,1,'Blazing Monstrosity',5,0); + +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry` IN (53786,53791,53789,53792); +INSERT INTO `npc_spellclick_spells` (`npc_entry`,`spell_id`,`cast_flags`) VALUES +(53786,98509,1), +(53791,98509,1), +(53789,93970,1), +(53792,93970,1); + +DELETE FROM `creature_text` WHERE `entry`=53795; +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES +(53795, 0, 0, 'The Molten Eggs begin to crack and splinter!', 41, 0, 100, 0, 0, 0, 'Molten Egg - EMOTE_CRACKING_EGGS'); + +-- ScriptNames and conditions +UPDATE `instance_template` SET `script`='instance_firelands' WHERE `map`=720; +UPDATE `creature_template` SET `ScriptName`='npc_harbinger_of_flame' WHERE `entry`=53793; +UPDATE `creature_template` SET `ScriptName`='npc_blazing_monstrosity' WHERE `entry` IN (53786,53791); +UPDATE `creature_template` SET `ScriptName`='npc_molten_barrage' WHERE `entry` IN (53787,53788); +UPDATE `creature_template` SET `ScriptName`='npc_egg_pile' WHERE `entry`=53795; + +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_alysrazor_cosmetic_egg_xplosion'; +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_alysrazor_turn_monstrosity'; +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_alysrazor_aggro_closest'; +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_alysrazor_fieroblast'; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(100099,'spell_alysrazor_cosmetic_egg_xplosion'), +(100076,'spell_alysrazor_turn_monstrosity'), +(100078,'spell_alysrazor_turn_monstrosity'), +(100080,'spell_alysrazor_turn_monstrosity'), +(100082,'spell_alysrazor_turn_monstrosity'), +(100089,'spell_alysrazor_turn_monstrosity'), +(100090,'spell_alysrazor_turn_monstrosity'), +(100091,'spell_alysrazor_turn_monstrosity'), +(100092,'spell_alysrazor_turn_monstrosity'), +(100462,'spell_alysrazor_aggro_closest'), +(100094,'spell_alysrazor_fieroblast'), +(101223,'spell_alysrazor_fieroblast'), +(101294,'spell_alysrazor_fieroblast'), +(101295,'spell_alysrazor_fieroblast'), +(101296,'spell_alysrazor_fieroblast'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (100558,100071,100074,100070,100076,100078,100080,100082,100089,100090,100091,100092); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,3,100558,0,0,31,0,3,54019,0,0,0,0,'','Sacrifice to the Flame - Captive Druid of the Talon'), +(13,1,100071,0,0,31,0,3,53787,0,0,0,0,'','Molten Barrage'), +(13,1,100074,0,0,31,0,3,53788,0,0,0,0,'','Molten Barrage'), +(13,2,100070,0,0,31,0,3,53786,0,0,0,0,'','Molten Barrage - Blazing Monstrosity'), +(13,2,100070,0,1,31,0,3,53791,0,0,0,0,'','Molten Barrage - Blazing Monstrosity'), +(13,2,100070,0,2,31,0,3,53793,0,0,0,0,'','Molten Barrage - Harbinger of Flame'), +(13,2,100070,0,3,31,0,3,53795,0,0,0,0,'','Molten Barrage - Egg Pile'), +(13,2,100070,0,4,31,0,3,53794,0,0,0,0,'','Molten Barrage - Smouldering Hatchling'), +(13,1,100076,0,0,31,0,3,53787,0,0,0,0,'','Left-Side Smack - Molten Barrage'), +(13,2,100076,0,1,31,0,3,53786,0,0,0,0,'','Left-Side Smack - Blazing Monstrosity'), +(13,1,100078,0,0,31,0,3,53787,0,0,0,0,'','Right-Side Smack - Molten Barrage'), +(13,2,100078,0,1,31,0,3,53786,0,0,0,0,'','Right-Side Smack - Blazing Monstrosity'), +(13,1,100080,0,0,31,0,3,53787,0,0,0,0,'','Head Bonk - Molten Barrage'), +(13,2,100080,0,1,31,0,3,53786,0,0,0,0,'','Head Bonk - Blazing Monstrosity'), +(13,1,100082,0,0,31,0,3,53787,0,0,0,0,'','Tickle - Molten Barrage'), +(13,2,100082,0,1,31,0,3,53786,0,0,0,0,'','Tickle - Blazing Monstrosity'), +(13,1,100089,0,0,31,0,3,53788,0,0,0,0,'','Head Bonk - Molten Barrage'), +(13,2,100089,0,1,31,0,3,53791,0,0,0,0,'','Head Bonk - Blazing Monstrosity'), +(13,1,100090,0,0,31,0,3,53788,0,0,0,0,'','Left-Side Smack - Molten Barrage'), +(13,2,100090,0,1,31,0,3,53791,0,0,0,0,'','Left-Side Smack - Blazing Monstrosity'), +(13,1,100091,0,0,31,0,3,53788,0,0,0,0,'','Right-Side Smack - Molten Barrage'), +(13,2,100091,0,1,31,0,3,53791,0,0,0,0,'','Right-Side Smack - Blazing Monstrosity'), +(13,1,100092,0,0,31,0,3,53788,0,0,0,0,'','Tickle - Molten Barrage'), +(13,2,100092,0,1,31,0,3,53791,0,0,0,0,'','Tickle - Blazing Monstrosity'); diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index 570fe23478f..f8e58220a3e 100644 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -332,6 +332,8 @@ void AddSC_instance_halls_of_origination(); void AddSC_boss_temple_guardian_anhuur(); void AddSC_boss_earthrager_ptah(); void AddSC_boss_anraphet(); +void AddSC_instance_firelands(); +void AddSC_boss_alysrazor(); void AddSC_ashenvale(); void AddSC_azshara(); @@ -991,6 +993,9 @@ void AddKalimdorScripts() AddSC_boss_temple_guardian_anhuur(); AddSC_boss_earthrager_ptah(); AddSC_boss_anraphet(); + + AddSC_instance_firelands(); + AddSC_boss_alysrazor(); #endif } diff --git a/src/server/scripts/Kalimdor/CMakeLists.txt b/src/server/scripts/Kalimdor/CMakeLists.txt index fc75444bda6..44f48a1c35e 100644 --- a/src/server/scripts/Kalimdor/CMakeLists.txt +++ b/src/server/scripts/Kalimdor/CMakeLists.txt @@ -116,6 +116,9 @@ set(scripts_STAT_SRCS Kalimdor/HallsOfOrigination/boss_temple_guardian_anhuur.cpp Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp Kalimdor/HallsOfOrigination/boss_anraphet.cpp + Kalimdor/Firelands/instance_firelands.cpp + Kalimdor/Firelands/firelands.h + Kalimdor/Firelands/boss_alysrazor.cpp ) message(" -> Prepared: Kalimdor") diff --git a/src/server/scripts/Kalimdor/Firelands/boss_alysrazor.cpp b/src/server/scripts/Kalimdor/Firelands/boss_alysrazor.cpp new file mode 100644 index 00000000000..e4ab2265027 --- /dev/null +++ b/src/server/scripts/Kalimdor/Firelands/boss_alysrazor.cpp @@ -0,0 +1,703 @@ +/* + * Copyright (C) 2008-2013 TrinityCore + * + * 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; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; 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, see . + */ + +#include "ObjectMgr.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "SpellScript.h" +#include "MoveSplineInit.h" +#include "Cell.h" +#include "CellImpl.h" +#include "GridNotifiers.h" +#include "GridNotifiersImpl.h" +#include "firelands.h" + +enum Texts +{ + // Egg Pile + EMOTE_CRACKING_EGGS = 0, // The Molten Eggs begin to crack and splinter! +}; + +enum Spells +{ + // Harbinger of Flame + SPELL_FIRE_IT_UP = 100093, + SPELL_FIEROBLAST_TRASH = 100094, + SPELL_FIEROCLAST_BARRAGE = 100095, + SPELL_FIRE_CHANNELING = 100109, + + // Blazing Monstrosity + SPELL_RIDE_MONSTROSITY = 93970, + SPELL_SHARE_HEALTH_LEFT = 101502, + SPELL_SHARE_HEALTH_RIGHT = 101503, + SPELL_SLEEP_ULTRA_HIGH_PRIORITY = 99480, + SPELL_GENERIC_DUMMY_CAST = 100088, + SPELL_LEFT_SIDE_SMACK_L = 100076, + SPELL_RIGHT_SIDE_SMACK_L = 100078, + SPELL_HEAD_BONK_L = 100080, + SPELL_TICKLE_L = 100082, + SPELL_KNOCKBACK_RIGHT = 100084, + SPELL_KNOCKBACK_LEFT = 100085, + SPELL_KNOCKBACK_FORWARD = 100086, + SPELL_KNOCKBACK_BACK = 100087, + SPELL_HEAD_BONK_R = 100089, + SPELL_LEFT_SIDE_SMACK_R = 100090, + SPELL_RIGHT_SIDE_SMACK_R = 100091, + SPELL_TICKLE_R = 100092, + SPELL_MOLTEN_BARRAGE_EFFECT_L = 100071, + SPELL_MOLTEN_BARRAGE_LEFT = 100072, + SPELL_MOLTEN_BARRAGE_RIGHT = 100073, + SPELL_MOLTEN_BARRAGE_EFFECT_R = 100074, + SPELL_MOLTEN_BARRAGE_VISUAL = 100075, + SPELL_AGGRO_CLOSEST = 100462, + SPELL_INVISIBILITY_AND_STEALTH_DETECTION = 18950, + + // Egg Pile + SPELL_SUMMON_SMOULDERING_HATCHLING = 100096, + SPELL_MOLTEN_EGG_TRASH_CALL_L = 100097, + SPELL_MOLTEN_EGG_TRASH_CALL_R = 100098, + SPELL_ALYSRAZOR_COSMETIC_EGG_XPLOSION = 100099, +}; + +#define SPELL_SHARE_HEALTH (me->GetEntry() == NPC_BLAZING_MONSTROSITY_LEFT ? SPELL_SHARE_HEALTH_LEFT : SPELL_SHARE_HEALTH_RIGHT) +#define SPELL_MOLTEN_BARRAGE (me->GetEntry() == NPC_BLAZING_MONSTROSITY_LEFT ? SPELL_MOLTEN_BARRAGE_LEFT : SPELL_MOLTEN_BARRAGE_RIGHT) +#define SPELL_MOLTEN_BARRAGE_EFFECT (me->GetEntry() == NPC_BLAZING_MONSTROSITY_LEFT ? SPELL_MOLTEN_BARRAGE_EFFECT_L : SPELL_MOLTEN_BARRAGE_EFFECT_R) + +enum Events +{ + // Blazing Monstrosity + EVENT_START_SPITTING = 1, + EVENT_CONTINUE_SPITTING = 2, + + // Harbinger of Flame + EVENT_FIEROBLAST = 1, + EVENT_FIEROCLAST_BARRAGE = 2, + + // Egg Pile + EVENT_SUMMON_SMOULDERING_HATCHLING = 1, +}; + +enum MiscData +{ + MODEL_INVISIBLE_STALKER = 11686, + ANIM_KIT_BIRD_WAKE = 1469, + ANIM_KIT_BIRD_TURN = 1473, +}; + +class RespawnEggEvent : public BasicEvent +{ + public: + explicit RespawnEggEvent(Creature* egg) : _egg(egg) { } + + bool Execute(uint64 /*time*/, uint32 /*diff*/) + { + _egg->RestoreDisplayId(); + return true; + } + + private: + Creature* _egg; +}; + +class MoltenEggCheck +{ + public: + explicit MoltenEggCheck(Creature* pile) : _eggPile(pile) { } + + bool operator()(Unit* object) const + { + if (object->GetEntry() != NPC_MOLTEN_EGG_TRASH) + return false; + + if (object->GetDisplayId() != object->GetNativeDisplayId()) + return false; + + if (_eggPile->GetDistance2d(object) > 20.0f) + return false; + + return true; + } + + private: + Creature* _eggPile; +}; + +class TrashRespawnWorker +{ + public: + void operator()(Creature* creature) const + { + switch (creature->GetEntry()) + { + case NPC_BLAZING_MONSTROSITY_LEFT: + case NPC_BLAZING_MONSTROSITY_RIGHT: + case NPC_EGG_PILE: + case NPC_HARBINGER_OF_FLAME: + case NPC_MOLTEN_EGG_TRASH: + if (!creature->isAlive()) + creature->Respawn(true); + break; + case NPC_SMOULDERING_HATCHLING: + creature->DespawnOrUnsummon(); + break; + } + } +}; + +static void AlysrazorTrashEvaded(Creature* creature) +{ + TrashRespawnWorker check; + Trinity::CreatureWorker worker(creature, check); + creature->VisitNearbyGridObject(SIZE_OF_GRIDS, worker); +} + +class npc_harbinger_of_flame : public CreatureScript +{ + public: + npc_harbinger_of_flame() : CreatureScript("npc_harbinger_of_flame") { } + + struct npc_harbinger_of_flameAI : public ScriptedAI + { + npc_harbinger_of_flameAI(Creature* creature) : ScriptedAI(creature) + { + } + + void EnterCombat(Unit* /*target*/) + { + if (Creature* bird = ObjectAccessor::GetCreature(*me, me->GetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT))) + DoZoneInCombat(bird, 200.0f); + + me->InterruptSpell(CURRENT_CHANNELED_SPELL); + _events.Reset(); + _events.ScheduleEvent(EVENT_FIEROBLAST, 1); + _events.ScheduleEvent(EVENT_FIEROCLAST_BARRAGE, 6000); + } + + void JustReachedHome() + { + AlysrazorTrashEvaded(me); + } + + void MoveInLineOfSight(Unit* unit) + { + if (me->isInCombat()) + return; + + if (!unit->isCharmedOwnedByPlayerOrPlayer()) + return; + + ScriptedAI::MoveInLineOfSight(unit); + } + + void UpdateAI(uint32 const diff) + { + if (!me->isInCombat()) + if (!me->GetCurrentSpell(CURRENT_CHANNELED_SPELL)) + if (Creature* fireBird = me->FindNearestCreature((me->GetHomePosition().GetPositionY() > -275.0f ? NPC_BLAZING_MONSTROSITY_LEFT : NPC_BLAZING_MONSTROSITY_RIGHT), 100.0f)) + DoCast(fireBird, SPELL_FIRE_CHANNELING); + + if (!UpdateVictim()) + return; + + _events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + while (uint32 eventId = _events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_FIEROBLAST: + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, false, -SPELL_RIDE_MONSTROSITY)) + DoCast(target, SPELL_FIEROBLAST_TRASH); + _events.RescheduleEvent(EVENT_FIEROBLAST, 500); // cast time is longer, but thanks to UNIT_STATE_CASTING check it won't trigger more often (need this because this creature gets a stacking haste aura) + break; + case EVENT_FIEROCLAST_BARRAGE: + DoCastAOE(SPELL_FIEROCLAST_BARRAGE); + _events.ScheduleEvent(EVENT_FIEROCLAST_BARRAGE, urand(9000, 12000)); + break; + } + } + + DoMeleeAttackIfReady(); + } + + private: + EventMap _events; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_harbinger_of_flameAI(creature); + } +}; + +class npc_blazing_monstrosity : public CreatureScript +{ + public: + npc_blazing_monstrosity() : CreatureScript("npc_blazing_monstrosity") { } + + struct npc_blazing_monstrosityAI : public PassiveAI + { + npc_blazing_monstrosityAI(Creature* creature) : PassiveAI(creature), _summons(creature) + { + } + + void EnterEvadeMode() + { + _summons.DespawnAll(); + _events.Reset(); + PassiveAI::EnterEvadeMode(); + } + + void JustDied(Unit* /*killer*/) + { + _summons.DespawnAll(); + _events.Reset(); + } + + void JustReachedHome() + { + AlysrazorTrashEvaded(me); + } + + void EnterCombat(Unit* /*target*/) + { + DoZoneInCombat(); + me->RemoveAurasDueToSpell(SPELL_SLEEP_ULTRA_HIGH_PRIORITY); + me->PlayOneShotAnimKit(ANIM_KIT_BIRD_WAKE); + _events.Reset(); + _events.ScheduleEvent(EVENT_START_SPITTING, 6000); + _events.ScheduleEvent(EVENT_CONTINUE_SPITTING, 9000); + } + + void PassengerBoarded(Unit* passenger, int8 /*seat*/, bool apply) + { + if (!apply) + return; + + // Our passenger is another vehicle (boardable by players) + DoCast(passenger, SPELL_SHARE_HEALTH, true); + passenger->setFaction(35); + passenger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + // Hack to relocate vehicle on vehicle so exiting players are not moved under map + Movement::MoveSplineInit init(*passenger); + init.DisableTransportPathTransformations(); + init.MoveTo(0.6654003f, 0.0f, 1.9815f); + init.SetFacing(0.0f); + init.Launch(); + } + + void JustSummoned(Creature* summon) + { + _summons.Summon(summon); + } + + void SummonedCreatureDespawn(Creature* summon) + { + _summons.Despawn(summon); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + _events.Update(diff); + + while (uint32 eventId = _events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_START_SPITTING: + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, false, -SPELL_RIDE_MONSTROSITY)) + DoCast(target, SPELL_MOLTEN_BARRAGE); + break; + case EVENT_CONTINUE_SPITTING: + DoCastAOE(SPELL_MOLTEN_BARRAGE_EFFECT); + if (Creature* egg = me->FindNearestCreature(NPC_EGG_PILE, 100.0f)) + egg->AI()->DoAction(me->GetEntry()); + break; + } + } + } + + private: + SummonList _summons; + EventMap _events; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_blazing_monstrosityAI(creature); + } +}; + +class npc_molten_barrage : public CreatureScript +{ + public: + npc_molten_barrage() : CreatureScript("npc_molten_barrage") { } + + struct npc_molten_barrageAI : public NullCreatureAI + { + npc_molten_barrageAI(Creature* creature) : NullCreatureAI(creature) + { + } + + void AttackStart(Unit* target) + { + if (target) + me->GetMotionMaster()->MoveFollow(target, 0.0f, 0.0f, MOTION_SLOT_IDLE); + } + + void IsSummonedBy(Unit* /*summoner*/) + { + DoCastAOE(SPELL_AGGRO_CLOSEST, true); + DoCast(me, SPELL_MOLTEN_BARRAGE_VISUAL); + DoCast(me, SPELL_INVISIBILITY_AND_STEALTH_DETECTION, true); + } + + void MovementInform(uint32 movementType, uint32 /*pointId*/) + { + if (movementType != EFFECT_MOTION_TYPE) + return; + + DoCastAOE(SPELL_AGGRO_CLOSEST); + me->ClearUnitState(UNIT_STATE_CANNOT_TURN); + } + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_molten_barrageAI(creature); + } +}; + +class npc_egg_pile : public CreatureScript +{ + public: + npc_egg_pile() : CreatureScript("npc_egg_pile") { } + + struct npc_egg_pileAI : public CreatureAI + { + npc_egg_pileAI(Creature* creature) : CreatureAI(creature) + { + } + + void AttackStart(Unit* /*target*/) { } + + void Reset() + { + me->SetReactState(REACT_PASSIVE); + _events.Reset(); + _callHatchlingSpell = 0; + } + + void JustDied(Unit* /*killer*/) + { + _events.Reset(); + std::list eggs; + GetCreatureListWithEntryInGrid(eggs, me, NPC_MOLTEN_EGG_TRASH, 20.0f); + for (std::list::const_iterator itr = eggs.begin(); itr != eggs.end(); ++itr) + (*itr)->CastSpell(*itr, SPELL_ALYSRAZOR_COSMETIC_EGG_XPLOSION, TRIGGERED_FULL_MASK); + + DoCast(me, SPELL_ALYSRAZOR_COSMETIC_EGG_XPLOSION, true); + } + + void JustReachedHome() + { + AlysrazorTrashEvaded(me); + } + + void DoAction(int32 const action) + { + if (action != NPC_BLAZING_MONSTROSITY_LEFT && + action != NPC_BLAZING_MONSTROSITY_RIGHT) + return; + + if (action == NPC_BLAZING_MONSTROSITY_LEFT) + Talk(EMOTE_CRACKING_EGGS); + + _callHatchlingSpell = (action == NPC_BLAZING_MONSTROSITY_LEFT) ? SPELL_MOLTEN_EGG_TRASH_CALL_L : SPELL_MOLTEN_EGG_TRASH_CALL_R; + DoZoneInCombat(); + _events.Reset(); + _events.ScheduleEvent(EVENT_SUMMON_SMOULDERING_HATCHLING, 1); + } + + void UpdateAI(uint32 const diff) + { + if (!UpdateVictim()) + return; + + _events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + while (uint32 eventId = _events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_SUMMON_SMOULDERING_HATCHLING: + { + std::list eggs; + MoltenEggCheck check(me); + Trinity::CreatureListSearcher searcher(me, eggs, check); + me->VisitNearbyGridObject(20.0f, searcher); + if (!eggs.empty()) + { + Creature* egg = Trinity::Containers::SelectRandomContainerElement(eggs); + egg->CastSpell(egg, SPELL_SUMMON_SMOULDERING_HATCHLING, TRIGGERED_FULL_MASK); + egg->SetDisplayId(MODEL_INVISIBLE_STALKER); + egg->m_Events.AddEvent(new RespawnEggEvent(egg), egg->m_Events.CalculateTime(5000)); + } + + if (_callHatchlingSpell) + DoCastAOE(_callHatchlingSpell, true); + _events.ScheduleEvent(EVENT_SUMMON_SMOULDERING_HATCHLING, urand(6000, 10000)); + break; + } + default: + break; + } + } + + DoMeleeAttackIfReady(); + } + + private: + EventMap _events; + uint32 _callHatchlingSpell; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_egg_pileAI(creature); + } +}; + +class spell_alysrazor_cosmetic_egg_xplosion : public SpellScriptLoader +{ + public: + spell_alysrazor_cosmetic_egg_xplosion() : SpellScriptLoader("spell_alysrazor_cosmetic_egg_xplosion") { } + + class spell_alysrazor_cosmetic_egg_xplosion_SpellScript : public SpellScript + { + PrepareSpellScript(spell_alysrazor_cosmetic_egg_xplosion_SpellScript); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sCreatureDisplayInfoStore.LookupEntry(MODEL_INVISIBLE_STALKER)) + return false; + return true; + } + + void HandleExplosion(SpellEffIndex effIndex) + { + PreventHitDefaultEffect(effIndex); + GetHitUnit()->SetDisplayId(MODEL_INVISIBLE_STALKER); + if (Creature* creature = GetHitCreature()) + creature->DespawnOrUnsummon(4000); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_alysrazor_cosmetic_egg_xplosion_SpellScript::HandleExplosion, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_alysrazor_cosmetic_egg_xplosion_SpellScript(); + } +}; + +class spell_alysrazor_turn_monstrosity : public SpellScriptLoader +{ + public: + spell_alysrazor_turn_monstrosity() : SpellScriptLoader("spell_alysrazor_turn_monstrosity") { } + + class spell_alysrazor_turn_monstrosity_SpellScript : public SpellScript + { + PrepareSpellScript(spell_alysrazor_turn_monstrosity_SpellScript); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_GENERIC_DUMMY_CAST)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_KNOCKBACK_RIGHT)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_KNOCKBACK_LEFT)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_KNOCKBACK_FORWARD)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_KNOCKBACK_BACK)) + return false; + return true; + } + + void KnockBarrage(SpellEffIndex effIndex) + { + PreventHitDefaultEffect(effIndex); + GetHitUnit()->GetMotionMaster()->MoveIdle(); + if (TempSummon* summ = GetHitUnit()->ToTempSummon()) + if (Unit* summoner = summ->GetSummoner()) + GetHitUnit()->CastSpell(summoner, SPELL_GENERIC_DUMMY_CAST, TRIGGERED_FULL_MASK); + + float angle = 0.0f; + if (Unit* bird = GetCaster()->GetVehicleBase()) + { + bird->SetInFront(GetHitUnit()); + angle = bird->GetOrientation(); + } + + uint32 spellId = 0; + switch (GetSpellInfo()->Id) + { + case SPELL_RIGHT_SIDE_SMACK_R: + case SPELL_RIGHT_SIDE_SMACK_L: + spellId = SPELL_KNOCKBACK_RIGHT; + angle -= M_PI * 0.5f; + break; + case SPELL_LEFT_SIDE_SMACK_R: + case SPELL_LEFT_SIDE_SMACK_L: + spellId = SPELL_KNOCKBACK_LEFT; + angle += M_PI * 0.5f; + break; + case SPELL_HEAD_BONK_R: + case SPELL_HEAD_BONK_L: + spellId = SPELL_KNOCKBACK_FORWARD; + break; + case SPELL_TICKLE_R: + case SPELL_TICKLE_L: + spellId = SPELL_KNOCKBACK_BACK; + angle -= M_PI; + break; + } + + // Cannot wait for object update to process facing spline, it's needed in next spell cast + GetHitUnit()->SetOrientation(angle); + GetHitUnit()->SetFacingTo(angle); + GetHitUnit()->AddUnitState(UNIT_STATE_CANNOT_TURN); + GetHitUnit()->CastSpell(GetHitUnit(), spellId, TRIGGERED_FULL_MASK); + } + + void TurnBird(SpellEffIndex effIndex) + { + PreventHitDefaultEffect(effIndex); + GetHitUnit()->PlayOneShotAnimKit(ANIM_KIT_BIRD_TURN); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_alysrazor_turn_monstrosity_SpellScript::KnockBarrage, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + OnEffectHitTarget += SpellEffectFn(spell_alysrazor_turn_monstrosity_SpellScript::TurnBird, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_alysrazor_turn_monstrosity_SpellScript(); + } +}; + +class spell_alysrazor_aggro_closest : public SpellScriptLoader +{ + public: + spell_alysrazor_aggro_closest() : SpellScriptLoader("spell_alysrazor_aggro_closest") { } + + class spell_alysrazor_aggro_closest_SpellScript : public SpellScript + { + PrepareSpellScript(spell_alysrazor_aggro_closest_SpellScript); + + bool Load() + { + return GetCaster()->GetTypeId() == TYPEID_UNIT; + } + + void HandleEffect(SpellEffIndex effIndex) + { + PreventHitDefaultEffect(effIndex); + float curThreat = GetCaster()->getThreatManager().getThreat(GetHitUnit(), true); + GetCaster()->getThreatManager().addThreat(GetHitUnit(), -curThreat + 50000.0f / std::min(1.0f, GetCaster()->GetDistance(GetHitUnit()))); + } + + void UpdateThreat() + { + GetCaster()->ClearUnitState(UNIT_STATE_CASTING); + GetCaster()->GetAI()->AttackStart(GetCaster()->ToCreature()->SelectVictim()); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_alysrazor_aggro_closest_SpellScript::HandleEffect, EFFECT_0, SPELL_EFFECT_DUMMY); + AfterCast += SpellCastFn(spell_alysrazor_aggro_closest_SpellScript::UpdateThreat); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_alysrazor_aggro_closest_SpellScript(); + } +}; + +class spell_alysrazor_fieroblast : public SpellScriptLoader +{ + public: + spell_alysrazor_fieroblast() : SpellScriptLoader("spell_alysrazor_fieroblast") { } + + class spell_alysrazor_fieroblast_SpellScript : public SpellScript + { + PrepareSpellScript(spell_alysrazor_fieroblast_SpellScript); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_FIRE_IT_UP)) + return false; + return true; + } + + void FireItUp() + { + GetCaster()->CastSpell(GetCaster(), SPELL_FIRE_IT_UP, TRIGGERED_FULL_MASK); + } + + void Register() + { + AfterCast += SpellCastFn(spell_alysrazor_fieroblast_SpellScript::FireItUp); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_alysrazor_fieroblast_SpellScript(); + } +}; + +void AddSC_boss_alysrazor() +{ + new npc_harbinger_of_flame(); + new npc_blazing_monstrosity(); + new npc_molten_barrage(); + new npc_egg_pile(); + new spell_alysrazor_cosmetic_egg_xplosion(); + new spell_alysrazor_turn_monstrosity(); + new spell_alysrazor_aggro_closest(); + new spell_alysrazor_fieroblast(); +} diff --git a/src/server/scripts/Kalimdor/Firelands/firelands.h b/src/server/scripts/Kalimdor/Firelands/firelands.h new file mode 100644 index 00000000000..f58b6e33c7c --- /dev/null +++ b/src/server/scripts/Kalimdor/Firelands/firelands.h @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2008-2013 TrinityCore + * + * 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; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; 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, see . + */ + +#ifndef FIRELANDS_H_ +#define FIRELANDS_H_ + +#include "Map.h" +#include "Creature.h" + +#define FirelandsScriptName "instance_firelands" + +uint32 const EncounterCount = 7; + +enum DataTypes +{ + DATA_BETH_TILAC = 0, + DATA_LORD_RHYOLITH = 1, + DATA_SHANNOX = 2, + DATA_ALYSRAZOR = 3, + DATA_BALEROC = 4, + DATA_MAJORDOMO_STAGHELM = 5, + DATA_RAGNAROS = 6, +}; + +enum CreatureIds +{ + NPC_BLAZING_MONSTROSITY_LEFT = 53786, + NPC_BLAZING_MONSTROSITY_RIGHT = 53791, + NPC_EGG_PILE = 53795, + NPC_HARBINGER_OF_FLAME = 53793, + NPC_MOLTEN_EGG_TRASH = 53914, + NPC_SMOULDERING_HATCHLING = 53794, +}; + +class DelayedAttackStartEvent : public BasicEvent +{ + public: + DelayedAttackStartEvent(Creature* owner) : _owner(owner) { } + + bool Execute(uint64 /*e_time*/, uint32 /*p_time*/) + { + _owner->AI()->DoZoneInCombat(_owner, 200.0f); + return true; + } + + private: + Creature* _owner; +}; + +template +CreatureAI* GetFirelandsAI(Creature* creature) +{ + if (InstanceMap* instance = creature->GetMap()->ToInstanceMap()) + if (instance->GetInstanceScript()) + if (instance->GetScriptId() == sObjectMgr->GetScriptId(FirelandsScriptName)) + return new AI(creature); + return NULL; +} + +#endif // FIRELANDS_H_ \ No newline at end of file diff --git a/src/server/scripts/Kalimdor/Firelands/instance_firelands.cpp b/src/server/scripts/Kalimdor/Firelands/instance_firelands.cpp new file mode 100644 index 00000000000..dd8b2a76093 --- /dev/null +++ b/src/server/scripts/Kalimdor/Firelands/instance_firelands.cpp @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2008-2013 TrinityCore + * + * 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; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; 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, see . + */ + +#include "ScriptMgr.h" +#include "InstanceScript.h" +#include "firelands.h" + +class instance_firelands : public InstanceMapScript +{ + public: + instance_firelands() : InstanceMapScript(FirelandsScriptName, 720) { } + + struct instance_firelands_InstanceScript : public InstanceScript + { + instance_firelands_InstanceScript(InstanceMap* map) : InstanceScript(map) + { + } + + void Initialize() + { + SetBossNumber(EncounterCount); + } + + void OnCreatureCreate(Creature* creature) + { + switch (creature->GetEntry()) + { + case NPC_SMOULDERING_HATCHLING: + // Cannot directly start attacking here as the creature is not yet on map + creature->m_Events.AddEvent(new DelayedAttackStartEvent(creature), creature->m_Events.CalculateTime(500)); + break; + } + } + }; + + InstanceScript* GetInstanceScript(InstanceMap* map) const + { + return new instance_firelands_InstanceScript(map); + } +}; + +void AddSC_instance_firelands() +{ + new instance_firelands(); +} -- cgit v1.2.3 From f6b6558814b4f5da7b6928e156ae84f4d6a94bb6 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 5 Jan 2013 13:14:44 +0100 Subject: Scripts/Firelands: Fixed a *major* mistake in previous commit --- src/server/scripts/Kalimdor/Firelands/firelands.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/scripts/Kalimdor/Firelands/firelands.h b/src/server/scripts/Kalimdor/Firelands/firelands.h index f58b6e33c7c..330158d6c94 100644 --- a/src/server/scripts/Kalimdor/Firelands/firelands.h +++ b/src/server/scripts/Kalimdor/Firelands/firelands.h @@ -71,4 +71,4 @@ CreatureAI* GetFirelandsAI(Creature* creature) return NULL; } -#endif // FIRELANDS_H_ \ No newline at end of file +#endif // FIRELANDS_H_ -- cgit v1.2.3 From 71b0b307129c502ccaf2129fff30963fdf9ffdd5 Mon Sep 17 00:00:00 2001 From: Tuxity Date: Wed, 9 Jan 2013 20:37:02 +0100 Subject: Core/Battleground: - Fix team logo after countdown timer expire. close #8887 - Add more options with justice and honor points in conf file, also fix a wrong cap value. - Grant back currencies when refunding an item and fix price. ref #8892 --- src/server/game/Battlegrounds/BattlegroundMgr.cpp | 2 +- src/server/game/Entities/Player/Player.cpp | 17 +++++++--- src/server/game/World/World.cpp | 39 ++++++++++------------- src/server/worldserver/worldserver.conf.dist | 23 ++++++++++++- 4 files changed, 51 insertions(+), 30 deletions(-) (limited to 'src') diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index f52e917ccdb..b95d8e85a79 100644 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -299,7 +299,7 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro data->WriteBit(bgGuid[7]); data->WriteBit(bgGuid[1]); data->WriteBit(playerGuid[5]); - data->WriteBit(player->GetBGTeam() == TEAM_ALLIANCE); // Battlefield Faction ( 0 horde, 1 alliance ) + data->WriteBit(player->GetBGTeam() == TEAM_HORDE); data->WriteBit(bgGuid[0]); data->WriteBit(playerGuid[1]); data->WriteBit(bgGuid[3]); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index b23614d4a05..cd576c8e89b 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -25985,7 +25985,7 @@ void Player::SendRefundInfo(Item* item) data.WriteByteSeq(guid[2]); for (uint8 i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i) // currency cost data { - data << uint32(iece->RequiredCurrencyCount[i]); + data << uint32(iece->RequiredCurrencyCount[i] / CURRENCY_PRECISION); data << uint32(iece->RequiredCurrency[i]); } @@ -26039,7 +26039,7 @@ void Player::SendItemRefundResult(Item* item, ItemExtendedCostEntry const* iece, { for (uint8 i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i) { - data << uint32(iece->RequiredCurrencyCount[i]); + data << uint32(iece->RequiredCurrencyCount[i] / CURRENCY_PRECISION); data << uint32(iece->RequiredCurrency[i]); } @@ -26132,7 +26132,7 @@ void Player::RefundItem(Item* item) DestroyItem(item->GetBagSlot(), item->GetSlot(), true); // Grant back extendedcost items - for (uint8 i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i) + for (uint8 i = 0; i < MAX_ITEM_EXT_COST_ITEMS; ++i) { uint32 count = iece->RequiredItemCount[i]; uint32 itemid = iece->RequiredItem[i]; @@ -26146,12 +26146,19 @@ void Player::RefundItem(Item* item) } } + // Grant back currencies + for (uint8 i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i) + { + uint32 count = iece->RequiredCurrencyCount[i]; + uint32 currencyid = iece->RequiredCurrency[i]; + if (count && currencyid) + ModifyCurrency(currencyid, count); + } + // Grant back money if (moneyRefund) ModifyMoney(moneyRefund); // Saved in SaveInventoryAndGoldToDB - // Grant back Arena and Honor points ? - SaveInventoryAndGoldToDB(trans); CharacterDatabase.CommitTransaction(trans); diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index d291d1d2fe9..b4d2e7933d2 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -808,11 +808,24 @@ void World::LoadConfigSettings(bool reload) sLog->outError(LOG_FILTER_SERVER_LOADING, "Currency.StartHonorPoints (%i) must be >= 0, set to default 0.", m_int_configs[CONFIG_CURRENCY_START_HONOR_POINTS]); m_int_configs[CONFIG_CURRENCY_START_HONOR_POINTS] = 0; } - m_int_configs[CONFIG_CURRENCY_MAX_HONOR_POINTS] = ConfigMgr::GetIntDefault("Currency.MaxHonorPoints", 40000); + m_int_configs[CONFIG_CURRENCY_MAX_HONOR_POINTS] = ConfigMgr::GetIntDefault("Currency.MaxHonorPoints", 400000); if (int32(m_int_configs[CONFIG_CURRENCY_MAX_HONOR_POINTS]) < 0) { - sLog->outError(LOG_FILTER_SERVER_LOADING, "Currency.MaxHonorPoints (%i) can't be negative. Set to 0.", m_int_configs[CONFIG_CURRENCY_MAX_HONOR_POINTS]); - m_int_configs[CONFIG_CURRENCY_MAX_HONOR_POINTS] = 0; + sLog->outError(LOG_FILTER_SERVER_LOADING, "Currency.MaxHonorPoints (%i) can't be negative. Set to default 400000 (with precision).", m_int_configs[CONFIG_CURRENCY_MAX_HONOR_POINTS]); + m_int_configs[CONFIG_CURRENCY_MAX_HONOR_POINTS] = 400000; + } + + m_int_configs[CONFIG_CURRENCY_START_JUSTICE_POINTS] = ConfigMgr::GetIntDefault("Currency.StartJusticePoints", 0); + if (int32(m_int_configs[CONFIG_CURRENCY_START_JUSTICE_POINTS]) < 0) + { + sLog->outError(LOG_FILTER_SERVER_LOADING, "Currency.StartJusticePoints (%i) must be >= 0, set to default 0.", m_int_configs[CONFIG_CURRENCY_START_JUSTICE_POINTS]); + m_int_configs[CONFIG_CURRENCY_START_JUSTICE_POINTS] = 0; + } + m_int_configs[CONFIG_CURRENCY_MAX_JUSTICE_POINTS] = ConfigMgr::GetIntDefault("Currency.MaxJusticePoints", 400000); + if (int32(m_int_configs[CONFIG_CURRENCY_MAX_JUSTICE_POINTS]) < 0) + { + sLog->outError(LOG_FILTER_SERVER_LOADING, "Currency.MaxJusticePoints (%i) can't be negative. Set to default 400000 (with precision).", m_int_configs[CONFIG_CURRENCY_MAX_JUSTICE_POINTS]); + m_int_configs[CONFIG_CURRENCY_MAX_JUSTICE_POINTS] = 400000; } m_int_configs[CONFIG_CURRENCY_START_CONQUEST_POINTS] = ConfigMgr::GetIntDefault("Currency.StartConquestPoints", 0); @@ -837,26 +850,6 @@ void World::LoadConfigSettings(bool reload) } m_int_configs[CONFIG_CURRENCY_CONQUEST_POINTS_ARENA_REWARD] *= 100; //precision mod - m_int_configs[CONFIG_CURRENCY_START_JUSTICE_POINTS] = ConfigMgr::GetIntDefault("StartJusticePoints", 0); - if (int32(m_int_configs[CONFIG_CURRENCY_START_JUSTICE_POINTS]) < 0) - { - sLog->outError(LOG_FILTER_SERVER_LOADING, "StartJusticePoints (%i) must be in range 0..MaxJusticePoints(%u). Set to %u.", - m_int_configs[CONFIG_CURRENCY_START_JUSTICE_POINTS], m_int_configs[CONFIG_CURRENCY_MAX_JUSTICE_POINTS], 0); - m_int_configs[CONFIG_CURRENCY_START_JUSTICE_POINTS] = 0; - } - else if (m_int_configs[CONFIG_CURRENCY_START_JUSTICE_POINTS] > m_int_configs[CONFIG_CURRENCY_MAX_JUSTICE_POINTS]) - { - sLog->outError(LOG_FILTER_SERVER_LOADING, "StartJusticePoints (%i) must be in range 0..MaxJusticePoints(%u). Set to %u.", - m_int_configs[CONFIG_CURRENCY_START_JUSTICE_POINTS], m_int_configs[CONFIG_CURRENCY_MAX_JUSTICE_POINTS], m_int_configs[CONFIG_CURRENCY_MAX_JUSTICE_POINTS]); - m_int_configs[CONFIG_CURRENCY_START_JUSTICE_POINTS] = m_int_configs[CONFIG_CURRENCY_MAX_JUSTICE_POINTS]; - } - m_int_configs[CONFIG_CURRENCY_MAX_JUSTICE_POINTS] = ConfigMgr::GetIntDefault("MaxJusticePoints", 400000); - if (int32(m_int_configs[CONFIG_CURRENCY_MAX_JUSTICE_POINTS]) < 0) - { - sLog->outError(LOG_FILTER_SERVER_LOADING, "MaxJusticePoints (%i) can't be negative. Set to 0.", m_int_configs[CONFIG_CURRENCY_MAX_JUSTICE_POINTS]); - m_int_configs[CONFIG_CURRENCY_MAX_JUSTICE_POINTS] = 0; - } - m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL] = ConfigMgr::GetIntDefault("RecruitAFriend.MaxLevel", 60); if (m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL] > m_int_configs[CONFIG_MAX_PLAYER_LEVEL]) { diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index 05c756c757c..22f99dbb04c 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -2860,12 +2860,33 @@ Guild.WeeklyReputationCap = 4375 # CURRENCIES SETTINGS # # Currency.StartHonorPoints -# Amount of honor that new players will start with +# Amount of honor points that new players will start with # Default: 0 (with precision) # Currency.StartHonorPoints = 0 +# Currency.MaxHonorPoints +# Max honor points of players +# Default: 400000 (with precision) +# + +Currency.MaxHonorPoints = 400000 + +# Currency.StartJusticePoints +# Amount of justice points that new players will start with +# Default: 0 (with precision) +# + +Currency.StartJusticePoints = 0 + +# Currency.MaxJusticePoints +# Max justice points of players +# Default: 400000 (with precision) +# + +Currency.MaxJusticePoints = 400000 + # # Currency.StartConquestPoints # Amount of conquest points that new players will start with -- cgit v1.2.3 From d754ca16fb32a84f27ab02190015a34c985d336f Mon Sep 17 00:00:00 2001 From: Tuxity Date: Thu, 10 Jan 2013 10:02:32 +0100 Subject: Core/Battleground: Fix team logo at countdown timer expire by @Vincent-Michael Fix typo when refunding currencies, thx @kennylive --- src/server/game/Battlegrounds/BattlegroundMgr.cpp | 4 ++-- src/server/game/Entities/Player/Player.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index b95d8e85a79..7fc344c759a 100644 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -299,7 +299,7 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro data->WriteBit(bgGuid[7]); data->WriteBit(bgGuid[1]); data->WriteBit(playerGuid[5]); - data->WriteBit(player->GetBGTeam() == TEAM_HORDE); + data->WriteBit(player->GetBGTeam() == HORDE ? 0 : 1); data->WriteBit(bgGuid[0]); data->WriteBit(playerGuid[1]); data->WriteBit(bgGuid[3]); @@ -399,7 +399,7 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg) data->WriteBit(playerGUID[5]); data->WriteBit(playerGUID[1]); data->WriteBit(playerGUID[6]); - data->WriteBit(player->GetBGTeam() == TEAM_ALLIANCE); + data->WriteBit(player->GetBGTeam() == HORDE ? 0 : 1); data->WriteBit(playerGUID[7]); buff << uint32(itr->second->HealingDone); // healing done diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index cd576c8e89b..117b461e6b6 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -26152,7 +26152,7 @@ void Player::RefundItem(Item* item) uint32 count = iece->RequiredCurrencyCount[i]; uint32 currencyid = iece->RequiredCurrency[i]; if (count && currencyid) - ModifyCurrency(currencyid, count); + ModifyCurrency(currencyid, count / CURRENCY_PRECISION); } // Grant back money -- cgit v1.2.3 From 3c8a9576923d226386578f6e7eba07b9e7bbc2e5 Mon Sep 17 00:00:00 2001 From: Warpten Date: Thu, 10 Jan 2013 12:00:11 +0100 Subject: Core/GuildFinder: Fixed a missing typecast. Also correctly display the guild's achievement points. --- src/server/game/Handlers/GuildFinderHandler.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/GuildFinderHandler.cpp b/src/server/game/Handlers/GuildFinderHandler.cpp index c374aa635ab..65b100624f2 100644 --- a/src/server/game/Handlers/GuildFinderHandler.cpp +++ b/src/server/game/Handlers/GuildFinderHandler.cpp @@ -127,26 +127,26 @@ void WorldSession::HandleGuildFinderBrowse(WorldPacket& recvPacket) data.WriteBit(guildGUID[6]); data.WriteBit(guildGUID[3]); - bufferData << int32(guild->GetEmblemInfo().GetColor()); - bufferData << int32(guild->GetEmblemInfo().GetBorderStyle()); // Guessed - bufferData << int32(guild->GetEmblemInfo().GetStyle()); + bufferData << uint32(guild->GetEmblemInfo().GetColor()); + bufferData << uint32(guild->GetEmblemInfo().GetBorderStyle()); // Guessed + bufferData << uint32(guild->GetEmblemInfo().GetStyle()); bufferData.WriteString(guildSettings.GetComment()); - bufferData << uint8(0); // Cached ? Idk + bufferData << uint8(0); // Unk bufferData.WriteByteSeq(guildGUID[5]); - bufferData << uint32(guildSettings.GetInterests()); // Guild Interests + bufferData << uint32(guildSettings.GetInterests()); bufferData.WriteByteSeq(guildGUID[6]); bufferData.WriteByteSeq(guildGUID[4]); - bufferData << guild->GetLevel(); + bufferData << uint32(guild->GetLevel()); bufferData.WriteString(guild->GetName()); - bufferData << int32(0); // guild->GetAchievementMgr().GetAchievementPoints() + bufferData << uint32(guild->GetAchievementMgr().GetAchievementPoints()); bufferData.WriteByteSeq(guildGUID[7]); @@ -159,13 +159,13 @@ void WorldSession::HandleGuildFinderBrowse(WorldPacket& recvPacket) bufferData.WriteByteSeq(guildGUID[1]); - bufferData << int32(guild->GetEmblemInfo().GetBackgroundColor()); + bufferData << uint32(guild->GetEmblemInfo().GetBackgroundColor()); bufferData << uint32(0); // Unk Int 2 (+ 128) // Always 0 or 1 - bufferData << int32(guild->GetEmblemInfo().GetBorderColor()); + bufferData << uint32(guild->GetEmblemInfo().GetBorderColor()); bufferData << uint32(guildSettings.GetClassRoles()); bufferData.WriteByteSeq(guildGUID[3]); - bufferData << int32(guild->GetMembersCount()); + bufferData << uint32(guild->GetMembersCount()); } data.FlushBits(); -- cgit v1.2.3 From 2f48fe7cf1b2a9ac00bff2e9694b52764f2c62c4 Mon Sep 17 00:00:00 2001 From: Tuxity Date: Thu, 10 Jan 2013 14:18:14 +0100 Subject: Core/Currency: - Fix a typo in conquest points formulas - Correctly fix max justice and honor points - Remove a previous fix when refunding an item, my mistake ref #8892 --- src/server/game/Entities/Player/Player.cpp | 47 ++++++++++++-------- src/server/game/Entities/Player/Player.h | 8 ++++ src/server/game/Miscellaneous/Formulas.h | 5 ++- src/server/game/World/World.cpp | 14 +++--- src/server/worldserver/worldserver.conf.dist | 64 +++++++++++++++------------- 5 files changed, 83 insertions(+), 55 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 117b461e6b6..c688bfd95f9 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -7437,6 +7437,11 @@ void Player::ModifyCurrency(uint32 id, int32 count, bool printLog/* = true*/, bo if (weekCap && count > int32(weekCap)) count = weekCap; + // count can't be more then totalCap if used (totalCap > 0) + uint32 totalCap = _GetCurrencyTotalCap(currency); + if (totalCap && count > int32(totalCap)) + count = totalCap; + int32 newTotalCount = int32(oldTotalCount) + count; if (newTotalCount < 0) newTotalCount = 0; @@ -7445,20 +7450,18 @@ void Player::ModifyCurrency(uint32 id, int32 count, bool printLog/* = true*/, bo if (newWeekCount < 0) newWeekCount = 0; - ASSERT(weekCap >= oldWeekCount); - // if we get more then weekCap just set to limit if (weekCap && int32(weekCap) < newWeekCount) { newWeekCount = int32(weekCap); - // weekCap - oldWeekCount alwayt >= 0 as we set limit before! + // weekCap - oldWeekCount always >= 0 as we set limit before! newTotalCount = oldTotalCount + (weekCap - oldWeekCount); } // if we get more then totalCap set to maximum; - if (currency->TotalCap && int32(currency->TotalCap) < newTotalCount) + if (totalCap && int32(totalCap) < newTotalCount) { - newTotalCount = int32(currency->TotalCap); + newTotalCount = int32(totalCap); newWeekCount = weekCap; } @@ -7571,10 +7574,29 @@ uint32 Player::_GetCurrencyWeekCap(const CurrencyTypesEntry* currency) const return _ConquestCurrencyTotalWeekCap; case CURRENCY_TYPE_CONQUEST_META_ARENA: // should add precision mod = 100 - return Trinity::Currency::ConquestRatingCalculator(_maxPersonalArenaRate) * 100; + return Trinity::Currency::ConquestRatingCalculator(_maxPersonalArenaRate) * CURRENCY_PRECISION; case CURRENCY_TYPE_CONQUEST_META_BG: // should add precision mod = 100 - return Trinity::Currency::BgConquestRatingCalculator(GetRBGPersonalRating()) * 100; + return Trinity::Currency::BgConquestRatingCalculator(GetRBGPersonalRating()) * CURRENCY_PRECISION; + } + + if (cap != currency->WeekCap && IsInWorld() && !GetSession()->PlayerLoading()) + { + WorldPacket packet(SMSG_UPDATE_CURRENCY_WEEK_LIMIT, 8); + packet << uint32(cap / ((currency->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? 100 : 1)); + packet << uint32(currency->ID); + GetSession()->SendPacket(&packet); + } + + return cap; +} + +uint32 Player::_GetCurrencyTotalCap(const CurrencyTypesEntry* currency) const +{ + uint32 cap = currency->TotalCap; + + switch (currency->ID) + { case CURRENCY_TYPE_HONOR_POINTS: { uint32 honorcap = sWorld->getIntConfig(CONFIG_CURRENCY_MAX_HONOR_POINTS); @@ -7591,16 +7613,7 @@ uint32 Player::_GetCurrencyWeekCap(const CurrencyTypesEntry* currency) const } } - if (cap != currency->WeekCap && IsInWorld() && !GetSession()->PlayerLoading()) - { - WorldPacket packet(SMSG_UPDATE_CURRENCY_WEEK_LIMIT, 8); - packet << uint32(cap / ((currency->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? 100 : 1)); - packet << uint32(currency->ID); - GetSession()->SendPacket(&packet); - } - return cap; - } void Player::SetInGuild(uint32 guildId) @@ -26152,7 +26165,7 @@ void Player::RefundItem(Item* item) uint32 count = iece->RequiredCurrencyCount[i]; uint32 currencyid = iece->RequiredCurrency[i]; if (count && currencyid) - ModifyCurrency(currencyid, count / CURRENCY_PRECISION); + ModifyCurrency(currencyid, count); } // Grant back money diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index ddff890bb6f..b6fc1599ce0 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -2935,6 +2935,14 @@ class Player : public Unit, public GridObject */ uint32 _GetCurrencyWeekCap(const CurrencyTypesEntry* currency) const; + /* + * @name _GetCurrencyTotalCap + * @brief return total cap for selected currency + + * @param currency CurrencyTypesEntry witch should get week cap + */ + uint32 _GetCurrencyTotalCap(const CurrencyTypesEntry* currency) const; + VoidStorageItem* _voidStorageItems[VOID_STORAGE_MAX_SLOT]; std::vector m_itemUpdateQueue; diff --git a/src/server/game/Miscellaneous/Formulas.h b/src/server/game/Miscellaneous/Formulas.h index 3675e633bad..8ae333f2651 100644 --- a/src/server/game/Miscellaneous/Formulas.h +++ b/src/server/game/Miscellaneous/Formulas.h @@ -235,13 +235,14 @@ namespace Trinity rate = 3000; // http://www.arenajunkies.com/topic/179536-conquest-point-cap-vs-personal-rating-chart/page__st__60#entry3085246 - return 1.4326 * ((1511.26 / (1 + 1639.28 / exp(0.00412 * rate))) + 850.15); + return uint32(1.4326 * ((1511.26 / (1 + 1639.28 / exp(0.00412 * rate))) + 850.15)); } inline uint32 BgConquestRatingCalculator(uint32 rate) { // WowWiki: Battleground ratings receive a bonus of 22.2% to the cap they generate - return ConquestRatingCalculator(rate)*1.222f; + printf("%u",uint32(round(ConquestRatingCalculator(rate) * 1.222f))); + return uint32(round(ConquestRatingCalculator(rate) * 1.222f)); } } // namespace Trinity::Currency } // namespace Trinity diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index b4d2e7933d2..215e9bb629b 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -808,12 +808,13 @@ void World::LoadConfigSettings(bool reload) sLog->outError(LOG_FILTER_SERVER_LOADING, "Currency.StartHonorPoints (%i) must be >= 0, set to default 0.", m_int_configs[CONFIG_CURRENCY_START_HONOR_POINTS]); m_int_configs[CONFIG_CURRENCY_START_HONOR_POINTS] = 0; } - m_int_configs[CONFIG_CURRENCY_MAX_HONOR_POINTS] = ConfigMgr::GetIntDefault("Currency.MaxHonorPoints", 400000); + m_int_configs[CONFIG_CURRENCY_MAX_HONOR_POINTS] = ConfigMgr::GetIntDefault("Currency.MaxHonorPoints", 4000); if (int32(m_int_configs[CONFIG_CURRENCY_MAX_HONOR_POINTS]) < 0) { - sLog->outError(LOG_FILTER_SERVER_LOADING, "Currency.MaxHonorPoints (%i) can't be negative. Set to default 400000 (with precision).", m_int_configs[CONFIG_CURRENCY_MAX_HONOR_POINTS]); - m_int_configs[CONFIG_CURRENCY_MAX_HONOR_POINTS] = 400000; + sLog->outError(LOG_FILTER_SERVER_LOADING, "Currency.MaxHonorPoints (%i) can't be negative. Set to default 4000.", m_int_configs[CONFIG_CURRENCY_MAX_HONOR_POINTS]); + m_int_configs[CONFIG_CURRENCY_MAX_HONOR_POINTS] = 4000; } + m_int_configs[CONFIG_CURRENCY_MAX_HONOR_POINTS] *= 100; //precision mod m_int_configs[CONFIG_CURRENCY_START_JUSTICE_POINTS] = ConfigMgr::GetIntDefault("Currency.StartJusticePoints", 0); if (int32(m_int_configs[CONFIG_CURRENCY_START_JUSTICE_POINTS]) < 0) @@ -821,12 +822,13 @@ void World::LoadConfigSettings(bool reload) sLog->outError(LOG_FILTER_SERVER_LOADING, "Currency.StartJusticePoints (%i) must be >= 0, set to default 0.", m_int_configs[CONFIG_CURRENCY_START_JUSTICE_POINTS]); m_int_configs[CONFIG_CURRENCY_START_JUSTICE_POINTS] = 0; } - m_int_configs[CONFIG_CURRENCY_MAX_JUSTICE_POINTS] = ConfigMgr::GetIntDefault("Currency.MaxJusticePoints", 400000); + m_int_configs[CONFIG_CURRENCY_MAX_JUSTICE_POINTS] = ConfigMgr::GetIntDefault("Currency.MaxJusticePoints", 4000); if (int32(m_int_configs[CONFIG_CURRENCY_MAX_JUSTICE_POINTS]) < 0) { - sLog->outError(LOG_FILTER_SERVER_LOADING, "Currency.MaxJusticePoints (%i) can't be negative. Set to default 400000 (with precision).", m_int_configs[CONFIG_CURRENCY_MAX_JUSTICE_POINTS]); - m_int_configs[CONFIG_CURRENCY_MAX_JUSTICE_POINTS] = 400000; + sLog->outError(LOG_FILTER_SERVER_LOADING, "Currency.MaxJusticePoints (%i) can't be negative. Set to default 4000.", m_int_configs[CONFIG_CURRENCY_MAX_JUSTICE_POINTS]); + m_int_configs[CONFIG_CURRENCY_MAX_JUSTICE_POINTS] = 4000; } + m_int_configs[CONFIG_CURRENCY_MAX_JUSTICE_POINTS] *= 100; //precision mod m_int_configs[CONFIG_CURRENCY_START_CONQUEST_POINTS] = ConfigMgr::GetIntDefault("Currency.StartConquestPoints", 0); if (int32(m_int_configs[CONFIG_CURRENCY_START_CONQUEST_POINTS]) < 0) diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index 22f99dbb04c..f32633958ec 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -2857,7 +2857,32 @@ Guild.WeeklyReputationCap = 4375 ################################################################################################### ################################################################################################### +# # CURRENCIES SETTINGS +# +# Currency.ResetInterval +# How often should currency week count reset (days) +# Default: 7 (weekly) +# + +Currency.ResetInterval = 7 + +# +# Currency.ResetWeekDay +# Week day when currency week count is reset (0..6) 0 == Sunday +# Default: 3 (Wednesday) +# + +Currency.ResetWeekDay = 3 + +# +# Currency.ResetHour +# Hour of a day when currency week count is reset (0..23) +# Default: 6 +# + +Currency.ResetHour = 6 + # # Currency.StartHonorPoints # Amount of honor points that new players will start with @@ -2866,13 +2891,15 @@ Guild.WeeklyReputationCap = 4375 Currency.StartHonorPoints = 0 +# # Currency.MaxHonorPoints -# Max honor points of players -# Default: 400000 (with precision) +# Amount honor points a player can have +# Default: 4000 # -Currency.MaxHonorPoints = 400000 +Currency.MaxHonorPoints = 4000 +# # Currency.StartJusticePoints # Amount of justice points that new players will start with # Default: 0 (with precision) @@ -2880,12 +2907,13 @@ Currency.MaxHonorPoints = 400000 Currency.StartJusticePoints = 0 +# # Currency.MaxJusticePoints -# Max justice points of players -# Default: 400000 (with precision) +# Amount honor points a player can have +# Default: 4000 # -Currency.MaxJusticePoints = 400000 +Currency.MaxJusticePoints = 4000 # # Currency.StartConquestPoints @@ -2895,30 +2923,6 @@ Currency.MaxJusticePoints = 400000 Currency.StartConquestPoints = 0 -# -# Currency.ResetInterval -# How often should currency week count reset (days) -# Default: 7 (weekly) -# - -Currency.ResetInterval = 7 - -# -# Currency.ResetWeekDay -# Week day when currency week count is reset (0..6) 0 == Sunday -# Default: 3 (Wednesday) -# - -Currency.ResetWeekDay = 3 - -# -# Currency.ResetHour -# Hour of a day when currency week count is reset (0..23) -# Default: 6 -# - -Currency.ResetHour = 6 - # # Currency.ConquestPointsDefaultWeekCap # Amount of conquest points that player can earn per week -- cgit v1.2.3 From 91c4f2c2fb825b5cf17784c600aa171766820db8 Mon Sep 17 00:00:00 2001 From: Tuxity Date: Thu, 10 Jan 2013 15:38:39 +0100 Subject: Core/Battleground: Fix asynch countdown timer for new players. close #8761 --- src/server/game/Battlegrounds/Battleground.cpp | 23 ++++++++++++++++------- src/server/game/Miscellaneous/Formulas.h | 1 - src/server/worldserver/worldserver.conf.dist | 2 +- 3 files changed, 17 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index bda8c6928a6..c148151b0f5 100644 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -298,7 +298,7 @@ void Battleground::Update(uint32 diff) } // Update start time and reset stats timer - m_StartTime += diff; + SetElapsedTime(GetElapsedTime() + diff); if (GetStatus() == STATUS_WAIT_JOIN) { m_ResetStatTimer += diff; @@ -484,7 +484,7 @@ inline void Battleground::_ProcessJoin(uint32 diff) WorldPacket data(SMSG_START_TIMER, 4+4+4); data << uint32(0); // unk - data << uint32(countdownMaxForBGType - (m_CountdownTimer / 1000)); + data << uint32(countdownMaxForBGType - (GetElapsedTime() / 1000)); data << uint32(countdownMaxForBGType); for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr) @@ -597,8 +597,8 @@ inline void Battleground::_ProcessJoin(uint32 diff) } } - if (m_EndTime > 0 && (m_EndTime -= diff) > 0) - m_EndTime -= diff; + if (GetRemainingTime() > 0 && (m_EndTime -= diff) > 0) + SetRemainingTime(GetRemainingTime() - diff); } inline void Battleground::_ProcessLeave(uint32 diff) @@ -607,10 +607,10 @@ inline void Battleground::_ProcessLeave(uint32 diff) // *** BATTLEGROUND ENDING SYSTEM *** // ********************************************************* // remove all players from battleground after 2 minutes - m_EndTime -= diff; - if (m_EndTime <= 0) + SetRemainingTime(GetRemainingTime() - diff); + if (GetRemainingTime() <= 0) { - m_EndTime = 0; + SetRemainingTime(0); BattlegroundPlayerMap::iterator itr, next; for (itr = m_Players.begin(); itr != m_Players.end(); itr = next) { @@ -1244,7 +1244,16 @@ void Battleground::AddPlayer(Player* player) else { if (GetStatus() == STATUS_WAIT_JOIN) // not started yet + { player->CastSpell(player, SPELL_PREPARATION, true); // reduces all mana cost of spells. + + int32 countdownMaxForBGType = isArena() ? ARENA_COUNTDOWN_MAX : BATTLEGROUND_COUNTDOWN_MAX; + WorldPacket data(SMSG_START_TIMER, 4+4+4); + data << uint32(0); // unk + data << uint32(countdownMaxForBGType - (GetElapsedTime() / 1000)); + data << uint32(countdownMaxForBGType); + player->GetSession()->SendPacket(&data); + } } player->ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE, ACHIEVEMENT_CRITERIA_CONDITION_BG_MAP, GetMapId(), true); diff --git a/src/server/game/Miscellaneous/Formulas.h b/src/server/game/Miscellaneous/Formulas.h index 8ae333f2651..79e1ad45fa9 100644 --- a/src/server/game/Miscellaneous/Formulas.h +++ b/src/server/game/Miscellaneous/Formulas.h @@ -241,7 +241,6 @@ namespace Trinity inline uint32 BgConquestRatingCalculator(uint32 rate) { // WowWiki: Battleground ratings receive a bonus of 22.2% to the cap they generate - printf("%u",uint32(round(ConquestRatingCalculator(rate) * 1.222f))); return uint32(round(ConquestRatingCalculator(rate) * 1.222f)); } } // namespace Trinity::Currency diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index f32633958ec..4ae9ab6c503 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -2909,7 +2909,7 @@ Currency.StartJusticePoints = 0 # # Currency.MaxJusticePoints -# Amount honor points a player can have +# Amount justice points a player can have # Default: 4000 # -- cgit v1.2.3 From 95cf2585bde1604e4ab1dc9b80011cee092281af Mon Sep 17 00:00:00 2001 From: Marius Ungureanu Date: Fri, 11 Jan 2013 02:44:08 +0200 Subject: *Core/Currency: - Fixed Tuxity's latest revisions to currency fixes. - Compilation fix. /slap Tuxity? XD Signed-off-by: Nay --- src/server/game/Entities/Player/Player.cpp | 18 ++++++++++++++++-- src/server/game/Miscellaneous/Formulas.h | 2 +- 2 files changed, 17 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index c688bfd95f9..6dc56f910d1 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -25950,6 +25950,8 @@ void Player::DeleteRefundReference(uint32 it) void Player::SendRefundInfo(Item* item) { + const CurrencyTypesEntry* currencyType; + uint32 divisor; // This function call unsets ITEM_FLAGS_REFUNDABLE if played time is over 2 hours. item->UpdatePlayedTime(this); @@ -25998,7 +26000,12 @@ void Player::SendRefundInfo(Item* item) data.WriteByteSeq(guid[2]); for (uint8 i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i) // currency cost data { - data << uint32(iece->RequiredCurrencyCount[i] / CURRENCY_PRECISION); + currencyType = sCurrencyTypesStore.LookupEntry(iece->RequiredCurrency[i]); + if (currencyType && currencyType->Flags & CURRENCY_FLAG_HIGH_PRECISION) + divisor = 100; + else + divisor = 1; + data << uint32(iece->RequiredCurrencyCount[i] / divisor); data << uint32(iece->RequiredCurrency[i]); } @@ -26037,6 +26044,8 @@ void Player::SendItemRefundResult(Item* item, ItemExtendedCostEntry const* iece, { ObjectGuid guid = item->GetGUID(); WorldPacket data(SMSG_ITEM_REFUND_RESULT, 1 + 1 + 8 + 4*8 + 4 + 4*8 + 1); + const CurrencyTypesEntry* currencyType; + uint32 divisor; data.WriteBit(guid[4]); data.WriteBit(guid[5]); data.WriteBit(guid[1]); @@ -26052,7 +26061,12 @@ void Player::SendItemRefundResult(Item* item, ItemExtendedCostEntry const* iece, { for (uint8 i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i) { - data << uint32(iece->RequiredCurrencyCount[i] / CURRENCY_PRECISION); + currencyType = sCurrencyTypesStore.LookupEntry(iece->RequiredCurrency[i]); + if (currencyType && currencyType->Flags & CURRENCY_FLAG_HIGH_PRECISION) + divisor = 100; + else + divisor = 1; + data << uint32(iece->RequiredCurrencyCount[i] / divisor); data << uint32(iece->RequiredCurrency[i]); } diff --git a/src/server/game/Miscellaneous/Formulas.h b/src/server/game/Miscellaneous/Formulas.h index 79e1ad45fa9..563468ab35d 100644 --- a/src/server/game/Miscellaneous/Formulas.h +++ b/src/server/game/Miscellaneous/Formulas.h @@ -241,7 +241,7 @@ namespace Trinity inline uint32 BgConquestRatingCalculator(uint32 rate) { // WowWiki: Battleground ratings receive a bonus of 22.2% to the cap they generate - return uint32(round(ConquestRatingCalculator(rate) * 1.222f)); + return uint32(floor(ConquestRatingCalculator(rate) * 1.222f)); } } // namespace Trinity::Currency } // namespace Trinity -- cgit v1.2.3 From a6c64c8c7e9b09a66642ca309fb1c67920d04cea Mon Sep 17 00:00:00 2001 From: Tuxity Date: Fri, 11 Jan 2013 10:42:00 +0100 Subject: Core/Formulas: Fix rounding problem in conquest rating calculator. --- src/server/game/Miscellaneous/Formulas.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Miscellaneous/Formulas.h b/src/server/game/Miscellaneous/Formulas.h index 563468ab35d..728bb5d9f97 100644 --- a/src/server/game/Miscellaneous/Formulas.h +++ b/src/server/game/Miscellaneous/Formulas.h @@ -241,7 +241,7 @@ namespace Trinity inline uint32 BgConquestRatingCalculator(uint32 rate) { // WowWiki: Battleground ratings receive a bonus of 22.2% to the cap they generate - return uint32(floor(ConquestRatingCalculator(rate) * 1.222f)); + return uint32((ConquestRatingCalculator(rate) * 1.222f) + 0.5f); } } // namespace Trinity::Currency } // namespace Trinity -- cgit v1.2.3 From c068adec529de8276d30e99c90e1920aaab579d5 Mon Sep 17 00:00:00 2001 From: Marius Ungureanu Date: Fri, 11 Jan 2013 20:34:38 +0200 Subject: Core/Opcodes: Warning fix. --- src/server/game/Handlers/MovementHandler.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp index b30632f9e7a..3d2e84c57e8 100644 --- a/src/server/game/Handlers/MovementHandler.cpp +++ b/src/server/game/Handlers/MovementHandler.cpp @@ -456,6 +456,7 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recvData) static char const* move_type_name[MAX_MOVE_TYPE] = { "Walk", "Run", "RunBack", "Swim", "SwimBack", "TurnRate", "Flight", "FlightBack", "PitchRate" }; + /* switch (opcode) { //case CMSG_MOVE_FORCE_WALK_SPEED_CHANGE_ACK: move_type = MOVE_WALK; force_move_type = MOVE_WALK; break; @@ -471,6 +472,9 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recvData) sLog->outError(LOG_FILTER_NETWORKIO, "WorldSession::HandleForceSpeedChangeAck: Unknown move type opcode: %u", opcode); return; } + */ + sLog->outError(LOG_FILTER_NETWORKIO, "WorldSession::HandleForceSpeedChangeAck: Unknown move type opcode: %u", opcode); + return; // skip all forced speed changes except last and unexpected // in run/mounted case used one ACK and it must be skipped.m_forced_speed_changes[MOVE_RUN} store both. -- cgit v1.2.3 From 95fba877fedaf833e74200a1cf537eb48aef2bc6 Mon Sep 17 00:00:00 2001 From: Marius Ungureanu Date: Fri, 11 Jan 2013 20:50:22 +0200 Subject: *Core/DBC: Updated structs. **AreaTableEntry **CharStartOutfitEntry **CurrencyTypesEntry **FactionEntry **GemPropertiesEntry **GlyphPropertiesEntry **LFGDungeonEntry **MapEntry **SkillLineAbilityEntry **SpellEntry **SpellPowerEntry **SpellShapeshiftFormEntry **TaxiNodesEntry **Removed TeamContributionPoints.dbc parsing as it is deprecated since WotLK. --- src/server/game/DataStores/DBCStores.cpp | 1 - src/server/game/DataStores/DBCStructure.h | 59 ++++++++++++++----------------- src/server/game/DataStores/DBCfmt.h | 21 ++++++----- 3 files changed, 36 insertions(+), 45 deletions(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 99d84bc779b..9ee43f8f206 100644 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -233,7 +233,6 @@ DBCStorage sTaxiPathStore(TaxiPathEntryfmt); TaxiPathNodesByPath sTaxiPathNodesByPath; static DBCStorage sTaxiPathNodeStore(TaxiPathNodeEntryfmt); -DBCStorage sTeamContributionPointsStore(TeamContributionPointsfmt); DBCStorage sTotemCategoryStore(TotemCategoryEntryfmt); DBCStorage sVehicleStore(VehicleEntryfmt); DBCStorage sVehicleSeatStore(VehicleSeatEntryfmt); diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 00e73dafc32..601e59163ab 100644 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -549,9 +549,9 @@ struct AreaTableEntry uint32 team; // 12 uint32 LiquidTypeOverride[4]; // 13-16 liquid override by type float MaxDepth; // 17, - //float unk13; // 18, - //uint32 unk19; // 19, All zeros (4.2.2) - //uint32 unk20; // 20 4.0.0 + float AmbientMultiplier; // 18 client only? + uint32 LightId; // 19 + //uint32 unk20; // 20 4.0.0 - Mounting related //uint32 unk21; // 21 4.0.0 //uint32 unk22; // 22 4.0.0 //uint32 unk23; // 23 4.0.0 @@ -668,11 +668,8 @@ struct CharStartOutfitEntry int32 ItemId[MAX_OUTFIT_ITEMS]; // 2-13 //int32 ItemDisplayId[MAX_OUTFIT_ITEMS]; // 14-25 not required at server side //int32 ItemInventorySlot[MAX_OUTFIT_ITEMS]; // 26-37 not required at server side - //uint32 Unknown1; // 38, unique values (index-like with gaps ordered in other way as ids) - //uint32 Unknown2; // 39 - //uint32 Unknown3; // 40 - //uint32 Unknown4; // 41 - //uint32 Unknown5; // 42 + uint32 PetDisplayId; // 38 Pet Model ID for starting pet + uint32 PetFamilyEntry; // 39 Pet Family Entry for starting pet }; struct CharTitlesEntry @@ -853,7 +850,7 @@ struct CurrencyTypesEntry //char* name; // 2 //char* iconName; // 3 //uint32 unk4; // 4 all 0 - //uint32 unk5; // 5 archaeology-related (?) + uint32 HasSubstitution; // 5 archaeology-related (?) uint32 SubstitutionId; // 6 uint32 TotalCap; // 7 uint32 WeekCap; // 8 @@ -944,9 +941,9 @@ struct FactionEntry float spilloverRateOut; // 20 Faction outputs rep * spilloverRateOut as spillover reputation uint32 spilloverMaxRankIn; // 21 The highest rank the faction will profit from incoming spillover //uint32 spilloverRank_unk; // 22 It does not seem to be the max standing at which a faction outputs spillover ...so no idea - char* name; // 23 m_name_lang + char* name; // 23 m_name_lang //char* description; // 24 m_description_lang - //uint32 // 25 + uint32 GroupExpansion; // 25 m_factionGroupExpansion // helpers bool CanHaveReputation() const @@ -1032,7 +1029,7 @@ struct GemPropertiesEntry // 2 m_maxcount_inv // 3 m_maxcount_item uint32 color; // 4 m_type - //uint32 // 5 + uint32 minJewelCraftingSkill; // 5 m_minJewelCraftingSkill }; struct GlyphPropertiesEntry @@ -1040,7 +1037,7 @@ struct GlyphPropertiesEntry uint32 Id; uint32 SpellId; uint32 TypeFlags; - uint32 Unk1; // GlyphIconId (SpellIcon.dbc) + uint32 IconId; // GlyphIconId (SpellIcon.dbc) }; struct GlyphSlotEntry @@ -1356,7 +1353,7 @@ struct LFGDungeonEntry uint32 reclevel; // 4 uint32 recminlevel; // 5 uint32 recmaxlevel; // 6 - int32 map; // 7 + int32 map; // 7 uint32 difficulty; // 8 uint32 flags; // 9 uint32 type; // 10 @@ -1366,6 +1363,7 @@ struct LFGDungeonEntry //uint32 unk4; // 14 uint32 grouptype; // 15 //char* desc; // 16 Description + uint32 randomCategoryId; // 17 RandomDungeonID assigned for this dungeon // Helpers uint32 Entry() const { return ID + (type << 24); } }; @@ -1438,7 +1436,7 @@ struct MapEntry float entrance_y; // 14 m_corpseY entrance y coordinate in ghost mode (in most cases = normal entrance) //uint32 timeOfDayOverride; // 15 m_timeOfDayOverride uint32 addon; // 16 m_expansionID - uint32 unk_time; // 17 m_raidOffset + uint32 expireTime; // 17 m_raidOffset //uint32 maxPlayers; // 18 m_maxPlayers int32 rootPhaseMap; // 19 new 4.0.0, mapid, related to phasing @@ -1530,7 +1528,7 @@ struct OverrideSpellDataEntry uint32 id; // 0 uint32 spellId[MAX_OVERRIDE_SPELL]; // 1-10 //uint32 unk0; // 11 - //uint32 unk3; // 12 possibly flag + //char* SpellBarName; // 12 }; struct PvPDifficultyEntry @@ -1647,8 +1645,7 @@ struct SkillLineAbilityEntry uint32 learnOnGetSkill; // 9 m_acquireMethod uint32 max_value; // 10 m_trivialSkillLineRankHigh uint32 min_value; // 11 m_trivialSkillLineRankLow - //uint32 // 12 - //uint32 // 13 4.0.0 + uint32 character_points[2]; // 12-13 m_characterPoints }; struct SoundEntriesEntry @@ -1783,7 +1780,7 @@ struct SpellEntry //uint32 spellMissileID; // 27 m_spellMissileID not used //uint32 spellDescriptionVariableID; // 28 m_spellDescriptionVariableID, 3.2.0 uint32 SpellDifficultyId; // 29 m_spellDifficultyID - id from SpellDifficulty.dbc - //float unk_f1; // 30 + float SpellCoef; // 30 uint32 SpellScalingId; // 31 SpellScaling.dbc uint32 SpellAuraOptionsId; // 32 SpellAuraOptions.dbc uint32 SpellAuraRestrictionsId; // 33 SpellAuraRestrictions.dbc @@ -1916,9 +1913,9 @@ struct SpellPowerEntry uint32 manaCostPerlevel; // 2 m_manaCostPerLevel uint32 ManaCostPercentage; // 3 m_manaCostPct uint32 manaPerSecond; // 4 m_manaPerSecond - //uint32 PowerDisplayId; // 5 m_powerDisplayID - id from PowerDisplay.dbc, new in 3.1 - //uint32 unk1; // 6 4.0.0 - //float unk2; // 7 4.3.0 + uint32 manaPerSecondPerLevel; // 5 m_manaPerSecondPerLevel + //uint32 PowerDisplayId; // 6 m_powerDisplayID - id from PowerDisplay.dbc, new in 3.1 + float ManaCostPercentageFloat; // 7 4.3.0 }; struct SpellRuneCostEntry @@ -1940,8 +1937,9 @@ struct SpellShapeshiftFormEntry //char* Name; // 2 unused uint32 flags1; // 3 int32 creatureType; // 4 <=0 humanoid, other normal creature types - //uint32 unk1; // 5 unused, related to next field + //uint32 spellIcon; // 5 unused, related to next field uint32 attackSpeed; // 6 + // Models changed, 0 is main model, the rest 3 are unused. uint32 modelID_A; // 7 alliance modelid (0 means no model) uint32 modelID_H; // 8 horde modelid (but only for one form) //uint32 unk3; // 9 unused always 0 @@ -2078,7 +2076,7 @@ struct TalentTabEntry //char* internalname; // 6 m_backgroundFile //char* description; // 7 //uint32 rolesMask; // 8 4.0.0 - //uint32 spellIds[2]; // 9-10 passive mastery bonus spells? + //uint32 MasterySpells[2]; // 9-10 passive mastery bonus spells? }; struct TalentTreePrimarySpellsEntry @@ -2098,6 +2096,7 @@ struct TaxiNodesEntry float z; // 4 m_z char* name; // 5 m_Name_lang uint32 MountCreatureID[2]; // 6-7 m_MountCreatureID[2] + uint32 Flags; // 8 m_Flags }; struct TaxiPathEntry @@ -2123,12 +2122,6 @@ struct TaxiPathNodeEntry uint32 departureEventID; // 10 m_departureEventID }; -struct TeamContributionPointsEntry -{ - //uint32 entry; // 0 - float value; // 1 (???) -}; - struct TotemCategoryEntry { uint32 ID; // 0 @@ -2164,9 +2157,9 @@ struct VehicleEntry float m_msslTrgtArcRepeat; // 25 float m_msslTrgtArcWidth; // 26 float m_msslTrgtImpactRadius[2]; // 27-28 - char* m_msslTrgtArcTexture; // 29 - char* m_msslTrgtImpactTexture; // 30 - char* m_msslTrgtImpactModel[2]; // 31-32 + char* m_msslTrgtArcTexture; // 29 + char* m_msslTrgtImpactTexture; // 30 + char* m_msslTrgtImpactModel[2]; // 31-32 float m_cameraYawOffset; // 33 uint32 m_uiLocomotionType; // 34 float m_msslTrgtImpactTexRadius; // 35 diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index 2cdf5509bc3..29f584b4bae 100644 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -26,7 +26,7 @@ char const Achievementfmt[]="niixsxiixixxii"; const std::string CustomAchievementfmt="pppaaaapapaapp"; const std::string CustomAchievementIndex = "ID"; char const AchievementCriteriafmt[]="niiiiiiiisiiiiixxiiiiii"; -char const AreaTableEntryfmt[]="iiinixxxxxisiiiiifxxxxxxxx"; +char const AreaTableEntryfmt[]="iiinixxxxxisiiiiiffixxxxxx"; char const AreaGroupEntryfmt[]="niiiiiii"; char const AreaPOIEntryfmt[]="niiiiiiiiiiiffixixxixx"; char const AreaTriggerEntryfmt[]="nifffxxxfffff"; @@ -35,7 +35,7 @@ char const AuctionHouseEntryfmt[]="niiix"; char const BankBagSlotPricesEntryfmt[]="ni"; char const BarberShopStyleEntryfmt[]="nixxxiii"; char const BattlemasterListEntryfmt[]="niiiiiiiiixsiiiixxxx"; -char const CharStartOutfitEntryfmt[]="diiiiiiiiiiiiiiiiiiiiiiiiixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; +char const CharStartOutfitEntryfmt[]="diiiiiiiiiiiiiiiiiiiiiiiiixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxii"; char const CharTitlesEntryfmt[]="nxsxix"; char const ChatChannelsEntryfmt[]="nixsx"; @@ -49,7 +49,7 @@ char const CreatureModelDatafmt[]="nxxxxxxxxxxxxxffxxxxxxxxxxxxxxx"; char const CreatureFamilyfmt[]="nfifiiiiixsx"; char const CreatureSpellDatafmt[]="niiiixxxx"; char const CreatureTypefmt[]="nxx"; -char const CurrencyTypesfmt[]="nixxxxiiiix"; +char const CurrencyTypesfmt[]="nixxxiiiiix"; char const DestructibleModelDatafmt[]="ixxixxxixxxixxxixxxxxxxx"; char const DungeonEncounterfmt[]="iiixisxx"; @@ -57,11 +57,11 @@ char const DurabilityCostsfmt[]="niiiiiiiiiiiiiiiiiiiiiiiiiiiii"; char const DurabilityQualityfmt[]="nf"; char const EmotesEntryfmt[]="nxxiiixx"; char const EmotesTextEntryfmt[]="nxixxxxxxxxxxxxxxxx"; -char const FactionEntryfmt[]="niiiiiiiiiiiiiiiiiiffixsxx"; +char const FactionEntryfmt[]="niiiiiiiiiiiiiiiiiiffixsxi"; char const FactionTemplateEntryfmt[]="niiiiiiiiiiiii"; char const GameObjectDisplayInfofmt[]="nsxxxxxxxxxxffffffxxx"; -char const GemPropertiesEntryfmt[]="nixxix"; +char const GemPropertiesEntryfmt[]="nixxii"; char const GlyphPropertiesfmt[]="niii"; char const GlyphSlotfmt[]="nii"; @@ -99,7 +99,7 @@ char const ItemLimitCategoryEntryfmt[]="nxii"; char const ItemRandomPropertiesfmt[]="nxiiixxs"; char const ItemRandomSuffixfmt[]="nsxiiiiiiiiii"; char const ItemSetEntryfmt[]="dsiiiiiiiiiixxxxxxxiiiiiiiiiiiiiiiiii"; -char const LFGDungeonEntryfmt[]="nsiiiiiiiiixxixixxxxx"; +char const LFGDungeonEntryfmt[]="nsiiiiiiiiixxixixixxx"; char const LiquidTypefmt[]="nxxixixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; char const LockEntryfmt[]="niiiiiiiiiiiiiiiiiiiiiiiixxxxxxxx"; char const PhaseEntryfmt[]="nsi"; @@ -120,7 +120,7 @@ char const RandomPropertiesPointsfmt[]="niiiiiiiiiiiiiii"; char const ScalingStatDistributionfmt[]="niiiiiiiiiiiiiiiiiiiixi"; char const ScalingStatValuesfmt[]="iniiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii"; char const SkillLinefmt[]="nisxixi"; -char const SkillLineAbilityfmt[]="niiiixxiiiiixx"; +char const SkillLineAbilityfmt[]="niiiixxiiiiiii"; char const SoundEntriesfmt[]="nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; char const SpellCastTimefmt[]="nixx"; char const SpellCategoriesEntryfmt[]="diiiiii"; @@ -129,7 +129,7 @@ const std::string CustomSpellDifficultyfmt="ppppp"; const std::string CustomSpellDifficultyIndex="id"; char const SpellDurationfmt[]="niii"; char const SpellEffectEntryfmt[]="nifiiiffiiiiiifiifiiiiiiiix"; -char const SpellEntryfmt[]="niiiiiiiiiiiiiiifiiiissxxiixxixiiiiiiixiiiiiiiix"; +char const SpellEntryfmt[]="niiiiiiiiiiiiiiifiiiissxxiixxifiiiiiiixiiiiiiiix"; const std::string CustomSpellEntryfmt="papppppppppppapapaaaaaaaaaaapaaapapppppppaaaaapaapaaaaaaaaaaaaaaaaaappppppppppppppppppppppppppppppppppppaaaaaapppppppppaaapppppppppaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaappppppppapppaaaaappaaaaaaa"; const std::string CustomSpellEntryIndex = "Id"; char const SpellFocusObjectfmt[]="nx"; @@ -141,7 +141,7 @@ char const SpellReagentsEntryfmt[]="diiiiiiiiiiiiiiii"; char const SpellScalingEntryfmt[]="diiiiffffffffffi"; char const SpellTotemsEntryfmt[]="niiii"; char const SpellTargetRestrictionsEntryfmt[]="nxiiii"; -char const SpellPowerEntryfmt[]="diiiixxx"; +char const SpellPowerEntryfmt[]="diiiiixf"; char const SpellInterruptsEntryfmt[]="dixixi"; char const SpellEquippedItemsEntryfmt[]="diii"; char const SpellAuraOptionsEntryfmt[]="niiii"; @@ -158,10 +158,9 @@ char const SummonPropertiesfmt[] = "niiiii"; char const TalentEntryfmt[]="niiiiiiiiixxixxxxxx"; char const TalentTabEntryfmt[]="nxxiiixxxxx"; char const TalentTreePrimarySpellsfmt[]="diix"; -char const TaxiNodesEntryfmt[]="nifffsiixxx"; +char const TaxiNodesEntryfmt[]="nifffsiiixx"; char const TaxiPathEntryfmt[]="niii"; char const TaxiPathNodeEntryfmt[]="diiifffiiii"; -char const TeamContributionPointsfmt[]="df"; char const TotemCategoryEntryfmt[]="nxii"; char const VehicleEntryfmt[]="niffffiiiiiiiifffffffffffffffssssfifiixx"; char const VehicleSeatEntryfmt[]="niiffffffffffiiiiiifffffffiiifffiiiiiiiffiiiiixxxxxxxxxxxxxxxxxxxx"; -- cgit v1.2.3 From 2a2924fb50fb3d7ab29f2ad36b977a0596f0883a Mon Sep 17 00:00:00 2001 From: Warpten Date: Sat, 12 Jan 2013 22:10:47 +0100 Subject: Core/GuildFinder: Fixed a possible crash and a typo. --- src/server/game/Guilds/GuildFinderMgr.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Guilds/GuildFinderMgr.cpp b/src/server/game/Guilds/GuildFinderMgr.cpp index 1f9030b94ae..0e041af402a 100644 --- a/src/server/game/Guilds/GuildFinderMgr.cpp +++ b/src/server/game/Guilds/GuildFinderMgr.cpp @@ -147,10 +147,9 @@ void GuildFinderMgr::RemoveAllMembershipRequestsFromPlayer(uint32 playerId) break; if (itr2 == itr->second.end()) - return; + continue; SQLTransaction trans = CharacterDatabase.BeginTransaction(); - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_FINDER_APPLICANT); stmt->setUInt32(0, itr2->GetGuildId()); stmt->setUInt32(1, itr2->GetPlayerGUID()); @@ -303,11 +302,12 @@ void GuildFinderMgr::DeleteGuild(uint32 guildId) trans->Append(stmt); CharacterDatabase.CommitTransaction(trans); - _membershipRequests[guildId].erase(itr); // Notify the applicant his submition has been removed if (Player* player = ObjectAccessor::FindPlayer(MAKE_NEW_GUID(applicant, 0, HIGHGUID_PLAYER))) SendMembershipRequestListUpdate(*player); + + ++itr; } _membershipRequests.erase(guildId); -- cgit v1.2.3 From 6d9ac921e0d06cb212b17fdb3fcf6e3aac53abf0 Mon Sep 17 00:00:00 2001 From: therzok Date: Sun, 13 Jan 2013 14:25:54 +0000 Subject: Core/DBC: Fixed startup Closes #8930 --- src/server/game/DataStores/DBCStructure.h | 1 + src/server/game/DataStores/DBCfmt.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 601e59163ab..4ec6c9fbd08 100644 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -670,6 +670,7 @@ struct CharStartOutfitEntry //int32 ItemInventorySlot[MAX_OUTFIT_ITEMS]; // 26-37 not required at server side uint32 PetDisplayId; // 38 Pet Model ID for starting pet uint32 PetFamilyEntry; // 39 Pet Family Entry for starting pet + //uint32 Unk[3]; // 40-42 Unknown }; struct CharTitlesEntry diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index 29f584b4bae..33dcaacb985 100644 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -35,7 +35,7 @@ char const AuctionHouseEntryfmt[]="niiix"; char const BankBagSlotPricesEntryfmt[]="ni"; char const BarberShopStyleEntryfmt[]="nixxxiii"; char const BattlemasterListEntryfmt[]="niiiiiiiiixsiiiixxxx"; -char const CharStartOutfitEntryfmt[]="diiiiiiiiiiiiiiiiiiiiiiiiixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxii"; +char const CharStartOutfitEntryfmt[]="diiiiiiiiiiiiiiiiiiiiiiiiixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiixxx"; char const CharTitlesEntryfmt[]="nxsxix"; char const ChatChannelsEntryfmt[]="nixsx"; -- cgit v1.2.3 From 7540cfedfc74b2c5e91ded052182fd3b02ca7b66 Mon Sep 17 00:00:00 2001 From: Spp Date: Mon, 14 Jan 2013 10:02:06 +0100 Subject: Core/Misc: Minor cosmetic change to avoid some merge conflicts --- src/server/game/DataStores/DBCfmt.h | 277 ++++++++++++++++++------------------ 1 file changed, 136 insertions(+), 141 deletions(-) (limited to 'src') diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index 33dcaacb985..cbbcb46bd08 100644 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -22,151 +22,146 @@ // x - skip, X - skip, s - char*, f - float, i - uint32, b - uint8, d - index (not included) // n - index (included), l - bool, p - field present in sql dbc, a - field absent in sql dbc -char const Achievementfmt[]="niixsxiixixxii"; -const std::string CustomAchievementfmt="pppaaaapapaapp"; +char const Achievementfmt[] = "niixsxiixixxii"; +const std::string CustomAchievementfmt = "pppaaaapapaapp"; const std::string CustomAchievementIndex = "ID"; -char const AchievementCriteriafmt[]="niiiiiiiisiiiiixxiiiiii"; -char const AreaTableEntryfmt[]="iiinixxxxxisiiiiiffixxxxxx"; -char const AreaGroupEntryfmt[]="niiiiiii"; -char const AreaPOIEntryfmt[]="niiiiiiiiiiiffixixxixx"; -char const AreaTriggerEntryfmt[]="nifffxxxfffff"; -char const ArmorLocationfmt[]="nfffff"; -char const AuctionHouseEntryfmt[]="niiix"; -char const BankBagSlotPricesEntryfmt[]="ni"; -char const BarberShopStyleEntryfmt[]="nixxxiii"; -char const BattlemasterListEntryfmt[]="niiiiiiiiixsiiiixxxx"; -char const CharStartOutfitEntryfmt[]="diiiiiiiiiiiiiiiiiiiiiiiiixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiixxx"; -char const CharTitlesEntryfmt[]="nxsxix"; -char const ChatChannelsEntryfmt[]="nixsx"; - -char const ChrClassesEntryfmt[]="nixsxxxixiiiii"; -char const ChrRacesEntryfmt[]="nxixiixixxxxixsxxxxxixxx"; -char const ChrClassesXPowerTypesfmt[]="nii"; - -char const CinematicSequencesEntryfmt[]="nxxxxxxxxx"; -char const CreatureDisplayInfofmt[]="nixxfxxxxxxxxxxxx"; -char const CreatureModelDatafmt[]="nxxxxxxxxxxxxxffxxxxxxxxxxxxxxx"; -char const CreatureFamilyfmt[]="nfifiiiiixsx"; -char const CreatureSpellDatafmt[]="niiiixxxx"; -char const CreatureTypefmt[]="nxx"; -char const CurrencyTypesfmt[]="nixxxiiiiix"; - -char const DestructibleModelDatafmt[]="ixxixxxixxxixxxixxxxxxxx"; -char const DungeonEncounterfmt[]="iiixisxx"; -char const DurabilityCostsfmt[]="niiiiiiiiiiiiiiiiiiiiiiiiiiiii"; -char const DurabilityQualityfmt[]="nf"; -char const EmotesEntryfmt[]="nxxiiixx"; -char const EmotesTextEntryfmt[]="nxixxxxxxxxxxxxxxxx"; -char const FactionEntryfmt[]="niiiiiiiiiiiiiiiiiiffixsxi"; -char const FactionTemplateEntryfmt[]="niiiiiiiiiiiii"; -char const GameObjectDisplayInfofmt[]="nsxxxxxxxxxxffffffxxx"; - -char const GemPropertiesEntryfmt[]="nixxii"; -char const GlyphPropertiesfmt[]="niii"; -char const GlyphSlotfmt[]="nii"; - -char const GtBarberShopCostBasefmt[]="xf"; -char const GtCombatRatingsfmt[]="xf"; -char const GtOCTHpPerStaminafmt[]="df"; -char const GtChanceToMeleeCritBasefmt[]="xf"; -char const GtChanceToMeleeCritfmt[]="xf"; -char const GtChanceToSpellCritBasefmt[]="xf"; -char const GtChanceToSpellCritfmt[]="xf"; -char const GtOCTClassCombatRatingScalarfmt[]="df"; -char const GtOCTRegenHPfmt[]="f"; -//char const GtOCTRegenMPfmt[]="f"; -char const GtRegenMPPerSptfmt[]="xf"; -char const GtSpellScalingfmt[]="df"; -char const GtOCTBaseHPByClassfmt[]="df"; -char const GtOCTBaseMPByClassfmt[]="df"; -char const GuildPerkSpellsfmt[]="dii"; -char const Holidaysfmt[]="niiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiixxsiix"; -char const ImportPriceArmorfmt[]="nffff"; -char const ImportPriceQualityfmt[]="nf"; -char const ImportPriceShieldfmt[]="nf"; -char const ImportPriceWeaponfmt[]="nf"; -char const ItemPriceBasefmt[]="diff"; -char const ItemReforgefmt[]="nifif"; -char const ItemBagFamilyfmt[]="nx"; -char const ItemArmorQualityfmt[]="nfffffffi"; -char const ItemArmorShieldfmt[]="nifffffff"; -char const ItemArmorTotalfmt[]="niffff"; -char const ItemClassfmt[]="dixxfx"; -char const ItemDamagefmt[]="nfffffffi"; -char const ItemDisenchantLootfmt[]="niiiiii"; -//char const ItemDisplayTemplateEntryfmt[]="nxxxxxxxxxxixxxxxxxxxxx"; -char const ItemLimitCategoryEntryfmt[]="nxii"; -char const ItemRandomPropertiesfmt[]="nxiiixxs"; -char const ItemRandomSuffixfmt[]="nsxiiiiiiiiii"; -char const ItemSetEntryfmt[]="dsiiiiiiiiiixxxxxxxiiiiiiiiiiiiiiiiii"; -char const LFGDungeonEntryfmt[]="nsiiiiiiiiixxixixixxx"; -char const LiquidTypefmt[]="nxxixixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; -char const LockEntryfmt[]="niiiiiiiiiiiiiiiiiiiiiiiixxxxxxxx"; -char const PhaseEntryfmt[]="nsi"; -char const MailTemplateEntryfmt[]="nxs"; -char const MapEntryfmt[]="nxixxxsixxixiffxiixi"; -char const MapDifficultyEntryfmt[]="diisiix"; -char const MovieEntryfmt[]="nxxx"; -char const MountCapabilityfmt[]="niiiiiii"; -char const MountTypefmt[]="niiiiiiiiiiiiiiiiiiiiiiii"; +char const AchievementCriteriafmt[] = "niiiiiiiisiiiiixxiiiiii"; +char const AreaTableEntryfmt[] = "iiinixxxxxisiiiiiffixxxxxx"; +char const AreaGroupEntryfmt[] = "niiiiiii"; +char const AreaPOIEntryfmt[] = "niiiiiiiiiiiffixixxixx"; +char const AreaTriggerEntryfmt[] = "nifffxxxfffff"; +char const ArmorLocationfmt[] = "nfffff"; +char const AuctionHouseEntryfmt[] = "niiix"; +char const BankBagSlotPricesEntryfmt[] = "ni"; +char const BarberShopStyleEntryfmt[] = "nixxxiii"; +char const BattlemasterListEntryfmt[] = "niiiiiiiiixsiiiixxxx"; +char const CharStartOutfitEntryfmt[] = "diiiiiiiiiiiiiiiiiiiiiiiiixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiixxx"; +char const CharTitlesEntryfmt[] = "nxsxix"; +char const ChatChannelsEntryfmt[] = "nixsx"; +char const ChrClassesEntryfmt[] = "nixsxxxixiiiii"; +char const ChrRacesEntryfmt[] = "nxixiixixxxxixsxxxxxixxx"; +char const ChrClassesXPowerTypesfmt[] = "nii"; +char const CinematicSequencesEntryfmt[] = "nxxxxxxxxx"; +char const CreatureDisplayInfofmt[] = "nixxfxxxxxxxxxxxx"; +char const CreatureModelDatafmt[] = "nxxxxxxxxxxxxxffxxxxxxxxxxxxxxx"; +char const CreatureFamilyfmt[] = "nfifiiiiixsx"; +char const CreatureSpellDatafmt[] = "niiiixxxx"; +char const CreatureTypefmt[] = "nxx"; +char const CurrencyTypesfmt[] = "nixxxiiiiix"; +char const DestructibleModelDatafmt[] = "ixxixxxixxxixxxixxxxxxxx"; +char const DungeonEncounterfmt[] = "iiixisxx"; +char const DurabilityCostsfmt[] = "niiiiiiiiiiiiiiiiiiiiiiiiiiiii"; +char const DurabilityQualityfmt[] = "nf"; +char const EmotesEntryfmt[] = "nxxiiixx"; +char const EmotesTextEntryfmt[] = "nxixxxxxxxxxxxxxxxx"; +char const FactionEntryfmt[] = "niiiiiiiiiiiiiiiiiiffixsxi"; +char const FactionTemplateEntryfmt[] = "niiiiiiiiiiiii"; +char const GameObjectDisplayInfofmt[] = "nsxxxxxxxxxxffffffxxx"; +char const GemPropertiesEntryfmt[] = "nixxii"; +char const GlyphPropertiesfmt[] = "niii"; +char const GlyphSlotfmt[] = "nii"; +char const GtBarberShopCostBasefmt[] = "xf"; +char const GtCombatRatingsfmt[] = "xf"; +char const GtOCTHpPerStaminafmt[] = "df"; +char const GtChanceToMeleeCritBasefmt[] = "xf"; +char const GtChanceToMeleeCritfmt[] = "xf"; +char const GtChanceToSpellCritBasefmt[] = "xf"; +char const GtChanceToSpellCritfmt[] = "xf"; +char const GtOCTClassCombatRatingScalarfmt[] = "df"; +char const GtOCTRegenHPfmt[] = "f"; +//char const GtOCTRegenMPfmt[] = "f"; +char const GtRegenMPPerSptfmt[] = "xf"; +char const GtSpellScalingfmt[] = "df"; +char const GtOCTBaseHPByClassfmt[] = "df"; +char const GtOCTBaseMPByClassfmt[] = "df"; +char const GuildPerkSpellsfmt[] = "dii"; +char const Holidaysfmt[] = "niiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiixxsiix"; +char const ImportPriceArmorfmt[] = "nffff"; +char const ImportPriceQualityfmt[] = "nf"; +char const ImportPriceShieldfmt[] = "nf"; +char const ImportPriceWeaponfmt[] = "nf"; +char const ItemPriceBasefmt[] = "diff"; +char const ItemReforgefmt[] = "nifif"; +char const ItemBagFamilyfmt[] = "nx"; +char const ItemArmorQualityfmt[] = "nfffffffi"; +char const ItemArmorShieldfmt[] = "nifffffff"; +char const ItemArmorTotalfmt[] = "niffff"; +char const ItemClassfmt[] = "dixxfx"; +char const ItemDamagefmt[] = "nfffffffi"; +char const ItemDisenchantLootfmt[] = "niiiiii"; +//char const ItemDisplayTemplateEntryfmt[] = "nxxxxxxxxxxixxxxxxxxxxx"; +char const ItemLimitCategoryEntryfmt[] = "nxii"; +char const ItemRandomPropertiesfmt[] = "nxiiixxs"; +char const ItemRandomSuffixfmt[] = "nsxiiiiiiiiii"; +char const ItemSetEntryfmt[] = "dsiiiiiiiiiixxxxxxxiiiiiiiiiiiiiiiiii"; +char const LFGDungeonEntryfmt[] = "nsiiiiiiiiixxixixixxx"; +char const LiquidTypefmt[] = "nxxixixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; +char const LockEntryfmt[] = "niiiiiiiiiiiiiiiiiiiiiiiixxxxxxxx"; +char const PhaseEntryfmt[] = "nsi"; +char const MailTemplateEntryfmt[] = "nxs"; +char const MapEntryfmt[] = "nxixxxsixxixiffxiixi"; +char const MapDifficultyEntryfmt[] = "diisiix"; +char const MovieEntryfmt[] = "nxxx"; +char const MountCapabilityfmt[] = "niiiiiii"; +char const MountTypefmt[] = "niiiiiiiiiiiiiiiiiiiiiiii"; char const NameGenfmt[] = "dsii"; -char const NumTalentsAtLevelfmt[]="df"; -char const OverrideSpellDatafmt[]="niiiiiiiiiixx"; -char const QuestSortEntryfmt[]="nx"; -char const QuestXPfmt[]="niiiiiiiiii"; -char const QuestFactionRewardfmt[]="niiiiiiiiii"; -char const PvPDifficultyfmt[]="diiiii"; -char const RandomPropertiesPointsfmt[]="niiiiiiiiiiiiiii"; -char const ScalingStatDistributionfmt[]="niiiiiiiiiiiiiiiiiiiixi"; -char const ScalingStatValuesfmt[]="iniiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii"; -char const SkillLinefmt[]="nisxixi"; -char const SkillLineAbilityfmt[]="niiiixxiiiiiii"; -char const SoundEntriesfmt[]="nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; -char const SpellCastTimefmt[]="nixx"; -char const SpellCategoriesEntryfmt[]="diiiiii"; -char const SpellDifficultyfmt[]="niiii"; -const std::string CustomSpellDifficultyfmt="ppppp"; -const std::string CustomSpellDifficultyIndex="id"; -char const SpellDurationfmt[]="niii"; -char const SpellEffectEntryfmt[]="nifiiiffiiiiiifiifiiiiiiiix"; -char const SpellEntryfmt[]="niiiiiiiiiiiiiiifiiiissxxiixxifiiiiiiixiiiiiiiix"; -const std::string CustomSpellEntryfmt="papppppppppppapapaaaaaaaaaaapaaapapppppppaaaaapaapaaaaaaaaaaaaaaaaaappppppppppppppppppppppppppppppppppppaaaaaapppppppppaaapppppppppaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaappppppppapppaaaaappaaaaaaa"; +char const NumTalentsAtLevelfmt[] = "df"; +char const OverrideSpellDatafmt[] = "niiiiiiiiiixx"; +char const QuestFactionRewardfmt[] = "niiiiiiiiii"; +char const QuestSortEntryfmt[] = "nx"; +char const QuestXPfmt[] = "niiiiiiiiii"; +char const PvPDifficultyfmt[] = "diiiii"; +char const RandomPropertiesPointsfmt[] = "niiiiiiiiiiiiiii"; +char const ScalingStatDistributionfmt[] = "niiiiiiiiiiiiiiiiiiiixi"; +char const ScalingStatValuesfmt[] = "iniiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii"; +char const SkillLinefmt[] = "nisxixi"; +char const SkillLineAbilityfmt[] = "niiiixxiiiiiii"; +char const SoundEntriesfmt[] = "nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; +char const SpellCastTimefmt[] = "nixx"; +char const SpellCategoriesEntryfmt[] = "diiiiii"; +char const SpellDifficultyfmt[] = "niiii"; +const std::string CustomSpellDifficultyfmt = "ppppp"; +const std::string CustomSpellDifficultyIndex = "id"; +char const SpellDurationfmt[] = "niii"; +char const SpellEffectEntryfmt[] = "nifiiiffiiiiiifiifiiiiiiiix"; +char const SpellEntryfmt[] = "niiiiiiiiiiiiiiifiiiissxxiixxifiiiiiiixiiiiiiiix"; +const std::string CustomSpellEntryfmt = "papppppppppppapapaaaaaaaaaaapaaapapppppppaaaaapaapaaaaaaaaaaaaaaaaaappppppppppppppppppppppppppppppppppppaaaaaapppppppppaaapppppppppaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaappppppppapppaaaaappaaaaaaa"; const std::string CustomSpellEntryIndex = "Id"; -char const SpellFocusObjectfmt[]="nx"; -char const SpellItemEnchantmentfmt[]="nxiiiiiixxxiiisiiiiiiix"; -char const SpellItemEnchantmentConditionfmt[]="nbbbbbxxxxxbbbbbbbbbbiiiiiXXXXX"; -char const SpellRadiusfmt[]="nfff"; -char const SpellRangefmt[]="nffffixx"; -char const SpellReagentsEntryfmt[]="diiiiiiiiiiiiiiii"; -char const SpellScalingEntryfmt[]="diiiiffffffffffi"; -char const SpellTotemsEntryfmt[]="niiii"; -char const SpellTargetRestrictionsEntryfmt[]="nxiiii"; -char const SpellPowerEntryfmt[]="diiiiixf"; -char const SpellInterruptsEntryfmt[]="dixixi"; -char const SpellEquippedItemsEntryfmt[]="diii"; -char const SpellAuraOptionsEntryfmt[]="niiii"; -char const SpellAuraRestrictionsEntryfmt[]="diiiiiiii"; -char const SpellCastingRequirementsEntryfmt[]="dixxixi"; -char const SpellClassOptionsEntryfmt[]="dxiiiix"; -char const SpellCooldownsEntryfmt[]="diii"; -char const SpellLevelsEntryfmt[]="diii"; -char const SpellRuneCostfmt[]="niiii"; -char const SpellShapeshiftEntryfmt[]="nixixx"; -char const SpellShapeshiftFormfmt[]="nxxiixiiixxiiiiiiiixx"; +char const SpellFocusObjectfmt[] = "nx"; +char const SpellItemEnchantmentfmt[] = "nxiiiiiixxxiiisiiiiiiix"; +char const SpellItemEnchantmentConditionfmt[] = "nbbbbbxxxxxbbbbbbbbbbiiiiiXXXXX"; +char const SpellRadiusfmt[] = "nfff"; +char const SpellRangefmt[] = "nffffixx"; +char const SpellReagentsEntryfmt[] = "diiiiiiiiiiiiiiii"; +char const SpellScalingEntryfmt[] = "diiiiffffffffffi"; +char const SpellTotemsEntryfmt[] = "niiii"; +char const SpellTargetRestrictionsEntryfmt[] = "nxiiii"; +char const SpellPowerEntryfmt[] = "diiiiixf"; +char const SpellInterruptsEntryfmt[] = "dixixi"; +char const SpellEquippedItemsEntryfmt[] = "diii"; +char const SpellAuraOptionsEntryfmt[] = "niiii"; +char const SpellAuraRestrictionsEntryfmt[] = "diiiiiiii"; +char const SpellCastingRequirementsEntryfmt[] = "dixxixi"; +char const SpellClassOptionsEntryfmt[] = "dxiiiix"; +char const SpellCooldownsEntryfmt[] = "diii"; +char const SpellLevelsEntryfmt[] = "diii"; +char const SpellRuneCostfmt[] = "niiii"; +char const SpellShapeshiftEntryfmt[] = "nixixx"; +char const SpellShapeshiftFormfmt[] = "nxxiixiiixxiiiiiiiixx"; char const StableSlotPricesfmt[] = "ni"; char const SummonPropertiesfmt[] = "niiiii"; -char const TalentEntryfmt[]="niiiiiiiiixxixxxxxx"; -char const TalentTabEntryfmt[]="nxxiiixxxxx"; -char const TalentTreePrimarySpellsfmt[]="diix"; -char const TaxiNodesEntryfmt[]="nifffsiiixx"; -char const TaxiPathEntryfmt[]="niii"; -char const TaxiPathNodeEntryfmt[]="diiifffiiii"; -char const TotemCategoryEntryfmt[]="nxii"; -char const VehicleEntryfmt[]="niffffiiiiiiiifffffffffffffffssssfifiixx"; -char const VehicleSeatEntryfmt[]="niiffffffffffiiiiiifffffffiiifffiiiiiiiffiiiiixxxxxxxxxxxxxxxxxxxx"; -char const WMOAreaTableEntryfmt[]="niiixxxxxiixxxx"; -char const WorldMapAreaEntryfmt[]="xinxffffixxxxx"; -char const WorldMapOverlayEntryfmt[]="nxiiiixxxxxxxxx"; -char const WorldSafeLocsEntryfmt[]="nifffx"; +char const TalentEntryfmt[] = "niiiiiiiiixxixxxxxx"; +char const TalentTabEntryfmt[] = "nxxiiixxxxx"; +char const TalentTreePrimarySpellsfmt[] = "diix"; +char const TaxiNodesEntryfmt[] = "nifffsiiixx"; +char const TaxiPathEntryfmt[] = "niii"; +char const TaxiPathNodeEntryfmt[] = "diiifffiiii"; +char const TotemCategoryEntryfmt[] = "nxii"; +char const VehicleEntryfmt[] = "niffffiiiiiiiifffffffffffffffssssfifiixx"; +char const VehicleSeatEntryfmt[] = "niiffffffffffiiiiiifffffffiiifffiiiiiiiffiiiiixxxxxxxxxxxxxxxxxxxx"; +char const WMOAreaTableEntryfmt[] = "niiixxxxxiixxxx"; +char const WorldMapAreaEntryfmt[] = "xinxffffixxxxx"; +char const WorldMapOverlayEntryfmt[] = "nxiiiixxxxxxxxx"; +char const WorldSafeLocsEntryfmt[] = "nifffx"; #endif -- cgit v1.2.3 From 0d5cb6af755199f716a2de3207e6df91787f98b5 Mon Sep 17 00:00:00 2001 From: Spp Date: Mon, 14 Jan 2013 11:12:58 +0100 Subject: Core/Misc: Apply codestyle to multiple files (II) --- src/server/game/Achievements/AchievementMgr.cpp | 12 +- src/server/game/Achievements/AchievementMgr.h | 4 +- src/server/game/Battlegrounds/Battleground.cpp | 2 +- src/server/game/Battlegrounds/BattlegroundMgr.cpp | 2 +- src/server/game/Chat/ChatLink.cpp | 2 +- src/server/game/DataStores/DB2Stores.cpp | 6 +- src/server/game/DataStores/DBCStores.cpp | 10 +- src/server/game/Entities/Player/Player.cpp | 16 +-- src/server/game/Entities/Player/Player.h | 4 +- src/server/game/Entities/Unit/StatSystem.cpp | 2 +- src/server/game/Entities/Unit/Unit.cpp | 16 +-- src/server/game/Entities/Unit/Unit.h | 2 +- src/server/game/Globals/ObjectMgr.cpp | 6 +- src/server/game/Guilds/GuildFinderMgr.cpp | 6 +- src/server/game/Handlers/ChatHandler.cpp | 2 +- src/server/game/Handlers/GuildHandler.cpp | 2 +- src/server/game/Handlers/MailHandler.cpp | 2 +- src/server/game/Handlers/QuestHandler.cpp | 2 +- .../MovementGenerators/RandomMovementGenerator.cpp | 2 +- .../TargetedMovementGenerator.cpp | 2 +- src/server/game/Movement/MovementStructures.h | 2 +- src/server/game/Movement/Spline/MovementUtil.cpp | 130 ++++++++++----------- src/server/game/Movement/Spline/Spline.h | 10 +- src/server/game/Server/WorldSocket.cpp | 2 +- src/server/game/Spells/Spell.cpp | 4 +- src/server/scripts/Commands/cs_debug.cpp | 2 +- .../scripts/EasternKingdoms/ZulAman/zulaman.cpp | 2 +- .../ZulGurub/boss_jindo_the_godbreaker.cpp | 2 +- .../Kalimdor/HallsOfOrigination/boss_anraphet.cpp | 14 +-- .../HallsOfOrigination/boss_earthrager_ptah.cpp | 28 ++--- .../boss_temple_guardian_anhuur.cpp | 30 ++--- .../HallsOfOrigination/halls_of_origination.h | 4 +- .../instance_halls_of_origination.cpp | 12 +- .../AzjolNerub/Ahnkahet/boss_elder_nadox.cpp | 4 +- .../ChamberOfAspects/RubySanctum/boss_halion.cpp | 2 +- .../UtgardeKeep/UtgardePinnacle/boss_svala.cpp | 2 +- src/server/scripts/Spells/spell_druid.cpp | 16 +-- src/server/scripts/Spells/spell_mage.cpp | 8 +- src/server/shared/DataStores/DB2FileLoader.cpp | 12 +- src/server/shared/Packets/ByteBuffer.h | 2 +- 40 files changed, 195 insertions(+), 195 deletions(-) (limited to 'src') diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 48eb6114cb4..b82aa86f3be 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -2302,7 +2302,7 @@ bool AchievementMgr::CanUpdateCriteria(AchievementCriteriaEntry const* criter } template -bool AchievementMgr::ConditionsSatisfied(AchievementCriteriaEntry const *criteria, Player* referencePlayer) const +bool AchievementMgr::ConditionsSatisfied(AchievementCriteriaEntry const* criteria, Player* referencePlayer) const { for (uint32 i = 0; i < MAX_CRITERIA_REQUIREMENTS; ++i) { @@ -2328,7 +2328,7 @@ bool AchievementMgr::ConditionsSatisfied(AchievementCriteriaEntry const *crit } template -bool AchievementMgr::RequirementsSatisfied(AchievementCriteriaEntry const *achievementCriteria, uint64 miscValue1, uint64 miscValue2, uint64 miscValue3, Unit const *unit, Player* referencePlayer) const +bool AchievementMgr::RequirementsSatisfied(AchievementCriteriaEntry const* achievementCriteria, uint64 miscValue1, uint64 miscValue2, uint64 miscValue3, Unit const* unit, Player* referencePlayer) const { switch (AchievementCriteriaTypes(achievementCriteria->type)) { @@ -2685,7 +2685,7 @@ bool AchievementMgr::RequirementsSatisfied(AchievementCriteriaEntry const *ac } template -bool AchievementMgr::AdditionalRequirementsSatisfied(AchievementCriteriaEntry const *criteria, uint64 miscValue1, uint64 /*miscValue2*/, Unit const* unit, Player* referencePlayer) const +bool AchievementMgr::AdditionalRequirementsSatisfied(AchievementCriteriaEntry const* criteria, uint64 miscValue1, uint64 /*miscValue2*/, Unit const* unit, Player* referencePlayer) const { for (uint8 i = 0; i < MAX_ADDITIONAL_CRITERIA_CONDITIONS; ++i) { @@ -2724,7 +2724,7 @@ bool AchievementMgr::AdditionalRequirementsSatisfied(AchievementCriteriaEntry case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_ITEM_QUALITY_MIN: // 14 { // miscValue1 is itemid - ItemTemplate const * const item = sObjectMgr->GetItemTemplate(uint32(miscValue1)); + ItemTemplate const* const item = sObjectMgr->GetItemTemplate(uint32(miscValue1)); if (!item || item->Quality < reqValue) return false; break; @@ -2732,7 +2732,7 @@ bool AchievementMgr::AdditionalRequirementsSatisfied(AchievementCriteriaEntry case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_ITEM_QUALITY_EQUALS: // 15 { // miscValue1 is itemid - ItemTemplate const * const item = sObjectMgr->GetItemTemplate(uint32(miscValue1)); + ItemTemplate const* const item = sObjectMgr->GetItemTemplate(uint32(miscValue1)); if (!item || item->Quality != reqValue) return false; break; @@ -2783,7 +2783,7 @@ bool AchievementMgr::AdditionalRequirementsSatisfied(AchievementCriteriaEntry { if (!unit) return false; - Creature const * const creature = unit->ToCreature(); + Creature const* const creature = unit->ToCreature(); if (!creature || creature->GetCreatureType() != reqValue) return false; break; diff --git a/src/server/game/Achievements/AchievementMgr.h b/src/server/game/Achievements/AchievementMgr.h index 42a1d2427d9..ad97af3ec6e 100644 --- a/src/server/game/Achievements/AchievementMgr.h +++ b/src/server/game/Achievements/AchievementMgr.h @@ -264,8 +264,8 @@ class AchievementMgr bool CanUpdateCriteria(AchievementCriteriaEntry const* criteria, AchievementEntry const* achievement, uint64 miscValue1, uint64 miscValue2, uint64 miscValue3, Unit const* unit, Player* referencePlayer); void SendPacket(WorldPacket* data) const; - bool ConditionsSatisfied(AchievementCriteriaEntry const *criteria, Player* referencePlayer) const; - bool RequirementsSatisfied(AchievementCriteriaEntry const *criteria, uint64 miscValue1, uint64 miscValue2, uint64 miscValue3, Unit const* unit, Player* referencePlayer) const; + bool ConditionsSatisfied(AchievementCriteriaEntry const* criteria, Player* referencePlayer) const; + bool RequirementsSatisfied(AchievementCriteriaEntry const* criteria, uint64 miscValue1, uint64 miscValue2, uint64 miscValue3, Unit const* unit, Player* referencePlayer) const; bool AdditionalRequirementsSatisfied(AchievementCriteriaEntry const* criteria, uint64 miscValue1, uint64 miscValue2, Unit const* unit, Player* referencePlayer) const; T* _owner; diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index 07112c957af..3dd8e01ad72 100644 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -1246,7 +1246,7 @@ void Battleground::AddPlayer(Player* player) if (GetStatus() == STATUS_WAIT_JOIN) // not started yet { player->CastSpell(player, SPELL_PREPARATION, true); // reduces all mana cost of spells. - + int32 countdownMaxForBGType = isArena() ? ARENA_COUNTDOWN_MAX : BATTLEGROUND_COUNTDOWN_MAX; WorldPacket data(SMSG_START_TIMER, 4+4+4); data << uint32(0); // unk diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index 7fc344c759a..c370b3a26ce 100644 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -148,7 +148,7 @@ void BattlegroundMgr::Update(uint32 diff) } } -void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battleground *bg, Player * player, uint8 QueueSlot, uint8 StatusID, uint32 Time1, uint32 Time2, uint8 arenatype) +void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket* data, Battleground* bg, Player* player, uint8 QueueSlot, uint8 StatusID, uint32 Time1, uint32 Time2, uint8 arenatype) { ObjectGuid playerGuid = player->GetGUID(); ObjectGuid bgGuid; diff --git a/src/server/game/Chat/ChatLink.cpp b/src/server/game/Chat/ChatLink.cpp index 63e3f3161e1..7f517d99b2c 100644 --- a/src/server/game/Chat/ChatLink.cpp +++ b/src/server/game/Chat/ChatLink.cpp @@ -167,7 +167,7 @@ bool ItemChatLink::Initialize(std::istringstream& iss) return true; } -inline std::string ItemChatLink::FormatName(uint8 index, ItemLocale const *locale, char* suffixStrings) const +inline std::string ItemChatLink::FormatName(uint8 index, ItemLocale const* locale, char* suffixStrings) const { std::stringstream ss; if (locale == NULL || index >= locale->Name.size()) diff --git a/src/server/game/DataStores/DB2Stores.cpp b/src/server/game/DataStores/DB2Stores.cpp index 2e1c25ced39..dadcce42950 100644 --- a/src/server/game/DataStores/DB2Stores.cpp +++ b/src/server/game/DataStores/DB2Stores.cpp @@ -32,7 +32,7 @@ typedef std::list StoreProblemList1; uint32 DB2FilesCount = 0; -static bool LoadDB2_assert_print(uint32 fsize,uint32 rsize, const std::string& filename) +static bool LoadDB2_assert_print(uint32 fsize, uint32 rsize, const std::string& filename) { sLog->outError(LOG_FILTER_GENERAL, "Size of '%s' setted by format string (%u) not equal size of C++ structure (%u).", filename.c_str(), fsize, rsize); @@ -62,7 +62,7 @@ inline void LoadDB2(StoreProblemList1& errlist, DB2Storage& storage, const st if (!storage.Load(db2_filename.c_str())) { // sort problematic db2 to (1) non compatible and (2) nonexistent - if (FILE * f = fopen(db2_filename.c_str(), "rb")) + if (FILE* f = fopen(db2_filename.c_str(), "rb")) { char buf[100]; snprintf(buf, 100,"(exist, but have %d fields instead " SIZEFMTD ") Wrong client version DBC file?", storage.GetFieldCount(), strlen(storage.GetFormat())); @@ -96,7 +96,7 @@ void LoadDB2Stores(const std::string& dataPath) for (std::list::iterator i = bad_db2_files.begin(); i != bad_db2_files.end(); ++i) str += *i + "\n"; - sLog->outError(LOG_FILTER_GENERAL, "\nSome required *.db2 files (%u from %d) not found or not compatible:\n%s", (uint32)bad_db2_files.size(), DB2FilesCount,str.c_str()); + sLog->outError(LOG_FILTER_GENERAL, "\nSome required *.db2 files (%u from %d) not found or not compatible:\n%s", (uint32)bad_db2_files.size(), DB2FilesCount, str.c_str()); exit(1); } diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 9ee43f8f206..17135291664 100644 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -435,11 +435,11 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sItemArmorTotalStore, dbcPath, "ItemArmorTotal.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sItemDamageAmmoStore, dbcPath, "ItemDamageAmmo.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sItemDamageOneHandStore, dbcPath, "ItemDamageOneHand.dbc");//14545 - LoadDBC(availableDbcLocales, bad_dbc_files, sItemDamageOneHandCasterStore,dbcPath, "ItemDamageOneHandCaster.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sItemDamageOneHandCasterStore, dbcPath, "ItemDamageOneHandCaster.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sItemDamageRangedStore, dbcPath, "ItemDamageRanged.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sItemDamageThrownStore, dbcPath, "ItemDamageThrown.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sItemDamageTwoHandStore, dbcPath, "ItemDamageTwoHand.dbc");//14545 - LoadDBC(availableDbcLocales, bad_dbc_files, sItemDamageTwoHandCasterStore,dbcPath, "ItemDamageTwoHandCaster.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sItemDamageTwoHandCasterStore, dbcPath, "ItemDamageTwoHandCaster.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sItemDamageWandStore, dbcPath, "ItemDamageWand.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sItemDisenchantLootStore, dbcPath, "ItemDisenchantLoot.dbc"); @@ -500,7 +500,7 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sSpellReagentsStore, dbcPath,"SpellReagents.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellScalingStore, dbcPath,"SpellScaling.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellTotemsStore, dbcPath,"SpellTotems.dbc");//14545 - LoadDBC(availableDbcLocales, bad_dbc_files, sSpellTargetRestrictionsStore,dbcPath,"SpellTargetRestrictions.dbc");//14545 + LoadDBC(availableDbcLocales, bad_dbc_files, sSpellTargetRestrictionsStore, dbcPath,"SpellTargetRestrictions.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellPowerStore, dbcPath,"SpellPower.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellLevelsStore, dbcPath,"SpellLevels.dbc");//14545 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellInterruptsStore, dbcPath,"SpellInterrupts.dbc");//14545 @@ -529,7 +529,7 @@ void LoadDBCStores(const std::string& dataPath) // Must be done when sSkillLineAbilityStore, sSpellStore, sSpellLevelsStore and sCreatureFamilyStore are all loaded for (uint32 j = 0; j < sSkillLineAbilityStore.GetNumRows(); ++j) { - SkillLineAbilityEntry const *skillLine = sSkillLineAbilityStore.LookupEntry(j); + SkillLineAbilityEntry const* skillLine = sSkillLineAbilityStore.LookupEntry(j); if (!skillLine) continue; @@ -763,7 +763,7 @@ void LoadDBCStores(const std::string& dataPath) const std::string* GetRandomCharacterName(uint8 race, uint8 gender) { uint32 size = sGenNameVectoArraysMap[race].stringVectorArray[gender].size(); - uint32 randPos = urand(0,size-1); + uint32 randPos = urand(0, size-1); return &sGenNameVectoArraysMap[race].stringVectorArray[gender][randPos]; } diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 18c33457c23..c7567aaa13f 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -1974,7 +1974,7 @@ bool Player::BuildEnumData(PreparedQueryResult result, ByteBuffer* dataBuffer, B continue; } - SpellItemEnchantmentEntry const *enchant = NULL; + SpellItemEnchantmentEntry const* enchant = NULL; uint32 enchants = GetUInt32ValueFromArray(equipment, visualbase + 1); for (uint8 enchantSlot = PERM_ENCHANTMENT_SLOT; enchantSlot <= TEMP_ENCHANTMENT_SLOT; ++enchantSlot) { @@ -7228,7 +7228,7 @@ void Player::_SaveCurrency(SQLTransaction& trans) if (!entry) // should never happen continue; - switch(itr->second.state) + switch (itr->second.state) { case PLAYERCURRENCY_NEW: stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_PLAYER_CURRENCY); @@ -7469,7 +7469,7 @@ void Player::ModifyCurrency(uint32 id, int32 count, bool printLog/* = true*/, bo if (currency->Category == CURRENCY_CATEGORY_META_CONQUEST) { //original conquest cap is highest of bg/arena conquest cap. - if(weekCap > _ConquestCurrencyTotalWeekCap) + if (weekCap > _ConquestCurrencyTotalWeekCap) _ConquestCurrencyTotalWeekCap = weekCap; // count was changed to week limit, now we can modify original points. ModifyCurrency(CURRENCY_TYPE_CONQUEST_POINTS, count, printLog ); @@ -7477,7 +7477,7 @@ void Player::ModifyCurrency(uint32 id, int32 count, bool printLog/* = true*/, bo } // on new case just set init. - if(itr->second.state == PLAYERCURRENCY_NEW) + if (itr->second.state == PLAYERCURRENCY_NEW) { SendNewCurrency(id); return; @@ -7521,7 +7521,7 @@ uint32 Player::GetCurrencyWeekCap(uint32 id, bool usePrecision) const return 0; uint32 cap = _GetCurrencyWeekCap(entry); - if(usePrecision && entry->Flags & CURRENCY_FLAG_HIGH_PRECISION) + if (usePrecision && entry->Flags & CURRENCY_FLAG_HIGH_PRECISION) cap /= 100; return cap; @@ -11497,7 +11497,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest return EQUIP_ERR_NOT_OWNER; // Currency Tokenizer are not supposed to be swapped out of their hidden bag - if(pItem->IsCurrencyToken()) + if (pItem->IsCurrencyToken()) { sLog->outError(LOG_FILTER_PLAYER, "Possible hacking attempt: Player %s [guid: %u] tried to move token [guid: %u, entry: %u] out of the currency bag!", GetName().c_str(), GetGUIDLow(), pItem->GetGUIDLow(), pProto->ItemId); @@ -21326,7 +21326,7 @@ void Player::InitDisplayIds() } } -inline bool Player::_StoreOrEquipNewItem(uint32 vendorslot, uint32 item, uint8 count, uint8 bag, uint8 slot, int32 price, ItemTemplate const *pProto, Creature *pVendor, VendorItem const* crItem, bool bStore) +inline bool Player::_StoreOrEquipNewItem(uint32 vendorslot, uint32 item, uint8 count, uint8 bag, uint8 slot, int32 price, ItemTemplate const* pProto, Creature* pVendor, VendorItem const* crItem, bool bStore) { ItemPosCountVec vDest; uint16 uiDest = 0; @@ -23450,7 +23450,7 @@ uint32 Player::GetResurrectionSpellId() } // Used in triggers for check "Only to targets that grant experience or honor" req -bool Player::isHonorOrXPTarget(Unit const *victim) +bool Player::isHonorOrXPTarget(Unit const* victim) { uint8 v_level = victim->getLevel(); uint8 k_grey = Trinity::XP::GetGrayLevel(getLevel()); diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 497aa98e043..b27d66a7654 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -2267,7 +2267,7 @@ class Player : public Unit, public GridObject bool IsAtRecruitAFriendDistance(WorldObject const* pOther) const; void RewardPlayerAndGroupAtKill(Unit* victim, bool isBattleGround); void RewardPlayerAndGroupAtEvent(uint32 creature_id, WorldObject* pRewardSource); - bool isHonorOrXPTarget(Unit const *victim); + bool isHonorOrXPTarget(Unit const* victim); bool GetsRecruitAFriendBonus(bool forXP); uint8 GetGrantableLevels() { return m_grantableLevels; } @@ -2938,7 +2938,7 @@ class Player : public Unit, public GridObject /* * @name _GetCurrencyTotalCap * @brief return total cap for selected currency - + * @param currency CurrencyTypesEntry witch should get week cap */ uint32 _GetCurrencyTotalCap(const CurrencyTypesEntry* currency) const; diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index 292b888e552..542fde39a3a 100644 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -668,7 +668,7 @@ void Player::UpdateManaRegen() // Apply PCT bonus from SPELL_AURA_MOD_POWER_REGEN_PERCENT aura on spirit base regen spirit_regen *= GetTotalAuraMultiplierByMiscValue(SPELL_AURA_MOD_POWER_REGEN_PERCENT, POWER_MANA); - // SpiritRegen(SPI,INT,LEVEL) = (0.001 + (SPI x sqrt(INT) x BASE_REGEN[LEVEL])) x 5 + // SpiritRegen(SPI, INT, LEVEL) = (0.001 + (SPI x sqrt(INT) x BASE_REGEN[LEVEL])) x 5 if (GetStat(STAT_INTELLECT) > 0.0f) spirit_regen *= sqrt(GetStat(STAT_INTELLECT)); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 6d79c401b6a..c1bd43fe853 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -4876,7 +4876,7 @@ bool Unit::HandleSpellCritChanceAuraProc(Unit* victim, uint32 /*damage*/, AuraEf return true; } -bool Unit::HandleAuraProcOnPowerAmount(Unit* victim, uint32 /*damage*/, AuraEffect* triggeredByAura, SpellInfo const *procSpell, uint32 procFlag, uint32 /*procEx*/, uint32 cooldown) +bool Unit::HandleAuraProcOnPowerAmount(Unit* victim, uint32 /*damage*/, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 /*procEx*/, uint32 cooldown) { // Get triggered aura spell info SpellInfo const* auraSpellInfo = triggeredByAura->GetSpellInfo(); @@ -4944,7 +4944,7 @@ bool Unit::HandleAuraProcOnPowerAmount(Unit* victim, uint32 /*damage*/, AuraEffe uint32 solarEclipseMarker = 67483; uint32 lunarEclipseMarker = 67484; - switch(effIndex) + switch (effIndex) { case 0: { @@ -4955,7 +4955,7 @@ bool Unit::HandleAuraProcOnPowerAmount(Unit* victim, uint32 /*damage*/, AuraEffe if (HasAura(solarEclipseMarker)) { RemoveAurasDueToSpell(solarEclipseMarker); - CastSpell(this,lunarEclipseMarker,true); + CastSpell(this, lunarEclipseMarker, true); } break; } @@ -4968,7 +4968,7 @@ bool Unit::HandleAuraProcOnPowerAmount(Unit* victim, uint32 /*damage*/, AuraEffe if (HasAura(lunarEclipseMarker)) { RemoveAurasDueToSpell(lunarEclipseMarker); - CastSpell(this,solarEclipseMarker,true); + CastSpell(this, solarEclipseMarker, true); } break; @@ -16977,7 +16977,7 @@ void Unit::ReadMovementInfo(WorldPacket& data, MovementInfo* mi) if (GetTransport()) GetTransport()->UpdatePosition(mi); - //! Anti-cheat checks. Please keep them in seperate if() blocks to maintain a clear overview. + //! Anti-cheat checks. Please keep them in seperate if () blocks to maintain a clear overview. //! Might be subject to latency, so just remove improper flags. #ifdef TRINITY_DEBUG #define REMOVE_VIOLATING_FLAGS(check, maskToRemove) \ @@ -17077,7 +17077,7 @@ void Unit::WriteMovementInfo(WorldPacket& data) ObjectGuid guid = mover->GetGUID(); ObjectGuid tguid = hasTransportData ? GetTransport()->GetGUID() : 0; - for(uint32 i = 0; i < MSE_COUNT; ++i) + for (uint32 i = 0; i < MSE_COUNT; ++i) { MovementStatusElements element = sequence[i]; if (element == MSEEnd) @@ -17323,10 +17323,10 @@ void Unit::SendTeleportPacket(Position& pos) // Relocate the player/creature to its old position, so we can broadcast to nearby players correctly if (GetTypeId() == TYPEID_PLAYER) - Relocate(&pos); + Relocate(&pos); else Relocate(&oldPos); - + // Broadcast the packet to everyone except self. SendMessageToSet(&data, false); } diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 2a82b520d32..40918dbb611 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -2296,7 +2296,7 @@ class Unit : public WorldObject void DisableSpline(); private: bool IsTriggeredAtSpellProcEvent(Unit* victim, Aura* aura, SpellInfo const* procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const* & spellProcEvent); - bool HandleAuraProcOnPowerAmount(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); + bool HandleAuraProcOnPowerAmount(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); bool HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); bool HandleHasteAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); bool HandleSpellCritChanceAuraProc(Unit* victim, uint32 damage, AuraEffect* triggredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 394d85a919f..1916dd17c89 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -2088,7 +2088,7 @@ void FillItemDamageFields(float* minDamage, float* maxDamage, float* dps, uint32 *dps = damageInfo->DPS[quality]; float avgDamage = *dps * delay * 0.001f; *minDamage = (statScalingFactor * -0.5f + 1.0f) * avgDamage; - *maxDamage = floor(float(avgDamage * (statScalingFactor * 0.5f + 1.0f) + 0.5f)); + *maxDamage = floor(float(avgDamage* (statScalingFactor * 0.5f + 1.0f) + 0.5f)); } uint32 FillItemArmor(uint32 itemlevel, uint32 itemClass, uint32 itemSubclass, uint32 quality, uint32 inventoryType) @@ -8697,7 +8697,7 @@ void ObjectMgr::LoadPhaseDefinitions() do { - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); PhaseDefinition PhaseDefinition; @@ -8742,7 +8742,7 @@ void ObjectMgr::LoadSpellPhaseInfo() uint32 count = 0; do { - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); SpellPhaseInfo spellPhaseInfo; spellPhaseInfo.spellId = fields[0].GetUInt32(); diff --git a/src/server/game/Guilds/GuildFinderMgr.cpp b/src/server/game/Guilds/GuildFinderMgr.cpp index 0e041af402a..f0b6e0a4495 100644 --- a/src/server/game/Guilds/GuildFinderMgr.cpp +++ b/src/server/game/Guilds/GuildFinderMgr.cpp @@ -142,7 +142,7 @@ void GuildFinderMgr::RemoveAllMembershipRequestsFromPlayer(uint32 playerId) for (MembershipRequestStore::iterator itr = _membershipRequests.begin(); itr != _membershipRequests.end(); ++itr) { std::vector::iterator itr2 = itr->second.begin(); - for(; itr2 != itr->second.end(); ++itr2) + for (; itr2 != itr->second.end(); ++itr2) if (itr2->GetPlayerGUID() == playerId) break; @@ -167,7 +167,7 @@ void GuildFinderMgr::RemoveAllMembershipRequestsFromPlayer(uint32 playerId) void GuildFinderMgr::RemoveMembershipRequest(uint32 playerId, uint32 guildId) { std::vector::iterator itr = _membershipRequests[guildId].begin(); - for(; itr != _membershipRequests[guildId].end(); ++itr) + for (; itr != _membershipRequests[guildId].end(); ++itr) if (itr->GetPlayerGUID() == playerId) break; @@ -306,7 +306,7 @@ void GuildFinderMgr::DeleteGuild(uint32 guildId) // Notify the applicant his submition has been removed if (Player* player = ObjectAccessor::FindPlayer(MAKE_NEW_GUID(applicant, 0, HIGHGUID_PLAYER))) SendMembershipRequestListUpdate(*player); - + ++itr; } diff --git a/src/server/game/Handlers/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cpp index 780f70e8be2..89dbe03703a 100644 --- a/src/server/game/Handlers/ChatHandler.cpp +++ b/src/server/game/Handlers/ChatHandler.cpp @@ -45,7 +45,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) uint32 type = 0; uint32 lang; - switch(recvData.GetOpcode()) + switch (recvData.GetOpcode()) { case CMSG_MESSAGECHAT_SAY: type = CHAT_MSG_SAY; diff --git a/src/server/game/Handlers/GuildHandler.cpp b/src/server/game/Handlers/GuildHandler.cpp index 8c570bc1937..4c3360122f2 100644 --- a/src/server/game/Handlers/GuildHandler.cpp +++ b/src/server/game/Handlers/GuildHandler.cpp @@ -400,7 +400,7 @@ void WorldSession::HandleGuildBankerActivate(WorldPacket& recvPacket) sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_BANKER_ACTIVATE [%s]: Go: [" UI64FMTD "] AllSlots: %u" , GetPlayerInfo().c_str(), guid, sendAllSlots); - GameObject const * const go = GetPlayer()->GetGameObjectIfCanInteractWith(guid, GAMEOBJECT_TYPE_GUILD_BANK); + GameObject const* const go = GetPlayer()->GetGameObjectIfCanInteractWith(guid, GAMEOBJECT_TYPE_GUILD_BANK); if (!go) return; diff --git a/src/server/game/Handlers/MailHandler.cpp b/src/server/game/Handlers/MailHandler.cpp index 4d09a9b4468..c21d16d3600 100644 --- a/src/server/game/Handlers/MailHandler.cpp +++ b/src/server/game/Handlers/MailHandler.cpp @@ -436,7 +436,7 @@ void WorldSession::HandleMailReturnToSender(WorldPacket& recvData) { for (MailItemInfoVec::iterator itr2 = m->items.begin(); itr2 != m->items.end(); ++itr2) { - if (Item * const item = player->GetMItem(itr2->item_guid)) + if (Item* const item = player->GetMItem(itr2->item_guid)) draft.AddItem(item); player->RemoveMItem(itr2->item_guid); } diff --git a/src/server/game/Handlers/QuestHandler.cpp b/src/server/game/Handlers/QuestHandler.cpp index 6cd6112efbc..78800f77098 100644 --- a/src/server/game/Handlers/QuestHandler.cpp +++ b/src/server/game/Handlers/QuestHandler.cpp @@ -330,7 +330,7 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket& recvData) case TYPEID_PLAYER: { //For AutoSubmition was added plr case there as it almost same exclute AI script cases. - Creature *creatureQGiver = object->ToCreature(); + Creature* creatureQGiver = object->ToCreature(); if (!creatureQGiver || !(sScriptMgr->OnQuestReward(_player, creatureQGiver, quest, reward))) { // Send next quest diff --git a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp index 06521fadb3a..94819e87213 100644 --- a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp @@ -165,7 +165,7 @@ bool RandomMovementGenerator::GetResetPosition(Creature &creature, flo creature.GetRespawnPosition(x, y, z, NULL, &radius); // use current if in range - if (creature.IsWithinDist2d(x, y,radius)) + if (creature.IsWithinDist2d(x, y, radius)) creature.GetPosition(x, y, z); return true; diff --git a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp index a1ac4ccb679..d111725a760 100755 --- a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp @@ -99,7 +99,7 @@ void TargetedMovementGeneratorMedium::_setTargetLocation(T &owner) //We don't update Mob Movement, if the difference between New destination and last destination is < BothObjectSize float bothObjectSize = i_target->GetObjectBoundingRadius() + owner.GetObjectBoundingRadius() + CONTACT_DISTANCE; - if ( i_destinationHolder.HasDestination() && i_destinationHolder.GetDestinationDiff(x, y,z) < bothObjectSize ) + if ( i_destinationHolder.HasDestination() && i_destinationHolder.GetDestinationDiff(x, y, z) < bothObjectSize ) return; */ diff --git a/src/server/game/Movement/MovementStructures.h b/src/server/game/Movement/MovementStructures.h index 9a92e9747f1..774a25d0e5b 100644 --- a/src/server/game/Movement/MovementStructures.h +++ b/src/server/game/Movement/MovementStructures.h @@ -2173,7 +2173,7 @@ MovementStatusElements MoveUpdateTeleport[] = MSEGuidByte4, MSETimestamp, MSEGuidByte0, - + MSEEnd, }; diff --git a/src/server/game/Movement/Spline/MovementUtil.cpp b/src/server/game/Movement/Spline/MovementUtil.cpp index 88b838ef5d9..7a380478ee2 100644 --- a/src/server/game/Movement/Spline/MovementUtil.cpp +++ b/src/server/game/Movement/Spline/MovementUtil.cpp @@ -104,39 +104,39 @@ namespace Movement char const* g_MovementFlag_names[] = { - STR(Forward ),// 0x00000001, - STR(Backward ),// 0x00000002, - STR(Strafe_Left ),// 0x00000004, - STR(Strafe_Right ),// 0x00000008, - STR(Turn_Left ),// 0x00000010, - STR(Turn_Right ),// 0x00000020, - STR(Pitch_Up ),// 0x00000040, - STR(Pitch_Down ),// 0x00000080, - - STR(Walk ),// 0x00000100, // Walking - STR(Levitation ),// 0x00000200, - STR(Root ),// 0x00000400, - STR(Falling ),// 0x00000800, - STR(Fallingfar ),// 0x00001000, - STR(Pendingstop ),// 0x00002000, - STR(PendingSTRafestop ),// 0x00004000, - STR(Pendingforward ),// 0x00008000, - STR(Pendingbackward ),// 0x00010000, - STR(PendingSTRafeleft ),// 0x00020000, - STR(PendingSTRaferight ),// 0x00040000, - STR(Pendingroot ),// 0x00080000, - STR(Swimming ),// 0x00100000, // Appears With Fly Flag Also - STR(Ascending ),// 0x00200000, // Swim Up Also - STR(Descending ),// 0x00400000, // Swim Down Also - STR(Can_Fly ),// 0x00800000, // Can Fly In 3.3? - STR(Flying ),// 0x01000000, // Actual Flying Mode - STR(Spline_Elevation ),// 0x02000000, // Used For Flight Paths - STR(Waterwalking ),// 0x04000000, // Prevent Unit From Falling Through Water - STR(Safe_Fall ),// 0x08000000, // Active Rogue Safe Fall Spell (Passive) - STR(Hover ),// 0x10000000 - STR(Local_Dirty ),// 0x20000000 - STR(None31 ),// 0x40000000 - STR(None32 ),// 0x80000000 + STR(Forward ), // 0x00000001, + STR(Backward ), // 0x00000002, + STR(Strafe_Left ), // 0x00000004, + STR(Strafe_Right ), // 0x00000008, + STR(Turn_Left ), // 0x00000010, + STR(Turn_Right ), // 0x00000020, + STR(Pitch_Up ), // 0x00000040, + STR(Pitch_Down ), // 0x00000080, + + STR(Walk ), // 0x00000100, // Walking + STR(Levitation ), // 0x00000200, + STR(Root ), // 0x00000400, + STR(Falling ), // 0x00000800, + STR(Fallingfar ), // 0x00001000, + STR(Pendingstop ), // 0x00002000, + STR(PendingSTRafestop ), // 0x00004000, + STR(Pendingforward ), // 0x00008000, + STR(Pendingbackward ), // 0x00010000, + STR(PendingSTRafeleft ), // 0x00020000, + STR(PendingSTRaferight ), // 0x00040000, + STR(Pendingroot ), // 0x00080000, + STR(Swimming ), // 0x00100000, // Appears With Fly Flag Also + STR(Ascending ), // 0x00200000, // Swim Up Also + STR(Descending ), // 0x00400000, // Swim Down Also + STR(Can_Fly ), // 0x00800000, // Can Fly In 3.3? + STR(Flying ), // 0x01000000, // Actual Flying Mode + STR(Spline_Elevation ), // 0x02000000, // Used For Flight Paths + STR(Waterwalking ), // 0x04000000, // Prevent Unit From Falling Through Water + STR(Safe_Fall ), // 0x08000000, // Active Rogue Safe Fall Spell (Passive) + STR(Hover ), // 0x10000000 + STR(Local_Dirty ), // 0x20000000 + STR(None31 ), // 0x40000000 + STR(None32 ), // 0x80000000 STR(Unk1 ), STR(Unk2 ), STR(Unk3 ), @@ -157,38 +157,38 @@ namespace Movement char const* g_SplineFlag_names[32] = { - STR(AnimBit1 ),// 0x00000001, - STR(AnimBit2 ),// 0x00000002, - STR(AnimBit3 ),// 0x00000004, - STR(Unknown0 ),// 0x00000008, - STR(FallingSlow ),// 0x00000010, - STR(Done ),// 0x00000020, - STR(Falling ),// 0x00000040, // Not Compartible With Trajectory Movement - STR(No_Spline ),// 0x00000080, - STR(Unknown2 ),// 0x00000100, - STR(Flying ),// 0x00000200, // Smooth Movement(Catmullrom Interpolation Mode), Flying Animation - STR(OrientationFixed ),// 0x00000400, // Model Orientation Fixed - STR(Catmullrom ),// 0x00000800, // Used Catmullrom Interpolation Mode - STR(Cyclic ),// 0x00001000, // Movement By Cycled Spline - STR(Enter_Cycle ),// 0x00002000, // Everytime Appears With Cyclic Flag In Monster Move Packet - STR(Frozen ),// 0x00004000, - STR(TransportEnter ),// 0x00008000 - STR(TransportExit ),// 0x00010000 - STR(Unknown3 ),// 0x00020000, - STR(Unknown4 ),// 0x00040000, - STR(OrientationInversed),// 0x00080000, // Appears With Runmode Flag, Nodes ),// 1, Handles Orientation - STR(SmoothGroundPath ),// 0x00100000, - STR(Walkmode ),// 0x00200000, - STR(UncompressedPath ),// 0x00400000, - STR(Unknown6 ),// 0x00800000, - STR(Animation ),// 0x01000000, // Animationid (0...3), Uint32 Time, Not Compartible With Trajectory And Fall Movement - STR(Parabolic ),// 0x02000000, // Not Compartible With Fall Movement - STR(Final_Point ),// 0x04000000, - STR(Final_Target ),// 0x08000000, - STR(Final_Angle ),// 0x10000000, - STR(Unknown7 ),// 0x20000000, - STR(Unknown8 ),// 0x40000000, - STR(Unknown9 ),// 0x80000000, + STR(AnimBit1 ), // 0x00000001, + STR(AnimBit2 ), // 0x00000002, + STR(AnimBit3 ), // 0x00000004, + STR(Unknown0 ), // 0x00000008, + STR(FallingSlow ), // 0x00000010, + STR(Done ), // 0x00000020, + STR(Falling ), // 0x00000040, // Not Compartible With Trajectory Movement + STR(No_Spline ), // 0x00000080, + STR(Unknown2 ), // 0x00000100, + STR(Flying ), // 0x00000200, // Smooth Movement(Catmullrom Interpolation Mode), Flying Animation + STR(OrientationFixed ), // 0x00000400, // Model Orientation Fixed + STR(Catmullrom ), // 0x00000800, // Used Catmullrom Interpolation Mode + STR(Cyclic ), // 0x00001000, // Movement By Cycled Spline + STR(Enter_Cycle ), // 0x00002000, // Everytime Appears With Cyclic Flag In Monster Move Packet + STR(Frozen ), // 0x00004000, + STR(TransportEnter ), // 0x00008000 + STR(TransportExit ), // 0x00010000 + STR(Unknown3 ), // 0x00020000, + STR(Unknown4 ), // 0x00040000, + STR(OrientationInversed), // 0x00080000, // Appears With Runmode Flag, Nodes ), // 1, Handles Orientation + STR(SmoothGroundPath ), // 0x00100000, + STR(Walkmode ), // 0x00200000, + STR(UncompressedPath ), // 0x00400000, + STR(Unknown6 ), // 0x00800000, + STR(Animation ), // 0x01000000, // Animationid (0...3), Uint32 Time, Not Compartible With Trajectory And Fall Movement + STR(Parabolic ), // 0x02000000, // Not Compartible With Fall Movement + STR(Final_Point ), // 0x04000000, + STR(Final_Target ), // 0x08000000, + STR(Final_Angle ), // 0x10000000, + STR(Unknown7 ), // 0x20000000, + STR(Unknown8 ), // 0x40000000, + STR(Unknown9 ), // 0x80000000, }; template diff --git a/src/server/game/Movement/Spline/Spline.h b/src/server/game/Movement/Spline/Spline.h index 2a2f3fa8f43..42090cae71b 100644 --- a/src/server/game/Movement/Spline/Spline.h +++ b/src/server/game/Movement/Spline/Spline.h @@ -91,13 +91,13 @@ public: @param t - percent of segment length, assumes that t in range [0, 1] @param Idx - spline segment index, should be in range [first, last) */ - void evaluate_percent(index_type Idx, float u, Vector3& c) const {(this->*evaluators[m_mode])(Idx, u,c);} + void evaluate_percent(index_type Idx, float u, Vector3& c) const {(this->*evaluators[m_mode])(Idx, u, c);} /** Caclulates derivation in index Idx, and percent of segment length t @param Idx - spline segment index, should be in range [first, last) @param t - percent of spline segment length, assumes that t in range [0, 1] */ - void evaluate_derivative(index_type Idx, float u, Vector3& hermite) const {(this->*derivative_evaluators[m_mode])(Idx, u,hermite);} + void evaluate_derivative(index_type Idx, float u, Vector3& hermite) const {(this->*derivative_evaluators[m_mode])(Idx, u, hermite);} /** Bounds for spline indexes. All indexes should be in range [first, last). */ index_type first() const { return index_lo;} @@ -156,12 +156,12 @@ public: /** Calculates the position for given segment Idx, and percent of segment length t @param t = partial_segment_length / whole_segment_length @param Idx - spline segment index, should be in range [first, last). */ - void evaluate_percent(index_type Idx, float u, Vector3& c) const { SplineBase::evaluate_percent(Idx, u,c);} + void evaluate_percent(index_type Idx, float u, Vector3& c) const { SplineBase::evaluate_percent(Idx, u, c);} /** Caclulates derivation for index Idx, and percent of segment length t @param Idx - spline segment index, should be in range [first, last) @param t - percent of spline segment length, assumes that t in range [0, 1]. */ - void evaluate_derivative(index_type Idx, float u, Vector3& c) const { SplineBase::evaluate_derivative(Idx, u,c);} + void evaluate_derivative(index_type Idx, float u, Vector3& c) const { SplineBase::evaluate_derivative(Idx, u, c);} // Assumes that t in range [0, 1] index_type computeIndexInBounds(float t) const; @@ -169,7 +169,7 @@ public: /** Initializes spline. Don't call other methods while spline not initialized. */ void init_spline(const Vector3 * controls, index_type count, EvaluationMode m) { SplineBase::init_spline(controls, count, m);} - void init_cyclic_spline(const Vector3 * controls, index_type count, EvaluationMode m, index_type cyclic_point) { SplineBase::init_cyclic_spline(controls, count, m,cyclic_point);} + void init_cyclic_spline(const Vector3 * controls, index_type count, EvaluationMode m, index_type cyclic_point) { SplineBase::init_cyclic_spline(controls, count, m, cyclic_point);} /** Initializes lengths with SplineBase::SegLength method. */ void initLengths(); diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index 6fc2452a83c..3299c104697 100644 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -871,7 +871,7 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) if (expansion > world_expansion) expansion = world_expansion; - sLog->outDebug(LOG_FILTER_NETWORKIO, "WorldSocket::HandleAuthSession: (s,v) check s: %s v: %s", + sLog->outDebug(LOG_FILTER_NETWORKIO, "WorldSocket::HandleAuthSession: (s, v) check s: %s v: %s", fields[5].GetCString(), fields[4].GetCString()); diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 14d8b7e9ce6..c0ab92d36c5 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -1734,7 +1734,7 @@ void Spell::SelectImplicitTrajTargets() m_targets.ModDst(trajDst); } - if (Vehicle * veh = m_caster->GetVehicleKit()) + if (Vehicle* veh = m_caster->GetVehicleKit()) veh->SetLastShootPos(*m_targets.GetDstPos()); } @@ -4981,7 +4981,7 @@ SpellCastResult Spell::CheckCast(bool strict) return SPELL_FAILED_ONLY_BATTLEGROUNDS; // do not allow spells to be cast in arenas or rated battlegrounds - if (Player * player = m_caster->ToPlayer()) + if (Player* player = m_caster->ToPlayer()) if (player->InArena()/* || player->InRatedBattleGround() NYI*/) { SpellCastResult castResult = CheckArenaAndRatedBattlegroundCastRules(); diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index d3a86180f50..56b8d251de6 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -1352,7 +1352,7 @@ public: { Unit* unit = handler->getSelectedUnit(); Player* player = handler->GetSession()->GetPlayer(); - if(unit && unit->GetTypeId() == TYPEID_PLAYER) + if (unit && unit->GetTypeId() == TYPEID_PLAYER) player = unit->ToPlayer(); player->GetPhaseMgr().SendDebugReportToPlayer(handler->GetSession()->GetPlayer()); diff --git a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp index 44fa0f87177..d0eefd67392 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp @@ -314,7 +314,7 @@ class npc_harrison_jones : public CreatureScript me->SetEntry(NPC_HARRISON_JONES_2); me->SetDisplayId(MODEL_HARRISON_JONES_2); me->SetTarget(0); - me->SetByteValue(UNIT_FIELD_BYTES_1, 0,UNIT_STAND_STATE_DEAD); + me->SetByteValue(UNIT_FIELD_BYTES_1, 0, UNIT_STAND_STATE_DEAD); me->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD); if (instance) instance->SetData(DATA_GONGEVENT, DONE); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo_the_godbreaker.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo_the_godbreaker.cpp index f4083337f56..bc712ab3a31 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo_the_godbreaker.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo_the_godbreaker.cpp @@ -22,7 +22,7 @@ enum Yells { - // Jin'do the Godbreaker + // Jin'do the Godbreaker SAY_INTRO = 0, SAY_AGGRO = 1, EMOTE_SHADOWS_OF_HAKKAR = 2, // ID - 97172 Shadows of Hakkar diff --git a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_anraphet.cpp b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_anraphet.cpp index 490c0a77494..9742aea194b 100644 --- a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_anraphet.cpp +++ b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_anraphet.cpp @@ -150,7 +150,7 @@ public: { // Set to combat automatically, Brann's event won't repeat me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - events.SetPhase(PHASE_COMBAT); + events.SetPhase(PHASE_COMBAT); ScheduleCombatEvents(); me->SetHomePosition(AnraphetActivatePos); } @@ -167,7 +167,7 @@ public: { instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); Talk(ANRAPHET_SAY_DEATH); - + if (Creature* brann = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_BRANN_0_GUID))) brann->AI()->DoAction(ACTION_ANRAPHET_DIED); @@ -209,12 +209,12 @@ public: { if ((events.GetPhaseMask() & PHASE_MASK_COMBAT) && (!UpdateVictim() || !CheckInRoom())) return; - + events.Update(diff); - + if (me->HasUnitState(UNIT_STATE_CASTING)) return; - + while (uint32 eventId = events.ExecuteEvent()) { switch (eventId) @@ -313,7 +313,7 @@ class npc_alpha_beam : public CreatureScript private: InstanceScript* _instance; }; - + CreatureAI* GetAI(Creature* creature) const { return GetHallsOfOriginationAI(creature); @@ -538,7 +538,7 @@ public: Unit* caster = GetCaster(); float angle = float(rand_norm()) * static_cast(2 * M_PI); uint32 dist = caster->GetObjectSize() + GetSpellInfo()->Effects[effIndex].CalcRadius(GetCaster()) * (float)rand_norm(); - + float x = caster->GetPositionX() + dist * std::cos(angle); float y = caster->GetPositionY() + dist * std::sin(angle); float z = caster->GetMap()->GetHeight(x, y, caster->GetPositionZ()); diff --git a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp index e20ad0ccf82..47bab21e215 100644 --- a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp +++ b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp @@ -45,14 +45,14 @@ enum Spells SPELL_RAGING_SMASH = 83650, SPELL_FLAME_BOLT = 77370, SPELL_EARTH_SPIKE_WARN = 94974, - + SPELL_PTAH_EXPLOSION = 75519, SPELL_SANDSTORM = 75491, - + SPELL_SUMMON_QUICKSAND = 75550, // Spell not in DBC, no SMSG_SPELL_START/GO for it SPELL_BEETLE_BURROW = 75463, - + SPELL_SUMMON_JEWELED_SCARAB = 75462, SPELL_SUMMON_DUSTBONE_HORROR = 75521, }; @@ -150,19 +150,19 @@ public: { events.SetPhase(PHASE_DISPERSE); _hasDispersed = true; - + me->AttackStop(); DoCast(me, SPELL_SANDSTORM); SendWeather(WEATHER_STATE_LIGHT_SANDSTORM, 1.0f); events.ScheduleEvent(EVENT_PTAH_EXPLODE, 6000, 0, PHASE_DISPERSE); events.ScheduleEvent(EVENT_QUICKSAND, 10000, 0, PHASE_DISPERSE); - + std::list stalkers; GetCreatureListWithEntryInGrid(stalkers, me, NPC_BEETLE_STALKER, 100.0f); std::list beetlers = stalkers; - + Trinity::Containers::RandomResizeList(beetlers, 9); // Holds the summoners of Jeweled Scarab - + for (std::list::iterator itr = beetlers.begin(); itr != beetlers.end(); ++itr) { stalkers.remove((*itr)); // Remove it to prevent a single trigger from spawning multiple npcs. @@ -172,7 +172,7 @@ public: } Trinity::Containers::RandomResizeList(stalkers, 2); // Holds the summoners of Dustbone Horror - + for (std::list::iterator itr = stalkers.begin(); itr != stalkers.end(); ++itr) (*itr)->CastSpell((*itr), SPELL_SUMMON_DUSTBONE_HORROR); } @@ -194,7 +194,7 @@ public: } } } - + void EnterCombat(Unit* /*who*/) { instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me, 1); @@ -221,12 +221,12 @@ public: { if (!UpdateVictim() || !CheckInRoom()) return; - + events.Update(diff); - + if (me->HasUnitState(UNIT_STATE_CASTING)) return; - + while (uint32 eventId = events.ExecuteEvent()) { switch (eventId) @@ -256,11 +256,11 @@ public: break; } } - + if (events.GetPhaseMask() & PHASE_MASK_NORMAL) // Do not melee in the disperse phase DoMeleeAttackIfReady(); } - + protected: bool _hasDispersed; uint8 _summonDeaths; diff --git a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_temple_guardian_anhuur.cpp b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_temple_guardian_anhuur.cpp index aec5f7416c6..9261575bc82 100644 --- a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_temple_guardian_anhuur.cpp +++ b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_temple_guardian_anhuur.cpp @@ -53,7 +53,7 @@ enum Spells SPELL_SHIELD_VISUAL_RIGHT = 83698, SPELL_BEAM_OF_LIGHT_RIGHT = 76573, - + SPELL_SHIELD_VISUAL_LEFT = 83697, SPELL_BEAM_OF_LIGHT_LEFT = 74930, @@ -196,12 +196,12 @@ public: { if (!UpdateVictim() || !CheckInRoom() || me->GetCurrentSpell(CURRENT_CHANNELED_SPELL) || _phase == PHASE_SHIELDED) return; - + events.Update(diff); - + if (me->HasUnitState(UNIT_STATE_CASTING)) return; - + while (uint32 eventId = events.ExecuteEvent()) { switch (eventId) @@ -225,22 +225,22 @@ public: Unit* target = me->FindNearestCreature(NPC_SEARING_LIGHT, 100.0f); if (!target) break; - + std::list stalkers; GetCreatureListWithEntryInGrid(stalkers, me, NPC_CAVE_IN_STALKER, 100.0f); stalkers.remove_if(Trinity::HeightDifferenceCheck(ObjectAccessor::GetGameObject(*me, instance->GetData64(DATA_ANHUUR_DOOR)), 5.0f, true)); - + if (stalkers.empty()) break; stalkers.sort(Trinity::ObjectDistanceOrderPred(target)); - + // Get the closest statue face (any of its eyes) Creature* eye1 = stalkers.front(); stalkers.remove(eye1); // Remove the eye. stalkers.sort(Trinity::ObjectDistanceOrderPred(eye1)); // Find the second eye. Creature* eye2 = stalkers.front(); - + eye1->CastSpell(eye1, SPELL_SEARING_LIGHT, true); eye2->CastSpell(eye2, SPELL_SEARING_LIGHT, true); break; @@ -267,11 +267,11 @@ class spell_anhuur_shield_of_light : public SpellScriptLoader { public: spell_anhuur_shield_of_light() : SpellScriptLoader("spell_anhuur_shield_of_light") { } - + class spell_anhuur_shield_of_light_SpellScript : public SpellScript { PrepareSpellScript(spell_anhuur_shield_of_light_SpellScript); - + void FilterTargets(std::list& targets) { if (InstanceMap* instance = GetCaster()->GetMap()->ToInstanceMap()) @@ -288,13 +288,13 @@ class spell_anhuur_shield_of_light : public SpellScriptLoader } } } - + void Register() { OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_anhuur_shield_of_light_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENTRY); } }; - + SpellScript* GetSpellScript() const { return new spell_anhuur_shield_of_light_SpellScript(); @@ -305,11 +305,11 @@ class spell_anhuur_disable_beacon_beams : public SpellScriptLoader { public: spell_anhuur_disable_beacon_beams() : SpellScriptLoader("spell_anhuur_disable_beacon_beams") { } - + class spell_anhuur_disable_beacon_beams_SpellScript : public SpellScript { PrepareSpellScript(spell_anhuur_disable_beacon_beams_SpellScript); - + void HandleScript(SpellEffIndex /*effIndex*/) { GetHitUnit()->RemoveAurasDueToSpell(GetEffectValue()); @@ -329,7 +329,7 @@ class spell_anhuur_disable_beacon_beams : public SpellScriptLoader OnEffectHit += SpellEffectFn(spell_anhuur_disable_beacon_beams_SpellScript::Notify, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); } }; - + SpellScript* GetSpellScript() const { return new spell_anhuur_disable_beacon_beams_SpellScript(); diff --git a/src/server/scripts/Kalimdor/HallsOfOrigination/halls_of_origination.h b/src/server/scripts/Kalimdor/HallsOfOrigination/halls_of_origination.h index 54ecdfb331d..5cc83e4af9c 100644 --- a/src/server/scripts/Kalimdor/HallsOfOrigination/halls_of_origination.h +++ b/src/server/scripts/Kalimdor/HallsOfOrigination/halls_of_origination.h @@ -37,7 +37,7 @@ enum Data DATA_AMMUNAE, DATA_SETESH, DATA_RAJH, - + // Temple Guardian Anhuur DATA_ANHUUR_GUID, DATA_ANHUUR_LEFT_BEACON, @@ -56,7 +56,7 @@ enum Creatures BOSS_TEMPLE_GUARDIAN_ANHUUR = 39425, NPC_CAVE_IN_STALKER = 40183, NPC_SEARING_LIGHT = 40283, - + BOSS_EARTHRAGER_PTAH = 39428, NPC_BEETLE_STALKER = 40459, // Summons both Jeweled Scarab and Dustbone Horror NPC_JEWELED_SCARAB = 40458, diff --git a/src/server/scripts/Kalimdor/HallsOfOrigination/instance_halls_of_origination.cpp b/src/server/scripts/Kalimdor/HallsOfOrigination/instance_halls_of_origination.cpp index 0cb21aeeba1..8c160bdc6f7 100644 --- a/src/server/scripts/Kalimdor/HallsOfOrigination/instance_halls_of_origination.cpp +++ b/src/server/scripts/Kalimdor/HallsOfOrigination/instance_halls_of_origination.cpp @@ -27,7 +27,7 @@ #include "WorldPacket.h" #include "WorldSession.h" -DoorData const doorData[] = +DoorData const doorData[] = { {GO_ANHUURS_DOOR, DATA_TEMPLE_GUARDIAN_ANHUUR, DOOR_TYPE_PASSAGE, BOUNDARY_NONE }, {GO_ANHUURS_BRIDGE, DATA_TEMPLE_GUARDIAN_ANHUUR, DOOR_TYPE_PASSAGE, BOUNDARY_NONE }, @@ -51,7 +51,7 @@ class instance_halls_of_origination : public InstanceMapScript struct instance_halls_of_origination_InstanceMapScript : public InstanceScript { - instance_halls_of_origination_InstanceMapScript(InstanceMap* map) : InstanceScript(map) + instance_halls_of_origination_InstanceMapScript(InstanceMap* map) : InstanceScript(map) { SetBossNumber(EncounterCount); LoadDoorData(doorData); @@ -66,7 +66,7 @@ class instance_halls_of_origination : public InstanceMapScript SunMirrorGUID = 0; _deadElementals = 0; } - + void OnGameObjectCreate(GameObject* go) { switch (go->GetEntry()) @@ -150,7 +150,7 @@ class instance_halls_of_origination : public InstanceMapScript default: break; } - + return 0; } @@ -173,7 +173,7 @@ class instance_halls_of_origination : public InstanceMapScript case DATA_ANRAPHET_GUID: return AnraphetGUID; } - + return 0; } @@ -269,7 +269,7 @@ class instance_halls_of_origination : public InstanceMapScript uint64 SunMirrorGUID; uint32 _deadElementals; }; - + InstanceScript* GetInstanceScript(InstanceMap* map) const { return new instance_halls_of_origination_InstanceMapScript(map); diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp index ac668c33874..7893fb7c984 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp @@ -176,7 +176,7 @@ class boss_elder_nadox : public CreatureScript } } - if (me->HealthBelowPct(100 - AmountHealthModifier * 25)) + if (me->HealthBelowPct(100 - AmountHealthModifier* 25)) { Talk(EMOTE_HATCHES, me->GetGUID()); DoCast(me, SPELL_SUMMON_SWARM_GUARD); @@ -298,7 +298,7 @@ public: void FilterTargets(std::list& targets) { - targets.remove_if(GuardianCheck()); + targets.remove_if (GuardianCheck()); } void Register() diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp index 1ac073ae881..13e4e5b51d5 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp @@ -358,7 +358,7 @@ class boss_halion : public CreatureScript if (Creature* twilightHalion = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_TWILIGHT_HALION))) if (twilightHalion->isAlive()) twilightHalion->Kill(twilightHalion); - + if (Creature* controller = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_HALION_CONTROLLER))) if (controller->isAlive()) controller->Kill(controller); diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp index dffdadc5b9c..5a38d163da3 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp @@ -554,7 +554,7 @@ class spell_paralyze_pinnacle : public SpellScriptLoader void FilterTargets(std::list& unitList) { - unitList.remove_if(RitualTargetCheck(GetCaster())); + unitList.remove_if (RitualTargetCheck(GetCaster())); } void Register() diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index d6b89e6b8c8..37278b2e59d 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -196,7 +196,7 @@ public: if (caster->GetPrimaryTalentTree(caster->GetActiveSpec()) != TALENT_TREE_DRUID_BALANCE) return; - switch(GetSpellInfo()->Id) + switch (GetSpellInfo()->Id) { case SPELL_DRUID_WRATH: { @@ -205,10 +205,10 @@ public: if ((!caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE_MARKER) && caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE_MARKER)) || caster->GetPower(POWER_ECLIPSE) == 0) { - caster->CastCustomSpell(caster,SPELL_DRUID_ECLIPSE_GENERAL_ENERGIZE,&energizeAmount,0,0,true); + caster->CastCustomSpell(caster, SPELL_DRUID_ECLIPSE_GENERAL_ENERGIZE, &energizeAmount, 0, 0, true); // If the energize was due to 0 power, cast the eclipse marker aura if (!caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE_MARKER)) - caster->CastSpell(caster,SPELL_DRUID_LUNAR_ECLIPSE_MARKER,true); + caster->CastSpell(caster, SPELL_DRUID_LUNAR_ECLIPSE_MARKER, true); } // The energizing effect brought us out of the solar eclipse, remove the aura if (caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE) && caster->GetPower(POWER_ECLIPSE) <= 0) @@ -222,10 +222,10 @@ public: if ((!caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE_MARKER) && caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE_MARKER)) || caster->GetPower(POWER_ECLIPSE) == 0) { - caster->CastCustomSpell(caster,SPELL_DRUID_ECLIPSE_GENERAL_ENERGIZE,&energizeAmount,0,0,true); + caster->CastCustomSpell(caster, SPELL_DRUID_ECLIPSE_GENERAL_ENERGIZE, &energizeAmount, 0, 0, true); // If the energize was due to 0 power, cast the eclipse marker aura if (!caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE_MARKER)) - caster->CastSpell(caster,SPELL_DRUID_SOLAR_ECLIPSE_MARKER,true); + caster->CastSpell(caster, SPELL_DRUID_SOLAR_ECLIPSE_MARKER, true); } // The energizing effect brought us out of the lunar eclipse, remove the aura if (caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE) && caster->GetPower(POWER_ECLIPSE) >= 0) @@ -239,16 +239,16 @@ public: || caster->GetPower(POWER_ECLIPSE) == 0) { energizeAmount = GetSpellInfo()->Effects[effIndex].BasePoints; // 15 - caster->CastCustomSpell(caster,SPELL_DRUID_STARSURGE_ENERGIZE,&energizeAmount,0,0,true); + caster->CastCustomSpell(caster, SPELL_DRUID_STARSURGE_ENERGIZE, &energizeAmount, 0, 0, true); // If the energize was due to 0 power, cast the eclipse marker aura if (!caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE_MARKER)) - caster->CastSpell(caster,SPELL_DRUID_SOLAR_ECLIPSE_MARKER,true); + caster->CastSpell(caster, SPELL_DRUID_SOLAR_ECLIPSE_MARKER, true); } else if (!caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE_MARKER) && caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE_MARKER)) { energizeAmount = -GetSpellInfo()->Effects[effIndex].BasePoints; // -15 - caster->CastCustomSpell(caster,SPELL_DRUID_STARSURGE_ENERGIZE,&energizeAmount,0,0,true); + caster->CastCustomSpell(caster, SPELL_DRUID_STARSURGE_ENERGIZE, &energizeAmount, 0, 0, true); } // The energizing effect brought us out of the lunar eclipse, remove the aura if (caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE) && caster->GetPower(POWER_ECLIPSE) >= 0) diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index bd27151c1c4..a338f6f6336 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -465,7 +465,7 @@ class spell_mage_conjure_refreshment : public SpellScriptLoader class spell_mage_blizzard : public SpellScriptLoader { public: - spell_mage_blizzard() : SpellScriptLoader("spell_mage_blizzard") { } + spell_mage_blizzard() : SpellScriptLoader("spell_mage_blizzard") { } class spell_mage_blizzard_SpellScript : public SpellScript { @@ -498,7 +498,7 @@ class spell_mage_blizzard : public SpellScriptLoader } }; - SpellScript *GetSpellScript() const + SpellScript* GetSpellScript() const { return new spell_mage_blizzard_SpellScript(); } @@ -509,7 +509,7 @@ class spell_mage_blizzard : public SpellScriptLoader class spell_mage_frostbolt : public SpellScriptLoader { public: - spell_mage_frostbolt() : SpellScriptLoader("spell_mage_frostbolt") { } + spell_mage_frostbolt() : SpellScriptLoader("spell_mage_frostbolt") { } class spell_mage_frostbolt_SpellScript : public SpellScript { @@ -534,7 +534,7 @@ class spell_mage_frostbolt : public SpellScriptLoader } }; - SpellScript *GetSpellScript() const + SpellScript* GetSpellScript() const { return new spell_mage_frostbolt_SpellScript(); } diff --git a/src/server/shared/DataStores/DB2FileLoader.cpp b/src/server/shared/DataStores/DB2FileLoader.cpp index 14170845211..0de3b94b5d4 100644 --- a/src/server/shared/DataStores/DB2FileLoader.cpp +++ b/src/server/shared/DataStores/DB2FileLoader.cpp @@ -37,7 +37,7 @@ bool DB2FileLoader::Load(const char *filename, const char *fmt) data=NULL; } - FILE * f = fopen(filename, "rb"); + FILE* f = fopen(filename, "rb"); if (!f) return false; @@ -193,7 +193,7 @@ uint32 DB2FileLoader::GetFormatRecordSize(const char * format, int32* index_pos) int32 i = -1; for (uint32 x=0; format[x]; ++x) { - switch(format[x]) + switch (format[x]) { case FT_FLOAT: case FT_INT: @@ -279,7 +279,7 @@ char* DB2FileLoader::AutoProduceData(const char* format, uint32& records, char** for (uint32 x = 0; x < fieldCount; x++) { - switch(format[x]) + switch (format[x]) { case FT_FLOAT: *((float*)(&dataTable[offset])) = getRecord(y).getFloat(x); @@ -332,8 +332,8 @@ char* DB2FileLoader::AutoProduceStringsArrayHolders(const char* format, char* da { uint32 stringFieldNum = 0; - for(uint32 x = 0; x < fieldCount; x++) - switch(format[x]) + for (uint32 x = 0; x < fieldCount; x++) + switch (format[x]) { case FT_FLOAT: case FT_IND: @@ -378,7 +378,7 @@ char* DB2FileLoader::AutoProduceStrings(const char* format, char* dataTable) for (uint32 y =0; y < recordCount; y++) { for (uint32 x = 0; x < fieldCount; x++) - switch(format[x]) + switch (format[x]) { case FT_FLOAT: case FT_IND: diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h index 4b840e24953..68d86406faa 100644 --- a/src/server/shared/Packets/ByteBuffer.h +++ b/src/server/shared/Packets/ByteBuffer.h @@ -54,7 +54,7 @@ class ByteBufferPositionException : public ByteBufferException { ACE_Stack_Trace trace; - sLog->outError(LOG_FILTER_NETWORKIO, "Attempted to %s value with size: " SIZEFMTD " in ByteBuffer (pos: " SIZEFMTD " size: "SIZEFMTD")\n[Stack trace: %s]" , + sLog->outError(LOG_FILTER_NETWORKIO, "Attempted to %s value with size: " SIZEFMTD " in ByteBuffer (pos: " SIZEFMTD " size: "SIZEFMTD")\n[Stack trace: %s]", (_add ? "put" : "get"), ValueSize, Pos, Size, trace.c_str()); } -- cgit v1.2.3 From 9007ef905ff3f82307256f845662a6bfe61c1ebd Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 14 Jan 2013 15:05:30 +0100 Subject: Core: Fixed some compile warnings --- src/server/game/Entities/Item/Item.cpp | 57 ++++++++++------------ src/server/game/Guilds/Guild.h | 2 +- src/server/game/Handlers/BattleGroundHandler.cpp | 2 +- src/server/game/Maps/PhaseMgr.cpp | 2 +- .../Kalimdor/HallsOfOrigination/boss_anraphet.cpp | 2 +- .../HallsOfOrigination/boss_earthrager_ptah.cpp | 8 +-- .../boss_temple_guardian_anhuur.cpp | 2 +- 7 files changed, 35 insertions(+), 40 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index 93c16104c44..7da910f1841 100644 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -1327,7 +1327,7 @@ uint32 Item::GetSellPrice(ItemTemplate const* proto, bool& normalSellPrice) inventoryType = INVTYPE_CHEST; float typeFactor = 0.0f; - uint8 wepType = -1; + int8 weapType = -1; switch (inventoryType) { @@ -1349,29 +1349,19 @@ uint32 Item::GetSellPrice(ItemTemplate const* proto, bool& normalSellPrice) { case ITEM_SUBCLASS_ARMOR_MISCELLANEOUS: case ITEM_SUBCLASS_ARMOR_CLOTH: - { typeFactor = armorPrice->ClothFactor; break; - } case ITEM_SUBCLASS_ARMOR_LEATHER: - { - typeFactor = armorPrice->ClothFactor; + typeFactor = armorPrice->LeatherFactor; break; - } case ITEM_SUBCLASS_ARMOR_MAIL: - { - typeFactor = armorPrice->ClothFactor; + typeFactor = armorPrice->MailFactor; break; - } case ITEM_SUBCLASS_ARMOR_PLATE: - { - typeFactor = armorPrice->ClothFactor; + typeFactor = armorPrice->PlateFactor; break; - } default: - { return 0; - } } break; @@ -1386,32 +1376,37 @@ uint32 Item::GetSellPrice(ItemTemplate const* proto, bool& normalSellPrice) break; } case INVTYPE_WEAPONMAINHAND: - wepType = 0; // unk enum, fall back + weapType = 0; + break; case INVTYPE_WEAPONOFFHAND: - wepType = 1; // unk enum, fall back + weapType = 1; + break; case INVTYPE_WEAPON: - wepType = 2; // unk enum, fall back + weapType = 2; + break; case INVTYPE_2HWEAPON: - wepType = 3; // unk enum, fall back + weapType = 3; + break; case INVTYPE_RANGED: case INVTYPE_RANGEDRIGHT: case INVTYPE_RELIC: - { - wepType = 4; // unk enum - - ImportPriceWeaponEntry const* weaponPrice = sImportPriceWeaponStore.LookupEntry(wepType + 1); - if (!weaponPrice) - return 0; - - typeFactor = weaponPrice->Factor; + weapType = 4; break; - } default: return proto->BuyPrice; } + if (weapType != -1) + { + ImportPriceWeaponEntry const* weaponPrice = sImportPriceWeaponStore.LookupEntry(weapType + 1); + if (!weaponPrice) + return 0; + + typeFactor = weaponPrice->Factor; + } + normalSellPrice = false; - return (uint32)(qualityFactor * proto->Unk430_2 * proto->Unk430_1 * typeFactor * baseFactor); + return uint32(qualityFactor * proto->Unk430_2 * proto->Unk430_1 * typeFactor * baseFactor); } } @@ -1453,7 +1448,7 @@ int32 Item::GetReforgableStat(ItemModType statType) const { ItemTemplate const* proto = GetTemplate(); for (uint32 i = 0; i < MAX_ITEM_PROTO_STATS; ++i) - if (proto->ItemStat[i].ItemStatType == statType) + if (ItemModType(proto->ItemStat[i].ItemStatType) == statType) return proto->ItemStat[i].ItemStatValue; int32 randomPropId = GetItemRandomPropertyId(); @@ -1469,7 +1464,7 @@ int32 Item::GetReforgableStat(ItemModType statType) const for (uint32 e = PROP_ENCHANTMENT_SLOT_0; e <= PROP_ENCHANTMENT_SLOT_4; ++e) if (SpellItemEnchantmentEntry const* enchant = sSpellItemEnchantmentStore.LookupEntry(GetEnchantmentId(EnchantmentSlot(e)))) for (uint32 f = 0; f < MAX_ITEM_ENCHANTMENT_EFFECTS; ++f) - if (enchant->type[f] == ITEM_ENCHANTMENT_TYPE_STAT && enchant->spellid[f] == statType) + if (enchant->type[f] == ITEM_ENCHANTMENT_TYPE_STAT && ItemModType(enchant->spellid[f]) == statType) for (int k = 0; k < 5; ++k) if (randomSuffix->enchant_id[k] == enchant->ID) return int32((randomSuffix->prefix[k] * GetItemSuffixFactor()) / 10000); @@ -1483,7 +1478,7 @@ int32 Item::GetReforgableStat(ItemModType statType) const for (uint32 e = PROP_ENCHANTMENT_SLOT_0; e <= PROP_ENCHANTMENT_SLOT_4; ++e) if (SpellItemEnchantmentEntry const* enchant = sSpellItemEnchantmentStore.LookupEntry(GetEnchantmentId(EnchantmentSlot(e)))) for (uint32 f = 0; f < MAX_ITEM_ENCHANTMENT_EFFECTS; ++f) - if (enchant->type[f] == ITEM_ENCHANTMENT_TYPE_STAT && enchant->spellid[f] == statType) + if (enchant->type[f] == ITEM_ENCHANTMENT_TYPE_STAT && ItemModType(enchant->spellid[f]) == statType) for (int k = 0; k < MAX_ITEM_ENCHANTMENT_EFFECTS; ++k) if (randomProp->enchant_id[k] == enchant->ID) return int32(enchant->amount[k]); diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h index e89be2e8952..0c41cc68a60 100644 --- a/src/server/game/Guilds/Guild.h +++ b/src/server/game/Guilds/Guild.h @@ -548,7 +548,7 @@ private: class LogHolder { public: - LogHolder(uint32 guildId, uint32 maxRecords) : m_guildId(guildId), m_maxRecords(maxRecords), m_nextGUID(GUILD_EVENT_LOG_GUID_UNDEFINED) { } + LogHolder(uint32 guildId, uint32 maxRecords) : m_guildId(guildId), m_maxRecords(maxRecords), m_nextGUID(uint32(GUILD_EVENT_LOG_GUID_UNDEFINED)) { } ~LogHolder(); uint8 GetSize() const { return uint8(m_log.size()); } diff --git a/src/server/game/Handlers/BattleGroundHandler.cpp b/src/server/game/Handlers/BattleGroundHandler.cpp index 08635071ce9..7dfc8b94090 100644 --- a/src/server/game/Handlers/BattleGroundHandler.cpp +++ b/src/server/game/Handlers/BattleGroundHandler.cpp @@ -727,7 +727,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket& recvData) BattlegroundQueue &bgQueue = sBattlegroundMgr->GetBattlegroundQueue(bgQueueTypeId); uint32 avgTime = 0; - GroupQueueInfo* ginfo; + GroupQueueInfo* ginfo = NULL; err = grp->CanJoinBattlegroundQueue(bg, bgQueueTypeId, arenatype, arenatype, true, arenaslot); if (!err) diff --git a/src/server/game/Maps/PhaseMgr.cpp b/src/server/game/Maps/PhaseMgr.cpp index 2bb4ed0fb8c..99eee8d7c08 100644 --- a/src/server/game/Maps/PhaseMgr.cpp +++ b/src/server/game/Maps/PhaseMgr.cpp @@ -218,7 +218,7 @@ void PhaseMgr::SetCustomPhase(uint32 const phaseMask) uint32 PhaseData::GetCurrentPhasemask() const { if (player->isGameMaster()) - return PHASEMASK_ANYWHERE; + return uint32(PHASEMASK_ANYWHERE); if (_CustomPhasemask) return _CustomPhasemask; diff --git a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_anraphet.cpp b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_anraphet.cpp index 9742aea194b..be024208596 100644 --- a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_anraphet.cpp +++ b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_anraphet.cpp @@ -302,7 +302,7 @@ class npc_alpha_beam : public CreatureScript { npc_alpha_beamAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) { } - void IsSummonedBy(Unit* summoner) + void IsSummonedBy(Unit* /*summoner*/) { if (Creature* anraphet = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_ANRAPHET_GUID))) anraphet->CastSpell(me, SPELL_ALPHA_BEAMS_BACK_CAST); diff --git a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp index 47bab21e215..1ea0ee0a343 100644 --- a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp +++ b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_earthrager_ptah.cpp @@ -76,7 +76,7 @@ class SummonScarab : public BasicEvent public: SummonScarab(Unit* owner, InstanceScript* instance) : _owner(owner), _instance(instance) { } - bool Execute(uint64 execTime, uint32 /*diff*/) + bool Execute(uint64 /*execTime*/, uint32 /*diff*/) { if (!_instance || _instance->GetBossState(DATA_EARTHRAGER_PTAH) != IN_PROGRESS) return true; // delete event @@ -178,7 +178,7 @@ public: } } - void SetData(uint32 index, uint32 value) + void SetData(uint32 index, uint32 /*value*/) { if (index == DATA_SUMMON_DEATHS) { @@ -311,7 +311,7 @@ public: { if (Unit* ptah = GetCaster()) { - ptah->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_UNK_29 | UNIT_FLAG_UNK_31); + ptah->SetFlag(UNIT_FIELD_FLAGS, uint32(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_UNK_29 | UNIT_FLAG_UNK_31)); ptah->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH); } } @@ -320,7 +320,7 @@ public: { if (Unit* ptah = GetCaster()) { - ptah->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_UNK_29 | UNIT_FLAG_UNK_31); + ptah->RemoveFlag(UNIT_FIELD_FLAGS, uint32(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_UNK_29 | UNIT_FLAG_UNK_31)); ptah->RemoveFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH); } } diff --git a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_temple_guardian_anhuur.cpp b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_temple_guardian_anhuur.cpp index 9261575bc82..9a66caf510c 100644 --- a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_temple_guardian_anhuur.cpp +++ b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_temple_guardian_anhuur.cpp @@ -121,7 +121,7 @@ public: DoCast(me, SPELL_TELEPORT); DoCast(me, SPELL_SHIELD_OF_LIGHT); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_31); + me->SetFlag(UNIT_FIELD_FLAGS, uint32(UNIT_FLAG_UNK_31)); DoCastAOE(SPELL_ACTIVATE_BEACONS); -- cgit v1.2.3 From 6f8aa6a78257e7a288c5731944798cc0f2f4e654 Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Mon, 14 Jan 2013 20:28:32 +0100 Subject: Core/Spells: Reorder more scripts in some script files and some cosmetic stuff --- src/server/scripts/Spells/spell_dk.cpp | 4 +- src/server/scripts/Spells/spell_druid.cpp | 249 ++++++------- src/server/scripts/Spells/spell_mage.cpp | 559 ++++++++++++++-------------- src/server/scripts/Spells/spell_paladin.cpp | 3 +- src/server/scripts/Spells/spell_rogue.cpp | 30 -- src/server/scripts/Spells/spell_shaman.cpp | 15 +- src/server/scripts/Spells/spell_warlock.cpp | 37 +- src/server/scripts/Spells/spell_warrior.cpp | 4 +- 8 files changed, 442 insertions(+), 459 deletions(-) (limited to 'src') diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 060db02d53c..5b43a46cb1f 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -46,12 +46,12 @@ enum DeathKnightSpells SPELL_DK_UNHOLY_PRESENCE = 48265, SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED = 63622, SPELL_DK_ITEM_SIGIL_VENGEFUL_HEART = 64962, - SPELL_DK_ITEM_T8_MELEE_4P_BONUS = 64736, + SPELL_DK_ITEM_T8_MELEE_4P_BONUS = 64736 }; enum DeathKnightSpellIcons { - DK_ICON_ID_IMPROVED_DEATH_STRIKE = 2751, + DK_ICON_ID_IMPROVED_DEATH_STRIKE = 2751 }; // 50462 - Anti-Magic Shell (on raid member) diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index 37278b2e59d..b5b4937a14c 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -29,6 +29,15 @@ enum DruidSpells { + SPELL_DRUID_WRATH = 5176, + SPELL_DRUID_STARFIRE = 2912, + SPELL_DRUID_STARSURGE = 78674, + SPELL_DRUID_ECLIPSE_GENERAL_ENERGIZE = 89265, + SPELL_DRUID_STARSURGE_ENERGIZE = 86605, + SPELL_DRUID_LUNAR_ECLIPSE_MARKER = 67484, // Will make the yellow arrow on eclipse bar point to the blue side (lunar) + SPELL_DRUID_SOLAR_ECLIPSE_MARKER = 67483, // Will make the yellow arrow on eclipse bar point to the yellow side (solar) + SPELL_DRUID_SOLAR_ECLIPSE = 48517, + SPELL_DRUID_LUNAR_ECLIPSE = 48518, SPELL_DRUID_ENRAGE_MOD_DAMAGE = 51185, SPELL_DRUID_INCREASED_MOONFIRE_DURATION = 38414, SPELL_DRUID_KING_OF_THE_JUNGLE = 48492, @@ -38,7 +47,117 @@ enum DruidSpells SPELL_DRUID_SURVIVAL_INSTINCTS = 50322, SPELL_DRUID_SAVAGE_ROAR = 62071, SPELL_DRUID_TIGER_S_FURY_ENERGIZE = 51178, - SPELL_DRUID_ITEM_T8_BALANCE_RELIC = 64950, + SPELL_DRUID_ITEM_T8_BALANCE_RELIC = 64950 +}; + +// 2912, 5176, 78674 - Starfire, Wrath, and Starsurge +class spell_dru_eclipse_energize : public SpellScriptLoader +{ + public: + spell_dru_eclipse_energize() : SpellScriptLoader("spell_dru_eclipse_energize") { } + + class spell_dru_eclipse_energize_SpellScript : public SpellScript + { + PrepareSpellScript(spell_dru_eclipse_energize_SpellScript); + + int32 energizeAmount; + + bool Load() + { + if (GetCaster()->GetTypeId() != TYPEID_PLAYER) + return false; + + if (GetCaster()->ToPlayer()->getClass() != CLASS_DRUID) + return false; + + energizeAmount = 0; + + return true; + } + + void HandleEnergize(SpellEffIndex effIndex) + { + Player* caster = GetCaster()->ToPlayer(); + + // No boomy, no deal. + if (caster->GetPrimaryTalentTree(caster->GetActiveSpec()) != TALENT_TREE_DRUID_BALANCE) + return; + + switch (GetSpellInfo()->Id) + { + case SPELL_DRUID_WRATH: + { + energizeAmount = -GetSpellInfo()->Effects[effIndex].BasePoints; // -13 + // If we are set to fill the lunar side or we've just logged in with 0 power.. + if ((!caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE_MARKER) && caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE_MARKER)) + || caster->GetPower(POWER_ECLIPSE) == 0) + { + caster->CastCustomSpell(caster, SPELL_DRUID_ECLIPSE_GENERAL_ENERGIZE, &energizeAmount, 0, 0, true); + // If the energize was due to 0 power, cast the eclipse marker aura + if (!caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE_MARKER)) + caster->CastSpell(caster, SPELL_DRUID_LUNAR_ECLIPSE_MARKER, true); + } + // The energizing effect brought us out of the solar eclipse, remove the aura + if (caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE) && caster->GetPower(POWER_ECLIPSE) <= 0) + caster->RemoveAurasDueToSpell(SPELL_DRUID_SOLAR_ECLIPSE); + break; + } + case SPELL_DRUID_STARFIRE: + { + energizeAmount = GetSpellInfo()->Effects[effIndex].BasePoints; // 20 + // If we are set to fill the solar side or we've just logged in with 0 power.. + if ((!caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE_MARKER) && caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE_MARKER)) + || caster->GetPower(POWER_ECLIPSE) == 0) + { + caster->CastCustomSpell(caster, SPELL_DRUID_ECLIPSE_GENERAL_ENERGIZE, &energizeAmount, 0, 0, true); + // If the energize was due to 0 power, cast the eclipse marker aura + if (!caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE_MARKER)) + caster->CastSpell(caster, SPELL_DRUID_SOLAR_ECLIPSE_MARKER, true); + } + // The energizing effect brought us out of the lunar eclipse, remove the aura + if (caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE) && caster->GetPower(POWER_ECLIPSE) >= 0) + caster->RemoveAura(SPELL_DRUID_LUNAR_ECLIPSE); + break; + } + case SPELL_DRUID_STARSURGE: + { + // If we are set to fill the solar side or we've just logged in with 0 power (confirmed with sniffs) + if ((!caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE_MARKER) && caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE_MARKER)) + || caster->GetPower(POWER_ECLIPSE) == 0) + { + energizeAmount = GetSpellInfo()->Effects[effIndex].BasePoints; // 15 + caster->CastCustomSpell(caster, SPELL_DRUID_STARSURGE_ENERGIZE, &energizeAmount, 0, 0, true); + + // If the energize was due to 0 power, cast the eclipse marker aura + if (!caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE_MARKER)) + caster->CastSpell(caster, SPELL_DRUID_SOLAR_ECLIPSE_MARKER, true); + } + else if (!caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE_MARKER) && caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE_MARKER)) + { + energizeAmount = -GetSpellInfo()->Effects[effIndex].BasePoints; // -15 + caster->CastCustomSpell(caster, SPELL_DRUID_STARSURGE_ENERGIZE, &energizeAmount, 0, 0, true); + } + // The energizing effect brought us out of the lunar eclipse, remove the aura + if (caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE) && caster->GetPower(POWER_ECLIPSE) >= 0) + caster->RemoveAura(SPELL_DRUID_LUNAR_ECLIPSE); + // The energizing effect brought us out of the solar eclipse, remove the aura + else if (caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE) && caster->GetPower(POWER_ECLIPSE) <= 0) + caster->RemoveAura(SPELL_DRUID_SOLAR_ECLIPSE); + break; + } + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_dru_eclipse_energize_SpellScript::HandleEnergize, EFFECT_1, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_dru_eclipse_energize_SpellScript; + } }; // -5229 - Enrage @@ -150,129 +269,7 @@ class spell_dru_insect_swarm : public SpellScriptLoader } }; -enum EclipseSpells -{ - SPELL_DRUID_WRATH = 5176, - SPELL_DRUID_STARFIRE = 2912, - SPELL_DRUID_STARSURGE = 78674, - SPELL_DRUID_ECLIPSE_GENERAL_ENERGIZE = 89265, - SPELL_DRUID_STARSURGE_ENERGIZE = 86605, - SPELL_DRUID_LUNAR_ECLIPSE_MARKER = 67484, // Will make the yellow arrow on eclipse bar point to the blue side (lunar) - SPELL_DRUID_SOLAR_ECLIPSE_MARKER = 67483, // Will make the yellow arrow on eclipse bar point to the yellow side (solar) - SPELL_DRUID_SOLAR_ECLIPSE = 48517, - SPELL_DRUID_LUNAR_ECLIPSE = 48518, -}; - -// Wrath, Starfire, and Starsurge -class spell_dru_eclipse_energize : public SpellScriptLoader -{ -public: - spell_dru_eclipse_energize() : SpellScriptLoader("spell_dru_eclipse_energize") { } - - class spell_dru_eclipse_energize_SpellScript : public SpellScript - { - PrepareSpellScript(spell_dru_eclipse_energize_SpellScript); - - int32 energizeAmount; - - bool Load() - { - if (GetCaster()->GetTypeId() != TYPEID_PLAYER) - return false; - - if (GetCaster()->ToPlayer()->getClass() != CLASS_DRUID) - return false; - - energizeAmount = 0; - - return true; - } - - void HandleEnergize(SpellEffIndex effIndex) - { - Player* caster = GetCaster()->ToPlayer(); - - // No boomy, no deal. - if (caster->GetPrimaryTalentTree(caster->GetActiveSpec()) != TALENT_TREE_DRUID_BALANCE) - return; - - switch (GetSpellInfo()->Id) - { - case SPELL_DRUID_WRATH: - { - energizeAmount = -GetSpellInfo()->Effects[effIndex].BasePoints; // -13 - // If we are set to fill the lunar side or we've just logged in with 0 power.. - if ((!caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE_MARKER) && caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE_MARKER)) - || caster->GetPower(POWER_ECLIPSE) == 0) - { - caster->CastCustomSpell(caster, SPELL_DRUID_ECLIPSE_GENERAL_ENERGIZE, &energizeAmount, 0, 0, true); - // If the energize was due to 0 power, cast the eclipse marker aura - if (!caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE_MARKER)) - caster->CastSpell(caster, SPELL_DRUID_LUNAR_ECLIPSE_MARKER, true); - } - // The energizing effect brought us out of the solar eclipse, remove the aura - if (caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE) && caster->GetPower(POWER_ECLIPSE) <= 0) - caster->RemoveAurasDueToSpell(SPELL_DRUID_SOLAR_ECLIPSE); - break; - } - case SPELL_DRUID_STARFIRE: - { - energizeAmount = GetSpellInfo()->Effects[effIndex].BasePoints; // 20 - // If we are set to fill the solar side or we've just logged in with 0 power.. - if ((!caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE_MARKER) && caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE_MARKER)) - || caster->GetPower(POWER_ECLIPSE) == 0) - { - caster->CastCustomSpell(caster, SPELL_DRUID_ECLIPSE_GENERAL_ENERGIZE, &energizeAmount, 0, 0, true); - // If the energize was due to 0 power, cast the eclipse marker aura - if (!caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE_MARKER)) - caster->CastSpell(caster, SPELL_DRUID_SOLAR_ECLIPSE_MARKER, true); - } - // The energizing effect brought us out of the lunar eclipse, remove the aura - if (caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE) && caster->GetPower(POWER_ECLIPSE) >= 0) - caster->RemoveAura(SPELL_DRUID_LUNAR_ECLIPSE); - break; - } - case SPELL_DRUID_STARSURGE: - { - // If we are set to fill the solar side or we've just logged in with 0 power (confirmed with sniffs) - if ((!caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE_MARKER) && caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE_MARKER)) - || caster->GetPower(POWER_ECLIPSE) == 0) - { - energizeAmount = GetSpellInfo()->Effects[effIndex].BasePoints; // 15 - caster->CastCustomSpell(caster, SPELL_DRUID_STARSURGE_ENERGIZE, &energizeAmount, 0, 0, true); - - // If the energize was due to 0 power, cast the eclipse marker aura - if (!caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE_MARKER)) - caster->CastSpell(caster, SPELL_DRUID_SOLAR_ECLIPSE_MARKER, true); - } - else if (!caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE_MARKER) && caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE_MARKER)) - { - energizeAmount = -GetSpellInfo()->Effects[effIndex].BasePoints; // -15 - caster->CastCustomSpell(caster, SPELL_DRUID_STARSURGE_ENERGIZE, &energizeAmount, 0, 0, true); - } - // The energizing effect brought us out of the lunar eclipse, remove the aura - if (caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE) && caster->GetPower(POWER_ECLIPSE) >= 0) - caster->RemoveAura(SPELL_DRUID_LUNAR_ECLIPSE); - // The energizing effect brought us out of the solar eclipse, remove the aura - else if (caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE) && caster->GetPower(POWER_ECLIPSE) <= 0) - caster->RemoveAura(SPELL_DRUID_SOLAR_ECLIPSE); - break; - } - } - } - - void Register() - { - OnEffectHitTarget += SpellEffectFn(spell_dru_eclipse_energize_SpellScript::HandleEnergize, EFFECT_1, SPELL_EFFECT_DUMMY); - } - }; - - SpellScript* GetSpellScript() const - { - return new spell_dru_eclipse_energize_SpellScript; - } -}; - +// -33763 - Lifebloom class spell_dru_lifebloom : public SpellScriptLoader { public: @@ -543,7 +540,7 @@ class spell_dru_savage_roar : public SpellScriptLoader { PrepareAuraScript(spell_dru_savage_roar_AuraScript); - bool Validate(SpellInfo const* /*spell*/) + bool Validate(SpellInfo const* /*spellInfo*/) { if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_SAVAGE_ROAR)) return false; @@ -837,6 +834,7 @@ class spell_dru_t10_restoration_4p_bonus : public SpellScriptLoader void AddSC_druid_spell_scripts() { + new spell_dru_eclipse_energize(); new spell_dru_enrage(); new spell_dru_glyph_of_starfire(); new spell_dru_insect_swarm(); @@ -852,5 +850,4 @@ void AddSC_druid_spell_scripts() new spell_dru_swift_flight_passive(); new spell_dru_tiger_s_fury(); new spell_dru_t10_restoration_4p_bonus(); - new spell_dru_eclipse_energize(); } diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index a338f6f6336..8c33117bb96 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -28,40 +28,55 @@ enum MageSpells { + SPELL_MAGE_FLAMESTRIKE = 2120, + + SPELL_MAGE_CHILLED_R1 = 12484, + SPELL_MAGE_CHILLED_R2 = 12485, + SPELL_MAGE_COLD_SNAP = 11958, + + SPELL_MAGE_CONE_OF_COLD_AURA_R1 = 11190, + SPELL_MAGE_CONE_OF_COLD_AURA_R2 = 12489, + SPELL_MAGE_CONE_OF_COLD_TRIGGER_R1 = 83301, + SPELL_MAGE_CONE_OF_COLD_TRIGGER_R2 = 83302, + + SPELL_MAGE_FROST_WARDING_R1 = 28332, + SPELL_MAGE_FROST_WARDING_TRIGGERED = 57776, + + SPELL_MAGE_SHATTERED_BARRIER_R1 = 44745, + SPELL_MAGE_SHATTERED_BARRIER_R2 = 54787, + SPELL_MAGE_SHATTERED_BARRIER_FREEZE_R1 = 55080, + SPELL_MAGE_SHATTERED_BARRIER_FREEZE_R2 = 83073, + + SPELL_MAGE_INCANTER_S_ABSORPTION_TRIGGERED = 44413, + SPELL_MAGE_INCANTER_S_ABSORPTION_KNOCKBACK = 86261, + SPELL_MAGE_SQUIRREL_FORM = 32813, SPELL_MAGE_GIRAFFE_FORM = 32816, SPELL_MAGE_SERPENT_FORM = 32817, SPELL_MAGE_DRAGONHAWK_FORM = 32818, SPELL_MAGE_WORGEN_FORM = 32819, SPELL_MAGE_SHEEP_FORM = 32820, + + SPELL_MAGE_IMPROVED_MANA_GEM_TRIGGERED = 83098, + SPELL_MAGE_GLYPH_OF_ETERNAL_WATER = 70937, SPELL_MAGE_SUMMON_WATER_ELEMENTAL_PERMANENT = 70908, SPELL_MAGE_SUMMON_WATER_ELEMENTAL_TEMPORARY = 70907, - SPELL_MAGE_GLYPH_OF_BLAST_WAVE = 62126, - SPELL_MAGE_CONJURE_REFRESHMENT = 42955, - SPELL_MAGE_FLAMESTRIKE = 2120, - SPELL_MAGE_CHILLED_R1 = 12484, - SPELL_MAGE_CHILLED_R2 = 12485, - SPELL_MAGE_INCANTER_S_ABSORPTION_TRIGGERED = 44413, - SPELL_MAGE_INCANTER_S_ABSORPTION_KNOCKBACK = 86261, - SPELL_MAGE_IMPROVED_MANA_GEM_TRIGGERED = 83098, - SPELL_MAGE_SHATTERED_BARRIER_R1 = 44745, - SPELL_MAGE_SHATTERED_BARRIER_R2 = 54787, - SPELL_MAGE_SHATTERED_BARRIER_FREEZE_R1 = 55080, - SPELL_MAGE_SHATTERED_BARRIER_FREEZE_R2 = 83073, - SPELL_MAGE_FINGERS_OF_FROST = 44544, + + SPELL_MAGE_FINGERS_OF_FROST = 44544 }; enum MageIcons { - ICON_MAGE_SHATTER = 976, - ICON_MAGE_IMPROVED_FLAMESTRIKE = 37, - ICON_MAGE_IMPROVED_FREEZE = 94, - ICON_MAGE_INCANTER_S_ABSORPTION = 2941, - ICON_MAGE_IMPROVED_MANA_GEM = 1036, + ICON_MAGE_SHATTER = 976, + ICON_MAGE_IMPROVED_FLAMESTRIKE = 37, + ICON_MAGE_IMPROVED_FREEZE = 94, + ICON_MAGE_INCANTER_S_ABSORPTION = 2941, + ICON_MAGE_IMPROVED_MANA_GEM = 1036 }; +// 11113 - Blast Wave class spell_mage_blast_wave : public SpellScriptLoader { public: @@ -115,6 +130,51 @@ class spell_mage_blast_wave : public SpellScriptLoader } }; +// 42208 - Blizzard +/// Updated 4.3.4 +class spell_mage_blizzard : public SpellScriptLoader +{ + public: + spell_mage_blizzard() : SpellScriptLoader("spell_mage_blizzard") { } + + class spell_mage_blizzard_SpellScript : public SpellScript + { + PrepareSpellScript(spell_mage_blizzard_SpellScript); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_CHILLED_R1)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_CHILLED_R2)) + return false; + return true; + } + + void AddChillEffect(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + if (Unit* unitTarget = GetHitUnit()) + { + if (caster->IsScriptOverriden(GetSpellInfo(), 836)) + caster->CastSpell(unitTarget, SPELL_MAGE_CHILLED_R1, true); + else if (caster->IsScriptOverriden(GetSpellInfo(), 988)) + caster->CastSpell(unitTarget, SPELL_MAGE_CHILLED_R2, true); + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_mage_blizzard_SpellScript::AddChillEffect, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_mage_blizzard_SpellScript(); + } +}; + +// 11958 - Cold Snap class spell_mage_cold_snap : public SpellScriptLoader { public: @@ -161,233 +221,39 @@ class spell_mage_cold_snap : public SpellScriptLoader } }; -enum SilvermoonPolymorph -{ - NPC_AUROSALIA = 18744, -}; - -// TODO: move out of here and rename - not a mage spell -class spell_mage_polymorph_cast_visual : public SpellScriptLoader -{ - public: - spell_mage_polymorph_cast_visual() : SpellScriptLoader("spell_mage_polymorph_visual") { } - - class spell_mage_polymorph_cast_visual_SpellScript : public SpellScript - { - PrepareSpellScript(spell_mage_polymorph_cast_visual_SpellScript); - - static const uint32 PolymorhForms[6]; - - bool Validate(SpellInfo const* /*spellEntry*/) - { - // check if spell ids exist in dbc - for (uint32 i = 0; i < 6; i++) - if (!sSpellMgr->GetSpellInfo(PolymorhForms[i])) - return false; - return true; - } - - void HandleDummy(SpellEffIndex /*effIndex*/) - { - if (Unit* target = GetCaster()->FindNearestCreature(NPC_AUROSALIA, 30.0f)) - if (target->GetTypeId() == TYPEID_UNIT) - target->CastSpell(target, PolymorhForms[urand(0, 5)], true); - } - - void Register() - { - // add dummy effect spell handler to Polymorph visual - OnEffectHitTarget += SpellEffectFn(spell_mage_polymorph_cast_visual_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; - - SpellScript* GetSpellScript() const - { - return new spell_mage_polymorph_cast_visual_SpellScript(); - } -}; - -const uint32 spell_mage_polymorph_cast_visual::spell_mage_polymorph_cast_visual_SpellScript::PolymorhForms[6] = -{ - SPELL_MAGE_SQUIRREL_FORM, - SPELL_MAGE_GIRAFFE_FORM, - SPELL_MAGE_SERPENT_FORM, - SPELL_MAGE_DRAGONHAWK_FORM, - SPELL_MAGE_WORGEN_FORM, - SPELL_MAGE_SHEEP_FORM -}; - -class spell_mage_summon_water_elemental : public SpellScriptLoader +// 120 - Cone of Cold +/// Updated 4.3.4 +class spell_mage_cone_of_cold : public SpellScriptLoader { public: - spell_mage_summon_water_elemental() : SpellScriptLoader("spell_mage_summon_water_elemental") { } + spell_mage_cone_of_cold() : SpellScriptLoader("spell_mage_cone_of_cold") { } - class spell_mage_summon_water_elemental_SpellScript : public SpellScript + class spell_mage_cone_of_cold_SpellScript : public SpellScript { - PrepareSpellScript(spell_mage_summon_water_elemental_SpellScript); - - bool Validate(SpellInfo const* /*spellEntry*/) - { - if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_GLYPH_OF_ETERNAL_WATER) || !sSpellMgr->GetSpellInfo(SPELL_MAGE_SUMMON_WATER_ELEMENTAL_TEMPORARY) || !sSpellMgr->GetSpellInfo(SPELL_MAGE_SUMMON_WATER_ELEMENTAL_PERMANENT)) - return false; - return true; - } + PrepareSpellScript(spell_mage_cone_of_cold_SpellScript); - void HandleDummy(SpellEffIndex /*effIndex*/) + void HandleConeOfColdScript(SpellEffIndex /*effIndex*/) { Unit* caster = GetCaster(); - // Glyph of Eternal Water - if (caster->HasAura(SPELL_MAGE_GLYPH_OF_ETERNAL_WATER)) - caster->CastSpell(caster, SPELL_MAGE_SUMMON_WATER_ELEMENTAL_PERMANENT, true); - else - caster->CastSpell(caster, SPELL_MAGE_SUMMON_WATER_ELEMENTAL_TEMPORARY, true); - } - - void Register() - { - // add dummy effect spell handler to Summon Water Elemental - OnEffectHit += SpellEffectFn(spell_mage_summon_water_elemental_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; - - SpellScript* GetSpellScript() const - { - return new spell_mage_summon_water_elemental_SpellScript(); - } -}; - -// Frost Warding -class spell_mage_frost_warding_trigger : public SpellScriptLoader -{ - public: - spell_mage_frost_warding_trigger() : SpellScriptLoader("spell_mage_frost_warding_trigger") { } - - class spell_mage_frost_warding_trigger_AuraScript : public AuraScript - { - PrepareAuraScript(spell_mage_frost_warding_trigger_AuraScript); - - enum Spells - { - SPELL_MAGE_FROST_WARDING_TRIGGERED = 57776, - SPELL_MAGE_FROST_WARDING_R1 = 28332, - }; - - bool Validate(SpellInfo const* /*spellEntry*/) - { - if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_FROST_WARDING_TRIGGERED) || !sSpellMgr->GetSpellInfo(SPELL_MAGE_FROST_WARDING_R1)) - return false; - return true; - } - - void Absorb(AuraEffect* aurEff, DamageInfo & dmgInfo, uint32 & absorbAmount) - { - Unit* target = GetTarget(); - if (AuraEffect* talentAurEff = target->GetAuraEffectOfRankedSpell(SPELL_MAGE_FROST_WARDING_R1, EFFECT_0)) + if (Unit* unitTarget = GetHitUnit()) { - int32 chance = talentAurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue(); - - if (roll_chance_i(chance)) - { - int32 bp = dmgInfo.GetDamage(); - dmgInfo.AbsorbDamage(bp); - target->CastCustomSpell(target, SPELL_MAGE_FROST_WARDING_TRIGGERED, &bp, NULL, NULL, true, NULL, aurEff); - absorbAmount = 0; - PreventDefaultAction(); - } + if (caster->HasAura(SPELL_MAGE_CONE_OF_COLD_AURA_R1)) // Improved Cone of Cold Rank 1 + unitTarget->CastSpell(unitTarget, SPELL_MAGE_CONE_OF_COLD_TRIGGER_R1, true); + else if (caster->HasAura(SPELL_MAGE_CONE_OF_COLD_AURA_R2)) // Improved Cone of Cold Rank 2 + unitTarget->CastSpell(unitTarget, SPELL_MAGE_CONE_OF_COLD_TRIGGER_R2, true); } } void Register() { - OnEffectAbsorb += AuraEffectAbsorbFn(spell_mage_frost_warding_trigger_AuraScript::Absorb, EFFECT_0); + OnEffectHitTarget += SpellEffectFn(spell_mage_cone_of_cold_SpellScript::HandleConeOfColdScript, EFFECT_0, SPELL_EFFECT_APPLY_AURA); } }; - AuraScript* GetAuraScript() const - { - return new spell_mage_frost_warding_trigger_AuraScript(); - } -}; - -class spell_mage_living_bomb : public SpellScriptLoader -{ - public: - spell_mage_living_bomb() : SpellScriptLoader("spell_mage_living_bomb") { } - - class spell_mage_living_bomb_AuraScript : public AuraScript - { - PrepareAuraScript(spell_mage_living_bomb_AuraScript); - - bool Validate(SpellInfo const* spell) - { - if (!sSpellMgr->GetSpellInfo(uint32(spell->Effects[EFFECT_1].CalcValue()))) - return false; - return true; - } - - void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) - { - AuraRemoveMode removeMode = GetTargetApplication()->GetRemoveMode(); - if (removeMode != AURA_REMOVE_BY_ENEMY_SPELL && removeMode != AURA_REMOVE_BY_EXPIRE) - return; - - if (Unit* caster = GetCaster()) - caster->CastSpell(GetTarget(), uint32(aurEff->GetAmount()), true, NULL, aurEff); - } - - void Register() - { - AfterEffectRemove += AuraEffectRemoveFn(spell_mage_living_bomb_AuraScript::AfterRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); - } - }; - - AuraScript* GetAuraScript() const - { - return new spell_mage_living_bomb_AuraScript(); - } -}; - -enum ConeOfColdSpells -{ - SPELL_CONE_OF_COLD_AURA_R1 = 11190, // Improved Cone of Cold Rank 1 aura - SPELL_CONE_OF_COLD_AURA_R2 = 12489, // Improved Cone of Cold Rank 2 aura - SPELL_CONE_OF_COLD_TRIGGER_R1 = 83301, // Improved Cone of Cold Rank 1 Trigger - SPELL_CONE_OF_COLD_TRIGGER_R2 = 83302, // Improved Cone of Cold Rank 2 Trigger -}; - -// 120 Cone of Cold -/// Updated 4.3.4 -class spell_mage_cone_of_cold : public SpellScriptLoader -{ -public: - spell_mage_cone_of_cold() : SpellScriptLoader("spell_mage_cone_of_cold") { } - - class spell_mage_cone_of_cold_SpellScript : public SpellScript - { - PrepareSpellScript(spell_mage_cone_of_cold_SpellScript); - - void HandleConeOfColdScript(SpellEffIndex /*effIndex*/) - { - Unit* caster = GetCaster(); - if (Unit* unitTarget = GetHitUnit()) - { - if (caster->HasAura(SPELL_CONE_OF_COLD_AURA_R1)) // Improved Cone of Cold Rank 1 - unitTarget->CastSpell(unitTarget, SPELL_CONE_OF_COLD_TRIGGER_R1, true); - else if (caster->HasAura(SPELL_CONE_OF_COLD_AURA_R2)) // Improved Cone of Cold Rank 2 - unitTarget->CastSpell(unitTarget, SPELL_CONE_OF_COLD_TRIGGER_R2, true); - } - } - - void Register() + SpellScript* GetSpellScript() const { - OnEffectHitTarget += SpellEffectFn(spell_mage_cone_of_cold_SpellScript::HandleConeOfColdScript, EFFECT_0, SPELL_EFFECT_APPLY_AURA); + return new spell_mage_cone_of_cold_SpellScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_mage_cone_of_cold_SpellScript(); - } }; // 42955 Conjure Refreshment @@ -400,7 +266,7 @@ struct ConjureRefreshmentData }; uint8 const MAX_CONJURE_REFRESHMENT_SPELLS = 7; -const ConjureRefreshmentData _conjureData[MAX_CONJURE_REFRESHMENT_SPELLS] = +ConjureRefreshmentData const _conjureData[MAX_CONJURE_REFRESHMENT_SPELLS] = { { 33, 43, 92739 }, { 44, 53, 92799 }, @@ -411,6 +277,7 @@ const ConjureRefreshmentData _conjureData[MAX_CONJURE_REFRESHMENT_SPELLS] = { 85, 85, 92727 } }; +// 42955 - Conjure Refreshment class spell_mage_conjure_refreshment : public SpellScriptLoader { public: @@ -420,7 +287,7 @@ class spell_mage_conjure_refreshment : public SpellScriptLoader { PrepareSpellScript(spell_mage_conjure_refreshment_SpellScript); - bool Validate(SpellInfo const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellInfo*/) { for (uint8 i = 0; i < MAX_CONJURE_REFRESHMENT_SPELLS; ++i) if (!sSpellMgr->GetSpellInfo(_conjureData[i].spellId)) @@ -460,51 +327,54 @@ class spell_mage_conjure_refreshment : public SpellScriptLoader } }; -// 42208 Blizzard -/// Updated 4.3.4 -class spell_mage_blizzard : public SpellScriptLoader +// -6143, -543 - Frost Warding +class spell_mage_frost_warding_trigger : public SpellScriptLoader { - public: - spell_mage_blizzard() : SpellScriptLoader("spell_mage_blizzard") { } + public: + spell_mage_frost_warding_trigger() : SpellScriptLoader("spell_mage_frost_warding_trigger") { } - class spell_mage_blizzard_SpellScript : public SpellScript - { - PrepareSpellScript(spell_mage_blizzard_SpellScript); + class spell_mage_frost_warding_trigger_AuraScript : public AuraScript + { + PrepareAuraScript(spell_mage_frost_warding_trigger_AuraScript); - bool Validate(SpellInfo const* /*spellEntry*/) - { - if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_CHILLED_R1)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_CHILLED_R2)) - return false; - return true; - } + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_FROST_WARDING_TRIGGERED) || !sSpellMgr->GetSpellInfo(SPELL_MAGE_FROST_WARDING_R1)) + return false; + return true; + } - void AddChillEffect(SpellEffIndex /*effIndex*/) - { - Unit* caster = GetCaster(); - if (Unit* unitTarget = GetHitUnit()) - { - if (caster->IsScriptOverriden(GetSpellInfo(), 836)) - caster->CastSpell(unitTarget, SPELL_MAGE_CHILLED_R1, true); - else if (caster->IsScriptOverriden(GetSpellInfo(), 988)) - caster->CastSpell(unitTarget, SPELL_MAGE_CHILLED_R2, true); - } - } + void Absorb(AuraEffect* aurEff, DamageInfo & dmgInfo, uint32 & absorbAmount) + { + Unit* target = GetTarget(); + if (AuraEffect* talentAurEff = target->GetAuraEffectOfRankedSpell(SPELL_MAGE_FROST_WARDING_R1, EFFECT_0)) + { + int32 chance = talentAurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue(); - void Register() - { - OnEffectHitTarget += SpellEffectFn(spell_mage_blizzard_SpellScript::AddChillEffect, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); - } - }; + if (roll_chance_i(chance)) + { + int32 bp = dmgInfo.GetDamage(); + dmgInfo.AbsorbDamage(bp); + target->CastCustomSpell(target, SPELL_MAGE_FROST_WARDING_TRIGGERED, &bp, NULL, NULL, true, NULL, aurEff); + absorbAmount = 0; + PreventDefaultAction(); + } + } + } - SpellScript* GetSpellScript() const - { - return new spell_mage_blizzard_SpellScript(); - } + void Register() + { + OnEffectAbsorb += AuraEffectAbsorbFn(spell_mage_frost_warding_trigger_AuraScript::Absorb, EFFECT_0); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_mage_frost_warding_trigger_AuraScript(); + } }; -// 116 Frostbolt +// 116 - Frostbolt /// Updated 4.3.4 class spell_mage_frostbolt : public SpellScriptLoader { @@ -540,7 +410,46 @@ class spell_mage_frostbolt : public SpellScriptLoader } }; -// 11426 Ice Barrier +// -44457 - Living Bomb +class spell_mage_living_bomb : public SpellScriptLoader +{ + public: + spell_mage_living_bomb() : SpellScriptLoader("spell_mage_living_bomb") { } + + class spell_mage_living_bomb_AuraScript : public AuraScript + { + PrepareAuraScript(spell_mage_living_bomb_AuraScript); + + bool Validate(SpellInfo const* spellInfo) + { + if (!sSpellMgr->GetSpellInfo(uint32(spellInfo->Effects[EFFECT_1].CalcValue()))) + return false; + return true; + } + + void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + { + AuraRemoveMode removeMode = GetTargetApplication()->GetRemoveMode(); + if (removeMode != AURA_REMOVE_BY_ENEMY_SPELL && removeMode != AURA_REMOVE_BY_EXPIRE) + return; + + if (Unit* caster = GetCaster()) + caster->CastSpell(GetTarget(), uint32(aurEff->GetAmount()), true, NULL, aurEff); + } + + void Register() + { + AfterEffectRemove += AuraEffectRemoveFn(spell_mage_living_bomb_AuraScript::AfterRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_mage_living_bomb_AuraScript(); + } +}; + +// 11426 - Ice Barrier /// Updated 4.3.4 class spell_mage_ice_barrier : public SpellScriptLoader { @@ -574,11 +483,11 @@ class spell_mage_ice_barrier : public SpellScriptLoader } }; -// 1463 Mana Shield +// 1463 - Mana Shield /// Updated 4.3.4 class spell_mage_mana_shield : public SpellScriptLoader { - public: + public: spell_mage_mana_shield() : SpellScriptLoader("spell_mage_mana_shield") { } class spell_mage_mana_shield_AuraScript : public AuraScript @@ -613,7 +522,7 @@ class spell_mage_mana_shield : public SpellScriptLoader } }; -// 543 Mage Ward +// 543 - Mage Ward /// Updated 4.3.4 class spell_mage_mage_ward : public SpellScriptLoader { @@ -645,7 +554,63 @@ class spell_mage_mage_ward : public SpellScriptLoader } }; -// 5405 Replenish Mana (Mana Gem) +enum SilvermoonPolymorph +{ + NPC_AUROSALIA = 18744 +}; + +// TODO: move out of here and rename - not a mage spell +class spell_mage_polymorph_cast_visual : public SpellScriptLoader +{ + public: + spell_mage_polymorph_cast_visual() : SpellScriptLoader("spell_mage_polymorph_visual") { } + + class spell_mage_polymorph_cast_visual_SpellScript : public SpellScript + { + PrepareSpellScript(spell_mage_polymorph_cast_visual_SpellScript); + + static const uint32 PolymorhForms[6]; + + bool Validate(SpellInfo const* /*spellInfo*/) + { + // check if spell ids exist in dbc + for (uint32 i = 0; i < 6; i++) + if (!sSpellMgr->GetSpellInfo(PolymorhForms[i])) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + if (Unit* target = GetCaster()->FindNearestCreature(NPC_AUROSALIA, 30.0f)) + if (target->GetTypeId() == TYPEID_UNIT) + target->CastSpell(target, PolymorhForms[urand(0, 5)], true); + } + + void Register() + { + // add dummy effect spell handler to Polymorph visual + OnEffectHitTarget += SpellEffectFn(spell_mage_polymorph_cast_visual_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_mage_polymorph_cast_visual_SpellScript(); + } +}; + +uint32 const spell_mage_polymorph_cast_visual::spell_mage_polymorph_cast_visual_SpellScript::PolymorhForms[6] = +{ + SPELL_MAGE_SQUIRREL_FORM, + SPELL_MAGE_GIRAFFE_FORM, + SPELL_MAGE_SERPENT_FORM, + SPELL_MAGE_DRAGONHAWK_FORM, + SPELL_MAGE_WORGEN_FORM, + SPELL_MAGE_SHEEP_FORM +}; + +// 5405 - Replenish Mana (Mana Gem) /// Updated 4.3.4 class spell_mage_replenish_mana : public SpellScriptLoader { @@ -656,7 +621,7 @@ class spell_mage_replenish_mana : public SpellScriptLoader { PrepareSpellScript(spell_mage_replenish_mana_SpellScript); - bool Validate(SpellInfo const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellInfo*/) { if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_IMPROVED_MANA_GEM_TRIGGERED)) return false; @@ -684,6 +649,46 @@ class spell_mage_replenish_mana : public SpellScriptLoader } }; +// 31687 - Summon Water Elemental +class spell_mage_summon_water_elemental : public SpellScriptLoader +{ + public: + spell_mage_summon_water_elemental() : SpellScriptLoader("spell_mage_summon_water_elemental") { } + + class spell_mage_summon_water_elemental_SpellScript : public SpellScript + { + PrepareSpellScript(spell_mage_summon_water_elemental_SpellScript); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_GLYPH_OF_ETERNAL_WATER) || !sSpellMgr->GetSpellInfo(SPELL_MAGE_SUMMON_WATER_ELEMENTAL_TEMPORARY) || !sSpellMgr->GetSpellInfo(SPELL_MAGE_SUMMON_WATER_ELEMENTAL_PERMANENT)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + // Glyph of Eternal Water + if (caster->HasAura(SPELL_MAGE_GLYPH_OF_ETERNAL_WATER)) + caster->CastSpell(caster, SPELL_MAGE_SUMMON_WATER_ELEMENTAL_PERMANENT, true); + else + caster->CastSpell(caster, SPELL_MAGE_SUMMON_WATER_ELEMENTAL_TEMPORARY, true); + } + + void Register() + { + // add dummy effect spell handler to Summon Water Elemental + OnEffectHit += SpellEffectFn(spell_mage_summon_water_elemental_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_mage_summon_water_elemental_SpellScript(); + } +}; + // 33395 Water Elemental's Freeze /// Updated 4.3.4 class spell_mage_water_elemental_freeze : public SpellScriptLoader @@ -695,7 +700,7 @@ class spell_mage_water_elemental_freeze : public SpellScriptLoader { PrepareSpellScript(spell_mage_water_elemental_freeze_SpellScript); - bool Validate(SpellInfo const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellInfo*/) { if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_FINGERS_OF_FROST)) return false; @@ -742,18 +747,18 @@ class spell_mage_water_elemental_freeze : public SpellScriptLoader void AddSC_mage_spell_scripts() { new spell_mage_blast_wave(); + new spell_mage_blizzard(); new spell_mage_cold_snap(); new spell_mage_cone_of_cold(); new spell_mage_conjure_refreshment(); new spell_mage_frost_warding_trigger(); - new spell_mage_polymorph_cast_visual(); - new spell_mage_summon_water_elemental(); - new spell_mage_living_bomb(); - new spell_mage_blizzard(); new spell_mage_frostbolt(); + new spell_mage_living_bomb(); new spell_mage_ice_barrier(); new spell_mage_mana_shield(); new spell_mage_mage_ward(); + new spell_mage_polymorph_cast_visual(); new spell_mage_replenish_mana(); + new spell_mage_summon_water_elemental(); new spell_mage_water_elemental_freeze(); } diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index 96d053b4611..47592630a11 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -50,7 +50,7 @@ enum PaladinSpells SPELL_PALADIN_IMMUNE_SHIELD_MARKER = 61988, SPELL_PALADIN_HAND_OF_SACRIFICE = 6940, - SPELL_PALADIN_DIVINE_SACRIFICE = 64205, + SPELL_PALADIN_DIVINE_SACRIFICE = 64205 }; // 31850 - Ardent Defender @@ -685,6 +685,7 @@ class spell_pal_righteous_defense : public SpellScriptLoader } }; +// 85285 - Sacred Shield class spell_pal_sacred_shield : public SpellScriptLoader { public: diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp index 43ee6572bf7..14d1c1a2f98 100644 --- a/src/server/scripts/Spells/spell_rogue.cpp +++ b/src/server/scripts/Spells/spell_rogue.cpp @@ -404,35 +404,6 @@ class spell_rog_recuperate : public SpellScriptLoader } }; -// 36554 - Shadowstep -class spell_rog_shadowstep : public SpellScriptLoader -{ - public: - spell_rog_shadowstep() : SpellScriptLoader("spell_rog_shadowstep") { } - - class spell_rog_shadowstep_SpellScript : public SpellScript - { - PrepareSpellScript(spell_rog_shadowstep_SpellScript); - - SpellCastResult CheckCast() - { - if (GetCaster()->HasUnitState(UNIT_STATE_ROOT)) - return SPELL_FAILED_ROOTED; - return SPELL_CAST_OK; - } - - void Register() - { - OnCheckCast += SpellCheckCastFn(spell_rog_shadowstep_SpellScript::CheckCast); - } - }; - - SpellScript* GetSpellScript() const - { - return new spell_rog_shadowstep_SpellScript(); - } -}; - // 5938 - Shiv class spell_rog_shiv : public SpellScriptLoader { @@ -482,6 +453,5 @@ void AddSC_rogue_spell_scripts() new spell_rog_preparation(); new spell_rog_prey_on_the_weak(); new spell_rog_recuperate(); - new spell_rog_shadowstep(); new spell_rog_shiv(); } diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index c84b9236db7..e2e3f5a52e7 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -49,10 +49,11 @@ enum ShamanSpells enum ShamanSpellIcons { - SHAMAN_ICON_ID_SOOTHING_RAIN = 2011, - SHAMAN_ICON_ID_SHAMAN_LAVA_FLOW = 3087 + SHAMAN_ICON_ID_SOOTHING_RAIN = 2011, + SHAMAN_ICON_ID_SHAMAN_LAVA_FLOW = 3087 }; +// 52759 - Ancestral Awakening /// Updated 4.3.4 class spell_sha_ancestral_awakening_proc : public SpellScriptLoader { @@ -89,6 +90,7 @@ class spell_sha_ancestral_awakening_proc : public SpellScriptLoader } }; +// 2825 - Bloodlust /// Updated 4.3.4 class spell_sha_bloodlust : public SpellScriptLoader { @@ -134,7 +136,7 @@ class spell_sha_bloodlust : public SpellScriptLoader } }; -// 1064 Chain Heal +// 1064 - Chain Heal /// Updated 4.3.4 class spell_sha_chain_heal : public SpellScriptLoader { @@ -264,6 +266,7 @@ class EarthenPowerTargetSelector } }; +// 59566 - Earthen Power class spell_sha_earthen_power : public SpellScriptLoader { public: @@ -326,6 +329,7 @@ class spell_sha_fire_nova : public SpellScriptLoader } }; +// 8050 -Flame Shock /// Updated 4.3.4 class spell_sha_flame_shock : public SpellScriptLoader { @@ -373,6 +377,7 @@ class spell_sha_flame_shock : public SpellScriptLoader } }; +// 52041 - Healing Stream Totem /// Updated 4.3.4 class spell_sha_healing_stream_totem : public SpellScriptLoader { @@ -422,6 +427,7 @@ class spell_sha_healing_stream_totem : public SpellScriptLoader } }; +// 32182 - Heroism /// Updated 4.3.4 class spell_sha_heroism : public SpellScriptLoader { @@ -467,6 +473,7 @@ class spell_sha_heroism : public SpellScriptLoader } }; +// 60103 - Lava Lash /// Updated 4.3.4 class spell_sha_lava_lash : public SpellScriptLoader { @@ -511,7 +518,7 @@ class spell_sha_lava_lash : public SpellScriptLoader } }; -// 16191 Mana Tide +// 16191 - Mana Tide /// Updated 4.3.4 class spell_sha_mana_tide_totem : public SpellScriptLoader { diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 655d1695029..21dea0b726b 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -57,6 +57,7 @@ enum WarlockSpellIcons WARLOCK_ICON_ID_MANA_FEED = 1982 }; +// 710 - Banish /// Updated 4.3.4 class spell_warl_banish : public SpellScriptLoader { @@ -111,7 +112,7 @@ class spell_warl_banish : public SpellScriptLoader } }; -// 6201 Create Healthstone +// 6201 - Create Healthstone class spell_warl_create_healthstone : public SpellScriptLoader { public: @@ -183,7 +184,8 @@ class spell_warl_create_healthstone : public SpellScriptLoader } }; -uint32 const spell_warl_create_healthstone::spell_warl_create_healthstone_SpellScript::iTypes[8][3] = { +uint32 const spell_warl_create_healthstone::spell_warl_create_healthstone_SpellScript::iTypes[8][3] = +{ { 5512, 19004, 19005}, // Minor Healthstone { 5511, 19006, 19007}, // Lesser Healthstone { 5509, 19008, 19009}, // Healthstone @@ -194,7 +196,7 @@ uint32 const spell_warl_create_healthstone::spell_warl_create_healthstone_SpellS {36892, 36893, 36894} // Fel Healthstone }; -// 603 Bane of Doom +// 603 - Bane of Doom /// Updated 4.3.4 class spell_warl_bane_of_doom : public SpellScriptLoader { @@ -205,7 +207,7 @@ class spell_warl_bane_of_doom : public SpellScriptLoader { PrepareAuraScript(spell_warl_curse_of_doom_AuraScript); - bool Validate(SpellInfo const* /*spell*/) + bool Validate(SpellInfo const* /*spellInfo*/) { if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_BANE_OF_DOOM_EFFECT)) return false; @@ -242,7 +244,7 @@ class spell_warl_bane_of_doom : public SpellScriptLoader } }; -// 48018 Demonic Circle: Summon +// 48018 - Demonic Circle: Summon /// Updated 4.3.4 class spell_warl_demonic_circle_summon : public SpellScriptLoader { @@ -295,7 +297,7 @@ class spell_warl_demonic_circle_summon : public SpellScriptLoader } }; -// 48020 Demonic Circle: Teleport +// 48020 - Demonic Circle: Teleport /// Updated 4.3.4 class spell_warl_demonic_circle_teleport : public SpellScriptLoader { @@ -330,7 +332,7 @@ class spell_warl_demonic_circle_teleport : public SpellScriptLoader } }; -// 47193 Demonic Empowerment +// 47193 - Demonic Empowerment /// Updated 4.3.4 class spell_warl_demonic_empowerment : public SpellScriptLoader { @@ -393,7 +395,7 @@ class spell_warl_demonic_empowerment : public SpellScriptLoader } }; -// 47422 Everlasting Affliction +// 47422 - Everlasting Affliction /// Updated 4.3.4 class spell_warl_everlasting_affliction : public SpellScriptLoader { @@ -424,7 +426,7 @@ class spell_warl_everlasting_affliction : public SpellScriptLoader } }; -// 48181 Haunt +// 48181 - Haunt /// Updated 4.3.4 class spell_warl_haunt : public SpellScriptLoader { @@ -452,7 +454,7 @@ class spell_warl_haunt : public SpellScriptLoader { PrepareAuraScript(spell_warl_haunt_AuraScript); - bool Validate(SpellInfo const* /*spell*/) + bool Validate(SpellInfo const* /*spellInfo*/) { if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_HAUNT_HEAL)) return false; @@ -485,7 +487,7 @@ class spell_warl_haunt : public SpellScriptLoader } }; -// 755 Health Funnel +// 755 - Health Funnel /// Updated 4.3.4 class spell_warl_health_funnel : public SpellScriptLoader { @@ -529,7 +531,7 @@ class spell_warl_health_funnel : public SpellScriptLoader } }; -// 1454 Life Tap +// 1454 - Life Tap /// Updated 4.3.4 class spell_warl_life_tap : public SpellScriptLoader { @@ -545,7 +547,7 @@ class spell_warl_life_tap : public SpellScriptLoader return GetCaster()->GetTypeId() == TYPEID_PLAYER; } - bool Validate(SpellInfo const* /*spell*/) + bool Validate(SpellInfo const* /*spellInfo*/) { if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_LIFE_TAP_ENERGIZE) || !sSpellMgr->GetSpellInfo(SPELL_WARLOCK_LIFE_TAP_ENERGIZE_2)) return false; @@ -599,7 +601,7 @@ class spell_warl_life_tap : public SpellScriptLoader } }; -// 27285 Seed of Corruption +// 27285 - Seed of Corruption /// Updated 4.3.4 class spell_warl_seed_of_corruption : public SpellScriptLoader { @@ -628,7 +630,7 @@ class spell_warl_seed_of_corruption : public SpellScriptLoader } }; -// 29858 Soulshatter +// 29858 - Soulshatter /// Updated 4.3.4 class spell_warl_soulshatter : public SpellScriptLoader { @@ -639,7 +641,7 @@ class spell_warl_soulshatter : public SpellScriptLoader { PrepareSpellScript(spell_warl_soulshatter_SpellScript); - bool Validate(SpellInfo const* /*spell*/) + bool Validate(SpellInfo const* /*spellInfo*/) { if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_SOULSHATTER)) return false; @@ -666,6 +668,7 @@ class spell_warl_soulshatter : public SpellScriptLoader } }; +// 30108, 34438, 34439, 35183 - Unstable Affliction /// Updated 4.3.4 class spell_warl_unstable_affliction : public SpellScriptLoader { @@ -676,7 +679,7 @@ class spell_warl_unstable_affliction : public SpellScriptLoader { PrepareAuraScript(spell_warl_unstable_affliction_AuraScript); - bool Validate(SpellInfo const* /*spell*/) + bool Validate(SpellInfo const* /*spellInfo*/) { if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_UNSTABLE_AFFLICTION_DISPEL)) return false; diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index 6b0ef00464b..909e90beaad 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -43,7 +43,7 @@ enum WarriorSpells enum WarriorSpellIcons { - WARRIOR_ICON_ID_SUDDEN_DEATH = 1989, + WARRIOR_ICON_ID_SUDDEN_DEATH = 1989, }; /// Updated 4.3.4 @@ -296,7 +296,7 @@ class spell_warr_last_stand : public SpellScriptLoader { PrepareSpellScript(spell_warr_last_stand_SpellScript); - bool Validate(SpellInfo const* /*spellEntry*/) + bool Validate(SpellInfo const* /*spellInfo*/) { if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_LAST_STAND_TRIGGERED)) return false; -- cgit v1.2.3 From 7d6634e3636c6090139c1415d164329ff03bb95f Mon Sep 17 00:00:00 2001 From: Spp Date: Thu, 17 Jan 2013 08:48:04 +0100 Subject: Fix merge problem --- src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'src') diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h b/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h index 50d16c44930..90f9c98497c 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h +++ b/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h @@ -23,8 +23,6 @@ uint32 const EncounterCount = 5; -#define ZGScriptName "instance_zulgurub" - enum DataTypes { DATA_VENOXIS = 0, -- cgit v1.2.3 From 6c71d555a07f2ea9a5107ea0d5855b57de098a52 Mon Sep 17 00:00:00 2001 From: Shocker Date: Sat, 19 Jan 2013 02:17:41 +0200 Subject: Core/Achievements: Delete from guild_achievement_progress table when encountering an invalid criteria in that table --- src/server/game/Achievements/AchievementMgr.cpp | 2 +- src/server/shared/Database/Implementation/CharacterDatabase.cpp | 1 + src/server/shared/Database/Implementation/CharacterDatabase.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index b82aa86f3be..d754ef967e6 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -803,7 +803,7 @@ void AchievementMgr::LoadFromDB(PreparedQueryResult achievementResult, Pr // we will remove not existed criteria for all guilds sLog->outError(LOG_FILTER_ACHIEVEMENTSYS, "Non-existing achievement criteria %u data removed from table `guild_achievement_progress`.", id); - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVALID_ACHIEV_PROGRESS_CRITERIA); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVALID_ACHIEV_PROGRESS_CRITERIA_GUILD); stmt->setUInt16(0, uint16(id)); CharacterDatabase.Execute(stmt); continue; diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index 6067446d1b8..e89067e3892 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -398,6 +398,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() PrepareStatement(CHAR_UPD_ZONE, "UPDATE characters SET zone = ? WHERE guid = ?", CONNECTION_ASYNC); PrepareStatement(CHAR_UPD_LEVEL, "UPDATE characters SET level = ?, xp = 0 WHERE guid = ?", CONNECTION_ASYNC); PrepareStatement(CHAR_DEL_INVALID_ACHIEV_PROGRESS_CRITERIA, "DELETE FROM character_achievement_progress WHERE criteria = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_DEL_INVALID_ACHIEV_PROGRESS_CRITERIA_GUILD, "DELETE FROM guild_achievement_progress WHERE criteria = ?", CONNECTION_ASYNC); PrepareStatement(CHAR_DEL_INVALID_ACHIEVMENT, "DELETE FROM character_achievement WHERE achievement = ?", CONNECTION_ASYNC); PrepareStatement(CHAR_INS_ADDON, "INSERT INTO addons (name, crc) VALUES (?, ?)", CONNECTION_ASYNC); PrepareStatement(CHAR_DEL_INVALID_PET_SPELL, "DELETE FROM pet_spell WHERE spell = ?", CONNECTION_ASYNC); diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.h b/src/server/shared/Database/Implementation/CharacterDatabase.h index 9a3286e9db5..74b56b1a437 100755 --- a/src/server/shared/Database/Implementation/CharacterDatabase.h +++ b/src/server/shared/Database/Implementation/CharacterDatabase.h @@ -337,6 +337,7 @@ enum CharacterDatabaseStatements CHAR_UPD_ZONE, CHAR_UPD_LEVEL, CHAR_DEL_INVALID_ACHIEV_PROGRESS_CRITERIA, + CHAR_DEL_INVALID_ACHIEV_PROGRESS_CRITERIA_GUILD, CHAR_DEL_INVALID_ACHIEVMENT, CHAR_INS_ADDON, CHAR_DEL_INVALID_PET_SPELL, -- cgit v1.2.3 From 504ca4105adf0c35dd96576c25487b34cbca9891 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 19 Jan 2013 13:05:20 +0100 Subject: Scripts/Firelands: Fixed compile without PCH --- src/server/scripts/Kalimdor/Firelands/boss_alysrazor.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/server/scripts/Kalimdor/Firelands/boss_alysrazor.cpp b/src/server/scripts/Kalimdor/Firelands/boss_alysrazor.cpp index e4ab2265027..1dc70c5e505 100644 --- a/src/server/scripts/Kalimdor/Firelands/boss_alysrazor.cpp +++ b/src/server/scripts/Kalimdor/Firelands/boss_alysrazor.cpp @@ -18,6 +18,7 @@ #include "ObjectMgr.h" #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "PassiveAI.h" #include "SpellScript.h" #include "MoveSplineInit.h" #include "Cell.h" -- cgit v1.2.3 From 456d9a6cea801c013df0c784256a3ada9a813aed Mon Sep 17 00:00:00 2001 From: Souler Date: Wed, 16 Jan 2013 12:57:00 +0100 Subject: Spells/Mage: Mages should be able to see everything while on Invisibility --- src/server/game/Entities/Object/Object.cpp | 7 ------- 1 file changed, 7 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index d86813c7023..4c6a13136eb 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -2026,13 +2026,6 @@ bool WorldObject::CanDetectInvisibilityOf(WorldObject const* obj) const if (mask != obj->m_invisibility.GetFlags()) return false; - // It isn't possible in invisibility to detect something that can't detect the invisible object - // (it's at least true for spell: 66) - // It seems like that only Units are affected by this check (couldn't see arena doors with preparation invisibility) - if (obj->ToUnit()) - if ((m_invisibility.GetFlags() & obj->m_invisibilityDetect.GetFlags()) != m_invisibility.GetFlags()) - return false; - for (uint32 i = 0; i < TOTAL_INVISIBILITY_TYPES; ++i) { if (!(mask & (1 << i))) -- cgit v1.2.3 From bff076bd2ae3ae091390989276b8a31ab7acfcfe Mon Sep 17 00:00:00 2001 From: Souler Date: Sun, 20 Jan 2013 20:01:23 +0100 Subject: Spells: Dispel effects can always be casted. Signed-off-by: Souler --- src/server/game/Spells/Spell.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index c0ab92d36c5..507e755ce9d 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -5068,6 +5068,8 @@ SpellCastResult Spell::CheckCast(bool strict) } } + // Updated 4.3.4. Dispel effects can always be cast (even when there's nothing to dispel). + /* if (!hasNonDispelEffect && !hasDispellableAura && dispelMask && !IsTriggered()) { if (Unit* target = m_targets.GetUnitTarget()) @@ -5078,6 +5080,7 @@ SpellCastResult Spell::CheckCast(bool strict) return SPELL_FAILED_NOTHING_TO_DISPEL; } } + */ for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { -- cgit v1.2.3 From 93c7f975b12641f2b36230c6c1eb711c1661b861 Mon Sep 17 00:00:00 2001 From: Northstrider Date: Mon, 21 Jan 2013 23:47:17 +0100 Subject: Scripts: implement Alizabal the misstress of hate Todo: use the rest of the texts and add the missing ones --- sql/updates/world/2013_01_21_00_world_misc.sql | 22 ++ src/server/game/Scripting/ScriptLoader.cpp | 4 + .../EasternKingdoms/BaradinHold/baradin_hold.h | 47 ++++ .../EasternKingdoms/BaradinHold/boss_alizabal.cpp | 268 +++++++++++++++++++++ .../BaradinHold/instance_baradin_hold.cpp | 169 +++++++++++++ src/server/scripts/EasternKingdoms/CMakeLists.txt | 2 + 6 files changed, 512 insertions(+) create mode 100644 sql/updates/world/2013_01_21_00_world_misc.sql create mode 100644 src/server/scripts/EasternKingdoms/BaradinHold/baradin_hold.h create mode 100644 src/server/scripts/EasternKingdoms/BaradinHold/boss_alizabal.cpp create mode 100644 src/server/scripts/EasternKingdoms/BaradinHold/instance_baradin_hold.cpp (limited to 'src') diff --git a/sql/updates/world/2013_01_21_00_world_misc.sql b/sql/updates/world/2013_01_21_00_world_misc.sql new file mode 100644 index 00000000000..e71a93d936a --- /dev/null +++ b/sql/updates/world/2013_01_21_00_world_misc.sql @@ -0,0 +1,22 @@ +-- Intro Areatrigger +DELETE FROM `areatrigger_scripts` WHERE `entry` = 7246; +INSERT INTO `areatrigger_scripts` (`entry`, `ScriptName`) VALUES +(7246, 'at_alizabal_intro'); + +UPDATE `creature_template` SET `scriptname` = 'boss_alizabal' WHERE `entry` = 55869; + +-- Todo: Find the Rest of the Texts and their meanings +DELETE FROM `creature_text` WHERE `entry` = 55869; +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES +(55869, 1, 0, 'How I hate this place. My captors may be long dead.. but don\'t think I won\'t take it out on you, miserable treasure hunters!', 14, 0, 100, 0, 0, 25779, 'Alizabal - Intro'), +(55869, 2, 0, 'I hate adventurers.', 14, 0, 100, 0, 0, 25777, 'Alizabal - Aggro'), +(55869, 3, 0, 'I hate martyrs!', 14, 0, 100, 0, 0, 25786, 'Alizabal - Seething Hate'), +(55869, 4, 0, 'I hate armor!', 14, 0, 100, 0, 0, 25785, 'Alizabal - Skewer'), +(55869, 5, 0, 'Alizabal nailed $N firmly on the ground.', 41, 0, 100, 0, 0, 0, 'Alizabal - Skewer Announce'), +(55869, 6, 0, 'I hate standing still!', 14, 0, 100, 0, 0, 25791, 'Alizabal - Blade Dance'), +(55869, 7, 0, 'Feel my hatred!', 14, 0, 100, 0, 0, 25787, 'Alizabal - ???'), +(55869, 8, 0, 'My hate will consume you!', 14, 0, 100, 0, 0, 25789, 'Alizabal - ???'), +(55869, 9, 0, 'I hate you all!', 14, 0, 100, 0, 0, 25790, 'Alizabal - ???'), +(55869, 10, 0, 'I hate mercy.', 14, 0, 100, 0, 0, 25783, 'Alizabal - Slay 1'), +(55869, 11, 0, 'My hatred burns!', 14, 0, 100, 0, 0, 25788, 'Alizabal - ???'), +(55869, 12, 0, 'I hate... every.. one of you!', 14, 0, 100, 0, 0, 25778, 'Alizabal - Death'); diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index 633e17ff014..8cbc4b62424 100644 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -97,6 +97,8 @@ void AddSC_boss_balinda(); void AddSC_boss_drekthar(); void AddSC_boss_galvangar(); void AddSC_boss_vanndar(); +void AddSC_boss_alizabal(); //Baradin Hold +void AddSC_instance_baradin_hold(); void AddSC_blackrock_depths(); //Blackrock Depths void AddSC_boss_ambassador_flamelash(); void AddSC_boss_anubshiah(); @@ -731,6 +733,8 @@ void AddEasternKingdomsScripts() AddSC_boss_drekthar(); AddSC_boss_galvangar(); AddSC_boss_vanndar(); + AddSC_boss_alizabal(); //Baradin Hold + AddSC_instance_baradin_hold(); AddSC_blackrock_depths(); //Blackrock Depths AddSC_boss_ambassador_flamelash(); AddSC_boss_anubshiah(); diff --git a/src/server/scripts/EasternKingdoms/BaradinHold/baradin_hold.h b/src/server/scripts/EasternKingdoms/BaradinHold/baradin_hold.h new file mode 100644 index 00000000000..77554d29d15 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/BaradinHold/baradin_hold.h @@ -0,0 +1,47 @@ +/* +* Copyright (C) 2008-2013 TrinityCore +* +* 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; either version 3 of the License, or (at your +* option) any later version. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; 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, see . +*/ + +#ifndef DEF_BARADIN_HOLD_H_ +#define DEF_BARADIN_HOLD_H_ + +#define MAX_ENCOUNTERS 3 + +enum Creatures +{ + BOSS_ARGALOTH = 47120, + BOSS_OCCUTHAR = 52363, + BOSS_ALIZABAL = 55869, + + NPC_EYE_OF_OCCUTHAR = 52389, + NPC_FOCUS_FIRE_DUMMY = 52369, + NPC_OCCUTHAR_EYE = 52368, +}; + +enum Objects +{ + GO_ARGALOTH_DOOR = 207619, + GO_OCCUTHAR_DOOR = 208953, +}; + +enum Data +{ + DATA_ARGALOTH = 1, + DATA_OCCUTHAR = 2, + DATA_ALIZABAL = 3, +}; + +#endif diff --git a/src/server/scripts/EasternKingdoms/BaradinHold/boss_alizabal.cpp b/src/server/scripts/EasternKingdoms/BaradinHold/boss_alizabal.cpp new file mode 100644 index 00000000000..ae1c5c03bd6 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/BaradinHold/boss_alizabal.cpp @@ -0,0 +1,268 @@ +/* +* Copyright (C) 2008-2013 TrinityCore + * + * 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; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; 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, see . + */ + +#include "baradin_hold.h" + +enum Texts +{ + SAY_INTRO = 1, + SAY_AGGRO = 2, + SAY_HATE = 3, + SAY_SKEWER = 4, + SAY_SKEWER_ANNOUNCE = 5, + SAY_BLADE_STORM = 6, + SAY_SLAY = 10, + SAY_DEATH = 12, +}; + +enum Spells +{ + SPELL_BLADE_DANCE = 105784, + SPELL_BLADE_DANCE_DUMMY = 105828, + SPELL_SEETHING_HATE = 105067, + SPELL_SKEWER = 104936, + SPELL_BERSERK = 47008, +}; + +enum Actions +{ + ACTION_INTRO = 1, +}; + +enum Points +{ + POINT_STORM = 1, +}; + +enum Events +{ + EVENT_RANDOM_CAST = 1, + EVENT_STOP_STORM = 2, + EVENT_MOVE_STORM = 3, + EVENT_CAST_STORM = 4, +}; + +class at_alizabal_intro : public AreaTriggerScript +{ + public: + at_alizabal_intro() : AreaTriggerScript("at_alizabal_intro") { } + + bool OnTrigger(Player* player, AreaTriggerEntry const* /*areaTrigger*/) + { + if (InstanceScript* instance = player->GetInstanceScript()) + if (Creature* Alizabal = ObjectAccessor::GetCreature(*player, instance->GetData64(DATA_ALIZABAL))) + Alizabal->AI()->DoAction(ACTION_INTRO); + return true; + } +}; + +class boss_alizabal : public CreatureScript +{ + public: + boss_alizabal() : CreatureScript("boss_alizabal") { } + + struct boss_alizabalAI : public BossAI + { + boss_alizabalAI(Creature* creature) : BossAI(creature, DATA_ALIZABAL) + { + instance = creature->GetInstanceScript(); + Intro = false; + Hate = false; + Skewer = false; + } + + InstanceScript* instance; + bool Intro; + bool Hate; + bool Skewer; + + void Reset() + { + _Reset(); + Hate = false; + Skewer = false; + } + + void EnterCombat(Unit* who) + { + _EnterCombat(); + Talk(SAY_AGGRO); + instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me); + events.ScheduleEvent(EVENT_RANDOM_CAST, 10000); + } + + void JustDied(Unit* killer) + { + _JustDied(); + Talk(SAY_DEATH); + instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); + } + + void KilledUnit(Unit * who) + { + if (who->GetTypeId() == TYPEID_PLAYER) + Talk(SAY_SLAY); + } + + void EnterEvadeMode() + { + instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); + me->GetMotionMaster()->MoveTargetedHome(); + _DespawnAtEvade(); + } + + void DoAction(int32 const action) + { + switch (action) + { + case ACTION_INTRO: + if (!Intro) + { + Talk(SAY_INTRO); + Intro = true; + } + break; + } + } + + void MovementInform(uint32 type, uint32 pointId) + { + switch (pointId) + { + case POINT_STORM: + events.ScheduleEvent(EVENT_CAST_STORM, 1); + break; + } + } + + void UpdateAI(uint32 const diff) + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_RANDOM_CAST: + switch (urand(0, 1)) + { + case 0: + if (!Skewer) + { + if (Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 0)) + { + DoCast(target, SPELL_SKEWER, true); + Talk(SAY_SKEWER); + Talk(SAY_SKEWER_ANNOUNCE, target->GetGUID()); + } + Skewer = true; + events.ScheduleEvent(EVENT_RANDOM_CAST, urand(7000, 10000)); + } + else if (!Hate) + { + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, NonTankTargetSelector(me))) + { + DoCast(target, SPELL_SEETHING_HATE, true); + Talk(SAY_HATE); + } + Hate = true; + events.ScheduleEvent(EVENT_RANDOM_CAST, urand(7000, 10000)); + } + else if (Hate && Skewer) + { + Talk(SAY_BLADE_STORM); + DoCastAOE(SPELL_BLADE_DANCE_DUMMY); + DoCastAOE(SPELL_BLADE_DANCE); + events.ScheduleEvent(EVENT_RANDOM_CAST, 21000); + events.ScheduleEvent(EVENT_MOVE_STORM, 4050); + events.ScheduleEvent(EVENT_STOP_STORM, 13000); + } + break; + case 1: + if (!Hate) + { + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, NonTankTargetSelector(me))) + { + DoCast(target, SPELL_SEETHING_HATE, true); + Talk(SAY_HATE); + } + Hate = true; + events.ScheduleEvent(EVENT_RANDOM_CAST, urand(7000, 10000)); + } + else if (!Skewer) + { + if (Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 0)) + { + DoCast(target, SPELL_SKEWER, true); + Talk(SAY_SKEWER); + Talk(SAY_SKEWER_ANNOUNCE, target->GetGUID()); + } + Skewer = true; + events.ScheduleEvent(EVENT_RANDOM_CAST, urand(7000, 10000)); + } + else if (Hate && Skewer) + { + Talk(SAY_BLADE_STORM); + DoCastAOE(SPELL_BLADE_DANCE_DUMMY); + DoCastAOE(SPELL_BLADE_DANCE); + events.ScheduleEvent(EVENT_RANDOM_CAST, 21000); + events.ScheduleEvent(EVENT_MOVE_STORM, 4050); + events.ScheduleEvent(EVENT_STOP_STORM, 13000); + } + break; + } + break; + case EVENT_MOVE_STORM: + me->SetSpeed(MOVE_RUN, 4.0f); + me->SetSpeed(MOVE_WALK, 4.0f); + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, NonTankTargetSelector(me))) + me->GetMotionMaster()->MovePoint(POINT_STORM, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ()); + events.ScheduleEvent(EVENT_MOVE_STORM, 4050); + break; + case EVENT_STOP_STORM: + me->RemoveAura(SPELL_BLADE_DANCE); + me->RemoveAura(SPELL_BLADE_DANCE_DUMMY); + me->SetSpeed(MOVE_WALK, 1.0f); + me->SetSpeed(MOVE_RUN, 1.14f); + me->GetMotionMaster()->MoveChase(me->getVictim()); + Hate = false; + Skewer = false; + break; + case EVENT_CAST_STORM: + DoCastAOE(SPELL_BLADE_DANCE); + break; + } + } + + DoMeleeAttackIfReady(); + } + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new boss_alizabalAI(creature); + } +}; + +void AddSC_boss_alizabal() +{ + new boss_alizabal(); + new at_alizabal_intro(); +} diff --git a/src/server/scripts/EasternKingdoms/BaradinHold/instance_baradin_hold.cpp b/src/server/scripts/EasternKingdoms/BaradinHold/instance_baradin_hold.cpp new file mode 100644 index 00000000000..6cc11504f2f --- /dev/null +++ b/src/server/scripts/EasternKingdoms/BaradinHold/instance_baradin_hold.cpp @@ -0,0 +1,169 @@ +/* +* Copyright (C) 2008-2013 TrinityCore +* +* 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; either version 3 of the License, or (at your +* option) any later version. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; 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, see . +*/ + +#include"ScriptPCH.h" +#include"baradin_hold.h" + +DoorData const doorData[] = +{ + {GO_ARGALOTH_DOOR, DATA_ARGALOTH, DOOR_TYPE_ROOM, BOUNDARY_NONE}, + {GO_OCCUTHAR_DOOR, DATA_OCCUTHAR, DOOR_TYPE_ROOM, BOUNDARY_NONE}, +}; + +class instance_baradin_hold: public InstanceMapScript +{ +public: + instance_baradin_hold() : InstanceMapScript("instance_baradin_hold", 757) { } + + InstanceScript* GetInstanceScript(InstanceMap* map) const + { + return new instance_baradin_hold_InstanceMapScript(map); + } + + struct instance_baradin_hold_InstanceMapScript: public InstanceScript + { + instance_baradin_hold_InstanceMapScript(InstanceMap* map) : InstanceScript(map) + { + SetBossNumber(MAX_ENCOUNTERS); + LoadDoorData(doorData); + ArgalothGUID = 0; + OccutharGUID = 0; + AlizabalGUID = 0; + ArgalothDoor = 0; + OccutharDoor = 0; + } + + void Initialize() + { + } + + void OnCreatureCreate(Creature* creature) + { + switch(creature->GetEntry()) + { + case BOSS_ARGALOTH: + ArgalothGUID = creature->GetGUID(); + break; + case BOSS_OCCUTHAR: + OccutharGUID = creature->GetGUID(); + break; + case BOSS_ALIZABAL: + AlizabalGUID = creature->GetGUID(); + break; + } + } + + void OnGameObjectCreate(GameObject* go) + { + switch(go->GetEntry()) + { + case GO_ARGALOTH_DOOR: + ArgalothDoor = go->GetGUID(); + AddDoor(go, true); + break; + case GO_OCCUTHAR_DOOR: + OccutharDoor = go->GetGUID(); + AddDoor(go, true); + break; + } + } + + uint64 GetData64(uint32 data) const + { + switch (data) + { + case DATA_ARGALOTH: + return ArgalothGUID; + case DATA_OCCUTHAR: + return OccutharGUID; + case DATA_ALIZABAL: + return AlizabalGUID; + default: + break; + } + return NULL; + } + + void OnGameObjectRemove(GameObject* go) + { + switch(go->GetEntry()) + { + case GO_ARGALOTH_DOOR: + AddDoor(go, false); + break; + case GO_OCCUTHAR_DOOR: + AddDoor(go, false); + break; + } + } + + std::string GetSaveData() + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << "B H " << GetBossSaveData(); + + OUT_SAVE_INST_DATA_COMPLETE; + return saveStream.str(); + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(in); + + char dataHead1, dataHead2; + + std::istringstream loadStream(in); + loadStream >> dataHead1 >> dataHead2; + + if (dataHead1 == 'B' && dataHead2 == 'H') + { + for (uint8 i = 0; i < MAX_ENCOUNTERS; ++i) + { + uint32 tmpState; + loadStream >> tmpState; + if (tmpState == IN_PROGRESS || tmpState > SPECIAL) + tmpState = NOT_STARTED; + + SetBossState(i, EncounterState(tmpState)); + } + + } else OUT_LOAD_INST_DATA_FAIL; + + OUT_LOAD_INST_DATA_COMPLETE; + } + + private: + uint64 ArgalothGUID; + uint64 OccutharGUID; + uint64 AlizabalGUID; + uint64 ArgalothDoor; + uint64 OccutharDoor; + }; +}; + +void AddSC_instance_baradin_hold() +{ + new instance_baradin_hold(); +} diff --git a/src/server/scripts/EasternKingdoms/CMakeLists.txt b/src/server/scripts/EasternKingdoms/CMakeLists.txt index 15ead9b00f8..e782711bde2 100644 --- a/src/server/scripts/EasternKingdoms/CMakeLists.txt +++ b/src/server/scripts/EasternKingdoms/CMakeLists.txt @@ -17,6 +17,8 @@ set(scripts_STAT_SRCS EasternKingdoms/AlteracValley/boss_drekthar.cpp EasternKingdoms/AlteracValley/boss_vanndar.cpp EasternKingdoms/AlteracValley/alterac_valley.cpp + EasternKingdoms/BaradinHold/boss_alizabal.cpp + EasternKingdoms/BaradinHold/instance_baradin_hold.cpp EasternKingdoms/Scholomance/boss_the_ravenian.cpp EasternKingdoms/Scholomance/boss_instructor_malicia.cpp EasternKingdoms/Scholomance/boss_death_knight_darkreaver.cpp -- cgit v1.2.3 From 8c64ceda796565bac68a433385de531e2f14dd66 Mon Sep 17 00:00:00 2001 From: Northstrider Date: Mon, 21 Jan 2013 23:49:23 +0100 Subject: Scripts: removed a unneeded header --- src/server/scripts/EasternKingdoms/BaradinHold/instance_baradin_hold.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/server/scripts/EasternKingdoms/BaradinHold/instance_baradin_hold.cpp b/src/server/scripts/EasternKingdoms/BaradinHold/instance_baradin_hold.cpp index 6cc11504f2f..0e4907a3f82 100644 --- a/src/server/scripts/EasternKingdoms/BaradinHold/instance_baradin_hold.cpp +++ b/src/server/scripts/EasternKingdoms/BaradinHold/instance_baradin_hold.cpp @@ -15,7 +15,6 @@ * with this program. If not, see . */ -#include"ScriptPCH.h" #include"baradin_hold.h" DoorData const doorData[] = -- cgit v1.2.3 From 3bf7fcef55f1ce5d89798197c2e30b9a0ef929f2 Mon Sep 17 00:00:00 2001 From: Northstrider Date: Tue, 22 Jan 2013 00:02:08 +0100 Subject: Scripts: apply some TC codestyle to instance script --- .../BaradinHold/instance_baradin_hold.cpp | 36 +++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/server/scripts/EasternKingdoms/BaradinHold/instance_baradin_hold.cpp b/src/server/scripts/EasternKingdoms/BaradinHold/instance_baradin_hold.cpp index 0e4907a3f82..9bbfebecf2c 100644 --- a/src/server/scripts/EasternKingdoms/BaradinHold/instance_baradin_hold.cpp +++ b/src/server/scripts/EasternKingdoms/BaradinHold/instance_baradin_hold.cpp @@ -39,11 +39,11 @@ public: { SetBossNumber(MAX_ENCOUNTERS); LoadDoorData(doorData); - ArgalothGUID = 0; - OccutharGUID = 0; - AlizabalGUID = 0; - ArgalothDoor = 0; - OccutharDoor = 0; + _argalothGUID = 0; + _occutharGUID = 0; + _alizabalGUID = 0; + _argalothDoor = 0; + _occutharDoor = 0; } void Initialize() @@ -55,13 +55,13 @@ public: switch(creature->GetEntry()) { case BOSS_ARGALOTH: - ArgalothGUID = creature->GetGUID(); + _argalothGUID = creature->GetGUID(); break; case BOSS_OCCUTHAR: - OccutharGUID = creature->GetGUID(); + _occutharGUID = creature->GetGUID(); break; case BOSS_ALIZABAL: - AlizabalGUID = creature->GetGUID(); + _alizabalGUID = creature->GetGUID(); break; } } @@ -71,11 +71,11 @@ public: switch(go->GetEntry()) { case GO_ARGALOTH_DOOR: - ArgalothDoor = go->GetGUID(); + _argalothDoor = go->GetGUID(); AddDoor(go, true); break; case GO_OCCUTHAR_DOOR: - OccutharDoor = go->GetGUID(); + _occutharDoor = go->GetGUID(); AddDoor(go, true); break; } @@ -86,11 +86,11 @@ public: switch (data) { case DATA_ARGALOTH: - return ArgalothGUID; + return _argalothGUID; case DATA_OCCUTHAR: - return OccutharGUID; + return _occutharGUID; case DATA_ALIZABAL: - return AlizabalGUID; + return _alizabalGUID; default: break; } @@ -154,11 +154,11 @@ public: } private: - uint64 ArgalothGUID; - uint64 OccutharGUID; - uint64 AlizabalGUID; - uint64 ArgalothDoor; - uint64 OccutharDoor; + uint64 _argalothGUID; + uint64 _occutharGUID; + uint64 _alizabalGUID; + uint64 _argalothDoor; + uint64 _occutharDoor; }; }; -- cgit v1.2.3 From da060b194895655370a44be6ce80406d19339eac Mon Sep 17 00:00:00 2001 From: Northstrider Date: Tue, 22 Jan 2013 00:07:36 +0100 Subject: Scripts: apply more TC codestyle --- .../scripts/EasternKingdoms/BaradinHold/boss_alizabal.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/server/scripts/EasternKingdoms/BaradinHold/boss_alizabal.cpp b/src/server/scripts/EasternKingdoms/BaradinHold/boss_alizabal.cpp index ae1c5c03bd6..d7441d6311b 100644 --- a/src/server/scripts/EasternKingdoms/BaradinHold/boss_alizabal.cpp +++ b/src/server/scripts/EasternKingdoms/BaradinHold/boss_alizabal.cpp @@ -64,8 +64,8 @@ class at_alizabal_intro : public AreaTriggerScript bool OnTrigger(Player* player, AreaTriggerEntry const* /*areaTrigger*/) { if (InstanceScript* instance = player->GetInstanceScript()) - if (Creature* Alizabal = ObjectAccessor::GetCreature(*player, instance->GetData64(DATA_ALIZABAL))) - Alizabal->AI()->DoAction(ACTION_INTRO); + if (Creature* alizabal = ObjectAccessor::GetCreature(*player, instance->GetData64(DATA_ALIZABAL))) + alizabal->AI()->DoAction(ACTION_INTRO); return true; } }; @@ -79,13 +79,11 @@ class boss_alizabal : public CreatureScript { boss_alizabalAI(Creature* creature) : BossAI(creature, DATA_ALIZABAL) { - instance = creature->GetInstanceScript(); Intro = false; Hate = false; Skewer = false; } - InstanceScript* instance; bool Intro; bool Hate; bool Skewer; @@ -97,7 +95,7 @@ class boss_alizabal : public CreatureScript Skewer = false; } - void EnterCombat(Unit* who) + void EnterCombat(Unit* /*who*/) { _EnterCombat(); Talk(SAY_AGGRO); @@ -105,14 +103,14 @@ class boss_alizabal : public CreatureScript events.ScheduleEvent(EVENT_RANDOM_CAST, 10000); } - void JustDied(Unit* killer) + void JustDied(Unit* /*killer*/) { _JustDied(); Talk(SAY_DEATH); instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); } - void KilledUnit(Unit * who) + void KilledUnit(Unit* who) { if (who->GetTypeId() == TYPEID_PLAYER) Talk(SAY_SLAY); -- cgit v1.2.3 From c72afa9ecfbbfcd1120316434991f75f6e9364a5 Mon Sep 17 00:00:00 2001 From: Tuxity Date: Tue, 22 Jan 2013 15:44:47 +0100 Subject: Core/Spells: Fix Tree of Life (Passive). Closes #8544 I learn something today, thx Shauren --- src/server/game/Spells/SpellMgr.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index ee7a1302739..8fec9605c31 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -3626,6 +3626,9 @@ void SpellMgr::LoadSpellInfoCorrections() break; case 24314: // Threatening Gaze spellInfo->AuraInterruptFlags |= AURA_INTERRUPT_FLAG_CAST | AURA_INTERRUPT_FLAG_MOVE | AURA_INTERRUPT_FLAG_JUMP; + case 5420: // Tree of Life (Passive) + spellInfo->Stances = 1 << (FORM_TREE - 1); + break; default: break; } -- cgit v1.2.3 From 5b7c01e48c3380d4e99fd982cba0aedf431c07c3 Mon Sep 17 00:00:00 2001 From: Tuxity Date: Tue, 22 Jan 2013 17:43:18 +0100 Subject: Core/Spells: Add missing break in previous commit --- src/server/game/Spells/SpellMgr.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 8fec9605c31..4ce2604810c 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -3626,6 +3626,7 @@ void SpellMgr::LoadSpellInfoCorrections() break; case 24314: // Threatening Gaze spellInfo->AuraInterruptFlags |= AURA_INTERRUPT_FLAG_CAST | AURA_INTERRUPT_FLAG_MOVE | AURA_INTERRUPT_FLAG_JUMP; + break; case 5420: // Tree of Life (Passive) spellInfo->Stances = 1 << (FORM_TREE - 1); break; -- cgit v1.2.3 From d0d3d0f3c461d666305a646912b27c3516febc6d Mon Sep 17 00:00:00 2001 From: Xanvial Date: Wed, 23 Jan 2013 01:20:31 +0700 Subject: Scripts/Creature: Hira Snowdawn no longer sells Tome of Cold Weather Flight --- sql/updates/world/2013_01_21_01_world_misc_434.sql | 4 ++ src/server/scripts/Northrend/zone_dalaran.cpp | 45 ---------------------- 2 files changed, 4 insertions(+), 45 deletions(-) create mode 100644 sql/updates/world/2013_01_21_01_world_misc_434.sql (limited to 'src') diff --git a/sql/updates/world/2013_01_21_01_world_misc_434.sql b/sql/updates/world/2013_01_21_01_world_misc_434.sql new file mode 100644 index 00000000000..dcf058b44e0 --- /dev/null +++ b/sql/updates/world/2013_01_21_01_world_misc_434.sql @@ -0,0 +1,4 @@ +-- NPC Hira Snowdawn no longer sells Tome of Cold Weather Flight +UPDATE `creature_template` SET `ScriptName`='' WHERE `entry`=31238; +DELETE FROM `gossip_menu_option` WHERE `menu_id`=10723 AND `id`=1; +DELETE FROM `npc_vendor` WHERE `entry`=31238 AND `item`=49177; diff --git a/src/server/scripts/Northrend/zone_dalaran.cpp b/src/server/scripts/Northrend/zone_dalaran.cpp index d16b6fe4588..6a104e28a1f 100644 --- a/src/server/scripts/Northrend/zone_dalaran.cpp +++ b/src/server/scripts/Northrend/zone_dalaran.cpp @@ -126,52 +126,7 @@ public: } }; -/*###### -## npc_hira_snowdawn -######*/ - -enum eHiraSnowdawn -{ - SPELL_COLD_WEATHER_FLYING = 54197 -}; - -#define GOSSIP_TEXT_TRAIN_HIRA "I seek training to ride a steed." - -class npc_hira_snowdawn : public CreatureScript -{ -public: - npc_hira_snowdawn() : CreatureScript("npc_hira_snowdawn") { } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (!creature->isVendor() || !creature->isTrainer()) - return false; - - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_TRAIN_HIRA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN); - - if (player->getLevel() >= 80 && player->HasSpell(SPELL_COLD_WEATHER_FLYING)) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - - return true; - } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_TRAIN) - player->GetSession()->SendTrainerList(creature->GetGUID()); - - if (action == GOSSIP_ACTION_TRADE) - player->GetSession()->SendListInventory(creature->GetGUID()); - - return true; - } -}; - void AddSC_dalaran() { new npc_mageguard_dalaran; - new npc_hira_snowdawn; } -- cgit v1.2.3 From 534cba6cae40c95e3c39bd9f4e52c1c40be00581 Mon Sep 17 00:00:00 2001 From: Northstrider Date: Tue, 22 Jan 2013 22:18:34 +0100 Subject: Core/Auras: fix mana regeneration for cataclysm food --- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 4496f3fecd6..186cdb8c552 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -1086,6 +1086,16 @@ void AuraEffect::UpdatePeriodic(Unit* caster) case 49472: // Drink Coffee case 57073: case 61830: + case 69176: + case 72623: + case 80166: + case 80167: + case 87958: + case 87959: + case 92736: + case 92797: + case 92800: + case 92803: if (!caster || caster->GetTypeId() != TYPEID_PLAYER) return; // Get SPELL_AURA_MOD_POWER_REGEN aura from spell -- cgit v1.2.3 From e360f8747002e858c0a85945ff1b1c1e3cba1fc3 Mon Sep 17 00:00:00 2001 From: Xanvial Date: Wed, 23 Jan 2013 05:26:51 +0700 Subject: Scripts/Paladin: Templar's Verdict --- .../2013_01_22_01_world_spell_script_names_434.sql | 4 ++ src/server/scripts/Spells/spell_paladin.cpp | 73 +++++++++++++++++++++- 2 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 sql/updates/world/2013_01_22_01_world_spell_script_names_434.sql (limited to 'src') diff --git a/sql/updates/world/2013_01_22_01_world_spell_script_names_434.sql b/sql/updates/world/2013_01_22_01_world_spell_script_names_434.sql new file mode 100644 index 00000000000..cc74d504e94 --- /dev/null +++ b/sql/updates/world/2013_01_22_01_world_spell_script_names_434.sql @@ -0,0 +1,4 @@ +-- 85256 - Templar's Verdict +DELETE FROM `spell_script_names` WHERE `spell_id`=85256; +INSERT INTO `spell_script_names` VALUES +(85256,'spell_pal_templar_s_verdict'); diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index 47592630a11..7625ed548ac 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -50,7 +50,9 @@ enum PaladinSpells SPELL_PALADIN_IMMUNE_SHIELD_MARKER = 61988, SPELL_PALADIN_HAND_OF_SACRIFICE = 6940, - SPELL_PALADIN_DIVINE_SACRIFICE = 64205 + SPELL_PALADIN_DIVINE_SACRIFICE = 64205, + + SPELL_PALADIN_DIVINE_PURPOSE_PROC = 90174 }; // 31850 - Ardent Defender @@ -719,6 +721,74 @@ class spell_pal_sacred_shield : public SpellScriptLoader } }; +// 85256 - Templar's Verdict +/// Updated 4.3.4 +class spell_pal_templar_s_verdict : public SpellScriptLoader +{ + public: + spell_pal_templar_s_verdict() : SpellScriptLoader("spell_pal_templar_s_verdict") { } + + class spell_pal_templar_s_verdict_SpellScript : public SpellScript + { + PrepareSpellScript(spell_pal_templar_s_verdict_SpellScript); + + bool Validate (SpellInfo const* /*spellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_DIVINE_PURPOSE_PROC)) + return false; + + return true; + } + + bool Load() + { + if (GetCaster()->GetTypeId() != TYPEID_PLAYER) + return false; + + if (GetCaster()->ToPlayer()->getClass() != CLASS_PALADIN) + return false; + + return true; + } + + void ChangeDamage(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + int32 damage = GetHitDamage(); + + if (caster->HasAura(SPELL_PALADIN_DIVINE_PURPOSE_PROC)) + damage *= 7.5; // 7.5*30% = 225% + else + { + switch (caster->GetPower(POWER_HOLY_POWER)) + { + case 0: // 1 Holy Power + damage = damage; + break; + case 1: // 2 Holy Power + damage *= 3; // 3*30 = 90% + break; + case 2: // 3 Holy Power + damage *= 7.5; // 7.5*30% = 225% + break; + } + } + + SetHitDamage(damage); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_pal_templar_s_verdict_SpellScript::ChangeDamage, EFFECT_0, SPELL_EFFECT_WEAPON_PERCENT_DAMAGE); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_pal_templar_s_verdict_SpellScript(); + } +}; + void AddSC_paladin_spell_scripts() { //new spell_pal_ardent_defender(); @@ -733,4 +803,5 @@ void AddSC_paladin_spell_scripts() new spell_pal_lay_on_hands(); new spell_pal_righteous_defense(); new spell_pal_sacred_shield(); + new spell_pal_templar_s_verdict(); } -- cgit v1.2.3 From 11c1eeceed9c16d9ac08ff3aba41046e11899dfb Mon Sep 17 00:00:00 2001 From: Nay Date: Wed, 23 Jan 2013 00:35:05 +0000 Subject: Tools/vmap4_extractor: do not add gcc/clang compile flags when using MSVC and fix a little warning --- src/tools/vmap4_extractor/CMakeLists.txt | 2 +- src/tools/vmap4_extractor/wdtfile.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/tools/vmap4_extractor/CMakeLists.txt b/src/tools/vmap4_extractor/CMakeLists.txt index f5439076e93..201f32ab630 100644 --- a/src/tools/vmap4_extractor/CMakeLists.txt +++ b/src/tools/vmap4_extractor/CMakeLists.txt @@ -15,7 +15,7 @@ file(GLOB_RECURSE sources *.cpp *.h) add_definitions("-DIOMAP_DEBUG") # build setup currently only supports libmpq 0.4.x -if( NOT WIN32 ) +if( NOT MSVC ) add_definitions("-Wall") add_definitions("-ggdb") add_definitions("-O3") diff --git a/src/tools/vmap4_extractor/wdtfile.cpp b/src/tools/vmap4_extractor/wdtfile.cpp index c1af5b5788d..3e503259c83 100644 --- a/src/tools/vmap4_extractor/wdtfile.cpp +++ b/src/tools/vmap4_extractor/wdtfile.cpp @@ -37,7 +37,7 @@ WDTFile::WDTFile(char* file_name, char* file_name1):WDT(WorldMpq, file_name) filename.append(file_name1,strlen(file_name1)); } -bool WDTFile::init(char */*map_id*/, unsigned int mapID) +bool WDTFile::init(char* /*map_id*/, unsigned int mapID) { if (WDT.isEof()) { -- cgit v1.2.3 From cb118cddc78c8e7adf7ddf247ba85326418a475e Mon Sep 17 00:00:00 2001 From: Tuxity Date: Wed, 23 Jan 2013 09:19:49 +0100 Subject: Core/Arenas: - You earn 180 cp when you win a match - Correctly display cp to the good currency meta - Rename a currency meta to avoid errors --- src/server/game/Battlegrounds/Battleground.cpp | 6 +++--- src/server/game/DataStores/DBCEnums.h | 2 +- src/server/game/Entities/Player/Player.cpp | 6 +++--- src/server/game/Handlers/BattleGroundHandler.cpp | 4 ++-- src/server/game/World/World.cpp | 4 ++-- src/server/worldserver/worldserver.conf.dist | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index 3dd8e01ad72..445d1295629 100644 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -938,13 +938,13 @@ void Battleground::EndBattleground(uint32 winner) UpdatePlayerScore(player, SCORE_BONUS_HONOR, GetBonusHonorFromKill(winner_kills)); if (!player->GetRandomWinner()) { - // 100cp awarded for the first rated battleground won each day - player->ModifyCurrency(CURRENCY_TYPE_CONQUEST_META_BG, BG_REWARD_WINNER_CONQUEST_FIRST); + // 100cp awarded for the first random battleground won each day + player->ModifyCurrency(CURRENCY_TYPE_CONQUEST_META_ARENA, BG_REWARD_WINNER_CONQUEST_FIRST); player->SetRandomWinner(true); } } else // 50cp awarded for each non-rated battleground won - player->ModifyCurrency(CURRENCY_TYPE_CONQUEST_META_BG, BG_REWARD_WINNER_CONQUEST_LAST ); + player->ModifyCurrency(CURRENCY_TYPE_CONQUEST_META_ARENA, BG_REWARD_WINNER_CONQUEST_LAST); player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_BG, 1); if (!guildAwarded) diff --git a/src/server/game/DataStores/DBCEnums.h b/src/server/game/DataStores/DBCEnums.h index d7ccaae9355..347e5f90916 100644 --- a/src/server/game/DataStores/DBCEnums.h +++ b/src/server/game/DataStores/DBCEnums.h @@ -530,7 +530,7 @@ enum CurrencyTypes CURRENCY_TYPE_JUSTICE_POINTS = 395, CURRENCY_TYPE_VALOR_POINTS = 396, CURRENCY_TYPE_CONQUEST_META_ARENA = 483, - CURRENCY_TYPE_CONQUEST_META_BG = 484, + CURRENCY_TYPE_CONQUEST_META_RBG = 484, }; #endif diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 89cab7d5744..1fe980f60b5 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -7342,9 +7342,9 @@ void Player::SendPvpRewards() const packet << GetCurrencyOnWeek(CURRENCY_TYPE_CONQUEST_POINTS, true); packet << GetCurrencyWeekCap(CURRENCY_TYPE_CONQUEST_META_ARENA, true); packet << GetCurrencyOnWeek(CURRENCY_TYPE_CONQUEST_META_ARENA, true); - packet << GetCurrencyOnWeek(CURRENCY_TYPE_CONQUEST_META_BG, true); + packet << GetCurrencyOnWeek(CURRENCY_TYPE_CONQUEST_META_RBG, true); packet << GetCurrencyWeekCap(CURRENCY_TYPE_CONQUEST_POINTS, true); - packet << GetCurrencyWeekCap(CURRENCY_TYPE_CONQUEST_META_BG, true); + packet << GetCurrencyWeekCap(CURRENCY_TYPE_CONQUEST_META_RBG, true); GetSession()->SendPacket(&packet); } @@ -7559,7 +7559,7 @@ uint32 Player::_GetCurrencyWeekCap(const CurrencyTypesEntry* currency) const case CURRENCY_TYPE_CONQUEST_META_ARENA: // should add precision mod = 100 return Trinity::Currency::ConquestRatingCalculator(_maxPersonalArenaRate) * CURRENCY_PRECISION; - case CURRENCY_TYPE_CONQUEST_META_BG: + case CURRENCY_TYPE_CONQUEST_META_RBG: // should add precision mod = 100 return Trinity::Currency::BgConquestRatingCalculator(GetRBGPersonalRating()) * CURRENCY_PRECISION; } diff --git a/src/server/game/Handlers/BattleGroundHandler.cpp b/src/server/game/Handlers/BattleGroundHandler.cpp index 7dfc8b94090..71c5da9af2b 100644 --- a/src/server/game/Handlers/BattleGroundHandler.cpp +++ b/src/server/game/Handlers/BattleGroundHandler.cpp @@ -792,7 +792,7 @@ void WorldSession::HandleRequestRatedBgInfo(WorldPacket & recvData) uint8 unk; recvData >> unk; - sLog->outDebug(LOG_FILTER_BATTLEGROUND, "WorldSession::HandleRequestRatedBgInfo: get unk = %u", unk); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "WorldSession::HandleRequestRatedBgInfo: unk = %u", unk); /// @Todo: perfome research in this case /// The unk fields are related to arenas @@ -852,7 +852,7 @@ void WorldSession::HandleRequestRatedBgStats(WorldPacket& /*recvData*/) data << uint8(3); // unk data << uint32(0); // unk data << uint32(0); // unk - data << _player->GetCurrencyWeekCap(CURRENCY_TYPE_CONQUEST_META_BG, true); + data << _player->GetCurrencyWeekCap(CURRENCY_TYPE_CONQUEST_META_RBG, true); data << uint32(0); // unk data << uint32(0); // unk data << _player->GetCurrency(CURRENCY_TYPE_CONQUEST_POINTS, true); diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 6f76363cf84..4b027e9ebbf 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -844,11 +844,11 @@ void World::LoadConfigSettings(bool reload) } m_int_configs[CONFIG_CURRENCY_CONQUEST_POINTS_WEEK_CAP] *= 100; //precision mod - m_int_configs[CONFIG_CURRENCY_CONQUEST_POINTS_ARENA_REWARD] = ConfigMgr::GetIntDefault("Currency.ConquestPointsArenaReward", 150); + m_int_configs[CONFIG_CURRENCY_CONQUEST_POINTS_ARENA_REWARD] = ConfigMgr::GetIntDefault("Currency.ConquestPointsArenaReward", 180); if (int32(m_int_configs[CONFIG_CURRENCY_CONQUEST_POINTS_ARENA_REWARD]) <= 0) { sLog->outError(LOG_FILTER_SERVER_LOADING, "Currency.ConquestPointsArenaReward (%i) must be > 0, set to default 180.", m_int_configs[CONFIG_CURRENCY_CONQUEST_POINTS_ARENA_REWARD]); - m_int_configs[CONFIG_CURRENCY_CONQUEST_POINTS_ARENA_REWARD] = 150; + m_int_configs[CONFIG_CURRENCY_CONQUEST_POINTS_ARENA_REWARD] = 180; } m_int_configs[CONFIG_CURRENCY_CONQUEST_POINTS_ARENA_REWARD] *= 100; //precision mod diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index af8f61ce7f3..f241b4d1b23 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -2942,10 +2942,10 @@ Currency.ConquestPointsDefaultWeekCap = 1350 # # Currency.ConquestPointsArenaReward # Amount of conquest points rewarded by winning arenas -# Default: 150 +# Default: 180 # -Currency.ConquestPointsArenaReward = 150 +Currency.ConquestPointsArenaReward = 180 # ################################################################################################### -- cgit v1.2.3 From b1cdb5bb68f4eb7e99f3cdd308d07877d4ded09d Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 24 Jan 2013 02:24:32 +0000 Subject: Core/Chat: Fix parse handler for CMSG_MESSAGECHAT_ADDON_GUILD and CMSG_MESSAGECHAT_ADDON_BATTLEGROUND --- src/server/game/Handlers/ChatHandler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cpp index 89dbe03703a..1105886813a 100644 --- a/src/server/game/Handlers/ChatHandler.cpp +++ b/src/server/game/Handlers/ChatHandler.cpp @@ -583,10 +583,10 @@ void WorldSession::HandleAddonMessagechatOpcode(WorldPacket& recvData) case CHAT_MSG_GUILD: case CHAT_MSG_BATTLEGROUND: { - uint32 prefixLen = recvData.ReadBits(5); uint32 msgLen = recvData.ReadBits(9); - prefix = recvData.ReadString(prefixLen); + uint32 prefixLen = recvData.ReadBits(5); message = recvData.ReadString(msgLen); + prefix = recvData.ReadString(prefixLen); break; } default: -- cgit v1.2.3 From 2169c644b9a5b768d2291061f5bb2276d426b6e1 Mon Sep 17 00:00:00 2001 From: Shocker Date: Thu, 24 Jan 2013 06:24:03 +0200 Subject: Core/Spells: Actually remove code for dispel effects check (ref bff076bd2ae3ae091390989276b8a31ab7acfcfe) --- src/server/game/Spells/Spell.cpp | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'src') diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 507e755ce9d..2619ef0eeb6 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -5068,20 +5068,6 @@ SpellCastResult Spell::CheckCast(bool strict) } } - // Updated 4.3.4. Dispel effects can always be cast (even when there's nothing to dispel). - /* - if (!hasNonDispelEffect && !hasDispellableAura && dispelMask && !IsTriggered()) - { - if (Unit* target = m_targets.GetUnitTarget()) - { - DispelChargesList dispelList; - target->GetDispellableAuraList(m_caster, dispelMask, dispelList); - if (dispelList.empty()) - return SPELL_FAILED_NOTHING_TO_DISPEL; - } - } - */ - for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { // for effects of spells that have only one target -- cgit v1.2.3 From 6dc9b4cc4474a00e801339d39f44e572e68ab757 Mon Sep 17 00:00:00 2001 From: Shocker Date: Thu, 24 Jan 2013 07:20:19 +0200 Subject: Core/Guild: Fix guild bank money withdraw update --- src/server/shared/Database/Implementation/CharacterDatabase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index e89067e3892..64110c8a8ce 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -211,7 +211,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() PrepareStatement(CHAR_INS_GUILD_MEMBER_WITHDRAW, "INSERT INTO guild_member_withdraw (guid, tab0, tab1, tab2, tab3, tab4, tab5, tab6, tab7, money) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) " - "ON DUPLICATE KEY UPDATE tab0 = VALUES (tab0), tab1 = VALUES (tab1), tab2 = VALUES (tab2), tab3 = VALUES (tab3), tab4 = VALUES (tab4), tab5 = VALUES (tab5), tab6 = VALUES (tab6), tab7 = VALUES (tab7)", CONNECTION_ASYNC); + "ON DUPLICATE KEY UPDATE tab0 = VALUES (tab0), tab1 = VALUES (tab1), tab2 = VALUES (tab2), tab3 = VALUES (tab3), tab4 = VALUES (tab4), tab5 = VALUES (tab5), tab6 = VALUES (tab6), tab7 = VALUES (tab7), money = VALUES (money)", CONNECTION_ASYNC); PrepareStatement(CHAR_DEL_GUILD_MEMBER_WITHDRAW, "TRUNCATE guild_member_withdraw", CONNECTION_ASYNC); // 0: uint32, 1: uint32, 2: uint32 -- cgit v1.2.3 From a3d07b5e6ac45c23ec4116028c4bccae9307083b Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 26 Jan 2013 13:25:06 +0100 Subject: Core/Spells: Fixed Darkflight, Two Forms and Running Wild for worgens. Closes #8905 --- .../2013_01_26_00_world_spell_script_names_434.sql | 7 + src/server/game/Spells/Auras/SpellAuraEffects.cpp | 34 ++--- src/server/scripts/Spells/spell_generic.cpp | 157 +++++++++++++++++++++ 3 files changed, 181 insertions(+), 17 deletions(-) create mode 100644 sql/updates/world/2013_01_26_00_world_spell_script_names_434.sql (limited to 'src') diff --git a/sql/updates/world/2013_01_26_00_world_spell_script_names_434.sql b/sql/updates/world/2013_01_26_00_world_spell_script_names_434.sql new file mode 100644 index 00000000000..d0c4a61c422 --- /dev/null +++ b/sql/updates/world/2013_01_26_00_world_spell_script_names_434.sql @@ -0,0 +1,7 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_gen_running_wild'; +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_gen_two_forms'; +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_gen_darkflight'; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(87840,'spell_gen_running_wild'), +(68996,'spell_gen_two_forms'), +(68992,'spell_gen_darkflight'); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 186cdb8c552..18128660436 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -2774,6 +2774,8 @@ void AuraEffect::HandleAuraMounted(AuraApplication const* aurApp, uint8 mode, bo if (apply) { uint32 creatureEntry = GetMiscValue(); + uint32 displayId = 0; + uint32 vehicleId = 0; // Festive Holiday Mount if (target->HasAura(62061)) @@ -2784,30 +2786,28 @@ void AuraEffect::HandleAuraMounted(AuraApplication const* aurApp, uint8 mode, bo creatureEntry = 15665; } - CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate(creatureEntry); - if (!ci) + if (CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate(creatureEntry)) { - sLog->outError(LOG_FILTER_SQL, "AuraMounted: `creature_template`='%u' not found in database (only need its modelid)", GetMiscValue()); - return; - } + uint32 team = 0; + if (target->GetTypeId() == TYPEID_PLAYER) + team = target->ToPlayer()->GetTeam(); - uint32 team = 0; - if (target->GetTypeId() == TYPEID_PLAYER) - team = target->ToPlayer()->GetTeam(); + displayId = ObjectMgr::ChooseDisplayId(team, ci); + sObjectMgr->GetCreatureModelRandomGender(&displayId); - uint32 displayID = ObjectMgr::ChooseDisplayId(team, ci); - sObjectMgr->GetCreatureModelRandomGender(&displayID); + vehicleId = ci->VehicleId; - //some spell has one aura of mount and one of vehicle - for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i) - if (GetSpellInfo()->Effects[i].Effect == SPELL_EFFECT_SUMMON - && GetSpellInfo()->Effects[i].MiscValue == GetMiscValue()) - displayID = 0; + //some spell has one aura of mount and one of vehicle + for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i) + if (GetSpellInfo()->Effects[i].Effect == SPELL_EFFECT_SUMMON + && GetSpellInfo()->Effects[i].MiscValue == GetMiscValue()) + displayId = 0; + } - target->Mount(displayID, ci->VehicleId, GetMiscValue()); + target->Mount(displayId, vehicleId, creatureEntry); // cast speed aura - if (MountCapabilityEntry const* mountCapability = target->GetMountCapability(uint32(GetMiscValueB()))) + if (MountCapabilityEntry const* mountCapability = sMountCapabilityStore.LookupEntry(GetAmount())) target->CastSpell(target, mountCapability->SpeedModSpell, true); } else diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 54cb346a033..d1d4f660172 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -3163,6 +3163,160 @@ class spell_gen_replenishment : public SpellScriptLoader } }; +enum RunningWildMountIds +{ + RUNNING_WILD_MODEL_MALE = 29422, + RUNNING_WILD_MODEL_FEMALE = 29423, + SPELL_ALTERED_FORM = 97709, +}; + +class spell_gen_running_wild : public SpellScriptLoader +{ + public: + spell_gen_running_wild() : SpellScriptLoader("spell_gen_running_wild") { } + + class spell_gen_running_wild_AuraScript : public AuraScript + { + PrepareAuraScript(spell_gen_running_wild_AuraScript); + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sCreatureDisplayInfoStore.LookupEntry(RUNNING_WILD_MODEL_MALE)) + return false; + if (!sCreatureDisplayInfoStore.LookupEntry(RUNNING_WILD_MODEL_FEMALE)) + return false; + return true; + } + + void HandleMount(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + PreventDefaultAction(); + + target->Mount(target->getGender() == GENDER_FEMALE ? RUNNING_WILD_MODEL_FEMALE : RUNNING_WILD_MODEL_MALE, 0, 0); + + // cast speed aura + if (MountCapabilityEntry const* mountCapability = sMountCapabilityStore.LookupEntry(aurEff->GetAmount())) + target->CastSpell(target, mountCapability->SpeedModSpell, TRIGGERED_FULL_MASK); + } + + void Register() + { + OnEffectApply += AuraEffectApplyFn(spell_gen_running_wild_AuraScript::HandleMount, EFFECT_1, SPELL_AURA_MOUNTED, AURA_EFFECT_HANDLE_REAL); + } + }; + + class spell_gen_running_wild_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_running_wild_SpellScript); + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_ALTERED_FORM)) + return false; + return true; + } + + bool Load() + { + // Definitely not a good thing, but currently the only way to do something at cast start + // Should be replaced as soon as possible with a new hook: BeforeCastStart + GetCaster()->CastSpell(GetCaster(), SPELL_ALTERED_FORM, TRIGGERED_FULL_MASK); + return false; + } + + void Register() + { + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_gen_running_wild_AuraScript(); + } + + SpellScript* GetSpellScript() const + { + return new spell_gen_running_wild_SpellScript(); + } +}; + +class spell_gen_two_forms : public SpellScriptLoader +{ + public: + spell_gen_two_forms() : SpellScriptLoader("spell_gen_two_forms") { } + + class spell_gen_two_forms_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_two_forms_SpellScript); + + SpellCastResult CheckCast() + { + if (GetCaster()->isInCombat()) + { + SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_CANT_TRANSFORM); + return SPELL_FAILED_CUSTOM_ERROR; + } + + // Player cannot transform to human form if he is forced to be worgen for some reason (Darkflight) + if (GetCaster()->GetAuraEffectsByType(SPELL_AURA_WORGEN_ALTERED_FORM).size() > 1) + { + SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_CANT_TRANSFORM); + return SPELL_FAILED_CUSTOM_ERROR; + } + + return SPELL_CAST_OK; + } + + void HandleTransform(SpellEffIndex effIndex) + { + Unit* target = GetHitUnit(); + PreventHitDefaultEffect(effIndex); + if (target->HasAuraType(SPELL_AURA_WORGEN_ALTERED_FORM)) + target->RemoveAurasByType(SPELL_AURA_WORGEN_ALTERED_FORM); + else // Basepoints 1 for this aura control whether to trigger transform transition animation or not. + target->CastCustomSpell(SPELL_ALTERED_FORM, SPELLVALUE_BASE_POINT0, 1, target, TRIGGERED_FULL_MASK); + } + + void Register() + { + OnCheckCast += SpellCheckCastFn(spell_gen_two_forms_SpellScript::CheckCast); + OnEffectHitTarget += SpellEffectFn(spell_gen_two_forms_SpellScript::HandleTransform, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_gen_two_forms_SpellScript(); + } +}; + +class spell_gen_darkflight : public SpellScriptLoader +{ + public: + spell_gen_darkflight() : SpellScriptLoader("spell_gen_darkflight") { } + + class spell_gen_darkflight_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_darkflight_SpellScript); + + void TriggerTransform() + { + GetCaster()->CastSpell(GetCaster(), SPELL_ALTERED_FORM, TRIGGERED_FULL_MASK); + } + + void Register() + { + AfterCast += SpellCastFn(spell_gen_darkflight_SpellScript::TriggerTransform); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_gen_darkflight_SpellScript(); + } +}; + void AddSC_generic_spell_scripts() { new spell_gen_absorb0_hitlimit1(); @@ -3243,4 +3397,7 @@ void AddSC_generic_spell_scripts() new spell_gen_increase_stats_buff("spell_mage_arcane_brilliance"); new spell_gen_increase_stats_buff("spell_mage_dalaran_brilliance"); new spell_gen_replenishment(); + new spell_gen_running_wild(); + new spell_gen_two_forms(); + new spell_gen_darkflight(); } -- cgit v1.2.3 From 98f01c2b12e6a2aeef8b2f9810e5a3cce9d5e475 Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 28 Jan 2013 02:54:27 +0000 Subject: Core/Misc: Fix compile errors introduced in previous merge There are probably other merge issues that got through, please report them --- src/server/game/Battlegrounds/Battleground.cpp | 6 ++- src/server/game/Handlers/BattleGroundHandler.cpp | 4 +- .../MovementGenerators/RandomMovementGenerator.cpp | 2 +- src/server/game/Movement/Spline/MoveSplineInit.cpp | 57 +++++++++++----------- .../scripts/Kalimdor/Firelands/boss_alysrazor.cpp | 2 +- src/server/scripts/Spells/spell_mage.cpp | 6 +-- src/server/scripts/Spells/spell_priest.cpp | 3 +- src/server/scripts/Spells/spell_warlock.cpp | 46 +++++++++++++---- src/server/scripts/Spells/spell_warrior.cpp | 41 ---------------- src/tools/CMakeLists.txt | 2 +- src/tools/map_extractor/System.cpp | 2 +- 11 files changed, 81 insertions(+), 90 deletions(-) (limited to 'src') diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index e2ae9f50452..445d1295629 100644 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -973,7 +973,7 @@ void Battleground::EndBattleground(uint32 winner) player->GetSession()->SendPacket(&pvpLogData); WorldPacket data; - sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, this, player, player->GetBattlegroundQueueIndex(bgQueueTypeId), STATUS_IN_PROGRESS, TIME_TO_AUTOREMOVE, player->GetBattlegroundQueueJoinTime(GetTypeID()), GetElapsedTime(), GetArenaType()); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, this, player, player->GetBattlegroundQueueIndex(bgQueueTypeId), STATUS_IN_PROGRESS, player->GetBattlegroundQueueJoinTime(GetTypeID()), GetElapsedTime(), GetArenaType()); player->GetSession()->SendPacket(&data); player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_BATTLEGROUND, 1); @@ -1204,9 +1204,13 @@ void Battleground::AddPlayer(Player* player) sBattlegroundMgr->BuildPlayerJoinedBattlegroundPacket(&data, player->GetGUID()); SendPacketToTeam(team, &data, player, false); + // BG Status packet + BattlegroundQueueTypeId bgQueueTypeId = sBattlegroundMgr->BGQueueTypeId(m_TypeID, GetArenaType()); + uint32 queueSlot = player->GetBattlegroundQueueIndex(bgQueueTypeId); sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, this, player, queueSlot, STATUS_IN_PROGRESS, player->GetBattlegroundQueueJoinTime(m_TypeID), GetElapsedTime(), GetArenaType()); player->GetSession()->SendPacket(&data); + player->RemoveAurasByType(SPELL_AURA_MOUNTED); // add arena specific auras diff --git a/src/server/game/Handlers/BattleGroundHandler.cpp b/src/server/game/Handlers/BattleGroundHandler.cpp index d28b67106c4..9955879d37a 100644 --- a/src/server/game/Handlers/BattleGroundHandler.cpp +++ b/src/server/game/Handlers/BattleGroundHandler.cpp @@ -538,7 +538,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData) _player->CleanupAfterTaxiFlight(); } - sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_IN_PROGRESS, 0, bg->GetStartTime(), bg->GetArenaType(), ginfo.Team); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, _player, queueSlot, STATUS_IN_PROGRESS, _player->GetBattlegroundQueueJoinTime(bgTypeId), bg->GetElapsedTime(), bg->GetArenaType()); _player->GetSession()->SendPacket(&data); // remove battleground queue status from BGmgr @@ -622,7 +622,7 @@ void WorldSession::HandleBattlefieldStatusOpcode(WorldPacket & /*recvData*/) { // this line is checked, i only don't know if GetElapsedTime() is changing itself after bg end! // send status in Battleground - sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, i, STATUS_IN_PROGRESS, bg->GetEndTime(), bg->GetStartTime(), arenaType, _player->GetBGTeam()); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, GetPlayer(), i, STATUS_IN_PROGRESS, _player->GetBattlegroundQueueJoinTime(bgTypeId), bg->GetElapsedTime(), arenaType); SendPacket(&data); continue; } diff --git a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp index 67136792fa6..723b0748494 100644 --- a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp @@ -165,7 +165,7 @@ bool RandomMovementGenerator::GetResetPos(Creature* creature, float& x creature->GetRespawnPosition(x, y, z, NULL, &radius); // use current if in range - if (creature.IsWithinDist2d(x, y, radius)) + if (creature->IsWithinDist2d(x, y, radius)) creature->GetPosition(x, y, z); return true; diff --git a/src/server/game/Movement/Spline/MoveSplineInit.cpp b/src/server/game/Movement/Spline/MoveSplineInit.cpp index a8ae40926b8..f7d876d7aa3 100644 --- a/src/server/game/Movement/Spline/MoveSplineInit.cpp +++ b/src/server/game/Movement/Spline/MoveSplineInit.cpp @@ -60,23 +60,22 @@ namespace Movement int32 MoveSplineInit::Launch() { - MoveSpline& move_spline = *unit.movespline; + MoveSpline& move_spline = *unit->movespline; - Location real_position(unit.GetPositionX(), unit.GetPositionY(), unit.GetPositionZMinusOffset(), unit.GetOrientation()); + Location real_position(unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZMinusOffset(), unit->GetOrientation()); // Elevators also use MOVEMENTFLAG_ONTRANSPORT but we do not keep track of their position changes - if (unit->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) && unit.GetTransGUID()) + if (unit->GetTransGUID()) { - transport = true; - real_position.x = unit.GetTransOffsetX(); - real_position.y = unit.GetTransOffsetY(); - real_position.z = unit.GetTransOffsetZ(); - real_position.orientation = unit.GetTransOffsetO(); + real_position.x = unit->GetTransOffsetX(); + real_position.y = unit->GetTransOffsetY(); + real_position.z = unit->GetTransOffsetZ(); + real_position.orientation = unit->GetTransOffsetO(); } // there is a big chance that current position is unknown if current state is not finalized, need compute it - // this also allows CalculatePath spline position and update map position in much greater intervals + // this also allows calculate spline position and update map position in much greater intervals // Don't compute for transport movement if the unit is in a motion between two transports - if (!move_spline.Finalized() && move_spline.onTransport == (unit.GetTransGUID() != 0)) + if (!move_spline.Finalized() && move_spline.onTransport == (unit->GetTransGUID() != 0)) real_position = move_spline.ComputePosition(); // should i do the things that user should do? - no. @@ -86,7 +85,7 @@ namespace Movement // correct first vertex args.path[0] = real_position; args.initialOrientation = real_position.orientation; - move_spline.onTransport = (unit.GetTransGUID() != 0); + move_spline.onTransport = (unit->GetTransGUID() != 0); uint32 moveFlags = unit->m_movementInfo.GetMovementFlags(); if (args.flags.walkmode) @@ -105,27 +104,27 @@ namespace Movement if (moveFlags & MOVEMENTFLAG_ROOT) moveFlags &= ~MOVEMENTFLAG_MASK_MOVING; - unit.m_movementInfo.SetMovementFlags(moveFlags); + unit->m_movementInfo.SetMovementFlags(moveFlags); move_spline.Initialize(args); WorldPacket data(SMSG_MONSTER_MOVE, 64); data.append(unit->GetPackGUID()); - if (unit.GetTransGUID()) + if (unit->GetTransGUID()) { data.SetOpcode(SMSG_MONSTER_MOVE_TRANSPORT); - data.appendPackGUID(unit.GetTransGUID()); - data << int8(unit.GetTransSeat()); + data.appendPackGUID(unit->GetTransGUID()); + data << int8(unit->GetTransSeat()); } PacketBuilder::WriteMonsterMove(move_spline, data); - unit->SendMessageToSet(&data,true); - + unit->SendMessageToSet(&data, true); + return move_spline.Duration(); } void MoveSplineInit::Stop() { - MoveSpline& move_spline = *unit.movespline; + MoveSpline& move_spline = *unit->movespline; // No need to stop if we are not moving if (move_spline.Finalized()) @@ -133,30 +132,30 @@ namespace Movement Location loc = move_spline.ComputePosition(); args.flags = MoveSplineFlag::Done; - unit.m_movementInfo.RemoveMovementFlag(MOVEMENTFLAG_FORWARD); + unit->m_movementInfo.RemoveMovementFlag(MOVEMENTFLAG_FORWARD); move_spline.Initialize(args); WorldPacket data(SMSG_MONSTER_MOVE, 64); - data.append(unit.GetPackGUID()); - if (unit.GetTransGUID()) + data.append(unit->GetPackGUID()); + if (unit->GetTransGUID()) { data.SetOpcode(SMSG_MONSTER_MOVE_TRANSPORT); - data.appendPackGUID(unit.GetTransGUID()); - data << int8(unit.GetTransSeat()); + data.appendPackGUID(unit->GetTransGUID()); + data << int8(unit->GetTransSeat()); } PacketBuilder::WriteStopMovement(loc, args.splineId, data); - unit.SendMessageToSet(&data, true); + unit->SendMessageToSet(&data, true); } - MoveSplineInit::MoveSplineInit(Unit& m) : unit(m) + MoveSplineInit::MoveSplineInit(Unit* m) : unit(m) { args.splineId = splineIdGen.NewId(); // Elevators also use MOVEMENTFLAG_ONTRANSPORT but we do not keep track of their position changes - args.TransformForTransport = unit.HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) && unit->GetTransGUID(); + args.TransformForTransport = unit->GetTransGUID(); // mix existing state into new - args.flags.walkmode = unit.m_movementInfo.HasMovementFlag(MOVEMENTFLAG_WALKING); - args.flags.flying = unit.m_movementInfo.HasMovementFlag(MOVEMENTFLAG_CAN_FLY | MOVEMENTFLAG_DISABLE_GRAVITY); + args.flags.walkmode = unit->m_movementInfo.HasMovementFlag(MOVEMENTFLAG_WALKING); + args.flags.flying = unit->m_movementInfo.HasMovementFlag(MovementFlags(MOVEMENTFLAG_CAN_FLY | MOVEMENTFLAG_DISABLE_GRAVITY)); args.flags.smoothGroundPath = true; // enabled by default, CatmullRom mode or client config "pathSmoothing" will disable this } @@ -202,7 +201,7 @@ namespace Movement void MoveSplineInit::SetFall() { args.flags.EnableFalling(); - args.flags.fallingSlow = unit.HasUnitMovementFlag(MOVEMENTFLAG_FALLING_SLOW); + args.flags.fallingSlow = unit->HasUnitMovementFlag(MOVEMENTFLAG_FALLING_SLOW); } Vector3 TransportPathTransform::operator()(Vector3 input) diff --git a/src/server/scripts/Kalimdor/Firelands/boss_alysrazor.cpp b/src/server/scripts/Kalimdor/Firelands/boss_alysrazor.cpp index 1dc70c5e505..b7816242afc 100644 --- a/src/server/scripts/Kalimdor/Firelands/boss_alysrazor.cpp +++ b/src/server/scripts/Kalimdor/Firelands/boss_alysrazor.cpp @@ -298,7 +298,7 @@ class npc_blazing_monstrosity : public CreatureScript passenger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); // Hack to relocate vehicle on vehicle so exiting players are not moved under map - Movement::MoveSplineInit init(*passenger); + Movement::MoveSplineInit init(passenger); init.DisableTransportPathTransformations(); init.MoveTo(0.6654003f, 0.0f, 1.9815f); init.SetFacing(0.0f); diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index e14327b0f36..7bd1753116b 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -688,7 +688,7 @@ class spell_mage_mage_ward : public SpellScriptLoader if (AuraEffect* aurEff = GetTarget()->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_GENERIC, ICON_MAGE_INCANTER_S_ABSORPTION, EFFECT_0)) { int32 bp = CalculatePct(absorbAmount, aurEff->GetAmount()); - GetTarget()->CastCustomSpell(GetTarget(), SPELL_MAGE_INCANTER_S_ABSORPTION_TRIGGERED, &bp, NULL, NULL, true); + GetTarget()->CastCustomSpell(GetTarget(), SPELL_MAGE_INCANTERS_ABSORBTION_TRIGGERED, &bp, NULL, NULL, true); } } @@ -720,14 +720,14 @@ class spell_mage_mana_shield : public SpellScriptLoader if (AuraEffect* aurEff = GetTarget()->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_GENERIC, ICON_MAGE_INCANTER_S_ABSORPTION, EFFECT_0)) { int32 bp = CalculatePct(absorbAmount, aurEff->GetAmount()); - GetTarget()->CastCustomSpell(GetTarget(), SPELL_MAGE_INCANTER_S_ABSORPTION_TRIGGERED, &bp, NULL, NULL, true); + GetTarget()->CastCustomSpell(GetTarget(), SPELL_MAGE_INCANTERS_ABSORBTION_TRIGGERED, &bp, NULL, NULL, true); } } void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_ENEMY_SPELL) - GetTarget()->CastSpell(GetTarget(), SPELL_MAGE_INCANTER_S_ABSORPTION_KNOCKBACK, true); + GetTarget()->CastSpell(GetTarget(), SPELL_MAGE_INCANTERS_ABSORBTION_R1, true); } void Register() diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index 94b12818626..c2bfc913893 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -54,8 +54,9 @@ enum PriestSpells enum PriestSpellIcons { + PRIEST_ICON_ID_BORROWED_TIME = 2899, PRIEST_ICON_ID_EMPOWERED_RENEW_TALENT = 3021, - PRIEST_ICON_ID_PAIN_AND_SUFFERING = 2874 + PRIEST_ICON_ID_PAIN_AND_SUFFERING = 2874, }; // -47509 - Divine Aegis diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 31833524861..df415a7bb08 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -29,28 +29,29 @@ enum WarlockSpells { SPELL_WARLOCK_BANE_OF_DOOM_EFFECT = 18662, + SPELL_WARLOCK_CURSE_OF_DOOM_EFFECT = 18662, + SPELL_WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST = 62388, SPELL_WARLOCK_DEMONIC_CIRCLE_SUMMON = 48018, SPELL_WARLOCK_DEMONIC_CIRCLE_TELEPORT = 48020, - SPELL_WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST = 62388, - SPELL_WARLOCK_DEMONIC_EMPOWERMENT_SUCCUBUS = 54435, - SPELL_WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER = 54443, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_FELGUARD = 54508, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_FELHUNTER = 54509, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_IMP = 54444, + SPELL_WARLOCK_DEMONIC_EMPOWERMENT_SUCCUBUS = 54435, + SPELL_WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER = 54443, SPELL_WARLOCK_FEL_SYNERGY_HEAL = 54181, SPELL_WARLOCK_GLYPH_OF_SIPHON_LIFE = 63106, + SPELL_WARLOCK_HAUNT = 48181, + SPELL_WARLOCK_HAUNT_HEAL = 48210, SPELL_WARLOCK_IMPROVED_HEALTHSTONE_R1 = 18692, SPELL_WARLOCK_IMPROVED_HEALTHSTONE_R2 = 18693, - SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_R1 = 18703, - SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_R2 = 18704, SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R1 = 60955, SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R2 = 60956, - SPELL_WARLOCK_HAUNT = 48181, - SPELL_WARLOCK_HAUNT_HEAL = 48210, + SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_R1 = 18703, + SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_R2 = 18704, SPELL_WARLOCK_LIFE_TAP_ENERGIZE = 31818, SPELL_WARLOCK_LIFE_TAP_ENERGIZE_2 = 32553, - SPELL_WARLOCK_SOULSHATTER = 32835, SPELL_WARLOCK_SIPHON_LIFE_HEAL = 63106, + SPELL_WARLOCK_SOULSHATTER = 32835, SPELL_WARLOCK_UNSTABLE_AFFLICTION_DISPEL = 31117 }; @@ -647,6 +648,34 @@ class spell_warl_life_tap : public SpellScriptLoader } }; +// 18541 - Ritual of Doom Effect +class spell_warl_ritual_of_doom_effect : public SpellScriptLoader +{ + public: + spell_warl_ritual_of_doom_effect() : SpellScriptLoader("spell_warl_ritual_of_doom_effect") { } + + class spell_warl_ritual_of_doom_effect_SpellScript : public SpellScript + { + PrepareSpellScript(spell_warl_ritual_of_doom_effect_SpellScript); + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + caster->CastSpell(caster, GetEffectValue(), true); + } + + void Register() + { + OnEffectHit += SpellEffectFn(spell_warl_ritual_of_doom_effect_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_warl_ritual_of_doom_effect_SpellScript(); + } +}; + // 27285 - Seed of Corruption /// Updated 4.3.4 class spell_warl_seed_of_corruption : public SpellScriptLoader @@ -846,7 +875,6 @@ void AddSC_warlock_spell_scripts() new spell_warl_bane_of_doom(); new spell_warl_banish(); new spell_warl_create_healthstone(); - new spell_warl_curse_of_doom(); new spell_warl_demonic_circle_summon(); new spell_warl_demonic_circle_teleport(); new spell_warl_demonic_empowerment(); diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index c155c39ffdb..9e2cb8aad71 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -31,7 +31,6 @@ enum WarriorSpells SPELL_WARRIOR_BLOODTHIRST = 23885, SPELL_WARRIOR_BLOODTHIRST_DAMAGE = 23881, SPELL_WARRIOR_CHARGE = 34846, - SPELL_WARRIOR_DAMAGE_SHIELD_DAMAGE = 59653, SPELL_WARRIOR_DEEP_WOUNDS_RANK_1 = 12162, SPELL_WARRIOR_DEEP_WOUNDS_RANK_2 = 12850, SPELL_WARRIOR_DEEP_WOUNDS_RANK_3 = 12868, @@ -43,7 +42,6 @@ enum WarriorSpells SPELL_WARRIOR_JUGGERNAUT_CRIT_BONUS_TALENT = 64976, SPELL_WARRIOR_LAST_STAND_TRIGGERED = 12976, SPELL_WARRIOR_SLAM = 50782, - SPELL_WARRIOR_SLAM = 50783, SPELL_WARRIOR_SWEEPING_STRIKES_EXTRA_ATTACK = 26654, SPELL_WARRIOR_TAUNT = 355, SPELL_WARRIOR_UNRELENTING_ASSAULT_RANK_1 = 46859, @@ -201,44 +199,6 @@ class spell_warr_concussion_blow : public SpellScriptLoader } }; -// -58872 - Damage Shield -class spell_warr_damage_shield : public SpellScriptLoader -{ - public: - spell_warr_damage_shield() : SpellScriptLoader("spell_warr_damage_shield") { } - - class spell_warr_damage_shield_AuraScript : public AuraScript - { - PrepareAuraScript(spell_warr_damage_shield_AuraScript); - - bool Validate(SpellInfo const* /*spellInfo*/) - { - if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_DAMAGE_SHIELD_DAMAGE)) - return false; - return true; - } - - void OnProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) - { - PreventDefaultAction(); - - // % of amount blocked - int32 damage = CalculatePct(int32(GetTarget()->GetShieldBlockValue()), aurEff->GetAmount()); - GetTarget()->CastCustomSpell(SPELL_WARRIOR_DAMAGE_SHIELD_DAMAGE, SPELLVALUE_BASE_POINT0, damage, eventInfo.GetProcTarget(), true, NULL, aurEff); - } - - void Register() - { - OnEffectProc += AuraEffectProcFn(spell_warr_damage_shield_AuraScript::OnProc, EFFECT_0, SPELL_AURA_DUMMY); - } - }; - - AuraScript* GetAuraScript() const - { - return new spell_warr_damage_shield_AuraScript(); - } -}; - /// Updated 4.3.4 class spell_warr_deep_wounds : public SpellScriptLoader { @@ -770,7 +730,6 @@ void AddSC_warrior_spell_scripts() new spell_warr_bloodthirst_heal(); new spell_warr_charge(); new spell_warr_concussion_blow(); - new spell_warr_damage_shield(); new spell_warr_deep_wounds(); new spell_warr_execute(); new spell_warr_improved_spell_reflection(); diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt index 49c17913c64..671de25dfd3 100644 --- a/src/tools/CMakeLists.txt +++ b/src/tools/CMakeLists.txt @@ -12,4 +12,4 @@ add_subdirectory(map_extractor) add_subdirectory(vmap4_assembler) add_subdirectory(vmap4_extractor) add_subdirectory(mmaps_generator) -add_subdirectory(mesh_extractor) +# add_subdirectory(mesh_extractor) diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp index 800328810a7..7b591ddfc85 100644 --- a/src/tools/map_extractor/System.cpp +++ b/src/tools/map_extractor/System.cpp @@ -901,7 +901,7 @@ bool ConvertADT(char *filename, char *filename2, int /*cell_y*/, int /*cell_x*/, { for (int j = 0; j < ADT_CELLS_PER_GRID; ++j) { - adt_MCNK * cell = cells->getMCNK(i,j); + adt_MCNK * cell = adt.cells[i][j]; if (!cell) continue; holes[i][j] = cell->holes; -- cgit v1.2.3 From 112c2a8dd0b1186fab878dcd2da8f666ae2fcdf8 Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 28 Jan 2013 12:53:51 +0000 Subject: Core/Misc: Fix a merge failure in SpellAuraEffects.cpp Thanks Tuxity and Vincent --- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 6 ------ 1 file changed, 6 deletions(-) (limited to 'src') diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index ac7f0348b84..ef0587feb53 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -538,12 +538,6 @@ int32 AuraEffect::CalculateAmount(Unit* caster) case SPELL_AURA_SCHOOL_ABSORB: case SPELL_AURA_MANA_SHIELD: m_canBeRecalculated = false; - case 57669: // Replenishment (0.2% from max) - amount = CalculatePct(GetBase()->GetUnitOwner()->GetMaxPower(POWER_MANA), amount); - break; - case 61782: // Infinite Replenishment - amount = GetBase()->GetUnitOwner()->GetMaxPower(POWER_MANA) * 0.0025f; - break; break; case SPELL_AURA_MOUNTED: if (MountCapabilityEntry const* mountCapability = GetBase()->GetUnitOwner()->GetMountCapability(uint32(GetMiscValueB()))) -- cgit v1.2.3 From 1b180e683e99078322a6f7a604a637cd6afe5b81 Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 29 Jan 2013 02:25:24 +0000 Subject: Core&DB/Trainers: Remove `trainer_spell` from `creature_template` since it is not longer necessary on Cata --- .../2013_01_29_00_world_creature_template_434.sql | 1 + src/server/game/Entities/Creature/Creature.cpp | 10 +-- src/server/game/Entities/Creature/Creature.h | 1 - src/server/game/Globals/ObjectMgr.cpp | 87 ++++++++++----------- src/server/scripts/Commands/cs_reload.cpp | 91 +++++++++++----------- .../Database/Implementation/WorldDatabase.cpp | 2 +- 6 files changed, 88 insertions(+), 104 deletions(-) create mode 100644 sql/updates/world/2013_01_29_00_world_creature_template_434.sql (limited to 'src') diff --git a/sql/updates/world/2013_01_29_00_world_creature_template_434.sql b/sql/updates/world/2013_01_29_00_world_creature_template_434.sql new file mode 100644 index 00000000000..52954b2b9f5 --- /dev/null +++ b/sql/updates/world/2013_01_29_00_world_creature_template_434.sql @@ -0,0 +1 @@ +ALTER TABLE `creature_template` DROP `trainer_spell`; diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index a2bed013640..0157cdf9130 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -925,15 +925,7 @@ bool Creature::isCanTrainingOf(Player* player, bool msg) const } break; case TRAINER_TYPE_TRADESKILLS: - if (GetCreatureTemplate()->trainer_spell && !player->HasSpell(GetCreatureTemplate()->trainer_spell)) - { - if (msg) - { - player->PlayerTalkClass->ClearMenus(); - player->PlayerTalkClass->SendGossipMenu(11031, GetGUID()); - } - return false; - } + // There's no Blacksmith specialization on Cataclysm, conditions are not required for tradeskills break; default: return false; // checked and error output at creature_template loading diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index 9ac5deb56f5..255014a7bbf 100644 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -109,7 +109,6 @@ struct CreatureTemplate uint32 dynamicflags; uint32 family; // enum CreatureFamily values (optional) uint32 trainer_type; - uint32 trainer_spell; uint32 trainer_class; uint32 trainer_race; float minrangedmg; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 05d986e3f92..c4721f3cc09 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -390,15 +390,15 @@ void ObjectMgr::LoadCreatureTemplates() "modelid4, name, subname, IconName, gossip_menu_id, minlevel, maxlevel, exp, exp_unk, faction_A, faction_H, npcflag, speed_walk, " // 22 23 24 25 26 27 28 29 30 31 32 33 34 "speed_run, scale, rank, mindmg, maxdmg, dmgschool, attackpower, dmg_multiplier, baseattacktime, rangeattacktime, unit_class, unit_flags, unit_flags2, " - // 35 36 37 38 39 40 41 42 43 44 - "dynamicflags, family, trainer_type, trainer_spell, trainer_class, trainer_race, minrangedmg, maxrangedmg, rangedattackpower, type, " - // 45 46 47 48 49 50 51 52 53 54 55 + // 35 36 37 38 39 40 41 42 43 + "dynamicflags, family, trainer_type, trainer_class, trainer_race, minrangedmg, maxrangedmg, rangedattackpower, type, " + // 44 45 46 47 48 49 50 51 52 53 54 "type_flags, type_flags2, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, " - // 56 57 58 59 60 61 62 63 64 65 66 67 68 69 + // 55 56 59 60 61 62 63 64 65 66 67 68 69 70 "spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, PetSpellDataId, VehicleId, mingold, maxgold, AIName, MovementType, " - // 70 71 72 73 74 75 76 77 78 79 80 81 + // 71 72 73 74 75 76 77 78 79 80 81 82 "InhabitType, HoverHeight, Health_mod, Mana_mod, Mana_mod_extra, Armor_mod, RacialLeader, questItem1, questItem2, questItem3, questItem4, questItem5, " - // 82 83 84 85 86 87 88 + // 83 84 85 86 87 88 89 " questItem6, movementId, RegenHealth, equipment_id, mechanic_immune_mask, flags_extra, ScriptName " "FROM creature_template;"); @@ -459,48 +459,47 @@ void ObjectMgr::LoadCreatureTemplates() creatureTemplate.dynamicflags = fields[35].GetUInt32(); creatureTemplate.family = uint32(fields[36].GetUInt8()); creatureTemplate.trainer_type = uint32(fields[37].GetUInt8()); - creatureTemplate.trainer_spell = fields[38].GetUInt32(); - creatureTemplate.trainer_class = uint32(fields[39].GetUInt8()); - creatureTemplate.trainer_race = uint32(fields[40].GetUInt8()); - creatureTemplate.minrangedmg = fields[41].GetFloat(); - creatureTemplate.maxrangedmg = fields[42].GetFloat(); - creatureTemplate.rangedattackpower = uint32(fields[43].GetUInt16()); - creatureTemplate.type = uint32(fields[44].GetUInt8()); - creatureTemplate.type_flags = fields[45].GetUInt32(); - creatureTemplate.type_flags2 = fields[46].GetUInt32(); - creatureTemplate.lootid = fields[47].GetUInt32(); - creatureTemplate.pickpocketLootId = fields[48].GetUInt32(); - creatureTemplate.SkinLootId = fields[49].GetUInt32(); + creatureTemplate.trainer_class = uint32(fields[38].GetUInt8()); + creatureTemplate.trainer_race = uint32(fields[39].GetUInt8()); + creatureTemplate.minrangedmg = fields[40].GetFloat(); + creatureTemplate.maxrangedmg = fields[41].GetFloat(); + creatureTemplate.rangedattackpower = uint32(fields[42].GetUInt16()); + creatureTemplate.type = uint32(fields[43].GetUInt8()); + creatureTemplate.type_flags = fields[44].GetUInt32(); + creatureTemplate.type_flags2 = fields[45].GetUInt32(); + creatureTemplate.lootid = fields[46].GetUInt32(); + creatureTemplate.pickpocketLootId = fields[47].GetUInt32(); + creatureTemplate.SkinLootId = fields[48].GetUInt32(); for (uint8 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i) - creatureTemplate.resistance[i] = fields[50 + i - 1].GetInt16(); + creatureTemplate.resistance[i] = fields[49 + i - 1].GetInt16(); for (uint8 i = 0; i < CREATURE_MAX_SPELLS; ++i) - creatureTemplate.spells[i] = fields[56 + i].GetUInt32(); - - creatureTemplate.PetSpellDataId = fields[64].GetUInt32(); - creatureTemplate.VehicleId = fields[65].GetUInt32(); - creatureTemplate.mingold = fields[66].GetUInt32(); - creatureTemplate.maxgold = fields[67].GetUInt32(); - creatureTemplate.AIName = fields[68].GetString(); - creatureTemplate.MovementType = uint32(fields[69].GetUInt8()); - creatureTemplate.InhabitType = uint32(fields[70].GetUInt8()); - creatureTemplate.HoverHeight = fields[71].GetFloat(); - creatureTemplate.ModHealth = fields[72].GetFloat(); - creatureTemplate.ModMana = fields[73].GetFloat(); - creatureTemplate.ModManaExtra = fields[74].GetFloat(); - creatureTemplate.ModArmor = fields[75].GetFloat(); - creatureTemplate.RacialLeader = fields[76].GetBool(); + creatureTemplate.spells[i] = fields[55 + i].GetUInt32(); + + creatureTemplate.PetSpellDataId = fields[63].GetUInt32(); + creatureTemplate.VehicleId = fields[64].GetUInt32(); + creatureTemplate.mingold = fields[65].GetUInt32(); + creatureTemplate.maxgold = fields[66].GetUInt32(); + creatureTemplate.AIName = fields[67].GetString(); + creatureTemplate.MovementType = uint32(fields[68].GetUInt8()); + creatureTemplate.InhabitType = uint32(fields[69].GetUInt8()); + creatureTemplate.HoverHeight = fields[70].GetFloat(); + creatureTemplate.ModHealth = fields[71].GetFloat(); + creatureTemplate.ModMana = fields[72].GetFloat(); + creatureTemplate.ModManaExtra = fields[73].GetFloat(); + creatureTemplate.ModArmor = fields[74].GetFloat(); + creatureTemplate.RacialLeader = fields[75].GetBool(); for (uint8 i = 0; i < MAX_CREATURE_QUEST_ITEMS; ++i) - creatureTemplate.questItems[i] = fields[77 + i].GetUInt32(); + creatureTemplate.questItems[i] = fields[76 + i].GetUInt32(); - creatureTemplate.movementId = fields[83].GetUInt32(); - creatureTemplate.RegenHealth = fields[84].GetBool(); - creatureTemplate.equipmentId = fields[85].GetUInt32(); - creatureTemplate.MechanicImmuneMask = fields[86].GetUInt32(); - creatureTemplate.flags_extra = fields[87].GetUInt32(); - creatureTemplate.ScriptID = GetScriptId(fields[88].GetCString()); + creatureTemplate.movementId = fields[82].GetUInt32(); + creatureTemplate.RegenHealth = fields[83].GetBool(); + creatureTemplate.equipmentId = fields[84].GetUInt32(); + creatureTemplate.MechanicImmuneMask = fields[85].GetUInt32(); + creatureTemplate.flags_extra = fields[86].GetUInt32(); + creatureTemplate.ScriptID = GetScriptId(fields[87].GetCString()); ++count; } @@ -662,12 +661,6 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo) continue; } - if (cInfo->trainer_spell != difficultyInfo->trainer_spell) - { - sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has different `trainer_spell` in difficulty %u mode (Entry: %u).", cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff]); - continue; - } - if (!difficultyInfo->AIName.empty()) { sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) lists difficulty %u mode entry %u with `AIName` filled in. `AIName` of difficulty 0 mode creature is always used instead.", diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp index f5f998bbf0d..52721f9866d 100644 --- a/src/server/scripts/Commands/cs_reload.cpp +++ b/src/server/scripts/Commands/cs_reload.cpp @@ -452,54 +452,53 @@ public: cInfo->dynamicflags = fields[33].GetUInt32(); cInfo->family = fields[34].GetUInt8(); cInfo->trainer_type = fields[35].GetUInt8(); - cInfo->trainer_spell = fields[36].GetUInt32(); - cInfo->trainer_class = fields[37].GetUInt8(); - cInfo->trainer_race = fields[38].GetUInt8(); - cInfo->minrangedmg = fields[39].GetFloat(); - cInfo->maxrangedmg = fields[40].GetFloat(); - cInfo->rangedattackpower = fields[41].GetUInt16(); - cInfo->type = fields[42].GetUInt8(); - cInfo->type_flags = fields[43].GetUInt32(); - cInfo->lootid = fields[44].GetUInt32(); - cInfo->pickpocketLootId = fields[45].GetUInt32(); - cInfo->SkinLootId = fields[46].GetUInt32(); + cInfo->trainer_class = fields[36].GetUInt8(); + cInfo->trainer_race = fields[37].GetUInt8(); + cInfo->minrangedmg = fields[38].GetFloat(); + cInfo->maxrangedmg = fields[39].GetFloat(); + cInfo->rangedattackpower = fields[40].GetUInt16(); + cInfo->type = fields[41].GetUInt8(); + cInfo->type_flags = fields[42].GetUInt32(); + cInfo->lootid = fields[43].GetUInt32(); + cInfo->pickpocketLootId = fields[44].GetUInt32(); + cInfo->SkinLootId = fields[45].GetUInt32(); for (uint8 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i) - cInfo->resistance[i] = fields[47 + i -1].GetUInt16(); - - cInfo->spells[0] = fields[53].GetUInt32(); - cInfo->spells[1] = fields[54].GetUInt32(); - cInfo->spells[2] = fields[55].GetUInt32(); - cInfo->spells[3] = fields[56].GetUInt32(); - cInfo->spells[4] = fields[57].GetUInt32(); - cInfo->spells[5] = fields[58].GetUInt32(); - cInfo->spells[6] = fields[59].GetUInt32(); - cInfo->spells[7] = fields[60].GetUInt32(); - cInfo->PetSpellDataId = fields[61].GetUInt32(); - cInfo->VehicleId = fields[62].GetUInt32(); - cInfo->mingold = fields[63].GetUInt32(); - cInfo->maxgold = fields[64].GetUInt32(); - cInfo->AIName = fields[65].GetString(); - cInfo->MovementType = fields[66].GetUInt8(); - cInfo->InhabitType = fields[67].GetUInt8(); - cInfo->HoverHeight = fields[68].GetFloat(); - cInfo->ModHealth = fields[69].GetFloat(); - cInfo->ModMana = fields[70].GetFloat(); - cInfo->ModManaExtra = fields[71].GetFloat(); - cInfo->ModArmor = fields[72].GetFloat(); - cInfo->RacialLeader = fields[73].GetBool(); - cInfo->questItems[0] = fields[74].GetUInt32(); - cInfo->questItems[1] = fields[75].GetUInt32(); - cInfo->questItems[2] = fields[76].GetUInt32(); - cInfo->questItems[3] = fields[77].GetUInt32(); - cInfo->questItems[4] = fields[78].GetUInt32(); - cInfo->questItems[5] = fields[79].GetUInt32(); - cInfo->movementId = fields[80].GetUInt32(); - cInfo->RegenHealth = fields[81].GetBool(); - cInfo->equipmentId = fields[82].GetUInt32(); - cInfo->MechanicImmuneMask = fields[83].GetUInt32(); - cInfo->flags_extra = fields[84].GetUInt32(); - cInfo->ScriptID = sObjectMgr->GetScriptId(fields[85].GetCString()); + cInfo->resistance[i] = fields[46 + i -1].GetUInt16(); + + cInfo->spells[0] = fields[52].GetUInt32(); + cInfo->spells[1] = fields[53].GetUInt32(); + cInfo->spells[2] = fields[54].GetUInt32(); + cInfo->spells[3] = fields[55].GetUInt32(); + cInfo->spells[4] = fields[56].GetUInt32(); + cInfo->spells[5] = fields[57].GetUInt32(); + cInfo->spells[6] = fields[58].GetUInt32(); + cInfo->spells[7] = fields[59].GetUInt32(); + cInfo->PetSpellDataId = fields[60].GetUInt32(); + cInfo->VehicleId = fields[61].GetUInt32(); + cInfo->mingold = fields[62].GetUInt32(); + cInfo->maxgold = fields[63].GetUInt32(); + cInfo->AIName = fields[64].GetString(); + cInfo->MovementType = fields[65].GetUInt8(); + cInfo->InhabitType = fields[66].GetUInt8(); + cInfo->HoverHeight = fields[67].GetFloat(); + cInfo->ModHealth = fields[68].GetFloat(); + cInfo->ModMana = fields[69].GetFloat(); + cInfo->ModManaExtra = fields[70].GetFloat(); + cInfo->ModArmor = fields[71].GetFloat(); + cInfo->RacialLeader = fields[72].GetBool(); + cInfo->questItems[0] = fields[73].GetUInt32(); + cInfo->questItems[1] = fields[74].GetUInt32(); + cInfo->questItems[2] = fields[75].GetUInt32(); + cInfo->questItems[3] = fields[76].GetUInt32(); + cInfo->questItems[4] = fields[77].GetUInt32(); + cInfo->questItems[5] = fields[78].GetUInt32(); + cInfo->movementId = fields[79].GetUInt32(); + cInfo->RegenHealth = fields[80].GetBool(); + cInfo->equipmentId = fields[81].GetUInt32(); + cInfo->MechanicImmuneMask = fields[82].GetUInt32(); + cInfo->flags_extra = fields[83].GetUInt32(); + cInfo->ScriptID = sObjectMgr->GetScriptId(fields[84].GetCString()); sObjectMgr->CheckCreatureTemplate(cInfo); } diff --git a/src/server/shared/Database/Implementation/WorldDatabase.cpp b/src/server/shared/Database/Implementation/WorldDatabase.cpp index 899ed51da0d..185ac647e33 100644 --- a/src/server/shared/Database/Implementation/WorldDatabase.cpp +++ b/src/server/shared/Database/Implementation/WorldDatabase.cpp @@ -78,7 +78,7 @@ void WorldDatabaseConnection::DoPrepareStatements() PrepareStatement(WORLD_INS_CREATURE_TRANSPORT, "INSERT INTO creature_transport (guid, npc_entry, transport_entry, TransOffsetX, TransOffsetY, TransOffsetZ, TransOffsetO) values (?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); PrepareStatement(WORLD_UPD_CREATURE_TRANSPORT_EMOTE, "UPDATE creature_transport SET emote = ? WHERE transport_entry = ? AND guid = ?", CONNECTION_ASYNC); PrepareStatement(WORLD_SEL_COMMANDS, "SELECT name, security, help FROM command", CONNECTION_SYNCH); - PrepareStatement(WORLD_SEL_CREATURE_TEMPLATE, "SELECT difficulty_entry_1, difficulty_entry_2, difficulty_entry_3, KillCredit1, KillCredit2, modelid1, modelid2, modelid3, modelid4, name, subname, IconName, gossip_menu_id, minlevel, maxlevel, exp, faction_A, faction_H, npcflag, speed_walk, speed_run, scale, rank, mindmg, maxdmg, dmgschool, attackpower, dmg_multiplier, baseattacktime, rangeattacktime, unit_class, unit_flags, unit_flags2, dynamicflags, family, trainer_type, trainer_spell, trainer_class, trainer_race, minrangedmg, maxrangedmg, rangedattackpower, type, type_flags, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, PetSpellDataId, VehicleId, mingold, maxgold, AIName, MovementType, InhabitType, HoverHeight, Health_mod, Mana_mod, Mana_mod_extra, Armor_mod, RacialLeader, questItem1, questItem2, questItem3, questItem4, questItem5, questItem6, movementId, RegenHealth, equipment_id, mechanic_immune_mask, flags_extra, ScriptName FROM creature_template WHERE entry = ?", CONNECTION_SYNCH); + PrepareStatement(WORLD_SEL_CREATURE_TEMPLATE, "SELECT difficulty_entry_1, difficulty_entry_2, difficulty_entry_3, KillCredit1, KillCredit2, modelid1, modelid2, modelid3, modelid4, name, subname, IconName, gossip_menu_id, minlevel, maxlevel, exp, faction_A, faction_H, npcflag, speed_walk, speed_run, scale, rank, mindmg, maxdmg, dmgschool, attackpower, dmg_multiplier, baseattacktime, rangeattacktime, unit_class, unit_flags, unit_flags2, dynamicflags, family, trainer_type, trainer_class, trainer_race, minrangedmg, maxrangedmg, rangedattackpower, type, type_flags, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, PetSpellDataId, VehicleId, mingold, maxgold, AIName, MovementType, InhabitType, HoverHeight, Health_mod, Mana_mod, Mana_mod_extra, Armor_mod, RacialLeader, questItem1, questItem2, questItem3, questItem4, questItem5, questItem6, movementId, RegenHealth, equipment_id, mechanic_immune_mask, flags_extra, ScriptName FROM creature_template WHERE entry = ?", CONNECTION_SYNCH); PrepareStatement(WORLD_SEL_WAYPOINT_SCRIPT_BY_ID, "SELECT guid, delay, command, datalong, datalong2, dataint, x, y, z, o FROM waypoint_scripts WHERE id = ?", CONNECTION_SYNCH); PrepareStatement(WORLD_SEL_IP2NATION_COUNTRY, "SELECT c.country FROM ip2nationCountries c, ip2nation i WHERE i.ip < ? AND c.code = i.country ORDER BY i.ip DESC LIMIT 0,1", CONNECTION_SYNCH); PrepareStatement(WORLD_SEL_ITEM_TEMPLATE_BY_NAME, "SELECT entry FROM item_template WHERE name = ?", CONNECTION_SYNCH); -- cgit v1.2.3 From d92347bc22fb213e19dcd0739e85970c1e74d319 Mon Sep 17 00:00:00 2001 From: Souler Date: Tue, 29 Jan 2013 15:10:47 +0000 Subject: Scripts/Mage: Unsummon current mage's Water Elemental before summoning a new one Closes #8433 --- src/server/scripts/Spells/spell_mage.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index 7bd1753116b..ddd65b26496 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -25,6 +25,7 @@ #include "ScriptMgr.h" #include "SpellScript.h" #include "SpellAuraEffects.h" +#include "Pet.h" enum MageSpells { @@ -904,6 +905,14 @@ class spell_mage_summon_water_elemental : public SpellScriptLoader void HandleDummy(SpellEffIndex /*effIndex*/) { Unit* caster = GetCaster(); + + if (Player* player = caster->ToPlayer()) + if (Guardian* elemental = player->GetGuardianPet()) + // Check if the pet we are going to unsummon is the mage's water elemental + if (elemental->GetEntry() == sSpellMgr->GetSpellInfo(SPELL_MAGE_SUMMON_WATER_ELEMENTAL_TEMPORARY)->Effects[EFFECT_0].MiscValue || + elemental->GetEntry() == sSpellMgr->GetSpellInfo(SPELL_MAGE_SUMMON_WATER_ELEMENTAL_PERMANENT)->Effects[EFFECT_0].MiscValue) + elemental->UnSummon(); + // Glyph of Eternal Water if (caster->HasAura(SPELL_MAGE_GLYPH_OF_ETERNAL_WATER)) caster->CastSpell(caster, SPELL_MAGE_SUMMON_WATER_ELEMENTAL_PERMANENT, true); -- cgit v1.2.3 From 92d92df80960f046cac8cde15599b510cbc34109 Mon Sep 17 00:00:00 2001 From: Nay Date: Wed, 30 Jan 2013 01:33:12 +0000 Subject: Core/Object: Re-add a line that somehow got removed in a merge Thanks Warpten for noticing --- src/server/game/Entities/Object/Object.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 53e7c3405a0..292554620e4 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -1014,6 +1014,7 @@ void Object::_SetUpdateBits(UpdateMask* updateMask, Player* target) const valCount = PLAYER_END_NOT_SELF; for (uint16 index = 0; index < valCount; ++index) + if (_fieldNotifyFlags & flags[index] || (flags[index] & UF_FLAG_SPECIAL_INFO && hasSpecialInfo) || (_changesMask.GetBit(index) && IsUpdateFieldVisible(flags[index], isSelf, isOwner, isItemOwner, isPartyMember))) updateMask->SetBit(index); } -- cgit v1.2.3 From b427068c39188474879c848ba44070ef8a1e246b Mon Sep 17 00:00:00 2001 From: Shocker Date: Wed, 30 Jan 2013 07:05:19 +0200 Subject: Core/Titles: There are now 4 title fields (only 2 titles for now, Ruthless and Cataclysmic Gladiator). Also remove some unused outdated defines WARNING! Run the SQL query before you start your emulator because it will reset all titles on login otherwise --- .../2013_01_30_00_characters_characters.sql | 2 + src/server/game/Entities/Player/Player.h | 49 +--------------------- 2 files changed, 4 insertions(+), 47 deletions(-) create mode 100644 sql/updates/characters/2013_01_30_00_characters_characters.sql (limited to 'src') diff --git a/sql/updates/characters/2013_01_30_00_characters_characters.sql b/sql/updates/characters/2013_01_30_00_characters_characters.sql new file mode 100644 index 00000000000..1ddb4c8900d --- /dev/null +++ b/sql/updates/characters/2013_01_30_00_characters_characters.sql @@ -0,0 +1,2 @@ +-- Add missing fields for new titles field +UPDATE `characters` SET knownTitles = CONCAT(knownTitles, '0 0 ') WHERE (LENGTH(knownTitles) - LENGTH(REPLACE(knownTitles, ' ', ''))) = 6; diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 511c3356b15..979dfc42040 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -531,53 +531,8 @@ enum PlayerFlags PLAYER_FLAGS_UNK31 = 0x80000000 }; -// used for PLAYER__FIELD_KNOWN_TITLES field (uint64), (1< Date: Wed, 30 Jan 2013 20:40:02 +0100 Subject: Core/Players: Improvements to currency handling. --- src/server/game/Entities/Player/Player.cpp | 220 ++++++++++++++--------------- src/server/game/Entities/Player/Player.h | 22 +-- src/server/game/Handlers/ItemHandler.cpp | 4 +- 3 files changed, 118 insertions(+), 128 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index fb8891893da..67dc948ed99 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -859,7 +859,6 @@ Player::Player(WorldSession* session): Unit(true), phaseMgr(this) _activeCheats = CHEAT_NONE; _maxPersonalArenaRate = 0; - _ConquestCurrencyTotalWeekCap = 0; memset(_voidStorageItems, 0, VOID_STORAGE_MAX_SLOT * sizeof(VoidStorageItem*)); memset(_CUFProfiles, 0, MAX_CUF_PROFILES * sizeof(CUFProfile*)); @@ -7205,14 +7204,6 @@ void Player::_LoadCurrency(PreparedQueryResult result) _currencyStorage.insert(PlayerCurrenciesMap::value_type(currencyID, cur)); - // load total conquest cap. should be after insert. - if (currency->Category == CURRENCY_CATEGORY_META_CONQUEST) - { - uint32 cap = _GetCurrencyWeekCap(currency); - if (cap > _ConquestCurrencyTotalWeekCap) - _ConquestCurrencyTotalWeekCap = cap; - } - } while (result->NextRow()); } @@ -7267,7 +7258,7 @@ void Player::SendNewCurrency(uint32 id) const uint32 precision = (entry->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? CURRENCY_PRECISION : 1; uint32 weekCount = itr->second.weekCount / precision; - uint32 weekCap = _GetCurrencyWeekCap(entry) / precision; + uint32 weekCap = GetCurrencyWeekCap(entry) / precision; packet.WriteBit(weekCount); packet.WriteBits(0, 4); // some flags @@ -7279,7 +7270,7 @@ void Player::SendNewCurrency(uint32 id) const currencyData << uint32(weekCap); //if (seasonTotal) - // currencyData << uint32(seasonTotal); + // currencyData << uint32(seasonTotal / precision); currencyData << uint32(entry->ID); if (weekCount) @@ -7308,7 +7299,7 @@ void Player::SendCurrencies() const uint32 precision = (entry->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? CURRENCY_PRECISION : 1; uint32 weekCount = itr->second.weekCount / precision; - uint32 weekCap = _GetCurrencyWeekCap(entry) / precision; + uint32 weekCap = GetCurrencyWeekCap(entry) / precision; packet.WriteBit(weekCount); packet.WriteBits(0, 4); // some flags @@ -7320,7 +7311,7 @@ void Player::SendCurrencies() const currencyData << uint32(weekCap); //if (seasonTotal) - // currencyData << uint32(seasonTotal); + // currencyData << uint32(seasonTotal / precision); currencyData << uint32(entry->ID); if (weekCount) @@ -7348,36 +7339,28 @@ void Player::SendPvpRewards() const GetSession()->SendPacket(&packet); } -uint32 Player::GetCurrency(uint32 id, bool precision) const +uint32 Player::GetCurrency(uint32 id, bool usePrecision) const { PlayerCurrenciesMap::const_iterator itr = _currencyStorage.find(id); if (itr == _currencyStorage.end()) return 0; - if (!precision) - return itr->second.totalCount; - CurrencyTypesEntry const* currency = sCurrencyTypesStore.LookupEntry(id); - ASSERT(currency); + uint32 precision = (usePrecision && currency->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? CURRENCY_PRECISION : 1; - int32 mod = currency->Flags & CURRENCY_FLAG_HIGH_PRECISION ? 100 : 1; - return itr->second.totalCount / mod; + return itr->second.totalCount / precision; } -uint32 Player::GetCurrencyOnWeek(uint32 id, bool precision) const +uint32 Player::GetCurrencyOnWeek(uint32 id, bool usePrecision) const { PlayerCurrenciesMap::const_iterator itr = _currencyStorage.find(id); if (itr == _currencyStorage.end()) return 0; - if (!precision) - return itr->second.weekCount; - CurrencyTypesEntry const* currency = sCurrencyTypesStore.LookupEntry(id); - ASSERT(currency); + uint32 precision = (usePrecision && currency->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? CURRENCY_PRECISION : 1; - int32 mod = currency->Flags & CURRENCY_FLAG_HIGH_PRECISION ? 100 : 1; - return itr->second.weekCount / mod; + return itr->second.weekCount / precision; } bool Player::HasCurrency(uint32 id, uint32 count) const @@ -7417,12 +7400,12 @@ void Player::ModifyCurrency(uint32 id, int32 count, bool printLog/* = true*/, bo } // count can't be more then weekCap if used (weekCap > 0) - uint32 weekCap = _GetCurrencyWeekCap(currency); + uint32 weekCap = GetCurrencyWeekCap(currency); if (weekCap && count > int32(weekCap)) count = weekCap; // count can't be more then totalCap if used (totalCap > 0) - uint32 totalCap = _GetCurrencyTotalCap(currency); + uint32 totalCap = GetCurrencyTotalCap(currency); if (totalCap && count > int32(totalCap)) count = totalCap; @@ -7457,44 +7440,30 @@ void Player::ModifyCurrency(uint32 id, int32 count, bool printLog/* = true*/, bo itr->second.totalCount = newTotalCount; itr->second.weekCount = newWeekCount; - // probably excessive checks - if (IsInWorld() && !GetSession()->PlayerLoading()) - { - if (count > 0) - UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CURRENCY, id, count); + if (count > 0) + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CURRENCY, id, count); - if (currency->Category == CURRENCY_CATEGORY_META_CONQUEST) - { - //original conquest cap is highest of bg/arena conquest cap. - if (weekCap > _ConquestCurrencyTotalWeekCap) - _ConquestCurrencyTotalWeekCap = weekCap; - // count was changed to week limit, now we can modify original points. - ModifyCurrency(CURRENCY_TYPE_CONQUEST_POINTS, count, printLog ); - return; - } - - // on new case just set init. - if (itr->second.state == PLAYERCURRENCY_NEW) - { - SendNewCurrency(id); - return; - } + if (currency->Category == CURRENCY_CATEGORY_META_CONQUEST) + { + // count was changed to week limit, now we can modify original points. + ModifyCurrency(CURRENCY_TYPE_CONQUEST_POINTS, count, printLog); + return; + } - WorldPacket packet(SMSG_UPDATE_CURRENCY, 12); + WorldPacket packet(SMSG_UPDATE_CURRENCY, 12); - packet.WriteBit(weekCap != 0); - packet.WriteBit(0); // hasSeasonCount - packet.WriteBit(printLog); // print in log + packet.WriteBit(weekCap != 0); + packet.WriteBit(0); // hasSeasonCount + packet.WriteBit(!printLog); // print in log - // if hasSeasonCount packet << uint32(seasontotalearned); TODO: save this in character DB and use it + // if hasSeasonCount packet << uint32(seasontotalearned); TODO: save this in character DB and use it - packet << uint32(newTotalCount / precision); - packet << uint32(id); - if (weekCap) - packet << uint32(newWeekCount / precision); + packet << uint32(newTotalCount / precision); + packet << uint32(id); + if (weekCap) + packet << uint32(newWeekCount / precision); - GetSession()->SendPacket(&packet); - } + GetSession()->SendPacket(&packet); } } @@ -7517,11 +7486,9 @@ uint32 Player::GetCurrencyWeekCap(uint32 id, bool usePrecision) const if (!entry) return 0; - uint32 cap = _GetCurrencyWeekCap(entry); - if (usePrecision && entry->Flags & CURRENCY_FLAG_HIGH_PRECISION) - cap /= 100; + uint32 precision = (usePrecision && entry->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? CURRENCY_PRECISION : 1; - return cap; + return GetCurrencyWeekCap(entry) / precision; } void Player::ResetCurrencyWeekCap() @@ -7547,15 +7514,13 @@ void Player::ResetCurrencyWeekCap() SendDirectMessage(&data); } -uint32 Player::_GetCurrencyWeekCap(const CurrencyTypesEntry* currency) const +uint32 Player::GetCurrencyWeekCap(CurrencyTypesEntry const* currency) const { - uint32 cap = currency->WeekCap; - switch (currency->ID) { //original conquest not have week cap case CURRENCY_TYPE_CONQUEST_POINTS: - return _ConquestCurrencyTotalWeekCap; + return std::max(GetCurrencyWeekCap(CURRENCY_TYPE_CONQUEST_META_ARENA, false), GetCurrencyWeekCap(CURRENCY_TYPE_CONQUEST_META_RBG, false)); case CURRENCY_TYPE_CONQUEST_META_ARENA: // should add precision mod = 100 return Trinity::Currency::ConquestRatingCalculator(_maxPersonalArenaRate) * CURRENCY_PRECISION; @@ -7564,18 +7529,10 @@ uint32 Player::_GetCurrencyWeekCap(const CurrencyTypesEntry* currency) const return Trinity::Currency::BgConquestRatingCalculator(GetRBGPersonalRating()) * CURRENCY_PRECISION; } - if (cap != currency->WeekCap && IsInWorld() && !GetSession()->PlayerLoading()) - { - WorldPacket packet(SMSG_UPDATE_CURRENCY_WEEK_LIMIT, 8); - packet << uint32(cap / ((currency->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? 100 : 1)); - packet << uint32(currency->ID); - GetSession()->SendPacket(&packet); - } - - return cap; + return currency->WeekCap; } -uint32 Player::_GetCurrencyTotalCap(const CurrencyTypesEntry* currency) const +uint32 Player::GetCurrencyTotalCap(CurrencyTypesEntry const* currency) const { uint32 cap = currency->TotalCap; @@ -7600,6 +7557,26 @@ uint32 Player::_GetCurrencyTotalCap(const CurrencyTypesEntry* currency) const return cap; } +void Player::UpdateConquestCurrencyCap(uint32 currency) +{ + uint32 currenciesToUpdate[2] = { currency, CURRENCY_TYPE_CONQUEST_POINTS }; + + for (uint32 i = 0; i < 2; ++i) + { + CurrencyTypesEntry const* currencyEntry = sCurrencyTypesStore.LookupEntry(currenciesToUpdate[i]); + if (!currencyEntry) + continue; + + uint32 precision = (currencyEntry->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? 100 : 1; + uint32 cap = GetCurrencyWeekCap(currencyEntry); + + WorldPacket packet(SMSG_UPDATE_CURRENCY_WEEK_LIMIT, 8); + packet << uint32(cap / precision); + packet << uint32(currenciesToUpdate[i]); + GetSession()->SendPacket(&packet); + } +} + void Player::SetInGuild(uint32 guildId) { if (guildId) @@ -7635,7 +7612,10 @@ void Player::SetArenaTeamInfoField(uint8 slot, ArenaTeamInfoType type, uint32 v { SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (slot * ARENA_TEAM_END) + type, value); if (type == ARENA_TEAM_PERSONAL_RATING && value > _maxPersonalArenaRate) + { _maxPersonalArenaRate = value; + UpdateConquestCurrencyCap(CURRENCY_TYPE_CONQUEST_META_ARENA); + } } uint32 Player::GetArenaTeamIdFromDB(uint64 guid, uint8 type) @@ -20946,11 +20926,6 @@ void Player::LeaveAllArenaTeams(uint64 guid) while (result->NextRow()); } -uint32 Player::GetRBGPersonalRating() const -{ - return 0; -} - void Player::SetRestBonus(float rest_bonus_new) { // Prevent resting on max level @@ -21354,6 +21329,7 @@ void Player::InitDisplayIds() inline bool Player::_StoreOrEquipNewItem(uint32 vendorslot, uint32 item, uint8 count, uint8 bag, uint8 slot, int32 price, ItemTemplate const* pProto, Creature* pVendor, VendorItem const* crItem, bool bStore) { + uint32 stacks = count / pProto->BuyCount; ItemPosCountVec vDest; uint16 uiDest = 0; InventoryResult msg = bStore ? @@ -21373,13 +21349,13 @@ inline bool Player::_StoreOrEquipNewItem(uint32 vendorslot, uint32 item, uint8 c for (int i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i) { if (iece->RequiredItem[i]) - DestroyItemCount(iece->RequiredItem[i], iece->RequiredItemCount[i], true); + DestroyItemCount(iece->RequiredItem[i], iece->RequiredItemCount[i] * stacks, true); } for (int i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i) { if (iece->RequiredCurrency[i]) - ModifyCurrency(iece->RequiredCurrency[i], -int32(iece->RequiredCurrencyCount[i]), true, true); + ModifyCurrency(iece->RequiredCurrency[i], -int32(iece->RequiredCurrencyCount[i] * stacks), true, true); } } @@ -21416,8 +21392,6 @@ inline bool Player::_StoreOrEquipNewItem(uint32 vendorslot, uint32 item, uint8 c bool Player::BuyCurrencyFromVendorSlot(uint64 vendorGuid, uint32 vendorSlot, uint32 currency, uint32 count) { - vendorSlot += 1; - // cheating attempt if (count < 1) count = 1; @@ -21460,9 +21434,17 @@ bool Player::BuyCurrencyFromVendorSlot(uint64 vendorGuid, uint32 vendorSlot, uin return false; } + if (count % crItem->maxcount) + { + SendEquipError(EQUIP_ERR_CANT_BUY_QUANTITY, NULL, NULL); + return false; + } + + uint32 stacks = count / crItem->maxcount; + ItemExtendedCostEntry const* iece = NULL; if (crItem->ExtendedCost) { - ItemExtendedCostEntry const* iece = sItemExtendedCostStore.LookupEntry(crItem->ExtendedCost); + iece = sItemExtendedCostStore.LookupEntry(crItem->ExtendedCost); if (!iece) { sLog->outError(LOG_FILTER_PLAYER, "Currency %u have wrong ExtendedCost field value %u", currency, crItem->ExtendedCost); @@ -21471,7 +21453,7 @@ bool Player::BuyCurrencyFromVendorSlot(uint64 vendorGuid, uint32 vendorSlot, uin for (uint8 i = 0; i < MAX_ITEM_EXT_COST_ITEMS; ++i) { - if (iece->RequiredItem[i] && !HasItemCount(iece->RequiredItem[i], (iece->RequiredItemCount[i] * count))) + if (iece->RequiredItem[i] && !HasItemCount(iece->RequiredItem[i], (iece->RequiredItemCount[i] * stacks))) { SendEquipError(EQUIP_ERR_VENDOR_MISSING_TURNINS, NULL, NULL); return false; @@ -21490,9 +21472,7 @@ bool Player::BuyCurrencyFromVendorSlot(uint64 vendorGuid, uint32 vendorSlot, uin return false; } - uint32 precision = (entry->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? CURRENCY_PRECISION : 1; - - if (!HasCurrency(iece->RequiredCurrency[i], (iece->RequiredCurrencyCount[i] * count) / precision)) + if (!HasCurrency(iece->RequiredCurrency[i], (iece->RequiredCurrencyCount[i] * stacks))) { SendEquipError(EQUIP_ERR_VENDOR_MISSING_TURNINS, NULL, NULL); // Find correct error return false; @@ -21513,7 +21493,25 @@ bool Player::BuyCurrencyFromVendorSlot(uint64 vendorGuid, uint32 vendorSlot, uin return false; } - ModifyCurrency(currency, crItem->maxcount, true, true); + ModifyCurrency(currency, count, true, true); + if (iece) + { + for (uint8 i = 0; i < MAX_ITEM_EXT_COST_ITEMS; ++i) + { + if (!iece->RequiredItem[i]) + continue; + + DestroyItemCount(iece->RequiredItem[i], iece->RequiredItemCount[i] * stacks, true); + } + + for (uint8 i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i) + { + if (!iece->RequiredCurrency[i]) + continue; + + ModifyCurrency(iece->RequiredCurrency[i], -int32(iece->RequiredCurrencyCount[i]) * stacks, false, true); + } + } return true; } @@ -21586,12 +21584,13 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32 if (crItem->ExtendedCost) { // Can only buy full stacks for extended cost - if (pProto->BuyCount != count) + if (count % pProto->BuyCount) { SendEquipError(EQUIP_ERR_CANT_BUY_QUANTITY, NULL, NULL); return false; } + uint32 stacks = count / pProto->BuyCount; ItemExtendedCostEntry const* iece = sItemExtendedCostStore.LookupEntry(crItem->ExtendedCost); if (!iece) { @@ -21601,7 +21600,7 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32 for (uint8 i = 0; i < MAX_ITEM_EXT_COST_ITEMS; ++i) { - if (iece->RequiredItem[i] && !HasItemCount(iece->RequiredItem[i], (iece->RequiredItemCount[i] * count))) + if (iece->RequiredItem[i] && !HasItemCount(iece->RequiredItem[i], iece->RequiredItemCount[i] * stacks)) { SendEquipError(EQUIP_ERR_VENDOR_MISSING_TURNINS, NULL, NULL); return false; @@ -21620,9 +21619,7 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32 return false; } - uint32 precision = (entry->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? CURRENCY_PRECISION : 1; - - if (!HasCurrency(iece->RequiredCurrency[i], (iece->RequiredCurrencyCount[i] * count) / precision)) + if (!HasCurrency(iece->RequiredCurrency[i], iece->RequiredCurrencyCount[i] * stacks)) { SendEquipError(EQUIP_ERR_VENDOR_MISSING_TURNINS, NULL, NULL); return false; @@ -25963,8 +25960,6 @@ void Player::DeleteRefundReference(uint32 it) void Player::SendRefundInfo(Item* item) { - const CurrencyTypesEntry* currencyType; - uint32 divisor; // This function call unsets ITEM_FLAGS_REFUNDABLE if played time is over 2 hours. item->UpdatePlayedTime(this); @@ -25999,6 +25994,7 @@ void Player::SendRefundInfo(Item* item) data.WriteBit(guid[0]); data.WriteBit(guid[1]); data.FlushBits(); + data.WriteByteSeq(guid[7]); data << uint32(GetTotalPlayedTime() - item->GetPlayedTime()); for (uint8 i = 0; i < MAX_ITEM_EXT_COST_ITEMS; ++i) // item cost data @@ -26013,12 +26009,10 @@ void Player::SendRefundInfo(Item* item) data.WriteByteSeq(guid[2]); for (uint8 i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i) // currency cost data { - currencyType = sCurrencyTypesStore.LookupEntry(iece->RequiredCurrency[i]); - if (currencyType && currencyType->Flags & CURRENCY_FLAG_HIGH_PRECISION) - divisor = 100; - else - divisor = 1; - data << uint32(iece->RequiredCurrencyCount[i] / divisor); + CurrencyTypesEntry const* currencyType = sCurrencyTypesStore.LookupEntry(iece->RequiredCurrency[i]); + uint32 precision = (currencyType && currencyType->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? CURRENCY_PRECISION : 1; + + data << uint32(iece->RequiredCurrencyCount[i] / precision); data << uint32(iece->RequiredCurrency[i]); } @@ -26057,8 +26051,6 @@ void Player::SendItemRefundResult(Item* item, ItemExtendedCostEntry const* iece, { ObjectGuid guid = item->GetGUID(); WorldPacket data(SMSG_ITEM_REFUND_RESULT, 1 + 1 + 8 + 4*8 + 4 + 4*8 + 1); - const CurrencyTypesEntry* currencyType; - uint32 divisor; data.WriteBit(guid[4]); data.WriteBit(guid[5]); data.WriteBit(guid[1]); @@ -26074,12 +26066,10 @@ void Player::SendItemRefundResult(Item* item, ItemExtendedCostEntry const* iece, { for (uint8 i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i) { - currencyType = sCurrencyTypesStore.LookupEntry(iece->RequiredCurrency[i]); - if (currencyType && currencyType->Flags & CURRENCY_FLAG_HIGH_PRECISION) - divisor = 100; - else - divisor = 1; - data << uint32(iece->RequiredCurrencyCount[i] / divisor); + CurrencyTypesEntry const* currencyType = sCurrencyTypesStore.LookupEntry(iece->RequiredCurrency[i]); + uint32 precision = (currencyType && currencyType->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? CURRENCY_PRECISION : 1; + + data << uint32(iece->RequiredCurrencyCount[i] / precision); data << uint32(iece->RequiredCurrency[i]); } diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 979dfc42040..6f5c5b71369 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1431,9 +1431,9 @@ class Player : public Unit, public GridObject /// send conquest currency points and their cap week/arena void SendPvpRewards() const; /// return count of currency witch has plr - uint32 GetCurrency(uint32 id, bool precision) const; + uint32 GetCurrency(uint32 id, bool usePrecision) const; /// return count of currency gaind on current week - uint32 GetCurrencyOnWeek(uint32 id, bool precision) const; + uint32 GetCurrencyOnWeek(uint32 id, bool usePrecision) const; /// return week cap by currency id uint32 GetCurrencyWeekCap(uint32 id, bool usePrecision) const; /// return presence related currency @@ -2049,7 +2049,7 @@ class Player : public Unit, public GridObject uint32 GetArenaPersonalRating(uint8 slot) const { return GetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (slot * ARENA_TEAM_END) + ARENA_TEAM_PERSONAL_RATING); } void SetArenaTeamIdInvited(uint32 ArenaTeamId) { m_ArenaTeamIdInvited = ArenaTeamId; } uint32 GetArenaTeamIdInvited() { return m_ArenaTeamIdInvited; } - uint32 GetRBGPersonalRating() const; + uint32 GetRBGPersonalRating() const { return 0; } Difficulty GetDifficulty(bool isRaid) const { return isRaid ? m_raidDifficulty : m_dungeonDifficulty; } Difficulty GetDungeonDifficulty() const { return m_dungeonDifficulty; } @@ -2887,20 +2887,23 @@ class Player : public Unit, public GridObject PlayerCurrenciesMap _currencyStorage; /** - * @name _GetCurrencyWeekCap + * @name GetCurrencyWeekCap * @brief return week cap for selected currency - * @param currency CurrencyTypesEntry witch should get week cap + * @param CurrencyTypesEntry for which to retrieve weekly cap */ - uint32 _GetCurrencyWeekCap(const CurrencyTypesEntry* currency) const; + uint32 GetCurrencyWeekCap(CurrencyTypesEntry const* currency) const; /* - * @name _GetCurrencyTotalCap + * @name GetCurrencyTotalCap * @brief return total cap for selected currency - * @param currency CurrencyTypesEntry witch should get week cap + * @param CurrencyTypesEntry for which to retrieve total cap */ - uint32 _GetCurrencyTotalCap(const CurrencyTypesEntry* currency) const; + uint32 GetCurrencyTotalCap(CurrencyTypesEntry const* currency) const; + + /// Updates weekly conquest point cap (dynamic cap) + void UpdateConquestCurrencyCap(uint32 currency); VoidStorageItem* _voidStorageItems[VOID_STORAGE_MAX_SLOT]; @@ -3104,7 +3107,6 @@ class Player : public Unit, public GridObject uint32 _activeCheats; uint32 _maxPersonalArenaRate; - uint32 _ConquestCurrencyTotalWeekCap; PhaseMgr phaseMgr; }; diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 617270ac119..4887bfee38b 100644 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -816,8 +816,6 @@ void WorldSession::SendListInventory(uint64 vendorGuid) if (vendorItem->ExtendedCost == 0) continue; // there's no price defined for currencies, only extendedcost is used - uint32 precision = (currencyTemplate->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? CURRENCY_PRECISION : 1; - ++count; itemsData << uint32(slot + 1); // client expects counting to start at 1 itemsData << uint32(0); // max durability @@ -838,7 +836,7 @@ void WorldSession::SendListInventory(uint64 vendorGuid) itemsData << uint32(0); // displayId // if (!unk "enabler") data << uint32(something); itemsData << int32(-1); - itemsData << uint32(vendorItem->maxcount * precision); + itemsData << uint32(vendorItem->maxcount); } // else error } -- cgit v1.2.3 From 71a0cc1706298281028434123e1ac016c082e486 Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Thu, 31 Jan 2013 00:18:27 +0100 Subject: Core/Spells: Add missing break in f5fd7bad69c04352f5e367b8aca2035e0eff57d9 Thx Nayd --- src/server/game/Entities/Unit/Unit.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index bd2674a5af6..32ade87fef4 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -5955,6 +5955,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere break; } } + break; } case SPELLFAMILY_PALADIN: { -- cgit v1.2.3 From a4b1f1c45fc8a1e28b76ffbbd0e73e6452c0785b Mon Sep 17 00:00:00 2001 From: Warpten Date: Thu, 31 Jan 2013 00:20:54 +0100 Subject: Spells/Warlock: Fixed Conflagrate, Demon Soul and Immolate. --- .../2013_01_31_00_world_spell_script_names_434.sql | 6 + src/server/scripts/Spells/spell_warlock.cpp | 150 +++++++++++++++++++++ 2 files changed, 156 insertions(+) create mode 100644 sql/updates/world/2013_01_31_00_world_spell_script_names_434.sql (limited to 'src') diff --git a/sql/updates/world/2013_01_31_00_world_spell_script_names_434.sql b/sql/updates/world/2013_01_31_00_world_spell_script_names_434.sql new file mode 100644 index 00000000000..14bf9f1832a --- /dev/null +++ b/sql/updates/world/2013_01_31_00_world_spell_script_names_434.sql @@ -0,0 +1,6 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_warl_demon_soul', 'spell_warl_conflagrate', 'spell_warl_fel_flame'); +DELETE FROM `spell_script_names` WHERE `spell_id`=77799 OR ScriptName="spell_warlock_fel_flame"; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(17962, 'spell_warl_conflagrate'); +(77799, 'spell_warl_fel_flame'); +(77801, 'spell_warl_demon_soul'); diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index df415a7bb08..92d8e940a22 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -25,6 +25,7 @@ #include "ScriptMgr.h" #include "SpellScript.h" #include "SpellAuraEffects.h" +#include "SpellAuras.h" enum WarlockSpells { @@ -38,10 +39,16 @@ enum WarlockSpells SPELL_WARLOCK_DEMONIC_EMPOWERMENT_IMP = 54444, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_SUCCUBUS = 54435, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER = 54443, + SPELL_WARLOCK_DEMON_SOUL_IMP = 79459, + SPELL_WARLOCK_DEMON_SOUL_FELHUNTER = 79460, + SPELL_WARLOCK_DEMON_SOUL_FELGUARD = 79452, + SPELL_WARLOCK_DEMON_SOUL_SUCCUBUS = 79453, + SPELL_WARLOCK_DEMON_SOUL_VOIDWALKER = 79454, SPELL_WARLOCK_FEL_SYNERGY_HEAL = 54181, SPELL_WARLOCK_GLYPH_OF_SIPHON_LIFE = 63106, SPELL_WARLOCK_HAUNT = 48181, SPELL_WARLOCK_HAUNT_HEAL = 48210, + SPELL_WARLOCK_IMMOLATE = 348, SPELL_WARLOCK_IMPROVED_HEALTHSTONE_R1 = 18692, SPELL_WARLOCK_IMPROVED_HEALTHSTONE_R2 = 18693, SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R1 = 60955, @@ -52,6 +59,7 @@ enum WarlockSpells SPELL_WARLOCK_LIFE_TAP_ENERGIZE_2 = 32553, SPELL_WARLOCK_SIPHON_LIFE_HEAL = 63106, SPELL_WARLOCK_SOULSHATTER = 32835, + SPELL_WARLOCK_UNSTABLE_AFFLICTION = 30108, SPELL_WARLOCK_UNSTABLE_AFFLICTION_DISPEL = 31117 }; @@ -116,6 +124,41 @@ class spell_warl_banish : public SpellScriptLoader } }; +// 17962 - Conflagrate - Updated to 4.3.4 +class spell_warl_conflagrate : public SpellScriptLoader +{ + public: + spell_warl_conflagrate() : SpellScriptLoader("spell_warl_conflagrate") { } + + class spell_warl_conflagrate_SpellScript : public SpellScript + { + PrepareSpellScript(spell_warl_conflagrate_SpellScript); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_IMMOLATE)) + return false; + return true; + } + + void HandleHit(SpellEffIndex /*effIndex*/) + { + if (AuraEffect const* aurEff = GetHitUnit()->GetAuraEffect(SPELL_WARLOCK_IMMOLATE, EFFECT_2, GetCaster()->GetGUID())) + SetHitDamage(CalculatePct(aurEff->GetAmount(), GetSpellInfo()->Effects[EFFECT_1].CalcValue(GetCaster()))); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_warl_conflagrate_SpellScript::HandleHit, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_warl_conflagrate_SpellScript(); + } +}; + // 6201 - Create Healthstone class spell_warl_create_healthstone : public SpellScriptLoader { @@ -336,6 +379,73 @@ class spell_warl_demonic_circle_teleport : public SpellScriptLoader } }; +// 77801 - Demon Soul - Updated to 4.3.4 +class spell_warl_demon_soul : public SpellScriptLoader +{ + public: + spell_warl_demon_soul() : SpellScriptLoader("spell_warl_demon_soul") { } + + class spell_warl_demon_soul_SpellScript : public SpellScript + { + PrepareSpellScript(spell_warl_demon_soul_SpellScript); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_DEMON_SOUL_IMP)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_DEMON_SOUL_FELHUNTER)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_DEMON_SOUL_FELGUARD)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_DEMON_SOUL_SUCCUBUS)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_DEMON_SOUL_VOIDWALKER)) + return false; + return true; + } + + void OnHitTarget(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + if (Creature* targetCreature = GetHitCreature()) + { + if (targetCreature->isPet()) + { + CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate(targetCreature->GetEntry()); + switch (ci->family) + { + case CREATURE_FAMILY_SUCCUBUS: + caster->CastSpell(caster, SPELL_WARLOCK_DEMON_SOUL_SUCCUBUS); + break; + case CREATURE_FAMILY_VOIDWALKER: + caster->CastSpell(caster, SPELL_WARLOCK_DEMON_SOUL_VOIDWALKER); + break; + case CREATURE_FAMILY_FELGUARD: + caster->CastSpell(caster, SPELL_WARLOCK_DEMON_SOUL_FELGUARD); + break; + case CREATURE_FAMILY_FELHUNTER: + caster->CastSpell(caster, SPELL_WARLOCK_DEMON_SOUL_FELHUNTER); + break; + case CREATURE_FAMILY_IMP: + caster->CastSpell(caster, SPELL_WARLOCK_DEMON_SOUL_IMP); + break; + } + } + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_warl_demon_soul_SpellScript::OnHitTarget, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_warl_demon_soul_SpellScript; + } +}; + // 47193 - Demonic Empowerment /// Updated 4.3.4 class spell_warl_demonic_empowerment : public SpellScriptLoader @@ -430,6 +540,43 @@ class spell_warl_everlasting_affliction : public SpellScriptLoader } }; +// 77799 - Fel Flame - Updated to 4.3.4 +class spell_warl_fel_flame : public SpellScriptLoader +{ + public: + spell_warl_fel_flame() : SpellScriptLoader("spell_warl_fel_flame") { } + + class spell_warl_fel_flame_SpellScript : public SpellScript + { + PrepareSpellScript(spell_warl_fel_flame_SpellScript); + + void OnHitTarget(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + Unit* target = GetHitUnit(); + Aura* aura = target->GetAura(SPELL_WARLOCK_UNSTABLE_AFFLICTION, caster->GetGUID()); + if (!aura) + aura = target->GetAura(SPELL_WARLOCK_IMMOLATE, caster->GetGUID()); + + if (!aura) + return; + + int32 newDuration = aura->GetDuration() + GetSpellInfo()->Effects[EFFECT_1].CalcValue() * 1000; + aura->SetDuration(std::min(newDuration, aura->GetMaxDuration())); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_warl_fel_flame_SpellScript::OnHitTarget, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_warl_fel_flame_SpellScript; + } +}; + // -47230 - Fel Synergy class spell_warl_fel_synergy : public SpellScriptLoader { @@ -874,11 +1021,14 @@ void AddSC_warlock_spell_scripts() { new spell_warl_bane_of_doom(); new spell_warl_banish(); + new spell_warl_conflagrate(); new spell_warl_create_healthstone(); new spell_warl_demonic_circle_summon(); new spell_warl_demonic_circle_teleport(); new spell_warl_demonic_empowerment(); + new spell_warl_demon_soul(); new spell_warl_everlasting_affliction(); + new spell_warl_fel_flame(); new spell_warl_fel_synergy(); new spell_warl_haunt(); new spell_warl_health_funnel(); -- cgit v1.2.3 From 9a0525757adc6ddf59d7e942cddfdd0185a896d8 Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Thu, 31 Jan 2013 00:35:33 +0100 Subject: Core: Fix some warnings --- src/server/game/Guilds/Guild.cpp | 2 +- src/server/game/Handlers/ChatHandler.cpp | 6 +++--- src/server/game/Spells/SpellInfo.cpp | 2 +- src/server/scripts/Spells/spell_mage.cpp | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index cef21863b60..04169bb7b7d 100644 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -2520,7 +2520,7 @@ void Guild::BroadcastAddonToGuild(WorldSession* session, bool officerOnly, std:: if (session && session->GetPlayer() && _HasRankRight(session->GetPlayer(), officerOnly ? GR_RIGHT_OFFCHATSPEAK : GR_RIGHT_GCHATSPEAK)) { WorldPacket data; - ChatHandler::FillMessageData(&data, session, officerOnly ? CHAT_MSG_OFFICER : CHAT_MSG_GUILD, CHAT_MSG_ADDON, NULL, 0, msg.c_str(), NULL, prefix.c_str()); + ChatHandler::FillMessageData(&data, session, officerOnly ? CHAT_MSG_OFFICER : CHAT_MSG_GUILD, uint32(CHAT_MSG_ADDON), NULL, 0, msg.c_str(), NULL, prefix.c_str()); for (Members::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr) if (Player* player = itr->second->FindPlayer()) if (player->GetSession() && _HasRankRight(player, officerOnly ? GR_RIGHT_OFFCHATLISTEN : GR_RIGHT_GCHATLISTEN) && diff --git a/src/server/game/Handlers/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cpp index 1105886813a..eef049fdb66 100644 --- a/src/server/game/Handlers/ChatHandler.cpp +++ b/src/server/game/Handlers/ChatHandler.cpp @@ -600,7 +600,7 @@ void WorldSession::HandleAddonMessagechatOpcode(WorldPacket& recvData) return; // Weird way to log stuff... - sScriptMgr->OnPlayerChat(sender, CHAT_MSG_ADDON, LANG_ADDON, message); + sScriptMgr->OnPlayerChat(sender, uint32(CHAT_MSG_ADDON), uint32(LANG_ADDON), message); } // Disabled addon channel? @@ -616,7 +616,7 @@ void WorldSession::HandleAddonMessagechatOpcode(WorldPacket& recvData) return; WorldPacket data; - ChatHandler::FillMessageData(&data, this, type, LANG_ADDON, "", 0, message.c_str(), NULL); + ChatHandler::FillMessageData(&data, this, type, uint32(LANG_ADDON), "", 0, message.c_str(), NULL); group->BroadcastAddonMessagePacket(&data, prefix, false); break; } @@ -649,7 +649,7 @@ void WorldSession::HandleAddonMessagechatOpcode(WorldPacket& recvData) break; WorldPacket data; - ChatHandler::FillMessageData(&data, this, type, LANG_ADDON, "", 0, message.c_str(), NULL, prefix.c_str()); + ChatHandler::FillMessageData(&data, this, type, uint32(LANG_ADDON), "", 0, message.c_str(), NULL, prefix.c_str()); group->BroadcastAddonMessagePacket(&data, prefix, true, -1, group->GetMemberGroup(sender->GetGUID())); break; } diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index e85d0e2bfe6..c5c8156d38b 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -386,7 +386,7 @@ bool SpellEffectInfo::IsAura() const bool SpellEffectInfo::IsAura(AuraType aura) const { - return IsAura() && AuraType(ApplyAuraName) == uint32(aura); + return IsAura() && ApplyAuraName == uint32(aura); } bool SpellEffectInfo::IsTargetingArea() const diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index ddd65b26496..cd3673c17de 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -909,8 +909,8 @@ class spell_mage_summon_water_elemental : public SpellScriptLoader if (Player* player = caster->ToPlayer()) if (Guardian* elemental = player->GetGuardianPet()) // Check if the pet we are going to unsummon is the mage's water elemental - if (elemental->GetEntry() == sSpellMgr->GetSpellInfo(SPELL_MAGE_SUMMON_WATER_ELEMENTAL_TEMPORARY)->Effects[EFFECT_0].MiscValue || - elemental->GetEntry() == sSpellMgr->GetSpellInfo(SPELL_MAGE_SUMMON_WATER_ELEMENTAL_PERMANENT)->Effects[EFFECT_0].MiscValue) + if (elemental->GetEntry() == uint32(sSpellMgr->GetSpellInfo(SPELL_MAGE_SUMMON_WATER_ELEMENTAL_TEMPORARY)->Effects[EFFECT_0].MiscValue) || + elemental->GetEntry() == uint32(sSpellMgr->GetSpellInfo(SPELL_MAGE_SUMMON_WATER_ELEMENTAL_PERMANENT)->Effects[EFFECT_0].MiscValue)) elemental->UnSummon(); // Glyph of Eternal Water -- cgit v1.2.3 From 0b72a91e7667943dd128ca28f5bb71d8457d3ec9 Mon Sep 17 00:00:00 2001 From: Warpten Date: Fri, 1 Feb 2013 19:55:23 +0100 Subject: Core/Hunters: Fixed focus power for pets. Closes #8553. --- src/server/game/Entities/Player/Player.cpp | 8 ++++---- src/server/game/Entities/Unit/Unit.cpp | 25 +++++++++++++++++++------ src/server/game/Entities/Unit/Unit.h | 1 + 3 files changed, 24 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 67dc948ed99..41142e2de27 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -2525,7 +2525,7 @@ void Player::Regenerate(Powers power) return; // Skip regeneration for power type we cannot have - uint32 powerIndex = GetPowerIndexByClass(power, getClass()); + uint32 powerIndex = GetPowerIndex(power); if (powerIndex == MAX_POWERS) return; @@ -17343,7 +17343,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) uint32 loadedPowers = 0; for (uint32 i = 0; i < MAX_POWERS; ++i) { - if (GetPowerIndexByClass(Powers(i), getClass()) != MAX_POWERS) + if (GetPowerIndex(i) != MAX_POWERS) { uint32 savedPower = fields[47+loadedPowers].GetUInt32(); uint32 maxPower = GetUInt32Value(UNIT_FIELD_MAXPOWER1 + loadedPowers); @@ -18937,7 +18937,7 @@ void Player::SaveToDB(bool create /*=false*/) uint32 storedPowers = 0; for (uint32 i = 0; i < MAX_POWERS; ++i) { - if (GetPowerIndexByClass(Powers(i), getClass()) != MAX_POWERS) + if (GetPowerIndex(i) != MAX_POWERS) { stmt->setUInt32(index++, GetUInt32Value(UNIT_FIELD_POWER1 + storedPowers)); if (++storedPowers >= MAX_POWERS_PER_CLASS) @@ -19057,7 +19057,7 @@ void Player::SaveToDB(bool create /*=false*/) uint32 storedPowers = 0; for (uint32 i = 0; i < MAX_POWERS; ++i) { - if (GetPowerIndexByClass(Powers(i), getClass()) != MAX_POWERS) + if (GetPowerIndex(i) != MAX_POWERS) { stmt->setUInt32(index++, GetUInt32Value(UNIT_FIELD_POWER1 + storedPowers)); if (++storedPowers >= MAX_POWERS_PER_CLASS) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 32ade87fef4..2db63040e83 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -9224,7 +9224,7 @@ int32 Unit::SpellBaseDamageBonusDone(SpellSchoolMask schoolMask) DoneAdvertisedBenefit += ToPlayer()->GetBaseSpellPowerBonus(); // Check if we are ever using mana - PaperDollFrame.lua - if (GetPowerIndexByClass(POWER_MANA, getClass()) != MAX_POWERS) + if (GetPowerIndex(POWER_MANA) != MAX_POWERS) DoneAdvertisedBenefit += std::max(0, int32(GetStat(STAT_INTELLECT)) - 10); // spellpower from intellect // Damage bonus from stats @@ -9747,7 +9747,7 @@ int32 Unit::SpellBaseHealingBonusDone(SpellSchoolMask schoolMask) AdvertisedBenefit += ToPlayer()->GetBaseSpellPowerBonus(); // Check if we are ever using mana - PaperDollFrame.lua - if (GetPowerIndexByClass(POWER_MANA, getClass()) != MAX_POWERS) + if (GetPowerIndex(POWER_MANA) != MAX_POWERS) AdvertisedBenefit += std::max(0, int32(GetStat(STAT_INTELLECT)) - 10); // spellpower from intellect // Healing bonus from stats @@ -12364,7 +12364,7 @@ void Unit::SetMaxHealth(uint32 val) int32 Unit::GetPower(Powers power) const { - uint32 powerIndex = GetPowerIndexByClass(power, getClass()); + uint32 powerIndex = GetPowerIndex(power); if (powerIndex == MAX_POWERS) return 0; @@ -12373,7 +12373,7 @@ int32 Unit::GetPower(Powers power) const int32 Unit::GetMaxPower(Powers power) const { - uint32 powerIndex = GetPowerIndexByClass(power, getClass()); + uint32 powerIndex = GetPowerIndex(power); if (powerIndex == MAX_POWERS) return 0; @@ -12382,7 +12382,7 @@ int32 Unit::GetMaxPower(Powers power) const void Unit::SetPower(Powers power, int32 val) { - uint32 powerIndex = GetPowerIndexByClass(power, getClass()); + uint32 powerIndex = GetPowerIndex(power); if (powerIndex == MAX_POWERS) return; @@ -12421,7 +12421,7 @@ void Unit::SetPower(Powers power, int32 val) void Unit::SetMaxPower(Powers power, int32 val) { - uint32 powerIndex = GetPowerIndexByClass(power, getClass()); + uint32 powerIndex = GetPowerIndex(power); if (powerIndex == MAX_POWERS) return; @@ -12448,6 +12448,19 @@ void Unit::SetMaxPower(Powers power, int32 val) SetPower(power, val); } +uint32 Unit::GetPowerIndex(uint32 powerType) const +{ + /// This is here because hunter pets are of the warrior class. + /// With the current implementation, the core only gives them + /// POWER_RAGE, so we enforce the class to hunter so that they + /// effectively get focus power. + uint32 classId = getClass(); + if (ToPet() && ToPet()->getPetType() == HUNTER_PET) + classId = CLASS_HUNTER; + + return GetPowerIndexByClass(powerType, classId); +} + int32 Unit::GetCreatePowers(Powers power) const { switch (power) diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index b723be7bee7..a8e088b2dd3 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1877,6 +1877,7 @@ class Unit : public WorldObject uint32 GetCreateHealth() const { return GetUInt32Value(UNIT_FIELD_BASE_HEALTH); } void SetCreateMana(uint32 val) { SetUInt32Value(UNIT_FIELD_BASE_MANA, val); } uint32 GetCreateMana() const { return GetUInt32Value(UNIT_FIELD_BASE_MANA); } + uint32 GetPowerIndex(uint32 powerType) const; int32 GetCreatePowers(Powers power) const; float GetPosStat(Stats stat) const { return GetFloatValue(UNIT_FIELD_POSSTAT0+stat); } float GetNegStat(Stats stat) const { return GetFloatValue(UNIT_FIELD_NEGSTAT0+stat); } -- cgit v1.2.3 From c4d3b831912b46e836de22e6cd773396b661fa29 Mon Sep 17 00:00:00 2001 From: Subv Date: Mon, 4 Feb 2013 22:38:20 -0500 Subject: Implemented use of `graveyard_orientation` - You can test it by clicking on "Return to Graveyard" button --- src/server/game/Entities/Player/Player.cpp | 3 ++- src/server/game/Globals/ObjectMgr.cpp | 29 +++++++++++++++++++++++++++++ src/server/game/Globals/ObjectMgr.h | 16 +++++++++++++++- src/server/game/World/World.cpp | 3 +++ 4 files changed, 49 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index fdcfee354e2..a3a7b364844 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -5499,7 +5499,8 @@ void Player::RepopAtGraveyard() // and don't show spirit healer location if (ClosestGrave) { - TeleportTo(ClosestGrave->map_id, ClosestGrave->x, ClosestGrave->y, ClosestGrave->z, GetOrientation()); + float const* orientation = sObjectMgr->GetGraveyardOrientation(ClosestGrave->ID); + TeleportTo(ClosestGrave->map_id, ClosestGrave->x, ClosestGrave->y, ClosestGrave->z, orientation ? *orientation : GetOrientation()); if (isDead()) // not send if alive, because it used in TeleportTo() { WorldPacket data(SMSG_DEATH_RELEASE_LOC, 4*4); // show spirit healer position on minimap diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 640eef5d651..043afdf4687 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -268,6 +268,7 @@ ObjectMgr::~ObjectMgr() itr->second.Clear(); _cacheTrainerSpellStore.clear(); + _graveyardOrientations.clear(); for (DungeonEncounterContainer::iterator itr =_dungeonEncounterStore.begin(); itr != _dungeonEncounterStore.end(); ++itr) for (DungeonEncounterList::iterator encounterItr = itr->second.begin(); encounterItr != itr->second.end(); ++encounterItr) @@ -288,6 +289,34 @@ void ObjectMgr::AddLocaleString(std::string const& s, LocaleConstant locale, Str } } +void ObjectMgr::LoadGraveyardOrientations() +{ + uint32 oldMSTime = getMSTime(); + + _graveyardOrientations.clear(); + + QueryResult result = WorldDatabase.Query("SELECT id, orientation FROM graveyard_orientation"); + + if (!result) + return; + + do + { + Field* fields = result->Fetch(); + + uint32 id = fields[0].GetUInt32(); + if (!sWorldSafeLocsStore.LookupEntry(id)) + { + sLog->outError(LOG_FILTER_SERVER_LOADING, "Graveyard %u referenced in graveyard_orientation doesn't exist.", id); + continue; + } + _graveyardOrientations[id] = fields[1].GetFloat(); + + } while (result->NextRow()); + + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu graveyard orientations in %u ms", (unsigned long)_graveyardOrientations.size(), GetMSTimeDiffToNow(oldMSTime)); +} + void ObjectMgr::LoadCreatureLocales() { uint32 oldMSTime = getMSTime(); diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index eb56bb09b93..563b218c55c 100644 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -561,6 +561,7 @@ struct GraveYardData }; typedef std::multimap GraveYardContainer; +typedef UNORDERED_MAP GraveyardOrientationContainer; typedef std::pair GraveYardMapBounds; typedef std::pair GraveYardMapBoundsNonConst; @@ -867,6 +868,7 @@ class ObjectMgr void LoadDbScriptStrings(); void LoadCreatureClassLevelStats(); void LoadCreatureLocales(); + void LoadGraveyardOrientations(); void LoadCreatureTemplates(); void LoadCreatureTemplateAddons(); void CheckCreatureTemplate(CreatureTemplate const* cInfo); @@ -1116,6 +1118,16 @@ class ObjectMgr return &iter->second; } + + float const* GetGraveyardOrientation(uint32 id) const + { + GraveyardOrientationContainer::const_iterator iter = _graveyardOrientations.find(id); + if (iter != _graveyardOrientations.end()) + return &iter->second; + + return NULL; + } + void AddVendorItem(uint32 entry, uint32 item, int32 maxcount, uint32 incrtime, uint32 extendedCost, uint8 type, bool persist = true); // for event bool RemoveVendorItem(uint32 entry, uint32 item, uint8 type, bool persist = true); // for event bool IsVendorItemValid(uint32 vendor_entry, uint32 id, int32 maxcount, uint32 ptime, uint32 ExtendedCost, uint8 type, Player* player = NULL, std::set* skip_vendors = NULL, uint32 ORnpcflag = 0) const; @@ -1151,7 +1163,7 @@ class ObjectMgr // for wintergrasp only GraveYardContainer GraveYardStore; - + static void AddLocaleString(std::string const& s, LocaleConstant locale, StringVector& data); static inline void GetLocaleString(const StringVector& data, int loc_idx, std::string& value) { @@ -1313,6 +1325,8 @@ class ObjectMgr CacheVendorItemContainer _cacheVendorItemStore; CacheTrainerSpellContainer _cacheTrainerSpellStore; + + GraveyardOrientationContainer _graveyardOrientations; std::set _difficultyEntries[MAX_DIFFICULTY - 1]; // already loaded difficulty 1 value in creatures, used in CheckCreatureTemplate std::set _hasDifficultyEntries[MAX_DIFFICULTY - 1]; // already loaded creatures with difficulty 1 values, used in CheckCreatureTemplate diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 3bba06a021f..ef0c9b64475 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1547,6 +1547,9 @@ void World::SetInitialWorldSettings() sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Graveyard-zone links..."); sObjectMgr->LoadGraveyardZones(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Graveyard Orientations..."); + sObjectMgr->LoadGraveyardOrientations(); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading spell pet auras..."); sSpellMgr->LoadSpellPetAuras(); -- cgit v1.2.3 From be07a7d481bdd6728463cf63ee236d27df45e550 Mon Sep 17 00:00:00 2001 From: Shocker Date: Wed, 6 Feb 2013 22:27:53 +0200 Subject: Core/Spells: Fix SPELL_AURA_MOD_POWER_COST_SCHOOL and SPELL_AURA_MOD_POWER_COST_SCHOOL_PCT --- src/server/game/Spells/SpellInfo.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 652cc34ae5d..6c0913dd2fa 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -2249,7 +2249,15 @@ int32 SpellInfo::CalcPowerCost(Unit const* caster, SpellSchoolMask schoolMask) c } SpellSchools school = GetFirstSchoolInMask(schoolMask); // Flat mod from caster auras by spell school - powerCost += caster->GetInt32Value(UNIT_FIELD_POWER_COST_MODIFIER + school); + AuraEffectList const& auras = caster->GetAuraEffectsByType(SPELL_AURA_MOD_POWER_COST_SCHOOL); + for (AuraEffectList::const_iterator i = auras.begin(); i != auras.end(); ++i) + { + if (!((*i)->GetMiscValue() & schoolMask)) + continue; + if (!((*i)->GetMiscValueB() & (1 << PowerType))) + continue; + powerCost += (*i)->GetAmount(); + } // Shiv - costs 20 + weaponSpeed*10 energy (apply only to non-triggered spell with energy cost) if (AttributesEx4 & SPELL_ATTR4_SPELL_VS_EXTEND_COST) powerCost += caster->GetAttackTime(OFF_ATTACK) / 100; @@ -2261,7 +2269,15 @@ int32 SpellInfo::CalcPowerCost(Unit const* caster, SpellSchoolMask schoolMask) c powerCost = int32(powerCost / (1.117f * SpellLevel / caster->getLevel() -0.1327f)); // PCT mod from user auras by school - powerCost = int32(powerCost * (1.0f + caster->GetFloatValue(UNIT_FIELD_POWER_COST_MULTIPLIER + school))); + AuraEffectList const& aurasPct = caster->GetAuraEffectsByType(SPELL_AURA_MOD_POWER_COST_SCHOOL_PCT); + for (AuraEffectList::const_iterator i = aurasPct.begin(); i != aurasPct.end(); ++i) + { + if (!((*i)->GetMiscValue() & schoolMask)) + continue; + if (!((*i)->GetMiscValueB() & (1 << PowerType))) + continue; + powerCost += CalculatePct(powerCost, (*i)->GetAmount()); + } if (powerCost < 0) powerCost = 0; return powerCost; -- cgit v1.2.3 From 443ea1282706ffe03730fbb51fe9d0738fbf68e2 Mon Sep 17 00:00:00 2001 From: Shocker Date: Wed, 6 Feb 2013 22:42:37 +0200 Subject: Fix build --- src/server/game/Spells/SpellInfo.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 6c0913dd2fa..aadc30e3921 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -2247,10 +2247,10 @@ int32 SpellInfo::CalcPowerCost(Unit const* caster, SpellSchoolMask schoolMask) c return 0; } } - SpellSchools school = GetFirstSchoolInMask(schoolMask); - // Flat mod from caster auras by spell school - AuraEffectList const& auras = caster->GetAuraEffectsByType(SPELL_AURA_MOD_POWER_COST_SCHOOL); - for (AuraEffectList::const_iterator i = auras.begin(); i != auras.end(); ++i) + + // Flat mod from caster auras by spell school and power type + Unit::AuraEffectList const& auras = caster->GetAuraEffectsByType(SPELL_AURA_MOD_POWER_COST_SCHOOL); + for (Unit::AuraEffectList::const_iterator i = auras.begin(); i != auras.end(); ++i) { if (!((*i)->GetMiscValue() & schoolMask)) continue; @@ -2268,9 +2268,9 @@ int32 SpellInfo::CalcPowerCost(Unit const* caster, SpellSchoolMask schoolMask) c if (Attributes & SPELL_ATTR0_LEVEL_DAMAGE_CALCULATION) powerCost = int32(powerCost / (1.117f * SpellLevel / caster->getLevel() -0.1327f)); - // PCT mod from user auras by school - AuraEffectList const& aurasPct = caster->GetAuraEffectsByType(SPELL_AURA_MOD_POWER_COST_SCHOOL_PCT); - for (AuraEffectList::const_iterator i = aurasPct.begin(); i != aurasPct.end(); ++i) + // PCT mod from user auras by spell school and power type + Unit::AuraEffectList const& aurasPct = caster->GetAuraEffectsByType(SPELL_AURA_MOD_POWER_COST_SCHOOL_PCT); + for (Unit::AuraEffectList::const_iterator i = aurasPct.begin(); i != aurasPct.end(); ++i) { if (!((*i)->GetMiscValue() & schoolMask)) continue; -- cgit v1.2.3 From 943c866da97871d382db2f52e965ed38558695b0 Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Thu, 7 Feb 2013 00:02:22 +0100 Subject: Core: Whitespace cleanup --- src/server/game/Accounts/RBAC.h | 38 +++++++++++----------- src/server/game/Globals/ObjectMgr.cpp | 14 ++++---- src/server/game/Globals/ObjectMgr.h | 10 +++--- src/server/game/Movement/Spline/MoveSplineInit.cpp | 2 +- src/server/game/World/World.cpp | 2 +- src/server/scripts/Commands/cs_rbac.cpp | 6 ++-- .../EasternKingdoms/BaradinHold/boss_alizabal.cpp | 6 ++-- .../EasternKingdoms/zone_western_plaguelands.cpp | 2 +- .../ChamberOfAspects/RubySanctum/boss_halion.cpp | 2 +- src/server/scripts/Northrend/zone_icecrown.cpp | 2 +- .../scripts/Outland/BlackTemple/boss_supremus.cpp | 2 +- .../Outland/TempestKeep/Eye/boss_kaelthas.cpp | 2 +- src/server/scripts/Spells/spell_paladin.cpp | 4 +-- src/server/shared/Logging/AppenderFile.cpp | 2 +- src/server/worldserver/worldserver.conf.dist | 2 +- 15 files changed, 48 insertions(+), 48 deletions(-) (limited to 'src') diff --git a/src/server/game/Accounts/RBAC.h b/src/server/game/Accounts/RBAC.h index 5420df29d17..d2c76b71801 100644 --- a/src/server/game/Accounts/RBAC.h +++ b/src/server/game/Accounts/RBAC.h @@ -161,10 +161,10 @@ class RBACData: public RBACObject * @name HasPermission * @brief Checks if certain action is allowed * - * Checks if certain action can be performed. + * Checks if certain action can be performed. * * @return grant or deny action - * + * * Example Usage: * @code * bool Player::CanJoinArena(Battleground* bg) @@ -175,7 +175,7 @@ class RBACData: public RBACObject */ bool HasPermission(uint32 permission) { return _globalPerms.test(permission); } - // Functions enabled to be used by command system + // Functions enabled to be used by command system /// Returns all the granted permissions (after computation) RBACPermissionContainer const& GetPermissions() const { return _globalPerms; } /// Returns all the granted permissions @@ -197,12 +197,12 @@ class RBACData: public RBACObject * No save to db action will be performed. * * Fails if group Id does not exists or group already present - * + * * @param groupId group to be added * @param realmId realm affected * * @return Success or failure (with reason) to add the group - * + * * Example Usage: * @code * // previously defined "RBACData* rbac" with proper initialization @@ -222,12 +222,12 @@ class RBACData: public RBACObject * "all realms (-1)" in addition to the realm specified * * Fails if group not present - * + * * @param groupId group to be removed * @param realmId realm affected * * @return Success or failure (with reason) to remove the group - * + * * Example Usage: * // previously defined "RBACData* rbac" with proper initialization * uint32 groupId = 2; @@ -245,12 +245,12 @@ class RBACData: public RBACObject * No save to db action will be performed. * * Fails if role Id does not exists or role already granted or denied - * + * * @param roleId role to be granted * @param realmId realm affected * * @return Success or failure (with reason) to grant the role - * + * * Example Usage: * // previously defined "RBACData* rbac" with proper initialization * uint32 roleId = 2; @@ -268,12 +268,12 @@ class RBACData: public RBACObject * No save to db action will be performed. * * Fails if role Id does not exists or role already granted or denied - * + * * @param roleId role to be denied * @param realmId realm affected * * @return Success or failure (with reason) to deny the role - * + * * Example Usage: * // previously defined "RBACData* rbac" with proper initialization * uint32 roleId = 2; @@ -292,12 +292,12 @@ class RBACData: public RBACObject * "all realms (-1)" in addition to the realm specified * * Fails if role not present - * + * * @param roleId role to be removed * @param realmId realm affected * * @return Success or failure (with reason) to remove the role - * + * * Example Usage: * // previously defined "RBACData* rbac" with proper initialization * uint32 roleId = 2; @@ -315,12 +315,12 @@ class RBACData: public RBACObject * No save to db action will be performed. * * Fails if permission Id does not exists or permission already granted or denied - * + * * @param permissionId permission to be granted * @param realmId realm affected * * @return Success or failure (with reason) to grant the permission - * + * * Example Usage: * // previously defined "RBACData* rbac" with proper initialization * uint32 permissionId = 2; @@ -338,12 +338,12 @@ class RBACData: public RBACObject * No save to db action will be performed. * * Fails if permission Id does not exists or permission already granted or denied - * + * * @param permissionId permission to be denied * @param realmId realm affected * * @return Success or failure (with reason) to deny the permission - * + * * Example Usage: * // previously defined "RBACData* rbac" with proper initialization * uint32 permissionId = 2; @@ -362,12 +362,12 @@ class RBACData: public RBACObject * "all realms (-1)" in addition to the realm specified * * Fails if permission not present - * + * * @param permissionId permission to be removed * @param realmId realm affected * * @return Success or failure (with reason) to remove the permission - * + * * Example Usage: * // previously defined "RBACData* rbac" with proper initialization * uint32 permissionId = 2; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 043afdf4687..8597b6098a9 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -292,18 +292,18 @@ void ObjectMgr::AddLocaleString(std::string const& s, LocaleConstant locale, Str void ObjectMgr::LoadGraveyardOrientations() { uint32 oldMSTime = getMSTime(); - + _graveyardOrientations.clear(); - + QueryResult result = WorldDatabase.Query("SELECT id, orientation FROM graveyard_orientation"); - + if (!result) return; - + do { Field* fields = result->Fetch(); - + uint32 id = fields[0].GetUInt32(); if (!sWorldSafeLocsStore.LookupEntry(id)) { @@ -311,9 +311,9 @@ void ObjectMgr::LoadGraveyardOrientations() continue; } _graveyardOrientations[id] = fields[1].GetFloat(); - + } while (result->NextRow()); - + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %lu graveyard orientations in %u ms", (unsigned long)_graveyardOrientations.size(), GetMSTimeDiffToNow(oldMSTime)); } diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index 563b218c55c..8c14f902c1f 100644 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -1118,16 +1118,16 @@ class ObjectMgr return &iter->second; } - + float const* GetGraveyardOrientation(uint32 id) const { GraveyardOrientationContainer::const_iterator iter = _graveyardOrientations.find(id); if (iter != _graveyardOrientations.end()) return &iter->second; - + return NULL; } - + void AddVendorItem(uint32 entry, uint32 item, int32 maxcount, uint32 incrtime, uint32 extendedCost, uint8 type, bool persist = true); // for event bool RemoveVendorItem(uint32 entry, uint32 item, uint8 type, bool persist = true); // for event bool IsVendorItemValid(uint32 vendor_entry, uint32 id, int32 maxcount, uint32 ptime, uint32 ExtendedCost, uint8 type, Player* player = NULL, std::set* skip_vendors = NULL, uint32 ORnpcflag = 0) const; @@ -1163,7 +1163,7 @@ class ObjectMgr // for wintergrasp only GraveYardContainer GraveYardStore; - + static void AddLocaleString(std::string const& s, LocaleConstant locale, StringVector& data); static inline void GetLocaleString(const StringVector& data, int loc_idx, std::string& value) { @@ -1325,7 +1325,7 @@ class ObjectMgr CacheVendorItemContainer _cacheVendorItemStore; CacheTrainerSpellContainer _cacheTrainerSpellStore; - + GraveyardOrientationContainer _graveyardOrientations; std::set _difficultyEntries[MAX_DIFFICULTY - 1]; // already loaded difficulty 1 value in creatures, used in CheckCreatureTemplate diff --git a/src/server/game/Movement/Spline/MoveSplineInit.cpp b/src/server/game/Movement/Spline/MoveSplineInit.cpp index f7d876d7aa3..249f25a6353 100644 --- a/src/server/game/Movement/Spline/MoveSplineInit.cpp +++ b/src/server/game/Movement/Spline/MoveSplineInit.cpp @@ -118,7 +118,7 @@ namespace Movement PacketBuilder::WriteMonsterMove(move_spline, data); unit->SendMessageToSet(&data, true); - + return move_spline.Duration(); } diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index ef0c9b64475..4a1d1566af1 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1548,7 +1548,7 @@ void World::SetInitialWorldSettings() sObjectMgr->LoadGraveyardZones(); sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Graveyard Orientations..."); - sObjectMgr->LoadGraveyardOrientations(); + sObjectMgr->LoadGraveyardOrientations(); sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading spell pet auras..."); sSpellMgr->LoadSpellPetAuras(); diff --git a/src/server/scripts/Commands/cs_rbac.cpp b/src/server/scripts/Commands/cs_rbac.cpp index fb21def4c02..092aabb0045 100644 --- a/src/server/scripts/Commands/cs_rbac.cpp +++ b/src/server/scripts/Commands/cs_rbac.cpp @@ -674,7 +674,7 @@ public: handler->SetSentErrorMessage(true); return false; } - + handler->PSendSysMessage("%s", handler->GetTrinityString(LANG_RBAC_LIST_GROUPS_HEADER)); handler->PSendSysMessage(LANG_RBAC_LIST_ELEMENT, group->GetId(), group->GetName().c_str()); handler->PSendSysMessage("%s", handler->GetTrinityString(LANG_RBAC_LIST_ROLES_HEADER)); @@ -719,7 +719,7 @@ public: handler->SetSentErrorMessage(true); return false; } - + handler->PSendSysMessage("%s", handler->GetTrinityString(LANG_RBAC_LIST_ROLES_HEADER)); handler->PSendSysMessage(LANG_RBAC_LIST_ELEMENT, role->GetId(), role->GetName().c_str()); handler->PSendSysMessage("%s", handler->GetTrinityString(LANG_RBAC_LIST_PERMISSIONS_HEADER)); @@ -765,7 +765,7 @@ public: handler->SetSentErrorMessage(true); return false; } - + handler->PSendSysMessage("%s", handler->GetTrinityString(LANG_RBAC_LIST_PERMISSIONS_HEADER)); handler->PSendSysMessage(LANG_RBAC_LIST_ELEMENT, permission->GetId(), permission->GetName().c_str()); } diff --git a/src/server/scripts/EasternKingdoms/BaradinHold/boss_alizabal.cpp b/src/server/scripts/EasternKingdoms/BaradinHold/boss_alizabal.cpp index fe7f3f47161..3c6369003ec 100644 --- a/src/server/scripts/EasternKingdoms/BaradinHold/boss_alizabal.cpp +++ b/src/server/scripts/EasternKingdoms/BaradinHold/boss_alizabal.cpp @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2008-2013 TrinityCore * * This program is free software; you can redistribute it and/or modify it @@ -79,7 +79,7 @@ class boss_alizabal : public CreatureScript { public: boss_alizabal() : CreatureScript("boss_alizabal") { } - + struct boss_alizabalAI : public BossAI { boss_alizabalAI(Creature* creature) : BossAI(creature, DATA_ALIZABAL) @@ -253,7 +253,7 @@ class boss_alizabal : public CreatureScript break; } } - + DoMeleeAttackIfReady(); } }; diff --git a/src/server/scripts/EasternKingdoms/zone_western_plaguelands.cpp b/src/server/scripts/EasternKingdoms/zone_western_plaguelands.cpp index 6fa3401bcc9..c8bc82be245 100644 --- a/src/server/scripts/EasternKingdoms/zone_western_plaguelands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_western_plaguelands.cpp @@ -256,7 +256,7 @@ public: struct npc_andorhal_towerAI : public ScriptedAI { - npc_andorhal_towerAI(Creature* creature) : ScriptedAI(creature) + npc_andorhal_towerAI(Creature* creature) : ScriptedAI(creature) { SetCombatMovement(false); } diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp index a9bf8c6ea8f..d84091e3cc7 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp @@ -976,7 +976,7 @@ class npc_meteor_strike_initial : public CreatureScript { npc_meteor_strike_initialAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) - { + { SetCombatMovement(false); } diff --git a/src/server/scripts/Northrend/zone_icecrown.cpp b/src/server/scripts/Northrend/zone_icecrown.cpp index 47fb7a86d32..70210844394 100644 --- a/src/server/scripts/Northrend/zone_icecrown.cpp +++ b/src/server/scripts/Northrend/zone_icecrown.cpp @@ -266,7 +266,7 @@ public: struct npc_guardian_pavilionAI : public ScriptedAI { - npc_guardian_pavilionAI(Creature* creature) : ScriptedAI(creature) + npc_guardian_pavilionAI(Creature* creature) : ScriptedAI(creature) { SetCombatMovement(false); } diff --git a/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp b/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp index 90b265e2a65..2fac33760e2 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp @@ -274,7 +274,7 @@ public: struct npc_volcanoAI : public ScriptedAI { - npc_volcanoAI(Creature* creature) : ScriptedAI(creature) + npc_volcanoAI(Creature* creature) : ScriptedAI(creature) { SetCombatMovement(false); } diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp index 8d66e0824b9..c4111f59d65 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp @@ -1406,7 +1406,7 @@ class mob_kael_flamestrike : public CreatureScript } struct mob_kael_flamestrikeAI : public ScriptedAI { - mob_kael_flamestrikeAI(Creature* creature) : ScriptedAI(creature) + mob_kael_flamestrikeAI(Creature* creature) : ScriptedAI(creature) { SetCombatMovement(false); } diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index a581a6ee351..ac9b861f584 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -56,7 +56,7 @@ enum PaladinSpells SPELL_PALADIN_DIVINE_SACRIFICE = 64205, SPELL_PALADIN_DIVINE_PURPOSE_PROC = 90174, - + SPELL_PALADIN_GLYPH_OF_SALVATION = 63225, SPELL_PALADIN_RIGHTEOUS_DEFENSE_TAUNT = 31790, @@ -874,7 +874,7 @@ class spell_pal_templar_s_verdict : public SpellScriptLoader } void ChangeDamage(SpellEffIndex /*effIndex*/) - { + { Unit* caster = GetCaster(); int32 damage = GetHitDamage(); diff --git a/src/server/shared/Logging/AppenderFile.cpp b/src/server/shared/Logging/AppenderFile.cpp index e29459299f7..93d53bcc30d 100644 --- a/src/server/shared/Logging/AppenderFile.cpp +++ b/src/server/shared/Logging/AppenderFile.cpp @@ -48,7 +48,7 @@ void AppenderFile::_write(LogMessage const& message) snprintf(namebuf, TRINITY_PATH_MAX, filename.c_str(), message.param1.c_str()); logfile = OpenFile(namebuf, mode, backup || exceedMaxSize); } - else if (exceedMaxSize) + else if (exceedMaxSize) logfile = OpenFile(filename, "w", true); if (!logfile) diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index 0fc26eae9cd..35d37d97f79 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -2674,7 +2674,7 @@ UI.ShowQuestLevelsInDialogs = 0 # Maximum value is 4294967295 (4 gb). Leave blank for no limit. # NOTE: Does not work with dynamic filenames. # Example: 536870912 (512 mb) -# +# Appender.Console=1,3,0 Appender.Server=2,2,0,Server.log,w -- cgit v1.2.3 From 82f7b337b2dafd16506033cdbfecc979bc6f7119 Mon Sep 17 00:00:00 2001 From: Shocker Date: Sun, 10 Feb 2013 20:20:36 +0200 Subject: Core/Opcodes: Prevent invalid memory access with custom opcodes --- src/server/game/Server/WorldSocket.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index 9e3c47caea2..24406cdbdab 100644 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -733,6 +733,10 @@ int WorldSocket::ProcessIncoming(WorldPacket* new_pct) return -1; } + // prevent invalid memory access/crash with custom opcodes + if (opcode >= NUM_OPCODE_HANDLERS) + return 0; + OpcodeHandler const* handler = opcodeTable[opcode]; if (!handler || handler->Status == STATUS_UNHANDLED) { -- cgit v1.2.3 From 1a1c53d889fdeec8b6d384cf5f3a0f51d8047eed Mon Sep 17 00:00:00 2001 From: Nay Date: Wed, 27 Feb 2013 08:05:51 +0000 Subject: Core/Loading: Fix LoadCreatureTemplates --- src/server/game/Globals/ObjectMgr.cpp | 38 +++++++++++++++++------------------ 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index a29227462ea..4a59967234f 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -506,28 +506,28 @@ void ObjectMgr::LoadCreatureTemplates() for (uint8 i = 0; i < CREATURE_MAX_SPELLS; ++i) creatureTemplate.spells[i] = fields[55 + i].GetUInt32(); - creatureTemplate.PetSpellDataId = fields[63].GetUInt32(); - creatureTemplate.VehicleId = fields[64].GetUInt32(); - creatureTemplate.mingold = fields[65].GetUInt32(); - creatureTemplate.maxgold = fields[66].GetUInt32(); - creatureTemplate.AIName = fields[67].GetString(); - creatureTemplate.MovementType = uint32(fields[68].GetUInt8()); - creatureTemplate.InhabitType = uint32(fields[69].GetUInt8()); - creatureTemplate.HoverHeight = fields[70].GetFloat(); - creatureTemplate.ModHealth = fields[71].GetFloat(); - creatureTemplate.ModMana = fields[72].GetFloat(); - creatureTemplate.ModManaExtra = fields[73].GetFloat(); - creatureTemplate.ModArmor = fields[74].GetFloat(); - creatureTemplate.RacialLeader = fields[75].GetBool(); + creatureTemplate.PetSpellDataId = fields[65].GetUInt32(); + creatureTemplate.VehicleId = fields[66].GetUInt32(); + creatureTemplate.mingold = fields[67].GetUInt32(); + creatureTemplate.maxgold = fields[68].GetUInt32(); + creatureTemplate.AIName = fields[69].GetString(); + creatureTemplate.MovementType = uint32(fields[70].GetUInt8()); + creatureTemplate.InhabitType = uint32(fields[71].GetUInt8()); + creatureTemplate.HoverHeight = fields[72].GetFloat(); + creatureTemplate.ModHealth = fields[73].GetFloat(); + creatureTemplate.ModMana = fields[74].GetFloat(); + creatureTemplate.ModManaExtra = fields[75].GetFloat(); + creatureTemplate.ModArmor = fields[76].GetFloat(); + creatureTemplate.RacialLeader = fields[77].GetBool(); for (uint8 i = 0; i < MAX_CREATURE_QUEST_ITEMS; ++i) - creatureTemplate.questItems[i] = fields[76 + i].GetUInt32(); + creatureTemplate.questItems[i] = fields[78 + i].GetUInt32(); - creatureTemplate.movementId = fields[82].GetUInt32(); - creatureTemplate.RegenHealth = fields[83].GetBool(); - creatureTemplate.MechanicImmuneMask = fields[84].GetUInt32(); - creatureTemplate.flags_extra = fields[85].GetUInt32(); - creatureTemplate.ScriptID = GetScriptId(fields[86].GetCString()); + creatureTemplate.movementId = fields[84].GetUInt32(); + creatureTemplate.RegenHealth = fields[85].GetBool(); + creatureTemplate.MechanicImmuneMask = fields[86].GetUInt32(); + creatureTemplate.flags_extra = fields[87].GetUInt32(); + creatureTemplate.ScriptID = GetScriptId(fields[88].GetCString()); ++count; } -- cgit v1.2.3 From 052e47780ef9852665287fe76edd51a5911674b0 Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Wed, 27 Feb 2013 18:22:12 +0100 Subject: Core/ZulGurub: Move mondokir hardcoded spawn in db --- .../2013_02_27_00_world_creature_summon_groups_434.sql | 10 ++++++++++ .../scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp | 16 +++------------- 2 files changed, 13 insertions(+), 13 deletions(-) create mode 100644 sql/updates/world/2013_02_27_00_world_creature_summon_groups_434.sql (limited to 'src') diff --git a/sql/updates/world/2013_02_27_00_world_creature_summon_groups_434.sql b/sql/updates/world/2013_02_27_00_world_creature_summon_groups_434.sql new file mode 100644 index 00000000000..4cdd26a83e8 --- /dev/null +++ b/sql/updates/world/2013_02_27_00_world_creature_summon_groups_434.sql @@ -0,0 +1,10 @@ +DELETE FROM `creature_summon_groups` WHERE `summonerId`=52151 AND `groupId`=0; +INSERT INTO `creature_summon_groups` (`summonerId`, `summonerType`, `groupId`, `entry`, `position_x`, `position_y`, `position_z`, `orientation`, `summonType`, `summonTime`) VALUES +(52151, 0, 0, 52156, -12330.3, -1878.41, 127.32, 3.89208, 8, 0), +(52151, 0, 0, 52156, -12351.94, -1861.51, 127.4807, 4.677482, 8, 0), +(52151, 0, 0, 52156, -12326.71, -1904.328, 127.4111, 2.75762, 8, 0), +(52151, 0, 0, 52156, -12347.41, -1917.535, 127.3196, 1.553343, 8, 0), +(52151, 0, 0, 52156, -12378.57, -1861.222, 127.5416, 5.340707, 8, 0), +(52151, 0, 0, 52156, -12397.79, -1887.731, 127.5453, 0.03490658, 8, 0), +(52151, 0, 0, 52156, -12372.36, -1918.844, 127.343, 1.151917, 8, 0), +(52151, 0, 0, 52156, -12391.23, -1905.273, 127.3196, 0.6108652, 8, 0); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp index 3cc4cf77cb7..116fd18e458 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp @@ -94,17 +94,9 @@ enum Misc FACTION_NONE = 1665 }; -// ToDo: Need better respawn support -Position const ChainedSpiritsSpawnPos[8] = +enum SummonGroups { - { -12330.34f, -1878.406f, 127.3196f, 3.892084f }, - { -12351.94f, -1861.51f, 127.4807f, 4.677482f }, - { -12326.71f, -1904.328f, 127.4111f, 2.75762f }, - { -12347.41f, -1917.535f, 127.3196f, 1.553343f }, - { -12378.57f, -1861.222f, 127.5416f, 5.340707f }, - { -12397.79f, -1887.731f, 127.5453f, 0.03490658f }, - { -12372.36f, -1918.844f, 127.343f, 1.151917f }, - { -12391.23f, -1905.273f, 127.3196f, 0.6108652f } + SUMMON_GROUP_CHAINED_SPIRIT = 0 }; class boss_mandokir : public CreatureScript @@ -123,9 +115,7 @@ class boss_mandokir : public CreatureScript _Reset(); - for (uint8 i = 0; i < 8; ++i) - me->SummonCreature(NPC_CHAINED_SPIRIT, ChainedSpiritsSpawnPos[i]); - + me->SummonCreatureGroup(SUMMON_GROUP_CHAINED_SPIRIT); _ohganotSoFast = true; _reanimateOhganCooldown = false; _reviveGUID = 0; -- cgit v1.2.3 From 47d7c3a6adbc9f11066a26136bbad440ee3c8641 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 28 Feb 2013 20:34:10 +0100 Subject: Core/Spells: Implemented SPELL_ATTR8_ATTACK_IGNORE_IMMUNE_TO_PC_FLAG --- src/server/game/Entities/Unit/Unit.cpp | 10 +++++++--- src/server/game/Miscellaneous/SharedDefines.h | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 491b469841c..97758b3d0b7 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -10536,13 +10536,17 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell, Wo if (playerAttacker->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_UBER)) return false; } + // check flags if (target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_TAXI_FLIGHT | UNIT_FLAG_NOT_ATTACKABLE_1 | UNIT_FLAG_UNK_16) || (!HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE) && target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC)) - || (!target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE) && HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC)) - || (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE) && target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC)) + || (!target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE) && HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC))) + return false; + + if ((!bySpell || !(bySpell->AttributesEx8 & SPELL_ATTR8_ATTACK_IGNORE_IMMUNE_TO_PC_FLAG)) + && (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE) && target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC)) // check if this is a world trigger cast - GOs are using world triggers to cast their spells, so we need to ignore their immunity flag here, this is a temp workaround, needs removal when go cast is implemented properly - || (GetEntry() != WORLD_TRIGGER && target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE) && HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC))) + && GetEntry() != WORLD_TRIGGER) return false; // CvC case - can attack each other only when one of them is hostile diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 035e658bd69..0a2761abf6c 100644 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -596,7 +596,7 @@ enum SpellAttr8 SPELL_ATTR8_NOT_IN_BG_OR_ARENA = 0x10000000, // 28 not allow to cast or deactivate currently active effect, not sure about Fast Track SPELL_ATTR8_MASTERY_SPECIALIZATION = 0x20000000, // 29 SPELL_ATTR8_UNK30 = 0x40000000, // 30 - SPELL_ATTR8_UNK31 = 0x80000000 // 31 + SPELL_ATTR8_ATTACK_IGNORE_IMMUNE_TO_PC_FLAG = 0x80000000 // 31 Do not check UNIT_FLAG_IMMUNE_TO_PC in IsValidAttackTarget }; enum SpellAttr9 -- cgit v1.2.3 From 72d63bb22f0f9a332da2cfe2a0d4cfddb7e9173c Mon Sep 17 00:00:00 2001 From: Kinzcool Date: Thu, 28 Feb 2013 22:20:52 -0500 Subject: Core/Enums: Updated emotes & animations enums to 4.3.4 --- src/server/game/Miscellaneous/SharedDefines.h | 173 +++++++++++++++++++++++++- 1 file changed, 170 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index a54e671d7d0..2adaa196ed0 100644 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -1974,7 +1974,8 @@ enum TextEmotes TEXT_EMOTE_LOOK = 449, TEXT_EMOTE_OBJECT = 450, TEXT_EMOTE_SWEAT = 451, - TEXT_EMOTE_YW = 453 + TEXT_EMOTE_YW = 453, + TEXT_EMOTE_READ = 456 }; // Emotes.dbc @@ -2154,7 +2155,19 @@ enum Emote EMOTE_STATE_STRANGULATE = 473, EMOTE_STATE_READY_SPELL_OMNI = 474, EMOTE_STATE_HOLD_JOUST = 475, - EMOTE_ONESHOT_CRY_JAINA = 476 + EMOTE_ONESHOT_CRY_JAINA = 476, + EMOTE_ONESHOT_SPECIAL_UNARMED = 477, + EMOTE_STATE_DANCE_NOSHEATHE = 478, + EMOTE_ONESHOT_SNIFF = 479, + EMOTE_ONESHOT_DRAGONSTOMP = 480, + EMOTE_ONESHOT_KNOCKDOWN = 482, + EMOTE_STATE_READ = 483, + EMOTE_ONESHOT_FLYEMOTETALK = 485, + EMOTE_STATE_READ_ALLOWMOVEMENT = 492, + EMOTE_STATE_READY1H_ALLOW_MOVEMENT = 505, + EMOTE_STATE_READY2H_ALLOW_MOVEMENT = 506, + EMOTE_ONESHOT_OPEN = 517, + EMOTE_STATE_READ_CHRISTMAS = 518 }; // AnimationData.dbc @@ -2665,7 +2678,161 @@ enum Anim ANIM_CARRY2H = 502, ANIM_CARRIED2H = 503, ANIM_FLY_CARRY2H = 504, - ANIM_FLY_CARRIED2H = 505 + ANIM_FLY_CARRIED2H = 505, + ANIM_EMOTE_SNIFF = 506, + ANIM_EMOTE_FLY_SNIFF = 507, + ANIM_ATTACK_FIST1H = 508, + ANIM_FLY_ATTACK_FIST1H = 509, + ANIM_ATTACK_FIST_1H_OFF = 510, + ANIM_FLY_ATTACK_FIST_1H_OFF = 511, + ANIM_PARRY_FIST1H = 512, + ANIM_FLY_PARRY_FIST1H = 513, + ANIM_READY_FIST1H = 514, + ANIM_FLY_READY_FIST1H = 515, + ANIM_SPECIAL_FIST1H = 516, + ANIM_FLY_SPECIAL_FIST1H = 517, + ANIM_EMOTE_READ_START = 518, + ANIM_FLY_EMOTE_READ_START = 519, + ANIM_EMOTE_READ_LOOP = 520, + ANIM_FLY_EMOTE_READ_LOOP = 521, + ANIM_EMOTE_READ_END = 522, + ANIM_FLY_EMOTE_READ_END = 523, + ANIM_SWIM_RUN = 524, + ANIM_FLY_SWIM_RUN = 525, + ANIM_SWIM_WALK = 526, + ANIM_FLY_SWIM_WALK = 527, + ANIM_SWIM_WALK_BACKWARDS = 528, + ANIM_FLY_SWIM_WALK_BACKWARDS = 529, + ANIM_SWIM_SPRINT = 530, + ANIM_FLY_SWIM_SPRINT = 531, + ANIM_MOUNT_SWIM_IDLE = 532, + ANIM_FLY_MOUNT_SWIM_IDLE = 533, + ANIM_MOUNT_SWIM_BACKWARDS = 534, + ANIM_FLY_MOUNT_SWIM_BACKWARDS = 535, + ANIM_MOUNT_SWIM_LEFT = 536, + ANIM_FLY_MOUNT_SWIM_LEFT = 537, + ANIM_MOUNT_SWIM_RIGHT = 538, + ANIM_FLY_MOUNT_SWIM_RIGHT = 539, + ANIM_MOUNT_SWIM_RUN = 540, + ANIM_FLY_MOUNT_SWIM_RUN = 541, + ANIM_MOUNT_SWIM_SPRINT = 542, + ANIM_FLY_MOUNT_SWIM_SPRINT = 543, + ANIM_MOUNT_SWIM_WALK = 544, + ANIM_FLY_MOUNT_SWIM_WALK = 545, + ANIM_MOUNT_SWIM_WALK_BACKWARDS = 546, + ANIM_FLY_MOUNT_SWIM_WALK_BACKWARDS = 547, + ANIM_MOUNT_FLIGHT_IDLE = 548, + ANIM_FLY_MOUNT_FLIGHT_IDLE = 549, + ANIM_MOUNT_FLIGHT_BACKWARDS = 550, + ANIM_FLY_MOUNT_FLIGHT_BACKWARDS = 551, + ANIM_MOUNT_FLIGHT_LEFT = 552, + ANIM_FLY_MOUNT_FLIGHT_LEFT = 553, + ANIM_MOUNT_FLIGHT_RIGHT = 554, + ANIM_FLY_MOUNT_FLIGHT_RIGHT = 555, + ANIM_MOUNT_FLIGHT_RUN = 556, + ANIM_FLY_MOUNT_FLIGHT_RUN = 557, + ANIM_MOUNT_FLIGHT_SPRINT = 558, + ANIM_FLY_MOUNT_FLIGHT_SPRINT = 559, + ANIM_MOUNT_FLIGHT_WALK = 560, + ANIM_FLY_MOUNT_FLIGHT_WALK = 561, + ANIM_MOUNT_FLIGHT_WALK_BACKWARDS = 562, + ANIM_FLY_MOUNT_FLIGHT_WALK_BACKWARDS = 563, + ANIM_MOUNT_FLIGHT_START = 564, + ANIM_FLY_MOUNT_FLIGHT_START = 565, + ANIM_MOUNT_SWIM_START = 566, + ANIM_FLY_MOUNT_SWIM_START = 567, + ANIM_MOUNT_SWIM_LAND = 568, + ANIM_FLY_MOUNT_SWIM_LAND = 569, + ANIM_MOUNT_SWIM_LAND_RUN = 570, + ANIM_FLY_MOUNT_SWIM_LAND_RUN = 571, + ANIM_MOUNT_FLIGHT_LAND = 572, + ANIM_FLY_MOUNT_FLIGHT_LAND = 573, + ANIM_MOUNT_FLIGHT_LAND_RUN = 574, + ANIM_FLY_MOUNT_FLIGHT_LAND_RUN = 575, + ANIM_READY_BLOW_DART = 576, + ANIM_FLY_READY_BLOW_DART = 577, + ANIM_LOAD_BLOW_DART = 578, + ANIM_FLY_LOAD_BLOW_DART = 579, + ANIM_HOLD_BLOW_DART = 580, + ANIM_FLY_HOLD_BLOW_DART = 581, + ANIM_ATTACK_BLOW_DART = 582, + ANIM_FLY_ATTACK_BLOW_DART = 583, + ANIM_CARRIAGE_MOUNT = 584, + ANIM_FLY_CARRIAGE_MOUNT = 585, + ANIM_CARRIAGE_PASSENGER_MOUNT = 586, + ANIM_FLY_CARRIAGE_PASSENGER_MOUNT = 587, + ANIM_CARRIAGE_MOUNT_ATTACK = 588, + ANIM_FLY_CARRIAGE_MOUNT_ATTACK = 589, + ANIM_BARTENDER_STAND = 590, + ANIM_FLY_BARTENDER_STAND = 591, + ANIM_BARTENDER_WALK = 592, + ANIM_FLY_BARTENDER_WALK = 593, + ANIM_BARTENDER_RUN = 594, + ANIM_FLY_BARTENDER_RUN = 595, + ANIM_BARTENDER_SHUFFLE_LEFT = 596, + ANIM_FLY_BARTENDER_SHUFFLE_LEFT = 597, + ANIM_BARTENDER_SHUFFLE_RIGHT = 598, + ANIM_FLY_BARTENDER_SHUFFLE_RIGHT = 599, + ANIM_BARTENDER_EMOTE_TALK = 600, + ANIM_FLY_BARTENDER_EMOTE_TALK = 601, + ANIM_BARTENDER_EMOTE_POINT = 602, + ANIM_FLY_BARTENDER_EMOTE_POINT = 603, + ANIM_BARMAID_STAND = 604, + ANIM_FLY_BARMAID_STAND = 605, + ANIM_BARMAID_WALK = 606, + ANIM_FLY_BARMAID_WALK = 607, + ANIM_BARMAID_RUN = 608, + ANIM_FLY_BARMAID_RUN = 609, + ANIM_BARMAID_SHUFFLE_LEFT = 610, + ANIM_FLY_BARMAID_SHUFFLE_LEFT = 611, + ANIM_BARMAID_SHUFFLE_RIGHT = 612, + ANIM_FLY_BARMAID_SHUFFLE_RIGHT = 613, + ANIM_BARMAID_EMOTE_TALK = 614, + ANIM_FLY_BARMAID_EMOTE_TALK = 615, + ANIM_BARMAID_EMOTE_POINT = 616, + ANIM_FLY_BARMAID_EMOTE_POINT = 617, + ANIM_MOUNT_SELF_IDLE = 618, + ANIM_FLY_MOUNT_SELF_IDLE = 619, + ANIM_MOUNT_SELF_WALK = 620, + ANIM_FLY_MOUNT_SELF_WALK = 621, + ANIM_MOUNT_SELF_RUN = 622, + ANIM_FLY_MOUNT_SELF_RUN = 623, + ANIM_MOUNT_SELF_SPRINT = 624, + ANIM_FLY_MOUNT_SELF_SPRINT = 625, + ANIM_MOUNT_SELF_RUN_LEFT = 626, + ANIM_FLY_MOUNT_SELF_RUN_LEFT = 627, + ANIM_MOUNT_SELF_RUN_RIGHT = 628, + ANIM_FLY_MOUNT_SELF_RUN_RIGHT = 629, + ANIM_MOUNT_SELF_SHUFFLE_LEFT = 630, + ANIM_FLY_MOUNT_SELF_SHUFFLE_LEFT = 631, + ANIM_MOUNT_SELF_SHUFFLE_RIGHT = 632, + ANIM_FLY_MOUNT_SELF_SHUFFLE_RIGHT = 633, + ANIM_MOUNT_SELF_WALK_BACKWARDS = 634, + ANIM_FLY_MOUNT_SELF_WALK_BACKWARDS = 635, + ANIM_MOUNT_SELF_SPECIAL = 636, + ANIM_FLY_MOUNT_SELF_SPECIAL = 637, + ANIM_MOUNT_SELF_JUMP = 638, + ANIM_FLY_MOUNT_SELF_JUMP = 639, + ANIM_MOUNT_SELF_JUMP_START = 640, + ANIM_FLY_MOUNT_SELF_JUMP_START = 641, + ANIM_MOUNT_SELF_JUMP_END = 642, + ANIM_FLY_MOUNT_SELF_JUMP_END = 643, + ANIM_MOUNT_SELF_JUMP_LAND_RUN = 644, + ANIM_FLY_MOUNT_SELF_JUMP_LAND_RUN = 645, + ANIM_MOUNT_SELF_START = 646, + ANIM_FLY_MOUNT_SELF_START = 647, + ANIM_MOUNT_SELF_FALL = 648, + ANIM_FLY_MOUNT_SELF_FALL = 649, + ANIM_STORMSTRIKE = 650, + ANIM_FLY_STORMSTRIKE = 651, + ANIM_READY_JOUST_NO_SHEATHE = 652, + ANIM_FLY_READY_JOUST_NO_SHEATHE = 653, + ANIM_SLAM = 654, + ANIM_FLY_SLAM = 655, + ANIM_DEATH_STRIKE = 656, + ANIM_FLY_DEATH_STRIKE = 657, + ANIM_SWIM_ATTACK_UNARMED = 658, + ANIM_FLY_SWIM_ATTACK_UNARMED = 659 }; enum LockKeyType -- cgit v1.2.3 From 943610cbca1d18db348a35749863648a814bdfc0 Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 2 Mar 2013 16:41:04 +0000 Subject: Core/Loading: Fix CreatureLoadTemplates and add missing fields to WORLD_SEL_CREATURE_TEMPLATE --- src/server/game/Globals/ObjectMgr.cpp | 44 +++---- src/server/scripts/Commands/cs_reload.cpp | 134 ++++++++++----------- .../Database/Implementation/WorldDatabase.cpp | 2 +- 3 files changed, 88 insertions(+), 92 deletions(-) (limited to 'src') diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 4a59967234f..9a28de30104 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -423,11 +423,11 @@ void ObjectMgr::LoadCreatureTemplates() "dynamicflags, family, trainer_type, trainer_class, trainer_race, minrangedmg, maxrangedmg, rangedattackpower, type, " // 44 45 46 47 48 49 50 51 52 53 54 "type_flags, type_flags2, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, " - // 55 56 59 60 61 62 63 64 65 66 67 68 69 70 + // 55 56 57 58 59 60 61 62 63 64 65 66 67 68 "spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, PetSpellDataId, VehicleId, mingold, maxgold, AIName, MovementType, " - // 71 72 73 74 75 76 77 78 79 80 81 82 + // 69 70 71 72 73 74 75 76 77 78 79 80 "InhabitType, HoverHeight, Health_mod, Mana_mod, Mana_mod_extra, Armor_mod, RacialLeader, questItem1, questItem2, questItem3, questItem4, questItem5, " - // 83 84 85 86 87 88 + // 81 82 83 84 85 86 " questItem6, movementId, RegenHealth, mechanic_immune_mask, flags_extra, ScriptName " "FROM creature_template;"); @@ -506,28 +506,28 @@ void ObjectMgr::LoadCreatureTemplates() for (uint8 i = 0; i < CREATURE_MAX_SPELLS; ++i) creatureTemplate.spells[i] = fields[55 + i].GetUInt32(); - creatureTemplate.PetSpellDataId = fields[65].GetUInt32(); - creatureTemplate.VehicleId = fields[66].GetUInt32(); - creatureTemplate.mingold = fields[67].GetUInt32(); - creatureTemplate.maxgold = fields[68].GetUInt32(); - creatureTemplate.AIName = fields[69].GetString(); - creatureTemplate.MovementType = uint32(fields[70].GetUInt8()); - creatureTemplate.InhabitType = uint32(fields[71].GetUInt8()); - creatureTemplate.HoverHeight = fields[72].GetFloat(); - creatureTemplate.ModHealth = fields[73].GetFloat(); - creatureTemplate.ModMana = fields[74].GetFloat(); - creatureTemplate.ModManaExtra = fields[75].GetFloat(); - creatureTemplate.ModArmor = fields[76].GetFloat(); - creatureTemplate.RacialLeader = fields[77].GetBool(); + creatureTemplate.PetSpellDataId = fields[63].GetUInt32(); + creatureTemplate.VehicleId = fields[64].GetUInt32(); + creatureTemplate.mingold = fields[65].GetUInt32(); + creatureTemplate.maxgold = fields[66].GetUInt32(); + creatureTemplate.AIName = fields[67].GetString(); + creatureTemplate.MovementType = uint32(fields[68].GetUInt8()); + creatureTemplate.InhabitType = uint32(fields[69].GetUInt8()); + creatureTemplate.HoverHeight = fields[70].GetFloat(); + creatureTemplate.ModHealth = fields[71].GetFloat(); + creatureTemplate.ModMana = fields[72].GetFloat(); + creatureTemplate.ModManaExtra = fields[73].GetFloat(); + creatureTemplate.ModArmor = fields[74].GetFloat(); + creatureTemplate.RacialLeader = fields[75].GetBool(); for (uint8 i = 0; i < MAX_CREATURE_QUEST_ITEMS; ++i) - creatureTemplate.questItems[i] = fields[78 + i].GetUInt32(); + creatureTemplate.questItems[i] = fields[76 + i].GetUInt32(); - creatureTemplate.movementId = fields[84].GetUInt32(); - creatureTemplate.RegenHealth = fields[85].GetBool(); - creatureTemplate.MechanicImmuneMask = fields[86].GetUInt32(); - creatureTemplate.flags_extra = fields[87].GetUInt32(); - creatureTemplate.ScriptID = GetScriptId(fields[88].GetCString()); + creatureTemplate.movementId = fields[82].GetUInt32(); + creatureTemplate.RegenHealth = fields[83].GetBool(); + creatureTemplate.MechanicImmuneMask = fields[84].GetUInt32(); + creatureTemplate.flags_extra = fields[85].GetUInt32(); + creatureTemplate.ScriptID = GetScriptId(fields[86].GetCString()); ++count; } diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp index 76045a249be..5211568b096 100644 --- a/src/server/scripts/Commands/cs_reload.cpp +++ b/src/server/scripts/Commands/cs_reload.cpp @@ -429,11 +429,12 @@ public: Field* fields = result->Fetch(); - cInfo->DifficultyEntry[0] = fields[0].GetUInt32(); - cInfo->DifficultyEntry[1] = fields[1].GetUInt32(); - cInfo->DifficultyEntry[2] = fields[2].GetUInt32(); - cInfo->KillCredit[0] = fields[3].GetUInt32(); - cInfo->KillCredit[1] = fields[4].GetUInt32(); + for (uint8 i = 0; i < MAX_DIFFICULTY - 1; ++i) + cInfo.DifficultyEntry[i] = fields[0 + i].GetUInt32(); + + for (uint8 i = 0; i < MAX_KILL_CREDIT; ++i) + cInfo.KillCredit[i] = fields[3 + i].GetUInt32(); + cInfo->Modelid1 = fields[5].GetUInt32(); cInfo->Modelid2 = fields[6].GetUInt32(); cInfo->Modelid3 = fields[7].GetUInt32(); @@ -445,72 +446,67 @@ public: cInfo->minlevel = fields[13].GetUInt8(); cInfo->maxlevel = fields[14].GetUInt8(); cInfo->expansion = fields[15].GetUInt16(); - cInfo->faction_A = fields[16].GetUInt16(); - cInfo->faction_H = fields[17].GetUInt16(); - cInfo->npcflag = fields[18].GetUInt32(); - cInfo->speed_walk = fields[19].GetFloat(); - cInfo->speed_run = fields[20].GetFloat(); - cInfo->scale = fields[21].GetFloat(); - cInfo->rank = fields[22].GetUInt8(); - cInfo->mindmg = fields[23].GetFloat(); - cInfo->maxdmg = fields[24].GetFloat(); - cInfo->dmgschool = fields[25].GetUInt8(); - cInfo->attackpower = fields[26].GetUInt32(); - cInfo->dmg_multiplier = fields[27].GetFloat(); - cInfo->baseattacktime = fields[28].GetUInt32(); - cInfo->rangeattacktime = fields[29].GetUInt32(); - cInfo->unit_class = fields[30].GetUInt8(); - cInfo->unit_flags = fields[31].GetUInt32(); - cInfo->unit_flags2 = fields[32].GetUInt32(); - cInfo->dynamicflags = fields[33].GetUInt32(); - cInfo->family = fields[34].GetUInt8(); - cInfo->trainer_type = fields[35].GetUInt8(); - cInfo->trainer_class = fields[36].GetUInt8(); - cInfo->trainer_race = fields[37].GetUInt8(); - cInfo->minrangedmg = fields[38].GetFloat(); - cInfo->maxrangedmg = fields[39].GetFloat(); - cInfo->rangedattackpower = fields[40].GetUInt16(); - cInfo->type = fields[41].GetUInt8(); - cInfo->type_flags = fields[42].GetUInt32(); - cInfo->lootid = fields[43].GetUInt32(); - cInfo->pickpocketLootId = fields[44].GetUInt32(); - cInfo->SkinLootId = fields[45].GetUInt32(); + cInfo->expansionUnknown = fields[16].GetUInt16(); + cInfo->faction_A = fields[17].GetUInt16(); + cInfo->faction_H = fields[18].GetUInt16(); + cInfo->npcflag = fields[19].GetUInt32(); + cInfo->speed_walk = fields[20].GetFloat(); + cInfo->speed_run = fields[21].GetFloat(); + cInfo->scale = fields[22].GetFloat(); + cInfo->rank = fields[23].GetUInt8(); + cInfo->mindmg = fields[24].GetFloat(); + cInfo->maxdmg = fields[25].GetFloat(); + cInfo->dmgschool = fields[26].GetUInt8(); + cInfo->attackpower = fields[27].GetUInt32(); + cInfo->dmg_multiplier = fields[28].GetFloat(); + cInfo->baseattacktime = fields[29].GetUInt32(); + cInfo->rangeattacktime = fields[30].GetUInt32(); + cInfo->unit_class = fields[31].GetUInt8(); + cInfo->unit_flags = fields[32].GetUInt32(); + cInfo->unit_flags2 = fields[33].GetUInt32(); + cInfo->dynamicflags = fields[34].GetUInt32(); + cInfo->family = fields[35].GetUInt8(); + cInfo->trainer_type = fields[36].GetUInt8(); + cInfo->trainer_class = fields[37].GetUInt8(); + cInfo->trainer_race = fields[38].GetUInt8(); + cInfo->minrangedmg = fields[39].GetFloat(); + cInfo->maxrangedmg = fields[40].GetFloat(); + cInfo->rangedattackpower = fields[41].GetUInt16(); + cInfo->type = fields[42].GetUInt8(); + cInfo->type_flags = fields[43].GetUInt32(); + cInfo->type_flags2 = fields[44].GetUInt32(); + cInfo->lootid = fields[45].GetUInt32(); + cInfo->pickpocketLootId = fields[46].GetUInt32(); + cInfo->SkinLootId = fields[47].GetUInt32(); for (uint8 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i) - cInfo->resistance[i] = fields[46 + i -1].GetUInt16(); - - cInfo->spells[0] = fields[52].GetUInt32(); - cInfo->spells[1] = fields[53].GetUInt32(); - cInfo->spells[2] = fields[54].GetUInt32(); - cInfo->spells[3] = fields[55].GetUInt32(); - cInfo->spells[4] = fields[56].GetUInt32(); - cInfo->spells[5] = fields[57].GetUInt32(); - cInfo->spells[6] = fields[58].GetUInt32(); - cInfo->spells[7] = fields[59].GetUInt32(); - cInfo->PetSpellDataId = fields[60].GetUInt32(); - cInfo->VehicleId = fields[61].GetUInt32(); - cInfo->mingold = fields[62].GetUInt32(); - cInfo->maxgold = fields[63].GetUInt32(); - cInfo->AIName = fields[64].GetString(); - cInfo->MovementType = fields[65].GetUInt8(); - cInfo->InhabitType = fields[66].GetUInt8(); - cInfo->HoverHeight = fields[67].GetFloat(); - cInfo->ModHealth = fields[68].GetFloat(); - cInfo->ModMana = fields[69].GetFloat(); - cInfo->ModManaExtra = fields[70].GetFloat(); - cInfo->ModArmor = fields[71].GetFloat(); - cInfo->RacialLeader = fields[72].GetBool(); - cInfo->questItems[0] = fields[73].GetUInt32(); - cInfo->questItems[1] = fields[74].GetUInt32(); - cInfo->questItems[2] = fields[75].GetUInt32(); - cInfo->questItems[3] = fields[76].GetUInt32(); - cInfo->questItems[4] = fields[77].GetUInt32(); - cInfo->questItems[5] = fields[78].GetUInt32(); - cInfo->movementId = fields[79].GetUInt32(); - cInfo->RegenHealth = fields[80].GetBool(); - cInfo->MechanicImmuneMask = fields[81].GetUInt32(); - cInfo->flags_extra = fields[82].GetUInt32(); - cInfo->ScriptID = sObjectMgr->GetScriptId(fields[83].GetCString()); + cInfo->resistance[i] = fields[48 + i -1].GetUInt16(); + + for (uint8 i = 0; i < CREATURE_MAX_SPELLS; ++i) + cInfo.spells[i] = fields[54 + i].GetUInt32(); + + cInfo->PetSpellDataId = fields[62].GetUInt32(); + cInfo->VehicleId = fields[63].GetUInt32(); + cInfo->mingold = fields[64].GetUInt32(); + cInfo->maxgold = fields[65].GetUInt32(); + cInfo->AIName = fields[66].GetString(); + cInfo->MovementType = fields[67].GetUInt8(); + cInfo->InhabitType = fields[68].GetUInt8(); + cInfo->HoverHeight = fields[69].GetFloat(); + cInfo->ModHealth = fields[70].GetFloat(); + cInfo->ModMana = fields[71].GetFloat(); + cInfo->ModManaExtra = fields[72].GetFloat(); + cInfo->ModArmor = fields[73].GetFloat(); + cInfo->RacialLeader = fields[74].GetBool(); + + for (uint8 i = 0; i < MAX_CREATURE_QUEST_ITEMS; ++i) + cInfo.questItems[i] = fields[75 + i].GetUInt32(); + + cInfo->movementId = fields[81].GetUInt32(); + cInfo->RegenHealth = fields[82].GetBool(); + cInfo->MechanicImmuneMask = fields[83].GetUInt32(); + cInfo->flags_extra = fields[84].GetUInt32(); + cInfo->ScriptID = sObjectMgr->GetScriptId(fields[85].GetCString()); sObjectMgr->CheckCreatureTemplate(cInfo); } diff --git a/src/server/shared/Database/Implementation/WorldDatabase.cpp b/src/server/shared/Database/Implementation/WorldDatabase.cpp index 8466e75bad2..94c01dd6569 100644 --- a/src/server/shared/Database/Implementation/WorldDatabase.cpp +++ b/src/server/shared/Database/Implementation/WorldDatabase.cpp @@ -78,7 +78,7 @@ void WorldDatabaseConnection::DoPrepareStatements() PrepareStatement(WORLD_INS_CREATURE_TRANSPORT, "INSERT INTO creature_transport (guid, npc_entry, transport_entry, TransOffsetX, TransOffsetY, TransOffsetZ, TransOffsetO) values (?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); PrepareStatement(WORLD_UPD_CREATURE_TRANSPORT_EMOTE, "UPDATE creature_transport SET emote = ? WHERE transport_entry = ? AND guid = ?", CONNECTION_ASYNC); PrepareStatement(WORLD_SEL_COMMANDS, "SELECT name, security, help FROM command", CONNECTION_SYNCH); - PrepareStatement(WORLD_SEL_CREATURE_TEMPLATE, "SELECT difficulty_entry_1, difficulty_entry_2, difficulty_entry_3, KillCredit1, KillCredit2, modelid1, modelid2, modelid3, modelid4, name, subname, IconName, gossip_menu_id, minlevel, maxlevel, exp, faction_A, faction_H, npcflag, speed_walk, speed_run, scale, rank, mindmg, maxdmg, dmgschool, attackpower, dmg_multiplier, baseattacktime, rangeattacktime, unit_class, unit_flags, unit_flags2, dynamicflags, family, trainer_type, trainer_class, trainer_race, minrangedmg, maxrangedmg, rangedattackpower, type, type_flags, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, PetSpellDataId, VehicleId, mingold, maxgold, AIName, MovementType, InhabitType, HoverHeight, Health_mod, Mana_mod, Mana_mod_extra, Armor_mod, RacialLeader, questItem1, questItem2, questItem3, questItem4, questItem5, questItem6, movementId, RegenHealth, mechanic_immune_mask, flags_extra, ScriptName FROM creature_template WHERE entry = ?", CONNECTION_SYNCH); + PrepareStatement(WORLD_SEL_CREATURE_TEMPLATE, "SELECT difficulty_entry_1, difficulty_entry_2, difficulty_entry_3, KillCredit1, KillCredit2, modelid1, modelid2, modelid3, modelid4, name, subname, IconName, gossip_menu_id, minlevel, maxlevel, exp, exp_unk, faction_A, faction_H, npcflag, speed_walk, speed_run, scale, rank, mindmg, maxdmg, dmgschool, attackpower, dmg_multiplier, baseattacktime, rangeattacktime, unit_class, unit_flags, unit_flags2, dynamicflags, family, trainer_type, trainer_class, trainer_race, minrangedmg, maxrangedmg, rangedattackpower, type, type_flags, type_flags2, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, PetSpellDataId, VehicleId, mingold, maxgold, AIName, MovementType, InhabitType, HoverHeight, Health_mod, Mana_mod, Mana_mod_extra, Armor_mod, RacialLeader, questItem1, questItem2, questItem3, questItem4, questItem5, questItem6, movementId, RegenHealth, mechanic_immune_mask, flags_extra, ScriptName FROM creature_template WHERE entry = ?", CONNECTION_SYNCH); PrepareStatement(WORLD_SEL_WAYPOINT_SCRIPT_BY_ID, "SELECT guid, delay, command, datalong, datalong2, dataint, x, y, z, o FROM waypoint_scripts WHERE id = ?", CONNECTION_SYNCH); PrepareStatement(WORLD_SEL_IP2NATION_COUNTRY, "SELECT c.country FROM ip2nationCountries c, ip2nation i WHERE i.ip < ? AND c.code = i.country ORDER BY i.ip DESC LIMIT 0,1", CONNECTION_SYNCH); PrepareStatement(WORLD_SEL_ITEM_TEMPLATE_BY_NAME, "SELECT entry FROM item_template WHERE name = ?", CONNECTION_SYNCH); -- cgit v1.2.3 From 37101c82d3b06431726d15d33439744c756c4664 Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 2 Mar 2013 16:54:19 +0000 Subject: Fix typo introduced in previous commit --- src/server/scripts/Commands/cs_reload.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp index 5211568b096..cd01711980e 100644 --- a/src/server/scripts/Commands/cs_reload.cpp +++ b/src/server/scripts/Commands/cs_reload.cpp @@ -430,10 +430,10 @@ public: Field* fields = result->Fetch(); for (uint8 i = 0; i < MAX_DIFFICULTY - 1; ++i) - cInfo.DifficultyEntry[i] = fields[0 + i].GetUInt32(); + cInfo->DifficultyEntry[i] = fields[0 + i].GetUInt32(); for (uint8 i = 0; i < MAX_KILL_CREDIT; ++i) - cInfo.KillCredit[i] = fields[3 + i].GetUInt32(); + cInfo->KillCredit[i] = fields[3 + i].GetUInt32(); cInfo->Modelid1 = fields[5].GetUInt32(); cInfo->Modelid2 = fields[6].GetUInt32(); @@ -483,7 +483,7 @@ public: cInfo->resistance[i] = fields[48 + i -1].GetUInt16(); for (uint8 i = 0; i < CREATURE_MAX_SPELLS; ++i) - cInfo.spells[i] = fields[54 + i].GetUInt32(); + cInfo->spells[i] = fields[54 + i].GetUInt32(); cInfo->PetSpellDataId = fields[62].GetUInt32(); cInfo->VehicleId = fields[63].GetUInt32(); @@ -500,7 +500,7 @@ public: cInfo->RacialLeader = fields[74].GetBool(); for (uint8 i = 0; i < MAX_CREATURE_QUEST_ITEMS; ++i) - cInfo.questItems[i] = fields[75 + i].GetUInt32(); + cInfo->questItems[i] = fields[75 + i].GetUInt32(); cInfo->movementId = fields[81].GetUInt32(); cInfo->RegenHealth = fields[82].GetBool(); -- cgit v1.2.3 From 5ed840139279fcff2a70a30068766836716bce4c Mon Sep 17 00:00:00 2001 From: Warpten Date: Sun, 3 Mar 2013 09:37:37 +0100 Subject: Spells/Warlock: Fixed Unstable Affliction's backfire damage. --- src/server/scripts/Spells/spell_warlock.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 92d8e940a22..e682322f37b 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -997,7 +997,7 @@ class spell_warl_unstable_affliction : public SpellScriptLoader void HandleDispel(DispelInfo* dispelInfo) { if (Unit* caster = GetCaster()) - if (AuraEffect const* aurEff = GetEffect(EFFECT_0)) + if (AuraEffect const* aurEff = GetEffect(EFFECT_1)) { int32 damage = aurEff->GetAmount() * 9; // backfire damage and silence -- cgit v1.2.3 From 671c50354d7d082bdeedf842884cd254d685d22a Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 3 Mar 2013 15:47:38 +0100 Subject: Core/PacketIO: Updated and enabled CMSG_BUG & CMSG_CALENDAR_COMPLAIN --- src/server/game/Handlers/CalendarHandler.cpp | 5 +++-- src/server/game/Handlers/MiscHandler.cpp | 6 ++++-- src/server/game/Server/Protocol/Opcodes.cpp | 4 ++-- 3 files changed, 9 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/server/game/Handlers/CalendarHandler.cpp b/src/server/game/Handlers/CalendarHandler.cpp index 8b854731b57..a3f45a8773c 100644 --- a/src/server/game/Handlers/CalendarHandler.cpp +++ b/src/server/game/Handlers/CalendarHandler.cpp @@ -617,10 +617,11 @@ void WorldSession::HandleCalendarComplain(WorldPacket& recvData) uint64 guid = _player->GetGUID(); uint64 eventId; uint64 complainGUID; + uint64 inviteId; - recvData >> eventId >> complainGUID; + recvData >> complainGUID >> eventId >> inviteId; sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_CALENDAR_COMPLAIN [" UI64FMTD "] EventId [" - UI64FMTD "] guid [" UI64FMTD "]", guid, eventId, complainGUID); + UI64FMTD "] guid [" UI64FMTD "] InviteId [" UI64FMTD "]", guid, eventId, complainGUID, inviteId); // what to do with complains? } diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index b7b5330921f..8c0cf1a15d8 100644 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -708,9 +708,11 @@ void WorldSession::HandleBugOpcode(WorldPacket& recvData) uint32 suggestion, contentlen, typelen; std::string content, type; - recvData >> suggestion >> contentlen >> content; + recvData >> suggestion >> contentlen; + content = recvData.ReadString(contentlen); - recvData >> typelen >> type; + recvData >> typelen; + type = recvData.ReadString(typelen); if (suggestion == 0) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_BUG [Bug Report]"); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index b1d069c6ae0..05f72fc3e93 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -111,14 +111,14 @@ void OpcodeTable::Initialize() DEFINE_OPCODE_HANDLER(CMSG_BATTLEMASTER_JOIN_RATED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER(CMSG_BEGIN_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBeginTradeOpcode ); DEFINE_OPCODE_HANDLER(CMSG_BINDER_ACTIVATE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBinderActivateOpcode ); - DEFINE_OPCODE_HANDLER(CMSG_BUG, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleBugOpcode ); + DEFINE_OPCODE_HANDLER(CMSG_BUG, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBugOpcode ); DEFINE_OPCODE_HANDLER(CMSG_BUSY_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBusyTradeOpcode ); DEFINE_OPCODE_HANDLER(CMSG_BUYBACK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuybackItem ); DEFINE_OPCODE_HANDLER(CMSG_BUY_BANK_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyBankSlotOpcode ); DEFINE_OPCODE_HANDLER(CMSG_BUY_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuyItemOpcode ); DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_ADD_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarAddEvent ); DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_ARENA_TEAM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarArenaTeam ); - DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_COMPLAIN, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarComplain ); + DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_COMPLAIN, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarComplain ); DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_COPY_EVENT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarCopyEvent ); DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_INVITE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventInvite ); DEFINE_OPCODE_HANDLER(CMSG_CALENDAR_EVENT_MODERATOR_STATUS, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCalendarEventModeratorStatus); -- cgit v1.2.3 From 3c222d0ae3d55440864e3a52ac2944b008a8ec8f Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Mon, 4 Mar 2013 19:17:51 +0100 Subject: Fix merge fail --- src/server/game/Entities/Player/Player.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 5f13fd0d33a..c708179fe04 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1675,7 +1675,7 @@ class Player : public Unit, public GridObject void setRegenTimerCount(uint32 time) {m_regenTimerCount = time;} void setWeaponChangeTimer(uint32 time) {m_weaponChangeTimer = time;} - uint64 GetMoney() const { return GetUInt32Value(PLAYER_FIELD_COINAGE); } + uint64 GetMoney() const { return GetUInt64Value(PLAYER_FIELD_COINAGE); } bool ModifyMoney(int64 amount, bool sendError = true); bool HasEnoughMoney(uint64 amount) const { return (GetMoney() >= amount); } bool HasEnoughMoney(int64 amount) const; -- cgit v1.2.3 From 11764233c56ed612a043ff2240c6d8fa738d01f3 Mon Sep 17 00:00:00 2001 From: Warpten Date: Sun, 10 Mar 2013 23:05:54 +0100 Subject: Core/Spells: Fixed removing glyphs. --- src/server/game/Spells/SpellEffects.cpp | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 6004888fdda..b62dc1c62ab 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -4197,13 +4197,13 @@ void Spell::EffectApplyGlyph(SpellEffIndex effIndex) } // apply new one - if (uint32 glyph = m_spellInfo->Effects[effIndex].MiscValue) + if (uint32 newGlyph = m_spellInfo->Effects[effIndex].MiscValue) { - if (GlyphPropertiesEntry const* gp = sGlyphPropertiesStore.LookupEntry(glyph)) + if (GlyphPropertiesEntry const* newGlyphProperties = sGlyphPropertiesStore.LookupEntry(newGlyph)) { - if (GlyphSlotEntry const* gs = sGlyphSlotStore.LookupEntry(player->GetGlyphSlot(m_glyphIndex))) + if (GlyphSlotEntry const* newGlyphSlot = sGlyphSlotStore.LookupEntry(player->GetGlyphSlot(m_glyphIndex))) { - if (gp->TypeFlags != gs->TypeFlags) + if (newGlyphProperties->TypeFlags != newGlyphSlot->TypeFlags) { SendCastResult(SPELL_FAILED_INVALID_GLYPH); return; // glyph slot mismatch @@ -4211,17 +4211,26 @@ void Spell::EffectApplyGlyph(SpellEffIndex effIndex) } // remove old glyph - if (uint32 oldglyph = player->GetGlyph(player->GetActiveSpec(), m_glyphIndex)) + if (uint32 oldGlyph = player->GetGlyph(player->GetActiveSpec(), m_glyphIndex)) { - if (GlyphPropertiesEntry const* old_gp = sGlyphPropertiesStore.LookupEntry(oldglyph)) + if (GlyphPropertiesEntry const* oldGlyphProperties = sGlyphPropertiesStore.LookupEntry(oldGlyph)) { - player->RemoveAurasDueToSpell(old_gp->SpellId); + player->RemoveAurasDueToSpell(oldGlyphProperties->SpellId); player->SetGlyph(m_glyphIndex, 0); } } - player->CastSpell(m_caster, gp->SpellId, true); - player->SetGlyph(m_glyphIndex, glyph); + player->CastSpell(m_caster, newGlyphProperties->SpellId, true); + player->SetGlyph(m_glyphIndex, newGlyph); + player->SendTalentsInfoData(false); + } + } + else if (uint32 oldGlyph = player->GetGlyph(player->GetActiveSpec(), m_glyphIndex)) // Removing the glyph, get the old one + { + if (GlyphPropertiesEntry const* oldGlyphProperties = sGlyphPropertiesStore.LookupEntry(oldGlyph)) + { + player->RemoveAurasDueToSpell(oldGlyphProperties->SpellId); + player->SetGlyph(m_glyphIndex, 0); player->SendTalentsInfoData(false); } } -- cgit v1.2.3